@overdoser/react-toolkit 0.21.0 → 0.22.1

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 (161) hide show
  1. package/AGENTS.md +1 -0
  2. package/CHANGELOG.md +35 -0
  3. package/components/Accordion/Accordion.js +48 -48
  4. package/components/ActionButton/ActionButton.js +23 -23
  5. package/components/ActionButton/CopyButton.js +5 -5
  6. package/components/Alert/Alert.js +13 -13
  7. package/components/Avatar/Avatar.js +12 -12
  8. package/components/Badge/Badge.js +6 -6
  9. package/components/Breadcrumbs/Breadcrumbs.js +15 -15
  10. package/components/Button/Button.js +14 -14
  11. package/components/Card/Card.js +26 -26
  12. package/components/Chart/AreaChart.js +103 -103
  13. package/components/Chart/Axis.js +7 -7
  14. package/components/Chart/BarChart.js +62 -62
  15. package/components/Chart/ChartContainer.js +11 -11
  16. package/components/Chart/ChartLegend.js +7 -7
  17. package/components/Chart/ChartTooltip.js +13 -13
  18. package/components/Chart/LineChart.js +88 -88
  19. package/components/Chart/PieChart.js +25 -25
  20. package/components/Chart/RadarChart.js +42 -42
  21. package/components/Chart/Sparkline.js +11 -11
  22. package/components/Chart/TradingChart.js +126 -126
  23. package/components/Chart/trading/period.js +3 -3
  24. package/components/Chip/Chip.js +24 -24
  25. package/components/CodeBlock/CodeBlock.js +31 -31
  26. package/components/CommandPalette/CommandPalette.js +166 -166
  27. package/components/ConfirmDialog/ConfirmDialog.js +60 -60
  28. package/components/Divider/Divider.js +10 -10
  29. package/components/Draggable/Draggable.js +29 -29
  30. package/components/Drawer/Drawer.js +53 -53
  31. package/components/Dropdown/Dropdown.js +66 -66
  32. package/components/Dropdown/DropdownItem.js +13 -13
  33. package/components/Dropdown/DropdownLabel.js +5 -5
  34. package/components/Dropdown/DropdownSeparator.js +5 -5
  35. package/components/Dropzone/Dropzone.js +15 -15
  36. package/components/EmptyState/EmptyState.js +11 -11
  37. package/components/Form/Form.js +17 -17
  38. package/components/Form/FormField.js +21 -21
  39. package/components/Form/FormRow.js +3 -3
  40. package/components/ImageViewer/ImageViewer.js +118 -118
  41. package/components/Kbd/Kbd.js +11 -11
  42. package/components/KeyValueList/KeyValueList.js +32 -32
  43. package/components/Link/Link.js +7 -7
  44. package/components/List/List.js +7 -7
  45. package/components/Loader/Loader.js +39 -39
  46. package/components/Modal/Modal.js +48 -48
  47. package/components/PageHeader/PageHeader.js +18 -18
  48. package/components/Pagination/Pagination.js +23 -23
  49. package/components/Popover/Popover.js +25 -25
  50. package/components/ProgressBar/ProgressBar.js +17 -17
  51. package/components/RelativeTime/RelativeTime.js +10 -10
  52. package/components/SegmentedControl/SegmentedControl.js +38 -38
  53. package/components/Skeleton/Skeleton.js +10 -10
  54. package/components/Spinner/Spinner.js +7 -7
  55. package/components/SplitButton/SplitButton.js +63 -63
  56. package/components/SplitPane/SplitPane.js +50 -50
  57. package/components/StatCard/StatCard.js +32 -32
  58. package/components/StatusDot/StatusDot.js +7 -7
  59. package/components/Table/Table.js +174 -174
  60. package/components/Tabs/Tabs.js +47 -47
  61. package/components/ThemeToggle/ThemeToggle.js +31 -31
  62. package/components/Timeline/GanttTimeline.js +213 -213
  63. package/components/Timeline/HistoryTimeline.js +306 -306
  64. package/components/Timeline/TimelineShared.js +103 -103
  65. package/components/Timeline/TraceEventDetails.js +103 -103
  66. package/components/Timeline/TraceTimeline.js +546 -546
  67. package/components/Timeline/historyLayout.js +2 -2
  68. package/components/Timer/Timer.js +39 -39
  69. package/components/Toast/Toast.js +59 -59
  70. package/components/ToggleIconButton/ToggleIconButton.js +9 -9
  71. package/components/Tooltip/Tooltip.js +16 -16
  72. package/components/Typography/Typography.js +5 -5
  73. package/components/inputs/Checkbox/Checkbox.js +11 -11
  74. package/components/inputs/Checkbox/CheckboxGroup.js +21 -21
  75. package/components/inputs/DatePicker/CalendarPanel.js +113 -113
  76. package/components/inputs/DatePicker/DatePicker.js +39 -39
  77. package/components/inputs/DateTimePicker/DateTimePicker.js +119 -119
  78. package/components/inputs/DateTimePicker/DateTimeSegments.js +40 -40
  79. package/components/inputs/DateTimePicker/TimeField.js +34 -34
  80. package/components/inputs/Input/Input.js +13 -13
  81. package/components/inputs/NumberInput/NumberInput.js +16 -16
  82. package/components/inputs/Radio/Radio.js +17 -17
  83. package/components/inputs/SearchInput/SearchInput.js +25 -25
  84. package/components/inputs/Select/Select.d.ts +55 -3
  85. package/components/inputs/Select/Select.js +485 -344
  86. package/components/inputs/Select/{Select.module.js → Select.module.scss.js} +15 -3
  87. package/components/inputs/Slider/Slider.js +21 -21
  88. package/components/inputs/Switch/Switch.js +4 -4
  89. package/components/inputs/Textarea/Textarea.js +8 -8
  90. package/hooks/usePortalPosition.d.ts +2 -1
  91. package/hooks/usePortalPosition.js +6 -3
  92. package/hooks/useResizable.js +1 -1
  93. package/hooks/useTheme.js +7 -7
  94. package/index.css +1 -1
  95. package/index.js +1 -1
  96. package/index.layered.css +1 -1
  97. package/llms.txt +25 -4
  98. package/manifest.json +33 -4
  99. package/package.json +1 -1
  100. /package/components/Accordion/{Accordion.module.js → Accordion.module.scss.js} +0 -0
  101. /package/components/ActionButton/{ActionButton.module.js → ActionButton.module.scss.js} +0 -0
  102. /package/components/Alert/{Alert.module.js → Alert.module.scss.js} +0 -0
  103. /package/components/Avatar/{Avatar.module.js → Avatar.module.scss.js} +0 -0
  104. /package/components/Badge/{Badge.module.js → Badge.module.scss.js} +0 -0
  105. /package/components/Breadcrumbs/{Breadcrumbs.module.js → Breadcrumbs.module.scss.js} +0 -0
  106. /package/components/Button/{Button.module.js → Button.module.scss.js} +0 -0
  107. /package/components/Card/{Card.module.js → Card.module.scss.js} +0 -0
  108. /package/components/Chart/{Chart.module.js → Chart.module.scss.js} +0 -0
  109. /package/components/Chip/{Chip.module.js → Chip.module.scss.js} +0 -0
  110. /package/components/CodeBlock/{CodeBlock.module.js → CodeBlock.module.scss.js} +0 -0
  111. /package/components/CommandPalette/{CommandPalette.module.js → CommandPalette.module.scss.js} +0 -0
  112. /package/components/ConfirmDialog/{ConfirmDialog.module.js → ConfirmDialog.module.scss.js} +0 -0
  113. /package/components/Divider/{Divider.module.js → Divider.module.scss.js} +0 -0
  114. /package/components/Draggable/{Draggable.module.js → Draggable.module.scss.js} +0 -0
  115. /package/components/Drawer/{Drawer.module.js → Drawer.module.scss.js} +0 -0
  116. /package/components/Dropdown/{Dropdown.module.js → Dropdown.module.scss.js} +0 -0
  117. /package/components/Dropzone/{Dropzone.module.js → Dropzone.module.scss.js} +0 -0
  118. /package/components/EmptyState/{EmptyState.module.js → EmptyState.module.scss.js} +0 -0
  119. /package/components/Form/{Form.module.js → Form.module.scss.js} +0 -0
  120. /package/components/ImageViewer/{ImageViewer.module.js → ImageViewer.module.scss.js} +0 -0
  121. /package/components/Kbd/{Kbd.module.js → Kbd.module.scss.js} +0 -0
  122. /package/components/KeyValueList/{KeyValueList.module.js → KeyValueList.module.scss.js} +0 -0
  123. /package/components/Link/{Link.module.js → Link.module.scss.js} +0 -0
  124. /package/components/List/{List.module.js → List.module.scss.js} +0 -0
  125. /package/components/Loader/{Loader.module.js → Loader.module.scss.js} +0 -0
  126. /package/components/Modal/{Modal.module.js → Modal.module.scss.js} +0 -0
  127. /package/components/PageHeader/{PageHeader.module.js → PageHeader.module.scss.js} +0 -0
  128. /package/components/Pagination/{Pagination.module.js → Pagination.module.scss.js} +0 -0
  129. /package/components/Popover/{Popover.module.js → Popover.module.scss.js} +0 -0
  130. /package/components/ProgressBar/{ProgressBar.module.js → ProgressBar.module.scss.js} +0 -0
  131. /package/components/RelativeTime/{RelativeTime.module.js → RelativeTime.module.scss.js} +0 -0
  132. /package/components/SegmentedControl/{SegmentedControl.module.js → SegmentedControl.module.scss.js} +0 -0
  133. /package/components/Skeleton/{Skeleton.module.js → Skeleton.module.scss.js} +0 -0
  134. /package/components/Spinner/{Spinner.module.js → Spinner.module.scss.js} +0 -0
  135. /package/components/SplitButton/{SplitButton.module.js → SplitButton.module.scss.js} +0 -0
  136. /package/components/SplitPane/{SplitPane.module.js → SplitPane.module.scss.js} +0 -0
  137. /package/components/StatCard/{StatCard.module.js → StatCard.module.scss.js} +0 -0
  138. /package/components/StatusDot/{StatusDot.module.js → StatusDot.module.scss.js} +0 -0
  139. /package/components/Table/{Table.module.js → Table.module.scss.js} +0 -0
  140. /package/components/Tabs/{Tabs.module.js → Tabs.module.scss.js} +0 -0
  141. /package/components/ThemeToggle/{ThemeToggle.module.js → ThemeToggle.module.scss.js} +0 -0
  142. /package/components/Timeline/{GanttTimeline.module.js → GanttTimeline.module.scss.js} +0 -0
  143. /package/components/Timeline/{HistoryTimeline.module.js → HistoryTimeline.module.scss.js} +0 -0
  144. /package/components/Timeline/{Timeline.module.js → Timeline.module.scss.js} +0 -0
  145. /package/components/Timeline/{TraceTimeline.module.js → TraceTimeline.module.scss.js} +0 -0
  146. /package/components/Timer/{Timer.module.js → Timer.module.scss.js} +0 -0
  147. /package/components/Toast/{Toast.module.js → Toast.module.scss.js} +0 -0
  148. /package/components/ToggleIconButton/{ToggleIconButton.module.js → ToggleIconButton.module.scss.js} +0 -0
  149. /package/components/Tooltip/{Tooltip.module.js → Tooltip.module.scss.js} +0 -0
  150. /package/components/Typography/{Typography.module.js → Typography.module.scss.js} +0 -0
  151. /package/components/inputs/Checkbox/{Checkbox.module.js → Checkbox.module.scss.js} +0 -0
  152. /package/components/inputs/Checkbox/{CheckboxGroup.module.js → CheckboxGroup.module.scss.js} +0 -0
  153. /package/components/inputs/DatePicker/{CalendarPanel.module.js → CalendarPanel.module.scss.js} +0 -0
  154. /package/components/inputs/DatePicker/{DatePicker.module.js → DatePicker.module.scss.js} +0 -0
  155. /package/components/inputs/DateTimePicker/{DateTimePicker.module.js → DateTimePicker.module.scss.js} +0 -0
  156. /package/components/inputs/Input/{Input.module.js → Input.module.scss.js} +0 -0
  157. /package/components/inputs/NumberInput/{NumberInput.module.js → NumberInput.module.scss.js} +0 -0
  158. /package/components/inputs/Radio/{Radio.module.js → Radio.module.scss.js} +0 -0
  159. /package/components/inputs/SearchInput/{SearchInput.module.js → SearchInput.module.scss.js} +0 -0
  160. /package/components/inputs/Slider/{Slider.module.js → Slider.module.scss.js} +0 -0
  161. /package/components/inputs/Textarea/{Textarea.module.js → Textarea.module.scss.js} +0 -0
@@ -1,150 +1,150 @@
1
- import { useClickOutside as e } from "../../../hooks/useClickOutside.js";
2
- import { usePortalPosition as ee } from "../../../hooks/usePortalPosition.js";
3
- import { Button as t } from "../../Button/Button.js";
4
- import { CalendarPanel as te } from "../DatePicker/CalendarPanel.js";
5
- import { startOfMonth as n } from "../DatePicker/dateUtils.js";
6
- import r from "../DatePicker/DatePicker.module.js";
7
- import i from "./DateTimePicker.module.js";
8
- import { TimeField as ne } from "./TimeField.js";
9
- import { DateTimeSegments as re } from "./DateTimeSegments.js";
10
- import { fromWallClock as ie, getWallClock as a, isValidTimeZone as ae, localTimeZone as oe, localeHourCycle as se, timeZoneName as ce, wallClockDay as o } from "./timeZoneUtils.js";
11
- import { forwardRef as s, useCallback as c, useMemo as l, useRef as u, useState as d } from "react";
12
- import f from "clsx";
13
- import { jsx as p, jsxs as m } from "react/jsx-runtime";
14
- import { createPortal as le } from "react-dom";
1
+ import { forwardRef as e, useCallback as t, useMemo as n, useRef as r, useState as i } from "react";
2
+ import { createPortal as ee } from "react-dom";
3
+ import a from "clsx";
4
+ import { useClickOutside as te } from "../../../hooks/useClickOutside.js";
5
+ import { usePortalPosition as ne } from "../../../hooks/usePortalPosition.js";
6
+ import { Button as re } from "../../Button/Button.js";
7
+ import { CalendarPanel as ie } from "../DatePicker/CalendarPanel.js";
8
+ import { startOfMonth as o } from "../DatePicker/dateUtils.js";
9
+ import s from "../DatePicker/DatePicker.module.scss.js";
10
+ import c from "./DateTimePicker.module.scss.js";
11
+ import { TimeField as ae } from "./TimeField.js";
12
+ import { DateTimeSegments as oe } from "./DateTimeSegments.js";
13
+ import { fromWallClock as se, getWallClock as l, isValidTimeZone as ce, localTimeZone as le, localeHourCycle as ue, timeZoneName as de, wallClockDay as u } from "./timeZoneUtils.js";
14
+ import { jsx as d, jsxs as f } from "react/jsx-runtime";
15
15
  // src/components/inputs/DateTimePicker/DateTimePicker.tsx
16
- var ue = {
16
+ var fe = {
17
17
  hour: 0,
18
18
  minute: 0,
19
19
  second: 0
20
- }, h = s(({ value: s, defaultValue: h, onChange: g, min: _, max: v, disabledDate: y, weekStartsOn: de = 0, locale: b, timeZone: fe, showTimeZone: pe = !0, timeZoneStyle: me = "longOffset", fieldFormat: x = "iso", hourCycle: he, minuteStep: ge = 5, showSeconds: _e = !0, format: S, placeholder: ve = "Select date and time", doneLabel: ye = "Done", inputSize: be = "md", error: C = !1, disabled: w = !1, portal: T = !0, classes: E, className: xe, style: Se, "aria-label": D, "aria-describedby": O }, k) => {
21
- let A = s !== void 0, [Ce, we] = d(h ?? null), j = A ? s ?? null : Ce, M = fe ?? "UTC", N = l(() => {
22
- if (M !== "system") return ae(M) ? M : (console.warn(`[DateTimePicker] Unknown time zone "${M}" — falling back to UTC.`), "UTC");
23
- }, [M]), P = l(() => he ?? (x === "locale" ? se(b) : 24), [
24
- he,
25
- x,
26
- b
27
- ]), F = l(() => j ? a(j, N) : null, [j, N]), I = l(() => F ? o(F) : null, [F]), L = F ? {
20
+ }, p = e(({ value: e, defaultValue: p, onChange: m, min: h, max: g, disabledDate: _, weekStartsOn: pe = 0, locale: v, timeZone: me, showTimeZone: y = !0, timeZoneStyle: he = "longOffset", fieldFormat: b = "iso", hourCycle: ge, minuteStep: _e = 5, showSeconds: x = !0, format: S, placeholder: ve = "Select date and time", doneLabel: ye = "Done", inputSize: be = "md", error: C = !1, disabled: w = !1, portal: T = !0, classes: E, className: xe, style: Se, "aria-label": D, "aria-describedby": O }, k) => {
21
+ let A = e !== void 0, [Ce, we] = i(p ?? null), j = A ? e ?? null : Ce, M = me ?? "UTC", N = n(() => {
22
+ if (M !== "system") return ce(M) ? M : (console.warn(`[DateTimePicker] Unknown time zone "${M}" — falling back to UTC.`), "UTC");
23
+ }, [M]), P = n(() => ge ?? (b === "locale" ? ue(v) : 24), [
24
+ ge,
25
+ b,
26
+ v
27
+ ]), F = n(() => j ? l(j, N) : null, [j, N]), I = n(() => F ? u(F) : null, [F]), L = F ? {
28
28
  hour: F.hour,
29
29
  minute: F.minute,
30
30
  second: F.second
31
- } : ue, R = c(() => o(a(/* @__PURE__ */ new Date(), N)), [N]), Te = l(() => R(), [R]), [z, B] = d(!1), [Ee, De] = d(() => n(I ?? R())), [V, H] = d(() => I ?? R()), U = u(null), W = u(null), Oe = u(null), ke = ee(U, z && T), G = l(() => pe ? N === "UTC" || N === "Etc/UTC" ? "UTC" : ce(j ?? /* @__PURE__ */ new Date(), N, b, me) : null, [
32
- pe,
31
+ } : fe, R = t(() => u(l(/* @__PURE__ */ new Date(), N)), [N]), Te = n(() => R(), [R]), [z, B] = i(!1), [Ee, V] = i(() => o(I ?? R())), [H, U] = i(() => I ?? R()), W = r(null), G = r(null), De = r(null), Oe = ne(W, z && T), K = n(() => y ? N === "UTC" || N === "Etc/UTC" ? "UTC" : de(j ?? /* @__PURE__ */ new Date(), N, v, he) : null, [
32
+ y,
33
33
  j,
34
34
  N,
35
- b,
36
- me
37
- ]), K = N ?? oe(), q = l(() => _ ? o(a(_, N)) : void 0, [_, N]), J = l(() => v ? o(a(v, N)) : void 0, [v, N]), Ae = c((e) => q && e < q || J && e > J ? !0 : y?.(e) ?? !1, [
38
- q,
35
+ v,
36
+ he
37
+ ]), q = N ?? le(), J = n(() => h ? u(l(h, N)) : void 0, [h, N]), Y = n(() => g ? u(l(g, N)) : void 0, [g, N]), ke = t((e) => J && e < J || Y && e > Y ? !0 : _?.(e) ?? !1, [
39
38
  J,
40
- y
41
- ]), Y = c((e) => {
42
- A || we(e), g?.(e);
43
- }, [A, g]), X = c((e, ee) => {
44
- let t = ie({
39
+ Y,
40
+ _
41
+ ]), X = t((e) => {
42
+ A || we(e), m?.(e);
43
+ }, [A, m]), Z = t((e, t) => {
44
+ let n = se({
45
45
  year: e.getFullYear(),
46
46
  month: e.getMonth(),
47
47
  day: e.getDate(),
48
- ...ee
48
+ ...t
49
49
  }, N);
50
- _ && t < _ && (t = new Date(_.getTime())), v && t > v && (t = new Date(v.getTime())), Y(t);
50
+ h && n < h && (n = new Date(h.getTime())), g && n > g && (n = new Date(g.getTime())), X(n);
51
51
  }, [
52
52
  N,
53
- _,
54
- v,
55
- Y
56
- ]), Z = c(() => {
53
+ h,
54
+ g,
55
+ X
56
+ ]), Q = t(() => {
57
57
  if (w) return;
58
58
  let e = I ?? R();
59
- De(n(e)), H(e), B(!0);
59
+ V(o(e)), U(e), B(!0);
60
60
  }, [
61
61
  w,
62
62
  I,
63
63
  R
64
- ]), Q = c((e = !0) => {
65
- B(!1), e && (W.current ? W.current.focus() : U.current?.querySelector("input")?.focus());
66
- }, []), je = c((e) => {
67
- H(e), X(e, L);
68
- }, [X, L]), Me = c((e) => X(I ?? V, e), [
69
- X,
64
+ ]), $ = t((e = !0) => {
65
+ B(!1), e && (G.current ? G.current.focus() : W.current?.querySelector("input")?.focus());
66
+ }, []), Ae = t((e) => {
67
+ U(e), Z(e, L);
68
+ }, [Z, L]), je = t((e) => Z(I ?? H, e), [
69
+ Z,
70
70
  I,
71
- V
72
- ]), Ne = c((e) => X(o(e), {
71
+ H
72
+ ]), Me = t((e) => Z(u(e), {
73
73
  hour: e.hour,
74
74
  minute: e.minute,
75
75
  second: e.second
76
- }), [X]);
77
- e(Oe, () => B(!1), z);
78
- let Pe = (e) => {
79
- e.key === "ArrowDown" || e.key === "Enter" ? (e.preventDefault(), Z()) : e.key === "Escape" && z && (e.preventDefault(), B(!1));
80
- }, $ = /* @__PURE__ */ m("div", {
81
- ref: Oe,
82
- className: f(i.popover, T && i.portalled, E?.popover),
76
+ }), [Z]);
77
+ te(De, () => B(!1), z);
78
+ let Ne = (e) => {
79
+ e.key === "ArrowDown" || e.key === "Enter" ? (e.preventDefault(), Q()) : e.key === "Escape" && z && (e.preventDefault(), B(!1));
80
+ }, Pe = /* @__PURE__ */ f("div", {
81
+ ref: De,
82
+ className: a(c.popover, T && c.portalled, E?.popover),
83
83
  style: T ? {
84
84
  position: "fixed",
85
- top: ke.top + 4,
86
- left: ke.left
85
+ top: Oe.top + 4,
86
+ left: Oe.left
87
87
  } : void 0,
88
88
  role: "dialog",
89
89
  "aria-modal": "false",
90
90
  "aria-label": "Choose date and time",
91
91
  onKeyDown: (e) => {
92
- e.key === "Escape" && !e.defaultPrevented && (e.preventDefault(), Q());
92
+ e.key === "Escape" && !e.defaultPrevented && (e.preventDefault(), $());
93
93
  },
94
- children: [/* @__PURE__ */ m("div", {
95
- className: i.body,
96
- children: [/* @__PURE__ */ p("div", {
97
- className: i.calendar,
98
- children: /* @__PURE__ */ p(te, {
94
+ children: [/* @__PURE__ */ f("div", {
95
+ className: c.body,
96
+ children: [/* @__PURE__ */ d("div", {
97
+ className: c.calendar,
98
+ children: /* @__PURE__ */ d(ie, {
99
99
  viewDate: Ee,
100
- focusedDate: V,
100
+ focusedDate: H,
101
101
  selected: I,
102
102
  today: Te,
103
- minDay: q,
104
- maxDay: J,
105
- locale: b,
106
- weekStartsOn: de,
107
- isDisabledDay: Ae,
108
- onSelect: je,
109
- onViewDateChange: De,
110
- onFocusedDateChange: H,
111
- onEscape: Q,
103
+ minDay: J,
104
+ maxDay: Y,
105
+ locale: v,
106
+ weekStartsOn: pe,
107
+ isDisabledDay: ke,
108
+ onSelect: Ae,
109
+ onViewDateChange: V,
110
+ onFocusedDateChange: U,
111
+ onEscape: $,
112
112
  classes: E
113
113
  })
114
- }), /* @__PURE__ */ p(ne, {
114
+ }), /* @__PURE__ */ d(ae, {
115
115
  ...L,
116
- onChange: Me,
116
+ onChange: je,
117
117
  hourCycle: P,
118
- showSeconds: _e,
119
- minuteStep: ge,
118
+ showSeconds: x,
119
+ minuteStep: _e,
120
120
  disabled: w,
121
121
  classes: E
122
122
  })]
123
- }), /* @__PURE__ */ m("div", {
124
- className: f(i.footer, E?.footer),
125
- children: [G && /* @__PURE__ */ p("span", {
126
- className: f(i.zone, E?.timeZone),
127
- title: K,
128
- children: G
129
- }), /* @__PURE__ */ p(t, {
123
+ }), /* @__PURE__ */ f("div", {
124
+ className: a(c.footer, E?.footer),
125
+ children: [K && /* @__PURE__ */ d("span", {
126
+ className: a(c.zone, E?.timeZone),
127
+ title: q,
128
+ children: K
129
+ }), /* @__PURE__ */ d(re, {
130
130
  type: "button",
131
131
  size: "sm",
132
- onClick: () => Q(),
132
+ onClick: () => $(),
133
133
  children: ye
134
134
  })]
135
135
  })]
136
136
  });
137
- return /* @__PURE__ */ m("div", {
137
+ return /* @__PURE__ */ f("div", {
138
138
  ref: (e) => {
139
- U.current = e, typeof k == "function" ? k(e) : k && (k.current = e);
139
+ W.current = e, typeof k == "function" ? k(e) : k && (k.current = e);
140
140
  },
141
- className: f(r.root, r[be], C && r.error, w && r.disabled, E?.root, xe),
141
+ className: a(s.root, s[be], C && s.error, w && s.disabled, E?.root, xe),
142
142
  style: Se,
143
143
  children: [
144
- S ? /* @__PURE__ */ p("input", {
144
+ S ? /* @__PURE__ */ d("input", {
145
145
  type: "text",
146
146
  readOnly: !0,
147
- className: f(r.input, E?.input),
147
+ className: a(s.input, E?.input),
148
148
  value: j ? S(j) : "",
149
149
  placeholder: ve,
150
150
  disabled: w,
@@ -153,74 +153,74 @@ var ue = {
153
153
  "aria-haspopup": "dialog",
154
154
  "aria-expanded": z,
155
155
  "aria-invalid": C || void 0,
156
- onClick: Z,
157
- onKeyDown: Pe
158
- }) : /* @__PURE__ */ p(re, {
159
- ref: W,
156
+ onClick: Q,
157
+ onKeyDown: Ne
158
+ }) : /* @__PURE__ */ d(oe, {
159
+ ref: G,
160
160
  value: j,
161
161
  timeZone: N,
162
- locale: b,
163
- layout: x,
162
+ locale: v,
163
+ layout: b,
164
164
  hourCycle: P,
165
- showSeconds: _e,
166
- onChange: Ne,
167
- onClear: () => Y(null),
168
- onOpenRequest: Z,
165
+ showSeconds: x,
166
+ onChange: Me,
167
+ onClear: () => X(null),
168
+ onOpenRequest: Q,
169
169
  onEscape: (e) => {
170
170
  z && (e.preventDefault(), B(!1));
171
171
  },
172
- suffix: G,
173
- suffixTitle: K,
172
+ suffix: K,
173
+ suffixTitle: q,
174
174
  suffixClassName: E?.timeZone,
175
175
  disabled: w,
176
- className: f(r.input, E?.input),
176
+ className: a(s.input, E?.input),
177
177
  classes: { segment: E?.segment },
178
178
  "aria-label": D,
179
179
  "aria-describedby": O,
180
180
  "aria-invalid": C
181
181
  }),
182
- S && G && /* @__PURE__ */ p("span", {
183
- className: f(i.timeZone, E?.timeZone),
184
- title: K,
185
- children: G
182
+ S && K && /* @__PURE__ */ d("span", {
183
+ className: a(c.timeZone, E?.timeZone),
184
+ title: q,
185
+ children: K
186
186
  }),
187
- /* @__PURE__ */ p("button", {
187
+ /* @__PURE__ */ d("button", {
188
188
  type: "button",
189
189
  tabIndex: -1,
190
- className: f(r.icon, E?.icon),
191
- onClick: Z,
190
+ className: a(s.icon, E?.icon),
191
+ onClick: Q,
192
192
  disabled: w,
193
193
  "aria-label": "Open date and time picker",
194
- children: /* @__PURE__ */ m("svg", {
194
+ children: /* @__PURE__ */ f("svg", {
195
195
  viewBox: "0 0 20 20",
196
196
  fill: "none",
197
197
  stroke: "currentColor",
198
198
  strokeWidth: "1.5",
199
199
  "aria-hidden": "true",
200
200
  children: [
201
- /* @__PURE__ */ p("path", {
201
+ /* @__PURE__ */ d("path", {
202
202
  d: "M3 8h14M7 2v3M13 2v3",
203
203
  strokeLinecap: "round"
204
204
  }),
205
- /* @__PURE__ */ p("path", {
205
+ /* @__PURE__ */ d("path", {
206
206
  d: "M17 10V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h4",
207
207
  strokeLinecap: "round"
208
208
  }),
209
- /* @__PURE__ */ p("circle", {
209
+ /* @__PURE__ */ d("circle", {
210
210
  cx: "14.5",
211
211
  cy: "14.5",
212
212
  r: "3.5"
213
213
  }),
214
- /* @__PURE__ */ p("path", {
214
+ /* @__PURE__ */ d("path", {
215
215
  d: "M14.5 12.75v1.75l1.25 1",
216
216
  strokeLinecap: "round"
217
217
  })
218
218
  ]
219
219
  })
220
220
  }),
221
- z && (T ? typeof document < "u" && le($, document.body) : $)
221
+ z && (T ? typeof document < "u" && ee(Pe, document.body) : Pe)
222
222
  ]
223
223
  });
224
224
  });
225
- h.displayName = "DateTimePicker";
226
- export { h as DateTimePicker };
225
+ p.displayName = "DateTimePicker";
226
+ export { p as DateTimePicker };
@@ -1,7 +1,7 @@
1
- import e from "./DateTimePicker.module.js";
2
- import { getWallClock as t } from "./timeZoneUtils.js";
3
- import { forwardRef as n, useCallback as r, useEffect as i, useImperativeHandle as a, useMemo as o, useRef as s, useState as c } from "react";
4
- import l from "clsx";
1
+ import { forwardRef as e, useCallback as t, useEffect as n, useImperativeHandle as r, useMemo as i, useRef as a, useState as o } from "react";
2
+ import s from "clsx";
3
+ import c from "./DateTimePicker.module.scss.js";
4
+ import { getWallClock as l } from "./timeZoneUtils.js";
5
5
  import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
6
6
  // src/components/inputs/DateTimePicker/DateTimeSegments.tsx
7
7
  var p = /* @__PURE__ */ new Set([
@@ -31,8 +31,8 @@ var p = /* @__PURE__ */ new Set([
31
31
  }, g = (e, t) => new Date(e, t + 1, 0).getDate(), _ = (e, t, n) => {
32
32
  let r = n - t + 1;
33
33
  return ((e - t) % r + r) % r + t;
34
- }, v = n(({ value: n, timeZone: v, locale: y, layout: b, hourCycle: x, showSeconds: S, onChange: C, onClear: w, onOpenRequest: T, onEscape: E, suffix: D, suffixTitle: O, suffixClassName: k, disabled: A = !1, classes: j, className: M, "aria-label": N, "aria-describedby": P, "aria-invalid": F }, I) => {
35
- let L = s(null), [R, z] = c(0), [B, V] = c(""), H = s(!1), U = o(() => new Intl.DateTimeFormat(y, {
34
+ }, v = e(({ value: e, timeZone: v, locale: y, layout: b, hourCycle: x, showSeconds: S, onChange: C, onClear: w, onOpenRequest: T, onEscape: E, suffix: D, suffixTitle: O, suffixClassName: k, disabled: A = !1, classes: j, className: M, "aria-label": N, "aria-describedby": P, "aria-invalid": F }, I) => {
35
+ let L = a(null), [R, z] = o(0), [B, V] = o(""), H = a(!1), U = i(() => new Intl.DateTimeFormat(y, {
36
36
  year: "numeric",
37
37
  month: "2-digit",
38
38
  day: "2-digit",
@@ -46,22 +46,22 @@ var p = /* @__PURE__ */ new Set([
46
46
  S,
47
47
  x,
48
48
  v
49
- ]), W = o(() => n ? t(n, v) : null, [n, v]), G = o(() => {
50
- if (b === "locale") return U.formatToParts(n ?? new Date(2001, 11, 21, 15, 45, 30)).filter((e) => p.has(e.type) || e.type === "literal").map((e) => ({
49
+ ]), W = i(() => e ? l(e, v) : null, [e, v]), G = i(() => {
50
+ if (b === "locale") return U.formatToParts(e ?? new Date(2001, 11, 21, 15, 45, 30)).filter((e) => p.has(e.type) || e.type === "literal").map((e) => ({
51
51
  type: e.type,
52
52
  text: e.value
53
53
  }));
54
- let e = (e, t = 2) => String(e).padStart(t, "0"), t = W ?? {
54
+ let t = (e, t = 2) => String(e).padStart(t, "0"), n = W ?? {
55
55
  year: 0,
56
56
  month: 0,
57
57
  day: 0,
58
58
  hour: 0,
59
59
  minute: 0,
60
60
  second: 0
61
- }, r = x === 12 ? t.hour % 12 || 12 : t.hour, i = [
61
+ }, r = x === 12 ? n.hour % 12 || 12 : n.hour, i = [
62
62
  {
63
63
  type: "year",
64
- text: e(t.year, 4)
64
+ text: t(n.year, 4)
65
65
  },
66
66
  {
67
67
  type: "literal",
@@ -69,7 +69,7 @@ var p = /* @__PURE__ */ new Set([
69
69
  },
70
70
  {
71
71
  type: "month",
72
- text: e(t.month + 1)
72
+ text: t(n.month + 1)
73
73
  },
74
74
  {
75
75
  type: "literal",
@@ -77,7 +77,7 @@ var p = /* @__PURE__ */ new Set([
77
77
  },
78
78
  {
79
79
  type: "day",
80
- text: e(t.day)
80
+ text: t(n.day)
81
81
  },
82
82
  {
83
83
  type: "literal",
@@ -85,7 +85,7 @@ var p = /* @__PURE__ */ new Set([
85
85
  },
86
86
  {
87
87
  type: "hour",
88
- text: e(r)
88
+ text: t(r)
89
89
  },
90
90
  {
91
91
  type: "literal",
@@ -93,7 +93,7 @@ var p = /* @__PURE__ */ new Set([
93
93
  },
94
94
  {
95
95
  type: "minute",
96
- text: e(t.minute)
96
+ text: t(n.minute)
97
97
  }
98
98
  ];
99
99
  return S && i.push({
@@ -101,28 +101,28 @@ var p = /* @__PURE__ */ new Set([
101
101
  text: ":"
102
102
  }, {
103
103
  type: "second",
104
- text: e(t.second)
104
+ text: t(n.second)
105
105
  }), x === 12 && i.push({
106
106
  type: "literal",
107
107
  text: " "
108
108
  }, {
109
109
  type: "dayPeriod",
110
- text: t.hour >= 12 ? "PM" : "AM"
110
+ text: n.hour >= 12 ? "PM" : "AM"
111
111
  }), i;
112
112
  }, [
113
113
  b,
114
114
  U,
115
- n,
115
+ e,
116
116
  W,
117
117
  x,
118
118
  S
119
- ]), K = o(() => G.map((e, t) => e.type === "literal" ? -1 : t).filter((e) => e >= 0), [G]), q = r(() => W ? { ...W } : {
120
- ...t(/* @__PURE__ */ new Date(), v),
119
+ ]), K = i(() => G.map((e, t) => e.type === "literal" ? -1 : t).filter((e) => e >= 0), [G]), q = t(() => W ? { ...W } : {
120
+ ...l(/* @__PURE__ */ new Date(), v),
121
121
  second: 0
122
122
  }, [W, v]);
123
- a(I, () => ({ focus: () => {
123
+ r(I, () => ({ focus: () => {
124
124
  L.current?.querySelector("[role=\"spinbutton\"][tabindex=\"0\"]")?.focus();
125
- } }), []), i(() => {
125
+ } }), []), n(() => {
126
126
  H.current && (H.current = !1, L.current?.querySelector(`[data-segment="${R}"]`)?.focus());
127
127
  }, [R]);
128
128
  let J = (e) => {
@@ -235,35 +235,35 @@ var p = /* @__PURE__ */ new Set([
235
235
  "aria-describedby": P,
236
236
  "aria-invalid": F || void 0,
237
237
  "aria-disabled": A || void 0,
238
- className: l(e.segments, j?.segments, M),
238
+ className: s(c.segments, j?.segments, M),
239
239
  onMouseDown: (e) => {
240
240
  A || e.target.closest("[role=\"spinbutton\"]") || (e.preventDefault(), L.current?.querySelector(`[data-segment="${R}"]`)?.focus());
241
241
  },
242
- children: [G.map((t, n) => {
243
- if (t.type === "literal") return /* @__PURE__ */ d("span", {
244
- className: e.literal,
242
+ children: [G.map((e, t) => {
243
+ if (e.type === "literal") return /* @__PURE__ */ d("span", {
244
+ className: c.literal,
245
245
  "aria-hidden": "true",
246
- children: t.text
247
- }, n);
248
- let r = t.type, i = n === R, a = i && B !== "", o = !W && !a, s = a ? B : o ? m[r] : t.text, c = W ? Z(r, W) + +(r === "month") : void 0;
246
+ children: e.text
247
+ }, t);
248
+ let n = e.type, r = t === R, i = r && B !== "", a = !W && !i, o = i ? B : a ? m[n] : e.text, l = W ? Z(n, W) + +(n === "month") : void 0;
249
249
  return /* @__PURE__ */ d("span", {
250
250
  role: "spinbutton",
251
- tabIndex: A ? -1 : i ? 0 : -1,
252
- "data-segment": n,
253
- "aria-label": h[r],
254
- "aria-valuenow": c,
255
- "aria-valuetext": o ? "Empty" : r === "dayPeriod" ? t.text : void 0,
251
+ tabIndex: A ? -1 : r ? 0 : -1,
252
+ "data-segment": t,
253
+ "aria-label": h[n],
254
+ "aria-valuenow": l,
255
+ "aria-valuetext": a ? "Empty" : n === "dayPeriod" ? e.text : void 0,
256
256
  "aria-disabled": A || void 0,
257
- className: l(e.segment, o && e.segmentEmpty, j?.segment),
257
+ className: s(c.segment, a && c.segmentEmpty, j?.segment),
258
258
  onFocus: () => {
259
- V(""), z(n);
259
+ V(""), z(t);
260
260
  },
261
261
  onBlur: () => V(""),
262
- onKeyDown: (e) => ee(e, r),
263
- children: s
264
- }, n);
262
+ onKeyDown: (e) => ee(e, n),
263
+ children: o
264
+ }, t);
265
265
  }), D && /* @__PURE__ */ f(u, { children: [" ", /* @__PURE__ */ d("span", {
266
- className: l(e.suffix, k),
266
+ className: s(c.suffix, k),
267
267
  title: O,
268
268
  children: D
269
269
  })] })]