@pismo/marola 0.0.1-alpha.11 → 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 (34) hide show
  1. package/dist/{ClickAwayListener-BKznXF1d.js → ClickAwayListener-HI1G6ob9.js} +2 -1
  2. package/dist/Popup-DFJQc_jn.js +1249 -0
  3. package/dist/{Portal-BcdMtRGF.js → Portal-D__zvwbZ.js} +1 -1
  4. package/dist/SelectButton-DWtqAiwt.js +45 -0
  5. package/dist/Tabs.module-jkH1Qjn7.js +22 -0
  6. package/dist/assets/SelectButton.css +1 -0
  7. package/dist/combineHooksSlotProps-BHqhiBfc.js +81 -0
  8. package/dist/components/Button/Button.stories.js +7 -6
  9. package/dist/components/Dialog/Dialog.js +13 -12
  10. package/dist/components/Dialog/Dialog.stories.js +8 -7
  11. package/dist/components/LoadingSpinner/LoadingSpinner.stories.js +5 -4
  12. package/dist/components/PageHeader/PageHeader.stories.js +3 -3
  13. package/dist/components/Select/Select.d.ts +25 -0
  14. package/dist/components/Select/Select.js +860 -0
  15. package/dist/components/Select/Select.stories.d.ts +31 -0
  16. package/dist/components/Select/Select.stories.js +66 -0
  17. package/dist/components/Select/SelectButton.d.ts +13 -0
  18. package/dist/components/Select/SelectButton.js +8 -0
  19. package/dist/components/Snackbar/Snackbar.js +5 -4
  20. package/dist/components/Tabs/Tab.js +180 -6
  21. package/dist/components/Tabs/TabPanel.js +19 -18
  22. package/dist/components/Tabs/Tabs.js +237 -662
  23. package/dist/components/Tooltip/Tooltip.js +89 -1328
  24. package/dist/components/Typography/Typography.stories.js +5 -4
  25. package/dist/components/Typography/typography.test.js +3 -2
  26. package/dist/{index-BNWbc5Kh.js → index-BJ8HbRCy.js} +3109 -3152
  27. package/dist/main.d.ts +1 -0
  28. package/dist/main.js +34 -31
  29. package/dist/useCompoundItem-D1iRfg8D.js +84 -0
  30. package/dist/useEventCallback-vAfOD-oT.js +45 -0
  31. package/dist/useList-ByMguSS_.js +437 -0
  32. package/package.json +1 -1
  33. package/dist/Tab-CRwnhsj5.js +0 -254
  34. package/dist/Tabs.module-yYcTJnj6.js +0 -103
@@ -1,559 +1,134 @@
1
- import { jsx as E } from "react/jsx-runtime";
2
- import * as i from "react";
3
- import { forwardRef as xe, useState as Ve } from "react";
4
- import { c as Q, C as Z, T as Te, u as Ie, s as Se } from "../../Tabs.module-yYcTJnj6.js";
5
- import { L as S, a as Re } from "../../Tab-CRwnhsj5.js";
6
- import { T as bt } from "../../Tab-CRwnhsj5.js";
7
- import { TabPanel as vt } from "./TabPanel.js";
8
- import { a as b, _ as ee } from "../../objectWithoutPropertiesLoose-D7Cp0Pg_.js";
9
- import { u as we, e as Pe, g as te, a as ne, b as oe, P as v, c as le, d as se } from "../../index-CqjC7P5Y.js";
10
- import { u as ye } from "../../useControlled-CCMYYdCM.js";
11
- function J(t, e, l = (n, o) => n === o) {
12
- return t.length === e.length && t.every((n, o) => l(n, e[o]));
1
+ import { jsx as T } from "react/jsx-runtime";
2
+ import * as r from "react";
3
+ import { forwardRef as q, useState as B } from "react";
4
+ import { T as G, u as J, s as Q } from "../../Tabs.module-jkH1Qjn7.js";
5
+ import { Tab as Ie } from "./Tab.js";
6
+ import { TabPanel as Fe } from "./TabPanel.js";
7
+ import { a as C, _ as I } from "../../objectWithoutPropertiesLoose-D7Cp0Pg_.js";
8
+ import { g as _, a as F, b as $, P as t, c as N, d as M } from "../../index-CqjC7P5Y.js";
9
+ import { b as O, C as S } from "../../useCompoundItem-D1iRfg8D.js";
10
+ import { u as X } from "../../useControlled-CCMYYdCM.js";
11
+ import { L as Y, a as Z } from "../../combineHooksSlotProps-BHqhiBfc.js";
12
+ import { l as ee, m as te, u as oe } from "../../useList-ByMguSS_.js";
13
+ const k = "Tabs";
14
+ function se(s) {
15
+ return _(k, s);
13
16
  }
14
- function De(t, e) {
15
- return t === e;
16
- }
17
- const W = {}, Y = () => {
18
- };
19
- function q(t, e) {
20
- const l = b({}, t);
21
- return Object.keys(e).forEach((n) => {
22
- e[n] !== void 0 && (l[n] = e[n]);
23
- }), l;
24
- }
25
- function Ee(t) {
26
- const {
27
- nextState: e,
28
- initialState: l,
29
- stateComparers: n,
30
- onStateChange: o,
31
- controlledProps: a,
32
- lastActionRef: s
33
- } = t, u = i.useRef(l);
34
- i.useEffect(() => {
35
- if (s.current === null)
36
- return;
37
- const r = q(u.current, a);
38
- Object.keys(e).forEach((d) => {
39
- var m;
40
- const g = (m = n[d]) != null ? m : De, h = e[d], f = r[d];
41
- if (f == null && h != null || f != null && h == null || f != null && h != null && !g(h, f)) {
42
- var c, C;
43
- o == null || o((c = s.current.event) != null ? c : null, d, h, (C = s.current.type) != null ? C : "", e);
44
- }
45
- }), u.current = e, s.current = null;
46
- }, [u, e, s, o, n, a]);
47
- }
48
- function Me(t) {
49
- const e = i.useRef(null), {
50
- reducer: l,
51
- initialState: n,
52
- controlledProps: o = W,
53
- stateComparers: a = W,
54
- onStateChange: s = Y,
55
- actionContext: u,
56
- componentName: r = ""
57
- } = t, d = i.useRef(o);
58
- process.env.NODE_ENV !== "production" && i.useEffect(() => {
59
- Object.keys(o).forEach((c) => {
60
- d.current[c] !== void 0 && o[c] === void 0 && console.error(`useControllableReducer: ${r ? `The ${r} component` : "A component"} is changing a controlled prop to be uncontrolled: ${c}`), d.current[c] === void 0 && o[c] !== void 0 && console.error(`useControllableReducer: ${r ? `The ${r} component` : "A component"} is changing an uncontrolled prop to be controlled: ${c}`);
61
- });
62
- }, [o, r]);
63
- const m = i.useCallback((c, C) => {
64
- e.current = C;
65
- const V = q(c, o);
66
- return l(V, C);
67
- }, [o, l]), [g, h] = i.useReducer(m, n), f = i.useCallback((c) => {
68
- h(b({}, c, {
69
- context: u
70
- }));
71
- }, [u]);
72
- return Ee({
73
- nextState: g,
74
- initialState: n,
75
- stateComparers: a ?? W,
76
- onStateChange: s ?? Y,
77
- controlledProps: o,
78
- lastActionRef: e
79
- }), [q(g, o), f];
80
- }
81
- function Oe(t, e, l, n, o, a) {
82
- if (l.length === 0 || !n && l.every((u, r) => o(u, r)))
83
- return -1;
84
- let s = t;
85
- for (; ; ) {
86
- if (!a && e === "next" && s === l.length || !a && e === "previous" && s === -1)
87
- return -1;
88
- if (n ? !1 : o(l[s], s))
89
- s += e === "next" ? 1 : -1, a && (s = (s + l.length) % l.length);
90
- else
91
- return s;
92
- }
93
- }
94
- function w(t, e, l) {
95
- var n;
96
- const {
97
- items: o,
98
- isItemDisabled: a,
99
- disableListWrap: s,
100
- disabledItemsFocusable: u,
101
- itemComparer: r,
102
- focusManagement: d
103
- } = l, m = d === "DOM" ? 0 : -1, g = o.length - 1, h = t == null ? -1 : o.findIndex((T) => r(T, t));
104
- let f, c, C = !s;
105
- switch (e) {
106
- case "reset":
107
- if (m === -1)
108
- return null;
109
- f = 0, c = "next", C = !1;
110
- break;
111
- case "start":
112
- f = 0, c = "next", C = !1;
113
- break;
114
- case "end":
115
- f = g, c = "previous", C = !1;
116
- break;
117
- default: {
118
- const T = h + e;
119
- T < 0 ? !C && h !== -1 || Math.abs(e) > 1 ? (f = 0, c = "next") : (f = g, c = "previous") : T > g ? !C || Math.abs(e) > 1 ? (f = g, c = "previous") : (f = 0, c = "next") : (f = T, c = e >= 0 ? "next" : "previous");
120
- }
121
- }
122
- const V = Oe(f, c, o, u, a, C);
123
- return V === -1 && t !== null && !a(t, h) ? t : (n = o[V]) != null ? n : null;
124
- }
125
- function ke(t, e, l, n) {
126
- return l === "none" ? [] : l === "single" ? n(e[0], t) ? e : [t] : e.some((o) => n(o, t)) ? e.filter((o) => !n(o, t)) : [...e, t];
127
- }
128
- function re(t, e, l) {
129
- const {
130
- itemComparer: n,
131
- isItemDisabled: o,
132
- selectionMode: a,
133
- items: s
134
- } = l, {
135
- selectedValues: u
136
- } = e, r = s.findIndex((m) => n(t, m));
137
- if (o(t, r))
138
- return e;
139
- const d = ke(t, u, a, n);
140
- return b({}, e, {
141
- selectedValues: d,
142
- highlightedValue: t
143
- });
144
- }
145
- function Le(t, e, l) {
146
- const n = e.highlightedValue, {
147
- orientation: o,
148
- pageSize: a
149
- } = l;
150
- switch (t) {
151
- case "Home":
152
- return b({}, e, {
153
- highlightedValue: w(n, "start", l)
154
- });
155
- case "End":
156
- return b({}, e, {
157
- highlightedValue: w(n, "end", l)
158
- });
159
- case "PageUp":
160
- return b({}, e, {
161
- highlightedValue: w(n, -a, l)
162
- });
163
- case "PageDown":
164
- return b({}, e, {
165
- highlightedValue: w(n, a, l)
166
- });
167
- case "ArrowUp":
168
- if (o !== "vertical")
169
- break;
170
- return b({}, e, {
171
- highlightedValue: w(n, -1, l)
172
- });
173
- case "ArrowDown":
174
- if (o !== "vertical")
175
- break;
176
- return b({}, e, {
177
- highlightedValue: w(n, 1, l)
178
- });
179
- case "ArrowLeft": {
180
- if (o === "vertical")
181
- break;
182
- return b({}, e, {
183
- highlightedValue: w(n, o === "horizontal-ltr" ? -1 : 1, l)
184
- });
185
- }
186
- case "ArrowRight": {
187
- if (o === "vertical")
188
- break;
189
- return b({}, e, {
190
- highlightedValue: w(n, o === "horizontal-ltr" ? 1 : -1, l)
191
- });
192
- }
193
- case "Enter":
194
- case " ":
195
- return e.highlightedValue === null ? e : re(e.highlightedValue, e, l);
196
- }
197
- return e;
198
- }
199
- function Ne(t, e) {
200
- return e.focusManagement === "DOM" ? t : b({}, t, {
201
- highlightedValue: null
202
- });
203
- }
204
- function $e(t, e, l) {
205
- var n;
206
- const o = (n = l(t)) == null ? void 0 : n.trim().toLowerCase();
207
- return !o || o.length === 0 ? !1 : o.indexOf(e) === 0;
208
- }
209
- function _e(t, e, l) {
210
- const {
211
- items: n,
212
- isItemDisabled: o,
213
- disabledItemsFocusable: a,
214
- getItemAsString: s
215
- } = l, u = e.length > 1;
216
- let r = u ? t.highlightedValue : w(t.highlightedValue, 1, l);
217
- for (let d = 0; d < n.length; d += 1) {
218
- if (!r || !u && t.highlightedValue === r)
219
- return t;
220
- if ($e(r, e, s) && (!o(r, n.indexOf(r)) || a))
221
- return b({}, t, {
222
- highlightedValue: r
223
- });
224
- r = w(r, 1, l);
225
- }
226
- return t;
227
- }
228
- function Ae(t, e, l, n) {
229
- var o;
230
- const {
231
- itemComparer: a,
232
- focusManagement: s
233
- } = n;
234
- let u = null;
235
- if (l.highlightedValue != null) {
236
- var r;
237
- u = (r = t.find((g) => a(g, l.highlightedValue))) != null ? r : null;
238
- } else
239
- s === "DOM" && e.length === 0 && (u = w(null, "reset", n));
240
- const m = ((o = l.selectedValues) != null ? o : []).filter((g) => t.some((h) => a(h, g)));
241
- return b({}, l, {
242
- highlightedValue: u,
243
- selectedValues: m
244
- });
245
- }
246
- function Fe(t, e) {
247
- return b({}, t, {
248
- highlightedValue: w(null, "reset", e)
249
- });
250
- }
251
- function He(t, e) {
252
- return b({}, t, {
253
- highlightedValue: w(null, "end", e)
254
- });
255
- }
256
- function ze(t, e) {
257
- return b({}, t, {
258
- selectedValues: [],
259
- highlightedValue: w(null, "reset", e)
260
- });
261
- }
262
- function ae(t, e) {
263
- const {
264
- type: l,
265
- context: n
266
- } = e;
267
- switch (l) {
268
- case S.keyDown:
269
- return Le(e.key, t, n);
270
- case S.itemClick:
271
- return re(e.item, t, n);
272
- case S.blur:
273
- return Ne(t, n);
274
- case S.textNavigation:
275
- return _e(t, e.searchString, n);
276
- case S.itemsChange:
277
- return Ae(e.items, e.previousItems, t, n);
278
- case S.resetHighlight:
279
- return Fe(t, n);
280
- case S.highlightLast:
281
- return He(t, n);
282
- case S.clearSelection:
283
- return ze(t, n);
284
- default:
285
- return t;
286
- }
287
- }
288
- const Ue = 500;
289
- function je(t) {
290
- const e = i.useRef({
291
- searchString: "",
292
- lastTime: null
293
- });
294
- return i.useCallback((l) => {
295
- if (l.key.length === 1 && l.key !== " ") {
296
- const n = e.current, o = l.key.toLowerCase(), a = performance.now();
297
- n.searchString.length > 0 && n.lastTime && a - n.lastTime > Ue ? n.searchString = o : (n.searchString.length !== 1 || o !== n.searchString) && (n.searchString += o), n.lastTime = a, t(n.searchString, l);
298
- }
299
- }, [t]);
300
- }
301
- const X = {}, Be = () => {
302
- }, Ke = (t, e) => t === e, We = () => !1, qe = (t) => typeof t == "string" ? t : String(t), Ge = () => ({
303
- highlightedValue: null,
304
- selectedValues: []
305
- });
306
- function Je(t) {
307
- const {
308
- controlledProps: e = X,
309
- disabledItemsFocusable: l = !1,
310
- disableListWrap: n = !1,
311
- focusManagement: o = "activeDescendant",
312
- getInitialState: a = Ge,
313
- getItemDomElement: s,
314
- getItemId: u,
315
- isItemDisabled: r = We,
316
- rootRef: d,
317
- onStateChange: m = Be,
318
- items: g,
319
- itemComparer: h = Ke,
320
- getItemAsString: f = qe,
321
- onChange: c,
322
- onHighlightChange: C,
323
- onItemsChange: V,
324
- orientation: T = "vertical",
325
- pageSize: $ = 5,
326
- reducerActionContext: L = X,
327
- selectionMode: O = "single",
328
- stateReducer: _,
329
- componentName: U = "useList"
330
- } = t;
331
- if (process.env.NODE_ENV !== "production") {
332
- if (o === "DOM" && s == null)
333
- throw new Error("useList: The `getItemDomElement` prop is required when using the `DOM` focus management.");
334
- if (o === "activeDescendant" && u == null)
335
- throw new Error("useList: The `getItemId` prop is required when using the `activeDescendant` focus management.");
336
- }
337
- const A = i.useRef(null), F = we(d, A), k = i.useCallback((x, p, I) => {
338
- if (C == null || C(x, p, I), o === "DOM" && p != null && (I === S.itemClick || I === S.keyDown || I === S.textNavigation)) {
339
- var R;
340
- s == null || (R = s(p)) == null || R.focus();
341
- }
342
- }, [s, C, o]), H = i.useMemo(() => ({
343
- highlightedValue: h,
344
- selectedValues: (x, p) => J(x, p, h)
345
- }), [h]), P = i.useCallback((x, p, I, R, z) => {
346
- switch (m == null || m(x, p, I, R, z), p) {
347
- case "highlightedValue":
348
- k(x, I, R);
349
- break;
350
- case "selectedValues":
351
- c == null || c(x, I, R);
352
- break;
353
- }
354
- }, [k, c, m]), y = i.useMemo(() => ({
355
- disabledItemsFocusable: l,
356
- disableListWrap: n,
357
- focusManagement: o,
358
- isItemDisabled: r,
359
- itemComparer: h,
360
- items: g,
361
- getItemAsString: f,
362
- onHighlightChange: k,
363
- orientation: T,
364
- pageSize: $,
365
- selectionMode: O,
366
- stateComparers: H
367
- }), [l, n, o, r, h, g, f, k, T, $, O, H]), D = a(), ge = _ ?? ae, fe = i.useMemo(() => b({}, L, y), [L, y]), [j, M] = Me({
368
- reducer: ge,
369
- actionContext: fe,
370
- initialState: D,
371
- controlledProps: e,
372
- stateComparers: H,
373
- onStateChange: P,
374
- componentName: U
375
- }), {
376
- highlightedValue: N,
377
- selectedValues: B
378
- } = j, me = je((x, p) => M({
379
- type: S.textNavigation,
380
- event: p,
381
- searchString: x
382
- })), K = i.useRef([]);
383
- i.useEffect(() => {
384
- J(K.current, g, h) || (M({
385
- type: S.itemsChange,
386
- event: null,
387
- items: g,
388
- previousItems: K.current
389
- }), K.current = g, V == null || V(g));
390
- }, [g, h, M, V]);
391
- const pe = (x) => (p) => {
392
- var I;
393
- if ((I = x.onKeyDown) == null || I.call(x, p), p.defaultMuiPrevented)
394
- return;
395
- const R = ["Home", "End", "PageUp", "PageDown"];
396
- T === "vertical" ? R.push("ArrowUp", "ArrowDown") : R.push("ArrowLeft", "ArrowRight"), o === "activeDescendant" && R.push(" ", "Enter"), R.includes(p.key) && p.preventDefault(), M({
397
- type: S.keyDown,
398
- key: p.key,
399
- event: p
400
- }), me(p);
401
- }, be = (x) => (p) => {
402
- var I, R;
403
- (I = x.onBlur) == null || I.call(x, p), !p.defaultMuiPrevented && ((R = A.current) != null && R.contains(p.relatedTarget) || M({
404
- type: S.blur,
405
- event: p
406
- }));
407
- }, Ce = (x = {}) => {
408
- const p = Pe(x);
409
- return b({}, x, {
410
- "aria-activedescendant": o === "activeDescendant" && N != null ? u(N) : void 0,
411
- tabIndex: o === "DOM" ? -1 : 0,
412
- ref: F
413
- }, p, {
414
- onBlur: be(p),
415
- onKeyDown: pe(p)
416
- });
417
- }, G = i.useCallback((x) => {
418
- const p = (B ?? []).some((z) => z != null && h(x, z)), I = N != null && h(x, N);
419
- return {
420
- focusable: o === "DOM",
421
- highlighted: I,
422
- selected: p
423
- };
424
- }, [h, B, N, o]), ve = i.useMemo(() => ({
425
- dispatch: M,
426
- getItemState: G
427
- }), [M, G]);
428
- return i.useDebugValue({
429
- state: j
430
- }), {
431
- contextValue: ve,
432
- dispatch: M,
433
- getRootProps: Ce,
434
- rootRef: F,
435
- state: j
436
- };
437
- }
438
- const ie = "Tabs";
439
- function Ye(t) {
440
- return te(ie, t);
441
- }
442
- ne(ie, ["root", "horizontal", "vertical"]);
443
- function Xe(t) {
17
+ F(k, ["root", "horizontal", "vertical"]);
18
+ function ne(s) {
444
19
  const {
445
20
  value: e,
446
- defaultValue: l,
21
+ defaultValue: o,
447
22
  onChange: n,
448
- orientation: o = "horizontal",
449
- direction: a = "ltr",
450
- selectionFollowsFocus: s = !1
451
- } = t, [u, r] = ye({
23
+ orientation: i = "horizontal",
24
+ direction: c = "ltr",
25
+ selectionFollowsFocus: l = !1
26
+ } = s, [d, u] = X({
452
27
  controlled: e,
453
- default: l,
28
+ default: o,
454
29
  name: "Tabs",
455
30
  state: "value"
456
- }), d = i.useCallback((V, T) => {
457
- r(T), n == null || n(V, T);
458
- }, [n, r]), {
31
+ }), a = r.useCallback((x, y) => {
32
+ u(y), n == null || n(x, y);
33
+ }, [n, u]), {
459
34
  subitems: m,
460
35
  contextValue: g
461
- } = Q(), h = i.useRef(() => {
462
- }), f = i.useCallback((V) => {
463
- var T;
464
- return (T = m.get(V)) == null ? void 0 : T.id;
465
- }, [m]), c = i.useCallback((V) => h.current(V), []), C = i.useCallback((V) => {
466
- h.current = V;
36
+ } = O(), p = r.useRef(() => {
37
+ }), f = r.useCallback((x) => {
38
+ var y;
39
+ return (y = m.get(x)) == null ? void 0 : y.id;
40
+ }, [m]), b = r.useCallback((x) => p.current(x), []), P = r.useCallback((x) => {
41
+ p.current = x;
467
42
  }, []);
468
43
  return {
469
- contextValue: b({
470
- direction: a,
471
- getTabId: c,
44
+ contextValue: C({
45
+ direction: c,
46
+ getTabId: b,
472
47
  getTabPanelId: f,
473
- onSelected: d,
474
- orientation: o,
475
- registerTabIdLookup: C,
476
- selectionFollowsFocus: s,
477
- value: u
48
+ onSelected: a,
49
+ orientation: i,
50
+ registerTabIdLookup: P,
51
+ selectionFollowsFocus: l,
52
+ value: d
478
53
  }, g)
479
54
  };
480
55
  }
481
- function Qe(t) {
56
+ function le(s) {
482
57
  const {
483
58
  value: e,
484
- children: l
485
- } = t, {
59
+ children: o
60
+ } = s, {
486
61
  direction: n,
487
- getItemIndex: o,
488
- onSelected: a,
489
- orientation: s,
490
- registerItem: u,
491
- registerTabIdLookup: r,
492
- selectionFollowsFocus: d,
62
+ getItemIndex: i,
63
+ onSelected: c,
64
+ orientation: l,
65
+ registerItem: d,
66
+ registerTabIdLookup: u,
67
+ selectionFollowsFocus: a,
493
68
  totalSubitemCount: m,
494
69
  value: g,
495
- getTabId: h,
70
+ getTabId: p,
496
71
  getTabPanelId: f
497
- } = e, c = i.useMemo(() => ({
498
- getItemIndex: o,
499
- registerItem: u,
72
+ } = e, b = r.useMemo(() => ({
73
+ getItemIndex: i,
74
+ registerItem: d,
500
75
  totalSubitemCount: m
501
- }), [u, o, m]), C = i.useMemo(() => ({
76
+ }), [d, i, m]), P = r.useMemo(() => ({
502
77
  direction: n,
503
- getTabId: h,
78
+ getTabId: p,
504
79
  getTabPanelId: f,
505
- onSelected: a,
506
- orientation: s,
507
- registerTabIdLookup: r,
508
- selectionFollowsFocus: d,
80
+ onSelected: c,
81
+ orientation: l,
82
+ registerTabIdLookup: u,
83
+ selectionFollowsFocus: a,
509
84
  value: g
510
- }), [n, h, f, a, s, r, d, g]);
511
- return /* @__PURE__ */ E(Z.Provider, {
512
- value: c,
513
- children: /* @__PURE__ */ E(Te.Provider, {
514
- value: C,
515
- children: l
85
+ }), [n, p, f, c, l, u, a, g]);
86
+ return /* @__PURE__ */ T(S.Provider, {
87
+ value: b,
88
+ children: /* @__PURE__ */ T(G.Provider, {
89
+ value: P,
90
+ children: o
516
91
  })
517
92
  });
518
93
  }
519
- const Ze = ["children", "value", "defaultValue", "orientation", "direction", "onChange", "selectionFollowsFocus", "slotProps", "slots"], et = (t) => {
94
+ const re = ["children", "value", "defaultValue", "orientation", "direction", "onChange", "selectionFollowsFocus", "slotProps", "slots"], ae = (s) => {
520
95
  const {
521
96
  orientation: e
522
- } = t;
523
- return le({
97
+ } = s;
98
+ return N({
524
99
  root: ["root", e]
525
- }, se(Ye));
526
- }, ue = /* @__PURE__ */ i.forwardRef(function(e, l) {
100
+ }, M(se));
101
+ }, w = /* @__PURE__ */ r.forwardRef(function(e, o) {
527
102
  var n;
528
103
  const {
529
- children: o,
530
- orientation: a = "horizontal",
531
- direction: s = "ltr",
532
- slotProps: u = {},
533
- slots: r = {}
534
- } = e, d = ee(e, Ze), m = b({}, e, {
535
- orientation: a,
536
- direction: s
104
+ children: i,
105
+ orientation: c = "horizontal",
106
+ direction: l = "ltr",
107
+ slotProps: d = {},
108
+ slots: u = {}
109
+ } = e, a = I(e, re), m = C({}, e, {
110
+ orientation: c,
111
+ direction: l
537
112
  }), {
538
113
  contextValue: g
539
- } = Xe(m), h = et(m), f = (n = r.root) != null ? n : "div", c = oe({
114
+ } = ne(m), p = ae(m), f = (n = u.root) != null ? n : "div", b = $({
540
115
  elementType: f,
541
- externalSlotProps: u.root,
542
- externalForwardedProps: d,
116
+ externalSlotProps: d.root,
117
+ externalForwardedProps: a,
543
118
  additionalProps: {
544
- ref: l
119
+ ref: o
545
120
  },
546
121
  ownerState: m,
547
- className: h.root
122
+ className: p.root
548
123
  });
549
- return /* @__PURE__ */ E(f, b({}, c, {
550
- children: /* @__PURE__ */ E(Qe, {
124
+ return /* @__PURE__ */ T(f, C({}, b, {
125
+ children: /* @__PURE__ */ T(le, {
551
126
  value: g,
552
- children: o
127
+ children: i
553
128
  })
554
129
  }));
555
130
  });
556
- process.env.NODE_ENV !== "production" && (ue.propTypes = {
131
+ process.env.NODE_ENV !== "production" && (w.propTypes = {
557
132
  // ┌────────────────────────────── Warning ──────────────────────────────┐
558
133
  // │ These PropTypes are generated from the TypeScript type definitions. │
559
134
  // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
@@ -561,231 +136,231 @@ process.env.NODE_ENV !== "production" && (ue.propTypes = {
561
136
  /**
562
137
  * The content of the component.
563
138
  */
564
- children: v.node,
139
+ children: t.node,
565
140
  /**
566
141
  * @ignore
567
142
  */
568
- className: v.string,
143
+ className: t.string,
569
144
  /**
570
145
  * The default value. Use when the component is not controlled.
571
146
  */
572
- defaultValue: v.oneOfType([v.number, v.string]),
147
+ defaultValue: t.oneOfType([t.number, t.string]),
573
148
  /**
574
149
  * The direction of the text.
575
150
  * @default 'ltr'
576
151
  */
577
- direction: v.oneOf(["ltr", "rtl"]),
152
+ direction: t.oneOf(["ltr", "rtl"]),
578
153
  /**
579
154
  * Callback invoked when new value is being set.
580
155
  */
581
- onChange: v.func,
156
+ onChange: t.func,
582
157
  /**
583
158
  * The component orientation (layout flow direction).
584
159
  * @default 'horizontal'
585
160
  */
586
- orientation: v.oneOf(["horizontal", "vertical"]),
161
+ orientation: t.oneOf(["horizontal", "vertical"]),
587
162
  /**
588
163
  * If `true` the selected tab changes on focus. Otherwise it only
589
164
  * changes on activation.
590
165
  */
591
- selectionFollowsFocus: v.bool,
166
+ selectionFollowsFocus: t.bool,
592
167
  /**
593
168
  * The props used for each slot inside the Tabs.
594
169
  * @default {}
595
170
  */
596
- slotProps: v.shape({
597
- root: v.oneOfType([v.func, v.object])
171
+ slotProps: t.shape({
172
+ root: t.oneOfType([t.func, t.object])
598
173
  }),
599
174
  /**
600
175
  * The components used for each slot inside the Tabs.
601
176
  * Either a string to use a HTML element or a component.
602
177
  * @default {}
603
178
  */
604
- slots: v.shape({
605
- root: v.elementType
179
+ slots: t.shape({
180
+ root: t.elementType
606
181
  }),
607
182
  /**
608
183
  * The value of the currently selected `Tab`.
609
184
  * If you don't want any selected `Tab`, you can set this prop to `null`.
610
185
  */
611
- value: v.oneOfType([v.number, v.string])
186
+ value: t.oneOfType([t.number, t.string])
612
187
  });
613
- const ce = "TabsList";
614
- function tt(t) {
615
- return te(ce, t);
188
+ const E = "TabsList";
189
+ function ie(s) {
190
+ return _(E, s);
616
191
  }
617
- ne(ce, ["root", "horizontal", "vertical"]);
618
- const de = {
192
+ F(E, ["root", "horizontal", "vertical"]);
193
+ const z = {
619
194
  valueChange: "valueChange"
620
195
  };
621
- function nt(t, e) {
622
- if (e.type === de.valueChange)
623
- return b({}, t, {
196
+ function ue(s, e) {
197
+ if (e.type === z.valueChange)
198
+ return C({}, s, {
624
199
  highlightedValue: e.value
625
200
  });
626
- const l = ae(t, e), {
201
+ const o = ee(s, e), {
627
202
  context: {
628
203
  selectionFollowsFocus: n
629
204
  }
630
205
  } = e;
631
- if (e.type === S.itemsChange) {
632
- if (l.selectedValues.length > 0)
633
- return b({}, l, {
634
- highlightedValue: l.selectedValues[0]
206
+ if (e.type === Y.itemsChange) {
207
+ if (o.selectedValues.length > 0)
208
+ return C({}, o, {
209
+ highlightedValue: o.selectedValues[0]
635
210
  });
636
- w(null, "reset", e.context);
211
+ te(null, "reset", e.context);
637
212
  }
638
- return n && l.highlightedValue != null ? b({}, l, {
639
- selectedValues: [l.highlightedValue]
640
- }) : l;
213
+ return n && o.highlightedValue != null ? C({}, o, {
214
+ selectedValues: [o.highlightedValue]
215
+ }) : o;
641
216
  }
642
- function ot(t) {
217
+ function ce(s) {
643
218
  var e;
644
219
  const {
645
- rootRef: l
646
- } = t, {
220
+ rootRef: o
221
+ } = s, {
647
222
  direction: n = "ltr",
648
- onSelected: o,
649
- orientation: a = "horizontal",
650
- value: s,
651
- registerTabIdLookup: u,
652
- selectionFollowsFocus: r
653
- } = Ie(), {
654
- subitems: d,
223
+ onSelected: i,
224
+ orientation: c = "horizontal",
225
+ value: l,
226
+ registerTabIdLookup: d,
227
+ selectionFollowsFocus: u
228
+ } = J(), {
229
+ subitems: a,
655
230
  contextValue: m
656
- } = Q(), g = i.useCallback((P) => {
657
- var y;
658
- return (y = d.get(P)) == null ? void 0 : y.id;
659
- }, [d]);
660
- u(g);
661
- const h = i.useMemo(() => Array.from(d.keys()), [d]), f = i.useCallback((P) => {
662
- var y, D;
663
- return P == null ? null : (y = (D = d.get(P)) == null ? void 0 : D.ref.current) != null ? y : null;
664
- }, [d]), c = n === "rtl";
665
- let C;
666
- a === "vertical" ? C = "vertical" : C = c ? "horizontal-rtl" : "horizontal-ltr";
667
- const V = i.useCallback((P, y) => {
668
- var D;
669
- o(P, (D = y[0]) != null ? D : null);
670
- }, [o]), T = i.useMemo(() => s === void 0 ? {} : s != null ? {
671
- selectedValues: [s]
231
+ } = O(), g = r.useCallback((h) => {
232
+ var v;
233
+ return (v = a.get(h)) == null ? void 0 : v.id;
234
+ }, [a]);
235
+ d(g);
236
+ const p = r.useMemo(() => Array.from(a.keys()), [a]), f = r.useCallback((h) => {
237
+ var v, V;
238
+ return h == null ? null : (v = (V = a.get(h)) == null ? void 0 : V.ref.current) != null ? v : null;
239
+ }, [a]), b = n === "rtl";
240
+ let P;
241
+ c === "vertical" ? P = "vertical" : P = b ? "horizontal-rtl" : "horizontal-ltr";
242
+ const x = r.useCallback((h, v) => {
243
+ var V;
244
+ i(h, (V = v[0]) != null ? V : null);
245
+ }, [i]), y = r.useMemo(() => l === void 0 ? {} : l != null ? {
246
+ selectedValues: [l]
672
247
  } : {
673
248
  selectedValues: []
674
- }, [s]), $ = i.useCallback((P) => {
675
- var y, D;
676
- return (y = (D = d.get(P)) == null ? void 0 : D.disabled) != null ? y : !1;
677
- }, [d]), {
249
+ }, [l]), U = r.useCallback((h) => {
250
+ var v, V;
251
+ return (v = (V = a.get(h)) == null ? void 0 : V.disabled) != null ? v : !1;
252
+ }, [a]), {
678
253
  contextValue: L,
679
- dispatch: O,
680
- getRootProps: _,
254
+ dispatch: R,
255
+ getRootProps: D,
681
256
  state: {
682
- highlightedValue: U,
683
- selectedValues: A
257
+ highlightedValue: j,
258
+ selectedValues: H
684
259
  },
685
- rootRef: F
686
- } = Je({
687
- controlledProps: T,
688
- disabledItemsFocusable: !r,
260
+ rootRef: K
261
+ } = oe({
262
+ controlledProps: y,
263
+ disabledItemsFocusable: !u,
689
264
  focusManagement: "DOM",
690
265
  getItemDomElement: f,
691
- isItemDisabled: $,
692
- items: h,
693
- rootRef: l,
694
- onChange: V,
695
- orientation: C,
696
- reducerActionContext: i.useMemo(() => ({
697
- selectionFollowsFocus: r || !1
698
- }), [r]),
266
+ isItemDisabled: U,
267
+ items: p,
268
+ rootRef: o,
269
+ onChange: x,
270
+ orientation: P,
271
+ reducerActionContext: r.useMemo(() => ({
272
+ selectionFollowsFocus: u || !1
273
+ }), [u]),
699
274
  selectionMode: "single",
700
- stateReducer: nt
275
+ stateReducer: ue
701
276
  });
702
- i.useEffect(() => {
703
- s !== void 0 && s != null && O({
704
- type: de.valueChange,
705
- value: s
277
+ r.useEffect(() => {
278
+ l !== void 0 && l != null && R({
279
+ type: z.valueChange,
280
+ value: l
706
281
  });
707
- }, [O, s]);
708
- const k = (P = {}) => b({}, P, _(P), {
709
- "aria-orientation": a === "vertical" ? "vertical" : void 0,
282
+ }, [R, l]);
283
+ const W = (h = {}) => C({}, h, D(h), {
284
+ "aria-orientation": c === "vertical" ? "vertical" : void 0,
710
285
  role: "tablist"
711
286
  });
712
287
  return {
713
- contextValue: i.useMemo(() => b({}, m, L), [m, L]),
714
- dispatch: O,
715
- getRootProps: k,
716
- highlightedValue: U,
717
- isRtl: c,
718
- orientation: a,
719
- rootRef: F,
720
- selectedValue: (e = A[0]) != null ? e : null
288
+ contextValue: r.useMemo(() => C({}, m, L), [m, L]),
289
+ dispatch: R,
290
+ getRootProps: W,
291
+ highlightedValue: j,
292
+ isRtl: b,
293
+ orientation: c,
294
+ rootRef: K,
295
+ selectedValue: (e = H[0]) != null ? e : null
721
296
  };
722
297
  }
723
- function lt(t) {
298
+ function de(s) {
724
299
  const {
725
300
  value: e,
726
- children: l
727
- } = t, {
301
+ children: o
302
+ } = s, {
728
303
  dispatch: n,
729
- getItemIndex: o,
730
- getItemState: a,
731
- registerItem: s,
732
- totalSubitemCount: u
733
- } = e, r = i.useMemo(() => ({
304
+ getItemIndex: i,
305
+ getItemState: c,
306
+ registerItem: l,
307
+ totalSubitemCount: d
308
+ } = e, u = r.useMemo(() => ({
734
309
  dispatch: n,
735
- getItemState: a,
736
- getItemIndex: o
737
- }), [n, o, a]), d = i.useMemo(() => ({
738
- getItemIndex: o,
739
- registerItem: s,
740
- totalSubitemCount: u
741
- }), [s, o, u]);
742
- return /* @__PURE__ */ E(Z.Provider, {
743
- value: d,
744
- children: /* @__PURE__ */ E(Re.Provider, {
745
- value: r,
746
- children: l
310
+ getItemState: c,
311
+ getItemIndex: i
312
+ }), [n, i, c]), a = r.useMemo(() => ({
313
+ getItemIndex: i,
314
+ registerItem: l,
315
+ totalSubitemCount: d
316
+ }), [l, i, d]);
317
+ return /* @__PURE__ */ T(S.Provider, {
318
+ value: a,
319
+ children: /* @__PURE__ */ T(Z.Provider, {
320
+ value: u,
321
+ children: o
747
322
  })
748
323
  });
749
324
  }
750
- const st = ["children", "slotProps", "slots"], rt = (t) => {
325
+ const me = ["children", "slotProps", "slots"], pe = (s) => {
751
326
  const {
752
327
  orientation: e
753
- } = t;
754
- return le({
328
+ } = s;
329
+ return N({
755
330
  root: ["root", e]
756
- }, se(tt));
757
- }, he = /* @__PURE__ */ i.forwardRef(function(e, l) {
331
+ }, M(ie));
332
+ }, A = /* @__PURE__ */ r.forwardRef(function(e, o) {
758
333
  var n;
759
334
  const {
760
- children: o,
761
- slotProps: a = {},
762
- slots: s = {}
763
- } = e, u = ee(e, st), {
764
- isRtl: r,
765
- orientation: d,
335
+ children: i,
336
+ slotProps: c = {},
337
+ slots: l = {}
338
+ } = e, d = I(e, me), {
339
+ isRtl: u,
340
+ orientation: a,
766
341
  getRootProps: m,
767
342
  contextValue: g
768
- } = ot({
769
- rootRef: l
770
- }), h = b({}, e, {
771
- isRtl: r,
772
- orientation: d
773
- }), f = rt(h), c = (n = s.root) != null ? n : "div", C = oe({
774
- elementType: c,
343
+ } = ce({
344
+ rootRef: o
345
+ }), p = C({}, e, {
346
+ isRtl: u,
347
+ orientation: a
348
+ }), f = pe(p), b = (n = l.root) != null ? n : "div", P = $({
349
+ elementType: b,
775
350
  getSlotProps: m,
776
- externalSlotProps: a.root,
777
- externalForwardedProps: u,
778
- ownerState: h,
351
+ externalSlotProps: c.root,
352
+ externalForwardedProps: d,
353
+ ownerState: p,
779
354
  className: f.root
780
355
  });
781
- return /* @__PURE__ */ E(lt, {
356
+ return /* @__PURE__ */ T(de, {
782
357
  value: g,
783
- children: /* @__PURE__ */ E(c, b({}, C, {
784
- children: o
358
+ children: /* @__PURE__ */ T(b, C({}, P, {
359
+ children: i
785
360
  }))
786
361
  });
787
362
  });
788
- process.env.NODE_ENV !== "production" && (he.propTypes = {
363
+ process.env.NODE_ENV !== "production" && (A.propTypes = {
789
364
  // ┌────────────────────────────── Warning ──────────────────────────────┐
790
365
  // │ These PropTypes are generated from the TypeScript type definitions. │
791
366
  // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
@@ -793,35 +368,35 @@ process.env.NODE_ENV !== "production" && (he.propTypes = {
793
368
  /**
794
369
  * The content of the component.
795
370
  */
796
- children: v.node,
371
+ children: t.node,
797
372
  /**
798
373
  * @ignore
799
374
  */
800
- className: v.string,
375
+ className: t.string,
801
376
  /**
802
377
  * The props used for each slot inside the TabsList.
803
378
  * @default {}
804
379
  */
805
- slotProps: v.shape({
806
- root: v.oneOfType([v.func, v.object])
380
+ slotProps: t.shape({
381
+ root: t.oneOfType([t.func, t.object])
807
382
  }),
808
383
  /**
809
384
  * The components used for each slot inside the TabsList.
810
385
  * Either a string to use a HTML element or a component.
811
386
  * @default {}
812
387
  */
813
- slots: v.shape({
814
- root: v.elementType
388
+ slots: t.shape({
389
+ root: t.elementType
815
390
  })
816
391
  });
817
- const ft = xe(({ children: t, onChange: e, dataTestId: l }, n) => {
818
- const [o, a] = Ve("1");
819
- return /* @__PURE__ */ E(ue, { "data-testid": l, value: o, onChange: (u, r) => {
820
- a(r), e && e(r, u);
821
- }, ref: n, children: /* @__PURE__ */ E(he, { className: Se.tabs, children: t }) });
392
+ const ye = q(({ children: s, onChange: e, dataTestId: o }, n) => {
393
+ const [i, c] = B("1");
394
+ return /* @__PURE__ */ T(w, { "data-testid": o, value: i, onChange: (d, u) => {
395
+ c(u), e && e(u, d);
396
+ }, ref: n, children: /* @__PURE__ */ T(A, { className: Q.tabs, children: s }) });
822
397
  });
823
398
  export {
824
- bt as Tab,
825
- vt as TabPanel,
826
- ft as Tabs
399
+ Ie as Tab,
400
+ Fe as TabPanel,
401
+ ye as Tabs
827
402
  };