@15gifts/back-office-kit 0.1.0-alpha.0 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (304) hide show
  1. package/README.md +9 -6
  2. package/dist/browser/back-office-kit.js +6649 -5932
  3. package/dist/components/Alert/Alert.css.d.ts +1 -0
  4. package/dist/components/Alert/Alert.d.ts +12 -2
  5. package/dist/components/Alert/Alert.js +33 -29
  6. package/dist/components/Alert/Alert.js.map +1 -1
  7. package/dist/components/Alert/Alert.styles.js +2 -2
  8. package/dist/components/Alert/Alert.styles.js.map +1 -1
  9. package/dist/components/AppShell/AppShell.css.d.ts +2 -0
  10. package/dist/components/AppShell/AppShell.d.ts +3 -1
  11. package/dist/components/AppShell/AppShell.js +42 -26
  12. package/dist/components/AppShell/AppShell.js.map +1 -1
  13. package/dist/components/AppShell/AppShell.styles.js +3 -2
  14. package/dist/components/AppShell/AppShell.styles.js.map +1 -1
  15. package/dist/components/Avatar/Avatar.d.ts +1 -0
  16. package/dist/components/Avatar/Avatar.js.map +1 -1
  17. package/dist/components/Badge/Badge.css.d.ts +5 -0
  18. package/dist/components/Badge/Badge.d.ts +4 -1
  19. package/dist/components/Badge/Badge.js +6 -5
  20. package/dist/components/Badge/Badge.js.map +1 -1
  21. package/dist/components/Badge/Badge.styles.js +16 -15
  22. package/dist/components/Badge/Badge.styles.js.map +1 -1
  23. package/dist/components/Breadcrumbs/Breadcrumbs.css.d.ts +2 -0
  24. package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +2 -0
  25. package/dist/components/Breadcrumbs/Breadcrumbs.js +27 -27
  26. package/dist/components/Breadcrumbs/Breadcrumbs.js.map +1 -1
  27. package/dist/components/Breadcrumbs/Breadcrumbs.styles.js +2 -2
  28. package/dist/components/Breadcrumbs/Breadcrumbs.styles.js.map +1 -1
  29. package/dist/components/Button/Button.css.d.ts +1 -1
  30. package/dist/components/Button/Button.d.ts +5 -4
  31. package/dist/components/Button/Button.js +21 -21
  32. package/dist/components/Button/Button.js.map +1 -1
  33. package/dist/components/Button/Button.styles.js.map +1 -1
  34. package/dist/components/Card/Card.css.d.ts +2 -0
  35. package/dist/components/Card/Card.d.ts +7 -1
  36. package/dist/components/Card/Card.js +33 -22
  37. package/dist/components/Card/Card.js.map +1 -1
  38. package/dist/components/Card/Card.styles.js +2 -2
  39. package/dist/components/Card/Card.styles.js.map +1 -1
  40. package/dist/components/ChatTranscript/ChatTranscript.d.ts +2 -2
  41. package/dist/components/ChatTranscript/ChatTranscript.js +74 -71
  42. package/dist/components/ChatTranscript/ChatTranscript.js.map +1 -1
  43. package/dist/components/Checkbox/Checkbox.d.ts +2 -1
  44. package/dist/components/Checkbox/Checkbox.js +30 -34
  45. package/dist/components/Checkbox/Checkbox.js.map +1 -1
  46. package/dist/components/Checkbox/Checkbox.styles.js.map +1 -1
  47. package/dist/components/CheckboxGroup/CheckboxGroup.css.d.ts +2 -0
  48. package/dist/components/CheckboxGroup/CheckboxGroup.d.ts +28 -0
  49. package/dist/components/CheckboxGroup/CheckboxGroup.js +66 -0
  50. package/dist/components/CheckboxGroup/CheckboxGroup.js.map +1 -0
  51. package/dist/components/CheckboxGroup/CheckboxGroup.styles.js +10 -0
  52. package/dist/components/CheckboxGroup/CheckboxGroup.styles.js.map +1 -0
  53. package/dist/components/CheckboxGroup/index.d.ts +2 -0
  54. package/dist/components/Chip/Chip.css.d.ts +2 -0
  55. package/dist/components/Chip/Chip.d.ts +15 -3
  56. package/dist/components/Chip/Chip.js +35 -16
  57. package/dist/components/Chip/Chip.js.map +1 -1
  58. package/dist/components/Chip/Chip.styles.js +2 -2
  59. package/dist/components/Chip/Chip.styles.js.map +1 -1
  60. package/dist/components/Chip/index.d.ts +1 -1
  61. package/dist/components/ColorPicker/ColorPicker.d.ts +3 -1
  62. package/dist/components/ColorPicker/ColorPicker.js +46 -47
  63. package/dist/components/ColorPicker/ColorPicker.js.map +1 -1
  64. package/dist/components/ColorPicker/ColorPicker.styles.js.map +1 -1
  65. package/dist/components/Combobox/Combobox.d.ts +28 -4
  66. package/dist/components/Combobox/Combobox.js +130 -109
  67. package/dist/components/Combobox/Combobox.js.map +1 -1
  68. package/dist/components/CopyButton/CopyButton.d.ts +11 -0
  69. package/dist/components/CopyButton/CopyButton.js +40 -0
  70. package/dist/components/CopyButton/CopyButton.js.map +1 -0
  71. package/dist/components/CopyButton/index.d.ts +2 -0
  72. package/dist/components/DateRangePicker/DateRangePicker.d.ts +10 -3
  73. package/dist/components/DateRangePicker/DateRangePicker.js +107 -110
  74. package/dist/components/DateRangePicker/DateRangePicker.js.map +1 -1
  75. package/dist/components/DateRangePicker/DateRangePicker.styles.js +2 -2
  76. package/dist/components/DateRangePicker/DateRangePicker.styles.js.map +1 -1
  77. package/dist/components/DateTimeInput/DateTimeInput.d.ts +1 -1
  78. package/dist/components/DateTimeInput/DateTimeInput.js +20 -28
  79. package/dist/components/DateTimeInput/DateTimeInput.js.map +1 -1
  80. package/dist/components/DateTimeInput/DateTimeInput.styles.js +1 -0
  81. package/dist/components/DescriptionList/DescriptionList.d.ts +8 -0
  82. package/dist/components/DescriptionList/DescriptionList.js +2 -1
  83. package/dist/components/DescriptionList/DescriptionList.js.map +1 -1
  84. package/dist/components/DetailsSummary/DetailsSummary.css.d.ts +1 -0
  85. package/dist/components/DetailsSummary/DetailsSummary.d.ts +5 -1
  86. package/dist/components/DetailsSummary/DetailsSummary.js +15 -15
  87. package/dist/components/DetailsSummary/DetailsSummary.js.map +1 -1
  88. package/dist/components/DetailsSummary/DetailsSummary.styles.js +10 -2
  89. package/dist/components/DetailsSummary/DetailsSummary.styles.js.map +1 -1
  90. package/dist/components/DetailsSummary/index.d.ts +1 -1
  91. package/dist/components/Drawer/Drawer.css.d.ts +3 -0
  92. package/dist/components/Drawer/Drawer.d.ts +24 -3
  93. package/dist/components/Drawer/Drawer.js +55 -46
  94. package/dist/components/Drawer/Drawer.js.map +1 -1
  95. package/dist/components/Drawer/Drawer.styles.js +7 -2
  96. package/dist/components/Drawer/Drawer.styles.js.map +1 -1
  97. package/dist/components/EmptyState/EmptyState.css.d.ts +16 -0
  98. package/dist/components/EmptyState/EmptyState.d.ts +15 -0
  99. package/dist/components/EmptyState/EmptyState.js +37 -0
  100. package/dist/components/EmptyState/EmptyState.js.map +1 -0
  101. package/dist/components/EmptyState/EmptyState.styles.js +15 -0
  102. package/dist/components/EmptyState/EmptyState.styles.js.map +1 -0
  103. package/dist/components/EmptyState/index.d.ts +2 -0
  104. package/dist/components/EnvironmentChip/EnvironmentChip.css.d.ts +5 -0
  105. package/dist/components/EnvironmentChip/EnvironmentChip.d.ts +13 -5
  106. package/dist/components/EnvironmentChip/EnvironmentChip.js +14 -3
  107. package/dist/components/EnvironmentChip/EnvironmentChip.js.map +1 -1
  108. package/dist/components/EnvironmentChip/EnvironmentChip.styles.js +3 -2
  109. package/dist/components/EnvironmentChip/EnvironmentChip.styles.js.map +1 -1
  110. package/dist/components/EnvironmentChip/index.d.ts +2 -2
  111. package/dist/components/Field/Field.css.d.ts +0 -1
  112. package/dist/components/Field/Field.d.ts +11 -28
  113. package/dist/components/Field/Field.js +25 -36
  114. package/dist/components/Field/Field.js.map +1 -1
  115. package/dist/components/Field/Field.styles.js +2 -2
  116. package/dist/components/Field/Field.styles.js.map +1 -1
  117. package/dist/components/Field/index.d.ts +1 -1
  118. package/dist/components/Fieldset/Fieldset.d.ts +1 -0
  119. package/dist/components/Fieldset/Fieldset.js.map +1 -1
  120. package/dist/components/Fieldset/Fieldset.styles.js.map +1 -1
  121. package/dist/components/Grid/Grid.css.d.ts +22 -0
  122. package/dist/components/Grid/Grid.d.ts +21 -0
  123. package/dist/components/Grid/Grid.js +23 -0
  124. package/dist/components/Grid/Grid.js.map +1 -0
  125. package/dist/components/Grid/Grid.styles.js +28 -0
  126. package/dist/components/Grid/Grid.styles.js.map +1 -0
  127. package/dist/components/Grid/index.d.ts +2 -0
  128. package/dist/components/List/List.d.ts +1 -0
  129. package/dist/components/List/List.js.map +1 -1
  130. package/dist/components/Loader/Loader.d.ts +1 -1
  131. package/dist/components/Loader/Loader.js +6 -2
  132. package/dist/components/Loader/Loader.js.map +1 -1
  133. package/dist/components/Menu/Menu.d.ts +25 -1
  134. package/dist/components/Menu/Menu.js +1 -1
  135. package/dist/components/Menu/Menu.js.map +1 -1
  136. package/dist/components/Menu/Menu.styles.js.map +1 -1
  137. package/dist/components/MetricBar/MetricBar.css.d.ts +5 -0
  138. package/dist/components/MetricBar/MetricBar.d.ts +9 -1
  139. package/dist/components/MetricBar/MetricBar.js +38 -22
  140. package/dist/components/MetricBar/MetricBar.js.map +1 -1
  141. package/dist/components/MetricBar/MetricBar.styles.js +15 -10
  142. package/dist/components/MetricBar/MetricBar.styles.js.map +1 -1
  143. package/dist/components/Modal/Modal.d.ts +6 -0
  144. package/dist/components/Modal/Modal.js +25 -28
  145. package/dist/components/Modal/Modal.js.map +1 -1
  146. package/dist/components/Modal/Modal.styles.js +2 -1
  147. package/dist/components/Modal/Modal.styles.js.map +1 -1
  148. package/dist/components/NavRail/NavRail.css.d.ts +2 -0
  149. package/dist/components/NavRail/NavRail.d.ts +22 -7
  150. package/dist/components/NavRail/NavRail.js +79 -58
  151. package/dist/components/NavRail/NavRail.js.map +1 -1
  152. package/dist/components/NavRail/NavRail.styles.js +3 -2
  153. package/dist/components/NavRail/NavRail.styles.js.map +1 -1
  154. package/dist/components/NavRail/index.d.ts +1 -1
  155. package/dist/components/NumberInput/NumberInput.d.ts +9 -1
  156. package/dist/components/NumberInput/NumberInput.js +37 -31
  157. package/dist/components/NumberInput/NumberInput.js.map +1 -1
  158. package/dist/components/PageHeader/PageHeader.css.d.ts +1 -1
  159. package/dist/components/PageHeader/PageHeader.d.ts +3 -1
  160. package/dist/components/PageHeader/PageHeader.js +21 -23
  161. package/dist/components/PageHeader/PageHeader.js.map +1 -1
  162. package/dist/components/PageHeader/PageHeader.styles.js +1 -1
  163. package/dist/components/PageHeader/PageHeader.styles.js.map +1 -1
  164. package/dist/components/Pagination/Pagination.d.ts +5 -0
  165. package/dist/components/Pagination/Pagination.js.map +1 -1
  166. package/dist/components/Popover/Popover.d.ts +9 -1
  167. package/dist/components/Popover/Popover.js +7 -6
  168. package/dist/components/Popover/Popover.js.map +1 -1
  169. package/dist/components/Popover/Popover.styles.js.map +1 -1
  170. package/dist/components/PortalContainer/PortalContainer.d.ts +1 -0
  171. package/dist/components/PortalContainer/PortalContainer.js.map +1 -1
  172. package/dist/components/ProgressBar/ProgressBar.css.d.ts +3 -0
  173. package/dist/components/ProgressBar/ProgressBar.d.ts +5 -1
  174. package/dist/components/ProgressBar/ProgressBar.js +21 -7
  175. package/dist/components/ProgressBar/ProgressBar.js.map +1 -1
  176. package/dist/components/ProgressBar/ProgressBar.styles.js +6 -6
  177. package/dist/components/ProgressBar/ProgressBar.styles.js.map +1 -1
  178. package/dist/components/RadioCards/RadioCards.d.ts +8 -2
  179. package/dist/components/RadioCards/RadioCards.js +40 -44
  180. package/dist/components/RadioCards/RadioCards.js.map +1 -1
  181. package/dist/components/SaveBar/SaveBar.d.ts +6 -1
  182. package/dist/components/SaveBar/SaveBar.js +1 -2
  183. package/dist/components/SaveBar/SaveBar.js.map +1 -1
  184. package/dist/components/SaveBar/SaveBar.styles.js.map +1 -1
  185. package/dist/components/Select/Select.css.d.ts +2 -0
  186. package/dist/components/Select/Select.d.ts +32 -5
  187. package/dist/components/Select/Select.js +91 -62
  188. package/dist/components/Select/Select.js.map +1 -1
  189. package/dist/components/Select/Select.styles.js +3 -2
  190. package/dist/components/Select/Select.styles.js.map +1 -1
  191. package/dist/components/Skeleton/Skeleton.d.ts +2 -0
  192. package/dist/components/Skeleton/Skeleton.js +20 -19
  193. package/dist/components/Skeleton/Skeleton.js.map +1 -1
  194. package/dist/components/Stack/Stack.css.d.ts +4 -1
  195. package/dist/components/Stack/Stack.d.ts +7 -3
  196. package/dist/components/Stack/Stack.js.map +1 -1
  197. package/dist/components/Stack/Stack.styles.js +16 -23
  198. package/dist/components/Stack/Stack.styles.js.map +1 -1
  199. package/dist/components/StatCard/StatCard.d.ts +3 -0
  200. package/dist/components/StatCard/StatCard.js.map +1 -1
  201. package/dist/components/StatCard/StatCard.styles.js.map +1 -1
  202. package/dist/components/StatsGrid/StatsGrid.d.ts +3 -6
  203. package/dist/components/StatsGrid/StatsGrid.js +3 -7
  204. package/dist/components/StatsGrid/StatsGrid.js.map +1 -1
  205. package/dist/components/StatusBadge/StatusBadge.d.ts +3 -2
  206. package/dist/components/StatusBadge/StatusBadge.js.map +1 -1
  207. package/dist/components/Switch/Switch.d.ts +2 -1
  208. package/dist/components/Switch/Switch.js +27 -31
  209. package/dist/components/Switch/Switch.js.map +1 -1
  210. package/dist/components/Switcher/Switcher.css.d.ts +0 -1
  211. package/dist/components/Switcher/Switcher.d.ts +13 -1
  212. package/dist/components/Switcher/Switcher.js +35 -35
  213. package/dist/components/Switcher/Switcher.js.map +1 -1
  214. package/dist/components/Switcher/Switcher.styles.js +2 -2
  215. package/dist/components/Switcher/Switcher.styles.js.map +1 -1
  216. package/dist/components/Table/Table.css.d.ts +16 -1
  217. package/dist/components/Table/Table.d.ts +110 -13
  218. package/dist/components/Table/Table.js +214 -102
  219. package/dist/components/Table/Table.js.map +1 -1
  220. package/dist/components/Table/Table.styles.js +7 -6
  221. package/dist/components/Table/Table.styles.js.map +1 -1
  222. package/dist/components/Table/index.d.ts +1 -1
  223. package/dist/components/Tabs/Tabs.d.ts +23 -8
  224. package/dist/components/Tabs/Tabs.js +1 -1
  225. package/dist/components/Tabs/Tabs.js.map +1 -1
  226. package/dist/components/Tabs/Tabs.styles.js.map +1 -1
  227. package/dist/components/Tabs/index.d.ts +1 -1
  228. package/dist/components/Tag/Tag.css.d.ts +33 -0
  229. package/dist/components/Tag/Tag.d.ts +5 -2
  230. package/dist/components/Tag/Tag.js +23 -6
  231. package/dist/components/Tag/Tag.js.map +1 -1
  232. package/dist/components/Tag/Tag.styles.js +12 -1
  233. package/dist/components/Tag/Tag.styles.js.map +1 -1
  234. package/dist/components/Tag/index.d.ts +1 -1
  235. package/dist/components/TextInput/TextInput.d.ts +13 -2
  236. package/dist/components/TextInput/TextInput.js +45 -48
  237. package/dist/components/TextInput/TextInput.js.map +1 -1
  238. package/dist/components/Textarea/Textarea.css.d.ts +2 -0
  239. package/dist/components/Textarea/Textarea.d.ts +5 -2
  240. package/dist/components/Textarea/Textarea.js +37 -37
  241. package/dist/components/Textarea/Textarea.js.map +1 -1
  242. package/dist/components/Textarea/Textarea.styles.js +3 -2
  243. package/dist/components/Textarea/Textarea.styles.js.map +1 -1
  244. package/dist/components/ThemeMenu/ThemeMenu.d.ts +13 -0
  245. package/dist/components/ThemeMenu/ThemeMenu.js +52 -0
  246. package/dist/components/ThemeMenu/ThemeMenu.js.map +1 -0
  247. package/dist/components/ThemeMenu/index.d.ts +2 -0
  248. package/dist/components/ThemePicker/ThemePicker.d.ts +9 -1
  249. package/dist/components/ThemePicker/ThemePicker.js +3 -1
  250. package/dist/components/ThemePicker/ThemePicker.js.map +1 -1
  251. package/dist/components/TimeInput/TimeInput.d.ts +10 -0
  252. package/dist/components/TimeInput/TimeInput.js +29 -0
  253. package/dist/components/TimeInput/TimeInput.js.map +1 -0
  254. package/dist/components/TimeInput/index.d.ts +2 -0
  255. package/dist/components/ToggleGroup/ToggleGroup.d.ts +30 -10
  256. package/dist/components/ToggleGroup/ToggleGroup.js +60 -59
  257. package/dist/components/ToggleGroup/ToggleGroup.js.map +1 -1
  258. package/dist/components/ToggleGroup/ToggleGroup.styles.js.map +1 -1
  259. package/dist/components/ToggleGroup/index.d.ts +1 -1
  260. package/dist/components/Tooltip/Tooltip.css.d.ts +0 -1
  261. package/dist/components/Tooltip/Tooltip.d.ts +9 -5
  262. package/dist/components/Tooltip/Tooltip.js +9 -9
  263. package/dist/components/Tooltip/Tooltip.js.map +1 -1
  264. package/dist/components/Tooltip/Tooltip.styles.js +2 -2
  265. package/dist/components/Tooltip/Tooltip.styles.js.map +1 -1
  266. package/dist/components/TopBar/TopBar.styles.js.map +1 -1
  267. package/dist/components/UserMenu/UserMenu.d.ts +4 -3
  268. package/dist/components/UserMenu/UserMenu.js.map +1 -1
  269. package/dist/examples/Crm.css.d.ts +3 -0
  270. package/dist/examples/ExampleShell.d.ts +28 -0
  271. package/dist/examples/Expenses.css.d.ts +2 -0
  272. package/dist/examples/HiringTracker.css.d.ts +13 -0
  273. package/dist/examples/SalesPipeline.css.d.ts +11 -0
  274. package/dist/foundations/Foundations.css.d.ts +1 -1
  275. package/dist/index.d.ts +6 -0
  276. package/dist/index.js +51 -45
  277. package/dist/styles/input.css.d.ts +8 -0
  278. package/dist/styles/input.styles.js +3 -2
  279. package/dist/styles/input.styles.js.map +1 -1
  280. package/dist/styles/shared.css.d.ts +5 -0
  281. package/dist/styles/shared.styles.js.map +1 -1
  282. package/dist/styles.css +1 -1
  283. package/dist/theme/fontSize.d.ts +4 -4
  284. package/dist/theme/fontSize.js +8 -23
  285. package/dist/theme/fontSize.js.map +1 -1
  286. package/dist/theme/htmlSetting.d.ts +14 -0
  287. package/dist/theme/htmlSetting.js +33 -0
  288. package/dist/theme/htmlSetting.js.map +1 -0
  289. package/dist/theme/theme.d.ts +4 -4
  290. package/dist/theme/theme.js +18 -33
  291. package/dist/theme/theme.js.map +1 -1
  292. package/dist/tokens/index.d.ts +0 -2
  293. package/dist/tokens.js +1 -2
  294. package/package.json +8 -3
  295. package/skills/back-office-kit/SKILL.md +27 -14
  296. package/skills/back-office-kit/references/artifact-template.html +1 -0
  297. package/skills/back-office-kit/references/components.md +482 -251
  298. package/skills/back-office-kit/references/install.md +27 -4
  299. package/skills/back-office-kit/references/migrate.md +58 -2
  300. package/skills/back-office-kit/references/patterns.md +129 -33
  301. package/skills/back-office-kit/references/testing.md +26 -22
  302. package/dist/tokens/sprinkles.css.d.ts +0 -38
  303. package/dist/tokens/sprinkles.styles.js +0 -349
  304. package/dist/tokens/sprinkles.styles.js.map +0 -1
@@ -1,40 +1,40 @@
1
1
  import { body as e, calendar as t, caption as n, captionLabel as r, day as i, dayButton as a, disabled as o, footer as ee, grid as s, icon as te, month as c, months as l, nav as u, navButton as d, outside as f, popup as ne, rangeEnd as p, rangeMiddle as m, rangeStart as h, selected as g, status as re, today as _, trigger as ie, value as ae, weekday as v } from "./DateRangePicker.styles.js";
2
2
  import { getDefaultPresets as oe, inZone as y } from "./presets.js";
3
3
  import { popoverLayer as se } from "../../styles/shared.styles.js";
4
- import { Button as ce } from "../Button/Button.js";
5
- import { FieldLabelText as le, FieldMessages as ue, hasError as de, labelClass as fe } from "../Field/Field.js";
6
- import { root as pe } from "../Field/Field.styles.js";
7
- import { usePortalContainer as me } from "../PortalContainer/PortalContainer.js";
8
- import { useId as he, useRef as ge, useState as b, useSyncExternalStore as x } from "react";
9
- import { clsx as S } from "clsx";
10
- import { CalendarDays as _e, ChevronLeft as C, ChevronRight as w } from "lucide-react";
11
- import { jsx as T, jsxs as E } from "react/jsx-runtime";
12
- import { Field as ve } from "@base-ui/react/field";
13
- import { Popover as D } from "@base-ui/react/popover";
14
- import { DayPicker as ye } from "react-day-picker";
4
+ import { Button as b } from "../Button/Button.js";
5
+ import { FieldLabelText as ce, FieldMessages as le, hasError as ue, labelClass as de } from "../Field/Field.js";
6
+ import { root as fe } from "../Field/Field.styles.js";
7
+ import { usePortalContainer as pe } from "../PortalContainer/PortalContainer.js";
8
+ import { useId as me, useRef as he, useState as x, useSyncExternalStore as S } from "react";
9
+ import { clsx as C } from "clsx";
10
+ import { CalendarDays as ge, ChevronLeft as w, ChevronRight as T } from "lucide-react";
11
+ import { jsx as E, jsxs as D } from "react/jsx-runtime";
12
+ import { Field as _e } from "@base-ui/react/field";
13
+ import { Popover as O } from "@base-ui/react/popover";
14
+ import { DayPicker as ve } from "react-day-picker";
15
15
  // src/components/DateRangePicker/DateRangePicker.tsx
16
- var be = {
16
+ var ye = {
17
17
  start: null,
18
18
  end: null
19
- }, O = "(min-width: 48em)", k = (e) => {
20
- let t = window.matchMedia(O);
21
- return t.addEventListener("change", e), () => t.removeEventListener("change", e);
22
- }, xe = () => x(k, () => window.matchMedia(O).matches, () => !0), A = (e) => String(e).padStart(2, "0"), j = (e, t, n) => {
19
+ }, k = "(min-width: 48em)", A = () => typeof window < "u" && typeof window.matchMedia == "function" ? window.matchMedia(k) : null, j = (e) => {
20
+ let t = A();
21
+ return t?.addEventListener("change", e), () => t?.removeEventListener("change", e);
22
+ }, be = () => S(j, () => A()?.matches ?? !0, () => !0), M = (e) => String(e).padStart(2, "0"), N = (e, t, n) => {
23
23
  if (!e) return n;
24
24
  let r = y(e, t);
25
- return `${A(r.getHours())}:${A(r.getMinutes())}`;
26
- }, M = (e, t, n, r) => {
25
+ return `${M(r.getHours())}:${M(r.getMinutes())}`;
26
+ }, P = (e, t, n, r) => {
27
27
  let [i = 0, a = 0] = t.split(":").map(Number), o = y(e, n);
28
28
  return o.setHours(i, a, r ? 59 : 0, r ? 999 : 0), new Date(o.getTime());
29
29
  };
30
- function Se({ orientation: e, className: t }) {
31
- return /* @__PURE__ */ T(e === "left" ? C : w, {
30
+ function xe({ orientation: e, className: t }) {
31
+ return /* @__PURE__ */ E(e === "left" ? w : T, {
32
32
  size: "1.125em",
33
33
  "aria-hidden": !0,
34
34
  className: t
35
35
  });
36
36
  }
37
- var Ce = {
37
+ var Se = {
38
38
  root: t,
39
39
  months: l,
40
40
  month: c,
@@ -55,190 +55,187 @@ var Ce = {
55
55
  disabled: o,
56
56
  outside: f
57
57
  };
58
- function N({ label: t, description: n, error: r, required: i, showRequired: a, requiredIndicator: o, optionalText: s, hideLabel: c, fieldProps: l, disabled: u, className: d, value: f, defaultValue: p = be, onValueChange: m, placeholder: h = "Select a date range", presets: g, minDate: _, maxDate: v, weekStartsOn: y = 1, locale: x, withTime: C = !1, timeZone: w, portalContainer: O, presetsLabel: k = "Quick ranges", applyLabel: A = "Apply", cancelLabel: N = "Cancel", startTimeLabel: we = "Start time", endTimeLabel: Te = "End time", triggerProps: P, popupProps: F }) {
59
- let I = he(), L = {
58
+ function F({ label: t, description: n, error: r, required: i, hideLabel: a, fieldProps: o, disabled: s, className: c, value: l, defaultValue: u = ye, onValueChange: d, placeholder: f = "Select a date range", presets: p, minDate: m, maxDate: h, weekStartsOn: g = 1, locale: _, withTime: v = !1, timeZone: y, portalContainer: S, presetsLabel: w = "Quick ranges", applyLabel: T = "Apply", cancelLabel: k = "Cancel", startTimeLabel: A = "Start time", endTimeLabel: j = "End time", triggerProps: M, popupProps: F }) {
59
+ let I = me(), L = {
60
60
  label: `${I}-label`,
61
61
  value: `${I}-value`,
62
62
  description: `${I}-description`,
63
63
  error: `${I}-error`
64
- }, R = me(O), Ee = xe(), z = ge(null), [De, Oe] = b(p), B = f === void 0 ? De : f, [ke, V] = b(!1), [H, U] = b(), [W, G] = b("00:00"), [K, q] = b("23:59"), Ae = x?.code ?? "en-GB", je = new Intl.DateTimeFormat(Ae, {
64
+ }, R = pe(S), Ce = be(), z = he(null), [we, Te] = x(u), B = l === void 0 ? we : l, [Ee, V] = x(!1), [H, U] = x(), [W, G] = x("00:00"), [K, q] = x("23:59"), De = _?.code ?? "en-GB", Oe = new Intl.DateTimeFormat(De, {
65
65
  weekday: "long",
66
66
  day: "numeric",
67
67
  month: "long",
68
68
  year: "numeric",
69
- timeZone: w
70
- }), Me = { labelDayButton: (e, { today: t, selected: n }) => [
69
+ timeZone: y
70
+ }), ke = { labelDayButton: (e, { today: t, selected: n }) => [
71
71
  t && "Today",
72
- je.format(e),
72
+ Oe.format(e),
73
73
  n && "selected"
74
- ].filter(Boolean).join(", ") }, J = new Intl.DateTimeFormat(Ae, {
74
+ ].filter(Boolean).join(", ") }, Ae = new Intl.DateTimeFormat(De, {
75
75
  day: "numeric",
76
76
  month: "short",
77
77
  year: "numeric",
78
- ...C && {
78
+ ...v && {
79
79
  hour: "2-digit",
80
80
  minute: "2-digit",
81
81
  hourCycle: "h23"
82
82
  },
83
- timeZone: w
84
- }), Y = ({ start: e, end: t }) => {
83
+ timeZone: y
84
+ }), J = ({ start: e, end: t }) => {
85
85
  if (!e) return "";
86
- let n = J.format(e), r = t ? J.format(t) : "";
86
+ let n = Ae.format(e), r = t ? Ae.format(t) : "";
87
87
  return !r || r === n ? n : `${n} – ${r}`;
88
- }, Ne = ({ start: e, end: t }) => ({
89
- start: _ && e < _ ? _ : e,
90
- end: v && t > v ? v : t
91
- }), Pe = (e, t) => {
92
- let n = Ne(e);
93
- Oe(n), m?.(n, { preset: t }), V(!1);
94
- }, Fe = (e) => {
88
+ }, Y = h && P(h, "23:59", y, !0), je = ({ start: e, end: t }) => ({
89
+ start: m && e < m ? m : e,
90
+ end: Y && t > Y ? Y : t
91
+ }), Me = (e, t) => {
92
+ let n = je(e);
93
+ Te(n), d?.(n, { preset: t }), V(!1);
94
+ }, Ne = (e) => {
95
95
  e && (U(B.start ? {
96
96
  from: B.start,
97
97
  to: B.end ?? B.start
98
- } : void 0), G(j(B.start, w, "00:00")), q(j(B.end, w, "23:59"))), V(e);
98
+ } : void 0), G(N(B.start, y, "00:00")), q(N(B.end, y, "23:59"))), V(e);
99
99
  }, X = {
100
- start: H?.from ? M(H.from, C ? W : "00:00", w, !1) : null,
101
- end: H?.to ? M(H.to, C ? K : "23:59", w, !0) : null
100
+ start: H?.from ? P(H.from, v ? W : "00:00", y, !1) : null,
101
+ end: H?.to ? P(H.to, v ? K : "23:59", y, !0) : null
102
102
  }, Z = X.start && X.end && X.start <= X.end ? {
103
103
  start: X.start,
104
104
  end: X.end
105
- } : null, Ie = H?.from ? H.to ? Y(X) : `${Y({
105
+ } : null, Pe = H?.from ? H.to ? J(X) : `${J({
106
106
  start: X.start,
107
107
  end: null
108
- })}, pick an end date` : "Pick a start date", Le = g ?? oe(w), Q = de(r), Re = [n != null && L.description, Q && L.error].filter(Boolean).join(" "), $ = Y(B), ze = typeof t == "string" ? t : "Date range";
109
- return /* @__PURE__ */ E(ve.Root, {
110
- ...l,
108
+ })}, pick an end date` : "Pick a start date", Fe = p ?? oe(y), Q = ue(r), Ie = [n != null && L.description, Q && L.error].filter(Boolean).join(" "), $ = J(B), Le = typeof t == "string" ? t : "Date range";
109
+ return /* @__PURE__ */ D(_e.Root, {
110
+ ...o,
111
111
  invalid: Q || void 0,
112
- disabled: u,
113
- className: S(pe, l?.className, d),
112
+ disabled: s,
113
+ className: C(fe, o?.className, c),
114
114
  children: [
115
- t != null && /* @__PURE__ */ T("div", {
115
+ t != null && /* @__PURE__ */ E("div", {
116
116
  id: L.label,
117
- className: fe("oe0y262", c),
118
- children: /* @__PURE__ */ T(le, {
117
+ className: de("oe0y262", a),
118
+ children: /* @__PURE__ */ E(ce, {
119
119
  label: t,
120
- required: i,
121
- showRequired: a,
122
- requiredIndicator: o,
123
- optionalText: s
120
+ required: i
124
121
  })
125
122
  }),
126
- /* @__PURE__ */ E(D.Root, {
127
- open: ke,
128
- onOpenChange: Fe,
129
- children: [/* @__PURE__ */ E(D.Trigger, {
123
+ /* @__PURE__ */ D(O.Root, {
124
+ open: Ee,
125
+ onOpenChange: Ne,
126
+ children: [/* @__PURE__ */ D(O.Trigger, {
130
127
  "aria-labelledby": t == null ? void 0 : `${L.label} ${L.value}`,
131
- "aria-describedby": Re || void 0,
128
+ "aria-describedby": Ie || void 0,
132
129
  "aria-invalid": Q || void 0,
133
- disabled: u,
134
- ...P,
135
- className: S(ie, P?.className),
136
- children: [/* @__PURE__ */ T("span", {
130
+ disabled: s,
131
+ ...M,
132
+ className: C(ie, M?.className),
133
+ children: [/* @__PURE__ */ E("span", {
137
134
  id: L.value,
138
135
  className: ae,
139
136
  "data-placeholder": !$ || void 0,
140
- children: $ || h
141
- }), /* @__PURE__ */ T(_e, {
137
+ children: $ || f
138
+ }), /* @__PURE__ */ E(ge, {
142
139
  size: "1.125em",
143
140
  "aria-hidden": !0,
144
141
  className: te
145
142
  })]
146
- }), /* @__PURE__ */ T(D.Portal, {
143
+ }), /* @__PURE__ */ E(O.Portal, {
147
144
  container: R,
148
- children: /* @__PURE__ */ T(D.Positioner, {
145
+ children: /* @__PURE__ */ E(O.Positioner, {
149
146
  className: se,
150
147
  align: "start",
151
148
  sideOffset: 4,
152
149
  collisionPadding: 8,
153
150
  positionMethod: R ? "fixed" : "absolute",
154
- children: /* @__PURE__ */ E(D.Popup, {
155
- "aria-label": ze,
151
+ children: /* @__PURE__ */ D(O.Popup, {
152
+ "aria-label": Le,
156
153
  initialFocus: () => z.current?.querySelector("button[tabindex=\"0\"]") ?? !0,
157
154
  ...F,
158
- className: S(ne, F?.className),
159
- children: [Le.length > 0 && /* @__PURE__ */ T("ul", {
160
- "aria-label": k,
155
+ className: C(ne, F?.className),
156
+ children: [Fe.length > 0 && /* @__PURE__ */ E("ul", {
157
+ "aria-label": w,
161
158
  className: "bnrk794",
162
- children: Le.map((e) => /* @__PURE__ */ T("li", { children: /* @__PURE__ */ T("button", {
159
+ children: Fe.map((e) => /* @__PURE__ */ E("li", { children: /* @__PURE__ */ E("button", {
163
160
  type: "button",
164
161
  className: "bnrk795 tyvs8e0",
165
- onClick: () => Pe(e.range(), e),
162
+ onClick: () => Me(e.range(), e),
166
163
  children: e.label
167
164
  }) }, e.label))
168
- }), /* @__PURE__ */ E("div", {
165
+ }), /* @__PURE__ */ D("div", {
169
166
  className: e,
170
167
  ref: z,
171
168
  children: [
172
- /* @__PURE__ */ T(ye, {
169
+ /* @__PURE__ */ E(ve, {
173
170
  mode: "range",
174
171
  selected: H,
175
172
  onSelect: U,
176
173
  resetOnSelect: !0,
177
- numberOfMonths: Ee ? 2 : 1,
178
- defaultMonth: B.start ?? v ?? void 0,
179
- startMonth: _,
180
- endMonth: v,
181
- disabled: [..._ ? [{ before: _ }] : [], ...v ? [{ after: v }] : []],
182
- weekStartsOn: y,
183
- locale: x,
184
- timeZone: w,
185
- classNames: Ce,
186
- labels: Me,
187
- components: { Chevron: Se }
174
+ numberOfMonths: Ce ? 2 : 1,
175
+ defaultMonth: B.start ?? h ?? void 0,
176
+ startMonth: m,
177
+ endMonth: h,
178
+ disabled: [...m ? [{ before: m }] : [], ...h ? [{ after: h }] : []],
179
+ weekStartsOn: g,
180
+ locale: _,
181
+ timeZone: y,
182
+ classNames: Se,
183
+ labels: ke,
184
+ components: { Chevron: xe }
188
185
  }),
189
- C && /* @__PURE__ */ E("div", {
186
+ v && /* @__PURE__ */ D("div", {
190
187
  className: "bnrk79p",
191
188
  children: [
192
- /* @__PURE__ */ E("label", {
189
+ /* @__PURE__ */ D("label", {
193
190
  className: "bnrk79q",
194
- children: [/* @__PURE__ */ T("span", {
191
+ children: [/* @__PURE__ */ E("span", {
195
192
  className: "oe0y262",
196
- children: we
197
- }), /* @__PURE__ */ T("input", {
193
+ children: A
194
+ }), /* @__PURE__ */ E("input", {
198
195
  type: "time",
199
196
  className: "bnrk79r _12aoxdm0",
200
197
  value: W,
201
198
  onChange: (e) => G(e.target.value)
202
199
  })]
203
200
  }),
204
- /* @__PURE__ */ E("label", {
201
+ /* @__PURE__ */ D("label", {
205
202
  className: "bnrk79q",
206
- children: [/* @__PURE__ */ T("span", {
203
+ children: [/* @__PURE__ */ E("span", {
207
204
  className: "oe0y262",
208
- children: Te
209
- }), /* @__PURE__ */ T("input", {
205
+ children: j
206
+ }), /* @__PURE__ */ E("input", {
210
207
  type: "time",
211
208
  className: "bnrk79r _12aoxdm0",
212
209
  value: K,
213
210
  onChange: (e) => q(e.target.value)
214
211
  })]
215
212
  }),
216
- w && /* @__PURE__ */ T("span", {
213
+ y && /* @__PURE__ */ E("span", {
217
214
  className: "bnrk79s",
218
- children: w
215
+ children: y
219
216
  })
220
217
  ]
221
218
  }),
222
- /* @__PURE__ */ E("div", {
219
+ /* @__PURE__ */ D("div", {
223
220
  className: ee,
224
221
  children: [
225
- /* @__PURE__ */ T("div", {
222
+ /* @__PURE__ */ E("div", {
226
223
  role: "status",
227
224
  "aria-live": "polite",
228
225
  className: re,
229
- children: Ie
226
+ children: Pe
230
227
  }),
231
- /* @__PURE__ */ T(ce, {
228
+ /* @__PURE__ */ E(b, {
232
229
  variant: "secondary",
233
230
  size: "sm",
234
- onClick: () => Fe(!1),
235
- children: N
231
+ onClick: () => Ne(!1),
232
+ children: k
236
233
  }),
237
- /* @__PURE__ */ T(ce, {
234
+ /* @__PURE__ */ E(b, {
238
235
  size: "sm",
239
236
  disabled: !Z,
240
- onClick: () => Z && Pe(Z),
241
- children: A
237
+ onClick: () => Z && Me(Z),
238
+ children: T
242
239
  })
243
240
  ]
244
241
  })
@@ -248,7 +245,7 @@ function N({ label: t, description: n, error: r, required: i, showRequired: a, r
248
245
  })
249
246
  })]
250
247
  }),
251
- /* @__PURE__ */ T(ue, {
248
+ /* @__PURE__ */ E(le, {
252
249
  description: n,
253
250
  error: r,
254
251
  ids: L
@@ -256,6 +253,6 @@ function N({ label: t, description: n, error: r, required: i, showRequired: a, r
256
253
  ]
257
254
  });
258
255
  }
259
- export { N as DateRangePicker };
256
+ export { F as DateRangePicker };
260
257
 
261
258
  //# sourceMappingURL=DateRangePicker.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DateRangePicker.js","names":["styles.calendar","styles.months","styles.month","styles.caption","styles.captionLabel","styles.nav","styles.navButton","styles.grid","styles.weekday","styles.day","styles.dayButton","styles.today","styles.selected","styles.rangeStart","styles.rangeEnd","styles.rangeMiddle","styles.disabled","styles.outside","value","status","presets","label","BaseField","fieldStyles.root","BasePopover","styles.trigger","styles.value","styles.icon","styles.popup","preset","styles.body","styles.footer","styles.status","EMPTY","WIDE","subscribeWide","query","notify","useWide","useSyncExternalStore","pad","n","toTime","date","fallback","zoned","inZone","timeZone","atTime","hours","minutes","time","day","isEnd","Chevron","orientation","ChevronLeft","ChevronRight","classNames","calendar","caption","captionLabel","navButton","grid","dayButton","rangeStart","rangeEnd","rangeMiddle","DateRangePicker","label$1","value$1","presets$1","id","useId","ids","container","usePortalContainer","portalContainer","wide","calendarRef","useRef","inner","setInner","useState","defaultValue","committed","open","setOpen","draft","setDraft","startTime","setStartTime","endTime","setEndTime","lang","locale","dayName","labels","today","selected","format","withTime","formatRange","start","from","to","end","clamp","minDate","maxDate","commit","next","range","onValueChange","handleOpenChange","draftRange","complete","status$1","items","getDefaultPresets","invalid","hasError","error","describedBy","description","text","dialogLabel","Field","fieldProps","clsx","root","className","labelClass","hideLabel","FieldLabelText","Popover","triggerProps","trigger","value","placeholder","CalendarDays","icon","popoverLayer","popupProps","popup","presetsLabel","preset$1","body","DayPicker","startTimeLabel","event","endTimeLabel","footer","status","Button","cancelLabel","applyLabel","FieldMessages"],"sources":["../../../src/components/DateRangePicker/DateRangePicker.tsx"],"sourcesContent":["import { Field as BaseField } from '@base-ui/react/field'\nimport { Popover as BasePopover } from '@base-ui/react/popover'\nimport { clsx } from 'clsx'\nimport { CalendarDays, ChevronLeft, ChevronRight } from 'lucide-react'\nimport { useId, useRef, useState, useSyncExternalStore } from 'react'\nimport {\n DayPicker,\n type ChevronProps,\n type ClassNames,\n type DateRange as DayRange,\n type DayPickerLocale,\n type Modifiers,\n} from 'react-day-picker'\n\nimport * as styles from './DateRangePicker.css'\nimport {\n getDefaultPresets,\n inZone,\n type DateRange,\n type DateRangePreset,\n type FullDateRange,\n} from './presets'\nimport { popoverLayer } from '../../styles/shared.css'\nimport { Button } from '../Button'\nimport {\n FieldLabelText,\n FieldMessages,\n hasError,\n labelClass,\n type FieldBaseProps,\n type FieldOptionProps,\n type PartProps,\n} from '../Field/Field'\nimport * as fieldStyles from '../Field/Field.css'\nimport { usePortalContainer, type PortalContainerTarget } from '../PortalContainer'\n\nexport interface DateRangePickerProps extends FieldBaseProps, FieldOptionProps {\n value?: DateRange\n defaultValue?: DateRange\n /**\n * Called with the new range on Apply or when a quick range is chosen. `details.preset` is the\n * chosen quick range, so a preset can trigger extra behaviour (e.g. a live mode).\n */\n onValueChange?: (range: DateRange, details: { preset?: DateRangePreset }) => void\n /** Trigger text while no range is set. */\n placeholder?: string\n /** Quick ranges beside the calendar. Replaces the defaults; `[]` hides the list. */\n presets?: DateRangePreset[]\n /** Earliest selectable day. */\n minDate?: Date\n /** Latest selectable day. */\n maxDate?: Date\n /** First day of the week (0 is Sunday). */\n weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6\n /** Calendar locale, e.g. `enGB` from `react-day-picker/locale`. Its `code` also formats the trigger. */\n locale?: Partial<DayPickerLocale>\n /** Adds start and end time inputs. Without it, a range runs from the start of its first day to the end of its last. */\n withTime?: boolean\n /** IANA zone (e.g. `'UTC'`) that days and times are shown and picked in. Defaults to local time. */\n timeZone?: string\n /** Where the popup renders. Defaults to the nearest `PortalContainer`, else `document.body`. */\n portalContainer?: PortalContainerTarget\n presetsLabel?: string\n applyLabel?: string\n cancelLabel?: string\n startTimeLabel?: string\n endTimeLabel?: string\n /** Goes on the field root. */\n className?: string\n /** Props for the trigger button, e.g. `{ 'data-testid': 'range' }`. */\n triggerProps?: PartProps<BasePopover.Trigger.Props>\n /** Props for the popup (role `dialog`). */\n popupProps?: PartProps<BasePopover.Popup.Props>\n}\n\nconst EMPTY: DateRange = { start: null, end: null }\nconst WIDE = '(min-width: 48em)'\n\nconst subscribeWide = (notify: () => void) => {\n const query = window.matchMedia(WIDE)\n query.addEventListener('change', notify)\n return () => query.removeEventListener('change', notify)\n}\nconst useWide = () =>\n useSyncExternalStore(\n subscribeWide,\n () => window.matchMedia(WIDE).matches,\n () => true,\n )\n\nconst pad = (n: number) => String(n).padStart(2, '0')\nconst toTime = (date: Date | null, timeZone: string | undefined, fallback: string) => {\n if (!date) return fallback\n const zoned = inZone(date, timeZone)\n return `${pad(zoned.getHours())}:${pad(zoned.getMinutes())}`\n}\n\n/** `day` at `time` (\"HH:mm\") in `timeZone`. The end of a range covers its whole last minute. */\nconst atTime = (day: Date, time: string, timeZone: string | undefined, isEnd: boolean) => {\n const [hours = 0, minutes = 0] = time.split(':').map(Number)\n const zoned = inZone(day, timeZone)\n zoned.setHours(hours, minutes, isEnd ? 59 : 0, isEnd ? 999 : 0)\n return new Date(zoned.getTime())\n}\n\nfunction Chevron({ orientation, className }: ChevronProps) {\n const Icon = orientation === 'left' ? ChevronLeft : ChevronRight\n return <Icon size=\"1.125em\" aria-hidden className={className} />\n}\n\nconst classNames: Partial<ClassNames> = {\n root: styles.calendar,\n months: styles.months,\n month: styles.month,\n month_caption: styles.caption,\n caption_label: styles.captionLabel,\n nav: styles.nav,\n button_previous: styles.navButton,\n button_next: styles.navButton,\n month_grid: styles.grid,\n weekday: styles.weekday,\n day: styles.day,\n day_button: styles.dayButton,\n today: styles.today,\n selected: styles.selected,\n range_start: styles.rangeStart,\n range_end: styles.rangeEnd,\n range_middle: styles.rangeMiddle,\n disabled: styles.disabled,\n outside: styles.outside,\n}\n\n/**\n * From–to date range picker: a field-styled trigger opening a range calendar with quick ranges.\n * Clicking a quick range applies it straight away; calendar picks apply with the Apply button.\n * Escape or Cancel discards the draft.\n */\nexport function DateRangePicker({\n label,\n description,\n error,\n required,\n showRequired,\n requiredIndicator,\n optionalText,\n hideLabel,\n fieldProps,\n disabled,\n className,\n value,\n defaultValue = EMPTY,\n onValueChange,\n placeholder = 'Select a date range',\n presets,\n minDate,\n maxDate,\n weekStartsOn = 1,\n locale,\n withTime = false,\n timeZone,\n portalContainer,\n presetsLabel = 'Quick ranges',\n applyLabel = 'Apply',\n cancelLabel = 'Cancel',\n startTimeLabel = 'Start time',\n endTimeLabel = 'End time',\n triggerProps,\n popupProps,\n}: DateRangePickerProps) {\n const id = useId()\n const ids = {\n label: `${id}-label`,\n value: `${id}-value`,\n description: `${id}-description`,\n error: `${id}-error`,\n }\n const container = usePortalContainer(portalContainer)\n const wide = useWide()\n const calendarRef = useRef<HTMLDivElement>(null)\n\n const [inner, setInner] = useState(defaultValue)\n const committed = value !== undefined ? value : inner\n const [open, setOpen] = useState(false)\n const [draft, setDraft] = useState<DayRange | undefined>()\n const [startTime, setStartTime] = useState('00:00')\n const [endTime, setEndTime] = useState('23:59')\n\n const lang = locale?.code ?? 'en-GB'\n // Day buttons are named \"Tuesday 10 March 2026\", so the name contains the visible number.\n const dayName = new Intl.DateTimeFormat(lang, {\n weekday: 'long',\n day: 'numeric',\n month: 'long',\n year: 'numeric',\n timeZone,\n })\n const labels = {\n labelDayButton: (date: Date, { today, selected }: Modifiers) =>\n [today && 'Today', dayName.format(date), selected && 'selected'].filter(Boolean).join(', '),\n }\n const format = new Intl.DateTimeFormat(lang, {\n day: 'numeric',\n month: 'short',\n year: 'numeric',\n ...(withTime && { hour: '2-digit', minute: '2-digit', hourCycle: 'h23' }),\n timeZone,\n })\n const formatRange = ({ start, end }: DateRange) => {\n if (!start) return ''\n const from = format.format(start)\n const to = end ? format.format(end) : ''\n return !to || to === from ? from : `${from} – ${to}`\n }\n\n const clamp = ({ start, end }: FullDateRange): FullDateRange => ({\n start: minDate && start < minDate ? minDate : start,\n end: maxDate && end > maxDate ? maxDate : end,\n })\n\n const commit = (range: FullDateRange, preset?: DateRangePreset) => {\n const next = clamp(range)\n setInner(next)\n onValueChange?.(next, { preset })\n setOpen(false)\n }\n\n const handleOpenChange = (next: boolean) => {\n if (next) {\n // Start each visit from the applied value; closing without Apply discards the draft.\n setDraft(\n committed.start\n ? { from: committed.start, to: committed.end ?? committed.start }\n : undefined,\n )\n setStartTime(toTime(committed.start, timeZone, '00:00'))\n setEndTime(toTime(committed.end, timeZone, '23:59'))\n }\n setOpen(next)\n }\n\n const draftRange: DateRange = {\n start: draft?.from ? atTime(draft.from, withTime ? startTime : '00:00', timeZone, false) : null,\n end: draft?.to ? atTime(draft.to, withTime ? endTime : '23:59', timeZone, true) : null,\n }\n const complete =\n draftRange.start && draftRange.end && draftRange.start <= draftRange.end\n ? { start: draftRange.start, end: draftRange.end }\n : null\n\n const status = !draft?.from\n ? 'Pick a start date'\n : !draft.to\n ? `${formatRange({ start: draftRange.start, end: null })}, pick an end date`\n : formatRange(draftRange)\n\n const items = presets ?? getDefaultPresets(timeZone)\n const invalid = hasError(error)\n const describedBy = [description != null && ids.description, invalid && ids.error]\n .filter(Boolean)\n .join(' ')\n const text = formatRange(committed)\n const dialogLabel = typeof label === 'string' ? label : 'Date range'\n\n return (\n <BaseField.Root\n {...fieldProps}\n invalid={invalid || undefined}\n disabled={disabled}\n className={clsx(fieldStyles.root, fieldProps?.className, className)}\n >\n {label != null && (\n <div id={ids.label} className={labelClass(fieldStyles.label, hideLabel)}>\n <FieldLabelText\n label={label}\n required={required}\n showRequired={showRequired}\n requiredIndicator={requiredIndicator}\n optionalText={optionalText}\n />\n </div>\n )}\n <BasePopover.Root open={open} onOpenChange={handleOpenChange}>\n <BasePopover.Trigger\n aria-labelledby={label != null ? `${ids.label} ${ids.value}` : undefined}\n aria-describedby={describedBy || undefined}\n aria-invalid={invalid || undefined}\n disabled={disabled}\n {...triggerProps}\n className={clsx(styles.trigger, triggerProps?.className)}\n >\n <span id={ids.value} className={styles.value} data-placeholder={!text || undefined}>\n {text || placeholder}\n </span>\n <CalendarDays size=\"1.125em\" aria-hidden className={styles.icon} />\n </BasePopover.Trigger>\n <BasePopover.Portal container={container}>\n <BasePopover.Positioner\n className={popoverLayer}\n align=\"start\"\n sideOffset={4}\n collisionPadding={8}\n positionMethod={container ? 'fixed' : 'absolute'}\n >\n <BasePopover.Popup\n aria-label={dialogLabel}\n initialFocus={() =>\n calendarRef.current?.querySelector<HTMLElement>('button[tabindex=\"0\"]') ?? true\n }\n {...popupProps}\n className={clsx(styles.popup, popupProps?.className)}\n >\n {items.length > 0 && (\n <ul aria-label={presetsLabel} className={styles.presets}>\n {items.map((preset) => (\n <li key={preset.label}>\n <button\n type=\"button\"\n className={styles.preset}\n onClick={() => commit(preset.range(), preset)}\n >\n {preset.label}\n </button>\n </li>\n ))}\n </ul>\n )}\n <div className={styles.body} ref={calendarRef}>\n <DayPicker\n mode=\"range\"\n selected={draft}\n onSelect={setDraft}\n resetOnSelect\n numberOfMonths={wide ? 2 : 1}\n defaultMonth={committed.start ?? maxDate ?? undefined}\n startMonth={minDate}\n endMonth={maxDate}\n disabled={[\n ...(minDate ? [{ before: minDate }] : []),\n ...(maxDate ? [{ after: maxDate }] : []),\n ]}\n weekStartsOn={weekStartsOn}\n locale={locale}\n timeZone={timeZone}\n classNames={classNames}\n labels={labels}\n components={{ Chevron }}\n />\n {withTime && (\n <div className={styles.times}>\n <label className={styles.timeField}>\n <span className={fieldStyles.label}>{startTimeLabel}</span>\n <input\n type=\"time\"\n className={styles.timeInput}\n value={startTime}\n onChange={(event) => setStartTime(event.target.value)}\n />\n </label>\n <label className={styles.timeField}>\n <span className={fieldStyles.label}>{endTimeLabel}</span>\n <input\n type=\"time\"\n className={styles.timeInput}\n value={endTime}\n onChange={(event) => setEndTime(event.target.value)}\n />\n </label>\n {timeZone && <span className={styles.zone}>{timeZone}</span>}\n </div>\n )}\n <div className={styles.footer}>\n <div role=\"status\" aria-live=\"polite\" className={styles.status}>\n {status}\n </div>\n <Button variant=\"secondary\" size=\"sm\" onClick={() => handleOpenChange(false)}>\n {cancelLabel}\n </Button>\n <Button\n size=\"sm\"\n disabled={!complete}\n onClick={() => complete && commit(complete)}\n >\n {applyLabel}\n </Button>\n </div>\n </div>\n </BasePopover.Popup>\n </BasePopover.Positioner>\n </BasePopover.Portal>\n </BasePopover.Root>\n <FieldMessages description={description} error={error} ids={ids} />\n </BaseField.Root>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;AA2EA,IAAMiC,KAAmB;CAAE,OAAO;CAAM,KAAK;AAAK,GAC5CC,IAAO,qBAEPC,KAAiB,MAAuB;CAC5C,IAAMC,IAAQ,OAAO,WAAWF,CAAI;CAEpC,OADAE,EAAM,iBAAiB,UAAUC,CAAM,SAC1BD,EAAM,oBAAoB,UAAUC,CAAM;AACzD,GACMC,WACJC,EACEJ,SACM,OAAO,WAAWD,CAAI,CAAC,CAAC,eACxB,EACR,GAEIM,KAAO,MAAc,OAAOC,CAAC,CAAC,CAAC,SAAS,GAAG,GAAG,GAC9CC,KAAU,GAAmB,GAA8B,MAAqB;CACpF,IAAI,CAACC,GAAM,OAAOC;CAClB,IAAMC,IAAQC,EAAOH,GAAMI,CAAQ;CACnC,OAAO,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AA4B;IAAoB;IAAY;GAAM,CAAA;EACpD;;AAEpB"}
1
+ {"version":3,"file":"DateRangePicker.js","names":["styles.calendar","styles.months","styles.month","styles.caption","styles.captionLabel","styles.nav","styles.navButton","styles.grid","styles.weekday","styles.day","styles.dayButton","styles.today","styles.selected","styles.rangeStart","styles.rangeEnd","styles.rangeMiddle","styles.disabled","styles.outside","value","status","presets","label","BaseField","fieldStyles.root","BasePopover","styles.trigger","styles.value","styles.icon","styles.popup","preset","styles.body","styles.footer","styles.status","EMPTY","WIDE","wideQuery","subscribeWide","query","notify","useWide","useSyncExternalStore","pad","n","toTime","date","fallback","zoned","inZone","timeZone","atTime","hours","minutes","time","day","isEnd","Chevron","orientation","ChevronLeft","ChevronRight","classNames","calendar","caption","captionLabel","navButton","grid","dayButton","rangeStart","rangeEnd","rangeMiddle","DateRangePicker","label$1","value$1","presets$1","id","useId","ids","container","usePortalContainer","portalContainer","wide","calendarRef","useRef","inner","setInner","useState","defaultValue","committed","open","setOpen","draft","setDraft","startTime","setStartTime","endTime","setEndTime","lang","locale","dayName","labels","today","selected","format","withTime","formatRange","start","from","to","end","latest","maxDate","clamp","minDate","commit","next","range","onValueChange","handleOpenChange","draftRange","complete","status$1","items","getDefaultPresets","invalid","hasError","error","describedBy","description","text","dialogLabel","Field","fieldProps","clsx","root","className","labelClass","hideLabel","FieldLabelText","Popover","triggerProps","trigger","value","placeholder","CalendarDays","icon","popoverLayer","popupProps","popup","presetsLabel","preset$1","body","DayPicker","startTimeLabel","event","endTimeLabel","footer","status","Button","cancelLabel","applyLabel","FieldMessages"],"sources":["../../../src/components/DateRangePicker/DateRangePicker.tsx"],"sourcesContent":["import { Field as BaseField } from '@base-ui/react/field'\nimport { Popover as BasePopover } from '@base-ui/react/popover'\nimport { clsx } from 'clsx'\nimport { CalendarDays, ChevronLeft, ChevronRight } from 'lucide-react'\nimport { useId, useRef, useState, useSyncExternalStore } from 'react'\nimport {\n DayPicker,\n type ChevronProps,\n type ClassNames,\n type DateRange as DayRange,\n type DayPickerLocale,\n type Modifiers,\n} from 'react-day-picker'\n\nimport * as styles from './DateRangePicker.css'\nimport {\n getDefaultPresets,\n inZone,\n type DateRange,\n type DateRangePreset,\n type FullDateRange,\n} from './presets'\nimport { popoverLayer } from '../../styles/shared.css'\nimport { Button } from '../Button'\nimport {\n FieldLabelText,\n FieldMessages,\n hasError,\n labelClass,\n type FieldBaseProps,\n type FieldOptionProps,\n type PartProps,\n} from '../Field/Field'\nimport * as fieldStyles from '../Field/Field.css'\nimport { usePortalContainer, type PortalContainerTarget } from '../PortalContainer'\n\nexport interface DateRangePickerProps extends FieldBaseProps, FieldOptionProps {\n /** The applied range, for a controlled picker. Use with `onValueChange`. */\n value?: DateRange\n /** The initial range, for an uncontrolled picker. */\n defaultValue?: DateRange\n /**\n * Called with the new range on Apply or when a quick range is chosen. `details.preset` is the\n * chosen quick range, so a preset can trigger extra behaviour (e.g. a live mode).\n */\n onValueChange?: (range: DateRange, details: { preset?: DateRangePreset }) => void\n /** Trigger text while no range is set. */\n placeholder?: string\n /** Quick ranges beside the calendar. Replaces the defaults; `[]` hides the list. */\n presets?: DateRangePreset[]\n /** Earliest selectable day. Ranges, including quick ranges, are clamped to start no earlier. */\n minDate?: Date\n /** Latest selectable day. Ranges, including quick ranges, are clamped to end by the end of it. */\n maxDate?: Date\n /** First day of the week (0 is Sunday). */\n weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6\n /** Calendar locale, e.g. `enGB` from `react-day-picker/locale`. Its `code` also formats the trigger. */\n locale?: Partial<DayPickerLocale>\n /** Adds start and end time inputs. Without it, a range runs from the start of its first day to the end of its last. */\n withTime?: boolean\n /** IANA zone (e.g. `'UTC'`) that days and times are shown and picked in. Defaults to local time. */\n timeZone?: string\n /** Where the popup renders. Defaults to the nearest `PortalContainer`, else `document.body`. */\n portalContainer?: PortalContainerTarget\n /** Accessible name of the quick ranges list. */\n presetsLabel?: string\n /** Text of the button that applies the picked range. */\n applyLabel?: string\n /** Text of the button that discards the picked range. */\n cancelLabel?: string\n /** Label of the start time input (with `withTime`). */\n startTimeLabel?: string\n /** Label of the end time input (with `withTime`). */\n endTimeLabel?: string\n /** Goes on the field root. */\n className?: string\n /** Props for the trigger button, e.g. `{ 'data-testid': 'range' }`. */\n triggerProps?: PartProps<BasePopover.Trigger.Props>\n /** Props for the popup (role `dialog`). */\n popupProps?: PartProps<BasePopover.Popup.Props>\n}\n\nconst EMPTY: DateRange = { start: null, end: null }\nconst WIDE = '(min-width: 48em)'\n\n// matchMedia is missing in jsdom (and SSR), where the calendar shows two months.\nconst wideQuery = () =>\n typeof window !== 'undefined' && typeof window.matchMedia === 'function'\n ? window.matchMedia(WIDE)\n : null\nconst subscribeWide = (notify: () => void) => {\n const query = wideQuery()\n query?.addEventListener('change', notify)\n return () => query?.removeEventListener('change', notify)\n}\nconst useWide = () =>\n useSyncExternalStore(\n subscribeWide,\n () => wideQuery()?.matches ?? true,\n () => true,\n )\n\nconst pad = (n: number) => String(n).padStart(2, '0')\nconst toTime = (date: Date | null, timeZone: string | undefined, fallback: string) => {\n if (!date) return fallback\n const zoned = inZone(date, timeZone)\n return `${pad(zoned.getHours())}:${pad(zoned.getMinutes())}`\n}\n\n/** `day` at `time` (\"HH:mm\") in `timeZone`. The end of a range covers its whole last minute. */\nconst atTime = (day: Date, time: string, timeZone: string | undefined, isEnd: boolean) => {\n const [hours = 0, minutes = 0] = time.split(':').map(Number)\n const zoned = inZone(day, timeZone)\n zoned.setHours(hours, minutes, isEnd ? 59 : 0, isEnd ? 999 : 0)\n return new Date(zoned.getTime())\n}\n\nfunction Chevron({ orientation, className }: ChevronProps) {\n const Icon = orientation === 'left' ? ChevronLeft : ChevronRight\n return <Icon size=\"1.125em\" aria-hidden className={className} />\n}\n\nconst classNames: Partial<ClassNames> = {\n root: styles.calendar,\n months: styles.months,\n month: styles.month,\n month_caption: styles.caption,\n caption_label: styles.captionLabel,\n nav: styles.nav,\n button_previous: styles.navButton,\n button_next: styles.navButton,\n month_grid: styles.grid,\n weekday: styles.weekday,\n day: styles.day,\n day_button: styles.dayButton,\n today: styles.today,\n selected: styles.selected,\n range_start: styles.rangeStart,\n range_end: styles.rangeEnd,\n range_middle: styles.rangeMiddle,\n disabled: styles.disabled,\n outside: styles.outside,\n}\n\n/**\n * From–to date range picker: a field-styled trigger opening a range calendar with quick ranges.\n * Clicking a quick range applies it straight away; calendar picks apply with the Apply button.\n * Escape or Cancel discards the draft.\n */\nexport function DateRangePicker({\n label,\n description,\n error,\n required,\n hideLabel,\n fieldProps,\n disabled,\n className,\n value,\n defaultValue = EMPTY,\n onValueChange,\n placeholder = 'Select a date range',\n presets,\n minDate,\n maxDate,\n weekStartsOn = 1,\n locale,\n withTime = false,\n timeZone,\n portalContainer,\n presetsLabel = 'Quick ranges',\n applyLabel = 'Apply',\n cancelLabel = 'Cancel',\n startTimeLabel = 'Start time',\n endTimeLabel = 'End time',\n triggerProps,\n popupProps,\n}: DateRangePickerProps) {\n const id = useId()\n const ids = {\n label: `${id}-label`,\n value: `${id}-value`,\n description: `${id}-description`,\n error: `${id}-error`,\n }\n const container = usePortalContainer(portalContainer)\n const wide = useWide()\n const calendarRef = useRef<HTMLDivElement>(null)\n\n const [inner, setInner] = useState(defaultValue)\n const committed = value !== undefined ? value : inner\n const [open, setOpen] = useState(false)\n const [draft, setDraft] = useState<DayRange | undefined>()\n const [startTime, setStartTime] = useState('00:00')\n const [endTime, setEndTime] = useState('23:59')\n\n const lang = locale?.code ?? 'en-GB'\n // Day buttons are named \"Tuesday 10 March 2026\", so the name contains the visible number.\n const dayName = new Intl.DateTimeFormat(lang, {\n weekday: 'long',\n day: 'numeric',\n month: 'long',\n year: 'numeric',\n timeZone,\n })\n const labels = {\n labelDayButton: (date: Date, { today, selected }: Modifiers) =>\n [today && 'Today', dayName.format(date), selected && 'selected'].filter(Boolean).join(', '),\n }\n const format = new Intl.DateTimeFormat(lang, {\n day: 'numeric',\n month: 'short',\n year: 'numeric',\n ...(withTime && { hour: '2-digit', minute: '2-digit', hourCycle: 'h23' }),\n timeZone,\n })\n const formatRange = ({ start, end }: DateRange) => {\n if (!start) return ''\n const from = format.format(start)\n const to = end ? format.format(end) : ''\n return !to || to === from ? from : `${from} – ${to}`\n }\n\n // `maxDate` is the latest selectable day, so a range may run to the end of it.\n const latest = maxDate && atTime(maxDate, '23:59', timeZone, true)\n const clamp = ({ start, end }: FullDateRange): FullDateRange => ({\n start: minDate && start < minDate ? minDate : start,\n end: latest && end > latest ? latest : end,\n })\n\n const commit = (range: FullDateRange, preset?: DateRangePreset) => {\n const next = clamp(range)\n setInner(next)\n onValueChange?.(next, { preset })\n setOpen(false)\n }\n\n const handleOpenChange = (next: boolean) => {\n if (next) {\n // Start each visit from the applied value; closing without Apply discards the draft.\n setDraft(\n committed.start\n ? { from: committed.start, to: committed.end ?? committed.start }\n : undefined,\n )\n setStartTime(toTime(committed.start, timeZone, '00:00'))\n setEndTime(toTime(committed.end, timeZone, '23:59'))\n }\n setOpen(next)\n }\n\n const draftRange: DateRange = {\n start: draft?.from ? atTime(draft.from, withTime ? startTime : '00:00', timeZone, false) : null,\n end: draft?.to ? atTime(draft.to, withTime ? endTime : '23:59', timeZone, true) : null,\n }\n const complete =\n draftRange.start && draftRange.end && draftRange.start <= draftRange.end\n ? { start: draftRange.start, end: draftRange.end }\n : null\n\n const status = !draft?.from\n ? 'Pick a start date'\n : !draft.to\n ? `${formatRange({ start: draftRange.start, end: null })}, pick an end date`\n : formatRange(draftRange)\n\n const items = presets ?? getDefaultPresets(timeZone)\n const invalid = hasError(error)\n const describedBy = [description != null && ids.description, invalid && ids.error]\n .filter(Boolean)\n .join(' ')\n const text = formatRange(committed)\n const dialogLabel = typeof label === 'string' ? label : 'Date range'\n\n return (\n <BaseField.Root\n {...fieldProps}\n invalid={invalid || undefined}\n disabled={disabled}\n className={clsx(fieldStyles.root, fieldProps?.className, className)}\n >\n {label != null && (\n <div id={ids.label} className={labelClass(fieldStyles.label, hideLabel)}>\n <FieldLabelText label={label} required={required} />\n </div>\n )}\n <BasePopover.Root open={open} onOpenChange={handleOpenChange}>\n <BasePopover.Trigger\n aria-labelledby={label != null ? `${ids.label} ${ids.value}` : undefined}\n aria-describedby={describedBy || undefined}\n aria-invalid={invalid || undefined}\n disabled={disabled}\n {...triggerProps}\n className={clsx(styles.trigger, triggerProps?.className)}\n >\n <span id={ids.value} className={styles.value} data-placeholder={!text || undefined}>\n {text || placeholder}\n </span>\n <CalendarDays size=\"1.125em\" aria-hidden className={styles.icon} />\n </BasePopover.Trigger>\n <BasePopover.Portal container={container}>\n <BasePopover.Positioner\n className={popoverLayer}\n align=\"start\"\n sideOffset={4}\n collisionPadding={8}\n positionMethod={container ? 'fixed' : 'absolute'}\n >\n <BasePopover.Popup\n aria-label={dialogLabel}\n initialFocus={() =>\n calendarRef.current?.querySelector<HTMLElement>('button[tabindex=\"0\"]') ?? true\n }\n {...popupProps}\n className={clsx(styles.popup, popupProps?.className)}\n >\n {items.length > 0 && (\n <ul aria-label={presetsLabel} className={styles.presets}>\n {items.map((preset) => (\n <li key={preset.label}>\n <button\n type=\"button\"\n className={styles.preset}\n onClick={() => commit(preset.range(), preset)}\n >\n {preset.label}\n </button>\n </li>\n ))}\n </ul>\n )}\n <div className={styles.body} ref={calendarRef}>\n <DayPicker\n mode=\"range\"\n selected={draft}\n onSelect={setDraft}\n resetOnSelect\n numberOfMonths={wide ? 2 : 1}\n defaultMonth={committed.start ?? maxDate ?? undefined}\n startMonth={minDate}\n endMonth={maxDate}\n disabled={[\n ...(minDate ? [{ before: minDate }] : []),\n ...(maxDate ? [{ after: maxDate }] : []),\n ]}\n weekStartsOn={weekStartsOn}\n locale={locale}\n timeZone={timeZone}\n classNames={classNames}\n labels={labels}\n components={{ Chevron }}\n />\n {withTime && (\n <div className={styles.times}>\n <label className={styles.timeField}>\n <span className={fieldStyles.label}>{startTimeLabel}</span>\n <input\n type=\"time\"\n className={styles.timeInput}\n value={startTime}\n onChange={(event) => setStartTime(event.target.value)}\n />\n </label>\n <label className={styles.timeField}>\n <span className={fieldStyles.label}>{endTimeLabel}</span>\n <input\n type=\"time\"\n className={styles.timeInput}\n value={endTime}\n onChange={(event) => setEndTime(event.target.value)}\n />\n </label>\n {timeZone && <span className={styles.zone}>{timeZone}</span>}\n </div>\n )}\n <div className={styles.footer}>\n <div role=\"status\" aria-live=\"polite\" className={styles.status}>\n {status}\n </div>\n <Button variant=\"secondary\" size=\"sm\" onClick={() => handleOpenChange(false)}>\n {cancelLabel}\n </Button>\n <Button\n size=\"sm\"\n disabled={!complete}\n onClick={() => complete && commit(complete)}\n >\n {applyLabel}\n </Button>\n </div>\n </div>\n </BasePopover.Popup>\n </BasePopover.Positioner>\n </BasePopover.Portal>\n </BasePopover.Root>\n <FieldMessages description={description} error={error} ids={ids} />\n </BaseField.Root>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;AAkFA,IAAMiC,KAAmB;CAAE,OAAO;CAAM,KAAK;AAAK,GAC5CC,IAAO,qBAGPC,UACJ,OAAO,SAAW,OAAe,OAAO,OAAO,cAAe,aAC1D,OAAO,WAAWD,CAAI,IACtB,MACAE,KAAiB,MAAuB;CAC5C,IAAMC,IAAQF,EAAU;CAExB,OADAE,GAAO,iBAAiB,UAAUC,CAAM,SAC3BD,GAAO,oBAAoB,UAAUC,CAAM;AAC1D,GACMC,WACJC,EACEJ,SACMD,EAAU,CAAC,EAAE,WAAW,UACxB,EACR,GAEIM,KAAO,MAAc,OAAOC,CAAC,CAAC,CAAC,SAAS,GAAG,GAAG,GAC9CC,KAAU,GAAmB,GAA8B,MAAqB;CACpF,IAAI,CAACC,GAAM,OAAOC;CAClB,IAAMC,IAAQC,EAAOH,GAAMI,CAAQ;CACnC,OAAO,GAAGP,EAAIK,EAAM,SAAS,CAAC,EAAE,GAAGL,EAAIK,EAAM,WAAW,CAAC;AAC3D,GAGMG,KAAU,GAAW,GAAc,GAA8B,MAAmB;CACxF,IAAM,CAACC,IAAQ,GAAGC,IAAU,KAAK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components/DateRangePicker/DateRangePicker.css.ts
5
- var e = "bnrk790 _12aoxdm0", t = "bnrk791", n = "bnrk792", r = "bnrk793", i = "bnrk794", a = "bnrk795 tyvs8e0", o = "bnrk796", s = "bnrk797", c = "bnrk798", l = "bnrk799", u = "bnrk79a", d = "bnrk79b", f = "bnrk79c", p = "bnrk79d tyvs8e0", m = "bnrk79e", h = "bnrk79f", g = "bnrk79g", _ = "bnrk79h", v = "bnrk79i", y = "bnrk79j", b = "bnrk79k", x = "bnrk79l", S = "bnrk79m", C = "bnrk79n", w = "bnrk79o tyvs8e0", T = "bnrk79p", E = "bnrk79q", D = "bnrk79r _12aoxdm0", O = "bnrk79s", k = "bnrk79t", A = "bnrk79u";
5
+ var e = "bnrk790 _12aoxdm0", t = "bnrk791", n = "bnrk792", r = "bnrk793 tyvs8e6", i = "bnrk794", a = "bnrk795 tyvs8e0", o = "bnrk796", s = "bnrk797", c = "bnrk798", l = "bnrk799", u = "bnrk79a", d = "bnrk79b", f = "bnrk79c", p = "bnrk79d tyvs8e0", m = "bnrk79e", h = "bnrk79f", g = "bnrk79g", _ = "bnrk79h", v = "bnrk79i", y = "bnrk79j", b = "bnrk79k", x = "bnrk79l", S = "bnrk79m", C = "bnrk79n", w = "bnrk79o tyvs8e0", T = "bnrk79p", E = "bnrk79q", D = "bnrk79r _12aoxdm0", O = "bnrk79s", k = "bnrk79t", A = "bnrk79u";
6
6
  export { o as body, s as calendar, u as caption, d as captionLabel, g as day, w as dayButton, S as disabled, k as footer, m as grid, n as icon, l as month, c as months, f as nav, p as navButton, C as outside, r as popup, a as preset, i as presets, b as rangeEnd, x as rangeMiddle, y as rangeStart, v as selected, A as status, E as timeField, D as timeInput, T as times, _ as today, e as trigger, t as value, h as weekday, O as zone };
7
7
 
8
8
  //# sourceMappingURL=DateRangePicker.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DateRangePicker.styles.js","names":["trigger","value","icon","popup","presets","preset","body","calendar","months","month","caption","captionLabel","nav","navButton","grid","weekday","day","today","selected","rangeStart","rangeEnd","rangeMiddle","disabled","outside","dayButton","times","timeField","timeInput","zone","footer","status"],"sources":["../../../src/components/DateRangePicker/DateRangePicker.css.ts"],"sourcesContent":["import { globalStyle, style } from '@vanilla-extract/css'\n\nimport { input } from '../../styles/input.css'\nimport { focusRing } from '../../styles/shared.css'\nimport { vars } from '../../tokens/contract.css'\nimport { fontSize, fontWeight, radius, space } from '../../tokens/scale'\n\nconst wide = 'screen and (min-width: 48em)'\nconst cell = '2.25rem'\n\nexport const trigger = style([\n input,\n {\n justifyContent: 'space-between',\n gap: space['3'],\n paddingInlineEnd: space['3'],\n cursor: 'pointer',\n userSelect: 'none',\n },\n])\n\nexport const value = style({\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n fontVariantNumeric: 'tabular-nums',\n selectors: { '&[data-placeholder]': { color: vars.color.inkSubtle } },\n})\n\nexport const icon = style({ flexShrink: 0, color: vars.color.inkMuted })\n\nexport const popup = style({\n boxSizing: 'border-box',\n display: 'flex',\n flexDirection: 'column',\n maxWidth: 'var(--available-width)',\n maxHeight: 'var(--available-height)',\n overflow: 'auto',\n border: `1px solid ${vars.color.border}`,\n borderRadius: radius.lg,\n backgroundColor: vars.color.surface,\n color: vars.color.ink,\n boxShadow: vars.shadow.md,\n fontFamily: vars.font.sans,\n fontSize: fontSize.md,\n outline: 'none',\n transformOrigin: 'var(--transform-origin)',\n transition: 'opacity 100ms, transform 100ms',\n selectors: {\n '&[data-starting-style], &[data-ending-style]': { opacity: 0, transform: 'scale(0.98)' },\n },\n '@media': {\n [wide]: { flexDirection: 'row' },\n '(prefers-reduced-motion: reduce)': { transition: 'none' },\n },\n})\n\nexport const presets = style({\n display: 'flex',\n flexWrap: 'wrap',\n gap: space['1'],\n margin: 0,\n padding: space['2'],\n listStyle: 'none',\n borderBlockEnd: `1px solid ${vars.color.border}`,\n '@media': {\n [wide]: {\n flexDirection: 'column',\n flexWrap: 'nowrap',\n minWidth: '10rem',\n borderBlockEnd: 0,\n borderInlineEnd: `1px solid ${vars.color.border}`,\n },\n },\n})\n\nexport const preset = style([\n focusRing,\n {\n width: '100%',\n margin: 0,\n paddingBlock: space['1.5'],\n paddingInline: space['3'],\n border: 0,\n borderRadius: radius.md,\n background: 'transparent',\n color: vars.color.ink,\n font: 'inherit',\n textAlign: 'start',\n whiteSpace: 'nowrap',\n cursor: 'pointer',\n selectors: { '&:hover': { backgroundColor: vars.color.surfaceHover } },\n },\n])\n\nexport const body = style({\n display: 'flex',\n flexDirection: 'column',\n gap: space['3'],\n padding: space['3'],\n})\n\n// react-day-picker parts (its stylesheet isn't loaded, so everything is set here).\nexport const calendar = style({ position: 'relative' })\n\nexport const months = style({\n position: 'relative',\n display: 'flex',\n flexWrap: 'wrap',\n gap: space['6'],\n})\n\nexport const month = style({ display: 'flex', flexDirection: 'column', gap: space['2'] })\n\nexport const caption = style({\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n height: '2rem',\n})\n\nexport const captionLabel = style({ fontWeight: fontWeight.semibold })\n\nexport const nav = style({\n position: 'absolute',\n insetInline: 0,\n insetBlockStart: 0,\n zIndex: 1,\n display: 'flex',\n justifyContent: 'space-between',\n pointerEvents: 'none',\n})\n\nexport const navButton = style([\n focusRing,\n {\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n width: '2rem',\n height: '2rem',\n margin: 0,\n padding: 0,\n border: 0,\n borderRadius: radius.md,\n background: 'transparent',\n color: vars.color.inkMuted,\n cursor: 'pointer',\n pointerEvents: 'auto',\n selectors: {\n '&:hover:not([aria-disabled=\"true\"])': {\n backgroundColor: vars.color.surfaceHover,\n color: vars.color.ink,\n },\n '&[aria-disabled=\"true\"]': { cursor: 'not-allowed', opacity: 0.4 },\n },\n },\n])\n\nexport const grid = style({ borderCollapse: 'collapse', borderSpacing: 0 })\n\nexport const weekday = style({\n width: cell,\n height: '1.75rem',\n padding: 0,\n fontSize: fontSize.xs,\n fontWeight: fontWeight.medium,\n color: vars.color.inkMuted,\n textAlign: 'center',\n})\n\nexport const day = style({ padding: 0, textAlign: 'center' })\nexport const today = style({})\nexport const selected = style({})\nexport const rangeStart = style({})\nexport const rangeEnd = style({})\nexport const rangeMiddle = style({})\nexport const disabled = style({})\nexport const outside = style({})\n\nexport const dayButton = style([\n focusRing,\n {\n // Centred explicitly, so an app's `button { text-align: left }` reset can't shift the number.\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n width: cell,\n height: cell,\n margin: 0,\n padding: 0,\n border: 0,\n borderRadius: radius.full,\n background: 'transparent',\n color: vars.color.ink,\n font: 'inherit',\n fontVariantNumeric: 'tabular-nums',\n cursor: 'pointer',\n selectors: {\n '&:hover:not(:disabled)': { backgroundColor: vars.color.surfaceHover },\n },\n },\n])\n\n// The band behind a range, drawn on the cells so it runs unbroken between the end caps.\nglobalStyle(`${rangeMiddle}`, { backgroundColor: vars.color.accentSubtle })\nglobalStyle(`${rangeStart}`, {\n backgroundImage: `linear-gradient(to right, transparent 50%, ${vars.color.accentSubtle} 50%)`,\n})\nglobalStyle(`${rangeEnd}`, {\n backgroundImage: `linear-gradient(to left, transparent 50%, ${vars.color.accentSubtle} 50%)`,\n})\nglobalStyle(`${rangeStart}${rangeEnd}`, { backgroundImage: 'none' })\nglobalStyle(`[dir=\"rtl\"] ${rangeStart}`, {\n backgroundImage: `linear-gradient(to left, transparent 50%, ${vars.color.accentSubtle} 50%)`,\n})\nglobalStyle(`[dir=\"rtl\"] ${rangeEnd}`, {\n backgroundImage: `linear-gradient(to right, transparent 50%, ${vars.color.accentSubtle} 50%)`,\n})\n\nglobalStyle(`${today} > ${dayButton}`, {\n fontWeight: fontWeight.semibold,\n color: vars.color.accentInk,\n})\nglobalStyle(`${selected} > ${dayButton}`, {\n backgroundColor: vars.color.primary,\n color: vars.color.onPrimary,\n fontWeight: fontWeight.semibold,\n})\nglobalStyle(`${rangeMiddle} > ${dayButton}`, {\n backgroundColor: 'transparent',\n color: vars.color.ink,\n fontWeight: fontWeight.normal,\n})\nglobalStyle(`${rangeMiddle} > ${dayButton}:hover`, { backgroundColor: vars.color.surfaceHover })\nglobalStyle(`${disabled} > ${dayButton}`, {\n color: vars.color.inkSubtle,\n textDecoration: 'line-through',\n cursor: 'not-allowed',\n})\nglobalStyle(`${outside} > ${dayButton}`, { color: vars.color.inkSubtle })\n\nexport const times = style({\n display: 'flex',\n flexWrap: 'wrap',\n alignItems: 'flex-end',\n gap: space['3'],\n})\n\nexport const timeField = style({ display: 'flex', flexDirection: 'column', gap: space['1.5'] })\n\nexport const timeInput = style([\n input,\n {\n width: 'auto',\n minHeight: '2.25rem',\n paddingBlock: space['1'],\n fontVariantNumeric: 'tabular-nums',\n },\n])\n\nexport const zone = style({ paddingBlockEnd: space['2'], color: vars.color.inkMuted })\n\nexport const footer = style({\n display: 'flex',\n flexWrap: 'wrap',\n alignItems: 'center',\n justifyContent: 'flex-end',\n gap: space['2'],\n paddingBlockStart: space['3'],\n borderBlockStart: `1px solid ${vars.color.border}`,\n})\n\nexport const status = style({\n flex: '1 1 12rem',\n color: vars.color.inkMuted,\n fontVariantNumeric: 'tabular-nums',\n})\n"],"mappings":""}
1
+ {"version":3,"file":"DateRangePicker.styles.js","names":["trigger","value","icon","popup","presets","preset","body","calendar","months","month","caption","captionLabel","nav","navButton","grid","weekday","day","today","selected","rangeStart","rangeEnd","rangeMiddle","disabled","outside","dayButton","times","timeField","timeInput","zone","footer","status"],"sources":["../../../src/components/DateRangePicker/DateRangePicker.css.ts"],"sourcesContent":["import { globalStyle, style } from '@vanilla-extract/css'\n\nimport { input } from '../../styles/input.css'\nimport { focusRing, thinScrollbar } from '../../styles/shared.css'\nimport { vars } from '../../tokens/contract.css'\nimport { fontSize, fontWeight, radius, space } from '../../tokens/scale'\n\nconst wide = 'screen and (min-width: 48em)'\nconst cell = '2.25rem'\n\nexport const trigger = style([\n input,\n {\n justifyContent: 'space-between',\n gap: space['3'],\n paddingInlineEnd: space['3'],\n cursor: 'pointer',\n userSelect: 'none',\n },\n])\n\nexport const value = style({\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n fontVariantNumeric: 'tabular-nums',\n selectors: { '&[data-placeholder]': { color: vars.color.inkSubtle } },\n})\n\nexport const icon = style({ flexShrink: 0, color: vars.color.inkMuted })\n\nexport const popup = style([\n thinScrollbar,\n {\n boxSizing: 'border-box',\n display: 'flex',\n flexDirection: 'column',\n maxWidth: 'var(--available-width)',\n maxHeight: 'var(--available-height)',\n overflow: 'auto',\n borderRadius: radius.lg,\n backgroundColor: vars.color.surface,\n color: vars.color.ink,\n boxShadow: vars.shadow.md,\n fontFamily: vars.font.sans,\n fontSize: fontSize.md,\n outline: 'none',\n transformOrigin: 'var(--transform-origin)',\n transition: 'opacity 100ms, transform 100ms',\n selectors: {\n '&[data-starting-style], &[data-ending-style]': { opacity: 0, transform: 'scale(0.98)' },\n },\n '@media': {\n [wide]: { flexDirection: 'row' },\n '(prefers-reduced-motion: reduce)': { transition: 'none' },\n },\n },\n])\n\nexport const presets = style({\n display: 'flex',\n flexWrap: 'wrap',\n gap: space['1'],\n margin: 0,\n padding: space['2'],\n listStyle: 'none',\n borderBlockEnd: `1px solid ${vars.color.border}`,\n '@media': {\n [wide]: {\n flexDirection: 'column',\n flexWrap: 'nowrap',\n minWidth: '10rem',\n borderBlockEnd: 0,\n borderInlineEnd: `1px solid ${vars.color.border}`,\n },\n },\n})\n\nexport const preset = style([\n focusRing,\n {\n width: '100%',\n margin: 0,\n paddingBlock: space['1.5'],\n paddingInline: space['3'],\n border: 0,\n borderRadius: radius.md,\n background: 'transparent',\n color: vars.color.ink,\n font: 'inherit',\n textAlign: 'start',\n whiteSpace: 'nowrap',\n cursor: 'pointer',\n selectors: { '&:hover': { backgroundColor: vars.color.surfaceHover } },\n },\n])\n\nexport const body = style({\n display: 'flex',\n flexDirection: 'column',\n gap: space['3'],\n padding: space['3'],\n})\n\n// react-day-picker parts (its stylesheet isn't loaded, so everything is set here).\nexport const calendar = style({ position: 'relative' })\n\nexport const months = style({\n position: 'relative',\n display: 'flex',\n flexWrap: 'wrap',\n gap: space['6'],\n})\n\nexport const month = style({ display: 'flex', flexDirection: 'column', gap: space['2'] })\n\nexport const caption = style({\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n height: '2rem',\n})\n\nexport const captionLabel = style({ fontWeight: fontWeight.semibold })\n\nexport const nav = style({\n position: 'absolute',\n insetInline: 0,\n insetBlockStart: 0,\n zIndex: 1,\n display: 'flex',\n justifyContent: 'space-between',\n pointerEvents: 'none',\n})\n\nexport const navButton = style([\n focusRing,\n {\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n width: '2rem',\n height: '2rem',\n margin: 0,\n padding: 0,\n border: 0,\n borderRadius: radius.md,\n background: 'transparent',\n color: vars.color.inkMuted,\n cursor: 'pointer',\n pointerEvents: 'auto',\n selectors: {\n '&:hover:not([aria-disabled=\"true\"])': {\n backgroundColor: vars.color.surfaceHover,\n color: vars.color.ink,\n },\n '&[aria-disabled=\"true\"]': { cursor: 'not-allowed', opacity: 0.4 },\n },\n },\n])\n\nexport const grid = style({ borderCollapse: 'collapse', borderSpacing: 0 })\n\nexport const weekday = style({\n width: cell,\n height: '1.75rem',\n padding: 0,\n fontSize: fontSize.xs,\n fontWeight: fontWeight.medium,\n color: vars.color.inkMuted,\n textAlign: 'center',\n})\n\nexport const day = style({ padding: 0, textAlign: 'center' })\nexport const today = style({})\nexport const selected = style({})\nexport const rangeStart = style({})\nexport const rangeEnd = style({})\nexport const rangeMiddle = style({})\nexport const disabled = style({})\nexport const outside = style({})\n\nexport const dayButton = style([\n focusRing,\n {\n // Centred explicitly, so an app's `button { text-align: left }` reset can't shift the number.\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n width: cell,\n height: cell,\n margin: 0,\n padding: 0,\n border: 0,\n borderRadius: radius.full,\n background: 'transparent',\n color: vars.color.ink,\n font: 'inherit',\n fontVariantNumeric: 'tabular-nums',\n cursor: 'pointer',\n selectors: {\n '&:hover:not(:disabled)': { backgroundColor: vars.color.surfaceHover },\n },\n },\n])\n\n// The band behind a range, drawn on the cells so it runs unbroken between the end caps.\nglobalStyle(`${rangeMiddle}`, { backgroundColor: vars.color.accentSubtle })\nglobalStyle(`${rangeStart}`, {\n backgroundImage: `linear-gradient(to right, transparent 50%, ${vars.color.accentSubtle} 50%)`,\n})\nglobalStyle(`${rangeEnd}`, {\n backgroundImage: `linear-gradient(to left, transparent 50%, ${vars.color.accentSubtle} 50%)`,\n})\nglobalStyle(`${rangeStart}${rangeEnd}`, { backgroundImage: 'none' })\nglobalStyle(`[dir=\"rtl\"] ${rangeStart}`, {\n backgroundImage: `linear-gradient(to left, transparent 50%, ${vars.color.accentSubtle} 50%)`,\n})\nglobalStyle(`[dir=\"rtl\"] ${rangeEnd}`, {\n backgroundImage: `linear-gradient(to right, transparent 50%, ${vars.color.accentSubtle} 50%)`,\n})\n\nglobalStyle(`${today} > ${dayButton}`, {\n fontWeight: fontWeight.semibold,\n color: vars.color.accentInk,\n})\nglobalStyle(`${selected} > ${dayButton}`, {\n backgroundColor: vars.color.primary,\n color: vars.color.onPrimary,\n fontWeight: fontWeight.semibold,\n})\nglobalStyle(`${rangeMiddle} > ${dayButton}`, {\n backgroundColor: 'transparent',\n color: vars.color.ink,\n fontWeight: fontWeight.normal,\n})\nglobalStyle(`${rangeMiddle} > ${dayButton}:hover`, {\n backgroundColor: `color-mix(in srgb, ${vars.color.accent} 20%, transparent)`,\n})\nglobalStyle(`${disabled} > ${dayButton}`, {\n color: vars.color.inkSubtle,\n textDecoration: 'line-through',\n cursor: 'not-allowed',\n})\nglobalStyle(`${outside} > ${dayButton}`, { color: vars.color.inkSubtle })\n\nexport const times = style({\n display: 'flex',\n flexWrap: 'wrap',\n alignItems: 'flex-end',\n gap: space['3'],\n})\n\nexport const timeField = style({ display: 'flex', flexDirection: 'column', gap: space['1.5'] })\n\nexport const timeInput = style([\n input,\n {\n width: 'auto',\n minHeight: '2.25rem',\n paddingBlock: space['1'],\n fontVariantNumeric: 'tabular-nums',\n },\n])\n\nexport const zone = style({ paddingBlockEnd: space['2'], color: vars.color.inkMuted })\n\nexport const footer = style({\n display: 'flex',\n flexWrap: 'wrap',\n alignItems: 'center',\n justifyContent: 'flex-end',\n gap: space['2'],\n paddingBlockStart: space['3'],\n borderBlockStart: `1px solid ${vars.color.border}`,\n})\n\nexport const status = style({\n flex: '1 1 12rem',\n color: vars.color.inkMuted,\n fontVariantNumeric: 'tabular-nums',\n})\n"],"mappings":""}
@@ -6,4 +6,4 @@ export interface DateTimeInputProps extends FieldBaseProps, FieldOptionProps, Om
6
6
  onValueChange?: (value: string) => void;
7
7
  }
8
8
  /** Date and time picker using the browser's native `datetime-local` input. */
9
- export declare function DateTimeInput({ label, description, error, required, showRequired, requiredIndicator, optionalText, hideLabel, fieldProps, disabled, className, onChange, onValueChange, ref, ...props }: DateTimeInputProps): import('react').JSX.Element;
9
+ export declare function DateTimeInput({ label, description, error, required, hideLabel, fieldProps, disabled, className, ref, ...props }: DateTimeInputProps): import('react').JSX.Element;
@@ -1,37 +1,29 @@
1
1
  import { dateTime as e } from "./DateTimeInput.styles.js";
2
- import { Field as t, ariaRequired as n } from "../Field/Field.js";
3
- import { clsx as r } from "clsx";
4
- import { jsx as i } from "react/jsx-runtime";
5
- import { Input as a } from "@base-ui/react/input";
2
+ import { Field as t } from "../Field/Field.js";
3
+ import { clsx as n } from "clsx";
4
+ import { jsx as r } from "react/jsx-runtime";
5
+ import { Input as i } from "@base-ui/react/input";
6
6
  // src/components/DateTimeInput/DateTimeInput.tsx
7
- function o({ label: o, description: s, error: c, required: l, showRequired: u, requiredIndicator: d, optionalText: f, hideLabel: p, fieldProps: m, disabled: h, className: g, onChange: _, onValueChange: v, ref: y, ...b }) {
8
- let x = (e) => {
9
- _?.(e), v?.(e.target.value);
10
- };
11
- return /* @__PURE__ */ i(t, {
12
- ...m,
13
- label: o,
14
- description: s,
15
- error: c,
16
- required: l,
17
- showRequired: u,
18
- requiredIndicator: d,
19
- optionalText: f,
20
- hideLabel: p,
21
- disabled: h,
22
- className: r(m?.className, g),
23
- children: /* @__PURE__ */ i(a, {
24
- "aria-required": n(l, u),
25
- ...b,
26
- ref: y,
7
+ function a({ label: a, description: o, error: s, required: c, hideLabel: l, fieldProps: u, disabled: d, className: f, ref: p, ...m }) {
8
+ return /* @__PURE__ */ r(t, {
9
+ ...u,
10
+ label: a,
11
+ description: o,
12
+ error: s,
13
+ required: c,
14
+ hideLabel: l,
15
+ disabled: d,
16
+ className: n(u?.className, f),
17
+ children: /* @__PURE__ */ r(i, {
18
+ ...m,
19
+ ref: p,
27
20
  type: "datetime-local",
28
- required: l,
29
- disabled: h,
30
- onChange: x,
21
+ required: c,
22
+ disabled: d,
31
23
  className: e
32
24
  })
33
25
  });
34
26
  }
35
- export { o as DateTimeInput };
27
+ export { a as DateTimeInput };
36
28
 
37
29
  //# sourceMappingURL=DateTimeInput.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DateTimeInput.js","names":["styles.dateTime","DateTimeInput","props","handleChange","onChange","event","onValueChange","Field","fieldProps","clsx","className","Input","ariaRequired","required","showRequired","dateTime"],"sources":["../../../src/components/DateTimeInput/DateTimeInput.tsx"],"sourcesContent":["import { Input } from '@base-ui/react/input'\nimport { clsx } from 'clsx'\nimport type { ChangeEvent, ComponentProps, Ref } from 'react'\n\nimport * as styles from './DateTimeInput.css'\nimport { ariaRequired, Field, type FieldBaseProps, type FieldOptionProps } from '../Field/Field'\n\nexport interface DateTimeInputProps\n extends FieldBaseProps, FieldOptionProps, Omit<ComponentProps<'input'>, 'ref' | 'type'> {\n ref?: Ref<HTMLInputElement>\n /** Called with the local date-time string, e.g. `2026-11-10T09:21`, or `''` when cleared. */\n onValueChange?: (value: string) => void\n}\n\n/** Date and time picker using the browser's native `datetime-local` input. */\nexport function DateTimeInput({\n label,\n description,\n error,\n required,\n showRequired,\n requiredIndicator,\n optionalText,\n hideLabel,\n fieldProps,\n disabled,\n className,\n onChange,\n onValueChange,\n ref,\n ...props\n}: DateTimeInputProps) {\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\n onChange?.(event)\n onValueChange?.(event.target.value)\n }\n return (\n <Field\n {...fieldProps}\n label={label}\n description={description}\n error={error}\n required={required}\n showRequired={showRequired}\n requiredIndicator={requiredIndicator}\n optionalText={optionalText}\n hideLabel={hideLabel}\n disabled={disabled}\n className={clsx(fieldProps?.className, className)}\n >\n <Input\n aria-required={ariaRequired(required, showRequired)}\n {...props}\n ref={ref}\n type=\"datetime-local\"\n required={required}\n disabled={disabled}\n onChange={handleChange}\n className={styles.dateTime}\n />\n </Field>\n )\n}\n"],"mappings":";;;;;;AAeA,SAAgBC,EAAc,EAC5B,UACA,gBACA,UACA,aACA,iBACA,sBACA,iBACA,cACA,eACA,aACA,cACA,aACA,kBACA,QACA,GAAGC,KACkB;CACrB,IAAMC,KAAgB,MAAyC;EAE7D,AADAC,IAAWC,CAAK,GAChBC,IAAgBD,EAAM,OAAO,KAAK;CACpC;CACA,OACE,kBAACE,GAAD;EACE,GAAIC;EACG;EACM;EACN;EACG;EACI;EACK;EACL;EACH;EACD;EACV,WAAWC,EAAKD,GAAY,WAAWE,CAAS;EAEhD,UAAA,kBAACC,GAAD;GACE,iBAAeC,EAAaC,GAAUC,CAAY;GAClD,GAAIZ;GACC;GACL,MAAK;GACK;GACA;GACV,UAAUC;GACV,WAAWH;EACZ,CAAA;CACI,CAAA;AAEX"}
1
+ {"version":3,"file":"DateTimeInput.js","names":["styles.dateTime","DateTimeInput","props","Field","fieldProps","clsx","className","Input","dateTime"],"sources":["../../../src/components/DateTimeInput/DateTimeInput.tsx"],"sourcesContent":["import { Input } from '@base-ui/react/input'\nimport { clsx } from 'clsx'\nimport type { ComponentProps, Ref } from 'react'\n\nimport * as styles from './DateTimeInput.css'\nimport { Field, type FieldBaseProps, type FieldOptionProps } from '../Field/Field'\n\nexport interface DateTimeInputProps\n extends FieldBaseProps, FieldOptionProps, Omit<ComponentProps<'input'>, 'ref' | 'type'> {\n ref?: Ref<HTMLInputElement>\n /** Called with the local date-time string, e.g. `2026-11-10T09:21`, or `''` when cleared. */\n onValueChange?: (value: string) => void\n}\n\n/** Date and time picker using the browser's native `datetime-local` input. */\nexport function DateTimeInput({\n label,\n description,\n error,\n required,\n hideLabel,\n fieldProps,\n disabled,\n className,\n ref,\n ...props\n}: DateTimeInputProps) {\n return (\n <Field\n {...fieldProps}\n label={label}\n description={description}\n error={error}\n required={required}\n hideLabel={hideLabel}\n disabled={disabled}\n className={clsx(fieldProps?.className, className)}\n >\n <Input\n {...props}\n ref={ref}\n type=\"datetime-local\"\n required={required}\n disabled={disabled}\n className={styles.dateTime}\n />\n </Field>\n )\n}\n"],"mappings":";;;;;;AAeA,SAAgBC,EAAc,EAC5B,UACA,gBACA,UACA,aACA,cACA,eACA,aACA,cACA,QACA,GAAGC,KACkB;CACrB,OACE,kBAACC,GAAD;EACE,GAAIC;EACG;EACM;EACN;EACG;EACC;EACD;EACV,WAAWC,EAAKD,GAAY,WAAWE,CAAS;EAEhD,UAAA,kBAACC,GAAD;GACE,GAAIL;GACC;GACL,MAAK;GACK;GACA;GACV,WAAWF;EACZ,CAAA;CACI,CAAA;AAEX"}