jaci-ui 0.9.4 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (182) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.md +11 -1
  3. package/dist/_virtual/_rolldown/runtime.cjs +1 -1
  4. package/dist/components/accordion/accordion.cjs.map +1 -1
  5. package/dist/components/accordion/accordion.js.map +1 -1
  6. package/dist/components/alert/alert.cjs.map +1 -1
  7. package/dist/components/alert/alert.js.map +1 -1
  8. package/dist/components/alert-dialog/alert-dialog.cjs.map +1 -1
  9. package/dist/components/alert-dialog/alert-dialog.js.map +1 -1
  10. package/dist/components/aspect-ratio/aspect-ratio.cjs.map +1 -1
  11. package/dist/components/avatar/avatar.cjs.map +1 -1
  12. package/dist/components/avatar/avatar.js.map +1 -1
  13. package/dist/components/breadcrumbs/breadcrumbs.cjs.map +1 -1
  14. package/dist/components/button/button.cjs +1 -0
  15. package/dist/components/button/button.cjs.map +1 -1
  16. package/dist/components/button/button.d.cts +2 -1
  17. package/dist/components/button/button.d.ts +2 -1
  18. package/dist/components/button/button.js +1 -0
  19. package/dist/components/button/button.js.map +1 -1
  20. package/dist/components/button-group/button-group.cjs.map +1 -1
  21. package/dist/components/calendar/calendar.cjs +4 -6
  22. package/dist/components/calendar/calendar.cjs.map +1 -1
  23. package/dist/components/calendar/calendar.js +4 -6
  24. package/dist/components/calendar/calendar.js.map +1 -1
  25. package/dist/components/card/card.cjs.map +1 -1
  26. package/dist/components/carousel/carousel.cjs.map +1 -1
  27. package/dist/components/carousel/carousel.js.map +1 -1
  28. package/dist/components/checkbox-group/checkbox-group.cjs +7 -3
  29. package/dist/components/checkbox-group/checkbox-group.cjs.map +1 -1
  30. package/dist/components/checkbox-group/checkbox-group.js +7 -3
  31. package/dist/components/checkbox-group/checkbox-group.js.map +1 -1
  32. package/dist/components/code/code.cjs.map +1 -1
  33. package/dist/components/code/code.js.map +1 -1
  34. package/dist/components/collapsible/collapsible.cjs.map +1 -1
  35. package/dist/components/collapsible/collapsible.js.map +1 -1
  36. package/dist/components/color-picker/color-picker.cjs.map +1 -1
  37. package/dist/components/color-picker/color-picker.js.map +1 -1
  38. package/dist/components/color-picker/color-utils.cjs +5 -3
  39. package/dist/components/color-picker/color-utils.cjs.map +1 -1
  40. package/dist/components/color-picker/color-utils.js +5 -3
  41. package/dist/components/color-picker/color-utils.js.map +1 -1
  42. package/dist/components/color-swatch/color-swatch.cjs.map +1 -1
  43. package/dist/components/combobox/combobox.cjs +2 -1
  44. package/dist/components/combobox/combobox.cjs.map +1 -1
  45. package/dist/components/combobox/combobox.js +2 -1
  46. package/dist/components/combobox/combobox.js.map +1 -1
  47. package/dist/components/command/command.cjs.map +1 -1
  48. package/dist/components/command/command.js.map +1 -1
  49. package/dist/components/context-menu/context-menu.cjs.map +1 -1
  50. package/dist/components/context-menu/context-menu.d.cts +2 -2
  51. package/dist/components/context-menu/context-menu.d.ts +2 -2
  52. package/dist/components/controls/checkbox.cjs.map +1 -1
  53. package/dist/components/controls/checkbox.js.map +1 -1
  54. package/dist/components/controls/input.cjs.map +1 -1
  55. package/dist/components/controls/input.js.map +1 -1
  56. package/dist/components/controls/radio.cjs.map +1 -1
  57. package/dist/components/controls/switch.cjs.map +1 -1
  58. package/dist/components/controls/switch.js.map +1 -1
  59. package/dist/components/controls/textarea.cjs.map +1 -1
  60. package/dist/components/controls/textarea.js.map +1 -1
  61. package/dist/components/copyable/copyable.cjs.map +1 -1
  62. package/dist/components/copyable/copyable.js.map +1 -1
  63. package/dist/components/data-toolbar/data-toolbar.cjs.map +1 -1
  64. package/dist/components/data-toolbar/data-toolbar.js.map +1 -1
  65. package/dist/components/data-view/data-view.cjs.map +1 -1
  66. package/dist/components/date-picker/date-picker.cjs +4 -7
  67. package/dist/components/date-picker/date-picker.cjs.map +1 -1
  68. package/dist/components/date-picker/date-picker.js +4 -7
  69. package/dist/components/date-picker/date-picker.js.map +1 -1
  70. package/dist/components/date-range-picker/date-range-picker.cjs +4 -6
  71. package/dist/components/date-range-picker/date-range-picker.cjs.map +1 -1
  72. package/dist/components/date-range-picker/date-range-picker.js +4 -6
  73. package/dist/components/date-range-picker/date-range-picker.js.map +1 -1
  74. package/dist/components/dialog/dialog.cjs.map +1 -1
  75. package/dist/components/dialog/dialog.js.map +1 -1
  76. package/dist/components/download-trigger/download-trigger.cjs.map +1 -1
  77. package/dist/components/drawer/drawer.cjs.map +1 -1
  78. package/dist/components/drawer/drawer.js.map +1 -1
  79. package/dist/components/empty-state/empty-state.cjs.map +1 -1
  80. package/dist/components/feedback/badge.cjs.map +1 -1
  81. package/dist/components/field/field.cjs.map +1 -1
  82. package/dist/components/field/field.js.map +1 -1
  83. package/dist/components/fieldset/fieldset.cjs.map +1 -1
  84. package/dist/components/figure/figure.cjs.map +1 -1
  85. package/dist/components/figure/figure.js.map +1 -1
  86. package/dist/components/form/form.cjs.map +1 -1
  87. package/dist/components/form/form.js.map +1 -1
  88. package/dist/components/icon-button/icon-button.cjs.map +1 -1
  89. package/dist/components/icon-button/icon-button.js.map +1 -1
  90. package/dist/components/image/image.cjs.map +1 -1
  91. package/dist/components/image/image.js.map +1 -1
  92. package/dist/components/input-group/input-group.cjs.map +1 -1
  93. package/dist/components/kbd/kbd.cjs.map +1 -1
  94. package/dist/components/layout/index.cjs.map +1 -1
  95. package/dist/components/list/list.cjs.map +1 -1
  96. package/dist/components/menu/menu.cjs.map +1 -1
  97. package/dist/components/menu/menu.d.cts +2 -2
  98. package/dist/components/menu/menu.d.ts +2 -2
  99. package/dist/components/menubar/menubar.cjs.map +1 -1
  100. package/dist/components/menubar/menubar.d.cts +2 -2
  101. package/dist/components/menubar/menubar.d.ts +2 -2
  102. package/dist/components/menubar/menubar.js.map +1 -1
  103. package/dist/components/meter/meter.cjs.map +1 -1
  104. package/dist/components/meter/meter.js.map +1 -1
  105. package/dist/components/navigation/navigation.cjs.map +1 -1
  106. package/dist/components/navigation/navigation.js.map +1 -1
  107. package/dist/components/navigation-menu/navigation-menu.cjs.map +1 -1
  108. package/dist/components/navigation-menu/navigation-menu.js.map +1 -1
  109. package/dist/components/number-field/number-field.cjs +2 -1
  110. package/dist/components/number-field/number-field.cjs.map +1 -1
  111. package/dist/components/number-field/number-field.js +2 -1
  112. package/dist/components/number-field/number-field.js.map +1 -1
  113. package/dist/components/option-selector/option-selector.cjs.map +1 -1
  114. package/dist/components/option-selector/option-selector.js.map +1 -1
  115. package/dist/components/pagination/pagination.cjs.map +1 -1
  116. package/dist/components/pagination/pagination.js.map +1 -1
  117. package/dist/components/pin-input/pin-input.cjs.map +1 -1
  118. package/dist/components/pin-input/pin-input.js.map +1 -1
  119. package/dist/components/popover/popover.cjs.map +1 -1
  120. package/dist/components/popover/popover.js.map +1 -1
  121. package/dist/components/progress/progress.cjs.map +1 -1
  122. package/dist/components/progress/progress.js.map +1 -1
  123. package/dist/components/qr-code/qr-code.cjs.map +1 -1
  124. package/dist/components/qr-code/qr-code.js.map +1 -1
  125. package/dist/components/quote/quote.cjs.map +1 -1
  126. package/dist/components/quote/quote.js.map +1 -1
  127. package/dist/components/radio-group/radio-group.cjs +7 -3
  128. package/dist/components/radio-group/radio-group.cjs.map +1 -1
  129. package/dist/components/radio-group/radio-group.js +7 -3
  130. package/dist/components/radio-group/radio-group.js.map +1 -1
  131. package/dist/components/range-slider/range-slider.cjs.map +1 -1
  132. package/dist/components/range-slider/range-slider.js.map +1 -1
  133. package/dist/components/scroll-area/scroll-area.cjs.map +1 -1
  134. package/dist/components/select/select.cjs.map +1 -1
  135. package/dist/components/select/select.js.map +1 -1
  136. package/dist/components/sidebar/sidebar.cjs.map +1 -1
  137. package/dist/components/sidebar/sidebar.js.map +1 -1
  138. package/dist/components/skeleton/skeleton.cjs.map +1 -1
  139. package/dist/components/slider/slider.cjs.map +1 -1
  140. package/dist/components/slider/slider.js.map +1 -1
  141. package/dist/components/spacer/spacer.cjs.map +1 -1
  142. package/dist/components/stat/stat.cjs.map +1 -1
  143. package/dist/components/stat/stat.js.map +1 -1
  144. package/dist/components/stepper/stepper.cjs +2 -1
  145. package/dist/components/stepper/stepper.cjs.map +1 -1
  146. package/dist/components/stepper/stepper.js +2 -1
  147. package/dist/components/stepper/stepper.js.map +1 -1
  148. package/dist/components/table/table.cjs.map +1 -1
  149. package/dist/components/table/table.js.map +1 -1
  150. package/dist/components/tabs/tabs.cjs.map +1 -1
  151. package/dist/components/tabs/tabs.js.map +1 -1
  152. package/dist/components/tags-input/tags-input.cjs +10 -9
  153. package/dist/components/tags-input/tags-input.cjs.map +1 -1
  154. package/dist/components/tags-input/tags-input.js +10 -9
  155. package/dist/components/tags-input/tags-input.js.map +1 -1
  156. package/dist/components/toast/toast.cjs.map +1 -1
  157. package/dist/components/toast/toast.js.map +1 -1
  158. package/dist/components/toggle/toggle.cjs.map +1 -1
  159. package/dist/components/toggle-group/toggle-group.cjs.map +1 -1
  160. package/dist/components/toolbar/toolbar.cjs.map +1 -1
  161. package/dist/components/tooltip/tooltip.cjs.map +1 -1
  162. package/dist/components/tree-view/tree-view.cjs.map +1 -1
  163. package/dist/components/tree-view/tree-view.js.map +1 -1
  164. package/dist/components/typography/heading.cjs.map +1 -1
  165. package/dist/components/typography/link.cjs.map +1 -1
  166. package/dist/components/typography/paragraph.cjs.map +1 -1
  167. package/dist/components/typography/text.cjs.map +1 -1
  168. package/dist/components/upload/upload.cjs +2 -2
  169. package/dist/components/upload/upload.cjs.map +1 -1
  170. package/dist/components/upload/upload.js +2 -2
  171. package/dist/components/upload/upload.js.map +1 -1
  172. package/dist/components/visually-hidden/visually-hidden.cjs.map +1 -1
  173. package/dist/panda-preset.cjs.map +1 -1
  174. package/dist/styles/theme.cjs +18 -18
  175. package/dist/styles/theme.cjs.map +1 -1
  176. package/dist/styles/theme.js +18 -18
  177. package/dist/styles/theme.js.map +1 -1
  178. package/dist/styles.css +12 -21
  179. package/dist/theme/theme-provider.cjs.map +1 -1
  180. package/dist/theme/theme-provider.js.map +1 -1
  181. package/dist/theme/theme-scope.cjs.map +1 -1
  182. package/package.json +9 -9
@@ -1 +1 @@
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,MAAM,SAAS,OAAO,CAACA,mBAAAA,YAAY,MAAM,MAAM,KAAK,KAAK,CAACC,mBAAAA,WAAW,MAAM,GAAG,CAAC;AAChG;AAEA,SAAgB,oBAAoB,EAClC,UACA,gBAAgB,MAChB,eAAe;CAAE,OAAO;CAAM,KAAK;AAAK,GACxC,WAAW,OACX,gBACA,SAAS,SACT,SACA,SACA,MACA,eACA,eACA,OAAO,iBACP,eAAe,GACf,WAAW,qBACX,GAAG,gBACwB;CAC3B,MAAM,CAAC,mBAAmB,yBAAA,GAAA,MAAA,SAAA,CAA4C,YAAY;CAClF,MAAM,QAAQ,mBAAmB;CACjC,MAAM,cAAc,MAAM,SAAS,iCAAiB,IAAI,KAAK;CAC7D,MAAM,CAAC,OAAO,kBAAA,GAAA,MAAA,SAAA,OAAgCC,mBAAAA,aAAa,WAAW,CAAC;CACvE,MAAM,CAAC,aAAa,mBAAA,GAAA,MAAA,SAAA,CAA2B,MAAM,SAAS,WAAW;CACzE,MAAM,CAAC,aAAa,mBAAA,GAAA,MAAA,SAAA,CAAwC,IAAI;CAChE,MAAM,WAAA,GAAA,MAAA,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AU;GACnB,MAAM,CAAC,MAAM,OAAO,OAAO,MAAM,cAAc,MAAM,MAAM,GAAG,CAAC,CAAC,IAAI,MAAM;GAC1E,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,KAAK;GAC7B,MAAM,OAAON,mBAAAA,mBAAmB,MAAM,QAAQ,GAAG,GAAG;GACpD,SACE,SAAS,UAAU;IAAE,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":["createContext","useContext","isBeforeDay","isAfterDay","useState","startOfMonth","useRef","useId","dateRangePicker","useMemo","useCallback","createCalendarDate","addMonths","addDays","dateKey","BasePopover","toInputDate","forwardRef","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,GAAyBA,MAAAA,cAAAA,CAAkD,IAAI;AAErF,SAAS,4BAA4B;CACnC,MAAM,WAAA,GAAUC,MAAAA,WAAAA,CAA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MAAM;EAC5B,WAAW,UAAU;GACnB,MAAM,CAAC,MAAM,OAAO,OAAO,MAAM,cAAc,MAAM,MAAM,GAAG,CAAC,CAAC,IAAI,MAAM;GAC1E,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,KAAK;GAC7B,MAAM,OAAOP,mBAAAA,mBAAmB,MAAM,QAAQ,GAAG,GAAG;GACpD,SACE,SAAS,UAAU;IAAE,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,GAA4BM,MAAAA,WAAAA,CAGvC,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,GAA0BA,MAAAA,WAAAA,CAGrC,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"}
@@ -432,12 +432,10 @@ const DateRangePickerDay = forwardRef(function DateRangePickerDay({ children, cl
432
432
  nextDate = addMonths(date, event.shiftKey ? 12 : 1);
433
433
  break;
434
434
  case "Enter":
435
- case " ":
436
- if (!isDisabled) {
437
- event.preventDefault();
438
- onSelect(date);
439
- }
440
- break;
435
+ case " ": if (!isDisabled) {
436
+ event.preventDefault();
437
+ onSelect(date);
438
+ }
441
439
  }
442
440
  if (nextDate) {
443
441
  event.preventDefault();
@@ -1 +1 @@
1
- {"version":3,"file":"date-range-picker.js","names":["BasePopover"],"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,\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,WAAW,UAAU;GACnB,MAAM,CAAC,MAAM,OAAO,OAAO,MAAM,cAAc,MAAM,MAAM,GAAG,CAAC,CAAC,IAAI,MAAM;GAC1E,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,KAAK;GAC7B,MAAM,OAAO,mBAAmB,MAAM,QAAQ,GAAG,GAAG;GACpD,SACE,SAAS,UAAU;IAAE,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,4BAA4B,WAGvC,SAAS,0BAA0B,OAAO,KAAK;CAC/C,OAAO,oBAAC,sBAAD;EAAsB,GAAI;EAAY;EAAK,MAAK;CAAS,CAAA;AAClE,CAAC;AACD,MAAa,0BAA0B,WAGrC,SAAS,wBAAwB,OAAO,KAAK;CAC7C,OAAO,oBAAC,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.js","names":["BasePopover"],"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,yBAAyB,cAAkD,IAAI;AAErF,SAAS,4BAA4B;CACnC,MAAM,UAAU,WAAW,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,MAAM,SAAS,OAAO,CAAC,YAAY,MAAM,MAA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ACL,MAAK;EACE;CACR,CAAA;AAEL,CACF;AAEA,MAAa,4BAA4B,WAGvC,SAAS,0BAA0B,OAAO,KAAK;CAC/C,OAAO,oBAAC,sBAAD;EAAsB,GAAI;EAAY;EAAK,MAAK;CAAS,CAAA;AAClE,CAAC;AACD,MAAa,0BAA0B,WAGrC,SAAS,wBAAwB,OAAO,KAAK;CAC7C,OAAO,oBAAC,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 +1 @@
1
- {"version":3,"file":"dialog.cjs","names":["BaseDialog","withRecipeClassName","dialog","useThemePortalProps","cx"],"sources":["../../../src/components/dialog/dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport { Dialog as BaseDialog } from \"@base-ui/react/dialog\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport type { DialogRoot as BaseDialogRoot } from \"@base-ui/react/dialog\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { dialog } from \"../../styled-system/recipes\";\nimport { withRecipeClassName } from \"../base-ui\";\nimport { useThemePortalProps } from \"../../theme/theme-scope\";\n\nexport type DialogSize = \"sm\" | \"md\" | \"lg\";\n\n/**\n * Groups the dialog parts. It supports Base UI's controlled open/onOpenChange\n * API and uncontrolled defaultOpen API.\n */\nexport type DialogRootProps<Payload = unknown> = BaseDialogRoot.Props<Payload>;\n\nexport function DialogRoot<Payload = unknown>(props: DialogRootProps<Payload>) {\n return <BaseDialog.Root {...props} />;\n}\n\nexport type DialogTriggerProps = ComponentPropsWithoutRef<typeof BaseDialog.Trigger>;\n\nexport const DialogTrigger = forwardRef<HTMLButtonElement, DialogTriggerProps>(\n function DialogTrigger({ className, ...props }, ref) {\n return (\n <BaseDialog.Trigger\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().trigger, className)}\n data-slot=\"dialog-trigger\"\n />\n );\n },\n);\n\nexport type DialogPortalProps = ComponentPropsWithoutRef<typeof BaseDialog.Portal>;\n\n/**\n * Preserves Base UI's portal behavior and optional container/ref APIs.\n */\nexport function DialogPortal(props: DialogPortalProps) {\n return <BaseDialog.Portal {...useThemePortalProps(props)} />;\n}\n\nexport type DialogBackdropProps = ComponentPropsWithoutRef<typeof BaseDialog.Backdrop>;\n\nexport const DialogBackdrop = forwardRef<HTMLDivElement, DialogBackdropProps>(\n function DialogBackdrop({ className, ...props }, ref) {\n return (\n <BaseDialog.Backdrop\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().backdrop, className)}\n data-slot=\"dialog-backdrop\"\n />\n );\n },\n);\n\nexport type DialogViewportProps = ComponentPropsWithoutRef<typeof BaseDialog.Viewport>;\n\nexport const DialogViewport = forwardRef<HTMLDivElement, DialogViewportProps>(\n function DialogViewport({ className, ...props }, ref) {\n return (\n <BaseDialog.Viewport\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().viewport, className)}\n data-slot=\"dialog-viewport\"\n />\n );\n },\n);\n\nexport interface DialogPopupProps extends ComponentPropsWithoutRef<typeof BaseDialog.Popup> {\n size?: DialogSize;\n}\n\nexport const DialogPopup = forwardRef<HTMLDivElement, DialogPopupProps>(function DialogPopup(\n { className, size = \"md\", ...props },\n ref,\n) {\n return (\n <BaseDialog.Popup\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog({ size }).popup, className)}\n data-jaci-component=\"dialog\"\n data-slot=\"dialog-popup\"\n />\n );\n});\n\nexport type DialogHeaderProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const DialogHeader = forwardRef<HTMLDivElement, DialogHeaderProps>(function DialogHeader(\n { className, ...props },\n ref,\n) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(dialog().header, className)}\n data-slot=\"dialog-header\"\n />\n );\n});\n\nexport type DialogTitleProps = ComponentPropsWithoutRef<typeof BaseDialog.Title>;\n\nexport const DialogTitle = forwardRef<HTMLHeadingElement, DialogTitleProps>(function DialogTitle(\n { className, ...props },\n ref,\n) {\n return (\n <BaseDialog.Title\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().title, className)}\n data-slot=\"dialog-title\"\n />\n );\n});\n\nexport type DialogDescriptionProps = ComponentPropsWithoutRef<typeof BaseDialog.Description>;\n\nexport const DialogDescription = forwardRef<HTMLParagraphElement, DialogDescriptionProps>(\n function DialogDescription({ className, ...props }, ref) {\n return (\n <BaseDialog.Description\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().description, className)}\n data-slot=\"dialog-description\"\n />\n );\n },\n);\n\nexport type DialogBodyProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const DialogBody = forwardRef<HTMLDivElement, DialogBodyProps>(function DialogBody(\n { className, ...props },\n ref,\n) {\n return (\n <div {...props} ref={ref} className={cx(dialog().body, className)} data-slot=\"dialog-body\" />\n );\n});\n\nexport type DialogFooterProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const DialogFooter = forwardRef<HTMLDivElement, DialogFooterProps>(function DialogFooter(\n { className, ...props },\n ref,\n) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(dialog().footer, className)}\n data-slot=\"dialog-footer\"\n />\n );\n});\n\nexport type DialogCloseProps = ComponentPropsWithoutRef<typeof BaseDialog.Close>;\n\nexport const DialogClose = forwardRef<HTMLButtonElement, DialogCloseProps>(function DialogClose(\n { \"aria-label\": ariaLabel, children, className, ...props },\n ref,\n) {\n const hasVisibleLabel = children != null;\n\n return (\n <BaseDialog.Close\n {...props}\n aria-label={ariaLabel ?? (hasVisibleLabel ? undefined : \"Close dialog\")}\n ref={ref}\n className={withRecipeClassName(hasVisibleLabel ? dialog().action : dialog().close, className)}\n data-slot=\"dialog-close\"\n >\n {children ?? \"×\"}\n </BaseDialog.Close>\n );\n});\n\nexport const Dialog = {\n Root: DialogRoot,\n Trigger: DialogTrigger,\n Portal: DialogPortal,\n Backdrop: DialogBackdrop,\n Viewport: DialogViewport,\n Popup: DialogPopup,\n Header: DialogHeader,\n Title: DialogTitle,\n Description: DialogDescription,\n Body: DialogBody,\n Footer: DialogFooter,\n Close: DialogClose,\n createHandle: BaseDialog.createHandle,\n};\n"],"mappings":";;;;;;;;;AAoBA,SAAgB,WAA8B,OAAiC;CAC7E,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAACA,sBAAAA,OAAW,MAAZ,EAAiB,GAAI,MAAQ,CAAA;AACtC;AAIA,MAAa,iBAAA,GAAA,MAAA,WAAA,CACX,SAAS,cAAc,EAAE,WAAW,GAAG,SAAS,KAAK;CACnD,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACA,sBAAAA,OAAW,SAAZ;EACE,GAAI;EACC;EACL,WAAWC,gBAAAA,oBAAoBC,eAAAA,OAAO,CAAC,CAAC,SAAS,SAAS;EAC1D,aAAU;CACX,CAAA;AAEL,CACF;;;;AAOA,SAAgB,aAAa,OAA0B;CACrD,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAACF,sBAAAA,OAAW,QAAZ,EAAmB,GAAIG,oBAAAA,oBAAoB,KAAK,EAAI,CAAA;AAC7D;AAIA,MAAa,kBAAA,GAAA,MAAA,WAAA,CACX,SAAS,eAAe,EAAE,WAAW,GAAG,SAAS,KAAK;CACpD,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACH,sBAAAA,OAAW,UAAZ;EACE,GAAI;EACC;EACL,WAAWC,gBAAAA,oBAAoBC,eAAAA,OAAO,CAAC,CAAC,UAAU,SAAS;EAC3D,aAAU;CACX,CAAA;AAEL,CACF;AAIA,MAAa,kBAAA,GAAA,MAAA,WAAA,CACX,SAAS,eAAe,EAAE,WAAW,GAAG,SAAS,KAAK;CACpD,OACE,iBAAA,GAA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;CACX,CAAA;AAEL,CACF;AAIA,MAAa,cAAA,GAAA,MAAA,WAAA,CAAyD,SAAS,WAC7E,EAAE,WAAW,GAAG,SAChB,KACA;CACA,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EAAK,GAAI;EAAY;EAAK,WAAWE,WAAAA,GAAGF,eAAAA,OAAO,CAAC,CAAC,MAAM,SAAS;EAAG,aAAU;CAAe,CAAA;AAEhG,CAAC;AAID,MAAa,gBAAA,GAAA,MAAA,WAAA,CAA6D,SAAS,aACjF,EAAE,WAAW,GAAG,SAChB,KACA;CACA,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EACE,GAAI;EACC;EACL,WAAWE,WAAAA,GAAGF,eAAAA,OAAO,CAAC,CAAC,QAAQ,SAAS;EACxC,aAAU;CACX,CAAA;AAEL,CAAC;AAID,MAAa,eAAA,GAAA,MAAA,WAAA,CAA8D,SAAS,YAClF,EAAE,cAAc,WAAW,UAAU,WAAW,GAAG,SACnD,KACA;CACA,MAAM,kBAAkB,YAAY;CAEpC,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACF,sBAAAA,OAAW,OAAZ;EACE,GAAI;EACJ,cAAY,cAAc,kBAAkB,KAAA,IAAY;EACnD;EACL,WAAWC,gBAAAA,oBAAoB,kBAAkBC,eAAAA,OAAO,CAAC,CAAC,SAASA,eAAAA,OAAO,CAAC,CAAC,OAAO,SAAS;EAC5F,aAAU;YAET,YAAY;CACG,CAAA;AAEtB,CAAC;AAED,MAAa,SAAS;CACpB,MAAM;CACN,SAAS;CACT,QAAQ;CACR,UAAU;CACV,UAAU;CACV,OAAO;CACP,QAAQ;CACR,OAAO;CACP,aAAa;CACb,MAAM;CACN,QAAQ;CACR,OAAO;CACP,cAAcF,sBAAAA,OAAW;AAC3B"}
1
+ {"version":3,"file":"dialog.cjs","names":["BaseDialog","forwardRef","withRecipeClassName","dialog","useThemePortalProps","cx"],"sources":["../../../src/components/dialog/dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport { Dialog as BaseDialog } from \"@base-ui/react/dialog\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport type { DialogRoot as BaseDialogRoot } from \"@base-ui/react/dialog\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { dialog } from \"../../styled-system/recipes\";\nimport { withRecipeClassName } from \"../base-ui\";\nimport { useThemePortalProps } from \"../../theme/theme-scope\";\n\nexport type DialogSize = \"sm\" | \"md\" | \"lg\";\n\n/**\n * Groups the dialog parts. It supports Base UI's controlled open/onOpenChange\n * API and uncontrolled defaultOpen API.\n */\nexport type DialogRootProps<Payload = unknown> = BaseDialogRoot.Props<Payload>;\n\nexport function DialogRoot<Payload = unknown>(props: DialogRootProps<Payload>) {\n return <BaseDialog.Root {...props} />;\n}\n\nexport type DialogTriggerProps = ComponentPropsWithoutRef<typeof BaseDialog.Trigger>;\n\nexport const DialogTrigger = forwardRef<HTMLButtonElement, DialogTriggerProps>(\n function DialogTrigger({ className, ...props }, ref) {\n return (\n <BaseDialog.Trigger\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().trigger, className)}\n data-slot=\"dialog-trigger\"\n />\n );\n },\n);\n\nexport type DialogPortalProps = ComponentPropsWithoutRef<typeof BaseDialog.Portal>;\n\n/**\n * Preserves Base UI's portal behavior and optional container/ref APIs.\n */\nexport function DialogPortal(props: DialogPortalProps) {\n return <BaseDialog.Portal {...useThemePortalProps(props)} />;\n}\n\nexport type DialogBackdropProps = ComponentPropsWithoutRef<typeof BaseDialog.Backdrop>;\n\nexport const DialogBackdrop = forwardRef<HTMLDivElement, DialogBackdropProps>(\n function DialogBackdrop({ className, ...props }, ref) {\n return (\n <BaseDialog.Backdrop\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().backdrop, className)}\n data-slot=\"dialog-backdrop\"\n />\n );\n },\n);\n\nexport type DialogViewportProps = ComponentPropsWithoutRef<typeof BaseDialog.Viewport>;\n\nexport const DialogViewport = forwardRef<HTMLDivElement, DialogViewportProps>(\n function DialogViewport({ className, ...props }, ref) {\n return (\n <BaseDialog.Viewport\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().viewport, className)}\n data-slot=\"dialog-viewport\"\n />\n );\n },\n);\n\nexport interface DialogPopupProps extends ComponentPropsWithoutRef<typeof BaseDialog.Popup> {\n size?: DialogSize;\n}\n\nexport const DialogPopup = forwardRef<HTMLDivElement, DialogPopupProps>(function DialogPopup(\n { className, size = \"md\", ...props },\n ref,\n) {\n return (\n <BaseDialog.Popup\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog({ size }).popup, className)}\n data-jaci-component=\"dialog\"\n data-slot=\"dialog-popup\"\n />\n );\n});\n\nexport type DialogHeaderProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const DialogHeader = forwardRef<HTMLDivElement, DialogHeaderProps>(function DialogHeader(\n { className, ...props },\n ref,\n) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(dialog().header, className)}\n data-slot=\"dialog-header\"\n />\n );\n});\n\nexport type DialogTitleProps = ComponentPropsWithoutRef<typeof BaseDialog.Title>;\n\nexport const DialogTitle = forwardRef<HTMLHeadingElement, DialogTitleProps>(function DialogTitle(\n { className, ...props },\n ref,\n) {\n return (\n <BaseDialog.Title\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().title, className)}\n data-slot=\"dialog-title\"\n />\n );\n});\n\nexport type DialogDescriptionProps = ComponentPropsWithoutRef<typeof BaseDialog.Description>;\n\nexport const DialogDescription = forwardRef<HTMLParagraphElement, DialogDescriptionProps>(\n function DialogDescription({ className, ...props }, ref) {\n return (\n <BaseDialog.Description\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().description, className)}\n data-slot=\"dialog-description\"\n />\n );\n },\n);\n\nexport type DialogBodyProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const DialogBody = forwardRef<HTMLDivElement, DialogBodyProps>(function DialogBody(\n { className, ...props },\n ref,\n) {\n return (\n <div {...props} ref={ref} className={cx(dialog().body, className)} data-slot=\"dialog-body\" />\n );\n});\n\nexport type DialogFooterProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const DialogFooter = forwardRef<HTMLDivElement, DialogFooterProps>(function DialogFooter(\n { className, ...props },\n ref,\n) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(dialog().footer, className)}\n data-slot=\"dialog-footer\"\n />\n );\n});\n\nexport type DialogCloseProps = ComponentPropsWithoutRef<typeof BaseDialog.Close>;\n\nexport const DialogClose = forwardRef<HTMLButtonElement, DialogCloseProps>(function DialogClose(\n { \"aria-label\": ariaLabel, children, className, ...props },\n ref,\n) {\n const hasVisibleLabel = children != null;\n\n return (\n <BaseDialog.Close\n {...props}\n aria-label={ariaLabel ?? (hasVisibleLabel ? undefined : \"Close dialog\")}\n ref={ref}\n className={withRecipeClassName(hasVisibleLabel ? dialog().action : dialog().close, className)}\n data-slot=\"dialog-close\"\n >\n {children ?? \"×\"}\n </BaseDialog.Close>\n );\n});\n\nexport const Dialog = {\n Root: DialogRoot,\n Trigger: DialogTrigger,\n Portal: DialogPortal,\n Backdrop: DialogBackdrop,\n Viewport: DialogViewport,\n Popup: DialogPopup,\n Header: DialogHeader,\n Title: DialogTitle,\n Description: DialogDescription,\n Body: DialogBody,\n Footer: DialogFooter,\n Close: DialogClose,\n createHandle: BaseDialog.createHandle,\n};\n"],"mappings":";;;;;;;;;AAoBA,SAAgB,WAA8B,OAAiC;CAC7E,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAACA,sBAAAA,OAAW,MAAZ,EAAiB,GAAI,MAAQ,CAAA;AACtC;AAIA,MAAa,iBAAA,GAAgBC,MAAAA,WAAAA,CAC3B,SAAS,cAAc,EAAE,WAAW,GAAG,SAAS,KAAK;CACnD,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACD,sBAAAA,OAAW,SAAZ;EACE,GAAI;EACC;EACL,WAAWE,gBAAAA,oBAAoBC,eAAAA,OAAO,CAAC,CAAC,SAAS,SAAS;EAC1D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,kBAAkB,YAAY;CAEpC,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACD,sBAAAA,OAAW,OAAZ;EACE,GAAI;EACJ,cAAY,cAAc,kBAAkB,KAAA,IAAY;EACnD;EACL,WAAWE,gBAAAA,oBAAoB,kBAAkBC,eAAAA,OAAO,CAAC,CAAC,SAASA,eAAAA,OAAO,CAAC,CAAC,OAAO,SAAS;EAC5F,aAAU;EAET,UAAA,YAAY;CACG,CAAA;AAEtB,CAAC;AAED,MAAa,SAAS;CACpB,MAAM;CACN,SAAS;CACT,QAAQ;CACR,UAAU;CACV,UAAU;CACV,OAAO;CACP,QAAQ;CACR,OAAO;CACP,aAAa;CACb,MAAM;CACN,QAAQ;CACR,OAAO;CACP,cAAcH,sBAAAA,OAAW;AAC3B"}
@@ -1 +1 @@
1
- {"version":3,"file":"dialog.js","names":["DialogRoot","BaseDialog","Dialog"],"sources":["../../../src/components/dialog/dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport { Dialog as BaseDialog } from \"@base-ui/react/dialog\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport type { DialogRoot as BaseDialogRoot } from \"@base-ui/react/dialog\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { dialog } from \"../../styled-system/recipes\";\nimport { withRecipeClassName } from \"../base-ui\";\nimport { useThemePortalProps } from \"../../theme/theme-scope\";\n\nexport type DialogSize = \"sm\" | \"md\" | \"lg\";\n\n/**\n * Groups the dialog parts. It supports Base UI's controlled open/onOpenChange\n * API and uncontrolled defaultOpen API.\n */\nexport type DialogRootProps<Payload = unknown> = BaseDialogRoot.Props<Payload>;\n\nexport function DialogRoot<Payload = unknown>(props: DialogRootProps<Payload>) {\n return <BaseDialog.Root {...props} />;\n}\n\nexport type DialogTriggerProps = ComponentPropsWithoutRef<typeof BaseDialog.Trigger>;\n\nexport const DialogTrigger = forwardRef<HTMLButtonElement, DialogTriggerProps>(\n function DialogTrigger({ className, ...props }, ref) {\n return (\n <BaseDialog.Trigger\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().trigger, className)}\n data-slot=\"dialog-trigger\"\n />\n );\n },\n);\n\nexport type DialogPortalProps = ComponentPropsWithoutRef<typeof BaseDialog.Portal>;\n\n/**\n * Preserves Base UI's portal behavior and optional container/ref APIs.\n */\nexport function DialogPortal(props: DialogPortalProps) {\n return <BaseDialog.Portal {...useThemePortalProps(props)} />;\n}\n\nexport type DialogBackdropProps = ComponentPropsWithoutRef<typeof BaseDialog.Backdrop>;\n\nexport const DialogBackdrop = forwardRef<HTMLDivElement, DialogBackdropProps>(\n function DialogBackdrop({ className, ...props }, ref) {\n return (\n <BaseDialog.Backdrop\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().backdrop, className)}\n data-slot=\"dialog-backdrop\"\n />\n );\n },\n);\n\nexport type DialogViewportProps = ComponentPropsWithoutRef<typeof BaseDialog.Viewport>;\n\nexport const DialogViewport = forwardRef<HTMLDivElement, DialogViewportProps>(\n function DialogViewport({ className, ...props }, ref) {\n return (\n <BaseDialog.Viewport\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().viewport, className)}\n data-slot=\"dialog-viewport\"\n />\n );\n },\n);\n\nexport interface DialogPopupProps extends ComponentPropsWithoutRef<typeof BaseDialog.Popup> {\n size?: DialogSize;\n}\n\nexport const DialogPopup = forwardRef<HTMLDivElement, DialogPopupProps>(function DialogPopup(\n { className, size = \"md\", ...props },\n ref,\n) {\n return (\n <BaseDialog.Popup\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog({ size }).popup, className)}\n data-jaci-component=\"dialog\"\n data-slot=\"dialog-popup\"\n />\n );\n});\n\nexport type DialogHeaderProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const DialogHeader = forwardRef<HTMLDivElement, DialogHeaderProps>(function DialogHeader(\n { className, ...props },\n ref,\n) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(dialog().header, className)}\n data-slot=\"dialog-header\"\n />\n );\n});\n\nexport type DialogTitleProps = ComponentPropsWithoutRef<typeof BaseDialog.Title>;\n\nexport const DialogTitle = forwardRef<HTMLHeadingElement, DialogTitleProps>(function DialogTitle(\n { className, ...props },\n ref,\n) {\n return (\n <BaseDialog.Title\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().title, className)}\n data-slot=\"dialog-title\"\n />\n );\n});\n\nexport type DialogDescriptionProps = ComponentPropsWithoutRef<typeof BaseDialog.Description>;\n\nexport const DialogDescription = forwardRef<HTMLParagraphElement, DialogDescriptionProps>(\n function DialogDescription({ className, ...props }, ref) {\n return (\n <BaseDialog.Description\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().description, className)}\n data-slot=\"dialog-description\"\n />\n );\n },\n);\n\nexport type DialogBodyProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const DialogBody = forwardRef<HTMLDivElement, DialogBodyProps>(function DialogBody(\n { className, ...props },\n ref,\n) {\n return (\n <div {...props} ref={ref} className={cx(dialog().body, className)} data-slot=\"dialog-body\" />\n );\n});\n\nexport type DialogFooterProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const DialogFooter = forwardRef<HTMLDivElement, DialogFooterProps>(function DialogFooter(\n { className, ...props },\n ref,\n) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(dialog().footer, className)}\n data-slot=\"dialog-footer\"\n />\n );\n});\n\nexport type DialogCloseProps = ComponentPropsWithoutRef<typeof BaseDialog.Close>;\n\nexport const DialogClose = forwardRef<HTMLButtonElement, DialogCloseProps>(function DialogClose(\n { \"aria-label\": ariaLabel, children, className, ...props },\n ref,\n) {\n const hasVisibleLabel = children != null;\n\n return (\n <BaseDialog.Close\n {...props}\n aria-label={ariaLabel ?? (hasVisibleLabel ? undefined : \"Close dialog\")}\n ref={ref}\n className={withRecipeClassName(hasVisibleLabel ? dialog().action : dialog().close, className)}\n data-slot=\"dialog-close\"\n >\n {children ?? \"×\"}\n </BaseDialog.Close>\n );\n});\n\nexport const Dialog = {\n Root: DialogRoot,\n Trigger: DialogTrigger,\n Portal: DialogPortal,\n Backdrop: DialogBackdrop,\n Viewport: DialogViewport,\n Popup: DialogPopup,\n Header: DialogHeader,\n Title: DialogTitle,\n Description: DialogDescription,\n Body: DialogBody,\n Footer: DialogFooter,\n Close: DialogClose,\n createHandle: BaseDialog.createHandle,\n};\n"],"mappings":";;;;;;;;;AAoBA,SAAgBA,aAA8B,OAAiC;CAC7E,OAAO,oBAACC,OAAW,MAAZ,EAAiB,GAAI,MAAQ,CAAA;AACtC;AAIA,MAAa,gBAAgB,WAC3B,SAAS,cAAc,EAAE,WAAW,GAAG,SAAS,KAAK;CACnD,OACE,oBAACA,OAAW,SAAZ;EACE,GAAI;EACC;EACL,WAAW,oBAAoB,OAAO,CAAC,CAAC,SAAS,SAAS;EAC1D,aAAU;CACX,CAAA;AAEL,CACF;;;;AAOA,SAAgB,aAAa,OAA0B;CACrD,OAAO,oBAACA,OAAW,QAAZ,EAAmB,GAAI,oBAAoB,KAAK,EAAI,CAAA;AAC7D;AAIA,MAAa,iBAAiB,WAC5B,SAAS,eAAe,EAAE,WAAW,GAAG,SAAS,KAAK;CACpD,OACE,oBAACA,OAAW,UAAZ;EACE,GAAI;EACC;EACL,WAAW,oBAAoB,OAAO,CAAC,CAAC,UAAU,SAAS;EAC3D,aAAU;CACX,CAAA;AAEL,CACF;AAIA,MAAa,iBAAiB,WAC5B,SAAS,eAAe,EAAE,WAAW,GAAG,SAAS,KAAK;CACpD,OACE,oBAACA,OAAW,UAAZ;EACE,GAAI;EACC;EACL,WAAW,oBAAoB,OAAO,CAAC,CAAC,UAAU,SAAS;EAC3D,aAAU;CACX,CAAA;AAEL,CACF;AAMA,MAAa,cAAc,WAA6C,SAAS,YAC/E,EAAE,WAAW,OAAO,MAAM,GAAG,SAC7B,KACA;CACA,OACE,oBAACA,OAAW,OAAZ;EACE,GAAI;EACC;EACL,WAAW,oBAAoB,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,OAAO,SAAS;EAChE,uBAAoB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AC,CAAC,SAAS,OAAO,CAAC,CAAC,OAAO,SAAS;EAC5F,aAAU;YAET,YAAY;CACG,CAAA;AAEtB,CAAC;AAED,MAAaC,WAAS;CACpB,MAAMF;CACN,SAAS;CACT,QAAQ;CACR,UAAU;CACV,UAAU;CACV,OAAO;CACP,QAAQ;CACR,OAAO;CACP,aAAa;CACb,MAAM;CACN,QAAQ;CACR,OAAO;CACP,cAAcC,OAAW;AAC3B"}
1
+ {"version":3,"file":"dialog.js","names":["DialogRoot","BaseDialog","Dialog"],"sources":["../../../src/components/dialog/dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport { Dialog as BaseDialog } from \"@base-ui/react/dialog\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport type { DialogRoot as BaseDialogRoot } from \"@base-ui/react/dialog\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { dialog } from \"../../styled-system/recipes\";\nimport { withRecipeClassName } from \"../base-ui\";\nimport { useThemePortalProps } from \"../../theme/theme-scope\";\n\nexport type DialogSize = \"sm\" | \"md\" | \"lg\";\n\n/**\n * Groups the dialog parts. It supports Base UI's controlled open/onOpenChange\n * API and uncontrolled defaultOpen API.\n */\nexport type DialogRootProps<Payload = unknown> = BaseDialogRoot.Props<Payload>;\n\nexport function DialogRoot<Payload = unknown>(props: DialogRootProps<Payload>) {\n return <BaseDialog.Root {...props} />;\n}\n\nexport type DialogTriggerProps = ComponentPropsWithoutRef<typeof BaseDialog.Trigger>;\n\nexport const DialogTrigger = forwardRef<HTMLButtonElement, DialogTriggerProps>(\n function DialogTrigger({ className, ...props }, ref) {\n return (\n <BaseDialog.Trigger\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().trigger, className)}\n data-slot=\"dialog-trigger\"\n />\n );\n },\n);\n\nexport type DialogPortalProps = ComponentPropsWithoutRef<typeof BaseDialog.Portal>;\n\n/**\n * Preserves Base UI's portal behavior and optional container/ref APIs.\n */\nexport function DialogPortal(props: DialogPortalProps) {\n return <BaseDialog.Portal {...useThemePortalProps(props)} />;\n}\n\nexport type DialogBackdropProps = ComponentPropsWithoutRef<typeof BaseDialog.Backdrop>;\n\nexport const DialogBackdrop = forwardRef<HTMLDivElement, DialogBackdropProps>(\n function DialogBackdrop({ className, ...props }, ref) {\n return (\n <BaseDialog.Backdrop\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().backdrop, className)}\n data-slot=\"dialog-backdrop\"\n />\n );\n },\n);\n\nexport type DialogViewportProps = ComponentPropsWithoutRef<typeof BaseDialog.Viewport>;\n\nexport const DialogViewport = forwardRef<HTMLDivElement, DialogViewportProps>(\n function DialogViewport({ className, ...props }, ref) {\n return (\n <BaseDialog.Viewport\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().viewport, className)}\n data-slot=\"dialog-viewport\"\n />\n );\n },\n);\n\nexport interface DialogPopupProps extends ComponentPropsWithoutRef<typeof BaseDialog.Popup> {\n size?: DialogSize;\n}\n\nexport const DialogPopup = forwardRef<HTMLDivElement, DialogPopupProps>(function DialogPopup(\n { className, size = \"md\", ...props },\n ref,\n) {\n return (\n <BaseDialog.Popup\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog({ size }).popup, className)}\n data-jaci-component=\"dialog\"\n data-slot=\"dialog-popup\"\n />\n );\n});\n\nexport type DialogHeaderProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const DialogHeader = forwardRef<HTMLDivElement, DialogHeaderProps>(function DialogHeader(\n { className, ...props },\n ref,\n) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(dialog().header, className)}\n data-slot=\"dialog-header\"\n />\n );\n});\n\nexport type DialogTitleProps = ComponentPropsWithoutRef<typeof BaseDialog.Title>;\n\nexport const DialogTitle = forwardRef<HTMLHeadingElement, DialogTitleProps>(function DialogTitle(\n { className, ...props },\n ref,\n) {\n return (\n <BaseDialog.Title\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().title, className)}\n data-slot=\"dialog-title\"\n />\n );\n});\n\nexport type DialogDescriptionProps = ComponentPropsWithoutRef<typeof BaseDialog.Description>;\n\nexport const DialogDescription = forwardRef<HTMLParagraphElement, DialogDescriptionProps>(\n function DialogDescription({ className, ...props }, ref) {\n return (\n <BaseDialog.Description\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().description, className)}\n data-slot=\"dialog-description\"\n />\n );\n },\n);\n\nexport type DialogBodyProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const DialogBody = forwardRef<HTMLDivElement, DialogBodyProps>(function DialogBody(\n { className, ...props },\n ref,\n) {\n return (\n <div {...props} ref={ref} className={cx(dialog().body, className)} data-slot=\"dialog-body\" />\n );\n});\n\nexport type DialogFooterProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const DialogFooter = forwardRef<HTMLDivElement, DialogFooterProps>(function DialogFooter(\n { className, ...props },\n ref,\n) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(dialog().footer, className)}\n data-slot=\"dialog-footer\"\n />\n );\n});\n\nexport type DialogCloseProps = ComponentPropsWithoutRef<typeof BaseDialog.Close>;\n\nexport const DialogClose = forwardRef<HTMLButtonElement, DialogCloseProps>(function DialogClose(\n { \"aria-label\": ariaLabel, children, className, ...props },\n ref,\n) {\n const hasVisibleLabel = children != null;\n\n return (\n <BaseDialog.Close\n {...props}\n aria-label={ariaLabel ?? (hasVisibleLabel ? undefined : \"Close dialog\")}\n ref={ref}\n className={withRecipeClassName(hasVisibleLabel ? dialog().action : dialog().close, className)}\n data-slot=\"dialog-close\"\n >\n {children ?? \"×\"}\n </BaseDialog.Close>\n );\n});\n\nexport const Dialog = {\n Root: DialogRoot,\n Trigger: DialogTrigger,\n Portal: DialogPortal,\n Backdrop: DialogBackdrop,\n Viewport: DialogViewport,\n Popup: DialogPopup,\n Header: DialogHeader,\n Title: DialogTitle,\n Description: DialogDescription,\n Body: DialogBody,\n Footer: DialogFooter,\n Close: DialogClose,\n createHandle: BaseDialog.createHandle,\n};\n"],"mappings":";;;;;;;;;AAoBA,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,MAAM;CACN,QAAQ;CACR,OAAO;CACP,cAAcC,OAAW;AAC3B"}
@@ -1 +1 @@
1
- {"version":3,"file":"download-trigger.cjs","names":["cx","downloadTrigger"],"sources":["../../../src/components/download-trigger/download-trigger.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { downloadTrigger } from \"../../styled-system/recipes\";\n\nexport interface DownloadTriggerProps extends ComponentPropsWithoutRef<\"a\"> {\n href: string;\n variant?: \"solid\" | \"outline\" | \"ghost\";\n size?: \"sm\" | \"md\" | \"lg\";\n disabled?: boolean;\n}\n\nexport const DownloadTrigger = forwardRef<HTMLAnchorElement, DownloadTriggerProps>(\n function DownloadTrigger(\n { className, disabled = false, href, size = \"md\", variant = \"outline\", ...props },\n ref,\n ) {\n return (\n <a\n {...props}\n aria-disabled={disabled || undefined}\n className={cx(downloadTrigger({ size, variant }), className)}\n data-disabled={disabled || undefined}\n data-jaci-component=\"download-trigger\"\n data-slot=\"download-trigger\"\n href={disabled ? undefined : href}\n ref={ref}\n tabIndex={disabled ? -1 : props.tabIndex}\n />\n );\n },\n);\n"],"mappings":";;;;;AAaA,MAAa,mBAAA,GAAA,MAAA,WAAA,CACX,SAAS,gBACP,EAAE,WAAW,WAAW,OAAO,MAAM,OAAO,MAAM,UAAU,WAAW,GAAG,SAC1E,KACA;CACA,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,KAAD;EACE,GAAI;EACJ,iBAAe,YAAY,KAAA;EAC3B,WAAWA,WAAAA,GAAGC,yBAAAA,gBAAgB;GAAE;GAAM;EAAQ,CAAC,GAAG,SAAS;EAC3D,iBAAe,YAAY,KAAA;EAC3B,uBAAoB;EACpB,aAAU;EACV,MAAM,WAAW,KAAA,IAAY;EACxB;EACL,UAAU,WAAW,KAAK,MAAM;CACjC,CAAA;AAEL,CACF"}
1
+ {"version":3,"file":"download-trigger.cjs","names":["forwardRef","cx","downloadTrigger"],"sources":["../../../src/components/download-trigger/download-trigger.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { downloadTrigger } from \"../../styled-system/recipes\";\n\nexport interface DownloadTriggerProps extends ComponentPropsWithoutRef<\"a\"> {\n href: string;\n variant?: \"solid\" | \"outline\" | \"ghost\";\n size?: \"sm\" | \"md\" | \"lg\";\n disabled?: boolean;\n}\n\nexport const DownloadTrigger = forwardRef<HTMLAnchorElement, DownloadTriggerProps>(\n function DownloadTrigger(\n { className, disabled = false, href, size = \"md\", variant = \"outline\", ...props },\n ref,\n ) {\n return (\n <a\n {...props}\n aria-disabled={disabled || undefined}\n className={cx(downloadTrigger({ size, variant }), className)}\n data-disabled={disabled || undefined}\n data-jaci-component=\"download-trigger\"\n data-slot=\"download-trigger\"\n href={disabled ? undefined : href}\n ref={ref}\n tabIndex={disabled ? -1 : props.tabIndex}\n />\n );\n },\n);\n"],"mappings":";;;;;AAaA,MAAa,mBAAA,GAAkBA,MAAAA,WAAAA,CAC7B,SAAS,gBACP,EAAE,WAAW,WAAW,OAAO,MAAM,OAAO,MAAM,UAAU,WAAW,GAAG,SAC1E,KACA;CACA,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,KAAD;EACE,GAAI;EACJ,iBAAe,YAAY,KAAA;EAC3B,WAAWC,WAAAA,GAAGC,yBAAAA,gBAAgB;GAAE;GAAM;EAAQ,CAAC,GAAG,SAAS;EAC3D,iBAAe,YAAY,KAAA;EAC3B,uBAAoB;EACpB,aAAU;EACV,MAAM,WAAW,KAAA,IAAY;EACxB;EACL,UAAU,WAAW,KAAK,MAAM;CACjC,CAAA;AAEL,CACF"}