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