@pismo/marola 0.0.1-alpha.32 → 0.0.1-alpha.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (170) hide show
  1. package/README.md +2 -13
  2. package/dist/{Button-2b1peDFT.js → Button-D--uN90N.js} +26 -25
  3. package/dist/Dialog.module-BKWFakxu.js +15 -0
  4. package/dist/ListContext-Dj2Va7Iv.js +18 -0
  5. package/dist/Tabs.module-BKlNuSPH.js +66 -0
  6. package/dist/assets/Button.css +1 -1
  7. package/dist/assets/Dialog.css +1 -1
  8. package/dist/assets/IconButton.css +1 -1
  9. package/dist/assets/PageHeader.css +1 -1
  10. package/dist/assets/Pagination.css +1 -1
  11. package/dist/assets/Tabs.css +1 -1
  12. package/dist/assets/Typography.css +1 -1
  13. package/dist/assets/main.css +1 -0
  14. package/dist/components/Button/Button.d.ts +2 -13
  15. package/dist/components/Button/Button.js +49 -60
  16. package/dist/components/Dialog/Actions.js +1 -1
  17. package/dist/components/Dialog/Backdrop.d.ts +1 -1
  18. package/dist/components/Dialog/Backdrop.js +1 -1
  19. package/dist/components/Dialog/CloseIconButton.js +124 -12
  20. package/dist/components/Dialog/Dialog.d.ts +3 -4
  21. package/dist/components/Dialog/Dialog.js +20098 -444
  22. package/dist/components/Dialog/{DialogTitle.d.ts → Title.d.ts} +3 -3
  23. package/dist/components/Dialog/Title.js +29 -0
  24. package/dist/components/IconButton/IconButton.d.ts +5 -21
  25. package/dist/components/IconButton/IconButton.js +76 -60
  26. package/dist/components/LoadingSpinner/LoadingSpinner.d.ts +0 -2
  27. package/dist/components/PageHeader/PageHeader.d.ts +16 -56
  28. package/dist/components/PageHeader/PageHeader.js +65 -83
  29. package/dist/components/Pagination/Pagination.d.ts +6 -25
  30. package/dist/components/Pagination/Pagination.js +113 -131
  31. package/dist/components/SortTooltip/SortTooltip.d.ts +0 -28
  32. package/dist/components/SortTooltip/SortTooltip.js +1 -93
  33. package/dist/components/Table/Table.d.ts +0 -56
  34. package/dist/components/Table/Table.js +1 -137
  35. package/dist/components/Table/TableContext.d.ts +0 -19
  36. package/dist/components/Table/TableContext.js +1 -21
  37. package/dist/components/Tabs/Tab.d.ts +1 -6
  38. package/dist/components/Tabs/Tab.js +173 -113
  39. package/dist/components/Tabs/TabPanel.d.ts +1 -5
  40. package/dist/components/Tabs/TabPanel.js +16 -15
  41. package/dist/components/Tabs/Tabs.d.ts +2 -8
  42. package/dist/components/Tabs/Tabs.js +664 -242
  43. package/dist/components/Tooltip/Tooltip.d.ts +0 -33
  44. package/dist/components/Tooltip/Tooltip.js +1 -141
  45. package/dist/components/Typography/Typography.d.ts +6 -17
  46. package/dist/components/Typography/Typography.js +58 -58
  47. package/dist/{index-CH45lKw7.js → index-BvA1HyDs.js} +300 -322
  48. package/dist/main.d.ts +8 -27
  49. package/dist/main.js +28 -75
  50. package/dist/objectWithoutPropertiesLoose-ClNcje2_.js +22 -0
  51. package/dist/types/helpers.d.ts +0 -8
  52. package/dist/useButton-abQpo0za.js +187 -0
  53. package/dist/useCompoundItem-wTwXbURC.js +41 -0
  54. package/package.json +9 -30
  55. package/dist/ClickAwayListener-BSW-Nd-y.js +0 -107
  56. package/dist/Dialog.module-DFEmFdYT.js +0 -30
  57. package/dist/Group-B3p31ftp.js +0 -26
  58. package/dist/Popup-B6ZSGIEI.js +0 -1248
  59. package/dist/Portal-DIeBsWdL.js +0 -73
  60. package/dist/SelectButton-C8JQKaf4.js +0 -61
  61. package/dist/Tabs.module-jkH1Qjn7.js +0 -22
  62. package/dist/Toggle-BCgIItCc.js +0 -142
  63. package/dist/assets/Advice.css +0 -1
  64. package/dist/assets/Checkbox.css +0 -1
  65. package/dist/assets/EllipsisTooltip.css +0 -1
  66. package/dist/assets/Group.css +0 -1
  67. package/dist/assets/Input.css +0 -1
  68. package/dist/assets/InputSearch.css +0 -1
  69. package/dist/assets/SelectButton.css +0 -1
  70. package/dist/assets/Skeleton.css +0 -1
  71. package/dist/assets/Snackbar.css +0 -1
  72. package/dist/assets/SortTooltip.css +0 -1
  73. package/dist/assets/Stepper.css +0 -1
  74. package/dist/assets/Table.css +0 -1
  75. package/dist/assets/TextDisplay.css +0 -1
  76. package/dist/assets/Toggle.css +0 -1
  77. package/dist/assets/Toggle2.css +0 -1
  78. package/dist/assets/Tooltip.css +0 -1
  79. package/dist/combineHooksSlotProps-DVjg9PRh.js +0 -80
  80. package/dist/components/Advice/Advice.d.ts +0 -30
  81. package/dist/components/Advice/Advice.js +0 -47
  82. package/dist/components/Advice/Advice.stories.d.ts +0 -18
  83. package/dist/components/Button/Button.stories.d.ts +0 -62
  84. package/dist/components/Checkbox/Checkbox.d.ts +0 -34
  85. package/dist/components/Checkbox/Checkbox.js +0 -71
  86. package/dist/components/Checkbox/Checkbox.stories.d.ts +0 -31
  87. package/dist/components/Chip/Chip.d.ts +0 -39
  88. package/dist/components/Chip/Chip.js +0 -19
  89. package/dist/components/Chip/Chip.stories.d.ts +0 -42
  90. package/dist/components/Chip/chip.test.d.ts +0 -1
  91. package/dist/components/Dialog/Dialog.stories.d.ts +0 -343
  92. package/dist/components/Dialog/DialogTitle.js +0 -29
  93. package/dist/components/EllipsisTooltip/EllipsisTooltip.d.ts +0 -7
  94. package/dist/components/EllipsisTooltip/EllipsisTooltip.js +0 -23
  95. package/dist/components/EllipsisTooltip/EllipsisTooltip.stories.d.ts +0 -31
  96. package/dist/components/Icon/Icon.d.ts +0 -11
  97. package/dist/components/Icon/Icon.js +0 -127
  98. package/dist/components/Icon/Icon.stories.d.ts +0 -15
  99. package/dist/components/Icon/types.d.ts +0 -5
  100. package/dist/components/Icon/types.js +0 -1
  101. package/dist/components/IconButton/Icon.stories.d.ts +0 -15
  102. package/dist/components/Input/Input.d.ts +0 -44
  103. package/dist/components/Input/Input.js +0 -508
  104. package/dist/components/Input/Input.stories.d.ts +0 -43
  105. package/dist/components/InputSearch/InputSearch.d.ts +0 -9
  106. package/dist/components/InputSearch/InputSearch.js +0 -34
  107. package/dist/components/InputSearch/InputSearch.stories.d.ts +0 -39
  108. package/dist/components/LoadingSpinner/LoadingSpinner.stories.d.ts +0 -14
  109. package/dist/components/PageHeader/PageHeader.stories.d.ts +0 -14
  110. package/dist/components/Pagination/Pagination.stories.d.ts +0 -17
  111. package/dist/components/Select/Select.d.ts +0 -26
  112. package/dist/components/Select/Select.js +0 -857
  113. package/dist/components/Select/Select.stories.d.ts +0 -22
  114. package/dist/components/Select/SelectButton.d.ts +0 -12
  115. package/dist/components/Select/SelectButton.js +0 -8
  116. package/dist/components/Skeleton/Skeleton.d.ts +0 -25
  117. package/dist/components/Skeleton/Skeleton.js +0 -23
  118. package/dist/components/Skeleton/Skeleton.stories.d.ts +0 -14
  119. package/dist/components/Skeleton/SkeletonCircle.stories.d.ts +0 -14
  120. package/dist/components/Skeleton/SkeletonTable.stories.d.ts +0 -16
  121. package/dist/components/Snackbar/Snackbar.d.ts +0 -27
  122. package/dist/components/Snackbar/Snackbar.js +0 -639
  123. package/dist/components/Snackbar/Snackbar.stories.d.ts +0 -319
  124. package/dist/components/Stepper/Stepper.d.ts +0 -26
  125. package/dist/components/Stepper/Stepper.js +0 -48
  126. package/dist/components/Stepper/Stepper.stories.d.ts +0 -16
  127. package/dist/components/Table/Table.stories.d.ts +0 -29
  128. package/dist/components/Table/_Table.TBody.stories.d.ts +0 -14
  129. package/dist/components/Table/_Table.THead.stories.d.ts +0 -14
  130. package/dist/components/Table/_Table.Td.stories.d.ts +0 -16
  131. package/dist/components/Table/_Table.Th.stories.d.ts +0 -15
  132. package/dist/components/Table/_Table.Tr.stories.d.ts +0 -15
  133. package/dist/components/Tabs/Tab.stories.d.ts +0 -15
  134. package/dist/components/Tabs/TabPanel.stories.d.ts +0 -14
  135. package/dist/components/Tabs/Tabs.stories.d.ts +0 -14
  136. package/dist/components/TextDisplay/TextDisplay.d.ts +0 -23
  137. package/dist/components/TextDisplay/TextDisplay.js +0 -37
  138. package/dist/components/TextDisplay/TextDisplay.stories.d.ts +0 -13
  139. package/dist/components/TextDisplay/textDisplay.test.d.ts +0 -1
  140. package/dist/components/Toggle/Toggle.d.ts +0 -11
  141. package/dist/components/Toggle/Toggle.js +0 -266
  142. package/dist/components/Toggle/Toggle.stories.d.ts +0 -21
  143. package/dist/components/ToggleGroup/Group.d.ts +0 -18
  144. package/dist/components/ToggleGroup/Group.js +0 -7
  145. package/dist/components/ToggleGroup/Group.test.d.ts +0 -1
  146. package/dist/components/ToggleGroup/Toggle.d.ts +0 -15
  147. package/dist/components/ToggleGroup/Toggle.js +0 -17
  148. package/dist/components/ToggleGroup/Toggle.test.d.ts +0 -1
  149. package/dist/components/ToggleGroup/ToggleGroup.d.ts +0 -2
  150. package/dist/components/ToggleGroup/ToggleGroup.js +0 -6
  151. package/dist/components/ToggleGroup/ToggleGroup.stories.d.ts +0 -25
  152. package/dist/components/Tooltip/Tooltip.stories.d.ts +0 -35
  153. package/dist/components/Typography/Typography.stories.d.ts +0 -32
  154. package/dist/components/Typography/typography.test.d.ts +0 -1
  155. package/dist/contexts/SnackbarProvider/SnackbarProvider.d.ts +0 -11
  156. package/dist/contexts/SnackbarProvider/SnackbarProvider.js +0 -50
  157. package/dist/contexts/SnackbarProvider/SnackbarProvider.stories.d.ts +0 -21
  158. package/dist/index-CjW42-M-.js +0 -19584
  159. package/dist/marola.css +0 -1
  160. package/dist/test-utils/assertStyles.d.ts +0 -1
  161. package/dist/test-utils/assertStyles.js +0 -11
  162. package/dist/useButton-DNk3wrQp.js +0 -105
  163. package/dist/useCompoundItem-D1iRfg8D.js +0 -84
  164. package/dist/useEventCallback-xTG9piMa.js +0 -45
  165. package/dist/useIsFocusVisible-BH4IAdcw.js +0 -69
  166. package/dist/useList-B0hog_3-.js +0 -436
  167. package/dist/useTimeout-DxF9kiZL.js +0 -36
  168. package/dist/utils/styleStrings.d.ts +0 -6
  169. package/dist/utils/styleStrings.js +0 -10
  170. package/dist/utils/styleStrings.test.d.ts +0 -1
@@ -1,11 +1,11 @@
1
1
  import { ReactNode } from 'react';
2
2
 
3
- export interface DialogTitleProps {
3
+ export interface TitleProps {
4
4
  /** title to be displayed */
5
5
  title?: ReactNode;
6
6
  /** subtitle to be displayed */
7
7
  subTitle?: ReactNode;
8
8
  }
9
9
  /** internal component only - used by the dialog */
10
- declare const DialogTitle: ({ title, subTitle }: DialogTitleProps) => import("react/jsx-runtime").JSX.Element;
11
- export default DialogTitle;
10
+ declare const Title: ({ title, subTitle }: TitleProps) => import("react/jsx-runtime").JSX.Element;
11
+ export default Title;
@@ -0,0 +1,29 @@
1
+ import { jsxs as l, Fragment as s, jsx as e } from "react/jsx-runtime";
2
+ import { Typography as a } from "../Typography/Typography.js";
3
+ import { s as r } from "../../Dialog.module-BKWFakxu.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
+ ),
15
+ /* @__PURE__ */ e("hr", { className: r.dialog__divider, "aria-hidden": !0 }),
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
+ )
26
+ ] });
27
+ export {
28
+ n as default
29
+ };
@@ -1,38 +1,22 @@
1
1
  import { Either } from '../../types/helpers';
2
- import { ReactNode, SyntheticEvent } from 'react';
2
+ import { ReactNode } from 'react';
3
3
 
4
- type variant = 'primary' | 'square';
4
+ type variant = "primary" | "square";
5
5
  type IconButtonCoreProps = {
6
- /** The icon can be any ReactNode element, including the Icon component. */
7
6
  icon: ReactNode;
8
- /** Loading status */
9
7
  loading?: boolean;
10
- /** Disabled status */
11
8
  disabled?: boolean;
12
- /** ClassNames for MuiButton */
13
9
  className?: string;
14
- /** Children content */
15
10
  children?: ReactNode;
16
- /** Variant of component */
17
11
  variant?: variant;
18
- /** Id to be applied as `data-testid` on the container element */
19
- 'data-testid'?: string;
20
12
  };
21
13
  interface IconButtonPropsWithLink extends IconButtonCoreProps {
22
- /** Link to access when Icon Button is clicked */
23
14
  link: string;
24
15
  }
25
16
  interface IconButtonPropsWithOnClick extends IconButtonCoreProps {
26
- /** Functionality executed when the Icon Button is clicked */
27
- onClick: (e: SyntheticEvent<HTMLButtonElement>) => void;
28
- /** Button type */
29
- type?: HTMLButtonElement['type'];
17
+ onClick: () => void;
18
+ type?: HTMLButtonElement["type"];
30
19
  }
31
20
  export type IconButtonProps = Either<IconButtonPropsWithLink, IconButtonPropsWithOnClick>;
32
- /**
33
- * The icon button is used in some cases where you need the icon to be pressed, sometimes it can contain text.
34
- * Icon buttons are commonly found in app bars and toolbars.
35
- * Icons are also appropriate for toggle buttons that allow a single choice to be selected or deselected, such as adding or removing a star to an item.
36
- */
37
- export declare const IconButton: import('react').ForwardRefExoticComponent<IconButtonProps & import('react').RefAttributes<HTMLButtonElement>>;
21
+ export declare const IconButton: import('react').ForwardRefExoticComponent<IconButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
38
22
  export default IconButton;
@@ -1,63 +1,79 @@
1
1
  import '../../assets/IconButton.css';
2
- import { jsx as a, jsxs as c } from "react/jsx-runtime";
3
- import { forwardRef as x, useMemo as d } from "react";
4
- import { c as l } from "../../clsx-DB4S2d7J.js";
5
- import { LoadingSpinner as j } from "../LoadingSpinner/LoadingSpinner.js";
6
- import { B as m } from "../../Button-2b1peDFT.js";
7
- const o = {
8
- "u-typography-h1": "_u-typography-h1_1xyj5_1",
9
- "u-typography-h2": "_u-typography-h2_1xyj5_8",
10
- "u-typography-h3": "_u-typography-h3_1xyj5_15",
11
- "u-typography-h4": "_u-typography-h4_1xyj5_22",
12
- "u-typography-h5": "_u-typography-h5_1xyj5_29",
13
- "u-typography-h6": "_u-typography-h6_1xyj5_36",
14
- "u-typography-base": "_u-typography-base_1xyj5_43",
15
- "icon-button": "_icon-button_1xyj5_43",
16
- "u-typography-base--xxl": "_u-typography-base--xxl_1xyj5_48",
17
- "u-typography-base--xl": "_u-typography-base--xl_1xyj5_52",
18
- "u-typography-base--lg": "_u-typography-base--lg_1xyj5_56",
19
- "u-typography-base--sm": "_u-typography-base--sm_1xyj5_60",
20
- "u-typography-base--bold": "_u-typography-base--bold_1xyj5_64",
21
- "u-typography-base--strikethrough": "_u-typography-base--strikethrough_1xyj5_67",
22
- "u-typography-base--underlined": "_u-typography-base--underlined_1xyj5_70",
23
- "u-typography-base--strikethrough-underlined": "_u-typography-base--strikethrough-underlined_1xyj5_73",
24
- "icon-button--primary": "_icon-button--primary_1xyj5_86",
25
- "icon-button--square": "_icon-button--square_1xyj5_108",
26
- "icon-button__container": "_icon-button__container_1xyj5_124"
27
- }, B = x((r, p) => {
28
- const {
29
- onClick: _,
30
- icon: e,
31
- link: u,
32
- loading: n,
33
- children: h,
34
- type: s = "button",
35
- disabled: i,
36
- className: y,
37
- variant: t = "primary",
38
- "data-testid": g
39
- } = r, b = d(
40
- () => l([o["icon-button"], o[`icon-button--${t}`], y]),
41
- [y, t]
42
- );
43
- return /* @__PURE__ */ a(
44
- m,
45
- {
46
- type: s,
47
- href: u,
48
- onClick: _,
49
- disabled: i,
50
- className: b,
51
- ref: p,
52
- "data-testid": g,
53
- children: /* @__PURE__ */ c("div", { className: o["icon-button__container"], children: [
54
- n ? /* @__PURE__ */ a(j, { invert: !0 }) : e,
55
- t !== "square" && h
56
- ] })
57
- }
58
- );
59
- });
2
+ import { jsx as n, jsxs as q } from "react/jsx-runtime";
3
+ import { forwardRef as h, useMemo as k } from "react";
4
+ import { LoadingSpinner as m } from "../LoadingSpinner/LoadingSpinner.js";
5
+ import { c as v } from "../../clsx-DB4S2d7J.js";
6
+ import { B as y } from "../../Button-D--uN90N.js";
7
+ const f = "_h1_1v5kq_1", p = "_h2_1v5kq_11", g = "_h3_1v5kq_21", w = "_h4_1v5kq_31", x = "_body_1v5kq_41", N = "_quote_1v5kq_75", B = "_form__input_1v5kq_86", j = "_form__hint_1v5kq_91", C = "_form__label_1v5kq_96", I = "_form__dropdown_1v5kq_101", L = "_table__header_1v5kq_107", M = "_table__body_1v5kq_112", R = "_button_1v5kq_123", o = {
8
+ h1: f,
9
+ "h1--bold": "_h1--bold_1v5kq_7",
10
+ h2: p,
11
+ "h2--bold": "_h2--bold_1v5kq_17",
12
+ h3: g,
13
+ "h3--bold": "_h3--bold_1v5kq_27",
14
+ h4: w,
15
+ "h4--bold": "_h4--bold_1v5kq_37",
16
+ body: x,
17
+ "body--large": "_body--large_1v5kq_46",
18
+ "body--medium": "_body--medium_1v5kq_50",
19
+ "body--small": "_body--small_1v5kq_54",
20
+ "body--tiny": "_body--tiny_1v5kq_58",
21
+ "body--bold": "_body--bold_1v5kq_62",
22
+ "body--strikethrough": "_body--strikethrough_1v5kq_65",
23
+ "body--underlined": "_body--underlined_1v5kq_68",
24
+ "body--strikethrough-underlined": "_body--strikethrough-underlined_1v5kq_71",
25
+ quote: N,
26
+ "quote--large": "_quote--large_1v5kq_80",
27
+ form__input: B,
28
+ form__hint: j,
29
+ form__label: C,
30
+ form__dropdown: I,
31
+ table__header: L,
32
+ table__body: M,
33
+ "table__body--secondary": "_table__body--secondary_1v5kq_117",
34
+ button: R,
35
+ "icon-button": "_icon-button_1v5kq_130",
36
+ "icon-button--primary": "_icon-button--primary_1v5kq_142",
37
+ "icon-button--square": "_icon-button--square_1v5kq_164",
38
+ "icon-button__container": "_icon-button__container_1v5kq_180"
39
+ }, E = h(
40
+ (r, e) => {
41
+ const {
42
+ onClick: d,
43
+ icon: b,
44
+ link: i,
45
+ loading: l,
46
+ children: a,
47
+ type: s = "button",
48
+ disabled: c,
49
+ className: t,
50
+ variant: _ = "primary"
51
+ } = r, u = k(
52
+ () => v([
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
+ );
60
76
  export {
61
- B as IconButton,
62
- B as default
77
+ E as IconButton,
78
+ E as default
63
79
  };
@@ -1,7 +1,5 @@
1
1
  export interface LoadingSpinnerProps {
2
- /** Whether to invert colours or not */
3
2
  invert?: boolean;
4
- /** Space separated list of CSS classes to apply */
5
3
  classNames?: string;
6
4
  }
7
5
  export declare const LoadingSpinner: ({ invert, classNames }: LoadingSpinnerProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,66 +1,26 @@
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
- };
18
4
  type PageHeaderCommonProps = {
19
- /** Title text */
20
5
  title: string;
21
- /** Subtitle text */
22
6
  subtitle?: string;
23
- /** Back link text
24
- * @deprecated Use breadcrumb prop instead.
25
- */
26
- backLinkText?: string;
27
- /**
28
- * Callback called when `back link` is clicked
29
- * @deprecated Use breadcrumb prop instead.
30
- * */
31
- onBackLinkClick?: () => void;
32
- /** Element to be rendered on the right slot of the component */
33
7
  rightChildren?: ReactNode;
34
- /** Element to be rendered on the bottom slot of the component */
35
8
  bottomChildren?: ReactNode;
36
- /** CSS classes to be applied on the container element */
37
- classNameWrapper?: string;
38
- /**
39
- * CSS classes to be applied on the back link element
40
- * @deprecated Use breadcrumb prop instead.
41
- * */
42
- classNameBackLink?: string;
43
- /** CSS classes to be applied on the title element */
44
- classNameTitle?: string;
45
- /** CSS classes to be applied on the subtitle element */
46
- classNameSubtitle?: string;
47
- /** Id to be applied as `data-testid` on the container element */
48
- 'data-testid-wrapper'?: string;
49
- /**
50
- * Id to be applied as `data-testid` on the back link element
51
- * @deprecated Use breadcrumb prop instead.
52
- * */
53
- 'data-testid-backLink'?: string;
54
- /** Id to be applied as `data-testid` on the title element */
55
- 'data-testid-title'?: string;
56
- /** Id to be applied as `data-testid` on the subtitle element */
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];
9
+ backLinkText?: string;
10
+ onBackLinkClick?: () => void;
11
+ wrapperClassName?: string;
12
+ backLinkClassName?: string;
13
+ titleClassName?: string;
14
+ subtitleClassName?: string;
15
+ rightChildrenClassName?: string;
16
+ bottomChildrenClassName?: string;
17
+ wrapperTestId?: string;
18
+ backLinkTestId?: string;
19
+ titleTestId?: string;
20
+ subtitleTestId?: string;
21
+ rightChildrenTestId?: string;
22
+ bottomChildrenTestId?: string;
63
23
  };
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;
24
+ type PageHeaderProps = RequireAllOrNone<PageHeaderCommonProps, 'backLinkText' | 'onBackLinkClick'>;
25
+ export declare const PageHeader: ({ title, subtitle, backLinkText, onBackLinkClick, rightChildren, bottomChildren, wrapperClassName, backLinkClassName, titleClassName, subtitleClassName, rightChildrenClassName, bottomChildrenClassName, wrapperTestId, backLinkTestId, titleTestId, subtitleTestId, rightChildrenTestId, bottomChildrenTestId, ...rest }: PageHeaderProps) => import("react/jsx-runtime").JSX.Element;
66
26
  export {};
@@ -1,87 +1,69 @@
1
1
  import '../../assets/PageHeader.css';
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 })
2
+ import { jsxs as c, jsx as t } from "react/jsx-runtime";
3
+ import { c as a } from "../../clsx-DB4S2d7J.js";
4
+ import * as i from "react";
5
+ const C = (n) => /* @__PURE__ */ i.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__ */ i.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" })), y = C, H = "_title_cz9x0_46", j = "_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: H,
17
+ subtitle: j,
18
+ "page-header__main-right-content": "_page-header__main-right-content_cz9x0_64"
19
+ }, L = ({
20
+ title: n,
21
+ subtitle: s,
22
+ backLinkText: r,
23
+ onBackLinkClick: d,
24
+ rightChildren: o,
25
+ bottomChildren: _,
26
+ wrapperClassName: l,
27
+ backLinkClassName: h,
28
+ titleClassName: m,
29
+ subtitleClassName: p,
30
+ rightChildrenClassName: g,
31
+ bottomChildrenClassName: f,
32
+ wrapperTestId: x,
33
+ backLinkTestId: u,
34
+ titleTestId: v,
35
+ subtitleTestId: w,
36
+ rightChildrenTestId: z,
37
+ bottomChildrenTestId: N,
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 }),
42
+ r
43
+ ] }) }),
44
+ /* @__PURE__ */ c("div", { className: e["page-header__main-content"], children: [
45
+ /* @__PURE__ */ c("div", { className: e["page-header__main-left-content"], children: [
46
+ /* @__PURE__ */ t("h1", { className: a(e.title, m), "data-testid": v, children: n }),
47
+ /* @__PURE__ */ t("h3", { className: a(e.subtitle, p), "data-testid": w, children: s })
81
48
  ] }),
82
- b && /* @__PURE__ */ a("div", { className: e["page-header__bottom-content"], children: b })
83
- ] });
84
- };
49
+ o && /* @__PURE__ */ t(
50
+ "div",
51
+ {
52
+ className: a(e["page-header__main-right-content"], g),
53
+ "data-testid": z,
54
+ children: o
55
+ }
56
+ )
57
+ ] }),
58
+ _ && /* @__PURE__ */ t(
59
+ "div",
60
+ {
61
+ className: a(e["page-header__bottom-content"], f),
62
+ "data-testid": N,
63
+ children: _
64
+ }
65
+ )
66
+ ] });
85
67
  export {
86
- P as PageHeader
68
+ L as PageHeader
87
69
  };
@@ -1,55 +1,36 @@
1
1
  export type PaginationParams = {
2
- /** Total number of items to paginate */
3
2
  totalItems: number;
4
- /** Number of items to show per page */
5
3
  perPage: number;
6
- /** Current page */
7
4
  currentPage: number;
8
5
  };
9
6
  export type PaginationTranslations = {
10
- /** Translation text for `showing` */
11
7
  showing: string;
12
- /** Translation text for `of` */
13
8
  of: string;
14
- /** Translation text for `result` */
15
9
  results: string;
16
- /** Translation text for `previous` */
17
10
  previous: string;
18
- /** Translation text for `next` */
19
11
  next: string;
20
12
  };
21
13
  type PaginationLanguages = 'pt' | 'en';
22
14
  type PaginationCommonProps = {
23
- /** CSS classes to be applied on the container element */
24
15
  className?: string;
25
- /** CSS classes to be applied on the per page element */
16
+ 'data-testid'?: string;
26
17
  classNamePerPage?: string;
27
- /** CSS classes to be applied on the pages navigation element */
18
+ 'data-testid__per-page'?: string;
28
19
  classNamePagesNav?: 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;
20
+ 'data-testid__pages-nav'?: string;
35
21
  };
36
22
  export type PaginationProps = {
37
- /** Array of options to be rendered as per page options. */
38
23
  perPageOptions?: (number | {
39
24
  value: number;
40
25
  label: string;
41
26
  })[] | undefined;
42
- /** Callback called when page changes. */
43
27
  onPageChange: (page: number) => void;
44
- /** Callback called when items per page changes. */
45
- onRowsPerPageChange: (perPage: number) => void;
46
- /** Language to be used for texts. */
28
+ onRowsPerPageChange: (perPage: number | string) => void;
47
29
  language?: PaginationLanguages;
48
- /** Custom translation object to be used for texts. */
49
30
  t?: PaginationTranslations;
50
31
  } & PaginationParams & PaginationCommonProps;
51
- export declare const paginationDefaultTranslations: {
32
+ export declare const defaultTranslations: {
52
33
  [key in PaginationLanguages]: PaginationTranslations;
53
34
  };
54
- export declare const Pagination: ({ perPageOptions, language, ...props }: PaginationProps) => import("react/jsx-runtime").JSX.Element;
35
+ export declare const Pagination: (props: PaginationProps) => import("react/jsx-runtime").JSX.Element;
55
36
  export {};