@pismo/marola 0.0.1-alpha.12 → 0.0.1-alpha.13
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 +1 -1
- package/dist/assets/Button.css +1 -1
- package/dist/assets/Chip.css +1 -0
- package/dist/assets/IconButton.css +1 -1
- package/dist/assets/Input.css +1 -1
- package/dist/assets/InputSearch.css +1 -1
- package/dist/assets/Typography.css +1 -1
- package/dist/components/Button/Button.d.ts +5 -2
- package/dist/components/Button/Button.js +87 -63
- package/dist/components/Button/Button.stories.d.ts +2 -0
- package/dist/components/Button/Button.stories.js +1 -2
- package/dist/components/Chip/Chip.d.ts +37 -0
- package/dist/components/Chip/Chip.js +143 -0
- package/dist/components/Chip/Chip.stories.d.ts +40 -0
- package/dist/components/Chip/Chip.stories.js +59 -0
- package/dist/components/Chip/chip.test.d.ts +1 -0
- package/dist/components/Chip/chip.test.js +17303 -0
- package/dist/components/Dialog/Dialog.stories.d.ts +3 -3
- package/dist/components/Dialog/Dialog.stories.js +1 -2
- package/dist/components/Icon/Icon.d.ts +1 -1
- package/dist/components/Icon/Icon.js +27 -20
- package/dist/components/IconButton/IconButton.d.ts +2 -2
- package/dist/components/IconButton/IconButton.js +63 -61
- package/dist/components/Input/Input.d.ts +1 -1
- package/dist/components/Input/Input.js +32 -32
- package/dist/components/InputSearch/InputSearch.d.ts +7 -9
- package/dist/components/InputSearch/InputSearch.js +31 -26
- package/dist/components/InputSearch/InputSearch.stories.d.ts +21 -4
- package/dist/components/InputSearch/InputSearch.stories.js +55 -18
- package/dist/components/LoadingSpinner/LoadingSpinner.d.ts +1 -1
- package/dist/components/LoadingSpinner/LoadingSpinner.stories.js +1 -2
- package/dist/components/Select/Select.stories.js +1 -2
- package/dist/components/Typography/Typography.d.ts +1 -1
- package/dist/components/Typography/Typography.js +76 -74
- package/dist/components/Typography/Typography.stories.js +1 -2
- package/dist/components/Typography/typography.test.js +195 -11319
- package/dist/main.d.ts +1 -0
- package/dist/main.js +57 -57
- package/dist/react.esm-DGd9_oKA.js +11126 -0
- package/dist/utils/styleStrings.test.js +1 -1
- package/dist/{vi.Y_w82WR8-Df0JUamG.js → vi.Y_w82WR8-XVYrIxgm.js} +2 -1
- package/package.json +1 -1
- package/dist/assets/global.css +0 -1
|
@@ -2,12 +2,28 @@ import { StoryObj } from '@storybook/react';
|
|
|
2
2
|
|
|
3
3
|
declare const meta: {
|
|
4
4
|
title: string;
|
|
5
|
-
component: ({
|
|
5
|
+
component: ({ classNameWrapper, triggerDelay, value, onChange, ...rest }: {
|
|
6
|
+
triggerDelay?: number | undefined;
|
|
7
|
+
} & import('react').InputHTMLAttributes<HTMLInputElement> & {
|
|
6
8
|
label?: string | undefined;
|
|
7
|
-
|
|
9
|
+
infoMessage?: string | undefined;
|
|
10
|
+
errorMessage?: string | undefined;
|
|
11
|
+
leftIcon?: import('react').ReactNode;
|
|
12
|
+
rightIcon?: import('react').ReactNode;
|
|
13
|
+
type?: "search" | "text" | "password" | undefined;
|
|
14
|
+
hideCharsCounter?: boolean | undefined;
|
|
8
15
|
classNameWrapper?: string | undefined;
|
|
9
|
-
|
|
10
|
-
|
|
16
|
+
classNameLabel?: string | undefined;
|
|
17
|
+
classNameInput?: string | undefined;
|
|
18
|
+
classNameInfoMessage?: string | undefined;
|
|
19
|
+
classNameErrorMessage?: string | undefined;
|
|
20
|
+
classNameCharsCounter?: string | undefined;
|
|
21
|
+
'data-testid-wrapper'?: string | undefined;
|
|
22
|
+
'data-testid-label'?: string | undefined;
|
|
23
|
+
'data-testid-input'?: string | undefined;
|
|
24
|
+
'data-testid-infoMessage'?: string | undefined;
|
|
25
|
+
'data-testid-errorMessage'?: string | undefined;
|
|
26
|
+
'data-testid-charsCounter'?: string | undefined;
|
|
11
27
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
12
28
|
tags: string[];
|
|
13
29
|
parameters: {
|
|
@@ -18,5 +34,6 @@ export default meta;
|
|
|
18
34
|
type Story = StoryObj<typeof meta>;
|
|
19
35
|
export declare const Simple: Story;
|
|
20
36
|
export declare const WithLabel: Story;
|
|
37
|
+
export declare const WithCustomDelay: Story;
|
|
21
38
|
export declare const WithPlaceholder: Story;
|
|
22
39
|
export declare const Disabled: Story;
|
|
@@ -1,25 +1,61 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { useState as l, useEffect as n } from "react";
|
|
3
|
+
import { InputSearch as t } from "./InputSearch.js";
|
|
4
|
+
const d = {
|
|
3
5
|
title: "Components/InputSearch",
|
|
4
|
-
component:
|
|
6
|
+
component: t,
|
|
5
7
|
tags: ["autodocs"],
|
|
6
8
|
parameters: {
|
|
7
9
|
layout: "padded"
|
|
8
10
|
}
|
|
9
|
-
},
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
}, h = {
|
|
12
|
+
render: () => {
|
|
13
|
+
const [e, a] = l(void 0);
|
|
14
|
+
return n(() => {
|
|
15
|
+
e !== void 0 && alert("Search triggered after 500 milliseconds");
|
|
16
|
+
}, [e]), /* @__PURE__ */ o(t, { value: e, onChange: (r) => a(r.target.value) });
|
|
17
|
+
}
|
|
18
|
+
}, m = {
|
|
12
19
|
name: "With label",
|
|
13
|
-
|
|
14
|
-
|
|
20
|
+
render: () => {
|
|
21
|
+
const [e, a] = l(void 0);
|
|
22
|
+
return n(() => {
|
|
23
|
+
e !== void 0 && alert("Search triggered after 500 milliseconds");
|
|
24
|
+
}, [e]), /* @__PURE__ */ o(t, { label: "Search by name or id", value: e, onChange: (r) => a(r.target.value) });
|
|
25
|
+
}
|
|
26
|
+
}, u = {
|
|
27
|
+
name: "With custom delay",
|
|
28
|
+
render: () => {
|
|
29
|
+
const [e, a] = l(void 0);
|
|
30
|
+
return n(() => {
|
|
31
|
+
e !== void 0 && alert("Search triggered after 2000 milliseconds");
|
|
32
|
+
}, [e]), /* @__PURE__ */ o(
|
|
33
|
+
t,
|
|
34
|
+
{
|
|
35
|
+
label: "Search by name or id",
|
|
36
|
+
value: e,
|
|
37
|
+
onChange: (r) => a(r.target.value),
|
|
38
|
+
triggerDelay: 2e3
|
|
39
|
+
}
|
|
40
|
+
);
|
|
15
41
|
}
|
|
16
|
-
},
|
|
42
|
+
}, g = {
|
|
17
43
|
name: "With placeholder",
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
44
|
+
render: () => {
|
|
45
|
+
const [e, a] = l(void 0);
|
|
46
|
+
return n(() => {
|
|
47
|
+
e !== void 0 && alert("Search triggered after 500 milliseconds");
|
|
48
|
+
}, [e]), /* @__PURE__ */ o(
|
|
49
|
+
t,
|
|
50
|
+
{
|
|
51
|
+
label: "Search",
|
|
52
|
+
placeholder: "Search by name or id",
|
|
53
|
+
value: e,
|
|
54
|
+
onChange: (r) => a(r.target.value)
|
|
55
|
+
}
|
|
56
|
+
);
|
|
21
57
|
}
|
|
22
|
-
},
|
|
58
|
+
}, S = {
|
|
23
59
|
args: {
|
|
24
60
|
label: "Search",
|
|
25
61
|
placeholder: "Search by name or id",
|
|
@@ -28,9 +64,10 @@ const l = {
|
|
|
28
64
|
}
|
|
29
65
|
};
|
|
30
66
|
export {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
67
|
+
S as Disabled,
|
|
68
|
+
h as Simple,
|
|
69
|
+
u as WithCustomDelay,
|
|
70
|
+
m as WithLabel,
|
|
71
|
+
g as WithPlaceholder,
|
|
72
|
+
d as default
|
|
36
73
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export interface LoadingSpinnerProps {
|
|
2
2
|
/** Whether to invert colours or not */
|
|
3
3
|
invert?: boolean;
|
|
4
|
-
/** Space
|
|
4
|
+
/** Space separated list of CSS classes to apply */
|
|
5
5
|
classNames?: string;
|
|
6
6
|
}
|
|
7
7
|
export declare const LoadingSpinner: ({ invert, classNames }: LoadingSpinnerProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -9,7 +9,7 @@ export type TypographyProps = {
|
|
|
9
9
|
element?: ElementType;
|
|
10
10
|
/** Style to be visually displayed as */
|
|
11
11
|
variant?: VariantType;
|
|
12
|
-
/** Space
|
|
12
|
+
/** Space separated list of CSS classes to apply */
|
|
13
13
|
className?: string;
|
|
14
14
|
/** Whether to apply underline text decoration */
|
|
15
15
|
underline?: boolean;
|
|
@@ -1,81 +1,83 @@
|
|
|
1
1
|
import '../../assets/Typography.css';
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { bemify as g, getBEMBase as
|
|
5
|
-
import { c as
|
|
6
|
-
const E = "
|
|
7
|
-
h1:
|
|
8
|
-
"h1--bold": "_h1--
|
|
9
|
-
h2:
|
|
10
|
-
"h2--bold": "_h2--
|
|
11
|
-
h3:
|
|
12
|
-
"h3--bold": "_h3--
|
|
13
|
-
h4:
|
|
14
|
-
"h4--bold": "_h4--
|
|
15
|
-
body:
|
|
16
|
-
"body--large": "_body--
|
|
17
|
-
"body--medium": "_body--
|
|
18
|
-
"body--small": "_body--
|
|
19
|
-
"body--tiny": "_body--
|
|
20
|
-
"body--bold": "_body--
|
|
21
|
-
"body--strikethrough": "_body--
|
|
22
|
-
"body--underlined": "_body--
|
|
23
|
-
"body--strikethrough-underlined": "_body--strikethrough-
|
|
24
|
-
quote:
|
|
25
|
-
"quote--large": "_quote--
|
|
26
|
-
"quote--bold": "_quote--
|
|
27
|
-
"quote--strikethrough": "_quote--
|
|
28
|
-
"quote--underlined": "_quote--
|
|
29
|
-
"quote--strikethrough-underlined": "_quote--strikethrough-
|
|
30
|
-
form__input:
|
|
31
|
-
form__hint:
|
|
32
|
-
form__label:
|
|
33
|
-
form__dropdown:
|
|
34
|
-
"form--bold": "_form--
|
|
35
|
-
"form--strikethrough": "_form--
|
|
36
|
-
"form--underlined": "_form--
|
|
37
|
-
"form--strikethrough-underlined": "_form--strikethrough-
|
|
38
|
-
table__header:
|
|
39
|
-
table__body:
|
|
40
|
-
"table__body--secondary": "_table__body--
|
|
41
|
-
"table--bold": "_table--
|
|
42
|
-
"table--strikethrough": "_table--
|
|
43
|
-
"table--underlined": "_table--
|
|
44
|
-
"table--strikethrough-underlined": "_table--strikethrough-
|
|
2
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef as f, useMemo as y } from "react";
|
|
4
|
+
import { bemify as g, getBEMBase as p, getBEMBlock as q } from "../../utils/styleStrings.js";
|
|
5
|
+
import { c as M } from "../../clsx-DB4S2d7J.js";
|
|
6
|
+
const B = "_h1_1elsk_1", E = "_h2_1elsk_11", S = "_h3_1elsk_21", $ = "_h4_1elsk_31", w = "_body_1elsk_41", v = "_quote_1elsk_75", x = "_form__input_1elsk_98", N = "_form__hint_1elsk_103", T = "_form__label_1elsk_108", j = "_form__dropdown_1elsk_113", P = "_table__header_1elsk_131", R = "_table__body_1elsk_136", U = "_button_1elsk_159", V = "_SM_1elsk_178", t = {
|
|
7
|
+
h1: B,
|
|
8
|
+
"h1--bold": "_h1--bold_1elsk_7",
|
|
9
|
+
h2: E,
|
|
10
|
+
"h2--bold": "_h2--bold_1elsk_17",
|
|
11
|
+
h3: S,
|
|
12
|
+
"h3--bold": "_h3--bold_1elsk_27",
|
|
13
|
+
h4: $,
|
|
14
|
+
"h4--bold": "_h4--bold_1elsk_37",
|
|
15
|
+
body: w,
|
|
16
|
+
"body--large": "_body--large_1elsk_46",
|
|
17
|
+
"body--medium": "_body--medium_1elsk_50",
|
|
18
|
+
"body--small": "_body--small_1elsk_54",
|
|
19
|
+
"body--tiny": "_body--tiny_1elsk_58",
|
|
20
|
+
"body--bold": "_body--bold_1elsk_62",
|
|
21
|
+
"body--strikethrough": "_body--strikethrough_1elsk_65",
|
|
22
|
+
"body--underlined": "_body--underlined_1elsk_68",
|
|
23
|
+
"body--strikethrough-underlined": "_body--strikethrough-underlined_1elsk_71",
|
|
24
|
+
quote: v,
|
|
25
|
+
"quote--large": "_quote--large_1elsk_80",
|
|
26
|
+
"quote--bold": "_quote--bold_1elsk_85",
|
|
27
|
+
"quote--strikethrough": "_quote--strikethrough_1elsk_88",
|
|
28
|
+
"quote--underlined": "_quote--underlined_1elsk_91",
|
|
29
|
+
"quote--strikethrough-underlined": "_quote--strikethrough-underlined_1elsk_94",
|
|
30
|
+
form__input: x,
|
|
31
|
+
form__hint: N,
|
|
32
|
+
form__label: T,
|
|
33
|
+
form__dropdown: j,
|
|
34
|
+
"form--bold": "_form--bold_1elsk_118",
|
|
35
|
+
"form--strikethrough": "_form--strikethrough_1elsk_121",
|
|
36
|
+
"form--underlined": "_form--underlined_1elsk_124",
|
|
37
|
+
"form--strikethrough-underlined": "_form--strikethrough-underlined_1elsk_127",
|
|
38
|
+
table__header: P,
|
|
39
|
+
table__body: R,
|
|
40
|
+
"table__body--secondary": "_table__body--secondary_1elsk_141",
|
|
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
45
|
button: U,
|
|
46
|
-
"button--bold": "_button--
|
|
47
|
-
"button--strikethrough": "_button--
|
|
48
|
-
"button--underlined": "_button--
|
|
49
|
-
"button--strikethrough-underlined": "_button--strikethrough-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
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: V,
|
|
51
|
+
"SM--bold": "_SM--bold_1elsk_183"
|
|
52
|
+
}, W = ["form", "table"], z = (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
|
+
}, G = f((o, e) => {
|
|
55
57
|
const {
|
|
56
|
-
children:
|
|
57
|
-
className:
|
|
58
|
-
underline:
|
|
59
|
-
element:
|
|
60
|
-
bold:
|
|
61
|
-
variant:
|
|
62
|
-
strikethrough:
|
|
63
|
-
elementProps:
|
|
64
|
-
} =
|
|
65
|
-
const
|
|
66
|
-
return
|
|
67
|
-
|
|
68
|
-
{ [
|
|
69
|
-
|
|
70
|
-
{ [
|
|
71
|
-
{ [
|
|
72
|
-
{ [
|
|
73
|
-
{ [
|
|
58
|
+
children: _,
|
|
59
|
+
className: n,
|
|
60
|
+
underline: d = !1,
|
|
61
|
+
element: b = "span",
|
|
62
|
+
bold: h = !1,
|
|
63
|
+
variant: u = z(b),
|
|
64
|
+
strikethrough: l = !1,
|
|
65
|
+
elementProps: k
|
|
66
|
+
} = o, a = b, m = y(() => {
|
|
67
|
+
const r = g(u, W), i = p(r), s = q(r);
|
|
68
|
+
return M(
|
|
69
|
+
t[i],
|
|
70
|
+
{ [t[`${r}`]]: r !== i },
|
|
71
|
+
n,
|
|
72
|
+
{ [t[`${s}--bold`]]: h },
|
|
73
|
+
{ [t[`${s}--underlined`]]: d },
|
|
74
|
+
{ [t[`${s}--strikethrough`]]: l },
|
|
75
|
+
{ [t[`${s}--strikethrough-underlined`]]: l && l && d }
|
|
74
76
|
);
|
|
75
|
-
}, [
|
|
76
|
-
return /* @__PURE__ */
|
|
77
|
+
}, [h, n, l, d, u]);
|
|
78
|
+
return /* @__PURE__ */ c(a, { ref: e, "data-testid": o["data-testid"], ...k ?? {}, className: m, children: _ });
|
|
77
79
|
});
|
|
78
80
|
export {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
+
G as Typography,
|
|
82
|
+
G as default
|
|
81
83
|
};
|