@pismo/marola 0.0.1-alpha.9 → 1.0.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (165) hide show
  1. package/README.md +1 -1
  2. package/dist/{Button-B1umG8kJ.js → Button-2b1peDFT.js} +25 -26
  3. package/dist/{ClickAwayListener-BKznXF1d.js → ClickAwayListener-BSW-Nd-y.js} +3 -2
  4. package/dist/Dialog.module-DFEmFdYT.js +30 -0
  5. package/dist/Group-B3p31ftp.js +26 -0
  6. package/dist/Popup-B6ZSGIEI.js +1248 -0
  7. package/dist/{Portal-BcdMtRGF.js → Portal-DIeBsWdL.js} +2 -2
  8. package/dist/SelectButton-C8JQKaf4.js +61 -0
  9. package/dist/Tabs.module-jkH1Qjn7.js +22 -0
  10. package/dist/Toggle-BCgIItCc.js +142 -0
  11. package/dist/assets/Advice.css +1 -1
  12. package/dist/assets/Button.css +1 -1
  13. package/dist/assets/Checkbox.css +1 -1
  14. package/dist/assets/Dialog.css +1 -1
  15. package/dist/assets/EllipsisTooltip.css +1 -0
  16. package/dist/assets/Group.css +1 -0
  17. package/dist/assets/IconButton.css +1 -1
  18. package/dist/assets/Input.css +1 -1
  19. package/dist/assets/InputSearch.css +1 -1
  20. package/dist/assets/PageHeader.css +1 -1
  21. package/dist/assets/Pagination.css +1 -1
  22. package/dist/assets/SelectButton.css +1 -0
  23. package/dist/assets/Skeleton.css +1 -1
  24. package/dist/assets/Snackbar.css +1 -1
  25. package/dist/assets/SortTooltip.css +1 -1
  26. package/dist/assets/Stepper.css +1 -1
  27. package/dist/assets/Table.css +1 -1
  28. package/dist/assets/TextDisplay.css +1 -0
  29. package/dist/assets/Toggle.css +1 -1
  30. package/dist/assets/Toggle2.css +1 -0
  31. package/dist/assets/Typography.css +1 -1
  32. package/dist/combineHooksSlotProps-DVjg9PRh.js +80 -0
  33. package/dist/components/Advice/Advice.d.ts +17 -3
  34. package/dist/components/Advice/Advice.js +39 -17
  35. package/dist/components/Advice/Advice.stories.d.ts +18 -0
  36. package/dist/components/Button/Button.d.ts +6 -3
  37. package/dist/components/Button/Button.js +60 -65
  38. package/dist/components/Button/Button.stories.d.ts +3 -1
  39. package/dist/components/Checkbox/Checkbox.d.ts +19 -2
  40. package/dist/components/Checkbox/Checkbox.js +63 -40
  41. package/dist/components/Checkbox/Checkbox.stories.d.ts +31 -0
  42. package/dist/components/Chip/Chip.d.ts +39 -0
  43. package/dist/components/Chip/Chip.js +19 -0
  44. package/dist/components/Chip/Chip.stories.d.ts +42 -0
  45. package/dist/components/Chip/chip.test.d.ts +1 -0
  46. package/dist/components/Dialog/Actions.js +1 -1
  47. package/dist/components/Dialog/Backdrop.js +1 -1
  48. package/dist/components/Dialog/CloseIconButton.js +2 -2
  49. package/dist/components/Dialog/Dialog.d.ts +1 -1
  50. package/dist/components/Dialog/Dialog.js +13 -13
  51. package/dist/components/Dialog/Dialog.stories.d.ts +10 -10
  52. package/dist/components/Dialog/{Title.d.ts → DialogTitle.d.ts} +3 -3
  53. package/dist/components/Dialog/DialogTitle.js +29 -0
  54. package/dist/components/EllipsisTooltip/EllipsisTooltip.d.ts +7 -0
  55. package/dist/components/EllipsisTooltip/EllipsisTooltip.js +23 -0
  56. package/dist/components/EllipsisTooltip/EllipsisTooltip.stories.d.ts +31 -0
  57. package/dist/components/Icon/Icon.d.ts +8 -15
  58. package/dist/components/Icon/Icon.js +85 -41
  59. package/dist/components/Icon/Icon.stories.d.ts +15 -0
  60. package/dist/components/Icon/types.d.ts +5 -0
  61. package/dist/components/Icon/types.js +1 -0
  62. package/dist/components/IconButton/Icon.stories.d.ts +15 -0
  63. package/dist/components/IconButton/IconButton.d.ts +18 -2
  64. package/dist/components/IconButton/IconButton.js +58 -63
  65. package/dist/components/Input/Input.d.ts +1 -1
  66. package/dist/components/Input/Input.js +241 -230
  67. package/dist/components/InputSearch/InputSearch.d.ts +7 -9
  68. package/dist/components/InputSearch/InputSearch.js +30 -25
  69. package/dist/components/InputSearch/InputSearch.stories.d.ts +21 -4
  70. package/dist/components/LoadingSpinner/LoadingSpinner.d.ts +1 -1
  71. package/dist/components/PageHeader/PageHeader.d.ts +36 -6
  72. package/dist/components/PageHeader/PageHeader.js +83 -47
  73. package/dist/components/PageHeader/PageHeader.stories.d.ts +2 -31
  74. package/dist/components/Pagination/Pagination.d.ts +24 -5
  75. package/dist/components/Pagination/Pagination.js +127 -109
  76. package/dist/components/Pagination/Pagination.stories.d.ts +17 -0
  77. package/dist/components/Select/Select.d.ts +26 -0
  78. package/dist/components/Select/Select.js +857 -0
  79. package/dist/components/Select/Select.stories.d.ts +22 -0
  80. package/dist/components/Select/SelectButton.d.ts +12 -0
  81. package/dist/components/Select/SelectButton.js +8 -0
  82. package/dist/components/Skeleton/Skeleton.d.ts +10 -3
  83. package/dist/components/Skeleton/Skeleton.js +16 -19
  84. package/dist/components/Skeleton/Skeleton.stories.d.ts +14 -0
  85. package/dist/components/Skeleton/SkeletonCircle.stories.d.ts +14 -0
  86. package/dist/components/Skeleton/SkeletonTable.stories.d.ts +16 -0
  87. package/dist/components/Snackbar/Snackbar.d.ts +19 -5
  88. package/dist/components/Snackbar/Snackbar.js +247 -230
  89. package/dist/components/Snackbar/Snackbar.stories.d.ts +319 -0
  90. package/dist/components/SortTooltip/SortTooltip.d.ts +3 -1
  91. package/dist/components/SortTooltip/SortTooltip.js +55 -29
  92. package/dist/components/Stepper/Stepper.d.ts +11 -1
  93. package/dist/components/Stepper/Stepper.js +37 -22
  94. package/dist/components/Stepper/Stepper.stories.d.ts +16 -0
  95. package/dist/components/Table/Table.d.ts +33 -16
  96. package/dist/components/Table/Table.js +106 -91
  97. package/dist/components/Table/Table.stories.d.ts +29 -0
  98. package/dist/components/Table/_Table.TBody.stories.d.ts +14 -0
  99. package/dist/components/Table/_Table.THead.stories.d.ts +14 -0
  100. package/dist/components/Table/_Table.Td.stories.d.ts +16 -0
  101. package/dist/components/Table/_Table.Th.stories.d.ts +15 -0
  102. package/dist/components/Table/_Table.Tr.stories.d.ts +15 -0
  103. package/dist/components/Tabs/Tab.d.ts +5 -0
  104. package/dist/components/Tabs/Tab.js +179 -6
  105. package/dist/components/Tabs/Tab.stories.d.ts +15 -0
  106. package/dist/components/Tabs/TabPanel.d.ts +4 -0
  107. package/dist/components/Tabs/TabPanel.js +12 -12
  108. package/dist/components/Tabs/TabPanel.stories.d.ts +14 -0
  109. package/dist/components/Tabs/Tabs.d.ts +5 -1
  110. package/dist/components/Tabs/Tabs.js +242 -668
  111. package/dist/components/Tabs/Tabs.stories.d.ts +14 -0
  112. package/dist/components/TextDisplay/TextDisplay.d.ts +23 -0
  113. package/dist/components/TextDisplay/TextDisplay.js +37 -0
  114. package/dist/components/TextDisplay/TextDisplay.stories.d.ts +13 -0
  115. package/dist/components/TextDisplay/textDisplay.test.d.ts +1 -0
  116. package/dist/components/Toggle/Toggle.js +143 -129
  117. package/dist/components/ToggleGroup/Group.d.ts +18 -0
  118. package/dist/components/ToggleGroup/Group.js +7 -0
  119. package/dist/components/ToggleGroup/Group.test.d.ts +1 -0
  120. package/dist/components/ToggleGroup/Toggle.d.ts +15 -0
  121. package/dist/components/ToggleGroup/Toggle.js +17 -0
  122. package/dist/components/ToggleGroup/Toggle.test.d.ts +1 -0
  123. package/dist/components/ToggleGroup/ToggleGroup.d.ts +2 -0
  124. package/dist/components/ToggleGroup/ToggleGroup.js +6 -0
  125. package/dist/components/ToggleGroup/ToggleGroup.stories.d.ts +25 -0
  126. package/dist/components/Tooltip/Tooltip.d.ts +22 -6
  127. package/dist/components/Tooltip/Tooltip.js +114 -1339
  128. package/dist/components/Tooltip/Tooltip.stories.d.ts +35 -0
  129. package/dist/components/Typography/Typography.d.ts +4 -2
  130. package/dist/components/Typography/Typography.js +56 -73
  131. package/dist/components/Typography/Typography.stories.d.ts +1 -0
  132. package/dist/contexts/SnackbarProvider/SnackbarProvider.d.ts +11 -0
  133. package/dist/contexts/SnackbarProvider/SnackbarProvider.js +50 -0
  134. package/dist/contexts/SnackbarProvider/SnackbarProvider.stories.d.ts +21 -0
  135. package/dist/{index-CqjC7P5Y.js → index-CH45lKw7.js} +333 -307
  136. package/dist/{index-BNWbc5Kh.js → index-CjW42-M-.js} +3108 -3152
  137. package/dist/main.d.ts +10 -1
  138. package/dist/main.js +73 -55
  139. package/dist/marola.css +1 -0
  140. package/dist/{useButton-Bc8IAgyk.js → useButton-DNk3wrQp.js} +3 -4
  141. package/dist/useCompoundItem-D1iRfg8D.js +84 -0
  142. package/dist/useEventCallback-xTG9piMa.js +45 -0
  143. package/dist/useList-B0hog_3-.js +436 -0
  144. package/dist/utils/styleStrings.d.ts +1 -1
  145. package/dist/utils/styleStrings.js +7 -7
  146. package/package.json +4 -4
  147. package/dist/Dialog.module-CGVM5V_D.js +0 -15
  148. package/dist/Tab-CRwnhsj5.js +0 -254
  149. package/dist/Tabs.module-yYcTJnj6.js +0 -103
  150. package/dist/_commonjsHelpers-CT_km90n.js +0 -30
  151. package/dist/assets/global.css +0 -1
  152. package/dist/components/Button/Button.stories.js +0 -40
  153. package/dist/components/Dialog/Dialog.stories.js +0 -59
  154. package/dist/components/Dialog/Title.js +0 -29
  155. package/dist/components/Input/Input.stories.js +0 -106
  156. package/dist/components/InputSearch/InputSearch.stories.js +0 -36
  157. package/dist/components/LoadingSpinner/LoadingSpinner.stories.js +0 -38
  158. package/dist/components/PageHeader/PageHeader.stories.js +0 -49
  159. package/dist/components/Toggle/Toggle.stories.js +0 -33
  160. package/dist/components/Typography/Typography.stories.js +0 -30
  161. package/dist/components/Typography/typography.test.js +0 -11357
  162. package/dist/magic-string.es-O_8lTkE3.js +0 -738
  163. package/dist/objectWithoutPropertiesLoose-D7Cp0Pg_.js +0 -26
  164. package/dist/utils/styleStrings.test.js +0 -41
  165. package/dist/vi.Y_w82WR8-Df0JUamG.js +0 -9860
@@ -1,29 +1,34 @@
1
1
  import '../../assets/InputSearch.css';
2
- import { jsx as t } from "react/jsx-runtime";
3
- import { c as r } from "../../clsx-DB4S2d7J.js";
2
+ import { jsx as e } from "react/jsx-runtime";
3
+ import { c as m } from "../../clsx-DB4S2d7J.js";
4
4
  import { Icon as p } from "../Icon/Icon.js";
5
- import { Input as m } from "../Input/Input.js";
6
- const u = "_inputSearch_8ayrz_1", a = {
7
- inputSearch: u
8
- }, I = ({
9
- label: n,
10
- placeholder: c,
11
- classNameWrapper: s,
12
- classNameInputSearch: e,
13
- disabled: i,
14
- "data-testid": o
15
- }) => /* @__PURE__ */ t("div", { className: r(a.inputSearch, s), children: /* @__PURE__ */ t(
16
- m,
17
- {
18
- label: n,
19
- type: "search",
20
- placeholder: c,
21
- leftIcon: /* @__PURE__ */ t(p, { icon: "magnifying-glass" }),
22
- "data-testid": o,
23
- disabled: i,
24
- classNameInput: r(a.input, e)
25
- }
26
- ) });
5
+ import { Input as u } from "../Input/Input.js";
6
+ const l = "_inputSearch_114e1_1", h = {
7
+ inputSearch: l
8
+ };
9
+ let n;
10
+ const d = ({
11
+ classNameWrapper: r,
12
+ triggerDelay: o = 500,
13
+ value: c,
14
+ onChange: i = () => {
15
+ },
16
+ ...a
17
+ }) => {
18
+ const s = (t) => {
19
+ n && clearTimeout(n), n = setTimeout(() => i(t), o);
20
+ };
21
+ return /* @__PURE__ */ e("div", { className: m(h.inputSearch, r), children: /* @__PURE__ */ e(
22
+ u,
23
+ {
24
+ type: "search",
25
+ ...a,
26
+ leftIcon: /* @__PURE__ */ e(p, { icon: "magnifying-glass" }),
27
+ defaultValue: c,
28
+ onChange: (t) => s(t)
29
+ }
30
+ ) });
31
+ };
27
32
  export {
28
- I as InputSearch
33
+ d as InputSearch
29
34
  };
@@ -2,12 +2,28 @@ import { StoryObj } from '@storybook/react';
2
2
 
3
3
  declare const meta: {
4
4
  title: string;
5
- component: ({ label, placeholder, classNameWrapper, classNameInputSearch, disabled, "data-testid": dataTestId, }: import('react').InputHTMLAttributes<HTMLInputElement> & {
5
+ component: ({ classNameWrapper, triggerDelay, value, onChange, ...rest }: {
6
+ triggerDelay?: number | undefined;
7
+ } & import('react').InputHTMLAttributes<HTMLInputElement> & {
6
8
  label?: string | undefined;
7
- placeholder?: string | undefined;
9
+ infoMessage?: string | undefined;
10
+ errorMessage?: string | undefined;
11
+ leftIcon?: import('react').ReactNode;
12
+ rightIcon?: import('react').ReactNode;
13
+ type?: "search" | "text" | "password" | undefined;
14
+ hideCharsCounter?: boolean | undefined;
8
15
  classNameWrapper?: string | undefined;
9
- classNameInputSearch?: string | undefined;
10
- 'data-testid'?: string | undefined;
16
+ classNameLabel?: string | undefined;
17
+ classNameInput?: string | undefined;
18
+ classNameInfoMessage?: string | undefined;
19
+ classNameErrorMessage?: string | undefined;
20
+ classNameCharsCounter?: string | undefined;
21
+ 'data-testid-wrapper'?: string | undefined;
22
+ 'data-testid-label'?: string | undefined;
23
+ 'data-testid-input'?: string | undefined;
24
+ 'data-testid-infoMessage'?: string | undefined;
25
+ 'data-testid-errorMessage'?: string | undefined;
26
+ 'data-testid-charsCounter'?: string | undefined;
11
27
  }) => import("react/jsx-runtime").JSX.Element;
12
28
  tags: string[];
13
29
  parameters: {
@@ -18,5 +34,6 @@ export default meta;
18
34
  type Story = StoryObj<typeof meta>;
19
35
  export declare const Simple: Story;
20
36
  export declare const WithLabel: Story;
37
+ export declare const WithCustomDelay: Story;
21
38
  export declare const WithPlaceholder: Story;
22
39
  export declare const Disabled: Story;
@@ -1,7 +1,7 @@
1
1
  export interface LoadingSpinnerProps {
2
2
  /** Whether to invert colours or not */
3
3
  invert?: boolean;
4
- /** Space seperated list of CSS classes to apply */
4
+ /** Space separated list of CSS classes to apply */
5
5
  classNames?: string;
6
6
  }
7
7
  export declare const LoadingSpinner: ({ invert, classNames }: LoadingSpinnerProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,14 +1,33 @@
1
1
  import { RequireAllOrNone } from '../../types/helpers';
2
2
  import { ReactNode } from 'react';
3
3
 
4
+ type BreadcrumbItem = {
5
+ /** Breadcrumb item label */
6
+ label: string;
7
+ /** Id to be applied as `data-testid` on the breadcrumb item */
8
+ 'data-testid'?: string;
9
+ /** CSS classes to be applied on the breadcrumb item */
10
+ className?: string;
11
+ /** Callback called when the breadcrumb item is clicked */
12
+ onClick: () => void;
13
+ };
14
+ type LastBreadcrumbItem = Omit<BreadcrumbItem, 'onClick'> & {
15
+ /** Callback called when the breadcrumb item is clicked */
16
+ onClick?: () => void;
17
+ };
4
18
  type PageHeaderCommonProps = {
5
19
  /** Title text */
6
20
  title: string;
7
21
  /** Subtitle text */
8
22
  subtitle?: string;
9
- /** Back link text */
23
+ /** Back link text
24
+ * @deprecated Use breadcrumb prop instead.
25
+ */
10
26
  backLinkText?: string;
11
- /** Callback called when `back link` is clicked */
27
+ /**
28
+ * Callback called when `back link` is clicked
29
+ * @deprecated Use breadcrumb prop instead.
30
+ * */
12
31
  onBackLinkClick?: () => void;
13
32
  /** Element to be rendered on the right slot of the component */
14
33
  rightChildren?: ReactNode;
@@ -16,7 +35,10 @@ type PageHeaderCommonProps = {
16
35
  bottomChildren?: ReactNode;
17
36
  /** CSS classes to be applied on the container element */
18
37
  classNameWrapper?: string;
19
- /** CSS classes to be applied on the back link element */
38
+ /**
39
+ * CSS classes to be applied on the back link element
40
+ * @deprecated Use breadcrumb prop instead.
41
+ * */
20
42
  classNameBackLink?: string;
21
43
  /** CSS classes to be applied on the title element */
22
44
  classNameTitle?: string;
@@ -24,13 +46,21 @@ type PageHeaderCommonProps = {
24
46
  classNameSubtitle?: string;
25
47
  /** Id to be applied as `data-testid` on the container element */
26
48
  'data-testid-wrapper'?: string;
27
- /** Id to be applied as `data-testid` on the back link element */
49
+ /**
50
+ * Id to be applied as `data-testid` on the back link element
51
+ * @deprecated Use breadcrumb prop instead.
52
+ * */
28
53
  'data-testid-backLink'?: string;
29
54
  /** Id to be applied as `data-testid` on the title element */
30
55
  'data-testid-title'?: string;
31
56
  /** Id to be applied as `data-testid` on the subtitle element */
32
57
  'data-testid-subtitle'?: string;
58
+ breadcrumb?: never;
59
+ };
60
+ type PageHeaderWithBreadcrumb = Omit<PageHeaderCommonProps, 'backLinkText' | 'onBackLinkClick' | 'classNameBackLink' | 'data-testid-backLink' | 'breadcrumb'> & {
61
+ /** List of breadcrumbs to be rendered at the top of the title */
62
+ breadcrumb?: [...BreadcrumbItem[], LastBreadcrumbItem];
33
63
  };
34
- type PageHeaderProps = RequireAllOrNone<PageHeaderCommonProps, 'backLinkText' | 'onBackLinkClick'>;
35
- export declare const PageHeader: ({ title, subtitle, 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;
64
+ export type PageHeaderProps = RequireAllOrNone<PageHeaderCommonProps, 'backLinkText' | 'onBackLinkClick'> | PageHeaderWithBreadcrumb;
65
+ export declare const PageHeader: ({ title, subtitle, rightChildren, bottomChildren, classNameWrapper, classNameTitle, classNameSubtitle, "data-testid-wrapper": wrapperTestId, "data-testid-title": titleTestId, "data-testid-subtitle": subtitleTestId, ...props }: PageHeaderProps) => import("react/jsx-runtime").JSX.Element;
36
66
  export {};
@@ -1,51 +1,87 @@
1
1
  import '../../assets/PageHeader.css';
2
- import { jsxs as a, jsx as t } from "react/jsx-runtime";
3
- import { c as r } from "../../clsx-DB4S2d7J.js";
4
- import * as _ from "react";
5
- const z = (n) => /* @__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
- }, ...n }, /* @__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" })), b = "_title_157kz_45", k = "_subtitle_157kz_46", e = {
11
- "page-header": "_page-header_157kz_1",
12
- "page-header__top-content": "_page-header__top-content_157kz_9",
13
- "page-header__main-content": "_page-header__main-content_157kz_12",
14
- "page-header__bottom-content": "_page-header__bottom-content_157kz_12",
15
- "page-header__main-left-content": "_page-header__main-left-content_157kz_39",
16
- title: b,
17
- subtitle: k,
18
- "page-header__main-right-content": "_page-header__main-right-content_157kz_63"
19
- }, C = ({
20
- title: n,
21
- subtitle: d,
22
- backLinkText: c,
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": f,
32
- "data-testid-title": u,
33
- "data-testid-subtitle": v,
34
- ...w
35
- }) => /* @__PURE__ */ a("div", { className: r([e["page-header"], l]), "data-testid": g, ...w, children: [
36
- c && /* @__PURE__ */ t("div", { className: e["page-header__top-content"], children: /* @__PURE__ */ a("button", { type: "button", onClick: s, className: h, "data-testid": f, children: [
37
- /* @__PURE__ */ t(z, { fontSize: 16 }),
38
- c
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: r(e.title, m), "data-testid": u, children: n }),
43
- /* @__PURE__ */ t("h2", { className: r(e.subtitle, p), "data-testid": v, children: d })
2
+ import { jsx as a, jsxs as h } from "react/jsx-runtime";
3
+ import { useMemo as L } from "react";
4
+ import { c as n } from "../../clsx-DB4S2d7J.js";
5
+ import { Icon as B } from "../Icon/Icon.js";
6
+ import { IconButton as C } from "../IconButton/IconButton.js";
7
+ const j = "_title_z7ezb_22", w = "_subtitle_z7ezb_43", e = {
8
+ "u-typography-h1": "_u-typography-h1_z7ezb_1",
9
+ "u-typography-h2": "_u-typography-h2_z7ezb_8",
10
+ "u-typography-h3": "_u-typography-h3_z7ezb_15",
11
+ "u-typography-h4": "_u-typography-h4_z7ezb_22",
12
+ "page-header__main-left-content": "_page-header__main-left-content_z7ezb_22",
13
+ title: j,
14
+ "u-typography-h5": "_u-typography-h5_z7ezb_29",
15
+ "u-typography-h6": "_u-typography-h6_z7ezb_36",
16
+ "u-typography-base": "_u-typography-base_z7ezb_43",
17
+ subtitle: w,
18
+ "u-typography-base--xxl": "_u-typography-base--xxl_z7ezb_48",
19
+ "u-typography-base--xl": "_u-typography-base--xl_z7ezb_52",
20
+ "u-typography-base--lg": "_u-typography-base--lg_z7ezb_56",
21
+ "u-typography-base--sm": "_u-typography-base--sm_z7ezb_60",
22
+ "u-typography-base--bold": "_u-typography-base--bold_z7ezb_64",
23
+ "u-typography-base--strikethrough": "_u-typography-base--strikethrough_z7ezb_67",
24
+ "u-typography-base--underlined": "_u-typography-base--underlined_z7ezb_70",
25
+ "u-typography-base--strikethrough-underlined": "_u-typography-base--strikethrough-underlined_z7ezb_73",
26
+ "page-header": "_page-header_z7ezb_22",
27
+ "page-header__top-content": "_page-header__top-content_z7ezb_86",
28
+ "page-header__main-content": "_page-header__main-content_z7ezb_89",
29
+ "page-header__bottom-content": "_page-header__bottom-content_z7ezb_89",
30
+ "page-header__breadcrumb": "_page-header__breadcrumb_z7ezb_103",
31
+ "page-header__breadcrumb__separator": "_page-header__breadcrumb__separator_z7ezb_108",
32
+ "page-header__main-right-content": "_page-header__main-right-content_z7ezb_131"
33
+ }, P = ({
34
+ title: l,
35
+ subtitle: g,
36
+ rightChildren: d,
37
+ bottomChildren: b,
38
+ classNameWrapper: y,
39
+ classNameTitle: u,
40
+ classNameSubtitle: z,
41
+ "data-testid-wrapper": m,
42
+ "data-testid-title": k,
43
+ "data-testid-subtitle": N,
44
+ ...f
45
+ }) => {
46
+ const {
47
+ breadcrumb: r,
48
+ backLinkText: p,
49
+ onBackLinkClick: s,
50
+ classNameBackLink: c,
51
+ "data-testid-backLink": i,
52
+ ...x
53
+ } = f, v = L(() => {
54
+ const _ = [];
55
+ return p && s && _.push({
56
+ label: p,
57
+ className: c,
58
+ "data-testid": i,
59
+ onClick: s
60
+ }), r && _.push(...r), /* @__PURE__ */ a("div", { className: e["page-header__top-content"], children: /* @__PURE__ */ a("div", { className: e["page-header__breadcrumb"], children: _.map((t, o) => /* @__PURE__ */ a(
61
+ C,
62
+ {
63
+ icon: o === 0 ? /* @__PURE__ */ a(B, { icon: "arrow-left" }) : /* @__PURE__ */ a("span", { className: e["page-header__breadcrumb__separator"], children: "/" }),
64
+ onClick: () => t.onClick && t.onClick(),
65
+ className: t.className,
66
+ "data-testid": t["data-testid"],
67
+ disabled: _.length === 1 ? !1 : o === _.length - 1,
68
+ children: t.label
69
+ },
70
+ `${t.label}_${o}`
71
+ )) }) });
72
+ }, [r, p, c, i, s]);
73
+ return /* @__PURE__ */ h("div", { className: n([e["page-header"], y]), "data-testid": m, ...x, children: [
74
+ v,
75
+ /* @__PURE__ */ h("div", { className: e["page-header__main-content"], children: [
76
+ /* @__PURE__ */ h("div", { className: e["page-header__main-left-content"], children: [
77
+ /* @__PURE__ */ a("h1", { className: n(e.title, u), "data-testid": k, children: l }),
78
+ /* @__PURE__ */ a("h2", { className: n(e.subtitle, z), "data-testid": N, children: g })
79
+ ] }),
80
+ d && /* @__PURE__ */ a("div", { className: e["page-header__main-right-content"], children: d })
44
81
  ] }),
45
- 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
- ] });
82
+ b && /* @__PURE__ */ a("div", { className: e["page-header__bottom-content"], children: b })
83
+ ] });
84
+ };
49
85
  export {
50
- C as PageHeader
86
+ P as PageHeader
51
87
  };
@@ -2,42 +2,13 @@ import { StoryObj } from '@storybook/react';
2
2
 
3
3
  declare const meta: {
4
4
  title: string;
5
- component: ({ title, subtitle, 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;
5
+ component: ({ title, subtitle, rightChildren, bottomChildren, classNameWrapper, classNameTitle, classNameSubtitle, "data-testid-wrapper": wrapperTestId, "data-testid-title": titleTestId, "data-testid-subtitle": subtitleTestId, ...props }: import('./PageHeader').PageHeaderProps) => import("react/jsx-runtime").JSX.Element;
36
6
  tags: string[];
37
7
  };
38
8
  export default meta;
39
9
  type Story = StoryObj<typeof meta>;
40
10
  export declare const Simple: Story;
41
11
  export declare const WithBackLink: Story;
12
+ export declare const WithBreadcrumb: Story;
42
13
  export declare const WithRightChildren: Story;
43
14
  export declare const WithBottomChildren: Story;
@@ -1,36 +1,55 @@
1
1
  export type PaginationParams = {
2
+ /** Total number of items to paginate */
2
3
  totalItems: number;
4
+ /** Number of items to show per page */
3
5
  perPage: number;
6
+ /** Current page */
4
7
  currentPage: number;
5
8
  };
6
9
  export type PaginationTranslations = {
10
+ /** Translation text for `showing` */
7
11
  showing: string;
12
+ /** Translation text for `of` */
8
13
  of: string;
14
+ /** Translation text for `result` */
9
15
  results: string;
16
+ /** Translation text for `previous` */
10
17
  previous: string;
18
+ /** Translation text for `next` */
11
19
  next: string;
12
20
  };
13
21
  type PaginationLanguages = 'pt' | 'en';
14
22
  type PaginationCommonProps = {
23
+ /** CSS classes to be applied on the container element */
15
24
  className?: string;
16
- 'data-testid'?: string;
25
+ /** CSS classes to be applied on the per page element */
17
26
  classNamePerPage?: string;
18
- 'data-testid__per-page'?: string;
27
+ /** CSS classes to be applied on the pages navigation element */
19
28
  classNamePagesNav?: string;
20
- 'data-testid__pages-nav'?: string;
29
+ /** Id to be applied as `data-testid` on the container element */
30
+ 'data-testid'?: string;
31
+ /** Id to be applied as `data-testid` on per page element */
32
+ 'data-testid-per-page'?: string;
33
+ /** Id to be applied as `data-testid` on the pages navigation element */
34
+ 'data-testid-pages-nav'?: string;
21
35
  };
22
36
  export type PaginationProps = {
37
+ /** Array of options to be rendered as per page options. */
23
38
  perPageOptions?: (number | {
24
39
  value: number;
25
40
  label: string;
26
41
  })[] | undefined;
42
+ /** Callback called when page changes. */
27
43
  onPageChange: (page: number) => void;
28
- onRowsPerPageChange: (perPage: number | string) => void;
44
+ /** Callback called when items per page changes. */
45
+ onRowsPerPageChange: (perPage: number) => void;
46
+ /** Language to be used for texts. */
29
47
  language?: PaginationLanguages;
48
+ /** Custom translation object to be used for texts. */
30
49
  t?: PaginationTranslations;
31
50
  } & PaginationParams & PaginationCommonProps;
32
51
  export declare const paginationDefaultTranslations: {
33
52
  [key in PaginationLanguages]: PaginationTranslations;
34
53
  };
35
- export declare const Pagination: (props: PaginationProps) => import("react/jsx-runtime").JSX.Element;
54
+ export declare const Pagination: ({ perPageOptions, language, ...props }: PaginationProps) => import("react/jsx-runtime").JSX.Element;
36
55
  export {};