@yamada-ui/autocomplete 1.6.0-dev-20241011151311 → 1.6.0-dev-20241011162311

Sign up to get free protection for your applications and to get access to all the features.
Files changed (76) hide show
  1. package/dist/autocomplete-context.d.mts +2 -4
  2. package/dist/autocomplete-context.d.ts +2 -4
  3. package/dist/autocomplete-context.js.map +1 -1
  4. package/dist/autocomplete-context.mjs +1 -1
  5. package/dist/autocomplete-create.js.map +1 -1
  6. package/dist/autocomplete-create.mjs +4 -4
  7. package/dist/autocomplete-empty.js.map +1 -1
  8. package/dist/autocomplete-empty.mjs +4 -4
  9. package/dist/autocomplete-icon.js.map +1 -1
  10. package/dist/autocomplete-icon.mjs +2 -2
  11. package/dist/autocomplete-list.js.map +1 -1
  12. package/dist/autocomplete-list.mjs +3 -3
  13. package/dist/autocomplete-option-group.js.map +1 -1
  14. package/dist/autocomplete-option-group.mjs +3 -3
  15. package/dist/autocomplete-option.js +11 -14
  16. package/dist/autocomplete-option.js.map +1 -1
  17. package/dist/autocomplete-option.mjs +4 -4
  18. package/dist/autocomplete.d.mts +0 -1
  19. package/dist/autocomplete.d.ts +0 -1
  20. package/dist/autocomplete.js +51 -88
  21. package/dist/autocomplete.js.map +1 -1
  22. package/dist/autocomplete.mjs +12 -12
  23. package/dist/{chunk-WERCEZNJ.mjs → chunk-352YZTOO.mjs} +39 -62
  24. package/dist/chunk-352YZTOO.mjs.map +1 -0
  25. package/dist/{chunk-V6YCG642.mjs → chunk-6OTUOEYS.mjs} +2 -2
  26. package/dist/{chunk-67X7JKWL.mjs → chunk-7QON6ZHO.mjs} +2 -2
  27. package/dist/{chunk-7LZUXESV.mjs → chunk-HUY7Q3WA.mjs} +14 -25
  28. package/dist/chunk-HUY7Q3WA.mjs.map +1 -0
  29. package/dist/{chunk-K5HCHHCJ.mjs → chunk-J6UKIKNL.mjs} +4 -4
  30. package/dist/{chunk-AIBJWPRA.mjs → chunk-KWIJUSLC.mjs} +4 -4
  31. package/dist/{chunk-Q33EMTO2.mjs → chunk-OY5JVCQQ.mjs} +14 -24
  32. package/dist/chunk-OY5JVCQQ.mjs.map +1 -0
  33. package/dist/{chunk-2HJUFFCU.mjs → chunk-PKRO525W.mjs} +4 -4
  34. package/dist/{chunk-VTBUO5SK.mjs → chunk-WJ4P4B2E.mjs} +3 -3
  35. package/dist/{chunk-4SBNPEK7.mjs → chunk-WNN655FX.mjs} +3 -3
  36. package/dist/{chunk-TR4X4EEG.mjs → chunk-X2PFHBZY.mjs} +2 -2
  37. package/dist/{chunk-WDQYM4FP.mjs → chunk-ZNO5RUVT.mjs} +1 -1
  38. package/dist/chunk-ZNO5RUVT.mjs.map +1 -0
  39. package/dist/{chunk-6OLHNK7O.mjs → chunk-ZXALWDKQ.mjs} +14 -18
  40. package/dist/chunk-ZXALWDKQ.mjs.map +1 -0
  41. package/dist/index.d.mts +0 -1
  42. package/dist/index.d.ts +0 -1
  43. package/dist/index.js +57 -105
  44. package/dist/index.js.map +1 -1
  45. package/dist/index.mjs +13 -13
  46. package/dist/multi-autocomplete.d.mts +0 -1
  47. package/dist/multi-autocomplete.d.ts +0 -1
  48. package/dist/multi-autocomplete.js +51 -89
  49. package/dist/multi-autocomplete.js.map +1 -1
  50. package/dist/multi-autocomplete.mjs +12 -12
  51. package/dist/use-autocomplete-list.js.map +1 -1
  52. package/dist/use-autocomplete-list.mjs +2 -2
  53. package/dist/use-autocomplete-option-group.js.map +1 -1
  54. package/dist/use-autocomplete-option-group.mjs +2 -2
  55. package/dist/use-autocomplete-option.js +11 -14
  56. package/dist/use-autocomplete-option.js.map +1 -1
  57. package/dist/use-autocomplete-option.mjs +2 -2
  58. package/dist/use-autocomplete.d.mts +11 -16
  59. package/dist/use-autocomplete.d.ts +11 -16
  60. package/dist/use-autocomplete.js +45 -72
  61. package/dist/use-autocomplete.js.map +1 -1
  62. package/dist/use-autocomplete.mjs +7 -7
  63. package/package.json +13 -13
  64. package/dist/chunk-6OLHNK7O.mjs.map +0 -1
  65. package/dist/chunk-7LZUXESV.mjs.map +0 -1
  66. package/dist/chunk-Q33EMTO2.mjs.map +0 -1
  67. package/dist/chunk-WDQYM4FP.mjs.map +0 -1
  68. package/dist/chunk-WERCEZNJ.mjs.map +0 -1
  69. /package/dist/{chunk-V6YCG642.mjs.map → chunk-6OTUOEYS.mjs.map} +0 -0
  70. /package/dist/{chunk-67X7JKWL.mjs.map → chunk-7QON6ZHO.mjs.map} +0 -0
  71. /package/dist/{chunk-K5HCHHCJ.mjs.map → chunk-J6UKIKNL.mjs.map} +0 -0
  72. /package/dist/{chunk-AIBJWPRA.mjs.map → chunk-KWIJUSLC.mjs.map} +0 -0
  73. /package/dist/{chunk-2HJUFFCU.mjs.map → chunk-PKRO525W.mjs.map} +0 -0
  74. /package/dist/{chunk-VTBUO5SK.mjs.map → chunk-WJ4P4B2E.mjs.map} +0 -0
  75. /package/dist/{chunk-4SBNPEK7.mjs.map → chunk-WNN655FX.mjs.map} +0 -0
  76. /package/dist/{chunk-TR4X4EEG.mjs.map → chunk-X2PFHBZY.mjs.map} +0 -0
package/dist/index.mjs CHANGED
@@ -1,29 +1,29 @@
1
1
  "use client"
2
2
  import {
3
3
  MultiAutocomplete
4
- } from "./chunk-7LZUXESV.mjs";
4
+ } from "./chunk-HUY7Q3WA.mjs";
5
5
  import {
6
6
  Autocomplete
7
- } from "./chunk-Q33EMTO2.mjs";
8
- import "./chunk-WERCEZNJ.mjs";
7
+ } from "./chunk-OY5JVCQQ.mjs";
8
+ import "./chunk-352YZTOO.mjs";
9
9
  import {
10
10
  AutocompleteCreate
11
- } from "./chunk-K5HCHHCJ.mjs";
11
+ } from "./chunk-J6UKIKNL.mjs";
12
12
  import {
13
13
  AutocompleteEmpty
14
- } from "./chunk-2HJUFFCU.mjs";
15
- import "./chunk-VTBUO5SK.mjs";
16
- import "./chunk-TR4X4EEG.mjs";
14
+ } from "./chunk-PKRO525W.mjs";
15
+ import "./chunk-WJ4P4B2E.mjs";
16
+ import "./chunk-X2PFHBZY.mjs";
17
17
  import {
18
18
  AutocompleteOptionGroup
19
- } from "./chunk-4SBNPEK7.mjs";
20
- import "./chunk-67X7JKWL.mjs";
19
+ } from "./chunk-WNN655FX.mjs";
20
+ import "./chunk-7QON6ZHO.mjs";
21
21
  import {
22
22
  AutocompleteOption
23
- } from "./chunk-AIBJWPRA.mjs";
24
- import "./chunk-6OLHNK7O.mjs";
25
- import "./chunk-V6YCG642.mjs";
26
- import "./chunk-WDQYM4FP.mjs";
23
+ } from "./chunk-KWIJUSLC.mjs";
24
+ import "./chunk-ZXALWDKQ.mjs";
25
+ import "./chunk-6OTUOEYS.mjs";
26
+ import "./chunk-ZNO5RUVT.mjs";
27
27
  export {
28
28
  Autocomplete,
29
29
  AutocompleteCreate,
@@ -9,7 +9,6 @@ import { AutocompleteIconProps } from './autocomplete-icon.mjs';
9
9
  import { AutocompleteListProps } from './autocomplete-list.mjs';
10
10
  import { UseAutocompleteProps } from './use-autocomplete.mjs';
11
11
  import '@yamada-ui/use-descendant';
12
- import 'react/jsx-runtime';
13
12
  import '@yamada-ui/form-control';
14
13
  import '@yamada-ui/popover';
15
14
  import '@yamada-ui/utils';
@@ -9,7 +9,6 @@ import { AutocompleteIconProps } from './autocomplete-icon.js';
9
9
  import { AutocompleteListProps } from './autocomplete-list.js';
10
10
  import { UseAutocompleteProps } from './use-autocomplete.js';
11
11
  import '@yamada-ui/use-descendant';
12
- import 'react/jsx-runtime';
13
12
  import '@yamada-ui/form-control';
14
13
  import '@yamada-ui/popover';
15
14
  import '@yamada-ui/utils';
@@ -155,7 +155,7 @@ var isTargetOption = (target) => {
155
155
  var useAutocompleteOption = (props) => {
156
156
  var _a, _b;
157
157
  const {
158
- closeOnSelect: generalCloseOnSelect,
158
+ closeOnSelect,
159
159
  focusedIndex,
160
160
  inputRef,
161
161
  omitSelectedValues,
@@ -163,7 +163,6 @@ var useAutocompleteOption = (props) => {
163
163
  value,
164
164
  optionProps,
165
165
  onChange,
166
- onChangeLabel,
167
166
  onClose,
168
167
  onFocusNext
169
168
  } = useAutocompleteContext();
@@ -194,28 +193,27 @@ var useAutocompleteOption = (props) => {
194
193
  );
195
194
  }
196
195
  }
197
- const isDuplicated = !isMulti ? frontValues.some(({ node }) => node.dataset.value === (optionValue != null ? optionValue : "")) : false;
196
+ const isDuplicated = frontValues.some(
197
+ ({ node }) => node.dataset.value === (optionValue != null ? optionValue : "")
198
+ );
198
199
  const isSelected = !isDuplicated && (!isMulti ? (optionValue != null ? optionValue : "") === value : value.includes(optionValue != null ? optionValue : ""));
199
200
  const isTarget = "target" in ((_b = (_a = itemRef.current) == null ? void 0 : _a.dataset) != null ? _b : {});
200
201
  const isFocused = index === focusedIndex;
201
202
  const onClick = (0, import_react2.useCallback)(
202
203
  (ev) => {
203
204
  ev.stopPropagation();
204
- if (isDisabled) {
205
- if (inputRef.current) inputRef.current.focus();
206
- return;
207
- }
208
- if (!isTargetOption(ev.currentTarget)) {
205
+ if (isDisabled || !isTargetOption(ev.currentTarget)) {
209
206
  if (inputRef.current) inputRef.current.focus();
210
207
  return;
211
208
  }
212
- setFocusedIndex(index);
209
+ if (!isDuplicated) setFocusedIndex(index);
213
210
  onChange(optionValue != null ? optionValue : "");
214
211
  if (inputRef.current) inputRef.current.focus();
215
- if (customCloseOnSelect != null ? customCloseOnSelect : generalCloseOnSelect) onClose();
212
+ if (customCloseOnSelect != null ? customCloseOnSelect : closeOnSelect) onClose();
216
213
  if (omitSelectedValues) onFocusNext(index);
217
214
  },
218
215
  [
216
+ isDuplicated,
219
217
  onFocusNext,
220
218
  omitSelectedValues,
221
219
  isDisabled,
@@ -224,14 +222,11 @@ var useAutocompleteOption = (props) => {
224
222
  index,
225
223
  onChange,
226
224
  customCloseOnSelect,
227
- generalCloseOnSelect,
225
+ closeOnSelect,
228
226
  onClose,
229
227
  inputRef
230
228
  ]
231
229
  );
232
- (0, import_utils3.useUpdateEffect)(() => {
233
- if (isSelected) onChangeLabel(optionValue != null ? optionValue : "", { runOmit: false });
234
- }, [optionValue]);
235
230
  const getOptionProps = (0, import_react2.useCallback)(
236
231
  (props2 = {}, ref = null) => {
237
232
  const style = {
@@ -255,6 +250,7 @@ var useAutocompleteOption = (props) => {
255
250
  "aria-checked": isSelected,
256
251
  "aria-disabled": (0, import_utils3.ariaAttr)(isDisabled),
257
252
  "data-disabled": (0, import_utils3.dataAttr)(isDisabled),
253
+ "data-duplicated": (0, import_utils3.dataAttr)(isDuplicated),
258
254
  "data-focus": (0, import_utils3.dataAttr)(isFocused),
259
255
  "data-target": (0, import_utils3.dataAttr)(true),
260
256
  "data-value": optionValue != null ? optionValue : "",
@@ -264,6 +260,7 @@ var useAutocompleteOption = (props) => {
264
260
  },
265
261
  [
266
262
  id,
263
+ isDuplicated,
267
264
  optionValue,
268
265
  computedProps,
269
266
  isDisabled,
@@ -983,15 +980,23 @@ var useAutocomplete = (props) => {
983
980
  );
984
981
  const validChildren = (0, import_utils11.getValidChildren)(children);
985
982
  const computedChildren = (0, import_react5.useMemo)(
986
- () => resolvedItems == null ? void 0 : resolvedItems.map((item, i) => {
983
+ () => resolvedItems == null ? void 0 : resolvedItems.map((item, index) => {
987
984
  if ("value" in item) {
988
985
  const { label: label2, value: value2, ...props2 } = item;
989
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(AutocompleteOption, { value: value2, ...props2, children: label2 }, i);
986
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(AutocompleteOption, { value: value2, ...props2, children: label2 }, index);
990
987
  } else if ("items" in item) {
991
988
  const { items: items2 = [], label: label2, ...props2 } = item;
992
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(AutocompleteOptionGroup, { label: label2, ...props2, children: items2.map(({ label: label3, value: value2, ...props3 }, i2) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(AutocompleteOption, { value: value2, ...props3, children: label3 }, i2)) }, i);
989
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
990
+ AutocompleteOptionGroup,
991
+ {
992
+ label: label2,
993
+ ...props2,
994
+ children: items2.map(({ label: label3, value: value2, ...props3 }, index2) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(AutocompleteOption, { value: value2, ...props3, children: label3 }, index2))
995
+ },
996
+ index
997
+ );
993
998
  }
994
- }),
999
+ }).filter(Boolean),
995
1000
  [resolvedItems]
996
1001
  );
997
1002
  const isEmpty = !validChildren.length && !(computedChildren == null ? void 0 : computedChildren.length);
@@ -1170,50 +1175,29 @@ var useAutocomplete = (props) => {
1170
1175
  },
1171
1176
  [descendants, onFocusFirst]
1172
1177
  );
1173
- const getSelectedValues = (0, import_react5.useCallback)(
1174
- (newValues) => {
1175
- const enabledValues2 = descendants.enabledValues();
1176
- const resolvedValues = (0, import_utils11.isArray)(newValues) ? newValues : [newValues];
1177
- const selectedValues2 = resolvedValues.map((value2) => {
1178
+ const onChangeLabel = (0, import_react5.useCallback)(
1179
+ (newValue) => {
1180
+ const values = descendants.values();
1181
+ if (!values.length) return;
1182
+ const resolvedValues = (0, import_utils11.isArray)(newValue) ? newValue : [newValue];
1183
+ const selectedLabel = resolvedValues.map((value2) => {
1178
1184
  var _a, _b;
1179
- const { node } = (_a = enabledValues2.find(({ node: node2 }) => node2.dataset.value === value2)) != null ? _a : {};
1185
+ const { node } = (_a = values.find(({ node: node2 }) => node2.dataset.value === value2)) != null ? _a : {};
1180
1186
  if (node) {
1181
- const el = Array.from(node.children).find(
1187
+ const { textContent } = (_b = Array.from(node.children).find(
1182
1188
  (child) => child.getAttribute("data-label") !== null
1183
- );
1184
- return (_b = el == null ? void 0 : el.textContent) != null ? _b : void 0;
1189
+ )) != null ? _b : {};
1190
+ return textContent;
1185
1191
  } else {
1186
1192
  return allowFree ? value2 : void 0;
1187
1193
  }
1188
- }).filter(Boolean);
1189
- return selectedValues2;
1190
- },
1191
- [allowFree, descendants]
1192
- );
1193
- const onChangeLabel = (0, import_react5.useCallback)(
1194
- (newValue, { forceUpdate, runOmit = true } = {}) => {
1195
- const selectedValues2 = getSelectedValues(newValue);
1196
- if (!forceUpdate && !selectedValues2.length) return;
1197
- setLabel((prev) => {
1198
- if (!isMulti) {
1199
- return selectedValues2[0];
1200
- } else {
1201
- selectedValues2.forEach((selectedValue) => {
1202
- const isSelected = (0, import_utils11.isArray)(prev) && prev.includes(selectedValue);
1203
- if (!isSelected) {
1204
- prev = [...(0, import_utils11.isArray)(prev) ? prev : [], selectedValue];
1205
- } else if (runOmit) {
1206
- prev = (0, import_utils11.isArray)(prev) ? prev.filter((value2) => value2 !== selectedValue) : void 0;
1207
- }
1208
- });
1209
- return prev;
1210
- }
1211
- });
1194
+ }).filter((label2) => !(0, import_utils11.isUndefined)(label2));
1195
+ setLabel(!isMulti ? selectedLabel[0] : selectedLabel);
1212
1196
  },
1213
- [getSelectedValues, isMulti]
1197
+ [allowFree, descendants, isMulti]
1214
1198
  );
1215
1199
  const onChange = (0, import_react5.useCallback)(
1216
- (newValue, { forceUpdate, runRebirth = true } = {}) => {
1200
+ (newValue, runRebirth = true) => {
1217
1201
  setValue((prev) => {
1218
1202
  let next;
1219
1203
  if (!(0, import_utils11.isArray)(prev)) {
@@ -1235,14 +1219,13 @@ var useAutocomplete = (props) => {
1235
1219
  return format((_a = node.textContent) != null ? _a : "").includes(newValue);
1236
1220
  }
1237
1221
  ).length > 0;
1238
- onChangeLabel(newValue, { forceUpdate });
1239
- if (allowFree || isHit2) setInputValue("");
1222
+ if (allowCreate || allowFree || isHit2) setInputValue("");
1240
1223
  if (isMulti && runRebirth) rebirthOptions(false);
1241
1224
  },
1242
1225
  [
1243
1226
  allowFree,
1227
+ allowCreate,
1244
1228
  isMulti,
1245
- onChangeLabel,
1246
1229
  rebirthOptions,
1247
1230
  setValue,
1248
1231
  descendants,
@@ -1353,7 +1336,7 @@ var useAutocomplete = (props) => {
1353
1336
  const relatedTarget = (0, import_utils11.getEventRelatedTarget)(ev);
1354
1337
  if ((0, import_utils11.isContains)(containerRef.current, relatedTarget)) return;
1355
1338
  if (!closeOnBlur && isHit) return;
1356
- if (allowFree && !!inputValue) onChange(inputValue, { runRebirth: false });
1339
+ if (allowFree && !!inputValue) onChange(inputValue, false);
1357
1340
  setInputValue("");
1358
1341
  if (isOpen) onClose();
1359
1342
  },
@@ -1361,7 +1344,7 @@ var useAutocomplete = (props) => {
1361
1344
  );
1362
1345
  const onDelete = (0, import_react5.useCallback)(() => {
1363
1346
  if (!isMulti) {
1364
- onChange("", { forceUpdate: true });
1347
+ onChange("");
1365
1348
  } else {
1366
1349
  onChange(value[value.length - 1]);
1367
1350
  }
@@ -1448,18 +1431,9 @@ var useAutocomplete = (props) => {
1448
1431
  onClose,
1449
1432
  maxSelectValues
1450
1433
  ]);
1451
- (0, import_react5.useEffect)(() => {
1452
- var _a;
1453
- if (isMulti) {
1454
- if (JSON.stringify((_a = prevValue.current) != null ? _a : []) === JSON.stringify(value))
1455
- return;
1456
- const label2 = getSelectedValues(value);
1457
- setLabel(label2);
1458
- } else {
1459
- if (prevValue.current === value) return;
1460
- onChangeLabel(value, { runOmit: false });
1461
- }
1462
- }, [isMulti, value, onChangeLabel, getSelectedValues]);
1434
+ (0, import_utils11.useSafeLayoutEffect)(() => {
1435
+ onChangeLabel(value);
1436
+ }, [value]);
1463
1437
  (0, import_utils11.useUpdateEffect)(() => {
1464
1438
  if (isOpen || allowFree) return;
1465
1439
  setFocusedIndex(-1);
@@ -1566,8 +1540,8 @@ var useAutocomplete = (props) => {
1566
1540
  id,
1567
1541
  allowCreate,
1568
1542
  allowFree,
1543
+ children: children != null ? children : computedChildren,
1569
1544
  closeOnSelect,
1570
- computedChildren,
1571
1545
  descendants,
1572
1546
  emptyMessage,
1573
1547
  focusedIndex,
@@ -1591,7 +1565,6 @@ var useAutocomplete = (props) => {
1591
1565
  inputProps,
1592
1566
  optionProps,
1593
1567
  onChange,
1594
- onChangeLabel,
1595
1568
  onClear,
1596
1569
  onClose,
1597
1570
  onCompositionEnd,
@@ -1688,7 +1661,6 @@ var MultiAutocomplete = (0, import_core9.forwardRef)(
1688
1661
  );
1689
1662
  let {
1690
1663
  className,
1691
- children,
1692
1664
  closeOnSelect = false,
1693
1665
  color,
1694
1666
  component,
@@ -1716,7 +1688,7 @@ var MultiAutocomplete = (0, import_core9.forwardRef)(
1716
1688
  } = (0, import_core9.omitThemeProps)(mergedProps);
1717
1689
  const {
1718
1690
  allowCreate,
1719
- computedChildren,
1691
+ children,
1720
1692
  descendants,
1721
1693
  inputValue,
1722
1694
  isEmpty,
@@ -1730,7 +1702,6 @@ var MultiAutocomplete = (0, import_core9.forwardRef)(
1730
1702
  ...rest
1731
1703
  } = useAutocomplete({
1732
1704
  ...computedProps,
1733
- children,
1734
1705
  closeOnSelect,
1735
1706
  defaultValue
1736
1707
  });
@@ -1791,26 +1762,17 @@ var MultiAutocomplete = (0, import_core9.forwardRef)(
1791
1762
  ]
1792
1763
  }
1793
1764
  ),
1794
- !isEmpty ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_portal.Portal, { ...portalProps, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
1765
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_portal.Portal, { ...portalProps, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1795
1766
  AutocompleteList,
1796
1767
  {
1797
1768
  footer: (0, import_utils12.runIfFunc)(footer, { value, onClose }),
1798
1769
  header: (0, import_utils12.runIfFunc)(header, { value, onClose }),
1799
1770
  contentProps,
1800
1771
  ...listProps,
1801
- children: [
1772
+ children: !isEmpty ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
1802
1773
  allowCreate ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(AutocompleteCreate, { ...createProps }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(AutocompleteEmpty, { ...emptyProps }),
1803
- children != null ? children : computedChildren
1804
- ]
1805
- }
1806
- ) }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_portal.Portal, { ...portalProps, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1807
- AutocompleteList,
1808
- {
1809
- footer: (0, import_utils12.runIfFunc)(footer, { value, onClose }),
1810
- header: (0, import_utils12.runIfFunc)(header, { value, onClose }),
1811
- contentProps,
1812
- ...listProps,
1813
- children: allowCreate && inputValue ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(AutocompleteCreate, { ...createProps }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(AutocompleteEmpty, { ...emptyProps })
1774
+ children
1775
+ ] }) : allowCreate && inputValue ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(AutocompleteCreate, { ...createProps }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(AutocompleteEmpty, { ...emptyProps })
1814
1776
  }
1815
1777
  ) })
1816
1778
  ]
@@ -1880,11 +1842,11 @@ var MultiAutocompleteField = (0, import_core9.forwardRef)(
1880
1842
  ...styles.field,
1881
1843
  cursor: "text"
1882
1844
  };
1845
+ if ((label == null ? void 0 : label.length) && component) css.py = "0.125rem";
1883
1846
  return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_popover2.PopoverTrigger, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
1884
1847
  import_core9.ui.div,
1885
1848
  {
1886
1849
  className: (0, import_utils12.cx)("ui-multi-autocomplete__field", className),
1887
- py: (label == null ? void 0 : label.length) && component ? "0.125rem" : void 0,
1888
1850
  __css: css,
1889
1851
  ...rest,
1890
1852
  children: [