@pismo/marola 0.0.1-alpha.4 → 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.
Files changed (95) hide show
  1. package/README.md +17 -5
  2. package/dist/{Button-C3Qm852g.js → Button-W6tM-_IT.js} +6 -5
  3. package/dist/Dialog.module-CGVM5V_D.js +15 -0
  4. package/dist/{ListContext-D6-YwtZn.js → ListContext-Dj2Va7Iv.js} +2 -2
  5. package/dist/Portal-P3fPvS3-.js +19695 -0
  6. package/dist/{Tabs.module-_kSbSyth.js → Tabs.module-BA-PC7fA.js} +16 -16
  7. package/dist/_commonjsHelpers-CT_km90n.js +30 -0
  8. package/dist/assets/Advice.css +1 -0
  9. package/dist/assets/Button.css +1 -0
  10. package/dist/assets/Checkbox.css +1 -0
  11. package/dist/assets/Dialog.css +1 -1
  12. package/dist/assets/IconButton.css +1 -0
  13. package/dist/assets/LoadingSpinner.css +1 -1
  14. package/dist/assets/PageHeader.css +1 -0
  15. package/dist/assets/Pagination.css +1 -0
  16. package/dist/assets/Skeleton.css +1 -0
  17. package/dist/assets/SortTooltip.css +1 -0
  18. package/dist/assets/Stepper.css +1 -0
  19. package/dist/assets/Table.css +1 -0
  20. package/dist/assets/Tabs.css +1 -1
  21. package/dist/assets/Tooltip.css +1 -0
  22. package/dist/assets/Typography.css +1 -1
  23. package/dist/assets/global.css +1 -0
  24. package/dist/components/Advice/Advice.d.ts +13 -0
  25. package/dist/components/Advice/Advice.js +25 -0
  26. package/dist/components/Button/Button.d.ts +21 -0
  27. package/dist/components/Button/Button.js +70 -0
  28. package/dist/components/Checkbox/Checkbox.d.ts +17 -0
  29. package/dist/components/Checkbox/Checkbox.js +48 -0
  30. package/dist/components/Dialog/Actions.js +1 -1
  31. package/dist/components/Dialog/Backdrop.d.ts +1 -1
  32. package/dist/components/Dialog/Backdrop.js +2 -9
  33. package/dist/components/Dialog/CloseIconButton.js +12 -124
  34. package/dist/components/Dialog/Dialog.d.ts +2 -2
  35. package/dist/components/Dialog/Dialog.js +418 -20077
  36. package/dist/components/Dialog/Title.js +22 -7
  37. package/dist/components/Icon/Icon.d.ts +7 -0
  38. package/dist/components/Icon/Icon.js +9 -0
  39. package/dist/components/IconButton/IconButton.d.ts +22 -0
  40. package/dist/components/IconButton/IconButton.js +68 -0
  41. package/dist/components/LoadingSpinner/LoadingSpinner.js +12 -13
  42. package/dist/components/PageHeader/PageHeader.d.ts +36 -0
  43. package/dist/components/PageHeader/PageHeader.js +51 -0
  44. package/dist/components/PageHeader/PageHeader.stories.d.ts +43 -0
  45. package/dist/components/PageHeader/PageHeader.stories.js +49 -0
  46. package/dist/components/Pagination/Pagination.d.ts +36 -0
  47. package/dist/components/Pagination/Pagination.js +219 -0
  48. package/dist/components/Skeleton/Skeleton.d.ts +18 -0
  49. package/dist/components/Skeleton/Skeleton.js +26 -0
  50. package/dist/components/SortTooltip/SortTooltip.d.ts +26 -0
  51. package/dist/components/SortTooltip/SortTooltip.js +67 -0
  52. package/dist/components/Stepper/Stepper.d.ts +16 -0
  53. package/dist/components/Stepper/Stepper.js +33 -0
  54. package/dist/components/Table/Table.d.ts +39 -0
  55. package/dist/components/Table/Table.js +122 -0
  56. package/dist/components/Table/TableContext.d.ts +19 -0
  57. package/dist/components/Table/TableContext.js +21 -0
  58. package/dist/components/Tabs/Tab.d.ts +1 -1
  59. package/dist/components/Tabs/Tab.js +42 -37
  60. package/dist/components/Tabs/TabPanel.d.ts +1 -1
  61. package/dist/components/Tabs/TabPanel.js +20 -21
  62. package/dist/components/Tabs/Tabs.d.ts +1 -1
  63. package/dist/components/Tabs/Tabs.js +185 -214
  64. package/dist/components/Tooltip/Tooltip.d.ts +17 -0
  65. package/dist/components/Tooltip/Tooltip.js +1463 -0
  66. package/dist/components/Typography/Typography.d.ts +14 -5
  67. package/dist/components/Typography/Typography.js +76 -68
  68. package/dist/components/Typography/Typography.stories.d.ts +18 -0
  69. package/dist/components/Typography/Typography.stories.js +30 -0
  70. package/dist/components/Typography/typography.test.d.ts +1 -0
  71. package/dist/components/Typography/typography.test.js +11360 -0
  72. package/dist/{index-BZ1lkM_M.js → index-D2P7y2mE.js} +303 -327
  73. package/dist/magic-string.es-O_8lTkE3.js +738 -0
  74. package/dist/main.d.ts +5 -1
  75. package/dist/main.js +30 -21
  76. package/dist/objectWithoutPropertiesLoose-D7Cp0Pg_.js +26 -0
  77. package/dist/react-CGNQ6M5x.js +117 -0
  78. package/dist/test-utils/assertStyles.d.ts +1 -0
  79. package/dist/test-utils/assertStyles.js +11 -0
  80. package/dist/types/helpers.d.ts +14 -7
  81. package/dist/{useButton-CbmjmH5z.js → useButton-JpyBo5M4.js} +17 -16
  82. package/dist/{useCompoundItem-B7wfGDHQ.js → useCompoundItem-CTYi5M_E.js} +1 -1
  83. package/dist/useControlled-CCMYYdCM.js +31 -0
  84. package/dist/utils/styleStrings.d.ts +6 -0
  85. package/dist/utils/styleStrings.js +10 -0
  86. package/dist/utils/styleStrings.test.d.ts +1 -0
  87. package/dist/utils/styleStrings.test.js +41 -0
  88. package/dist/vi.Y_w82WR8-Df0JUamG.js +9860 -0
  89. package/package.json +47 -7
  90. package/dist/Dialog.module-BO0mdB7d.js +0 -15
  91. package/dist/assets/CallToActionButton.css +0 -1
  92. package/dist/assets/main.css +0 -1
  93. package/dist/components/CallToActionButton/CallToActionButton.d.ts +0 -21
  94. package/dist/components/CallToActionButton/CallToActionButton.js +0 -57
  95. package/src/playground/Playground.tsx +0 -20
@@ -1,13 +1,28 @@
1
1
  import { jsxs as l, Fragment as s, jsx as e } from "react/jsx-runtime";
2
- import { s as r } from "../../Dialog.module-BO0mdB7d.js";
3
2
  import { Typography as a } from "../Typography/Typography.js";
4
- const n = ({
5
- title: i,
6
- subTitle: t
7
- }) => /* @__PURE__ */ l(s, { children: [
8
- /* @__PURE__ */ e(a, { element: "h1", elementProps: { id: "alert-dialog-title" }, variant: "h4", className: r.dialog__title, children: i }),
3
+ import { s as r } from "../../Dialog.module-CGVM5V_D.js";
4
+ const n = ({ title: i, subTitle: t }) => /* @__PURE__ */ l(s, { children: [
5
+ /* @__PURE__ */ e(
6
+ a,
7
+ {
8
+ element: "h1",
9
+ elementProps: { id: "alert-dialog-title" },
10
+ variant: "h4",
11
+ className: r.dialog__title,
12
+ children: i
13
+ }
14
+ ),
9
15
  /* @__PURE__ */ e("hr", { className: r.dialog__divider, "aria-hidden": !0 }),
10
- t && /* @__PURE__ */ e(a, { element: "h2", elementProps: { id: "alert-dialog-description" }, variant: "h4", className: r.dialog__subtitle, children: t })
16
+ t && /* @__PURE__ */ e(
17
+ a,
18
+ {
19
+ element: "h2",
20
+ elementProps: { id: "alert-dialog-description" },
21
+ variant: "h4",
22
+ className: r.dialog__subtitle,
23
+ children: t
24
+ }
25
+ )
11
26
  ] });
12
27
  export {
13
28
  n as default
@@ -0,0 +1,7 @@
1
+ export type IconProps = {
2
+ iconFamily?: string;
3
+ icon: string;
4
+ size?: number | string;
5
+ color?: string;
6
+ };
7
+ export declare const Icon: ({ iconFamily, icon, size, color }: IconProps) => import("react/jsx-runtime").JSX.Element;
@@ -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
+ };
@@ -0,0 +1,22 @@
1
+ import { Either } from '../../types/helpers';
2
+ import { ReactNode } from 'react';
3
+
4
+ type variant = 'primary' | 'square';
5
+ type IconButtonCoreProps = {
6
+ icon: ReactNode;
7
+ loading?: boolean;
8
+ disabled?: boolean;
9
+ className?: string;
10
+ children?: ReactNode;
11
+ variant?: variant;
12
+ };
13
+ interface IconButtonPropsWithLink extends IconButtonCoreProps {
14
+ link: string;
15
+ }
16
+ interface IconButtonPropsWithOnClick extends IconButtonCoreProps {
17
+ onClick: () => void;
18
+ type?: HTMLButtonElement['type'];
19
+ }
20
+ export type IconButtonProps = Either<IconButtonPropsWithLink, IconButtonPropsWithOnClick>;
21
+ export declare const IconButton: import('react').ForwardRefExoticComponent<IconButtonProps & import('react').RefAttributes<HTMLButtonElement>>;
22
+ export default IconButton;
@@ -0,0 +1,68 @@
1
+ import '../../assets/IconButton.css';
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";
5
+ import { LoadingSpinner as m } from "../LoadingSpinner/LoadingSpinner.js";
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
+ h2: p,
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",
31
+ form__input: B,
32
+ form__hint: j,
33
+ form__label: C,
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",
39
+ table__header: L,
40
+ table__body: M,
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",
46
+ button: R,
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
+ });
65
+ export {
66
+ E as IconButton,
67
+ E as default
68
+ };
@@ -1,17 +1,16 @@
1
1
  import '../../assets/LoadingSpinner.css';
2
- import { jsxs as o, jsx as s } from "react/jsx-runtime";
3
- import { useMemo as e } from "react";
2
+ import { jsxs as e, jsx as s } from "react/jsx-runtime";
3
+ import { useMemo as o } from "react";
4
4
  import { c as t } from "../../clsx-DB4S2d7J.js";
5
5
  const n = {
6
- "ls-ring": "_ls-ring_19dsy_1",
7
- "ls-ring--invert": "_ls-ring--invert_19dsy_34"
8
- }, c = ({ invert: i = !1, classNames: r }) => {
9
- const l = e(() => t(
10
- [n["ls-ring"]],
11
- { [n["ls-ring--invert"]]: i },
12
- r
13
- ), [r, i]);
14
- return /* @__PURE__ */ o("div", { className: l, children: [
6
+ "ls-ring": "_ls-ring_elvjz_1",
7
+ "ls-ring--invert": "_ls-ring--invert_elvjz_34"
8
+ }, a = ({ invert: i = !1, classNames: r }) => {
9
+ const l = o(
10
+ () => t([n["ls-ring"]], { [n["ls-ring--invert"]]: i }, r),
11
+ [r, i]
12
+ );
13
+ return /* @__PURE__ */ e("div", { className: l, children: [
15
14
  /* @__PURE__ */ s("div", {}),
16
15
  /* @__PURE__ */ s("div", {}),
17
16
  /* @__PURE__ */ s("div", {}),
@@ -19,6 +18,6 @@ const n = {
19
18
  ] });
20
19
  };
21
20
  export {
22
- c as LoadingSpinner,
23
- c as default
21
+ a as LoadingSpinner,
22
+ a as default
24
23
  };
@@ -0,0 +1,36 @@
1
+ import { RequireAllOrNone } from '../../types/helpers';
2
+ import { ReactNode } from 'react';
3
+
4
+ type PageHeaderCommonProps = {
5
+ /** Title text */
6
+ title: string;
7
+ /** Subtitle text */
8
+ subtitle?: string;
9
+ /** Back link text */
10
+ backLinkText?: string;
11
+ /** Callback called when `back link` is clicked */
12
+ onBackLinkClick?: () => void;
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;
33
+ };
34
+ type PageHeaderProps = RequireAllOrNone<PageHeaderCommonProps, 'backLinkText' | 'onBackLinkClick'>;
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;
36
+ export {};
@@ -0,0 +1,51 @@
1
+ import '../../assets/PageHeader.css';
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
+ fill: "currentcolor",
7
+ color: "currentcolor",
8
+ width: "1em",
9
+ height: "1em"
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
+ "page-header": "_page-header_cz9x0_1",
12
+ "page-header__top-content": "_page-header__top-content_cz9x0_10",
13
+ "page-header__main-content": "_page-header__main-content_cz9x0_13",
14
+ "page-header__bottom-content": "_page-header__bottom-content_cz9x0_13",
15
+ "page-header__main-left-content": "_page-header__main-left-content_cz9x0_40",
16
+ title: z,
17
+ subtitle: b,
18
+ "page-header__main-right-content": "_page-header__main-right-content_cz9x0_64"
19
+ }, y = ({
20
+ title: c,
21
+ subtitle: d,
22
+ backLinkText: r,
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 }),
38
+ r
39
+ ] }) }),
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 })
44
+ ] }),
45
+ i && /* @__PURE__ */ t("div", { className: e["page-header__main-right-content"], children: i })
46
+ ] }),
47
+ o && /* @__PURE__ */ t("div", { className: e["page-header__bottom-content"], children: o })
48
+ ] });
49
+ export {
50
+ y as PageHeader
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
+ };
@@ -0,0 +1,36 @@
1
+ export type PaginationParams = {
2
+ totalItems: number;
3
+ perPage: number;
4
+ currentPage: number;
5
+ };
6
+ export type PaginationTranslations = {
7
+ showing: string;
8
+ of: string;
9
+ results: string;
10
+ previous: string;
11
+ next: string;
12
+ };
13
+ type PaginationLanguages = 'pt' | 'en';
14
+ type PaginationCommonProps = {
15
+ className?: string;
16
+ 'data-testid'?: string;
17
+ classNamePerPage?: string;
18
+ 'data-testid__per-page'?: string;
19
+ classNamePagesNav?: string;
20
+ 'data-testid__pages-nav'?: string;
21
+ };
22
+ export type PaginationProps = {
23
+ perPageOptions?: (number | {
24
+ value: number;
25
+ label: string;
26
+ })[] | undefined;
27
+ onPageChange: (page: number) => void;
28
+ onRowsPerPageChange: (perPage: number | string) => void;
29
+ language?: PaginationLanguages;
30
+ t?: PaginationTranslations;
31
+ } & PaginationParams & PaginationCommonProps;
32
+ export declare const defaultTranslations: {
33
+ [key in PaginationLanguages]: PaginationTranslations;
34
+ };
35
+ export declare const Pagination: (props: PaginationProps) => import("react/jsx-runtime").JSX.Element;
36
+ export {};
@@ -0,0 +1,219 @@
1
+ import '../../assets/Pagination.css';
2
+ import { jsxs as x, jsx as i, Fragment as M } from "react/jsx-runtime";
3
+ import { c as C } from "../../clsx-DB4S2d7J.js";
4
+ import { _ as S, a as A } from "../../objectWithoutPropertiesLoose-D7Cp0Pg_.js";
5
+ import { u as D } from "../../useControlled-CCMYYdCM.js";
6
+ const E = ["boundaryCount", "componentName", "count", "defaultPage", "disabled", "hideNextButton", "hidePrevButton", "onChange", "page", "showFirstButton", "showLastButton", "siblingCount"];
7
+ function $(e = {}) {
8
+ const {
9
+ boundaryCount: a = 1,
10
+ componentName: _ = "usePagination",
11
+ count: s = 1,
12
+ defaultPage: b = 1,
13
+ disabled: h = !1,
14
+ hideNextButton: c = !1,
15
+ hidePrevButton: m = !1,
16
+ onChange: t,
17
+ page: o,
18
+ showFirstButton: p = !1,
19
+ showLastButton: f = !1,
20
+ siblingCount: u = 1
21
+ } = e, d = S(e, E), [r, k] = D({
22
+ controlled: o,
23
+ default: b,
24
+ name: _,
25
+ state: "page"
26
+ }), N = (n, l) => {
27
+ o || k(l), t && t(n, l);
28
+ }, v = (n, l) => {
29
+ const I = l - n + 1;
30
+ return Array.from({
31
+ length: I
32
+ }, (W, O) => n + O);
33
+ }, j = v(1, Math.min(a, s)), P = v(Math.max(s - a + 1, a + 1), s), w = Math.max(
34
+ Math.min(
35
+ // Natural start
36
+ r - u,
37
+ // Lower boundary when page is high
38
+ s - a - u * 2 - 1
39
+ ),
40
+ // Greater than startPages
41
+ a + 2
42
+ ), B = Math.min(
43
+ Math.max(
44
+ // Natural end
45
+ r + u,
46
+ // Upper boundary when page is low
47
+ a + u * 2 + 2
48
+ ),
49
+ // Less than endPages
50
+ P.length > 0 ? P[0] - 2 : s - 1
51
+ ), L = [
52
+ ...p ? ["first"] : [],
53
+ ...m ? [] : ["previous"],
54
+ ...j,
55
+ // Start ellipsis
56
+ // eslint-disable-next-line no-nested-ternary
57
+ ...w > a + 2 ? ["start-ellipsis"] : a + 1 < s - a ? [a + 1] : [],
58
+ // Sibling pages
59
+ ...v(w, B),
60
+ // End ellipsis
61
+ // eslint-disable-next-line no-nested-ternary
62
+ ...B < s - a - 1 ? ["end-ellipsis"] : s - a > a ? [s - a] : [],
63
+ ...P,
64
+ ...c ? [] : ["next"],
65
+ ...f ? ["last"] : []
66
+ ], y = (n) => {
67
+ switch (n) {
68
+ case "first":
69
+ return 1;
70
+ case "previous":
71
+ return r - 1;
72
+ case "next":
73
+ return r + 1;
74
+ case "last":
75
+ return s;
76
+ default:
77
+ return null;
78
+ }
79
+ }, F = L.map((n) => typeof n == "number" ? {
80
+ onClick: (l) => {
81
+ N(l, n);
82
+ },
83
+ type: "page",
84
+ page: n,
85
+ selected: n === r,
86
+ disabled: h,
87
+ "aria-current": n === r ? "true" : void 0
88
+ } : {
89
+ onClick: (l) => {
90
+ N(l, y(n));
91
+ },
92
+ type: n,
93
+ page: y(n),
94
+ selected: !1,
95
+ disabled: h || n.indexOf("ellipsis") === -1 && (n === "next" || n === "last" ? r >= s : r <= 1)
96
+ });
97
+ return A({
98
+ items: F
99
+ }, d);
100
+ }
101
+ const R = "_pagination_9gf1w_1", g = {
102
+ pagination: R,
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
+ }, T = {
110
+ pt: {
111
+ showing: "Exibindo",
112
+ of: "de",
113
+ results: "resultados",
114
+ previous: "Anterior",
115
+ next: "Próximo"
116
+ },
117
+ en: {
118
+ showing: "Showing",
119
+ of: "of",
120
+ results: "results",
121
+ previous: "Previous",
122
+ next: "Next"
123
+ }
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"], c = (t) => h[t], { items: m } = $({
126
+ count: _,
127
+ hideNextButton: !0,
128
+ hidePrevButton: !0,
129
+ page: e.currentPage,
130
+ onChange: (t, o) => e.onPageChange(o),
131
+ siblingCount: 1,
132
+ boundaryCount: 2
133
+ });
134
+ return /* @__PURE__ */ x("div", { className: C(g.pagination, e.className), "data-testid": e["data-testid"], children: [
135
+ /* @__PURE__ */ i(
136
+ "div",
137
+ {
138
+ className: C(g["per-page-container"], e.classNamePerPage),
139
+ "data-testid": e["data-testid__per-page"],
140
+ children: a && /* @__PURE__ */ x(M, { children: [
141
+ c`showing`,
142
+ /* @__PURE__ */ i(
143
+ "select",
144
+ {
145
+ value: e.perPage,
146
+ name: "per-page-select",
147
+ id: "per-page-select",
148
+ onChange: (t) => e.onRowsPerPageChange(t.target.value),
149
+ children: a.map((t) => {
150
+ const o = typeof t == "number";
151
+ return /* @__PURE__ */ i(
152
+ "option",
153
+ {
154
+ value: o ? t : t.value,
155
+ children: o ? t : t.label
156
+ },
157
+ `per-page__${o ? t : t.value}`
158
+ );
159
+ })
160
+ }
161
+ ),
162
+ c`of`,
163
+ " ",
164
+ /* @__PURE__ */ i("strong", { children: e.totalItems }),
165
+ " ",
166
+ c`results`
167
+ ] })
168
+ }
169
+ ),
170
+ /* @__PURE__ */ x(
171
+ "div",
172
+ {
173
+ className: C(g["pages-navigator-container"], e.classNamePagesNav),
174
+ "data-testid": e["data-testid__per-page"],
175
+ children: [
176
+ /* @__PURE__ */ i(
177
+ "button",
178
+ {
179
+ className: g["pages-navigator-container__previous-next-btn"],
180
+ disabled: s,
181
+ onClick: () => e.onPageChange(e.currentPage - 1),
182
+ type: "button",
183
+ children: c`previous`
184
+ },
185
+ "page__previous"
186
+ ),
187
+ m.map(({ page: t, type: o, selected: p, ...f }, u) => {
188
+ let d = /* @__PURE__ */ i(M, {});
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
+ "button",
191
+ {
192
+ className: [g["page-number__btn"], p ? g["page-number__btn--selected"] : ""].join(" ").trim(),
193
+ onClick: () => e.onPageChange(t || 0),
194
+ type: "button",
195
+ children: t
196
+ },
197
+ `page__${u}`
198
+ ) : d = /* @__PURE__ */ i("button", { type: "button", ...f, children: o }), /* @__PURE__ */ i("li", { children: d }, u);
199
+ }),
200
+ /* @__PURE__ */ i(
201
+ "button",
202
+ {
203
+ className: g["pages-navigator-container__previous-next-btn"],
204
+ disabled: b,
205
+ onClick: () => e.onPageChange(e.currentPage + 1),
206
+ type: "button",
207
+ children: c`next`
208
+ },
209
+ "page__next"
210
+ )
211
+ ]
212
+ }
213
+ )
214
+ ] });
215
+ };
216
+ export {
217
+ J as Pagination,
218
+ T as defaultTranslations
219
+ };
@@ -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 };