@bioturing/components 0.46.3 → 0.46.4

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.
@@ -1 +1 @@
1
- {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/components/combobox/component.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EACZ,YAAY,EAOb,MAAM,OAAO,CAAC;AAUf,OAAO,KAAK,EAAkB,aAAa,EAAE,MAAM,SAAS,CAAC;AAG7D,OAAO,aAAa,CAAC;AAErB,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAQ7D,QAAA,MAAM,aAAa,GACjB,CAAC,SAAS,KAAK,CAAC,GAAG,EACnB,CAAC,SAAS,OAAO,EACjB,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,EAAE,EAEtC,mcAmCG,aAAa,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EACzB,KAAK,KAAK,CAAC,YAAY,CAAC,cAAc,CAAC,4CA+axC,CAAC;AAUF,eAAO,MAAM,QAAQ,GAPnB,CAAC,SAAS,KAAK,CAAC,GAAG,EACnB,CAAC,SAAS,OAAO,EACjB,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,cAE1B,aAAa,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GAAG;IAAE,GAAG,CAAC,EAAE,YAAY,CAAC,cAAc,CAAC,CAAA;CAAE,KACnE,UAAU,CAAC,OAAO,aAAa,CAIlC,CAAC;AAEH,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/components/combobox/component.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EACZ,YAAY,EAOb,MAAM,OAAO,CAAC;AAUf,OAAO,KAAK,EAAkB,aAAa,EAAE,MAAM,SAAS,CAAC;AAG7D,OAAO,aAAa,CAAC;AAErB,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAQ7D,QAAA,MAAM,aAAa,GACjB,CAAC,SAAS,KAAK,CAAC,GAAG,EACnB,CAAC,SAAS,OAAO,EACjB,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,EAAE,EAEtC,mcAmCG,aAAa,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EACzB,KAAK,KAAK,CAAC,YAAY,CAAC,cAAc,CAAC,4CAkbxC,CAAC;AAUF,eAAO,MAAM,QAAQ,GAPnB,CAAC,SAAS,KAAK,CAAC,GAAG,EACnB,CAAC,SAAS,OAAO,EACjB,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,cAE1B,aAAa,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GAAG;IAAE,GAAG,CAAC,EAAE,YAAY,CAAC,cAAc,CAAC,CAAA;CAAE,KACnE,UAAU,CAAC,OAAO,aAAa,CAIlC,CAAC;AAEH,eAAe,QAAQ,CAAC"}
@@ -1,77 +1,77 @@
1
1
  "use client";
2
2
  import { jsx as t, jsxs as g, Fragment as ne } from "react/jsx-runtime";
3
3
  import { Combobox as r } from "@base-ui/react/combobox";
4
- import Re from "antd/es/config-provider/DisabledContext";
5
- import { FormItemInputContext as Te } from "antd/es/form/context";
4
+ import Ae from "antd/es/config-provider/DisabledContext";
5
+ import { FormItemInputContext as Re } from "antd/es/form/context";
6
6
  import { forwardRef as Se, useRef as ke, useContext as re, useCallback as v, useMemo as y, useState as De } from "react";
7
- import { BaseMenu as M } from "../base-menu/index.js";
7
+ import { BaseMenu as V } from "../base-menu/index.js";
8
8
  import { XIcon as Me } from "@bioturing/assets";
9
- import { splitBySeparators as Ve } from "./utils.js";
10
- import { useComboboxTokenInput as Fe } from "./use-combobox-token-input.js";
9
+ import { hasTokenSeparator as Ve, splitBySeparators as Fe } from "./utils.js";
10
+ import { useComboboxTokenInput as Oe } from "./use-combobox-token-input.js";
11
11
  import './style.css';/* empty css */
12
12
  import { SelectTrigger as p } from "../select-trigger/component.js";
13
13
  import { BaseMenuItem as se } from "../base-menu/item.js";
14
- import { Empty as Oe } from "../empty/component.js";
14
+ import { Empty as $e } from "../empty/component.js";
15
15
  import { useControlledState as ce } from "../hooks/useControlledState.js";
16
- import { useCls as $e } from "../utils/antdUtils.js";
16
+ import { useCls as Be } from "../utils/antdUtils.js";
17
17
  import { clsx as l } from "../utils/cn.js";
18
18
  import { reactNodeToString as le } from "../utils/reactToString.js";
19
- import { ScrollArea as Be } from "../scroll-area/component.js";
20
- const Le = (s) => /* @__PURE__ */ t(M.Root, { ...s }), Pe = (s) => /* @__PURE__ */ t(M.Popup, { ...s }), je = (s) => /* @__PURE__ */ t(M.Divider, { ...s }), Ee = (s) => /* @__PURE__ */ t(M.List, { ...s }), Ke = ({
19
+ import { ScrollArea as Le } from "../scroll-area/component.js";
20
+ const Pe = (s) => /* @__PURE__ */ t(V.Root, { ...s }), je = (s) => /* @__PURE__ */ t(V.Popup, { ...s }), Ee = (s) => /* @__PURE__ */ t(V.Divider, { ...s }), Ke = (s) => /* @__PURE__ */ t(V.List, { ...s }), We = ({
21
21
  options: s = [],
22
22
  value: ae,
23
23
  defaultValue: K,
24
- onChange: V,
24
+ onChange: F,
25
25
  placeholder: w = "Select...",
26
26
  disabled: ie = !1,
27
27
  status: de,
28
28
  allowClear: W = !1,
29
29
  multiple: n = !1,
30
- showSearch: He = !0,
31
- open: me,
32
- onOpenChange: he,
30
+ showSearch: Qe = !0,
31
+ open: he,
32
+ onOpenChange: me,
33
33
  className: ue,
34
34
  classNames: b,
35
- size: F = "middle",
35
+ size: O = "middle",
36
36
  optionRender: H,
37
- onSearch: O,
37
+ onSearch: $,
38
38
  clearIcon: Q,
39
39
  suffixIcon: U,
40
- placement: A = "bottomLeft",
40
+ placement: T = "bottomLeft",
41
41
  // showSelectionSummary: _showSelectionSummary = false,
42
42
  // selectionSummaryRender,
43
43
  showSelectAll: X = !1,
44
- optionLabelRender: R,
44
+ optionLabelRender: A,
45
45
  getOptionKeywords: G = (u) => [
46
46
  String(u.value),
47
47
  le(u.label)
48
48
  ],
49
49
  popupMatchSelectWidth: be = !0,
50
- addOnEnter: $ = !1,
50
+ addOnEnter: B = !1,
51
51
  tokenSeparators: C,
52
- autoHighlight: B = !0,
53
- filterOption: T,
52
+ autoHighlight: L = !0,
53
+ filterOption: R,
54
54
  ...fe
55
55
  }, ge) => {
56
56
  const [u, J] = ce(
57
57
  ae,
58
- V,
58
+ F,
59
59
  K !== void 0 ? K : n ? [] : void 0
60
- ), [L, S] = ce(me, he, !1), c = $e(), P = ke(null), { status: pe } = re(Te), Ce = re(Re), k = de || pe, I = ie || Ce, m = v(
60
+ ), [P, S] = ce(he, me, !1), c = Be(), j = ke(null), { status: pe } = re(Re), Ce = re(Ae), k = de || pe, I = ie || Ce, h = v(
61
61
  (e) => {
62
- J(e), V?.(e);
62
+ J(e), F?.(e);
63
63
  },
64
- [J, V]
64
+ [J, F]
65
65
  ), Y = v(() => {
66
66
  if (n) {
67
67
  const e = s.map((o) => o.value);
68
- m(e);
68
+ h(e);
69
69
  }
70
- }, [n, s, m]), Z = v(() => {
71
- n && m([]);
72
- }, [n, m]), _ = v(() => {
73
- m(n ? [] : void 0);
74
- }, [n, m]), h = y(() => Array.isArray(u) ? u : u ? [u] : [], [u]), i = y(() => {
70
+ }, [n, s, h]), Z = v(() => {
71
+ n && h([]);
72
+ }, [n, h]), _ = v(() => {
73
+ h(n ? [] : void 0);
74
+ }, [n, h]), m = y(() => Array.isArray(u) ? u : u ? [u] : [], [u]), i = y(() => {
75
75
  const e = /* @__PURE__ */ new Map();
76
76
  for (const o of s)
77
77
  e.set(o.value, o);
@@ -79,7 +79,7 @@ const Le = (s) => /* @__PURE__ */ t(M.Root, { ...s }), Pe = (s) => /* @__PURE__
79
79
  }, [s]), D = y(() => {
80
80
  if (!X || !n || s.length === 0)
81
81
  return null;
82
- const e = h.filter((d) => i.has(d)), o = e.length === s.length && s.length > 0, a = e.length > 0 && e.length < s.length;
82
+ const e = m.filter((d) => i.has(d)), o = e.length === s.length && s.length > 0, a = e.length > 0 && e.length < s.length;
83
83
  return {
84
84
  checked: o,
85
85
  indeterminate: a,
@@ -87,9 +87,9 @@ const Le = (s) => /* @__PURE__ */ t(M.Root, { ...s }), Pe = (s) => /* @__PURE__
87
87
  a || o ? Z() : Y();
88
88
  }
89
89
  };
90
- }, [X, n, s, i, h, Z, Y]), xe = y(() => s.map((e) => e.value), [s]), z = y(() => n ? h.length > 0 ? `${h.length} item${h.length === 1 ? "" : "s"} selected` : null : i.get(h[0])?.label || null, [n, h, i]), q = l(
90
+ }, [X, n, s, i, m, Z, Y]), xe = y(() => s.map((e) => e.value), [s]), z = y(() => n ? m.length > 0 ? `${m.length} item${m.length === 1 ? "" : "s"} selected` : null : i.get(m[0])?.label || null, [n, m, i]), q = l(
91
91
  c("combobox-input"),
92
- c(`combobox-input-${F}`),
92
+ c(`combobox-input-${O}`),
93
93
  k && c(`combobox-input-${k}`),
94
94
  b?.input
95
95
  ), ve = v(
@@ -98,34 +98,34 @@ const Le = (s) => /* @__PURE__ */ t(M.Root, { ...s }), Pe = (s) => /* @__PURE__
98
98
  return le(o?.label || String(e));
99
99
  },
100
100
  [i]
101
- ), [j, ee] = De(""), { handleAddOnEnter: oe, handleInputValueChange: ye } = Fe({
102
- addOnEnter: $,
101
+ ), [M, ee] = De(""), { handleAddOnEnter: oe, handleInputValueChange: ye } = Oe({
102
+ addOnEnter: B,
103
103
  multiple: n,
104
104
  tokenSeparators: C,
105
105
  optionMap: i,
106
106
  value: u,
107
- handleValueChange: m,
107
+ handleValueChange: h,
108
108
  setOpen: S,
109
109
  setSearchValue: ee,
110
- onSearch: O
111
- }), Ie = !!C?.length, Ne = n && Ie ? !1 : B, te = v(
110
+ onSearch: $
111
+ }), Ie = !!C?.length, Ne = n && Ie && Ve(M, C) ? !1 : L, te = v(
112
112
  (e) => (o) => {
113
- if (o.key === "Enter" && $ && e) {
114
- if (!n && B) return;
115
- oe(e) && (o.preventDefault(), ee(""), O?.(""));
113
+ if (o.key === "Enter" && B && e) {
114
+ if (!n && L) return;
115
+ oe(e) && (o.preventDefault(), ee(""), $?.(""));
116
116
  }
117
117
  },
118
- [$, B, n, oe, O]
119
- ), we = y(() => T === !1 ? null : typeof T == "function" ? (e, o) => {
118
+ [B, L, n, oe, $]
119
+ ), we = y(() => R === !1 ? null : typeof R == "function" ? (e, o) => {
120
120
  const a = i.get(e);
121
- return T(o, a);
121
+ return R(o, a);
122
122
  } : (e, o) => {
123
123
  if (!o) return !0;
124
124
  const a = i.get(e);
125
125
  if (!a) return !1;
126
- const d = C && C.length > 0 ? Ve(o, C) : [o], x = G(a).map((N) => N.toLowerCase()), f = d.filter((N) => {
126
+ const d = C && C.length > 0 ? Fe(o, C) : [o], x = G(a).map((N) => N.toLowerCase()), f = d.filter((N) => {
127
127
  const E = N.toLowerCase();
128
- return x.some((Ae) => Ae.includes(E));
128
+ return x.some((Te) => Te.includes(E));
129
129
  }).length;
130
130
  if (f === 0) return !1;
131
131
  if (d.length > 1 && f > 1) {
@@ -133,19 +133,19 @@ const Le = (s) => /* @__PURE__ */ t(M.Root, { ...s }), Pe = (s) => /* @__PURE__
133
133
  return x.some((E) => E.includes(N));
134
134
  }
135
135
  return !0;
136
- }, [T, i, C, G]);
136
+ }, [R, i, C, G]);
137
137
  return /* @__PURE__ */ t("div", { ref: ge, className: l(c("combobox"), ue), ...fe, children: /* @__PURE__ */ g(
138
138
  r.Root,
139
139
  {
140
- value: n ? h : h[0] ?? null,
140
+ value: n ? m : m[0] ?? null,
141
141
  onValueChange: (e) => {
142
- m(
142
+ h(
143
143
  n ? Array.isArray(e) ? e : [] : e
144
144
  );
145
145
  },
146
- inputValue: j,
146
+ inputValue: M,
147
147
  onInputValueChange: ye,
148
- open: L,
148
+ open: P,
149
149
  onOpenChange: S,
150
150
  multiple: n,
151
151
  disabled: I,
@@ -159,10 +159,10 @@ const Le = (s) => /* @__PURE__ */ t(M.Root, { ...s }), Pe = (s) => /* @__PURE__
159
159
  /* @__PURE__ */ g(
160
160
  p.Root,
161
161
  {
162
- ref: P,
163
- size: F,
162
+ ref: j,
163
+ size: O,
164
164
  disabled: I,
165
- open: L,
165
+ open: P,
166
166
  status: k,
167
167
  placeholder: w,
168
168
  displayValue: z,
@@ -182,7 +182,7 @@ const Le = (s) => /* @__PURE__ */ t(M.Root, { ...s }), Pe = (s) => /* @__PURE__
182
182
  const f = i.get(x);
183
183
  return /* @__PURE__ */ g(r.Chip, { className: l(c("combobox-chip")), children: [
184
184
  f?.icon && /* @__PURE__ */ t("span", { className: l(c("combobox-chip-icon")), children: f.icon }),
185
- /* @__PURE__ */ t("span", { className: l(c("combobox-chip-text")), children: f ? R ? R(f) : f.label : x }),
185
+ /* @__PURE__ */ t("span", { className: l(c("combobox-chip-text")), children: f ? A ? A(f) : f.label : x }),
186
186
  /* @__PURE__ */ t(
187
187
  r.ChipRemove,
188
188
  {
@@ -198,7 +198,7 @@ const Le = (s) => /* @__PURE__ */ t(M.Root, { ...s }), Pe = (s) => /* @__PURE__
198
198
  placeholder: d.length > 0 ? "" : w,
199
199
  className: q,
200
200
  disabled: I,
201
- onKeyDown: te(j)
201
+ onKeyDown: te(M)
202
202
  }
203
203
  )
204
204
  ] }) }) })
@@ -222,11 +222,11 @@ const Le = (s) => /* @__PURE__ */ t(M.Root, { ...s }), Pe = (s) => /* @__PURE__
222
222
  ) : /* @__PURE__ */ g(
223
223
  p.Root,
224
224
  {
225
- ref: P,
225
+ ref: j,
226
226
  as: "div",
227
- size: F,
227
+ size: O,
228
228
  disabled: I,
229
- open: L,
229
+ open: P,
230
230
  status: k,
231
231
  placeholder: w,
232
232
  displayValue: z,
@@ -246,7 +246,7 @@ const Le = (s) => /* @__PURE__ */ t(M.Root, { ...s }), Pe = (s) => /* @__PURE__
246
246
  placeholder: w,
247
247
  className: l(e, q),
248
248
  disabled: I,
249
- onKeyDown: te(j),
249
+ onKeyDown: te(M),
250
250
  ...a
251
251
  }
252
252
  )
@@ -270,11 +270,11 @@ const Le = (s) => /* @__PURE__ */ t(M.Root, { ...s }), Pe = (s) => /* @__PURE__
270
270
  /* @__PURE__ */ t(r.Portal, { children: /* @__PURE__ */ t(
271
271
  r.Positioner,
272
272
  {
273
- anchor: P.current,
273
+ anchor: j.current,
274
274
  sideOffset: 4,
275
- side: A.startsWith("top") ? "top" : "bottom",
276
- align: A.endsWith("Right") ? "end" : A === "top" || A === "bottom" ? "center" : "start",
277
- render: Le,
275
+ side: T.startsWith("top") ? "top" : "bottom",
276
+ align: T.endsWith("Right") ? "end" : T === "top" || T === "bottom" ? "center" : "start",
277
+ render: Pe,
278
278
  children: /* @__PURE__ */ t(
279
279
  r.Popup,
280
280
  {
@@ -283,7 +283,7 @@ const Le = (s) => /* @__PURE__ */ t(M.Root, { ...s }), Pe = (s) => /* @__PURE__
283
283
  !be && c("combobox-popup--auto-width"),
284
284
  b?.portal
285
285
  ),
286
- render: Pe,
286
+ render: je,
287
287
  children: /* @__PURE__ */ g("div", { className: l(c("combobox-container")), children: [
288
288
  D && /* @__PURE__ */ g(ne, { children: [
289
289
  /* @__PURE__ */ t(
@@ -299,18 +299,18 @@ const Le = (s) => /* @__PURE__ */ t(M.Root, { ...s }), Pe = (s) => /* @__PURE__
299
299
  children: "Select All"
300
300
  }
301
301
  ),
302
- /* @__PURE__ */ t(r.Separator, { render: je })
302
+ /* @__PURE__ */ t(r.Separator, { render: Ee })
303
303
  ] }),
304
- /* @__PURE__ */ g(Be, { fadeEdges: !0, children: [
304
+ /* @__PURE__ */ g(Le, { fadeEdges: !0, children: [
305
305
  /* @__PURE__ */ t(
306
306
  r.List,
307
307
  {
308
308
  className: l(c("combobox-list"), b?.list),
309
- render: Ee,
309
+ render: Ke,
310
310
  children: (e) => {
311
311
  const o = i.get(e);
312
312
  if (!o) return null;
313
- const a = h.includes(e);
313
+ const a = m.includes(e);
314
314
  return H ? H(o, {}) : /* @__PURE__ */ t(
315
315
  se,
316
316
  {
@@ -323,7 +323,7 @@ const Le = (s) => /* @__PURE__ */ t(M.Root, { ...s }), Pe = (s) => /* @__PURE__
323
323
  icon: b?.optionIcon,
324
324
  text: b?.optionText
325
325
  },
326
- labelRender: R ? (d) => R(o, d) : void 0,
326
+ labelRender: A ? (d) => A(o, d) : void 0,
327
327
  render: (d) => /* @__PURE__ */ t(
328
328
  r.Item,
329
329
  {
@@ -341,7 +341,7 @@ const Le = (s) => /* @__PURE__ */ t(M.Root, { ...s }), Pe = (s) => /* @__PURE__
341
341
  }
342
342
  }
343
343
  ),
344
- /* @__PURE__ */ t(r.Empty, { className: l(c("combobox-empty")), children: /* @__PURE__ */ t(Oe, { description: "No options found" }) })
344
+ /* @__PURE__ */ t(r.Empty, { className: l(c("combobox-empty")), children: /* @__PURE__ */ t($e, { description: "No options found" }) })
345
345
  ] })
346
346
  ] })
347
347
  }
@@ -351,11 +351,11 @@ const Le = (s) => /* @__PURE__ */ t(M.Root, { ...s }), Pe = (s) => /* @__PURE__
351
351
  ]
352
352
  }
353
353
  ) });
354
- }, We = Se(Ke), ao = Object.assign(We, {
354
+ }, He = Se(We), io = Object.assign(He, {
355
355
  // Add any sub components here if needed
356
356
  });
357
357
  export {
358
- ao as Combobox,
359
- ao as default
358
+ io as Combobox,
359
+ io as default
360
360
  };
361
361
  //# sourceMappingURL=component.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"component.js","sources":["../../../src/components/combobox/component.tsx"],"sourcesContent":["\"use client\";\nimport { Combobox as BaseCombobox } from \"@base-ui/react/combobox\";\nimport DisabledContext from \"antd/es/config-provider/DisabledContext\";\nimport { FormItemInputContext } from \"antd/es/form/context\";\nimport React, {\n ForwardedRef,\n forwardRef,\n useCallback,\n useContext,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { BaseMenuItem } from \"../base-menu\";\nimport { useControlledState } from \"../hooks\";\nimport { ScrollArea } from \"../scroll-area\";\nimport { SelectTrigger } from \"../select-trigger\";\nimport { clsx, reactNodeToString, useCls } from \"../utils\";\n\nimport { XIcon } from \"@bioturing/assets\";\nimport { BaseMenu } from \"../base-menu\";\nimport { Empty } from \"../empty\";\nimport type { ComboboxOption, ComboboxProps } from \"./types\";\nimport { splitBySeparators } from \"./utils\";\nimport { useComboboxTokenInput } from \"./use-combobox-token-input\";\nimport \"./style.css\";\n\nexport type { ComboboxOption, ComboboxProps } from \"./types\";\n\n// Module-level static renderers — avoid recreating on every render\nconst positionerRender = (props: React.ComponentProps<\"div\">) => <BaseMenu.Root {...props} />;\nconst popupRender = (props: React.ComponentProps<\"div\">) => <BaseMenu.Popup {...props} />;\nconst separatorRender = (props: React.ComponentProps<\"div\">) => <BaseMenu.Divider {...props} />;\nconst listRender = (props: React.ComponentProps<\"div\">) => <BaseMenu.List {...props} />;\n\nconst ComboboxInner = <\n T extends React.Key,\n M extends boolean,\n O extends Record<string, unknown> = {},\n>(\n {\n options = [],\n value: controlledValue,\n defaultValue,\n onChange,\n placeholder = \"Select...\",\n disabled: disabledProp = false,\n status: statusProp,\n allowClear = false,\n multiple = false as M,\n showSearch: _showSearch = true,\n open: controlledOpen,\n onOpenChange,\n className,\n classNames,\n size = \"middle\",\n optionRender,\n onSearch,\n clearIcon,\n suffixIcon,\n placement = \"bottomLeft\",\n // showSelectionSummary: _showSelectionSummary = false,\n // selectionSummaryRender,\n showSelectAll = false,\n optionLabelRender,\n getOptionKeywords: _getOptionKeywords = (option: ComboboxOption<T, O>) => [\n String(option.value),\n reactNodeToString(option.label),\n ],\n popupMatchSelectWidth = true,\n addOnEnter = false,\n tokenSeparators,\n autoHighlight = true,\n filterOption,\n ...rest\n }: ComboboxProps<T, M, O>,\n ref: React.ForwardedRef<HTMLDivElement>,\n) => {\n const [value, setValue] = useControlledState(\n controlledValue,\n onChange,\n defaultValue !== undefined ? defaultValue : multiple ? ([] as T[]) : undefined,\n );\n\n const [open, setOpen] = useControlledState(controlledOpen, onOpenChange, false);\n\n const cls = useCls();\n const inputContainerRef = useRef<HTMLDivElement>(null);\n\n // Get form context values\n const { status: contextStatus } = useContext(FormItemInputContext);\n const contextDisabled = useContext(DisabledContext);\n\n // Merge context values with props\n const mergedStatus = statusProp || contextStatus;\n const disabled = disabledProp || contextDisabled;\n\n const handleValueChange = useCallback(\n (newValue: M extends true ? T[] : T) => {\n setValue(newValue);\n onChange?.(newValue);\n },\n [setValue, onChange],\n );\n\n const handleSelectAll = useCallback(() => {\n if (multiple) {\n const allValues = options.map((option) => option.value);\n (handleValueChange as (v: T[]) => void)(allValues);\n }\n }, [multiple, options, handleValueChange]);\n\n const handleDeselectAll = useCallback(() => {\n if (multiple) {\n (handleValueChange as (v: T[]) => void)([]);\n }\n }, [multiple, handleValueChange]);\n\n const handleClear = useCallback(() => {\n if (multiple) {\n (handleValueChange as (v: T[]) => void)([]);\n } else {\n (handleValueChange as (v: T) => void)(undefined as T);\n }\n }, [multiple, handleValueChange]);\n\n // Prepare selected values\n const selectedValues = useMemo(() => {\n return Array.isArray(value) ? value : value ? [value] : [];\n }, [value]);\n\n // Build a Map for O(1) option lookups.\n // `options.find()` was being called 7+ times per render and inside\n // the hot `filter` path on every keystroke.\n const optionMap = useMemo(() => {\n const map = new Map<T, ComboboxOption<T, O>>();\n for (const opt of options) {\n map.set(opt.value, opt);\n }\n return map;\n }, [options]);\n\n // Select all option logic\n const selectAllOption = useMemo(() => {\n if (!showSelectAll || !multiple || options.length === 0) {\n return null;\n }\n\n const selectedFromFiltered = selectedValues.filter((val) => optionMap.has(val as T));\n const checked = selectedFromFiltered.length === options.length && options.length > 0;\n const indeterminate =\n selectedFromFiltered.length > 0 && selectedFromFiltered.length < options.length;\n\n return {\n checked,\n indeterminate,\n onToggle: () => {\n if (indeterminate || checked) {\n handleDeselectAll();\n } else {\n handleSelectAll();\n }\n },\n };\n }, [showSelectAll, multiple, options, optionMap, selectedValues, handleDeselectAll, handleSelectAll]);\n\n // Convert options to Base UI format\n const baseUIItems = useMemo(() => options.map((opt) => opt.value), [options]);\n\n // Get display value for SelectTrigger\n const displayValue = useMemo(() => {\n if (multiple) {\n return selectedValues.length > 0\n ? `${selectedValues.length} item${selectedValues.length === 1 ? \"\" : \"s\"} selected`\n : null;\n } else {\n const selectedOption = optionMap.get(selectedValues[0] as T);\n return selectedOption?.label || null;\n }\n }, [multiple, selectedValues, optionMap]);\n\n const inputClassName = clsx(\n cls(\"combobox-input\"),\n cls(`combobox-input-${size}`),\n mergedStatus && cls(`combobox-input-${mergedStatus}`),\n classNames?.input,\n );\n\n const itemToStringLabel = useCallback(\n (itemValue: T) => {\n const option = optionMap.get(itemValue);\n return reactNodeToString(option?.label || String(itemValue));\n },\n [optionMap],\n );\n\n const [searchValue, setSearchValue] = useState(\"\");\n\n const { handleAddOnEnter, handleInputValueChange } = useComboboxTokenInput<T, O>({\n addOnEnter,\n multiple,\n tokenSeparators,\n optionMap,\n value: value as T | T[] | undefined,\n handleValueChange: handleValueChange as (nextValue: T | T[]) => void,\n setOpen,\n setSearchValue,\n onSearch,\n });\n\n const hasTokenSeparators = Boolean(tokenSeparators?.length);\n const effectiveAutoHighlight = multiple && hasTokenSeparators ? false : autoHighlight;\n\n const createInputKeyDownHandler = useCallback(\n (currentSearchValue: string) => (event: React.KeyboardEvent<HTMLInputElement>) => {\n if (event.key === \"Enter\" && addOnEnter && currentSearchValue) {\n // In single-select mode with autoHighlight, let Base UI handle Enter\n // to select the natively highlighted item instead of exact matching.\n if (!multiple && autoHighlight) return;\n\n const matched = handleAddOnEnter(currentSearchValue);\n if (matched) {\n event.preventDefault();\n setSearchValue(\"\");\n onSearch?.(\"\");\n }\n }\n },\n [addOnEnter, autoHighlight, multiple, handleAddOnEnter, onSearch],\n );\n\n const mergedFilter = useMemo(() => {\n if (filterOption === false) {\n return null;\n }\n\n if (typeof filterOption === \"function\") {\n return (itemValue: T, query: string) => {\n const option = optionMap.get(itemValue);\n return filterOption(query, option);\n };\n }\n\n return (itemValue: T, query: string) => {\n if (!query) return true;\n const option = optionMap.get(itemValue);\n if (!option) return false;\n\n const tokens =\n tokenSeparators && tokenSeparators.length > 0\n ? splitBySeparators(query, tokenSeparators)\n : [query];\n\n const keywords = _getOptionKeywords(option).map((k) => k.toLowerCase());\n\n const matchingTokenCount = tokens.filter((token) => {\n const lowerToken = token.toLowerCase();\n return keywords.some((keyword) => keyword.includes(lowerToken));\n }).length;\n\n if (matchingTokenCount === 0) return false;\n if (tokens.length > 1 && matchingTokenCount > 1) {\n const lowerQuery = query.toLowerCase();\n return keywords.some((keyword) => keyword.includes(lowerQuery));\n }\n return true;\n };\n }, [filterOption, optionMap, tokenSeparators, _getOptionKeywords]);\n\n return (\n <div ref={ref} className={clsx(cls(\"combobox\"), className)} {...rest}>\n <BaseCombobox.Root<T, M>\n value={\n (multiple ? selectedValues : (selectedValues[0] ?? null)) as M extends true\n ? T[]\n : T | null\n }\n onValueChange={(newValue) => {\n if (multiple) {\n (handleValueChange as (v: T[]) => void)(\n Array.isArray(newValue) ? (newValue as T[]) : [],\n );\n } else {\n (handleValueChange as (v: T) => void)(newValue as T);\n }\n }}\n inputValue={searchValue}\n onInputValueChange={handleInputValueChange}\n open={open}\n onOpenChange={setOpen}\n multiple={multiple}\n disabled={disabled}\n autoHighlight={effectiveAutoHighlight}\n items={baseUIItems}\n itemToStringLabel={itemToStringLabel}\n filter={mergedFilter}\n >\n {/* Single Selection Layout using SelectTrigger compound components */}\n {!multiple ? (\n <SelectTrigger.Root\n ref={inputContainerRef}\n as=\"div\"\n size={size}\n disabled={disabled}\n open={open}\n status={mergedStatus}\n placeholder={placeholder}\n displayValue={displayValue}\n allowClear={allowClear}\n suffixIcon={suffixIcon}\n clearIcon={clearIcon}\n onClear={handleClear}\n onOpenChange={setOpen}\n className={clsx(classNames?.trigger, cls(\"combobox-trigger-single\"))}\n >\n <SelectTrigger.Content\n contentRender={({ className, children, ...rest }) => (\n <BaseCombobox.Input\n placeholder={placeholder}\n className={clsx(className, inputClassName)}\n disabled={disabled}\n onKeyDown={createInputKeyDownHandler(searchValue)}\n {...rest}\n />\n )}\n />\n <SelectTrigger.Clear\n render={(props) => <BaseCombobox.Clear {...props}></BaseCombobox.Clear>}\n />\n <SelectTrigger.Arrow\n render={(props, { icon }) => (\n <BaseCombobox.Trigger {...props}>\n <BaseCombobox.Icon>{icon}</BaseCombobox.Icon>\n </BaseCombobox.Trigger>\n )}\n />\n </SelectTrigger.Root>\n ) : (\n /* Multiple Selection Layout using SelectTrigger compound components */\n <SelectTrigger.Root\n ref={inputContainerRef}\n size={size}\n disabled={disabled}\n open={open}\n status={mergedStatus}\n placeholder={placeholder}\n displayValue={displayValue}\n allowClear={allowClear}\n suffixIcon={suffixIcon}\n clearIcon={clearIcon}\n onClear={handleClear}\n onOpenChange={setOpen}\n className={clsx(classNames?.trigger, cls(\"combobox-trigger-multiple\"))}\n as=\"div\"\n >\n <SelectTrigger.Content\n contentRender={({ className, children, ...rest }) => (\n <BaseCombobox.Chips className={clsx(cls(\"combobox-chips\"), className)} {...rest}>\n <BaseCombobox.Value>\n {(selectedItems) => (\n <>\n {selectedItems.map((item: T) => {\n const option = optionMap.get(item);\n return (\n <BaseCombobox.Chip key={item} className={clsx(cls(\"combobox-chip\"))}>\n {option?.icon && (\n <span className={clsx(cls(\"combobox-chip-icon\"))}>\n {option.icon}\n </span>\n )}\n <span className={clsx(cls(\"combobox-chip-text\"))}>\n {option\n ? optionLabelRender\n ? optionLabelRender(option)\n : option.label\n : item}\n </span>\n <BaseCombobox.ChipRemove\n className={clsx(cls(\"combobox-chip-remove\"))}\n >\n <XIcon />\n </BaseCombobox.ChipRemove>\n </BaseCombobox.Chip>\n );\n })}\n\n <BaseCombobox.Input\n placeholder={selectedItems.length > 0 ? \"\" : placeholder}\n className={inputClassName}\n disabled={disabled}\n onKeyDown={createInputKeyDownHandler(searchValue)}\n />\n </>\n )}\n </BaseCombobox.Value>\n </BaseCombobox.Chips>\n )}\n />\n <SelectTrigger.Clear\n render={(props) => <BaseCombobox.Clear {...props}></BaseCombobox.Clear>}\n />\n <SelectTrigger.Arrow\n render={(props, { icon }) => (\n <BaseCombobox.Trigger {...props}>\n <BaseCombobox.Icon>{icon}</BaseCombobox.Icon>\n </BaseCombobox.Trigger>\n )}\n />\n </SelectTrigger.Root>\n )}\n\n <BaseCombobox.Portal>\n <BaseCombobox.Positioner\n anchor={inputContainerRef.current}\n sideOffset={4}\n side={placement.startsWith(\"top\") ? \"top\" : \"bottom\"}\n align={\n placement.endsWith(\"Right\")\n ? \"end\"\n : placement === \"top\" || placement === \"bottom\"\n ? \"center\"\n : \"start\"\n }\n render={positionerRender}\n >\n <BaseCombobox.Popup\n className={clsx(\n cls(\"combobox-popup\"),\n !popupMatchSelectWidth && cls(\"combobox-popup--auto-width\"),\n classNames?.portal,\n )}\n render={popupRender}\n >\n <div className={clsx(cls(\"combobox-container\"))}>\n {/* Select All Option */}\n {selectAllOption && (\n <>\n <BaseMenuItem\n as=\"button\"\n type=\"button\"\n className={clsx(cls(\"combobox-select-all\"))}\n selected={selectAllOption.checked}\n onClick={selectAllOption.onToggle}\n indeterminate={selectAllOption.indeterminate}\n showCheckbox\n >\n Select All\n </BaseMenuItem>\n <BaseCombobox.Separator render={separatorRender} />\n </>\n )}\n <ScrollArea fadeEdges>\n <BaseCombobox.List\n className={clsx(cls(\"combobox-list\"), classNames?.list)}\n render={listRender}\n >\n {(item: T) => {\n const option = optionMap.get(item);\n if (!option) return null;\n const isSelected = (selectedValues as T[]).includes(item);\n return optionRender ? (\n optionRender(option, {})\n ) : (\n <BaseMenuItem\n key={option.value}\n disabled={option.disabled}\n selected={isSelected}\n showCheckbox={multiple}\n icon={option.icon}\n classNames={{\n root: clsx(classNames?.option),\n icon: classNames?.optionIcon,\n text: classNames?.optionText,\n }}\n labelRender={\n optionLabelRender\n ? (props: React.HTMLAttributes<HTMLElement>) =>\n optionLabelRender(option, props)\n : undefined\n }\n render={(props: React.HTMLAttributes<HTMLElement>) => (\n <BaseCombobox.Item\n value={item as T}\n disabled={option.disabled}\n {...props}\n data-disabled={option.disabled}\n data-selected={isSelected}\n />\n )}\n >\n {option.label}\n </BaseMenuItem>\n );\n }}\n </BaseCombobox.List>\n\n <BaseCombobox.Empty className={clsx(cls(\"combobox-empty\"))}>\n <Empty description=\"No options found\" />\n </BaseCombobox.Empty>\n </ScrollArea>\n </div>\n </BaseCombobox.Popup>\n </BaseCombobox.Positioner>\n </BaseCombobox.Portal>\n </BaseCombobox.Root>\n </div>\n );\n};\n\nconst MainCombobox = forwardRef(ComboboxInner) as <\n T extends React.Key,\n M extends boolean,\n O extends Record<string, unknown> = {},\n>(\n props: ComboboxProps<T, M, O> & { ref?: ForwardedRef<HTMLDivElement> },\n) => ReturnType<typeof ComboboxInner>;\n\nexport const Combobox = Object.assign(MainCombobox, {\n // Add any sub components here if needed\n});\n\nexport default Combobox;\n"],"names":["positionerRender","props","jsx","BaseMenu","popupRender","separatorRender","listRender","ComboboxInner","options","controlledValue","defaultValue","onChange","placeholder","disabledProp","statusProp","allowClear","multiple","_showSearch","controlledOpen","onOpenChange","className","classNames","size","optionRender","onSearch","clearIcon","suffixIcon","placement","showSelectAll","optionLabelRender","_getOptionKeywords","option","reactNodeToString","popupMatchSelectWidth","addOnEnter","tokenSeparators","autoHighlight","filterOption","rest","ref","value","setValue","useControlledState","open","setOpen","cls","useCls","inputContainerRef","useRef","contextStatus","useContext","FormItemInputContext","contextDisabled","DisabledContext","mergedStatus","disabled","handleValueChange","useCallback","newValue","handleSelectAll","allValues","handleDeselectAll","handleClear","selectedValues","useMemo","optionMap","map","opt","selectAllOption","selectedFromFiltered","val","checked","indeterminate","baseUIItems","displayValue","inputClassName","clsx","itemToStringLabel","itemValue","searchValue","setSearchValue","useState","handleAddOnEnter","handleInputValueChange","useComboboxTokenInput","hasTokenSeparators","effectiveAutoHighlight","createInputKeyDownHandler","currentSearchValue","event","mergedFilter","query","tokens","splitBySeparators","keywords","k","matchingTokenCount","token","lowerToken","keyword","lowerQuery","jsxs","BaseCombobox","SelectTrigger","children","selectedItems","Fragment","item","XIcon","icon","BaseMenuItem","ScrollArea","isSelected","Empty","MainCombobox","forwardRef","Combobox"],"mappings":";;;;;;;;;;;;;;;;;;;AA8BA,MAAMA,KAAmB,CAACC,MAAuC,gBAAAC,EAACC,EAAS,MAAT,EAAe,GAAGF,GAAO,GACrFG,KAAc,CAACH,MAAuC,gBAAAC,EAACC,EAAS,OAAT,EAAgB,GAAGF,GAAO,GACjFI,KAAkB,CAACJ,MAAuC,gBAAAC,EAACC,EAAS,SAAT,EAAkB,GAAGF,GAAO,GACvFK,KAAa,CAACL,MAAuC,gBAAAC,EAACC,EAAS,MAAT,EAAe,GAAGF,GAAO,GAE/EM,KAAgB,CAKpB;AAAA,EACE,SAAAC,IAAU,CAAA;AAAA,EACV,OAAOC;AAAA,EACP,cAAAC;AAAA,EACA,UAAAC;AAAA,EACA,aAAAC,IAAc;AAAA,EACd,UAAUC,KAAe;AAAA,EACzB,QAAQC;AAAA,EACR,YAAAC,IAAa;AAAA,EACb,UAAAC,IAAW;AAAA,EACX,YAAYC,KAAc;AAAA,EAC1B,MAAMC;AAAA,EACN,cAAAC;AAAA,EACA,WAAAC;AAAA,EACA,YAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,cAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,YAAAC;AAAA,EACA,WAAAC,IAAY;AAAA;AAAA;AAAA,EAGZ,eAAAC,IAAgB;AAAA,EAChB,mBAAAC;AAAA,EACA,mBAAmBC,IAAqB,CAACC,MAAiC;AAAA,IACxE,OAAOA,EAAO,KAAK;AAAA,IACnBC,GAAkBD,EAAO,KAAK;AAAA,EAAA;AAAA,EAEhC,uBAAAE,KAAwB;AAAA,EACxB,YAAAC,IAAa;AAAA,EACb,iBAAAC;AAAA,EACA,eAAAC,IAAgB;AAAA,EAChB,cAAAC;AAAA,EACA,GAAGC;AACL,GACAC,OACG;AACH,QAAM,CAACC,GAAOC,CAAQ,IA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AeiF;AAAA,gCAAA;AAAA,8BAAA;AAAA,8BAIlB,UAAAjF,EAAO;AAAA,4BAAA;AAAA,4BA1BHA,EAAO;AAAA,0BAAA;AAAA,wBA6BlB;AAAA,sBAAA;AAAA,oBAAA;AAAA,oBAGF,gBAAA7B,EAACoG,EAAa,OAAb,EAAmB,WAAW1B,EAAK/B,EAAI,gBAAgB,CAAC,GACvD,UAAA,gBAAA3C,EAAC+G,IAAA,EAAM,aAAY,oBAAmB,EAAA,CACxC;AAAA,kBAAA,EAAA,CACF;AAAA,gBAAA,EAAA,CACF;AAAA,cAAA;AAAA,YAAA;AAAA,UACF;AAAA,QAAA,EACF,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ,GAEMC,KAAeC,GAAW5G,EAAa,GAQhC6G,KAAW,OAAO,OAAOF,IAAc;AAAA;AAEpD,CAAC;"}
1
+ {"version":3,"file":"component.js","sources":["../../../src/components/combobox/component.tsx"],"sourcesContent":["\"use client\";\nimport { Combobox as BaseCombobox } from \"@base-ui/react/combobox\";\nimport DisabledContext from \"antd/es/config-provider/DisabledContext\";\nimport { FormItemInputContext } from \"antd/es/form/context\";\nimport React, {\n ForwardedRef,\n forwardRef,\n useCallback,\n useContext,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { BaseMenuItem } from \"../base-menu\";\nimport { useControlledState } from \"../hooks\";\nimport { ScrollArea } from \"../scroll-area\";\nimport { SelectTrigger } from \"../select-trigger\";\nimport { clsx, reactNodeToString, useCls } from \"../utils\";\n\nimport { XIcon } from \"@bioturing/assets\";\nimport { BaseMenu } from \"../base-menu\";\nimport { Empty } from \"../empty\";\nimport type { ComboboxOption, ComboboxProps } from \"./types\";\nimport { hasTokenSeparator, splitBySeparators } from \"./utils\";\nimport { useComboboxTokenInput } from \"./use-combobox-token-input\";\nimport \"./style.css\";\n\nexport type { ComboboxOption, ComboboxProps } from \"./types\";\n\n// Module-level static renderers — avoid recreating on every render\nconst positionerRender = (props: React.ComponentProps<\"div\">) => <BaseMenu.Root {...props} />;\nconst popupRender = (props: React.ComponentProps<\"div\">) => <BaseMenu.Popup {...props} />;\nconst separatorRender = (props: React.ComponentProps<\"div\">) => <BaseMenu.Divider {...props} />;\nconst listRender = (props: React.ComponentProps<\"div\">) => <BaseMenu.List {...props} />;\n\nconst ComboboxInner = <\n T extends React.Key,\n M extends boolean,\n O extends Record<string, unknown> = {},\n>(\n {\n options = [],\n value: controlledValue,\n defaultValue,\n onChange,\n placeholder = \"Select...\",\n disabled: disabledProp = false,\n status: statusProp,\n allowClear = false,\n multiple = false as M,\n showSearch: _showSearch = true,\n open: controlledOpen,\n onOpenChange,\n className,\n classNames,\n size = \"middle\",\n optionRender,\n onSearch,\n clearIcon,\n suffixIcon,\n placement = \"bottomLeft\",\n // showSelectionSummary: _showSelectionSummary = false,\n // selectionSummaryRender,\n showSelectAll = false,\n optionLabelRender,\n getOptionKeywords: _getOptionKeywords = (option: ComboboxOption<T, O>) => [\n String(option.value),\n reactNodeToString(option.label),\n ],\n popupMatchSelectWidth = true,\n addOnEnter = false,\n tokenSeparators,\n autoHighlight = true,\n filterOption,\n ...rest\n }: ComboboxProps<T, M, O>,\n ref: React.ForwardedRef<HTMLDivElement>,\n) => {\n const [value, setValue] = useControlledState(\n controlledValue,\n onChange,\n defaultValue !== undefined ? defaultValue : multiple ? ([] as T[]) : undefined,\n );\n\n const [open, setOpen] = useControlledState(controlledOpen, onOpenChange, false);\n\n const cls = useCls();\n const inputContainerRef = useRef<HTMLDivElement>(null);\n\n // Get form context values\n const { status: contextStatus } = useContext(FormItemInputContext);\n const contextDisabled = useContext(DisabledContext);\n\n // Merge context values with props\n const mergedStatus = statusProp || contextStatus;\n const disabled = disabledProp || contextDisabled;\n\n const handleValueChange = useCallback(\n (newValue: M extends true ? T[] : T) => {\n setValue(newValue);\n onChange?.(newValue);\n },\n [setValue, onChange],\n );\n\n const handleSelectAll = useCallback(() => {\n if (multiple) {\n const allValues = options.map((option) => option.value);\n (handleValueChange as (v: T[]) => void)(allValues);\n }\n }, [multiple, options, handleValueChange]);\n\n const handleDeselectAll = useCallback(() => {\n if (multiple) {\n (handleValueChange as (v: T[]) => void)([]);\n }\n }, [multiple, handleValueChange]);\n\n const handleClear = useCallback(() => {\n if (multiple) {\n (handleValueChange as (v: T[]) => void)([]);\n } else {\n (handleValueChange as (v: T) => void)(undefined as T);\n }\n }, [multiple, handleValueChange]);\n\n // Prepare selected values\n const selectedValues = useMemo(() => {\n return Array.isArray(value) ? value : value ? [value] : [];\n }, [value]);\n\n // Build a Map for O(1) option lookups.\n // `options.find()` was being called 7+ times per render and inside\n // the hot `filter` path on every keystroke.\n const optionMap = useMemo(() => {\n const map = new Map<T, ComboboxOption<T, O>>();\n for (const opt of options) {\n map.set(opt.value, opt);\n }\n return map;\n }, [options]);\n\n // Select all option logic\n const selectAllOption = useMemo(() => {\n if (!showSelectAll || !multiple || options.length === 0) {\n return null;\n }\n\n const selectedFromFiltered = selectedValues.filter((val) => optionMap.has(val as T));\n const checked = selectedFromFiltered.length === options.length && options.length > 0;\n const indeterminate =\n selectedFromFiltered.length > 0 && selectedFromFiltered.length < options.length;\n\n return {\n checked,\n indeterminate,\n onToggle: () => {\n if (indeterminate || checked) {\n handleDeselectAll();\n } else {\n handleSelectAll();\n }\n },\n };\n }, [showSelectAll, multiple, options, optionMap, selectedValues, handleDeselectAll, handleSelectAll]);\n\n // Convert options to Base UI format\n const baseUIItems = useMemo(() => options.map((opt) => opt.value), [options]);\n\n // Get display value for SelectTrigger\n const displayValue = useMemo(() => {\n if (multiple) {\n return selectedValues.length > 0\n ? `${selectedValues.length} item${selectedValues.length === 1 ? \"\" : \"s\"} selected`\n : null;\n } else {\n const selectedOption = optionMap.get(selectedValues[0] as T);\n return selectedOption?.label || null;\n }\n }, [multiple, selectedValues, optionMap]);\n\n const inputClassName = clsx(\n cls(\"combobox-input\"),\n cls(`combobox-input-${size}`),\n mergedStatus && cls(`combobox-input-${mergedStatus}`),\n classNames?.input,\n );\n\n const itemToStringLabel = useCallback(\n (itemValue: T) => {\n const option = optionMap.get(itemValue);\n return reactNodeToString(option?.label || String(itemValue));\n },\n [optionMap],\n );\n\n const [searchValue, setSearchValue] = useState(\"\");\n\n const { handleAddOnEnter, handleInputValueChange } = useComboboxTokenInput<T, O>({\n addOnEnter,\n multiple,\n tokenSeparators,\n optionMap,\n value: value as T | T[] | undefined,\n handleValueChange: handleValueChange as (nextValue: T | T[]) => void,\n setOpen,\n setSearchValue,\n onSearch,\n });\n\n const hasTokenSeparators = Boolean(tokenSeparators?.length);\n const effectiveAutoHighlight =\n multiple && hasTokenSeparators && hasTokenSeparator(searchValue, tokenSeparators)\n ? false\n : autoHighlight;\n\n const createInputKeyDownHandler = useCallback(\n (currentSearchValue: string) => (event: React.KeyboardEvent<HTMLInputElement>) => {\n if (event.key === \"Enter\" && addOnEnter && currentSearchValue) {\n // In single-select mode with autoHighlight, let Base UI handle Enter\n // to select the natively highlighted item instead of exact matching.\n if (!multiple && autoHighlight) return;\n\n const matched = handleAddOnEnter(currentSearchValue);\n if (matched) {\n event.preventDefault();\n setSearchValue(\"\");\n onSearch?.(\"\");\n }\n }\n },\n [addOnEnter, autoHighlight, multiple, handleAddOnEnter, onSearch],\n );\n\n const mergedFilter = useMemo(() => {\n if (filterOption === false) {\n return null;\n }\n\n if (typeof filterOption === \"function\") {\n return (itemValue: T, query: string) => {\n const option = optionMap.get(itemValue);\n return filterOption(query, option);\n };\n }\n\n return (itemValue: T, query: string) => {\n if (!query) return true;\n const option = optionMap.get(itemValue);\n if (!option) return false;\n\n const tokens =\n tokenSeparators && tokenSeparators.length > 0\n ? splitBySeparators(query, tokenSeparators)\n : [query];\n\n const keywords = _getOptionKeywords(option).map((k) => k.toLowerCase());\n\n const matchingTokenCount = tokens.filter((token) => {\n const lowerToken = token.toLowerCase();\n return keywords.some((keyword) => keyword.includes(lowerToken));\n }).length;\n\n if (matchingTokenCount === 0) return false;\n if (tokens.length > 1 && matchingTokenCount > 1) {\n const lowerQuery = query.toLowerCase();\n return keywords.some((keyword) => keyword.includes(lowerQuery));\n }\n return true;\n };\n }, [filterOption, optionMap, tokenSeparators, _getOptionKeywords]);\n\n return (\n <div ref={ref} className={clsx(cls(\"combobox\"), className)} {...rest}>\n <BaseCombobox.Root<T, M>\n value={\n (multiple ? selectedValues : (selectedValues[0] ?? null)) as M extends true\n ? T[]\n : T | null\n }\n onValueChange={(newValue) => {\n if (multiple) {\n (handleValueChange as (v: T[]) => void)(\n Array.isArray(newValue) ? (newValue as T[]) : [],\n );\n } else {\n (handleValueChange as (v: T) => void)(newValue as T);\n }\n }}\n inputValue={searchValue}\n onInputValueChange={handleInputValueChange}\n open={open}\n onOpenChange={setOpen}\n multiple={multiple}\n disabled={disabled}\n autoHighlight={effectiveAutoHighlight}\n items={baseUIItems}\n itemToStringLabel={itemToStringLabel}\n filter={mergedFilter}\n >\n {/* Single Selection Layout using SelectTrigger compound components */}\n {!multiple ? (\n <SelectTrigger.Root\n ref={inputContainerRef}\n as=\"div\"\n size={size}\n disabled={disabled}\n open={open}\n status={mergedStatus}\n placeholder={placeholder}\n displayValue={displayValue}\n allowClear={allowClear}\n suffixIcon={suffixIcon}\n clearIcon={clearIcon}\n onClear={handleClear}\n onOpenChange={setOpen}\n className={clsx(classNames?.trigger, cls(\"combobox-trigger-single\"))}\n >\n <SelectTrigger.Content\n contentRender={({ className, children, ...rest }) => (\n <BaseCombobox.Input\n placeholder={placeholder}\n className={clsx(className, inputClassName)}\n disabled={disabled}\n onKeyDown={createInputKeyDownHandler(searchValue)}\n {...rest}\n />\n )}\n />\n <SelectTrigger.Clear\n render={(props) => <BaseCombobox.Clear {...props}></BaseCombobox.Clear>}\n />\n <SelectTrigger.Arrow\n render={(props, { icon }) => (\n <BaseCombobox.Trigger {...props}>\n <BaseCombobox.Icon>{icon}</BaseCombobox.Icon>\n </BaseCombobox.Trigger>\n )}\n />\n </SelectTrigger.Root>\n ) : (\n /* Multiple Selection Layout using SelectTrigger compound components */\n <SelectTrigger.Root\n ref={inputContainerRef}\n size={size}\n disabled={disabled}\n open={open}\n status={mergedStatus}\n placeholder={placeholder}\n displayValue={displayValue}\n allowClear={allowClear}\n suffixIcon={suffixIcon}\n clearIcon={clearIcon}\n onClear={handleClear}\n onOpenChange={setOpen}\n className={clsx(classNames?.trigger, cls(\"combobox-trigger-multiple\"))}\n as=\"div\"\n >\n <SelectTrigger.Content\n contentRender={({ className, children, ...rest }) => (\n <BaseCombobox.Chips className={clsx(cls(\"combobox-chips\"), className)} {...rest}>\n <BaseCombobox.Value>\n {(selectedItems) => (\n <>\n {selectedItems.map((item: T) => {\n const option = optionMap.get(item);\n return (\n <BaseCombobox.Chip key={item} className={clsx(cls(\"combobox-chip\"))}>\n {option?.icon && (\n <span className={clsx(cls(\"combobox-chip-icon\"))}>\n {option.icon}\n </span>\n )}\n <span className={clsx(cls(\"combobox-chip-text\"))}>\n {option\n ? optionLabelRender\n ? optionLabelRender(option)\n : option.label\n : item}\n </span>\n <BaseCombobox.ChipRemove\n className={clsx(cls(\"combobox-chip-remove\"))}\n >\n <XIcon />\n </BaseCombobox.ChipRemove>\n </BaseCombobox.Chip>\n );\n })}\n\n <BaseCombobox.Input\n placeholder={selectedItems.length > 0 ? \"\" : placeholder}\n className={inputClassName}\n disabled={disabled}\n onKeyDown={createInputKeyDownHandler(searchValue)}\n />\n </>\n )}\n </BaseCombobox.Value>\n </BaseCombobox.Chips>\n )}\n />\n <SelectTrigger.Clear\n render={(props) => <BaseCombobox.Clear {...props}></BaseCombobox.Clear>}\n />\n <SelectTrigger.Arrow\n render={(props, { icon }) => (\n <BaseCombobox.Trigger {...props}>\n <BaseCombobox.Icon>{icon}</BaseCombobox.Icon>\n </BaseCombobox.Trigger>\n )}\n />\n </SelectTrigger.Root>\n )}\n\n <BaseCombobox.Portal>\n <BaseCombobox.Positioner\n anchor={inputContainerRef.current}\n sideOffset={4}\n side={placement.startsWith(\"top\") ? \"top\" : \"bottom\"}\n align={\n placement.endsWith(\"Right\")\n ? \"end\"\n : placement === \"top\" || placement === \"bottom\"\n ? \"center\"\n : \"start\"\n }\n render={positionerRender}\n >\n <BaseCombobox.Popup\n className={clsx(\n cls(\"combobox-popup\"),\n !popupMatchSelectWidth && cls(\"combobox-popup--auto-width\"),\n classNames?.portal,\n )}\n render={popupRender}\n >\n <div className={clsx(cls(\"combobox-container\"))}>\n {/* Select All Option */}\n {selectAllOption && (\n <>\n <BaseMenuItem\n as=\"button\"\n type=\"button\"\n className={clsx(cls(\"combobox-select-all\"))}\n selected={selectAllOption.checked}\n onClick={selectAllOption.onToggle}\n indeterminate={selectAllOption.indeterminate}\n showCheckbox\n >\n Select All\n </BaseMenuItem>\n <BaseCombobox.Separator render={separatorRender} />\n </>\n )}\n <ScrollArea fadeEdges>\n <BaseCombobox.List\n className={clsx(cls(\"combobox-list\"), classNames?.list)}\n render={listRender}\n >\n {(item: T) => {\n const option = optionMap.get(item);\n if (!option) return null;\n const isSelected = (selectedValues as T[]).includes(item);\n return optionRender ? (\n optionRender(option, {})\n ) : (\n <BaseMenuItem\n key={option.value}\n disabled={option.disabled}\n selected={isSelected}\n showCheckbox={multiple}\n icon={option.icon}\n classNames={{\n root: clsx(classNames?.option),\n icon: classNames?.optionIcon,\n text: classNames?.optionText,\n }}\n labelRender={\n optionLabelRender\n ? (props: React.HTMLAttributes<HTMLElement>) =>\n optionLabelRender(option, props)\n : undefined\n }\n render={(props: React.HTMLAttributes<HTMLElement>) => (\n <BaseCombobox.Item\n value={item as T}\n disabled={option.disabled}\n {...props}\n data-disabled={option.disabled}\n data-selected={isSelected}\n />\n )}\n >\n {option.label}\n </BaseMenuItem>\n );\n }}\n </BaseCombobox.List>\n\n <BaseCombobox.Empty className={clsx(cls(\"combobox-empty\"))}>\n <Empty description=\"No options found\" />\n </BaseCombobox.Empty>\n </ScrollArea>\n </div>\n </BaseCombobox.Popup>\n </BaseCombobox.Positioner>\n </BaseCombobox.Portal>\n </BaseCombobox.Root>\n </div>\n );\n};\n\nconst MainCombobox = forwardRef(ComboboxInner) as <\n T extends React.Key,\n M extends boolean,\n O extends Record<string, unknown> = {},\n>(\n props: ComboboxProps<T, M, O> & { ref?: ForwardedRef<HTMLDivElement> },\n) => ReturnType<typeof ComboboxInner>;\n\nexport const Combobox = Object.assign(MainCombobox, {\n // Add any sub components here if needed\n});\n\nexport default Combobox;\n"],"names":["positionerRender","props","jsx","BaseMenu","popupRender","separatorRender","listRender","ComboboxInner","options","controlledValue","defaultValue","onChange","placeholder","disabledProp","statusProp","allowClear","multiple","_showSearch","controlledOpen","onOpenChange","className","classNames","size","optionRender","onSearch","clearIcon","suffixIcon","placement","showSelectAll","optionLabelRender","_getOptionKeywords","option","reactNodeToString","popupMatchSelectWidth","addOnEnter","tokenSeparators","autoHighlight","filterOption","rest","ref","value","setValue","useControlledState","open","setOpen","cls","useCls","inputContainerRef","useRef","contextStatus","useContext","FormItemInputContext","contextDisabled","DisabledContext","mergedStatus","disabled","handleValueChange","useCallback","newValue","handleSelectAll","allValues","handleDeselectAll","handleClear","selectedValues","useMemo","optionMap","map","opt","selectAllOption","selectedFromFiltered","val","checked","indeterminate","baseUIItems","displayValue","inputClassName","clsx","itemToStringLabel","itemValue","searchValue","setSearchValue","useState","handleAddOnEnter","handleInputValueChange","useComboboxTokenInput","hasTokenSeparators","effectiveAutoHighlight","hasTokenSeparator","createInputKeyDownHandler","currentSearchValue","event","mergedFilter","query","tokens","splitBySeparators","keywords","k","matchingTokenCount","token","lowerToken","keyword","lowerQuery","jsxs","BaseCombobox","SelectTrigger","children","selectedItems","Fragment","item","XIcon","icon","BaseMenuItem","ScrollArea","isSelected","Empty","MainCombobox","forwardRef","Combobox"],"mappings":";;;;;;;;;;;;;;;;;;;AA8BA,MAAMA,KAAmB,CAACC,MAAuC,gBAAAC,EAACC,EAAS,MAAT,EAAe,GAAGF,GAAO,GACrFG,KAAc,CAACH,MAAuC,gBAAAC,EAACC,EAAS,OAAT,EAAgB,GAAGF,GAAO,GACj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