@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,49 +1,28 @@
|
|
|
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
|
-
r as breadcrumb,
|
|
28
|
-
D as default,
|
|
29
|
-
f as footer,
|
|
30
|
-
s as group,
|
|
31
|
-
m as groupLabel,
|
|
32
|
-
c as header,
|
|
33
|
-
i as headerSpinner,
|
|
34
|
-
o as input,
|
|
35
|
-
a as item,
|
|
36
|
-
p as itemActive,
|
|
37
|
-
u as itemChevron,
|
|
38
|
-
b as itemDescription,
|
|
39
|
-
k as itemDisabled,
|
|
40
|
-
l as itemIcon,
|
|
41
|
-
h as itemLabel,
|
|
42
|
-
g as itemShortcut,
|
|
43
|
-
d as itemText,
|
|
44
|
-
n as list,
|
|
45
|
-
L as loading,
|
|
46
|
-
v as match,
|
|
47
|
-
S as message,
|
|
48
|
-
t as panel
|
|
1
|
+
// src/components/CommandPalette/CommandPalette.module.scss
|
|
2
|
+
var e = "crk-backdrop-85I58", t = "crk-paletteBackdropIn-OuahC", n = "crk-panel-RBr7A", r = "crk-paletteIn-K7Qg9", i = "crk-header-WpV0d", a = "crk-breadcrumb-yrjqZ", o = "crk-input-1yX4p", s = "crk-headerSpinner-vWtoV", c = "crk-list-Z8b3Q", l = "crk-group-hKsgv", u = "crk-groupLabel-S-h3h", d = "crk-item-TULJl", f = "crk-itemActive-T5Hpv", p = "crk-itemDisabled-A-ped", m = "crk-itemIcon-Ruqhi", h = "crk-itemText-nEkyw", g = "crk-itemLabel-03iZM", _ = "crk-itemDescription-ehmYh", v = "crk-itemChevron-234PX", y = "crk-itemShortcut-OHXBv", b = "crk-match--l5e2", x = "crk-message-TgWpQ", S = "crk-loading-fcSft", C = "crk-footer-bwQFJ", w = {
|
|
3
|
+
backdrop: e,
|
|
4
|
+
paletteBackdropIn: t,
|
|
5
|
+
panel: n,
|
|
6
|
+
paletteIn: r,
|
|
7
|
+
header: i,
|
|
8
|
+
breadcrumb: a,
|
|
9
|
+
input: o,
|
|
10
|
+
headerSpinner: s,
|
|
11
|
+
list: c,
|
|
12
|
+
group: l,
|
|
13
|
+
groupLabel: u,
|
|
14
|
+
item: d,
|
|
15
|
+
itemActive: f,
|
|
16
|
+
itemDisabled: p,
|
|
17
|
+
itemIcon: m,
|
|
18
|
+
itemText: h,
|
|
19
|
+
itemLabel: g,
|
|
20
|
+
itemDescription: _,
|
|
21
|
+
itemChevron: v,
|
|
22
|
+
itemShortcut: y,
|
|
23
|
+
match: b,
|
|
24
|
+
message: x,
|
|
25
|
+
loading: S,
|
|
26
|
+
footer: C
|
|
49
27
|
};
|
|
28
|
+
export { e as backdrop, a as breadcrumb, w as default, C as footer, l as group, u as groupLabel, i as header, s as headerSpinner, o as input, d as item, f as itemActive, v as itemChevron, _ as itemDescription, p as itemDisabled, m as itemIcon, g as itemLabel, y as itemShortcut, h as itemText, c as list, S as loading, b as match, x as message, t as paletteBackdropIn, r as paletteIn, n as panel };
|
|
@@ -101,7 +101,7 @@ export interface ConfirmProviderProps {
|
|
|
101
101
|
* <App />
|
|
102
102
|
* </ConfirmProvider>
|
|
103
103
|
*/
|
|
104
|
-
export declare function ConfirmProvider({ children, defaults }: ConfirmProviderProps): import("react
|
|
104
|
+
export declare function ConfirmProvider({ children, defaults }: ConfirmProviderProps): import("react").JSX.Element;
|
|
105
105
|
export declare namespace ConfirmProvider {
|
|
106
106
|
var displayName: string;
|
|
107
107
|
}
|
|
@@ -1,201 +1,186 @@
|
|
|
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
|
-
|
|
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
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
{
|
|
180
|
-
...E,
|
|
181
|
-
open: u !== null,
|
|
182
|
-
onConfirm: P,
|
|
183
|
-
onCancel: p,
|
|
184
|
-
children: d
|
|
185
|
-
},
|
|
186
|
-
u?.id ?? "idle"
|
|
187
|
-
)
|
|
188
|
-
] });
|
|
1
|
+
import { createContext as e, forwardRef as t, useCallback as n, useContext as r, useEffect as i, useId as a, useMemo as o, useRef as s, useState as c } from "react";
|
|
2
|
+
import l from "clsx";
|
|
3
|
+
import { Modal as u } from "../Modal/Modal.js";
|
|
4
|
+
import { Button as d } from "../Button/Button.js";
|
|
5
|
+
import { Input as f } from "../inputs/Input/Input.js";
|
|
6
|
+
import p from "./ConfirmDialog.module.scss.js";
|
|
7
|
+
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
8
|
+
// src/components/ConfirmDialog/ConfirmDialog.tsx
|
|
9
|
+
var g = /* @__PURE__ */ m("svg", {
|
|
10
|
+
viewBox: "0 0 20 20",
|
|
11
|
+
fill: "currentColor",
|
|
12
|
+
"aria-hidden": "true",
|
|
13
|
+
children: /* @__PURE__ */ m("path", {
|
|
14
|
+
fillRule: "evenodd",
|
|
15
|
+
d: "M8.26 3.1c.77-1.33 2.71-1.33 3.48 0l5.58 9.67c.77 1.33-.19 3-1.74 3H4.42c-1.55 0-2.51-1.67-1.74-3L8.26 3.1zM10 7a1 1 0 011 1v3a1 1 0 11-2 0V8a1 1 0 011-1zm0 7a1 1 0 100-2 1 1 0 000 2z",
|
|
16
|
+
clipRule: "evenodd"
|
|
17
|
+
})
|
|
18
|
+
}), _ = (e) => String(e?.message ?? e), v = t(({ open: e, onConfirm: t, onCancel: r, title: v = "Are you sure?", description: y, children: b, confirmLabel: x = "Confirm", cancelLabel: S = "Cancel", danger: C = !1, requireText: w, icon: T, autoFocus: E, closeOnBackdrop: D = !0, errorMessage: O = _, "aria-label": k, classes: A, className: j, style: M }, N) => {
|
|
19
|
+
let [P, F] = c(!1), [I, L] = c(void 0), [R, z] = c(""), B = s(null), V = s(null), H = s(null), U = s(!0), W = a();
|
|
20
|
+
i(() => (U.current = !0, () => {
|
|
21
|
+
U.current = !1;
|
|
22
|
+
}), []), i(() => {
|
|
23
|
+
e || (F(!1), L(void 0), z(""));
|
|
24
|
+
}, [e]);
|
|
25
|
+
let G = E ?? (C ? "cancel" : "confirm");
|
|
26
|
+
i(() => {
|
|
27
|
+
e && (w ? H.current : G === "cancel" ? V.current : B.current)?.focus();
|
|
28
|
+
}, [
|
|
29
|
+
e,
|
|
30
|
+
G,
|
|
31
|
+
w
|
|
32
|
+
]);
|
|
33
|
+
let K = w === void 0 || R === w, q = K && !P, J = n(async () => {
|
|
34
|
+
if (!q) return;
|
|
35
|
+
L(void 0);
|
|
36
|
+
let e;
|
|
37
|
+
try {
|
|
38
|
+
e = t();
|
|
39
|
+
} catch (e) {
|
|
40
|
+
L(e);
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
if (e && typeof e.then == "function") {
|
|
44
|
+
F(!0);
|
|
45
|
+
try {
|
|
46
|
+
await e;
|
|
47
|
+
} catch (e) {
|
|
48
|
+
U.current && L(e);
|
|
49
|
+
} finally {
|
|
50
|
+
U.current && F(!1);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}, [q, t]), Y = n(() => {
|
|
54
|
+
P || r();
|
|
55
|
+
}, [P, r]), X = T === !1 ? null : T === void 0 ? C ? g : null : T, Z = o(() => ({
|
|
56
|
+
modal: A?.modal,
|
|
57
|
+
header: A?.header,
|
|
58
|
+
body: A?.body,
|
|
59
|
+
footer: A?.footer
|
|
60
|
+
}), [A]);
|
|
61
|
+
return /* @__PURE__ */ h(u, {
|
|
62
|
+
ref: N,
|
|
63
|
+
open: e,
|
|
64
|
+
onClose: Y,
|
|
65
|
+
size: "sm",
|
|
66
|
+
closeOnBackdrop: D && !P,
|
|
67
|
+
closeOnEscape: !P,
|
|
68
|
+
classes: Z,
|
|
69
|
+
className: l(p.root, C && p.danger, j),
|
|
70
|
+
style: M,
|
|
71
|
+
"aria-label": typeof v == "string" ? v : v ? void 0 : k,
|
|
72
|
+
children: [
|
|
73
|
+
v ? /* @__PURE__ */ m(u.Header, {
|
|
74
|
+
onClose: P ? void 0 : Y,
|
|
75
|
+
children: /* @__PURE__ */ h("span", {
|
|
76
|
+
className: p.titleRow,
|
|
77
|
+
children: [X && /* @__PURE__ */ m("span", {
|
|
78
|
+
className: l(p.icon, A?.icon),
|
|
79
|
+
"aria-hidden": "true",
|
|
80
|
+
children: X
|
|
81
|
+
}), /* @__PURE__ */ m("span", {
|
|
82
|
+
className: p.title,
|
|
83
|
+
children: v
|
|
84
|
+
})]
|
|
85
|
+
})
|
|
86
|
+
}) : null,
|
|
87
|
+
/* @__PURE__ */ h(u.Body, { children: [
|
|
88
|
+
y && /* @__PURE__ */ m("div", {
|
|
89
|
+
className: l(p.description, A?.description),
|
|
90
|
+
children: y
|
|
91
|
+
}),
|
|
92
|
+
b,
|
|
93
|
+
w !== void 0 && /* @__PURE__ */ h("div", {
|
|
94
|
+
className: l(p.input, A?.input),
|
|
95
|
+
children: [/* @__PURE__ */ h("label", {
|
|
96
|
+
htmlFor: W,
|
|
97
|
+
className: p.inputLabel,
|
|
98
|
+
children: [
|
|
99
|
+
"Type ",
|
|
100
|
+
/* @__PURE__ */ m("b", { children: w }),
|
|
101
|
+
" to confirm"
|
|
102
|
+
]
|
|
103
|
+
}), /* @__PURE__ */ m(f, {
|
|
104
|
+
ref: H,
|
|
105
|
+
id: W,
|
|
106
|
+
value: R,
|
|
107
|
+
onChange: (e) => z(e.target.value),
|
|
108
|
+
onKeyDown: (e) => {
|
|
109
|
+
e.key === "Enter" && q && (e.preventDefault(), J());
|
|
110
|
+
},
|
|
111
|
+
autoComplete: "off",
|
|
112
|
+
spellCheck: !1,
|
|
113
|
+
disabled: P,
|
|
114
|
+
"aria-invalid": R.length > 0 && !K || void 0
|
|
115
|
+
})]
|
|
116
|
+
}),
|
|
117
|
+
I !== void 0 && /* @__PURE__ */ m("div", {
|
|
118
|
+
role: "alert",
|
|
119
|
+
className: l(p.error, A?.error),
|
|
120
|
+
children: O(I)
|
|
121
|
+
})
|
|
122
|
+
] }),
|
|
123
|
+
/* @__PURE__ */ h(u.Footer, { children: [/* @__PURE__ */ m(d, {
|
|
124
|
+
ref: V,
|
|
125
|
+
variant: "ghost",
|
|
126
|
+
onClick: Y,
|
|
127
|
+
disabled: P,
|
|
128
|
+
className: l(p.cancel, A?.cancel),
|
|
129
|
+
children: S
|
|
130
|
+
}), /* @__PURE__ */ m(d, {
|
|
131
|
+
ref: B,
|
|
132
|
+
variant: C ? "danger" : "primary",
|
|
133
|
+
onClick: () => void J(),
|
|
134
|
+
loading: P,
|
|
135
|
+
disabled: !K,
|
|
136
|
+
className: l(p.confirm, A?.confirm),
|
|
137
|
+
children: x
|
|
138
|
+
})] })
|
|
139
|
+
]
|
|
140
|
+
});
|
|
141
|
+
});
|
|
142
|
+
v.displayName = "ConfirmDialog";
|
|
143
|
+
var y = e(null), b = 0;
|
|
144
|
+
function x({ children: e, defaults: t }) {
|
|
145
|
+
let [r, i] = c(null), a = s(null);
|
|
146
|
+
a.current = r;
|
|
147
|
+
let o = n((e = {}) => new Promise((n) => {
|
|
148
|
+
a.current?.resolve(!1);
|
|
149
|
+
let r = {
|
|
150
|
+
id: ++b,
|
|
151
|
+
options: {
|
|
152
|
+
...t,
|
|
153
|
+
...e
|
|
154
|
+
},
|
|
155
|
+
resolve: n
|
|
156
|
+
};
|
|
157
|
+
a.current = r, i(r);
|
|
158
|
+
}), [t]), l = n((e, t) => {
|
|
159
|
+
a.current === e && (a.current = null, i(null), e.resolve(t));
|
|
160
|
+
}, []), u = n(async () => {
|
|
161
|
+
let e = a.current;
|
|
162
|
+
if (!e) return;
|
|
163
|
+
let t = e.options.onConfirm?.();
|
|
164
|
+
t && typeof t.then == "function" && await t, l(e, !0);
|
|
165
|
+
}, [l]), d = n(() => {
|
|
166
|
+
let e = a.current;
|
|
167
|
+
e && l(e, !1);
|
|
168
|
+
}, [l]), { body: f, onConfirm: p, ...g } = r?.options ?? {};
|
|
169
|
+
return /* @__PURE__ */ h(y.Provider, {
|
|
170
|
+
value: o,
|
|
171
|
+
children: [e, /* @__PURE__ */ m(v, {
|
|
172
|
+
...g,
|
|
173
|
+
open: r !== null,
|
|
174
|
+
onConfirm: u,
|
|
175
|
+
onCancel: d,
|
|
176
|
+
children: f
|
|
177
|
+
}, r?.id ?? "idle")]
|
|
178
|
+
});
|
|
189
179
|
}
|
|
190
|
-
|
|
191
|
-
function
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
return e;
|
|
180
|
+
x.displayName = "ConfirmProvider";
|
|
181
|
+
function S() {
|
|
182
|
+
let e = r(y);
|
|
183
|
+
if (!e) throw Error("useConfirm() must be used inside a <ConfirmProvider>.");
|
|
184
|
+
return e;
|
|
196
185
|
}
|
|
197
|
-
export {
|
|
198
|
-
J as ConfirmDialog,
|
|
199
|
-
le as ConfirmProvider,
|
|
200
|
-
he as useConfirm
|
|
201
|
-
};
|
|
186
|
+
export { v as ConfirmDialog, x as ConfirmProvider, S as useConfirm };
|
|
@@ -1,21 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export {
|
|
12
|
-
r as danger,
|
|
13
|
-
l as default,
|
|
14
|
-
o as description,
|
|
15
|
-
s as error,
|
|
16
|
-
n as icon,
|
|
17
|
-
e as input,
|
|
18
|
-
i as inputLabel,
|
|
19
|
-
c as title,
|
|
20
|
-
t as titleRow
|
|
1
|
+
// src/components/ConfirmDialog/ConfirmDialog.module.scss
|
|
2
|
+
var e = "crk-titleRow-45dc7", t = "crk-title-Y07Q8", n = "crk-icon-8MwQK", r = "crk-danger-yQ2Yd", i = "crk-description-KCKQ-", a = "crk-input--R-KC", o = "crk-inputLabel-mD7a2", s = "crk-error-f81j6", c = {
|
|
3
|
+
titleRow: e,
|
|
4
|
+
title: t,
|
|
5
|
+
icon: n,
|
|
6
|
+
danger: r,
|
|
7
|
+
description: i,
|
|
8
|
+
input: a,
|
|
9
|
+
inputLabel: o,
|
|
10
|
+
error: s
|
|
21
11
|
};
|
|
12
|
+
export { r as danger, c as default, i as description, s as error, n as icon, a as input, o as inputLabel, t as title, e as titleRow };
|
|
@@ -1,36 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import r from "
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
/* @__PURE__ */ e("span", { className: a(r.label, l?.label), children: n }),
|
|
27
|
-
/* @__PURE__ */ e("span", { className: a(r.line, l?.line) })
|
|
28
|
-
] }) : null
|
|
29
|
-
}
|
|
30
|
-
);
|
|
31
|
-
}
|
|
32
|
-
);
|
|
33
|
-
N.displayName = "Divider";
|
|
34
|
-
export {
|
|
35
|
-
N as Divider
|
|
36
|
-
};
|
|
1
|
+
import { forwardRef as e } from "react";
|
|
2
|
+
import t from "clsx";
|
|
3
|
+
import n from "./Divider.module.scss.js";
|
|
4
|
+
import { Fragment as r, jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
5
|
+
// src/components/Divider/Divider.tsx
|
|
6
|
+
var o = e(({ orientation: e = "horizontal", variant: o = "solid", label: s, labelPosition: c = "center", classes: l, className: u, ...d }, f) => {
|
|
7
|
+
let p = s != null && e === "horizontal";
|
|
8
|
+
return /* @__PURE__ */ i("div", {
|
|
9
|
+
ref: f,
|
|
10
|
+
role: "separator",
|
|
11
|
+
"aria-orientation": e,
|
|
12
|
+
className: t(n.root, n[e], n[o], p && n.withLabel, p && n[`label_${c}`], l?.root, u),
|
|
13
|
+
...d,
|
|
14
|
+
children: p ? /* @__PURE__ */ a(r, { children: [
|
|
15
|
+
/* @__PURE__ */ i("span", { className: t(n.line, l?.line) }),
|
|
16
|
+
/* @__PURE__ */ i("span", {
|
|
17
|
+
className: t(n.label, l?.label),
|
|
18
|
+
children: s
|
|
19
|
+
}),
|
|
20
|
+
/* @__PURE__ */ i("span", { className: t(n.line, l?.line) })
|
|
21
|
+
] }) : null
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
o.displayName = "Divider";
|
|
25
|
+
export { o as Divider };
|
|
@@ -1,31 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
export {
|
|
17
|
-
o as dashed,
|
|
18
|
-
h as default,
|
|
19
|
-
c as dotted,
|
|
20
|
-
t as horizontal,
|
|
21
|
-
s as label,
|
|
22
|
-
k as labelEnd,
|
|
23
|
-
b as labelStart,
|
|
24
|
-
i as label_end,
|
|
25
|
-
d as label_start,
|
|
26
|
-
n as line,
|
|
27
|
-
l as root,
|
|
28
|
-
a as solid,
|
|
29
|
-
e as vertical,
|
|
30
|
-
r as withLabel
|
|
1
|
+
// src/components/Divider/Divider.module.scss
|
|
2
|
+
var e = "crk-root-NGCl-", t = "crk-horizontal-X75Kv", n = "crk-vertical-RMtD4", r = "crk-solid-TBm4T", i = "crk-dashed-SegXI", a = "crk-dotted--Swoe", o = "crk-withLabel-Eu-NF", s = "crk-line-27unV", c = "crk-label-cjRGC", l = "crk-label_start-KQBPQ", u = "crk-label_start-KQBPQ", d = "crk-label_end-i4XW3", f = "crk-label_end-i4XW3", p = {
|
|
3
|
+
root: e,
|
|
4
|
+
horizontal: t,
|
|
5
|
+
vertical: n,
|
|
6
|
+
solid: r,
|
|
7
|
+
dashed: i,
|
|
8
|
+
dotted: a,
|
|
9
|
+
withLabel: o,
|
|
10
|
+
line: s,
|
|
11
|
+
label: c,
|
|
12
|
+
label_start: l,
|
|
13
|
+
labelStart: u,
|
|
14
|
+
label_end: d,
|
|
15
|
+
labelEnd: f
|
|
31
16
|
};
|
|
17
|
+
export { i as dashed, p as default, a as dotted, t as horizontal, c as label, f as labelEnd, u as labelStart, d as label_end, l as label_start, s as line, e as root, r as solid, n as vertical, o as withLabel };
|
|
@@ -42,7 +42,7 @@ export interface DraggableHandleProps extends ComponentPropsWithoutRef<'div'> {
|
|
|
42
42
|
* Grab area for a `<Draggable>`. Place it inside the container; only this element
|
|
43
43
|
* initiates dragging, and it's keyboard-movable (arrow keys) when focused.
|
|
44
44
|
*/
|
|
45
|
-
declare function DraggableHandle({ children, className, style, ...rest }: DraggableHandleProps): import("react
|
|
45
|
+
declare function DraggableHandle({ children, className, style, ...rest }: DraggableHandleProps): import("react").JSX.Element;
|
|
46
46
|
declare namespace DraggableHandle {
|
|
47
47
|
var displayName: string;
|
|
48
48
|
}
|