@overdoser/react-toolkit 0.20.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 +2 -1
- package/CHANGELOG.md +41 -0
- package/components/Accordion/Accordion.js +160 -177
- package/components/Accordion/Accordion.module.scss.js +19 -35
- package/components/ActionButton/ActionButton.js +155 -209
- package/components/ActionButton/ActionButton.module.scss.js +24 -46
- package/components/ActionButton/CopyButton.js +52 -64
- package/components/Alert/Alert.js +93 -96
- package/components/Alert/Alert.module.scss.js +17 -32
- package/components/Avatar/Avatar.js +44 -55
- package/components/Avatar/Avatar.module.scss.js +22 -42
- package/components/Badge/Badge.js +15 -37
- package/components/Badge/Badge.module.scss.js +16 -30
- package/components/Breadcrumbs/Breadcrumbs.d.ts +1 -1
- package/components/Breadcrumbs/Breadcrumbs.js +52 -48
- package/components/Breadcrumbs/Breadcrumbs.module.scss.js +9 -16
- package/components/Button/Button.js +35 -57
- package/components/Button/Button.module.scss.js +24 -46
- package/components/Card/Card.js +94 -131
- package/components/Card/Card.module.scss.js +34 -59
- package/components/Chart/AreaChart.d.ts +1 -1
- package/components/Chart/AreaChart.js +248 -249
- package/components/Chart/Axis.d.ts +2 -2
- package/components/Chart/Axis.js +34 -43
- package/components/Chart/BarChart.d.ts +1 -1
- package/components/Chart/BarChart.js +307 -348
- package/components/Chart/Chart.module.scss.js +31 -60
- package/components/Chart/ChartContainer.js +33 -41
- package/components/Chart/ChartLegend.d.ts +1 -1
- package/components/Chart/ChartLegend.js +31 -30
- package/components/Chart/ChartTooltip.d.ts +1 -1
- package/components/Chart/ChartTooltip.js +45 -40
- package/components/Chart/LineChart.d.ts +1 -1
- package/components/Chart/LineChart.js +220 -232
- package/components/Chart/PieChart.d.ts +1 -1
- package/components/Chart/PieChart.js +224 -240
- package/components/Chart/RadarChart.d.ts +1 -1
- package/components/Chart/RadarChart.js +166 -215
- package/components/Chart/Sparkline.js +73 -68
- package/components/Chart/TradingChart.d.ts +1 -1
- package/components/Chart/TradingChart.js +804 -701
- package/components/Chart/scales.js +28 -35
- package/components/Chart/trading/indicators.js +61 -62
- package/components/Chart/trading/period.js +46 -68
- package/components/Chart/useChartDimensions.js +30 -22
- package/components/Chip/Chip.js +98 -141
- package/components/Chip/Chip.module.scss.js +31 -58
- package/components/CodeBlock/CodeBlock.js +111 -119
- package/components/CodeBlock/CodeBlock.module.scss.js +22 -42
- package/components/CommandPalette/CommandPalette.js +387 -392
- package/components/CommandPalette/CommandPalette.module.scss.js +27 -48
- package/components/ConfirmDialog/ConfirmDialog.d.ts +1 -1
- package/components/ConfirmDialog/ConfirmDialog.js +184 -199
- package/components/ConfirmDialog/ConfirmDialog.module.scss.js +11 -20
- package/components/Divider/Divider.js +25 -36
- package/components/Divider/Divider.module.scss.js +16 -30
- package/components/Draggable/Draggable.d.ts +1 -1
- package/components/Draggable/Draggable.js +157 -164
- package/components/Draggable/Draggable.module.scss.js +9 -16
- package/components/Drawer/Drawer.js +104 -126
- package/components/Drawer/Drawer.module.scss.js +65 -118
- package/components/Dropdown/Dropdown.js +175 -234
- package/components/Dropdown/Dropdown.module.scss.js +28 -52
- package/components/Dropdown/DropdownItem.js +55 -58
- package/components/Dropdown/DropdownLabel.js +14 -11
- package/components/Dropdown/DropdownSeparator.js +13 -11
- package/components/Dropdown/dropdownContext.js +4 -5
- package/components/Dropdown/useContextMenu.js +27 -17
- package/components/Dropzone/Dropzone.js +99 -105
- package/components/Dropzone/Dropzone.module.scss.js +11 -20
- package/components/EmptyState/EmptyState.js +57 -54
- package/components/EmptyState/EmptyState.module.scss.js +13 -24
- package/components/Form/Form.d.ts +1 -1
- package/components/Form/Form.js +31 -34
- package/components/Form/Form.module.scss.js +15 -28
- package/components/Form/FormField.d.ts +1 -1
- package/components/Form/FormField.js +71 -75
- package/components/Form/FormRow.d.ts +1 -1
- package/components/Form/FormRow.js +11 -8
- package/components/Form/formFieldDefaults.js +4 -5
- package/components/ImageViewer/ImageViewer.js +312 -201
- package/components/ImageViewer/ImageViewer.module.scss.js +25 -46
- package/components/ImageViewer/useZoomPan.js +206 -137
- package/components/Kbd/Kbd.js +24 -21
- package/components/Kbd/Kbd.module.scss.js +9 -16
- package/components/KeyValueList/KeyValueList.js +119 -123
- package/components/KeyValueList/KeyValueList.module.scss.js +22 -42
- package/components/Link/Link.js +45 -59
- package/components/Link/Link.module.scss.js +9 -15
- package/components/List/List.js +22 -46
- package/components/List/List.module.scss.js +11 -20
- package/components/Loader/Loader.js +152 -182
- package/components/Loader/Loader.module.scss.js +39 -69
- package/components/Modal/Modal.js +93 -105
- package/components/Modal/Modal.module.scss.js +17 -32
- package/components/PageHeader/PageHeader.js +79 -73
- package/components/PageHeader/PageHeader.module.scss.js +22 -42
- package/components/Pagination/Pagination.js +62 -83
- package/components/Pagination/Pagination.module.scss.js +12 -22
- package/components/Pagination/paginationRange.js +15 -22
- package/components/Popover/Popover.js +110 -134
- package/components/Popover/Popover.module.scss.js +11 -20
- package/components/ProgressBar/ProgressBar.d.ts +15 -1
- package/components/ProgressBar/ProgressBar.js +56 -89
- package/components/ProgressBar/ProgressBar.module.scss.js +28 -50
- package/components/RelativeTime/RelativeTime.js +36 -43
- package/components/RelativeTime/RelativeTime.module.scss.js +3 -7
- package/components/SegmentedControl/SegmentedControl.js +93 -129
- package/components/SegmentedControl/SegmentedControl.module.scss.js +20 -38
- package/components/Skeleton/Skeleton.js +36 -50
- package/components/Skeleton/Skeleton.module.scss.js +14 -24
- package/components/Spinner/Spinner.js +25 -25
- package/components/Spinner/Spinner.module.scss.js +11 -19
- package/components/SplitButton/SplitButton.js +149 -196
- package/components/SplitButton/SplitButton.module.scss.js +30 -56
- package/components/SplitPane/SplitPane.js +134 -170
- package/components/SplitPane/SplitPane.module.scss.js +13 -24
- package/components/StatCard/StatCard.js +132 -125
- package/components/StatCard/StatCard.module.scss.js +41 -71
- package/components/StatusDot/StatusDot.js +28 -39
- package/components/StatusDot/StatusDot.module.scss.js +17 -31
- package/components/Table/Table.d.ts +1 -1
- package/components/Table/Table.js +381 -451
- package/components/Table/Table.module.scss.js +41 -80
- package/components/Table/useTableSort.js +51 -42
- package/components/Tabs/Tabs.js +109 -161
- package/components/Tabs/Tabs.module.scss.js +27 -52
- package/components/ThemeToggle/ThemeToggle.js +122 -98
- package/components/ThemeToggle/ThemeToggle.module.scss.js +12 -22
- package/components/Timeline/GanttTimeline.js +357 -318
- package/components/Timeline/GanttTimeline.module.scss.js +28 -54
- package/components/Timeline/HistoryTimeline.js +486 -450
- package/components/Timeline/HistoryTimeline.module.scss.js +30 -58
- package/components/Timeline/Timeline.module.scss.js +75 -140
- package/components/Timeline/TimelineShared.d.ts +7 -7
- package/components/Timeline/TimelineShared.js +288 -279
- package/components/Timeline/TraceEventDetails.d.ts +3 -3
- package/components/Timeline/TraceEventDetails.js +244 -177
- package/components/Timeline/TraceTimeline.js +823 -783
- package/components/Timeline/TraceTimeline.module.scss.js +97 -188
- package/components/Timeline/historyLayout.js +336 -263
- package/components/Timeline/timelineCore.js +208 -183
- package/components/Timeline/traceEvent.js +59 -61
- package/components/Timeline/traceLayout.js +101 -90
- package/components/Timeline/useTimeline.js +76 -79
- package/components/Timer/Timer.js +190 -156
- package/components/Timer/Timer.module.scss.js +28 -54
- package/components/Toast/Toast.d.ts +1 -1
- package/components/Toast/Toast.js +128 -128
- package/components/Toast/Toast.module.scss.js +36 -61
- package/components/Toast/toastStore.js +58 -62
- package/components/ToggleIconButton/ToggleIconButton.js +36 -58
- package/components/ToggleIconButton/ToggleIconButton.module.scss.js +14 -26
- package/components/Tooltip/Tooltip.d.ts +1 -1
- package/components/Tooltip/Tooltip.js +76 -85
- package/components/Tooltip/Tooltip.module.scss.js +16 -29
- package/components/Typography/Typography.js +10 -35
- package/components/Typography/Typography.module.scss.js +29 -52
- package/components/inputs/Checkbox/Checkbox.js +27 -51
- package/components/inputs/Checkbox/Checkbox.module.scss.js +9 -16
- package/components/inputs/Checkbox/CheckboxGroup.js +53 -111
- package/components/inputs/Checkbox/CheckboxGroup.module.scss.js +16 -30
- package/components/inputs/DatePicker/CalendarPanel.d.ts +1 -1
- package/components/inputs/DatePicker/CalendarPanel.js +263 -286
- package/components/inputs/DatePicker/CalendarPanel.module.scss.js +22 -40
- package/components/inputs/DatePicker/DatePicker.js +115 -142
- package/components/inputs/DatePicker/DatePicker.module.scss.js +13 -24
- package/components/inputs/DatePicker/dateUtils.js +32 -41
- package/components/inputs/DateTimePicker/DateTimePicker.js +226 -232
- package/components/inputs/DateTimePicker/DateTimePicker.module.scss.js +19 -36
- package/components/inputs/DateTimePicker/DateTimeSegments.js +273 -252
- package/components/inputs/DateTimePicker/TimeField.d.ts +1 -1
- package/components/inputs/DateTimePicker/TimeField.js +131 -132
- package/components/inputs/DateTimePicker/timeZoneUtils.js +95 -92
- package/components/inputs/Input/Input.js +98 -109
- package/components/inputs/Input/Input.module.scss.js +14 -26
- package/components/inputs/NumberInput/NumberInput.js +112 -132
- package/components/inputs/NumberInput/NumberInput.module.scss.js +13 -24
- package/components/inputs/Radio/Radio.js +50 -73
- package/components/inputs/Radio/Radio.module.scss.js +8 -14
- package/components/inputs/SearchInput/SearchInput.js +98 -115
- package/components/inputs/SearchInput/SearchInput.module.scss.js +7 -12
- package/components/inputs/Select/Select.d.ts +55 -3
- package/components/inputs/Select/Select.js +696 -682
- package/components/inputs/Select/Select.module.scss.js +49 -72
- package/components/inputs/Slider/Slider.js +97 -128
- package/components/inputs/Slider/Slider.module.scss.js +8 -14
- package/components/inputs/Switch/Switch.js +11 -8
- package/components/inputs/Textarea/Textarea.js +42 -58
- package/components/inputs/Textarea/Textarea.module.scss.js +13 -24
- package/hooks/useClickOutside.js +17 -14
- package/hooks/useDebouncedValue.js +13 -14
- package/hooks/useElementSize.js +27 -22
- package/hooks/useEscapeLayer.js +28 -29
- package/hooks/useFocusTrap.js +27 -38
- package/hooks/useKeyboard.js +76 -64
- package/hooks/useMediaQuery.js +10 -15
- package/hooks/useNow.js +28 -33
- package/hooks/usePersistedState.js +98 -94
- package/hooks/usePortalPosition.d.ts +2 -1
- package/hooks/usePortalPosition.js +28 -19
- package/hooks/useResizable.js +106 -104
- package/hooks/useTheme.js +28 -23
- package/index.css +2 -1
- package/index.js +96 -214
- package/index.layered.css +2 -3
- package/llms.txt +28 -4
- package/manifest.json +41 -4
- package/package.json +1 -1
- package/utils/formatBytes.js +29 -13
- package/utils/themeScript.js +6 -8
- package/utils/timeAgo.js +59 -32
|
@@ -1,108 +1,96 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
);
|
|
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
|
+
// src/components/Modal/Modal.tsx
|
|
9
|
+
var m = e({
|
|
10
|
+
classes: {},
|
|
11
|
+
titleId: ""
|
|
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
|
+
children: e
|
|
21
|
+
}), i && /* @__PURE__ */ f("button", {
|
|
22
|
+
type: "button",
|
|
23
|
+
className: s(d.closeButton, a.closeButton),
|
|
24
|
+
onClick: i,
|
|
25
|
+
"aria-label": "Close",
|
|
26
|
+
children: "×"
|
|
27
|
+
})]
|
|
28
|
+
});
|
|
30
29
|
};
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
h.displayName = "Modal.Header";
|
|
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
|
+
children: e
|
|
37
|
+
});
|
|
35
38
|
};
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
open: e,
|
|
45
|
-
onClose: a,
|
|
46
|
-
closeOnBackdrop: l = !0,
|
|
47
|
-
closeOnEscape: r = !0,
|
|
48
|
-
size: c = "md",
|
|
49
|
-
classes: i,
|
|
50
|
-
className: w,
|
|
51
|
-
style: x,
|
|
52
|
-
children: k,
|
|
53
|
-
"aria-label": y,
|
|
54
|
-
"aria-labelledby": C
|
|
55
|
-
}, n) => {
|
|
56
|
-
const b = v(null), T = (o) => {
|
|
57
|
-
b.current = o, typeof n == "function" ? n(o) : n && (n.current = o);
|
|
58
|
-
}, g = P(), h = C ?? `${g}-title`;
|
|
59
|
-
O(b, e);
|
|
60
|
-
const I = U(() => {
|
|
61
|
-
r && a();
|
|
62
|
-
}, e);
|
|
63
|
-
j(() => {
|
|
64
|
-
if (!e) return;
|
|
65
|
-
const o = document.body.style.overflow;
|
|
66
|
-
return document.body.style.overflow = "hidden", () => {
|
|
67
|
-
document.body.style.overflow = o;
|
|
68
|
-
};
|
|
69
|
-
}, [e]);
|
|
70
|
-
const f = v(!1), F = (o) => {
|
|
71
|
-
f.current = o.target === o.currentTarget;
|
|
72
|
-
}, R = (o) => {
|
|
73
|
-
l && f.current && o.target === o.currentTarget && a(), f.current = !1;
|
|
74
|
-
};
|
|
75
|
-
return e ? L(
|
|
76
|
-
/* @__PURE__ */ s(
|
|
77
|
-
"div",
|
|
78
|
-
{
|
|
79
|
-
className: d(t.backdrop, i?.backdrop),
|
|
80
|
-
onMouseDown: F,
|
|
81
|
-
onMouseUp: R,
|
|
82
|
-
role: "presentation",
|
|
83
|
-
children: /* @__PURE__ */ s(
|
|
84
|
-
"div",
|
|
85
|
-
{
|
|
86
|
-
ref: T,
|
|
87
|
-
className: d(t.modal, t[c], i?.modal, w),
|
|
88
|
-
style: x,
|
|
89
|
-
role: "dialog",
|
|
90
|
-
"aria-modal": "true",
|
|
91
|
-
"aria-label": y,
|
|
92
|
-
"aria-labelledby": y ? void 0 : h,
|
|
93
|
-
children: /* @__PURE__ */ s(u.Provider, { value: { classes: i ?? {}, titleId: h }, children: /* @__PURE__ */ s(S, { value: I, children: k }) })
|
|
94
|
-
}
|
|
95
|
-
)
|
|
96
|
-
}
|
|
97
|
-
),
|
|
98
|
-
document.body
|
|
99
|
-
) : null;
|
|
100
|
-
}
|
|
101
|
-
);
|
|
102
|
-
m.displayName = "Modal";
|
|
103
|
-
m.Header = N;
|
|
104
|
-
m.Body = M;
|
|
105
|
-
m.Footer = B;
|
|
106
|
-
export {
|
|
107
|
-
m as Modal
|
|
39
|
+
g.displayName = "Modal.Body";
|
|
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
|
+
children: e
|
|
46
|
+
});
|
|
108
47
|
};
|
|
48
|
+
_.displayName = "Modal.Footer";
|
|
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
|
+
C.current = e, typeof S == "function" ? S(e) : S && (S.current = e);
|
|
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
|
+
return document.body.style.overflow = "hidden", () => {
|
|
61
|
+
document.body.style.overflow = t;
|
|
62
|
+
};
|
|
63
|
+
}, [e]);
|
|
64
|
+
let O = a(!1);
|
|
65
|
+
return e ? o(/* @__PURE__ */ f("div", {
|
|
66
|
+
className: s(d.backdrop, g?.backdrop),
|
|
67
|
+
onMouseDown: (e) => {
|
|
68
|
+
O.current = e.target === e.currentTarget;
|
|
69
|
+
},
|
|
70
|
+
onMouseUp: (e) => {
|
|
71
|
+
n && O.current && e.target === e.currentTarget && t(), O.current = !1;
|
|
72
|
+
},
|
|
73
|
+
role: "presentation",
|
|
74
|
+
children: /* @__PURE__ */ f("div", {
|
|
75
|
+
ref: w,
|
|
76
|
+
className: s(d.modal, d[h], g?.modal, _),
|
|
77
|
+
style: v,
|
|
78
|
+
role: "dialog",
|
|
79
|
+
"aria-modal": "true",
|
|
80
|
+
"aria-label": b,
|
|
81
|
+
"aria-labelledby": b ? void 0 : E,
|
|
82
|
+
children: /* @__PURE__ */ f(m.Provider, {
|
|
83
|
+
value: {
|
|
84
|
+
classes: g ?? {},
|
|
85
|
+
titleId: E
|
|
86
|
+
},
|
|
87
|
+
children: /* @__PURE__ */ f(l, {
|
|
88
|
+
value: D,
|
|
89
|
+
children: y
|
|
90
|
+
})
|
|
91
|
+
})
|
|
92
|
+
})
|
|
93
|
+
}), document.body) : null;
|
|
94
|
+
});
|
|
95
|
+
v.displayName = "Modal", v.Header = h, v.Body = g, v.Footer = _;
|
|
96
|
+
export { v as Modal };
|
|
@@ -1,33 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
export {
|
|
18
|
-
o as backdrop,
|
|
19
|
-
c as backdropIn,
|
|
20
|
-
h as body,
|
|
21
|
-
m as closeButton,
|
|
22
|
-
f as default,
|
|
23
|
-
b as footer,
|
|
24
|
-
n as fullscreen,
|
|
25
|
-
l as header,
|
|
26
|
-
a as headerTitle,
|
|
27
|
-
k as headerWithClose,
|
|
28
|
-
d as lg,
|
|
29
|
-
s as md,
|
|
30
|
-
e as modal,
|
|
31
|
-
r as modalIn,
|
|
32
|
-
t as sm
|
|
1
|
+
// src/components/Modal/Modal.module.scss
|
|
2
|
+
var e = "crk-backdrop-jYpTA", t = "crk-backdropIn-x5Z-A", n = "crk-modal-yNG-7", r = "crk-modalIn-xFUwm", i = "crk-sm--xyY9", a = "crk-md-ETTfh", o = "crk-lg-5DBb7", s = "crk-fullscreen-b4jQ-", c = "crk-header-NS30G", l = "crk-headerTitle-tJ2Qv", u = "crk-headerWithClose-4davm", d = "crk-closeButton-JX-aq", f = "crk-body-3zIj9", p = "crk-footer-Oyz-R", m = {
|
|
3
|
+
backdrop: e,
|
|
4
|
+
backdropIn: t,
|
|
5
|
+
modal: n,
|
|
6
|
+
modalIn: r,
|
|
7
|
+
sm: i,
|
|
8
|
+
md: a,
|
|
9
|
+
lg: o,
|
|
10
|
+
fullscreen: s,
|
|
11
|
+
header: c,
|
|
12
|
+
headerTitle: l,
|
|
13
|
+
headerWithClose: u,
|
|
14
|
+
closeButton: d,
|
|
15
|
+
body: f,
|
|
16
|
+
footer: p
|
|
33
17
|
};
|
|
18
|
+
export { e as backdrop, t as backdropIn, f as body, d as closeButton, m as default, p as footer, s as fullscreen, c as header, l as headerTitle, u as headerWithClose, o as lg, a as md, n as modal, r as modalIn, i as sm };
|
|
@@ -1,73 +1,79 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import r from "
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
)
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
1
|
+
import { createElement as e, forwardRef as t } from "react";
|
|
2
|
+
import n from "clsx";
|
|
3
|
+
import r from "./PageHeader.module.scss.js";
|
|
4
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
5
|
+
// src/components/PageHeader/PageHeader.tsx
|
|
6
|
+
var o = /* @__PURE__ */ i("svg", {
|
|
7
|
+
viewBox: "0 0 20 20",
|
|
8
|
+
fill: "none",
|
|
9
|
+
stroke: "currentColor",
|
|
10
|
+
strokeWidth: "2",
|
|
11
|
+
"aria-hidden": "true",
|
|
12
|
+
width: "1em",
|
|
13
|
+
height: "1em",
|
|
14
|
+
children: /* @__PURE__ */ i("path", {
|
|
15
|
+
d: "M12 4l-6 6 6 6",
|
|
16
|
+
strokeLinecap: "round",
|
|
17
|
+
strokeLinejoin: "round"
|
|
18
|
+
})
|
|
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
|
+
let E = f === void 0 ? p ? /* @__PURE__ */ a("button", {
|
|
21
|
+
type: "button",
|
|
22
|
+
onClick: p,
|
|
23
|
+
className: n(r.back, x?.back),
|
|
24
|
+
children: [o, m]
|
|
25
|
+
}) : null : /* @__PURE__ */ a("a", {
|
|
26
|
+
href: f,
|
|
27
|
+
className: n(r.back, x?.back),
|
|
28
|
+
children: [o, m]
|
|
29
|
+
});
|
|
30
|
+
return /* @__PURE__ */ a("header", {
|
|
31
|
+
ref: T,
|
|
32
|
+
className: n(r.root, r[y], v && r.divider, b && r.sticky, _ && r.hasTabs, x?.root, S),
|
|
33
|
+
...w,
|
|
34
|
+
children: [
|
|
35
|
+
d && /* @__PURE__ */ i("div", {
|
|
36
|
+
className: n(r.breadcrumbs, x?.breadcrumbs),
|
|
37
|
+
children: d
|
|
38
|
+
}),
|
|
39
|
+
E,
|
|
40
|
+
/* @__PURE__ */ a("div", {
|
|
41
|
+
className: n(r.titleRow, x?.titleRow),
|
|
42
|
+
children: [/* @__PURE__ */ a("div", {
|
|
43
|
+
className: r.titleBlock,
|
|
44
|
+
children: [
|
|
45
|
+
/* @__PURE__ */ a("div", {
|
|
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
|
+
children: h
|
|
50
|
+
})]
|
|
51
|
+
}),
|
|
52
|
+
c && /* @__PURE__ */ i("p", {
|
|
53
|
+
className: n(r.subtitle, x?.subtitle),
|
|
54
|
+
children: c
|
|
55
|
+
}),
|
|
56
|
+
l && /* @__PURE__ */ i("p", {
|
|
57
|
+
className: n(r.description, x?.description),
|
|
58
|
+
children: l
|
|
59
|
+
}),
|
|
60
|
+
g && /* @__PURE__ */ i("div", {
|
|
61
|
+
className: n(r.meta, x?.meta),
|
|
62
|
+
children: g
|
|
63
|
+
})
|
|
64
|
+
]
|
|
65
|
+
}), u && /* @__PURE__ */ i("div", {
|
|
66
|
+
className: n(r.actions, x?.actions),
|
|
67
|
+
children: u
|
|
68
|
+
})]
|
|
69
|
+
}),
|
|
70
|
+
C,
|
|
71
|
+
_ && /* @__PURE__ */ i("div", {
|
|
72
|
+
className: n(r.tabs, x?.tabs),
|
|
73
|
+
children: _
|
|
74
|
+
})
|
|
75
|
+
]
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
s.displayName = "PageHeader";
|
|
79
|
+
export { s as PageHeader };
|
|
@@ -1,43 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
export {
|
|
23
|
-
p as actions,
|
|
24
|
-
k as back,
|
|
25
|
-
m as badge,
|
|
26
|
-
n as breadcrumbs,
|
|
27
|
-
L as default,
|
|
28
|
-
g as description,
|
|
29
|
-
e as divider,
|
|
30
|
-
i as hasTabs,
|
|
31
|
-
o as lg,
|
|
32
|
-
s as md,
|
|
33
|
-
T as meta,
|
|
34
|
-
t as root,
|
|
35
|
-
c as sm,
|
|
36
|
-
r as sticky,
|
|
37
|
-
u as subtitle,
|
|
38
|
-
B as tabs,
|
|
39
|
-
d as title,
|
|
40
|
-
l as titleBlock,
|
|
41
|
-
b as titleLine,
|
|
42
|
-
a as titleRow
|
|
1
|
+
// src/components/PageHeader/PageHeader.module.scss
|
|
2
|
+
var e = "crk-root-K-SAd", t = "crk-sm-XJoTL", n = "crk-md-obtrZ", r = "crk-lg--8FAx", i = "crk-divider-q-A5e", a = "crk-hasTabs-YLYqx", o = "crk-sticky-e3pQP", s = "crk-breadcrumbs-rTXxK", c = "crk-back-R4Oq3", l = "crk-titleRow-4-MEi", u = "crk-titleBlock-37A6l", d = "crk-titleLine-oWB7d", f = "crk-title-1nY9v", p = "crk-badge-Uesjc", m = "crk-subtitle-BREZj", h = "crk-description--PNl0", g = "crk-meta-fkWcX", _ = "crk-actions-EYOW1", v = "crk-tabs-qDTiN", y = {
|
|
3
|
+
root: e,
|
|
4
|
+
sm: t,
|
|
5
|
+
md: n,
|
|
6
|
+
lg: r,
|
|
7
|
+
divider: i,
|
|
8
|
+
hasTabs: a,
|
|
9
|
+
sticky: o,
|
|
10
|
+
breadcrumbs: s,
|
|
11
|
+
back: c,
|
|
12
|
+
titleRow: l,
|
|
13
|
+
titleBlock: u,
|
|
14
|
+
titleLine: d,
|
|
15
|
+
title: f,
|
|
16
|
+
badge: p,
|
|
17
|
+
subtitle: m,
|
|
18
|
+
description: h,
|
|
19
|
+
meta: g,
|
|
20
|
+
actions: _,
|
|
21
|
+
tabs: v
|
|
43
22
|
};
|
|
23
|
+
export { _ as actions, c as back, p as badge, s as breadcrumbs, y as default, h as description, i as divider, a as hasTabs, r as lg, n as md, g as meta, e as root, t as sm, o as sticky, m as subtitle, v as tabs, f as title, u as titleBlock, d as titleLine, l as titleRow };
|
|
@@ -1,84 +1,63 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import l from "clsx";
|
|
1
|
+
import { forwardRef as e, useState as t } from "react";
|
|
2
|
+
import n from "clsx";
|
|
4
3
|
import r from "./Pagination.module.scss.js";
|
|
5
|
-
import { paginationRange as
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
className: l(r.item, o === n && r.active, e?.item, o === n && e?.active),
|
|
66
|
-
onClick: () => v(o),
|
|
67
|
-
disabled: u,
|
|
68
|
-
"aria-current": o === n ? "page" : void 0,
|
|
69
|
-
"aria-label": `Go to page ${o}`,
|
|
70
|
-
children: o
|
|
71
|
-
}
|
|
72
|
-
) }, o)
|
|
73
|
-
),
|
|
74
|
-
m && s("next", "right", n + 1, "Go to next page"),
|
|
75
|
-
f && s("last", "last", i, "Go to last page")
|
|
76
|
-
] })
|
|
77
|
-
}
|
|
78
|
-
);
|
|
79
|
-
}
|
|
80
|
-
);
|
|
81
|
-
z.displayName = "Pagination";
|
|
82
|
-
export {
|
|
83
|
-
z as Pagination
|
|
84
|
-
};
|
|
4
|
+
import { paginationRange as i } from "./paginationRange.js";
|
|
5
|
+
import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
6
|
+
// src/components/Pagination/Pagination.tsx
|
|
7
|
+
var c = ({ dir: e }) => /* @__PURE__ */ o("svg", {
|
|
8
|
+
viewBox: "0 0 12 12",
|
|
9
|
+
fill: "none",
|
|
10
|
+
stroke: "currentColor",
|
|
11
|
+
strokeWidth: "1.5",
|
|
12
|
+
strokeLinecap: "round",
|
|
13
|
+
strokeLinejoin: "round",
|
|
14
|
+
"aria-hidden": "true",
|
|
15
|
+
children: {
|
|
16
|
+
left: /* @__PURE__ */ o("path", { d: "M7 2L3 6l4 4" }),
|
|
17
|
+
right: /* @__PURE__ */ o("path", { d: "M5 2l4 4-4 4" }),
|
|
18
|
+
first: /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ o("path", { d: "M8 2L4 6l4 4" }), /* @__PURE__ */ o("path", { d: "M4 2v8" })] }),
|
|
19
|
+
last: /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ o("path", { d: "M4 2l4 4-4 4" }), /* @__PURE__ */ o("path", { d: "M8 2v8" })] })
|
|
20
|
+
}[e]
|
|
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
|
+
let t = Math.min(Math.max(e, 1), w);
|
|
24
|
+
t !== O && (T || D(t), f?.(t));
|
|
25
|
+
}, A = i(O, w, p, m), j = (e, t, i, a) => /* @__PURE__ */ o("li", { children: /* @__PURE__ */ o("button", {
|
|
26
|
+
type: "button",
|
|
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
|
+
"aria-label": a,
|
|
31
|
+
children: /* @__PURE__ */ o(c, { dir: t })
|
|
32
|
+
}) }, e);
|
|
33
|
+
return /* @__PURE__ */ o("nav", {
|
|
34
|
+
ref: C,
|
|
35
|
+
"aria-label": y,
|
|
36
|
+
className: n(r.root, r[_], b?.root, x),
|
|
37
|
+
...S,
|
|
38
|
+
children: /* @__PURE__ */ s("ul", {
|
|
39
|
+
className: n(r.list, b?.list),
|
|
40
|
+
children: [
|
|
41
|
+
g && j("first", "first", 1, "Go to first page"),
|
|
42
|
+
h && j("prev", "left", O - 1, "Go to previous page"),
|
|
43
|
+
A.map((e, t) => e === "ellipsis" ? /* @__PURE__ */ o("li", {
|
|
44
|
+
"aria-hidden": "true",
|
|
45
|
+
className: n(r.ellipsis, b?.ellipsis),
|
|
46
|
+
children: "…"
|
|
47
|
+
}, `e${t}`) : /* @__PURE__ */ o("li", { children: /* @__PURE__ */ o("button", {
|
|
48
|
+
type: "button",
|
|
49
|
+
className: n(r.item, e === O && r.active, b?.item, e === O && b?.active),
|
|
50
|
+
onClick: () => k(e),
|
|
51
|
+
disabled: v,
|
|
52
|
+
"aria-current": e === O ? "page" : void 0,
|
|
53
|
+
"aria-label": `Go to page ${e}`,
|
|
54
|
+
children: e
|
|
55
|
+
}) }, e)),
|
|
56
|
+
h && j("next", "right", O + 1, "Go to next page"),
|
|
57
|
+
g && j("last", "last", w, "Go to last page")
|
|
58
|
+
]
|
|
59
|
+
})
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
l.displayName = "Pagination";
|
|
63
|
+
export { l as Pagination };
|