@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,9 +1,9 @@
1
- import { Modal as e } from "../Modal/Modal.js";
2
- import { Button as t } from "../Button/Button.js";
3
- import { Input as n } from "../inputs/Input/Input.js";
4
- import r from "./ConfirmDialog.module.js";
5
- import { createContext as i, forwardRef as a, useCallback as o, useContext as s, useEffect as c, useId as l, useMemo as u, useRef as d, useState as f } from "react";
6
- import p from "clsx";
1
+ import { createContext as e, forwardRef as t, useCallback as n, useContext as r, useEffect as i, useId as a, useMemo as o, useRef as s, useState as c } from "react";
2
+ import l from "clsx";
3
+ import { Modal as u } from "../Modal/Modal.js";
4
+ import { Button as d } from "../Button/Button.js";
5
+ import { Input as f } from "../inputs/Input/Input.js";
6
+ import p from "./ConfirmDialog.module.scss.js";
7
7
  import { jsx as m, jsxs as h } from "react/jsx-runtime";
8
8
  // src/components/ConfirmDialog/ConfirmDialog.tsx
9
9
  var g = /* @__PURE__ */ m("svg", {
@@ -15,27 +15,27 @@ var g = /* @__PURE__ */ m("svg", {
15
15
  d: "M8.26 3.1c.77-1.33 2.71-1.33 3.48 0l5.58 9.67c.77 1.33-.19 3-1.74 3H4.42c-1.55 0-2.51-1.67-1.74-3L8.26 3.1zM10 7a1 1 0 011 1v3a1 1 0 11-2 0V8a1 1 0 011-1zm0 7a1 1 0 100-2 1 1 0 000 2z",
16
16
  clipRule: "evenodd"
17
17
  })
18
- }), _ = (e) => String(e?.message ?? e), v = a(({ open: i, onConfirm: a, onCancel: s, title: v = "Are you sure?", description: y, children: b, confirmLabel: x = "Confirm", cancelLabel: S = "Cancel", danger: C = !1, requireText: w, icon: T, autoFocus: E, closeOnBackdrop: D = !0, errorMessage: O = _, "aria-label": k, classes: A, className: j, style: M }, N) => {
19
- let [P, F] = f(!1), [I, L] = f(void 0), [R, z] = f(""), B = d(null), V = d(null), H = d(null), U = d(!0), W = l();
20
- c(() => (U.current = !0, () => {
18
+ }), _ = (e) => String(e?.message ?? e), v = t(({ open: e, onConfirm: t, onCancel: r, title: v = "Are you sure?", description: y, children: b, confirmLabel: x = "Confirm", cancelLabel: S = "Cancel", danger: C = !1, requireText: w, icon: T, autoFocus: E, closeOnBackdrop: D = !0, errorMessage: O = _, "aria-label": k, classes: A, className: j, style: M }, N) => {
19
+ let [P, F] = c(!1), [I, L] = c(void 0), [R, z] = c(""), B = s(null), V = s(null), H = s(null), U = s(!0), W = a();
20
+ i(() => (U.current = !0, () => {
21
21
  U.current = !1;
22
- }), []), c(() => {
23
- i || (F(!1), L(void 0), z(""));
24
- }, [i]);
22
+ }), []), i(() => {
23
+ e || (F(!1), L(void 0), z(""));
24
+ }, [e]);
25
25
  let G = E ?? (C ? "cancel" : "confirm");
26
- c(() => {
27
- i && (w ? H.current : G === "cancel" ? V.current : B.current)?.focus();
26
+ i(() => {
27
+ e && (w ? H.current : G === "cancel" ? V.current : B.current)?.focus();
28
28
  }, [
29
- i,
29
+ e,
30
30
  G,
31
31
  w
32
32
  ]);
33
- let K = w === void 0 || R === w, q = K && !P, J = o(async () => {
33
+ let K = w === void 0 || R === w, q = K && !P, J = n(async () => {
34
34
  if (!q) return;
35
35
  L(void 0);
36
36
  let e;
37
37
  try {
38
- e = a();
38
+ e = t();
39
39
  } catch (e) {
40
40
  L(e);
41
41
  return;
@@ -50,57 +50,57 @@ var g = /* @__PURE__ */ m("svg", {
50
50
  U.current && F(!1);
51
51
  }
52
52
  }
53
- }, [q, a]), Y = o(() => {
54
- P || s();
55
- }, [P, s]), X = T === !1 ? null : T === void 0 ? C ? g : null : T, Z = u(() => ({
53
+ }, [q, t]), Y = n(() => {
54
+ P || r();
55
+ }, [P, r]), X = T === !1 ? null : T === void 0 ? C ? g : null : T, Z = o(() => ({
56
56
  modal: A?.modal,
57
57
  header: A?.header,
58
58
  body: A?.body,
59
59
  footer: A?.footer
60
60
  }), [A]);
61
- return /* @__PURE__ */ h(e, {
61
+ return /* @__PURE__ */ h(u, {
62
62
  ref: N,
63
- open: i,
63
+ open: e,
64
64
  onClose: Y,
65
65
  size: "sm",
66
66
  closeOnBackdrop: D && !P,
67
67
  closeOnEscape: !P,
68
68
  classes: Z,
69
- className: p(r.root, C && r.danger, j),
69
+ className: l(p.root, C && p.danger, j),
70
70
  style: M,
71
71
  "aria-label": typeof v == "string" ? v : v ? void 0 : k,
72
72
  children: [
73
- v ? /* @__PURE__ */ m(e.Header, {
73
+ v ? /* @__PURE__ */ m(u.Header, {
74
74
  onClose: P ? void 0 : Y,
75
75
  children: /* @__PURE__ */ h("span", {
76
- className: r.titleRow,
76
+ className: p.titleRow,
77
77
  children: [X && /* @__PURE__ */ m("span", {
78
- className: p(r.icon, A?.icon),
78
+ className: l(p.icon, A?.icon),
79
79
  "aria-hidden": "true",
80
80
  children: X
81
81
  }), /* @__PURE__ */ m("span", {
82
- className: r.title,
82
+ className: p.title,
83
83
  children: v
84
84
  })]
85
85
  })
86
86
  }) : null,
87
- /* @__PURE__ */ h(e.Body, { children: [
87
+ /* @__PURE__ */ h(u.Body, { children: [
88
88
  y && /* @__PURE__ */ m("div", {
89
- className: p(r.description, A?.description),
89
+ className: l(p.description, A?.description),
90
90
  children: y
91
91
  }),
92
92
  b,
93
93
  w !== void 0 && /* @__PURE__ */ h("div", {
94
- className: p(r.input, A?.input),
94
+ className: l(p.input, A?.input),
95
95
  children: [/* @__PURE__ */ h("label", {
96
96
  htmlFor: W,
97
- className: r.inputLabel,
97
+ className: p.inputLabel,
98
98
  children: [
99
99
  "Type ",
100
100
  /* @__PURE__ */ m("b", { children: w }),
101
101
  " to confirm"
102
102
  ]
103
- }), /* @__PURE__ */ m(n, {
103
+ }), /* @__PURE__ */ m(f, {
104
104
  ref: H,
105
105
  id: W,
106
106
  value: R,
@@ -116,37 +116,37 @@ var g = /* @__PURE__ */ m("svg", {
116
116
  }),
117
117
  I !== void 0 && /* @__PURE__ */ m("div", {
118
118
  role: "alert",
119
- className: p(r.error, A?.error),
119
+ className: l(p.error, A?.error),
120
120
  children: O(I)
121
121
  })
122
122
  ] }),
123
- /* @__PURE__ */ h(e.Footer, { children: [/* @__PURE__ */ m(t, {
123
+ /* @__PURE__ */ h(u.Footer, { children: [/* @__PURE__ */ m(d, {
124
124
  ref: V,
125
125
  variant: "ghost",
126
126
  onClick: Y,
127
127
  disabled: P,
128
- className: p(r.cancel, A?.cancel),
128
+ className: l(p.cancel, A?.cancel),
129
129
  children: S
130
- }), /* @__PURE__ */ m(t, {
130
+ }), /* @__PURE__ */ m(d, {
131
131
  ref: B,
132
132
  variant: C ? "danger" : "primary",
133
133
  onClick: () => void J(),
134
134
  loading: P,
135
135
  disabled: !K,
136
- className: p(r.confirm, A?.confirm),
136
+ className: l(p.confirm, A?.confirm),
137
137
  children: x
138
138
  })] })
139
139
  ]
140
140
  });
141
141
  });
142
142
  v.displayName = "ConfirmDialog";
143
- var y = i(null), b = 0;
143
+ var y = e(null), b = 0;
144
144
  function x({ children: e, defaults: t }) {
145
- let [n, r] = f(null), i = d(null);
146
- i.current = n;
147
- let a = o((e = {}) => new Promise((n) => {
148
- i.current?.resolve(!1);
149
- let a = {
145
+ let [r, i] = c(null), a = s(null);
146
+ a.current = r;
147
+ let o = n((e = {}) => new Promise((n) => {
148
+ a.current?.resolve(!1);
149
+ let r = {
150
150
  id: ++b,
151
151
  options: {
152
152
  ...t,
@@ -154,32 +154,32 @@ function x({ children: e, defaults: t }) {
154
154
  },
155
155
  resolve: n
156
156
  };
157
- i.current = a, r(a);
158
- }), [t]), s = o((e, t) => {
159
- i.current === e && (i.current = null, r(null), e.resolve(t));
160
- }, []), c = o(async () => {
161
- let e = i.current;
157
+ a.current = r, i(r);
158
+ }), [t]), l = n((e, t) => {
159
+ a.current === e && (a.current = null, i(null), e.resolve(t));
160
+ }, []), u = n(async () => {
161
+ let e = a.current;
162
162
  if (!e) return;
163
163
  let t = e.options.onConfirm?.();
164
- t && typeof t.then == "function" && await t, s(e, !0);
165
- }, [s]), l = o(() => {
166
- let e = i.current;
167
- e && s(e, !1);
168
- }, [s]), { body: u, onConfirm: p, ...g } = n?.options ?? {};
164
+ t && typeof t.then == "function" && await t, l(e, !0);
165
+ }, [l]), d = n(() => {
166
+ let e = a.current;
167
+ e && l(e, !1);
168
+ }, [l]), { body: f, onConfirm: p, ...g } = r?.options ?? {};
169
169
  return /* @__PURE__ */ h(y.Provider, {
170
- value: a,
170
+ value: o,
171
171
  children: [e, /* @__PURE__ */ m(v, {
172
172
  ...g,
173
- open: n !== null,
174
- onConfirm: c,
175
- onCancel: l,
176
- children: u
177
- }, n?.id ?? "idle")]
173
+ open: r !== null,
174
+ onConfirm: u,
175
+ onCancel: d,
176
+ children: f
177
+ }, r?.id ?? "idle")]
178
178
  });
179
179
  }
180
180
  x.displayName = "ConfirmProvider";
181
181
  function S() {
182
- let e = s(y);
182
+ let e = r(y);
183
183
  if (!e) throw Error("useConfirm() must be used inside a <ConfirmProvider>.");
184
184
  return e;
185
185
  }
@@ -1,23 +1,23 @@
1
- import e from "./Divider.module.js";
2
- import { forwardRef as t } from "react";
3
- import n from "clsx";
1
+ import { forwardRef as e } from "react";
2
+ import t from "clsx";
3
+ import n from "./Divider.module.scss.js";
4
4
  import { Fragment as r, jsx as i, jsxs as a } from "react/jsx-runtime";
5
5
  // src/components/Divider/Divider.tsx
6
- var o = t(({ orientation: t = "horizontal", variant: o = "solid", label: s, labelPosition: c = "center", classes: l, className: u, ...d }, f) => {
7
- let p = s != null && t === "horizontal";
6
+ var o = e(({ orientation: e = "horizontal", variant: o = "solid", label: s, labelPosition: c = "center", classes: l, className: u, ...d }, f) => {
7
+ let p = s != null && e === "horizontal";
8
8
  return /* @__PURE__ */ i("div", {
9
9
  ref: f,
10
10
  role: "separator",
11
- "aria-orientation": t,
12
- className: n(e.root, e[t], e[o], p && e.withLabel, p && e[`label_${c}`], l?.root, u),
11
+ "aria-orientation": e,
12
+ className: t(n.root, n[e], n[o], p && n.withLabel, p && n[`label_${c}`], l?.root, u),
13
13
  ...d,
14
14
  children: p ? /* @__PURE__ */ a(r, { children: [
15
- /* @__PURE__ */ i("span", { className: n(e.line, l?.line) }),
15
+ /* @__PURE__ */ i("span", { className: t(n.line, l?.line) }),
16
16
  /* @__PURE__ */ i("span", {
17
- className: n(e.label, l?.label),
17
+ className: t(n.label, l?.label),
18
18
  children: s
19
19
  }),
20
- /* @__PURE__ */ i("span", { className: n(e.line, l?.line) })
20
+ /* @__PURE__ */ i("span", { className: t(n.line, l?.line) })
21
21
  ] }) : null
22
22
  });
23
23
  });
@@ -1,19 +1,19 @@
1
- import e from "./Draggable.module.js";
2
- import { createContext as t, forwardRef as n, useCallback as r, useContext as i, useEffect as a, useRef as o, useState as s } from "react";
3
- import c from "clsx";
1
+ import { createContext as e, forwardRef as t, useCallback as n, useContext as r, useEffect as i, useRef as a, useState as o } from "react";
2
+ import s from "clsx";
3
+ import c from "./Draggable.module.scss.js";
4
4
  import { jsx as l } from "react/jsx-runtime";
5
5
  // src/components/Draggable/Draggable.tsx
6
- var u = t(null), d = n(({ children: t, defaultPosition: n, position: i, axis: d = "both", bounds: f = "viewport", keyboardStep: p = 10, disabled: m = !1, onDragStart: h, onDrag: g, onDragEnd: _, classes: v, className: y, style: b, ...x }, S) => {
7
- let C = o(null), w = i !== void 0, [T, E] = s(n ?? {
6
+ var u = e(null), d = t(({ children: e, defaultPosition: t, position: r, axis: d = "both", bounds: f = "viewport", keyboardStep: p = 10, disabled: m = !1, onDragStart: h, onDrag: g, onDragEnd: _, classes: v, className: y, style: b, ...x }, S) => {
7
+ let C = a(null), w = r !== void 0, [T, E] = o(t ?? {
8
8
  x: 0,
9
9
  y: 0
10
- }), D = w ? i : T, O = o(D);
10
+ }), D = w ? r : T, O = a(D);
11
11
  O.current = D;
12
- let [k, A] = s(!1), j = o(null), M = o(0), [N, P] = s(!1), F = r(() => (M.current += 1, P(!0), () => {
12
+ let [k, A] = o(!1), j = a(null), M = a(0), [N, P] = o(!1), F = n(() => (M.current += 1, P(!0), () => {
13
13
  --M.current, M.current === 0 && P(!1);
14
- }), []), I = r((e) => {
14
+ }), []), I = n((e) => {
15
15
  C.current = e, typeof S == "function" ? S(e) : S && (S.current = e);
16
- }, [S]), L = r((e) => {
16
+ }, [S]), L = n((e) => {
17
17
  let t = C.current?.getBoundingClientRect();
18
18
  return t ? {
19
19
  left: t.left - e.x,
@@ -26,7 +26,7 @@ var u = t(null), d = n(({ children: t, defaultPosition: n, position: i, axis: d
26
26
  width: 0,
27
27
  height: 0
28
28
  };
29
- }, []), R = r((e, t, n) => {
29
+ }, []), R = n((e, t, n) => {
30
30
  if (f === "none" || typeof window > "u") return {
31
31
  x: e,
32
32
  y: t
@@ -41,9 +41,9 @@ var u = t(null), d = n(({ children: t, defaultPosition: n, position: i, axis: d
41
41
  x: Math.min(Math.max(e, Math.min(i, a)), Math.max(i, a)),
42
42
  y: Math.min(Math.max(t, Math.min(o, s)), Math.max(o, s))
43
43
  };
44
- }, [f]), z = r((e) => {
44
+ }, [f]), z = n((e) => {
45
45
  O.current = e, w || E(e), g?.(e);
46
- }, [w, g]), B = r((e) => {
46
+ }, [w, g]), B = n((e) => {
47
47
  if (m || e.button > 0) return;
48
48
  e.preventDefault();
49
49
  let t = O.current;
@@ -58,7 +58,7 @@ var u = t(null), d = n(({ children: t, defaultPosition: n, position: i, axis: d
58
58
  L,
59
59
  h
60
60
  ]);
61
- a(() => {
61
+ i(() => {
62
62
  if (!k) return;
63
63
  let e = (e) => {
64
64
  let t = j.current;
@@ -77,7 +77,7 @@ var u = t(null), d = n(({ children: t, defaultPosition: n, position: i, axis: d
77
77
  R,
78
78
  z,
79
79
  _
80
- ]), a(() => {
80
+ ]), i(() => {
81
81
  if (f === "none" || typeof window > "u") return;
82
82
  let e = () => {
83
83
  if (j.current) return;
@@ -95,7 +95,7 @@ var u = t(null), d = n(({ children: t, defaultPosition: n, position: i, axis: d
95
95
  ]);
96
96
  let V = {
97
97
  startPointerDrag: B,
98
- onHandleKeyDown: r((e) => {
98
+ onHandleKeyDown: n((e) => {
99
99
  if (m) return;
100
100
  let t = {
101
101
  ArrowLeft: [-p, 0],
@@ -128,29 +128,29 @@ var u = t(null), d = n(({ children: t, defaultPosition: n, position: i, axis: d
128
128
  value: V,
129
129
  children: /* @__PURE__ */ l("div", {
130
130
  ref: I,
131
- className: c(e.root, !N && !m && e.surfaceDraggable, k && e.dragging, v?.root, y),
131
+ className: s(c.root, !N && !m && c.surfaceDraggable, k && c.dragging, v?.root, y),
132
132
  style: U,
133
133
  onPointerDown: N ? void 0 : B,
134
134
  ...x,
135
- children: t
135
+ children: e
136
136
  })
137
137
  });
138
138
  });
139
139
  d.displayName = "Draggable";
140
- function f({ children: t, className: n, style: r, ...o }) {
141
- let s = i(u);
142
- if (!s) throw Error("Draggable.Handle must be rendered inside a <Draggable>.");
143
- return a(() => s.registerHandle(), [s.registerHandle]), /* @__PURE__ */ l("div", {
144
- className: c(e.handle, s.disabled && e.handleDisabled, s.dragging && e.handleDragging, s.handleClassName, n),
145
- style: r,
140
+ function f({ children: e, className: t, style: n, ...a }) {
141
+ let o = r(u);
142
+ if (!o) throw Error("Draggable.Handle must be rendered inside a <Draggable>.");
143
+ return i(() => o.registerHandle(), [o.registerHandle]), /* @__PURE__ */ l("div", {
144
+ className: s(c.handle, o.disabled && c.handleDisabled, o.dragging && c.handleDragging, o.handleClassName, t),
145
+ style: n,
146
146
  role: "button",
147
147
  "aria-label": "Drag handle",
148
- "aria-disabled": s.disabled || void 0,
149
- tabIndex: s.disabled ? -1 : 0,
150
- onPointerDown: s.startPointerDrag,
151
- onKeyDown: s.onHandleKeyDown,
152
- ...o,
153
- children: t
148
+ "aria-disabled": o.disabled || void 0,
149
+ tabIndex: o.disabled ? -1 : 0,
150
+ onPointerDown: o.startPointerDrag,
151
+ onKeyDown: o.onHandleKeyDown,
152
+ ...a,
153
+ children: e
154
154
  });
155
155
  }
156
156
  f.displayName = "Draggable.Handle";
@@ -1,26 +1,26 @@
1
- import { useFocusTrap as e } from "../../hooks/useFocusTrap.js";
2
- import { EscapeLayerProvider as t, useEscapeLayer as n } from "../../hooks/useEscapeLayer.js";
3
- import r from "./Drawer.module.js";
4
- import { createContext as i, forwardRef as a, useContext as o, useEffect as s, useId as c, useRef as l, useState as u } from "react";
5
- import d from "clsx";
6
- import { jsx as f, jsxs as p } from "react/jsx-runtime";
7
- import { createPortal as m } from "react-dom";
1
+ import { createContext as e, forwardRef as t, useContext as n, useEffect as r, useId as i, useRef as a, useState as o } from "react";
2
+ import { createPortal as s } from "react-dom";
3
+ import c from "clsx";
4
+ import { useFocusTrap as l } from "../../hooks/useFocusTrap.js";
5
+ import { EscapeLayerProvider as u, useEscapeLayer as d } from "../../hooks/useEscapeLayer.js";
6
+ import f from "./Drawer.module.scss.js";
7
+ import { jsx as p, jsxs as m } from "react/jsx-runtime";
8
8
  // src/components/Drawer/Drawer.tsx
9
- var h = i({
9
+ var h = e({
10
10
  classes: {},
11
11
  titleId: ""
12
- }), g = ({ children: e, className: t, style: n, onClose: i }) => {
13
- let { classes: a, titleId: s } = o(h);
14
- return /* @__PURE__ */ p("div", {
15
- className: d(r.header, i && r.headerWithClose, a.header, t),
16
- style: n,
17
- children: [/* @__PURE__ */ f("div", {
18
- id: s,
19
- className: d(r.headerTitle, a.headerTitle),
12
+ }), g = ({ children: e, className: t, style: r, onClose: i }) => {
13
+ let { classes: a, titleId: o } = n(h);
14
+ return /* @__PURE__ */ m("div", {
15
+ className: c(f.header, i && f.headerWithClose, a.header, t),
16
+ style: r,
17
+ children: [/* @__PURE__ */ p("div", {
18
+ id: o,
19
+ className: c(f.headerTitle, a.headerTitle),
20
20
  children: e
21
- }), i && /* @__PURE__ */ f("button", {
21
+ }), i && /* @__PURE__ */ p("button", {
22
22
  type: "button",
23
- className: d(r.closeButton, a.closeButton),
23
+ className: c(f.closeButton, a.closeButton),
24
24
  onClick: i,
25
25
  "aria-label": "Close",
26
26
  children: "×"
@@ -28,74 +28,74 @@ var h = i({
28
28
  });
29
29
  };
30
30
  g.displayName = "Drawer.Header";
31
- var _ = ({ children: e, className: t, style: n }) => {
32
- let { classes: i } = o(h);
33
- return /* @__PURE__ */ f("div", {
34
- className: d(r.body, i.body, t),
35
- style: n,
31
+ var _ = ({ children: e, className: t, style: r }) => {
32
+ let { classes: i } = n(h);
33
+ return /* @__PURE__ */ p("div", {
34
+ className: c(f.body, i.body, t),
35
+ style: r,
36
36
  children: e
37
37
  });
38
38
  };
39
39
  _.displayName = "Drawer.Body";
40
- var v = ({ children: e, className: t, style: n }) => {
41
- let { classes: i } = o(h);
42
- return /* @__PURE__ */ f("div", {
43
- className: d(r.footer, i.footer, t),
44
- style: n,
40
+ var v = ({ children: e, className: t, style: r }) => {
41
+ let { classes: i } = n(h);
42
+ return /* @__PURE__ */ p("div", {
43
+ className: c(f.footer, i.footer, t),
44
+ style: r,
45
45
  children: e
46
46
  });
47
47
  };
48
48
  v.displayName = "Drawer.Footer";
49
- var y = 340, b = a(({ open: i, onClose: a, side: o = "right", size: p = "md", variant: g = "temporary", closeOnBackdrop: _ = !0, closeOnEscape: v = !0, classes: b, className: x, style: S, children: C, "aria-label": w, "aria-labelledby": T }, E) => {
50
- let D = l(null), O = (e) => {
49
+ var y = 340, b = t(({ open: e, onClose: t, side: n = "right", size: m = "md", variant: g = "temporary", closeOnBackdrop: _ = !0, closeOnEscape: v = !0, classes: b, className: x, style: S, children: C, "aria-label": w, "aria-labelledby": T }, E) => {
50
+ let D = a(null), O = (e) => {
51
51
  D.current = e, typeof E == "function" ? E(e) : E && (E.current = e);
52
- }, k = c(), A = T ?? `${k}-title`, j = g === "temporary", [M, N] = u(i), [P, F] = u(!1), [I, L] = u(o), [R, z] = u(p);
53
- s(() => {
54
- i && (N(!0), F(!1), L(o), z(p));
52
+ }, k = i(), A = T ?? `${k}-title`, j = g === "temporary", [M, N] = o(e), [P, F] = o(!1), [I, L] = o(n), [R, z] = o(m);
53
+ r(() => {
54
+ e && (N(!0), F(!1), L(n), z(m));
55
55
  }, [
56
- i,
57
- o,
58
- p
59
- ]), s(() => {
60
- if (i || !M) return;
56
+ e,
57
+ n,
58
+ m
59
+ ]), r(() => {
60
+ if (e || !M) return;
61
61
  F(!0);
62
- let e = setTimeout(() => N(!1), y);
63
- return () => clearTimeout(e);
64
- }, [i, M]), e(D, M && i && j);
65
- let B = n(() => {
66
- v && a();
67
- }, i);
68
- s(() => {
62
+ let t = setTimeout(() => N(!1), y);
63
+ return () => clearTimeout(t);
64
+ }, [e, M]), l(D, M && e && j);
65
+ let B = d(() => {
66
+ v && t();
67
+ }, e);
68
+ r(() => {
69
69
  if (!M) return;
70
70
  let e = document.body.style.overflow;
71
71
  return document.body.style.overflow = "hidden", () => {
72
72
  document.body.style.overflow = e;
73
73
  };
74
74
  }, [M]);
75
- let V = l(!1);
76
- return M ? m(/* @__PURE__ */ f("div", {
77
- className: d(r.backdrop, P && r.backdropClosing, !j && r.backdropBare, b?.backdrop),
75
+ let V = a(!1);
76
+ return M ? s(/* @__PURE__ */ p("div", {
77
+ className: c(f.backdrop, P && f.backdropClosing, !j && f.backdropBare, b?.backdrop),
78
78
  onMouseDown: (e) => {
79
79
  V.current = e.target === e.currentTarget;
80
80
  },
81
81
  onMouseUp: (e) => {
82
- _ && V.current && e.target === e.currentTarget && a(), V.current = !1;
82
+ _ && V.current && e.target === e.currentTarget && t(), V.current = !1;
83
83
  },
84
84
  role: "presentation",
85
- children: /* @__PURE__ */ f("div", {
85
+ children: /* @__PURE__ */ p("div", {
86
86
  ref: O,
87
- className: d(r.drawer, r[`side_${I}`], r[`size_${R}`], r[`${P ? "slideOut" : "slideIn"}_${I}`], b?.drawer, x),
87
+ className: c(f.drawer, f[`side_${I}`], f[`size_${R}`], f[`${P ? "slideOut" : "slideIn"}_${I}`], b?.drawer, x),
88
88
  style: S,
89
89
  role: "dialog",
90
90
  "aria-modal": j ? "true" : void 0,
91
91
  "aria-label": w,
92
92
  "aria-labelledby": w ? void 0 : A,
93
- children: /* @__PURE__ */ f(h.Provider, {
93
+ children: /* @__PURE__ */ p(h.Provider, {
94
94
  value: {
95
95
  classes: b ?? {},
96
96
  titleId: A
97
97
  },
98
- children: /* @__PURE__ */ f(t, {
98
+ children: /* @__PURE__ */ p(u, {
99
99
  value: B,
100
100
  children: C
101
101
  })