@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,196 +1,149 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
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
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
n && t.toggleOpen,
|
|
151
|
-
T,
|
|
152
|
-
s?.toggle
|
|
153
|
-
),
|
|
154
|
-
disabled: O,
|
|
155
|
-
onClick: K,
|
|
156
|
-
"aria-haspopup": "menu",
|
|
157
|
-
"aria-expanded": n,
|
|
158
|
-
"aria-controls": n ? M : void 0,
|
|
159
|
-
"aria-label": G,
|
|
160
|
-
children: /* @__PURE__ */ r(
|
|
161
|
-
"svg",
|
|
162
|
-
{
|
|
163
|
-
className: i(t.chevron, n && t.chevronOpen, s?.chevron),
|
|
164
|
-
viewBox: "0 0 10 6",
|
|
165
|
-
"aria-hidden": "true",
|
|
166
|
-
children: /* @__PURE__ */ r("path", { d: "M1 1l4 4 4-4", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
167
|
-
}
|
|
168
|
-
)
|
|
169
|
-
}
|
|
170
|
-
)
|
|
171
|
-
] }),
|
|
172
|
-
a && !y && A(),
|
|
173
|
-
a && y && n && typeof document < "u" && ee(
|
|
174
|
-
A({
|
|
175
|
-
position: "fixed",
|
|
176
|
-
top: d.top,
|
|
177
|
-
left: v === "right" ? void 0 : d.left,
|
|
178
|
-
// clientWidth, not innerWidth: `right` on a fixed element is
|
|
179
|
-
// measured from the viewport edge inside the scrollbar, while
|
|
180
|
-
// innerWidth includes it — the menu would shift left by the
|
|
181
|
-
// scrollbar width whenever the page scrolls.
|
|
182
|
-
right: v === "right" ? document.documentElement.clientWidth - (d.left + d.width) : void 0,
|
|
183
|
-
width: d.width,
|
|
184
|
-
zIndex: "var(--crk-z-floating)"
|
|
185
|
-
}),
|
|
186
|
-
document.body
|
|
187
|
-
)
|
|
188
|
-
]
|
|
189
|
-
}
|
|
190
|
-
);
|
|
191
|
-
}
|
|
192
|
-
);
|
|
193
|
-
oe.displayName = "SplitButton";
|
|
194
|
-
export {
|
|
195
|
-
oe as SplitButton
|
|
196
|
-
};
|
|
1
|
+
import { forwardRef as e, useCallback as t, useEffect as n, useId 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 "./SplitButton.module.scss.js";
|
|
5
|
+
import l from "../Button/Button.module.scss.js";
|
|
6
|
+
import { EscapeLayerProvider as u, useEscapeLayer as d } from "../../hooks/useEscapeLayer.js";
|
|
7
|
+
import { usePortalPosition as f } from "../../hooks/usePortalPosition.js";
|
|
8
|
+
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
9
|
+
// src/components/SplitButton/SplitButton.tsx
|
|
10
|
+
var h = e(({ actions: e, variant: h = "secondary", size: g = "md", disabled: _ = !1, align: v = "right", portal: y = !0, menuLabel: b = "More actions", maxWidth: x, className: S, style: C, id: w, onOpen: T, onClose: E, classes: D }, O) => {
|
|
11
|
+
let [k, A] = a(!1), j = i(null), M = i(null), N = i(null), P = r();
|
|
12
|
+
n(() => {
|
|
13
|
+
k && M.current && M.current.querySelector("[role=\"menuitem\"]:not([disabled])")?.focus();
|
|
14
|
+
}, [k]);
|
|
15
|
+
let F = t(() => {
|
|
16
|
+
A(!1), E?.(), N.current?.focus();
|
|
17
|
+
}, [E]), I = t(() => {
|
|
18
|
+
A((e) => {
|
|
19
|
+
let t = !e;
|
|
20
|
+
return t ? T?.() : E?.(), t;
|
|
21
|
+
});
|
|
22
|
+
}, [T, E]);
|
|
23
|
+
n(() => {
|
|
24
|
+
if (!k) return;
|
|
25
|
+
let e = (e) => {
|
|
26
|
+
let t = e.target;
|
|
27
|
+
j.current?.contains(t) || M.current?.contains(t) || F();
|
|
28
|
+
};
|
|
29
|
+
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
30
|
+
}, [k, F]);
|
|
31
|
+
let L = d(F, k), R = f(j, k && y);
|
|
32
|
+
if (e.length === 0) return null;
|
|
33
|
+
let [z, ...B] = e, V = B.length > 0, H = _ || z.disabled, U = s(l.root, l[h], l[g]), W = h === "secondary" ? c.overlapOutline : h === "ghost" ? c.dividerSubtle : c.dividerOnFill, G = s(U, c.main, V && c.mainAttached, V && k && c.mainOpen, D?.main), K = (e) => x !== void 0 && (typeof e == "string" || typeof e == "number") ? String(e) : void 0, q = /* @__PURE__ */ m("span", {
|
|
34
|
+
className: c.mainContent,
|
|
35
|
+
children: [/* @__PURE__ */ p("span", {
|
|
36
|
+
className: c.mainLabel,
|
|
37
|
+
children: z.label
|
|
38
|
+
}), V && /* @__PURE__ */ p("span", {
|
|
39
|
+
className: c.sizer,
|
|
40
|
+
"aria-hidden": "true",
|
|
41
|
+
children: e.map((e, t) => /* @__PURE__ */ p("span", {
|
|
42
|
+
className: c.sizerItem,
|
|
43
|
+
children: e.label
|
|
44
|
+
}, t))
|
|
45
|
+
})]
|
|
46
|
+
}), J = z.href && !H ? /* @__PURE__ */ p("a", {
|
|
47
|
+
id: w,
|
|
48
|
+
className: G,
|
|
49
|
+
href: z.href,
|
|
50
|
+
target: z.target,
|
|
51
|
+
rel: z.target === "_blank" ? "noopener noreferrer" : void 0,
|
|
52
|
+
title: K(z.label),
|
|
53
|
+
onClick: z.onClick,
|
|
54
|
+
children: q
|
|
55
|
+
}) : /* @__PURE__ */ p("button", {
|
|
56
|
+
id: w,
|
|
57
|
+
type: "button",
|
|
58
|
+
className: G,
|
|
59
|
+
disabled: H,
|
|
60
|
+
title: K(z.label),
|
|
61
|
+
onClick: z.onClick,
|
|
62
|
+
children: q
|
|
63
|
+
}), Y = B.map((e, t) => {
|
|
64
|
+
let n = s(c.item, e.disabled && c.itemDisabled, e.danger && c.itemDanger, D?.item), r = (t) => {
|
|
65
|
+
e.onClick?.(t), F();
|
|
66
|
+
};
|
|
67
|
+
return e.href && !e.disabled ? /* @__PURE__ */ p("a", {
|
|
68
|
+
role: "menuitem",
|
|
69
|
+
className: n,
|
|
70
|
+
href: e.href,
|
|
71
|
+
target: e.target,
|
|
72
|
+
rel: e.target === "_blank" ? "noopener noreferrer" : void 0,
|
|
73
|
+
title: K(e.label),
|
|
74
|
+
onClick: r,
|
|
75
|
+
children: e.label
|
|
76
|
+
}, t) : /* @__PURE__ */ p("button", {
|
|
77
|
+
type: "button",
|
|
78
|
+
role: "menuitem",
|
|
79
|
+
className: n,
|
|
80
|
+
disabled: e.disabled,
|
|
81
|
+
title: K(e.label),
|
|
82
|
+
onClick: r,
|
|
83
|
+
children: e.label
|
|
84
|
+
}, t);
|
|
85
|
+
}), X = {
|
|
86
|
+
sm: c.menuSm,
|
|
87
|
+
md: c.menuMd,
|
|
88
|
+
lg: c.menuLg
|
|
89
|
+
}[g], Z = (e) => /* @__PURE__ */ p("div", {
|
|
90
|
+
ref: M,
|
|
91
|
+
id: P,
|
|
92
|
+
className: s(c.menu, X, k && c.menuOpen, v === "left" ? c.alignLeft : c.alignRight, D?.menu),
|
|
93
|
+
style: e,
|
|
94
|
+
role: "menu",
|
|
95
|
+
children: /* @__PURE__ */ p(u, {
|
|
96
|
+
value: L,
|
|
97
|
+
children: Y
|
|
98
|
+
})
|
|
99
|
+
});
|
|
100
|
+
return /* @__PURE__ */ m("div", {
|
|
101
|
+
ref: O,
|
|
102
|
+
className: s(c.root, D?.root, S),
|
|
103
|
+
style: x === void 0 ? C : {
|
|
104
|
+
maxWidth: x,
|
|
105
|
+
...C
|
|
106
|
+
},
|
|
107
|
+
children: [
|
|
108
|
+
/* @__PURE__ */ m("div", {
|
|
109
|
+
ref: j,
|
|
110
|
+
className: s(c.group, D?.group),
|
|
111
|
+
children: [J, V && /* @__PURE__ */ p("button", {
|
|
112
|
+
ref: N,
|
|
113
|
+
type: "button",
|
|
114
|
+
className: s(U, l.iconOnly, c.toggle, k && c.toggleOpen, W, D?.toggle),
|
|
115
|
+
disabled: _,
|
|
116
|
+
onClick: I,
|
|
117
|
+
"aria-haspopup": "menu",
|
|
118
|
+
"aria-expanded": k,
|
|
119
|
+
"aria-controls": k ? P : void 0,
|
|
120
|
+
"aria-label": b,
|
|
121
|
+
children: /* @__PURE__ */ p("svg", {
|
|
122
|
+
className: s(c.chevron, k && c.chevronOpen, D?.chevron),
|
|
123
|
+
viewBox: "0 0 10 6",
|
|
124
|
+
"aria-hidden": "true",
|
|
125
|
+
children: /* @__PURE__ */ p("path", {
|
|
126
|
+
d: "M1 1l4 4 4-4",
|
|
127
|
+
fill: "none",
|
|
128
|
+
stroke: "currentColor",
|
|
129
|
+
strokeWidth: "1.5",
|
|
130
|
+
strokeLinecap: "round",
|
|
131
|
+
strokeLinejoin: "round"
|
|
132
|
+
})
|
|
133
|
+
})
|
|
134
|
+
})]
|
|
135
|
+
}),
|
|
136
|
+
V && !y && Z(),
|
|
137
|
+
V && y && k && typeof document < "u" && o(Z({
|
|
138
|
+
position: "fixed",
|
|
139
|
+
top: R.top,
|
|
140
|
+
left: v === "right" ? void 0 : R.left,
|
|
141
|
+
right: v === "right" ? document.documentElement.clientWidth - (R.left + R.width) : void 0,
|
|
142
|
+
width: R.width,
|
|
143
|
+
zIndex: "var(--crk-z-floating)"
|
|
144
|
+
}), document.body)
|
|
145
|
+
]
|
|
146
|
+
});
|
|
147
|
+
});
|
|
148
|
+
h.displayName = "SplitButton";
|
|
149
|
+
export { h as SplitButton };
|
|
@@ -1,57 +1,31 @@
|
|
|
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
|
-
|
|
30
|
-
D as alignLeft,
|
|
31
|
-
z as alignRight,
|
|
32
|
-
d as chevron,
|
|
33
|
-
O as chevronOpen,
|
|
34
|
-
C as default,
|
|
35
|
-
g as dividerOnFill,
|
|
36
|
-
k as dividerSubtle,
|
|
37
|
-
e as group,
|
|
38
|
-
A as item,
|
|
39
|
-
f as itemDanger,
|
|
40
|
-
S as itemDisabled,
|
|
41
|
-
t as main,
|
|
42
|
-
m as mainAttached,
|
|
43
|
-
i as mainContent,
|
|
44
|
-
c as mainLabel,
|
|
45
|
-
a as mainOpen,
|
|
46
|
-
p as menu,
|
|
47
|
-
b as menuLg,
|
|
48
|
-
L as menuMd,
|
|
49
|
-
v as menuOpen,
|
|
50
|
-
h as menuSm,
|
|
51
|
-
u as overlapOutline,
|
|
52
|
-
n as root,
|
|
53
|
-
r as sizer,
|
|
54
|
-
o as sizerItem,
|
|
55
|
-
s as toggle,
|
|
56
|
-
l as toggleOpen
|
|
1
|
+
// src/components/SplitButton/SplitButton.module.scss
|
|
2
|
+
var e = "crk-root-WQNOC", t = "crk-group-vpjIZ", n = "crk-main-rC6D1", r = "crk-mainContent-ztmsF", i = "crk-mainLabel-nGrtw", a = "crk-sizer-PLveG", o = "crk-sizerItem-dwWwd", s = "crk-mainAttached-AhE-l", c = "crk-toggle-yVTi-", l = "crk-mainOpen-7hEXl", u = "crk-toggleOpen-56O29", d = "crk-dividerOnFill-HLKeu", f = "crk-dividerSubtle-g-TfH", p = "crk-overlapOutline-yWbkD", m = "crk-chevron-4zed5", h = "crk-chevronOpen-7vOPn", g = "crk-menu-2ijiM", _ = "crk-menuOpen-hANn0", v = "crk-menuEnter-xjAuj", y = "crk-menuSm-WBQSi", b = "crk-menuMd-xjRTT", x = "crk-menuLg-rXDWh", S = "crk-alignLeft-aXK9A", C = "crk-alignRight-ANsBn", w = "crk-item-rolo0", T = "crk-itemDisabled-A7T-8", E = "crk-itemDanger-g19Qe", D = {
|
|
3
|
+
root: e,
|
|
4
|
+
group: t,
|
|
5
|
+
main: n,
|
|
6
|
+
mainContent: r,
|
|
7
|
+
mainLabel: i,
|
|
8
|
+
sizer: a,
|
|
9
|
+
sizerItem: o,
|
|
10
|
+
mainAttached: s,
|
|
11
|
+
toggle: c,
|
|
12
|
+
mainOpen: l,
|
|
13
|
+
toggleOpen: u,
|
|
14
|
+
dividerOnFill: d,
|
|
15
|
+
dividerSubtle: f,
|
|
16
|
+
overlapOutline: p,
|
|
17
|
+
chevron: m,
|
|
18
|
+
chevronOpen: h,
|
|
19
|
+
menu: g,
|
|
20
|
+
menuOpen: _,
|
|
21
|
+
menuEnter: v,
|
|
22
|
+
menuSm: y,
|
|
23
|
+
menuMd: b,
|
|
24
|
+
menuLg: x,
|
|
25
|
+
alignLeft: S,
|
|
26
|
+
alignRight: C,
|
|
27
|
+
item: w,
|
|
28
|
+
itemDisabled: T,
|
|
29
|
+
itemDanger: E
|
|
57
30
|
};
|
|
31
|
+
export { S as alignLeft, C as alignRight, m as chevron, h as chevronOpen, D as default, d as dividerOnFill, f as dividerSubtle, t as group, w as item, E as itemDanger, T as itemDisabled, n as main, s as mainAttached, r as mainContent, i as mainLabel, l as mainOpen, g as menu, v as menuEnter, x as menuLg, b as menuMd, _ as menuOpen, y as menuSm, p as overlapOutline, e as root, a as sizer, o as sizerItem, c as toggle, u as toggleOpen };
|