@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,196 +1,149 @@
1
- import { jsxs as N, jsx as r } from "react/jsx-runtime";
2
- import { forwardRef as Y, useState as Z, useRef as L, useId as $, useEffect as q, useCallback as F } from "react";
3
- import { createPortal as ee } from "react-dom";
4
- import i from "clsx";
5
- import t from "./SplitButton.module.scss.js";
6
- import h from "../Button/Button.module.scss.js";
7
- import { useEscapeLayer as te, EscapeLayerProvider as ne } from "../../hooks/useEscapeLayer.js";
8
- import { usePortalPosition as re } from "../../hooks/usePortalPosition.js";
9
- const oe = Y(
10
- ({
11
- actions: g,
12
- variant: b = "secondary",
13
- size: S = "md",
14
- disabled: O = !1,
15
- align: v = "right",
16
- portal: y = !0,
17
- menuLabel: G = "More actions",
18
- maxWidth: k,
19
- className: H,
20
- style: w,
21
- id: x,
22
- onOpen: I,
23
- onClose: c,
24
- classes: s
25
- }, J) => {
26
- const [n, E] = Z(!1), C = L(null), u = L(null), R = L(null), M = $();
27
- q(() => {
28
- n && u.current && u.current.querySelector('[role="menuitem"]:not([disabled])')?.focus();
29
- }, [n]);
30
- const f = F(() => {
31
- E(!1), c?.(), R.current?.focus();
32
- }, [c]), K = F(() => {
33
- E((e) => {
34
- const l = !e;
35
- return l ? I?.() : c?.(), l;
36
- });
37
- }, [I, c]);
38
- q(() => {
39
- if (!n) return;
40
- const e = (l) => {
41
- const m = l.target;
42
- C.current?.contains(m) || u.current?.contains(m) || f();
43
- };
44
- return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
45
- }, [n, f]);
46
- const Q = te(f, n), d = re(C, n && y);
47
- if (g.length === 0) return null;
48
- const [o, ...P] = g, a = P.length > 0, z = O || o.disabled, B = i(h.root, h[b], h[S]), T = b === "secondary" ? t.overlapOutline : b === "ghost" ? t.dividerSubtle : t.dividerOnFill, j = i(
49
- B,
50
- t.main,
51
- a && t.mainAttached,
52
- a && n && t.mainOpen,
53
- s?.main
54
- ), p = (e) => k !== void 0 && (typeof e == "string" || typeof e == "number") ? String(e) : void 0, D = /* @__PURE__ */ N("span", { className: t.mainContent, children: [
55
- /* @__PURE__ */ r("span", { className: t.mainLabel, children: o.label }),
56
- a && /* @__PURE__ */ r("span", { className: t.sizer, "aria-hidden": "true", children: g.map((e, l) => /* @__PURE__ */ r("span", { className: t.sizerItem, children: e.label }, l)) })
57
- ] }), U = o.href && !z ? /* @__PURE__ */ r(
58
- "a",
59
- {
60
- id: x,
61
- className: j,
62
- href: o.href,
63
- target: o.target,
64
- rel: o.target === "_blank" ? "noopener noreferrer" : void 0,
65
- title: p(o.label),
66
- onClick: o.onClick,
67
- children: D
68
- }
69
- ) : /* @__PURE__ */ r(
70
- "button",
71
- {
72
- id: x,
73
- type: "button",
74
- className: j,
75
- disabled: z,
76
- title: p(o.label),
77
- onClick: o.onClick,
78
- children: D
79
- }
80
- ), V = P.map((e, l) => {
81
- const m = i(
82
- t.item,
83
- e.disabled && t.itemDisabled,
84
- e.danger && t.itemDanger,
85
- s?.item
86
- ), _ = (X) => {
87
- e.onClick?.(X), f();
88
- };
89
- return e.href && !e.disabled ? /* @__PURE__ */ r(
90
- "a",
91
- {
92
- role: "menuitem",
93
- className: m,
94
- href: e.href,
95
- target: e.target,
96
- rel: e.target === "_blank" ? "noopener noreferrer" : void 0,
97
- title: p(e.label),
98
- onClick: _,
99
- children: e.label
100
- },
101
- l
102
- ) : /* @__PURE__ */ r(
103
- "button",
104
- {
105
- type: "button",
106
- role: "menuitem",
107
- className: m,
108
- disabled: e.disabled,
109
- title: p(e.label),
110
- onClick: _,
111
- children: e.label
112
- },
113
- l
114
- );
115
- }), W = { sm: t.menuSm, md: t.menuMd, lg: t.menuLg }[S], A = (e) => /* @__PURE__ */ r(
116
- "div",
117
- {
118
- ref: u,
119
- id: M,
120
- className: i(
121
- t.menu,
122
- W,
123
- n && t.menuOpen,
124
- v === "left" ? t.alignLeft : t.alignRight,
125
- s?.menu
126
- ),
127
- style: e,
128
- role: "menu",
129
- children: /* @__PURE__ */ r(ne, { value: Q, children: V })
130
- }
131
- );
132
- return /* @__PURE__ */ N(
133
- "div",
134
- {
135
- ref: J,
136
- className: i(t.root, s?.root, H),
137
- style: k !== void 0 ? { maxWidth: k, ...w } : w,
138
- children: [
139
- /* @__PURE__ */ N("div", { ref: C, className: i(t.group, s?.group), children: [
140
- U,
141
- a && /* @__PURE__ */ r(
142
- "button",
143
- {
144
- ref: R,
145
- type: "button",
146
- className: i(
147
- B,
148
- h.iconOnly,
149
- t.toggle,
150
- n && t.toggleOpen,
151
- T,
152
- s?.toggle
153
- ),
154
- disabled: O,
155
- onClick: K,
156
- "aria-haspopup": "menu",
157
- "aria-expanded": n,
158
- "aria-controls": n ? M : void 0,
159
- "aria-label": G,
160
- children: /* @__PURE__ */ r(
161
- "svg",
162
- {
163
- className: i(t.chevron, n && t.chevronOpen, s?.chevron),
164
- viewBox: "0 0 10 6",
165
- "aria-hidden": "true",
166
- children: /* @__PURE__ */ r("path", { d: "M1 1l4 4 4-4", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })
167
- }
168
- )
169
- }
170
- )
171
- ] }),
172
- a && !y && A(),
173
- a && y && n && typeof document < "u" && ee(
174
- A({
175
- position: "fixed",
176
- top: d.top,
177
- left: v === "right" ? void 0 : d.left,
178
- // clientWidth, not innerWidth: `right` on a fixed element is
179
- // measured from the viewport edge inside the scrollbar, while
180
- // innerWidth includes it — the menu would shift left by the
181
- // scrollbar width whenever the page scrolls.
182
- right: v === "right" ? document.documentElement.clientWidth - (d.left + d.width) : void 0,
183
- width: d.width,
184
- zIndex: "var(--crk-z-floating)"
185
- }),
186
- document.body
187
- )
188
- ]
189
- }
190
- );
191
- }
192
- );
193
- oe.displayName = "SplitButton";
194
- export {
195
- oe as SplitButton
196
- };
1
+ import { forwardRef as e, useCallback as t, useEffect as n, useId as r, useRef as i, useState as a } from "react";
2
+ import { createPortal as o } from "react-dom";
3
+ import s from "clsx";
4
+ import c from "./SplitButton.module.scss.js";
5
+ import l from "../Button/Button.module.scss.js";
6
+ import { EscapeLayerProvider as u, useEscapeLayer as d } from "../../hooks/useEscapeLayer.js";
7
+ import { usePortalPosition as f } from "../../hooks/usePortalPosition.js";
8
+ import { jsx as p, jsxs as m } from "react/jsx-runtime";
9
+ // src/components/SplitButton/SplitButton.tsx
10
+ var h = e(({ actions: e, variant: h = "secondary", size: g = "md", disabled: _ = !1, align: v = "right", portal: y = !0, menuLabel: b = "More actions", maxWidth: x, className: S, style: C, id: w, onOpen: T, onClose: E, classes: D }, O) => {
11
+ let [k, A] = a(!1), j = i(null), M = i(null), N = i(null), P = r();
12
+ n(() => {
13
+ k && M.current && M.current.querySelector("[role=\"menuitem\"]:not([disabled])")?.focus();
14
+ }, [k]);
15
+ let F = t(() => {
16
+ A(!1), E?.(), N.current?.focus();
17
+ }, [E]), I = t(() => {
18
+ A((e) => {
19
+ let t = !e;
20
+ return t ? T?.() : E?.(), t;
21
+ });
22
+ }, [T, E]);
23
+ n(() => {
24
+ if (!k) return;
25
+ let e = (e) => {
26
+ let t = e.target;
27
+ j.current?.contains(t) || M.current?.contains(t) || F();
28
+ };
29
+ return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
30
+ }, [k, F]);
31
+ let L = d(F, k), R = f(j, k && y);
32
+ if (e.length === 0) return null;
33
+ let [z, ...B] = e, V = B.length > 0, H = _ || z.disabled, U = s(l.root, l[h], l[g]), W = h === "secondary" ? c.overlapOutline : h === "ghost" ? c.dividerSubtle : c.dividerOnFill, G = s(U, c.main, V && c.mainAttached, V && k && c.mainOpen, D?.main), K = (e) => x !== void 0 && (typeof e == "string" || typeof e == "number") ? String(e) : void 0, q = /* @__PURE__ */ m("span", {
34
+ className: c.mainContent,
35
+ children: [/* @__PURE__ */ p("span", {
36
+ className: c.mainLabel,
37
+ children: z.label
38
+ }), V && /* @__PURE__ */ p("span", {
39
+ className: c.sizer,
40
+ "aria-hidden": "true",
41
+ children: e.map((e, t) => /* @__PURE__ */ p("span", {
42
+ className: c.sizerItem,
43
+ children: e.label
44
+ }, t))
45
+ })]
46
+ }), J = z.href && !H ? /* @__PURE__ */ p("a", {
47
+ id: w,
48
+ className: G,
49
+ href: z.href,
50
+ target: z.target,
51
+ rel: z.target === "_blank" ? "noopener noreferrer" : void 0,
52
+ title: K(z.label),
53
+ onClick: z.onClick,
54
+ children: q
55
+ }) : /* @__PURE__ */ p("button", {
56
+ id: w,
57
+ type: "button",
58
+ className: G,
59
+ disabled: H,
60
+ title: K(z.label),
61
+ onClick: z.onClick,
62
+ children: q
63
+ }), Y = B.map((e, t) => {
64
+ let n = s(c.item, e.disabled && c.itemDisabled, e.danger && c.itemDanger, D?.item), r = (t) => {
65
+ e.onClick?.(t), F();
66
+ };
67
+ return e.href && !e.disabled ? /* @__PURE__ */ p("a", {
68
+ role: "menuitem",
69
+ className: n,
70
+ href: e.href,
71
+ target: e.target,
72
+ rel: e.target === "_blank" ? "noopener noreferrer" : void 0,
73
+ title: K(e.label),
74
+ onClick: r,
75
+ children: e.label
76
+ }, t) : /* @__PURE__ */ p("button", {
77
+ type: "button",
78
+ role: "menuitem",
79
+ className: n,
80
+ disabled: e.disabled,
81
+ title: K(e.label),
82
+ onClick: r,
83
+ children: e.label
84
+ }, t);
85
+ }), X = {
86
+ sm: c.menuSm,
87
+ md: c.menuMd,
88
+ lg: c.menuLg
89
+ }[g], Z = (e) => /* @__PURE__ */ p("div", {
90
+ ref: M,
91
+ id: P,
92
+ className: s(c.menu, X, k && c.menuOpen, v === "left" ? c.alignLeft : c.alignRight, D?.menu),
93
+ style: e,
94
+ role: "menu",
95
+ children: /* @__PURE__ */ p(u, {
96
+ value: L,
97
+ children: Y
98
+ })
99
+ });
100
+ return /* @__PURE__ */ m("div", {
101
+ ref: O,
102
+ className: s(c.root, D?.root, S),
103
+ style: x === void 0 ? C : {
104
+ maxWidth: x,
105
+ ...C
106
+ },
107
+ children: [
108
+ /* @__PURE__ */ m("div", {
109
+ ref: j,
110
+ className: s(c.group, D?.group),
111
+ children: [J, V && /* @__PURE__ */ p("button", {
112
+ ref: N,
113
+ type: "button",
114
+ className: s(U, l.iconOnly, c.toggle, k && c.toggleOpen, W, D?.toggle),
115
+ disabled: _,
116
+ onClick: I,
117
+ "aria-haspopup": "menu",
118
+ "aria-expanded": k,
119
+ "aria-controls": k ? P : void 0,
120
+ "aria-label": b,
121
+ children: /* @__PURE__ */ p("svg", {
122
+ className: s(c.chevron, k && c.chevronOpen, D?.chevron),
123
+ viewBox: "0 0 10 6",
124
+ "aria-hidden": "true",
125
+ children: /* @__PURE__ */ p("path", {
126
+ d: "M1 1l4 4 4-4",
127
+ fill: "none",
128
+ stroke: "currentColor",
129
+ strokeWidth: "1.5",
130
+ strokeLinecap: "round",
131
+ strokeLinejoin: "round"
132
+ })
133
+ })
134
+ })]
135
+ }),
136
+ V && !y && Z(),
137
+ V && y && k && typeof document < "u" && o(Z({
138
+ position: "fixed",
139
+ top: R.top,
140
+ left: v === "right" ? void 0 : R.left,
141
+ right: v === "right" ? document.documentElement.clientWidth - (R.left + R.width) : void 0,
142
+ width: R.width,
143
+ zIndex: "var(--crk-z-floating)"
144
+ }), document.body)
145
+ ]
146
+ });
147
+ });
148
+ h.displayName = "SplitButton";
149
+ export { h as SplitButton };
@@ -1,57 +1,31 @@
1
- const n = "crk-root-WQNOC", e = "crk-group-vpjIZ", t = "crk-main-rC6D1", i = "crk-mainContent-ztmsF", c = "crk-mainLabel-nGrtw", r = "crk-sizer-PLveG", o = "crk-sizerItem-dwWwd", m = "crk-mainAttached-AhE-l", s = "crk-toggle-yVTi-", a = "crk-mainOpen-7hEXl", l = "crk-toggleOpen-56O29", g = "crk-dividerOnFill-HLKeu", k = "crk-dividerSubtle-g-TfH", u = "crk-overlapOutline-yWbkD", d = "crk-chevron-4zed5", O = "crk-chevronOpen-7vOPn", p = "crk-menu-2ijiM", v = "crk-menuOpen-hANn0", h = "crk-menuSm-WBQSi", L = "crk-menuMd-xjRTT", b = "crk-menuLg-rXDWh", D = "crk-alignLeft-aXK9A", z = "crk-alignRight-ANsBn", A = "crk-item-rolo0", S = "crk-itemDisabled-A7T-8", f = "crk-itemDanger-g19Qe", C = {
2
- root: n,
3
- group: e,
4
- main: t,
5
- mainContent: i,
6
- mainLabel: c,
7
- sizer: r,
8
- sizerItem: o,
9
- mainAttached: m,
10
- toggle: s,
11
- mainOpen: a,
12
- toggleOpen: l,
13
- dividerOnFill: g,
14
- dividerSubtle: k,
15
- overlapOutline: u,
16
- chevron: d,
17
- chevronOpen: O,
18
- menu: p,
19
- menuOpen: v,
20
- menuSm: h,
21
- menuMd: L,
22
- menuLg: b,
23
- alignLeft: D,
24
- alignRight: z,
25
- item: A,
26
- itemDisabled: S,
27
- itemDanger: f
28
- };
29
- export {
30
- D as alignLeft,
31
- z as alignRight,
32
- d as chevron,
33
- O as chevronOpen,
34
- C as default,
35
- g as dividerOnFill,
36
- k as dividerSubtle,
37
- e as group,
38
- A as item,
39
- f as itemDanger,
40
- S as itemDisabled,
41
- t as main,
42
- m as mainAttached,
43
- i as mainContent,
44
- c as mainLabel,
45
- a as mainOpen,
46
- p as menu,
47
- b as menuLg,
48
- L as menuMd,
49
- v as menuOpen,
50
- h as menuSm,
51
- u as overlapOutline,
52
- n as root,
53
- r as sizer,
54
- o as sizerItem,
55
- s as toggle,
56
- l as toggleOpen
1
+ // src/components/SplitButton/SplitButton.module.scss
2
+ var e = "crk-root-WQNOC", t = "crk-group-vpjIZ", n = "crk-main-rC6D1", r = "crk-mainContent-ztmsF", i = "crk-mainLabel-nGrtw", a = "crk-sizer-PLveG", o = "crk-sizerItem-dwWwd", s = "crk-mainAttached-AhE-l", c = "crk-toggle-yVTi-", l = "crk-mainOpen-7hEXl", u = "crk-toggleOpen-56O29", d = "crk-dividerOnFill-HLKeu", f = "crk-dividerSubtle-g-TfH", p = "crk-overlapOutline-yWbkD", m = "crk-chevron-4zed5", h = "crk-chevronOpen-7vOPn", g = "crk-menu-2ijiM", _ = "crk-menuOpen-hANn0", v = "crk-menuEnter-xjAuj", y = "crk-menuSm-WBQSi", b = "crk-menuMd-xjRTT", x = "crk-menuLg-rXDWh", S = "crk-alignLeft-aXK9A", C = "crk-alignRight-ANsBn", w = "crk-item-rolo0", T = "crk-itemDisabled-A7T-8", E = "crk-itemDanger-g19Qe", D = {
3
+ root: e,
4
+ group: t,
5
+ main: n,
6
+ mainContent: r,
7
+ mainLabel: i,
8
+ sizer: a,
9
+ sizerItem: o,
10
+ mainAttached: s,
11
+ toggle: c,
12
+ mainOpen: l,
13
+ toggleOpen: u,
14
+ dividerOnFill: d,
15
+ dividerSubtle: f,
16
+ overlapOutline: p,
17
+ chevron: m,
18
+ chevronOpen: h,
19
+ menu: g,
20
+ menuOpen: _,
21
+ menuEnter: v,
22
+ menuSm: y,
23
+ menuMd: b,
24
+ menuLg: x,
25
+ alignLeft: S,
26
+ alignRight: C,
27
+ item: w,
28
+ itemDisabled: T,
29
+ itemDanger: E
57
30
  };
31
+ export { S as alignLeft, C as alignRight, m as chevron, h as chevronOpen, D as default, d as dividerOnFill, f as dividerSubtle, t as group, w as item, E as itemDanger, T as itemDisabled, n as main, s as mainAttached, r as mainContent, i as mainLabel, l as mainOpen, g as menu, v as menuEnter, x as menuLg, b as menuMd, _ as menuOpen, y as menuSm, p as overlapOutline, e as root, a as sizer, o as sizerItem, c as toggle, u as toggleOpen };