@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,186 +1,156 @@
1
- import { jsxs as V, jsx as m } from "react/jsx-runtime";
2
- import { forwardRef as D, useRef as P, useLayoutEffect as Y, useEffect as _, useState as $ } from "react";
3
- import { createPortal as q } from "react-dom";
4
- import c from "clsx";
5
- import t from "./Loader.module.scss.js";
6
- const G = {
7
- dots: 3,
8
- pulse: 3,
9
- spinner: 1,
10
- grid: 9,
11
- morph: 2
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
+ import o from "clsx";
4
+ import s from "./Loader.module.scss.js";
5
+ import { jsx as c, jsxs as l } from "react/jsx-runtime";
6
+ // src/components/Loader/Loader.tsx
7
+ var u = {
8
+ dots: 3,
9
+ pulse: 3,
10
+ spinner: 1,
11
+ grid: 9,
12
+ morph: 2
12
13
  };
13
- function I(l) {
14
- const o = l.getBoundingClientRect();
15
- let e = Math.max(o.top, 0), r = Math.min(o.bottom, window.innerHeight);
16
- for (let n = l.parentElement; n && n !== document.body; n = n.parentElement) {
17
- const u = getComputedStyle(n).overflowY;
18
- if (u === "visible" || u === "") continue;
19
- const v = n.getBoundingClientRect();
20
- e = Math.max(e, v.top), r = Math.min(r, v.bottom);
21
- }
22
- return { top: e, bottom: r };
14
+ function d(e) {
15
+ let t = e.getBoundingClientRect(), n = Math.max(t.top, 0), r = Math.min(t.bottom, window.innerHeight);
16
+ for (let t = e.parentElement; t && t !== document.body; t = t.parentElement) {
17
+ let e = getComputedStyle(t).overflowY;
18
+ if (e === "visible" || e === "") continue;
19
+ let i = t.getBoundingClientRect();
20
+ n = Math.max(n, i.top), r = Math.min(r, i.bottom);
21
+ }
22
+ return {
23
+ top: n,
24
+ bottom: r
25
+ };
23
26
  }
24
- function z(l, o) {
25
- Y(() => {
26
- const e = l.current;
27
- if (!o || !e) return;
28
- let r = 0;
29
- const n = () => {
30
- r = 0;
31
- const f = e.getBoundingClientRect(), b = e.firstElementChild, { top: h, bottom: g } = I(e);
32
- let d = 0;
33
- if (g > h && f.height > 0) {
34
- d = (h + g) / 2 - (f.top + f.bottom) / 2;
35
- const i = Math.max(0, f.height / 2 - (b?.offsetHeight ?? 0) / 2 - 8);
36
- d = Math.max(-i, Math.min(i, d));
37
- }
38
- e.style.setProperty("--_shift-y", `${Math.round(d)}px`);
39
- }, u = () => {
40
- r || (r = requestAnimationFrame(n));
41
- };
42
- n(), window.addEventListener("scroll", u, { capture: !0, passive: !0 }), window.addEventListener("resize", u);
43
- const v = new ResizeObserver(u);
44
- return v.observe(e), () => {
45
- r && cancelAnimationFrame(r), window.removeEventListener("scroll", u, { capture: !0 }), window.removeEventListener("resize", u), v.disconnect();
46
- };
47
- }, [l, o]);
27
+ function f(e, t) {
28
+ n(() => {
29
+ let n = e.current;
30
+ if (!t || !n) return;
31
+ let r = 0, i = () => {
32
+ r = 0;
33
+ let e = n.getBoundingClientRect(), t = n.firstElementChild, { top: i, bottom: a } = d(n), o = 0;
34
+ if (a > i && e.height > 0) {
35
+ o = (i + a) / 2 - (e.top + e.bottom) / 2;
36
+ let n = Math.max(0, e.height / 2 - (t?.offsetHeight ?? 0) / 2 - 8);
37
+ o = Math.max(-n, Math.min(n, o));
38
+ }
39
+ n.style.setProperty("--_shift-y", `${Math.round(o)}px`);
40
+ }, a = () => {
41
+ r ||= requestAnimationFrame(i);
42
+ };
43
+ i(), window.addEventListener("scroll", a, {
44
+ capture: !0,
45
+ passive: !0
46
+ }), window.addEventListener("resize", a);
47
+ let o = new ResizeObserver(a);
48
+ return o.observe(n), () => {
49
+ r && cancelAnimationFrame(r), window.removeEventListener("scroll", a, { capture: !0 }), window.removeEventListener("resize", a), o.disconnect();
50
+ };
51
+ }, [e, t]);
48
52
  }
49
- function J(l, o) {
50
- const [e, r] = $(l && o <= 0);
51
- return _(() => {
52
- if (!l) {
53
- r(!1);
54
- return;
55
- }
56
- if (o <= 0) {
57
- r(!0);
58
- return;
59
- }
60
- const n = setTimeout(() => r(!0), o);
61
- return () => clearTimeout(n);
62
- }, [l, o]), l && e;
53
+ function p(e, n) {
54
+ let [r, a] = i(e && n <= 0);
55
+ return t(() => {
56
+ if (!e) {
57
+ a(!1);
58
+ return;
59
+ }
60
+ if (n <= 0) {
61
+ a(!0);
62
+ return;
63
+ }
64
+ let t = setTimeout(() => a(!0), n);
65
+ return () => clearTimeout(t);
66
+ }, [e, n]), e && r;
63
67
  }
64
- const K = D(
65
- ({
66
- variant: l = "dots",
67
- size: o = "md",
68
- mode: e = "inline",
69
- loading: r = !0,
70
- children: n,
71
- delay: u = 0,
72
- backdrop: v = "dim",
73
- interactive: f = !1,
74
- color: b,
75
- label: h = "Loading",
76
- showLabel: g = !1,
77
- minHeight: d,
78
- classes: i,
79
- className: w,
80
- style: x,
81
- ...E
82
- }, L) => {
83
- const a = J(r, u), p = n != null, N = P(null), S = P(null), k = P(null), R = (s) => {
84
- N.current = s, typeof L == "function" ? L(s) : L && (L.current = s);
85
- }, H = !p && e === "overlay" && a;
86
- Y(() => {
87
- if (!H) return;
88
- const s = N.current?.parentElement;
89
- if (!s) return;
90
- const M = s.getAttribute("aria-busy");
91
- s.setAttribute("aria-busy", "true");
92
- const F = getComputedStyle(s).position, O = F === "static" || F === "", j = s.style.position;
93
- return O && (s.style.position = "relative"), () => {
94
- O && (s.style.position = j), M === null ? s.removeAttribute("aria-busy") : s.setAttribute("aria-busy", M);
95
- };
96
- }, [H]), z(p ? k : N, a && e !== "fullscreen" && (p || e === "overlay")), _(() => {
97
- S.current?.toggleAttribute("inert", a && !f);
98
- }, [a, f]);
99
- const y = b ? { "--crk-loader-color": b } : void 0, A = typeof d == "number" ? `${d}px` : d, C = /* @__PURE__ */ V(
100
- "span",
101
- {
102
- role: "status",
103
- "aria-live": "polite",
104
- className: c(t.indicator, i?.indicator),
105
- children: [
106
- /* @__PURE__ */ m("span", { className: c(t.glyph, t[l], i?.glyph), "aria-hidden": "true", children: Array.from({ length: G[l] }, (s, M) => /* @__PURE__ */ m("span", {}, M)) }),
107
- h ? /* @__PURE__ */ m("span", { className: c(g ? t.label : t.srLabel, i?.label), children: h }) : null
108
- ]
109
- }
110
- ), B = {
111
- dim: t.backdropDim,
112
- blur: t.backdropBlur,
113
- none: void 0
114
- }[v], T = a && e === "fullscreen" && typeof document < "u" ? q(
115
- /* @__PURE__ */ m(
116
- "div",
117
- {
118
- ref: p ? void 0 : R,
119
- className: c(
120
- // Portaled out of the wrapper, so it carries the tokens itself.
121
- t.root,
122
- t[o],
123
- t.overlay,
124
- t.fullscreen,
125
- B,
126
- i?.overlay,
127
- !p && [i?.root, w]
128
- ),
129
- style: p ? y : { ...y, ...x },
130
- ...p ? {} : E,
131
- children: C
132
- }
133
- ),
134
- document.body
135
- ) : null;
136
- return p ? /* @__PURE__ */ V(
137
- "div",
138
- {
139
- ref: R,
140
- className: c(t.root, t[o], t.wrap, a && t.wrapBusy, i?.root, w),
141
- style: { ...y, ...a && A ? { minHeight: A } : null, ...x },
142
- "aria-busy": r || void 0,
143
- ...E,
144
- children: [
145
- /* @__PURE__ */ m("div", { ref: S, className: c(t.content, i?.content), children: n }),
146
- a && e !== "fullscreen" && /* @__PURE__ */ m(
147
- "div",
148
- {
149
- ref: k,
150
- className: c(
151
- t.overlay,
152
- B,
153
- f && t.passThrough,
154
- i?.overlay
155
- ),
156
- children: C
157
- }
158
- ),
159
- T
160
- ]
161
- }
162
- ) : a ? e === "fullscreen" ? T : e === "overlay" ? /* @__PURE__ */ m(
163
- "div",
164
- {
165
- ref: R,
166
- className: c(t.root, t[o], t.overlay, B, i?.root, i?.overlay, w),
167
- style: { ...y, ...x },
168
- ...E,
169
- children: C
170
- }
171
- ) : /* @__PURE__ */ m(
172
- "div",
173
- {
174
- ref: R,
175
- className: c(t.root, t[o], t.inline, i?.root, w),
176
- style: { ...y, ...A ? { minHeight: A } : null, ...x },
177
- ...E,
178
- children: C
179
- }
180
- ) : null;
181
- }
182
- );
183
- K.displayName = "Loader";
184
- export {
185
- K as Loader
186
- };
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
+ A.current = e, typeof D == "function" ? D(e) : D && (D.current = e);
71
+ }, P = !k && d === "overlay" && O;
72
+ n(() => {
73
+ if (!P) return;
74
+ let e = A.current?.parentElement;
75
+ if (!e) return;
76
+ let t = e.getAttribute("aria-busy");
77
+ e.setAttribute("aria-busy", "true");
78
+ let n = getComputedStyle(e).position, r = n === "static" || n === "", i = e.style.position;
79
+ return r && (e.style.position = "relative"), () => {
80
+ r && (e.style.position = i), t === null ? e.removeAttribute("aria-busy") : e.setAttribute("aria-busy", t);
81
+ };
82
+ }, [P]), f(k ? M : A, O && d !== "fullscreen" && (k || d === "overlay")), t(() => {
83
+ j.current?.toggleAttribute("inert", O && !v);
84
+ }, [O, v]);
85
+ let F = y ? { "--crk-loader-color": y } : void 0, I = typeof S == "number" ? `${S}px` : S, L = /* @__PURE__ */ l("span", {
86
+ role: "status",
87
+ "aria-live": "polite",
88
+ className: o(s.indicator, C?.indicator),
89
+ children: [/* @__PURE__ */ c("span", {
90
+ className: o(s.glyph, s[e], C?.glyph),
91
+ "aria-hidden": "true",
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
+ children: b
96
+ }) : null]
97
+ }), R = {
98
+ dim: s.backdropDim,
99
+ blur: s.backdropBlur,
100
+ none: void 0
101
+ }[_], z = O && d === "fullscreen" && typeof document < "u" ? a(/* @__PURE__ */ c("div", {
102
+ ref: k ? void 0 : N,
103
+ className: o(s.root, s[i], s.overlay, s.fullscreen, R, C?.overlay, !k && [C?.root, w]),
104
+ style: k ? F : {
105
+ ...F,
106
+ ...T
107
+ },
108
+ ...k ? {} : E,
109
+ children: L
110
+ }), document.body) : null;
111
+ return k ? /* @__PURE__ */ l("div", {
112
+ ref: N,
113
+ className: o(s.root, s[i], s.wrap, O && s.wrapBusy, C?.root, w),
114
+ style: {
115
+ ...F,
116
+ ...O && I ? { minHeight: I } : null,
117
+ ...T
118
+ },
119
+ "aria-busy": m || void 0,
120
+ ...E,
121
+ children: [
122
+ /* @__PURE__ */ c("div", {
123
+ ref: j,
124
+ className: o(s.content, C?.content),
125
+ children: h
126
+ }),
127
+ O && d !== "fullscreen" && /* @__PURE__ */ c("div", {
128
+ ref: M,
129
+ className: o(s.overlay, R, v && s.passThrough, C?.overlay),
130
+ children: L
131
+ }),
132
+ z
133
+ ]
134
+ }) : O ? d === "fullscreen" ? z : d === "overlay" ? /* @__PURE__ */ c("div", {
135
+ ref: N,
136
+ className: o(s.root, s[i], s.overlay, R, C?.root, C?.overlay, w),
137
+ style: {
138
+ ...F,
139
+ ...T
140
+ },
141
+ ...E,
142
+ children: L
143
+ }) : /* @__PURE__ */ c("div", {
144
+ ref: N,
145
+ className: o(s.root, s[i], s.inline, C?.root, w),
146
+ style: {
147
+ ...F,
148
+ ...I ? { minHeight: I } : null,
149
+ ...T
150
+ },
151
+ ...E,
152
+ children: L
153
+ }) : null;
154
+ });
155
+ m.displayName = "Loader";
156
+ export { m as Loader };
@@ -1,70 +1,40 @@
1
- const r = "crk-root-u1D7u", o = "crk-sm-M6Sb3", c = "crk-md-5c9sz", e = "crk-lg-PaoKK", t = "crk-inline-neVjU", a = "crk-wrap-BaBNd", k = "crk-wrapBusy-a4D7Z", l = "crk-content-bw8zV", n = "crk-overlay-B-AIp", s = "crk-crk-loader-enter-VxXmo", d = "crk-indicator-LqmYc", p = "crk-fullscreen-BXAhh", h = "crk-backdropDim-JqArB", u = "crk-backdropBlur-wV2vo", i = "crk-passThrough-NCa9b", b = "crk-glyph-L8nf5", L = "crk-label-yMjMY", m = "crk-srLabel-PDGoC", B = "crk-dots-KfhUo", g = "crk-pulse-wPxve", y = "crk-crk-loader-dot-bounce-NtrLY", D = "crk-crk-loader-dot-pulse-AolCU", w = "crk-spinner-xG6h2", C = "crk-crk-loader-rotate-yVTPr", A = "crk-grid-5nFwV", V = "crk-crk-loader-cell-A7li4", v = "crk-morph-DAgji", x = "crk-crk-loader-morph-1hxzv", P = "crk-crk-loader-breathe-RCpGC", f = {
2
- root: r,
3
- sm: o,
4
- md: c,
5
- lg: e,
6
- inline: t,
7
- wrap: a,
8
- wrapBusy: k,
9
- content: l,
10
- overlay: n,
11
- "crk-loader-enter": "crk-crk-loader-enter-VxXmo",
12
- crkLoaderEnter: s,
13
- indicator: d,
14
- fullscreen: p,
15
- backdropDim: h,
16
- backdropBlur: u,
17
- passThrough: i,
18
- glyph: b,
19
- label: L,
20
- srLabel: m,
21
- dots: B,
22
- pulse: g,
23
- "crk-loader-dot-bounce": "crk-crk-loader-dot-bounce-NtrLY",
24
- crkLoaderDotBounce: y,
25
- "crk-loader-dot-pulse": "crk-crk-loader-dot-pulse-AolCU",
26
- crkLoaderDotPulse: D,
27
- spinner: w,
28
- "crk-loader-rotate": "crk-crk-loader-rotate-yVTPr",
29
- crkLoaderRotate: C,
30
- grid: A,
31
- "crk-loader-cell": "crk-crk-loader-cell-A7li4",
32
- crkLoaderCell: V,
33
- morph: v,
34
- "crk-loader-morph": "crk-crk-loader-morph-1hxzv",
35
- crkLoaderMorph: x,
36
- "crk-loader-breathe": "crk-crk-loader-breathe-RCpGC",
37
- crkLoaderBreathe: P
38
- };
39
- export {
40
- u as backdropBlur,
41
- h as backdropDim,
42
- l as content,
43
- P as crkLoaderBreathe,
44
- V as crkLoaderCell,
45
- y as crkLoaderDotBounce,
46
- D as crkLoaderDotPulse,
47
- s as crkLoaderEnter,
48
- x as crkLoaderMorph,
49
- C as crkLoaderRotate,
50
- f as default,
51
- B as dots,
52
- p as fullscreen,
53
- b as glyph,
54
- A as grid,
55
- d as indicator,
56
- t as inline,
57
- L as label,
58
- e as lg,
59
- c as md,
60
- v as morph,
61
- n as overlay,
62
- i as passThrough,
63
- g as pulse,
64
- r as root,
65
- o as sm,
66
- w as spinner,
67
- m as srLabel,
68
- a as wrap,
69
- k as wrapBusy
1
+ // src/components/Loader/Loader.module.scss
2
+ var e = "crk-root-u1D7u", t = "crk-sm-M6Sb3", n = "crk-md-5c9sz", r = "crk-lg-PaoKK", i = "crk-inline-neVjU", a = "crk-wrap-BaBNd", o = "crk-wrapBusy-a4D7Z", s = "crk-content-bw8zV", c = "crk-overlay-B-AIp", l = "crk-crk-loader-enter-VxXmo", u = "crk-indicator-LqmYc", d = "crk-fullscreen-BXAhh", f = "crk-backdropDim-JqArB", p = "crk-backdropBlur-wV2vo", m = "crk-passThrough-NCa9b", h = "crk-glyph-L8nf5", g = "crk-label-yMjMY", _ = "crk-srLabel-PDGoC", v = "crk-dots-KfhUo", y = "crk-pulse-wPxve", b = "crk-crk-loader-dot-bounce-NtrLY", x = "crk-crk-loader-dot-pulse-AolCU", S = "crk-spinner-xG6h2", C = "crk-crk-loader-rotate-yVTPr", w = "crk-grid-5nFwV", T = "crk-crk-loader-cell-A7li4", E = "crk-morph-DAgji", D = "crk-crk-loader-morph-1hxzv", O = "crk-crk-loader-breathe-RCpGC", k = {
3
+ root: e,
4
+ sm: t,
5
+ md: n,
6
+ lg: r,
7
+ inline: i,
8
+ wrap: a,
9
+ wrapBusy: o,
10
+ content: s,
11
+ overlay: c,
12
+ "crk-loader-enter": "crk-crk-loader-enter-VxXmo",
13
+ crkLoaderEnter: l,
14
+ indicator: u,
15
+ fullscreen: d,
16
+ backdropDim: f,
17
+ backdropBlur: p,
18
+ passThrough: m,
19
+ glyph: h,
20
+ label: g,
21
+ srLabel: _,
22
+ dots: v,
23
+ pulse: y,
24
+ "crk-loader-dot-bounce": "crk-crk-loader-dot-bounce-NtrLY",
25
+ crkLoaderDotBounce: b,
26
+ "crk-loader-dot-pulse": "crk-crk-loader-dot-pulse-AolCU",
27
+ crkLoaderDotPulse: x,
28
+ spinner: S,
29
+ "crk-loader-rotate": "crk-crk-loader-rotate-yVTPr",
30
+ crkLoaderRotate: C,
31
+ grid: w,
32
+ "crk-loader-cell": "crk-crk-loader-cell-A7li4",
33
+ crkLoaderCell: T,
34
+ morph: E,
35
+ "crk-loader-morph": "crk-crk-loader-morph-1hxzv",
36
+ crkLoaderMorph: D,
37
+ "crk-loader-breathe": "crk-crk-loader-breathe-RCpGC",
38
+ crkLoaderBreathe: O
70
39
  };
40
+ export { p as backdropBlur, f as backdropDim, s as content, O as crkLoaderBreathe, T as crkLoaderCell, b as crkLoaderDotBounce, x as crkLoaderDotPulse, l as crkLoaderEnter, D as crkLoaderMorph, C as crkLoaderRotate, k as default, v as dots, d as fullscreen, h as glyph, w as grid, u as indicator, i as inline, g as label, r as lg, n as md, E as morph, c as overlay, m as passThrough, y as pulse, e as root, t as sm, S as spinner, _ as srLabel, a as wrap, o as wrapBusy };