@alixpartners/ui-components 2.0.0-beta.8 → 2.0.0

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 (87) hide show
  1. package/dist/ap-logos-Cl1TR5nm.js +4 -0
  2. package/dist/assets/Banner.css +1 -1
  3. package/dist/assets/Button.css +1 -1
  4. package/dist/assets/Checkbox.css +1 -1
  5. package/dist/assets/Dialog.css +1 -1
  6. package/dist/assets/DragAndDrop.css +1 -1
  7. package/dist/assets/Dropdown.css +1 -1
  8. package/dist/assets/Input.css +1 -1
  9. package/dist/assets/LogosGallery.css +1 -0
  10. package/dist/assets/NavBar.css +1 -1
  11. package/dist/assets/SplitButton.css +1 -1
  12. package/dist/assets/TabNavigation.css +1 -1
  13. package/dist/assets/Tag.css +1 -1
  14. package/dist/assets/Textarea.css +1 -1
  15. package/dist/assets/Toast.css +1 -1
  16. package/dist/assets/Tooltip.css +1 -1
  17. package/dist/assets/ap-icons-types.d.ts +1 -1
  18. package/dist/assets/ap-icons.d.ts +1 -1
  19. package/dist/assets/ap-logos-types.d.ts +1 -0
  20. package/dist/assets/ap-logos.d.ts +1 -0
  21. package/dist/assets/main.css +1 -1
  22. package/dist/components/Banner/Banner.d.ts +4 -2
  23. package/dist/components/Banner/Banner.js +23 -21
  24. package/dist/components/Button/Button.d.ts +13 -14
  25. package/dist/components/Button/Button.js +27 -25
  26. package/dist/components/Checkbox/Checkbox.d.ts +4 -2
  27. package/dist/components/Checkbox/Checkbox.js +141 -138
  28. package/dist/components/Creatable/Creatable.d.ts +6 -2
  29. package/dist/components/Creatable/Creatable.js +29 -14
  30. package/dist/components/Dialog/Dialog.d.ts +16 -4
  31. package/dist/components/Dialog/Dialog.js +58 -41
  32. package/dist/components/DragAndDrop/DragAndDrop.d.ts +10 -5
  33. package/dist/components/DragAndDrop/DragAndDrop.js +81 -70
  34. package/dist/components/Dropdown/Dropdown.d.ts +11 -2
  35. package/dist/components/Dropdown/Dropdown.js +383 -345
  36. package/dist/components/Ghost/Ghost.d.ts +4 -2
  37. package/dist/components/Ghost/Ghost.js +18 -15
  38. package/dist/components/Icons/IconsGallery.js +1 -1
  39. package/dist/components/Input/Input.d.ts +25 -22
  40. package/dist/components/Input/Input.js +62 -58
  41. package/dist/components/Logo/Logo.d.ts +8 -0
  42. package/dist/components/Logo/Logo.js +57 -0
  43. package/dist/components/Logos/LogosGallery.d.ts +1 -0
  44. package/dist/components/Logos/LogosGallery.js +16 -0
  45. package/dist/components/NavBar/NavBar.d.ts +14 -5
  46. package/dist/components/NavBar/NavBar.js +241 -224
  47. package/dist/components/Radio/Radio.d.ts +3 -2
  48. package/dist/components/Radio/Radio.js +1 -1
  49. package/dist/components/RadioGroup/RadioGroup.d.ts +4 -2
  50. package/dist/components/RadioGroup/RadioGroup.js +14 -13
  51. package/dist/components/Search/Search.d.ts +6 -4
  52. package/dist/components/Search/Search.js +20 -18
  53. package/dist/components/SplitButton/SplitButton.d.ts +4 -2
  54. package/dist/components/SplitButton/SplitButton.js +115 -106
  55. package/dist/components/Tab/Tab.d.ts +4 -2
  56. package/dist/components/Tab/Tab.js +27 -24
  57. package/dist/components/TabNavigation/TabNavigation.d.ts +3 -1
  58. package/dist/components/TabNavigation/TabNavigation.js +15 -8
  59. package/dist/components/Tag/Tag.d.ts +2 -1
  60. package/dist/components/Tag/Tag.js +8 -8
  61. package/dist/components/TagsFields/TagsFields.d.ts +4 -2
  62. package/dist/components/TagsFields/TagsFields.js +7 -6
  63. package/dist/components/Textarea/Textarea.d.ts +7 -5
  64. package/dist/components/Textarea/Textarea.js +27 -25
  65. package/dist/components/Toast/Toast.d.ts +4 -2
  66. package/dist/components/Toast/Toast.js +23 -22
  67. package/dist/components/Toast/Toast.test.js +1 -1
  68. package/dist/components/Toggle/Toggle.d.ts +4 -2
  69. package/dist/components/Toggle/Toggle.js +80 -78
  70. package/dist/components/Tooltip/Tooltip.d.ts +2 -1
  71. package/dist/components/Tooltip/Tooltip.js +376 -123
  72. package/dist/index-2H7slGYV.js +23 -0
  73. package/dist/index-BGZDIjm9.js +674 -0
  74. package/dist/{index-snhwePGJ.js → index-BJXIvJs4.js} +3 -3
  75. package/dist/{index-DNvS1y4S.js → index-CVWHq7Pr.js} +33 -32
  76. package/dist/{index-DrL-TXFC.js → index-CjQV7MmW.js} +2 -2
  77. package/dist/index-DWydnyjJ.js +245 -0
  78. package/dist/index-DieLVN0p.js +1664 -0
  79. package/dist/{index-BvhDRUM9.js → index-DpfPnSMn.js} +1 -1
  80. package/dist/main.d.ts +10 -8
  81. package/dist/main.js +29 -25
  82. package/dist/storybook-docs-page.d.ts +4 -1
  83. package/dist/types/native-events.d.ts +80 -0
  84. package/package.json +1 -1
  85. package/dist/index-Bx8a_H5C.js +0 -2331
  86. package/dist/index-CVlmPg9Z.js +0 -239
  87. package/dist/index-k9IXwz5f.js +0 -23
@@ -1,9 +1,10 @@
1
1
  import * as r from "react";
2
- import { c as je, d as N, a as v, P as F, f as He, g as We, b as ze } from "./index-CVlmPg9Z.js";
3
- import { u as Ze, a as $e, c as pe, I as qe, R as Je } from "./index-DrL-TXFC.js";
4
- import { c as ve, R as Qe, A as et, P as tt, h as nt, u as ot, a as rt, F as ct, D as at, C as st, b as ut } from "./index-Bx8a_H5C.js";
5
- import { P as H } from "./index-BvhDRUM9.js";
6
- import { a as Me } from "./index-k9IXwz5f.js";
2
+ import { c as je, d as N, a as v, P as F, f as He, g as We, b as ze } from "./index-DWydnyjJ.js";
3
+ import { a as Ze, c as pe, u as $e, I as qe, R as Je } from "./index-CjQV7MmW.js";
4
+ import { c as ve, R as Qe, A as et, P as tt, D as nt, C as ot, a as rt } from "./index-DieLVN0p.js";
5
+ import { h as ct, u as at, R as st, F as ut } from "./index-BGZDIjm9.js";
6
+ import { P as H } from "./index-DpfPnSMn.js";
7
+ import { a as Me } from "./index-2H7slGYV.js";
7
8
  import { jsx as u } from "react/jsx-runtime";
8
9
  var Q = ["Enter", " "], it = ["ArrowDown", "PageUp", "Home"], he = ["ArrowUp", "PageDown", "End"], lt = [...it, ...he], dt = {
9
10
  ltr: [...Q, "ArrowRight"],
@@ -11,12 +12,12 @@ var Q = ["Enter", " "], it = ["ArrowDown", "PageUp", "Home"], he = ["ArrowUp", "
11
12
  }, ft = {
12
13
  ltr: ["ArrowLeft"],
13
14
  rtl: ["ArrowRight"]
14
- }, L = "Menu", [O, mt, pt] = $e(L), [w, Yt] = je(L, [
15
+ }, L = "Menu", [O, mt, pt] = Ze(L), [w, Xt] = je(L, [
15
16
  pt,
16
17
  ve,
17
18
  pe
18
19
  ]), W = ve(), Ce = pe(), [vt, I] = w(L), [Mt, K] = w(L), ge = (e) => {
19
- const { __scopeMenu: n, open: t = !1, children: o, dir: s, onOpenChange: c, modal: d = !0 } = e, p = W(n), [M, m] = r.useState(null), f = r.useRef(!1), a = Me(c), l = Ze(s);
20
+ const { __scopeMenu: n, open: t = !1, children: o, dir: s, onOpenChange: c, modal: d = !0 } = e, p = W(n), [M, m] = r.useState(null), f = r.useRef(!1), a = Me(c), l = $e(s);
20
21
  return r.useEffect(() => {
21
22
  const C = () => {
22
23
  f.current = !0, document.addEventListener("pointerdown", h, { capture: !0, once: !0 }), document.addEventListener("pointermove", h, { capture: !0, once: !0 });
@@ -71,7 +72,7 @@ var _ = "MenuContent", [gt, ne] = w(_), Pe = r.forwardRef(
71
72
  const t = I(_, e.__scopeMenu), o = r.useRef(null), s = N(n, o);
72
73
  return r.useEffect(() => {
73
74
  const c = o.current;
74
- if (c) return nt(c);
75
+ if (c) return ct(c);
75
76
  }, []), /* @__PURE__ */ u(
76
77
  oe,
77
78
  {
@@ -119,14 +120,14 @@ var _ = "MenuContent", [gt, ne] = w(_), Pe = r.forwardRef(
119
120
  onDismiss: C,
120
121
  disableOutsideScroll: h,
121
122
  ...S
122
- } = e, y = I(_, t), T = K(_, t), G = W(t), U = Ce(t), se = mt(t), [Ge, ue] = r.useState(null), B = r.useRef(null), Ue = N(n, B, y.onContentChange), V = r.useRef(0), Y = r.useRef(""), Be = r.useRef(0), Z = r.useRef(null), ie = r.useRef("right"), $ = r.useRef(0), Ve = h ? rt : r.Fragment, Ye = h ? { as: Pt, allowPinchZoom: !0 } : void 0, Xe = (i) => {
123
+ } = e, y = I(_, t), T = K(_, t), G = W(t), U = Ce(t), se = mt(t), [Ge, ue] = r.useState(null), B = r.useRef(null), Ue = N(n, B, y.onContentChange), V = r.useRef(0), Y = r.useRef(""), Be = r.useRef(0), Z = r.useRef(null), ie = r.useRef("right"), $ = r.useRef(0), Ve = h ? st : r.Fragment, Ye = h ? { as: Pt, allowPinchZoom: !0 } : void 0, Xe = (i) => {
123
124
  var x, de;
124
125
  const g = Y.current + i, R = se().filter((P) => !P.disabled), E = document.activeElement, q = (x = R.find((P) => P.ref.current === E)) == null ? void 0 : x.textValue, J = R.map((P) => P.textValue), le = kt(J, g, q), A = (de = R.find((P) => P.textValue === le)) == null ? void 0 : de.ref.current;
125
126
  (function P(fe) {
126
127
  Y.current = fe, window.clearTimeout(V.current), fe !== "" && (V.current = window.setTimeout(() => P(""), 1e3));
127
128
  })(g), A && setTimeout(() => A.focus());
128
129
  };
129
- r.useEffect(() => () => window.clearTimeout(V.current), []), ot();
130
+ r.useEffect(() => () => window.clearTimeout(V.current), []), at();
130
131
  const b = r.useCallback((i) => {
131
132
  var R, E;
132
133
  return ie.current === ((R = Z.current) == null ? void 0 : R.side) && Ft(i, (E = Z.current) == null ? void 0 : E.area);
@@ -160,7 +161,7 @@ var _ = "MenuContent", [gt, ne] = w(_), Pe = r.forwardRef(
160
161
  Z.current = i;
161
162
  }, []),
162
163
  children: /* @__PURE__ */ u(Ve, { ...Ye, children: /* @__PURE__ */ u(
163
- ct,
164
+ ut,
164
165
  {
165
166
  asChild: !0,
166
167
  trapped: s,
@@ -170,7 +171,7 @@ var _ = "MenuContent", [gt, ne] = w(_), Pe = r.forwardRef(
170
171
  }),
171
172
  onUnmountAutoFocus: d,
172
173
  children: /* @__PURE__ */ u(
173
- at,
174
+ nt,
174
175
  {
175
176
  asChild: !0,
176
177
  disableOutsidePointerEvents: p,
@@ -194,7 +195,7 @@ var _ = "MenuContent", [gt, ne] = w(_), Pe = r.forwardRef(
194
195
  }),
195
196
  preventScrollOnEntryFocus: !0,
196
197
  children: /* @__PURE__ */ u(
197
- st,
198
+ ot,
198
199
  {
199
200
  role: "menu",
200
201
  "aria-orientation": "vertical",
@@ -422,11 +423,11 @@ De.displayName = xt;
422
423
  var Tt = "MenuArrow", Oe = r.forwardRef(
423
424
  (e, n) => {
424
425
  const { __scopeMenu: t, ...o } = e, s = W(t);
425
- return /* @__PURE__ */ u(ut, { ...s, ...o, ref: n });
426
+ return /* @__PURE__ */ u(rt, { ...s, ...o, ref: n });
426
427
  }
427
428
  );
428
429
  Oe.displayName = Tt;
429
- var At = "MenuSub", [Xt, ke] = w(At), D = "MenuSubTrigger", Ne = r.forwardRef(
430
+ var At = "MenuSub", [jt, ke] = w(At), D = "MenuSubTrigger", Ne = r.forwardRef(
430
431
  (e, n) => {
431
432
  const t = I(D, e.__scopeMenu), o = K(D, e.__scopeMenu), s = ke(D, e.__scopeMenu), c = ne(D, e.__scopeMenu), d = r.useRef(null), { pointerGraceTimerRef: p, onPointerGraceIntentChange: M } = c, m = { __scopeMenu: e.__scopeMenu }, f = r.useCallback(() => {
432
433
  d.current && window.clearTimeout(d.current), d.current = null;
@@ -576,22 +577,22 @@ function Ft(e, n) {
576
577
  function k(e) {
577
578
  return (n) => n.pointerType === "mouse" ? e(n) : void 0;
578
579
  }
579
- var jt = ge, Ht = ee, Wt = Re, zt = Pe, Zt = re, $t = Ee, qt = z, Jt = we, Qt = ye, en = xe, tn = Ae, nn = De, on = Oe, rn = Ne, cn = Le;
580
+ var Ht = ge, Wt = ee, zt = Re, Zt = Pe, $t = re, qt = Ee, Jt = z, Qt = we, en = ye, tn = xe, nn = Ae, on = De, rn = Oe, cn = Ne, an = Le;
580
581
  export {
581
- Ht as A,
582
- zt as C,
583
- Zt as G,
584
- qt as I,
585
- $t as L,
586
- Wt as P,
587
- jt as R,
588
- nn as S,
589
- Jt as a,
590
- Qt as b,
591
- Yt as c,
592
- en as d,
593
- tn as e,
594
- on as f,
595
- rn as g,
596
- cn as h
582
+ Wt as A,
583
+ Zt as C,
584
+ $t as G,
585
+ Jt as I,
586
+ qt as L,
587
+ zt as P,
588
+ Ht as R,
589
+ on as S,
590
+ Qt as a,
591
+ en as b,
592
+ Xt as c,
593
+ tn as d,
594
+ nn as e,
595
+ rn as f,
596
+ cn as g,
597
+ an as h
597
598
  };
@@ -1,8 +1,8 @@
1
1
  import * as i from "react";
2
2
  import S from "react";
3
- import { c as L, d as P, g as G, P as K, a as A, u as $ } from "./index-CVlmPg9Z.js";
3
+ import { c as L, d as P, g as G, P as K, a as A, u as $ } from "./index-DWydnyjJ.js";
4
4
  import { jsx as m } from "react/jsx-runtime";
5
- import { u as J, a as Q } from "./index-k9IXwz5f.js";
5
+ import { u as J, a as Q } from "./index-2H7slGYV.js";
6
6
  function W(e) {
7
7
  const o = e + "CollectionProvider", [u, n] = L(o), [_, v] = u(
8
8
  o,
@@ -0,0 +1,245 @@
1
+ import * as c from "react";
2
+ import * as P from "react-dom";
3
+ import { jsx as S, Fragment as R } from "react/jsx-runtime";
4
+ function v(t, e) {
5
+ if (typeof t == "function")
6
+ return t(e);
7
+ t != null && (t.current = e);
8
+ }
9
+ function C(...t) {
10
+ return (e) => {
11
+ let o = !1;
12
+ const r = t.map((n) => {
13
+ const s = v(n, e);
14
+ return !o && typeof s == "function" && (o = !0), s;
15
+ });
16
+ if (o)
17
+ return () => {
18
+ for (let n = 0; n < r.length; n++) {
19
+ const s = r[n];
20
+ typeof s == "function" ? s() : v(t[n], null);
21
+ }
22
+ };
23
+ };
24
+ }
25
+ function j(...t) {
26
+ return c.useCallback(C(...t), t);
27
+ }
28
+ // @__NO_SIDE_EFFECTS__
29
+ function E(t) {
30
+ const e = /* @__PURE__ */ _(t), o = c.forwardRef((r, n) => {
31
+ const { children: s, ...u } = r, i = c.Children.toArray(s), l = i.find($);
32
+ if (l) {
33
+ const f = l.props.children, d = i.map((a) => a === l ? c.Children.count(f) > 1 ? c.Children.only(null) : c.isValidElement(f) ? f.props.children : null : a);
34
+ return /* @__PURE__ */ S(e, { ...u, ref: n, children: c.isValidElement(f) ? c.cloneElement(f, void 0, d) : null });
35
+ }
36
+ return /* @__PURE__ */ S(e, { ...u, ref: n, children: s });
37
+ });
38
+ return o.displayName = `${t}.Slot`, o;
39
+ }
40
+ // @__NO_SIDE_EFFECTS__
41
+ function _(t) {
42
+ const e = c.forwardRef((o, r) => {
43
+ const { children: n, ...s } = o;
44
+ if (c.isValidElement(n)) {
45
+ const u = O(n), i = z(s, n.props);
46
+ return n.type !== c.Fragment && (i.ref = r ? C(r, u) : u), c.cloneElement(n, i);
47
+ }
48
+ return c.Children.count(n) > 1 ? c.Children.only(null) : null;
49
+ });
50
+ return e.displayName = `${t}.SlotClone`, e;
51
+ }
52
+ var x = Symbol("radix.slottable");
53
+ // @__NO_SIDE_EFFECTS__
54
+ function B(t) {
55
+ const e = ({ children: o }) => /* @__PURE__ */ S(R, { children: o });
56
+ return e.displayName = `${t}.Slottable`, e.__radixId = x, e;
57
+ }
58
+ function $(t) {
59
+ return c.isValidElement(t) && typeof t.type == "function" && "__radixId" in t.type && t.type.__radixId === x;
60
+ }
61
+ function z(t, e) {
62
+ const o = { ...e };
63
+ for (const r in e) {
64
+ const n = t[r], s = e[r];
65
+ /^on[A-Z]/.test(r) ? n && s ? o[r] = (...i) => {
66
+ const l = s(...i);
67
+ return n(...i), l;
68
+ } : n && (o[r] = n) : r === "style" ? o[r] = { ...n, ...s } : r === "className" && (o[r] = [n, s].filter(Boolean).join(" "));
69
+ }
70
+ return { ...t, ...o };
71
+ }
72
+ function O(t) {
73
+ var r, n;
74
+ let e = (r = Object.getOwnPropertyDescriptor(t.props, "ref")) == null ? void 0 : r.get, o = e && "isReactWarning" in e && e.isReactWarning;
75
+ return o ? t.ref : (e = (n = Object.getOwnPropertyDescriptor(t, "ref")) == null ? void 0 : n.get, o = e && "isReactWarning" in e && e.isReactWarning, o ? t.props.ref : t.props.ref || t.ref);
76
+ }
77
+ var N = [
78
+ "a",
79
+ "button",
80
+ "div",
81
+ "form",
82
+ "h2",
83
+ "h3",
84
+ "img",
85
+ "input",
86
+ "label",
87
+ "li",
88
+ "nav",
89
+ "ol",
90
+ "p",
91
+ "select",
92
+ "span",
93
+ "svg",
94
+ "ul"
95
+ ], k = N.reduce((t, e) => {
96
+ const o = /* @__PURE__ */ E(`Primitive.${e}`), r = c.forwardRef((n, s) => {
97
+ const { asChild: u, ...i } = n, l = u ? o : e;
98
+ return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ S(l, { ...i, ref: s });
99
+ });
100
+ return r.displayName = `Primitive.${e}`, { ...t, [e]: r };
101
+ }, {});
102
+ function F(t, e) {
103
+ t && P.flushSync(() => t.dispatchEvent(e));
104
+ }
105
+ function L(t, e = []) {
106
+ let o = [];
107
+ function r(s, u) {
108
+ const i = c.createContext(u), l = o.length;
109
+ o = [...o, u];
110
+ const f = (a) => {
111
+ var b;
112
+ const { scope: p, children: h, ...m } = a, y = ((b = p == null ? void 0 : p[t]) == null ? void 0 : b[l]) || i, w = c.useMemo(() => m, Object.values(m));
113
+ return /* @__PURE__ */ S(y.Provider, { value: w, children: h });
114
+ };
115
+ f.displayName = s + "Provider";
116
+ function d(a, p) {
117
+ var y;
118
+ const h = ((y = p == null ? void 0 : p[t]) == null ? void 0 : y[l]) || i, m = c.useContext(h);
119
+ if (m) return m;
120
+ if (u !== void 0) return u;
121
+ throw new Error(`\`${a}\` must be used within \`${s}\``);
122
+ }
123
+ return [f, d];
124
+ }
125
+ const n = () => {
126
+ const s = o.map((u) => c.createContext(u));
127
+ return function(i) {
128
+ const l = (i == null ? void 0 : i[t]) || s;
129
+ return c.useMemo(
130
+ () => ({ [`__scope${t}`]: { ...i, [t]: l } }),
131
+ [i, l]
132
+ );
133
+ };
134
+ };
135
+ return n.scopeName = t, [r, A(n, ...e)];
136
+ }
137
+ function A(...t) {
138
+ const e = t[0];
139
+ if (t.length === 1) return e;
140
+ const o = () => {
141
+ const r = t.map((n) => ({
142
+ useScope: n(),
143
+ scopeName: n.scopeName
144
+ }));
145
+ return function(s) {
146
+ const u = r.reduce((i, { useScope: l, scopeName: f }) => {
147
+ const a = l(s)[`__scope${f}`];
148
+ return { ...i, ...a };
149
+ }, {});
150
+ return c.useMemo(() => ({ [`__scope${e.scopeName}`]: u }), [u]);
151
+ };
152
+ };
153
+ return o.scopeName = e.scopeName, o;
154
+ }
155
+ function M(t, e, { checkForDefaultPrevented: o = !0 } = {}) {
156
+ return function(n) {
157
+ if (t == null || t(n), o === !1 || !n.defaultPrevented)
158
+ return e == null ? void 0 : e(n);
159
+ };
160
+ }
161
+ var g = globalThis != null && globalThis.document ? c.useLayoutEffect : () => {
162
+ }, I = c[" useInsertionEffect ".trim().toString()] || g;
163
+ function T({
164
+ prop: t,
165
+ defaultProp: e,
166
+ onChange: o = () => {
167
+ },
168
+ caller: r
169
+ }) {
170
+ const [n, s, u] = D({
171
+ defaultProp: e,
172
+ onChange: o
173
+ }), i = t !== void 0, l = i ? t : n;
174
+ {
175
+ const d = c.useRef(t !== void 0);
176
+ c.useEffect(() => {
177
+ const a = d.current;
178
+ a !== i && console.warn(
179
+ `${r} is changing from ${a ? "controlled" : "uncontrolled"} to ${i ? "controlled" : "uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`
180
+ ), d.current = i;
181
+ }, [i, r]);
182
+ }
183
+ const f = c.useCallback(
184
+ (d) => {
185
+ var a;
186
+ if (i) {
187
+ const p = W(d) ? d(t) : d;
188
+ p !== t && ((a = u.current) == null || a.call(u, p));
189
+ } else
190
+ s(d);
191
+ },
192
+ [i, t, s, u]
193
+ );
194
+ return [l, f];
195
+ }
196
+ function D({
197
+ defaultProp: t,
198
+ onChange: e
199
+ }) {
200
+ const [o, r] = c.useState(t), n = c.useRef(o), s = c.useRef(e);
201
+ return I(() => {
202
+ s.current = e;
203
+ }, [e]), c.useEffect(() => {
204
+ var u;
205
+ n.current !== o && ((u = s.current) == null || u.call(s, o), n.current = o);
206
+ }, [o, n]), [o, r, s];
207
+ }
208
+ function W(t) {
209
+ return typeof t == "function";
210
+ }
211
+ function U(t) {
212
+ const [e, o] = c.useState(void 0);
213
+ return g(() => {
214
+ if (t) {
215
+ o({ width: t.offsetWidth, height: t.offsetHeight });
216
+ const r = new ResizeObserver((n) => {
217
+ if (!Array.isArray(n) || !n.length)
218
+ return;
219
+ const s = n[0];
220
+ let u, i;
221
+ if ("borderBoxSize" in s) {
222
+ const l = s.borderBoxSize, f = Array.isArray(l) ? l[0] : l;
223
+ u = f.inlineSize, i = f.blockSize;
224
+ } else
225
+ u = t.offsetWidth, i = t.offsetHeight;
226
+ o({ width: u, height: i });
227
+ });
228
+ return r.observe(t, { box: "border-box" }), () => r.unobserve(t);
229
+ } else
230
+ o(void 0);
231
+ }, [t]), e;
232
+ }
233
+ export {
234
+ k as P,
235
+ M as a,
236
+ C as b,
237
+ L as c,
238
+ j as d,
239
+ U as e,
240
+ F as f,
241
+ E as g,
242
+ B as h,
243
+ g as i,
244
+ T as u
245
+ };