@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.
- package/README.md +13 -2
- package/dist/{Button-D--uN90N.js → Button-B1umG8kJ.js} +3 -3
- package/dist/ClickAwayListener-BKznXF1d.js +106 -0
- package/dist/Dialog.module-CGVM5V_D.js +15 -0
- package/dist/Portal-BcdMtRGF.js +73 -0
- package/dist/{Tabs.module-BKlNuSPH.js → Tabs.module-BA-PC7fA.js} +13 -13
- package/dist/_commonjsHelpers-CT_km90n.js +30 -0
- package/dist/assets/Advice.css +1 -0
- package/dist/assets/Button.css +1 -1
- package/dist/assets/Checkbox.css +1 -0
- package/dist/assets/Dialog.css +1 -1
- package/dist/assets/IconButton.css +1 -1
- package/dist/assets/Input.css +1 -0
- package/dist/assets/Pagination.css +1 -1
- package/dist/assets/Skeleton.css +1 -0
- package/dist/assets/Snackbar.css +1 -0
- package/dist/assets/SortTooltip.css +1 -0
- package/dist/assets/Stepper.css +1 -0
- package/dist/assets/Table.css +1 -0
- package/dist/assets/Tabs.css +1 -1
- package/dist/assets/Toggle.css +1 -0
- package/dist/assets/Tooltip.css +1 -0
- package/dist/assets/Typography.css +1 -1
- package/dist/assets/{main.css → global.css} +1 -1
- package/dist/components/Advice/Advice.d.ts +16 -0
- package/dist/components/Advice/Advice.js +25 -0
- package/dist/components/Button/Button.d.ts +9 -1
- package/dist/components/Button/Button.js +54 -38
- package/dist/components/Button/Button.stories.d.ts +60 -0
- package/dist/components/Button/Button.stories.js +40 -0
- package/dist/components/Checkbox/Checkbox.d.ts +17 -0
- package/dist/components/Checkbox/Checkbox.js +48 -0
- package/dist/components/Dialog/Actions.js +1 -1
- package/dist/components/Dialog/Backdrop.d.ts +1 -1
- package/dist/components/Dialog/Backdrop.js +1 -1
- package/dist/components/Dialog/CloseIconButton.js +12 -124
- package/dist/components/Dialog/Dialog.d.ts +3 -2
- package/dist/components/Dialog/Dialog.js +418 -20072
- package/dist/components/Dialog/Dialog.stories.d.ts +343 -0
- package/dist/components/Dialog/Dialog.stories.js +59 -0
- package/dist/components/Dialog/Title.js +1 -1
- package/dist/components/Icon/Icon.d.ts +18 -0
- package/dist/components/Icon/Icon.js +95 -0
- package/dist/components/IconButton/IconButton.d.ts +3 -3
- package/dist/components/IconButton/IconButton.js +54 -65
- package/dist/components/Input/Input.d.ts +44 -0
- package/dist/components/Input/Input.js +497 -0
- package/dist/components/Input/Input.stories.d.ts +43 -0
- package/dist/components/Input/Input.stories.js +106 -0
- package/dist/components/LoadingSpinner/LoadingSpinner.d.ts +2 -0
- package/dist/components/LoadingSpinner/LoadingSpinner.stories.d.ts +14 -0
- package/dist/components/LoadingSpinner/LoadingSpinner.stories.js +38 -0
- package/dist/components/PageHeader/PageHeader.d.ts +25 -15
- package/dist/components/PageHeader/PageHeader.js +32 -50
- package/dist/components/PageHeader/PageHeader.stories.d.ts +43 -0
- package/dist/components/PageHeader/PageHeader.stories.js +49 -0
- package/dist/components/Pagination/Pagination.d.ts +1 -1
- package/dist/components/Pagination/Pagination.js +47 -47
- package/dist/components/Skeleton/Skeleton.d.ts +18 -0
- package/dist/components/Skeleton/Skeleton.js +26 -0
- package/dist/components/Snackbar/Snackbar.d.ts +13 -0
- package/dist/components/Snackbar/Snackbar.js +622 -0
- package/dist/components/SortTooltip/SortTooltip.d.ts +26 -0
- package/dist/components/SortTooltip/SortTooltip.js +67 -1
- package/dist/components/Stepper/Stepper.d.ts +16 -0
- package/dist/components/Stepper/Stepper.js +33 -0
- package/dist/components/Table/Table.d.ts +39 -0
- package/dist/components/Table/Table.js +122 -1
- package/dist/components/Table/TableContext.d.ts +19 -0
- package/dist/components/Table/TableContext.js +21 -1
- package/dist/components/Tabs/Tab.d.ts +1 -1
- package/dist/components/Tabs/Tab.js +5 -5
- package/dist/components/Tabs/TabPanel.d.ts +1 -1
- package/dist/components/Tabs/TabPanel.js +4 -4
- package/dist/components/Tabs/Tabs.d.ts +1 -1
- package/dist/components/Tabs/Tabs.js +3 -3
- package/dist/components/Toggle/Toggle.d.ts +14 -0
- package/dist/components/Toggle/Toggle.js +256 -0
- package/dist/components/Tooltip/Tooltip.d.ts +17 -0
- package/dist/components/Tooltip/Tooltip.js +1366 -1
- package/dist/components/Typography/Typography.d.ts +14 -5
- package/dist/components/Typography/Typography.js +76 -59
- package/dist/components/Typography/Typography.stories.d.ts +31 -0
- package/dist/components/Typography/Typography.stories.js +30 -0
- package/dist/components/Typography/typography.test.d.ts +1 -0
- package/dist/components/Typography/typography.test.js +11357 -0
- package/dist/index-BNWbc5Kh.js +19628 -0
- package/dist/{index-BvA1HyDs.js → index-CqjC7P5Y.js} +91 -95
- package/dist/magic-string.es-O_8lTkE3.js +738 -0
- package/dist/main.d.ts +16 -7
- package/dist/main.js +50 -28
- package/dist/objectWithoutPropertiesLoose-D7Cp0Pg_.js +26 -0
- package/dist/test-utils/assertStyles.d.ts +1 -0
- package/dist/test-utils/assertStyles.js +11 -0
- package/dist/types/helpers.d.ts +8 -0
- package/dist/useButton-Bc8IAgyk.js +106 -0
- package/dist/{useCompoundItem-wTwXbURC.js → useCompoundItem-CTYi5M_E.js} +1 -1
- package/dist/useIsFocusVisible-BH4IAdcw.js +69 -0
- package/dist/useTimeout-DxF9kiZL.js +36 -0
- package/dist/utils/styleStrings.d.ts +6 -0
- package/dist/utils/styleStrings.js +10 -0
- package/dist/utils/styleStrings.test.d.ts +1 -0
- package/dist/utils/styleStrings.test.js +41 -0
- package/dist/vi.Y_w82WR8-Df0JUamG.js +9860 -0
- package/package.json +30 -9
- package/dist/Dialog.module-BKWFakxu.js +0 -15
- package/dist/objectWithoutPropertiesLoose-ClNcje2_.js +0 -22
- package/dist/useButton-abQpo0za.js +0 -187
|
@@ -1,52 +1,68 @@
|
|
|
1
1
|
import '../../assets/Button.css';
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { c as
|
|
5
|
-
import { LoadingSpinner as
|
|
6
|
-
import { B as
|
|
7
|
-
const
|
|
8
|
-
h1:
|
|
9
|
-
"h1--bold": "_h1--
|
|
10
|
-
h2:
|
|
11
|
-
"h2--bold": "_h2--
|
|
12
|
-
h3:
|
|
13
|
-
"h3--bold": "_h3--
|
|
14
|
-
h4:
|
|
15
|
-
"h4--bold": "_h4--
|
|
16
|
-
body:
|
|
17
|
-
"body--large": "_body--
|
|
18
|
-
"body--medium": "_body--
|
|
19
|
-
"body--small": "_body--
|
|
20
|
-
"body--tiny": "_body--
|
|
21
|
-
"body--bold": "_body--
|
|
22
|
-
"body--strikethrough": "_body--
|
|
23
|
-
"body--underlined": "_body--
|
|
24
|
-
"body--strikethrough-underlined": "_body--strikethrough-
|
|
25
|
-
quote:
|
|
26
|
-
"quote--large": "_quote--
|
|
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--
|
|
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--
|
|
36
|
-
"button--
|
|
37
|
-
"button--
|
|
38
|
-
"
|
|
39
|
-
|
|
40
|
-
|
|
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
|
-
},
|
|
43
|
-
() =>
|
|
58
|
+
}, q = c(
|
|
59
|
+
() => y([r.button, r[`button--${_}`], t]),
|
|
44
60
|
[t, _]
|
|
45
61
|
);
|
|
46
|
-
return /* @__PURE__ */
|
|
47
|
-
/* @__PURE__ */
|
|
48
|
-
|
|
49
|
-
] }) :
|
|
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-
|
|
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
|
|
@@ -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-
|
|
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
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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:
|
|
10
|
+
className: l,
|
|
123
11
|
"aria-description": "Close dialog",
|
|
124
|
-
onClick:
|
|
12
|
+
onClick: i,
|
|
125
13
|
"data-testid": "dialog-close-button",
|
|
126
|
-
children: /* @__PURE__ */
|
|
14
|
+
children: /* @__PURE__ */ s(r, { icon: "circle-xmark", size: 32, color: "var(--gray-75)" })
|
|
127
15
|
}
|
|
128
16
|
);
|
|
129
17
|
};
|
|
130
18
|
export {
|
|
131
|
-
|
|
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
|
|
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
|
-
|
|
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 };
|