@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.
Files changed (43) hide show
  1. package/README.md +1 -1
  2. package/dist/assets/Button.css +1 -1
  3. package/dist/assets/Chip.css +1 -0
  4. package/dist/assets/IconButton.css +1 -1
  5. package/dist/assets/Input.css +1 -1
  6. package/dist/assets/InputSearch.css +1 -1
  7. package/dist/assets/Typography.css +1 -1
  8. package/dist/components/Button/Button.d.ts +5 -2
  9. package/dist/components/Button/Button.js +87 -63
  10. package/dist/components/Button/Button.stories.d.ts +2 -0
  11. package/dist/components/Button/Button.stories.js +1 -2
  12. package/dist/components/Chip/Chip.d.ts +37 -0
  13. package/dist/components/Chip/Chip.js +143 -0
  14. package/dist/components/Chip/Chip.stories.d.ts +40 -0
  15. package/dist/components/Chip/Chip.stories.js +59 -0
  16. package/dist/components/Chip/chip.test.d.ts +1 -0
  17. package/dist/components/Chip/chip.test.js +17303 -0
  18. package/dist/components/Dialog/Dialog.stories.d.ts +3 -3
  19. package/dist/components/Dialog/Dialog.stories.js +1 -2
  20. package/dist/components/Icon/Icon.d.ts +1 -1
  21. package/dist/components/Icon/Icon.js +27 -20
  22. package/dist/components/IconButton/IconButton.d.ts +2 -2
  23. package/dist/components/IconButton/IconButton.js +63 -61
  24. package/dist/components/Input/Input.d.ts +1 -1
  25. package/dist/components/Input/Input.js +32 -32
  26. package/dist/components/InputSearch/InputSearch.d.ts +7 -9
  27. package/dist/components/InputSearch/InputSearch.js +31 -26
  28. package/dist/components/InputSearch/InputSearch.stories.d.ts +21 -4
  29. package/dist/components/InputSearch/InputSearch.stories.js +55 -18
  30. package/dist/components/LoadingSpinner/LoadingSpinner.d.ts +1 -1
  31. package/dist/components/LoadingSpinner/LoadingSpinner.stories.js +1 -2
  32. package/dist/components/Select/Select.stories.js +1 -2
  33. package/dist/components/Typography/Typography.d.ts +1 -1
  34. package/dist/components/Typography/Typography.js +76 -74
  35. package/dist/components/Typography/Typography.stories.js +1 -2
  36. package/dist/components/Typography/typography.test.js +195 -11319
  37. package/dist/main.d.ts +1 -0
  38. package/dist/main.js +57 -57
  39. package/dist/react.esm-DGd9_oKA.js +11126 -0
  40. package/dist/utils/styleStrings.test.js +1 -1
  41. package/dist/{vi.Y_w82WR8-Df0JUamG.js → vi.Y_w82WR8-XVYrIxgm.js} +2 -1
  42. package/package.json +1 -1
  43. 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: ({ label, placeholder, classNameWrapper, classNameInputSearch, disabled, "data-testid": dataTestId, }: import('react').InputHTMLAttributes<HTMLInputElement> & {
5
+ component: ({ classNameWrapper, triggerDelay, value, onChange, ...rest }: {
6
+ triggerDelay?: number | undefined;
7
+ } & import('react').InputHTMLAttributes<HTMLInputElement> & {
6
8
  label?: string | undefined;
7
- placeholder?: string | undefined;
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
- classNameInputSearch?: string | undefined;
10
- 'data-testid'?: string | undefined;
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 { InputSearch as a } from "./InputSearch.js";
2
- const l = {
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: a,
6
+ component: t,
5
7
  tags: ["autodocs"],
6
8
  parameters: {
7
9
  layout: "padded"
8
10
  }
9
- }, r = {
10
- args: {}
11
- }, t = {
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
- args: {
14
- label: "Search by name or id"
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
- }, o = {
42
+ }, g = {
17
43
  name: "With placeholder",
18
- args: {
19
- label: "Search",
20
- placeholder: "Search by name or id"
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
- }, c = {
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
- c as Disabled,
32
- r as Simple,
33
- t as WithLabel,
34
- o as WithPlaceholder,
35
- l as default
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 seperated list of CSS classes to apply */
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;
@@ -1,6 +1,5 @@
1
- import '../../assets/global.css';
2
1
  import { jsx as t } from "react/jsx-runtime";
3
- /* empty css */
2
+ import "../Chip/Chip.js";
4
3
  import "../Button/Button.js";
5
4
  import "react";
6
5
  import "../Dialog/Backdrop.js";
@@ -1,6 +1,5 @@
1
- import '../../assets/global.css';
2
1
  import { jsxs as l, Fragment as t, jsx as e } from "react/jsx-runtime";
3
- /* empty css */
2
+ import "../Chip/Chip.js";
4
3
  import "../Button/Button.js";
5
4
  import * as n from "react";
6
5
  import "../Dialog/Backdrop.js";
@@ -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 seperated list of CSS classes to apply */
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 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",
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--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) => {
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: 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 }
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
- }, [u, b, o, l, i]);
76
- return /* @__PURE__ */ f(p, { ref: r, "data-testid": e["data-testid"], ...a ?? {}, className: m, children: t });
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
- F as Typography,
80
- F as default
81
+ G as Typography,
82
+ G as default
81
83
  };
@@ -1,6 +1,5 @@
1
- import '../../assets/global.css';
2
1
  import { jsx as t } from "react/jsx-runtime";
3
- /* empty css */
2
+ import "../Chip/Chip.js";
4
3
  import "../Button/Button.js";
5
4
  import "react";
6
5
  import "../Dialog/Backdrop.js";