@alixpartners/ui-components 2.0.0-beta.9 → 2.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.
Files changed (53) hide show
  1. package/README.md +2 -2
  2. package/dist/ap-logos-Cl1TR5nm.js +4 -0
  3. package/dist/assets/Banner.css +1 -1
  4. package/dist/assets/Button.css +1 -1
  5. package/dist/assets/Checkbox.css +1 -1
  6. package/dist/assets/Dialog.css +1 -1
  7. package/dist/assets/DragAndDrop.css +1 -1
  8. package/dist/assets/Dropdown.css +1 -1
  9. package/dist/assets/Input.css +1 -1
  10. package/dist/assets/LogosGallery.css +1 -0
  11. package/dist/assets/NavBar.css +1 -1
  12. package/dist/assets/SplitButton.css +1 -1
  13. package/dist/assets/TabNavigation.css +1 -1
  14. package/dist/assets/Tag.css +1 -1
  15. package/dist/assets/Textarea.css +1 -1
  16. package/dist/assets/Toast.css +1 -1
  17. package/dist/assets/ap-icons-types.d.ts +1 -1
  18. package/dist/assets/ap-icons.d.ts +1 -1
  19. package/dist/assets/ap-logos-types.d.ts +1 -0
  20. package/dist/assets/ap-logos.d.ts +1 -0
  21. package/dist/assets/main.css +1 -1
  22. package/dist/components/Button/Button.d.ts +11 -12
  23. package/dist/components/Button/Button.js +15 -14
  24. package/dist/components/Creatable/Creatable.d.ts +3 -1
  25. package/dist/components/Creatable/Creatable.js +26 -25
  26. package/dist/components/Dialog/Dialog.d.ts +15 -4
  27. package/dist/components/Dialog/Dialog.js +58 -42
  28. package/dist/components/DragAndDrop/DragAndDrop.d.ts +4 -1
  29. package/dist/components/DragAndDrop/DragAndDrop.js +82 -72
  30. package/dist/components/Dropdown/Dropdown.d.ts +8 -1
  31. package/dist/components/Dropdown/Dropdown.js +354 -320
  32. package/dist/components/Icons/IconsGallery.js +1 -1
  33. package/dist/components/Input/Input.d.ts +23 -22
  34. package/dist/components/Input/Input.js +62 -60
  35. package/dist/components/Logo/Logo.d.ts +8 -0
  36. package/dist/components/Logo/Logo.js +57 -0
  37. package/dist/components/Logos/LogosGallery.d.ts +1 -0
  38. package/dist/components/Logos/LogosGallery.js +16 -0
  39. package/dist/components/NavBar/NavBar.d.ts +13 -5
  40. package/dist/components/NavBar/NavBar.js +246 -230
  41. package/dist/components/SplitButton/SplitButton.js +20 -18
  42. package/dist/components/Tab/Tab.js +19 -19
  43. package/dist/components/TabNavigation/TabNavigation.js +11 -10
  44. package/dist/components/Tag/Tag.js +8 -8
  45. package/dist/components/Textarea/Textarea.d.ts +2 -2
  46. package/dist/components/Toast/Toast.js +2 -2
  47. package/dist/components/Toast/Toast.test.js +1 -1
  48. package/dist/components/Tooltip/Tooltip.d.ts +1 -1
  49. package/dist/components/Tooltip/Tooltip.js +12 -10
  50. package/dist/main.d.ts +5 -3
  51. package/dist/main.js +29 -25
  52. package/dist/storybook-docs-page.d.ts +4 -1
  53. package/package.json +1 -1
@@ -1,118 +1,118 @@
1
- import { jsx as t, jsxs as f } from "react/jsx-runtime";
2
- import { c as P } from "../../clsx-OuTLNxxd.js";
1
+ import { jsx as t, jsxs as v } from "react/jsx-runtime";
2
+ import { c as R } from "../../clsx-OuTLNxxd.js";
3
3
  import * as m from "react";
4
- import { useState as B, useRef as Y, useEffect as W, useCallback as te } from "react";
5
- import U from "../Icon/Icon.js";
6
- import $e from "../Toggle/Toggle.js";
7
- import ne from "../Button/Button.js";
8
- import pe from "../Ghost/Ghost.js";
9
- import He from "../Search/Search.js";
10
- import Qe from "../Tooltip/Tooltip.js";
11
- import { u as eo, c as oo, d as ue, P as _e, a as J, g as to } from "../../index-DWydnyjJ.js";
12
- import { c as me, R as no, A as we, P as ro, D as lo, C as so, a as ao } from "../../index-DieLVN0p.js";
13
- import { h as co, R as io, u as po, F as uo } from "../../index-BGZDIjm9.js";
14
- import { u as _o } from "../../index-2H7slGYV.js";
15
- import { P as fe } from "../../index-DpfPnSMn.js";
16
- import '../../assets/Dropdown.css';var Z = "Popover", [ve, Tt] = oo(Z, [
17
- me
18
- ]), K = me(), [mo, T] = ve(Z), he = (n) => {
4
+ import { useState as W, useRef as U, useEffect as q, useCallback as ae } from "react";
5
+ import K from "../Icon/Icon.js";
6
+ import co from "../Toggle/Toggle.js";
7
+ import ce from "../Button/Button.js";
8
+ import ge from "../Ghost/Ghost.js";
9
+ import io from "../Search/Search.js";
10
+ import po from "../Tooltip/Tooltip.js";
11
+ import { u as uo, c as _o, d as Ce, P as Ie, a as X, g as mo } from "../../index-DWydnyjJ.js";
12
+ import { c as Ne, R as fo, A as Pe, P as wo, D as vo, C as ho, a as bo } from "../../index-DieLVN0p.js";
13
+ import { h as Do, R as go, u as Co, F as Io } from "../../index-BGZDIjm9.js";
14
+ import { u as No } from "../../index-2H7slGYV.js";
15
+ import { P as Oe } from "../../index-DpfPnSMn.js";
16
+ import '../../assets/Dropdown.css';var te = "Popover", [Ae, Xt] = _o(te, [
17
+ Ne
18
+ ]), Y = Ne(), [Po, G] = Ae(te), Re = (n) => {
19
19
  const {
20
20
  __scopePopover: p,
21
- children: c,
22
- open: a,
23
- defaultOpen: s,
24
- onOpenChange: r,
21
+ children: a,
22
+ open: l,
23
+ defaultOpen: c,
24
+ onOpenChange: s,
25
25
  modal: _ = !1
26
- } = n, u = K(p), A = m.useRef(null), [h, x] = m.useState(!1), [S, R] = eo({
27
- prop: a,
28
- defaultProp: s ?? !1,
29
- onChange: r,
30
- caller: Z
26
+ } = n, u = Y(p), y = m.useRef(null), [D, E] = m.useState(!1), [T, L] = uo({
27
+ prop: l,
28
+ defaultProp: c ?? !1,
29
+ onChange: s,
30
+ caller: te
31
31
  });
32
- return /* @__PURE__ */ t(no, { ...u, children: /* @__PURE__ */ t(
33
- mo,
32
+ return /* @__PURE__ */ t(fo, { ...u, children: /* @__PURE__ */ t(
33
+ Po,
34
34
  {
35
35
  scope: p,
36
- contentId: _o(),
37
- triggerRef: A,
38
- open: S,
39
- onOpenChange: R,
40
- onOpenToggle: m.useCallback(() => R((i) => !i), [R]),
41
- hasCustomAnchor: h,
42
- onCustomAnchorAdd: m.useCallback(() => x(!0), []),
43
- onCustomAnchorRemove: m.useCallback(() => x(!1), []),
36
+ contentId: No(),
37
+ triggerRef: y,
38
+ open: T,
39
+ onOpenChange: L,
40
+ onOpenToggle: m.useCallback(() => L((i) => !i), [L]),
41
+ hasCustomAnchor: D,
42
+ onCustomAnchorAdd: m.useCallback(() => E(!0), []),
43
+ onCustomAnchorRemove: m.useCallback(() => E(!1), []),
44
44
  modal: _,
45
- children: c
45
+ children: a
46
46
  }
47
47
  ) });
48
48
  };
49
- he.displayName = Z;
50
- var be = "PopoverAnchor", ge = m.forwardRef(
49
+ Re.displayName = te;
50
+ var ye = "PopoverAnchor", Le = m.forwardRef(
51
51
  (n, p) => {
52
- const { __scopePopover: c, ...a } = n, s = T(be, c), r = K(c), { onCustomAnchorAdd: _, onCustomAnchorRemove: u } = s;
53
- return m.useEffect(() => (_(), () => u()), [_, u]), /* @__PURE__ */ t(we, { ...r, ...a, ref: p });
52
+ const { __scopePopover: a, ...l } = n, c = G(ye, a), s = Y(a), { onCustomAnchorAdd: _, onCustomAnchorRemove: u } = c;
53
+ return m.useEffect(() => (_(), () => u()), [_, u]), /* @__PURE__ */ t(Pe, { ...s, ...l, ref: p });
54
54
  }
55
55
  );
56
- ge.displayName = be;
57
- var De = "PopoverTrigger", Ce = m.forwardRef(
56
+ Le.displayName = ye;
57
+ var xe = "PopoverTrigger", ke = m.forwardRef(
58
58
  (n, p) => {
59
- const { __scopePopover: c, ...a } = n, s = T(De, c), r = K(c), _ = ue(p, s.triggerRef), u = /* @__PURE__ */ t(
60
- _e.button,
59
+ const { __scopePopover: a, ...l } = n, c = G(xe, a), s = Y(a), _ = Ce(p, c.triggerRef), u = /* @__PURE__ */ t(
60
+ Ie.button,
61
61
  {
62
62
  type: "button",
63
63
  "aria-haspopup": "dialog",
64
- "aria-expanded": s.open,
65
- "aria-controls": s.contentId,
66
- "data-state": Ae(s.open),
67
- ...a,
64
+ "aria-expanded": c.open,
65
+ "aria-controls": c.contentId,
66
+ "data-state": Te(c.open),
67
+ ...l,
68
68
  ref: _,
69
- onClick: J(n.onClick, s.onOpenToggle)
69
+ onClick: X(n.onClick, c.onOpenToggle)
70
70
  }
71
71
  );
72
- return s.hasCustomAnchor ? u : /* @__PURE__ */ t(we, { asChild: !0, ...r, children: u });
72
+ return c.hasCustomAnchor ? u : /* @__PURE__ */ t(Pe, { asChild: !0, ...s, children: u });
73
73
  }
74
74
  );
75
- Ce.displayName = De;
76
- var re = "PopoverPortal", [wo, fo] = ve(re, {
75
+ ke.displayName = xe;
76
+ var ie = "PopoverPortal", [Oo, Ao] = Ae(ie, {
77
77
  forceMount: void 0
78
- }), Ie = (n) => {
79
- const { __scopePopover: p, forceMount: c, children: a, container: s } = n, r = T(re, p);
80
- return /* @__PURE__ */ t(wo, { scope: p, forceMount: c, children: /* @__PURE__ */ t(fe, { present: c || r.open, children: /* @__PURE__ */ t(ro, { asChild: !0, container: s, children: a }) }) });
78
+ }), Ee = (n) => {
79
+ const { __scopePopover: p, forceMount: a, children: l, container: c } = n, s = G(ie, p);
80
+ return /* @__PURE__ */ t(Oo, { scope: p, forceMount: a, children: /* @__PURE__ */ t(Oe, { present: a || s.open, children: /* @__PURE__ */ t(wo, { asChild: !0, container: c, children: l }) }) });
81
81
  };
82
- Ie.displayName = re;
83
- var z = "PopoverContent", Ne = m.forwardRef(
82
+ Ee.displayName = ie;
83
+ var J = "PopoverContent", Me = m.forwardRef(
84
84
  (n, p) => {
85
- const c = fo(z, n.__scopePopover), { forceMount: a = c.forceMount, ...s } = n, r = T(z, n.__scopePopover);
86
- return /* @__PURE__ */ t(fe, { present: a || r.open, children: r.modal ? /* @__PURE__ */ t(ho, { ...s, ref: p }) : /* @__PURE__ */ t(bo, { ...s, ref: p }) });
85
+ const a = Ao(J, n.__scopePopover), { forceMount: l = a.forceMount, ...c } = n, s = G(J, n.__scopePopover);
86
+ return /* @__PURE__ */ t(Oe, { present: l || s.open, children: s.modal ? /* @__PURE__ */ t(yo, { ...c, ref: p }) : /* @__PURE__ */ t(Lo, { ...c, ref: p }) });
87
87
  }
88
88
  );
89
- Ne.displayName = z;
90
- var vo = to("PopoverContent.RemoveScroll"), ho = m.forwardRef(
89
+ Me.displayName = J;
90
+ var Ro = mo("PopoverContent.RemoveScroll"), yo = m.forwardRef(
91
91
  (n, p) => {
92
- const c = T(z, n.__scopePopover), a = m.useRef(null), s = ue(p, a), r = m.useRef(!1);
92
+ const a = G(J, n.__scopePopover), l = m.useRef(null), c = Ce(p, l), s = m.useRef(!1);
93
93
  return m.useEffect(() => {
94
- const _ = a.current;
95
- if (_) return co(_);
96
- }, []), /* @__PURE__ */ t(io, { as: vo, allowPinchZoom: !0, children: /* @__PURE__ */ t(
97
- Oe,
94
+ const _ = l.current;
95
+ if (_) return Do(_);
96
+ }, []), /* @__PURE__ */ t(go, { as: Ro, allowPinchZoom: !0, children: /* @__PURE__ */ t(
97
+ Se,
98
98
  {
99
99
  ...n,
100
- ref: s,
101
- trapFocus: c.open,
100
+ ref: c,
101
+ trapFocus: a.open,
102
102
  disableOutsidePointerEvents: !0,
103
- onCloseAutoFocus: J(n.onCloseAutoFocus, (_) => {
103
+ onCloseAutoFocus: X(n.onCloseAutoFocus, (_) => {
104
104
  var u;
105
- _.preventDefault(), r.current || (u = c.triggerRef.current) == null || u.focus();
105
+ _.preventDefault(), s.current || (u = a.triggerRef.current) == null || u.focus();
106
106
  }),
107
- onPointerDownOutside: J(
107
+ onPointerDownOutside: X(
108
108
  n.onPointerDownOutside,
109
109
  (_) => {
110
- const u = _.detail.originalEvent, A = u.button === 0 && u.ctrlKey === !0, h = u.button === 2 || A;
111
- r.current = h;
110
+ const u = _.detail.originalEvent, y = u.button === 0 && u.ctrlKey === !0, D = u.button === 2 || y;
111
+ s.current = D;
112
112
  },
113
113
  { checkForDefaultPrevented: !1 }
114
114
  ),
115
- onFocusOutside: J(
115
+ onFocusOutside: X(
116
116
  n.onFocusOutside,
117
117
  (_) => _.preventDefault(),
118
118
  { checkForDefaultPrevented: !1 }
@@ -120,72 +120,72 @@ var vo = to("PopoverContent.RemoveScroll"), ho = m.forwardRef(
120
120
  }
121
121
  ) });
122
122
  }
123
- ), bo = m.forwardRef(
123
+ ), Lo = m.forwardRef(
124
124
  (n, p) => {
125
- const c = T(z, n.__scopePopover), a = m.useRef(!1), s = m.useRef(!1);
125
+ const a = G(J, n.__scopePopover), l = m.useRef(!1), c = m.useRef(!1);
126
126
  return /* @__PURE__ */ t(
127
- Oe,
127
+ Se,
128
128
  {
129
129
  ...n,
130
130
  ref: p,
131
131
  trapFocus: !1,
132
132
  disableOutsidePointerEvents: !1,
133
- onCloseAutoFocus: (r) => {
133
+ onCloseAutoFocus: (s) => {
134
134
  var _, u;
135
- (_ = n.onCloseAutoFocus) == null || _.call(n, r), r.defaultPrevented || (a.current || (u = c.triggerRef.current) == null || u.focus(), r.preventDefault()), a.current = !1, s.current = !1;
135
+ (_ = n.onCloseAutoFocus) == null || _.call(n, s), s.defaultPrevented || (l.current || (u = a.triggerRef.current) == null || u.focus(), s.preventDefault()), l.current = !1, c.current = !1;
136
136
  },
137
- onInteractOutside: (r) => {
138
- var A, h;
139
- (A = n.onInteractOutside) == null || A.call(n, r), r.defaultPrevented || (a.current = !0, r.detail.originalEvent.type === "pointerdown" && (s.current = !0));
140
- const _ = r.target;
141
- ((h = c.triggerRef.current) == null ? void 0 : h.contains(_)) && r.preventDefault(), r.detail.originalEvent.type === "focusin" && s.current && r.preventDefault();
137
+ onInteractOutside: (s) => {
138
+ var y, D;
139
+ (y = n.onInteractOutside) == null || y.call(n, s), s.defaultPrevented || (l.current = !0, s.detail.originalEvent.type === "pointerdown" && (c.current = !0));
140
+ const _ = s.target;
141
+ ((D = a.triggerRef.current) == null ? void 0 : D.contains(_)) && s.preventDefault(), s.detail.originalEvent.type === "focusin" && c.current && s.preventDefault();
142
142
  }
143
143
  }
144
144
  );
145
145
  }
146
- ), Oe = m.forwardRef(
146
+ ), Se = m.forwardRef(
147
147
  (n, p) => {
148
148
  const {
149
- __scopePopover: c,
150
- trapFocus: a,
151
- onOpenAutoFocus: s,
152
- onCloseAutoFocus: r,
149
+ __scopePopover: a,
150
+ trapFocus: l,
151
+ onOpenAutoFocus: c,
152
+ onCloseAutoFocus: s,
153
153
  disableOutsidePointerEvents: _,
154
154
  onEscapeKeyDown: u,
155
- onPointerDownOutside: A,
156
- onFocusOutside: h,
157
- onInteractOutside: x,
158
- ...S
159
- } = n, R = T(z, c), i = K(c);
160
- return po(), /* @__PURE__ */ t(
161
- uo,
155
+ onPointerDownOutside: y,
156
+ onFocusOutside: D,
157
+ onInteractOutside: E,
158
+ ...T
159
+ } = n, L = G(J, a), i = Y(a);
160
+ return Co(), /* @__PURE__ */ t(
161
+ Io,
162
162
  {
163
163
  asChild: !0,
164
164
  loop: !0,
165
- trapped: a,
166
- onMountAutoFocus: s,
167
- onUnmountAutoFocus: r,
165
+ trapped: l,
166
+ onMountAutoFocus: c,
167
+ onUnmountAutoFocus: s,
168
168
  children: /* @__PURE__ */ t(
169
- lo,
169
+ vo,
170
170
  {
171
171
  asChild: !0,
172
172
  disableOutsidePointerEvents: _,
173
- onInteractOutside: x,
173
+ onInteractOutside: E,
174
174
  onEscapeKeyDown: u,
175
- onPointerDownOutside: A,
176
- onFocusOutside: h,
177
- onDismiss: () => R.onOpenChange(!1),
175
+ onPointerDownOutside: y,
176
+ onFocusOutside: D,
177
+ onDismiss: () => L.onOpenChange(!1),
178
178
  children: /* @__PURE__ */ t(
179
- so,
179
+ ho,
180
180
  {
181
- "data-state": Ae(R.open),
181
+ "data-state": Te(L.open),
182
182
  role: "dialog",
183
- id: R.contentId,
183
+ id: L.contentId,
184
184
  ...i,
185
- ...S,
185
+ ...T,
186
186
  ref: p,
187
187
  style: {
188
- ...S.style,
188
+ ...T.style,
189
189
  "--radix-popover-content-transform-origin": "var(--radix-popper-transform-origin)",
190
190
  "--radix-popover-content-available-width": "var(--radix-popper-available-width)",
191
191
  "--radix-popover-content-available-height": "var(--radix-popper-available-height)",
@@ -199,294 +199,328 @@ var vo = to("PopoverContent.RemoveScroll"), ho = m.forwardRef(
199
199
  }
200
200
  );
201
201
  }
202
- ), Pe = "PopoverClose", go = m.forwardRef(
202
+ ), Fe = "PopoverClose", xo = m.forwardRef(
203
203
  (n, p) => {
204
- const { __scopePopover: c, ...a } = n, s = T(Pe, c);
204
+ const { __scopePopover: a, ...l } = n, c = G(Fe, a);
205
205
  return /* @__PURE__ */ t(
206
- _e.button,
206
+ Ie.button,
207
207
  {
208
208
  type: "button",
209
- ...a,
209
+ ...l,
210
210
  ref: p,
211
- onClick: J(n.onClick, () => s.onOpenChange(!1))
211
+ onClick: X(n.onClick, () => c.onOpenChange(!1))
212
212
  }
213
213
  );
214
214
  }
215
215
  );
216
- go.displayName = Pe;
217
- var Do = "PopoverArrow", Co = m.forwardRef(
216
+ xo.displayName = Fe;
217
+ var ko = "PopoverArrow", Eo = m.forwardRef(
218
218
  (n, p) => {
219
- const { __scopePopover: c, ...a } = n, s = K(c);
220
- return /* @__PURE__ */ t(ao, { ...s, ...a, ref: p });
219
+ const { __scopePopover: a, ...l } = n, c = Y(a);
220
+ return /* @__PURE__ */ t(bo, { ...c, ...l, ref: p });
221
221
  }
222
222
  );
223
- Co.displayName = Do;
224
- function Ae(n) {
223
+ Eo.displayName = ko;
224
+ function Te(n) {
225
225
  return n ? "open" : "closed";
226
226
  }
227
- var Io = he, No = ge, Oo = Ce, Po = Ie, Ao = Ne;
228
- const Ro = "Dropdown-module__dropdownContainer___beNhQ", yo = "Dropdown-module__dropdownLabel___T9FmB", Lo = "Dropdown-module__dropdownLabelDisabled___SLRmM", ko = "Dropdown-module__required___ChI1m", xo = "Dropdown-module__dropdownWrapper___AUuWD", Mo = "Dropdown-module__dropdownTrigger___Rue93", Eo = "Dropdown-module__dropdownTriggerDisabled___63wkd", So = "Dropdown-module__dropdownTriggerOpen___cbm8V", Fo = "Dropdown-module__dropdownTriggerError___Uu02x", Bo = "Dropdown-module__dropdownContent___zLMhL", To = "Dropdown-module__dropdownSelectedItems___iXnpQ", Vo = "Dropdown-module__selectedItemsCreatable___SCjLK", Wo = "Dropdown-module__selectedItem___2jO4z", Go = "Dropdown-module__selectedItemLabel___efVI-", zo = "Dropdown-module__removeButton___9r85B", jo = "Dropdown-module__removeIcon___st3b-", qo = "Dropdown-module__singleSelectedCreatableItem___BKFLb", Uo = "Dropdown-module__singleSelectedCreatableItemRemoveButton___w3XXp", Jo = "Dropdown-module__selectedOptionLabel___7Zdh3", Ko = "Dropdown-module__placeholder___fWdch", Xo = "Dropdown-module__dropdownActions___d55Fa", Yo = "Dropdown-module__dropdownArrow___dLbrb", Zo = "Dropdown-module__dropdownArrowOpen___Z4Nh1", $o = "Dropdown-module__dropdownMenu___toYcy", Ho = "Dropdown-module__dropdownMenuRight___n1aDk", Qo = "Dropdown-module__dropdownMenuToolbar___gFne0", et = "Dropdown-module__searchContainer___4kUvD", ot = "Dropdown-module__dropdownCreatableSearchContainer___sbs0F", tt = "Dropdown-module__disabled___0FjAX", nt = "Dropdown-module__dropdownCreatableError___gwBGw", rt = "Dropdown-module__creatableInput___meKz6", dt = "Dropdown-module__optionsList___rk2hi", lt = "Dropdown-module__categoryGroup___Np2bP", st = "Dropdown-module__categoryDivider___Gh6F0", at = "Dropdown-module__categoryLabel___B9IDR", ct = "Dropdown-module__optionItem___7pi10", it = "Dropdown-module__optionItemDisabled___aepUD", pt = "Dropdown-module__optionItemFocused___u2781", ut = "Dropdown-module__optionContent___nf1VC", _t = "Dropdown-module__optionLabel___sJerM", mt = "Dropdown-module__tickIcon___hYdCr", wt = "Dropdown-module__noOptions___8vmhM", ft = "Dropdown-module__helpers___s4ulA", vt = "Dropdown-module__helpText___YooJE", ht = "Dropdown-module__helpTextDisabled___Ct4qq", bt = "Dropdown-module__helpLink___-Zwpq", gt = "Dropdown-module__helpLinkDisabled___r-opC", Dt = "Dropdown-module__errorMessage___3Mopi", Ct = "Dropdown-module__selectAllContainer___Dlk3J", It = "Dropdown-module__actionButtons___-2nvr", o = {
229
- dropdownContainer: Ro,
230
- dropdownLabel: yo,
231
- dropdownLabelDisabled: Lo,
227
+ var Mo = Re, So = Le, Fo = ke, To = Ee, Vo = Me;
228
+ const Bo = "Dropdown-module__dropdownContainer___beNhQ", Wo = "Dropdown-module__dropdownLabel___T9FmB", Go = "Dropdown-module__dropdownLabelDisabled___SLRmM", zo = "Dropdown-module__required___ChI1m", qo = "Dropdown-module__dropdownWrapper___AUuWD", Jo = "Dropdown-module__dropdownTrigger___Rue93", $o = "Dropdown-module__dropdownTriggerDisabled___63wkd", jo = "Dropdown-module__dropdownTriggerOpen___cbm8V", Uo = "Dropdown-module__dropdownTriggerError___Uu02x", Ko = "Dropdown-module__dropdownContent___zLMhL", Xo = "Dropdown-module__dropdownSelectedItems___iXnpQ", Yo = "Dropdown-module__selectedItemsCreatable___SCjLK", Zo = "Dropdown-module__selectedItem___2jO4z", Ho = "Dropdown-module__selectedItemLabel___efVI-", Qo = "Dropdown-module__removeButton___9r85B", et = "Dropdown-module__removeIcon___st3b-", ot = "Dropdown-module__singleSelectedCreatableItem___BKFLb", tt = "Dropdown-module__singleSelectedCreatableItemRemoveButton___w3XXp", rt = "Dropdown-module__selectedOptionLabel___7Zdh3", nt = "Dropdown-module__placeholder___fWdch", dt = "Dropdown-module__dropdownActions___d55Fa", st = "Dropdown-module__dropdownArrow___dLbrb", lt = "Dropdown-module__dropdownArrowOpen___Z4Nh1", at = "Dropdown-module__dropdownMenu___toYcy", ct = "Dropdown-module__dropdownMenuToolbar___gFne0", it = "Dropdown-module__searchContainer___4kUvD", pt = "Dropdown-module__search___JmgDx", ut = "Dropdown-module__dropdownCreatableSearchContainer___sbs0F", _t = "Dropdown-module__disabled___0FjAX", mt = "Dropdown-module__dropdownCreatableError___gwBGw", ft = "Dropdown-module__creatableInput___meKz6", wt = "Dropdown-module__optionsList___rk2hi", vt = "Dropdown-module__categoryGroup___Np2bP", ht = "Dropdown-module__categoryDivider___Gh6F0", bt = "Dropdown-module__categoryLabel___B9IDR", Dt = "Dropdown-module__optionItem___7pi10", gt = "Dropdown-module__optionItemDisabled___aepUD", Ct = "Dropdown-module__optionItemFocused___u2781", It = "Dropdown-module__optionContent___nf1VC", Nt = "Dropdown-module__optionLabel___sJerM", Pt = "Dropdown-module__tickIcon___hYdCr", Ot = "Dropdown-module__noOptions___8vmhM", At = "Dropdown-module__helpers___s4ulA", Rt = "Dropdown-module__helpText___YooJE", yt = "Dropdown-module__helpTextDisabled___Ct4qq", Lt = "Dropdown-module__helpLink___-Zwpq", xt = "Dropdown-module__helpLinkDisabled___r-opC", kt = "Dropdown-module__errorMessage___3Mopi", Et = "Dropdown-module__selectAllContainer___Dlk3J", Mt = "Dropdown-module__actionButtons___-2nvr", o = {
229
+ dropdownContainer: Bo,
230
+ dropdownLabel: Wo,
231
+ "label-text": "Dropdown-module__label-text___VEqG-",
232
+ dropdownLabelDisabled: Go,
232
233
  "label-tooltip-icon": "Dropdown-module__label-tooltip-icon___JYVOm",
233
- required: ko,
234
- dropdownWrapper: xo,
234
+ required: zo,
235
+ dropdownWrapper: qo,
235
236
  "dropdown-menu-trigger": "Dropdown-module__dropdown-menu-trigger___fgqVT",
236
- dropdownTrigger: Mo,
237
- dropdownTriggerDisabled: Eo,
238
- dropdownTriggerOpen: So,
239
- dropdownTriggerError: Fo,
240
- dropdownContent: Bo,
241
- dropdownSelectedItems: To,
242
- selectedItemsCreatable: Vo,
243
- selectedItem: Wo,
244
- selectedItemLabel: Go,
245
- removeButton: zo,
246
- removeIcon: jo,
247
- singleSelectedCreatableItem: qo,
248
- singleSelectedCreatableItemRemoveButton: Uo,
249
- selectedOptionLabel: Jo,
250
- placeholder: Ko,
251
- dropdownActions: Xo,
252
- dropdownArrow: Yo,
253
- dropdownArrowOpen: Zo,
254
- dropdownMenu: $o,
255
- dropdownMenuRight: Ho,
237
+ dropdownTrigger: Jo,
238
+ dropdownTriggerDisabled: $o,
239
+ dropdownTriggerOpen: jo,
240
+ dropdownTriggerError: Uo,
241
+ dropdownContent: Ko,
242
+ dropdownSelectedItems: Xo,
243
+ selectedItemsCreatable: Yo,
244
+ selectedItem: Zo,
245
+ selectedItemLabel: Ho,
246
+ removeButton: Qo,
247
+ removeIcon: et,
248
+ singleSelectedCreatableItem: ot,
249
+ singleSelectedCreatableItemRemoveButton: tt,
250
+ selectedOptionLabel: rt,
251
+ placeholder: nt,
252
+ dropdownActions: dt,
253
+ dropdownArrow: st,
254
+ dropdownArrowOpen: lt,
255
+ dropdownMenu: at,
256
256
  "dropdown-container-grouped": "Dropdown-module__dropdown-container-grouped___1twhU",
257
257
  "dropdown-container-multi-select": "Dropdown-module__dropdown-container-multi-select___zdaum",
258
- dropdownMenuToolbar: Qo,
259
- searchContainer: et,
260
- dropdownCreatableSearchContainer: ot,
261
- disabled: tt,
262
- dropdownCreatableError: nt,
263
- creatableInput: rt,
264
- optionsList: dt,
265
- categoryGroup: lt,
266
- categoryDivider: st,
267
- categoryLabel: at,
268
- optionItem: ct,
269
- optionItemDisabled: it,
270
- optionItemFocused: pt,
271
- optionContent: ut,
272
- optionLabel: _t,
273
- tickIcon: mt,
274
- noOptions: wt,
275
- helpers: ft,
276
- helpText: vt,
277
- helpTextDisabled: ht,
278
- helpLink: bt,
279
- helpLinkDisabled: gt,
280
- errorMessage: Dt,
281
- selectAllContainer: Ct,
282
- actionButtons: It
258
+ dropdownMenuToolbar: ct,
259
+ searchContainer: it,
260
+ search: pt,
261
+ dropdownCreatableSearchContainer: ut,
262
+ disabled: _t,
263
+ dropdownCreatableError: mt,
264
+ creatableInput: ft,
265
+ optionsList: wt,
266
+ categoryGroup: vt,
267
+ categoryDivider: ht,
268
+ categoryLabel: bt,
269
+ optionItem: Dt,
270
+ optionItemDisabled: gt,
271
+ optionItemFocused: Ct,
272
+ optionContent: It,
273
+ optionLabel: Nt,
274
+ tickIcon: Pt,
275
+ noOptions: Ot,
276
+ helpers: At,
277
+ helpText: Rt,
278
+ helpTextDisabled: yt,
279
+ helpLink: Lt,
280
+ helpLinkDisabled: xt,
281
+ errorMessage: kt,
282
+ selectAllContainer: Et,
283
+ actionButtons: Mt
283
284
  };
284
- function Vt({
285
+ function Yt({
285
286
  className: n,
286
287
  label: p,
287
- options: c,
288
- value: a = [],
289
- placeholder: s = "Select options...",
290
- disabled: r = !1,
288
+ options: a,
289
+ value: l = [],
290
+ placeholder: c = "Select options...",
291
+ disabled: s = !1,
291
292
  required: _ = !1,
292
293
  searchable: u = !1,
293
- searchPlaceholder: A = "Search options...",
294
- errorMessage: h,
295
- helpText: x,
296
- helpLink: S,
297
- helpLinkText: R,
294
+ searchPlaceholder: y = "Search options...",
295
+ errorMessage: D,
296
+ helpText: E,
297
+ helpLink: T,
298
+ helpLinkText: L,
298
299
  onChange: i,
299
300
  onSearch: M,
300
- multiSelect: b = !1,
301
- grouped: Re = !1,
302
- align: ye = "left",
303
- onToggleChange: X,
304
- toggleLabel: Le,
305
- isCreatable: g = !1,
306
- dropdownTriggerClassName: ke,
307
- dropdownMenuClassName: xe,
308
- hideSelectedItems: Me = !1,
309
- labelTooltip: V,
310
- isTagsFields: D = !1,
311
- ...$
301
+ multiSelect: g = !1,
302
+ grouped: Ve = !1,
303
+ align: pe = "left",
304
+ onToggleChange: Z,
305
+ toggleLabel: Be,
306
+ isCreatable: C = !1,
307
+ dropdownTriggerClassName: We,
308
+ dropdownMenuClassName: Ge,
309
+ hideSelectedItems: ze = !1,
310
+ labelTooltip: z,
311
+ isTagsFields: I = !1,
312
+ unselect: H = !1,
313
+ selectedOptionLabel: qe = "option selected",
314
+ selectedOptionsLabel: Je = "options selected",
315
+ allOptionsSelectedLabel: Q,
316
+ caseSensitive: re = !1,
317
+ ...$e
312
318
  }) {
313
- const [w, F] = B(a), [O, y] = B(!1), [L, N] = B(""), [j, v] = B(-1), [E, k] = B([]), Ee = Y(null), de = Y(null), le = Y(null), q = Y(null), [se, Se] = B(0), [Fe, Be] = B(0), [Te, Ve] = B(a.length > 0 ? a.join(", ") : s ?? "");
314
- W(() => {
315
- F(a);
316
- }, [a]), W(() => {
319
+ const [f, S] = W(l), [h, O] = W(!1), [ne, N] = W(""), [$, w] = W(-1), [F, x] = W([]), ue = U(null), _e = U(null), ee = U(null), j = U(null), [me, je] = W(0), [Ue, Ke] = W(0), [Xe, Ye] = W(l.length > 0 ? l.join(", ") : c ?? ""), fe = U(l);
320
+ q(() => {
321
+ JSON.stringify(fe.current) !== JSON.stringify(l) && (S(l), fe.current = l);
322
+ }, [l]), q(() => {
317
323
  var d;
318
- const e = (d = de.current) == null ? void 0 : d.getBoundingClientRect().width;
319
- e && Se(e);
320
- }, []), W(() => {
324
+ const e = (d = _e.current) == null ? void 0 : d.getBoundingClientRect().width;
325
+ e && je(e);
326
+ }, []), q(() => {
321
327
  var d;
322
- const e = (d = le.current) == null ? void 0 : d.getBoundingClientRect().width;
323
- e && Be(e);
324
- }, []), W(() => {
325
- O && k([...w]);
326
- }, [O, w]);
327
- const C = c.filter((e) => e.label.toLowerCase().includes(L.toLowerCase()));
328
- W(() => {
329
- Ve(a.length > 0 ? a.join(", ") : s ?? "");
330
- }, [a, s]), W(() => {
331
- O && (u || g || D) && q.current && q.current.focus();
332
- }, [O, u, g, D]);
333
- const We = (e) => {
334
- y(e), e ? (k([...w]), N(""), v(-1)) : (N(""), v(-1), k([]));
335
- }, H = te((e) => {
328
+ const e = (d = ee.current) == null ? void 0 : d.getBoundingClientRect().width;
329
+ e && Ke(e);
330
+ }, []), q(() => {
331
+ h && x([...f]);
332
+ }, [h, f]);
333
+ const k = ne.trim(), P = a.filter((e) => {
334
+ const d = re ? e.label : e.label.toLowerCase(), r = re ? k : k.toLowerCase();
335
+ return d.includes(r);
336
+ });
337
+ q(() => {
338
+ Ye(l.length > 0 ? l.join(", ") : c ?? "");
339
+ }, [l, c]), q(() => {
340
+ h && (u || C || I) && j.current && j.current.focus();
341
+ }, [h, u, C, I]);
342
+ const Ze = (e) => {
343
+ O(e), e ? (x([...f]), N(""), w(-1)) : (N(""), w(-1), x([]));
344
+ }, de = ae((e) => {
336
345
  if (e.disabled) return;
337
346
  let d = [];
338
- if (b)
339
- d = E.includes(e.value) ? E.filter((l) => l !== e.value) : [...E, e.value];
347
+ if (g)
348
+ d = F.includes(e.value) ? F.filter((r) => r !== e.value) : [...F, e.value];
340
349
  else {
341
- w.includes(e.value) ? d = [] : d = [e.value], F(d), i == null || i(d), y(!1), N(""), v(-1), k([]);
350
+ if (f.includes(e.value))
351
+ if (H)
352
+ d = [];
353
+ else
354
+ return;
355
+ else
356
+ d = [e.value];
357
+ S(d), i == null || i(d), O(!1), N(""), w(-1), x([]);
342
358
  return;
343
359
  }
344
- k(d);
345
- }, [b, i, E, w]), Ge = () => {
346
- F(E), i == null || i(E), y(!1), N(""), v(-1), k([]);
347
- }, ze = () => {
348
- y(!1), N(""), v(-1), k([]);
349
- }, je = (e) => {
350
- N(e), v(-1), M == null || M(e);
351
- }, qe = te((e) => {
360
+ x(d);
361
+ }, [g, i, F, f, H]), He = () => {
362
+ S(F), i == null || i(F), O(!1), N(""), w(-1), x([]);
363
+ }, Qe = () => {
364
+ O(!1), N(""), w(-1), x([]);
365
+ }, eo = (e) => {
366
+ N(e), w(-1), M == null || M(e);
367
+ }, oo = ae((e) => {
368
+ var r;
352
369
  const d = {
353
370
  value: e,
354
371
  label: e,
355
372
  disabled: !1
356
373
  };
357
- if (c.push(d), b) {
358
- const G = w.includes(e) ? w : [...w, e];
359
- F(G), i == null || i(G), N(""), y(!0), v(-1);
374
+ if (a.push(d), g) {
375
+ const B = f.includes(e) ? f : [...f, e];
376
+ S(B), i == null || i(B), N(""), O(!0), w(-1);
360
377
  } else {
361
- const l = [e];
362
- F(l), i == null || i(l), N(""), y(!1), v(-1);
378
+ const V = [e];
379
+ S(V), i == null || i(V), N(""), O(!1), w(-1);
363
380
  }
364
- }, [b, i, c, w]), Q = te((e) => {
365
- if (!e.disabled)
366
- if (b) {
367
- const l = w.includes(e.value) ? w.filter((G) => G !== e.value) : [...w, e.value];
368
- F(l), i == null || i(l), y(!0), N(""), v(-1);
381
+ (r = ee.current) == null || r.focus();
382
+ }, [g, i, a, f]), se = ae((e) => {
383
+ var d;
384
+ if (!e.disabled) {
385
+ if (g) {
386
+ const V = f.includes(e.value) ? f.filter((B) => B !== e.value) : [...f, e.value];
387
+ S(V), i == null || i(V), O(!0), N(""), w(-1);
388
+ } else if (f.includes(e.value)) {
389
+ if (H) {
390
+ const r = [];
391
+ S(r), i == null || i(r), O(!1), N(""), w(-1);
392
+ }
369
393
  } else {
370
- const d = w.includes(e.value) ? [] : [e.value];
371
- F(d), i == null || i(d), y(!1), N(""), v(-1);
394
+ const r = [e.value];
395
+ S(r), i == null || i(r), O(!1), N(""), w(-1);
372
396
  }
373
- }, [b, i, w]), Ue = (e) => {
374
- y(!0), N(e), v(-1), M == null || M(e);
375
- }, ae = (e) => {
376
- y(!0), N(e), v(-1), M == null || M(e);
377
- }, Je = (e) => {
378
- X == null || X(e);
379
- }, ce = (e) => {
380
- const d = w.filter((l) => l !== e);
381
- F(d), i == null || i(d);
397
+ (d = ee.current) == null || d.focus();
398
+ }
399
+ }, [g, i, f, H]), to = (e) => {
400
+ O(!0), N(e), w(-1), M == null || M(e);
401
+ }, we = (e) => {
402
+ O(!0), N(e), w(-1), M == null || M(e);
403
+ }, ro = (e) => {
404
+ Z == null || Z(e);
405
+ }, ve = (e) => {
406
+ const d = f.filter((r) => r !== e);
407
+ S(d), i == null || i(d);
382
408
  };
383
- W(() => {
409
+ q(() => {
384
410
  const e = (d) => {
385
- if (O)
411
+ if (h)
386
412
  switch (d.key) {
387
413
  case "ArrowDown":
388
- d.preventDefault(), v((l) => l < C.length - 1 ? l + 1 : 0);
414
+ d.preventDefault(), w((r) => r < P.length - 1 ? r + 1 : 0);
389
415
  break;
390
416
  case "ArrowUp":
391
- d.preventDefault(), v((l) => l > 0 ? l - 1 : C.length - 1);
417
+ d.preventDefault(), w((r) => r > 0 ? r - 1 : P.length - 1);
392
418
  break;
393
419
  case "Enter":
394
- if (d.preventDefault(), j >= 0 && j < C.length) {
395
- const l = C[j];
396
- g || D ? Q(l) : H(l);
420
+ if (d.preventDefault(), $ >= 0 && $ < P.length) {
421
+ const r = P[$];
422
+ C || I ? se(r) : de(r);
397
423
  }
398
424
  break;
399
425
  case "Escape":
400
- d.preventDefault(), y(!1), N(""), v(-1), k([]);
426
+ d.preventDefault(), O(!1), N(""), w(-1), x([]);
401
427
  break;
402
428
  }
403
429
  };
404
430
  return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
405
- }, [O, j, C, g, D, Q, H]);
406
- const ee = g || D ? w : O ? E : w, I = c.filter((e) => ee.includes(e.value)), ie = !!h, Ke = JSON.stringify(E) !== JSON.stringify(w), Xe = C.reduce((e, d) => {
407
- const l = d.category || "default";
408
- return e[l] || (e[l] = []), e[l].push(d), e;
409
- }, {}), Ye = C;
410
- return /* @__PURE__ */ f("div", { ref: Ee, className: P(o.dropdownContainer, Re && o["dropdown-container-grouped"], b && o["dropdown-container-multi-select"], n), ...$, children: [
411
- p && /* @__PURE__ */ f("label", { className: P(o.dropdownLabel, r && o.dropdownLabelDisabled), title: p, children: [
412
- p,
431
+ }, [h, $, P, C, I, se, de]);
432
+ const oe = C || I ? f : h ? F : f, b = a.filter((e) => oe.includes(e.value)), he = !!D, no = JSON.stringify(F) !== JSON.stringify(f), be = a.filter((e) => !e.disabled), De = be.length > 0 && be.every((e) => oe.includes(e.value)), so = P.reduce((e, d) => {
433
+ const r = d.category || "default";
434
+ return e[r] || (e[r] = []), e[r].push(d), e;
435
+ }, {}), lo = P, {
436
+ onBlur: A,
437
+ ...le
438
+ } = $e;
439
+ return /* @__PURE__ */ v("div", { ref: ue, className: R(o.dropdownContainer, Ve && o["dropdown-container-grouped"], g && o["dropdown-container-multi-select"], n), ...le, children: [
440
+ p && /* @__PURE__ */ v("label", { className: R(o.dropdownLabel, s && o.dropdownLabelDisabled), children: [
441
+ /* @__PURE__ */ t("span", { title: p, className: o["label-text"], children: p }),
413
442
  _ && /* @__PURE__ */ t("span", { className: o.required, children: "*" }),
414
- V && /* @__PURE__ */ t(Qe, { content: V.content, size: V.size, theme: V.theme, tipSide: V.tipSide, tipAlignment: V.tipAlignment, startVisible: V.startVisible, children: /* @__PURE__ */ t(U, { icon: "ap-icon-info", className: o["label-tooltip-icon"] }) })
443
+ z && /* @__PURE__ */ t(po, { content: z.content, size: z.size, theme: z.theme, tipSide: z.tipSide, tipAlignment: z.tipAlignment, startVisible: z.startVisible, children: /* @__PURE__ */ t(K, { icon: "ap-icon-info", className: o["label-tooltip-icon"] }) })
415
444
  ] }),
416
- /* @__PURE__ */ t(Io, { open: O, onOpenChange: We, children: /* @__PURE__ */ f("div", { className: o.dropdownWrapper, children: [
417
- !g && !D && /* @__PURE__ */ t(Oo, { disabled: r, className: P(o["dropdown-menu-trigger"], o.dropdownTrigger, ke, O && o.dropdownTriggerOpen, r && o.dropdownTriggerDisabled, ie && o.dropdownTriggerError), ref: de, ...$, children: /* @__PURE__ */ f("div", { className: o.dropdownContent, children: [
418
- !Me && /* @__PURE__ */ t("div", { className: o.dropdownSelectedItems, children: I.length > 0 ? b ? I.length === 1 ? I.length + " option selected" : I.length + " options selected" : (
445
+ /* @__PURE__ */ t(Mo, { open: h, onOpenChange: Ze, children: /* @__PURE__ */ v("div", { className: o.dropdownWrapper, children: [
446
+ !C && !I && /* @__PURE__ */ t(Fo, { disabled: s, className: R(o["dropdown-menu-trigger"], o.dropdownTrigger, We, h && o.dropdownTriggerOpen, s && o.dropdownTriggerDisabled, he && o.dropdownTriggerError), ref: _e, onBlur: (e) => {
447
+ h || A == null || A(e);
448
+ }, ...le, children: /* @__PURE__ */ v("div", { className: o.dropdownContent, children: [
449
+ !ze && /* @__PURE__ */ t("div", { className: o.dropdownSelectedItems, children: b.length > 0 ? g ? De && Q ? Q : b.length === 1 ? ` ${b.length} ${qe}` : ` ${b.length} ${Je}` : (
419
450
  // For single select, show the selected option label
420
- /* @__PURE__ */ t("span", { className: o.selectedOptionLabel, children: I[0].label })
421
- ) : /* @__PURE__ */ t("span", { title: Te, className: o.placeholder, children: s }) }),
422
- /* @__PURE__ */ t("div", { className: o.dropdownActions, children: /* @__PURE__ */ t(U, { icon: "ap-icon-expand-more", className: P(o.dropdownArrow, O && o.dropdownArrowOpen) }) })
451
+ /* @__PURE__ */ t("span", { className: o.selectedOptionLabel, children: b[0].label })
452
+ ) : /* @__PURE__ */ t("span", { title: Xe, className: o.placeholder, children: c }) }),
453
+ /* @__PURE__ */ t("div", { className: o.dropdownActions, children: /* @__PURE__ */ t(K, { icon: "ap-icon-expand-more", className: R(o.dropdownArrow, h && o.dropdownArrowOpen) }) })
423
454
  ] }) }),
424
- (g || D) && /* @__PURE__ */ t(No, { children: /* @__PURE__ */ f("div", { ref: le, className: P(o.dropdownCreatableSearchContainer, r && o.disabled, ie && o.dropdownCreatableError), onClick: () => {
455
+ (C || I) && /* @__PURE__ */ t(So, { children: /* @__PURE__ */ v("div", { tabIndex: 0, ref: ee, className: R(o.dropdownCreatableSearchContainer, s && o.disabled, he && o.dropdownCreatableError), onBlur: (e) => {
456
+ h || A == null || A(e);
457
+ }, onClick: () => {
425
458
  var e;
426
- if (!b && I.length > 0)
427
- return ae("");
428
- (e = q.current) == null || e.focus();
429
- }, ...$, children: [
430
- I.length > 0 && /* @__PURE__ */ t("div", { className: P(o.selectedItemsCreatable), children: b ? I.length > 3 ? /* @__PURE__ */ t("div", { className: o.selectedItem, children: /* @__PURE__ */ f("span", { className: o.selectedItemLabel, children: [
431
- I.length,
432
- " options selected"
433
- ] }) }) : I.map((e) => /* @__PURE__ */ f("div", { className: o.selectedItem, children: [
459
+ if (!g && b.length > 0)
460
+ return we("");
461
+ (e = j.current) == null || e.focus();
462
+ }, ...le, children: [
463
+ b.length > 0 && /* @__PURE__ */ t("div", { className: R(o.selectedItemsCreatable), children: g ? b.length > 3 ? /* @__PURE__ */ t("div", { className: o.selectedItem, children: /* @__PURE__ */ t("span", { className: o.selectedItemLabel, children: De && Q ? Q : `${b.length} options selected` }) }) : b.map((e) => /* @__PURE__ */ v("div", { className: o.selectedItem, children: [
434
464
  /* @__PURE__ */ t("span", { className: o.selectedItemLabel, children: e.label }),
435
- /* @__PURE__ */ t("button", { type: "button", className: o.removeButton, onClick: () => ce(e.value), disabled: r, children: /* @__PURE__ */ t(U, { icon: "ap-icon-close", className: o.removeIcon }) })
436
- ] }, e.value)) : I.length > 0 && /* @__PURE__ */ f("div", { className: o.singleSelectedCreatableItem, children: [
437
- /* @__PURE__ */ t("span", { className: o.selectedItemLabel, children: I[0].label }),
438
- /* @__PURE__ */ t(ne, { type: "tertiary", variant: "default", size: "sm", onClick: () => ce(I[0].value), disabled: r, icon: "ap-icon-add-filled", className: o.singleSelectedCreatableItemRemoveButton })
465
+ /* @__PURE__ */ t("button", { type: "button", className: o.removeButton, onClick: () => ve(e.value), disabled: s, children: /* @__PURE__ */ t(K, { icon: "ap-icon-close", className: o.removeIcon }) })
466
+ ] }, e.value)) : b.length > 0 && /* @__PURE__ */ v("div", { className: o.singleSelectedCreatableItem, children: [
467
+ /* @__PURE__ */ t("span", { className: o.selectedItemLabel, children: b[0].label }),
468
+ /* @__PURE__ */ t(ce, { type: "tertiary", variant: "default", size: "sm", onClick: () => ve(b[0].value), disabled: s, icon: "ap-icon-add-filled", className: o.singleSelectedCreatableItemRemoveButton })
439
469
  ] }) }),
440
- (b || !I.length) && /* @__PURE__ */ t("input", { ref: q, placeholder: A, value: L, onChange: (e) => Ue(e.target.value), onFocus: (e) => ae(e.target.value), disabled: r, className: o.creatableInput }),
441
- /* @__PURE__ */ t("div", { className: o.dropdownActions, children: /* @__PURE__ */ t(U, { icon: "ap-icon-expand-more", className: P(o.dropdownArrow, O && o.dropdownArrowOpen) }) })
470
+ (g || !b.length) && /* @__PURE__ */ t("input", { ref: j, placeholder: b.length > 0 ? "" : y, value: ne, onChange: (e) => to(e.target.value), onFocus: (e) => we(e.target.value), onBlur: (e) => {
471
+ h || A == null || A(e);
472
+ }, disabled: s, className: o.creatableInput }),
473
+ /* @__PURE__ */ t("div", { className: o.dropdownActions, children: /* @__PURE__ */ t(K, { icon: "ap-icon-expand-more", className: R(o.dropdownArrow, h && o.dropdownArrowOpen) }) })
442
474
  ] }) }),
443
- /* @__PURE__ */ t(Po, { children: /* @__PURE__ */ t(Ao, { align: "start", sideOffset: 0, style: {
444
- minWidth: se
475
+ /* @__PURE__ */ t(To, { children: /* @__PURE__ */ t(Vo, { align: pe === "right" ? "end" : "start", side: "bottom", avoidCollisions: !0, sideOffset: 6, collisionPadding: 8, style: {
476
+ minWidth: me,
477
+ zIndex: 9999
445
478
  }, onInteractOutside: (e) => {
446
- e.target === q.current && e.preventDefault();
447
- }, children: O && /* @__PURE__ */ f("div", { style: {
448
- minWidth: g || D ? Fe : se
449
- }, className: P(o.dropdownMenu, xe, ye === "right" && o.dropdownMenuRight), children: [
450
- !g && !D && (u || b) && /* @__PURE__ */ f("div", { className: o.dropdownMenuToolbar, children: [
451
- u && /* @__PURE__ */ f("div", { className: o.searchContainer, children: [
452
- /* @__PURE__ */ t(He, { placeholder: A, value: L, onChange: je }),
453
- X && /* @__PURE__ */ t($e, { label: Le, onChange: Je })
479
+ var r;
480
+ e.target === j.current && e.preventDefault(), ((r = ue.current) == null ? void 0 : r.contains(e.target)) || A == null || A(e);
481
+ }, children: h && /* @__PURE__ */ v("div", { style: {
482
+ minWidth: C || I ? Ue : me
483
+ }, className: R(o.dropdownMenu, Ge, pe === "right" && o.dropdownMenuRight), children: [
484
+ !C && !I && (u || g) && /* @__PURE__ */ v("div", { className: o.dropdownMenuToolbar, children: [
485
+ u && /* @__PURE__ */ v("div", { className: o.searchContainer, children: [
486
+ /* @__PURE__ */ t(io, { placeholder: y, value: ne, onChange: eo, className: o.search }),
487
+ Z && /* @__PURE__ */ t(co, { label: Be, onChange: ro })
454
488
  ] }),
455
- b && !g && !D && /* @__PURE__ */ f("div", { className: o.selectAllContainer, children: [
456
- /* @__PURE__ */ t(pe, { variant: "default", noIcon: !0, onClick: () => {
457
- const e = C.filter((d) => !d.disabled).map((d) => d.value);
458
- k(e);
459
- }, disabled: C.filter((e) => !e.disabled).length === 0, children: "Select all" }),
460
- /* @__PURE__ */ t(pe, { variant: "default", noIcon: !0, onClick: () => k([]), disabled: E.length === 0, children: "Deselect all" })
489
+ g && !C && !I && /* @__PURE__ */ v("div", { className: o.selectAllContainer, children: [
490
+ /* @__PURE__ */ t(ge, { variant: "default", noIcon: !0, onClick: () => {
491
+ const e = P.filter((d) => !d.disabled).map((d) => d.value);
492
+ x(e);
493
+ }, disabled: P.filter((e) => !e.disabled).length === 0, children: "Select all" }),
494
+ /* @__PURE__ */ t(ge, { variant: "default", noIcon: !0, onClick: () => x([]), disabled: F.length === 0, children: "Deselect all" })
461
495
  ] })
462
496
  ] }),
463
- /* @__PURE__ */ f("div", { className: o.optionsList, "data-dropdown-options-list": !0, children: [
464
- C.length > 0 ? Object.entries(Xe).map(([e, d]) => /* @__PURE__ */ f("div", { className: o.categoryGroup, children: [
497
+ /* @__PURE__ */ v("div", { className: o.optionsList, "data-dropdown-options-list": !0, children: [
498
+ P.length > 0 ? Object.entries(so).map(([e, d]) => /* @__PURE__ */ v("div", { className: o.categoryGroup, children: [
465
499
  e !== "default" && /* @__PURE__ */ t("div", { className: o.categoryDivider, children: /* @__PURE__ */ t("span", { className: o.categoryLabel, children: e }) }),
466
- d.map((l) => {
467
- const G = Ye.indexOf(l), oe = C.find((Ze) => Ze.value === l.value);
468
- return /* @__PURE__ */ t("button", { title: (oe == null ? void 0 : oe.label) || l.label, type: "button", className: P(o.optionItem, ee.includes(l.value) && o.optionItemSelected, l.disabled && o.optionItemDisabled, G === j && o.optionItemFocused), onClick: () => g || D ? Q(l) : H(l), disabled: l.disabled, "data-dropdown-option-item": !0, children: /* @__PURE__ */ f("div", { className: o.optionContent, children: [
469
- /* @__PURE__ */ t("span", { className: o.optionLabel, children: l.label }),
470
- ee.includes(l.value) && /* @__PURE__ */ t(U, { icon: "ap-icon-check", className: o.tickIcon })
471
- ] }) }, l.value);
500
+ d.map((r) => {
501
+ const V = lo.indexOf(r), B = P.find((ao) => ao.value === r.value);
502
+ return /* @__PURE__ */ t("button", { title: (B == null ? void 0 : B.label) || r.label, type: "button", className: R(o.optionItem, oe.includes(r.value) && o.optionItemSelected, r.disabled && o.optionItemDisabled, V === $ && o.optionItemFocused), onClick: () => C || I ? se(r) : de(r), disabled: r.disabled, "data-dropdown-option-item": !0, children: /* @__PURE__ */ v("div", { className: o.optionContent, children: [
503
+ /* @__PURE__ */ t("span", { className: o.optionLabel, children: r.label }),
504
+ oe.includes(r.value) && /* @__PURE__ */ t(K, { icon: "ap-icon-check", className: o.tickIcon })
505
+ ] }) }, r.value);
472
506
  })
473
507
  ] }, e)) : null,
474
- g && L !== "" && !C.find((e) => e.label === L) && /* @__PURE__ */ t("button", { type: "button", className: P(o.optionItem, o.optionItemCreatable), title: L ? `Create "${L}"` : "Create new option", onClick: () => qe(L), children: /* @__PURE__ */ t("div", { className: o.optionContent, children: /* @__PURE__ */ t("span", { className: o.optionLabel, children: L ? `Create "${L}"` : "Create new option" }) }) }),
475
- C.length === 0 && !g && !D && /* @__PURE__ */ t("div", { className: o.noOptions, children: "No options found" }),
476
- C.length === 0 && D && /* @__PURE__ */ t("div", { className: o.noOptions, children: "No options found" })
508
+ C && k !== "" && !a.find((e) => re ? e.label === k : e.label.toLowerCase() === k.toLowerCase()) && /* @__PURE__ */ t("button", { type: "button", className: R(o.optionItem, o.optionItemCreatable), title: k ? `Create "${k}"` : "Create new option", onClick: () => oo(k), children: /* @__PURE__ */ t("div", { className: o.optionContent, children: /* @__PURE__ */ t("span", { className: o.optionLabel, children: k ? `Create "${k}"` : "Create new option" }) }) }),
509
+ P.length === 0 && !C && !I && /* @__PURE__ */ t("div", { className: o.noOptions, children: "No options found" }),
510
+ P.length === 0 && I && /* @__PURE__ */ t("div", { className: o.noOptions, children: "No options found" })
477
511
  ] }),
478
- b && !g && !D && /* @__PURE__ */ f("div", { className: o.actionButtons, children: [
479
- /* @__PURE__ */ t(ne, { type: "primary", variant: "cancel", size: "md", onClick: ze, children: "Cancel" }),
480
- /* @__PURE__ */ t(ne, { type: "primary", variant: "default", size: "md", onClick: Ge, disabled: !Ke, children: "Apply" })
512
+ g && !C && !I && /* @__PURE__ */ v("div", { className: o.actionButtons, children: [
513
+ /* @__PURE__ */ t(ce, { type: "primary", variant: "cancel", size: "md", onClick: Qe, children: "Cancel" }),
514
+ /* @__PURE__ */ t(ce, { type: "primary", variant: "default", size: "md", onClick: He, disabled: !no, children: "Apply" })
481
515
  ] })
482
516
  ] }) }) })
483
517
  ] }) }),
484
- (h || x || S && R) && /* @__PURE__ */ f("div", { className: o.helpers, children: [
485
- h ? /* @__PURE__ */ t("span", { title: h, className: o.errorMessage, children: h }) : x && /* @__PURE__ */ t("span", { title: x, className: P(o.helpText, r && o.helpTextDisabled), children: x }),
486
- S && R && /* @__PURE__ */ t("a", { href: S, className: P(o.helpLink, r && o.helpLinkDisabled), target: "_blank", rel: "noopener noreferrer", children: R })
518
+ (D || E || T && L) && /* @__PURE__ */ v("div", { className: o.helpers, children: [
519
+ D ? /* @__PURE__ */ t("span", { title: D, className: o.errorMessage, children: D }) : E && /* @__PURE__ */ t("span", { title: E, className: R(o.helpText, s && o.helpTextDisabled), children: E }),
520
+ T && L && /* @__PURE__ */ t("a", { href: T, className: R(o.helpLink, s && o.helpLinkDisabled), target: "_blank", rel: "noopener noreferrer", children: L })
487
521
  ] })
488
522
  ] });
489
523
  }
490
524
  export {
491
- Vt as default
525
+ Yt as default
492
526
  };