@pismo/marola 0.0.1-alpha.4 → 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.
- package/README.md +4 -3
- package/dist/{Button-C3Qm852g.js → Button-D--uN90N.js} +6 -5
- package/dist/Dialog.module-BKWFakxu.js +15 -0
- package/dist/{ListContext-D6-YwtZn.js → ListContext-Dj2Va7Iv.js} +2 -2
- package/dist/{Tabs.module-_kSbSyth.js → Tabs.module-BKlNuSPH.js} +20 -20
- package/dist/assets/Button.css +1 -0
- package/dist/assets/Dialog.css +1 -1
- package/dist/assets/IconButton.css +1 -0
- package/dist/assets/LoadingSpinner.css +1 -1
- package/dist/assets/PageHeader.css +1 -0
- package/dist/assets/Pagination.css +1 -0
- package/dist/assets/Tabs.css +1 -1
- package/dist/assets/Typography.css +1 -1
- package/dist/assets/main.css +1 -1
- package/dist/components/Button/Button.d.ts +21 -0
- package/dist/components/Button/Button.js +54 -0
- package/dist/components/Dialog/Actions.js +1 -1
- package/dist/components/Dialog/Backdrop.js +2 -9
- package/dist/components/Dialog/CloseIconButton.js +3 -3
- package/dist/components/Dialog/Dialog.d.ts +2 -2
- package/dist/components/Dialog/Dialog.js +22 -26
- package/dist/components/Dialog/Title.js +22 -7
- package/dist/components/IconButton/IconButton.d.ts +22 -0
- package/dist/components/IconButton/IconButton.js +79 -0
- package/dist/components/LoadingSpinner/LoadingSpinner.js +12 -13
- package/dist/components/PageHeader/PageHeader.d.ts +26 -0
- package/dist/components/PageHeader/PageHeader.js +69 -0
- package/dist/components/Pagination/Pagination.d.ts +36 -0
- package/dist/components/Pagination/Pagination.js +219 -0
- package/dist/components/SortTooltip/SortTooltip.d.ts +0 -0
- package/dist/components/SortTooltip/SortTooltip.js +1 -0
- package/dist/components/Table/Table.d.ts +0 -0
- package/dist/components/Table/Table.js +1 -0
- package/dist/components/Table/TableContext.d.ts +0 -0
- package/dist/components/Table/TableContext.js +1 -0
- package/dist/components/Tabs/Tab.js +42 -37
- package/dist/components/Tabs/TabPanel.js +20 -21
- package/dist/components/Tabs/Tabs.js +185 -214
- package/dist/components/Tooltip/Tooltip.d.ts +0 -0
- package/dist/components/Tooltip/Tooltip.js +1 -0
- package/dist/components/Typography/Typography.d.ts +1 -1
- package/dist/components/Typography/Typography.js +38 -47
- package/dist/{index-BZ1lkM_M.js → index-BvA1HyDs.js} +274 -293
- package/dist/main.d.ts +4 -1
- package/dist/main.js +22 -15
- package/dist/objectWithoutPropertiesLoose-ClNcje2_.js +22 -0
- package/dist/types/helpers.d.ts +6 -7
- package/dist/{useButton-CbmjmH5z.js → useButton-abQpo0za.js} +17 -16
- package/dist/{useCompoundItem-B7wfGDHQ.js → useCompoundItem-wTwXbURC.js} +1 -1
- package/dist/useControlled-CCMYYdCM.js +31 -0
- package/package.json +26 -6
- package/dist/Dialog.module-BO0mdB7d.js +0 -15
- package/dist/assets/CallToActionButton.css +0 -1
- package/dist/components/CallToActionButton/CallToActionButton.d.ts +0 -21
- package/dist/components/CallToActionButton/CallToActionButton.js +0 -57
- package/src/playground/Playground.tsx +0 -20
|
@@ -1,40 +1,15 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { u as Q, C as Z, T as Ve, a as xe, s as Te } from "../../Tabs.module-_kSbSyth.js";
|
|
1
|
+
import { jsx as E } from "react/jsx-runtime";
|
|
3
2
|
import * as i from "react";
|
|
4
|
-
import { forwardRef as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
3
|
+
import { forwardRef as xe, useState as Ve } from "react";
|
|
4
|
+
import { a as Q, C as Z, T as Te, u as Ie, s as Se } from "../../Tabs.module-BKlNuSPH.js";
|
|
5
|
+
import { a as b, _ as ee } from "../../objectWithoutPropertiesLoose-ClNcje2_.js";
|
|
6
|
+
import { f as Re, h as we, g as te, a as ne, u as oe, P as v, c as le, b as se } from "../../index-BvA1HyDs.js";
|
|
7
|
+
import { u as Pe } from "../../useControlled-CCMYYdCM.js";
|
|
8
|
+
import { a as S, L as ye } from "../../ListContext-Dj2Va7Iv.js";
|
|
9
|
+
function J(t, e, l = (n, o) => n === o) {
|
|
8
10
|
return t.length === e.length && t.every((n, o) => l(n, e[o]));
|
|
9
11
|
}
|
|
10
|
-
function
|
|
11
|
-
controlled: t,
|
|
12
|
-
default: e,
|
|
13
|
-
name: l,
|
|
14
|
-
state: n = "value"
|
|
15
|
-
}) {
|
|
16
|
-
const {
|
|
17
|
-
current: o
|
|
18
|
-
} = i.useRef(t !== void 0), [a, s] = i.useState(e), u = o ? t : a;
|
|
19
|
-
if (process.env.NODE_ENV !== "production") {
|
|
20
|
-
i.useEffect(() => {
|
|
21
|
-
o !== (t !== void 0) && console.error([`MUI: A component is changing the ${o ? "" : "un"}controlled ${n} state of ${l} to be ${o ? "un" : ""}controlled.`, "Elements should not switch from uncontrolled to controlled (or vice versa).", `Decide between using a controlled or uncontrolled ${l} element for the lifetime of the component.`, "The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.", "More info: https://fb.me/react-controlled-components"].join(`
|
|
22
|
-
`));
|
|
23
|
-
}, [n, l, t]);
|
|
24
|
-
const {
|
|
25
|
-
current: c
|
|
26
|
-
} = i.useRef(e);
|
|
27
|
-
i.useEffect(() => {
|
|
28
|
-
!o && c !== e && console.error([`MUI: A component is changing the default ${n} state of an uncontrolled ${l} after being initialized. To suppress this warning opt to use a controlled ${l}.`].join(`
|
|
29
|
-
`));
|
|
30
|
-
}, [JSON.stringify(e)]);
|
|
31
|
-
}
|
|
32
|
-
const r = i.useCallback((c) => {
|
|
33
|
-
o || s(c);
|
|
34
|
-
}, []);
|
|
35
|
-
return [u, r];
|
|
36
|
-
}
|
|
37
|
-
function ye(t, e) {
|
|
12
|
+
function De(t, e) {
|
|
38
13
|
return t === e;
|
|
39
14
|
}
|
|
40
15
|
const W = {}, Y = () => {
|
|
@@ -45,7 +20,7 @@ function q(t, e) {
|
|
|
45
20
|
e[n] !== void 0 && (l[n] = e[n]);
|
|
46
21
|
}), l;
|
|
47
22
|
}
|
|
48
|
-
function
|
|
23
|
+
function Ee(t) {
|
|
49
24
|
const {
|
|
50
25
|
nextState: e,
|
|
51
26
|
initialState: l,
|
|
@@ -58,17 +33,17 @@ function Me(t) {
|
|
|
58
33
|
if (s.current === null)
|
|
59
34
|
return;
|
|
60
35
|
const r = q(u.current, a);
|
|
61
|
-
Object.keys(e).forEach((
|
|
36
|
+
Object.keys(e).forEach((d) => {
|
|
62
37
|
var m;
|
|
63
|
-
const
|
|
64
|
-
if (
|
|
65
|
-
var
|
|
66
|
-
o == null || o((
|
|
38
|
+
const g = (m = n[d]) != null ? m : De, h = e[d], f = r[d];
|
|
39
|
+
if (f == null && h != null || f != null && h == null || f != null && h != null && !g(h, f)) {
|
|
40
|
+
var c, C;
|
|
41
|
+
o == null || o((c = s.current.event) != null ? c : null, d, h, (C = s.current.type) != null ? C : "", e);
|
|
67
42
|
}
|
|
68
43
|
}), u.current = e, s.current = null;
|
|
69
44
|
}, [u, e, s, o, n, a]);
|
|
70
45
|
}
|
|
71
|
-
function
|
|
46
|
+
function Me(t) {
|
|
72
47
|
const e = i.useRef(null), {
|
|
73
48
|
reducer: l,
|
|
74
49
|
initialState: n,
|
|
@@ -77,29 +52,29 @@ function De(t) {
|
|
|
77
52
|
onStateChange: s = Y,
|
|
78
53
|
actionContext: u,
|
|
79
54
|
componentName: r = ""
|
|
80
|
-
} = t,
|
|
55
|
+
} = t, d = i.useRef(o);
|
|
81
56
|
process.env.NODE_ENV !== "production" && i.useEffect(() => {
|
|
82
|
-
Object.keys(o).forEach((
|
|
83
|
-
|
|
57
|
+
Object.keys(o).forEach((c) => {
|
|
58
|
+
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}`);
|
|
84
59
|
});
|
|
85
60
|
}, [o, r]);
|
|
86
|
-
const m = i.useCallback((
|
|
61
|
+
const m = i.useCallback((c, C) => {
|
|
87
62
|
e.current = C;
|
|
88
|
-
const
|
|
89
|
-
return l(
|
|
90
|
-
}, [o, l]), [
|
|
91
|
-
h(b({},
|
|
63
|
+
const V = q(c, o);
|
|
64
|
+
return l(V, C);
|
|
65
|
+
}, [o, l]), [g, h] = i.useReducer(m, n), f = i.useCallback((c) => {
|
|
66
|
+
h(b({}, c, {
|
|
92
67
|
context: u
|
|
93
68
|
}));
|
|
94
69
|
}, [u]);
|
|
95
|
-
return
|
|
96
|
-
nextState:
|
|
70
|
+
return Ee({
|
|
71
|
+
nextState: g,
|
|
97
72
|
initialState: n,
|
|
98
73
|
stateComparers: a ?? W,
|
|
99
74
|
onStateChange: s ?? Y,
|
|
100
75
|
controlledProps: o,
|
|
101
76
|
lastActionRef: e
|
|
102
|
-
}), [q(
|
|
77
|
+
}), [q(g, o), f];
|
|
103
78
|
}
|
|
104
79
|
function Oe(t, e, l, n, o, a) {
|
|
105
80
|
if (l.length === 0 || !n && l.every((u, r) => o(u, r)))
|
|
@@ -122,30 +97,30 @@ function w(t, e, l) {
|
|
|
122
97
|
disableListWrap: s,
|
|
123
98
|
disabledItemsFocusable: u,
|
|
124
99
|
itemComparer: r,
|
|
125
|
-
focusManagement:
|
|
126
|
-
} = l, m =
|
|
127
|
-
let
|
|
100
|
+
focusManagement: d
|
|
101
|
+
} = l, m = d === "DOM" ? 0 : -1, g = o.length - 1, h = t == null ? -1 : o.findIndex((T) => r(T, t));
|
|
102
|
+
let f, c, C = !s;
|
|
128
103
|
switch (e) {
|
|
129
104
|
case "reset":
|
|
130
105
|
if (m === -1)
|
|
131
106
|
return null;
|
|
132
|
-
|
|
107
|
+
f = 0, c = "next", C = !1;
|
|
133
108
|
break;
|
|
134
109
|
case "start":
|
|
135
|
-
|
|
110
|
+
f = 0, c = "next", C = !1;
|
|
136
111
|
break;
|
|
137
112
|
case "end":
|
|
138
|
-
|
|
113
|
+
f = g, c = "previous", C = !1;
|
|
139
114
|
break;
|
|
140
115
|
default: {
|
|
141
116
|
const T = h + e;
|
|
142
|
-
T < 0 ? !C && h !== -1 || Math.abs(e) > 1 ? (
|
|
117
|
+
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");
|
|
143
118
|
}
|
|
144
119
|
}
|
|
145
|
-
const
|
|
146
|
-
return
|
|
120
|
+
const V = Oe(f, c, o, u, a, C);
|
|
121
|
+
return V === -1 && t !== null && !a(t, h) ? t : (n = o[V]) != null ? n : null;
|
|
147
122
|
}
|
|
148
|
-
function
|
|
123
|
+
function ke(t, e, l, n) {
|
|
149
124
|
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];
|
|
150
125
|
}
|
|
151
126
|
function re(t, e, l) {
|
|
@@ -159,13 +134,13 @@ function re(t, e, l) {
|
|
|
159
134
|
} = e, r = s.findIndex((m) => n(t, m));
|
|
160
135
|
if (o(t, r))
|
|
161
136
|
return e;
|
|
162
|
-
const
|
|
137
|
+
const d = ke(t, u, a, n);
|
|
163
138
|
return b({}, e, {
|
|
164
|
-
selectedValues:
|
|
139
|
+
selectedValues: d,
|
|
165
140
|
highlightedValue: t
|
|
166
141
|
});
|
|
167
142
|
}
|
|
168
|
-
function
|
|
143
|
+
function Le(t, e, l) {
|
|
169
144
|
const n = e.highlightedValue, {
|
|
170
145
|
orientation: o,
|
|
171
146
|
pageSize: a
|
|
@@ -224,7 +199,7 @@ function Ne(t, e) {
|
|
|
224
199
|
highlightedValue: null
|
|
225
200
|
});
|
|
226
201
|
}
|
|
227
|
-
function
|
|
202
|
+
function $e(t, e, l) {
|
|
228
203
|
var n;
|
|
229
204
|
const o = (n = l(t)) == null ? void 0 : n.trim().toLowerCase();
|
|
230
205
|
return !o || o.length === 0 ? !1 : o.indexOf(e) === 0;
|
|
@@ -237,10 +212,10 @@ function _e(t, e, l) {
|
|
|
237
212
|
getItemAsString: s
|
|
238
213
|
} = l, u = e.length > 1;
|
|
239
214
|
let r = u ? t.highlightedValue : w(t.highlightedValue, 1, l);
|
|
240
|
-
for (let
|
|
215
|
+
for (let d = 0; d < n.length; d += 1) {
|
|
241
216
|
if (!r || !u && t.highlightedValue === r)
|
|
242
217
|
return t;
|
|
243
|
-
if (
|
|
218
|
+
if ($e(r, e, s) && (!o(r, n.indexOf(r)) || a))
|
|
244
219
|
return b({}, t, {
|
|
245
220
|
highlightedValue: r
|
|
246
221
|
});
|
|
@@ -257,10 +232,10 @@ function Ae(t, e, l, n) {
|
|
|
257
232
|
let u = null;
|
|
258
233
|
if (l.highlightedValue != null) {
|
|
259
234
|
var r;
|
|
260
|
-
u = (r = t.find((
|
|
235
|
+
u = (r = t.find((g) => a(g, l.highlightedValue))) != null ? r : null;
|
|
261
236
|
} else
|
|
262
237
|
s === "DOM" && e.length === 0 && (u = w(null, "reset", n));
|
|
263
|
-
const m = ((o = l.selectedValues) != null ? o : []).filter((
|
|
238
|
+
const m = ((o = l.selectedValues) != null ? o : []).filter((g) => t.some((h) => a(h, g)));
|
|
264
239
|
return b({}, l, {
|
|
265
240
|
highlightedValue: u,
|
|
266
241
|
selectedValues: m
|
|
@@ -271,7 +246,7 @@ function Fe(t, e) {
|
|
|
271
246
|
highlightedValue: w(null, "reset", e)
|
|
272
247
|
});
|
|
273
248
|
}
|
|
274
|
-
function
|
|
249
|
+
function He(t, e) {
|
|
275
250
|
return b({}, t, {
|
|
276
251
|
highlightedValue: w(null, "end", e)
|
|
277
252
|
});
|
|
@@ -289,7 +264,7 @@ function ae(t, e) {
|
|
|
289
264
|
} = e;
|
|
290
265
|
switch (l) {
|
|
291
266
|
case S.keyDown:
|
|
292
|
-
return
|
|
267
|
+
return Le(e.key, t, n);
|
|
293
268
|
case S.itemClick:
|
|
294
269
|
return re(e.item, t, n);
|
|
295
270
|
case S.blur:
|
|
@@ -301,14 +276,14 @@ function ae(t, e) {
|
|
|
301
276
|
case S.resetHighlight:
|
|
302
277
|
return Fe(t, n);
|
|
303
278
|
case S.highlightLast:
|
|
304
|
-
return
|
|
279
|
+
return He(t, n);
|
|
305
280
|
case S.clearSelection:
|
|
306
281
|
return ze(t, n);
|
|
307
282
|
default:
|
|
308
283
|
return t;
|
|
309
284
|
}
|
|
310
285
|
}
|
|
311
|
-
const
|
|
286
|
+
const Ue = 500;
|
|
312
287
|
function je(t) {
|
|
313
288
|
const e = i.useRef({
|
|
314
289
|
searchString: "",
|
|
@@ -317,39 +292,39 @@ function je(t) {
|
|
|
317
292
|
return i.useCallback((l) => {
|
|
318
293
|
if (l.key.length === 1 && l.key !== " ") {
|
|
319
294
|
const n = e.current, o = l.key.toLowerCase(), a = performance.now();
|
|
320
|
-
n.searchString.length > 0 && n.lastTime && a - n.lastTime >
|
|
295
|
+
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);
|
|
321
296
|
}
|
|
322
297
|
}, [t]);
|
|
323
298
|
}
|
|
324
299
|
const X = {}, Be = () => {
|
|
325
|
-
}, Ke = (t, e) => t === e, We = () => !1, qe = (t) => typeof t == "string" ? t : String(t),
|
|
300
|
+
}, Ke = (t, e) => t === e, We = () => !1, qe = (t) => typeof t == "string" ? t : String(t), Ge = () => ({
|
|
326
301
|
highlightedValue: null,
|
|
327
302
|
selectedValues: []
|
|
328
303
|
});
|
|
329
|
-
function
|
|
304
|
+
function Je(t) {
|
|
330
305
|
const {
|
|
331
306
|
controlledProps: e = X,
|
|
332
307
|
disabledItemsFocusable: l = !1,
|
|
333
308
|
disableListWrap: n = !1,
|
|
334
309
|
focusManagement: o = "activeDescendant",
|
|
335
|
-
getInitialState: a =
|
|
310
|
+
getInitialState: a = Ge,
|
|
336
311
|
getItemDomElement: s,
|
|
337
312
|
getItemId: u,
|
|
338
313
|
isItemDisabled: r = We,
|
|
339
|
-
rootRef:
|
|
314
|
+
rootRef: d,
|
|
340
315
|
onStateChange: m = Be,
|
|
341
|
-
items:
|
|
316
|
+
items: g,
|
|
342
317
|
itemComparer: h = Ke,
|
|
343
|
-
getItemAsString:
|
|
344
|
-
onChange:
|
|
318
|
+
getItemAsString: f = qe,
|
|
319
|
+
onChange: c,
|
|
345
320
|
onHighlightChange: C,
|
|
346
|
-
onItemsChange:
|
|
321
|
+
onItemsChange: V,
|
|
347
322
|
orientation: T = "vertical",
|
|
348
|
-
pageSize:
|
|
349
|
-
reducerActionContext:
|
|
323
|
+
pageSize: $ = 5,
|
|
324
|
+
reducerActionContext: L = X,
|
|
350
325
|
selectionMode: O = "single",
|
|
351
326
|
stateReducer: _,
|
|
352
|
-
componentName:
|
|
327
|
+
componentName: U = "useList"
|
|
353
328
|
} = t;
|
|
354
329
|
if (process.env.NODE_ENV !== "production") {
|
|
355
330
|
if (o === "DOM" && s == null)
|
|
@@ -357,79 +332,79 @@ function Ge(t) {
|
|
|
357
332
|
if (o === "activeDescendant" && u == null)
|
|
358
333
|
throw new Error("useList: The `getItemId` prop is required when using the `activeDescendant` focus management.");
|
|
359
334
|
}
|
|
360
|
-
const A = i.useRef(null), F = Re(
|
|
361
|
-
if (C == null || C(
|
|
335
|
+
const A = i.useRef(null), F = Re(d, A), k = i.useCallback((x, p, I) => {
|
|
336
|
+
if (C == null || C(x, p, I), o === "DOM" && p != null && (I === S.itemClick || I === S.keyDown || I === S.textNavigation)) {
|
|
362
337
|
var R;
|
|
363
338
|
s == null || (R = s(p)) == null || R.focus();
|
|
364
339
|
}
|
|
365
|
-
}, [s, C, o]),
|
|
340
|
+
}, [s, C, o]), H = i.useMemo(() => ({
|
|
366
341
|
highlightedValue: h,
|
|
367
|
-
selectedValues: (
|
|
368
|
-
}), [h]), P = i.useCallback((
|
|
369
|
-
switch (m == null || m(
|
|
342
|
+
selectedValues: (x, p) => J(x, p, h)
|
|
343
|
+
}), [h]), P = i.useCallback((x, p, I, R, z) => {
|
|
344
|
+
switch (m == null || m(x, p, I, R, z), p) {
|
|
370
345
|
case "highlightedValue":
|
|
371
|
-
|
|
346
|
+
k(x, I, R);
|
|
372
347
|
break;
|
|
373
348
|
case "selectedValues":
|
|
374
|
-
|
|
349
|
+
c == null || c(x, I, R);
|
|
375
350
|
break;
|
|
376
351
|
}
|
|
377
|
-
}, [
|
|
352
|
+
}, [k, c, m]), y = i.useMemo(() => ({
|
|
378
353
|
disabledItemsFocusable: l,
|
|
379
354
|
disableListWrap: n,
|
|
380
355
|
focusManagement: o,
|
|
381
356
|
isItemDisabled: r,
|
|
382
357
|
itemComparer: h,
|
|
383
|
-
items:
|
|
384
|
-
getItemAsString:
|
|
385
|
-
onHighlightChange:
|
|
358
|
+
items: g,
|
|
359
|
+
getItemAsString: f,
|
|
360
|
+
onHighlightChange: k,
|
|
386
361
|
orientation: T,
|
|
387
|
-
pageSize:
|
|
362
|
+
pageSize: $,
|
|
388
363
|
selectionMode: O,
|
|
389
|
-
stateComparers:
|
|
390
|
-
}), [l, n, o, r, h, f,
|
|
391
|
-
reducer:
|
|
392
|
-
actionContext:
|
|
393
|
-
initialState:
|
|
364
|
+
stateComparers: H
|
|
365
|
+
}), [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({
|
|
366
|
+
reducer: ge,
|
|
367
|
+
actionContext: fe,
|
|
368
|
+
initialState: D,
|
|
394
369
|
controlledProps: e,
|
|
395
|
-
stateComparers:
|
|
370
|
+
stateComparers: H,
|
|
396
371
|
onStateChange: P,
|
|
397
|
-
componentName:
|
|
372
|
+
componentName: U
|
|
398
373
|
}), {
|
|
399
374
|
highlightedValue: N,
|
|
400
375
|
selectedValues: B
|
|
401
|
-
} = j, me = je((
|
|
376
|
+
} = j, me = je((x, p) => M({
|
|
402
377
|
type: S.textNavigation,
|
|
403
378
|
event: p,
|
|
404
|
-
searchString:
|
|
379
|
+
searchString: x
|
|
405
380
|
})), K = i.useRef([]);
|
|
406
381
|
i.useEffect(() => {
|
|
407
|
-
|
|
382
|
+
J(K.current, g, h) || (M({
|
|
408
383
|
type: S.itemsChange,
|
|
409
384
|
event: null,
|
|
410
|
-
items:
|
|
385
|
+
items: g,
|
|
411
386
|
previousItems: K.current
|
|
412
|
-
}), K.current =
|
|
413
|
-
}, [
|
|
414
|
-
const pe = (
|
|
387
|
+
}), K.current = g, V == null || V(g));
|
|
388
|
+
}, [g, h, M, V]);
|
|
389
|
+
const pe = (x) => (p) => {
|
|
415
390
|
var I;
|
|
416
|
-
if ((I =
|
|
391
|
+
if ((I = x.onKeyDown) == null || I.call(x, p), p.defaultMuiPrevented)
|
|
417
392
|
return;
|
|
418
393
|
const R = ["Home", "End", "PageUp", "PageDown"];
|
|
419
|
-
T === "vertical" ? R.push("ArrowUp", "ArrowDown") : R.push("ArrowLeft", "ArrowRight"), o === "activeDescendant" && R.push(" ", "Enter"), R.includes(p.key) && p.preventDefault(),
|
|
394
|
+
T === "vertical" ? R.push("ArrowUp", "ArrowDown") : R.push("ArrowLeft", "ArrowRight"), o === "activeDescendant" && R.push(" ", "Enter"), R.includes(p.key) && p.preventDefault(), M({
|
|
420
395
|
type: S.keyDown,
|
|
421
396
|
key: p.key,
|
|
422
397
|
event: p
|
|
423
398
|
}), me(p);
|
|
424
|
-
}, be = (
|
|
399
|
+
}, be = (x) => (p) => {
|
|
425
400
|
var I, R;
|
|
426
|
-
(I =
|
|
401
|
+
(I = x.onBlur) == null || I.call(x, p), !p.defaultMuiPrevented && ((R = A.current) != null && R.contains(p.relatedTarget) || M({
|
|
427
402
|
type: S.blur,
|
|
428
403
|
event: p
|
|
429
404
|
}));
|
|
430
|
-
}, Ce = (
|
|
431
|
-
const p = we(
|
|
432
|
-
return b({},
|
|
405
|
+
}, Ce = (x = {}) => {
|
|
406
|
+
const p = we(x);
|
|
407
|
+
return b({}, x, {
|
|
433
408
|
"aria-activedescendant": o === "activeDescendant" && N != null ? u(N) : void 0,
|
|
434
409
|
tabIndex: o === "DOM" ? -1 : 0,
|
|
435
410
|
ref: F
|
|
@@ -437,22 +412,22 @@ function Ge(t) {
|
|
|
437
412
|
onBlur: be(p),
|
|
438
413
|
onKeyDown: pe(p)
|
|
439
414
|
});
|
|
440
|
-
},
|
|
441
|
-
const p = (B ?? []).some((z) => z != null && h(
|
|
415
|
+
}, G = i.useCallback((x) => {
|
|
416
|
+
const p = (B ?? []).some((z) => z != null && h(x, z)), I = N != null && h(x, N);
|
|
442
417
|
return {
|
|
443
418
|
focusable: o === "DOM",
|
|
444
419
|
highlighted: I,
|
|
445
420
|
selected: p
|
|
446
421
|
};
|
|
447
422
|
}, [h, B, N, o]), ve = i.useMemo(() => ({
|
|
448
|
-
dispatch:
|
|
449
|
-
getItemState:
|
|
450
|
-
}), [
|
|
423
|
+
dispatch: M,
|
|
424
|
+
getItemState: G
|
|
425
|
+
}), [M, G]);
|
|
451
426
|
return i.useDebugValue({
|
|
452
427
|
state: j
|
|
453
428
|
}), {
|
|
454
429
|
contextValue: ve,
|
|
455
|
-
dispatch:
|
|
430
|
+
dispatch: M,
|
|
456
431
|
getRootProps: Ce,
|
|
457
432
|
rootRef: F,
|
|
458
433
|
state: j
|
|
@@ -460,9 +435,9 @@ function Ge(t) {
|
|
|
460
435
|
}
|
|
461
436
|
const ie = "Tabs";
|
|
462
437
|
function Ye(t) {
|
|
463
|
-
return
|
|
438
|
+
return te(ie, t);
|
|
464
439
|
}
|
|
465
|
-
|
|
440
|
+
ne(ie, ["root", "horizontal", "vertical"]);
|
|
466
441
|
function Xe(t) {
|
|
467
442
|
const {
|
|
468
443
|
value: e,
|
|
@@ -471,34 +446,34 @@ function Xe(t) {
|
|
|
471
446
|
orientation: o = "horizontal",
|
|
472
447
|
direction: a = "ltr",
|
|
473
448
|
selectionFollowsFocus: s = !1
|
|
474
|
-
} = t, [u, r] =
|
|
449
|
+
} = t, [u, r] = Pe({
|
|
475
450
|
controlled: e,
|
|
476
451
|
default: l,
|
|
477
452
|
name: "Tabs",
|
|
478
453
|
state: "value"
|
|
479
|
-
}),
|
|
480
|
-
r(T), n == null || n(
|
|
454
|
+
}), d = i.useCallback((V, T) => {
|
|
455
|
+
r(T), n == null || n(V, T);
|
|
481
456
|
}, [n, r]), {
|
|
482
457
|
subitems: m,
|
|
483
|
-
contextValue:
|
|
458
|
+
contextValue: g
|
|
484
459
|
} = Q(), h = i.useRef(() => {
|
|
485
|
-
}),
|
|
460
|
+
}), f = i.useCallback((V) => {
|
|
486
461
|
var T;
|
|
487
|
-
return (T = m.get(
|
|
488
|
-
}, [m]),
|
|
489
|
-
h.current =
|
|
462
|
+
return (T = m.get(V)) == null ? void 0 : T.id;
|
|
463
|
+
}, [m]), c = i.useCallback((V) => h.current(V), []), C = i.useCallback((V) => {
|
|
464
|
+
h.current = V;
|
|
490
465
|
}, []);
|
|
491
466
|
return {
|
|
492
467
|
contextValue: b({
|
|
493
468
|
direction: a,
|
|
494
|
-
getTabId:
|
|
495
|
-
getTabPanelId:
|
|
496
|
-
onSelected:
|
|
469
|
+
getTabId: c,
|
|
470
|
+
getTabPanelId: f,
|
|
471
|
+
onSelected: d,
|
|
497
472
|
orientation: o,
|
|
498
473
|
registerTabIdLookup: C,
|
|
499
474
|
selectionFollowsFocus: s,
|
|
500
475
|
value: u
|
|
501
|
-
},
|
|
476
|
+
}, g)
|
|
502
477
|
};
|
|
503
478
|
}
|
|
504
479
|
function Qe(t) {
|
|
@@ -512,28 +487,28 @@ function Qe(t) {
|
|
|
512
487
|
orientation: s,
|
|
513
488
|
registerItem: u,
|
|
514
489
|
registerTabIdLookup: r,
|
|
515
|
-
selectionFollowsFocus:
|
|
490
|
+
selectionFollowsFocus: d,
|
|
516
491
|
totalSubitemCount: m,
|
|
517
|
-
value:
|
|
492
|
+
value: g,
|
|
518
493
|
getTabId: h,
|
|
519
|
-
getTabPanelId:
|
|
520
|
-
} = e,
|
|
494
|
+
getTabPanelId: f
|
|
495
|
+
} = e, c = i.useMemo(() => ({
|
|
521
496
|
getItemIndex: o,
|
|
522
497
|
registerItem: u,
|
|
523
498
|
totalSubitemCount: m
|
|
524
499
|
}), [u, o, m]), C = i.useMemo(() => ({
|
|
525
500
|
direction: n,
|
|
526
501
|
getTabId: h,
|
|
527
|
-
getTabPanelId:
|
|
502
|
+
getTabPanelId: f,
|
|
528
503
|
onSelected: a,
|
|
529
504
|
orientation: s,
|
|
530
505
|
registerTabIdLookup: r,
|
|
531
|
-
selectionFollowsFocus:
|
|
532
|
-
value:
|
|
533
|
-
}), [n, h,
|
|
534
|
-
return /* @__PURE__ */
|
|
535
|
-
value:
|
|
536
|
-
children: /* @__PURE__ */
|
|
506
|
+
selectionFollowsFocus: d,
|
|
507
|
+
value: g
|
|
508
|
+
}), [n, h, f, a, s, r, d, g]);
|
|
509
|
+
return /* @__PURE__ */ E(Z.Provider, {
|
|
510
|
+
value: c,
|
|
511
|
+
children: /* @__PURE__ */ E(Te.Provider, {
|
|
537
512
|
value: C,
|
|
538
513
|
children: l
|
|
539
514
|
})
|
|
@@ -554,24 +529,24 @@ const Ze = ["children", "value", "defaultValue", "orientation", "direction", "on
|
|
|
554
529
|
direction: s = "ltr",
|
|
555
530
|
slotProps: u = {},
|
|
556
531
|
slots: r = {}
|
|
557
|
-
} = e,
|
|
532
|
+
} = e, d = ee(e, Ze), m = b({}, e, {
|
|
558
533
|
orientation: a,
|
|
559
534
|
direction: s
|
|
560
535
|
}), {
|
|
561
|
-
contextValue:
|
|
562
|
-
} = Xe(m), h = et(m),
|
|
563
|
-
elementType:
|
|
536
|
+
contextValue: g
|
|
537
|
+
} = Xe(m), h = et(m), f = (n = r.root) != null ? n : "div", c = oe({
|
|
538
|
+
elementType: f,
|
|
564
539
|
externalSlotProps: u.root,
|
|
565
|
-
externalForwardedProps:
|
|
540
|
+
externalForwardedProps: d,
|
|
566
541
|
additionalProps: {
|
|
567
542
|
ref: l
|
|
568
543
|
},
|
|
569
544
|
ownerState: m,
|
|
570
545
|
className: h.root
|
|
571
546
|
});
|
|
572
|
-
return /* @__PURE__ */
|
|
573
|
-
children: /* @__PURE__ */
|
|
574
|
-
value:
|
|
547
|
+
return /* @__PURE__ */ E(f, b({}, c, {
|
|
548
|
+
children: /* @__PURE__ */ E(Qe, {
|
|
549
|
+
value: g,
|
|
575
550
|
children: o
|
|
576
551
|
})
|
|
577
552
|
}));
|
|
@@ -635,9 +610,9 @@ process.env.NODE_ENV !== "production" && (ue.propTypes = {
|
|
|
635
610
|
});
|
|
636
611
|
const ce = "TabsList";
|
|
637
612
|
function tt(t) {
|
|
638
|
-
return
|
|
613
|
+
return te(ce, t);
|
|
639
614
|
}
|
|
640
|
-
|
|
615
|
+
ne(ce, ["root", "horizontal", "vertical"]);
|
|
641
616
|
const de = {
|
|
642
617
|
valueChange: "valueChange"
|
|
643
618
|
};
|
|
@@ -673,48 +648,48 @@ function ot(t) {
|
|
|
673
648
|
value: s,
|
|
674
649
|
registerTabIdLookup: u,
|
|
675
650
|
selectionFollowsFocus: r
|
|
676
|
-
} =
|
|
677
|
-
subitems:
|
|
651
|
+
} = Ie(), {
|
|
652
|
+
subitems: d,
|
|
678
653
|
contextValue: m
|
|
679
|
-
} = Q(),
|
|
680
|
-
var E;
|
|
681
|
-
return (E = c.get(P)) == null ? void 0 : E.id;
|
|
682
|
-
}, [c]);
|
|
683
|
-
u(f);
|
|
684
|
-
const h = i.useMemo(() => Array.from(c.keys()), [c]), g = i.useCallback((P) => {
|
|
685
|
-
var E, y;
|
|
686
|
-
return P == null ? null : (E = (y = c.get(P)) == null ? void 0 : y.ref.current) != null ? E : null;
|
|
687
|
-
}, [c]), d = n === "rtl";
|
|
688
|
-
let C;
|
|
689
|
-
a === "vertical" ? C = "vertical" : C = d ? "horizontal-rtl" : "horizontal-ltr";
|
|
690
|
-
const x = i.useCallback((P, E) => {
|
|
654
|
+
} = Q(), g = i.useCallback((P) => {
|
|
691
655
|
var y;
|
|
692
|
-
|
|
656
|
+
return (y = d.get(P)) == null ? void 0 : y.id;
|
|
657
|
+
}, [d]);
|
|
658
|
+
u(g);
|
|
659
|
+
const h = i.useMemo(() => Array.from(d.keys()), [d]), f = i.useCallback((P) => {
|
|
660
|
+
var y, D;
|
|
661
|
+
return P == null ? null : (y = (D = d.get(P)) == null ? void 0 : D.ref.current) != null ? y : null;
|
|
662
|
+
}, [d]), c = n === "rtl";
|
|
663
|
+
let C;
|
|
664
|
+
a === "vertical" ? C = "vertical" : C = c ? "horizontal-rtl" : "horizontal-ltr";
|
|
665
|
+
const V = i.useCallback((P, y) => {
|
|
666
|
+
var D;
|
|
667
|
+
o(P, (D = y[0]) != null ? D : null);
|
|
693
668
|
}, [o]), T = i.useMemo(() => s === void 0 ? {} : s != null ? {
|
|
694
669
|
selectedValues: [s]
|
|
695
670
|
} : {
|
|
696
671
|
selectedValues: []
|
|
697
|
-
}, [s]),
|
|
698
|
-
var
|
|
699
|
-
return (
|
|
700
|
-
}, [
|
|
701
|
-
contextValue:
|
|
672
|
+
}, [s]), $ = i.useCallback((P) => {
|
|
673
|
+
var y, D;
|
|
674
|
+
return (y = (D = d.get(P)) == null ? void 0 : D.disabled) != null ? y : !1;
|
|
675
|
+
}, [d]), {
|
|
676
|
+
contextValue: L,
|
|
702
677
|
dispatch: O,
|
|
703
678
|
getRootProps: _,
|
|
704
679
|
state: {
|
|
705
|
-
highlightedValue:
|
|
680
|
+
highlightedValue: U,
|
|
706
681
|
selectedValues: A
|
|
707
682
|
},
|
|
708
683
|
rootRef: F
|
|
709
|
-
} =
|
|
684
|
+
} = Je({
|
|
710
685
|
controlledProps: T,
|
|
711
686
|
disabledItemsFocusable: !r,
|
|
712
687
|
focusManagement: "DOM",
|
|
713
|
-
getItemDomElement:
|
|
714
|
-
isItemDisabled:
|
|
688
|
+
getItemDomElement: f,
|
|
689
|
+
isItemDisabled: $,
|
|
715
690
|
items: h,
|
|
716
691
|
rootRef: l,
|
|
717
|
-
onChange:
|
|
692
|
+
onChange: V,
|
|
718
693
|
orientation: C,
|
|
719
694
|
reducerActionContext: i.useMemo(() => ({
|
|
720
695
|
selectionFollowsFocus: r || !1
|
|
@@ -728,16 +703,16 @@ function ot(t) {
|
|
|
728
703
|
value: s
|
|
729
704
|
});
|
|
730
705
|
}, [O, s]);
|
|
731
|
-
const
|
|
706
|
+
const k = (P = {}) => b({}, P, _(P), {
|
|
732
707
|
"aria-orientation": a === "vertical" ? "vertical" : void 0,
|
|
733
708
|
role: "tablist"
|
|
734
709
|
});
|
|
735
710
|
return {
|
|
736
|
-
contextValue: i.useMemo(() => b({}, m,
|
|
711
|
+
contextValue: i.useMemo(() => b({}, m, L), [m, L]),
|
|
737
712
|
dispatch: O,
|
|
738
|
-
getRootProps:
|
|
739
|
-
highlightedValue:
|
|
740
|
-
isRtl:
|
|
713
|
+
getRootProps: k,
|
|
714
|
+
highlightedValue: U,
|
|
715
|
+
isRtl: c,
|
|
741
716
|
orientation: a,
|
|
742
717
|
rootRef: F,
|
|
743
718
|
selectedValue: (e = A[0]) != null ? e : null
|
|
@@ -757,14 +732,14 @@ function lt(t) {
|
|
|
757
732
|
dispatch: n,
|
|
758
733
|
getItemState: a,
|
|
759
734
|
getItemIndex: o
|
|
760
|
-
}), [n, o, a]),
|
|
735
|
+
}), [n, o, a]), d = i.useMemo(() => ({
|
|
761
736
|
getItemIndex: o,
|
|
762
737
|
registerItem: s,
|
|
763
738
|
totalSubitemCount: u
|
|
764
739
|
}), [s, o, u]);
|
|
765
|
-
return /* @__PURE__ */
|
|
766
|
-
value:
|
|
767
|
-
children: /* @__PURE__ */
|
|
740
|
+
return /* @__PURE__ */ E(Z.Provider, {
|
|
741
|
+
value: d,
|
|
742
|
+
children: /* @__PURE__ */ E(ye.Provider, {
|
|
768
743
|
value: r,
|
|
769
744
|
children: l
|
|
770
745
|
})
|
|
@@ -783,27 +758,27 @@ const st = ["children", "slotProps", "slots"], rt = (t) => {
|
|
|
783
758
|
children: o,
|
|
784
759
|
slotProps: a = {},
|
|
785
760
|
slots: s = {}
|
|
786
|
-
} = e, u =
|
|
761
|
+
} = e, u = ee(e, st), {
|
|
787
762
|
isRtl: r,
|
|
788
|
-
orientation:
|
|
763
|
+
orientation: d,
|
|
789
764
|
getRootProps: m,
|
|
790
|
-
contextValue:
|
|
765
|
+
contextValue: g
|
|
791
766
|
} = ot({
|
|
792
767
|
rootRef: l
|
|
793
768
|
}), h = b({}, e, {
|
|
794
769
|
isRtl: r,
|
|
795
|
-
orientation:
|
|
796
|
-
}),
|
|
797
|
-
elementType:
|
|
770
|
+
orientation: d
|
|
771
|
+
}), f = rt(h), c = (n = s.root) != null ? n : "div", C = oe({
|
|
772
|
+
elementType: c,
|
|
798
773
|
getSlotProps: m,
|
|
799
774
|
externalSlotProps: a.root,
|
|
800
775
|
externalForwardedProps: u,
|
|
801
776
|
ownerState: h,
|
|
802
|
-
className:
|
|
777
|
+
className: f.root
|
|
803
778
|
});
|
|
804
|
-
return /* @__PURE__ */
|
|
805
|
-
value:
|
|
806
|
-
children: /* @__PURE__ */
|
|
779
|
+
return /* @__PURE__ */ E(lt, {
|
|
780
|
+
value: g,
|
|
781
|
+
children: /* @__PURE__ */ E(c, b({}, C, {
|
|
807
782
|
children: o
|
|
808
783
|
}))
|
|
809
784
|
});
|
|
@@ -837,16 +812,12 @@ process.env.NODE_ENV !== "production" && (he.propTypes = {
|
|
|
837
812
|
root: v.elementType
|
|
838
813
|
})
|
|
839
814
|
});
|
|
840
|
-
const
|
|
841
|
-
|
|
842
|
-
onChange:
|
|
843
|
-
dataTestId: l
|
|
844
|
-
}, n) => {
|
|
845
|
-
const [o, a] = Se("1");
|
|
846
|
-
return /* @__PURE__ */ M(ue, { "data-testid": l, value: o, onChange: (u, r) => {
|
|
815
|
+
const ft = xe(({ children: t, onChange: e, dataTestId: l }, n) => {
|
|
816
|
+
const [o, a] = Ve("1");
|
|
817
|
+
return /* @__PURE__ */ E(ue, { "data-testid": l, value: o, onChange: (u, r) => {
|
|
847
818
|
a(r), e && e(r, u);
|
|
848
|
-
}, ref: n, children: /* @__PURE__ */
|
|
819
|
+
}, ref: n, children: /* @__PURE__ */ E(he, { className: Se.tabs, children: t }) });
|
|
849
820
|
});
|
|
850
821
|
export {
|
|
851
|
-
|
|
822
|
+
ft as Tabs
|
|
852
823
|
};
|