@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
package/dist/main.d.ts CHANGED
@@ -5,6 +5,7 @@ export * from './components/LoadingSpinner/LoadingSpinner';
5
5
  export * from './components/Tabs/Tabs';
6
6
  export * from './components/Tabs/Tab';
7
7
  export * from './components/Tabs/TabPanel';
8
+ export * from './components/Table/Table';
8
9
  export * from './components/Pagination/Pagination';
9
10
  export * from './components/PageHeader/PageHeader';
10
11
  export * from './components/Button/Button';
package/dist/main.js CHANGED
@@ -1,30 +1,32 @@
1
- import './assets/main.css';
2
- import { Dialog as t } from "./components/Dialog/Dialog.js";
3
- import { Typography as a } from "./components/Typography/Typography.js";
4
- import { LoadingSpinner as p } from "./components/LoadingSpinner/LoadingSpinner.js";
5
- import { Tabs as m } from "./components/Tabs/Tabs.js";
6
- import { Tab as i } from "./components/Tabs/Tab.js";
7
- import { TabPanel as s } from "./components/Tabs/TabPanel.js";
8
- import { Pagination as g, defaultTranslations as u } from "./components/Pagination/Pagination.js";
9
- import { PageHeader as b } from "./components/PageHeader/PageHeader.js";
10
- import { Button as c } from "./components/Button/Button.js";
11
- import { IconButton as B } from "./components/IconButton/IconButton.js";
12
- import { default as h } from "./components/Dialog/Title.js";
13
- import { default as C } from "./components/Dialog/Content.js";
14
- import { default as I } from "./components/Dialog/Actions.js";
1
+ import './assets/global.css';
2
+ /* empty css */
3
+ import { Dialog as a } from "./components/Dialog/Dialog.js";
4
+ import { Typography as f } from "./components/Typography/Typography.js";
5
+ import { LoadingSpinner as n } from "./components/LoadingSpinner/LoadingSpinner.js";
6
+ import { Tabs as i } from "./components/Tabs/Tabs.js";
7
+ import { Tab as s } from "./components/Tabs/Tab.js";
8
+ import { TabPanel as g } from "./components/Tabs/TabPanel.js";
9
+ import "./components/Table/Table.js";
10
+ import { Pagination as T, defaultTranslations as b } from "./components/Pagination/Pagination.js";
11
+ import { PageHeader as c } from "./components/PageHeader/PageHeader.js";
12
+ import { Button as B } from "./components/Button/Button.js";
13
+ import { IconButton as h } from "./components/IconButton/IconButton.js";
14
+ import { default as C } from "./components/Dialog/Title.js";
15
+ import { default as I } from "./components/Dialog/Content.js";
16
+ import { default as S } from "./components/Dialog/Actions.js";
15
17
  export {
16
- I as Actions,
17
- c as Button,
18
- C as Content,
19
- t as Dialog,
20
- h as DialogTitle,
21
- B as IconButton,
22
- p as LoadingSpinner,
23
- b as PageHeader,
24
- g as Pagination,
25
- i as Tab,
26
- s as TabPanel,
27
- m as Tabs,
28
- a as Typography,
29
- u as defaultTranslations
18
+ S as Actions,
19
+ B as Button,
20
+ I as Content,
21
+ a as Dialog,
22
+ C as DialogTitle,
23
+ h as IconButton,
24
+ n as LoadingSpinner,
25
+ c as PageHeader,
26
+ T as Pagination,
27
+ s as Tab,
28
+ g as TabPanel,
29
+ i as Tabs,
30
+ f as Typography,
31
+ b as defaultTranslations
30
32
  };
@@ -0,0 +1,26 @@
1
+ function e() {
2
+ return e = Object.assign ? Object.assign.bind() : function(n) {
3
+ for (var a = 1; a < arguments.length; a++) {
4
+ var r = arguments[a];
5
+ for (var t in r)
6
+ Object.prototype.hasOwnProperty.call(r, t) && (n[t] = r[t]);
7
+ }
8
+ return n;
9
+ }, e.apply(this, arguments);
10
+ }
11
+ function i(n, a) {
12
+ if (n == null)
13
+ return {};
14
+ var r = {};
15
+ for (var t in n)
16
+ if (Object.prototype.hasOwnProperty.call(n, t)) {
17
+ if (a.indexOf(t) >= 0)
18
+ continue;
19
+ r[t] = n[t];
20
+ }
21
+ return r;
22
+ }
23
+ export {
24
+ i as _,
25
+ e as a
26
+ };
@@ -0,0 +1,117 @@
1
+ import { c as N, g as W } from "./_commonjsHelpers-CT_km90n.js";
2
+ import T from "react";
3
+ var E = { exports: {} };
4
+ (function(A, I) {
5
+ (function(y, w) {
6
+ A.exports = w(T);
7
+ })(N, (y) => (() => {
8
+ var w = { 639: (e) => {
9
+ e.exports = y;
10
+ } }, S = {};
11
+ function c(e) {
12
+ var o = S[e];
13
+ if (o !== void 0)
14
+ return o.exports;
15
+ var s = S[e] = { exports: {} };
16
+ return w[e](s, s.exports, c), s.exports;
17
+ }
18
+ c.n = (e) => {
19
+ var o = e && e.__esModule ? () => e.default : () => e;
20
+ return c.d(o, { a: o }), o;
21
+ }, c.d = (e, o) => {
22
+ for (var s in o)
23
+ c.o(o, s) && !c.o(e, s) && Object.defineProperty(e, s, { enumerable: !0, get: o[s] });
24
+ }, c.o = (e, o) => Object.prototype.hasOwnProperty.call(e, o), c.r = (e) => {
25
+ typeof Symbol < "u" && Symbol.toStringTag && Object.defineProperty(e, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(e, "__esModule", { value: !0 });
26
+ };
27
+ var x = {};
28
+ return (() => {
29
+ c.r(x), c.d(x, { default: () => O });
30
+ var e = c(639), o = c.n(e), s = function(a, i, u, r) {
31
+ return new (u || (u = Promise))(function(m, l) {
32
+ function p(n) {
33
+ try {
34
+ d(r.next(n));
35
+ } catch (t) {
36
+ l(t);
37
+ }
38
+ }
39
+ function f(n) {
40
+ try {
41
+ d(r.throw(n));
42
+ } catch (t) {
43
+ l(t);
44
+ }
45
+ }
46
+ function d(n) {
47
+ var t;
48
+ n.done ? m(n.value) : (t = n.value, t instanceof u ? t : new u(function(h) {
49
+ h(t);
50
+ })).then(p, f);
51
+ }
52
+ d((r = r.apply(a, [])).next());
53
+ });
54
+ };
55
+ function j() {
56
+ return typeof globalThis < "u" && globalThis.WAVES_ICONS_BASE_URL ? globalThis.WAVES_ICONS_BASE_URL : typeof window < "u" && window.WAVES_ICONS_BASE_URL ? window.WAVES_ICONS_BASE_URL : "https://waves-icons.pismolabs.io/bin";
57
+ }
58
+ function _(a, i, u) {
59
+ const r = i && Number.isNaN(Number(i)) ? i : i ? `${i}px` : "1em", m = u || "currentColor", l = { fill: m, color: m, width: r, height: r };
60
+ return a && Object.keys(l).forEach((p) => {
61
+ a.setAttribute(p, l[p]);
62
+ }), a && Object.assign(a.style, l), a;
63
+ }
64
+ const O = ({ icon: a, color: i, size: u }) => {
65
+ const r = (0, e.useRef)(null), [m, l] = (0, e.useState)(null), p = (f) => {
66
+ const d = _(f, `${u || ""}`, i);
67
+ r != null && r.current && (r.current.innerHTML = "", r.current.append(d)), l(d);
68
+ };
69
+ return (0, e.useEffect)(() => {
70
+ (function(f, d = !1) {
71
+ return s(this, void 0, void 0, function* () {
72
+ return function(n) {
73
+ return s(this, void 0, void 0, function* () {
74
+ return fetch(n, { cache: "force-cache" }).then((t) => t.status >= 200 && t.status <= 299 ? t.text() : Promise.resolve(`
75
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
76
+ <svg role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000">
77
+ <!-- Waves Icon Not Found -->
78
+ </svg>
79
+ `)).catch(console.error);
80
+ });
81
+ }(f.startsWith("http") ? f : function(n, t = "svg", h) {
82
+ return h || (h = j()), `${h}/${n}.${t}`;
83
+ }(f)).then((n) => {
84
+ try {
85
+ const t = d ? n : function(h, b) {
86
+ b || (b = `
87
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
88
+ <svg role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000">
89
+ <!-- Waves Icon Not Found -->
90
+ </svg>
91
+ `);
92
+ const g = Object.assign(document.createElement("template"), { innerHTML: b }).content.querySelector("svg");
93
+ return Array.from(g.attributes).map(({ name: v }) => v).find((v) => {
94
+ v.startsWith("on") && g.removeAttribute(v);
95
+ }), g.querySelectorAll(["a", "animate", "color-profile", "cursor", "discard", "fedropshadow", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"].join(",")).forEach((v) => {
96
+ v.remove();
97
+ }), g.setAttribute("data-waves-icon", h), g;
98
+ }(f, n);
99
+ return Promise.resolve(t);
100
+ } catch (t) {
101
+ return Promise.reject(t);
102
+ }
103
+ }).catch(console.error);
104
+ });
105
+ })(a).then(p).catch(console.error);
106
+ }, [a]), (0, e.useEffect)(() => {
107
+ _(m, `${u || ""}`, i);
108
+ }, [u, i]), o().createElement("span", { ref: r });
109
+ };
110
+ })(), x;
111
+ })());
112
+ })(E);
113
+ var P = E.exports;
114
+ const L = /* @__PURE__ */ W(P);
115
+ export {
116
+ L as W
117
+ };
@@ -0,0 +1 @@
1
+ export declare const assertClassesApplied: (expectedClasses: string[] | null, component: HTMLElement) => void;
@@ -0,0 +1,11 @@
1
+ const i = (h, r) => {
2
+ h == null || h.forEach((a) => {
3
+ if (!r.className.split(" ").some((t) => t.startsWith(`_${a}_`)))
4
+ throw new Error(`
5
+ Received: ${r.className}
6
+ Expected: _${a}_{x}, (where {x} = random hash)`);
7
+ });
8
+ };
9
+ export {
10
+ i as assertClassesApplied
11
+ };
@@ -17,3 +17,11 @@ type RequireAllOrNone<T, U extends keyof T = never> = (
17
17
  | Partial<Record<U, never>> // Require none
18
18
  ) &
19
19
  Omit<T, U>; // remaining keys not listed in U
20
+
21
+ // S = string, D = delimiter to split by. Then split S by D and return array of strings. "foo-bar-baz" = ["foo","bar","baz"]
22
+ // Fallback if no '-' return [s] which is an array of the input string e.g. foo = [foo]
23
+ type Split<S extends string, D extends string> = string extends S
24
+ ? string[]
25
+ : S extends `${infer T}${D}${infer Rest}`
26
+ ? [T, ...Split<Rest, D>]
27
+ : [S];
@@ -1,6 +1,6 @@
1
- import { a as k } from "./objectWithoutPropertiesLoose-ClNcje2_.js";
1
+ import { a as k } from "./objectWithoutPropertiesLoose-D7Cp0Pg_.js";
2
2
  import * as l from "react";
3
- import { f as A, h as I } from "./index-BvA1HyDs.js";
3
+ import { d as A, e as I } from "./index-D2P7y2mE.js";
4
4
  function _(r) {
5
5
  const {
6
6
  rootElementName: n = "",
@@ -1,5 +1,5 @@
1
1
  import * as o from "react";
2
- import { C as a } from "./Tabs.module-BKlNuSPH.js";
2
+ import { C as a } from "./Tabs.module-BA-PC7fA.js";
3
3
  import { u as I } from "./useEnhancedEffect-CJGo-L3B.js";
4
4
  let r = 0;
5
5
  function i(t) {
@@ -0,0 +1,6 @@
1
+ import { Split } from '../types/helpers';
2
+
3
+ export type BlockType<T extends string> = Split<T, '-'>[0];
4
+ export declare const bemify: <T extends string>(variant: T, blocksWithElements: BlockType<T>[]) => string;
5
+ export declare const getBEMBase: (variant: string) => string;
6
+ export declare const getBEMBlock: (variant: string) => string;
@@ -0,0 +1,10 @@
1
+ const s = (e, n) => {
2
+ const r = new RegExp(`^([${n.join("|")}]*)-`);
3
+ let t = e.replace(r, "$1__");
4
+ return t = t.replace(new RegExp("(?<!-)-(?!-)", "g"), "--"), t;
5
+ }, c = (e) => e.split("--")[0], l = (e) => e.split(/--|__/)[0];
6
+ export {
7
+ s as bemify,
8
+ c as getBEMBase,
9
+ l as getBEMBlock
10
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,41 @@
1
+ import { bemify as a, getBEMBase as e, getBEMBlock as r } from "./styleStrings.js";
2
+ import { d as s, i as o, g as t } from "../vi.Y_w82WR8-Df0JUamG.js";
3
+ s("styleStrings", () => {
4
+ s("bemify", () => {
5
+ o("returns just a block if a block was only given", () => {
6
+ t(a("foo", ["bar"])).toEqual("foo");
7
+ }), o("returns just a block and modifier if no elements for that block", () => {
8
+ t(a("foo-baz", ["bar"])).toEqual("foo--baz");
9
+ }), o("returns just block and element if it is a block with elements", () => {
10
+ t(a("bar-baz", ["bar"])).toEqual("bar__baz");
11
+ }), o("returns block, element and modifier if it has all three parts", () => {
12
+ t(a("bar-baz-qux", ["bar"])).toEqual("bar__baz--qux");
13
+ }), o("accepts alternative types for the generic variants type", () => {
14
+ t(a("abc-def", ["abc"])).toEqual("abc__def");
15
+ });
16
+ }), s("getBEMBase", () => {
17
+ o("returns the base BEM of a Block with no elements or modifiers", () => {
18
+ t(e("foo")).toEqual("foo");
19
+ }), o("returns the base BEM of a Block with an element but no modifiers", () => {
20
+ t(e("foo__bar")).toEqual("foo__bar");
21
+ }), o("returns the base BEM of a Block with no elements but a modifier", () => {
22
+ t(e("foo--baz")).toEqual("foo");
23
+ }), o("returns the base BEM of a Block with an element and a modifier", () => {
24
+ t(e("foo__bar--baz")).toEqual("foo__bar");
25
+ }), o("returns empty if given nothing", () => {
26
+ t(e("")).toEqual("");
27
+ });
28
+ }), s("getBEMBlock", () => {
29
+ o("returns the block part of a full BEM style string", () => {
30
+ t(r("foo__bar--baz")).toEqual("foo");
31
+ }), o("returns the block part of a BEM style string that has just block and element", () => {
32
+ t(r("foo__bar")).toEqual("foo");
33
+ }), o("returns the block part of a BEM style string that has just block and modifier", () => {
34
+ t(r("foo--baz")).toEqual("foo");
35
+ }), o("returns the block part of a BEM style string that has just a block", () => {
36
+ t(r("foo")).toEqual("foo");
37
+ }), o("returns nothing if nothing passed in", () => {
38
+ t(r("")).toEqual("");
39
+ });
40
+ });
41
+ });