@pismo/marola 0.0.1-alpha.2 → 0.0.1-alpha.21

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 (153) hide show
  1. package/README.md +17 -5
  2. package/dist/Button-2b1peDFT.js +130 -0
  3. package/dist/ClickAwayListener-BSW-Nd-y.js +107 -0
  4. package/dist/Dialog.module-DFEmFdYT.js +30 -0
  5. package/dist/Popup-B6ZSGIEI.js +1248 -0
  6. package/dist/Portal-DIeBsWdL.js +73 -0
  7. package/dist/SelectButton-C8JQKaf4.js +61 -0
  8. package/dist/Tabs.module-jkH1Qjn7.js +22 -0
  9. package/dist/assets/Advice.css +1 -0
  10. package/dist/assets/Button.css +1 -0
  11. package/dist/assets/Checkbox.css +1 -0
  12. package/dist/assets/Chip.css +1 -0
  13. package/dist/assets/Dialog.css +1 -1
  14. package/dist/assets/IconButton.css +1 -0
  15. package/dist/assets/Input.css +1 -0
  16. package/dist/assets/InputSearch.css +1 -0
  17. package/dist/assets/LoadingSpinner.css +1 -1
  18. package/dist/assets/PageHeader.css +1 -0
  19. package/dist/assets/Pagination.css +1 -0
  20. package/dist/assets/SelectButton.css +1 -0
  21. package/dist/assets/Skeleton.css +1 -0
  22. package/dist/assets/Snackbar.css +1 -0
  23. package/dist/assets/SortTooltip.css +1 -0
  24. package/dist/assets/Stepper.css +1 -0
  25. package/dist/assets/Table.css +1 -0
  26. package/dist/assets/Tabs.css +1 -0
  27. package/dist/assets/TextDisplay.css +1 -0
  28. package/dist/assets/Toggle.css +1 -0
  29. package/dist/assets/Tooltip.css +1 -0
  30. package/dist/assets/Typography.css +1 -1
  31. package/dist/combineHooksSlotProps-DVjg9PRh.js +80 -0
  32. package/dist/components/Advice/Advice.d.ts +28 -0
  33. package/dist/components/Advice/Advice.js +40 -0
  34. package/dist/components/Advice/Advice.stories.d.ts +16 -0
  35. package/dist/components/Button/Button.d.ts +32 -0
  36. package/dist/components/Button/Button.js +65 -0
  37. package/dist/components/Button/Button.stories.d.ts +62 -0
  38. package/dist/components/Checkbox/Checkbox.d.ts +34 -0
  39. package/dist/components/Checkbox/Checkbox.js +71 -0
  40. package/dist/components/Checkbox/Checkbox.stories.d.ts +31 -0
  41. package/dist/components/Chip/Chip.d.ts +37 -0
  42. package/dist/components/Chip/Chip.js +113 -0
  43. package/dist/components/Chip/Chip.stories.d.ts +40 -0
  44. package/dist/components/Chip/chip.test.d.ts +1 -0
  45. package/dist/components/Dialog/Actions.js +1 -1
  46. package/dist/components/Dialog/Backdrop.d.ts +1 -1
  47. package/dist/components/Dialog/Backdrop.js +2 -9
  48. package/dist/components/Dialog/CloseIconButton.js +11 -10
  49. package/dist/components/Dialog/Dialog.d.ts +6 -5
  50. package/dist/components/Dialog/Dialog.js +419 -20077
  51. package/dist/components/Dialog/Dialog.stories.d.ts +343 -0
  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/Icon/Icon.d.ts +27 -0
  55. package/dist/components/Icon/Icon.js +122 -0
  56. package/dist/components/Icon/Icon.stories.d.ts +16 -0
  57. package/dist/components/IconButton/Icon.stories.d.ts +15 -0
  58. package/dist/components/IconButton/IconButton.d.ts +36 -0
  59. package/dist/components/IconButton/IconButton.js +40 -0
  60. package/dist/components/Input/Input.d.ts +44 -0
  61. package/dist/components/Input/Input.js +508 -0
  62. package/dist/components/Input/Input.stories.d.ts +43 -0
  63. package/dist/components/InputSearch/InputSearch.d.ts +9 -0
  64. package/dist/components/InputSearch/InputSearch.js +34 -0
  65. package/dist/components/InputSearch/InputSearch.stories.d.ts +39 -0
  66. package/dist/components/LoadingSpinner/LoadingSpinner.d.ts +2 -0
  67. package/dist/components/LoadingSpinner/LoadingSpinner.js +12 -13
  68. package/dist/components/LoadingSpinner/LoadingSpinner.stories.d.ts +14 -0
  69. package/dist/components/PageHeader/PageHeader.d.ts +36 -0
  70. package/dist/components/PageHeader/PageHeader.js +66 -0
  71. package/dist/components/PageHeader/PageHeader.stories.d.ts +43 -0
  72. package/dist/components/Pagination/Pagination.d.ts +55 -0
  73. package/dist/components/Pagination/Pagination.js +236 -0
  74. package/dist/components/Pagination/Pagination.stories.d.ts +17 -0
  75. package/dist/components/Select/Select.d.ts +26 -0
  76. package/dist/components/Select/Select.js +857 -0
  77. package/dist/components/Select/Select.stories.d.ts +22 -0
  78. package/dist/components/Select/SelectButton.d.ts +12 -0
  79. package/dist/components/Select/SelectButton.js +8 -0
  80. package/dist/components/Skeleton/Skeleton.d.ts +25 -0
  81. package/dist/components/Skeleton/Skeleton.js +23 -0
  82. package/dist/components/Skeleton/Skeleton.stories.d.ts +14 -0
  83. package/dist/components/Skeleton/SkeletonCircle.stories.d.ts +14 -0
  84. package/dist/components/Skeleton/SkeletonTable.stories.d.ts +16 -0
  85. package/dist/components/Snackbar/Snackbar.d.ts +25 -0
  86. package/dist/components/Snackbar/Snackbar.js +637 -0
  87. package/dist/components/Snackbar/Snackbar.stories.d.ts +318 -0
  88. package/dist/components/SortTooltip/SortTooltip.d.ts +28 -0
  89. package/dist/components/SortTooltip/SortTooltip.js +93 -0
  90. package/dist/components/Stepper/Stepper.d.ts +26 -0
  91. package/dist/components/Stepper/Stepper.js +48 -0
  92. package/dist/components/Stepper/Stepper.stories.d.ts +16 -0
  93. package/dist/components/Table/Table.d.ts +56 -0
  94. package/dist/components/Table/Table.js +137 -0
  95. package/dist/components/Table/Table.stories.d.ts +29 -0
  96. package/dist/components/Table/TableContext.d.ts +19 -0
  97. package/dist/components/Table/TableContext.js +21 -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 +14 -0
  104. package/dist/components/Tabs/Tab.js +181 -0
  105. package/dist/components/Tabs/Tab.stories.d.ts +15 -0
  106. package/dist/components/Tabs/TabPanel.d.ts +12 -0
  107. package/dist/components/Tabs/TabPanel.js +118 -0
  108. package/dist/components/Tabs/TabPanel.stories.d.ts +14 -0
  109. package/dist/components/Tabs/Tabs.d.ts +15 -0
  110. package/dist/components/Tabs/Tabs.js +401 -0
  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.d.ts +11 -0
  117. package/dist/components/Toggle/Toggle.js +266 -0
  118. package/dist/components/Toggle/Toggle.stories.d.ts +21 -0
  119. package/dist/components/Tooltip/Tooltip.d.ts +29 -0
  120. package/dist/components/Tooltip/Tooltip.js +139 -0
  121. package/dist/components/Tooltip/Tooltip.stories.d.ts +33 -0
  122. package/dist/components/Typography/Typography.d.ts +17 -6
  123. package/dist/components/Typography/Typography.js +56 -65
  124. package/dist/components/Typography/Typography.stories.d.ts +32 -0
  125. package/dist/components/Typography/typography.test.d.ts +1 -0
  126. package/dist/index-CH45lKw7.js +840 -0
  127. package/dist/index-CjW42-M-.js +19584 -0
  128. package/dist/main.d.ts +25 -3
  129. package/dist/main.js +67 -15
  130. package/dist/marola.css +1 -0
  131. package/dist/test-utils/assertStyles.d.ts +1 -0
  132. package/dist/test-utils/assertStyles.js +11 -0
  133. package/dist/types/helpers.d.ts +14 -7
  134. package/dist/useButton-DNk3wrQp.js +105 -0
  135. package/dist/useCompoundItem-D1iRfg8D.js +84 -0
  136. package/dist/useControlled-CCMYYdCM.js +31 -0
  137. package/dist/useEnhancedEffect-CJGo-L3B.js +5 -0
  138. package/dist/useEventCallback-xTG9piMa.js +45 -0
  139. package/dist/useIsFocusVisible-BH4IAdcw.js +69 -0
  140. package/dist/useList-B0hog_3-.js +436 -0
  141. package/dist/useTimeout-DxF9kiZL.js +36 -0
  142. package/dist/utils/styleStrings.d.ts +6 -0
  143. package/dist/utils/styleStrings.js +10 -0
  144. package/dist/utils/styleStrings.test.d.ts +1 -0
  145. package/package.json +51 -9
  146. package/dist/Button-REznN-RP.js +0 -1139
  147. package/dist/Dialog.module-BO0mdB7d.js +0 -15
  148. package/dist/assets/CallToActionButton.css +0 -1
  149. package/dist/assets/main.css +0 -1
  150. package/dist/components/CallToActionButton/CallToActionButton.d.ts +0 -23
  151. package/dist/components/CallToActionButton/CallToActionButton.js +0 -57
  152. package/dist/components/Dialog/Title.js +0 -14
  153. package/src/playground/Playground.tsx +0 -58
@@ -0,0 +1,65 @@
1
+ import '../../assets/Button.css';
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
+ }
60
+ );
61
+ });
62
+ export {
63
+ P as Button,
64
+ P as default
65
+ };
@@ -0,0 +1,62 @@
1
+ import { StoryObj } from '@storybook/react';
2
+
3
+ declare const meta: {
4
+ title: string;
5
+ component: import('react').ForwardRefExoticComponent<import('./Button').ButtonProps & import('react').RefAttributes<HTMLButtonElement>>;
6
+ tags: string[];
7
+ decorators: ((Story: import('@storybook/types').PartialStoryFn<import('@storybook/react').ReactRenderer, {
8
+ link: string;
9
+ loading?: boolean | undefined;
10
+ disabled?: boolean | undefined;
11
+ className?: string | undefined;
12
+ children: import('react').ReactNode;
13
+ variant?: ("primary" | "secondary" | "quick") | undefined;
14
+ muiButtonBaseProps?: import('@mui/base').ButtonOwnProps | undefined;
15
+ type?: undefined;
16
+ onClick?: undefined;
17
+ ref?: import('react').LegacyRef<HTMLButtonElement> | undefined;
18
+ key?: import('react').Key | null | undefined;
19
+ } | {
20
+ onClick: () => void;
21
+ type?: "button" | "submit" | "reset" | undefined;
22
+ loading?: boolean | undefined;
23
+ disabled?: boolean | undefined;
24
+ className?: string | undefined;
25
+ children: import('react').ReactNode;
26
+ variant?: ("primary" | "secondary" | "quick") | undefined;
27
+ muiButtonBaseProps?: import('@mui/base').ButtonOwnProps | undefined;
28
+ link?: undefined;
29
+ ref?: import('react').LegacyRef<HTMLButtonElement> | undefined;
30
+ key?: import('react').Key | null | undefined;
31
+ }>) => import("react/jsx-runtime").JSX.Element)[];
32
+ argTypes: {
33
+ onClick: {
34
+ if: {
35
+ arg: string;
36
+ exists: false;
37
+ };
38
+ };
39
+ type: {
40
+ control: {
41
+ type: "text";
42
+ };
43
+ if: {
44
+ arg: string;
45
+ exists: true;
46
+ };
47
+ };
48
+ link: {
49
+ control: {
50
+ type: "text";
51
+ };
52
+ if: {
53
+ arg: string;
54
+ exists: false;
55
+ };
56
+ };
57
+ };
58
+ };
59
+ export default meta;
60
+ type Story = StoryObj<typeof meta>;
61
+ export declare const Simple: Story;
62
+ export declare const Link: Story;
@@ -0,0 +1,34 @@
1
+ import { ReactNode } from 'react';
2
+
3
+ type CheckboxTheme = 'light' | 'accent';
4
+ type CheckboxSizes = 'small' | 'normal';
5
+ type CheckboxProps = {
6
+ /** Space separated list of CSS classes to apply */
7
+ className?: string;
8
+ /** ID that tests can use to get this component from the DOM */
9
+ 'data-testid'?: string;
10
+ /** Checkbox label */
11
+ label?: ReactNode;
12
+ /** Checkbox theme */
13
+ theme?: CheckboxTheme;
14
+ /** Checkbox size */
15
+ size?: CheckboxSizes;
16
+ /** Checkbox size */
17
+ checked?: boolean;
18
+ /** Indeterminate state */
19
+ isIndeterminate?: boolean;
20
+ /** Name */
21
+ name?: string;
22
+ /** Functionality to perform when the checkbox value change */
23
+ onChange: (checked: boolean) => void;
24
+ /** Checkbox label */
25
+ children?: ReactNode;
26
+ /** Set the highlight of the label */
27
+ highlightLabel?: boolean;
28
+ };
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;
34
+ export { Checkbox };
@@ -0,0 +1,71 @@
1
+ import '../../assets/Checkbox.css';
2
+ import { jsxs as v, jsx as c } from "react/jsx-runtime";
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
43
+ }) => {
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;
60
+ return /* @__PURE__ */ v("div", { className: C, onClick: () => {
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 })
67
+ ] });
68
+ };
69
+ export {
70
+ M as Checkbox
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,37 @@
1
+ import { IconFamilies, 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
+ /** Which style of chip to show */
24
+ variant?: Variant;
25
+ /** Dataset test id only used for tests, used to hook onto the loading skeleton component for this chip */
26
+ 'data-testid-skeleton'?: string;
27
+ };
28
+ export type ChipAdornmentSlotProps = {
29
+ /** The Marola Icon to display */
30
+ icon: ReactElement<IconProps<IconFamilies>>;
31
+ /** Any additional classes to apply to icon */
32
+ className?: string;
33
+ /** Dataset test id only used for tests to reach in and grab the rendered DOM node of the icon */
34
+ 'data-testid'?: string;
35
+ };
36
+ export declare const Chip: import('react').ForwardRefExoticComponent<ChipProps & import('react').RefAttributes<unknown>>;
37
+ export {};
@@ -0,0 +1,113 @@
1
+ import '../../assets/Chip.css';
2
+ import { jsx as e, jsxs as u } from "react/jsx-runtime";
3
+ import { forwardRef as d, cloneElement as m } from "react";
4
+ import { c as l } from "../../clsx-DB4S2d7J.js";
5
+ import { Icon as g } from "../Icon/Icon.js";
6
+ import "../Button/Button.js";
7
+ import "../Dialog/Backdrop.js";
8
+ import "../Typography/Typography.js";
9
+ import "../IconButton/IconButton.js";
10
+ import "../Select/Select.js";
11
+ import { Skeleton as b } from "../Skeleton/Skeleton.js";
12
+ import "../Table/Table.js";
13
+ import "../Tabs/Tabs.js";
14
+ import { B as j } from "../../Button-2b1peDFT.js";
15
+ const f = "_chip_1j9h1_60", x = "_chip__adornment_1j9h1_114", k = "_chip__remove_1j9h1_119", r = {
16
+ "u-typography-h1": "_u-typography-h1_1j9h1_1",
17
+ "u-typography-h2": "_u-typography-h2_1j9h1_8",
18
+ "u-typography-h3": "_u-typography-h3_1j9h1_15",
19
+ "u-typography-h4": "_u-typography-h4_1j9h1_22",
20
+ "u-typography-h5": "_u-typography-h5_1j9h1_29",
21
+ "u-typography-h6": "_u-typography-h6_1j9h1_36",
22
+ "u-typography-base": "_u-typography-base_1j9h1_43",
23
+ "u-typography-base--xxl": "_u-typography-base--xxl_1j9h1_48",
24
+ "u-typography-base--xl": "_u-typography-base--xl_1j9h1_52",
25
+ "u-typography-base--lg": "_u-typography-base--lg_1j9h1_56",
26
+ "u-typography-base--sm": "_u-typography-base--sm_1j9h1_60",
27
+ chip: f,
28
+ "u-typography-base--bold": "_u-typography-base--bold_1j9h1_64",
29
+ "u-typography-base--strikethrough": "_u-typography-base--strikethrough_1j9h1_67",
30
+ "u-typography-base--underlined": "_u-typography-base--underlined_1j9h1_70",
31
+ "u-typography-base--strikethrough-underlined": "_u-typography-base--strikethrough-underlined_1j9h1_73",
32
+ "chip--button": "_chip--button_1j9h1_89",
33
+ "chip--outlined": "_chip--outlined_1j9h1_102",
34
+ "chip--contained": "_chip--contained_1j9h1_108",
35
+ chip__adornment: x,
36
+ chip__remove: k,
37
+ "chip__remove--disabled": "_chip__remove--disabled_1j9h1_130"
38
+ }, C = d((t, o) => {
39
+ const { children: h, onClickContent: p, disabled: _, className: i, variant: n } = t;
40
+ let a = l(
41
+ r.chip,
42
+ { [r["chip--outlined"]]: n === "outlined" },
43
+ { [r["chip--contained"]]: n === "contained" },
44
+ i
45
+ );
46
+ return p ? (a += ` ${r["chip--button"]}`, /* @__PURE__ */ e(
47
+ j,
48
+ {
49
+ onClick: p,
50
+ disabled: _,
51
+ "data-testid": t["data-testid"],
52
+ ref: o,
53
+ className: a,
54
+ children: h
55
+ }
56
+ )) : /* @__PURE__ */ e("span", { "data-testid": t["data-testid"], ref: o, className: a, children: h });
57
+ }), N = (t) => {
58
+ const { icon: o, disabled: h = !1, className: p } = t;
59
+ if (o) {
60
+ const _ = l(r.chip__adornment, p), i = h ? m(o, { color: "rgb(var(--gray-95-rgb), 0.4)" }) : o;
61
+ return /* @__PURE__ */ e("span", { className: _, children: i });
62
+ }
63
+ return null;
64
+ }, $ = d((t, o) => {
65
+ const {
66
+ label: h,
67
+ className: p,
68
+ onClickContent: _,
69
+ leftAdornment: i,
70
+ loading: n = !1,
71
+ disabled: a = !1,
72
+ variant: y = "default",
73
+ onClickRemove: c
74
+ } = t;
75
+ return n ? /* @__PURE__ */ e(
76
+ b,
77
+ {
78
+ style: { width: "6rem", height: "2rem", borderRadius: "4rem", display: "inline-flex" },
79
+ "data-testid": t["data-testid-skeleton"]
80
+ }
81
+ ) : /* @__PURE__ */ u(
82
+ C,
83
+ {
84
+ ref: o,
85
+ "data-testid": t["data-testid"],
86
+ onClickContent: _,
87
+ disabled: a,
88
+ className: p,
89
+ variant: y,
90
+ children: [
91
+ i && /* @__PURE__ */ e(N, { ...i, disabled: a }),
92
+ h,
93
+ c && /* @__PURE__ */ e(
94
+ "span",
95
+ {
96
+ className: l(r.chip__remove, { [r["chip__remove--disabled"]]: a }),
97
+ role: "button",
98
+ tabIndex: a ? -1 : 0,
99
+ "aria-label": "remove",
100
+ onClick: (s) => {
101
+ s == null || s.stopPropagation(), s == null || s.nativeEvent.stopImmediatePropagation(), c();
102
+ },
103
+ "aria-disabled": a,
104
+ children: /* @__PURE__ */ e(g, { icon: "circle-xmark", size: "1.125rem", color: "rgba(var(--gray-95-rgb), 0.45)" })
105
+ }
106
+ )
107
+ ]
108
+ }
109
+ );
110
+ });
111
+ export {
112
+ $ as Chip
113
+ };
@@ -0,0 +1,40 @@
1
+ import { StoryObj } from '@storybook/react';
2
+
3
+ declare const meta: {
4
+ title: string;
5
+ component: import('react').ForwardRefExoticComponent<{
6
+ label: import('react').ReactNode;
7
+ loading?: boolean | undefined;
8
+ leftAdornment?: import('./Chip').ChipAdornmentSlotProps | undefined;
9
+ 'data-testid'?: string | undefined;
10
+ onClickContent?: (() => void) | undefined;
11
+ onClickRemove?: (() => void) | undefined;
12
+ disabled?: boolean | undefined;
13
+ className?: string | undefined;
14
+ variant?: import('./Chip').Variant | undefined;
15
+ 'data-testid-skeleton'?: string | undefined;
16
+ } & import('react').RefAttributes<unknown>>;
17
+ tags: string[];
18
+ decorators: ((Story: import('@storybook/types').PartialStoryFn<import('@storybook/react').ReactRenderer, {
19
+ label: import('react').ReactNode;
20
+ loading?: boolean | undefined;
21
+ leftAdornment?: import('./Chip').ChipAdornmentSlotProps | undefined;
22
+ 'data-testid'?: string | undefined;
23
+ onClickContent?: (() => void) | undefined;
24
+ onClickRemove?: (() => void) | undefined;
25
+ disabled?: boolean | undefined;
26
+ className?: string | undefined;
27
+ variant?: import('./Chip').Variant | undefined;
28
+ 'data-testid-skeleton'?: string | undefined;
29
+ ref?: import('react').LegacyRef<unknown> | undefined;
30
+ key?: import('react').Key | null | undefined;
31
+ }>) => import("react/jsx-runtime").JSX.Element)[];
32
+ };
33
+ export default meta;
34
+ type Story = StoryObj<typeof meta>;
35
+ export declare const Simple: Story;
36
+ export declare const Clickable: Story;
37
+ export declare const ClickableWithRemove: Story;
38
+ export declare const FullDefault: Story;
39
+ export declare const FullOutlined: Story;
40
+ export declare const FullContained: Story;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,5 +1,5 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
- import { s as t } from "../../Dialog.module-BO0mdB7d.js";
2
+ import { s as t } from "../../Dialog.module-DFEmFdYT.js";
3
3
  const i = ({ children: s }) => /* @__PURE__ */ o("div", { className: t.dialog__actions, children: s });
4
4
  export {
5
5
  i as default
@@ -2,5 +2,5 @@
2
2
  declare const Backdrop: import('react').ForwardRefExoticComponent<{
3
3
  open?: boolean | undefined;
4
4
  className: string;
5
- } & import("react").RefAttributes<HTMLDivElement>>;
5
+ } & import('react').RefAttributes<HTMLDivElement>>;
6
6
  export default Backdrop;
@@ -1,16 +1,9 @@
1
1
  import { jsx as a } from "react/jsx-runtime";
2
2
  import { forwardRef as t } from "react";
3
- import { s as e } from "../../Dialog.module-BO0mdB7d.js";
3
+ import { s as e } from "../../Dialog.module-DFEmFdYT.js";
4
4
  const i = t((o, r) => {
5
5
  const { open: m, className: p, ...s } = o;
6
- return /* @__PURE__ */ a(
7
- "div",
8
- {
9
- className: e.dialog__backdrop,
10
- ref: r,
11
- ...s
12
- }
13
- );
6
+ return /* @__PURE__ */ a("div", { className: e.dialog__backdrop, ref: r, ...s });
14
7
  });
15
8
  export {
16
9
  i as default
@@ -1,16 +1,17 @@
1
- import { jsx as t } from "react/jsx-runtime";
2
- import { s as c } from "../../Dialog.module-BO0mdB7d.js";
3
- import { B as i } from "../../Button-REznN-RP.js";
4
- const s = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='32'%20height='32'%20viewBox='0%200%2032%2032'%20fill='none'%3e%3cg%20clip-path='url(%23clip0_2659_187)'%3e%3cpath%20d='M15.9437%2013.8812L18.9374%2010.9375C19.5249%2010.3562%2020.4749%2010.3562%2021.0062%2010.9375C21.6437%2011.525%2021.6437%2012.475%2021.0062%2013.0062L18.1187%2015.9437L21.0062%2018.9375C21.6437%2019.525%2021.6437%2020.475%2021.0062%2021.0062C20.4749%2021.6437%2019.5249%2021.6437%2018.9374%2021.0062L15.9437%2018.1187L13.0062%2021.0062C12.4749%2021.6437%2011.5249%2021.6437%2010.9374%2021.0062C10.3562%2020.475%2010.3562%2019.525%2010.9374%2018.9375L13.8812%2015.9437L10.9374%2013.0062C10.3562%2012.475%2010.3562%2011.525%2010.9374%2010.9375C11.5249%2010.3562%2012.4749%2010.3562%2013.0062%2010.9375L15.9437%2013.8812Z'%20fill='%23DF4561'/%3e%3cpath%20opacity='0.4'%20d='M0%2016C0%207.1625%207.1625%200%2016%200C24.8375%200%2032%207.1625%2032%2016C32%2024.8375%2024.8375%2032%2016%2032C7.1625%2032%200%2024.8375%200%2016ZM10.9375%2013.0063L13.8813%2015.9438L10.9375%2018.9375C10.3562%2019.525%2010.3562%2020.475%2010.9375%2021.0063C11.525%2021.6438%2012.475%2021.6438%2013.0063%2021.0063L15.9438%2018.1187L18.9375%2021.0063C19.525%2021.6438%2020.475%2021.6438%2021.0063%2021.0063C21.6438%2020.475%2021.6438%2019.525%2021.0063%2018.9375L18.1187%2015.9438L21.0063%2013.0063C21.6438%2012.475%2021.6438%2011.525%2021.0063%2010.9375C20.475%2010.3562%2019.525%2010.3562%2018.9375%2010.9375L15.9438%2013.8813L13.0063%2010.9375C12.475%2010.3562%2011.525%2010.3562%2010.9375%2010.9375C10.3562%2011.525%2010.3562%2012.475%2010.9375%2013.0063Z'%20fill='%23DF4561'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_2659_187'%3e%3crect%20width='32'%20height='32'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e", d = ({ handleOnClose: e, className: l }) => {
5
- const o = l != null ? c["dialog__close-icon "] + l : c["dialog__close-icon"];
6
- return /* @__PURE__ */ t(
7
- i,
1
+ import { jsx as s } from "react/jsx-runtime";
2
+ import { Icon as r } from "../Icon/Icon.js";
3
+ import { s as t } from "../../Dialog.module-DFEmFdYT.js";
4
+ import { B as a } from "../../Button-2b1peDFT.js";
5
+ const d = ({ handleOnClose: i, className: o }) => {
6
+ const l = o != null ? t["dialog__close-icon "] + o : t["dialog__close-icon"];
7
+ return /* @__PURE__ */ s(
8
+ a,
8
9
  {
9
- className: o,
10
+ className: l,
10
11
  "aria-description": "Close dialog",
11
- onClick: e,
12
+ onClick: i,
12
13
  "data-testid": "dialog-close-button",
13
- children: /* @__PURE__ */ t("img", { src: s, alt: "close" })
14
+ children: /* @__PURE__ */ s(r, { icon: "circle-xmark", size: 32, color: "var(--gray-75)" })
14
15
  }
15
16
  );
16
17
  };
@@ -1,20 +1,21 @@
1
- import { default as DialogTitle } from './Title';
1
+ import { default as DialogTitle } from './DialogTitle';
2
2
  import { default as Content } from './Content';
3
3
  import { default as Actions } from './Actions';
4
4
  import { ModalProps } from '@mui/base';
5
5
  import { JSXElementConstructor, ReactElement, ReactNode } from 'react';
6
6
 
7
- export type CloseReason = "backdropClick" | "escapeKeyDown" | "closeButtonClick";
7
+ export type CloseReason = 'backdropClick' | 'escapeKeyDown' | 'closeButtonClick';
8
8
  export interface DialogProps extends ModalProps {
9
- /** main children content */
10
- children: ReactElement<any, string | JSXElementConstructor<any>>;
9
+ /** main content */
10
+ children: ReactElement<unknown, string | JSXElementConstructor<unknown>>;
11
11
  /** display title label */
12
12
  dialogTitle: ReactNode;
13
13
  /** display subtitle */
14
14
  dialogSubtitle?: ReactNode;
15
15
  /** if true, show skeleton */
16
16
  isLoading?: boolean;
17
- onClose: () => void;
17
+ /** callback for when close is clicked */
18
+ onClose?: () => void;
18
19
  }
19
20
  declare const Dialog: ({ children, dialogTitle, dialogSubtitle, isLoading, onClose, ...props }: DialogProps) => import("react/jsx-runtime").JSX.Element;
20
21
  export { Dialog, DialogTitle, Content, Actions };