@pismo/marola 0.0.1-alpha.32 → 0.0.1-alpha.5

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