@pismo/marola 0.0.1-alpha.5 → 0.0.1-alpha.6
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-W6tM-_IT.js} +3 -3
- package/dist/Dialog.module-CGVM5V_D.js +15 -0
- package/dist/Portal-P3fPvS3-.js +19695 -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/Pagination.css +1 -1
- package/dist/assets/Skeleton.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/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 +13 -0
- package/dist/components/Advice/Advice.js +25 -0
- package/dist/components/Button/Button.d.ts +1 -1
- package/dist/components/Button/Button.js +54 -38
- 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.js +417 -20072
- package/dist/components/Dialog/Title.js +1 -1
- package/dist/components/Icon/Icon.d.ts +7 -0
- package/dist/components/Icon/Icon.js +9 -0
- package/dist/components/IconButton/IconButton.d.ts +3 -3
- package/dist/components/IconButton/IconButton.js +54 -65
- 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.js +38 -38
- package/dist/components/Skeleton/Skeleton.d.ts +18 -0
- package/dist/components/Skeleton/Skeleton.js +26 -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/Tooltip/Tooltip.d.ts +17 -0
- package/dist/components/Tooltip/Tooltip.js +1463 -1
- package/dist/components/Typography/Typography.d.ts +13 -4
- package/dist/components/Typography/Typography.js +76 -59
- package/dist/components/Typography/Typography.stories.d.ts +18 -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 +11360 -0
- package/dist/{index-BvA1HyDs.js → index-D2P7y2mE.js} +90 -95
- package/dist/magic-string.es-O_8lTkE3.js +738 -0
- package/dist/main.d.ts +1 -0
- package/dist/main.js +30 -28
- package/dist/objectWithoutPropertiesLoose-D7Cp0Pg_.js +26 -0
- package/dist/react-CGNQ6M5x.js +117 -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-abQpo0za.js → useButton-JpyBo5M4.js} +2 -2
- package/dist/{useCompoundItem-wTwXbURC.js → useCompoundItem-CTYi5M_E.js} +1 -1
- 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 +26 -6
- package/dist/Dialog.module-BKWFakxu.js +0 -15
- package/dist/objectWithoutPropertiesLoose-ClNcje2_.js +0 -22
|
@@ -3,20 +3,29 @@ import { ComponentType, ElementType, HTMLAttributes, ReactNode } from 'react';
|
|
|
3
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 */
|
|
6
7
|
children: ReactNode;
|
|
7
|
-
|
|
8
|
-
dataTestId?: string;
|
|
8
|
+
/** The HTML element to render as on the DOM */
|
|
9
9
|
element?: ElementType;
|
|
10
|
-
|
|
10
|
+
/** Additional props to pass down to native HTML element e.g. dataset attributes */
|
|
11
11
|
variant?: VariantType;
|
|
12
|
+
/** Space seperated list of CSS classes to apply */
|
|
13
|
+
className?: string;
|
|
14
|
+
/** Style to be visually displayed as */
|
|
12
15
|
underline?: boolean;
|
|
16
|
+
/** Whether to apply strikethrough text decoration */
|
|
13
17
|
strikethrough?: boolean;
|
|
18
|
+
/** Whether to set a higher 'bold' font weight */
|
|
14
19
|
bold?: boolean;
|
|
20
|
+
/** Whether to apply underline text decoration */
|
|
21
|
+
elementProps?: HTMLAttributes<CommonTypographyHTMLAttributes>;
|
|
22
|
+
/** ID that tests can use to get this component from the DOM */
|
|
23
|
+
['data-testid']?: string;
|
|
15
24
|
};
|
|
16
25
|
/**
|
|
17
26
|
* Typography component provide HTML 'element' field (default span) and override
|
|
18
27
|
* element specific styling with 'variant'. 'className' to provide additional
|
|
19
28
|
* styling. elementProps to provide additional HTML element attributes
|
|
20
29
|
*/
|
|
21
|
-
export declare const Typography: import('react').ForwardRefExoticComponent<TypographyProps & import(
|
|
30
|
+
export declare const Typography: import('react').ForwardRefExoticComponent<TypographyProps & import('react').RefAttributes<ElementType | ComponentType>>;
|
|
22
31
|
export default Typography;
|
|
@@ -1,64 +1,81 @@
|
|
|
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
|
-
"body--
|
|
17
|
-
"body--
|
|
18
|
-
"body--
|
|
19
|
-
"body--
|
|
20
|
-
"body--
|
|
21
|
-
"body--
|
|
22
|
-
"body--
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
2
|
+
import { jsx as f } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef as c, useMemo as y } from "react";
|
|
4
|
+
import { bemify as g, getBEMBase as k, getBEMBlock as q } from "../../utils/styleStrings.js";
|
|
5
|
+
import { c as B } from "../../clsx-DB4S2d7J.js";
|
|
6
|
+
const E = "_h1_13r5p_1", $ = "_h2_13r5p_11", w = "_h3_13r5p_21", M = "_h4_13r5p_31", v = "_body_13r5p_41", x = "_quote_13r5p_75", N = "_form__input_13r5p_98", T = "_form__hint_13r5p_103", j = "_form__label_13r5p_108", P = "_form__dropdown_13r5p_113", R = "_table__header_13r5p_131", S = "_table__body_13r5p_136", U = "_button_13r5p_159", _ = {
|
|
7
|
+
h1: E,
|
|
8
|
+
"h1--bold": "_h1--bold_13r5p_7",
|
|
9
|
+
h2: $,
|
|
10
|
+
"h2--bold": "_h2--bold_13r5p_17",
|
|
11
|
+
h3: w,
|
|
12
|
+
"h3--bold": "_h3--bold_13r5p_27",
|
|
13
|
+
h4: M,
|
|
14
|
+
"h4--bold": "_h4--bold_13r5p_37",
|
|
15
|
+
body: v,
|
|
16
|
+
"body--large": "_body--large_13r5p_46",
|
|
17
|
+
"body--medium": "_body--medium_13r5p_50",
|
|
18
|
+
"body--small": "_body--small_13r5p_54",
|
|
19
|
+
"body--tiny": "_body--tiny_13r5p_58",
|
|
20
|
+
"body--bold": "_body--bold_13r5p_62",
|
|
21
|
+
"body--strikethrough": "_body--strikethrough_13r5p_65",
|
|
22
|
+
"body--underlined": "_body--underlined_13r5p_68",
|
|
23
|
+
"body--strikethrough-underlined": "_body--strikethrough-underlined_13r5p_71",
|
|
24
|
+
quote: x,
|
|
25
|
+
"quote--large": "_quote--large_13r5p_80",
|
|
26
|
+
"quote--bold": "_quote--bold_13r5p_85",
|
|
27
|
+
"quote--strikethrough": "_quote--strikethrough_13r5p_88",
|
|
28
|
+
"quote--underlined": "_quote--underlined_13r5p_91",
|
|
29
|
+
"quote--strikethrough-underlined": "_quote--strikethrough-underlined_13r5p_94",
|
|
30
|
+
form__input: N,
|
|
31
|
+
form__hint: T,
|
|
32
|
+
form__label: j,
|
|
33
|
+
form__dropdown: P,
|
|
34
|
+
"form--bold": "_form--bold_13r5p_118",
|
|
35
|
+
"form--strikethrough": "_form--strikethrough_13r5p_121",
|
|
36
|
+
"form--underlined": "_form--underlined_13r5p_124",
|
|
37
|
+
"form--strikethrough-underlined": "_form--strikethrough-underlined_13r5p_127",
|
|
38
|
+
table__header: R,
|
|
39
|
+
table__body: S,
|
|
40
|
+
"table__body--secondary": "_table__body--secondary_13r5p_141",
|
|
41
|
+
"table--bold": "_table--bold_13r5p_146",
|
|
42
|
+
"table--strikethrough": "_table--strikethrough_13r5p_149",
|
|
43
|
+
"table--underlined": "_table--underlined_13r5p_152",
|
|
44
|
+
"table--strikethrough-underlined": "_table--strikethrough-underlined_13r5p_155",
|
|
45
|
+
button: U,
|
|
46
|
+
"button--bold": "_button--bold_13r5p_165",
|
|
47
|
+
"button--strikethrough": "_button--strikethrough_13r5p_168",
|
|
48
|
+
"button--underlined": "_button--underlined_13r5p_171",
|
|
49
|
+
"button--strikethrough-underlined": "_button--strikethrough-underlined_13r5p_174"
|
|
50
|
+
}, V = ["form", "table"], W = (e) => {
|
|
51
|
+
const r = e.toString();
|
|
52
|
+
let t = "body";
|
|
53
|
+
return r.match(/^h[1-4]/) ? t = r : r.match(/^h[5-6]/) && (t = "h4"), r === "th" && (t = "table-header"), r === "td" && (t = "table-body"), t;
|
|
54
|
+
}, F = c((e, r) => {
|
|
41
55
|
const {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
56
|
+
children: t,
|
|
57
|
+
className: b,
|
|
58
|
+
underline: l = !1,
|
|
59
|
+
element: h = "span",
|
|
60
|
+
bold: u = !1,
|
|
61
|
+
variant: i = W(h),
|
|
62
|
+
strikethrough: o = !1,
|
|
63
|
+
elementProps: a
|
|
64
|
+
} = e, p = h, m = y(() => {
|
|
65
|
+
const d = g(i, V), s = k(d), n = q(d);
|
|
66
|
+
return B(
|
|
67
|
+
_[s],
|
|
68
|
+
{ [_[`${d}`]]: d !== s },
|
|
69
|
+
b,
|
|
70
|
+
{ [_[`${n}--bold`]]: u },
|
|
71
|
+
{ [_[`${n}--underlined`]]: l },
|
|
72
|
+
{ [_[`${n}--strikethrough`]]: o },
|
|
73
|
+
{ [_[`${n}--strikethrough-underlined`]]: o && o && l }
|
|
74
|
+
);
|
|
75
|
+
}, [u, b, o, l, i]);
|
|
76
|
+
return /* @__PURE__ */ f(p, { ref: r, "data-testid": e["data-testid"], ...a ?? {}, className: m, children: t });
|
|
60
77
|
});
|
|
61
78
|
export {
|
|
62
|
-
|
|
63
|
-
|
|
79
|
+
F as Typography,
|
|
80
|
+
F as default
|
|
64
81
|
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: import('react').ForwardRefExoticComponent<import('./Typography').TypographyProps & import('react').RefAttributes<import('react').ElementType | import('react').ComponentType>>;
|
|
6
|
+
tags: string[];
|
|
7
|
+
argTypes: {
|
|
8
|
+
element: {
|
|
9
|
+
options: string[];
|
|
10
|
+
control: {
|
|
11
|
+
type: "select";
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export default meta;
|
|
17
|
+
type Story = StoryObj<typeof meta>;
|
|
18
|
+
export declare const Simple: Story;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import '../../assets/global.css';
|
|
2
|
+
/* empty css */
|
|
3
|
+
import "react/jsx-runtime";
|
|
4
|
+
import "../Dialog/Backdrop.js";
|
|
5
|
+
import "../../react-CGNQ6M5x.js";
|
|
6
|
+
import { Typography as t } from "./Typography.js";
|
|
7
|
+
import "react";
|
|
8
|
+
import "../Tabs/Tabs.js";
|
|
9
|
+
import "../Tabs/Tab.js";
|
|
10
|
+
import "../Tabs/TabPanel.js";
|
|
11
|
+
import "../Table/Table.js";
|
|
12
|
+
import "../Button/Button.js";
|
|
13
|
+
import "../IconButton/IconButton.js";
|
|
14
|
+
const y = {
|
|
15
|
+
title: "Components/Typography",
|
|
16
|
+
component: t,
|
|
17
|
+
tags: ["autodocs"],
|
|
18
|
+
argTypes: {
|
|
19
|
+
element: {
|
|
20
|
+
options: ["span", "p", "h1", "h2", "h3", "h4", "h5", "h6", "td", "th"],
|
|
21
|
+
control: { type: "select" }
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}, g = {
|
|
25
|
+
args: { children: "Example text" }
|
|
26
|
+
};
|
|
27
|
+
export {
|
|
28
|
+
g as Simple,
|
|
29
|
+
y as default
|
|
30
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|