@uselets/ui 2.0.1 → 2.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 (204) hide show
  1. package/dist/{as-child-Dxg3Xo1G.d.ts → as-child-T9W73ZYU.d.ts} +1 -3
  2. package/dist/{chart-B_6nC_ih.d.ts → chart-8rgtsk95.d.ts} +1 -3
  3. package/dist/cli/uselets.mjs.map +1 -1
  4. package/dist/components/accordion.d.ts +1 -3
  5. package/dist/components/accordion.js.map +1 -1
  6. package/dist/components/alert-dialog.d.ts +1 -3
  7. package/dist/components/alert-dialog.js.map +1 -1
  8. package/dist/components/alert.d.ts +0 -2
  9. package/dist/components/alert.js.map +1 -1
  10. package/dist/components/anchor.d.ts +1 -3
  11. package/dist/components/anchor.js.map +1 -1
  12. package/dist/components/area-chart.d.ts +1 -3
  13. package/dist/components/area-chart.js.map +1 -1
  14. package/dist/components/avatar.d.ts +1 -3
  15. package/dist/components/avatar.js.map +1 -1
  16. package/dist/components/badge.d.ts +1 -3
  17. package/dist/components/badge.js.map +1 -1
  18. package/dist/components/bar-chart.d.ts +1 -3
  19. package/dist/components/bar-chart.js.map +1 -1
  20. package/dist/components/bottom-nav.d.ts +1 -3
  21. package/dist/components/bottom-nav.js.map +1 -1
  22. package/dist/components/breadcrumb.d.ts +1 -3
  23. package/dist/components/breadcrumb.js.map +1 -1
  24. package/dist/components/button-group.d.ts +1 -3
  25. package/dist/components/button-group.js.map +1 -1
  26. package/dist/components/button.d.ts +1 -3
  27. package/dist/components/button.js.map +1 -1
  28. package/dist/components/calendar.d.ts +0 -2
  29. package/dist/components/calendar.js +1 -1
  30. package/dist/components/calendar.js.map +1 -1
  31. package/dist/components/card.d.ts +0 -2
  32. package/dist/components/card.js.map +1 -1
  33. package/dist/components/carousel.d.ts +0 -2
  34. package/dist/components/carousel.js.map +1 -1
  35. package/dist/components/center.d.ts +0 -2
  36. package/dist/components/center.js.map +1 -1
  37. package/dist/components/chart.d.ts +1 -1
  38. package/dist/components/chart.js.map +1 -1
  39. package/dist/components/checkbox.d.ts +0 -2
  40. package/dist/components/checkbox.js.map +1 -1
  41. package/dist/components/code.d.ts +0 -2
  42. package/dist/components/code.js.map +1 -1
  43. package/dist/components/collapsible.d.ts +1 -3
  44. package/dist/components/collapsible.js.map +1 -1
  45. package/dist/components/combobox.d.ts +1 -3
  46. package/dist/components/combobox.js.map +1 -1
  47. package/dist/components/command.d.ts +0 -2
  48. package/dist/components/command.js.map +1 -1
  49. package/dist/components/container.d.ts +0 -2
  50. package/dist/components/container.js.map +1 -1
  51. package/dist/components/data-table.d.ts +0 -2
  52. package/dist/components/data-table.js.map +1 -1
  53. package/dist/components/date-range-picker.d.ts +0 -2
  54. package/dist/components/date-range-picker.js.map +1 -1
  55. package/dist/components/dialog.d.ts +1 -3
  56. package/dist/components/dialog.js.map +1 -1
  57. package/dist/components/direction.d.ts +0 -2
  58. package/dist/components/donut-chart.d.ts +0 -2
  59. package/dist/components/donut-chart.js.map +1 -1
  60. package/dist/components/drawer.d.ts +1 -3
  61. package/dist/components/drawer.js.map +1 -1
  62. package/dist/components/dropdown-menu.d.ts +1 -3
  63. package/dist/components/dropdown-menu.js.map +1 -1
  64. package/dist/components/dropzone.d.ts +0 -2
  65. package/dist/components/dropzone.js.map +1 -1
  66. package/dist/components/empty.d.ts +0 -2
  67. package/dist/components/empty.js.map +1 -1
  68. package/dist/components/field.d.ts +0 -2
  69. package/dist/components/field.js.map +1 -1
  70. package/dist/components/flex.d.ts +0 -2
  71. package/dist/components/flex.js.map +1 -1
  72. package/dist/components/grid.d.ts +0 -2
  73. package/dist/components/grid.js.map +1 -1
  74. package/dist/components/group.d.ts +0 -2
  75. package/dist/components/group.js.map +1 -1
  76. package/dist/components/heading.d.ts +1 -3
  77. package/dist/components/heading.js.map +1 -1
  78. package/dist/components/hover-card.d.ts +1 -3
  79. package/dist/components/hover-card.js.map +1 -1
  80. package/dist/components/input-group.d.ts +0 -2
  81. package/dist/components/input-group.js.map +1 -1
  82. package/dist/components/input-otp.d.ts +0 -2
  83. package/dist/components/input-otp.js.map +1 -1
  84. package/dist/components/input.d.ts +0 -2
  85. package/dist/components/input.js.map +1 -1
  86. package/dist/components/kbd.d.ts +0 -2
  87. package/dist/components/kbd.js.map +1 -1
  88. package/dist/components/label.d.ts +1 -3
  89. package/dist/components/label.js.map +1 -1
  90. package/dist/components/list.d.ts +1 -3
  91. package/dist/components/list.js.map +1 -1
  92. package/dist/components/logo.d.ts +0 -2
  93. package/dist/components/marker.d.ts +1 -3
  94. package/dist/components/marker.js.map +1 -1
  95. package/dist/components/mask-input.d.ts +0 -2
  96. package/dist/components/mask-input.js.map +1 -1
  97. package/dist/components/native-select.d.ts +0 -2
  98. package/dist/components/native-select.js.map +1 -1
  99. package/dist/components/navigation-menu.d.ts +1 -3
  100. package/dist/components/navigation-menu.js.map +1 -1
  101. package/dist/components/number-field.d.ts +1 -3
  102. package/dist/components/number-field.js.map +1 -1
  103. package/dist/components/pagination.d.ts +0 -2
  104. package/dist/components/pagination.js.map +1 -1
  105. package/dist/components/phone-input.d.ts +0 -2
  106. package/dist/components/phone-input.js.map +1 -1
  107. package/dist/components/pie-chart.d.ts +1 -3
  108. package/dist/components/pie-chart.js.map +1 -1
  109. package/dist/components/popover.d.ts +1 -3
  110. package/dist/components/popover.js.map +1 -1
  111. package/dist/components/progress.d.ts +0 -2
  112. package/dist/components/progress.js.map +1 -1
  113. package/dist/components/radio-group.d.ts +0 -2
  114. package/dist/components/radio-group.js.map +1 -1
  115. package/dist/components/resizable.d.ts +0 -2
  116. package/dist/components/resizable.js.map +1 -1
  117. package/dist/components/ring-progress.d.ts +0 -2
  118. package/dist/components/ring-progress.js.map +1 -1
  119. package/dist/components/scroll-area.d.ts +0 -2
  120. package/dist/components/scroll-area.js.map +1 -1
  121. package/dist/components/select.d.ts +1 -3
  122. package/dist/components/select.js.map +1 -1
  123. package/dist/components/separator.d.ts +1 -3
  124. package/dist/components/separator.js.map +1 -1
  125. package/dist/components/sidebar.d.ts +1 -3
  126. package/dist/components/sidebar.js.map +1 -1
  127. package/dist/components/simple-grid.d.ts +0 -2
  128. package/dist/components/simple-grid.js.map +1 -1
  129. package/dist/components/skeleton.d.ts +0 -2
  130. package/dist/components/skeleton.js.map +1 -1
  131. package/dist/components/slider.d.ts +0 -2
  132. package/dist/components/slider.js.map +1 -1
  133. package/dist/components/sonner.d.ts +0 -2
  134. package/dist/components/sonner.js.map +1 -1
  135. package/dist/components/spinner.d.ts +0 -2
  136. package/dist/components/spinner.js.map +1 -1
  137. package/dist/components/stack.d.ts +0 -2
  138. package/dist/components/stack.js.map +1 -1
  139. package/dist/components/stepper.d.ts +1 -3
  140. package/dist/components/stepper.js.map +1 -1
  141. package/dist/components/switch.d.ts +0 -2
  142. package/dist/components/switch.js.map +1 -1
  143. package/dist/components/table.d.ts +0 -2
  144. package/dist/components/table.js.map +1 -1
  145. package/dist/components/tabs.d.ts +1 -3
  146. package/dist/components/tabs.js.map +1 -1
  147. package/dist/components/text.d.ts +1 -3
  148. package/dist/components/text.js.map +1 -1
  149. package/dist/components/textarea.d.ts +0 -2
  150. package/dist/components/textarea.js.map +1 -1
  151. package/dist/components/theme.d.ts +0 -2
  152. package/dist/components/theme.js.map +1 -1
  153. package/dist/components/timeline.d.ts +0 -2
  154. package/dist/components/timeline.js.map +1 -1
  155. package/dist/components/toggle-group.d.ts +1 -3
  156. package/dist/components/toggle-group.js.map +1 -1
  157. package/dist/components/toggle.d.ts +1 -3
  158. package/dist/components/toggle.js.map +1 -1
  159. package/dist/components/tooltip.d.ts +1 -3
  160. package/dist/components/tooltip.js.map +1 -1
  161. package/dist/components/unstyled-button.d.ts +1 -3
  162. package/dist/components/unstyled-button.js.map +1 -1
  163. package/dist/components/visibility.d.ts +0 -2
  164. package/dist/components/visibility.js.map +1 -1
  165. package/dist/hooks/use-breakpoint-value.d.ts +0 -2
  166. package/dist/hooks/use-breakpoint-value.js.map +1 -1
  167. package/dist/hooks/use-breakpoint.d.ts +0 -2
  168. package/dist/hooks/use-breakpoint.js.map +1 -1
  169. package/dist/hooks/use-disclosure.d.ts +0 -2
  170. package/dist/hooks/use-disclosure.js.map +1 -1
  171. package/dist/hooks/use-document-visibility.d.ts +0 -2
  172. package/dist/hooks/use-document-visibility.js.map +1 -1
  173. package/dist/hooks/use-hotkeys.d.ts +1 -1
  174. package/dist/hooks/use-idle.d.ts +0 -2
  175. package/dist/hooks/use-idle.js.map +1 -1
  176. package/dist/hooks/use-interval.d.ts +0 -2
  177. package/dist/hooks/use-interval.js.map +1 -1
  178. package/dist/hooks/use-local-storage.d.ts +0 -2
  179. package/dist/hooks/use-local-storage.js.map +1 -1
  180. package/dist/hooks/use-mask.d.ts +0 -2
  181. package/dist/hooks/use-mask.js.map +1 -1
  182. package/dist/hooks/use-mobile.d.ts +0 -2
  183. package/dist/hooks/use-mobile.js.map +1 -1
  184. package/dist/index.d.ts +3 -3
  185. package/dist/lib/as-child.d.ts +1 -1
  186. package/dist/lib/as-child.js.map +1 -1
  187. package/dist/lib/badge.d.ts +0 -2
  188. package/dist/lib/badge.js.map +1 -1
  189. package/dist/lib/button.d.ts +0 -2
  190. package/dist/lib/button.js.map +1 -1
  191. package/dist/lib/color.d.ts +0 -2
  192. package/dist/lib/color.js.map +1 -1
  193. package/dist/lib/compose-refs.d.ts +0 -2
  194. package/dist/lib/compose-refs.js.map +1 -1
  195. package/dist/lib/progress.d.ts +0 -2
  196. package/dist/lib/progress.js.map +1 -1
  197. package/dist/lib/utils.d.ts +0 -2
  198. package/dist/lib/utils.js.map +1 -1
  199. package/dist/logo--R3_XDgA.js.map +1 -1
  200. package/dist/postcss.config.js.map +1 -1
  201. package/dist/resolve-class-name-BurP8ngI.js.map +1 -1
  202. package/dist/{use-hotkeys-D1_TEIwN.d.ts → use-hotkeys-BVm0IGb8.d.ts} +1 -5
  203. package/dist/use-hotkeys-YDJmGWX6.js.map +1 -1
  204. package/package.json +9 -9
@@ -1 +1 @@
1
- {"version":3,"file":"date-range-picker.js","names":["React","DateRangePickerContext","defaultPresetDefinitions","today","yesterday","previousWeekStart","previousMonth","valueProp","openProp","props","uncontrolledValue","setUncontrolledValue","defaultValue","uncontrolledOpen","setUncontrolledOpen","defaultOpen","isValueControlled","isOpenControlled","value","open","draft","setDraft","month","setMonth","updateDraft","normalizedDraft","nextDraft","nextMonth","commitValue","nextValue","onValueChange","setOpen","nextOpen","onOpenChange","apply","onApply","reset","onReset","context","locale","placeholder","Popover","children","Fragment","asChild","PopoverTrigger","Button","type","cn","className","IconCalendar","IconChevronDown","contextPlaceholder","childArray","presets","content","child","PopoverContent","resolveClassName","state","todayRelativeValue","yesterdayRelativeValue","range","preset","selected","days","id","inputValue","setInputValue","Input","label","event","Calendar","onMonthChange","date","IconArrowRight","onClick","match","year","day","targetDate","target","left","right","nextDate","amount"],"sources":["../../src/components/date-range-picker.tsx"],"sourcesContent":["import * as React from 'react'\nimport type { Locale } from 'react-day-picker'\n\nimport { IconArrowRight, IconCalendar, IconChevronDown } from '@tabler/icons-react'\n\nimport { cn } from '../lib/utils'\nimport { resolveClassName } from '../utils/resolve-class-name'\nimport { Button } from './button'\nimport { Calendar, type DateRange } from './calendar'\nimport { Input } from './input'\nimport { Popover, PopoverContent, PopoverTrigger } from './popover'\n\ntype DateRangePickerContextValue = {\n value: DateRange | null\n draft: DateRange | undefined\n month: Date\n locale?: Partial<Locale>\n placeholder: string\n setDraft: (range: DateRange | undefined) => void\n setMonth: (month: Date) => void\n apply: () => void\n reset: () => void\n}\n\nconst DateRangePickerContext = React.createContext<DateRangePickerContextValue | null>(null)\n\nconst defaultPlaceholder = 'Selecione um período'\n\nconst defaultPresetDefinitions = [\n {\n label: 'Hoje',\n getRange: () => {\n const today = startOfDay(new Date())\n return { from: today, to: today }\n }\n },\n {\n label: 'Ontem',\n getRange: () => {\n const yesterday = addDays(startOfDay(new Date()), -1)\n return { from: yesterday, to: yesterday }\n }\n },\n {\n label: 'Últimos 7 dias',\n getRange: () => {\n const today = startOfDay(new Date())\n return { from: addDays(today, -7), to: today }\n }\n },\n {\n label: 'Últimos 15 dias',\n getRange: () => {\n const today = startOfDay(new Date())\n return { from: addDays(today, -15), to: today }\n }\n },\n {\n label: 'Últimos 30 dias',\n getRange: () => {\n const today = startOfDay(new Date())\n return { from: addDays(today, -30), to: today }\n }\n },\n {\n label: 'Últimos 60 dias',\n getRange: () => {\n const today = startOfDay(new Date())\n return { from: addDays(today, -60), to: today }\n }\n },\n {\n label: 'Últimos 90 dias',\n getRange: () => {\n const today = startOfDay(new Date())\n return { from: addDays(today, -90), to: today }\n }\n },\n {\n label: 'Semana passada',\n getRange: () => {\n const previousWeekStart = addDays(startOfWeek(new Date()), -7)\n return { from: previousWeekStart, to: addDays(previousWeekStart, 6) }\n }\n },\n {\n label: 'Este mês',\n getRange: () => {\n const today = startOfDay(new Date())\n return { from: startOfMonth(today), to: today }\n }\n },\n {\n label: 'Mês passado',\n getRange: () => {\n const previousMonth = new Date(new Date().getFullYear(), new Date().getMonth() - 1, 1)\n return { from: startOfMonth(previousMonth), to: endOfMonth(previousMonth) }\n }\n }\n] satisfies DateRangePickerPresetOption[]\n\nexport type DateRangePickerPresetOption = {\n label: string\n getRange: () => DateRange\n}\n\nexport type DateRangePickerProps = Omit<\n React.ComponentProps<typeof Popover>,\n 'open' | 'defaultOpen' | 'onOpenChange'\n> & {\n /** Selected range (controlled). `null` when empty. */\n value?: DateRange | null\n /**\n * Initial range (uncontrolled).\n * @default null\n */\n defaultValue?: DateRange | null\n /** Called when a range is applied, or with `null` when it is reset. */\n onValueChange?: (range: DateRange | null) => void\n /** Called after `DateRangePickerApply` commits the draft. */\n onApply?: (range: DateRange | null) => void\n /** Called after `DateRangePickerReset` clears the value. */\n onReset?: () => void\n /** Whether the popover is open (controlled). */\n open?: boolean\n /**\n * Whether the popover starts open (uncontrolled).\n * @default false\n */\n defaultOpen?: boolean\n /** Called when the popover opens or closes. */\n onOpenChange?: (open: boolean) => void\n /** `react-day-picker` locale used by the calendar and the formatted dates. */\n locale?: Partial<Locale>\n /** Trigger text when no range is selected. */\n placeholder?: string\n}\n\nexport type DateRangePickerTriggerProps = React.ComponentProps<typeof Button> & {\n asChild?: boolean\n}\n\nexport type DateRangePickerValueProps = React.ComponentProps<'span'> & {\n /** Text shown when no range is selected. Defaults to the picker `placeholder`. */\n placeholder?: string\n}\n\nexport type DateRangePickerContentProps = React.ComponentProps<typeof PopoverContent>\n\nexport type DateRangePickerPresetsProps = React.ComponentProps<'div'> & {\n /** Presets to show, as `{ label, getRange }`. Defaults to the pt-BR presets. */\n presets?: DateRangePickerPresetOption[]\n}\n\nexport type DateRangePickerPresetProps = React.ComponentProps<'button'> & {\n /**\n * Highlights the preset as the current selection.\n * @default false\n */\n selected?: boolean\n}\n\nexport type DateRangePickerCalendarProps = Omit<\n React.ComponentProps<typeof Calendar>,\n 'mode' | 'numberOfMonths' | 'selected' | 'onSelect' | 'month' | 'defaultMonth'\n>\n\nexport type DateRangePickerDateFieldsProps = React.ComponentProps<'div'>\n\nexport type DateRangePickerActionsProps = React.ComponentProps<'div'>\n\nexport type DateRangePickerApplyProps = React.ComponentProps<typeof Button>\n\nexport type DateRangePickerResetProps = React.ComponentProps<typeof Button>\n\nfunction DateRangePicker({\n value: valueProp,\n defaultValue = null,\n onValueChange,\n onApply,\n onReset,\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n locale,\n placeholder = defaultPlaceholder,\n children,\n ...props\n}: DateRangePickerProps) {\n const [uncontrolledValue, setUncontrolledValue] = React.useState<DateRange | null>(defaultValue)\n const [uncontrolledOpen, setUncontrolledOpen] = React.useState(defaultOpen)\n\n const isValueControlled = valueProp !== undefined\n const isOpenControlled = openProp !== undefined\n const value = isValueControlled ? (valueProp ?? null) : uncontrolledValue\n const open = isOpenControlled ? openProp : uncontrolledOpen\n\n const [draft, setDraft] = React.useState<DateRange | undefined>(() => toDraft(value))\n const [month, setMonth] = React.useState<Date>(() => getRangeMonth(toDraft(value)))\n\n const updateDraft = React.useCallback((nextDraft: DateRange | undefined) => {\n const normalizedDraft = normalizeDraft(nextDraft)\n setDraft(normalizedDraft)\n\n const nextMonth = getRangeMonth(normalizedDraft)\n if (nextMonth) {\n setMonth(nextMonth)\n }\n }, [])\n\n const commitValue = React.useCallback(\n (nextValue: DateRange | null) => {\n if (!isValueControlled) {\n setUncontrolledValue(nextValue)\n }\n\n onValueChange?.(nextValue)\n },\n [isValueControlled, onValueChange]\n )\n\n const setOpen = React.useCallback(\n (nextOpen: boolean) => {\n if (nextOpen) {\n const nextDraft = toDraft(value)\n setDraft(nextDraft)\n setMonth(getRangeMonth(nextDraft))\n }\n\n if (!isOpenControlled) {\n setUncontrolledOpen(nextOpen)\n }\n\n onOpenChange?.(nextOpen)\n },\n [isOpenControlled, onOpenChange, value]\n )\n\n const apply = React.useCallback(() => {\n const nextValue = toValue(draft)\n commitValue(nextValue)\n onApply?.(nextValue)\n setOpen(false)\n }, [commitValue, draft, onApply, setOpen])\n\n const reset = React.useCallback(() => {\n setDraft(undefined)\n commitValue(null)\n onReset?.()\n setOpen(false)\n }, [commitValue, onReset, setOpen])\n\n const context = React.useMemo<DateRangePickerContextValue>(\n () => ({\n value,\n draft,\n month,\n locale,\n placeholder,\n setDraft: updateDraft,\n setMonth,\n apply,\n reset\n }),\n [apply, draft, locale, month, placeholder, reset, updateDraft, value]\n )\n\n return (\n <DateRangePickerContext.Provider value={context}>\n <Popover open={open} onOpenChange={setOpen} {...props}>\n {children ?? (\n <>\n <DateRangePickerTrigger />\n <DateRangePickerContent>\n <DateRangePickerPresets />\n <DateRangePickerDateFields />\n <DateRangePickerCalendar />\n <DateRangePickerActions />\n </DateRangePickerContent>\n </>\n )}\n </Popover>\n </DateRangePickerContext.Provider>\n )\n}\n\nfunction DateRangePickerTrigger({\n className,\n children,\n asChild = false,\n variant = 'secondary',\n type,\n ...props\n}: DateRangePickerTriggerProps) {\n if (asChild) {\n return (\n <PopoverTrigger asChild className={className} type={type} {...props}>\n {children}\n </PopoverTrigger>\n )\n }\n\n return (\n <PopoverTrigger asChild>\n <Button\n type={type ?? 'button'}\n variant={variant}\n className={cn('min-w-64 justify-between font-normal', className)}\n {...props}\n >\n {children ?? (\n <>\n <IconCalendar data-icon=\"inline-start\" className=\"size-4 text-muted-foreground\" />\n <DateRangePickerValue className=\"flex-1 text-left\" />\n <IconChevronDown data-icon=\"inline-end\" className=\"size-4 text-muted-foreground\" />\n </>\n )}\n </Button>\n </PopoverTrigger>\n )\n}\n\nfunction DateRangePickerValue({ className, placeholder, ...props }: DateRangePickerValueProps) {\n const { value, locale, placeholder: contextPlaceholder } = useDateRangePicker()\n\n return (\n <span data-slot=\"date-range-picker-value\" className={cn('truncate', className)} {...props}>\n {formatRange(value, locale, placeholder ?? contextPlaceholder)}\n </span>\n )\n}\n\nfunction DateRangePickerContent({\n className,\n align = 'start',\n sideOffset = 8,\n children,\n ...props\n}: DateRangePickerContentProps) {\n const childArray = React.Children.toArray(children)\n const presets = childArray.filter(isDateRangePickerPresetsElement)\n const content = childArray.filter((child) => !isDateRangePickerPresetsElement(child))\n\n return (\n <PopoverContent\n align={align}\n sideOffset={sideOffset}\n className={(state) => cn('w-[calc(100vw-(--spacing(4)))] max-w-2xl p-2', resolveClassName(className, state))}\n {...props}\n >\n <div data-slot=\"date-range-picker-content\" className=\"grid gap-3 md:grid-cols-[10rem_minmax(0,1fr)]\">\n {presets}\n <div className=\"flex min-w-0 flex-col gap-3\">{content}</div>\n </div>\n </PopoverContent>\n )\n}\n\nfunction DateRangePickerPresets({\n className,\n presets = defaultPresetDefinitions,\n ...props\n}: DateRangePickerPresetsProps) {\n const { draft, setDraft } = useDateRangePicker()\n const todayRelativeValue = getRelativeDaysValue(draft, 'today')\n const yesterdayRelativeValue = getRelativeDaysValue(draft, 'yesterday')\n\n return (\n <div\n data-slot=\"date-range-picker-presets\"\n className={cn('hidden flex-col border-border pr-3 md:flex md:border-r', className)}\n {...props}\n >\n {presets.map((preset) => {\n const range = preset.getRange()\n const selected = isSameRange(draft, range)\n\n return (\n <DateRangePickerPreset key={preset.label} type=\"button\" selected={selected} onClick={() => setDraft(range)}>\n {preset.label}\n </DateRangePickerPreset>\n )\n })}\n\n <div className=\"my-3 flex flex-col gap-2\">\n <DateRangePickerRelativeField\n label=\"Dias até hoje\"\n value={todayRelativeValue}\n onValueChange={(days) => setDraft(getRelativeDaysRange(days, 'today'))}\n />\n <DateRangePickerRelativeField\n label=\"Dias até ontem\"\n value={yesterdayRelativeValue}\n onValueChange={(days) => setDraft(getRelativeDaysRange(days, 'yesterday'))}\n />\n </div>\n </div>\n )\n}\n\nfunction DateRangePickerPreset({ className, selected = false, ...props }: DateRangePickerPresetProps) {\n return (\n <button\n data-slot=\"date-range-picker-preset\"\n data-selected={selected}\n className={cn(\n 'flex h-8.5 w-full items-center border-l-3 border-border bg-transparent px-2 text-left text-sm text-foreground transition-colors outline-none',\n 'hover:border-primary hover:bg-primary-50 hover:text-primary-700 dark:hover:bg-primary-950 dark:hover:text-primary-300',\n 'focus-visible:border-primary focus-visible:ring-3 focus-visible:ring-ring/50',\n 'data-[selected=true]:border-primary data-[selected=true]:bg-primary-50 data-[selected=true]:text-primary-700 dark:data-[selected=true]:bg-primary-950 dark:data-[selected=true]:text-primary-300',\n className\n )}\n aria-pressed={selected}\n {...props}\n />\n )\n}\n\nfunction DateRangePickerRelativeField({\n label,\n value,\n onValueChange\n}: {\n label: string\n value: number | undefined\n onValueChange: (days: number) => void\n}) {\n const id = React.useId()\n const [inputValue, setInputValue] = React.useState(() => formatRelativeInputValue(value))\n\n React.useEffect(() => {\n setInputValue(formatRelativeInputValue(value))\n }, [value])\n\n return (\n <div className=\"flex items-center gap-2 text-sm text-foreground\">\n <Input\n id={id}\n type=\"number\"\n name={label}\n min={1}\n step={1}\n value={inputValue}\n className=\"h-7 w-9 rounded-md px-1 text-center [appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none\"\n aria-label={label}\n onChange={(event) => {\n const nextValue = event.target.value\n setInputValue(nextValue)\n\n if (nextValue === '') return\n\n const days = parsePositiveInteger(nextValue)\n if (!days) return\n onValueChange(days)\n }}\n />\n <label htmlFor={id}>{label}</label>\n </div>\n )\n}\n\nfunction DateRangePickerCalendar({\n className,\n showOutsideDays = false,\n onMonthChange,\n ...props\n}: DateRangePickerCalendarProps) {\n const { draft, locale, month, setDraft, setMonth } = useDateRangePicker()\n\n return (\n <Calendar\n mode=\"range\"\n numberOfMonths={2}\n showOutsideDays={showOutsideDays}\n month={month}\n onMonthChange={(nextMonth) => {\n setMonth(nextMonth)\n onMonthChange?.(nextMonth)\n }}\n selected={draft}\n onSelect={setDraft}\n locale={locale}\n className={cn('mx-auto bg-transparent p-0', className)}\n {...props}\n />\n )\n}\n\nfunction DateRangePickerDateFields({ className, ...props }: DateRangePickerDateFieldsProps) {\n const { draft, setDraft } = useDateRangePicker()\n\n return (\n <div\n data-slot=\"date-range-picker-date-fields\"\n className={cn(\n 'pb-2 border-b flex justify-between gap-2 flex-wrap flex-col sm:flex-row sm:items-center',\n className\n )}\n {...props}\n >\n <Input\n type=\"date\"\n value={formatInputDate(draft?.from)}\n className=\"sm:w-max\"\n onChange={(event) => {\n if (event.target.value === '') {\n setDraft(undefined)\n return\n }\n\n const date = parseInputDate(event.target.value)\n if (!date) return\n setDraft(normalizeDraft({ from: date, to: draft?.to }))\n }}\n />\n <IconArrowRight className=\"size-4 text-primary hidden sm:block\" />\n <Input\n type=\"date\"\n value={formatInputDate(draft?.to)}\n className=\"sm:w-max\"\n onChange={(event) => {\n if (event.target.value === '') {\n setDraft(undefined)\n return\n }\n\n const date = parseInputDate(event.target.value)\n if (!date) return\n setDraft(normalizeDraft({ from: draft?.from, to: date }))\n }}\n />\n </div>\n )\n}\n\nfunction DateRangePickerActions({ className, children, ...props }: DateRangePickerActionsProps) {\n return (\n <div data-slot=\"date-range-picker-actions\" className={cn('flex items-center gap-2 mt-auto', className)} {...props}>\n {children ?? (\n <>\n <DateRangePickerReset />\n <DateRangePickerApply />\n </>\n )}\n </div>\n )\n}\n\nfunction DateRangePickerApply({ children = 'Aplicar', onClick, className, ...props }: DateRangePickerApplyProps) {\n const { apply } = useDateRangePicker()\n\n return (\n <Button\n size=\"sm\"\n className={cn('flex-1', className)}\n onClick={(event) => {\n onClick?.(event)\n if (!event.defaultPrevented) {\n apply()\n }\n }}\n {...props}\n >\n {children}\n </Button>\n )\n}\n\nfunction DateRangePickerReset({\n children = 'Resetar',\n onClick,\n variant = 'secondary',\n className,\n ...props\n}: DateRangePickerResetProps) {\n const { reset } = useDateRangePicker()\n\n return (\n <Button\n size=\"sm\"\n className={cn('flex-1', className)}\n variant={variant}\n onClick={(event) => {\n onClick?.(event)\n if (!event.defaultPrevented) {\n reset()\n }\n }}\n {...props}\n >\n {children}\n </Button>\n )\n}\n\nfunction useDateRangePicker() {\n const context = React.useContext(DateRangePickerContext)\n\n if (!context) {\n throw new Error('DateRangePicker components must be used within DateRangePicker.')\n }\n\n return context\n}\n\nfunction isDateRangePickerPresetsElement(child: React.ReactNode) {\n return React.isValidElement(child) && child.type === DateRangePickerPresets\n}\n\nfunction toDraft(range: DateRange | null | undefined) {\n return normalizeDraft(range ?? undefined)\n}\n\nfunction toValue(range: DateRange | undefined): DateRange | null {\n return normalizeDraft(range) ?? null\n}\n\nfunction getRangeMonth(range: DateRange | undefined) {\n return startOfDay(range?.from ?? range?.to ?? new Date())\n}\n\nfunction normalizeDraft(range: DateRange | undefined): DateRange | undefined {\n if (!range?.from && !range?.to) return undefined\n\n if (range.from && range.to && range.from > range.to) {\n return { from: startOfDay(range.to), to: startOfDay(range.from) }\n }\n\n return {\n from: range.from ? startOfDay(range.from) : undefined,\n to: range.to ? startOfDay(range.to) : undefined\n }\n}\n\nfunction formatRange(range: DateRange | null | undefined, locale: Partial<Locale> | undefined, placeholder: string) {\n if (!range?.from && !range?.to) return placeholder\n\n if (range.from && range.to) {\n return `${formatDisplayDate(range.from, locale)} - ${formatDisplayDate(range.to, locale)}`\n }\n\n return formatDisplayDate(range.from ?? range.to, locale)\n}\n\nfunction formatDisplayDate(date: Date | undefined, locale: Partial<Locale> | undefined) {\n if (!date) return ''\n\n return new Intl.DateTimeFormat(locale?.code ?? 'pt-BR', {\n day: '2-digit',\n month: '2-digit',\n year: 'numeric'\n }).format(date)\n}\n\nfunction formatInputDate(date: Date | undefined) {\n if (!date) return ''\n\n const year = date.getFullYear()\n const month = String(date.getMonth() + 1).padStart(2, '0')\n const day = String(date.getDate()).padStart(2, '0')\n\n return `${year}-${month}-${day}`\n}\n\nfunction parseInputDate(value: string) {\n if (!value) return undefined\n\n const match = /^(?<year>\\d{4})-(?<month>\\d{2})-(?<day>\\d{2})$/.exec(value)\n if (!match?.groups) return undefined\n\n const year = Number(match.groups.year)\n const month = Number(match.groups.month)\n const day = Number(match.groups.day)\n const date = new Date(year, month - 1, day)\n\n if (date.getFullYear() !== year || date.getMonth() !== month - 1 || date.getDate() !== day) {\n return undefined\n }\n\n return date\n}\n\nfunction parsePositiveInteger(value: string) {\n if (!value) return undefined\n\n const days = Number(value)\n if (!Number.isInteger(days) || days < 1) return undefined\n\n return days\n}\n\nfunction formatRelativeInputValue(value: number | undefined) {\n return value ? String(value) : ''\n}\n\nfunction getRelativeDaysRange(days: number, target: 'today' | 'yesterday'): DateRange {\n const today = startOfDay(new Date())\n const targetDate = target === 'today' ? addDays(today, -1) : addDays(today, -2)\n\n return {\n from: addDays(targetDate, -days + 1),\n to: targetDate\n }\n}\n\nfunction getRelativeDaysValue(range: DateRange | undefined, target: 'today' | 'yesterday') {\n if (!range?.from || !range.to) return undefined\n\n const today = startOfDay(new Date())\n const targetDate = target === 'today' ? addDays(today, -1) : addDays(today, -2)\n if (!isSameDay(range.to, targetDate)) return undefined\n\n const days = differenceInCalendarDays(targetDate, startOfDay(range.from)) + 1\n return days > 0 ? days : undefined\n}\n\nfunction isSameRange(left: DateRange | undefined, right: DateRange | undefined) {\n return isSameDay(left?.from, right?.from) && isSameDay(left?.to, right?.to)\n}\n\nfunction isSameDay(left: Date | undefined, right: Date | undefined) {\n if (!left || !right) return left === right\n\n return (\n left.getFullYear() === right.getFullYear() &&\n left.getMonth() === right.getMonth() &&\n left.getDate() === right.getDate()\n )\n}\n\nfunction startOfDay(date: Date) {\n return new Date(date.getFullYear(), date.getMonth(), date.getDate())\n}\n\nfunction startOfWeek(date: Date) {\n const day = startOfDay(date)\n return addDays(day, -day.getDay())\n}\n\nfunction startOfMonth(date: Date) {\n return new Date(date.getFullYear(), date.getMonth(), 1)\n}\n\nfunction endOfMonth(date: Date) {\n return new Date(date.getFullYear(), date.getMonth() + 1, 0)\n}\n\nfunction differenceInCalendarDays(left: Date, right: Date) {\n const millisecondsPerDay = 24 * 60 * 60 * 1000\n return Math.round((startOfDay(left).getTime() - startOfDay(right).getTime()) / millisecondsPerDay)\n}\n\nfunction addDays(date: Date, amount: number) {\n const nextDate = startOfDay(date)\n nextDate.setDate(nextDate.getDate() + amount)\n return nextDate\n}\n\nexport {\n type DateRange,\n DateRangePicker,\n DateRangePickerActions,\n DateRangePickerApply,\n DateRangePickerCalendar,\n DateRangePickerContent,\n DateRangePickerDateFields,\n DateRangePickerPreset,\n DateRangePickerPresets,\n DateRangePickerReset,\n DateRangePickerTrigger,\n DateRangePickerValue\n}\n"],"mappings":"kfAwBA,MAAMC,EAAyBD,EAAM,cAAkD,IAAI,EAIrFE,EAA2B,CAC/B,CACE,MAAO,OACP,aAAgB,CACd,IAAMC,EAAQ,2BAAW,IAAI,IAAM,EACnC,MAAO,CAAE,KAAMA,EAAO,GAAIA,CAAM,CAClC,CACF,EACA,CACE,MAAO,QACP,aAAgB,CACd,IAAMC,EAAY,QAAQ,2BAAW,IAAI,IAAM,EAAG,EAAE,EACpD,MAAO,CAAE,KAAMA,EAAW,GAAIA,CAAU,CAC1C,CACF,EACA,CACE,MAAO,iBACP,aAAgB,CACd,IAAMD,EAAQ,2BAAW,IAAI,IAAM,EACnC,MAAO,CAAE,KAAM,QAAQA,E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SAAS,GACnCD,EAAK,QAAQ,IAAMC,EAAM,QAAQ,CAErC,CAEA,SAAS,WAAW,EAAY,CAC9B,OAAO,IAAI,KAAKT,EAAK,YAAY,EAAGA,EAAK,SAAS,EAAGA,EAAK,QAAQ,CAAC,CACrE,CAEA,SAAS,YAAY,EAAY,CAC/B,IAAMK,EAAM,WAAWL,CAAI,EAC3B,OAAO,QAAQK,EAAK,CAACA,EAAI,OAAO,CAAC,CACnC,CAEA,SAAS,aAAa,EAAY,CAChC,OAAO,IAAI,KAAKL,EAAK,YAAY,EAAGA,EAAK,SAAS,EAAG,CAAC,CACxD,CAEA,SAAS,WAAW,EAAY,CAC9B,OAAO,IAAI,KAAKA,EAAK,YAAY,EAAGA,EAAK,SAAS,EAAI,EAAG,CAAC,CAC5D,CAEA,SAAS,yBAAyB,EAAY,EAAa,CAEzD,OAAO,KAAK,OAAO,WAAWQ,CAAI,CAAC,CAAC,QAAQ,EAAI,WAAWC,CAAK,CAAC,CAAC,QAAQ,GAAK,KAAkB,CACnG,CAEA,SAAS,QAAQ,EAAY,EAAgB,CAC3C,IAAMC,EAAW,WAAWV,CAAI,EAEhC,OADAU,EAAS,QAAQA,EAAS,QAAQ,EAAIC,CAAM,EACrCD,CACT"}
1
+ {"version":3,"file":"date-range-picker.js","names":["React","DateRangePickerContext","defaultPresetDefinitions","today","yesterday","previousWeekStart","previousMonth","valueProp","openProp","props","uncontrolledValue","setUncontrolledValue","defaultValue","uncontrolledOpen","setUncontrolledOpen","defaultOpen","isValueControlled","isOpenControlled","value","open","draft","setDraft","month","setMonth","updateDraft","normalizedDraft","nextDraft","nextMonth","commitValue","nextValue","onValueChange","setOpen","nextOpen","onOpenChange","apply","onApply","reset","onReset","context","locale","placeholder","Popover","children","Fragment","asChild","PopoverTrigger","Button","type","cn","className","IconCalendar","IconChevronDown","contextPlaceholder","childArray","presets","content","child","PopoverContent","resolveClassName","state","todayRelativeValue","yesterdayRelativeValue","range","preset","selected","days","id","inputValue","setInputValue","Input","label","event","Calendar","onMonthChange","date","IconArrowRight","onClick","match","year","day","targetDate","target","left","right","nextDate","amount"],"sources":["../../src/components/date-range-picker.tsx"],"sourcesContent":["import * as React from 'react'\nimport type { Locale } from 'react-day-picker'\n\nimport { IconArrowRight, IconCalendar, IconChevronDown } from '@tabler/icons-react'\n\nimport { cn } from '../lib/utils'\nimport { resolveClassName } from '../utils/resolve-class-name'\nimport { Button } from './button'\nimport { Calendar, type DateRange } from './calendar'\nimport { Input } from './input'\nimport { Popover, PopoverContent, PopoverTrigger } from './popover'\n\ntype DateRangePickerContextValue = {\n value: DateRange | null\n draft: DateRange | undefined\n month: Date\n locale?: Partial<Locale>\n placeholder: string\n setDraft: (range: DateRange | undefined) => void\n setMonth: (month: Date) => void\n apply: () => void\n reset: () => void\n}\n\nconst DateRangePickerContext = React.createContext<DateRangePickerContextValue | null>(null)\n\nconst defaultPlaceholder = 'Selecione um período'\n\nconst defaultPresetDefinitions = [\n {\n label: 'Hoje',\n getRange: () => {\n const today = startOfDay(new Date())\n return { from: today, to: today }\n }\n },\n {\n label: 'Ontem',\n getRange: () => {\n const yesterday = addDays(startOfDay(new Date()), -1)\n return { from: yesterday, to: yesterday }\n }\n },\n {\n label: 'Últimos 7 dias',\n getRange: () => {\n const today = startOfDay(new Date())\n return { from: addDays(today, -7), to: today }\n }\n },\n {\n label: 'Últimos 15 dias',\n getRange: () => {\n const today = startOfDay(new Date())\n return { from: addDays(today, -15), to: today }\n }\n },\n {\n label: 'Últimos 30 dias',\n getRange: () => {\n const today = startOfDay(new Date())\n return { from: addDays(today, -30), to: today }\n }\n },\n {\n label: 'Últimos 60 dias',\n getRange: () => {\n const today = startOfDay(new Date())\n return { from: addDays(today, -60), to: today }\n }\n },\n {\n label: 'Últimos 90 dias',\n getRange: () => {\n const today = startOfDay(new Date())\n return { from: addDays(today, -90), to: today }\n }\n },\n {\n label: 'Semana passada',\n getRange: () => {\n const previousWeekStart = addDays(startOfWeek(new Date()), -7)\n return { from: previousWeekStart, to: addDays(previousWeekStart, 6) }\n }\n },\n {\n label: 'Este mês',\n getRange: () => {\n const today = startOfDay(new Date())\n return { from: startOfMonth(today), to: today }\n }\n },\n {\n label: 'Mês passado',\n getRange: () => {\n const previousMonth = new Date(new Date().getFullYear(), new Date().getMonth() - 1, 1)\n return { from: startOfMonth(previousMonth), to: endOfMonth(previousMonth) }\n }\n }\n] satisfies DateRangePickerPresetOption[]\n\nexport type DateRangePickerPresetOption = {\n label: string\n getRange: () => DateRange\n}\n\nexport type DateRangePickerProps = Omit<\n React.ComponentProps<typeof Popover>,\n 'open' | 'defaultOpen' | 'onOpenChange'\n> & {\n /** Selected range (controlled). `null` when empty. */\n value?: DateRange | null\n /**\n * Initial range (uncontrolled).\n * @default null\n */\n defaultValue?: DateRange | null\n /** Called when a range is applied, or with `null` when it is reset. */\n onValueChange?: (range: DateRange | null) => void\n /** Called after `DateRangePickerApply` commits the draft. */\n onApply?: (range: DateRange | null) => void\n /** Called after `DateRangePickerReset` clears the value. */\n onReset?: () => void\n /** Whether the popover is open (controlled). */\n open?: boolean\n /**\n * Whether the popover starts open (uncontrolled).\n * @default false\n */\n defaultOpen?: boolean\n /** Called when the popover opens or closes. */\n onOpenChange?: (open: boolean) => void\n /** `react-day-picker` locale used by the calendar and the formatted dates. */\n locale?: Partial<Locale>\n /** Trigger text when no range is selected. */\n placeholder?: string\n}\n\nexport type DateRangePickerTriggerProps = React.ComponentProps<typeof Button> & {\n asChild?: boolean\n}\n\nexport type DateRangePickerValueProps = React.ComponentProps<'span'> & {\n /** Text shown when no range is selected. Defaults to the picker `placeholder`. */\n placeholder?: string\n}\n\nexport type DateRangePickerContentProps = React.ComponentProps<typeof PopoverContent>\n\nexport type DateRangePickerPresetsProps = React.ComponentProps<'div'> & {\n /** Presets to show, as `{ label, getRange }`. Defaults to the pt-BR presets. */\n presets?: DateRangePickerPresetOption[]\n}\n\nexport type DateRangePickerPresetProps = React.ComponentProps<'button'> & {\n /**\n * Highlights the preset as the current selection.\n * @default false\n */\n selected?: boolean\n}\n\nexport type DateRangePickerCalendarProps = Omit<\n React.ComponentProps<typeof Calendar>,\n 'mode' | 'numberOfMonths' | 'selected' | 'onSelect' | 'month' | 'defaultMonth'\n>\n\nexport type DateRangePickerDateFieldsProps = React.ComponentProps<'div'>\n\nexport type DateRangePickerActionsProps = React.ComponentProps<'div'>\n\nexport type DateRangePickerApplyProps = React.ComponentProps<typeof Button>\n\nexport type DateRangePickerResetProps = React.ComponentProps<typeof Button>\n\nfunction DateRangePicker({\n value: valueProp,\n defaultValue = null,\n onValueChange,\n onApply,\n onReset,\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n locale,\n placeholder = defaultPlaceholder,\n children,\n ...props\n}: DateRangePickerProps) {\n const [uncontrolledValue, setUncontrolledValue] = React.useState<DateRange | null>(defaultValue)\n const [uncontrolledOpen, setUncontrolledOpen] = React.useState(defaultOpen)\n\n const isValueControlled = valueProp !== undefined\n const isOpenControlled = openProp !== undefined\n const value = isValueControlled ? (valueProp ?? null) : uncontrolledValue\n const open = isOpenControlled ? openProp : uncontrolledOpen\n\n const [draft, setDraft] = React.useState<DateRange | undefined>(() => toDraft(value))\n const [month, setMonth] = React.useState<Date>(() => getRangeMonth(toDraft(value)))\n\n const updateDraft = React.useCallback((nextDraft: DateRange | undefined) => {\n const normalizedDraft = normalizeDraft(nextDraft)\n setDraft(normalizedDraft)\n\n const nextMonth = getRangeMonth(normalizedDraft)\n if (nextMonth) {\n setMonth(nextMonth)\n }\n }, [])\n\n const commitValue = React.useCallback(\n (nextValue: DateRange | null) => {\n if (!isValueControlled) {\n setUncontrolledValue(nextValue)\n }\n\n onValueChange?.(nextValue)\n },\n [isValueControlled, onValueChange]\n )\n\n const setOpen = React.useCallback(\n (nextOpen: boolean) => {\n if (nextOpen) {\n const nextDraft = toDraft(value)\n setDraft(nextDraft)\n setMonth(getRangeMonth(nextDraft))\n }\n\n if (!isOpenControlled) {\n setUncontrolledOpen(nextOpen)\n }\n\n onOpenChange?.(nextOpen)\n },\n [isOpenControlled, onOpenChange, value]\n )\n\n const apply = React.useCallback(() => {\n const nextValue = toValue(draft)\n commitValue(nextValue)\n onApply?.(nextValue)\n setOpen(false)\n }, [commitValue, draft, onApply, setOpen])\n\n const reset = React.useCallback(() => {\n setDraft(undefined)\n commitValue(null)\n onReset?.()\n setOpen(false)\n }, [commitValue, onReset, setOpen])\n\n const context = React.useMemo<DateRangePickerContextValue>(\n () => ({\n value,\n draft,\n month,\n locale,\n placeholder,\n setDraft: updateDraft,\n setMonth,\n apply,\n reset\n }),\n [apply, draft, locale, month, placeholder, reset, updateDraft, value]\n )\n\n return (\n <DateRangePickerContext.Provider value={context}>\n <Popover open={open} onOpenChange={setOpen} {...props}>\n {children ?? (\n <>\n <DateRangePickerTrigger />\n <DateRangePickerContent>\n <DateRangePickerPresets />\n <DateRangePickerDateFields />\n <DateRangePickerCalendar />\n <DateRangePickerActions />\n </DateRangePickerContent>\n </>\n )}\n </Popover>\n </DateRangePickerContext.Provider>\n )\n}\n\nfunction DateRangePickerTrigger({\n className,\n children,\n asChild = false,\n variant = 'secondary',\n type,\n ...props\n}: DateRangePickerTriggerProps) {\n if (asChild) {\n return (\n <PopoverTrigger asChild className={className} type={type} {...props}>\n {children}\n </PopoverTrigger>\n )\n }\n\n return (\n <PopoverTrigger asChild>\n <Button\n type={type ?? 'button'}\n variant={variant}\n className={cn('min-w-64 justify-between font-normal', className)}\n {...props}\n >\n {children ?? (\n <>\n <IconCalendar data-icon=\"inline-start\" className=\"size-4 text-muted-foreground\" />\n <DateRangePickerValue className=\"flex-1 text-left\" />\n <IconChevronDown data-icon=\"inline-end\" className=\"size-4 text-muted-foreground\" />\n </>\n )}\n </Button>\n </PopoverTrigger>\n )\n}\n\nfunction DateRangePickerValue({ className, placeholder, ...props }: DateRangePickerValueProps) {\n const { value, locale, placeholder: contextPlaceholder } = useDateRangePicker()\n\n return (\n <span data-slot=\"date-range-picker-value\" className={cn('truncate', className)} {...props}>\n {formatRange(value, locale, placeholder ?? contextPlaceholder)}\n </span>\n )\n}\n\nfunction DateRangePickerContent({\n className,\n align = 'start',\n sideOffset = 8,\n children,\n ...props\n}: DateRangePickerContentProps) {\n const childArray = React.Children.toArray(children)\n const presets = childArray.filter(isDateRangePickerPresetsElement)\n const content = childArray.filter((child) => !isDateRangePickerPresetsElement(child))\n\n return (\n <PopoverContent\n align={align}\n sideOffset={sideOffset}\n className={(state) => cn('w-[calc(100vw-(--spacing(4)))] max-w-2xl p-2', resolveClassName(className, state))}\n {...props}\n >\n <div data-slot=\"date-range-picker-content\" className=\"grid gap-3 md:grid-cols-[10rem_minmax(0,1fr)]\">\n {presets}\n <div className=\"flex min-w-0 flex-col gap-3\">{content}</div>\n </div>\n </PopoverContent>\n )\n}\n\nfunction DateRangePickerPresets({\n className,\n presets = defaultPresetDefinitions,\n ...props\n}: DateRangePickerPresetsProps) {\n const { draft, setDraft } = useDateRangePicker()\n const todayRelativeValue = getRelativeDaysValue(draft, 'today')\n const yesterdayRelativeValue = getRelativeDaysValue(draft, 'yesterday')\n\n return (\n <div\n data-slot=\"date-range-picker-presets\"\n className={cn('hidden flex-col border-border pr-3 md:flex md:border-r', className)}\n {...props}\n >\n {presets.map((preset) => {\n const range = preset.getRange()\n const selected = isSameRange(draft, range)\n\n return (\n <DateRangePickerPreset key={preset.label} type=\"button\" selected={selected} onClick={() => setDraft(range)}>\n {preset.label}\n </DateRangePickerPreset>\n )\n })}\n\n <div className=\"my-3 flex flex-col gap-2\">\n <DateRangePickerRelativeField\n label=\"Dias até hoje\"\n value={todayRelativeValue}\n onValueChange={(days) => setDraft(getRelativeDaysRange(days, 'today'))}\n />\n <DateRangePickerRelativeField\n label=\"Dias até ontem\"\n value={yesterdayRelativeValue}\n onValueChange={(days) => setDraft(getRelativeDaysRange(days, 'yesterday'))}\n />\n </div>\n </div>\n )\n}\n\nfunction DateRangePickerPreset({ className, selected = false, ...props }: DateRangePickerPresetProps) {\n return (\n <button\n data-slot=\"date-range-picker-preset\"\n data-selected={selected}\n className={cn(\n 'flex h-8.5 w-full items-center border-l-3 border-border bg-transparent px-2 text-left text-sm text-foreground transition-colors outline-none',\n 'hover:border-primary hover:bg-primary-50 hover:text-primary-700 dark:hover:bg-primary-950 dark:hover:text-primary-300',\n 'focus-visible:border-primary focus-visible:ring-3 focus-visible:ring-ring/50',\n 'data-[selected=true]:border-primary data-[selected=true]:bg-primary-50 data-[selected=true]:text-primary-700 dark:data-[selected=true]:bg-primary-950 dark:data-[selected=true]:text-primary-300',\n className\n )}\n aria-pressed={selected}\n {...props}\n />\n )\n}\n\nfunction DateRangePickerRelativeField({\n label,\n value,\n onValueChange\n}: {\n label: string\n value: number | undefined\n onValueChange: (days: number) => void\n}) {\n const id = React.useId()\n const [inputValue, setInputValue] = React.useState(() => formatRelativeInputValue(value))\n\n React.useEffect(() => {\n setInputValue(formatRelativeInputValue(value))\n }, [value])\n\n return (\n <div className=\"flex items-center gap-2 text-sm text-foreground\">\n <Input\n id={id}\n type=\"number\"\n name={label}\n min={1}\n step={1}\n value={inputValue}\n className=\"h-7 w-9 rounded-md px-1 text-center [appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none\"\n aria-label={label}\n onChange={(event) => {\n const nextValue = event.target.value\n setInputValue(nextValue)\n\n if (nextValue === '') return\n\n const days = parsePositiveInteger(nextValue)\n if (!days) return\n onValueChange(days)\n }}\n />\n <label htmlFor={id}>{label}</label>\n </div>\n )\n}\n\nfunction DateRangePickerCalendar({\n className,\n showOutsideDays = false,\n onMonthChange,\n ...props\n}: DateRangePickerCalendarProps) {\n const { draft, locale, month, setDraft, setMonth } = useDateRangePicker()\n\n return (\n <Calendar\n mode=\"range\"\n numberOfMonths={2}\n showOutsideDays={showOutsideDays}\n month={month}\n onMonthChange={(nextMonth) => {\n setMonth(nextMonth)\n onMonthChange?.(nextMonth)\n }}\n selected={draft}\n onSelect={setDraft}\n locale={locale}\n className={cn('mx-auto bg-transparent p-0', className)}\n {...props}\n />\n )\n}\n\nfunction DateRangePickerDateFields({ className, ...props }: DateRangePickerDateFieldsProps) {\n const { draft, setDraft } = useDateRangePicker()\n\n return (\n <div\n data-slot=\"date-range-picker-date-fields\"\n className={cn(\n 'pb-2 border-b flex justify-between gap-2 flex-wrap flex-col sm:flex-row sm:items-center',\n className\n )}\n {...props}\n >\n <Input\n type=\"date\"\n value={formatInputDate(draft?.from)}\n className=\"sm:w-max\"\n onChange={(event) => {\n if (event.target.value === '') {\n setDraft(undefined)\n return\n }\n\n const date = parseInputDate(event.target.value)\n if (!date) return\n setDraft(normalizeDraft({ from: date, to: draft?.to }))\n }}\n />\n <IconArrowRight className=\"size-4 text-primary hidden sm:block\" />\n <Input\n type=\"date\"\n value={formatInputDate(draft?.to)}\n className=\"sm:w-max\"\n onChange={(event) => {\n if (event.target.value === '') {\n setDraft(undefined)\n return\n }\n\n const date = parseInputDate(event.target.value)\n if (!date) return\n setDraft(normalizeDraft({ from: draft?.from, to: date }))\n }}\n />\n </div>\n )\n}\n\nfunction DateRangePickerActions({ className, children, ...props }: DateRangePickerActionsProps) {\n return (\n <div data-slot=\"date-range-picker-actions\" className={cn('flex items-center gap-2 mt-auto', className)} {...props}>\n {children ?? (\n <>\n <DateRangePickerReset />\n <DateRangePickerApply />\n </>\n )}\n </div>\n )\n}\n\nfunction DateRangePickerApply({ children = 'Aplicar', onClick, className, ...props }: DateRangePickerApplyProps) {\n const { apply } = useDateRangePicker()\n\n return (\n <Button\n size=\"sm\"\n className={cn('flex-1', className)}\n onClick={(event) => {\n onClick?.(event)\n if (!event.defaultPrevented) {\n apply()\n }\n }}\n {...props}\n >\n {children}\n </Button>\n )\n}\n\nfunction DateRangePickerReset({\n children = 'Resetar',\n onClick,\n variant = 'secondary',\n className,\n ...props\n}: DateRangePickerResetProps) {\n const { reset } = useDateRangePicker()\n\n return (\n <Button\n size=\"sm\"\n className={cn('flex-1', className)}\n variant={variant}\n onClick={(event) => {\n onClick?.(event)\n if (!event.defaultPrevented) {\n reset()\n }\n }}\n {...props}\n >\n {children}\n </Button>\n )\n}\n\nfunction useDateRangePicker() {\n const context = React.useContext(DateRangePickerContext)\n\n if (!context) {\n throw new Error('DateRangePicker components must be used within DateRangePicker.')\n }\n\n return context\n}\n\nfunction isDateRangePickerPresetsElement(child: React.ReactNode) {\n return React.isValidElement(child) && child.type === DateRangePickerPresets\n}\n\nfunction toDraft(range: DateRange | null | undefined) {\n return normalizeDraft(range ?? undefined)\n}\n\nfunction toValue(range: DateRange | undefined): DateRange | null {\n return normalizeDraft(range) ?? null\n}\n\nfunction getRangeMonth(range: DateRange | undefined) {\n return startOfDay(range?.from ?? range?.to ?? new Date())\n}\n\nfunction normalizeDraft(range: DateRange | undefined): DateRange | undefined {\n if (!range?.from && !range?.to) return undefined\n\n if (range.from && range.to && range.from > range.to) {\n return { from: startOfDay(range.to), to: startOfDay(range.from) }\n }\n\n return {\n from: range.from ? startOfDay(range.from) : undefined,\n to: range.to ? startOfDay(range.to) : undefined\n }\n}\n\nfunction formatRange(range: DateRange | null | undefined, locale: Partial<Locale> | undefined, placeholder: string) {\n if (!range?.from && !range?.to) return placeholder\n\n if (range.from && range.to) {\n return `${formatDisplayDate(range.from, locale)} - ${formatDisplayDate(range.to, locale)}`\n }\n\n return formatDisplayDate(range.from ?? range.to, locale)\n}\n\nfunction formatDisplayDate(date: Date | undefined, locale: Partial<Locale> | undefined) {\n if (!date) return ''\n\n return new Intl.DateTimeFormat(locale?.code ?? 'pt-BR', {\n day: '2-digit',\n month: '2-digit',\n year: 'numeric'\n }).format(date)\n}\n\nfunction formatInputDate(date: Date | undefined) {\n if (!date) return ''\n\n const year = date.getFullYear()\n const month = String(date.getMonth() + 1).padStart(2, '0')\n const day = String(date.getDate()).padStart(2, '0')\n\n return `${year}-${month}-${day}`\n}\n\nfunction parseInputDate(value: string) {\n if (!value) return undefined\n\n const match = /^(?<year>\\d{4})-(?<month>\\d{2})-(?<day>\\d{2})$/.exec(value)\n if (!match?.groups) return undefined\n\n const year = Number(match.groups.year)\n const month = Number(match.groups.month)\n const day = Number(match.groups.day)\n const date = new Date(year, month - 1, day)\n\n if (date.getFullYear() !== year || date.getMonth() !== month - 1 || date.getDate() !== day) {\n return undefined\n }\n\n return date\n}\n\nfunction parsePositiveInteger(value: string) {\n if (!value) return undefined\n\n const days = Number(value)\n if (!Number.isInteger(days) || days < 1) return undefined\n\n return days\n}\n\nfunction formatRelativeInputValue(value: number | undefined) {\n return value ? String(value) : ''\n}\n\nfunction getRelativeDaysRange(days: number, target: 'today' | 'yesterday'): DateRange {\n const today = startOfDay(new Date())\n const targetDate = target === 'today' ? addDays(today, -1) : addDays(today, -2)\n\n return {\n from: addDays(targetDate, -days + 1),\n to: targetDate\n }\n}\n\nfunction getRelativeDaysValue(range: DateRange | undefined, target: 'today' | 'yesterday') {\n if (!range?.from || !range.to) return undefined\n\n const today = startOfDay(new Date())\n const targetDate = target === 'today' ? addDays(today, -1) : addDays(today, -2)\n if (!isSameDay(range.to, targetDate)) return undefined\n\n const days = differenceInCalendarDays(targetDate, startOfDay(range.from)) + 1\n return days > 0 ? days : undefined\n}\n\nfunction isSameRange(left: DateRange | undefined, right: DateRange | undefined) {\n return isSameDay(left?.from, right?.from) && isSameDay(left?.to, right?.to)\n}\n\nfunction isSameDay(left: Date | undefined, right: Date | undefined) {\n if (!left || !right) return left === right\n\n return (\n left.getFullYear() === right.getFullYear() &&\n left.getMonth() === right.getMonth() &&\n left.getDate() === right.getDate()\n )\n}\n\nfunction startOfDay(date: Date) {\n return new Date(date.getFullYear(), date.getMonth(), date.getDate())\n}\n\nfunction startOfWeek(date: Date) {\n const day = startOfDay(date)\n return addDays(day, -day.getDay())\n}\n\nfunction startOfMonth(date: Date) {\n return new Date(date.getFullYear(), date.getMonth(), 1)\n}\n\nfunction endOfMonth(date: Date) {\n return new Date(date.getFullYear(), date.getMonth() + 1, 0)\n}\n\nfunction differenceInCalendarDays(left: Date, right: Date) {\n const millisecondsPerDay = 24 * 60 * 60 * 1000\n return Math.round((startOfDay(left).getTime() - startOfDay(right).getTime()) / millisecondsPerDay)\n}\n\nfunction addDays(date: Date, amount: number) {\n const nextDate = startOfDay(date)\n nextDate.setDate(nextDate.getDate() + amount)\n return nextDate\n}\n\nexport {\n type DateRange,\n DateRangePicker,\n DateRangePickerActions,\n DateRangePickerApply,\n DateRangePickerCalendar,\n DateRangePickerContent,\n DateRangePickerDateFields,\n DateRangePickerPreset,\n DateRangePickerPresets,\n DateRangePickerReset,\n DateRangePickerTrigger,\n DateRangePickerValue\n}\n"],"mappings":"A,kfAwBA,MAAMC,EAAyBD,EAAM,cAAkD,IAAI,EAIrFE,EAA2B,CAC/B,CACE,MAAO,OACP,aAAgB,CACd,IAAMC,EAAQ,2BAAW,IAAI,IAAM,EACnC,MAAO,CAAE,KAAMA,EAAO,GAAIA,CAAM,CAClC,CACF,EACA,CACE,MAAO,QACP,aAAgB,CACd,IAAMC,EAAY,QAAQ,2BAAW,IAAI,IAAM,EAAG,EAAE,EACpD,MAAO,CAAE,KAAMA,EAAW,GAAIA,CAAU,CAC1C,CACF,EACA,CACE,MAAO,iBACP,aAAgB,CACd,IAAMD,EAAQ,2BAAW,IAAI,IAAM,EACnC,MAAO,CAAE,KAAM,QAAQA,EAAO,EAAE,EAAG,GAAIA,CAAM,CAC/C,CACF,EACA,CACE,MAAO,kBACP,aAAgB,CACd,IAAMA,EAAQ,2BAAW,IAAI,IAAM,EACnC,MAAO,CAAE,KAAM,QAAQA,EAAO,GAAG,EAAG,GAAIA,CAAM,CAChD,CACF,EACA,CACE,MAAO,kBACP,aAAgB,CACd,IAAMA,EAAQ,2BAAW,IAAI,IAAM,EACnC,MAAO,CAAE,KAAM,QAAQA,EAAO,GAAG,EAAG,GAAIA,CAAM,CAChD,CACF,EACA,CACE,MAAO,kBACP,aAAgB,CACd,IAAMA,EAAQ,2BAAW,IAAI,IAAM,EACnC,MAAO,CAAE,KAAM,QAAQA,EAAO,GAAG,EAAG,GAAIA,CAA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,EAAGA,EAAK,SAAS,EAAI,EAAG,CAAC,CAC5D,CAEA,SAAS,yBAAyB,EAAY,EAAa,CAEzD,OAAO,KAAK,OAAO,WAAWQ,CAAI,CAAC,CAAC,QAAQ,EAAI,WAAWC,CAAK,CAAC,CAAC,QAAQ,GAAK,KAAkB,CACnG,CAEA,SAAS,QAAQ,EAAY,EAAgB,CAC3C,IAAMC,EAAW,WAAWV,CAAI,EAEhC,OADAU,EAAS,QAAQA,EAAS,QAAQ,EAAIC,CAAM,EACrCD,CACT,C"}
@@ -1,9 +1,8 @@
1
1
  import { t as __name } from "../rolldown-runtime-BhWHdk3m.js";
2
- import { t as AsChildPrimitiveProps } from "../as-child-Dxg3Xo1G.js";
2
+ import { t as AsChildPrimitiveProps } from "../as-child-T9W73ZYU.js";
3
3
  import * as React from "react";
4
4
  import { VariantProps } from "class-variance-authority";
5
5
  import { Dialog as Dialog$1 } from "@base-ui/react/dialog";
6
- //#region src/components/dialog.d.ts
7
6
  declare const dialogContentVariants: (props?: ({
8
7
  size?: "2xl" | "3xl" | "full" | "lg" | "md" | "sm" | "xl" | null | undefined;
9
8
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
@@ -57,6 +56,5 @@ declare function DialogBody({ className, ...props }: DialogBodyProps): React.JSX
57
56
  declare function DialogFooter({ className, showCloseButton, children, ...props }: DialogFooterProps): React.JSX.Element;
58
57
  declare function DialogTitle({ className, asChild, children, ...props }: DialogTitleProps): React.JSX.Element;
59
58
  declare function DialogDescription({ className, asChild, children, ...props }: DialogDescriptionProps): React.JSX.Element;
60
- //#endregion
61
59
  export { Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger };
62
60
  //# sourceMappingURL=dialog.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dialog.js","names":["DialogPrimitive","resolveClassName","React","Dialog$1","dialogContentVariants","cva","DialogContext","props","contextValue","size","dismissible","disablePointerDismissal","eventDetails","onOpenChange","open","toAsChildRenderProps","asChild","children","cn","className","state","stopPropagationHandler","onClick","overlayProps","overlayRef","showCloseButton","Button","IconX"],"sources":["../../src/components/dialog.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { Dialog as DialogPrimitive } from '@base-ui/react/dialog'\nimport { IconX } from '@tabler/icons-react'\nimport { cva, type VariantProps } from 'class-variance-authority'\n\nimport { type AsChildPrimitiveProps, toAsChildRenderProps } from '../lib/as-child'\nimport { cn, stopPropagationHandler } from '../lib/utils'\nimport { resolveClassName } from '../utils/resolve-class-name'\nimport { Button } from './button'\n\nconst dialogContentVariants = cva(\n [\n 'bg-background ring-foreground/10 fixed top-1/2 left-1/2 z-50 w-full -translate-x-1/2 -translate-y-1/2 outline-none',\n 'flex flex-col gap-4 rounded-xl p-4 text-sm ring-1 duration-100',\n 'max-w-[calc(100%-2rem)] max-h-[calc(100dvh-2rem)] overflow-hidden',\n 'data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95'\n ],\n {\n variants: {\n size: {\n sm: 'sm:max-w-sm',\n md: 'sm:max-w-md',\n lg: 'sm:max-w-lg',\n xl: 'sm:max-w-xl',\n '2xl': 'sm:max-w-2xl',\n '3xl': 'sm:max-w-3xl',\n full: 'w-screen h-screen max-w-none max-h-screen rounded-none sm:max-w-none'\n }\n },\n defaultVariants: {\n size: 'md'\n }\n }\n)\n\ntype DialogSize = NonNullable<VariantProps<typeof dialogContentVariants>['size']>\ntype DialogContextValue = { size: DialogSize }\nconst DialogContext = React.createContext<DialogContextValue>({ size: 'md' })\n\nexport type DialogProps = React.ComponentProps<typeof DialogPrimitive.Root> & {\n /**\n * Dialog width. `full` fills the whole viewport.\n * @default 'md'\n */\n size?: DialogSize\n /**\n * When `false`, clicking outside and pressing Esc no longer close the dialog. The close button and `DialogClose` still work.\n * @default true\n */\n dismissible?: boolean\n}\nexport type DialogTriggerProps = AsChildPrimitiveProps<typeof DialogPrimitive.Trigger>\nexport type DialogPortalProps = React.ComponentProps<typeof DialogPrimitive.Portal>\nexport type DialogCloseProps = AsChildPrimitiveProps<typeof DialogPrimitive.Close>\nexport type DialogOverlayProps = AsChildPrimitiveProps<typeof DialogPrimitive.Backdrop>\nexport type DialogContentProps = AsChildPrimitiveProps<typeof DialogPrimitive.Popup> &\n Pick<DialogPortalProps, 'keepMounted'> & {\n /**\n * Shows the X button in the top-right corner.\n * @default true\n */\n showCloseButton?: boolean\n /** Ref to the overlay element rendered behind the dialog. */\n overlayRef?: React.Ref<HTMLDivElement>\n /** Props passed to the overlay rendered behind the dialog. */\n overlayProps?: DialogOverlayProps\n }\nexport type DialogHeaderProps = React.ComponentProps<'div'>\nexport type DialogBodyProps = React.ComponentProps<'div'>\nexport type DialogFooterProps = React.ComponentProps<'div'> & {\n /**\n * Adds an outline \"Close\" button after the footer actions.\n * @default false\n */\n showCloseButton?: boolean\n}\nexport type DialogTitleProps = AsChildPrimitiveProps<typeof DialogPrimitive.Title>\nexport type DialogDescriptionProps = AsChildPrimitiveProps<typeof DialogPrimitive.Description>\n\nfunction Dialog({ size = 'md', dismissible = true, disablePointerDismissal, onOpenChange, ...props }: DialogProps) {\n const contextValue = React.useMemo<DialogContextValue>(() => ({ size }), [size])\n\n return (\n <DialogContext.Provider value={contextValue}>\n <DialogPrimitive.Root\n data-slot=\"dialog\"\n disablePointerDismissal={!dismissible || disablePointerDismissal}\n onOpenChange={(open, eventDetails) => {\n if (!dismissible && eventDetails.reason === 'escape-key') {\n eventDetails.cancel()\n return\n }\n onOpenChange?.(open, eventDetails)\n }}\n {...props}\n />\n </DialogContext.Provider>\n )\n}\n\nfunction DialogTrigger({ asChild, children, ...props }: DialogTriggerProps) {\n return <DialogPrimitive.Trigger data-slot=\"dialog-trigger\" {...props} {...toAsChildRenderProps(asChild, children)} />\n}\n\nfunction DialogPortal({ ...props }: DialogPortalProps) {\n return <DialogPrimitive.Portal data-slot=\"dialog-portal\" {...props} />\n}\n\nfunction DialogClose({ asChild, children, ...props }: DialogCloseProps) {\n return <DialogPrimitive.Close data-slot=\"dialog-close\" {...props} {...toAsChildRenderProps(asChild, children)} />\n}\n\nfunction DialogOverlay({ className, onClick, forceRender = true, asChild, children, ...props }: DialogOverlayProps) {\n return (\n <DialogPrimitive.Backdrop\n data-slot=\"dialog-overlay\"\n forceRender={forceRender}\n className={(state) =>\n cn(\n 'bg-black/10 fixed inset-0 isolate z-50',\n 'data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0',\n 'duration-100 supports-backdrop-filter:backdrop-blur-xs',\n resolveClassName(className, state)\n )\n }\n onClick={stopPropagationHandler(onClick)}\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n )\n}\n\nfunction DialogContent({\n className,\n children,\n showCloseButton = true,\n overlayRef,\n overlayProps,\n keepMounted,\n asChild,\n ...props\n}: DialogContentProps) {\n const { size } = React.useContext(DialogContext)\n\n return (\n <DialogPortal keepMounted={keepMounted}>\n <DialogOverlay {...overlayProps} ref={overlayRef ?? overlayProps?.ref} />\n <DialogPrimitive.Popup\n data-slot=\"dialog-content\"\n className={(state) => cn(dialogContentVariants({ size }), resolveClassName(className, state))}\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n // React events bubble through the fiber tree, not the DOM, so a portaled Popup still\n // reaches any ancestor's onClick/onSubmit even though it renders outside it in the DOM.\n onClick={stopPropagationHandler(props.onClick)}\n onSubmit={stopPropagationHandler(props.onSubmit)}\n >\n {!asChild && children}\n {showCloseButton && !asChild && (\n <DialogPrimitive.Close\n data-slot=\"dialog-close\"\n render={<Button variant=\"ghost\" className=\"absolute top-2 right-2\" size=\"icon-sm\" />}\n >\n <IconX />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n )}\n </DialogPrimitive.Popup>\n </DialogPortal>\n )\n}\n\nfunction DialogHeader({ className, ...props }: DialogHeaderProps) {\n return <div data-slot=\"dialog-header\" className={cn('gap-2 flex flex-col shrink-0', className)} {...props} />\n}\n\nfunction DialogBody({ className, ...props }: DialogBodyProps) {\n return <div data-slot=\"dialog-body\" className={cn('-mx-4 px-4 flex-1 overflow-y-auto', className)} {...props} />\n}\n\nfunction DialogFooter({ className, showCloseButton = false, children, ...props }: DialogFooterProps) {\n return (\n <div\n data-slot=\"dialog-footer\"\n className={cn(\n 'bg-muted/50 -mx-4 -mb-4 rounded-b-xl border-t p-4 shrink-0',\n 'flex flex-col-reverse gap-2 sm:flex-row sm:justify-end',\n className\n )}\n {...props}\n >\n {children}\n {showCloseButton && <DialogPrimitive.Close render={<Button variant=\"outline\" />}>Close</DialogPrimitive.Close>}\n </div>\n )\n}\n\nfunction DialogTitle({ className, asChild, children, ...props }: DialogTitleProps) {\n return (\n <DialogPrimitive.Title\n data-slot=\"dialog-title\"\n className={(state) => cn('text-base leading-none font-medium', resolveClassName(className, state))}\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n )\n}\n\nfunction DialogDescription({ className, asChild, children, ...props }: DialogDescriptionProps) {\n return (\n <DialogPrimitive.Description\n data-slot=\"dialog-description\"\n className={(state) =>\n cn(\n 'text-muted-foreground text-sm',\n '*:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground',\n resolveClassName(className, state)\n )\n }\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n )\n}\n\nexport {\n Dialog,\n DialogBody,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger\n}\n"],"mappings":"kdAWA,MAAMI,EAAwBC,EAC5B,CACE,qHACA,iEACA,oEACA,sIACF,EACA,CACE,SAAU,CACR,KAAM,CACJ,GAAI,cACJ,GAAI,cACJ,GAAI,cACJ,GAAI,cACJ,MAAO,eACP,MAAO,eACP,KAAM,sEACR,CACF,EACA,gBAAiB,CACf,KAAM,IACR,CACF,CACF,EAIMC,EAAgBJ,EAAM,cAAkC,CAAE,KAAM,IAAK,CAAC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B,kBAACzB,EAAgB,MAAjB,CAAuB,OAAQ,kBAAC0B,EAAD,CAAQ,QAAQ,SAAW,CAAA,EAAG,SAAA,OAA4B,CAAA,CAC1G,GAET,CAEA,SAAS,YAAY,CAAE,YAAW,UAAS,WAAU,GAAGnB,GAA2B,CACjF,MACE,kBAACP,EAAgB,MAAjB,CACE,YAAU,eACV,UAAY,GAAUkB,EAAG,qCAAsCjB,EAAiBkB,EAAWC,CAAK,CAAC,EACjG,GAAIb,EACJ,GAAIQ,EAAqBC,EAASC,CAAQ,CAC3C,CAAA,CAEL,CAEA,SAAS,kBAAkB,CAAE,YAAW,UAAS,WAAU,GAAGV,GAAiC,CAC7F,MACE,kBAACP,EAAgB,YAAjB,CACE,YAAU,qBACV,UAAY,GACVkB,EACE,gCACA,uEACAjB,EAAiBkB,EAAWC,CAAK,CACnC,EAEF,GAAIb,EACJ,GAAIQ,EAAqBC,EAASC,CAAQ,CAC3C,CAAA,CAEL"}
1
+ {"version":3,"file":"dialog.js","names":["DialogPrimitive","resolveClassName","React","Dialog$1","dialogContentVariants","cva","DialogContext","props","contextValue","size","dismissible","disablePointerDismissal","eventDetails","onOpenChange","open","toAsChildRenderProps","asChild","children","cn","className","state","stopPropagationHandler","onClick","overlayProps","overlayRef","showCloseButton","Button","IconX"],"sources":["../../src/components/dialog.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { Dialog as DialogPrimitive } from '@base-ui/react/dialog'\nimport { IconX } from '@tabler/icons-react'\nimport { cva, type VariantProps } from 'class-variance-authority'\n\nimport { type AsChildPrimitiveProps, toAsChildRenderProps } from '../lib/as-child'\nimport { cn, stopPropagationHandler } from '../lib/utils'\nimport { resolveClassName } from '../utils/resolve-class-name'\nimport { Button } from './button'\n\nconst dialogContentVariants = cva(\n [\n 'bg-background ring-foreground/10 fixed top-1/2 left-1/2 z-50 w-full -translate-x-1/2 -translate-y-1/2 outline-none',\n 'flex flex-col gap-4 rounded-xl p-4 text-sm ring-1 duration-100',\n 'max-w-[calc(100%-2rem)] max-h-[calc(100dvh-2rem)] overflow-hidden',\n 'data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95'\n ],\n {\n variants: {\n size: {\n sm: 'sm:max-w-sm',\n md: 'sm:max-w-md',\n lg: 'sm:max-w-lg',\n xl: 'sm:max-w-xl',\n '2xl': 'sm:max-w-2xl',\n '3xl': 'sm:max-w-3xl',\n full: 'w-screen h-screen max-w-none max-h-screen rounded-none sm:max-w-none'\n }\n },\n defaultVariants: {\n size: 'md'\n }\n }\n)\n\ntype DialogSize = NonNullable<VariantProps<typeof dialogContentVariants>['size']>\ntype DialogContextValue = { size: DialogSize }\nconst DialogContext = React.createContext<DialogContextValue>({ size: 'md' })\n\nexport type DialogProps = React.ComponentProps<typeof DialogPrimitive.Root> & {\n /**\n * Dialog width. `full` fills the whole viewport.\n * @default 'md'\n */\n size?: DialogSize\n /**\n * When `false`, clicking outside and pressing Esc no longer close the dialog. The close button and `DialogClose` still work.\n * @default true\n */\n dismissible?: boolean\n}\nexport type DialogTriggerProps = AsChildPrimitiveProps<typeof DialogPrimitive.Trigger>\nexport type DialogPortalProps = React.ComponentProps<typeof DialogPrimitive.Portal>\nexport type DialogCloseProps = AsChildPrimitiveProps<typeof DialogPrimitive.Close>\nexport type DialogOverlayProps = AsChildPrimitiveProps<typeof DialogPrimitive.Backdrop>\nexport type DialogContentProps = AsChildPrimitiveProps<typeof DialogPrimitive.Popup> &\n Pick<DialogPortalProps, 'keepMounted'> & {\n /**\n * Shows the X button in the top-right corner.\n * @default true\n */\n showCloseButton?: boolean\n /** Ref to the overlay element rendered behind the dialog. */\n overlayRef?: React.Ref<HTMLDivElement>\n /** Props passed to the overlay rendered behind the dialog. */\n overlayProps?: DialogOverlayProps\n }\nexport type DialogHeaderProps = React.ComponentProps<'div'>\nexport type DialogBodyProps = React.ComponentProps<'div'>\nexport type DialogFooterProps = React.ComponentProps<'div'> & {\n /**\n * Adds an outline \"Close\" button after the footer actions.\n * @default false\n */\n showCloseButton?: boolean\n}\nexport type DialogTitleProps = AsChildPrimitiveProps<typeof DialogPrimitive.Title>\nexport type DialogDescriptionProps = AsChildPrimitiveProps<typeof DialogPrimitive.Description>\n\nfunction Dialog({ size = 'md', dismissible = true, disablePointerDismissal, onOpenChange, ...props }: DialogProps) {\n const contextValue = React.useMemo<DialogContextValue>(() => ({ size }), [size])\n\n return (\n <DialogContext.Provider value={contextValue}>\n <DialogPrimitive.Root\n data-slot=\"dialog\"\n disablePointerDismissal={!dismissible || disablePointerDismissal}\n onOpenChange={(open, eventDetails) => {\n if (!dismissible && eventDetails.reason === 'escape-key') {\n eventDetails.cancel()\n return\n }\n onOpenChange?.(open, eventDetails)\n }}\n {...props}\n />\n </DialogContext.Provider>\n )\n}\n\nfunction DialogTrigger({ asChild, children, ...props }: DialogTriggerProps) {\n return <DialogPrimitive.Trigger data-slot=\"dialog-trigger\" {...props} {...toAsChildRenderProps(asChild, children)} />\n}\n\nfunction DialogPortal({ ...props }: DialogPortalProps) {\n return <DialogPrimitive.Portal data-slot=\"dialog-portal\" {...props} />\n}\n\nfunction DialogClose({ asChild, children, ...props }: DialogCloseProps) {\n return <DialogPrimitive.Close data-slot=\"dialog-close\" {...props} {...toAsChildRenderProps(asChild, children)} />\n}\n\nfunction DialogOverlay({ className, onClick, forceRender = true, asChild, children, ...props }: DialogOverlayProps) {\n return (\n <DialogPrimitive.Backdrop\n data-slot=\"dialog-overlay\"\n forceRender={forceRender}\n className={(state) =>\n cn(\n 'bg-black/10 fixed inset-0 isolate z-50',\n 'data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0',\n 'duration-100 supports-backdrop-filter:backdrop-blur-xs',\n resolveClassName(className, state)\n )\n }\n onClick={stopPropagationHandler(onClick)}\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n )\n}\n\nfunction DialogContent({\n className,\n children,\n showCloseButton = true,\n overlayRef,\n overlayProps,\n keepMounted,\n asChild,\n ...props\n}: DialogContentProps) {\n const { size } = React.useContext(DialogContext)\n\n return (\n <DialogPortal keepMounted={keepMounted}>\n <DialogOverlay {...overlayProps} ref={overlayRef ?? overlayProps?.ref} />\n <DialogPrimitive.Popup\n data-slot=\"dialog-content\"\n className={(state) => cn(dialogContentVariants({ size }), resolveClassName(className, state))}\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n // React events bubble through the fiber tree, not the DOM, so a portaled Popup still\n // reaches any ancestor's onClick/onSubmit even though it renders outside it in the DOM.\n onClick={stopPropagationHandler(props.onClick)}\n onSubmit={stopPropagationHandler(props.onSubmit)}\n >\n {!asChild && children}\n {showCloseButton && !asChild && (\n <DialogPrimitive.Close\n data-slot=\"dialog-close\"\n render={<Button variant=\"ghost\" className=\"absolute top-2 right-2\" size=\"icon-sm\" />}\n >\n <IconX />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n )}\n </DialogPrimitive.Popup>\n </DialogPortal>\n )\n}\n\nfunction DialogHeader({ className, ...props }: DialogHeaderProps) {\n return <div data-slot=\"dialog-header\" className={cn('gap-2 flex flex-col shrink-0', className)} {...props} />\n}\n\nfunction DialogBody({ className, ...props }: DialogBodyProps) {\n return <div data-slot=\"dialog-body\" className={cn('-mx-4 px-4 flex-1 overflow-y-auto', className)} {...props} />\n}\n\nfunction DialogFooter({ className, showCloseButton = false, children, ...props }: DialogFooterProps) {\n return (\n <div\n data-slot=\"dialog-footer\"\n className={cn(\n 'bg-muted/50 -mx-4 -mb-4 rounded-b-xl border-t p-4 shrink-0',\n 'flex flex-col-reverse gap-2 sm:flex-row sm:justify-end',\n className\n )}\n {...props}\n >\n {children}\n {showCloseButton && <DialogPrimitive.Close render={<Button variant=\"outline\" />}>Close</DialogPrimitive.Close>}\n </div>\n )\n}\n\nfunction DialogTitle({ className, asChild, children, ...props }: DialogTitleProps) {\n return (\n <DialogPrimitive.Title\n data-slot=\"dialog-title\"\n className={(state) => cn('text-base leading-none font-medium', resolveClassName(className, state))}\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n )\n}\n\nfunction DialogDescription({ className, asChild, children, ...props }: DialogDescriptionProps) {\n return (\n <DialogPrimitive.Description\n data-slot=\"dialog-description\"\n className={(state) =>\n cn(\n 'text-muted-foreground text-sm',\n '*:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground',\n resolveClassName(className, state)\n )\n }\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n )\n}\n\nexport {\n Dialog,\n DialogBody,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger\n}\n"],"mappings":"A,kdAWA,MAAMI,EAAwBC,EAC5B,CACE,qHACA,iEACA,oEACA,sIACF,EACA,CACE,SAAU,CACR,KAAM,CACJ,GAAI,cACJ,GAAI,cACJ,GAAI,cACJ,GAAI,cACJ,MAAO,eACP,MAAO,eACP,KAAM,sEACR,CACF,EACA,gBAAiB,CACf,KAAM,IACR,CACF,CACF,EAIMC,EAAgBJ,EAAM,cAAkC,CAAE,KAAM,IAAK,CAAC,EA0C5E,SAAS,OAAO,CAAE,OAAO,KAAM,cAAc,GAAM,0BAAyB,eAAc,GAAGK,GAAsB,CACjH,IAAMC,EAAeN,EAAM,aAAmC,CAAE,MAAK,GAAI,CAACO,CAAI,CAAC,EAE/E,MACE,kBAACH,EAAc,SAAf,CAAwB,MAAOE,EAC7B,SAAA,kBAACR,EAAgB,KAAjB,CACE,YAAU,SACV,wBAAyB,CAACU,GAAeC,EACzC,cAAe,EAAM,IAAiB,CAChC,CAACD,GAAeE,EAAa,SAAW,aAC1CA,EAAa,OAAO,EAGtBC,IAAeC,EAAMF,CAAY,CACnC,EACA,GAAIL,CACL,CAAA,CACqB,CAAA,CAE5B,CAEA,SAAS,cAAc,CAAE,UAAS,WAAU,GAAGA,GAA6B,CAC1E,MAAO,kBAACP,EAAgB,QAAjB,CAAyB,YAAU,iBAA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nC,EAEF,GAAIb,EACJ,GAAIQ,EAAqBC,EAASC,CAAQ,CAC3C,CAAA,CAEL,C"}
@@ -1,7 +1,5 @@
1
1
  import { t as __name } from "../rolldown-runtime-BhWHdk3m.js";
2
2
  import { DirectionProvider, TextDirection, useDirection } from "@base-ui/react/direction-provider";
3
- //#region src/components/direction.d.ts
4
3
  export type DirectionProviderProps = DirectionProvider.Props;
5
- //#endregion
6
4
  export { DirectionProvider, type TextDirection, useDirection };
7
5
  //# sourceMappingURL=direction.d.ts.map
@@ -1,7 +1,6 @@
1
1
  import { t as __name } from "../rolldown-runtime-BhWHdk3m.js";
2
2
  import { PieChartProps } from "./pie-chart.js";
3
3
  import * as React from "react";
4
- //#region src/components/donut-chart.d.ts
5
4
  export type DonutChartProps = PieChartProps & {
6
5
  /**
7
6
  * Ring width as a fraction of the radius.
@@ -20,6 +19,5 @@ export type DonutChartProps = PieChartProps & {
20
19
  totalLabel?: React.ReactNode;
21
20
  };
22
21
  declare function DonutChart({ className, thickness, outerRadius, withTotal, totalLabel, data, ...props }: DonutChartProps): React.JSX.Element;
23
- //#endregion
24
22
  export { DonutChart };
25
23
  //# sourceMappingURL=donut-chart.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"donut-chart.js","names":["React","props","innerRadius","ratio","thickness","outerRadius","match","total","data","sum","item","PieChartBase","cn","className","withTotal","Label","viewBox","totalLabel"],"sources":["../../src/components/donut-chart.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { Label } from 'recharts'\n\nimport { cn } from '../lib/utils'\nimport { PieChartBase, type PieChartProps } from './pie-chart'\n\nexport type DonutChartProps = PieChartProps & {\n /**\n * Ring width as a fraction of the radius.\n * @default 0.35\n */\n thickness?: number\n /**\n * Shows the sum of the values in the center.\n * @default false\n */\n withTotal?: boolean\n /**\n * Label below the total.\n * @default 'Total'\n */\n totalLabel?: React.ReactNode\n}\n\nfunction DonutChart({\n className,\n thickness = 0.35,\n outerRadius = '80%',\n withTotal = false,\n totalLabel = 'Total',\n data,\n ...props\n}: DonutChartProps) {\n const innerRadius = React.useMemo(() => {\n const ratio = Math.min(Math.max(1 - thickness, 0), 1)\n if (typeof outerRadius === 'number') {\n return outerRadius * ratio\n }\n const match = /^(\\d+(?:\\.\\d+)?)%$/.exec(outerRadius)\n if (match) {\n return `${Number(match[1]) * ratio}%`\n }\n return outerRadius\n }, [outerRadius, thickness])\n\n const total = React.useMemo(() => data.reduce((sum, item) => sum + item.value, 0), [data])\n\n return (\n <PieChartBase\n dataSlot=\"donut-chart\"\n className={cn(className)}\n data={data}\n outerRadius={outerRadius}\n innerRadius={innerRadius}\n centerSlot={\n withTotal ? (\n <Label\n content={({ viewBox }) => {\n if (!viewBox || !('cx' in viewBox) || !('cy' in viewBox)) {\n return null\n }\n return (\n <text x={viewBox.cx} y={viewBox.cy} textAnchor=\"middle\" dominantBaseline=\"middle\">\n <tspan x={viewBox.cx} y={viewBox.cy} className=\"fill-foreground font-medium text-2xl tabular-nums\">\n {total.toLocaleString()}\n </tspan>\n <tspan x={viewBox.cx} y={(viewBox.cy ?? 0) + 20} className=\"fill-muted-foreground text-xs\">\n {totalLabel}\n </tspan>\n </text>\n )\n }}\n />\n ) : null\n }\n {...props}\n />\n )\n}\n\nexport { DonutChart }\n"],"mappings":"sOAyBA,SAAS,WAAW,CAClB,YACA,YAAY,IACZ,cAAc,MACd,YAAY,GACZ,aAAa,QACb,OACA,GAAGC,GACe,CAClB,IAAMC,EAAcF,EAAM,YAAc,CACtC,IAAMG,EAAQ,KAAK,IAAI,KAAK,IAAI,EAAIC,EAAW,CAAC,EAAG,CAAC,EACpD,GAAI,OAAOC,GAAgB,SACzB,OAAOA,EAAcF,EAEvB,IAAMG,EAAQ,qBAAqB,KAAKD,CAAW,EAInD,OAHIC,EACK,GAAG,OAAOA,EAAM,EAAE,EAAIH,EAAM,GAE9BE,CACT,EAAG,CAACA,EAAaD,CAAS,CAAC,EAErBG,EAAQP,EAAM,YAAcQ,EAAK,QAAQ,EAAK,IAASC,EAAMC,EAAK,MAAO,CAAC,EAAG,CAACF,CAAI,CAAC,EAEzF,MACE,kBAACG,EAAD,CACE,SAAS,cACT,UAAWC,EAAGC,CAAS,EACjB,OACO,cACA,cACb,WACEC,EACE,kBAACC,EAAD,CACE,SAAU,CAAE,aACN,CAACC,GAAW,EAAE,OAAQA,IAAY,EAAE,OAAQA,GACvC,KAGP,kBAAC,OAAD,CAAM,EAAGA,EAAQ,GAAI,EAAGA,EAAQ,GAAI,WAAW,SAAS,iBAAiB,SAAzE,SAAA,CACE,kBAAC,QAAD,CAAO,EAAGA,EAAQ,GAAI,EAAGA,EAAQ,GAAI,UAAU,oDAC5C,SAAAT,EAAM,eAAe,CACjB,CAAA,EACP,kBAAC,QAAD,CAAO,EAAGS,EAAQ,GAAI,GAAIA,EAAQ,IAAM,GAAK,GAAI,UAAU,gCACxD,SAAAC,CACI,CAAA,CACH,GAGX,CAAA,EACC,KAEN,GAAIhB,CACL,CAAA,CAEL"}
1
+ {"version":3,"file":"donut-chart.js","names":["React","props","innerRadius","ratio","thickness","outerRadius","match","total","data","sum","item","PieChartBase","cn","className","withTotal","Label","viewBox","totalLabel"],"sources":["../../src/components/donut-chart.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { Label } from 'recharts'\n\nimport { cn } from '../lib/utils'\nimport { PieChartBase, type PieChartProps } from './pie-chart'\n\nexport type DonutChartProps = PieChartProps & {\n /**\n * Ring width as a fraction of the radius.\n * @default 0.35\n */\n thickness?: number\n /**\n * Shows the sum of the values in the center.\n * @default false\n */\n withTotal?: boolean\n /**\n * Label below the total.\n * @default 'Total'\n */\n totalLabel?: React.ReactNode\n}\n\nfunction DonutChart({\n className,\n thickness = 0.35,\n outerRadius = '80%',\n withTotal = false,\n totalLabel = 'Total',\n data,\n ...props\n}: DonutChartProps) {\n const innerRadius = React.useMemo(() => {\n const ratio = Math.min(Math.max(1 - thickness, 0), 1)\n if (typeof outerRadius === 'number') {\n return outerRadius * ratio\n }\n const match = /^(\\d+(?:\\.\\d+)?)%$/.exec(outerRadius)\n if (match) {\n return `${Number(match[1]) * ratio}%`\n }\n return outerRadius\n }, [outerRadius, thickness])\n\n const total = React.useMemo(() => data.reduce((sum, item) => sum + item.value, 0), [data])\n\n return (\n <PieChartBase\n dataSlot=\"donut-chart\"\n className={cn(className)}\n data={data}\n outerRadius={outerRadius}\n innerRadius={innerRadius}\n centerSlot={\n withTotal ? (\n <Label\n content={({ viewBox }) => {\n if (!viewBox || !('cx' in viewBox) || !('cy' in viewBox)) {\n return null\n }\n return (\n <text x={viewBox.cx} y={viewBox.cy} textAnchor=\"middle\" dominantBaseline=\"middle\">\n <tspan x={viewBox.cx} y={viewBox.cy} className=\"fill-foreground font-medium text-2xl tabular-nums\">\n {total.toLocaleString()}\n </tspan>\n <tspan x={viewBox.cx} y={(viewBox.cy ?? 0) + 20} className=\"fill-muted-foreground text-xs\">\n {totalLabel}\n </tspan>\n </text>\n )\n }}\n />\n ) : null\n }\n {...props}\n />\n )\n}\n\nexport { DonutChart }\n"],"mappings":"A,sOAyBA,SAAS,WAAW,CAClB,YACA,YAAY,IACZ,cAAc,MACd,YAAY,GACZ,aAAa,QACb,OACA,GAAGC,GACe,CAClB,IAAMC,EAAcF,EAAM,YAAc,CACtC,IAAMG,EAAQ,KAAK,IAAI,KAAK,IAAI,EAAIC,EAAW,CAAC,EAAG,CAAC,EACpD,GAAI,OAAOC,GAAgB,SACzB,OAAOA,EAAcF,EAEvB,IAAMG,EAAQ,qBAAqB,KAAKD,CAAW,EAInD,OAHIC,EACK,GAAG,OAAOA,EAAM,EAAE,EAAIH,EAAM,GAE9BE,CACT,EAAG,CAACA,EAAaD,CAAS,CAAC,EAErBG,EAAQP,EAAM,YAAcQ,EAAK,QAAQ,EAAK,IAASC,EAAMC,EAAK,MAAO,CAAC,EAAG,CAACF,CAAI,CAAC,EAEzF,MACE,kBAACG,EAAD,CACE,SAAS,cACT,UAAWC,EAAGC,CAAS,EACjB,OACO,cACA,cACb,WACEC,EACE,kBAACC,EAAD,CACE,SAAU,CAAE,aACN,CAACC,GAAW,EAAE,OAAQA,IAAY,EAAE,OAAQA,GACvC,KAGP,kBAAC,OAAD,CAAM,EAAGA,EAAQ,GAAI,EAAGA,EAAQ,GAAI,WAAW,SAAS,iBAAiB,SAAzE,SAAA,CACE,kBAAC,QAAD,CAAO,EAAGA,EAAQ,GAAI,EAAGA,EAAQ,GAAI,UAAU,oDAC5C,SAAAT,EAAM,eAAe,CACjB,CAAA,EACP,kBAAC,QAAD,CAAO,EAAGS,EAAQ,GAAI,GAAIA,EAAQ,IAAM,GAAK,GAAI,UAAU,gCACxD,SAAAC,CACI,CAAA,CACH,C,EAGX,CAAA,EACC,KAEN,GAAIhB,CACL,CAAA,CAEL,C"}
@@ -1,9 +1,8 @@
1
1
  import { t as __name } from "../rolldown-runtime-BhWHdk3m.js";
2
- import { t as AsChildPrimitiveProps } from "../as-child-Dxg3Xo1G.js";
2
+ import { t as AsChildPrimitiveProps } from "../as-child-T9W73ZYU.js";
3
3
  import * as React from "react";
4
4
  import { VariantProps } from "class-variance-authority";
5
5
  import { Dialog } from "@base-ui/react/dialog";
6
- //#region src/components/drawer.d.ts
7
6
  declare const drawerContentVariants: (props?: ({
8
7
  direction?: "bottom" | "left" | "right" | "top" | null | undefined;
9
8
  size?: "2xl" | "3xl" | "full" | "lg" | "md" | "sm" | "xl" | null | undefined;
@@ -56,6 +55,5 @@ declare function DrawerBody({ className, ...props }: DrawerBodyProps): React.JSX
56
55
  declare function DrawerFooter({ className, ...props }: DrawerFooterProps): React.JSX.Element;
57
56
  declare function DrawerTitle({ className, asChild, children, ...props }: DrawerTitleProps): React.JSX.Element;
58
57
  declare function DrawerDescription({ className, asChild, children, ...props }: DrawerDescriptionProps): React.JSX.Element;
59
- //#endregion
60
58
  export { Drawer, DrawerBody, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger };
61
59
  //# sourceMappingURL=drawer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"drawer.js","names":["DrawerPrimitive","resolveClassName","React","drawerContentVariants","cva","DrawerContext","props","contextValue","size","direction","Dialog","dismissible","disablePointerDismissal","eventDetails","onOpenChange","open","toAsChildRenderProps","asChild","children","cn","className","state","stopPropagationHandler","onClick","overlayProps","showCloseButton","Button","IconX"],"sources":["../../src/components/drawer.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { Dialog as DrawerPrimitive } from '@base-ui/react/dialog'\nimport { IconX } from '@tabler/icons-react'\nimport { cva, type VariantProps } from 'class-variance-authority'\n\nimport { type AsChildPrimitiveProps, toAsChildRenderProps } from '../lib/as-child'\nimport { cn, stopPropagationHandler } from '../lib/utils'\nimport { resolveClassName } from '../utils/resolve-class-name'\nimport { Button } from './button'\n\nconst drawerContentVariants = cva(\n [\n 'bg-background flex h-auto flex-col text-sm fixed z-50 outline-none duration-200',\n 'data-open:animate-in data-closed:animate-out'\n ],\n {\n variants: {\n direction: {\n top: 'inset-x-0 top-0 rounded-b-xl border-b data-closed:slide-out-to-top data-open:slide-in-from-top-10',\n right:\n 'inset-y-0 right-0 rounded-l-xl border-l data-closed:slide-out-to-right data-open:slide-in-from-right-10',\n bottom:\n 'inset-x-0 bottom-0 rounded-t-xl border-t data-closed:slide-out-to-bottom data-open:slide-in-from-bottom-10',\n left: 'inset-y-0 left-0 rounded-r-xl border-r data-closed:slide-out-to-left data-open:slide-in-from-left-10'\n },\n size: {\n sm: '',\n md: '',\n lg: '',\n xl: '',\n '2xl': '',\n '3xl': '',\n full: ''\n }\n },\n compoundVariants: [\n { direction: ['left', 'right'], size: 'sm', className: 'w-3/4 sm:max-w-sm' },\n { direction: ['left', 'right'], size: 'md', className: 'w-4/5 sm:max-w-md' },\n { direction: ['left', 'right'], size: 'lg', className: 'w-[90%] sm:max-w-lg' },\n { direction: ['left', 'right'], size: 'xl', className: 'w-[90%] sm:max-w-195' },\n { direction: ['left', 'right'], size: '2xl', className: 'w-[90%] sm:max-w-240' },\n { direction: ['left', 'right'], size: '3xl', className: 'w-[90%] sm:max-w-300' },\n { direction: ['left', 'right'], size: 'full', className: 'w-full' },\n { direction: 'top', size: 'sm', className: 'mb-24 h-full max-h-96' },\n { direction: 'top', size: 'md', className: 'mb-20 h-full max-h-112' },\n { direction: 'top', size: 'lg', className: 'mb-12 h-full max-h-128' },\n { direction: 'top', size: 'xl', className: 'mb-12 h-full max-h-195' },\n { direction: 'top', size: '2xl', className: 'mb-12 h-full max-h-240' },\n { direction: 'top', size: '3xl', className: 'mb-12 h-full max-h-300' },\n { direction: 'top', size: 'full', className: 'mb-0 h-full' },\n { direction: 'bottom', size: 'sm', className: 'mt-24 h-full max-h-96' },\n { direction: 'bottom', size: 'md', className: 'mt-20 h-full max-h-112' },\n { direction: 'bottom', size: 'lg', className: 'mt-12 h-full max-h-128' },\n { direction: 'bottom', size: 'xl', className: 'mt-12 h-full max-h-195' },\n { direction: 'bottom', size: '2xl', className: 'mt-12 h-full max-h-240' },\n { direction: 'bottom', size: '3xl', className: 'mt-12 h-full max-h-300' },\n { direction: 'bottom', size: 'full', className: 'mt-0 h-full' }\n ],\n defaultVariants: {\n direction: 'right',\n size: 'md'\n }\n }\n)\n\ntype DrawerDirection = NonNullable<VariantProps<typeof drawerContentVariants>['direction']>\ntype DrawerSize = NonNullable<VariantProps<typeof drawerContentVariants>['size']>\ntype DrawerContextValue = { size: DrawerSize; direction: DrawerDirection }\nconst DrawerContext = React.createContext<DrawerContextValue>({ size: 'md', direction: 'right' })\n\nexport type DrawerProps = React.ComponentProps<typeof DrawerPrimitive.Root> & {\n /**\n * Panel width for `left`/`right`, or height for `top`/`bottom`. `full` fills the whole viewport.\n * @default 'md'\n */\n size?: DrawerSize\n /**\n * Edge the drawer slides in from.\n * @default 'right'\n */\n direction?: DrawerDirection\n /**\n * When `false`, clicking outside and pressing Esc no longer close the drawer. The close button and `DrawerClose` still work.\n * @default true\n */\n dismissible?: boolean\n}\nexport type DrawerTriggerProps = AsChildPrimitiveProps<typeof DrawerPrimitive.Trigger>\nexport type DrawerPortalProps = React.ComponentProps<typeof DrawerPrimitive.Portal>\nexport type DrawerCloseProps = AsChildPrimitiveProps<typeof DrawerPrimitive.Close>\nexport type DrawerOverlayProps = AsChildPrimitiveProps<typeof DrawerPrimitive.Backdrop>\nexport type DrawerContentProps = AsChildPrimitiveProps<typeof DrawerPrimitive.Popup> &\n Pick<DrawerPortalProps, 'keepMounted'> & {\n /**\n * Shows the X button in the top-right corner.\n * @default true\n */\n showCloseButton?: boolean\n /** Props passed to the overlay rendered behind the drawer. */\n overlayProps?: DrawerOverlayProps\n }\nexport type DrawerHeaderProps = React.ComponentProps<'div'>\nexport type DrawerBodyProps = React.ComponentProps<'div'>\nexport type DrawerFooterProps = React.ComponentProps<'div'>\nexport type DrawerTitleProps = AsChildPrimitiveProps<typeof DrawerPrimitive.Title>\nexport type DrawerDescriptionProps = AsChildPrimitiveProps<typeof DrawerPrimitive.Description>\n\nfunction Drawer({\n size = 'md',\n direction = 'right',\n dismissible = true,\n disablePointerDismissal,\n onOpenChange,\n ...props\n}: DrawerProps) {\n const contextValue = React.useMemo<DrawerContextValue>(() => ({ size, direction }), [size, direction])\n\n return (\n <DrawerContext.Provider value={contextValue}>\n <DrawerPrimitive.Root\n data-slot=\"drawer\"\n disablePointerDismissal={!dismissible || disablePointerDismissal}\n onOpenChange={(open, eventDetails) => {\n if (!dismissible && eventDetails.reason === 'escape-key') {\n eventDetails.cancel()\n return\n }\n onOpenChange?.(open, eventDetails)\n }}\n {...props}\n />\n </DrawerContext.Provider>\n )\n}\n\nfunction DrawerTrigger({ asChild, children, ...props }: DrawerTriggerProps) {\n return <DrawerPrimitive.Trigger data-slot=\"drawer-trigger\" {...props} {...toAsChildRenderProps(asChild, children)} />\n}\n\nfunction DrawerPortal({ ...props }: DrawerPortalProps) {\n return <DrawerPrimitive.Portal data-slot=\"drawer-portal\" {...props} />\n}\n\nfunction DrawerClose({ asChild, children, ...props }: DrawerCloseProps) {\n return <DrawerPrimitive.Close data-slot=\"drawer-close\" {...props} {...toAsChildRenderProps(asChild, children)} />\n}\n\nfunction DrawerOverlay({ className, onClick, forceRender = true, asChild, children, ...props }: DrawerOverlayProps) {\n return (\n <DrawerPrimitive.Backdrop\n data-slot=\"drawer-overlay\"\n forceRender={forceRender}\n className={(state) =>\n cn(\n 'bg-black/10 fixed inset-0 z-50 duration-200',\n 'data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0',\n 'supports-backdrop-filter:backdrop-blur-xs',\n resolveClassName(className, state)\n )\n }\n onClick={stopPropagationHandler(onClick)}\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n )\n}\n\nfunction DrawerContent({\n className,\n children,\n showCloseButton = true,\n overlayProps,\n keepMounted,\n asChild,\n ...props\n}: DrawerContentProps) {\n const { size, direction } = React.useContext(DrawerContext)\n\n return (\n <DrawerPortal keepMounted={keepMounted}>\n <DrawerOverlay {...overlayProps} />\n <DrawerPrimitive.Popup\n data-slot=\"drawer-content\"\n className={(state) => cn(drawerContentVariants({ size, direction }), resolveClassName(className, state))}\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n // React events bubble through the fiber tree, not the DOM, so a portaled Popup still\n // reaches any ancestor's onClick/onSubmit even though it renders outside it in the DOM.\n onClick={stopPropagationHandler(props.onClick)}\n onSubmit={stopPropagationHandler(props.onSubmit)}\n >\n {!asChild && children}\n {showCloseButton && !asChild && (\n <DrawerPrimitive.Close\n data-slot=\"drawer-close\"\n render={<Button variant=\"ghost\" className=\"absolute top-3 right-3\" size=\"icon-sm\" />}\n >\n <IconX />\n <span className=\"sr-only\">Close</span>\n </DrawerPrimitive.Close>\n )}\n </DrawerPrimitive.Popup>\n </DrawerPortal>\n )\n}\n\nfunction DrawerHeader({ className, ...props }: DrawerHeaderProps) {\n const { direction } = React.useContext(DrawerContext)\n const isVertical = direction === 'top' || direction === 'bottom'\n\n return (\n <div\n data-slot=\"drawer-header\"\n className={cn('p-4 flex flex-col gap-0.5 md:gap-0.5', isVertical && 'text-center md:text-left', className)}\n {...props}\n />\n )\n}\n\nfunction DrawerBody({ className, ...props }: DrawerBodyProps) {\n return (\n <div data-slot=\"drawer-body\" className={cn('px-4 pb-4 flex-1 min-h-0 overflow-y-auto', className)} {...props} />\n )\n}\n\nfunction DrawerFooter({ className, ...props }: DrawerFooterProps) {\n return (\n <div\n data-slot=\"drawer-footer\"\n className={cn('gap-2 p-4 mt-auto flex flex-col sm:flex-row sm:justify-end', className)}\n {...props}\n />\n )\n}\n\nfunction DrawerTitle({ className, asChild, children, ...props }: DrawerTitleProps) {\n return (\n <DrawerPrimitive.Title\n data-slot=\"drawer-title\"\n className={(state) => cn('text-foreground text-base font-medium', resolveClassName(className, state))}\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n )\n}\n\nfunction DrawerDescription({ className, asChild, children, ...props }: DrawerDescriptionProps) {\n return (\n <DrawerPrimitive.Description\n data-slot=\"drawer-description\"\n className={(state) => cn('text-muted-foreground text-sm', resolveClassName(className, state))}\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n )\n}\n\nexport {\n Drawer,\n DrawerBody,\n DrawerClose,\n DrawerContent,\n DrawerDescription,\n DrawerFooter,\n DrawerHeader,\n DrawerOverlay,\n DrawerPortal,\n DrawerTitle,\n DrawerTrigger\n}\n"],"mappings":"kdAWA,MAAMG,EAAwBC,EAC5B,CACE,kFACA,8CACF,EACA,CACE,SAAU,CACR,UAAW,CACT,IAAK,oGACL,MACE,0GACF,OACE,6GACF,KAAM,sGACR,EACA,KAAM,CACJ,GAAI,GACJ,GAAI,GACJ,GAAI,GACJ,GAAI,GACJ,MAAO,GACP,MAAO,GACP,KAAM,EACR,CACF,EACA,iBAAkB,CAChB,CAAE,UAAW,CAAC,OAAQ,OAAO,EAAG,KAAM,KAAM,UAAW,mBAAoB,EAC3E,CAAE,UAAW,CAAC,OAAQ,OAAO,EAAG,KAAM,KAAM,UAAW,m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,CAAE,YAAW,UAAS,WAAU,GAAGA,GAA2B,CACjF,MACE,kBAACN,EAAgB,MAAjB,CACE,YAAU,eACV,UAAY,GAAUmB,EAAG,wCAAyClB,EAAiBmB,EAAWC,CAAK,CAAC,EACpG,GAAIf,EACJ,GAAIU,EAAqBC,EAASC,CAAQ,CAC3C,CAAA,CAEL,CAEA,SAAS,kBAAkB,CAAE,YAAW,UAAS,WAAU,GAAGZ,GAAiC,CAC7F,MACE,kBAACN,EAAgB,YAAjB,CACE,YAAU,qBACV,UAAY,GAAUmB,EAAG,gCAAiClB,EAAiBmB,EAAWC,CAAK,CAAC,EAC5F,GAAIf,EACJ,GAAIU,EAAqBC,EAASC,CAAQ,CAC3C,CAAA,CAEL"}
1
+ {"version":3,"file":"drawer.js","names":["DrawerPrimitive","resolveClassName","React","drawerContentVariants","cva","DrawerContext","props","contextValue","size","direction","Dialog","dismissible","disablePointerDismissal","eventDetails","onOpenChange","open","toAsChildRenderProps","asChild","children","cn","className","state","stopPropagationHandler","onClick","overlayProps","showCloseButton","Button","IconX"],"sources":["../../src/components/drawer.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { Dialog as DrawerPrimitive } from '@base-ui/react/dialog'\nimport { IconX } from '@tabler/icons-react'\nimport { cva, type VariantProps } from 'class-variance-authority'\n\nimport { type AsChildPrimitiveProps, toAsChildRenderProps } from '../lib/as-child'\nimport { cn, stopPropagationHandler } from '../lib/utils'\nimport { resolveClassName } from '../utils/resolve-class-name'\nimport { Button } from './button'\n\nconst drawerContentVariants = cva(\n [\n 'bg-background flex h-auto flex-col text-sm fixed z-50 outline-none duration-200',\n 'data-open:animate-in data-closed:animate-out'\n ],\n {\n variants: {\n direction: {\n top: 'inset-x-0 top-0 rounded-b-xl border-b data-closed:slide-out-to-top data-open:slide-in-from-top-10',\n right:\n 'inset-y-0 right-0 rounded-l-xl border-l data-closed:slide-out-to-right data-open:slide-in-from-right-10',\n bottom:\n 'inset-x-0 bottom-0 rounded-t-xl border-t data-closed:slide-out-to-bottom data-open:slide-in-from-bottom-10',\n left: 'inset-y-0 left-0 rounded-r-xl border-r data-closed:slide-out-to-left data-open:slide-in-from-left-10'\n },\n size: {\n sm: '',\n md: '',\n lg: '',\n xl: '',\n '2xl': '',\n '3xl': '',\n full: ''\n }\n },\n compoundVariants: [\n { direction: ['left', 'right'], size: 'sm', className: 'w-3/4 sm:max-w-sm' },\n { direction: ['left', 'right'], size: 'md', className: 'w-4/5 sm:max-w-md' },\n { direction: ['left', 'right'], size: 'lg', className: 'w-[90%] sm:max-w-lg' },\n { direction: ['left', 'right'], size: 'xl', className: 'w-[90%] sm:max-w-195' },\n { direction: ['left', 'right'], size: '2xl', className: 'w-[90%] sm:max-w-240' },\n { direction: ['left', 'right'], size: '3xl', className: 'w-[90%] sm:max-w-300' },\n { direction: ['left', 'right'], size: 'full', className: 'w-full' },\n { direction: 'top', size: 'sm', className: 'mb-24 h-full max-h-96' },\n { direction: 'top', size: 'md', className: 'mb-20 h-full max-h-112' },\n { direction: 'top', size: 'lg', className: 'mb-12 h-full max-h-128' },\n { direction: 'top', size: 'xl', className: 'mb-12 h-full max-h-195' },\n { direction: 'top', size: '2xl', className: 'mb-12 h-full max-h-240' },\n { direction: 'top', size: '3xl', className: 'mb-12 h-full max-h-300' },\n { direction: 'top', size: 'full', className: 'mb-0 h-full' },\n { direction: 'bottom', size: 'sm', className: 'mt-24 h-full max-h-96' },\n { direction: 'bottom', size: 'md', className: 'mt-20 h-full max-h-112' },\n { direction: 'bottom', size: 'lg', className: 'mt-12 h-full max-h-128' },\n { direction: 'bottom', size: 'xl', className: 'mt-12 h-full max-h-195' },\n { direction: 'bottom', size: '2xl', className: 'mt-12 h-full max-h-240' },\n { direction: 'bottom', size: '3xl', className: 'mt-12 h-full max-h-300' },\n { direction: 'bottom', size: 'full', className: 'mt-0 h-full' }\n ],\n defaultVariants: {\n direction: 'right',\n size: 'md'\n }\n }\n)\n\ntype DrawerDirection = NonNullable<VariantProps<typeof drawerContentVariants>['direction']>\ntype DrawerSize = NonNullable<VariantProps<typeof drawerContentVariants>['size']>\ntype DrawerContextValue = { size: DrawerSize; direction: DrawerDirection }\nconst DrawerContext = React.createContext<DrawerContextValue>({ size: 'md', direction: 'right' })\n\nexport type DrawerProps = React.ComponentProps<typeof DrawerPrimitive.Root> & {\n /**\n * Panel width for `left`/`right`, or height for `top`/`bottom`. `full` fills the whole viewport.\n * @default 'md'\n */\n size?: DrawerSize\n /**\n * Edge the drawer slides in from.\n * @default 'right'\n */\n direction?: DrawerDirection\n /**\n * When `false`, clicking outside and pressing Esc no longer close the drawer. The close button and `DrawerClose` still work.\n * @default true\n */\n dismissible?: boolean\n}\nexport type DrawerTriggerProps = AsChildPrimitiveProps<typeof DrawerPrimitive.Trigger>\nexport type DrawerPortalProps = React.ComponentProps<typeof DrawerPrimitive.Portal>\nexport type DrawerCloseProps = AsChildPrimitiveProps<typeof DrawerPrimitive.Close>\nexport type DrawerOverlayProps = AsChildPrimitiveProps<typeof DrawerPrimitive.Backdrop>\nexport type DrawerContentProps = AsChildPrimitiveProps<typeof DrawerPrimitive.Popup> &\n Pick<DrawerPortalProps, 'keepMounted'> & {\n /**\n * Shows the X button in the top-right corner.\n * @default true\n */\n showCloseButton?: boolean\n /** Props passed to the overlay rendered behind the drawer. */\n overlayProps?: DrawerOverlayProps\n }\nexport type DrawerHeaderProps = React.ComponentProps<'div'>\nexport type DrawerBodyProps = React.ComponentProps<'div'>\nexport type DrawerFooterProps = React.ComponentProps<'div'>\nexport type DrawerTitleProps = AsChildPrimitiveProps<typeof DrawerPrimitive.Title>\nexport type DrawerDescriptionProps = AsChildPrimitiveProps<typeof DrawerPrimitive.Description>\n\nfunction Drawer({\n size = 'md',\n direction = 'right',\n dismissible = true,\n disablePointerDismissal,\n onOpenChange,\n ...props\n}: DrawerProps) {\n const contextValue = React.useMemo<DrawerContextValue>(() => ({ size, direction }), [size, direction])\n\n return (\n <DrawerContext.Provider value={contextValue}>\n <DrawerPrimitive.Root\n data-slot=\"drawer\"\n disablePointerDismissal={!dismissible || disablePointerDismissal}\n onOpenChange={(open, eventDetails) => {\n if (!dismissible && eventDetails.reason === 'escape-key') {\n eventDetails.cancel()\n return\n }\n onOpenChange?.(open, eventDetails)\n }}\n {...props}\n />\n </DrawerContext.Provider>\n )\n}\n\nfunction DrawerTrigger({ asChild, children, ...props }: DrawerTriggerProps) {\n return <DrawerPrimitive.Trigger data-slot=\"drawer-trigger\" {...props} {...toAsChildRenderProps(asChild, children)} />\n}\n\nfunction DrawerPortal({ ...props }: DrawerPortalProps) {\n return <DrawerPrimitive.Portal data-slot=\"drawer-portal\" {...props} />\n}\n\nfunction DrawerClose({ asChild, children, ...props }: DrawerCloseProps) {\n return <DrawerPrimitive.Close data-slot=\"drawer-close\" {...props} {...toAsChildRenderProps(asChild, children)} />\n}\n\nfunction DrawerOverlay({ className, onClick, forceRender = true, asChild, children, ...props }: DrawerOverlayProps) {\n return (\n <DrawerPrimitive.Backdrop\n data-slot=\"drawer-overlay\"\n forceRender={forceRender}\n className={(state) =>\n cn(\n 'bg-black/10 fixed inset-0 z-50 duration-200',\n 'data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0',\n 'supports-backdrop-filter:backdrop-blur-xs',\n resolveClassName(className, state)\n )\n }\n onClick={stopPropagationHandler(onClick)}\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n )\n}\n\nfunction DrawerContent({\n className,\n children,\n showCloseButton = true,\n overlayProps,\n keepMounted,\n asChild,\n ...props\n}: DrawerContentProps) {\n const { size, direction } = React.useContext(DrawerContext)\n\n return (\n <DrawerPortal keepMounted={keepMounted}>\n <DrawerOverlay {...overlayProps} />\n <DrawerPrimitive.Popup\n data-slot=\"drawer-content\"\n className={(state) => cn(drawerContentVariants({ size, direction }), resolveClassName(className, state))}\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n // React events bubble through the fiber tree, not the DOM, so a portaled Popup still\n // reaches any ancestor's onClick/onSubmit even though it renders outside it in the DOM.\n onClick={stopPropagationHandler(props.onClick)}\n onSubmit={stopPropagationHandler(props.onSubmit)}\n >\n {!asChild && children}\n {showCloseButton && !asChild && (\n <DrawerPrimitive.Close\n data-slot=\"drawer-close\"\n render={<Button variant=\"ghost\" className=\"absolute top-3 right-3\" size=\"icon-sm\" />}\n >\n <IconX />\n <span className=\"sr-only\">Close</span>\n </DrawerPrimitive.Close>\n )}\n </DrawerPrimitive.Popup>\n </DrawerPortal>\n )\n}\n\nfunction DrawerHeader({ className, ...props }: DrawerHeaderProps) {\n const { direction } = React.useContext(DrawerContext)\n const isVertical = direction === 'top' || direction === 'bottom'\n\n return (\n <div\n data-slot=\"drawer-header\"\n className={cn('p-4 flex flex-col gap-0.5 md:gap-0.5', isVertical && 'text-center md:text-left', className)}\n {...props}\n />\n )\n}\n\nfunction DrawerBody({ className, ...props }: DrawerBodyProps) {\n return (\n <div data-slot=\"drawer-body\" className={cn('px-4 pb-4 flex-1 min-h-0 overflow-y-auto', className)} {...props} />\n )\n}\n\nfunction DrawerFooter({ className, ...props }: DrawerFooterProps) {\n return (\n <div\n data-slot=\"drawer-footer\"\n className={cn('gap-2 p-4 mt-auto flex flex-col sm:flex-row sm:justify-end', className)}\n {...props}\n />\n )\n}\n\nfunction DrawerTitle({ className, asChild, children, ...props }: DrawerTitleProps) {\n return (\n <DrawerPrimitive.Title\n data-slot=\"drawer-title\"\n className={(state) => cn('text-foreground text-base font-medium', resolveClassName(className, state))}\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n )\n}\n\nfunction DrawerDescription({ className, asChild, children, ...props }: DrawerDescriptionProps) {\n return (\n <DrawerPrimitive.Description\n data-slot=\"drawer-description\"\n className={(state) => cn('text-muted-foreground text-sm', resolveClassName(className, state))}\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n )\n}\n\nexport {\n Drawer,\n DrawerBody,\n DrawerClose,\n DrawerContent,\n DrawerDescription,\n DrawerFooter,\n DrawerHeader,\n DrawerOverlay,\n D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AC,MAAD,CACE,YAAU,gBACV,UAAWc,EAAG,wCALCV,IAAc,OAASA,IAAc,WAKgB,2BAA4BW,CAAS,EACzG,GAAId,CACL,CAAA,CAEL,CAEA,SAAS,WAAW,CAAE,YAAW,GAAGA,GAA0B,CAC5D,MACE,kBAAC,MAAD,CAAK,YAAU,cAAc,UAAWa,EAAG,2CAA4CC,CAAS,EAAG,GAAId,CAAQ,CAAA,CAEnH,CAEA,SAAS,aAAa,CAAE,YAAW,GAAGA,GAA4B,CAChE,MACE,kBAAC,MAAD,CACE,YAAU,gBACV,UAAWa,EAAG,6DAA8DC,CAAS,EACrF,GAAId,CACL,CAAA,CAEL,CAEA,SAAS,YAAY,CAAE,YAAW,UAAS,WAAU,GAAGA,GAA2B,CACjF,MACE,kBAACN,EAAgB,MAAjB,CACE,YAAU,eACV,UAAY,GAAUmB,EAAG,wCAAyClB,EAAiBmB,EAAWC,CAAK,CAAC,EACpG,GAAIf,EACJ,GAAIU,EAAqBC,EAASC,CAAQ,CAC3C,CAAA,CAEL,CAEA,SAAS,kBAAkB,CAAE,YAAW,UAAS,WAAU,GAAGZ,GAAiC,CAC7F,MACE,kBAACN,EAAgB,YAAjB,CACE,YAAU,qBACV,UAAY,GAAUmB,EAAG,gCAAiClB,EAAiBmB,EAAWC,CAAK,CAAC,EAC5F,GAAIf,EACJ,GAAIU,EAAqBC,EAASC,CAAQ,CAC3C,CAAA,CAEL,C"}
@@ -1,8 +1,7 @@
1
1
  import { t as __name } from "../rolldown-runtime-BhWHdk3m.js";
2
- import { n as AsChildProps, t as AsChildPrimitiveProps } from "../as-child-Dxg3Xo1G.js";
2
+ import { n as AsChildProps, t as AsChildPrimitiveProps } from "../as-child-T9W73ZYU.js";
3
3
  import * as React from "react";
4
4
  import { Menu } from "@base-ui/react/menu";
5
- //#region src/components/dropdown-menu.d.ts
6
5
  export type DropdownMenuProps = React.ComponentProps<typeof Menu.Root>;
7
6
  export type DropdownMenuPortalProps = React.ComponentProps<typeof Menu.Portal>;
8
7
  export type DropdownMenuTriggerProps = AsChildPrimitiveProps<typeof Menu.Trigger>;
@@ -53,6 +52,5 @@ declare function DropdownMenuShortcut({ className, ...props }: DropdownMenuShort
53
52
  declare function DropdownMenuSub({ ...props }: DropdownMenuSubProps): React.JSX.Element;
54
53
  declare function DropdownMenuSubTrigger({ className, inset, children, asChild, ...props }: DropdownMenuSubTriggerProps): React.JSX.Element;
55
54
  declare function DropdownMenuSubContent({ className, side, sideOffset, align, alignOffset, sticky, keepMounted, asChild, children, ...props }: DropdownMenuSubContentProps): React.JSX.Element;
56
- //#endregion
57
55
  export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger };
58
56
  //# sourceMappingURL=dropdown-menu.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dropdown-menu.js","names":["DropdownMenuPrimitive","resolveClassName","React","DropdownMenuGroupContext","props","Menu","toAsChildRenderProps","asChild","children","cn","className","state","inset","variant","IconCheck","isInsideGroup","labelProps","useAsChild","IconChevronRight"],"sources":["../../src/components/dropdown-menu.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { Menu as DropdownMenuPrimitive } from '@base-ui/react/menu'\nimport { IconCheck, IconChevronRight } from '@tabler/icons-react'\n\nimport { type AsChildPrimitiveProps, type AsChildProps, toAsChildRenderProps, useAsChild } from '../lib/as-child'\nimport { cn } from '../lib/utils'\nimport { resolveClassName } from '../utils/resolve-class-name'\n\nexport type DropdownMenuProps = React.ComponentProps<typeof DropdownMenuPrimitive.Root>\n\nexport type DropdownMenuPortalProps = React.ComponentProps<typeof DropdownMenuPrimitive.Portal>\n\nexport type DropdownMenuTriggerProps = AsChildPrimitiveProps<typeof DropdownMenuPrimitive.Trigger>\n\nexport type DropdownMenuContentProps = AsChildPrimitiveProps<typeof DropdownMenuPrimitive.Popup> &\n Pick<\n React.ComponentProps<typeof DropdownMenuPrimitive.Positioner>,\n 'side' | 'sideOffset' | 'align' | 'alignOffset' | 'sticky'\n > &\n Pick<DropdownMenuPortalProps, 'keepMounted'>\n\nexport type DropdownMenuGroupProps = AsChildPrimitiveProps<typeof DropdownMenuPrimitive.Group>\n\nexport type DropdownMenuItemProps = AsChildPrimitiveProps<typeof DropdownMenuPrimitive.Item> & {\n /** Adds left padding so the text lines up with items that have an icon or indicator. */\n inset?: boolean\n /**\n * `destructive` colors the item red for dangerous actions.\n * @default 'default'\n */\n variant?: 'default' | 'destructive'\n}\n\nexport type DropdownMenuCheckboxItemProps = AsChildPrimitiveProps<typeof DropdownMenuPrimitive.CheckboxItem> & {\n /** Adds left padding so the text lines up with items that have an icon or indicator. */\n inset?: boolean\n}\n\nexport type DropdownMenuRadioGroupProps = AsChildPrimitiveProps<typeof DropdownMenuPrimitive.RadioGroup>\n\nexport type DropdownMenuRadioItemProps = AsChildPrimitiveProps<typeof DropdownMenuPrimitive.RadioItem> & {\n /** Adds left padding so the text lines up with items that have an icon or indicator. */\n inset?: boolean\n}\n\nexport type DropdownMenuLabelProps = AsChildProps<'div'> & {\n /** Adds left padding so the text lines up with items that have an icon or indicator. */\n inset?: boolean\n}\n\nexport type DropdownMenuSeparatorProps = AsChildPrimitiveProps<typeof DropdownMenuPrimitive.Separator>\n\nexport type DropdownMenuShortcutProps = React.ComponentProps<'span'>\n\nexport type DropdownMenuSubProps = React.ComponentProps<typeof DropdownMenuPrimitive.SubmenuRoot>\n\nexport type DropdownMenuSubTriggerProps = AsChildPrimitiveProps<typeof DropdownMenuPrimitive.SubmenuTrigger> & {\n /** Adds left padding so the text lines up with items that have an icon or indicator. */\n inset?: boolean\n}\n\nexport type DropdownMenuSubContentProps = DropdownMenuContentProps\n\n// Base UI's `GroupLabel` must live inside a `Group`/`RadioGroup`; this flag lets `DropdownMenuLabel`\n// fall back to a plain element when it is rendered on its own, like Radix's `Label` allowed.\nconst DropdownMenuGroupContext = React.createContext(false)\n\nfunction DropdownMenu({ ...props }: DropdownMenuProps) {\n return <DropdownMenuPrimitive.Root data-slot=\"dropdown-menu\" {...props} />\n}\n\nfunction DropdownMenuPortal({ ...props }: DropdownMenuPortalProps) {\n return <DropdownMenuPrimitive.Portal data-slot=\"dropdown-menu-portal\" {...props} />\n}\n\nfunction DropdownMenuTrigger({ asChild, children, ...props }: DropdownMenuTriggerProps) {\n return (\n <DropdownMenuPrimitive.Trigger\n data-slot=\"dropdown-menu-trigger\"\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n )\n}\n\nfunction DropdownMenuContent({\n className,\n side = 'bottom',\n sideOffset = 4,\n align = 'start',\n alignOffset = 0,\n sticky,\n keepMounted,\n asChild,\n children,\n ...props\n}: DropdownMenuContentProps) {\n return (\n <DropdownMenuPortal keepMounted={keepMounted}>\n <DropdownMenuPrimitive.Positioner\n side={side}\n sideOffset={sideOffset}\n align={align}\n alignOffset={alignOffset}\n sticky={sticky}\n className=\"isolate z-50 outline-none\"\n >\n <DropdownMenuPrimitive.Popup\n data-slot=\"dropdown-menu-content\"\n className={(state) =>\n cn(\n 'relative z-50 w-(--anchor-width) min-w-32 max-h-(--available-height) outline-none',\n 'origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg p-1',\n 'bg-popover/70 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100',\n 'data-closed:overflow-hidden',\n 'data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95',\n 'data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',\n 'before:pointer-events-none before:absolute before:inset-0 before:-z-1 before:rounded-[inherit]',\n 'before:backdrop-blur-2xl before:backdrop-saturate-150',\n '**:data-[slot$=-item]:focus:bg-foreground/10 **:data-[slot$=-item]:data-highlighted:bg-foreground/10',\n '**:data-[slot$=-separator]:bg-foreground/5',\n '**:data-[slot$=-trigger]:focus:bg-foreground/10 **:data-[slot$=-trigger]:aria-expanded:bg-foreground/10!',\n '**:data-[variant=destructive]:focus:bg-destructive/10! dark:**:data-[variant=destructive]:focus:bg-destructive/20!',\n '**:data-[variant=destructive]:text-destructive! **:data-[variant=destructive]:**:text-destructive!',\n 'animate-none!',\n resolveClassName(className, state)\n )\n }\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n </DropdownMenuPrimitive.Positioner>\n </DropdownMenuPortal>\n )\n}\n\nfunction DropdownMenuGroup({ asChild, children, ...props }: DropdownMenuGroupProps) {\n return (\n <DropdownMenuGroupContext.Provider value={true}>\n <DropdownMenuPrimitive.Group\n data-slot=\"dropdown-menu-group\"\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n </DropdownMenuGroupContext.Provider>\n )\n}\n\nfunction DropdownMenuItem({\n className,\n inset,\n variant = 'default',\n asChild,\n children,\n ...props\n}: DropdownMenuItemProps) {\n return (\n <DropdownMenuPrimitive.Item\n data-slot=\"dropdown-menu-item\"\n data-inset={inset}\n data-variant={variant}\n className={(state) =>\n cn(\n 'group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm',\n 'select-none outline-hidden',\n 'focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground',\n 'data-inset:pl-7',\n 'data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive',\n 'dark:data-[variant=destructive]:focus:bg-destructive/20',\n 'data-disabled:pointer-events-none data-disabled:opacity-50',\n \"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n 'data-[variant=destructive]:*:[svg]:text-destructive',\n resolveClassName(className, state)\n )\n }\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n )\n}\n\nfunction DropdownMenuCheckboxItem({ className, children, inset, asChild, ...props }: DropdownMenuCheckboxItemProps) {\n return (\n <DropdownMenuPrimitive.CheckboxItem\n data-slot=\"dropdown-menu-checkbox-item\"\n data-inset={inset}\n className={(state) =>\n cn(\n 'relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm',\n 'select-none outline-hidden',\n 'focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground',\n 'data-inset:pl-7',\n 'data-disabled:pointer-events-none data-disabled:opacity-50',\n \"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n resolveClassName(className, state)\n )\n }\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n >\n {!asChild && (\n <span\n data-slot=\"dropdown-menu-checkbox-item-indicator\"\n className=\"pointer-events-none absolute right-2 flex items-center justify-center\"\n >\n <DropdownMenuPrimitive.CheckboxItemIndicator>\n <IconCheck />\n </DropdownMenuPrimitive.CheckboxItemIndicator>\n </span>\n )}\n {!asChild && children}\n </DropdownMenuPrimitive.CheckboxItem>\n )\n}\n\nfunction DropdownMenuRadioGroup({ asChild, children, ...props }: DropdownMenuRadioGroupProps) {\n return (\n <DropdownMenuGroupContext.Provider value={true}>\n <DropdownMenuPrimitive.RadioGroup\n data-slot=\"dropdown-menu-radio-group\"\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n </DropdownMenuGroupContext.Provider>\n )\n}\n\nfunction DropdownMenuRadioItem({ className, children, inset, asChild, ...props }: DropdownMenuRadioItemProps) {\n return (\n <DropdownMenuPrimitive.RadioItem\n data-slot=\"dropdown-menu-radio-item\"\n data-inset={inset}\n className={(state) =>\n cn(\n 'relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm',\n 'select-none outline-hidden',\n 'focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground',\n 'data-inset:pl-7',\n 'data-disabled:pointer-events-none data-disabled:opacity-50',\n \"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n resolveClassName(className, state)\n )\n }\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n >\n {!asChild && (\n <span\n data-slot=\"dropdown-menu-radio-item-indicator\"\n className=\"pointer-events-none absolute right-2 flex items-center justify-center\"\n >\n <DropdownMenuPrimitive.RadioItemIndicator>\n <IconCheck />\n </DropdownMenuPrimitive.RadioItemIndicator>\n </span>\n )}\n {!asChild && children}\n </DropdownMenuPrimitive.RadioItem>\n )\n}\n\nfunction DropdownMenuLabel({ className, inset, asChild, children, ...props }: DropdownMenuLabelProps) {\n const isInsideGroup = React.useContext(DropdownMenuGroupContext)\n const labelProps = {\n 'data-slot': 'dropdown-menu-label',\n 'data-inset': inset,\n className: cn('px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7', className),\n ...props\n }\n\n if (isInsideGroup) {\n return <DropdownMenuPrimitive.GroupLabel {...labelProps} {...toAsChildRenderProps(asChild, children)} />\n }\n\n return (\n <DropdownMenuStandaloneLabel {...labelProps} asChild={asChild}>\n {children}\n </DropdownMenuStandaloneLabel>\n )\n}\n\nfunction DropdownMenuStandaloneLabel(props: AsChildProps<'div'>) {\n return useAsChild('div', { ...props })\n}\n\nfunction DropdownMenuSeparator({ className, asChild, children, ...props }: DropdownMenuSeparatorProps) {\n return (\n <DropdownMenuPrimitive.Separator\n data-slot=\"dropdown-menu-separator\"\n className={(state) => cn('bg-border -mx-1 my-1 h-px', resolveClassName(className, state))}\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n )\n}\n\nfunction DropdownMenuShortcut({ className, ...props }: DropdownMenuShortcutProps) {\n return (\n <span\n data-slot=\"dropdown-menu-shortcut\"\n className={cn(\n 'ml-auto text-xs tracking-widest text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction DropdownMenuSub({ ...props }: DropdownMenuSubProps) {\n return <DropdownMenuPrimitive.SubmenuRoot data-slot=\"dropdown-menu-sub\" {...props} />\n}\n\nfunction DropdownMenuSubTrigger({ className, inset, children, asChild, ...props }: DropdownMenuSubTriggerProps) {\n return (\n <DropdownMenuPrimitive.SubmenuTrigger\n data-slot=\"dropdown-menu-sub-trigger\"\n data-inset={inset}\n className={(state) =>\n cn(\n 'flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm',\n 'select-none outline-hidden',\n 'focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground',\n 'data-inset:pl-7 data-popup-open:bg-accent data-popup-open:text-accent-foreground',\n \"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n resolveClassName(className, state)\n )\n }\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n >\n {!asChild && children}\n {!asChild && <IconChevronRight className=\"ml-auto\" />}\n </DropdownMenuPrimitive.SubmenuTrigger>\n )\n}\n\nfunction DropdownMenuSubContent({\n className,\n side = 'right',\n sideOffset = 0,\n align = 'start',\n alignOffset = -3,\n sticky,\n keepMounted,\n asChild,\n children,\n ...props\n}: DropdownMenuSubContentProps) {\n return (\n <DropdownMenuPortal keepMounted={keepMounted}>\n <DropdownMenuPrimitive.Positioner\n side={side}\n sideOffset={sideOffset}\n align={align}\n alignOffset={alignOffset}\n sticky={sticky}\n className=\"isolate z-50 outline-none\"\n >\n <DropdownMenuPrimitive.Popup\n data-slot=\"dropdown-menu-sub-content\"\n className={(state) =>\n cn(\n 'relative z-50 min-w-24 origin-(--transform-origin) overflow-hidden rounded-lg p-1 outline-none',\n 'bg-popover/70 text-popover-foreground shadow-lg ring-1 ring-foreground/10 duration-100',\n 'data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95',\n 'data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',\n 'before:pointer-events-none before:absolute before:inset-0 before:-z-1 before:rounded-[inherit]',\n 'before:backdrop-blur-2xl before:backdrop-saturate-150',\n '**:data-[slot$=-item]:focus:bg-foreground/10 **:data-[slot$=-item]:data-highlighted:bg-foreground/10',\n '**:data-[slot$=-separator]:bg-foreground/5',\n '**:data-[slot$=-trigger]:focus:bg-foreground/10 **:data-[slot$=-trigger]:aria-expanded:bg-foreground/10!',\n '**:data-[variant=destructive]:focus:bg-destructive/10! dark:**:data-[variant=destructive]:focus:bg-destructive/20!',\n '**:data-[variant=destructive]:text-destructive! **:data-[variant=destructive]:**:text-destructive!',\n 'animate-none!',\n resolveClassName(className, state)\n )\n }\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n </DropdownMenuPrimitive.Positioner>\n </DropdownMenuPortal>\n )\n}\n\nexport {\n DropdownMenu,\n DropdownMenuCheckboxItem,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuPortal,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuTrigger\n}\n"],"mappings":"wYAkEA,MAAMG,EAA2BD,EAAM,cAAc,EAAK,EAE1D,SAAS,aAAa,CAAE,GAAGE,GAA4B,CACrD,MAAO,kBAACJ,EAAsB,KAAvB,CAA4B,YAAU,gBAAgB,GAAII,CAAQ,CAAA,CAC3E,CAEA,SAAS,mBAAmB,CAAE,GAAGA,GAAkC,CACjE,MAAO,kBAACJ,EAAsB,OAAvB,CAA8B,YAAU,uBAAuB,GAAII,CAAQ,CAAA,CACpF,CAEA,SAAS,oBAAoB,CAAE,UAAS,WAAU,GAAGA,GAAmC,CACtF,MACE,kBAACJ,EAAsB,QAAvB,CACE,YAAU,wBACV,GAAII,EACJ,GAAIE,EAAqBC,EAASC,CAAQ,CAC3C,CAAA,CAEL,CA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,4BAEV,SAAA,kBAACA,EAAsB,MAAvB,CACE,YAAU,4BACV,UAAY,GACVS,EACE,iGACA,yFACA,uIACA,8JACA,iGACA,wDACA,uGACA,6CACA,2GACA,qHACA,qGACA,gBACAR,EAAiBS,EAAWC,CAAK,CACnC,EAEF,GAAIP,EACJ,GAAIE,EAAqBC,EAASC,CAAQ,CAC3C,CAAA,CAC+B,CAAA,CAChB,CAAA,CAExB"}
1
+ {"version":3,"file":"dropdown-menu.js","names":["DropdownMenuPrimitive","resolveClassName","React","DropdownMenuGroupContext","props","Menu","toAsChildRenderProps","asChild","children","cn","className","state","inset","variant","IconCheck","isInsideGroup","labelProps","useAsChild","IconChevronRight"],"sources":["../../src/components/dropdown-menu.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { Menu as DropdownMenuPrimitive } from '@base-ui/react/menu'\nimport { IconCheck, IconChevronRight } from '@tabler/icons-react'\n\nimport { type AsChildPrimitiveProps, type AsChildProps, toAsChildRenderProps, useAsChild } from '../lib/as-child'\nimport { cn } from '../lib/utils'\nimport { resolveClassName } from '../utils/resolve-class-name'\n\nexport type DropdownMenuProps = React.ComponentProps<typeof DropdownMenuPrimitive.Root>\n\nexport type DropdownMenuPortalProps = React.ComponentProps<typeof DropdownMenuPrimitive.Portal>\n\nexport type DropdownMenuTriggerProps = AsChildPrimitiveProps<typeof DropdownMenuPrimitive.Trigger>\n\nexport type DropdownMenuContentProps = AsChildPrimitiveProps<typeof DropdownMenuPrimitive.Popup> &\n Pick<\n React.ComponentProps<typeof DropdownMenuPrimitive.Positioner>,\n 'side' | 'sideOffset' | 'align' | 'alignOffset' | 'sticky'\n > &\n Pick<DropdownMenuPortalProps, 'keepMounted'>\n\nexport type DropdownMenuGroupProps = AsChildPrimitiveProps<typeof DropdownMenuPrimitive.Group>\n\nexport type DropdownMenuItemProps = AsChildPrimitiveProps<typeof DropdownMenuPrimitive.Item> & {\n /** Adds left padding so the text lines up with items that have an icon or indicator. */\n inset?: boolean\n /**\n * `destructive` colors the item red for dangerous actions.\n * @default 'default'\n */\n variant?: 'default' | 'destructive'\n}\n\nexport type DropdownMenuCheckboxItemProps = AsChildPrimitiveProps<typeof DropdownMenuPrimitive.CheckboxItem> & {\n /** Adds left padding so the text lines up with items that have an icon or indicator. */\n inset?: boolean\n}\n\nexport type DropdownMenuRadioGroupProps = AsChildPrimitiveProps<typeof DropdownMenuPrimitive.RadioGroup>\n\nexport type DropdownMenuRadioItemProps = AsChildPrimitiveProps<typeof DropdownMenuPrimitive.RadioItem> & {\n /** Adds left padding so the text lines up with items that have an icon or indicator. */\n inset?: boolean\n}\n\nexport type DropdownMenuLabelProps = AsChildProps<'div'> & {\n /** Adds left padding so the text lines up with items that have an icon or indicator. */\n inset?: boolean\n}\n\nexport type DropdownMenuSeparatorProps = AsChildPrimitiveProps<typeof DropdownMenuPrimitive.Separator>\n\nexport type DropdownMenuShortcutProps = React.ComponentProps<'span'>\n\nexport type DropdownMenuSubProps = React.ComponentProps<typeof DropdownMenuPrimitive.SubmenuRoot>\n\nexport type DropdownMenuSubTriggerProps = AsChildPrimitiveProps<typeof DropdownMenuPrimitive.SubmenuTrigger> & {\n /** Adds left padding so the text lines up with items that have an icon or indicator. */\n inset?: boolean\n}\n\nexport type DropdownMenuSubContentProps = DropdownMenuContentProps\n\n// Base UI's `GroupLabel` must live inside a `Group`/`RadioGroup`; this flag lets `DropdownMenuLabel`\n// fall back to a plain element when it is rendered on its own, like Radix's `Label` allowed.\nconst DropdownMenuGroupContext = React.createContext(false)\n\nfunction DropdownMenu({ ...props }: DropdownMenuProps) {\n return <DropdownMenuPrimitive.Root data-slot=\"dropdown-menu\" {...props} />\n}\n\nfunction DropdownMenuPortal({ ...props }: DropdownMenuPortalProps) {\n return <DropdownMenuPrimitive.Portal data-slot=\"dropdown-menu-portal\" {...props} />\n}\n\nfunction DropdownMenuTrigger({ asChild, children, ...props }: DropdownMenuTriggerProps) {\n return (\n <DropdownMenuPrimitive.Trigger\n data-slot=\"dropdown-menu-trigger\"\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n )\n}\n\nfunction DropdownMenuContent({\n className,\n side = 'bottom',\n sideOffset = 4,\n align = 'start',\n alignOffset = 0,\n sticky,\n keepMounted,\n asChild,\n children,\n ...props\n}: DropdownMenuContentProps) {\n return (\n <DropdownMenuPortal keepMounted={keepMounted}>\n <DropdownMenuPrimitive.Positioner\n side={side}\n sideOffset={sideOffset}\n align={align}\n alignOffset={alignOffset}\n sticky={sticky}\n className=\"isolate z-50 outline-none\"\n >\n <DropdownMenuPrimitive.Popup\n data-slot=\"dropdown-menu-content\"\n className={(state) =>\n cn(\n 'relative z-50 w-(--anchor-width) min-w-32 max-h-(--available-height) outline-none',\n 'origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg p-1',\n 'bg-popover/70 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100',\n 'data-closed:overflow-hidden',\n 'data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95',\n 'data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',\n 'before:pointer-events-none before:absolute before:inset-0 before:-z-1 before:rounded-[inherit]',\n 'before:backdrop-blur-2xl before:backdrop-saturate-150',\n '**:data-[slot$=-item]:focus:bg-foreground/10 **:data-[slot$=-item]:data-highlighted:bg-foreground/10',\n '**:data-[slot$=-separator]:bg-foreground/5',\n '**:data-[slot$=-trigger]:focus:bg-foreground/10 **:data-[slot$=-trigger]:aria-expanded:bg-foreground/10!',\n '**:data-[variant=destructive]:focus:bg-destructive/10! dark:**:data-[variant=destructive]:focus:bg-destructive/20!',\n '**:data-[variant=destructive]:text-destructive! **:data-[variant=destructive]:**:text-destructive!',\n 'animate-none!',\n resolveClassName(className, state)\n )\n }\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n </DropdownMenuPrimitive.Positioner>\n </DropdownMenuPortal>\n )\n}\n\nfunction DropdownMenuGroup({ asChild, children, ...props }: DropdownMenuGroupProps) {\n return (\n <DropdownMenuGroupContext.Provider value={true}>\n <DropdownMenuPrimitive.Group\n data-slot=\"dropdown-menu-group\"\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n </DropdownMenuGroupContext.Provider>\n )\n}\n\nfunction DropdownMenuItem({\n className,\n inset,\n variant = 'default',\n asChild,\n children,\n ...props\n}: DropdownMenuItemProps) {\n return (\n <DropdownMenuPrimitive.Item\n data-slot=\"dropdown-menu-item\"\n data-inset={inset}\n data-variant={variant}\n className={(state) =>\n cn(\n 'group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm',\n 'select-none outline-hidden',\n 'focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground',\n 'data-inset:pl-7',\n 'data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive',\n 'dark:data-[variant=destructive]:focus:bg-destructive/20',\n 'data-disabled:pointer-events-none data-disabled:opacity-50',\n \"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n 'data-[variant=destructive]:*:[svg]:text-destructive',\n resolveClassName(className, state)\n )\n }\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n )\n}\n\nfunction DropdownMenuCheckboxItem({ className, children, inset, asChild, ...props }: DropdownMenuCheckboxItemProps) {\n return (\n <DropdownMenuPrimitive.CheckboxItem\n data-slot=\"dropdown-menu-checkbox-item\"\n data-inset={inset}\n className={(state) =>\n cn(\n 'relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm',\n 'select-none outline-hidden',\n 'focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground',\n 'data-inset:pl-7',\n 'data-disabled:pointer-events-none data-disabled:opacity-50',\n \"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n resolveClassName(className, state)\n )\n }\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n >\n {!asChild && (\n <span\n data-slot=\"dropdown-menu-checkbox-item-indicator\"\n className=\"pointer-events-none absolute right-2 flex items-center justify-center\"\n >\n <DropdownMenuPrimitive.CheckboxItemIndicator>\n <IconCheck />\n </DropdownMenuPrimitive.CheckboxItemIndicator>\n </span>\n )}\n {!asChild && children}\n </DropdownMenuPrimitive.CheckboxItem>\n )\n}\n\nfunction DropdownMenuRadioGroup({ asChild, children, ...props }: DropdownMenuRadioGroupProps) {\n return (\n <DropdownMenuGroupContext.Provider value={true}>\n <DropdownMenuPrimitive.RadioGroup\n data-slot=\"dropdown-menu-radio-group\"\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n </DropdownMenuGroupContext.Provider>\n )\n}\n\nfunction DropdownMenuRadioItem({ className, children, inset, asChild, ...props }: DropdownMenuRadioItemProps) {\n return (\n <DropdownMenuPrimitive.RadioItem\n data-slot=\"dropdown-menu-radio-item\"\n data-inset={inset}\n className={(state) =>\n cn(\n 'relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm',\n 'select-none outline-hidden',\n 'focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground',\n 'data-inset:pl-7',\n 'data-disabled:pointer-events-none data-disabled:opacity-50',\n \"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n resolveClassName(className, state)\n )\n }\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n >\n {!asChild && (\n <span\n data-slot=\"dropdown-menu-radio-item-indicator\"\n className=\"pointer-events-none absolute right-2 flex items-center justify-center\"\n >\n <DropdownMenuPrimitive.RadioItemIndicator>\n <IconCheck />\n </DropdownMenuPrimitive.RadioItemIndicator>\n </span>\n )}\n {!asChild && children}\n </DropdownMenuPrimitive.RadioItem>\n )\n}\n\nfunction DropdownMenuLabel({ className, inset, asChild, children, ...props }: DropdownMenuLabelProps) {\n const isInsideGroup = React.useContext(DropdownMenuGroupContext)\n const labelProps = {\n 'data-slot': 'dropdown-menu-label',\n 'data-inset': inset,\n className: cn('px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7', className),\n ...props\n }\n\n if (isInsideGroup) {\n return <DropdownMenuPrimitive.GroupLabel {...labelProps} {...toAsChildRenderProps(asChild, children)} />\n }\n\n return (\n <DropdownMenuStandaloneLabel {...labelProps} asChild={asChild}>\n {children}\n </DropdownMenuStandaloneLabel>\n )\n}\n\nfunction DropdownMenuStandaloneLabel(props: AsChildProps<'div'>) {\n return useAsChild('div', { ...props })\n}\n\nfunction DropdownMenuSeparator({ className, asChild, children, ...props }: DropdownMenuSeparatorProps) {\n return (\n <DropdownMenuPrimitive.Separator\n data-slot=\"dropdown-menu-separator\"\n className={(state) => cn('bg-border -mx-1 my-1 h-px', resolveClassName(className, state))}\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n )\n}\n\nfunction DropdownMenuShortcut({ className, ...props }: DropdownMenuShortcutProps) {\n return (\n <span\n data-slot=\"dropdown-menu-shortcut\"\n className={cn(\n 'ml-auto text-xs tracking-widest text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction DropdownMenuSub({ ...props }: DropdownMenuSubProps) {\n return <DropdownMenuPrimitive.SubmenuRoot data-slot=\"dropdown-menu-sub\" {...props} />\n}\n\nfunction DropdownMenuSubTrigger({ className, inset, children, asChild, ...props }: DropdownMenuSubTriggerProps) {\n return (\n <DropdownMenuPrimitive.SubmenuTrigger\n data-slot=\"dropdown-menu-sub-trigger\"\n data-inset={inset}\n className={(state) =>\n cn(\n 'flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm',\n 'select-none outline-hidden',\n 'focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground',\n 'data-inset:pl-7 data-popup-open:bg-accent data-popup-open:text-accent-foreground',\n \"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n resolveClassName(className, state)\n )\n }\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n >\n {!asChild && children}\n {!asChild && <IconChevronRight className=\"ml-auto\" />}\n </DropdownMenuPrimitive.SubmenuTrigger>\n )\n}\n\nfunction DropdownMenuSubContent({\n className,\n side = 'right',\n sideOffset = 0,\n align = 'start',\n alignOffset = -3,\n sticky,\n keepMounted,\n asChild,\n children,\n ...props\n}: DropdownMenuSubContentProps) {\n return (\n <DropdownMenuPortal keepMounted={keepMounted}>\n <DropdownMenuPrimitive.Positioner\n side={side}\n sideOffset={sideOffset}\n align={align}\n alignOffset={alignOffset}\n sticky={sticky}\n className=\"isolate z-50 outline-none\"\n >\n <DropdownMenuPrimitive.Popup\n data-slot=\"dropdown-menu-sub-content\"\n className={(state) =>\n cn(\n 'relative z-50 min-w-24 origin-(--transform-origin) overflow-hidden rounded-lg p-1 outline-none',\n 'bg-popover/70 text-popover-foreground shadow-lg ring-1 ring-foreground/10 duration-100',\n 'data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95',\n 'data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',\n 'before:pointer-events-none before:absolute before:inset-0 before:-z-1 before:rounded-[inherit]',\n 'before:backdrop-blur-2xl before:backdrop-saturate-150',\n '**:data-[slot$=-item]:focus:bg-foreground/10 **:data-[slot$=-item]:data-highlighted:bg-foreground/10',\n '**:data-[slot$=-separator]:bg-foreground/5',\n '**:data-[slot$=-trigger]:focus:bg-foreground/10 **:data-[slot$=-trigger]:aria-expanded:bg-foreground/10!',\n '**:data-[variant=destructive]:focus:bg-destructive/10! dark:**:data-[variant=destructive]:focus:bg-destructive/20!',\n '**:data-[variant=destructive]:text-destructive! **:data-[variant=destructive]:**:text-destructive!',\n 'animate-none!',\n resolveClassName(className, state)\n )\n }\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n </DropdownMenuPrimitive.Positioner>\n </DropdownMenuPortal>\n )\n}\n\nexport {\n DropdownMenu,\n DropdownMenuCheckboxItem,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuPortal,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuTrigger\n}\n"],"mappings":"A,wYAkEA,MAAMG,EAA2BD,EAAM,cAAc,EAAK,EAE1D,SAAS,aAAa,CAAE,GAAGE,GAA4B,CACrD,MAAO,kBAACJ,EAAsB,KAAvB,CAA4B,YAAU,gBAAgB,GAAII,CAAQ,CAAA,CAC3E,CAEA,SAAS,mBAAmB,CAAE,GAAGA,GAAkC,CACjE,MAAO,kBAACJ,EAAsB,OAAvB,CAA8B,YAAU,uBAAuB,GAAII,CAAQ,CAAA,CACpF,CAEA,SAAS,oBAAoB,CAAE,UAAS,WAAU,GAAGA,GAAmC,CACtF,MACE,kBAACJ,EAAsB,QAAvB,CACE,YAAU,wBACV,GAAII,EACJ,GAAIE,EAAqBC,EAASC,CAAQ,CAC3C,CAAA,CAEL,CAEA,SAAS,oBAAoB,CAC3B,YACA,OAAO,SACP,aAAa,EACb,QAAQ,QACR,cAAc,EACd,SACA,cACA,UACA,WACA,GAAGJ,GACwB,CAC3B,MACE,kBAAC,mBAAD,CAAiC,cAC/B,SAAA,kBAACJ,EAAsB,WAAvB,CACQ,OACM,aACL,QACM,cACL,SACR,UAAU,4BAEV,SAAA,kBAACA,EAAsB,MAAvB,CACE,YAAU,wBACV,UAAY,GACVS,EACE,oFACA,+EACA,yFACA,8BACA,uIACA,8JACA,iGACA,wDACA,uGACA,6CACA,2GACA,qHACA,qGACA,gBACAR,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ASC,CAAQ,CAC3C,CAAA,CAEL,CAEA,SAAS,qBAAqB,CAAE,YAAW,GAAGJ,GAAoC,CAChF,MACE,kBAAC,OAAD,CACE,YAAU,yBACV,UAAWK,EACT,8GACAC,CACF,EACA,GAAIN,CACL,CAAA,CAEL,CAEA,SAAS,gBAAgB,CAAE,GAAGA,GAA+B,CAC3D,MAAO,kBAACJ,EAAsB,YAAvB,CAAmC,YAAU,oBAAoB,GAAII,CAAQ,CAAA,CACtF,CAEA,SAAS,uBAAuB,CAAE,YAAW,QAAO,WAAU,UAAS,GAAGA,GAAsC,CAC9G,MACE,kBAACJ,EAAsB,eAAvB,CACE,YAAU,4BACV,aAAYY,EACZ,UAAY,GACVH,EACE,0EACA,6BACA,8GACA,mFACA,oFACAR,EAAiBS,EAAWC,CAAK,CACnC,EAEF,GAAIP,EACJ,GAAIE,EAAqBC,EAASC,CAAQ,EAd5C,SAAA,CAgBG,CAACD,GAAWC,EACZ,CAACD,GAAW,kBAACW,EAAD,CAAkB,UAAU,SAAW,CAAA,CAChB,C,EAE1C,CAEA,SAAS,uBAAuB,CAC9B,YACA,OAAO,QACP,aAAa,EACb,QAAQ,QACR,cAAc,GACd,SACA,cACA,UACA,WACA,GAAGd,GAC2B,CAC9B,MACE,kBAAC,mBAAD,CAAiC,cAC/B,SAAA,kBAACJ,EAAsB,WAAvB,CACQ,OACM,aACL,QACM,cACL,SACR,UAAU,4BAEV,SAAA,kBAACA,EAAsB,MAAvB,CACE,YAAU,4BACV,UAAY,GACVS,EACE,iGACA,yFACA,uIACA,8JACA,iGACA,wDACA,uGACA,6CACA,2GACA,qHACA,qGACA,gBACAR,EAAiBS,EAAWC,CAAK,CACnC,EAEF,GAAIP,EACJ,GAAIE,EAAqBC,EAASC,CAAQ,CAC3C,CAAA,CAC+B,CAAA,CAChB,CAAA,CAExB,C"}
@@ -2,7 +2,6 @@ import { t as __name } from "../rolldown-runtime-BhWHdk3m.js";
2
2
  import { ButtonProps } from "./button.js";
3
3
  import * as React from "react";
4
4
  import { Accept, ErrorCode, FileError, useDropzone as useDropzone$1 } from "react-dropzone";
5
- //#region src/components/dropzone.d.ts
6
5
  export type DropzoneUploadResult<TUploadResult, TUploadError> = {
7
6
  status: 'error';
8
7
  error: TUploadError;
@@ -116,6 +115,5 @@ declare const DropzoneRemoveFile: React.ForwardRefExoticComponent<Omit<ButtonPro
116
115
  declare const DropzoneRetryFile: React.ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
117
116
  declare const DropzoneTrigger: React.ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
118
117
  declare const InfiniteProgress: React.ForwardRefExoticComponent<Omit<InfiniteProgressProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
119
- //#endregion
120
118
  export { Dropzone, DropzoneArea, DropzoneDescription, DropzoneFileList, DropzoneFileListItem, DropzoneFileMessage, DropzoneMessage, DropzoneRemoveFile, DropzoneRetryFile, DropzoneTrigger, ErrorCode, type FileError, InfiniteProgress, useDropzone };
121
119
  //# sourceMappingURL=dropzone.d.ts.map