@ttt-productions/ui-core 0.11.33 → 0.11.35

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 (238) hide show
  1. package/README.md +1 -1
  2. package/dist/browser/index.d.ts +2 -2
  3. package/dist/browser/index.d.ts.map +1 -1
  4. package/dist/browser/index.js +1 -2
  5. package/dist/browser/index.js.map +1 -1
  6. package/dist/browser/reload-recovery-watch.d.ts +2 -6
  7. package/dist/browser/reload-recovery-watch.d.ts.map +1 -1
  8. package/dist/browser/reload-recovery-watch.js +5 -10
  9. package/dist/browser/reload-recovery-watch.js.map +1 -1
  10. package/dist/index.d.ts +3 -3
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +3 -4
  13. package/dist/index.js.map +1 -1
  14. package/dist/lib/format-numbers.d.ts +0 -6
  15. package/dist/lib/format-numbers.d.ts.map +1 -1
  16. package/dist/lib/format-numbers.js +2 -8
  17. package/dist/lib/format-numbers.js.map +1 -1
  18. package/dist/lib/reload-recovery.d.ts +1 -9
  19. package/dist/lib/reload-recovery.d.ts.map +1 -1
  20. package/dist/lib/reload-recovery.js +14 -24
  21. package/dist/lib/reload-recovery.js.map +1 -1
  22. package/dist/lib/utils.d.ts +0 -3
  23. package/dist/lib/utils.d.ts.map +1 -1
  24. package/dist/lib/utils.js +0 -3
  25. package/dist/lib/utils.js.map +1 -1
  26. package/dist/react/components/accordion.d.ts +2 -2
  27. package/dist/react/components/accordion.d.ts.map +1 -1
  28. package/dist/react/components/accordion.js +8 -8
  29. package/dist/react/components/accordion.js.map +1 -1
  30. package/dist/react/components/action-row.d.ts +2 -9
  31. package/dist/react/components/action-row.d.ts.map +1 -1
  32. package/dist/react/components/action-row.js +7 -11
  33. package/dist/react/components/action-row.js.map +1 -1
  34. package/dist/react/components/alert-dialog.d.ts +2 -2
  35. package/dist/react/components/alert-dialog.d.ts.map +1 -1
  36. package/dist/react/components/alert-dialog.js +15 -15
  37. package/dist/react/components/alert-dialog.js.map +1 -1
  38. package/dist/react/components/alert.d.ts +2 -2
  39. package/dist/react/components/alert.d.ts.map +1 -1
  40. package/dist/react/components/alert.js +12 -12
  41. package/dist/react/components/alert.js.map +1 -1
  42. package/dist/react/components/avatar.d.ts +2 -2
  43. package/dist/react/components/avatar.d.ts.map +1 -1
  44. package/dist/react/components/avatar.js +7 -7
  45. package/dist/react/components/avatar.js.map +1 -1
  46. package/dist/react/components/badge.d.ts +2 -2
  47. package/dist/react/components/badge.d.ts.map +1 -1
  48. package/dist/react/components/badge.js +9 -9
  49. package/dist/react/components/badge.js.map +1 -1
  50. package/dist/react/components/button.d.ts +2 -12
  51. package/dist/react/components/button.d.ts.map +1 -1
  52. package/dist/react/components/button.js +30 -35
  53. package/dist/react/components/button.js.map +1 -1
  54. package/dist/react/components/card.d.ts +1 -1
  55. package/dist/react/components/card.d.ts.map +1 -1
  56. package/dist/react/components/card.js +15 -15
  57. package/dist/react/components/card.js.map +1 -1
  58. package/dist/react/components/checkbox.d.ts +2 -2
  59. package/dist/react/components/checkbox.d.ts.map +1 -1
  60. package/dist/react/components/checkbox.js +6 -6
  61. package/dist/react/components/checkbox.js.map +1 -1
  62. package/dist/react/components/collapsible.d.ts +1 -1
  63. package/dist/react/components/collapsible.d.ts.map +1 -1
  64. package/dist/react/components/collapsible.js +2 -2
  65. package/dist/react/components/collapsible.js.map +1 -1
  66. package/dist/react/components/consequence-dialog.d.ts +1 -48
  67. package/dist/react/components/consequence-dialog.d.ts.map +1 -1
  68. package/dist/react/components/consequence-dialog.js +7 -23
  69. package/dist/react/components/consequence-dialog.js.map +1 -1
  70. package/dist/react/components/date-picker.d.ts +1 -18
  71. package/dist/react/components/date-picker.d.ts.map +1 -1
  72. package/dist/react/components/date-picker.js +102 -98
  73. package/dist/react/components/date-picker.js.map +1 -1
  74. package/dist/react/components/date-time-picker.d.ts +1 -24
  75. package/dist/react/components/date-time-picker.d.ts.map +1 -1
  76. package/dist/react/components/date-time-picker.js +20 -37
  77. package/dist/react/components/date-time-picker.js.map +1 -1
  78. package/dist/react/components/dialog.d.ts +2 -2
  79. package/dist/react/components/dialog.d.ts.map +1 -1
  80. package/dist/react/components/dialog.js +14 -14
  81. package/dist/react/components/dialog.js.map +1 -1
  82. package/dist/react/components/dropdown-menu.d.ts +2 -10
  83. package/dist/react/components/dropdown-menu.d.ts.map +1 -1
  84. package/dist/react/components/dropdown-menu.js +24 -20
  85. package/dist/react/components/dropdown-menu.js.map +1 -1
  86. package/dist/react/components/end-of-list-indicator.d.ts +1 -1
  87. package/dist/react/components/end-of-list-indicator.js +3 -3
  88. package/dist/react/components/end-of-list-indicator.js.map +1 -1
  89. package/dist/react/components/form.d.ts +3 -3
  90. package/dist/react/components/form.d.ts.map +1 -1
  91. package/dist/react/components/form.js +17 -17
  92. package/dist/react/components/form.js.map +1 -1
  93. package/dist/react/components/format-control.d.ts +7 -20
  94. package/dist/react/components/format-control.d.ts.map +1 -1
  95. package/dist/react/components/format-control.js +18 -22
  96. package/dist/react/components/format-control.js.map +1 -1
  97. package/dist/react/components/input.d.ts +10 -27
  98. package/dist/react/components/input.d.ts.map +1 -1
  99. package/dist/react/components/input.js +11 -9
  100. package/dist/react/components/input.js.map +1 -1
  101. package/dist/react/components/label.d.ts +3 -3
  102. package/dist/react/components/label.d.ts.map +1 -1
  103. package/dist/react/components/label.js +6 -6
  104. package/dist/react/components/label.js.map +1 -1
  105. package/dist/react/components/layout/screen-adaptive-view.d.ts +2 -9
  106. package/dist/react/components/layout/screen-adaptive-view.d.ts.map +1 -1
  107. package/dist/react/components/layout/screen-adaptive-view.js +40 -37
  108. package/dist/react/components/layout/screen-adaptive-view.js.map +1 -1
  109. package/dist/react/components/list-pagination.d.ts +1 -31
  110. package/dist/react/components/list-pagination.d.ts.map +1 -1
  111. package/dist/react/components/list-pagination.js +10 -37
  112. package/dist/react/components/list-pagination.js.map +1 -1
  113. package/dist/react/components/menubar.d.ts +2 -2
  114. package/dist/react/components/menubar.d.ts.map +1 -1
  115. package/dist/react/components/menubar.js +17 -17
  116. package/dist/react/components/menubar.js.map +1 -1
  117. package/dist/react/components/opener-focus.d.ts +2 -8
  118. package/dist/react/components/opener-focus.d.ts.map +1 -1
  119. package/dist/react/components/opener-focus.js +4 -10
  120. package/dist/react/components/opener-focus.js.map +1 -1
  121. package/dist/react/components/pending-guard.d.ts +1 -7
  122. package/dist/react/components/pending-guard.d.ts.map +1 -1
  123. package/dist/react/components/pending-guard.js +1 -7
  124. package/dist/react/components/pending-guard.js.map +1 -1
  125. package/dist/react/components/popover.d.ts +2 -2
  126. package/dist/react/components/popover.d.ts.map +1 -1
  127. package/dist/react/components/popover.js +5 -5
  128. package/dist/react/components/popover.js.map +1 -1
  129. package/dist/react/components/progress.d.ts +2 -2
  130. package/dist/react/components/progress.d.ts.map +1 -1
  131. package/dist/react/components/progress.js +5 -5
  132. package/dist/react/components/progress.js.map +1 -1
  133. package/dist/react/components/radio-group.d.ts +2 -2
  134. package/dist/react/components/radio-group.d.ts.map +1 -1
  135. package/dist/react/components/radio-group.js +7 -7
  136. package/dist/react/components/radio-group.js.map +1 -1
  137. package/dist/react/components/relative-time.d.ts +1 -9
  138. package/dist/react/components/relative-time.d.ts.map +1 -1
  139. package/dist/react/components/relative-time.js +8 -11
  140. package/dist/react/components/relative-time.js.map +1 -1
  141. package/dist/react/components/reload-recovery-notice.d.ts +3 -17
  142. package/dist/react/components/reload-recovery-notice.d.ts.map +1 -1
  143. package/dist/react/components/reload-recovery-notice.js +7 -12
  144. package/dist/react/components/reload-recovery-notice.js.map +1 -1
  145. package/dist/react/components/scroll-area.d.ts +2 -2
  146. package/dist/react/components/scroll-area.d.ts.map +1 -1
  147. package/dist/react/components/scroll-area.js +6 -8
  148. package/dist/react/components/scroll-area.js.map +1 -1
  149. package/dist/react/components/scroll-to-top-button.d.ts +6 -30
  150. package/dist/react/components/scroll-to-top-button.d.ts.map +1 -1
  151. package/dist/react/components/scroll-to-top-button.js +9 -9
  152. package/dist/react/components/scroll-to-top-button.js.map +1 -1
  153. package/dist/react/components/search-dropdown.d.ts +0 -53
  154. package/dist/react/components/search-dropdown.d.ts.map +1 -1
  155. package/dist/react/components/search-dropdown.js +10 -39
  156. package/dist/react/components/search-dropdown.js.map +1 -1
  157. package/dist/react/components/select.d.ts +2 -9
  158. package/dist/react/components/select.d.ts.map +1 -1
  159. package/dist/react/components/select.js +19 -21
  160. package/dist/react/components/select.js.map +1 -1
  161. package/dist/react/components/separator.d.ts +2 -2
  162. package/dist/react/components/separator.d.ts.map +1 -1
  163. package/dist/react/components/separator.js +5 -5
  164. package/dist/react/components/separator.js.map +1 -1
  165. package/dist/react/components/sheet.d.ts +3 -3
  166. package/dist/react/components/sheet.d.ts.map +1 -1
  167. package/dist/react/components/sheet.js +21 -21
  168. package/dist/react/components/sheet.js.map +1 -1
  169. package/dist/react/components/show-more-toggle.d.ts +2 -18
  170. package/dist/react/components/show-more-toggle.d.ts.map +1 -1
  171. package/dist/react/components/show-more-toggle.js +6 -11
  172. package/dist/react/components/show-more-toggle.js.map +1 -1
  173. package/dist/react/components/skeleton.d.ts +1 -1
  174. package/dist/react/components/skeleton.d.ts.map +1 -1
  175. package/dist/react/components/skeleton.js +3 -3
  176. package/dist/react/components/skeleton.js.map +1 -1
  177. package/dist/react/components/slider.d.ts +2 -2
  178. package/dist/react/components/slider.d.ts.map +1 -1
  179. package/dist/react/components/slider.js +5 -5
  180. package/dist/react/components/slider.js.map +1 -1
  181. package/dist/react/components/spinner.d.ts +1 -15
  182. package/dist/react/components/spinner.d.ts.map +1 -1
  183. package/dist/react/components/spinner.js +10 -18
  184. package/dist/react/components/spinner.js.map +1 -1
  185. package/dist/react/components/switch.d.ts +2 -9
  186. package/dist/react/components/switch.d.ts.map +1 -1
  187. package/dist/react/components/switch.js +13 -10
  188. package/dist/react/components/switch.js.map +1 -1
  189. package/dist/react/components/table.d.ts +2 -12
  190. package/dist/react/components/table.d.ts.map +1 -1
  191. package/dist/react/components/table.js +24 -30
  192. package/dist/react/components/table.js.map +1 -1
  193. package/dist/react/components/tabs.d.ts +2 -2
  194. package/dist/react/components/tabs.d.ts.map +1 -1
  195. package/dist/react/components/tabs.js +7 -7
  196. package/dist/react/components/tabs.js.map +1 -1
  197. package/dist/react/components/textarea.d.ts +5 -16
  198. package/dist/react/components/textarea.d.ts.map +1 -1
  199. package/dist/react/components/textarea.js +11 -9
  200. package/dist/react/components/textarea.js.map +1 -1
  201. package/dist/react/components/toast.d.ts +4 -8
  202. package/dist/react/components/toast.d.ts.map +1 -1
  203. package/dist/react/components/toast.js +26 -47
  204. package/dist/react/components/toast.js.map +1 -1
  205. package/dist/react/components/toaster.d.ts.map +1 -1
  206. package/dist/react/components/toaster.js +5 -5
  207. package/dist/react/components/toaster.js.map +1 -1
  208. package/dist/react/components/tooltip.d.ts +2 -2
  209. package/dist/react/components/tooltip.d.ts.map +1 -1
  210. package/dist/react/components/tooltip.js +5 -5
  211. package/dist/react/components/tooltip.js.map +1 -1
  212. package/dist/react/hooks/use-async-action.d.ts +1 -21
  213. package/dist/react/hooks/use-async-action.d.ts.map +1 -1
  214. package/dist/react/hooks/use-async-action.js +3 -11
  215. package/dist/react/hooks/use-async-action.js.map +1 -1
  216. package/dist/react/hooks/use-cursor-page.d.ts +1 -63
  217. package/dist/react/hooks/use-cursor-page.d.ts.map +1 -1
  218. package/dist/react/hooks/use-cursor-page.js +3 -39
  219. package/dist/react/hooks/use-cursor-page.js.map +1 -1
  220. package/dist/react/hooks/use-media-query.js +5 -5
  221. package/dist/react/hooks/use-media-query.js.map +1 -1
  222. package/dist/react/hooks/use-paged-list.d.ts +0 -43
  223. package/dist/react/hooks/use-paged-list.d.ts.map +1 -1
  224. package/dist/react/hooks/use-paged-list.js +2 -17
  225. package/dist/react/hooks/use-paged-list.js.map +1 -1
  226. package/dist/react/hooks/use-return-scroll.d.ts +1 -10
  227. package/dist/react/hooks/use-return-scroll.d.ts.map +1 -1
  228. package/dist/react/hooks/use-return-scroll.js +13 -45
  229. package/dist/react/hooks/use-return-scroll.js.map +1 -1
  230. package/dist/react/hooks/use-toast.d.ts +3 -11
  231. package/dist/react/hooks/use-toast.d.ts.map +1 -1
  232. package/dist/react/hooks/use-toast.js +18 -21
  233. package/dist/react/hooks/use-toast.js.map +1 -1
  234. package/dist/react/index.d.ts +74 -74
  235. package/dist/react/index.d.ts.map +1 -1
  236. package/dist/react/index.js +51 -57
  237. package/dist/react/index.js.map +1 -1
  238. package/package.json +8 -6
@@ -1,40 +1,17 @@
1
- import * as React from "react";
1
+ import * as React from 'react';
2
2
  export interface DateTimePickerTime {
3
- /** 0–23 */
4
3
  hours: number;
5
- /** 0–59 */
6
4
  minutes: number;
7
5
  }
8
6
  export interface DateTimePickerProps {
9
- /** The chosen instant (local time). */
10
7
  value?: Date;
11
- /** Called with the new instant — always inside `min`/`max`, seconds and milliseconds zero. */
12
8
  onChange?: (value: Date) => void;
13
- /** The earliest selectable instant. Earlier days and times are unavailable. */
14
9
  min?: Date;
15
- /** The latest selectable instant. Later days and times are unavailable. */
16
10
  max?: Date;
17
- /** Minutes offered are multiples of this (default 1). */
18
11
  minuteStep?: number;
19
- /** Time of day a picked day takes when there is no `value` yet (default 23:59 — end of day). */
20
12
  defaultTime?: DateTimePickerTime;
21
13
  className?: string;
22
14
  }
23
- /**
24
- * Generic date-and-time picker: `DatePicker` for the day, then hour / minute / AM-PM
25
- * columns of buttons for the time of day — never a native time input, so it looks and
26
- * behaves the same everywhere and honours `min` / `max` to the minute.
27
- *
28
- * Every offered day, hour, minute, and period is one the value may take: a day with
29
- * no allowed instant is disabled in the calendar, and an hour, minute, or period
30
- * that would land outside `min` / `max` on the chosen day is disabled. Picking a day
31
- * keeps the chosen time of day (or `defaultTime` when there is no value) and moves it
32
- * to the nearest allowed time on that day; picking an hour or period whose current
33
- * minute is unavailable takes the nearest allowed minute.
34
- *
35
- * Keyboard: each time column is one tab stop with roving focus (ArrowUp / ArrowDown,
36
- * Home / End); Enter or Space picks.
37
- */
38
15
  declare function DateTimePicker({ value, onChange, min, max, minuteStep, defaultTime, className, }: DateTimePickerProps): React.JSX.Element;
39
16
  declare namespace DateTimePicker {
40
17
  var displayName: string;
@@ -1 +1 @@
1
- {"version":3,"file":"date-time-picker.d.ts","sourceRoot":"","sources":["../../../src/react/components/date-time-picker.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,MAAM,WAAW,kBAAkB;IACjC,WAAW;IACX,KAAK,EAAE,MAAM,CAAA;IACb,WAAW;IACX,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,mBAAmB;IAClC,uCAAuC;IACvC,KAAK,CAAC,EAAE,IAAI,CAAA;IACZ,8FAA8F;IAC9F,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,IAAI,KAAK,IAAI,CAAA;IAChC,+EAA+E;IAC/E,GAAG,CAAC,EAAE,IAAI,CAAA;IACV,2EAA2E;IAC3E,GAAG,CAAC,EAAE,IAAI,CAAA;IACV,yDAAyD;IACzD,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,gGAAgG;IAChG,WAAW,CAAC,EAAE,kBAAkB,CAAA;IAChC,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAeD;;;;;;;;;;;;;;GAcG;AACH,iBAAS,cAAc,CAAC,EACtB,KAAK,EACL,QAAQ,EACR,GAAG,EACH,GAAG,EACH,UAAc,EACd,WAAwC,EACxC,SAAS,GACV,EAAE,mBAAmB,qBAmJrB;kBA3JQ,cAAc;;;AAuPvB,OAAO,EAAE,cAAc,EAAE,CAAA"}
1
+ {"version":3,"file":"date-time-picker.d.ts","sourceRoot":"","sources":["../../../src/react/components/date-time-picker.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,mBAAmB;IAClC,KAAK,CAAC,EAAE,IAAI,CAAC;IACb,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,IAAI,KAAK,IAAI,CAAC;IACjC,GAAG,CAAC,EAAE,IAAI,CAAC;IACX,GAAG,CAAC,EAAE,IAAI,CAAC;IACX,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAuBD,iBAAS,cAAc,CAAC,EACtB,KAAK,EACL,QAAQ,EACR,GAAG,EACH,GAAG,EACH,UAAc,EACd,WAAwC,EACxC,SAAS,GACV,EAAE,mBAAmB,qBAmJrB;kBA3JQ,cAAc;;;AAsPvB,OAAO,EAAE,cAAc,EAAE,CAAC"}
@@ -1,39 +1,23 @@
1
- "use client";
1
+ 'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import * as React from "react";
4
- import { DatePicker } from "./date-picker.js";
5
- import { cn } from "../../lib/utils.js";
3
+ import * as React from 'react';
4
+ import { DatePicker } from './date-picker.js';
5
+ import { cn } from '../../lib/utils.js';
6
6
  const MINUTES_PER_DAY = 24 * 60;
7
7
  const HOURS_12 = [12, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
8
- const PERIODS = ["AM", "PM"];
9
- const pad2 = (n) => String(n).padStart(2, "0");
8
+ const PERIODS = ['AM', 'PM'];
9
+ const pad2 = (n) => String(n).padStart(2, '0');
10
10
  const at = (day, minuteOfDay) => new Date(day.getFullYear(), day.getMonth(), day.getDate(), Math.floor(minuteOfDay / 60), minuteOfDay % 60, 0, 0);
11
11
  const minuteOfDayOf = (date) => date.getHours() * 60 + date.getMinutes();
12
- const to24 = (hour12, period) => (hour12 % 12) + (period === "PM" ? 12 : 0);
13
- const periodOf = (hours) => (hours >= 12 ? "PM" : "AM");
12
+ const to24 = (hour12, period) => (hour12 % 12) + (period === 'PM' ? 12 : 0);
13
+ const periodOf = (hours) => (hours >= 12 ? 'PM' : 'AM');
14
14
  const hour12Of = (hours) => (hours % 12 === 0 ? 12 : hours % 12);
15
- /**
16
- * Generic date-and-time picker: `DatePicker` for the day, then hour / minute / AM-PM
17
- * columns of buttons for the time of day — never a native time input, so it looks and
18
- * behaves the same everywhere and honours `min` / `max` to the minute.
19
- *
20
- * Every offered day, hour, minute, and period is one the value may take: a day with
21
- * no allowed instant is disabled in the calendar, and an hour, minute, or period
22
- * that would land outside `min` / `max` on the chosen day is disabled. Picking a day
23
- * keeps the chosen time of day (or `defaultTime` when there is no value) and moves it
24
- * to the nearest allowed time on that day; picking an hour or period whose current
25
- * minute is unavailable takes the nearest allowed minute.
26
- *
27
- * Keyboard: each time column is one tab stop with roving focus (ArrowUp / ArrowDown,
28
- * Home / End); Enter or Space picks.
29
- */
30
15
  function DateTimePicker({ value, onChange, min, max, minuteStep = 1, defaultTime = { hours: 23, minutes: 59 }, className, }) {
31
16
  const step = Math.max(1, Math.min(60, Math.floor(minuteStep)));
32
17
  const minuteOptions = React.useMemo(() => Array.from({ length: Math.ceil(60 / step) }, (_, i) => i * step).filter((m) => m < 60), [step]);
33
18
  const isAllowed = React.useCallback((instant) => (!min || instant >= min) && (!max || instant <= max), [min, max]);
34
19
  const offeredMinutes = React.useMemo(() => new Set(minuteOptions), [minuteOptions]);
35
20
  const isOffered = React.useCallback((minuteOfDay) => offeredMinutes.has(minuteOfDay % 60), [offeredMinutes]);
36
- /** Allowed minutes-of-day on `day`, ascending. */
37
21
  const allowedMinutesOn = React.useCallback((day) => {
38
22
  const out = [];
39
23
  for (let m = 0; m < MINUTES_PER_DAY; m++) {
@@ -58,11 +42,11 @@ function DateTimePicker({ value, onChange, min, max, minuteStep = 1, defaultTime
58
42
  return;
59
43
  onChange?.(at(day, m));
60
44
  };
61
- // A day strictly between the bounds' own days is decided by its first and last offered
62
- // minute; only the bounds' days need the minute-by-minute check.
63
45
  const firstOfferedMinute = minuteOptions[0];
64
46
  const lastOfferedMinute = 23 * 60 + minuteOptions[minuteOptions.length - 1];
65
- const isSameDay = (a, b) => a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();
47
+ const isSameDay = (a, b) => a.getFullYear() === b.getFullYear() &&
48
+ a.getMonth() === b.getMonth() &&
49
+ a.getDate() === b.getDate();
66
50
  const isDayDisabled = (day) => {
67
51
  if ((min && isSameDay(day, min)) || (max && isSameDay(day, max))) {
68
52
  return allowedMinutesOn(day).length === 0;
@@ -87,7 +71,7 @@ function DateTimePicker({ value, onChange, min, max, minuteStep = 1, defaultTime
87
71
  const hourEnabled = (hours) => minuteOptions.some((m) => allowedSet.has(hours * 60 + m));
88
72
  const minuteEnabled = (minutes) => currentHours !== null && allowedSet.has(currentHours * 60 + minutes);
89
73
  const periodEnabled = (period) => {
90
- const base = period === "PM" ? 12 : 0;
74
+ const base = period === 'PM' ? 12 : 0;
91
75
  for (let h = base; h < base + 12; h++)
92
76
  if (hourEnabled(h))
93
77
  return true;
@@ -115,7 +99,7 @@ function DateTimePicker({ value, onChange, min, max, minuteStep = 1, defaultTime
115
99
  commit(value, hours * 60 + currentMinutes);
116
100
  };
117
101
  const timeDisabled = !value;
118
- return (_jsxs("div", { className: cn("flex flex-col gap-3 sm:flex-row sm:items-start", className), children: [_jsx(DatePicker, { selected: value, onSelect: handleDayPick, disabled: isDayDisabled }), _jsxs("div", { className: "flex gap-2 p-4 bg-card rounded-lg", role: "group", "aria-label": "Time", "aria-disabled": timeDisabled || undefined, children: [_jsx(TimeColumn, { label: "Hour", options: HOURS_12.map((h) => ({
102
+ return (_jsxs("div", { className: cn('flex flex-col gap-3 sm:flex-row sm:items-start', className), children: [_jsx(DatePicker, { selected: value, onSelect: handleDayPick, disabled: isDayDisabled }), _jsxs("div", { className: "flex gap-2 p-4 bg-card rounded-lg", role: "group", "aria-label": "Time", "aria-disabled": timeDisabled || undefined, children: [_jsx(TimeColumn, { label: "Hour", options: HOURS_12.map((h) => ({
119
103
  key: h,
120
104
  text: String(h),
121
105
  ariaLabel: `${h} o'clock`,
@@ -138,7 +122,7 @@ function DateTimePicker({ value, onChange, min, max, minuteStep = 1, defaultTime
138
122
  onPick: () => pickPeriod(p),
139
123
  })) })] })] }));
140
124
  }
141
- DateTimePicker.displayName = "DateTimePicker";
125
+ DateTimePicker.displayName = 'DateTimePicker';
142
126
  function TimeColumn({ label, options }) {
143
127
  const listRef = React.useRef(null);
144
128
  const selectedIndex = options.findIndex((o) => o.selected && !o.disabled);
@@ -149,12 +133,11 @@ function TimeColumn({ label, options }) {
149
133
  : selectedIndex >= 0
150
134
  ? selectedIndex
151
135
  : firstEnabled;
152
- // Keep the chosen option in view inside the fixed-height column.
153
136
  React.useLayoutEffect(() => {
154
137
  if (selectedIndex < 0)
155
138
  return;
156
139
  const el = listRef.current?.querySelector(`[data-index="${selectedIndex}"]`);
157
- el?.scrollIntoView?.({ block: "nearest" });
140
+ el?.scrollIntoView?.({ block: 'nearest' });
158
141
  }, [selectedIndex]);
159
142
  const focusAt = (index) => {
160
143
  setFocusIndex(index);
@@ -166,13 +149,13 @@ function TimeColumn({ label, options }) {
166
149
  return;
167
150
  const pos = enabled.indexOf(rovingIndex);
168
151
  let next;
169
- if (e.key === "ArrowDown")
152
+ if (e.key === 'ArrowDown')
170
153
  next = enabled[Math.min(enabled.length - 1, pos + 1)];
171
- else if (e.key === "ArrowUp")
154
+ else if (e.key === 'ArrowUp')
172
155
  next = enabled[Math.max(0, pos - 1)];
173
- else if (e.key === "Home")
156
+ else if (e.key === 'Home')
174
157
  next = enabled[0];
175
- else if (e.key === "End")
158
+ else if (e.key === 'End')
176
159
  next = enabled[enabled.length - 1];
177
160
  if (next === undefined)
178
161
  return;
@@ -182,7 +165,7 @@ function TimeColumn({ label, options }) {
182
165
  return (_jsxs("div", { className: "flex flex-col items-center gap-1", children: [_jsx("div", { className: "text-xs font-semibold text-muted-foreground", "aria-hidden": "true", children: label }), _jsx("div", { ref: listRef, role: "group", "aria-label": label, onKeyDown: handleKeyDown, className: "flex h-64 w-14 flex-col gap-1 overflow-y-auto", children: options.map((o, i) => (_jsx("button", { type: "button", "data-index": i, tabIndex: i === rovingIndex ? 0 : -1, disabled: o.disabled, "aria-pressed": o.selected, "aria-label": o.ariaLabel, onClick: () => {
183
166
  setFocusIndex(i);
184
167
  o.onPick();
185
- }, className: cn("h-9 shrink-0 rounded-lg text-sm font-semibold flex items-center justify-center", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background", !o.disabled && !o.selected && "text-foreground hover:bg-primary/10", o.selected && "bg-primary text-primary-foreground font-bold", o.disabled && "opacity-30 cursor-not-allowed"), children: o.text }, o.key))) })] }));
168
+ }, className: cn('h-9 shrink-0 rounded-lg text-sm font-semibold flex items-center justify-center', 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background', !o.disabled && !o.selected && 'text-foreground hover:bg-primary/10', o.selected && 'bg-primary text-primary-foreground font-bold', o.disabled && 'opacity-30 cursor-not-allowed'), children: o.text }, o.key))) })] }));
186
169
  }
187
170
  export { DateTimePicker };
188
171
  //# sourceMappingURL=date-time-picker.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"date-time-picker.js","sourceRoot":"","sources":["../../../src/react/components/date-time-picker.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAA;AAyBvC,MAAM,eAAe,GAAG,EAAE,GAAG,EAAE,CAAA;AAC/B,MAAM,QAAQ,GAAG,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,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"react\"\nimport { DatePicker } from \"./date-picker.js\"\nimport { cn } from \"../../lib/utils.js\"\n\nexport interface DateTimePickerTime {\n /** 0–23 */\n hours: number\n /** 0–59 */\n minutes: number\n}\n\nexport interface DateTimePickerProps {\n /** The chosen instant (local time). */\n value?: Date\n /** Called with the new instant — always inside `min`/`max`, seconds and milliseconds zero. */\n onChange?: (value: Date) => void\n /** The earliest selectable instant. Earlier days and times are unavailable. */\n min?: Date\n /** The latest selectable instant. Later days and times are unavailable. */\n max?: Date\n /** Minutes offered are multiples of this (default 1). */\n minuteStep?: number\n /** Time of day a picked day takes when there is no `value` yet (default 23:59 — end of day). */\n defaultTime?: DateTimePickerTime\n className?: string\n}\n\nconst MINUTES_PER_DAY = 24 * 60\nconst HOURS_12 = [12, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]\nconst PERIODS = [\"AM\", \"PM\"] as const\ntype Period = (typeof PERIODS)[number]\n\nconst pad2 = (n: number) => String(n).padStart(2, \"0\")\nconst at = (day: Date, minuteOfDay: number) =>\n new Date(day.getFullYear(), day.getMonth(), day.getDate(), Math.floor(minuteOfDay / 60), minuteOfDay % 60, 0, 0)\nconst minuteOfDayOf = (date: Date) => date.getHours() * 60 + date.getMinutes()\nconst to24 = (hour12: number, period: Period) => (hour12 % 12) + (period === \"PM\" ? 12 : 0)\nconst periodOf = (hours: number): Period => (hours >= 12 ? \"PM\" : \"AM\")\nconst hour12Of = (hours: number) => (hours % 12 === 0 ? 12 : hours % 12)\n\n/**\n * Generic date-and-time picker: `DatePicker` for the day, then hour / minute / AM-PM\n * columns of buttons for the time of day — never a native time input, so it looks and\n * behaves the same everywhere and honours `min` / `max` to the minute.\n *\n * Every offered day, hour, minute, and period is one the value may take: a day with\n * no allowed instant is disabled in the calendar, and an hour, minute, or period\n * that would land outside `min` / `max` on the chosen day is disabled. Picking a day\n * keeps the chosen time of day (or `defaultTime` when there is no value) and moves it\n * to the nearest allowed time on that day; picking an hour or period whose current\n * minute is unavailable takes the nearest allowed minute.\n *\n * Keyboard: each time column is one tab stop with roving focus (ArrowUp / ArrowDown,\n * Home / End); Enter or Space picks.\n */\nfunction DateTimePicker({\n value,\n onChange,\n min,\n max,\n minuteStep = 1,\n defaultTime = { hours: 23, minutes: 59 },\n className,\n}: DateTimePickerProps) {\n const step = Math.max(1, Math.min(60, Math.floor(minuteStep)))\n const minuteOptions = React.useMemo(\n () => Array.from({ length: Math.ceil(60 / step) }, (_, i) => i * step).filter((m) => m < 60),\n [step],\n )\n\n const isAllowed = React.useCallback(\n (instant: Date) => (!min || instant >= min) && (!max || instant <= max),\n [min, max],\n )\n const offeredMinutes = React.useMemo(() => new Set(minuteOptions), [minuteOptions])\n const isOffered = React.useCallback(\n (minuteOfDay: number) => offeredMinutes.has(minuteOfDay % 60),\n [offeredMinutes],\n )\n\n /** Allowed minutes-of-day on `day`, ascending. */\n const allowedMinutesOn = React.useCallback(\n (day: Date) => {\n const out: number[] = []\n for (let m = 0; m < MINUTES_PER_DAY; m++) {\n if (isOffered(m) && isAllowed(at(day, m))) out.push(m)\n }\n return out\n },\n [isAllowed, isOffered],\n )\n\n const nearestAllowed = (day: Date, wanted: number): number | null => {\n const allowed = allowedMinutesOn(day)\n if (allowed.length === 0) return null\n let best = allowed[0]\n for (const m of allowed) if (Math.abs(m - wanted) < Math.abs(best - wanted)) best = m\n return best\n }\n\n const commit = (day: Date, wanted: number) => {\n const m = nearestAllowed(day, wanted)\n if (m === null) return\n onChange?.(at(day, m))\n }\n\n // A day strictly between the bounds' own days is decided by its first and last offered\n // minute; only the bounds' days need the minute-by-minute check.\n const firstOfferedMinute = minuteOptions[0]\n const lastOfferedMinute = 23 * 60 + minuteOptions[minuteOptions.length - 1]\n const isSameDay = (a: Date, b: Date) =>\n a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate()\n const isDayDisabled = (day: Date) => {\n if ((min && isSameDay(day, min)) || (max && isSameDay(day, max))) {\n return allowedMinutesOn(day).length === 0\n }\n if (min && at(day, lastOfferedMinute) < min) return true\n if (max && at(day, firstOfferedMinute) > max) return true\n return false\n }\n\n const handleDayPick = (day: Date | undefined) => {\n if (!day) return\n const wanted = value ? minuteOfDayOf(value) : defaultTime.hours * 60 + defaultTime.minutes\n commit(day, wanted)\n }\n\n const current = value ? minuteOfDayOf(value) : null\n const currentHours = current === null ? null : Math.floor(current / 60)\n const currentMinutes = current === null ? null : current % 60\n const currentPeriod = currentHours === null ? null : periodOf(currentHours)\n\n const allowedSet = React.useMemo(\n () => new Set(value ? allowedMinutesOn(value) : []),\n [value, allowedMinutesOn],\n )\n const hourEnabled = (hours: number) => minuteOptions.some((m) => allowedSet.has(hours * 60 + m))\n const minuteEnabled = (minutes: number) =>\n currentHours !== null && allowedSet.has(currentHours * 60 + minutes)\n const periodEnabled = (period: Period) => {\n const base = period === \"PM\" ? 12 : 0\n for (let h = base; h < base + 12; h++) if (hourEnabled(h)) return true\n return false\n }\n\n const pickHour = (hour12: number) => {\n if (!value || currentPeriod === null || currentMinutes === null) return\n const hours = to24(hour12, currentPeriod)\n const firstInHour = minuteOptions.find((m) => allowedSet.has(hours * 60 + m))\n if (firstInHour === undefined) return\n const minutes = allowedSet.has(hours * 60 + currentMinutes) ? currentMinutes : firstInHour\n commit(value, hours * 60 + minutes)\n }\n const pickMinute = (minutes: number) => {\n if (!value || currentHours === null) return\n commit(value, currentHours * 60 + minutes)\n }\n const pickPeriod = (period: Period) => {\n if (!value || currentHours === null || currentMinutes === null) return\n const hours = to24(hour12Of(currentHours), period)\n commit(value, hours * 60 + currentMinutes)\n }\n\n const timeDisabled = !value\n\n return (\n <div className={cn(\"flex flex-col gap-3 sm:flex-row sm:items-start\", className)}>\n <DatePicker selected={value} onSelect={handleDayPick} disabled={isDayDisabled} />\n <div\n className=\"flex gap-2 p-4 bg-card rounded-lg\"\n role=\"group\"\n aria-label=\"Time\"\n aria-disabled={timeDisabled || undefined}\n >\n <TimeColumn\n label=\"Hour\"\n options={HOURS_12.map((h) => ({\n key: h,\n text: String(h),\n ariaLabel: `${h} o'clock`,\n selected: currentHours !== null && hour12Of(currentHours) === h,\n disabled: timeDisabled || currentPeriod === null || !hourEnabled(to24(h, currentPeriod)),\n onPick: () => pickHour(h),\n }))}\n />\n <TimeColumn\n label=\"Minute\"\n options={minuteOptions.map((m) => ({\n key: m,\n text: pad2(m),\n ariaLabel: `${pad2(m)} minutes`,\n selected: currentMinutes === m,\n disabled: timeDisabled || !minuteEnabled(m),\n onPick: () => pickMinute(m),\n }))}\n />\n <TimeColumn\n label=\"AM or PM\"\n options={PERIODS.map((p) => ({\n key: p,\n text: p,\n ariaLabel: p,\n selected: currentPeriod === p,\n disabled: timeDisabled || !periodEnabled(p),\n onPick: () => pickPeriod(p),\n }))}\n />\n </div>\n </div>\n )\n}\n\nDateTimePicker.displayName = \"DateTimePicker\"\n\ninterface TimeOption {\n key: string | number\n text: string\n ariaLabel: string\n selected: boolean\n disabled: boolean\n onPick: () => void\n}\n\nfunction TimeColumn({ label, options }: { label: string; options: TimeOption[] }) {\n const listRef = React.useRef<HTMLDivElement | null>(null)\n const selectedIndex = options.findIndex((o) => o.selected && !o.disabled)\n const firstEnabled = options.findIndex((o) => !o.disabled)\n const [focusIndex, setFocusIndex] = React.useState<number | null>(null)\n const rovingIndex =\n focusIndex !== null && options[focusIndex] && !options[focusIndex].disabled\n ? focusIndex\n : selectedIndex >= 0\n ? selectedIndex\n : firstEnabled\n\n // Keep the chosen option in view inside the fixed-height column.\n React.useLayoutEffect(() => {\n if (selectedIndex < 0) return\n const el = listRef.current?.querySelector<HTMLButtonElement>(`[data-index=\"${selectedIndex}\"]`)\n el?.scrollIntoView?.({ block: \"nearest\" })\n }, [selectedIndex])\n\n const focusAt = (index: number) => {\n setFocusIndex(index)\n listRef.current?.querySelector<HTMLButtonElement>(`[data-index=\"${index}\"]`)?.focus()\n }\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLDivElement>) => {\n const enabled = options.map((o, i) => (o.disabled ? -1 : i)).filter((i) => i >= 0)\n if (enabled.length === 0 || rovingIndex < 0) return\n const pos = enabled.indexOf(rovingIndex)\n let next: number | undefined\n if (e.key === \"ArrowDown\") next = enabled[Math.min(enabled.length - 1, pos + 1)]\n else if (e.key === \"ArrowUp\") next = enabled[Math.max(0, pos - 1)]\n else if (e.key === \"Home\") next = enabled[0]\n else if (e.key === \"End\") next = enabled[enabled.length - 1]\n if (next === undefined) return\n e.preventDefault()\n focusAt(next)\n }\n\n return (\n <div className=\"flex flex-col items-center gap-1\">\n <div className=\"text-xs font-semibold text-muted-foreground\" aria-hidden=\"true\">\n {label}\n </div>\n <div\n ref={listRef}\n role=\"group\"\n aria-label={label}\n onKeyDown={handleKeyDown}\n className=\"flex h-64 w-14 flex-col gap-1 overflow-y-auto\"\n >\n {options.map((o, i) => (\n <button\n key={o.key}\n type=\"button\"\n data-index={i}\n tabIndex={i === rovingIndex ? 0 : -1}\n disabled={o.disabled}\n aria-pressed={o.selected}\n aria-label={o.ariaLabel}\n onClick={() => {\n setFocusIndex(i)\n o.onPick()\n }}\n className={cn(\n \"h-9 shrink-0 rounded-lg text-sm font-semibold flex items-center justify-center\",\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background\",\n !o.disabled && !o.selected && \"text-foreground hover:bg-primary/10\",\n o.selected && \"bg-primary text-primary-foreground font-bold\",\n o.disabled && \"opacity-30 cursor-not-allowed\",\n )}\n >\n {o.text}\n </button>\n ))}\n </div>\n </div>\n )\n}\n\nexport { DateTimePicker }\n"]}
1
+ {"version":3,"file":"date-time-picker.js","sourceRoot":"","sources":["../../../src/react/components/date-time-picker.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAiBxC,MAA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AI,IAnBF,CAAC,CAAC,GAAG,CAoBH,CACV,CAAC,GACE,IACF,CACP,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,cAAc,EAAE,CAAC","sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { DatePicker } from './date-picker.js';\nimport { cn } from '../../lib/utils.js';\n\nexport interface DateTimePickerTime {\n hours: number;\n minutes: number;\n}\n\nexport interface DateTimePickerProps {\n value?: Date;\n onChange?: (value: Date) => void;\n min?: Date;\n max?: Date;\n minuteStep?: number;\n defaultTime?: DateTimePickerTime;\n className?: string;\n}\n\nconst MINUTES_PER_DAY = 24 * 60;\nconst HOURS_12 = [12, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];\nconst PERIODS = ['AM', 'PM'] as const;\ntype Period = (typeof PERIODS)[number];\n\nconst pad2 = (n: number) => String(n).padStart(2, '0');\nconst at = (day: Date, minuteOfDay: number) =>\n new Date(\n day.getFullYear(),\n day.getMonth(),\n day.getDate(),\n Math.floor(minuteOfDay / 60),\n minuteOfDay % 60,\n 0,\n 0,\n );\nconst minuteOfDayOf = (date: Date) => date.getHours() * 60 + date.getMinutes();\nconst to24 = (hour12: number, period: Period) => (hour12 % 12) + (period === 'PM' ? 12 : 0);\nconst periodOf = (hours: number): Period => (hours >= 12 ? 'PM' : 'AM');\nconst hour12Of = (hours: number) => (hours % 12 === 0 ? 12 : hours % 12);\n\nfunction DateTimePicker({\n value,\n onChange,\n min,\n max,\n minuteStep = 1,\n defaultTime = { hours: 23, minutes: 59 },\n className,\n}: DateTimePickerProps) {\n const step = Math.max(1, Math.min(60, Math.floor(minuteStep)));\n const minuteOptions = React.useMemo(\n () => Array.from({ length: Math.ceil(60 / step) }, (_, i) => i * step).filter((m) => m < 60),\n [step],\n );\n\n const isAllowed = React.useCallback(\n (instant: Date) => (!min || instant >= min) && (!max || instant <= max),\n [min, max],\n );\n const offeredMinutes = React.useMemo(() => new Set(minuteOptions), [minuteOptions]);\n const isOffered = React.useCallback(\n (minuteOfDay: number) => offeredMinutes.has(minuteOfDay % 60),\n [offeredMinutes],\n );\n\n const allowedMinutesOn = React.useCallback(\n (day: Date) => {\n const out: number[] = [];\n for (let m = 0; m < MINUTES_PER_DAY; m++) {\n if (isOffered(m) && isAllowed(at(day, m))) out.push(m);\n }\n return out;\n },\n [isAllowed, isOffered],\n );\n\n const nearestAllowed = (day: Date, wanted: number): number | null => {\n const allowed = allowedMinutesOn(day);\n if (allowed.length === 0) return null;\n let best = allowed[0];\n for (const m of allowed) if (Math.abs(m - wanted) < Math.abs(best - wanted)) best = m;\n return best;\n };\n\n const commit = (day: Date, wanted: number) => {\n const m = nearestAllowed(day, wanted);\n if (m === null) return;\n onChange?.(at(day, m));\n };\n\n const firstOfferedMinute = minuteOptions[0];\n const lastOfferedMinute = 23 * 60 + minuteOptions[minuteOptions.length - 1];\n const isSameDay = (a: Date, b: Date) =>\n a.getFullYear() === b.getFullYear() &&\n a.getMonth() === b.getMonth() &&\n a.getDate() === b.getDate();\n const isDayDisabled = (day: Date) => {\n if ((min && isSameDay(day, min)) || (max && isSameDay(day, max))) {\n return allowedMinutesOn(day).length === 0;\n }\n if (min && at(day, lastOfferedMinute) < min) return true;\n if (max && at(day, firstOfferedMinute) > max) return true;\n return false;\n };\n\n const handleDayPick = (day: Date | undefined) => {\n if (!day) return;\n const wanted = value ? minuteOfDayOf(value) : defaultTime.hours * 60 + defaultTime.minutes;\n commit(day, wanted);\n };\n\n const current = value ? minuteOfDayOf(value) : null;\n const currentHours = current === null ? null : Math.floor(current / 60);\n const currentMinutes = current === null ? null : current % 60;\n const currentPeriod = currentHours === null ? null : periodOf(currentHours);\n\n const allowedSet = React.useMemo(\n () => new Set(value ? allowedMinutesOn(value) : []),\n [value, allowedMinutesOn],\n );\n const hourEnabled = (hours: number) => minuteOptions.some((m) => allowedSet.has(hours * 60 + m));\n const minuteEnabled = (minutes: number) =>\n currentHours !== null && allowedSet.has(currentHours * 60 + minutes);\n const periodEnabled = (period: Period) => {\n const base = period === 'PM' ? 12 : 0;\n for (let h = base; h < base + 12; h++) if (hourEnabled(h)) return true;\n return false;\n };\n\n const pickHour = (hour12: number) => {\n if (!value || currentPeriod === null || currentMinutes === null) return;\n const hours = to24(hour12, currentPeriod);\n const firstInHour = minuteOptions.find((m) => allowedSet.has(hours * 60 + m));\n if (firstInHour === undefined) return;\n const minutes = allowedSet.has(hours * 60 + currentMinutes) ? currentMinutes : firstInHour;\n commit(value, hours * 60 + minutes);\n };\n const pickMinute = (minutes: number) => {\n if (!value || currentHours === null) return;\n commit(value, currentHours * 60 + minutes);\n };\n const pickPeriod = (period: Period) => {\n if (!value || currentHours === null || currentMinutes === null) return;\n const hours = to24(hour12Of(currentHours), period);\n commit(value, hours * 60 + currentMinutes);\n };\n\n const timeDisabled = !value;\n\n return (\n <div className={cn('flex flex-col gap-3 sm:flex-row sm:items-start', className)}>\n <DatePicker selected={value} onSelect={handleDayPick} disabled={isDayDisabled} />\n <div\n className=\"flex gap-2 p-4 bg-card rounded-lg\"\n role=\"group\"\n aria-label=\"Time\"\n aria-disabled={timeDisabled || undefined}\n >\n <TimeColumn\n label=\"Hour\"\n options={HOURS_12.map((h) => ({\n key: h,\n text: String(h),\n ariaLabel: `${h} o'clock`,\n selected: currentHours !== null && hour12Of(currentHours) === h,\n disabled:\n timeDisabled || currentPeriod === null || !hourEnabled(to24(h, currentPeriod)),\n onPick: () => pickHour(h),\n }))}\n />\n <TimeColumn\n label=\"Minute\"\n options={minuteOptions.map((m) => ({\n key: m,\n text: pad2(m),\n ariaLabel: `${pad2(m)} minutes`,\n selected: currentMinutes === m,\n disabled: timeDisabled || !minuteEnabled(m),\n onPick: () => pickMinute(m),\n }))}\n />\n <TimeColumn\n label=\"AM or PM\"\n options={PERIODS.map((p) => ({\n key: p,\n text: p,\n ariaLabel: p,\n selected: currentPeriod === p,\n disabled: timeDisabled || !periodEnabled(p),\n onPick: () => pickPeriod(p),\n }))}\n />\n </div>\n </div>\n );\n}\n\nDateTimePicker.displayName = 'DateTimePicker';\n\ninterface TimeOption {\n key: string | number;\n text: string;\n ariaLabel: string;\n selected: boolean;\n disabled: boolean;\n onPick: () => void;\n}\n\nfunction TimeColumn({ label, options }: { label: string; options: TimeOption[] }) {\n const listRef = React.useRef<HTMLDivElement | null>(null);\n const selectedIndex = options.findIndex((o) => o.selected && !o.disabled);\n const firstEnabled = options.findIndex((o) => !o.disabled);\n const [focusIndex, setFocusIndex] = React.useState<number | null>(null);\n const rovingIndex =\n focusIndex !== null && options[focusIndex] && !options[focusIndex].disabled\n ? focusIndex\n : selectedIndex >= 0\n ? selectedIndex\n : firstEnabled;\n\n React.useLayoutEffect(() => {\n if (selectedIndex < 0) return;\n const el = listRef.current?.querySelector<HTMLButtonElement>(`[data-index=\"${selectedIndex}\"]`);\n el?.scrollIntoView?.({ block: 'nearest' });\n }, [selectedIndex]);\n\n const focusAt = (index: number) => {\n setFocusIndex(index);\n listRef.current?.querySelector<HTMLButtonElement>(`[data-index=\"${index}\"]`)?.focus();\n };\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLDivElement>) => {\n const enabled = options.map((o, i) => (o.disabled ? -1 : i)).filter((i) => i >= 0);\n if (enabled.length === 0 || rovingIndex < 0) return;\n const pos = enabled.indexOf(rovingIndex);\n let next: number | undefined;\n if (e.key === 'ArrowDown') next = enabled[Math.min(enabled.length - 1, pos + 1)];\n else if (e.key === 'ArrowUp') next = enabled[Math.max(0, pos - 1)];\n else if (e.key === 'Home') next = enabled[0];\n else if (e.key === 'End') next = enabled[enabled.length - 1];\n if (next === undefined) return;\n e.preventDefault();\n focusAt(next);\n };\n\n return (\n <div className=\"flex flex-col items-center gap-1\">\n <div className=\"text-xs font-semibold text-muted-foreground\" aria-hidden=\"true\">\n {label}\n </div>\n <div\n ref={listRef}\n role=\"group\"\n aria-label={label}\n onKeyDown={handleKeyDown}\n className=\"flex h-64 w-14 flex-col gap-1 overflow-y-auto\"\n >\n {options.map((o, i) => (\n <button\n key={o.key}\n type=\"button\"\n data-index={i}\n tabIndex={i === rovingIndex ? 0 : -1}\n disabled={o.disabled}\n aria-pressed={o.selected}\n aria-label={o.ariaLabel}\n onClick={() => {\n setFocusIndex(i);\n o.onPick();\n }}\n className={cn(\n 'h-9 shrink-0 rounded-lg text-sm font-semibold flex items-center justify-center',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background',\n !o.disabled && !o.selected && 'text-foreground hover:bg-primary/10',\n o.selected && 'bg-primary text-primary-foreground font-bold',\n o.disabled && 'opacity-30 cursor-not-allowed',\n )}\n >\n {o.text}\n </button>\n ))}\n </div>\n </div>\n );\n}\n\nexport { DateTimePicker };\n"]}
@@ -1,5 +1,5 @@
1
- import * as React from "react";
2
- import * as DialogPrimitive from "@radix-ui/react-dialog";
1
+ import * as React from 'react';
2
+ import * as DialogPrimitive from '@radix-ui/react-dialog';
3
3
  declare const Dialog: React.FC<DialogPrimitive.DialogProps>;
4
4
  declare const DialogTrigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
5
5
  declare const DialogPortal: React.FC<DialogPrimitive.DialogPortalProps>;
@@ -1 +1 @@
1
- {"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../../src/react/components/dialog.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAA;AAMzD,QAAA,MAAM,MAAM,uCAAuB,CAAA;AACnC,QAAA,MAAM,aAAa,8GAA0B,CAAA;AAC7C,QAAA,MAAM,YAAY,6CAAyB,CAAA;AAC3C,QAAA,MAAM,WAAW,4GAAwB,CAAA;AAEzC,QAAA,MAAM,aAAa,8JAYjB,CAAA;AAGF,QAAA,MAAM,aAAa,8JA0BjB,CAAA;AAGF,QAAA,MAAM,YAAY;8BAGf,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;;CAKtC,CAAA;AAGD,QAAA,MAAM,YAAY;8BAGf,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;;CAQtC,CAAA;AAGD,QAAA,MAAM,WAAW,oKASf,CAAA;AAGF,QAAA,MAAM,iBAAiB,8KASrB,CAAA;AAGF,OAAO,EACL,MAAM,EACN,YAAY,EACZ,aAAa,EACb,WAAW,EACX,aAAa,EACb,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,iBAAiB,GAClB,CAAA"}
1
+ {"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../../src/react/components/dialog.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAM1D,QAAA,MAAM,MAAM,uCAAuB,CAAC;AACpC,QAAA,MAAM,aAAa,8GAA0B,CAAC;AAC9C,QAAA,MAAM,YAAY,6CAAyB,CAAC;AAC5C,QAAA,MAAM,WAAW,4GAAwB,CAAC;AAE1C,QAAA,MAAM,aAAa,8JAYjB,CAAC;AAGH,QAAA,MAAM,aAAa,8JA0BjB,CAAC;AAGH,QAAA,MAAM,YAAY;8BAA6B,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;;CAElF,CAAC;AAGF,QAAA,MAAM,YAAY;8BAA6B,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;;CAKlF,CAAC;AAGF,QAAA,MAAM,WAAW,oKASf,CAAC;AAGH,QAAA,MAAM,iBAAiB,8KASrB,CAAC;AAGH,OAAO,EACL,MAAM,EACN,YAAY,EACZ,aAAa,EACb,WAAW,EACX,aAAa,EACb,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,iBAAiB,GAClB,CAAC"}
@@ -1,28 +1,28 @@
1
- "use client";
1
+ 'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import * as React from "react";
4
- import * as DialogPrimitive from "@radix-ui/react-dialog";
5
- import { X } from "lucide-react";
6
- import { cn } from "../../lib/utils.js";
7
- import { useOpenerFocus } from "./opener-focus.js";
3
+ import * as React from 'react';
4
+ import * as DialogPrimitive from '@radix-ui/react-dialog';
5
+ import { X } from 'lucide-react';
6
+ import { cn } from '../../lib/utils.js';
7
+ import { useOpenerFocus } from './opener-focus.js';
8
8
  const Dialog = DialogPrimitive.Root;
9
9
  const DialogTrigger = DialogPrimitive.Trigger;
10
10
  const DialogPortal = DialogPrimitive.Portal;
11
11
  const DialogClose = DialogPrimitive.Close;
12
- const DialogOverlay = React.forwardRef(({ className, ...props }, ref) => (_jsx(DialogPrimitive.Overlay, { ref: ref, className: cn("fixed inset-0 z-50 bg-[color:var(--scrim)] duration-[var(--motion-base)] ease-[var(--motion-ease)] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", className), ...props })));
12
+ const DialogOverlay = React.forwardRef(({ className, ...props }, ref) => (_jsx(DialogPrimitive.Overlay, { ref: ref, className: cn('fixed inset-0 z-50 bg-[color:var(--scrim)] duration-[var(--motion-base)] ease-[var(--motion-ease)] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0', className), ...props })));
13
13
  DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
14
14
  const DialogContent = React.forwardRef(({ className, children, onOpenAutoFocus, onCloseAutoFocus, ...props }, ref) => {
15
15
  const openerFocus = useOpenerFocus({ onOpenAutoFocus, onCloseAutoFocus });
16
- return (_jsxs(DialogPortal, { children: [_jsx(DialogOverlay, {}), _jsxs(DialogPrimitive.Content, { ref: ref, className: cn("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-card p-6 elevation-raised duration-[var(--motion-base)] ease-[var(--motion-ease)] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg", "max-h-[90vh] overflow-y-auto [&>*]:min-w-0", className), ...props, ...openerFocus, children: [children, _jsxs(DialogPrimitive.Close, { className: "absolute right-4 top-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [_jsx(X, { className: "h-4 w-4" }), _jsx("span", { className: "sr-only", children: "Close" })] })] })] }));
16
+ return (_jsxs(DialogPortal, { children: [_jsx(DialogOverlay, {}), _jsxs(DialogPrimitive.Content, { ref: ref, className: cn('fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-card p-6 elevation-raised duration-[var(--motion-base)] ease-[var(--motion-ease)] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg', 'max-h-[90vh] overflow-y-auto [&>*]:min-w-0', className), ...props, ...openerFocus, children: [children, _jsxs(DialogPrimitive.Close, { className: "absolute right-4 top-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [_jsx(X, { className: "h-4 w-4" }), _jsx("span", { className: "sr-only", children: "Close" })] })] })] }));
17
17
  });
18
18
  DialogContent.displayName = DialogPrimitive.Content.displayName;
19
- const DialogHeader = ({ className, ...props }) => (_jsx("div", { className: cn("flex flex-col space-y-1.5 text-center sm:text-left", className), ...props }));
20
- DialogHeader.displayName = "DialogHeader";
21
- const DialogFooter = ({ className, ...props }) => (_jsx("div", { className: cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className), ...props }));
22
- DialogFooter.displayName = "DialogFooter";
23
- const DialogTitle = React.forwardRef(({ className, ...props }, ref) => (_jsx(DialogPrimitive.Title, { ref: ref, className: cn("text-lg font-semibold leading-none tracking-tight break-words", className), ...props })));
19
+ const DialogHeader = ({ className, ...props }) => (_jsx("div", { className: cn('flex flex-col space-y-1.5 text-center sm:text-left', className), ...props }));
20
+ DialogHeader.displayName = 'DialogHeader';
21
+ const DialogFooter = ({ className, ...props }) => (_jsx("div", { className: cn('flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2', className), ...props }));
22
+ DialogFooter.displayName = 'DialogFooter';
23
+ const DialogTitle = React.forwardRef(({ className, ...props }, ref) => (_jsx(DialogPrimitive.Title, { ref: ref, className: cn('text-lg font-semibold leading-none tracking-tight break-words', className), ...props })));
24
24
  DialogTitle.displayName = DialogPrimitive.Title.displayName;
25
- const DialogDescription = React.forwardRef(({ className, ...props }, ref) => (_jsx(DialogPrimitive.Description, { ref: ref, className: cn("text-sm text-muted-foreground break-words", className), ...props })));
25
+ const DialogDescription = React.forwardRef(({ className, ...props }, ref) => (_jsx(DialogPrimitive.Description, { ref: ref, className: cn('text-sm text-muted-foreground break-words', className), ...props })));
26
26
  DialogDescription.displayName = DialogPrimitive.Description.displayName;
27
27
  export { Dialog, DialogPortal, DialogOverlay, DialogClose, DialogTrigger, DialogContent, DialogHeader, DialogFooter, DialogTitle, DialogDescription, };
28
28
  //# sourceMappingURL=dialog.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dialog.js","sourceRoot":"","sources":["../../../src/react/components/dialog.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAA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W,GAAG,eAAe,CAAC,WAAW,CAAC,WAAW,CAAA;AAEvE,OAAO,EACL,MAAM,EACN,YAAY,EACZ,aAAa,EACb,WAAW,EACX,aAAa,EACb,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,iBAAiB,GAClB,CAAA","sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\"\nimport { X } from \"lucide-react\"\n\nimport { cn } from \"../../lib/utils.js\"\nimport { useOpenerFocus } from \"./opener-focus.js\"\n\nconst Dialog = DialogPrimitive.Root\nconst DialogTrigger = DialogPrimitive.Trigger\nconst DialogPortal = DialogPrimitive.Portal\nconst DialogClose = DialogPrimitive.Close\n\nconst DialogOverlay = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Overlay\n ref={ref}\n className={cn(\n \"fixed inset-0 z-50 bg-[color:var(--scrim)] duration-[var(--motion-base)] ease-[var(--motion-ease)] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\",\n className\n )}\n {...props}\n />\n))\nDialogOverlay.displayName = DialogPrimitive.Overlay.displayName\n\nconst DialogContent = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>\n>(({ className, children, onOpenAutoFocus, onCloseAutoFocus, ...props }, ref) => {\n const openerFocus = useOpenerFocus({ onOpenAutoFocus, onCloseAutoFocus })\n return (\n <DialogPortal>\n <DialogOverlay />\n <DialogPrimitive.Content\n ref={ref}\n className={cn(\n \"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-card p-6 elevation-raised duration-[var(--motion-base)] ease-[var(--motion-ease)] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg\",\n \"max-h-[90vh] overflow-y-auto [&>*]:min-w-0\",\n className\n )}\n {...props}\n {...openerFocus}\n >\n {children}\n <DialogPrimitive.Close className=\"absolute right-4 top-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground\">\n <X className=\"h-4 w-4\" />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n </DialogPrimitive.Content>\n </DialogPortal>\n )\n})\nDialogContent.displayName = DialogPrimitive.Content.displayName\n\nconst DialogHeader = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\"flex flex-col space-y-1.5 text-center sm:text-left\", className)}\n {...props}\n />\n)\nDialogHeader.displayName = \"DialogHeader\"\n\nconst DialogFooter = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n \"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2\",\n className\n )}\n {...props}\n />\n)\nDialogFooter.displayName = \"DialogFooter\"\n\nconst DialogTitle = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Title\n ref={ref}\n className={cn(\"text-lg font-semibold leading-none tracking-tight break-words\", className)}\n {...props}\n />\n))\nDialogTitle.displayName = DialogPrimitive.Title.displayName\n\nconst DialogDescription = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Description\n ref={ref}\n className={cn(\"text-sm text-muted-foreground break-words\", className)}\n {...props}\n />\n))\nDialogDescription.displayName = DialogPrimitive.Description.displayName\n\nexport {\n Dialog,\n DialogPortal,\n DialogOverlay,\n DialogClose,\n DialogTrigger,\n DialogContent,\n DialogHeader,\n DialogFooter,\n DialogTitle,\n DialogDescription,\n}\n"]}
1
+ {"version":3,"file":"dialog.js","sourceRoot":"","sources":["../../../src/react/components/dialog.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,CAAC,EAAE,MAAM,cAAc,CAAC;AAEjC,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,MAAM,MAAM,GAAG,eAAe,CAAC,IAAI,CAAC;AACpC,MAAM,aAAa,GAAG,eAAe,CAAC,OAAO,CAAC;AAC9C,MAAM,YAAY,GAAG,eAAe,CAAC,MAAM,CAAC;AAC5C,MAAM,WAAW,GAAG,eAAe,CAAC,KAAK,CAAC;AAE1C,MAAM,aAAa,GAAG,KAAK,CAAC,UAAU,CAGpC,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAClC,KAAC,eAAe,CAAC,OAAO,IACtB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CACX,4NAA4N,EAC5N,SAAS,CACV,KACG,KAAK,GACT,CACH,CAAC,CAAC;AACH,aAAa,CAAC,WAAW,GAAG,eAAe,CAAC,OAAO,CAAC,WAAW,CAAC;AAEhE,MAAM,aAAa,GAAG,KAAK,CAAC,UAAU,CAGpC,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,eAAe,EAAE,gBAAgB,EAAE,GAAG,KAAK,EAAE,EA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AAS,CAAC,KACrF,KAAK,GACT,CACH,CAAC,CAAC;AACH,WAAW,CAAC,WAAW,GAAG,eAAe,CAAC,KAAK,CAAC,WAAW,CAAC;AAE5D,MAAM,iBAAiB,GAAG,KAAK,CAAC,UAAU,CAGxC,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAClC,KAAC,eAAe,CAAC,WAAW,IAC1B,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CAAC,2CAA2C,EAAE,SAAS,CAAC,KACjE,KAAK,GACT,CACH,CAAC,CAAC;AACH,iBAAiB,CAAC,WAAW,GAAG,eAAe,CAAC,WAAW,CAAC,WAAW,CAAC;AAExE,OAAO,EACL,MAAM,EACN,YAAY,EACZ,aAAa,EACb,WAAW,EACX,aAAa,EACb,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,iBAAiB,GAClB,CAAC","sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport * as DialogPrimitive from '@radix-ui/react-dialog';\nimport { X } from 'lucide-react';\n\nimport { cn } from '../../lib/utils.js';\nimport { useOpenerFocus } from './opener-focus.js';\n\nconst Dialog = DialogPrimitive.Root;\nconst DialogTrigger = DialogPrimitive.Trigger;\nconst DialogPortal = DialogPrimitive.Portal;\nconst DialogClose = DialogPrimitive.Close;\n\nconst DialogOverlay = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Overlay\n ref={ref}\n className={cn(\n 'fixed inset-0 z-50 bg-[color:var(--scrim)] duration-[var(--motion-base)] ease-[var(--motion-ease)] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',\n className,\n )}\n {...props}\n />\n));\nDialogOverlay.displayName = DialogPrimitive.Overlay.displayName;\n\nconst DialogContent = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>\n>(({ className, children, onOpenAutoFocus, onCloseAutoFocus, ...props }, ref) => {\n const openerFocus = useOpenerFocus({ onOpenAutoFocus, onCloseAutoFocus });\n return (\n <DialogPortal>\n <DialogOverlay />\n <DialogPrimitive.Content\n ref={ref}\n className={cn(\n 'fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-card p-6 elevation-raised duration-[var(--motion-base)] ease-[var(--motion-ease)] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg',\n 'max-h-[90vh] overflow-y-auto [&>*]:min-w-0',\n className,\n )}\n {...props}\n {...openerFocus}\n >\n {children}\n <DialogPrimitive.Close className=\"absolute right-4 top-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground\">\n <X className=\"h-4 w-4\" />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n </DialogPrimitive.Content>\n </DialogPortal>\n );\n});\nDialogContent.displayName = DialogPrimitive.Content.displayName;\n\nconst DialogHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div className={cn('flex flex-col space-y-1.5 text-center sm:text-left', className)} {...props} />\n);\nDialogHeader.displayName = 'DialogHeader';\n\nconst DialogFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn('flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2', className)}\n {...props}\n />\n);\nDialogFooter.displayName = 'DialogFooter';\n\nconst DialogTitle = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Title\n ref={ref}\n className={cn('text-lg font-semibold leading-none tracking-tight break-words', className)}\n {...props}\n />\n));\nDialogTitle.displayName = DialogPrimitive.Title.displayName;\n\nconst DialogDescription = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Description\n ref={ref}\n className={cn('text-sm text-muted-foreground break-words', className)}\n {...props}\n />\n));\nDialogDescription.displayName = DialogPrimitive.Description.displayName;\n\nexport {\n Dialog,\n DialogPortal,\n DialogOverlay,\n DialogClose,\n DialogTrigger,\n DialogContent,\n DialogHeader,\n DialogFooter,\n DialogTitle,\n DialogDescription,\n};\n"]}
@@ -1,5 +1,5 @@
1
- import * as React from "react";
2
- import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
1
+ import * as React from 'react';
2
+ import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
3
3
  declare const DropdownMenu: React.FC<DropdownMenuPrimitive.DropdownMenuProps>;
4
4
  declare const DropdownMenuTrigger: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuTriggerProps & React.RefAttributes<HTMLButtonElement>>;
5
5
  declare const DropdownMenuGroup: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuGroupProps & React.RefAttributes<HTMLDivElement>>;
@@ -13,15 +13,7 @@ declare const DropdownMenuSubContent: React.ForwardRefExoticComponent<Omit<Dropd
13
13
  declare const DropdownMenuContent: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
14
14
  declare const DropdownMenuItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
15
15
  inset?: boolean;
16
- /**
17
- * The action this item started is in flight: the item ignores selection, sets
18
- * `aria-disabled` and `aria-busy`, and shows the spinner in place of its `icon`. It is
19
- * never natively disabled while pending (a `disabled` passed alongside applies once pending
20
- * ends), so it keeps focus (FRONTEND-203). Keeping the menu
21
- * open meanwhile is the caller's `onSelect` (`event.preventDefault()`, close on settle).
22
- */
23
16
  pending?: boolean;
24
- /** Leading icon. While `pending`, the spinner takes its place. */
25
17
  icon?: React.ReactNode;
26
18
  } & React.RefAttributes<HTMLDivElement>>;
27
19
  declare const DropdownMenuCheckboxItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuCheckboxItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
@@ -1 +1 @@
1
- {"version":3,"file":"dropdown-menu.d.ts","sourceRoot":"","sources":["../../../src/react/components/dropdown-menu.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,qBAAqB,MAAM,+BAA+B,CAAA;AAOtE,QAAA,MAAM,YAAY,mDAA6B,CAAA;AAC/C,QAAA,MAAM,mBAAmB,0HAAgC,CAAA;AACzD,QAAA,MAAM,iBAAiB,qHAA8B,CAAA;AACrD,QAAA,MAAM,kBAAkB,yDAA+B,CAAA;AACvD,QAAA,MAAM,eAAe,sDAA4B,CAAA;AACjD,QAAA,MAAM,sBAAsB,0HAAmC,CAAA;AAE/D,QAAA,MAAM,sBAAsB;YAGhB,OAAO;wCAejB,CAAA;AAGF,QAAA,MAAM,sBAAsB,6KAY1B,CAAA;AAGF,QAAA,MAAM,mBAAmB,0KAevB,CAAA;AAUF,QAAA,MAAM,gBAAgB;YAGV,OAAO;IACf;;;;;;OAMG;cACO,OAAO;IACjB,kEAAkE;WAC3D,KAAK,CAAC,SAAS;wCAqBxB,CAAA;AA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A,MAAM,iBAAiB;YAGX,OAAO;wCAQjB,CAAC;AAGH,QAAA,MAAM,qBAAqB,4KASzB,CAAC;AAGH,QAAA,MAAM,oBAAoB;8BAA6B,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC;;CAE3F,CAAC;AAGF,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,wBAAwB,EACxB,qBAAqB,EACrB,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,GACvB,CAAC"}
@@ -1,42 +1,46 @@
1
- "use client";
1
+ 'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import * as React from "react";
4
- import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
5
- import { Slottable } from "@radix-ui/react-slot";
6
- import { Check, ChevronRight, Circle } from "lucide-react";
7
- import { cn } from "../../lib/utils.js";
8
- import { Spinner } from "./spinner.js";
3
+ import * as React from 'react';
4
+ import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
5
+ import { Slottable } from '@radix-ui/react-slot';
6
+ import { Check, ChevronRight, Circle } from 'lucide-react';
7
+ import { cn } from '../../lib/utils.js';
8
+ import { Spinner } from './spinner.js';
9
9
  const DropdownMenu = DropdownMenuPrimitive.Root;
10
10
  const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
11
11
  const DropdownMenuGroup = DropdownMenuPrimitive.Group;
12
12
  const DropdownMenuPortal = DropdownMenuPrimitive.Portal;
13
13
  const DropdownMenuSub = DropdownMenuPrimitive.Sub;
14
14
  const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
15
- const DropdownMenuSubTrigger = React.forwardRef(({ className, inset, children, ...props }, ref) => (_jsxs(DropdownMenuPrimitive.SubTrigger, { ref: ref, className: cn("flex cursor-default gap-2 select-none items-center rounded-xs px-2 py-1.5 text-sm outline-hidden focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", inset && "pl-8", className), ...props, children: [children, _jsx(ChevronRight, { className: "ml-auto" })] })));
15
+ const DropdownMenuSubTrigger = React.forwardRef(({ className, inset, children, ...props }, ref) => (_jsxs(DropdownMenuPrimitive.SubTrigger, { ref: ref, className: cn('flex cursor-default gap-2 select-none items-center rounded-xs px-2 py-1.5 text-sm outline-hidden focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0', inset && 'pl-8', className), ...props, children: [children, _jsx(ChevronRight, { className: "ml-auto" })] })));
16
16
  DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
17
- const DropdownMenuSubContent = React.forwardRef(({ className, ...props }, ref) => (_jsx(DropdownMenuPrimitive.SubContent, { ref: ref, className: cn("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground elevation-raised duration-[var(--motion-fast)] ease-[var(--motion-ease)] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", className), ...props })));
17
+ const DropdownMenuSubContent = React.forwardRef(({ className, ...props }, ref) => (_jsx(DropdownMenuPrimitive.SubContent, { ref: ref, className: cn('z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground elevation-raised duration-[var(--motion-fast)] ease-[var(--motion-ease)] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2', className), ...props })));
18
18
  DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
19
- const DropdownMenuContent = React.forwardRef(({ className, sideOffset = 4, ...props }, ref) => (_jsx(DropdownMenuPrimitive.Portal, { children: _jsx(DropdownMenuPrimitive.Content, { ref: ref, sideOffset: sideOffset, className: cn("z-50 min-w-[8rem] overflow-hidden rounded-md border !bg-card p-1 text-popover-foreground elevation-popover duration-[var(--motion-fast)] ease-[var(--motion-ease)] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", className), ...props }) })));
19
+ const DropdownMenuContent = React.forwardRef(({ className, sideOffset = 4, ...props }, ref) => (_jsx(DropdownMenuPrimitive.Portal, { children: _jsx(DropdownMenuPrimitive.Content, { ref: ref, sideOffset: sideOffset, className: cn('z-50 min-w-[8rem] overflow-hidden rounded-md border !bg-card p-1 text-popover-foreground elevation-popover duration-[var(--motion-fast)] ease-[var(--motion-ease)] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2', className), ...props }) })));
20
20
  DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
21
- // Every selection — a pointer, Enter, or Space — reaches the item as a click; stopping it in the
22
- // capture phase keeps the item's select (and an `asChild` link's navigation) from running.
21
+ // Every selection — a pointer, Enter, or Space — reaches the item as a click, so the capture-phase stop keeps its select from running.
23
22
  function blockActivation(event) {
24
23
  event.preventDefault();
25
24
  event.stopPropagation();
26
25
  }
27
- const DropdownMenuItem = React.forwardRef(({ className, inset, pending = false, icon, disabled, children, ...props }, ref) => (_jsxs(DropdownMenuPrimitive.Item, { ref: ref, className: cn("relative flex cursor-default select-none items-center gap-2 rounded-xs px-2 py-1.5 text-sm outline-hidden transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 app-dropdown-item", inset && "pl-8", className), ...props, ...(pending
28
- ? { "aria-busy": true, "aria-disabled": true, "data-pending": "", onClickCapture: blockActivation }
26
+ const DropdownMenuItem = React.forwardRef(({ className, inset, pending = false, icon, disabled, children, ...props }, ref) => (_jsxs(DropdownMenuPrimitive.Item, { ref: ref, className: cn('relative flex cursor-default select-none items-center gap-2 rounded-xs px-2 py-1.5 text-sm outline-hidden transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 app-dropdown-item', inset && 'pl-8', className), ...props, ...(pending
27
+ ? {
28
+ 'aria-busy': true,
29
+ 'aria-disabled': true,
30
+ 'data-pending': '',
31
+ onClickCapture: blockActivation,
32
+ }
29
33
  : {}), disabled: (disabled && !pending) || undefined, children: [pending ? _jsx(Spinner, { size: "xs" }) : icon, _jsx(Slottable, { children: children })] })));
30
34
  DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
31
- const DropdownMenuCheckboxItem = React.forwardRef(({ className, children, checked, ...props }, ref) => (_jsxs(DropdownMenuPrimitive.CheckboxItem, { ref: ref, className: cn("relative flex cursor-default select-none items-center rounded-xs py-1.5 pl-8 pr-2 text-sm outline-hidden transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className), checked: checked, ...props, children: [_jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: _jsx(DropdownMenuPrimitive.ItemIndicator, { children: _jsx(Check, { className: "h-4 w-4" }) }) }), children] })));
35
+ const DropdownMenuCheckboxItem = React.forwardRef(({ className, children, checked, ...props }, ref) => (_jsxs(DropdownMenuPrimitive.CheckboxItem, { ref: ref, className: cn('relative flex cursor-default select-none items-center rounded-xs py-1.5 pl-8 pr-2 text-sm outline-hidden transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50', className), checked: checked, ...props, children: [_jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: _jsx(DropdownMenuPrimitive.ItemIndicator, { children: _jsx(Check, { className: "h-4 w-4" }) }) }), children] })));
32
36
  DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
33
- const DropdownMenuRadioItem = React.forwardRef(({ className, children, ...props }, ref) => (_jsxs(DropdownMenuPrimitive.RadioItem, { ref: ref, className: cn("relative flex cursor-default select-none items-center rounded-xs py-1.5 pl-8 pr-2 text-sm outline-hidden transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className), ...props, children: [_jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: _jsx(DropdownMenuPrimitive.ItemIndicator, { children: _jsx(Circle, { className: "h-2 w-2 fill-current" }) }) }), children] })));
37
+ const DropdownMenuRadioItem = React.forwardRef(({ className, children, ...props }, ref) => (_jsxs(DropdownMenuPrimitive.RadioItem, { ref: ref, className: cn('relative flex cursor-default select-none items-center rounded-xs py-1.5 pl-8 pr-2 text-sm outline-hidden transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50', className), ...props, children: [_jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: _jsx(DropdownMenuPrimitive.ItemIndicator, { children: _jsx(Circle, { className: "h-2 w-2 fill-current" }) }) }), children] })));
34
38
  DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
35
- const DropdownMenuLabel = React.forwardRef(({ className, inset, ...props }, ref) => (_jsx(DropdownMenuPrimitive.Label, { ref: ref, className: cn("px-2 py-1.5 text-sm font-semibold", inset && "pl-8", className), ...props })));
39
+ const DropdownMenuLabel = React.forwardRef(({ className, inset, ...props }, ref) => (_jsx(DropdownMenuPrimitive.Label, { ref: ref, className: cn('px-2 py-1.5 text-sm font-semibold', inset && 'pl-8', className), ...props })));
36
40
  DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
37
- const DropdownMenuSeparator = React.forwardRef(({ className, ...props }, ref) => (_jsx(DropdownMenuPrimitive.Separator, { ref: ref, className: cn("-mx-1 my-1 h-px bg-muted", className), ...props })));
41
+ const DropdownMenuSeparator = React.forwardRef(({ className, ...props }, ref) => (_jsx(DropdownMenuPrimitive.Separator, { ref: ref, className: cn('-mx-1 my-1 h-px bg-muted', className), ...props })));
38
42
  DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
39
- const DropdownMenuShortcut = ({ className, ...props }) => (_jsx("span", { className: cn("ml-auto text-xs tracking-widest opacity-60", className), ...props }));
40
- DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
43
+ const DropdownMenuShortcut = ({ className, ...props }) => (_jsx("span", { className: cn('ml-auto text-xs tracking-widest opacity-60', className), ...props }));
44
+ DropdownMenuShortcut.displayName = 'DropdownMenuShortcut';
41
45
  export { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuGroup, DropdownMenuPortal, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuRadioGroup, };
42
46
  //# sourceMappingURL=dropdown-menu.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dropdown-menu.js","sourceRoot":"","sources":["../../../src/react/components/dropdown-menu.tsx"],"names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,EACpB,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,GACvB,CAAA","sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport * as DropdownMenuPrimitive from \"@radix-ui/react-dropdown-menu\"\nimport { Slottable } from \"@radix-ui/react-slot\"\nimport { Check, ChevronRight, Circle } from \"lucide-react\"\n\nimport { cn } from \"../../lib/utils.js\"\nimport { Spinner } from \"./spinner.js\"\n\nconst DropdownMenu = DropdownMenuPrimitive.Root\nconst DropdownMenuTrigger = DropdownMenuPrimitive.Trigger\nconst DropdownMenuGroup = DropdownMenuPrimitive.Group\nconst DropdownMenuPortal = DropdownMenuPrimitive.Portal\nconst DropdownMenuSub = DropdownMenuPrimitive.Sub\nconst DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup\n\nconst DropdownMenuSubTrigger = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean\n }\n>(({ className, inset, children, ...props }, ref) => (\n <DropdownMenuPrimitive.SubTrigger\n ref={ref}\n className={cn(\n \"flex cursor-default gap-2 select-none items-center rounded-xs px-2 py-1.5 text-sm outline-hidden focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0\",\n inset && \"pl-8\",\n className\n )}\n {...props}\n >\n {children}\n <ChevronRight className=\"ml-auto\" />\n </DropdownMenuPrimitive.SubTrigger>\n))\nDropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName\n\nconst DropdownMenuSubContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.SubContent\n ref={ref}\n className={cn(\n \"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground elevation-raised duration-[var(--motion-fast)] ease-[var(--motion-ease)] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n className\n )}\n {...props}\n />\n))\nDropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName\n\nconst DropdownMenuContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n \"z-50 min-w-[8rem] overflow-hidden rounded-md border !bg-card p-1 text-popover-foreground elevation-popover duration-[var(--motion-fast)] ease-[var(--motion-ease)] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n className\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n))\nDropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName\n\n// Every selection — a pointer, Enter, or Space — reaches the item as a click; stopping it in the\n// capture phase keeps the item's select (and an `asChild` link's navigation) from running.\nfunction blockActivation(event: React.MouseEvent<HTMLElement>) {\n event.preventDefault()\n event.stopPropagation()\n}\n\nconst DropdownMenuItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean\n /**\n * The action this item started is in flight: the item ignores selection, sets\n * `aria-disabled` and `aria-busy`, and shows the spinner in place of its `icon`. It is\n * never natively disabled while pending (a `disabled` passed alongside applies once pending\n * ends), so it keeps focus (FRONTEND-203). Keeping the menu\n * open meanwhile is the caller's `onSelect` (`event.preventDefault()`, close on settle).\n */\n pending?: boolean\n /** Leading icon. While `pending`, the spinner takes its place. */\n icon?: React.ReactNode\n }\n>(({ className, inset, pending = false, icon, disabled, children, ...props }, ref) => (\n <DropdownMenuPrimitive.Item\n ref={ref}\n className={cn(\n \"relative flex cursor-default select-none items-center gap-2 rounded-xs px-2 py-1.5 text-sm outline-hidden transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 app-dropdown-item\",\n inset && \"pl-8\",\n className\n )}\n {...props}\n {...(pending\n ? { \"aria-busy\": true, \"aria-disabled\": true, \"data-pending\": \"\", onClickCapture: blockActivation }\n : {})}\n disabled={(disabled && !pending) || undefined}\n >\n {/* Direct siblings, never a fragment: under `asChild` Radix Slot finds the Slottable\n among its direct children and renders the icon/spinner inside the child element. */}\n {pending ? <Spinner size=\"xs\" /> : icon}\n <Slottable>{children}</Slottable>\n </DropdownMenuPrimitive.Item>\n))\nDropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName\n\nconst DropdownMenuCheckboxItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n <DropdownMenuPrimitive.CheckboxItem\n ref={ref}\n className={cn(\n \"relative flex cursor-default select-none items-center rounded-xs py-1.5 pl-8 pr-2 text-sm outline-hidden transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50\",\n className\n )}\n checked={checked}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <Check className=\"h-4 w-4\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n))\nDropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName\n\nconst DropdownMenuRadioItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <DropdownMenuPrimitive.RadioItem\n ref={ref}\n className={cn(\n \"relative flex cursor-default select-none items-center rounded-xs py-1.5 pl-8 pr-2 text-sm outline-hidden transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50\",\n className\n )}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <Circle className=\"h-2 w-2 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n))\nDropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName\n\nconst DropdownMenuLabel = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Label\n ref={ref}\n className={cn(\"px-2 py-1.5 text-sm font-semibold\", inset && \"pl-8\", className)}\n {...props}\n />\n))\nDropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName\n\nconst DropdownMenuSeparator = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.Separator\n ref={ref}\n className={cn(\"-mx-1 my-1 h-px bg-muted\", className)}\n {...props}\n />\n))\nDropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName\n\nconst DropdownMenuShortcut = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => (\n <span className={cn(\"ml-auto text-xs tracking-widest opacity-60\", className)} {...props} />\n)\nDropdownMenuShortcut.displayName = \"DropdownMenuShortcut\"\n\nexport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuGroup,\n DropdownMenuPortal,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuRadioGroup,\n}\n"]}
1
+ {"version":3,"file":"dropdown-menu.js","sourceRoot":"","sources":["../../../src/react/components/dropdown-menu.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,qBAAqB,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAE3D,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,MAAM,YAAY,GAAG,qBAAqB,CAAC,IAAI,CAAC;AAChD,MAAM,mBAAmB,GAAG,qBAAqB,CAAC,OAAO,CAAC;AAC1D,MAAM,iBAAiB,GAAG,qBAAqB,CAAC,KAAK,CAAC;AACtD,MAAM,kBAAkB,GAAG,qBAAqB,CAAC,MAAM,CAAC;AACxD,MAAM,eAAe,GAAG,qBAAqB,CAAC,GAAG,CAAC;AAClD,MAAM,sBAAsB,GAAG,qBAA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AAC,qBAAqB,CAAC,SAAS,IAC9B,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CAAC,0BAA0B,EAAE,SAAS,CAAC,KAChD,KAAK,GACT,CACH,CAAC,CAAC;AACH,qBAAqB,CAAC,WAAW,GAAG,qBAAqB,CAAC,SAAS,CAAC,WAAW,CAAC;AAEhF,MAAM,oBAAoB,GAAG,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAyC,EAAE,EAAE,CAAC,CAC/F,eAAM,SAAS,EAAE,EAAE,CAAC,4CAA4C,EAAE,SAAS,CAAC,KAAM,KAAK,GAAI,CAC5F,CAAC;AACF,oBAAoB,CAAC,WAAW,GAAG,sBAAsB,CAAC;AAE1D,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,wBAAwB,EACxB,qBAAqB,EACrB,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,GACvB,CAAC","sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\nimport { Slottable } from '@radix-ui/react-slot';\nimport { Check, ChevronRight, Circle } from 'lucide-react';\n\nimport { cn } from '../../lib/utils.js';\nimport { Spinner } from './spinner.js';\n\nconst DropdownMenu = DropdownMenuPrimitive.Root;\nconst DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;\nconst DropdownMenuGroup = DropdownMenuPrimitive.Group;\nconst DropdownMenuPortal = DropdownMenuPrimitive.Portal;\nconst DropdownMenuSub = DropdownMenuPrimitive.Sub;\nconst DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;\n\nconst DropdownMenuSubTrigger = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean;\n }\n>(({ className, inset, children, ...props }, ref) => (\n <DropdownMenuPrimitive.SubTrigger\n ref={ref}\n className={cn(\n 'flex cursor-default gap-2 select-none items-center rounded-xs px-2 py-1.5 text-sm outline-hidden focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0',\n inset && 'pl-8',\n className,\n )}\n {...props}\n >\n {children}\n <ChevronRight className=\"ml-auto\" />\n </DropdownMenuPrimitive.SubTrigger>\n));\nDropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;\n\nconst DropdownMenuSubContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.SubContent\n ref={ref}\n className={cn(\n 'z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground elevation-raised duration-[var(--motion-fast)] ease-[var(--motion-ease)] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',\n className,\n )}\n {...props}\n />\n));\nDropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;\n\nconst DropdownMenuContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n 'z-50 min-w-[8rem] overflow-hidden rounded-md border !bg-card p-1 text-popover-foreground elevation-popover duration-[var(--motion-fast)] ease-[var(--motion-ease)] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',\n className,\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n));\nDropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;\n\n// Every selection — a pointer, Enter, or Space — reaches the item as a click, so the capture-phase stop keeps its select from running.\nfunction blockActivation(event: React.MouseEvent<HTMLElement>) {\n event.preventDefault();\n event.stopPropagation();\n}\n\nconst DropdownMenuItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean;\n pending?: boolean;\n icon?: React.ReactNode;\n }\n>(({ className, inset, pending = false, icon, disabled, children, ...props }, ref) => (\n <DropdownMenuPrimitive.Item\n ref={ref}\n className={cn(\n 'relative flex cursor-default select-none items-center gap-2 rounded-xs px-2 py-1.5 text-sm outline-hidden transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 app-dropdown-item',\n inset && 'pl-8',\n className,\n )}\n {...props}\n {...(pending\n ? {\n 'aria-busy': true,\n 'aria-disabled': true,\n 'data-pending': '',\n onClickCapture: blockActivation,\n }\n : {})}\n disabled={(disabled && !pending) || undefined}\n >\n {/* Radix Slot finds the Slottable among its direct children, so these are siblings, never a fragment. */}\n {pending ? <Spinner size=\"xs\" /> : icon}\n <Slottable>{children}</Slottable>\n </DropdownMenuPrimitive.Item>\n));\nDropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;\n\nconst DropdownMenuCheckboxItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n <DropdownMenuPrimitive.CheckboxItem\n ref={ref}\n className={cn(\n 'relative flex cursor-default select-none items-center rounded-xs py-1.5 pl-8 pr-2 text-sm outline-hidden transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n className,\n )}\n checked={checked}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <Check className=\"h-4 w-4\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n));\nDropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;\n\nconst DropdownMenuRadioItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <DropdownMenuPrimitive.RadioItem\n ref={ref}\n className={cn(\n 'relative flex cursor-default select-none items-center rounded-xs py-1.5 pl-8 pr-2 text-sm outline-hidden transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n className,\n )}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <Circle className=\"h-2 w-2 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n));\nDropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;\n\nconst DropdownMenuLabel = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Label\n ref={ref}\n className={cn('px-2 py-1.5 text-sm font-semibold', inset && 'pl-8', className)}\n {...props}\n />\n));\nDropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;\n\nconst DropdownMenuSeparator = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.Separator\n ref={ref}\n className={cn('-mx-1 my-1 h-px bg-muted', className)}\n {...props}\n />\n));\nDropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;\n\nconst DropdownMenuShortcut = ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>) => (\n <span className={cn('ml-auto text-xs tracking-widest opacity-60', className)} {...props} />\n);\nDropdownMenuShortcut.displayName = 'DropdownMenuShortcut';\n\nexport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuGroup,\n DropdownMenuPortal,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuRadioGroup,\n};\n"]}
@@ -1,4 +1,4 @@
1
- import * as React from "react";
1
+ import * as React from 'react';
2
2
  export interface EndOfListIndicatorProps {
3
3
  message?: string;
4
4
  className?: string;