@pismo/marola 0.0.1-alpha.32 → 0.0.1-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -13
- package/dist/{Button-2b1peDFT.js → Button-D--uN90N.js} +26 -25
- package/dist/Dialog.module-BKWFakxu.js +15 -0
- package/dist/ListContext-Dj2Va7Iv.js +18 -0
- package/dist/Tabs.module-BKlNuSPH.js +66 -0
- package/dist/assets/Button.css +1 -1
- package/dist/assets/Dialog.css +1 -1
- package/dist/assets/IconButton.css +1 -1
- package/dist/assets/PageHeader.css +1 -1
- package/dist/assets/Pagination.css +1 -1
- package/dist/assets/Tabs.css +1 -1
- package/dist/assets/Typography.css +1 -1
- package/dist/assets/main.css +1 -0
- package/dist/components/Button/Button.d.ts +2 -13
- package/dist/components/Button/Button.js +49 -60
- package/dist/components/Dialog/Actions.js +1 -1
- package/dist/components/Dialog/Backdrop.d.ts +1 -1
- package/dist/components/Dialog/Backdrop.js +1 -1
- package/dist/components/Dialog/CloseIconButton.js +124 -12
- package/dist/components/Dialog/Dialog.d.ts +3 -4
- package/dist/components/Dialog/Dialog.js +20098 -444
- package/dist/components/Dialog/{DialogTitle.d.ts → Title.d.ts} +3 -3
- package/dist/components/Dialog/Title.js +29 -0
- package/dist/components/IconButton/IconButton.d.ts +5 -21
- package/dist/components/IconButton/IconButton.js +76 -60
- package/dist/components/LoadingSpinner/LoadingSpinner.d.ts +0 -2
- package/dist/components/PageHeader/PageHeader.d.ts +16 -56
- package/dist/components/PageHeader/PageHeader.js +65 -83
- package/dist/components/Pagination/Pagination.d.ts +6 -25
- package/dist/components/Pagination/Pagination.js +113 -131
- package/dist/components/SortTooltip/SortTooltip.d.ts +0 -28
- package/dist/components/SortTooltip/SortTooltip.js +1 -93
- package/dist/components/Table/Table.d.ts +0 -56
- package/dist/components/Table/Table.js +1 -137
- package/dist/components/Table/TableContext.d.ts +0 -19
- package/dist/components/Table/TableContext.js +1 -21
- package/dist/components/Tabs/Tab.d.ts +1 -6
- package/dist/components/Tabs/Tab.js +173 -113
- package/dist/components/Tabs/TabPanel.d.ts +1 -5
- package/dist/components/Tabs/TabPanel.js +16 -15
- package/dist/components/Tabs/Tabs.d.ts +2 -8
- package/dist/components/Tabs/Tabs.js +664 -242
- package/dist/components/Tooltip/Tooltip.d.ts +0 -33
- package/dist/components/Tooltip/Tooltip.js +1 -141
- package/dist/components/Typography/Typography.d.ts +6 -17
- package/dist/components/Typography/Typography.js +58 -58
- package/dist/{index-CH45lKw7.js → index-BvA1HyDs.js} +300 -322
- package/dist/main.d.ts +8 -27
- package/dist/main.js +28 -75
- package/dist/objectWithoutPropertiesLoose-ClNcje2_.js +22 -0
- package/dist/types/helpers.d.ts +0 -8
- package/dist/useButton-abQpo0za.js +187 -0
- package/dist/useCompoundItem-wTwXbURC.js +41 -0
- package/package.json +9 -30
- package/dist/ClickAwayListener-BSW-Nd-y.js +0 -107
- package/dist/Dialog.module-DFEmFdYT.js +0 -30
- package/dist/Group-B3p31ftp.js +0 -26
- package/dist/Popup-B6ZSGIEI.js +0 -1248
- package/dist/Portal-DIeBsWdL.js +0 -73
- package/dist/SelectButton-C8JQKaf4.js +0 -61
- package/dist/Tabs.module-jkH1Qjn7.js +0 -22
- package/dist/Toggle-BCgIItCc.js +0 -142
- package/dist/assets/Advice.css +0 -1
- package/dist/assets/Checkbox.css +0 -1
- package/dist/assets/EllipsisTooltip.css +0 -1
- package/dist/assets/Group.css +0 -1
- package/dist/assets/Input.css +0 -1
- package/dist/assets/InputSearch.css +0 -1
- package/dist/assets/SelectButton.css +0 -1
- package/dist/assets/Skeleton.css +0 -1
- package/dist/assets/Snackbar.css +0 -1
- package/dist/assets/SortTooltip.css +0 -1
- package/dist/assets/Stepper.css +0 -1
- package/dist/assets/Table.css +0 -1
- package/dist/assets/TextDisplay.css +0 -1
- package/dist/assets/Toggle.css +0 -1
- package/dist/assets/Toggle2.css +0 -1
- package/dist/assets/Tooltip.css +0 -1
- package/dist/combineHooksSlotProps-DVjg9PRh.js +0 -80
- package/dist/components/Advice/Advice.d.ts +0 -30
- package/dist/components/Advice/Advice.js +0 -47
- package/dist/components/Advice/Advice.stories.d.ts +0 -18
- package/dist/components/Button/Button.stories.d.ts +0 -62
- package/dist/components/Checkbox/Checkbox.d.ts +0 -34
- package/dist/components/Checkbox/Checkbox.js +0 -71
- package/dist/components/Checkbox/Checkbox.stories.d.ts +0 -31
- package/dist/components/Chip/Chip.d.ts +0 -39
- package/dist/components/Chip/Chip.js +0 -19
- package/dist/components/Chip/Chip.stories.d.ts +0 -42
- package/dist/components/Chip/chip.test.d.ts +0 -1
- package/dist/components/Dialog/Dialog.stories.d.ts +0 -343
- package/dist/components/Dialog/DialogTitle.js +0 -29
- package/dist/components/EllipsisTooltip/EllipsisTooltip.d.ts +0 -7
- package/dist/components/EllipsisTooltip/EllipsisTooltip.js +0 -23
- package/dist/components/EllipsisTooltip/EllipsisTooltip.stories.d.ts +0 -31
- package/dist/components/Icon/Icon.d.ts +0 -11
- package/dist/components/Icon/Icon.js +0 -127
- package/dist/components/Icon/Icon.stories.d.ts +0 -15
- package/dist/components/Icon/types.d.ts +0 -5
- package/dist/components/Icon/types.js +0 -1
- package/dist/components/IconButton/Icon.stories.d.ts +0 -15
- package/dist/components/Input/Input.d.ts +0 -44
- package/dist/components/Input/Input.js +0 -508
- package/dist/components/Input/Input.stories.d.ts +0 -43
- package/dist/components/InputSearch/InputSearch.d.ts +0 -9
- package/dist/components/InputSearch/InputSearch.js +0 -34
- package/dist/components/InputSearch/InputSearch.stories.d.ts +0 -39
- package/dist/components/LoadingSpinner/LoadingSpinner.stories.d.ts +0 -14
- package/dist/components/PageHeader/PageHeader.stories.d.ts +0 -14
- package/dist/components/Pagination/Pagination.stories.d.ts +0 -17
- package/dist/components/Select/Select.d.ts +0 -26
- package/dist/components/Select/Select.js +0 -857
- package/dist/components/Select/Select.stories.d.ts +0 -22
- package/dist/components/Select/SelectButton.d.ts +0 -12
- package/dist/components/Select/SelectButton.js +0 -8
- package/dist/components/Skeleton/Skeleton.d.ts +0 -25
- package/dist/components/Skeleton/Skeleton.js +0 -23
- package/dist/components/Skeleton/Skeleton.stories.d.ts +0 -14
- package/dist/components/Skeleton/SkeletonCircle.stories.d.ts +0 -14
- package/dist/components/Skeleton/SkeletonTable.stories.d.ts +0 -16
- package/dist/components/Snackbar/Snackbar.d.ts +0 -27
- package/dist/components/Snackbar/Snackbar.js +0 -639
- package/dist/components/Snackbar/Snackbar.stories.d.ts +0 -319
- package/dist/components/Stepper/Stepper.d.ts +0 -26
- package/dist/components/Stepper/Stepper.js +0 -48
- package/dist/components/Stepper/Stepper.stories.d.ts +0 -16
- package/dist/components/Table/Table.stories.d.ts +0 -29
- package/dist/components/Table/_Table.TBody.stories.d.ts +0 -14
- package/dist/components/Table/_Table.THead.stories.d.ts +0 -14
- package/dist/components/Table/_Table.Td.stories.d.ts +0 -16
- package/dist/components/Table/_Table.Th.stories.d.ts +0 -15
- package/dist/components/Table/_Table.Tr.stories.d.ts +0 -15
- package/dist/components/Tabs/Tab.stories.d.ts +0 -15
- package/dist/components/Tabs/TabPanel.stories.d.ts +0 -14
- package/dist/components/Tabs/Tabs.stories.d.ts +0 -14
- package/dist/components/TextDisplay/TextDisplay.d.ts +0 -23
- package/dist/components/TextDisplay/TextDisplay.js +0 -37
- package/dist/components/TextDisplay/TextDisplay.stories.d.ts +0 -13
- package/dist/components/TextDisplay/textDisplay.test.d.ts +0 -1
- package/dist/components/Toggle/Toggle.d.ts +0 -11
- package/dist/components/Toggle/Toggle.js +0 -266
- package/dist/components/Toggle/Toggle.stories.d.ts +0 -21
- package/dist/components/ToggleGroup/Group.d.ts +0 -18
- package/dist/components/ToggleGroup/Group.js +0 -7
- package/dist/components/ToggleGroup/Group.test.d.ts +0 -1
- package/dist/components/ToggleGroup/Toggle.d.ts +0 -15
- package/dist/components/ToggleGroup/Toggle.js +0 -17
- package/dist/components/ToggleGroup/Toggle.test.d.ts +0 -1
- package/dist/components/ToggleGroup/ToggleGroup.d.ts +0 -2
- package/dist/components/ToggleGroup/ToggleGroup.js +0 -6
- package/dist/components/ToggleGroup/ToggleGroup.stories.d.ts +0 -25
- package/dist/components/Tooltip/Tooltip.stories.d.ts +0 -35
- package/dist/components/Typography/Typography.stories.d.ts +0 -32
- package/dist/components/Typography/typography.test.d.ts +0 -1
- package/dist/contexts/SnackbarProvider/SnackbarProvider.d.ts +0 -11
- package/dist/contexts/SnackbarProvider/SnackbarProvider.js +0 -50
- package/dist/contexts/SnackbarProvider/SnackbarProvider.stories.d.ts +0 -21
- package/dist/index-CjW42-M-.js +0 -19584
- package/dist/marola.css +0 -1
- package/dist/test-utils/assertStyles.d.ts +0 -1
- package/dist/test-utils/assertStyles.js +0 -11
- package/dist/useButton-DNk3wrQp.js +0 -105
- package/dist/useCompoundItem-D1iRfg8D.js +0 -84
- package/dist/useEventCallback-xTG9piMa.js +0 -45
- package/dist/useIsFocusVisible-BH4IAdcw.js +0 -69
- package/dist/useList-B0hog_3-.js +0 -436
- package/dist/useTimeout-DxF9kiZL.js +0 -36
- package/dist/utils/styleStrings.d.ts +0 -6
- package/dist/utils/styleStrings.js +0 -10
- package/dist/utils/styleStrings.test.d.ts +0 -1
|
@@ -1,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,29 @@
|
|
|
1
|
+
import { jsxs as l, Fragment as s, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { Typography as a } from "../Typography/Typography.js";
|
|
3
|
+
import { s as r } from "../../Dialog.module-BKWFakxu.js";
|
|
4
|
+
const n = ({ title: i, subTitle: t }) => /* @__PURE__ */ l(s, { children: [
|
|
5
|
+
/* @__PURE__ */ e(
|
|
6
|
+
a,
|
|
7
|
+
{
|
|
8
|
+
element: "h1",
|
|
9
|
+
elementProps: { id: "alert-dialog-title" },
|
|
10
|
+
variant: "h4",
|
|
11
|
+
className: r.dialog__title,
|
|
12
|
+
children: i
|
|
13
|
+
}
|
|
14
|
+
),
|
|
15
|
+
/* @__PURE__ */ e("hr", { className: r.dialog__divider, "aria-hidden": !0 }),
|
|
16
|
+
t && /* @__PURE__ */ e(
|
|
17
|
+
a,
|
|
18
|
+
{
|
|
19
|
+
element: "h2",
|
|
20
|
+
elementProps: { id: "alert-dialog-description" },
|
|
21
|
+
variant: "h4",
|
|
22
|
+
className: r.dialog__subtitle,
|
|
23
|
+
children: t
|
|
24
|
+
}
|
|
25
|
+
)
|
|
26
|
+
] });
|
|
27
|
+
export {
|
|
28
|
+
n as default
|
|
29
|
+
};
|
|
@@ -1,38 +1,22 @@
|
|
|
1
1
|
import { Either } from '../../types/helpers';
|
|
2
|
-
import { ReactNode
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
3
|
|
|
4
|
-
type variant =
|
|
4
|
+
type variant = "primary" | "square";
|
|
5
5
|
type IconButtonCoreProps = {
|
|
6
|
-
/** The icon can be any ReactNode element, including the Icon component. */
|
|
7
6
|
icon: ReactNode;
|
|
8
|
-
/** Loading status */
|
|
9
7
|
loading?: boolean;
|
|
10
|
-
/** Disabled status */
|
|
11
8
|
disabled?: boolean;
|
|
12
|
-
/** ClassNames for MuiButton */
|
|
13
9
|
className?: string;
|
|
14
|
-
/** Children content */
|
|
15
10
|
children?: ReactNode;
|
|
16
|
-
/** Variant of component */
|
|
17
11
|
variant?: variant;
|
|
18
|
-
/** Id to be applied as `data-testid` on the container element */
|
|
19
|
-
'data-testid'?: string;
|
|
20
12
|
};
|
|
21
13
|
interface IconButtonPropsWithLink extends IconButtonCoreProps {
|
|
22
|
-
/** Link to access when Icon Button is clicked */
|
|
23
14
|
link: string;
|
|
24
15
|
}
|
|
25
16
|
interface IconButtonPropsWithOnClick extends IconButtonCoreProps {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
/** Button type */
|
|
29
|
-
type?: HTMLButtonElement['type'];
|
|
17
|
+
onClick: () => void;
|
|
18
|
+
type?: HTMLButtonElement["type"];
|
|
30
19
|
}
|
|
31
20
|
export type IconButtonProps = Either<IconButtonPropsWithLink, IconButtonPropsWithOnClick>;
|
|
32
|
-
|
|
33
|
-
* The icon button is used in some cases where you need the icon to be pressed, sometimes it can contain text.
|
|
34
|
-
* Icon buttons are commonly found in app bars and toolbars.
|
|
35
|
-
* Icons are also appropriate for toggle buttons that allow a single choice to be selected or deselected, such as adding or removing a star to an item.
|
|
36
|
-
*/
|
|
37
|
-
export declare const IconButton: import('react').ForwardRefExoticComponent<IconButtonProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
21
|
+
export declare const IconButton: import('react').ForwardRefExoticComponent<IconButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
38
22
|
export default IconButton;
|
|
@@ -1,63 +1,79 @@
|
|
|
1
1
|
import '../../assets/IconButton.css';
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { B as
|
|
7
|
-
const o = {
|
|
8
|
-
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
"
|
|
14
|
-
|
|
15
|
-
"
|
|
16
|
-
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
|
|
26
|
-
"
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
t
|
|
56
|
-
]
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
2
|
+
import { jsx as n, jsxs as q } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef as h, useMemo as k } from "react";
|
|
4
|
+
import { LoadingSpinner as m } from "../LoadingSpinner/LoadingSpinner.js";
|
|
5
|
+
import { c as v } from "../../clsx-DB4S2d7J.js";
|
|
6
|
+
import { B as y } from "../../Button-D--uN90N.js";
|
|
7
|
+
const f = "_h1_1v5kq_1", p = "_h2_1v5kq_11", g = "_h3_1v5kq_21", w = "_h4_1v5kq_31", x = "_body_1v5kq_41", N = "_quote_1v5kq_75", B = "_form__input_1v5kq_86", j = "_form__hint_1v5kq_91", C = "_form__label_1v5kq_96", I = "_form__dropdown_1v5kq_101", L = "_table__header_1v5kq_107", M = "_table__body_1v5kq_112", R = "_button_1v5kq_123", o = {
|
|
8
|
+
h1: f,
|
|
9
|
+
"h1--bold": "_h1--bold_1v5kq_7",
|
|
10
|
+
h2: p,
|
|
11
|
+
"h2--bold": "_h2--bold_1v5kq_17",
|
|
12
|
+
h3: g,
|
|
13
|
+
"h3--bold": "_h3--bold_1v5kq_27",
|
|
14
|
+
h4: w,
|
|
15
|
+
"h4--bold": "_h4--bold_1v5kq_37",
|
|
16
|
+
body: x,
|
|
17
|
+
"body--large": "_body--large_1v5kq_46",
|
|
18
|
+
"body--medium": "_body--medium_1v5kq_50",
|
|
19
|
+
"body--small": "_body--small_1v5kq_54",
|
|
20
|
+
"body--tiny": "_body--tiny_1v5kq_58",
|
|
21
|
+
"body--bold": "_body--bold_1v5kq_62",
|
|
22
|
+
"body--strikethrough": "_body--strikethrough_1v5kq_65",
|
|
23
|
+
"body--underlined": "_body--underlined_1v5kq_68",
|
|
24
|
+
"body--strikethrough-underlined": "_body--strikethrough-underlined_1v5kq_71",
|
|
25
|
+
quote: N,
|
|
26
|
+
"quote--large": "_quote--large_1v5kq_80",
|
|
27
|
+
form__input: B,
|
|
28
|
+
form__hint: j,
|
|
29
|
+
form__label: C,
|
|
30
|
+
form__dropdown: I,
|
|
31
|
+
table__header: L,
|
|
32
|
+
table__body: M,
|
|
33
|
+
"table__body--secondary": "_table__body--secondary_1v5kq_117",
|
|
34
|
+
button: R,
|
|
35
|
+
"icon-button": "_icon-button_1v5kq_130",
|
|
36
|
+
"icon-button--primary": "_icon-button--primary_1v5kq_142",
|
|
37
|
+
"icon-button--square": "_icon-button--square_1v5kq_164",
|
|
38
|
+
"icon-button__container": "_icon-button__container_1v5kq_180"
|
|
39
|
+
}, E = h(
|
|
40
|
+
(r, e) => {
|
|
41
|
+
const {
|
|
42
|
+
onClick: d,
|
|
43
|
+
icon: b,
|
|
44
|
+
link: i,
|
|
45
|
+
loading: l,
|
|
46
|
+
children: a,
|
|
47
|
+
type: s = "button",
|
|
48
|
+
disabled: c,
|
|
49
|
+
className: t,
|
|
50
|
+
variant: _ = "primary"
|
|
51
|
+
} = r, u = k(
|
|
52
|
+
() => v([
|
|
53
|
+
o["icon-button"],
|
|
54
|
+
o[`icon-button--${_}`],
|
|
55
|
+
t
|
|
56
|
+
]),
|
|
57
|
+
[t, _]
|
|
58
|
+
);
|
|
59
|
+
return /* @__PURE__ */ n(
|
|
60
|
+
y,
|
|
61
|
+
{
|
|
62
|
+
type: s,
|
|
63
|
+
href: i,
|
|
64
|
+
onClick: d,
|
|
65
|
+
disabled: c,
|
|
66
|
+
className: u,
|
|
67
|
+
ref: e,
|
|
68
|
+
children: /* @__PURE__ */ q("div", { className: o["icon-button__container"], children: [
|
|
69
|
+
l ? /* @__PURE__ */ n(m, { invert: !0 }) : b,
|
|
70
|
+
_ !== "square" && a
|
|
71
|
+
] })
|
|
72
|
+
}
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
);
|
|
60
76
|
export {
|
|
61
|
-
|
|
62
|
-
|
|
77
|
+
E as IconButton,
|
|
78
|
+
E as default
|
|
63
79
|
};
|
|
@@ -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,66 +1,26 @@
|
|
|
1
1
|
import { RequireAllOrNone } from '../../types/helpers';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
|
|
4
|
-
type BreadcrumbItem = {
|
|
5
|
-
/** Breadcrumb item label */
|
|
6
|
-
label: string;
|
|
7
|
-
/** Id to be applied as `data-testid` on the breadcrumb item */
|
|
8
|
-
'data-testid'?: string;
|
|
9
|
-
/** CSS classes to be applied on the breadcrumb item */
|
|
10
|
-
className?: string;
|
|
11
|
-
/** Callback called when the breadcrumb item is clicked */
|
|
12
|
-
onClick: () => void;
|
|
13
|
-
};
|
|
14
|
-
type LastBreadcrumbItem = Omit<BreadcrumbItem, 'onClick'> & {
|
|
15
|
-
/** Callback called when the breadcrumb item is clicked */
|
|
16
|
-
onClick?: () => void;
|
|
17
|
-
};
|
|
18
4
|
type PageHeaderCommonProps = {
|
|
19
|
-
/** Title text */
|
|
20
5
|
title: string;
|
|
21
|
-
/** Subtitle text */
|
|
22
6
|
subtitle?: string;
|
|
23
|
-
/** Back link text
|
|
24
|
-
* @deprecated Use breadcrumb prop instead.
|
|
25
|
-
*/
|
|
26
|
-
backLinkText?: string;
|
|
27
|
-
/**
|
|
28
|
-
* Callback called when `back link` is clicked
|
|
29
|
-
* @deprecated Use breadcrumb prop instead.
|
|
30
|
-
* */
|
|
31
|
-
onBackLinkClick?: () => void;
|
|
32
|
-
/** Element to be rendered on the right slot of the component */
|
|
33
7
|
rightChildren?: ReactNode;
|
|
34
|
-
/** Element to be rendered on the bottom slot of the component */
|
|
35
8
|
bottomChildren?: ReactNode;
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
* Id to be applied as `data-testid` on the back link element
|
|
51
|
-
* @deprecated Use breadcrumb prop instead.
|
|
52
|
-
* */
|
|
53
|
-
'data-testid-backLink'?: string;
|
|
54
|
-
/** Id to be applied as `data-testid` on the title element */
|
|
55
|
-
'data-testid-title'?: string;
|
|
56
|
-
/** Id to be applied as `data-testid` on the subtitle element */
|
|
57
|
-
'data-testid-subtitle'?: string;
|
|
58
|
-
breadcrumb?: never;
|
|
59
|
-
};
|
|
60
|
-
type PageHeaderWithBreadcrumb = Omit<PageHeaderCommonProps, 'backLinkText' | 'onBackLinkClick' | 'classNameBackLink' | 'data-testid-backLink' | 'breadcrumb'> & {
|
|
61
|
-
/** List of breadcrumbs to be rendered at the top of the title */
|
|
62
|
-
breadcrumb?: [...BreadcrumbItem[], LastBreadcrumbItem];
|
|
9
|
+
backLinkText?: string;
|
|
10
|
+
onBackLinkClick?: () => void;
|
|
11
|
+
wrapperClassName?: string;
|
|
12
|
+
backLinkClassName?: string;
|
|
13
|
+
titleClassName?: string;
|
|
14
|
+
subtitleClassName?: string;
|
|
15
|
+
rightChildrenClassName?: string;
|
|
16
|
+
bottomChildrenClassName?: string;
|
|
17
|
+
wrapperTestId?: string;
|
|
18
|
+
backLinkTestId?: string;
|
|
19
|
+
titleTestId?: string;
|
|
20
|
+
subtitleTestId?: string;
|
|
21
|
+
rightChildrenTestId?: string;
|
|
22
|
+
bottomChildrenTestId?: string;
|
|
63
23
|
};
|
|
64
|
-
|
|
65
|
-
export declare const PageHeader: ({ title, subtitle, rightChildren, bottomChildren,
|
|
24
|
+
type PageHeaderProps = RequireAllOrNone<PageHeaderCommonProps, 'backLinkText' | 'onBackLinkClick'>;
|
|
25
|
+
export declare const PageHeader: ({ title, subtitle, backLinkText, onBackLinkClick, rightChildren, bottomChildren, wrapperClassName, backLinkClassName, titleClassName, subtitleClassName, rightChildrenClassName, bottomChildrenClassName, wrapperTestId, backLinkTestId, titleTestId, subtitleTestId, rightChildrenTestId, bottomChildrenTestId, ...rest }: PageHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
66
26
|
export {};
|
|
@@ -1,87 +1,69 @@
|
|
|
1
1
|
import '../../assets/PageHeader.css';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
"
|
|
12
|
-
"page-
|
|
13
|
-
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
|
|
17
|
-
subtitle:
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
backLinkText: p,
|
|
49
|
-
onBackLinkClick: s,
|
|
50
|
-
classNameBackLink: c,
|
|
51
|
-
"data-testid-backLink": i,
|
|
52
|
-
...x
|
|
53
|
-
} = f, v = L(() => {
|
|
54
|
-
const _ = [];
|
|
55
|
-
return p && s && _.push({
|
|
56
|
-
label: p,
|
|
57
|
-
className: c,
|
|
58
|
-
"data-testid": i,
|
|
59
|
-
onClick: s
|
|
60
|
-
}), r && _.push(...r), /* @__PURE__ */ a("div", { className: e["page-header__top-content"], children: /* @__PURE__ */ a("div", { className: e["page-header__breadcrumb"], children: _.map((t, o) => /* @__PURE__ */ a(
|
|
61
|
-
C,
|
|
62
|
-
{
|
|
63
|
-
icon: o === 0 ? /* @__PURE__ */ a(B, { icon: "arrow-left" }) : /* @__PURE__ */ a("span", { className: e["page-header__breadcrumb__separator"], children: "/" }),
|
|
64
|
-
onClick: () => t.onClick && t.onClick(),
|
|
65
|
-
className: t.className,
|
|
66
|
-
"data-testid": t["data-testid"],
|
|
67
|
-
disabled: _.length === 1 ? !1 : o === _.length - 1,
|
|
68
|
-
children: t.label
|
|
69
|
-
},
|
|
70
|
-
`${t.label}_${o}`
|
|
71
|
-
)) }) });
|
|
72
|
-
}, [r, p, c, i, s]);
|
|
73
|
-
return /* @__PURE__ */ h("div", { className: n([e["page-header"], y]), "data-testid": m, ...x, children: [
|
|
74
|
-
v,
|
|
75
|
-
/* @__PURE__ */ h("div", { className: e["page-header__main-content"], children: [
|
|
76
|
-
/* @__PURE__ */ h("div", { className: e["page-header__main-left-content"], children: [
|
|
77
|
-
/* @__PURE__ */ a("h1", { className: n(e.title, u), "data-testid": k, children: l }),
|
|
78
|
-
/* @__PURE__ */ a("h2", { className: n(e.subtitle, z), "data-testid": N, children: g })
|
|
79
|
-
] }),
|
|
80
|
-
d && /* @__PURE__ */ a("div", { className: e["page-header__main-right-content"], children: d })
|
|
2
|
+
import { jsxs as c, jsx as t } from "react/jsx-runtime";
|
|
3
|
+
import { c as a } from "../../clsx-DB4S2d7J.js";
|
|
4
|
+
import * as i from "react";
|
|
5
|
+
const C = (n) => /* @__PURE__ */ i.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 448 512", "data-waves-icon": "fa/solid/arrow-left", fill: "currentColor", color: "currentColor", width: "1em", height: "1em", style: {
|
|
6
|
+
fill: "currentcolor",
|
|
7
|
+
color: "currentcolor",
|
|
8
|
+
width: "1em",
|
|
9
|
+
height: "1em"
|
|
10
|
+
}, ...n }, /* @__PURE__ */ i.createElement("path", { d: "M447.1 256C447.1 273.7 433.7 288 416 288H109.3l105.4 105.4c12.5 12.5 12.5 32.75 0 45.25C208.4 444.9 200.2 448 192 448s-16.38-3.125-22.62-9.375l-160-160c-12.5-12.5-12.5-32.75 0-45.25l160-160c12.5-12.5 32.75-12.5 45.25 0s12.5 32.75 0 45.25L109.3 224H416C433.7 224 447.1 238.3 447.1 256z" })), y = C, H = "_title_cz9x0_46", j = "_subtitle_cz9x0_47", e = {
|
|
11
|
+
"page-header": "_page-header_cz9x0_1",
|
|
12
|
+
"page-header__top-content": "_page-header__top-content_cz9x0_10",
|
|
13
|
+
"page-header__main-content": "_page-header__main-content_cz9x0_13",
|
|
14
|
+
"page-header__bottom-content": "_page-header__bottom-content_cz9x0_13",
|
|
15
|
+
"page-header__main-left-content": "_page-header__main-left-content_cz9x0_40",
|
|
16
|
+
title: H,
|
|
17
|
+
subtitle: j,
|
|
18
|
+
"page-header__main-right-content": "_page-header__main-right-content_cz9x0_64"
|
|
19
|
+
}, L = ({
|
|
20
|
+
title: n,
|
|
21
|
+
subtitle: s,
|
|
22
|
+
backLinkText: r,
|
|
23
|
+
onBackLinkClick: d,
|
|
24
|
+
rightChildren: o,
|
|
25
|
+
bottomChildren: _,
|
|
26
|
+
wrapperClassName: l,
|
|
27
|
+
backLinkClassName: h,
|
|
28
|
+
titleClassName: m,
|
|
29
|
+
subtitleClassName: p,
|
|
30
|
+
rightChildrenClassName: g,
|
|
31
|
+
bottomChildrenClassName: f,
|
|
32
|
+
wrapperTestId: x,
|
|
33
|
+
backLinkTestId: u,
|
|
34
|
+
titleTestId: v,
|
|
35
|
+
subtitleTestId: w,
|
|
36
|
+
rightChildrenTestId: z,
|
|
37
|
+
bottomChildrenTestId: N,
|
|
38
|
+
...b
|
|
39
|
+
}) => /* @__PURE__ */ c("div", { className: a([e["page-header"], l]), "data-testid": x, ...b, children: [
|
|
40
|
+
r && /* @__PURE__ */ t("div", { className: e["page-header__top-content"], children: /* @__PURE__ */ c("button", { type: "button", onClick: d, className: h, "data-testid": u, children: [
|
|
41
|
+
/* @__PURE__ */ t(y, { fontSize: 16 }),
|
|
42
|
+
r
|
|
43
|
+
] }) }),
|
|
44
|
+
/* @__PURE__ */ c("div", { className: e["page-header__main-content"], children: [
|
|
45
|
+
/* @__PURE__ */ c("div", { className: e["page-header__main-left-content"], children: [
|
|
46
|
+
/* @__PURE__ */ t("h1", { className: a(e.title, m), "data-testid": v, children: n }),
|
|
47
|
+
/* @__PURE__ */ t("h3", { className: a(e.subtitle, p), "data-testid": w, children: s })
|
|
81
48
|
] }),
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
49
|
+
o && /* @__PURE__ */ t(
|
|
50
|
+
"div",
|
|
51
|
+
{
|
|
52
|
+
className: a(e["page-header__main-right-content"], g),
|
|
53
|
+
"data-testid": z,
|
|
54
|
+
children: o
|
|
55
|
+
}
|
|
56
|
+
)
|
|
57
|
+
] }),
|
|
58
|
+
_ && /* @__PURE__ */ t(
|
|
59
|
+
"div",
|
|
60
|
+
{
|
|
61
|
+
className: a(e["page-header__bottom-content"], f),
|
|
62
|
+
"data-testid": N,
|
|
63
|
+
children: _
|
|
64
|
+
}
|
|
65
|
+
)
|
|
66
|
+
] });
|
|
85
67
|
export {
|
|
86
|
-
|
|
68
|
+
L as PageHeader
|
|
87
69
|
};
|
|
@@ -1,55 +1,36 @@
|
|
|
1
1
|
export type PaginationParams = {
|
|
2
|
-
/** Total number of items to paginate */
|
|
3
2
|
totalItems: number;
|
|
4
|
-
/** Number of items to show per page */
|
|
5
3
|
perPage: number;
|
|
6
|
-
/** Current page */
|
|
7
4
|
currentPage: number;
|
|
8
5
|
};
|
|
9
6
|
export type PaginationTranslations = {
|
|
10
|
-
/** Translation text for `showing` */
|
|
11
7
|
showing: string;
|
|
12
|
-
/** Translation text for `of` */
|
|
13
8
|
of: string;
|
|
14
|
-
/** Translation text for `result` */
|
|
15
9
|
results: string;
|
|
16
|
-
/** Translation text for `previous` */
|
|
17
10
|
previous: string;
|
|
18
|
-
/** Translation text for `next` */
|
|
19
11
|
next: string;
|
|
20
12
|
};
|
|
21
13
|
type PaginationLanguages = 'pt' | 'en';
|
|
22
14
|
type PaginationCommonProps = {
|
|
23
|
-
/** CSS classes to be applied on the container element */
|
|
24
15
|
className?: string;
|
|
25
|
-
|
|
16
|
+
'data-testid'?: string;
|
|
26
17
|
classNamePerPage?: string;
|
|
27
|
-
|
|
18
|
+
'data-testid__per-page'?: string;
|
|
28
19
|
classNamePagesNav?: string;
|
|
29
|
-
|
|
30
|
-
'data-testid'?: string;
|
|
31
|
-
/** Id to be applied as `data-testid` on per page element */
|
|
32
|
-
'data-testid-per-page'?: string;
|
|
33
|
-
/** Id to be applied as `data-testid` on the pages navigation element */
|
|
34
|
-
'data-testid-pages-nav'?: string;
|
|
20
|
+
'data-testid__pages-nav'?: string;
|
|
35
21
|
};
|
|
36
22
|
export type PaginationProps = {
|
|
37
|
-
/** Array of options to be rendered as per page options. */
|
|
38
23
|
perPageOptions?: (number | {
|
|
39
24
|
value: number;
|
|
40
25
|
label: string;
|
|
41
26
|
})[] | undefined;
|
|
42
|
-
/** Callback called when page changes. */
|
|
43
27
|
onPageChange: (page: number) => void;
|
|
44
|
-
|
|
45
|
-
onRowsPerPageChange: (perPage: number) => void;
|
|
46
|
-
/** Language to be used for texts. */
|
|
28
|
+
onRowsPerPageChange: (perPage: number | string) => void;
|
|
47
29
|
language?: PaginationLanguages;
|
|
48
|
-
/** Custom translation object to be used for texts. */
|
|
49
30
|
t?: PaginationTranslations;
|
|
50
31
|
} & PaginationParams & PaginationCommonProps;
|
|
51
|
-
export declare const
|
|
32
|
+
export declare const defaultTranslations: {
|
|
52
33
|
[key in PaginationLanguages]: PaginationTranslations;
|
|
53
34
|
};
|
|
54
|
-
export declare const Pagination: (
|
|
35
|
+
export declare const Pagination: (props: PaginationProps) => import("react/jsx-runtime").JSX.Element;
|
|
55
36
|
export {};
|