@devalok/shilp-sutra 0.17.2 → 0.18.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 (318) hide show
  1. package/dist/_chunks/avatar.js +21 -19
  2. package/dist/_chunks/button-group.js +27 -0
  3. package/dist/_chunks/button.js +53 -35
  4. package/dist/_chunks/card.js +50 -0
  5. package/dist/_chunks/checkbox.js +11 -9
  6. package/dist/_chunks/date-utils.js +13 -0
  7. package/dist/_chunks/form.js +20 -20
  8. package/dist/_chunks/link-context.js +19 -0
  9. package/dist/_chunks/motion.js +1376 -0
  10. package/dist/_chunks/motion2.js +35 -0
  11. package/dist/_chunks/primitives.js +3499 -3920
  12. package/dist/_chunks/sidebar.js +225 -211
  13. package/dist/_chunks/spinner.js +58 -28
  14. package/dist/_chunks/tiptap.js +1 -1
  15. package/dist/_chunks/tooltip.js +27 -10
  16. package/dist/_chunks/tree-view.js +180 -178
  17. package/dist/_chunks/use-calendar.js +531 -515
  18. package/dist/_chunks/utils.js +3 -3
  19. package/dist/_chunks/vendor-client.js +1792 -1049
  20. package/dist/_chunks/vendor-utils.js +5123 -1169
  21. package/dist/composed/activity-feed.d.ts.map +1 -1
  22. package/dist/composed/activity-feed.js +71 -74
  23. package/dist/composed/avatar-group.js +36 -36
  24. package/dist/composed/command-palette.d.ts +1 -1
  25. package/dist/composed/command-palette.d.ts.map +1 -1
  26. package/dist/composed/command-palette.js +207 -158
  27. package/dist/composed/confirm-dialog.d.ts +3 -5
  28. package/dist/composed/confirm-dialog.d.ts.map +1 -1
  29. package/dist/composed/confirm-dialog.js +46 -41
  30. package/dist/composed/content-card.d.ts +1 -1
  31. package/dist/composed/content-card.js +29 -29
  32. package/dist/composed/date-picker/calendar-grid.d.ts +1 -1
  33. package/dist/composed/date-picker/calendar-grid.d.ts.map +1 -1
  34. package/dist/composed/date-picker/date-picker.d.ts +1 -1
  35. package/dist/composed/date-picker/date-picker.d.ts.map +1 -1
  36. package/dist/composed/date-picker/date-range-picker.d.ts +1 -1
  37. package/dist/composed/date-picker/date-range-picker.d.ts.map +1 -1
  38. package/dist/composed/date-picker/date-time-picker.d.ts +1 -1
  39. package/dist/composed/date-picker/date-time-picker.d.ts.map +1 -1
  40. package/dist/composed/date-picker/month-picker.d.ts +1 -1
  41. package/dist/composed/date-picker/month-picker.d.ts.map +1 -1
  42. package/dist/composed/date-picker/presets.d.ts +1 -1
  43. package/dist/composed/date-picker/presets.d.ts.map +1 -1
  44. package/dist/composed/date-picker/time-picker.d.ts +1 -1
  45. package/dist/composed/date-picker/time-picker.d.ts.map +1 -1
  46. package/dist/composed/date-picker/year-picker.d.ts +1 -1
  47. package/dist/composed/date-picker/year-picker.d.ts.map +1 -1
  48. package/dist/composed/empty-state.d.ts +1 -0
  49. package/dist/composed/empty-state.d.ts.map +1 -1
  50. package/dist/composed/empty-state.js +51 -47
  51. package/dist/composed/error-boundary.d.ts +1 -1
  52. package/dist/composed/error-boundary.d.ts.map +1 -1
  53. package/dist/composed/error-boundary.js +48 -48
  54. package/dist/composed/extensions/mention-suggestion.d.ts +1 -1
  55. package/dist/composed/extensions/mention-suggestion.d.ts.map +1 -1
  56. package/dist/composed/global-loading.d.ts +1 -1
  57. package/dist/composed/global-loading.d.ts.map +1 -1
  58. package/dist/composed/global-loading.js +23 -20
  59. package/dist/composed/index.d.ts +2 -4
  60. package/dist/composed/index.d.ts.map +1 -1
  61. package/dist/composed/index.js +26 -29
  62. package/dist/composed/loading-skeleton.d.ts +1 -1
  63. package/dist/composed/loading-skeleton.d.ts.map +1 -1
  64. package/dist/composed/loading-skeleton.js +92 -87
  65. package/dist/composed/member-picker.d.ts +1 -1
  66. package/dist/composed/member-picker.d.ts.map +1 -1
  67. package/dist/composed/member-picker.js +47 -43
  68. package/dist/composed/page-header.js +36 -36
  69. package/dist/composed/page-skeletons.d.ts +9 -3
  70. package/dist/composed/page-skeletons.d.ts.map +1 -1
  71. package/dist/composed/page-skeletons.js +58 -58
  72. package/dist/composed/priority-indicator.js +19 -19
  73. package/dist/composed/rich-text-editor.d.ts +3 -3
  74. package/dist/composed/rich-text-editor.d.ts.map +1 -1
  75. package/dist/composed/rich-text-editor.js +316 -309
  76. package/dist/composed/schedule-view.js +88 -88
  77. package/dist/composed/simple-tooltip.d.ts +2 -5
  78. package/dist/composed/simple-tooltip.d.ts.map +1 -1
  79. package/dist/composed/simple-tooltip.js +19 -14
  80. package/dist/composed/status-badge.d.ts +2 -1
  81. package/dist/composed/status-badge.d.ts.map +1 -1
  82. package/dist/composed/status-badge.js +76 -63
  83. package/dist/hooks/index.d.ts +2 -1
  84. package/dist/hooks/index.d.ts.map +1 -1
  85. package/dist/hooks/index.js +3 -4
  86. package/dist/hooks/use-toast.d.ts +15 -45
  87. package/dist/hooks/use-toast.d.ts.map +1 -1
  88. package/dist/hooks/use-toast.js +2 -95
  89. package/dist/motion/index.d.ts +4 -0
  90. package/dist/motion/index.d.ts.map +1 -0
  91. package/dist/motion/index.js +10 -0
  92. package/dist/motion/motion-provider.d.ts +18 -0
  93. package/dist/motion/motion-provider.d.ts.map +1 -0
  94. package/dist/motion/motion-provider.js +24 -0
  95. package/dist/motion/primitives-index.d.ts +3 -0
  96. package/dist/motion/primitives-index.d.ts.map +1 -0
  97. package/dist/motion/primitives-index.js +11 -0
  98. package/dist/motion/primitives.d.ts +38 -0
  99. package/dist/motion/primitives.d.ts.map +1 -0
  100. package/dist/motion/primitives.js +187 -0
  101. package/dist/shell/app-command-palette.d.ts +14 -5
  102. package/dist/shell/app-command-palette.d.ts.map +1 -1
  103. package/dist/shell/app-command-palette.js +152 -130
  104. package/dist/shell/bottom-navbar.d.ts.map +1 -1
  105. package/dist/shell/bottom-navbar.js +90 -92
  106. package/dist/shell/command-registry.d.ts +23 -0
  107. package/dist/shell/command-registry.d.ts.map +1 -0
  108. package/dist/shell/command-registry.js +18 -0
  109. package/dist/shell/index.d.ts +2 -1
  110. package/dist/shell/index.d.ts.map +1 -1
  111. package/dist/shell/index.js +14 -11
  112. package/dist/shell/link-context.d.ts +6 -10
  113. package/dist/shell/link-context.d.ts.map +1 -1
  114. package/dist/shell/link-context.js +3 -16
  115. package/dist/shell/notification-center.d.ts.map +1 -1
  116. package/dist/shell/notification-center.js +137 -132
  117. package/dist/shell/notification-preferences.d.ts +10 -5
  118. package/dist/shell/notification-preferences.d.ts.map +1 -1
  119. package/dist/shell/notification-preferences.js +168 -165
  120. package/dist/shell/sidebar.js +119 -119
  121. package/dist/shell/top-bar.js +65 -65
  122. package/dist/tailwind/index.cjs +118 -297
  123. package/dist/tailwind/preset.d.ts.map +1 -1
  124. package/dist/tailwind/preset.js +118 -297
  125. package/dist/tokens/generate-scale.d.ts +86 -0
  126. package/dist/tokens/generate-scale.d.ts.map +1 -0
  127. package/dist/tokens/primitives.css +415 -187
  128. package/dist/tokens/semantic.css +244 -270
  129. package/dist/tokens/typography.css +6 -6
  130. package/dist/ui/accordion.d.ts.map +1 -1
  131. package/dist/ui/accordion.js +32 -22
  132. package/dist/ui/alert-dialog.d.ts +4 -1
  133. package/dist/ui/alert-dialog.d.ts.map +1 -1
  134. package/dist/ui/alert-dialog.js +114 -73
  135. package/dist/ui/alert.d.ts +6 -1
  136. package/dist/ui/alert.d.ts.map +1 -1
  137. package/dist/ui/alert.js +64 -49
  138. package/dist/ui/aspect-ratio.d.ts +2 -1
  139. package/dist/ui/aspect-ratio.d.ts.map +1 -1
  140. package/dist/ui/aspect-ratio.js +14 -4
  141. package/dist/ui/autocomplete.d.ts +11 -2
  142. package/dist/ui/autocomplete.d.ts.map +1 -1
  143. package/dist/ui/autocomplete.js +82 -57
  144. package/dist/ui/avatar.d.ts.map +1 -1
  145. package/dist/ui/avatar.js +45 -34
  146. package/dist/ui/badge.d.ts +1 -1
  147. package/dist/ui/badge.d.ts.map +1 -1
  148. package/dist/ui/badge.js +70 -65
  149. package/dist/ui/banner.d.ts.map +1 -1
  150. package/dist/ui/banner.js +53 -39
  151. package/dist/ui/breadcrumb.d.ts +2 -0
  152. package/dist/ui/breadcrumb.d.ts.map +1 -1
  153. package/dist/ui/breadcrumb.js +21 -21
  154. package/dist/ui/button.d.ts +10 -1
  155. package/dist/ui/button.d.ts.map +1 -1
  156. package/dist/ui/button.js +103 -67
  157. package/dist/ui/card.d.ts +2 -2
  158. package/dist/ui/card.d.ts.map +1 -1
  159. package/dist/ui/card.js +61 -53
  160. package/dist/ui/charts/_internal/animation.d.ts +1 -1
  161. package/dist/ui/charts/_internal/animation.d.ts.map +1 -1
  162. package/dist/ui/charts/area-chart.d.ts +3 -5
  163. package/dist/ui/charts/area-chart.d.ts.map +1 -1
  164. package/dist/ui/charts/bar-chart.d.ts +3 -5
  165. package/dist/ui/charts/bar-chart.d.ts.map +1 -1
  166. package/dist/ui/charts/chart-container.d.ts +2 -5
  167. package/dist/ui/charts/chart-container.d.ts.map +1 -1
  168. package/dist/ui/charts/gauge-chart.d.ts +3 -5
  169. package/dist/ui/charts/gauge-chart.d.ts.map +1 -1
  170. package/dist/ui/charts/index.js +1204 -1095
  171. package/dist/ui/charts/line-chart.d.ts +3 -5
  172. package/dist/ui/charts/line-chart.d.ts.map +1 -1
  173. package/dist/ui/charts/pie-chart.d.ts +2 -5
  174. package/dist/ui/charts/pie-chart.d.ts.map +1 -1
  175. package/dist/ui/charts/radar-chart.d.ts +3 -5
  176. package/dist/ui/charts/radar-chart.d.ts.map +1 -1
  177. package/dist/ui/charts/sparkline.d.ts +5 -5
  178. package/dist/ui/charts/sparkline.d.ts.map +1 -1
  179. package/dist/ui/checkbox.d.ts.map +1 -1
  180. package/dist/ui/checkbox.js +31 -19
  181. package/dist/ui/chip.d.ts +3 -2
  182. package/dist/ui/chip.d.ts.map +1 -1
  183. package/dist/ui/chip.js +62 -54
  184. package/dist/ui/code.js +16 -16
  185. package/dist/ui/collapsible.d.ts.map +1 -1
  186. package/dist/ui/collapsible.js +23 -15
  187. package/dist/ui/color-input.d.ts +1 -1
  188. package/dist/ui/color-input.d.ts.map +1 -1
  189. package/dist/ui/color-input.js +27 -27
  190. package/dist/ui/combobox.d.ts +2 -0
  191. package/dist/ui/combobox.d.ts.map +1 -1
  192. package/dist/ui/combobox.js +177 -166
  193. package/dist/ui/context-menu.d.ts +4 -2
  194. package/dist/ui/context-menu.d.ts.map +1 -1
  195. package/dist/ui/context-menu.js +146 -86
  196. package/dist/ui/data-table-toolbar.d.ts +3 -2
  197. package/dist/ui/data-table-toolbar.d.ts.map +1 -1
  198. package/dist/ui/data-table-toolbar.js +61 -59
  199. package/dist/ui/data-table.d.ts.map +1 -1
  200. package/dist/ui/data-table.js +289 -254
  201. package/dist/ui/dialog.d.ts +3 -1
  202. package/dist/ui/dialog.d.ts.map +1 -1
  203. package/dist/ui/dialog.js +114 -74
  204. package/dist/ui/dropdown-menu.d.ts +5 -3
  205. package/dist/ui/dropdown-menu.d.ts.map +1 -1
  206. package/dist/ui/dropdown-menu.js +150 -89
  207. package/dist/ui/file-upload.d.ts.map +1 -1
  208. package/dist/ui/file-upload.js +169 -127
  209. package/dist/ui/form.d.ts.map +1 -1
  210. package/dist/ui/form.js +29 -26
  211. package/dist/ui/hover-card.d.ts +1 -1
  212. package/dist/ui/hover-card.d.ts.map +1 -1
  213. package/dist/ui/hover-card.js +53 -21
  214. package/dist/ui/index.d.ts +18 -18
  215. package/dist/ui/index.d.ts.map +1 -1
  216. package/dist/ui/index.js +432 -449
  217. package/dist/ui/input-otp.d.ts +2 -0
  218. package/dist/ui/input-otp.d.ts.map +1 -1
  219. package/dist/ui/input-otp.js +7 -7
  220. package/dist/ui/input.d.ts.map +1 -1
  221. package/dist/ui/input.js +36 -34
  222. package/dist/ui/label.js +12 -12
  223. package/dist/ui/lib/date-utils.d.ts +6 -0
  224. package/dist/ui/lib/date-utils.d.ts.map +1 -0
  225. package/dist/ui/lib/index.d.ts +7 -0
  226. package/dist/ui/lib/index.d.ts.map +1 -0
  227. package/dist/ui/lib/link-context.d.ts +13 -0
  228. package/dist/ui/lib/link-context.d.ts.map +1 -0
  229. package/dist/ui/lib/motion.d.ts +44 -9
  230. package/dist/ui/lib/motion.d.ts.map +1 -1
  231. package/dist/ui/lib/use-ripple.d.ts.map +1 -1
  232. package/dist/ui/lib/utils.js +1 -1
  233. package/dist/ui/link.js +11 -11
  234. package/dist/ui/menubar.d.ts +4 -2
  235. package/dist/ui/menubar.d.ts.map +1 -1
  236. package/dist/ui/menubar.js +141 -97
  237. package/dist/ui/navigation-menu.d.ts +2 -0
  238. package/dist/ui/navigation-menu.d.ts.map +1 -1
  239. package/dist/ui/navigation-menu.js +176 -73
  240. package/dist/ui/number-input.d.ts.map +1 -1
  241. package/dist/ui/number-input.js +56 -49
  242. package/dist/ui/pagination.js +22 -22
  243. package/dist/ui/popover.d.ts +2 -1
  244. package/dist/ui/popover.d.ts.map +1 -1
  245. package/dist/ui/popover.js +54 -22
  246. package/dist/ui/progress.d.ts.map +1 -1
  247. package/dist/ui/progress.js +58 -42
  248. package/dist/ui/radio.js +19 -19
  249. package/dist/ui/search-input.d.ts.map +1 -1
  250. package/dist/ui/search-input.js +28 -33
  251. package/dist/ui/segmented-control.d.ts +2 -2
  252. package/dist/ui/segmented-control.d.ts.map +1 -1
  253. package/dist/ui/segmented-control.js +143 -124
  254. package/dist/ui/select.d.ts.map +1 -1
  255. package/dist/ui/select.js +72 -61
  256. package/dist/ui/separator.js +11 -11
  257. package/dist/ui/sheet.d.ts +1 -1
  258. package/dist/ui/sheet.d.ts.map +1 -1
  259. package/dist/ui/sheet.js +111 -75
  260. package/dist/ui/sidebar.d.ts +6 -1
  261. package/dist/ui/sidebar.d.ts.map +1 -1
  262. package/dist/ui/sidebar.js +27 -25
  263. package/dist/ui/skeleton.js +1 -1
  264. package/dist/ui/slider.d.ts +9 -0
  265. package/dist/ui/slider.d.ts.map +1 -1
  266. package/dist/ui/slider.js +33 -27
  267. package/dist/ui/spinner.d.ts +32 -25
  268. package/dist/ui/spinner.d.ts.map +1 -1
  269. package/dist/ui/spinner.js +199 -40
  270. package/dist/ui/stat-card.d.ts.map +1 -1
  271. package/dist/ui/stat-card.js +183 -116
  272. package/dist/ui/stepper.d.ts +22 -1
  273. package/dist/ui/stepper.d.ts.map +1 -1
  274. package/dist/ui/stepper.js +121 -43
  275. package/dist/ui/switch.d.ts.map +1 -1
  276. package/dist/ui/switch.js +39 -26
  277. package/dist/ui/table.d.ts +3 -0
  278. package/dist/ui/table.d.ts.map +1 -1
  279. package/dist/ui/table.js +47 -47
  280. package/dist/ui/tabs.d.ts +4 -1
  281. package/dist/ui/tabs.d.ts.map +1 -1
  282. package/dist/ui/tabs.js +94 -44
  283. package/dist/ui/text.d.ts +3 -3
  284. package/dist/ui/text.js +1 -1
  285. package/dist/ui/textarea.d.ts.map +1 -1
  286. package/dist/ui/textarea.js +29 -27
  287. package/dist/ui/toast-types.d.ts +43 -0
  288. package/dist/ui/toast-types.d.ts.map +1 -0
  289. package/dist/ui/toast-types.js +2 -0
  290. package/dist/ui/toast.d.ts +60 -26
  291. package/dist/ui/toast.d.ts.map +1 -1
  292. package/dist/ui/toast.js +535 -89
  293. package/dist/ui/toaster.d.ts +19 -23
  294. package/dist/ui/toaster.d.ts.map +1 -1
  295. package/dist/ui/toaster.js +31 -21
  296. package/dist/ui/toggle-group.d.ts +2 -2
  297. package/dist/ui/toggle-group.d.ts.map +1 -1
  298. package/dist/ui/toggle-group.js +29 -26
  299. package/dist/ui/toggle.d.ts +2 -2
  300. package/dist/ui/toggle.d.ts.map +1 -1
  301. package/dist/ui/toggle.js +21 -17
  302. package/dist/ui/tooltip.d.ts +2 -1
  303. package/dist/ui/tooltip.d.ts.map +1 -1
  304. package/dist/ui/tooltip.js +58 -21
  305. package/dist/ui/tree-view/tree-view.d.ts +1 -1
  306. package/dist/ui/tree-view/tree-view.d.ts.map +1 -1
  307. package/llms-full.txt +221 -102
  308. package/llms.txt +65 -12
  309. package/package.json +26 -8
  310. package/dist/_chunks/switch.js +0 -10
  311. package/dist/composed/upload-progress.d.ts +0 -33
  312. package/dist/composed/upload-progress.d.ts.map +0 -1
  313. package/dist/composed/upload-progress.js +0 -386
  314. package/dist/ui/lib/use-reduced-motion.d.ts +0 -4
  315. package/dist/ui/lib/use-reduced-motion.d.ts.map +0 -1
  316. package/dist/ui/transitions.d.ts +0 -17
  317. package/dist/ui/transitions.d.ts.map +0 -1
  318. package/dist/ui/transitions.js +0 -111
@@ -1,187 +1,189 @@
1
1
  "use client";
2
- import { jsxs as x, jsx as s } from "react/jsx-runtime";
3
- import * as h from "react";
4
- import { useState as ke } from "react";
5
- import { format as j, startOfMonth as q, endOfMonth as fe, startOfWeek as ve, endOfWeek as Pe, addDays as J, subMonths as pe, addMonths as te, isSameMonth as he, isSameDay as X, lastDayOfMonth as Se, isBefore as C, startOfDay as G, isAfter as ee, isWithinInterval as be, setMonth as re, setYear as ne, endOfDay as _, startOfYear as Ye, subDays as ie, setHours as K, setMinutes as se, setSeconds as xe } from "date-fns";
6
- import { IconChevronLeft as Re, IconChevronRight as Te, IconCalendarEvent as ge, IconClock as Ae, IconCalendarClock as He } from "@tabler/icons-react";
7
- import { c as k } from "./utils.js";
8
- import { Popover as oe, PopoverTrigger as ce, PopoverContent as le } from "../ui/popover.js";
9
- const Oe = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"], z = h.forwardRef(
2
+ import { jsxs as h, jsx as t } from "react/jsx-runtime";
3
+ import * as p from "react";
4
+ import { useState as Se } from "react";
5
+ import { format as D, startOfMonth as z, endOfMonth as me, startOfWeek as ve, endOfWeek as Ye, addDays as _, subMonths as be, addMonths as te, isSameMonth as ge, isSameDay as X, lastDayOfMonth as Re, isBefore as C, startOfDay as K, isAfter as ee, isWithinInterval as xe, setMonth as re, setYear as ne, endOfDay as U, startOfYear as Te, subDays as ue, setHours as J, setMinutes as se, setSeconds as ye } from "date-fns";
6
+ import { IconChevronLeft as Ae, IconChevronRight as He, IconCalendarEvent as we, IconClock as Oe, IconCalendarClock as De } from "@tabler/icons-react";
7
+ import { c as y } from "./utils.js";
8
+ import { Popover as ce, PopoverTrigger as oe, PopoverContent as ae } from "../ui/popover.js";
9
+ const Ee = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"], Q = p.forwardRef(
10
10
  function({
11
11
  currentMonth: e,
12
12
  selected: n,
13
- rangeStart: o,
14
- rangeEnd: f,
15
- hoverDate: y,
16
- onSelect: m,
17
- onHover: d,
18
- onMonthChange: b,
19
- onHeaderClick: M,
20
- disabledDates: g,
21
- minDate: P,
22
- maxDate: D,
23
- hidePrevNav: N,
24
- hideNextNav: A,
25
- events: v
26
- }, R) {
27
- const p = h.useRef(null), H = h.useMemo(() => {
13
+ rangeStart: a,
14
+ rangeEnd: i,
15
+ hoverDate: g,
16
+ onSelect: b,
17
+ onHover: f,
18
+ onMonthChange: x,
19
+ onHeaderClick: P,
20
+ disabledDates: S,
21
+ minDate: M,
22
+ maxDate: w,
23
+ hidePrevNav: T,
24
+ hideNextNav: N,
25
+ events: A,
26
+ className: Y,
27
+ ...R
28
+ }, m) {
29
+ const O = p.useRef(null), H = p.useMemo(() => {
28
30
  const c = /* @__PURE__ */ new Map();
29
- if (!v) return c;
30
- for (const w of v) {
31
- const t = j(w.date, "yyyy-MM-dd"), l = c.get(t) ?? [];
32
- l.push(w), c.set(t, l);
31
+ if (!A) return c;
32
+ for (const s of A) {
33
+ const l = D(s.date, "yyyy-MM-dd"), r = c.get(l) ?? [];
34
+ r.push(s), c.set(l, r);
33
35
  }
34
36
  return c;
35
- }, [v]), T = q(e), E = fe(e), S = ve(T), $ = Pe(E), W = [];
36
- let O = S;
37
- for (; O <= $; )
38
- W.push(O), O = J(O, 1);
39
- const L = (c) => !!(g != null && g(c) || P && C(c, G(P)) || D && ee(c, G(D))), I = (c) => {
40
- if (o && f) {
41
- const w = C(o, f) ? o : f, t = ee(f, o) ? f : o;
42
- return be(c, { start: w, end: t });
37
+ }, [A]), E = z(e), v = me(e), $ = ve(E), G = Ye(v), L = [];
38
+ let j = $;
39
+ for (; j <= G; )
40
+ L.push(j), j = _(j, 1);
41
+ const I = (c) => !!(S != null && S(c) || M && C(c, K(M)) || w && ee(c, K(w))), B = (c) => {
42
+ if (a && i) {
43
+ const s = C(a, i) ? a : i, l = ee(i, a) ? i : a;
44
+ return xe(c, { start: s, end: l });
43
45
  }
44
- if (o && y) {
45
- const w = C(o, y) ? o : y, t = ee(y, o) ? y : o;
46
- return be(c, { start: w, end: t });
46
+ if (a && g) {
47
+ const s = C(a, g) ? a : g, l = ee(g, a) ? g : a;
48
+ return xe(c, { start: s, end: l });
47
49
  }
48
50
  return !1;
49
- }, B = (c) => !!(o && X(c, o) || f && X(c, f)), V = (c) => {
50
- if (!p.current) return;
51
- const w = j(c, "yyyy-MM-dd"), t = p.current.querySelector(
52
- `[data-date="${w}"]`
51
+ }, V = (c) => !!(a && X(c, a) || i && X(c, i)), F = (c) => {
52
+ if (!O.current) return;
53
+ const s = D(c, "yyyy-MM-dd"), l = O.current.querySelector(
54
+ `[data-date="${s}"]`
53
55
  );
54
- t ? t.focus() : b(q(c));
55
- }, F = (c) => {
56
- const t = c.target.getAttribute("data-date");
57
- if (!t) return;
58
- const l = /* @__PURE__ */ new Date(t + "T00:00:00");
59
- let r = null;
56
+ l ? l.focus() : x(z(c));
57
+ }, W = (c) => {
58
+ const l = c.target.getAttribute("data-date");
59
+ if (!l) return;
60
+ const r = /* @__PURE__ */ new Date(l + "T00:00:00");
61
+ let o = null;
60
62
  switch (c.key) {
61
63
  case "ArrowLeft":
62
- r = J(l, -1);
64
+ o = _(r, -1);
63
65
  break;
64
66
  case "ArrowRight":
65
- r = J(l, 1);
67
+ o = _(r, 1);
66
68
  break;
67
69
  case "ArrowUp":
68
- r = J(l, -7);
70
+ o = _(r, -7);
69
71
  break;
70
72
  case "ArrowDown":
71
- r = J(l, 7);
73
+ o = _(r, 7);
72
74
  break;
73
75
  case "Home":
74
- r = q(l);
76
+ o = z(r);
75
77
  break;
76
78
  case "End":
77
- r = Se(l);
79
+ o = Re(r);
78
80
  break;
79
81
  case "Enter":
80
82
  case " ": {
81
- c.preventDefault(), !L(l) && he(l, e) && m(l);
83
+ c.preventDefault(), !I(r) && ge(r, e) && b(r);
82
84
  return;
83
85
  }
84
86
  default:
85
87
  return;
86
88
  }
87
- r && (c.preventDefault(), V(r));
89
+ o && (c.preventDefault(), F(o));
88
90
  };
89
- return /* @__PURE__ */ x("div", { ref: R, className: "w-[252px]", children: [
90
- /* @__PURE__ */ x("div", { className: "flex items-center justify-between px-ds-02 pb-ds-04", children: [
91
- N ? /* @__PURE__ */ s("span", { className: "h-ds-xs-plus w-ds-xs-plus" }) : /* @__PURE__ */ s(
91
+ return /* @__PURE__ */ h("div", { ref: m, ...R, className: y("w-[252px]", Y), children: [
92
+ /* @__PURE__ */ h("div", { className: "flex items-center justify-between px-ds-02 pb-ds-04", children: [
93
+ T ? /* @__PURE__ */ t("span", { className: "h-ds-xs-plus w-ds-xs-plus" }) : /* @__PURE__ */ t(
92
94
  "button",
93
95
  {
94
96
  type: "button",
95
- onClick: () => b(pe(e, 1)),
96
- className: "inline-flex h-ds-xs-plus w-ds-xs-plus items-center justify-center rounded-ds-md text-text-placeholder transition-colors duration-fast-01 ease-productive-standard hover:bg-field hover:text-text-secondary",
97
+ onClick: () => x(be(e, 1)),
98
+ className: "inline-flex h-ds-xs-plus w-ds-xs-plus items-center justify-center rounded-ds-md text-surface-fg-subtle transition-colors duration-fast-01 ease-productive-standard hover:bg-surface-3 hover:text-surface-fg-muted",
97
99
  "aria-label": "Previous month",
98
- children: /* @__PURE__ */ s(Re, { className: "h-ico-sm w-ico-sm", stroke: 1.5 })
100
+ children: /* @__PURE__ */ t(Ae, { className: "h-ico-sm w-ico-sm", stroke: 1.5 })
99
101
  }
100
102
  ),
101
- /* @__PURE__ */ s(
103
+ /* @__PURE__ */ t(
102
104
  "button",
103
105
  {
104
106
  type: "button",
105
- onClick: M,
106
- className: k(
107
- "text-ds-md font-semibold text-text-primary",
108
- M && "cursor-pointer rounded-ds-md px-ds-02 transition-colors duration-fast-01 ease-productive-standard hover:bg-field"
107
+ onClick: P,
108
+ className: y(
109
+ "text-ds-md font-semibold text-surface-fg",
110
+ P && "cursor-pointer rounded-ds-md px-ds-02 transition-colors duration-fast-01 ease-productive-standard hover:bg-surface-3"
109
111
  ),
110
112
  "aria-label": "Switch to month/year view",
111
- children: j(e, "MMMM yyyy")
113
+ children: D(e, "MMMM yyyy")
112
114
  }
113
115
  ),
114
- A ? /* @__PURE__ */ s("span", { className: "h-ds-xs-plus w-ds-xs-plus" }) : /* @__PURE__ */ s(
116
+ N ? /* @__PURE__ */ t("span", { className: "h-ds-xs-plus w-ds-xs-plus" }) : /* @__PURE__ */ t(
115
117
  "button",
116
118
  {
117
119
  type: "button",
118
- onClick: () => b(te(e, 1)),
119
- className: "inline-flex h-ds-xs-plus w-ds-xs-plus items-center justify-center rounded-ds-md text-text-placeholder transition-colors duration-fast-01 ease-productive-standard hover:bg-field hover:text-text-secondary",
120
+ onClick: () => x(te(e, 1)),
121
+ className: "inline-flex h-ds-xs-plus w-ds-xs-plus items-center justify-center rounded-ds-md text-surface-fg-subtle transition-colors duration-fast-01 ease-productive-standard hover:bg-surface-3 hover:text-surface-fg-muted",
120
122
  "aria-label": "Next month",
121
- children: /* @__PURE__ */ s(Te, { className: "h-ico-sm w-ico-sm", stroke: 1.5 })
123
+ children: /* @__PURE__ */ t(He, { className: "h-ico-sm w-ico-sm", stroke: 1.5 })
122
124
  }
123
125
  )
124
126
  ] }),
125
- /* @__PURE__ */ x(
127
+ /* @__PURE__ */ h(
126
128
  "div",
127
129
  {
128
- ref: p,
130
+ ref: O,
129
131
  className: "grid grid-cols-7 gap-0",
130
132
  role: "grid",
131
133
  tabIndex: 0,
132
134
  "aria-label": "Calendar",
133
- onKeyDown: F,
135
+ onKeyDown: W,
134
136
  children: [
135
- Oe.map((c) => /* @__PURE__ */ s(
137
+ Ee.map((c) => /* @__PURE__ */ t(
136
138
  "div",
137
139
  {
138
140
  role: "columnheader",
139
- className: "flex h-ds-sm items-center justify-center text-ds-xs font-semibold uppercase tracking-wider text-text-placeholder",
141
+ className: "flex h-ds-sm items-center justify-center text-ds-xs font-semibold uppercase tracking-wider text-surface-fg-subtle",
140
142
  children: c
141
143
  },
142
144
  c
143
145
  )),
144
- W.map((c, w) => {
145
- const t = he(c, e), l = L(c), r = n && X(c, n), i = I(c), a = B(c), Y = X(c, /* @__PURE__ */ new Date()), Q = j(c, "yyyy-MM-dd"), me = H.get(Q) ?? [];
146
- return /* @__PURE__ */ x(
146
+ L.map((c, s) => {
147
+ const l = ge(c, e), r = I(c), o = n && X(c, n), d = B(c), k = V(c), ie = X(c, /* @__PURE__ */ new Date()), pe = D(c, "yyyy-MM-dd"), he = H.get(pe) ?? [];
148
+ return /* @__PURE__ */ h(
147
149
  "button",
148
150
  {
149
151
  type: "button",
150
152
  role: "gridcell",
151
- "data-date": Q,
152
- tabIndex: t && !l ? 0 : -1,
153
- disabled: !t || l,
153
+ "data-date": pe,
154
+ tabIndex: l && !r ? 0 : -1,
155
+ disabled: !l || r,
154
156
  onClick: () => {
155
- t && !l && m(c);
157
+ l && !r && b(c);
156
158
  },
157
- onMouseEnter: () => d == null ? void 0 : d(c),
158
- onMouseLeave: () => d == null ? void 0 : d(null),
159
- "aria-label": j(c, "EEEE, MMMM d, yyyy"),
160
- "aria-selected": r || a || void 0,
161
- "aria-disabled": !t || l || void 0,
162
- className: k(
159
+ onMouseEnter: () => f == null ? void 0 : f(c),
160
+ onMouseLeave: () => f == null ? void 0 : f(null),
161
+ "aria-label": D(c, "EEEE, MMMM d, yyyy"),
162
+ "aria-selected": o || k || void 0,
163
+ "aria-disabled": !l || r || void 0,
164
+ className: y(
163
165
  "relative flex h-ds-sm w-ds-sm-plus items-center justify-center rounded-ds-md text-ds-md font-body transition-colors duration-fast-01 ease-productive-standard",
164
- !t && "pointer-events-none opacity-0",
165
- t && l && "opacity-[0.38] pointer-events-none cursor-not-allowed",
166
- t && !l && !r && !a && !i && "text-text-primary hover:bg-field",
167
- i && !a && "rounded-ds-none bg-field text-text-primary",
168
- (r || a) && "bg-interactive text-text-on-color hover:bg-interactive-hover",
169
- Y && !r && !a && !l && "font-semibold text-interactive"
166
+ !l && "pointer-events-none opacity-0",
167
+ l && r && "opacity-action-disabled pointer-events-none cursor-not-allowed",
168
+ l && !r && !o && !k && !d && "text-surface-fg hover:bg-surface-3",
169
+ d && !k && "rounded-ds-none bg-surface-3 text-surface-fg",
170
+ (o || k) && "bg-accent-9 text-accent-fg hover:bg-accent-10",
171
+ ie && !o && !k && !r && "font-semibold text-accent-11"
170
172
  ),
171
173
  children: [
172
- j(c, "d"),
173
- me.length > 0 && /* @__PURE__ */ s("span", { className: "flex gap-px justify-center absolute bottom-[2px] left-0 right-0", children: me.slice(0, 3).map((we, Ne) => /* @__PURE__ */ s(
174
+ D(c, "d"),
175
+ he.length > 0 && /* @__PURE__ */ t("span", { className: "flex gap-px justify-center absolute bottom-[2px] left-0 right-0", children: he.slice(0, 3).map((ke, Pe) => /* @__PURE__ */ t(
174
176
  "span",
175
177
  {
176
178
  "data-event-dot": !0,
177
179
  className: "h-[4px] w-[4px] rounded-ds-full",
178
- style: { backgroundColor: we.color ?? "var(--color-interactive)" }
180
+ style: { backgroundColor: ke.color ?? "var(--color-accent-9)" }
179
181
  },
180
- Ne
182
+ Pe
181
183
  )) })
182
184
  ]
183
185
  },
184
- w
186
+ s
185
187
  );
186
188
  })
187
189
  ]
@@ -190,35 +192,37 @@ const Oe = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"], z = h.forwardRef(
190
192
  ] });
191
193
  }
192
194
  );
193
- z.displayName = "CalendarGrid";
194
- const ae = h.forwardRef(
195
+ Q.displayName = "CalendarGrid";
196
+ const le = p.forwardRef(
195
197
  function({
196
198
  currentYear: e,
197
199
  selectedYear: n,
198
- onYearSelect: o,
199
- minDate: f,
200
- maxDate: y
201
- }, m) {
202
- const d = Math.floor(e / 10) * 10, b = Array.from({ length: 12 }, (M, g) => d + g);
203
- return /* @__PURE__ */ x("div", { ref: m, className: "w-[252px]", children: [
204
- /* @__PURE__ */ x("div", { className: "text-center pb-ds-04 text-ds-md font-semibold text-text-primary", children: [
205
- d,
200
+ onYearSelect: a,
201
+ minDate: i,
202
+ maxDate: g,
203
+ className: b,
204
+ ...f
205
+ }, x) {
206
+ const P = Math.floor(e / 10) * 10, S = Array.from({ length: 12 }, (M, w) => P + w);
207
+ return /* @__PURE__ */ h("div", { ref: x, ...f, className: y("w-[252px]", b), children: [
208
+ /* @__PURE__ */ h("div", { className: "text-center pb-ds-04 text-ds-md font-semibold text-surface-fg", children: [
209
+ P,
206
210
  " – ",
207
- d + 11
211
+ P + 11
208
212
  ] }),
209
- /* @__PURE__ */ s("div", { className: "grid grid-cols-3 gap-ds-02", children: b.map((M) => {
210
- const g = M === n, P = f != null && M < f.getFullYear() || y != null && M > y.getFullYear();
211
- return /* @__PURE__ */ s(
213
+ /* @__PURE__ */ t("div", { className: "grid grid-cols-3 gap-ds-02", children: S.map((M) => {
214
+ const w = M === n, T = i != null && M < i.getFullYear() || g != null && M > g.getFullYear();
215
+ return /* @__PURE__ */ t(
212
216
  "button",
213
217
  {
214
218
  type: "button",
215
- disabled: P || !1,
216
- onClick: () => !P && o(M),
217
- className: k(
219
+ disabled: T || !1,
220
+ onClick: () => !T && a(M),
221
+ className: y(
218
222
  "h-ds-sm-plus rounded-ds-md text-ds-md transition-colors",
219
- P && "opacity-[0.38] pointer-events-none cursor-not-allowed",
220
- g && "bg-interactive text-text-on-color",
221
- !g && !P && "hover:bg-field text-text-primary"
223
+ T && "opacity-action-disabled pointer-events-none cursor-not-allowed",
224
+ w && "bg-accent-9 text-accent-fg",
225
+ !w && !T && "hover:bg-surface-3 text-surface-fg"
222
226
  ),
223
227
  children: M
224
228
  },
@@ -228,8 +232,8 @@ const ae = h.forwardRef(
228
232
  ] });
229
233
  }
230
234
  );
231
- ae.displayName = "YearPicker";
232
- const De = [
235
+ le.displayName = "YearPicker";
236
+ const $e = [
233
237
  "Jan",
234
238
  "Feb",
235
239
  "Mar",
@@ -242,141 +246,146 @@ const De = [
242
246
  "Oct",
243
247
  "Nov",
244
248
  "Dec"
245
- ], de = h.forwardRef(
249
+ ], de = p.forwardRef(
246
250
  function({
247
251
  currentYear: e,
248
252
  selectedMonth: n,
249
- onMonthSelect: o,
250
- minDate: f,
251
- maxDate: y
252
- }, m) {
253
- return /* @__PURE__ */ x("div", { ref: m, className: "w-[252px]", children: [
254
- /* @__PURE__ */ s("div", { className: "text-center pb-ds-04 text-ds-md font-semibold text-text-primary", children: e }),
255
- /* @__PURE__ */ s("div", { className: "grid grid-cols-4 gap-ds-02", children: De.map((d, b) => {
256
- const M = b === n, g = f != null && (e < f.getFullYear() || e === f.getFullYear() && b < f.getMonth()) || y != null && (e > y.getFullYear() || e === y.getFullYear() && b > y.getMonth());
257
- return /* @__PURE__ */ s(
253
+ onMonthSelect: a,
254
+ minDate: i,
255
+ maxDate: g,
256
+ className: b,
257
+ ...f
258
+ }, x) {
259
+ return /* @__PURE__ */ h("div", { ref: x, ...f, className: y("w-[252px]", b), children: [
260
+ /* @__PURE__ */ t("div", { className: "text-center pb-ds-04 text-ds-md font-semibold text-surface-fg", children: e }),
261
+ /* @__PURE__ */ t("div", { className: "grid grid-cols-4 gap-ds-02", children: $e.map((P, S) => {
262
+ const M = S === n, w = i != null && (e < i.getFullYear() || e === i.getFullYear() && S < i.getMonth()) || g != null && (e > g.getFullYear() || e === g.getFullYear() && S > g.getMonth());
263
+ return /* @__PURE__ */ t(
258
264
  "button",
259
265
  {
260
266
  type: "button",
261
- disabled: g || !1,
262
- onClick: () => !g && o(b),
263
- className: k(
267
+ disabled: w || !1,
268
+ onClick: () => !w && a(S),
269
+ className: y(
264
270
  "h-ds-sm-plus rounded-ds-md text-ds-md transition-colors",
265
- g && "opacity-[0.38] pointer-events-none cursor-not-allowed",
266
- M && "bg-interactive text-text-on-color",
267
- !M && !g && "hover:bg-field text-text-primary"
271
+ w && "opacity-action-disabled pointer-events-none cursor-not-allowed",
272
+ M && "bg-accent-9 text-accent-fg",
273
+ !M && !w && "hover:bg-surface-3 text-surface-fg"
268
274
  ),
269
- children: d
275
+ children: P
270
276
  },
271
- d
277
+ P
272
278
  );
273
279
  }) })
274
280
  ] });
275
281
  }
276
282
  );
277
283
  de.displayName = "MonthPicker";
278
- const Ee = h.forwardRef(
284
+ const je = p.forwardRef(
279
285
  function({
280
286
  value: e,
281
287
  onChange: n,
282
- placeholder: o = "Pick a date",
283
- className: f,
284
- formatStr: y = "MMM d, yyyy",
285
- minDate: m,
286
- maxDate: d,
287
- disabledDates: b
288
- }, M) {
289
- const [g, P] = h.useState(!1), [D, N] = h.useState(
288
+ placeholder: a = "Pick a date",
289
+ className: i,
290
+ formatStr: g = "MMM d, yyyy",
291
+ minDate: b,
292
+ maxDate: f,
293
+ disabledDates: x,
294
+ ...P
295
+ }, S) {
296
+ const [M, w] = p.useState(!1), [T, N] = p.useState(
290
297
  e ?? /* @__PURE__ */ new Date()
291
- ), [A, v] = h.useState("days");
292
- h.useEffect(() => {
293
- g || v("days");
294
- }, [g]);
295
- const R = (S) => {
296
- n == null || n(S), P(!1);
297
- }, p = () => {
298
- v((S) => S === "days" ? "months" : "years");
299
- }, H = (S) => {
300
- N(($) => re($, S)), v("days");
301
- }, T = (S) => {
302
- N(($) => ne($, S)), v("months");
298
+ ), [A, Y] = p.useState("days");
299
+ p.useEffect(() => {
300
+ M || Y("days");
301
+ }, [M]);
302
+ const R = (v) => {
303
+ n == null || n(v), w(!1);
304
+ }, m = () => {
305
+ Y((v) => v === "days" ? "months" : "years");
306
+ }, O = (v) => {
307
+ N(($) => re($, v)), Y("days");
308
+ }, H = (v) => {
309
+ N(($) => ne($, v)), Y("months");
303
310
  }, E = () => {
304
311
  switch (A) {
305
312
  case "years":
306
- return /* @__PURE__ */ s(
307
- ae,
313
+ return /* @__PURE__ */ t(
314
+ le,
308
315
  {
309
- currentYear: D.getFullYear(),
316
+ currentYear: T.getFullYear(),
310
317
  selectedYear: e == null ? void 0 : e.getFullYear(),
311
- onYearSelect: T,
312
- minDate: m,
313
- maxDate: d
318
+ onYearSelect: H,
319
+ minDate: b,
320
+ maxDate: f
314
321
  }
315
322
  );
316
323
  case "months":
317
- return /* @__PURE__ */ s(
324
+ return /* @__PURE__ */ t(
318
325
  de,
319
326
  {
320
- currentYear: D.getFullYear(),
327
+ currentYear: T.getFullYear(),
321
328
  selectedMonth: e == null ? void 0 : e.getMonth(),
322
- onMonthSelect: H,
323
- minDate: m,
324
- maxDate: d
329
+ onMonthSelect: O,
330
+ minDate: b,
331
+ maxDate: f
325
332
  }
326
333
  );
327
334
  default:
328
- return /* @__PURE__ */ s(
329
- z,
335
+ return /* @__PURE__ */ t(
336
+ Q,
330
337
  {
331
- currentMonth: D,
338
+ currentMonth: T,
332
339
  selected: e,
333
340
  onSelect: R,
334
341
  onMonthChange: N,
335
- onHeaderClick: p,
336
- disabledDates: b,
337
- minDate: m,
338
- maxDate: d
342
+ onHeaderClick: m,
343
+ disabledDates: x,
344
+ minDate: b,
345
+ maxDate: f
339
346
  }
340
347
  );
341
348
  }
342
349
  };
343
- return /* @__PURE__ */ x(oe, { open: g, onOpenChange: P, children: [
344
- /* @__PURE__ */ s(ce, { asChild: !0, children: /* @__PURE__ */ x(
350
+ return /* @__PURE__ */ h(ce, { open: M, onOpenChange: w, children: [
351
+ /* @__PURE__ */ t(oe, { asChild: !0, children: /* @__PURE__ */ h(
345
352
  "button",
346
353
  {
347
- ref: M,
354
+ ref: S,
348
355
  type: "button",
349
- className: k(
350
- "inline-flex h-ds-sm-plus items-center gap-ds-03 rounded-ds-lg border border-border bg-layer-01 px-ds-04 text-left transition-colors duration-fast-01 ease-productive-standard",
351
- "hover:border-border-strong",
352
- "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus focus-visible:ring-offset-2",
353
- f
356
+ "aria-label": e ? `Change date, ${D(e, g)}` : a,
357
+ ...P,
358
+ className: y(
359
+ "inline-flex h-ds-sm-plus items-center gap-ds-03 rounded-ds-lg border border-surface-border-strong bg-surface-1 px-ds-04 text-left transition-colors duration-fast-01 ease-productive-standard",
360
+ "hover:border-surface-border-strong",
361
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-9 focus-visible:ring-offset-2",
362
+ i
354
363
  ),
355
364
  children: [
356
- /* @__PURE__ */ s(
357
- ge,
365
+ /* @__PURE__ */ t(
366
+ we,
358
367
  {
359
- className: "h-ico-sm w-ico-sm text-text-placeholder",
368
+ className: "h-ico-sm w-ico-sm text-surface-fg-subtle",
360
369
  stroke: 1.5
361
370
  }
362
371
  ),
363
- /* @__PURE__ */ s(
372
+ /* @__PURE__ */ t(
364
373
  "span",
365
374
  {
366
- className: k(
375
+ className: y(
367
376
  "text-ds-md",
368
- e ? "text-text-primary" : "text-text-placeholder"
377
+ e ? "text-surface-fg" : "text-surface-fg-subtle"
369
378
  ),
370
- children: e ? j(e, y) : o
379
+ children: e ? D(e, g) : a
371
380
  }
372
381
  )
373
382
  ]
374
383
  }
375
384
  ) }),
376
- /* @__PURE__ */ s(
377
- le,
385
+ /* @__PURE__ */ t(
386
+ ae,
378
387
  {
379
- className: "w-auto border-border bg-layer-01 p-ds-04",
388
+ className: "w-auto border-surface-border-strong bg-surface-1 p-ds-04",
380
389
  align: "start",
381
390
  sideOffset: 4,
382
391
  children: E()
@@ -385,398 +394,403 @@ const Ee = h.forwardRef(
385
394
  ] });
386
395
  }
387
396
  );
388
- Ee.displayName = "DatePicker";
389
- const $e = {
397
+ je.displayName = "DatePicker";
398
+ const Ie = {
390
399
  today: {
391
400
  label: "Today",
392
401
  getRange: () => {
393
402
  const u = /* @__PURE__ */ new Date();
394
- return { start: G(u), end: _(u) };
403
+ return { start: K(u), end: U(u) };
395
404
  }
396
405
  },
397
406
  yesterday: {
398
407
  label: "Yesterday",
399
408
  getRange: () => {
400
- const u = ie(/* @__PURE__ */ new Date(), 1);
401
- return { start: G(u), end: _(u) };
409
+ const u = ue(/* @__PURE__ */ new Date(), 1);
410
+ return { start: K(u), end: U(u) };
402
411
  }
403
412
  },
404
413
  last7days: {
405
414
  label: "Last 7 days",
406
415
  getRange: () => {
407
416
  const u = /* @__PURE__ */ new Date();
408
- return { start: G(ie(u, 6)), end: _(u) };
417
+ return { start: K(ue(u, 6)), end: U(u) };
409
418
  }
410
419
  },
411
420
  last30days: {
412
421
  label: "Last 30 days",
413
422
  getRange: () => {
414
423
  const u = /* @__PURE__ */ new Date();
415
- return { start: G(ie(u, 29)), end: _(u) };
424
+ return { start: K(ue(u, 29)), end: U(u) };
416
425
  }
417
426
  },
418
427
  thisMonth: {
419
428
  label: "This month",
420
429
  getRange: () => {
421
430
  const u = /* @__PURE__ */ new Date();
422
- return { start: q(u), end: fe(u) };
431
+ return { start: z(u), end: me(u) };
423
432
  }
424
433
  },
425
434
  lastMonth: {
426
435
  label: "Last month",
427
436
  getRange: () => {
428
- const e = pe(/* @__PURE__ */ new Date(), 1);
429
- return { start: q(e), end: fe(e) };
437
+ const e = be(/* @__PURE__ */ new Date(), 1);
438
+ return { start: z(e), end: me(e) };
430
439
  }
431
440
  },
432
441
  thisYear: {
433
442
  label: "This year",
434
443
  getRange: () => {
435
444
  const u = /* @__PURE__ */ new Date();
436
- return { start: Ye(u), end: _(u) };
445
+ return { start: Te(u), end: U(u) };
437
446
  }
438
447
  }
439
- }, Me = h.forwardRef(
440
- function({ presets: e, onSelect: n, className: o }, f) {
441
- return /* @__PURE__ */ s("div", { ref: f, className: k("flex flex-col gap-ds-01", o), children: e.map((y) => {
442
- const m = $e[y];
443
- return m ? /* @__PURE__ */ s(
448
+ }, Ne = p.forwardRef(
449
+ function({ presets: e, onSelect: n, className: a, ...i }, g) {
450
+ return /* @__PURE__ */ t("div", { ref: g, ...i, className: y("flex flex-col gap-ds-01", a), children: e.map((b) => {
451
+ const f = Ie[b];
452
+ return f ? /* @__PURE__ */ t(
444
453
  "button",
445
454
  {
446
455
  type: "button",
447
456
  onClick: () => {
448
- const { start: d, end: b } = m.getRange();
449
- n(d, b);
457
+ const { start: x, end: P } = f.getRange();
458
+ n(x, P);
450
459
  },
451
- className: k(
460
+ className: y(
452
461
  "h-ds-sm w-full rounded-ds-md px-ds-03 text-left text-ds-sm",
453
- "text-text-primary transition-colors",
454
- "hover:bg-field",
455
- "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus"
462
+ "text-surface-fg transition-colors",
463
+ "hover:bg-surface-3",
464
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-9"
456
465
  ),
457
- children: m.label
466
+ children: f.label
458
467
  },
459
- y
468
+ b
460
469
  ) : null;
461
470
  }) });
462
471
  }
463
472
  );
464
- Me.displayName = "Presets";
465
- const je = h.forwardRef(
473
+ Ne.displayName = "Presets";
474
+ const Le = p.forwardRef(
466
475
  function({
467
476
  startDate: e,
468
477
  endDate: n,
469
- onChange: o,
470
- placeholder: f = "Pick a date range",
471
- className: y,
472
- formatStr: m = "MMM d, yyyy",
473
- minDate: d,
474
- maxDate: b,
475
- disabledDates: M,
476
- presets: g,
477
- numberOfMonths: P = 1
478
- }, D) {
479
- const [N, A] = h.useState(!1), [v, R] = h.useState(
478
+ onChange: a,
479
+ placeholder: i = "Pick a date range",
480
+ className: g,
481
+ formatStr: b = "MMM d, yyyy",
482
+ minDate: f,
483
+ maxDate: x,
484
+ disabledDates: P,
485
+ presets: S,
486
+ numberOfMonths: M = 1,
487
+ ...w
488
+ }, T) {
489
+ const [N, A] = p.useState(!1), [Y, R] = p.useState(
480
490
  e ?? /* @__PURE__ */ new Date()
481
- ), [p, H] = h.useState(
491
+ ), [m, O] = p.useState(
482
492
  e ?? null
483
- ), [T, E] = h.useState(
493
+ ), [H, E] = p.useState(
484
494
  n ?? null
485
- ), [S, $] = h.useState(null), [W, O] = h.useState("days"), L = Math.max(1, P);
486
- h.useEffect(() => {
487
- H(e ?? null), E(n ?? null);
488
- }, [e, n]), h.useEffect(() => {
489
- N || O("days");
495
+ ), [v, $] = p.useState(null), [G, L] = p.useState("days"), j = Math.max(1, M);
496
+ p.useEffect(() => {
497
+ O(e ?? null), E(n ?? null);
498
+ }, [e, n]), p.useEffect(() => {
499
+ N || L("days");
490
500
  }, [N]);
491
- const I = (i) => {
492
- if (!p || p && T)
493
- H(i), E(null);
501
+ const I = (o) => {
502
+ if (!m || m && H)
503
+ O(o), E(null);
494
504
  else {
495
- const a = C(i, p) ? i : p, Y = ee(i, p) ? i : p;
496
- H(a), E(Y), o == null || o({ start: a, end: Y }), A(!1);
505
+ const d = C(o, m) ? o : m, k = ee(o, m) ? o : m;
506
+ O(d), E(k), a == null || a({ start: d, end: k }), A(!1);
497
507
  }
498
- }, B = (i, a) => {
499
- H(i), E(a), o == null || o({ start: i, end: a }), A(!1);
508
+ }, B = (o, d) => {
509
+ O(o), E(d), a == null || a({ start: o, end: d }), A(!1);
500
510
  }, V = () => {
501
- O((i) => i === "days" ? "months" : "years");
502
- }, F = (i) => {
503
- R((a) => re(a, i)), O("days");
504
- }, c = (i) => {
505
- R((a) => ne(a, i)), O("months");
506
- }, w = () => p && T ? `${j(p, m)} - ${j(T, m)}` : f, t = () => L === 1 ? /* @__PURE__ */ s(
507
- z,
511
+ L((o) => o === "days" ? "months" : "years");
512
+ }, F = (o) => {
513
+ R((d) => re(d, o)), L("days");
514
+ }, W = (o) => {
515
+ R((d) => ne(d, o)), L("months");
516
+ }, c = () => m && H ? `${D(m, b)} - ${D(H, b)}` : i, s = () => j === 1 ? /* @__PURE__ */ t(
517
+ Q,
508
518
  {
509
- currentMonth: v,
510
- rangeStart: p,
511
- rangeEnd: T,
512
- hoverDate: S,
519
+ currentMonth: Y,
520
+ rangeStart: m,
521
+ rangeEnd: H,
522
+ hoverDate: v,
513
523
  onSelect: I,
514
524
  onHover: $,
515
525
  onMonthChange: R,
516
526
  onHeaderClick: V,
517
- disabledDates: M,
518
- minDate: d,
519
- maxDate: b
527
+ disabledDates: P,
528
+ minDate: f,
529
+ maxDate: x
520
530
  }
521
- ) : /* @__PURE__ */ s("div", { className: "flex flex-row gap-ds-04", children: Array.from({ length: L }, (i, a) => /* @__PURE__ */ s(
522
- z,
531
+ ) : /* @__PURE__ */ t("div", { className: "flex flex-row gap-ds-04", children: Array.from({ length: j }, (o, d) => /* @__PURE__ */ t(
532
+ Q,
523
533
  {
524
- currentMonth: te(v, a),
525
- rangeStart: p,
526
- rangeEnd: T,
527
- hoverDate: S,
534
+ currentMonth: te(Y, d),
535
+ rangeStart: m,
536
+ rangeEnd: H,
537
+ hoverDate: v,
528
538
  onSelect: I,
529
539
  onHover: $,
530
- onMonthChange: (Y) => {
531
- R(te(Y, -a));
540
+ onMonthChange: (k) => {
541
+ R(te(k, -d));
532
542
  },
533
543
  onHeaderClick: V,
534
- disabledDates: M,
535
- minDate: d,
536
- maxDate: b,
537
- hidePrevNav: a > 0,
538
- hideNextNav: a < L - 1
544
+ disabledDates: P,
545
+ minDate: f,
546
+ maxDate: x,
547
+ hidePrevNav: d > 0,
548
+ hideNextNav: d < j - 1
539
549
  },
540
- a
550
+ d
541
551
  )) }), l = () => {
542
- switch (W) {
552
+ switch (G) {
543
553
  case "years":
544
- return /* @__PURE__ */ s(
545
- ae,
554
+ return /* @__PURE__ */ t(
555
+ le,
546
556
  {
547
- currentYear: v.getFullYear(),
548
- selectedYear: p == null ? void 0 : p.getFullYear(),
549
- onYearSelect: c,
550
- minDate: d,
551
- maxDate: b
557
+ currentYear: Y.getFullYear(),
558
+ selectedYear: m == null ? void 0 : m.getFullYear(),
559
+ onYearSelect: W,
560
+ minDate: f,
561
+ maxDate: x
552
562
  }
553
563
  );
554
564
  case "months":
555
- return /* @__PURE__ */ s(
565
+ return /* @__PURE__ */ t(
556
566
  de,
557
567
  {
558
- currentYear: v.getFullYear(),
559
- selectedMonth: p == null ? void 0 : p.getMonth(),
568
+ currentYear: Y.getFullYear(),
569
+ selectedMonth: m == null ? void 0 : m.getMonth(),
560
570
  onMonthSelect: F,
561
- minDate: d,
562
- maxDate: b
571
+ minDate: f,
572
+ maxDate: x
563
573
  }
564
574
  );
565
575
  default:
566
- return t();
576
+ return s();
567
577
  }
568
- }, r = g && g.length > 0;
569
- return /* @__PURE__ */ x(oe, { open: N, onOpenChange: A, children: [
570
- /* @__PURE__ */ s(ce, { asChild: !0, children: /* @__PURE__ */ x(
578
+ }, r = S && S.length > 0;
579
+ return /* @__PURE__ */ h(ce, { open: N, onOpenChange: A, children: [
580
+ /* @__PURE__ */ t(oe, { asChild: !0, children: /* @__PURE__ */ h(
571
581
  "button",
572
582
  {
573
- ref: D,
583
+ ref: T,
574
584
  type: "button",
575
- className: k(
576
- "inline-flex h-ds-sm-plus items-center gap-ds-03 rounded-ds-lg border border-border bg-layer-01 px-ds-04 text-left transition-colors duration-fast-01 ease-productive-standard",
577
- "hover:border-border-strong",
578
- "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus focus-visible:ring-offset-2",
579
- y
585
+ "aria-label": m && H ? `Change date range, ${c()}` : i,
586
+ ...w,
587
+ className: y(
588
+ "inline-flex h-ds-sm-plus items-center gap-ds-03 rounded-ds-lg border border-surface-border-strong bg-surface-1 px-ds-04 text-left transition-colors duration-fast-01 ease-productive-standard",
589
+ "hover:border-surface-border-strong",
590
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-9 focus-visible:ring-offset-2",
591
+ g
580
592
  ),
581
593
  children: [
582
- /* @__PURE__ */ s(
583
- ge,
594
+ /* @__PURE__ */ t(
595
+ we,
584
596
  {
585
- className: "h-ico-sm w-ico-sm text-text-placeholder",
597
+ className: "h-ico-sm w-ico-sm text-surface-fg-subtle",
586
598
  stroke: 1.5
587
599
  }
588
600
  ),
589
- /* @__PURE__ */ s(
601
+ /* @__PURE__ */ t(
590
602
  "span",
591
603
  {
592
- className: k(
604
+ className: y(
593
605
  "text-ds-md",
594
- p && T ? "text-text-primary" : "text-text-placeholder"
606
+ m && H ? "text-surface-fg" : "text-surface-fg-subtle"
595
607
  ),
596
- children: w()
608
+ children: c()
597
609
  }
598
610
  )
599
611
  ]
600
612
  }
601
613
  ) }),
602
- /* @__PURE__ */ s(
603
- le,
614
+ /* @__PURE__ */ t(
615
+ ae,
604
616
  {
605
- className: "w-auto border-border bg-layer-01 p-ds-04",
617
+ className: "w-auto border-surface-border-strong bg-surface-1 p-ds-04",
606
618
  align: "start",
607
619
  sideOffset: 4,
608
- children: r ? /* @__PURE__ */ x("div", { className: "flex flex-row gap-ds-04", children: [
609
- /* @__PURE__ */ s("div", { className: "min-w-[140px] border-r border-border pr-ds-04", children: /* @__PURE__ */ s(Me, { presets: g, onSelect: B }) }),
610
- /* @__PURE__ */ s("div", { children: l() })
620
+ children: r ? /* @__PURE__ */ h("div", { className: "flex flex-row gap-ds-04", children: [
621
+ /* @__PURE__ */ t("div", { className: "min-w-[140px] border-r border-surface-border-strong pr-ds-04", children: /* @__PURE__ */ t(Ne, { presets: S, onSelect: B }) }),
622
+ /* @__PURE__ */ t("div", { children: l() })
611
623
  ] }) : l()
612
624
  }
613
625
  )
614
626
  ] });
615
627
  }
616
628
  );
617
- je.displayName = "DateRangePicker";
629
+ Le.displayName = "DateRangePicker";
618
630
  function Z(u, e, n) {
619
- const o = [];
620
- for (let f = u; f <= e; f += n)
621
- o.push(f);
622
- return o;
631
+ const a = [];
632
+ for (let i = u; i <= e; i += n)
633
+ a.push(i);
634
+ return a;
623
635
  }
624
- function U(u) {
636
+ function q(u) {
625
637
  return u.toString().padStart(2, "0");
626
638
  }
627
- const Ie = h.forwardRef(
639
+ const Ve = p.forwardRef(
628
640
  function({
629
641
  value: e,
630
642
  onChange: n,
631
- format: o = "12h",
632
- minuteStep: f = 1,
633
- secondStep: y = 1,
634
- showSeconds: m = !1,
635
- placeholder: d = "Pick a time",
636
- className: b,
637
- disabled: M = !1
638
- }, g) {
639
- const [P, D] = h.useState(!1), N = e ? e.getHours() : null, A = e ? e.getMinutes() : null, v = e ? e.getSeconds() : null, R = N !== null ? N >= 12 ? "PM" : "AM" : null, p = N !== null ? N === 0 ? 12 : N > 12 ? N - 12 : N : null, H = o === "12h" ? Z(1, 12, 1) : Z(0, 23, 1), T = Z(0, 59, f), E = Z(0, 59, y), S = (t) => {
643
+ format: a = "12h",
644
+ minuteStep: i = 1,
645
+ secondStep: g = 1,
646
+ showSeconds: b = !1,
647
+ placeholder: f = "Pick a time",
648
+ className: x,
649
+ disabled: P = !1,
650
+ ...S
651
+ }, M) {
652
+ const [w, T] = p.useState(!1), N = e ? e.getHours() : null, A = e ? e.getMinutes() : null, Y = e ? e.getSeconds() : null, R = N !== null ? N >= 12 ? "PM" : "AM" : null, m = N !== null ? N === 0 ? 12 : N > 12 ? N - 12 : N : null, O = a === "12h" ? Z(1, 12, 1) : Z(0, 23, 1), H = Z(0, 59, i), E = Z(0, 59, g), v = (s) => {
640
653
  const l = e ? new Date(e) : /* @__PURE__ */ new Date();
641
- let r = t.hours ?? l.getHours();
642
- const i = t.minutes ?? l.getMinutes(), a = t.seconds ?? l.getSeconds();
643
- o === "12h" && t.hours !== void 0 && ((t.ampm ?? R ?? "AM") === "AM" ? r = t.hours === 12 ? 0 : t.hours : r = t.hours === 12 ? 12 : t.hours + 12);
644
- let Y = K(l, r);
645
- return Y = se(Y, i), Y = xe(Y, a), Y;
646
- }, $ = (t) => {
647
- const l = S({ hours: t });
654
+ let r = s.hours ?? l.getHours();
655
+ const o = s.minutes ?? l.getMinutes(), d = s.seconds ?? l.getSeconds();
656
+ a === "12h" && s.hours !== void 0 && ((s.ampm ?? R ?? "AM") === "AM" ? r = s.hours === 12 ? 0 : s.hours : r = s.hours === 12 ? 12 : s.hours + 12);
657
+ let k = J(l, r);
658
+ return k = se(k, o), k = ye(k, d), k;
659
+ }, $ = (s) => {
660
+ const l = v({ hours: s });
648
661
  n == null || n(l);
649
- }, W = (t) => {
650
- const l = S({ minutes: t });
662
+ }, G = (s) => {
663
+ const l = v({ minutes: s });
651
664
  n == null || n(l);
652
- }, O = (t) => {
653
- const l = S({ seconds: t });
665
+ }, L = (s) => {
666
+ const l = v({ seconds: s });
654
667
  n == null || n(l);
655
- }, L = (t) => {
668
+ }, j = (s) => {
656
669
  if (!e) {
657
- const i = t === "AM" ? 0 : 12;
658
- let a = /* @__PURE__ */ new Date();
659
- a = K(a, i), a = se(a, 0), a = xe(a, 0), n == null || n(a);
670
+ const o = s === "AM" ? 0 : 12;
671
+ let d = /* @__PURE__ */ new Date();
672
+ d = J(d, o), d = se(d, 0), d = ye(d, 0), n == null || n(d);
660
673
  return;
661
674
  }
662
675
  const l = e.getHours();
663
676
  let r;
664
- t === "AM" ? r = l >= 12 ? l - 12 : l : r = l < 12 ? l + 12 : l, n == null || n(K(new Date(e), r));
665
- }, I = h.useMemo(() => e ? o === "12h" ? j(e, m ? "h:mm:ss a" : "h:mm a") : j(e, m ? "HH:mm:ss" : "HH:mm") : null, [e, o, m]), B = o === "12h" ? p : N, V = "flex flex-col gap-ds-01 overflow-y-auto max-h-[200px] px-ds-01", F = "flex h-ds-sm w-full items-center justify-center rounded-ds-md text-ds-md transition-colors duration-fast-01 ease-productive-standard cursor-pointer", c = "bg-interactive text-text-on-color", w = "text-text-primary hover:bg-field";
666
- return /* @__PURE__ */ x(oe, { open: P, onOpenChange: D, children: [
667
- /* @__PURE__ */ s(ce, { asChild: !0, children: /* @__PURE__ */ x(
677
+ s === "AM" ? r = l >= 12 ? l - 12 : l : r = l < 12 ? l + 12 : l, n == null || n(J(new Date(e), r));
678
+ }, I = p.useMemo(() => e ? a === "12h" ? D(e, b ? "h:mm:ss a" : "h:mm a") : D(e, b ? "HH:mm:ss" : "HH:mm") : null, [e, a, b]), B = a === "12h" ? m : N, V = "flex flex-col gap-ds-01 overflow-y-auto max-h-[200px] px-ds-01", F = "flex h-ds-sm w-full items-center justify-center rounded-ds-md text-ds-md transition-colors duration-fast-01 ease-productive-standard cursor-pointer", W = "bg-accent-9 text-accent-fg", c = "text-surface-fg hover:bg-surface-3";
679
+ return /* @__PURE__ */ h(ce, { open: w, onOpenChange: T, children: [
680
+ /* @__PURE__ */ t(oe, { asChild: !0, children: /* @__PURE__ */ h(
668
681
  "button",
669
682
  {
670
- ref: g,
683
+ ref: M,
671
684
  type: "button",
672
- disabled: M,
673
- className: k(
674
- "inline-flex h-ds-sm-plus items-center gap-ds-03 rounded-ds-lg border border-border bg-layer-01 px-ds-04 text-left transition-colors duration-fast-01 ease-productive-standard",
675
- "hover:border-border-strong",
676
- "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus focus-visible:ring-offset-2",
677
- M && "opacity-[0.38] pointer-events-none",
678
- b
685
+ disabled: P,
686
+ ...S,
687
+ className: y(
688
+ "inline-flex h-ds-sm-plus items-center gap-ds-03 rounded-ds-lg border border-surface-border-strong bg-surface-1 px-ds-04 text-left transition-colors duration-fast-01 ease-productive-standard",
689
+ "hover:border-surface-border-strong",
690
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-9 focus-visible:ring-offset-2",
691
+ P && "opacity-action-disabled pointer-events-none",
692
+ x
679
693
  ),
680
- "aria-label": I ? `Selected time: ${I}` : d,
694
+ "aria-label": I ? `Selected time: ${I}` : f,
681
695
  children: [
682
- /* @__PURE__ */ s(
683
- Ae,
696
+ /* @__PURE__ */ t(
697
+ Oe,
684
698
  {
685
- className: "h-ico-sm w-ico-sm text-text-placeholder",
699
+ className: "h-ico-sm w-ico-sm text-surface-fg-subtle",
686
700
  stroke: 1.5
687
701
  }
688
702
  ),
689
- /* @__PURE__ */ s(
703
+ /* @__PURE__ */ t(
690
704
  "span",
691
705
  {
692
- className: k(
706
+ className: y(
693
707
  "text-ds-md",
694
- I ? "text-text-primary" : "text-text-placeholder"
708
+ I ? "text-surface-fg" : "text-surface-fg-subtle"
695
709
  ),
696
- children: I ?? d
710
+ children: I ?? f
697
711
  }
698
712
  )
699
713
  ]
700
714
  }
701
715
  ) }),
702
- /* @__PURE__ */ s(
703
- le,
716
+ /* @__PURE__ */ t(
717
+ ae,
704
718
  {
705
- className: "w-auto border-border bg-layer-01 p-ds-04",
719
+ className: "w-auto border-surface-border-strong bg-surface-1 p-ds-04",
706
720
  align: "start",
707
721
  sideOffset: 4,
708
- children: /* @__PURE__ */ x("div", { className: "flex gap-ds-03", role: "group", "aria-label": "Time picker", children: [
709
- /* @__PURE__ */ x("div", { className: "flex flex-col items-center gap-ds-02", children: [
710
- /* @__PURE__ */ s("span", { className: "text-ds-xs font-semibold uppercase tracking-wider text-text-placeholder", children: "Hr" }),
711
- /* @__PURE__ */ s("div", { className: k(V, "min-w-[48px]"), children: H.map((t) => /* @__PURE__ */ s(
722
+ children: /* @__PURE__ */ h("div", { className: "flex gap-ds-03", role: "group", "aria-label": "Time picker", children: [
723
+ /* @__PURE__ */ h("div", { className: "flex flex-col items-center gap-ds-02", children: [
724
+ /* @__PURE__ */ t("span", { className: "text-ds-xs font-semibold uppercase tracking-wider text-surface-fg-subtle", children: "Hr" }),
725
+ /* @__PURE__ */ t("div", { className: y(V, "min-w-[48px]"), children: O.map((s) => /* @__PURE__ */ t(
712
726
  "button",
713
727
  {
714
728
  type: "button",
715
- onClick: () => $(t),
716
- className: k(
729
+ onClick: () => $(s),
730
+ className: y(
717
731
  F,
718
- B === t ? c : w
732
+ B === s ? W : c
719
733
  ),
720
- "aria-label": `${t} hours`,
721
- "aria-selected": B === t || void 0,
722
- children: o === "24h" ? U(t) : t
734
+ "aria-label": `${s} hours`,
735
+ "aria-selected": B === s || void 0,
736
+ children: a === "24h" ? q(s) : s
723
737
  },
724
- t
738
+ s
725
739
  )) })
726
740
  ] }),
727
- /* @__PURE__ */ x("div", { className: "flex flex-col items-center gap-ds-02", children: [
728
- /* @__PURE__ */ s("span", { className: "text-ds-xs font-semibold uppercase tracking-wider text-text-placeholder", children: "Min" }),
729
- /* @__PURE__ */ s("div", { className: k(V, "min-w-[48px]"), children: T.map((t) => /* @__PURE__ */ s(
741
+ /* @__PURE__ */ h("div", { className: "flex flex-col items-center gap-ds-02", children: [
742
+ /* @__PURE__ */ t("span", { className: "text-ds-xs font-semibold uppercase tracking-wider text-surface-fg-subtle", children: "Min" }),
743
+ /* @__PURE__ */ t("div", { className: y(V, "min-w-[48px]"), children: H.map((s) => /* @__PURE__ */ t(
730
744
  "button",
731
745
  {
732
746
  type: "button",
733
- onClick: () => W(t),
734
- className: k(
747
+ onClick: () => G(s),
748
+ className: y(
735
749
  F,
736
- A === t ? c : w
750
+ A === s ? W : c
737
751
  ),
738
- "aria-label": `${U(t)} minutes`,
739
- "aria-selected": A === t || void 0,
740
- children: U(t)
752
+ "aria-label": `${q(s)} minutes`,
753
+ "aria-selected": A === s || void 0,
754
+ children: q(s)
741
755
  },
742
- t
756
+ s
743
757
  )) })
744
758
  ] }),
745
- m && /* @__PURE__ */ x("div", { className: "flex flex-col items-center gap-ds-02", children: [
746
- /* @__PURE__ */ s("span", { className: "text-ds-xs font-semibold uppercase tracking-wider text-text-placeholder", children: "Sec" }),
747
- /* @__PURE__ */ s("div", { className: k(V, "min-w-[48px]"), children: E.map((t) => /* @__PURE__ */ s(
759
+ b && /* @__PURE__ */ h("div", { className: "flex flex-col items-center gap-ds-02", children: [
760
+ /* @__PURE__ */ t("span", { className: "text-ds-xs font-semibold uppercase tracking-wider text-surface-fg-subtle", children: "Sec" }),
761
+ /* @__PURE__ */ t("div", { className: y(V, "min-w-[48px]"), children: E.map((s) => /* @__PURE__ */ t(
748
762
  "button",
749
763
  {
750
764
  type: "button",
751
- onClick: () => O(t),
752
- className: k(
765
+ onClick: () => L(s),
766
+ className: y(
753
767
  F,
754
- v === t ? c : w
768
+ Y === s ? W : c
755
769
  ),
756
- "aria-label": `${U(t)} seconds`,
757
- "aria-selected": v === t || void 0,
758
- children: U(t)
770
+ "aria-label": `${q(s)} seconds`,
771
+ "aria-selected": Y === s || void 0,
772
+ children: q(s)
759
773
  },
760
- t
774
+ s
761
775
  )) })
762
776
  ] }),
763
- o === "12h" && /* @__PURE__ */ x("div", { className: "flex flex-col items-center gap-ds-02", children: [
764
- /* @__PURE__ */ s("span", { className: "text-ds-xs font-semibold uppercase tracking-wider text-text-placeholder", children: " " }),
765
- /* @__PURE__ */ s("div", { className: "flex flex-col gap-ds-01 px-ds-01", children: ["AM", "PM"].map((t) => /* @__PURE__ */ s(
777
+ a === "12h" && /* @__PURE__ */ h("div", { className: "flex flex-col items-center gap-ds-02", children: [
778
+ /* @__PURE__ */ t("span", { className: "text-ds-xs font-semibold uppercase tracking-wider text-surface-fg-subtle", children: " " }),
779
+ /* @__PURE__ */ t("div", { className: "flex flex-col gap-ds-01 px-ds-01", children: ["AM", "PM"].map((s) => /* @__PURE__ */ t(
766
780
  "button",
767
781
  {
768
782
  type: "button",
769
- onClick: () => L(t),
770
- className: k(
783
+ onClick: () => j(s),
784
+ className: y(
771
785
  F,
772
786
  "min-w-[44px] font-semibold",
773
- R === t ? c : w
787
+ R === s ? W : c
774
788
  ),
775
- "aria-label": t,
776
- "aria-selected": R === t || void 0,
777
- children: t
789
+ "aria-label": s,
790
+ "aria-selected": R === s || void 0,
791
+ children: s
778
792
  },
779
- t
793
+ s
780
794
  )) })
781
795
  ] })
782
796
  ] })
@@ -785,176 +799,178 @@ const Ie = h.forwardRef(
785
799
  ] });
786
800
  }
787
801
  );
788
- Ie.displayName = "TimePicker";
789
- function ye(u) {
802
+ Ve.displayName = "TimePicker";
803
+ function Me(u) {
790
804
  return u.toString().padStart(2, "0");
791
805
  }
792
- function ue(u, e, n) {
793
- const o = [];
794
- for (let f = u; f <= e; f += n)
795
- o.push(f);
796
- return o;
806
+ function fe(u, e, n) {
807
+ const a = [];
808
+ for (let i = u; i <= e; i += n)
809
+ a.push(i);
810
+ return a;
797
811
  }
798
- const Le = h.forwardRef(
812
+ const Fe = p.forwardRef(
799
813
  function({
800
814
  value: e,
801
815
  onChange: n,
802
- minDate: o,
803
- maxDate: f,
804
- disabledDates: y,
805
- timeFormat: m = "12h",
806
- minuteStep: d = 1,
807
- placeholder: b = "Pick date & time",
808
- className: M
809
- }, g) {
810
- const [P, D] = h.useState(!1), [N, A] = h.useState(e ?? /* @__PURE__ */ new Date()), [v, R] = h.useState("days");
811
- h.useEffect(() => {
812
- P || R("days");
813
- }, [P]);
814
- const p = e ? e.getHours() : 0, H = e ? e.getMinutes() : 0, T = p >= 12 ? "PM" : "AM", E = p === 0 ? 12 : p > 12 ? p - 12 : p, S = m === "12h" ? ue(1, 12, 1) : ue(0, 23, 1), $ = ue(0, 59, d), W = m === "12h" ? E : p, O = (r) => {
815
- let i = K(r, e ? e.getHours() : p);
816
- i = se(i, e ? e.getMinutes() : H), n == null || n(i);
817
- }, L = () => {
816
+ minDate: a,
817
+ maxDate: i,
818
+ disabledDates: g,
819
+ timeFormat: b = "12h",
820
+ minuteStep: f = 1,
821
+ placeholder: x = "Pick date & time",
822
+ className: P,
823
+ ...S
824
+ }, M) {
825
+ const [w, T] = p.useState(!1), [N, A] = p.useState(e ?? /* @__PURE__ */ new Date()), [Y, R] = p.useState("days");
826
+ p.useEffect(() => {
827
+ w || R("days");
828
+ }, [w]);
829
+ const m = e ? e.getHours() : 0, O = e ? e.getMinutes() : 0, H = m >= 12 ? "PM" : "AM", E = m === 0 ? 12 : m > 12 ? m - 12 : m, v = b === "12h" ? fe(1, 12, 1) : fe(0, 23, 1), $ = fe(0, 59, f), G = b === "12h" ? E : m, L = (r) => {
830
+ let o = J(r, e ? e.getHours() : m);
831
+ o = se(o, e ? e.getMinutes() : O), n == null || n(o);
832
+ }, j = () => {
818
833
  R((r) => r === "days" ? "months" : "years");
819
834
  }, I = (r) => {
820
- A((i) => re(i, r)), R("days");
835
+ A((o) => re(o, r)), R("days");
821
836
  }, B = (r) => {
822
- A((i) => ne(i, r)), R("months");
837
+ A((o) => ne(o, r)), R("months");
823
838
  }, V = (r) => {
824
- const i = e ? new Date(e) : /* @__PURE__ */ new Date();
825
- let a = r;
826
- m === "12h" && ((e ? T : "AM") === "AM" ? a = r === 12 ? 0 : r : a = r === 12 ? 12 : r + 12);
827
- const Y = K(i, a);
828
- n == null || n(Y);
839
+ const o = e ? new Date(e) : /* @__PURE__ */ new Date();
840
+ let d = r;
841
+ b === "12h" && ((e ? H : "AM") === "AM" ? d = r === 12 ? 0 : r : d = r === 12 ? 12 : r + 12);
842
+ const k = J(o, d);
843
+ n == null || n(k);
829
844
  }, F = (r) => {
830
- const i = e ? new Date(e) : /* @__PURE__ */ new Date(), a = se(i, r);
831
- n == null || n(a);
832
- }, c = (r) => {
833
- const i = e ? new Date(e) : /* @__PURE__ */ new Date(), a = i.getHours();
834
- let Y;
835
- r === "AM" ? Y = a >= 12 ? a - 12 : a : Y = a < 12 ? a + 12 : a, n == null || n(K(i, Y));
836
- }, w = h.useMemo(() => e ? j(e, m === "12h" ? "MMM d, yyyy h:mm a" : "MMM d, yyyy HH:mm") : null, [e, m]), t = () => {
837
- switch (v) {
845
+ const o = e ? new Date(e) : /* @__PURE__ */ new Date(), d = se(o, r);
846
+ n == null || n(d);
847
+ }, W = (r) => {
848
+ const o = e ? new Date(e) : /* @__PURE__ */ new Date(), d = o.getHours();
849
+ let k;
850
+ r === "AM" ? k = d >= 12 ? d - 12 : d : k = d < 12 ? d + 12 : d, n == null || n(J(o, k));
851
+ }, c = p.useMemo(() => e ? D(e, b === "12h" ? "MMM d, yyyy h:mm a" : "MMM d, yyyy HH:mm") : null, [e, b]), s = () => {
852
+ switch (Y) {
838
853
  case "years":
839
- return /* @__PURE__ */ s(
840
- ae,
854
+ return /* @__PURE__ */ t(
855
+ le,
841
856
  {
842
857
  currentYear: N.getFullYear(),
843
858
  selectedYear: e == null ? void 0 : e.getFullYear(),
844
859
  onYearSelect: B,
845
- minDate: o,
846
- maxDate: f
860
+ minDate: a,
861
+ maxDate: i
847
862
  }
848
863
  );
849
864
  case "months":
850
- return /* @__PURE__ */ s(
865
+ return /* @__PURE__ */ t(
851
866
  de,
852
867
  {
853
868
  currentYear: N.getFullYear(),
854
869
  selectedMonth: e == null ? void 0 : e.getMonth(),
855
870
  onMonthSelect: I,
856
- minDate: o,
857
- maxDate: f
871
+ minDate: a,
872
+ maxDate: i
858
873
  }
859
874
  );
860
875
  default:
861
- return /* @__PURE__ */ s(
862
- z,
876
+ return /* @__PURE__ */ t(
877
+ Q,
863
878
  {
864
879
  currentMonth: N,
865
880
  selected: e,
866
- onSelect: O,
881
+ onSelect: L,
867
882
  onMonthChange: A,
868
- onHeaderClick: L,
869
- disabledDates: y,
870
- minDate: o,
871
- maxDate: f
883
+ onHeaderClick: j,
884
+ disabledDates: g,
885
+ minDate: a,
886
+ maxDate: i
872
887
  }
873
888
  );
874
889
  }
875
- }, l = "h-ds-sm rounded-ds-md border border-border bg-layer-01 px-ds-02 text-ds-md text-text-primary transition-colors duration-fast-01 ease-productive-standard hover:border-border-strong focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus cursor-pointer appearance-none";
876
- return /* @__PURE__ */ x(oe, { open: P, onOpenChange: D, children: [
877
- /* @__PURE__ */ s(ce, { asChild: !0, children: /* @__PURE__ */ x(
890
+ }, l = "h-ds-sm rounded-ds-md border border-surface-border-strong bg-surface-1 px-ds-02 text-ds-md text-surface-fg transition-colors duration-fast-01 ease-productive-standard hover:border-surface-border-strong focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-9 cursor-pointer appearance-none";
891
+ return /* @__PURE__ */ h(ce, { open: w, onOpenChange: T, children: [
892
+ /* @__PURE__ */ t(oe, { asChild: !0, children: /* @__PURE__ */ h(
878
893
  "button",
879
894
  {
880
- ref: g,
895
+ ref: M,
881
896
  type: "button",
882
- className: k(
883
- "inline-flex h-ds-sm-plus items-center gap-ds-03 rounded-ds-lg border border-border bg-layer-01 px-ds-04 text-left transition-colors duration-fast-01 ease-productive-standard",
884
- "hover:border-border-strong",
885
- "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus focus-visible:ring-offset-2",
886
- M
897
+ ...S,
898
+ className: y(
899
+ "inline-flex h-ds-sm-plus items-center gap-ds-03 rounded-ds-lg border border-surface-border-strong bg-surface-1 px-ds-04 text-left transition-colors duration-fast-01 ease-productive-standard",
900
+ "hover:border-surface-border-strong",
901
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-9 focus-visible:ring-offset-2",
902
+ P
887
903
  ),
888
- "aria-label": w ? `Selected: ${w}` : b,
904
+ "aria-label": c ? `Selected: ${c}` : x,
889
905
  children: [
890
- /* @__PURE__ */ s(
891
- He,
906
+ /* @__PURE__ */ t(
907
+ De,
892
908
  {
893
- className: "h-ico-sm w-ico-sm text-text-placeholder",
909
+ className: "h-ico-sm w-ico-sm text-surface-fg-subtle",
894
910
  stroke: 1.5
895
911
  }
896
912
  ),
897
- /* @__PURE__ */ s(
913
+ /* @__PURE__ */ t(
898
914
  "span",
899
915
  {
900
- className: k(
916
+ className: y(
901
917
  "text-ds-md",
902
- w ? "text-text-primary" : "text-text-placeholder"
918
+ c ? "text-surface-fg" : "text-surface-fg-subtle"
903
919
  ),
904
- children: w ?? b
920
+ children: c ?? x
905
921
  }
906
922
  )
907
923
  ]
908
924
  }
909
925
  ) }),
910
- /* @__PURE__ */ s(
911
- le,
926
+ /* @__PURE__ */ t(
927
+ ae,
912
928
  {
913
- className: "w-auto border-border bg-layer-01 p-ds-04",
929
+ className: "w-auto border-surface-border-strong bg-surface-1 p-ds-04",
914
930
  align: "start",
915
931
  sideOffset: 4,
916
- children: /* @__PURE__ */ x("div", { className: "flex flex-col gap-ds-04", children: [
917
- t(),
918
- v === "days" && /* @__PURE__ */ x("div", { className: "flex items-center gap-ds-02 border-t border-border pt-ds-04", children: [
919
- /* @__PURE__ */ s("span", { className: "text-ds-xs font-semibold uppercase tracking-wider text-text-placeholder", children: "Time" }),
920
- /* @__PURE__ */ x(
932
+ children: /* @__PURE__ */ h("div", { className: "flex flex-col gap-ds-04", children: [
933
+ s(),
934
+ Y === "days" && /* @__PURE__ */ h("div", { className: "flex items-center gap-ds-02 border-t border-surface-border-strong pt-ds-04", children: [
935
+ /* @__PURE__ */ t("span", { className: "text-ds-xs font-semibold uppercase tracking-wider text-surface-fg-subtle", children: "Time" }),
936
+ /* @__PURE__ */ h(
921
937
  "select",
922
938
  {
923
- value: W ?? "",
939
+ value: G ?? "",
924
940
  onChange: (r) => V(Number(r.target.value)),
925
941
  className: l,
926
942
  "aria-label": "Hour",
927
943
  children: [
928
- !e && /* @__PURE__ */ s("option", { value: "", children: "--" }),
929
- S.map((r) => /* @__PURE__ */ s("option", { value: r, children: m === "24h" ? ye(r) : r }, r))
944
+ !e && /* @__PURE__ */ t("option", { value: "", children: "--" }),
945
+ v.map((r) => /* @__PURE__ */ t("option", { value: r, children: b === "24h" ? Me(r) : r }, r))
930
946
  ]
931
947
  }
932
948
  ),
933
- /* @__PURE__ */ s("span", { className: "text-ds-md font-semibold text-text-placeholder", children: ":" }),
934
- /* @__PURE__ */ x(
949
+ /* @__PURE__ */ t("span", { className: "text-ds-md font-semibold text-surface-fg-subtle", children: ":" }),
950
+ /* @__PURE__ */ h(
935
951
  "select",
936
952
  {
937
- value: e ? H : "",
953
+ value: e ? O : "",
938
954
  onChange: (r) => F(Number(r.target.value)),
939
955
  className: l,
940
956
  "aria-label": "Minute",
941
957
  children: [
942
- !e && /* @__PURE__ */ s("option", { value: "", children: "--" }),
943
- $.map((r) => /* @__PURE__ */ s("option", { value: r, children: ye(r) }, r))
958
+ !e && /* @__PURE__ */ t("option", { value: "", children: "--" }),
959
+ $.map((r) => /* @__PURE__ */ t("option", { value: r, children: Me(r) }, r))
944
960
  ]
945
961
  }
946
962
  ),
947
- m === "12h" && /* @__PURE__ */ x(
963
+ b === "12h" && /* @__PURE__ */ h(
948
964
  "select",
949
965
  {
950
- value: e ? T : "",
951
- onChange: (r) => c(r.target.value),
966
+ value: e ? H : "",
967
+ onChange: (r) => W(r.target.value),
952
968
  className: l,
953
969
  "aria-label": "AM or PM",
954
970
  children: [
955
- !e && /* @__PURE__ */ s("option", { value: "", children: "--" }),
956
- /* @__PURE__ */ s("option", { value: "AM", children: "AM" }),
957
- /* @__PURE__ */ s("option", { value: "PM", children: "PM" })
971
+ !e && /* @__PURE__ */ t("option", { value: "", children: "--" }),
972
+ /* @__PURE__ */ t("option", { value: "AM", children: "AM" }),
973
+ /* @__PURE__ */ t("option", { value: "PM", children: "PM" })
958
974
  ]
959
975
  }
960
976
  )
@@ -965,26 +981,26 @@ const Le = h.forwardRef(
965
981
  ] });
966
982
  }
967
983
  );
968
- Le.displayName = "DateTimePicker";
969
- function Je(u) {
970
- const [e, n] = ke(u ?? /* @__PURE__ */ new Date());
984
+ Fe.displayName = "DateTimePicker";
985
+ function Ue(u) {
986
+ const [e, n] = Se(u ?? /* @__PURE__ */ new Date());
971
987
  return {
972
988
  currentMonth: e,
973
989
  setCurrentMonth: n,
974
- goToPreviousMonth: () => n((d) => pe(d, 1)),
975
- goToNextMonth: () => n((d) => te(d, 1)),
976
- goToMonth: (d) => n((b) => re(b, d)),
977
- goToYear: (d) => n((b) => ne(b, d))
990
+ goToPreviousMonth: () => n((f) => be(f, 1)),
991
+ goToNextMonth: () => n((f) => te(f, 1)),
992
+ goToMonth: (f) => n((x) => re(x, f)),
993
+ goToYear: (f) => n((x) => ne(x, f))
978
994
  };
979
995
  }
980
996
  export {
981
- z as C,
982
- Ee as D,
997
+ Q as C,
998
+ je as D,
983
999
  de as M,
984
- Me as P,
985
- Ie as T,
986
- ae as Y,
987
- je as a,
988
- Le as b,
989
- Je as u
1000
+ Ne as P,
1001
+ Ve as T,
1002
+ le as Y,
1003
+ Le as a,
1004
+ Fe as b,
1005
+ Ue as u
990
1006
  };