@pismo/marola 0.0.1-alpha.32 → 0.0.1-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -13
- package/dist/{Button-2b1peDFT.js → Button-D--uN90N.js} +26 -25
- package/dist/Dialog.module-BKWFakxu.js +15 -0
- package/dist/ListContext-Dj2Va7Iv.js +18 -0
- package/dist/Tabs.module-BKlNuSPH.js +66 -0
- package/dist/assets/Button.css +1 -1
- package/dist/assets/Dialog.css +1 -1
- package/dist/assets/IconButton.css +1 -1
- package/dist/assets/PageHeader.css +1 -1
- package/dist/assets/Pagination.css +1 -1
- package/dist/assets/Tabs.css +1 -1
- package/dist/assets/Typography.css +1 -1
- package/dist/assets/main.css +1 -0
- package/dist/components/Button/Button.d.ts +2 -13
- package/dist/components/Button/Button.js +49 -60
- package/dist/components/Dialog/Actions.js +1 -1
- package/dist/components/Dialog/Backdrop.d.ts +1 -1
- package/dist/components/Dialog/Backdrop.js +1 -1
- package/dist/components/Dialog/CloseIconButton.js +124 -12
- package/dist/components/Dialog/Dialog.d.ts +3 -4
- package/dist/components/Dialog/Dialog.js +20098 -444
- package/dist/components/Dialog/{DialogTitle.d.ts → Title.d.ts} +3 -3
- package/dist/components/Dialog/Title.js +29 -0
- package/dist/components/IconButton/IconButton.d.ts +5 -21
- package/dist/components/IconButton/IconButton.js +76 -60
- package/dist/components/LoadingSpinner/LoadingSpinner.d.ts +0 -2
- package/dist/components/PageHeader/PageHeader.d.ts +16 -56
- package/dist/components/PageHeader/PageHeader.js +65 -83
- package/dist/components/Pagination/Pagination.d.ts +6 -25
- package/dist/components/Pagination/Pagination.js +113 -131
- package/dist/components/SortTooltip/SortTooltip.d.ts +0 -28
- package/dist/components/SortTooltip/SortTooltip.js +1 -93
- package/dist/components/Table/Table.d.ts +0 -56
- package/dist/components/Table/Table.js +1 -137
- package/dist/components/Table/TableContext.d.ts +0 -19
- package/dist/components/Table/TableContext.js +1 -21
- package/dist/components/Tabs/Tab.d.ts +1 -6
- package/dist/components/Tabs/Tab.js +173 -113
- package/dist/components/Tabs/TabPanel.d.ts +1 -5
- package/dist/components/Tabs/TabPanel.js +16 -15
- package/dist/components/Tabs/Tabs.d.ts +2 -8
- package/dist/components/Tabs/Tabs.js +664 -242
- package/dist/components/Tooltip/Tooltip.d.ts +0 -33
- package/dist/components/Tooltip/Tooltip.js +1 -141
- package/dist/components/Typography/Typography.d.ts +6 -17
- package/dist/components/Typography/Typography.js +58 -58
- package/dist/{index-CH45lKw7.js → index-BvA1HyDs.js} +300 -322
- package/dist/main.d.ts +8 -27
- package/dist/main.js +28 -75
- package/dist/objectWithoutPropertiesLoose-ClNcje2_.js +22 -0
- package/dist/types/helpers.d.ts +0 -8
- package/dist/useButton-abQpo0za.js +187 -0
- package/dist/useCompoundItem-wTwXbURC.js +41 -0
- package/package.json +9 -30
- package/dist/ClickAwayListener-BSW-Nd-y.js +0 -107
- package/dist/Dialog.module-DFEmFdYT.js +0 -30
- package/dist/Group-B3p31ftp.js +0 -26
- package/dist/Popup-B6ZSGIEI.js +0 -1248
- package/dist/Portal-DIeBsWdL.js +0 -73
- package/dist/SelectButton-C8JQKaf4.js +0 -61
- package/dist/Tabs.module-jkH1Qjn7.js +0 -22
- package/dist/Toggle-BCgIItCc.js +0 -142
- package/dist/assets/Advice.css +0 -1
- package/dist/assets/Checkbox.css +0 -1
- package/dist/assets/EllipsisTooltip.css +0 -1
- package/dist/assets/Group.css +0 -1
- package/dist/assets/Input.css +0 -1
- package/dist/assets/InputSearch.css +0 -1
- package/dist/assets/SelectButton.css +0 -1
- package/dist/assets/Skeleton.css +0 -1
- package/dist/assets/Snackbar.css +0 -1
- package/dist/assets/SortTooltip.css +0 -1
- package/dist/assets/Stepper.css +0 -1
- package/dist/assets/Table.css +0 -1
- package/dist/assets/TextDisplay.css +0 -1
- package/dist/assets/Toggle.css +0 -1
- package/dist/assets/Toggle2.css +0 -1
- package/dist/assets/Tooltip.css +0 -1
- package/dist/combineHooksSlotProps-DVjg9PRh.js +0 -80
- package/dist/components/Advice/Advice.d.ts +0 -30
- package/dist/components/Advice/Advice.js +0 -47
- package/dist/components/Advice/Advice.stories.d.ts +0 -18
- package/dist/components/Button/Button.stories.d.ts +0 -62
- package/dist/components/Checkbox/Checkbox.d.ts +0 -34
- package/dist/components/Checkbox/Checkbox.js +0 -71
- package/dist/components/Checkbox/Checkbox.stories.d.ts +0 -31
- package/dist/components/Chip/Chip.d.ts +0 -39
- package/dist/components/Chip/Chip.js +0 -19
- package/dist/components/Chip/Chip.stories.d.ts +0 -42
- package/dist/components/Chip/chip.test.d.ts +0 -1
- package/dist/components/Dialog/Dialog.stories.d.ts +0 -343
- package/dist/components/Dialog/DialogTitle.js +0 -29
- package/dist/components/EllipsisTooltip/EllipsisTooltip.d.ts +0 -7
- package/dist/components/EllipsisTooltip/EllipsisTooltip.js +0 -23
- package/dist/components/EllipsisTooltip/EllipsisTooltip.stories.d.ts +0 -31
- package/dist/components/Icon/Icon.d.ts +0 -11
- package/dist/components/Icon/Icon.js +0 -127
- package/dist/components/Icon/Icon.stories.d.ts +0 -15
- package/dist/components/Icon/types.d.ts +0 -5
- package/dist/components/Icon/types.js +0 -1
- package/dist/components/IconButton/Icon.stories.d.ts +0 -15
- package/dist/components/Input/Input.d.ts +0 -44
- package/dist/components/Input/Input.js +0 -508
- package/dist/components/Input/Input.stories.d.ts +0 -43
- package/dist/components/InputSearch/InputSearch.d.ts +0 -9
- package/dist/components/InputSearch/InputSearch.js +0 -34
- package/dist/components/InputSearch/InputSearch.stories.d.ts +0 -39
- package/dist/components/LoadingSpinner/LoadingSpinner.stories.d.ts +0 -14
- package/dist/components/PageHeader/PageHeader.stories.d.ts +0 -14
- package/dist/components/Pagination/Pagination.stories.d.ts +0 -17
- package/dist/components/Select/Select.d.ts +0 -26
- package/dist/components/Select/Select.js +0 -857
- package/dist/components/Select/Select.stories.d.ts +0 -22
- package/dist/components/Select/SelectButton.d.ts +0 -12
- package/dist/components/Select/SelectButton.js +0 -8
- package/dist/components/Skeleton/Skeleton.d.ts +0 -25
- package/dist/components/Skeleton/Skeleton.js +0 -23
- package/dist/components/Skeleton/Skeleton.stories.d.ts +0 -14
- package/dist/components/Skeleton/SkeletonCircle.stories.d.ts +0 -14
- package/dist/components/Skeleton/SkeletonTable.stories.d.ts +0 -16
- package/dist/components/Snackbar/Snackbar.d.ts +0 -27
- package/dist/components/Snackbar/Snackbar.js +0 -639
- package/dist/components/Snackbar/Snackbar.stories.d.ts +0 -319
- package/dist/components/Stepper/Stepper.d.ts +0 -26
- package/dist/components/Stepper/Stepper.js +0 -48
- package/dist/components/Stepper/Stepper.stories.d.ts +0 -16
- package/dist/components/Table/Table.stories.d.ts +0 -29
- package/dist/components/Table/_Table.TBody.stories.d.ts +0 -14
- package/dist/components/Table/_Table.THead.stories.d.ts +0 -14
- package/dist/components/Table/_Table.Td.stories.d.ts +0 -16
- package/dist/components/Table/_Table.Th.stories.d.ts +0 -15
- package/dist/components/Table/_Table.Tr.stories.d.ts +0 -15
- package/dist/components/Tabs/Tab.stories.d.ts +0 -15
- package/dist/components/Tabs/TabPanel.stories.d.ts +0 -14
- package/dist/components/Tabs/Tabs.stories.d.ts +0 -14
- package/dist/components/TextDisplay/TextDisplay.d.ts +0 -23
- package/dist/components/TextDisplay/TextDisplay.js +0 -37
- package/dist/components/TextDisplay/TextDisplay.stories.d.ts +0 -13
- package/dist/components/TextDisplay/textDisplay.test.d.ts +0 -1
- package/dist/components/Toggle/Toggle.d.ts +0 -11
- package/dist/components/Toggle/Toggle.js +0 -266
- package/dist/components/Toggle/Toggle.stories.d.ts +0 -21
- package/dist/components/ToggleGroup/Group.d.ts +0 -18
- package/dist/components/ToggleGroup/Group.js +0 -7
- package/dist/components/ToggleGroup/Group.test.d.ts +0 -1
- package/dist/components/ToggleGroup/Toggle.d.ts +0 -15
- package/dist/components/ToggleGroup/Toggle.js +0 -17
- package/dist/components/ToggleGroup/Toggle.test.d.ts +0 -1
- package/dist/components/ToggleGroup/ToggleGroup.d.ts +0 -2
- package/dist/components/ToggleGroup/ToggleGroup.js +0 -6
- package/dist/components/ToggleGroup/ToggleGroup.stories.d.ts +0 -25
- package/dist/components/Tooltip/Tooltip.stories.d.ts +0 -35
- package/dist/components/Typography/Typography.stories.d.ts +0 -32
- package/dist/components/Typography/typography.test.d.ts +0 -1
- package/dist/contexts/SnackbarProvider/SnackbarProvider.d.ts +0 -11
- package/dist/contexts/SnackbarProvider/SnackbarProvider.js +0 -50
- package/dist/contexts/SnackbarProvider/SnackbarProvider.stories.d.ts +0 -21
- package/dist/index-CjW42-M-.js +0 -19584
- package/dist/marola.css +0 -1
- package/dist/test-utils/assertStyles.d.ts +0 -1
- package/dist/test-utils/assertStyles.js +0 -11
- package/dist/useButton-DNk3wrQp.js +0 -105
- package/dist/useCompoundItem-D1iRfg8D.js +0 -84
- package/dist/useEventCallback-xTG9piMa.js +0 -45
- package/dist/useIsFocusVisible-BH4IAdcw.js +0 -69
- package/dist/useList-B0hog_3-.js +0 -436
- package/dist/useTimeout-DxF9kiZL.js +0 -36
- package/dist/utils/styleStrings.d.ts +0 -6
- package/dist/utils/styleStrings.js +0 -10
- package/dist/utils/styleStrings.test.d.ts +0 -1
|
@@ -1,137 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { jsxs as b, jsx as a } from "react/jsx-runtime";
|
|
3
|
-
import * as h from "react";
|
|
4
|
-
import { useState as w } from "react";
|
|
5
|
-
import { c as g } from "../../clsx-DB4S2d7J.js";
|
|
6
|
-
import { paginationDefaultTranslations as y, Pagination as T } from "../Pagination/Pagination.js";
|
|
7
|
-
import { sortTooltipDefaultTranslations as u, SortTooltip as f } from "../SortTooltip/SortTooltip.js";
|
|
8
|
-
import { TableProvider as N, useTable as x } from "./TableContext.js";
|
|
9
|
-
const C = (p) => /* @__PURE__ */ h.createElement("svg", { width: 7, height: 10, viewBox: "0 0 7 10", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...p }, /* @__PURE__ */ h.createElement("g", { clipPath: "url(#clip0_2291_2457)" }, /* @__PURE__ */ h.createElement("path", { d: "M6.41658 3.93794C6.26731 3.93794 6.11798 3.88301 6.00423 3.77314L3.49991 1.35923L0.995768 3.77271C0.767904 3.99243 0.398763 3.99243 0.170898 3.77271C-0.0569661 3.55298 -0.0569661 3.19702 0.170898 2.97729L3.08756 0.164795C3.31543 -0.0549316 3.68457 -0.0549316 3.91243 0.164795L6.8291 2.97729C7.05697 3.19702 7.05697 3.55298 6.8291 3.77271C6.71553 3.88345 6.56605 3.93794 6.41658 3.93794Z", fill: "#1897F3" }), /* @__PURE__ */ h.createElement("path", { opacity: 0.4, d: "M6.41663 5.38022C6.26737 5.38022 6.11804 5.43516 6.00429 5.54502L3.49997 7.95894L0.99528 5.5437C0.767415 5.32397 0.398275 5.32397 0.17041 5.5437C-0.0574544 5.76343 -0.0574544 6.11938 0.17041 6.33911L3.08708 9.15161C3.31494 9.37134 3.68408 9.37134 3.91195 9.15161L6.82861 6.33911C7.05648 6.11938 7.05648 5.76343 6.82861 5.5437C6.71559 5.43472 6.56611 5.38022 6.41663 5.38022Z", fill: "#1897F3" })), /* @__PURE__ */ h.createElement("defs", null, /* @__PURE__ */ h.createElement("clipPath", { id: "clip0_2291_2457" }, /* @__PURE__ */ h.createElement("rect", { width: 7, height: 10, fill: "white" })))), L = "_table_1gspp_43", E = "_th__wrapper_1gspp_114", k = "_tr_1gspp_130", v = "_td_1gspp_134", t = {
|
|
10
|
-
"u-typography-h1": "_u-typography-h1_1gspp_1",
|
|
11
|
-
"u-typography-h2": "_u-typography-h2_1gspp_8",
|
|
12
|
-
"u-typography-h3": "_u-typography-h3_1gspp_15",
|
|
13
|
-
"u-typography-h4": "_u-typography-h4_1gspp_22",
|
|
14
|
-
"u-typography-h5": "_u-typography-h5_1gspp_29",
|
|
15
|
-
"u-typography-h6": "_u-typography-h6_1gspp_36",
|
|
16
|
-
"u-typography-base": "_u-typography-base_1gspp_43",
|
|
17
|
-
table: L,
|
|
18
|
-
"u-typography-base--xxl": "_u-typography-base--xxl_1gspp_48",
|
|
19
|
-
"u-typography-base--xl": "_u-typography-base--xl_1gspp_52",
|
|
20
|
-
"u-typography-base--lg": "_u-typography-base--lg_1gspp_56",
|
|
21
|
-
"u-typography-base--sm": "_u-typography-base--sm_1gspp_60",
|
|
22
|
-
"u-typography-base--bold": "_u-typography-base--bold_1gspp_64",
|
|
23
|
-
"u-typography-base--strikethrough": "_u-typography-base--strikethrough_1gspp_67",
|
|
24
|
-
"u-typography-base--underlined": "_u-typography-base--underlined_1gspp_70",
|
|
25
|
-
"u-typography-base--strikethrough-underlined": "_u-typography-base--strikethrough-underlined_1gspp_73",
|
|
26
|
-
"table--full-width": "_table--full-width_1gspp_81",
|
|
27
|
-
"table--white-theme": "_table--white-theme_1gspp_84",
|
|
28
|
-
"table--transparent-theme": "_table--transparent-theme_1gspp_87",
|
|
29
|
-
"cell--left-alignment": "_cell--left-alignment_1gspp_90",
|
|
30
|
-
"cell--center-alignment": "_cell--center-alignment_1gspp_94",
|
|
31
|
-
"cell--right-alignment": "_cell--right-alignment_1gspp_98",
|
|
32
|
-
th__wrapper: E,
|
|
33
|
-
"th__wrapper--pressed": "_th__wrapper--pressed_1gspp_117",
|
|
34
|
-
"th__wrapper--clickable": "_th__wrapper--clickable_1gspp_121",
|
|
35
|
-
"th__sort-icon-container": "_th__sort-icon-container_1gspp_124",
|
|
36
|
-
"tr__row-or-cell--disabled": "_tr__row-or-cell--disabled_1gspp_130",
|
|
37
|
-
tr: k,
|
|
38
|
-
td: v,
|
|
39
|
-
"tr__row-or-cell--clickable": "_tr__row-or-cell--clickable_1gspp_139",
|
|
40
|
-
"td__row-or-cell--clickable": "_td__row-or-cell--clickable_1gspp_140",
|
|
41
|
-
"td__row-or-cell--disabled": "_td__row-or-cell--disabled_1gspp_144",
|
|
42
|
-
"td-wrapper": "_td-wrapper_1gspp_148"
|
|
43
|
-
}, B = {
|
|
44
|
-
pt: {
|
|
45
|
-
...y.pt,
|
|
46
|
-
...u.pt
|
|
47
|
-
},
|
|
48
|
-
en: {
|
|
49
|
-
...y.en,
|
|
50
|
-
...u.en
|
|
51
|
-
},
|
|
52
|
-
// example to add a new language translation
|
|
53
|
-
es: {
|
|
54
|
-
asc: "Orden ascendente",
|
|
55
|
-
desc: "Orden descendiente",
|
|
56
|
-
next: "Próximo",
|
|
57
|
-
previous: "Anterior",
|
|
58
|
-
showing: "Mostrando",
|
|
59
|
-
of: "de",
|
|
60
|
-
results: "resultados"
|
|
61
|
-
}
|
|
62
|
-
}, l = ({
|
|
63
|
-
children: p,
|
|
64
|
-
theme: e = "white",
|
|
65
|
-
fullWidth: r = !0,
|
|
66
|
-
className: o,
|
|
67
|
-
paginationProps: s,
|
|
68
|
-
language: _,
|
|
69
|
-
translations: n,
|
|
70
|
-
...d
|
|
71
|
-
}) => {
|
|
72
|
-
const c = g(
|
|
73
|
-
t.table,
|
|
74
|
-
r ? t["table--full-width"] : "",
|
|
75
|
-
t[`table--${e}-theme`],
|
|
76
|
-
o
|
|
77
|
-
), i = _ && B[_] || n;
|
|
78
|
-
return /* @__PURE__ */ b(N, { initialTranslations: i, children: [
|
|
79
|
-
/* @__PURE__ */ a("table", { ...d, className: c, children: p }),
|
|
80
|
-
s && /* @__PURE__ */ a(T, { ...s, t: i })
|
|
81
|
-
] });
|
|
82
|
-
}, H = ({ children: p, ...e }) => /* @__PURE__ */ a("thead", { ...e, children: p }), P = ({ children: p, ...e }) => /* @__PURE__ */ a("tbody", { ...e, children: p }), D = ({ children: p, onClick: e, disabled: r, className: o, ...s }) => {
|
|
83
|
-
const _ = g(
|
|
84
|
-
t.tr,
|
|
85
|
-
e && !r ? t["tr__row-or-cell--clickable"] : r ? t["tr__row-or-cell--disabled"] : "",
|
|
86
|
-
o
|
|
87
|
-
);
|
|
88
|
-
return /* @__PURE__ */ a("tr", { ...s, className: _, onClick: () => !r && (e == null ? void 0 : e()), children: p });
|
|
89
|
-
}, M = ({ children: p, onClick: e, disabled: r, className: o, align: s = "left", ..._ }) => {
|
|
90
|
-
const n = g(
|
|
91
|
-
t.td,
|
|
92
|
-
e && !r ? t["td__row-or-cell--clickable"] : r ? t["td__row-or-cell--disabled"] : "",
|
|
93
|
-
t[`cell--${s}-alignment`],
|
|
94
|
-
o
|
|
95
|
-
);
|
|
96
|
-
return /* @__PURE__ */ a("td", { ..._, className: n, onClick: () => !r && (e == null ? void 0 : e()), children: /* @__PURE__ */ a("span", { className: t["td-wrapper"], children: p }) });
|
|
97
|
-
}, O = ({ children: p, onSort: e, sortType: r, className: o, classNameTooltip: s, align: _ = "left", ...n }) => {
|
|
98
|
-
const { translations: d } = x(), [c, i] = w(!1), m = g(
|
|
99
|
-
t.th__wrapper,
|
|
100
|
-
c ? t["th__wrapper--pressed"] : "",
|
|
101
|
-
e ? t["th__wrapper--clickable"] : "",
|
|
102
|
-
o
|
|
103
|
-
);
|
|
104
|
-
return /* @__PURE__ */ a("th", { ...n, className: t[`cell--${_}-alignment`], children: /* @__PURE__ */ a("span", { className: m, onClick: e && (() => i(!c)), children: e ? /* @__PURE__ */ b(
|
|
105
|
-
f,
|
|
106
|
-
{
|
|
107
|
-
onClose: () => i(!1),
|
|
108
|
-
onSort: e,
|
|
109
|
-
show: c,
|
|
110
|
-
sortType: r,
|
|
111
|
-
className: s,
|
|
112
|
-
t: d,
|
|
113
|
-
children: [
|
|
114
|
-
/* @__PURE__ */ a("span", { children: p }),
|
|
115
|
-
/* @__PURE__ */ a("span", { className: t["th__sort-icon-container"], children: /* @__PURE__ */ a(C, {}) })
|
|
116
|
-
]
|
|
117
|
-
}
|
|
118
|
-
) : /* @__PURE__ */ a("span", { children: p }) }) });
|
|
119
|
-
};
|
|
120
|
-
l.THead = H;
|
|
121
|
-
l.THead.displayName = "Table.THead";
|
|
122
|
-
l.TBody = P;
|
|
123
|
-
l.TBody.displayName = "Table.TBody";
|
|
124
|
-
l.Tr = D;
|
|
125
|
-
l.Tr.displayName = "Table.Tr";
|
|
126
|
-
l.Td = M;
|
|
127
|
-
l.Td.displayName = "Table.Td";
|
|
128
|
-
l.Th = O;
|
|
129
|
-
l.Th.displayName = "Table.Th";
|
|
130
|
-
export {
|
|
131
|
-
P as TBody,
|
|
132
|
-
H as THead,
|
|
133
|
-
l as Table,
|
|
134
|
-
M as Td,
|
|
135
|
-
O as Th,
|
|
136
|
-
D as Tr
|
|
137
|
-
};
|
|
1
|
+
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { SortTranslationsByKeys } from '../SortTooltip/SortTooltip';
|
|
2
|
-
import { PaginationTranslations } from '../Pagination/Pagination';
|
|
3
|
-
import { ReactNode } from 'react';
|
|
4
|
-
|
|
5
|
-
export type TableTranslationsKeys = keyof PaginationTranslations | keyof SortTranslationsByKeys;
|
|
6
|
-
export type TableTranslations = {
|
|
7
|
-
[key in TableTranslationsKeys]?: string;
|
|
8
|
-
};
|
|
9
|
-
type ITableContext = {
|
|
10
|
-
translations?: TableTranslations;
|
|
11
|
-
setTranslations: (translation: TableTranslations) => void;
|
|
12
|
-
};
|
|
13
|
-
type TableProviderProps = {
|
|
14
|
-
initialTranslations?: TableTranslations;
|
|
15
|
-
children: ReactNode;
|
|
16
|
-
};
|
|
17
|
-
declare const TableProvider: ({ initialTranslations, children }: TableProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
-
export declare const useTable: () => Partial<ITableContext>;
|
|
19
|
-
export { TableProvider };
|
|
@@ -1,21 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { createContext as n, useState as u, useEffect as x, useContext as a } from "react";
|
|
3
|
-
const o = n({}), b = ({ initialTranslations: e, children: r }) => {
|
|
4
|
-
const [s, t] = u(e);
|
|
5
|
-
return x(() => {
|
|
6
|
-
t(e);
|
|
7
|
-
}, [e]), /* @__PURE__ */ c(
|
|
8
|
-
o.Provider,
|
|
9
|
-
{
|
|
10
|
-
value: {
|
|
11
|
-
translations: s,
|
|
12
|
-
setTranslations: t
|
|
13
|
-
},
|
|
14
|
-
children: r
|
|
15
|
-
}
|
|
16
|
-
);
|
|
17
|
-
}, p = () => a(o);
|
|
18
|
-
export {
|
|
19
|
-
b as TableProvider,
|
|
20
|
-
p as useTable
|
|
21
|
-
};
|
|
1
|
+
|
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
|
|
3
3
|
export interface TabProps {
|
|
4
|
-
/** The value to be showing in the tab */
|
|
5
4
|
children: ReactNode;
|
|
6
|
-
/** The value that corresponds to the panel to show.
|
|
7
|
-
* e.g. value="1" when this tab is clicked it will show the panel which also has value="1! */
|
|
8
5
|
value: string | number;
|
|
9
|
-
/** Disable clicking the tab */
|
|
10
6
|
disabled?: boolean;
|
|
11
|
-
/** data test id */
|
|
12
7
|
dataTestId?: string;
|
|
13
8
|
}
|
|
14
|
-
export declare const Tab: import('react').ForwardRefExoticComponent<TabProps & import(
|
|
9
|
+
export declare const Tab: import('react').ForwardRefExoticComponent<TabProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -1,123 +1,183 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { c as
|
|
5
|
-
import { u as
|
|
6
|
-
import {
|
|
7
|
-
import { u as
|
|
8
|
-
import { u as
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
function Z(
|
|
12
|
-
|
|
1
|
+
import { jsx as I } from "react/jsx-runtime";
|
|
2
|
+
import * as f from "react";
|
|
3
|
+
import { forwardRef as S, useContext as U, useMemo as j } from "react";
|
|
4
|
+
import { c as D } from "../../clsx-DB4S2d7J.js";
|
|
5
|
+
import { u as $, T as A, s as y } from "../../Tabs.module-BKlNuSPH.js";
|
|
6
|
+
import { a as p, _ as B } from "../../objectWithoutPropertiesLoose-ClNcje2_.js";
|
|
7
|
+
import { h as O, g as W, a as q, f as N, u as z, P as o, c as G, b as J } from "../../index-BvA1HyDs.js";
|
|
8
|
+
import { u as K, a as Q } from "../../useCompoundItem-wTwXbURC.js";
|
|
9
|
+
import { L as X, a as E } from "../../ListContext-Dj2Va7Iv.js";
|
|
10
|
+
import { u as Y } from "../../useButton-abQpo0za.js";
|
|
11
|
+
function Z(n) {
|
|
12
|
+
const {
|
|
13
|
+
handlePointerOverEvents: t = !1,
|
|
14
|
+
item: e
|
|
15
|
+
} = n, s = f.useContext(X);
|
|
16
|
+
if (!s)
|
|
17
|
+
throw new Error("useListItem must be used within a ListProvider");
|
|
18
|
+
const {
|
|
19
|
+
dispatch: a,
|
|
20
|
+
getItemState: i
|
|
21
|
+
} = s, {
|
|
22
|
+
highlighted: c,
|
|
23
|
+
selected: b,
|
|
24
|
+
focusable: m
|
|
25
|
+
} = i(e), h = f.useCallback((l) => (r) => {
|
|
26
|
+
var d;
|
|
27
|
+
if ((d = l.onClick) == null || d.call(l, r), !r.defaultPrevented) {
|
|
28
|
+
if (process.env.NODE_ENV !== "production" && e === void 0)
|
|
29
|
+
throw new Error(["MUI: The `item` provided to useListItem() is undefined.", "This should happen only during server-side rendering under React 17."].join(`
|
|
30
|
+
`));
|
|
31
|
+
a({
|
|
32
|
+
type: E.itemClick,
|
|
33
|
+
item: e,
|
|
34
|
+
event: r
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
}, [a, e]), P = f.useCallback((l) => (r) => {
|
|
38
|
+
var d;
|
|
39
|
+
if ((d = l.onMouseOver) == null || d.call(l, r), !r.defaultPrevented) {
|
|
40
|
+
if (process.env.NODE_ENV !== "production" && e === void 0)
|
|
41
|
+
throw new Error(["MUI: The `item` provided to useListItem() is undefined.", "This should happen only during server-side rendering under React 17."].join(`
|
|
42
|
+
`));
|
|
43
|
+
a({
|
|
44
|
+
type: E.itemHover,
|
|
45
|
+
item: e,
|
|
46
|
+
event: r
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}, [a, e]);
|
|
50
|
+
let u;
|
|
51
|
+
return m && (u = c ? 0 : -1), {
|
|
52
|
+
getRootProps: (l = {}) => {
|
|
53
|
+
const r = O(l);
|
|
54
|
+
return p({}, l, {
|
|
55
|
+
onClick: h(r),
|
|
56
|
+
onPointerOver: t ? P(r) : void 0,
|
|
57
|
+
tabIndex: u
|
|
58
|
+
});
|
|
59
|
+
},
|
|
60
|
+
highlighted: c,
|
|
61
|
+
selected: b
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
function ee(n, t) {
|
|
65
|
+
return function(s = {}) {
|
|
66
|
+
const a = p({}, s, n(s));
|
|
67
|
+
return p({}, a, t(a));
|
|
68
|
+
};
|
|
13
69
|
}
|
|
14
|
-
|
|
15
|
-
function
|
|
16
|
-
return
|
|
70
|
+
const w = "Tab";
|
|
71
|
+
function te(n) {
|
|
72
|
+
return W(w, n);
|
|
17
73
|
}
|
|
18
|
-
|
|
74
|
+
q(w, ["root", "selected", "disabled"]);
|
|
75
|
+
function oe(n) {
|
|
76
|
+
return n.size;
|
|
77
|
+
}
|
|
78
|
+
function se(n) {
|
|
19
79
|
const {
|
|
20
80
|
value: t,
|
|
21
|
-
rootRef:
|
|
22
|
-
disabled:
|
|
81
|
+
rootRef: e,
|
|
82
|
+
disabled: s = !1,
|
|
83
|
+
id: a
|
|
84
|
+
} = n, i = f.useRef(null), c = K(a), {
|
|
85
|
+
value: b,
|
|
86
|
+
selectionFollowsFocus: m,
|
|
87
|
+
getTabPanelId: h
|
|
88
|
+
} = $(), P = f.useMemo(() => ({
|
|
89
|
+
disabled: s,
|
|
90
|
+
ref: i,
|
|
23
91
|
id: c
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
} =
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
index: R,
|
|
35
|
-
totalItemCount: g
|
|
36
|
-
} = X(t ?? ee, P), {
|
|
37
|
-
getRootProps: h,
|
|
38
|
-
highlighted: T,
|
|
39
|
-
selected: i
|
|
40
|
-
} = J({
|
|
41
|
-
item: l
|
|
92
|
+
}), [s, i, c]), {
|
|
93
|
+
id: u,
|
|
94
|
+
index: C,
|
|
95
|
+
totalItemCount: l
|
|
96
|
+
} = Q(t ?? oe, P), {
|
|
97
|
+
getRootProps: r,
|
|
98
|
+
highlighted: d,
|
|
99
|
+
selected: g
|
|
100
|
+
} = Z({
|
|
101
|
+
item: u
|
|
42
102
|
}), {
|
|
43
|
-
getRootProps:
|
|
44
|
-
rootRef:
|
|
45
|
-
active:
|
|
46
|
-
focusVisible:
|
|
47
|
-
setFocusVisible:
|
|
103
|
+
getRootProps: v,
|
|
104
|
+
rootRef: R,
|
|
105
|
+
active: T,
|
|
106
|
+
focusVisible: L,
|
|
107
|
+
setFocusVisible: M
|
|
48
108
|
} = Y({
|
|
49
|
-
disabled:
|
|
50
|
-
focusableWhenDisabled: !
|
|
109
|
+
disabled: s,
|
|
110
|
+
focusableWhenDisabled: !m,
|
|
51
111
|
type: "button"
|
|
52
|
-
}), _ =
|
|
112
|
+
}), _ = N(i, e, R), H = u !== void 0 ? h(u) : void 0;
|
|
53
113
|
return {
|
|
54
114
|
getRootProps: (x = {}) => {
|
|
55
|
-
const
|
|
56
|
-
return
|
|
115
|
+
const V = O(x), F = ee(r, v);
|
|
116
|
+
return p({}, x, F(V), {
|
|
57
117
|
role: "tab",
|
|
58
|
-
"aria-controls":
|
|
59
|
-
"aria-selected":
|
|
60
|
-
id:
|
|
118
|
+
"aria-controls": H,
|
|
119
|
+
"aria-selected": g,
|
|
120
|
+
id: c,
|
|
61
121
|
ref: _
|
|
62
122
|
});
|
|
63
123
|
},
|
|
64
|
-
active:
|
|
65
|
-
focusVisible:
|
|
66
|
-
highlighted:
|
|
67
|
-
index:
|
|
124
|
+
active: T,
|
|
125
|
+
focusVisible: L,
|
|
126
|
+
highlighted: d,
|
|
127
|
+
index: C,
|
|
68
128
|
rootRef: _,
|
|
69
129
|
// the `selected` state isn't set on the server (it relies on effects to be calculated),
|
|
70
130
|
// so we fall back to checking the `value` prop with the selectedValue from the TabsContext
|
|
71
|
-
selected:
|
|
72
|
-
setFocusVisible:
|
|
73
|
-
totalTabsCount:
|
|
131
|
+
selected: g || u === b,
|
|
132
|
+
setFocusVisible: M,
|
|
133
|
+
totalTabsCount: l
|
|
74
134
|
};
|
|
75
135
|
}
|
|
76
|
-
const
|
|
136
|
+
const ne = ["action", "children", "disabled", "onChange", "onClick", "onFocus", "slotProps", "slots", "value"], re = (n) => {
|
|
77
137
|
const {
|
|
78
138
|
selected: t,
|
|
79
|
-
disabled:
|
|
80
|
-
} =
|
|
81
|
-
return
|
|
82
|
-
root: ["root", t && "selected",
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
var
|
|
139
|
+
disabled: e
|
|
140
|
+
} = n;
|
|
141
|
+
return G({
|
|
142
|
+
root: ["root", t && "selected", e && "disabled"]
|
|
143
|
+
}, J(te));
|
|
144
|
+
}, k = /* @__PURE__ */ f.forwardRef(function(t, e) {
|
|
145
|
+
var s;
|
|
86
146
|
const {
|
|
87
|
-
children:
|
|
88
|
-
disabled:
|
|
89
|
-
slotProps:
|
|
90
|
-
slots:
|
|
91
|
-
value:
|
|
92
|
-
} = t,
|
|
93
|
-
active:
|
|
94
|
-
highlighted:
|
|
95
|
-
selected:
|
|
96
|
-
getRootProps:
|
|
97
|
-
} =
|
|
98
|
-
rootRef:
|
|
99
|
-
value:
|
|
100
|
-
})),
|
|
101
|
-
active:
|
|
102
|
-
disabled:
|
|
103
|
-
highlighted:
|
|
104
|
-
selected:
|
|
105
|
-
}),
|
|
106
|
-
elementType:
|
|
107
|
-
getSlotProps:
|
|
108
|
-
externalSlotProps:
|
|
109
|
-
externalForwardedProps:
|
|
147
|
+
children: a,
|
|
148
|
+
disabled: i = !1,
|
|
149
|
+
slotProps: c = {},
|
|
150
|
+
slots: b = {},
|
|
151
|
+
value: m
|
|
152
|
+
} = t, h = B(t, ne), P = f.useRef(), u = N(P, e), {
|
|
153
|
+
active: C,
|
|
154
|
+
highlighted: l,
|
|
155
|
+
selected: r,
|
|
156
|
+
getRootProps: d
|
|
157
|
+
} = se(p({}, t, {
|
|
158
|
+
rootRef: u,
|
|
159
|
+
value: m
|
|
160
|
+
})), g = p({}, t, {
|
|
161
|
+
active: C,
|
|
162
|
+
disabled: i,
|
|
163
|
+
highlighted: l,
|
|
164
|
+
selected: r
|
|
165
|
+
}), v = re(g), R = (s = b.root) != null ? s : "button", T = z({
|
|
166
|
+
elementType: R,
|
|
167
|
+
getSlotProps: d,
|
|
168
|
+
externalSlotProps: c.root,
|
|
169
|
+
externalForwardedProps: h,
|
|
110
170
|
additionalProps: {
|
|
111
|
-
ref:
|
|
171
|
+
ref: e
|
|
112
172
|
},
|
|
113
|
-
ownerState:
|
|
114
|
-
className:
|
|
173
|
+
ownerState: g,
|
|
174
|
+
className: v.root
|
|
115
175
|
});
|
|
116
|
-
return /* @__PURE__ */
|
|
117
|
-
children:
|
|
176
|
+
return /* @__PURE__ */ I(R, p({}, T, {
|
|
177
|
+
children: a
|
|
118
178
|
}));
|
|
119
179
|
});
|
|
120
|
-
process.env.NODE_ENV !== "production" && (
|
|
180
|
+
process.env.NODE_ENV !== "production" && (k.propTypes = {
|
|
121
181
|
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
122
182
|
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
123
183
|
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
|
|
@@ -125,57 +185,57 @@ process.env.NODE_ENV !== "production" && (F.propTypes = {
|
|
|
125
185
|
/**
|
|
126
186
|
* A ref for imperative actions. It currently only supports `focusVisible()` action.
|
|
127
187
|
*/
|
|
128
|
-
action:
|
|
129
|
-
current:
|
|
130
|
-
focusVisible:
|
|
188
|
+
action: o.oneOfType([o.func, o.shape({
|
|
189
|
+
current: o.shape({
|
|
190
|
+
focusVisible: o.func.isRequired
|
|
131
191
|
})
|
|
132
192
|
})]),
|
|
133
193
|
/**
|
|
134
194
|
* @ignore
|
|
135
195
|
*/
|
|
136
|
-
children:
|
|
196
|
+
children: o.node,
|
|
137
197
|
/**
|
|
138
198
|
* If `true`, the component is disabled.
|
|
139
199
|
* @default false
|
|
140
200
|
*/
|
|
141
|
-
disabled:
|
|
201
|
+
disabled: o.bool,
|
|
142
202
|
/**
|
|
143
203
|
* Callback invoked when new value is being set.
|
|
144
204
|
*/
|
|
145
|
-
onChange:
|
|
205
|
+
onChange: o.func,
|
|
146
206
|
/**
|
|
147
207
|
* The props used for each slot inside the Tab.
|
|
148
208
|
* @default {}
|
|
149
209
|
*/
|
|
150
|
-
slotProps:
|
|
151
|
-
root:
|
|
210
|
+
slotProps: o.shape({
|
|
211
|
+
root: o.oneOfType([o.func, o.object])
|
|
152
212
|
}),
|
|
153
213
|
/**
|
|
154
214
|
* The components used for each slot inside the Tab.
|
|
155
215
|
* Either a string to use a HTML element or a component.
|
|
156
216
|
* @default {}
|
|
157
217
|
*/
|
|
158
|
-
slots:
|
|
159
|
-
root:
|
|
218
|
+
slots: o.shape({
|
|
219
|
+
root: o.elementType
|
|
160
220
|
}),
|
|
161
221
|
/**
|
|
162
222
|
* You can provide your own value. Otherwise, it falls back to the child position index.
|
|
163
223
|
*/
|
|
164
|
-
value:
|
|
224
|
+
value: o.oneOfType([o.number, o.string])
|
|
165
225
|
});
|
|
166
|
-
const
|
|
167
|
-
({ children:
|
|
168
|
-
const
|
|
169
|
-
() =>
|
|
226
|
+
const he = S(
|
|
227
|
+
({ children: n, value: t, disabled: e, dataTestId: s }, a) => {
|
|
228
|
+
const i = U(A), c = j(
|
|
229
|
+
() => D(
|
|
170
230
|
y.tabs__tab,
|
|
171
|
-
t === (
|
|
172
|
-
|
|
231
|
+
t === (i == null ? void 0 : i.value) && y["tabs__tab--selected"],
|
|
232
|
+
e && y["tabs__tab--disabled"]
|
|
173
233
|
),
|
|
174
|
-
[t,
|
|
234
|
+
[t, i, e]
|
|
175
235
|
);
|
|
176
|
-
return /* @__PURE__ */
|
|
236
|
+
return /* @__PURE__ */ I(k, { className: c, disabled: e, value: t, "data-testid": s, ref: a, children: n });
|
|
177
237
|
}
|
|
178
238
|
);
|
|
179
239
|
export {
|
|
180
|
-
|
|
240
|
+
he as Tab
|
|
181
241
|
};
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
|
|
3
3
|
export interface TabPanelProps {
|
|
4
|
-
/** The content to be displayed when the corresponding tab is selected */
|
|
5
4
|
children: ReactNode;
|
|
6
|
-
/** The value that identifies which tab is selected.
|
|
7
|
-
* e.g. value="1" when the tab button with the value="1" is selected this content will show */
|
|
8
5
|
value: string | number;
|
|
9
|
-
/** Test id */
|
|
10
6
|
dataTestId?: string;
|
|
11
7
|
}
|
|
12
|
-
export declare const TabPanel: import('react').ForwardRefExoticComponent<TabPanelProps & import(
|
|
8
|
+
export declare const TabPanel: import('react').ForwardRefExoticComponent<TabPanelProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { jsx as T } from "react/jsx-runtime";
|
|
2
|
-
import * as
|
|
2
|
+
import * as P from "react";
|
|
3
3
|
import { forwardRef as v } from "react";
|
|
4
|
-
import { u as y, s as x } from "../../Tabs.module-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { u as y, s as x } from "../../Tabs.module-BKlNuSPH.js";
|
|
5
|
+
import { a as b, _ as C } from "../../objectWithoutPropertiesLoose-ClNcje2_.js";
|
|
6
|
+
import { g as N, a as _, f as w, u as O, P as o, c as E, b as I } from "../../index-BvA1HyDs.js";
|
|
7
|
+
import { u as S, a as U } from "../../useCompoundItem-wTwXbURC.js";
|
|
7
8
|
const h = "TabPanel";
|
|
8
9
|
function j(t) {
|
|
9
|
-
return
|
|
10
|
+
return N(h, t);
|
|
10
11
|
}
|
|
11
|
-
|
|
12
|
+
_(h, ["root", "hidden"]);
|
|
12
13
|
function M(t) {
|
|
13
14
|
return t.size;
|
|
14
15
|
}
|
|
@@ -22,13 +23,13 @@ function V(t) {
|
|
|
22
23
|
throw new Error("No TabContext provided");
|
|
23
24
|
const {
|
|
24
25
|
value: f,
|
|
25
|
-
getTabId:
|
|
26
|
-
} = i, a = S(s), r =
|
|
26
|
+
getTabId: m
|
|
27
|
+
} = i, a = S(s), r = P.useRef(null), c = w(r, n), u = P.useMemo(() => ({
|
|
27
28
|
id: a,
|
|
28
29
|
ref: r
|
|
29
30
|
}), [a]), {
|
|
30
31
|
id: l
|
|
31
|
-
} = U(e ?? M, u), d = l !== f, p = l !== void 0 ?
|
|
32
|
+
} = U(e ?? M, u), d = l !== f, p = l !== void 0 ? m(l) : void 0;
|
|
32
33
|
return {
|
|
33
34
|
hidden: d,
|
|
34
35
|
getRootProps: (g = {}) => b({
|
|
@@ -48,18 +49,18 @@ const F = ["children", "value", "slotProps", "slots"], $ = (t) => {
|
|
|
48
49
|
return E({
|
|
49
50
|
root: ["root", e && "hidden"]
|
|
50
51
|
}, I(j));
|
|
51
|
-
}, R = /* @__PURE__ */
|
|
52
|
+
}, R = /* @__PURE__ */ P.forwardRef(function(e, s) {
|
|
52
53
|
var n;
|
|
53
54
|
const {
|
|
54
55
|
children: i,
|
|
55
56
|
slotProps: f = {},
|
|
56
|
-
slots:
|
|
57
|
-
} = e, a =
|
|
57
|
+
slots: m = {}
|
|
58
|
+
} = e, a = C(e, F), {
|
|
58
59
|
hidden: r,
|
|
59
60
|
getRootProps: c
|
|
60
61
|
} = V(e), u = b({}, e, {
|
|
61
62
|
hidden: r
|
|
62
|
-
}), l = $(u), d = (n =
|
|
63
|
+
}), l = $(u), d = (n = m.root) != null ? n : "div", p = O({
|
|
63
64
|
elementType: d,
|
|
64
65
|
getSlotProps: c,
|
|
65
66
|
externalSlotProps: f.root,
|
|
@@ -110,9 +111,9 @@ process.env.NODE_ENV !== "production" && (R.propTypes = {
|
|
|
110
111
|
*/
|
|
111
112
|
value: o.oneOfType([o.number, o.string])
|
|
112
113
|
});
|
|
113
|
-
const
|
|
114
|
+
const q = v(
|
|
114
115
|
({ children: t, value: e, dataTestId: s }, n) => /* @__PURE__ */ T(R, { className: x["tabs__tab-panel"], value: e, "data-testid": s, ref: n, children: t })
|
|
115
116
|
);
|
|
116
117
|
export {
|
|
117
|
-
|
|
118
|
+
q as TabPanel
|
|
118
119
|
};
|
|
@@ -1,15 +1,9 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
|
|
3
3
|
export interface TabsProps {
|
|
4
|
-
/** Should contain `Tab` and `TabPanel` components to be rendered */
|
|
5
4
|
children?: ReactNode;
|
|
6
|
-
/** Selected tab */
|
|
7
5
|
value?: number | string;
|
|
8
|
-
/** Callback triggered when the user has selected a tab */
|
|
9
|
-
onChange?: (tabValue: number | string | null, event?: React.SyntheticEvent<Element, Event> | null) => void;
|
|
10
|
-
/** Test id */
|
|
11
6
|
dataTestId?: string;
|
|
7
|
+
onChange?: (tabValue: number | string | null, event?: React.SyntheticEvent<Element, Event> | null) => void;
|
|
12
8
|
}
|
|
13
|
-
export declare const Tabs: import('react').ForwardRefExoticComponent<TabsProps & import(
|
|
14
|
-
export * from './Tab';
|
|
15
|
-
export * from './TabPanel';
|
|
9
|
+
export declare const Tabs: import('react').ForwardRefExoticComponent<TabsProps & import("react").RefAttributes<HTMLDivElement>>;
|