@overdoser/react-toolkit 0.21.0 → 0.22.1
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 -0
- package/CHANGELOG.md +35 -0
- package/components/Accordion/Accordion.js +48 -48
- package/components/ActionButton/ActionButton.js +23 -23
- package/components/ActionButton/CopyButton.js +5 -5
- package/components/Alert/Alert.js +13 -13
- package/components/Avatar/Avatar.js +12 -12
- package/components/Badge/Badge.js +6 -6
- package/components/Breadcrumbs/Breadcrumbs.js +15 -15
- package/components/Button/Button.js +14 -14
- package/components/Card/Card.js +26 -26
- package/components/Chart/AreaChart.js +103 -103
- package/components/Chart/Axis.js +7 -7
- package/components/Chart/BarChart.js +62 -62
- package/components/Chart/ChartContainer.js +11 -11
- package/components/Chart/ChartLegend.js +7 -7
- package/components/Chart/ChartTooltip.js +13 -13
- package/components/Chart/LineChart.js +88 -88
- package/components/Chart/PieChart.js +25 -25
- package/components/Chart/RadarChart.js +42 -42
- package/components/Chart/Sparkline.js +11 -11
- package/components/Chart/TradingChart.js +126 -126
- package/components/Chart/trading/period.js +3 -3
- package/components/Chip/Chip.js +24 -24
- package/components/CodeBlock/CodeBlock.js +31 -31
- package/components/CommandPalette/CommandPalette.js +166 -166
- package/components/ConfirmDialog/ConfirmDialog.js +60 -60
- package/components/Divider/Divider.js +10 -10
- package/components/Draggable/Draggable.js +29 -29
- package/components/Drawer/Drawer.js +53 -53
- package/components/Dropdown/Dropdown.js +66 -66
- package/components/Dropdown/DropdownItem.js +13 -13
- package/components/Dropdown/DropdownLabel.js +5 -5
- package/components/Dropdown/DropdownSeparator.js +5 -5
- package/components/Dropzone/Dropzone.js +15 -15
- package/components/EmptyState/EmptyState.js +11 -11
- package/components/Form/Form.js +17 -17
- package/components/Form/FormField.js +21 -21
- package/components/Form/FormRow.js +3 -3
- package/components/ImageViewer/ImageViewer.js +118 -118
- package/components/Kbd/Kbd.js +11 -11
- package/components/KeyValueList/KeyValueList.js +32 -32
- package/components/Link/Link.js +7 -7
- package/components/List/List.js +7 -7
- package/components/Loader/Loader.js +39 -39
- package/components/Modal/Modal.js +48 -48
- package/components/PageHeader/PageHeader.js +18 -18
- package/components/Pagination/Pagination.js +23 -23
- package/components/Popover/Popover.js +25 -25
- package/components/ProgressBar/ProgressBar.js +17 -17
- package/components/RelativeTime/RelativeTime.js +10 -10
- package/components/SegmentedControl/SegmentedControl.js +38 -38
- package/components/Skeleton/Skeleton.js +10 -10
- package/components/Spinner/Spinner.js +7 -7
- package/components/SplitButton/SplitButton.js +63 -63
- package/components/SplitPane/SplitPane.js +50 -50
- package/components/StatCard/StatCard.js +32 -32
- package/components/StatusDot/StatusDot.js +7 -7
- package/components/Table/Table.js +174 -174
- package/components/Tabs/Tabs.js +47 -47
- package/components/ThemeToggle/ThemeToggle.js +31 -31
- package/components/Timeline/GanttTimeline.js +213 -213
- package/components/Timeline/HistoryTimeline.js +306 -306
- package/components/Timeline/TimelineShared.js +103 -103
- package/components/Timeline/TraceEventDetails.js +103 -103
- package/components/Timeline/TraceTimeline.js +546 -546
- package/components/Timeline/historyLayout.js +2 -2
- package/components/Timer/Timer.js +39 -39
- package/components/Toast/Toast.js +59 -59
- package/components/ToggleIconButton/ToggleIconButton.js +9 -9
- package/components/Tooltip/Tooltip.js +16 -16
- package/components/Typography/Typography.js +5 -5
- package/components/inputs/Checkbox/Checkbox.js +11 -11
- package/components/inputs/Checkbox/CheckboxGroup.js +21 -21
- package/components/inputs/DatePicker/CalendarPanel.js +113 -113
- package/components/inputs/DatePicker/DatePicker.js +39 -39
- package/components/inputs/DateTimePicker/DateTimePicker.js +119 -119
- package/components/inputs/DateTimePicker/DateTimeSegments.js +40 -40
- package/components/inputs/DateTimePicker/TimeField.js +34 -34
- package/components/inputs/Input/Input.js +13 -13
- package/components/inputs/NumberInput/NumberInput.js +16 -16
- package/components/inputs/Radio/Radio.js +17 -17
- package/components/inputs/SearchInput/SearchInput.js +25 -25
- package/components/inputs/Select/Select.d.ts +55 -3
- package/components/inputs/Select/Select.js +485 -344
- package/components/inputs/Select/{Select.module.js → Select.module.scss.js} +15 -3
- package/components/inputs/Slider/Slider.js +21 -21
- package/components/inputs/Switch/Switch.js +4 -4
- package/components/inputs/Textarea/Textarea.js +8 -8
- package/hooks/usePortalPosition.d.ts +2 -1
- package/hooks/usePortalPosition.js +6 -3
- package/hooks/useResizable.js +1 -1
- package/hooks/useTheme.js +7 -7
- package/index.css +1 -1
- package/index.js +1 -1
- package/index.layered.css +1 -1
- package/llms.txt +25 -4
- package/manifest.json +33 -4
- package/package.json +1 -1
- /package/components/Accordion/{Accordion.module.js → Accordion.module.scss.js} +0 -0
- /package/components/ActionButton/{ActionButton.module.js → ActionButton.module.scss.js} +0 -0
- /package/components/Alert/{Alert.module.js → Alert.module.scss.js} +0 -0
- /package/components/Avatar/{Avatar.module.js → Avatar.module.scss.js} +0 -0
- /package/components/Badge/{Badge.module.js → Badge.module.scss.js} +0 -0
- /package/components/Breadcrumbs/{Breadcrumbs.module.js → Breadcrumbs.module.scss.js} +0 -0
- /package/components/Button/{Button.module.js → Button.module.scss.js} +0 -0
- /package/components/Card/{Card.module.js → Card.module.scss.js} +0 -0
- /package/components/Chart/{Chart.module.js → Chart.module.scss.js} +0 -0
- /package/components/Chip/{Chip.module.js → Chip.module.scss.js} +0 -0
- /package/components/CodeBlock/{CodeBlock.module.js → CodeBlock.module.scss.js} +0 -0
- /package/components/CommandPalette/{CommandPalette.module.js → CommandPalette.module.scss.js} +0 -0
- /package/components/ConfirmDialog/{ConfirmDialog.module.js → ConfirmDialog.module.scss.js} +0 -0
- /package/components/Divider/{Divider.module.js → Divider.module.scss.js} +0 -0
- /package/components/Draggable/{Draggable.module.js → Draggable.module.scss.js} +0 -0
- /package/components/Drawer/{Drawer.module.js → Drawer.module.scss.js} +0 -0
- /package/components/Dropdown/{Dropdown.module.js → Dropdown.module.scss.js} +0 -0
- /package/components/Dropzone/{Dropzone.module.js → Dropzone.module.scss.js} +0 -0
- /package/components/EmptyState/{EmptyState.module.js → EmptyState.module.scss.js} +0 -0
- /package/components/Form/{Form.module.js → Form.module.scss.js} +0 -0
- /package/components/ImageViewer/{ImageViewer.module.js → ImageViewer.module.scss.js} +0 -0
- /package/components/Kbd/{Kbd.module.js → Kbd.module.scss.js} +0 -0
- /package/components/KeyValueList/{KeyValueList.module.js → KeyValueList.module.scss.js} +0 -0
- /package/components/Link/{Link.module.js → Link.module.scss.js} +0 -0
- /package/components/List/{List.module.js → List.module.scss.js} +0 -0
- /package/components/Loader/{Loader.module.js → Loader.module.scss.js} +0 -0
- /package/components/Modal/{Modal.module.js → Modal.module.scss.js} +0 -0
- /package/components/PageHeader/{PageHeader.module.js → PageHeader.module.scss.js} +0 -0
- /package/components/Pagination/{Pagination.module.js → Pagination.module.scss.js} +0 -0
- /package/components/Popover/{Popover.module.js → Popover.module.scss.js} +0 -0
- /package/components/ProgressBar/{ProgressBar.module.js → ProgressBar.module.scss.js} +0 -0
- /package/components/RelativeTime/{RelativeTime.module.js → RelativeTime.module.scss.js} +0 -0
- /package/components/SegmentedControl/{SegmentedControl.module.js → SegmentedControl.module.scss.js} +0 -0
- /package/components/Skeleton/{Skeleton.module.js → Skeleton.module.scss.js} +0 -0
- /package/components/Spinner/{Spinner.module.js → Spinner.module.scss.js} +0 -0
- /package/components/SplitButton/{SplitButton.module.js → SplitButton.module.scss.js} +0 -0
- /package/components/SplitPane/{SplitPane.module.js → SplitPane.module.scss.js} +0 -0
- /package/components/StatCard/{StatCard.module.js → StatCard.module.scss.js} +0 -0
- /package/components/StatusDot/{StatusDot.module.js → StatusDot.module.scss.js} +0 -0
- /package/components/Table/{Table.module.js → Table.module.scss.js} +0 -0
- /package/components/Tabs/{Tabs.module.js → Tabs.module.scss.js} +0 -0
- /package/components/ThemeToggle/{ThemeToggle.module.js → ThemeToggle.module.scss.js} +0 -0
- /package/components/Timeline/{GanttTimeline.module.js → GanttTimeline.module.scss.js} +0 -0
- /package/components/Timeline/{HistoryTimeline.module.js → HistoryTimeline.module.scss.js} +0 -0
- /package/components/Timeline/{Timeline.module.js → Timeline.module.scss.js} +0 -0
- /package/components/Timeline/{TraceTimeline.module.js → TraceTimeline.module.scss.js} +0 -0
- /package/components/Timer/{Timer.module.js → Timer.module.scss.js} +0 -0
- /package/components/Toast/{Toast.module.js → Toast.module.scss.js} +0 -0
- /package/components/ToggleIconButton/{ToggleIconButton.module.js → ToggleIconButton.module.scss.js} +0 -0
- /package/components/Tooltip/{Tooltip.module.js → Tooltip.module.scss.js} +0 -0
- /package/components/Typography/{Typography.module.js → Typography.module.scss.js} +0 -0
- /package/components/inputs/Checkbox/{Checkbox.module.js → Checkbox.module.scss.js} +0 -0
- /package/components/inputs/Checkbox/{CheckboxGroup.module.js → CheckboxGroup.module.scss.js} +0 -0
- /package/components/inputs/DatePicker/{CalendarPanel.module.js → CalendarPanel.module.scss.js} +0 -0
- /package/components/inputs/DatePicker/{DatePicker.module.js → DatePicker.module.scss.js} +0 -0
- /package/components/inputs/DateTimePicker/{DateTimePicker.module.js → DateTimePicker.module.scss.js} +0 -0
- /package/components/inputs/Input/{Input.module.js → Input.module.scss.js} +0 -0
- /package/components/inputs/NumberInput/{NumberInput.module.js → NumberInput.module.scss.js} +0 -0
- /package/components/inputs/Radio/{Radio.module.js → Radio.module.scss.js} +0 -0
- /package/components/inputs/SearchInput/{SearchInput.module.js → SearchInput.module.scss.js} +0 -0
- /package/components/inputs/Slider/{Slider.module.js → Slider.module.scss.js} +0 -0
- /package/components/inputs/Textarea/{Textarea.module.js → Textarea.module.scss.js} +0 -0
package/AGENTS.md
CHANGED
|
@@ -49,6 +49,7 @@ For exhaustive component reference (every prop, every variant, every signature),
|
|
|
49
49
|
- Few options, native UX OK → `<Select options={...} />`.
|
|
50
50
|
- Many options, want a search filter → `<Select searchable options={...} />`.
|
|
51
51
|
- Multi-pick with chips → `<Select multiple options={...} onValuesChange={...} />`.
|
|
52
|
+
- Picking many values from a long list while filtering (AWS console log-group picker: checkboxes, selected rows stay visible, Select all matching) → `<Select multiple checklist maxVisibleChips={3} ... />`.
|
|
52
53
|
- Options come from a server as the user types (async autocomplete / combobox) → `<Select searchable onSearch={fetch} loading={…} options={results} selectedLabels={…} />` (same for `multiple`). Don't build a Combobox.
|
|
53
54
|
- You want it to look like a "menu trigger" instead of a form input → `<Dropdown options={...} value={...} onChange={...} />` (select-mode dropdown).
|
|
54
55
|
|
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,41 @@ All notable changes to `@overdoser/react-toolkit` are documented here.
|
|
|
4
4
|
The format is based on [Keep a Changelog](https://keepachangelog.com/), and this
|
|
5
5
|
project adheres to [Semantic Versioning](https://semver.org/).
|
|
6
6
|
|
|
7
|
+
## [0.22.1]
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
|
|
11
|
+
- **`Select` checklist mode** — hovering a selected row no longer switches
|
|
12
|
+
its font weight from 400 to 500. Fonts that render both weights
|
|
13
|
+
differently showed the row text jump on hover.
|
|
14
|
+
|
|
15
|
+
## [0.22.0]
|
|
16
|
+
|
|
17
|
+
### Added
|
|
18
|
+
|
|
19
|
+
- **`Select` checklist mode.** `multiple checklist` is the AWS CloudWatch
|
|
20
|
+
log-group picker, for picking many values while filtering: the search box
|
|
21
|
+
moves into the menu, every row gets a checkbox, and selected options stay
|
|
22
|
+
listed when they don't match the query, in their `options` order. A row
|
|
23
|
+
unchecked while filtered stays put until the query changes, so nothing
|
|
24
|
+
jumps under the pointer. The header offers "Select all matching" and
|
|
25
|
+
"Deselect all" (`selectAllLabel`, `deselectAllLabel`). The menu stays open
|
|
26
|
+
while picking (`closeOnSelect` and `clearSearchOnSelect` default to
|
|
27
|
+
`false`) and closes on outside click, Escape or Tab. Chips show the plain
|
|
28
|
+
`label`, so a rich two-line `content` row stays in the menu.
|
|
29
|
+
- **`Select` `maxVisibleChips`.** Any multi mode can cap the chips in the
|
|
30
|
+
control; the rest collapse into a "+N more" chip whose tooltip lists them
|
|
31
|
+
(`moreChipsLabel` customises its text).
|
|
32
|
+
|
|
33
|
+
### Fixed
|
|
34
|
+
|
|
35
|
+
- **Portaled menus** (`Select`, and everything else on `usePortalPosition`)
|
|
36
|
+
follow the trigger when it grows while open, instead of covering the new
|
|
37
|
+
chip rows, and no longer re-render on scrolls that move nothing.
|
|
38
|
+
- **`Select`** — option ids are scoped per instance, so two Selects with the
|
|
39
|
+
same values no longer share ids, and values containing spaces give valid
|
|
40
|
+
`aria-activedescendant` targets.
|
|
41
|
+
|
|
7
42
|
## [0.21.0]
|
|
8
43
|
|
|
9
44
|
### Added
|
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import
|
|
3
|
-
import c from "
|
|
1
|
+
import { createContext as e, forwardRef as t, useCallback as n, useContext as r, useId as i, useRef as a, useState as o } from "react";
|
|
2
|
+
import s from "clsx";
|
|
3
|
+
import c from "./Accordion.module.scss.js";
|
|
4
4
|
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
5
5
|
// src/components/Accordion/Accordion.tsx
|
|
6
|
-
var d =
|
|
6
|
+
var d = e(null), f = e(null);
|
|
7
7
|
function p(e) {
|
|
8
|
-
let t =
|
|
8
|
+
let t = r(d);
|
|
9
9
|
if (!t) throw Error(`${e} must be rendered inside an <Accordion>.`);
|
|
10
10
|
return t;
|
|
11
11
|
}
|
|
12
12
|
function m(e) {
|
|
13
|
-
let t =
|
|
13
|
+
let t = r(f);
|
|
14
14
|
if (!t) throw Error(`${e} must be rendered inside an <Accordion.Item>.`);
|
|
15
15
|
return t;
|
|
16
16
|
}
|
|
17
17
|
function h(e) {
|
|
18
18
|
return e === void 0 ? [] : Array.isArray(e) ? e : [e];
|
|
19
19
|
}
|
|
20
|
-
var g =
|
|
21
|
-
let A =
|
|
22
|
-
let n = F.includes(
|
|
23
|
-
if (
|
|
20
|
+
var g = t(({ type: e = "single", value: t, defaultValue: r, onValueChange: f, collapsible: p = !0, keepMounted: m = !1, variant: g = "default", size: v = "md", disabled: x = !1, headingLevel: S = 3, items: C, classes: w, className: T, children: E, onKeyDown: D, ...O }, k) => {
|
|
21
|
+
let A = i(), j = a(null), M = t !== void 0, [N, P] = o(() => h(r)), F = M ? h(t) : N, I = n((t) => {
|
|
22
|
+
let n = F.includes(t), r;
|
|
23
|
+
if (e === "multiple") r = n ? F.filter((e) => e !== t) : [...F, t];
|
|
24
24
|
else if (n) {
|
|
25
25
|
if (!p) return;
|
|
26
26
|
r = [];
|
|
27
|
-
} else r = [
|
|
28
|
-
M || P(r), f?.(
|
|
27
|
+
} else r = [t];
|
|
28
|
+
M || P(r), f?.(e === "multiple" ? r : r[0] ?? "");
|
|
29
29
|
}, [
|
|
30
30
|
F,
|
|
31
|
-
|
|
31
|
+
e,
|
|
32
32
|
p,
|
|
33
33
|
M,
|
|
34
34
|
f
|
|
35
|
-
]), L =
|
|
35
|
+
]), L = n((e) => {
|
|
36
36
|
j.current = e, typeof k == "function" ? k(e) : k && (k.current = e);
|
|
37
37
|
}, [k]), R = (e) => {
|
|
38
38
|
if (D?.(e), e.defaultPrevented) return;
|
|
@@ -58,7 +58,7 @@ var g = n(({ type: t = "single", value: n, defaultValue: i, onValueChange: f, co
|
|
|
58
58
|
children: /* @__PURE__ */ l("div", {
|
|
59
59
|
ref: L,
|
|
60
60
|
"data-accordion-root": "",
|
|
61
|
-
className: c
|
|
61
|
+
className: s(c.root, c[g], c[v], w?.root, T),
|
|
62
62
|
onKeyDown: R,
|
|
63
63
|
...O,
|
|
64
64
|
children: C ? C.map((e) => /* @__PURE__ */ u(_, {
|
|
@@ -70,9 +70,9 @@ var g = n(({ type: t = "single", value: n, defaultValue: i, onValueChange: f, co
|
|
|
70
70
|
});
|
|
71
71
|
});
|
|
72
72
|
g.displayName = "Accordion";
|
|
73
|
-
var _ =
|
|
74
|
-
let
|
|
75
|
-
value:
|
|
73
|
+
var _ = t(({ value: e, disabled: t = !1, className: n, children: r, ...i }, a) => {
|
|
74
|
+
let o = p("Accordion.Item"), u = o.openValues.includes(e), d = t || o.disabled, m = `${o.baseId}-${e}`, h = {
|
|
75
|
+
value: e,
|
|
76
76
|
open: u,
|
|
77
77
|
disabled: d,
|
|
78
78
|
triggerId: `${m}-trigger`,
|
|
@@ -81,12 +81,12 @@ var _ = n(({ value: t, disabled: n = !1, className: r, children: i, ...a }, o) =
|
|
|
81
81
|
return /* @__PURE__ */ l(f.Provider, {
|
|
82
82
|
value: h,
|
|
83
83
|
children: /* @__PURE__ */ l("div", {
|
|
84
|
-
ref:
|
|
84
|
+
ref: a,
|
|
85
85
|
"data-state": u ? "open" : "closed",
|
|
86
86
|
"data-disabled": d || void 0,
|
|
87
|
-
className: c
|
|
88
|
-
...
|
|
89
|
-
children:
|
|
87
|
+
className: s(c.item, u && c.itemOpen, d && c.itemDisabled, o.classes?.item, u && o.classes?.itemOpen, n),
|
|
88
|
+
...i,
|
|
89
|
+
children: r
|
|
90
90
|
})
|
|
91
91
|
});
|
|
92
92
|
});
|
|
@@ -104,55 +104,55 @@ var v = /* @__PURE__ */ l("svg", {
|
|
|
104
104
|
strokeLinecap: "round",
|
|
105
105
|
strokeLinejoin: "round"
|
|
106
106
|
})
|
|
107
|
-
}), y =
|
|
108
|
-
let d = p("Accordion.Trigger"), f = m("Accordion.Trigger"), h = `h${d.headingLevel}`, g =
|
|
109
|
-
className: c
|
|
107
|
+
}), y = t(({ icon: e = v, iconPosition: t = "end", className: n, children: r, onClick: i, ...a }, o) => {
|
|
108
|
+
let d = p("Accordion.Trigger"), f = m("Accordion.Trigger"), h = `h${d.headingLevel}`, g = e === !1 ? null : /* @__PURE__ */ l("span", {
|
|
109
|
+
className: s(c.icon, d.classes?.icon),
|
|
110
110
|
"aria-hidden": "true",
|
|
111
|
-
children:
|
|
111
|
+
children: e
|
|
112
112
|
});
|
|
113
113
|
return /* @__PURE__ */ l(h, {
|
|
114
|
-
className: c
|
|
114
|
+
className: s(c.header, d.classes?.header),
|
|
115
115
|
children: /* @__PURE__ */ u("button", {
|
|
116
|
-
ref:
|
|
116
|
+
ref: o,
|
|
117
117
|
type: "button",
|
|
118
118
|
id: f.triggerId,
|
|
119
119
|
"data-accordion-trigger": "",
|
|
120
120
|
"aria-expanded": f.open,
|
|
121
121
|
"aria-controls": f.contentId,
|
|
122
122
|
disabled: f.disabled,
|
|
123
|
-
className: c
|
|
123
|
+
className: s(c.trigger, t === "start" && c.iconStart, d.classes?.trigger, n),
|
|
124
124
|
onClick: (e) => {
|
|
125
|
-
|
|
125
|
+
i?.(e), e.defaultPrevented || d.toggle(f.value);
|
|
126
126
|
},
|
|
127
|
-
...
|
|
127
|
+
...a,
|
|
128
128
|
children: [
|
|
129
|
-
|
|
129
|
+
t === "start" && g,
|
|
130
130
|
/* @__PURE__ */ l("span", {
|
|
131
|
-
className:
|
|
132
|
-
children:
|
|
131
|
+
className: c.triggerLabel,
|
|
132
|
+
children: r
|
|
133
133
|
}),
|
|
134
|
-
|
|
134
|
+
t === "end" && g
|
|
135
135
|
]
|
|
136
136
|
})
|
|
137
137
|
});
|
|
138
138
|
});
|
|
139
139
|
y.displayName = "Accordion.Trigger";
|
|
140
|
-
var b =
|
|
141
|
-
let
|
|
142
|
-
return !
|
|
143
|
-
ref:
|
|
144
|
-
id:
|
|
140
|
+
var b = t(({ className: e, children: t, ...n }, r) => {
|
|
141
|
+
let i = p("Accordion.Content"), a = m("Accordion.Content");
|
|
142
|
+
return !a.open && !i.keepMounted ? null : /* @__PURE__ */ l("div", {
|
|
143
|
+
ref: r,
|
|
144
|
+
id: a.contentId,
|
|
145
145
|
role: "region",
|
|
146
|
-
"aria-labelledby":
|
|
147
|
-
hidden: !
|
|
148
|
-
"data-state":
|
|
149
|
-
className: c
|
|
150
|
-
...
|
|
146
|
+
"aria-labelledby": a.triggerId,
|
|
147
|
+
hidden: !a.open,
|
|
148
|
+
"data-state": a.open ? "open" : "closed",
|
|
149
|
+
className: s(c.content, i.classes?.content, e),
|
|
150
|
+
...n,
|
|
151
151
|
children: /* @__PURE__ */ l("div", {
|
|
152
|
-
className:
|
|
152
|
+
className: c.contentClip,
|
|
153
153
|
children: /* @__PURE__ */ l("div", {
|
|
154
|
-
className: c
|
|
155
|
-
children:
|
|
154
|
+
className: s(c.contentInner, i.classes?.contentInner),
|
|
155
|
+
children: t
|
|
156
156
|
})
|
|
157
157
|
})
|
|
158
158
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import
|
|
3
|
-
import a from "
|
|
1
|
+
import { forwardRef as e, useEffect as t, useRef as n, useState as r } from "react";
|
|
2
|
+
import i from "clsx";
|
|
3
|
+
import a from "./ActionButton.module.scss.js";
|
|
4
4
|
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
5
5
|
// src/components/ActionButton/ActionButton.tsx
|
|
6
6
|
function c() {
|
|
@@ -30,9 +30,9 @@ function l() {
|
|
|
30
30
|
children: /* @__PURE__ */ o("path", { d: "M21 12a9 9 0 1 1-9-9" })
|
|
31
31
|
});
|
|
32
32
|
}
|
|
33
|
-
var u =
|
|
34
|
-
let [N, P] =
|
|
35
|
-
|
|
33
|
+
var u = e(({ icon: e, label: u, pendingIcon: d, pendingLabel: f, successIcon: p, successLabel: m, confirmLabel: h, confirmTimeout: g = 2600, onAction: _, progressLabel: v, onError: y, onPhaseChange: b, resetAfter: x = 1800, speed: S = 1, variant: C = "secondary", size: w = "md", iconOnly: T = !1, classes: E, className: D, style: O, disabled: k, onClick: A, ...j }, M) => {
|
|
34
|
+
let [N, P] = r("idle"), [F, I] = r(null), L = n("idle"), R = n(!0), z = n({});
|
|
35
|
+
t(() => {
|
|
36
36
|
R.current = !0;
|
|
37
37
|
let e = z.current;
|
|
38
38
|
return () => {
|
|
@@ -70,7 +70,7 @@ var u = t(({ icon: t, label: u, pendingIcon: d, pendingLabel: f, successIcon: p,
|
|
|
70
70
|
}, K = N === "pending" && F != null, q = [
|
|
71
71
|
{
|
|
72
72
|
key: "idle",
|
|
73
|
-
node:
|
|
73
|
+
node: e,
|
|
74
74
|
visible: N === "idle" || N === "armed" || K
|
|
75
75
|
},
|
|
76
76
|
{
|
|
@@ -110,14 +110,14 @@ var u = t(({ icon: t, label: u, pendingIcon: d, pendingLabel: f, successIcon: p,
|
|
|
110
110
|
node: m,
|
|
111
111
|
visible: N === "success"
|
|
112
112
|
}
|
|
113
|
-
].filter((e) => e.node != null).map((
|
|
114
|
-
...
|
|
115
|
-
position:
|
|
113
|
+
].filter((e) => e.node != null).map((e) => ({
|
|
114
|
+
...e,
|
|
115
|
+
position: e.visible ? void 0 : X[e.key] < X[N] ? a.labelAbove : a.labelBelow
|
|
116
116
|
}));
|
|
117
117
|
return /* @__PURE__ */ s("button", {
|
|
118
118
|
ref: M,
|
|
119
119
|
type: "button",
|
|
120
|
-
className: a
|
|
120
|
+
className: i(a.root, a[C], a[w], T && a.iconOnly, E?.root, D),
|
|
121
121
|
style: S === 1 ? O : {
|
|
122
122
|
...O,
|
|
123
123
|
"--crk-action-speed": S
|
|
@@ -129,26 +129,26 @@ var u = t(({ icon: t, label: u, pendingIcon: d, pendingLabel: f, successIcon: p,
|
|
|
129
129
|
...j,
|
|
130
130
|
children: [
|
|
131
131
|
/* @__PURE__ */ o("span", {
|
|
132
|
-
className: a
|
|
132
|
+
className: i(a.progressFill, K && a.progressFillActive, E?.progressFill),
|
|
133
133
|
style: { width: `${F ?? 0}%` },
|
|
134
134
|
"aria-hidden": "true"
|
|
135
135
|
}),
|
|
136
136
|
/* @__PURE__ */ o("span", {
|
|
137
|
-
className: a
|
|
137
|
+
className: i(a.iconStack, E?.iconStack),
|
|
138
138
|
"aria-hidden": "true",
|
|
139
|
-
children: q.map((
|
|
140
|
-
className: a
|
|
141
|
-
children:
|
|
142
|
-
},
|
|
139
|
+
children: q.map((e) => /* @__PURE__ */ o("span", {
|
|
140
|
+
className: i(a.iconLayer, e.visible && a.layerVisible, e.visible && e.spin && a.iconSpin, E?.iconLayer),
|
|
141
|
+
children: e.node
|
|
142
|
+
}, e.key))
|
|
143
143
|
}),
|
|
144
144
|
!T && Z.length > 0 && /* @__PURE__ */ o("span", {
|
|
145
|
-
className: a
|
|
145
|
+
className: i(a.labelStack, E?.labelStack),
|
|
146
146
|
"aria-live": K ? "off" : "polite",
|
|
147
|
-
children: Z.map((
|
|
148
|
-
"aria-hidden": !
|
|
149
|
-
className: a
|
|
150
|
-
children:
|
|
151
|
-
},
|
|
147
|
+
children: Z.map((e) => /* @__PURE__ */ o("span", {
|
|
148
|
+
"aria-hidden": !e.visible || void 0,
|
|
149
|
+
className: i(a.labelLayer, e.visible && a.layerVisible, e.position, E?.labelLayer),
|
|
150
|
+
children: e.node
|
|
151
|
+
}, e.key))
|
|
152
152
|
})
|
|
153
153
|
]
|
|
154
154
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { forwardRef as e } from "react";
|
|
2
|
+
import { ActionButton as t } from "./ActionButton.js";
|
|
3
3
|
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
4
|
// src/components/ActionButton/CopyButton.tsx
|
|
5
5
|
function i() {
|
|
@@ -35,14 +35,14 @@ async function a(e) {
|
|
|
35
35
|
t.remove();
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
var o =
|
|
38
|
+
var o = e(({ value: e, icon: r = /* @__PURE__ */ n(i, {}), label: o = "Copy", successLabel: s = "Copied", onCopied: c, style: l, ...u }, d) => /* @__PURE__ */ n(t, {
|
|
39
39
|
ref: d,
|
|
40
40
|
icon: r,
|
|
41
41
|
label: o,
|
|
42
42
|
successLabel: s,
|
|
43
43
|
onAction: async () => {
|
|
44
|
-
let
|
|
45
|
-
await a(
|
|
44
|
+
let t = typeof e == "function" ? await e() : e;
|
|
45
|
+
await a(t), c?.(t);
|
|
46
46
|
},
|
|
47
47
|
style: {
|
|
48
48
|
"--crk-action-icon-exit": "scale(0.4) rotate(-40deg)",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import
|
|
3
|
-
import n from "
|
|
1
|
+
import { forwardRef as e } from "react";
|
|
2
|
+
import t from "clsx";
|
|
3
|
+
import n from "./Alert.module.scss.js";
|
|
4
4
|
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
5
5
|
// src/components/Alert/Alert.tsx
|
|
6
6
|
var a = {
|
|
@@ -44,31 +44,31 @@ var a = {
|
|
|
44
44
|
clipRule: "evenodd"
|
|
45
45
|
})
|
|
46
46
|
})
|
|
47
|
-
}, o =
|
|
48
|
-
let v = s === !0 ? a[
|
|
49
|
-
className: n
|
|
47
|
+
}, o = e(({ variant: e = "info", title: o, icon: s = !0, onClose: c, closeLabel: l = "Dismiss", action: u, layout: d = "inline", size: f = "md", classes: p, className: m, children: h, ...g }, _) => {
|
|
48
|
+
let v = s === !0 ? a[e] : s === !1 ? null : s, y = u == null ? null : /* @__PURE__ */ r("div", {
|
|
49
|
+
className: t(n.action, p?.action),
|
|
50
50
|
children: u
|
|
51
51
|
});
|
|
52
52
|
return /* @__PURE__ */ i("div", {
|
|
53
53
|
ref: _,
|
|
54
54
|
role: "alert",
|
|
55
|
-
className: n
|
|
55
|
+
className: t(n.root, n[e], d === "banner" && n.banner, f === "sm" && n.sm, p?.root, m),
|
|
56
56
|
...g,
|
|
57
57
|
children: [
|
|
58
58
|
v != null && /* @__PURE__ */ r("span", {
|
|
59
|
-
className: n
|
|
59
|
+
className: t(n.icon, p?.icon),
|
|
60
60
|
"aria-hidden": "true",
|
|
61
61
|
children: v
|
|
62
62
|
}),
|
|
63
63
|
/* @__PURE__ */ i("div", {
|
|
64
|
-
className: n
|
|
64
|
+
className: t(n.content, p?.content),
|
|
65
65
|
children: [/* @__PURE__ */ i("div", {
|
|
66
|
-
className:
|
|
66
|
+
className: n.text,
|
|
67
67
|
children: [o != null && /* @__PURE__ */ r("div", {
|
|
68
|
-
className: n
|
|
68
|
+
className: t(n.title, p?.title),
|
|
69
69
|
children: o
|
|
70
70
|
}), h != null && /* @__PURE__ */ r("div", {
|
|
71
|
-
className: n
|
|
71
|
+
className: t(n.message, p?.message),
|
|
72
72
|
children: h
|
|
73
73
|
})]
|
|
74
74
|
}), d === "inline" && y]
|
|
@@ -76,7 +76,7 @@ var a = {
|
|
|
76
76
|
d === "banner" && y,
|
|
77
77
|
c && /* @__PURE__ */ r("button", {
|
|
78
78
|
type: "button",
|
|
79
|
-
className: n
|
|
79
|
+
className: t(n.close, p?.close),
|
|
80
80
|
onClick: c,
|
|
81
81
|
"aria-label": l,
|
|
82
82
|
children: /* @__PURE__ */ r("svg", {
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import
|
|
3
|
-
import i from "
|
|
1
|
+
import { forwardRef as e, useEffect as t, useState as n } from "react";
|
|
2
|
+
import r from "clsx";
|
|
3
|
+
import i from "./Avatar.module.scss.js";
|
|
4
4
|
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
5
5
|
// src/components/Avatar/Avatar.tsx
|
|
6
6
|
function s(e) {
|
|
7
7
|
let t = e.trim().split(/\s+/).filter(Boolean);
|
|
8
8
|
return t.length === 0 ? "" : t.length === 1 ? t[0].slice(0, 2).toUpperCase() : (t[0][0] + t[t.length - 1][0]).toUpperCase();
|
|
9
9
|
}
|
|
10
|
-
var c =
|
|
11
|
-
let [y, b] =
|
|
12
|
-
|
|
13
|
-
let x =
|
|
10
|
+
var c = e(({ src: e, alt: c, name: u, fallback: d, size: f = "md", shape: p = "circle", status: m, classes: h, className: g, ..._ }, v) => {
|
|
11
|
+
let [y, b] = n(!1);
|
|
12
|
+
t(() => b(!1), [e]);
|
|
13
|
+
let x = e && !y, S = u ? s(u) : "";
|
|
14
14
|
return /* @__PURE__ */ o("span", {
|
|
15
15
|
ref: v,
|
|
16
|
-
className: i
|
|
16
|
+
className: r(i.root, i[f], i[p], h?.root, g),
|
|
17
17
|
..._,
|
|
18
18
|
children: [x ? /* @__PURE__ */ a("img", {
|
|
19
|
-
className: i
|
|
20
|
-
src:
|
|
19
|
+
className: r(i.image, h?.image),
|
|
20
|
+
src: e,
|
|
21
21
|
alt: c ?? u ?? "",
|
|
22
22
|
onError: () => b(!0)
|
|
23
23
|
}) : /* @__PURE__ */ a("span", {
|
|
24
|
-
className: i
|
|
24
|
+
className: r(i.fallback, h?.fallback),
|
|
25
25
|
role: "img",
|
|
26
26
|
"aria-label": c ?? u ?? "Avatar",
|
|
27
27
|
children: d ?? (S || /* @__PURE__ */ a(l, {}))
|
|
28
28
|
}), m && /* @__PURE__ */ a("span", {
|
|
29
|
-
className: i
|
|
29
|
+
className: r(i.status, i[`status_${m}`], h?.status),
|
|
30
30
|
"data-status": m,
|
|
31
31
|
"aria-hidden": "true"
|
|
32
32
|
})]
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import
|
|
3
|
-
import n from "
|
|
1
|
+
import { forwardRef as e } from "react";
|
|
2
|
+
import t from "clsx";
|
|
3
|
+
import n from "./Badge.module.scss.js";
|
|
4
4
|
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
5
5
|
// src/components/Badge/Badge.tsx
|
|
6
|
-
var a =
|
|
6
|
+
var a = e(({ variant: e = "neutral", appearance: a = "soft", size: o = "md", dot: s = !1, classes: c, className: l, children: u, ...d }, f) => /* @__PURE__ */ i("span", {
|
|
7
7
|
ref: f,
|
|
8
|
-
className: n
|
|
8
|
+
className: t(n.root, n[e], n[a], n[o], c?.root, l),
|
|
9
9
|
...d,
|
|
10
10
|
children: [s && /* @__PURE__ */ r("span", {
|
|
11
|
-
className: n
|
|
11
|
+
className: t(n.dot, c?.dot),
|
|
12
12
|
"aria-hidden": "true"
|
|
13
13
|
}), u]
|
|
14
14
|
}));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import
|
|
3
|
-
import i from "
|
|
1
|
+
import { Children as e, forwardRef as t, isValidElement as n } from "react";
|
|
2
|
+
import r from "clsx";
|
|
3
|
+
import i from "./Breadcrumbs.module.scss.js";
|
|
4
4
|
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
5
5
|
// src/components/Breadcrumbs/Breadcrumbs.tsx
|
|
6
6
|
function s({ href: e, current: t = !1, children: n, className: r, ...i }) {
|
|
@@ -17,33 +17,33 @@ function s({ href: e, current: t = !1, children: n, className: r, ...i }) {
|
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
19
|
s.displayName = "Breadcrumbs.Item";
|
|
20
|
-
var c =
|
|
21
|
-
let p =
|
|
20
|
+
var c = t(({ children: t, separator: s = "/", label: c = "Breadcrumb", classes: l, className: u, ...d }, f) => {
|
|
21
|
+
let p = e.toArray(t).filter(n);
|
|
22
22
|
return /* @__PURE__ */ a("nav", {
|
|
23
23
|
ref: f,
|
|
24
24
|
"aria-label": c,
|
|
25
|
-
className: i
|
|
25
|
+
className: r(i.root, l?.root, u),
|
|
26
26
|
...d,
|
|
27
27
|
children: /* @__PURE__ */ a("ol", {
|
|
28
|
-
className: i
|
|
29
|
-
children: p.map((
|
|
30
|
-
let
|
|
28
|
+
className: r(i.list, l?.list),
|
|
29
|
+
children: p.map((e, t) => {
|
|
30
|
+
let n = t === p.length - 1, { href: c, current: u, children: d, className: f } = e.props ?? {}, m = u ?? n;
|
|
31
31
|
return /* @__PURE__ */ o("li", {
|
|
32
|
-
className: i
|
|
32
|
+
className: r(i.item, l?.item, f),
|
|
33
33
|
children: [m || !c ? /* @__PURE__ */ a("span", {
|
|
34
|
-
className: i
|
|
34
|
+
className: r(i.current, l?.current),
|
|
35
35
|
"aria-current": m ? "page" : void 0,
|
|
36
36
|
children: d
|
|
37
37
|
}) : /* @__PURE__ */ a("a", {
|
|
38
|
-
className: i
|
|
38
|
+
className: r(i.link, l?.link),
|
|
39
39
|
href: c,
|
|
40
40
|
children: d
|
|
41
|
-
}), !
|
|
42
|
-
className: i
|
|
41
|
+
}), !n && /* @__PURE__ */ a("span", {
|
|
42
|
+
className: r(i.separator, l?.separator),
|
|
43
43
|
"aria-hidden": "true",
|
|
44
44
|
children: s
|
|
45
45
|
})]
|
|
46
|
-
},
|
|
46
|
+
}, e.key ?? t);
|
|
47
47
|
})
|
|
48
48
|
})
|
|
49
49
|
});
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import
|
|
3
|
-
import n from "
|
|
1
|
+
import { forwardRef as e } from "react";
|
|
2
|
+
import t from "clsx";
|
|
3
|
+
import n from "./Button.module.scss.js";
|
|
4
4
|
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
5
5
|
// src/components/Button/Button.tsx
|
|
6
6
|
var a = {
|
|
7
|
-
dots:
|
|
8
|
-
shimmer:
|
|
9
|
-
border:
|
|
10
|
-
}, o =
|
|
7
|
+
dots: n.loadingDots,
|
|
8
|
+
shimmer: n.loadingShimmer,
|
|
9
|
+
border: n.loadingBorder
|
|
10
|
+
}, o = e(({ variant: e = "primary", size: o = "md", loading: s = !1, loadingStyle: c = "dots", fullWidth: l = !1, iconOnly: u = !1, disabled: d, classes: f, className: p, style: m, children: h, ...g }, _) => /* @__PURE__ */ i("button", {
|
|
11
11
|
ref: _,
|
|
12
|
-
className: n
|
|
12
|
+
className: t(n.root, n[e], n[o], l && n.fullWidth, u && n.iconOnly, s && n.loading, s && a[c], f?.root, p),
|
|
13
13
|
style: m,
|
|
14
14
|
disabled: d || s,
|
|
15
15
|
"aria-busy": s || void 0,
|
|
16
16
|
...g,
|
|
17
17
|
children: [
|
|
18
|
-
/* @__PURE__ */ r("div", { className: n
|
|
18
|
+
/* @__PURE__ */ r("div", { className: t(n.shimmer, f?.shimmer) }),
|
|
19
19
|
/* @__PURE__ */ r("span", {
|
|
20
|
-
className: n
|
|
20
|
+
className: t(n.content, f?.content),
|
|
21
21
|
children: h
|
|
22
22
|
}),
|
|
23
23
|
/* @__PURE__ */ i("span", {
|
|
24
|
-
className: n
|
|
24
|
+
className: t(n.dots, f?.dots),
|
|
25
25
|
"aria-hidden": "true",
|
|
26
26
|
children: [
|
|
27
|
-
/* @__PURE__ */ r("span", { className: n
|
|
28
|
-
/* @__PURE__ */ r("span", { className: n
|
|
29
|
-
/* @__PURE__ */ r("span", { className: n
|
|
27
|
+
/* @__PURE__ */ r("span", { className: t(n.dot, f?.dot) }),
|
|
28
|
+
/* @__PURE__ */ r("span", { className: t(n.dot, f?.dot) }),
|
|
29
|
+
/* @__PURE__ */ r("span", { className: t(n.dot, f?.dot) })
|
|
30
30
|
]
|
|
31
31
|
})
|
|
32
32
|
]
|