@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,8 +1,8 @@
1
- import e from "./Loader.module.js";
2
- import { forwardRef as t, useEffect as n, useLayoutEffect as r, useRef as i, useState as a } from "react";
1
+ import { forwardRef as e, useEffect as t, useLayoutEffect as n, useRef as r, useState as i } from "react";
2
+ import { createPortal as a } from "react-dom";
3
3
  import o from "clsx";
4
- import { jsx as s, jsxs as c } from "react/jsx-runtime";
5
- import { createPortal as l } from "react-dom";
4
+ import s from "./Loader.module.scss.js";
5
+ import { jsx as c, jsxs as l } from "react/jsx-runtime";
6
6
  // src/components/Loader/Loader.tsx
7
7
  var u = {
8
8
  dots: 3,
@@ -25,7 +25,7 @@ function d(e) {
25
25
  };
26
26
  }
27
27
  function f(e, t) {
28
- r(() => {
28
+ n(() => {
29
29
  let n = e.current;
30
30
  if (!t || !n) return;
31
31
  let r = 0, i = () => {
@@ -50,26 +50,26 @@ function f(e, t) {
50
50
  };
51
51
  }, [e, t]);
52
52
  }
53
- function p(e, t) {
54
- let [r, i] = a(e && t <= 0);
55
- return n(() => {
53
+ function p(e, n) {
54
+ let [r, a] = i(e && n <= 0);
55
+ return t(() => {
56
56
  if (!e) {
57
- i(!1);
57
+ a(!1);
58
58
  return;
59
59
  }
60
- if (t <= 0) {
61
- i(!0);
60
+ if (n <= 0) {
61
+ a(!0);
62
62
  return;
63
63
  }
64
- let n = setTimeout(() => i(!0), t);
65
- return () => clearTimeout(n);
66
- }, [e, t]), e && r;
64
+ let t = setTimeout(() => a(!0), n);
65
+ return () => clearTimeout(t);
66
+ }, [e, n]), e && r;
67
67
  }
68
- var m = t(({ variant: t = "dots", size: a = "md", mode: d = "inline", loading: m = !0, children: h, delay: g = 0, backdrop: _ = "dim", interactive: v = !1, color: y, label: b = "Loading", showLabel: x = !1, minHeight: S, classes: C, className: w, style: T, ...E }, D) => {
69
- let O = p(m, g), k = h != null, A = i(null), j = i(null), M = i(null), N = (e) => {
68
+ var m = e(({ variant: e = "dots", size: i = "md", mode: d = "inline", loading: m = !0, children: h, delay: g = 0, backdrop: _ = "dim", interactive: v = !1, color: y, label: b = "Loading", showLabel: x = !1, minHeight: S, classes: C, className: w, style: T, ...E }, D) => {
69
+ let O = p(m, g), k = h != null, A = r(null), j = r(null), M = r(null), N = (e) => {
70
70
  A.current = e, typeof D == "function" ? D(e) : D && (D.current = e);
71
71
  }, P = !k && d === "overlay" && O;
72
- r(() => {
72
+ n(() => {
73
73
  if (!P) return;
74
74
  let e = A.current?.parentElement;
75
75
  if (!e) return;
@@ -79,28 +79,28 @@ var m = t(({ variant: t = "dots", size: a = "md", mode: d = "inline", loading: m
79
79
  return r && (e.style.position = "relative"), () => {
80
80
  r && (e.style.position = i), t === null ? e.removeAttribute("aria-busy") : e.setAttribute("aria-busy", t);
81
81
  };
82
- }, [P]), f(k ? M : A, O && d !== "fullscreen" && (k || d === "overlay")), n(() => {
82
+ }, [P]), f(k ? M : A, O && d !== "fullscreen" && (k || d === "overlay")), t(() => {
83
83
  j.current?.toggleAttribute("inert", O && !v);
84
84
  }, [O, v]);
85
- let F = y ? { "--crk-loader-color": y } : void 0, I = typeof S == "number" ? `${S}px` : S, L = /* @__PURE__ */ c("span", {
85
+ let F = y ? { "--crk-loader-color": y } : void 0, I = typeof S == "number" ? `${S}px` : S, L = /* @__PURE__ */ l("span", {
86
86
  role: "status",
87
87
  "aria-live": "polite",
88
- className: o(e.indicator, C?.indicator),
89
- children: [/* @__PURE__ */ s("span", {
90
- className: o(e.glyph, e[t], C?.glyph),
88
+ className: o(s.indicator, C?.indicator),
89
+ children: [/* @__PURE__ */ c("span", {
90
+ className: o(s.glyph, s[e], C?.glyph),
91
91
  "aria-hidden": "true",
92
- children: Array.from({ length: u[t] }, (e, t) => /* @__PURE__ */ s("span", {}, t))
93
- }), b ? /* @__PURE__ */ s("span", {
94
- className: o(x ? e.label : e.srLabel, C?.label),
92
+ children: Array.from({ length: u[e] }, (e, t) => /* @__PURE__ */ c("span", {}, t))
93
+ }), b ? /* @__PURE__ */ c("span", {
94
+ className: o(x ? s.label : s.srLabel, C?.label),
95
95
  children: b
96
96
  }) : null]
97
97
  }), R = {
98
- dim: e.backdropDim,
99
- blur: e.backdropBlur,
98
+ dim: s.backdropDim,
99
+ blur: s.backdropBlur,
100
100
  none: void 0
101
- }[_], z = O && d === "fullscreen" && typeof document < "u" ? l(/* @__PURE__ */ s("div", {
101
+ }[_], z = O && d === "fullscreen" && typeof document < "u" ? a(/* @__PURE__ */ c("div", {
102
102
  ref: k ? void 0 : N,
103
- className: o(e.root, e[a], e.overlay, e.fullscreen, R, C?.overlay, !k && [C?.root, w]),
103
+ className: o(s.root, s[i], s.overlay, s.fullscreen, R, C?.overlay, !k && [C?.root, w]),
104
104
  style: k ? F : {
105
105
  ...F,
106
106
  ...T
@@ -108,9 +108,9 @@ var m = t(({ variant: t = "dots", size: a = "md", mode: d = "inline", loading: m
108
108
  ...k ? {} : E,
109
109
  children: L
110
110
  }), document.body) : null;
111
- return k ? /* @__PURE__ */ c("div", {
111
+ return k ? /* @__PURE__ */ l("div", {
112
112
  ref: N,
113
- className: o(e.root, e[a], e.wrap, O && e.wrapBusy, C?.root, w),
113
+ className: o(s.root, s[i], s.wrap, O && s.wrapBusy, C?.root, w),
114
114
  style: {
115
115
  ...F,
116
116
  ...O && I ? { minHeight: I } : null,
@@ -119,30 +119,30 @@ var m = t(({ variant: t = "dots", size: a = "md", mode: d = "inline", loading: m
119
119
  "aria-busy": m || void 0,
120
120
  ...E,
121
121
  children: [
122
- /* @__PURE__ */ s("div", {
122
+ /* @__PURE__ */ c("div", {
123
123
  ref: j,
124
- className: o(e.content, C?.content),
124
+ className: o(s.content, C?.content),
125
125
  children: h
126
126
  }),
127
- O && d !== "fullscreen" && /* @__PURE__ */ s("div", {
127
+ O && d !== "fullscreen" && /* @__PURE__ */ c("div", {
128
128
  ref: M,
129
- className: o(e.overlay, R, v && e.passThrough, C?.overlay),
129
+ className: o(s.overlay, R, v && s.passThrough, C?.overlay),
130
130
  children: L
131
131
  }),
132
132
  z
133
133
  ]
134
- }) : O ? d === "fullscreen" ? z : d === "overlay" ? /* @__PURE__ */ s("div", {
134
+ }) : O ? d === "fullscreen" ? z : d === "overlay" ? /* @__PURE__ */ c("div", {
135
135
  ref: N,
136
- className: o(e.root, e[a], e.overlay, R, C?.root, C?.overlay, w),
136
+ className: o(s.root, s[i], s.overlay, R, C?.root, C?.overlay, w),
137
137
  style: {
138
138
  ...F,
139
139
  ...T
140
140
  },
141
141
  ...E,
142
142
  children: L
143
- }) : /* @__PURE__ */ s("div", {
143
+ }) : /* @__PURE__ */ c("div", {
144
144
  ref: N,
145
- className: o(e.root, e[a], e.inline, C?.root, w),
145
+ className: o(s.root, s[i], s.inline, C?.root, w),
146
146
  style: {
147
147
  ...F,
148
148
  ...I ? { minHeight: I } : null,
@@ -1,26 +1,26 @@
1
- import { useFocusTrap as e } from "../../hooks/useFocusTrap.js";
2
- import { EscapeLayerProvider as t, useEscapeLayer as n } from "../../hooks/useEscapeLayer.js";
3
- import r from "./Modal.module.js";
4
- import { createContext as i, forwardRef as a, useContext as o, useEffect as s, useId as c, useRef as l } from "react";
5
- import u from "clsx";
6
- import { jsx as d, jsxs as f } from "react/jsx-runtime";
7
- import { createPortal as p } from "react-dom";
1
+ import { createContext as e, forwardRef as t, useContext as n, useEffect as r, useId as i, useRef as a } from "react";
2
+ import { createPortal as o } from "react-dom";
3
+ import s from "clsx";
4
+ import { useFocusTrap as c } from "../../hooks/useFocusTrap.js";
5
+ import { EscapeLayerProvider as l, useEscapeLayer as u } from "../../hooks/useEscapeLayer.js";
6
+ import d from "./Modal.module.scss.js";
7
+ import { jsx as f, jsxs as p } from "react/jsx-runtime";
8
8
  // src/components/Modal/Modal.tsx
9
- var m = i({
9
+ var m = e({
10
10
  classes: {},
11
11
  titleId: ""
12
- }), h = ({ children: e, className: t, style: n, onClose: i }) => {
13
- let { classes: a, titleId: s } = o(m);
14
- return /* @__PURE__ */ f("div", {
15
- className: u(r.header, i && r.headerWithClose, a.header, t),
16
- style: n,
17
- children: [/* @__PURE__ */ d("div", {
18
- id: s,
19
- className: u(r.headerTitle, a.headerTitle),
12
+ }), h = ({ children: e, className: t, style: r, onClose: i }) => {
13
+ let { classes: a, titleId: o } = n(m);
14
+ return /* @__PURE__ */ p("div", {
15
+ className: s(d.header, i && d.headerWithClose, a.header, t),
16
+ style: r,
17
+ children: [/* @__PURE__ */ f("div", {
18
+ id: o,
19
+ className: s(d.headerTitle, a.headerTitle),
20
20
  children: e
21
- }), i && /* @__PURE__ */ d("button", {
21
+ }), i && /* @__PURE__ */ f("button", {
22
22
  type: "button",
23
- className: u(r.closeButton, a.closeButton),
23
+ className: s(d.closeButton, a.closeButton),
24
24
  onClick: i,
25
25
  "aria-label": "Close",
26
26
  children: "×"
@@ -28,63 +28,63 @@ var m = i({
28
28
  });
29
29
  };
30
30
  h.displayName = "Modal.Header";
31
- var g = ({ children: e, className: t, style: n }) => {
32
- let { classes: i } = o(m);
33
- return /* @__PURE__ */ d("div", {
34
- className: u(r.body, i.body, t),
35
- style: n,
31
+ var g = ({ children: e, className: t, style: r }) => {
32
+ let { classes: i } = n(m);
33
+ return /* @__PURE__ */ f("div", {
34
+ className: s(d.body, i.body, t),
35
+ style: r,
36
36
  children: e
37
37
  });
38
38
  };
39
39
  g.displayName = "Modal.Body";
40
- var _ = ({ children: e, className: t, style: n }) => {
41
- let { classes: i } = o(m);
42
- return /* @__PURE__ */ d("div", {
43
- className: u(r.footer, i.footer, t),
44
- style: n,
40
+ var _ = ({ children: e, className: t, style: r }) => {
41
+ let { classes: i } = n(m);
42
+ return /* @__PURE__ */ f("div", {
43
+ className: s(d.footer, i.footer, t),
44
+ style: r,
45
45
  children: e
46
46
  });
47
47
  };
48
48
  _.displayName = "Modal.Footer";
49
- var v = a(({ open: i, onClose: a, closeOnBackdrop: o = !0, closeOnEscape: f = !0, size: h = "md", classes: g, className: _, style: v, children: y, "aria-label": b, "aria-labelledby": x }, S) => {
50
- let C = l(null), w = (e) => {
49
+ var v = t(({ open: e, onClose: t, closeOnBackdrop: n = !0, closeOnEscape: p = !0, size: h = "md", classes: g, className: _, style: v, children: y, "aria-label": b, "aria-labelledby": x }, S) => {
50
+ let C = a(null), w = (e) => {
51
51
  C.current = e, typeof S == "function" ? S(e) : S && (S.current = e);
52
- }, T = c(), E = x ?? `${T}-title`;
53
- e(C, i);
54
- let D = n(() => {
55
- f && a();
56
- }, i);
57
- s(() => {
58
- if (!i) return;
59
- let e = document.body.style.overflow;
52
+ }, T = i(), E = x ?? `${T}-title`;
53
+ c(C, e);
54
+ let D = u(() => {
55
+ p && t();
56
+ }, e);
57
+ r(() => {
58
+ if (!e) return;
59
+ let t = document.body.style.overflow;
60
60
  return document.body.style.overflow = "hidden", () => {
61
- document.body.style.overflow = e;
61
+ document.body.style.overflow = t;
62
62
  };
63
- }, [i]);
64
- let O = l(!1);
65
- return i ? p(/* @__PURE__ */ d("div", {
66
- className: u(r.backdrop, g?.backdrop),
63
+ }, [e]);
64
+ let O = a(!1);
65
+ return e ? o(/* @__PURE__ */ f("div", {
66
+ className: s(d.backdrop, g?.backdrop),
67
67
  onMouseDown: (e) => {
68
68
  O.current = e.target === e.currentTarget;
69
69
  },
70
70
  onMouseUp: (e) => {
71
- o && O.current && e.target === e.currentTarget && a(), O.current = !1;
71
+ n && O.current && e.target === e.currentTarget && t(), O.current = !1;
72
72
  },
73
73
  role: "presentation",
74
- children: /* @__PURE__ */ d("div", {
74
+ children: /* @__PURE__ */ f("div", {
75
75
  ref: w,
76
- className: u(r.modal, r[h], g?.modal, _),
76
+ className: s(d.modal, d[h], g?.modal, _),
77
77
  style: v,
78
78
  role: "dialog",
79
79
  "aria-modal": "true",
80
80
  "aria-label": b,
81
81
  "aria-labelledby": b ? void 0 : E,
82
- children: /* @__PURE__ */ d(m.Provider, {
82
+ children: /* @__PURE__ */ f(m.Provider, {
83
83
  value: {
84
84
  classes: g ?? {},
85
85
  titleId: E
86
86
  },
87
- children: /* @__PURE__ */ d(t, {
87
+ children: /* @__PURE__ */ f(l, {
88
88
  value: D,
89
89
  children: y
90
90
  })
@@ -1,6 +1,6 @@
1
- import e from "./PageHeader.module.js";
2
- import { createElement as t, forwardRef as n } from "react";
3
- import r from "clsx";
1
+ import { createElement as e, forwardRef as t } from "react";
2
+ import n from "clsx";
3
+ import r from "./PageHeader.module.scss.js";
4
4
  import { jsx as i, jsxs as a } from "react/jsx-runtime";
5
5
  // src/components/PageHeader/PageHeader.tsx
6
6
  var o = /* @__PURE__ */ i("svg", {
@@ -16,60 +16,60 @@ var o = /* @__PURE__ */ i("svg", {
16
16
  strokeLinecap: "round",
17
17
  strokeLinejoin: "round"
18
18
  })
19
- }), s = n(({ title: n, as: s = "h1", subtitle: c, description: l, actions: u, breadcrumbs: d, backHref: f, onBack: p, backLabel: m = "Back", badge: h, meta: g, tabs: _, divider: v = !0, size: y = "md", sticky: b = !1, classes: x, className: S, children: C, ...w }, T) => {
19
+ }), s = t(({ title: t, as: s = "h1", subtitle: c, description: l, actions: u, breadcrumbs: d, backHref: f, onBack: p, backLabel: m = "Back", badge: h, meta: g, tabs: _, divider: v = !0, size: y = "md", sticky: b = !1, classes: x, className: S, children: C, ...w }, T) => {
20
20
  let E = f === void 0 ? p ? /* @__PURE__ */ a("button", {
21
21
  type: "button",
22
22
  onClick: p,
23
- className: r(e.back, x?.back),
23
+ className: n(r.back, x?.back),
24
24
  children: [o, m]
25
25
  }) : null : /* @__PURE__ */ a("a", {
26
26
  href: f,
27
- className: r(e.back, x?.back),
27
+ className: n(r.back, x?.back),
28
28
  children: [o, m]
29
29
  });
30
30
  return /* @__PURE__ */ a("header", {
31
31
  ref: T,
32
- className: r(e.root, e[y], v && e.divider, b && e.sticky, _ && e.hasTabs, x?.root, S),
32
+ className: n(r.root, r[y], v && r.divider, b && r.sticky, _ && r.hasTabs, x?.root, S),
33
33
  ...w,
34
34
  children: [
35
35
  d && /* @__PURE__ */ i("div", {
36
- className: r(e.breadcrumbs, x?.breadcrumbs),
36
+ className: n(r.breadcrumbs, x?.breadcrumbs),
37
37
  children: d
38
38
  }),
39
39
  E,
40
40
  /* @__PURE__ */ a("div", {
41
- className: r(e.titleRow, x?.titleRow),
41
+ className: n(r.titleRow, x?.titleRow),
42
42
  children: [/* @__PURE__ */ a("div", {
43
- className: e.titleBlock,
43
+ className: r.titleBlock,
44
44
  children: [
45
45
  /* @__PURE__ */ a("div", {
46
- className: e.titleLine,
47
- children: [t(s, { className: r(e.title, x?.title) }, n), h && /* @__PURE__ */ i("span", {
48
- className: r(e.badge, x?.badge),
46
+ className: r.titleLine,
47
+ children: [e(s, { className: n(r.title, x?.title) }, t), h && /* @__PURE__ */ i("span", {
48
+ className: n(r.badge, x?.badge),
49
49
  children: h
50
50
  })]
51
51
  }),
52
52
  c && /* @__PURE__ */ i("p", {
53
- className: r(e.subtitle, x?.subtitle),
53
+ className: n(r.subtitle, x?.subtitle),
54
54
  children: c
55
55
  }),
56
56
  l && /* @__PURE__ */ i("p", {
57
- className: r(e.description, x?.description),
57
+ className: n(r.description, x?.description),
58
58
  children: l
59
59
  }),
60
60
  g && /* @__PURE__ */ i("div", {
61
- className: r(e.meta, x?.meta),
61
+ className: n(r.meta, x?.meta),
62
62
  children: g
63
63
  })
64
64
  ]
65
65
  }), u && /* @__PURE__ */ i("div", {
66
- className: r(e.actions, x?.actions),
66
+ className: n(r.actions, x?.actions),
67
67
  children: u
68
68
  })]
69
69
  }),
70
70
  C,
71
71
  _ && /* @__PURE__ */ i("div", {
72
- className: r(e.tabs, x?.tabs),
72
+ className: n(r.tabs, x?.tabs),
73
73
  children: _
74
74
  })
75
75
  ]
@@ -1,7 +1,7 @@
1
- import e from "./Pagination.module.js";
2
- import { paginationRange as t } from "./paginationRange.js";
3
- import { forwardRef as n, useState as r } from "react";
4
- import i from "clsx";
1
+ import { forwardRef as e, useState as t } from "react";
2
+ import n from "clsx";
3
+ import r from "./Pagination.module.scss.js";
4
+ import { paginationRange as i } from "./paginationRange.js";
5
5
  import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
6
6
  // src/components/Pagination/Pagination.tsx
7
7
  var c = ({ dir: e }) => /* @__PURE__ */ o("svg", {
@@ -18,41 +18,41 @@ var c = ({ dir: e }) => /* @__PURE__ */ o("svg", {
18
18
  first: /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ o("path", { d: "M8 2L4 6l4 4" }), /* @__PURE__ */ o("path", { d: "M4 2v8" })] }),
19
19
  last: /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ o("path", { d: "M4 2l4 4-4 4" }), /* @__PURE__ */ o("path", { d: "M8 2v8" })] })
20
20
  }[e]
21
- }), l = n(({ count: n, total: a, pageSize: l = 10, page: u, defaultPage: d = 1, onChange: f, boundaryCount: p = 1, siblingCount: m = 2, showPrevNext: h = !0, showFirstLast: g = !1, size: _ = "md", disabled: v = !1, label: y = "Pagination", classes: b, className: x, ...S }, C) => {
22
- let w = n ?? (a == null ? 1 : Math.max(1, Math.ceil(a / l))), T = u !== void 0, [E, D] = r(d), O = Math.min(Math.max(T ? u : E, 1), w), k = (e) => {
21
+ }), l = e(({ count: e, total: a, pageSize: l = 10, page: u, defaultPage: d = 1, onChange: f, boundaryCount: p = 1, siblingCount: m = 2, showPrevNext: h = !0, showFirstLast: g = !1, size: _ = "md", disabled: v = !1, label: y = "Pagination", classes: b, className: x, ...S }, C) => {
22
+ let w = e ?? (a == null ? 1 : Math.max(1, Math.ceil(a / l))), T = u !== void 0, [E, D] = t(d), O = Math.min(Math.max(T ? u : E, 1), w), k = (e) => {
23
23
  let t = Math.min(Math.max(e, 1), w);
24
24
  t !== O && (T || D(t), f?.(t));
25
- }, A = t(O, w, p, m), j = (t, n, r, a) => /* @__PURE__ */ o("li", { children: /* @__PURE__ */ o("button", {
25
+ }, A = i(O, w, p, m), j = (e, t, i, a) => /* @__PURE__ */ o("li", { children: /* @__PURE__ */ o("button", {
26
26
  type: "button",
27
- className: i(e.item, e.control, b?.item, b?.control),
28
- onClick: () => k(r),
29
- disabled: v || O === r || (n === "left" || n === "first" ? O === 1 : O === w),
27
+ className: n(r.item, r.control, b?.item, b?.control),
28
+ onClick: () => k(i),
29
+ disabled: v || O === i || (t === "left" || t === "first" ? O === 1 : O === w),
30
30
  "aria-label": a,
31
- children: /* @__PURE__ */ o(c, { dir: n })
32
- }) }, t);
31
+ children: /* @__PURE__ */ o(c, { dir: t })
32
+ }) }, e);
33
33
  return /* @__PURE__ */ o("nav", {
34
34
  ref: C,
35
35
  "aria-label": y,
36
- className: i(e.root, e[_], b?.root, x),
36
+ className: n(r.root, r[_], b?.root, x),
37
37
  ...S,
38
38
  children: /* @__PURE__ */ s("ul", {
39
- className: i(e.list, b?.list),
39
+ className: n(r.list, b?.list),
40
40
  children: [
41
41
  g && j("first", "first", 1, "Go to first page"),
42
42
  h && j("prev", "left", O - 1, "Go to previous page"),
43
- A.map((t, n) => t === "ellipsis" ? /* @__PURE__ */ o("li", {
43
+ A.map((e, t) => e === "ellipsis" ? /* @__PURE__ */ o("li", {
44
44
  "aria-hidden": "true",
45
- className: i(e.ellipsis, b?.ellipsis),
45
+ className: n(r.ellipsis, b?.ellipsis),
46
46
  children: "…"
47
- }, `e${n}`) : /* @__PURE__ */ o("li", { children: /* @__PURE__ */ o("button", {
47
+ }, `e${t}`) : /* @__PURE__ */ o("li", { children: /* @__PURE__ */ o("button", {
48
48
  type: "button",
49
- className: i(e.item, t === O && e.active, b?.item, t === O && b?.active),
50
- onClick: () => k(t),
49
+ className: n(r.item, e === O && r.active, b?.item, e === O && b?.active),
50
+ onClick: () => k(e),
51
51
  disabled: v,
52
- "aria-current": t === O ? "page" : void 0,
53
- "aria-label": `Go to page ${t}`,
54
- children: t
55
- }) }, t)),
52
+ "aria-current": e === O ? "page" : void 0,
53
+ "aria-label": `Go to page ${e}`,
54
+ children: e
55
+ }) }, e)),
56
56
  h && j("next", "right", O + 1, "Go to next page"),
57
57
  g && j("last", "last", w, "Go to last page")
58
58
  ]
@@ -1,8 +1,8 @@
1
- import e from "./Popover.module.js";
2
- import { useClickOutside as t } from "../../hooks/useClickOutside.js";
3
- import { EscapeLayerProvider as n, useEscapeLayer as r } from "../../hooks/useEscapeLayer.js";
4
- import { cloneElement as i, forwardRef as a, isValidElement as o, useCallback as s, useEffect as c, useId as l, useLayoutEffect as u, useRef as d, useState as f } from "react";
5
- import p from "clsx";
1
+ import { cloneElement as e, forwardRef as t, isValidElement as n, useCallback as r, useEffect as i, useId as a, useLayoutEffect as o, useRef as s, useState as c } from "react";
2
+ import l from "clsx";
3
+ import u from "./Popover.module.scss.js";
4
+ import { useClickOutside as d } from "../../hooks/useClickOutside.js";
5
+ import { EscapeLayerProvider as f, useEscapeLayer as p } from "../../hooks/useEscapeLayer.js";
6
6
  import { jsx as m, jsxs as h } from "react/jsx-runtime";
7
7
  // src/components/Popover/Popover.tsx
8
8
  function g(...e) {
@@ -10,17 +10,17 @@ function g(...e) {
10
10
  for (let n of e) n && (typeof n == "function" ? n(t) : n.current = t);
11
11
  };
12
12
  }
13
- var _ = a(({ trigger: a, asChild: _ = !1, content: v, position: y = "bottom", autoPosition: b = !0, open: x, onOpenChange: S, classes: C, className: w, style: T }, E) => {
14
- let [D, O] = f(!1), [k, A] = f(y), [j, M] = f(0), [N, P] = f(0), F = d(null), I = d(null), L = d(null), R = l(), z = x !== void 0, B = z ? x : D, V = s((e) => {
13
+ var _ = t(({ trigger: t, asChild: _ = !1, content: v, position: y = "bottom", autoPosition: b = !0, open: x, onOpenChange: S, classes: C, className: w, style: T }, E) => {
14
+ let [D, O] = c(!1), [k, A] = c(y), [j, M] = c(0), [N, P] = c(0), F = s(null), I = s(null), L = s(null), R = a(), z = x !== void 0, B = z ? x : D, V = r((e) => {
15
15
  z || O(e), S?.(e);
16
- }, [z, S]), H = s(() => {
16
+ }, [z, S]), H = r(() => {
17
17
  V(!1), L.current?.focus();
18
- }, [V]), U = s(() => {
18
+ }, [V]), U = r(() => {
19
19
  V(!B);
20
20
  }, [B, V]);
21
- t(F, H, B);
22
- let W = r(H, B);
23
- u(() => {
21
+ d(F, H, B);
22
+ let W = p(H, B);
23
+ o(() => {
24
24
  if (!B || !b) {
25
25
  A(y), M(0), P(0);
26
26
  return;
@@ -54,21 +54,21 @@ var _ = a(({ trigger: a, asChild: _ = !1, content: v, position: y = "bottom", au
54
54
  B,
55
55
  b,
56
56
  y
57
- ]), c(() => {
57
+ ]), i(() => {
58
58
  if (B && I.current) {
59
59
  let e = I.current.querySelector("button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])");
60
60
  e ? e.focus() : I.current.focus();
61
61
  }
62
62
  }, [B]);
63
63
  let G;
64
- if (_ && o(a)) {
65
- let e = a, t = e.ref;
66
- G = i(e, {
67
- ref: g(L, t),
68
- onClick: (t) => {
69
- e.props.onClick?.(t), U();
64
+ if (_ && n(t)) {
65
+ let n = t, r = n.ref;
66
+ G = e(n, {
67
+ ref: g(L, r),
68
+ onClick: (e) => {
69
+ n.props.onClick?.(e), U();
70
70
  },
71
- className: p(e.props.className, C?.trigger),
71
+ className: l(n.props.className, C?.trigger),
72
72
  "aria-expanded": B,
73
73
  "aria-haspopup": "dialog",
74
74
  "aria-controls": B ? R : void 0
@@ -76,16 +76,16 @@ var _ = a(({ trigger: a, asChild: _ = !1, content: v, position: y = "bottom", au
76
76
  } else G = /* @__PURE__ */ m("button", {
77
77
  ref: L,
78
78
  type: "button",
79
- className: p(e.trigger, C?.trigger),
79
+ className: l(u.trigger, C?.trigger),
80
80
  onClick: U,
81
81
  "aria-expanded": B,
82
82
  "aria-haspopup": "dialog",
83
83
  "aria-controls": B ? R : void 0,
84
- children: a
84
+ children: t
85
85
  });
86
86
  return /* @__PURE__ */ m("div", {
87
87
  ref: E,
88
- className: p(e.root, C?.root, w),
88
+ className: l(u.root, C?.root, w),
89
89
  style: T,
90
90
  children: /* @__PURE__ */ h("div", {
91
91
  ref: F,
@@ -94,12 +94,12 @@ var _ = a(({ trigger: a, asChild: _ = !1, content: v, position: y = "bottom", au
94
94
  id: R,
95
95
  role: "dialog",
96
96
  tabIndex: -1,
97
- className: p(e.popover, e[b ? k : y], C?.popover),
97
+ className: l(u.popover, u[b ? k : y], C?.popover),
98
98
  style: b ? {
99
99
  "--crk-popover-shift-x": `${j}px`,
100
100
  "--crk-popover-shift-y": `${N}px`
101
101
  } : void 0,
102
- children: /* @__PURE__ */ m(n, {
102
+ children: /* @__PURE__ */ m(f, {
103
103
  value: W,
104
104
  children: v
105
105
  })
@@ -1,10 +1,10 @@
1
- import e from "./ProgressBar.module.js";
2
- import { forwardRef as t, useMemo as n } from "react";
3
- import r from "clsx";
1
+ import { forwardRef as e, useMemo as t } from "react";
2
+ import n from "clsx";
3
+ import r from "./ProgressBar.module.scss.js";
4
4
  import { jsx as i, jsxs as a } from "react/jsx-runtime";
5
5
  // src/components/ProgressBar/ProgressBar.tsx
6
- var o = (e, t) => `${Math.round(e / t * 100)}%`, s = (e, t) => `Step ${e + 1} of ${t}`, c = t(({ value: t, max: c = 100, label: l, showValue: u = !1, formatValue: d = o, size: f = "md", variant: p = "primary", thresholds: m, segments: h, showCurrent: g = !1, shape: _ = "rounded", onSegmentClick: v, segmentLabel: y = s, classes: b, className: x, style: S, "aria-label": C, "aria-labelledby": w, ...T }, E) => {
7
- let D = c > 0 ? c : 100, O = t === void 0 || Number.isNaN(t), k = O ? 0 : Math.min(D, Math.max(0, t)), A = k / D, j = n(() => {
6
+ var o = (e, t) => `${Math.round(e / t * 100)}%`, s = (e, t) => `Step ${e + 1} of ${t}`, c = e(({ value: e, max: c = 100, label: l, showValue: u = !1, formatValue: d = o, size: f = "md", variant: p = "primary", thresholds: m, segments: h, showCurrent: g = !1, shape: _ = "rounded", onSegmentClick: v, segmentLabel: y = s, classes: b, className: x, style: S, "aria-label": C, "aria-labelledby": w, ...T }, E) => {
7
+ let D = c > 0 ? c : 100, O = e === void 0 || Number.isNaN(e), k = O ? 0 : Math.min(D, Math.max(0, e)), A = k / D, j = t(() => {
8
8
  if (O || !m?.length) return p;
9
9
  let e = [...m].sort((e, t) => e.value - t.value), t = p;
10
10
  for (let n of e) n.value <= k && (t = n.variant);
@@ -17,16 +17,16 @@ var o = (e, t) => `${Math.round(e / t * 100)}%`, s = (e, t) => `Step ${e + 1} of
17
17
  ]), M = !O && typeof h == "number" && h > 1, N = M ? Math.round(A * h) : 0, P = M && g && N < h ? N : -1, F = M && typeof v == "function", I = l != null && l !== !1, L = I || u && !O;
18
18
  return /* @__PURE__ */ a("div", {
19
19
  ref: E,
20
- className: r(e.root, e[f], e[j], _ === "square" && e.square, b?.root, x),
20
+ className: n(r.root, r[f], r[j], _ === "square" && r.square, b?.root, x),
21
21
  style: S,
22
22
  ...T,
23
23
  children: [L && /* @__PURE__ */ a("div", {
24
- className: r(e.header, b?.header),
24
+ className: n(r.header, b?.header),
25
25
  children: [I && /* @__PURE__ */ i("span", {
26
- className: r(e.label, b?.label),
26
+ className: n(r.label, b?.label),
27
27
  children: l
28
28
  }), u && !O && /* @__PURE__ */ i("span", {
29
- className: r(e.value, b?.value),
29
+ className: n(r.value, b?.value),
30
30
  children: d(k, D)
31
31
  })]
32
32
  }), /* @__PURE__ */ i("div", {
@@ -36,18 +36,18 @@ var o = (e, t) => `${Math.round(e / t * 100)}%`, s = (e, t) => `Step ${e + 1} of
36
36
  "aria-valuenow": F || O ? void 0 : k,
37
37
  "aria-label": C ?? (typeof l == "string" ? l : void 0),
38
38
  "aria-labelledby": w,
39
- className: r(e.track, O && e.indeterminate, M && e.segmented, F && e.clickable, b?.track),
40
- children: M ? Array.from({ length: h }, (t, n) => {
41
- let a = r(e.segment, n < N && e.segmentFilled, n === P && e.segmentCurrent, b?.segment, n < N && b?.segmentFilled, n === P && b?.segmentCurrent);
39
+ className: n(r.track, O && r.indeterminate, M && r.segmented, F && r.clickable, b?.track),
40
+ children: M ? Array.from({ length: h }, (e, t) => {
41
+ let a = n(r.segment, t < N && r.segmentFilled, t === P && r.segmentCurrent, b?.segment, t < N && b?.segmentFilled, t === P && b?.segmentCurrent);
42
42
  return F ? /* @__PURE__ */ i("button", {
43
43
  type: "button",
44
44
  className: a,
45
- "aria-label": y(n, h),
46
- "aria-current": n === P ? "step" : void 0,
47
- onClick: (e) => v?.(n, e)
48
- }, n) : /* @__PURE__ */ i("span", { className: a }, n);
45
+ "aria-label": y(t, h),
46
+ "aria-current": t === P ? "step" : void 0,
47
+ onClick: (e) => v?.(t, e)
48
+ }, t) : /* @__PURE__ */ i("span", { className: a }, t);
49
49
  }) : /* @__PURE__ */ i("span", {
50
- className: r(e.fill, b?.fill),
50
+ className: n(r.fill, b?.fill),
51
51
  style: O ? void 0 : { width: `${A * 100}%` }
52
52
  })
53
53
  })]