@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.
- package/AGENTS.md +1 -0
- package/CHANGELOG.md +27 -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
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import {
|
|
1
|
+
import { forwardRef as e, useEffect as t, useLayoutEffect as n, useRef as r, useState as i } from "react";
|
|
2
|
+
import { createPortal as a } from "react-dom";
|
|
3
3
|
import o from "clsx";
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
4
|
+
import s from "./Loader.module.scss.js";
|
|
5
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
6
6
|
// src/components/Loader/Loader.tsx
|
|
7
7
|
var u = {
|
|
8
8
|
dots: 3,
|
|
@@ -25,7 +25,7 @@ function d(e) {
|
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
27
|
function f(e, t) {
|
|
28
|
-
|
|
28
|
+
n(() => {
|
|
29
29
|
let n = e.current;
|
|
30
30
|
if (!t || !n) return;
|
|
31
31
|
let r = 0, i = () => {
|
|
@@ -50,26 +50,26 @@ function f(e, t) {
|
|
|
50
50
|
};
|
|
51
51
|
}, [e, t]);
|
|
52
52
|
}
|
|
53
|
-
function p(e,
|
|
54
|
-
let [r,
|
|
55
|
-
return
|
|
53
|
+
function p(e, n) {
|
|
54
|
+
let [r, a] = i(e && n <= 0);
|
|
55
|
+
return t(() => {
|
|
56
56
|
if (!e) {
|
|
57
|
-
|
|
57
|
+
a(!1);
|
|
58
58
|
return;
|
|
59
59
|
}
|
|
60
|
-
if (
|
|
61
|
-
|
|
60
|
+
if (n <= 0) {
|
|
61
|
+
a(!0);
|
|
62
62
|
return;
|
|
63
63
|
}
|
|
64
|
-
let
|
|
65
|
-
return () => clearTimeout(
|
|
66
|
-
}, [e,
|
|
64
|
+
let t = setTimeout(() => a(!0), n);
|
|
65
|
+
return () => clearTimeout(t);
|
|
66
|
+
}, [e, n]), e && r;
|
|
67
67
|
}
|
|
68
|
-
var m =
|
|
69
|
-
let O = p(m, g), k = h != null, A =
|
|
68
|
+
var m = e(({ variant: e = "dots", size: i = "md", mode: d = "inline", loading: m = !0, children: h, delay: g = 0, backdrop: _ = "dim", interactive: v = !1, color: y, label: b = "Loading", showLabel: x = !1, minHeight: S, classes: C, className: w, style: T, ...E }, D) => {
|
|
69
|
+
let O = p(m, g), k = h != null, A = r(null), j = r(null), M = r(null), N = (e) => {
|
|
70
70
|
A.current = e, typeof D == "function" ? D(e) : D && (D.current = e);
|
|
71
71
|
}, P = !k && d === "overlay" && O;
|
|
72
|
-
|
|
72
|
+
n(() => {
|
|
73
73
|
if (!P) return;
|
|
74
74
|
let e = A.current?.parentElement;
|
|
75
75
|
if (!e) return;
|
|
@@ -79,28 +79,28 @@ var m = t(({ variant: t = "dots", size: a = "md", mode: d = "inline", loading: m
|
|
|
79
79
|
return r && (e.style.position = "relative"), () => {
|
|
80
80
|
r && (e.style.position = i), t === null ? e.removeAttribute("aria-busy") : e.setAttribute("aria-busy", t);
|
|
81
81
|
};
|
|
82
|
-
}, [P]), f(k ? M : A, O && d !== "fullscreen" && (k || d === "overlay")),
|
|
82
|
+
}, [P]), f(k ? M : A, O && d !== "fullscreen" && (k || d === "overlay")), t(() => {
|
|
83
83
|
j.current?.toggleAttribute("inert", O && !v);
|
|
84
84
|
}, [O, v]);
|
|
85
|
-
let F = y ? { "--crk-loader-color": y } : void 0, I = typeof S == "number" ? `${S}px` : S, L = /* @__PURE__ */
|
|
85
|
+
let F = y ? { "--crk-loader-color": y } : void 0, I = typeof S == "number" ? `${S}px` : S, L = /* @__PURE__ */ l("span", {
|
|
86
86
|
role: "status",
|
|
87
87
|
"aria-live": "polite",
|
|
88
|
-
className: o(
|
|
89
|
-
children: [/* @__PURE__ */
|
|
90
|
-
className: o(
|
|
88
|
+
className: o(s.indicator, C?.indicator),
|
|
89
|
+
children: [/* @__PURE__ */ c("span", {
|
|
90
|
+
className: o(s.glyph, s[e], C?.glyph),
|
|
91
91
|
"aria-hidden": "true",
|
|
92
|
-
children: Array.from({ length: u[
|
|
93
|
-
}), b ? /* @__PURE__ */
|
|
94
|
-
className: o(x ?
|
|
92
|
+
children: Array.from({ length: u[e] }, (e, t) => /* @__PURE__ */ c("span", {}, t))
|
|
93
|
+
}), b ? /* @__PURE__ */ c("span", {
|
|
94
|
+
className: o(x ? s.label : s.srLabel, C?.label),
|
|
95
95
|
children: b
|
|
96
96
|
}) : null]
|
|
97
97
|
}), R = {
|
|
98
|
-
dim:
|
|
99
|
-
blur:
|
|
98
|
+
dim: s.backdropDim,
|
|
99
|
+
blur: s.backdropBlur,
|
|
100
100
|
none: void 0
|
|
101
|
-
}[_], z = O && d === "fullscreen" && typeof document < "u" ?
|
|
101
|
+
}[_], z = O && d === "fullscreen" && typeof document < "u" ? a(/* @__PURE__ */ c("div", {
|
|
102
102
|
ref: k ? void 0 : N,
|
|
103
|
-
className: o(
|
|
103
|
+
className: o(s.root, s[i], s.overlay, s.fullscreen, R, C?.overlay, !k && [C?.root, w]),
|
|
104
104
|
style: k ? F : {
|
|
105
105
|
...F,
|
|
106
106
|
...T
|
|
@@ -108,9 +108,9 @@ var m = t(({ variant: t = "dots", size: a = "md", mode: d = "inline", loading: m
|
|
|
108
108
|
...k ? {} : E,
|
|
109
109
|
children: L
|
|
110
110
|
}), document.body) : null;
|
|
111
|
-
return k ? /* @__PURE__ */
|
|
111
|
+
return k ? /* @__PURE__ */ l("div", {
|
|
112
112
|
ref: N,
|
|
113
|
-
className: o(
|
|
113
|
+
className: o(s.root, s[i], s.wrap, O && s.wrapBusy, C?.root, w),
|
|
114
114
|
style: {
|
|
115
115
|
...F,
|
|
116
116
|
...O && I ? { minHeight: I } : null,
|
|
@@ -119,30 +119,30 @@ var m = t(({ variant: t = "dots", size: a = "md", mode: d = "inline", loading: m
|
|
|
119
119
|
"aria-busy": m || void 0,
|
|
120
120
|
...E,
|
|
121
121
|
children: [
|
|
122
|
-
/* @__PURE__ */
|
|
122
|
+
/* @__PURE__ */ c("div", {
|
|
123
123
|
ref: j,
|
|
124
|
-
className: o(
|
|
124
|
+
className: o(s.content, C?.content),
|
|
125
125
|
children: h
|
|
126
126
|
}),
|
|
127
|
-
O && d !== "fullscreen" && /* @__PURE__ */
|
|
127
|
+
O && d !== "fullscreen" && /* @__PURE__ */ c("div", {
|
|
128
128
|
ref: M,
|
|
129
|
-
className: o(
|
|
129
|
+
className: o(s.overlay, R, v && s.passThrough, C?.overlay),
|
|
130
130
|
children: L
|
|
131
131
|
}),
|
|
132
132
|
z
|
|
133
133
|
]
|
|
134
|
-
}) : O ? d === "fullscreen" ? z : d === "overlay" ? /* @__PURE__ */
|
|
134
|
+
}) : O ? d === "fullscreen" ? z : d === "overlay" ? /* @__PURE__ */ c("div", {
|
|
135
135
|
ref: N,
|
|
136
|
-
className: o(
|
|
136
|
+
className: o(s.root, s[i], s.overlay, R, C?.root, C?.overlay, w),
|
|
137
137
|
style: {
|
|
138
138
|
...F,
|
|
139
139
|
...T
|
|
140
140
|
},
|
|
141
141
|
...E,
|
|
142
142
|
children: L
|
|
143
|
-
}) : /* @__PURE__ */
|
|
143
|
+
}) : /* @__PURE__ */ c("div", {
|
|
144
144
|
ref: N,
|
|
145
|
-
className: o(
|
|
145
|
+
className: o(s.root, s[i], s.inline, C?.root, w),
|
|
146
146
|
style: {
|
|
147
147
|
...F,
|
|
148
148
|
...I ? { minHeight: I } : null,
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import u from "
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
1
|
+
import { createContext as e, forwardRef as t, useContext as n, useEffect as r, useId as i, useRef as a } from "react";
|
|
2
|
+
import { createPortal as o } from "react-dom";
|
|
3
|
+
import s from "clsx";
|
|
4
|
+
import { useFocusTrap as c } from "../../hooks/useFocusTrap.js";
|
|
5
|
+
import { EscapeLayerProvider as l, useEscapeLayer as u } from "../../hooks/useEscapeLayer.js";
|
|
6
|
+
import d from "./Modal.module.scss.js";
|
|
7
|
+
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
8
8
|
// src/components/Modal/Modal.tsx
|
|
9
|
-
var m =
|
|
9
|
+
var m = e({
|
|
10
10
|
classes: {},
|
|
11
11
|
titleId: ""
|
|
12
|
-
}), h = ({ children: e, className: t, style:
|
|
13
|
-
let { classes: a, titleId:
|
|
14
|
-
return /* @__PURE__ */
|
|
15
|
-
className:
|
|
16
|
-
style:
|
|
17
|
-
children: [/* @__PURE__ */
|
|
18
|
-
id:
|
|
19
|
-
className:
|
|
12
|
+
}), h = ({ children: e, className: t, style: r, onClose: i }) => {
|
|
13
|
+
let { classes: a, titleId: o } = n(m);
|
|
14
|
+
return /* @__PURE__ */ p("div", {
|
|
15
|
+
className: s(d.header, i && d.headerWithClose, a.header, t),
|
|
16
|
+
style: r,
|
|
17
|
+
children: [/* @__PURE__ */ f("div", {
|
|
18
|
+
id: o,
|
|
19
|
+
className: s(d.headerTitle, a.headerTitle),
|
|
20
20
|
children: e
|
|
21
|
-
}), i && /* @__PURE__ */
|
|
21
|
+
}), i && /* @__PURE__ */ f("button", {
|
|
22
22
|
type: "button",
|
|
23
|
-
className:
|
|
23
|
+
className: s(d.closeButton, a.closeButton),
|
|
24
24
|
onClick: i,
|
|
25
25
|
"aria-label": "Close",
|
|
26
26
|
children: "×"
|
|
@@ -28,63 +28,63 @@ var m = i({
|
|
|
28
28
|
});
|
|
29
29
|
};
|
|
30
30
|
h.displayName = "Modal.Header";
|
|
31
|
-
var g = ({ children: e, className: t, style:
|
|
32
|
-
let { classes: i } =
|
|
33
|
-
return /* @__PURE__ */
|
|
34
|
-
className:
|
|
35
|
-
style:
|
|
31
|
+
var g = ({ children: e, className: t, style: r }) => {
|
|
32
|
+
let { classes: i } = n(m);
|
|
33
|
+
return /* @__PURE__ */ f("div", {
|
|
34
|
+
className: s(d.body, i.body, t),
|
|
35
|
+
style: r,
|
|
36
36
|
children: e
|
|
37
37
|
});
|
|
38
38
|
};
|
|
39
39
|
g.displayName = "Modal.Body";
|
|
40
|
-
var _ = ({ children: e, className: t, style:
|
|
41
|
-
let { classes: i } =
|
|
42
|
-
return /* @__PURE__ */
|
|
43
|
-
className:
|
|
44
|
-
style:
|
|
40
|
+
var _ = ({ children: e, className: t, style: r }) => {
|
|
41
|
+
let { classes: i } = n(m);
|
|
42
|
+
return /* @__PURE__ */ f("div", {
|
|
43
|
+
className: s(d.footer, i.footer, t),
|
|
44
|
+
style: r,
|
|
45
45
|
children: e
|
|
46
46
|
});
|
|
47
47
|
};
|
|
48
48
|
_.displayName = "Modal.Footer";
|
|
49
|
-
var v =
|
|
50
|
-
let C =
|
|
49
|
+
var v = t(({ open: e, onClose: t, closeOnBackdrop: n = !0, closeOnEscape: p = !0, size: h = "md", classes: g, className: _, style: v, children: y, "aria-label": b, "aria-labelledby": x }, S) => {
|
|
50
|
+
let C = a(null), w = (e) => {
|
|
51
51
|
C.current = e, typeof S == "function" ? S(e) : S && (S.current = e);
|
|
52
|
-
}, T =
|
|
53
|
-
|
|
54
|
-
let D =
|
|
55
|
-
|
|
56
|
-
},
|
|
57
|
-
|
|
58
|
-
if (!
|
|
59
|
-
let
|
|
52
|
+
}, T = i(), E = x ?? `${T}-title`;
|
|
53
|
+
c(C, e);
|
|
54
|
+
let D = u(() => {
|
|
55
|
+
p && t();
|
|
56
|
+
}, e);
|
|
57
|
+
r(() => {
|
|
58
|
+
if (!e) return;
|
|
59
|
+
let t = document.body.style.overflow;
|
|
60
60
|
return document.body.style.overflow = "hidden", () => {
|
|
61
|
-
document.body.style.overflow =
|
|
61
|
+
document.body.style.overflow = t;
|
|
62
62
|
};
|
|
63
|
-
}, [
|
|
64
|
-
let O =
|
|
65
|
-
return
|
|
66
|
-
className:
|
|
63
|
+
}, [e]);
|
|
64
|
+
let O = a(!1);
|
|
65
|
+
return e ? o(/* @__PURE__ */ f("div", {
|
|
66
|
+
className: s(d.backdrop, g?.backdrop),
|
|
67
67
|
onMouseDown: (e) => {
|
|
68
68
|
O.current = e.target === e.currentTarget;
|
|
69
69
|
},
|
|
70
70
|
onMouseUp: (e) => {
|
|
71
|
-
|
|
71
|
+
n && O.current && e.target === e.currentTarget && t(), O.current = !1;
|
|
72
72
|
},
|
|
73
73
|
role: "presentation",
|
|
74
|
-
children: /* @__PURE__ */
|
|
74
|
+
children: /* @__PURE__ */ f("div", {
|
|
75
75
|
ref: w,
|
|
76
|
-
className:
|
|
76
|
+
className: s(d.modal, d[h], g?.modal, _),
|
|
77
77
|
style: v,
|
|
78
78
|
role: "dialog",
|
|
79
79
|
"aria-modal": "true",
|
|
80
80
|
"aria-label": b,
|
|
81
81
|
"aria-labelledby": b ? void 0 : E,
|
|
82
|
-
children: /* @__PURE__ */
|
|
82
|
+
children: /* @__PURE__ */ f(m.Provider, {
|
|
83
83
|
value: {
|
|
84
84
|
classes: g ?? {},
|
|
85
85
|
titleId: E
|
|
86
86
|
},
|
|
87
|
-
children: /* @__PURE__ */
|
|
87
|
+
children: /* @__PURE__ */ f(l, {
|
|
88
88
|
value: D,
|
|
89
89
|
children: y
|
|
90
90
|
})
|
|
@@ -1,6 +1,6 @@
|
|
|
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 "./PageHeader.module.scss.js";
|
|
4
4
|
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
5
5
|
// src/components/PageHeader/PageHeader.tsx
|
|
6
6
|
var o = /* @__PURE__ */ i("svg", {
|
|
@@ -16,60 +16,60 @@ var o = /* @__PURE__ */ i("svg", {
|
|
|
16
16
|
strokeLinecap: "round",
|
|
17
17
|
strokeLinejoin: "round"
|
|
18
18
|
})
|
|
19
|
-
}), s =
|
|
19
|
+
}), s = t(({ title: t, as: s = "h1", subtitle: c, description: l, actions: u, breadcrumbs: d, backHref: f, onBack: p, backLabel: m = "Back", badge: h, meta: g, tabs: _, divider: v = !0, size: y = "md", sticky: b = !1, classes: x, className: S, children: C, ...w }, T) => {
|
|
20
20
|
let E = f === void 0 ? p ? /* @__PURE__ */ a("button", {
|
|
21
21
|
type: "button",
|
|
22
22
|
onClick: p,
|
|
23
|
-
className: r
|
|
23
|
+
className: n(r.back, x?.back),
|
|
24
24
|
children: [o, m]
|
|
25
25
|
}) : null : /* @__PURE__ */ a("a", {
|
|
26
26
|
href: f,
|
|
27
|
-
className: r
|
|
27
|
+
className: n(r.back, x?.back),
|
|
28
28
|
children: [o, m]
|
|
29
29
|
});
|
|
30
30
|
return /* @__PURE__ */ a("header", {
|
|
31
31
|
ref: T,
|
|
32
|
-
className: r
|
|
32
|
+
className: n(r.root, r[y], v && r.divider, b && r.sticky, _ && r.hasTabs, x?.root, S),
|
|
33
33
|
...w,
|
|
34
34
|
children: [
|
|
35
35
|
d && /* @__PURE__ */ i("div", {
|
|
36
|
-
className: r
|
|
36
|
+
className: n(r.breadcrumbs, x?.breadcrumbs),
|
|
37
37
|
children: d
|
|
38
38
|
}),
|
|
39
39
|
E,
|
|
40
40
|
/* @__PURE__ */ a("div", {
|
|
41
|
-
className: r
|
|
41
|
+
className: n(r.titleRow, x?.titleRow),
|
|
42
42
|
children: [/* @__PURE__ */ a("div", {
|
|
43
|
-
className:
|
|
43
|
+
className: r.titleBlock,
|
|
44
44
|
children: [
|
|
45
45
|
/* @__PURE__ */ a("div", {
|
|
46
|
-
className:
|
|
47
|
-
children: [
|
|
48
|
-
className: r
|
|
46
|
+
className: r.titleLine,
|
|
47
|
+
children: [e(s, { className: n(r.title, x?.title) }, t), h && /* @__PURE__ */ i("span", {
|
|
48
|
+
className: n(r.badge, x?.badge),
|
|
49
49
|
children: h
|
|
50
50
|
})]
|
|
51
51
|
}),
|
|
52
52
|
c && /* @__PURE__ */ i("p", {
|
|
53
|
-
className: r
|
|
53
|
+
className: n(r.subtitle, x?.subtitle),
|
|
54
54
|
children: c
|
|
55
55
|
}),
|
|
56
56
|
l && /* @__PURE__ */ i("p", {
|
|
57
|
-
className: r
|
|
57
|
+
className: n(r.description, x?.description),
|
|
58
58
|
children: l
|
|
59
59
|
}),
|
|
60
60
|
g && /* @__PURE__ */ i("div", {
|
|
61
|
-
className: r
|
|
61
|
+
className: n(r.meta, x?.meta),
|
|
62
62
|
children: g
|
|
63
63
|
})
|
|
64
64
|
]
|
|
65
65
|
}), u && /* @__PURE__ */ i("div", {
|
|
66
|
-
className: r
|
|
66
|
+
className: n(r.actions, x?.actions),
|
|
67
67
|
children: u
|
|
68
68
|
})]
|
|
69
69
|
}),
|
|
70
70
|
C,
|
|
71
71
|
_ && /* @__PURE__ */ i("div", {
|
|
72
|
-
className: r
|
|
72
|
+
className: n(r.tabs, x?.tabs),
|
|
73
73
|
children: _
|
|
74
74
|
})
|
|
75
75
|
]
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import i from "
|
|
1
|
+
import { forwardRef as e, useState as t } from "react";
|
|
2
|
+
import n from "clsx";
|
|
3
|
+
import r from "./Pagination.module.scss.js";
|
|
4
|
+
import { paginationRange as i } from "./paginationRange.js";
|
|
5
5
|
import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
6
6
|
// src/components/Pagination/Pagination.tsx
|
|
7
7
|
var c = ({ dir: e }) => /* @__PURE__ */ o("svg", {
|
|
@@ -18,41 +18,41 @@ var c = ({ dir: e }) => /* @__PURE__ */ o("svg", {
|
|
|
18
18
|
first: /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ o("path", { d: "M8 2L4 6l4 4" }), /* @__PURE__ */ o("path", { d: "M4 2v8" })] }),
|
|
19
19
|
last: /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ o("path", { d: "M4 2l4 4-4 4" }), /* @__PURE__ */ o("path", { d: "M8 2v8" })] })
|
|
20
20
|
}[e]
|
|
21
|
-
}), l =
|
|
22
|
-
let w =
|
|
21
|
+
}), l = e(({ count: e, total: a, pageSize: l = 10, page: u, defaultPage: d = 1, onChange: f, boundaryCount: p = 1, siblingCount: m = 2, showPrevNext: h = !0, showFirstLast: g = !1, size: _ = "md", disabled: v = !1, label: y = "Pagination", classes: b, className: x, ...S }, C) => {
|
|
22
|
+
let w = e ?? (a == null ? 1 : Math.max(1, Math.ceil(a / l))), T = u !== void 0, [E, D] = t(d), O = Math.min(Math.max(T ? u : E, 1), w), k = (e) => {
|
|
23
23
|
let t = Math.min(Math.max(e, 1), w);
|
|
24
24
|
t !== O && (T || D(t), f?.(t));
|
|
25
|
-
}, A =
|
|
25
|
+
}, A = i(O, w, p, m), j = (e, t, i, a) => /* @__PURE__ */ o("li", { children: /* @__PURE__ */ o("button", {
|
|
26
26
|
type: "button",
|
|
27
|
-
className:
|
|
28
|
-
onClick: () => k(
|
|
29
|
-
disabled: v || O ===
|
|
27
|
+
className: n(r.item, r.control, b?.item, b?.control),
|
|
28
|
+
onClick: () => k(i),
|
|
29
|
+
disabled: v || O === i || (t === "left" || t === "first" ? O === 1 : O === w),
|
|
30
30
|
"aria-label": a,
|
|
31
|
-
children: /* @__PURE__ */ o(c, { dir:
|
|
32
|
-
}) },
|
|
31
|
+
children: /* @__PURE__ */ o(c, { dir: t })
|
|
32
|
+
}) }, e);
|
|
33
33
|
return /* @__PURE__ */ o("nav", {
|
|
34
34
|
ref: C,
|
|
35
35
|
"aria-label": y,
|
|
36
|
-
className:
|
|
36
|
+
className: n(r.root, r[_], b?.root, x),
|
|
37
37
|
...S,
|
|
38
38
|
children: /* @__PURE__ */ s("ul", {
|
|
39
|
-
className:
|
|
39
|
+
className: n(r.list, b?.list),
|
|
40
40
|
children: [
|
|
41
41
|
g && j("first", "first", 1, "Go to first page"),
|
|
42
42
|
h && j("prev", "left", O - 1, "Go to previous page"),
|
|
43
|
-
A.map((
|
|
43
|
+
A.map((e, t) => e === "ellipsis" ? /* @__PURE__ */ o("li", {
|
|
44
44
|
"aria-hidden": "true",
|
|
45
|
-
className:
|
|
45
|
+
className: n(r.ellipsis, b?.ellipsis),
|
|
46
46
|
children: "…"
|
|
47
|
-
}, `e${
|
|
47
|
+
}, `e${t}`) : /* @__PURE__ */ o("li", { children: /* @__PURE__ */ o("button", {
|
|
48
48
|
type: "button",
|
|
49
|
-
className:
|
|
50
|
-
onClick: () => k(
|
|
49
|
+
className: n(r.item, e === O && r.active, b?.item, e === O && b?.active),
|
|
50
|
+
onClick: () => k(e),
|
|
51
51
|
disabled: v,
|
|
52
|
-
"aria-current":
|
|
53
|
-
"aria-label": `Go to page ${
|
|
54
|
-
children:
|
|
55
|
-
}) },
|
|
52
|
+
"aria-current": e === O ? "page" : void 0,
|
|
53
|
+
"aria-label": `Go to page ${e}`,
|
|
54
|
+
children: e
|
|
55
|
+
}) }, e)),
|
|
56
56
|
h && j("next", "right", O + 1, "Go to next page"),
|
|
57
57
|
g && j("last", "last", w, "Go to last page")
|
|
58
58
|
]
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import p from "
|
|
1
|
+
import { cloneElement as e, forwardRef as t, isValidElement as n, useCallback as r, useEffect as i, useId as a, useLayoutEffect as o, useRef as s, useState as c } from "react";
|
|
2
|
+
import l from "clsx";
|
|
3
|
+
import u from "./Popover.module.scss.js";
|
|
4
|
+
import { useClickOutside as d } from "../../hooks/useClickOutside.js";
|
|
5
|
+
import { EscapeLayerProvider as f, useEscapeLayer as p } from "../../hooks/useEscapeLayer.js";
|
|
6
6
|
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
7
7
|
// src/components/Popover/Popover.tsx
|
|
8
8
|
function g(...e) {
|
|
@@ -10,17 +10,17 @@ function g(...e) {
|
|
|
10
10
|
for (let n of e) n && (typeof n == "function" ? n(t) : n.current = t);
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
|
-
var _ =
|
|
14
|
-
let [D, O] =
|
|
13
|
+
var _ = t(({ trigger: t, asChild: _ = !1, content: v, position: y = "bottom", autoPosition: b = !0, open: x, onOpenChange: S, classes: C, className: w, style: T }, E) => {
|
|
14
|
+
let [D, O] = c(!1), [k, A] = c(y), [j, M] = c(0), [N, P] = c(0), F = s(null), I = s(null), L = s(null), R = a(), z = x !== void 0, B = z ? x : D, V = r((e) => {
|
|
15
15
|
z || O(e), S?.(e);
|
|
16
|
-
}, [z, S]), H =
|
|
16
|
+
}, [z, S]), H = r(() => {
|
|
17
17
|
V(!1), L.current?.focus();
|
|
18
|
-
}, [V]), U =
|
|
18
|
+
}, [V]), U = r(() => {
|
|
19
19
|
V(!B);
|
|
20
20
|
}, [B, V]);
|
|
21
|
-
|
|
22
|
-
let W =
|
|
23
|
-
|
|
21
|
+
d(F, H, B);
|
|
22
|
+
let W = p(H, B);
|
|
23
|
+
o(() => {
|
|
24
24
|
if (!B || !b) {
|
|
25
25
|
A(y), M(0), P(0);
|
|
26
26
|
return;
|
|
@@ -54,21 +54,21 @@ var _ = a(({ trigger: a, asChild: _ = !1, content: v, position: y = "bottom", au
|
|
|
54
54
|
B,
|
|
55
55
|
b,
|
|
56
56
|
y
|
|
57
|
-
]),
|
|
57
|
+
]), i(() => {
|
|
58
58
|
if (B && I.current) {
|
|
59
59
|
let e = I.current.querySelector("button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])");
|
|
60
60
|
e ? e.focus() : I.current.focus();
|
|
61
61
|
}
|
|
62
62
|
}, [B]);
|
|
63
63
|
let G;
|
|
64
|
-
if (_ &&
|
|
65
|
-
let
|
|
66
|
-
G =
|
|
67
|
-
ref: g(L,
|
|
68
|
-
onClick: (
|
|
69
|
-
|
|
64
|
+
if (_ && n(t)) {
|
|
65
|
+
let n = t, r = n.ref;
|
|
66
|
+
G = e(n, {
|
|
67
|
+
ref: g(L, r),
|
|
68
|
+
onClick: (e) => {
|
|
69
|
+
n.props.onClick?.(e), U();
|
|
70
70
|
},
|
|
71
|
-
className:
|
|
71
|
+
className: l(n.props.className, C?.trigger),
|
|
72
72
|
"aria-expanded": B,
|
|
73
73
|
"aria-haspopup": "dialog",
|
|
74
74
|
"aria-controls": B ? R : void 0
|
|
@@ -76,16 +76,16 @@ var _ = a(({ trigger: a, asChild: _ = !1, content: v, position: y = "bottom", au
|
|
|
76
76
|
} else G = /* @__PURE__ */ m("button", {
|
|
77
77
|
ref: L,
|
|
78
78
|
type: "button",
|
|
79
|
-
className:
|
|
79
|
+
className: l(u.trigger, C?.trigger),
|
|
80
80
|
onClick: U,
|
|
81
81
|
"aria-expanded": B,
|
|
82
82
|
"aria-haspopup": "dialog",
|
|
83
83
|
"aria-controls": B ? R : void 0,
|
|
84
|
-
children:
|
|
84
|
+
children: t
|
|
85
85
|
});
|
|
86
86
|
return /* @__PURE__ */ m("div", {
|
|
87
87
|
ref: E,
|
|
88
|
-
className:
|
|
88
|
+
className: l(u.root, C?.root, w),
|
|
89
89
|
style: T,
|
|
90
90
|
children: /* @__PURE__ */ h("div", {
|
|
91
91
|
ref: F,
|
|
@@ -94,12 +94,12 @@ var _ = a(({ trigger: a, asChild: _ = !1, content: v, position: y = "bottom", au
|
|
|
94
94
|
id: R,
|
|
95
95
|
role: "dialog",
|
|
96
96
|
tabIndex: -1,
|
|
97
|
-
className:
|
|
97
|
+
className: l(u.popover, u[b ? k : y], C?.popover),
|
|
98
98
|
style: b ? {
|
|
99
99
|
"--crk-popover-shift-x": `${j}px`,
|
|
100
100
|
"--crk-popover-shift-y": `${N}px`
|
|
101
101
|
} : void 0,
|
|
102
|
-
children: /* @__PURE__ */ m(
|
|
102
|
+
children: /* @__PURE__ */ m(f, {
|
|
103
103
|
value: W,
|
|
104
104
|
children: v
|
|
105
105
|
})
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import
|
|
3
|
-
import r from "
|
|
1
|
+
import { forwardRef as e, useMemo as t } from "react";
|
|
2
|
+
import n from "clsx";
|
|
3
|
+
import r from "./ProgressBar.module.scss.js";
|
|
4
4
|
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
5
5
|
// src/components/ProgressBar/ProgressBar.tsx
|
|
6
|
-
var o = (e, t) => `${Math.round(e / t * 100)}%`, s = (e, t) => `Step ${e + 1} of ${t}`, c =
|
|
7
|
-
let D = c > 0 ? c : 100, O =
|
|
6
|
+
var o = (e, t) => `${Math.round(e / t * 100)}%`, s = (e, t) => `Step ${e + 1} of ${t}`, c = e(({ value: e, max: c = 100, label: l, showValue: u = !1, formatValue: d = o, size: f = "md", variant: p = "primary", thresholds: m, segments: h, showCurrent: g = !1, shape: _ = "rounded", onSegmentClick: v, segmentLabel: y = s, classes: b, className: x, style: S, "aria-label": C, "aria-labelledby": w, ...T }, E) => {
|
|
7
|
+
let D = c > 0 ? c : 100, O = e === void 0 || Number.isNaN(e), k = O ? 0 : Math.min(D, Math.max(0, e)), A = k / D, j = t(() => {
|
|
8
8
|
if (O || !m?.length) return p;
|
|
9
9
|
let e = [...m].sort((e, t) => e.value - t.value), t = p;
|
|
10
10
|
for (let n of e) n.value <= k && (t = n.variant);
|
|
@@ -17,16 +17,16 @@ var o = (e, t) => `${Math.round(e / t * 100)}%`, s = (e, t) => `Step ${e + 1} of
|
|
|
17
17
|
]), M = !O && typeof h == "number" && h > 1, N = M ? Math.round(A * h) : 0, P = M && g && N < h ? N : -1, F = M && typeof v == "function", I = l != null && l !== !1, L = I || u && !O;
|
|
18
18
|
return /* @__PURE__ */ a("div", {
|
|
19
19
|
ref: E,
|
|
20
|
-
className: r
|
|
20
|
+
className: n(r.root, r[f], r[j], _ === "square" && r.square, b?.root, x),
|
|
21
21
|
style: S,
|
|
22
22
|
...T,
|
|
23
23
|
children: [L && /* @__PURE__ */ a("div", {
|
|
24
|
-
className: r
|
|
24
|
+
className: n(r.header, b?.header),
|
|
25
25
|
children: [I && /* @__PURE__ */ i("span", {
|
|
26
|
-
className: r
|
|
26
|
+
className: n(r.label, b?.label),
|
|
27
27
|
children: l
|
|
28
28
|
}), u && !O && /* @__PURE__ */ i("span", {
|
|
29
|
-
className: r
|
|
29
|
+
className: n(r.value, b?.value),
|
|
30
30
|
children: d(k, D)
|
|
31
31
|
})]
|
|
32
32
|
}), /* @__PURE__ */ i("div", {
|
|
@@ -36,18 +36,18 @@ var o = (e, t) => `${Math.round(e / t * 100)}%`, s = (e, t) => `Step ${e + 1} of
|
|
|
36
36
|
"aria-valuenow": F || O ? void 0 : k,
|
|
37
37
|
"aria-label": C ?? (typeof l == "string" ? l : void 0),
|
|
38
38
|
"aria-labelledby": w,
|
|
39
|
-
className: r
|
|
40
|
-
children: M ? Array.from({ length: h }, (
|
|
41
|
-
let a = r
|
|
39
|
+
className: n(r.track, O && r.indeterminate, M && r.segmented, F && r.clickable, b?.track),
|
|
40
|
+
children: M ? Array.from({ length: h }, (e, t) => {
|
|
41
|
+
let a = n(r.segment, t < N && r.segmentFilled, t === P && r.segmentCurrent, b?.segment, t < N && b?.segmentFilled, t === P && b?.segmentCurrent);
|
|
42
42
|
return F ? /* @__PURE__ */ i("button", {
|
|
43
43
|
type: "button",
|
|
44
44
|
className: a,
|
|
45
|
-
"aria-label": y(
|
|
46
|
-
"aria-current":
|
|
47
|
-
onClick: (e) => v?.(
|
|
48
|
-
},
|
|
45
|
+
"aria-label": y(t, h),
|
|
46
|
+
"aria-current": t === P ? "step" : void 0,
|
|
47
|
+
onClick: (e) => v?.(t, e)
|
|
48
|
+
}, t) : /* @__PURE__ */ i("span", { className: a }, t);
|
|
49
49
|
}) : /* @__PURE__ */ i("span", {
|
|
50
|
-
className: r
|
|
50
|
+
className: n(r.fill, b?.fill),
|
|
51
51
|
style: O ? void 0 : { width: `${A * 100}%` }
|
|
52
52
|
})
|
|
53
53
|
})]
|