@pismo/marola 0.0.1-alpha.9 → 1.0.0-beta.0
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 +85 -41
- package/dist/components/Icon/Icon.stories.d.ts +15 -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 +4 -2
- package/dist/components/Typography/Typography.js +56 -73
- 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 +73 -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
|
@@ -2,38 +2,55 @@ import { TableTranslations } from './TableContext';
|
|
|
2
2
|
import { SortType } from '../SortTooltip/SortTooltip';
|
|
3
3
|
import { PaginationProps } from '../Pagination/Pagination';
|
|
4
4
|
|
|
5
|
-
type ChildrenProps = {
|
|
5
|
+
export type ChildrenProps = {
|
|
6
|
+
/** Children of the component */
|
|
6
7
|
children: React.ReactNode;
|
|
8
|
+
/** CSS classes to be applied on the component */
|
|
7
9
|
className?: string;
|
|
10
|
+
/** Id to be applied as data-testid on the component */
|
|
8
11
|
'data-testid'?: string;
|
|
9
12
|
};
|
|
13
|
+
type ActionProps = {
|
|
14
|
+
/** Disabled status */
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
/** Functionality to perform once clicked */
|
|
17
|
+
onClick?: () => void;
|
|
18
|
+
};
|
|
19
|
+
type AlignProps = {
|
|
20
|
+
/** Alignment */
|
|
21
|
+
align?: 'left' | 'right' | 'center';
|
|
22
|
+
};
|
|
10
23
|
type TableTheme = 'white' | 'transparent';
|
|
11
|
-
type TableProps = ChildrenProps & {
|
|
24
|
+
export type TableProps = ChildrenProps & {
|
|
25
|
+
/** Set if the table is full width */
|
|
12
26
|
fullWidth?: boolean;
|
|
27
|
+
/** Pagination Props */
|
|
13
28
|
paginationProps?: PaginationProps;
|
|
29
|
+
/** Set theme */
|
|
14
30
|
theme?: TableTheme;
|
|
31
|
+
/** Set language */
|
|
15
32
|
language?: string;
|
|
33
|
+
/** Set translations to labels */
|
|
16
34
|
translations?: TableTranslations;
|
|
17
35
|
};
|
|
18
36
|
declare const Table: {
|
|
19
37
|
({ children, theme, fullWidth, className, paginationProps, language, translations, ...rest }: TableProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
-
THead:
|
|
21
|
-
TBody:
|
|
22
|
-
Tr:
|
|
23
|
-
Td:
|
|
24
|
-
Th:
|
|
25
|
-
};
|
|
26
|
-
type Alignment = 'left' | 'right' | 'center';
|
|
27
|
-
type CellProps = {
|
|
28
|
-
align?: Alignment;
|
|
29
|
-
};
|
|
30
|
-
type RowOrCellProps = ChildrenProps & {
|
|
31
|
-
disabled?: boolean;
|
|
32
|
-
onClick?: () => void;
|
|
38
|
+
THead: import('react').FunctionComponent<ChildrenProps>;
|
|
39
|
+
TBody: import('react').FunctionComponent<ChildrenProps>;
|
|
40
|
+
Tr: import('react').FunctionComponent<TrProps>;
|
|
41
|
+
Td: import('react').FunctionComponent<TdProps>;
|
|
42
|
+
Th: import('react').FunctionComponent<ThProps>;
|
|
33
43
|
};
|
|
34
|
-
|
|
44
|
+
export declare const THead: ({ children, ...rest }: ChildrenProps) => import("react/jsx-runtime").JSX.Element;
|
|
45
|
+
export declare const TBody: ({ children, ...rest }: ChildrenProps) => import("react/jsx-runtime").JSX.Element;
|
|
46
|
+
export type TrProps = ChildrenProps & ActionProps;
|
|
47
|
+
export declare const Tr: ({ children, onClick, disabled, className, ...rest }: TrProps) => import("react/jsx-runtime").JSX.Element;
|
|
48
|
+
export type TdProps = ChildrenProps & ActionProps & AlignProps;
|
|
49
|
+
export declare const Td: ({ children, onClick, disabled, className, align, ...rest }: TdProps) => import("react/jsx-runtime").JSX.Element;
|
|
50
|
+
export type ThProps = ChildrenProps & AlignProps & {
|
|
35
51
|
onSort?: (order: SortType) => void;
|
|
36
52
|
sortType?: SortType;
|
|
37
53
|
classNameTooltip?: string;
|
|
38
54
|
};
|
|
55
|
+
export declare const Th: ({ children, onSort, sortType, className, classNameTooltip, align, ...rest }: ThProps) => import("react/jsx-runtime").JSX.Element;
|
|
39
56
|
export { Table, type TableTranslations };
|
|
@@ -1,38 +1,53 @@
|
|
|
1
1
|
import '../../assets/Table.css';
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import * as
|
|
4
|
-
import { useState as
|
|
5
|
-
import { c as
|
|
6
|
-
import { paginationDefaultTranslations as
|
|
7
|
-
import { sortTooltipDefaultTranslations as
|
|
8
|
-
import { TableProvider as N, useTable as
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
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"
|
|
28
43
|
}, B = {
|
|
29
44
|
pt: {
|
|
30
|
-
...
|
|
31
|
-
...
|
|
45
|
+
...y.pt,
|
|
46
|
+
...u.pt
|
|
32
47
|
},
|
|
33
48
|
en: {
|
|
34
|
-
...
|
|
35
|
-
...
|
|
49
|
+
...y.en,
|
|
50
|
+
...u.en
|
|
36
51
|
},
|
|
37
52
|
// example to add a new language translation
|
|
38
53
|
es: {
|
|
@@ -44,79 +59,79 @@ const L = (l) => /* @__PURE__ */ c.createElement("svg", { width: 7, height: 10,
|
|
|
44
59
|
of: "de",
|
|
45
60
|
results: "resultados"
|
|
46
61
|
}
|
|
47
|
-
},
|
|
48
|
-
children:
|
|
62
|
+
}, l = ({
|
|
63
|
+
children: p,
|
|
49
64
|
theme: e = "white",
|
|
50
|
-
fullWidth:
|
|
51
|
-
className:
|
|
52
|
-
paginationProps:
|
|
53
|
-
language:
|
|
54
|
-
translations:
|
|
55
|
-
...
|
|
65
|
+
fullWidth: r = !0,
|
|
66
|
+
className: o,
|
|
67
|
+
paginationProps: s,
|
|
68
|
+
language: _,
|
|
69
|
+
translations: n,
|
|
70
|
+
...d
|
|
56
71
|
}) => {
|
|
57
|
-
const
|
|
72
|
+
const c = g(
|
|
58
73
|
t.table,
|
|
59
|
-
|
|
74
|
+
r ? t["table--full-width"] : "",
|
|
60
75
|
t[`table--${e}-theme`],
|
|
61
|
-
|
|
62
|
-
), i =
|
|
63
|
-
return /* @__PURE__ */
|
|
64
|
-
/* @__PURE__ */
|
|
65
|
-
|
|
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 })
|
|
66
81
|
] });
|
|
67
|
-
},
|
|
68
|
-
const
|
|
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(
|
|
69
84
|
t.tr,
|
|
70
|
-
e && !
|
|
71
|
-
|
|
85
|
+
e && !r ? t["tr__row-or-cell--clickable"] : r ? t["tr__row-or-cell--disabled"] : "",
|
|
86
|
+
o
|
|
72
87
|
);
|
|
73
|
-
return /* @__PURE__ */
|
|
74
|
-
},
|
|
75
|
-
const
|
|
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(
|
|
76
91
|
t.td,
|
|
77
|
-
e && !
|
|
78
|
-
t[`cell--${
|
|
79
|
-
|
|
92
|
+
e && !r ? t["td__row-or-cell--clickable"] : r ? t["td__row-or-cell--disabled"] : "",
|
|
93
|
+
t[`cell--${s}-alignment`],
|
|
94
|
+
o
|
|
80
95
|
);
|
|
81
|
-
return /* @__PURE__ */
|
|
82
|
-
},
|
|
83
|
-
|
|
84
|
-
onSort: e,
|
|
85
|
-
sortType: a,
|
|
86
|
-
className: n,
|
|
87
|
-
classNameTooltip: _,
|
|
88
|
-
align: s = "left",
|
|
89
|
-
...o
|
|
90
|
-
}) => {
|
|
91
|
-
const { translations: m } = C(), [p, i] = u(!1), f = h(
|
|
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(
|
|
92
99
|
t.th__wrapper,
|
|
93
|
-
|
|
100
|
+
c ? t["th__wrapper--pressed"] : "",
|
|
94
101
|
e ? t["th__wrapper--clickable"] : "",
|
|
95
|
-
|
|
102
|
+
o
|
|
96
103
|
);
|
|
97
|
-
return /* @__PURE__ */
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
] })
|
|
113
|
-
] }) });
|
|
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 }) }) });
|
|
114
119
|
};
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
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";
|
|
120
130
|
export {
|
|
121
|
-
|
|
131
|
+
P as TBody,
|
|
132
|
+
H as THead,
|
|
133
|
+
l as Table,
|
|
134
|
+
M as Td,
|
|
135
|
+
O as Th,
|
|
136
|
+
D as Tr
|
|
122
137
|
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: {
|
|
6
|
+
({ children, theme, fullWidth, className, paginationProps, language, translations, ...rest }: import('./Table').TableProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
THead: import('react').FunctionComponent<import('./Table').ChildrenProps>;
|
|
8
|
+
TBody: import('react').FunctionComponent<import('./Table').ChildrenProps>;
|
|
9
|
+
Tr: import('react').FunctionComponent<import('./Table').TrProps>;
|
|
10
|
+
Td: import('react').FunctionComponent<import('./Table').TdProps>;
|
|
11
|
+
Th: import('react').FunctionComponent<import('./Table').ThProps>;
|
|
12
|
+
};
|
|
13
|
+
tags: string[];
|
|
14
|
+
parameters: {
|
|
15
|
+
layout: string;
|
|
16
|
+
};
|
|
17
|
+
subcomponents: {
|
|
18
|
+
'Table.THead': import('react').FunctionComponent<unknown>;
|
|
19
|
+
'Table.TBody': import('react').FunctionComponent<unknown>;
|
|
20
|
+
'Table.Tr': import('react').FunctionComponent<unknown>;
|
|
21
|
+
'Table.Th': import('react').FunctionComponent<unknown>;
|
|
22
|
+
'Table.Td': import('react').FunctionComponent<unknown>;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
export default meta;
|
|
26
|
+
type Story = StoryObj<typeof meta>;
|
|
27
|
+
export declare const Default: Story;
|
|
28
|
+
export declare const WithPagination: Story;
|
|
29
|
+
export declare const WithLanguage: Story;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ChildrenProps } from './Table';
|
|
2
|
+
import { StoryObj } from '@storybook/react';
|
|
3
|
+
|
|
4
|
+
declare const meta: {
|
|
5
|
+
title: string;
|
|
6
|
+
component: ({ children, ...rest }: ChildrenProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
tags: string[];
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export default meta;
|
|
13
|
+
type Story = StoryObj<typeof meta>;
|
|
14
|
+
export declare const Default: Story;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ChildrenProps } from './Table';
|
|
2
|
+
import { StoryObj } from '@storybook/react';
|
|
3
|
+
|
|
4
|
+
declare const meta: {
|
|
5
|
+
title: string;
|
|
6
|
+
component: ({ children, ...rest }: ChildrenProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
tags: string[];
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export default meta;
|
|
13
|
+
type Story = StoryObj<typeof meta>;
|
|
14
|
+
export declare const Default: Story;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { TdProps } from './Table';
|
|
2
|
+
import { StoryObj } from '@storybook/react';
|
|
3
|
+
|
|
4
|
+
declare const meta: {
|
|
5
|
+
title: string;
|
|
6
|
+
component: ({ children, onClick, disabled, className, align, ...rest }: TdProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
tags: string[];
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export default meta;
|
|
13
|
+
type Story = StoryObj<typeof meta>;
|
|
14
|
+
export declare const Default: Story;
|
|
15
|
+
export declare const WithAlign: Story;
|
|
16
|
+
export declare const Disabled: Story;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ThProps } from './Table';
|
|
2
|
+
import { StoryObj } from '@storybook/react';
|
|
3
|
+
|
|
4
|
+
declare const meta: {
|
|
5
|
+
title: string;
|
|
6
|
+
component: ({ children, onSort, sortType, className, classNameTooltip, align, ...rest }: ThProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
tags: string[];
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export default meta;
|
|
13
|
+
type Story = StoryObj<typeof meta>;
|
|
14
|
+
export declare const Default: Story;
|
|
15
|
+
export declare const WithAlign: Story;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { TrProps } from './Table';
|
|
2
|
+
import { StoryObj } from '@storybook/react';
|
|
3
|
+
|
|
4
|
+
declare const meta: {
|
|
5
|
+
title: string;
|
|
6
|
+
component: ({ children, onClick, disabled, className, ...rest }: TrProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
tags: string[];
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export default meta;
|
|
13
|
+
type Story = StoryObj<typeof meta>;
|
|
14
|
+
export declare const Default: Story;
|
|
15
|
+
export declare const Disabled: Story;
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
|
|
3
3
|
export interface TabProps {
|
|
4
|
+
/** The value to be showing in the tab */
|
|
4
5
|
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! */
|
|
5
8
|
value: string | number;
|
|
9
|
+
/** Disable clicking the tab */
|
|
6
10
|
disabled?: boolean;
|
|
11
|
+
/** data test id */
|
|
7
12
|
dataTestId?: string;
|
|
8
13
|
}
|
|
9
14
|
export declare const Tab: import('react').ForwardRefExoticComponent<TabProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
@@ -1,8 +1,181 @@
|
|
|
1
|
-
import "react/jsx-runtime";
|
|
2
|
-
import "react";
|
|
3
|
-
import "
|
|
4
|
-
import "../../
|
|
5
|
-
import { T as
|
|
1
|
+
import { jsx as N } from "react/jsx-runtime";
|
|
2
|
+
import * as b from "react";
|
|
3
|
+
import { forwardRef as H, useContext as U, useMemo as j } from "react";
|
|
4
|
+
import { c as k } from "../../clsx-DB4S2d7J.js";
|
|
5
|
+
import { u as B, T as D, s as y } from "../../Tabs.module-jkH1Qjn7.js";
|
|
6
|
+
import { g as L, a as W, u as O, f as $, b as d, _ as q, c as z, P as e, d as A, e as G } from "../../index-CH45lKw7.js";
|
|
7
|
+
import { u as J, c as K } from "../../combineHooksSlotProps-DVjg9PRh.js";
|
|
8
|
+
import { u as Q, a as X } from "../../useCompoundItem-D1iRfg8D.js";
|
|
9
|
+
import { u as Y } from "../../useButton-DNk3wrQp.js";
|
|
10
|
+
const E = "Tab";
|
|
11
|
+
function Z(o) {
|
|
12
|
+
return L(E, o);
|
|
13
|
+
}
|
|
14
|
+
W(E, ["root", "selected", "disabled"]);
|
|
15
|
+
function ee(o) {
|
|
16
|
+
return o.size;
|
|
17
|
+
}
|
|
18
|
+
function te(o) {
|
|
19
|
+
const {
|
|
20
|
+
value: t,
|
|
21
|
+
rootRef: s,
|
|
22
|
+
disabled: n = !1,
|
|
23
|
+
id: c
|
|
24
|
+
} = o, a = b.useRef(null), r = Q(c), {
|
|
25
|
+
value: f,
|
|
26
|
+
selectionFollowsFocus: p,
|
|
27
|
+
getTabPanelId: m
|
|
28
|
+
} = B(), P = b.useMemo(() => ({
|
|
29
|
+
disabled: n,
|
|
30
|
+
ref: a,
|
|
31
|
+
id: r
|
|
32
|
+
}), [n, a, r]), {
|
|
33
|
+
id: l,
|
|
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
|
|
42
|
+
}), {
|
|
43
|
+
getRootProps: C,
|
|
44
|
+
rootRef: u,
|
|
45
|
+
active: v,
|
|
46
|
+
focusVisible: I,
|
|
47
|
+
setFocusVisible: V
|
|
48
|
+
} = Y({
|
|
49
|
+
disabled: n,
|
|
50
|
+
focusableWhenDisabled: !p,
|
|
51
|
+
type: "button"
|
|
52
|
+
}), _ = O(a, s, u), M = l !== void 0 ? m(l) : void 0;
|
|
53
|
+
return {
|
|
54
|
+
getRootProps: (x = {}) => {
|
|
55
|
+
const S = $(x), w = K(h, C);
|
|
56
|
+
return d({}, x, w(S), {
|
|
57
|
+
role: "tab",
|
|
58
|
+
"aria-controls": M,
|
|
59
|
+
"aria-selected": i,
|
|
60
|
+
id: r,
|
|
61
|
+
ref: _
|
|
62
|
+
});
|
|
63
|
+
},
|
|
64
|
+
active: v,
|
|
65
|
+
focusVisible: I,
|
|
66
|
+
highlighted: T,
|
|
67
|
+
index: R,
|
|
68
|
+
rootRef: _,
|
|
69
|
+
// the `selected` state isn't set on the server (it relies on effects to be calculated),
|
|
70
|
+
// so we fall back to checking the `value` prop with the selectedValue from the TabsContext
|
|
71
|
+
selected: i || l === f,
|
|
72
|
+
setFocusVisible: V,
|
|
73
|
+
totalTabsCount: g
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
const oe = ["action", "children", "disabled", "onChange", "onClick", "onFocus", "slotProps", "slots", "value"], se = (o) => {
|
|
77
|
+
const {
|
|
78
|
+
selected: t,
|
|
79
|
+
disabled: s
|
|
80
|
+
} = o;
|
|
81
|
+
return A({
|
|
82
|
+
root: ["root", t && "selected", s && "disabled"]
|
|
83
|
+
}, G(Z));
|
|
84
|
+
}, F = /* @__PURE__ */ b.forwardRef(function(t, s) {
|
|
85
|
+
var n;
|
|
86
|
+
const {
|
|
87
|
+
children: c,
|
|
88
|
+
disabled: a = !1,
|
|
89
|
+
slotProps: r = {},
|
|
90
|
+
slots: f = {},
|
|
91
|
+
value: p
|
|
92
|
+
} = t, m = q(t, oe), P = b.useRef(), l = O(P, s), {
|
|
93
|
+
active: R,
|
|
94
|
+
highlighted: g,
|
|
95
|
+
selected: h,
|
|
96
|
+
getRootProps: T
|
|
97
|
+
} = te(d({}, t, {
|
|
98
|
+
rootRef: l,
|
|
99
|
+
value: p
|
|
100
|
+
})), i = d({}, t, {
|
|
101
|
+
active: R,
|
|
102
|
+
disabled: a,
|
|
103
|
+
highlighted: g,
|
|
104
|
+
selected: h
|
|
105
|
+
}), C = se(i), u = (n = f.root) != null ? n : "button", v = z({
|
|
106
|
+
elementType: u,
|
|
107
|
+
getSlotProps: T,
|
|
108
|
+
externalSlotProps: r.root,
|
|
109
|
+
externalForwardedProps: m,
|
|
110
|
+
additionalProps: {
|
|
111
|
+
ref: s
|
|
112
|
+
},
|
|
113
|
+
ownerState: i,
|
|
114
|
+
className: C.root
|
|
115
|
+
});
|
|
116
|
+
return /* @__PURE__ */ N(u, d({}, v, {
|
|
117
|
+
children: c
|
|
118
|
+
}));
|
|
119
|
+
});
|
|
120
|
+
process.env.NODE_ENV !== "production" && (F.propTypes = {
|
|
121
|
+
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
122
|
+
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
123
|
+
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
|
|
124
|
+
// └─────────────────────────────────────────────────────────────────────┘
|
|
125
|
+
/**
|
|
126
|
+
* A ref for imperative actions. It currently only supports `focusVisible()` action.
|
|
127
|
+
*/
|
|
128
|
+
action: e.oneOfType([e.func, e.shape({
|
|
129
|
+
current: e.shape({
|
|
130
|
+
focusVisible: e.func.isRequired
|
|
131
|
+
})
|
|
132
|
+
})]),
|
|
133
|
+
/**
|
|
134
|
+
* @ignore
|
|
135
|
+
*/
|
|
136
|
+
children: e.node,
|
|
137
|
+
/**
|
|
138
|
+
* If `true`, the component is disabled.
|
|
139
|
+
* @default false
|
|
140
|
+
*/
|
|
141
|
+
disabled: e.bool,
|
|
142
|
+
/**
|
|
143
|
+
* Callback invoked when new value is being set.
|
|
144
|
+
*/
|
|
145
|
+
onChange: e.func,
|
|
146
|
+
/**
|
|
147
|
+
* The props used for each slot inside the Tab.
|
|
148
|
+
* @default {}
|
|
149
|
+
*/
|
|
150
|
+
slotProps: e.shape({
|
|
151
|
+
root: e.oneOfType([e.func, e.object])
|
|
152
|
+
}),
|
|
153
|
+
/**
|
|
154
|
+
* The components used for each slot inside the Tab.
|
|
155
|
+
* Either a string to use a HTML element or a component.
|
|
156
|
+
* @default {}
|
|
157
|
+
*/
|
|
158
|
+
slots: e.shape({
|
|
159
|
+
root: e.elementType
|
|
160
|
+
}),
|
|
161
|
+
/**
|
|
162
|
+
* You can provide your own value. Otherwise, it falls back to the child position index.
|
|
163
|
+
*/
|
|
164
|
+
value: e.oneOfType([e.number, e.string])
|
|
165
|
+
});
|
|
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
|
+
);
|
|
6
179
|
export {
|
|
7
|
-
|
|
180
|
+
fe as Tab
|
|
8
181
|
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { TabProps } from './Tabs.tsx';
|
|
2
|
+
import { StoryObj } from '@storybook/react';
|
|
3
|
+
|
|
4
|
+
declare const meta: {
|
|
5
|
+
title: string;
|
|
6
|
+
component: import('react').ForwardRefExoticComponent<TabProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
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;
|
|
15
|
+
export declare const Disabled: Story;
|
|
@@ -1,8 +1,12 @@
|
|
|
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 */
|
|
4
5
|
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 */
|
|
5
8
|
value: string | number;
|
|
9
|
+
/** Test id */
|
|
6
10
|
dataTestId?: string;
|
|
7
11
|
}
|
|
8
12
|
export declare const TabPanel: import('react').ForwardRefExoticComponent<TabPanelProps & import('react').RefAttributes<HTMLDivElement>>;
|