feat(DatePicker): New DatePicker component#3286
Conversation
|
@sh0ji re focus ring transition: this is our default gamut focus ring. do you want me to override it for this case or can i cut a separate ticket to update the focus ring opacity transition across the board? |
dreamwasp
left a comment
There was a problem hiding this comment.
have a couple comments but looking good overall!
| @@ -0,0 +1,115 @@ | |||
| /** | |||
There was a problem hiding this comment.
could you get the robot to add tests for these longer util functions
There was a problem hiding this comment.
yeah im going to tackle tests separately and everything will have tests
| range && isDateInRange(date, selectedDate, endDate); | ||
| const disabled = isDateDisabled(date, disabledDates); | ||
| const today = isToday(date); | ||
| // this is making the selected date a differnet color bc it is focused, look into further |
There was a problem hiding this comment.
idk if you want to get nitty gritty w/ it, but comment here
|
📬 Published Alpha Packages:
|
|
🚀 Styleguide deploy preview ready! Preview URL: https://69d3ee242142547e479a95d5--gamut-preview.netlify.app |
Overview
Adds DatePicker to Gamut: a locale-aware, accessible date (or date range) picker with text 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).Text input
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
Accessibility
role="dialog"with configurablearia-label.role="combobox"witharia-expanded,aria-controls,aria-haspopup,aria-autocomplete="none".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