@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,33 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { useState as r } from "react";
|
|
3
|
+
import { Toggle as c } from "./Toggle.js";
|
|
4
|
+
const l = {
|
|
5
|
+
title: "Components/Toggle",
|
|
6
|
+
component: c,
|
|
7
|
+
tags: ["autodocs"],
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: "padded"
|
|
10
|
+
}
|
|
11
|
+
}, h = {
|
|
12
|
+
render: () => {
|
|
13
|
+
const [e, t] = r(!1);
|
|
14
|
+
return /* @__PURE__ */ o(c, { checked: e, onChange: (a) => t(a.target.checked) });
|
|
15
|
+
}
|
|
16
|
+
}, m = {
|
|
17
|
+
name: "With label",
|
|
18
|
+
render: () => {
|
|
19
|
+
const [e, t] = r(!1);
|
|
20
|
+
return /* @__PURE__ */ o(c, { label: "Active", checked: e, onChange: (a) => t(a.target.checked) });
|
|
21
|
+
}
|
|
22
|
+
}, g = {
|
|
23
|
+
render: () => {
|
|
24
|
+
const [e, t] = r(!1);
|
|
25
|
+
return /* @__PURE__ */ o(c, { label: "Active", disabled: !0, checked: e, onChange: (a) => t(a.target.checked) });
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
export {
|
|
29
|
+
g as Disabled,
|
|
30
|
+
h as Simple,
|
|
31
|
+
m as WithLabel,
|
|
32
|
+
l as default
|
|
33
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { PopupPlacement } from '@mui/base';
|
|
2
|
+
|
|
3
|
+
type TooltipProps = {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
show?: boolean;
|
|
6
|
+
anchorRef?: HTMLElement | null | undefined;
|
|
7
|
+
disableHoverListener?: boolean;
|
|
8
|
+
onClose?: () => void;
|
|
9
|
+
theme?: 'white' | 'black';
|
|
10
|
+
padding?: 'small' | 'normal';
|
|
11
|
+
position?: PopupPlacement;
|
|
12
|
+
arialRole?: React.AriaRole;
|
|
13
|
+
className?: string;
|
|
14
|
+
'data-testid'?: string;
|
|
15
|
+
};
|
|
16
|
+
declare const Tooltip: ({ children, show, anchorRef, onClose, arialRole, position, theme, padding, className, disableHoverListener, ...rest }: TooltipProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export { Tooltip };
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import '../../assets/Tooltip.css';
|
|
2
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
3
|
+
import * as d from "react";
|
|
4
|
+
import { useRef as k, useState as E, useEffect as w } from "react";
|
|
5
|
+
import { T as v, P } from "../../Popup-DFJQc_jn.js";
|
|
6
|
+
import { _ as S, a as q } from "../../objectWithoutPropertiesLoose-D7Cp0Pg_.js";
|
|
7
|
+
import { P as l } from "../../index-CqjC7P5Y.js";
|
|
8
|
+
import { c as M } from "../../clsx-DB4S2d7J.js";
|
|
9
|
+
import { C as O } from "../../ClickAwayListener-HI1G6ob9.js";
|
|
10
|
+
function $() {
|
|
11
|
+
const n = d.useContext(v);
|
|
12
|
+
if (!n)
|
|
13
|
+
throw new Error("Missing transition context");
|
|
14
|
+
const {
|
|
15
|
+
registerTransition: i,
|
|
16
|
+
requestedEnter: t,
|
|
17
|
+
onExited: o
|
|
18
|
+
} = n;
|
|
19
|
+
return d.useEffect(() => i(), [i]), {
|
|
20
|
+
onExited: o,
|
|
21
|
+
requestedEnter: t
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
const z = ["children", "className", "enterAnimationName", "enterClassName", "exitAnimationName", "exitClassName"];
|
|
25
|
+
function A(n) {
|
|
26
|
+
const {
|
|
27
|
+
children: i,
|
|
28
|
+
className: t,
|
|
29
|
+
enterAnimationName: o,
|
|
30
|
+
enterClassName: f,
|
|
31
|
+
exitAnimationName: p,
|
|
32
|
+
exitClassName: x
|
|
33
|
+
} = n, h = S(n, z), {
|
|
34
|
+
requestedEnter: c,
|
|
35
|
+
onExited: s
|
|
36
|
+
} = $(), m = d.useRef(!0);
|
|
37
|
+
d.useEffect(() => {
|
|
38
|
+
c && m.current && (m.current = !1);
|
|
39
|
+
}, [c]);
|
|
40
|
+
const e = d.useCallback((u) => {
|
|
41
|
+
u.animationName === p ? (s(), m.current = !0) : u.animationName === o && (m.current = !1);
|
|
42
|
+
}, [s, p, o]);
|
|
43
|
+
return /* @__PURE__ */ a("div", q({
|
|
44
|
+
onAnimationEnd: e,
|
|
45
|
+
className: M(t, c ? f : x)
|
|
46
|
+
}, h, {
|
|
47
|
+
children: i
|
|
48
|
+
}));
|
|
49
|
+
}
|
|
50
|
+
process.env.NODE_ENV !== "production" && (A.propTypes = {
|
|
51
|
+
children: l.node,
|
|
52
|
+
className: l.string,
|
|
53
|
+
enterAnimationName: l.string,
|
|
54
|
+
enterClassName: l.string,
|
|
55
|
+
exitAnimationName: l.string,
|
|
56
|
+
exitClassName: l.string
|
|
57
|
+
});
|
|
58
|
+
const D = "_tooltip_1dujm_1", r = {
|
|
59
|
+
tooltip: D,
|
|
60
|
+
"tooltip--small-padding": "_tooltip--small-padding_1dujm_5",
|
|
61
|
+
"tooltip--normal-padding": "_tooltip--normal-padding_1dujm_8",
|
|
62
|
+
"tooltip--white-theme": "_tooltip--white-theme_1dujm_11",
|
|
63
|
+
"tooltip--black-theme": "_tooltip--black-theme_1dujm_15",
|
|
64
|
+
"tooltip--animation": "_tooltip--animation_1dujm_20",
|
|
65
|
+
"tooltip--anim-open": "_tooltip--anim-open_1dujm_20",
|
|
66
|
+
"tooltip--open-animation": "_tooltip--open-animation_1dujm_1",
|
|
67
|
+
"tooltip--anim-close": "_tooltip--anim-close_1dujm_23",
|
|
68
|
+
"tooltip--close-animation": "_tooltip--close-animation_1dujm_1"
|
|
69
|
+
}, K = ({
|
|
70
|
+
children: n,
|
|
71
|
+
show: i,
|
|
72
|
+
anchorRef: t,
|
|
73
|
+
onClose: o,
|
|
74
|
+
arialRole: f,
|
|
75
|
+
position: p = "bottom",
|
|
76
|
+
theme: x = "black",
|
|
77
|
+
padding: h = "small",
|
|
78
|
+
className: c,
|
|
79
|
+
disableHoverListener: s,
|
|
80
|
+
...m
|
|
81
|
+
}) => {
|
|
82
|
+
const e = k(null), [u, g] = E(i || !1), [C, j] = E(t || null);
|
|
83
|
+
w(() => {
|
|
84
|
+
var _;
|
|
85
|
+
if (!t && (e != null && e.current)) {
|
|
86
|
+
const N = (_ = e == null ? void 0 : e.current) == null ? void 0 : _.parentElement;
|
|
87
|
+
N && (s || (N.onpointerenter = () => g(!0), N.onpointerleave = () => g(!1)), j(N));
|
|
88
|
+
}
|
|
89
|
+
}, [e, s, t]);
|
|
90
|
+
const y = (_) => {
|
|
91
|
+
t != null && t.contains(_.target) || (o == null || o(), !s && g(!1));
|
|
92
|
+
}, T = {
|
|
93
|
+
padding: p.match(/(bottom|top)/) ? ".25rem 0" : "0 .25rem",
|
|
94
|
+
zIndex: 1
|
|
95
|
+
}, b = [
|
|
96
|
+
r.tooltip,
|
|
97
|
+
r[`tooltip--${x}-theme`],
|
|
98
|
+
r[`tooltip--${h}-padding`],
|
|
99
|
+
c || ""
|
|
100
|
+
].join(" ").trim();
|
|
101
|
+
return /* @__PURE__ */ a("span", { ref: e, children: /* @__PURE__ */ a(
|
|
102
|
+
P,
|
|
103
|
+
{
|
|
104
|
+
...m,
|
|
105
|
+
open: i || u,
|
|
106
|
+
anchor: C,
|
|
107
|
+
disablePortal: !0,
|
|
108
|
+
style: T,
|
|
109
|
+
role: f,
|
|
110
|
+
placement: p,
|
|
111
|
+
children: /* @__PURE__ */ a(
|
|
112
|
+
A,
|
|
113
|
+
{
|
|
114
|
+
className: r["tooltip--animation"],
|
|
115
|
+
enterClassName: r["tooltip--anim-open"],
|
|
116
|
+
exitClassName: r["tooltip--anim-close"],
|
|
117
|
+
enterAnimationName: "tooltip--open-animation",
|
|
118
|
+
exitAnimationName: "tooltip--close-animation",
|
|
119
|
+
children: /* @__PURE__ */ a("div", { className: b, children: /* @__PURE__ */ a(O, { onClickAway: y, children: /* @__PURE__ */ a("div", { children: n }) }) })
|
|
120
|
+
}
|
|
121
|
+
)
|
|
122
|
+
}
|
|
123
|
+
) });
|
|
124
|
+
};
|
|
125
|
+
export {
|
|
126
|
+
K as Tooltip
|
|
127
|
+
};
|
|
@@ -1,22 +1,31 @@
|
|
|
1
|
-
import { ComponentType, ElementType, HTMLAttributes, ReactNode } from 'react';
|
|
1
|
+
import { ComponentType, ElementType, HTMLAttributes, LabelHTMLAttributes, 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 */
|
|
6
7
|
children: ReactNode;
|
|
7
|
-
|
|
8
|
-
dataTestId?: string;
|
|
8
|
+
/** The HTML element to render as on the DOM */
|
|
9
9
|
element?: ElementType;
|
|
10
|
-
|
|
10
|
+
/** Style to be visually displayed as */
|
|
11
11
|
variant?: VariantType;
|
|
12
|
+
/** Space seperated list of CSS classes to apply */
|
|
13
|
+
className?: string;
|
|
14
|
+
/** Whether to apply underline text decoration */
|
|
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
|
+
/** Additional props to pass down to native HTML element e.g. dataset attributes */
|
|
21
|
+
elementProps?: HTMLAttributes<CommonTypographyHTMLAttributes> & LabelHTMLAttributes<HTMLLabelElement>;
|
|
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,73 +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
|
-
className: n,
|
|
56
|
+
children: t,
|
|
57
|
+
className: b,
|
|
45
58
|
underline: l = !1,
|
|
46
|
-
element:
|
|
47
|
-
bold:
|
|
48
|
-
variant:
|
|
49
|
-
strikethrough:
|
|
50
|
-
elementProps:
|
|
51
|
-
} =
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
...b != null && b,
|
|
65
|
-
className: m,
|
|
66
|
-
children: s
|
|
67
|
-
}
|
|
68
|
-
);
|
|
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 });
|
|
69
77
|
});
|
|
70
78
|
export {
|
|
71
|
-
|
|
72
|
-
|
|
79
|
+
F as Typography,
|
|
80
|
+
F as default
|
|
73
81
|
};
|
|
@@ -0,0 +1,31 @@
|
|
|
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
|
+
decorators: ((Story: import('@storybook/types').PartialStoryFn<import('@storybook/react').ReactRenderer, {
|
|
16
|
+
children: import('react').ReactNode;
|
|
17
|
+
element?: import('react').ElementType | undefined;
|
|
18
|
+
variant?: import('./Typography').VariantType | undefined;
|
|
19
|
+
className?: string | undefined;
|
|
20
|
+
underline?: boolean | undefined;
|
|
21
|
+
strikethrough?: boolean | undefined;
|
|
22
|
+
bold?: boolean | undefined;
|
|
23
|
+
elementProps?: (import('react').HTMLAttributes<import('./Typography').CommonTypographyHTMLAttributes> & import('react').LabelHTMLAttributes<HTMLLabelElement>) | undefined;
|
|
24
|
+
"data-testid"?: string | undefined;
|
|
25
|
+
ref?: import('react').LegacyRef<import('react').ElementType | import('react').ComponentType> | undefined;
|
|
26
|
+
key?: import('react').Key | null | undefined;
|
|
27
|
+
}>) => import("react/jsx-runtime").JSX.Element)[];
|
|
28
|
+
};
|
|
29
|
+
export default meta;
|
|
30
|
+
type Story = StoryObj<typeof meta>;
|
|
31
|
+
export declare const Simple: Story;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import '../../assets/global.css';
|
|
2
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
+
/* empty css */
|
|
4
|
+
import "../Button/Button.js";
|
|
5
|
+
import "react";
|
|
6
|
+
import "../Dialog/Backdrop.js";
|
|
7
|
+
import { Typography as p } from "./Typography.js";
|
|
8
|
+
import "../IconButton/IconButton.js";
|
|
9
|
+
import "../Select/Select.js";
|
|
10
|
+
import "../Table/Table.js";
|
|
11
|
+
import "../Tabs/Tabs.js";
|
|
12
|
+
const d = {
|
|
13
|
+
title: "Components/Typography",
|
|
14
|
+
component: p,
|
|
15
|
+
tags: ["autodocs"],
|
|
16
|
+
argTypes: {
|
|
17
|
+
element: {
|
|
18
|
+
options: ["span", "p", "h1", "h2", "h3", "h4", "h5", "h6", "td", "th"],
|
|
19
|
+
control: { type: "select" }
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
decorators: [
|
|
23
|
+
(o) => /* @__PURE__ */ t("div", { style: { margin: "1em" }, children: /* @__PURE__ */ t(o, {}) })
|
|
24
|
+
]
|
|
25
|
+
}, y = {
|
|
26
|
+
args: { children: "Example text" }
|
|
27
|
+
};
|
|
28
|
+
export {
|
|
29
|
+
y as Simple,
|
|
30
|
+
d as default
|
|
31
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|