@overdoser/react-toolkit 0.21.0 → 0.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (161) hide show
  1. package/AGENTS.md +1 -0
  2. package/CHANGELOG.md +27 -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
@@ -69,7 +69,7 @@ function e(e, t) {
69
69
  }
70
70
  return r;
71
71
  }, m = (e, t) => {
72
- let r = g[e], i = F[w[e].side], a = Infinity;
72
+ let r = g[e], i = F[w[e].side], a = 1e400;
73
73
  for (let t of i) t.i !== e && t.lv === w[e].dlv && t.p > r && (a = Math.min(a, t.p - 8));
74
74
  let o = (t) => !i.some((n) => n.i !== e && n.lv > w[e].dlv && Math.abs(n.p - t) < 8) && !n.stems.some((e) => Math.abs(e.x - t) < 4), s = Math.min(Math.max(t, r + 8), a);
75
75
  for (let e = s; e <= a && e <= s + 80; e++) if (o(e)) return e;
@@ -79,7 +79,7 @@ function e(e, t) {
79
79
  let n = g[e];
80
80
  return F[w[e].side].some((r) => r.i !== e && (r.lv > w[e].dlv && Math.abs(r.p - t) < 8 || r.lv === w[e].dlv && r.p > n && r.p < t + 8));
81
81
  }, _ = (e, t, n) => {
82
- let r = g[e], i = F[w[e].side], a = Infinity;
82
+ let r = g[e], i = F[w[e].side], a = 1e400;
83
83
  for (let t of i) t.i !== e && t.lv === w[e].dlv && t.p > r && (a = Math.min(a, t.p - 28));
84
84
  let o = (t) => !i.some((n) => n.i !== e && n.lv > w[e].dlv && Math.abs(n.p - (t + 20)) < 8), s = p(t, n), c = 0;
85
85
  for (; !o(s) && s < a && c++ < 40;) s = p(t, s + 4);
@@ -1,6 +1,6 @@
1
- import e from "./Timer.module.js";
2
- import { Fragment as t, forwardRef as n, useCallback as r, useEffect as i, useImperativeHandle as a, useRef as o, useState as s } from "react";
3
- import c from "clsx";
1
+ import { Fragment as e, forwardRef as t, useCallback as n, useEffect as r, useImperativeHandle as i, useRef as a, useState as o } from "react";
2
+ import s from "clsx";
3
+ import c from "./Timer.module.scss.js";
4
4
  import { jsx as l, jsxs as u } from "react/jsx-runtime";
5
5
  // src/components/Timer/Timer.tsx
6
6
  var d = () => Date.now();
@@ -55,34 +55,34 @@ function ne(e, t, n, r) {
55
55
  };
56
56
  });
57
57
  }
58
- var g = n(({ mode: n = "countdown", duration: f, to: p, value: m, autoStart: h = !0, running: g, interval: _ = 1e3, variant: v = "digital", size: re = "md", format: ie = ee, units: ae, unitFormat: oe = "short", unitLabels: se, segmentVariant: ce = "boxed", renderSegment: y, segmentSeparator: b, label: x, labelPlacement: S = "bottom", onComplete: C, onTick: w, classes: T, className: le, style: ue, "aria-label": de }, fe) => {
59
- let E = m !== void 0, D = p !== void 0, O = D ? p instanceof Date ? p.getTime() : p : 0, k = (f ?? 0) * 1e3, [, A] = s(0), [j, M] = s(!1), N = o(null), P = o(!1), F = o(0), I = o(!1), L = o(null), R = o(C), z = o(w);
58
+ var g = t(({ mode: t = "countdown", duration: f, to: p, value: m, autoStart: h = !0, running: g, interval: _ = 1e3, variant: v = "digital", size: re = "md", format: ie = ee, units: ae, unitFormat: oe = "short", unitLabels: se, segmentVariant: ce = "boxed", renderSegment: y, segmentSeparator: b, label: x, labelPlacement: S = "bottom", onComplete: C, onTick: w, classes: T, className: le, style: ue, "aria-label": de }, fe) => {
59
+ let E = m !== void 0, D = p !== void 0, O = D ? p instanceof Date ? p.getTime() : p : 0, k = (f ?? 0) * 1e3, [, A] = o(0), [j, M] = o(!1), N = a(null), P = a(!1), F = a(0), I = a(!1), L = a(null), R = a(C), z = a(w);
60
60
  R.current = C, z.current = w;
61
- let B = r(() => F.current + (N.current == null ? 0 : d() - N.current), []), V = r(() => {
61
+ let B = n(() => F.current + (N.current == null ? 0 : d() - N.current), []), V = n(() => {
62
62
  if (E) return m;
63
63
  if (D) return Math.max(0, (O - d()) / 1e3);
64
64
  let e = B();
65
- return n === "countdown" ? Math.max(0, (k - e) / 1e3) : e / 1e3;
65
+ return t === "countdown" ? Math.max(0, (k - e) / 1e3) : e / 1e3;
66
66
  }, [
67
67
  E,
68
68
  m,
69
69
  D,
70
70
  O,
71
71
  B,
72
- n,
72
+ t,
73
73
  k
74
- ]), H = r(() => {
74
+ ]), H = n(() => {
75
75
  L.current &&= (clearInterval(L.current), null);
76
- }, []), U = r(() => {
76
+ }, []), U = n(() => {
77
77
  N.current != null && (F.current += d() - N.current, N.current = null), H(), M(!1);
78
- }, [H]), W = r(() => {
78
+ }, [H]), W = n(() => {
79
79
  E || (N.current ??= d(), I.current = !1, M(!0));
80
- }, [E]), G = r(() => U(), [U]), K = r(() => {
80
+ }, [E]), G = n(() => U(), [U]), K = n(() => {
81
81
  H(), N.current = null, F.current = 0, I.current = !1, M(!1), A((e) => e + 1);
82
- }, [H]), q = r(() => {
82
+ }, [H]), q = n(() => {
83
83
  F.current = 0, I.current = !1, N.current = d(), M(!0);
84
84
  }, []);
85
- i(() => {
85
+ r(() => {
86
86
  P.current || (P.current = !0, h && g === void 0 && !E && !D && W());
87
87
  }, [
88
88
  h,
@@ -90,26 +90,26 @@ var g = n(({ mode: n = "countdown", duration: f, to: p, value: m, autoStart: h =
90
90
  E,
91
91
  D,
92
92
  W
93
- ]), i(() => E || !(D || j) ? void 0 : (L.current = setInterval(() => {
93
+ ]), r(() => E || !(D || j) ? void 0 : (L.current = setInterval(() => {
94
94
  let e = V();
95
- z.current?.(e), A((e) => e + 1), (n === "countdown" || D) && e <= 0 && !I.current && (I.current = !0, R.current?.(), D || U());
95
+ z.current?.(e), A((e) => e + 1), (t === "countdown" || D) && e <= 0 && !I.current && (I.current = !0, R.current?.(), D || U());
96
96
  }, _), H), [
97
97
  j,
98
98
  D,
99
99
  E,
100
100
  _,
101
- n,
101
+ t,
102
102
  V,
103
103
  U,
104
104
  H
105
- ]), i(() => {
105
+ ]), r(() => {
106
106
  g === void 0 || E || (g ? W() : G());
107
107
  }, [
108
108
  g,
109
109
  E,
110
110
  W,
111
111
  G
112
- ]), a(fe, () => ({
112
+ ]), i(fe, () => ({
113
113
  start: W,
114
114
  pause: G,
115
115
  reset: K,
@@ -126,14 +126,14 @@ var g = n(({ mode: n = "countdown", duration: f, to: p, value: m, autoStart: h =
126
126
  V,
127
127
  j
128
128
  ]);
129
- let J = V(), Y = n === "countdown" || D ? Math.ceil(J) : Math.floor(J), X = ie(Y), Z = D ? 0 : k / 1e3, Q = 0;
130
- Z > 0 && (Q = n === "countdown" ? J / Z : Math.min(1, J / Z)), Q = Math.max(0, Math.min(1, Q));
129
+ let J = V(), Y = t === "countdown" || D ? Math.ceil(J) : Math.floor(J), X = ie(Y), Z = D ? 0 : k / 1e3, Q = 0;
130
+ Z > 0 && (Q = t === "countdown" ? J / Z : Math.min(1, J / Z)), Q = Math.max(0, Math.min(1, Q));
131
131
  let pe = ne(Y, ae ?? te(Math.max(Y, f ?? 0)), oe, se), $ = S === "top" || S === "left", me = x != null && /* @__PURE__ */ l("span", {
132
- className: c(e.label, T?.label),
132
+ className: s(c.label, T?.label),
133
133
  children: x
134
134
  });
135
135
  return /* @__PURE__ */ u("div", {
136
- className: c(e.root, e[re], e[`label_${S}`], T?.root, le),
136
+ className: s(c.root, c[re], c[`label_${S}`], T?.root, le),
137
137
  style: ue,
138
138
  role: "timer",
139
139
  "aria-label": de,
@@ -141,18 +141,18 @@ var g = n(({ mode: n = "countdown", duration: f, to: p, value: m, autoStart: h =
141
141
  children: [
142
142
  $ && me,
143
143
  v === "ring" ? /* @__PURE__ */ u("span", {
144
- className: e.ringWrap,
144
+ className: c.ringWrap,
145
145
  children: [/* @__PURE__ */ u("svg", {
146
146
  viewBox: "0 0 100 100",
147
- className: e.ring,
147
+ className: c.ring,
148
148
  "aria-hidden": "true",
149
149
  children: [/* @__PURE__ */ l("circle", {
150
- className: c(e.ringTrack, T?.ringTrack),
150
+ className: s(c.ringTrack, T?.ringTrack),
151
151
  cx: "50",
152
152
  cy: "50",
153
153
  r: "44"
154
154
  }), /* @__PURE__ */ l("circle", {
155
- className: c(e.ringProgress, T?.ringProgress),
155
+ className: s(c.ringProgress, T?.ringProgress),
156
156
  cx: "50",
157
157
  cy: "50",
158
158
  r: "44",
@@ -162,27 +162,27 @@ var g = n(({ mode: n = "countdown", duration: f, to: p, value: m, autoStart: h =
162
162
  }
163
163
  })]
164
164
  }), /* @__PURE__ */ l("span", {
165
- className: c(e.display, e.ringDisplay, T?.display),
165
+ className: s(c.display, c.ringDisplay, T?.display),
166
166
  children: X
167
167
  })]
168
168
  }) : v === "segments" ? /* @__PURE__ */ l("span", {
169
- className: c(e.segments, T?.segments),
170
- children: pe.map((n, r) => /* @__PURE__ */ u(t, { children: [r > 0 && b != null && /* @__PURE__ */ l("span", {
171
- className: e.segmentSep,
169
+ className: s(c.segments, T?.segments),
170
+ children: pe.map((t, n) => /* @__PURE__ */ u(e, { children: [n > 0 && b != null && /* @__PURE__ */ l("span", {
171
+ className: c.segmentSep,
172
172
  "aria-hidden": "true",
173
173
  children: b
174
- }), y ? y(n, r) : /* @__PURE__ */ u("span", {
175
- className: c(e.segment, ce === "boxed" ? e.segmentBoxed : e.segmentPlain, T?.segment),
174
+ }), y ? y(t, n) : /* @__PURE__ */ u("span", {
175
+ className: s(c.segment, ce === "boxed" ? c.segmentBoxed : c.segmentPlain, T?.segment),
176
176
  children: [/* @__PURE__ */ l("span", {
177
- className: c(e.segmentValue, T?.segmentValue),
178
- children: n.text
177
+ className: s(c.segmentValue, T?.segmentValue),
178
+ children: t.text
179
179
  }), /* @__PURE__ */ l("span", {
180
- className: c(e.segmentLabel, T?.segmentLabel),
181
- children: n.label
180
+ className: s(c.segmentLabel, T?.segmentLabel),
181
+ children: t.label
182
182
  })]
183
- })] }, n.unit))
183
+ })] }, t.unit))
184
184
  }) : /* @__PURE__ */ l("span", {
185
- className: c(e.display, T?.display),
185
+ className: s(c.display, T?.display),
186
186
  children: X
187
187
  }),
188
188
  !$ && me
@@ -1,130 +1,130 @@
1
- import e from "./Toast.module.js";
2
- import { addToast as t, configureToasts as n, dismissAllToasts as r, dismissToast as i, getServerToasts as a, getToasts as o, registerProvider as s, subscribeToasts as c } from "./toastStore.js";
3
- import { useCallback as l, useEffect as u, useRef as d, useState as f, useSyncExternalStore as p } from "react";
4
- import m from "clsx";
5
- import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
6
- import { createPortal as v } from "react-dom";
1
+ import { useCallback as e, useEffect as t, useRef as n, useState as r, useSyncExternalStore as i } from "react";
2
+ import { createPortal as a } from "react-dom";
3
+ import o from "clsx";
4
+ import s from "./Toast.module.scss.js";
5
+ import { addToast as c, configureToasts as l, dismissAllToasts as u, dismissToast as d, getServerToasts as f, getToasts as p, registerProvider as m, subscribeToasts as h } from "./toastStore.js";
6
+ import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
7
7
  // src/components/Toast/Toast.tsx
8
- var y = Object.assign((e) => t(e), {
9
- dismiss: i,
10
- dismissAll: r
8
+ var y = Object.assign((e) => c(e), {
9
+ dismiss: d,
10
+ dismissAll: u
11
11
  });
12
12
  function b() {
13
13
  return {
14
14
  toast: y,
15
- dismiss: i,
16
- dismissAll: r
15
+ dismiss: d,
16
+ dismissAll: u
17
17
  };
18
18
  }
19
- function x({ children: t, position: r = "top-right", duration: l = 5e3, max: d = 5, classes: y }) {
20
- let b = p(c, o, a), x = r.startsWith("top"), [S, w] = f(!1);
21
- u(() => w(!0), []), u(() => {
22
- n({
23
- duration: l,
24
- max: d
19
+ function x({ children: e, position: n = "top-right", duration: c = 5e3, max: u = 5, classes: y }) {
20
+ let b = i(h, p, f), x = n.startsWith("top"), [S, w] = r(!1);
21
+ t(() => w(!0), []), t(() => {
22
+ l({
23
+ duration: c,
24
+ max: u
25
25
  });
26
- }, [l, d]), u(() => s(), []);
27
- let T = x ? [...b].reverse() : b, E = S && typeof document < "u" ? v(/* @__PURE__ */ g("div", {
28
- className: m(e.viewport, e[`pos_${r}`], y?.viewport),
26
+ }, [c, u]), t(() => m(), []);
27
+ let T = x ? [...b].reverse() : b, E = S && typeof document < "u" ? a(/* @__PURE__ */ _("div", {
28
+ className: o(s.viewport, s[`pos_${n}`], y?.viewport),
29
29
  role: "region",
30
30
  "aria-label": "Notifications",
31
- children: T.map((e) => /* @__PURE__ */ g(C, {
31
+ children: T.map((e) => /* @__PURE__ */ _(C, {
32
32
  record: e,
33
33
  exiting: e.exiting,
34
34
  isTop: x,
35
- onDismiss: i,
35
+ onDismiss: d,
36
36
  classes: y
37
37
  }, e.id))
38
38
  }), document.body) : null;
39
- return /* @__PURE__ */ _(h, { children: [t, E] });
39
+ return /* @__PURE__ */ v(g, { children: [e, E] });
40
40
  }
41
41
  var S = {
42
42
  neutral: null,
43
- info: /* @__PURE__ */ g("svg", {
43
+ info: /* @__PURE__ */ _("svg", {
44
44
  viewBox: "0 0 20 20",
45
45
  fill: "currentColor",
46
46
  "aria-hidden": "true",
47
- children: /* @__PURE__ */ g("path", {
47
+ children: /* @__PURE__ */ _("path", {
48
48
  fillRule: "evenodd",
49
49
  d: "M10 18a8 8 0 100-16 8 8 0 000 16zM9 9a1 1 0 012 0v4a1 1 0 11-2 0V9zm1-4a1 1 0 100 2 1 1 0 000-2z",
50
50
  clipRule: "evenodd"
51
51
  })
52
52
  }),
53
- success: /* @__PURE__ */ g("svg", {
53
+ success: /* @__PURE__ */ _("svg", {
54
54
  viewBox: "0 0 20 20",
55
55
  fill: "currentColor",
56
56
  "aria-hidden": "true",
57
- children: /* @__PURE__ */ g("path", {
57
+ children: /* @__PURE__ */ _("path", {
58
58
  fillRule: "evenodd",
59
59
  d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.7-9.3a1 1 0 00-1.4-1.4L9 10.6 7.7 9.3a1 1 0 00-1.4 1.4l2 2a1 1 0 001.4 0l4-4z",
60
60
  clipRule: "evenodd"
61
61
  })
62
62
  }),
63
- warning: /* @__PURE__ */ g("svg", {
63
+ warning: /* @__PURE__ */ _("svg", {
64
64
  viewBox: "0 0 20 20",
65
65
  fill: "currentColor",
66
66
  "aria-hidden": "true",
67
- children: /* @__PURE__ */ g("path", {
67
+ children: /* @__PURE__ */ _("path", {
68
68
  fillRule: "evenodd",
69
69
  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",
70
70
  clipRule: "evenodd"
71
71
  })
72
72
  }),
73
- danger: /* @__PURE__ */ g("svg", {
73
+ danger: /* @__PURE__ */ _("svg", {
74
74
  viewBox: "0 0 20 20",
75
75
  fill: "currentColor",
76
76
  "aria-hidden": "true",
77
- children: /* @__PURE__ */ g("path", {
77
+ children: /* @__PURE__ */ _("path", {
78
78
  fillRule: "evenodd",
79
79
  d: "M10 18a8 8 0 100-16 8 8 0 000 16zM8.7 7.3a1 1 0 00-1.4 1.4L8.6 10l-1.3 1.3a1 1 0 101.4 1.4L10 11.4l1.3 1.3a1 1 0 001.4-1.4L11.4 10l1.3-1.3a1 1 0 00-1.4-1.4L10 8.6 8.7 7.3z",
80
80
  clipRule: "evenodd"
81
81
  })
82
82
  })
83
83
  };
84
- function C({ record: t, exiting: n, isTop: r, onDismiss: i, classes: a }) {
85
- let { id: o, variant: s, title: c, description: f, duration: p = 0 } = t, h = d(null), v = l(() => {
86
- p && Number.isFinite(p) && (h.current = setTimeout(() => i(o), p));
84
+ function C({ record: r, exiting: i, isTop: a, onDismiss: c, classes: l }) {
85
+ let { id: u, variant: d, title: f, description: p, duration: m = 0 } = r, h = n(null), g = e(() => {
86
+ m && Number.isFinite(m) && (h.current = setTimeout(() => c(u), m));
87
87
  }, [
88
- p,
89
- o,
90
- i
91
- ]), y = l(() => {
88
+ m,
89
+ u,
90
+ c
91
+ ]), y = e(() => {
92
92
  h.current &&= (clearTimeout(h.current), null);
93
93
  }, []);
94
- u(() => (v(), y), [v, y]);
95
- let b = S[s];
96
- return /* @__PURE__ */ _("div", {
97
- className: m(e.toast, e[s], r ? e.fromTop : e.fromBottom, n && e.leaving, a?.toast),
98
- role: s === "danger" || s === "warning" ? "alert" : "status",
99
- "aria-live": s === "danger" || s === "warning" ? "assertive" : "polite",
94
+ t(() => (g(), y), [g, y]);
95
+ let b = S[d];
96
+ return /* @__PURE__ */ v("div", {
97
+ className: o(s.toast, s[d], a ? s.fromTop : s.fromBottom, i && s.leaving, l?.toast),
98
+ role: d === "danger" || d === "warning" ? "alert" : "status",
99
+ "aria-live": d === "danger" || d === "warning" ? "assertive" : "polite",
100
100
  onMouseEnter: y,
101
- onMouseLeave: v,
101
+ onMouseLeave: g,
102
102
  children: [
103
- b && /* @__PURE__ */ g("span", {
104
- className: m(e.icon, a?.icon),
103
+ b && /* @__PURE__ */ _("span", {
104
+ className: o(s.icon, l?.icon),
105
105
  "aria-hidden": "true",
106
106
  children: b
107
107
  }),
108
- /* @__PURE__ */ _("div", {
109
- className: m(e.content, a?.content),
110
- children: [c != null && /* @__PURE__ */ g("div", {
111
- className: m(e.title, a?.title),
112
- children: c
113
- }), f != null && /* @__PURE__ */ g("div", {
114
- className: m(e.description, a?.description),
108
+ /* @__PURE__ */ v("div", {
109
+ className: o(s.content, l?.content),
110
+ children: [f != null && /* @__PURE__ */ _("div", {
111
+ className: o(s.title, l?.title),
115
112
  children: f
113
+ }), p != null && /* @__PURE__ */ _("div", {
114
+ className: o(s.description, l?.description),
115
+ children: p
116
116
  })]
117
117
  }),
118
- /* @__PURE__ */ g("button", {
118
+ /* @__PURE__ */ _("button", {
119
119
  type: "button",
120
- className: m(e.close, a?.close),
121
- onClick: () => i(o),
120
+ className: o(s.close, l?.close),
121
+ onClick: () => c(u),
122
122
  "aria-label": "Dismiss notification",
123
- children: /* @__PURE__ */ g("svg", {
123
+ children: /* @__PURE__ */ _("svg", {
124
124
  viewBox: "0 0 20 20",
125
125
  fill: "currentColor",
126
126
  "aria-hidden": "true",
127
- children: /* @__PURE__ */ g("path", { d: "M6.3 6.3a1 1 0 011.4 0L10 8.6l2.3-2.3a1 1 0 111.4 1.4L11.4 10l2.3 2.3a1 1 0 01-1.4 1.4L10 11.4l-2.3 2.3a1 1 0 01-1.4-1.4L8.6 10 6.3 7.7a1 1 0 010-1.4z" })
127
+ children: /* @__PURE__ */ _("path", { d: "M6.3 6.3a1 1 0 011.4 0L10 8.6l2.3-2.3a1 1 0 111.4 1.4L11.4 10l2.3 2.3a1 1 0 01-1.4 1.4L10 11.4l-2.3 2.3a1 1 0 01-1.4-1.4L8.6 10 6.3 7.7a1 1 0 010-1.4z" })
128
128
  })
129
129
  })
130
130
  ]
@@ -1,10 +1,10 @@
1
- import e from "./ToggleIconButton.module.js";
2
- import { forwardRef as t, useState as n } from "react";
3
- import r from "clsx";
1
+ import { forwardRef as e, useState as t } from "react";
2
+ import n from "clsx";
3
+ import r from "./ToggleIconButton.module.scss.js";
4
4
  import { jsx as i, jsxs as a } from "react/jsx-runtime";
5
5
  // src/components/ToggleIconButton/ToggleIconButton.tsx
6
- var o = t(({ icon: t, pressed: o, defaultPressed: s = !1, onPressedChange: c, activeColor: l, burst: u = !1, variant: d = "secondary", size: f = "md", speed: p = 1, classes: m, className: h, style: g, disabled: _, onClick: v, ...y }, b) => {
7
- let [x, S] = n(s), [C, w] = n(!1), T = o !== void 0, E = T ? o : x, D = (e) => {
6
+ var o = e(({ icon: e, pressed: o, defaultPressed: s = !1, onPressedChange: c, activeColor: l, burst: u = !1, variant: d = "secondary", size: f = "md", speed: p = 1, classes: m, className: h, style: g, disabled: _, onClick: v, ...y }, b) => {
7
+ let [x, S] = t(s), [C, w] = t(!1), T = o !== void 0, E = T ? o : x, D = (e) => {
8
8
  if (v?.(e), _ || e.defaultPrevented) return;
9
9
  let t = !E;
10
10
  T || S(t), w(!0), c?.(t);
@@ -14,7 +14,7 @@ var o = t(({ icon: t, pressed: o, defaultPressed: s = !1, onPressedChange: c, ac
14
14
  type: "button",
15
15
  "aria-pressed": E,
16
16
  "data-pressed": E || void 0,
17
- className: r(e.root, e[d], e[f], E && C && e.animate, m?.root, h),
17
+ className: n(r.root, r[d], r[f], E && C && r.animate, m?.root, h),
18
18
  style: Object.keys(O).length > 0 ? {
19
19
  ...g,
20
20
  ...O
@@ -23,12 +23,12 @@ var o = t(({ icon: t, pressed: o, defaultPressed: s = !1, onPressedChange: c, ac
23
23
  onClick: D,
24
24
  ...y,
25
25
  children: [u && /* @__PURE__ */ i("span", {
26
- className: r(e.burst, m?.burst),
26
+ className: n(r.burst, m?.burst),
27
27
  "aria-hidden": "true"
28
28
  }), /* @__PURE__ */ i("span", {
29
- className: r(e.icon, m?.icon),
29
+ className: n(r.icon, m?.icon),
30
30
  "aria-hidden": "true",
31
- children: t
31
+ children: e
32
32
  })]
33
33
  });
34
34
  });
@@ -1,27 +1,27 @@
1
- import e from "./Tooltip.module.js";
2
- import { useCallback as t, useEffect as n, useId as r, useLayoutEffect as i, useRef as a, useState as o } from "react";
1
+ import { useCallback as e, useEffect as t, useId as n, useLayoutEffect as r, useRef as i, useState as a } from "react";
2
+ import { createPortal as o } from "react-dom";
3
3
  import s from "clsx";
4
- import { jsx as c, jsxs as l } from "react/jsx-runtime";
5
- import { createPortal as u } from "react-dom";
4
+ import c from "./Tooltip.module.scss.js";
5
+ import { jsx as l, jsxs as u } from "react/jsx-runtime";
6
6
  // src/components/Tooltip/Tooltip.tsx
7
7
  var d = 8;
8
8
  function f({ content: f, children: p, placement: m = "top", delay: h = 300, closeDelay: g = 0, disabled: _ = !1, hideArrow: v = !1, classes: y }) {
9
- let b = a(null), x = a(null), S = a(null), [C, w] = o(!1), [T, E] = o(m), [D, O] = o({
9
+ let b = i(null), x = i(null), S = i(null), [C, w] = a(!1), [T, E] = a(m), [D, O] = a({
10
10
  top: 0,
11
11
  left: 0
12
- }), k = r(), A = t(() => {
12
+ }), k = n(), A = e(() => {
13
13
  S.current &&= (clearTimeout(S.current), null);
14
- }, []), j = t(() => {
14
+ }, []), j = e(() => {
15
15
  _ || f == null || f === "" || (A(), S.current = setTimeout(() => w(!0), h));
16
16
  }, [
17
17
  _,
18
18
  f,
19
19
  A,
20
20
  h
21
- ]), M = t(() => {
21
+ ]), M = e(() => {
22
22
  A(), g > 0 ? S.current = setTimeout(() => w(!1), g) : w(!1);
23
23
  }, [A, g]);
24
- n(() => A, [A]), i(() => {
24
+ t(() => A, [A]), r(() => {
25
25
  if (!C) return;
26
26
  let e = () => {
27
27
  let e = b.current, t = x.current;
@@ -40,7 +40,7 @@ function f({ content: f, children: p, placement: m = "top", delay: h = 300, clos
40
40
  if (e(), typeof window < "u") return window.addEventListener("scroll", e, !0), window.addEventListener("resize", e), () => {
41
41
  window.removeEventListener("scroll", e, !0), window.removeEventListener("resize", e);
42
42
  };
43
- }, [C, m]), n(() => {
43
+ }, [C, m]), t(() => {
44
44
  if (!C) return;
45
45
  let e = (e) => {
46
46
  e.key === "Escape" && w(!1);
@@ -52,22 +52,22 @@ function f({ content: f, children: p, placement: m = "top", delay: h = 300, clos
52
52
  top: D.top,
53
53
  left: D.left
54
54
  };
55
- return /* @__PURE__ */ l("span", {
55
+ return /* @__PURE__ */ u("span", {
56
56
  ref: b,
57
- className: s(e.wrapper, y?.wrapper),
57
+ className: s(c.wrapper, y?.wrapper),
58
58
  onMouseEnter: j,
59
59
  onMouseLeave: M,
60
60
  onFocus: j,
61
61
  onBlur: M,
62
62
  "aria-describedby": N,
63
- children: [p, C && typeof document < "u" && u(/* @__PURE__ */ l("div", {
63
+ children: [p, C && typeof document < "u" && o(/* @__PURE__ */ u("div", {
64
64
  ref: x,
65
65
  id: k,
66
66
  role: "tooltip",
67
- className: s(e.tooltip, e[`p_${T}`], y?.tooltip),
67
+ className: s(c.tooltip, c[`p_${T}`], y?.tooltip),
68
68
  style: P,
69
- children: [f, !v && /* @__PURE__ */ c("span", {
70
- className: s(e.arrow, y?.arrow),
69
+ children: [f, !v && /* @__PURE__ */ l("span", {
70
+ className: s(c.arrow, y?.arrow),
71
71
  "aria-hidden": "true"
72
72
  })]
73
73
  }), document.body)]
@@ -1,10 +1,10 @@
1
- import e from "./Typography.module.js";
2
- import { createElement as t, forwardRef as n } from "react";
3
- import r from "clsx";
1
+ import { createElement as e, forwardRef as t } from "react";
2
+ import n from "clsx";
3
+ import r from "./Typography.module.scss.js";
4
4
  // src/components/Typography/Typography.tsx
5
- var i = n(({ variant: n = "p", weight: i, color: a, align: o, truncate: s = !1, className: c, style: l, children: u, ...d }, f) => t(n, {
5
+ var i = t(({ variant: t = "p", weight: i, color: a, align: o, truncate: s = !1, className: c, style: l, children: u, ...d }, f) => e(t, {
6
6
  ref: f,
7
- className: r(e.root, e[n], i && e[i], a && e[a], o && e[`align-${o}`], s && e.truncate, c),
7
+ className: n(r.root, r[t], i && r[i], a && r[a], o && r[`align-${o}`], s && r.truncate, c),
8
8
  style: l,
9
9
  ...d
10
10
  }, u));
@@ -1,25 +1,25 @@
1
- import e from "./Checkbox.module.js";
2
- import { forwardRef as t, useEffect as n, useRef as r } from "react";
3
- import i from "clsx";
1
+ import { forwardRef as e, useEffect as t, useRef as n } from "react";
2
+ import r from "clsx";
3
+ import i from "./Checkbox.module.scss.js";
4
4
  import { jsx as a, jsxs as o } from "react/jsx-runtime";
5
5
  // src/components/inputs/Checkbox/Checkbox.tsx
6
- var s = t(({ label: t, variant: s = "checkbox", indeterminate: c = !1, error: l = !1, classes: u, className: d, style: f, ...p }, m) => {
7
- let h = r(null), g = s === "switch", _ = c && !g;
8
- return n(() => {
6
+ var s = e(({ label: e, variant: s = "checkbox", indeterminate: c = !1, error: l = !1, classes: u, className: d, style: f, ...p }, m) => {
7
+ let h = n(null), g = s === "switch", _ = c && !g;
8
+ return t(() => {
9
9
  h.current && (h.current.indeterminate = _);
10
10
  }, [_]), /* @__PURE__ */ o("label", {
11
- className: i(e.root, g && e.switchRoot, _ && e.indeterminate, u?.root, d),
11
+ className: r(i.root, g && i.switchRoot, _ && i.indeterminate, u?.root, d),
12
12
  style: f,
13
13
  children: [/* @__PURE__ */ a("input", {
14
14
  ref: (e) => {
15
15
  h.current = e, typeof m == "function" ? m(e) : m && (m.current = e);
16
16
  },
17
17
  type: "checkbox",
18
- className: i(e.input, g && e.switchInput, l && e.error, u?.input),
18
+ className: r(i.input, g && i.switchInput, l && i.error, u?.input),
19
19
  ...p
20
- }), t && /* @__PURE__ */ a("span", {
21
- className: i(e.label, u?.label),
22
- children: t
20
+ }), e && /* @__PURE__ */ a("span", {
21
+ className: r(i.label, u?.label),
22
+ children: e
23
23
  })]
24
24
  });
25
25
  });
@@ -1,14 +1,14 @@
1
- import { Checkbox as e } from "./Checkbox.js";
2
- import t from "./CheckboxGroup.module.js";
3
- import { forwardRef as n } from "react";
4
- import r from "clsx";
1
+ import { forwardRef as e } from "react";
2
+ import t from "clsx";
3
+ import { Checkbox as n } from "./Checkbox.js";
4
+ import r from "./CheckboxGroup.module.scss.js";
5
5
  import { jsx as i, jsxs as a } from "react/jsx-runtime";
6
6
  // src/components/inputs/Checkbox/CheckboxGroup.tsx
7
- var o = n(({ options: n, value: o = [], onChange: s, variant: c = "checkbox", chipShape: l = "pill", chipCheckmark: u = !0, orientation: d, disabled: f = !1, error: p = !1, name: m, classes: h, className: g, style: _, id: v, "aria-label": y, "aria-labelledby": b, "aria-describedby": x, "aria-invalid": S, required: C }, w) => {
7
+ var o = e(({ options: e, value: o = [], onChange: s, variant: c = "checkbox", chipShape: l = "pill", chipCheckmark: u = !0, orientation: d, disabled: f = !1, error: p = !1, name: m, classes: h, className: g, style: _, id: v, "aria-label": y, "aria-labelledby": b, "aria-describedby": x, "aria-invalid": S, required: C }, w) => {
8
8
  let T = d ?? (c === "chips" ? "horizontal" : "vertical"), E = {
9
- pill: t.chipPill,
10
- rounded: t.chipRounded,
11
- square: t.chipSquare
9
+ pill: r.chipPill,
10
+ rounded: r.chipRounded,
11
+ square: r.chipSquare
12
12
  }[l], D = (e) => {
13
13
  let t = o.includes(e) ? o.filter((t) => t !== e) : [...o, e];
14
14
  s?.(t);
@@ -22,30 +22,30 @@ var o = n(({ options: n, value: o = [], onChange: s, variant: c = "checkbox", ch
22
22
  "aria-describedby": x,
23
23
  "aria-invalid": S,
24
24
  "aria-required": C || void 0,
25
- className: r(t.group, t[T], c === "chips" && t.chipsGroup, p && t.error, h?.group, g),
25
+ className: t(r.group, r[T], c === "chips" && r.chipsGroup, p && r.error, h?.group, g),
26
26
  style: _,
27
- children: n.map((n) => {
28
- let s = o.includes(n.value), l = f || n.disabled;
27
+ children: e.map((e) => {
28
+ let s = o.includes(e.value), l = f || e.disabled;
29
29
  return c === "chips" ? /* @__PURE__ */ a("button", {
30
30
  type: "button",
31
31
  role: "checkbox",
32
32
  "aria-checked": s,
33
33
  disabled: l,
34
- className: r(t.chip, E, s && t.chipSelected, u && s && t.chipChecked, h?.option, h?.chip, s && h?.chipSelected),
35
- onClick: () => D(n.value),
34
+ className: t(r.chip, E, s && r.chipSelected, u && s && r.chipChecked, h?.option, h?.chip, s && h?.chipSelected),
35
+ onClick: () => D(e.value),
36
36
  children: [u && /* @__PURE__ */ i("span", {
37
- className: r(t.chipCheck, s && t.chipCheckVisible),
37
+ className: t(r.chipCheck, s && r.chipCheckVisible),
38
38
  "aria-hidden": "true"
39
- }), n.label]
40
- }, n.value) : /* @__PURE__ */ i(e, {
39
+ }), e.label]
40
+ }, e.value) : /* @__PURE__ */ i(n, {
41
41
  name: m,
42
- value: n.value,
43
- label: n.label,
42
+ value: e.value,
43
+ label: e.label,
44
44
  checked: s,
45
45
  disabled: l,
46
- className: r(t.option, h?.option),
47
- onChange: () => D(n.value)
48
- }, n.value);
46
+ className: t(r.option, h?.option),
47
+ onChange: () => D(e.value)
48
+ }, e.value);
49
49
  })
50
50
  });
51
51
  });