Date Picker
1.0.0
The date picker is really great!
Structure
- Fieldset legend: Legend for fieldset group
<legend>
See form inputs - Form label and input: Label for each form input
<label for>
See form inputs - Calendar button: See buttons.
- Horizontal spacing:
2 XS
See spacing - Vertical spacing:
3 SM
See spacing - Calendar picker dropdown: TBD.
Validation
- Group label: See form inputs.
- Field label and input: See form inputs.
- Error message: One error message positioned below form inputs. See form inputs and behaviour.
- Stacked positioning: Stacked layout error message sits below form inputs.
Behaviour
- The error must not be shown when the user is tabbing between the day, month and year inputs.
- Only trigger validation when the user moves focus away from all three inputs. Consider using
FocusEvent.relatedTarget
./ (see MDN web docs FocusEvent.relatedTarget).
Stacked
- Default state: Stacked layout for screen resolution
@media screen and (max-width: 258px)
only - Error state: Error message sits below the component
Accessibility
- Do not hijack the cursor by automatically moving the cursor to the next input. The user must always be in control.
- Validation message must specify which field is in error state (eg ‘Please enter a valid day and year’), and must not rely on colour alone to indicate error state.
- All form input validation for date picker inherit from form inputs.
References
Type | Resource | Status |
---|---|---|
Design | RAADS (Figma) | TBD |