@pismo/marola 0.0.1-alpha.5 → 0.0.1-alpha.7

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 (108) hide show
  1. package/README.md +13 -2
  2. package/dist/{Button-D--uN90N.js → Button-B1umG8kJ.js} +3 -3
  3. package/dist/ClickAwayListener-BKznXF1d.js +106 -0
  4. package/dist/Dialog.module-CGVM5V_D.js +15 -0
  5. package/dist/Portal-BcdMtRGF.js +73 -0
  6. package/dist/{Tabs.module-BKlNuSPH.js → Tabs.module-BA-PC7fA.js} +13 -13
  7. package/dist/_commonjsHelpers-CT_km90n.js +30 -0
  8. package/dist/assets/Advice.css +1 -0
  9. package/dist/assets/Button.css +1 -1
  10. package/dist/assets/Checkbox.css +1 -0
  11. package/dist/assets/Dialog.css +1 -1
  12. package/dist/assets/IconButton.css +1 -1
  13. package/dist/assets/Input.css +1 -0
  14. package/dist/assets/Pagination.css +1 -1
  15. package/dist/assets/Skeleton.css +1 -0
  16. package/dist/assets/Snackbar.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/Toggle.css +1 -0
  22. package/dist/assets/Tooltip.css +1 -0
  23. package/dist/assets/Typography.css +1 -1
  24. package/dist/assets/{main.css → global.css} +1 -1
  25. package/dist/components/Advice/Advice.d.ts +16 -0
  26. package/dist/components/Advice/Advice.js +25 -0
  27. package/dist/components/Button/Button.d.ts +9 -1
  28. package/dist/components/Button/Button.js +54 -38
  29. package/dist/components/Button/Button.stories.d.ts +60 -0
  30. package/dist/components/Button/Button.stories.js +40 -0
  31. package/dist/components/Checkbox/Checkbox.d.ts +17 -0
  32. package/dist/components/Checkbox/Checkbox.js +48 -0
  33. package/dist/components/Dialog/Actions.js +1 -1
  34. package/dist/components/Dialog/Backdrop.d.ts +1 -1
  35. package/dist/components/Dialog/Backdrop.js +1 -1
  36. package/dist/components/Dialog/CloseIconButton.js +12 -124
  37. package/dist/components/Dialog/Dialog.d.ts +3 -2
  38. package/dist/components/Dialog/Dialog.js +418 -20072
  39. package/dist/components/Dialog/Dialog.stories.d.ts +343 -0
  40. package/dist/components/Dialog/Dialog.stories.js +59 -0
  41. package/dist/components/Dialog/Title.js +1 -1
  42. package/dist/components/Icon/Icon.d.ts +18 -0
  43. package/dist/components/Icon/Icon.js +95 -0
  44. package/dist/components/IconButton/IconButton.d.ts +3 -3
  45. package/dist/components/IconButton/IconButton.js +54 -65
  46. package/dist/components/Input/Input.d.ts +44 -0
  47. package/dist/components/Input/Input.js +497 -0
  48. package/dist/components/Input/Input.stories.d.ts +43 -0
  49. package/dist/components/Input/Input.stories.js +106 -0
  50. package/dist/components/LoadingSpinner/LoadingSpinner.d.ts +2 -0
  51. package/dist/components/LoadingSpinner/LoadingSpinner.stories.d.ts +14 -0
  52. package/dist/components/LoadingSpinner/LoadingSpinner.stories.js +38 -0
  53. package/dist/components/PageHeader/PageHeader.d.ts +25 -15
  54. package/dist/components/PageHeader/PageHeader.js +32 -50
  55. package/dist/components/PageHeader/PageHeader.stories.d.ts +43 -0
  56. package/dist/components/PageHeader/PageHeader.stories.js +49 -0
  57. package/dist/components/Pagination/Pagination.d.ts +1 -1
  58. package/dist/components/Pagination/Pagination.js +47 -47
  59. package/dist/components/Skeleton/Skeleton.d.ts +18 -0
  60. package/dist/components/Skeleton/Skeleton.js +26 -0
  61. package/dist/components/Snackbar/Snackbar.d.ts +13 -0
  62. package/dist/components/Snackbar/Snackbar.js +622 -0
  63. package/dist/components/SortTooltip/SortTooltip.d.ts +26 -0
  64. package/dist/components/SortTooltip/SortTooltip.js +67 -1
  65. package/dist/components/Stepper/Stepper.d.ts +16 -0
  66. package/dist/components/Stepper/Stepper.js +33 -0
  67. package/dist/components/Table/Table.d.ts +39 -0
  68. package/dist/components/Table/Table.js +122 -1
  69. package/dist/components/Table/TableContext.d.ts +19 -0
  70. package/dist/components/Table/TableContext.js +21 -1
  71. package/dist/components/Tabs/Tab.d.ts +1 -1
  72. package/dist/components/Tabs/Tab.js +5 -5
  73. package/dist/components/Tabs/TabPanel.d.ts +1 -1
  74. package/dist/components/Tabs/TabPanel.js +4 -4
  75. package/dist/components/Tabs/Tabs.d.ts +1 -1
  76. package/dist/components/Tabs/Tabs.js +3 -3
  77. package/dist/components/Toggle/Toggle.d.ts +14 -0
  78. package/dist/components/Toggle/Toggle.js +256 -0
  79. package/dist/components/Tooltip/Tooltip.d.ts +17 -0
  80. package/dist/components/Tooltip/Tooltip.js +1366 -1
  81. package/dist/components/Typography/Typography.d.ts +14 -5
  82. package/dist/components/Typography/Typography.js +76 -59
  83. package/dist/components/Typography/Typography.stories.d.ts +31 -0
  84. package/dist/components/Typography/Typography.stories.js +30 -0
  85. package/dist/components/Typography/typography.test.d.ts +1 -0
  86. package/dist/components/Typography/typography.test.js +11357 -0
  87. package/dist/index-BNWbc5Kh.js +19628 -0
  88. package/dist/{index-BvA1HyDs.js → index-CqjC7P5Y.js} +91 -95
  89. package/dist/magic-string.es-O_8lTkE3.js +738 -0
  90. package/dist/main.d.ts +16 -7
  91. package/dist/main.js +50 -28
  92. package/dist/objectWithoutPropertiesLoose-D7Cp0Pg_.js +26 -0
  93. package/dist/test-utils/assertStyles.d.ts +1 -0
  94. package/dist/test-utils/assertStyles.js +11 -0
  95. package/dist/types/helpers.d.ts +8 -0
  96. package/dist/useButton-Bc8IAgyk.js +106 -0
  97. package/dist/{useCompoundItem-wTwXbURC.js → useCompoundItem-CTYi5M_E.js} +1 -1
  98. package/dist/useIsFocusVisible-BH4IAdcw.js +69 -0
  99. package/dist/useTimeout-DxF9kiZL.js +36 -0
  100. package/dist/utils/styleStrings.d.ts +6 -0
  101. package/dist/utils/styleStrings.js +10 -0
  102. package/dist/utils/styleStrings.test.d.ts +1 -0
  103. package/dist/utils/styleStrings.test.js +41 -0
  104. package/dist/vi.Y_w82WR8-Df0JUamG.js +9860 -0
  105. package/package.json +30 -9
  106. package/dist/Dialog.module-BKWFakxu.js +0 -15
  107. package/dist/objectWithoutPropertiesLoose-ClNcje2_.js +0 -22
  108. package/dist/useButton-abQpo0za.js +0 -187
@@ -1,22 +1,31 @@
1
- import { ComponentType, ElementType, HTMLAttributes, ReactNode } from 'react';
1
+ import { ComponentType, ElementType, HTMLAttributes, LabelHTMLAttributes, ReactNode } from 'react';
2
2
 
3
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
+ /** 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("react").RefAttributes<ElementType | ComponentType>>;
30
+ export declare const Typography: import('react').ForwardRefExoticComponent<TypographyProps & import('react').RefAttributes<ElementType | ComponentType>>;
22
31
  export default Typography;
@@ -1,64 +1,81 @@
1
1
  import '../../assets/Typography.css';
2
- import { jsx as y } from "react/jsx-runtime";
3
- import { forwardRef as k, useMemo as u } from "react";
4
- import { c } from "../../clsx-DB4S2d7J.js";
5
- const v = "_h1_nv7ki_1", f = "_h2_nv7ki_11", p = "_h3_nv7ki_21", g = "_h4_nv7ki_31", q = "_body_nv7ki_41", T = "_quote_nv7ki_75", $ = "_form__input_nv7ki_86", w = "_form__hint_nv7ki_91", x = "_form__label_nv7ki_96", N = "_form__dropdown_nv7ki_101", S = "_table__header_nv7ki_107", E = "_table__body_nv7ki_112", V = "_button_nv7ki_123", n = {
6
- h1: v,
7
- "h1--bold": "_h1--bold_nv7ki_7",
8
- h2: f,
9
- "h2--bold": "_h2--bold_nv7ki_17",
10
- h3: p,
11
- "h3--bold": "_h3--bold_nv7ki_27",
12
- h4: g,
13
- "h4--bold": "_h4--bold_nv7ki_37",
14
- body: q,
15
- "body--large": "_body--large_nv7ki_46",
16
- "body--medium": "_body--medium_nv7ki_50",
17
- "body--small": "_body--small_nv7ki_54",
18
- "body--tiny": "_body--tiny_nv7ki_58",
19
- "body--bold": "_body--bold_nv7ki_62",
20
- "body--strikethrough": "_body--strikethrough_nv7ki_65",
21
- "body--underlined": "_body--underlined_nv7ki_68",
22
- "body--strikethrough-underlined": "_body--strikethrough-underlined_nv7ki_71",
23
- quote: T,
24
- "quote--large": "_quote--large_nv7ki_80",
25
- form__input: $,
26
- form__hint: w,
27
- form__label: x,
28
- form__dropdown: N,
29
- table__header: S,
30
- table__body: E,
31
- "table__body--secondary": "_table__body--secondary_nv7ki_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"), "--"), _;
40
- }, R = k((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: d = !1,
46
- element: i = "span",
47
- bold: a = !1,
48
- variant: t = j(i),
49
- strikethrough: r = !1,
50
- elementProps: s
51
- } = e, h = i, m = u(() => c(
52
- n[z(t)],
53
- l,
54
- { [n[`${t}--bold`]]: a },
55
- { [n[`${t}--underlined`]]: d },
56
- { [n[`${t}--strikethrough`]]: r },
57
- { [n[`${t}--strikethrough-underlined`]]: r && r && d }
58
- ), [a, l, r, d, t]);
59
- return /* @__PURE__ */ y(h, { ref: _, "data-testid": o, ...s != null && s, className: m, children: b });
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 });
60
77
  });
61
78
  export {
62
- R as Typography,
63
- R as default
79
+ F as Typography,
80
+ F as default
64
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,30 @@
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 "../Table/Table.js";
10
+ import "../Tabs/Tabs.js";
11
+ const c = {
12
+ title: "Components/Typography",
13
+ component: p,
14
+ tags: ["autodocs"],
15
+ argTypes: {
16
+ element: {
17
+ options: ["span", "p", "h1", "h2", "h3", "h4", "h5", "h6", "td", "th"],
18
+ control: { type: "select" }
19
+ }
20
+ },
21
+ decorators: [
22
+ (o) => /* @__PURE__ */ t("div", { style: { margin: "1em" }, children: /* @__PURE__ */ t(o, {}) })
23
+ ]
24
+ }, d = {
25
+ args: { children: "Example text" }
26
+ };
27
+ export {
28
+ d as Simple,
29
+ c as default
30
+ };
@@ -0,0 +1 @@
1
+ export {};