@overdoser/react-toolkit 0.21.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.
Files changed (161) hide show
  1. package/AGENTS.md +1 -0
  2. package/CHANGELOG.md +27 -0
  3. package/components/Accordion/Accordion.js +48 -48
  4. package/components/ActionButton/ActionButton.js +23 -23
  5. package/components/ActionButton/CopyButton.js +5 -5
  6. package/components/Alert/Alert.js +13 -13
  7. package/components/Avatar/Avatar.js +12 -12
  8. package/components/Badge/Badge.js +6 -6
  9. package/components/Breadcrumbs/Breadcrumbs.js +15 -15
  10. package/components/Button/Button.js +14 -14
  11. package/components/Card/Card.js +26 -26
  12. package/components/Chart/AreaChart.js +103 -103
  13. package/components/Chart/Axis.js +7 -7
  14. package/components/Chart/BarChart.js +62 -62
  15. package/components/Chart/ChartContainer.js +11 -11
  16. package/components/Chart/ChartLegend.js +7 -7
  17. package/components/Chart/ChartTooltip.js +13 -13
  18. package/components/Chart/LineChart.js +88 -88
  19. package/components/Chart/PieChart.js +25 -25
  20. package/components/Chart/RadarChart.js +42 -42
  21. package/components/Chart/Sparkline.js +11 -11
  22. package/components/Chart/TradingChart.js +126 -126
  23. package/components/Chart/trading/period.js +3 -3
  24. package/components/Chip/Chip.js +24 -24
  25. package/components/CodeBlock/CodeBlock.js +31 -31
  26. package/components/CommandPalette/CommandPalette.js +166 -166
  27. package/components/ConfirmDialog/ConfirmDialog.js +60 -60
  28. package/components/Divider/Divider.js +10 -10
  29. package/components/Draggable/Draggable.js +29 -29
  30. package/components/Drawer/Drawer.js +53 -53
  31. package/components/Dropdown/Dropdown.js +66 -66
  32. package/components/Dropdown/DropdownItem.js +13 -13
  33. package/components/Dropdown/DropdownLabel.js +5 -5
  34. package/components/Dropdown/DropdownSeparator.js +5 -5
  35. package/components/Dropzone/Dropzone.js +15 -15
  36. package/components/EmptyState/EmptyState.js +11 -11
  37. package/components/Form/Form.js +17 -17
  38. package/components/Form/FormField.js +21 -21
  39. package/components/Form/FormRow.js +3 -3
  40. package/components/ImageViewer/ImageViewer.js +118 -118
  41. package/components/Kbd/Kbd.js +11 -11
  42. package/components/KeyValueList/KeyValueList.js +32 -32
  43. package/components/Link/Link.js +7 -7
  44. package/components/List/List.js +7 -7
  45. package/components/Loader/Loader.js +39 -39
  46. package/components/Modal/Modal.js +48 -48
  47. package/components/PageHeader/PageHeader.js +18 -18
  48. package/components/Pagination/Pagination.js +23 -23
  49. package/components/Popover/Popover.js +25 -25
  50. package/components/ProgressBar/ProgressBar.js +17 -17
  51. package/components/RelativeTime/RelativeTime.js +10 -10
  52. package/components/SegmentedControl/SegmentedControl.js +38 -38
  53. package/components/Skeleton/Skeleton.js +10 -10
  54. package/components/Spinner/Spinner.js +7 -7
  55. package/components/SplitButton/SplitButton.js +63 -63
  56. package/components/SplitPane/SplitPane.js +50 -50
  57. package/components/StatCard/StatCard.js +32 -32
  58. package/components/StatusDot/StatusDot.js +7 -7
  59. package/components/Table/Table.js +174 -174
  60. package/components/Tabs/Tabs.js +47 -47
  61. package/components/ThemeToggle/ThemeToggle.js +31 -31
  62. package/components/Timeline/GanttTimeline.js +213 -213
  63. package/components/Timeline/HistoryTimeline.js +306 -306
  64. package/components/Timeline/TimelineShared.js +103 -103
  65. package/components/Timeline/TraceEventDetails.js +103 -103
  66. package/components/Timeline/TraceTimeline.js +546 -546
  67. package/components/Timeline/historyLayout.js +2 -2
  68. package/components/Timer/Timer.js +39 -39
  69. package/components/Toast/Toast.js +59 -59
  70. package/components/ToggleIconButton/ToggleIconButton.js +9 -9
  71. package/components/Tooltip/Tooltip.js +16 -16
  72. package/components/Typography/Typography.js +5 -5
  73. package/components/inputs/Checkbox/Checkbox.js +11 -11
  74. package/components/inputs/Checkbox/CheckboxGroup.js +21 -21
  75. package/components/inputs/DatePicker/CalendarPanel.js +113 -113
  76. package/components/inputs/DatePicker/DatePicker.js +39 -39
  77. package/components/inputs/DateTimePicker/DateTimePicker.js +119 -119
  78. package/components/inputs/DateTimePicker/DateTimeSegments.js +40 -40
  79. package/components/inputs/DateTimePicker/TimeField.js +34 -34
  80. package/components/inputs/Input/Input.js +13 -13
  81. package/components/inputs/NumberInput/NumberInput.js +16 -16
  82. package/components/inputs/Radio/Radio.js +17 -17
  83. package/components/inputs/SearchInput/SearchInput.js +25 -25
  84. package/components/inputs/Select/Select.d.ts +55 -3
  85. package/components/inputs/Select/Select.js +485 -344
  86. package/components/inputs/Select/{Select.module.js → Select.module.scss.js} +15 -3
  87. package/components/inputs/Slider/Slider.js +21 -21
  88. package/components/inputs/Switch/Switch.js +4 -4
  89. package/components/inputs/Textarea/Textarea.js +8 -8
  90. package/hooks/usePortalPosition.d.ts +2 -1
  91. package/hooks/usePortalPosition.js +6 -3
  92. package/hooks/useResizable.js +1 -1
  93. package/hooks/useTheme.js +7 -7
  94. package/index.css +1 -1
  95. package/index.js +1 -1
  96. package/index.layered.css +1 -1
  97. package/llms.txt +25 -4
  98. package/manifest.json +33 -4
  99. package/package.json +1 -1
  100. /package/components/Accordion/{Accordion.module.js → Accordion.module.scss.js} +0 -0
  101. /package/components/ActionButton/{ActionButton.module.js → ActionButton.module.scss.js} +0 -0
  102. /package/components/Alert/{Alert.module.js → Alert.module.scss.js} +0 -0
  103. /package/components/Avatar/{Avatar.module.js → Avatar.module.scss.js} +0 -0
  104. /package/components/Badge/{Badge.module.js → Badge.module.scss.js} +0 -0
  105. /package/components/Breadcrumbs/{Breadcrumbs.module.js → Breadcrumbs.module.scss.js} +0 -0
  106. /package/components/Button/{Button.module.js → Button.module.scss.js} +0 -0
  107. /package/components/Card/{Card.module.js → Card.module.scss.js} +0 -0
  108. /package/components/Chart/{Chart.module.js → Chart.module.scss.js} +0 -0
  109. /package/components/Chip/{Chip.module.js → Chip.module.scss.js} +0 -0
  110. /package/components/CodeBlock/{CodeBlock.module.js → CodeBlock.module.scss.js} +0 -0
  111. /package/components/CommandPalette/{CommandPalette.module.js → CommandPalette.module.scss.js} +0 -0
  112. /package/components/ConfirmDialog/{ConfirmDialog.module.js → ConfirmDialog.module.scss.js} +0 -0
  113. /package/components/Divider/{Divider.module.js → Divider.module.scss.js} +0 -0
  114. /package/components/Draggable/{Draggable.module.js → Draggable.module.scss.js} +0 -0
  115. /package/components/Drawer/{Drawer.module.js → Drawer.module.scss.js} +0 -0
  116. /package/components/Dropdown/{Dropdown.module.js → Dropdown.module.scss.js} +0 -0
  117. /package/components/Dropzone/{Dropzone.module.js → Dropzone.module.scss.js} +0 -0
  118. /package/components/EmptyState/{EmptyState.module.js → EmptyState.module.scss.js} +0 -0
  119. /package/components/Form/{Form.module.js → Form.module.scss.js} +0 -0
  120. /package/components/ImageViewer/{ImageViewer.module.js → ImageViewer.module.scss.js} +0 -0
  121. /package/components/Kbd/{Kbd.module.js → Kbd.module.scss.js} +0 -0
  122. /package/components/KeyValueList/{KeyValueList.module.js → KeyValueList.module.scss.js} +0 -0
  123. /package/components/Link/{Link.module.js → Link.module.scss.js} +0 -0
  124. /package/components/List/{List.module.js → List.module.scss.js} +0 -0
  125. /package/components/Loader/{Loader.module.js → Loader.module.scss.js} +0 -0
  126. /package/components/Modal/{Modal.module.js → Modal.module.scss.js} +0 -0
  127. /package/components/PageHeader/{PageHeader.module.js → PageHeader.module.scss.js} +0 -0
  128. /package/components/Pagination/{Pagination.module.js → Pagination.module.scss.js} +0 -0
  129. /package/components/Popover/{Popover.module.js → Popover.module.scss.js} +0 -0
  130. /package/components/ProgressBar/{ProgressBar.module.js → ProgressBar.module.scss.js} +0 -0
  131. /package/components/RelativeTime/{RelativeTime.module.js → RelativeTime.module.scss.js} +0 -0
  132. /package/components/SegmentedControl/{SegmentedControl.module.js → SegmentedControl.module.scss.js} +0 -0
  133. /package/components/Skeleton/{Skeleton.module.js → Skeleton.module.scss.js} +0 -0
  134. /package/components/Spinner/{Spinner.module.js → Spinner.module.scss.js} +0 -0
  135. /package/components/SplitButton/{SplitButton.module.js → SplitButton.module.scss.js} +0 -0
  136. /package/components/SplitPane/{SplitPane.module.js → SplitPane.module.scss.js} +0 -0
  137. /package/components/StatCard/{StatCard.module.js → StatCard.module.scss.js} +0 -0
  138. /package/components/StatusDot/{StatusDot.module.js → StatusDot.module.scss.js} +0 -0
  139. /package/components/Table/{Table.module.js → Table.module.scss.js} +0 -0
  140. /package/components/Tabs/{Tabs.module.js → Tabs.module.scss.js} +0 -0
  141. /package/components/ThemeToggle/{ThemeToggle.module.js → ThemeToggle.module.scss.js} +0 -0
  142. /package/components/Timeline/{GanttTimeline.module.js → GanttTimeline.module.scss.js} +0 -0
  143. /package/components/Timeline/{HistoryTimeline.module.js → HistoryTimeline.module.scss.js} +0 -0
  144. /package/components/Timeline/{Timeline.module.js → Timeline.module.scss.js} +0 -0
  145. /package/components/Timeline/{TraceTimeline.module.js → TraceTimeline.module.scss.js} +0 -0
  146. /package/components/Timer/{Timer.module.js → Timer.module.scss.js} +0 -0
  147. /package/components/Toast/{Toast.module.js → Toast.module.scss.js} +0 -0
  148. /package/components/ToggleIconButton/{ToggleIconButton.module.js → ToggleIconButton.module.scss.js} +0 -0
  149. /package/components/Tooltip/{Tooltip.module.js → Tooltip.module.scss.js} +0 -0
  150. /package/components/Typography/{Typography.module.js → Typography.module.scss.js} +0 -0
  151. /package/components/inputs/Checkbox/{Checkbox.module.js → Checkbox.module.scss.js} +0 -0
  152. /package/components/inputs/Checkbox/{CheckboxGroup.module.js → CheckboxGroup.module.scss.js} +0 -0
  153. /package/components/inputs/DatePicker/{CalendarPanel.module.js → CalendarPanel.module.scss.js} +0 -0
  154. /package/components/inputs/DatePicker/{DatePicker.module.js → DatePicker.module.scss.js} +0 -0
  155. /package/components/inputs/DateTimePicker/{DateTimePicker.module.js → DateTimePicker.module.scss.js} +0 -0
  156. /package/components/inputs/Input/{Input.module.js → Input.module.scss.js} +0 -0
  157. /package/components/inputs/NumberInput/{NumberInput.module.js → NumberInput.module.scss.js} +0 -0
  158. /package/components/inputs/Radio/{Radio.module.js → Radio.module.scss.js} +0 -0
  159. /package/components/inputs/SearchInput/{SearchInput.module.js → SearchInput.module.scss.js} +0 -0
  160. /package/components/inputs/Slider/{Slider.module.js → Slider.module.scss.js} +0 -0
  161. /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,33 @@ 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.0]
8
+
9
+ ### Added
10
+
11
+ - **`Select` checklist mode.** `multiple checklist` is the AWS CloudWatch
12
+ log-group picker, for picking many values while filtering: the search box
13
+ moves into the menu, every row gets a checkbox, and selected options stay
14
+ listed when they don't match the query, in their `options` order. A row
15
+ unchecked while filtered stays put until the query changes, so nothing
16
+ jumps under the pointer. The header offers "Select all matching" and
17
+ "Deselect all" (`selectAllLabel`, `deselectAllLabel`). The menu stays open
18
+ while picking (`closeOnSelect` and `clearSearchOnSelect` default to
19
+ `false`) and closes on outside click, Escape or Tab. Chips show the plain
20
+ `label`, so a rich two-line `content` row stays in the menu.
21
+ - **`Select` `maxVisibleChips`.** Any multi mode can cap the chips in the
22
+ control; the rest collapse into a "+N more" chip whose tooltip lists them
23
+ (`moreChipsLabel` customises its text).
24
+
25
+ ### Fixed
26
+
27
+ - **Portaled menus** (`Select`, and everything else on `usePortalPosition`)
28
+ follow the trigger when it grows while open, instead of covering the new
29
+ chip rows, and no longer re-render on scrolls that move nothing.
30
+ - **`Select`** — option ids are scoped per instance, so two Selects with the
31
+ same values no longer share ids, and values containing spaces give valid
32
+ `aria-activedescendant` targets.
33
+
7
34
  ## [0.21.0]
8
35
 
9
36
  ### Added
@@ -1,38 +1,38 @@
1
- import e from "./Accordion.module.js";
2
- import { createContext as t, forwardRef as n, useCallback as r, useContext as i, useId as a, useRef as o, useState as s } from "react";
3
- import c from "clsx";
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 = t(null), f = t(null);
6
+ var d = e(null), f = e(null);
7
7
  function p(e) {
8
- let t = i(d);
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 = i(f);
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 = n(({ type: t = "single", value: n, defaultValue: i, 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 = a(), j = o(null), M = n !== void 0, [N, P] = s(() => h(i)), F = M ? h(n) : N, I = r((e) => {
22
- let n = F.includes(e), r;
23
- if (t === "multiple") r = n ? F.filter((t) => t !== e) : [...F, e];
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 = [e];
28
- M || P(r), f?.(t === "multiple" ? r : r[0] ?? "");
27
+ } else r = [t];
28
+ M || P(r), f?.(e === "multiple" ? r : r[0] ?? "");
29
29
  }, [
30
30
  F,
31
- t,
31
+ e,
32
32
  p,
33
33
  M,
34
34
  f
35
- ]), L = r((e) => {
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(e.root, e[g], e[v], w?.root, T),
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 _ = n(({ value: t, disabled: n = !1, className: r, children: i, ...a }, o) => {
74
- let s = p("Accordion.Item"), u = s.openValues.includes(t), d = n || s.disabled, m = `${s.baseId}-${t}`, h = {
75
- value: t,
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: o,
84
+ ref: a,
85
85
  "data-state": u ? "open" : "closed",
86
86
  "data-disabled": d || void 0,
87
- className: c(e.item, u && e.itemOpen, d && e.itemDisabled, s.classes?.item, u && s.classes?.itemOpen, r),
88
- ...a,
89
- children: i
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 = n(({ icon: t = v, iconPosition: n = "end", className: r, children: i, onClick: a, ...o }, s) => {
108
- let d = p("Accordion.Trigger"), f = m("Accordion.Trigger"), h = `h${d.headingLevel}`, g = t === !1 ? null : /* @__PURE__ */ l("span", {
109
- className: c(e.icon, d.classes?.icon),
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: t
111
+ children: e
112
112
  });
113
113
  return /* @__PURE__ */ l(h, {
114
- className: c(e.header, d.classes?.header),
114
+ className: s(c.header, d.classes?.header),
115
115
  children: /* @__PURE__ */ u("button", {
116
- ref: s,
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(e.trigger, n === "start" && e.iconStart, d.classes?.trigger, r),
123
+ className: s(c.trigger, t === "start" && c.iconStart, d.classes?.trigger, n),
124
124
  onClick: (e) => {
125
- a?.(e), e.defaultPrevented || d.toggle(f.value);
125
+ i?.(e), e.defaultPrevented || d.toggle(f.value);
126
126
  },
127
- ...o,
127
+ ...a,
128
128
  children: [
129
- n === "start" && g,
129
+ t === "start" && g,
130
130
  /* @__PURE__ */ l("span", {
131
- className: e.triggerLabel,
132
- children: i
131
+ className: c.triggerLabel,
132
+ children: r
133
133
  }),
134
- n === "end" && g
134
+ t === "end" && g
135
135
  ]
136
136
  })
137
137
  });
138
138
  });
139
139
  y.displayName = "Accordion.Trigger";
140
- var b = n(({ className: t, children: n, ...r }, i) => {
141
- let a = p("Accordion.Content"), o = m("Accordion.Content");
142
- return !o.open && !a.keepMounted ? null : /* @__PURE__ */ l("div", {
143
- ref: i,
144
- id: o.contentId,
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": o.triggerId,
147
- hidden: !o.open,
148
- "data-state": o.open ? "open" : "closed",
149
- className: c(e.content, a.classes?.content, t),
150
- ...r,
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: e.contentClip,
152
+ className: c.contentClip,
153
153
  children: /* @__PURE__ */ l("div", {
154
- className: c(e.contentInner, a.classes?.contentInner),
155
- children: n
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 "./ActionButton.module.js";
2
- import { forwardRef as t, useEffect as n, useRef as r, useState as i } from "react";
3
- import a from "clsx";
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 = t(({ icon: t, 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] = i("idle"), [F, I] = i(null), L = r("idle"), R = r(!0), z = r({});
35
- n(() => {
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: t,
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((t) => ({
114
- ...t,
115
- position: t.visible ? void 0 : X[t.key] < X[N] ? e.labelAbove : e.labelBelow
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(e.root, e[C], e[w], T && e.iconOnly, E?.root, D),
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(e.progressFill, K && e.progressFillActive, E?.progressFill),
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(e.iconStack, E?.iconStack),
137
+ className: i(a.iconStack, E?.iconStack),
138
138
  "aria-hidden": "true",
139
- children: q.map((t) => /* @__PURE__ */ o("span", {
140
- className: a(e.iconLayer, t.visible && e.layerVisible, t.visible && t.spin && e.iconSpin, E?.iconLayer),
141
- children: t.node
142
- }, t.key))
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(e.labelStack, E?.labelStack),
145
+ className: i(a.labelStack, E?.labelStack),
146
146
  "aria-live": K ? "off" : "polite",
147
- children: Z.map((t) => /* @__PURE__ */ o("span", {
148
- "aria-hidden": !t.visible || void 0,
149
- className: a(e.labelLayer, t.visible && e.layerVisible, t.position, E?.labelLayer),
150
- children: t.node
151
- }, t.key))
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 { ActionButton as e } from "./ActionButton.js";
2
- import { forwardRef as t } from "react";
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 = t(({ value: t, icon: r = /* @__PURE__ */ n(i, {}), label: o = "Copy", successLabel: s = "Copied", onCopied: c, style: l, ...u }, d) => /* @__PURE__ */ n(e, {
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 e = typeof t == "function" ? await t() : t;
45
- await a(e), c?.(e);
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 "./Alert.module.js";
2
- import { forwardRef as t } from "react";
3
- import n from "clsx";
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 = t(({ variant: t = "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[t] : s === !1 ? null : s, y = u == null ? null : /* @__PURE__ */ r("div", {
49
- className: n(e.action, p?.action),
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(e.root, e[t], d === "banner" && e.banner, f === "sm" && e.sm, p?.root, m),
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(e.icon, p?.icon),
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(e.content, p?.content),
64
+ className: t(n.content, p?.content),
65
65
  children: [/* @__PURE__ */ i("div", {
66
- className: e.text,
66
+ className: n.text,
67
67
  children: [o != null && /* @__PURE__ */ r("div", {
68
- className: n(e.title, p?.title),
68
+ className: t(n.title, p?.title),
69
69
  children: o
70
70
  }), h != null && /* @__PURE__ */ r("div", {
71
- className: n(e.message, p?.message),
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(e.close, p?.close),
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 "./Avatar.module.js";
2
- import { forwardRef as t, useEffect as n, useState as r } from "react";
3
- import i from "clsx";
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 = t(({ src: t, alt: c, name: u, fallback: d, size: f = "md", shape: p = "circle", status: m, classes: h, className: g, ..._ }, v) => {
11
- let [y, b] = r(!1);
12
- n(() => b(!1), [t]);
13
- let x = t && !y, S = u ? s(u) : "";
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(e.root, e[f], e[p], h?.root, g),
16
+ className: r(i.root, i[f], i[p], h?.root, g),
17
17
  ..._,
18
18
  children: [x ? /* @__PURE__ */ a("img", {
19
- className: i(e.image, h?.image),
20
- src: t,
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(e.fallback, h?.fallback),
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(e.status, e[`status_${m}`], h?.status),
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 "./Badge.module.js";
2
- import { forwardRef as t } from "react";
3
- import n from "clsx";
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 = t(({ variant: t = "neutral", appearance: a = "soft", size: o = "md", dot: s = !1, classes: c, className: l, children: u, ...d }, f) => /* @__PURE__ */ i("span", {
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(e.root, e[t], e[a], e[o], c?.root, l),
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(e.dot, c?.dot),
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 "./Breadcrumbs.module.js";
2
- import { Children as t, forwardRef as n, isValidElement as r } from "react";
3
- import i from "clsx";
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 = n(({ children: n, separator: s = "/", label: c = "Breadcrumb", classes: l, className: u, ...d }, f) => {
21
- let p = t.toArray(n).filter(r);
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(e.root, l?.root, u),
25
+ className: r(i.root, l?.root, u),
26
26
  ...d,
27
27
  children: /* @__PURE__ */ a("ol", {
28
- className: i(e.list, l?.list),
29
- children: p.map((t, n) => {
30
- let r = n === p.length - 1, { href: c, current: u, children: d, className: f } = t.props ?? {}, m = u ?? r;
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(e.item, l?.item, f),
32
+ className: r(i.item, l?.item, f),
33
33
  children: [m || !c ? /* @__PURE__ */ a("span", {
34
- className: i(e.current, l?.current),
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(e.link, l?.link),
38
+ className: r(i.link, l?.link),
39
39
  href: c,
40
40
  children: d
41
- }), !r && /* @__PURE__ */ a("span", {
42
- className: i(e.separator, l?.separator),
41
+ }), !n && /* @__PURE__ */ a("span", {
42
+ className: r(i.separator, l?.separator),
43
43
  "aria-hidden": "true",
44
44
  children: s
45
45
  })]
46
- }, t.key ?? n);
46
+ }, e.key ?? t);
47
47
  })
48
48
  })
49
49
  });
@@ -1,32 +1,32 @@
1
- import e from "./Button.module.js";
2
- import { forwardRef as t } from "react";
3
- import n from "clsx";
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: e.loadingDots,
8
- shimmer: e.loadingShimmer,
9
- border: e.loadingBorder
10
- }, o = t(({ variant: t = "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", {
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(e.root, e[t], e[o], l && e.fullWidth, u && e.iconOnly, s && e.loading, s && a[c], f?.root, p),
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(e.shimmer, f?.shimmer) }),
18
+ /* @__PURE__ */ r("div", { className: t(n.shimmer, f?.shimmer) }),
19
19
  /* @__PURE__ */ r("span", {
20
- className: n(e.content, f?.content),
20
+ className: t(n.content, f?.content),
21
21
  children: h
22
22
  }),
23
23
  /* @__PURE__ */ i("span", {
24
- className: n(e.dots, f?.dots),
24
+ className: t(n.dots, f?.dots),
25
25
  "aria-hidden": "true",
26
26
  children: [
27
- /* @__PURE__ */ r("span", { className: n(e.dot, f?.dot) }),
28
- /* @__PURE__ */ r("span", { className: n(e.dot, f?.dot) }),
29
- /* @__PURE__ */ r("span", { className: n(e.dot, f?.dot) })
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
  ]