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

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 (108) hide show
  1. package/README.md +13 -2
  2. package/dist/{Button-D--uN90N.js → Button-B1umG8kJ.js} +3 -3
  3. package/dist/ClickAwayListener-BKznXF1d.js +106 -0
  4. package/dist/Dialog.module-CGVM5V_D.js +15 -0
  5. package/dist/Portal-BcdMtRGF.js +73 -0
  6. package/dist/{Tabs.module-BKlNuSPH.js → Tabs.module-BA-PC7fA.js} +13 -13
  7. package/dist/_commonjsHelpers-CT_km90n.js +30 -0
  8. package/dist/assets/Advice.css +1 -0
  9. package/dist/assets/Button.css +1 -1
  10. package/dist/assets/Checkbox.css +1 -0
  11. package/dist/assets/Dialog.css +1 -1
  12. package/dist/assets/IconButton.css +1 -1
  13. package/dist/assets/Input.css +1 -0
  14. package/dist/assets/Pagination.css +1 -1
  15. package/dist/assets/Skeleton.css +1 -0
  16. package/dist/assets/Snackbar.css +1 -0
  17. package/dist/assets/SortTooltip.css +1 -0
  18. package/dist/assets/Stepper.css +1 -0
  19. package/dist/assets/Table.css +1 -0
  20. package/dist/assets/Tabs.css +1 -1
  21. package/dist/assets/Toggle.css +1 -0
  22. package/dist/assets/Tooltip.css +1 -0
  23. package/dist/assets/Typography.css +1 -1
  24. package/dist/assets/{main.css → global.css} +1 -1
  25. package/dist/components/Advice/Advice.d.ts +16 -0
  26. package/dist/components/Advice/Advice.js +25 -0
  27. package/dist/components/Button/Button.d.ts +9 -1
  28. package/dist/components/Button/Button.js +54 -38
  29. package/dist/components/Button/Button.stories.d.ts +60 -0
  30. package/dist/components/Button/Button.stories.js +40 -0
  31. package/dist/components/Checkbox/Checkbox.d.ts +17 -0
  32. package/dist/components/Checkbox/Checkbox.js +48 -0
  33. package/dist/components/Dialog/Actions.js +1 -1
  34. package/dist/components/Dialog/Backdrop.d.ts +1 -1
  35. package/dist/components/Dialog/Backdrop.js +1 -1
  36. package/dist/components/Dialog/CloseIconButton.js +12 -124
  37. package/dist/components/Dialog/Dialog.d.ts +3 -2
  38. package/dist/components/Dialog/Dialog.js +418 -20072
  39. package/dist/components/Dialog/Dialog.stories.d.ts +343 -0
  40. package/dist/components/Dialog/Dialog.stories.js +59 -0
  41. package/dist/components/Dialog/Title.js +1 -1
  42. package/dist/components/Icon/Icon.d.ts +18 -0
  43. package/dist/components/Icon/Icon.js +95 -0
  44. package/dist/components/IconButton/IconButton.d.ts +3 -3
  45. package/dist/components/IconButton/IconButton.js +54 -65
  46. package/dist/components/Input/Input.d.ts +44 -0
  47. package/dist/components/Input/Input.js +497 -0
  48. package/dist/components/Input/Input.stories.d.ts +43 -0
  49. package/dist/components/Input/Input.stories.js +106 -0
  50. package/dist/components/LoadingSpinner/LoadingSpinner.d.ts +2 -0
  51. package/dist/components/LoadingSpinner/LoadingSpinner.stories.d.ts +14 -0
  52. package/dist/components/LoadingSpinner/LoadingSpinner.stories.js +38 -0
  53. package/dist/components/PageHeader/PageHeader.d.ts +25 -15
  54. package/dist/components/PageHeader/PageHeader.js +32 -50
  55. package/dist/components/PageHeader/PageHeader.stories.d.ts +43 -0
  56. package/dist/components/PageHeader/PageHeader.stories.js +49 -0
  57. package/dist/components/Pagination/Pagination.d.ts +1 -1
  58. package/dist/components/Pagination/Pagination.js +47 -47
  59. package/dist/components/Skeleton/Skeleton.d.ts +18 -0
  60. package/dist/components/Skeleton/Skeleton.js +26 -0
  61. package/dist/components/Snackbar/Snackbar.d.ts +13 -0
  62. package/dist/components/Snackbar/Snackbar.js +622 -0
  63. package/dist/components/SortTooltip/SortTooltip.d.ts +26 -0
  64. package/dist/components/SortTooltip/SortTooltip.js +67 -1
  65. package/dist/components/Stepper/Stepper.d.ts +16 -0
  66. package/dist/components/Stepper/Stepper.js +33 -0
  67. package/dist/components/Table/Table.d.ts +39 -0
  68. package/dist/components/Table/Table.js +122 -1
  69. package/dist/components/Table/TableContext.d.ts +19 -0
  70. package/dist/components/Table/TableContext.js +21 -1
  71. package/dist/components/Tabs/Tab.d.ts +1 -1
  72. package/dist/components/Tabs/Tab.js +5 -5
  73. package/dist/components/Tabs/TabPanel.d.ts +1 -1
  74. package/dist/components/Tabs/TabPanel.js +4 -4
  75. package/dist/components/Tabs/Tabs.d.ts +1 -1
  76. package/dist/components/Tabs/Tabs.js +3 -3
  77. package/dist/components/Toggle/Toggle.d.ts +14 -0
  78. package/dist/components/Toggle/Toggle.js +256 -0
  79. package/dist/components/Tooltip/Tooltip.d.ts +17 -0
  80. package/dist/components/Tooltip/Tooltip.js +1366 -1
  81. package/dist/components/Typography/Typography.d.ts +14 -5
  82. package/dist/components/Typography/Typography.js +76 -59
  83. package/dist/components/Typography/Typography.stories.d.ts +31 -0
  84. package/dist/components/Typography/Typography.stories.js +30 -0
  85. package/dist/components/Typography/typography.test.d.ts +1 -0
  86. package/dist/components/Typography/typography.test.js +11357 -0
  87. package/dist/index-BNWbc5Kh.js +19628 -0
  88. package/dist/{index-BvA1HyDs.js → index-CqjC7P5Y.js} +91 -95
  89. package/dist/magic-string.es-O_8lTkE3.js +738 -0
  90. package/dist/main.d.ts +16 -7
  91. package/dist/main.js +50 -28
  92. package/dist/objectWithoutPropertiesLoose-D7Cp0Pg_.js +26 -0
  93. package/dist/test-utils/assertStyles.d.ts +1 -0
  94. package/dist/test-utils/assertStyles.js +11 -0
  95. package/dist/types/helpers.d.ts +8 -0
  96. package/dist/useButton-Bc8IAgyk.js +106 -0
  97. package/dist/{useCompoundItem-wTwXbURC.js → useCompoundItem-CTYi5M_E.js} +1 -1
  98. package/dist/useIsFocusVisible-BH4IAdcw.js +69 -0
  99. package/dist/useTimeout-DxF9kiZL.js +36 -0
  100. package/dist/utils/styleStrings.d.ts +6 -0
  101. package/dist/utils/styleStrings.js +10 -0
  102. package/dist/utils/styleStrings.test.d.ts +1 -0
  103. package/dist/utils/styleStrings.test.js +41 -0
  104. package/dist/vi.Y_w82WR8-Df0JUamG.js +9860 -0
  105. package/package.json +30 -9
  106. package/dist/Dialog.module-BKWFakxu.js +0 -15
  107. package/dist/objectWithoutPropertiesLoose-ClNcje2_.js +0 -22
  108. package/dist/useButton-abQpo0za.js +0 -187
@@ -1,52 +1,68 @@
1
1
  import '../../assets/Button.css';
2
- import { jsx as s, jsxs as u } from "react/jsx-runtime";
3
- import { forwardRef as c, useMemo as h } from "react";
4
- import { c as v } from "../../clsx-DB4S2d7J.js";
5
- import { LoadingSpinner as f } from "../LoadingSpinner/LoadingSpinner.js";
6
- import { B as p } from "../../Button-D--uN90N.js";
7
- const g = "_h1_nvysm_1", k = "_h2_nvysm_11", q = "_h3_nvysm_21", w = "_h4_nvysm_31", x = "_body_nvysm_41", N = "_quote_nvysm_75", B = "_form__input_nvysm_86", j = "_form__hint_nvysm_91", S = "_form__label_nvysm_96", $ = "_form__dropdown_nvysm_101", C = "_table__header_nvysm_107", L = "_table__body_nvysm_112", M = "_button_nvysm_123", o = {
8
- h1: g,
9
- "h1--bold": "_h1--bold_nvysm_7",
10
- h2: k,
11
- "h2--bold": "_h2--bold_nvysm_17",
12
- h3: q,
13
- "h3--bold": "_h3--bold_nvysm_27",
14
- h4: w,
15
- "h4--bold": "_h4--bold_nvysm_37",
16
- body: x,
17
- "body--large": "_body--large_nvysm_46",
18
- "body--medium": "_body--medium_nvysm_50",
19
- "body--small": "_body--small_nvysm_54",
20
- "body--tiny": "_body--tiny_nvysm_58",
21
- "body--bold": "_body--bold_nvysm_62",
22
- "body--strikethrough": "_body--strikethrough_nvysm_65",
23
- "body--underlined": "_body--underlined_nvysm_68",
24
- "body--strikethrough-underlined": "_body--strikethrough-underlined_nvysm_71",
25
- quote: N,
26
- "quote--large": "_quote--large_nvysm_80",
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",
27
31
  form__input: B,
28
32
  form__hint: j,
29
33
  form__label: S,
30
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",
31
39
  table__header: C,
32
40
  table__body: L,
33
- "table__body--secondary": "_table__body--secondary_nvysm_117",
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",
34
46
  button: M,
35
- "button--primary": "_button--primary_nvysm_142",
36
- "button--secondary": "_button--secondary_nvysm_161",
37
- "button--quick": "_button--quick_nvysm_178",
38
- "button__loading-container": "_button__loading-container_nvysm_201"
39
- }, E = c((d, r) => {
40
- const { onClick: e, link: m, loading: y, children: n, type: b = "button", disabled: l, className: t, variant: _ = "primary" } = d, a = {
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 = {
41
57
  invert: _ === "secondary" || _ === "quick"
42
- }, i = h(
43
- () => v([o.button, o[`button--${_}`], t]),
58
+ }, q = c(
59
+ () => y([r.button, r[`button--${_}`], t]),
44
60
  [t, _]
45
61
  );
46
- return /* @__PURE__ */ s(p, { type: b, href: m, onClick: e, disabled: l, className: i, ref: r, children: y ? /* @__PURE__ */ u("div", { className: o["button__loading-container"], children: [
47
- /* @__PURE__ */ s(f, { ...a }),
48
- n
49
- ] }) : n });
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 });
50
66
  });
51
67
  export {
52
68
  E as Button,
@@ -0,0 +1,60 @@
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
+ type?: undefined;
15
+ onClick?: undefined;
16
+ ref?: import('react').LegacyRef<HTMLButtonElement> | undefined;
17
+ key?: import('react').Key | null | undefined;
18
+ } | {
19
+ onClick: () => void;
20
+ type?: "button" | "submit" | "reset" | undefined;
21
+ loading?: boolean | undefined;
22
+ disabled?: boolean | undefined;
23
+ className?: string | undefined;
24
+ children: import('react').ReactNode;
25
+ variant?: ("primary" | "secondary" | "quick") | undefined;
26
+ link?: undefined;
27
+ ref?: import('react').LegacyRef<HTMLButtonElement> | undefined;
28
+ key?: import('react').Key | null | undefined;
29
+ }>) => import("react/jsx-runtime").JSX.Element)[];
30
+ argTypes: {
31
+ onClick: {
32
+ if: {
33
+ arg: string;
34
+ exists: false;
35
+ };
36
+ };
37
+ type: {
38
+ control: {
39
+ type: "text";
40
+ };
41
+ if: {
42
+ arg: string;
43
+ exists: true;
44
+ };
45
+ };
46
+ link: {
47
+ control: {
48
+ type: "text";
49
+ };
50
+ if: {
51
+ arg: string;
52
+ exists: false;
53
+ };
54
+ };
55
+ };
56
+ };
57
+ export default meta;
58
+ type Story = StoryObj<typeof meta>;
59
+ export declare const Simple: Story;
60
+ export declare const Link: Story;
@@ -0,0 +1,40 @@
1
+ import '../../assets/global.css';
2
+ import { jsx as t } from "react/jsx-runtime";
3
+ /* empty css */
4
+ import { Button as i } from "./Button.js";
5
+ import "react";
6
+ import "../Dialog/Backdrop.js";
7
+ import "../Typography/Typography.js";
8
+ import "../IconButton/IconButton.js";
9
+ import "../Table/Table.js";
10
+ import "../Tabs/Tabs.js";
11
+ const d = {
12
+ title: "Components/Button",
13
+ component: i,
14
+ tags: ["autodocs"],
15
+ decorators: [
16
+ (o) => /* @__PURE__ */ t("div", { style: { padding: "1em" }, children: /* @__PURE__ */ t(o, {}) })
17
+ ],
18
+ argTypes: {
19
+ onClick: {
20
+ if: { arg: "link", exists: !1 }
21
+ },
22
+ type: {
23
+ control: { type: "text" },
24
+ if: { arg: "onClick", exists: !0 }
25
+ },
26
+ link: {
27
+ control: { type: "text" },
28
+ if: { arg: "onClick", exists: !1 }
29
+ }
30
+ }
31
+ }, k = {
32
+ args: { children: "Button", onClick: () => alert("Button was clicked!") }
33
+ }, f = {
34
+ args: { children: "Button", link: "https://marola.pismolabs.io" }
35
+ };
36
+ export {
37
+ f as Link,
38
+ k as Simple,
39
+ d as default
40
+ };
@@ -0,0 +1,17 @@
1
+ import { ReactNode } from 'react';
2
+
3
+ type CheckboxTheme = 'light' | 'accent';
4
+ type CheckboxSizes = 'small' | 'normal';
5
+ type CheckboxProps = {
6
+ className?: string;
7
+ 'data-testid'?: string;
8
+ label?: ReactNode;
9
+ theme?: CheckboxTheme;
10
+ size?: CheckboxSizes;
11
+ isChecked?: boolean;
12
+ isIndeterminate?: boolean;
13
+ name?: string;
14
+ onChange: (checked: boolean) => void;
15
+ };
16
+ declare const Checkbox: ({ className, label, name, theme, size, isChecked, onChange, isIndeterminate, ...rest }: CheckboxProps) => import("react/jsx-runtime").JSX.Element;
17
+ export { Checkbox };
@@ -0,0 +1,48 @@
1
+ import '../../assets/Checkbox.css';
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
24
+ }) => {
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
+ );
37
+ 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 })
44
+ ] });
45
+ };
46
+ export {
47
+ S as Checkbox
48
+ };
@@ -1,5 +1,5 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
- import { s as t } from "../../Dialog.module-BKWFakxu.js";
2
+ import { s as t } from "../../Dialog.module-CGVM5V_D.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,6 +1,6 @@
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-BKWFakxu.js";
3
+ import { s as e } from "../../Dialog.module-CGVM5V_D.js";
4
4
  const i = t((o, r) => {
5
5
  const { open: m, className: p, ...s } = o;
6
6
  return /* @__PURE__ */ a("div", { className: e.dialog__backdrop, ref: r, ...s });
@@ -1,132 +1,20 @@
1
- import { jsx as j } from "react/jsx-runtime";
2
- import { d as C, e as W } from "../../index-BvA1HyDs.js";
3
- import I from "react";
4
- import { s as O } from "../../Dialog.module-BKWFakxu.js";
5
- import { B as P } from "../../Button-D--uN90N.js";
6
- var N = { exports: {} };
7
- (function(w, b) {
8
- (function(x, y) {
9
- w.exports = y(I);
10
- })(C, (x) => (() => {
11
- var y = { 639: (t) => {
12
- t.exports = x;
13
- } }, E = {};
14
- function s(t) {
15
- var o = E[t];
16
- if (o !== void 0)
17
- return o.exports;
18
- var c = E[t] = { exports: {} };
19
- return y[t](c, c.exports, s), c.exports;
20
- }
21
- s.n = (t) => {
22
- var o = t && t.__esModule ? () => t.default : () => t;
23
- return s.d(o, { a: o }), o;
24
- }, s.d = (t, o) => {
25
- for (var c in o)
26
- s.o(o, c) && !s.o(t, c) && Object.defineProperty(t, c, { enumerable: !0, get: o[c] });
27
- }, s.o = (t, o) => Object.prototype.hasOwnProperty.call(t, o), s.r = (t) => {
28
- typeof Symbol < "u" && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(t, "__esModule", { value: !0 });
29
- };
30
- var _ = {};
31
- return (() => {
32
- s.r(_), s.d(_, { default: () => B });
33
- var t = s(639), o = s.n(t), c = function(i, a, l, r) {
34
- return new (l || (l = Promise))(function(p, u) {
35
- function h(n) {
36
- try {
37
- d(r.next(n));
38
- } catch (e) {
39
- u(e);
40
- }
41
- }
42
- function f(n) {
43
- try {
44
- d(r.throw(n));
45
- } catch (e) {
46
- u(e);
47
- }
48
- }
49
- function d(n) {
50
- var e;
51
- n.done ? p(n.value) : (e = n.value, e instanceof l ? e : new l(function(m) {
52
- m(e);
53
- })).then(h, f);
54
- }
55
- d((r = r.apply(i, a || [])).next());
56
- });
57
- };
58
- function T() {
59
- return typeof globalThis < "u" && globalThis.WAVES_ICONS_BASE_URL ? globalThis.WAVES_ICONS_BASE_URL : typeof window < "u" && window.WAVES_ICONS_BASE_URL ? window.WAVES_ICONS_BASE_URL : "https://waves-icons.pismolabs.io/bin";
60
- }
61
- function A(i, a, l) {
62
- const r = a && Number.isNaN(Number(a)) ? a : a ? `${a}px` : "1em", p = l || "currentColor", u = { fill: p, color: p, width: r, height: r };
63
- return i && Object.keys(u).forEach((h) => {
64
- i.setAttribute(h, u[h]);
65
- }), i && Object.assign(i.style, u), i;
66
- }
67
- const B = ({ icon: i, color: a, size: l }) => {
68
- const r = (0, t.useRef)(null), [p, u] = (0, t.useState)(null), h = (f) => {
69
- const d = A(f, `${l || ""}`, a);
70
- r != null && r.current && (r.current.innerHTML = "", r.current.append(d)), u(d);
71
- };
72
- return (0, t.useEffect)(() => {
73
- (function(f, d = !1) {
74
- return c(this, void 0, void 0, function* () {
75
- return function(n) {
76
- return c(this, void 0, void 0, function* () {
77
- return fetch(n, { cache: "force-cache" }).then((e) => e.status >= 200 && e.status <= 299 ? e.text() : Promise.resolve(`
78
- <?xml version="1.0" encoding="UTF-8" standalone="no"?>
79
- <svg role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000">
80
- <!-- Waves Icon Not Found -->
81
- </svg>
82
- `)).catch(console.error);
83
- });
84
- }(f.startsWith("http") ? f : function(n, e = "svg", m) {
85
- return m || (m = T()), `${m}/${n}.${e}`;
86
- }(f)).then((n) => {
87
- try {
88
- const e = d ? n : function(m, S) {
89
- S || (S = `
90
- <?xml version="1.0" encoding="UTF-8" standalone="no"?>
91
- <svg role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000">
92
- <!-- Waves Icon Not Found -->
93
- </svg>
94
- `);
95
- const g = Object.assign(document.createElement("template"), { innerHTML: S }).content.querySelector("svg");
96
- return Array.from(g.attributes).map(({ name: v }) => v).find((v) => {
97
- v.startsWith("on") && g.removeAttribute(v);
98
- }), g.querySelectorAll(["a", "animate", "color-profile", "cursor", "discard", "fedropshadow", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"].join(",")).forEach((v) => {
99
- v.remove();
100
- }), g.setAttribute("data-waves-icon", m), g;
101
- }(f, n);
102
- return Promise.resolve(e);
103
- } catch (e) {
104
- return Promise.reject(e);
105
- }
106
- }).catch(console.error);
107
- });
108
- })(i).then(h).catch(console.error);
109
- }, [i]), (0, t.useEffect)(() => {
110
- A(p, `${l || ""}`, a);
111
- }, [l, a]), o().createElement("span", { ref: r });
112
- };
113
- })(), _;
114
- })());
115
- })(N);
116
- var L = N.exports;
117
- const R = /* @__PURE__ */ W(L), V = ({ handleOnClose: w, className: b }) => {
118
- const x = b != null ? O["dialog__close-icon "] + b : O["dialog__close-icon"];
119
- return /* @__PURE__ */ j(
120
- P,
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-CGVM5V_D.js";
4
+ import { B as a } from "../../Button-B1umG8kJ.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,
121
9
  {
122
- className: x,
10
+ className: l,
123
11
  "aria-description": "Close dialog",
124
- onClick: w,
12
+ onClick: i,
125
13
  "data-testid": "dialog-close-button",
126
- children: /* @__PURE__ */ j(R, { icon: "fa/duotone/circle-xmark", size: 32, color: "var(--gray-75)" })
14
+ children: /* @__PURE__ */ s(r, { icon: "circle-xmark", size: 32, color: "var(--gray-75)" })
127
15
  }
128
16
  );
129
17
  };
130
18
  export {
131
- V as default
19
+ d as default
132
20
  };
@@ -6,7 +6,7 @@ import { JSXElementConstructor, ReactElement, ReactNode } from 'react';
6
6
 
7
7
  export type CloseReason = 'backdropClick' | 'escapeKeyDown' | 'closeButtonClick';
8
8
  export interface DialogProps extends ModalProps {
9
- /** main children content */
9
+ /** main content */
10
10
  children: ReactElement<unknown, string | JSXElementConstructor<unknown>>;
11
11
  /** display title label */
12
12
  dialogTitle: ReactNode;
@@ -14,7 +14,8 @@ export interface DialogProps extends ModalProps {
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 };