@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.
- package/AGENTS.md +1 -0
- package/CHANGELOG.md +35 -0
- package/components/Accordion/Accordion.js +48 -48
- package/components/ActionButton/ActionButton.js +23 -23
- package/components/ActionButton/CopyButton.js +5 -5
- package/components/Alert/Alert.js +13 -13
- package/components/Avatar/Avatar.js +12 -12
- package/components/Badge/Badge.js +6 -6
- package/components/Breadcrumbs/Breadcrumbs.js +15 -15
- package/components/Button/Button.js +14 -14
- package/components/Card/Card.js +26 -26
- package/components/Chart/AreaChart.js +103 -103
- package/components/Chart/Axis.js +7 -7
- package/components/Chart/BarChart.js +62 -62
- package/components/Chart/ChartContainer.js +11 -11
- package/components/Chart/ChartLegend.js +7 -7
- package/components/Chart/ChartTooltip.js +13 -13
- package/components/Chart/LineChart.js +88 -88
- package/components/Chart/PieChart.js +25 -25
- package/components/Chart/RadarChart.js +42 -42
- package/components/Chart/Sparkline.js +11 -11
- package/components/Chart/TradingChart.js +126 -126
- package/components/Chart/trading/period.js +3 -3
- package/components/Chip/Chip.js +24 -24
- package/components/CodeBlock/CodeBlock.js +31 -31
- package/components/CommandPalette/CommandPalette.js +166 -166
- package/components/ConfirmDialog/ConfirmDialog.js +60 -60
- package/components/Divider/Divider.js +10 -10
- package/components/Draggable/Draggable.js +29 -29
- package/components/Drawer/Drawer.js +53 -53
- package/components/Dropdown/Dropdown.js +66 -66
- package/components/Dropdown/DropdownItem.js +13 -13
- package/components/Dropdown/DropdownLabel.js +5 -5
- package/components/Dropdown/DropdownSeparator.js +5 -5
- package/components/Dropzone/Dropzone.js +15 -15
- package/components/EmptyState/EmptyState.js +11 -11
- package/components/Form/Form.js +17 -17
- package/components/Form/FormField.js +21 -21
- package/components/Form/FormRow.js +3 -3
- package/components/ImageViewer/ImageViewer.js +118 -118
- package/components/Kbd/Kbd.js +11 -11
- package/components/KeyValueList/KeyValueList.js +32 -32
- package/components/Link/Link.js +7 -7
- package/components/List/List.js +7 -7
- package/components/Loader/Loader.js +39 -39
- package/components/Modal/Modal.js +48 -48
- package/components/PageHeader/PageHeader.js +18 -18
- package/components/Pagination/Pagination.js +23 -23
- package/components/Popover/Popover.js +25 -25
- package/components/ProgressBar/ProgressBar.js +17 -17
- package/components/RelativeTime/RelativeTime.js +10 -10
- package/components/SegmentedControl/SegmentedControl.js +38 -38
- package/components/Skeleton/Skeleton.js +10 -10
- package/components/Spinner/Spinner.js +7 -7
- package/components/SplitButton/SplitButton.js +63 -63
- package/components/SplitPane/SplitPane.js +50 -50
- package/components/StatCard/StatCard.js +32 -32
- package/components/StatusDot/StatusDot.js +7 -7
- package/components/Table/Table.js +174 -174
- package/components/Tabs/Tabs.js +47 -47
- package/components/ThemeToggle/ThemeToggle.js +31 -31
- package/components/Timeline/GanttTimeline.js +213 -213
- package/components/Timeline/HistoryTimeline.js +306 -306
- package/components/Timeline/TimelineShared.js +103 -103
- package/components/Timeline/TraceEventDetails.js +103 -103
- package/components/Timeline/TraceTimeline.js +546 -546
- package/components/Timeline/historyLayout.js +2 -2
- package/components/Timer/Timer.js +39 -39
- package/components/Toast/Toast.js +59 -59
- package/components/ToggleIconButton/ToggleIconButton.js +9 -9
- package/components/Tooltip/Tooltip.js +16 -16
- package/components/Typography/Typography.js +5 -5
- package/components/inputs/Checkbox/Checkbox.js +11 -11
- package/components/inputs/Checkbox/CheckboxGroup.js +21 -21
- package/components/inputs/DatePicker/CalendarPanel.js +113 -113
- package/components/inputs/DatePicker/DatePicker.js +39 -39
- package/components/inputs/DateTimePicker/DateTimePicker.js +119 -119
- package/components/inputs/DateTimePicker/DateTimeSegments.js +40 -40
- package/components/inputs/DateTimePicker/TimeField.js +34 -34
- package/components/inputs/Input/Input.js +13 -13
- package/components/inputs/NumberInput/NumberInput.js +16 -16
- package/components/inputs/Radio/Radio.js +17 -17
- package/components/inputs/SearchInput/SearchInput.js +25 -25
- package/components/inputs/Select/Select.d.ts +55 -3
- package/components/inputs/Select/Select.js +485 -344
- package/components/inputs/Select/{Select.module.js → Select.module.scss.js} +15 -3
- package/components/inputs/Slider/Slider.js +21 -21
- package/components/inputs/Switch/Switch.js +4 -4
- package/components/inputs/Textarea/Textarea.js +8 -8
- package/hooks/usePortalPosition.d.ts +2 -1
- package/hooks/usePortalPosition.js +6 -3
- package/hooks/useResizable.js +1 -1
- package/hooks/useTheme.js +7 -7
- package/index.css +1 -1
- package/index.js +1 -1
- package/index.layered.css +1 -1
- package/llms.txt +25 -4
- package/manifest.json +33 -4
- package/package.json +1 -1
- /package/components/Accordion/{Accordion.module.js → Accordion.module.scss.js} +0 -0
- /package/components/ActionButton/{ActionButton.module.js → ActionButton.module.scss.js} +0 -0
- /package/components/Alert/{Alert.module.js → Alert.module.scss.js} +0 -0
- /package/components/Avatar/{Avatar.module.js → Avatar.module.scss.js} +0 -0
- /package/components/Badge/{Badge.module.js → Badge.module.scss.js} +0 -0
- /package/components/Breadcrumbs/{Breadcrumbs.module.js → Breadcrumbs.module.scss.js} +0 -0
- /package/components/Button/{Button.module.js → Button.module.scss.js} +0 -0
- /package/components/Card/{Card.module.js → Card.module.scss.js} +0 -0
- /package/components/Chart/{Chart.module.js → Chart.module.scss.js} +0 -0
- /package/components/Chip/{Chip.module.js → Chip.module.scss.js} +0 -0
- /package/components/CodeBlock/{CodeBlock.module.js → CodeBlock.module.scss.js} +0 -0
- /package/components/CommandPalette/{CommandPalette.module.js → CommandPalette.module.scss.js} +0 -0
- /package/components/ConfirmDialog/{ConfirmDialog.module.js → ConfirmDialog.module.scss.js} +0 -0
- /package/components/Divider/{Divider.module.js → Divider.module.scss.js} +0 -0
- /package/components/Draggable/{Draggable.module.js → Draggable.module.scss.js} +0 -0
- /package/components/Drawer/{Drawer.module.js → Drawer.module.scss.js} +0 -0
- /package/components/Dropdown/{Dropdown.module.js → Dropdown.module.scss.js} +0 -0
- /package/components/Dropzone/{Dropzone.module.js → Dropzone.module.scss.js} +0 -0
- /package/components/EmptyState/{EmptyState.module.js → EmptyState.module.scss.js} +0 -0
- /package/components/Form/{Form.module.js → Form.module.scss.js} +0 -0
- /package/components/ImageViewer/{ImageViewer.module.js → ImageViewer.module.scss.js} +0 -0
- /package/components/Kbd/{Kbd.module.js → Kbd.module.scss.js} +0 -0
- /package/components/KeyValueList/{KeyValueList.module.js → KeyValueList.module.scss.js} +0 -0
- /package/components/Link/{Link.module.js → Link.module.scss.js} +0 -0
- /package/components/List/{List.module.js → List.module.scss.js} +0 -0
- /package/components/Loader/{Loader.module.js → Loader.module.scss.js} +0 -0
- /package/components/Modal/{Modal.module.js → Modal.module.scss.js} +0 -0
- /package/components/PageHeader/{PageHeader.module.js → PageHeader.module.scss.js} +0 -0
- /package/components/Pagination/{Pagination.module.js → Pagination.module.scss.js} +0 -0
- /package/components/Popover/{Popover.module.js → Popover.module.scss.js} +0 -0
- /package/components/ProgressBar/{ProgressBar.module.js → ProgressBar.module.scss.js} +0 -0
- /package/components/RelativeTime/{RelativeTime.module.js → RelativeTime.module.scss.js} +0 -0
- /package/components/SegmentedControl/{SegmentedControl.module.js → SegmentedControl.module.scss.js} +0 -0
- /package/components/Skeleton/{Skeleton.module.js → Skeleton.module.scss.js} +0 -0
- /package/components/Spinner/{Spinner.module.js → Spinner.module.scss.js} +0 -0
- /package/components/SplitButton/{SplitButton.module.js → SplitButton.module.scss.js} +0 -0
- /package/components/SplitPane/{SplitPane.module.js → SplitPane.module.scss.js} +0 -0
- /package/components/StatCard/{StatCard.module.js → StatCard.module.scss.js} +0 -0
- /package/components/StatusDot/{StatusDot.module.js → StatusDot.module.scss.js} +0 -0
- /package/components/Table/{Table.module.js → Table.module.scss.js} +0 -0
- /package/components/Tabs/{Tabs.module.js → Tabs.module.scss.js} +0 -0
- /package/components/ThemeToggle/{ThemeToggle.module.js → ThemeToggle.module.scss.js} +0 -0
- /package/components/Timeline/{GanttTimeline.module.js → GanttTimeline.module.scss.js} +0 -0
- /package/components/Timeline/{HistoryTimeline.module.js → HistoryTimeline.module.scss.js} +0 -0
- /package/components/Timeline/{Timeline.module.js → Timeline.module.scss.js} +0 -0
- /package/components/Timeline/{TraceTimeline.module.js → TraceTimeline.module.scss.js} +0 -0
- /package/components/Timer/{Timer.module.js → Timer.module.scss.js} +0 -0
- /package/components/Toast/{Toast.module.js → Toast.module.scss.js} +0 -0
- /package/components/ToggleIconButton/{ToggleIconButton.module.js → ToggleIconButton.module.scss.js} +0 -0
- /package/components/Tooltip/{Tooltip.module.js → Tooltip.module.scss.js} +0 -0
- /package/components/Typography/{Typography.module.js → Typography.module.scss.js} +0 -0
- /package/components/inputs/Checkbox/{Checkbox.module.js → Checkbox.module.scss.js} +0 -0
- /package/components/inputs/Checkbox/{CheckboxGroup.module.js → CheckboxGroup.module.scss.js} +0 -0
- /package/components/inputs/DatePicker/{CalendarPanel.module.js → CalendarPanel.module.scss.js} +0 -0
- /package/components/inputs/DatePicker/{DatePicker.module.js → DatePicker.module.scss.js} +0 -0
- /package/components/inputs/DateTimePicker/{DateTimePicker.module.js → DateTimePicker.module.scss.js} +0 -0
- /package/components/inputs/Input/{Input.module.js → Input.module.scss.js} +0 -0
- /package/components/inputs/NumberInput/{NumberInput.module.js → NumberInput.module.scss.js} +0 -0
- /package/components/inputs/Radio/{Radio.module.js → Radio.module.scss.js} +0 -0
- /package/components/inputs/SearchInput/{SearchInput.module.js → SearchInput.module.scss.js} +0 -0
- /package/components/inputs/Slider/{Slider.module.js → Slider.module.scss.js} +0 -0
- /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 =
|
|
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 =
|
|
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 "
|
|
2
|
-
import
|
|
3
|
-
import c from "
|
|
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 =
|
|
59
|
-
let E = m !== void 0, D = p !== void 0, O = D ? p instanceof Date ? p.getTime() : p : 0, k = (f ?? 0) * 1e3, [, A] =
|
|
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 =
|
|
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
|
|
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
|
-
|
|
72
|
+
t,
|
|
73
73
|
k
|
|
74
|
-
]), H =
|
|
74
|
+
]), H = n(() => {
|
|
75
75
|
L.current &&= (clearInterval(L.current), null);
|
|
76
|
-
}, []), U =
|
|
76
|
+
}, []), U = n(() => {
|
|
77
77
|
N.current != null && (F.current += d() - N.current, N.current = null), H(), M(!1);
|
|
78
|
-
}, [H]), W =
|
|
78
|
+
}, [H]), W = n(() => {
|
|
79
79
|
E || (N.current ??= d(), I.current = !1, M(!0));
|
|
80
|
-
}, [E]), G =
|
|
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 =
|
|
82
|
+
}, [H]), q = n(() => {
|
|
83
83
|
F.current = 0, I.current = !1, N.current = d(), M(!0);
|
|
84
84
|
}, []);
|
|
85
|
-
|
|
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
|
-
]),
|
|
93
|
+
]), r(() => E || !(D || j) ? void 0 : (L.current = setInterval(() => {
|
|
94
94
|
let e = V();
|
|
95
|
-
z.current?.(e), A((e) => e + 1), (
|
|
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
|
-
|
|
101
|
+
t,
|
|
102
102
|
V,
|
|
103
103
|
U,
|
|
104
104
|
H
|
|
105
|
-
]),
|
|
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
|
-
]),
|
|
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 =
|
|
130
|
-
Z > 0 && (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
|
|
132
|
+
className: s(c.label, T?.label),
|
|
133
133
|
children: x
|
|
134
134
|
});
|
|
135
135
|
return /* @__PURE__ */ u("div", {
|
|
136
|
-
className: c
|
|
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:
|
|
144
|
+
className: c.ringWrap,
|
|
145
145
|
children: [/* @__PURE__ */ u("svg", {
|
|
146
146
|
viewBox: "0 0 100 100",
|
|
147
|
-
className:
|
|
147
|
+
className: c.ring,
|
|
148
148
|
"aria-hidden": "true",
|
|
149
149
|
children: [/* @__PURE__ */ l("circle", {
|
|
150
|
-
className: c
|
|
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
|
|
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
|
|
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
|
|
170
|
-
children: pe.map((
|
|
171
|
-
className:
|
|
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(
|
|
175
|
-
className: c
|
|
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
|
|
178
|
-
children:
|
|
177
|
+
className: s(c.segmentValue, T?.segmentValue),
|
|
178
|
+
children: t.text
|
|
179
179
|
}), /* @__PURE__ */ l("span", {
|
|
180
|
-
className: c
|
|
181
|
-
children:
|
|
180
|
+
className: s(c.segmentLabel, T?.segmentLabel),
|
|
181
|
+
children: t.label
|
|
182
182
|
})]
|
|
183
|
-
})] },
|
|
183
|
+
})] }, t.unit))
|
|
184
184
|
}) : /* @__PURE__ */ l("span", {
|
|
185
|
-
className: c
|
|
185
|
+
className: s(c.display, T?.display),
|
|
186
186
|
children: X
|
|
187
187
|
}),
|
|
188
188
|
!$ && me
|
|
@@ -1,130 +1,130 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
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) =>
|
|
9
|
-
dismiss:
|
|
10
|
-
dismissAll:
|
|
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:
|
|
16
|
-
dismissAll:
|
|
15
|
+
dismiss: d,
|
|
16
|
+
dismissAll: u
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
|
-
function x({ children:
|
|
20
|
-
let b =
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
duration:
|
|
24
|
-
max:
|
|
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
|
-
}, [
|
|
27
|
-
let T = x ? [...b].reverse() : b, E = S && typeof document < "u" ?
|
|
28
|
-
className:
|
|
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__ */
|
|
31
|
+
children: T.map((e) => /* @__PURE__ */ _(C, {
|
|
32
32
|
record: e,
|
|
33
33
|
exiting: e.exiting,
|
|
34
34
|
isTop: x,
|
|
35
|
-
onDismiss:
|
|
35
|
+
onDismiss: d,
|
|
36
36
|
classes: y
|
|
37
37
|
}, e.id))
|
|
38
38
|
}), document.body) : null;
|
|
39
|
-
return /* @__PURE__ */
|
|
39
|
+
return /* @__PURE__ */ v(g, { children: [e, E] });
|
|
40
40
|
}
|
|
41
41
|
var S = {
|
|
42
42
|
neutral: null,
|
|
43
|
-
info: /* @__PURE__ */
|
|
43
|
+
info: /* @__PURE__ */ _("svg", {
|
|
44
44
|
viewBox: "0 0 20 20",
|
|
45
45
|
fill: "currentColor",
|
|
46
46
|
"aria-hidden": "true",
|
|
47
|
-
children: /* @__PURE__ */
|
|
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__ */
|
|
53
|
+
success: /* @__PURE__ */ _("svg", {
|
|
54
54
|
viewBox: "0 0 20 20",
|
|
55
55
|
fill: "currentColor",
|
|
56
56
|
"aria-hidden": "true",
|
|
57
|
-
children: /* @__PURE__ */
|
|
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__ */
|
|
63
|
+
warning: /* @__PURE__ */ _("svg", {
|
|
64
64
|
viewBox: "0 0 20 20",
|
|
65
65
|
fill: "currentColor",
|
|
66
66
|
"aria-hidden": "true",
|
|
67
|
-
children: /* @__PURE__ */
|
|
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__ */
|
|
73
|
+
danger: /* @__PURE__ */ _("svg", {
|
|
74
74
|
viewBox: "0 0 20 20",
|
|
75
75
|
fill: "currentColor",
|
|
76
76
|
"aria-hidden": "true",
|
|
77
|
-
children: /* @__PURE__ */
|
|
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:
|
|
85
|
-
let { id:
|
|
86
|
-
|
|
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
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
]), y =
|
|
88
|
+
m,
|
|
89
|
+
u,
|
|
90
|
+
c
|
|
91
|
+
]), y = e(() => {
|
|
92
92
|
h.current &&= (clearTimeout(h.current), null);
|
|
93
93
|
}, []);
|
|
94
|
-
|
|
95
|
-
let b = S[
|
|
96
|
-
return /* @__PURE__ */
|
|
97
|
-
className:
|
|
98
|
-
role:
|
|
99
|
-
"aria-live":
|
|
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:
|
|
101
|
+
onMouseLeave: g,
|
|
102
102
|
children: [
|
|
103
|
-
b && /* @__PURE__ */
|
|
104
|
-
className:
|
|
103
|
+
b && /* @__PURE__ */ _("span", {
|
|
104
|
+
className: o(s.icon, l?.icon),
|
|
105
105
|
"aria-hidden": "true",
|
|
106
106
|
children: b
|
|
107
107
|
}),
|
|
108
|
-
/* @__PURE__ */
|
|
109
|
-
className:
|
|
110
|
-
children: [
|
|
111
|
-
className:
|
|
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__ */
|
|
118
|
+
/* @__PURE__ */ _("button", {
|
|
119
119
|
type: "button",
|
|
120
|
-
className:
|
|
121
|
-
onClick: () =>
|
|
120
|
+
className: o(s.close, l?.close),
|
|
121
|
+
onClick: () => c(u),
|
|
122
122
|
"aria-label": "Dismiss notification",
|
|
123
|
-
children: /* @__PURE__ */
|
|
123
|
+
children: /* @__PURE__ */ _("svg", {
|
|
124
124
|
viewBox: "0 0 20 20",
|
|
125
125
|
fill: "currentColor",
|
|
126
126
|
"aria-hidden": "true",
|
|
127
|
-
children: /* @__PURE__ */
|
|
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 "
|
|
2
|
-
import
|
|
3
|
-
import r from "
|
|
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 =
|
|
7
|
-
let [x, S] =
|
|
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
|
|
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
|
|
26
|
+
className: n(r.burst, m?.burst),
|
|
27
27
|
"aria-hidden": "true"
|
|
28
28
|
}), /* @__PURE__ */ i("span", {
|
|
29
|
-
className: r
|
|
29
|
+
className: n(r.icon, m?.icon),
|
|
30
30
|
"aria-hidden": "true",
|
|
31
|
-
children:
|
|
31
|
+
children: e
|
|
32
32
|
})]
|
|
33
33
|
});
|
|
34
34
|
});
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import {
|
|
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
|
|
5
|
-
import {
|
|
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 =
|
|
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 =
|
|
12
|
+
}), k = n(), A = e(() => {
|
|
13
13
|
S.current &&= (clearTimeout(S.current), null);
|
|
14
|
-
}, []), j =
|
|
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 =
|
|
21
|
+
]), M = e(() => {
|
|
22
22
|
A(), g > 0 ? S.current = setTimeout(() => w(!1), g) : w(!1);
|
|
23
23
|
}, [A, g]);
|
|
24
|
-
|
|
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]),
|
|
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__ */
|
|
55
|
+
return /* @__PURE__ */ u("span", {
|
|
56
56
|
ref: b,
|
|
57
|
-
className: s(
|
|
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" &&
|
|
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(
|
|
67
|
+
className: s(c.tooltip, c[`p_${T}`], y?.tooltip),
|
|
68
68
|
style: P,
|
|
69
|
-
children: [f, !v && /* @__PURE__ */
|
|
70
|
-
className: s(
|
|
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 "
|
|
2
|
-
import
|
|
3
|
-
import r from "
|
|
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 =
|
|
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
|
|
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 "
|
|
2
|
-
import
|
|
3
|
-
import i from "
|
|
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 =
|
|
7
|
-
let h =
|
|
8
|
-
return
|
|
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
|
|
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
|
|
18
|
+
className: r(i.input, g && i.switchInput, l && i.error, u?.input),
|
|
19
19
|
...p
|
|
20
|
-
}),
|
|
21
|
-
className: i
|
|
22
|
-
children:
|
|
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 {
|
|
2
|
-
import t from "
|
|
3
|
-
import {
|
|
4
|
-
import r from "
|
|
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 =
|
|
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:
|
|
10
|
-
rounded:
|
|
11
|
-
square:
|
|
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
|
|
25
|
+
className: t(r.group, r[T], c === "chips" && r.chipsGroup, p && r.error, h?.group, g),
|
|
26
26
|
style: _,
|
|
27
|
-
children:
|
|
28
|
-
let s = o.includes(
|
|
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
|
|
35
|
-
onClick: () => D(
|
|
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
|
|
37
|
+
className: t(r.chipCheck, s && r.chipCheckVisible),
|
|
38
38
|
"aria-hidden": "true"
|
|
39
|
-
}),
|
|
40
|
-
},
|
|
39
|
+
}), e.label]
|
|
40
|
+
}, e.value) : /* @__PURE__ */ i(n, {
|
|
41
41
|
name: m,
|
|
42
|
-
value:
|
|
43
|
-
label:
|
|
42
|
+
value: e.value,
|
|
43
|
+
label: e.label,
|
|
44
44
|
checked: s,
|
|
45
45
|
disabled: l,
|
|
46
|
-
className: r
|
|
47
|
-
onChange: () => D(
|
|
48
|
-
},
|
|
46
|
+
className: t(r.option, h?.option),
|
|
47
|
+
onChange: () => D(e.value)
|
|
48
|
+
}, e.value);
|
|
49
49
|
})
|
|
50
50
|
});
|
|
51
51
|
});
|