@pismo/marola 0.0.1-alpha.4 → 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.
Files changed (95) hide show
  1. package/README.md +17 -5
  2. package/dist/{Button-C3Qm852g.js → Button-W6tM-_IT.js} +6 -5
  3. package/dist/Dialog.module-CGVM5V_D.js +15 -0
  4. package/dist/{ListContext-D6-YwtZn.js → ListContext-Dj2Va7Iv.js} +2 -2
  5. package/dist/Portal-P3fPvS3-.js +19695 -0
  6. package/dist/{Tabs.module-_kSbSyth.js → Tabs.module-BA-PC7fA.js} +16 -16
  7. package/dist/_commonjsHelpers-CT_km90n.js +30 -0
  8. package/dist/assets/Advice.css +1 -0
  9. package/dist/assets/Button.css +1 -0
  10. package/dist/assets/Checkbox.css +1 -0
  11. package/dist/assets/Dialog.css +1 -1
  12. package/dist/assets/IconButton.css +1 -0
  13. package/dist/assets/LoadingSpinner.css +1 -1
  14. package/dist/assets/PageHeader.css +1 -0
  15. package/dist/assets/Pagination.css +1 -0
  16. package/dist/assets/Skeleton.css +1 -0
  17. package/dist/assets/SortTooltip.css +1 -0
  18. package/dist/assets/Stepper.css +1 -0
  19. package/dist/assets/Table.css +1 -0
  20. package/dist/assets/Tabs.css +1 -1
  21. package/dist/assets/Tooltip.css +1 -0
  22. package/dist/assets/Typography.css +1 -1
  23. package/dist/assets/global.css +1 -0
  24. package/dist/components/Advice/Advice.d.ts +13 -0
  25. package/dist/components/Advice/Advice.js +25 -0
  26. package/dist/components/Button/Button.d.ts +21 -0
  27. package/dist/components/Button/Button.js +70 -0
  28. package/dist/components/Checkbox/Checkbox.d.ts +17 -0
  29. package/dist/components/Checkbox/Checkbox.js +48 -0
  30. package/dist/components/Dialog/Actions.js +1 -1
  31. package/dist/components/Dialog/Backdrop.d.ts +1 -1
  32. package/dist/components/Dialog/Backdrop.js +2 -9
  33. package/dist/components/Dialog/CloseIconButton.js +12 -124
  34. package/dist/components/Dialog/Dialog.d.ts +2 -2
  35. package/dist/components/Dialog/Dialog.js +418 -20077
  36. package/dist/components/Dialog/Title.js +22 -7
  37. package/dist/components/Icon/Icon.d.ts +7 -0
  38. package/dist/components/Icon/Icon.js +9 -0
  39. package/dist/components/IconButton/IconButton.d.ts +22 -0
  40. package/dist/components/IconButton/IconButton.js +68 -0
  41. package/dist/components/LoadingSpinner/LoadingSpinner.js +12 -13
  42. package/dist/components/PageHeader/PageHeader.d.ts +36 -0
  43. package/dist/components/PageHeader/PageHeader.js +51 -0
  44. package/dist/components/PageHeader/PageHeader.stories.d.ts +43 -0
  45. package/dist/components/PageHeader/PageHeader.stories.js +49 -0
  46. package/dist/components/Pagination/Pagination.d.ts +36 -0
  47. package/dist/components/Pagination/Pagination.js +219 -0
  48. package/dist/components/Skeleton/Skeleton.d.ts +18 -0
  49. package/dist/components/Skeleton/Skeleton.js +26 -0
  50. package/dist/components/SortTooltip/SortTooltip.d.ts +26 -0
  51. package/dist/components/SortTooltip/SortTooltip.js +67 -0
  52. package/dist/components/Stepper/Stepper.d.ts +16 -0
  53. package/dist/components/Stepper/Stepper.js +33 -0
  54. package/dist/components/Table/Table.d.ts +39 -0
  55. package/dist/components/Table/Table.js +122 -0
  56. package/dist/components/Table/TableContext.d.ts +19 -0
  57. package/dist/components/Table/TableContext.js +21 -0
  58. package/dist/components/Tabs/Tab.d.ts +1 -1
  59. package/dist/components/Tabs/Tab.js +42 -37
  60. package/dist/components/Tabs/TabPanel.d.ts +1 -1
  61. package/dist/components/Tabs/TabPanel.js +20 -21
  62. package/dist/components/Tabs/Tabs.d.ts +1 -1
  63. package/dist/components/Tabs/Tabs.js +185 -214
  64. package/dist/components/Tooltip/Tooltip.d.ts +17 -0
  65. package/dist/components/Tooltip/Tooltip.js +1463 -0
  66. package/dist/components/Typography/Typography.d.ts +14 -5
  67. package/dist/components/Typography/Typography.js +76 -68
  68. package/dist/components/Typography/Typography.stories.d.ts +18 -0
  69. package/dist/components/Typography/Typography.stories.js +30 -0
  70. package/dist/components/Typography/typography.test.d.ts +1 -0
  71. package/dist/components/Typography/typography.test.js +11360 -0
  72. package/dist/{index-BZ1lkM_M.js → index-D2P7y2mE.js} +303 -327
  73. package/dist/magic-string.es-O_8lTkE3.js +738 -0
  74. package/dist/main.d.ts +5 -1
  75. package/dist/main.js +30 -21
  76. package/dist/objectWithoutPropertiesLoose-D7Cp0Pg_.js +26 -0
  77. package/dist/react-CGNQ6M5x.js +117 -0
  78. package/dist/test-utils/assertStyles.d.ts +1 -0
  79. package/dist/test-utils/assertStyles.js +11 -0
  80. package/dist/types/helpers.d.ts +14 -7
  81. package/dist/{useButton-CbmjmH5z.js → useButton-JpyBo5M4.js} +17 -16
  82. package/dist/{useCompoundItem-B7wfGDHQ.js → useCompoundItem-CTYi5M_E.js} +1 -1
  83. package/dist/useControlled-CCMYYdCM.js +31 -0
  84. package/dist/utils/styleStrings.d.ts +6 -0
  85. package/dist/utils/styleStrings.js +10 -0
  86. package/dist/utils/styleStrings.test.d.ts +1 -0
  87. package/dist/utils/styleStrings.test.js +41 -0
  88. package/dist/vi.Y_w82WR8-Df0JUamG.js +9860 -0
  89. package/package.json +47 -7
  90. package/dist/Dialog.module-BO0mdB7d.js +0 -15
  91. package/dist/assets/CallToActionButton.css +0 -1
  92. package/dist/assets/main.css +0 -1
  93. package/dist/components/CallToActionButton/CallToActionButton.d.ts +0 -21
  94. package/dist/components/CallToActionButton/CallToActionButton.js +0 -57
  95. package/src/playground/Playground.tsx +0 -20
@@ -1,22 +1,31 @@
1
1
  import { ComponentType, ElementType, HTMLAttributes, ReactNode } from 'react';
2
2
 
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";
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
- elementProps?: HTMLAttributes<CommonTypographyHTMLAttributes>;
8
- dataTestId?: string;
8
+ /** The HTML element to render as on the DOM */
9
9
  element?: ElementType;
10
- className?: string;
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("react").RefAttributes<ElementType | ComponentType>>;
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 y } from "react/jsx-runtime";
3
- import { forwardRef as u, useMemo as c } from "react";
4
- import { c as f } from "../../clsx-DB4S2d7J.js";
5
- const p = "_h1_111i6_1", g = "_h2_111i6_11", k = "_h3_111i6_21", q = "_h4_111i6_31", T = "_body_111i6_41", $ = "_quote_111i6_75", w = "_form__input_111i6_86", S = "_form__hint_111i6_91", x = "_form__label_111i6_96", N = "_form__dropdown_111i6_101", v = "_table__header_111i6_107", E = "_table__body_111i6_112", V = "_button_111i6_123", r = {
6
- h1: p,
7
- "h1--bold": "_h1--bold_111i6_7",
8
- h2: g,
9
- "h2--bold": "_h2--bold_111i6_17",
10
- h3: k,
11
- "h3--bold": "_h3--bold_111i6_27",
12
- h4: q,
13
- "h4--bold": "_h4--bold_111i6_37",
14
- body: T,
15
- "body--large": "_body--large_111i6_46",
16
- "body--medium": "_body--medium_111i6_50",
17
- "body--small": "_body--small_111i6_54",
18
- "body--tiny": "_body--tiny_111i6_58",
19
- "body--bold": "_body--bold_111i6_62",
20
- "body--strikethrough": "_body--strikethrough_111i6_65",
21
- "body--underlined": "_body--underlined_111i6_68",
22
- "body--strikethrough-underlined": "_body--strikethrough-underlined_111i6_71",
23
- quote: $,
24
- "quote--large": "_quote--large_111i6_80",
25
- form__input: w,
26
- form__hint: S,
27
- form__label: x,
28
- form__dropdown: N,
29
- table__header: v,
30
- table__body: E,
31
- "table__body--secondary": "_table__body--secondary_111i6_117",
32
- button: V
33
- }, j = (e) => {
34
- const _ = e.toString();
35
- let o = "body";
36
- return _.match(/^h[1-4]/) ? o = _ : _.match(/^h[5-6]/) && (o = "h4"), _ === "th" && (o = "table-header"), _ === "td" && (o = "table-body"), o;
37
- }, z = (e) => {
38
- let _ = e.replace(/^([a-z]*)-/, "$1__");
39
- return _ = _.replace(new RegExp("(?<!-)-(?!-)", "g"), "--"), console.log("styleString", _), _;
40
- }, R = u((e, _) => {
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
- dataTestId: o,
43
- children: b,
44
- className: l,
45
- underline: n = !1,
46
- element: i = "span",
47
- bold: a = !1,
48
- variant: t = j(i),
49
- strikethrough: d = !1,
50
- elementProps: s
51
- } = e, h = i, m = c(() => f(
52
- r[z(t)],
53
- l,
54
- { [r[`${t}--bold`]]: a },
55
- { [r[`${t}--underlined`]]: n },
56
- { [r[`${t}--strikethrough`]]: d },
57
- { [r[`${t}--strikethrough-underlined`]]: d && d && n }
58
- ), [a, l, d, n, t]);
59
- return /* @__PURE__ */ y(
60
- h,
61
- {
62
- ref: _,
63
- "data-testid": o,
64
- ...s != null && s,
65
- className: m,
66
- children: b
67
- }
68
- );
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 });
69
77
  });
70
78
  export {
71
- R as Typography,
72
- R as default
79
+ F as Typography,
80
+ F as default
73
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 {};