@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,86 +1,77 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
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
|
-
|
|
74
|
-
|
|
75
|
-
}
|
|
76
|
-
),
|
|
77
|
-
document.body
|
|
78
|
-
)
|
|
79
|
-
]
|
|
80
|
-
}
|
|
81
|
-
);
|
|
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
|
+
import s from "clsx";
|
|
4
|
+
import c from "./Tooltip.module.scss.js";
|
|
5
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
6
|
+
// src/components/Tooltip/Tooltip.tsx
|
|
7
|
+
var d = 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 = i(null), x = i(null), S = i(null), [C, w] = a(!1), [T, E] = a(m), [D, O] = a({
|
|
10
|
+
top: 0,
|
|
11
|
+
left: 0
|
|
12
|
+
}), k = n(), A = e(() => {
|
|
13
|
+
S.current &&= (clearTimeout(S.current), null);
|
|
14
|
+
}, []), j = e(() => {
|
|
15
|
+
_ || f == null || f === "" || (A(), S.current = setTimeout(() => w(!0), h));
|
|
16
|
+
}, [
|
|
17
|
+
_,
|
|
18
|
+
f,
|
|
19
|
+
A,
|
|
20
|
+
h
|
|
21
|
+
]), M = e(() => {
|
|
22
|
+
A(), g > 0 ? S.current = setTimeout(() => w(!1), g) : w(!1);
|
|
23
|
+
}, [A, g]);
|
|
24
|
+
t(() => A, [A]), r(() => {
|
|
25
|
+
if (!C) return;
|
|
26
|
+
let e = () => {
|
|
27
|
+
let e = b.current, t = x.current;
|
|
28
|
+
if (!e || !t) return;
|
|
29
|
+
let n = e.getBoundingClientRect(), r = t.offsetWidth, i = t.offsetHeight, a = typeof window < "u" ? window.innerWidth : 0, o = typeof window < "u" ? window.innerHeight : 0, s = (e) => e === "top" ? n.top - i - d >= 0 : e === "bottom" ? n.bottom + i + d <= o : e === "left" ? n.left - r - d >= 0 : n.right + r + d <= a, c = {
|
|
30
|
+
top: "bottom",
|
|
31
|
+
bottom: "top",
|
|
32
|
+
left: "right",
|
|
33
|
+
right: "left"
|
|
34
|
+
}, l = s(m) || !s(c[m]) ? m : c[m], u = 0, f = 0;
|
|
35
|
+
l === "top" || l === "bottom" ? (f = n.left + n.width / 2 - r / 2, u = l === "top" ? n.top - i - d : n.bottom + d) : (u = n.top + n.height / 2 - i / 2, f = l === "left" ? n.left - r - d : n.right + d), f = Math.max(d, Math.min(f, a - r - d)), u = Math.max(d, Math.min(u, o - i - d)), E(l), O({
|
|
36
|
+
top: u,
|
|
37
|
+
left: f
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
if (e(), typeof window < "u") return window.addEventListener("scroll", e, !0), window.addEventListener("resize", e), () => {
|
|
41
|
+
window.removeEventListener("scroll", e, !0), window.removeEventListener("resize", e);
|
|
42
|
+
};
|
|
43
|
+
}, [C, m]), t(() => {
|
|
44
|
+
if (!C) return;
|
|
45
|
+
let e = (e) => {
|
|
46
|
+
e.key === "Escape" && w(!1);
|
|
47
|
+
};
|
|
48
|
+
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
49
|
+
}, [C]);
|
|
50
|
+
let N = C ? k : void 0, P = {
|
|
51
|
+
position: "fixed",
|
|
52
|
+
top: D.top,
|
|
53
|
+
left: D.left
|
|
54
|
+
};
|
|
55
|
+
return /* @__PURE__ */ u("span", {
|
|
56
|
+
ref: b,
|
|
57
|
+
className: s(c.wrapper, y?.wrapper),
|
|
58
|
+
onMouseEnter: j,
|
|
59
|
+
onMouseLeave: M,
|
|
60
|
+
onFocus: j,
|
|
61
|
+
onBlur: M,
|
|
62
|
+
"aria-describedby": N,
|
|
63
|
+
children: [p, C && typeof document < "u" && o(/* @__PURE__ */ u("div", {
|
|
64
|
+
ref: x,
|
|
65
|
+
id: k,
|
|
66
|
+
role: "tooltip",
|
|
67
|
+
className: s(c.tooltip, c[`p_${T}`], y?.tooltip),
|
|
68
|
+
style: P,
|
|
69
|
+
children: [f, !v && /* @__PURE__ */ l("span", {
|
|
70
|
+
className: s(c.arrow, y?.arrow),
|
|
71
|
+
"aria-hidden": "true"
|
|
72
|
+
})]
|
|
73
|
+
}), document.body)]
|
|
74
|
+
});
|
|
82
75
|
}
|
|
83
|
-
|
|
84
|
-
export {
|
|
85
|
-
V as Tooltip
|
|
86
|
-
};
|
|
76
|
+
f.displayName = "Tooltip";
|
|
77
|
+
export { f as Tooltip };
|
|
@@ -1,30 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
export {
|
|
17
|
-
r as arrow,
|
|
18
|
-
p as crkTooltipIn,
|
|
19
|
-
a as default,
|
|
20
|
-
i as pBottom,
|
|
21
|
-
s as pLeft,
|
|
22
|
-
e as pRight,
|
|
23
|
-
k as pTop,
|
|
24
|
-
n as p_bottom,
|
|
25
|
-
l as p_left,
|
|
26
|
-
_ as p_right,
|
|
27
|
-
c as p_top,
|
|
28
|
-
o as tooltip,
|
|
29
|
-
t as wrapper
|
|
1
|
+
// src/components/Tooltip/Tooltip.module.scss
|
|
2
|
+
var e = "crk-wrapper-V567h", t = "crk-tooltip-LjRUX", n = "crk-crk-tooltip-in-JCAKo", r = "crk-arrow-6yECM", i = "crk-p_top-I9ELz", a = "crk-p_top-I9ELz", o = "crk-p_bottom-S3gQ1", s = "crk-p_bottom-S3gQ1", c = "crk-p_left--Bx3l", l = "crk-p_left--Bx3l", u = "crk-p_right-3Wuqv", d = "crk-p_right-3Wuqv", f = {
|
|
3
|
+
wrapper: e,
|
|
4
|
+
tooltip: t,
|
|
5
|
+
"crk-tooltip-in": "crk-crk-tooltip-in-JCAKo",
|
|
6
|
+
crkTooltipIn: n,
|
|
7
|
+
arrow: r,
|
|
8
|
+
p_top: i,
|
|
9
|
+
pTop: a,
|
|
10
|
+
p_bottom: o,
|
|
11
|
+
pBottom: s,
|
|
12
|
+
p_left: c,
|
|
13
|
+
pLeft: l,
|
|
14
|
+
p_right: u,
|
|
15
|
+
pRight: d
|
|
30
16
|
};
|
|
17
|
+
export { r as arrow, n as crkTooltipIn, f as default, s as pBottom, l as pLeft, d as pRight, a as pTop, o as p_bottom, c as p_left, u as p_right, i as p_top, t as tooltip, e as wrapper };
|
|
@@ -1,37 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { createElement as e, forwardRef as t } from "react";
|
|
2
|
+
import n from "clsx";
|
|
3
3
|
import r from "./Typography.module.scss.js";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
className: a,
|
|
12
|
-
style: s,
|
|
13
|
-
children: f,
|
|
14
|
-
...y
|
|
15
|
-
}, l) => n(
|
|
16
|
-
e,
|
|
17
|
-
{
|
|
18
|
-
ref: l,
|
|
19
|
-
className: d(
|
|
20
|
-
r.root,
|
|
21
|
-
r[e],
|
|
22
|
-
o && r[o],
|
|
23
|
-
p && r[p],
|
|
24
|
-
t && r[`align-${t}`],
|
|
25
|
-
m && r.truncate,
|
|
26
|
-
a
|
|
27
|
-
),
|
|
28
|
-
style: s,
|
|
29
|
-
...y
|
|
30
|
-
},
|
|
31
|
-
f
|
|
32
|
-
)
|
|
33
|
-
);
|
|
4
|
+
// src/components/Typography/Typography.tsx
|
|
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
|
+
ref: f,
|
|
7
|
+
className: n(r.root, r[t], i && r[i], a && r[a], o && r[`align-${o}`], s && r.truncate, c),
|
|
8
|
+
style: l,
|
|
9
|
+
...d
|
|
10
|
+
}, u));
|
|
34
11
|
i.displayName = "Typography";
|
|
35
|
-
export {
|
|
36
|
-
i as Typography
|
|
37
|
-
};
|
|
12
|
+
export { i as Typography };
|
|
@@ -1,53 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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
|
-
export {
|
|
30
|
-
y as alignCenter,
|
|
31
|
-
f as alignLeft,
|
|
32
|
-
w as alignRight,
|
|
33
|
-
m as bold,
|
|
34
|
-
b as danger,
|
|
35
|
-
C as default,
|
|
36
|
-
r as h1,
|
|
37
|
-
t as h2,
|
|
38
|
-
n as h3,
|
|
39
|
-
e as h4,
|
|
40
|
-
o as h5,
|
|
41
|
-
s as h6,
|
|
42
|
-
i as label,
|
|
43
|
-
h as medium,
|
|
44
|
-
d as muted,
|
|
45
|
-
k as normal,
|
|
46
|
-
l as p,
|
|
47
|
-
u as primary,
|
|
48
|
-
c as root,
|
|
49
|
-
g as semibold,
|
|
50
|
-
a as span,
|
|
51
|
-
p as success,
|
|
52
|
-
x as truncate
|
|
1
|
+
// src/components/Typography/Typography.module.scss
|
|
2
|
+
var e = "crk-root-U-oiq", t = "crk-h1-Aivwz", n = "crk-h2-CV8Oo", r = "crk-h3-lrbrK", i = "crk-h4--jkC1", a = "crk-h5-GnQvD", o = "crk-h6-MKlIN", s = "crk-p-FzRtm", c = "crk-span-NZvLx", l = "crk-label-Cwi6a", u = "crk-normal-7AeZz", d = "crk-medium-36OXr", f = "crk-semibold-oQixc", p = "crk-bold-bk4b4", m = "crk-muted-itOSW", h = "crk-primary-rp36t", g = "crk-danger-SyOy-", _ = "crk-success-w8PpD", v = "crk-align-left-3AGYw", y = "crk-align-center-h-x--", b = "crk-align-right-IXFhK", x = "crk-truncate-eqr85", S = {
|
|
3
|
+
root: e,
|
|
4
|
+
h1: t,
|
|
5
|
+
h2: n,
|
|
6
|
+
h3: r,
|
|
7
|
+
h4: i,
|
|
8
|
+
h5: a,
|
|
9
|
+
h6: o,
|
|
10
|
+
p: s,
|
|
11
|
+
span: c,
|
|
12
|
+
label: l,
|
|
13
|
+
normal: u,
|
|
14
|
+
medium: d,
|
|
15
|
+
semibold: f,
|
|
16
|
+
bold: p,
|
|
17
|
+
default: "crk-default-79lKR",
|
|
18
|
+
muted: m,
|
|
19
|
+
primary: h,
|
|
20
|
+
danger: g,
|
|
21
|
+
success: _,
|
|
22
|
+
"align-left": "crk-align-left-3AGYw",
|
|
23
|
+
alignLeft: v,
|
|
24
|
+
"align-center": "crk-align-center-h-x--",
|
|
25
|
+
alignCenter: y,
|
|
26
|
+
"align-right": "crk-align-right-IXFhK",
|
|
27
|
+
alignRight: b,
|
|
28
|
+
truncate: x
|
|
53
29
|
};
|
|
30
|
+
export { y as alignCenter, v as alignLeft, b as alignRight, p as bold, g as danger, S as default, t as h1, n as h2, r as h3, i as h4, a as h5, o as h6, l as label, d as medium, m as muted, u as normal, s as p, h as primary, e as root, f as semibold, c as span, _ as success, x as truncate };
|
|
@@ -1,51 +1,27 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
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
|
-
style: h,
|
|
30
|
-
children: [
|
|
31
|
-
/* @__PURE__ */ f(
|
|
32
|
-
"input",
|
|
33
|
-
{
|
|
34
|
-
ref: (c) => {
|
|
35
|
-
i.current = c, typeof t == "function" ? t(c) : t && (t.current = c);
|
|
36
|
-
},
|
|
37
|
-
type: "checkbox",
|
|
38
|
-
className: s(e.input, n && e.switchInput, p && e.error, r?.input),
|
|
39
|
-
...x
|
|
40
|
-
}
|
|
41
|
-
),
|
|
42
|
-
a && /* @__PURE__ */ f("span", { className: s(e.label, r?.label), children: a })
|
|
43
|
-
]
|
|
44
|
-
}
|
|
45
|
-
);
|
|
46
|
-
}
|
|
47
|
-
);
|
|
48
|
-
y.displayName = "Checkbox";
|
|
49
|
-
export {
|
|
50
|
-
y as Checkbox
|
|
51
|
-
};
|
|
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
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
5
|
+
// src/components/inputs/Checkbox/Checkbox.tsx
|
|
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
|
+
h.current && (h.current.indeterminate = _);
|
|
10
|
+
}, [_]), /* @__PURE__ */ o("label", {
|
|
11
|
+
className: r(i.root, g && i.switchRoot, _ && i.indeterminate, u?.root, d),
|
|
12
|
+
style: f,
|
|
13
|
+
children: [/* @__PURE__ */ a("input", {
|
|
14
|
+
ref: (e) => {
|
|
15
|
+
h.current = e, typeof m == "function" ? m(e) : m && (m.current = e);
|
|
16
|
+
},
|
|
17
|
+
type: "checkbox",
|
|
18
|
+
className: r(i.input, g && i.switchInput, l && i.error, u?.input),
|
|
19
|
+
...p
|
|
20
|
+
}), e && /* @__PURE__ */ a("span", {
|
|
21
|
+
className: r(i.label, u?.label),
|
|
22
|
+
children: e
|
|
23
|
+
})]
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
s.displayName = "Checkbox";
|
|
27
|
+
export { s as Checkbox };
|
|
@@ -1,17 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export {
|
|
10
|
-
s as default,
|
|
11
|
-
e as error,
|
|
12
|
-
o as indeterminate,
|
|
13
|
-
r as input,
|
|
14
|
-
c as label,
|
|
15
|
-
t as root,
|
|
16
|
-
n as switchInput
|
|
1
|
+
// src/components/inputs/Checkbox/Checkbox.module.scss
|
|
2
|
+
var e = "crk-root-61cKD", t = "crk-input-bAjPU", n = "crk-error-8Cdk6", r = "crk-switchInput-Ichse", i = "crk-label-W9IeS", a = "crk-indeterminate-mLarv", o = {
|
|
3
|
+
root: e,
|
|
4
|
+
input: t,
|
|
5
|
+
error: n,
|
|
6
|
+
switchInput: r,
|
|
7
|
+
label: i,
|
|
8
|
+
indeterminate: a
|
|
17
9
|
};
|
|
10
|
+
export { o as default, n as error, a as indeterminate, t as input, i as label, e as root, r as switchInput };
|
|
@@ -1,111 +1,53 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import i from "
|
|
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
|
-
style: v,
|
|
56
|
-
children: p.map((e) => {
|
|
57
|
-
const r = a.includes(e.value), c = m || e.disabled;
|
|
58
|
-
return d === "chips" ? /* @__PURE__ */ w(
|
|
59
|
-
"button",
|
|
60
|
-
{
|
|
61
|
-
type: "button",
|
|
62
|
-
role: "checkbox",
|
|
63
|
-
"aria-checked": r,
|
|
64
|
-
disabled: c,
|
|
65
|
-
className: o(
|
|
66
|
-
i.chip,
|
|
67
|
-
R,
|
|
68
|
-
r && i.chipSelected,
|
|
69
|
-
h && r && i.chipChecked,
|
|
70
|
-
l?.option,
|
|
71
|
-
l?.chip,
|
|
72
|
-
r && l?.chipSelected
|
|
73
|
-
),
|
|
74
|
-
onClick: () => n(e.value),
|
|
75
|
-
children: [
|
|
76
|
-
h && // Always rendered so it can transition; collapsed to zero
|
|
77
|
-
// width when unselected, expanding in when selected. Padding
|
|
78
|
-
// stays symmetric, so the icon + label remain centered.
|
|
79
|
-
/* @__PURE__ */ s(
|
|
80
|
-
"span",
|
|
81
|
-
{
|
|
82
|
-
className: o(i.chipCheck, r && i.chipCheckVisible),
|
|
83
|
-
"aria-hidden": "true"
|
|
84
|
-
}
|
|
85
|
-
),
|
|
86
|
-
e.label
|
|
87
|
-
]
|
|
88
|
-
},
|
|
89
|
-
e.value
|
|
90
|
-
) : /* @__PURE__ */ s(
|
|
91
|
-
D,
|
|
92
|
-
{
|
|
93
|
-
name: x,
|
|
94
|
-
value: e.value,
|
|
95
|
-
label: e.label,
|
|
96
|
-
checked: r,
|
|
97
|
-
disabled: c,
|
|
98
|
-
className: o(i.option, l?.option),
|
|
99
|
-
onChange: () => n(e.value)
|
|
100
|
-
},
|
|
101
|
-
e.value
|
|
102
|
-
);
|
|
103
|
-
})
|
|
104
|
-
}
|
|
105
|
-
);
|
|
106
|
-
}
|
|
107
|
-
);
|
|
108
|
-
O.displayName = "CheckboxGroup";
|
|
109
|
-
export {
|
|
110
|
-
O as CheckboxGroup
|
|
111
|
-
};
|
|
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
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
6
|
+
// src/components/inputs/Checkbox/CheckboxGroup.tsx
|
|
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
|
+
let T = d ?? (c === "chips" ? "horizontal" : "vertical"), E = {
|
|
9
|
+
pill: r.chipPill,
|
|
10
|
+
rounded: r.chipRounded,
|
|
11
|
+
square: r.chipSquare
|
|
12
|
+
}[l], D = (e) => {
|
|
13
|
+
let t = o.includes(e) ? o.filter((t) => t !== e) : [...o, e];
|
|
14
|
+
s?.(t);
|
|
15
|
+
};
|
|
16
|
+
return /* @__PURE__ */ i("div", {
|
|
17
|
+
ref: w,
|
|
18
|
+
id: v,
|
|
19
|
+
role: "group",
|
|
20
|
+
"aria-label": y,
|
|
21
|
+
"aria-labelledby": b,
|
|
22
|
+
"aria-describedby": x,
|
|
23
|
+
"aria-invalid": S,
|
|
24
|
+
"aria-required": C || void 0,
|
|
25
|
+
className: t(r.group, r[T], c === "chips" && r.chipsGroup, p && r.error, h?.group, g),
|
|
26
|
+
style: _,
|
|
27
|
+
children: e.map((e) => {
|
|
28
|
+
let s = o.includes(e.value), l = f || e.disabled;
|
|
29
|
+
return c === "chips" ? /* @__PURE__ */ a("button", {
|
|
30
|
+
type: "button",
|
|
31
|
+
role: "checkbox",
|
|
32
|
+
"aria-checked": s,
|
|
33
|
+
disabled: l,
|
|
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
|
+
children: [u && /* @__PURE__ */ i("span", {
|
|
37
|
+
className: t(r.chipCheck, s && r.chipCheckVisible),
|
|
38
|
+
"aria-hidden": "true"
|
|
39
|
+
}), e.label]
|
|
40
|
+
}, e.value) : /* @__PURE__ */ i(n, {
|
|
41
|
+
name: m,
|
|
42
|
+
value: e.value,
|
|
43
|
+
label: e.label,
|
|
44
|
+
checked: s,
|
|
45
|
+
disabled: l,
|
|
46
|
+
className: t(r.option, h?.option),
|
|
47
|
+
onChange: () => D(e.value)
|
|
48
|
+
}, e.value);
|
|
49
|
+
})
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
o.displayName = "CheckboxGroup";
|
|
53
|
+
export { o as CheckboxGroup };
|