Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split time input component (with subfields for each part) #7104

Open
23 tasks
rolfsmeds opened this issue Dec 11, 2024 · 0 comments
Open
23 tasks

Split time input component (with subfields for each part) #7104

rolfsmeds opened this issue Dec 11, 2024 · 0 comments
Labels
acceptance criteria used for the acceptance criteria checklist DS Design System feature (e.g. component)

Comments

@rolfsmeds
Copy link
Collaborator

rolfsmeds commented Dec 11, 2024

Description

An alternative to TimePicker composed of 2+ sub-fields for hours, minutes, seconds, etc, with support for text entry, dropdown selection and spinner (up & down arrows) for setting the value in each.

image

Also see #7105

Motivation

The TimePicker component is a bit limiting in that it represents time as a single unitary field, and provides a single dropdown for selecting both hours and minutes. In many use cases, a field split into hours, minutes, seconds etc, with either dropdowns or spinners for each, can be more convenient.

Acceptance criteria

  • Split-field similar to DateTimePicker
  • Configurable to 24 or 12 hour format
    • 12 hour format provides am/pm toggle
    • Default based on locale
  • Configurable resolution: minutes or seconds (millisecond support could be added later)
  • Can be configured to render sub-fields as either
    • Combo-boxes with autogenerated values, or
    • Spinners (up & down arrows increment/decrement)
  • Allows specifying a step size for each part
    • Step size only affects dropdown options / spinner steps, not validation
  • Configurable to auto-increment to the next sub-field after filling in valid value in current sub-field
  • Clear button at the end (non-focusable, with Esc as kbd-equivalent)
  • i18n:
    • Sub-field placeholders
    • Sub-field aria-labels that are automatically prefixed with root label/aria-label

Possible later enhancements

  • API for providing a callback function that evaluates valid values in each sub-field (this would allow e.g. updating available minute options based on the currently selected hour)
  • Style variant that looks like a single unitary field (with separator chars instead of gaps between subfields)

General criteria

  • APIs reviewed
  • Design
  • Performance
  • UX/DX tests in Alpha
  • Documentation:
  • How to test?
  • Limitations:

Security

  • Security implications have been taken into account (elaborate or link to product security requirement specification if there are implications)
@rolfsmeds rolfsmeds added the acceptance criteria used for the acceptance criteria checklist label Dec 11, 2024
@rolfsmeds rolfsmeds changed the title TimeField component (with subfields for each part) Split time input component (with subfields for each part) Dec 11, 2024
@rolfsmeds rolfsmeds added the DS Design System feature (e.g. component) label Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
acceptance criteria used for the acceptance criteria checklist DS Design System feature (e.g. component)
Projects
None yet
Development

No branches or pull requests

1 participant