@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
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { TabsProps } from './Tabs.tsx';
|
|
2
|
+
import { StoryObj } from '@storybook/react';
|
|
3
|
+
|
|
4
|
+
declare const meta: {
|
|
5
|
+
title: string;
|
|
6
|
+
component: import('react').ForwardRefExoticComponent<TabsProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
7
|
+
tags: string[];
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export default meta;
|
|
13
|
+
type Story = StoryObj<typeof meta>;
|
|
14
|
+
export declare const Simple: Story;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { VariantType } from '../Typography/Typography.tsx';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
|
|
4
|
+
type OptionsProps = {
|
|
5
|
+
variant?: VariantType;
|
|
6
|
+
color?: string;
|
|
7
|
+
};
|
|
8
|
+
export interface TextDisplayProps {
|
|
9
|
+
/** TextDisplay label */
|
|
10
|
+
label: React.ReactNode;
|
|
11
|
+
/** TextDisplay value */
|
|
12
|
+
value: React.ReactNode;
|
|
13
|
+
/** Renders skeleton when true */
|
|
14
|
+
isLoading?: boolean;
|
|
15
|
+
/** Sets the testId prefix for label, value and skeletons */
|
|
16
|
+
testId?: string;
|
|
17
|
+
/** Sets the label options */
|
|
18
|
+
labelOptions?: OptionsProps;
|
|
19
|
+
/** Sets the value options */
|
|
20
|
+
valueOptions?: OptionsProps;
|
|
21
|
+
}
|
|
22
|
+
export declare const TextDisplay: ({ label, value, isLoading, testId, labelOptions, valueOptions, }: TextDisplayProps) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import '../../assets/TextDisplay.css';
|
|
2
|
+
import { jsxs as h, jsx as c } from "react/jsx-runtime";
|
|
3
|
+
import { Skeleton as d } from "../Skeleton/Skeleton.js";
|
|
4
|
+
import { Typography as o } from "../Typography/Typography.js";
|
|
5
|
+
const x = "_container_13z5o_1", f = {
|
|
6
|
+
container: x
|
|
7
|
+
}, $ = ({
|
|
8
|
+
label: m,
|
|
9
|
+
value: y,
|
|
10
|
+
isLoading: e = !1,
|
|
11
|
+
testId: t = "TextDisplay",
|
|
12
|
+
labelOptions: r,
|
|
13
|
+
valueOptions: a
|
|
14
|
+
}) => /* @__PURE__ */ h("div", { className: f.container, children: [
|
|
15
|
+
/* @__PURE__ */ c(
|
|
16
|
+
o,
|
|
17
|
+
{
|
|
18
|
+
color: (r == null ? void 0 : r.color) || "var(--gray-90)",
|
|
19
|
+
variant: (r == null ? void 0 : r.variant) || "base",
|
|
20
|
+
"data-testid": `${t}-label`,
|
|
21
|
+
children: e ? /* @__PURE__ */ c(d, { style: { width: 70, marginBottom: 2 }, "data-testid": `${t}-skeletonLabel` }) : m
|
|
22
|
+
}
|
|
23
|
+
),
|
|
24
|
+
/* @__PURE__ */ c(
|
|
25
|
+
o,
|
|
26
|
+
{
|
|
27
|
+
bold: !0,
|
|
28
|
+
color: (a == null ? void 0 : a.color) || "var(--gray-90)",
|
|
29
|
+
variant: (a == null ? void 0 : a.variant) || "base-lg",
|
|
30
|
+
"data-testid": `${t}-value`,
|
|
31
|
+
children: e ? /* @__PURE__ */ c(d, { style: { width: 100 }, "data-testid": `${t}-skeletonValue` }) : y || "-"
|
|
32
|
+
}
|
|
33
|
+
)
|
|
34
|
+
] });
|
|
35
|
+
export {
|
|
36
|
+
$ as TextDisplay
|
|
37
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: ({ label, value, isLoading, testId, labelOptions, valueOptions, }: import('./TextDisplay').TextDisplayProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
tags: string[];
|
|
7
|
+
};
|
|
8
|
+
export default meta;
|
|
9
|
+
type Story = StoryObj<typeof meta>;
|
|
10
|
+
export declare const Simple: Story;
|
|
11
|
+
export declare const WithLoading: Story;
|
|
12
|
+
export declare const Size: Story;
|
|
13
|
+
export declare const Color: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,134 +1,133 @@
|
|
|
1
|
-
import '../../assets/
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { c as
|
|
4
|
-
import { a as
|
|
5
|
-
import * as
|
|
6
|
-
import { u as
|
|
7
|
-
import { u as D } from "../../
|
|
8
|
-
|
|
9
|
-
function W(l) {
|
|
1
|
+
import '../../assets/Toggle2.css';
|
|
2
|
+
import { jsxs as j, jsx as P } from "react/jsx-runtime";
|
|
3
|
+
import { c as O } from "../../clsx-DB4S2d7J.js";
|
|
4
|
+
import { u as E, b as k, g as v, a as U, _ as q, c as C, P as e, d as H, e as M } from "../../index-CH45lKw7.js";
|
|
5
|
+
import * as F from "react";
|
|
6
|
+
import { u as A } from "../../useControlled-CCMYYdCM.js";
|
|
7
|
+
import { u as D } from "../../useIsFocusVisible-BH4IAdcw.js";
|
|
8
|
+
function L(l) {
|
|
10
9
|
const {
|
|
11
10
|
checked: s,
|
|
12
|
-
defaultChecked:
|
|
13
|
-
disabled:
|
|
14
|
-
onBlur:
|
|
15
|
-
onChange:
|
|
16
|
-
onFocus:
|
|
11
|
+
defaultChecked: i,
|
|
12
|
+
disabled: r,
|
|
13
|
+
onBlur: c,
|
|
14
|
+
onChange: h,
|
|
15
|
+
onFocus: n,
|
|
17
16
|
onFocusVisible: u,
|
|
18
|
-
readOnly:
|
|
19
|
-
required:
|
|
20
|
-
} = l, [
|
|
17
|
+
readOnly: a,
|
|
18
|
+
required: p
|
|
19
|
+
} = l, [N, V] = A({
|
|
21
20
|
controlled: s,
|
|
22
|
-
default: !!
|
|
21
|
+
default: !!i,
|
|
23
22
|
name: "Switch",
|
|
24
23
|
state: "checked"
|
|
25
|
-
}),
|
|
26
|
-
var
|
|
27
|
-
o.nativeEvent.defaultPrevented || (
|
|
24
|
+
}), S = (t) => (o) => {
|
|
25
|
+
var d;
|
|
26
|
+
o.nativeEvent.defaultPrevented || (V(o.target.checked), h == null || h(o), (d = t.onChange) == null || d.call(t, o));
|
|
28
27
|
}, {
|
|
29
|
-
isFocusVisibleRef:
|
|
30
|
-
onBlur:
|
|
31
|
-
onFocus:
|
|
32
|
-
ref:
|
|
33
|
-
} =
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}, [
|
|
37
|
-
const
|
|
38
|
-
var
|
|
39
|
-
|
|
40
|
-
},
|
|
41
|
-
var
|
|
42
|
-
|
|
43
|
-
},
|
|
28
|
+
isFocusVisibleRef: b,
|
|
29
|
+
onBlur: B,
|
|
30
|
+
onFocus: _,
|
|
31
|
+
ref: f
|
|
32
|
+
} = D(), [y, z] = F.useState(!1);
|
|
33
|
+
r && y && z(!1), F.useEffect(() => {
|
|
34
|
+
b.current = y;
|
|
35
|
+
}, [y, b]);
|
|
36
|
+
const m = F.useRef(null), w = (t) => (o) => {
|
|
37
|
+
var d;
|
|
38
|
+
m.current || (m.current = o.currentTarget), _(o), b.current === !0 && (z(!0), u == null || u(o)), n == null || n(o), (d = t.onFocus) == null || d.call(t, o);
|
|
39
|
+
}, T = (t) => (o) => {
|
|
40
|
+
var d;
|
|
41
|
+
B(o), b.current === !1 && z(!1), c == null || c(o), (d = t.onBlur) == null || d.call(t, o);
|
|
42
|
+
}, x = E(f, m);
|
|
44
43
|
return {
|
|
45
|
-
checked:
|
|
46
|
-
disabled: !!
|
|
47
|
-
focusVisible:
|
|
48
|
-
getInputProps: (t = {}) =>
|
|
44
|
+
checked: N,
|
|
45
|
+
disabled: !!r,
|
|
46
|
+
focusVisible: y,
|
|
47
|
+
getInputProps: (t = {}) => k({
|
|
49
48
|
checked: s,
|
|
50
|
-
defaultChecked:
|
|
51
|
-
disabled:
|
|
52
|
-
readOnly:
|
|
53
|
-
ref:
|
|
54
|
-
required:
|
|
49
|
+
defaultChecked: i,
|
|
50
|
+
disabled: r,
|
|
51
|
+
readOnly: a,
|
|
52
|
+
ref: x,
|
|
53
|
+
required: p,
|
|
55
54
|
type: "checkbox",
|
|
56
55
|
role: "switch",
|
|
57
56
|
"aria-checked": s
|
|
58
57
|
}, t, {
|
|
59
|
-
onChange:
|
|
60
|
-
onFocus:
|
|
61
|
-
onBlur:
|
|
58
|
+
onChange: S(t),
|
|
59
|
+
onFocus: w(t),
|
|
60
|
+
onBlur: T(t)
|
|
62
61
|
}),
|
|
63
|
-
inputRef:
|
|
64
|
-
readOnly: !!
|
|
62
|
+
inputRef: x,
|
|
63
|
+
readOnly: !!a
|
|
65
64
|
};
|
|
66
65
|
}
|
|
67
|
-
const
|
|
68
|
-
function
|
|
69
|
-
return
|
|
66
|
+
const I = "Switch";
|
|
67
|
+
function W(l) {
|
|
68
|
+
return v(I, l);
|
|
70
69
|
}
|
|
71
|
-
|
|
70
|
+
U(I, ["root", "input", "track", "thumb", "checked", "disabled", "focusVisible", "readOnly"]);
|
|
72
71
|
const G = ["checked", "defaultChecked", "disabled", "onBlur", "onChange", "onFocus", "onFocusVisible", "readOnly", "required", "slotProps", "slots"], J = (l) => {
|
|
73
72
|
const {
|
|
74
73
|
checked: s,
|
|
75
|
-
disabled:
|
|
76
|
-
focusVisible:
|
|
77
|
-
readOnly:
|
|
74
|
+
disabled: i,
|
|
75
|
+
focusVisible: r,
|
|
76
|
+
readOnly: c
|
|
78
77
|
} = l;
|
|
79
|
-
return
|
|
80
|
-
root: ["root", s && "checked",
|
|
78
|
+
return H({
|
|
79
|
+
root: ["root", s && "checked", i && "disabled", r && "focusVisible", c && "readOnly"],
|
|
81
80
|
thumb: ["thumb"],
|
|
82
81
|
input: ["input"],
|
|
83
82
|
track: ["track"]
|
|
84
|
-
},
|
|
85
|
-
},
|
|
86
|
-
var
|
|
83
|
+
}, M(W));
|
|
84
|
+
}, $ = /* @__PURE__ */ F.forwardRef(function(s, i) {
|
|
85
|
+
var r, c, h, n;
|
|
87
86
|
const {
|
|
88
87
|
slotProps: u = {},
|
|
89
|
-
slots:
|
|
90
|
-
} = s,
|
|
91
|
-
getInputProps:
|
|
92
|
-
checked:
|
|
93
|
-
disabled:
|
|
94
|
-
focusVisible:
|
|
95
|
-
readOnly:
|
|
96
|
-
} =
|
|
97
|
-
checked:
|
|
98
|
-
disabled:
|
|
99
|
-
focusVisible:
|
|
100
|
-
readOnly:
|
|
101
|
-
}),
|
|
102
|
-
elementType:
|
|
88
|
+
slots: a = {}
|
|
89
|
+
} = s, p = q(s, G), {
|
|
90
|
+
getInputProps: N,
|
|
91
|
+
checked: V,
|
|
92
|
+
disabled: S,
|
|
93
|
+
focusVisible: b,
|
|
94
|
+
readOnly: B
|
|
95
|
+
} = L(s), _ = k({}, s, {
|
|
96
|
+
checked: V,
|
|
97
|
+
disabled: S,
|
|
98
|
+
focusVisible: b,
|
|
99
|
+
readOnly: B
|
|
100
|
+
}), f = J(_), y = (r = a.root) != null ? r : "span", z = C({
|
|
101
|
+
elementType: y,
|
|
103
102
|
externalSlotProps: u.root,
|
|
104
|
-
externalForwardedProps:
|
|
103
|
+
externalForwardedProps: p,
|
|
105
104
|
additionalProps: {
|
|
106
|
-
ref:
|
|
105
|
+
ref: i
|
|
107
106
|
},
|
|
108
|
-
ownerState:
|
|
109
|
-
className:
|
|
110
|
-
}),
|
|
111
|
-
elementType:
|
|
107
|
+
ownerState: _,
|
|
108
|
+
className: f.root
|
|
109
|
+
}), m = (c = a.thumb) != null ? c : "span", w = C({
|
|
110
|
+
elementType: m,
|
|
112
111
|
externalSlotProps: u.thumb,
|
|
113
|
-
ownerState:
|
|
114
|
-
className:
|
|
115
|
-
}),
|
|
116
|
-
elementType:
|
|
117
|
-
getSlotProps:
|
|
112
|
+
ownerState: _,
|
|
113
|
+
className: f.thumb
|
|
114
|
+
}), T = (h = a.input) != null ? h : "input", x = C({
|
|
115
|
+
elementType: T,
|
|
116
|
+
getSlotProps: N,
|
|
118
117
|
externalSlotProps: u.input,
|
|
119
|
-
ownerState:
|
|
120
|
-
className:
|
|
121
|
-
}),
|
|
122
|
-
elementType:
|
|
118
|
+
ownerState: _,
|
|
119
|
+
className: f.input
|
|
120
|
+
}), R = a.track === null ? () => null : (n = a.track) != null ? n : "span", t = C({
|
|
121
|
+
elementType: R,
|
|
123
122
|
externalSlotProps: u.track,
|
|
124
|
-
ownerState:
|
|
125
|
-
className:
|
|
123
|
+
ownerState: _,
|
|
124
|
+
className: f.track
|
|
126
125
|
});
|
|
127
|
-
return /* @__PURE__ */
|
|
128
|
-
children: [/* @__PURE__ */
|
|
126
|
+
return /* @__PURE__ */ j(y, k({}, z, {
|
|
127
|
+
children: [/* @__PURE__ */ P(R, k({}, t)), /* @__PURE__ */ P(m, k({}, w)), /* @__PURE__ */ P(T, k({}, x))]
|
|
129
128
|
}));
|
|
130
129
|
});
|
|
131
|
-
process.env.NODE_ENV !== "production" && (
|
|
130
|
+
process.env.NODE_ENV !== "production" && ($.propTypes = {
|
|
132
131
|
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
133
132
|
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
134
133
|
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
|
|
@@ -199,54 +198,69 @@ process.env.NODE_ENV !== "production" && (E.propTypes = {
|
|
|
199
198
|
track: e.oneOfType([e.elementType, e.oneOf([null])])
|
|
200
199
|
})
|
|
201
200
|
});
|
|
202
|
-
const K = "
|
|
203
|
-
|
|
204
|
-
"
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
"
|
|
209
|
-
"
|
|
210
|
-
toggle__label:
|
|
211
|
-
"
|
|
212
|
-
|
|
201
|
+
const K = "_toggle__label_1rzg2_43", Q = "_toggle_1rzg2_43", X = "_input_1rzg2_88", Y = "_thumb_1rzg2_99", Z = "_track_1rzg2_113", g = {
|
|
202
|
+
"u-typography-h1": "_u-typography-h1_1rzg2_1",
|
|
203
|
+
"u-typography-h2": "_u-typography-h2_1rzg2_8",
|
|
204
|
+
"u-typography-h3": "_u-typography-h3_1rzg2_15",
|
|
205
|
+
"u-typography-h4": "_u-typography-h4_1rzg2_22",
|
|
206
|
+
"u-typography-h5": "_u-typography-h5_1rzg2_29",
|
|
207
|
+
"u-typography-h6": "_u-typography-h6_1rzg2_36",
|
|
208
|
+
"u-typography-base": "_u-typography-base_1rzg2_43",
|
|
209
|
+
toggle__label: K,
|
|
210
|
+
"u-typography-base--xxl": "_u-typography-base--xxl_1rzg2_48",
|
|
211
|
+
"u-typography-base--xl": "_u-typography-base--xl_1rzg2_52",
|
|
212
|
+
"u-typography-base--lg": "_u-typography-base--lg_1rzg2_56",
|
|
213
|
+
"u-typography-base--sm": "_u-typography-base--sm_1rzg2_60",
|
|
214
|
+
"u-typography-base--bold": "_u-typography-base--bold_1rzg2_64",
|
|
215
|
+
"u-typography-base--strikethrough": "_u-typography-base--strikethrough_1rzg2_67",
|
|
216
|
+
"u-typography-base--underlined": "_u-typography-base--underlined_1rzg2_70",
|
|
217
|
+
"u-typography-base--strikethrough-underlined": "_u-typography-base--strikethrough-underlined_1rzg2_73",
|
|
218
|
+
toggle: Q,
|
|
219
|
+
"toggle__toggle-el-wrapper": "_toggle__toggle-el-wrapper_1rzg2_84",
|
|
220
|
+
input: X,
|
|
221
|
+
thumb: Y,
|
|
222
|
+
track: Z,
|
|
223
|
+
"toggle--focus-visible": "_toggle--focus-visible_1rzg2_123",
|
|
224
|
+
"toggle--checked": "_toggle--checked_1rzg2_127",
|
|
225
|
+
"toggle--disabled": "_toggle--disabled_1rzg2_140"
|
|
226
|
+
}, re = ({
|
|
213
227
|
label: l,
|
|
214
228
|
checked: s,
|
|
215
|
-
disabled:
|
|
216
|
-
classNameWrapper:
|
|
217
|
-
classNameInput:
|
|
218
|
-
"data-testid":
|
|
219
|
-
onChange:
|
|
229
|
+
disabled: i,
|
|
230
|
+
classNameWrapper: r,
|
|
231
|
+
classNameInput: c,
|
|
232
|
+
"data-testid": h,
|
|
233
|
+
onChange: n,
|
|
220
234
|
classNameLabel: u
|
|
221
235
|
}) => {
|
|
222
|
-
const
|
|
223
|
-
|
|
236
|
+
const a = (p) => {
|
|
237
|
+
n == null || n(p);
|
|
224
238
|
};
|
|
225
|
-
return /* @__PURE__ */
|
|
226
|
-
/* @__PURE__ */
|
|
227
|
-
|
|
239
|
+
return /* @__PURE__ */ j("div", { className: O(g.toggle, r), "data-testid": h, children: [
|
|
240
|
+
/* @__PURE__ */ P(
|
|
241
|
+
$,
|
|
228
242
|
{
|
|
229
243
|
checked: s === !0,
|
|
230
|
-
disabled:
|
|
231
|
-
onChange:
|
|
244
|
+
disabled: i,
|
|
245
|
+
onChange: a,
|
|
232
246
|
"aria-label": l,
|
|
233
247
|
slotProps: {
|
|
234
|
-
root: (
|
|
235
|
-
className:
|
|
236
|
-
[
|
|
237
|
-
[
|
|
238
|
-
[
|
|
248
|
+
root: (p) => ({
|
|
249
|
+
className: O(g["toggle__toggle-el-wrapper"], {
|
|
250
|
+
[g["toggle--disabled"]]: p.disabled,
|
|
251
|
+
[g["toggle--focus-visible"]]: p.focusVisible,
|
|
252
|
+
[g["toggle--checked"]]: p.checked
|
|
239
253
|
})
|
|
240
254
|
}),
|
|
241
|
-
input: { className:
|
|
242
|
-
thumb: { className:
|
|
243
|
-
track: { className:
|
|
255
|
+
input: { className: O(g.input, c) },
|
|
256
|
+
thumb: { className: g.thumb },
|
|
257
|
+
track: { className: g.track }
|
|
244
258
|
}
|
|
245
259
|
}
|
|
246
260
|
),
|
|
247
|
-
l && /* @__PURE__ */
|
|
261
|
+
l && /* @__PURE__ */ P("label", { className: O(g.toggle__label, u), children: l })
|
|
248
262
|
] });
|
|
249
263
|
};
|
|
250
264
|
export {
|
|
251
|
-
|
|
265
|
+
re as Toggle
|
|
252
266
|
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ToggleGroupItemProps } from './Toggle.tsx';
|
|
2
|
+
import { ReactElement, ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
export type ToggleGroupProps = {
|
|
5
|
+
/** Optional title and description content */
|
|
6
|
+
legend?: ReactNode;
|
|
7
|
+
/** Optional any errors to display */
|
|
8
|
+
error?: ReactNode;
|
|
9
|
+
/** ToggleGroupItems to display; options to toggle between */
|
|
10
|
+
children: Array<ReactElement<ToggleGroupItemProps<string | number>>>;
|
|
11
|
+
/**
|
|
12
|
+
* Dataset test id only used for tests to reach in and grab the rendered DOM nodes base value is used for fieldset
|
|
13
|
+
* error and legend append their names e.g. {data-testid}-error and {data-testid}-legend
|
|
14
|
+
* */
|
|
15
|
+
'data-testid'?: string;
|
|
16
|
+
};
|
|
17
|
+
declare const Group: import('react').ForwardRefExoticComponent<ToggleGroupProps & import('react').RefAttributes<HTMLFieldSetElement>>;
|
|
18
|
+
export default Group;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export type ToggleGroupItemProps<T extends string | number> = {
|
|
3
|
+
/** The display text to show for this option */
|
|
4
|
+
text: string;
|
|
5
|
+
/** The underlining value of this option */
|
|
6
|
+
value: T;
|
|
7
|
+
/** Whether this radio button is selected */
|
|
8
|
+
isSelected?: boolean;
|
|
9
|
+
/** callback for selection change */
|
|
10
|
+
onChange: (value: T | '') => void;
|
|
11
|
+
/** Dataset test id only used for tests to reach in and grab the rendered DOM node of the label */
|
|
12
|
+
'data-testid'?: string;
|
|
13
|
+
};
|
|
14
|
+
declare const Toggle: import('react').ForwardRefExoticComponent<ToggleGroupItemProps<string | number> & import('react').RefAttributes<HTMLInputElement>>;
|
|
15
|
+
export default Toggle;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import "../../clsx-DB4S2d7J.js";
|
|
4
|
+
import "../Icon/Icon.js";
|
|
5
|
+
import "../Button/Button.js";
|
|
6
|
+
import { T as b } from "../../Toggle-BCgIItCc.js";
|
|
7
|
+
import "../Dialog/Backdrop.js";
|
|
8
|
+
import "../Typography/Typography.js";
|
|
9
|
+
import "../IconButton/IconButton.js";
|
|
10
|
+
import "../Select/Select.js";
|
|
11
|
+
import "../Table/Table.js";
|
|
12
|
+
import "../Tabs/Tabs.js";
|
|
13
|
+
import "../../Group-B3p31ftp.js";
|
|
14
|
+
import "../../contexts/SnackbarProvider/SnackbarProvider.js";
|
|
15
|
+
export {
|
|
16
|
+
b as default
|
|
17
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ToggleGroupProps } from './Group.tsx';
|
|
2
|
+
import { StoryObj } from '@storybook/react';
|
|
3
|
+
import { FunctionComponent } from 'react';
|
|
4
|
+
|
|
5
|
+
declare const meta: {
|
|
6
|
+
title: string;
|
|
7
|
+
component: import('react').ForwardRefExoticComponent<ToggleGroupProps & import('react').RefAttributes<HTMLFieldSetElement>>;
|
|
8
|
+
tags: string[];
|
|
9
|
+
decorators: ((Story: import('@storybook/types').PartialStoryFn<import('@storybook/react').ReactRenderer, {
|
|
10
|
+
legend?: import('react').ReactNode;
|
|
11
|
+
error?: import('react').ReactNode;
|
|
12
|
+
children: import('react').ReactElement<import('./Toggle.tsx').ToggleGroupItemProps<string | number>, string | import('react').JSXElementConstructor<any>>[];
|
|
13
|
+
'data-testid'?: string | undefined;
|
|
14
|
+
ref?: import('react').LegacyRef<HTMLFieldSetElement> | undefined;
|
|
15
|
+
key?: import('react').Key | null | undefined;
|
|
16
|
+
}>) => import("react/jsx-runtime").JSX.Element)[];
|
|
17
|
+
subcomponents: {
|
|
18
|
+
ToggleGroupItem: FunctionComponent<unknown>;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export default meta;
|
|
22
|
+
type Story = StoryObj<typeof meta>;
|
|
23
|
+
export declare const Simple: Story;
|
|
24
|
+
export declare const NoLegend: Story;
|
|
25
|
+
export declare const WithError: Story;
|
|
@@ -1,17 +1,33 @@
|
|
|
1
1
|
import { PopupPlacement } from '@mui/base';
|
|
2
|
+
import { AriaRole, CSSProperties, ReactNode } from 'react';
|
|
2
3
|
|
|
3
|
-
type TooltipProps = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
export type TooltipProps = {
|
|
5
|
+
/** Tooltip reference element. */
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
/** Tooltip title. Zero-length titles string, undefined, null and false are never displayed. */
|
|
8
|
+
title: ReactNode;
|
|
9
|
+
/** Should the tooltip be initially open */
|
|
10
|
+
open?: boolean;
|
|
11
|
+
/** Disable the hover listener */
|
|
7
12
|
disableHoverListener?: boolean;
|
|
13
|
+
/** Function to run when the tooltip is closed */
|
|
8
14
|
onClose?: () => void;
|
|
15
|
+
/** The color of the tooltip */
|
|
9
16
|
theme?: 'white' | 'black';
|
|
17
|
+
/** Dhe padding applied to the tooltip */
|
|
10
18
|
padding?: 'small' | 'normal';
|
|
19
|
+
/** The Position where the tooltip will be display relative to the anchor element */
|
|
11
20
|
position?: PopupPlacement;
|
|
12
|
-
|
|
21
|
+
/** Accessibility role label */
|
|
22
|
+
arialRole?: AriaRole;
|
|
23
|
+
/** Additional classnames to be applied to the tooltip */
|
|
13
24
|
className?: string;
|
|
25
|
+
/** Additional styles to be applied to the tooltip */
|
|
26
|
+
style?: CSSProperties;
|
|
27
|
+
/** Test id */
|
|
14
28
|
'data-testid'?: string;
|
|
29
|
+
/** Function thats return the HTML Element of target. Important to EllipsisTooltip knows if the node needs or not the ellipsis */
|
|
30
|
+
onTargetCreated?: (e: HTMLElement) => void;
|
|
15
31
|
};
|
|
16
|
-
declare const Tooltip: ({ children,
|
|
32
|
+
declare const Tooltip: ({ arialRole, children: childrenProp, className, disableHoverListener, onClose, padding, position, open: openProp, theme, title, onTargetCreated, ...rest }: TooltipProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
33
|
export { Tooltip };
|