@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.
Files changed (161) hide show
  1. package/AGENTS.md +1 -0
  2. package/CHANGELOG.md +35 -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
@@ -1,22 +1,22 @@
1
- import e from "./RelativeTime.module.js";
2
- import { useNow as t } from "../../hooks/useNow.js";
3
- import { refreshIntervalFor as n, timeAgo as r, toTimestamp as i } from "../../utils/timeAgo.js";
4
- import { forwardRef as a, useMemo as o } from "react";
5
- import s from "clsx";
1
+ import { forwardRef as e, useMemo as t } from "react";
2
+ import n from "clsx";
3
+ import r from "./RelativeTime.module.scss.js";
4
+ import { useNow as i } from "../../hooks/useNow.js";
5
+ import { refreshIntervalFor as a, timeAgo as o, toTimestamp as s } from "../../utils/timeAgo.js";
6
6
  import { jsx as c } from "react/jsx-runtime";
7
7
  // src/components/RelativeTime/RelativeTime.tsx
8
8
  var l = {
9
9
  dateStyle: "medium",
10
10
  timeStyle: "short"
11
- }, u = a(({ value: a, format: u = "long", numeric: d = "auto", locale: f, live: p = !0, now: m, maxAge: h, absoluteFormat: g = l, title: _ = !0, fallback: v = "—", classes: y, className: b, ...x }, S) => {
12
- let C = o(() => i(a), [a]), w = Number.isFinite(C), T = C - (m ?? Date.now()), E = n(T), D = t(E, p && m === void 0 && w), O = m ?? D;
11
+ }, u = e(({ value: e, format: u = "long", numeric: d = "auto", locale: f, live: p = !0, now: m, maxAge: h, absoluteFormat: g = l, title: _ = !0, fallback: v = "—", classes: y, className: b, ...x }, S) => {
12
+ let C = t(() => s(e), [e]), w = Number.isFinite(C), T = C - (m ?? Date.now()), E = a(T), D = i(E, p && m === void 0 && w), O = m ?? D;
13
13
  if (!w) return /* @__PURE__ */ c("time", {
14
14
  ref: S,
15
- className: s(e.root, y?.root, b),
15
+ className: n(r.root, y?.root, b),
16
16
  ...x,
17
17
  children: v
18
18
  });
19
- let k = new Date(C).toISOString(), A = new Intl.DateTimeFormat(f, g).format(C), j = r(C, {
19
+ let k = new Date(C).toISOString(), A = new Intl.DateTimeFormat(f, g).format(C), j = o(C, {
20
20
  now: O,
21
21
  locale: f,
22
22
  format: u,
@@ -27,7 +27,7 @@ var l = {
27
27
  ref: S,
28
28
  dateTime: k,
29
29
  title: _ === !1 ? void 0 : _ === !0 ? A : _,
30
- className: s(e.root, y?.root, b),
30
+ className: n(r.root, y?.root, b),
31
31
  ...x,
32
32
  children: j ?? A
33
33
  });
@@ -1,17 +1,17 @@
1
- import e from "./SegmentedControl.module.js";
2
- import { Tooltip as t } from "../Tooltip/Tooltip.js";
3
- import { forwardRef as n, useCallback as r, useRef as i, useState as a } from "react";
4
- import o from "clsx";
1
+ import { forwardRef as e, useCallback as t, useRef as n, useState as r } from "react";
2
+ import i from "clsx";
3
+ import a from "./SegmentedControl.module.scss.js";
4
+ import { Tooltip as o } from "../Tooltip/Tooltip.js";
5
5
  import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
6
6
  // src/components/SegmentedControl/SegmentedControl.tsx
7
- function u({ options: n, value: u, defaultValue: d, onChange: f, size: p = "md", shape: m = "rounded", variant: h = "filled", fullWidth: g = !1, disabled: _ = !1, classes: v, className: y, style: b, id: x, "aria-label": S, "aria-labelledby": C }, w) {
8
- let T = u !== void 0, [E, D] = a(d), O = T ? u : E, k = i(/* @__PURE__ */ new Map()), A = n.some((e) => e.href !== void 0), j = r((e) => {
7
+ function u({ options: e, value: u, defaultValue: d, onChange: f, size: p = "md", shape: m = "rounded", variant: h = "filled", fullWidth: g = !1, disabled: _ = !1, classes: v, className: y, style: b, id: x, "aria-label": S, "aria-labelledby": C }, w) {
8
+ let T = u !== void 0, [E, D] = r(d), O = T ? u : E, k = n(/* @__PURE__ */ new Map()), A = e.some((e) => e.href !== void 0), j = t((e) => {
9
9
  T || D(e), e !== O && f?.(e);
10
10
  }, [
11
11
  T,
12
12
  O,
13
13
  f
14
- ]), M = n.filter((e) => !(_ || e.disabled)), N = (e) => {
14
+ ]), M = e.filter((e) => !(_ || e.disabled)), N = (e) => {
15
15
  e && (j(e.value), k.current.get(e.value)?.focus());
16
16
  }, P = (e, t) => {
17
17
  if (M.length === 0) return;
@@ -38,58 +38,58 @@ function u({ options: n, value: u, defaultValue: d, onChange: f, size: p = "md",
38
38
  "aria-label": S,
39
39
  "aria-labelledby": C,
40
40
  "aria-disabled": _ || void 0,
41
- className: o(e.root, e[p], e[m], e[h], g && e.fullWidth, _ && e.disabled, v?.root, y),
41
+ className: i(a.root, a[p], a[m], a[h], g && a.fullWidth, _ && a.disabled, v?.root, y),
42
42
  style: b,
43
- children: n.map((n) => {
44
- let r = n.value === O, i = _ || !!n.disabled, a = n.icon !== void 0 && n.label === void 0, u = typeof n.tooltip == "string" ? n.tooltip : void 0, d = n["aria-label"] ?? (a ? u : void 0), f = /* @__PURE__ */ l(s, { children: [
45
- n.icon !== void 0 && /* @__PURE__ */ c("span", {
46
- className: o(e.icon, v?.icon),
43
+ children: e.map((e) => {
44
+ let t = e.value === O, n = _ || !!e.disabled, r = e.icon !== void 0 && e.label === void 0, u = typeof e.tooltip == "string" ? e.tooltip : void 0, d = e["aria-label"] ?? (r ? u : void 0), f = /* @__PURE__ */ l(s, { children: [
45
+ e.icon !== void 0 && /* @__PURE__ */ c("span", {
46
+ className: i(a.icon, v?.icon),
47
47
  "aria-hidden": "true",
48
- children: n.icon
48
+ children: e.icon
49
49
  }),
50
- n.label !== void 0 && /* @__PURE__ */ c("span", {
51
- className: o(e.label, v?.label),
52
- children: n.label
50
+ e.label !== void 0 && /* @__PURE__ */ c("span", {
51
+ className: i(a.label, v?.label),
52
+ children: e.label
53
53
  }),
54
- n.count !== void 0 && /* @__PURE__ */ c("span", {
55
- className: o(e.count, v?.count),
56
- children: n.count
54
+ e.count !== void 0 && /* @__PURE__ */ c("span", {
55
+ className: i(a.count, v?.count),
56
+ children: e.count
57
57
  })
58
- ] }), p = o(e.item, r && e.itemSelected, a && e.iconOnly, v?.item, r && v?.itemSelected), m = (e) => {
59
- e ? k.current.set(n.value, e) : k.current.delete(n.value);
58
+ ] }), p = i(a.item, t && a.itemSelected, r && a.iconOnly, v?.item, t && v?.itemSelected), m = (t) => {
59
+ t ? k.current.set(e.value, t) : k.current.delete(e.value);
60
60
  }, h;
61
61
  return h = A ? /* @__PURE__ */ c("a", {
62
62
  ref: m,
63
- href: i ? void 0 : n.href,
64
- "aria-current": r ? "page" : void 0,
65
- "aria-disabled": i || void 0,
63
+ href: n ? void 0 : e.href,
64
+ "aria-current": t ? "page" : void 0,
65
+ "aria-disabled": n || void 0,
66
66
  "aria-label": d,
67
- tabIndex: i ? -1 : n.value === F ? 0 : -1,
67
+ tabIndex: n ? -1 : e.value === F ? 0 : -1,
68
68
  className: p,
69
- onClick: (e) => {
70
- i ? e.preventDefault() : j(n.value);
69
+ onClick: (t) => {
70
+ n ? t.preventDefault() : j(e.value);
71
71
  },
72
- onKeyDown: (e) => P(e, n),
72
+ onKeyDown: (t) => P(t, e),
73
73
  children: f
74
- }, n.value) : /* @__PURE__ */ c("button", {
74
+ }, e.value) : /* @__PURE__ */ c("button", {
75
75
  ref: m,
76
76
  type: "button",
77
77
  role: "radio",
78
- "aria-checked": r,
78
+ "aria-checked": t,
79
79
  "aria-label": d,
80
- disabled: i,
81
- tabIndex: n.value === F ? 0 : -1,
80
+ disabled: n,
81
+ tabIndex: e.value === F ? 0 : -1,
82
82
  className: p,
83
- onClick: () => j(n.value),
84
- onKeyDown: (e) => P(e, n),
83
+ onClick: () => j(e.value),
84
+ onKeyDown: (t) => P(t, e),
85
85
  children: f
86
- }, n.value), n.tooltip !== void 0 && n.tooltip !== null && n.tooltip !== "" ? /* @__PURE__ */ c(t, {
87
- content: n.tooltip,
86
+ }, e.value), e.tooltip !== void 0 && e.tooltip !== null && e.tooltip !== "" ? /* @__PURE__ */ c(o, {
87
+ content: e.tooltip,
88
88
  children: h
89
- }, n.value) : h;
89
+ }, e.value) : h;
90
90
  })
91
91
  });
92
92
  }
93
- var d = n(u);
93
+ var d = e(u);
94
94
  d.displayName = "SegmentedControl";
95
95
  export { d as SegmentedControl };
@@ -1,18 +1,18 @@
1
- import e from "./Skeleton.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 "./Skeleton.module.scss.js";
4
4
  import { jsx as r } from "react/jsx-runtime";
5
5
  // src/components/Skeleton/Skeleton.tsx
6
- var i = (e) => typeof e == "number" ? `${e}px` : e, a = t(({ variant: t = "text", width: a, height: o, animation: s = "pulse", lines: c = 1, classes: l, className: u, style: d, ...f }, p) => {
7
- let m = s === "wave" ? e.wave : s === "none" ? void 0 : e.pulse;
8
- if (t === "text" && c > 1) return /* @__PURE__ */ r("div", {
6
+ var i = (e) => typeof e == "number" ? `${e}px` : e, a = e(({ variant: e = "text", width: a, height: o, animation: s = "pulse", lines: c = 1, classes: l, className: u, style: d, ...f }, p) => {
7
+ let m = s === "wave" ? n.wave : s === "none" ? void 0 : n.pulse;
8
+ if (e === "text" && c > 1) return /* @__PURE__ */ r("div", {
9
9
  ref: p,
10
10
  "aria-hidden": "true",
11
- className: n(e.stack, l?.root, u),
11
+ className: t(n.stack, l?.root, u),
12
12
  style: d,
13
13
  ...f,
14
- children: Array.from({ length: c }).map((t, s) => /* @__PURE__ */ r("span", {
15
- className: n(e.line, e.text, m, l?.line),
14
+ children: Array.from({ length: c }).map((e, s) => /* @__PURE__ */ r("span", {
15
+ className: t(n.line, n.text, m, l?.line),
16
16
  style: {
17
17
  width: s === c - 1 ? "60%" : i(a) ?? "100%",
18
18
  height: i(o)
@@ -27,7 +27,7 @@ var i = (e) => typeof e == "number" ? `${e}px` : e, a = t(({ variant: t = "text"
27
27
  return /* @__PURE__ */ r("div", {
28
28
  ref: p,
29
29
  "aria-hidden": "true",
30
- className: n(e.line, e[t], m, l?.root, u),
30
+ className: t(n.line, n[e], m, l?.root, u),
31
31
  style: h,
32
32
  ...f
33
33
  });
@@ -1,23 +1,23 @@
1
- import e from "./Spinner.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 "./Spinner.module.scss.js";
4
4
  import { jsx as r, jsxs as i } from "react/jsx-runtime";
5
5
  // src/components/Spinner/Spinner.tsx
6
- var a = t(({ size: t = "md", color: a, label: o = "Loading", classes: s, className: c, style: l, ...u }, d) => /* @__PURE__ */ i("span", {
6
+ var a = e(({ size: e = "md", color: a, label: o = "Loading", classes: s, className: c, style: l, ...u }, d) => /* @__PURE__ */ i("span", {
7
7
  ref: d,
8
8
  role: "status",
9
9
  "aria-live": "polite",
10
- className: n(e.root, e[t], s?.root, c),
10
+ className: t(n.root, n[e], s?.root, c),
11
11
  style: a ? {
12
12
  ...l,
13
13
  color: a
14
14
  } : l,
15
15
  ...u,
16
16
  children: [/* @__PURE__ */ r("span", {
17
- className: n(e.circle, s?.circle),
17
+ className: t(n.circle, s?.circle),
18
18
  "aria-hidden": "true"
19
19
  }), o ? /* @__PURE__ */ r("span", {
20
- className: n(e.label, s?.label),
20
+ className: t(n.label, s?.label),
21
21
  children: o
22
22
  }) : null]
23
23
  }));
@@ -1,26 +1,26 @@
1
- import e from "./SplitButton.module.js";
2
- import t from "../Button/Button.module.js";
3
- import { EscapeLayerProvider as n, useEscapeLayer as r } from "../../hooks/useEscapeLayer.js";
4
- import { usePortalPosition as i } from "../../hooks/usePortalPosition.js";
5
- import { forwardRef as a, useCallback as o, useEffect as s, useId as c, useRef as l, useState as u } from "react";
6
- import d from "clsx";
7
- import { jsx as f, jsxs as p } from "react/jsx-runtime";
8
- import { createPortal as m } from "react-dom";
1
+ import { forwardRef as e, useCallback as t, useEffect as n, useId as r, useRef as i, useState as a } from "react";
2
+ import { createPortal as o } from "react-dom";
3
+ import s from "clsx";
4
+ import c from "./SplitButton.module.scss.js";
5
+ import l from "../Button/Button.module.scss.js";
6
+ import { EscapeLayerProvider as u, useEscapeLayer as d } from "../../hooks/useEscapeLayer.js";
7
+ import { usePortalPosition as f } from "../../hooks/usePortalPosition.js";
8
+ import { jsx as p, jsxs as m } from "react/jsx-runtime";
9
9
  // src/components/SplitButton/SplitButton.tsx
10
- var h = a(({ actions: a, variant: h = "secondary", size: g = "md", disabled: _ = !1, align: v = "right", portal: y = !0, menuLabel: b = "More actions", maxWidth: x, className: S, style: C, id: w, onOpen: T, onClose: E, classes: D }, O) => {
11
- let [k, A] = u(!1), j = l(null), M = l(null), N = l(null), P = c();
12
- s(() => {
10
+ var h = e(({ actions: e, variant: h = "secondary", size: g = "md", disabled: _ = !1, align: v = "right", portal: y = !0, menuLabel: b = "More actions", maxWidth: x, className: S, style: C, id: w, onOpen: T, onClose: E, classes: D }, O) => {
11
+ let [k, A] = a(!1), j = i(null), M = i(null), N = i(null), P = r();
12
+ n(() => {
13
13
  k && M.current && M.current.querySelector("[role=\"menuitem\"]:not([disabled])")?.focus();
14
14
  }, [k]);
15
- let F = o(() => {
15
+ let F = t(() => {
16
16
  A(!1), E?.(), N.current?.focus();
17
- }, [E]), I = o(() => {
17
+ }, [E]), I = t(() => {
18
18
  A((e) => {
19
19
  let t = !e;
20
20
  return t ? T?.() : E?.(), t;
21
21
  });
22
22
  }, [T, E]);
23
- s(() => {
23
+ n(() => {
24
24
  if (!k) return;
25
25
  let e = (e) => {
26
26
  let t = e.target;
@@ -28,22 +28,22 @@ var h = a(({ actions: a, variant: h = "secondary", size: g = "md", disabled: _ =
28
28
  };
29
29
  return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
30
30
  }, [k, F]);
31
- let L = r(F, k), R = i(j, k && y);
32
- if (a.length === 0) return null;
33
- let [z, ...B] = a, V = B.length > 0, H = _ || z.disabled, U = d(t.root, t[h], t[g]), W = h === "secondary" ? e.overlapOutline : h === "ghost" ? e.dividerSubtle : e.dividerOnFill, G = d(U, e.main, V && e.mainAttached, V && k && e.mainOpen, D?.main), K = (e) => x !== void 0 && (typeof e == "string" || typeof e == "number") ? String(e) : void 0, q = /* @__PURE__ */ p("span", {
34
- className: e.mainContent,
35
- children: [/* @__PURE__ */ f("span", {
36
- className: e.mainLabel,
31
+ let L = d(F, k), R = f(j, k && y);
32
+ if (e.length === 0) return null;
33
+ let [z, ...B] = e, V = B.length > 0, H = _ || z.disabled, U = s(l.root, l[h], l[g]), W = h === "secondary" ? c.overlapOutline : h === "ghost" ? c.dividerSubtle : c.dividerOnFill, G = s(U, c.main, V && c.mainAttached, V && k && c.mainOpen, D?.main), K = (e) => x !== void 0 && (typeof e == "string" || typeof e == "number") ? String(e) : void 0, q = /* @__PURE__ */ m("span", {
34
+ className: c.mainContent,
35
+ children: [/* @__PURE__ */ p("span", {
36
+ className: c.mainLabel,
37
37
  children: z.label
38
- }), V && /* @__PURE__ */ f("span", {
39
- className: e.sizer,
38
+ }), V && /* @__PURE__ */ p("span", {
39
+ className: c.sizer,
40
40
  "aria-hidden": "true",
41
- children: a.map((t, n) => /* @__PURE__ */ f("span", {
42
- className: e.sizerItem,
43
- children: t.label
44
- }, n))
41
+ children: e.map((e, t) => /* @__PURE__ */ p("span", {
42
+ className: c.sizerItem,
43
+ children: e.label
44
+ }, t))
45
45
  })]
46
- }), J = z.href && !H ? /* @__PURE__ */ f("a", {
46
+ }), J = z.href && !H ? /* @__PURE__ */ p("a", {
47
47
  id: w,
48
48
  className: G,
49
49
  href: z.href,
@@ -52,7 +52,7 @@ var h = a(({ actions: a, variant: h = "secondary", size: g = "md", disabled: _ =
52
52
  title: K(z.label),
53
53
  onClick: z.onClick,
54
54
  children: q
55
- }) : /* @__PURE__ */ f("button", {
55
+ }) : /* @__PURE__ */ p("button", {
56
56
  id: w,
57
57
  type: "button",
58
58
  className: G,
@@ -60,69 +60,69 @@ var h = a(({ actions: a, variant: h = "secondary", size: g = "md", disabled: _ =
60
60
  title: K(z.label),
61
61
  onClick: z.onClick,
62
62
  children: q
63
- }), Y = B.map((t, n) => {
64
- let r = d(e.item, t.disabled && e.itemDisabled, t.danger && e.itemDanger, D?.item), i = (e) => {
65
- t.onClick?.(e), F();
63
+ }), Y = B.map((e, t) => {
64
+ let n = s(c.item, e.disabled && c.itemDisabled, e.danger && c.itemDanger, D?.item), r = (t) => {
65
+ e.onClick?.(t), F();
66
66
  };
67
- return t.href && !t.disabled ? /* @__PURE__ */ f("a", {
67
+ return e.href && !e.disabled ? /* @__PURE__ */ p("a", {
68
68
  role: "menuitem",
69
- className: r,
70
- href: t.href,
71
- target: t.target,
72
- rel: t.target === "_blank" ? "noopener noreferrer" : void 0,
73
- title: K(t.label),
74
- onClick: i,
75
- children: t.label
76
- }, n) : /* @__PURE__ */ f("button", {
69
+ className: n,
70
+ href: e.href,
71
+ target: e.target,
72
+ rel: e.target === "_blank" ? "noopener noreferrer" : void 0,
73
+ title: K(e.label),
74
+ onClick: r,
75
+ children: e.label
76
+ }, t) : /* @__PURE__ */ p("button", {
77
77
  type: "button",
78
78
  role: "menuitem",
79
- className: r,
80
- disabled: t.disabled,
81
- title: K(t.label),
82
- onClick: i,
83
- children: t.label
84
- }, n);
79
+ className: n,
80
+ disabled: e.disabled,
81
+ title: K(e.label),
82
+ onClick: r,
83
+ children: e.label
84
+ }, t);
85
85
  }), X = {
86
- sm: e.menuSm,
87
- md: e.menuMd,
88
- lg: e.menuLg
89
- }[g], Z = (t) => /* @__PURE__ */ f("div", {
86
+ sm: c.menuSm,
87
+ md: c.menuMd,
88
+ lg: c.menuLg
89
+ }[g], Z = (e) => /* @__PURE__ */ p("div", {
90
90
  ref: M,
91
91
  id: P,
92
- className: d(e.menu, X, k && e.menuOpen, v === "left" ? e.alignLeft : e.alignRight, D?.menu),
93
- style: t,
92
+ className: s(c.menu, X, k && c.menuOpen, v === "left" ? c.alignLeft : c.alignRight, D?.menu),
93
+ style: e,
94
94
  role: "menu",
95
- children: /* @__PURE__ */ f(n, {
95
+ children: /* @__PURE__ */ p(u, {
96
96
  value: L,
97
97
  children: Y
98
98
  })
99
99
  });
100
- return /* @__PURE__ */ p("div", {
100
+ return /* @__PURE__ */ m("div", {
101
101
  ref: O,
102
- className: d(e.root, D?.root, S),
102
+ className: s(c.root, D?.root, S),
103
103
  style: x === void 0 ? C : {
104
104
  maxWidth: x,
105
105
  ...C
106
106
  },
107
107
  children: [
108
- /* @__PURE__ */ p("div", {
108
+ /* @__PURE__ */ m("div", {
109
109
  ref: j,
110
- className: d(e.group, D?.group),
111
- children: [J, V && /* @__PURE__ */ f("button", {
110
+ className: s(c.group, D?.group),
111
+ children: [J, V && /* @__PURE__ */ p("button", {
112
112
  ref: N,
113
113
  type: "button",
114
- className: d(U, t.iconOnly, e.toggle, k && e.toggleOpen, W, D?.toggle),
114
+ className: s(U, l.iconOnly, c.toggle, k && c.toggleOpen, W, D?.toggle),
115
115
  disabled: _,
116
116
  onClick: I,
117
117
  "aria-haspopup": "menu",
118
118
  "aria-expanded": k,
119
119
  "aria-controls": k ? P : void 0,
120
120
  "aria-label": b,
121
- children: /* @__PURE__ */ f("svg", {
122
- className: d(e.chevron, k && e.chevronOpen, D?.chevron),
121
+ children: /* @__PURE__ */ p("svg", {
122
+ className: s(c.chevron, k && c.chevronOpen, D?.chevron),
123
123
  viewBox: "0 0 10 6",
124
124
  "aria-hidden": "true",
125
- children: /* @__PURE__ */ f("path", {
125
+ children: /* @__PURE__ */ p("path", {
126
126
  d: "M1 1l4 4 4-4",
127
127
  fill: "none",
128
128
  stroke: "currentColor",
@@ -134,7 +134,7 @@ var h = a(({ actions: a, variant: h = "secondary", size: g = "md", disabled: _ =
134
134
  })]
135
135
  }),
136
136
  V && !y && Z(),
137
- V && y && k && typeof document < "u" && m(Z({
137
+ V && y && k && typeof document < "u" && o(Z({
138
138
  position: "fixed",
139
139
  top: R.top,
140
140
  left: v === "right" ? void 0 : R.left,
@@ -1,11 +1,11 @@
1
- import e from "./SplitPane.module.js";
2
- import { useResizable as t } from "../../hooks/useResizable.js";
3
- import { usePersistedState as n } from "../../hooks/usePersistedState.js";
4
- import { forwardRef as r, useCallback as i, useEffect as ee, useImperativeHandle as te, useLayoutEffect as a, useMemo as ne, useRef as o, useState as s } from "react";
5
- import c from "clsx";
6
- import { jsx as l, jsxs as re } from "react/jsx-runtime";
1
+ import { forwardRef as e, useCallback as t, useEffect as n, useImperativeHandle as r, useLayoutEffect as i, useMemo as ee, useRef as a, useState as o } from "react";
2
+ import s from "clsx";
3
+ import c from "./SplitPane.module.scss.js";
4
+ import { useResizable as l } from "../../hooks/useResizable.js";
5
+ import { usePersistedState as u } from "../../hooks/usePersistedState.js";
6
+ import { jsx as d, jsxs as te } from "react/jsx-runtime";
7
7
  // src/components/SplitPane/SplitPane.tsx
8
- function u(e, t) {
8
+ function f(e, t) {
9
9
  if (e === void 0) return {
10
10
  px: null,
11
11
  ratio: null
@@ -28,11 +28,11 @@ function u(e, t) {
28
28
  ratio: null
29
29
  };
30
30
  }
31
- var d = "__crk-splitpane-unpersisted__", f = r(({ children: r, direction: f = "horizontal", primary: p = "first", size: m, defaultSize: h = "50%", onSizeChange: g, minSize: _ = 100, maxSize: v, minSecondarySize: y = 100, collapsible: b = !1, collapsed: x, defaultCollapsed: ie = !1, onCollapsedChange: S, persistKey: C, handleSize: w = 6, handleLabel: ae = "Resize", disabled: T = !1, classes: E, className: D, style: O, ...oe }, se) => {
32
- let k = o(null);
33
- te(se, () => k.current);
34
- let A = f === "horizontal", [j, M] = s(0);
35
- a(() => {
31
+ var p = "__crk-splitpane-unpersisted__", m = e(({ children: e, direction: m = "horizontal", primary: h = "first", size: g, defaultSize: _ = "50%", onSizeChange: ne, minSize: v = 100, maxSize: y, minSecondarySize: b = 100, collapsible: x = !1, collapsed: S, defaultCollapsed: re = !1, onCollapsedChange: C, persistKey: w, handleSize: T = 6, handleLabel: ie = "Resize", disabled: E = !1, classes: D, className: O, style: ae, ...oe }, se) => {
32
+ let k = a(null);
33
+ r(se, () => k.current);
34
+ let A = m === "horizontal", [j, M] = o(0);
35
+ i(() => {
36
36
  let e = k.current;
37
37
  if (!e) return;
38
38
  let t = () => {
@@ -43,93 +43,93 @@ var d = "__crk-splitpane-unpersisted__", f = r(({ children: r, direction: f = "h
43
43
  let n = new ResizeObserver(t);
44
44
  return n.observe(e), () => n.disconnect();
45
45
  }, [A]);
46
- let [N, P] = n(C ?? d, {}, { sync: !!C }), F = i((e) => {
47
- C && P((t) => ({
46
+ let [N, P] = u(w ?? p, {}, { sync: !!w }), F = t((e) => {
47
+ w && P((t) => ({
48
48
  ...t,
49
49
  ...e
50
50
  }));
51
- }, [C, P]), I = ne(() => u(h, 0), [h]), [L, R] = s(() => C && N.px !== void 0 ? null : I.ratio), [z, B] = s(() => C && N.px !== void 0 ? N.px : I.px ?? 0);
52
- a(() => {
51
+ }, [w, P]), I = ee(() => f(_, 0), [_]), [L, R] = o(() => w && N.px !== void 0 ? null : I.ratio), [z, B] = o(() => w && N.px !== void 0 ? N.px : I.px ?? 0);
52
+ i(() => {
53
53
  L !== null && j > 0 && B(L * j);
54
54
  }, [L, j]);
55
- let V = m === void 0 ? null : u(m, j), H = V ? V.px ?? 0 : z, [U, W] = s(() => C && N.collapsed !== void 0 ? N.collapsed : ie), G = b && (x ?? U), K = i((e) => {
56
- x === void 0 && W(e), S?.(e), F({ collapsed: e });
55
+ let V = g === void 0 ? null : f(g, j), H = V ? V.px ?? 0 : z, [U, W] = o(() => w && N.collapsed !== void 0 ? N.collapsed : re), G = x && (S ?? U), K = t((e) => {
56
+ S === void 0 && W(e), C?.(e), F({ collapsed: e });
57
57
  }, [
58
- x,
59
58
  S,
59
+ C,
60
60
  F
61
- ]), q = i(() => v === void 0 ? j > 0 ? Math.max(_, j - y - w) : Infinity : v, [
62
- v,
63
- j,
64
- _,
61
+ ]), q = t(() => y === void 0 ? j > 0 ? Math.max(v, j - b - T) : 1e400 : y, [
65
62
  y,
66
- w
67
- ]), J = j > 0 ? Math.min(Math.max(H, _), q()) : H, Y = o(J), X = t({
63
+ j,
64
+ v,
65
+ b,
66
+ T
67
+ ]), J = j > 0 ? Math.min(Math.max(H, v), q()) : H, Y = a(J), X = l({
68
68
  size: J,
69
69
  defaultSize: I.px ?? (I.ratio !== null && j > 0 ? I.ratio * j : J),
70
- min: _,
70
+ min: v,
71
71
  max: q,
72
72
  axis: A ? "x" : "y",
73
- invert: p === "second",
74
- disabled: T,
73
+ invert: h === "second",
74
+ disabled: E,
75
75
  onResizeStart: () => {
76
76
  G && K(!1);
77
77
  },
78
78
  onResize: (e, t) => {
79
- Y.current = t, V || (R(null), B(e)), g?.(e);
79
+ Y.current = t, V || (R(null), B(e)), ne?.(e);
80
80
  },
81
81
  onResizeEnd: (e) => {
82
- b && Y.current < _ / 2 ? (K(!0), Y.current = e) : F({ px: e });
82
+ x && Y.current < v / 2 ? (K(!0), Y.current = e) : F({ px: e });
83
83
  }
84
- }), ce = i(() => {
85
- T || (b ? K(!G) : X.reset());
84
+ }), ce = t(() => {
85
+ E || (x ? K(!G) : X.reset());
86
86
  }, [
87
- T,
88
- b,
87
+ E,
88
+ x,
89
89
  G,
90
90
  K,
91
91
  X
92
92
  ]);
93
- ee(() => {
93
+ n(() => {
94
94
  V?.ratio !== null && V?.ratio !== void 0 && R(V.ratio);
95
95
  }, [V?.ratio]);
96
96
  let le = G ? 0 : V && V.px === null && V.ratio !== null ? `${V.ratio * 100}%` : !V && L !== null && j === 0 ? `${L * 100}%` : J, Z = {
97
97
  [A ? "width" : "height"]: le,
98
98
  flex: "0 0 auto"
99
- }, ue = r[0], de = r[1], Q = p === "first", fe = /* @__PURE__ */ l("div", {
100
- className: c(e.pane, Q ? e.primary : e.secondary, Q && G && e.collapsed, E?.pane, Q ? E?.primary : E?.secondary, Q && G && E?.collapsed),
99
+ }, ue = e[0], de = e[1], Q = h === "first", fe = /* @__PURE__ */ d("div", {
100
+ className: s(c.pane, Q ? c.primary : c.secondary, Q && G && c.collapsed, D?.pane, Q ? D?.primary : D?.secondary, Q && G && D?.collapsed),
101
101
  style: Q ? Z : void 0,
102
102
  "data-pane": Q ? "primary" : "secondary",
103
103
  children: ue
104
- }), pe = /* @__PURE__ */ l("div", {
105
- className: c(e.pane, Q ? e.secondary : e.primary, !Q && G && e.collapsed, E?.pane, Q ? E?.secondary : E?.primary, !Q && G && E?.collapsed),
104
+ }), pe = /* @__PURE__ */ d("div", {
105
+ className: s(c.pane, Q ? c.secondary : c.primary, !Q && G && c.collapsed, D?.pane, Q ? D?.secondary : D?.primary, !Q && G && D?.collapsed),
106
106
  style: Q ? void 0 : Z,
107
107
  "data-pane": Q ? "secondary" : "primary",
108
108
  children: de
109
109
  }), { onDoubleClick: me, ...$ } = X.handleProps;
110
- return /* @__PURE__ */ re("div", {
110
+ return /* @__PURE__ */ te("div", {
111
111
  ref: k,
112
- className: c(e.root, A ? e.horizontal : e.vertical, E?.root, D),
112
+ className: s(c.root, A ? c.horizontal : c.vertical, D?.root, O),
113
113
  style: {
114
- ...O,
115
- "--crk-splitpane-handle-size": `${w}px`
114
+ ...ae,
115
+ "--crk-splitpane-handle-size": `${T}px`
116
116
  },
117
- "data-direction": f,
117
+ "data-direction": m,
118
118
  ...oe,
119
119
  children: [
120
120
  fe,
121
- /* @__PURE__ */ l("div", {
121
+ /* @__PURE__ */ d("div", {
122
122
  ...$,
123
123
  onDoubleClick: ce,
124
- "aria-label": ae,
124
+ "aria-label": ie,
125
125
  "aria-valuenow": G ? 0 : $["aria-valuenow"],
126
- tabIndex: T ? -1 : 0,
127
- className: c(e.handle, X.isResizing && e.handleActive, T && e.handleDisabled, E?.handle, X.isResizing && E?.handleActive),
126
+ tabIndex: E ? -1 : 0,
127
+ className: s(c.handle, X.isResizing && c.handleActive, E && c.handleDisabled, D?.handle, X.isResizing && D?.handleActive),
128
128
  "data-collapsed": G || void 0
129
129
  }),
130
130
  pe
131
131
  ]
132
132
  });
133
133
  });
134
- f.displayName = "SplitPane";
135
- export { f as SplitPane };
134
+ m.displayName = "SplitPane";
135
+ export { m as SplitPane };