@overdoser/react-toolkit 0.19.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 +2 -2
- package/CHANGELOG.md +47 -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 +41 -16
- package/components/Table/Table.js +383 -442
- package/components/Table/Table.module.js +42 -0
- package/components/Table/index.d.ts +1 -1
- package/components/Table/useTableSort.d.ts +1 -1
- 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.d.ts +2 -0
- package/components/ThemeToggle/ThemeToggle.js +122 -97
- 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 -91
- package/hooks/usePortalPosition.js +25 -19
- package/hooks/useResizable.js +106 -104
- package/hooks/useTheme.d.ts +2 -2
- package/hooks/useTheme.js +28 -25
- package/index.css +2 -1
- package/index.d.ts +1 -1
- package/index.js +97 -215
- package/index.layered.css +2 -3
- package/llms.txt +9 -6
- package/manifest.json +66 -10
- package/package.json +1 -1
- package/utils/formatBytes.js +29 -13
- package/utils/themeScript.d.ts +2 -0
- 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,73 +1,79 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import e from "./PageHeader.module.js";
|
|
2
|
+
import { createElement as t, forwardRef 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
|
-
|
|
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
|
-
|
|
4
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
5
|
+
// src/components/PageHeader/PageHeader.tsx
|
|
6
|
+
var o = /* @__PURE__ */ i("svg", {
|
|
7
|
+
viewBox: "0 0 20 20",
|
|
8
|
+
fill: "none",
|
|
9
|
+
stroke: "currentColor",
|
|
10
|
+
strokeWidth: "2",
|
|
11
|
+
"aria-hidden": "true",
|
|
12
|
+
width: "1em",
|
|
13
|
+
height: "1em",
|
|
14
|
+
children: /* @__PURE__ */ i("path", {
|
|
15
|
+
d: "M12 4l-6 6 6 6",
|
|
16
|
+
strokeLinecap: "round",
|
|
17
|
+
strokeLinejoin: "round"
|
|
18
|
+
})
|
|
19
|
+
}), s = n(({ title: n, as: s = "h1", subtitle: c, description: l, actions: u, breadcrumbs: d, backHref: f, onBack: p, backLabel: m = "Back", badge: h, meta: g, tabs: _, divider: v = !0, size: y = "md", sticky: b = !1, classes: x, className: S, children: C, ...w }, T) => {
|
|
20
|
+
let E = f === void 0 ? p ? /* @__PURE__ */ a("button", {
|
|
21
|
+
type: "button",
|
|
22
|
+
onClick: p,
|
|
23
|
+
className: r(e.back, x?.back),
|
|
24
|
+
children: [o, m]
|
|
25
|
+
}) : null : /* @__PURE__ */ a("a", {
|
|
26
|
+
href: f,
|
|
27
|
+
className: r(e.back, x?.back),
|
|
28
|
+
children: [o, m]
|
|
29
|
+
});
|
|
30
|
+
return /* @__PURE__ */ a("header", {
|
|
31
|
+
ref: T,
|
|
32
|
+
className: r(e.root, e[y], v && e.divider, b && e.sticky, _ && e.hasTabs, x?.root, S),
|
|
33
|
+
...w,
|
|
34
|
+
children: [
|
|
35
|
+
d && /* @__PURE__ */ i("div", {
|
|
36
|
+
className: r(e.breadcrumbs, x?.breadcrumbs),
|
|
37
|
+
children: d
|
|
38
|
+
}),
|
|
39
|
+
E,
|
|
40
|
+
/* @__PURE__ */ a("div", {
|
|
41
|
+
className: r(e.titleRow, x?.titleRow),
|
|
42
|
+
children: [/* @__PURE__ */ a("div", {
|
|
43
|
+
className: e.titleBlock,
|
|
44
|
+
children: [
|
|
45
|
+
/* @__PURE__ */ a("div", {
|
|
46
|
+
className: e.titleLine,
|
|
47
|
+
children: [t(s, { className: r(e.title, x?.title) }, n), h && /* @__PURE__ */ i("span", {
|
|
48
|
+
className: r(e.badge, x?.badge),
|
|
49
|
+
children: h
|
|
50
|
+
})]
|
|
51
|
+
}),
|
|
52
|
+
c && /* @__PURE__ */ i("p", {
|
|
53
|
+
className: r(e.subtitle, x?.subtitle),
|
|
54
|
+
children: c
|
|
55
|
+
}),
|
|
56
|
+
l && /* @__PURE__ */ i("p", {
|
|
57
|
+
className: r(e.description, x?.description),
|
|
58
|
+
children: l
|
|
59
|
+
}),
|
|
60
|
+
g && /* @__PURE__ */ i("div", {
|
|
61
|
+
className: r(e.meta, x?.meta),
|
|
62
|
+
children: g
|
|
63
|
+
})
|
|
64
|
+
]
|
|
65
|
+
}), u && /* @__PURE__ */ i("div", {
|
|
66
|
+
className: r(e.actions, x?.actions),
|
|
67
|
+
children: u
|
|
68
|
+
})]
|
|
69
|
+
}),
|
|
70
|
+
C,
|
|
71
|
+
_ && /* @__PURE__ */ i("div", {
|
|
72
|
+
className: r(e.tabs, x?.tabs),
|
|
73
|
+
children: _
|
|
74
|
+
})
|
|
75
|
+
]
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
s.displayName = "PageHeader";
|
|
79
|
+
export { s as PageHeader };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// src/components/PageHeader/PageHeader.module.scss
|
|
2
|
+
var e = "crk-root-K-SAd", t = "crk-sm-XJoTL", n = "crk-md-obtrZ", r = "crk-lg--8FAx", i = "crk-divider-q-A5e", a = "crk-hasTabs-YLYqx", o = "crk-sticky-e3pQP", s = "crk-breadcrumbs-rTXxK", c = "crk-back-R4Oq3", l = "crk-titleRow-4-MEi", u = "crk-titleBlock-37A6l", d = "crk-titleLine-oWB7d", f = "crk-title-1nY9v", p = "crk-badge-Uesjc", m = "crk-subtitle-BREZj", h = "crk-description--PNl0", g = "crk-meta-fkWcX", _ = "crk-actions-EYOW1", v = "crk-tabs-qDTiN", y = {
|
|
3
|
+
root: e,
|
|
4
|
+
sm: t,
|
|
5
|
+
md: n,
|
|
6
|
+
lg: r,
|
|
7
|
+
divider: i,
|
|
8
|
+
hasTabs: a,
|
|
9
|
+
sticky: o,
|
|
10
|
+
breadcrumbs: s,
|
|
11
|
+
back: c,
|
|
12
|
+
titleRow: l,
|
|
13
|
+
titleBlock: u,
|
|
14
|
+
titleLine: d,
|
|
15
|
+
title: f,
|
|
16
|
+
badge: p,
|
|
17
|
+
subtitle: m,
|
|
18
|
+
description: h,
|
|
19
|
+
meta: g,
|
|
20
|
+
actions: _,
|
|
21
|
+
tabs: v
|
|
22
|
+
};
|
|
23
|
+
export { _ as actions, c as back, p as badge, s as breadcrumbs, y as default, h as description, i as divider, a as hasTabs, r as lg, n as md, g as meta, e as root, t as sm, o as sticky, m as subtitle, v as tabs, f as title, u as titleBlock, d as titleLine, l as titleRow };
|
|
@@ -1,84 +1,63 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
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
|
-
type: "button",
|
|
65
|
-
className: l(r.item, o === n && r.active, e?.item, o === n && e?.active),
|
|
66
|
-
onClick: () => v(o),
|
|
67
|
-
disabled: u,
|
|
68
|
-
"aria-current": o === n ? "page" : void 0,
|
|
69
|
-
"aria-label": `Go to page ${o}`,
|
|
70
|
-
children: o
|
|
71
|
-
}
|
|
72
|
-
) }, o)
|
|
73
|
-
),
|
|
74
|
-
m && s("next", "right", n + 1, "Go to next page"),
|
|
75
|
-
f && s("last", "last", i, "Go to last page")
|
|
76
|
-
] })
|
|
77
|
-
}
|
|
78
|
-
);
|
|
79
|
-
}
|
|
80
|
-
);
|
|
81
|
-
z.displayName = "Pagination";
|
|
82
|
-
export {
|
|
83
|
-
z as Pagination
|
|
84
|
-
};
|
|
1
|
+
import e from "./Pagination.module.js";
|
|
2
|
+
import { paginationRange as t } from "./paginationRange.js";
|
|
3
|
+
import { forwardRef as n, useState as r } from "react";
|
|
4
|
+
import i from "clsx";
|
|
5
|
+
import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
6
|
+
// src/components/Pagination/Pagination.tsx
|
|
7
|
+
var c = ({ dir: e }) => /* @__PURE__ */ o("svg", {
|
|
8
|
+
viewBox: "0 0 12 12",
|
|
9
|
+
fill: "none",
|
|
10
|
+
stroke: "currentColor",
|
|
11
|
+
strokeWidth: "1.5",
|
|
12
|
+
strokeLinecap: "round",
|
|
13
|
+
strokeLinejoin: "round",
|
|
14
|
+
"aria-hidden": "true",
|
|
15
|
+
children: {
|
|
16
|
+
left: /* @__PURE__ */ o("path", { d: "M7 2L3 6l4 4" }),
|
|
17
|
+
right: /* @__PURE__ */ o("path", { d: "M5 2l4 4-4 4" }),
|
|
18
|
+
first: /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ o("path", { d: "M8 2L4 6l4 4" }), /* @__PURE__ */ o("path", { d: "M4 2v8" })] }),
|
|
19
|
+
last: /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ o("path", { d: "M4 2l4 4-4 4" }), /* @__PURE__ */ o("path", { d: "M8 2v8" })] })
|
|
20
|
+
}[e]
|
|
21
|
+
}), l = n(({ count: n, total: a, pageSize: l = 10, page: u, defaultPage: d = 1, onChange: f, boundaryCount: p = 1, siblingCount: m = 2, showPrevNext: h = !0, showFirstLast: g = !1, size: _ = "md", disabled: v = !1, label: y = "Pagination", classes: b, className: x, ...S }, C) => {
|
|
22
|
+
let w = n ?? (a == null ? 1 : Math.max(1, Math.ceil(a / l))), T = u !== void 0, [E, D] = r(d), O = Math.min(Math.max(T ? u : E, 1), w), k = (e) => {
|
|
23
|
+
let t = Math.min(Math.max(e, 1), w);
|
|
24
|
+
t !== O && (T || D(t), f?.(t));
|
|
25
|
+
}, A = t(O, w, p, m), j = (t, n, r, a) => /* @__PURE__ */ o("li", { children: /* @__PURE__ */ o("button", {
|
|
26
|
+
type: "button",
|
|
27
|
+
className: i(e.item, e.control, b?.item, b?.control),
|
|
28
|
+
onClick: () => k(r),
|
|
29
|
+
disabled: v || O === r || (n === "left" || n === "first" ? O === 1 : O === w),
|
|
30
|
+
"aria-label": a,
|
|
31
|
+
children: /* @__PURE__ */ o(c, { dir: n })
|
|
32
|
+
}) }, t);
|
|
33
|
+
return /* @__PURE__ */ o("nav", {
|
|
34
|
+
ref: C,
|
|
35
|
+
"aria-label": y,
|
|
36
|
+
className: i(e.root, e[_], b?.root, x),
|
|
37
|
+
...S,
|
|
38
|
+
children: /* @__PURE__ */ s("ul", {
|
|
39
|
+
className: i(e.list, b?.list),
|
|
40
|
+
children: [
|
|
41
|
+
g && j("first", "first", 1, "Go to first page"),
|
|
42
|
+
h && j("prev", "left", O - 1, "Go to previous page"),
|
|
43
|
+
A.map((t, n) => t === "ellipsis" ? /* @__PURE__ */ o("li", {
|
|
44
|
+
"aria-hidden": "true",
|
|
45
|
+
className: i(e.ellipsis, b?.ellipsis),
|
|
46
|
+
children: "…"
|
|
47
|
+
}, `e${n}`) : /* @__PURE__ */ o("li", { children: /* @__PURE__ */ o("button", {
|
|
48
|
+
type: "button",
|
|
49
|
+
className: i(e.item, t === O && e.active, b?.item, t === O && b?.active),
|
|
50
|
+
onClick: () => k(t),
|
|
51
|
+
disabled: v,
|
|
52
|
+
"aria-current": t === O ? "page" : void 0,
|
|
53
|
+
"aria-label": `Go to page ${t}`,
|
|
54
|
+
children: t
|
|
55
|
+
}) }, t)),
|
|
56
|
+
h && j("next", "right", O + 1, "Go to next page"),
|
|
57
|
+
g && j("last", "last", w, "Go to last page")
|
|
58
|
+
]
|
|
59
|
+
})
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
l.displayName = "Pagination";
|
|
63
|
+
export { l as Pagination };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// src/components/Pagination/Pagination.module.scss
|
|
2
|
+
var e = "crk-root-IuiQ5", t = "crk-sm-tfMLg", n = "crk-md-MdjxU", r = "crk-lg-6-p8a", i = "crk-list-UN-OF", a = "crk-item-ZOauk", o = "crk-active-gs4QO", s = "crk-control-HnlrC", c = "crk-ellipsis-iAsGN", l = {
|
|
3
|
+
root: e,
|
|
4
|
+
sm: t,
|
|
5
|
+
md: n,
|
|
6
|
+
lg: r,
|
|
7
|
+
list: i,
|
|
8
|
+
item: a,
|
|
9
|
+
active: o,
|
|
10
|
+
control: s,
|
|
11
|
+
ellipsis: c
|
|
12
|
+
};
|
|
13
|
+
export { o as active, s as control, l as default, c as ellipsis, a as item, r as lg, i as list, n as md, e as root, t as sm };
|
|
@@ -1,24 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
// src/components/Pagination/paginationRange.ts
|
|
2
|
+
function e(e, t) {
|
|
3
|
+
let n = Math.max(t - e + 1, 0);
|
|
4
|
+
return Array.from({ length: n }, (t, n) => e + n);
|
|
4
5
|
}
|
|
5
|
-
function
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
...m,
|
|
16
|
-
...a > e + 2 ? ["ellipsis"] : e + 1 < s - e ? [e + 1] : [],
|
|
17
|
-
...l(a, g),
|
|
18
|
-
...g < s - e - 1 ? ["ellipsis"] : s - e > e ? [s - e] : [],
|
|
19
|
-
...M
|
|
20
|
-
];
|
|
6
|
+
function t(t, n, r = 1, i = 2) {
|
|
7
|
+
if (n <= 0) return [];
|
|
8
|
+
let a = e(1, Math.min(r, n)), o = e(Math.max(n - r + 1, r + 1), n), s = Math.max(Math.min(t - i, n - r - i * 2 - 1), r + 2), c = Math.min(Math.max(t + i, r + i * 2 + 2), o.length > 0 ? o[0] - 2 : n - 1);
|
|
9
|
+
return [
|
|
10
|
+
...a,
|
|
11
|
+
...s > r + 2 ? ["ellipsis"] : r + 1 < n - r ? [r + 1] : [],
|
|
12
|
+
...e(s, c),
|
|
13
|
+
...c < n - r - 1 ? ["ellipsis"] : n - r > r ? [n - r] : [],
|
|
14
|
+
...o
|
|
15
|
+
];
|
|
21
16
|
}
|
|
22
|
-
export {
|
|
23
|
-
x as paginationRange
|
|
24
|
-
};
|
|
17
|
+
export { t as paginationRange };
|
|
@@ -1,135 +1,111 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import e from "./Popover.module.js";
|
|
2
|
+
import { useClickOutside as t } from "../../hooks/useClickOutside.js";
|
|
3
|
+
import { EscapeLayerProvider as n, useEscapeLayer as r } from "../../hooks/useEscapeLayer.js";
|
|
4
|
+
import { cloneElement as i, forwardRef as a, isValidElement as o, useCallback as s, useEffect as c, useId as l, useLayoutEffect as u, useRef as d, useState as f } from "react";
|
|
5
|
+
import p from "clsx";
|
|
6
|
+
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
7
|
+
// src/components/Popover/Popover.tsx
|
|
8
|
+
function g(...e) {
|
|
9
|
+
return (t) => {
|
|
10
|
+
for (let n of e) n && (typeof n == "function" ? n(t) : n.current = t);
|
|
11
|
+
};
|
|
12
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
|
-
o && /* @__PURE__ */ y(
|
|
113
|
-
"div",
|
|
114
|
-
{
|
|
115
|
-
ref: u,
|
|
116
|
-
id: k,
|
|
117
|
-
role: "dialog",
|
|
118
|
-
tabIndex: -1,
|
|
119
|
-
className: R(L.popover, L[m ? D : n], g?.popover),
|
|
120
|
-
style: m ? {
|
|
121
|
-
"--crk-popover-shift-x": `${F}px`,
|
|
122
|
-
"--crk-popover-shift-y": `${G}px`
|
|
123
|
-
} : void 0,
|
|
124
|
-
children: /* @__PURE__ */ y(ne, { value: J, children: l })
|
|
125
|
-
}
|
|
126
|
-
)
|
|
127
|
-
] })
|
|
128
|
-
}
|
|
129
|
-
);
|
|
130
|
-
}
|
|
131
|
-
);
|
|
132
|
-
se.displayName = "Popover";
|
|
133
|
-
export {
|
|
134
|
-
se as Popover
|
|
135
|
-
};
|
|
13
|
+
var _ = a(({ trigger: a, asChild: _ = !1, content: v, position: y = "bottom", autoPosition: b = !0, open: x, onOpenChange: S, classes: C, className: w, style: T }, E) => {
|
|
14
|
+
let [D, O] = f(!1), [k, A] = f(y), [j, M] = f(0), [N, P] = f(0), F = d(null), I = d(null), L = d(null), R = l(), z = x !== void 0, B = z ? x : D, V = s((e) => {
|
|
15
|
+
z || O(e), S?.(e);
|
|
16
|
+
}, [z, S]), H = s(() => {
|
|
17
|
+
V(!1), L.current?.focus();
|
|
18
|
+
}, [V]), U = s(() => {
|
|
19
|
+
V(!B);
|
|
20
|
+
}, [B, V]);
|
|
21
|
+
t(F, H, B);
|
|
22
|
+
let W = r(H, B);
|
|
23
|
+
u(() => {
|
|
24
|
+
if (!B || !b) {
|
|
25
|
+
A(y), M(0), P(0);
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
if (typeof window > "u") return;
|
|
29
|
+
let e = () => {
|
|
30
|
+
let e = L.current, t = I.current;
|
|
31
|
+
if (!e || !t) return;
|
|
32
|
+
let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = window.innerWidth, a = window.innerHeight, o = y;
|
|
33
|
+
if (y === "bottom" || y === "top") {
|
|
34
|
+
let e = n.bottom + 8 + r.height <= a, t = n.top - 8 - r.height >= 0;
|
|
35
|
+
y === "bottom" && !e && t ? o = "top" : y === "top" && !t && e && (o = "bottom");
|
|
36
|
+
} else {
|
|
37
|
+
let e = n.right + 8 + r.width <= i, t = n.left - 8 - r.width >= 0;
|
|
38
|
+
y === "right" && !e && t ? o = "left" : y === "left" && !t && e && (o = "right");
|
|
39
|
+
}
|
|
40
|
+
let s = 0, c = 0;
|
|
41
|
+
if (o === "bottom" || o === "top") {
|
|
42
|
+
let e = n.left + n.width / 2 - r.width / 2;
|
|
43
|
+
e < 8 ? s = 8 - e : e + r.width > i - 8 && (s = i - 8 - (e + r.width));
|
|
44
|
+
} else {
|
|
45
|
+
let e = n.top + n.height / 2 - r.height / 2;
|
|
46
|
+
e < 8 ? c = 8 - e : e + r.height > a - 8 && (c = a - 8 - (e + r.height));
|
|
47
|
+
}
|
|
48
|
+
s = Math.round(s), c = Math.round(c), A((e) => e === o ? e : o), M((e) => e === s ? e : s), P((e) => e === c ? e : c);
|
|
49
|
+
};
|
|
50
|
+
return e(), window.addEventListener("scroll", e, !0), window.addEventListener("resize", e), () => {
|
|
51
|
+
window.removeEventListener("scroll", e, !0), window.removeEventListener("resize", e);
|
|
52
|
+
};
|
|
53
|
+
}, [
|
|
54
|
+
B,
|
|
55
|
+
b,
|
|
56
|
+
y
|
|
57
|
+
]), c(() => {
|
|
58
|
+
if (B && I.current) {
|
|
59
|
+
let e = I.current.querySelector("button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])");
|
|
60
|
+
e ? e.focus() : I.current.focus();
|
|
61
|
+
}
|
|
62
|
+
}, [B]);
|
|
63
|
+
let G;
|
|
64
|
+
if (_ && o(a)) {
|
|
65
|
+
let e = a, t = e.ref;
|
|
66
|
+
G = i(e, {
|
|
67
|
+
ref: g(L, t),
|
|
68
|
+
onClick: (t) => {
|
|
69
|
+
e.props.onClick?.(t), U();
|
|
70
|
+
},
|
|
71
|
+
className: p(e.props.className, C?.trigger),
|
|
72
|
+
"aria-expanded": B,
|
|
73
|
+
"aria-haspopup": "dialog",
|
|
74
|
+
"aria-controls": B ? R : void 0
|
|
75
|
+
});
|
|
76
|
+
} else G = /* @__PURE__ */ m("button", {
|
|
77
|
+
ref: L,
|
|
78
|
+
type: "button",
|
|
79
|
+
className: p(e.trigger, C?.trigger),
|
|
80
|
+
onClick: U,
|
|
81
|
+
"aria-expanded": B,
|
|
82
|
+
"aria-haspopup": "dialog",
|
|
83
|
+
"aria-controls": B ? R : void 0,
|
|
84
|
+
children: a
|
|
85
|
+
});
|
|
86
|
+
return /* @__PURE__ */ m("div", {
|
|
87
|
+
ref: E,
|
|
88
|
+
className: p(e.root, C?.root, w),
|
|
89
|
+
style: T,
|
|
90
|
+
children: /* @__PURE__ */ h("div", {
|
|
91
|
+
ref: F,
|
|
92
|
+
children: [G, B && /* @__PURE__ */ m("div", {
|
|
93
|
+
ref: I,
|
|
94
|
+
id: R,
|
|
95
|
+
role: "dialog",
|
|
96
|
+
tabIndex: -1,
|
|
97
|
+
className: p(e.popover, e[b ? k : y], C?.popover),
|
|
98
|
+
style: b ? {
|
|
99
|
+
"--crk-popover-shift-x": `${j}px`,
|
|
100
|
+
"--crk-popover-shift-y": `${N}px`
|
|
101
|
+
} : void 0,
|
|
102
|
+
children: /* @__PURE__ */ m(n, {
|
|
103
|
+
value: W,
|
|
104
|
+
children: v
|
|
105
|
+
})
|
|
106
|
+
})]
|
|
107
|
+
})
|
|
108
|
+
});
|
|
109
|
+
});
|
|
110
|
+
_.displayName = "Popover";
|
|
111
|
+
export { _ as Popover };
|