@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
@@ -1,5 +1,5 @@
1
1
  // src/components/inputs/Select/Select.module.scss
2
- var e = "crk-wrapper-SP2JE", t = "crk-sm-DqshL", n = "crk-md-j4AKI", r = "crk-lg-24Xd3", i = "crk-root-Uu9Ah", a = "crk-error-9oRU6", o = "crk-arrow-WU8ZW", s = "crk-searchableWrapper-7AL4l", c = "crk-hiddenSelect-s3DEx", l = "crk-searchableTrigger-m-GWV", u = "crk-triggerOpen-Lo8-j", d = "crk-triggerLabel-5rETZ", f = "crk-placeholder-teBBh", p = "crk-arrowInline-m-roG", m = "crk-disabled-pcSeq", h = "crk-visuallyHidden-2tTD5", g = "crk-menu--i-je", _ = "crk-menuEnter-vJjLV", v = "crk-menuItems-VrZnE", y = "crk-item-fU3XI", b = "crk-itemHighlighted-MvR41", x = "crk-itemDisabled-KTUO8", S = "crk-itemSelected-42-BG", C = "crk-noResults-uicSW", w = "crk-match-Aej-J", T = "crk-spinner-I1ffm", E = "crk-multiTrigger-Pd3wJ", D = "crk-multiTriggerDisabled-9ajge", O = "crk-chip-TuYUB", k = "crk-chipLabel-H4JWu", A = "crk-chipRemove-Lfk0R", j = "crk-multiSearch-OrVeS", M = "crk-arrowMulti-Nh9Hr", N = "crk-itemCheck-DPB5A", P = {
2
+ var e = "crk-wrapper-SP2JE", t = "crk-sm-DqshL", n = "crk-md-j4AKI", r = "crk-lg-24Xd3", i = "crk-root-Uu9Ah", a = "crk-error-9oRU6", o = "crk-arrow-WU8ZW", s = "crk-searchableWrapper-7AL4l", c = "crk-hiddenSelect-s3DEx", l = "crk-searchableTrigger-m-GWV", u = "crk-triggerOpen-Lo8-j", d = "crk-triggerLabel-5rETZ", f = "crk-placeholder-teBBh", p = "crk-arrowInline-m-roG", m = "crk-disabled-pcSeq", h = "crk-visuallyHidden-2tTD5", g = "crk-menu--i-je", _ = "crk-menuEnter-vJjLV", v = "crk-menuItems-VrZnE", y = "crk-item-fU3XI", b = "crk-itemHighlighted-MvR41", x = "crk-itemDisabled-KTUO8", S = "crk-itemSelected-42-BG", C = "crk-noResults-uicSW", w = "crk-match-Aej-J", T = "crk-spinner-I1ffm", E = "crk-multiTrigger-Pd3wJ", D = "crk-multiTriggerDisabled-9ajge", O = "crk-chip-TuYUB", k = "crk-chipLabel-H4JWu", A = "crk-chipRemove-Lfk0R", j = "crk-multiSearch-OrVeS", M = "crk-arrowMulti-Nh9Hr", N = "crk-itemCheck-DPB5A", P = "crk-moreChip-Rlrb8", F = "crk-checklistTrigger-3mDgS", I = "crk-checklistButton-Jvh3L", L = "crk-menuChecklist-MxLWj", R = "crk-menuSearchRow-LuCyU", z = "crk-menuSearchIcon-drN6W", B = "crk-menuSearch-SjM96", V = "crk-menuHeader-VpZN1", H = "crk-menuAction-t1izk", U = "crk-checkbox-xFpYO", W = "crk-checkboxChecked-PATgQ", G = "crk-itemBody--PcX2", K = {
3
3
  wrapper: e,
4
4
  sm: t,
5
5
  md: n,
@@ -33,6 +33,18 @@ var e = "crk-wrapper-SP2JE", t = "crk-sm-DqshL", n = "crk-md-j4AKI", r = "crk-lg
33
33
  chipRemove: A,
34
34
  multiSearch: j,
35
35
  arrowMulti: M,
36
- itemCheck: N
36
+ itemCheck: N,
37
+ moreChip: P,
38
+ checklistTrigger: F,
39
+ checklistButton: I,
40
+ menuChecklist: L,
41
+ menuSearchRow: R,
42
+ menuSearchIcon: z,
43
+ menuSearch: B,
44
+ menuHeader: V,
45
+ menuAction: H,
46
+ checkbox: U,
47
+ checkboxChecked: W,
48
+ itemBody: G
37
49
  };
38
- export { o as arrow, p as arrowInline, M as arrowMulti, O as chip, k as chipLabel, A as chipRemove, P as default, m as disabled, a as error, c as hiddenSelect, y as item, N as itemCheck, x as itemDisabled, b as itemHighlighted, S as itemSelected, r as lg, w as match, n as md, g as menu, _ as menuEnter, v as menuItems, j as multiSearch, E as multiTrigger, D as multiTriggerDisabled, C as noResults, f as placeholder, i as root, l as searchableTrigger, s as searchableWrapper, t as sm, T as spinner, d as triggerLabel, u as triggerOpen, h as visuallyHidden, e as wrapper };
50
+ export { o as arrow, p as arrowInline, M as arrowMulti, U as checkbox, W as checkboxChecked, I as checklistButton, F as checklistTrigger, O as chip, k as chipLabel, A as chipRemove, K as default, m as disabled, a as error, c as hiddenSelect, y as item, G as itemBody, N as itemCheck, x as itemDisabled, b as itemHighlighted, S as itemSelected, r as lg, w as match, n as md, g as menu, H as menuAction, L as menuChecklist, _ as menuEnter, V as menuHeader, v as menuItems, B as menuSearch, z as menuSearchIcon, R as menuSearchRow, P as moreChip, j as multiSearch, E as multiTrigger, D as multiTriggerDisabled, C as noResults, f as placeholder, i as root, l as searchableTrigger, s as searchableWrapper, t as sm, T as spinner, d as triggerLabel, u as triggerOpen, h as visuallyHidden, e as wrapper };
@@ -1,20 +1,20 @@
1
- import e from "./Slider.module.js";
2
- import { forwardRef as t, useCallback as n, useEffect as r, useRef as i, useState as a } from "react";
3
- import o from "clsx";
1
+ import { forwardRef as e, useCallback as t, useEffect as n, useRef as r, useState as i } from "react";
2
+ import a from "clsx";
3
+ import o from "./Slider.module.scss.js";
4
4
  import { jsx as s, jsxs as c } from "react/jsx-runtime";
5
5
  // src/components/inputs/Slider/Slider.tsx
6
- var l = (e) => Array.isArray(e) ? e : null, u = t(({ value: t, defaultValue: u, onChange: d, onChangeEnd: f, min: p = 0, max: m = 100, step: h = 1, disabled: g = !1, formatValue: _, classes: v, className: y, style: b, "aria-label": x, "aria-labelledby": S }, C) => {
7
- let w = t !== void 0, [T, E] = a(t ?? u ?? 0), D = w ? t : T, O = i(null), k = i(0), [A, j] = a(!1), M = n((e) => Math.min(m, Math.max(p, e)), [p, m]), N = n((e) => M(Math.round((e - p) / h) * h + p), [
6
+ var l = (e) => Array.isArray(e) ? e : null, u = e(({ value: e, defaultValue: u, onChange: d, onChangeEnd: f, min: p = 0, max: m = 100, step: h = 1, disabled: g = !1, formatValue: _, classes: v, className: y, style: b, "aria-label": x, "aria-labelledby": S }, C) => {
7
+ let w = e !== void 0, [T, E] = i(e ?? u ?? 0), D = w ? e : T, O = r(null), k = r(0), [A, j] = i(!1), M = t((e) => Math.min(m, Math.max(p, e)), [p, m]), N = t((e) => M(Math.round((e - p) / h) * h + p), [
8
8
  M,
9
9
  p,
10
10
  h
11
- ]), P = n((e) => (e - p) / (m - p) * 100, [p, m]), F = n((e, t = !1) => {
11
+ ]), P = t((e) => (e - p) / (m - p) * 100, [p, m]), F = t((e, t = !1) => {
12
12
  w || E(e), d?.(e), t && f?.(e);
13
13
  }, [
14
14
  w,
15
15
  d,
16
16
  f
17
- ]), I = n((e, t, n = !1) => {
17
+ ]), I = t((e, t, n = !1) => {
18
18
  let r = N(t), i = l(D);
19
19
  if (i) {
20
20
  let t = [i[0], i[1]];
@@ -24,16 +24,16 @@ var l = (e) => Array.isArray(e) ? e : null, u = t(({ value: t, defaultValue: u,
24
24
  D,
25
25
  N,
26
26
  F
27
- ]), L = n((e) => {
27
+ ]), L = t((e) => {
28
28
  let t = O.current;
29
29
  if (!t) return p;
30
30
  let n = t.getBoundingClientRect();
31
31
  return p + (n.width > 0 ? (e - n.left) / n.width : 0) * (m - p);
32
- }, [p, m]), R = n((e) => {
32
+ }, [p, m]), R = t((e) => {
33
33
  let t = l(D);
34
34
  return t ? Math.abs(e - t[0]) <= Math.abs(e - t[1]) ? 0 : 1 : 0;
35
35
  }, [D]);
36
- r(() => {
36
+ n(() => {
37
37
  if (!A) return;
38
38
  let e = (e) => {
39
39
  I(k.current, L(e.clientX));
@@ -61,35 +61,35 @@ var l = (e) => Array.isArray(e) ? e : null, u = t(({ value: t, defaultValue: u,
61
61
  }, H = l(D), U = H ?? [D], W = H ? P(H[0]) : 0, G = P(H ? H[1] : D);
62
62
  return /* @__PURE__ */ s("div", {
63
63
  ref: C,
64
- className: o(e.root, g && e.disabled, v?.root, y),
64
+ className: a(o.root, g && o.disabled, v?.root, y),
65
65
  style: b,
66
66
  "data-disabled": g || void 0,
67
67
  children: /* @__PURE__ */ c("div", {
68
68
  ref: O,
69
- className: o(e.track, v?.track),
69
+ className: a(o.track, v?.track),
70
70
  onPointerDown: z,
71
71
  children: [/* @__PURE__ */ s("div", {
72
- className: o(e.range, v?.range),
72
+ className: a(o.range, v?.range),
73
73
  style: {
74
74
  left: `${W}%`,
75
75
  width: `${G - W}%`
76
76
  }
77
- }), U.map((t, n) => /* @__PURE__ */ s("div", {
78
- className: o(e.thumb, v?.thumb),
79
- style: { left: `${P(t)}%` },
77
+ }), U.map((e, t) => /* @__PURE__ */ s("div", {
78
+ className: a(o.thumb, v?.thumb),
79
+ style: { left: `${P(e)}%` },
80
80
  role: "slider",
81
81
  tabIndex: g ? -1 : 0,
82
82
  "aria-orientation": "horizontal",
83
83
  "aria-valuemin": p,
84
84
  "aria-valuemax": m,
85
- "aria-valuenow": t,
86
- "aria-valuetext": _ ? _(t) : void 0,
85
+ "aria-valuenow": e,
86
+ "aria-valuetext": _ ? _(e) : void 0,
87
87
  "aria-label": x,
88
88
  "aria-labelledby": S,
89
89
  "aria-disabled": g || void 0,
90
- onPointerDown: B(n),
91
- onKeyDown: V(n, t)
92
- }, n))]
90
+ onPointerDown: B(t),
91
+ onKeyDown: V(t, e)
92
+ }, t))]
93
93
  })
94
94
  });
95
95
  });
@@ -1,11 +1,11 @@
1
- import { Checkbox as e } from "../Checkbox/Checkbox.js";
2
- import { forwardRef as t } from "react";
1
+ import { forwardRef as e } from "react";
2
+ import { Checkbox as t } from "../Checkbox/Checkbox.js";
3
3
  import { jsx as n } from "react/jsx-runtime";
4
4
  // src/components/inputs/Switch/Switch.tsx
5
- var r = t((t, r) => /* @__PURE__ */ n(e, {
5
+ var r = e((e, r) => /* @__PURE__ */ n(t, {
6
6
  ref: r,
7
7
  variant: "switch",
8
- ...t
8
+ ...e
9
9
  }));
10
10
  r.displayName = "Switch";
11
11
  export { r as Switch };
@@ -1,6 +1,6 @@
1
- import e from "./Textarea.module.js";
2
- import { forwardRef as t, useCallback as n, useEffect as r, useRef as i } from "react";
3
- import a from "clsx";
1
+ import { forwardRef as e, useCallback as t, useEffect as n, useRef as r } from "react";
2
+ import i from "clsx";
3
+ import a from "./Textarea.module.scss.js";
4
4
  import { jsx as o } from "react/jsx-runtime";
5
5
  // src/components/inputs/Textarea/Textarea.tsx
6
6
  var s = {
@@ -8,19 +8,19 @@ var s = {
8
8
  vertical: "resizeVertical",
9
9
  horizontal: "resizeHorizontal",
10
10
  both: "resizeBoth"
11
- }, c = t(({ inputSize: t = "md", error: c = !1, resize: l = "vertical", autoExpand: u = !0, className: d, style: f, onChange: p, ...m }, h) => {
12
- let g = i(null), _ = n(() => {
11
+ }, c = e(({ inputSize: e = "md", error: c = !1, resize: l = "vertical", autoExpand: u = !0, className: d, style: f, onChange: p, ...m }, h) => {
12
+ let g = r(null), _ = t(() => {
13
13
  let e = g.current;
14
14
  e && (e.style.height = "auto", e.style.height = `${e.scrollHeight}px`);
15
15
  }, []), v = m.value ?? "";
16
- r(() => {
16
+ n(() => {
17
17
  u && _();
18
18
  }, [
19
19
  u,
20
20
  _,
21
21
  v
22
22
  ]);
23
- let y = n((e) => {
23
+ let y = t((e) => {
24
24
  u && _(), p?.(e);
25
25
  }, [
26
26
  u,
@@ -31,7 +31,7 @@ var s = {
31
31
  ref: (e) => {
32
32
  g.current = e, typeof h == "function" ? h(e) : h && (h.current = e);
33
33
  },
34
- className: a(e.root, e[t], c && e.error, u ? e.autoExpand : e[s[l]], d),
34
+ className: i(a.root, a[e], c && a.error, u ? a.autoExpand : a[s[l]], d),
35
35
  style: f,
36
36
  onChange: y,
37
37
  rows: m.rows ?? 1,
@@ -10,7 +10,8 @@ export interface PortalPosition {
10
10
  /**
11
11
  * Tracks the trigger's bounding rect for a portaled popover-style menu.
12
12
  * Recomputes on scroll (capture phase, so nested scroll containers like a
13
- * Modal body are caught too) and on window resize.
13
+ * Modal body are caught too), on window resize, and when the trigger itself
14
+ * resizes.
14
15
  *
15
16
  * Returns viewport-relative coordinates intended for use with
16
17
  * `position: fixed` on the portaled menu.
@@ -12,14 +12,17 @@ function n(n, r) {
12
12
  let e = n.current;
13
13
  if (!e) return;
14
14
  let t = e.getBoundingClientRect();
15
- a({
15
+ a((e) => e.top === t.bottom && e.left === t.left && e.width === t.width ? e : {
16
16
  top: t.bottom,
17
17
  left: t.left,
18
18
  width: t.width
19
19
  });
20
20
  };
21
- if (e(), typeof window < "u") return window.addEventListener("scroll", e, !0), window.addEventListener("resize", e), () => {
22
- window.removeEventListener("scroll", e, !0), window.removeEventListener("resize", e);
21
+ if (e(), typeof window > "u") return;
22
+ window.addEventListener("scroll", e, !0), window.addEventListener("resize", e);
23
+ let t = n.current, i = t && typeof ResizeObserver < "u" ? new ResizeObserver(e) : null;
24
+ return t && i?.observe(t), () => {
25
+ window.removeEventListener("scroll", e, !0), window.removeEventListener("resize", e), i?.disconnect();
23
26
  };
24
27
  }, [r, n]), i;
25
28
  }
@@ -1,6 +1,6 @@
1
1
  import { useCallback as e, useEffect as t, useRef as n, useState as r } from "react";
2
2
  // src/hooks/useResizable.ts
3
- var i = (e) => typeof e == "function" ? e() : e ?? Infinity;
3
+ var i = (e) => typeof e == "function" ? e() : e ?? 1e400;
4
4
  function a(a = {}) {
5
5
  let { size: o, defaultSize: s = 0, min: c = 0, max: l, axis: u = "x", invert: d = !1, step: f = 16, onResize: p, onResizeStart: m, onResizeEnd: h, disabled: g = !1 } = a, [_, v] = r(s), [y, b] = r(!1), x = o ?? _, S = n(x);
6
6
  S.current = x;
package/hooks/useTheme.js CHANGED
@@ -1,6 +1,6 @@
1
- import { usePersistedState as e } from "./usePersistedState.js";
2
- import { useMediaQuery as t } from "./useMediaQuery.js";
3
- import { useCallback as n, useEffect as r } from "react";
1
+ import { useCallback as e, useEffect as t } from "react";
2
+ import { usePersistedState as n } from "./usePersistedState.js";
3
+ import { useMediaQuery as r } from "./useMediaQuery.js";
4
4
  // src/hooks/useTheme.ts
5
5
  var i = [
6
6
  "light",
@@ -11,18 +11,18 @@ function a(e, t) {
11
11
  typeof document < "u" && document.documentElement.setAttribute(e, t);
12
12
  }
13
13
  function o(o = {}) {
14
- let { storageKey: s = "crk-theme", attribute: c = "data-theme", defaultTheme: l = "system" } = o, [u, d] = e(s, l), f = i.includes(u) ? u : l, p = t("(prefers-color-scheme: dark)"), m = f === "system" ? p ? "dark" : "light" : f;
15
- r(() => {
14
+ let { storageKey: s = "crk-theme", attribute: c = "data-theme", defaultTheme: l = "system" } = o, [u, d] = n(s, l), f = i.includes(u) ? u : l, p = r("(prefers-color-scheme: dark)"), m = f === "system" ? p ? "dark" : "light" : f;
15
+ t(() => {
16
16
  a(c, f);
17
17
  }, [c, f]);
18
- let h = n((e) => {
18
+ let h = e((e) => {
19
19
  d(e), a(c, e);
20
20
  }, [d, c]);
21
21
  return {
22
22
  theme: f,
23
23
  resolved: m,
24
24
  setTheme: h,
25
- toggle: n(() => {
25
+ toggle: e(() => {
26
26
  h(i[(i.indexOf(f) + 1) % i.length]);
27
27
  }, [f, h])
28
28
  };