Financial-Times / origami

The Origami Component System
52 stars 14 forks source link

Rationalise Date Inputs #248

Open notlee opened 2 years ago

notlee commented 2 years ago

Rationalise Date Inputs

Find examples of date inputs in ft products and document recommended components/patterns to use. This may result in creating new components, such as a date picker. Currently the only date input documented in Origami is the text-based date input found in o-forms.

motivation

o-forms includes a text-based date input but there are valid reasons to use other date input interfaces. A date picker, for example, is a helpful interface if the user doesn't already know the date to input but context would help them find it: a week ago, next monday, etc. Origami doesn't cater to these use-cases which has lead to repeated work and inconsistent implementations.

Continuing the date picker example there are inconsistent uses by multiple projects, internal and external. Some are native date pickers, which aren't supported by all browsers the FT supports and may not be accessible, and others are custom.

work required

With the design teams support:

supporting examples

Native date picker on ft.com search (no date picker in some browsers, e.g. Safari): native date picker on ft.com search Native date picker on the interactive graphics covid tracker (falls back to multiple select boxes in Safari): native date picker on the interactive graphics covid tracke fallback select box date picker on the interactive graphics covid tracker

Custom date picker in Spark CMS: custom date picker in Spark CMS

o-forms date input in the catering app: o-forms date input in the catering app

notlee commented 2 years ago

Moved from PR: https://github.com/Financial-Times/origami/pull/113