@overdoser/react-toolkit 0.20.0 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +1 -1
- package/CHANGELOG.md +14 -0
- package/components/Accordion/Accordion.js +160 -177
- package/components/Accordion/Accordion.module.js +20 -0
- package/components/ActionButton/ActionButton.js +155 -209
- package/components/ActionButton/ActionButton.module.js +25 -0
- package/components/ActionButton/CopyButton.js +52 -64
- package/components/Alert/Alert.js +92 -95
- package/components/Alert/Alert.module.js +18 -0
- package/components/Avatar/Avatar.js +44 -55
- package/components/Avatar/Avatar.module.js +23 -0
- package/components/Badge/Badge.js +16 -38
- package/components/Badge/Badge.module.js +17 -0
- package/components/Breadcrumbs/Breadcrumbs.d.ts +1 -1
- package/components/Breadcrumbs/Breadcrumbs.js +52 -48
- package/components/Breadcrumbs/Breadcrumbs.module.js +10 -0
- package/components/Button/Button.js +35 -57
- package/components/Button/Button.module.js +25 -0
- package/components/Card/Card.js +94 -131
- package/components/Card/Card.module.js +35 -0
- 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.js +32 -0
- 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 +46 -41
- 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.js +32 -0
- package/components/CodeBlock/CodeBlock.js +111 -119
- package/components/CodeBlock/CodeBlock.module.js +23 -0
- package/components/CommandPalette/CommandPalette.js +387 -392
- package/components/CommandPalette/CommandPalette.module.js +28 -0
- package/components/ConfirmDialog/ConfirmDialog.d.ts +1 -1
- package/components/ConfirmDialog/ConfirmDialog.js +184 -199
- package/components/ConfirmDialog/ConfirmDialog.module.js +12 -0
- package/components/Divider/Divider.js +25 -36
- package/components/Divider/Divider.module.js +17 -0
- package/components/Draggable/Draggable.d.ts +1 -1
- package/components/Draggable/Draggable.js +157 -164
- package/components/Draggable/Draggable.module.js +10 -0
- package/components/Drawer/Drawer.js +104 -126
- package/components/Drawer/Drawer.module.js +66 -0
- package/components/Dropdown/Dropdown.js +175 -234
- package/components/Dropdown/Dropdown.module.js +29 -0
- package/components/Dropdown/DropdownItem.js +55 -58
- package/components/Dropdown/DropdownLabel.js +14 -11
- package/components/Dropdown/DropdownSeparator.js +12 -10
- 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.js +12 -0
- package/components/EmptyState/EmptyState.js +58 -55
- package/components/EmptyState/EmptyState.module.js +14 -0
- package/components/Form/Form.d.ts +1 -1
- package/components/Form/Form.js +32 -35
- package/components/Form/Form.module.js +16 -0
- 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.js +26 -0
- package/components/ImageViewer/useZoomPan.js +206 -137
- package/components/Kbd/Kbd.js +25 -22
- package/components/Kbd/Kbd.module.js +10 -0
- package/components/KeyValueList/KeyValueList.js +119 -123
- package/components/KeyValueList/KeyValueList.module.js +23 -0
- package/components/Link/Link.js +45 -59
- package/components/Link/Link.module.js +10 -0
- package/components/List/List.js +22 -46
- package/components/List/List.module.js +12 -0
- package/components/Loader/Loader.js +152 -182
- package/components/Loader/Loader.module.js +40 -0
- package/components/Modal/Modal.js +93 -105
- package/components/Modal/Modal.module.js +18 -0
- package/components/PageHeader/PageHeader.js +78 -72
- package/components/PageHeader/PageHeader.module.js +23 -0
- package/components/Pagination/Pagination.js +63 -84
- package/components/Pagination/Pagination.module.js +13 -0
- package/components/Pagination/paginationRange.js +15 -22
- package/components/Popover/Popover.js +110 -134
- package/components/Popover/Popover.module.js +12 -0
- package/components/ProgressBar/ProgressBar.d.ts +15 -1
- package/components/ProgressBar/ProgressBar.js +57 -90
- package/components/ProgressBar/ProgressBar.module.js +29 -0
- package/components/RelativeTime/RelativeTime.js +36 -43
- package/components/RelativeTime/RelativeTime.module.js +3 -0
- package/components/SegmentedControl/SegmentedControl.js +94 -130
- package/components/SegmentedControl/SegmentedControl.module.js +21 -0
- package/components/Skeleton/Skeleton.js +36 -50
- package/components/Skeleton/Skeleton.module.js +15 -0
- package/components/Spinner/Spinner.js +25 -25
- package/components/Spinner/Spinner.module.js +12 -0
- package/components/SplitButton/SplitButton.js +149 -196
- package/components/SplitButton/SplitButton.module.js +31 -0
- package/components/SplitPane/SplitPane.js +134 -170
- package/components/SplitPane/SplitPane.module.js +14 -0
- package/components/StatCard/StatCard.js +132 -125
- package/components/StatCard/StatCard.module.js +42 -0
- package/components/StatusDot/StatusDot.js +28 -39
- package/components/StatusDot/StatusDot.module.js +18 -0
- package/components/Table/Table.d.ts +1 -1
- package/components/Table/Table.js +381 -451
- package/components/Table/Table.module.js +42 -0
- package/components/Table/useTableSort.js +51 -42
- package/components/Tabs/Tabs.js +109 -161
- package/components/Tabs/Tabs.module.js +28 -0
- package/components/ThemeToggle/ThemeToggle.js +122 -98
- package/components/ThemeToggle/ThemeToggle.module.js +13 -0
- package/components/Timeline/GanttTimeline.js +357 -318
- package/components/Timeline/GanttTimeline.module.js +29 -0
- package/components/Timeline/HistoryTimeline.js +486 -450
- package/components/Timeline/HistoryTimeline.module.js +31 -0
- package/components/Timeline/Timeline.module.js +76 -0
- 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 +245 -178
- package/components/Timeline/TraceTimeline.js +823 -783
- package/components/Timeline/TraceTimeline.module.js +98 -0
- 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.js +29 -0
- package/components/Toast/Toast.d.ts +1 -1
- package/components/Toast/Toast.js +128 -128
- package/components/Toast/Toast.module.js +37 -0
- package/components/Toast/toastStore.js +58 -62
- package/components/ToggleIconButton/ToggleIconButton.js +35 -57
- package/components/ToggleIconButton/ToggleIconButton.module.js +15 -0
- package/components/Tooltip/Tooltip.d.ts +1 -1
- package/components/Tooltip/Tooltip.js +76 -85
- package/components/Tooltip/Tooltip.module.js +17 -0
- package/components/Typography/Typography.js +11 -36
- package/components/Typography/Typography.module.js +30 -0
- package/components/inputs/Checkbox/Checkbox.js +27 -51
- package/components/inputs/Checkbox/Checkbox.module.js +10 -0
- package/components/inputs/Checkbox/CheckboxGroup.js +53 -111
- package/components/inputs/Checkbox/CheckboxGroup.module.js +17 -0
- package/components/inputs/DatePicker/CalendarPanel.d.ts +1 -1
- package/components/inputs/DatePicker/CalendarPanel.js +263 -286
- package/components/inputs/DatePicker/CalendarPanel.module.js +23 -0
- package/components/inputs/DatePicker/DatePicker.js +115 -142
- package/components/inputs/DatePicker/DatePicker.module.js +14 -0
- package/components/inputs/DatePicker/dateUtils.js +32 -41
- package/components/inputs/DateTimePicker/DateTimePicker.js +226 -232
- package/components/inputs/DateTimePicker/DateTimePicker.module.js +20 -0
- 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.js +15 -0
- package/components/inputs/NumberInput/NumberInput.js +112 -132
- package/components/inputs/NumberInput/NumberInput.module.js +14 -0
- package/components/inputs/Radio/Radio.js +50 -73
- package/components/inputs/Radio/Radio.module.js +9 -0
- package/components/inputs/SearchInput/SearchInput.js +98 -115
- package/components/inputs/SearchInput/SearchInput.module.js +8 -0
- package/components/inputs/Select/Select.js +555 -682
- package/components/inputs/Select/Select.module.js +38 -0
- package/components/inputs/Slider/Slider.js +97 -128
- package/components/inputs/Slider/Slider.module.js +9 -0
- package/components/inputs/Switch/Switch.js +11 -8
- package/components/inputs/Textarea/Textarea.js +42 -58
- package/components/inputs/Textarea/Textarea.module.js +14 -0
- 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.js +25 -19
- package/hooks/useResizable.js +106 -104
- package/hooks/useTheme.js +28 -23
- package/index.css +2 -1
- package/index.js +97 -215
- package/index.layered.css +2 -3
- package/llms.txt +3 -0
- package/manifest.json +8 -0
- package/package.json +1 -1
- package/utils/formatBytes.js +29 -13
- package/utils/themeScript.js +6 -8
- package/utils/timeAgo.js +59 -32
- package/components/Accordion/Accordion.module.scss.js +0 -36
- package/components/ActionButton/ActionButton.module.scss.js +0 -47
- package/components/Alert/Alert.module.scss.js +0 -33
- package/components/Avatar/Avatar.module.scss.js +0 -43
- package/components/Badge/Badge.module.scss.js +0 -31
- package/components/Breadcrumbs/Breadcrumbs.module.scss.js +0 -17
- package/components/Button/Button.module.scss.js +0 -47
- package/components/Card/Card.module.scss.js +0 -60
- package/components/Chart/Chart.module.scss.js +0 -61
- package/components/Chip/Chip.module.scss.js +0 -59
- package/components/CodeBlock/CodeBlock.module.scss.js +0 -43
- package/components/CommandPalette/CommandPalette.module.scss.js +0 -49
- package/components/ConfirmDialog/ConfirmDialog.module.scss.js +0 -21
- package/components/Divider/Divider.module.scss.js +0 -31
- package/components/Draggable/Draggable.module.scss.js +0 -17
- package/components/Drawer/Drawer.module.scss.js +0 -119
- package/components/Dropdown/Dropdown.module.scss.js +0 -53
- package/components/Dropzone/Dropzone.module.scss.js +0 -21
- package/components/EmptyState/EmptyState.module.scss.js +0 -25
- package/components/Form/Form.module.scss.js +0 -29
- package/components/ImageViewer/ImageViewer.module.scss.js +0 -47
- package/components/Kbd/Kbd.module.scss.js +0 -17
- package/components/KeyValueList/KeyValueList.module.scss.js +0 -43
- package/components/Link/Link.module.scss.js +0 -16
- package/components/List/List.module.scss.js +0 -21
- package/components/Loader/Loader.module.scss.js +0 -70
- package/components/Modal/Modal.module.scss.js +0 -33
- package/components/PageHeader/PageHeader.module.scss.js +0 -43
- package/components/Pagination/Pagination.module.scss.js +0 -23
- package/components/Popover/Popover.module.scss.js +0 -21
- package/components/ProgressBar/ProgressBar.module.scss.js +0 -51
- package/components/RelativeTime/RelativeTime.module.scss.js +0 -7
- package/components/SegmentedControl/SegmentedControl.module.scss.js +0 -39
- package/components/Skeleton/Skeleton.module.scss.js +0 -25
- package/components/Spinner/Spinner.module.scss.js +0 -20
- package/components/SplitButton/SplitButton.module.scss.js +0 -57
- package/components/SplitPane/SplitPane.module.scss.js +0 -25
- package/components/StatCard/StatCard.module.scss.js +0 -72
- package/components/StatusDot/StatusDot.module.scss.js +0 -32
- package/components/Table/Table.module.scss.js +0 -81
- package/components/Tabs/Tabs.module.scss.js +0 -53
- package/components/ThemeToggle/ThemeToggle.module.scss.js +0 -23
- package/components/Timeline/GanttTimeline.module.scss.js +0 -55
- package/components/Timeline/HistoryTimeline.module.scss.js +0 -59
- package/components/Timeline/Timeline.module.scss.js +0 -141
- package/components/Timeline/TraceTimeline.module.scss.js +0 -189
- package/components/Timer/Timer.module.scss.js +0 -55
- package/components/Toast/Toast.module.scss.js +0 -62
- package/components/ToggleIconButton/ToggleIconButton.module.scss.js +0 -27
- package/components/Tooltip/Tooltip.module.scss.js +0 -30
- package/components/Typography/Typography.module.scss.js +0 -53
- package/components/inputs/Checkbox/Checkbox.module.scss.js +0 -17
- package/components/inputs/Checkbox/CheckboxGroup.module.scss.js +0 -31
- package/components/inputs/DatePicker/CalendarPanel.module.scss.js +0 -41
- package/components/inputs/DatePicker/DatePicker.module.scss.js +0 -25
- package/components/inputs/DateTimePicker/DateTimePicker.module.scss.js +0 -37
- package/components/inputs/Input/Input.module.scss.js +0 -27
- package/components/inputs/NumberInput/NumberInput.module.scss.js +0 -25
- package/components/inputs/Radio/Radio.module.scss.js +0 -15
- package/components/inputs/SearchInput/SearchInput.module.scss.js +0 -13
- package/components/inputs/Select/Select.module.scss.js +0 -73
- package/components/inputs/Slider/Slider.module.scss.js +0 -15
- package/components/inputs/Textarea/Textarea.module.scss.js +0 -25
|
@@ -0,0 +1,28 @@
|
|
|
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
|
|
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 { Modal as e } from "../Modal/Modal.js";
|
|
2
|
+
import { Button as t } from "../Button/Button.js";
|
|
3
|
+
import { Input as n } from "../inputs/Input/Input.js";
|
|
4
|
+
import r from "./ConfirmDialog.module.js";
|
|
5
|
+
import { createContext as i, forwardRef as a, useCallback as o, useContext as s, useEffect as c, useId as l, useMemo as u, useRef as d, useState as f } from "react";
|
|
6
|
+
import p from "clsx";
|
|
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 = a(({ open: i, onConfirm: a, onCancel: s, 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] = f(!1), [I, L] = f(void 0), [R, z] = f(""), B = d(null), V = d(null), H = d(null), U = d(!0), W = l();
|
|
20
|
+
c(() => (U.current = !0, () => {
|
|
21
|
+
U.current = !1;
|
|
22
|
+
}), []), c(() => {
|
|
23
|
+
i || (F(!1), L(void 0), z(""));
|
|
24
|
+
}, [i]);
|
|
25
|
+
let G = E ?? (C ? "cancel" : "confirm");
|
|
26
|
+
c(() => {
|
|
27
|
+
i && (w ? H.current : G === "cancel" ? V.current : B.current)?.focus();
|
|
28
|
+
}, [
|
|
29
|
+
i,
|
|
30
|
+
G,
|
|
31
|
+
w
|
|
32
|
+
]);
|
|
33
|
+
let K = w === void 0 || R === w, q = K && !P, J = o(async () => {
|
|
34
|
+
if (!q) return;
|
|
35
|
+
L(void 0);
|
|
36
|
+
let e;
|
|
37
|
+
try {
|
|
38
|
+
e = a();
|
|
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, a]), Y = o(() => {
|
|
54
|
+
P || s();
|
|
55
|
+
}, [P, s]), X = T === !1 ? null : T === void 0 ? C ? g : null : T, Z = u(() => ({
|
|
56
|
+
modal: A?.modal,
|
|
57
|
+
header: A?.header,
|
|
58
|
+
body: A?.body,
|
|
59
|
+
footer: A?.footer
|
|
60
|
+
}), [A]);
|
|
61
|
+
return /* @__PURE__ */ h(e, {
|
|
62
|
+
ref: N,
|
|
63
|
+
open: i,
|
|
64
|
+
onClose: Y,
|
|
65
|
+
size: "sm",
|
|
66
|
+
closeOnBackdrop: D && !P,
|
|
67
|
+
closeOnEscape: !P,
|
|
68
|
+
classes: Z,
|
|
69
|
+
className: p(r.root, C && r.danger, j),
|
|
70
|
+
style: M,
|
|
71
|
+
"aria-label": typeof v == "string" ? v : v ? void 0 : k,
|
|
72
|
+
children: [
|
|
73
|
+
v ? /* @__PURE__ */ m(e.Header, {
|
|
74
|
+
onClose: P ? void 0 : Y,
|
|
75
|
+
children: /* @__PURE__ */ h("span", {
|
|
76
|
+
className: r.titleRow,
|
|
77
|
+
children: [X && /* @__PURE__ */ m("span", {
|
|
78
|
+
className: p(r.icon, A?.icon),
|
|
79
|
+
"aria-hidden": "true",
|
|
80
|
+
children: X
|
|
81
|
+
}), /* @__PURE__ */ m("span", {
|
|
82
|
+
className: r.title,
|
|
83
|
+
children: v
|
|
84
|
+
})]
|
|
85
|
+
})
|
|
86
|
+
}) : null,
|
|
87
|
+
/* @__PURE__ */ h(e.Body, { children: [
|
|
88
|
+
y && /* @__PURE__ */ m("div", {
|
|
89
|
+
className: p(r.description, A?.description),
|
|
90
|
+
children: y
|
|
91
|
+
}),
|
|
92
|
+
b,
|
|
93
|
+
w !== void 0 && /* @__PURE__ */ h("div", {
|
|
94
|
+
className: p(r.input, A?.input),
|
|
95
|
+
children: [/* @__PURE__ */ h("label", {
|
|
96
|
+
htmlFor: W,
|
|
97
|
+
className: r.inputLabel,
|
|
98
|
+
children: [
|
|
99
|
+
"Type ",
|
|
100
|
+
/* @__PURE__ */ m("b", { children: w }),
|
|
101
|
+
" to confirm"
|
|
102
|
+
]
|
|
103
|
+
}), /* @__PURE__ */ m(n, {
|
|
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: p(r.error, A?.error),
|
|
120
|
+
children: O(I)
|
|
121
|
+
})
|
|
122
|
+
] }),
|
|
123
|
+
/* @__PURE__ */ h(e.Footer, { children: [/* @__PURE__ */ m(t, {
|
|
124
|
+
ref: V,
|
|
125
|
+
variant: "ghost",
|
|
126
|
+
onClick: Y,
|
|
127
|
+
disabled: P,
|
|
128
|
+
className: p(r.cancel, A?.cancel),
|
|
129
|
+
children: S
|
|
130
|
+
}), /* @__PURE__ */ m(t, {
|
|
131
|
+
ref: B,
|
|
132
|
+
variant: C ? "danger" : "primary",
|
|
133
|
+
onClick: () => void J(),
|
|
134
|
+
loading: P,
|
|
135
|
+
disabled: !K,
|
|
136
|
+
className: p(r.confirm, A?.confirm),
|
|
137
|
+
children: x
|
|
138
|
+
})] })
|
|
139
|
+
]
|
|
140
|
+
});
|
|
141
|
+
});
|
|
142
|
+
v.displayName = "ConfirmDialog";
|
|
143
|
+
var y = i(null), b = 0;
|
|
144
|
+
function x({ children: e, defaults: t }) {
|
|
145
|
+
let [n, r] = f(null), i = d(null);
|
|
146
|
+
i.current = n;
|
|
147
|
+
let a = o((e = {}) => new Promise((n) => {
|
|
148
|
+
i.current?.resolve(!1);
|
|
149
|
+
let a = {
|
|
150
|
+
id: ++b,
|
|
151
|
+
options: {
|
|
152
|
+
...t,
|
|
153
|
+
...e
|
|
154
|
+
},
|
|
155
|
+
resolve: n
|
|
156
|
+
};
|
|
157
|
+
i.current = a, r(a);
|
|
158
|
+
}), [t]), s = o((e, t) => {
|
|
159
|
+
i.current === e && (i.current = null, r(null), e.resolve(t));
|
|
160
|
+
}, []), c = o(async () => {
|
|
161
|
+
let e = i.current;
|
|
162
|
+
if (!e) return;
|
|
163
|
+
let t = e.options.onConfirm?.();
|
|
164
|
+
t && typeof t.then == "function" && await t, s(e, !0);
|
|
165
|
+
}, [s]), l = o(() => {
|
|
166
|
+
let e = i.current;
|
|
167
|
+
e && s(e, !1);
|
|
168
|
+
}, [s]), { body: u, onConfirm: p, ...g } = n?.options ?? {};
|
|
169
|
+
return /* @__PURE__ */ h(y.Provider, {
|
|
170
|
+
value: a,
|
|
171
|
+
children: [e, /* @__PURE__ */ m(v, {
|
|
172
|
+
...g,
|
|
173
|
+
open: n !== null,
|
|
174
|
+
onConfirm: c,
|
|
175
|
+
onCancel: l,
|
|
176
|
+
children: u
|
|
177
|
+
}, n?.id ?? "idle")]
|
|
178
|
+
});
|
|
189
179
|
}
|
|
190
|
-
|
|
191
|
-
function
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
return e;
|
|
180
|
+
x.displayName = "ConfirmProvider";
|
|
181
|
+
function S() {
|
|
182
|
+
let e = s(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 };
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
|
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 { forwardRef as
|
|
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 e from "./Divider.module.js";
|
|
2
|
+
import { forwardRef as t } from "react";
|
|
3
|
+
import n from "clsx";
|
|
4
|
+
import { Fragment as r, jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
5
|
+
// src/components/Divider/Divider.tsx
|
|
6
|
+
var o = t(({ orientation: t = "horizontal", variant: o = "solid", label: s, labelPosition: c = "center", classes: l, className: u, ...d }, f) => {
|
|
7
|
+
let p = s != null && t === "horizontal";
|
|
8
|
+
return /* @__PURE__ */ i("div", {
|
|
9
|
+
ref: f,
|
|
10
|
+
role: "separator",
|
|
11
|
+
"aria-orientation": t,
|
|
12
|
+
className: n(e.root, e[t], e[o], p && e.withLabel, p && e[`label_${c}`], l?.root, u),
|
|
13
|
+
...d,
|
|
14
|
+
children: p ? /* @__PURE__ */ a(r, { children: [
|
|
15
|
+
/* @__PURE__ */ i("span", { className: n(e.line, l?.line) }),
|
|
16
|
+
/* @__PURE__ */ i("span", {
|
|
17
|
+
className: n(e.label, l?.label),
|
|
18
|
+
children: s
|
|
19
|
+
}),
|
|
20
|
+
/* @__PURE__ */ i("span", { className: n(e.line, l?.line) })
|
|
21
|
+
] }) : null
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
o.displayName = "Divider";
|
|
25
|
+
export { o as Divider };
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
|
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
|
}
|