@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
@@ -1,187 +0,0 @@
1
- import { a as k } from "./objectWithoutPropertiesLoose-D7Cp0Pg_.js";
2
- import * as l from "react";
3
- import { d as A, e as I } from "./index-D2P7y2mE.js";
4
- function _(r) {
5
- const {
6
- rootElementName: n = "",
7
- componentName: o
8
- } = r, [s, i] = l.useState(n.toUpperCase());
9
- process.env.NODE_ENV !== "production" && l.useEffect(() => {
10
- n && s !== n.toUpperCase() && console.error(`useRootElementName: the \`rootElementName\` prop of ${o ? `the ${o} component` : "a component"} expected the '${n}' element, but a '${s.toLowerCase()}' was rendered instead`, "This may cause hydration issues in an SSR context, for example in a Next.js app");
11
- }, [n, s, o]);
12
- const c = l.useCallback((b) => {
13
- var f;
14
- i((f = b == null ? void 0 : b.tagName) != null ? f : "");
15
- }, []);
16
- return [s, c];
17
- }
18
- class F {
19
- constructor() {
20
- this.currentId = null, this.clear = () => {
21
- this.currentId !== null && (clearTimeout(this.currentId), this.currentId = null);
22
- }, this.disposeEffect = () => this.clear;
23
- }
24
- static create() {
25
- return new F();
26
- }
27
- /**
28
- * Executes `fn` after `delay`, clearing any previously scheduled call.
29
- */
30
- start(n, o) {
31
- this.clear(), this.currentId = setTimeout(() => {
32
- this.currentId = null, o();
33
- }, n);
34
- }
35
- }
36
- let R = !0, w = !1;
37
- const W = new F(), j = {
38
- text: !0,
39
- search: !0,
40
- url: !0,
41
- tel: !0,
42
- email: !0,
43
- password: !0,
44
- number: !0,
45
- date: !0,
46
- month: !0,
47
- week: !0,
48
- time: !0,
49
- datetime: !0,
50
- "datetime-local": !0
51
- };
52
- function X(r) {
53
- const {
54
- type: n,
55
- tagName: o
56
- } = r;
57
- return !!(o === "INPUT" && j[n] && !r.readOnly || o === "TEXTAREA" && !r.readOnly || r.isContentEditable);
58
- }
59
- function q(r) {
60
- r.metaKey || r.altKey || r.ctrlKey || (R = !0);
61
- }
62
- function T() {
63
- R = !1;
64
- }
65
- function z() {
66
- this.visibilityState === "hidden" && w && (R = !0);
67
- }
68
- function G(r) {
69
- r.addEventListener("keydown", q, !0), r.addEventListener("mousedown", T, !0), r.addEventListener("pointerdown", T, !0), r.addEventListener("touchstart", T, !0), r.addEventListener("visibilitychange", z, !0);
70
- }
71
- function J(r) {
72
- const {
73
- target: n
74
- } = r;
75
- try {
76
- return n.matches(":focus-visible");
77
- } catch {
78
- }
79
- return R || X(n);
80
- }
81
- function Q() {
82
- const r = l.useCallback((i) => {
83
- i != null && G(i.ownerDocument);
84
- }, []), n = l.useRef(!1);
85
- function o() {
86
- return n.current ? (w = !0, W.start(100, () => {
87
- w = !1;
88
- }), n.current = !1, !0) : !1;
89
- }
90
- function s(i) {
91
- return J(i) ? (n.current = !0, !0) : !1;
92
- }
93
- return {
94
- isFocusVisibleRef: n,
95
- onFocus: s,
96
- onBlur: o,
97
- ref: r
98
- };
99
- }
100
- function ee(r = {}) {
101
- const {
102
- disabled: n = !1,
103
- focusableWhenDisabled: o,
104
- href: s,
105
- rootRef: i,
106
- tabIndex: c,
107
- to: b,
108
- type: f,
109
- rootElementName: V
110
- } = r, y = l.useRef(), [K, E] = l.useState(!1), {
111
- isFocusVisibleRef: h,
112
- onFocus: x,
113
- onBlur: B,
114
- ref: v
115
- } = Q(), [p, N] = l.useState(!1);
116
- n && !o && p && N(!1), l.useEffect(() => {
117
- h.current = p;
118
- }, [p, h]);
119
- const [m, M] = _({
120
- rootElementName: V ?? (s || b ? "a" : void 0),
121
- componentName: "Button"
122
- }), U = (t) => (e) => {
123
- var u;
124
- p && e.preventDefault(), (u = t.onMouseLeave) == null || u.call(t, e);
125
- }, L = (t) => (e) => {
126
- var u;
127
- B(e), h.current === !1 && N(!1), (u = t.onBlur) == null || u.call(t, e);
128
- }, P = (t) => (e) => {
129
- var u;
130
- if (y.current || (y.current = e.currentTarget), x(e), h.current === !0) {
131
- var d;
132
- N(!0), (d = t.onFocusVisible) == null || d.call(t, e);
133
- }
134
- (u = t.onFocus) == null || u.call(t, e);
135
- }, g = () => {
136
- const t = y.current;
137
- return m === "BUTTON" || m === "INPUT" && ["button", "submit", "reset"].includes(t == null ? void 0 : t.type) || m === "A" && (t == null ? void 0 : t.href);
138
- }, C = (t) => (e) => {
139
- if (!n) {
140
- var u;
141
- (u = t.onClick) == null || u.call(t, e);
142
- }
143
- }, $ = (t) => (e) => {
144
- var u;
145
- n || (E(!0), document.addEventListener("mouseup", () => {
146
- E(!1);
147
- }, {
148
- once: !0
149
- })), (u = t.onMouseDown) == null || u.call(t, e);
150
- }, S = (t) => (e) => {
151
- var u;
152
- if ((u = t.onKeyDown) == null || u.call(t, e), !e.defaultMuiPrevented && (e.target === e.currentTarget && !g() && e.key === " " && e.preventDefault(), e.target === e.currentTarget && e.key === " " && !n && E(!0), e.target === e.currentTarget && !g() && e.key === "Enter" && !n)) {
153
- var d;
154
- (d = t.onClick) == null || d.call(t, e), e.preventDefault();
155
- }
156
- }, O = (t) => (e) => {
157
- var u;
158
- if (e.target === e.currentTarget && E(!1), (u = t.onKeyUp) == null || u.call(t, e), e.target === e.currentTarget && !g() && !n && e.key === " " && !e.defaultMuiPrevented) {
159
- var d;
160
- (d = t.onClick) == null || d.call(t, e);
161
- }
162
- }, D = A(M, i, v, y), a = {};
163
- return c !== void 0 && (a.tabIndex = c), m === "BUTTON" ? (a.type = f ?? "button", o ? a["aria-disabled"] = n : a.disabled = n) : m === "INPUT" ? f && ["button", "submit", "reset"].includes(f) && (o ? a["aria-disabled"] = n : a.disabled = n) : m !== "" && (!s && !b && (a.role = "button", a.tabIndex = c ?? 0), n && (a["aria-disabled"] = n, a.tabIndex = o ? c ?? 0 : -1)), {
164
- getRootProps: (t = {}) => {
165
- const e = k({}, I(r), I(t)), u = k({
166
- type: f
167
- }, e, a, t, {
168
- onBlur: L(e),
169
- onClick: C(e),
170
- onFocus: P(e),
171
- onKeyDown: S(e),
172
- onKeyUp: O(e),
173
- onMouseDown: $(e),
174
- onMouseLeave: U(e),
175
- ref: D
176
- });
177
- return delete u.onFocusVisible, u;
178
- },
179
- focusVisible: p,
180
- setFocusVisible: N,
181
- active: K,
182
- rootRef: D
183
- };
184
- }
185
- export {
186
- ee as u
187
- };
@@ -1,41 +0,0 @@
1
- import * as o from "react";
2
- import { C as a } from "./Tabs.module-BA-PC7fA.js";
3
- import { u as I } from "./useEnhancedEffect-CJGo-L3B.js";
4
- let r = 0;
5
- function i(t) {
6
- const [e, n] = o.useState(t), u = t || e;
7
- return o.useEffect(() => {
8
- e == null && (r += 1, n(`mui-${r}`));
9
- }, [e]), u;
10
- }
11
- const d = o.useId;
12
- function C(t) {
13
- if (d !== void 0) {
14
- const e = d();
15
- return t ?? e;
16
- }
17
- return i(t);
18
- }
19
- function g(t, e) {
20
- const n = o.useContext(a);
21
- if (n === null)
22
- throw new Error("useCompoundItem must be used within a useCompoundParent");
23
- const {
24
- registerItem: u
25
- } = n, [s, f] = o.useState(typeof t == "function" ? void 0 : t);
26
- return I(() => {
27
- const {
28
- id: c,
29
- deregister: m
30
- } = u(t, e);
31
- return f(c), m;
32
- }, [u, e, t]), {
33
- id: s,
34
- index: s !== void 0 ? n.getItemIndex(s) : -1,
35
- totalItemCount: n.totalSubitemCount
36
- };
37
- }
38
- export {
39
- g as a,
40
- C as u
41
- };