@overdoser/react-toolkit 0.20.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 (212) hide show
  1. package/AGENTS.md +2 -1
  2. package/CHANGELOG.md +41 -0
  3. package/components/Accordion/Accordion.js +160 -177
  4. package/components/Accordion/Accordion.module.scss.js +19 -35
  5. package/components/ActionButton/ActionButton.js +155 -209
  6. package/components/ActionButton/ActionButton.module.scss.js +24 -46
  7. package/components/ActionButton/CopyButton.js +52 -64
  8. package/components/Alert/Alert.js +93 -96
  9. package/components/Alert/Alert.module.scss.js +17 -32
  10. package/components/Avatar/Avatar.js +44 -55
  11. package/components/Avatar/Avatar.module.scss.js +22 -42
  12. package/components/Badge/Badge.js +15 -37
  13. package/components/Badge/Badge.module.scss.js +16 -30
  14. package/components/Breadcrumbs/Breadcrumbs.d.ts +1 -1
  15. package/components/Breadcrumbs/Breadcrumbs.js +52 -48
  16. package/components/Breadcrumbs/Breadcrumbs.module.scss.js +9 -16
  17. package/components/Button/Button.js +35 -57
  18. package/components/Button/Button.module.scss.js +24 -46
  19. package/components/Card/Card.js +94 -131
  20. package/components/Card/Card.module.scss.js +34 -59
  21. package/components/Chart/AreaChart.d.ts +1 -1
  22. package/components/Chart/AreaChart.js +248 -249
  23. package/components/Chart/Axis.d.ts +2 -2
  24. package/components/Chart/Axis.js +34 -43
  25. package/components/Chart/BarChart.d.ts +1 -1
  26. package/components/Chart/BarChart.js +307 -348
  27. package/components/Chart/Chart.module.scss.js +31 -60
  28. package/components/Chart/ChartContainer.js +33 -41
  29. package/components/Chart/ChartLegend.d.ts +1 -1
  30. package/components/Chart/ChartLegend.js +31 -30
  31. package/components/Chart/ChartTooltip.d.ts +1 -1
  32. package/components/Chart/ChartTooltip.js +45 -40
  33. package/components/Chart/LineChart.d.ts +1 -1
  34. package/components/Chart/LineChart.js +220 -232
  35. package/components/Chart/PieChart.d.ts +1 -1
  36. package/components/Chart/PieChart.js +224 -240
  37. package/components/Chart/RadarChart.d.ts +1 -1
  38. package/components/Chart/RadarChart.js +166 -215
  39. package/components/Chart/Sparkline.js +73 -68
  40. package/components/Chart/TradingChart.d.ts +1 -1
  41. package/components/Chart/TradingChart.js +804 -701
  42. package/components/Chart/scales.js +28 -35
  43. package/components/Chart/trading/indicators.js +61 -62
  44. package/components/Chart/trading/period.js +46 -68
  45. package/components/Chart/useChartDimensions.js +30 -22
  46. package/components/Chip/Chip.js +98 -141
  47. package/components/Chip/Chip.module.scss.js +31 -58
  48. package/components/CodeBlock/CodeBlock.js +111 -119
  49. package/components/CodeBlock/CodeBlock.module.scss.js +22 -42
  50. package/components/CommandPalette/CommandPalette.js +387 -392
  51. package/components/CommandPalette/CommandPalette.module.scss.js +27 -48
  52. package/components/ConfirmDialog/ConfirmDialog.d.ts +1 -1
  53. package/components/ConfirmDialog/ConfirmDialog.js +184 -199
  54. package/components/ConfirmDialog/ConfirmDialog.module.scss.js +11 -20
  55. package/components/Divider/Divider.js +25 -36
  56. package/components/Divider/Divider.module.scss.js +16 -30
  57. package/components/Draggable/Draggable.d.ts +1 -1
  58. package/components/Draggable/Draggable.js +157 -164
  59. package/components/Draggable/Draggable.module.scss.js +9 -16
  60. package/components/Drawer/Drawer.js +104 -126
  61. package/components/Drawer/Drawer.module.scss.js +65 -118
  62. package/components/Dropdown/Dropdown.js +175 -234
  63. package/components/Dropdown/Dropdown.module.scss.js +28 -52
  64. package/components/Dropdown/DropdownItem.js +55 -58
  65. package/components/Dropdown/DropdownLabel.js +14 -11
  66. package/components/Dropdown/DropdownSeparator.js +13 -11
  67. package/components/Dropdown/dropdownContext.js +4 -5
  68. package/components/Dropdown/useContextMenu.js +27 -17
  69. package/components/Dropzone/Dropzone.js +99 -105
  70. package/components/Dropzone/Dropzone.module.scss.js +11 -20
  71. package/components/EmptyState/EmptyState.js +57 -54
  72. package/components/EmptyState/EmptyState.module.scss.js +13 -24
  73. package/components/Form/Form.d.ts +1 -1
  74. package/components/Form/Form.js +31 -34
  75. package/components/Form/Form.module.scss.js +15 -28
  76. package/components/Form/FormField.d.ts +1 -1
  77. package/components/Form/FormField.js +71 -75
  78. package/components/Form/FormRow.d.ts +1 -1
  79. package/components/Form/FormRow.js +11 -8
  80. package/components/Form/formFieldDefaults.js +4 -5
  81. package/components/ImageViewer/ImageViewer.js +312 -201
  82. package/components/ImageViewer/ImageViewer.module.scss.js +25 -46
  83. package/components/ImageViewer/useZoomPan.js +206 -137
  84. package/components/Kbd/Kbd.js +24 -21
  85. package/components/Kbd/Kbd.module.scss.js +9 -16
  86. package/components/KeyValueList/KeyValueList.js +119 -123
  87. package/components/KeyValueList/KeyValueList.module.scss.js +22 -42
  88. package/components/Link/Link.js +45 -59
  89. package/components/Link/Link.module.scss.js +9 -15
  90. package/components/List/List.js +22 -46
  91. package/components/List/List.module.scss.js +11 -20
  92. package/components/Loader/Loader.js +152 -182
  93. package/components/Loader/Loader.module.scss.js +39 -69
  94. package/components/Modal/Modal.js +93 -105
  95. package/components/Modal/Modal.module.scss.js +17 -32
  96. package/components/PageHeader/PageHeader.js +79 -73
  97. package/components/PageHeader/PageHeader.module.scss.js +22 -42
  98. package/components/Pagination/Pagination.js +62 -83
  99. package/components/Pagination/Pagination.module.scss.js +12 -22
  100. package/components/Pagination/paginationRange.js +15 -22
  101. package/components/Popover/Popover.js +110 -134
  102. package/components/Popover/Popover.module.scss.js +11 -20
  103. package/components/ProgressBar/ProgressBar.d.ts +15 -1
  104. package/components/ProgressBar/ProgressBar.js +56 -89
  105. package/components/ProgressBar/ProgressBar.module.scss.js +28 -50
  106. package/components/RelativeTime/RelativeTime.js +36 -43
  107. package/components/RelativeTime/RelativeTime.module.scss.js +3 -7
  108. package/components/SegmentedControl/SegmentedControl.js +93 -129
  109. package/components/SegmentedControl/SegmentedControl.module.scss.js +20 -38
  110. package/components/Skeleton/Skeleton.js +36 -50
  111. package/components/Skeleton/Skeleton.module.scss.js +14 -24
  112. package/components/Spinner/Spinner.js +25 -25
  113. package/components/Spinner/Spinner.module.scss.js +11 -19
  114. package/components/SplitButton/SplitButton.js +149 -196
  115. package/components/SplitButton/SplitButton.module.scss.js +30 -56
  116. package/components/SplitPane/SplitPane.js +134 -170
  117. package/components/SplitPane/SplitPane.module.scss.js +13 -24
  118. package/components/StatCard/StatCard.js +132 -125
  119. package/components/StatCard/StatCard.module.scss.js +41 -71
  120. package/components/StatusDot/StatusDot.js +28 -39
  121. package/components/StatusDot/StatusDot.module.scss.js +17 -31
  122. package/components/Table/Table.d.ts +1 -1
  123. package/components/Table/Table.js +381 -451
  124. package/components/Table/Table.module.scss.js +41 -80
  125. package/components/Table/useTableSort.js +51 -42
  126. package/components/Tabs/Tabs.js +109 -161
  127. package/components/Tabs/Tabs.module.scss.js +27 -52
  128. package/components/ThemeToggle/ThemeToggle.js +122 -98
  129. package/components/ThemeToggle/ThemeToggle.module.scss.js +12 -22
  130. package/components/Timeline/GanttTimeline.js +357 -318
  131. package/components/Timeline/GanttTimeline.module.scss.js +28 -54
  132. package/components/Timeline/HistoryTimeline.js +486 -450
  133. package/components/Timeline/HistoryTimeline.module.scss.js +30 -58
  134. package/components/Timeline/Timeline.module.scss.js +75 -140
  135. package/components/Timeline/TimelineShared.d.ts +7 -7
  136. package/components/Timeline/TimelineShared.js +288 -279
  137. package/components/Timeline/TraceEventDetails.d.ts +3 -3
  138. package/components/Timeline/TraceEventDetails.js +244 -177
  139. package/components/Timeline/TraceTimeline.js +823 -783
  140. package/components/Timeline/TraceTimeline.module.scss.js +97 -188
  141. package/components/Timeline/historyLayout.js +336 -263
  142. package/components/Timeline/timelineCore.js +208 -183
  143. package/components/Timeline/traceEvent.js +59 -61
  144. package/components/Timeline/traceLayout.js +101 -90
  145. package/components/Timeline/useTimeline.js +76 -79
  146. package/components/Timer/Timer.js +190 -156
  147. package/components/Timer/Timer.module.scss.js +28 -54
  148. package/components/Toast/Toast.d.ts +1 -1
  149. package/components/Toast/Toast.js +128 -128
  150. package/components/Toast/Toast.module.scss.js +36 -61
  151. package/components/Toast/toastStore.js +58 -62
  152. package/components/ToggleIconButton/ToggleIconButton.js +36 -58
  153. package/components/ToggleIconButton/ToggleIconButton.module.scss.js +14 -26
  154. package/components/Tooltip/Tooltip.d.ts +1 -1
  155. package/components/Tooltip/Tooltip.js +76 -85
  156. package/components/Tooltip/Tooltip.module.scss.js +16 -29
  157. package/components/Typography/Typography.js +10 -35
  158. package/components/Typography/Typography.module.scss.js +29 -52
  159. package/components/inputs/Checkbox/Checkbox.js +27 -51
  160. package/components/inputs/Checkbox/Checkbox.module.scss.js +9 -16
  161. package/components/inputs/Checkbox/CheckboxGroup.js +53 -111
  162. package/components/inputs/Checkbox/CheckboxGroup.module.scss.js +16 -30
  163. package/components/inputs/DatePicker/CalendarPanel.d.ts +1 -1
  164. package/components/inputs/DatePicker/CalendarPanel.js +263 -286
  165. package/components/inputs/DatePicker/CalendarPanel.module.scss.js +22 -40
  166. package/components/inputs/DatePicker/DatePicker.js +115 -142
  167. package/components/inputs/DatePicker/DatePicker.module.scss.js +13 -24
  168. package/components/inputs/DatePicker/dateUtils.js +32 -41
  169. package/components/inputs/DateTimePicker/DateTimePicker.js +226 -232
  170. package/components/inputs/DateTimePicker/DateTimePicker.module.scss.js +19 -36
  171. package/components/inputs/DateTimePicker/DateTimeSegments.js +273 -252
  172. package/components/inputs/DateTimePicker/TimeField.d.ts +1 -1
  173. package/components/inputs/DateTimePicker/TimeField.js +131 -132
  174. package/components/inputs/DateTimePicker/timeZoneUtils.js +95 -92
  175. package/components/inputs/Input/Input.js +98 -109
  176. package/components/inputs/Input/Input.module.scss.js +14 -26
  177. package/components/inputs/NumberInput/NumberInput.js +112 -132
  178. package/components/inputs/NumberInput/NumberInput.module.scss.js +13 -24
  179. package/components/inputs/Radio/Radio.js +50 -73
  180. package/components/inputs/Radio/Radio.module.scss.js +8 -14
  181. package/components/inputs/SearchInput/SearchInput.js +98 -115
  182. package/components/inputs/SearchInput/SearchInput.module.scss.js +7 -12
  183. package/components/inputs/Select/Select.d.ts +55 -3
  184. package/components/inputs/Select/Select.js +696 -682
  185. package/components/inputs/Select/Select.module.scss.js +49 -72
  186. package/components/inputs/Slider/Slider.js +97 -128
  187. package/components/inputs/Slider/Slider.module.scss.js +8 -14
  188. package/components/inputs/Switch/Switch.js +11 -8
  189. package/components/inputs/Textarea/Textarea.js +42 -58
  190. package/components/inputs/Textarea/Textarea.module.scss.js +13 -24
  191. package/hooks/useClickOutside.js +17 -14
  192. package/hooks/useDebouncedValue.js +13 -14
  193. package/hooks/useElementSize.js +27 -22
  194. package/hooks/useEscapeLayer.js +28 -29
  195. package/hooks/useFocusTrap.js +27 -38
  196. package/hooks/useKeyboard.js +76 -64
  197. package/hooks/useMediaQuery.js +10 -15
  198. package/hooks/useNow.js +28 -33
  199. package/hooks/usePersistedState.js +98 -94
  200. package/hooks/usePortalPosition.d.ts +2 -1
  201. package/hooks/usePortalPosition.js +28 -19
  202. package/hooks/useResizable.js +106 -104
  203. package/hooks/useTheme.js +28 -23
  204. package/index.css +2 -1
  205. package/index.js +96 -214
  206. package/index.layered.css +2 -3
  207. package/llms.txt +28 -4
  208. package/manifest.json +41 -4
  209. package/package.json +1 -1
  210. package/utils/formatBytes.js +29 -13
  211. package/utils/themeScript.js +6 -8
  212. package/utils/timeAgo.js +59 -32
@@ -1,86 +1,77 @@
1
- import { jsxs as W, jsx as q } from "react/jsx-runtime";
2
- import { useRef as b, useState as E, useId as J, useCallback as L, useEffect as A, useLayoutEffect as Q } from "react";
3
- import { createPortal as U } from "react-dom";
4
- import x from "clsx";
5
- import w from "./Tooltip.module.scss.js";
6
- const e = 8;
7
- function V({
8
- content: p,
9
- children: F,
10
- placement: r = "top",
11
- delay: M = 300,
12
- closeDelay: h = 0,
13
- disabled: R = !1,
14
- hideArrow: G = !1,
15
- classes: v
16
- }) {
17
- const T = b(null), N = b(null), s = b(null), [n, a] = E(!1), [K, O] = E(r), [k, P] = E({ top: 0, left: 0 }), B = J(), i = L(() => {
18
- s.current && (clearTimeout(s.current), s.current = null);
19
- }, []), C = L(() => {
20
- R || p == null || p === "" || (i(), s.current = setTimeout(() => a(!0), M));
21
- }, [R, p, i, M]), j = L(() => {
22
- i(), h > 0 ? s.current = setTimeout(() => a(!1), h) : a(!1);
23
- }, [i, h]);
24
- A(() => i, [i]), Q(() => {
25
- if (!n) return;
26
- const o = () => {
27
- const m = T.current, y = N.current;
28
- if (!m || !y) return;
29
- const t = m.getBoundingClientRect(), f = y.offsetWidth, u = y.offsetHeight, z = typeof window < "u" ? window.innerWidth : 0, H = typeof window < "u" ? window.innerHeight : 0, I = (g) => g === "top" ? t.top - u - e >= 0 : g === "bottom" ? t.bottom + u + e <= H : g === "left" ? t.left - f - e >= 0 : t.right + f + e <= z, S = {
30
- top: "bottom",
31
- bottom: "top",
32
- left: "right",
33
- right: "left"
34
- }, d = I(r) || !I(S[r]) ? r : S[r];
35
- let l = 0, c = 0;
36
- d === "top" || d === "bottom" ? (c = t.left + t.width / 2 - f / 2, l = d === "top" ? t.top - u - e : t.bottom + e) : (l = t.top + t.height / 2 - u / 2, c = d === "left" ? t.left - f - e : t.right + e), c = Math.max(e, Math.min(c, z - f - e)), l = Math.max(e, Math.min(l, H - u - e)), O(d), P({ top: l, left: c });
37
- };
38
- if (o(), !(typeof window > "u"))
39
- return window.addEventListener("scroll", o, !0), window.addEventListener("resize", o), () => {
40
- window.removeEventListener("scroll", o, !0), window.removeEventListener("resize", o);
41
- };
42
- }, [n, r]), A(() => {
43
- if (!n) return;
44
- const o = (m) => {
45
- m.key === "Escape" && a(!1);
46
- };
47
- return document.addEventListener("keydown", o), () => document.removeEventListener("keydown", o);
48
- }, [n]);
49
- const _ = n ? B : void 0, $ = { position: "fixed", top: k.top, left: k.left };
50
- return /* @__PURE__ */ W(
51
- "span",
52
- {
53
- ref: T,
54
- className: x(w.wrapper, v?.wrapper),
55
- onMouseEnter: C,
56
- onMouseLeave: j,
57
- onFocus: C,
58
- onBlur: j,
59
- "aria-describedby": _,
60
- children: [
61
- F,
62
- n && typeof document < "u" && U(
63
- /* @__PURE__ */ W(
64
- "div",
65
- {
66
- ref: N,
67
- id: B,
68
- role: "tooltip",
69
- className: x(w.tooltip, w[`p_${K}`], v?.tooltip),
70
- style: $,
71
- children: [
72
- p,
73
- !G && /* @__PURE__ */ q("span", { className: x(w.arrow, v?.arrow), "aria-hidden": "true" })
74
- ]
75
- }
76
- ),
77
- document.body
78
- )
79
- ]
80
- }
81
- );
1
+ import { useCallback as e, useEffect as t, useId as n, useLayoutEffect 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 "./Tooltip.module.scss.js";
5
+ import { jsx as l, jsxs as u } from "react/jsx-runtime";
6
+ // src/components/Tooltip/Tooltip.tsx
7
+ var d = 8;
8
+ function f({ content: f, children: p, placement: m = "top", delay: h = 300, closeDelay: g = 0, disabled: _ = !1, hideArrow: v = !1, classes: y }) {
9
+ let b = i(null), x = i(null), S = i(null), [C, w] = a(!1), [T, E] = a(m), [D, O] = a({
10
+ top: 0,
11
+ left: 0
12
+ }), k = n(), A = e(() => {
13
+ S.current &&= (clearTimeout(S.current), null);
14
+ }, []), j = e(() => {
15
+ _ || f == null || f === "" || (A(), S.current = setTimeout(() => w(!0), h));
16
+ }, [
17
+ _,
18
+ f,
19
+ A,
20
+ h
21
+ ]), M = e(() => {
22
+ A(), g > 0 ? S.current = setTimeout(() => w(!1), g) : w(!1);
23
+ }, [A, g]);
24
+ t(() => A, [A]), r(() => {
25
+ if (!C) return;
26
+ let e = () => {
27
+ let e = b.current, t = x.current;
28
+ if (!e || !t) return;
29
+ let n = e.getBoundingClientRect(), r = t.offsetWidth, i = t.offsetHeight, a = typeof window < "u" ? window.innerWidth : 0, o = typeof window < "u" ? window.innerHeight : 0, s = (e) => e === "top" ? n.top - i - d >= 0 : e === "bottom" ? n.bottom + i + d <= o : e === "left" ? n.left - r - d >= 0 : n.right + r + d <= a, c = {
30
+ top: "bottom",
31
+ bottom: "top",
32
+ left: "right",
33
+ right: "left"
34
+ }, l = s(m) || !s(c[m]) ? m : c[m], u = 0, f = 0;
35
+ l === "top" || l === "bottom" ? (f = n.left + n.width / 2 - r / 2, u = l === "top" ? n.top - i - d : n.bottom + d) : (u = n.top + n.height / 2 - i / 2, f = l === "left" ? n.left - r - d : n.right + d), f = Math.max(d, Math.min(f, a - r - d)), u = Math.max(d, Math.min(u, o - i - d)), E(l), O({
36
+ top: u,
37
+ left: f
38
+ });
39
+ };
40
+ if (e(), typeof window < "u") return window.addEventListener("scroll", e, !0), window.addEventListener("resize", e), () => {
41
+ window.removeEventListener("scroll", e, !0), window.removeEventListener("resize", e);
42
+ };
43
+ }, [C, m]), t(() => {
44
+ if (!C) return;
45
+ let e = (e) => {
46
+ e.key === "Escape" && w(!1);
47
+ };
48
+ return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
49
+ }, [C]);
50
+ let N = C ? k : void 0, P = {
51
+ position: "fixed",
52
+ top: D.top,
53
+ left: D.left
54
+ };
55
+ return /* @__PURE__ */ u("span", {
56
+ ref: b,
57
+ className: s(c.wrapper, y?.wrapper),
58
+ onMouseEnter: j,
59
+ onMouseLeave: M,
60
+ onFocus: j,
61
+ onBlur: M,
62
+ "aria-describedby": N,
63
+ children: [p, C && typeof document < "u" && o(/* @__PURE__ */ u("div", {
64
+ ref: x,
65
+ id: k,
66
+ role: "tooltip",
67
+ className: s(c.tooltip, c[`p_${T}`], y?.tooltip),
68
+ style: P,
69
+ children: [f, !v && /* @__PURE__ */ l("span", {
70
+ className: s(c.arrow, y?.arrow),
71
+ "aria-hidden": "true"
72
+ })]
73
+ }), document.body)]
74
+ });
82
75
  }
83
- V.displayName = "Tooltip";
84
- export {
85
- V as Tooltip
86
- };
76
+ f.displayName = "Tooltip";
77
+ export { f as Tooltip };
@@ -1,30 +1,17 @@
1
- const t = "crk-wrapper-V567h", o = "crk-tooltip-LjRUX", p = "crk-crk-tooltip-in-JCAKo", r = "crk-arrow-6yECM", c = "crk-p_top-I9ELz", k = "crk-p_top-I9ELz", n = "crk-p_bottom-S3gQ1", i = "crk-p_bottom-S3gQ1", l = "crk-p_left--Bx3l", s = "crk-p_left--Bx3l", _ = "crk-p_right-3Wuqv", e = "crk-p_right-3Wuqv", a = {
2
- wrapper: t,
3
- tooltip: o,
4
- "crk-tooltip-in": "crk-crk-tooltip-in-JCAKo",
5
- crkTooltipIn: p,
6
- arrow: r,
7
- p_top: c,
8
- pTop: k,
9
- p_bottom: n,
10
- pBottom: i,
11
- p_left: l,
12
- pLeft: s,
13
- p_right: _,
14
- pRight: e
15
- };
16
- export {
17
- r as arrow,
18
- p as crkTooltipIn,
19
- a as default,
20
- i as pBottom,
21
- s as pLeft,
22
- e as pRight,
23
- k as pTop,
24
- n as p_bottom,
25
- l as p_left,
26
- _ as p_right,
27
- c as p_top,
28
- o as tooltip,
29
- t as wrapper
1
+ // src/components/Tooltip/Tooltip.module.scss
2
+ var e = "crk-wrapper-V567h", t = "crk-tooltip-LjRUX", n = "crk-crk-tooltip-in-JCAKo", r = "crk-arrow-6yECM", i = "crk-p_top-I9ELz", a = "crk-p_top-I9ELz", o = "crk-p_bottom-S3gQ1", s = "crk-p_bottom-S3gQ1", c = "crk-p_left--Bx3l", l = "crk-p_left--Bx3l", u = "crk-p_right-3Wuqv", d = "crk-p_right-3Wuqv", f = {
3
+ wrapper: e,
4
+ tooltip: t,
5
+ "crk-tooltip-in": "crk-crk-tooltip-in-JCAKo",
6
+ crkTooltipIn: n,
7
+ arrow: r,
8
+ p_top: i,
9
+ pTop: a,
10
+ p_bottom: o,
11
+ pBottom: s,
12
+ p_left: c,
13
+ pLeft: l,
14
+ p_right: u,
15
+ pRight: d
30
16
  };
17
+ export { r as arrow, n as crkTooltipIn, f as default, s as pBottom, l as pLeft, d as pRight, a as pTop, o as p_bottom, c as p_left, u as p_right, i as p_top, t as tooltip, e as wrapper };
@@ -1,37 +1,12 @@
1
- import { forwardRef as c, createElement as n } from "react";
2
- import d from "clsx";
1
+ import { createElement as e, forwardRef as t } from "react";
2
+ import n from "clsx";
3
3
  import r from "./Typography.module.scss.js";
4
- const i = c(
5
- ({
6
- variant: e = "p",
7
- weight: o,
8
- color: p,
9
- align: t,
10
- truncate: m = !1,
11
- className: a,
12
- style: s,
13
- children: f,
14
- ...y
15
- }, l) => n(
16
- e,
17
- {
18
- ref: l,
19
- className: d(
20
- r.root,
21
- r[e],
22
- o && r[o],
23
- p && r[p],
24
- t && r[`align-${t}`],
25
- m && r.truncate,
26
- a
27
- ),
28
- style: s,
29
- ...y
30
- },
31
- f
32
- )
33
- );
4
+ // src/components/Typography/Typography.tsx
5
+ var i = t(({ variant: t = "p", weight: i, color: a, align: o, truncate: s = !1, className: c, style: l, children: u, ...d }, f) => e(t, {
6
+ ref: f,
7
+ className: n(r.root, r[t], i && r[i], a && r[a], o && r[`align-${o}`], s && r.truncate, c),
8
+ style: l,
9
+ ...d
10
+ }, u));
34
11
  i.displayName = "Typography";
35
- export {
36
- i as Typography
37
- };
12
+ export { i as Typography };
@@ -1,53 +1,30 @@
1
- const c = "crk-root-U-oiq", r = "crk-h1-Aivwz", t = "crk-h2-CV8Oo", n = "crk-h3-lrbrK", e = "crk-h4--jkC1", o = "crk-h5-GnQvD", s = "crk-h6-MKlIN", l = "crk-p-FzRtm", a = "crk-span-NZvLx", i = "crk-label-Cwi6a", k = "crk-normal-7AeZz", h = "crk-medium-36OXr", g = "crk-semibold-oQixc", m = "crk-bold-bk4b4", d = "crk-muted-itOSW", u = "crk-primary-rp36t", b = "crk-danger-SyOy-", p = "crk-success-w8PpD", f = "crk-align-left-3AGYw", y = "crk-align-center-h-x--", w = "crk-align-right-IXFhK", x = "crk-truncate-eqr85", C = {
2
- root: c,
3
- h1: r,
4
- h2: t,
5
- h3: n,
6
- h4: e,
7
- h5: o,
8
- h6: s,
9
- p: l,
10
- span: a,
11
- label: i,
12
- normal: k,
13
- medium: h,
14
- semibold: g,
15
- bold: m,
16
- default: "crk-default-79lKR",
17
- muted: d,
18
- primary: u,
19
- danger: b,
20
- success: p,
21
- "align-left": "crk-align-left-3AGYw",
22
- alignLeft: f,
23
- "align-center": "crk-align-center-h-x--",
24
- alignCenter: y,
25
- "align-right": "crk-align-right-IXFhK",
26
- alignRight: w,
27
- truncate: x
28
- };
29
- export {
30
- y as alignCenter,
31
- f as alignLeft,
32
- w as alignRight,
33
- m as bold,
34
- b as danger,
35
- C as default,
36
- r as h1,
37
- t as h2,
38
- n as h3,
39
- e as h4,
40
- o as h5,
41
- s as h6,
42
- i as label,
43
- h as medium,
44
- d as muted,
45
- k as normal,
46
- l as p,
47
- u as primary,
48
- c as root,
49
- g as semibold,
50
- a as span,
51
- p as success,
52
- x as truncate
1
+ // src/components/Typography/Typography.module.scss
2
+ var e = "crk-root-U-oiq", t = "crk-h1-Aivwz", n = "crk-h2-CV8Oo", r = "crk-h3-lrbrK", i = "crk-h4--jkC1", a = "crk-h5-GnQvD", o = "crk-h6-MKlIN", s = "crk-p-FzRtm", c = "crk-span-NZvLx", l = "crk-label-Cwi6a", u = "crk-normal-7AeZz", d = "crk-medium-36OXr", f = "crk-semibold-oQixc", p = "crk-bold-bk4b4", m = "crk-muted-itOSW", h = "crk-primary-rp36t", g = "crk-danger-SyOy-", _ = "crk-success-w8PpD", v = "crk-align-left-3AGYw", y = "crk-align-center-h-x--", b = "crk-align-right-IXFhK", x = "crk-truncate-eqr85", S = {
3
+ root: e,
4
+ h1: t,
5
+ h2: n,
6
+ h3: r,
7
+ h4: i,
8
+ h5: a,
9
+ h6: o,
10
+ p: s,
11
+ span: c,
12
+ label: l,
13
+ normal: u,
14
+ medium: d,
15
+ semibold: f,
16
+ bold: p,
17
+ default: "crk-default-79lKR",
18
+ muted: m,
19
+ primary: h,
20
+ danger: g,
21
+ success: _,
22
+ "align-left": "crk-align-left-3AGYw",
23
+ alignLeft: v,
24
+ "align-center": "crk-align-center-h-x--",
25
+ alignCenter: y,
26
+ "align-right": "crk-align-right-IXFhK",
27
+ alignRight: b,
28
+ truncate: x
53
29
  };
30
+ export { y as alignCenter, v as alignLeft, b as alignRight, p as bold, g as danger, S as default, t as h1, n as h2, r as h3, i as h4, a as h5, o as h6, l as label, d as medium, m as muted, u as normal, s as p, h as primary, e as root, f as semibold, c as span, _ as success, x as truncate };
@@ -1,51 +1,27 @@
1
- import { jsxs as b, jsx as f } from "react/jsx-runtime";
2
- import { forwardRef as d, useRef as w, useEffect as k } from "react";
3
- import s from "clsx";
4
- import e from "./Checkbox.module.scss.js";
5
- const y = d(
6
- ({
7
- label: a,
8
- variant: l = "checkbox",
9
- indeterminate: m = !1,
10
- error: p = !1,
11
- classes: r,
12
- className: u,
13
- style: h,
14
- ...x
15
- }, t) => {
16
- const i = w(null), n = l === "switch", o = m && !n;
17
- return k(() => {
18
- i.current && (i.current.indeterminate = o);
19
- }, [o]), /* @__PURE__ */ b(
20
- "label",
21
- {
22
- className: s(
23
- e.root,
24
- n && e.switchRoot,
25
- o && e.indeterminate,
26
- r?.root,
27
- u
28
- ),
29
- style: h,
30
- children: [
31
- /* @__PURE__ */ f(
32
- "input",
33
- {
34
- ref: (c) => {
35
- i.current = c, typeof t == "function" ? t(c) : t && (t.current = c);
36
- },
37
- type: "checkbox",
38
- className: s(e.input, n && e.switchInput, p && e.error, r?.input),
39
- ...x
40
- }
41
- ),
42
- a && /* @__PURE__ */ f("span", { className: s(e.label, r?.label), children: a })
43
- ]
44
- }
45
- );
46
- }
47
- );
48
- y.displayName = "Checkbox";
49
- export {
50
- y as Checkbox
51
- };
1
+ import { forwardRef as e, useEffect as t, useRef as n } from "react";
2
+ import r from "clsx";
3
+ import i from "./Checkbox.module.scss.js";
4
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
5
+ // src/components/inputs/Checkbox/Checkbox.tsx
6
+ var s = e(({ label: e, variant: s = "checkbox", indeterminate: c = !1, error: l = !1, classes: u, className: d, style: f, ...p }, m) => {
7
+ let h = n(null), g = s === "switch", _ = c && !g;
8
+ return t(() => {
9
+ h.current && (h.current.indeterminate = _);
10
+ }, [_]), /* @__PURE__ */ o("label", {
11
+ className: r(i.root, g && i.switchRoot, _ && i.indeterminate, u?.root, d),
12
+ style: f,
13
+ children: [/* @__PURE__ */ a("input", {
14
+ ref: (e) => {
15
+ h.current = e, typeof m == "function" ? m(e) : m && (m.current = e);
16
+ },
17
+ type: "checkbox",
18
+ className: r(i.input, g && i.switchInput, l && i.error, u?.input),
19
+ ...p
20
+ }), e && /* @__PURE__ */ a("span", {
21
+ className: r(i.label, u?.label),
22
+ children: e
23
+ })]
24
+ });
25
+ });
26
+ s.displayName = "Checkbox";
27
+ export { s as Checkbox };
@@ -1,17 +1,10 @@
1
- const t = "crk-root-61cKD", r = "crk-input-bAjPU", e = "crk-error-8Cdk6", n = "crk-switchInput-Ichse", c = "crk-label-W9IeS", o = "crk-indeterminate-mLarv", s = {
2
- root: t,
3
- input: r,
4
- error: e,
5
- switchInput: n,
6
- label: c,
7
- indeterminate: o
8
- };
9
- export {
10
- s as default,
11
- e as error,
12
- o as indeterminate,
13
- r as input,
14
- c as label,
15
- t as root,
16
- n as switchInput
1
+ // src/components/inputs/Checkbox/Checkbox.module.scss
2
+ var e = "crk-root-61cKD", t = "crk-input-bAjPU", n = "crk-error-8Cdk6", r = "crk-switchInput-Ichse", i = "crk-label-W9IeS", a = "crk-indeterminate-mLarv", o = {
3
+ root: e,
4
+ input: t,
5
+ error: n,
6
+ switchInput: r,
7
+ label: i,
8
+ indeterminate: a
17
9
  };
10
+ export { o as default, n as error, a as indeterminate, t as input, i as label, e as root, r as switchInput };
@@ -1,111 +1,53 @@
1
- import { jsx as s, jsxs as w } from "react/jsx-runtime";
2
- import { forwardRef as z } from "react";
3
- import o from "clsx";
4
- import { Checkbox as D } from "./Checkbox.js";
5
- import i from "./CheckboxGroup.module.scss.js";
6
- const O = z(
7
- ({
8
- options: p,
9
- value: a = [],
10
- onChange: t,
11
- variant: d = "checkbox",
12
- chipShape: b = "pill",
13
- chipCheckmark: h = !0,
14
- orientation: u,
15
- disabled: m = !1,
16
- error: f = !1,
17
- name: x,
18
- classes: l,
19
- className: k,
20
- style: v,
21
- id: C,
22
- "aria-label": y,
23
- "aria-labelledby": g,
24
- "aria-describedby": N,
25
- "aria-invalid": q,
26
- required: G
27
- }, S) => {
28
- const j = u ?? (d === "chips" ? "horizontal" : "vertical"), R = {
29
- pill: i.chipPill,
30
- rounded: i.chipRounded,
31
- square: i.chipSquare
32
- }[b], n = (e) => {
33
- const r = a.includes(e) ? a.filter((c) => c !== e) : [...a, e];
34
- t?.(r);
35
- };
36
- return /* @__PURE__ */ s(
37
- "div",
38
- {
39
- ref: S,
40
- id: C,
41
- role: "group",
42
- "aria-label": y,
43
- "aria-labelledby": g,
44
- "aria-describedby": N,
45
- "aria-invalid": q,
46
- "aria-required": G || void 0,
47
- className: o(
48
- i.group,
49
- i[j],
50
- d === "chips" && i.chipsGroup,
51
- f && i.error,
52
- l?.group,
53
- k
54
- ),
55
- style: v,
56
- children: p.map((e) => {
57
- const r = a.includes(e.value), c = m || e.disabled;
58
- return d === "chips" ? /* @__PURE__ */ w(
59
- "button",
60
- {
61
- type: "button",
62
- role: "checkbox",
63
- "aria-checked": r,
64
- disabled: c,
65
- className: o(
66
- i.chip,
67
- R,
68
- r && i.chipSelected,
69
- h && r && i.chipChecked,
70
- l?.option,
71
- l?.chip,
72
- r && l?.chipSelected
73
- ),
74
- onClick: () => n(e.value),
75
- children: [
76
- h && // Always rendered so it can transition; collapsed to zero
77
- // width when unselected, expanding in when selected. Padding
78
- // stays symmetric, so the icon + label remain centered.
79
- /* @__PURE__ */ s(
80
- "span",
81
- {
82
- className: o(i.chipCheck, r && i.chipCheckVisible),
83
- "aria-hidden": "true"
84
- }
85
- ),
86
- e.label
87
- ]
88
- },
89
- e.value
90
- ) : /* @__PURE__ */ s(
91
- D,
92
- {
93
- name: x,
94
- value: e.value,
95
- label: e.label,
96
- checked: r,
97
- disabled: c,
98
- className: o(i.option, l?.option),
99
- onChange: () => n(e.value)
100
- },
101
- e.value
102
- );
103
- })
104
- }
105
- );
106
- }
107
- );
108
- O.displayName = "CheckboxGroup";
109
- export {
110
- O as CheckboxGroup
111
- };
1
+ import { forwardRef as e } from "react";
2
+ import t from "clsx";
3
+ import { Checkbox as n } from "./Checkbox.js";
4
+ import r from "./CheckboxGroup.module.scss.js";
5
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
6
+ // src/components/inputs/Checkbox/CheckboxGroup.tsx
7
+ var o = e(({ options: e, value: o = [], onChange: s, variant: c = "checkbox", chipShape: l = "pill", chipCheckmark: u = !0, orientation: d, disabled: f = !1, error: p = !1, name: m, classes: h, className: g, style: _, id: v, "aria-label": y, "aria-labelledby": b, "aria-describedby": x, "aria-invalid": S, required: C }, w) => {
8
+ let T = d ?? (c === "chips" ? "horizontal" : "vertical"), E = {
9
+ pill: r.chipPill,
10
+ rounded: r.chipRounded,
11
+ square: r.chipSquare
12
+ }[l], D = (e) => {
13
+ let t = o.includes(e) ? o.filter((t) => t !== e) : [...o, e];
14
+ s?.(t);
15
+ };
16
+ return /* @__PURE__ */ i("div", {
17
+ ref: w,
18
+ id: v,
19
+ role: "group",
20
+ "aria-label": y,
21
+ "aria-labelledby": b,
22
+ "aria-describedby": x,
23
+ "aria-invalid": S,
24
+ "aria-required": C || void 0,
25
+ className: t(r.group, r[T], c === "chips" && r.chipsGroup, p && r.error, h?.group, g),
26
+ style: _,
27
+ children: e.map((e) => {
28
+ let s = o.includes(e.value), l = f || e.disabled;
29
+ return c === "chips" ? /* @__PURE__ */ a("button", {
30
+ type: "button",
31
+ role: "checkbox",
32
+ "aria-checked": s,
33
+ disabled: l,
34
+ className: t(r.chip, E, s && r.chipSelected, u && s && r.chipChecked, h?.option, h?.chip, s && h?.chipSelected),
35
+ onClick: () => D(e.value),
36
+ children: [u && /* @__PURE__ */ i("span", {
37
+ className: t(r.chipCheck, s && r.chipCheckVisible),
38
+ "aria-hidden": "true"
39
+ }), e.label]
40
+ }, e.value) : /* @__PURE__ */ i(n, {
41
+ name: m,
42
+ value: e.value,
43
+ label: e.label,
44
+ checked: s,
45
+ disabled: l,
46
+ className: t(r.option, h?.option),
47
+ onChange: () => D(e.value)
48
+ }, e.value);
49
+ })
50
+ });
51
+ });
52
+ o.displayName = "CheckboxGroup";
53
+ export { o as CheckboxGroup };