@pismo/marola 0.0.1-alpha.1 → 0.0.1-alpha.12
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 +17 -5
- package/dist/Button-B1umG8kJ.js +131 -0
- package/dist/ClickAwayListener-HI1G6ob9.js +107 -0
- package/dist/Dialog.module-CGVM5V_D.js +15 -0
- package/dist/Popup-DFJQc_jn.js +1249 -0
- package/dist/Portal-D__zvwbZ.js +73 -0
- package/dist/SelectButton-DWtqAiwt.js +45 -0
- package/dist/Tabs.module-jkH1Qjn7.js +22 -0
- package/dist/_commonjsHelpers-CT_km90n.js +30 -0
- package/dist/assets/Advice.css +1 -0
- package/dist/assets/Button.css +1 -0
- package/dist/assets/Checkbox.css +1 -0
- package/dist/assets/Dialog.css +1 -1
- package/dist/assets/IconButton.css +1 -0
- package/dist/assets/Input.css +1 -0
- package/dist/assets/InputSearch.css +1 -0
- package/dist/assets/LoadingSpinner.css +1 -1
- package/dist/assets/PageHeader.css +1 -0
- package/dist/assets/Pagination.css +1 -0
- package/dist/assets/SelectButton.css +1 -0
- 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 -0
- package/dist/assets/Toggle.css +1 -0
- package/dist/assets/Tooltip.css +1 -0
- package/dist/assets/Typography.css +1 -1
- package/dist/assets/global.css +1 -0
- package/dist/combineHooksSlotProps-BHqhiBfc.js +81 -0
- package/dist/components/Advice/Advice.d.ts +16 -0
- package/dist/components/Advice/Advice.js +25 -0
- package/dist/components/Button/Button.d.ts +29 -0
- package/dist/components/Button/Button.js +70 -0
- package/dist/components/Button/Button.stories.d.ts +60 -0
- package/dist/components/Button/Button.stories.js +41 -0
- package/dist/components/Checkbox/Checkbox.d.ts +19 -0
- package/dist/components/Checkbox/Checkbox.js +56 -0
- package/dist/components/Dialog/Actions.js +1 -1
- package/dist/components/Dialog/Backdrop.d.ts +1 -1
- package/dist/components/Dialog/Backdrop.js +2 -9
- package/dist/components/Dialog/CloseIconButton.js +11 -10
- package/dist/components/Dialog/Dialog.d.ts +5 -4
- package/dist/components/Dialog/Dialog.js +420 -20077
- package/dist/components/Dialog/Dialog.stories.d.ts +343 -0
- package/dist/components/Dialog/Dialog.stories.js +60 -0
- package/dist/components/Dialog/Title.js +22 -7
- package/dist/components/Icon/Icon.d.ts +18 -0
- package/dist/components/Icon/Icon.js +95 -0
- package/dist/components/IconButton/IconButton.d.ts +22 -0
- package/dist/components/IconButton/IconButton.js +68 -0
- 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/InputSearch/InputSearch.d.ts +11 -0
- package/dist/components/InputSearch/InputSearch.js +29 -0
- package/dist/components/InputSearch/InputSearch.stories.d.ts +22 -0
- package/dist/components/InputSearch/InputSearch.stories.js +36 -0
- package/dist/components/LoadingSpinner/LoadingSpinner.d.ts +2 -0
- package/dist/components/LoadingSpinner/LoadingSpinner.js +12 -13
- package/dist/components/LoadingSpinner/LoadingSpinner.stories.d.ts +14 -0
- package/dist/components/LoadingSpinner/LoadingSpinner.stories.js +39 -0
- package/dist/components/PageHeader/PageHeader.d.ts +36 -0
- package/dist/components/PageHeader/PageHeader.js +51 -0
- 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 +36 -0
- package/dist/components/Pagination/Pagination.js +219 -0
- package/dist/components/Select/Select.d.ts +25 -0
- package/dist/components/Select/Select.js +860 -0
- package/dist/components/Select/Select.stories.d.ts +31 -0
- package/dist/components/Select/Select.stories.js +66 -0
- package/dist/components/Select/SelectButton.d.ts +13 -0
- package/dist/components/Select/SelectButton.js +8 -0
- 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 +623 -0
- package/dist/components/SortTooltip/SortTooltip.d.ts +26 -0
- package/dist/components/SortTooltip/SortTooltip.js +67 -0
- 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 -0
- package/dist/components/Table/TableContext.d.ts +19 -0
- package/dist/components/Table/TableContext.js +21 -0
- package/dist/components/Tabs/Tab.d.ts +9 -0
- package/dist/components/Tabs/Tab.js +182 -0
- package/dist/components/Tabs/TabPanel.d.ts +8 -0
- package/dist/components/Tabs/TabPanel.js +119 -0
- package/dist/components/Tabs/Tabs.d.ts +11 -0
- package/dist/components/Tabs/Tabs.js +402 -0
- package/dist/components/Toggle/Toggle.d.ts +11 -0
- package/dist/components/Toggle/Toggle.js +252 -0
- package/dist/components/Toggle/Toggle.stories.d.ts +21 -0
- package/dist/components/Toggle/Toggle.stories.js +33 -0
- package/dist/components/Tooltip/Tooltip.d.ts +17 -0
- package/dist/components/Tooltip/Tooltip.js +127 -0
- package/dist/components/Typography/Typography.d.ts +15 -6
- package/dist/components/Typography/Typography.js +75 -67
- package/dist/components/Typography/Typography.stories.d.ts +31 -0
- package/dist/components/Typography/Typography.stories.js +31 -0
- package/dist/components/Typography/typography.test.d.ts +1 -0
- package/dist/components/Typography/typography.test.js +11358 -0
- package/dist/index-BJ8HbRCy.js +19585 -0
- package/dist/index-CqjC7P5Y.js +814 -0
- package/dist/magic-string.es-O_8lTkE3.js +738 -0
- package/dist/main.d.ts +19 -2
- package/dist/main.js +60 -15
- 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 +14 -7
- package/dist/useButton-Bc8IAgyk.js +106 -0
- package/dist/useCompoundItem-D1iRfg8D.js +84 -0
- package/dist/useControlled-CCMYYdCM.js +31 -0
- package/dist/useEnhancedEffect-CJGo-L3B.js +5 -0
- package/dist/useEventCallback-vAfOD-oT.js +45 -0
- package/dist/useIsFocusVisible-BH4IAdcw.js +69 -0
- package/dist/useList-ByMguSS_.js +437 -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 +53 -10
- package/dist/Button-REznN-RP.js +0 -1139
- package/dist/Dialog.module-BO0mdB7d.js +0 -15
- package/dist/assets/CallToActionButton.css +0 -1
- package/dist/assets/main.css +0 -1
- package/dist/components/CallToActionButton/CallToActionButton.d.ts +0 -23
- package/dist/components/CallToActionButton/CallToActionButton.js +0 -57
- package/src/playground/Playground.tsx +0 -58
|
@@ -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,41 @@
|
|
|
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 "../Select/Select.js";
|
|
10
|
+
import "../Table/Table.js";
|
|
11
|
+
import "../Tabs/Tabs.js";
|
|
12
|
+
const k = {
|
|
13
|
+
title: "Components/Button",
|
|
14
|
+
component: i,
|
|
15
|
+
tags: ["autodocs"],
|
|
16
|
+
decorators: [
|
|
17
|
+
(o) => /* @__PURE__ */ t("div", { style: { padding: "1em" }, children: /* @__PURE__ */ t(o, {}) })
|
|
18
|
+
],
|
|
19
|
+
argTypes: {
|
|
20
|
+
onClick: {
|
|
21
|
+
if: { arg: "link", exists: !1 }
|
|
22
|
+
},
|
|
23
|
+
type: {
|
|
24
|
+
control: { type: "text" },
|
|
25
|
+
if: { arg: "onClick", exists: !0 }
|
|
26
|
+
},
|
|
27
|
+
link: {
|
|
28
|
+
control: { type: "text" },
|
|
29
|
+
if: { arg: "onClick", exists: !1 }
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}, f = {
|
|
33
|
+
args: { children: "Button", onClick: () => alert("Button was clicked!") }
|
|
34
|
+
}, g = {
|
|
35
|
+
args: { children: "Button", link: "https://marola.pismolabs.io" }
|
|
36
|
+
};
|
|
37
|
+
export {
|
|
38
|
+
g as Link,
|
|
39
|
+
f as Simple,
|
|
40
|
+
k as default
|
|
41
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
checked?: boolean;
|
|
12
|
+
isIndeterminate?: boolean;
|
|
13
|
+
name?: string;
|
|
14
|
+
onChange: (checked: boolean) => void;
|
|
15
|
+
children?: ReactNode;
|
|
16
|
+
highlightLabel?: boolean;
|
|
17
|
+
};
|
|
18
|
+
declare const Checkbox: ({ className, label, name, theme, size, checked, onChange, isIndeterminate, highlightLabel, ...rest }: CheckboxProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export { Checkbox };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import '../../assets/Checkbox.css';
|
|
2
|
+
import { jsxs as N, jsx as h } from "react/jsx-runtime";
|
|
3
|
+
import * as k from "react";
|
|
4
|
+
import { useState as g, useEffect as w } from "react";
|
|
5
|
+
import { c as i } from "../../clsx-DB4S2d7J.js";
|
|
6
|
+
const y = (a) => /* @__PURE__ */ k.createElement("svg", { width: 14, height: 10, viewBox: "0 0 14 10", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...a }, /* @__PURE__ */ k.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_1aw5t_10", E = "_checkmark_1aw5t_20", e = {
|
|
7
|
+
"checkbox-wrapper": "_checkbox-wrapper_1aw5t_1",
|
|
8
|
+
label: z,
|
|
9
|
+
"label--highlighted": "_label--highlighted_1aw5t_14",
|
|
10
|
+
"label--highlighted-checked": "_label--highlighted-checked_1aw5t_17",
|
|
11
|
+
checkmark: E,
|
|
12
|
+
"checkmark--checked": "_checkmark--checked_1aw5t_32",
|
|
13
|
+
"checkmark--light-theme": "_checkmark--light-theme_1aw5t_35",
|
|
14
|
+
"checkmark--accent-theme": "_checkmark--accent-theme_1aw5t_42",
|
|
15
|
+
"checkmark--small-size": "_checkmark--small-size_1aw5t_49",
|
|
16
|
+
"checkmark--normal-size": "_checkmark--normal-size_1aw5t_56"
|
|
17
|
+
}, F = (a) => /* @__PURE__ */ k.createElement("svg", { width: 10, height: 3, viewBox: "0 0 10 3", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...a }, /* @__PURE__ */ k.createElement("rect", { y: 0.5, width: 10, height: 2, rx: 1, fill: "#1897F3" })), M = ({
|
|
18
|
+
className: a,
|
|
19
|
+
label: o,
|
|
20
|
+
name: d,
|
|
21
|
+
theme: b = "accent",
|
|
22
|
+
size: p = "normal",
|
|
23
|
+
checked: l,
|
|
24
|
+
onChange: x,
|
|
25
|
+
isIndeterminate: r,
|
|
26
|
+
highlightLabel: C = !1,
|
|
27
|
+
...s
|
|
28
|
+
}) => {
|
|
29
|
+
const [c, n] = g(l), [t, _] = g(r);
|
|
30
|
+
w(() => {
|
|
31
|
+
l !== c && n(l);
|
|
32
|
+
}, [l]), w(() => {
|
|
33
|
+
typeof r == "boolean" && _(r);
|
|
34
|
+
}, [r]);
|
|
35
|
+
const f = i(e["checkbox-wrapper"], a), v = i(
|
|
36
|
+
e.checkmark,
|
|
37
|
+
e[`checkmark--${b}-theme`],
|
|
38
|
+
e[`checkmark--${p}-size`],
|
|
39
|
+
(c || t) && e["checkmark--checked"]
|
|
40
|
+
), u = C && (s.children || o) ? i(
|
|
41
|
+
e.label,
|
|
42
|
+
e["label--highlighted"],
|
|
43
|
+
(c || t) && e["label--highlighted-checked"]
|
|
44
|
+
) : e.label;
|
|
45
|
+
return /* @__PURE__ */ N("div", { className: f, onClick: () => {
|
|
46
|
+
let m = !c;
|
|
47
|
+
t && (_(!1), m = !0), x(m), n(m);
|
|
48
|
+
}, ...s, children: [
|
|
49
|
+
/* @__PURE__ */ h("input", { name: d, type: "checkbox", checked: !t && c, readOnly: !0 }),
|
|
50
|
+
/* @__PURE__ */ h("span", { className: v, children: t ? /* @__PURE__ */ h(F, {}) : c && /* @__PURE__ */ h(y, {}) }),
|
|
51
|
+
/* @__PURE__ */ h("label", { className: u, children: s.children || o })
|
|
52
|
+
] });
|
|
53
|
+
};
|
|
54
|
+
export {
|
|
55
|
+
M as Checkbox
|
|
56
|
+
};
|
|
@@ -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,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-
|
|
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
|
-
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
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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,
|
|
8
9
|
{
|
|
9
|
-
className:
|
|
10
|
+
className: l,
|
|
10
11
|
"aria-description": "Close dialog",
|
|
11
|
-
onClick:
|
|
12
|
+
onClick: i,
|
|
12
13
|
"data-testid": "dialog-close-button",
|
|
13
|
-
children: /* @__PURE__ */
|
|
14
|
+
children: /* @__PURE__ */ s(r, { icon: "circle-xmark", size: 32, color: "var(--gray-75)" })
|
|
14
15
|
}
|
|
15
16
|
);
|
|
16
17
|
};
|
|
@@ -4,17 +4,18 @@ 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 =
|
|
7
|
+
export type CloseReason = 'backdropClick' | 'escapeKeyDown' | 'closeButtonClick';
|
|
8
8
|
export interface DialogProps extends ModalProps {
|
|
9
|
-
/** main
|
|
10
|
-
children: ReactElement<
|
|
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
|
-
|
|
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 };
|