@pismo/marola 0.0.1-alpha.19 → 0.0.1-alpha.2
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 +5 -17
- package/dist/Button-REznN-RP.js +1139 -0
- package/dist/Dialog.module-BO0mdB7d.js +15 -0
- package/dist/assets/CallToActionButton.css +1 -0
- package/dist/assets/Dialog.css +1 -1
- package/dist/assets/LoadingSpinner.css +1 -1
- package/dist/assets/Typography.css +1 -1
- package/dist/assets/main.css +1 -0
- package/dist/components/CallToActionButton/CallToActionButton.d.ts +23 -0
- package/dist/components/CallToActionButton/CallToActionButton.js +57 -0
- package/dist/components/Dialog/Actions.js +1 -1
- package/dist/components/Dialog/Backdrop.d.ts +1 -1
- package/dist/components/Dialog/Backdrop.js +9 -2
- package/dist/components/Dialog/CloseIconButton.js +10 -11
- package/dist/components/Dialog/Dialog.d.ts +4 -5
- package/dist/components/Dialog/Dialog.js +20103 -445
- package/dist/components/Dialog/Title.js +7 -22
- package/dist/components/LoadingSpinner/LoadingSpinner.d.ts +0 -2
- package/dist/components/LoadingSpinner/LoadingSpinner.js +13 -12
- package/dist/components/Typography/Typography.d.ts +6 -17
- package/dist/components/Typography/Typography.js +64 -85
- package/dist/main.d.ts +3 -25
- package/dist/main.js +15 -62
- package/dist/types/helpers.d.ts +7 -14
- package/package.json +9 -51
- package/src/playground/Playground.tsx +58 -0
- package/dist/Button-2b1peDFT.js +0 -130
- package/dist/ClickAwayListener-BSW-Nd-y.js +0 -107
- package/dist/Dialog.module-B8COssqi.js +0 -15
- package/dist/Popup-B6ZSGIEI.js +0 -1248
- package/dist/Portal-DIeBsWdL.js +0 -73
- package/dist/SelectButton-pciwIWcj.js +0 -46
- package/dist/Tabs.module-jkH1Qjn7.js +0 -22
- package/dist/assets/Advice.css +0 -1
- package/dist/assets/Button.css +0 -1
- package/dist/assets/Checkbox.css +0 -1
- package/dist/assets/Chip.css +0 -1
- package/dist/assets/IconButton.css +0 -1
- package/dist/assets/Input.css +0 -1
- package/dist/assets/InputSearch.css +0 -1
- package/dist/assets/PageHeader.css +0 -1
- package/dist/assets/Pagination.css +0 -1
- package/dist/assets/SelectButton.css +0 -1
- package/dist/assets/Skeleton.css +0 -1
- package/dist/assets/Snackbar.css +0 -1
- package/dist/assets/SortTooltip.css +0 -1
- package/dist/assets/Stepper.css +0 -1
- package/dist/assets/Table.css +0 -1
- package/dist/assets/Tabs.css +0 -1
- package/dist/assets/TextDisplay.css +0 -1
- package/dist/assets/Toggle.css +0 -1
- package/dist/assets/Tooltip.css +0 -1
- package/dist/combineHooksSlotProps-DVjg9PRh.js +0 -80
- package/dist/components/Advice/Advice.d.ts +0 -28
- package/dist/components/Advice/Advice.js +0 -25
- package/dist/components/Advice/Advice.stories.d.ts +0 -16
- package/dist/components/Button/Button.d.ts +0 -32
- package/dist/components/Button/Button.js +0 -94
- package/dist/components/Button/Button.stories.d.ts +0 -62
- package/dist/components/Checkbox/Checkbox.d.ts +0 -34
- package/dist/components/Checkbox/Checkbox.js +0 -56
- package/dist/components/Checkbox/Checkbox.stories.d.ts +0 -31
- package/dist/components/Chip/Chip.d.ts +0 -37
- package/dist/components/Chip/Chip.js +0 -143
- package/dist/components/Chip/Chip.stories.d.ts +0 -40
- package/dist/components/Chip/chip.test.d.ts +0 -1
- package/dist/components/Dialog/Dialog.stories.d.ts +0 -343
- package/dist/components/Icon/Icon.d.ts +0 -27
- package/dist/components/Icon/Icon.js +0 -116
- package/dist/components/Icon/Icon.stories.d.ts +0 -16
- package/dist/components/IconButton/Icon.stories.d.ts +0 -15
- package/dist/components/IconButton/IconButton.d.ts +0 -36
- package/dist/components/IconButton/IconButton.js +0 -70
- package/dist/components/Input/Input.d.ts +0 -44
- package/dist/components/Input/Input.js +0 -496
- package/dist/components/Input/Input.stories.d.ts +0 -43
- package/dist/components/InputSearch/InputSearch.d.ts +0 -9
- package/dist/components/InputSearch/InputSearch.js +0 -34
- package/dist/components/InputSearch/InputSearch.stories.d.ts +0 -39
- package/dist/components/LoadingSpinner/LoadingSpinner.stories.d.ts +0 -14
- package/dist/components/PageHeader/PageHeader.d.ts +0 -36
- package/dist/components/PageHeader/PageHeader.js +0 -51
- package/dist/components/PageHeader/PageHeader.stories.d.ts +0 -43
- package/dist/components/Pagination/Pagination.d.ts +0 -55
- package/dist/components/Pagination/Pagination.js +0 -222
- package/dist/components/Pagination/Pagination.stories.d.ts +0 -17
- package/dist/components/Select/Select.d.ts +0 -26
- package/dist/components/Select/Select.js +0 -857
- package/dist/components/Select/Select.stories.d.ts +0 -22
- package/dist/components/Select/SelectButton.d.ts +0 -12
- package/dist/components/Select/SelectButton.js +0 -8
- package/dist/components/Skeleton/Skeleton.d.ts +0 -25
- package/dist/components/Skeleton/Skeleton.js +0 -23
- package/dist/components/Skeleton/Skeleton.stories.d.ts +0 -14
- package/dist/components/Skeleton/SkeletonCircle.stories.d.ts +0 -14
- package/dist/components/Skeleton/SkeletonTable.stories.d.ts +0 -16
- package/dist/components/Snackbar/Snackbar.d.ts +0 -25
- package/dist/components/Snackbar/Snackbar.js +0 -622
- package/dist/components/Snackbar/Snackbar.stories.d.ts +0 -318
- package/dist/components/SortTooltip/SortTooltip.d.ts +0 -28
- package/dist/components/SortTooltip/SortTooltip.js +0 -78
- package/dist/components/Stepper/Stepper.d.ts +0 -26
- package/dist/components/Stepper/Stepper.js +0 -33
- package/dist/components/Stepper/Stepper.stories.d.ts +0 -16
- package/dist/components/Table/Table.d.ts +0 -39
- package/dist/components/Table/Table.js +0 -120
- package/dist/components/Table/TableContext.d.ts +0 -19
- package/dist/components/Table/TableContext.js +0 -21
- package/dist/components/Tabs/Tab.d.ts +0 -14
- package/dist/components/Tabs/Tab.js +0 -181
- package/dist/components/Tabs/Tab.stories.d.ts +0 -15
- package/dist/components/Tabs/TabPanel.d.ts +0 -12
- package/dist/components/Tabs/TabPanel.js +0 -118
- package/dist/components/Tabs/TabPanel.stories.d.ts +0 -14
- package/dist/components/Tabs/Tabs.d.ts +0 -15
- package/dist/components/Tabs/Tabs.js +0 -401
- package/dist/components/Tabs/Tabs.stories.d.ts +0 -14
- package/dist/components/TextDisplay/TextDisplay.d.ts +0 -23
- package/dist/components/TextDisplay/TextDisplay.js +0 -37
- package/dist/components/TextDisplay/TextDisplay.stories.d.ts +0 -13
- package/dist/components/TextDisplay/textDisplay.test.d.ts +0 -1
- package/dist/components/Toggle/Toggle.d.ts +0 -11
- package/dist/components/Toggle/Toggle.js +0 -251
- package/dist/components/Toggle/Toggle.stories.d.ts +0 -21
- package/dist/components/Tooltip/Tooltip.d.ts +0 -29
- package/dist/components/Tooltip/Tooltip.js +0 -139
- package/dist/components/Tooltip/Tooltip.stories.d.ts +0 -33
- package/dist/components/Typography/Typography.stories.d.ts +0 -32
- package/dist/components/Typography/typography.test.d.ts +0 -1
- package/dist/index-CH45lKw7.js +0 -840
- package/dist/index-CjW42-M-.js +0 -19584
- package/dist/marola.css +0 -1
- package/dist/test-utils/assertStyles.d.ts +0 -1
- package/dist/test-utils/assertStyles.js +0 -11
- package/dist/useButton-DNk3wrQp.js +0 -105
- package/dist/useCompoundItem-D1iRfg8D.js +0 -84
- package/dist/useControlled-CCMYYdCM.js +0 -31
- package/dist/useEnhancedEffect-CJGo-L3B.js +0 -5
- package/dist/useEventCallback-xTG9piMa.js +0 -45
- package/dist/useIsFocusVisible-BH4IAdcw.js +0 -69
- package/dist/useList-B0hog_3-.js +0 -436
- package/dist/useTimeout-DxF9kiZL.js +0 -36
- package/dist/utils/styleStrings.d.ts +0 -6
- package/dist/utils/styleStrings.js +0 -10
- package/dist/utils/styleStrings.test.d.ts +0 -1
|
@@ -1,28 +1,13 @@
|
|
|
1
1
|
import { jsxs as l, Fragment as s, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { s as r } from "../../Dialog.module-BO0mdB7d.js";
|
|
2
3
|
import { Typography as a } from "../Typography/Typography.js";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
element: "h1",
|
|
9
|
-
elementProps: { id: "alert-dialog-title" },
|
|
10
|
-
variant: "h4",
|
|
11
|
-
className: r.dialog__title,
|
|
12
|
-
children: i
|
|
13
|
-
}
|
|
14
|
-
),
|
|
4
|
+
const n = ({
|
|
5
|
+
title: i,
|
|
6
|
+
subTitle: t
|
|
7
|
+
}) => /* @__PURE__ */ l(s, { children: [
|
|
8
|
+
/* @__PURE__ */ e(a, { element: "h1", elementProps: { id: "alert-dialog-title" }, variant: "h4", className: r.dialog__title, children: i }),
|
|
15
9
|
/* @__PURE__ */ e("hr", { className: r.dialog__divider, "aria-hidden": !0 }),
|
|
16
|
-
t && /* @__PURE__ */ e(
|
|
17
|
-
a,
|
|
18
|
-
{
|
|
19
|
-
element: "h2",
|
|
20
|
-
elementProps: { id: "alert-dialog-description" },
|
|
21
|
-
variant: "h4",
|
|
22
|
-
className: r.dialog__subtitle,
|
|
23
|
-
children: t
|
|
24
|
-
}
|
|
25
|
-
)
|
|
10
|
+
t && /* @__PURE__ */ e(a, { element: "h2", elementProps: { id: "alert-dialog-description" }, variant: "h4", className: r.dialog__subtitle, children: t })
|
|
26
11
|
] });
|
|
27
12
|
export {
|
|
28
13
|
n as default
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
export interface LoadingSpinnerProps {
|
|
2
|
-
/** Whether to invert colours or not */
|
|
3
2
|
invert?: boolean;
|
|
4
|
-
/** Space separated list of CSS classes to apply */
|
|
5
3
|
classNames?: string;
|
|
6
4
|
}
|
|
7
5
|
export declare const LoadingSpinner: ({ invert, classNames }: LoadingSpinnerProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import '../../assets/LoadingSpinner.css';
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { useMemo as
|
|
2
|
+
import { jsxs as o, jsx as s } from "react/jsx-runtime";
|
|
3
|
+
import { useMemo as e } from "react";
|
|
4
4
|
import { c as t } from "../../clsx-DB4S2d7J.js";
|
|
5
5
|
const n = {
|
|
6
|
-
"ls-ring": "_ls-
|
|
7
|
-
"ls-ring--invert": "_ls-ring--
|
|
8
|
-
},
|
|
9
|
-
const l =
|
|
10
|
-
|
|
11
|
-
[
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
"ls-ring": "_ls-ring_19dsy_1",
|
|
7
|
+
"ls-ring--invert": "_ls-ring--invert_19dsy_34"
|
|
8
|
+
}, c = ({ invert: i = !1, classNames: r }) => {
|
|
9
|
+
const l = e(() => t(
|
|
10
|
+
[n["ls-ring"]],
|
|
11
|
+
{ [n["ls-ring--invert"]]: i },
|
|
12
|
+
r
|
|
13
|
+
), [r, i]);
|
|
14
|
+
return /* @__PURE__ */ o("div", { className: l, children: [
|
|
14
15
|
/* @__PURE__ */ s("div", {}),
|
|
15
16
|
/* @__PURE__ */ s("div", {}),
|
|
16
17
|
/* @__PURE__ */ s("div", {}),
|
|
@@ -18,6 +19,6 @@ const n = {
|
|
|
18
19
|
] });
|
|
19
20
|
};
|
|
20
21
|
export {
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
c as LoadingSpinner,
|
|
23
|
+
c as default
|
|
23
24
|
};
|
|
@@ -1,33 +1,22 @@
|
|
|
1
|
-
import { ComponentType, ElementType, HTMLAttributes,
|
|
1
|
+
import { ComponentType, ElementType, HTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
|
|
3
|
-
export type VariantType =
|
|
3
|
+
export type VariantType = "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "body-large" | "body-medium" | "body" | "body-small" | "body-tiny" | "quote-large" | "quote" | "form-input" | "form-label" | "form-hint" | "form-dropdown" | "table-header" | "table-body" | "table-body-secondary" | "button" | "link";
|
|
4
4
|
export type CommonTypographyHTMLAttributes = HTMLAttributes<HTMLParagraphElement> & HTMLAttributes<HTMLHeadingElement> & HTMLAttributes<HTMLSpanElement> & HTMLAttributes<HTMLTableCellElement>;
|
|
5
5
|
export type TypographyProps = {
|
|
6
|
-
/** Text or children to display */
|
|
7
6
|
children: ReactNode;
|
|
8
|
-
|
|
7
|
+
elementProps?: HTMLAttributes<CommonTypographyHTMLAttributes>;
|
|
8
|
+
dataTestId?: string;
|
|
9
9
|
element?: ElementType;
|
|
10
|
-
/** Style to be visually displayed as */
|
|
11
|
-
variant?: VariantType;
|
|
12
|
-
/** Space separated list of CSS classes to apply */
|
|
13
10
|
className?: string;
|
|
14
|
-
|
|
15
|
-
color?: string;
|
|
16
|
-
/** Whether to apply underline text decoration */
|
|
11
|
+
variant?: VariantType;
|
|
17
12
|
underline?: boolean;
|
|
18
|
-
/** Whether to apply strikethrough text decoration */
|
|
19
13
|
strikethrough?: boolean;
|
|
20
|
-
/** Whether to set a higher 'bold' font weight */
|
|
21
14
|
bold?: boolean;
|
|
22
|
-
/** Additional props to pass down to native HTML element e.g. dataset attributes */
|
|
23
|
-
elementProps?: HTMLAttributes<CommonTypographyHTMLAttributes> & LabelHTMLAttributes<HTMLLabelElement>;
|
|
24
|
-
/** ID that tests can use to get this component from the DOM */
|
|
25
|
-
['data-testid']?: string;
|
|
26
15
|
};
|
|
27
16
|
/**
|
|
28
17
|
* Typography component provide HTML 'element' field (default span) and override
|
|
29
18
|
* element specific styling with 'variant'. 'className' to provide additional
|
|
30
19
|
* styling. elementProps to provide additional HTML element attributes
|
|
31
20
|
*/
|
|
32
|
-
export declare const Typography: import('react').ForwardRefExoticComponent<TypographyProps & import(
|
|
21
|
+
export declare const Typography: import('react').ForwardRefExoticComponent<TypographyProps & import("react").RefAttributes<ElementType | ComponentType>>;
|
|
33
22
|
export default Typography;
|
|
@@ -1,94 +1,73 @@
|
|
|
1
1
|
import '../../assets/Typography.css';
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
h1:
|
|
8
|
-
|
|
9
|
-
h2:
|
|
10
|
-
|
|
11
|
-
h3:
|
|
12
|
-
|
|
13
|
-
h4:
|
|
14
|
-
|
|
15
|
-
body:
|
|
16
|
-
"body--
|
|
17
|
-
"body--
|
|
18
|
-
"body--
|
|
19
|
-
"body--
|
|
20
|
-
"body--
|
|
21
|
-
"body--
|
|
22
|
-
"body--underlined": "_body--
|
|
23
|
-
|
|
24
|
-
quote:
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
"
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
"table--bold": "_table--bold_1elsk_146",
|
|
42
|
-
"table--strikethrough": "_table--strikethrough_1elsk_149",
|
|
43
|
-
"table--underlined": "_table--underlined_1elsk_152",
|
|
44
|
-
"table--strikethrough-underlined": "_table--strikethrough-underlined_1elsk_155",
|
|
45
|
-
button: V,
|
|
46
|
-
"button--bold": "_button--bold_1elsk_165",
|
|
47
|
-
"button--strikethrough": "_button--strikethrough_1elsk_168",
|
|
48
|
-
"button--underlined": "_button--underlined_1elsk_171",
|
|
49
|
-
"button--strikethrough-underlined": "_button--strikethrough-underlined_1elsk_174",
|
|
50
|
-
SM: W,
|
|
51
|
-
"SM--bold": "_SM--bold_1elsk_183"
|
|
52
|
-
}, z = ["form", "table"], A = (o) => {
|
|
53
|
-
const e = o.toString();
|
|
54
|
-
let _ = "body";
|
|
55
|
-
return e.match(/^h[1-4]/) ? _ = e : e.match(/^h[5-6]/) && (_ = "h4"), e === "th" && (_ = "table-header"), e === "td" && (_ = "table-body"), _;
|
|
56
|
-
}, H = y((o, e) => {
|
|
2
|
+
import { jsx as y } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef as u, useMemo as c } from "react";
|
|
4
|
+
import { c as f } from "../../clsx-DB4S2d7J.js";
|
|
5
|
+
const p = "_h1_111i6_1", g = "_h2_111i6_11", k = "_h3_111i6_21", q = "_h4_111i6_31", T = "_body_111i6_41", w = "_quote_111i6_75", $ = "_form__input_111i6_86", x = "_form__hint_111i6_91", N = "_form__label_111i6_96", S = "_form__dropdown_111i6_101", v = "_table__header_111i6_107", E = "_table__body_111i6_112", V = "_button_111i6_123", r = {
|
|
6
|
+
h1: p,
|
|
7
|
+
"h1--bold": "_h1--bold_111i6_7",
|
|
8
|
+
h2: g,
|
|
9
|
+
"h2--bold": "_h2--bold_111i6_17",
|
|
10
|
+
h3: k,
|
|
11
|
+
"h3--bold": "_h3--bold_111i6_27",
|
|
12
|
+
h4: q,
|
|
13
|
+
"h4--bold": "_h4--bold_111i6_37",
|
|
14
|
+
body: T,
|
|
15
|
+
"body--large": "_body--large_111i6_46",
|
|
16
|
+
"body--medium": "_body--medium_111i6_50",
|
|
17
|
+
"body--small": "_body--small_111i6_54",
|
|
18
|
+
"body--tiny": "_body--tiny_111i6_58",
|
|
19
|
+
"body--bold": "_body--bold_111i6_62",
|
|
20
|
+
"body--strikethrough": "_body--strikethrough_111i6_65",
|
|
21
|
+
"body--underlined": "_body--underlined_111i6_68",
|
|
22
|
+
"body--strikethrough-underlined": "_body--strikethrough-underlined_111i6_71",
|
|
23
|
+
quote: w,
|
|
24
|
+
"quote--large": "_quote--large_111i6_80",
|
|
25
|
+
form__input: $,
|
|
26
|
+
form__hint: x,
|
|
27
|
+
form__label: N,
|
|
28
|
+
form__dropdown: S,
|
|
29
|
+
table__header: v,
|
|
30
|
+
table__body: E,
|
|
31
|
+
"table__body--secondary": "_table__body--secondary_111i6_117",
|
|
32
|
+
button: V
|
|
33
|
+
}, j = (t) => {
|
|
34
|
+
const _ = t.toString();
|
|
35
|
+
let o = "body";
|
|
36
|
+
return _.match(/^h[1-4]/) ? o = _ : _.match(/^h[5-6]/) && (o = "h4"), _ === "th" && (o = "table-header"), _ === "td" && (o = "table-body"), o;
|
|
37
|
+
}, I = (t) => {
|
|
38
|
+
let _ = t.replace(/form-/g, "form__");
|
|
39
|
+
return _ = _.replace(/table-/g, "table__"), _ = _.replace(new RegExp("(?<!-)-(?!-)", "g"), "--"), _;
|
|
40
|
+
}, U = u((t, _) => {
|
|
57
41
|
const {
|
|
58
|
-
|
|
42
|
+
dataTestId: o,
|
|
43
|
+
children: s,
|
|
59
44
|
className: n,
|
|
60
|
-
underline:
|
|
61
|
-
element:
|
|
62
|
-
bold:
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
{ [t[`${s}--strikethrough-underlined`]]: l && l && d }
|
|
77
|
-
);
|
|
78
|
-
}, [h, n, l, d, u]);
|
|
79
|
-
return /* @__PURE__ */ f(
|
|
80
|
-
m,
|
|
45
|
+
underline: l = !1,
|
|
46
|
+
element: i = "span",
|
|
47
|
+
bold: a = !1,
|
|
48
|
+
variant: e = j(i),
|
|
49
|
+
strikethrough: d = !1,
|
|
50
|
+
elementProps: b
|
|
51
|
+
} = t, h = i, m = c(() => f(
|
|
52
|
+
r[I(e)],
|
|
53
|
+
n,
|
|
54
|
+
{ [r[`${e}--bold`]]: a },
|
|
55
|
+
{ [r[`${e}--underlined`]]: l },
|
|
56
|
+
{ [r[`${e}--strikethrough`]]: d },
|
|
57
|
+
{ [r[`${e}--strikethrough-underlined`]]: d && d && l }
|
|
58
|
+
), [a, n, d, l, e]);
|
|
59
|
+
return /* @__PURE__ */ y(
|
|
60
|
+
h,
|
|
81
61
|
{
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
children: _
|
|
62
|
+
ref: _,
|
|
63
|
+
"data-testid": o,
|
|
64
|
+
...b != null && b,
|
|
65
|
+
className: m,
|
|
66
|
+
children: s
|
|
88
67
|
}
|
|
89
68
|
);
|
|
90
69
|
});
|
|
91
70
|
export {
|
|
92
|
-
|
|
93
|
-
|
|
71
|
+
U as Typography,
|
|
72
|
+
U as default
|
|
94
73
|
};
|
package/dist/main.d.ts
CHANGED
|
@@ -1,27 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
* This file is automatically generated. Any changes will be lost.
|
|
3
|
-
* run "yarn export-files" or "yarn build" to regenerate it.
|
|
4
|
-
*/
|
|
5
|
-
export * from './components/Advice/Advice';
|
|
6
|
-
export * from './components/Button/Button';
|
|
7
|
-
export * from './components/Checkbox/Checkbox';
|
|
8
|
-
export * from './components/Chip/Chip';
|
|
1
|
+
|
|
9
2
|
export * from './components/Dialog/Dialog';
|
|
10
|
-
export * from './components/Icon/Icon';
|
|
11
|
-
export * from './components/IconButton/IconButton';
|
|
12
|
-
export * from './components/Input/Input';
|
|
13
|
-
export * from './components/InputSearch/InputSearch';
|
|
14
|
-
export * from './components/LoadingSpinner/LoadingSpinner';
|
|
15
|
-
export * from './components/PageHeader/PageHeader';
|
|
16
|
-
export * from './components/Pagination/Pagination';
|
|
17
|
-
export * from './components/Select/Select';
|
|
18
|
-
export * from './components/Skeleton/Skeleton';
|
|
19
|
-
export * from './components/Snackbar/Snackbar';
|
|
20
|
-
export * from './components/SortTooltip/SortTooltip';
|
|
21
|
-
export * from './components/Stepper/Stepper';
|
|
22
|
-
export * from './components/Table/Table';
|
|
23
|
-
export * from './components/Tabs/Tabs';
|
|
24
|
-
export * from './components/TextDisplay/TextDisplay';
|
|
25
|
-
export * from './components/Toggle/Toggle';
|
|
26
|
-
export * from './components/Tooltip/Tooltip';
|
|
27
3
|
export * from './components/Typography/Typography';
|
|
4
|
+
export * from './components/LoadingSpinner/LoadingSpinner';
|
|
5
|
+
export * from './components/CallToActionButton/CallToActionButton';
|
package/dist/main.js
CHANGED
|
@@ -1,64 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { InputSearch as d } from "./components/InputSearch/InputSearch.js";
|
|
10
|
-
import { LoadingSpinner as D } from "./components/LoadingSpinner/LoadingSpinner.js";
|
|
11
|
-
import { PageHeader as h } from "./components/PageHeader/PageHeader.js";
|
|
12
|
-
import { Pagination as C, paginationDefaultTranslations as A } from "./components/Pagination/Pagination.js";
|
|
13
|
-
import { Select as B, SelectOption as v } from "./components/Select/Select.js";
|
|
14
|
-
import { Skeleton as H, SkeletonCircle as L, SkeletonTable as O } from "./components/Skeleton/Skeleton.js";
|
|
15
|
-
import { Snackbar as q } from "./components/Snackbar/Snackbar.js";
|
|
16
|
-
import { SortTooltip as z, sortTooltipDefaultTranslations as E } from "./components/SortTooltip/SortTooltip.js";
|
|
17
|
-
import { Stepper as J } from "./components/Stepper/Stepper.js";
|
|
18
|
-
import { Table as M } from "./components/Table/Table.js";
|
|
19
|
-
import { Tabs as Q } from "./components/Tabs/Tabs.js";
|
|
20
|
-
import { TextDisplay as U } from "./components/TextDisplay/TextDisplay.js";
|
|
21
|
-
import { Toggle as W } from "./components/Toggle/Toggle.js";
|
|
22
|
-
import { Tooltip as Y } from "./components/Tooltip/Tooltip.js";
|
|
23
|
-
import { Typography as _ } from "./components/Typography/Typography.js";
|
|
24
|
-
import { default as oo } from "./components/Dialog/Title.js";
|
|
25
|
-
import { default as eo } from "./components/Dialog/Content.js";
|
|
26
|
-
import { default as po } from "./components/Dialog/Actions.js";
|
|
27
|
-
import { Tab as fo } from "./components/Tabs/Tab.js";
|
|
28
|
-
import { TabPanel as mo } from "./components/Tabs/TabPanel.js";
|
|
1
|
+
import './assets/main.css';
|
|
2
|
+
import { Dialog as r } from "./components/Dialog/Dialog.js";
|
|
3
|
+
import { Typography as a } from "./components/Typography/Typography.js";
|
|
4
|
+
import { LoadingSpinner as p } from "./components/LoadingSpinner/LoadingSpinner.js";
|
|
5
|
+
import { CallToActionButton as n } from "./components/CallToActionButton/CallToActionButton.js";
|
|
6
|
+
import { default as m } from "./components/Dialog/Title.js";
|
|
7
|
+
import { default as d } from "./components/Dialog/Content.js";
|
|
8
|
+
import { default as s } from "./components/Dialog/Actions.js";
|
|
29
9
|
export {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
m as
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
oo as DialogTitle,
|
|
38
|
-
T as FamilyAndIcons,
|
|
39
|
-
s as Icon,
|
|
40
|
-
S as IconButton,
|
|
41
|
-
u as Input,
|
|
42
|
-
d as InputSearch,
|
|
43
|
-
D as LoadingSpinner,
|
|
44
|
-
h as PageHeader,
|
|
45
|
-
C as Pagination,
|
|
46
|
-
B as Select,
|
|
47
|
-
v as SelectOption,
|
|
48
|
-
H as Skeleton,
|
|
49
|
-
L as SkeletonCircle,
|
|
50
|
-
O as SkeletonTable,
|
|
51
|
-
q as Snackbar,
|
|
52
|
-
z as SortTooltip,
|
|
53
|
-
J as Stepper,
|
|
54
|
-
fo as Tab,
|
|
55
|
-
mo as TabPanel,
|
|
56
|
-
M as Table,
|
|
57
|
-
Q as Tabs,
|
|
58
|
-
U as TextDisplay,
|
|
59
|
-
W as Toggle,
|
|
60
|
-
Y as Tooltip,
|
|
61
|
-
_ as Typography,
|
|
62
|
-
A as paginationDefaultTranslations,
|
|
63
|
-
E as sortTooltipDefaultTranslations
|
|
10
|
+
s as Actions,
|
|
11
|
+
n as CallToActionButton,
|
|
12
|
+
d as Content,
|
|
13
|
+
r as Dialog,
|
|
14
|
+
m as DialogTitle,
|
|
15
|
+
p as LoadingSpinner,
|
|
16
|
+
a as Typography
|
|
64
17
|
};
|
package/dist/types/helpers.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
/// <reference types="vite-plugin-svgr/client" />
|
|
2
|
-
|
|
3
1
|
// Saves having to declare 'never' for every property that exists on the 'other' type
|
|
4
2
|
// Creates a new type that 'only' has properties in the first type and not in the second, if the property does not
|
|
5
3
|
// exist in the second type, it is given the value of 'never' so it can never be set
|
|
6
|
-
type Only<T, U> = { [P in keyof T]: T[P] } & Omit<
|
|
4
|
+
type Only<T, U> = { [P in keyof T]: T[P] } & Omit<
|
|
5
|
+
{ [P in keyof U]?: never },
|
|
6
|
+
keyof T
|
|
7
|
+
>;
|
|
7
8
|
|
|
8
9
|
// Usage MyNewType = Either<TypeA, TypeB>
|
|
9
10
|
// Creates a new type via union based on two types
|
|
@@ -14,14 +15,6 @@ export type Either<T, U> = Only<T, U> | Only<U, T>;
|
|
|
14
15
|
// note these arguments must be declared in MyType as optional '?'
|
|
15
16
|
type RequireAllOrNone<T, U extends keyof T = never> = (
|
|
16
17
|
| Required<Pick<T, U>> // Require all properties
|
|
17
|
-
| Partial<Record<U, never>>
|
|
18
|
-
) &
|
|
19
|
-
Omit<T, U>; // remaining keys not listed in U
|
|
20
|
-
|
|
21
|
-
// S = string, D = delimiter to split by. Then split S by D and return array of strings. "foo-bar-baz" = ["foo","bar","baz"]
|
|
22
|
-
// Fallback if no '-' return [s] which is an array of the input string e.g. foo = [foo]
|
|
23
|
-
type Split<S extends string, D extends string> = string extends S
|
|
24
|
-
? string[]
|
|
25
|
-
: S extends `${infer T}${D}${infer Rest}`
|
|
26
|
-
? [T, ...Split<Rest, D>]
|
|
27
|
-
: [S];
|
|
18
|
+
| Partial<Record<U, never>>
|
|
19
|
+
) & // Require none
|
|
20
|
+
Omit<T, U>; // remaining keys not listed in U
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pismo/marola",
|
|
3
3
|
"description": "CDX tribe component library",
|
|
4
|
-
"version": "0.0.1-alpha.
|
|
4
|
+
"version": "0.0.1-alpha.2",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/main.js",
|
|
7
7
|
"types": "dist/main.d.ts",
|
|
@@ -17,78 +17,36 @@
|
|
|
17
17
|
],
|
|
18
18
|
"scripts": {
|
|
19
19
|
"dev": "vite",
|
|
20
|
-
"
|
|
21
|
-
"lint
|
|
22
|
-
"lint:scss": "stylelint \"**/*.scss\" --fix",
|
|
23
|
-
"prettier": "prettier . --write",
|
|
20
|
+
"build": "tsc --p ./tsconfig-build.json && vite build",
|
|
21
|
+
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
|
24
22
|
"preview": "vite preview",
|
|
25
|
-
"prepublishOnly": "npm run build"
|
|
26
|
-
"test": "yarn test:unit",
|
|
27
|
-
"test:unit": "vitest run",
|
|
28
|
-
"test:unit:visual": "vitest-preview",
|
|
29
|
-
"test:unit:watch": "vitest",
|
|
30
|
-
"test:e2e": "echo \"no test implemented\"",
|
|
31
|
-
"coverage": "vitest run --coverage",
|
|
32
|
-
"export-files": "node scripts/export-files.cjs",
|
|
33
|
-
"prebuild": "yarn export-files",
|
|
34
|
-
"build": "tsc --p ./tsconfig-build.json && vite build && mv ./dist/assets/marola.css ./dist",
|
|
35
|
-
"postbuild": "storybook build --disable-telemetry --output-dir build",
|
|
36
|
-
"storybook": "storybook dev -p 6006"
|
|
23
|
+
"prepublishOnly": "npm run build"
|
|
37
24
|
},
|
|
38
25
|
"peerDependencies": {
|
|
39
26
|
"react": "^18.2.0",
|
|
40
27
|
"react-dom": "^18.2.0"
|
|
41
28
|
},
|
|
42
29
|
"devDependencies": {
|
|
43
|
-
"@ianvs/prettier-plugin-sort-imports": "^4.2.1",
|
|
44
|
-
"@storybook/addon-a11y": "^8.0.8",
|
|
45
|
-
"@storybook/addon-essentials": "^8.0.8",
|
|
46
|
-
"@storybook/addon-interactions": "^8.0.8",
|
|
47
|
-
"@storybook/addon-links": "^8.0.8",
|
|
48
|
-
"@storybook/addon-onboarding": "^8.0.8",
|
|
49
|
-
"@storybook/blocks": "^8.0.8",
|
|
50
|
-
"@storybook/react": "^8.0.8",
|
|
51
|
-
"@storybook/react-vite": "^8.0.8",
|
|
52
|
-
"@storybook/test": "^8.0.8",
|
|
53
|
-
"@testing-library/react": "^15.0.5",
|
|
54
30
|
"@types/node": "^20.12.2",
|
|
55
31
|
"@types/react": "^18.2.66",
|
|
56
32
|
"@types/react-dom": "^18.2.22",
|
|
57
|
-
"@typescript-eslint/eslint-plugin": "^7.
|
|
58
|
-
"@typescript-eslint/parser": "^7.
|
|
33
|
+
"@typescript-eslint/eslint-plugin": "^7.2.0",
|
|
34
|
+
"@typescript-eslint/parser": "^7.2.0",
|
|
59
35
|
"@vitejs/plugin-react": "^4.2.1",
|
|
60
36
|
"clsx": "^2.1.0",
|
|
61
|
-
"commitlint": "^19.2.1",
|
|
62
|
-
"cypress": "^13.8.1",
|
|
63
37
|
"eslint": "^8.57.0",
|
|
64
|
-
"eslint-config-prettier": "^9.1.0",
|
|
65
|
-
"eslint-plugin-prettier": "^5.1.3",
|
|
66
38
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
67
39
|
"eslint-plugin-react-refresh": "^0.4.6",
|
|
68
|
-
"
|
|
69
|
-
"eslint-plugin-storybook": "^0.8.0",
|
|
70
|
-
"glob": "^10.3.14",
|
|
71
|
-
"husky": "^9.0.11",
|
|
72
|
-
"jsdom": "^24.0.0",
|
|
73
|
-
"prettier": "^3.2.5",
|
|
40
|
+
"glob": "^10.3.12",
|
|
74
41
|
"react": "^18.2.0",
|
|
75
42
|
"react-dom": "^18.2.0",
|
|
76
43
|
"sass": "^1.72.0",
|
|
77
|
-
"storybook": "^8.0.8",
|
|
78
|
-
"stylelint": "^16.3.1",
|
|
79
|
-
"stylelint-config-recess-order": "^5.0.0",
|
|
80
|
-
"stylelint-config-standard-scss": "^13.1.0",
|
|
81
|
-
"stylelint-prettier": "^5.0.0",
|
|
82
44
|
"typescript": "^5.2.2",
|
|
83
45
|
"vite": "^5.2.0",
|
|
84
46
|
"vite-plugin-dts": "^3.8.1",
|
|
85
|
-
"vite-plugin-lib-inject-css": "^2.0.1"
|
|
86
|
-
"vite-plugin-svgr": "^4.2.0",
|
|
87
|
-
"vitest": "^1.4.0",
|
|
88
|
-
"vitest-preview": "^0.0.1"
|
|
47
|
+
"vite-plugin-lib-inject-css": "^2.0.1"
|
|
89
48
|
},
|
|
90
49
|
"dependencies": {
|
|
91
|
-
"@mui/base": "^5.0.0-beta.40"
|
|
92
|
-
"@mui/material": "^5.15.15"
|
|
50
|
+
"@mui/base": "^5.0.0-beta.40"
|
|
93
51
|
}
|
|
94
52
|
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import {CallToActionButton, LoadingSpinner, Typography} from '../../lib/main';
|
|
2
|
+
|
|
3
|
+
import DialogExample from "./DialogExample.tsx";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* A playground that can be used to test and build components. Run `yarn dev` to launch this page
|
|
7
|
+
*/
|
|
8
|
+
const Playground = () => {
|
|
9
|
+
return <>
|
|
10
|
+
<DialogExample/>
|
|
11
|
+
<CallToActionButton variation="primary">Test Button</CallToActionButton>
|
|
12
|
+
<CallToActionButton variation="secondary">Test Button secondary</CallToActionButton>
|
|
13
|
+
<CallToActionButton variation="primary" isLoading>Test Button loading</CallToActionButton>
|
|
14
|
+
<CallToActionButton variation="secondary" isLoading>Test Button loading secondary</CallToActionButton>
|
|
15
|
+
<CallToActionButton variation="primary" disabled>Test Button disabled</CallToActionButton>
|
|
16
|
+
<CallToActionButton variation="secondary" disabled>Test Button disabled secondary</CallToActionButton>
|
|
17
|
+
<Typography element="p">abc</Typography>
|
|
18
|
+
<Typography element="h1" variant="form-hint">abc</Typography>
|
|
19
|
+
<Typography>regular</Typography>
|
|
20
|
+
{/*<Typography className={styles["test-red"]}>regular extra classes</Typography>*/}
|
|
21
|
+
<Typography variant="body" element="p">body explicit (element p) </Typography>
|
|
22
|
+
<Typography variant="body-large">body large </Typography>
|
|
23
|
+
<Typography variant="body-medium">body medium </Typography>
|
|
24
|
+
<Typography variant="body-small">body small </Typography>
|
|
25
|
+
<Typography variant="body-tiny">body tiny </Typography>
|
|
26
|
+
<Typography element="h1">h1</Typography>
|
|
27
|
+
<Typography element="h2">h2</Typography>
|
|
28
|
+
<Typography element="h3">h3</Typography>
|
|
29
|
+
<Typography element="h4">h4</Typography>
|
|
30
|
+
<Typography element="h5">h5 uses h4 style</Typography>
|
|
31
|
+
<Typography element="h6">h6 uses h4 style</Typography>
|
|
32
|
+
<Typography element="h1" variant="h4">h1 with h4 style</Typography>
|
|
33
|
+
<Typography element="h2" variant="h4">h2 with h4 style</Typography>
|
|
34
|
+
<Typography element="h3" variant="h4">h3 with h4 style</Typography>
|
|
35
|
+
<Typography variant="quote"> quote</Typography>
|
|
36
|
+
<Typography variant="quote-large"> large quote</Typography>
|
|
37
|
+
<Typography bold> bold</Typography>
|
|
38
|
+
<Typography strikethrough> strikethrough</Typography>
|
|
39
|
+
<Typography underline> underlined</Typography>
|
|
40
|
+
<Typography element="p" underline strikethrough>strikethrough and underlined paragraph</Typography>
|
|
41
|
+
<Typography variant="form-hint"> form-hint</Typography>
|
|
42
|
+
<Typography variant="form-label"> form-label</Typography>
|
|
43
|
+
<Typography variant="form-dropdown"> form-dropdown</Typography>
|
|
44
|
+
<Typography variant="form-input"> form-input</Typography>
|
|
45
|
+
<Typography variant="table-header"> default element table header explicit variant</Typography>
|
|
46
|
+
<Typography variant="table-body"> default element table body explicit variant</Typography>
|
|
47
|
+
<Typography variant="table-body-secondary"> default element but table body secondary explicit
|
|
48
|
+
variant</Typography>
|
|
49
|
+
<Typography element="th"> th </Typography>
|
|
50
|
+
<Typography element="td"> td</Typography>
|
|
51
|
+
<Typography element="li"> list item</Typography>
|
|
52
|
+
<Typography variant="button"> button</Typography>
|
|
53
|
+
<LoadingSpinner/>
|
|
54
|
+
<LoadingSpinner invert/>
|
|
55
|
+
</>;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export default Playground;
|