@pismo/marola 0.0.1-alpha.1 → 0.0.1-alpha.12

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 (136) hide show
  1. package/README.md +17 -5
  2. package/dist/Button-B1umG8kJ.js +131 -0
  3. package/dist/ClickAwayListener-HI1G6ob9.js +107 -0
  4. package/dist/Dialog.module-CGVM5V_D.js +15 -0
  5. package/dist/Popup-DFJQc_jn.js +1249 -0
  6. package/dist/Portal-D__zvwbZ.js +73 -0
  7. package/dist/SelectButton-DWtqAiwt.js +45 -0
  8. package/dist/Tabs.module-jkH1Qjn7.js +22 -0
  9. package/dist/_commonjsHelpers-CT_km90n.js +30 -0
  10. package/dist/assets/Advice.css +1 -0
  11. package/dist/assets/Button.css +1 -0
  12. package/dist/assets/Checkbox.css +1 -0
  13. package/dist/assets/Dialog.css +1 -1
  14. package/dist/assets/IconButton.css +1 -0
  15. package/dist/assets/Input.css +1 -0
  16. package/dist/assets/InputSearch.css +1 -0
  17. package/dist/assets/LoadingSpinner.css +1 -1
  18. package/dist/assets/PageHeader.css +1 -0
  19. package/dist/assets/Pagination.css +1 -0
  20. package/dist/assets/SelectButton.css +1 -0
  21. package/dist/assets/Skeleton.css +1 -0
  22. package/dist/assets/Snackbar.css +1 -0
  23. package/dist/assets/SortTooltip.css +1 -0
  24. package/dist/assets/Stepper.css +1 -0
  25. package/dist/assets/Table.css +1 -0
  26. package/dist/assets/Tabs.css +1 -0
  27. package/dist/assets/Toggle.css +1 -0
  28. package/dist/assets/Tooltip.css +1 -0
  29. package/dist/assets/Typography.css +1 -1
  30. package/dist/assets/global.css +1 -0
  31. package/dist/combineHooksSlotProps-BHqhiBfc.js +81 -0
  32. package/dist/components/Advice/Advice.d.ts +16 -0
  33. package/dist/components/Advice/Advice.js +25 -0
  34. package/dist/components/Button/Button.d.ts +29 -0
  35. package/dist/components/Button/Button.js +70 -0
  36. package/dist/components/Button/Button.stories.d.ts +60 -0
  37. package/dist/components/Button/Button.stories.js +41 -0
  38. package/dist/components/Checkbox/Checkbox.d.ts +19 -0
  39. package/dist/components/Checkbox/Checkbox.js +56 -0
  40. package/dist/components/Dialog/Actions.js +1 -1
  41. package/dist/components/Dialog/Backdrop.d.ts +1 -1
  42. package/dist/components/Dialog/Backdrop.js +2 -9
  43. package/dist/components/Dialog/CloseIconButton.js +11 -10
  44. package/dist/components/Dialog/Dialog.d.ts +5 -4
  45. package/dist/components/Dialog/Dialog.js +420 -20077
  46. package/dist/components/Dialog/Dialog.stories.d.ts +343 -0
  47. package/dist/components/Dialog/Dialog.stories.js +60 -0
  48. package/dist/components/Dialog/Title.js +22 -7
  49. package/dist/components/Icon/Icon.d.ts +18 -0
  50. package/dist/components/Icon/Icon.js +95 -0
  51. package/dist/components/IconButton/IconButton.d.ts +22 -0
  52. package/dist/components/IconButton/IconButton.js +68 -0
  53. package/dist/components/Input/Input.d.ts +44 -0
  54. package/dist/components/Input/Input.js +497 -0
  55. package/dist/components/Input/Input.stories.d.ts +43 -0
  56. package/dist/components/Input/Input.stories.js +106 -0
  57. package/dist/components/InputSearch/InputSearch.d.ts +11 -0
  58. package/dist/components/InputSearch/InputSearch.js +29 -0
  59. package/dist/components/InputSearch/InputSearch.stories.d.ts +22 -0
  60. package/dist/components/InputSearch/InputSearch.stories.js +36 -0
  61. package/dist/components/LoadingSpinner/LoadingSpinner.d.ts +2 -0
  62. package/dist/components/LoadingSpinner/LoadingSpinner.js +12 -13
  63. package/dist/components/LoadingSpinner/LoadingSpinner.stories.d.ts +14 -0
  64. package/dist/components/LoadingSpinner/LoadingSpinner.stories.js +39 -0
  65. package/dist/components/PageHeader/PageHeader.d.ts +36 -0
  66. package/dist/components/PageHeader/PageHeader.js +51 -0
  67. package/dist/components/PageHeader/PageHeader.stories.d.ts +43 -0
  68. package/dist/components/PageHeader/PageHeader.stories.js +49 -0
  69. package/dist/components/Pagination/Pagination.d.ts +36 -0
  70. package/dist/components/Pagination/Pagination.js +219 -0
  71. package/dist/components/Select/Select.d.ts +25 -0
  72. package/dist/components/Select/Select.js +860 -0
  73. package/dist/components/Select/Select.stories.d.ts +31 -0
  74. package/dist/components/Select/Select.stories.js +66 -0
  75. package/dist/components/Select/SelectButton.d.ts +13 -0
  76. package/dist/components/Select/SelectButton.js +8 -0
  77. package/dist/components/Skeleton/Skeleton.d.ts +18 -0
  78. package/dist/components/Skeleton/Skeleton.js +26 -0
  79. package/dist/components/Snackbar/Snackbar.d.ts +13 -0
  80. package/dist/components/Snackbar/Snackbar.js +623 -0
  81. package/dist/components/SortTooltip/SortTooltip.d.ts +26 -0
  82. package/dist/components/SortTooltip/SortTooltip.js +67 -0
  83. package/dist/components/Stepper/Stepper.d.ts +16 -0
  84. package/dist/components/Stepper/Stepper.js +33 -0
  85. package/dist/components/Table/Table.d.ts +39 -0
  86. package/dist/components/Table/Table.js +122 -0
  87. package/dist/components/Table/TableContext.d.ts +19 -0
  88. package/dist/components/Table/TableContext.js +21 -0
  89. package/dist/components/Tabs/Tab.d.ts +9 -0
  90. package/dist/components/Tabs/Tab.js +182 -0
  91. package/dist/components/Tabs/TabPanel.d.ts +8 -0
  92. package/dist/components/Tabs/TabPanel.js +119 -0
  93. package/dist/components/Tabs/Tabs.d.ts +11 -0
  94. package/dist/components/Tabs/Tabs.js +402 -0
  95. package/dist/components/Toggle/Toggle.d.ts +11 -0
  96. package/dist/components/Toggle/Toggle.js +252 -0
  97. package/dist/components/Toggle/Toggle.stories.d.ts +21 -0
  98. package/dist/components/Toggle/Toggle.stories.js +33 -0
  99. package/dist/components/Tooltip/Tooltip.d.ts +17 -0
  100. package/dist/components/Tooltip/Tooltip.js +127 -0
  101. package/dist/components/Typography/Typography.d.ts +15 -6
  102. package/dist/components/Typography/Typography.js +75 -67
  103. package/dist/components/Typography/Typography.stories.d.ts +31 -0
  104. package/dist/components/Typography/Typography.stories.js +31 -0
  105. package/dist/components/Typography/typography.test.d.ts +1 -0
  106. package/dist/components/Typography/typography.test.js +11358 -0
  107. package/dist/index-BJ8HbRCy.js +19585 -0
  108. package/dist/index-CqjC7P5Y.js +814 -0
  109. package/dist/magic-string.es-O_8lTkE3.js +738 -0
  110. package/dist/main.d.ts +19 -2
  111. package/dist/main.js +60 -15
  112. package/dist/objectWithoutPropertiesLoose-D7Cp0Pg_.js +26 -0
  113. package/dist/test-utils/assertStyles.d.ts +1 -0
  114. package/dist/test-utils/assertStyles.js +11 -0
  115. package/dist/types/helpers.d.ts +14 -7
  116. package/dist/useButton-Bc8IAgyk.js +106 -0
  117. package/dist/useCompoundItem-D1iRfg8D.js +84 -0
  118. package/dist/useControlled-CCMYYdCM.js +31 -0
  119. package/dist/useEnhancedEffect-CJGo-L3B.js +5 -0
  120. package/dist/useEventCallback-vAfOD-oT.js +45 -0
  121. package/dist/useIsFocusVisible-BH4IAdcw.js +69 -0
  122. package/dist/useList-ByMguSS_.js +437 -0
  123. package/dist/useTimeout-DxF9kiZL.js +36 -0
  124. package/dist/utils/styleStrings.d.ts +6 -0
  125. package/dist/utils/styleStrings.js +10 -0
  126. package/dist/utils/styleStrings.test.d.ts +1 -0
  127. package/dist/utils/styleStrings.test.js +41 -0
  128. package/dist/vi.Y_w82WR8-Df0JUamG.js +9860 -0
  129. package/package.json +53 -10
  130. package/dist/Button-REznN-RP.js +0 -1139
  131. package/dist/Dialog.module-BO0mdB7d.js +0 -15
  132. package/dist/assets/CallToActionButton.css +0 -1
  133. package/dist/assets/main.css +0 -1
  134. package/dist/components/CallToActionButton/CallToActionButton.d.ts +0 -23
  135. package/dist/components/CallToActionButton/CallToActionButton.js +0 -57
  136. package/src/playground/Playground.tsx +0 -58
@@ -0,0 +1,437 @@
1
+ import { a as p } from "./objectWithoutPropertiesLoose-D7Cp0Pg_.js";
2
+ import * as f from "react";
3
+ import { L as x } from "./combineHooksSlotProps-BHqhiBfc.js";
4
+ import { u as re, e as ie } from "./index-CqjC7P5Y.js";
5
+ function W(t, e, r = (n, l) => n === l) {
6
+ return t.length === e.length && t.every((n, l) => r(n, e[l]));
7
+ }
8
+ function ue(t, e) {
9
+ return t === e;
10
+ }
11
+ const N = {}, q = () => {
12
+ };
13
+ function L(t, e) {
14
+ const r = p({}, t);
15
+ return Object.keys(e).forEach((n) => {
16
+ e[n] !== void 0 && (r[n] = e[n]);
17
+ }), r;
18
+ }
19
+ function ae(t) {
20
+ const {
21
+ nextState: e,
22
+ initialState: r,
23
+ stateComparers: n,
24
+ onStateChange: l,
25
+ controlledProps: s,
26
+ lastActionRef: i
27
+ } = t, h = f.useRef(r);
28
+ f.useEffect(() => {
29
+ if (i.current === null)
30
+ return;
31
+ const a = L(h.current, s);
32
+ Object.keys(e).forEach((C) => {
33
+ var V;
34
+ const g = (V = n[C]) != null ? V : ue, c = e[C], m = a[C];
35
+ if (m == null && c != null || m != null && c == null || m != null && c != null && !g(c, m)) {
36
+ var o, S;
37
+ l == null || l((o = i.current.event) != null ? o : null, C, c, (S = i.current.type) != null ? S : "", e);
38
+ }
39
+ }), h.current = e, i.current = null;
40
+ }, [h, e, i, l, n, s]);
41
+ }
42
+ function se(t) {
43
+ const e = f.useRef(null), {
44
+ reducer: r,
45
+ initialState: n,
46
+ controlledProps: l = N,
47
+ stateComparers: s = N,
48
+ onStateChange: i = q,
49
+ actionContext: h,
50
+ componentName: a = ""
51
+ } = t, C = f.useRef(l);
52
+ process.env.NODE_ENV !== "production" && f.useEffect(() => {
53
+ Object.keys(l).forEach((o) => {
54
+ C.current[o] !== void 0 && l[o] === void 0 && console.error(`useControllableReducer: ${a ? `The ${a} component` : "A component"} is changing a controlled prop to be uncontrolled: ${o}`), C.current[o] === void 0 && l[o] !== void 0 && console.error(`useControllableReducer: ${a ? `The ${a} component` : "A component"} is changing an uncontrolled prop to be controlled: ${o}`);
55
+ });
56
+ }, [l, a]);
57
+ const V = f.useCallback((o, S) => {
58
+ e.current = S;
59
+ const R = L(o, l);
60
+ return r(R, S);
61
+ }, [l, r]), [g, c] = f.useReducer(V, n), m = f.useCallback((o) => {
62
+ c(p({}, o, {
63
+ context: h
64
+ }));
65
+ }, [h]);
66
+ return ae({
67
+ nextState: g,
68
+ initialState: n,
69
+ stateComparers: s ?? N,
70
+ onStateChange: i ?? q,
71
+ controlledProps: l,
72
+ lastActionRef: e
73
+ }), [L(g, l), m];
74
+ }
75
+ function oe(t, e, r, n, l, s) {
76
+ if (r.length === 0 || !n && r.every((h, a) => l(h, a)))
77
+ return -1;
78
+ let i = t;
79
+ for (; ; ) {
80
+ if (!s && e === "next" && i === r.length || !s && e === "previous" && i === -1)
81
+ return -1;
82
+ if (n ? !1 : l(r[i], i))
83
+ i += e === "next" ? 1 : -1, s && (i = (i + r.length) % r.length);
84
+ else
85
+ return i;
86
+ }
87
+ }
88
+ function w(t, e, r) {
89
+ var n;
90
+ const {
91
+ items: l,
92
+ isItemDisabled: s,
93
+ disableListWrap: i,
94
+ disabledItemsFocusable: h,
95
+ itemComparer: a,
96
+ focusManagement: C
97
+ } = r, V = C === "DOM" ? 0 : -1, g = l.length - 1, c = t == null ? -1 : l.findIndex((D) => a(D, t));
98
+ let m, o, S = !i;
99
+ switch (e) {
100
+ case "reset":
101
+ if (V === -1)
102
+ return null;
103
+ m = 0, o = "next", S = !1;
104
+ break;
105
+ case "start":
106
+ m = 0, o = "next", S = !1;
107
+ break;
108
+ case "end":
109
+ m = g, o = "previous", S = !1;
110
+ break;
111
+ default: {
112
+ const D = c + e;
113
+ D < 0 ? !S && c !== -1 || Math.abs(e) > 1 ? (m = 0, o = "next") : (m = g, o = "previous") : D > g ? !S || Math.abs(e) > 1 ? (m = g, o = "previous") : (m = 0, o = "next") : (m = D, o = e >= 0 ? "next" : "previous");
114
+ }
115
+ }
116
+ const R = oe(m, o, l, h, s, S);
117
+ return R === -1 && t !== null && !s(t, c) ? t : (n = l[R]) != null ? n : null;
118
+ }
119
+ function ce(t, e, r, n) {
120
+ return r === "none" ? [] : r === "single" ? n(e[0], t) ? e : [t] : e.some((l) => n(l, t)) ? e.filter((l) => !n(l, t)) : [...e, t];
121
+ }
122
+ function j(t, e, r) {
123
+ const {
124
+ itemComparer: n,
125
+ isItemDisabled: l,
126
+ selectionMode: s,
127
+ items: i
128
+ } = r, {
129
+ selectedValues: h
130
+ } = e, a = i.findIndex((V) => n(t, V));
131
+ if (l(t, a))
132
+ return e;
133
+ const C = ce(t, h, s, n);
134
+ return p({}, e, {
135
+ selectedValues: C,
136
+ highlightedValue: t
137
+ });
138
+ }
139
+ function he(t, e, r) {
140
+ const n = e.highlightedValue, {
141
+ orientation: l,
142
+ pageSize: s
143
+ } = r;
144
+ switch (t) {
145
+ case "Home":
146
+ return p({}, e, {
147
+ highlightedValue: w(n, "start", r)
148
+ });
149
+ case "End":
150
+ return p({}, e, {
151
+ highlightedValue: w(n, "end", r)
152
+ });
153
+ case "PageUp":
154
+ return p({}, e, {
155
+ highlightedValue: w(n, -s, r)
156
+ });
157
+ case "PageDown":
158
+ return p({}, e, {
159
+ highlightedValue: w(n, s, r)
160
+ });
161
+ case "ArrowUp":
162
+ if (l !== "vertical")
163
+ break;
164
+ return p({}, e, {
165
+ highlightedValue: w(n, -1, r)
166
+ });
167
+ case "ArrowDown":
168
+ if (l !== "vertical")
169
+ break;
170
+ return p({}, e, {
171
+ highlightedValue: w(n, 1, r)
172
+ });
173
+ case "ArrowLeft": {
174
+ if (l === "vertical")
175
+ break;
176
+ return p({}, e, {
177
+ highlightedValue: w(n, l === "horizontal-ltr" ? -1 : 1, r)
178
+ });
179
+ }
180
+ case "ArrowRight": {
181
+ if (l === "vertical")
182
+ break;
183
+ return p({}, e, {
184
+ highlightedValue: w(n, l === "horizontal-ltr" ? 1 : -1, r)
185
+ });
186
+ }
187
+ case "Enter":
188
+ case " ":
189
+ return e.highlightedValue === null ? e : j(e.highlightedValue, e, r);
190
+ }
191
+ return e;
192
+ }
193
+ function ge(t, e) {
194
+ return e.focusManagement === "DOM" ? t : p({}, t, {
195
+ highlightedValue: null
196
+ });
197
+ }
198
+ function de(t, e, r) {
199
+ var n;
200
+ const l = (n = r(t)) == null ? void 0 : n.trim().toLowerCase();
201
+ return !l || l.length === 0 ? !1 : l.indexOf(e) === 0;
202
+ }
203
+ function fe(t, e, r) {
204
+ const {
205
+ items: n,
206
+ isItemDisabled: l,
207
+ disabledItemsFocusable: s,
208
+ getItemAsString: i
209
+ } = r, h = e.length > 1;
210
+ let a = h ? t.highlightedValue : w(t.highlightedValue, 1, r);
211
+ for (let C = 0; C < n.length; C += 1) {
212
+ if (!a || !h && t.highlightedValue === a)
213
+ return t;
214
+ if (de(a, e, i) && (!l(a, n.indexOf(a)) || s))
215
+ return p({}, t, {
216
+ highlightedValue: a
217
+ });
218
+ a = w(a, 1, r);
219
+ }
220
+ return t;
221
+ }
222
+ function me(t, e, r, n) {
223
+ var l;
224
+ const {
225
+ itemComparer: s,
226
+ focusManagement: i
227
+ } = n;
228
+ let h = null;
229
+ if (r.highlightedValue != null) {
230
+ var a;
231
+ h = (a = t.find((g) => s(g, r.highlightedValue))) != null ? a : null;
232
+ } else
233
+ i === "DOM" && e.length === 0 && (h = w(null, "reset", n));
234
+ const V = ((l = r.selectedValues) != null ? l : []).filter((g) => t.some((c) => s(c, g)));
235
+ return p({}, r, {
236
+ highlightedValue: h,
237
+ selectedValues: V
238
+ });
239
+ }
240
+ function pe(t, e) {
241
+ return p({}, t, {
242
+ highlightedValue: w(null, "reset", e)
243
+ });
244
+ }
245
+ function Ce(t, e) {
246
+ return p({}, t, {
247
+ highlightedValue: w(null, "end", e)
248
+ });
249
+ }
250
+ function Se(t, e) {
251
+ return p({}, t, {
252
+ selectedValues: [],
253
+ highlightedValue: w(null, "reset", e)
254
+ });
255
+ }
256
+ function Ie(t, e) {
257
+ const {
258
+ type: r,
259
+ context: n
260
+ } = e;
261
+ switch (r) {
262
+ case x.keyDown:
263
+ return he(e.key, t, n);
264
+ case x.itemClick:
265
+ return j(e.item, t, n);
266
+ case x.blur:
267
+ return ge(t, n);
268
+ case x.textNavigation:
269
+ return fe(t, e.searchString, n);
270
+ case x.itemsChange:
271
+ return me(e.items, e.previousItems, t, n);
272
+ case x.resetHighlight:
273
+ return pe(t, n);
274
+ case x.highlightLast:
275
+ return Ce(t, n);
276
+ case x.clearSelection:
277
+ return Se(t, n);
278
+ default:
279
+ return t;
280
+ }
281
+ }
282
+ const be = 500;
283
+ function xe(t) {
284
+ const e = f.useRef({
285
+ searchString: "",
286
+ lastTime: null
287
+ });
288
+ return f.useCallback((r) => {
289
+ if (r.key.length === 1 && r.key !== " ") {
290
+ const n = e.current, l = r.key.toLowerCase(), s = performance.now();
291
+ n.searchString.length > 0 && n.lastTime && s - n.lastTime > be ? n.searchString = l : (n.searchString.length !== 1 || l !== n.searchString) && (n.searchString += l), n.lastTime = s, t(n.searchString, r);
292
+ }
293
+ }, [t]);
294
+ }
295
+ const z = {}, Ve = () => {
296
+ }, we = (t, e) => t === e, De = () => !1, Re = (t) => typeof t == "string" ? t : String(t), ve = () => ({
297
+ highlightedValue: null,
298
+ selectedValues: []
299
+ });
300
+ function Oe(t) {
301
+ const {
302
+ controlledProps: e = z,
303
+ disabledItemsFocusable: r = !1,
304
+ disableListWrap: n = !1,
305
+ focusManagement: l = "activeDescendant",
306
+ getInitialState: s = ve,
307
+ getItemDomElement: i,
308
+ getItemId: h,
309
+ isItemDisabled: a = De,
310
+ rootRef: C,
311
+ onStateChange: V = Ve,
312
+ items: g,
313
+ itemComparer: c = we,
314
+ getItemAsString: m = Re,
315
+ onChange: o,
316
+ onHighlightChange: S,
317
+ onItemsChange: R,
318
+ orientation: D = "vertical",
319
+ pageSize: P = 5,
320
+ reducerActionContext: H = z,
321
+ selectionMode: $ = "single",
322
+ stateReducer: _,
323
+ componentName: G = "useList"
324
+ } = t;
325
+ if (process.env.NODE_ENV !== "production") {
326
+ if (l === "DOM" && i == null)
327
+ throw new Error("useList: The `getItemDomElement` prop is required when using the `DOM` focus management.");
328
+ if (l === "activeDescendant" && h == null)
329
+ throw new Error("useList: The `getItemId` prop is required when using the `activeDescendant` focus management.");
330
+ }
331
+ const B = f.useRef(null), F = re(C, B), T = f.useCallback((d, u, I) => {
332
+ if (S == null || S(d, u, I), l === "DOM" && u != null && (I === x.itemClick || I === x.keyDown || I === x.textNavigation)) {
333
+ var b;
334
+ i == null || (b = i(u)) == null || b.focus();
335
+ }
336
+ }, [i, S, l]), O = f.useMemo(() => ({
337
+ highlightedValue: c,
338
+ selectedValues: (d, u) => W(d, u, c)
339
+ }), [c]), J = f.useCallback((d, u, I, b, M) => {
340
+ switch (V == null || V(d, u, I, b, M), u) {
341
+ case "highlightedValue":
342
+ T(d, I, b);
343
+ break;
344
+ case "selectedValues":
345
+ o == null || o(d, I, b);
346
+ break;
347
+ }
348
+ }, [T, o, V]), K = f.useMemo(() => ({
349
+ disabledItemsFocusable: r,
350
+ disableListWrap: n,
351
+ focusManagement: l,
352
+ isItemDisabled: a,
353
+ itemComparer: c,
354
+ items: g,
355
+ getItemAsString: m,
356
+ onHighlightChange: T,
357
+ orientation: D,
358
+ pageSize: P,
359
+ selectionMode: $,
360
+ stateComparers: O
361
+ }), [r, n, l, a, c, g, m, T, D, P, $, O]), Y = s(), X = _ ?? Ie, Q = f.useMemo(() => p({}, H, K), [H, K]), [k, v] = se({
362
+ reducer: X,
363
+ actionContext: Q,
364
+ initialState: Y,
365
+ controlledProps: e,
366
+ stateComparers: O,
367
+ onStateChange: J,
368
+ componentName: G
369
+ }), {
370
+ highlightedValue: E,
371
+ selectedValues: A
372
+ } = k, Z = xe((d, u) => v({
373
+ type: x.textNavigation,
374
+ event: u,
375
+ searchString: d
376
+ })), y = f.useRef([]);
377
+ f.useEffect(() => {
378
+ W(y.current, g, c) || (v({
379
+ type: x.itemsChange,
380
+ event: null,
381
+ items: g,
382
+ previousItems: y.current
383
+ }), y.current = g, R == null || R(g));
384
+ }, [g, c, v, R]);
385
+ const ee = (d) => (u) => {
386
+ var I;
387
+ if ((I = d.onKeyDown) == null || I.call(d, u), u.defaultMuiPrevented)
388
+ return;
389
+ const b = ["Home", "End", "PageUp", "PageDown"];
390
+ D === "vertical" ? b.push("ArrowUp", "ArrowDown") : b.push("ArrowLeft", "ArrowRight"), l === "activeDescendant" && b.push(" ", "Enter"), b.includes(u.key) && u.preventDefault(), v({
391
+ type: x.keyDown,
392
+ key: u.key,
393
+ event: u
394
+ }), Z(u);
395
+ }, te = (d) => (u) => {
396
+ var I, b;
397
+ (I = d.onBlur) == null || I.call(d, u), !u.defaultMuiPrevented && ((b = B.current) != null && b.contains(u.relatedTarget) || v({
398
+ type: x.blur,
399
+ event: u
400
+ }));
401
+ }, ne = (d = {}) => {
402
+ const u = ie(d);
403
+ return p({}, d, {
404
+ "aria-activedescendant": l === "activeDescendant" && E != null ? h(E) : void 0,
405
+ tabIndex: l === "DOM" ? -1 : 0,
406
+ ref: F
407
+ }, u, {
408
+ onBlur: te(u),
409
+ onKeyDown: ee(u)
410
+ });
411
+ }, U = f.useCallback((d) => {
412
+ const u = (A ?? []).some((M) => M != null && c(d, M)), I = E != null && c(d, E);
413
+ return {
414
+ focusable: l === "DOM",
415
+ highlighted: I,
416
+ selected: u
417
+ };
418
+ }, [c, A, E, l]), le = f.useMemo(() => ({
419
+ dispatch: v,
420
+ getItemState: U
421
+ }), [v, U]);
422
+ return f.useDebugValue({
423
+ state: k
424
+ }), {
425
+ contextValue: le,
426
+ dispatch: v,
427
+ getRootProps: ne,
428
+ rootRef: F,
429
+ state: k
430
+ };
431
+ }
432
+ export {
433
+ j as h,
434
+ Ie as l,
435
+ w as m,
436
+ Oe as u
437
+ };
@@ -0,0 +1,36 @@
1
+ import * as n from "react";
2
+ const u = {};
3
+ function c(t, r) {
4
+ const e = n.useRef(u);
5
+ return e.current === u && (e.current = t(r)), e;
6
+ }
7
+ const i = [];
8
+ function o(t) {
9
+ n.useEffect(t, i);
10
+ }
11
+ class s {
12
+ constructor() {
13
+ this.currentId = null, this.clear = () => {
14
+ this.currentId !== null && (clearTimeout(this.currentId), this.currentId = null);
15
+ }, this.disposeEffect = () => this.clear;
16
+ }
17
+ static create() {
18
+ return new s();
19
+ }
20
+ /**
21
+ * Executes `fn` after `delay`, clearing any previously scheduled call.
22
+ */
23
+ start(r, e) {
24
+ this.clear(), this.currentId = setTimeout(() => {
25
+ this.currentId = null, e();
26
+ }, r);
27
+ }
28
+ }
29
+ function f() {
30
+ const t = c(s.create).current;
31
+ return o(t.disposeEffect), t;
32
+ }
33
+ export {
34
+ s as T,
35
+ f as u
36
+ };
@@ -0,0 +1,6 @@
1
+ import { Split } from '../types/helpers';
2
+
3
+ export type BlockType<T extends string> = Split<T, '-'>[0];
4
+ export declare const bemify: <T extends string>(variant: T, blocksWithElements: BlockType<T>[]) => string;
5
+ export declare const getBEMBase: (variant: string) => string;
6
+ export declare const getBEMBlock: (variant: string) => string;
@@ -0,0 +1,10 @@
1
+ const s = (e, n) => {
2
+ const r = new RegExp(`^([${n.join("|")}]*)-`);
3
+ let t = e.replace(r, "$1__");
4
+ return t = t.replace(new RegExp("(?<!-)-(?!-)", "g"), "--"), t;
5
+ }, c = (e) => e.split("--")[0], l = (e) => e.split(/--|__/)[0];
6
+ export {
7
+ s as bemify,
8
+ c as getBEMBase,
9
+ l as getBEMBlock
10
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,41 @@
1
+ import { bemify as a, getBEMBase as e, getBEMBlock as r } from "./styleStrings.js";
2
+ import { d as s, i as o, g as t } from "../vi.Y_w82WR8-Df0JUamG.js";
3
+ s("styleStrings", () => {
4
+ s("bemify", () => {
5
+ o("returns just a block if a block was only given", () => {
6
+ t(a("foo", ["bar"])).toEqual("foo");
7
+ }), o("returns just a block and modifier if no elements for that block", () => {
8
+ t(a("foo-baz", ["bar"])).toEqual("foo--baz");
9
+ }), o("returns just block and element if it is a block with elements", () => {
10
+ t(a("bar-baz", ["bar"])).toEqual("bar__baz");
11
+ }), o("returns block, element and modifier if it has all three parts", () => {
12
+ t(a("bar-baz-qux", ["bar"])).toEqual("bar__baz--qux");
13
+ }), o("accepts alternative types for the generic variants type", () => {
14
+ t(a("abc-def", ["abc"])).toEqual("abc__def");
15
+ });
16
+ }), s("getBEMBase", () => {
17
+ o("returns the base BEM of a Block with no elements or modifiers", () => {
18
+ t(e("foo")).toEqual("foo");
19
+ }), o("returns the base BEM of a Block with an element but no modifiers", () => {
20
+ t(e("foo__bar")).toEqual("foo__bar");
21
+ }), o("returns the base BEM of a Block with no elements but a modifier", () => {
22
+ t(e("foo--baz")).toEqual("foo");
23
+ }), o("returns the base BEM of a Block with an element and a modifier", () => {
24
+ t(e("foo__bar--baz")).toEqual("foo__bar");
25
+ }), o("returns empty if given nothing", () => {
26
+ t(e("")).toEqual("");
27
+ });
28
+ }), s("getBEMBlock", () => {
29
+ o("returns the block part of a full BEM style string", () => {
30
+ t(r("foo__bar--baz")).toEqual("foo");
31
+ }), o("returns the block part of a BEM style string that has just block and element", () => {
32
+ t(r("foo__bar")).toEqual("foo");
33
+ }), o("returns the block part of a BEM style string that has just block and modifier", () => {
34
+ t(r("foo--baz")).toEqual("foo");
35
+ }), o("returns the block part of a BEM style string that has just a block", () => {
36
+ t(r("foo")).toEqual("foo");
37
+ }), o("returns nothing if nothing passed in", () => {
38
+ t(r("")).toEqual("");
39
+ });
40
+ });
41
+ });