@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
|
@@ -1,133 +1,133 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import e from "./Toast.module.js";
|
|
2
|
+
import { addToast as t, configureToasts as n, dismissAllToasts as r, dismissToast as i, getServerToasts as a, getToasts as o, registerProvider as s, subscribeToasts as c } from "./toastStore.js";
|
|
3
|
+
import { useCallback as l, useEffect as u, useRef as d, useState as f, useSyncExternalStore as p } from "react";
|
|
4
|
+
import m from "clsx";
|
|
5
|
+
import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
6
|
+
import { createPortal as v } from "react-dom";
|
|
7
|
+
// src/components/Toast/Toast.tsx
|
|
8
|
+
var y = Object.assign((e) => t(e), {
|
|
9
|
+
dismiss: i,
|
|
10
|
+
dismissAll: r
|
|
10
11
|
});
|
|
11
|
-
function
|
|
12
|
-
|
|
12
|
+
function b() {
|
|
13
|
+
return {
|
|
14
|
+
toast: y,
|
|
15
|
+
dismiss: i,
|
|
16
|
+
dismissAll: r
|
|
17
|
+
};
|
|
13
18
|
}
|
|
14
|
-
function
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
})
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
record: o,
|
|
36
|
-
exiting: o.exiting,
|
|
37
|
-
isTop: r,
|
|
38
|
-
onDismiss: T,
|
|
39
|
-
classes: i
|
|
40
|
-
},
|
|
41
|
-
o.id
|
|
42
|
-
))
|
|
43
|
-
}
|
|
44
|
-
),
|
|
45
|
-
document.body
|
|
46
|
-
) : null;
|
|
47
|
-
return /* @__PURE__ */ g(L, { children: [
|
|
48
|
-
c,
|
|
49
|
-
d
|
|
50
|
-
] });
|
|
19
|
+
function x({ children: t, position: r = "top-right", duration: l = 5e3, max: d = 5, classes: y }) {
|
|
20
|
+
let b = p(c, o, a), x = r.startsWith("top"), [S, w] = f(!1);
|
|
21
|
+
u(() => w(!0), []), u(() => {
|
|
22
|
+
n({
|
|
23
|
+
duration: l,
|
|
24
|
+
max: d
|
|
25
|
+
});
|
|
26
|
+
}, [l, d]), u(() => s(), []);
|
|
27
|
+
let T = x ? [...b].reverse() : b, E = S && typeof document < "u" ? v(/* @__PURE__ */ g("div", {
|
|
28
|
+
className: m(e.viewport, e[`pos_${r}`], y?.viewport),
|
|
29
|
+
role: "region",
|
|
30
|
+
"aria-label": "Notifications",
|
|
31
|
+
children: T.map((e) => /* @__PURE__ */ g(C, {
|
|
32
|
+
record: e,
|
|
33
|
+
exiting: e.exiting,
|
|
34
|
+
isTop: x,
|
|
35
|
+
onDismiss: i,
|
|
36
|
+
classes: y
|
|
37
|
+
}, e.id))
|
|
38
|
+
}), document.body) : null;
|
|
39
|
+
return /* @__PURE__ */ _(h, { children: [t, E] });
|
|
51
40
|
}
|
|
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
|
-
|
|
41
|
+
var S = {
|
|
42
|
+
neutral: null,
|
|
43
|
+
info: /* @__PURE__ */ g("svg", {
|
|
44
|
+
viewBox: "0 0 20 20",
|
|
45
|
+
fill: "currentColor",
|
|
46
|
+
"aria-hidden": "true",
|
|
47
|
+
children: /* @__PURE__ */ g("path", {
|
|
48
|
+
fillRule: "evenodd",
|
|
49
|
+
d: "M10 18a8 8 0 100-16 8 8 0 000 16zM9 9a1 1 0 012 0v4a1 1 0 11-2 0V9zm1-4a1 1 0 100 2 1 1 0 000-2z",
|
|
50
|
+
clipRule: "evenodd"
|
|
51
|
+
})
|
|
52
|
+
}),
|
|
53
|
+
success: /* @__PURE__ */ g("svg", {
|
|
54
|
+
viewBox: "0 0 20 20",
|
|
55
|
+
fill: "currentColor",
|
|
56
|
+
"aria-hidden": "true",
|
|
57
|
+
children: /* @__PURE__ */ g("path", {
|
|
58
|
+
fillRule: "evenodd",
|
|
59
|
+
d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.7-9.3a1 1 0 00-1.4-1.4L9 10.6 7.7 9.3a1 1 0 00-1.4 1.4l2 2a1 1 0 001.4 0l4-4z",
|
|
60
|
+
clipRule: "evenodd"
|
|
61
|
+
})
|
|
62
|
+
}),
|
|
63
|
+
warning: /* @__PURE__ */ g("svg", {
|
|
64
|
+
viewBox: "0 0 20 20",
|
|
65
|
+
fill: "currentColor",
|
|
66
|
+
"aria-hidden": "true",
|
|
67
|
+
children: /* @__PURE__ */ g("path", {
|
|
68
|
+
fillRule: "evenodd",
|
|
69
|
+
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",
|
|
70
|
+
clipRule: "evenodd"
|
|
71
|
+
})
|
|
72
|
+
}),
|
|
73
|
+
danger: /* @__PURE__ */ g("svg", {
|
|
74
|
+
viewBox: "0 0 20 20",
|
|
75
|
+
fill: "currentColor",
|
|
76
|
+
"aria-hidden": "true",
|
|
77
|
+
children: /* @__PURE__ */ g("path", {
|
|
78
|
+
fillRule: "evenodd",
|
|
79
|
+
d: "M10 18a8 8 0 100-16 8 8 0 000 16zM8.7 7.3a1 1 0 00-1.4 1.4L8.6 10l-1.3 1.3a1 1 0 101.4 1.4L10 11.4l1.3 1.3a1 1 0 001.4-1.4L11.4 10l1.3-1.3a1 1 0 00-1.4-1.4L10 8.6 8.7 7.3z",
|
|
80
|
+
clipRule: "evenodd"
|
|
81
|
+
})
|
|
82
|
+
})
|
|
86
83
|
};
|
|
87
|
-
function
|
|
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
|
-
|
|
84
|
+
function C({ record: t, exiting: n, isTop: r, onDismiss: i, classes: a }) {
|
|
85
|
+
let { id: o, variant: s, title: c, description: f, duration: p = 0 } = t, h = d(null), v = l(() => {
|
|
86
|
+
p && Number.isFinite(p) && (h.current = setTimeout(() => i(o), p));
|
|
87
|
+
}, [
|
|
88
|
+
p,
|
|
89
|
+
o,
|
|
90
|
+
i
|
|
91
|
+
]), y = l(() => {
|
|
92
|
+
h.current &&= (clearTimeout(h.current), null);
|
|
93
|
+
}, []);
|
|
94
|
+
u(() => (v(), y), [v, y]);
|
|
95
|
+
let b = S[s];
|
|
96
|
+
return /* @__PURE__ */ _("div", {
|
|
97
|
+
className: m(e.toast, e[s], r ? e.fromTop : e.fromBottom, n && e.leaving, a?.toast),
|
|
98
|
+
role: s === "danger" || s === "warning" ? "alert" : "status",
|
|
99
|
+
"aria-live": s === "danger" || s === "warning" ? "assertive" : "polite",
|
|
100
|
+
onMouseEnter: y,
|
|
101
|
+
onMouseLeave: v,
|
|
102
|
+
children: [
|
|
103
|
+
b && /* @__PURE__ */ g("span", {
|
|
104
|
+
className: m(e.icon, a?.icon),
|
|
105
|
+
"aria-hidden": "true",
|
|
106
|
+
children: b
|
|
107
|
+
}),
|
|
108
|
+
/* @__PURE__ */ _("div", {
|
|
109
|
+
className: m(e.content, a?.content),
|
|
110
|
+
children: [c != null && /* @__PURE__ */ g("div", {
|
|
111
|
+
className: m(e.title, a?.title),
|
|
112
|
+
children: c
|
|
113
|
+
}), f != null && /* @__PURE__ */ g("div", {
|
|
114
|
+
className: m(e.description, a?.description),
|
|
115
|
+
children: f
|
|
116
|
+
})]
|
|
117
|
+
}),
|
|
118
|
+
/* @__PURE__ */ g("button", {
|
|
119
|
+
type: "button",
|
|
120
|
+
className: m(e.close, a?.close),
|
|
121
|
+
onClick: () => i(o),
|
|
122
|
+
"aria-label": "Dismiss notification",
|
|
123
|
+
children: /* @__PURE__ */ g("svg", {
|
|
124
|
+
viewBox: "0 0 20 20",
|
|
125
|
+
fill: "currentColor",
|
|
126
|
+
"aria-hidden": "true",
|
|
127
|
+
children: /* @__PURE__ */ g("path", { d: "M6.3 6.3a1 1 0 011.4 0L10 8.6l2.3-2.3a1 1 0 111.4 1.4L11.4 10l2.3 2.3a1 1 0 01-1.4 1.4L10 11.4l-2.3 2.3a1 1 0 01-1.4-1.4L8.6 10 6.3 7.7a1 1 0 010-1.4z" })
|
|
128
|
+
})
|
|
129
|
+
})
|
|
130
|
+
]
|
|
131
|
+
});
|
|
128
132
|
}
|
|
129
|
-
export {
|
|
130
|
-
$ as ToastProvider,
|
|
131
|
-
E as toast,
|
|
132
|
-
_ as useToast
|
|
133
|
-
};
|
|
133
|
+
export { x as ToastProvider, y as toast, b as useToast };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// src/components/Toast/Toast.module.scss
|
|
2
|
+
var e = "crk-viewport-2hLMp", t = "crk-pos_top-left-XVZwu", n = "crk-pos_top-center-7zvlQ", r = "crk-pos_top-right-nyzVI", i = "crk-pos_bottom-left-z0yV3", a = "crk-pos_bottom-center-m0ZHE", o = "crk-pos_bottom-right-Fplwy", s = "crk-toast-ngbBR", c = "crk-fromTop-ne93U", l = "crk-crk-toast-in-top-23NC0", u = "crk-fromBottom-Y7KGE", d = "crk-crk-toast-in-bottom-TVVax", f = "crk-leaving-P017e", p = "crk-crk-toast-out-2YmIq", m = "crk-neutral-Fo-jg", h = "crk-info-YHq0a", g = "crk-success-BoQPi", _ = "crk-warning-jpQSP", v = "crk-danger-6qs-8", y = "crk-icon-r-npu", b = "crk-content-puk6Q", x = "crk-title-Iv28R", S = "crk-description-RLU-y", C = "crk-close-gWTNf", w = {
|
|
3
|
+
viewport: e,
|
|
4
|
+
"pos_top-left": "crk-pos_top-left-XVZwu",
|
|
5
|
+
posTopLeft: t,
|
|
6
|
+
"pos_top-center": "crk-pos_top-center-7zvlQ",
|
|
7
|
+
posTopCenter: n,
|
|
8
|
+
"pos_top-right": "crk-pos_top-right-nyzVI",
|
|
9
|
+
posTopRight: r,
|
|
10
|
+
"pos_bottom-left": "crk-pos_bottom-left-z0yV3",
|
|
11
|
+
posBottomLeft: i,
|
|
12
|
+
"pos_bottom-center": "crk-pos_bottom-center-m0ZHE",
|
|
13
|
+
posBottomCenter: a,
|
|
14
|
+
"pos_bottom-right": "crk-pos_bottom-right-Fplwy",
|
|
15
|
+
posBottomRight: o,
|
|
16
|
+
toast: s,
|
|
17
|
+
fromTop: c,
|
|
18
|
+
"crk-toast-in-top": "crk-crk-toast-in-top-23NC0",
|
|
19
|
+
crkToastInTop: l,
|
|
20
|
+
fromBottom: u,
|
|
21
|
+
"crk-toast-in-bottom": "crk-crk-toast-in-bottom-TVVax",
|
|
22
|
+
crkToastInBottom: d,
|
|
23
|
+
leaving: f,
|
|
24
|
+
"crk-toast-out": "crk-crk-toast-out-2YmIq",
|
|
25
|
+
crkToastOut: p,
|
|
26
|
+
neutral: m,
|
|
27
|
+
info: h,
|
|
28
|
+
success: g,
|
|
29
|
+
warning: _,
|
|
30
|
+
danger: v,
|
|
31
|
+
icon: y,
|
|
32
|
+
content: b,
|
|
33
|
+
title: x,
|
|
34
|
+
description: S,
|
|
35
|
+
close: C
|
|
36
|
+
};
|
|
37
|
+
export { C as close, b as content, d as crkToastInBottom, l as crkToastInTop, p as crkToastOut, v as danger, w as default, S as description, u as fromBottom, c as fromTop, y as icon, h as info, f as leaving, m as neutral, a as posBottomCenter, i as posBottomLeft, o as posBottomRight, n as posTopCenter, t as posTopLeft, r as posTopRight, g as success, x as title, s as toast, e as viewport, _ as warning };
|
|
@@ -1,62 +1,58 @@
|
|
|
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
|
-
function
|
|
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
|
-
x as getToasts,
|
|
60
|
-
w as registerProvider,
|
|
61
|
-
m as subscribeToasts
|
|
62
|
-
};
|
|
1
|
+
// src/components/Toast/toastStore.ts
|
|
2
|
+
var e = {
|
|
3
|
+
duration: 5e3,
|
|
4
|
+
max: 5
|
|
5
|
+
}, t = [], n = t, r = { ...e }, i = 0, a = 0, o = !1, s = /* @__PURE__ */ new Set(), c = /* @__PURE__ */ new Map();
|
|
6
|
+
function l() {
|
|
7
|
+
for (let e of s) e();
|
|
8
|
+
}
|
|
9
|
+
function u(e) {
|
|
10
|
+
return s.add(e), () => {
|
|
11
|
+
s.delete(e);
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
function d() {
|
|
15
|
+
return n;
|
|
16
|
+
}
|
|
17
|
+
function f() {
|
|
18
|
+
return t;
|
|
19
|
+
}
|
|
20
|
+
function p(e) {
|
|
21
|
+
r = {
|
|
22
|
+
...r,
|
|
23
|
+
...e
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
function m() {
|
|
27
|
+
return a += 1, () => {
|
|
28
|
+
--a;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
function h(e) {
|
|
32
|
+
i += 1;
|
|
33
|
+
let t = `toast-${i}`, s = {
|
|
34
|
+
id: t,
|
|
35
|
+
variant: e.variant ?? "neutral",
|
|
36
|
+
title: e.title,
|
|
37
|
+
description: e.description,
|
|
38
|
+
duration: e.duration ?? r.duration,
|
|
39
|
+
exiting: !1
|
|
40
|
+
}, c = [...n, s];
|
|
41
|
+
return c.length > r.max && (c = c.slice(c.length - r.max)), n = c, l(), a === 0 && !o && typeof console < "u" && (o = !0, console.warn("[react-toolkit] toast() was called but no <ToastProvider> is mounted, so nothing will render. Mount <ToastProvider> once near the root of your app.")), t;
|
|
42
|
+
}
|
|
43
|
+
function g(e) {
|
|
44
|
+
let t = n.find((t) => t.id === e);
|
|
45
|
+
if (!t || t.exiting) return;
|
|
46
|
+
n = n.map((t) => t.id === e ? {
|
|
47
|
+
...t,
|
|
48
|
+
exiting: !0
|
|
49
|
+
} : t), l();
|
|
50
|
+
let r = setTimeout(() => {
|
|
51
|
+
n = n.filter((t) => t.id !== e), c.delete(e), l();
|
|
52
|
+
}, 200);
|
|
53
|
+
c.set(e, r);
|
|
54
|
+
}
|
|
55
|
+
function _() {
|
|
56
|
+
for (let e of n) g(e.id);
|
|
57
|
+
}
|
|
58
|
+
export { h as addToast, p as configureToasts, _ as dismissAllToasts, g as dismissToast, f as getServerToasts, d as getToasts, m as registerProvider, u as subscribeToasts };
|
|
@@ -1,58 +1,36 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { forwardRef as
|
|
1
|
+
import e from "./ToggleIconButton.module.js";
|
|
2
|
+
import { forwardRef as t, useState as n } from "react";
|
|
3
3
|
import r from "clsx";
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
t[y],
|
|
38
|
-
t[b],
|
|
39
|
-
e && B && t.animate,
|
|
40
|
-
s?.root,
|
|
41
|
-
N
|
|
42
|
-
),
|
|
43
|
-
style: Object.keys(o).length > 0 ? { ...c, ...o } : c,
|
|
44
|
-
disabled: l,
|
|
45
|
-
onClick: O,
|
|
46
|
-
...j,
|
|
47
|
-
children: [
|
|
48
|
-
x && /* @__PURE__ */ g("span", { className: r(t.burst, s?.burst), "aria-hidden": "true" }),
|
|
49
|
-
/* @__PURE__ */ g("span", { className: r(t.icon, s?.icon), "aria-hidden": "true", children: p })
|
|
50
|
-
]
|
|
51
|
-
}
|
|
52
|
-
);
|
|
53
|
-
}
|
|
54
|
-
);
|
|
55
|
-
R.displayName = "ToggleIconButton";
|
|
56
|
-
export {
|
|
57
|
-
R as ToggleIconButton
|
|
58
|
-
};
|
|
4
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
5
|
+
// src/components/ToggleIconButton/ToggleIconButton.tsx
|
|
6
|
+
var o = t(({ icon: t, pressed: o, defaultPressed: s = !1, onPressedChange: c, activeColor: l, burst: u = !1, variant: d = "secondary", size: f = "md", speed: p = 1, classes: m, className: h, style: g, disabled: _, onClick: v, ...y }, b) => {
|
|
7
|
+
let [x, S] = n(s), [C, w] = n(!1), T = o !== void 0, E = T ? o : x, D = (e) => {
|
|
8
|
+
if (v?.(e), _ || e.defaultPrevented) return;
|
|
9
|
+
let t = !E;
|
|
10
|
+
T || S(t), w(!0), c?.(t);
|
|
11
|
+
}, O = {};
|
|
12
|
+
return l && (O["--crk-toggle-color"] = l), p !== 1 && (O["--crk-toggle-speed"] = p), /* @__PURE__ */ a("button", {
|
|
13
|
+
ref: b,
|
|
14
|
+
type: "button",
|
|
15
|
+
"aria-pressed": E,
|
|
16
|
+
"data-pressed": E || void 0,
|
|
17
|
+
className: r(e.root, e[d], e[f], E && C && e.animate, m?.root, h),
|
|
18
|
+
style: Object.keys(O).length > 0 ? {
|
|
19
|
+
...g,
|
|
20
|
+
...O
|
|
21
|
+
} : g,
|
|
22
|
+
disabled: _,
|
|
23
|
+
onClick: D,
|
|
24
|
+
...y,
|
|
25
|
+
children: [u && /* @__PURE__ */ i("span", {
|
|
26
|
+
className: r(e.burst, m?.burst),
|
|
27
|
+
"aria-hidden": "true"
|
|
28
|
+
}), /* @__PURE__ */ i("span", {
|
|
29
|
+
className: r(e.icon, m?.icon),
|
|
30
|
+
"aria-hidden": "true",
|
|
31
|
+
children: t
|
|
32
|
+
})]
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
o.displayName = "ToggleIconButton";
|
|
36
|
+
export { o as ToggleIconButton };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// src/components/ToggleIconButton/ToggleIconButton.module.scss
|
|
2
|
+
var e = "crk-root-sK5En", t = "crk-secondary-fbwZs", n = "crk-ghost-MuXFl", r = "crk-sm-96-1z", i = "crk-md-h9veM", a = "crk-lg-sOekJ", o = "crk-icon-TVDmu", s = "crk-animate-qNjdL", c = "crk-crkTogglePop-bVeaK", l = "crk-burst-Wjr-r", u = "crk-crkToggleBurst-HvC9q", d = {
|
|
3
|
+
root: e,
|
|
4
|
+
secondary: t,
|
|
5
|
+
ghost: n,
|
|
6
|
+
sm: r,
|
|
7
|
+
md: i,
|
|
8
|
+
lg: a,
|
|
9
|
+
icon: o,
|
|
10
|
+
animate: s,
|
|
11
|
+
crkTogglePop: c,
|
|
12
|
+
burst: l,
|
|
13
|
+
crkToggleBurst: u
|
|
14
|
+
};
|
|
15
|
+
export { s as animate, l as burst, u as crkToggleBurst, c as crkTogglePop, d as default, n as ghost, o as icon, a as lg, i as md, e as root, t as secondary, r as sm };
|
|
@@ -32,7 +32,7 @@ export interface TooltipProps {
|
|
|
32
32
|
* <button aria-label="Copy">⧉</button>
|
|
33
33
|
* </Tooltip>
|
|
34
34
|
*/
|
|
35
|
-
export declare function Tooltip({ content, children, placement, delay, closeDelay, disabled, hideArrow, classes, }: TooltipProps): import("react
|
|
35
|
+
export declare function Tooltip({ content, children, placement, delay, closeDelay, disabled, hideArrow, classes, }: TooltipProps): import("react").JSX.Element;
|
|
36
36
|
export declare namespace Tooltip {
|
|
37
37
|
var displayName: string;
|
|
38
38
|
}
|