Open
Conversation
Collaborator
|
📬 Published Alpha Packages:
|
Contributor
|
🚀 Styleguide deploy preview ready! Preview URL: https://69d817eaf90c2b9d0f18cc90--gamut-preview.netlify.app |
sh0ji
reviewed
Apr 10, 2026
| bg: 'primary', | ||
| color: 'background', | ||
| borderRadius: 'md', | ||
| }, |
Member
There was a problem hiding this comment.
sh0ji
reviewed
Apr 10, 2026
| if (disabled) return; | ||
|
|
||
| if (e.altKey && (e.key === 'ArrowDown' || e.key === 'Down')) { | ||
| e.preventDefault(); |
Member
There was a problem hiding this comment.
In Storybook, Alt + ArrowDown also navigates to the next story so I couldn't navigate to the calendar from the input that way. Adding e.stopPropagation() should fix that.
My first thought that this should be fixed in Storybook, not in the component, but I actually think it makes sense to fix here. This should override any app has a global Alt + ArrowDown bindings when it's directed at the input/segment.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Overview
Adds DatePicker to Gamut: a locale-aware, accessible date (or date range) picker with segmented inputs, a popover calendar, keyboard support, and optional composition via context.
Modes
selectedDate/setSelectedDate.startDate,endDate,setStartDate,setEndDate; optionalstartLabel/endLabel.Default UI vs composition
childrenfor layout only; composeDatePickerInputandDatePickerCalendar(calendar requiresDatePickercontext).Segmented inputs
Intl-based layout).Calendar & layout
xsbreakpoint up; one month on smaller viewports.Intl.Locale#getWeekInfo()(polyfill when needed), optionalweekStartsOnonDatePickerCalendar.Selection behavior
Disabled dates
disabledDates— unselectable days; integrated into range validation.Footer
Keyboard & focus
role="spinbutton"span (tabIndex={0}when enabled). Focus moves with Tab / Shift+Tab like normal focusable controls. **Arrow Left / Right ** moves focus within the segments. Arrow Up / Arrow Down steps the current segment up or down, clamped to min/max for that field. Month: 1–12. Day: 1–last day of month when month/year are known. Year: 1–9999; if empty, stepping uses sensible defaults (e.g. current year when stepping up from empty on year).Accessibility
role="dialog"with configurablearia-label.role="group";FormGroupassociates the visible label with the first segment viahtmlFor/id.:focus-withinso the field still shows focus when any inner segment is focused.role="spinbutton", matching Arrow Up/Down stepping and numeric min/max.aria-valuemin/aria-valuemax— match spin bounds (day max depends on month/year when known).aria-valuenow— when there is a numeric value; omitted when empty.aria-valuetext— display string (digits or placeholders likeMM/DD/YYYY).aria-label— field name (month,day,year).aria-invalid— validation/error state.aria-disabledandtabIndex={-1}when disabled.Internationalization
localeusesIntl.LocalesArgument, defaults to runtime locale but ability to override vialocaleproptranslationsfor clear button, field labels, and dialog label. default values in English but ability to override viatranslationspropweekStartsOnuses Intl.Locale#getWeekInfo() (polyfill when needed) but ability to override viaweekStartsOnpropIntl.DateTimeFormatIntl.RelativeTimeFormatOther
inputSizepasses through toInputsizein the default layout.Things I know are missing/not completely working:
PR Checklist
Testing Instructions
Don't make me tap the sign.
PR Links and Envs