@pismo/marola 1.0.0-beta.48 → 1.0.0-beta.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/dist/{Button-BAljjMv3.js → Button-2b1peDFT.js} +2 -2
- package/dist/{ClickAwayListener-DbEYZpyh.js → ClickAwayListener-BSW-Nd-y.js} +3 -4
- package/dist/Dialog.module-DFEmFdYT.js +30 -0
- package/dist/Group-B3p31ftp.js +26 -0
- package/dist/{Popup-Ck3XlWMq.js → Popup-B6ZSGIEI.js} +3 -3
- package/dist/{Portal-oY3enyAm.js → Portal-DIeBsWdL.js} +2 -2
- package/dist/SelectButton-K3OIfR5m.js +61 -0
- package/dist/{Tabs.module-BGGTkDc5.js → Tabs.module-jkH1Qjn7.js} +7 -7
- 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 -1
- package/dist/assets/Group.css +1 -1
- package/dist/assets/IconButton.css +1 -1
- package/dist/assets/Input.css +1 -1
- package/dist/assets/PageHeader.css +1 -1
- package/dist/assets/Pagination.css +1 -1
- package/dist/assets/SelectButton.css +1 -1
- 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/Tabs.css +1 -1
- package/dist/assets/TextDisplay.css +1 -1
- package/dist/assets/Toggle.css +1 -1
- package/dist/assets/Toggle2.css +1 -1
- package/dist/assets/Typography.css +1 -1
- package/dist/{combineHooksSlotProps-C-zYvfnF.js → combineHooksSlotProps-DVjg9PRh.js} +1 -1
- package/dist/components/Advice/Advice.d.ts +17 -32
- package/dist/components/Advice/Advice.js +40 -39
- package/dist/components/Advice/Advice.stories.d.ts +3 -4
- package/dist/components/Button/Button.d.ts +0 -2
- package/dist/components/Button/Button.js +49 -51
- package/dist/components/Checkbox/Checkbox.js +52 -52
- package/dist/components/Chip/Chip.d.ts +12 -6
- package/dist/components/Chip/Chip.js +6 -9
- package/dist/components/Chip/Chip.stories.d.ts +15 -6
- package/dist/components/Dialog/Actions.js +1 -1
- package/dist/components/Dialog/Backdrop.d.ts +3 -3
- package/dist/components/Dialog/Backdrop.js +7 -8
- package/dist/components/Dialog/CloseIconButton.d.ts +2 -1
- package/dist/components/Dialog/CloseIconButton.js +18 -15
- package/dist/components/Dialog/Dialog.d.ts +6 -9
- package/dist/components/Dialog/Dialog.js +139 -139
- package/dist/components/Dialog/Dialog.stories.d.ts +47 -51
- package/dist/components/Dialog/DialogTitle.js +1 -1
- package/dist/components/EllipsisTooltip/EllipsisTooltip.js +17 -30
- package/dist/components/EllipsisTooltip/EllipsisTooltip.stories.d.ts +2 -3
- package/dist/components/Icon/Icon.js +52 -146
- package/dist/components/Icon/types.d.ts +1 -1
- package/dist/components/IconButton/IconButton.js +42 -42
- package/dist/components/Input/Input.d.ts +5 -24
- package/dist/components/Input/Input.js +292 -301
- package/dist/components/Input/Input.stories.d.ts +21 -2
- package/dist/components/InputSearch/InputSearch.stories.d.ts +21 -1
- package/dist/components/LoadingSpinner/LoadingSpinner.stories.d.ts +1 -1
- package/dist/components/PageHeader/PageHeader.js +57 -57
- package/dist/components/Pagination/Pagination.d.ts +1 -5
- package/dist/components/Pagination/Pagination.js +185 -87
- package/dist/components/Pagination/Pagination.stories.d.ts +1 -1
- package/dist/components/Select/Select.d.ts +0 -21
- package/dist/components/Select/Select.js +413 -476
- package/dist/components/Select/SelectButton.d.ts +0 -2
- package/dist/components/Select/SelectButton.js +2 -3
- package/dist/components/Skeleton/Skeleton.d.ts +1 -3
- package/dist/components/Skeleton/Skeleton.js +14 -20
- package/dist/components/Skeleton/SkeletonTable.stories.d.ts +1 -1
- package/dist/components/Snackbar/Snackbar.js +94 -94
- package/dist/components/Snackbar/Snackbar.stories.d.ts +4 -4
- package/dist/components/SortTooltip/SortTooltip.js +46 -46
- package/dist/components/Stepper/Stepper.js +35 -35
- package/dist/components/Table/Table.d.ts +1 -3
- package/dist/components/Table/Table.js +99 -87
- package/dist/components/Table/Table.stories.d.ts +1 -1
- package/dist/components/Tabs/Tab.d.ts +3 -5
- package/dist/components/Tabs/Tab.js +36 -38
- package/dist/components/Tabs/TabPanel.d.ts +2 -4
- package/dist/components/Tabs/TabPanel.js +40 -51
- package/dist/components/Tabs/Tabs.d.ts +4 -6
- package/dist/components/Tabs/Tabs.js +128 -131
- package/dist/components/TextDisplay/TextDisplay.d.ts +3 -9
- package/dist/components/TextDisplay/TextDisplay.js +31 -45
- package/dist/components/TextDisplay/TextDisplay.stories.d.ts +1 -2
- package/dist/components/Toggle/Toggle.js +56 -56
- package/dist/components/ToggleGroup/Group.d.ts +0 -2
- package/dist/components/ToggleGroup/Group.js +2 -4
- package/dist/components/ToggleGroup/Toggle.d.ts +0 -2
- package/dist/components/ToggleGroup/Toggle.js +5 -7
- package/dist/components/ToggleGroup/ToggleGroup.js +2 -2
- package/dist/components/ToggleGroup/ToggleGroup.stories.d.ts +1 -3
- package/dist/components/Tooltip/Tooltip.d.ts +1 -3
- package/dist/components/Tooltip/Tooltip.js +4 -4
- package/dist/components/Tooltip/Tooltip.stories.d.ts +1 -2
- package/dist/components/Typography/Typography.js +47 -47
- package/dist/components/Typography/Typography.stories.d.ts +1 -1
- package/dist/contexts/SnackbarProvider/SnackbarProvider.stories.d.ts +1 -1
- package/dist/{useSlotProps-C_I1kEHr.js → index-CH45lKw7.js} +99 -99
- package/dist/{index-bQFToy-I.js → index-CjW42-M-.js} +1 -1
- package/dist/main.d.ts +0 -6
- package/dist/main.js +76 -87
- package/dist/{useButton-DcihopJG.js → useButton-DNk3wrQp.js} +1 -1
- package/dist/useCompoundItem-D1iRfg8D.js +84 -0
- package/dist/useEventCallback-xTG9piMa.js +45 -0
- package/dist/{useList-B9C55YB7.js → useList-B0hog_3-.js} +2 -2
- package/package.json +12 -21
- package/dist/Dialog.module-D9e4RsKo.js +0 -30
- package/dist/Group-DspH8hyO.js +0 -30
- package/dist/Popover.module-B4boCutS.js +0 -10
- package/dist/SelectButton-B38avP9u.js +0 -75
- package/dist/Toggle-BbmXeuJd.js +0 -188
- package/dist/assets/Adornment.css +0 -1
- package/dist/assets/Autocomplete.css +0 -1
- package/dist/assets/Popover.css +0 -1
- package/dist/assets/ResultWithChips.css +0 -1
- package/dist/assets/StepperNavigator.css +0 -1
- package/dist/components/Adornment/Adornment.d.ts +0 -20
- package/dist/components/Adornment/Adornment.js +0 -13
- package/dist/components/Adornment/Adornment.stories.d.ts +0 -14
- package/dist/components/Adornment/adornment.test.d.ts +0 -1
- package/dist/components/Autocomplete/Autocomplete.d.ts +0 -20
- package/dist/components/Autocomplete/Autocomplete.js +0 -679
- package/dist/components/Autocomplete/Autocomplete.stories.d.ts +0 -23
- package/dist/components/Pagination/usePagination.d.ts +0 -90
- package/dist/components/Pagination/usePagination.js +0 -79
- package/dist/components/Popover/Popover.d.ts +0 -32
- package/dist/components/Popover/Popover.js +0 -24
- package/dist/components/Popover/Popover.stories.d.ts +0 -34
- package/dist/components/Popover/PopoverBody.d.ts +0 -6
- package/dist/components/Popover/PopoverBody.js +0 -6
- package/dist/components/Popover/PopoverFooter.d.ts +0 -6
- package/dist/components/Popover/PopoverFooter.js +0 -6
- package/dist/components/Popover/PopoverHeader.d.ts +0 -6
- package/dist/components/Popover/PopoverHeader.js +0 -6
- package/dist/components/ResultWithChips/ResultWithChips.d.ts +0 -12
- package/dist/components/ResultWithChips/ResultWithChips.js +0 -33
- package/dist/components/RowItem/RowItem.d.ts +0 -25
- package/dist/components/RowItem/RowItem.js +0 -21
- package/dist/components/RowItem/RowItem.stories.d.ts +0 -17
- package/dist/components/RowItem/rowItem.test.d.ts +0 -1
- package/dist/components/StepperNavigator/StepperNavigator.d.ts +0 -58
- package/dist/components/StepperNavigator/StepperNavigator.js +0 -115
- package/dist/components/StepperNavigator/StepperNavigator.stories.d.ts +0 -18
- package/dist/components/StepperNavigator/StepperNavigator.test.d.ts +0 -1
- package/dist/ownerDocument-YGhwAnr1.js +0 -33
- package/dist/useCompoundItem-B7Eo_qZk.js +0 -68
- package/dist/useEventCallback-BAQJJ3ye.js +0 -14
- package/dist/useId-BW-oWmul.js +0 -19
|
@@ -2,7 +2,27 @@ import { StoryObj } from '@storybook/react';
|
|
|
2
2
|
|
|
3
3
|
declare const meta: {
|
|
4
4
|
title: string;
|
|
5
|
-
component:
|
|
5
|
+
component: ({ label, infoMessage, errorMessage, leftIcon, rightIcon, id, disabled, type, maxLength, hideCharsCounter, onChange, classNameWrapper, classNameLabel, classNameInput, classNameInfoMessage, classNameErrorMessage, classNameCharsCounter, "data-testid-wrapper": testIdWrapper, "data-testid-label": testIdLabel, "data-testid-input": testIdInput, "data-testid-infoMessage": testIdInfoMessage, "data-testid-errorMessage": testIdErrorMessage, "data-testid-charsCounter": testIdCharsCounter, ...rest }: import('react').InputHTMLAttributes<HTMLInputElement> & {
|
|
6
|
+
label?: string | undefined;
|
|
7
|
+
infoMessage?: string | undefined;
|
|
8
|
+
errorMessage?: string | undefined;
|
|
9
|
+
leftIcon?: import('react').ReactNode;
|
|
10
|
+
rightIcon?: import('react').ReactNode;
|
|
11
|
+
type?: "search" | "text" | "password" | undefined;
|
|
12
|
+
hideCharsCounter?: boolean | undefined;
|
|
13
|
+
classNameWrapper?: string | undefined;
|
|
14
|
+
classNameLabel?: string | undefined;
|
|
15
|
+
classNameInput?: string | undefined;
|
|
16
|
+
classNameInfoMessage?: string | undefined;
|
|
17
|
+
classNameErrorMessage?: string | undefined;
|
|
18
|
+
classNameCharsCounter?: string | undefined;
|
|
19
|
+
'data-testid-wrapper'?: string | undefined;
|
|
20
|
+
'data-testid-label'?: string | undefined;
|
|
21
|
+
'data-testid-input'?: string | undefined;
|
|
22
|
+
'data-testid-infoMessage'?: string | undefined;
|
|
23
|
+
'data-testid-errorMessage'?: string | undefined;
|
|
24
|
+
'data-testid-charsCounter'?: string | undefined;
|
|
25
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
6
26
|
tags: string[];
|
|
7
27
|
parameters: {
|
|
8
28
|
layout: string;
|
|
@@ -21,4 +41,3 @@ export declare const WithRightIconAndClickEvent: Story;
|
|
|
21
41
|
export declare const WithBothIcons: Story;
|
|
22
42
|
export declare const WithInfoMessage: Story;
|
|
23
43
|
export declare const WithErrorMessage: Story;
|
|
24
|
-
export declare const Textarea: Story;
|
|
@@ -4,7 +4,27 @@ declare const meta: {
|
|
|
4
4
|
title: string;
|
|
5
5
|
component: ({ classNameWrapper, triggerDelay, value, onChange, ...rest }: {
|
|
6
6
|
triggerDelay?: number | undefined;
|
|
7
|
-
} &
|
|
7
|
+
} & import('react').InputHTMLAttributes<HTMLInputElement> & {
|
|
8
|
+
label?: string | undefined;
|
|
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;
|
|
15
|
+
classNameWrapper?: string | undefined;
|
|
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;
|
|
27
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
8
28
|
tags: string[];
|
|
9
29
|
parameters: {
|
|
10
30
|
layout: string;
|
|
@@ -4,7 +4,7 @@ declare const meta: {
|
|
|
4
4
|
title: string;
|
|
5
5
|
component: ({ invert, classNames }: import('./LoadingSpinner').LoadingSpinnerProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
tags: string[];
|
|
7
|
-
decorators: ((Story: import('@storybook/
|
|
7
|
+
decorators: ((Story: import('@storybook/types').PartialStoryFn<import('@storybook/react').ReactRenderer, {
|
|
8
8
|
invert?: boolean | undefined;
|
|
9
9
|
classNames?: string | undefined;
|
|
10
10
|
}>) => import("react/jsx-runtime").JSX.Element)[];
|
|
@@ -1,85 +1,85 @@
|
|
|
1
1
|
import '../../assets/PageHeader.css';
|
|
2
|
-
import { jsx as a, jsxs as
|
|
2
|
+
import { jsx as a, jsxs as h } from "react/jsx-runtime";
|
|
3
3
|
import { useMemo as L } from "react";
|
|
4
|
-
import { c as
|
|
4
|
+
import { c as n } from "../../clsx-DB4S2d7J.js";
|
|
5
5
|
import { Icon as B } from "../Icon/Icon.js";
|
|
6
6
|
import { IconButton as C } from "../IconButton/IconButton.js";
|
|
7
|
-
const j = "
|
|
8
|
-
"u-typography-h1": "_u-typography-
|
|
9
|
-
"u-typography-h2": "_u-typography-
|
|
10
|
-
"u-typography-h3": "_u-typography-
|
|
11
|
-
"u-typography-h4": "_u-typography-
|
|
12
|
-
"page-header__main-left-content": "_page-header__main-left-
|
|
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
13
|
title: j,
|
|
14
|
-
"u-typography-h5": "_u-typography-
|
|
15
|
-
"u-typography-h6": "_u-typography-
|
|
16
|
-
"u-typography-base": "_u-typography-
|
|
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
17
|
subtitle: w,
|
|
18
|
-
"u-typography-base--xxl": "_u-typography-base--
|
|
19
|
-
"u-typography-base--xl": "_u-typography-base--
|
|
20
|
-
"u-typography-base--lg": "_u-typography-base--
|
|
21
|
-
"u-typography-base--sm": "_u-typography-base--
|
|
22
|
-
"u-typography-base--bold": "_u-typography-base--
|
|
23
|
-
"u-typography-base--strikethrough": "_u-typography-base--
|
|
24
|
-
"u-typography-base--underlined": "_u-typography-base--
|
|
25
|
-
"u-typography-base--strikethrough-underlined": "_u-typography-base--strikethrough-
|
|
26
|
-
"page-header": "_page-
|
|
27
|
-
"page-header__top-content": "_page-header__top-
|
|
28
|
-
"page-header__main-content": "_page-header__main-
|
|
29
|
-
"page-header__bottom-content": "_page-header__bottom-
|
|
30
|
-
"page-header__breadcrumb": "_page-
|
|
31
|
-
"page-header__breadcrumb__separator": "_page-
|
|
32
|
-
"page-header__main-right-content": "_page-header__main-right-
|
|
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
33
|
}, P = ({
|
|
34
|
-
title:
|
|
35
|
-
subtitle:
|
|
36
|
-
rightChildren:
|
|
37
|
-
bottomChildren:
|
|
38
|
-
classNameWrapper:
|
|
39
|
-
classNameTitle:
|
|
40
|
-
classNameSubtitle:
|
|
34
|
+
title: l,
|
|
35
|
+
subtitle: g,
|
|
36
|
+
rightChildren: d,
|
|
37
|
+
bottomChildren: b,
|
|
38
|
+
classNameWrapper: y,
|
|
39
|
+
classNameTitle: u,
|
|
40
|
+
classNameSubtitle: z,
|
|
41
41
|
"data-testid-wrapper": m,
|
|
42
|
-
"data-testid-title":
|
|
42
|
+
"data-testid-title": k,
|
|
43
43
|
"data-testid-subtitle": N,
|
|
44
44
|
...f
|
|
45
45
|
}) => {
|
|
46
46
|
const {
|
|
47
|
-
breadcrumb:
|
|
48
|
-
backLinkText:
|
|
49
|
-
onBackLinkClick:
|
|
50
|
-
classNameBackLink:
|
|
51
|
-
"data-testid-backLink":
|
|
47
|
+
breadcrumb: r,
|
|
48
|
+
backLinkText: p,
|
|
49
|
+
onBackLinkClick: s,
|
|
50
|
+
classNameBackLink: c,
|
|
51
|
+
"data-testid-backLink": i,
|
|
52
52
|
...x
|
|
53
53
|
} = f, v = L(() => {
|
|
54
|
-
const
|
|
55
|
-
return
|
|
56
|
-
label:
|
|
57
|
-
className:
|
|
58
|
-
"data-testid":
|
|
59
|
-
onClick:
|
|
60
|
-
}),
|
|
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
61
|
C,
|
|
62
62
|
{
|
|
63
|
-
icon:
|
|
63
|
+
icon: o === 0 ? /* @__PURE__ */ a(B, { icon: "arrow-left" }) : /* @__PURE__ */ a("span", { className: e["page-header__breadcrumb__separator"], children: "/" }),
|
|
64
64
|
onClick: () => t.onClick && t.onClick(),
|
|
65
65
|
className: t.className,
|
|
66
66
|
"data-testid": t["data-testid"],
|
|
67
|
-
disabled:
|
|
67
|
+
disabled: _.length === 1 ? !1 : o === _.length - 1,
|
|
68
68
|
children: t.label
|
|
69
69
|
},
|
|
70
|
-
`${t.label}_${
|
|
70
|
+
`${t.label}_${o}`
|
|
71
71
|
)) }) });
|
|
72
|
-
}, [
|
|
73
|
-
return /* @__PURE__ */
|
|
72
|
+
}, [r, p, c, i, s]);
|
|
73
|
+
return /* @__PURE__ */ h("div", { className: n([e["page-header"], y]), "data-testid": m, ...x, children: [
|
|
74
74
|
v,
|
|
75
|
-
/* @__PURE__ */
|
|
76
|
-
/* @__PURE__ */
|
|
77
|
-
/* @__PURE__ */ a("h1", { className:
|
|
78
|
-
/* @__PURE__ */ a("h2", { className:
|
|
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
79
|
] }),
|
|
80
|
-
|
|
80
|
+
d && /* @__PURE__ */ a("div", { className: e["page-header__main-right-content"], children: d })
|
|
81
81
|
] }),
|
|
82
|
-
|
|
82
|
+
b && /* @__PURE__ */ a("div", { className: e["page-header__bottom-content"], children: b })
|
|
83
83
|
] });
|
|
84
84
|
};
|
|
85
85
|
export {
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { UsePaginationProps } from './usePagination';
|
|
2
|
-
|
|
3
1
|
export type PaginationParams = {
|
|
4
2
|
/** Total number of items to paginate */
|
|
5
3
|
totalItems: number;
|
|
@@ -55,11 +53,9 @@ export type PaginationProps = {
|
|
|
55
53
|
language?: PaginationLanguages;
|
|
56
54
|
/** Custom translation object to be used for texts. */
|
|
57
55
|
t?: Partial<PaginationTranslations>;
|
|
58
|
-
/** usePagination hook props */
|
|
59
|
-
usePaginationProps?: UsePaginationProps;
|
|
60
56
|
} & PaginationParams & PaginationCommonProps;
|
|
61
57
|
export declare const paginationDefaultTranslations: {
|
|
62
58
|
[key in PaginationLanguages]: PaginationTranslations;
|
|
63
59
|
};
|
|
64
|
-
export declare const Pagination: ({ perPageOptions, language,
|
|
60
|
+
export declare const Pagination: ({ perPageOptions, language, ...props }: PaginationProps) => import("react/jsx-runtime").JSX.Element;
|
|
65
61
|
export {};
|
|
@@ -1,33 +1,129 @@
|
|
|
1
1
|
import '../../assets/Pagination.css';
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { c as
|
|
4
|
-
import { Select as
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
2
|
+
import { jsxs as c, Fragment as w, jsx as r } from "react/jsx-runtime";
|
|
3
|
+
import { c as y } from "../../clsx-DB4S2d7J.js";
|
|
4
|
+
import { Select as L } from "../Select/Select.js";
|
|
5
|
+
import { _ as A, b as E } from "../../index-CH45lKw7.js";
|
|
6
|
+
import { u as $ } from "../../useControlled-CCMYYdCM.js";
|
|
7
|
+
const R = ["boundaryCount", "componentName", "count", "defaultPage", "disabled", "hideNextButton", "hidePrevButton", "onChange", "page", "showFirstButton", "showLastButton", "siblingCount"];
|
|
8
|
+
function T(u = {}) {
|
|
9
|
+
const {
|
|
10
|
+
boundaryCount: s = 1,
|
|
11
|
+
componentName: e = "usePagination",
|
|
12
|
+
count: i = 1,
|
|
13
|
+
defaultPage: P = 1,
|
|
14
|
+
disabled: b = !1,
|
|
15
|
+
hideNextButton: v = !1,
|
|
16
|
+
hidePrevButton: l = !1,
|
|
17
|
+
onChange: f,
|
|
18
|
+
page: p,
|
|
19
|
+
showFirstButton: m = !1,
|
|
20
|
+
showLastButton: j = !1,
|
|
21
|
+
siblingCount: _ = 1
|
|
22
|
+
} = u, n = A(u, R), [t, C] = $({
|
|
23
|
+
controlled: p,
|
|
24
|
+
default: P,
|
|
25
|
+
name: e,
|
|
26
|
+
state: "page"
|
|
27
|
+
}), x = (a, g) => {
|
|
28
|
+
p || C(g), f && f(a, g);
|
|
29
|
+
}, h = (a, g) => {
|
|
30
|
+
const D = g - a + 1;
|
|
31
|
+
return Array.from({
|
|
32
|
+
length: D
|
|
33
|
+
}, (z, F) => a + F);
|
|
34
|
+
}, d = h(1, Math.min(s, i)), N = h(Math.max(i - s + 1, s + 1), i), I = Math.max(
|
|
35
|
+
Math.min(
|
|
36
|
+
// Natural start
|
|
37
|
+
t - _,
|
|
38
|
+
// Lower boundary when page is high
|
|
39
|
+
i - s - _ * 2 - 1
|
|
40
|
+
),
|
|
41
|
+
// Greater than startPages
|
|
42
|
+
s + 2
|
|
43
|
+
), B = Math.min(
|
|
44
|
+
Math.max(
|
|
45
|
+
// Natural end
|
|
46
|
+
t + _,
|
|
47
|
+
// Upper boundary when page is low
|
|
48
|
+
s + _ * 2 + 2
|
|
49
|
+
),
|
|
50
|
+
// Less than endPages
|
|
51
|
+
N.length > 0 ? N[0] - 2 : i - 1
|
|
52
|
+
), M = [
|
|
53
|
+
...m ? ["first"] : [],
|
|
54
|
+
...l ? [] : ["previous"],
|
|
55
|
+
...d,
|
|
56
|
+
// Start ellipsis
|
|
57
|
+
// eslint-disable-next-line no-nested-ternary
|
|
58
|
+
...I > s + 2 ? ["start-ellipsis"] : s + 1 < i - s ? [s + 1] : [],
|
|
59
|
+
// Sibling pages
|
|
60
|
+
...h(I, B),
|
|
61
|
+
// End ellipsis
|
|
62
|
+
// eslint-disable-next-line no-nested-ternary
|
|
63
|
+
...B < i - s - 1 ? ["end-ellipsis"] : i - s > s ? [i - s] : [],
|
|
64
|
+
...N,
|
|
65
|
+
...v ? [] : ["next"],
|
|
66
|
+
...j ? ["last"] : []
|
|
67
|
+
], k = (a) => {
|
|
68
|
+
switch (a) {
|
|
69
|
+
case "first":
|
|
70
|
+
return 1;
|
|
71
|
+
case "previous":
|
|
72
|
+
return t - 1;
|
|
73
|
+
case "next":
|
|
74
|
+
return t + 1;
|
|
75
|
+
case "last":
|
|
76
|
+
return i;
|
|
77
|
+
default:
|
|
78
|
+
return null;
|
|
79
|
+
}
|
|
80
|
+
}, S = M.map((a) => typeof a == "number" ? {
|
|
81
|
+
onClick: (g) => {
|
|
82
|
+
x(g, a);
|
|
83
|
+
},
|
|
84
|
+
type: "page",
|
|
85
|
+
page: a,
|
|
86
|
+
selected: a === t,
|
|
87
|
+
disabled: b,
|
|
88
|
+
"aria-current": a === t ? "true" : void 0
|
|
89
|
+
} : {
|
|
90
|
+
onClick: (g) => {
|
|
91
|
+
x(g, k(a));
|
|
92
|
+
},
|
|
93
|
+
type: a,
|
|
94
|
+
page: k(a),
|
|
95
|
+
selected: !1,
|
|
96
|
+
disabled: b || a.indexOf("ellipsis") === -1 && (a === "next" || a === "last" ? t >= i : t <= 1)
|
|
97
|
+
});
|
|
98
|
+
return E({
|
|
99
|
+
items: S
|
|
100
|
+
}, n);
|
|
101
|
+
}
|
|
102
|
+
const W = "_pagination_19imj_43", o = {
|
|
103
|
+
"u-typography-h1": "_u-typography-h1_19imj_1",
|
|
104
|
+
"u-typography-h2": "_u-typography-h2_19imj_8",
|
|
105
|
+
"u-typography-h3": "_u-typography-h3_19imj_15",
|
|
106
|
+
"u-typography-h4": "_u-typography-h4_19imj_22",
|
|
107
|
+
"u-typography-h5": "_u-typography-h5_19imj_29",
|
|
108
|
+
"u-typography-h6": "_u-typography-h6_19imj_36",
|
|
109
|
+
"u-typography-base": "_u-typography-base_19imj_43",
|
|
110
|
+
pagination: W,
|
|
111
|
+
"per-page-container": "_per-page-container_19imj_43",
|
|
112
|
+
"u-typography-base--xxl": "_u-typography-base--xxl_19imj_48",
|
|
113
|
+
"u-typography-base--xl": "_u-typography-base--xl_19imj_52",
|
|
114
|
+
"u-typography-base--lg": "_u-typography-base--lg_19imj_56",
|
|
115
|
+
"u-typography-base--sm": "_u-typography-base--sm_19imj_60",
|
|
116
|
+
"u-typography-base--bold": "_u-typography-base--bold_19imj_64",
|
|
117
|
+
"u-typography-base--strikethrough": "_u-typography-base--strikethrough_19imj_67",
|
|
118
|
+
"u-typography-base--underlined": "_u-typography-base--underlined_19imj_70",
|
|
119
|
+
"u-typography-base--strikethrough-underlined": "_u-typography-base--strikethrough-underlined_19imj_73",
|
|
120
|
+
"per-page-container__select": "_per-page-container__select_19imj_90",
|
|
121
|
+
"pages-navigator-container": "_pages-navigator-container_19imj_97",
|
|
122
|
+
"page-item": "_page-item_19imj_114",
|
|
123
|
+
"page-number__btn": "_page-number__btn_19imj_114",
|
|
124
|
+
"pages-navigator-container__previous-next-btn": "_pages-navigator-container__previous-next-btn_19imj_133",
|
|
125
|
+
"page-number__btn--selected": "_page-number__btn--selected_19imj_158"
|
|
126
|
+
}, q = {
|
|
31
127
|
pt: {
|
|
32
128
|
showing: "Exibindo",
|
|
33
129
|
of: "de",
|
|
@@ -44,106 +140,108 @@ const w = "_pagination_2n0nk_43", a = {
|
|
|
44
140
|
next: "Next",
|
|
45
141
|
perPage: "Items per page"
|
|
46
142
|
}
|
|
47
|
-
},
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
usePaginationProps: b = {},
|
|
51
|
-
...e
|
|
52
|
-
}) => {
|
|
53
|
-
const l = Math.ceil(e.totalItems / e.perPage), m = e.currentPage <= 1, k = e.currentPage >= l, v = { ...B[y], ...e.t || {} }, i = (n) => v[n], { items: x } = C({
|
|
54
|
-
count: l,
|
|
55
|
-
page: e.currentPage,
|
|
143
|
+
}, U = ({ perPageOptions: u = [5, 10, 25, 50, 100], language: s = "en", ...e }) => {
|
|
144
|
+
const i = Math.ceil(e.totalItems / e.perPage), P = e.currentPage <= 1, b = e.currentPage >= i, v = { ...q[s], ...e.t || {} }, l = (n) => v[n], { items: f } = T({
|
|
145
|
+
count: i,
|
|
56
146
|
hideNextButton: !0,
|
|
57
147
|
hidePrevButton: !0,
|
|
148
|
+
page: e.currentPage,
|
|
58
149
|
siblingCount: 1,
|
|
59
150
|
boundaryCount: 2,
|
|
60
|
-
|
|
61
|
-
}),
|
|
62
|
-
return /* @__PURE__ */
|
|
63
|
-
/* @__PURE__ */
|
|
151
|
+
onChange: (n, t) => e.onPageChange(t)
|
|
152
|
+
}), p = e.perPage * (e.currentPage - 1) + 1, m = p + e.perPage - 1, j = m > e.totalItems ? m - e.totalItems : 0, _ = m - j;
|
|
153
|
+
return /* @__PURE__ */ c("div", { className: y(o.pagination, e.className), "data-testid": e["data-testid"], children: [
|
|
154
|
+
/* @__PURE__ */ c(
|
|
64
155
|
"div",
|
|
65
156
|
{
|
|
66
|
-
className:
|
|
157
|
+
className: y(o["per-page-container"], e.classNamePerPage),
|
|
67
158
|
"data-testid": e["data-testid-per-page"],
|
|
68
159
|
children: [
|
|
69
|
-
|
|
70
|
-
/* @__PURE__ */
|
|
71
|
-
/* @__PURE__ */
|
|
72
|
-
|
|
160
|
+
u && /* @__PURE__ */ c(w, { children: [
|
|
161
|
+
/* @__PURE__ */ r("span", { children: l`perPage` }),
|
|
162
|
+
/* @__PURE__ */ r(
|
|
163
|
+
L,
|
|
73
164
|
{
|
|
74
|
-
className:
|
|
165
|
+
className: o["per-page-container__select"],
|
|
75
166
|
value: String(e.perPage),
|
|
76
167
|
onChange: (n) => e.onRowsPerPageChange(Number(n)),
|
|
77
|
-
children:
|
|
78
|
-
const
|
|
79
|
-
return /* @__PURE__ */
|
|
80
|
-
|
|
168
|
+
children: u == null ? void 0 : u.map((n) => {
|
|
169
|
+
const t = typeof n == "number";
|
|
170
|
+
return /* @__PURE__ */ r(
|
|
171
|
+
L.Option,
|
|
81
172
|
{
|
|
82
|
-
value: String(
|
|
83
|
-
children:
|
|
173
|
+
value: String(t ? n : n.value),
|
|
174
|
+
children: t ? n : n.label
|
|
84
175
|
},
|
|
85
|
-
`per-page__${
|
|
176
|
+
`per-page__${t ? n : n.value}`
|
|
86
177
|
);
|
|
87
178
|
})
|
|
88
179
|
}
|
|
89
180
|
)
|
|
90
181
|
] }),
|
|
91
|
-
/* @__PURE__ */
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
"
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
182
|
+
/* @__PURE__ */ c(
|
|
183
|
+
"div",
|
|
184
|
+
{
|
|
185
|
+
className: y(o["page-infos"], e.classNamePagesInfo),
|
|
186
|
+
"data-testid": e["data-testid-pages-info"],
|
|
187
|
+
children: [
|
|
188
|
+
/* @__PURE__ */ c("span", { children: [
|
|
189
|
+
p,
|
|
190
|
+
" - ",
|
|
191
|
+
_
|
|
192
|
+
] }),
|
|
193
|
+
" ",
|
|
194
|
+
/* @__PURE__ */ c("span", { children: [
|
|
195
|
+
l`of`,
|
|
196
|
+
" ",
|
|
197
|
+
/* @__PURE__ */ r("strong", { children: e.totalItems }),
|
|
198
|
+
" ",
|
|
199
|
+
l`results`
|
|
200
|
+
] })
|
|
201
|
+
]
|
|
202
|
+
}
|
|
203
|
+
)
|
|
106
204
|
]
|
|
107
205
|
}
|
|
108
206
|
),
|
|
109
|
-
/* @__PURE__ */
|
|
207
|
+
/* @__PURE__ */ c(
|
|
110
208
|
"div",
|
|
111
209
|
{
|
|
112
|
-
className:
|
|
210
|
+
className: y(o["pages-navigator-container"], e.classNamePagesNav),
|
|
113
211
|
"data-testid": e["data-testid-pages-nav"],
|
|
114
212
|
children: [
|
|
115
|
-
/* @__PURE__ */
|
|
213
|
+
/* @__PURE__ */ r(
|
|
116
214
|
"button",
|
|
117
215
|
{
|
|
118
|
-
className:
|
|
119
|
-
disabled:
|
|
216
|
+
className: o["pages-navigator-container__previous-next-btn"],
|
|
217
|
+
disabled: P,
|
|
120
218
|
onClick: () => e.onPageChange(e.currentPage - 1),
|
|
121
219
|
type: "button",
|
|
122
|
-
children:
|
|
220
|
+
children: l`previous`
|
|
123
221
|
},
|
|
124
222
|
"page__previous"
|
|
125
223
|
),
|
|
126
|
-
/* @__PURE__ */
|
|
127
|
-
let
|
|
128
|
-
return
|
|
224
|
+
/* @__PURE__ */ r("ul", { children: f.map(({ page: n, type: t, selected: C, ...x }, h) => {
|
|
225
|
+
let d = /* @__PURE__ */ r(w, {});
|
|
226
|
+
return t === "start-ellipsis" || t === "end-ellipsis" ? d = /* @__PURE__ */ r("span", { className: o["page-item"], children: "..." }) : t === "page" ? d = /* @__PURE__ */ r(
|
|
129
227
|
"button",
|
|
130
228
|
{
|
|
131
|
-
className:
|
|
229
|
+
className: y(o["page-number__btn"], C && o["page-number__btn--selected"]),
|
|
132
230
|
onClick: () => e.onPageChange(n || 0),
|
|
133
231
|
type: "button",
|
|
134
232
|
children: n
|
|
135
233
|
},
|
|
136
234
|
`page__${h}`
|
|
137
|
-
) :
|
|
235
|
+
) : d = /* @__PURE__ */ r("button", { type: "button", ...x, children: t }), /* @__PURE__ */ r("li", { children: d }, h);
|
|
138
236
|
}) }),
|
|
139
|
-
/* @__PURE__ */
|
|
237
|
+
/* @__PURE__ */ r(
|
|
140
238
|
"button",
|
|
141
239
|
{
|
|
142
|
-
className:
|
|
143
|
-
disabled:
|
|
240
|
+
className: o["pages-navigator-container__previous-next-btn"],
|
|
241
|
+
disabled: b,
|
|
144
242
|
onClick: () => e.onPageChange(e.currentPage + 1),
|
|
145
243
|
type: "button",
|
|
146
|
-
children:
|
|
244
|
+
children: l`next`
|
|
147
245
|
},
|
|
148
246
|
"page__next"
|
|
149
247
|
)
|
|
@@ -153,6 +251,6 @@ const w = "_pagination_2n0nk_43", a = {
|
|
|
153
251
|
] });
|
|
154
252
|
};
|
|
155
253
|
export {
|
|
156
|
-
|
|
157
|
-
|
|
254
|
+
U as Pagination,
|
|
255
|
+
q as paginationDefaultTranslations
|
|
158
256
|
};
|
|
@@ -3,7 +3,7 @@ import { StoryObj } from '@storybook/react';
|
|
|
3
3
|
|
|
4
4
|
declare const meta: {
|
|
5
5
|
title: string;
|
|
6
|
-
component: ({ perPageOptions, language,
|
|
6
|
+
component: ({ perPageOptions, language, ...props }: PaginationProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
tags: string[];
|
|
8
8
|
parameters: {
|
|
9
9
|
layout: string;
|
|
@@ -15,30 +15,9 @@ export type SelectProps = {
|
|
|
15
15
|
placeholder?: string;
|
|
16
16
|
prefix?: string;
|
|
17
17
|
className?: string;
|
|
18
|
-
id?: string;
|
|
19
18
|
value?: string;
|
|
20
|
-
label?: string;
|
|
21
|
-
classNameWrapper?: string;
|
|
22
|
-
classNameLabel?: string;
|
|
23
|
-
testIdLabel?: string;
|
|
24
|
-
testIdWrapper?: string;
|
|
25
19
|
'data-testid'?: string;
|
|
26
20
|
onChange?: (value: string | null, event?: React.SyntheticEvent<Element, Event> | null) => void;
|
|
27
|
-
fullWidth?: boolean;
|
|
28
|
-
/** Info message text */
|
|
29
|
-
infoMessage?: string;
|
|
30
|
-
/** Show the field layout as an error */
|
|
31
|
-
error?: boolean;
|
|
32
|
-
/** Error message text, if has "errorMessage", the "error" props will be "true" */
|
|
33
|
-
errorMessage?: string;
|
|
34
|
-
/** CSS classes to be applied on the info message element */
|
|
35
|
-
classNameInfoMessage?: string;
|
|
36
|
-
/** CSS classes to be applied on the error message element */
|
|
37
|
-
classNameErrorMessage?: string;
|
|
38
|
-
/** Id to be applied as `data-testid` on the info message element */
|
|
39
|
-
'data-testid-infoMessage'?: string;
|
|
40
|
-
/** Id to be applied as `data-testid` on the error message element */
|
|
41
|
-
'data-testid-errorMessage'?: string;
|
|
42
21
|
};
|
|
43
22
|
declare const Select: {
|
|
44
23
|
(props: SelectProps): import("react/jsx-runtime").JSX.Element;
|