jaci-ui 0.9.4 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -0
- package/README.md +11 -1
- package/dist/_virtual/_rolldown/runtime.cjs +1 -1
- package/dist/components/accordion/accordion.cjs.map +1 -1
- package/dist/components/accordion/accordion.js.map +1 -1
- package/dist/components/alert/alert.cjs.map +1 -1
- package/dist/components/alert/alert.js.map +1 -1
- package/dist/components/alert-dialog/alert-dialog.cjs.map +1 -1
- package/dist/components/alert-dialog/alert-dialog.js.map +1 -1
- package/dist/components/aspect-ratio/aspect-ratio.cjs.map +1 -1
- package/dist/components/avatar/avatar.cjs.map +1 -1
- package/dist/components/avatar/avatar.js.map +1 -1
- package/dist/components/breadcrumbs/breadcrumbs.cjs.map +1 -1
- package/dist/components/button/button.cjs +1 -0
- package/dist/components/button/button.cjs.map +1 -1
- package/dist/components/button/button.d.cts +2 -1
- package/dist/components/button/button.d.ts +2 -1
- package/dist/components/button/button.js +1 -0
- package/dist/components/button/button.js.map +1 -1
- package/dist/components/button-group/button-group.cjs.map +1 -1
- package/dist/components/calendar/calendar.cjs +4 -6
- package/dist/components/calendar/calendar.cjs.map +1 -1
- package/dist/components/calendar/calendar.js +4 -6
- package/dist/components/calendar/calendar.js.map +1 -1
- package/dist/components/card/card.cjs.map +1 -1
- package/dist/components/carousel/carousel.cjs.map +1 -1
- package/dist/components/carousel/carousel.js.map +1 -1
- package/dist/components/checkbox-group/checkbox-group.cjs +7 -3
- package/dist/components/checkbox-group/checkbox-group.cjs.map +1 -1
- package/dist/components/checkbox-group/checkbox-group.js +7 -3
- package/dist/components/checkbox-group/checkbox-group.js.map +1 -1
- package/dist/components/code/code.cjs.map +1 -1
- package/dist/components/code/code.js.map +1 -1
- package/dist/components/collapsible/collapsible.cjs.map +1 -1
- package/dist/components/collapsible/collapsible.js.map +1 -1
- package/dist/components/color-picker/color-picker.cjs.map +1 -1
- package/dist/components/color-picker/color-picker.js.map +1 -1
- package/dist/components/color-picker/color-utils.cjs +5 -3
- package/dist/components/color-picker/color-utils.cjs.map +1 -1
- package/dist/components/color-picker/color-utils.js +5 -3
- package/dist/components/color-picker/color-utils.js.map +1 -1
- package/dist/components/color-swatch/color-swatch.cjs.map +1 -1
- package/dist/components/combobox/combobox.cjs +2 -1
- package/dist/components/combobox/combobox.cjs.map +1 -1
- package/dist/components/combobox/combobox.js +2 -1
- package/dist/components/combobox/combobox.js.map +1 -1
- package/dist/components/command/command.cjs.map +1 -1
- package/dist/components/command/command.js.map +1 -1
- package/dist/components/context-menu/context-menu.cjs.map +1 -1
- package/dist/components/context-menu/context-menu.d.cts +2 -2
- package/dist/components/context-menu/context-menu.d.ts +2 -2
- package/dist/components/controls/checkbox.cjs.map +1 -1
- package/dist/components/controls/checkbox.js.map +1 -1
- package/dist/components/controls/input.cjs.map +1 -1
- package/dist/components/controls/input.js.map +1 -1
- package/dist/components/controls/radio.cjs.map +1 -1
- package/dist/components/controls/switch.cjs.map +1 -1
- package/dist/components/controls/switch.js.map +1 -1
- package/dist/components/controls/textarea.cjs.map +1 -1
- package/dist/components/controls/textarea.js.map +1 -1
- package/dist/components/copyable/copyable.cjs.map +1 -1
- package/dist/components/copyable/copyable.js.map +1 -1
- package/dist/components/data-toolbar/data-toolbar.cjs.map +1 -1
- package/dist/components/data-toolbar/data-toolbar.js.map +1 -1
- package/dist/components/data-view/data-view.cjs.map +1 -1
- package/dist/components/date-picker/date-picker.cjs +4 -7
- package/dist/components/date-picker/date-picker.cjs.map +1 -1
- package/dist/components/date-picker/date-picker.js +4 -7
- package/dist/components/date-picker/date-picker.js.map +1 -1
- package/dist/components/date-range-picker/date-range-picker.cjs +4 -6
- package/dist/components/date-range-picker/date-range-picker.cjs.map +1 -1
- package/dist/components/date-range-picker/date-range-picker.js +4 -6
- package/dist/components/date-range-picker/date-range-picker.js.map +1 -1
- package/dist/components/dialog/dialog.cjs.map +1 -1
- package/dist/components/dialog/dialog.js.map +1 -1
- package/dist/components/download-trigger/download-trigger.cjs.map +1 -1
- package/dist/components/drawer/drawer.cjs.map +1 -1
- package/dist/components/drawer/drawer.js.map +1 -1
- package/dist/components/empty-state/empty-state.cjs.map +1 -1
- package/dist/components/feedback/badge.cjs.map +1 -1
- package/dist/components/field/field.cjs.map +1 -1
- package/dist/components/field/field.js.map +1 -1
- package/dist/components/fieldset/fieldset.cjs.map +1 -1
- package/dist/components/figure/figure.cjs.map +1 -1
- package/dist/components/figure/figure.js.map +1 -1
- package/dist/components/form/form.cjs.map +1 -1
- package/dist/components/form/form.js.map +1 -1
- package/dist/components/icon-button/icon-button.cjs.map +1 -1
- package/dist/components/icon-button/icon-button.js.map +1 -1
- package/dist/components/image/image.cjs.map +1 -1
- package/dist/components/image/image.js.map +1 -1
- package/dist/components/input-group/input-group.cjs.map +1 -1
- package/dist/components/kbd/kbd.cjs.map +1 -1
- package/dist/components/layout/index.cjs.map +1 -1
- package/dist/components/list/list.cjs.map +1 -1
- package/dist/components/menu/menu.cjs.map +1 -1
- package/dist/components/menu/menu.d.cts +2 -2
- package/dist/components/menu/menu.d.ts +2 -2
- package/dist/components/menubar/menubar.cjs.map +1 -1
- package/dist/components/menubar/menubar.d.cts +2 -2
- package/dist/components/menubar/menubar.d.ts +2 -2
- package/dist/components/menubar/menubar.js.map +1 -1
- package/dist/components/meter/meter.cjs.map +1 -1
- package/dist/components/meter/meter.js.map +1 -1
- package/dist/components/navigation/navigation.cjs.map +1 -1
- package/dist/components/navigation/navigation.js.map +1 -1
- package/dist/components/navigation-menu/navigation-menu.cjs.map +1 -1
- package/dist/components/navigation-menu/navigation-menu.js.map +1 -1
- package/dist/components/number-field/number-field.cjs +2 -1
- package/dist/components/number-field/number-field.cjs.map +1 -1
- package/dist/components/number-field/number-field.js +2 -1
- package/dist/components/number-field/number-field.js.map +1 -1
- package/dist/components/option-selector/option-selector.cjs.map +1 -1
- package/dist/components/option-selector/option-selector.js.map +1 -1
- package/dist/components/pagination/pagination.cjs.map +1 -1
- package/dist/components/pagination/pagination.js.map +1 -1
- package/dist/components/pin-input/pin-input.cjs.map +1 -1
- package/dist/components/pin-input/pin-input.js.map +1 -1
- package/dist/components/popover/popover.cjs.map +1 -1
- package/dist/components/popover/popover.js.map +1 -1
- package/dist/components/progress/progress.cjs.map +1 -1
- package/dist/components/progress/progress.js.map +1 -1
- package/dist/components/qr-code/qr-code.cjs.map +1 -1
- package/dist/components/qr-code/qr-code.js.map +1 -1
- package/dist/components/quote/quote.cjs.map +1 -1
- package/dist/components/quote/quote.js.map +1 -1
- package/dist/components/radio-group/radio-group.cjs +7 -3
- package/dist/components/radio-group/radio-group.cjs.map +1 -1
- package/dist/components/radio-group/radio-group.js +7 -3
- package/dist/components/radio-group/radio-group.js.map +1 -1
- package/dist/components/range-slider/range-slider.cjs.map +1 -1
- package/dist/components/range-slider/range-slider.js.map +1 -1
- package/dist/components/scroll-area/scroll-area.cjs.map +1 -1
- package/dist/components/select/select.cjs.map +1 -1
- package/dist/components/select/select.js.map +1 -1
- package/dist/components/sidebar/sidebar.cjs.map +1 -1
- package/dist/components/sidebar/sidebar.js.map +1 -1
- package/dist/components/skeleton/skeleton.cjs.map +1 -1
- package/dist/components/slider/slider.cjs.map +1 -1
- package/dist/components/slider/slider.js.map +1 -1
- package/dist/components/spacer/spacer.cjs.map +1 -1
- package/dist/components/stat/stat.cjs.map +1 -1
- package/dist/components/stat/stat.js.map +1 -1
- package/dist/components/stepper/stepper.cjs +2 -1
- package/dist/components/stepper/stepper.cjs.map +1 -1
- package/dist/components/stepper/stepper.js +2 -1
- package/dist/components/stepper/stepper.js.map +1 -1
- package/dist/components/table/table.cjs.map +1 -1
- package/dist/components/table/table.js.map +1 -1
- package/dist/components/tabs/tabs.cjs.map +1 -1
- package/dist/components/tabs/tabs.js.map +1 -1
- package/dist/components/tags-input/tags-input.cjs +10 -9
- package/dist/components/tags-input/tags-input.cjs.map +1 -1
- package/dist/components/tags-input/tags-input.js +10 -9
- package/dist/components/tags-input/tags-input.js.map +1 -1
- package/dist/components/toast/toast.cjs.map +1 -1
- package/dist/components/toast/toast.js.map +1 -1
- package/dist/components/toggle/toggle.cjs.map +1 -1
- package/dist/components/toggle-group/toggle-group.cjs.map +1 -1
- package/dist/components/toolbar/toolbar.cjs.map +1 -1
- package/dist/components/tooltip/tooltip.cjs.map +1 -1
- package/dist/components/tree-view/tree-view.cjs.map +1 -1
- package/dist/components/tree-view/tree-view.js.map +1 -1
- package/dist/components/typography/heading.cjs.map +1 -1
- package/dist/components/typography/link.cjs.map +1 -1
- package/dist/components/typography/paragraph.cjs.map +1 -1
- package/dist/components/typography/text.cjs.map +1 -1
- package/dist/components/upload/upload.cjs +2 -2
- package/dist/components/upload/upload.cjs.map +1 -1
- package/dist/components/upload/upload.js +2 -2
- package/dist/components/upload/upload.js.map +1 -1
- package/dist/components/visually-hidden/visually-hidden.cjs.map +1 -1
- package/dist/panda-preset.cjs.map +1 -1
- package/dist/styles/theme.cjs +18 -18
- package/dist/styles/theme.cjs.map +1 -1
- package/dist/styles/theme.js +18 -18
- package/dist/styles/theme.js.map +1 -1
- package/dist/styles.css +12 -21
- package/dist/theme/theme-provider.cjs.map +1 -1
- package/dist/theme/theme-provider.js.map +1 -1
- package/dist/theme/theme-scope.cjs.map +1 -1
- package/package.json +9 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-picker.cjs","names":["startOfMonth","datePicker","isBeforeDay","isAfterDay","createCalendarDate","isSameDay","addDays","dateKey","addMonths","toTimeInput","formatDateLabel","BasePopover","toInputMonth","toInputDateTime","toInputDate","cx","withRecipeClassName","useThemePortalProps","formatMonthLabel","getMonthLabels","getDateRangeLabel","getCalendarDays","getWeekdayLabels"],"sources":["../../../src/components/date-picker/date-picker.tsx"],"sourcesContent":["\"use client\";\n\nimport { Popover as BasePopover } from \"@base-ui/react/popover\";\nimport {\n createContext,\n forwardRef,\n useCallback,\n useContext,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport type { ComponentPropsWithoutRef, KeyboardEvent, MouseEvent, ReactNode, Ref } from \"react\";\nimport type { PopoverRoot as BasePopoverRoot } from \"@base-ui/react/popover\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { datePicker } from \"../../styled-system/recipes\";\nimport { withRecipeClassName } from \"../base-ui\";\nimport { useThemePortalProps } from \"../../theme/theme-scope\";\nimport {\n addDays,\n addMonths,\n createCalendarDate,\n dateKey,\n formatDateLabel,\n formatMonthLabel,\n getCalendarDays,\n getDateRangeLabel,\n getMonthLabels,\n getWeekdayLabels,\n isAfterDay,\n isBeforeDay,\n isSameDay,\n startOfMonth,\n toInputDate,\n toInputDateTime,\n toInputMonth,\n toTimeInput,\n} from \"./date-utils\";\nimport type { DatePickerGranularity } from \"./date-utils\";\n\nexport type DatePickerSize = \"sm\" | \"md\" | \"lg\";\nexport type { DatePickerGranularity } from \"./date-utils\";\n\nexport interface DatePickerYearRange {\n start: number;\n end: number;\n}\n\ninterface DatePickerContextValue {\n canNavigate: (amount: number) => boolean;\n close: () => void;\n dateDisabled: (date: Date) => boolean;\n granularity: DatePickerGranularity;\n disabled: boolean;\n focusDate: (date: Date, direction?: number) => void;\n focusedDate: Date;\n formatDate: (date: Date | null) => string;\n labelId: string;\n locale: string;\n month: Date;\n monthDisabled: (date: Date) => boolean;\n onClear: () => void;\n onTimeChange: (value: string) => void;\n onSelect: (date: Date) => void;\n selectMonth: (month: number) => void;\n selectYear: (year: number) => void;\n placeholder: ReactNode;\n registerDay: (key: string, node: HTMLButtonElement | null) => void;\n selected: Date | null;\n setFocusedDate: (date: Date) => void;\n setMonth: (date: Date) => void;\n size: DatePickerSize;\n styles: ReturnType<typeof datePicker>;\n today: Date;\n timeMax: string | undefined;\n timeMin: string | undefined;\n triggerId: string;\n weekStartsOn: number;\n yearRange: DatePickerYearRange;\n}\n\nconst DatePickerContext = createContext<DatePickerContextValue | null>(null);\n\nfunction useDatePickerContext() {\n const context = useContext(DatePickerContext);\n if (!context) {\n throw new Error(\"DatePicker parts must be rendered inside DatePicker.Root.\");\n }\n\n return context;\n}\n\nfunction isSameMonth(left: Date, right: Date) {\n return left.getFullYear() === right.getFullYear() && left.getMonth() === right.getMonth();\n}\n\nfunction composeRefs<T>(first: Ref<T> | undefined, second: (value: T | null) => void) {\n return (value: T | null) => {\n second(value);\n if (typeof first === \"function\") {\n first(value);\n } else if (first) {\n first.current = value;\n }\n };\n}\n\nexport interface DatePickerRootProps extends Omit<BasePopoverRoot.Props, \"children\"> {\n /** Selected value. Use together with `onValueChange` for a controlled picker. */\n value?: Date | null;\n /** Initial selected value for an uncontrolled picker. */\n defaultValue?: Date | null;\n /** Called after a valid day, month, or time is selected, or when the value is cleared. */\n onValueChange?: (value: Date | null) => void;\n /** Prevents dates before this local calendar day from being selected. */\n minDate?: Date;\n /** Prevents dates after this local calendar day from being selected. */\n maxDate?: Date;\n /** Adds application-specific disabled dates, such as holidays or weekends. */\n isDateDisabled?: (date: Date) => boolean;\n /** Locale used for month, weekday and value formatting. */\n locale?: string;\n /** Called after the visible calendar month changes. */\n onMonthChange?: (month: Date) => void;\n /** First weekday in the calendar, where 0 is Sunday and 1 is Monday. */\n weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6;\n /** Text shown when no date has been selected. */\n placeholder?: ReactNode;\n /** Shared visual size for the trigger and calendar days. */\n size?: DatePickerSize;\n /** Controls whether the picker selects days, months, or date and time. */\n granularity?: DatePickerGranularity;\n /** Inclusive range used by the year selector. */\n yearRange?: DatePickerYearRange;\n /** Reference date used when no value is selected, useful for deterministic SSR and tests. */\n referenceDate?: Date;\n /** Adds a native hidden input using the representation for the selected granularity. */\n name?: string;\n /** Prevents interaction and disables the hidden form input. */\n disabled?: boolean;\n /** Closes the popup after a value is chosen. Defaults to false for date-time mode and true otherwise. */\n closeOnSelect?: boolean;\n children?: ReactNode;\n}\n\nexport function DatePickerRoot({\n children,\n closeOnSelect: closeOnSelectProp,\n defaultValue = null,\n disabled = false,\n granularity = \"day\",\n isDateDisabled,\n locale = \"pt-BR\",\n maxDate,\n minDate,\n name,\n onValueChange,\n onMonthChange,\n placeholder = \"Select a date\",\n size = \"md\",\n value: controlledValue,\n weekStartsOn = 0,\n yearRange: configuredYearRange,\n referenceDate,\n actionsRef: externalActionsRef,\n ...popoverProps\n}: DatePickerRootProps) {\n const [uncontrolledValue, setUncontrolledValue] = useState<Date | null>(defaultValue);\n const selected = controlledValue === undefined ? uncontrolledValue : controlledValue;\n const [month, setMonthState] = useState(() =>\n startOfMonth(selected ?? referenceDate ?? new Date()),\n );\n const [focusedDate, setFocusedDate] = useState(selected ?? referenceDate ?? month);\n const previousMonthRef = useRef(month);\n const internalActionsRef = useRef<BasePopoverRoot.Actions | null>(null);\n const dayRefs = useRef(new Map<string, HTMLButtonElement>());\n const labelId = useId();\n const triggerId = useId();\n const today = useMemo(() => referenceDate ?? new Date(), [referenceDate]);\n const styles = datePicker({ size });\n const minMonth = minDate ? startOfMonth(minDate) : undefined;\n const maxMonth = maxDate ? startOfMonth(maxDate) : undefined;\n const closeOnSelect = closeOnSelectProp ?? granularity !== \"date-time\";\n const yearRange = useMemo(() => {\n const defaultStart = today.getFullYear() - 100;\n const defaultEnd = today.getFullYear() + 20;\n const start = configuredYearRange?.start ?? defaultStart;\n const end = configuredYearRange?.end ?? defaultEnd;\n const years = [selected?.getFullYear(), minDate?.getFullYear(), maxDate?.getFullYear()].filter(\n (year): year is number => year !== undefined,\n );\n return {\n end: Math.max(start, end, ...years),\n start: Math.min(start, end, ...years),\n };\n }, [configuredYearRange?.end, configuredYearRange?.start, maxDate, minDate, selected, today]);\n\n const clampMonth = useCallback(\n (nextMonth: Date) => {\n const normalized = startOfMonth(nextMonth);\n if (minMonth && isBeforeDay(normalized, minMonth)) return minMonth;\n if (maxMonth && isAfterDay(normalized, maxMonth)) return maxMonth;\n return normalized;\n },\n [maxMonth, minMonth],\n );\n\n const setMonth = useCallback(\n (nextMonth: Date) => {\n const normalized = clampMonth(nextMonth);\n setMonthState((current) => {\n if (isSameMonth(current, normalized)) return current;\n return normalized;\n });\n },\n [clampMonth],\n );\n\n useEffect(() => {\n if (isSameMonth(previousMonthRef.current, month)) return;\n previousMonthRef.current = month;\n onMonthChange?.(month);\n }, [month, onMonthChange]);\n\n useEffect(() => {\n if (!selected) {\n return;\n }\n\n setFocusedDate(selected);\n setMonthState((current) => (isSameMonth(current, selected) ? current : clampMonth(selected)));\n }, [clampMonth, selected]);\n\n const dateDisabled = useCallback(\n (date: Date) =>\n Boolean(\n (minDate && isBeforeDay(date, minDate)) ||\n (maxDate && isAfterDay(date, maxDate)) ||\n isDateDisabled?.(date),\n ),\n [isDateDisabled, maxDate, minDate],\n );\n\n const close = useCallback(() => {\n (externalActionsRef ?? internalActionsRef).current?.close();\n }, [externalActionsRef]);\n\n const setValue = useCallback(\n (nextValue: Date | null) => {\n if (controlledValue === undefined) setUncontrolledValue(nextValue);\n onValueChange?.(nextValue);\n },\n [controlledValue, onValueChange],\n );\n\n const monthDisabled = useCallback(\n (candidate: Date) => {\n const firstDay = startOfMonth(candidate);\n const lastDay = createCalendarDate(candidate.getFullYear(), candidate.getMonth() + 1, 0);\n return Boolean(\n (minDate && isBeforeDay(lastDay, minDate)) || (maxDate && isAfterDay(firstDay, maxDate)),\n );\n },\n [maxDate, minDate],\n );\n\n const onSelect = useCallback(\n (date: Date) => {\n if (disabled || (granularity === \"month\" ? monthDisabled(date) : dateDisabled(date))) {\n return;\n }\n\n const nextValue = createCalendarDate(\n date.getFullYear(),\n date.getMonth(),\n granularity === \"month\" ? 1 : date.getDate(),\n );\n if (granularity === \"date-time\") {\n nextValue.setHours(selected?.getHours() ?? 12, selected?.getMinutes() ?? 0, 0, 0);\n if (minDate && isSameDay(nextValue, minDate) && nextValue < minDate) {\n nextValue.setHours(minDate.getHours(), minDate.getMinutes(), 0, 0);\n }\n if (maxDate && isSameDay(nextValue, maxDate) && nextValue > maxDate) {\n nextValue.setHours(maxDate.getHours(), maxDate.getMinutes(), 0, 0);\n }\n }\n setValue(nextValue);\n setFocusedDate(nextValue);\n setMonth(startOfMonth(nextValue));\n if (closeOnSelect) {\n close();\n }\n },\n [\n close,\n closeOnSelect,\n dateDisabled,\n disabled,\n granularity,\n maxDate,\n monthDisabled,\n minDate,\n selected,\n setMonth,\n setValue,\n ],\n );\n\n const onClear = useCallback(() => {\n setValue(null);\n }, [setValue]);\n\n const selectMonth = useCallback(\n (monthIndex: number) => {\n const nextMonth = clampMonth(createCalendarDate(month.getFullYear(), monthIndex, 1));\n if (monthDisabled(nextMonth)) return;\n setMonth(nextMonth);\n if (granularity === \"month\") {\n const nextValue = createCalendarDate(nextMonth.getFullYear(), nextMonth.getMonth(), 1);\n setFocusedDate(nextValue);\n setValue(nextValue);\n if (closeOnSelect) close();\n }\n },\n [clampMonth, close, closeOnSelect, granularity, month, monthDisabled, setMonth, setValue],\n );\n\n const selectYear = useCallback(\n (year: number) => {\n const nextMonth = clampMonth(createCalendarDate(year, month.getMonth(), 1));\n if (monthDisabled(nextMonth)) return;\n setMonth(nextMonth);\n if (granularity === \"month\") {\n const nextValue = createCalendarDate(nextMonth.getFullYear(), nextMonth.getMonth(), 1);\n setFocusedDate(nextValue);\n setValue(nextValue);\n if (closeOnSelect) close();\n }\n },\n [clampMonth, close, closeOnSelect, granularity, month, monthDisabled, setMonth, setValue],\n );\n\n const onTimeChange = useCallback(\n (value: string) => {\n const match = value.match(/^(\\d{2}):(\\d{2})$/);\n if (!match) return;\n const hours = Number(match[1]);\n const minutes = Number(match[2]);\n if (hours > 23 || minutes > 59) return;\n const baseDate = selected ?? focusedDate;\n const nextValue = createCalendarDate(\n baseDate.getFullYear(),\n baseDate.getMonth(),\n baseDate.getDate(),\n );\n nextValue.setHours(hours, minutes, 0, 0);\n if (minDate && isSameDay(nextValue, minDate) && nextValue < minDate) return;\n if (maxDate && isSameDay(nextValue, maxDate) && nextValue > maxDate) return;\n setValue(nextValue);\n },\n [focusedDate, maxDate, minDate, selected, setValue],\n );\n\n const focusDate = useCallback(\n (date: Date, direction = 1) => {\n let nextDate = createCalendarDate(date.getFullYear(), date.getMonth(), date.getDate());\n const step = direction < 0 ? -1 : 1;\n let attempts = 0;\n while (dateDisabled(nextDate) && attempts < 366) {\n nextDate = addDays(nextDate, step);\n attempts += 1;\n }\n\n setFocusedDate(nextDate);\n setMonth(nextDate);\n\n const focusTarget = () => dayRefs.current.get(dateKey(nextDate))?.focus();\n focusTarget();\n queueMicrotask(focusTarget);\n },\n [dateDisabled, setMonth],\n );\n\n const canNavigate = useCallback(\n (amount: number) => {\n const nextMonth = addMonths(month, amount);\n return !(\n (minMonth && isBeforeDay(nextMonth, minMonth)) ||\n (maxMonth && isAfterDay(nextMonth, maxMonth))\n );\n },\n [maxMonth, minMonth, month],\n );\n\n const registerDay = useCallback((key: string, node: HTMLButtonElement | null) => {\n if (node) {\n dayRefs.current.set(key, node);\n } else {\n dayRefs.current.delete(key);\n }\n }, []);\n\n const timeMin =\n selected && minDate && isSameDay(selected, minDate) ? toTimeInput(minDate) : undefined;\n const timeMax =\n selected && maxDate && isSameDay(selected, maxDate) ? toTimeInput(maxDate) : undefined;\n\n const context: DatePickerContextValue = {\n canNavigate,\n close,\n dateDisabled,\n granularity,\n disabled,\n focusDate,\n focusedDate,\n formatDate: (date) => formatDateLabel(date, locale, String(placeholder), granularity),\n labelId,\n locale,\n month,\n monthDisabled,\n onClear,\n onTimeChange,\n onSelect,\n selectMonth,\n selectYear,\n placeholder,\n registerDay,\n selected,\n setFocusedDate,\n setMonth,\n size,\n styles,\n today: createCalendarDate(today.getFullYear(), today.getMonth(), today.getDate()),\n timeMax,\n timeMin,\n triggerId,\n weekStartsOn,\n yearRange,\n };\n\n return (\n <DatePickerContext.Provider value={context}>\n <BasePopover.Root {...popoverProps} actionsRef={externalActionsRef ?? internalActionsRef}>\n {children}\n </BasePopover.Root>\n {name ? (\n <input\n disabled={disabled}\n name={name}\n type=\"hidden\"\n value={\n granularity === \"month\"\n ? toInputMonth(selected)\n : granularity === \"date-time\"\n ? toInputDateTime(selected)\n : toInputDate(selected)\n }\n />\n ) : null}\n </DatePickerContext.Provider>\n );\n}\n\nexport type DatePickerLabelProps = ComponentPropsWithoutRef<\"label\">;\n\nexport const DatePickerLabel = forwardRef<HTMLLabelElement, DatePickerLabelProps>(\n function DatePickerLabel({ children, className, ...props }, ref) {\n const { labelId, styles, triggerId } = useDatePickerContext();\n\n return (\n <label\n {...props}\n ref={ref}\n className={cx(styles.label, className)}\n data-slot=\"date-picker-label\"\n htmlFor={props.htmlFor ?? triggerId}\n id={props.id ?? labelId}\n >\n {children}\n </label>\n );\n },\n);\n\nexport type DatePickerControlProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const DatePickerControl = forwardRef<HTMLDivElement, DatePickerControlProps>(\n function DatePickerControl({ className, ...props }, ref) {\n const { styles } = useDatePickerContext();\n\n return (\n <div\n {...props}\n ref={ref}\n className={cx(styles.control, className)}\n data-jaci-component=\"date-picker\"\n data-slot=\"date-picker-control\"\n />\n );\n },\n);\n\nexport type DatePickerTriggerProps = ComponentPropsWithoutRef<typeof BasePopover.Trigger>;\n\nexport const DatePickerTrigger = forwardRef<HTMLButtonElement, DatePickerTriggerProps>(\n function DatePickerTrigger({ children, className, disabled, id, ...props }, ref) {\n const { disabled: pickerDisabled, styles, triggerId } = useDatePickerContext();\n\n return (\n <BasePopover.Trigger\n {...props}\n aria-label={props[\"aria-label\"] ?? \"Choose date\"}\n disabled={disabled ?? pickerDisabled}\n id={id ?? triggerId}\n ref={ref}\n className={withRecipeClassName(styles.trigger, className)}\n data-jaci-component=\"date-picker\"\n data-slot=\"date-picker-trigger\"\n >\n {children ?? (\n <>\n <DatePickerValue />\n <span aria-hidden=\"true\">▾</span>\n </>\n )}\n </BasePopover.Trigger>\n );\n },\n);\n\nexport interface DatePickerValueProps extends ComponentPropsWithoutRef<\"span\"> {\n placeholder?: ReactNode;\n}\n\nexport const DatePickerValue = forwardRef<HTMLSpanElement, DatePickerValueProps>(\n function DatePickerValue({ children, className, placeholder, ...props }, ref) {\n const { formatDate, selected, styles } = useDatePickerContext();\n const value = children ?? (selected ? formatDate(selected) : (placeholder ?? \"Select a date\"));\n\n return (\n <span\n {...props}\n ref={ref}\n className={cx(styles.value, className)}\n data-placeholder={selected ? undefined : \"true\"}\n data-slot=\"date-picker-value\"\n >\n {value}\n </span>\n );\n },\n);\n\nexport type DatePickerClearProps = ComponentPropsWithoutRef<\"button\">;\n\nexport const DatePickerClear = forwardRef<HTMLButtonElement, DatePickerClearProps>(\n function DatePickerClear({ children = \"×\", className, disabled, onClick, ...props }, ref) {\n const { close, disabled: pickerDisabled, onClear, selected, styles } = useDatePickerContext();\n const handleClick = (event: MouseEvent<HTMLButtonElement>) => {\n onClear();\n onClick?.(event);\n close();\n };\n\n return (\n <button\n {...props}\n aria-label={props[\"aria-label\"] ?? \"Clear date\"}\n className={cx(styles.clear, className)}\n data-slot=\"date-picker-clear\"\n disabled={disabled || pickerDisabled || !selected}\n onClick={handleClick}\n ref={ref}\n type=\"button\"\n >\n {children}\n </button>\n );\n },\n);\n\nexport type DatePickerPortalProps = ComponentPropsWithoutRef<typeof BasePopover.Portal>;\nexport function DatePickerPortal(props: DatePickerPortalProps) {\n return <BasePopover.Portal {...useThemePortalProps(props)} />;\n}\n\nexport type DatePickerPositionerProps = ComponentPropsWithoutRef<typeof BasePopover.Positioner>;\n\nexport const DatePickerPositioner = forwardRef<HTMLDivElement, DatePickerPositionerProps>(\n function DatePickerPositioner({ className, ...props }, ref) {\n const { styles } = useDatePickerContext();\n\n return (\n <BasePopover.Positioner\n {...props}\n ref={ref}\n className={withRecipeClassName(styles.positioner, className)}\n data-slot=\"date-picker-positioner\"\n />\n );\n },\n);\n\nexport type DatePickerPopupProps = ComponentPropsWithoutRef<typeof BasePopover.Popup>;\n\nexport const DatePickerPopup = forwardRef<HTMLDivElement, DatePickerPopupProps>(\n function DatePickerPopup({ className, ...props }, ref) {\n const { styles } = useDatePickerContext();\n\n return (\n <BasePopover.Popup\n {...props}\n ref={ref}\n aria-label={props[\"aria-label\"] ?? \"Calendar\"}\n className={withRecipeClassName(styles.popup, className)}\n data-slot=\"date-picker-popup\"\n />\n );\n },\n);\n\nexport type DatePickerCloseProps = ComponentPropsWithoutRef<typeof BasePopover.Close>;\n\nexport const DatePickerClose = forwardRef<HTMLButtonElement, DatePickerCloseProps>(\n function DatePickerClose({ className, ...props }, ref) {\n const { styles } = useDatePickerContext();\n\n return (\n <BasePopover.Close\n {...props}\n ref={ref}\n className={withRecipeClassName(styles.close, className)}\n data-slot=\"date-picker-close\"\n />\n );\n },\n);\n\nexport type DatePickerHeaderProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const DatePickerHeader = forwardRef<HTMLDivElement, DatePickerHeaderProps>(\n function DatePickerHeader({ className, ...props }, ref) {\n const { styles } = useDatePickerContext();\n\n return (\n <div\n {...props}\n ref={ref}\n className={cx(styles.header, className)}\n data-slot=\"date-picker-header\"\n />\n );\n },\n);\n\nexport type DatePickerCaptionProps = ComponentPropsWithoutRef<\"span\">;\n\nexport const DatePickerCaption = forwardRef<HTMLSpanElement, DatePickerCaptionProps>(\n function DatePickerCaption({ children, className, ...props }, ref) {\n const { locale, month, styles } = useDatePickerContext();\n\n return (\n <span\n {...props}\n ref={ref}\n className={cx(styles.caption, className)}\n data-slot=\"date-picker-caption\"\n >\n {children ?? formatMonthLabel(month, locale)}\n </span>\n );\n },\n);\n\nexport type DatePickerMonthSelectProps = Omit<\n ComponentPropsWithoutRef<\"select\">,\n \"children\" | \"onChange\" | \"value\"\n>;\n\nexport const DatePickerMonthSelect = forwardRef<HTMLSelectElement, DatePickerMonthSelectProps>(\n function DatePickerMonthSelect({ className, ...props }, ref) {\n const { locale, month, monthDisabled, selectMonth, styles } = useDatePickerContext();\n const labels = getMonthLabels(locale);\n\n return (\n <select\n {...props}\n aria-label={props[\"aria-label\"] ?? \"Select month\"}\n className={cx(styles.monthSelect, className)}\n data-slot=\"date-picker-month-select\"\n onChange={(event) => selectMonth(Number(event.currentTarget.value))}\n ref={ref}\n value={month.getMonth()}\n >\n {labels.map((label, monthIndex) => (\n <option\n disabled={monthDisabled(createCalendarDate(month.getFullYear(), monthIndex, 1))}\n key={label}\n value={monthIndex}\n >\n {label}\n </option>\n ))}\n </select>\n );\n },\n);\n\nexport type DatePickerYearSelectProps = Omit<\n ComponentPropsWithoutRef<\"select\">,\n \"children\" | \"onChange\" | \"value\"\n>;\n\nexport const DatePickerYearSelect = forwardRef<HTMLSelectElement, DatePickerYearSelectProps>(\n function DatePickerYearSelect({ className, ...props }, ref) {\n const { month, monthDisabled, selectYear, styles, yearRange } = useDatePickerContext();\n const years = Array.from(\n { length: yearRange.end - yearRange.start + 1 },\n (_, index) => yearRange.start + index,\n );\n\n return (\n <select\n {...props}\n aria-label={props[\"aria-label\"] ?? \"Select year\"}\n className={cx(styles.yearSelect, className)}\n data-slot=\"date-picker-year-select\"\n onChange={(event) => selectYear(Number(event.currentTarget.value))}\n ref={ref}\n value={month.getFullYear()}\n >\n {years.map((year) => (\n <option\n disabled={monthDisabled(createCalendarDate(year, month.getMonth(), 1))}\n key={year}\n value={year}\n >\n {year}\n </option>\n ))}\n </select>\n );\n },\n);\n\nexport type DatePickerTimeFieldProps = Omit<\n ComponentPropsWithoutRef<\"input\">,\n \"onChange\" | \"type\" | \"value\"\n>;\n\nexport const DatePickerTimeField = forwardRef<HTMLInputElement, DatePickerTimeFieldProps>(\n function DatePickerTimeField({ className, ...props }, ref) {\n const { disabled, granularity, onTimeChange, selected, styles, timeMax, timeMin } =\n useDatePickerContext();\n if (granularity !== \"date-time\") return null;\n\n return (\n <input\n {...props}\n aria-label={props[\"aria-label\"] ?? \"Select time\"}\n className={cx(styles.timeField, className)}\n data-slot=\"date-picker-time-field\"\n disabled={disabled || !selected}\n max={timeMax}\n min={timeMin}\n onChange={(event) => onTimeChange(event.currentTarget.value)}\n ref={ref}\n type=\"time\"\n value={toTimeInput(selected)}\n />\n );\n },\n);\n\nexport interface DatePickerNavigationProps extends ComponentPropsWithoutRef<\"button\"> {\n amount?: number;\n}\n\nconst DatePickerNavigationButton = forwardRef<HTMLButtonElement, DatePickerNavigationProps>(\n function DatePickerNavigationButton({ amount, children, className, onClick, ...props }, ref) {\n const { canNavigate, month, setMonth, styles } = useDatePickerContext();\n const direction = amount ?? 1;\n const isDisabled = props.disabled || !canNavigate(direction);\n\n return (\n <button\n {...props}\n aria-label={props[\"aria-label\"] ?? (direction < 0 ? \"Previous month\" : \"Next month\")}\n className={cx(styles.navigation, className)}\n data-slot={direction < 0 ? \"date-picker-previous\" : \"date-picker-next\"}\n disabled={isDisabled}\n onClick={(event) => {\n if (!isDisabled) setMonth(addMonths(month, direction));\n onClick?.(event);\n }}\n ref={ref}\n type=\"button\"\n >\n {children ?? (direction < 0 ? \"‹\" : \"›\")}\n </button>\n );\n },\n);\n\nexport const DatePickerPrevious = forwardRef<HTMLButtonElement, DatePickerNavigationProps>(\n function DatePickerPrevious(props, ref) {\n return <DatePickerNavigationButton {...props} amount={-1} ref={ref} />;\n },\n);\n\nexport const DatePickerNext = forwardRef<HTMLButtonElement, DatePickerNavigationProps>(\n function DatePickerNext(props, ref) {\n return <DatePickerNavigationButton {...props} amount={1} ref={ref} />;\n },\n);\n\nexport interface DatePickerDayProps extends Omit<ComponentPropsWithoutRef<\"button\">, \"value\"> {\n date: Date;\n}\n\nexport const DatePickerDay = forwardRef<HTMLButtonElement, DatePickerDayProps>(\n function DatePickerDay(\n { children, className, date, disabled, onClick, onKeyDown, ...props },\n ref,\n ) {\n const {\n dateDisabled,\n disabled: pickerDisabled,\n focusDate,\n focusedDate,\n locale,\n month,\n onSelect,\n registerDay,\n selected,\n styles,\n today,\n weekStartsOn,\n } = useDatePickerContext();\n const key = dateKey(date);\n const outsideMonth = !isSameMonth(date, month);\n const isDisabled = disabled || pickerDisabled || dateDisabled(date);\n const isFocused = isSameDay(date, focusedDate);\n const isSelected = isSameDay(date, selected);\n const isToday = isSameDay(date, today);\n const dayRef = composeRefs(ref, (node) => registerDay(key, node));\n\n const moveByKey = (event: KeyboardEvent<HTMLButtonElement>) => {\n if (event.defaultPrevented) {\n return;\n }\n\n let nextDate: Date | undefined;\n switch (event.key) {\n case \"ArrowLeft\":\n nextDate = addDays(date, -1);\n break;\n case \"ArrowRight\":\n nextDate = addDays(date, 1);\n break;\n case \"ArrowUp\":\n nextDate = addDays(date, -7);\n break;\n case \"ArrowDown\":\n nextDate = addDays(date, 7);\n break;\n case \"Home\":\n nextDate = addDays(date, -((date.getDay() - weekStartsOn + 7) % 7));\n break;\n case \"End\":\n nextDate = addDays(date, 6 - ((date.getDay() - weekStartsOn + 7) % 7));\n break;\n case \"PageUp\":\n nextDate = addMonths(date, event.shiftKey ? -12 : -1);\n break;\n case \"PageDown\":\n nextDate = addMonths(date, event.shiftKey ? 12 : 1);\n break;\n case \"Enter\":\n case \" \":\n if (!isDisabled) {\n event.preventDefault();\n onSelect(date);\n }\n break;\n default:\n break;\n }\n\n if (nextDate) {\n event.preventDefault();\n focusDate(nextDate, nextDate < date ? -1 : 1);\n }\n };\n\n return (\n // biome-ignore lint/a11y/useSemanticElements: A calendar day is an interactive gridcell, not a generic table cell.\n <button\n {...props}\n ref={dayRef}\n aria-label={props[\"aria-label\"] ?? getDateRangeLabel(date, locale)}\n aria-current={isToday ? \"date\" : undefined}\n aria-selected={isSelected}\n className={cx(styles.day, className)}\n data-date={key}\n data-disabled={isDisabled || undefined}\n data-outside-month={outsideMonth || undefined}\n data-selected={isSelected || undefined}\n data-slot=\"date-picker-day\"\n data-today={isToday || undefined}\n disabled={isDisabled}\n onClick={(event) => {\n onSelect(date);\n onClick?.(event);\n }}\n onKeyDown={(event) => {\n moveByKey(event);\n onKeyDown?.(event);\n }}\n role=\"gridcell\"\n tabIndex={isFocused && !isDisabled ? 0 : -1}\n type=\"button\"\n >\n {children ?? date.getDate()}\n </button>\n );\n },\n);\n\ninterface DatePickerMonthButtonProps {\n date: Date;\n}\n\nconst DatePickerMonthButton = forwardRef<HTMLButtonElement, DatePickerMonthButtonProps>(\n function DatePickerMonthButton({ date }, ref) {\n const { disabled, granularity, locale, monthDisabled, onSelect, selected, styles } =\n useDatePickerContext();\n const isDisabled = disabled || monthDisabled(date);\n const isSelected = granularity === \"month\" && Boolean(selected && isSameMonth(selected, date));\n\n return (\n // biome-ignore lint/a11y/useSemanticElements: Month choices use the calendar gridcell pattern.\n <button\n aria-label={new Intl.DateTimeFormat(locale, { month: \"long\" }).format(date)}\n aria-selected={isSelected}\n className={styles.month}\n data-disabled={isDisabled || undefined}\n data-selected={isSelected || undefined}\n data-slot=\"date-picker-month\"\n disabled={isDisabled}\n onClick={() => onSelect(date)}\n ref={ref}\n role=\"gridcell\"\n type=\"button\"\n >\n {new Intl.DateTimeFormat(locale, { month: \"short\" }).format(date)}\n </button>\n );\n },\n);\n\nexport interface DatePickerCalendarProps\n extends Omit<ComponentPropsWithoutRef<\"section\">, \"children\"> {\n \"aria-label\"?: string;\n}\n\nexport const DatePickerCalendar = forwardRef<HTMLElement, DatePickerCalendarProps>(\n function DatePickerCalendar({ \"aria-label\": ariaLabel, className, ...props }, ref) {\n const { granularity, locale, month, styles, weekStartsOn } = useDatePickerContext();\n const days = useMemo(() => getCalendarDays(month, weekStartsOn), [month, weekStartsOn]);\n const weekdays = useMemo(() => getWeekdayLabels(locale, weekStartsOn), [locale, weekStartsOn]);\n const monthDates = useMemo(\n () =>\n Array.from({ length: 12 }, (_, index) => createCalendarDate(month.getFullYear(), index, 1)),\n [month],\n );\n\n return (\n <section\n {...props}\n ref={ref}\n aria-label={ariaLabel ?? formatMonthLabel(month, locale)}\n className={cx(styles.calendar, className)}\n data-granularity={granularity}\n data-slot=\"date-picker-calendar\"\n >\n {granularity === \"month\" ? (\n // biome-ignore lint/a11y/useSemanticElements: Month selection uses the calendar grid pattern.\n <div\n aria-label={String(month.getFullYear())}\n className={styles.monthGrid}\n data-slot=\"date-picker-month-grid\"\n role=\"grid\"\n >\n {monthDates.map((date) => (\n <DatePickerMonthButton date={date} key={dateKey(date)} />\n ))}\n </div>\n ) : (\n <>\n <div aria-hidden=\"true\" className={styles.weekdays} data-slot=\"date-picker-weekdays\">\n {weekdays.map((weekday) => (\n <span className={styles.weekday} data-slot=\"date-picker-weekday\" key={weekday}>\n {weekday}\n </span>\n ))}\n </div>\n {/* biome-ignore lint/a11y/useSemanticElements: Calendar grids use the WAI-ARIA grid pattern for roving day focus. */}\n <div\n aria-label={formatMonthLabel(month, locale)}\n className={styles.grid}\n data-slot=\"date-picker-grid\"\n role=\"grid\"\n >\n {days.map((date) => (\n <DatePickerDay date={date} key={dateKey(date)} />\n ))}\n </div>\n </>\n )}\n </section>\n );\n },\n);\n\nexport const DatePicker = {\n Root: DatePickerRoot,\n Label: DatePickerLabel,\n Control: DatePickerControl,\n Trigger: DatePickerTrigger,\n Value: DatePickerValue,\n Clear: DatePickerClear,\n Portal: DatePickerPortal,\n Positioner: DatePickerPositioner,\n Popup: DatePickerPopup,\n Close: DatePickerClose,\n Header: DatePickerHeader,\n Caption: DatePickerCaption,\n MonthSelect: DatePickerMonthSelect,\n YearSelect: DatePickerYearSelect,\n TimeField: DatePickerTimeField,\n Previous: DatePickerPrevious,\n Next: DatePickerNext,\n Day: DatePickerDay,\n Calendar: DatePickerCalendar,\n};\n"],"mappings":";;;;;;;;;;AAoFA,MAAM,qBAAA,GAAA,MAAA,cAAA,CAAiE,IAAI;AAE3E,SAAS,uBAAuB;CAC9B,MAAM,WAAA,GAAA,MAAA,WAAA,CAAqB,iBAAiB;CAC5C,IAAI,CAAC,SACH,MAAM,IAAI,MAAM,2DAA2D;CAG7E,OAAO;AACT;AAEA,SAAS,YAAY,MAAY,OAAa;CAC5C,OAAO,KAAK,YAAY,MAAM,MAAM,YAAY,KAAK,KAAK,SAAS,MAAM,MAAM,SAAS;AAC1F;AAEA,SAAS,YAAe,OAA2B,QAAmC;CACpF,QAAQ,UAAoB;EAC1B,OAAO,KAAK;EACZ,IAAI,OAAO,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CAAC,uBAAD,EAA6B,KAA2B,GAAhBR,mBAAAA,QAAQ,IAAI,CAAI,CACzD;EACE,CAAA,IAEL,iBAAA,GAAA,kBAAA,KAAA,CAAA,kBAAA,UAAA,EAAA,UAAA,CACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;GAAK,eAAY;GAAO,WAAW,OAAO;GAAU,aAAU;aAC3D,SAAS,KAAK,YACb,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;IAAM,WAAW,OAAO;IAAS,aAAU;cACxC;GACG,GAFgE,OAEhE,CACP;EACE,CAAA,GAEL,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;GACE,cAAYW,mBAAAA,iBAAiB,OAAO,MAAM;GAC1C,WAAW,OAAO;GAClB,aAAU;GACV,MAAK;aAEJ,KAAK,KAAK,SACT,iBAAA,GAAA,kBAAA,IAAA,CAAC,eAAD,EAAqB,KAA2B,GAAhBX,mBAAAA,QAAQ,IAAI,CAAI,CACjD;EACE,CAAA,CACL,EAAA,CAAA;CAEG,CAAA;AAEb,CACF;AAEA,MAAa,aAAa;CACxB,MAAM;CACN,OAAO;CACP,SAAS;CACT,SAAS;CACT,OAAO;CACP,OAAO;CACP,QAAQ;CACR,YAAY;CACZ,OAAO;CACP,OAAO;CACP,QAAQ;CACR,SAAS;CACT,aAAa;CACb,YAAY;CACZ,WAAW;CACX,UAAU;CACV,MAAM;CACN,KAAK;CACL,UAAU;AACZ"}
|
|
1
|
+
{"version":3,"file":"date-picker.cjs","names":["createContext","useContext","useState","startOfMonth","useRef","useId","useMemo","datePicker","useCallback","isBeforeDay","isAfterDay","createCalendarDate","isSameDay","addDays","dateKey","addMonths","toTimeInput","formatDateLabel","BasePopover","toInputMonth","toInputDateTime","toInputDate","forwardRef","cx","withRecipeClassName","useThemePortalProps","formatMonthLabel","getMonthLabels","getDateRangeLabel","getCalendarDays","getWeekdayLabels"],"sources":["../../../src/components/date-picker/date-picker.tsx"],"sourcesContent":["\"use client\";\n\nimport { Popover as BasePopover } from \"@base-ui/react/popover\";\nimport {\n createContext,\n forwardRef,\n useCallback,\n useContext,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport type { ComponentPropsWithoutRef, KeyboardEvent, MouseEvent, ReactNode, Ref } from \"react\";\nimport type { PopoverRoot as BasePopoverRoot } from \"@base-ui/react/popover\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { datePicker } from \"../../styled-system/recipes\";\nimport { withRecipeClassName } from \"../base-ui\";\nimport { useThemePortalProps } from \"../../theme/theme-scope\";\nimport {\n addDays,\n addMonths,\n createCalendarDate,\n dateKey,\n formatDateLabel,\n formatMonthLabel,\n getCalendarDays,\n getDateRangeLabel,\n getMonthLabels,\n getWeekdayLabels,\n isAfterDay,\n isBeforeDay,\n isSameDay,\n startOfMonth,\n toInputDate,\n toInputDateTime,\n toInputMonth,\n toTimeInput,\n} from \"./date-utils\";\nimport type { DatePickerGranularity } from \"./date-utils\";\n\nexport type DatePickerSize = \"sm\" | \"md\" | \"lg\";\nexport type { DatePickerGranularity } from \"./date-utils\";\n\nexport interface DatePickerYearRange {\n start: number;\n end: number;\n}\n\ninterface DatePickerContextValue {\n canNavigate: (amount: number) => boolean;\n close: () => void;\n dateDisabled: (date: Date) => boolean;\n granularity: DatePickerGranularity;\n disabled: boolean;\n focusDate: (date: Date, direction?: number) => void;\n focusedDate: Date;\n formatDate: (date: Date | null) => string;\n labelId: string;\n locale: string;\n month: Date;\n monthDisabled: (date: Date) => boolean;\n onClear: () => void;\n onTimeChange: (value: string) => void;\n onSelect: (date: Date) => void;\n selectMonth: (month: number) => void;\n selectYear: (year: number) => void;\n placeholder: ReactNode;\n registerDay: (key: string, node: HTMLButtonElement | null) => void;\n selected: Date | null;\n setFocusedDate: (date: Date) => void;\n setMonth: (date: Date) => void;\n size: DatePickerSize;\n styles: ReturnType<typeof datePicker>;\n today: Date;\n timeMax: string | undefined;\n timeMin: string | undefined;\n triggerId: string;\n weekStartsOn: number;\n yearRange: DatePickerYearRange;\n}\n\nconst DatePickerContext = createContext<DatePickerContextValue | null>(null);\n\nfunction useDatePickerContext() {\n const context = useContext(DatePickerContext);\n if (!context) {\n throw new Error(\"DatePicker parts must be rendered inside DatePicker.Root.\");\n }\n\n return context;\n}\n\nfunction isSameMonth(left: Date, right: Date) {\n return left.getFullYear() === right.getFullYear() && left.getMonth() === right.getMonth();\n}\n\nfunction composeRefs<T>(first: Ref<T> | undefined, second: (value: T | null) => void) {\n return (value: T | null) => {\n second(value);\n if (typeof first === \"function\") {\n first(value);\n } else if (first) {\n first.current = value;\n }\n };\n}\n\nexport interface DatePickerRootProps extends Omit<BasePopoverRoot.Props, \"children\"> {\n /** Selected value. Use together with `onValueChange` for a controlled picker. */\n value?: Date | null;\n /** Initial selected value for an uncontrolled picker. */\n defaultValue?: Date | null;\n /** Called after a valid day, month, or time is selected, or when the value is cleared. */\n onValueChange?: (value: Date | null) => void;\n /** Prevents dates before this local calendar day from being selected. */\n minDate?: Date;\n /** Prevents dates after this local calendar day from being selected. */\n maxDate?: Date;\n /** Adds application-specific disabled dates, such as holidays or weekends. */\n isDateDisabled?: (date: Date) => boolean;\n /** Locale used for month, weekday and value formatting. */\n locale?: string;\n /** Called after the visible calendar month changes. */\n onMonthChange?: (month: Date) => void;\n /** First weekday in the calendar, where 0 is Sunday and 1 is Monday. */\n weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6;\n /** Text shown when no date has been selected. */\n placeholder?: ReactNode;\n /** Shared visual size for the trigger and calendar days. */\n size?: DatePickerSize;\n /** Controls whether the picker selects days, months, or date and time. */\n granularity?: DatePickerGranularity;\n /** Inclusive range used by the year selector. */\n yearRange?: DatePickerYearRange;\n /** Reference date used when no value is selected, useful for deterministic SSR and tests. */\n referenceDate?: Date;\n /** Adds a native hidden input using the representation for the selected granularity. */\n name?: string;\n /** Prevents interaction and disables the hidden form input. */\n disabled?: boolean;\n /** Closes the popup after a value is chosen. Defaults to false for date-time mode and true otherwise. */\n closeOnSelect?: boolean;\n children?: ReactNode;\n}\n\nexport function DatePickerRoot({\n children,\n closeOnSelect: closeOnSelectProp,\n defaultValue = null,\n disabled = false,\n granularity = \"day\",\n isDateDisabled,\n locale = \"pt-BR\",\n maxDate,\n minDate,\n name,\n onValueChange,\n onMonthChange,\n placeholder = \"Select a date\",\n size = \"md\",\n value: controlledValue,\n weekStartsOn = 0,\n yearRange: configuredYearRange,\n referenceDate,\n actionsRef: externalActionsRef,\n ...popoverProps\n}: DatePickerRootProps) {\n const [uncontrolledValue, setUncontrolledValue] = useState<Date | null>(defaultValue);\n const selected = controlledValue === undefined ? uncontrolledValue : controlledValue;\n const [month, setMonthState] = useState(() =>\n startOfMonth(selected ?? referenceDate ?? new Date()),\n );\n const [focusedDate, setFocusedDate] = useState(selected ?? referenceDate ?? month);\n const previousMonthRef = useRef(month);\n const internalActionsRef = useRef<BasePopoverRoot.Actions | null>(null);\n const dayRefs = useRef(new Map<string, HTMLButtonElement>());\n const labelId = useId();\n const triggerId = useId();\n const today = useMemo(() => referenceDate ?? new Date(), [referenceDate]);\n const styles = datePicker({ size });\n const minMonth = minDate ? startOfMonth(minDate) : undefined;\n const maxMonth = maxDate ? startOfMonth(maxDate) : undefined;\n const closeOnSelect = closeOnSelectProp ?? granularity !== \"date-time\";\n const yearRange = useMemo(() => {\n const defaultStart = today.getFullYear() - 100;\n const defaultEnd = today.getFullYear() + 20;\n const start = configuredYearRange?.start ?? defaultStart;\n const end = configuredYearRange?.end ?? defaultEnd;\n const years = [selected?.getFullYear(), minDate?.getFullYear(), maxDate?.getFullYear()].filter(\n (year): year is number => year !== undefined,\n );\n return {\n end: Math.max(start, end, ...years),\n start: Math.min(start, end, ...years),\n };\n }, [configuredYearRange?.end, configuredYearRange?.start, maxDate, minDate, selected, today]);\n\n const clampMonth = useCallback(\n (nextMonth: Date) => {\n const normalized = startOfMonth(nextMonth);\n if (minMonth && isBeforeDay(normalized, minMonth)) return minMonth;\n if (maxMonth && isAfterDay(normalized, maxMonth)) return maxMonth;\n return normalized;\n },\n [maxMonth, minMonth],\n );\n\n const setMonth = useCallback(\n (nextMonth: Date) => {\n const normalized = clampMonth(nextMonth);\n setMonthState((current) => {\n if (isSameMonth(current, normalized)) return current;\n return normalized;\n });\n },\n [clampMonth],\n );\n\n useEffect(() => {\n if (isSameMonth(previousMonthRef.current, month)) return;\n previousMonthRef.current = month;\n onMonthChange?.(month);\n }, [month, onMonthChange]);\n\n useEffect(() => {\n if (!selected) {\n return;\n }\n\n setFocusedDate(selected);\n setMonthState((current) => (isSameMonth(current, selected) ? current : clampMonth(selected)));\n }, [clampMonth, selected]);\n\n const dateDisabled = useCallback(\n (date: Date) =>\n Boolean(\n (minDate && isBeforeDay(date, minDate)) ||\n (maxDate && isAfterDay(date, maxDate)) ||\n isDateDisabled?.(date),\n ),\n [isDateDisabled, maxDate, minDate],\n );\n\n const close = useCallback(() => {\n (externalActionsRef ?? internalActionsRef).current?.close();\n }, [externalActionsRef]);\n\n const setValue = useCallback(\n (nextValue: Date | null) => {\n if (controlledValue === undefined) setUncontrolledValue(nextValue);\n onValueChange?.(nextValue);\n },\n [controlledValue, onValueChange],\n );\n\n const monthDisabled = useCallback(\n (candidate: Date) => {\n const firstDay = startOfMonth(candidate);\n const lastDay = createCalendarDate(candidate.getFullYear(), candidate.getMonth() + 1, 0);\n return Boolean(\n (minDate && isBeforeDay(lastDay, minDate)) || (maxDate && isAfterDay(firstDay, maxDate)),\n );\n },\n [maxDate, minDate],\n );\n\n const onSelect = useCallback(\n (date: Date) => {\n if (disabled || (granularity === \"month\" ? monthDisabled(date) : dateDisabled(date))) {\n return;\n }\n\n const nextValue = createCalendarDate(\n date.getFullYear(),\n date.getMonth(),\n granularity === \"month\" ? 1 : date.getDate(),\n );\n if (granularity === \"date-time\") {\n nextValue.setHours(selected?.getHours() ?? 12, selected?.getMinutes() ?? 0, 0, 0);\n if (minDate && isSameDay(nextValue, minDate) && nextValue < minDate) {\n nextValue.setHours(minDate.getHours(), minDate.getMinutes(), 0, 0);\n }\n if (maxDate && isSameDay(nextValue, maxDate) && nextValue > maxDate) {\n nextValue.setHours(maxDate.getHours(), maxDate.getMinutes(), 0, 0);\n }\n }\n setValue(nextValue);\n setFocusedDate(nextValue);\n setMonth(startOfMonth(nextValue));\n if (closeOnSelect) {\n close();\n }\n },\n [\n close,\n closeOnSelect,\n dateDisabled,\n disabled,\n granularity,\n maxDate,\n monthDisabled,\n minDate,\n selected,\n setMonth,\n setValue,\n ],\n );\n\n const onClear = useCallback(() => {\n setValue(null);\n }, [setValue]);\n\n const selectMonth = useCallback(\n (monthIndex: number) => {\n const nextMonth = clampMonth(createCalendarDate(month.getFullYear(), monthIndex, 1));\n if (monthDisabled(nextMonth)) return;\n setMonth(nextMonth);\n if (granularity === \"month\") {\n const nextValue = createCalendarDate(nextMonth.getFullYear(), nextMonth.getMonth(), 1);\n setFocusedDate(nextValue);\n setValue(nextValue);\n if (closeOnSelect) close();\n }\n },\n [clampMonth, close, closeOnSelect, granularity, month, monthDisabled, setMonth, setValue],\n );\n\n const selectYear = useCallback(\n (year: number) => {\n const nextMonth = clampMonth(createCalendarDate(year, month.getMonth(), 1));\n if (monthDisabled(nextMonth)) return;\n setMonth(nextMonth);\n if (granularity === \"month\") {\n const nextValue = createCalendarDate(nextMonth.getFullYear(), nextMonth.getMonth(), 1);\n setFocusedDate(nextValue);\n setValue(nextValue);\n if (closeOnSelect) close();\n }\n },\n [clampMonth, close, closeOnSelect, granularity, month, monthDisabled, setMonth, setValue],\n );\n\n const onTimeChange = useCallback(\n (value: string) => {\n const match = value.match(/^(\\d{2}):(\\d{2})$/);\n if (!match) return;\n const hours = Number(match[1]);\n const minutes = Number(match[2]);\n if (hours > 23 || minutes > 59) return;\n const baseDate = selected ?? focusedDate;\n const nextValue = createCalendarDate(\n baseDate.getFullYear(),\n baseDate.getMonth(),\n baseDate.getDate(),\n );\n nextValue.setHours(hours, minutes, 0, 0);\n if (minDate && isSameDay(nextValue, minDate) && nextValue < minDate) return;\n if (maxDate && isSameDay(nextValue, maxDate) && nextValue > maxDate) return;\n setValue(nextValue);\n },\n [focusedDate, maxDate, minDate, selected, setValue],\n );\n\n const focusDate = useCallback(\n (date: Date, direction = 1) => {\n let nextDate = createCalendarDate(date.getFullYear(), date.getMonth(), date.getDate());\n const step = direction < 0 ? -1 : 1;\n let attempts = 0;\n while (dateDisabled(nextDate) && attempts < 366) {\n nextDate = addDays(nextDate, step);\n attempts += 1;\n }\n\n setFocusedDate(nextDate);\n setMonth(nextDate);\n\n const focusTarget = () => dayRefs.current.get(dateKey(nextDate))?.focus();\n focusTarget();\n queueMicrotask(focusTarget);\n },\n [dateDisabled, setMonth],\n );\n\n const canNavigate = useCallback(\n (amount: number) => {\n const nextMonth = addMonths(month, amount);\n return !(\n (minMonth && isBeforeDay(nextMonth, minMonth)) ||\n (maxMonth && isAfterDay(nextMonth, maxMonth))\n );\n },\n [maxMonth, minMonth, month],\n );\n\n const registerDay = useCallback((key: string, node: HTMLButtonElement | null) => {\n if (node) {\n dayRefs.current.set(key, node);\n } else {\n dayRefs.current.delete(key);\n }\n }, []);\n\n const timeMin =\n selected && minDate && isSameDay(selected, minDate) ? toTimeInput(minDate) : undefined;\n const timeMax =\n selected && maxDate && isSameDay(selected, maxDate) ? toTimeInput(maxDate) : undefined;\n\n const context: DatePickerContextValue = {\n canNavigate,\n close,\n dateDisabled,\n granularity,\n disabled,\n focusDate,\n focusedDate,\n formatDate: (date) => formatDateLabel(date, locale, String(placeholder), granularity),\n labelId,\n locale,\n month,\n monthDisabled,\n onClear,\n onTimeChange,\n onSelect,\n selectMonth,\n selectYear,\n placeholder,\n registerDay,\n selected,\n setFocusedDate,\n setMonth,\n size,\n styles,\n today: createCalendarDate(today.getFullYear(), today.getMonth(), today.getDate()),\n timeMax,\n timeMin,\n triggerId,\n weekStartsOn,\n yearRange,\n };\n\n return (\n <DatePickerContext.Provider value={context}>\n <BasePopover.Root {...popoverProps} actionsRef={externalActionsRef ?? internalActionsRef}>\n {children}\n </BasePopover.Root>\n {name ? (\n <input\n disabled={disabled}\n name={name}\n type=\"hidden\"\n value={\n granularity === \"month\"\n ? toInputMonth(selected)\n : granularity === \"date-time\"\n ? toInputDateTime(selected)\n : toInputDate(selected)\n }\n />\n ) : null}\n </DatePickerContext.Provider>\n );\n}\n\nexport type DatePickerLabelProps = ComponentPropsWithoutRef<\"label\">;\n\nexport const DatePickerLabel = forwardRef<HTMLLabelElement, DatePickerLabelProps>(\n function DatePickerLabel({ children, className, ...props }, ref) {\n const { labelId, styles, triggerId } = useDatePickerContext();\n\n return (\n <label\n {...props}\n ref={ref}\n className={cx(styles.label, className)}\n data-slot=\"date-picker-label\"\n htmlFor={props.htmlFor ?? triggerId}\n id={props.id ?? labelId}\n >\n {children}\n </label>\n );\n },\n);\n\nexport type DatePickerControlProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const DatePickerControl = forwardRef<HTMLDivElement, DatePickerControlProps>(\n function DatePickerControl({ className, ...props }, ref) {\n const { styles } = useDatePickerContext();\n\n return (\n <div\n {...props}\n ref={ref}\n className={cx(styles.control, className)}\n data-jaci-component=\"date-picker\"\n data-slot=\"date-picker-control\"\n />\n );\n },\n);\n\nexport type DatePickerTriggerProps = ComponentPropsWithoutRef<typeof BasePopover.Trigger>;\n\nexport const DatePickerTrigger = forwardRef<HTMLButtonElement, DatePickerTriggerProps>(\n function DatePickerTrigger({ children, className, disabled, id, ...props }, ref) {\n const { disabled: pickerDisabled, styles, triggerId } = useDatePickerContext();\n\n return (\n <BasePopover.Trigger\n {...props}\n aria-label={props[\"aria-label\"] ?? \"Choose date\"}\n disabled={disabled ?? pickerDisabled}\n id={id ?? triggerId}\n ref={ref}\n className={withRecipeClassName(styles.trigger, className)}\n data-jaci-component=\"date-picker\"\n data-slot=\"date-picker-trigger\"\n >\n {children ?? (\n <>\n <DatePickerValue />\n <span aria-hidden=\"true\">▾</span>\n </>\n )}\n </BasePopover.Trigger>\n );\n },\n);\n\nexport interface DatePickerValueProps extends ComponentPropsWithoutRef<\"span\"> {\n placeholder?: ReactNode;\n}\n\nexport const DatePickerValue = forwardRef<HTMLSpanElement, DatePickerValueProps>(\n function DatePickerValue({ children, className, placeholder, ...props }, ref) {\n const { formatDate, selected, styles } = useDatePickerContext();\n const value = children ?? (selected ? formatDate(selected) : (placeholder ?? \"Select a date\"));\n\n return (\n <span\n {...props}\n ref={ref}\n className={cx(styles.value, className)}\n data-placeholder={selected ? undefined : \"true\"}\n data-slot=\"date-picker-value\"\n >\n {value}\n </span>\n );\n },\n);\n\nexport type DatePickerClearProps = ComponentPropsWithoutRef<\"button\">;\n\nexport const DatePickerClear = forwardRef<HTMLButtonElement, DatePickerClearProps>(\n function DatePickerClear({ children = \"×\", className, disabled, onClick, ...props }, ref) {\n const { close, disabled: pickerDisabled, onClear, selected, styles } = useDatePickerContext();\n const handleClick = (event: MouseEvent<HTMLButtonElement>) => {\n onClear();\n onClick?.(event);\n close();\n };\n\n return (\n <button\n {...props}\n aria-label={props[\"aria-label\"] ?? \"Clear date\"}\n className={cx(styles.clear, className)}\n data-slot=\"date-picker-clear\"\n disabled={disabled || pickerDisabled || !selected}\n onClick={handleClick}\n ref={ref}\n type=\"button\"\n >\n {children}\n </button>\n );\n },\n);\n\nexport type DatePickerPortalProps = ComponentPropsWithoutRef<typeof BasePopover.Portal>;\nexport function DatePickerPortal(props: DatePickerPortalProps) {\n return <BasePopover.Portal {...useThemePortalProps(props)} />;\n}\n\nexport type DatePickerPositionerProps = ComponentPropsWithoutRef<typeof BasePopover.Positioner>;\n\nexport const DatePickerPositioner = forwardRef<HTMLDivElement, DatePickerPositionerProps>(\n function DatePickerPositioner({ className, ...props }, ref) {\n const { styles } = useDatePickerContext();\n\n return (\n <BasePopover.Positioner\n {...props}\n ref={ref}\n className={withRecipeClassName(styles.positioner, className)}\n data-slot=\"date-picker-positioner\"\n />\n );\n },\n);\n\nexport type DatePickerPopupProps = ComponentPropsWithoutRef<typeof BasePopover.Popup>;\n\nexport const DatePickerPopup = forwardRef<HTMLDivElement, DatePickerPopupProps>(\n function DatePickerPopup({ className, ...props }, ref) {\n const { styles } = useDatePickerContext();\n\n return (\n <BasePopover.Popup\n {...props}\n ref={ref}\n aria-label={props[\"aria-label\"] ?? \"Calendar\"}\n className={withRecipeClassName(styles.popup, className)}\n data-slot=\"date-picker-popup\"\n />\n );\n },\n);\n\nexport type DatePickerCloseProps = ComponentPropsWithoutRef<typeof BasePopover.Close>;\n\nexport const DatePickerClose = forwardRef<HTMLButtonElement, DatePickerCloseProps>(\n function DatePickerClose({ className, ...props }, ref) {\n const { styles } = useDatePickerContext();\n\n return (\n <BasePopover.Close\n {...props}\n ref={ref}\n className={withRecipeClassName(styles.close, className)}\n data-slot=\"date-picker-close\"\n />\n );\n },\n);\n\nexport type DatePickerHeaderProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const DatePickerHeader = forwardRef<HTMLDivElement, DatePickerHeaderProps>(\n function DatePickerHeader({ className, ...props }, ref) {\n const { styles } = useDatePickerContext();\n\n return (\n <div\n {...props}\n ref={ref}\n className={cx(styles.header, className)}\n data-slot=\"date-picker-header\"\n />\n );\n },\n);\n\nexport type DatePickerCaptionProps = ComponentPropsWithoutRef<\"span\">;\n\nexport const DatePickerCaption = forwardRef<HTMLSpanElement, DatePickerCaptionProps>(\n function DatePickerCaption({ children, className, ...props }, ref) {\n const { locale, month, styles } = useDatePickerContext();\n\n return (\n <span\n {...props}\n ref={ref}\n className={cx(styles.caption, className)}\n data-slot=\"date-picker-caption\"\n >\n {children ?? formatMonthLabel(month, locale)}\n </span>\n );\n },\n);\n\nexport type DatePickerMonthSelectProps = Omit<\n ComponentPropsWithoutRef<\"select\">,\n \"children\" | \"onChange\" | \"value\"\n>;\n\nexport const DatePickerMonthSelect = forwardRef<HTMLSelectElement, DatePickerMonthSelectProps>(\n function DatePickerMonthSelect({ className, ...props }, ref) {\n const { locale, month, monthDisabled, selectMonth, styles } = useDatePickerContext();\n const labels = getMonthLabels(locale);\n\n return (\n <select\n {...props}\n aria-label={props[\"aria-label\"] ?? \"Select month\"}\n className={cx(styles.monthSelect, className)}\n data-slot=\"date-picker-month-select\"\n onChange={(event) => selectMonth(Number(event.currentTarget.value))}\n ref={ref}\n value={month.getMonth()}\n >\n {labels.map((label, monthIndex) => (\n <option\n disabled={monthDisabled(createCalendarDate(month.getFullYear(), monthIndex, 1))}\n key={label}\n value={monthIndex}\n >\n {label}\n </option>\n ))}\n </select>\n );\n },\n);\n\nexport type DatePickerYearSelectProps = Omit<\n ComponentPropsWithoutRef<\"select\">,\n \"children\" | \"onChange\" | \"value\"\n>;\n\nexport const DatePickerYearSelect = forwardRef<HTMLSelectElement, DatePickerYearSelectProps>(\n function DatePickerYearSelect({ className, ...props }, ref) {\n const { month, monthDisabled, selectYear, styles, yearRange } = useDatePickerContext();\n const years = Array.from(\n { length: yearRange.end - yearRange.start + 1 },\n (_, index) => yearRange.start + index,\n );\n\n return (\n <select\n {...props}\n aria-label={props[\"aria-label\"] ?? \"Select year\"}\n className={cx(styles.yearSelect, className)}\n data-slot=\"date-picker-year-select\"\n onChange={(event) => selectYear(Number(event.currentTarget.value))}\n ref={ref}\n value={month.getFullYear()}\n >\n {years.map((year) => (\n <option\n disabled={monthDisabled(createCalendarDate(year, month.getMonth(), 1))}\n key={year}\n value={year}\n >\n {year}\n </option>\n ))}\n </select>\n );\n },\n);\n\nexport type DatePickerTimeFieldProps = Omit<\n ComponentPropsWithoutRef<\"input\">,\n \"onChange\" | \"type\" | \"value\"\n>;\n\nexport const DatePickerTimeField = forwardRef<HTMLInputElement, DatePickerTimeFieldProps>(\n function DatePickerTimeField({ className, ...props }, ref) {\n const { disabled, granularity, onTimeChange, selected, styles, timeMax, timeMin } =\n useDatePickerContext();\n if (granularity !== \"date-time\") return null;\n\n return (\n <input\n {...props}\n aria-label={props[\"aria-label\"] ?? \"Select time\"}\n className={cx(styles.timeField, className)}\n data-slot=\"date-picker-time-field\"\n disabled={disabled || !selected}\n max={timeMax}\n min={timeMin}\n onChange={(event) => onTimeChange(event.currentTarget.value)}\n ref={ref}\n type=\"time\"\n value={toTimeInput(selected)}\n />\n );\n },\n);\n\nexport interface DatePickerNavigationProps extends ComponentPropsWithoutRef<\"button\"> {\n amount?: number;\n}\n\nconst DatePickerNavigationButton = forwardRef<HTMLButtonElement, DatePickerNavigationProps>(\n function DatePickerNavigationButton({ amount, children, className, onClick, ...props }, ref) {\n const { canNavigate, month, setMonth, styles } = useDatePickerContext();\n const direction = amount ?? 1;\n const isDisabled = props.disabled || !canNavigate(direction);\n\n return (\n <button\n {...props}\n aria-label={props[\"aria-label\"] ?? (direction < 0 ? \"Previous month\" : \"Next month\")}\n className={cx(styles.navigation, className)}\n data-slot={direction < 0 ? \"date-picker-previous\" : \"date-picker-next\"}\n disabled={isDisabled}\n onClick={(event) => {\n if (!isDisabled) setMonth(addMonths(month, direction));\n onClick?.(event);\n }}\n ref={ref}\n type=\"button\"\n >\n {children ?? (direction < 0 ? \"‹\" : \"›\")}\n </button>\n );\n },\n);\n\nexport const DatePickerPrevious = forwardRef<HTMLButtonElement, DatePickerNavigationProps>(\n function DatePickerPrevious(props, ref) {\n return <DatePickerNavigationButton {...props} amount={-1} ref={ref} />;\n },\n);\n\nexport const DatePickerNext = forwardRef<HTMLButtonElement, DatePickerNavigationProps>(\n function DatePickerNext(props, ref) {\n return <DatePickerNavigationButton {...props} amount={1} ref={ref} />;\n },\n);\n\nexport interface DatePickerDayProps extends Omit<ComponentPropsWithoutRef<\"button\">, \"value\"> {\n date: Date;\n}\n\nexport const DatePickerDay = forwardRef<HTMLButtonElement, DatePickerDayProps>(\n function DatePickerDay(\n { children, className, date, disabled, onClick, onKeyDown, ...props },\n ref,\n ) {\n const {\n dateDisabled,\n disabled: pickerDisabled,\n focusDate,\n focusedDate,\n locale,\n month,\n onSelect,\n registerDay,\n selected,\n styles,\n today,\n weekStartsOn,\n } = useDatePickerContext();\n const key = dateKey(date);\n const outsideMonth = !isSameMonth(date, month);\n const isDisabled = disabled || pickerDisabled || dateDisabled(date);\n const isFocused = isSameDay(date, focusedDate);\n const isSelected = isSameDay(date, selected);\n const isToday = isSameDay(date, today);\n const dayRef = composeRefs(ref, (node) => registerDay(key, node));\n\n const moveByKey = (event: KeyboardEvent<HTMLButtonElement>) => {\n if (event.defaultPrevented) {\n return;\n }\n\n let nextDate: Date | undefined;\n switch (event.key) {\n case \"ArrowLeft\":\n nextDate = addDays(date, -1);\n break;\n case \"ArrowRight\":\n nextDate = addDays(date, 1);\n break;\n case \"ArrowUp\":\n nextDate = addDays(date, -7);\n break;\n case \"ArrowDown\":\n nextDate = addDays(date, 7);\n break;\n case \"Home\":\n nextDate = addDays(date, -((date.getDay() - weekStartsOn + 7) % 7));\n break;\n case \"End\":\n nextDate = addDays(date, 6 - ((date.getDay() - weekStartsOn + 7) % 7));\n break;\n case \"PageUp\":\n nextDate = addMonths(date, event.shiftKey ? -12 : -1);\n break;\n case \"PageDown\":\n nextDate = addMonths(date, event.shiftKey ? 12 : 1);\n break;\n case \"Enter\":\n case \" \":\n if (!isDisabled) {\n event.preventDefault();\n onSelect(date);\n }\n break;\n default:\n break;\n }\n\n if (nextDate) {\n event.preventDefault();\n focusDate(nextDate, nextDate < date ? -1 : 1);\n }\n };\n\n return (\n // biome-ignore lint/a11y/useSemanticElements: A calendar day is an interactive gridcell, not a generic table cell.\n <button\n {...props}\n ref={dayRef}\n aria-label={props[\"aria-label\"] ?? getDateRangeLabel(date, locale)}\n aria-current={isToday ? \"date\" : undefined}\n aria-selected={isSelected}\n className={cx(styles.day, className)}\n data-date={key}\n data-disabled={isDisabled || undefined}\n data-outside-month={outsideMonth || undefined}\n data-selected={isSelected || undefined}\n data-slot=\"date-picker-day\"\n data-today={isToday || undefined}\n disabled={isDisabled}\n onClick={(event) => {\n onSelect(date);\n onClick?.(event);\n }}\n onKeyDown={(event) => {\n moveByKey(event);\n onKeyDown?.(event);\n }}\n role=\"gridcell\"\n tabIndex={isFocused && !isDisabled ? 0 : -1}\n type=\"button\"\n >\n {children ?? date.getDate()}\n </button>\n );\n },\n);\n\ninterface DatePickerMonthButtonProps {\n date: Date;\n}\n\nconst DatePickerMonthButton = forwardRef<HTMLButtonElement, DatePickerMonthButtonProps>(\n function DatePickerMonthButton({ date }, ref) {\n const { disabled, granularity, locale, monthDisabled, onSelect, selected, styles } =\n useDatePickerContext();\n const isDisabled = disabled || monthDisabled(date);\n const isSelected = granularity === \"month\" && Boolean(selected && isSameMonth(selected, date));\n\n return (\n // biome-ignore lint/a11y/useSemanticElements: Month choices use the calendar gridcell pattern.\n <button\n aria-label={new Intl.DateTimeFormat(locale, { month: \"long\" }).format(date)}\n aria-selected={isSelected}\n className={styles.month}\n data-disabled={isDisabled || undefined}\n data-selected={isSelected || undefined}\n data-slot=\"date-picker-month\"\n disabled={isDisabled}\n onClick={() => onSelect(date)}\n ref={ref}\n role=\"gridcell\"\n type=\"button\"\n >\n {new Intl.DateTimeFormat(locale, { month: \"short\" }).format(date)}\n </button>\n );\n },\n);\n\nexport interface DatePickerCalendarProps\n extends Omit<ComponentPropsWithoutRef<\"section\">, \"children\"> {\n \"aria-label\"?: string;\n}\n\nexport const DatePickerCalendar = forwardRef<HTMLElement, DatePickerCalendarProps>(\n function DatePickerCalendar({ \"aria-label\": ariaLabel, className, ...props }, ref) {\n const { granularity, locale, month, styles, weekStartsOn } = useDatePickerContext();\n const days = useMemo(() => getCalendarDays(month, weekStartsOn), [month, weekStartsOn]);\n const weekdays = useMemo(() => getWeekdayLabels(locale, weekStartsOn), [locale, weekStartsOn]);\n const monthDates = useMemo(\n () =>\n Array.from({ length: 12 }, (_, index) => createCalendarDate(month.getFullYear(), index, 1)),\n [month],\n );\n\n return (\n <section\n {...props}\n ref={ref}\n aria-label={ariaLabel ?? formatMonthLabel(month, locale)}\n className={cx(styles.calendar, className)}\n data-granularity={granularity}\n data-slot=\"date-picker-calendar\"\n >\n {granularity === \"month\" ? (\n // biome-ignore lint/a11y/useSemanticElements: Month selection uses the calendar grid pattern.\n <div\n aria-label={String(month.getFullYear())}\n className={styles.monthGrid}\n data-slot=\"date-picker-month-grid\"\n role=\"grid\"\n >\n {monthDates.map((date) => (\n <DatePickerMonthButton date={date} key={dateKey(date)} />\n ))}\n </div>\n ) : (\n <>\n <div aria-hidden=\"true\" className={styles.weekdays} data-slot=\"date-picker-weekdays\">\n {weekdays.map((weekday) => (\n <span className={styles.weekday} data-slot=\"date-picker-weekday\" key={weekday}>\n {weekday}\n </span>\n ))}\n </div>\n {/* biome-ignore lint/a11y/useSemanticElements: Calendar grids use the WAI-ARIA grid pattern for roving day focus. */}\n <div\n aria-label={formatMonthLabel(month, locale)}\n className={styles.grid}\n data-slot=\"date-picker-grid\"\n role=\"grid\"\n >\n {days.map((date) => (\n <DatePickerDay date={date} key={dateKey(date)} />\n ))}\n </div>\n </>\n )}\n </section>\n );\n },\n);\n\nexport const DatePicker = {\n Root: DatePickerRoot,\n Label: DatePickerLabel,\n Control: DatePickerControl,\n Trigger: DatePickerTrigger,\n Value: DatePickerValue,\n Clear: DatePickerClear,\n Portal: DatePickerPortal,\n Positioner: DatePickerPositioner,\n Popup: DatePickerPopup,\n Close: DatePickerClose,\n Header: DatePickerHeader,\n Caption: DatePickerCaption,\n MonthSelect: DatePickerMonthSelect,\n YearSelect: DatePickerYearSelect,\n TimeField: DatePickerTimeField,\n Previous: DatePickerPrevious,\n Next: DatePickerNext,\n Day: DatePickerDay,\n Calendar: DatePickerCalendar,\n};\n"],"mappings":";;;;;;;;;;AAoFA,MAAM,qBAAA,GAAoBA,MAAAA,cAAAA,CAA6C,IAAI;AAE3E,SAAS,uBAAuB;CAC9B,MAAM,WAAA,GAAUC,MAAAA,WAAAA,CAAW,iBAAiB;CAC5C,IAAI,CAAC,SACH,MAAM,IAAI,MAAM,2DAA2D;CAG7E,OAAO;AACT;AAEA,SAAS,YAAY,MAAY,OAAa;CAC5C,OAAO,KAAK,YAAY,MAAM,MAAM,YAAY,KAAK,KAAK,SAAS,MAAM,MA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;CACP,QAAQ;CACR,SAAS;CACT,aAAa;CACb,YAAY;CACZ,WAAW;CACX,UAAU;CACV,MAAM;CACN,KAAK;CACL,UAAU;AACZ"}
|
|
@@ -506,13 +506,10 @@ const DatePickerDay = forwardRef(function DatePickerDay({ children, className, d
|
|
|
506
506
|
nextDate = addMonths(date, event.shiftKey ? 12 : 1);
|
|
507
507
|
break;
|
|
508
508
|
case "Enter":
|
|
509
|
-
case " ":
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
}
|
|
514
|
-
break;
|
|
515
|
-
default: break;
|
|
509
|
+
case " ": if (!isDisabled) {
|
|
510
|
+
event.preventDefault();
|
|
511
|
+
onSelect(date);
|
|
512
|
+
}
|
|
516
513
|
}
|
|
517
514
|
if (nextDate) {
|
|
518
515
|
event.preventDefault();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-picker.js","names":["BasePopover"],"sources":["../../../src/components/date-picker/date-picker.tsx"],"sourcesContent":["\"use client\";\n\nimport { Popover as BasePopover } from \"@base-ui/react/popover\";\nimport {\n createContext,\n forwardRef,\n useCallback,\n useContext,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport type { ComponentPropsWithoutRef, KeyboardEvent, MouseEvent, ReactNode, Ref } from \"react\";\nimport type { PopoverRoot as BasePopoverRoot } from \"@base-ui/react/popover\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { datePicker } from \"../../styled-system/recipes\";\nimport { withRecipeClassName } from \"../base-ui\";\nimport { useThemePortalProps } from \"../../theme/theme-scope\";\nimport {\n addDays,\n addMonths,\n createCalendarDate,\n dateKey,\n formatDateLabel,\n formatMonthLabel,\n getCalendarDays,\n getDateRangeLabel,\n getMonthLabels,\n getWeekdayLabels,\n isAfterDay,\n isBeforeDay,\n isSameDay,\n startOfMonth,\n toInputDate,\n toInputDateTime,\n toInputMonth,\n toTimeInput,\n} from \"./date-utils\";\nimport type { DatePickerGranularity } from \"./date-utils\";\n\nexport type DatePickerSize = \"sm\" | \"md\" | \"lg\";\nexport type { DatePickerGranularity } from \"./date-utils\";\n\nexport interface DatePickerYearRange {\n start: number;\n end: number;\n}\n\ninterface DatePickerContextValue {\n canNavigate: (amount: number) => boolean;\n close: () => void;\n dateDisabled: (date: Date) => boolean;\n granularity: DatePickerGranularity;\n disabled: boolean;\n focusDate: (date: Date, direction?: number) => void;\n focusedDate: Date;\n formatDate: (date: Date | null) => string;\n labelId: string;\n locale: string;\n month: Date;\n monthDisabled: (date: Date) => boolean;\n onClear: () => void;\n onTimeChange: (value: string) => void;\n onSelect: (date: Date) => void;\n selectMonth: (month: number) => void;\n selectYear: (year: number) => void;\n placeholder: ReactNode;\n registerDay: (key: string, node: HTMLButtonElement | null) => void;\n selected: Date | null;\n setFocusedDate: (date: Date) => void;\n setMonth: (date: Date) => void;\n size: DatePickerSize;\n styles: ReturnType<typeof datePicker>;\n today: Date;\n timeMax: string | undefined;\n timeMin: string | undefined;\n triggerId: string;\n weekStartsOn: number;\n yearRange: DatePickerYearRange;\n}\n\nconst DatePickerContext = createContext<DatePickerContextValue | null>(null);\n\nfunction useDatePickerContext() {\n const context = useContext(DatePickerContext);\n if (!context) {\n throw new Error(\"DatePicker parts must be rendered inside DatePicker.Root.\");\n }\n\n return context;\n}\n\nfunction isSameMonth(left: Date, right: Date) {\n return left.getFullYear() === right.getFullYear() && left.getMonth() === right.getMonth();\n}\n\nfunction composeRefs<T>(first: Ref<T> | undefined, second: (value: T | null) => void) {\n return (value: T | null) => {\n second(value);\n if (typeof first === \"function\") {\n first(value);\n } else if (first) {\n first.current = value;\n }\n };\n}\n\nexport interface DatePickerRootProps extends Omit<BasePopoverRoot.Props, \"children\"> {\n /** Selected value. Use together with `onValueChange` for a controlled picker. */\n value?: Date | null;\n /** Initial selected value for an uncontrolled picker. */\n defaultValue?: Date | null;\n /** Called after a valid day, month, or time is selected, or when the value is cleared. */\n onValueChange?: (value: Date | null) => void;\n /** Prevents dates before this local calendar day from being selected. */\n minDate?: Date;\n /** Prevents dates after this local calendar day from being selected. */\n maxDate?: Date;\n /** Adds application-specific disabled dates, such as holidays or weekends. */\n isDateDisabled?: (date: Date) => boolean;\n /** Locale used for month, weekday and value formatting. */\n locale?: string;\n /** Called after the visible calendar month changes. */\n onMonthChange?: (month: Date) => void;\n /** First weekday in the calendar, where 0 is Sunday and 1 is Monday. */\n weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6;\n /** Text shown when no date has been selected. */\n placeholder?: ReactNode;\n /** Shared visual size for the trigger and calendar days. */\n size?: DatePickerSize;\n /** Controls whether the picker selects days, months, or date and time. */\n granularity?: DatePickerGranularity;\n /** Inclusive range used by the year selector. */\n yearRange?: DatePickerYearRange;\n /** Reference date used when no value is selected, useful for deterministic SSR and tests. */\n referenceDate?: Date;\n /** Adds a native hidden input using the representation for the selected granularity. */\n name?: string;\n /** Prevents interaction and disables the hidden form input. */\n disabled?: boolean;\n /** Closes the popup after a value is chosen. Defaults to false for date-time mode and true otherwise. */\n closeOnSelect?: boolean;\n children?: ReactNode;\n}\n\nexport function DatePickerRoot({\n children,\n closeOnSelect: closeOnSelectProp,\n defaultValue = null,\n disabled = false,\n granularity = \"day\",\n isDateDisabled,\n locale = \"pt-BR\",\n maxDate,\n minDate,\n name,\n onValueChange,\n onMonthChange,\n placeholder = \"Select a date\",\n size = \"md\",\n value: controlledValue,\n weekStartsOn = 0,\n yearRange: configuredYearRange,\n referenceDate,\n actionsRef: externalActionsRef,\n ...popoverProps\n}: DatePickerRootProps) {\n const [uncontrolledValue, setUncontrolledValue] = useState<Date | null>(defaultValue);\n const selected = controlledValue === undefined ? uncontrolledValue : controlledValue;\n const [month, setMonthState] = useState(() =>\n startOfMonth(selected ?? referenceDate ?? new Date()),\n );\n const [focusedDate, setFocusedDate] = useState(selected ?? referenceDate ?? month);\n const previousMonthRef = useRef(month);\n const internalActionsRef = useRef<BasePopoverRoot.Actions | null>(null);\n const dayRefs = useRef(new Map<string, HTMLButtonElement>());\n const labelId = useId();\n const triggerId = useId();\n const today = useMemo(() => referenceDate ?? new Date(), [referenceDate]);\n const styles = datePicker({ size });\n const minMonth = minDate ? startOfMonth(minDate) : undefined;\n const maxMonth = maxDate ? startOfMonth(maxDate) : undefined;\n const closeOnSelect = closeOnSelectProp ?? granularity !== \"date-time\";\n const yearRange = useMemo(() => {\n const defaultStart = today.getFullYear() - 100;\n const defaultEnd = today.getFullYear() + 20;\n const start = configuredYearRange?.start ?? defaultStart;\n const end = configuredYearRange?.end ?? defaultEnd;\n const years = [selected?.getFullYear(), minDate?.getFullYear(), maxDate?.getFullYear()].filter(\n (year): year is number => year !== undefined,\n );\n return {\n end: Math.max(start, end, ...years),\n start: Math.min(start, end, ...years),\n };\n }, [configuredYearRange?.end, configuredYearRange?.start, maxDate, minDate, selected, today]);\n\n const clampMonth = useCallback(\n (nextMonth: Date) => {\n const normalized = startOfMonth(nextMonth);\n if (minMonth && isBeforeDay(normalized, minMonth)) return minMonth;\n if (maxMonth && isAfterDay(normalized, maxMonth)) return maxMonth;\n return normalized;\n },\n [maxMonth, minMonth],\n );\n\n const setMonth = useCallback(\n (nextMonth: Date) => {\n const normalized = clampMonth(nextMonth);\n setMonthState((current) => {\n if (isSameMonth(current, normalized)) return current;\n return normalized;\n });\n },\n [clampMonth],\n );\n\n useEffect(() => {\n if (isSameMonth(previousMonthRef.current, month)) return;\n previousMonthRef.current = month;\n onMonthChange?.(month);\n }, [month, onMonthChange]);\n\n useEffect(() => {\n if (!selected) {\n return;\n }\n\n setFocusedDate(selected);\n setMonthState((current) => (isSameMonth(current, selected) ? current : clampMonth(selected)));\n }, [clampMonth, selected]);\n\n const dateDisabled = useCallback(\n (date: Date) =>\n Boolean(\n (minDate && isBeforeDay(date, minDate)) ||\n (maxDate && isAfterDay(date, maxDate)) ||\n isDateDisabled?.(date),\n ),\n [isDateDisabled, maxDate, minDate],\n );\n\n const close = useCallback(() => {\n (externalActionsRef ?? internalActionsRef).current?.close();\n }, [externalActionsRef]);\n\n const setValue = useCallback(\n (nextValue: Date | null) => {\n if (controlledValue === undefined) setUncontrolledValue(nextValue);\n onValueChange?.(nextValue);\n },\n [controlledValue, onValueChange],\n );\n\n const monthDisabled = useCallback(\n (candidate: Date) => {\n const firstDay = startOfMonth(candidate);\n const lastDay = createCalendarDate(candidate.getFullYear(), candidate.getMonth() + 1, 0);\n return Boolean(\n (minDate && isBeforeDay(lastDay, minDate)) || (maxDate && isAfterDay(firstDay, maxDate)),\n );\n },\n [maxDate, minDate],\n );\n\n const onSelect = useCallback(\n (date: Date) => {\n if (disabled || (granularity === \"month\" ? monthDisabled(date) : dateDisabled(date))) {\n return;\n }\n\n const nextValue = createCalendarDate(\n date.getFullYear(),\n date.getMonth(),\n granularity === \"month\" ? 1 : date.getDate(),\n );\n if (granularity === \"date-time\") {\n nextValue.setHours(selected?.getHours() ?? 12, selected?.getMinutes() ?? 0, 0, 0);\n if (minDate && isSameDay(nextValue, minDate) && nextValue < minDate) {\n nextValue.setHours(minDate.getHours(), minDate.getMinutes(), 0, 0);\n }\n if (maxDate && isSameDay(nextValue, maxDate) && nextValue > maxDate) {\n nextValue.setHours(maxDate.getHours(), maxDate.getMinutes(), 0, 0);\n }\n }\n setValue(nextValue);\n setFocusedDate(nextValue);\n setMonth(startOfMonth(nextValue));\n if (closeOnSelect) {\n close();\n }\n },\n [\n close,\n closeOnSelect,\n dateDisabled,\n disabled,\n granularity,\n maxDate,\n monthDisabled,\n minDate,\n selected,\n setMonth,\n setValue,\n ],\n );\n\n const onClear = useCallback(() => {\n setValue(null);\n }, [setValue]);\n\n const selectMonth = useCallback(\n (monthIndex: number) => {\n const nextMonth = clampMonth(createCalendarDate(month.getFullYear(), monthIndex, 1));\n if (monthDisabled(nextMonth)) return;\n setMonth(nextMonth);\n if (granularity === \"month\") {\n const nextValue = createCalendarDate(nextMonth.getFullYear(), nextMonth.getMonth(), 1);\n setFocusedDate(nextValue);\n setValue(nextValue);\n if (closeOnSelect) close();\n }\n },\n [clampMonth, close, closeOnSelect, granularity, month, monthDisabled, setMonth, setValue],\n );\n\n const selectYear = useCallback(\n (year: number) => {\n const nextMonth = clampMonth(createCalendarDate(year, month.getMonth(), 1));\n if (monthDisabled(nextMonth)) return;\n setMonth(nextMonth);\n if (granularity === \"month\") {\n const nextValue = createCalendarDate(nextMonth.getFullYear(), nextMonth.getMonth(), 1);\n setFocusedDate(nextValue);\n setValue(nextValue);\n if (closeOnSelect) close();\n }\n },\n [clampMonth, close, closeOnSelect, granularity, month, monthDisabled, setMonth, setValue],\n );\n\n const onTimeChange = useCallback(\n (value: string) => {\n const match = value.match(/^(\\d{2}):(\\d{2})$/);\n if (!match) return;\n const hours = Number(match[1]);\n const minutes = Number(match[2]);\n if (hours > 23 || minutes > 59) return;\n const baseDate = selected ?? focusedDate;\n const nextValue = createCalendarDate(\n baseDate.getFullYear(),\n baseDate.getMonth(),\n baseDate.getDate(),\n );\n nextValue.setHours(hours, minutes, 0, 0);\n if (minDate && isSameDay(nextValue, minDate) && nextValue < minDate) return;\n if (maxDate && isSameDay(nextValue, maxDate) && nextValue > maxDate) return;\n setValue(nextValue);\n },\n [focusedDate, maxDate, minDate, selected, setValue],\n );\n\n const focusDate = useCallback(\n (date: Date, direction = 1) => {\n let nextDate = createCalendarDate(date.getFullYear(), date.getMonth(), date.getDate());\n const step = direction < 0 ? -1 : 1;\n let attempts = 0;\n while (dateDisabled(nextDate) && attempts < 366) {\n nextDate = addDays(nextDate, step);\n attempts += 1;\n }\n\n setFocusedDate(nextDate);\n setMonth(nextDate);\n\n const focusTarget = () => dayRefs.current.get(dateKey(nextDate))?.focus();\n focusTarget();\n queueMicrotask(focusTarget);\n },\n [dateDisabled, setMonth],\n );\n\n const canNavigate = useCallback(\n (amount: number) => {\n const nextMonth = addMonths(month, amount);\n return !(\n (minMonth && isBeforeDay(nextMonth, minMonth)) ||\n (maxMonth && isAfterDay(nextMonth, maxMonth))\n );\n },\n [maxMonth, minMonth, month],\n );\n\n const registerDay = useCallback((key: string, node: HTMLButtonElement | null) => {\n if (node) {\n dayRefs.current.set(key, node);\n } else {\n dayRefs.current.delete(key);\n }\n }, []);\n\n const timeMin =\n selected && minDate && isSameDay(selected, minDate) ? toTimeInput(minDate) : undefined;\n const timeMax =\n selected && maxDate && isSameDay(selected, maxDate) ? toTimeInput(maxDate) : undefined;\n\n const context: DatePickerContextValue = {\n canNavigate,\n close,\n dateDisabled,\n granularity,\n disabled,\n focusDate,\n focusedDate,\n formatDate: (date) => formatDateLabel(date, locale, String(placeholder), granularity),\n labelId,\n locale,\n month,\n monthDisabled,\n onClear,\n onTimeChange,\n onSelect,\n selectMonth,\n selectYear,\n placeholder,\n registerDay,\n selected,\n setFocusedDate,\n setMonth,\n size,\n styles,\n today: createCalendarDate(today.getFullYear(), today.getMonth(), today.getDate()),\n timeMax,\n timeMin,\n triggerId,\n weekStartsOn,\n yearRange,\n };\n\n return (\n <DatePickerContext.Provider value={context}>\n <BasePopover.Root {...popoverProps} actionsRef={externalActionsRef ?? internalActionsRef}>\n {children}\n </BasePopover.Root>\n {name ? (\n <input\n disabled={disabled}\n name={name}\n type=\"hidden\"\n value={\n granularity === \"month\"\n ? toInputMonth(selected)\n : granularity === \"date-time\"\n ? toInputDateTime(selected)\n : toInputDate(selected)\n }\n />\n ) : null}\n </DatePickerContext.Provider>\n );\n}\n\nexport type DatePickerLabelProps = ComponentPropsWithoutRef<\"label\">;\n\nexport const DatePickerLabel = forwardRef<HTMLLabelElement, DatePickerLabelProps>(\n function DatePickerLabel({ children, className, ...props }, ref) {\n const { labelId, styles, triggerId } = useDatePickerContext();\n\n return (\n <label\n {...props}\n ref={ref}\n className={cx(styles.label, className)}\n data-slot=\"date-picker-label\"\n htmlFor={props.htmlFor ?? triggerId}\n id={props.id ?? labelId}\n >\n {children}\n </label>\n );\n },\n);\n\nexport type DatePickerControlProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const DatePickerControl = forwardRef<HTMLDivElement, DatePickerControlProps>(\n function DatePickerControl({ className, ...props }, ref) {\n const { styles } = useDatePickerContext();\n\n return (\n <div\n {...props}\n ref={ref}\n className={cx(styles.control, className)}\n data-jaci-component=\"date-picker\"\n data-slot=\"date-picker-control\"\n />\n );\n },\n);\n\nexport type DatePickerTriggerProps = ComponentPropsWithoutRef<typeof BasePopover.Trigger>;\n\nexport const DatePickerTrigger = forwardRef<HTMLButtonElement, DatePickerTriggerProps>(\n function DatePickerTrigger({ children, className, disabled, id, ...props }, ref) {\n const { disabled: pickerDisabled, styles, triggerId } = useDatePickerContext();\n\n return (\n <BasePopover.Trigger\n {...props}\n aria-label={props[\"aria-label\"] ?? \"Choose date\"}\n disabled={disabled ?? pickerDisabled}\n id={id ?? triggerId}\n ref={ref}\n className={withRecipeClassName(styles.trigger, className)}\n data-jaci-component=\"date-picker\"\n data-slot=\"date-picker-trigger\"\n >\n {children ?? (\n <>\n <DatePickerValue />\n <span aria-hidden=\"true\">▾</span>\n </>\n )}\n </BasePopover.Trigger>\n );\n },\n);\n\nexport interface DatePickerValueProps extends ComponentPropsWithoutRef<\"span\"> {\n placeholder?: ReactNode;\n}\n\nexport const DatePickerValue = forwardRef<HTMLSpanElement, DatePickerValueProps>(\n function DatePickerValue({ children, className, placeholder, ...props }, ref) {\n const { formatDate, selected, styles } = useDatePickerContext();\n const value = children ?? (selected ? formatDate(selected) : (placeholder ?? \"Select a date\"));\n\n return (\n <span\n {...props}\n ref={ref}\n className={cx(styles.value, className)}\n data-placeholder={selected ? undefined : \"true\"}\n data-slot=\"date-picker-value\"\n >\n {value}\n </span>\n );\n },\n);\n\nexport type DatePickerClearProps = ComponentPropsWithoutRef<\"button\">;\n\nexport const DatePickerClear = forwardRef<HTMLButtonElement, DatePickerClearProps>(\n function DatePickerClear({ children = \"×\", className, disabled, onClick, ...props }, ref) {\n const { close, disabled: pickerDisabled, onClear, selected, styles } = useDatePickerContext();\n const handleClick = (event: MouseEvent<HTMLButtonElement>) => {\n onClear();\n onClick?.(event);\n close();\n };\n\n return (\n <button\n {...props}\n aria-label={props[\"aria-label\"] ?? \"Clear date\"}\n className={cx(styles.clear, className)}\n data-slot=\"date-picker-clear\"\n disabled={disabled || pickerDisabled || !selected}\n onClick={handleClick}\n ref={ref}\n type=\"button\"\n >\n {children}\n </button>\n );\n },\n);\n\nexport type DatePickerPortalProps = ComponentPropsWithoutRef<typeof BasePopover.Portal>;\nexport function DatePickerPortal(props: DatePickerPortalProps) {\n return <BasePopover.Portal {...useThemePortalProps(props)} />;\n}\n\nexport type DatePickerPositionerProps = ComponentPropsWithoutRef<typeof BasePopover.Positioner>;\n\nexport const DatePickerPositioner = forwardRef<HTMLDivElement, DatePickerPositionerProps>(\n function DatePickerPositioner({ className, ...props }, ref) {\n const { styles } = useDatePickerContext();\n\n return (\n <BasePopover.Positioner\n {...props}\n ref={ref}\n className={withRecipeClassName(styles.positioner, className)}\n data-slot=\"date-picker-positioner\"\n />\n );\n },\n);\n\nexport type DatePickerPopupProps = ComponentPropsWithoutRef<typeof BasePopover.Popup>;\n\nexport const DatePickerPopup = forwardRef<HTMLDivElement, DatePickerPopupProps>(\n function DatePickerPopup({ className, ...props }, ref) {\n const { styles } = useDatePickerContext();\n\n return (\n <BasePopover.Popup\n {...props}\n ref={ref}\n aria-label={props[\"aria-label\"] ?? \"Calendar\"}\n className={withRecipeClassName(styles.popup, className)}\n data-slot=\"date-picker-popup\"\n />\n );\n },\n);\n\nexport type DatePickerCloseProps = ComponentPropsWithoutRef<typeof BasePopover.Close>;\n\nexport const DatePickerClose = forwardRef<HTMLButtonElement, DatePickerCloseProps>(\n function DatePickerClose({ className, ...props }, ref) {\n const { styles } = useDatePickerContext();\n\n return (\n <BasePopover.Close\n {...props}\n ref={ref}\n className={withRecipeClassName(styles.close, className)}\n data-slot=\"date-picker-close\"\n />\n );\n },\n);\n\nexport type DatePickerHeaderProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const DatePickerHeader = forwardRef<HTMLDivElement, DatePickerHeaderProps>(\n function DatePickerHeader({ className, ...props }, ref) {\n const { styles } = useDatePickerContext();\n\n return (\n <div\n {...props}\n ref={ref}\n className={cx(styles.header, className)}\n data-slot=\"date-picker-header\"\n />\n );\n },\n);\n\nexport type DatePickerCaptionProps = ComponentPropsWithoutRef<\"span\">;\n\nexport const DatePickerCaption = forwardRef<HTMLSpanElement, DatePickerCaptionProps>(\n function DatePickerCaption({ children, className, ...props }, ref) {\n const { locale, month, styles } = useDatePickerContext();\n\n return (\n <span\n {...props}\n ref={ref}\n className={cx(styles.caption, className)}\n data-slot=\"date-picker-caption\"\n >\n {children ?? formatMonthLabel(month, locale)}\n </span>\n );\n },\n);\n\nexport type DatePickerMonthSelectProps = Omit<\n ComponentPropsWithoutRef<\"select\">,\n \"children\" | \"onChange\" | \"value\"\n>;\n\nexport const DatePickerMonthSelect = forwardRef<HTMLSelectElement, DatePickerMonthSelectProps>(\n function DatePickerMonthSelect({ className, ...props }, ref) {\n const { locale, month, monthDisabled, selectMonth, styles } = useDatePickerContext();\n const labels = getMonthLabels(locale);\n\n return (\n <select\n {...props}\n aria-label={props[\"aria-label\"] ?? \"Select month\"}\n className={cx(styles.monthSelect, className)}\n data-slot=\"date-picker-month-select\"\n onChange={(event) => selectMonth(Number(event.currentTarget.value))}\n ref={ref}\n value={month.getMonth()}\n >\n {labels.map((label, monthIndex) => (\n <option\n disabled={monthDisabled(createCalendarDate(month.getFullYear(), monthIndex, 1))}\n key={label}\n value={monthIndex}\n >\n {label}\n </option>\n ))}\n </select>\n );\n },\n);\n\nexport type DatePickerYearSelectProps = Omit<\n ComponentPropsWithoutRef<\"select\">,\n \"children\" | \"onChange\" | \"value\"\n>;\n\nexport const DatePickerYearSelect = forwardRef<HTMLSelectElement, DatePickerYearSelectProps>(\n function DatePickerYearSelect({ className, ...props }, ref) {\n const { month, monthDisabled, selectYear, styles, yearRange } = useDatePickerContext();\n const years = Array.from(\n { length: yearRange.end - yearRange.start + 1 },\n (_, index) => yearRange.start + index,\n );\n\n return (\n <select\n {...props}\n aria-label={props[\"aria-label\"] ?? \"Select year\"}\n className={cx(styles.yearSelect, className)}\n data-slot=\"date-picker-year-select\"\n onChange={(event) => selectYear(Number(event.currentTarget.value))}\n ref={ref}\n value={month.getFullYear()}\n >\n {years.map((year) => (\n <option\n disabled={monthDisabled(createCalendarDate(year, month.getMonth(), 1))}\n key={year}\n value={year}\n >\n {year}\n </option>\n ))}\n </select>\n );\n },\n);\n\nexport type DatePickerTimeFieldProps = Omit<\n ComponentPropsWithoutRef<\"input\">,\n \"onChange\" | \"type\" | \"value\"\n>;\n\nexport const DatePickerTimeField = forwardRef<HTMLInputElement, DatePickerTimeFieldProps>(\n function DatePickerTimeField({ className, ...props }, ref) {\n const { disabled, granularity, onTimeChange, selected, styles, timeMax, timeMin } =\n useDatePickerContext();\n if (granularity !== \"date-time\") return null;\n\n return (\n <input\n {...props}\n aria-label={props[\"aria-label\"] ?? \"Select time\"}\n className={cx(styles.timeField, className)}\n data-slot=\"date-picker-time-field\"\n disabled={disabled || !selected}\n max={timeMax}\n min={timeMin}\n onChange={(event) => onTimeChange(event.currentTarget.value)}\n ref={ref}\n type=\"time\"\n value={toTimeInput(selected)}\n />\n );\n },\n);\n\nexport interface DatePickerNavigationProps extends ComponentPropsWithoutRef<\"button\"> {\n amount?: number;\n}\n\nconst DatePickerNavigationButton = forwardRef<HTMLButtonElement, DatePickerNavigationProps>(\n function DatePickerNavigationButton({ amount, children, className, onClick, ...props }, ref) {\n const { canNavigate, month, setMonth, styles } = useDatePickerContext();\n const direction = amount ?? 1;\n const isDisabled = props.disabled || !canNavigate(direction);\n\n return (\n <button\n {...props}\n aria-label={props[\"aria-label\"] ?? (direction < 0 ? \"Previous month\" : \"Next month\")}\n className={cx(styles.navigation, className)}\n data-slot={direction < 0 ? \"date-picker-previous\" : \"date-picker-next\"}\n disabled={isDisabled}\n onClick={(event) => {\n if (!isDisabled) setMonth(addMonths(month, direction));\n onClick?.(event);\n }}\n ref={ref}\n type=\"button\"\n >\n {children ?? (direction < 0 ? \"‹\" : \"›\")}\n </button>\n );\n },\n);\n\nexport const DatePickerPrevious = forwardRef<HTMLButtonElement, DatePickerNavigationProps>(\n function DatePickerPrevious(props, ref) {\n return <DatePickerNavigationButton {...props} amount={-1} ref={ref} />;\n },\n);\n\nexport const DatePickerNext = forwardRef<HTMLButtonElement, DatePickerNavigationProps>(\n function DatePickerNext(props, ref) {\n return <DatePickerNavigationButton {...props} amount={1} ref={ref} />;\n },\n);\n\nexport interface DatePickerDayProps extends Omit<ComponentPropsWithoutRef<\"button\">, \"value\"> {\n date: Date;\n}\n\nexport const DatePickerDay = forwardRef<HTMLButtonElement, DatePickerDayProps>(\n function DatePickerDay(\n { children, className, date, disabled, onClick, onKeyDown, ...props },\n ref,\n ) {\n const {\n dateDisabled,\n disabled: pickerDisabled,\n focusDate,\n focusedDate,\n locale,\n month,\n onSelect,\n registerDay,\n selected,\n styles,\n today,\n weekStartsOn,\n } = useDatePickerContext();\n const key = dateKey(date);\n const outsideMonth = !isSameMonth(date, month);\n const isDisabled = disabled || pickerDisabled || dateDisabled(date);\n const isFocused = isSameDay(date, focusedDate);\n const isSelected = isSameDay(date, selected);\n const isToday = isSameDay(date, today);\n const dayRef = composeRefs(ref, (node) => registerDay(key, node));\n\n const moveByKey = (event: KeyboardEvent<HTMLButtonElement>) => {\n if (event.defaultPrevented) {\n return;\n }\n\n let nextDate: Date | undefined;\n switch (event.key) {\n case \"ArrowLeft\":\n nextDate = addDays(date, -1);\n break;\n case \"ArrowRight\":\n nextDate = addDays(date, 1);\n break;\n case \"ArrowUp\":\n nextDate = addDays(date, -7);\n break;\n case \"ArrowDown\":\n nextDate = addDays(date, 7);\n break;\n case \"Home\":\n nextDate = addDays(date, -((date.getDay() - weekStartsOn + 7) % 7));\n break;\n case \"End\":\n nextDate = addDays(date, 6 - ((date.getDay() - weekStartsOn + 7) % 7));\n break;\n case \"PageUp\":\n nextDate = addMonths(date, event.shiftKey ? -12 : -1);\n break;\n case \"PageDown\":\n nextDate = addMonths(date, event.shiftKey ? 12 : 1);\n break;\n case \"Enter\":\n case \" \":\n if (!isDisabled) {\n event.preventDefault();\n onSelect(date);\n }\n break;\n default:\n break;\n }\n\n if (nextDate) {\n event.preventDefault();\n focusDate(nextDate, nextDate < date ? -1 : 1);\n }\n };\n\n return (\n // biome-ignore lint/a11y/useSemanticElements: A calendar day is an interactive gridcell, not a generic table cell.\n <button\n {...props}\n ref={dayRef}\n aria-label={props[\"aria-label\"] ?? getDateRangeLabel(date, locale)}\n aria-current={isToday ? \"date\" : undefined}\n aria-selected={isSelected}\n className={cx(styles.day, className)}\n data-date={key}\n data-disabled={isDisabled || undefined}\n data-outside-month={outsideMonth || undefined}\n data-selected={isSelected || undefined}\n data-slot=\"date-picker-day\"\n data-today={isToday || undefined}\n disabled={isDisabled}\n onClick={(event) => {\n onSelect(date);\n onClick?.(event);\n }}\n onKeyDown={(event) => {\n moveByKey(event);\n onKeyDown?.(event);\n }}\n role=\"gridcell\"\n tabIndex={isFocused && !isDisabled ? 0 : -1}\n type=\"button\"\n >\n {children ?? date.getDate()}\n </button>\n );\n },\n);\n\ninterface DatePickerMonthButtonProps {\n date: Date;\n}\n\nconst DatePickerMonthButton = forwardRef<HTMLButtonElement, DatePickerMonthButtonProps>(\n function DatePickerMonthButton({ date }, ref) {\n const { disabled, granularity, locale, monthDisabled, onSelect, selected, styles } =\n useDatePickerContext();\n const isDisabled = disabled || monthDisabled(date);\n const isSelected = granularity === \"month\" && Boolean(selected && isSameMonth(selected, date));\n\n return (\n // biome-ignore lint/a11y/useSemanticElements: Month choices use the calendar gridcell pattern.\n <button\n aria-label={new Intl.DateTimeFormat(locale, { month: \"long\" }).format(date)}\n aria-selected={isSelected}\n className={styles.month}\n data-disabled={isDisabled || undefined}\n data-selected={isSelected || undefined}\n data-slot=\"date-picker-month\"\n disabled={isDisabled}\n onClick={() => onSelect(date)}\n ref={ref}\n role=\"gridcell\"\n type=\"button\"\n >\n {new Intl.DateTimeFormat(locale, { month: \"short\" }).format(date)}\n </button>\n );\n },\n);\n\nexport interface DatePickerCalendarProps\n extends Omit<ComponentPropsWithoutRef<\"section\">, \"children\"> {\n \"aria-label\"?: string;\n}\n\nexport const DatePickerCalendar = forwardRef<HTMLElement, DatePickerCalendarProps>(\n function DatePickerCalendar({ \"aria-label\": ariaLabel, className, ...props }, ref) {\n const { granularity, locale, month, styles, weekStartsOn } = useDatePickerContext();\n const days = useMemo(() => getCalendarDays(month, weekStartsOn), [month, weekStartsOn]);\n const weekdays = useMemo(() => getWeekdayLabels(locale, weekStartsOn), [locale, weekStartsOn]);\n const monthDates = useMemo(\n () =>\n Array.from({ length: 12 }, (_, index) => createCalendarDate(month.getFullYear(), index, 1)),\n [month],\n );\n\n return (\n <section\n {...props}\n ref={ref}\n aria-label={ariaLabel ?? formatMonthLabel(month, locale)}\n className={cx(styles.calendar, className)}\n data-granularity={granularity}\n data-slot=\"date-picker-calendar\"\n >\n {granularity === \"month\" ? (\n // biome-ignore lint/a11y/useSemanticElements: Month selection uses the calendar grid pattern.\n <div\n aria-label={String(month.getFullYear())}\n className={styles.monthGrid}\n data-slot=\"date-picker-month-grid\"\n role=\"grid\"\n >\n {monthDates.map((date) => (\n <DatePickerMonthButton date={date} key={dateKey(date)} />\n ))}\n </div>\n ) : (\n <>\n <div aria-hidden=\"true\" className={styles.weekdays} data-slot=\"date-picker-weekdays\">\n {weekdays.map((weekday) => (\n <span className={styles.weekday} data-slot=\"date-picker-weekday\" key={weekday}>\n {weekday}\n </span>\n ))}\n </div>\n {/* biome-ignore lint/a11y/useSemanticElements: Calendar grids use the WAI-ARIA grid pattern for roving day focus. */}\n <div\n aria-label={formatMonthLabel(month, locale)}\n className={styles.grid}\n data-slot=\"date-picker-grid\"\n role=\"grid\"\n >\n {days.map((date) => (\n <DatePickerDay date={date} key={dateKey(date)} />\n ))}\n </div>\n </>\n )}\n </section>\n );\n },\n);\n\nexport const DatePicker = {\n Root: DatePickerRoot,\n Label: DatePickerLabel,\n Control: DatePickerControl,\n Trigger: DatePickerTrigger,\n Value: DatePickerValue,\n Clear: DatePickerClear,\n Portal: DatePickerPortal,\n Positioner: DatePickerPositioner,\n Popup: DatePickerPopup,\n Close: DatePickerClose,\n Header: DatePickerHeader,\n Caption: DatePickerCaption,\n MonthSelect: DatePickerMonthSelect,\n YearSelect: DatePickerYearSelect,\n TimeField: DatePickerTimeField,\n Previous: DatePickerPrevious,\n Next: DatePickerNext,\n Day: DatePickerDay,\n Calendar: DatePickerCalendar,\n};\n"],"mappings":";;;;;;;;;;AAoFA,MAAM,oBAAoB,cAA6C,IAAI;AAE3E,SAAS,uBAAuB;CAC9B,MAAM,UAAU,WAAW,iBAAiB;CAC5C,IAAI,CAAC,SACH,MAAM,IAAI,MAAM,2DAA2D;CAG7E,OAAO;AACT;AAEA,SAAS,YAAY,MAAY,OAAa;CAC5C,OAAO,KAAK,YAAY,MAAM,MAAM,YAAY,KAAK,KAAK,SAAS,MAAM,MAAM,SAAS;AAC1F;AAEA,SAAS,YAAe,OAA2B,QAAmC;CACpF,QAAQ,UAAoB;EAC1B,OAAO,KAAK;EACZ,IAAI,OAAO,UAAU,YACnB,MAAM,KAAK;OACN,IAAI,OACT,MAAM,UAAU;CAEpB;AACF;AAwCA,SAAgB,eAAe,EAC7B,UACA,eAAe,mBACf,eAAe,MACf,WAAW,OACX,cAAc,OACd,gBACA,SAAS,SACT,SACA,SACA,MACA,eACA,eACA,cAAc,iBACd,OAAO,MACP,OAAO,iBACP,eAAe,GACf,WAAW,qBACX,eACA,YAAY,oBACZ,GAAG,gBACmB;CACtB,MAAM,CAAC,mBAAmB,wBAAwB,SAAsB,YAAY;CACpF,MAAM,WAAW,oBAAoB,KAAA,IAAY,oBAAoB;CACrE,MAAM,CAAC,OAAO,iBAAiB,eAC7B,aAAa,YAAY,iCAAiB,IAAI,KAAK,CAAC,CACtD;CACA,MAAM,CAAC,aAAa,kBAAkB,SAAS,YAAY,iBAAiB,KAAK;CACjF,MAAM,mBAAmB,OAAO,KAA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AI,CACjD;EACE,CAAA,CACL,EAAA,CAAA;CAEG,CAAA;AAEb,CACF;AAEA,MAAa,aAAa;CACxB,MAAM;CACN,OAAO;CACP,SAAS;CACT,SAAS;CACT,OAAO;CACP,OAAO;CACP,QAAQ;CACR,YAAY;CACZ,OAAO;CACP,OAAO;CACP,QAAQ;CACR,SAAS;CACT,aAAa;CACb,YAAY;CACZ,WAAW;CACX,UAAU;CACV,MAAM;CACN,KAAK;CACL,UAAU;AACZ"}
|
|
1
|
+
{"version":3,"file":"date-picker.js","names":["BasePopover"],"sources":["../../../src/components/date-picker/date-picker.tsx"],"sourcesContent":["\"use client\";\n\nimport { Popover as BasePopover } from \"@base-ui/react/popover\";\nimport {\n createContext,\n forwardRef,\n useCallback,\n useContext,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport type { ComponentPropsWithoutRef, KeyboardEvent, MouseEvent, ReactNode, Ref } from \"react\";\nimport type { PopoverRoot as BasePopoverRoot } from \"@base-ui/react/popover\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { datePicker } from \"../../styled-system/recipes\";\nimport { withRecipeClassName } from \"../base-ui\";\nimport { useThemePortalProps } from \"../../theme/theme-scope\";\nimport {\n addDays,\n addMonths,\n createCalendarDate,\n dateKey,\n formatDateLabel,\n formatMonthLabel,\n getCalendarDays,\n getDateRangeLabel,\n getMonthLabels,\n getWeekdayLabels,\n isAfterDay,\n isBeforeDay,\n isSameDay,\n startOfMonth,\n toInputDate,\n toInputDateTime,\n toInputMonth,\n toTimeInput,\n} from \"./date-utils\";\nimport type { DatePickerGranularity } from \"./date-utils\";\n\nexport type DatePickerSize = \"sm\" | \"md\" | \"lg\";\nexport type { DatePickerGranularity } from \"./date-utils\";\n\nexport interface DatePickerYearRange {\n start: number;\n end: number;\n}\n\ninterface DatePickerContextValue {\n canNavigate: (amount: number) => boolean;\n close: () => void;\n dateDisabled: (date: Date) => boolean;\n granularity: DatePickerGranularity;\n disabled: boolean;\n focusDate: (date: Date, direction?: number) => void;\n focusedDate: Date;\n formatDate: (date: Date | null) => string;\n labelId: string;\n locale: string;\n month: Date;\n monthDisabled: (date: Date) => boolean;\n onClear: () => void;\n onTimeChange: (value: string) => void;\n onSelect: (date: Date) => void;\n selectMonth: (month: number) => void;\n selectYear: (year: number) => void;\n placeholder: ReactNode;\n registerDay: (key: string, node: HTMLButtonElement | null) => void;\n selected: Date | null;\n setFocusedDate: (date: Date) => void;\n setMonth: (date: Date) => void;\n size: DatePickerSize;\n styles: ReturnType<typeof datePicker>;\n today: Date;\n timeMax: string | undefined;\n timeMin: string | undefined;\n triggerId: string;\n weekStartsOn: number;\n yearRange: DatePickerYearRange;\n}\n\nconst DatePickerContext = createContext<DatePickerContextValue | null>(null);\n\nfunction useDatePickerContext() {\n const context = useContext(DatePickerContext);\n if (!context) {\n throw new Error(\"DatePicker parts must be rendered inside DatePicker.Root.\");\n }\n\n return context;\n}\n\nfunction isSameMonth(left: Date, right: Date) {\n return left.getFullYear() === right.getFullYear() && left.getMonth() === right.getMonth();\n}\n\nfunction composeRefs<T>(first: Ref<T> | undefined, second: (value: T | null) => void) {\n return (value: T | null) => {\n second(value);\n if (typeof first === \"function\") {\n first(value);\n } else if (first) {\n first.current = value;\n }\n };\n}\n\nexport interface DatePickerRootProps extends Omit<BasePopoverRoot.Props, \"children\"> {\n /** Selected value. Use together with `onValueChange` for a controlled picker. */\n value?: Date | null;\n /** Initial selected value for an uncontrolled picker. */\n defaultValue?: Date | null;\n /** Called after a valid day, month, or time is selected, or when the value is cleared. */\n onValueChange?: (value: Date | null) => void;\n /** Prevents dates before this local calendar day from being selected. */\n minDate?: Date;\n /** Prevents dates after this local calendar day from being selected. */\n maxDate?: Date;\n /** Adds application-specific disabled dates, such as holidays or weekends. */\n isDateDisabled?: (date: Date) => boolean;\n /** Locale used for month, weekday and value formatting. */\n locale?: string;\n /** Called after the visible calendar month changes. */\n onMonthChange?: (month: Date) => void;\n /** First weekday in the calendar, where 0 is Sunday and 1 is Monday. */\n weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6;\n /** Text shown when no date has been selected. */\n placeholder?: ReactNode;\n /** Shared visual size for the trigger and calendar days. */\n size?: DatePickerSize;\n /** Controls whether the picker selects days, months, or date and time. */\n granularity?: DatePickerGranularity;\n /** Inclusive range used by the year selector. */\n yearRange?: DatePickerYearRange;\n /** Reference date used when no value is selected, useful for deterministic SSR and tests. */\n referenceDate?: Date;\n /** Adds a native hidden input using the representation for the selected granularity. */\n name?: string;\n /** Prevents interaction and disables the hidden form input. */\n disabled?: boolean;\n /** Closes the popup after a value is chosen. Defaults to false for date-time mode and true otherwise. */\n closeOnSelect?: boolean;\n children?: ReactNode;\n}\n\nexport function DatePickerRoot({\n children,\n closeOnSelect: closeOnSelectProp,\n defaultValue = null,\n disabled = false,\n granularity = \"day\",\n isDateDisabled,\n locale = \"pt-BR\",\n maxDate,\n minDate,\n name,\n onValueChange,\n onMonthChange,\n placeholder = \"Select a date\",\n size = \"md\",\n value: controlledValue,\n weekStartsOn = 0,\n yearRange: configuredYearRange,\n referenceDate,\n actionsRef: externalActionsRef,\n ...popoverProps\n}: DatePickerRootProps) {\n const [uncontrolledValue, setUncontrolledValue] = useState<Date | null>(defaultValue);\n const selected = controlledValue === undefined ? uncontrolledValue : controlledValue;\n const [month, setMonthState] = useState(() =>\n startOfMonth(selected ?? referenceDate ?? new Date()),\n );\n const [focusedDate, setFocusedDate] = useState(selected ?? referenceDate ?? month);\n const previousMonthRef = useRef(month);\n const internalActionsRef = useRef<BasePopoverRoot.Actions | null>(null);\n const dayRefs = useRef(new Map<string, HTMLButtonElement>());\n const labelId = useId();\n const triggerId = useId();\n const today = useMemo(() => referenceDate ?? new Date(), [referenceDate]);\n const styles = datePicker({ size });\n const minMonth = minDate ? startOfMonth(minDate) : undefined;\n const maxMonth = maxDate ? startOfMonth(maxDate) : undefined;\n const closeOnSelect = closeOnSelectProp ?? granularity !== \"date-time\";\n const yearRange = useMemo(() => {\n const defaultStart = today.getFullYear() - 100;\n const defaultEnd = today.getFullYear() + 20;\n const start = configuredYearRange?.start ?? defaultStart;\n const end = configuredYearRange?.end ?? defaultEnd;\n const years = [selected?.getFullYear(), minDate?.getFullYear(), maxDate?.getFullYear()].filter(\n (year): year is number => year !== undefined,\n );\n return {\n end: Math.max(start, end, ...years),\n start: Math.min(start, end, ...years),\n };\n }, [configuredYearRange?.end, configuredYearRange?.start, maxDate, minDate, selected, today]);\n\n const clampMonth = useCallback(\n (nextMonth: Date) => {\n const normalized = startOfMonth(nextMonth);\n if (minMonth && isBeforeDay(normalized, minMonth)) return minMonth;\n if (maxMonth && isAfterDay(normalized, maxMonth)) return maxMonth;\n return normalized;\n },\n [maxMonth, minMonth],\n );\n\n const setMonth = useCallback(\n (nextMonth: Date) => {\n const normalized = clampMonth(nextMonth);\n setMonthState((current) => {\n if (isSameMonth(current, normalized)) return current;\n return normalized;\n });\n },\n [clampMonth],\n );\n\n useEffect(() => {\n if (isSameMonth(previousMonthRef.current, month)) return;\n previousMonthRef.current = month;\n onMonthChange?.(month);\n }, [month, onMonthChange]);\n\n useEffect(() => {\n if (!selected) {\n return;\n }\n\n setFocusedDate(selected);\n setMonthState((current) => (isSameMonth(current, selected) ? current : clampMonth(selected)));\n }, [clampMonth, selected]);\n\n const dateDisabled = useCallback(\n (date: Date) =>\n Boolean(\n (minDate && isBeforeDay(date, minDate)) ||\n (maxDate && isAfterDay(date, maxDate)) ||\n isDateDisabled?.(date),\n ),\n [isDateDisabled, maxDate, minDate],\n );\n\n const close = useCallback(() => {\n (externalActionsRef ?? internalActionsRef).current?.close();\n }, [externalActionsRef]);\n\n const setValue = useCallback(\n (nextValue: Date | null) => {\n if (controlledValue === undefined) setUncontrolledValue(nextValue);\n onValueChange?.(nextValue);\n },\n [controlledValue, onValueChange],\n );\n\n const monthDisabled = useCallback(\n (candidate: Date) => {\n const firstDay = startOfMonth(candidate);\n const lastDay = createCalendarDate(candidate.getFullYear(), candidate.getMonth() + 1, 0);\n return Boolean(\n (minDate && isBeforeDay(lastDay, minDate)) || (maxDate && isAfterDay(firstDay, maxDate)),\n );\n },\n [maxDate, minDate],\n );\n\n const onSelect = useCallback(\n (date: Date) => {\n if (disabled || (granularity === \"month\" ? monthDisabled(date) : dateDisabled(date))) {\n return;\n }\n\n const nextValue = createCalendarDate(\n date.getFullYear(),\n date.getMonth(),\n granularity === \"month\" ? 1 : date.getDate(),\n );\n if (granularity === \"date-time\") {\n nextValue.setHours(selected?.getHours() ?? 12, selected?.getMinutes() ?? 0, 0, 0);\n if (minDate && isSameDay(nextValue, minDate) && nextValue < minDate) {\n nextValue.setHours(minDate.getHours(), minDate.getMinutes(), 0, 0);\n }\n if (maxDate && isSameDay(nextValue, maxDate) && nextValue > maxDate) {\n nextValue.setHours(maxDate.getHours(), maxDate.getMinutes(), 0, 0);\n }\n }\n setValue(nextValue);\n setFocusedDate(nextValue);\n setMonth(startOfMonth(nextValue));\n if (closeOnSelect) {\n close();\n }\n },\n [\n close,\n closeOnSelect,\n dateDisabled,\n disabled,\n granularity,\n maxDate,\n monthDisabled,\n minDate,\n selected,\n setMonth,\n setValue,\n ],\n );\n\n const onClear = useCallback(() => {\n setValue(null);\n }, [setValue]);\n\n const selectMonth = useCallback(\n (monthIndex: number) => {\n const nextMonth = clampMonth(createCalendarDate(month.getFullYear(), monthIndex, 1));\n if (monthDisabled(nextMonth)) return;\n setMonth(nextMonth);\n if (granularity === \"month\") {\n const nextValue = createCalendarDate(nextMonth.getFullYear(), nextMonth.getMonth(), 1);\n setFocusedDate(nextValue);\n setValue(nextValue);\n if (closeOnSelect) close();\n }\n },\n [clampMonth, close, closeOnSelect, granularity, month, monthDisabled, setMonth, setValue],\n );\n\n const selectYear = useCallback(\n (year: number) => {\n const nextMonth = clampMonth(createCalendarDate(year, month.getMonth(), 1));\n if (monthDisabled(nextMonth)) return;\n setMonth(nextMonth);\n if (granularity === \"month\") {\n const nextValue = createCalendarDate(nextMonth.getFullYear(), nextMonth.getMonth(), 1);\n setFocusedDate(nextValue);\n setValue(nextValue);\n if (closeOnSelect) close();\n }\n },\n [clampMonth, close, closeOnSelect, granularity, month, monthDisabled, setMonth, setValue],\n );\n\n const onTimeChange = useCallback(\n (value: string) => {\n const match = value.match(/^(\\d{2}):(\\d{2})$/);\n if (!match) return;\n const hours = Number(match[1]);\n const minutes = Number(match[2]);\n if (hours > 23 || minutes > 59) return;\n const baseDate = selected ?? focusedDate;\n const nextValue = createCalendarDate(\n baseDate.getFullYear(),\n baseDate.getMonth(),\n baseDate.getDate(),\n );\n nextValue.setHours(hours, minutes, 0, 0);\n if (minDate && isSameDay(nextValue, minDate) && nextValue < minDate) return;\n if (maxDate && isSameDay(nextValue, maxDate) && nextValue > maxDate) return;\n setValue(nextValue);\n },\n [focusedDate, maxDate, minDate, selected, setValue],\n );\n\n const focusDate = useCallback(\n (date: Date, direction = 1) => {\n let nextDate = createCalendarDate(date.getFullYear(), date.getMonth(), date.getDate());\n const step = direction < 0 ? -1 : 1;\n let attempts = 0;\n while (dateDisabled(nextDate) && attempts < 366) {\n nextDate = addDays(nextDate, step);\n attempts += 1;\n }\n\n setFocusedDate(nextDate);\n setMonth(nextDate);\n\n const focusTarget = () => dayRefs.current.get(dateKey(nextDate))?.focus();\n focusTarget();\n queueMicrotask(focusTarget);\n },\n [dateDisabled, setMonth],\n );\n\n const canNavigate = useCallback(\n (amount: number) => {\n const nextMonth = addMonths(month, amount);\n return !(\n (minMonth && isBeforeDay(nextMonth, minMonth)) ||\n (maxMonth && isAfterDay(nextMonth, maxMonth))\n );\n },\n [maxMonth, minMonth, month],\n );\n\n const registerDay = useCallback((key: string, node: HTMLButtonElement | null) => {\n if (node) {\n dayRefs.current.set(key, node);\n } else {\n dayRefs.current.delete(key);\n }\n }, []);\n\n const timeMin =\n selected && minDate && isSameDay(selected, minDate) ? toTimeInput(minDate) : undefined;\n const timeMax =\n selected && maxDate && isSameDay(selected, maxDate) ? toTimeInput(maxDate) : undefined;\n\n const context: DatePickerContextValue = {\n canNavigate,\n close,\n dateDisabled,\n granularity,\n disabled,\n focusDate,\n focusedDate,\n formatDate: (date) => formatDateLabel(date, locale, String(placeholder), granularity),\n labelId,\n locale,\n month,\n monthDisabled,\n onClear,\n onTimeChange,\n onSelect,\n selectMonth,\n selectYear,\n placeholder,\n registerDay,\n selected,\n setFocusedDate,\n setMonth,\n size,\n styles,\n today: createCalendarDate(today.getFullYear(), today.getMonth(), today.getDate()),\n timeMax,\n timeMin,\n triggerId,\n weekStartsOn,\n yearRange,\n };\n\n return (\n <DatePickerContext.Provider value={context}>\n <BasePopover.Root {...popoverProps} actionsRef={externalActionsRef ?? internalActionsRef}>\n {children}\n </BasePopover.Root>\n {name ? (\n <input\n disabled={disabled}\n name={name}\n type=\"hidden\"\n value={\n granularity === \"month\"\n ? toInputMonth(selected)\n : granularity === \"date-time\"\n ? toInputDateTime(selected)\n : toInputDate(selected)\n }\n />\n ) : null}\n </DatePickerContext.Provider>\n );\n}\n\nexport type DatePickerLabelProps = ComponentPropsWithoutRef<\"label\">;\n\nexport const DatePickerLabel = forwardRef<HTMLLabelElement, DatePickerLabelProps>(\n function DatePickerLabel({ children, className, ...props }, ref) {\n const { labelId, styles, triggerId } = useDatePickerContext();\n\n return (\n <label\n {...props}\n ref={ref}\n className={cx(styles.label, className)}\n data-slot=\"date-picker-label\"\n htmlFor={props.htmlFor ?? triggerId}\n id={props.id ?? labelId}\n >\n {children}\n </label>\n );\n },\n);\n\nexport type DatePickerControlProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const DatePickerControl = forwardRef<HTMLDivElement, DatePickerControlProps>(\n function DatePickerControl({ className, ...props }, ref) {\n const { styles } = useDatePickerContext();\n\n return (\n <div\n {...props}\n ref={ref}\n className={cx(styles.control, className)}\n data-jaci-component=\"date-picker\"\n data-slot=\"date-picker-control\"\n />\n );\n },\n);\n\nexport type DatePickerTriggerProps = ComponentPropsWithoutRef<typeof BasePopover.Trigger>;\n\nexport const DatePickerTrigger = forwardRef<HTMLButtonElement, DatePickerTriggerProps>(\n function DatePickerTrigger({ children, className, disabled, id, ...props }, ref) {\n const { disabled: pickerDisabled, styles, triggerId } = useDatePickerContext();\n\n return (\n <BasePopover.Trigger\n {...props}\n aria-label={props[\"aria-label\"] ?? \"Choose date\"}\n disabled={disabled ?? pickerDisabled}\n id={id ?? triggerId}\n ref={ref}\n className={withRecipeClassName(styles.trigger, className)}\n data-jaci-component=\"date-picker\"\n data-slot=\"date-picker-trigger\"\n >\n {children ?? (\n <>\n <DatePickerValue />\n <span aria-hidden=\"true\">▾</span>\n </>\n )}\n </BasePopover.Trigger>\n );\n },\n);\n\nexport interface DatePickerValueProps extends ComponentPropsWithoutRef<\"span\"> {\n placeholder?: ReactNode;\n}\n\nexport const DatePickerValue = forwardRef<HTMLSpanElement, DatePickerValueProps>(\n function DatePickerValue({ children, className, placeholder, ...props }, ref) {\n const { formatDate, selected, styles } = useDatePickerContext();\n const value = children ?? (selected ? formatDate(selected) : (placeholder ?? \"Select a date\"));\n\n return (\n <span\n {...props}\n ref={ref}\n className={cx(styles.value, className)}\n data-placeholder={selected ? undefined : \"true\"}\n data-slot=\"date-picker-value\"\n >\n {value}\n </span>\n );\n },\n);\n\nexport type DatePickerClearProps = ComponentPropsWithoutRef<\"button\">;\n\nexport const DatePickerClear = forwardRef<HTMLButtonElement, DatePickerClearProps>(\n function DatePickerClear({ children = \"×\", className, disabled, onClick, ...props }, ref) {\n const { close, disabled: pickerDisabled, onClear, selected, styles } = useDatePickerContext();\n const handleClick = (event: MouseEvent<HTMLButtonElement>) => {\n onClear();\n onClick?.(event);\n close();\n };\n\n return (\n <button\n {...props}\n aria-label={props[\"aria-label\"] ?? \"Clear date\"}\n className={cx(styles.clear, className)}\n data-slot=\"date-picker-clear\"\n disabled={disabled || pickerDisabled || !selected}\n onClick={handleClick}\n ref={ref}\n type=\"button\"\n >\n {children}\n </button>\n );\n },\n);\n\nexport type DatePickerPortalProps = ComponentPropsWithoutRef<typeof BasePopover.Portal>;\nexport function DatePickerPortal(props: DatePickerPortalProps) {\n return <BasePopover.Portal {...useThemePortalProps(props)} />;\n}\n\nexport type DatePickerPositionerProps = ComponentPropsWithoutRef<typeof BasePopover.Positioner>;\n\nexport const DatePickerPositioner = forwardRef<HTMLDivElement, DatePickerPositionerProps>(\n function DatePickerPositioner({ className, ...props }, ref) {\n const { styles } = useDatePickerContext();\n\n return (\n <BasePopover.Positioner\n {...props}\n ref={ref}\n className={withRecipeClassName(styles.positioner, className)}\n data-slot=\"date-picker-positioner\"\n />\n );\n },\n);\n\nexport type DatePickerPopupProps = ComponentPropsWithoutRef<typeof BasePopover.Popup>;\n\nexport const DatePickerPopup = forwardRef<HTMLDivElement, DatePickerPopupProps>(\n function DatePickerPopup({ className, ...props }, ref) {\n const { styles } = useDatePickerContext();\n\n return (\n <BasePopover.Popup\n {...props}\n ref={ref}\n aria-label={props[\"aria-label\"] ?? \"Calendar\"}\n className={withRecipeClassName(styles.popup, className)}\n data-slot=\"date-picker-popup\"\n />\n );\n },\n);\n\nexport type DatePickerCloseProps = ComponentPropsWithoutRef<typeof BasePopover.Close>;\n\nexport const DatePickerClose = forwardRef<HTMLButtonElement, DatePickerCloseProps>(\n function DatePickerClose({ className, ...props }, ref) {\n const { styles } = useDatePickerContext();\n\n return (\n <BasePopover.Close\n {...props}\n ref={ref}\n className={withRecipeClassName(styles.close, className)}\n data-slot=\"date-picker-close\"\n />\n );\n },\n);\n\nexport type DatePickerHeaderProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const DatePickerHeader = forwardRef<HTMLDivElement, DatePickerHeaderProps>(\n function DatePickerHeader({ className, ...props }, ref) {\n const { styles } = useDatePickerContext();\n\n return (\n <div\n {...props}\n ref={ref}\n className={cx(styles.header, className)}\n data-slot=\"date-picker-header\"\n />\n );\n },\n);\n\nexport type DatePickerCaptionProps = ComponentPropsWithoutRef<\"span\">;\n\nexport const DatePickerCaption = forwardRef<HTMLSpanElement, DatePickerCaptionProps>(\n function DatePickerCaption({ children, className, ...props }, ref) {\n const { locale, month, styles } = useDatePickerContext();\n\n return (\n <span\n {...props}\n ref={ref}\n className={cx(styles.caption, className)}\n data-slot=\"date-picker-caption\"\n >\n {children ?? formatMonthLabel(month, locale)}\n </span>\n );\n },\n);\n\nexport type DatePickerMonthSelectProps = Omit<\n ComponentPropsWithoutRef<\"select\">,\n \"children\" | \"onChange\" | \"value\"\n>;\n\nexport const DatePickerMonthSelect = forwardRef<HTMLSelectElement, DatePickerMonthSelectProps>(\n function DatePickerMonthSelect({ className, ...props }, ref) {\n const { locale, month, monthDisabled, selectMonth, styles } = useDatePickerContext();\n const labels = getMonthLabels(locale);\n\n return (\n <select\n {...props}\n aria-label={props[\"aria-label\"] ?? \"Select month\"}\n className={cx(styles.monthSelect, className)}\n data-slot=\"date-picker-month-select\"\n onChange={(event) => selectMonth(Number(event.currentTarget.value))}\n ref={ref}\n value={month.getMonth()}\n >\n {labels.map((label, monthIndex) => (\n <option\n disabled={monthDisabled(createCalendarDate(month.getFullYear(), monthIndex, 1))}\n key={label}\n value={monthIndex}\n >\n {label}\n </option>\n ))}\n </select>\n );\n },\n);\n\nexport type DatePickerYearSelectProps = Omit<\n ComponentPropsWithoutRef<\"select\">,\n \"children\" | \"onChange\" | \"value\"\n>;\n\nexport const DatePickerYearSelect = forwardRef<HTMLSelectElement, DatePickerYearSelectProps>(\n function DatePickerYearSelect({ className, ...props }, ref) {\n const { month, monthDisabled, selectYear, styles, yearRange } = useDatePickerContext();\n const years = Array.from(\n { length: yearRange.end - yearRange.start + 1 },\n (_, index) => yearRange.start + index,\n );\n\n return (\n <select\n {...props}\n aria-label={props[\"aria-label\"] ?? \"Select year\"}\n className={cx(styles.yearSelect, className)}\n data-slot=\"date-picker-year-select\"\n onChange={(event) => selectYear(Number(event.currentTarget.value))}\n ref={ref}\n value={month.getFullYear()}\n >\n {years.map((year) => (\n <option\n disabled={monthDisabled(createCalendarDate(year, month.getMonth(), 1))}\n key={year}\n value={year}\n >\n {year}\n </option>\n ))}\n </select>\n );\n },\n);\n\nexport type DatePickerTimeFieldProps = Omit<\n ComponentPropsWithoutRef<\"input\">,\n \"onChange\" | \"type\" | \"value\"\n>;\n\nexport const DatePickerTimeField = forwardRef<HTMLInputElement, DatePickerTimeFieldProps>(\n function DatePickerTimeField({ className, ...props }, ref) {\n const { disabled, granularity, onTimeChange, selected, styles, timeMax, timeMin } =\n useDatePickerContext();\n if (granularity !== \"date-time\") return null;\n\n return (\n <input\n {...props}\n aria-label={props[\"aria-label\"] ?? \"Select time\"}\n className={cx(styles.timeField, className)}\n data-slot=\"date-picker-time-field\"\n disabled={disabled || !selected}\n max={timeMax}\n min={timeMin}\n onChange={(event) => onTimeChange(event.currentTarget.value)}\n ref={ref}\n type=\"time\"\n value={toTimeInput(selected)}\n />\n );\n },\n);\n\nexport interface DatePickerNavigationProps extends ComponentPropsWithoutRef<\"button\"> {\n amount?: number;\n}\n\nconst DatePickerNavigationButton = forwardRef<HTMLButtonElement, DatePickerNavigationProps>(\n function DatePickerNavigationButton({ amount, children, className, onClick, ...props }, ref) {\n const { canNavigate, month, setMonth, styles } = useDatePickerContext();\n const direction = amount ?? 1;\n const isDisabled = props.disabled || !canNavigate(direction);\n\n return (\n <button\n {...props}\n aria-label={props[\"aria-label\"] ?? (direction < 0 ? \"Previous month\" : \"Next month\")}\n className={cx(styles.navigation, className)}\n data-slot={direction < 0 ? \"date-picker-previous\" : \"date-picker-next\"}\n disabled={isDisabled}\n onClick={(event) => {\n if (!isDisabled) setMonth(addMonths(month, direction));\n onClick?.(event);\n }}\n ref={ref}\n type=\"button\"\n >\n {children ?? (direction < 0 ? \"‹\" : \"›\")}\n </button>\n );\n },\n);\n\nexport const DatePickerPrevious = forwardRef<HTMLButtonElement, DatePickerNavigationProps>(\n function DatePickerPrevious(props, ref) {\n return <DatePickerNavigationButton {...props} amount={-1} ref={ref} />;\n },\n);\n\nexport const DatePickerNext = forwardRef<HTMLButtonElement, DatePickerNavigationProps>(\n function DatePickerNext(props, ref) {\n return <DatePickerNavigationButton {...props} amount={1} ref={ref} />;\n },\n);\n\nexport interface DatePickerDayProps extends Omit<ComponentPropsWithoutRef<\"button\">, \"value\"> {\n date: Date;\n}\n\nexport const DatePickerDay = forwardRef<HTMLButtonElement, DatePickerDayProps>(\n function DatePickerDay(\n { children, className, date, disabled, onClick, onKeyDown, ...props },\n ref,\n ) {\n const {\n dateDisabled,\n disabled: pickerDisabled,\n focusDate,\n focusedDate,\n locale,\n month,\n onSelect,\n registerDay,\n selected,\n styles,\n today,\n weekStartsOn,\n } = useDatePickerContext();\n const key = dateKey(date);\n const outsideMonth = !isSameMonth(date, month);\n const isDisabled = disabled || pickerDisabled || dateDisabled(date);\n const isFocused = isSameDay(date, focusedDate);\n const isSelected = isSameDay(date, selected);\n const isToday = isSameDay(date, today);\n const dayRef = composeRefs(ref, (node) => registerDay(key, node));\n\n const moveByKey = (event: KeyboardEvent<HTMLButtonElement>) => {\n if (event.defaultPrevented) {\n return;\n }\n\n let nextDate: Date | undefined;\n switch (event.key) {\n case \"ArrowLeft\":\n nextDate = addDays(date, -1);\n break;\n case \"ArrowRight\":\n nextDate = addDays(date, 1);\n break;\n case \"ArrowUp\":\n nextDate = addDays(date, -7);\n break;\n case \"ArrowDown\":\n nextDate = addDays(date, 7);\n break;\n case \"Home\":\n nextDate = addDays(date, -((date.getDay() - weekStartsOn + 7) % 7));\n break;\n case \"End\":\n nextDate = addDays(date, 6 - ((date.getDay() - weekStartsOn + 7) % 7));\n break;\n case \"PageUp\":\n nextDate = addMonths(date, event.shiftKey ? -12 : -1);\n break;\n case \"PageDown\":\n nextDate = addMonths(date, event.shiftKey ? 12 : 1);\n break;\n case \"Enter\":\n case \" \":\n if (!isDisabled) {\n event.preventDefault();\n onSelect(date);\n }\n break;\n default:\n break;\n }\n\n if (nextDate) {\n event.preventDefault();\n focusDate(nextDate, nextDate < date ? -1 : 1);\n }\n };\n\n return (\n // biome-ignore lint/a11y/useSemanticElements: A calendar day is an interactive gridcell, not a generic table cell.\n <button\n {...props}\n ref={dayRef}\n aria-label={props[\"aria-label\"] ?? getDateRangeLabel(date, locale)}\n aria-current={isToday ? \"date\" : undefined}\n aria-selected={isSelected}\n className={cx(styles.day, className)}\n data-date={key}\n data-disabled={isDisabled || undefined}\n data-outside-month={outsideMonth || undefined}\n data-selected={isSelected || undefined}\n data-slot=\"date-picker-day\"\n data-today={isToday || undefined}\n disabled={isDisabled}\n onClick={(event) => {\n onSelect(date);\n onClick?.(event);\n }}\n onKeyDown={(event) => {\n moveByKey(event);\n onKeyDown?.(event);\n }}\n role=\"gridcell\"\n tabIndex={isFocused && !isDisabled ? 0 : -1}\n type=\"button\"\n >\n {children ?? date.getDate()}\n </button>\n );\n },\n);\n\ninterface DatePickerMonthButtonProps {\n date: Date;\n}\n\nconst DatePickerMonthButton = forwardRef<HTMLButtonElement, DatePickerMonthButtonProps>(\n function DatePickerMonthButton({ date }, ref) {\n const { disabled, granularity, locale, monthDisabled, onSelect, selected, styles } =\n useDatePickerContext();\n const isDisabled = disabled || monthDisabled(date);\n const isSelected = granularity === \"month\" && Boolean(selected && isSameMonth(selected, date));\n\n return (\n // biome-ignore lint/a11y/useSemanticElements: Month choices use the calendar gridcell pattern.\n <button\n aria-label={new Intl.DateTimeFormat(locale, { month: \"long\" }).format(date)}\n aria-selected={isSelected}\n className={styles.month}\n data-disabled={isDisabled || undefined}\n data-selected={isSelected || undefined}\n data-slot=\"date-picker-month\"\n disabled={isDisabled}\n onClick={() => onSelect(date)}\n ref={ref}\n role=\"gridcell\"\n type=\"button\"\n >\n {new Intl.DateTimeFormat(locale, { month: \"short\" }).format(date)}\n </button>\n );\n },\n);\n\nexport interface DatePickerCalendarProps\n extends Omit<ComponentPropsWithoutRef<\"section\">, \"children\"> {\n \"aria-label\"?: string;\n}\n\nexport const DatePickerCalendar = forwardRef<HTMLElement, DatePickerCalendarProps>(\n function DatePickerCalendar({ \"aria-label\": ariaLabel, className, ...props }, ref) {\n const { granularity, locale, month, styles, weekStartsOn } = useDatePickerContext();\n const days = useMemo(() => getCalendarDays(month, weekStartsOn), [month, weekStartsOn]);\n const weekdays = useMemo(() => getWeekdayLabels(locale, weekStartsOn), [locale, weekStartsOn]);\n const monthDates = useMemo(\n () =>\n Array.from({ length: 12 }, (_, index) => createCalendarDate(month.getFullYear(), index, 1)),\n [month],\n );\n\n return (\n <section\n {...props}\n ref={ref}\n aria-label={ariaLabel ?? formatMonthLabel(month, locale)}\n className={cx(styles.calendar, className)}\n data-granularity={granularity}\n data-slot=\"date-picker-calendar\"\n >\n {granularity === \"month\" ? (\n // biome-ignore lint/a11y/useSemanticElements: Month selection uses the calendar grid pattern.\n <div\n aria-label={String(month.getFullYear())}\n className={styles.monthGrid}\n data-slot=\"date-picker-month-grid\"\n role=\"grid\"\n >\n {monthDates.map((date) => (\n <DatePickerMonthButton date={date} key={dateKey(date)} />\n ))}\n </div>\n ) : (\n <>\n <div aria-hidden=\"true\" className={styles.weekdays} data-slot=\"date-picker-weekdays\">\n {weekdays.map((weekday) => (\n <span className={styles.weekday} data-slot=\"date-picker-weekday\" key={weekday}>\n {weekday}\n </span>\n ))}\n </div>\n {/* biome-ignore lint/a11y/useSemanticElements: Calendar grids use the WAI-ARIA grid pattern for roving day focus. */}\n <div\n aria-label={formatMonthLabel(month, locale)}\n className={styles.grid}\n data-slot=\"date-picker-grid\"\n role=\"grid\"\n >\n {days.map((date) => (\n <DatePickerDay date={date} key={dateKey(date)} />\n ))}\n </div>\n </>\n )}\n </section>\n );\n },\n);\n\nexport const DatePicker = {\n Root: DatePickerRoot,\n Label: DatePickerLabel,\n Control: DatePickerControl,\n Trigger: DatePickerTrigger,\n Value: DatePickerValue,\n Clear: DatePickerClear,\n Portal: DatePickerPortal,\n Positioner: DatePickerPositioner,\n Popup: DatePickerPopup,\n Close: DatePickerClose,\n Header: DatePickerHeader,\n Caption: DatePickerCaption,\n MonthSelect: DatePickerMonthSelect,\n YearSelect: DatePickerYearSelect,\n TimeField: DatePickerTimeField,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O;CACP,QAAQ;CACR,YAAY;CACZ,OAAO;CACP,OAAO;CACP,QAAQ;CACR,SAAS;CACT,aAAa;CACb,YAAY;CACZ,WAAW;CACX,UAAU;CACV,MAAM;CACN,KAAK;CACL,UAAU;AACZ"}
|
|
@@ -432,12 +432,10 @@ const DateRangePickerDay = (0, react.forwardRef)(function DateRangePickerDay({ c
|
|
|
432
432
|
nextDate = require_date_utils.addMonths(date, event.shiftKey ? 12 : 1);
|
|
433
433
|
break;
|
|
434
434
|
case "Enter":
|
|
435
|
-
case " ":
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
}
|
|
440
|
-
break;
|
|
435
|
+
case " ": if (!isDisabled) {
|
|
436
|
+
event.preventDefault();
|
|
437
|
+
onSelect(date);
|
|
438
|
+
}
|
|
441
439
|
}
|
|
442
440
|
if (nextDate) {
|
|
443
441
|
event.preventDefault();
|