@pismo/marola 0.0.1-alpha.6 → 0.0.1-alpha.8

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 (72) hide show
  1. package/dist/{Button-W6tM-_IT.js → Button-B1umG8kJ.js} +2 -2
  2. package/dist/ClickAwayListener-BKznXF1d.js +106 -0
  3. package/dist/Portal-BcdMtRGF.js +73 -0
  4. package/dist/Tab-CRwnhsj5.js +254 -0
  5. package/dist/Tabs.module-yYcTJnj6.js +103 -0
  6. package/dist/assets/Input.css +1 -0
  7. package/dist/assets/InputSearch.css +1 -0
  8. package/dist/assets/PageHeader.css +1 -1
  9. package/dist/assets/Snackbar.css +1 -0
  10. package/dist/assets/Toggle.css +1 -0
  11. package/dist/assets/global.css +1 -1
  12. package/dist/components/Advice/Advice.d.ts +6 -3
  13. package/dist/components/Advice/Advice.js +15 -15
  14. package/dist/components/Button/Button.d.ts +8 -0
  15. package/dist/components/Button/Button.js +1 -1
  16. package/dist/components/Button/Button.stories.d.ts +60 -0
  17. package/dist/components/Button/Button.stories.js +40 -0
  18. package/dist/components/Dialog/CloseIconButton.js +9 -9
  19. package/dist/components/Dialog/Dialog.d.ts +3 -2
  20. package/dist/components/Dialog/Dialog.js +10 -9
  21. package/dist/components/Dialog/Dialog.stories.d.ts +343 -0
  22. package/dist/components/Dialog/Dialog.stories.js +59 -0
  23. package/dist/components/Icon/Icon.d.ts +15 -4
  24. package/dist/components/Icon/Icon.js +92 -6
  25. package/dist/components/IconButton/IconButton.js +1 -1
  26. package/dist/components/Input/Input.d.ts +44 -0
  27. package/dist/components/Input/Input.js +497 -0
  28. package/dist/components/Input/Input.stories.d.ts +43 -0
  29. package/dist/components/Input/Input.stories.js +106 -0
  30. package/dist/components/InputSearch/InputSearch.d.ts +11 -0
  31. package/dist/components/InputSearch/InputSearch.js +29 -0
  32. package/dist/components/InputSearch/InputSearch.stories.d.ts +22 -0
  33. package/dist/components/InputSearch/InputSearch.stories.js +36 -0
  34. package/dist/components/LoadingSpinner/LoadingSpinner.d.ts +2 -0
  35. package/dist/components/LoadingSpinner/LoadingSpinner.stories.d.ts +14 -0
  36. package/dist/components/LoadingSpinner/LoadingSpinner.stories.js +38 -0
  37. package/dist/components/PageHeader/PageHeader.js +25 -25
  38. package/dist/components/PageHeader/PageHeader.stories.js +3 -3
  39. package/dist/components/Pagination/Pagination.d.ts +1 -1
  40. package/dist/components/Pagination/Pagination.js +10 -10
  41. package/dist/components/Snackbar/Snackbar.d.ts +13 -0
  42. package/dist/components/Snackbar/Snackbar.js +622 -0
  43. package/dist/components/SortTooltip/SortTooltip.d.ts +1 -1
  44. package/dist/components/SortTooltip/SortTooltip.js +8 -8
  45. package/dist/components/Table/Table.d.ts +1 -1
  46. package/dist/components/Table/Table.js +15 -15
  47. package/dist/components/Tabs/Tab.js +6 -239
  48. package/dist/components/Tabs/TabPanel.js +18 -19
  49. package/dist/components/Tabs/Tabs.d.ts +2 -0
  50. package/dist/components/Tabs/Tabs.js +12 -8
  51. package/dist/components/Toggle/Toggle.d.ts +12 -0
  52. package/dist/components/Toggle/Toggle.js +251 -0
  53. package/dist/components/Toggle/Toggle.stories.d.ts +22 -0
  54. package/dist/components/Toggle/Toggle.stories.js +27 -0
  55. package/dist/components/Tooltip/Tooltip.js +558 -655
  56. package/dist/components/Typography/Typography.d.ts +5 -5
  57. package/dist/components/Typography/Typography.stories.d.ts +13 -0
  58. package/dist/components/Typography/Typography.stories.js +15 -15
  59. package/dist/components/Typography/typography.test.js +5 -8
  60. package/dist/{Portal-P3fPvS3-.js → index-BNWbc5Kh.js} +5709 -5776
  61. package/dist/{index-D2P7y2mE.js → index-CqjC7P5Y.js} +4 -3
  62. package/dist/main.d.ts +17 -8
  63. package/dist/main.js +55 -28
  64. package/dist/useButton-Bc8IAgyk.js +106 -0
  65. package/dist/useIsFocusVisible-BH4IAdcw.js +69 -0
  66. package/dist/useTimeout-DxF9kiZL.js +36 -0
  67. package/package.json +5 -4
  68. package/dist/ListContext-Dj2Va7Iv.js +0 -18
  69. package/dist/Tabs.module-BA-PC7fA.js +0 -66
  70. package/dist/react-CGNQ6M5x.js +0 -117
  71. package/dist/useButton-JpyBo5M4.js +0 -187
  72. package/dist/useCompoundItem-CTYi5M_E.js +0 -41
@@ -0,0 +1,22 @@
1
+ import { StoryObj } from '@storybook/react';
2
+
3
+ declare const meta: {
4
+ title: string;
5
+ component: ({ label, placeholder, classNameWrapper, classNameInputSearch, disabled, "data-testid": dataTestId, }: import('react').InputHTMLAttributes<HTMLInputElement> & {
6
+ label?: string | undefined;
7
+ placeholder?: string | undefined;
8
+ classNameWrapper?: string | undefined;
9
+ classNameInputSearch?: string | undefined;
10
+ 'data-testid'?: string | undefined;
11
+ }) => import("react/jsx-runtime").JSX.Element;
12
+ tags: string[];
13
+ parameters: {
14
+ layout: string;
15
+ };
16
+ };
17
+ export default meta;
18
+ type Story = StoryObj<typeof meta>;
19
+ export declare const Simple: Story;
20
+ export declare const WithLabel: Story;
21
+ export declare const WithPlaceholder: Story;
22
+ export declare const Disabled: Story;
@@ -0,0 +1,36 @@
1
+ import { InputSearch as a } from "./InputSearch.js";
2
+ const l = {
3
+ title: "Components/InputSearch",
4
+ component: a,
5
+ tags: ["autodocs"],
6
+ parameters: {
7
+ layout: "padded"
8
+ }
9
+ }, r = {
10
+ args: {}
11
+ }, t = {
12
+ name: "With label",
13
+ args: {
14
+ label: "Search by name or id"
15
+ }
16
+ }, o = {
17
+ name: "With placeholder",
18
+ args: {
19
+ label: "Search",
20
+ placeholder: "Search by name or id"
21
+ }
22
+ }, c = {
23
+ args: {
24
+ label: "Search",
25
+ placeholder: "Search by name or id",
26
+ value: "Marola DS",
27
+ disabled: !0
28
+ }
29
+ };
30
+ export {
31
+ c as Disabled,
32
+ r as Simple,
33
+ t as WithLabel,
34
+ o as WithPlaceholder,
35
+ l as default
36
+ };
@@ -1,5 +1,7 @@
1
1
  export interface LoadingSpinnerProps {
2
+ /** Whether to invert colours or not */
2
3
  invert?: boolean;
4
+ /** Space seperated list of CSS classes to apply */
3
5
  classNames?: string;
4
6
  }
5
7
  export declare const LoadingSpinner: ({ invert, classNames }: LoadingSpinnerProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,14 @@
1
+ import { StoryObj } from '@storybook/react';
2
+
3
+ declare const meta: {
4
+ title: string;
5
+ component: ({ invert, classNames }: import('./LoadingSpinner').LoadingSpinnerProps) => import("react/jsx-runtime").JSX.Element;
6
+ tags: string[];
7
+ decorators: ((Story: import('@storybook/types').PartialStoryFn<import('@storybook/react').ReactRenderer, {
8
+ invert?: boolean | undefined;
9
+ classNames?: string | undefined;
10
+ }>) => import("react/jsx-runtime").JSX.Element)[];
11
+ };
12
+ export default meta;
13
+ type Story = StoryObj<typeof meta>;
14
+ export declare const Simple: Story;
@@ -0,0 +1,38 @@
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/Typography.js";
8
+ import "../IconButton/IconButton.js";
9
+ import { LoadingSpinner as i } from "./LoadingSpinner.js";
10
+ import "../Table/Table.js";
11
+ import "../Tabs/Tabs.js";
12
+ const g = {
13
+ title: "Components/LoadingSpinner",
14
+ component: i,
15
+ tags: ["autodocs"],
16
+ decorators: [
17
+ (o) => /* @__PURE__ */ t(
18
+ "div",
19
+ {
20
+ style: {
21
+ backgroundColor: "#423755",
22
+ width: "5em",
23
+ height: "5em",
24
+ display: "flex",
25
+ justifyContent: "center",
26
+ alignItems: "center"
27
+ },
28
+ children: /* @__PURE__ */ t(o, {})
29
+ }
30
+ )
31
+ ]
32
+ }, f = {
33
+ args: {}
34
+ };
35
+ export {
36
+ f as Simple,
37
+ g as default
38
+ };
@@ -1,25 +1,25 @@
1
1
  import '../../assets/PageHeader.css';
2
2
  import { jsxs as a, jsx as t } from "react/jsx-runtime";
3
- import { c as n } from "../../clsx-DB4S2d7J.js";
3
+ import { c as r } from "../../clsx-DB4S2d7J.js";
4
4
  import * as _ from "react";
5
- const w = (c) => /* @__PURE__ */ _.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 448 512", "data-waves-icon": "fa/solid/arrow-left", fill: "currentColor", color: "currentColor", width: "1em", height: "1em", style: {
5
+ const z = (n) => /* @__PURE__ */ _.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 448 512", "data-waves-icon": "fa/solid/arrow-left", fill: "currentColor", color: "currentColor", width: "1em", height: "1em", style: {
6
6
  fill: "currentcolor",
7
7
  color: "currentcolor",
8
8
  width: "1em",
9
9
  height: "1em"
10
- }, ...c }, /* @__PURE__ */ _.createElement("path", { d: "M447.1 256C447.1 273.7 433.7 288 416 288H109.3l105.4 105.4c12.5 12.5 12.5 32.75 0 45.25C208.4 444.9 200.2 448 192 448s-16.38-3.125-22.62-9.375l-160-160c-12.5-12.5-12.5-32.75 0-45.25l160-160c12.5-12.5 32.75-12.5 45.25 0s12.5 32.75 0 45.25L109.3 224H416C433.7 224 447.1 238.3 447.1 256z" })), z = "_title_cz9x0_46", b = "_subtitle_cz9x0_47", e = {
11
- "page-header": "_page-header_cz9x0_1",
12
- "page-header__top-content": "_page-header__top-content_cz9x0_10",
13
- "page-header__main-content": "_page-header__main-content_cz9x0_13",
14
- "page-header__bottom-content": "_page-header__bottom-content_cz9x0_13",
15
- "page-header__main-left-content": "_page-header__main-left-content_cz9x0_40",
16
- title: z,
17
- subtitle: b,
18
- "page-header__main-right-content": "_page-header__main-right-content_cz9x0_64"
19
- }, y = ({
20
- title: c,
10
+ }, ...n }, /* @__PURE__ */ _.createElement("path", { d: "M447.1 256C447.1 273.7 433.7 288 416 288H109.3l105.4 105.4c12.5 12.5 12.5 32.75 0 45.25C208.4 444.9 200.2 448 192 448s-16.38-3.125-22.62-9.375l-160-160c-12.5-12.5-12.5-32.75 0-45.25l160-160c12.5-12.5 32.75-12.5 45.25 0s12.5 32.75 0 45.25L109.3 224H416C433.7 224 447.1 238.3 447.1 256z" })), b = "_title_157kz_45", k = "_subtitle_157kz_46", e = {
11
+ "page-header": "_page-header_157kz_1",
12
+ "page-header__top-content": "_page-header__top-content_157kz_9",
13
+ "page-header__main-content": "_page-header__main-content_157kz_12",
14
+ "page-header__bottom-content": "_page-header__bottom-content_157kz_12",
15
+ "page-header__main-left-content": "_page-header__main-left-content_157kz_39",
16
+ title: b,
17
+ subtitle: k,
18
+ "page-header__main-right-content": "_page-header__main-right-content_157kz_63"
19
+ }, C = ({
20
+ title: n,
21
21
  subtitle: d,
22
- backLinkText: r,
22
+ backLinkText: c,
23
23
  onBackLinkClick: s,
24
24
  rightChildren: i,
25
25
  bottomChildren: o,
@@ -28,24 +28,24 @@ const w = (c) => /* @__PURE__ */ _.createElement("svg", { xmlns: "http://www.w3.
28
28
  classNameTitle: m,
29
29
  classNameSubtitle: p,
30
30
  "data-testid-wrapper": g,
31
- "data-testid-backLink": x,
32
- "data-testid-title": f,
33
- "data-testid-subtitle": u,
34
- ...v
35
- }) => /* @__PURE__ */ a("div", { className: n([e["page-header"], l]), "data-testid": g, ...v, children: [
36
- r && /* @__PURE__ */ t("div", { className: e["page-header__top-content"], children: /* @__PURE__ */ a("button", { type: "button", onClick: s, className: h, "data-testid": x, children: [
37
- /* @__PURE__ */ t(w, { fontSize: 16 }),
38
- r
31
+ "data-testid-backLink": f,
32
+ "data-testid-title": u,
33
+ "data-testid-subtitle": v,
34
+ ...w
35
+ }) => /* @__PURE__ */ a("div", { className: r([e["page-header"], l]), "data-testid": g, ...w, children: [
36
+ c && /* @__PURE__ */ t("div", { className: e["page-header__top-content"], children: /* @__PURE__ */ a("button", { type: "button", onClick: s, className: h, "data-testid": f, children: [
37
+ /* @__PURE__ */ t(z, { fontSize: 16 }),
38
+ c
39
39
  ] }) }),
40
40
  /* @__PURE__ */ a("div", { className: e["page-header__main-content"], children: [
41
41
  /* @__PURE__ */ a("div", { className: e["page-header__main-left-content"], children: [
42
- /* @__PURE__ */ t("h1", { className: n(e.title, m), "data-testid": f, children: c }),
43
- /* @__PURE__ */ t("h2", { className: n(e.subtitle, p), "data-testid": u, children: d })
42
+ /* @__PURE__ */ t("h1", { className: r(e.title, m), "data-testid": u, children: n }),
43
+ /* @__PURE__ */ t("h2", { className: r(e.subtitle, p), "data-testid": v, children: d })
44
44
  ] }),
45
45
  i && /* @__PURE__ */ t("div", { className: e["page-header__main-right-content"], children: i })
46
46
  ] }),
47
47
  o && /* @__PURE__ */ t("div", { className: e["page-header__bottom-content"], children: o })
48
48
  ] });
49
49
  export {
50
- y as PageHeader
50
+ C as PageHeader
51
51
  };
@@ -1,6 +1,6 @@
1
1
  import { jsx as t, jsxs as n } from "react/jsx-runtime";
2
2
  import { Button as r } from "../Button/Button.js";
3
- import { Tab as e } from "../Tabs/Tab.js";
3
+ import { T as e } from "../../Tab-CRwnhsj5.js";
4
4
  import { TabPanel as a } from "../Tabs/TabPanel.js";
5
5
  import { Tabs as o } from "../Tabs/Tabs.js";
6
6
  import { PageHeader as l } from "./PageHeader.js";
@@ -26,7 +26,7 @@ const g = {
26
26
  ...i.args,
27
27
  rightChildren: /* @__PURE__ */ t(r, { variant: "quick", onClick: () => alert("button clicked"), children: "Click me!" })
28
28
  }
29
- }, p = {
29
+ }, T = {
30
30
  name: "With bottom children",
31
31
  args: {
32
32
  ...i.args,
@@ -43,7 +43,7 @@ const g = {
43
43
  export {
44
44
  c as Simple,
45
45
  i as WithBackLink,
46
- p as WithBottomChildren,
46
+ T as WithBottomChildren,
47
47
  u as WithRightChildren,
48
48
  g as default
49
49
  };
@@ -29,7 +29,7 @@ export type PaginationProps = {
29
29
  language?: PaginationLanguages;
30
30
  t?: PaginationTranslations;
31
31
  } & PaginationParams & PaginationCommonProps;
32
- export declare const defaultTranslations: {
32
+ export declare const paginationDefaultTranslations: {
33
33
  [key in PaginationLanguages]: PaginationTranslations;
34
34
  };
35
35
  export declare const Pagination: (props: PaginationProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,8 +1,8 @@
1
1
  import '../../assets/Pagination.css';
2
2
  import { jsxs as x, jsx as i, Fragment as M } from "react/jsx-runtime";
3
3
  import { c as C } from "../../clsx-DB4S2d7J.js";
4
- import { _ as S, a as A } from "../../objectWithoutPropertiesLoose-D7Cp0Pg_.js";
5
- import { u as D } from "../../useControlled-CCMYYdCM.js";
4
+ import { _ as O, a as S } from "../../objectWithoutPropertiesLoose-D7Cp0Pg_.js";
5
+ import { u as A } from "../../useControlled-CCMYYdCM.js";
6
6
  const E = ["boundaryCount", "componentName", "count", "defaultPage", "disabled", "hideNextButton", "hidePrevButton", "onChange", "page", "showFirstButton", "showLastButton", "siblingCount"];
7
7
  function $(e = {}) {
8
8
  const {
@@ -18,7 +18,7 @@ function $(e = {}) {
18
18
  showFirstButton: p = !1,
19
19
  showLastButton: f = !1,
20
20
  siblingCount: u = 1
21
- } = e, d = S(e, E), [r, k] = D({
21
+ } = e, d = O(e, E), [r, k] = A({
22
22
  controlled: o,
23
23
  default: b,
24
24
  name: _,
@@ -26,10 +26,10 @@ function $(e = {}) {
26
26
  }), N = (n, l) => {
27
27
  o || k(l), t && t(n, l);
28
28
  }, v = (n, l) => {
29
- const I = l - n + 1;
29
+ const F = l - n + 1;
30
30
  return Array.from({
31
- length: I
32
- }, (W, O) => n + O);
31
+ length: F
32
+ }, (W, I) => n + I);
33
33
  }, j = v(1, Math.min(a, s)), P = v(Math.max(s - a + 1, a + 1), s), w = Math.max(
34
34
  Math.min(
35
35
  // Natural start
@@ -76,7 +76,7 @@ function $(e = {}) {
76
76
  default:
77
77
  return null;
78
78
  }
79
- }, F = L.map((n) => typeof n == "number" ? {
79
+ }, D = L.map((n) => typeof n == "number" ? {
80
80
  onClick: (l) => {
81
81
  N(l, n);
82
82
  },
@@ -94,8 +94,8 @@ function $(e = {}) {
94
94
  selected: !1,
95
95
  disabled: h || n.indexOf("ellipsis") === -1 && (n === "next" || n === "last" ? r >= s : r <= 1)
96
96
  });
97
- return A({
98
- items: F
97
+ return S({
98
+ items: D
99
99
  }, d);
100
100
  }
101
101
  const R = "_pagination_9gf1w_1", g = {
@@ -215,5 +215,5 @@ const R = "_pagination_9gf1w_1", g = {
215
215
  };
216
216
  export {
217
217
  J as Pagination,
218
- T as defaultTranslations
218
+ T as paginationDefaultTranslations
219
219
  };
@@ -0,0 +1,13 @@
1
+ import { InputHTMLAttributes } from 'react';
2
+
3
+ type SnackbarProps = InputHTMLAttributes<HTMLInputElement> & {
4
+ open?: boolean;
5
+ 'data-testid'?: string;
6
+ classNameWrapper?: string;
7
+ color?: 'success' | 'error' | 'attention';
8
+ snackbarMessage: string;
9
+ autoHideDuration?: number;
10
+ onClose?: () => void;
11
+ };
12
+ export declare const Snackbar: ({ snackbarMessage, color, autoHideDuration, open, onClose, classNameWrapper, "data-testid": dataTestId, }: SnackbarProps) => import("react/jsx-runtime").JSX.Element;
13
+ export {};