jaci-ui 0.7.0 → 0.8.0

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.
Files changed (146) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +17 -0
  3. package/dist/components/alert-dialog/alert-dialog.cjs +4 -1
  4. package/dist/components/alert-dialog/alert-dialog.cjs.map +1 -1
  5. package/dist/components/alert-dialog/alert-dialog.d.cts +2 -2
  6. package/dist/components/alert-dialog/alert-dialog.d.ts +2 -2
  7. package/dist/components/alert-dialog/alert-dialog.js +4 -1
  8. package/dist/components/alert-dialog/alert-dialog.js.map +1 -1
  9. package/dist/components/color-picker/color-picker.cjs +4 -1
  10. package/dist/components/color-picker/color-picker.cjs.map +1 -1
  11. package/dist/components/color-picker/color-picker.d.cts +2 -2
  12. package/dist/components/color-picker/color-picker.d.ts +2 -2
  13. package/dist/components/color-picker/color-picker.js +4 -1
  14. package/dist/components/color-picker/color-picker.js.map +1 -1
  15. package/dist/components/combobox/combobox.cjs +4 -1
  16. package/dist/components/combobox/combobox.cjs.map +1 -1
  17. package/dist/components/combobox/combobox.d.cts +2 -2
  18. package/dist/components/combobox/combobox.d.ts +2 -2
  19. package/dist/components/combobox/combobox.js +4 -1
  20. package/dist/components/combobox/combobox.js.map +1 -1
  21. package/dist/components/command/command.cjs +73 -12
  22. package/dist/components/command/command.cjs.map +1 -1
  23. package/dist/components/command/command.d.cts +7 -1
  24. package/dist/components/command/command.d.ts +7 -1
  25. package/dist/components/command/command.js +73 -12
  26. package/dist/components/command/command.js.map +1 -1
  27. package/dist/components/command/index.d.cts +2 -2
  28. package/dist/components/command/index.d.ts +2 -2
  29. package/dist/components/context-menu/context-menu.cjs +4 -1
  30. package/dist/components/context-menu/context-menu.cjs.map +1 -1
  31. package/dist/components/context-menu/context-menu.d.cts +2 -2
  32. package/dist/components/context-menu/context-menu.d.ts +2 -2
  33. package/dist/components/context-menu/context-menu.js +4 -1
  34. package/dist/components/context-menu/context-menu.js.map +1 -1
  35. package/dist/components/date-picker/date-picker.cjs +4 -1
  36. package/dist/components/date-picker/date-picker.cjs.map +1 -1
  37. package/dist/components/date-picker/date-picker.d.cts +2 -2
  38. package/dist/components/date-picker/date-picker.d.ts +2 -2
  39. package/dist/components/date-picker/date-picker.js +4 -1
  40. package/dist/components/date-picker/date-picker.js.map +1 -1
  41. package/dist/components/date-range-picker/date-range-picker.cjs +4 -1
  42. package/dist/components/date-range-picker/date-range-picker.cjs.map +1 -1
  43. package/dist/components/date-range-picker/date-range-picker.d.cts +2 -2
  44. package/dist/components/date-range-picker/date-range-picker.d.ts +2 -2
  45. package/dist/components/date-range-picker/date-range-picker.js +4 -1
  46. package/dist/components/date-range-picker/date-range-picker.js.map +1 -1
  47. package/dist/components/dialog/dialog.cjs +4 -1
  48. package/dist/components/dialog/dialog.cjs.map +1 -1
  49. package/dist/components/dialog/dialog.d.cts +2 -2
  50. package/dist/components/dialog/dialog.d.ts +2 -2
  51. package/dist/components/dialog/dialog.js +4 -1
  52. package/dist/components/dialog/dialog.js.map +1 -1
  53. package/dist/components/drawer/drawer.cjs +4 -1
  54. package/dist/components/drawer/drawer.cjs.map +1 -1
  55. package/dist/components/drawer/drawer.d.cts +2 -2
  56. package/dist/components/drawer/drawer.d.ts +2 -2
  57. package/dist/components/drawer/drawer.js +4 -1
  58. package/dist/components/drawer/drawer.js.map +1 -1
  59. package/dist/components/figure/figure.cjs +45 -36
  60. package/dist/components/figure/figure.cjs.map +1 -1
  61. package/dist/components/figure/figure.js +45 -36
  62. package/dist/components/figure/figure.js.map +1 -1
  63. package/dist/components/image/image.cjs +41 -32
  64. package/dist/components/image/image.cjs.map +1 -1
  65. package/dist/components/image/image.js +41 -32
  66. package/dist/components/image/image.js.map +1 -1
  67. package/dist/components/menu/menu.cjs +4 -1
  68. package/dist/components/menu/menu.cjs.map +1 -1
  69. package/dist/components/menu/menu.d.cts +2 -2
  70. package/dist/components/menu/menu.d.ts +2 -2
  71. package/dist/components/menu/menu.js +4 -1
  72. package/dist/components/menu/menu.js.map +1 -1
  73. package/dist/components/menubar/menubar.cjs +4 -1
  74. package/dist/components/menubar/menubar.cjs.map +1 -1
  75. package/dist/components/menubar/menubar.d.cts +2 -2
  76. package/dist/components/menubar/menubar.d.ts +2 -2
  77. package/dist/components/menubar/menubar.js +4 -1
  78. package/dist/components/menubar/menubar.js.map +1 -1
  79. package/dist/components/navigation/navigation.cjs +3 -1
  80. package/dist/components/navigation/navigation.cjs.map +1 -1
  81. package/dist/components/navigation/navigation.js +3 -1
  82. package/dist/components/navigation/navigation.js.map +1 -1
  83. package/dist/components/navigation-menu/navigation-menu.cjs +4 -1
  84. package/dist/components/navigation-menu/navigation-menu.cjs.map +1 -1
  85. package/dist/components/navigation-menu/navigation-menu.d.cts +2 -2
  86. package/dist/components/navigation-menu/navigation-menu.d.ts +2 -2
  87. package/dist/components/navigation-menu/navigation-menu.js +4 -1
  88. package/dist/components/navigation-menu/navigation-menu.js.map +1 -1
  89. package/dist/components/popover/popover.cjs +4 -1
  90. package/dist/components/popover/popover.cjs.map +1 -1
  91. package/dist/components/popover/popover.d.cts +2 -2
  92. package/dist/components/popover/popover.d.ts +2 -2
  93. package/dist/components/popover/popover.js +4 -1
  94. package/dist/components/popover/popover.js.map +1 -1
  95. package/dist/components/select/select.cjs +4 -1
  96. package/dist/components/select/select.cjs.map +1 -1
  97. package/dist/components/select/select.d.cts +2 -2
  98. package/dist/components/select/select.d.ts +2 -2
  99. package/dist/components/select/select.js +4 -1
  100. package/dist/components/select/select.js.map +1 -1
  101. package/dist/components/sidebar/sidebar.cjs +24 -17
  102. package/dist/components/sidebar/sidebar.cjs.map +1 -1
  103. package/dist/components/sidebar/sidebar.d.cts +4 -2
  104. package/dist/components/sidebar/sidebar.d.ts +4 -2
  105. package/dist/components/sidebar/sidebar.js +24 -17
  106. package/dist/components/sidebar/sidebar.js.map +1 -1
  107. package/dist/components/toast/toast.cjs +4 -1
  108. package/dist/components/toast/toast.cjs.map +1 -1
  109. package/dist/components/toast/toast.d.cts +1 -1
  110. package/dist/components/toast/toast.d.ts +1 -1
  111. package/dist/components/toast/toast.js +4 -1
  112. package/dist/components/toast/toast.js.map +1 -1
  113. package/dist/components/tooltip/tooltip.cjs +4 -1
  114. package/dist/components/tooltip/tooltip.cjs.map +1 -1
  115. package/dist/components/tooltip/tooltip.d.cts +2 -2
  116. package/dist/components/tooltip/tooltip.d.ts +2 -2
  117. package/dist/components/tooltip/tooltip.js +4 -1
  118. package/dist/components/tooltip/tooltip.js.map +1 -1
  119. package/dist/index.cjs +1 -0
  120. package/dist/index.cjs.map +1 -0
  121. package/dist/index.d.cts +2 -2
  122. package/dist/index.d.ts +2 -2
  123. package/dist/index.js +1 -0
  124. package/dist/index.js.map +1 -0
  125. package/dist/styled-system/recipes/command.cjs +3 -3
  126. package/dist/styled-system/recipes/command.cjs.map +1 -1
  127. package/dist/styled-system/recipes/command.js +3 -3
  128. package/dist/styled-system/recipes/command.js.map +1 -1
  129. package/dist/styled-system/recipes/figure.cjs +1 -0
  130. package/dist/styled-system/recipes/figure.cjs.map +1 -1
  131. package/dist/styled-system/recipes/figure.js +1 -0
  132. package/dist/styled-system/recipes/figure.js.map +1 -1
  133. package/dist/styled-system/recipes/image.cjs +1 -0
  134. package/dist/styled-system/recipes/image.cjs.map +1 -1
  135. package/dist/styled-system/recipes/image.js +1 -0
  136. package/dist/styled-system/recipes/image.js.map +1 -1
  137. package/dist/styles.css +70 -50
  138. package/dist/theme/theme-provider.cjs +18 -8
  139. package/dist/theme/theme-provider.cjs.map +1 -1
  140. package/dist/theme/theme-provider.js +18 -8
  141. package/dist/theme/theme-provider.js.map +1 -1
  142. package/dist/theme/theme-scope.cjs +21 -0
  143. package/dist/theme/theme-scope.cjs.map +1 -0
  144. package/dist/theme/theme-scope.js +19 -0
  145. package/dist/theme/theme-scope.js.map +1 -0
  146. package/package.json +7 -4
@@ -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 {\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 const DatePickerPortal: typeof BasePopover.Portal = BasePopover.Portal;\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":";;;;;;;;;AAmFA,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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,CAAC;GACtC,WAAW,OAAO;GAClB,aAAU;GACV,MAAK;aAEJ,WAAW,KAAK,SACf,oBAAC,uBAAD,EAA6B,KAA2B,GAAhB,QAAQ,IAAI,CAAI,CACzD;EACE,CAAA,IAEL,qBAAA,UAAA,EAAA,UAAA,CACE,oBAAC,OAAD;GAAK,eAAY;GAAO,WAAW,OAAO;GAAU,aAAU;aAC3D,SAAS,KAAK,YACb,oBAAC,QAAD;IAAM,WAAW,OAAO;IAAS,aAAU;cACxC;GACG,GAFgE,OAEhE,CACP;EACE,CAAA,GAEL,oBAAC,OAAD;GACE,cAAY,iBAAiB,OAAO,MAAM;GAC1C,WAAW,OAAO;GAClB,aAAU;GACV,MAAK;aAEJ,KAAK,KAAK,SACT,oBAAC,eAAD,EAAqB,KAA2B,GAAhB,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.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,g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C3D,SAAS,KAAK,YACb,oBAAC,QAAD;IAAM,WAAW,OAAO;IAAS,aAAU;cACxC;GACG,GAFgE,OAEhE,CACP;EACE,CAAA,GAEL,oBAAC,OAAD;GACE,cAAY,iBAAiB,OAAO,MAAM;GAC1C,WAAW,OAAO;GAClB,aAAU;GACV,MAAK;aAEJ,KAAK,KAAK,SACT,oBAAC,eAAD,EAAqB,KAA2B,GAAhB,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"}
@@ -2,6 +2,7 @@
2
2
  const require_cx = require("../../styled-system/css/cx.cjs");
3
3
  const require_base_ui = require("../base-ui.cjs");
4
4
  const require_date_range_picker = require("../../styled-system/recipes/date-range-picker.cjs");
5
+ const require_theme_scope = require("../../theme/theme-scope.cjs");
5
6
  const require_date_utils = require("../date-picker/date-utils.cjs");
6
7
  let react = require("react");
7
8
  let react_jsx_runtime = require("react/jsx-runtime");
@@ -265,7 +266,9 @@ const DateRangePickerClear = (0, react.forwardRef)(function DateRangePickerClear
265
266
  children
266
267
  });
267
268
  });
268
- const DateRangePickerPortal = _base_ui_react_popover.Popover.Portal;
269
+ function DateRangePickerPortal(props) {
270
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_popover.Popover.Portal, { ...require_theme_scope.useThemePortalProps(props) });
271
+ }
269
272
  const DateRangePickerPositioner = (0, react.forwardRef)(function DateRangePickerPositioner({ className, ...props }, ref) {
270
273
  const { styles } = useDateRangePickerContext();
271
274
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_popover.Popover.Positioner, {
@@ -1 +1 @@
1
- {"version":3,"file":"date-range-picker.cjs","names":["isBeforeDay","isAfterDay","startOfMonth","dateRangePicker","createCalendarDate","addMonths","addDays","dateKey","BasePopover","toInputDate","cx","withRecipeClassName","formatDateLabel","getMonthLabels","isSameDay","getCalendarDays","getWeekdayLabels","formatMonthLabel"],"sources":["../../../src/components/date-range-picker/date-range-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, ReactNode } from \"react\";\nimport type { PopoverRoot as BasePopoverRoot } from \"@base-ui/react/popover\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { dateRangePicker } from \"../../styled-system/recipes\";\nimport { withRecipeClassName } from \"../base-ui\";\nimport {\n addDays,\n addMonths,\n createCalendarDate,\n dateKey,\n formatDateLabel,\n formatMonthLabel,\n getCalendarDays,\n getMonthLabels,\n getWeekdayLabels,\n isAfterDay,\n isBeforeDay,\n isSameDay,\n startOfMonth,\n toInputDate,\n} from \"../date-picker/date-utils\";\n\nexport interface DateRange {\n start: Date | null;\n end: Date | null;\n}\n\nexport interface DateRangePickerYearRange {\n start: number;\n end: number;\n}\n\nexport interface DateRangePickerRootProps extends Omit<BasePopoverRoot.Props, \"children\"> {\n value?: DateRange;\n defaultValue?: DateRange;\n onValueChange?: (range: DateRange) => void;\n referenceDate?: Date;\n locale?: string;\n weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6;\n minDate?: Date;\n maxDate?: Date;\n isDateDisabled?: (date: Date) => boolean;\n yearRange?: DateRangePickerYearRange;\n closeOnSelect?: boolean;\n name?: string;\n disabled?: boolean;\n placeholder?: ReactNode;\n children?: ReactNode;\n}\n\ninterface DateRangePickerContextValue {\n canNavigate: (amount: number) => boolean;\n close: () => void;\n dateDisabled: (date: Date) => boolean;\n disabled: boolean;\n focusDate: (date: Date, direction?: number) => void;\n focusedDate: Date;\n hoveredDate: Date | null;\n locale: string;\n maxDate: Date | undefined;\n minDate: Date | undefined;\n month: Date;\n monthDisabled: (date: Date) => boolean;\n onSelect: (date: Date) => void;\n range: DateRange;\n selectMonth: (month: number) => void;\n selectYear: (year: number) => void;\n setMonth: (date: Date) => void;\n setHoveredDate: (date: Date | null) => void;\n setRange: (range: DateRange) => void;\n styles: ReturnType<typeof dateRangePicker>;\n today: Date;\n triggerId: string;\n weekStartsOn: number;\n yearRange: DateRangePickerYearRange;\n registerDay: (key: string, node: HTMLButtonElement | null) => void;\n}\n\nconst DateRangePickerContext = createContext<DateRangePickerContextValue | null>(null);\n\nfunction useDateRangePickerContext() {\n const context = useContext(DateRangePickerContext);\n if (!context)\n throw new Error(\"DateRangePicker parts must be rendered inside DateRangePicker.Root.\");\n return context;\n}\n\nfunction sameMonth(left: Date, right: Date) {\n return left.getFullYear() === right.getFullYear() && left.getMonth() === right.getMonth();\n}\n\nfunction dateInRange(date: Date, range: DateRange, preview: Date | null) {\n const end = range.end ?? preview;\n return Boolean(range.start && end && !isBeforeDay(date, range.start) && !isAfterDay(date, end));\n}\n\nexport function DateRangePickerRoot({\n children,\n closeOnSelect = true,\n defaultValue = { start: null, end: null },\n disabled = false,\n isDateDisabled,\n locale = \"pt-BR\",\n maxDate,\n minDate,\n name,\n onValueChange,\n referenceDate,\n value: controlledValue,\n weekStartsOn = 0,\n yearRange: configuredYearRange,\n ...popoverProps\n}: DateRangePickerRootProps) {\n const [uncontrolledRange, setUncontrolledRange] = useState<DateRange>(defaultValue);\n const range = controlledValue ?? uncontrolledRange;\n const initialDate = range.start ?? referenceDate ?? new Date();\n const [month, setMonthState] = useState(() => startOfMonth(initialDate));\n const [focusedDate, setFocusedDate] = useState(range.start ?? initialDate);\n const [hoveredDate, setHoveredDate] = useState<Date | null>(null);\n const dayRefs = useRef(new Map<string, HTMLButtonElement>());\n const actionsRef = useRef<BasePopoverRoot.Actions | null>(null);\n const triggerId = useId();\n const styles = dateRangePicker();\n const today = useMemo(() => referenceDate ?? new Date(), [referenceDate]);\n const minMonth = minDate ? startOfMonth(minDate) : undefined;\n const maxMonth = maxDate ? startOfMonth(maxDate) : undefined;\n const yearRange = useMemo(() => {\n const start = configuredYearRange?.start ?? today.getFullYear() - 100;\n const end = configuredYearRange?.end ?? today.getFullYear() + 20;\n const years = [\n range.start?.getFullYear(),\n range.end?.getFullYear(),\n minDate?.getFullYear(),\n maxDate?.getFullYear(),\n ].filter((year): year is number => year !== undefined);\n return { start: Math.min(start, end, ...years), end: Math.max(start, end, ...years) };\n }, [\n configuredYearRange?.end,\n configuredYearRange?.start,\n maxDate,\n minDate,\n range.end,\n range.start,\n today,\n ]);\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 const monthDisabled = useCallback(\n (date: Date) => {\n const first = startOfMonth(date);\n const last = createCalendarDate(date.getFullYear(), date.getMonth() + 1, 0);\n return Boolean(\n (minDate && isBeforeDay(last, minDate)) || (maxDate && isAfterDay(first, maxDate)),\n );\n },\n [maxDate, minDate],\n );\n const clampMonth = useCallback(\n (date: Date) => {\n const normalized = startOfMonth(date);\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 const setMonth = useCallback((date: Date) => setMonthState(clampMonth(date)), [clampMonth]);\n const canNavigate = useCallback(\n (amount: number) => {\n const next = addMonths(month, amount);\n return (\n !(minMonth && isBeforeDay(next, minMonth)) && !(maxMonth && isAfterDay(next, maxMonth))\n );\n },\n [maxMonth, minMonth, month],\n );\n const setRange = useCallback(\n (nextRange: DateRange) => {\n if (controlledValue === undefined) setUncontrolledRange(nextRange);\n onValueChange?.(nextRange);\n },\n [controlledValue, onValueChange],\n );\n const close = useCallback(() => actionsRef.current?.close(), []);\n const onSelect = useCallback(\n (date: Date) => {\n if (disabled || dateDisabled(date)) return;\n const nextDate = createCalendarDate(date.getFullYear(), date.getMonth(), date.getDate());\n let nextRange: DateRange;\n if (!range.start || range.end) nextRange = { start: nextDate, end: null };\n else if (isBeforeDay(nextDate, range.start)) nextRange = { start: nextDate, end: null };\n else nextRange = { start: range.start, end: nextDate };\n setRange(nextRange);\n setFocusedDate(nextDate);\n setMonth(nextDate);\n setHoveredDate(null);\n if (nextRange.start && nextRange.end && closeOnSelect) close();\n },\n [close, closeOnSelect, dateDisabled, disabled, range.end, range.start, setMonth, setRange],\n );\n const focusDate = useCallback(\n (date: Date, direction = 1) => {\n let next = createCalendarDate(date.getFullYear(), date.getMonth(), date.getDate());\n const step = direction < 0 ? -1 : 1;\n let attempts = 0;\n while (dateDisabled(next) && attempts < 366) {\n next = addDays(next, step);\n attempts += 1;\n }\n setFocusedDate(next);\n setMonth(next);\n const focusTarget = () => dayRefs.current.get(dateKey(next))?.focus();\n focusTarget();\n queueMicrotask(focusTarget);\n },\n [dateDisabled, setMonth],\n );\n const selectMonth = useCallback(\n (monthIndex: number) => setMonth(createCalendarDate(month.getFullYear(), monthIndex, 1)),\n [month, setMonth],\n );\n const selectYear = useCallback(\n (year: number) => setMonth(createCalendarDate(year, month.getMonth(), 1)),\n [month, setMonth],\n );\n const registerDay = useCallback((key: string, node: HTMLButtonElement | null) => {\n if (node) dayRefs.current.set(key, node);\n else dayRefs.current.delete(key);\n }, []);\n\n useEffect(() => {\n const selected = range.end ?? range.start;\n if (!selected) return;\n setFocusedDate(selected);\n setMonthState((current) => (sameMonth(current, selected) ? current : clampMonth(selected)));\n }, [clampMonth, range.end, range.start]);\n\n const context: DateRangePickerContextValue = {\n canNavigate,\n close,\n dateDisabled,\n disabled,\n focusDate,\n focusedDate,\n hoveredDate,\n locale,\n maxDate,\n minDate,\n month,\n monthDisabled,\n onSelect,\n range,\n registerDay,\n selectMonth,\n selectYear,\n setHoveredDate,\n setMonth,\n setRange,\n styles,\n today,\n triggerId,\n weekStartsOn,\n yearRange,\n };\n\n return (\n <DateRangePickerContext.Provider value={context}>\n <BasePopover.Root {...popoverProps} actionsRef={actionsRef}>\n {children}\n </BasePopover.Root>\n {name ? (\n <>\n <input\n disabled={disabled}\n name={`${name}[start]`}\n type=\"hidden\"\n value={toInputDate(range.start)}\n />\n <input\n disabled={disabled}\n name={`${name}[end]`}\n type=\"hidden\"\n value={toInputDate(range.end)}\n />\n </>\n ) : null}\n </DateRangePickerContext.Provider>\n );\n}\n\nexport type DateRangePickerLabelProps = ComponentPropsWithoutRef<\"label\">;\nexport const DateRangePickerLabel = forwardRef<HTMLLabelElement, DateRangePickerLabelProps>(\n function DateRangePickerLabel({ className, ...props }, ref) {\n const { styles, triggerId } = useDateRangePickerContext();\n return (\n // biome-ignore lint/a11y/noLabelWithoutControl: the consumer renders the trigger/control in this composition.\n <label\n {...props}\n className={cx(styles.label, className)}\n data-slot=\"date-range-picker-label\"\n htmlFor={props.htmlFor ?? triggerId}\n ref={ref}\n />\n );\n },\n);\n\nexport type DateRangePickerControlProps = ComponentPropsWithoutRef<\"div\">;\nexport const DateRangePickerControl = forwardRef<HTMLDivElement, DateRangePickerControlProps>(\n function DateRangePickerControl({ className, ...props }, ref) {\n const { styles } = useDateRangePickerContext();\n return (\n <div\n {...props}\n className={cx(styles.control, className)}\n data-slot=\"date-range-picker-control\"\n ref={ref}\n />\n );\n },\n);\n\nexport type DateRangePickerTriggerProps = ComponentPropsWithoutRef<typeof BasePopover.Trigger>;\nexport const DateRangePickerTrigger = forwardRef<HTMLButtonElement, DateRangePickerTriggerProps>(\n function DateRangePickerTrigger({ children, className, disabled, id, ...props }, ref) {\n const { disabled: pickerDisabled, styles, triggerId } = useDateRangePickerContext();\n return (\n <BasePopover.Trigger\n {...props}\n aria-label={props[\"aria-label\"] ?? \"Choose date range\"}\n className={withRecipeClassName(styles.trigger, className)}\n data-jaci-component=\"date-range-picker\"\n data-slot=\"date-range-picker-trigger\"\n disabled={disabled ?? pickerDisabled}\n id={id ?? triggerId}\n ref={ref}\n >\n {children ?? (\n <>\n <DateRangePickerValue />\n <span aria-hidden=\"true\">▾</span>\n </>\n )}\n </BasePopover.Trigger>\n );\n },\n);\n\nexport interface DateRangePickerValueProps extends ComponentPropsWithoutRef<\"span\"> {\n placeholder?: ReactNode;\n}\nexport const DateRangePickerValue = forwardRef<HTMLSpanElement, DateRangePickerValueProps>(\n function DateRangePickerValue({ children, className, placeholder, ...props }, ref) {\n const { locale, range, styles } = useDateRangePickerContext();\n const value =\n children ??\n (range.start && range.end\n ? `${formatDateLabel(range.start, locale, \"\")} – ${formatDateLabel(range.end, locale, \"\")}`\n : range.start\n ? `${formatDateLabel(range.start, locale, \"\")} – …`\n : (placeholder ?? \"Select a date range\"));\n return (\n <span\n {...props}\n className={cx(styles.value, className)}\n data-placeholder={range.start ? undefined : \"true\"}\n data-slot=\"date-range-picker-value\"\n ref={ref}\n >\n {value}\n </span>\n );\n },\n);\n\nexport type DateRangePickerClearProps = ComponentPropsWithoutRef<\"button\">;\nexport const DateRangePickerClear = forwardRef<HTMLButtonElement, DateRangePickerClearProps>(\n function DateRangePickerClear({ children = \"×\", className, disabled, onClick, ...props }, ref) {\n const {\n disabled: pickerDisabled,\n range,\n setRange,\n styles,\n close,\n } = useDateRangePickerContext();\n return (\n <button\n {...props}\n aria-label={props[\"aria-label\"] ?? \"Clear date range\"}\n className={cx(styles.clear, className)}\n data-slot=\"date-range-picker-clear\"\n disabled={disabled || pickerDisabled || (!range.start && !range.end)}\n onClick={(event) => {\n setRange({ start: null, end: null });\n close();\n onClick?.(event);\n }}\n ref={ref}\n type=\"button\"\n >\n {children}\n </button>\n );\n },\n);\n\nexport type DateRangePickerPortalProps = ComponentPropsWithoutRef<typeof BasePopover.Portal>;\nexport const DateRangePickerPortal = BasePopover.Portal;\nexport type DateRangePickerPositionerProps = ComponentPropsWithoutRef<\n typeof BasePopover.Positioner\n>;\nexport const DateRangePickerPositioner = forwardRef<HTMLDivElement, DateRangePickerPositionerProps>(\n function DateRangePickerPositioner({ className, ...props }, ref) {\n const { styles } = useDateRangePickerContext();\n return (\n <BasePopover.Positioner\n {...props}\n className={withRecipeClassName(styles.positioner, className)}\n data-slot=\"date-range-picker-positioner\"\n ref={ref}\n />\n );\n },\n);\nexport type DateRangePickerPopupProps = ComponentPropsWithoutRef<typeof BasePopover.Popup>;\nexport const DateRangePickerPopup = forwardRef<HTMLDivElement, DateRangePickerPopupProps>(\n function DateRangePickerPopup({ className, ...props }, ref) {\n const { styles } = useDateRangePickerContext();\n return (\n <BasePopover.Popup\n {...props}\n aria-label={props[\"aria-label\"] ?? \"Calendar\"}\n className={withRecipeClassName(styles.popup, className)}\n data-slot=\"date-range-picker-popup\"\n ref={ref}\n />\n );\n },\n);\nexport type DateRangePickerCloseProps = ComponentPropsWithoutRef<typeof BasePopover.Close>;\nexport const DateRangePickerClose = forwardRef<HTMLButtonElement, DateRangePickerCloseProps>(\n function DateRangePickerClose({ className, ...props }, ref) {\n const { styles } = useDateRangePickerContext();\n return (\n <BasePopover.Close\n {...props}\n className={withRecipeClassName(styles.close, className)}\n data-slot=\"date-range-picker-close\"\n ref={ref}\n />\n );\n },\n);\n\nexport type DateRangePickerHeaderProps = ComponentPropsWithoutRef<\"div\">;\nexport const DateRangePickerHeader = forwardRef<HTMLDivElement, DateRangePickerHeaderProps>(\n function DateRangePickerHeader({ className, ...props }, ref) {\n const { styles } = useDateRangePickerContext();\n return (\n <div\n {...props}\n className={cx(styles.header, className)}\n data-slot=\"date-range-picker-header\"\n ref={ref}\n />\n );\n },\n);\nexport type DateRangePickerNavigationProps = ComponentPropsWithoutRef<\"button\"> & {\n amount?: number;\n};\nconst DateRangePickerNavigationButton = forwardRef<\n HTMLButtonElement,\n DateRangePickerNavigationProps\n>(function DateRangePickerNavigationButton(\n { amount = 1, children, className, onClick, ...props },\n ref,\n) {\n const { canNavigate, month, setMonth, styles } = useDateRangePickerContext();\n const isDisabled = props.disabled || !canNavigate(amount);\n return (\n <button\n {...props}\n aria-label={props[\"aria-label\"] ?? (amount < 0 ? \"Previous month\" : \"Next month\")}\n className={cx(styles.navigation, className)}\n data-slot={amount < 0 ? \"date-range-picker-previous\" : \"date-range-picker-next\"}\n disabled={isDisabled}\n onClick={(event) => {\n if (!isDisabled) setMonth(addMonths(month, amount));\n onClick?.(event);\n }}\n ref={ref}\n type=\"button\"\n >\n {children ?? (amount < 0 ? \"‹\" : \"›\")}\n </button>\n );\n});\nexport const DateRangePickerPrevious = forwardRef<\n HTMLButtonElement,\n DateRangePickerNavigationProps\n>(function DateRangePickerPrevious(props, ref) {\n return <DateRangePickerNavigationButton {...props} amount={-1} ref={ref} />;\n});\nexport const DateRangePickerNext = forwardRef<HTMLButtonElement, DateRangePickerNavigationProps>(\n function DateRangePickerNext(props, ref) {\n return <DateRangePickerNavigationButton {...props} amount={1} ref={ref} />;\n },\n);\nexport type DateRangePickerMonthSelectProps = Omit<\n ComponentPropsWithoutRef<\"select\">,\n \"children\" | \"onChange\" | \"value\"\n>;\nexport const DateRangePickerMonthSelect = forwardRef<\n HTMLSelectElement,\n DateRangePickerMonthSelectProps\n>(function DateRangePickerMonthSelect({ className, ...props }, ref) {\n const { locale, month, monthDisabled, selectMonth, styles } = useDateRangePickerContext();\n const labels = getMonthLabels(locale);\n return (\n <select\n {...props}\n aria-label={props[\"aria-label\"] ?? \"Select month\"}\n className={cx(styles.monthSelect, className)}\n data-slot=\"date-range-picker-month-select\"\n onChange={(event) => selectMonth(Number(event.currentTarget.value))}\n ref={ref}\n value={month.getMonth()}\n >\n {labels.map((label, index) => (\n <option\n disabled={monthDisabled(createCalendarDate(month.getFullYear(), index, 1))}\n key={label}\n value={index}\n >\n {label}\n </option>\n ))}\n </select>\n );\n});\nexport type DateRangePickerYearSelectProps = Omit<\n ComponentPropsWithoutRef<\"select\">,\n \"children\" | \"onChange\" | \"value\"\n>;\nexport const DateRangePickerYearSelect = forwardRef<\n HTMLSelectElement,\n DateRangePickerYearSelectProps\n>(function DateRangePickerYearSelect({ className, ...props }, ref) {\n const { month, monthDisabled, selectYear, styles, yearRange } = useDateRangePickerContext();\n const years = Array.from(\n { length: yearRange.end - yearRange.start + 1 },\n (_, index) => yearRange.start + index,\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-range-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\nexport interface DateRangePickerDayProps extends Omit<ComponentPropsWithoutRef<\"button\">, \"value\"> {\n date: Date;\n}\nexport const DateRangePickerDay = forwardRef<HTMLButtonElement, DateRangePickerDayProps>(\n function DateRangePickerDay(\n { children, className, date, disabled, onClick, onKeyDown, onMouseEnter, ...props },\n ref,\n ) {\n const {\n dateDisabled,\n disabled: pickerDisabled,\n focusDate,\n focusedDate,\n hoveredDate,\n locale,\n month,\n range,\n onSelect,\n registerDay,\n setHoveredDate,\n styles,\n today,\n weekStartsOn,\n } = useDateRangePickerContext();\n const key = dateKey(date);\n const isDisabled = Boolean(disabled || pickerDisabled || dateDisabled(date));\n const isStart = Boolean(range.start && isSameDay(date, range.start));\n const isEnd = Boolean(range.end && isSameDay(date, range.end));\n const inRange = dateInRange(date, range, hoveredDate);\n const outsideMonth = !sameMonth(date, month);\n const isFocused = isSameDay(date, focusedDate);\n const isToday = isSameDay(date, today);\n return (\n // biome-ignore lint/a11y/useSemanticElements: the roving button is the interactive grid cell.\n <button\n {...props}\n aria-label={\n props[\"aria-label\"] ?? new Intl.DateTimeFormat(locale, { dateStyle: \"full\" }).format(date)\n }\n aria-current={isToday ? \"date\" : undefined}\n aria-selected={isStart || isEnd}\n className={cx(styles.day, className)}\n data-date={key}\n data-disabled={isDisabled || undefined}\n data-in-range={inRange || undefined}\n data-outside-month={outsideMonth || undefined}\n data-range-end={isEnd || undefined}\n data-range-start={isStart || undefined}\n data-slot=\"date-range-picker-day\"\n data-today={isToday || undefined}\n disabled={isDisabled}\n onClick={(event) => {\n onSelect(date);\n onClick?.(event);\n }}\n onKeyDown={(event) => {\n if (!event.defaultPrevented) {\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 }\n if (nextDate) {\n event.preventDefault();\n focusDate(nextDate, nextDate < date ? -1 : 1);\n }\n }\n onKeyDown?.(event);\n }}\n onMouseEnter={(event) => {\n if (!isDisabled) setHoveredDate(date);\n onMouseEnter?.(event);\n }}\n ref={(node) => {\n registerDay(key, node);\n if (typeof ref === \"function\") ref(node);\n else if (ref) ref.current = node;\n }}\n role=\"gridcell\"\n tabIndex={isFocused && !isDisabled ? 0 : -1}\n type=\"button\"\n >\n {children ?? date.getDate()}\n </button>\n );\n },\n);\n\nexport interface DateRangePickerCalendarProps\n extends Omit<ComponentPropsWithoutRef<\"section\">, \"children\"> {\n \"aria-label\"?: string;\n}\nexport const DateRangePickerCalendar = forwardRef<HTMLElement, DateRangePickerCalendarProps>(\n function DateRangePickerCalendar({ \"aria-label\": ariaLabel, className, ...props }, ref) {\n const { locale, month, styles, weekStartsOn } = useDateRangePickerContext();\n const days = useMemo(() => getCalendarDays(month, weekStartsOn), [month, weekStartsOn]);\n const weekdays = useMemo(() => getWeekdayLabels(locale, weekStartsOn), [locale, weekStartsOn]);\n return (\n <section\n {...props}\n aria-label={ariaLabel ?? formatMonthLabel(month, locale)}\n className={cx(styles.calendar, className)}\n data-slot=\"date-range-picker-calendar\"\n ref={ref}\n >\n <div aria-hidden=\"true\" className={styles.weekdays} data-slot=\"date-range-picker-weekdays\">\n {weekdays.map((weekday) => (\n <span className={styles.weekday} data-slot=\"date-range-picker-weekday\" key={weekday}>\n {weekday}\n </span>\n ))}\n </div>\n {/* biome-ignore lint/a11y/useSemanticElements: the calendar uses the ARIA grid pattern. */}\n <div\n aria-label={formatMonthLabel(month, locale)}\n className={styles.grid}\n data-slot=\"date-range-picker-grid\"\n role=\"grid\"\n >\n {days.map((date) => (\n <DateRangePickerDay date={date} key={dateKey(date)} />\n ))}\n </div>\n </section>\n );\n },\n);\n\nexport interface DateRangePickerPreviewProps extends ComponentPropsWithoutRef<\"div\"> {\n children?: ReactNode;\n}\nexport const DateRangePickerPreview = forwardRef<HTMLDivElement, DateRangePickerPreviewProps>(\n function DateRangePickerPreview({ children, className, ...props }, ref) {\n const { hoveredDate, locale, range, styles } = useDateRangePickerContext();\n const content =\n children ??\n (range.start\n ? `${formatDateLabel(range.start, locale, \"\")} – ${range.end ? formatDateLabel(range.end, locale, \"\") : hoveredDate ? formatDateLabel(hoveredDate, locale, \"\") : \"…\"}`\n : \"Select a start date\");\n return (\n <div\n {...props}\n aria-live=\"polite\"\n className={cx(styles.preview, className)}\n data-slot=\"date-range-picker-preview\"\n ref={ref}\n >\n {content}\n </div>\n );\n },\n);\n\nexport interface DateRangePickerInputProps\n extends Omit<ComponentPropsWithoutRef<\"input\">, \"type\" | \"value\" | \"onChange\"> {\n side: \"start\" | \"end\";\n}\nexport const DateRangePickerInput = forwardRef<HTMLInputElement, DateRangePickerInputProps>(\n function DateRangePickerInput({ className, onBlur, onInput, side, ...props }, ref) {\n const { disabled, range, setRange, styles } = useDateRangePickerContext();\n const value = toInputDate(side === \"start\" ? range.start : range.end);\n return (\n <input\n {...props}\n aria-label={props[\"aria-label\"] ?? (side === \"start\" ? \"Start date\" : \"End date\")}\n className={cx(styles.input, className)}\n data-slot={`date-range-picker-${side}-input`}\n disabled={disabled || props.disabled}\n onChange={(event) => {\n const [year, month, day] = event.currentTarget.value.split(\"-\").map(Number);\n if (!year || !month || !day) return;\n const date = createCalendarDate(year, month - 1, day);\n setRange(\n side === \"start\" ? { start: date, end: range.end } : { start: range.start, end: date },\n );\n }}\n onBlur={onBlur}\n onInput={onInput}\n ref={ref}\n type=\"date\"\n value={value}\n />\n );\n },\n);\n\nexport const DateRangePickerStartInput = forwardRef<\n HTMLInputElement,\n Omit<DateRangePickerInputProps, \"side\">\n>(function DateRangePickerStartInput(props, ref) {\n return <DateRangePickerInput {...props} ref={ref} side=\"start\" />;\n});\nexport const DateRangePickerEndInput = forwardRef<\n HTMLInputElement,\n Omit<DateRangePickerInputProps, \"side\">\n>(function DateRangePickerEndInput(props, ref) {\n return <DateRangePickerInput {...props} ref={ref} side=\"end\" />;\n});\n\nexport const DateRangePicker = {\n Root: DateRangePickerRoot,\n Label: DateRangePickerLabel,\n Control: DateRangePickerControl,\n Trigger: DateRangePickerTrigger,\n Value: DateRangePickerValue,\n Clear: DateRangePickerClear,\n Portal: DateRangePickerPortal,\n Positioner: DateRangePickerPositioner,\n Popup: DateRangePickerPopup,\n Close: DateRangePickerClose,\n Header: DateRangePickerHeader,\n Previous: DateRangePickerPrevious,\n Next: DateRangePickerNext,\n MonthSelect: DateRangePickerMonthSelect,\n YearSelect: DateRangePickerYearSelect,\n Calendar: DateRangePickerCalendar,\n Day: DateRangePickerDay,\n Preview: DateRangePickerPreview,\n StartInput: DateRangePickerStartInput,\n EndInput: DateRangePickerEndInput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E,OAAO;IAAM,KAAK,MAAM;GAAI,IAAI;IAAE,OAAO,MAAM;IAAO,KAAK;GAAK,CACvF;EACF;EACQ;EACC;EACJ;EACL,MAAK;EACE;CACR,CAAA;AAEL,CACF;AAEA,MAAa,6BAAA,GAAA,MAAA,WAAA,CAGX,SAAS,0BAA0B,OAAO,KAAK;CAC/C,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAAC,sBAAD;EAAsB,GAAI;EAAY;EAAK,MAAK;CAAS,CAAA;AAClE,CAAC;AACD,MAAa,2BAAA,GAAA,MAAA,WAAA,CAGX,SAAS,wBAAwB,OAAO,KAAK;CAC7C,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAAC,sBAAD;EAAsB,GAAI;EAAY;EAAK,MAAK;CAAO,CAAA;AAChE,CAAC;AAED,MAAa,kBAAkB;CAC7B,MAAM;CACN,OAAO;CACP,SAAS;CACT,SAAS;CACT,OAAO;CACP,OAAO;CACP,QAAQ;CACR,YAAY;CACZ,OAAO;CACP,OAAO;CACP,QAAQ;CACR,UAAU;CACV,MAAM;CACN,aAAa;CACb,YAAY;CACZ,UAAU;CACV,KAAK;CACL,SAAS;CACT,YAAY;CACZ,UAAU;AACZ"}
1
+ {"version":3,"file":"date-range-picker.cjs","names":["isBeforeDay","isAfterDay","startOfMonth","dateRangePicker","createCalendarDate","addMonths","addDays","dateKey","BasePopover","toInputDate","cx","withRecipeClassName","formatDateLabel","useThemePortalProps","getMonthLabels","isSameDay","getCalendarDays","getWeekdayLabels","formatMonthLabel"],"sources":["../../../src/components/date-range-picker/date-range-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, ReactNode } from \"react\";\nimport type { PopoverRoot as BasePopoverRoot } from \"@base-ui/react/popover\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { dateRangePicker } 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 getMonthLabels,\n getWeekdayLabels,\n isAfterDay,\n isBeforeDay,\n isSameDay,\n startOfMonth,\n toInputDate,\n} from \"../date-picker/date-utils\";\n\nexport interface DateRange {\n start: Date | null;\n end: Date | null;\n}\n\nexport interface DateRangePickerYearRange {\n start: number;\n end: number;\n}\n\nexport interface DateRangePickerRootProps extends Omit<BasePopoverRoot.Props, \"children\"> {\n value?: DateRange;\n defaultValue?: DateRange;\n onValueChange?: (range: DateRange) => void;\n referenceDate?: Date;\n locale?: string;\n weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6;\n minDate?: Date;\n maxDate?: Date;\n isDateDisabled?: (date: Date) => boolean;\n yearRange?: DateRangePickerYearRange;\n closeOnSelect?: boolean;\n name?: string;\n disabled?: boolean;\n placeholder?: ReactNode;\n children?: ReactNode;\n}\n\ninterface DateRangePickerContextValue {\n canNavigate: (amount: number) => boolean;\n close: () => void;\n dateDisabled: (date: Date) => boolean;\n disabled: boolean;\n focusDate: (date: Date, direction?: number) => void;\n focusedDate: Date;\n hoveredDate: Date | null;\n locale: string;\n maxDate: Date | undefined;\n minDate: Date | undefined;\n month: Date;\n monthDisabled: (date: Date) => boolean;\n onSelect: (date: Date) => void;\n range: DateRange;\n selectMonth: (month: number) => void;\n selectYear: (year: number) => void;\n setMonth: (date: Date) => void;\n setHoveredDate: (date: Date | null) => void;\n setRange: (range: DateRange) => void;\n styles: ReturnType<typeof dateRangePicker>;\n today: Date;\n triggerId: string;\n weekStartsOn: number;\n yearRange: DateRangePickerYearRange;\n registerDay: (key: string, node: HTMLButtonElement | null) => void;\n}\n\nconst DateRangePickerContext = createContext<DateRangePickerContextValue | null>(null);\n\nfunction useDateRangePickerContext() {\n const context = useContext(DateRangePickerContext);\n if (!context)\n throw new Error(\"DateRangePicker parts must be rendered inside DateRangePicker.Root.\");\n return context;\n}\n\nfunction sameMonth(left: Date, right: Date) {\n return left.getFullYear() === right.getFullYear() && left.getMonth() === right.getMonth();\n}\n\nfunction dateInRange(date: Date, range: DateRange, preview: Date | null) {\n const end = range.end ?? preview;\n return Boolean(range.start && end && !isBeforeDay(date, range.start) && !isAfterDay(date, end));\n}\n\nexport function DateRangePickerRoot({\n children,\n closeOnSelect = true,\n defaultValue = { start: null, end: null },\n disabled = false,\n isDateDisabled,\n locale = \"pt-BR\",\n maxDate,\n minDate,\n name,\n onValueChange,\n referenceDate,\n value: controlledValue,\n weekStartsOn = 0,\n yearRange: configuredYearRange,\n ...popoverProps\n}: DateRangePickerRootProps) {\n const [uncontrolledRange, setUncontrolledRange] = useState<DateRange>(defaultValue);\n const range = controlledValue ?? uncontrolledRange;\n const initialDate = range.start ?? referenceDate ?? new Date();\n const [month, setMonthState] = useState(() => startOfMonth(initialDate));\n const [focusedDate, setFocusedDate] = useState(range.start ?? initialDate);\n const [hoveredDate, setHoveredDate] = useState<Date | null>(null);\n const dayRefs = useRef(new Map<string, HTMLButtonElement>());\n const actionsRef = useRef<BasePopoverRoot.Actions | null>(null);\n const triggerId = useId();\n const styles = dateRangePicker();\n const today = useMemo(() => referenceDate ?? new Date(), [referenceDate]);\n const minMonth = minDate ? startOfMonth(minDate) : undefined;\n const maxMonth = maxDate ? startOfMonth(maxDate) : undefined;\n const yearRange = useMemo(() => {\n const start = configuredYearRange?.start ?? today.getFullYear() - 100;\n const end = configuredYearRange?.end ?? today.getFullYear() + 20;\n const years = [\n range.start?.getFullYear(),\n range.end?.getFullYear(),\n minDate?.getFullYear(),\n maxDate?.getFullYear(),\n ].filter((year): year is number => year !== undefined);\n return { start: Math.min(start, end, ...years), end: Math.max(start, end, ...years) };\n }, [\n configuredYearRange?.end,\n configuredYearRange?.start,\n maxDate,\n minDate,\n range.end,\n range.start,\n today,\n ]);\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 const monthDisabled = useCallback(\n (date: Date) => {\n const first = startOfMonth(date);\n const last = createCalendarDate(date.getFullYear(), date.getMonth() + 1, 0);\n return Boolean(\n (minDate && isBeforeDay(last, minDate)) || (maxDate && isAfterDay(first, maxDate)),\n );\n },\n [maxDate, minDate],\n );\n const clampMonth = useCallback(\n (date: Date) => {\n const normalized = startOfMonth(date);\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 const setMonth = useCallback((date: Date) => setMonthState(clampMonth(date)), [clampMonth]);\n const canNavigate = useCallback(\n (amount: number) => {\n const next = addMonths(month, amount);\n return (\n !(minMonth && isBeforeDay(next, minMonth)) && !(maxMonth && isAfterDay(next, maxMonth))\n );\n },\n [maxMonth, minMonth, month],\n );\n const setRange = useCallback(\n (nextRange: DateRange) => {\n if (controlledValue === undefined) setUncontrolledRange(nextRange);\n onValueChange?.(nextRange);\n },\n [controlledValue, onValueChange],\n );\n const close = useCallback(() => actionsRef.current?.close(), []);\n const onSelect = useCallback(\n (date: Date) => {\n if (disabled || dateDisabled(date)) return;\n const nextDate = createCalendarDate(date.getFullYear(), date.getMonth(), date.getDate());\n let nextRange: DateRange;\n if (!range.start || range.end) nextRange = { start: nextDate, end: null };\n else if (isBeforeDay(nextDate, range.start)) nextRange = { start: nextDate, end: null };\n else nextRange = { start: range.start, end: nextDate };\n setRange(nextRange);\n setFocusedDate(nextDate);\n setMonth(nextDate);\n setHoveredDate(null);\n if (nextRange.start && nextRange.end && closeOnSelect) close();\n },\n [close, closeOnSelect, dateDisabled, disabled, range.end, range.start, setMonth, setRange],\n );\n const focusDate = useCallback(\n (date: Date, direction = 1) => {\n let next = createCalendarDate(date.getFullYear(), date.getMonth(), date.getDate());\n const step = direction < 0 ? -1 : 1;\n let attempts = 0;\n while (dateDisabled(next) && attempts < 366) {\n next = addDays(next, step);\n attempts += 1;\n }\n setFocusedDate(next);\n setMonth(next);\n const focusTarget = () => dayRefs.current.get(dateKey(next))?.focus();\n focusTarget();\n queueMicrotask(focusTarget);\n },\n [dateDisabled, setMonth],\n );\n const selectMonth = useCallback(\n (monthIndex: number) => setMonth(createCalendarDate(month.getFullYear(), monthIndex, 1)),\n [month, setMonth],\n );\n const selectYear = useCallback(\n (year: number) => setMonth(createCalendarDate(year, month.getMonth(), 1)),\n [month, setMonth],\n );\n const registerDay = useCallback((key: string, node: HTMLButtonElement | null) => {\n if (node) dayRefs.current.set(key, node);\n else dayRefs.current.delete(key);\n }, []);\n\n useEffect(() => {\n const selected = range.end ?? range.start;\n if (!selected) return;\n setFocusedDate(selected);\n setMonthState((current) => (sameMonth(current, selected) ? current : clampMonth(selected)));\n }, [clampMonth, range.end, range.start]);\n\n const context: DateRangePickerContextValue = {\n canNavigate,\n close,\n dateDisabled,\n disabled,\n focusDate,\n focusedDate,\n hoveredDate,\n locale,\n maxDate,\n minDate,\n month,\n monthDisabled,\n onSelect,\n range,\n registerDay,\n selectMonth,\n selectYear,\n setHoveredDate,\n setMonth,\n setRange,\n styles,\n today,\n triggerId,\n weekStartsOn,\n yearRange,\n };\n\n return (\n <DateRangePickerContext.Provider value={context}>\n <BasePopover.Root {...popoverProps} actionsRef={actionsRef}>\n {children}\n </BasePopover.Root>\n {name ? (\n <>\n <input\n disabled={disabled}\n name={`${name}[start]`}\n type=\"hidden\"\n value={toInputDate(range.start)}\n />\n <input\n disabled={disabled}\n name={`${name}[end]`}\n type=\"hidden\"\n value={toInputDate(range.end)}\n />\n </>\n ) : null}\n </DateRangePickerContext.Provider>\n );\n}\n\nexport type DateRangePickerLabelProps = ComponentPropsWithoutRef<\"label\">;\nexport const DateRangePickerLabel = forwardRef<HTMLLabelElement, DateRangePickerLabelProps>(\n function DateRangePickerLabel({ className, ...props }, ref) {\n const { styles, triggerId } = useDateRangePickerContext();\n return (\n // biome-ignore lint/a11y/noLabelWithoutControl: the consumer renders the trigger/control in this composition.\n <label\n {...props}\n className={cx(styles.label, className)}\n data-slot=\"date-range-picker-label\"\n htmlFor={props.htmlFor ?? triggerId}\n ref={ref}\n />\n );\n },\n);\n\nexport type DateRangePickerControlProps = ComponentPropsWithoutRef<\"div\">;\nexport const DateRangePickerControl = forwardRef<HTMLDivElement, DateRangePickerControlProps>(\n function DateRangePickerControl({ className, ...props }, ref) {\n const { styles } = useDateRangePickerContext();\n return (\n <div\n {...props}\n className={cx(styles.control, className)}\n data-slot=\"date-range-picker-control\"\n ref={ref}\n />\n );\n },\n);\n\nexport type DateRangePickerTriggerProps = ComponentPropsWithoutRef<typeof BasePopover.Trigger>;\nexport const DateRangePickerTrigger = forwardRef<HTMLButtonElement, DateRangePickerTriggerProps>(\n function DateRangePickerTrigger({ children, className, disabled, id, ...props }, ref) {\n const { disabled: pickerDisabled, styles, triggerId } = useDateRangePickerContext();\n return (\n <BasePopover.Trigger\n {...props}\n aria-label={props[\"aria-label\"] ?? \"Choose date range\"}\n className={withRecipeClassName(styles.trigger, className)}\n data-jaci-component=\"date-range-picker\"\n data-slot=\"date-range-picker-trigger\"\n disabled={disabled ?? pickerDisabled}\n id={id ?? triggerId}\n ref={ref}\n >\n {children ?? (\n <>\n <DateRangePickerValue />\n <span aria-hidden=\"true\">▾</span>\n </>\n )}\n </BasePopover.Trigger>\n );\n },\n);\n\nexport interface DateRangePickerValueProps extends ComponentPropsWithoutRef<\"span\"> {\n placeholder?: ReactNode;\n}\nexport const DateRangePickerValue = forwardRef<HTMLSpanElement, DateRangePickerValueProps>(\n function DateRangePickerValue({ children, className, placeholder, ...props }, ref) {\n const { locale, range, styles } = useDateRangePickerContext();\n const value =\n children ??\n (range.start && range.end\n ? `${formatDateLabel(range.start, locale, \"\")} – ${formatDateLabel(range.end, locale, \"\")}`\n : range.start\n ? `${formatDateLabel(range.start, locale, \"\")} – …`\n : (placeholder ?? \"Select a date range\"));\n return (\n <span\n {...props}\n className={cx(styles.value, className)}\n data-placeholder={range.start ? undefined : \"true\"}\n data-slot=\"date-range-picker-value\"\n ref={ref}\n >\n {value}\n </span>\n );\n },\n);\n\nexport type DateRangePickerClearProps = ComponentPropsWithoutRef<\"button\">;\nexport const DateRangePickerClear = forwardRef<HTMLButtonElement, DateRangePickerClearProps>(\n function DateRangePickerClear({ children = \"×\", className, disabled, onClick, ...props }, ref) {\n const {\n disabled: pickerDisabled,\n range,\n setRange,\n styles,\n close,\n } = useDateRangePickerContext();\n return (\n <button\n {...props}\n aria-label={props[\"aria-label\"] ?? \"Clear date range\"}\n className={cx(styles.clear, className)}\n data-slot=\"date-range-picker-clear\"\n disabled={disabled || pickerDisabled || (!range.start && !range.end)}\n onClick={(event) => {\n setRange({ start: null, end: null });\n close();\n onClick?.(event);\n }}\n ref={ref}\n type=\"button\"\n >\n {children}\n </button>\n );\n },\n);\n\nexport type DateRangePickerPortalProps = ComponentPropsWithoutRef<typeof BasePopover.Portal>;\nexport function DateRangePickerPortal(props: DateRangePickerPortalProps) {\n return <BasePopover.Portal {...useThemePortalProps(props)} />;\n}\nexport type DateRangePickerPositionerProps = ComponentPropsWithoutRef<\n typeof BasePopover.Positioner\n>;\nexport const DateRangePickerPositioner = forwardRef<HTMLDivElement, DateRangePickerPositionerProps>(\n function DateRangePickerPositioner({ className, ...props }, ref) {\n const { styles } = useDateRangePickerContext();\n return (\n <BasePopover.Positioner\n {...props}\n className={withRecipeClassName(styles.positioner, className)}\n data-slot=\"date-range-picker-positioner\"\n ref={ref}\n />\n );\n },\n);\nexport type DateRangePickerPopupProps = ComponentPropsWithoutRef<typeof BasePopover.Popup>;\nexport const DateRangePickerPopup = forwardRef<HTMLDivElement, DateRangePickerPopupProps>(\n function DateRangePickerPopup({ className, ...props }, ref) {\n const { styles } = useDateRangePickerContext();\n return (\n <BasePopover.Popup\n {...props}\n aria-label={props[\"aria-label\"] ?? \"Calendar\"}\n className={withRecipeClassName(styles.popup, className)}\n data-slot=\"date-range-picker-popup\"\n ref={ref}\n />\n );\n },\n);\nexport type DateRangePickerCloseProps = ComponentPropsWithoutRef<typeof BasePopover.Close>;\nexport const DateRangePickerClose = forwardRef<HTMLButtonElement, DateRangePickerCloseProps>(\n function DateRangePickerClose({ className, ...props }, ref) {\n const { styles } = useDateRangePickerContext();\n return (\n <BasePopover.Close\n {...props}\n className={withRecipeClassName(styles.close, className)}\n data-slot=\"date-range-picker-close\"\n ref={ref}\n />\n );\n },\n);\n\nexport type DateRangePickerHeaderProps = ComponentPropsWithoutRef<\"div\">;\nexport const DateRangePickerHeader = forwardRef<HTMLDivElement, DateRangePickerHeaderProps>(\n function DateRangePickerHeader({ className, ...props }, ref) {\n const { styles } = useDateRangePickerContext();\n return (\n <div\n {...props}\n className={cx(styles.header, className)}\n data-slot=\"date-range-picker-header\"\n ref={ref}\n />\n );\n },\n);\nexport type DateRangePickerNavigationProps = ComponentPropsWithoutRef<\"button\"> & {\n amount?: number;\n};\nconst DateRangePickerNavigationButton = forwardRef<\n HTMLButtonElement,\n DateRangePickerNavigationProps\n>(function DateRangePickerNavigationButton(\n { amount = 1, children, className, onClick, ...props },\n ref,\n) {\n const { canNavigate, month, setMonth, styles } = useDateRangePickerContext();\n const isDisabled = props.disabled || !canNavigate(amount);\n return (\n <button\n {...props}\n aria-label={props[\"aria-label\"] ?? (amount < 0 ? \"Previous month\" : \"Next month\")}\n className={cx(styles.navigation, className)}\n data-slot={amount < 0 ? \"date-range-picker-previous\" : \"date-range-picker-next\"}\n disabled={isDisabled}\n onClick={(event) => {\n if (!isDisabled) setMonth(addMonths(month, amount));\n onClick?.(event);\n }}\n ref={ref}\n type=\"button\"\n >\n {children ?? (amount < 0 ? \"‹\" : \"›\")}\n </button>\n );\n});\nexport const DateRangePickerPrevious = forwardRef<\n HTMLButtonElement,\n DateRangePickerNavigationProps\n>(function DateRangePickerPrevious(props, ref) {\n return <DateRangePickerNavigationButton {...props} amount={-1} ref={ref} />;\n});\nexport const DateRangePickerNext = forwardRef<HTMLButtonElement, DateRangePickerNavigationProps>(\n function DateRangePickerNext(props, ref) {\n return <DateRangePickerNavigationButton {...props} amount={1} ref={ref} />;\n },\n);\nexport type DateRangePickerMonthSelectProps = Omit<\n ComponentPropsWithoutRef<\"select\">,\n \"children\" | \"onChange\" | \"value\"\n>;\nexport const DateRangePickerMonthSelect = forwardRef<\n HTMLSelectElement,\n DateRangePickerMonthSelectProps\n>(function DateRangePickerMonthSelect({ className, ...props }, ref) {\n const { locale, month, monthDisabled, selectMonth, styles } = useDateRangePickerContext();\n const labels = getMonthLabels(locale);\n return (\n <select\n {...props}\n aria-label={props[\"aria-label\"] ?? \"Select month\"}\n className={cx(styles.monthSelect, className)}\n data-slot=\"date-range-picker-month-select\"\n onChange={(event) => selectMonth(Number(event.currentTarget.value))}\n ref={ref}\n value={month.getMonth()}\n >\n {labels.map((label, index) => (\n <option\n disabled={monthDisabled(createCalendarDate(month.getFullYear(), index, 1))}\n key={label}\n value={index}\n >\n {label}\n </option>\n ))}\n </select>\n );\n});\nexport type DateRangePickerYearSelectProps = Omit<\n ComponentPropsWithoutRef<\"select\">,\n \"children\" | \"onChange\" | \"value\"\n>;\nexport const DateRangePickerYearSelect = forwardRef<\n HTMLSelectElement,\n DateRangePickerYearSelectProps\n>(function DateRangePickerYearSelect({ className, ...props }, ref) {\n const { month, monthDisabled, selectYear, styles, yearRange } = useDateRangePickerContext();\n const years = Array.from(\n { length: yearRange.end - yearRange.start + 1 },\n (_, index) => yearRange.start + index,\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-range-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\nexport interface DateRangePickerDayProps extends Omit<ComponentPropsWithoutRef<\"button\">, \"value\"> {\n date: Date;\n}\nexport const DateRangePickerDay = forwardRef<HTMLButtonElement, DateRangePickerDayProps>(\n function DateRangePickerDay(\n { children, className, date, disabled, onClick, onKeyDown, onMouseEnter, ...props },\n ref,\n ) {\n const {\n dateDisabled,\n disabled: pickerDisabled,\n focusDate,\n focusedDate,\n hoveredDate,\n locale,\n month,\n range,\n onSelect,\n registerDay,\n setHoveredDate,\n styles,\n today,\n weekStartsOn,\n } = useDateRangePickerContext();\n const key = dateKey(date);\n const isDisabled = Boolean(disabled || pickerDisabled || dateDisabled(date));\n const isStart = Boolean(range.start && isSameDay(date, range.start));\n const isEnd = Boolean(range.end && isSameDay(date, range.end));\n const inRange = dateInRange(date, range, hoveredDate);\n const outsideMonth = !sameMonth(date, month);\n const isFocused = isSameDay(date, focusedDate);\n const isToday = isSameDay(date, today);\n return (\n // biome-ignore lint/a11y/useSemanticElements: the roving button is the interactive grid cell.\n <button\n {...props}\n aria-label={\n props[\"aria-label\"] ?? new Intl.DateTimeFormat(locale, { dateStyle: \"full\" }).format(date)\n }\n aria-current={isToday ? \"date\" : undefined}\n aria-selected={isStart || isEnd}\n className={cx(styles.day, className)}\n data-date={key}\n data-disabled={isDisabled || undefined}\n data-in-range={inRange || undefined}\n data-outside-month={outsideMonth || undefined}\n data-range-end={isEnd || undefined}\n data-range-start={isStart || undefined}\n data-slot=\"date-range-picker-day\"\n data-today={isToday || undefined}\n disabled={isDisabled}\n onClick={(event) => {\n onSelect(date);\n onClick?.(event);\n }}\n onKeyDown={(event) => {\n if (!event.defaultPrevented) {\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 }\n if (nextDate) {\n event.preventDefault();\n focusDate(nextDate, nextDate < date ? -1 : 1);\n }\n }\n onKeyDown?.(event);\n }}\n onMouseEnter={(event) => {\n if (!isDisabled) setHoveredDate(date);\n onMouseEnter?.(event);\n }}\n ref={(node) => {\n registerDay(key, node);\n if (typeof ref === \"function\") ref(node);\n else if (ref) ref.current = node;\n }}\n role=\"gridcell\"\n tabIndex={isFocused && !isDisabled ? 0 : -1}\n type=\"button\"\n >\n {children ?? date.getDate()}\n </button>\n );\n },\n);\n\nexport interface DateRangePickerCalendarProps\n extends Omit<ComponentPropsWithoutRef<\"section\">, \"children\"> {\n \"aria-label\"?: string;\n}\nexport const DateRangePickerCalendar = forwardRef<HTMLElement, DateRangePickerCalendarProps>(\n function DateRangePickerCalendar({ \"aria-label\": ariaLabel, className, ...props }, ref) {\n const { locale, month, styles, weekStartsOn } = useDateRangePickerContext();\n const days = useMemo(() => getCalendarDays(month, weekStartsOn), [month, weekStartsOn]);\n const weekdays = useMemo(() => getWeekdayLabels(locale, weekStartsOn), [locale, weekStartsOn]);\n return (\n <section\n {...props}\n aria-label={ariaLabel ?? formatMonthLabel(month, locale)}\n className={cx(styles.calendar, className)}\n data-slot=\"date-range-picker-calendar\"\n ref={ref}\n >\n <div aria-hidden=\"true\" className={styles.weekdays} data-slot=\"date-range-picker-weekdays\">\n {weekdays.map((weekday) => (\n <span className={styles.weekday} data-slot=\"date-range-picker-weekday\" key={weekday}>\n {weekday}\n </span>\n ))}\n </div>\n {/* biome-ignore lint/a11y/useSemanticElements: the calendar uses the ARIA grid pattern. */}\n <div\n aria-label={formatMonthLabel(month, locale)}\n className={styles.grid}\n data-slot=\"date-range-picker-grid\"\n role=\"grid\"\n >\n {days.map((date) => (\n <DateRangePickerDay date={date} key={dateKey(date)} />\n ))}\n </div>\n </section>\n );\n },\n);\n\nexport interface DateRangePickerPreviewProps extends ComponentPropsWithoutRef<\"div\"> {\n children?: ReactNode;\n}\nexport const DateRangePickerPreview = forwardRef<HTMLDivElement, DateRangePickerPreviewProps>(\n function DateRangePickerPreview({ children, className, ...props }, ref) {\n const { hoveredDate, locale, range, styles } = useDateRangePickerContext();\n const content =\n children ??\n (range.start\n ? `${formatDateLabel(range.start, locale, \"\")} – ${range.end ? formatDateLabel(range.end, locale, \"\") : hoveredDate ? formatDateLabel(hoveredDate, locale, \"\") : \"…\"}`\n : \"Select a start date\");\n return (\n <div\n {...props}\n aria-live=\"polite\"\n className={cx(styles.preview, className)}\n data-slot=\"date-range-picker-preview\"\n ref={ref}\n >\n {content}\n </div>\n );\n },\n);\n\nexport interface DateRangePickerInputProps\n extends Omit<ComponentPropsWithoutRef<\"input\">, \"type\" | \"value\" | \"onChange\"> {\n side: \"start\" | \"end\";\n}\nexport const DateRangePickerInput = forwardRef<HTMLInputElement, DateRangePickerInputProps>(\n function DateRangePickerInput({ className, onBlur, onInput, side, ...props }, ref) {\n const { disabled, range, setRange, styles } = useDateRangePickerContext();\n const value = toInputDate(side === \"start\" ? range.start : range.end);\n return (\n <input\n {...props}\n aria-label={props[\"aria-label\"] ?? (side === \"start\" ? \"Start date\" : \"End date\")}\n className={cx(styles.input, className)}\n data-slot={`date-range-picker-${side}-input`}\n disabled={disabled || props.disabled}\n onChange={(event) => {\n const [year, month, day] = event.currentTarget.value.split(\"-\").map(Number);\n if (!year || !month || !day) return;\n const date = createCalendarDate(year, month - 1, day);\n setRange(\n side === \"start\" ? { start: date, end: range.end } : { start: range.start, end: date },\n );\n }}\n onBlur={onBlur}\n onInput={onInput}\n ref={ref}\n type=\"date\"\n value={value}\n />\n );\n },\n);\n\nexport const DateRangePickerStartInput = forwardRef<\n HTMLInputElement,\n Omit<DateRangePickerInputProps, \"side\">\n>(function DateRangePickerStartInput(props, ref) {\n return <DateRangePickerInput {...props} ref={ref} side=\"start\" />;\n});\nexport const DateRangePickerEndInput = forwardRef<\n HTMLInputElement,\n Omit<DateRangePickerInputProps, \"side\">\n>(function DateRangePickerEndInput(props, ref) {\n return <DateRangePickerInput {...props} ref={ref} side=\"end\" />;\n});\n\nexport const DateRangePicker = {\n Root: DateRangePickerRoot,\n Label: DateRangePickerLabel,\n Control: DateRangePickerControl,\n Trigger: DateRangePickerTrigger,\n Value: DateRangePickerValue,\n Clear: DateRangePickerClear,\n Portal: DateRangePickerPortal,\n Positioner: DateRangePickerPositioner,\n Popup: DateRangePickerPopup,\n Close: DateRangePickerClose,\n Header: DateRangePickerHeader,\n Previous: DateRangePickerPrevious,\n Next: DateRangePickerNext,\n MonthSelect: DateRangePickerMonthSelect,\n YearSelect: DateRangePickerYearSelect,\n Calendar: DateRangePickerCalendar,\n Day: DateRangePickerDay,\n Preview: DateRangePickerPreview,\n StartInput: DateRangePickerStartInput,\n EndInput: DateRangePickerEndInput,\n};\n"],"mappings":";;;;;;;;;;AA8FA,MAAM,0BAAA,GAAA,MAAA,cAAA,CAA2E,IAAI;AAErF,SAAS,4BAA4B;CACnC,MAAM,WAAA,GAAA,MAAA,WAAA,CAAqB,sBAAsB;CACjD,IAAI,CAAC,SACH,MAAM,IAAI,MAAM,qEAAqE;CACvF,OAAO;AACT;AAEA,SAAS,UAAU,MAAY,OAAa;CAC1C,OAAO,KAAK,YAAY,MAAM,MAAM,YAAY,KAAK,KAAK,SAAS,MAAM,MAAM,SAAS;AAC1F;AAEA,SAAS,YAAY,MAAY,OAAkB,SAAsB;CACvE,MAAM,MAAM,MAAM,OAAO;CACzB,OAAO,QAAQ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AAClE,CAAC;AACD,MAAa,2BAAA,GAAA,MAAA,WAAA,CAGX,SAAS,wBAAwB,OAAO,KAAK;CAC7C,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAAC,sBAAD;EAAsB,GAAI;EAAY;EAAK,MAAK;CAAO,CAAA;AAChE,CAAC;AAED,MAAa,kBAAkB;CAC7B,MAAM;CACN,OAAO;CACP,SAAS;CACT,SAAS;CACT,OAAO;CACP,OAAO;CACP,QAAQ;CACR,YAAY;CACZ,OAAO;CACP,OAAO;CACP,QAAQ;CACR,UAAU;CACV,MAAM;CACN,aAAa;CACb,YAAY;CACZ,UAAU;CACV,KAAK;CACL,SAAS;CACT,YAAY;CACZ,UAAU;AACZ"}
@@ -52,7 +52,7 @@ declare const DateRangePickerValue: import("react").ForwardRefExoticComponent<Da
52
52
  type DateRangePickerClearProps = ComponentPropsWithoutRef<"button">;
53
53
  declare const DateRangePickerClear: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
54
54
  type DateRangePickerPortalProps = ComponentPropsWithoutRef<typeof Popover.Portal>;
55
- declare const DateRangePickerPortal: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").PopoverPortalProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
55
+ declare function DateRangePickerPortal(props: DateRangePickerPortalProps): import("react").JSX.Element;
56
56
  type DateRangePickerPositionerProps = ComponentPropsWithoutRef<typeof Popover.Positioner>;
57
57
  declare const DateRangePickerPositioner: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").PopoverPositionerProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
58
58
  type DateRangePickerPopupProps = ComponentPropsWithoutRef<typeof Popover.Popup>;
@@ -110,7 +110,7 @@ declare const DateRangePicker: {
110
110
  } & import("react").RefAttributes<HTMLElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
111
111
  Value: import("react").ForwardRefExoticComponent<DateRangePickerValueProps & import("react").RefAttributes<HTMLSpanElement>>;
112
112
  Clear: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
113
- Portal: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").PopoverPortalProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
113
+ Portal: typeof DateRangePickerPortal;
114
114
  Positioner: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").PopoverPositionerProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
115
115
  Popup: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").PopoverPopupProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
116
116
  Close: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").PopoverCloseProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
@@ -52,7 +52,7 @@ declare const DateRangePickerValue: import("react").ForwardRefExoticComponent<Da
52
52
  type DateRangePickerClearProps = ComponentPropsWithoutRef<"button">;
53
53
  declare const DateRangePickerClear: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
54
54
  type DateRangePickerPortalProps = ComponentPropsWithoutRef<typeof Popover.Portal>;
55
- declare const DateRangePickerPortal: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").PopoverPortalProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
55
+ declare function DateRangePickerPortal(props: DateRangePickerPortalProps): import("react").JSX.Element;
56
56
  type DateRangePickerPositionerProps = ComponentPropsWithoutRef<typeof Popover.Positioner>;
57
57
  declare const DateRangePickerPositioner: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").PopoverPositionerProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
58
58
  type DateRangePickerPopupProps = ComponentPropsWithoutRef<typeof Popover.Popup>;
@@ -110,7 +110,7 @@ declare const DateRangePicker: {
110
110
  } & import("react").RefAttributes<HTMLElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
111
111
  Value: import("react").ForwardRefExoticComponent<DateRangePickerValueProps & import("react").RefAttributes<HTMLSpanElement>>;
112
112
  Clear: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
113
- Portal: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").PopoverPortalProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
113
+ Portal: typeof DateRangePickerPortal;
114
114
  Positioner: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").PopoverPositionerProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
115
115
  Popup: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").PopoverPopupProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
116
116
  Close: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").PopoverCloseProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
@@ -2,6 +2,7 @@
2
2
  import { cx } from "../../styled-system/css/cx.js";
3
3
  import { withRecipeClassName } from "../base-ui.js";
4
4
  import { dateRangePicker } from "../../styled-system/recipes/date-range-picker.js";
5
+ import { useThemePortalProps } from "../../theme/theme-scope.js";
5
6
  import { addDays, addMonths, createCalendarDate, dateKey, formatDateLabel, formatMonthLabel, getCalendarDays, getMonthLabels, getWeekdayLabels, isAfterDay, isBeforeDay, isSameDay, startOfMonth, toInputDate } from "../date-picker/date-utils.js";
6
7
  import { createContext, forwardRef, useCallback, useContext, useEffect, useId, useMemo, useRef, useState } from "react";
7
8
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
@@ -265,7 +266,9 @@ const DateRangePickerClear = forwardRef(function DateRangePickerClear({ children
265
266
  children
266
267
  });
267
268
  });
268
- const DateRangePickerPortal = Popover.Portal;
269
+ function DateRangePickerPortal(props) {
270
+ return /* @__PURE__ */ jsx(Popover.Portal, { ...useThemePortalProps(props) });
271
+ }
269
272
  const DateRangePickerPositioner = forwardRef(function DateRangePickerPositioner({ className, ...props }, ref) {
270
273
  const { styles } = useDateRangePickerContext();
271
274
  return /* @__PURE__ */ jsx(Popover.Positioner, {