@pismo/marola 0.0.1-alpha.31 → 0.0.1-alpha.4
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-2b1peDFT.js → Button-C3Qm852g.js} +23 -23
- package/dist/Dialog.module-BO0mdB7d.js +15 -0
- package/dist/ListContext-D6-YwtZn.js +18 -0
- package/dist/Tabs.module-_kSbSyth.js +66 -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/Tabs.css +1 -1
- package/dist/assets/Typography.css +1 -1
- package/dist/assets/main.css +1 -0
- package/dist/components/CallToActionButton/CallToActionButton.d.ts +21 -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 +124 -12
- package/dist/components/Dialog/Dialog.d.ts +5 -6
- package/dist/components/Dialog/Dialog.js +20103 -445
- package/dist/components/Dialog/{DialogTitle.d.ts → Title.d.ts} +3 -3
- package/dist/components/Dialog/Title.js +14 -0
- package/dist/components/LoadingSpinner/LoadingSpinner.d.ts +0 -2
- package/dist/components/LoadingSpinner/LoadingSpinner.js +13 -12
- package/dist/components/Tabs/Tab.d.ts +1 -6
- package/dist/components/Tabs/Tab.js +173 -118
- package/dist/components/Tabs/TabPanel.d.ts +1 -5
- package/dist/components/Tabs/TabPanel.js +10 -8
- package/dist/components/Tabs/Tabs.d.ts +2 -8
- package/dist/components/Tabs/Tabs.js +701 -250
- package/dist/components/Typography/Typography.d.ts +6 -17
- package/dist/components/Typography/Typography.js +64 -55
- package/dist/{index-CH45lKw7.js → index-BZ1lkM_M.js} +159 -162
- package/dist/main.d.ts +5 -27
- package/dist/main.js +21 -76
- package/dist/types/helpers.d.ts +7 -14
- package/dist/useButton-CbmjmH5z.js +186 -0
- package/dist/useCompoundItem-B7wfGDHQ.js +41 -0
- package/package.json +10 -51
- package/src/playground/Playground.tsx +20 -0
- package/dist/ClickAwayListener-BSW-Nd-y.js +0 -107
- package/dist/Dialog.module-DFEmFdYT.js +0 -30
- package/dist/Group-B3p31ftp.js +0 -26
- package/dist/Popup-B6ZSGIEI.js +0 -1248
- package/dist/Portal-DIeBsWdL.js +0 -73
- package/dist/SelectButton-C8JQKaf4.js +0 -61
- package/dist/Tabs.module-jkH1Qjn7.js +0 -22
- package/dist/Toggle-BXcLAMNy.js +0 -142
- package/dist/assets/Advice.css +0 -1
- package/dist/assets/Button.css +0 -1
- package/dist/assets/Checkbox.css +0 -1
- package/dist/assets/EllipsisTooltip.css +0 -1
- package/dist/assets/Group.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/TextDisplay.css +0 -1
- package/dist/assets/Toggle.css +0 -1
- package/dist/assets/Toggle2.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 -30
- package/dist/components/Advice/Advice.js +0 -48
- package/dist/components/Advice/Advice.stories.d.ts +0 -18
- package/dist/components/Button/Button.d.ts +0 -32
- package/dist/components/Button/Button.js +0 -65
- 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 -71
- package/dist/components/Checkbox/Checkbox.stories.d.ts +0 -31
- package/dist/components/Chip/Chip.d.ts +0 -39
- package/dist/components/Chip/Chip.js +0 -19
- package/dist/components/Chip/Chip.stories.d.ts +0 -42
- package/dist/components/Chip/chip.test.d.ts +0 -1
- package/dist/components/Dialog/Dialog.stories.d.ts +0 -343
- package/dist/components/Dialog/DialogTitle.js +0 -29
- package/dist/components/EllipsisTooltip/EllipsisTooltip.d.ts +0 -7
- package/dist/components/EllipsisTooltip/EllipsisTooltip.js +0 -23
- package/dist/components/EllipsisTooltip/EllipsisTooltip.stories.d.ts +0 -31
- package/dist/components/Icon/Icon.d.ts +0 -27
- package/dist/components/Icon/Icon.js +0 -136
- 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 -38
- package/dist/components/IconButton/IconButton.js +0 -63
- package/dist/components/Input/Input.d.ts +0 -44
- package/dist/components/Input/Input.js +0 -508
- 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 -66
- package/dist/components/PageHeader/PageHeader.js +0 -87
- package/dist/components/PageHeader/PageHeader.stories.d.ts +0 -14
- package/dist/components/Pagination/Pagination.d.ts +0 -55
- package/dist/components/Pagination/Pagination.js +0 -237
- 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 -27
- package/dist/components/Snackbar/Snackbar.js +0 -639
- package/dist/components/Snackbar/Snackbar.stories.d.ts +0 -319
- package/dist/components/SortTooltip/SortTooltip.d.ts +0 -28
- package/dist/components/SortTooltip/SortTooltip.js +0 -93
- package/dist/components/Stepper/Stepper.d.ts +0 -26
- package/dist/components/Stepper/Stepper.js +0 -48
- package/dist/components/Stepper/Stepper.stories.d.ts +0 -16
- package/dist/components/Table/Table.d.ts +0 -56
- package/dist/components/Table/Table.js +0 -137
- package/dist/components/Table/Table.stories.d.ts +0 -29
- package/dist/components/Table/TableContext.d.ts +0 -19
- package/dist/components/Table/TableContext.js +0 -21
- package/dist/components/Table/_Table.TBody.stories.d.ts +0 -14
- package/dist/components/Table/_Table.THead.stories.d.ts +0 -14
- package/dist/components/Table/_Table.Td.stories.d.ts +0 -16
- package/dist/components/Table/_Table.Th.stories.d.ts +0 -15
- package/dist/components/Table/_Table.Tr.stories.d.ts +0 -15
- package/dist/components/Tabs/Tab.stories.d.ts +0 -15
- package/dist/components/Tabs/TabPanel.stories.d.ts +0 -14
- 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 -266
- package/dist/components/Toggle/Toggle.stories.d.ts +0 -21
- package/dist/components/ToggleGroup/Group.d.ts +0 -18
- package/dist/components/ToggleGroup/Group.js +0 -7
- package/dist/components/ToggleGroup/Group.test.d.ts +0 -1
- package/dist/components/ToggleGroup/Toggle.d.ts +0 -15
- package/dist/components/ToggleGroup/Toggle.js +0 -16
- package/dist/components/ToggleGroup/Toggle.test.d.ts +0 -1
- package/dist/components/ToggleGroup/ToggleGroup.d.ts +0 -2
- package/dist/components/ToggleGroup/ToggleGroup.js +0 -6
- package/dist/components/ToggleGroup/ToggleGroup.stories.d.ts +0 -25
- package/dist/components/Tooltip/Tooltip.d.ts +0 -33
- package/dist/components/Tooltip/Tooltip.js +0 -141
- package/dist/components/Tooltip/Tooltip.stories.d.ts +0 -35
- package/dist/components/Typography/Typography.stories.d.ts +0 -32
- package/dist/components/Typography/typography.test.d.ts +0 -1
- package/dist/contexts/SnackbarProvider/SnackbarProvider.d.ts +0 -11
- package/dist/contexts/SnackbarProvider/SnackbarProvider.js +0 -50
- package/dist/contexts/SnackbarProvider/SnackbarProvider.stories.d.ts +0 -21
- 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/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,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,64 +1,73 @@
|
|
|
1
1
|
import '../../assets/Typography.css';
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
"
|
|
8
|
-
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
"
|
|
14
|
-
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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", $ = "_quote_111i6_75", w = "_form__input_111i6_86", S = "_form__hint_111i6_91", x = "_form__label_111i6_96", N = "_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: $,
|
|
24
|
+
"quote--large": "_quote--large_111i6_80",
|
|
25
|
+
form__input: w,
|
|
26
|
+
form__hint: S,
|
|
27
|
+
form__label: x,
|
|
28
|
+
form__dropdown: N,
|
|
29
|
+
table__header: v,
|
|
30
|
+
table__body: E,
|
|
31
|
+
"table__body--secondary": "_table__body--secondary_111i6_117",
|
|
32
|
+
button: V
|
|
33
|
+
}, j = (e) => {
|
|
34
|
+
const _ = e.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
|
+
}, z = (e) => {
|
|
38
|
+
let _ = e.replace(/^([a-z]*)-/, "$1__");
|
|
39
|
+
return _ = _.replace(new RegExp("(?<!-)-(?!-)", "g"), "--"), console.log("styleString", _), _;
|
|
40
|
+
}, R = u((e, _) => {
|
|
27
41
|
const {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
variant:
|
|
35
|
-
strikethrough:
|
|
36
|
-
elementProps:
|
|
37
|
-
} = e,
|
|
38
|
-
|
|
39
|
-
return B(
|
|
40
|
-
t[g],
|
|
41
|
-
{ [t[`${o}`]]: o !== g },
|
|
42
|
-
s,
|
|
43
|
-
{ [t[`${p}--bold`]]: i },
|
|
44
|
-
{ [t[`${p}--underlined`]]: y },
|
|
45
|
-
{ [t[`${p}--strikethrough`]]: h },
|
|
46
|
-
{ [t[`${p}--strikethrough-underlined`]]: h && h && y }
|
|
47
|
-
);
|
|
48
|
-
}, [i, s, h, y, _]);
|
|
49
|
-
return /* @__PURE__ */ b(
|
|
42
|
+
dataTestId: o,
|
|
43
|
+
children: b,
|
|
44
|
+
className: l,
|
|
45
|
+
underline: n = !1,
|
|
46
|
+
element: i = "span",
|
|
47
|
+
bold: a = !1,
|
|
48
|
+
variant: t = j(i),
|
|
49
|
+
strikethrough: d = !1,
|
|
50
|
+
elementProps: s
|
|
51
|
+
} = e, h = i, m = c(() => f(
|
|
52
|
+
r[z(t)],
|
|
50
53
|
l,
|
|
54
|
+
{ [r[`${t}--bold`]]: a },
|
|
55
|
+
{ [r[`${t}--underlined`]]: n },
|
|
56
|
+
{ [r[`${t}--strikethrough`]]: d },
|
|
57
|
+
{ [r[`${t}--strikethrough-underlined`]]: d && d && n }
|
|
58
|
+
), [a, l, d, n, t]);
|
|
59
|
+
return /* @__PURE__ */ y(
|
|
60
|
+
h,
|
|
51
61
|
{
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
children: r
|
|
62
|
+
ref: _,
|
|
63
|
+
"data-testid": o,
|
|
64
|
+
...s != null && s,
|
|
65
|
+
className: m,
|
|
66
|
+
children: b
|
|
58
67
|
}
|
|
59
68
|
);
|
|
60
69
|
});
|
|
61
70
|
export {
|
|
62
|
-
|
|
63
|
-
|
|
71
|
+
R as Typography,
|
|
72
|
+
R as default
|
|
64
73
|
};
|