@pismo/marola 1.0.0-beta.19 → 1.0.0-beta.2
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-DiLqcAJG.js → Button-2b1peDFT.js} +2 -2
- package/dist/{ClickAwayListener-BaJ-OV_7.js → ClickAwayListener-BSW-Nd-y.js} +3 -4
- package/dist/Dialog.module-DFEmFdYT.js +30 -0
- package/dist/{Popup-lLWZt2wk.js → Popup-B6ZSGIEI.js} +3 -3
- package/dist/{Portal-B_Es6eUL.js → Portal-DIeBsWdL.js} +2 -2
- package/dist/SelectButton-C8JQKaf4.js +61 -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/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/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 -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-BtBYUV_B.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 +5 -6
- package/dist/components/Chip/Chip.stories.d.ts +14 -5
- 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 +6 -9
- package/dist/components/Dialog/Dialog.js +162 -162
- package/dist/components/Dialog/Dialog.stories.d.ts +46 -50
- package/dist/components/Dialog/DialogTitle.js +1 -1
- package/dist/components/EllipsisTooltip/EllipsisTooltip.js +17 -30
- package/dist/components/EllipsisTooltip/EllipsisTooltip.stories.d.ts +1 -2
- package/dist/components/Icon/Icon.js +34 -52
- package/dist/components/Icon/types.d.ts +1 -1
- package/dist/components/IconButton/IconButton.js +42 -42
- package/dist/components/Input/Input.d.ts +2 -4
- package/dist/components/Input/Input.js +471 -74
- package/dist/components/Input/Input.stories.d.ts +1 -1
- package/dist/components/InputSearch/InputSearch.stories.d.ts +1 -1
- package/dist/components/PageHeader/PageHeader.js +57 -57
- package/dist/components/Pagination/Pagination.d.ts +1 -7
- package/dist/components/Pagination/Pagination.js +182 -104
- package/dist/components/Select/Select.js +8 -9
- package/dist/components/Select/SelectButton.js +1 -1
- package/dist/components/Skeleton/Skeleton.d.ts +1 -3
- package/dist/components/Skeleton/Skeleton.js +12 -18
- 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 +3 -3
- 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 +85 -88
- package/dist/components/Table/Table.stories.d.ts +1 -1
- package/dist/components/Tabs/Tab.js +17 -18
- package/dist/components/Tabs/TabPanel.js +26 -27
- package/dist/components/Tabs/Tabs.js +25 -25
- package/dist/components/TextDisplay/TextDisplay.d.ts +1 -3
- package/dist/components/TextDisplay/TextDisplay.js +28 -42
- package/dist/components/TextDisplay/TextDisplay.stories.d.ts +1 -2
- package/dist/components/Toggle/Toggle.js +56 -56
- package/dist/components/ToggleGroup/Toggle.js +3 -3
- package/dist/components/ToggleGroup/ToggleGroup.js +1 -1
- 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 +0 -1
- package/dist/components/Typography/Typography.js +47 -47
- package/dist/{useSlotProps-kRhf7Gil.js → index-CH45lKw7.js} +94 -93
- package/dist/{index-D3Wj0eid.js → index-CjW42-M-.js} +1 -1
- package/dist/main.d.ts +0 -5
- package/dist/main.js +76 -85
- package/dist/{useButton-Bn3MNH8I.js → useButton-DNk3wrQp.js} +1 -1
- package/dist/useCompoundItem-D1iRfg8D.js +84 -0
- package/dist/useEventCallback-xTG9piMa.js +45 -0
- package/dist/{useList-BpJT77u3.js → useList-B0hog_3-.js} +2 -2
- package/package.json +3 -8
- package/dist/Dialog.module-D9e4RsKo.js +0 -30
- package/dist/Input.module-ZTRZRcNt.js +0 -405
- package/dist/SelectButton-CoOT2txy.js +0 -61
- package/dist/Toggle-CRfZgFJp.js +0 -181
- package/dist/assets/Adornment.css +0 -1
- package/dist/assets/Autocomplete.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 -52
- package/dist/components/Autocomplete/Autocomplete.js +0 -690
- package/dist/components/Autocomplete/Autocomplete.stories.d.ts +0 -46
- package/dist/components/Pagination/usePagination.d.ts +0 -90
- package/dist/components/Pagination/usePagination.js +0 -79
- 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 -19
- 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 -43
- package/dist/components/StepperNavigator/StepperNavigator.js +0 -56
- package/dist/components/StepperNavigator/StepperNavigator.stories.d.ts +0 -16
- package/dist/components/StepperNavigator/StepperNavigator.test.d.ts +0 -1
- package/dist/ownerDocument-B61GUaFs.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
|
@@ -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 {
|
|
@@ -17,8 +17,6 @@ export type PaginationTranslations = {
|
|
|
17
17
|
previous: string;
|
|
18
18
|
/** Translation text for `next` */
|
|
19
19
|
next: string;
|
|
20
|
-
/** Translation text for `perPage` */
|
|
21
|
-
perPage: string;
|
|
22
20
|
};
|
|
23
21
|
type PaginationLanguages = 'pt' | 'en';
|
|
24
22
|
type PaginationCommonProps = {
|
|
@@ -26,16 +24,12 @@ type PaginationCommonProps = {
|
|
|
26
24
|
className?: string;
|
|
27
25
|
/** CSS classes to be applied on the per page element */
|
|
28
26
|
classNamePerPage?: string;
|
|
29
|
-
/** CSS classes to be applied on the pages info element */
|
|
30
|
-
classNamePagesInfo?: string;
|
|
31
27
|
/** CSS classes to be applied on the pages navigation element */
|
|
32
28
|
classNamePagesNav?: string;
|
|
33
29
|
/** Id to be applied as `data-testid` on the container element */
|
|
34
30
|
'data-testid'?: string;
|
|
35
31
|
/** Id to be applied as `data-testid` on per page element */
|
|
36
32
|
'data-testid-per-page'?: string;
|
|
37
|
-
/** Id to be applied as `data-testid` on the pages info element */
|
|
38
|
-
'data-testid-pages-info'?: string;
|
|
39
33
|
/** Id to be applied as `data-testid` on the pages navigation element */
|
|
40
34
|
'data-testid-pages-nav'?: string;
|
|
41
35
|
};
|
|
@@ -52,7 +46,7 @@ export type PaginationProps = {
|
|
|
52
46
|
/** Language to be used for texts. */
|
|
53
47
|
language?: PaginationLanguages;
|
|
54
48
|
/** Custom translation object to be used for texts. */
|
|
55
|
-
t?:
|
|
49
|
+
t?: PaginationTranslations;
|
|
56
50
|
} & PaginationParams & PaginationCommonProps;
|
|
57
51
|
export declare const paginationDefaultTranslations: {
|
|
58
52
|
[key in PaginationLanguages]: PaginationTranslations;
|
|
@@ -1,150 +1,228 @@
|
|
|
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 m, jsx as i, Fragment as k } from "react/jsx-runtime";
|
|
3
|
+
import { c as y } from "../../clsx-DB4S2d7J.js";
|
|
4
|
+
import { Select as w } 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(l = {}) {
|
|
9
|
+
const {
|
|
10
|
+
boundaryCount: n = 1,
|
|
11
|
+
componentName: e = "usePagination",
|
|
12
|
+
count: s = 1,
|
|
13
|
+
defaultPage: b = 1,
|
|
14
|
+
disabled: c = !1,
|
|
15
|
+
hideNextButton: x = !1,
|
|
16
|
+
hidePrevButton: _ = !1,
|
|
17
|
+
onChange: p,
|
|
18
|
+
page: t,
|
|
19
|
+
showFirstButton: r = !1,
|
|
20
|
+
showLastButton: f = !1,
|
|
21
|
+
siblingCount: h = 1
|
|
22
|
+
} = l, d = A(l, R), [o, M] = $({
|
|
23
|
+
controlled: t,
|
|
24
|
+
default: b,
|
|
25
|
+
name: e,
|
|
26
|
+
state: "page"
|
|
27
|
+
}), C = (a, g) => {
|
|
28
|
+
t || M(g), p && p(a, g);
|
|
29
|
+
}, v = (a, g) => {
|
|
30
|
+
const F = g - a + 1;
|
|
31
|
+
return Array.from({
|
|
32
|
+
length: F
|
|
33
|
+
}, (z, I) => a + I);
|
|
34
|
+
}, S = v(1, Math.min(n, s)), j = v(Math.max(s - n + 1, n + 1), s), P = Math.max(
|
|
35
|
+
Math.min(
|
|
36
|
+
// Natural start
|
|
37
|
+
o - h,
|
|
38
|
+
// Lower boundary when page is high
|
|
39
|
+
s - n - h * 2 - 1
|
|
40
|
+
),
|
|
41
|
+
// Greater than startPages
|
|
42
|
+
n + 2
|
|
43
|
+
), N = Math.min(
|
|
44
|
+
Math.max(
|
|
45
|
+
// Natural end
|
|
46
|
+
o + h,
|
|
47
|
+
// Upper boundary when page is low
|
|
48
|
+
n + h * 2 + 2
|
|
49
|
+
),
|
|
50
|
+
// Less than endPages
|
|
51
|
+
j.length > 0 ? j[0] - 2 : s - 1
|
|
52
|
+
), L = [
|
|
53
|
+
...r ? ["first"] : [],
|
|
54
|
+
..._ ? [] : ["previous"],
|
|
55
|
+
...S,
|
|
56
|
+
// Start ellipsis
|
|
57
|
+
// eslint-disable-next-line no-nested-ternary
|
|
58
|
+
...P > n + 2 ? ["start-ellipsis"] : n + 1 < s - n ? [n + 1] : [],
|
|
59
|
+
// Sibling pages
|
|
60
|
+
...v(P, N),
|
|
61
|
+
// End ellipsis
|
|
62
|
+
// eslint-disable-next-line no-nested-ternary
|
|
63
|
+
...N < s - n - 1 ? ["end-ellipsis"] : s - n > n ? [s - n] : [],
|
|
64
|
+
...j,
|
|
65
|
+
...x ? [] : ["next"],
|
|
66
|
+
...f ? ["last"] : []
|
|
67
|
+
], B = (a) => {
|
|
68
|
+
switch (a) {
|
|
69
|
+
case "first":
|
|
70
|
+
return 1;
|
|
71
|
+
case "previous":
|
|
72
|
+
return o - 1;
|
|
73
|
+
case "next":
|
|
74
|
+
return o + 1;
|
|
75
|
+
case "last":
|
|
76
|
+
return s;
|
|
77
|
+
default:
|
|
78
|
+
return null;
|
|
79
|
+
}
|
|
80
|
+
}, D = L.map((a) => typeof a == "number" ? {
|
|
81
|
+
onClick: (g) => {
|
|
82
|
+
C(g, a);
|
|
83
|
+
},
|
|
84
|
+
type: "page",
|
|
85
|
+
page: a,
|
|
86
|
+
selected: a === o,
|
|
87
|
+
disabled: c,
|
|
88
|
+
"aria-current": a === o ? "true" : void 0
|
|
89
|
+
} : {
|
|
90
|
+
onClick: (g) => {
|
|
91
|
+
C(g, B(a));
|
|
92
|
+
},
|
|
93
|
+
type: a,
|
|
94
|
+
page: B(a),
|
|
95
|
+
selected: !1,
|
|
96
|
+
disabled: c || a.indexOf("ellipsis") === -1 && (a === "next" || a === "last" ? o >= s : o <= 1)
|
|
97
|
+
});
|
|
98
|
+
return E({
|
|
99
|
+
items: D
|
|
100
|
+
}, d);
|
|
101
|
+
}
|
|
102
|
+
const W = "_pagination_19imj_43", u = {
|
|
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",
|
|
34
130
|
results: "resultados",
|
|
35
131
|
previous: "Anterior",
|
|
36
|
-
next: "Próximo"
|
|
37
|
-
perPage: "Itens por página"
|
|
132
|
+
next: "Próximo"
|
|
38
133
|
},
|
|
39
134
|
en: {
|
|
40
135
|
showing: "Showing",
|
|
41
136
|
of: "of",
|
|
42
137
|
results: "results",
|
|
43
138
|
previous: "Previous",
|
|
44
|
-
next: "Next"
|
|
45
|
-
perPage: "Items per page"
|
|
139
|
+
next: "Next"
|
|
46
140
|
}
|
|
47
|
-
},
|
|
48
|
-
const
|
|
49
|
-
count:
|
|
141
|
+
}, U = ({ perPageOptions: l = [5, 10, 25, 50, 100], language: n = "en", ...e }) => {
|
|
142
|
+
const s = Math.ceil(e.totalItems / e.perPage), b = e.currentPage <= 1, c = e.currentPage >= s, x = e.t || q[n], _ = (t) => x[t], { items: p } = T({
|
|
143
|
+
count: s,
|
|
50
144
|
hideNextButton: !0,
|
|
51
145
|
hidePrevButton: !0,
|
|
52
146
|
page: e.currentPage,
|
|
53
147
|
siblingCount: 1,
|
|
54
|
-
boundaryCount: 2
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
148
|
+
boundaryCount: 2,
|
|
149
|
+
onChange: (t, r) => e.onPageChange(r)
|
|
150
|
+
});
|
|
151
|
+
return /* @__PURE__ */ m("div", { className: y(u.pagination, e.className), "data-testid": e["data-testid"], children: [
|
|
152
|
+
/* @__PURE__ */ i(
|
|
58
153
|
"div",
|
|
59
154
|
{
|
|
60
|
-
className:
|
|
155
|
+
className: y(u["per-page-container"], e.classNamePerPage),
|
|
61
156
|
"data-testid": e["data-testid-per-page"],
|
|
62
|
-
children: [
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
d,
|
|
67
|
-
{
|
|
68
|
-
className: a["per-page-container__select"],
|
|
69
|
-
value: String(e.perPage),
|
|
70
|
-
onChange: (n) => e.onRowsPerPageChange(Number(n)),
|
|
71
|
-
children: g == null ? void 0 : g.map((n) => {
|
|
72
|
-
const r = typeof n == "number";
|
|
73
|
-
return /* @__PURE__ */ t(
|
|
74
|
-
d.Option,
|
|
75
|
-
{
|
|
76
|
-
value: String(r ? n : n.value),
|
|
77
|
-
children: r ? n : n.label
|
|
78
|
-
},
|
|
79
|
-
`per-page__${r ? n : n.value}`
|
|
80
|
-
);
|
|
81
|
-
})
|
|
82
|
-
}
|
|
83
|
-
)
|
|
84
|
-
] }),
|
|
85
|
-
/* @__PURE__ */ s(
|
|
86
|
-
"div",
|
|
157
|
+
children: l && /* @__PURE__ */ m(k, { children: [
|
|
158
|
+
/* @__PURE__ */ i("span", { children: _`showing` }),
|
|
159
|
+
/* @__PURE__ */ i(
|
|
160
|
+
w,
|
|
87
161
|
{
|
|
88
|
-
className:
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
i`results`
|
|
103
|
-
] })
|
|
104
|
-
]
|
|
162
|
+
className: u["per-page-container__select"],
|
|
163
|
+
value: String(e.perPage),
|
|
164
|
+
onChange: (t) => e.onRowsPerPageChange(Number(t)),
|
|
165
|
+
children: l == null ? void 0 : l.map((t) => {
|
|
166
|
+
const r = typeof t == "number";
|
|
167
|
+
return /* @__PURE__ */ i(
|
|
168
|
+
w.Option,
|
|
169
|
+
{
|
|
170
|
+
value: String(r ? t : t.value),
|
|
171
|
+
children: r ? t : t.label
|
|
172
|
+
},
|
|
173
|
+
`per-page__${r ? t : t.value}`
|
|
174
|
+
);
|
|
175
|
+
})
|
|
105
176
|
}
|
|
106
|
-
)
|
|
107
|
-
|
|
177
|
+
),
|
|
178
|
+
/* @__PURE__ */ m("span", { children: [
|
|
179
|
+
_`of`,
|
|
180
|
+
" ",
|
|
181
|
+
/* @__PURE__ */ i("strong", { children: e.totalItems }),
|
|
182
|
+
" ",
|
|
183
|
+
_`results`
|
|
184
|
+
] })
|
|
185
|
+
] })
|
|
108
186
|
}
|
|
109
187
|
),
|
|
110
|
-
/* @__PURE__ */
|
|
188
|
+
/* @__PURE__ */ m(
|
|
111
189
|
"div",
|
|
112
190
|
{
|
|
113
|
-
className:
|
|
191
|
+
className: y(u["pages-navigator-container"], e.classNamePagesNav),
|
|
114
192
|
"data-testid": e["data-testid-pages-nav"],
|
|
115
193
|
children: [
|
|
116
|
-
/* @__PURE__ */
|
|
194
|
+
/* @__PURE__ */ i(
|
|
117
195
|
"button",
|
|
118
196
|
{
|
|
119
|
-
className:
|
|
197
|
+
className: u["pages-navigator-container__previous-next-btn"],
|
|
120
198
|
disabled: b,
|
|
121
199
|
onClick: () => e.onPageChange(e.currentPage - 1),
|
|
122
200
|
type: "button",
|
|
123
|
-
children:
|
|
201
|
+
children: _`previous`
|
|
124
202
|
},
|
|
125
203
|
"page__previous"
|
|
126
204
|
),
|
|
127
|
-
/* @__PURE__ */
|
|
128
|
-
let
|
|
129
|
-
return r === "start-ellipsis" || r === "end-ellipsis" ?
|
|
205
|
+
/* @__PURE__ */ i("ul", { children: p.map(({ page: t, type: r, selected: f, ...h }, d) => {
|
|
206
|
+
let o = /* @__PURE__ */ i(k, {});
|
|
207
|
+
return r === "start-ellipsis" || r === "end-ellipsis" ? o = /* @__PURE__ */ i("span", { className: u["page-item"], children: "..." }) : r === "page" ? o = /* @__PURE__ */ i(
|
|
130
208
|
"button",
|
|
131
209
|
{
|
|
132
|
-
className:
|
|
133
|
-
onClick: () => e.onPageChange(
|
|
210
|
+
className: y(u["page-number__btn"], f && u["page-number__btn--selected"]),
|
|
211
|
+
onClick: () => e.onPageChange(t || 0),
|
|
134
212
|
type: "button",
|
|
135
|
-
children:
|
|
213
|
+
children: t
|
|
136
214
|
},
|
|
137
|
-
`page__${
|
|
138
|
-
) :
|
|
215
|
+
`page__${d}`
|
|
216
|
+
) : o = /* @__PURE__ */ i("button", { type: "button", ...h, children: r }), /* @__PURE__ */ i("li", { children: o }, d);
|
|
139
217
|
}) }),
|
|
140
|
-
/* @__PURE__ */
|
|
218
|
+
/* @__PURE__ */ i(
|
|
141
219
|
"button",
|
|
142
220
|
{
|
|
143
|
-
className:
|
|
144
|
-
disabled:
|
|
221
|
+
className: u["pages-navigator-container__previous-next-btn"],
|
|
222
|
+
disabled: c,
|
|
145
223
|
onClick: () => e.onPageChange(e.currentPage + 1),
|
|
146
224
|
type: "button",
|
|
147
|
-
children:
|
|
225
|
+
children: _`next`
|
|
148
226
|
},
|
|
149
227
|
"page__next"
|
|
150
228
|
)
|
|
@@ -154,6 +232,6 @@ const C = "_pagination_2n0nk_43", a = {
|
|
|
154
232
|
] });
|
|
155
233
|
};
|
|
156
234
|
export {
|
|
157
|
-
|
|
158
|
-
|
|
235
|
+
U as Pagination,
|
|
236
|
+
q as paginationDefaultTranslations
|
|
159
237
|
};
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { jsx as h, jsxs as Oe } from "react/jsx-runtime";
|
|
2
2
|
import { c as _e } from "../../clsx-DB4S2d7J.js";
|
|
3
3
|
import { Typography as Ke } from "../Typography/Typography.js";
|
|
4
|
-
import { s as L, S as ze } from "../../SelectButton-
|
|
5
|
-
import { g as Ve, a as we, u as X, f as ne, b as g, P as l, _ as ke, c as le, d as Ie, e as Ne } from "../../
|
|
4
|
+
import { s as L, S as ze } from "../../SelectButton-C8JQKaf4.js";
|
|
5
|
+
import { g as Ve, a as we, u as X, f as ne, b as g, P as l, _ as ke, c as le, d as Ie, e as Ne } from "../../index-CH45lKw7.js";
|
|
6
6
|
import * as s from "react";
|
|
7
|
-
import { u as Je, c as se, a as ye, L as Q } from "../../combineHooksSlotProps-
|
|
8
|
-
import { u as Me } from "../../useButton-
|
|
9
|
-
import { u as Te } from "../../
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { m as ve, h as Ye, l as Ze, u as et } from "../../useList-BpJT77u3.js";
|
|
7
|
+
import { u as Je, c as se, a as ye, L as Q } from "../../combineHooksSlotProps-DVjg9PRh.js";
|
|
8
|
+
import { u as Me } from "../../useButton-DNk3wrQp.js";
|
|
9
|
+
import { u as Te, a as We, b as Ge, C as Qe } from "../../useCompoundItem-D1iRfg8D.js";
|
|
10
|
+
import { P as Xe } from "../../Popup-B6ZSGIEI.js";
|
|
11
|
+
import { m as ve, h as Ye, l as Ze, u as et } from "../../useList-B0hog_3-.js";
|
|
13
12
|
import { u as tt } from "../../useEnhancedEffect-CJGo-L3B.js";
|
|
14
13
|
const ot = {
|
|
15
14
|
border: 0,
|
|
@@ -845,7 +844,7 @@ const ht = (n) => {
|
|
|
845
844
|
slots: { root: ze },
|
|
846
845
|
slotProps: {
|
|
847
846
|
listbox: { className: L.select__listbox },
|
|
848
|
-
popup: { className: L.select__popup
|
|
847
|
+
popup: { className: L.select__popup }
|
|
849
848
|
},
|
|
850
849
|
children: o
|
|
851
850
|
}
|
|
@@ -2,7 +2,7 @@ import "react/jsx-runtime";
|
|
|
2
2
|
import "react";
|
|
3
3
|
import "../../clsx-DB4S2d7J.js";
|
|
4
4
|
import "../Typography/Typography.js";
|
|
5
|
-
import { S as e } from "../../SelectButton-
|
|
5
|
+
import { S as e } from "../../SelectButton-C8JQKaf4.js";
|
|
6
6
|
export {
|
|
7
7
|
e as SelectButton
|
|
8
8
|
};
|
|
@@ -20,8 +20,6 @@ export type SkeletonTableProps = SkeletonProps & {
|
|
|
20
20
|
rows?: number;
|
|
21
21
|
/** Controls if the with of the cells should be automatically defined */
|
|
22
22
|
autoWidth?: boolean;
|
|
23
|
-
/** Controls if show or not the skeleton of the table header */
|
|
24
|
-
showHeader?: boolean;
|
|
25
23
|
};
|
|
26
|
-
declare const SkeletonTable: ({ columns, rows, autoWidth,
|
|
24
|
+
declare const SkeletonTable: ({ columns, rows, autoWidth, ...props }: SkeletonTableProps) => import("react/jsx-runtime").JSX.Element;
|
|
27
25
|
export { Skeleton, SkeletonCircle, SkeletonTable };
|
|
@@ -1,29 +1,23 @@
|
|
|
1
1
|
import '../../assets/Skeleton.css';
|
|
2
|
-
import { jsx as t, jsxs as
|
|
2
|
+
import { jsx as t, jsxs as w } from "react/jsx-runtime";
|
|
3
3
|
import { c as r } from "../../clsx-DB4S2d7J.js";
|
|
4
|
-
const
|
|
5
|
-
skeleton:
|
|
4
|
+
const N = "_skeleton_dtmoz_1", b = "_skeletonLoading_dtmoz_1", o = {
|
|
5
|
+
skeleton: N,
|
|
6
6
|
skeletonLoading: b,
|
|
7
7
|
"skeleton--circle-type": "_skeleton--circle-type_dtmoz_13",
|
|
8
8
|
"skeleton--table-type": "_skeleton--table-type_dtmoz_17"
|
|
9
|
-
},
|
|
9
|
+
}, i = (e) => /* @__PURE__ */ t("div", { ...e, className: r(o.skeleton, e.className) }), $ = ({ size: e = "4rem", ...l }) => {
|
|
10
10
|
const s = r(o.skeleton, o["skeleton--circle-type"], l.className);
|
|
11
11
|
return /* @__PURE__ */ t("div", { ...l, style: { width: e, height: e }, className: s });
|
|
12
|
-
},
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
...a
|
|
18
|
-
}) => {
|
|
19
|
-
const k = r(o["skeleton--table-type"], a.className), i = `${100 / e}%`, h = c && /* @__PURE__ */ t("tr", { children: new Array(e).fill(null).map((_, n) => /* @__PURE__ */ t("th", { style: { width: i }, children: /* @__PURE__ */ t(d, { style: { width: s ? m(50) : "100%" } }) }, `row-columns-${n}`)) }), y = new Array(l).fill(null).map((_, n) => /* @__PURE__ */ t("tr", { children: new Array(e).fill(null).map((f, w) => /* @__PURE__ */ t("td", { style: { width: i }, children: /* @__PURE__ */ t(d, { style: { width: s ? m() : "100%" } }) }, `row-${n}-cell-${w}`)) }, `row-${n}`));
|
|
20
|
-
return /* @__PURE__ */ N("table", { ...a, className: k, children: [
|
|
21
|
-
c && /* @__PURE__ */ t("thead", { children: h }),
|
|
22
|
-
/* @__PURE__ */ t("tbody", { children: y })
|
|
12
|
+
}, d = (e = 30) => `${Math.floor(Math.random() * (100 - e + 1) + e)}%`, C = ({ columns: e = 5, rows: l = 5, autoWidth: s = !0, ...c }) => {
|
|
13
|
+
const m = r(o["skeleton--table-type"], c.className), a = `${100 / e}%`, h = /* @__PURE__ */ t("tr", { children: new Array(e).fill(null).map((y, n) => /* @__PURE__ */ t("th", { style: { width: a }, children: /* @__PURE__ */ t(i, { style: { width: s ? d(50) : "100%" } }) }, `row-columns-${n}`)) }), k = new Array(l).fill(null).map((y, n) => /* @__PURE__ */ t("tr", { children: new Array(e).fill(null).map((f, _) => /* @__PURE__ */ t("td", { style: { width: a }, children: /* @__PURE__ */ t(i, { style: { width: s ? d() : "100%" } }) }, `row-${n}-cell-${_}`)) }, `row-${n}`));
|
|
14
|
+
return /* @__PURE__ */ w("table", { ...c, className: m, children: [
|
|
15
|
+
/* @__PURE__ */ t("thead", { children: h }),
|
|
16
|
+
/* @__PURE__ */ t("tbody", { children: k })
|
|
23
17
|
] });
|
|
24
18
|
};
|
|
25
19
|
export {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
20
|
+
i as Skeleton,
|
|
21
|
+
$ as SkeletonCircle,
|
|
22
|
+
C as SkeletonTable
|
|
29
23
|
};
|
|
@@ -2,7 +2,7 @@ import { StoryObj } from '@storybook/react';
|
|
|
2
2
|
|
|
3
3
|
declare const meta: {
|
|
4
4
|
title: string;
|
|
5
|
-
component: ({ columns, rows, autoWidth,
|
|
5
|
+
component: ({ columns, rows, autoWidth, ...props }: import('./Skeleton').SkeletonTableProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
tags: string[];
|
|
7
7
|
parameters: {
|
|
8
8
|
layout: string;
|