@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
@@ -0,0 +1,80 @@
1
+ import { f as E, b as a } from "./index-CH45lKw7.js";
2
+ import * as r from "react";
3
+ const f = {
4
+ blur: "list:blur",
5
+ focus: "list:focus",
6
+ itemClick: "list:itemClick",
7
+ itemHover: "list:itemHover",
8
+ itemsChange: "list:itemsChange",
9
+ keyDown: "list:keyDown",
10
+ resetHighlight: "list:resetHighlight",
11
+ highlightLast: "list:highlightLast",
12
+ textNavigation: "list:textNavigation",
13
+ clearSelection: "list:clearSelection"
14
+ }, m = /* @__PURE__ */ r.createContext(null);
15
+ process.env.NODE_ENV !== "production" && (m.displayName = "ListContext");
16
+ function b(l) {
17
+ const {
18
+ handlePointerOverEvents: c = !1,
19
+ item: t
20
+ } = l, s = r.useContext(m);
21
+ if (!s)
22
+ throw new Error("useListItem must be used within a ListProvider");
23
+ const {
24
+ dispatch: n,
25
+ getItemState: u
26
+ } = s, {
27
+ highlighted: d,
28
+ selected: p,
29
+ focusable: g
30
+ } = u(t), v = r.useCallback((i) => (e) => {
31
+ var o;
32
+ if ((o = i.onClick) == null || o.call(i, e), !e.defaultPrevented) {
33
+ if (process.env.NODE_ENV !== "production" && t === void 0)
34
+ throw new Error(["MUI: The `item` provided to useListItem() is undefined.", "This should happen only during server-side rendering under React 17."].join(`
35
+ `));
36
+ n({
37
+ type: f.itemClick,
38
+ item: t,
39
+ event: e
40
+ });
41
+ }
42
+ }, [n, t]), C = r.useCallback((i) => (e) => {
43
+ var o;
44
+ if ((o = i.onMouseOver) == null || o.call(i, e), !e.defaultPrevented) {
45
+ if (process.env.NODE_ENV !== "production" && t === void 0)
46
+ throw new Error(["MUI: The `item` provided to useListItem() is undefined.", "This should happen only during server-side rendering under React 17."].join(`
47
+ `));
48
+ n({
49
+ type: f.itemHover,
50
+ item: t,
51
+ event: e
52
+ });
53
+ }
54
+ }, [n, t]);
55
+ let h;
56
+ return g && (h = d ? 0 : -1), {
57
+ getRootProps: (i = {}) => {
58
+ const e = E(i);
59
+ return a({}, i, {
60
+ onClick: v(e),
61
+ onPointerOver: c ? C(e) : void 0,
62
+ tabIndex: h
63
+ });
64
+ },
65
+ highlighted: d,
66
+ selected: p
67
+ };
68
+ }
69
+ function x(l, c) {
70
+ return function(s = {}) {
71
+ const n = a({}, s, l(s));
72
+ return a({}, n, c(n));
73
+ };
74
+ }
75
+ export {
76
+ f as L,
77
+ m as a,
78
+ x as c,
79
+ b as u
80
+ };
@@ -1,16 +1,30 @@
1
1
  import { Icon } from '../Icon/Icon';
2
2
  import { ReactNode } from 'react';
3
3
 
4
- export type AdviceTypes = 'without-results' | 'no-permission';
4
+ export type AdviceTypes = 'without-results' | 'no-permission' | 'no-items' | 'error-page';
5
5
  export type AdviceProps = {
6
+ /** Advice icon.
7
+ * This property uses the Icon Component Props
8
+ */
6
9
  icon?: React.ComponentProps<typeof Icon>;
10
+ /** Advice SVG icon */
7
11
  IconSvg?: React.FunctionComponent<React.SVGProps<SVGSVGElement> & {
8
12
  title?: string | undefined;
9
13
  }>;
14
+ /** Type of advice */
10
15
  type?: AdviceTypes;
11
- content: ReactNode;
16
+ /** Advice content message */
17
+ content?: ReactNode;
18
+ title?: string;
19
+ description?: string;
20
+ /** Space seperated list of CSS classes to apply */
12
21
  className?: string;
22
+ /** ID that tests can use to get this component from the DOM */
13
23
  'data-testid'?: string;
14
24
  };
15
- declare const Advice: ({ icon, type, content, className, IconSvg, ...rest }: AdviceProps) => import("react/jsx-runtime").JSX.Element;
25
+ /**
26
+ * Advice component provide HTML with an icon and a message.
27
+ * Is commonly used to indicate No Permission and No Results.
28
+ */
29
+ declare const Advice: ({ icon, type, content, title, description, className, IconSvg, ...rest }: AdviceProps) => import("react/jsx-runtime").JSX.Element;
16
30
  export { Advice };
@@ -1,25 +1,47 @@
1
1
  import '../../assets/Advice.css';
2
- import { jsxs as m, jsx as t } from "react/jsx-runtime";
3
- import { c as y } from "../../clsx-DB4S2d7J.js";
4
- import { Icon as n } from "../Icon/Icon.js";
5
- const f = "_advice_1yug7_1", h = "_content_1yug7_7", l = {
6
- advice: f,
7
- content: h
8
- }, d = {
2
+ import { jsxs as h, jsx as r } from "react/jsx-runtime";
3
+ import { c as l } from "../../clsx-DB4S2d7J.js";
4
+ import { Icon as i } from "../Icon/Icon.js";
5
+ const n = "_advice_12o7p_56", d = "_content_12o7p_56", s = {
6
+ "u-typography-h1": "_u-typography-h1_12o7p_1",
7
+ "u-typography-h2": "_u-typography-h2_12o7p_8",
8
+ "u-typography-h3": "_u-typography-h3_12o7p_15",
9
+ "u-typography-h4": "_u-typography-h4_12o7p_22",
10
+ "u-typography-h5": "_u-typography-h5_12o7p_29",
11
+ "u-typography-h6": "_u-typography-h6_12o7p_36",
12
+ "u-typography-base": "_u-typography-base_12o7p_43",
13
+ "u-typography-base--xxl": "_u-typography-base--xxl_12o7p_48",
14
+ "u-typography-base--xl": "_u-typography-base--xl_12o7p_52",
15
+ "u-typography-base--lg": "_u-typography-base--lg_12o7p_56",
16
+ advice: n,
17
+ content: d,
18
+ "u-typography-base--sm": "_u-typography-base--sm_12o7p_61",
19
+ "u-typography-base--bold": "_u-typography-base--bold_12o7p_65",
20
+ "u-typography-base--strikethrough": "_u-typography-base--strikethrough_12o7p_69",
21
+ "u-typography-base--underlined": "_u-typography-base--underlined_12o7p_72",
22
+ "u-typography-base--strikethrough-underlined": "_u-typography-base--strikethrough-underlined_12o7p_75",
23
+ "content-no-items": "_content-no-items_12o7p_90"
24
+ }, m = {
9
25
  "no-permission": "eye-slash",
26
+ "no-items": "",
27
+ "error-page": "circle-exclamation",
10
28
  "without-results": "folder-magnifying-glass"
11
- }, g = ({ icon: s, type: o, content: r, className: i, IconSvg: a, ...c }) => {
12
- const e = {
13
- color: (s == null ? void 0 : s.color) || "var(--accent)",
14
- size: (s == null ? void 0 : s.size) || "3.375rem",
15
- icon: d[o] || (s == null ? void 0 : s.icon) || "",
16
- iconFamily: d[o] ? "fa/duotone" : (s == null ? void 0 : s.iconFamily) || "fa/duotone"
29
+ }, v = ({ icon: p, type: o, content: e, title: y, description: _, className: g, IconSvg: t, ...u }) => {
30
+ const a = {
31
+ color: p != null && p.color ? p == null ? void 0 : p.color : o !== "error-page" ? "var(--accent)" : "var(--secondary-orange)",
32
+ size: (p == null ? void 0 : p.size) || "3.375rem",
33
+ icon: m[o] || (p == null ? void 0 : p.icon) || ""
17
34
  };
18
- return /* @__PURE__ */ m("div", { className: y(l.advice, i), ...c, children: [
19
- a ? /* @__PURE__ */ t(a, { style: { color: e.color, height: e.size, width: e.size } }) : /* @__PURE__ */ t(n, { ...e }),
20
- typeof r == "string" ? /* @__PURE__ */ t("p", { children: r }) : /* @__PURE__ */ t("div", { className: l.content, children: r })
35
+ return /* @__PURE__ */ h("div", { className: l(s.advice, g), ...u, children: [
36
+ t && o !== "no-items" && o !== "error-page" && /* @__PURE__ */ r(t, { style: { color: a.color, height: a.size, width: a.size } }),
37
+ !t && o !== "no-items" && /* @__PURE__ */ r(i, { ...a }),
38
+ o !== "error-page" && o !== "no-items" ? typeof e == "string" ? /* @__PURE__ */ r("p", { children: e }) : /* @__PURE__ */ r("div", { className: s.content, children: e }) : /* @__PURE__ */ h("div", { className: s["content-no-items"], children: [
39
+ /* @__PURE__ */ r("h3", { children: y }),
40
+ /* @__PURE__ */ r("p", { children: _ }),
41
+ e
42
+ ] })
21
43
  ] });
22
44
  };
23
45
  export {
24
- g as Advice
46
+ v as Advice
25
47
  };
@@ -0,0 +1,18 @@
1
+ import { StoryObj } from '@storybook/react';
2
+
3
+ declare const meta: {
4
+ title: string;
5
+ component: ({ icon, type, content, title, description, className, IconSvg, ...rest }: import('./Advice').AdviceProps) => import("react/jsx-runtime").JSX.Element;
6
+ tags: string[];
7
+ parameters: {
8
+ layout: string;
9
+ };
10
+ };
11
+ export default meta;
12
+ type Story = StoryObj<typeof meta>;
13
+ export declare const WithoutResults: Story;
14
+ export declare const NoPermission: Story;
15
+ export declare const CustomIcon: Story;
16
+ export declare const CustomIconSVG: Story;
17
+ export declare const NoItems: Story;
18
+ export declare const ErrorPage: Story;
@@ -1,4 +1,5 @@
1
1
  import { Either } from '../../types/helpers';
2
+ import { ButtonOwnProps as MUIButtonBaseProps } from '@mui/base';
2
3
  import { ReactNode } from 'react';
3
4
 
4
5
  type Variant = 'primary' | 'secondary' | 'quick';
@@ -7,12 +8,14 @@ type ButtonCoreProps = {
7
8
  loading?: boolean;
8
9
  /** Button to display and act in a disabled state */
9
10
  disabled?: boolean;
10
- /** Space seperated list of CSS classes to apply */
11
+ /** Space separated list of CSS classes to apply */
11
12
  className?: string;
12
13
  /** Text or children to display */
13
14
  children: ReactNode;
14
- /** Space seperated list of CSS classes to apply */
15
+ /** alternative style to use*/
15
16
  variant?: Variant;
17
+ /** mui base button props */
18
+ muiButtonBaseProps?: MUIButtonBaseProps;
16
19
  };
17
20
  interface ButtonPropsWithLink extends ButtonCoreProps {
18
21
  /** link for component to navigate to, if provide component will be an anchor */
@@ -20,7 +23,7 @@ interface ButtonPropsWithLink extends ButtonCoreProps {
20
23
  }
21
24
  interface ButtonPropsWithOnClick extends ButtonCoreProps {
22
25
  /** functionality to perform once clicked */
23
- onClick: () => void;
26
+ onClick?: () => void;
24
27
  /** HTML type of button */
25
28
  type?: HTMLButtonElement['type'];
26
29
  }
@@ -1,70 +1,65 @@
1
1
  import '../../assets/Button.css';
2
- import { jsx as e, jsxs as a } from "react/jsx-runtime";
3
- import { forwardRef as m, useMemo as c } from "react";
4
- import { c as y } from "../../clsx-DB4S2d7J.js";
5
- import { LoadingSpinner as g } from "../LoadingSpinner/LoadingSpinner.js";
6
- import { B as f } from "../../Button-B1umG8kJ.js";
7
- const k = "_h1_2qr61_1", p = "_h2_2qr61_11", w = "_h3_2qr61_21", x = "_h4_2qr61_31", N = "_body_2qr61_41", v = "_quote_2qr61_75", B = "_form__input_2qr61_98", j = "_form__hint_2qr61_103", S = "_form__label_2qr61_108", $ = "_form__dropdown_2qr61_113", C = "_table__header_2qr61_131", L = "_table__body_2qr61_136", M = "_button_2qr61_159", r = {
8
- h1: k,
9
- "h1--bold": "_h1--bold_2qr61_7",
10
- h2: p,
11
- "h2--bold": "_h2--bold_2qr61_17",
12
- h3: w,
13
- "h3--bold": "_h3--bold_2qr61_27",
14
- h4: x,
15
- "h4--bold": "_h4--bold_2qr61_37",
16
- body: N,
17
- "body--large": "_body--large_2qr61_46",
18
- "body--medium": "_body--medium_2qr61_50",
19
- "body--small": "_body--small_2qr61_54",
20
- "body--tiny": "_body--tiny_2qr61_58",
21
- "body--bold": "_body--bold_2qr61_62",
22
- "body--strikethrough": "_body--strikethrough_2qr61_65",
23
- "body--underlined": "_body--underlined_2qr61_68",
24
- "body--strikethrough-underlined": "_body--strikethrough-underlined_2qr61_71",
25
- quote: v,
26
- "quote--large": "_quote--large_2qr61_80",
27
- "quote--bold": "_quote--bold_2qr61_85",
28
- "quote--strikethrough": "_quote--strikethrough_2qr61_88",
29
- "quote--underlined": "_quote--underlined_2qr61_91",
30
- "quote--strikethrough-underlined": "_quote--strikethrough-underlined_2qr61_94",
31
- form__input: B,
32
- form__hint: j,
33
- form__label: S,
34
- form__dropdown: $,
35
- "form--bold": "_form--bold_2qr61_118",
36
- "form--strikethrough": "_form--strikethrough_2qr61_121",
37
- "form--underlined": "_form--underlined_2qr61_124",
38
- "form--strikethrough-underlined": "_form--strikethrough-underlined_2qr61_127",
39
- table__header: C,
40
- table__body: L,
41
- "table__body--secondary": "_table__body--secondary_2qr61_141",
42
- "table--bold": "_table--bold_2qr61_146",
43
- "table--strikethrough": "_table--strikethrough_2qr61_149",
44
- "table--underlined": "_table--underlined_2qr61_152",
45
- "table--strikethrough-underlined": "_table--strikethrough-underlined_2qr61_155",
46
- button: M,
47
- "button--bold": "_button--bold_2qr61_165",
48
- "button--strikethrough": "_button--strikethrough_2qr61_168",
49
- "button--underlined": "_button--underlined_2qr61_171",
50
- "button--strikethrough-underlined": "_button--strikethrough-underlined_2qr61_174",
51
- "button--primary": "_button--primary_2qr61_190",
52
- "button--secondary": "_button--secondary_2qr61_209",
53
- "button--quick": "_button--quick_2qr61_226",
54
- "button__loading-container": "_button__loading-container_2qr61_249"
55
- }, E = m((n, d) => {
56
- const { onClick: u, link: l, loading: b, children: o, type: i = "button", disabled: h, className: t, variant: _ = "primary" } = n, s = {
57
- invert: _ === "secondary" || _ === "quick"
58
- }, q = c(
59
- () => y([r.button, r[`button--${_}`], t]),
60
- [t, _]
2
+ import { jsx as h, jsxs as l } from "react/jsx-runtime";
3
+ import { forwardRef as d, useMemo as c } from "react";
4
+ import { c as m } from "../../clsx-DB4S2d7J.js";
5
+ import { LoadingSpinner as x } from "../LoadingSpinner/LoadingSpinner.js";
6
+ import { B as f } from "../../Button-2b1peDFT.js";
7
+ const k = "_button_1h876_56", o = {
8
+ "u-typography-h1": "_u-typography-h1_1h876_1",
9
+ "u-typography-h2": "_u-typography-h2_1h876_8",
10
+ "u-typography-h3": "_u-typography-h3_1h876_15",
11
+ "u-typography-h4": "_u-typography-h4_1h876_22",
12
+ "u-typography-h5": "_u-typography-h5_1h876_29",
13
+ "u-typography-h6": "_u-typography-h6_1h876_36",
14
+ "u-typography-base": "_u-typography-base_1h876_43",
15
+ "u-typography-base--xxl": "_u-typography-base--xxl_1h876_48",
16
+ "u-typography-base--xl": "_u-typography-base--xl_1h876_52",
17
+ "u-typography-base--lg": "_u-typography-base--lg_1h876_56",
18
+ button: k,
19
+ "u-typography-base--sm": "_u-typography-base--sm_1h876_60",
20
+ "u-typography-base--bold": "_u-typography-base--bold_1h876_64",
21
+ "u-typography-base--strikethrough": "_u-typography-base--strikethrough_1h876_67",
22
+ "u-typography-base--underlined": "_u-typography-base--underlined_1h876_70",
23
+ "u-typography-base--strikethrough-underlined": "_u-typography-base--strikethrough-underlined_1h876_73",
24
+ "button--primary": "_button--primary_1h876_86",
25
+ "button--secondary": "_button--secondary_1h876_105",
26
+ "button--quick": "_button--quick_1h876_122",
27
+ "button__loading-container": "_button__loading-container_1h876_145"
28
+ }, P = d((p, y) => {
29
+ const {
30
+ onClick: _,
31
+ link: u,
32
+ loading: n,
33
+ children: a,
34
+ type: e = "button",
35
+ disabled: s,
36
+ className: r,
37
+ variant: t = "primary",
38
+ muiButtonBaseProps: g
39
+ } = p, i = {
40
+ invert: t === "secondary" || t === "quick"
41
+ }, b = c(
42
+ () => m([o.button, o[`button--${t}`], r]),
43
+ [r, t]
44
+ );
45
+ return /* @__PURE__ */ h(
46
+ f,
47
+ {
48
+ type: e,
49
+ href: u,
50
+ onClick: _,
51
+ disabled: s,
52
+ className: b,
53
+ ref: y,
54
+ ...g ?? {},
55
+ children: n ? /* @__PURE__ */ l("div", { className: o["button__loading-container"], children: [
56
+ /* @__PURE__ */ h(x, { ...i }),
57
+ a
58
+ ] }) : a
59
+ }
61
60
  );
62
- return /* @__PURE__ */ e(f, { type: i, href: l, onClick: u, disabled: h, className: q, ref: d, children: b ? /* @__PURE__ */ a("div", { className: r["button__loading-container"], children: [
63
- /* @__PURE__ */ e(g, { ...s }),
64
- o
65
- ] }) : o });
66
61
  });
67
62
  export {
68
- E as Button,
69
- E as default
63
+ P as Button,
64
+ P as default
70
65
  };
@@ -11,18 +11,20 @@ declare const meta: {
11
11
  className?: string | undefined;
12
12
  children: import('react').ReactNode;
13
13
  variant?: ("primary" | "secondary" | "quick") | undefined;
14
+ muiButtonBaseProps?: import('@mui/base').ButtonOwnProps | undefined;
14
15
  type?: undefined;
15
16
  onClick?: undefined;
16
17
  ref?: import('react').LegacyRef<HTMLButtonElement> | undefined;
17
18
  key?: import('react').Key | null | undefined;
18
19
  } | {
19
- onClick: () => void;
20
+ onClick?: (() => void) | undefined;
20
21
  type?: "button" | "submit" | "reset" | undefined;
21
22
  loading?: boolean | undefined;
22
23
  disabled?: boolean | undefined;
23
24
  className?: string | undefined;
24
25
  children: import('react').ReactNode;
25
26
  variant?: ("primary" | "secondary" | "quick") | undefined;
27
+ muiButtonBaseProps?: import('@mui/base').ButtonOwnProps | undefined;
26
28
  link?: undefined;
27
29
  ref?: import('react').LegacyRef<HTMLButtonElement> | undefined;
28
30
  key?: import('react').Key | null | undefined;
@@ -3,15 +3,32 @@ import { ReactNode } from 'react';
3
3
  type CheckboxTheme = 'light' | 'accent';
4
4
  type CheckboxSizes = 'small' | 'normal';
5
5
  type CheckboxProps = {
6
+ /** Space separated list of CSS classes to apply */
6
7
  className?: string;
8
+ /** ID that tests can use to get this component from the DOM */
7
9
  'data-testid'?: string;
10
+ /** Checkbox label */
8
11
  label?: ReactNode;
12
+ /** Checkbox theme */
9
13
  theme?: CheckboxTheme;
14
+ /** Checkbox size */
10
15
  size?: CheckboxSizes;
11
- isChecked?: boolean;
16
+ /** Checkbox size */
17
+ checked?: boolean;
18
+ /** Indeterminate state */
12
19
  isIndeterminate?: boolean;
20
+ /** Name */
13
21
  name?: string;
22
+ /** Functionality to perform when the checkbox value change */
14
23
  onChange: (checked: boolean) => void;
24
+ /** Checkbox label */
25
+ children?: ReactNode;
26
+ /** Set the highlight of the label */
27
+ highlightLabel?: boolean;
15
28
  };
16
- declare const Checkbox: ({ className, label, name, theme, size, isChecked, onChange, isIndeterminate, ...rest }: CheckboxProps) => import("react/jsx-runtime").JSX.Element;
29
+ /**
30
+ * Checkboxes allow the user to select one or more items from a set.
31
+ * Checkboxes can be used to turn an option on or off.
32
+ */
33
+ declare const Checkbox: ({ className, label, name, theme, size, checked, onChange, isIndeterminate, highlightLabel, ...rest }: CheckboxProps) => import("react/jsx-runtime").JSX.Element;
17
34
  export { Checkbox };
@@ -1,48 +1,71 @@
1
1
  import '../../assets/Checkbox.css';
2
2
  import { jsxs as v, jsx as c } from "react/jsx-runtime";
3
- import * as m from "react";
4
- import { useState as i, useEffect as _ } from "react";
5
- import { c as p } from "../../clsx-DB4S2d7J.js";
6
- const u = (e) => /* @__PURE__ */ m.createElement("svg", { width: 14, height: 10, viewBox: "0 0 14 10", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ m.createElement("path", { d: "M13.7063 0.293438C14.0969 0.684062 14.0969 1.31531 13.7063 1.70594L5.70625 9.70594C5.31563 10.0966 4.68437 10.0966 4.29375 9.70594L0.292875 5.70594C-0.097625 5.31531 -0.097625 4.68406 0.292875 4.29344C0.683437 3.90281 1.31656 3.90281 1.70719 4.29344L4.97188 7.58406L12.2937 0.293438C12.6844 -0.0978125 13.3156 -0.0978125 13.7063 0.293438Z", fill: "#F7F7FC" })), y = "_checkmark_14khe_10", t = {
7
- "checkbox-wrapper": "_checkbox-wrapper_14khe_1",
8
- checkmark: y,
9
- "checkmark--checked": "_checkmark--checked_14khe_22",
10
- "checkmark--light-theme": "_checkmark--light-theme_14khe_25",
11
- "checkmark--accent-theme": "_checkmark--accent-theme_14khe_32",
12
- "checkmark--small-size": "_checkmark--small-size_14khe_39",
13
- "checkmark--normal-size": "_checkmark--normal-size_14khe_46"
14
- }, z = (e) => /* @__PURE__ */ m.createElement("svg", { width: 10, height: 3, viewBox: "0 0 10 3", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ m.createElement("rect", { y: 0.5, width: 10, height: 2, rx: 1, fill: "#1897F3" })), S = ({
15
- className: e,
16
- label: g,
17
- name: l,
18
- theme: x = "accent",
19
- size: w = "normal",
20
- isChecked: h,
21
- onChange: f,
22
- isIndeterminate: k,
23
- ...d
3
+ import * as o from "react";
4
+ import { useState as k, useEffect as i } from "react";
5
+ import { c as s } from "../../clsx-DB4S2d7J.js";
6
+ const N = (a) => /* @__PURE__ */ o.createElement("svg", { width: 14, height: 10, viewBox: "0 0 14 10", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...a }, /* @__PURE__ */ o.createElement("path", { d: "M13.7063 0.293438C14.0969 0.684062 14.0969 1.31531 13.7063 1.70594L5.70625 9.70594C5.31563 10.0966 4.68437 10.0966 4.29375 9.70594L0.292875 5.70594C-0.097625 5.31531 -0.097625 4.68406 0.292875 4.29344C0.683437 3.90281 1.31656 3.90281 1.70719 4.29344L4.97188 7.58406L12.2937 0.293438C12.6844 -0.0978125 13.3156 -0.0978125 13.7063 0.293438Z", fill: "#F7F7FC" })), z = "_label_18hen_64", E = "_checkmark_18hen_93", e = {
7
+ "u-typography-h1": "_u-typography-h1_18hen_1",
8
+ "u-typography-h2": "_u-typography-h2_18hen_8",
9
+ "u-typography-h3": "_u-typography-h3_18hen_15",
10
+ "u-typography-h4": "_u-typography-h4_18hen_22",
11
+ "u-typography-h5": "_u-typography-h5_18hen_29",
12
+ "u-typography-h6": "_u-typography-h6_18hen_36",
13
+ "u-typography-base": "_u-typography-base_18hen_43",
14
+ "u-typography-base--xxl": "_u-typography-base--xxl_18hen_48",
15
+ "u-typography-base--xl": "_u-typography-base--xl_18hen_52",
16
+ "u-typography-base--lg": "_u-typography-base--lg_18hen_56",
17
+ "u-typography-base--sm": "_u-typography-base--sm_18hen_60",
18
+ "u-typography-base--bold": "_u-typography-base--bold_18hen_64",
19
+ "checkbox-wrapper": "_checkbox-wrapper_18hen_64",
20
+ "label--highlighted": "_label--highlighted_18hen_64",
21
+ "u-typography-base--strikethrough": "_u-typography-base--strikethrough_18hen_67",
22
+ "u-typography-base--underlined": "_u-typography-base--underlined_18hen_70",
23
+ "u-typography-base--strikethrough-underlined": "_u-typography-base--strikethrough-underlined_18hen_73",
24
+ label: z,
25
+ "label--highlighted-checked": "_label--highlighted-checked_18hen_90",
26
+ checkmark: E,
27
+ "checkmark--checked": "_checkmark--checked_18hen_105",
28
+ "checkmark--light-theme": "_checkmark--light-theme_18hen_108",
29
+ "checkmark--accent-theme": "_checkmark--accent-theme_18hen_115",
30
+ "checkmark--small-size": "_checkmark--small-size_18hen_122",
31
+ "checkmark--normal-size": "_checkmark--normal-size_18hen_129"
32
+ }, F = (a) => /* @__PURE__ */ o.createElement("svg", { width: 10, height: 3, viewBox: "0 0 10 3", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...a }, /* @__PURE__ */ o.createElement("rect", { y: 0.5, width: 10, height: 2, rx: 1, fill: "#1897F3" })), M = ({
33
+ className: a,
34
+ label: n,
35
+ name: m,
36
+ theme: u = "accent",
37
+ size: b = "normal",
38
+ checked: r,
39
+ onChange: d,
40
+ isIndeterminate: l,
41
+ highlightLabel: x = !1,
42
+ ...p
24
43
  }) => {
25
- const [r, s] = i(h), [a, n] = i(k);
26
- _(() => {
27
- r !== h && s(h);
28
- }, [h]), _(() => {
29
- typeof k == "boolean" && n(k);
30
- }, [k]);
31
- const C = p(t["checkbox-wrapper"], e), b = p(
32
- t.checkmark,
33
- t[`checkmark--${x}-theme`],
34
- t[`checkmark--${w}-size`],
35
- (r || a) && t["checkmark--checked"]
36
- );
44
+ const [h, g] = k(r), [t, y] = k(l);
45
+ i(() => {
46
+ r !== h && g(r);
47
+ }, [r]), i(() => {
48
+ typeof l == "boolean" && y(l);
49
+ }, [l]);
50
+ const C = s(e["checkbox-wrapper"], a), f = s(
51
+ e.checkmark,
52
+ e[`checkmark--${u}-theme`],
53
+ e[`checkmark--${b}-size`],
54
+ (h || t) && e["checkmark--checked"]
55
+ ), w = x && (p.children || n) ? s(
56
+ e.label,
57
+ e["label--highlighted"],
58
+ (h || t) && e["label--highlighted-checked"]
59
+ ) : e.label;
37
60
  return /* @__PURE__ */ v("div", { className: C, onClick: () => {
38
- let o = !r;
39
- a && (n(!1), o = !0), f(o), s(o);
40
- }, ...d, children: [
41
- /* @__PURE__ */ c("input", { name: l, type: "checkbox", checked: !a && r, readOnly: !0 }),
42
- /* @__PURE__ */ c("span", { className: b, children: a ? /* @__PURE__ */ c(z, {}) : /* @__PURE__ */ c(u, {}) }),
43
- /* @__PURE__ */ c("label", { htmlFor: l, children: g })
61
+ let _ = !h;
62
+ t && (y(!1), _ = !0), d(_), g(_);
63
+ }, ...p, children: [
64
+ /* @__PURE__ */ c("input", { name: m, type: "checkbox", checked: !t && h, readOnly: !0 }),
65
+ /* @__PURE__ */ c("span", { className: f, children: t ? /* @__PURE__ */ c(F, {}) : h && /* @__PURE__ */ c(N, {}) }),
66
+ /* @__PURE__ */ c("label", { className: w, children: p.children || n })
44
67
  ] });
45
68
  };
46
69
  export {
47
- S as Checkbox
70
+ M as Checkbox
48
71
  };
@@ -0,0 +1,31 @@
1
+ import { StoryObj } from '@storybook/react';
2
+
3
+ declare const meta: {
4
+ title: string;
5
+ component: ({ className, label, name, theme, size, checked, onChange, isIndeterminate, highlightLabel, ...rest }: {
6
+ className?: string | undefined;
7
+ 'data-testid'?: string | undefined;
8
+ label?: import('react').ReactNode;
9
+ theme?: ("light" | "accent") | undefined;
10
+ size?: ("small" | "normal") | undefined;
11
+ checked?: boolean | undefined;
12
+ isIndeterminate?: boolean | undefined;
13
+ name?: string | undefined;
14
+ onChange: (checked: boolean) => void;
15
+ children?: import('react').ReactNode;
16
+ highlightLabel?: boolean | undefined;
17
+ }) => import("react/jsx-runtime").JSX.Element;
18
+ tags: string[];
19
+ parameters: {
20
+ layout: string;
21
+ };
22
+ };
23
+ export default meta;
24
+ type Story = StoryObj<typeof meta>;
25
+ export declare const Default: Story;
26
+ export declare const DefaultWithLabel: Story;
27
+ export declare const LightTheme: Story;
28
+ export declare const LightThemeIndeterminate: Story;
29
+ export declare const LabelAsChildren: Story;
30
+ export declare const HighlightLabel: Story;
31
+ export declare const SmallSize: Story;
@@ -0,0 +1,39 @@
1
+ import { IconProps } from '../../main';
2
+ import { ReactElement, ReactNode } from 'react';
3
+
4
+ export type Variant = 'default' | 'contained' | 'outlined';
5
+ type ChipProps = {
6
+ /** Main content to display, typically just some text */
7
+ label: ReactNode;
8
+ /** Whether to show loading state (skeleton) */
9
+ loading?: boolean;
10
+ /** Left icon to display */
11
+ leftAdornment?: ChipAdornmentSlotProps;
12
+ /** Dataset test id only used for tests to reach in and grab the rendered DOM node of the chip wrapper */
13
+ 'data-testid'?: string;
14
+ /** Functionality to perform when the main body of the chip is clicked */
15
+ onClickContent?: () => void;
16
+ /** If present an 'x' icon will be on the right side of the button when clicked whatever functionality is passed to
17
+ * this will be executed */
18
+ onClickRemove?: () => void;
19
+ /** Whether to show the button in a disabled state, user will be unable to interact with the chip */
20
+ disabled?: boolean;
21
+ /** Any additional classes to apply to the Chip wrapper */
22
+ className?: string;
23
+ /** Any additional classes to apply to the chip skeleton */
24
+ 'className-skeleton'?: string;
25
+ /** Which style of chip to show */
26
+ variant?: Variant;
27
+ /** Dataset test id only used for tests, used to hook onto the loading skeleton component for this chip */
28
+ 'data-testid-skeleton'?: string;
29
+ };
30
+ export type ChipAdornmentSlotProps = {
31
+ /** The Marola Icon to display */
32
+ icon: ReactElement<IconProps>;
33
+ /** Any additional classes to apply to icon */
34
+ className?: string;
35
+ /** Dataset test id only used for tests to reach in and grab the rendered DOM node of the icon */
36
+ 'data-testid'?: string;
37
+ };
38
+ export declare const Chip: import('react').ForwardRefExoticComponent<ChipProps & import('react').RefAttributes<unknown>>;
39
+ export {};
@@ -0,0 +1,19 @@
1
+ import "react/jsx-runtime";
2
+ import "react";
3
+ import "../../clsx-DB4S2d7J.js";
4
+ import "../Icon/Icon.js";
5
+ import "../Button/Button.js";
6
+ import { C as j } from "../../Toggle-BCgIItCc.js";
7
+ import "../Dialog/Backdrop.js";
8
+ import "../Typography/Typography.js";
9
+ import "../IconButton/IconButton.js";
10
+ import "../Select/Select.js";
11
+ import "../Skeleton/Skeleton.js";
12
+ import "../Table/Table.js";
13
+ import "../Tabs/Tabs.js";
14
+ import "../../Group-B3p31ftp.js";
15
+ import "../../contexts/SnackbarProvider/SnackbarProvider.js";
16
+ import "../../Button-2b1peDFT.js";
17
+ export {
18
+ j as Chip
19
+ };