@commercetools/nimbus 0.0.0-canary-20250929125459 → 0.0.0-canary-20250930095152

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 (64) hide show
  1. package/dist/chunks/data-table-BFGyPJvT.cjs.js +2 -0
  2. package/dist/chunks/{data-table-BBgNLX1F.cjs.js.map → data-table-BFGyPJvT.cjs.js.map} +1 -1
  3. package/dist/chunks/{data-table-D3e1Jwo7.es.js → data-table-CommJV1y.es.js} +883 -872
  4. package/dist/chunks/{data-table-D3e1Jwo7.es.js.map → data-table-CommJV1y.es.js.map} +1 -1
  5. package/dist/chunks/form-field-C6lWjdck.cjs.js +11 -0
  6. package/dist/chunks/form-field-C6lWjdck.cjs.js.map +1 -0
  7. package/dist/chunks/form-field-bP4SYMaC.es.js +319 -0
  8. package/dist/chunks/form-field-bP4SYMaC.es.js.map +1 -0
  9. package/dist/chunks/make-element-focusable-BDByS8Na.cjs.js +2 -0
  10. package/dist/chunks/make-element-focusable-BDByS8Na.cjs.js.map +1 -0
  11. package/dist/chunks/make-element-focusable-BamCHW5U.es.js +25 -0
  12. package/dist/chunks/make-element-focusable-BamCHW5U.es.js.map +1 -0
  13. package/dist/chunks/{money-input-B2X3PtKX.es.js → money-input-BN_yFB_R.es.js} +3 -3
  14. package/dist/chunks/{money-input-B2X3PtKX.es.js.map → money-input-BN_yFB_R.es.js.map} +1 -1
  15. package/dist/chunks/{money-input-BFhtaiLG.cjs.js → money-input-BPrFeUBJ.cjs.js} +2 -2
  16. package/dist/chunks/{money-input-BFhtaiLG.cjs.js.map → money-input-BPrFeUBJ.cjs.js.map} +1 -1
  17. package/dist/chunks/{pagination-Dis-nnBy.cjs.js → pagination-0rlXyI2R.cjs.js} +2 -2
  18. package/dist/chunks/{pagination-Dis-nnBy.cjs.js.map → pagination-0rlXyI2R.cjs.js.map} +1 -1
  19. package/dist/chunks/{pagination-ZXOMcPAB.es.js → pagination-C4dyNajw.es.js} +2 -2
  20. package/dist/chunks/{pagination-ZXOMcPAB.es.js.map → pagination-C4dyNajw.es.js.map} +1 -1
  21. package/dist/chunks/{rich-text-input-3MgAtZuL.cjs.js → rich-text-input-DbpI_805.cjs.js} +12 -12
  22. package/dist/chunks/{rich-text-input-3MgAtZuL.cjs.js.map → rich-text-input-DbpI_805.cjs.js.map} +1 -1
  23. package/dist/chunks/{rich-text-input-C8bdPxGb.es.js → rich-text-input-DynX9BO2.es.js} +658 -655
  24. package/dist/chunks/{rich-text-input-C8bdPxGb.es.js.map → rich-text-input-DynX9BO2.es.js.map} +1 -1
  25. package/dist/chunks/select-5dgbT8AN.cjs.js +2 -0
  26. package/dist/chunks/{select-C1SC1XAp.cjs.js.map → select-5dgbT8AN.cjs.js.map} +1 -1
  27. package/dist/chunks/select-CwavXa9Y.es.js +580 -0
  28. package/dist/chunks/{select-DpHmAHrs.es.js.map → select-CwavXa9Y.es.js.map} +1 -1
  29. package/dist/components/components.cjs +1 -1
  30. package/dist/components/components.es.js +7 -7
  31. package/dist/components/data-table.cjs +1 -1
  32. package/dist/components/data-table.es.js +1 -1
  33. package/dist/components/form-field.cjs +1 -1
  34. package/dist/components/form-field.es.js +1 -1
  35. package/dist/components/money-input.cjs +1 -1
  36. package/dist/components/money-input.es.js +1 -1
  37. package/dist/components/pagination.cjs +1 -1
  38. package/dist/components/pagination.es.js +1 -1
  39. package/dist/components/rich-text-input.cjs +1 -1
  40. package/dist/components/rich-text-input.es.js +1 -1
  41. package/dist/components/select.cjs +1 -1
  42. package/dist/components/select.es.js +1 -1
  43. package/dist/components/tooltip.cjs +1 -1
  44. package/dist/components/tooltip.es.js +1 -1
  45. package/dist/components.d.ts +76 -21
  46. package/dist/data-table.d.ts +45 -14
  47. package/dist/form-field.d.ts +7 -4
  48. package/dist/index.cjs +1 -1
  49. package/dist/index.d.ts +74 -19
  50. package/dist/index.es.js +8 -8
  51. package/dist/select.d.ts +12 -4
  52. package/dist/tooltip.d.ts +13 -6
  53. package/package.json +5 -5
  54. package/dist/chunks/data-table-BBgNLX1F.cjs.js +0 -2
  55. package/dist/chunks/form-field-D2DlhLF_.cjs.js +0 -11
  56. package/dist/chunks/form-field-D2DlhLF_.cjs.js.map +0 -1
  57. package/dist/chunks/form-field-DY3B_1tq.es.js +0 -310
  58. package/dist/chunks/form-field-DY3B_1tq.es.js.map +0 -1
  59. package/dist/chunks/make-element-focusable-C4ZHUSEU.es.js +0 -22
  60. package/dist/chunks/make-element-focusable-C4ZHUSEU.es.js.map +0 -1
  61. package/dist/chunks/make-element-focusable-bPAMXt4D.cjs.js +0 -2
  62. package/dist/chunks/make-element-focusable-bPAMXt4D.cjs.js.map +0 -1
  63. package/dist/chunks/select-C1SC1XAp.cjs.js +0 -2
  64. package/dist/chunks/select-DpHmAHrs.es.js +0 -579
@@ -1,579 +0,0 @@
1
- import { jsx as d, jsxs as F } from "react/jsx-runtime";
2
- import m, { useMemo as z, useRef as I, useCallback as X, useState as B, forwardRef as N, createContext as j, useContext as _ } from "react";
3
- import { createSlotRecipeContext as de, useSlotRecipe as ce, chakra as fe } from "@chakra-ui/react/styled-system";
4
- import { Close as ue, Loop as be, KeyboardArrowDown as $e } from "@commercetools/nimbus-icons";
5
- import { B as U } from "./box-DuBoAZvq.es.js";
6
- import { $ as J, a as pe } from "./Button-CNBS3n5a.es.js";
7
- import { f as me, b as ve, c as he, g as ye, $ as ge } from "./Dialog-CpUyTYgL.es.js";
8
- import { $ as Q, c as Y, a as Z, b as xe, e as Se, d as Pe } from "./utils-BkdW_cdL.es.js";
9
- import { $ as Ce } from "./FieldError-CXcEMuBf.es.js";
10
- import { $ as Re } from "./Form-CXcEMuBf.es.js";
11
- import { $ as De } from "./intlStrings-Cd44R5hT.es.js";
12
- import { $ as ee } from "./Label-B2YyCdLl.es.js";
13
- import { a as Fe, b as Ke, c as Be, d as Ie, e as Ee } from "./ListBox-Vxd1SXUB.es.js";
14
- import { $ as G } from "./Text-DOcU1ycg.es.js";
15
- import { f as we, g as Oe } from "./Separator-Qp4OCFiC.es.js";
16
- import { $ as T, a as Me, e as ke } from "./mergeProps-B_9syxhT.es.js";
17
- import { $ as L } from "./filterDOMProps-BSVCO5jK.es.js";
18
- import { $ as qe, a as Ve } from "./OverlayArrow-sJzRZNbO.es.js";
19
- import { $ as Te } from "./useLocalizedStringFormatter-BRnRyxJp.es.js";
20
- import { a as ze, $ as Ne } from "./useFormValidation-4hZ1_a6w.es.js";
21
- import { $ as je } from "./useSingleSelectListState-BsnptkyP.es.js";
22
- import { $ as Ge } from "./useFocusRing-updnkDQg.es.js";
23
- import { $ as Le, j as We } from "./SelectionManager-BCXBpjO4.es.js";
24
- import { c as He } from "./useFocusVisible-CWDaG0ze.es.js";
25
- import { $ as Ae } from "./useCollator-BHMZd1r6.es.js";
26
- import { $ as Ue } from "./useField-Ce9zQxmx.es.js";
27
- import { $ as Xe } from "./useFormReset-DurgUJL-.es.js";
28
- import { a as _e } from "./VisuallyHidden-VHEPK04F.es.js";
29
- import { j as te } from "./index-CRta5Y1_.es.js";
30
- import { I as Je } from "./icon-button-C_i4ydsN.es.js";
31
- import { defineMessages as Qe, useIntl as Ye } from "react-intl";
32
- import { e as le } from "./extractStyleProps-DkXeCUuq.es.js";
33
- import { Flex as V } from "@chakra-ui/react/flex";
34
- import { c as Ze } from "./Header-CRiZqLJU.es.js";
35
- const W = /* @__PURE__ */ new WeakMap();
36
- function et(e, t, r) {
37
- let { keyboardDelegate: o, isDisabled: l, isRequired: n, name: c, form: i, validationBehavior: s = "aria" } = e, $ = Ae({
38
- usage: "search",
39
- sensitivity: "base"
40
- }), a = z(() => o || new Le(t.collection, t.disabledKeys, r, $), [
41
- o,
42
- t.collection,
43
- t.disabledKeys,
44
- $,
45
- r
46
- ]), { menuTriggerProps: p, menuProps: b } = me({
47
- isDisabled: l,
48
- type: "listbox"
49
- }, t, r), f = (u) => {
50
- switch (u.key) {
51
- case "ArrowLeft": {
52
- var g, x;
53
- u.preventDefault();
54
- let D = t.selectedKey != null ? (g = a.getKeyAbove) === null || g === void 0 ? void 0 : g.call(a, t.selectedKey) : (x = a.getFirstKey) === null || x === void 0 ? void 0 : x.call(a);
55
- D && t.setSelectedKey(D);
56
- break;
57
- }
58
- case "ArrowRight": {
59
- var k, q;
60
- u.preventDefault();
61
- let D = t.selectedKey != null ? (k = a.getKeyBelow) === null || k === void 0 ? void 0 : k.call(a, t.selectedKey) : (q = a.getFirstKey) === null || q === void 0 ? void 0 : q.call(a);
62
- D && t.setSelectedKey(D);
63
- break;
64
- }
65
- }
66
- }, { typeSelectProps: v } = We({
67
- keyboardDelegate: a,
68
- selectionManager: t.selectionManager,
69
- onTypeSelect(u) {
70
- t.setSelectedKey(u);
71
- }
72
- }), { isInvalid: P, validationErrors: C, validationDetails: E } = t.displayValidation, { labelProps: w, fieldProps: R, descriptionProps: y, errorMessageProps: O } = Ue({
73
- ...e,
74
- labelElementType: "span",
75
- isInvalid: P,
76
- errorMessage: e.errorMessage || C
77
- });
78
- v.onKeyDown = v.onKeyDownCapture, delete v.onKeyDownCapture;
79
- let M = L(e, {
80
- labelable: !0
81
- }), h = T(v, p, R), K = Me();
82
- return W.set(t, {
83
- isDisabled: l,
84
- isRequired: n,
85
- name: c,
86
- form: i,
87
- validationBehavior: s
88
- }), {
89
- labelProps: {
90
- ...w,
91
- onClick: () => {
92
- if (!e.isDisabled) {
93
- var u;
94
- (u = r.current) === null || u === void 0 || u.focus(), He("keyboard");
95
- }
96
- }
97
- },
98
- triggerProps: T(M, {
99
- ...h,
100
- isDisabled: l,
101
- onKeyDown: ke(h.onKeyDown, f, e.onKeyDown),
102
- onKeyUp: e.onKeyUp,
103
- "aria-labelledby": [
104
- K,
105
- h["aria-labelledby"],
106
- h["aria-label"] && !h["aria-labelledby"] ? h.id : null
107
- ].filter(Boolean).join(" "),
108
- onFocus(u) {
109
- t.isFocused || (e.onFocus && e.onFocus(u), e.onFocusChange && e.onFocusChange(!0), t.setFocused(!0));
110
- },
111
- onBlur(u) {
112
- t.isOpen || (e.onBlur && e.onBlur(u), e.onFocusChange && e.onFocusChange(!1), t.setFocused(!1));
113
- }
114
- }),
115
- valueProps: {
116
- id: K
117
- },
118
- menuProps: {
119
- ...b,
120
- autoFocus: t.focusStrategy || !0,
121
- shouldSelectOnPressUp: !0,
122
- shouldFocusOnHover: !0,
123
- disallowEmptySelection: !0,
124
- linkBehavior: "selection",
125
- onBlur: (u) => {
126
- u.currentTarget.contains(u.relatedTarget) || (e.onBlur && e.onBlur(u), e.onFocusChange && e.onFocusChange(!1), t.setFocused(!1));
127
- },
128
- "aria-labelledby": [
129
- R["aria-labelledby"],
130
- h["aria-label"] && !R["aria-labelledby"] ? h.id : null
131
- ].filter(Boolean).join(" ")
132
- },
133
- descriptionProps: y,
134
- errorMessageProps: O,
135
- isInvalid: P,
136
- validationErrors: C,
137
- validationDetails: E,
138
- hiddenSelectProps: {
139
- isDisabled: l,
140
- name: c,
141
- label: e.label,
142
- state: t,
143
- triggerRef: r,
144
- form: i
145
- }
146
- };
147
- }
148
- function tt(e, t, r) {
149
- let o = W.get(t) || {}, { autoComplete: l, name: n = o.name, form: c = o.form, isDisabled: i = o.isDisabled } = e, { validationBehavior: s, isRequired: $ } = o, { visuallyHiddenProps: a } = _e({
150
- style: {
151
- // Prevent page scrolling.
152
- position: "fixed",
153
- top: 0,
154
- left: 0
155
- }
156
- });
157
- Xe(e.selectRef, t.defaultSelectedKey, t.setSelectedKey), ze({
158
- validationBehavior: s,
159
- focus: () => {
160
- var f;
161
- return (f = r.current) === null || f === void 0 ? void 0 : f.focus();
162
- }
163
- }, t, e.selectRef);
164
- let p = X((f) => t.setSelectedKey(f.currentTarget.value), [
165
- t.setSelectedKey
166
- ]);
167
- var b;
168
- return {
169
- containerProps: {
170
- ...a,
171
- "aria-hidden": !0,
172
- // @ts-ignore
173
- "data-react-aria-prevent-focus": !0,
174
- // @ts-ignore
175
- "data-a11y-ignore": "aria-hidden-focus"
176
- },
177
- inputProps: {
178
- style: {
179
- display: "none"
180
- }
181
- },
182
- selectProps: {
183
- tabIndex: -1,
184
- autoComplete: l,
185
- disabled: i,
186
- required: s === "native" && $,
187
- name: n,
188
- form: c,
189
- value: (b = t.selectedKey) !== null && b !== void 0 ? b : "",
190
- onChange: p,
191
- onInput: p
192
- }
193
- };
194
- }
195
- function lt(e) {
196
- let { state: t, triggerRef: r, label: o, name: l, form: n, isDisabled: c } = e, i = I(null), s = I(null), { containerProps: $, selectProps: a } = tt({
197
- ...e,
198
- selectRef: t.collection.size <= 300 ? i : s
199
- }, t, r);
200
- if (t.collection.size <= 300) return /* @__PURE__ */ m.createElement("div", {
201
- ...$,
202
- "data-testid": "hidden-select-container"
203
- }, /* @__PURE__ */ m.createElement("label", null, o, /* @__PURE__ */ m.createElement("select", {
204
- ...a,
205
- ref: i
206
- }, /* @__PURE__ */ m.createElement("option", null), [
207
- ...t.collection.getKeys()
208
- ].map((b) => {
209
- let f = t.collection.getItem(b);
210
- if (f && f.type === "item") return /* @__PURE__ */ m.createElement("option", {
211
- key: f.key,
212
- value: f.key
213
- }, f.textValue);
214
- }))));
215
- if (l) {
216
- let b = W.get(t) || {}, { validationBehavior: f } = b;
217
- var p;
218
- let v = {
219
- type: "hidden",
220
- autoComplete: a.autoComplete,
221
- name: l,
222
- form: n,
223
- disabled: c,
224
- value: (p = t.selectedKey) !== null && p !== void 0 ? p : ""
225
- };
226
- return f === "native" ? /* @__PURE__ */ m.createElement("input", {
227
- ...v,
228
- ref: s,
229
- style: {
230
- display: "none"
231
- },
232
- type: "text",
233
- required: a.required,
234
- onChange: () => {
235
- }
236
- }) : /* @__PURE__ */ m.createElement("input", {
237
- ...v,
238
- ref: s
239
- });
240
- }
241
- return null;
242
- }
243
- function at(e) {
244
- let t = qe(e), [r, o] = B(null), l = je({
245
- ...e,
246
- onSelectionChange: (a) => {
247
- e.onSelectionChange != null && e.onSelectionChange(a), t.close(), n.commitValidation();
248
- }
249
- }), n = Ne({
250
- ...e,
251
- value: l.selectedKey
252
- }), [c, i] = B(!1), [s] = B(l.selectedKey);
253
- var $;
254
- return {
255
- ...n,
256
- ...l,
257
- ...t,
258
- defaultSelectedKey: ($ = e.defaultSelectedKey) !== null && $ !== void 0 ? $ : s,
259
- focusStrategy: r,
260
- open(a = null) {
261
- l.collection.size !== 0 && (o(a), t.open());
262
- },
263
- toggle(a = null) {
264
- l.collection.size !== 0 && (o(a), t.toggle());
265
- },
266
- isFocused: c,
267
- setFocused: i
268
- };
269
- }
270
- function ot(e) {
271
- return e && e.__esModule ? e.default : e;
272
- }
273
- const H = /* @__PURE__ */ j(null), A = /* @__PURE__ */ j(null), it = /* @__PURE__ */ N(function(t, r) {
274
- [t, r] = Q(t, r, H);
275
- let { children: o, isDisabled: l = !1, isInvalid: n = !1, isRequired: c = !1 } = t, i = z(() => typeof o == "function" ? o({
276
- isOpen: !1,
277
- isDisabled: l,
278
- isInvalid: n,
279
- isRequired: c,
280
- isFocused: !1,
281
- isFocusVisible: !1,
282
- defaultChildren: null
283
- }) : o, [
284
- o,
285
- l,
286
- n,
287
- c
288
- ]);
289
- return /* @__PURE__ */ m.createElement(we, {
290
- content: i
291
- }, (s) => /* @__PURE__ */ m.createElement(nt, {
292
- props: t,
293
- collection: s,
294
- selectRef: r
295
- }));
296
- }), rt = [
297
- ee,
298
- J,
299
- G
300
- ];
301
- function nt({ props: e, selectRef: t, collection: r }) {
302
- let { validationBehavior: o } = Y(Re) || {};
303
- var l, n;
304
- let c = (n = (l = e.validationBehavior) !== null && l !== void 0 ? l : o) !== null && n !== void 0 ? n : "native", i = at({
305
- ...e,
306
- collection: r,
307
- children: void 0,
308
- validationBehavior: c
309
- }), { isFocusVisible: s, focusProps: $ } = Ge({
310
- within: !0
311
- }), a = I(null), [p, b] = xe(!e["aria-label"] && !e["aria-labelledby"]), { labelProps: f, triggerProps: v, valueProps: P, menuProps: C, descriptionProps: E, errorMessageProps: w, hiddenSelectProps: R, ...y } = et({
312
- ...Se(e),
313
- label: b,
314
- validationBehavior: c
315
- }, i, a), [O, M] = B(null), h = X(() => {
316
- a.current && M(a.current.offsetWidth + "px");
317
- }, [
318
- a
319
- ]);
320
- Ve({
321
- ref: a,
322
- onResize: h
323
- });
324
- let K = z(() => ({
325
- isOpen: i.isOpen,
326
- isFocused: i.isFocused,
327
- isFocusVisible: s,
328
- isDisabled: e.isDisabled || !1,
329
- isInvalid: y.isInvalid || !1,
330
- isRequired: e.isRequired || !1
331
- }), [
332
- i.isOpen,
333
- i.isFocused,
334
- s,
335
- e.isDisabled,
336
- y.isInvalid,
337
- e.isRequired
338
- ]), u = Z({
339
- ...e,
340
- values: K,
341
- defaultClassName: "react-aria-Select"
342
- }), g = L(e, {
343
- global: !0
344
- });
345
- delete g.id;
346
- let x = I(null);
347
- return /* @__PURE__ */ m.createElement(Pe, {
348
- values: [
349
- [
350
- H,
351
- e
352
- ],
353
- [
354
- A,
355
- i
356
- ],
357
- [
358
- ae,
359
- P
360
- ],
361
- [
362
- ee,
363
- {
364
- ...f,
365
- ref: p,
366
- elementType: "span"
367
- }
368
- ],
369
- [
370
- J,
371
- {
372
- ...v,
373
- ref: a,
374
- isPressed: i.isOpen,
375
- autoFocus: e.autoFocus
376
- }
377
- ],
378
- [
379
- ve,
380
- i
381
- ],
382
- [
383
- he,
384
- {
385
- trigger: "Select",
386
- triggerRef: a,
387
- scrollRef: x,
388
- placement: "bottom start",
389
- style: {
390
- "--trigger-width": O
391
- },
392
- "aria-labelledby": C["aria-labelledby"],
393
- clearContexts: rt
394
- }
395
- ],
396
- [
397
- Fe,
398
- {
399
- ...C,
400
- ref: x
401
- }
402
- ],
403
- [
404
- Ke,
405
- i
406
- ],
407
- [
408
- G,
409
- {
410
- slots: {
411
- description: E,
412
- errorMessage: w
413
- }
414
- }
415
- ],
416
- [
417
- Ce,
418
- y
419
- ]
420
- ]
421
- }, /* @__PURE__ */ m.createElement("div", {
422
- ...T(g, u, $),
423
- ref: t,
424
- slot: e.slot || void 0,
425
- "data-focused": i.isFocused || void 0,
426
- "data-focus-visible": s || void 0,
427
- "data-open": i.isOpen || void 0,
428
- "data-disabled": e.isDisabled || void 0,
429
- "data-invalid": y.isInvalid || void 0,
430
- "data-required": e.isRequired || void 0
431
- }, u.children, /* @__PURE__ */ m.createElement(lt, {
432
- ...R,
433
- autoComplete: e.autoComplete
434
- })));
435
- }
436
- const ae = /* @__PURE__ */ j(null), st = /* @__PURE__ */ N(function(t, r) {
437
- var o, l;
438
- [t, r] = Q(t, r, ae);
439
- let n = _(A), { placeholder: c } = Y(H), i = n.selectedKey != null ? n.collection.getItem(n.selectedKey) : null, s = i?.props.children;
440
- typeof s == "function" && (s = s({
441
- isHovered: !1,
442
- isPressed: !1,
443
- isSelected: !1,
444
- isFocused: !1,
445
- isFocusVisible: !1,
446
- isDisabled: !1,
447
- selectionMode: "single",
448
- selectionBehavior: "toggle"
449
- }));
450
- let $ = Te(ot(De), "react-aria-components");
451
- var a, p, b;
452
- let f = Z({
453
- ...t,
454
- defaultChildren: (a = s ?? c) !== null && a !== void 0 ? a : $.format("selectPlaceholder"),
455
- defaultClassName: "react-aria-SelectValue",
456
- values: {
457
- selectedItem: (p = (o = n.selectedItem) === null || o === void 0 ? void 0 : o.value) !== null && p !== void 0 ? p : null,
458
- selectedText: (b = (l = n.selectedItem) === null || l === void 0 ? void 0 : l.textValue) !== null && b !== void 0 ? b : null,
459
- isPlaceholder: !i
460
- }
461
- }), v = L(t, {
462
- global: !0
463
- });
464
- return /* @__PURE__ */ m.createElement("span", {
465
- ref: r,
466
- ...v,
467
- ...f,
468
- "data-placeholder": !i || void 0
469
- }, /* @__PURE__ */ m.createElement(G.Provider, {
470
- value: void 0
471
- }, f.children));
472
- }), { withProvider: dt, withContext: S } = /* @__PURE__ */ de({
473
- recipe: te
474
- }), ct = /* @__PURE__ */ dt(
475
- "div",
476
- "root"
477
- ), ft = /* @__PURE__ */ S("div", "leadingElement"), ut = /* @__PURE__ */ S("button", "trigger"), bt = /* @__PURE__ */ S("span", "triggerLabel"), $t = /* @__PURE__ */ S("div", "options"), pt = /* @__PURE__ */ S("div", "option"), mt = /* @__PURE__ */ S("div", "optionGroup"), vt = /* @__PURE__ */ Qe({
478
- clearSelection: {
479
- id: "Nimbus.Select.clearSelection",
480
- description: "aria-label for select clear button",
481
- defaultMessage: "Clear selection"
482
- }
483
- }), oe = () => {
484
- const e = _(A), t = Ye();
485
- if (!e?.selectedKey)
486
- return null;
487
- const r = () => {
488
- e?.setSelectedKey(null);
489
- };
490
- return /* @__PURE__ */ d(ye, { children: /* @__PURE__ */ d(
491
- Je,
492
- {
493
- pointerEvents: "all",
494
- size: "2xs",
495
- variant: "ghost",
496
- "aria-label": t.formatMessage(vt.clearSelection),
497
- "aria-labelledby": "",
498
- onPress: r,
499
- children: /* @__PURE__ */ d(ue, {})
500
- }
501
- ) });
502
- };
503
- oe.displayName = "Select.ClearButton";
504
- const ie = /* @__PURE__ */ N(
505
- ({
506
- children: e,
507
- leadingElement: t,
508
- isLoading: r,
509
- isDisabled: o,
510
- isClearable: l = !0,
511
- ...n
512
- }, c) => {
513
- const i = ce({ recipe: te }), [s, $] = i.splitVariantProps(n), [a, p] = le($), b = {
514
- ...p,
515
- isDisabled: r || o
516
- };
517
- return /* @__PURE__ */ d(ct, { asChild: !0, ref: c, ...s, ...a, children: /* @__PURE__ */ F(it, { ...b, children: [
518
- /* @__PURE__ */ F(fe.div, { position: "relative", children: [
519
- /* @__PURE__ */ d(ut, { zIndex: 0, asChild: !0, children: /* @__PURE__ */ F(pe, { children: [
520
- t && /* @__PURE__ */ d(ft, { asChild: !0, children: t }),
521
- /* @__PURE__ */ d(bt, { asChild: !0, children: /* @__PURE__ */ d(st, {}) })
522
- ] }) }),
523
- /* @__PURE__ */ F(
524
- V,
525
- {
526
- position: "absolute",
527
- top: "0",
528
- bottom: "0",
529
- zIndex: 1,
530
- right: "400",
531
- pointerEvents: "none",
532
- children: [
533
- l && /* @__PURE__ */ d(V, { width: "600", my: "auto", children: /* @__PURE__ */ d(oe, {}) }),
534
- /* @__PURE__ */ d(V, { my: "auto", w: "600", h: "600", pointerEvents: "none", children: /* @__PURE__ */ d(U, { color: "neutral.9", asChild: !0, m: "auto", w: "400", h: "400", children: r ? /* @__PURE__ */ d(U, { asChild: !0, animation: "spin", animationDuration: "slowest", children: /* @__PURE__ */ d(be, {}) }) : /* @__PURE__ */ d($e, {}) }) })
535
- ]
536
- }
537
- )
538
- ] }),
539
- /* @__PURE__ */ d(ge, { children: e })
540
- ] }) });
541
- }
542
- );
543
- ie.displayName = "Select.Root";
544
- const re = (e) => {
545
- const { ref: t, ...r } = e, [o, l] = le(r);
546
- return /* @__PURE__ */ d($t, { asChild: !0, ...o, children: /* @__PURE__ */ d(Be, { ref: t, ...l }) });
547
- };
548
- re.displayName = "Select.Options";
549
- const ne = ({
550
- ref: e,
551
- ...t
552
- }) => /* @__PURE__ */ d(pt, { asChild: !0, ref: e, children: /* @__PURE__ */ d(Ie, { ...t }) });
553
- ne.displayName = "Select.Option";
554
- const se = (e) => {
555
- const { ref: t, label: r, items: o, children: l, ...n } = e;
556
- if (o && typeof l != "function")
557
- throw new Error(
558
- 'SelectOptionGroup: When "items" is provided, "children" must be a function'
559
- );
560
- return /* @__PURE__ */ F(Ee, { ref: t, ...n, children: [
561
- /* @__PURE__ */ d(mt, { asChild: !0, children: /* @__PURE__ */ d(Ze, { children: r }) }),
562
- o ? /* @__PURE__ */ d(Oe, { items: o, children: (c) => typeof l == "function" ? l(c) : null }) : l
563
- ] });
564
- };
565
- se.displayName = "Select.OptionGroup";
566
- const Yt = {
567
- Root: ie,
568
- Options: re,
569
- Option: ne,
570
- OptionGroup: se
571
- };
572
- export {
573
- Yt as S,
574
- ie as a,
575
- re as b,
576
- ne as c,
577
- se as d
578
- };
579
- //# sourceMappingURL=select-DpHmAHrs.es.js.map