@pismo/marola 2.1.64 → 2.1.65

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 (112) hide show
  1. package/dist/Button-CJaBSdv1.js +135 -0
  2. package/dist/ClassNameConfigurator-CVRWfyIa.js +847 -0
  3. package/dist/{ClickAwayListener-Z08peX_P.js → ClickAwayListener-BnYMO5Ki.js} +26 -33
  4. package/dist/Popup-D267EI4e.js +1338 -0
  5. package/dist/{Portal-DJapUCn6.js → Portal-BrGvxB96.js} +32 -36
  6. package/dist/RadioOption-DyRY8xlF.js +1094 -0
  7. package/dist/{Toggle-DcZTfLrC.js → Toggle-nnDfpqI1.js} +31 -31
  8. package/dist/assets/Checkbox.css +1 -1
  9. package/dist/assets/DropdownMenu.css +1 -1
  10. package/dist/assets/ToastCard.css +1 -1
  11. package/dist/assets/Toggle2.css +1 -1
  12. package/dist/combineHooksSlotProps-j-8UVeYo.js +86 -0
  13. package/dist/components/Alert/Alert.stories.d.ts +6 -6
  14. package/dist/components/Autocomplete/Autocomplete.d.ts +1 -1
  15. package/dist/components/Autocomplete/Autocomplete.js +311 -320
  16. package/dist/components/Autocomplete/Autocomplete.stories.d.ts +1 -1
  17. package/dist/components/Avatar/Avatar.stories.d.ts +4 -4
  18. package/dist/components/BankingCard/BankingCard.d.ts +0 -1
  19. package/dist/components/Button/Button.js +1 -1
  20. package/dist/components/Checkbox/Checkbox.js +56 -56
  21. package/dist/components/Checkbox/Checkbox.stories.d.ts +8 -8
  22. package/dist/components/Chip/Chip.js +3 -3
  23. package/dist/components/DatePicker/DatePicker.js +742 -639
  24. package/dist/components/DatePicker/DatePicker.stories.d.ts +8 -8
  25. package/dist/components/DatePicker/dateUtils.d.ts +2 -2
  26. package/dist/components/DatePicker/dateUtils.js +1 -1
  27. package/dist/components/DatePicker/keyboardNavigation.d.ts +1 -1
  28. package/dist/components/DatePicker/renderCalendarDays.js +1 -1
  29. package/dist/components/DatePicker/renderPeriodSelection.js +1 -1
  30. package/dist/components/Dialog/CloseIconButton.js +1 -1
  31. package/dist/components/Dialog/Dialog.js +372 -352
  32. package/dist/components/Dialog/Dialog.stories.d.ts +96 -135
  33. package/dist/components/DoubleAutocomplete/DoubleAutocomplete.d.ts +1 -1
  34. package/dist/components/DoubleAutocomplete/DoubleAutocomplete.js +2 -2
  35. package/dist/components/DoubleAutocomplete/DoubleAutocomplete.stories.d.ts +1 -1
  36. package/dist/components/DoubleInput/DoubleInput.stories.d.ts +1 -1
  37. package/dist/components/Draggable/Draggable.d.ts +0 -1
  38. package/dist/components/Draggable/Draggable.js +1 -1
  39. package/dist/components/Draggable/Draggable.stories.d.ts +2 -3
  40. package/dist/components/Draggable/useDraggable.js +1 -1
  41. package/dist/components/DropdownMenu/DropdownMenu.d.ts +3 -1
  42. package/dist/components/DropdownMenu/DropdownMenu.js +39 -34
  43. package/dist/components/DropdownMenu/DropdownMenu.stories.d.ts +6 -4
  44. package/dist/components/EllipsisTooltip/EllipsisTooltip.stories.d.ts +4 -4
  45. package/dist/components/IconButton/IconButton.js +1 -1
  46. package/dist/components/Input/Input.js +335 -320
  47. package/dist/components/InputSearch/InputSearch.d.ts +31 -31
  48. package/dist/components/InputSearch/InputSearch.stories.d.ts +31 -31
  49. package/dist/components/Popover/Popover.d.ts +3 -3
  50. package/dist/components/Popover/Popover.js +2 -2
  51. package/dist/components/Popover/Popover.stories.d.ts +3 -3
  52. package/dist/components/Popover/PopoverBody.d.ts +0 -1
  53. package/dist/components/Popover/PopoverFooter.d.ts +0 -1
  54. package/dist/components/Popover/PopoverHeader.d.ts +0 -1
  55. package/dist/components/RadioButton/RadioButton.d.ts +0 -1
  56. package/dist/components/RadioButton/RadioButton.js +684 -769
  57. package/dist/components/RadioButton/RadioOption.d.ts +0 -1
  58. package/dist/components/RadioButton/RadioOption.js +3 -3
  59. package/dist/components/ResultContainer/ResultContainer.d.ts +0 -1
  60. package/dist/components/ResultContainer/ResultContainer.stories.d.ts +9 -9
  61. package/dist/components/ResultWithChips/ResultWithChips.js +1 -1
  62. package/dist/components/ResultWithChips/ResultWithChips.stories.d.ts +9 -9
  63. package/dist/components/RowItem/RowItem.js +2 -2
  64. package/dist/components/Select/Select.js +625 -591
  65. package/dist/components/Skeleton/Skeleton.d.ts +0 -1
  66. package/dist/components/Snackbar/Snackbar.js +295 -239
  67. package/dist/components/Snackbar/Snackbar.stories.d.ts +113 -113
  68. package/dist/components/StepperNavigator/StepperNavigator.d.ts +0 -1
  69. package/dist/components/Table/Table.stories.d.ts +5 -5
  70. package/dist/components/Tabs/Tab.js +107 -98
  71. package/dist/components/Tabs/TabPanel.js +58 -55
  72. package/dist/components/Tabs/Tabs.js +246 -231
  73. package/dist/components/ToastCard/ToastCard.js +31 -31
  74. package/dist/components/Toggle/Toggle.js +147 -137
  75. package/dist/components/Toggle/Toggle.stories.d.ts +5 -5
  76. package/dist/components/ToggleGroup/Toggle.d.ts +0 -1
  77. package/dist/components/ToggleGroup/Toggle.js +2 -2
  78. package/dist/components/ToggleGroup/ToggleGroup.js +1 -1
  79. package/dist/components/ToggleGroup/ToggleGroup.stories.d.ts +1 -1
  80. package/dist/components/Tooltip/Tooltip.js +266 -325
  81. package/dist/components/Tooltip/Tooltip.stories.d.ts +4 -4
  82. package/dist/components/TransactionRow/TransactionRow.stories.d.ts +21 -21
  83. package/dist/contexts/DraggableProvider/DraggableProvider.d.ts +0 -1
  84. package/dist/contexts/DraggableProvider/DraggableProvider.js +1 -1
  85. package/dist/contexts/SnackbarProvider/SnackbarProvider.js +1 -1
  86. package/dist/{dayjs.min-ClQKmc--.js → dayjs.min-BtgZiFZY.js} +14 -14
  87. package/dist/getReactElementRef-iorwYm2A.js +19 -0
  88. package/dist/{index-1UpBa69h.js → index-ew-96uBP.js} +2129 -2128
  89. package/dist/isFocusVisible-CPZqtjv2.js +12 -0
  90. package/dist/main.js +2 -2
  91. package/dist/{ownerDocument-By592Iy6.js → ownerDocument-CU-LCrtd.js} +1 -1
  92. package/dist/react-BTbo_5A3.js +526 -0
  93. package/dist/setRef-Bo0HEdBB.js +6 -0
  94. package/dist/useButton-C2E_LFJp.js +90 -0
  95. package/dist/useControlled-BYdyS7Pn.js +31 -0
  96. package/dist/useId-CK6Kn3Tn.js +21 -0
  97. package/dist/useList-BLW78Lq7.js +446 -0
  98. package/dist/utils/draggable.d.ts +2 -2
  99. package/package.json +1 -1
  100. package/dist/Button-BrEDdtHO.js +0 -130
  101. package/dist/Popup-Dffqo7wT.js +0 -1246
  102. package/dist/RadioOption-DYovqiwF.js +0 -720
  103. package/dist/combineHooksSlotProps-BhQ14uyD.js +0 -79
  104. package/dist/exactProp-SYjL19cU.js +0 -13
  105. package/dist/react-BvI-Sw9b.js +0 -509
  106. package/dist/useButton-CezPDte8.js +0 -105
  107. package/dist/useControlled-CCMYYdCM.js +0 -31
  108. package/dist/useId-BW-oWmul.js +0 -19
  109. package/dist/useIsFocusVisible-BH4IAdcw.js +0 -69
  110. package/dist/useList-nqLfZem8.js +0 -435
  111. package/dist/useSlotProps-CYHDC4TN.js +0 -834
  112. package/dist/useTimeout-DxF9kiZL.js +0 -36
@@ -1,285 +1,226 @@
1
- import { jsx as y, jsxs as I, Fragment as et } from "react/jsx-runtime";
2
- import * as F from "react";
3
- import { useRef as ot, useState as G, useEffect as J, isValidElement as nt, cloneElement as it } from "react";
4
- import { T as at, P as lt } from "../../Popup-Dffqo7wT.js";
5
- import { c as X } from "../../clsx-OuTLNxxd.js";
6
- import { b as rt, _ as st, P as O } from "../../useSlotProps-CYHDC4TN.js";
7
- import { C as ct } from "../../ClickAwayListener-Z08peX_P.js";
8
- import '../../assets/Tooltip.css';function pt() {
9
- const t = F.useContext(at);
1
+ import { jsx as h, jsxs as P, Fragment as B } from "react/jsx-runtime";
2
+ import * as r from "react";
3
+ import { useRef as W, useState as O, useEffect as D, isValidElement as Y, cloneElement as G } from "react";
4
+ import { T as J, P as K, f as Q } from "../../Popup-D267EI4e.js";
5
+ import { c as L } from "../../clsx-OuTLNxxd.js";
6
+ import { P as d } from "../../ClassNameConfigurator-CVRWfyIa.js";
7
+ import '../../assets/Tooltip.css';function Z() {
8
+ const t = r.useContext(J);
10
9
  if (!t)
11
10
  throw new Error("Missing transition context");
12
11
  const {
13
12
  registerTransition: e,
14
13
  requestedEnter: i,
15
- onExited: a
14
+ onExited: o
16
15
  } = t;
17
- return F.useEffect(() => e(), [e]), {
18
- onExited: a,
16
+ return r.useEffect(() => e(), [e]), {
17
+ onExited: o,
19
18
  requestedEnter: i
20
19
  };
21
20
  }
22
- const ut = ["children", "className", "enterAnimationName", "enterClassName", "exitAnimationName", "exitClassName"];
23
- function Y(t) {
21
+ function S(t) {
24
22
  const {
25
23
  children: e,
26
24
  className: i,
27
- enterAnimationName: a,
28
- enterClassName: n,
29
- exitAnimationName: o,
30
- exitClassName: c
31
- } = t, l = rt(t, ut), {
32
- requestedEnter: p,
33
- onExited: h
34
- } = pt(), s = F.useRef(!0);
35
- F.useEffect(() => {
36
- p && s.current && (s.current = !1);
37
- }, [p]);
38
- const u = F.useCallback((x) => {
39
- x.animationName === o ? (h(), s.current = !0) : x.animationName === a && (s.current = !1);
40
- }, [h, o, a]);
41
- return /* @__PURE__ */ y("div", st({
42
- onAnimationEnd: u,
43
- className: X(i, p ? n : c)
44
- }, l, {
25
+ enterAnimationName: o,
26
+ enterClassName: f,
27
+ exitAnimationName: s,
28
+ exitClassName: g,
29
+ ...a
30
+ } = t, {
31
+ requestedEnter: c,
32
+ onExited: y
33
+ } = Z(), u = r.useRef(!0);
34
+ r.useEffect(() => {
35
+ c && u.current && (u.current = !1);
36
+ }, [c]);
37
+ const _ = r.useCallback((E) => {
38
+ E.animationName === s ? (y(), u.current = !0) : E.animationName === o && (u.current = !1);
39
+ }, [y, s, o]);
40
+ return /* @__PURE__ */ h("div", {
41
+ onAnimationEnd: _,
42
+ className: L(i, c ? f : g),
43
+ ...a,
45
44
  children: e
46
- }));
45
+ });
47
46
  }
48
- process.env.NODE_ENV !== "production" && (Y.propTypes = {
49
- children: O.node,
50
- className: O.string,
51
- enterAnimationName: O.string,
52
- enterClassName: O.string,
53
- exitAnimationName: O.string,
54
- exitClassName: O.string
47
+ process.env.NODE_ENV !== "production" && (S.propTypes = {
48
+ children: d.node,
49
+ className: d.string,
50
+ enterAnimationName: d.string,
51
+ enterClassName: d.string,
52
+ exitAnimationName: d.string,
53
+ exitClassName: d.string
55
54
  });
56
- const mt = {
57
- left: "right",
58
- right: "left",
59
- bottom: "top",
60
- top: "bottom"
61
- }, ft = {
62
- start: "end",
63
- end: "start"
64
- };
65
- function Z(t, e) {
66
- return typeof t == "function" ? t(e) : t;
55
+ function j(t, e) {
56
+ return process.env.NODE_ENV === "production" ? () => null : function(...o) {
57
+ return t(...o) || e(...o);
58
+ };
67
59
  }
68
- function B(t) {
69
- return t.split("-")[0];
60
+ function w() {
61
+ return w = Object.assign ? Object.assign.bind() : function(t) {
62
+ for (var e = 1; e < arguments.length; e++) {
63
+ var i = arguments[e];
64
+ for (var o in i) ({}).hasOwnProperty.call(i, o) && (t[o] = i[o]);
65
+ }
66
+ return t;
67
+ }, w.apply(null, arguments);
70
68
  }
71
69
  function H(t) {
72
- return t.split("-")[1];
73
- }
74
- function _t(t) {
75
- return t === "x" ? "y" : "x";
70
+ const {
71
+ prototype: e = {}
72
+ } = t;
73
+ return !!e.isReactComponent;
76
74
  }
77
- function ht(t) {
78
- return t === "y" ? "height" : "width";
75
+ function q(t, e, i, o, f) {
76
+ const s = t[e], g = f || e;
77
+ if (s == null || // When server-side rendering React doesn't warn either.
78
+ // This is not an accurate check for SSR.
79
+ // This is only in place for Emotion compat.
80
+ // TODO: Revisit once https://github.com/facebook/react/issues/20047 is resolved.
81
+ typeof window > "u")
82
+ return null;
83
+ let a;
84
+ const c = s.type;
85
+ return typeof c == "function" && !H(c) && (a = "Did you accidentally use a plain function component for an element instead?"), a !== void 0 ? new Error(`Invalid ${o} \`${g}\` supplied to \`${i}\`. Expected an element that can hold a ref. ${a} For more information see https://mui.com/r/caveat-with-refs-guide`) : null;
79
86
  }
80
- const gt = /* @__PURE__ */ new Set(["top", "bottom"]);
81
- function D(t) {
82
- return gt.has(B(t)) ? "y" : "x";
87
+ const V = j(d.element, q);
88
+ V.isRequired = j(d.element.isRequired, q);
89
+ const tt = "exact-prop: ";
90
+ function et(t) {
91
+ return process.env.NODE_ENV === "production" ? t : w({}, t, {
92
+ [tt]: (e) => {
93
+ const i = Object.keys(e).filter((o) => !t.hasOwnProperty(o));
94
+ return i.length > 0 ? new Error(`The following props are not supported: ${i.map((o) => `\`${o}\``).join(", ")}. Please remove them.`) : null;
95
+ }
96
+ });
83
97
  }
84
- function dt(t) {
85
- return _t(D(t));
98
+ function k(t) {
99
+ return t && t.ownerDocument || document;
86
100
  }
87
- function yt(t, e, i) {
88
- i === void 0 && (i = !1);
89
- const a = H(t), n = dt(t), o = ht(n);
90
- let c = n === "x" ? a === (i ? "end" : "start") ? "right" : "left" : a === "start" ? "bottom" : "top";
91
- return e.reference[o] > e.floating[o] && (c = $(c)), [c, $(c)];
101
+ function nt(t, e) {
102
+ typeof t == "function" ? t(e) : t && (t.current = e);
92
103
  }
93
- function xt(t) {
94
- const e = $(t);
95
- return [z(t), e, z(e)];
104
+ const ot = typeof window < "u" ? r.useLayoutEffect : r.useEffect;
105
+ function it(t) {
106
+ const e = r.useRef(t);
107
+ return ot(() => {
108
+ e.current = t;
109
+ }), r.useRef((...i) => (
110
+ // @ts-expect-error hide `this`
111
+ (0, e.current)(...i)
112
+ )).current;
96
113
  }
97
- function z(t) {
98
- return t.replace(/start|end/g, (e) => ft[e]);
114
+ function rt(...t) {
115
+ return r.useMemo(() => t.every((e) => e == null) ? null : (e) => {
116
+ t.forEach((i) => {
117
+ nt(i, e);
118
+ });
119
+ }, t);
99
120
  }
100
- const K = ["left", "right"], Q = ["right", "left"], bt = ["top", "bottom"], vt = ["bottom", "top"];
101
- function wt(t, e, i) {
102
- switch (t) {
103
- case "top":
104
- case "bottom":
105
- return i ? e ? Q : K : e ? K : Q;
106
- case "left":
107
- case "right":
108
- return e ? bt : vt;
109
- default:
110
- return [];
121
+ function at(t) {
122
+ if (parseInt(r.version, 10) >= 19) {
123
+ var e;
124
+ return (t == null || (e = t.props) == null ? void 0 : e.ref) || null;
111
125
  }
126
+ return (t == null ? void 0 : t.ref) || null;
112
127
  }
113
- function At(t, e, i, a) {
114
- const n = H(t);
115
- let o = wt(B(t), i === "start", a);
116
- return n && (o = o.map((c) => c + "-" + n), e && (o = o.concat(o.map(z)))), o;
117
- }
118
- function $(t) {
119
- return t.replace(/left|right|bottom|top/g, (e) => mt[e]);
120
- }
121
- function Pt(t) {
122
- return {
123
- top: 0,
124
- right: 0,
125
- bottom: 0,
126
- left: 0,
127
- ...t
128
- };
129
- }
130
- function Nt(t) {
131
- return typeof t != "number" ? Pt(t) : {
132
- top: t,
133
- right: t,
134
- bottom: t,
135
- left: t
136
- };
128
+ function M(t) {
129
+ return t.substring(2).toLowerCase();
137
130
  }
138
- function U(t) {
139
- const {
140
- x: e,
141
- y: i,
142
- width: a,
143
- height: n
144
- } = t;
145
- return {
146
- width: a,
147
- height: n,
148
- top: i,
149
- left: e,
150
- right: e + a,
151
- bottom: i + n,
152
- x: e,
153
- y: i
154
- };
131
+ function st(t, e) {
132
+ return e.documentElement.clientWidth < t.clientX || e.documentElement.clientHeight < t.clientY;
155
133
  }
156
- async function kt(t, e) {
157
- var i;
158
- e === void 0 && (e = {});
134
+ function x(t) {
159
135
  const {
160
- x: a,
161
- y: n,
162
- platform: o,
163
- rects: c,
164
- elements: l,
165
- strategy: p
166
- } = t, {
167
- boundary: h = "clippingAncestors",
168
- rootBoundary: s = "viewport",
169
- elementContext: u = "floating",
170
- altBoundary: x = !1,
171
- padding: S = 0
172
- } = Z(e, t), r = Nt(S), m = l[x ? u === "floating" ? "reference" : "floating" : u], b = U(await o.getClippingRect({
173
- element: (i = await (o.isElement == null ? void 0 : o.isElement(m))) == null || i ? m : m.contextElement || await (o.getDocumentElement == null ? void 0 : o.getDocumentElement(l.floating)),
174
- boundary: h,
175
- rootBoundary: s,
176
- strategy: p
177
- })), g = u === "floating" ? {
178
- x: a,
179
- y: n,
180
- width: c.floating.width,
181
- height: c.floating.height
182
- } : c.reference, P = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(l.floating)), d = await (o.isElement == null ? void 0 : o.isElement(P)) ? await (o.getScale == null ? void 0 : o.getScale(P)) || {
183
- x: 1,
184
- y: 1
185
- } : {
186
- x: 1,
187
- y: 1
188
- }, v = U(o.convertOffsetParentRelativeRectToViewportRelativeRect ? await o.convertOffsetParentRelativeRectToViewportRelativeRect({
189
- elements: l,
190
- rect: g,
191
- offsetParent: P,
192
- strategy: p
193
- }) : g);
194
- return {
195
- top: (b.top - v.top + r.top) / d.y,
196
- bottom: (v.bottom - b.bottom + r.bottom) / d.y,
197
- left: (b.left - v.left + r.left) / d.x,
198
- right: (v.right - b.right + r.right) / d.x
199
- };
200
- }
201
- const Ct = function(t) {
202
- return t === void 0 && (t = {}), {
203
- name: "flip",
204
- options: t,
205
- async fn(e) {
206
- var i, a;
207
- const {
208
- placement: n,
209
- middlewareData: o,
210
- rects: c,
211
- initialPlacement: l,
212
- platform: p,
213
- elements: h
214
- } = e, {
215
- mainAxis: s = !0,
216
- crossAxis: u = !0,
217
- fallbackPlacements: x,
218
- fallbackStrategy: S = "bestFit",
219
- fallbackAxisSideDirection: r = "none",
220
- flipAlignment: R = !0,
221
- ...m
222
- } = Z(t, e);
223
- if ((i = o.arrow) != null && i.alignmentOffset)
224
- return {};
225
- const b = B(n), g = D(l), P = B(l) === l, d = await (p.isRTL == null ? void 0 : p.isRTL(h.floating)), v = x || (P || !R ? [$(l)] : xt(l)), T = r !== "none";
226
- !x && T && v.push(...At(l, R, r, d));
227
- const L = [l, ...v], M = await kt(e, m), E = [];
228
- let w = ((a = o.flip) == null ? void 0 : a.overflows) || [];
229
- if (s && E.push(M[b]), u) {
230
- const k = yt(n, c, d);
231
- E.push(M[k[0]], M[k[1]]);
232
- }
233
- if (w = [...w, {
234
- placement: n,
235
- overflows: E
236
- }], !E.every((k) => k <= 0)) {
237
- var V, N;
238
- const k = (((V = o.flip) == null ? void 0 : V.index) || 0) + 1, q = L[k];
239
- if (q && (!(u === "alignment" ? g !== D(q) : !1) || // We leave the current main axis only if every placement on that axis
240
- // overflows the main axis.
241
- w.every((f) => f.overflows[0] > 0 && D(f.placement) === g)))
242
- return {
243
- data: {
244
- index: k,
245
- overflows: w
246
- },
247
- reset: {
248
- placement: q
249
- }
250
- };
251
- let j = (N = w.filter((C) => C.overflows[0] <= 0).sort((C, f) => C.overflows[1] - f.overflows[1])[0]) == null ? void 0 : N.placement;
252
- if (!j)
253
- switch (S) {
254
- case "bestFit": {
255
- var W;
256
- const C = (W = w.filter((f) => {
257
- if (T) {
258
- const A = D(f.placement);
259
- return A === g || // Create a bias to the `y` side axis due to horizontal
260
- // reading directions favoring greater width.
261
- A === "y";
262
- }
263
- return !0;
264
- }).map((f) => [f.placement, f.overflows.filter((A) => A > 0).reduce((A, tt) => A + tt, 0)]).sort((f, A) => f[1] - A[1])[0]) == null ? void 0 : W[0];
265
- C && (j = C);
266
- break;
267
- }
268
- case "initialPlacement":
269
- j = l;
270
- break;
271
- }
272
- if (n !== j)
273
- return {
274
- reset: {
275
- placement: j
276
- }
277
- };
278
- }
279
- return {};
136
+ children: e,
137
+ disableReactTree: i = !1,
138
+ mouseEvent: o = "onClick",
139
+ onClickAway: f,
140
+ touchEvent: s = "onTouchEnd"
141
+ } = t, g = r.useRef(!1), a = r.useRef(null), c = r.useRef(!1), y = r.useRef(!1);
142
+ r.useEffect(() => (setTimeout(() => {
143
+ c.current = !0;
144
+ }, 0), () => {
145
+ c.current = !1;
146
+ }), []);
147
+ const u = rt(at(e), a), _ = it((n) => {
148
+ const p = y.current;
149
+ y.current = !1;
150
+ const l = k(a.current);
151
+ if (!c.current || !a.current || "clientX" in n && st(n, l))
152
+ return;
153
+ if (g.current) {
154
+ g.current = !1;
155
+ return;
280
156
  }
157
+ let v;
158
+ n.composedPath ? v = n.composedPath().indexOf(a.current) > -1 : v = !l.documentElement.contains(
159
+ // @ts-expect-error returns `false` as intended when not dispatched from a Node
160
+ n.target
161
+ ) || a.current.contains(
162
+ // @ts-expect-error returns `false` as intended when not dispatched from a Node
163
+ n.target
164
+ ), !v && (i || !p) && f(n);
165
+ }), E = (n) => (p) => {
166
+ y.current = !0;
167
+ const l = e.props[n];
168
+ l && l(p);
169
+ }, b = {
170
+ ref: u
281
171
  };
282
- }, Et = Ct, Ot = "_tooltip_1ui81_79", St = "_tooltip__container_1ui81_128", Rt = "_tooltip__title_1ui81_134", Tt = "_tooltip__content_1ui81_141", Mt = "_tooltip__footer_1ui81_148", _ = {
172
+ return s !== !1 && (b[s] = E(s)), r.useEffect(() => {
173
+ if (s !== !1) {
174
+ const n = M(s), p = k(a.current), l = () => {
175
+ g.current = !0;
176
+ };
177
+ return p.addEventListener(n, _), p.addEventListener("touchmove", l), () => {
178
+ p.removeEventListener(n, _), p.removeEventListener("touchmove", l);
179
+ };
180
+ }
181
+ }, [_, s]), o !== !1 && (b[o] = E(o)), r.useEffect(() => {
182
+ if (o !== !1) {
183
+ const n = M(o), p = k(a.current);
184
+ return p.addEventListener(n, _), () => {
185
+ p.removeEventListener(n, _);
186
+ };
187
+ }
188
+ }, [_, o]), /* @__PURE__ */ h(r.Fragment, {
189
+ children: /* @__PURE__ */ r.cloneElement(e, b)
190
+ });
191
+ }
192
+ process.env.NODE_ENV !== "production" && (x.propTypes = {
193
+ // ┌────────────────────────────── Warning ──────────────────────────────┐
194
+ // │ These PropTypes are generated from the TypeScript type definitions. │
195
+ // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
196
+ // └─────────────────────────────────────────────────────────────────────┘
197
+ /**
198
+ * The wrapped element.
199
+ */
200
+ children: V.isRequired,
201
+ /**
202
+ * If `true`, the React tree is ignored and only the DOM tree is considered.
203
+ * This prop changes how portaled elements are handled.
204
+ * @default false
205
+ */
206
+ disableReactTree: d.bool,
207
+ /**
208
+ * The mouse event to listen to. You can disable the listener by providing `false`.
209
+ * @default 'onClick'
210
+ */
211
+ mouseEvent: d.oneOf(["onClick", "onMouseDown", "onMouseUp", "onPointerDown", "onPointerUp", !1]),
212
+ /**
213
+ * Callback fired when a "click away" event is detected.
214
+ */
215
+ onClickAway: d.func.isRequired,
216
+ /**
217
+ * The touch event to listen to. You can disable the listener by providing `false`.
218
+ * @default 'onTouchEnd'
219
+ */
220
+ touchEvent: d.oneOf(["onTouchEnd", "onTouchStart", !1])
221
+ });
222
+ process.env.NODE_ENV !== "production" && (x.propTypes = et(x.propTypes));
223
+ const ut = "_tooltip_1ui81_79", lt = "_tooltip__container_1ui81_128", ct = "_tooltip__title_1ui81_134", pt = "_tooltip__content_1ui81_141", ft = "_tooltip__footer_1ui81_148", m = {
283
224
  "u-typography-h1": "_u-typography-h1_1ui81_1",
284
225
  "u-typography-h2": "_u-typography-h2_1ui81_8",
285
226
  "u-typography-h3": "_u-typography-h3_1ui81_15",
@@ -295,15 +236,15 @@ const Ct = function(t) {
295
236
  "u-typography-base--strikethrough": "_u-typography-base--strikethrough_1ui81_68",
296
237
  "u-typography-base--underlined": "_u-typography-base--underlined_1ui81_71",
297
238
  "u-typography-base--strikethrough-underlined": "_u-typography-base--strikethrough-underlined_1ui81_74",
298
- tooltip: Ot,
239
+ tooltip: ut,
299
240
  "tooltip--bottom": "_tooltip--bottom_1ui81_99",
300
241
  "tooltip--top": "_tooltip--top_1ui81_106",
301
242
  "tooltip--right": "_tooltip--right_1ui81_113",
302
243
  "tooltip--left": "_tooltip--left_1ui81_120",
303
- tooltip__container: St,
304
- tooltip__title: Rt,
305
- tooltip__content: Tt,
306
- tooltip__footer: Mt,
244
+ tooltip__container: lt,
245
+ tooltip__title: ct,
246
+ tooltip__content: pt,
247
+ tooltip__footer: ft,
307
248
  "tooltip__footer-button": "_tooltip__footer-button_1ui81_152",
308
249
  "tooltip__footer-link": "_tooltip__footer-link_1ui81_172",
309
250
  "tooltip--animation": "_tooltip--animation_1ui81_183",
@@ -311,99 +252,99 @@ const Ct = function(t) {
311
252
  "tooltip--open-animation": "_tooltip--open-animation_1ui81_1",
312
253
  "tooltip--anim-close": "_tooltip--anim-close_1ui81_186",
313
254
  "tooltip--close-animation": "_tooltip--close-animation_1ui81_1"
314
- }, $t = ({
255
+ }, gt = ({
315
256
  arialRole: t,
316
257
  children: e,
317
258
  className: i,
318
- style: a,
319
- disableHoverListener: n,
320
- onClose: o,
321
- position: c = "bottom",
322
- open: l,
323
- title: p,
324
- content: h,
325
- footer: s,
326
- onTargetCreated: u,
327
- popperZIndex: x = 9999,
328
- ...S
259
+ style: o,
260
+ disableHoverListener: f,
261
+ onClose: s,
262
+ position: g = "bottom",
263
+ open: a,
264
+ title: c,
265
+ content: y,
266
+ footer: u,
267
+ onTargetCreated: _,
268
+ popperZIndex: E = 9999,
269
+ ...b
329
270
  }) => {
330
- const r = ot(null), [R, m] = G(l || !1);
331
- let b = R;
332
- const [g, P] = G(c);
333
- J(() => {
334
- m(l || !1);
335
- }, [l]);
336
- const d = nt(e) ? e : /* @__PURE__ */ y("span", { children: e });
337
- !h && h !== 0 && (b = !1);
338
- const v = () => {
339
- o == null || o(), !n && m(!1);
271
+ const n = W(null), [p, l] = O(a || !1);
272
+ let v = p;
273
+ const [R, $] = O(g);
274
+ D(() => {
275
+ l(a || !1);
276
+ }, [a]);
277
+ const C = Y(e) ? e : /* @__PURE__ */ h("span", { children: e });
278
+ !y && y !== 0 && (v = !1);
279
+ const F = () => {
280
+ s == null || s(), !f && l(!1);
340
281
  };
341
- J(() => {
342
- if (r != null && r.current) {
343
- const N = r == null ? void 0 : r.current;
344
- u == null || u(N);
282
+ D(() => {
283
+ if (n != null && n.current) {
284
+ const N = n == null ? void 0 : n.current;
285
+ _ == null || _(N);
345
286
  }
346
- }, [r, n]);
287
+ }, [n, f]);
347
288
  const T = () => {
348
- n || m(!0);
349
- }, L = () => {
350
- n || m(!1);
351
- }, M = {
352
- padding: g.match(/(bottom|top)/) ? ".25rem 0" : "0 .25rem",
353
- zIndex: x
354
- }, E = X(_.tooltip, _[`tooltip--${g}`], i), w = {
355
- ...d.props,
356
- ref: r,
357
- onPointerEnter: n ? void 0 : () => m(!0),
358
- onPointerLeave: n ? void 0 : () => m(!1)
359
- }, V = () => ({
289
+ f || l(!0);
290
+ }, A = () => {
291
+ f || l(!1);
292
+ }, I = {
293
+ padding: R.match(/(bottom|top)/) ? ".25rem 0" : "0 .25rem",
294
+ zIndex: E
295
+ }, U = L(m.tooltip, m[`tooltip--${R}`], i), X = {
296
+ ...C.props,
297
+ ref: n,
298
+ onPointerEnter: f ? void 0 : () => l(!0),
299
+ onPointerLeave: f ? void 0 : () => l(!1)
300
+ }, z = () => ({
360
301
  name: "currentPlacement",
361
- fn: (N) => (P(N.placement), N)
302
+ fn: (N) => ($(N.placement), N)
362
303
  });
363
- return /* @__PURE__ */ I(et, { children: [
364
- it(d, w),
365
- /* @__PURE__ */ y(
366
- lt,
304
+ return /* @__PURE__ */ P(B, { children: [
305
+ G(C, X),
306
+ /* @__PURE__ */ h(
307
+ K,
367
308
  {
368
309
  disablePortal: !0,
369
- ...S,
370
- open: b,
371
- anchor: r == null ? void 0 : r.current,
372
- style: M,
310
+ ...b,
311
+ open: v,
312
+ anchor: n == null ? void 0 : n.current,
313
+ style: I,
373
314
  role: t,
374
- placement: g,
315
+ placement: R,
375
316
  onPointerEnter: T,
376
- onPointerLeave: L,
317
+ onPointerLeave: A,
377
318
  "data-testid": "popup",
378
- middleware: [Et(), V()],
379
- children: /* @__PURE__ */ y(
380
- Y,
319
+ middleware: [Q(), z()],
320
+ children: /* @__PURE__ */ h(
321
+ S,
381
322
  {
382
- className: _["tooltip--animation"],
383
- enterClassName: _["tooltip--anim-open"],
384
- exitClassName: _["tooltip--anim-close"],
323
+ className: m["tooltip--animation"],
324
+ enterClassName: m["tooltip--anim-open"],
325
+ exitClassName: m["tooltip--anim-close"],
385
326
  enterAnimationName: "tooltip--open-animation",
386
327
  exitAnimationName: "tooltip--close-animation",
387
- children: /* @__PURE__ */ y(
328
+ children: /* @__PURE__ */ h(
388
329
  "div",
389
330
  {
390
- className: E,
391
- style: a,
331
+ className: U,
332
+ style: o,
392
333
  onPointerEnter: T,
393
- onPointerLeave: L,
394
- children: /* @__PURE__ */ y(ct, { onClickAway: v, children: /* @__PURE__ */ I("div", { className: _.tooltip__container, children: [
395
- p && /* @__PURE__ */ y("div", { className: _.tooltip__title, children: p }),
396
- /* @__PURE__ */ y("div", { className: _.tooltip__content, children: h }),
397
- s && /* @__PURE__ */ I("div", { className: _.tooltip__footer, children: [
398
- s.type === "button" && s.onClick && /* @__PURE__ */ y("button", { onClick: s.onClick, className: _["tooltip__footer-button"], children: s.label }),
399
- s.type === "link" && s.href && /* @__PURE__ */ y(
334
+ onPointerLeave: A,
335
+ children: /* @__PURE__ */ h(x, { onClickAway: F, children: /* @__PURE__ */ P("div", { className: m.tooltip__container, children: [
336
+ c && /* @__PURE__ */ h("div", { className: m.tooltip__title, children: c }),
337
+ /* @__PURE__ */ h("div", { className: m.tooltip__content, children: y }),
338
+ u && /* @__PURE__ */ P("div", { className: m.tooltip__footer, children: [
339
+ u.type === "button" && u.onClick && /* @__PURE__ */ h("button", { onClick: u.onClick, className: m["tooltip__footer-button"], children: u.label }),
340
+ u.type === "link" && u.href && /* @__PURE__ */ h(
400
341
  "a",
401
342
  {
402
- href: s.href,
403
- className: _["tooltip__footer-link"],
343
+ href: u.href,
344
+ className: m["tooltip__footer-link"],
404
345
  target: "_blank",
405
346
  rel: "noopener noreferrer",
406
- children: s.label
347
+ children: u.label
407
348
  }
408
349
  )
409
350
  ] })
@@ -417,5 +358,5 @@ const Ct = function(t) {
417
358
  ] });
418
359
  };
419
360
  export {
420
- $t as Tooltip
361
+ gt as Tooltip
421
362
  };