welcome-ui 9.0.0-alpha.4 → 9.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 (111) hide show
  1. package/README.md +47 -3
  2. package/dist/2W3RN7C5-bkX-rIa3.js +61 -0
  3. package/dist/4I4MLMKD-BLxAidnq.js +43 -0
  4. package/dist/Accordion.js +6 -6
  5. package/dist/Alert.js +1 -1
  6. package/dist/AspectRatio.js +1 -1
  7. package/dist/Avatar.js +1 -1
  8. package/dist/{4CMBR7SL-Dhp8uJop.js → B7UTNDHN-BlIblHCu.js} +59 -59
  9. package/dist/Badge.js +1 -1
  10. package/dist/Breadcrumb.css +1 -1
  11. package/dist/Breadcrumb.js +27 -27
  12. package/dist/Button.js +2 -2
  13. package/dist/ButtonGroup.js +1 -1
  14. package/dist/Card.js +1 -1
  15. package/dist/Checkbox.css +1 -1
  16. package/dist/Checkbox.js +22 -22
  17. package/dist/CloseButton.js +3 -3
  18. package/dist/{SYRFVSLH-CHNUB1rW.js → DSAASPLT-BaaCUKsb.js} +7 -7
  19. package/dist/DatePicker.js +5 -5
  20. package/dist/DateTimePicker.js +2 -2
  21. package/dist/Drawer.css +1 -1
  22. package/dist/Drawer.js +67 -67
  23. package/dist/DropdownMenu.js +261 -259
  24. package/dist/Field.js +1 -1
  25. package/dist/FieldGroup.js +1 -1
  26. package/dist/FileDrop.js +194 -221
  27. package/dist/FileUpload.js +2 -2
  28. package/dist/GVVKDT6A-bET6V7Py.js +724 -0
  29. package/dist/Hint.js +1 -1
  30. package/dist/{Icon-BisRi8B3.js → Icon-EG7O4YwD.js} +1 -1
  31. package/dist/Icon.js +12 -12
  32. package/dist/InputText.js +1 -1
  33. package/dist/{ASMQKSDT-SH1qSiMi.js → KPUWHTQJ-D2TPji47.js} +30 -30
  34. package/dist/Label.js +3 -3
  35. package/dist/Link.css +1 -1
  36. package/dist/Link.js +27 -27
  37. package/dist/Loader.js +1 -1
  38. package/dist/Logo.js +1 -1
  39. package/dist/Modal.js +10 -10
  40. package/dist/{JC64G2H7-DPy9R0De.js → NI3IVY7K-Ztb3-XAv.js} +571 -571
  41. package/dist/{P4IRICAX-7kH4HzWI.js → NMGNQVTG-C6TqBngP.js} +5 -5
  42. package/dist/{LVA2YJMS-NUHCRwFZ.js → OE2EFRVA-C3721cM3.js} +316 -315
  43. package/dist/{ITI7HKP4-C5xLpoVY.js → OLVWQA7U-DysaSaZj.js} +59 -59
  44. package/dist/Pagination.css +1 -1
  45. package/dist/Pagination.js +81 -73
  46. package/dist/PasswordInput.js +17 -18
  47. package/dist/Popover.js +14 -14
  48. package/dist/{YV4JVR4I-CVFstk2K.js → RTNCFSKZ-qpPg689E.js} +75 -73
  49. package/dist/Radio.css +1 -1
  50. package/dist/Radio.js +29 -29
  51. package/dist/RadioGroup.js +21 -21
  52. package/dist/RadioTab.js +2 -2
  53. package/dist/{P2CTZE2T-D1TepwxQ.js → SBSPVDDI-DJKkC1eb.js} +43 -43
  54. package/dist/{NLEBE274-B4zy25kL.js → SQZLCNLX-CHDXnZ16.js} +16 -16
  55. package/dist/Search.js +2 -2
  56. package/dist/Select.js +170 -181
  57. package/dist/Slider.js +1 -1
  58. package/dist/Swiper.css +1 -1
  59. package/dist/Swiper.js +151 -151
  60. package/dist/{VGCJ63VH-CVhs4PYt.js → T22PY7TE-C1N0q8Kn.js} +109 -109
  61. package/dist/Table.js +1 -1
  62. package/dist/Tabs.js +303 -308
  63. package/dist/Tag.js +3 -3
  64. package/dist/Text.js +1 -1
  65. package/dist/Textarea.js +1 -1
  66. package/dist/TimePicker.js +2 -2
  67. package/dist/Toast.js +1 -1
  68. package/dist/Toggle.js +2 -2
  69. package/dist/Tooltip.js +72 -72
  70. package/dist/VariantIcon.js +3 -3
  71. package/dist/WelcomeLoader.js +1 -1
  72. package/dist/XCKGTAUF-DkxWCbaW.js +25 -0
  73. package/dist/Y67KZUMI-DFEgrUv2.js +15 -0
  74. package/dist/{AXB53BZF-BHeessqV.js → ZTXFEM5L-CkrIQCN1.js} +7 -7
  75. package/dist/{field-icon-size-Du58qHNC.js → field-icon-size-Z5NulTSk.js} +216 -224
  76. package/dist/{index-5rXezknO.js → index-BC2bF45u.js} +1 -1
  77. package/dist/{index-C8GsqBDe.js → index-BeetbagJ.js} +1 -1
  78. package/dist/{index-BJLXLdM3.js → index-Bt79XJ8R.js} +1 -1
  79. package/dist/{index-Dcq5gh3E.js → index-BtwrJ6N4.js} +1 -1
  80. package/dist/{index-DL4-ut3P.js → index-CCASZBtz.js} +1 -1
  81. package/dist/{index-lbUBMgHp.js → index-CPqDZeah.js} +2 -2
  82. package/dist/{index-CTgip19b.js → index-CQEPCbEE.js} +1 -1
  83. package/dist/{index-CnxSNAPH.js → index-Crpe9CvH.js} +1 -1
  84. package/dist/{index-CWVOLBDY.js → index-D5a8Oe6k.js} +1 -1
  85. package/dist/{index-C1jjVTAc.js → index-D8dq-I5s.js} +1 -1
  86. package/dist/{index-Cvtm6uuS.js → index-DkwTwo3z.js} +1 -1
  87. package/dist/{index-BG2aV9o8.js → index-DnO8yBVT.js} +1 -1
  88. package/dist/index.css +0 -0
  89. package/dist/tslib.es6-DpB4Y59c.js +683 -0
  90. package/dist/types/components/Pagination/index.d.ts +1 -2
  91. package/dist/types/components/Pagination/types.d.ts +5 -2
  92. package/dist/types/components/PasswordInput/ToggleButton.d.ts +1 -1
  93. package/dist/types/components/PasswordInput/types.d.ts +1 -1
  94. package/dist/types/components/Tabs/components/TabList/index.d.ts +1 -1
  95. package/dist/types/components/Tabs/index.d.ts +1 -1
  96. package/dist/types/components/Tabs/types.d.ts +1 -2
  97. package/dist/types/components/Tabs/utils.d.ts +1 -2
  98. package/dist/types/utils/index.d.ts +1 -0
  99. package/dist/types/utils/theme/index.d.ts +0 -0
  100. package/dist/types/utils/useForkRef.d.ts +7 -1
  101. package/dist/useForkRef-D807AV7D.js +22 -0
  102. package/dist/{utils-BNMgUIHQ.js → utils-BpbIqM56.js} +1 -1
  103. package/dist/utils.js +2 -2
  104. package/package.json +5 -5
  105. package/dist/BYC7LY2E-DbSoi9cN.js +0 -673
  106. package/dist/KUU7WJ55-CsIy9XMu.js +0 -61
  107. package/dist/MTZPJQMC-D_TnSwZf.js +0 -15
  108. package/dist/QYJ6MIDR-Dm7lYMh6.js +0 -43
  109. package/dist/X5NMLKT6-PeY306ft.js +0 -25
  110. package/dist/index--0U5Rubs.js +0 -644
  111. /package/dist/{index-PAaZGbyz.js → index-CdiHdiVB.js} +0 -0
package/dist/Tabs.js CHANGED
@@ -1,216 +1,69 @@
1
1
  "use client";
2
- import { jsx as P, jsxs as pe } from "react/jsx-runtime";
3
- import { C as te, a as oe, h as U, b as ve, j as Ie } from "./P2CTZE2T-D1TepwxQ.js";
4
- import { v as se, w as Se, x as M, y as O, z as k, S as J, e as h, g as v, B as Q, m as xe, l as A, c as B, n as j, _ as H, i as K, C as ne, G as he, b as F, D as re, a0 as _e, f as Ce, W as ge } from "./LVA2YJMS-NUHCRwFZ.js";
5
- import { m as Pe, o as X, c as Te, s as z, a as w, f as Ee, u as ae, b as Y, d as D } from "./YV4JVR4I-CVFstk2K.js";
6
- import ce, { createContext as ie, useMemo as le, useCallback as de, useRef as W, useEffect as Z, useState as q, cloneElement as we, forwardRef as ue } from "react";
7
- import { c as V } from "./index-PAaZGbyz.js";
8
- import { f as ye } from "./forwardRefWithAs-8eP3ZN15.js";
9
- import { b as Re, a as $e } from "./ITI7HKP4-C5xLpoVY.js";
10
- import { u as Ne, a as Le } from "./use-viewport-CgrficYB.js";
11
- import { u as Oe, f as ke } from "./VGCJ63VH-CVhs4PYt.js";
12
- import { P as ze, b as De } from "./MTZPJQMC-D_TnSwZf.js";
13
- import { c as Me, a as Ve, u as Fe } from "./4CMBR7SL-Dhp8uJop.js";
14
- var We = se(
15
- [De, oe],
16
- [ze, te]
17
- ), Ae = We.useContext;
18
- ie(!1);
19
- ie(null);
20
- function Be(t = {}) {
21
- var s = t, {
22
- composite: o,
23
- combobox: e
24
- } = s, n = Se(s, [
25
- "composite",
26
- "combobox"
27
- ]);
28
- const r = [
29
- "items",
30
- "renderedItems",
31
- "moves",
32
- "orientation",
33
- "virtualFocus",
34
- "includesBaseElement",
35
- "baseElement",
36
- "focusLoop",
37
- "focusShift",
38
- "focusWrap"
39
- ], m = Pe(
40
- n.store,
41
- X(o, r),
42
- X(e, r)
43
- ), i = m == null ? void 0 : m.getState(), d = Me(M(k({}, n), {
44
- store: m,
45
- // We need to explicitly set the default value of `includesBaseElement` to
46
- // `false` since we don't want the composite store to default it to `true`
47
- // when the activeId state is null, which could be the case when rendering
48
- // combobox with tab.
49
- includesBaseElement: O(
50
- n.includesBaseElement,
51
- i == null ? void 0 : i.includesBaseElement,
52
- !1
53
- ),
54
- orientation: O(
55
- n.orientation,
56
- i == null ? void 0 : i.orientation,
57
- "horizontal"
58
- ),
59
- focusLoop: O(n.focusLoop, i == null ? void 0 : i.focusLoop, !0)
60
- })), a = Ve(), _ = M(k({}, d.getState()), {
61
- selectedId: O(
62
- n.selectedId,
63
- i == null ? void 0 : i.selectedId,
64
- n.defaultSelectedId
65
- ),
66
- selectOnMove: O(
67
- n.selectOnMove,
68
- i == null ? void 0 : i.selectOnMove,
69
- !0
70
- )
71
- }), c = Te(_, d, m);
72
- z(
73
- c,
74
- () => w(c, ["moves"], () => {
75
- const { activeId: u, selectOnMove: p } = c.getState();
76
- if (!p || !u) return;
77
- const I = d.item(u);
78
- I && (I.dimmed || I.disabled || c.setState("selectedId", I.id));
79
- })
80
- );
81
- let b = !0;
82
- z(
83
- c,
84
- () => Ee(c, ["selectedId"], (u, p) => {
85
- if (!b) {
86
- b = !0;
87
- return;
88
- }
89
- o && u.selectedId === p.selectedId || c.setState("activeId", u.selectedId);
90
- })
91
- ), z(
92
- c,
93
- () => w(c, ["selectedId", "renderedItems"], (u) => {
94
- if (u.selectedId !== void 0) return;
95
- const { activeId: p, renderedItems: I } = c.getState(), S = d.item(p);
96
- if (S && !S.disabled && !S.dimmed)
97
- c.setState("selectedId", S.id);
98
- else {
99
- const T = I.find(
100
- (C) => !C.disabled && !C.dimmed
101
- );
102
- c.setState("selectedId", T == null ? void 0 : T.id);
103
- }
104
- })
105
- ), z(
106
- c,
107
- () => w(c, ["renderedItems"], (u) => {
108
- const p = u.renderedItems;
109
- if (p.length)
110
- return w(a, ["renderedItems"], (I) => {
111
- const S = I.renderedItems;
112
- S.some((C) => !C.tabId) && S.forEach((C, R) => {
113
- if (C.tabId) return;
114
- const N = p[R];
115
- N && a.renderItem(M(k({}, C), { tabId: N.id }));
116
- });
117
- });
118
- })
119
- );
120
- let x = null;
121
- return z(c, () => {
122
- const u = () => {
123
- x = c.getState().selectedId;
124
- }, p = () => {
125
- b = !1, c.setState("selectedId", x);
126
- };
127
- if (o && "setSelectElement" in o)
128
- return J(
129
- w(o, ["value"], u),
130
- w(o, ["mounted"], p)
131
- );
132
- if (e)
133
- return J(
134
- w(e, ["selectedValue"], u),
135
- w(e, ["mounted"], p)
136
- );
137
- }), M(k(k({}, d), c), {
138
- panels: a,
139
- setSelectedId: (u) => c.setState("selectedId", u),
140
- select: (u) => {
141
- c.setState("selectedId", u), d.move(u);
142
- }
143
- });
144
- }
145
- function je(t, s, o) {
146
- Q(s, [o.composite, o.combobox]), t = Fe(t, s, o), Y(t, o, "selectedId", "setSelectedId"), Y(t, o, "selectOnMove");
147
- const [e, n] = ae(() => t.panels, {});
148
- return Q(n, [t, n]), Object.assign(
149
- le(() => h(v({}, t), { panels: e }), [t, e]),
150
- { composite: o.composite, combobox: o.combobox }
151
- );
152
- }
153
- function Nt(t = {}) {
154
- const s = Re(), o = Ae() || s;
155
- t = h(v({}, t), {
156
- composite: t.composite !== void 0 ? t.composite : o,
157
- combobox: t.combobox !== void 0 ? t.combobox : s
158
- });
159
- const [e, n] = ae(Be, t);
160
- return je(e, n, t);
161
- }
162
- var G = se(
163
- [oe],
164
- [te]
165
- ), He = G.useScopedContext, me = G.useProviderContext, fe = G.ScopedContextProvider, Ke = "button", qe = B(function(s) {
166
- var o = s, {
2
+ import { jsx as P, jsxs as fe } from "react/jsx-runtime";
3
+ import { C as ee, a as te, h as U, b as be, j as pe } from "./SBSPVDDI-DJKkC1eb.js";
4
+ import { e as oe, v as ve, f as B, c as W, b as j, _ as H, i as K, w as se, A as Ie, d as h, a as v, u as V, x as ne, ad as Se, p as xe, W as he, F as _e, G as D, H as O, I as k, S as J, K as Q } from "./OE2EFRVA-C3721cM3.js";
5
+ import { u as A, m as ge, o as X, c as Ce, s as z, a as w, f as Pe, b as re, d as Y } from "./RTNCFSKZ-qpPg689E.js";
6
+ import ae, { useCallback as ce, useRef as F, useEffect as Z, useState as q, createContext as ie, useMemo as Te, cloneElement as Ee, forwardRef as le } from "react";
7
+ import { c as M } from "./index-CdiHdiVB.js";
8
+ import { f as we } from "./forwardRefWithAs-8eP3ZN15.js";
9
+ import { u as Re, b as ye } from "./OLVWQA7U-DysaSaZj.js";
10
+ import { m as $e, g as Ne, u as Le } from "./useForkRef-D807AV7D.js";
11
+ import { u as Oe, a as ke } from "./use-viewport-CgrficYB.js";
12
+ import { u as ze, d as Ae } from "./T22PY7TE-C1N0q8Kn.js";
13
+ import { P as De, a as Me } from "./Y67KZUMI-DFEgrUv2.js";
14
+ import { c as Ve, a as Fe, u as Be } from "./B7UTNDHN-BlIblHCu.js";
15
+ var G = oe(
16
+ [te],
17
+ [ee]
18
+ ), We = G.useScopedContext, de = G.useProviderContext, ue = G.ScopedContextProvider, je = "button", He = W(function(r) {
19
+ var t = r, {
167
20
  store: e,
168
- getItem: n
169
- } = o, r = H(o, [
21
+ getItem: s
22
+ } = t, n = H(t, [
170
23
  "store",
171
24
  "getItem"
172
25
  ]), m;
173
- const i = He();
26
+ const i = We();
174
27
  e = e || i, K(
175
28
  e,
176
29
  process.env.NODE_ENV !== "production" && "Tab must be wrapped in a TabList component."
177
30
  );
178
- const d = ne(), a = r.id || d, _ = he(r), c = de(
31
+ const d = se(), a = n.id || d, _ = Ie(n), c = ce(
179
32
  (f) => {
180
- const y = h(v({}, f), { dimmed: _ });
181
- return n ? n(y) : y;
33
+ const R = h(v({}, f), { dimmed: _ });
34
+ return s ? s(R) : R;
182
35
  },
183
- [_, n]
184
- ), b = r.onClick, x = F((f) => {
36
+ [_, s]
37
+ ), b = n.onClick, x = V((f) => {
185
38
  b == null || b(f), !f.defaultPrevented && (e == null || e.setSelectedId(a));
186
39
  }), u = e.panels.useState(
187
40
  (f) => {
188
- var y;
189
- return (y = f.items.find((l) => l.tabId === a)) == null ? void 0 : y.id;
41
+ var R;
42
+ return (R = f.items.find((l) => l.tabId === a)) == null ? void 0 : R.id;
190
43
  }
191
- ), p = d ? r.shouldRegisterItem : !1, I = e.useState((f) => !!a && f.activeId === a), S = e.useState((f) => !!a && f.selectedId === a), T = e.useState((f) => !!e.item(f.activeId)), C = I || S && !T, R = S || ((m = r.accessibleWhenDisabled) != null ? m : !0);
192
- if (D(
44
+ ), p = d ? n.shouldRegisterItem : !1, I = e.useState((f) => !!a && f.activeId === a), S = e.useState((f) => !!a && f.selectedId === a), T = e.useState((f) => !!e.item(f.activeId)), g = I || S && !T, y = S || ((m = n.accessibleWhenDisabled) != null ? m : !0);
45
+ if (A(
193
46
  e.combobox || e.composite,
194
47
  "virtualFocus"
195
- ) && (r = h(v({}, r), {
48
+ ) && (n = h(v({}, n), {
196
49
  tabIndex: -1
197
- })), r = h(v({
50
+ })), n = h(v({
198
51
  id: a,
199
52
  role: "tab",
200
53
  "aria-selected": S,
201
54
  "aria-controls": u || void 0
202
- }, r), {
55
+ }, n), {
203
56
  onClick: x
204
57
  }), e.composite) {
205
58
  const f = {
206
59
  id: a,
207
- accessibleWhenDisabled: R,
60
+ accessibleWhenDisabled: y,
208
61
  store: e.composite,
209
- shouldRegisterItem: C && p,
210
- rowId: r.rowId,
211
- render: r.render
62
+ shouldRegisterItem: g && p,
63
+ rowId: n.rowId,
64
+ render: n.render
212
65
  };
213
- r = h(v({}, r), {
66
+ n = h(v({}, n), {
214
67
  render: /* @__PURE__ */ P(
215
68
  U,
216
69
  h(v({}, f), {
@@ -219,53 +72,53 @@ var G = se(
219
72
  )
220
73
  });
221
74
  }
222
- return r = ve(h(v({
75
+ return n = be(h(v({
223
76
  store: e
224
- }, r), {
225
- accessibleWhenDisabled: R,
77
+ }, n), {
78
+ accessibleWhenDisabled: y,
226
79
  getItem: c,
227
80
  shouldRegisterItem: p
228
- })), r;
229
- }), Ge = xe(
230
- A(function(s) {
231
- const o = qe(s);
232
- return j(Ke, o);
81
+ })), n;
82
+ }), Ke = ve(
83
+ B(function(r) {
84
+ const t = He(r);
85
+ return j(je, t);
233
86
  })
234
- ), Ue = "div", Je = B(
235
- function(s) {
236
- var o = s, { store: e } = o, n = H(o, ["store"]);
237
- const r = me();
238
- e = e || r, K(
87
+ ), qe = "div", Ge = W(
88
+ function(r) {
89
+ var t = r, { store: e } = t, s = H(t, ["store"]);
90
+ const n = de();
91
+ e = e || n, K(
239
92
  e,
240
93
  process.env.NODE_ENV !== "production" && "TabList must receive a `store` prop or be wrapped in a TabProvider component."
241
94
  );
242
95
  const m = e.useState(
243
96
  (i) => i.orientation === "both" ? void 0 : i.orientation
244
97
  );
245
- return n = re(
246
- n,
247
- (i) => /* @__PURE__ */ P(fe, { value: e, children: i }),
98
+ return s = ne(
99
+ s,
100
+ (i) => /* @__PURE__ */ P(ue, { value: e, children: i }),
248
101
  [e]
249
- ), e.composite && (n = v({
102
+ ), e.composite && (s = v({
250
103
  focusable: !1
251
- }, n)), n = v({
104
+ }, s)), s = v({
252
105
  role: "tablist",
253
106
  "aria-orientation": m
254
- }, n), n = $e(v({ store: e }, n)), n;
107
+ }, s), s = Re(v({ store: e }, s)), s;
255
108
  }
256
- ), Qe = A(function(s) {
257
- const o = Je(s);
258
- return j(Ue, o);
259
- }), Xe = "div", Ye = B(
260
- function(s) {
261
- var o = s, {
109
+ ), Ue = B(function(r) {
110
+ const t = Ge(r);
111
+ return j(qe, t);
112
+ }), Je = "div", Qe = W(
113
+ function(r) {
114
+ var t = r, {
262
115
  store: e,
263
- unmountOnHide: n,
264
- tabId: r,
116
+ unmountOnHide: s,
117
+ tabId: n,
265
118
  getItem: m,
266
119
  scrollRestoration: i,
267
120
  scrollElement: d
268
- } = o, a = H(o, [
121
+ } = t, a = H(t, [
269
122
  "store",
270
123
  "unmountOnHide",
271
124
  "tabId",
@@ -273,187 +126,329 @@ var G = se(
273
126
  "scrollRestoration",
274
127
  "scrollElement"
275
128
  ]);
276
- const _ = me();
129
+ const _ = de();
277
130
  e = e || _, K(
278
131
  e,
279
132
  process.env.NODE_ENV !== "production" && "TabPanel must receive a `store` prop or be wrapped in a TabProvider component."
280
133
  );
281
- const c = W(null), b = ne(a.id), x = D(
134
+ const c = F(null), b = se(a.id), x = A(
282
135
  e.panels,
283
136
  () => {
284
137
  var l;
285
- return r || ((l = e == null ? void 0 : e.panels.item(b)) == null ? void 0 : l.tabId);
138
+ return n || ((l = e == null ? void 0 : e.panels.item(b)) == null ? void 0 : l.tabId);
286
139
  }
287
- ), u = D(
140
+ ), u = A(
288
141
  e,
289
142
  (l) => !!x && l.selectedId === x
290
- ), p = Oe({ open: u }), I = D(p, "mounted"), S = W(
143
+ ), p = ze({ open: u }), I = A(p, "mounted"), S = F(
291
144
  /* @__PURE__ */ new Map()
292
- ), T = F(() => {
145
+ ), T = V(() => {
293
146
  const l = c.current;
294
147
  return l ? d ? typeof d == "function" ? d(l) : "current" in d ? d.current : d : l : null;
295
148
  });
296
149
  Z(() => {
297
150
  var l, E;
298
151
  if (!i || !I) return;
299
- const g = T();
300
- if (!g) return;
152
+ const C = T();
153
+ if (!C) return;
301
154
  if (i === "reset") {
302
- g.scroll(0, 0);
155
+ C.scroll(0, 0);
303
156
  return;
304
157
  }
305
158
  if (!x) return;
306
159
  const $ = S.current.get(x);
307
- g.scroll((l = $ == null ? void 0 : $.x) != null ? l : 0, (E = $ == null ? void 0 : $.y) != null ? E : 0);
160
+ C.scroll((l = $ == null ? void 0 : $.x) != null ? l : 0, (E = $ == null ? void 0 : $.y) != null ? E : 0);
308
161
  const L = () => {
309
162
  S.current.set(x, {
310
- x: g.scrollLeft,
311
- y: g.scrollTop
163
+ x: C.scrollLeft,
164
+ y: C.scrollTop
312
165
  });
313
166
  };
314
- return g.addEventListener("scroll", L), () => {
315
- g.removeEventListener("scroll", L);
167
+ return C.addEventListener("scroll", L), () => {
168
+ C.removeEventListener("scroll", L);
316
169
  };
317
170
  }, [i, I, x, T, e]);
318
- const [C, R] = q(!1);
171
+ const [g, y] = q(!1);
319
172
  Z(() => {
320
173
  const l = c.current;
321
174
  if (!l) return;
322
- const E = _e(l);
323
- R(!!E.length);
175
+ const E = Se(l);
176
+ y(!!E.length);
324
177
  }, []);
325
- const N = de(
178
+ const N = ce(
326
179
  (l) => {
327
- const E = h(v({}, l), { id: b || l.id, tabId: r });
180
+ const E = h(v({}, l), { id: b || l.id, tabId: n });
328
181
  return m ? m(E) : E;
329
182
  },
330
- [b, r, m]
331
- ), f = a.onKeyDown, y = F((l) => {
183
+ [b, n, m]
184
+ ), f = a.onKeyDown, R = V((l) => {
332
185
  if (f == null || f(l), l.defaultPrevented || !(e != null && e.composite)) return;
333
- const g = {
186
+ const C = {
334
187
  ArrowLeft: e.previous,
335
188
  ArrowRight: e.next,
336
189
  Home: e.first,
337
190
  End: e.last
338
191
  }[l.key];
339
- if (!g) return;
340
- const { selectedId: $ } = e.getState(), L = g({ activeId: $ });
192
+ if (!C) return;
193
+ const { selectedId: $ } = e.getState(), L = C({ activeId: $ });
341
194
  L && (l.preventDefault(), e.move(L));
342
195
  });
343
- return a = re(
196
+ return a = ne(
344
197
  a,
345
- (l) => /* @__PURE__ */ P(fe, { value: e, children: l }),
198
+ (l) => /* @__PURE__ */ P(ue, { value: e, children: l }),
346
199
  [e]
347
200
  ), a = h(v({
348
201
  id: b,
349
202
  role: "tabpanel",
350
203
  "aria-labelledby": x || void 0
351
204
  }, a), {
352
- children: n && !I ? null : a.children,
353
- ref: Ce(c, a.ref),
354
- onKeyDown: y
355
- }), a = ge(v({
205
+ children: s && !I ? null : a.children,
206
+ ref: xe(c, a.ref),
207
+ onKeyDown: R
208
+ }), a = he(v({
356
209
  // If the tab panel is rendered as part of another composite widget such
357
210
  // as combobox, it should not be focusable.
358
- focusable: !e.composite && !C
359
- }, a)), a = ke(v({ store: p }, a)), a = Ie(h(v({ store: e.panels }, a), { getItem: N })), a;
211
+ focusable: !e.composite && !g
212
+ }, a)), a = Ae(v({ store: p }, a)), a = pe(h(v({ store: e.panels }, a), { getItem: N })), a;
360
213
  }
361
- ), Ze = A(function(s) {
362
- const o = Ye(s);
363
- return j(Xe, o);
364
- });
365
- const be = (t) => {
366
- if (!t || typeof window > "u") return 1;
367
- const s = Number(window.getComputedStyle(t).scale);
368
- return isNaN(s) ? be(t.parentElement) : s;
369
- };
370
- function et(t, s) {
371
- return le(() => t == null && s == null ? null : (o) => {
372
- ee(t, o), ee(s, o);
373
- }, [t, s]);
214
+ ), Xe = B(function(r) {
215
+ const t = Qe(r);
216
+ return j(Je, t);
217
+ }), Ye = oe(
218
+ [Me, te],
219
+ [De, ee]
220
+ ), Ze = Ye.useContext;
221
+ ie(!1);
222
+ ie(null);
223
+ function et(o = {}) {
224
+ var r = o, {
225
+ composite: t,
226
+ combobox: e
227
+ } = r, s = _e(r, [
228
+ "composite",
229
+ "combobox"
230
+ ]);
231
+ const n = [
232
+ "items",
233
+ "renderedItems",
234
+ "moves",
235
+ "orientation",
236
+ "virtualFocus",
237
+ "includesBaseElement",
238
+ "baseElement",
239
+ "focusLoop",
240
+ "focusShift",
241
+ "focusWrap"
242
+ ], m = ge(
243
+ s.store,
244
+ X(t, n),
245
+ X(e, n)
246
+ ), i = m == null ? void 0 : m.getState(), d = Ve(D(k({}, s), {
247
+ store: m,
248
+ // We need to explicitly set the default value of `includesBaseElement` to
249
+ // `false` since we don't want the composite store to default it to `true`
250
+ // when the activeId state is null, which could be the case when rendering
251
+ // combobox with tab.
252
+ includesBaseElement: O(
253
+ s.includesBaseElement,
254
+ i == null ? void 0 : i.includesBaseElement,
255
+ !1
256
+ ),
257
+ orientation: O(
258
+ s.orientation,
259
+ i == null ? void 0 : i.orientation,
260
+ "horizontal"
261
+ ),
262
+ focusLoop: O(s.focusLoop, i == null ? void 0 : i.focusLoop, !0)
263
+ })), a = Fe(), _ = D(k({}, d.getState()), {
264
+ selectedId: O(
265
+ s.selectedId,
266
+ i == null ? void 0 : i.selectedId,
267
+ s.defaultSelectedId
268
+ ),
269
+ selectOnMove: O(
270
+ s.selectOnMove,
271
+ i == null ? void 0 : i.selectOnMove,
272
+ !0
273
+ )
274
+ }), c = Ce(_, d, m);
275
+ z(
276
+ c,
277
+ () => w(c, ["moves"], () => {
278
+ const { activeId: u, selectOnMove: p } = c.getState();
279
+ if (!p || !u) return;
280
+ const I = d.item(u);
281
+ I && (I.dimmed || I.disabled || c.setState("selectedId", I.id));
282
+ })
283
+ );
284
+ let b = !0;
285
+ z(
286
+ c,
287
+ () => Pe(c, ["selectedId"], (u, p) => {
288
+ if (!b) {
289
+ b = !0;
290
+ return;
291
+ }
292
+ t && u.selectedId === p.selectedId || c.setState("activeId", u.selectedId);
293
+ })
294
+ ), z(
295
+ c,
296
+ () => w(c, ["selectedId", "renderedItems"], (u) => {
297
+ if (u.selectedId !== void 0) return;
298
+ const { activeId: p, renderedItems: I } = c.getState(), S = d.item(p);
299
+ if (S && !S.disabled && !S.dimmed)
300
+ c.setState("selectedId", S.id);
301
+ else {
302
+ const T = I.find(
303
+ (g) => !g.disabled && !g.dimmed
304
+ );
305
+ c.setState("selectedId", T == null ? void 0 : T.id);
306
+ }
307
+ })
308
+ ), z(
309
+ c,
310
+ () => w(c, ["renderedItems"], (u) => {
311
+ const p = u.renderedItems;
312
+ if (p.length)
313
+ return w(a, ["renderedItems"], (I) => {
314
+ const S = I.renderedItems;
315
+ S.some((g) => !g.tabId) && S.forEach((g, y) => {
316
+ if (g.tabId) return;
317
+ const N = p[y];
318
+ N && a.renderItem(D(k({}, g), { tabId: N.id }));
319
+ });
320
+ });
321
+ })
322
+ );
323
+ let x = null;
324
+ return z(c, () => {
325
+ const u = () => {
326
+ x = c.getState().selectedId;
327
+ }, p = () => {
328
+ b = !1, c.setState("selectedId", x);
329
+ };
330
+ if (t && "setSelectElement" in t)
331
+ return J(
332
+ w(t, ["value"], u),
333
+ w(t, ["mounted"], p)
334
+ );
335
+ if (e)
336
+ return J(
337
+ w(e, ["selectedValue"], u),
338
+ w(e, ["mounted"], p)
339
+ );
340
+ }), D(k(k({}, d), c), {
341
+ panels: a,
342
+ setSelectedId: (u) => c.setState("selectedId", u),
343
+ select: (u) => {
344
+ c.setState("selectedId", u), d.move(u);
345
+ }
346
+ });
347
+ }
348
+ function tt(o, r, t) {
349
+ Q(r, [t.composite, t.combobox]), o = Be(o, r, t), Y(o, t, "selectedId", "setSelectedId"), Y(o, t, "selectOnMove");
350
+ const [e, s] = re(() => o.panels, {});
351
+ return Q(s, [o, s]), Object.assign(
352
+ Te(() => h(v({}, o), { panels: e }), [o, e]),
353
+ { composite: t.composite, combobox: t.combobox }
354
+ );
374
355
  }
375
- function tt(t, s) {
376
- const [o, e] = q(null), n = ce.Children.map(s, (r) => r.props.id === t ? we(r, { ref: e }) : r);
377
- return { activeTab: o, tabs: n };
356
+ function Ot(o = {}) {
357
+ const r = ye(), t = Ze() || r;
358
+ o = h(v({}, o), {
359
+ composite: o.composite !== void 0 ? o.composite : t,
360
+ combobox: o.combobox !== void 0 ? o.combobox : r
361
+ });
362
+ const [e, s] = re(et, o);
363
+ return tt(e, s, o);
378
364
  }
379
- function ee(t, s) {
380
- typeof t == "function" ? t(s) : t && (t.current = s);
365
+ const me = (o) => {
366
+ if (!o || typeof window > "u") return 1;
367
+ const r = Number(window.getComputedStyle(o).scale);
368
+ return isNaN(r) ? me(o.parentElement) : r;
369
+ };
370
+ function ot(o, r) {
371
+ const [t, e] = q(null), s = ae.Children.map(r, (n) => n.props.id === o ? Ee(n, {
372
+ ...n.props,
373
+ ref: $e(e, Ne(n))
374
+ }) : n);
375
+ return { activeTab: t, tabs: s };
381
376
  }
382
- const ot = "_root_102tt_2", st = {
383
- root: ot
377
+ const st = "_root_102tt_2", nt = {
378
+ root: st
384
379
  };
385
- function nt({ activeTab: t, listRef: s, orientation: o }) {
386
- const [e, n] = q({}), { height: r, width: m } = Ne();
387
- return Le(() => {
388
- const i = s.current;
389
- if (!i || !t) return;
390
- const d = i.getBoundingClientRect(), a = t.getBoundingClientRect(), _ = be(i);
391
- if (o === "vertical") {
380
+ function rt({ activeTab: o, listRef: r, orientation: t }) {
381
+ const [e, s] = q({}), { height: n, width: m } = Oe();
382
+ return ke(() => {
383
+ const i = r.current;
384
+ if (!i || !o) return;
385
+ const d = i.getBoundingClientRect(), a = o.getBoundingClientRect(), _ = me(i);
386
+ if (t === "vertical") {
392
387
  const c = a.top - d.top, b = a.height;
393
- n({
388
+ s({
394
389
  offset: c,
395
- orientation: o,
390
+ orientation: t,
396
391
  size: b
397
392
  });
398
393
  } else {
399
394
  const c = (a.left - d.left + i.scrollLeft) / _, b = a.width / _;
400
- n({
395
+ s({
401
396
  offset: isNaN(c) ? 0 : c,
402
- orientation: o,
397
+ orientation: t,
403
398
  size: isNaN(b) ? 0 : b
404
399
  });
405
400
  }
406
- }, [s, t, m, r, o]), e;
401
+ }, [r, o, m, n, t]), e;
407
402
  }
408
- const rt = V(st), at = ({ activeTab: t, listRef: s, orientation: o }) => {
409
- const e = nt({ activeTab: t, listRef: s, orientation: o }), n = {
403
+ const at = M(nt), ct = ({ activeTab: o, listRef: r, orientation: t }) => {
404
+ const e = rt({ activeTab: o, listRef: r, orientation: t }), s = {
410
405
  "--active-bar-offset": `${e.offset}px`,
411
406
  "--active-bar-size": `${e.size}px`
412
407
  };
413
- return /* @__PURE__ */ P("span", { className: rt("root", `orientation-${o}`), style: n });
414
- }, ct = "_root_axn0q_2", it = {
415
- root: ct,
408
+ return /* @__PURE__ */ P("span", { className: at("root", `orientation-${t}`), style: s });
409
+ }, it = "_root_axn0q_2", lt = {
410
+ root: it,
416
411
  "size-md": "_size-md_axn0q_18",
417
412
  "size-sm": "_size-sm_axn0q_21"
418
- }, lt = V(it), dt = ue(
419
- ({ children: t, className: s, size: o = "md", store: e, ...n }, r) => {
420
- const m = W(), i = et(r, m), { orientation: d, selectedId: a } = D(e), { activeTab: _, tabs: c } = tt(a, t), b = ce.Children.count(t) > 1;
421
- return /* @__PURE__ */ pe(
422
- Qe,
413
+ }, dt = M(lt), ut = le(
414
+ ({ children: o, className: r, size: t = "md", store: e, ...s }, n) => {
415
+ const m = F(), [, i] = Le(n, m), { orientation: d, selectedId: a } = A(e), { activeTab: _, tabs: c } = ot(a, o), b = ae.Children.count(o) > 1;
416
+ return /* @__PURE__ */ fe(
417
+ Ue,
423
418
  {
424
- className: lt("root", `size-${o}`, s),
419
+ className: dt("root", `size-${t}`, r),
425
420
  ref: i,
426
421
  store: e,
427
- ...n,
422
+ ...s,
428
423
  children: [
429
424
  c,
430
- b ? /* @__PURE__ */ P(at, { activeTab: _, listRef: m, orientation: d }) : null
425
+ b ? /* @__PURE__ */ P(ct, { activeTab: _, listRef: m, orientation: d }) : null
431
426
  ]
432
427
  }
433
428
  );
434
429
  }
435
- ), ut = "_root_1kepd_2", mt = {
436
- root: ut
437
- }, ft = V(mt), bt = ue(
438
- ({ children: t, store: s, tabId: o, ...e }, n) => /* @__PURE__ */ P(Ze, { className: ft("root"), ref: n, store: s, tabId: o, ...e, children: t })
439
- ), pt = "_root_wlfaw_2", vt = {
440
- root: pt
441
- }, It = V(vt), St = ye(
442
- ({ as: t, children: s, className: o, id: e, store: n, ...r }, m) => /* @__PURE__ */ P(
443
- Ge,
430
+ ), mt = "_root_1kepd_2", ft = {
431
+ root: mt
432
+ }, bt = M(ft), pt = le(
433
+ ({ children: o, store: r, tabId: t, ...e }, s) => /* @__PURE__ */ P(Xe, { className: bt("root"), ref: s, store: r, tabId: t, ...e, children: o })
434
+ ), vt = "_root_wlfaw_2", It = {
435
+ root: vt
436
+ }, St = M(It), xt = we(
437
+ ({ as: o, children: r, className: t, id: e, store: s, ...n }, m) => /* @__PURE__ */ P(
438
+ Ke,
444
439
  {
445
- className: It("root", o),
440
+ className: St("root", t),
446
441
  id: e,
447
442
  ref: m,
448
- render: t ? /* @__PURE__ */ P(t, {}) : void 0,
449
- store: n,
450
- ...r,
451
- children: s
443
+ render: o ? /* @__PURE__ */ P(o, {}) : void 0,
444
+ store: s,
445
+ ...n,
446
+ children: r
452
447
  }
453
448
  )
454
- ), Lt = Object.assign(St, { List: dt, Panel: bt });
449
+ ), kt = Object.assign(xt, { List: ut, Panel: pt });
455
450
  export {
456
- Lt as Tab,
457
- St as TabComponent,
458
- Nt as useTab
451
+ kt as Tab,
452
+ xt as TabComponent,
453
+ Ot as useTab
459
454
  };