@stenajs-webui/select 19.0.0-next.9 → 19.0.1

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.
package/dist/index.es.js CHANGED
@@ -1,26 +1,29 @@
1
1
  (function(){"use strict";try{var e=document.createElement("style");e.appendChild(document.createTextNode("")),document.head.appendChild(e)}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
2
- import * as F from "react";
3
- import { useMemo as p, memo as A, createElement as P } from "react";
4
- import M, { mergeStyles as w, components as h } from "react-select";
5
- import R from "react-select/async";
6
- import { jsx as a, jsxs as m } from "react/jsx-runtime";
7
- import { Row as g, Space as y, Text as _, Column as j, Spacing as S } from "@stenajs-webui/core";
8
- import { Icon as N, stenaCheck as U, Chip as I, FlatButton as q } from "@stenajs-webui/elements";
9
- import { uniqWith as E, isEqual as x, intersectionWith as H, differenceWith as X } from "lodash";
10
- const L = {
2
+ import { jsx as a, jsxs as h } from "react/jsx-runtime";
3
+ import * as R from "react";
4
+ import { useMemo as p, memo as _, createElement as j } from "react";
5
+ import H, { mergeStyles as w, components as b } from "react-select";
6
+ import V from "react-select/async";
7
+ import { cssColor as f } from "@stenajs-webui/theme";
8
+ import { CloseButton as B, Icon as N, stenaCheck as U, Chip as T, FlatButton as q } from "@stenajs-webui/elements";
9
+ import { Row as k, Space as y, Text as E, Column as X, Spacing as I } from "@stenajs-webui/core";
10
+ import { uniqWith as Y, isEqual as S, intersectionWith as L, differenceWith as J } from "lodash";
11
+ import K from "react-select/creatable";
12
+ const W = {
11
13
  arrowColor: {
14
+ disabled: f("--silver-light"),
12
15
  focused: {
13
- hover: "var(--lhds-color-ui-500)",
14
- standard: "var(--lhds-color-ui-500)"
16
+ hover: f("--lhds-color-blue-600"),
17
+ standard: f("--lhds-color-blue-600")
15
18
  },
16
19
  closed: {
17
- hover: "var(--lhds-color-ui-500)",
18
- standard: "var(--lhds-color-ui-500)"
20
+ hover: f("--lhds-color-blue-600"),
21
+ standard: f("--lhds-color-blue-600")
19
22
  }
20
23
  },
21
24
  clearButtonColor: {
22
- hover: "var(--lhds-color-ui-600)",
23
- standard: "var(--lhds-color-ui-500)"
25
+ hover: f("--lhds-color-red-600"),
26
+ standard: f("--lhds-color-red-500")
24
27
  },
25
28
  input: {
26
29
  backgroundColor: "var(--swui-field-bg-enabled)",
@@ -30,16 +33,15 @@ const L = {
30
33
  disabledBackgroundColor: "var(--swui-field-bg-disabled)",
31
34
  disabledBorderColor: "var(--swui-field-bg-disabled)",
32
35
  warningBackgroundColor: "var(--swui-state-alert-light-color)",
36
+ warningBorderColor: "var(--swui-state-alert-light-color)",
33
37
  errorBackgroundColor: "var(--swui-state-error-light-color)",
38
+ errorBorderColor: "var(--swui-state-error-light-color)",
34
39
  successBackgroundColor: "var(--swui-state-success-light-color)",
35
- warningBorderColor: "var(--swui-state-alert-color)",
36
- errorBorderColor: "var(--swui-state-error-color)",
37
- successBorderColor: "var(--swui-state-success-color)",
38
- boxShadowFocused: "var(--swui-field-focus-shadow)",
40
+ successBorderColor: "var(--swui-state-success-light-color)",
41
+ boxShadowFocused: "none",
39
42
  fontFamily: "var(--swui-font-primary)",
40
43
  fontSize: "var(--swui-font-size-inputs)",
41
- height: "32px",
42
- minHeight: "32px",
44
+ minHeight: "30px",
43
45
  placeholderColor: "var(--swui-field-text-color)",
44
46
  textColor: "var(--swui-field-text-color)",
45
47
  borderRadius: "var(--swui-field-border-radius)"
@@ -51,26 +53,26 @@ const L = {
51
53
  fontSize: "var(--swui-font-size-smaller)",
52
54
  lineHeight: "var(--swui-line-height-smaller)",
53
55
  fontWeight: "var(--swui-font-weight-text-bold)",
54
- color: "var(--lhds-color-ui-600)",
56
+ color: f("--lhds-color-ui-600"),
55
57
  letterSpacing: "0.1rem"
56
58
  },
57
59
  menu: {
58
- activeBackgroundColor: "var(--lhds-color-blue-100)",
60
+ activeBackgroundColor: f("--lhds-color-blue-100"),
59
61
  activeTextColor: "var(--swui-field-text-color)",
60
- selectedItemActiveBackgroundColor: "var(--lhds-color-blue-500)",
61
- selectedItemActiveTextColor: "var(--lhds-color-blue-50)",
62
+ selectedItemActiveBackgroundColor: f("--lhds-color-blue-500"),
63
+ selectedItemActiveTextColor: f("--lhds-color-blue-50"),
62
64
  disabledTextColor: "var(--swui-field-text-color-disabled)",
63
65
  disabledBackgroundColor: "var(--swui-field-bg-disabled)",
64
66
  textColor: "var(--swui-field-text-color)",
65
67
  backgroundColor: "var(--swui-field-bg-enabled)",
66
68
  hoverTextColor: "var(--swui-field-text-color)",
67
- hoverBackgroundColor: "var(--lhds-color-blue-200)",
68
- selectedItemTextColor: "var(--lhds-color-blue-500)",
69
- selectedItemIconColor: "var(--lhds-color-blue-500)",
69
+ hoverBackgroundColor: f("--lhds-color-blue-200"),
70
+ selectedItemTextColor: f("--lhds-color-blue-500"),
71
+ selectedItemIconColor: f("--lhds-color-blue-500"),
70
72
  selectedItemHoverTextColor: "var(--swui-field-text-color)",
71
73
  selectedItemHoverIconColor: "var(--swui-field-text-color)",
72
- selectedItemBackgroundColor: "var(--lhds-color-blue-50)",
73
- selectedItemHoverBackgroundColor: "var(--lhds-color-blue-50)",
74
+ selectedItemBackgroundColor: f("--lhds-color-blue-50"),
75
+ selectedItemHoverBackgroundColor: f("--lhds-color-blue-50"),
74
76
  zIndex: 1,
75
77
  width: "auto",
76
78
  minWidth: "100%",
@@ -81,13 +83,13 @@ const L = {
81
83
  },
82
84
  multiSelect: {
83
85
  backgroundColor: "var(--swui-primary-action-color)",
84
- textColor: "var(--lhds-color-blue-50)",
86
+ textColor: f("--lhds-color-blue-50"),
85
87
  removeButtonBackgroundColor: "transparent",
86
88
  removeButtonTextColor: "var(--swui-white)",
87
89
  removeButtonHoverBackgroundColor: "var(--swui-primary-action-color-hover)",
88
90
  removeButtonHoverTextColor: "var(--swui-white)"
89
91
  }
90
- }, Y = (e, r, o, t) => r ? e.disabledBackgroundColor : o && t ? e.selectedItemHoverBackgroundColor : o ? e.selectedItemBackgroundColor : t ? e.hoverBackgroundColor : void 0, D = (e, r, o, t) => r ? e.disabledTextColor : o && t ? e.selectedItemHoverTextColor : o ? e.selectedItemTextColor : t ? e.hoverTextColor : void 0, J = (e, r, o, t) => r ? e.disabledBackgroundColor : o ? e.backgroundColor : t === "warning" ? e.warningBackgroundColor : t === "success" ? e.successBackgroundColor : t === "error" ? e.errorBackgroundColor : e.backgroundColor, z = (e, r, o, t, n) => r ? e.disabledBorderColor : o ? e.borderColorFocused : n === "warning" ? e.warningBorderColor : n === "success" ? e.successBorderColor : n === "error" ? e.errorBorderColor : t ? e.borderColorFocused : e.borderColor, K = ({
92
+ }, Q = (e, r, o, t) => r ? e.disabledBackgroundColor : o && t ? e.selectedItemHoverBackgroundColor : o ? e.selectedItemBackgroundColor : t ? e.hoverBackgroundColor : void 0, Z = (e, r, o, t) => r ? e.disabledTextColor : o && t ? e.selectedItemHoverTextColor : o ? e.selectedItemTextColor : t ? e.hoverTextColor : void 0, $ = (e, r, o, t) => r ? e.disabledBackgroundColor : o ? e.backgroundColor : t === "warning" ? e.warningBackgroundColor : t === "success" ? e.successBackgroundColor : t === "error" ? e.errorBackgroundColor : e.backgroundColor, M = (e, r, o, t, n) => r ? e.disabledBorderColor : o ? e.borderColorFocused : n === "warning" ? e.warningBorderColor : n === "success" ? e.successBorderColor : n === "error" ? e.errorBorderColor : t ? e.borderColorFocused : e.borderColor, D = ({
91
93
  menu: e,
92
94
  menuPortal: r,
93
95
  input: o,
@@ -95,54 +97,57 @@ const L = {
95
97
  clearButtonColor: n,
96
98
  arrowColor: i,
97
99
  groupHeading: c,
98
- loadingIndicator: v
99
- }, u) => ({
100
- option: (l, { isDisabled: s, isFocused: d, isSelected: f }) => ({
100
+ loadingIndicator: s
101
+ }, m) => ({
102
+ option: (l, { isDisabled: d, isFocused: u, isSelected: C }) => ({
101
103
  ...l,
102
104
  fontFamily: o.fontFamily,
103
105
  fontSize: o.fontSize,
104
- backgroundColor: Y(
106
+ backgroundColor: Q(
105
107
  e,
106
- s,
107
- f,
108
- d
108
+ d,
109
+ C,
110
+ u
109
111
  ),
110
- color: D(e, s, f, d),
111
- cursor: s ? "not-allowed" : "default",
112
+ color: Z(e, d, C, u),
113
+ cursor: d ? "not-allowed" : "default",
112
114
  whiteSpace: e.whiteSpace || l.whiteSpace,
113
115
  ":active": {
114
- backgroundColor: s ? void 0 : f ? e.selectedItemActiveBackgroundColor : e.activeBackgroundColor,
115
- color: s ? void 0 : f ? e.selectedItemActiveTextColor : e.activeTextColor
116
+ backgroundColor: d ? void 0 : C ? e.selectedItemActiveBackgroundColor : e.activeBackgroundColor,
117
+ color: d ? void 0 : C ? e.selectedItemActiveTextColor : e.activeTextColor
116
118
  }
117
119
  }),
118
- control: (l, { isFocused: s, isDisabled: d, menuIsOpen: f }) => ({
120
+ control: (l, { isFocused: d, isDisabled: u, menuIsOpen: C }) => ({
119
121
  ...l,
120
122
  fontFamily: o.fontFamily,
121
123
  fontSize: o.fontSize,
122
124
  minHeight: o.minHeight,
123
- backgroundColor: J(
125
+ backgroundColor: $(
124
126
  o,
127
+ u,
125
128
  d,
126
- s,
127
- u
129
+ m
128
130
  ),
129
131
  borderRadius: o.borderRadius,
130
132
  border: o.border,
131
- "--swui-select-border-color": z(
133
+ "--swui-select-border-color": M(
132
134
  o,
133
- d,
134
- s || f,
135
+ u,
136
+ d || C,
135
137
  !1,
136
- u
138
+ m
137
139
  ),
138
- boxShadow: s ? o.boxShadowFocused : void 0,
140
+ outline: d ? "var(--swui-focus-outline)" : void 0,
141
+ outlineOffset: d ? "-1px" : void 0,
142
+ transition: "none",
143
+ boxShadow: d ? o.boxShadowFocused : void 0,
139
144
  "&:hover": {
140
- "--swui-select-border-color": z(
145
+ "--swui-select-border-color": M(
141
146
  o,
142
147
  !1,
143
- s || f,
148
+ d || C,
144
149
  !0,
145
- u
150
+ m
146
151
  )
147
152
  }
148
153
  }),
@@ -159,6 +164,7 @@ const L = {
159
164
  }),
160
165
  input: (l) => ({
161
166
  ...l,
167
+ minHeight: o.minHeight,
162
168
  fontFamily: o.fontFamily,
163
169
  fontSize: o.fontSize,
164
170
  color: o.textColor
@@ -205,12 +211,12 @@ const L = {
205
211
  ...l,
206
212
  padding: "0 8px"
207
213
  }),
208
- dropdownIndicator: (l, { isFocused: s }) => ({
214
+ dropdownIndicator: (l, { isFocused: d, isDisabled: u }) => ({
209
215
  ...l,
210
216
  padding: "5px",
211
- color: s ? i.focused.standard : i.closed.standard,
217
+ color: u ? i.disabled : d ? i.focused.standard : i.closed.standard,
212
218
  "&:hover": {
213
- color: s ? i.focused.hover : i.closed.hover
219
+ color: u ? i.disabled : d ? i.focused.hover : i.closed.hover
214
220
  },
215
221
  svg: {
216
222
  width: 14,
@@ -262,211 +268,216 @@ const L = {
262
268
  }),
263
269
  loadingMessage: (l) => ({
264
270
  ...l,
265
- color: v.textColor,
271
+ color: s.textColor,
266
272
  fontFamily: o.fontFamily,
267
273
  fontSize: o.fontSize
268
274
  })
269
- }), k = (e) => K(L, e);
270
- function Ce({
275
+ }), x = (e) => D(W, e);
276
+ function ke({
271
277
  variant: e = "standard",
272
278
  styles: r,
273
279
  isMulti: o,
274
280
  ...t
275
281
  }) {
276
282
  const n = p(() => {
277
- const i = k(e);
283
+ const i = x(e);
278
284
  return r ? w(i, r) : i;
279
285
  }, [e, r]);
280
- return /* @__PURE__ */ a(R, {
281
- styles: n,
282
- ...t,
283
- isMulti: !0
284
- });
286
+ return /* @__PURE__ */ a(V, { styles: n, ...t, isMulti: !0 });
285
287
  }
286
- function ge({
288
+ function Se({
287
289
  variant: e = "standard",
288
290
  styles: r,
289
291
  isMulti: o,
290
292
  ...t
291
293
  }) {
292
294
  const n = p(() => {
293
- const i = k(e);
295
+ const i = x(e);
294
296
  return r ? w(i, r) : i;
295
297
  }, [e, r]);
296
- return /* @__PURE__ */ a(R, {
297
- styles: n,
298
- ...t,
299
- isMulti: !1
300
- });
298
+ return /* @__PURE__ */ a(V, { styles: n, ...t, isMulti: !1 });
301
299
  }
302
- function B({
300
+ function O({
303
301
  variant: e = "standard",
304
302
  styles: r,
305
303
  isMulti: o,
306
- ...t
304
+ components: t,
305
+ ...n
307
306
  }) {
308
- const n = p(() => {
309
- const i = k(e);
310
- return r ? w(i, r) : i;
307
+ const i = p(() => {
308
+ const s = x(e);
309
+ return r ? w(s, r) : s;
311
310
  }, [e, r]);
312
- return /* @__PURE__ */ a(M, {
313
- styles: n,
314
- ...t,
315
- isMulti: !0
316
- });
311
+ return /* @__PURE__ */ a(
312
+ H,
313
+ {
314
+ styles: i,
315
+ components: { ...t, ClearIndicator: (s) => /* @__PURE__ */ a(B, { "aria-label": "Clear", onClick: s.clearValue }) },
316
+ ...n,
317
+ isMulti: !0
318
+ }
319
+ );
317
320
  }
318
- function pe(e) {
319
- return /* @__PURE__ */ a(B, {
320
- hideSelectedOptions: !1,
321
- ...e,
322
- components: {
323
- ...e.components,
324
- ValueContainer: Q
321
+ function Ie(e) {
322
+ return /* @__PURE__ */ a(
323
+ O,
324
+ {
325
+ hideSelectedOptions: !1,
326
+ ...e,
327
+ components: {
328
+ ...e.components,
329
+ ValueContainer: ee
330
+ }
325
331
  }
326
- });
332
+ );
327
333
  }
328
- const Q = A((e) => {
329
- const [r, ...o] = e.children, t = Z(r, e);
330
- return /* @__PURE__ */ m(h.ValueContainer, {
331
- ...e,
332
- children: [t, o]
333
- });
334
- }), Z = (e, {
334
+ const ee = _(
335
+ (e) => {
336
+ const [r, ...o] = e.children, t = oe(r, e);
337
+ return /* @__PURE__ */ h(b.ValueContainer, { ...e, children: [
338
+ t,
339
+ o
340
+ ] });
341
+ }
342
+ ), oe = (e, {
335
343
  children: r,
336
344
  innerProps: o,
337
345
  className: t,
338
346
  ...n
339
- }) => e ? e.length > 1 ? [e[0], /* @__PURE__ */ P(h.MultiValue, {
340
- ...n,
341
- key: "DUMMY_VALUE_FOR_PLUS_X",
342
- innerProps: {},
343
- data: null,
344
- isFocused: !1,
345
- removeProps: {},
346
- index: 1,
347
- components: {
348
- Container: h.MultiValueContainer,
349
- Label: h.MultiValueLabel,
350
- Remove: () => /* @__PURE__ */ a("div", {
351
- style: {
352
- height: 16,
353
- margin: 3,
354
- marginTop: 4
347
+ }) => e ? e.length > 1 ? [
348
+ e[0],
349
+ /* @__PURE__ */ j(
350
+ b.MultiValue,
351
+ {
352
+ ...n,
353
+ key: "DUMMY_VALUE_FOR_PLUS_X",
354
+ innerProps: {},
355
+ data: null,
356
+ isFocused: !1,
357
+ removeProps: {},
358
+ index: 1,
359
+ components: {
360
+ Container: b.MultiValueContainer,
361
+ Label: b.MultiValueLabel,
362
+ Remove: () => /* @__PURE__ */ a("div", { style: { height: 16, margin: 3, marginTop: 4 } })
355
363
  }
356
- })
357
- }
358
- }, "+" + (e.length - 1))] : e : null;
359
- function we({
364
+ },
365
+ "+" + (e.length - 1)
366
+ )
367
+ ] : e : null;
368
+ function ye({
360
369
  variant: e = "standard",
361
370
  styles: r,
362
371
  isMulti: o,
363
- ...t
372
+ components: t,
373
+ ...n
364
374
  }) {
365
- const n = p(() => {
366
- const i = k(e);
367
- return r ? w(i, r) : i;
375
+ const i = p(() => {
376
+ const s = x(e);
377
+ return r ? w(s, r) : s;
368
378
  }, [e, r]);
369
- return /* @__PURE__ */ a(M, {
370
- styles: n,
371
- ...t,
372
- isMulti: !1
373
- });
379
+ return /* @__PURE__ */ a(
380
+ H,
381
+ {
382
+ styles: i,
383
+ components: { ...t, ClearIndicator: (s) => /* @__PURE__ */ a(B, { "aria-label": "Clear", onClick: s.clearValue }) },
384
+ ...n,
385
+ isMulti: !1
386
+ }
387
+ );
374
388
  }
375
- const T = (e, r) => X(
389
+ const F = (e, r) => J(
376
390
  r,
377
391
  [...e.internalOptions, e],
378
- x
379
- ).map(C), $ = (e) => !("internalOptions" in e), b = (e) => e.filter($).map(C), ee = (e) => (r, o) => {
392
+ S
393
+ ).map(g), re = (e) => !("internalOptions" in e), v = (e) => e.filter(re).map(g), te = (e) => (r, o) => {
380
394
  const t = r != null ? r : [];
381
395
  switch (o.action) {
382
396
  case "select-option":
383
397
  if (o.option && "internalOptions" in o.option) {
384
- const n = E(
398
+ const n = Y(
385
399
  t.reduce(
386
400
  (i, c) => "internalOptions" in c ? [...i, ...c.internalOptions] : [
387
401
  ...i,
388
- C(c)
402
+ g(c)
389
403
  ],
390
404
  []
391
405
  ),
392
- x
406
+ S
393
407
  );
394
408
  e(n, o);
395
409
  } else
396
- e(b(t), o);
410
+ e(v(t), o);
397
411
  break;
398
412
  case "deselect-option":
399
413
  o.option && "internalOptions" in o.option ? e(
400
- T(
414
+ F(
401
415
  o.option,
402
- b(t)
416
+ v(t)
403
417
  ),
404
418
  o
405
- ) : e(b(t), o);
419
+ ) : e(v(t), o);
406
420
  break;
407
421
  case "remove-value":
408
422
  case "pop-value":
409
423
  o.removedValue && "internalOptions" in o.removedValue ? e(
410
- T(
424
+ F(
411
425
  o.removedValue,
412
- b(t)
426
+ v(t)
413
427
  ),
414
428
  o
415
- ) : e(b(t), o);
429
+ ) : e(v(t), o);
416
430
  break;
417
431
  case "clear":
418
432
  e(
419
- t.map(C),
433
+ t.map(g),
420
434
  o
421
435
  );
422
436
  break;
423
437
  case "create-option":
424
438
  e(
425
- t.map(C),
439
+ t.map(g),
426
440
  o
427
441
  );
428
442
  break;
429
443
  }
430
- }, oe = (e) => e.reduce(
444
+ }, le = (e) => e.reduce(
431
445
  (r, o) => [
432
446
  ...r,
433
- G(o),
434
- ...o.options.map(W)
447
+ A(o),
448
+ ...o.options.map(G)
435
449
  ],
436
450
  []
437
- ), re = (e, r) => {
451
+ ), ne = (e, r) => {
438
452
  if (!r)
439
453
  return [];
440
454
  const o = [];
441
455
  return e.forEach((t) => {
442
- te(t.options, r) && o.push(
443
- G(t)
456
+ ie(t.options, r) && o.push(
457
+ A(t)
444
458
  ), o.push(
445
- ...H(t.options, r, x).map(
446
- (n) => W(n)
459
+ ...L(t.options, r, S).map(
460
+ (n) => G(n)
447
461
  )
448
462
  );
449
463
  }), o;
450
- }, te = (e, r) => r ? H(e, r, x).length === e.length : !1, W = (e) => ({
464
+ }, ie = (e, r) => r ? L(e, r, S).length === e.length : !1, G = (e) => ({
451
465
  data: e.data,
452
466
  label: e.label,
453
467
  value: e.value
454
- }), G = (e) => ({
468
+ }), A = (e) => ({
455
469
  data: e.label,
456
470
  label: e.label,
457
471
  value: e.label,
458
472
  internalOptions: e.options
459
- }), C = (e) => ({
473
+ }), g = (e) => ({
460
474
  data: e.data,
461
475
  label: e.label,
462
476
  value: e.value
463
- }), le = (e, r) => r ? e.menu.selectedItemHoverIconColor : e.menu.selectedItemIconColor;
464
- function ne(e) {
477
+ }), ae = (e, r) => r ? e.menu.selectedItemHoverIconColor : e.menu.selectedItemIconColor;
478
+ function ce(e) {
465
479
  var t;
466
- const {
467
- formatGroupLabel: r,
468
- formatOptionLabel: o
469
- } = e.selectProps;
480
+ const { formatGroupLabel: r, formatOptionLabel: o } = e.selectProps;
470
481
  return "internalOptions" in e.data ? r ? r({
471
482
  label: e.data.label,
472
483
  options: e.data.internalOptions
@@ -476,7 +487,7 @@ function ne(e) {
476
487
  selectValue: e.getValue()
477
488
  }) : e.label;
478
489
  }
479
- function ie({
490
+ function se({
480
491
  onChange: e,
481
492
  options: r,
482
493
  value: o,
@@ -485,100 +496,116 @@ function ie({
485
496
  formatOptionLabel: i,
486
497
  ...c
487
498
  }) {
488
- const v = (d) => {
489
- const f = ne(d), O = "internalOptions" in d.data;
490
- return /* @__PURE__ */ a(h.Option, {
491
- ...d,
492
- children: /* @__PURE__ */ m(g, {
493
- children: [!O && /* @__PURE__ */ a(y, {}), /* @__PURE__ */ a(ae, {
494
- theme: L,
495
- size: O ? void 0 : "small",
496
- label: f,
497
- selected: d.isSelected,
498
- focused: d.isFocused
499
- })]
500
- })
501
- });
502
- }, u = (d) => "internalOptions" in d.data ? null : /* @__PURE__ */ a(h.MultiValue, {
503
- ...d
504
- }), l = r ? re(r, o) : void 0, s = r ? oe(r) : void 0;
505
- return /* @__PURE__ */ a(B, {
506
- ...c,
507
- onChange: e ? ee(e) : void 0,
508
- hideSelectedOptions: !1,
509
- components: {
510
- ...c.components,
511
- MultiValue: u,
512
- Option: v
513
- },
514
- isMulti: !0,
515
- options: s,
516
- value: l,
517
- variant: t
518
- });
499
+ const s = (u) => {
500
+ const C = ce(u), z = "internalOptions" in u.data;
501
+ return /* @__PURE__ */ a(b.Option, { ...u, children: /* @__PURE__ */ h(k, { children: [
502
+ !z && /* @__PURE__ */ a(y, {}),
503
+ /* @__PURE__ */ a(
504
+ de,
505
+ {
506
+ theme: W,
507
+ size: z ? void 0 : "small",
508
+ label: C,
509
+ selected: u.isSelected,
510
+ focused: u.isFocused
511
+ }
512
+ )
513
+ ] }) });
514
+ }, m = (u) => "internalOptions" in u.data ? null : /* @__PURE__ */ a(b.MultiValue, { ...u }), l = r ? ne(r, o) : void 0, d = r ? le(r) : void 0;
515
+ return /* @__PURE__ */ a(
516
+ O,
517
+ {
518
+ ...c,
519
+ onChange: e ? te(e) : void 0,
520
+ hideSelectedOptions: !1,
521
+ components: {
522
+ ...c.components,
523
+ MultiValue: m,
524
+ Option: s
525
+ },
526
+ isMulti: !0,
527
+ options: d,
528
+ value: l,
529
+ variant: t
530
+ }
531
+ );
519
532
  }
520
- const ae = ({
533
+ const de = ({
521
534
  focused: e,
522
535
  label: r,
523
536
  selected: o,
524
537
  size: t,
525
538
  theme: n
526
- }) => /* @__PURE__ */ m(g, {
527
- alignItems: "center",
528
- justifyContent: "space-between",
529
- flexGrow: 1,
530
- children: [/* @__PURE__ */ a(_, {
531
- tabIndex: -1,
532
- size: t,
533
- color: "currentColor",
534
- children: r
535
- }), o && /* @__PURE__ */ a(N, {
536
- color: le(n, e),
537
- icon: U,
538
- size: 12
539
- })]
540
- });
541
- function V({
539
+ }) => /* @__PURE__ */ h(k, { alignItems: "center", justifyContent: "space-between", flexGrow: 1, children: [
540
+ /* @__PURE__ */ a(E, { tabIndex: -1, size: t, color: "currentColor", children: r }),
541
+ o && /* @__PURE__ */ a(
542
+ N,
543
+ {
544
+ color: ae(n, e),
545
+ icon: U,
546
+ size: 12
547
+ }
548
+ )
549
+ ] });
550
+ function Be({
551
+ variant: e = "standard",
552
+ styles: r,
553
+ isMulti: o,
554
+ components: t,
555
+ ariaLabelClear: n = "Clear",
556
+ ...i
557
+ }) {
558
+ const c = p(() => {
559
+ const m = x(e);
560
+ return r ? w(m, r) : m;
561
+ }, [e, r]);
562
+ return /* @__PURE__ */ a(
563
+ K,
564
+ {
565
+ styles: c,
566
+ components: { ...t, ClearIndicator: (m) => /* @__PURE__ */ a(B, { "aria-label": n, onClick: m.clearValue }) },
567
+ ...i,
568
+ isMulti: !1
569
+ }
570
+ );
571
+ }
572
+ function P({
542
573
  value: e,
543
574
  onValueChange: r,
544
575
  noneSelectedLabel: o = "None",
545
576
  children: t
546
577
  }) {
547
- return /* @__PURE__ */ m(j, {
548
- flex: 1,
549
- children: [/* @__PURE__ */ m(g, {
550
- flexWrap: "wrap",
551
- children: [e == null ? void 0 : e.map((n) => /* @__PURE__ */ m(g, {
552
- children: [/* @__PURE__ */ a(S, {
553
- num: 0.5,
554
- children: /* @__PURE__ */ a(I, {
578
+ return /* @__PURE__ */ h(X, { flex: 1, children: [
579
+ /* @__PURE__ */ h(k, { flexWrap: "wrap", children: [
580
+ e == null ? void 0 : e.map((n) => /* @__PURE__ */ h(k, { children: [
581
+ /* @__PURE__ */ a(I, { num: 0.5, children: /* @__PURE__ */ a(
582
+ T,
583
+ {
555
584
  label: n.label,
556
585
  onClickRemove: () => {
557
586
  var i;
558
- return r == null ? void 0 : r((i = e == null ? void 0 : e.filter((c) => c.value !== n.value)) != null ? i : []);
587
+ return r == null ? void 0 : r(
588
+ (i = e == null ? void 0 : e.filter((c) => c.value !== n.value)) != null ? i : []
589
+ );
559
590
  }
560
- })
561
- }), /* @__PURE__ */ a(y, {})]
562
- }, n.value)), e != null && e.length ? /* @__PURE__ */ a(S, {
563
- num: 0.5,
564
- children: /* @__PURE__ */ a(q, {
591
+ }
592
+ ) }),
593
+ /* @__PURE__ */ a(y, {})
594
+ ] }, n.value)),
595
+ e != null && e.length ? /* @__PURE__ */ a(I, { num: 0.5, children: /* @__PURE__ */ a(
596
+ q,
597
+ {
565
598
  size: "small",
566
599
  label: "Clear",
567
600
  onClick: () => r == null ? void 0 : r([])
568
- })
569
- }) : /* @__PURE__ */ a(S, {
570
- num: 0.5,
571
- children: /* @__PURE__ */ a(I, {
572
- variant: "secondary",
573
- label: o
574
- })
575
- })]
576
- }), /* @__PURE__ */ a(y, {
577
- num: 0.5
578
- }), t]
579
- });
601
+ }
602
+ ) }) : /* @__PURE__ */ a(I, { num: 0.5, children: /* @__PURE__ */ a(T, { variant: "secondary", label: o }) })
603
+ ] }),
604
+ /* @__PURE__ */ a(y, { num: 0.5 }),
605
+ t
606
+ ] });
580
607
  }
581
- function ce({
608
+ function ue({
582
609
  value: e,
583
610
  onValueChange: r,
584
611
  placeholder: o = "Type to search",
@@ -586,29 +613,37 @@ function ce({
586
613
  inputValue: n,
587
614
  onInputChange: i,
588
615
  noneSelectedLabel: c = "None",
589
- ...v
616
+ ...s
590
617
  }) {
591
- return /* @__PURE__ */ a(V, {
592
- noneSelectedLabel: c,
593
- onValueChange: r,
594
- value: e,
595
- children: /* @__PURE__ */ a(B, {
596
- ...v,
597
- isClearable: !1,
618
+ return /* @__PURE__ */ a(
619
+ P,
620
+ {
621
+ noneSelectedLabel: c,
622
+ onValueChange: r,
598
623
  value: e,
599
- onChange: r ? (u) => r([...u]) : void 0,
600
- backspaceRemovesValue: !1,
601
- hideSelectedOptions: !0,
602
- controlShouldRenderValue: !1,
603
- placeholder: o,
604
- isLoading: t,
605
- inputValue: n,
606
- onInputChange: i
607
- })
608
- });
624
+ children: /* @__PURE__ */ a(
625
+ O,
626
+ {
627
+ ...s,
628
+ isClearable: !1,
629
+ value: e,
630
+ onChange: r ? (m) => r([...m]) : void 0,
631
+ backspaceRemovesValue: !1,
632
+ hideSelectedOptions: !0,
633
+ controlShouldRenderValue: !1,
634
+ placeholder: o,
635
+ isLoading: t,
636
+ inputValue: n,
637
+ onInputChange: i
638
+ }
639
+ )
640
+ }
641
+ );
609
642
  }
610
- const xe = F.memo(ce);
611
- function se({
643
+ const Oe = R.memo(
644
+ ue
645
+ );
646
+ function fe({
612
647
  value: e,
613
648
  onValueChange: r,
614
649
  placeholder: o = "Type to search",
@@ -616,39 +651,48 @@ function se({
616
651
  inputValue: n,
617
652
  onInputChange: i,
618
653
  noneSelectedLabel: c = "None",
619
- ...v
654
+ ...s
620
655
  }) {
621
- return /* @__PURE__ */ a(V, {
622
- noneSelectedLabel: c,
623
- onValueChange: r,
624
- value: e,
625
- children: /* @__PURE__ */ a(ie, {
626
- ...v,
627
- isClearable: !1,
656
+ return /* @__PURE__ */ a(
657
+ P,
658
+ {
659
+ noneSelectedLabel: c,
660
+ onValueChange: r,
628
661
  value: e,
629
- onChange: r ? (u) => r([...u]) : void 0,
630
- backspaceRemovesValue: !1,
631
- hideSelectedOptions: !0,
632
- controlShouldRenderValue: !1,
633
- placeholder: o,
634
- isLoading: t,
635
- inputValue: n,
636
- onInputChange: i
637
- })
638
- });
662
+ children: /* @__PURE__ */ a(
663
+ se,
664
+ {
665
+ ...s,
666
+ isClearable: !1,
667
+ value: e,
668
+ onChange: r ? (m) => r([...m]) : void 0,
669
+ backspaceRemovesValue: !1,
670
+ hideSelectedOptions: !0,
671
+ controlShouldRenderValue: !1,
672
+ placeholder: o,
673
+ isLoading: t,
674
+ inputValue: n,
675
+ onInputChange: i
676
+ }
677
+ )
678
+ }
679
+ );
639
680
  }
640
- const ke = F.memo(se);
681
+ const ze = R.memo(
682
+ fe
683
+ );
641
684
  export {
642
- Ce as AsyncMultiSelect,
643
- ge as AsyncSelect,
644
- xe as ChipMultiSelect,
645
- ke as GroupedChipMultiSelect,
646
- ie as GroupedMultiSelect,
647
- B as MultiSelect,
648
- pe as OverflowingMultiSelect,
649
- we as Select,
650
- K as createStylesFromTheme,
651
- k as createStylesFromVariant,
652
- L as defaultSelectTheme
685
+ ke as AsyncMultiSelect,
686
+ Se as AsyncSelect,
687
+ Oe as ChipMultiSelect,
688
+ Be as CreatableSelect,
689
+ ze as GroupedChipMultiSelect,
690
+ se as GroupedMultiSelect,
691
+ O as MultiSelect,
692
+ Ie as OverflowingMultiSelect,
693
+ ye as Select,
694
+ D as createStylesFromTheme,
695
+ x as createStylesFromVariant,
696
+ W as defaultSelectTheme
653
697
  };
654
698
  //# sourceMappingURL=index.es.js.map