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