@pismo/marola 0.0.1-alpha.32 → 0.0.1-alpha.4
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 +5 -17
- package/dist/{Button-2b1peDFT.js → Button-C3Qm852g.js} +23 -23
- package/dist/Dialog.module-BO0mdB7d.js +15 -0
- package/dist/ListContext-D6-YwtZn.js +18 -0
- package/dist/Tabs.module-_kSbSyth.js +66 -0
- package/dist/assets/CallToActionButton.css +1 -0
- package/dist/assets/Dialog.css +1 -1
- package/dist/assets/LoadingSpinner.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/CallToActionButton/CallToActionButton.d.ts +21 -0
- package/dist/components/CallToActionButton/CallToActionButton.js +57 -0
- package/dist/components/Dialog/Actions.js +1 -1
- package/dist/components/Dialog/Backdrop.d.ts +1 -1
- package/dist/components/Dialog/Backdrop.js +9 -2
- package/dist/components/Dialog/CloseIconButton.js +124 -12
- package/dist/components/Dialog/Dialog.d.ts +5 -6
- package/dist/components/Dialog/Dialog.js +20103 -445
- package/dist/components/Dialog/{DialogTitle.d.ts → Title.d.ts} +3 -3
- package/dist/components/Dialog/Title.js +14 -0
- package/dist/components/LoadingSpinner/LoadingSpinner.d.ts +0 -2
- package/dist/components/LoadingSpinner/LoadingSpinner.js +13 -12
- package/dist/components/Tabs/Tab.d.ts +1 -6
- package/dist/components/Tabs/Tab.js +173 -118
- package/dist/components/Tabs/TabPanel.d.ts +1 -5
- package/dist/components/Tabs/TabPanel.js +10 -8
- package/dist/components/Tabs/Tabs.d.ts +2 -8
- package/dist/components/Tabs/Tabs.js +701 -250
- package/dist/components/Typography/Typography.d.ts +6 -17
- package/dist/components/Typography/Typography.js +64 -55
- package/dist/{index-CH45lKw7.js → index-BZ1lkM_M.js} +159 -162
- package/dist/main.d.ts +5 -27
- package/dist/main.js +21 -75
- package/dist/types/helpers.d.ts +7 -14
- package/dist/useButton-CbmjmH5z.js +186 -0
- package/dist/useCompoundItem-B7wfGDHQ.js +41 -0
- package/package.json +9 -50
- package/src/playground/Playground.tsx +20 -0
- 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/Button.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/IconButton.css +0 -1
- package/dist/assets/Input.css +0 -1
- package/dist/assets/InputSearch.css +0 -1
- package/dist/assets/PageHeader.css +0 -1
- package/dist/assets/Pagination.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.d.ts +0 -32
- package/dist/components/Button/Button.js +0 -65
- 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/IconButton/IconButton.d.ts +0 -38
- package/dist/components/IconButton/IconButton.js +0 -63
- 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.d.ts +0 -66
- package/dist/components/PageHeader/PageHeader.js +0 -87
- package/dist/components/PageHeader/PageHeader.stories.d.ts +0 -14
- package/dist/components/Pagination/Pagination.d.ts +0 -55
- package/dist/components/Pagination/Pagination.js +0 -237
- 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/SortTooltip/SortTooltip.d.ts +0 -28
- package/dist/components/SortTooltip/SortTooltip.js +0 -93
- 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.d.ts +0 -56
- package/dist/components/Table/Table.js +0 -137
- package/dist/components/Table/Table.stories.d.ts +0 -29
- package/dist/components/Table/TableContext.d.ts +0 -19
- package/dist/components/Table/TableContext.js +0 -21
- 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.d.ts +0 -33
- package/dist/components/Tooltip/Tooltip.js +0 -141
- 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/useControlled-CCMYYdCM.js +0 -31
- 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,11 +1,11 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
|
|
3
|
-
export interface
|
|
3
|
+
export interface TitleProps {
|
|
4
4
|
/** title to be displayed */
|
|
5
5
|
title?: ReactNode;
|
|
6
6
|
/** subtitle to be displayed */
|
|
7
7
|
subTitle?: ReactNode;
|
|
8
8
|
}
|
|
9
9
|
/** internal component only - used by the dialog */
|
|
10
|
-
declare const
|
|
11
|
-
export default
|
|
10
|
+
declare const Title: ({ title, subTitle }: TitleProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export default Title;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsxs as l, Fragment as s, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { s as r } from "../../Dialog.module-BO0mdB7d.js";
|
|
3
|
+
import { Typography as a } from "../Typography/Typography.js";
|
|
4
|
+
const n = ({
|
|
5
|
+
title: i,
|
|
6
|
+
subTitle: t
|
|
7
|
+
}) => /* @__PURE__ */ l(s, { children: [
|
|
8
|
+
/* @__PURE__ */ e(a, { element: "h1", elementProps: { id: "alert-dialog-title" }, variant: "h4", className: r.dialog__title, children: i }),
|
|
9
|
+
/* @__PURE__ */ e("hr", { className: r.dialog__divider, "aria-hidden": !0 }),
|
|
10
|
+
t && /* @__PURE__ */ e(a, { element: "h2", elementProps: { id: "alert-dialog-description" }, variant: "h4", className: r.dialog__subtitle, children: t })
|
|
11
|
+
] });
|
|
12
|
+
export {
|
|
13
|
+
n as default
|
|
14
|
+
};
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
export interface LoadingSpinnerProps {
|
|
2
|
-
/** Whether to invert colours or not */
|
|
3
2
|
invert?: boolean;
|
|
4
|
-
/** Space separated list of CSS classes to apply */
|
|
5
3
|
classNames?: string;
|
|
6
4
|
}
|
|
7
5
|
export declare const LoadingSpinner: ({ invert, classNames }: LoadingSpinnerProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import '../../assets/LoadingSpinner.css';
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { useMemo as
|
|
2
|
+
import { jsxs as o, jsx as s } from "react/jsx-runtime";
|
|
3
|
+
import { useMemo as e } from "react";
|
|
4
4
|
import { c as t } from "../../clsx-DB4S2d7J.js";
|
|
5
5
|
const n = {
|
|
6
|
-
"ls-ring": "_ls-
|
|
7
|
-
"ls-ring--invert": "_ls-ring--
|
|
8
|
-
},
|
|
9
|
-
const l =
|
|
10
|
-
|
|
11
|
-
[
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
"ls-ring": "_ls-ring_19dsy_1",
|
|
7
|
+
"ls-ring--invert": "_ls-ring--invert_19dsy_34"
|
|
8
|
+
}, c = ({ invert: i = !1, classNames: r }) => {
|
|
9
|
+
const l = e(() => t(
|
|
10
|
+
[n["ls-ring"]],
|
|
11
|
+
{ [n["ls-ring--invert"]]: i },
|
|
12
|
+
r
|
|
13
|
+
), [r, i]);
|
|
14
|
+
return /* @__PURE__ */ o("div", { className: l, children: [
|
|
14
15
|
/* @__PURE__ */ s("div", {}),
|
|
15
16
|
/* @__PURE__ */ s("div", {}),
|
|
16
17
|
/* @__PURE__ */ s("div", {}),
|
|
@@ -18,6 +19,6 @@ const n = {
|
|
|
18
19
|
] });
|
|
19
20
|
};
|
|
20
21
|
export {
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
c as LoadingSpinner,
|
|
23
|
+
c as default
|
|
23
24
|
};
|
|
@@ -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,182 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { u as
|
|
8
|
-
import {
|
|
9
|
-
import { u as Y } from "../../useButton-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { jsx as I } from "react/jsx-runtime";
|
|
2
|
+
import { a as S, T as U, s as y } from "../../Tabs.module-_kSbSyth.js";
|
|
3
|
+
import * as f from "react";
|
|
4
|
+
import { forwardRef as j, useContext as D, useMemo as $ } from "react";
|
|
5
|
+
import { c as A } from "../../clsx-DB4S2d7J.js";
|
|
6
|
+
import { e as O, _ as p, g as B, a as W, u as N, b as q, c as z, P as o, d as G, f as J } from "../../index-BZ1lkM_M.js";
|
|
7
|
+
import { u as K, a as Q } from "../../useCompoundItem-B7wfGDHQ.js";
|
|
8
|
+
import { a as X, L as E } from "../../ListContext-D6-YwtZn.js";
|
|
9
|
+
import { u as Y } from "../../useButton-CbmjmH5z.js";
|
|
10
|
+
function Z(n) {
|
|
11
|
+
const {
|
|
12
|
+
handlePointerOverEvents: t = !1,
|
|
13
|
+
item: e
|
|
14
|
+
} = n, s = f.useContext(X);
|
|
15
|
+
if (!s)
|
|
16
|
+
throw new Error("useListItem must be used within a ListProvider");
|
|
17
|
+
const {
|
|
18
|
+
dispatch: a,
|
|
19
|
+
getItemState: i
|
|
20
|
+
} = s, {
|
|
21
|
+
highlighted: c,
|
|
22
|
+
selected: b,
|
|
23
|
+
focusable: m
|
|
24
|
+
} = i(e), h = f.useCallback((l) => (r) => {
|
|
25
|
+
var u;
|
|
26
|
+
if ((u = l.onClick) == null || u.call(l, r), !r.defaultPrevented) {
|
|
27
|
+
if (process.env.NODE_ENV !== "production" && e === void 0)
|
|
28
|
+
throw new Error(["MUI: The `item` provided to useListItem() is undefined.", "This should happen only during server-side rendering under React 17."].join(`
|
|
29
|
+
`));
|
|
30
|
+
a({
|
|
31
|
+
type: E.itemClick,
|
|
32
|
+
item: e,
|
|
33
|
+
event: r
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
}, [a, e]), P = f.useCallback((l) => (r) => {
|
|
37
|
+
var u;
|
|
38
|
+
if ((u = l.onMouseOver) == null || u.call(l, r), !r.defaultPrevented) {
|
|
39
|
+
if (process.env.NODE_ENV !== "production" && e === void 0)
|
|
40
|
+
throw new Error(["MUI: The `item` provided to useListItem() is undefined.", "This should happen only during server-side rendering under React 17."].join(`
|
|
41
|
+
`));
|
|
42
|
+
a({
|
|
43
|
+
type: E.itemHover,
|
|
44
|
+
item: e,
|
|
45
|
+
event: r
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
}, [a, e]);
|
|
49
|
+
let d;
|
|
50
|
+
return m && (d = c ? 0 : -1), {
|
|
51
|
+
getRootProps: (l = {}) => {
|
|
52
|
+
const r = O(l);
|
|
53
|
+
return p({}, l, {
|
|
54
|
+
onClick: h(r),
|
|
55
|
+
onPointerOver: t ? P(r) : void 0,
|
|
56
|
+
tabIndex: d
|
|
57
|
+
});
|
|
58
|
+
},
|
|
59
|
+
highlighted: c,
|
|
60
|
+
selected: b
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
function ee(n, t) {
|
|
64
|
+
return function(s = {}) {
|
|
65
|
+
const a = p({}, s, n(s));
|
|
66
|
+
return p({}, a, t(a));
|
|
67
|
+
};
|
|
13
68
|
}
|
|
14
|
-
|
|
15
|
-
function
|
|
16
|
-
return
|
|
69
|
+
const w = "Tab";
|
|
70
|
+
function te(n) {
|
|
71
|
+
return B(w, n);
|
|
17
72
|
}
|
|
18
|
-
|
|
73
|
+
W(w, ["root", "selected", "disabled"]);
|
|
74
|
+
function oe(n) {
|
|
75
|
+
return n.size;
|
|
76
|
+
}
|
|
77
|
+
function se(n) {
|
|
19
78
|
const {
|
|
20
79
|
value: t,
|
|
21
|
-
rootRef:
|
|
22
|
-
disabled:
|
|
80
|
+
rootRef: e,
|
|
81
|
+
disabled: s = !1,
|
|
82
|
+
id: a
|
|
83
|
+
} = n, i = f.useRef(null), c = K(a), {
|
|
84
|
+
value: b,
|
|
85
|
+
selectionFollowsFocus: m,
|
|
86
|
+
getTabPanelId: h
|
|
87
|
+
} = S(), P = f.useMemo(() => ({
|
|
88
|
+
disabled: s,
|
|
89
|
+
ref: i,
|
|
23
90
|
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
|
|
91
|
+
}), [s, i, c]), {
|
|
92
|
+
id: d,
|
|
93
|
+
index: C,
|
|
94
|
+
totalItemCount: l
|
|
95
|
+
} = Q(t ?? oe, P), {
|
|
96
|
+
getRootProps: r,
|
|
97
|
+
highlighted: u,
|
|
98
|
+
selected: g
|
|
99
|
+
} = Z({
|
|
100
|
+
item: d
|
|
42
101
|
}), {
|
|
43
|
-
getRootProps:
|
|
44
|
-
rootRef:
|
|
45
|
-
active:
|
|
46
|
-
focusVisible:
|
|
47
|
-
setFocusVisible:
|
|
102
|
+
getRootProps: v,
|
|
103
|
+
rootRef: R,
|
|
104
|
+
active: T,
|
|
105
|
+
focusVisible: L,
|
|
106
|
+
setFocusVisible: M
|
|
48
107
|
} = Y({
|
|
49
|
-
disabled:
|
|
50
|
-
focusableWhenDisabled: !
|
|
108
|
+
disabled: s,
|
|
109
|
+
focusableWhenDisabled: !m,
|
|
51
110
|
type: "button"
|
|
52
|
-
}), _ =
|
|
111
|
+
}), _ = N(i, e, R), H = d !== void 0 ? h(d) : void 0;
|
|
53
112
|
return {
|
|
54
113
|
getRootProps: (x = {}) => {
|
|
55
|
-
const
|
|
56
|
-
return
|
|
114
|
+
const V = O(x), F = ee(r, v);
|
|
115
|
+
return p({}, x, F(V), {
|
|
57
116
|
role: "tab",
|
|
58
|
-
"aria-controls":
|
|
59
|
-
"aria-selected":
|
|
60
|
-
id:
|
|
117
|
+
"aria-controls": H,
|
|
118
|
+
"aria-selected": g,
|
|
119
|
+
id: c,
|
|
61
120
|
ref: _
|
|
62
121
|
});
|
|
63
122
|
},
|
|
64
|
-
active:
|
|
65
|
-
focusVisible:
|
|
66
|
-
highlighted:
|
|
67
|
-
index:
|
|
123
|
+
active: T,
|
|
124
|
+
focusVisible: L,
|
|
125
|
+
highlighted: u,
|
|
126
|
+
index: C,
|
|
68
127
|
rootRef: _,
|
|
69
128
|
// the `selected` state isn't set on the server (it relies on effects to be calculated),
|
|
70
129
|
// so we fall back to checking the `value` prop with the selectedValue from the TabsContext
|
|
71
|
-
selected:
|
|
72
|
-
setFocusVisible:
|
|
73
|
-
totalTabsCount:
|
|
130
|
+
selected: g || d === b,
|
|
131
|
+
setFocusVisible: M,
|
|
132
|
+
totalTabsCount: l
|
|
74
133
|
};
|
|
75
134
|
}
|
|
76
|
-
const
|
|
135
|
+
const ne = ["action", "children", "disabled", "onChange", "onClick", "onFocus", "slotProps", "slots", "value"], re = (n) => {
|
|
77
136
|
const {
|
|
78
137
|
selected: t,
|
|
79
|
-
disabled:
|
|
80
|
-
} =
|
|
81
|
-
return
|
|
82
|
-
root: ["root", t && "selected",
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
var
|
|
138
|
+
disabled: e
|
|
139
|
+
} = n;
|
|
140
|
+
return G({
|
|
141
|
+
root: ["root", t && "selected", e && "disabled"]
|
|
142
|
+
}, J(te));
|
|
143
|
+
}, k = /* @__PURE__ */ f.forwardRef(function(t, e) {
|
|
144
|
+
var s;
|
|
86
145
|
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:
|
|
146
|
+
children: a,
|
|
147
|
+
disabled: i = !1,
|
|
148
|
+
slotProps: c = {},
|
|
149
|
+
slots: b = {},
|
|
150
|
+
value: m
|
|
151
|
+
} = t, h = q(t, ne), P = f.useRef(), d = N(P, e), {
|
|
152
|
+
active: C,
|
|
153
|
+
highlighted: l,
|
|
154
|
+
selected: r,
|
|
155
|
+
getRootProps: u
|
|
156
|
+
} = se(p({}, t, {
|
|
157
|
+
rootRef: d,
|
|
158
|
+
value: m
|
|
159
|
+
})), g = p({}, t, {
|
|
160
|
+
active: C,
|
|
161
|
+
disabled: i,
|
|
162
|
+
highlighted: l,
|
|
163
|
+
selected: r
|
|
164
|
+
}), v = re(g), R = (s = b.root) != null ? s : "button", T = z({
|
|
165
|
+
elementType: R,
|
|
166
|
+
getSlotProps: u,
|
|
167
|
+
externalSlotProps: c.root,
|
|
168
|
+
externalForwardedProps: h,
|
|
110
169
|
additionalProps: {
|
|
111
|
-
ref:
|
|
170
|
+
ref: e
|
|
112
171
|
},
|
|
113
|
-
ownerState:
|
|
114
|
-
className:
|
|
172
|
+
ownerState: g,
|
|
173
|
+
className: v.root
|
|
115
174
|
});
|
|
116
|
-
return /* @__PURE__ */
|
|
117
|
-
children:
|
|
175
|
+
return /* @__PURE__ */ I(R, p({}, T, {
|
|
176
|
+
children: a
|
|
118
177
|
}));
|
|
119
178
|
});
|
|
120
|
-
process.env.NODE_ENV !== "production" && (
|
|
179
|
+
process.env.NODE_ENV !== "production" && (k.propTypes = {
|
|
121
180
|
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
122
181
|
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
123
182
|
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
|
|
@@ -125,57 +184,53 @@ process.env.NODE_ENV !== "production" && (F.propTypes = {
|
|
|
125
184
|
/**
|
|
126
185
|
* A ref for imperative actions. It currently only supports `focusVisible()` action.
|
|
127
186
|
*/
|
|
128
|
-
action:
|
|
129
|
-
current:
|
|
130
|
-
focusVisible:
|
|
187
|
+
action: o.oneOfType([o.func, o.shape({
|
|
188
|
+
current: o.shape({
|
|
189
|
+
focusVisible: o.func.isRequired
|
|
131
190
|
})
|
|
132
191
|
})]),
|
|
133
192
|
/**
|
|
134
193
|
* @ignore
|
|
135
194
|
*/
|
|
136
|
-
children:
|
|
195
|
+
children: o.node,
|
|
137
196
|
/**
|
|
138
197
|
* If `true`, the component is disabled.
|
|
139
198
|
* @default false
|
|
140
199
|
*/
|
|
141
|
-
disabled:
|
|
200
|
+
disabled: o.bool,
|
|
142
201
|
/**
|
|
143
202
|
* Callback invoked when new value is being set.
|
|
144
203
|
*/
|
|
145
|
-
onChange:
|
|
204
|
+
onChange: o.func,
|
|
146
205
|
/**
|
|
147
206
|
* The props used for each slot inside the Tab.
|
|
148
207
|
* @default {}
|
|
149
208
|
*/
|
|
150
|
-
slotProps:
|
|
151
|
-
root:
|
|
209
|
+
slotProps: o.shape({
|
|
210
|
+
root: o.oneOfType([o.func, o.object])
|
|
152
211
|
}),
|
|
153
212
|
/**
|
|
154
213
|
* The components used for each slot inside the Tab.
|
|
155
214
|
* Either a string to use a HTML element or a component.
|
|
156
215
|
* @default {}
|
|
157
216
|
*/
|
|
158
|
-
slots:
|
|
159
|
-
root:
|
|
217
|
+
slots: o.shape({
|
|
218
|
+
root: o.elementType
|
|
160
219
|
}),
|
|
161
220
|
/**
|
|
162
221
|
* You can provide your own value. Otherwise, it falls back to the child position index.
|
|
163
222
|
*/
|
|
164
|
-
value:
|
|
223
|
+
value: o.oneOfType([o.number, o.string])
|
|
224
|
+
});
|
|
225
|
+
const me = j(({
|
|
226
|
+
children: n,
|
|
227
|
+
value: t,
|
|
228
|
+
disabled: e,
|
|
229
|
+
dataTestId: s
|
|
230
|
+
}, a) => {
|
|
231
|
+
const i = D(U), c = $(() => A(y.tabs__tab, t === (i == null ? void 0 : i.value) && y["tabs__tab--selected"], e && y["tabs__tab--disabled"]), [t, i, e]);
|
|
232
|
+
return /* @__PURE__ */ I(k, { className: c, disabled: e, value: t, "data-testid": s, ref: a, children: n });
|
|
165
233
|
});
|
|
166
|
-
const fe = H(
|
|
167
|
-
({ children: o, value: t, disabled: s, dataTestId: n }, c) => {
|
|
168
|
-
const a = U(D), r = j(
|
|
169
|
-
() => k(
|
|
170
|
-
y.tabs__tab,
|
|
171
|
-
t === (a == null ? void 0 : a.value) && y["tabs__tab--selected"],
|
|
172
|
-
s && y["tabs__tab--disabled"]
|
|
173
|
-
),
|
|
174
|
-
[t, a, s]
|
|
175
|
-
);
|
|
176
|
-
return /* @__PURE__ */ N(F, { className: r, disabled: s, value: t, "data-testid": n, ref: c, children: o });
|
|
177
|
-
}
|
|
178
|
-
);
|
|
179
234
|
export {
|
|
180
|
-
|
|
235
|
+
me as Tab
|
|
181
236
|
};
|
|
@@ -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,9 +1,9 @@
|
|
|
1
1
|
import { jsx as T } from "react/jsx-runtime";
|
|
2
|
+
import { a as v, s as y } from "../../Tabs.module-_kSbSyth.js";
|
|
2
3
|
import * as m from "react";
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { u as
|
|
5
|
-
import {
|
|
6
|
-
import { u as S, a as U } from "../../useCompoundItem-D1iRfg8D.js";
|
|
4
|
+
import { forwardRef as x } from "react";
|
|
5
|
+
import { g as C, a as N, u as _, _ as b, b as w, c as O, P as o, d as E, f as I } from "../../index-BZ1lkM_M.js";
|
|
6
|
+
import { u as S, a as U } from "../../useCompoundItem-B7wfGDHQ.js";
|
|
7
7
|
const h = "TabPanel";
|
|
8
8
|
function j(t) {
|
|
9
9
|
return C(h, t);
|
|
@@ -17,7 +17,7 @@ function V(t) {
|
|
|
17
17
|
value: e,
|
|
18
18
|
id: s,
|
|
19
19
|
rootRef: n
|
|
20
|
-
} = t, i =
|
|
20
|
+
} = t, i = v();
|
|
21
21
|
if (i === null)
|
|
22
22
|
throw new Error("No TabContext provided");
|
|
23
23
|
const {
|
|
@@ -110,9 +110,11 @@ process.env.NODE_ENV !== "production" && (R.propTypes = {
|
|
|
110
110
|
*/
|
|
111
111
|
value: o.oneOfType([o.number, o.string])
|
|
112
112
|
});
|
|
113
|
-
const W =
|
|
114
|
-
|
|
115
|
-
|
|
113
|
+
const W = x(({
|
|
114
|
+
children: t,
|
|
115
|
+
value: e,
|
|
116
|
+
dataTestId: s
|
|
117
|
+
}, n) => /* @__PURE__ */ T(R, { className: y["tabs__tab-panel"], value: e, "data-testid": s, ref: n, children: t }));
|
|
116
118
|
export {
|
|
117
119
|
W as TabPanel
|
|
118
120
|
};
|
|
@@ -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>>;
|