@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,73 +1,50 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
B as itemCheck,
|
|
50
|
-
L as itemDisabled,
|
|
51
|
-
T as itemHighlighted,
|
|
52
|
-
D as itemSelected,
|
|
53
|
-
t as lg,
|
|
54
|
-
R as match,
|
|
55
|
-
c as md,
|
|
56
|
-
u as menu,
|
|
57
|
-
b as menuEnter,
|
|
58
|
-
w as menuItems,
|
|
59
|
-
f as multiSearch,
|
|
60
|
-
H as multiTrigger,
|
|
61
|
-
W as multiTriggerDisabled,
|
|
62
|
-
I as noResults,
|
|
63
|
-
h as placeholder,
|
|
64
|
-
i as root,
|
|
65
|
-
a as searchableTrigger,
|
|
66
|
-
l as searchableWrapper,
|
|
67
|
-
r as sm,
|
|
68
|
-
v as spinner,
|
|
69
|
-
g as triggerLabel,
|
|
70
|
-
m as triggerOpen,
|
|
71
|
-
p as visuallyHidden,
|
|
72
|
-
e as wrapper
|
|
1
|
+
// src/components/inputs/Select/Select.module.scss
|
|
2
|
+
var e = "crk-wrapper-SP2JE", t = "crk-sm-DqshL", n = "crk-md-j4AKI", r = "crk-lg-24Xd3", i = "crk-root-Uu9Ah", a = "crk-error-9oRU6", o = "crk-arrow-WU8ZW", s = "crk-searchableWrapper-7AL4l", c = "crk-hiddenSelect-s3DEx", l = "crk-searchableTrigger-m-GWV", u = "crk-triggerOpen-Lo8-j", d = "crk-triggerLabel-5rETZ", f = "crk-placeholder-teBBh", p = "crk-arrowInline-m-roG", m = "crk-disabled-pcSeq", h = "crk-visuallyHidden-2tTD5", g = "crk-menu--i-je", _ = "crk-menuEnter-vJjLV", v = "crk-menuItems-VrZnE", y = "crk-item-fU3XI", b = "crk-itemHighlighted-MvR41", x = "crk-itemDisabled-KTUO8", S = "crk-itemSelected-42-BG", C = "crk-noResults-uicSW", w = "crk-match-Aej-J", T = "crk-spinner-I1ffm", E = "crk-multiTrigger-Pd3wJ", D = "crk-multiTriggerDisabled-9ajge", O = "crk-chip-TuYUB", k = "crk-chipLabel-H4JWu", A = "crk-chipRemove-Lfk0R", j = "crk-multiSearch-OrVeS", M = "crk-arrowMulti-Nh9Hr", N = "crk-itemCheck-DPB5A", P = "crk-moreChip-Rlrb8", F = "crk-checklistTrigger-3mDgS", I = "crk-checklistButton-Jvh3L", L = "crk-menuChecklist-MxLWj", R = "crk-menuSearchRow-LuCyU", z = "crk-menuSearchIcon-drN6W", B = "crk-menuSearch-SjM96", V = "crk-menuHeader-VpZN1", H = "crk-menuAction-t1izk", U = "crk-checkbox-xFpYO", W = "crk-checkboxChecked-PATgQ", G = "crk-itemBody--PcX2", K = {
|
|
3
|
+
wrapper: e,
|
|
4
|
+
sm: t,
|
|
5
|
+
md: n,
|
|
6
|
+
lg: r,
|
|
7
|
+
root: i,
|
|
8
|
+
error: a,
|
|
9
|
+
arrow: o,
|
|
10
|
+
searchableWrapper: s,
|
|
11
|
+
hiddenSelect: c,
|
|
12
|
+
searchableTrigger: l,
|
|
13
|
+
triggerOpen: u,
|
|
14
|
+
triggerLabel: d,
|
|
15
|
+
placeholder: f,
|
|
16
|
+
arrowInline: p,
|
|
17
|
+
disabled: m,
|
|
18
|
+
visuallyHidden: h,
|
|
19
|
+
menu: g,
|
|
20
|
+
menuEnter: _,
|
|
21
|
+
menuItems: v,
|
|
22
|
+
item: y,
|
|
23
|
+
itemHighlighted: b,
|
|
24
|
+
itemDisabled: x,
|
|
25
|
+
itemSelected: S,
|
|
26
|
+
noResults: C,
|
|
27
|
+
match: w,
|
|
28
|
+
spinner: T,
|
|
29
|
+
multiTrigger: E,
|
|
30
|
+
multiTriggerDisabled: D,
|
|
31
|
+
chip: O,
|
|
32
|
+
chipLabel: k,
|
|
33
|
+
chipRemove: A,
|
|
34
|
+
multiSearch: j,
|
|
35
|
+
arrowMulti: M,
|
|
36
|
+
itemCheck: N,
|
|
37
|
+
moreChip: P,
|
|
38
|
+
checklistTrigger: F,
|
|
39
|
+
checklistButton: I,
|
|
40
|
+
menuChecklist: L,
|
|
41
|
+
menuSearchRow: R,
|
|
42
|
+
menuSearchIcon: z,
|
|
43
|
+
menuSearch: B,
|
|
44
|
+
menuHeader: V,
|
|
45
|
+
menuAction: H,
|
|
46
|
+
checkbox: U,
|
|
47
|
+
checkboxChecked: W,
|
|
48
|
+
itemBody: G
|
|
73
49
|
};
|
|
50
|
+
export { o as arrow, p as arrowInline, M as arrowMulti, U as checkbox, W as checkboxChecked, I as checklistButton, F as checklistTrigger, O as chip, k as chipLabel, A as chipRemove, K as default, m as disabled, a as error, c as hiddenSelect, y as item, G as itemBody, N as itemCheck, x as itemDisabled, b as itemHighlighted, S as itemSelected, r as lg, w as match, n as md, g as menu, H as menuAction, L as menuChecklist, _ as menuEnter, V as menuHeader, v as menuItems, B as menuSearch, z as menuSearchIcon, R as menuSearchRow, P as moreChip, j as multiSearch, E as multiTrigger, D as multiTriggerDisabled, C as noResults, f as placeholder, i as root, l as searchableTrigger, s as searchableWrapper, t as sm, T as spinner, d as triggerLabel, u as triggerOpen, h as visuallyHidden, e as wrapper };
|
|
@@ -1,128 +1,97 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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
|
-
W.map((t, e) => /* @__PURE__ */ P(
|
|
99
|
-
"div",
|
|
100
|
-
{
|
|
101
|
-
className: k(v.thumb, y?.thumb),
|
|
102
|
-
style: { left: `${h(t)}%` },
|
|
103
|
-
role: "slider",
|
|
104
|
-
tabIndex: s ? -1 : 0,
|
|
105
|
-
"aria-orientation": "horizontal",
|
|
106
|
-
"aria-valuemin": n,
|
|
107
|
-
"aria-valuemax": a,
|
|
108
|
-
"aria-valuenow": t,
|
|
109
|
-
"aria-valuetext": L ? L(t) : void 0,
|
|
110
|
-
"aria-label": z,
|
|
111
|
-
"aria-labelledby": B,
|
|
112
|
-
"aria-disabled": s || void 0,
|
|
113
|
-
onPointerDown: O(e),
|
|
114
|
-
onKeyDown: Q(e, t)
|
|
115
|
-
},
|
|
116
|
-
e
|
|
117
|
-
))
|
|
118
|
-
]
|
|
119
|
-
}
|
|
120
|
-
)
|
|
121
|
-
}
|
|
122
|
-
);
|
|
123
|
-
}
|
|
124
|
-
);
|
|
125
|
-
tt.displayName = "Slider";
|
|
126
|
-
export {
|
|
127
|
-
tt as Slider
|
|
128
|
-
};
|
|
1
|
+
import { forwardRef as e, useCallback as t, useEffect as n, useRef as r, useState as i } from "react";
|
|
2
|
+
import a from "clsx";
|
|
3
|
+
import o from "./Slider.module.scss.js";
|
|
4
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
5
|
+
// src/components/inputs/Slider/Slider.tsx
|
|
6
|
+
var l = (e) => Array.isArray(e) ? e : null, u = e(({ value: e, defaultValue: u, onChange: d, onChangeEnd: f, min: p = 0, max: m = 100, step: h = 1, disabled: g = !1, formatValue: _, classes: v, className: y, style: b, "aria-label": x, "aria-labelledby": S }, C) => {
|
|
7
|
+
let w = e !== void 0, [T, E] = i(e ?? u ?? 0), D = w ? e : T, O = r(null), k = r(0), [A, j] = i(!1), M = t((e) => Math.min(m, Math.max(p, e)), [p, m]), N = t((e) => M(Math.round((e - p) / h) * h + p), [
|
|
8
|
+
M,
|
|
9
|
+
p,
|
|
10
|
+
h
|
|
11
|
+
]), P = t((e) => (e - p) / (m - p) * 100, [p, m]), F = t((e, t = !1) => {
|
|
12
|
+
w || E(e), d?.(e), t && f?.(e);
|
|
13
|
+
}, [
|
|
14
|
+
w,
|
|
15
|
+
d,
|
|
16
|
+
f
|
|
17
|
+
]), I = t((e, t, n = !1) => {
|
|
18
|
+
let r = N(t), i = l(D);
|
|
19
|
+
if (i) {
|
|
20
|
+
let t = [i[0], i[1]];
|
|
21
|
+
t[e] = r, e === 0 ? t[0] = Math.min(t[0], t[1]) : t[1] = Math.max(t[1], t[0]), F(t, n);
|
|
22
|
+
} else F(r, n);
|
|
23
|
+
}, [
|
|
24
|
+
D,
|
|
25
|
+
N,
|
|
26
|
+
F
|
|
27
|
+
]), L = t((e) => {
|
|
28
|
+
let t = O.current;
|
|
29
|
+
if (!t) return p;
|
|
30
|
+
let n = t.getBoundingClientRect();
|
|
31
|
+
return p + (n.width > 0 ? (e - n.left) / n.width : 0) * (m - p);
|
|
32
|
+
}, [p, m]), R = t((e) => {
|
|
33
|
+
let t = l(D);
|
|
34
|
+
return t ? Math.abs(e - t[0]) <= Math.abs(e - t[1]) ? 0 : 1 : 0;
|
|
35
|
+
}, [D]);
|
|
36
|
+
n(() => {
|
|
37
|
+
if (!A) return;
|
|
38
|
+
let e = (e) => {
|
|
39
|
+
I(k.current, L(e.clientX));
|
|
40
|
+
}, t = (e) => {
|
|
41
|
+
j(!1), I(k.current, L(e.clientX), !0);
|
|
42
|
+
};
|
|
43
|
+
return window.addEventListener("pointermove", e), window.addEventListener("pointerup", t), () => {
|
|
44
|
+
window.removeEventListener("pointermove", e), window.removeEventListener("pointerup", t);
|
|
45
|
+
};
|
|
46
|
+
}, [
|
|
47
|
+
A,
|
|
48
|
+
I,
|
|
49
|
+
L
|
|
50
|
+
]);
|
|
51
|
+
let z = (e) => {
|
|
52
|
+
if (g) return;
|
|
53
|
+
let t = L(e.clientX);
|
|
54
|
+
k.current = R(t), j(!0), I(k.current, t);
|
|
55
|
+
}, B = (e) => (t) => {
|
|
56
|
+
g || (t.stopPropagation(), k.current = e, j(!0));
|
|
57
|
+
}, V = (e, t) => (n) => {
|
|
58
|
+
if (g) return;
|
|
59
|
+
let r = null;
|
|
60
|
+
n.key === "ArrowRight" || n.key === "ArrowUp" ? r = t + h : n.key === "ArrowLeft" || n.key === "ArrowDown" ? r = t - h : n.key === "Home" ? r = p : n.key === "End" ? r = m : n.key === "PageUp" ? r = t + h * 10 : n.key === "PageDown" && (r = t - h * 10), r !== null && (n.preventDefault(), I(e, r, !0));
|
|
61
|
+
}, H = l(D), U = H ?? [D], W = H ? P(H[0]) : 0, G = P(H ? H[1] : D);
|
|
62
|
+
return /* @__PURE__ */ s("div", {
|
|
63
|
+
ref: C,
|
|
64
|
+
className: a(o.root, g && o.disabled, v?.root, y),
|
|
65
|
+
style: b,
|
|
66
|
+
"data-disabled": g || void 0,
|
|
67
|
+
children: /* @__PURE__ */ c("div", {
|
|
68
|
+
ref: O,
|
|
69
|
+
className: a(o.track, v?.track),
|
|
70
|
+
onPointerDown: z,
|
|
71
|
+
children: [/* @__PURE__ */ s("div", {
|
|
72
|
+
className: a(o.range, v?.range),
|
|
73
|
+
style: {
|
|
74
|
+
left: `${W}%`,
|
|
75
|
+
width: `${G - W}%`
|
|
76
|
+
}
|
|
77
|
+
}), U.map((e, t) => /* @__PURE__ */ s("div", {
|
|
78
|
+
className: a(o.thumb, v?.thumb),
|
|
79
|
+
style: { left: `${P(e)}%` },
|
|
80
|
+
role: "slider",
|
|
81
|
+
tabIndex: g ? -1 : 0,
|
|
82
|
+
"aria-orientation": "horizontal",
|
|
83
|
+
"aria-valuemin": p,
|
|
84
|
+
"aria-valuemax": m,
|
|
85
|
+
"aria-valuenow": e,
|
|
86
|
+
"aria-valuetext": _ ? _(e) : void 0,
|
|
87
|
+
"aria-label": x,
|
|
88
|
+
"aria-labelledby": S,
|
|
89
|
+
"aria-disabled": g || void 0,
|
|
90
|
+
onPointerDown: B(t),
|
|
91
|
+
onKeyDown: V(t, e)
|
|
92
|
+
}, t))]
|
|
93
|
+
})
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
u.displayName = "Slider";
|
|
97
|
+
export { u as Slider };
|
|
@@ -1,15 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export {
|
|
9
|
-
a as default,
|
|
10
|
-
s as disabled,
|
|
11
|
-
c as range,
|
|
12
|
-
t as root,
|
|
13
|
-
o as thumb,
|
|
14
|
-
r as track
|
|
1
|
+
// src/components/inputs/Slider/Slider.module.scss
|
|
2
|
+
var e = "crk-root-fvpfd", t = "crk-track-MP1oP", n = "crk-range-fh4JV", r = "crk-thumb-LKxgd", i = "crk-disabled-n8jtF", a = {
|
|
3
|
+
root: e,
|
|
4
|
+
track: t,
|
|
5
|
+
range: n,
|
|
6
|
+
thumb: r,
|
|
7
|
+
disabled: i
|
|
15
8
|
};
|
|
9
|
+
export { a as default, i as disabled, n as range, e as root, r as thumb, t as track };
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { forwardRef as e } from "react";
|
|
2
|
+
import { Checkbox as t } from "../Checkbox/Checkbox.js";
|
|
3
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
+
// src/components/inputs/Switch/Switch.tsx
|
|
5
|
+
var r = e((e, r) => /* @__PURE__ */ n(t, {
|
|
6
|
+
ref: r,
|
|
7
|
+
variant: "switch",
|
|
8
|
+
...e
|
|
9
|
+
}));
|
|
10
|
+
r.displayName = "Switch";
|
|
11
|
+
export { r as Switch };
|
|
@@ -1,58 +1,42 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
f && t.error,
|
|
44
|
-
r ? t.autoExpand : t[C[u]],
|
|
45
|
-
h
|
|
46
|
-
),
|
|
47
|
-
style: m,
|
|
48
|
-
onChange: p,
|
|
49
|
-
rows: i.rows ?? 1,
|
|
50
|
-
...i
|
|
51
|
-
}
|
|
52
|
-
);
|
|
53
|
-
}
|
|
54
|
-
);
|
|
55
|
-
H.displayName = "Textarea";
|
|
56
|
-
export {
|
|
57
|
-
H as Textarea
|
|
58
|
-
};
|
|
1
|
+
import { forwardRef as e, useCallback as t, useEffect as n, useRef as r } from "react";
|
|
2
|
+
import i from "clsx";
|
|
3
|
+
import a from "./Textarea.module.scss.js";
|
|
4
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
5
|
+
// src/components/inputs/Textarea/Textarea.tsx
|
|
6
|
+
var s = {
|
|
7
|
+
none: "resizeNone",
|
|
8
|
+
vertical: "resizeVertical",
|
|
9
|
+
horizontal: "resizeHorizontal",
|
|
10
|
+
both: "resizeBoth"
|
|
11
|
+
}, c = e(({ inputSize: e = "md", error: c = !1, resize: l = "vertical", autoExpand: u = !0, className: d, style: f, onChange: p, ...m }, h) => {
|
|
12
|
+
let g = r(null), _ = t(() => {
|
|
13
|
+
let e = g.current;
|
|
14
|
+
e && (e.style.height = "auto", e.style.height = `${e.scrollHeight}px`);
|
|
15
|
+
}, []), v = m.value ?? "";
|
|
16
|
+
n(() => {
|
|
17
|
+
u && _();
|
|
18
|
+
}, [
|
|
19
|
+
u,
|
|
20
|
+
_,
|
|
21
|
+
v
|
|
22
|
+
]);
|
|
23
|
+
let y = t((e) => {
|
|
24
|
+
u && _(), p?.(e);
|
|
25
|
+
}, [
|
|
26
|
+
u,
|
|
27
|
+
_,
|
|
28
|
+
p
|
|
29
|
+
]);
|
|
30
|
+
return /* @__PURE__ */ o("textarea", {
|
|
31
|
+
ref: (e) => {
|
|
32
|
+
g.current = e, typeof h == "function" ? h(e) : h && (h.current = e);
|
|
33
|
+
},
|
|
34
|
+
className: i(a.root, a[e], c && a.error, u ? a.autoExpand : a[s[l]], d),
|
|
35
|
+
style: f,
|
|
36
|
+
onChange: y,
|
|
37
|
+
rows: m.rows ?? 1,
|
|
38
|
+
...m
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
c.displayName = "Textarea";
|
|
42
|
+
export { c as Textarea };
|
|
@@ -1,25 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
export {
|
|
14
|
-
a as autoExpand,
|
|
15
|
-
l as default,
|
|
16
|
-
t as error,
|
|
17
|
-
s as lg,
|
|
18
|
-
e as md,
|
|
19
|
-
z as resizeBoth,
|
|
20
|
-
i as resizeHorizontal,
|
|
21
|
-
c as resizeNone,
|
|
22
|
-
n as resizeVertical,
|
|
23
|
-
r as root,
|
|
24
|
-
o as sm
|
|
1
|
+
// src/components/inputs/Textarea/Textarea.module.scss
|
|
2
|
+
var e = "crk-root-IGgdn", t = "crk-sm-N-5I2", n = "crk-md-bbyFl", r = "crk-lg-Pd-Iq", i = "crk-error-fyu3i", a = "crk-resizeNone-SmNT4", o = "crk-resizeVertical-oi8vP", s = "crk-resizeHorizontal-riMLL", c = "crk-resizeBoth-NYSh4", l = "crk-autoExpand-JWone", u = {
|
|
3
|
+
root: e,
|
|
4
|
+
sm: t,
|
|
5
|
+
md: n,
|
|
6
|
+
lg: r,
|
|
7
|
+
error: i,
|
|
8
|
+
resizeNone: a,
|
|
9
|
+
resizeVertical: o,
|
|
10
|
+
resizeHorizontal: s,
|
|
11
|
+
resizeBoth: c,
|
|
12
|
+
autoExpand: l
|
|
25
13
|
};
|
|
14
|
+
export { l as autoExpand, u as default, i as error, r as lg, n as md, c as resizeBoth, s as resizeHorizontal, a as resizeNone, o as resizeVertical, e as root, t as sm };
|
package/hooks/useClickOutside.js
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
import { useEffect as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { useEffect as e } from "react";
|
|
2
|
+
// src/hooks/useClickOutside.ts
|
|
3
|
+
function t(t, n, r = !0) {
|
|
4
|
+
e(() => {
|
|
5
|
+
if (!r) return;
|
|
6
|
+
let e = (e) => {
|
|
7
|
+
t.current && !t.current.contains(e.target) && n();
|
|
8
|
+
};
|
|
9
|
+
return document.addEventListener("mousedown", e), () => {
|
|
10
|
+
document.removeEventListener("mousedown", e);
|
|
11
|
+
};
|
|
12
|
+
}, [
|
|
13
|
+
t,
|
|
14
|
+
n,
|
|
15
|
+
r
|
|
16
|
+
]);
|
|
12
17
|
}
|
|
13
|
-
export {
|
|
14
|
-
s as useClickOutside
|
|
15
|
-
};
|
|
18
|
+
export { t as useClickOutside };
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { useEffect as e, useState as t } from "react";
|
|
2
|
+
// src/hooks/useDebouncedValue.ts
|
|
3
|
+
function n(n, r = 300) {
|
|
4
|
+
let [i, a] = t(n);
|
|
5
|
+
return e(() => {
|
|
6
|
+
if (r <= 0) {
|
|
7
|
+
a(n);
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
let e = setTimeout(() => a(n), r);
|
|
11
|
+
return () => clearTimeout(e);
|
|
12
|
+
}, [n, r]), i;
|
|
12
13
|
}
|
|
13
|
-
export {
|
|
14
|
-
i as useDebouncedValue
|
|
15
|
-
};
|
|
14
|
+
export { n as useDebouncedValue };
|