@pismo/marola 0.0.1-alpha.17 → 0.0.1-alpha.18

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 (69) hide show
  1. package/dist/{Button-CSuug0jG.js → Button-2b1peDFT.js} +25 -26
  2. package/dist/{ClickAwayListener-hSFuUJnv.js → ClickAwayListener-BSW-Nd-y.js} +3 -3
  3. package/dist/{Popup-DwaWJ3ye.js → Popup-B6ZSGIEI.js} +12 -13
  4. package/dist/{Portal-CGBQMhI6.js → Portal-DIeBsWdL.js} +2 -2
  5. package/dist/{SelectButton-DWZ2BRaX.js → SelectButton-pciwIWcj.js} +24 -22
  6. package/dist/assets/Pagination.css +1 -1
  7. package/dist/assets/SelectButton.css +1 -1
  8. package/dist/assets/TextDisplay.css +1 -0
  9. package/dist/{combineHooksSlotProps-D8j4htsd.js → combineHooksSlotProps-DVjg9PRh.js} +18 -19
  10. package/dist/components/Button/Button.js +1 -1
  11. package/dist/components/Checkbox/Checkbox.d.ts +15 -0
  12. package/dist/components/Checkbox/Checkbox.stories.d.ts +31 -0
  13. package/dist/components/Chip/Chip.js +1 -1
  14. package/dist/components/Dialog/CloseIconButton.js +1 -1
  15. package/dist/components/Dialog/Dialog.js +15 -16
  16. package/dist/components/Dialog/Dialog.stories.d.ts +3 -3
  17. package/dist/components/Icon/Icon.d.ts +10 -1
  18. package/dist/components/Icon/Icon.js +39 -25
  19. package/dist/components/Icon/Icon.stories.d.ts +16 -0
  20. package/dist/components/IconButton/Icon.stories.d.ts +15 -0
  21. package/dist/components/IconButton/IconButton.d.ts +14 -0
  22. package/dist/components/IconButton/IconButton.js +1 -1
  23. package/dist/components/Input/Input.js +25 -26
  24. package/dist/components/Pagination/Pagination.d.ts +24 -5
  25. package/dist/components/Pagination/Pagination.js +119 -116
  26. package/dist/components/Pagination/Pagination.stories.d.ts +17 -0
  27. package/dist/components/Select/Select.js +137 -138
  28. package/dist/components/Select/SelectButton.js +1 -1
  29. package/dist/components/Skeleton/Skeleton.d.ts +10 -3
  30. package/dist/components/Skeleton/Skeleton.js +12 -15
  31. package/dist/components/Skeleton/Skeleton.stories.d.ts +14 -0
  32. package/dist/components/Skeleton/SkeletonCircle.stories.d.ts +14 -0
  33. package/dist/components/Skeleton/SkeletonTable.stories.d.ts +16 -0
  34. package/dist/components/Snackbar/Snackbar.js +6 -7
  35. package/dist/components/Snackbar/Snackbar.stories.d.ts +3 -3
  36. package/dist/components/SortTooltip/SortTooltip.d.ts +3 -1
  37. package/dist/components/SortTooltip/SortTooltip.js +27 -16
  38. package/dist/components/Stepper/Stepper.d.ts +11 -1
  39. package/dist/components/Stepper/Stepper.stories.d.ts +16 -0
  40. package/dist/components/Table/Table.js +38 -40
  41. package/dist/components/Tabs/Tab.d.ts +5 -0
  42. package/dist/components/Tabs/Tab.js +9 -10
  43. package/dist/components/Tabs/Tab.stories.d.ts +15 -0
  44. package/dist/components/Tabs/TabPanel.d.ts +4 -0
  45. package/dist/components/Tabs/TabPanel.js +13 -14
  46. package/dist/components/Tabs/TabPanel.stories.d.ts +14 -0
  47. package/dist/components/Tabs/Tabs.d.ts +5 -1
  48. package/dist/components/Tabs/Tabs.js +36 -37
  49. package/dist/components/Tabs/Tabs.stories.d.ts +14 -0
  50. package/dist/components/TextDisplay/TextDisplay.d.ts +23 -0
  51. package/dist/components/TextDisplay/TextDisplay.js +37 -0
  52. package/dist/components/TextDisplay/TextDisplay.stories.d.ts +13 -0
  53. package/dist/components/TextDisplay/textDisplay.test.d.ts +1 -0
  54. package/dist/components/Toggle/Toggle.js +7 -8
  55. package/dist/components/Tooltip/Tooltip.d.ts +18 -6
  56. package/dist/components/Tooltip/Tooltip.js +104 -92
  57. package/dist/components/Tooltip/Tooltip.stories.d.ts +33 -0
  58. package/dist/components/Typography/Typography.d.ts +2 -0
  59. package/dist/components/Typography/Typography.js +40 -29
  60. package/dist/components/Typography/Typography.stories.d.ts +1 -0
  61. package/dist/{index-CtPvew6C.js → index-CH45lKw7.js} +310 -287
  62. package/dist/{index-BfeM9yWx.js → index-CjW42-M-.js} +5 -6
  63. package/dist/main.d.ts +1 -0
  64. package/dist/main.js +28 -26
  65. package/dist/{useButton-DSAvAfH_.js → useButton-DNk3wrQp.js} +3 -4
  66. package/dist/{useEventCallback-lXNMsMLa.js → useEventCallback-xTG9piMa.js} +1 -1
  67. package/dist/{useList-C5PBIv2I.js → useList-B0hog_3-.js} +48 -49
  68. package/package.json +1 -1
  69. package/dist/objectWithoutPropertiesLoose-D7Cp0Pg_.js +0 -26
@@ -1,53 +1,52 @@
1
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-DwaWJ3ye.js";
6
- import { _ as S, a as q } from "../../objectWithoutPropertiesLoose-D7Cp0Pg_.js";
7
- import { P as l } from "../../index-CtPvew6C.js";
8
- import { c as M } from "../../clsx-DB4S2d7J.js";
9
- import { C as O } from "../../ClickAwayListener-hSFuUJnv.js";
10
- function $() {
11
- const n = d.useContext(v);
2
+ import { jsx as i, jsxs as w, Fragment as S } from "react/jsx-runtime";
3
+ import * as u from "react";
4
+ import { useRef as v, useState as P, useEffect as E, isValidElement as R, cloneElement as q } from "react";
5
+ import { T as M, P as O } from "../../Popup-B6ZSGIEI.js";
6
+ import { _ as V, b as $, P as l } from "../../index-CH45lKw7.js";
7
+ import { c as z } from "../../clsx-DB4S2d7J.js";
8
+ import { C as D } from "../../ClickAwayListener-BSW-Nd-y.js";
9
+ function F() {
10
+ const n = u.useContext(M);
12
11
  if (!n)
13
12
  throw new Error("Missing transition context");
14
13
  const {
15
- registerTransition: i,
16
- requestedEnter: t,
14
+ registerTransition: e,
15
+ requestedEnter: r,
17
16
  onExited: o
18
17
  } = n;
19
- return d.useEffect(() => i(), [i]), {
18
+ return u.useEffect(() => e(), [e]), {
20
19
  onExited: o,
21
- requestedEnter: t
20
+ requestedEnter: r
22
21
  };
23
22
  }
24
- const z = ["children", "className", "enterAnimationName", "enterClassName", "exitAnimationName", "exitClassName"];
25
- function A(n) {
23
+ const I = ["children", "className", "enterAnimationName", "enterClassName", "exitAnimationName", "exitClassName"];
24
+ function g(n) {
26
25
  const {
27
- children: i,
28
- className: t,
26
+ children: e,
27
+ className: r,
29
28
  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
29
+ enterClassName: c,
30
+ exitAnimationName: _,
31
+ exitClassName: f
32
+ } = n, p = V(n, I), {
33
+ requestedEnter: d,
34
+ onExited: a
35
+ } = F(), s = u.useRef(!0);
36
+ u.useEffect(() => {
37
+ d && s.current && (s.current = !1);
38
+ }, [d]);
39
+ const t = u.useCallback((h) => {
40
+ h.animationName === _ ? (a(), s.current = !0) : h.animationName === o && (s.current = !1);
41
+ }, [a, _, o]);
42
+ return /* @__PURE__ */ i("div", $({
43
+ onAnimationEnd: t,
44
+ className: z(r, d ? c : f)
45
+ }, p, {
46
+ children: e
48
47
  }));
49
48
  }
50
- process.env.NODE_ENV !== "production" && (A.propTypes = {
49
+ process.env.NODE_ENV !== "production" && (g.propTypes = {
51
50
  children: l.node,
52
51
  className: l.string,
53
52
  enterAnimationName: l.string,
@@ -55,8 +54,8 @@ process.env.NODE_ENV !== "production" && (A.propTypes = {
55
54
  exitAnimationName: l.string,
56
55
  exitClassName: l.string
57
56
  });
58
- const D = "_tooltip_1dujm_1", r = {
59
- tooltip: D,
57
+ const W = "_tooltip_1dujm_1", m = {
58
+ tooltip: W,
60
59
  "tooltip--small-padding": "_tooltip--small-padding_1dujm_5",
61
60
  "tooltip--normal-padding": "_tooltip--normal-padding_1dujm_8",
62
61
  "tooltip--white-theme": "_tooltip--white-theme_1dujm_11",
@@ -66,62 +65,75 @@ const D = "_tooltip_1dujm_1", r = {
66
65
  "tooltip--open-animation": "_tooltip--open-animation_1dujm_1",
67
66
  "tooltip--anim-close": "_tooltip--anim-close_1dujm_23",
68
67
  "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
68
+ }, U = ({
69
+ arialRole: n,
70
+ children: e,
71
+ className: r,
72
+ disableHoverListener: o,
73
+ onClose: c,
74
+ padding: _ = "small",
75
+ position: f = "bottom",
76
+ open: p,
77
+ theme: d = "black",
78
+ title: a,
79
+ ...s
81
80
  }) => {
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));
81
+ const t = v(null), [h, N] = P(p || !1);
82
+ let j = h;
83
+ E(() => {
84
+ N(p || !1);
85
+ }, [p]);
86
+ const C = R(e) ? e : /* @__PURE__ */ i("span", { children: e });
87
+ !a && a !== 0 && (j = !1);
88
+ const b = () => {
89
+ c == null || c(), !o && N(!1);
90
+ };
91
+ E(() => {
92
+ var A;
93
+ if (t != null && t.current) {
94
+ const x = (A = t == null ? void 0 : t.current) == null ? void 0 : A.parentElement;
95
+ x && (o || (x.onpointerenter = () => N(!0), x.onpointerleave = () => N(!1)));
88
96
  }
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",
97
+ }, [t, o]);
98
+ const y = {
99
+ padding: f.match(/(bottom|top)/) ? ".25rem 0" : "0 .25rem",
94
100
  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
- ) });
101
+ }, T = [
102
+ m.tooltip,
103
+ m[`tooltip--${d}-theme`],
104
+ m[`tooltip--${_}-padding`],
105
+ r || ""
106
+ ].join(" ").trim(), k = {
107
+ ...C.props,
108
+ ref: t
109
+ };
110
+ return /* @__PURE__ */ w(S, { children: [
111
+ q(C, k),
112
+ /* @__PURE__ */ i(
113
+ O,
114
+ {
115
+ ...s,
116
+ open: j,
117
+ anchor: t == null ? void 0 : t.current,
118
+ disablePortal: !0,
119
+ style: y,
120
+ role: n,
121
+ placement: f,
122
+ children: /* @__PURE__ */ i(
123
+ g,
124
+ {
125
+ className: m["tooltip--animation"],
126
+ enterClassName: m["tooltip--anim-open"],
127
+ exitClassName: m["tooltip--anim-close"],
128
+ enterAnimationName: "tooltip--open-animation",
129
+ exitAnimationName: "tooltip--close-animation",
130
+ children: /* @__PURE__ */ i("div", { className: T, children: /* @__PURE__ */ i(D, { onClickAway: b, children: /* @__PURE__ */ i("div", { children: a }) }) })
131
+ }
132
+ )
133
+ }
134
+ )
135
+ ] });
124
136
  };
125
137
  export {
126
- K as Tooltip
138
+ U as Tooltip
127
139
  };
@@ -0,0 +1,33 @@
1
+ import { TooltipProps } from './Tooltip.tsx';
2
+ import { StoryObj } from '@storybook/react';
3
+
4
+ declare const meta: {
5
+ title: string;
6
+ component: ({ arialRole, children: childrenProp, className, disableHoverListener, onClose, padding, position, open: openProp, theme, title, ...rest }: TooltipProps) => import("react/jsx-runtime").JSX.Element;
7
+ tags: string[];
8
+ parameters: {
9
+ layout: string;
10
+ };
11
+ decorators: ((Story: import('@storybook/types').PartialStoryFn<import('@storybook/react').ReactRenderer, {
12
+ children: import('react').ReactNode;
13
+ title: import('react').ReactNode;
14
+ open?: boolean | undefined;
15
+ disableHoverListener?: boolean | undefined;
16
+ onClose?: (() => void) | undefined;
17
+ theme?: "black" | "white" | undefined;
18
+ padding?: "small" | "normal" | undefined;
19
+ position?: import('@floating-ui/utils').Placement | undefined;
20
+ arialRole?: import('react').AriaRole | undefined;
21
+ className?: string | undefined;
22
+ 'data-testid'?: string | undefined;
23
+ }>) => import("react/jsx-runtime").JSX.Element)[];
24
+ };
25
+ export default meta;
26
+ type Story = StoryObj<typeof meta>;
27
+ export declare const Simple: Story;
28
+ export declare const Onclose: Story;
29
+ export declare const InitialOpen: Story;
30
+ export declare const WhiteTheme: Story;
31
+ export declare const DisabledHover: Story;
32
+ export declare const NormalPadding: Story;
33
+ export declare const Positioning: Story;
@@ -11,6 +11,8 @@ export type TypographyProps = {
11
11
  variant?: VariantType;
12
12
  /** Space separated list of CSS classes to apply */
13
13
  className?: string;
14
+ /** Color to apply */
15
+ color?: string;
14
16
  /** Whether to apply underline text decoration */
15
17
  underline?: boolean;
16
18
  /** Whether to apply strikethrough text decoration */
@@ -1,18 +1,18 @@
1
1
  import '../../assets/Typography.css';
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,
2
+ import { jsx as f } from "react/jsx-runtime";
3
+ import { forwardRef as y, useMemo as g } from "react";
4
+ import { bemify as p, getBEMBase as q, getBEMBlock as M } from "../../utils/styleStrings.js";
5
+ import { c as B } from "../../clsx-DB4S2d7J.js";
6
+ const E = "_h1_1elsk_1", S = "_h2_1elsk_11", $ = "_h3_1elsk_21", w = "_h4_1elsk_31", v = "_body_1elsk_41", x = "_quote_1elsk_75", N = "_form__input_1elsk_98", T = "_form__hint_1elsk_103", j = "_form__label_1elsk_108", P = "_form__dropdown_1elsk_113", R = "_table__header_1elsk_131", U = "_table__body_1elsk_136", V = "_button_1elsk_159", W = "_SM_1elsk_178", t = {
7
+ h1: E,
8
8
  "h1--bold": "_h1--bold_1elsk_7",
9
- h2: E,
9
+ h2: S,
10
10
  "h2--bold": "_h2--bold_1elsk_17",
11
- h3: S,
11
+ h3: $,
12
12
  "h3--bold": "_h3--bold_1elsk_27",
13
- h4: $,
13
+ h4: w,
14
14
  "h4--bold": "_h4--bold_1elsk_37",
15
- body: w,
15
+ body: v,
16
16
  "body--large": "_body--large_1elsk_46",
17
17
  "body--medium": "_body--medium_1elsk_50",
18
18
  "body--small": "_body--small_1elsk_54",
@@ -21,51 +21,52 @@ const B = "_h1_1elsk_1", E = "_h2_1elsk_11", S = "_h3_1elsk_21", $ = "_h4_1elsk_
21
21
  "body--strikethrough": "_body--strikethrough_1elsk_65",
22
22
  "body--underlined": "_body--underlined_1elsk_68",
23
23
  "body--strikethrough-underlined": "_body--strikethrough-underlined_1elsk_71",
24
- quote: v,
24
+ quote: x,
25
25
  "quote--large": "_quote--large_1elsk_80",
26
26
  "quote--bold": "_quote--bold_1elsk_85",
27
27
  "quote--strikethrough": "_quote--strikethrough_1elsk_88",
28
28
  "quote--underlined": "_quote--underlined_1elsk_91",
29
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,
30
+ form__input: N,
31
+ form__hint: T,
32
+ form__label: j,
33
+ form__dropdown: P,
34
34
  "form--bold": "_form--bold_1elsk_118",
35
35
  "form--strikethrough": "_form--strikethrough_1elsk_121",
36
36
  "form--underlined": "_form--underlined_1elsk_124",
37
37
  "form--strikethrough-underlined": "_form--strikethrough-underlined_1elsk_127",
38
- table__header: P,
39
- table__body: R,
38
+ table__header: R,
39
+ table__body: U,
40
40
  "table__body--secondary": "_table__body--secondary_1elsk_141",
41
41
  "table--bold": "_table--bold_1elsk_146",
42
42
  "table--strikethrough": "_table--strikethrough_1elsk_149",
43
43
  "table--underlined": "_table--underlined_1elsk_152",
44
44
  "table--strikethrough-underlined": "_table--strikethrough-underlined_1elsk_155",
45
- button: U,
45
+ button: V,
46
46
  "button--bold": "_button--bold_1elsk_165",
47
47
  "button--strikethrough": "_button--strikethrough_1elsk_168",
48
48
  "button--underlined": "_button--underlined_1elsk_171",
49
49
  "button--strikethrough-underlined": "_button--strikethrough-underlined_1elsk_174",
50
- SM: V,
50
+ SM: W,
51
51
  "SM--bold": "_SM--bold_1elsk_183"
52
- }, W = ["form", "table"], z = (o) => {
52
+ }, z = ["form", "table"], A = (o) => {
53
53
  const e = o.toString();
54
54
  let _ = "body";
55
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) => {
56
+ }, H = y((o, e) => {
57
57
  const {
58
58
  children: _,
59
59
  className: n,
60
60
  underline: d = !1,
61
61
  element: b = "span",
62
62
  bold: h = !1,
63
- variant: u = z(b),
63
+ color: k,
64
+ variant: u = A(b),
64
65
  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(
66
+ elementProps: a
67
+ } = o, m = b, c = g(() => {
68
+ const r = p(u, z), i = q(r), s = M(r);
69
+ return B(
69
70
  t[i],
70
71
  { [t[`${r}`]]: r !== i },
71
72
  n,
@@ -75,9 +76,19 @@ const B = "_h1_1elsk_1", E = "_h2_1elsk_11", S = "_h3_1elsk_21", $ = "_h4_1elsk_
75
76
  { [t[`${s}--strikethrough-underlined`]]: l && l && d }
76
77
  );
77
78
  }, [h, n, l, d, u]);
78
- return /* @__PURE__ */ c(a, { ref: e, "data-testid": o["data-testid"], ...k ?? {}, className: m, children: _ });
79
+ return /* @__PURE__ */ f(
80
+ m,
81
+ {
82
+ style: { color: k },
83
+ ref: e,
84
+ "data-testid": o["data-testid"],
85
+ ...a ?? {},
86
+ className: c,
87
+ children: _
88
+ }
89
+ );
79
90
  });
80
91
  export {
81
- G as Typography,
82
- G as default
92
+ H as Typography,
93
+ H as default
83
94
  };
@@ -17,6 +17,7 @@ declare const meta: {
17
17
  element?: import('react').ElementType | undefined;
18
18
  variant?: import('./Typography').VariantType | undefined;
19
19
  className?: string | undefined;
20
+ color?: string | undefined;
20
21
  underline?: boolean | undefined;
21
22
  strikethrough?: boolean | undefined;
22
23
  bold?: boolean | undefined;