@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
|
@@ -1,29 +1,34 @@
|
|
|
1
1
|
import '../../assets/InputSearch.css';
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { c as
|
|
2
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
3
|
+
import { c as m } from "../../clsx-DB4S2d7J.js";
|
|
4
4
|
import { Icon as p } from "../Icon/Icon.js";
|
|
5
|
-
import { Input as
|
|
6
|
-
const
|
|
7
|
-
inputSearch:
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
classNameWrapper:
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
5
|
+
import { Input as u } from "../Input/Input.js";
|
|
6
|
+
const l = "_inputSearch_114e1_1", h = {
|
|
7
|
+
inputSearch: l
|
|
8
|
+
};
|
|
9
|
+
let n;
|
|
10
|
+
const d = ({
|
|
11
|
+
classNameWrapper: r,
|
|
12
|
+
triggerDelay: o = 500,
|
|
13
|
+
value: c,
|
|
14
|
+
onChange: i = () => {
|
|
15
|
+
},
|
|
16
|
+
...a
|
|
17
|
+
}) => {
|
|
18
|
+
const s = (t) => {
|
|
19
|
+
n && clearTimeout(n), n = setTimeout(() => i(t), o);
|
|
20
|
+
};
|
|
21
|
+
return /* @__PURE__ */ e("div", { className: m(h.inputSearch, r), children: /* @__PURE__ */ e(
|
|
22
|
+
u,
|
|
23
|
+
{
|
|
24
|
+
type: "search",
|
|
25
|
+
...a,
|
|
26
|
+
leftIcon: /* @__PURE__ */ e(p, { icon: "magnifying-glass" }),
|
|
27
|
+
defaultValue: c,
|
|
28
|
+
onChange: (t) => s(t)
|
|
29
|
+
}
|
|
30
|
+
) });
|
|
31
|
+
};
|
|
27
32
|
export {
|
|
28
|
-
|
|
33
|
+
d as InputSearch
|
|
29
34
|
};
|
|
@@ -2,12 +2,28 @@ import { StoryObj } from '@storybook/react';
|
|
|
2
2
|
|
|
3
3
|
declare const meta: {
|
|
4
4
|
title: string;
|
|
5
|
-
component: ({
|
|
5
|
+
component: ({ classNameWrapper, triggerDelay, value, onChange, ...rest }: {
|
|
6
|
+
triggerDelay?: number | undefined;
|
|
7
|
+
} & import('react').InputHTMLAttributes<HTMLInputElement> & {
|
|
6
8
|
label?: string | undefined;
|
|
7
|
-
|
|
9
|
+
infoMessage?: string | undefined;
|
|
10
|
+
errorMessage?: string | undefined;
|
|
11
|
+
leftIcon?: import('react').ReactNode;
|
|
12
|
+
rightIcon?: import('react').ReactNode;
|
|
13
|
+
type?: "search" | "text" | "password" | undefined;
|
|
14
|
+
hideCharsCounter?: boolean | undefined;
|
|
8
15
|
classNameWrapper?: string | undefined;
|
|
9
|
-
|
|
10
|
-
|
|
16
|
+
classNameLabel?: string | undefined;
|
|
17
|
+
classNameInput?: string | undefined;
|
|
18
|
+
classNameInfoMessage?: string | undefined;
|
|
19
|
+
classNameErrorMessage?: string | undefined;
|
|
20
|
+
classNameCharsCounter?: string | undefined;
|
|
21
|
+
'data-testid-wrapper'?: string | undefined;
|
|
22
|
+
'data-testid-label'?: string | undefined;
|
|
23
|
+
'data-testid-input'?: string | undefined;
|
|
24
|
+
'data-testid-infoMessage'?: string | undefined;
|
|
25
|
+
'data-testid-errorMessage'?: string | undefined;
|
|
26
|
+
'data-testid-charsCounter'?: string | undefined;
|
|
11
27
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
12
28
|
tags: string[];
|
|
13
29
|
parameters: {
|
|
@@ -18,5 +34,6 @@ export default meta;
|
|
|
18
34
|
type Story = StoryObj<typeof meta>;
|
|
19
35
|
export declare const Simple: Story;
|
|
20
36
|
export declare const WithLabel: Story;
|
|
37
|
+
export declare const WithCustomDelay: Story;
|
|
21
38
|
export declare const WithPlaceholder: Story;
|
|
22
39
|
export declare const Disabled: Story;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export interface LoadingSpinnerProps {
|
|
2
2
|
/** Whether to invert colours or not */
|
|
3
3
|
invert?: boolean;
|
|
4
|
-
/** Space
|
|
4
|
+
/** Space separated list of CSS classes to apply */
|
|
5
5
|
classNames?: string;
|
|
6
6
|
}
|
|
7
7
|
export declare const LoadingSpinner: ({ invert, classNames }: LoadingSpinnerProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,14 +1,33 @@
|
|
|
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
|
+
};
|
|
4
18
|
type PageHeaderCommonProps = {
|
|
5
19
|
/** Title text */
|
|
6
20
|
title: string;
|
|
7
21
|
/** Subtitle text */
|
|
8
22
|
subtitle?: string;
|
|
9
|
-
/** Back link text
|
|
23
|
+
/** Back link text
|
|
24
|
+
* @deprecated Use breadcrumb prop instead.
|
|
25
|
+
*/
|
|
10
26
|
backLinkText?: string;
|
|
11
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
* Callback called when `back link` is clicked
|
|
29
|
+
* @deprecated Use breadcrumb prop instead.
|
|
30
|
+
* */
|
|
12
31
|
onBackLinkClick?: () => void;
|
|
13
32
|
/** Element to be rendered on the right slot of the component */
|
|
14
33
|
rightChildren?: ReactNode;
|
|
@@ -16,7 +35,10 @@ type PageHeaderCommonProps = {
|
|
|
16
35
|
bottomChildren?: ReactNode;
|
|
17
36
|
/** CSS classes to be applied on the container element */
|
|
18
37
|
classNameWrapper?: string;
|
|
19
|
-
/**
|
|
38
|
+
/**
|
|
39
|
+
* CSS classes to be applied on the back link element
|
|
40
|
+
* @deprecated Use breadcrumb prop instead.
|
|
41
|
+
* */
|
|
20
42
|
classNameBackLink?: string;
|
|
21
43
|
/** CSS classes to be applied on the title element */
|
|
22
44
|
classNameTitle?: string;
|
|
@@ -24,13 +46,21 @@ type PageHeaderCommonProps = {
|
|
|
24
46
|
classNameSubtitle?: string;
|
|
25
47
|
/** Id to be applied as `data-testid` on the container element */
|
|
26
48
|
'data-testid-wrapper'?: string;
|
|
27
|
-
/**
|
|
49
|
+
/**
|
|
50
|
+
* Id to be applied as `data-testid` on the back link element
|
|
51
|
+
* @deprecated Use breadcrumb prop instead.
|
|
52
|
+
* */
|
|
28
53
|
'data-testid-backLink'?: string;
|
|
29
54
|
/** Id to be applied as `data-testid` on the title element */
|
|
30
55
|
'data-testid-title'?: string;
|
|
31
56
|
/** Id to be applied as `data-testid` on the subtitle element */
|
|
32
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];
|
|
33
63
|
};
|
|
34
|
-
type PageHeaderProps = RequireAllOrNone<PageHeaderCommonProps, 'backLinkText' | 'onBackLinkClick'
|
|
35
|
-
export declare const PageHeader: ({ title, subtitle,
|
|
64
|
+
export type PageHeaderProps = RequireAllOrNone<PageHeaderCommonProps, 'backLinkText' | 'onBackLinkClick'> | PageHeaderWithBreadcrumb;
|
|
65
|
+
export declare const PageHeader: ({ title, subtitle, rightChildren, bottomChildren, classNameWrapper, classNameTitle, classNameSubtitle, "data-testid-wrapper": wrapperTestId, "data-testid-title": titleTestId, "data-testid-subtitle": subtitleTestId, ...props }: PageHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
36
66
|
export {};
|
|
@@ -1,51 +1,87 @@
|
|
|
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
|
-
|
|
2
|
+
import { jsx as a, jsxs as h } from "react/jsx-runtime";
|
|
3
|
+
import { useMemo as L } from "react";
|
|
4
|
+
import { c as n } from "../../clsx-DB4S2d7J.js";
|
|
5
|
+
import { Icon as B } from "../Icon/Icon.js";
|
|
6
|
+
import { IconButton as C } from "../IconButton/IconButton.js";
|
|
7
|
+
const j = "_title_z7ezb_22", w = "_subtitle_z7ezb_43", e = {
|
|
8
|
+
"u-typography-h1": "_u-typography-h1_z7ezb_1",
|
|
9
|
+
"u-typography-h2": "_u-typography-h2_z7ezb_8",
|
|
10
|
+
"u-typography-h3": "_u-typography-h3_z7ezb_15",
|
|
11
|
+
"u-typography-h4": "_u-typography-h4_z7ezb_22",
|
|
12
|
+
"page-header__main-left-content": "_page-header__main-left-content_z7ezb_22",
|
|
13
|
+
title: j,
|
|
14
|
+
"u-typography-h5": "_u-typography-h5_z7ezb_29",
|
|
15
|
+
"u-typography-h6": "_u-typography-h6_z7ezb_36",
|
|
16
|
+
"u-typography-base": "_u-typography-base_z7ezb_43",
|
|
17
|
+
subtitle: w,
|
|
18
|
+
"u-typography-base--xxl": "_u-typography-base--xxl_z7ezb_48",
|
|
19
|
+
"u-typography-base--xl": "_u-typography-base--xl_z7ezb_52",
|
|
20
|
+
"u-typography-base--lg": "_u-typography-base--lg_z7ezb_56",
|
|
21
|
+
"u-typography-base--sm": "_u-typography-base--sm_z7ezb_60",
|
|
22
|
+
"u-typography-base--bold": "_u-typography-base--bold_z7ezb_64",
|
|
23
|
+
"u-typography-base--strikethrough": "_u-typography-base--strikethrough_z7ezb_67",
|
|
24
|
+
"u-typography-base--underlined": "_u-typography-base--underlined_z7ezb_70",
|
|
25
|
+
"u-typography-base--strikethrough-underlined": "_u-typography-base--strikethrough-underlined_z7ezb_73",
|
|
26
|
+
"page-header": "_page-header_z7ezb_22",
|
|
27
|
+
"page-header__top-content": "_page-header__top-content_z7ezb_86",
|
|
28
|
+
"page-header__main-content": "_page-header__main-content_z7ezb_89",
|
|
29
|
+
"page-header__bottom-content": "_page-header__bottom-content_z7ezb_89",
|
|
30
|
+
"page-header__breadcrumb": "_page-header__breadcrumb_z7ezb_103",
|
|
31
|
+
"page-header__breadcrumb__separator": "_page-header__breadcrumb__separator_z7ezb_108",
|
|
32
|
+
"page-header__main-right-content": "_page-header__main-right-content_z7ezb_131"
|
|
33
|
+
}, P = ({
|
|
34
|
+
title: l,
|
|
35
|
+
subtitle: g,
|
|
36
|
+
rightChildren: d,
|
|
37
|
+
bottomChildren: b,
|
|
38
|
+
classNameWrapper: y,
|
|
39
|
+
classNameTitle: u,
|
|
40
|
+
classNameSubtitle: z,
|
|
41
|
+
"data-testid-wrapper": m,
|
|
42
|
+
"data-testid-title": k,
|
|
43
|
+
"data-testid-subtitle": N,
|
|
44
|
+
...f
|
|
45
|
+
}) => {
|
|
46
|
+
const {
|
|
47
|
+
breadcrumb: r,
|
|
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 })
|
|
44
81
|
] }),
|
|
45
|
-
|
|
46
|
-
] })
|
|
47
|
-
|
|
48
|
-
] });
|
|
82
|
+
b && /* @__PURE__ */ a("div", { className: e["page-header__bottom-content"], children: b })
|
|
83
|
+
] });
|
|
84
|
+
};
|
|
49
85
|
export {
|
|
50
|
-
|
|
86
|
+
P as PageHeader
|
|
51
87
|
};
|
|
@@ -2,42 +2,13 @@ import { StoryObj } from '@storybook/react';
|
|
|
2
2
|
|
|
3
3
|
declare const meta: {
|
|
4
4
|
title: string;
|
|
5
|
-
component: ({ title, subtitle,
|
|
6
|
-
title: string;
|
|
7
|
-
subtitle?: string | undefined;
|
|
8
|
-
backLinkText?: string | undefined;
|
|
9
|
-
onBackLinkClick?: (() => void) | undefined;
|
|
10
|
-
rightChildren?: import('react').ReactNode;
|
|
11
|
-
bottomChildren?: import('react').ReactNode;
|
|
12
|
-
classNameWrapper?: string | undefined;
|
|
13
|
-
classNameBackLink?: string | undefined;
|
|
14
|
-
classNameTitle?: string | undefined;
|
|
15
|
-
classNameSubtitle?: string | undefined;
|
|
16
|
-
'data-testid-wrapper'?: string | undefined;
|
|
17
|
-
'data-testid-backLink'?: string | undefined;
|
|
18
|
-
'data-testid-title'?: string | undefined;
|
|
19
|
-
'data-testid-subtitle'?: string | undefined;
|
|
20
|
-
}, "backLinkText" | "onBackLinkClick">> | Partial<Record<"backLinkText" | "onBackLinkClick", never>>) & Omit<{
|
|
21
|
-
title: string;
|
|
22
|
-
subtitle?: string | undefined;
|
|
23
|
-
backLinkText?: string | undefined;
|
|
24
|
-
onBackLinkClick?: (() => void) | undefined;
|
|
25
|
-
rightChildren?: import('react').ReactNode;
|
|
26
|
-
bottomChildren?: import('react').ReactNode;
|
|
27
|
-
classNameWrapper?: string | undefined;
|
|
28
|
-
classNameBackLink?: string | undefined;
|
|
29
|
-
classNameTitle?: string | undefined;
|
|
30
|
-
classNameSubtitle?: string | undefined;
|
|
31
|
-
'data-testid-wrapper'?: string | undefined;
|
|
32
|
-
'data-testid-backLink'?: string | undefined;
|
|
33
|
-
'data-testid-title'?: string | undefined;
|
|
34
|
-
'data-testid-subtitle'?: string | undefined;
|
|
35
|
-
}, "backLinkText" | "onBackLinkClick">) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
component: ({ title, subtitle, rightChildren, bottomChildren, classNameWrapper, classNameTitle, classNameSubtitle, "data-testid-wrapper": wrapperTestId, "data-testid-title": titleTestId, "data-testid-subtitle": subtitleTestId, ...props }: import('./PageHeader').PageHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
36
6
|
tags: string[];
|
|
37
7
|
};
|
|
38
8
|
export default meta;
|
|
39
9
|
type Story = StoryObj<typeof meta>;
|
|
40
10
|
export declare const Simple: Story;
|
|
41
11
|
export declare const WithBackLink: Story;
|
|
12
|
+
export declare const WithBreadcrumb: Story;
|
|
42
13
|
export declare const WithRightChildren: Story;
|
|
43
14
|
export declare const WithBottomChildren: Story;
|
|
@@ -1,36 +1,55 @@
|
|
|
1
1
|
export type PaginationParams = {
|
|
2
|
+
/** Total number of items to paginate */
|
|
2
3
|
totalItems: number;
|
|
4
|
+
/** Number of items to show per page */
|
|
3
5
|
perPage: number;
|
|
6
|
+
/** Current page */
|
|
4
7
|
currentPage: number;
|
|
5
8
|
};
|
|
6
9
|
export type PaginationTranslations = {
|
|
10
|
+
/** Translation text for `showing` */
|
|
7
11
|
showing: string;
|
|
12
|
+
/** Translation text for `of` */
|
|
8
13
|
of: string;
|
|
14
|
+
/** Translation text for `result` */
|
|
9
15
|
results: string;
|
|
16
|
+
/** Translation text for `previous` */
|
|
10
17
|
previous: string;
|
|
18
|
+
/** Translation text for `next` */
|
|
11
19
|
next: string;
|
|
12
20
|
};
|
|
13
21
|
type PaginationLanguages = 'pt' | 'en';
|
|
14
22
|
type PaginationCommonProps = {
|
|
23
|
+
/** CSS classes to be applied on the container element */
|
|
15
24
|
className?: string;
|
|
16
|
-
|
|
25
|
+
/** CSS classes to be applied on the per page element */
|
|
17
26
|
classNamePerPage?: string;
|
|
18
|
-
|
|
27
|
+
/** CSS classes to be applied on the pages navigation element */
|
|
19
28
|
classNamePagesNav?: string;
|
|
20
|
-
|
|
29
|
+
/** Id to be applied as `data-testid` on the container element */
|
|
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;
|
|
21
35
|
};
|
|
22
36
|
export type PaginationProps = {
|
|
37
|
+
/** Array of options to be rendered as per page options. */
|
|
23
38
|
perPageOptions?: (number | {
|
|
24
39
|
value: number;
|
|
25
40
|
label: string;
|
|
26
41
|
})[] | undefined;
|
|
42
|
+
/** Callback called when page changes. */
|
|
27
43
|
onPageChange: (page: number) => void;
|
|
28
|
-
|
|
44
|
+
/** Callback called when items per page changes. */
|
|
45
|
+
onRowsPerPageChange: (perPage: number) => void;
|
|
46
|
+
/** Language to be used for texts. */
|
|
29
47
|
language?: PaginationLanguages;
|
|
48
|
+
/** Custom translation object to be used for texts. */
|
|
30
49
|
t?: PaginationTranslations;
|
|
31
50
|
} & PaginationParams & PaginationCommonProps;
|
|
32
51
|
export declare const paginationDefaultTranslations: {
|
|
33
52
|
[key in PaginationLanguages]: PaginationTranslations;
|
|
34
53
|
};
|
|
35
|
-
export declare const Pagination: (props: PaginationProps) => import("react/jsx-runtime").JSX.Element;
|
|
54
|
+
export declare const Pagination: ({ perPageOptions, language, ...props }: PaginationProps) => import("react/jsx-runtime").JSX.Element;
|
|
36
55
|
export {};
|