@pismo/marola 0.0.1-alpha.5 → 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 (84) hide show
  1. package/README.md +13 -2
  2. package/dist/{Button-D--uN90N.js → Button-W6tM-_IT.js} +3 -3
  3. package/dist/Dialog.module-CGVM5V_D.js +15 -0
  4. package/dist/Portal-P3fPvS3-.js +19695 -0
  5. package/dist/{Tabs.module-BKlNuSPH.js → Tabs.module-BA-PC7fA.js} +13 -13
  6. package/dist/_commonjsHelpers-CT_km90n.js +30 -0
  7. package/dist/assets/Advice.css +1 -0
  8. package/dist/assets/Button.css +1 -1
  9. package/dist/assets/Checkbox.css +1 -0
  10. package/dist/assets/Dialog.css +1 -1
  11. package/dist/assets/IconButton.css +1 -1
  12. package/dist/assets/Pagination.css +1 -1
  13. package/dist/assets/Skeleton.css +1 -0
  14. package/dist/assets/SortTooltip.css +1 -0
  15. package/dist/assets/Stepper.css +1 -0
  16. package/dist/assets/Table.css +1 -0
  17. package/dist/assets/Tabs.css +1 -1
  18. package/dist/assets/Tooltip.css +1 -0
  19. package/dist/assets/Typography.css +1 -1
  20. package/dist/assets/{main.css → global.css} +1 -1
  21. package/dist/components/Advice/Advice.d.ts +13 -0
  22. package/dist/components/Advice/Advice.js +25 -0
  23. package/dist/components/Button/Button.d.ts +1 -1
  24. package/dist/components/Button/Button.js +54 -38
  25. package/dist/components/Checkbox/Checkbox.d.ts +17 -0
  26. package/dist/components/Checkbox/Checkbox.js +48 -0
  27. package/dist/components/Dialog/Actions.js +1 -1
  28. package/dist/components/Dialog/Backdrop.d.ts +1 -1
  29. package/dist/components/Dialog/Backdrop.js +1 -1
  30. package/dist/components/Dialog/CloseIconButton.js +12 -124
  31. package/dist/components/Dialog/Dialog.js +417 -20072
  32. package/dist/components/Dialog/Title.js +1 -1
  33. package/dist/components/Icon/Icon.d.ts +7 -0
  34. package/dist/components/Icon/Icon.js +9 -0
  35. package/dist/components/IconButton/IconButton.d.ts +3 -3
  36. package/dist/components/IconButton/IconButton.js +54 -65
  37. package/dist/components/PageHeader/PageHeader.d.ts +25 -15
  38. package/dist/components/PageHeader/PageHeader.js +32 -50
  39. package/dist/components/PageHeader/PageHeader.stories.d.ts +43 -0
  40. package/dist/components/PageHeader/PageHeader.stories.js +49 -0
  41. package/dist/components/Pagination/Pagination.js +38 -38
  42. package/dist/components/Skeleton/Skeleton.d.ts +18 -0
  43. package/dist/components/Skeleton/Skeleton.js +26 -0
  44. package/dist/components/SortTooltip/SortTooltip.d.ts +26 -0
  45. package/dist/components/SortTooltip/SortTooltip.js +67 -1
  46. package/dist/components/Stepper/Stepper.d.ts +16 -0
  47. package/dist/components/Stepper/Stepper.js +33 -0
  48. package/dist/components/Table/Table.d.ts +39 -0
  49. package/dist/components/Table/Table.js +122 -1
  50. package/dist/components/Table/TableContext.d.ts +19 -0
  51. package/dist/components/Table/TableContext.js +21 -1
  52. package/dist/components/Tabs/Tab.d.ts +1 -1
  53. package/dist/components/Tabs/Tab.js +5 -5
  54. package/dist/components/Tabs/TabPanel.d.ts +1 -1
  55. package/dist/components/Tabs/TabPanel.js +4 -4
  56. package/dist/components/Tabs/Tabs.d.ts +1 -1
  57. package/dist/components/Tabs/Tabs.js +3 -3
  58. package/dist/components/Tooltip/Tooltip.d.ts +17 -0
  59. package/dist/components/Tooltip/Tooltip.js +1463 -1
  60. package/dist/components/Typography/Typography.d.ts +13 -4
  61. package/dist/components/Typography/Typography.js +76 -59
  62. package/dist/components/Typography/Typography.stories.d.ts +18 -0
  63. package/dist/components/Typography/Typography.stories.js +30 -0
  64. package/dist/components/Typography/typography.test.d.ts +1 -0
  65. package/dist/components/Typography/typography.test.js +11360 -0
  66. package/dist/{index-BvA1HyDs.js → index-D2P7y2mE.js} +90 -95
  67. package/dist/magic-string.es-O_8lTkE3.js +738 -0
  68. package/dist/main.d.ts +1 -0
  69. package/dist/main.js +30 -28
  70. package/dist/objectWithoutPropertiesLoose-D7Cp0Pg_.js +26 -0
  71. package/dist/react-CGNQ6M5x.js +117 -0
  72. package/dist/test-utils/assertStyles.d.ts +1 -0
  73. package/dist/test-utils/assertStyles.js +11 -0
  74. package/dist/types/helpers.d.ts +8 -0
  75. package/dist/{useButton-abQpo0za.js → useButton-JpyBo5M4.js} +2 -2
  76. package/dist/{useCompoundItem-wTwXbURC.js → useCompoundItem-CTYi5M_E.js} +1 -1
  77. package/dist/utils/styleStrings.d.ts +6 -0
  78. package/dist/utils/styleStrings.js +10 -0
  79. package/dist/utils/styleStrings.test.d.ts +1 -0
  80. package/dist/utils/styleStrings.test.js +41 -0
  81. package/dist/vi.Y_w82WR8-Df0JUamG.js +9860 -0
  82. package/package.json +26 -6
  83. package/dist/Dialog.module-BKWFakxu.js +0 -15
  84. package/dist/objectWithoutPropertiesLoose-ClNcje2_.js +0 -22
@@ -3,20 +3,29 @@ import { ComponentType, ElementType, HTMLAttributes, ReactNode } from 'react';
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
+ /** 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,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,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 {};