@devalok/shilp-sutra 0.31.0 → 0.33.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 (278) hide show
  1. package/LICENSE +21 -0
  2. package/dist/_chunks/badge-group.js +123 -172
  3. package/dist/_chunks/date-time-picker.js +851 -0
  4. package/dist/_chunks/document-preview.js +92 -0
  5. package/dist/_chunks/file-preview.js +511 -0
  6. package/dist/_chunks/image-preview.js +90 -0
  7. package/dist/_chunks/mention-suggestion.js +362 -0
  8. package/dist/_chunks/primitives.js +109 -109
  9. package/dist/_chunks/stat-row.js +144 -124
  10. package/dist/_chunks/tiptap.js +11595 -7731
  11. package/dist/_chunks/use-calendar.js +117 -890
  12. package/dist/_chunks/vendor-client.js +1055 -894
  13. package/dist/ai/block-renderer.d.ts +2 -1
  14. package/dist/ai/block-renderer.d.ts.map +1 -1
  15. package/dist/ai/block-renderer.js +30 -29
  16. package/dist/ai/blocks/block-table.d.ts.map +1 -1
  17. package/dist/ai/blocks/confirm.d.ts.map +1 -1
  18. package/dist/ai/blocks/divider.d.ts.map +1 -1
  19. package/dist/ai/blocks/error.d.ts.map +1 -1
  20. package/dist/ai/blocks/info.d.ts.map +1 -1
  21. package/dist/ai/blocks/loading.d.ts.map +1 -1
  22. package/dist/ai/blocks/stat-row.d.ts.map +1 -1
  23. package/dist/ai/blocks/success.d.ts.map +1 -1
  24. package/dist/ai/blocks/text.d.ts.map +1 -1
  25. package/dist/ai/command-bar.d.ts +18 -0
  26. package/dist/ai/command-bar.d.ts.map +1 -1
  27. package/dist/ai/command-bar.js +126 -125
  28. package/dist/ai/conversation.d.ts +13 -1
  29. package/dist/ai/conversation.d.ts.map +1 -1
  30. package/dist/ai/conversation.js +78 -78
  31. package/dist/ai/types.d.ts +0 -1
  32. package/dist/ai/types.d.ts.map +1 -1
  33. package/dist/ai/types.js +0 -1
  34. package/dist/composed/bulk-action-bar.d.ts +6 -4
  35. package/dist/composed/bulk-action-bar.d.ts.map +1 -1
  36. package/dist/composed/bulk-action-bar.js +102 -58
  37. package/dist/composed/command-palette.d.ts +9 -0
  38. package/dist/composed/command-palette.d.ts.map +1 -1
  39. package/dist/composed/command-palette.js +68 -68
  40. package/dist/composed/confirm-dialog.d.ts +1 -1
  41. package/dist/composed/confirm-dialog.d.ts.map +1 -1
  42. package/dist/composed/confirm-dialog.js +10 -10
  43. package/dist/composed/date-picker/date-picker.d.ts +11 -1
  44. package/dist/composed/date-picker/date-picker.d.ts.map +1 -1
  45. package/dist/composed/date-picker/index.js +9 -8
  46. package/dist/composed/date-picker/month-picker.d.ts.map +1 -1
  47. package/dist/composed/date-picker/year-picker.d.ts.map +1 -1
  48. package/dist/composed/deadline-indicator.d.ts +1 -1
  49. package/dist/composed/deadline-indicator.d.ts.map +1 -1
  50. package/dist/composed/deadline-indicator.js +39 -36
  51. package/dist/composed/emoji-picker.d.ts +14 -2
  52. package/dist/composed/emoji-picker.d.ts.map +1 -1
  53. package/dist/composed/emoji-picker.js +66 -55
  54. package/dist/composed/error-boundary.d.ts +21 -1
  55. package/dist/composed/error-boundary.d.ts.map +1 -1
  56. package/dist/composed/error-boundary.js +47 -32
  57. package/dist/composed/extensions/emoji-data.d.ts +35 -0
  58. package/dist/composed/extensions/emoji-data.d.ts.map +1 -0
  59. package/dist/composed/extensions/emoji-node.d.ts +11 -0
  60. package/dist/composed/extensions/emoji-node.d.ts.map +1 -0
  61. package/dist/composed/extensions/emoji-suggestion.d.ts +4 -6
  62. package/dist/composed/extensions/emoji-suggestion.d.ts.map +1 -1
  63. package/dist/composed/extensions/slash-command.d.ts +35 -0
  64. package/dist/composed/extensions/slash-command.d.ts.map +1 -0
  65. package/dist/composed/file-preview/audio-preview.d.ts +7 -0
  66. package/dist/composed/file-preview/audio-preview.d.ts.map +1 -0
  67. package/dist/composed/file-preview/document-preview.d.ts +7 -0
  68. package/dist/composed/file-preview/document-preview.d.ts.map +1 -0
  69. package/dist/composed/file-preview/embed-preview.d.ts +7 -0
  70. package/dist/composed/file-preview/embed-preview.d.ts.map +1 -0
  71. package/dist/composed/file-preview/image-preview.d.ts +7 -0
  72. package/dist/composed/file-preview/image-preview.d.ts.map +1 -0
  73. package/dist/composed/file-preview/shared.d.ts +20 -0
  74. package/dist/composed/file-preview/shared.d.ts.map +1 -0
  75. package/dist/composed/file-preview/video-preview.d.ts +6 -0
  76. package/dist/composed/file-preview/video-preview.d.ts.map +1 -0
  77. package/dist/composed/file-preview.d.ts.map +1 -1
  78. package/dist/composed/file-preview.js +10 -662
  79. package/dist/composed/filter-bar.d.ts +10 -2
  80. package/dist/composed/filter-bar.d.ts.map +1 -1
  81. package/dist/composed/filter-bar.js +42 -43
  82. package/dist/composed/form-section.d.ts +1 -1
  83. package/dist/composed/form-section.d.ts.map +1 -1
  84. package/dist/composed/form-section.js +22 -21
  85. package/dist/composed/index.d.ts +9 -3
  86. package/dist/composed/index.d.ts.map +1 -1
  87. package/dist/composed/index.js +79 -69
  88. package/dist/composed/inline-edit.d.ts +1 -1
  89. package/dist/composed/inline-edit.d.ts.map +1 -1
  90. package/dist/composed/inline-edit.js +33 -32
  91. package/dist/composed/markdown-viewer.d.ts +1 -1
  92. package/dist/composed/markdown-viewer.d.ts.map +1 -1
  93. package/dist/composed/markdown-viewer.js +60 -59
  94. package/dist/composed/master-detail.d.ts +11 -7
  95. package/dist/composed/master-detail.d.ts.map +1 -1
  96. package/dist/composed/master-detail.js +123 -84
  97. package/dist/composed/responsive-overlay.d.ts +8 -0
  98. package/dist/composed/responsive-overlay.d.ts.map +1 -1
  99. package/dist/composed/rich-chat-input/attachment-strip.d.ts +15 -0
  100. package/dist/composed/rich-chat-input/attachment-strip.d.ts.map +1 -0
  101. package/dist/composed/rich-chat-input/audio-player.d.ts +11 -0
  102. package/dist/composed/rich-chat-input/audio-player.d.ts.map +1 -0
  103. package/dist/composed/rich-chat-input/audio-waveform.d.ts +24 -0
  104. package/dist/composed/rich-chat-input/audio-waveform.d.ts.map +1 -0
  105. package/dist/composed/rich-chat-input/chat-toolbar.d.ts +51 -0
  106. package/dist/composed/rich-chat-input/chat-toolbar.d.ts.map +1 -0
  107. package/dist/composed/rich-chat-input/recording-overlay.d.ts +15 -0
  108. package/dist/composed/rich-chat-input/recording-overlay.d.ts.map +1 -0
  109. package/dist/composed/rich-chat-input/reply-banner.d.ts +8 -0
  110. package/dist/composed/rich-chat-input/reply-banner.d.ts.map +1 -0
  111. package/dist/composed/rich-chat-input/schedule-send.d.ts +22 -0
  112. package/dist/composed/rich-chat-input/schedule-send.d.ts.map +1 -0
  113. package/dist/composed/rich-chat-input/use-voice-recorder.d.ts +18 -0
  114. package/dist/composed/rich-chat-input/use-voice-recorder.d.ts.map +1 -0
  115. package/dist/composed/rich-chat-input.d.ts +91 -0
  116. package/dist/composed/rich-chat-input.d.ts.map +1 -0
  117. package/dist/composed/rich-chat-input.js +1861 -0
  118. package/dist/composed/rich-text-editor.d.ts +14 -3
  119. package/dist/composed/rich-text-editor.d.ts.map +1 -1
  120. package/dist/composed/rich-text-editor.js +278 -447
  121. package/dist/composed/schedule-view.d.ts +9 -1
  122. package/dist/composed/schedule-view.d.ts.map +1 -1
  123. package/dist/hooks/index.d.ts +2 -0
  124. package/dist/hooks/index.d.ts.map +1 -1
  125. package/dist/hooks/index.js +8 -4
  126. package/dist/hooks/use-touch-device.d.ts +12 -0
  127. package/dist/hooks/use-touch-device.d.ts.map +1 -0
  128. package/dist/hooks/use-touch-device.js +13 -0
  129. package/dist/hooks/use-viewport-height.d.ts +11 -0
  130. package/dist/hooks/use-viewport-height.d.ts.map +1 -0
  131. package/dist/hooks/use-viewport-height.js +16 -0
  132. package/dist/shell/bottom-navbar.d.ts.map +1 -1
  133. package/dist/shell/bottom-navbar.js +72 -63
  134. package/dist/shell/command-registry.d.ts.map +1 -1
  135. package/dist/shell/notification-center.d.ts.map +1 -1
  136. package/dist/shell/notification-center.js +77 -77
  137. package/dist/shell/top-bar.d.ts +2 -2
  138. package/dist/shell/top-bar.d.ts.map +1 -1
  139. package/dist/shell/top-bar.js +61 -60
  140. package/dist/tailwind/index.cjs +51 -7
  141. package/dist/tailwind/preset.d.ts.map +1 -1
  142. package/dist/tailwind/preset.js +51 -7
  143. package/dist/tokens/primitives.css +3 -1
  144. package/dist/tokens/semantic.css +16 -13
  145. package/dist/ui/autocomplete.d.ts.map +1 -1
  146. package/dist/ui/autocomplete.js +38 -39
  147. package/dist/ui/badge.d.ts +104 -2
  148. package/dist/ui/badge.d.ts.map +1 -1
  149. package/dist/ui/banner.d.ts.map +1 -1
  150. package/dist/ui/banner.js +8 -7
  151. package/dist/ui/button-group.d.ts +27 -37
  152. package/dist/ui/button-group.d.ts.map +1 -1
  153. package/dist/ui/button-group.js +95 -29
  154. package/dist/ui/button.d.ts +2 -2
  155. package/dist/ui/button.d.ts.map +1 -1
  156. package/dist/ui/button.js +118 -134
  157. package/dist/ui/card.js +24 -24
  158. package/dist/ui/charts/area-chart.d.ts +2 -0
  159. package/dist/ui/charts/area-chart.d.ts.map +1 -1
  160. package/dist/ui/charts/bar-chart.d.ts +2 -0
  161. package/dist/ui/charts/bar-chart.d.ts.map +1 -1
  162. package/dist/ui/charts/chart-container.d.ts +2 -0
  163. package/dist/ui/charts/chart-container.d.ts.map +1 -1
  164. package/dist/ui/charts/index.js +583 -577
  165. package/dist/ui/charts/line-chart.d.ts +2 -0
  166. package/dist/ui/charts/line-chart.d.ts.map +1 -1
  167. package/dist/ui/charts/pie-chart.d.ts +2 -0
  168. package/dist/ui/charts/pie-chart.d.ts.map +1 -1
  169. package/dist/ui/charts/radar-chart.d.ts +2 -0
  170. package/dist/ui/charts/radar-chart.d.ts.map +1 -1
  171. package/dist/ui/checkbox.d.ts +2 -0
  172. package/dist/ui/checkbox.d.ts.map +1 -1
  173. package/dist/ui/checkbox.js +36 -27
  174. package/dist/ui/color-input.js +5 -5
  175. package/dist/ui/combobox.d.ts +6 -1
  176. package/dist/ui/combobox.d.ts.map +1 -1
  177. package/dist/ui/combobox.js +1 -1
  178. package/dist/ui/context-menu.js +1 -1
  179. package/dist/ui/data-table-body.d.ts +12 -0
  180. package/dist/ui/data-table-body.d.ts.map +1 -0
  181. package/dist/ui/data-table-body.js +219 -0
  182. package/dist/ui/data-table-bulk-actions.d.ts +19 -0
  183. package/dist/ui/data-table-bulk-actions.d.ts.map +1 -0
  184. package/dist/ui/data-table-bulk-actions.js +61 -0
  185. package/dist/ui/data-table-card.d.ts +9 -0
  186. package/dist/ui/data-table-card.d.ts.map +1 -0
  187. package/dist/ui/data-table-card.js +73 -0
  188. package/dist/ui/data-table-context.d.ts +62 -0
  189. package/dist/ui/data-table-context.d.ts.map +1 -0
  190. package/dist/ui/data-table-context.js +48 -0
  191. package/dist/ui/data-table-header.d.ts +10 -0
  192. package/dist/ui/data-table-header.d.ts.map +1 -0
  193. package/dist/ui/data-table-header.js +141 -0
  194. package/dist/ui/data-table-pagination.d.ts +13 -0
  195. package/dist/ui/data-table-pagination.d.ts.map +1 -0
  196. package/dist/ui/data-table-pagination.js +84 -0
  197. package/dist/ui/data-table.d.ts +11 -9
  198. package/dist/ui/data-table.d.ts.map +1 -1
  199. package/dist/ui/data-table.js +258 -573
  200. package/dist/ui/dialog.d.ts +6 -2
  201. package/dist/ui/dialog.d.ts.map +1 -1
  202. package/dist/ui/dialog.js +84 -82
  203. package/dist/ui/dropdown-menu.js +1 -1
  204. package/dist/ui/hover-card.d.ts +7 -0
  205. package/dist/ui/hover-card.d.ts.map +1 -1
  206. package/dist/ui/hover-card.js +3 -3
  207. package/dist/ui/icon-group.d.ts +2 -4
  208. package/dist/ui/icon-group.d.ts.map +1 -1
  209. package/dist/ui/icon-group.js +22 -23
  210. package/dist/ui/index.d.ts +2 -2
  211. package/dist/ui/index.d.ts.map +1 -1
  212. package/dist/ui/index.js +324 -327
  213. package/dist/ui/label.js +1 -1
  214. package/dist/ui/lib/bottom-sheet.d.ts +16 -0
  215. package/dist/ui/lib/bottom-sheet.d.ts.map +1 -0
  216. package/dist/ui/menubar.d.ts.map +1 -1
  217. package/dist/ui/menubar.js +64 -73
  218. package/dist/ui/navigation-menu.d.ts.map +1 -1
  219. package/dist/ui/navigation-menu.js +40 -44
  220. package/dist/ui/number-input.d.ts.map +1 -1
  221. package/dist/ui/number-input.js +19 -17
  222. package/dist/ui/popover.d.ts.map +1 -1
  223. package/dist/ui/popover.js +107 -32
  224. package/dist/ui/progress-ring.d.ts.map +1 -1
  225. package/dist/ui/progress-ring.js +80 -80
  226. package/dist/ui/progress.js +4 -4
  227. package/dist/ui/radio.d.ts +5 -2
  228. package/dist/ui/radio.d.ts.map +1 -1
  229. package/dist/ui/radio.js +29 -20
  230. package/dist/ui/search-input.d.ts.map +1 -1
  231. package/dist/ui/search-input.js +13 -12
  232. package/dist/ui/segmented-control.d.ts +6 -108
  233. package/dist/ui/segmented-control.d.ts.map +1 -1
  234. package/dist/ui/segmented-control.js +86 -272
  235. package/dist/ui/select.js +5 -5
  236. package/dist/ui/separator.js +5 -5
  237. package/dist/ui/sheet.d.ts +2 -0
  238. package/dist/ui/sheet.d.ts.map +1 -1
  239. package/dist/ui/sheet.js +102 -84
  240. package/dist/ui/sidebar.d.ts.map +1 -1
  241. package/dist/ui/sidebar.js +200 -175
  242. package/dist/ui/slider.js +14 -14
  243. package/dist/ui/split-button.d.ts +45 -0
  244. package/dist/ui/split-button.d.ts.map +1 -0
  245. package/dist/ui/split-button.js +282 -0
  246. package/dist/ui/status-dot.js +8 -8
  247. package/dist/ui/stepper.d.ts.map +1 -1
  248. package/dist/ui/stepper.js +33 -31
  249. package/dist/ui/switch.js +3 -3
  250. package/dist/ui/tabs.js +6 -6
  251. package/dist/ui/toast-types.d.ts +0 -1
  252. package/dist/ui/toast-types.d.ts.map +1 -1
  253. package/dist/ui/toast-types.js +0 -1
  254. package/dist/ui/toast.d.ts.map +1 -1
  255. package/dist/ui/toast.js +156 -150
  256. package/dist/ui/toggle-group.js +1 -1
  257. package/dist/ui/toggle.js +1 -1
  258. package/dist/ui/tooltip.js +3 -3
  259. package/docs/components/composed/emoji-picker.md +9 -0
  260. package/docs/components/composed/rich-chat-input.md +88 -0
  261. package/docs/components/composed/rich-text-editor.md +5 -0
  262. package/docs/components/ui/button-group.md +9 -0
  263. package/docs/components/ui/button.md +4 -0
  264. package/docs/components/ui/data-table-body.md +13 -0
  265. package/docs/components/ui/data-table-bulk-actions.md +13 -0
  266. package/docs/components/ui/data-table-card.md +13 -0
  267. package/docs/components/ui/data-table-context.md +13 -0
  268. package/docs/components/ui/data-table-header.md +13 -0
  269. package/docs/components/ui/data-table-pagination.md +13 -0
  270. package/docs/components/ui/split-button.md +41 -0
  271. package/llms-full.txt +235 -48
  272. package/llms.txt +54 -2
  273. package/package.json +30 -31
  274. package/dist/ui/chip.d.ts +0 -19
  275. package/dist/ui/chip.d.ts.map +0 -1
  276. package/dist/ui/chip.js +0 -14
  277. package/dist/ui/lib/use-ripple.d.ts +0 -14
  278. package/dist/ui/lib/use-ripple.d.ts.map +0 -1
@@ -0,0 +1,851 @@
1
+ "use client";
2
+ import { jsxs as M, jsx as t } from "react/jsx-runtime";
3
+ import * as d from "react";
4
+ import { format as U, setMonth as ae, setYear as oe, endOfDay as B, startOfYear as be, subMonths as me, endOfMonth as ce, startOfMonth as le, startOfDay as _, subDays as ne, addMonths as ie, isBefore as pe, isAfter as xe, setHours as K, setMinutes as q, setSeconds as de } from "date-fns";
5
+ import { IconCalendarEvent as fe, IconClock as Me, IconCalendarClock as ye } from "@tabler/icons-react";
6
+ import { Icon as W } from "../ui/icon.js";
7
+ import { cn as N } from "../ui/lib/utils.js";
8
+ import { Popover as X, PopoverTrigger as Z, PopoverContent as ee } from "../ui/popover.js";
9
+ import { C as Q } from "./use-calendar.js";
10
+ const te = d.forwardRef(
11
+ function({
12
+ currentYear: e,
13
+ selectedYear: f,
14
+ onYearSelect: u,
15
+ minDate: h,
16
+ maxDate: S,
17
+ className: b,
18
+ ...y
19
+ }, C) {
20
+ const w = Math.floor(e / 10) * 10, H = Array.from({ length: 12 }, (i, s) => w + s), [k, R] = d.useState(() => {
21
+ const i = H.indexOf(f ?? e);
22
+ return i >= 0 ? i : 0;
23
+ }), m = d.useRef([]), g = (i) => h != null && i < h.getFullYear() || S != null && i > S.getFullYear(), o = (i) => {
24
+ let s = k;
25
+ switch (i.key) {
26
+ case "ArrowRight":
27
+ s = Math.min(11, k + 1);
28
+ break;
29
+ case "ArrowLeft":
30
+ s = Math.max(0, k - 1);
31
+ break;
32
+ case "ArrowDown":
33
+ s = Math.min(11, k + 3);
34
+ break;
35
+ case "ArrowUp":
36
+ s = Math.max(0, k - 3);
37
+ break;
38
+ case "Home":
39
+ s = 0;
40
+ break;
41
+ case "End":
42
+ s = 11;
43
+ break;
44
+ default:
45
+ return;
46
+ }
47
+ for (i.preventDefault(); s !== k && g(H[s]); )
48
+ if (s += i.key === "ArrowLeft" || i.key === "ArrowUp" ? -1 : 1, s < 0 || s > 11) return;
49
+ R(s), m.current[s]?.focus();
50
+ };
51
+ return /* @__PURE__ */ M("div", { ref: C, ...y, className: N("w-[252px]", b), children: [
52
+ /* @__PURE__ */ M("div", { className: "text-center pb-ds-04 text-ds-md font-semibold text-surface-fg", children: [
53
+ w,
54
+ " – ",
55
+ w + 11
56
+ ] }),
57
+ /* @__PURE__ */ t("div", { role: "grid", "aria-label": "Year picker", tabIndex: -1, onKeyDown: o, children: [0, 1, 2, 3].map((i) => /* @__PURE__ */ t("div", { role: "row", className: "grid grid-cols-3 gap-ds-02 mb-ds-02 last:mb-0", children: H.slice(i * 3, i * 3 + 3).map((s) => {
58
+ const P = H.indexOf(s), x = s === f, A = g(s);
59
+ return /* @__PURE__ */ t(
60
+ "button",
61
+ {
62
+ ref: (v) => {
63
+ m.current[P] = v;
64
+ },
65
+ type: "button",
66
+ role: "gridcell",
67
+ tabIndex: P === k ? 0 : -1,
68
+ disabled: A || !1,
69
+ onClick: () => !A && u(s),
70
+ className: N(
71
+ "h-ds-sm-plus rounded-ds-md text-ds-md transition-colors focus-visible:ring-2 focus-visible:ring-accent-9 focus-visible:ring-offset-2",
72
+ A && "opacity-action-disabled pointer-events-none cursor-not-allowed",
73
+ x && "bg-accent-9 text-accent-fg",
74
+ !x && !A && "hover:bg-surface-raised-hover text-surface-fg"
75
+ ),
76
+ children: s
77
+ },
78
+ s
79
+ );
80
+ }) }, i)) })
81
+ ] });
82
+ }
83
+ );
84
+ te.displayName = "YearPicker";
85
+ const we = [
86
+ "Jan",
87
+ "Feb",
88
+ "Mar",
89
+ "Apr",
90
+ "May",
91
+ "Jun",
92
+ "Jul",
93
+ "Aug",
94
+ "Sep",
95
+ "Oct",
96
+ "Nov",
97
+ "Dec"
98
+ ], se = d.forwardRef(
99
+ function({
100
+ currentYear: e,
101
+ selectedMonth: f,
102
+ onMonthSelect: u,
103
+ minDate: h,
104
+ maxDate: S,
105
+ className: b,
106
+ ...y
107
+ }, C) {
108
+ const [w, H] = d.useState(f ?? 0), k = d.useRef([]), R = (g) => h != null && (e < h.getFullYear() || e === h.getFullYear() && g < h.getMonth()) || S != null && (e > S.getFullYear() || e === S.getFullYear() && g > S.getMonth()), m = (g) => {
109
+ let o = w;
110
+ switch (g.key) {
111
+ case "ArrowRight":
112
+ o = Math.min(11, w + 1);
113
+ break;
114
+ case "ArrowLeft":
115
+ o = Math.max(0, w - 1);
116
+ break;
117
+ case "ArrowDown":
118
+ o = Math.min(11, w + 4);
119
+ break;
120
+ case "ArrowUp":
121
+ o = Math.max(0, w - 4);
122
+ break;
123
+ case "Home":
124
+ o = 0;
125
+ break;
126
+ case "End":
127
+ o = 11;
128
+ break;
129
+ default:
130
+ return;
131
+ }
132
+ for (g.preventDefault(); o !== w && R(o); )
133
+ if (o += g.key === "ArrowLeft" || g.key === "ArrowUp" ? -1 : 1, o < 0 || o > 11) return;
134
+ H(o), k.current[o]?.focus();
135
+ };
136
+ return /* @__PURE__ */ M("div", { ref: C, ...y, className: N("w-[252px]", b), children: [
137
+ /* @__PURE__ */ t("div", { className: "text-center pb-ds-04 text-ds-md font-semibold text-surface-fg", children: e }),
138
+ /* @__PURE__ */ t("div", { role: "grid", "aria-label": "Month picker", tabIndex: -1, onKeyDown: m, children: [0, 1, 2].map((g) => /* @__PURE__ */ t("div", { role: "row", className: "grid grid-cols-4 gap-ds-02 mb-ds-02 last:mb-0", children: we.slice(g * 4, g * 4 + 4).map((o, i) => {
139
+ const s = g * 4 + i, P = s === f, x = R(s);
140
+ return /* @__PURE__ */ t(
141
+ "button",
142
+ {
143
+ ref: (A) => {
144
+ k.current[s] = A;
145
+ },
146
+ type: "button",
147
+ role: "gridcell",
148
+ tabIndex: s === w ? 0 : -1,
149
+ disabled: x || !1,
150
+ onClick: () => !x && u(s),
151
+ className: N(
152
+ "h-ds-sm-plus rounded-ds-md text-ds-md transition-colors focus-visible:ring-2 focus-visible:ring-accent-9 focus-visible:ring-offset-2",
153
+ x && "opacity-action-disabled pointer-events-none cursor-not-allowed",
154
+ P && "bg-accent-9 text-accent-fg",
155
+ !P && !x && "hover:bg-surface-raised-hover text-surface-fg"
156
+ ),
157
+ children: o
158
+ },
159
+ o
160
+ );
161
+ }) }, g)) })
162
+ ] });
163
+ }
164
+ );
165
+ se.displayName = "MonthPicker";
166
+ const ke = d.forwardRef(
167
+ function({
168
+ value: e,
169
+ onChange: f,
170
+ placeholder: u = "Pick a date",
171
+ className: h,
172
+ formatStr: S = "MMM d, yyyy",
173
+ minDate: b,
174
+ maxDate: y,
175
+ disabledDates: C,
176
+ ...Y
177
+ }, w) {
178
+ const [H, k] = d.useState(!1), [R, m] = d.useState(
179
+ e ?? /* @__PURE__ */ new Date()
180
+ ), [g, o] = d.useState("days");
181
+ d.useEffect(() => {
182
+ H || o("days");
183
+ }, [H]);
184
+ const i = (v) => {
185
+ f?.(v), k(!1);
186
+ }, s = () => {
187
+ o((v) => v === "days" ? "months" : "years");
188
+ }, P = (v) => {
189
+ m((T) => ae(T, v)), o("days");
190
+ }, x = (v) => {
191
+ m((T) => oe(T, v)), o("months");
192
+ }, A = () => {
193
+ switch (g) {
194
+ case "years":
195
+ return /* @__PURE__ */ t(
196
+ te,
197
+ {
198
+ currentYear: R.getFullYear(),
199
+ selectedYear: e?.getFullYear(),
200
+ onYearSelect: x,
201
+ minDate: b,
202
+ maxDate: y
203
+ }
204
+ );
205
+ case "months":
206
+ return /* @__PURE__ */ t(
207
+ se,
208
+ {
209
+ currentYear: R.getFullYear(),
210
+ selectedMonth: e?.getMonth(),
211
+ onMonthSelect: P,
212
+ minDate: b,
213
+ maxDate: y
214
+ }
215
+ );
216
+ default:
217
+ return /* @__PURE__ */ t(
218
+ Q,
219
+ {
220
+ currentMonth: R,
221
+ selected: e,
222
+ onSelect: i,
223
+ onMonthChange: m,
224
+ onHeaderClick: s,
225
+ disabledDates: C,
226
+ minDate: b,
227
+ maxDate: y
228
+ }
229
+ );
230
+ }
231
+ };
232
+ return /* @__PURE__ */ M(X, { open: H, onOpenChange: k, children: [
233
+ /* @__PURE__ */ t(Z, { asChild: !0, children: /* @__PURE__ */ M(
234
+ "button",
235
+ {
236
+ ref: w,
237
+ type: "button",
238
+ "aria-label": e ? `Change date, ${U(e, S)}` : u,
239
+ ...Y,
240
+ className: N(
241
+ "inline-flex h-ds-sm-plus items-center gap-ds-03 rounded-ds-lg border border-surface-border-strong bg-surface-overlay px-ds-04 text-left transition-colors duration-fast-01 ease-productive-standard",
242
+ "hover:border-surface-border-strong",
243
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-9 focus-visible:ring-offset-2",
244
+ h
245
+ ),
246
+ children: [
247
+ /* @__PURE__ */ t(W, { icon: fe, size: "sm", stroke: "light", className: "text-surface-fg-subtle" }),
248
+ /* @__PURE__ */ t(
249
+ "span",
250
+ {
251
+ className: N(
252
+ "text-ds-md",
253
+ e ? "text-surface-fg" : "text-surface-fg-subtle"
254
+ ),
255
+ children: e ? U(e, S) : u
256
+ }
257
+ )
258
+ ]
259
+ }
260
+ ) }),
261
+ /* @__PURE__ */ t(
262
+ ee,
263
+ {
264
+ className: "w-auto border-surface-border-strong bg-surface-overlay p-ds-04",
265
+ align: "start",
266
+ sideOffset: 4,
267
+ children: A()
268
+ }
269
+ )
270
+ ] });
271
+ }
272
+ );
273
+ ke.displayName = "DatePicker";
274
+ const Ne = {
275
+ today: {
276
+ label: "Today",
277
+ getRange: () => {
278
+ const l = /* @__PURE__ */ new Date();
279
+ return { start: _(l), end: B(l) };
280
+ }
281
+ },
282
+ yesterday: {
283
+ label: "Yesterday",
284
+ getRange: () => {
285
+ const l = ne(/* @__PURE__ */ new Date(), 1);
286
+ return { start: _(l), end: B(l) };
287
+ }
288
+ },
289
+ last7days: {
290
+ label: "Last 7 days",
291
+ getRange: () => {
292
+ const l = /* @__PURE__ */ new Date();
293
+ return { start: _(ne(l, 6)), end: B(l) };
294
+ }
295
+ },
296
+ last30days: {
297
+ label: "Last 30 days",
298
+ getRange: () => {
299
+ const l = /* @__PURE__ */ new Date();
300
+ return { start: _(ne(l, 29)), end: B(l) };
301
+ }
302
+ },
303
+ thisMonth: {
304
+ label: "This month",
305
+ getRange: () => {
306
+ const l = /* @__PURE__ */ new Date();
307
+ return { start: le(l), end: ce(l) };
308
+ }
309
+ },
310
+ lastMonth: {
311
+ label: "Last month",
312
+ getRange: () => {
313
+ const e = me(/* @__PURE__ */ new Date(), 1);
314
+ return { start: le(e), end: ce(e) };
315
+ }
316
+ },
317
+ thisYear: {
318
+ label: "This year",
319
+ getRange: () => {
320
+ const l = /* @__PURE__ */ new Date();
321
+ return { start: be(l), end: B(l) };
322
+ }
323
+ }
324
+ }, he = d.forwardRef(
325
+ function({ presets: e, onSelect: f, className: u, ...h }, S) {
326
+ return /* @__PURE__ */ t("div", { ref: S, ...h, className: N("flex flex-col gap-ds-01", u), children: e.map((b) => {
327
+ const y = Ne[b];
328
+ return y ? /* @__PURE__ */ t(
329
+ "button",
330
+ {
331
+ type: "button",
332
+ onClick: () => {
333
+ const { start: C, end: Y } = y.getRange();
334
+ f(C, Y);
335
+ },
336
+ className: N(
337
+ "h-ds-sm w-full rounded-ds-md px-ds-03 text-left text-ds-sm",
338
+ "text-surface-fg transition-colors",
339
+ "hover:bg-surface-raised-hover",
340
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-9"
341
+ ),
342
+ children: y.label
343
+ },
344
+ b
345
+ ) : null;
346
+ }) });
347
+ }
348
+ );
349
+ he.displayName = "Presets";
350
+ const Se = d.forwardRef(
351
+ function({
352
+ startDate: e,
353
+ endDate: f,
354
+ onChange: u,
355
+ placeholder: h = "Pick a date range",
356
+ className: S,
357
+ formatStr: b = "MMM d, yyyy",
358
+ minDate: y,
359
+ maxDate: C,
360
+ disabledDates: Y,
361
+ presets: w,
362
+ numberOfMonths: H = 1,
363
+ ...k
364
+ }, R) {
365
+ const [m, g] = d.useState(!1), [o, i] = d.useState(
366
+ e ?? /* @__PURE__ */ new Date()
367
+ ), [s, P] = d.useState(
368
+ e ?? null
369
+ ), [x, A] = d.useState(
370
+ f ?? null
371
+ ), [v, T] = d.useState(null), [j, E] = d.useState("days"), V = Math.max(1, H);
372
+ d.useEffect(() => {
373
+ P(e ?? null), A(f ?? null);
374
+ }, [e, f]), d.useEffect(() => {
375
+ m || E("days");
376
+ }, [m]);
377
+ const L = (c) => {
378
+ if (!s || s && x)
379
+ P(c), A(null);
380
+ else {
381
+ const a = pe(c, s) ? c : s, O = xe(c, s) ? c : s;
382
+ P(a), A(O), u?.({ start: a, end: O }), g(!1);
383
+ }
384
+ }, z = (c, a) => {
385
+ P(c), A(a), u?.({ start: c, end: a }), g(!1);
386
+ }, $ = () => {
387
+ E((c) => c === "days" ? "months" : "years");
388
+ }, I = (c) => {
389
+ i((a) => ae(a, c)), E("days");
390
+ }, F = (c) => {
391
+ i((a) => oe(a, c)), E("months");
392
+ }, D = () => s && x ? `${U(s, b)} - ${U(x, b)}` : h, n = () => V === 1 ? /* @__PURE__ */ t(
393
+ Q,
394
+ {
395
+ currentMonth: o,
396
+ rangeStart: s,
397
+ rangeEnd: x,
398
+ hoverDate: v,
399
+ onSelect: L,
400
+ onHover: T,
401
+ onMonthChange: i,
402
+ onHeaderClick: $,
403
+ disabledDates: Y,
404
+ minDate: y,
405
+ maxDate: C
406
+ }
407
+ ) : /* @__PURE__ */ t("div", { className: "flex flex-row gap-ds-04", children: Array.from({ length: V }, (c, a) => /* @__PURE__ */ t(
408
+ Q,
409
+ {
410
+ currentMonth: ie(o, a),
411
+ rangeStart: s,
412
+ rangeEnd: x,
413
+ hoverDate: v,
414
+ onSelect: L,
415
+ onHover: T,
416
+ onMonthChange: (O) => {
417
+ i(ie(O, -a));
418
+ },
419
+ onHeaderClick: $,
420
+ disabledDates: Y,
421
+ minDate: y,
422
+ maxDate: C,
423
+ hidePrevNav: a > 0,
424
+ hideNextNav: a < V - 1
425
+ },
426
+ a
427
+ )) }), p = () => {
428
+ switch (j) {
429
+ case "years":
430
+ return /* @__PURE__ */ t(
431
+ te,
432
+ {
433
+ currentYear: o.getFullYear(),
434
+ selectedYear: s?.getFullYear(),
435
+ onYearSelect: F,
436
+ minDate: y,
437
+ maxDate: C
438
+ }
439
+ );
440
+ case "months":
441
+ return /* @__PURE__ */ t(
442
+ se,
443
+ {
444
+ currentYear: o.getFullYear(),
445
+ selectedMonth: s?.getMonth(),
446
+ onMonthSelect: I,
447
+ minDate: y,
448
+ maxDate: C
449
+ }
450
+ );
451
+ default:
452
+ return n();
453
+ }
454
+ }, r = w && w.length > 0;
455
+ return /* @__PURE__ */ M(X, { open: m, onOpenChange: g, children: [
456
+ /* @__PURE__ */ t(Z, { asChild: !0, children: /* @__PURE__ */ M(
457
+ "button",
458
+ {
459
+ ref: R,
460
+ type: "button",
461
+ "aria-label": s && x ? `Change date range, ${D()}` : h,
462
+ ...k,
463
+ className: N(
464
+ "inline-flex h-ds-sm-plus items-center gap-ds-03 rounded-ds-lg border border-surface-border-strong bg-surface-overlay px-ds-04 text-left transition-colors duration-fast-01 ease-productive-standard",
465
+ "hover:border-surface-border-strong",
466
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-9 focus-visible:ring-offset-2",
467
+ S
468
+ ),
469
+ children: [
470
+ /* @__PURE__ */ t(W, { icon: fe, size: "sm", stroke: "light", className: "text-surface-fg-subtle" }),
471
+ /* @__PURE__ */ t(
472
+ "span",
473
+ {
474
+ className: N(
475
+ "text-ds-md",
476
+ s && x ? "text-surface-fg" : "text-surface-fg-subtle"
477
+ ),
478
+ children: D()
479
+ }
480
+ )
481
+ ]
482
+ }
483
+ ) }),
484
+ /* @__PURE__ */ t(
485
+ ee,
486
+ {
487
+ className: "w-auto border-surface-border-strong bg-surface-overlay p-ds-04",
488
+ align: "start",
489
+ sideOffset: 4,
490
+ children: r ? /* @__PURE__ */ M("div", { className: "flex flex-row gap-ds-04", children: [
491
+ /* @__PURE__ */ t("div", { className: "min-w-[140px] border-r border-surface-border-strong pr-ds-04", children: /* @__PURE__ */ t(he, { presets: w, onSelect: z }) }),
492
+ /* @__PURE__ */ t("div", { children: p() })
493
+ ] }) : p()
494
+ }
495
+ )
496
+ ] });
497
+ }
498
+ );
499
+ Se.displayName = "DateRangePicker";
500
+ function G(l, e, f) {
501
+ const u = [];
502
+ for (let h = l; h <= e; h += f)
503
+ u.push(h);
504
+ return u;
505
+ }
506
+ function J(l) {
507
+ return l.toString().padStart(2, "0");
508
+ }
509
+ const ve = d.forwardRef(
510
+ function({
511
+ value: e,
512
+ onChange: f,
513
+ format: u = "12h",
514
+ minuteStep: h = 1,
515
+ secondStep: S = 1,
516
+ showSeconds: b = !1,
517
+ placeholder: y = "Pick a time",
518
+ className: C,
519
+ disabled: Y = !1,
520
+ ...w
521
+ }, H) {
522
+ const [k, R] = d.useState(!1), m = e ? e.getHours() : null, g = e ? e.getMinutes() : null, o = e ? e.getSeconds() : null, i = m !== null ? m >= 12 ? "PM" : "AM" : null, s = m !== null ? m === 0 ? 12 : m > 12 ? m - 12 : m : null, P = u === "12h" ? G(1, 12, 1) : G(0, 23, 1), x = G(0, 59, h), A = G(0, 59, S), v = (n) => {
523
+ const p = e ? new Date(e) : /* @__PURE__ */ new Date();
524
+ let r = n.hours ?? p.getHours();
525
+ const c = n.minutes ?? p.getMinutes(), a = n.seconds ?? p.getSeconds();
526
+ u === "12h" && n.hours !== void 0 && ((n.ampm ?? i ?? "AM") === "AM" ? r = n.hours === 12 ? 0 : n.hours : r = n.hours === 12 ? 12 : n.hours + 12);
527
+ let O = K(p, r);
528
+ return O = q(O, c), O = de(O, a), O;
529
+ }, T = (n) => {
530
+ const p = v({ hours: n });
531
+ f?.(p);
532
+ }, j = (n) => {
533
+ const p = v({ minutes: n });
534
+ f?.(p);
535
+ }, E = (n) => {
536
+ const p = v({ seconds: n });
537
+ f?.(p);
538
+ }, V = (n) => {
539
+ if (!e) {
540
+ const c = n === "AM" ? 0 : 12;
541
+ let a = /* @__PURE__ */ new Date();
542
+ a = K(a, c), a = q(a, 0), a = de(a, 0), f?.(a);
543
+ return;
544
+ }
545
+ const p = e.getHours();
546
+ let r;
547
+ n === "AM" ? r = p >= 12 ? p - 12 : p : r = p < 12 ? p + 12 : p, f?.(K(new Date(e), r));
548
+ }, L = d.useMemo(() => e ? u === "12h" ? U(e, b ? "h:mm:ss a" : "h:mm a") : U(e, b ? "HH:mm:ss" : "HH:mm") : null, [e, u, b]), z = u === "12h" ? s : m, $ = "flex flex-col gap-ds-01 overflow-y-auto max-h-[200px] px-ds-01", I = "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", F = "bg-accent-9 text-accent-fg", D = "text-surface-fg hover:bg-surface-raised-hover";
549
+ return /* @__PURE__ */ M(X, { open: k, onOpenChange: R, children: [
550
+ /* @__PURE__ */ t(Z, { asChild: !0, children: /* @__PURE__ */ M(
551
+ "button",
552
+ {
553
+ ref: H,
554
+ type: "button",
555
+ disabled: Y,
556
+ ...w,
557
+ className: N(
558
+ "inline-flex h-ds-sm-plus items-center gap-ds-03 rounded-ds-lg border border-surface-border-strong bg-surface-overlay px-ds-04 text-left transition-colors duration-fast-01 ease-productive-standard",
559
+ "hover:border-surface-border-strong",
560
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-9 focus-visible:ring-offset-2",
561
+ Y && "opacity-action-disabled pointer-events-none",
562
+ C
563
+ ),
564
+ "aria-label": L ? `Selected time: ${L}` : y,
565
+ children: [
566
+ /* @__PURE__ */ t(W, { icon: Me, size: "sm", stroke: "light", className: "text-surface-fg-subtle" }),
567
+ /* @__PURE__ */ t(
568
+ "span",
569
+ {
570
+ className: N(
571
+ "text-ds-md",
572
+ L ? "text-surface-fg" : "text-surface-fg-subtle"
573
+ ),
574
+ children: L ?? y
575
+ }
576
+ )
577
+ ]
578
+ }
579
+ ) }),
580
+ /* @__PURE__ */ t(
581
+ ee,
582
+ {
583
+ className: "w-auto border-surface-border-strong bg-surface-overlay p-ds-04",
584
+ align: "start",
585
+ sideOffset: 4,
586
+ children: /* @__PURE__ */ M("div", { className: "flex gap-ds-03", role: "group", "aria-label": "Time picker", children: [
587
+ /* @__PURE__ */ M("div", { className: "flex flex-col items-center gap-ds-02", children: [
588
+ /* @__PURE__ */ t("span", { className: "text-ds-xs font-semibold uppercase tracking-wider text-surface-fg-subtle", children: "Hr" }),
589
+ /* @__PURE__ */ t("div", { className: N($, "min-w-[48px]"), children: P.map((n) => /* @__PURE__ */ t(
590
+ "button",
591
+ {
592
+ type: "button",
593
+ onClick: () => T(n),
594
+ className: N(
595
+ I,
596
+ z === n ? F : D
597
+ ),
598
+ "aria-label": `${n} hours`,
599
+ "aria-selected": z === n || void 0,
600
+ children: u === "24h" ? J(n) : n
601
+ },
602
+ n
603
+ )) })
604
+ ] }),
605
+ /* @__PURE__ */ M("div", { className: "flex flex-col items-center gap-ds-02", children: [
606
+ /* @__PURE__ */ t("span", { className: "text-ds-xs font-semibold uppercase tracking-wider text-surface-fg-subtle", children: "Min" }),
607
+ /* @__PURE__ */ t("div", { className: N($, "min-w-[48px]"), children: x.map((n) => /* @__PURE__ */ t(
608
+ "button",
609
+ {
610
+ type: "button",
611
+ onClick: () => j(n),
612
+ className: N(
613
+ I,
614
+ g === n ? F : D
615
+ ),
616
+ "aria-label": `${J(n)} minutes`,
617
+ "aria-selected": g === n || void 0,
618
+ children: J(n)
619
+ },
620
+ n
621
+ )) })
622
+ ] }),
623
+ b && /* @__PURE__ */ M("div", { className: "flex flex-col items-center gap-ds-02", children: [
624
+ /* @__PURE__ */ t("span", { className: "text-ds-xs font-semibold uppercase tracking-wider text-surface-fg-subtle", children: "Sec" }),
625
+ /* @__PURE__ */ t("div", { className: N($, "min-w-[48px]"), children: A.map((n) => /* @__PURE__ */ t(
626
+ "button",
627
+ {
628
+ type: "button",
629
+ onClick: () => E(n),
630
+ className: N(
631
+ I,
632
+ o === n ? F : D
633
+ ),
634
+ "aria-label": `${J(n)} seconds`,
635
+ "aria-selected": o === n || void 0,
636
+ children: J(n)
637
+ },
638
+ n
639
+ )) })
640
+ ] }),
641
+ u === "12h" && /* @__PURE__ */ M("div", { className: "flex flex-col items-center gap-ds-02", children: [
642
+ /* @__PURE__ */ t("span", { className: "text-ds-xs font-semibold uppercase tracking-wider text-surface-fg-subtle", children: " " }),
643
+ /* @__PURE__ */ t("div", { className: "flex flex-col gap-ds-01 px-ds-01", children: ["AM", "PM"].map((n) => /* @__PURE__ */ t(
644
+ "button",
645
+ {
646
+ type: "button",
647
+ onClick: () => V(n),
648
+ className: N(
649
+ I,
650
+ "min-w-[44px] font-semibold",
651
+ i === n ? F : D
652
+ ),
653
+ "aria-label": n,
654
+ "aria-selected": i === n || void 0,
655
+ children: n
656
+ },
657
+ n
658
+ )) })
659
+ ] })
660
+ ] })
661
+ }
662
+ )
663
+ ] });
664
+ }
665
+ );
666
+ ve.displayName = "TimePicker";
667
+ function ue(l) {
668
+ return l.toString().padStart(2, "0");
669
+ }
670
+ function re(l, e, f) {
671
+ const u = [];
672
+ for (let h = l; h <= e; h += f)
673
+ u.push(h);
674
+ return u;
675
+ }
676
+ const Ce = d.forwardRef(
677
+ function({
678
+ value: e,
679
+ onChange: f,
680
+ minDate: u,
681
+ maxDate: h,
682
+ disabledDates: S,
683
+ timeFormat: b = "12h",
684
+ minuteStep: y = 1,
685
+ placeholder: C = "Pick date & time",
686
+ className: Y,
687
+ ...w
688
+ }, H) {
689
+ const [k, R] = d.useState(!1), [m, g] = d.useState(e ?? /* @__PURE__ */ new Date()), [o, i] = d.useState("days");
690
+ d.useEffect(() => {
691
+ k || i("days");
692
+ }, [k]);
693
+ const s = e ? e.getHours() : 0, P = e ? e.getMinutes() : 0, x = s >= 12 ? "PM" : "AM", A = s === 0 ? 12 : s > 12 ? s - 12 : s, v = b === "12h" ? re(1, 12, 1) : re(0, 23, 1), T = re(0, 59, y), j = b === "12h" ? A : s, E = (r) => {
694
+ let c = K(r, e ? e.getHours() : s);
695
+ c = q(c, e ? e.getMinutes() : P), f?.(c);
696
+ }, V = () => {
697
+ i((r) => r === "days" ? "months" : "years");
698
+ }, L = (r) => {
699
+ g((c) => ae(c, r)), i("days");
700
+ }, z = (r) => {
701
+ g((c) => oe(c, r)), i("months");
702
+ }, $ = (r) => {
703
+ const c = e ? new Date(e) : /* @__PURE__ */ new Date();
704
+ let a = r;
705
+ b === "12h" && ((e ? x : "AM") === "AM" ? a = r === 12 ? 0 : r : a = r === 12 ? 12 : r + 12);
706
+ const O = K(c, a);
707
+ f?.(O);
708
+ }, I = (r) => {
709
+ const c = e ? new Date(e) : /* @__PURE__ */ new Date(), a = q(c, r);
710
+ f?.(a);
711
+ }, F = (r) => {
712
+ const c = e ? new Date(e) : /* @__PURE__ */ new Date(), a = c.getHours();
713
+ let O;
714
+ r === "AM" ? O = a >= 12 ? a - 12 : a : O = a < 12 ? a + 12 : a, f?.(K(c, O));
715
+ }, D = d.useMemo(() => e ? U(e, b === "12h" ? "MMM d, yyyy h:mm a" : "MMM d, yyyy HH:mm") : null, [e, b]), n = () => {
716
+ switch (o) {
717
+ case "years":
718
+ return /* @__PURE__ */ t(
719
+ te,
720
+ {
721
+ currentYear: m.getFullYear(),
722
+ selectedYear: e?.getFullYear(),
723
+ onYearSelect: z,
724
+ minDate: u,
725
+ maxDate: h
726
+ }
727
+ );
728
+ case "months":
729
+ return /* @__PURE__ */ t(
730
+ se,
731
+ {
732
+ currentYear: m.getFullYear(),
733
+ selectedMonth: e?.getMonth(),
734
+ onMonthSelect: L,
735
+ minDate: u,
736
+ maxDate: h
737
+ }
738
+ );
739
+ default:
740
+ return /* @__PURE__ */ t(
741
+ Q,
742
+ {
743
+ currentMonth: m,
744
+ selected: e,
745
+ onSelect: E,
746
+ onMonthChange: g,
747
+ onHeaderClick: V,
748
+ disabledDates: S,
749
+ minDate: u,
750
+ maxDate: h
751
+ }
752
+ );
753
+ }
754
+ }, p = "h-ds-sm rounded-ds-md border border-surface-border-strong bg-surface-overlay 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";
755
+ return /* @__PURE__ */ M(X, { open: k, onOpenChange: R, children: [
756
+ /* @__PURE__ */ t(Z, { asChild: !0, children: /* @__PURE__ */ M(
757
+ "button",
758
+ {
759
+ ref: H,
760
+ type: "button",
761
+ ...w,
762
+ className: N(
763
+ "inline-flex h-ds-sm-plus items-center gap-ds-03 rounded-ds-lg border border-surface-border-strong bg-surface-overlay px-ds-04 text-left transition-colors duration-fast-01 ease-productive-standard",
764
+ "hover:border-surface-border-strong",
765
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-9 focus-visible:ring-offset-2",
766
+ Y
767
+ ),
768
+ "aria-label": D ? `Selected: ${D}` : C,
769
+ children: [
770
+ /* @__PURE__ */ t(W, { icon: ye, size: "sm", stroke: "light", className: "text-surface-fg-subtle" }),
771
+ /* @__PURE__ */ t(
772
+ "span",
773
+ {
774
+ className: N(
775
+ "text-ds-md",
776
+ D ? "text-surface-fg" : "text-surface-fg-subtle"
777
+ ),
778
+ children: D ?? C
779
+ }
780
+ )
781
+ ]
782
+ }
783
+ ) }),
784
+ /* @__PURE__ */ t(
785
+ ee,
786
+ {
787
+ className: "w-auto border-surface-border-strong bg-surface-overlay p-ds-04",
788
+ align: "start",
789
+ sideOffset: 4,
790
+ children: /* @__PURE__ */ M("div", { className: "flex flex-col gap-ds-04", children: [
791
+ n(),
792
+ o === "days" && /* @__PURE__ */ M("div", { className: "flex items-center gap-ds-02 border-t border-surface-border-strong pt-ds-04", children: [
793
+ /* @__PURE__ */ t("span", { className: "text-ds-xs font-semibold uppercase tracking-wider text-surface-fg-subtle", children: "Time" }),
794
+ /* @__PURE__ */ M(
795
+ "select",
796
+ {
797
+ value: j ?? "",
798
+ onChange: (r) => $(Number(r.target.value)),
799
+ className: p,
800
+ "aria-label": "Hour",
801
+ children: [
802
+ !e && /* @__PURE__ */ t("option", { value: "", children: "--" }),
803
+ v.map((r) => /* @__PURE__ */ t("option", { value: r, children: b === "24h" ? ue(r) : r }, r))
804
+ ]
805
+ }
806
+ ),
807
+ /* @__PURE__ */ t("span", { className: "text-ds-md font-semibold text-surface-fg-subtle", children: ":" }),
808
+ /* @__PURE__ */ M(
809
+ "select",
810
+ {
811
+ value: e ? P : "",
812
+ onChange: (r) => I(Number(r.target.value)),
813
+ className: p,
814
+ "aria-label": "Minute",
815
+ children: [
816
+ !e && /* @__PURE__ */ t("option", { value: "", children: "--" }),
817
+ T.map((r) => /* @__PURE__ */ t("option", { value: r, children: ue(r) }, r))
818
+ ]
819
+ }
820
+ ),
821
+ b === "12h" && /* @__PURE__ */ M(
822
+ "select",
823
+ {
824
+ value: e ? x : "",
825
+ onChange: (r) => F(r.target.value),
826
+ className: p,
827
+ "aria-label": "AM or PM",
828
+ children: [
829
+ !e && /* @__PURE__ */ t("option", { value: "", children: "--" }),
830
+ /* @__PURE__ */ t("option", { value: "AM", children: "AM" }),
831
+ /* @__PURE__ */ t("option", { value: "PM", children: "PM" })
832
+ ]
833
+ }
834
+ )
835
+ ] })
836
+ ] })
837
+ }
838
+ )
839
+ ] });
840
+ }
841
+ );
842
+ Ce.displayName = "DateTimePicker";
843
+ export {
844
+ ke as D,
845
+ se as M,
846
+ he as P,
847
+ ve as T,
848
+ te as Y,
849
+ Se as a,
850
+ Ce as b
851
+ };