@pismo/marola 0.0.1-alpha.5 → 0.0.1-alpha.6
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 +13 -2
- package/dist/{Button-D--uN90N.js → Button-W6tM-_IT.js} +3 -3
- package/dist/Dialog.module-CGVM5V_D.js +15 -0
- package/dist/Portal-P3fPvS3-.js +19695 -0
- package/dist/{Tabs.module-BKlNuSPH.js → Tabs.module-BA-PC7fA.js} +13 -13
- package/dist/_commonjsHelpers-CT_km90n.js +30 -0
- package/dist/assets/Advice.css +1 -0
- package/dist/assets/Button.css +1 -1
- package/dist/assets/Checkbox.css +1 -0
- package/dist/assets/Dialog.css +1 -1
- package/dist/assets/IconButton.css +1 -1
- package/dist/assets/Pagination.css +1 -1
- package/dist/assets/Skeleton.css +1 -0
- package/dist/assets/SortTooltip.css +1 -0
- package/dist/assets/Stepper.css +1 -0
- package/dist/assets/Table.css +1 -0
- package/dist/assets/Tabs.css +1 -1
- package/dist/assets/Tooltip.css +1 -0
- package/dist/assets/Typography.css +1 -1
- package/dist/assets/{main.css → global.css} +1 -1
- package/dist/components/Advice/Advice.d.ts +13 -0
- package/dist/components/Advice/Advice.js +25 -0
- package/dist/components/Button/Button.d.ts +1 -1
- package/dist/components/Button/Button.js +54 -38
- package/dist/components/Checkbox/Checkbox.d.ts +17 -0
- package/dist/components/Checkbox/Checkbox.js +48 -0
- package/dist/components/Dialog/Actions.js +1 -1
- package/dist/components/Dialog/Backdrop.d.ts +1 -1
- package/dist/components/Dialog/Backdrop.js +1 -1
- package/dist/components/Dialog/CloseIconButton.js +12 -124
- package/dist/components/Dialog/Dialog.js +417 -20072
- package/dist/components/Dialog/Title.js +1 -1
- package/dist/components/Icon/Icon.d.ts +7 -0
- package/dist/components/Icon/Icon.js +9 -0
- package/dist/components/IconButton/IconButton.d.ts +3 -3
- package/dist/components/IconButton/IconButton.js +54 -65
- package/dist/components/PageHeader/PageHeader.d.ts +25 -15
- package/dist/components/PageHeader/PageHeader.js +32 -50
- package/dist/components/PageHeader/PageHeader.stories.d.ts +43 -0
- package/dist/components/PageHeader/PageHeader.stories.js +49 -0
- package/dist/components/Pagination/Pagination.js +38 -38
- package/dist/components/Skeleton/Skeleton.d.ts +18 -0
- package/dist/components/Skeleton/Skeleton.js +26 -0
- package/dist/components/SortTooltip/SortTooltip.d.ts +26 -0
- package/dist/components/SortTooltip/SortTooltip.js +67 -1
- package/dist/components/Stepper/Stepper.d.ts +16 -0
- package/dist/components/Stepper/Stepper.js +33 -0
- package/dist/components/Table/Table.d.ts +39 -0
- package/dist/components/Table/Table.js +122 -1
- package/dist/components/Table/TableContext.d.ts +19 -0
- package/dist/components/Table/TableContext.js +21 -1
- package/dist/components/Tabs/Tab.d.ts +1 -1
- package/dist/components/Tabs/Tab.js +5 -5
- package/dist/components/Tabs/TabPanel.d.ts +1 -1
- package/dist/components/Tabs/TabPanel.js +4 -4
- package/dist/components/Tabs/Tabs.d.ts +1 -1
- package/dist/components/Tabs/Tabs.js +3 -3
- package/dist/components/Tooltip/Tooltip.d.ts +17 -0
- package/dist/components/Tooltip/Tooltip.js +1463 -1
- package/dist/components/Typography/Typography.d.ts +13 -4
- package/dist/components/Typography/Typography.js +76 -59
- package/dist/components/Typography/Typography.stories.d.ts +18 -0
- package/dist/components/Typography/Typography.stories.js +30 -0
- package/dist/components/Typography/typography.test.d.ts +1 -0
- package/dist/components/Typography/typography.test.js +11360 -0
- package/dist/{index-BvA1HyDs.js → index-D2P7y2mE.js} +90 -95
- package/dist/magic-string.es-O_8lTkE3.js +738 -0
- package/dist/main.d.ts +1 -0
- package/dist/main.js +30 -28
- package/dist/objectWithoutPropertiesLoose-D7Cp0Pg_.js +26 -0
- package/dist/react-CGNQ6M5x.js +117 -0
- package/dist/test-utils/assertStyles.d.ts +1 -0
- package/dist/test-utils/assertStyles.js +11 -0
- package/dist/types/helpers.d.ts +8 -0
- package/dist/{useButton-abQpo0za.js → useButton-JpyBo5M4.js} +2 -2
- package/dist/{useCompoundItem-wTwXbURC.js → useCompoundItem-CTYi5M_E.js} +1 -1
- package/dist/utils/styleStrings.d.ts +6 -0
- package/dist/utils/styleStrings.js +10 -0
- package/dist/utils/styleStrings.test.d.ts +1 -0
- package/dist/utils/styleStrings.test.js +41 -0
- package/dist/vi.Y_w82WR8-Df0JUamG.js +9860 -0
- package/package.json +26 -6
- package/dist/Dialog.module-BKWFakxu.js +0 -15
- package/dist/objectWithoutPropertiesLoose-ClNcje2_.js +0 -22
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as l, Fragment as s, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { Typography as a } from "../Typography/Typography.js";
|
|
3
|
-
import { s as r } from "../../Dialog.module-
|
|
3
|
+
import { s as r } from "../../Dialog.module-CGVM5V_D.js";
|
|
4
4
|
const n = ({ title: i, subTitle: t }) => /* @__PURE__ */ l(s, { children: [
|
|
5
5
|
/* @__PURE__ */ e(
|
|
6
6
|
a,
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { W as e } from "../../react-CGNQ6M5x.js";
|
|
3
|
+
const m = ({ iconFamily: o, icon: n, size: r, color: t }) => {
|
|
4
|
+
const c = `${o ?? "fa/duotone"}/${n}`;
|
|
5
|
+
return /* @__PURE__ */ s(e, { icon: c, color: t || "", size: r || "" });
|
|
6
|
+
};
|
|
7
|
+
export {
|
|
8
|
+
m as Icon
|
|
9
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Either } from '../../types/helpers';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
|
|
4
|
-
type variant =
|
|
4
|
+
type variant = 'primary' | 'square';
|
|
5
5
|
type IconButtonCoreProps = {
|
|
6
6
|
icon: ReactNode;
|
|
7
7
|
loading?: boolean;
|
|
@@ -15,8 +15,8 @@ interface IconButtonPropsWithLink extends IconButtonCoreProps {
|
|
|
15
15
|
}
|
|
16
16
|
interface IconButtonPropsWithOnClick extends IconButtonCoreProps {
|
|
17
17
|
onClick: () => void;
|
|
18
|
-
type?: HTMLButtonElement[
|
|
18
|
+
type?: HTMLButtonElement['type'];
|
|
19
19
|
}
|
|
20
20
|
export type IconButtonProps = Either<IconButtonPropsWithLink, IconButtonPropsWithOnClick>;
|
|
21
|
-
export declare const IconButton: import('react').ForwardRefExoticComponent<IconButtonProps & import(
|
|
21
|
+
export declare const IconButton: import('react').ForwardRefExoticComponent<IconButtonProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
22
22
|
export default IconButton;
|
|
@@ -1,78 +1,67 @@
|
|
|
1
1
|
import '../../assets/IconButton.css';
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { forwardRef as
|
|
2
|
+
import { jsx as e, jsxs as s } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef as q, useMemo as a } from "react";
|
|
4
|
+
import { c } from "../../clsx-DB4S2d7J.js";
|
|
4
5
|
import { LoadingSpinner as m } from "../LoadingSpinner/LoadingSpinner.js";
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
h1:
|
|
9
|
-
"h1--bold": "_h1--bold_1v5kq_7",
|
|
6
|
+
import { B as g } from "../../Button-W6tM-_IT.js";
|
|
7
|
+
const k = "_h1_8qiyf_1", p = "_h2_8qiyf_11", w = "_h3_8qiyf_21", x = "_h4_8qiyf_31", N = "_body_8qiyf_41", v = "_quote_8qiyf_75", B = "_form__input_8qiyf_98", j = "_form__hint_8qiyf_103", C = "_form__label_8qiyf_108", I = "_form__dropdown_8qiyf_113", L = "_table__header_8qiyf_131", M = "_table__body_8qiyf_136", R = "_button_8qiyf_159", o = {
|
|
8
|
+
h1: k,
|
|
9
|
+
"h1--bold": "_h1--bold_8qiyf_7",
|
|
10
10
|
h2: p,
|
|
11
|
-
"h2--bold": "_h2--
|
|
12
|
-
h3:
|
|
13
|
-
"h3--bold": "_h3--
|
|
14
|
-
h4:
|
|
15
|
-
"h4--bold": "_h4--
|
|
16
|
-
body:
|
|
17
|
-
"body--large": "_body--
|
|
18
|
-
"body--medium": "_body--
|
|
19
|
-
"body--small": "_body--
|
|
20
|
-
"body--tiny": "_body--
|
|
21
|
-
"body--bold": "_body--
|
|
22
|
-
"body--strikethrough": "_body--
|
|
23
|
-
"body--underlined": "_body--
|
|
24
|
-
"body--strikethrough-underlined": "_body--strikethrough-
|
|
25
|
-
quote:
|
|
26
|
-
"quote--large": "_quote--
|
|
11
|
+
"h2--bold": "_h2--bold_8qiyf_17",
|
|
12
|
+
h3: w,
|
|
13
|
+
"h3--bold": "_h3--bold_8qiyf_27",
|
|
14
|
+
h4: x,
|
|
15
|
+
"h4--bold": "_h4--bold_8qiyf_37",
|
|
16
|
+
body: N,
|
|
17
|
+
"body--large": "_body--large_8qiyf_46",
|
|
18
|
+
"body--medium": "_body--medium_8qiyf_50",
|
|
19
|
+
"body--small": "_body--small_8qiyf_54",
|
|
20
|
+
"body--tiny": "_body--tiny_8qiyf_58",
|
|
21
|
+
"body--bold": "_body--bold_8qiyf_62",
|
|
22
|
+
"body--strikethrough": "_body--strikethrough_8qiyf_65",
|
|
23
|
+
"body--underlined": "_body--underlined_8qiyf_68",
|
|
24
|
+
"body--strikethrough-underlined": "_body--strikethrough-underlined_8qiyf_71",
|
|
25
|
+
quote: v,
|
|
26
|
+
"quote--large": "_quote--large_8qiyf_80",
|
|
27
|
+
"quote--bold": "_quote--bold_8qiyf_85",
|
|
28
|
+
"quote--strikethrough": "_quote--strikethrough_8qiyf_88",
|
|
29
|
+
"quote--underlined": "_quote--underlined_8qiyf_91",
|
|
30
|
+
"quote--strikethrough-underlined": "_quote--strikethrough-underlined_8qiyf_94",
|
|
27
31
|
form__input: B,
|
|
28
32
|
form__hint: j,
|
|
29
33
|
form__label: C,
|
|
30
34
|
form__dropdown: I,
|
|
35
|
+
"form--bold": "_form--bold_8qiyf_118",
|
|
36
|
+
"form--strikethrough": "_form--strikethrough_8qiyf_121",
|
|
37
|
+
"form--underlined": "_form--underlined_8qiyf_124",
|
|
38
|
+
"form--strikethrough-underlined": "_form--strikethrough-underlined_8qiyf_127",
|
|
31
39
|
table__header: L,
|
|
32
40
|
table__body: M,
|
|
33
|
-
"table__body--secondary": "_table__body--
|
|
41
|
+
"table__body--secondary": "_table__body--secondary_8qiyf_141",
|
|
42
|
+
"table--bold": "_table--bold_8qiyf_146",
|
|
43
|
+
"table--strikethrough": "_table--strikethrough_8qiyf_149",
|
|
44
|
+
"table--underlined": "_table--underlined_8qiyf_152",
|
|
45
|
+
"table--strikethrough-underlined": "_table--strikethrough-underlined_8qiyf_155",
|
|
34
46
|
button: R,
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
o["icon-button"],
|
|
54
|
-
o[`icon-button--${_}`],
|
|
55
|
-
t
|
|
56
|
-
]),
|
|
57
|
-
[t, _]
|
|
58
|
-
);
|
|
59
|
-
return /* @__PURE__ */ n(
|
|
60
|
-
y,
|
|
61
|
-
{
|
|
62
|
-
type: s,
|
|
63
|
-
href: i,
|
|
64
|
-
onClick: d,
|
|
65
|
-
disabled: c,
|
|
66
|
-
className: u,
|
|
67
|
-
ref: e,
|
|
68
|
-
children: /* @__PURE__ */ q("div", { className: o["icon-button__container"], children: [
|
|
69
|
-
l ? /* @__PURE__ */ n(m, { invert: !0 }) : b,
|
|
70
|
-
_ !== "square" && a
|
|
71
|
-
] })
|
|
72
|
-
}
|
|
73
|
-
);
|
|
74
|
-
}
|
|
75
|
-
);
|
|
47
|
+
"button--bold": "_button--bold_8qiyf_165",
|
|
48
|
+
"button--strikethrough": "_button--strikethrough_8qiyf_168",
|
|
49
|
+
"button--underlined": "_button--underlined_8qiyf_171",
|
|
50
|
+
"button--strikethrough-underlined": "_button--strikethrough-underlined_8qiyf_174",
|
|
51
|
+
"icon-button": "_icon-button_8qiyf_178",
|
|
52
|
+
"icon-button--primary": "_icon-button--primary_8qiyf_190",
|
|
53
|
+
"icon-button--square": "_icon-button--square_8qiyf_212",
|
|
54
|
+
"icon-button__container": "_icon-button__container_8qiyf_228"
|
|
55
|
+
}, E = q((i, r) => {
|
|
56
|
+
const { onClick: n, icon: d, link: u, loading: b, children: l, type: y = "button", disabled: f, className: t, variant: _ = "primary" } = i, h = a(
|
|
57
|
+
() => c([o["icon-button"], o[`icon-button--${_}`], t]),
|
|
58
|
+
[t, _]
|
|
59
|
+
);
|
|
60
|
+
return /* @__PURE__ */ e(g, { type: y, href: u, onClick: n, disabled: f, className: h, ref: r, children: /* @__PURE__ */ s("div", { className: o["icon-button__container"], children: [
|
|
61
|
+
b ? /* @__PURE__ */ e(m, { invert: !0 }) : d,
|
|
62
|
+
_ !== "square" && l
|
|
63
|
+
] }) });
|
|
64
|
+
});
|
|
76
65
|
export {
|
|
77
66
|
E as IconButton,
|
|
78
67
|
E as default
|
|
@@ -2,25 +2,35 @@ import { RequireAllOrNone } from '../../types/helpers';
|
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
|
|
4
4
|
type PageHeaderCommonProps = {
|
|
5
|
+
/** Title text */
|
|
5
6
|
title: string;
|
|
7
|
+
/** Subtitle text */
|
|
6
8
|
subtitle?: string;
|
|
7
|
-
|
|
8
|
-
bottomChildren?: ReactNode;
|
|
9
|
+
/** Back link text */
|
|
9
10
|
backLinkText?: string;
|
|
11
|
+
/** Callback called when `back link` is clicked */
|
|
10
12
|
onBackLinkClick?: () => void;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
13
|
+
/** Element to be rendered on the right slot of the component */
|
|
14
|
+
rightChildren?: ReactNode;
|
|
15
|
+
/** Element to be rendered on the bottom slot of the component */
|
|
16
|
+
bottomChildren?: ReactNode;
|
|
17
|
+
/** CSS classes to be applied on the container element */
|
|
18
|
+
classNameWrapper?: string;
|
|
19
|
+
/** CSS classes to be applied on the back link element */
|
|
20
|
+
classNameBackLink?: string;
|
|
21
|
+
/** CSS classes to be applied on the title element */
|
|
22
|
+
classNameTitle?: string;
|
|
23
|
+
/** CSS classes to be applied on the subtitle element */
|
|
24
|
+
classNameSubtitle?: string;
|
|
25
|
+
/** Id to be applied as `data-testid` on the container element */
|
|
26
|
+
'data-testid-wrapper'?: string;
|
|
27
|
+
/** Id to be applied as `data-testid` on the back link element */
|
|
28
|
+
'data-testid-backLink'?: string;
|
|
29
|
+
/** Id to be applied as `data-testid` on the title element */
|
|
30
|
+
'data-testid-title'?: string;
|
|
31
|
+
/** Id to be applied as `data-testid` on the subtitle element */
|
|
32
|
+
'data-testid-subtitle'?: string;
|
|
23
33
|
};
|
|
24
34
|
type PageHeaderProps = RequireAllOrNone<PageHeaderCommonProps, 'backLinkText' | 'onBackLinkClick'>;
|
|
25
|
-
export declare const PageHeader: ({ title, subtitle, backLinkText, onBackLinkClick, rightChildren, bottomChildren,
|
|
35
|
+
export declare const PageHeader: ({ title, subtitle, backLinkText, onBackLinkClick, rightChildren, bottomChildren, classNameWrapper, classNameBackLink, classNameTitle, classNameSubtitle, "data-testid-wrapper": wrapperTestId, "data-testid-backLink": backLinkTestId, "data-testid-title": titleTestId, "data-testid-subtitle": subtitleTestId, ...rest }: PageHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
26
36
|
export {};
|
|
@@ -1,69 +1,51 @@
|
|
|
1
1
|
import '../../assets/PageHeader.css';
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { c as
|
|
4
|
-
import * as
|
|
5
|
-
const
|
|
2
|
+
import { jsxs as a, jsx as t } from "react/jsx-runtime";
|
|
3
|
+
import { c as n } from "../../clsx-DB4S2d7J.js";
|
|
4
|
+
import * as _ from "react";
|
|
5
|
+
const w = (c) => /* @__PURE__ */ _.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 448 512", "data-waves-icon": "fa/solid/arrow-left", fill: "currentColor", color: "currentColor", width: "1em", height: "1em", style: {
|
|
6
6
|
fill: "currentcolor",
|
|
7
7
|
color: "currentcolor",
|
|
8
8
|
width: "1em",
|
|
9
9
|
height: "1em"
|
|
10
|
-
}, ...
|
|
10
|
+
}, ...c }, /* @__PURE__ */ _.createElement("path", { d: "M447.1 256C447.1 273.7 433.7 288 416 288H109.3l105.4 105.4c12.5 12.5 12.5 32.75 0 45.25C208.4 444.9 200.2 448 192 448s-16.38-3.125-22.62-9.375l-160-160c-12.5-12.5-12.5-32.75 0-45.25l160-160c12.5-12.5 32.75-12.5 45.25 0s12.5 32.75 0 45.25L109.3 224H416C433.7 224 447.1 238.3 447.1 256z" })), z = "_title_cz9x0_46", b = "_subtitle_cz9x0_47", e = {
|
|
11
11
|
"page-header": "_page-header_cz9x0_1",
|
|
12
12
|
"page-header__top-content": "_page-header__top-content_cz9x0_10",
|
|
13
13
|
"page-header__main-content": "_page-header__main-content_cz9x0_13",
|
|
14
14
|
"page-header__bottom-content": "_page-header__bottom-content_cz9x0_13",
|
|
15
15
|
"page-header__main-left-content": "_page-header__main-left-content_cz9x0_40",
|
|
16
|
-
title:
|
|
17
|
-
subtitle:
|
|
16
|
+
title: z,
|
|
17
|
+
subtitle: b,
|
|
18
18
|
"page-header__main-right-content": "_page-header__main-right-content_cz9x0_64"
|
|
19
|
-
},
|
|
20
|
-
title:
|
|
21
|
-
subtitle:
|
|
19
|
+
}, y = ({
|
|
20
|
+
title: c,
|
|
21
|
+
subtitle: d,
|
|
22
22
|
backLinkText: r,
|
|
23
|
-
onBackLinkClick:
|
|
24
|
-
rightChildren:
|
|
25
|
-
bottomChildren:
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
...b
|
|
39
|
-
}) => /* @__PURE__ */ c("div", { className: a([e["page-header"], l]), "data-testid": x, ...b, children: [
|
|
40
|
-
r && /* @__PURE__ */ t("div", { className: e["page-header__top-content"], children: /* @__PURE__ */ c("button", { type: "button", onClick: d, className: h, "data-testid": u, children: [
|
|
41
|
-
/* @__PURE__ */ t(y, { fontSize: 16 }),
|
|
23
|
+
onBackLinkClick: s,
|
|
24
|
+
rightChildren: i,
|
|
25
|
+
bottomChildren: o,
|
|
26
|
+
classNameWrapper: l,
|
|
27
|
+
classNameBackLink: h,
|
|
28
|
+
classNameTitle: m,
|
|
29
|
+
classNameSubtitle: p,
|
|
30
|
+
"data-testid-wrapper": g,
|
|
31
|
+
"data-testid-backLink": x,
|
|
32
|
+
"data-testid-title": f,
|
|
33
|
+
"data-testid-subtitle": u,
|
|
34
|
+
...v
|
|
35
|
+
}) => /* @__PURE__ */ a("div", { className: n([e["page-header"], l]), "data-testid": g, ...v, children: [
|
|
36
|
+
r && /* @__PURE__ */ t("div", { className: e["page-header__top-content"], children: /* @__PURE__ */ a("button", { type: "button", onClick: s, className: h, "data-testid": x, children: [
|
|
37
|
+
/* @__PURE__ */ t(w, { fontSize: 16 }),
|
|
42
38
|
r
|
|
43
39
|
] }) }),
|
|
44
|
-
/* @__PURE__ */
|
|
45
|
-
/* @__PURE__ */
|
|
46
|
-
/* @__PURE__ */ t("h1", { className:
|
|
47
|
-
/* @__PURE__ */ t("
|
|
40
|
+
/* @__PURE__ */ a("div", { className: e["page-header__main-content"], children: [
|
|
41
|
+
/* @__PURE__ */ a("div", { className: e["page-header__main-left-content"], children: [
|
|
42
|
+
/* @__PURE__ */ t("h1", { className: n(e.title, m), "data-testid": f, children: c }),
|
|
43
|
+
/* @__PURE__ */ t("h2", { className: n(e.subtitle, p), "data-testid": u, children: d })
|
|
48
44
|
] }),
|
|
49
|
-
|
|
50
|
-
"div",
|
|
51
|
-
{
|
|
52
|
-
className: a(e["page-header__main-right-content"], g),
|
|
53
|
-
"data-testid": z,
|
|
54
|
-
children: o
|
|
55
|
-
}
|
|
56
|
-
)
|
|
45
|
+
i && /* @__PURE__ */ t("div", { className: e["page-header__main-right-content"], children: i })
|
|
57
46
|
] }),
|
|
58
|
-
|
|
59
|
-
"div",
|
|
60
|
-
{
|
|
61
|
-
className: a(e["page-header__bottom-content"], f),
|
|
62
|
-
"data-testid": N,
|
|
63
|
-
children: _
|
|
64
|
-
}
|
|
65
|
-
)
|
|
47
|
+
o && /* @__PURE__ */ t("div", { className: e["page-header__bottom-content"], children: o })
|
|
66
48
|
] });
|
|
67
49
|
export {
|
|
68
|
-
|
|
50
|
+
y as PageHeader
|
|
69
51
|
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: ({ title, subtitle, backLinkText, onBackLinkClick, rightChildren, bottomChildren, classNameWrapper, classNameBackLink, classNameTitle, classNameSubtitle, "data-testid-wrapper": wrapperTestId, "data-testid-backLink": backLinkTestId, "data-testid-title": titleTestId, "data-testid-subtitle": subtitleTestId, ...rest }: (Required<Pick<{
|
|
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;
|
|
36
|
+
tags: string[];
|
|
37
|
+
};
|
|
38
|
+
export default meta;
|
|
39
|
+
type Story = StoryObj<typeof meta>;
|
|
40
|
+
export declare const Simple: Story;
|
|
41
|
+
export declare const WithBackLink: Story;
|
|
42
|
+
export declare const WithRightChildren: Story;
|
|
43
|
+
export declare const WithBottomChildren: Story;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
2
|
+
import { Button as r } from "../Button/Button.js";
|
|
3
|
+
import { Tab as e } from "../Tabs/Tab.js";
|
|
4
|
+
import { TabPanel as a } from "../Tabs/TabPanel.js";
|
|
5
|
+
import { Tabs as o } from "../Tabs/Tabs.js";
|
|
6
|
+
import { PageHeader as l } from "./PageHeader.js";
|
|
7
|
+
const g = {
|
|
8
|
+
title: "Components/PageHeader",
|
|
9
|
+
component: l,
|
|
10
|
+
tags: ["autodocs"]
|
|
11
|
+
}, c = {
|
|
12
|
+
args: {
|
|
13
|
+
title: "Marola Design System",
|
|
14
|
+
subtitle: "A Pismo design system"
|
|
15
|
+
}
|
|
16
|
+
}, i = {
|
|
17
|
+
name: "With back link",
|
|
18
|
+
args: {
|
|
19
|
+
...c.args,
|
|
20
|
+
backLinkText: "Back",
|
|
21
|
+
onBackLinkClick: () => alert("Back button clicked!")
|
|
22
|
+
}
|
|
23
|
+
}, u = {
|
|
24
|
+
name: "With right children",
|
|
25
|
+
args: {
|
|
26
|
+
...i.args,
|
|
27
|
+
rightChildren: /* @__PURE__ */ t(r, { variant: "quick", onClick: () => alert("button clicked"), children: "Click me!" })
|
|
28
|
+
}
|
|
29
|
+
}, p = {
|
|
30
|
+
name: "With bottom children",
|
|
31
|
+
args: {
|
|
32
|
+
...i.args,
|
|
33
|
+
bottomChildren: /* @__PURE__ */ n(o, { children: [
|
|
34
|
+
/* @__PURE__ */ t(e, { value: "1", children: "Tab 1" }),
|
|
35
|
+
/* @__PURE__ */ t(e, { value: "2", children: "Tab 2" }),
|
|
36
|
+
/* @__PURE__ */ t(e, { value: "3", children: "Tab 3" }),
|
|
37
|
+
/* @__PURE__ */ t(a, { value: "1", children: "Tab 1 content" }),
|
|
38
|
+
/* @__PURE__ */ t(a, { value: "2", children: "Tab 2 content" }),
|
|
39
|
+
/* @__PURE__ */ t(a, { value: "3", children: "Tab 3 content" })
|
|
40
|
+
] })
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
export {
|
|
44
|
+
c as Simple,
|
|
45
|
+
i as WithBackLink,
|
|
46
|
+
p as WithBottomChildren,
|
|
47
|
+
u as WithRightChildren,
|
|
48
|
+
g as default
|
|
49
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import '../../assets/Pagination.css';
|
|
2
|
-
import { jsxs as
|
|
2
|
+
import { jsxs as x, jsx as i, Fragment as M } from "react/jsx-runtime";
|
|
3
3
|
import { c as C } from "../../clsx-DB4S2d7J.js";
|
|
4
|
-
import { _ as S, a as A } from "../../objectWithoutPropertiesLoose-
|
|
4
|
+
import { _ as S, a as A } from "../../objectWithoutPropertiesLoose-D7Cp0Pg_.js";
|
|
5
5
|
import { u as D } from "../../useControlled-CCMYYdCM.js";
|
|
6
6
|
const E = ["boundaryCount", "componentName", "count", "defaultPage", "disabled", "hideNextButton", "hidePrevButton", "onChange", "page", "showFirstButton", "showLastButton", "siblingCount"];
|
|
7
7
|
function $(e = {}) {
|
|
@@ -11,12 +11,12 @@ function $(e = {}) {
|
|
|
11
11
|
count: s = 1,
|
|
12
12
|
defaultPage: b = 1,
|
|
13
13
|
disabled: h = !1,
|
|
14
|
-
hideNextButton:
|
|
14
|
+
hideNextButton: c = !1,
|
|
15
15
|
hidePrevButton: m = !1,
|
|
16
16
|
onChange: t,
|
|
17
17
|
page: o,
|
|
18
18
|
showFirstButton: p = !1,
|
|
19
|
-
showLastButton:
|
|
19
|
+
showLastButton: f = !1,
|
|
20
20
|
siblingCount: u = 1
|
|
21
21
|
} = e, d = S(e, E), [r, k] = D({
|
|
22
22
|
controlled: o,
|
|
@@ -30,7 +30,7 @@ function $(e = {}) {
|
|
|
30
30
|
return Array.from({
|
|
31
31
|
length: I
|
|
32
32
|
}, (W, O) => n + O);
|
|
33
|
-
}, j = v(1, Math.min(a, s)),
|
|
33
|
+
}, j = v(1, Math.min(a, s)), P = v(Math.max(s - a + 1, a + 1), s), w = Math.max(
|
|
34
34
|
Math.min(
|
|
35
35
|
// Natural start
|
|
36
36
|
r - u,
|
|
@@ -47,23 +47,23 @@ function $(e = {}) {
|
|
|
47
47
|
a + u * 2 + 2
|
|
48
48
|
),
|
|
49
49
|
// Less than endPages
|
|
50
|
-
|
|
50
|
+
P.length > 0 ? P[0] - 2 : s - 1
|
|
51
51
|
), L = [
|
|
52
52
|
...p ? ["first"] : [],
|
|
53
53
|
...m ? [] : ["previous"],
|
|
54
54
|
...j,
|
|
55
55
|
// Start ellipsis
|
|
56
56
|
// eslint-disable-next-line no-nested-ternary
|
|
57
|
-
...
|
|
57
|
+
...w > a + 2 ? ["start-ellipsis"] : a + 1 < s - a ? [a + 1] : [],
|
|
58
58
|
// Sibling pages
|
|
59
|
-
...v(
|
|
59
|
+
...v(w, B),
|
|
60
60
|
// End ellipsis
|
|
61
61
|
// eslint-disable-next-line no-nested-ternary
|
|
62
62
|
...B < s - a - 1 ? ["end-ellipsis"] : s - a > a ? [s - a] : [],
|
|
63
|
-
...
|
|
64
|
-
...
|
|
65
|
-
...
|
|
66
|
-
],
|
|
63
|
+
...P,
|
|
64
|
+
...c ? [] : ["next"],
|
|
65
|
+
...f ? ["last"] : []
|
|
66
|
+
], y = (n) => {
|
|
67
67
|
switch (n) {
|
|
68
68
|
case "first":
|
|
69
69
|
return 1;
|
|
@@ -87,10 +87,10 @@ function $(e = {}) {
|
|
|
87
87
|
"aria-current": n === r ? "true" : void 0
|
|
88
88
|
} : {
|
|
89
89
|
onClick: (l) => {
|
|
90
|
-
N(l,
|
|
90
|
+
N(l, y(n));
|
|
91
91
|
},
|
|
92
92
|
type: n,
|
|
93
|
-
page:
|
|
93
|
+
page: y(n),
|
|
94
94
|
selected: !1,
|
|
95
95
|
disabled: h || n.indexOf("ellipsis") === -1 && (n === "next" || n === "last" ? r >= s : r <= 1)
|
|
96
96
|
});
|
|
@@ -98,14 +98,14 @@ function $(e = {}) {
|
|
|
98
98
|
items: F
|
|
99
99
|
}, d);
|
|
100
100
|
}
|
|
101
|
-
const R = "
|
|
101
|
+
const R = "_pagination_9gf1w_1", g = {
|
|
102
102
|
pagination: R,
|
|
103
|
-
"per-page-container": "_per-page-
|
|
104
|
-
"pages-navigator-container": "_pages-navigator-
|
|
105
|
-
"pages-navigator-container__label": "_pages-navigator-
|
|
106
|
-
"page-number__btn": "_page-
|
|
107
|
-
"pages-navigator-container__previous-next-btn": "_pages-navigator-container__previous-next-
|
|
108
|
-
"page-number__btn--selected": "_page-number__btn--
|
|
103
|
+
"per-page-container": "_per-page-container_9gf1w_8",
|
|
104
|
+
"pages-navigator-container": "_pages-navigator-container_9gf1w_20",
|
|
105
|
+
"pages-navigator-container__label": "_pages-navigator-container__label_9gf1w_31",
|
|
106
|
+
"page-number__btn": "_page-number__btn_9gf1w_31",
|
|
107
|
+
"pages-navigator-container__previous-next-btn": "_pages-navigator-container__previous-next-btn_9gf1w_44",
|
|
108
|
+
"page-number__btn--selected": "_page-number__btn--selected_9gf1w_69"
|
|
109
109
|
}, T = {
|
|
110
110
|
pt: {
|
|
111
111
|
showing: "Exibindo",
|
|
@@ -122,7 +122,7 @@ const R = "_pagination_1exye_1", c = {
|
|
|
122
122
|
next: "Next"
|
|
123
123
|
}
|
|
124
124
|
}, J = (e) => {
|
|
125
|
-
const a = e.perPageOptions || [5, 10, 25, 50, 100], _ = Math.ceil(e.totalItems / e.perPage), s = e.currentPage <= 1, b = e.currentPage >= _, h = e.t || T[e.language || "en"],
|
|
125
|
+
const a = e.perPageOptions || [5, 10, 25, 50, 100], _ = Math.ceil(e.totalItems / e.perPage), s = e.currentPage <= 1, b = e.currentPage >= _, h = e.t || T[e.language || "en"], c = (t) => h[t], { items: m } = $({
|
|
126
126
|
count: _,
|
|
127
127
|
hideNextButton: !0,
|
|
128
128
|
hidePrevButton: !0,
|
|
@@ -131,14 +131,14 @@ const R = "_pagination_1exye_1", c = {
|
|
|
131
131
|
siblingCount: 1,
|
|
132
132
|
boundaryCount: 2
|
|
133
133
|
});
|
|
134
|
-
return /* @__PURE__ */
|
|
134
|
+
return /* @__PURE__ */ x("div", { className: C(g.pagination, e.className), "data-testid": e["data-testid"], children: [
|
|
135
135
|
/* @__PURE__ */ i(
|
|
136
136
|
"div",
|
|
137
137
|
{
|
|
138
|
-
className: C(
|
|
138
|
+
className: C(g["per-page-container"], e.classNamePerPage),
|
|
139
139
|
"data-testid": e["data-testid__per-page"],
|
|
140
|
-
children: a && /* @__PURE__ */
|
|
141
|
-
|
|
140
|
+
children: a && /* @__PURE__ */ x(M, { children: [
|
|
141
|
+
c`showing`,
|
|
142
142
|
/* @__PURE__ */ i(
|
|
143
143
|
"select",
|
|
144
144
|
{
|
|
@@ -159,52 +159,52 @@ const R = "_pagination_1exye_1", c = {
|
|
|
159
159
|
})
|
|
160
160
|
}
|
|
161
161
|
),
|
|
162
|
-
|
|
162
|
+
c`of`,
|
|
163
163
|
" ",
|
|
164
164
|
/* @__PURE__ */ i("strong", { children: e.totalItems }),
|
|
165
165
|
" ",
|
|
166
|
-
|
|
166
|
+
c`results`
|
|
167
167
|
] })
|
|
168
168
|
}
|
|
169
169
|
),
|
|
170
|
-
/* @__PURE__ */
|
|
170
|
+
/* @__PURE__ */ x(
|
|
171
171
|
"div",
|
|
172
172
|
{
|
|
173
|
-
className: C(
|
|
173
|
+
className: C(g["pages-navigator-container"], e.classNamePagesNav),
|
|
174
174
|
"data-testid": e["data-testid__per-page"],
|
|
175
175
|
children: [
|
|
176
176
|
/* @__PURE__ */ i(
|
|
177
177
|
"button",
|
|
178
178
|
{
|
|
179
|
-
className:
|
|
179
|
+
className: g["pages-navigator-container__previous-next-btn"],
|
|
180
180
|
disabled: s,
|
|
181
181
|
onClick: () => e.onPageChange(e.currentPage - 1),
|
|
182
182
|
type: "button",
|
|
183
|
-
children:
|
|
183
|
+
children: c`previous`
|
|
184
184
|
},
|
|
185
185
|
"page__previous"
|
|
186
186
|
),
|
|
187
|
-
m.map(({ page: t, type: o, selected: p, ...
|
|
187
|
+
m.map(({ page: t, type: o, selected: p, ...f }, u) => {
|
|
188
188
|
let d = /* @__PURE__ */ i(M, {});
|
|
189
|
-
return o === "start-ellipsis" || o === "end-ellipsis" ? d = /* @__PURE__ */ i("span", { className:
|
|
189
|
+
return o === "start-ellipsis" || o === "end-ellipsis" ? d = /* @__PURE__ */ i("span", { className: g["pages-navigator-container__label"], children: "..." }) : o === "page" ? d = /* @__PURE__ */ i(
|
|
190
190
|
"button",
|
|
191
191
|
{
|
|
192
|
-
className: [
|
|
192
|
+
className: [g["page-number__btn"], p ? g["page-number__btn--selected"] : ""].join(" ").trim(),
|
|
193
193
|
onClick: () => e.onPageChange(t || 0),
|
|
194
194
|
type: "button",
|
|
195
195
|
children: t
|
|
196
196
|
},
|
|
197
197
|
`page__${u}`
|
|
198
|
-
) : d = /* @__PURE__ */ i("button", { type: "button", ...
|
|
198
|
+
) : d = /* @__PURE__ */ i("button", { type: "button", ...f, children: o }), /* @__PURE__ */ i("li", { children: d }, u);
|
|
199
199
|
}),
|
|
200
200
|
/* @__PURE__ */ i(
|
|
201
201
|
"button",
|
|
202
202
|
{
|
|
203
|
-
className:
|
|
203
|
+
className: g["pages-navigator-container__previous-next-btn"],
|
|
204
204
|
disabled: b,
|
|
205
205
|
onClick: () => e.onPageChange(e.currentPage + 1),
|
|
206
206
|
type: "button",
|
|
207
|
-
children:
|
|
207
|
+
children: c`next`
|
|
208
208
|
},
|
|
209
209
|
"page__next"
|
|
210
210
|
)
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
type SkeletonProps = {
|
|
3
|
+
style?: React.CSSProperties | undefined;
|
|
4
|
+
className?: string;
|
|
5
|
+
'data-testid'?: string;
|
|
6
|
+
};
|
|
7
|
+
declare const Skeleton: (props: SkeletonProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
type SkeletonCircleProps = SkeletonProps & {
|
|
9
|
+
size?: string | number;
|
|
10
|
+
};
|
|
11
|
+
declare const SkeletonCircle: ({ size, ...props }: SkeletonCircleProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
type SkeletonTableProps = SkeletonProps & {
|
|
13
|
+
columns?: number;
|
|
14
|
+
rows?: number;
|
|
15
|
+
autoWidth?: boolean;
|
|
16
|
+
};
|
|
17
|
+
declare const SkeletonTable: ({ columns, rows, autoWidth, ...props }: SkeletonTableProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export { Skeleton, SkeletonCircle, SkeletonTable };
|