@yamada-ui/autocomplete 1.5.4-next-20241005220055 → 1.5.4-next-20241008193728

Sign up to get free protection for your applications and to get access to all the features.
Files changed (100) hide show
  1. package/dist/autocomplete-context.d.mts +115 -115
  2. package/dist/autocomplete-context.d.ts +115 -115
  3. package/dist/autocomplete-context.js +2 -2
  4. package/dist/autocomplete-context.js.map +1 -1
  5. package/dist/autocomplete-context.mjs +1 -1
  6. package/dist/autocomplete-create.d.mts +4 -4
  7. package/dist/autocomplete-create.d.ts +4 -4
  8. package/dist/autocomplete-create.js +32 -32
  9. package/dist/autocomplete-create.js.map +1 -1
  10. package/dist/autocomplete-create.mjs +4 -4
  11. package/dist/autocomplete-empty.d.mts +4 -4
  12. package/dist/autocomplete-empty.d.ts +4 -4
  13. package/dist/autocomplete-empty.js +34 -34
  14. package/dist/autocomplete-empty.js.map +1 -1
  15. package/dist/autocomplete-empty.mjs +4 -4
  16. package/dist/autocomplete-icon.js +17 -17
  17. package/dist/autocomplete-icon.js.map +1 -1
  18. package/dist/autocomplete-icon.mjs +2 -2
  19. package/dist/autocomplete-list.d.mts +2 -2
  20. package/dist/autocomplete-list.d.ts +2 -2
  21. package/dist/autocomplete-list.js +18 -18
  22. package/dist/autocomplete-list.js.map +1 -1
  23. package/dist/autocomplete-list.mjs +3 -3
  24. package/dist/autocomplete-option-group.js +10 -10
  25. package/dist/autocomplete-option-group.js.map +1 -1
  26. package/dist/autocomplete-option-group.mjs +3 -3
  27. package/dist/autocomplete-option.d.mts +1 -1
  28. package/dist/autocomplete-option.d.ts +1 -1
  29. package/dist/autocomplete-option.js +47 -47
  30. package/dist/autocomplete-option.js.map +1 -1
  31. package/dist/autocomplete-option.mjs +4 -4
  32. package/dist/autocomplete.d.mts +31 -31
  33. package/dist/autocomplete.d.ts +31 -31
  34. package/dist/autocomplete.js +294 -292
  35. package/dist/autocomplete.js.map +1 -1
  36. package/dist/autocomplete.mjs +12 -12
  37. package/dist/{chunk-6F3LT7J6.mjs → chunk-4SBNPEK7.mjs} +7 -7
  38. package/dist/{chunk-6F3LT7J6.mjs.map → chunk-4SBNPEK7.mjs.map} +1 -1
  39. package/dist/{chunk-JMX72TSD.mjs → chunk-67X7JKWL.mjs} +7 -7
  40. package/dist/{chunk-JMX72TSD.mjs.map → chunk-67X7JKWL.mjs.map} +1 -1
  41. package/dist/{chunk-HZECQUHV.mjs → chunk-AXC7ILCH.mjs} +40 -40
  42. package/dist/{chunk-HZECQUHV.mjs.map → chunk-AXC7ILCH.mjs.map} +1 -1
  43. package/dist/{chunk-OLOU5HFC.mjs → chunk-BGZIX6SN.mjs} +168 -166
  44. package/dist/chunk-BGZIX6SN.mjs.map +1 -0
  45. package/dist/{chunk-Q2HZVVOI.mjs → chunk-BKW7XJ6R.mjs} +16 -16
  46. package/dist/chunk-BKW7XJ6R.mjs.map +1 -0
  47. package/dist/{chunk-5LPWFWE6.mjs → chunk-DDMSYTKO.mjs} +34 -34
  48. package/dist/chunk-DDMSYTKO.mjs.map +1 -0
  49. package/dist/{chunk-QPIWG4ZF.mjs → chunk-EEECVCVW.mjs} +63 -61
  50. package/dist/chunk-EEECVCVW.mjs.map +1 -0
  51. package/dist/{chunk-5GKGL6BL.mjs → chunk-KLXMUIGY.mjs} +16 -16
  52. package/dist/chunk-KLXMUIGY.mjs.map +1 -0
  53. package/dist/{chunk-R76HPAN4.mjs → chunk-TR4X4EEG.mjs} +7 -7
  54. package/dist/{chunk-R76HPAN4.mjs.map → chunk-TR4X4EEG.mjs.map} +1 -1
  55. package/dist/{chunk-7SWSKLSA.mjs → chunk-V6YCG642.mjs} +18 -18
  56. package/dist/chunk-V6YCG642.mjs.map +1 -0
  57. package/dist/{chunk-S53LMDD7.mjs → chunk-VTBUO5SK.mjs} +15 -15
  58. package/dist/chunk-VTBUO5SK.mjs.map +1 -0
  59. package/dist/{chunk-JPUKYLBW.mjs → chunk-WDQYM4FP.mjs} +5 -5
  60. package/dist/chunk-WDQYM4FP.mjs.map +1 -0
  61. package/dist/{chunk-S2HFYJVI.mjs → chunk-WFLZPB35.mjs} +13 -13
  62. package/dist/chunk-WFLZPB35.mjs.map +1 -0
  63. package/dist/index.d.mts +4 -4
  64. package/dist/index.d.ts +4 -4
  65. package/dist/index.js +347 -343
  66. package/dist/index.js.map +1 -1
  67. package/dist/index.mjs +13 -13
  68. package/dist/multi-autocomplete.d.mts +51 -51
  69. package/dist/multi-autocomplete.d.ts +51 -51
  70. package/dist/multi-autocomplete.js +317 -313
  71. package/dist/multi-autocomplete.js.map +1 -1
  72. package/dist/multi-autocomplete.mjs +12 -12
  73. package/dist/use-autocomplete-list.d.mts +1 -1
  74. package/dist/use-autocomplete-list.d.ts +1 -1
  75. package/dist/use-autocomplete-list.js +7 -7
  76. package/dist/use-autocomplete-list.js.map +1 -1
  77. package/dist/use-autocomplete-list.mjs +2 -2
  78. package/dist/use-autocomplete-option-group.js +7 -7
  79. package/dist/use-autocomplete-option-group.js.map +1 -1
  80. package/dist/use-autocomplete-option-group.mjs +2 -2
  81. package/dist/use-autocomplete-option.d.mts +12 -12
  82. package/dist/use-autocomplete-option.d.ts +12 -12
  83. package/dist/use-autocomplete-option.js +34 -34
  84. package/dist/use-autocomplete-option.js.map +1 -1
  85. package/dist/use-autocomplete-option.mjs +2 -2
  86. package/dist/use-autocomplete.d.mts +86 -86
  87. package/dist/use-autocomplete.d.ts +86 -86
  88. package/dist/use-autocomplete.js +216 -214
  89. package/dist/use-autocomplete.js.map +1 -1
  90. package/dist/use-autocomplete.mjs +7 -7
  91. package/package.json +13 -13
  92. package/dist/chunk-5GKGL6BL.mjs.map +0 -1
  93. package/dist/chunk-5LPWFWE6.mjs.map +0 -1
  94. package/dist/chunk-7SWSKLSA.mjs.map +0 -1
  95. package/dist/chunk-JPUKYLBW.mjs.map +0 -1
  96. package/dist/chunk-OLOU5HFC.mjs.map +0 -1
  97. package/dist/chunk-Q2HZVVOI.mjs.map +0 -1
  98. package/dist/chunk-QPIWG4ZF.mjs.map +0 -1
  99. package/dist/chunk-S2HFYJVI.mjs.map +0 -1
  100. package/dist/chunk-S53LMDD7.mjs.map +0 -1
@@ -38,9 +38,9 @@ var import_use_descendant = require("@yamada-ui/use-descendant");
38
38
  var import_utils = require("@yamada-ui/utils");
39
39
  var {
40
40
  DescendantsContextProvider: AutocompleteDescendantsContextProvider,
41
- useDescendantsContext: useAutocompleteDescendantsContext,
41
+ useDescendant: useAutocompleteDescendant,
42
42
  useDescendants: useAutocompleteDescendants,
43
- useDescendant: useAutocompleteDescendant
43
+ useDescendantsContext: useAutocompleteDescendantsContext
44
44
  } = (0, import_use_descendant.createDescendant)();
45
45
  var [AutocompleteProvider, useAutocompleteContext] = (0, import_utils.createContext)({
46
46
  name: "AutocompleteContext",
@@ -62,27 +62,27 @@ var AutocompleteIcon = (0, import_core.forwardRef)(
62
62
  ({ className, children, __css, ...rest }, ref) => {
63
63
  const { styles } = useAutocompleteContext();
64
64
  const css = {
65
- position: "absolute",
66
- top: "50%",
67
- transform: "translateY(-50%)",
68
- display: "inline-flex",
69
65
  alignItems: "center",
66
+ cursor: "pointer",
67
+ display: "inline-flex",
70
68
  justifyContent: "center",
71
69
  pointerEvents: "none",
72
- cursor: "pointer",
70
+ position: "absolute",
71
+ top: "50%",
72
+ transform: "translateY(-50%)",
73
73
  ...styles.icon,
74
74
  ...__css
75
75
  };
76
76
  const validChildren = (0, import_utils2.getValidChildren)(children);
77
77
  const cloneChildren = validChildren.map(
78
78
  (child) => (0, import_react.cloneElement)(child, {
79
- focusable: false,
80
- "aria-hidden": true,
81
79
  style: {
82
- maxWidth: "1em",
80
+ color: "currentColor",
83
81
  maxHeight: "1em",
84
- color: "currentColor"
85
- }
82
+ maxWidth: "1em"
83
+ },
84
+ "aria-hidden": true,
85
+ focusable: false
86
86
  })
87
87
  );
88
88
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
@@ -115,11 +115,11 @@ var AutocompleteClearIcon = ({
115
115
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
116
116
  AutocompleteIcon,
117
117
  {
118
- "aria-label": "Clear value",
119
118
  className: (0, import_utils2.cx)("ui-autocomplete__icon--clear", className),
119
+ "aria-label": "Clear value",
120
120
  __css: styles.clearIcon,
121
121
  ...rest,
122
- children: children != null ? children : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icon.CloseIcon, { w: "0.5em", h: "0.5em" })
122
+ children: children != null ? children : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icon.CloseIcon, { h: "0.5em", w: "0.5em" })
123
123
  }
124
124
  );
125
125
  };
@@ -128,11 +128,11 @@ AutocompleteClearIcon.__ui__ = "AutocompleteClearIcon";
128
128
  var AutocompleteItemIcon = (0, import_core.forwardRef)(({ className, ...rest }, ref) => {
129
129
  const { styles } = useAutocompleteContext();
130
130
  const css = {
131
- flexShrink: 0,
132
- display: "inline-flex",
133
- justifyContent: "center",
134
131
  alignItems: "center",
132
+ display: "inline-flex",
133
+ flexShrink: 0,
135
134
  fontSize: "0.85em",
135
+ justifyContent: "center",
136
136
  ...styles.itemIcon
137
137
  };
138
138
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
@@ -153,36 +153,36 @@ var import_utils3 = require("@yamada-ui/utils");
153
153
  var import_react2 = require("react");
154
154
  var isTargetOption = (target) => {
155
155
  var _a;
156
- return (0, import_utils3.isHTMLElement)(target) && !!((_a = target == null ? void 0 : target.getAttribute("role")) == null ? void 0 : _a.startsWith("option"));
156
+ return (0, import_utils3.isHTMLElement)(target) && !!((_a = target.getAttribute("role")) == null ? void 0 : _a.startsWith("option"));
157
157
  };
158
158
  var useAutocompleteOption = (props) => {
159
159
  var _a, _b;
160
160
  const {
161
- value,
161
+ closeOnSelect: generalCloseOnSelect,
162
+ focusedIndex,
163
+ inputRef,
162
164
  omitSelectedValues,
165
+ setFocusedIndex,
166
+ value,
167
+ optionProps,
163
168
  onChange,
164
169
  onChangeLabel,
165
- focusedIndex,
166
- setFocusedIndex,
167
170
  onClose,
168
- closeOnSelect: generalCloseOnSelect,
169
- optionProps,
170
- inputRef,
171
171
  onFocusNext
172
172
  } = useAutocompleteContext();
173
173
  const id = (0, import_react2.useId)();
174
174
  let {
175
+ children,
176
+ closeOnSelect: customCloseOnSelect,
175
177
  icon: customIcon,
176
178
  isDisabled,
177
179
  isFocusable,
178
- closeOnSelect: customCloseOnSelect,
179
- children,
180
180
  value: optionValue,
181
181
  ...computedProps
182
182
  } = { ...optionProps, ...props };
183
183
  const trulyDisabled = !!isDisabled && !isFocusable;
184
184
  const itemRef = (0, import_react2.useRef)(null);
185
- const { index, register, descendants } = useAutocompleteDescendant({
185
+ const { descendants, index, register } = useAutocompleteDescendant({
186
186
  disabled: trulyDisabled
187
187
  });
188
188
  const values = descendants.values();
@@ -232,27 +232,27 @@ var useAutocompleteOption = (props) => {
232
232
  border: "0px",
233
233
  clip: "rect(0px, 0px, 0px, 0px)",
234
234
  height: "1px",
235
- width: "1px",
236
235
  margin: "-1px",
237
- padding: "0px",
238
236
  overflow: "hidden",
237
+ padding: "0px",
238
+ position: "absolute",
239
239
  whiteSpace: "nowrap",
240
- position: "absolute"
240
+ width: "1px"
241
241
  };
242
242
  return {
243
- ref: (0, import_utils3.mergeRefs)(itemRef, ref, register),
244
243
  id,
244
+ ref: (0, import_utils3.mergeRefs)(itemRef, ref, register),
245
245
  role: "option",
246
246
  ...computedProps,
247
247
  ...props2,
248
- tabIndex: -1,
249
248
  style: !isTarget || omitSelectedValues && isSelected ? style : void 0,
250
- "data-target": (0, import_utils3.dataAttr)(true),
251
- "data-value": optionValue != null ? optionValue : "",
252
- "data-focus": (0, import_utils3.dataAttr)(isFocused),
253
- "data-disabled": (0, import_utils3.dataAttr)(isDisabled),
254
249
  "aria-checked": isSelected,
255
250
  "aria-disabled": (0, import_utils3.ariaAttr)(isDisabled),
251
+ "data-disabled": (0, import_utils3.dataAttr)(isDisabled),
252
+ "data-focus": (0, import_utils3.dataAttr)(isFocused),
253
+ "data-target": (0, import_utils3.dataAttr)(true),
254
+ "data-value": optionValue != null ? optionValue : "",
255
+ tabIndex: -1,
256
256
  onClick: (0, import_utils3.handlerAll)(computedProps.onClick, props2.onClick, onClick)
257
257
  };
258
258
  },
@@ -270,10 +270,10 @@ var useAutocompleteOption = (props) => {
270
270
  ]
271
271
  );
272
272
  return {
273
- isSelected,
274
- isFocused,
275
- customIcon,
276
273
  children,
274
+ customIcon,
275
+ isFocused,
276
+ isSelected,
277
277
  getOptionProps
278
278
  };
279
279
  };
@@ -283,19 +283,19 @@ var import_jsx_runtime2 = require("react/jsx-runtime");
283
283
  var AutocompleteOption = (0, import_core2.forwardRef)(
284
284
  ({ className, icon, ...rest }, ref) => {
285
285
  const { styles } = useAutocompleteContext();
286
- const { isSelected, customIcon, children, getOptionProps } = useAutocompleteOption(rest);
286
+ const { children, customIcon, isSelected, getOptionProps } = useAutocompleteOption(rest);
287
287
  icon != null ? icon : icon = customIcon;
288
288
  const css = {
289
- textDecoration: "none",
289
+ alignItems: "center",
290
290
  color: "inherit",
291
- userSelect: "none",
292
291
  display: "flex",
293
- width: "100%",
294
- alignItems: "center",
295
- textAlign: "start",
296
292
  flex: "0 0 auto",
297
- outline: 0,
298
293
  gap: "0.75rem",
294
+ outline: 0,
295
+ textAlign: "start",
296
+ textDecoration: "none",
297
+ userSelect: "none",
298
+ width: "100%",
299
299
  ...styles.item
300
300
  };
301
301
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
@@ -314,7 +314,7 @@ var AutocompleteOption = (0, import_core2.forwardRef)(
314
314
  );
315
315
  AutocompleteOption.displayName = "AutocompleteOption";
316
316
  AutocompleteOption.__ui__ = "AutocompleteOption";
317
- var AutocompleteCheckIcon = () => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("svg", { viewBox: "0 0 14 14", width: "1em", height: "1em", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
317
+ var AutocompleteCheckIcon = () => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("svg", { height: "1em", viewBox: "0 0 14 14", width: "1em", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
318
318
  "polygon",
319
319
  {
320
320
  fill: "currentColor",
@@ -336,7 +336,7 @@ var useAutocompleteOptionGroup = ({
336
336
  label,
337
337
  ...rest
338
338
  }) => {
339
- const { value, omitSelectedValues } = useAutocompleteContext();
339
+ const { omitSelectedValues, value } = useAutocompleteContext();
340
340
  const isMulti = (0, import_utils5.isArray)(value);
341
341
  const descendants = useAutocompleteDescendantsContext();
342
342
  const values = descendants.values();
@@ -348,7 +348,7 @@ var useAutocompleteOptionGroup = ({
348
348
  ) : [];
349
349
  const selectedIndexes = selectedValues.map(({ index }) => index);
350
350
  const childValues = values.filter(
351
- ({ node, index }) => {
351
+ ({ index, node }) => {
352
352
  var _a;
353
353
  return ((_a = node.parentElement) == null ? void 0 : _a.dataset.label) === label && !selectedIndexes.includes(index) && "target" in node.dataset;
354
354
  }
@@ -361,12 +361,12 @@ var useAutocompleteOptionGroup = ({
361
361
  border: "0px",
362
362
  clip: "rect(0px, 0px, 0px, 0px)",
363
363
  height: "1px",
364
- width: "1px",
365
364
  margin: "-1px",
366
- padding: "0px",
367
365
  overflow: "hidden",
366
+ padding: "0px",
367
+ position: "absolute",
368
368
  whiteSpace: "nowrap",
369
- position: "absolute"
369
+ width: "1px"
370
370
  };
371
371
  return {
372
372
  ref,
@@ -401,12 +401,12 @@ var import_jsx_runtime3 = require("react/jsx-runtime");
401
401
  var AutocompleteOptionGroup = (0, import_core4.forwardRef)(
402
402
  ({
403
403
  className,
404
+ children,
404
405
  color,
405
406
  h,
406
407
  height,
407
408
  minH,
408
409
  minHeight,
409
- children,
410
410
  labelProps,
411
411
  ...rest
412
412
  }, ref) => {
@@ -422,15 +422,15 @@ var AutocompleteOptionGroup = (0, import_core4.forwardRef)(
422
422
  "ui-autocomplete__item--group",
423
423
  className
424
424
  ),
425
- __css: { w: "100%", h: "fit-content", color },
425
+ __css: { color, h: "fit-content", w: "100%" },
426
426
  ...getContainerProps(),
427
427
  children: [
428
428
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
429
429
  import_core4.ui.span,
430
430
  {
431
431
  className: "ui-autocomplete__item__group-label",
432
- __css: styles.groupLabel,
433
432
  lineClamp: 1,
433
+ __css: styles.groupLabel,
434
434
  ...labelProps,
435
435
  children: label
436
436
  }
@@ -455,64 +455,79 @@ AutocompleteOptionGroup.__ui__ = "AutocompleteOptionGroup";
455
455
  // src/use-autocomplete.tsx
456
456
  var import_jsx_runtime4 = require("react/jsx-runtime");
457
457
  var kanaMap = {
458
- \uFF76\uFF9E: "\u30AC",
459
- \uFF77\uFF9E: "\u30AE",
460
- \uFF78\uFF9E: "\u30B0",
461
- \uFF79\uFF9E: "\u30B2",
462
- \uFF7A\uFF9E: "\u30B4",
463
- \uFF7B\uFF9E: "\u30B6",
464
- \uFF7C\uFF9E: "\u30B8",
465
- \uFF7D\uFF9E: "\u30BA",
466
- \uFF7E\uFF9E: "\u30BC",
467
- \uFF7F\uFF9E: "\u30BE",
468
- \uFF80\uFF9E: "\u30C0",
469
- \uFF81\uFF9E: "\u30C2",
470
- \uFF82\uFF9E: "\u30C5",
471
- \uFF83\uFF9E: "\u30C7",
472
- \uFF84\uFF9E: "\u30C9",
473
- \uFF8A\uFF9E: "\u30D0",
474
- \uFF8B\uFF9E: "\u30D3",
475
- \uFF8C\uFF9E: "\u30D6",
476
- \uFF8D\uFF9E: "\u30D9",
477
- \uFF8E\uFF9E: "\u30DC",
478
- \uFF8A\uFF9F: "\u30D1",
479
- \uFF8B\uFF9F: "\u30D4",
480
- \uFF8C\uFF9F: "\u30D7",
481
- \uFF8D\uFF9F: "\u30DA",
482
- \uFF8E\uFF9F: "\u30DD",
483
- \uFF73\uFF9E: "\u30F4",
484
- \uFF9C\uFF9E: "\u30F7",
458
+ "\uFF61": "\u3002",
459
+ "\uFF62": "\u300C",
460
+ "\uFF63": "\u300D",
461
+ "\uFF64": "\u3001",
462
+ "\uFF65": "\u30FB",
463
+ \uFF66: "\u30F2",
485
464
  \uFF66\uFF9E: "\u30FA",
465
+ \uFF67: "\u30A1",
466
+ \uFF68: "\u30A3",
467
+ \uFF69: "\u30A5",
468
+ \uFF6A: "\u30A7",
469
+ \uFF6B: "\u30A9",
470
+ \uFF6C: "\u30E3",
471
+ \uFF6D: "\u30E5",
472
+ \uFF6E: "\u30E7",
473
+ \uFF6F: "\u30C3",
474
+ \uFF70: "\u30FC",
486
475
  \uFF71: "\u30A2",
487
476
  \uFF72: "\u30A4",
488
477
  \uFF73: "\u30A6",
478
+ \uFF73\uFF9E: "\u30F4",
489
479
  \uFF74: "\u30A8",
490
480
  \uFF75: "\u30AA",
491
481
  \uFF76: "\u30AB",
482
+ \uFF76\uFF9E: "\u30AC",
492
483
  \uFF77: "\u30AD",
484
+ \uFF77\uFF9E: "\u30AE",
493
485
  \uFF78: "\u30AF",
486
+ \uFF78\uFF9E: "\u30B0",
494
487
  \uFF79: "\u30B1",
488
+ \uFF79\uFF9E: "\u30B2",
495
489
  \uFF7A: "\u30B3",
490
+ \uFF7A\uFF9E: "\u30B4",
496
491
  \uFF7B: "\u30B5",
492
+ \uFF7B\uFF9E: "\u30B6",
497
493
  \uFF7C: "\u30B7",
494
+ \uFF7C\uFF9E: "\u30B8",
498
495
  \uFF7D: "\u30B9",
496
+ \uFF7D\uFF9E: "\u30BA",
499
497
  \uFF7E: "\u30BB",
498
+ \uFF7E\uFF9E: "\u30BC",
500
499
  \uFF7F: "\u30BD",
500
+ \uFF7F\uFF9E: "\u30BE",
501
501
  \uFF80: "\u30BF",
502
+ \uFF80\uFF9E: "\u30C0",
502
503
  \uFF81: "\u30C1",
504
+ \uFF81\uFF9E: "\u30C2",
503
505
  \uFF82: "\u30C4",
506
+ \uFF82\uFF9E: "\u30C5",
504
507
  \uFF83: "\u30C6",
508
+ \uFF83\uFF9E: "\u30C7",
505
509
  \uFF84: "\u30C8",
510
+ \uFF84\uFF9E: "\u30C9",
506
511
  \uFF85: "\u30CA",
507
512
  \uFF86: "\u30CB",
508
513
  \uFF87: "\u30CC",
509
514
  \uFF88: "\u30CD",
510
515
  \uFF89: "\u30CE",
511
516
  \uFF8A: "\u30CF",
517
+ \uFF8A\uFF9E: "\u30D0",
518
+ \uFF8A\uFF9F: "\u30D1",
512
519
  \uFF8B: "\u30D2",
520
+ \uFF8B\uFF9E: "\u30D3",
521
+ \uFF8B\uFF9F: "\u30D4",
513
522
  \uFF8C: "\u30D5",
523
+ \uFF8C\uFF9E: "\u30D6",
524
+ \uFF8C\uFF9F: "\u30D7",
514
525
  \uFF8D: "\u30D8",
526
+ \uFF8D\uFF9E: "\u30D9",
527
+ \uFF8D\uFF9F: "\u30DA",
515
528
  \uFF8E: "\u30DB",
529
+ \uFF8E\uFF9E: "\u30DC",
530
+ \uFF8E\uFF9F: "\u30DD",
516
531
  \uFF8F: "\u30DE",
517
532
  \uFF90: "\u30DF",
518
533
  \uFF91: "\u30E0",
@@ -527,23 +542,8 @@ var kanaMap = {
527
542
  \uFF9A: "\u30EC",
528
543
  \uFF9B: "\u30ED",
529
544
  \uFF9C: "\u30EF",
530
- \uFF66: "\u30F2",
531
- \uFF9D: "\u30F3",
532
- \uFF67: "\u30A1",
533
- \uFF68: "\u30A3",
534
- \uFF69: "\u30A5",
535
- \uFF6A: "\u30A7",
536
- \uFF6B: "\u30A9",
537
- \uFF6F: "\u30C3",
538
- \uFF6C: "\u30E3",
539
- \uFF6D: "\u30E5",
540
- \uFF6E: "\u30E7",
541
- "\uFF61": "\u3002",
542
- "\uFF64": "\u3001",
543
- \uFF70: "\u30FC",
544
- "\uFF62": "\u300C",
545
- "\uFF63": "\u300D",
546
- "\uFF65": "\u30FB"
545
+ \uFF9C\uFF9E: "\u30F7",
546
+ \uFF9D: "\u30F3"
547
547
  };
548
548
  var defaultFormat = (value) => {
549
549
  value = value.replace(
@@ -571,46 +571,46 @@ var flattenItems = (items) => {
571
571
  };
572
572
  var useAutocomplete = (props) => {
573
573
  const {
574
- value: valueProp,
575
- defaultValue,
576
- onChange: onChangeProp,
577
- onCreate: onCreateProp,
578
- onSearch: onSearchProp,
579
- closeOnSelect = true,
580
- omitSelectedValues = false,
581
- maxSelectValues,
582
574
  allowCreate = false,
583
575
  allowFree = false,
584
- insertPositionItem = "first",
585
- emptyMessage = "No results found",
586
- format = defaultFormat,
587
- optionProps,
588
- placeholder,
589
- onKeyDown: onKeyDownProp,
590
- isOpen: isOpenProp,
591
- defaultIsOpen,
592
- onOpen: onOpenProp,
593
- onClose: onCloseProp,
576
+ animation,
577
+ boundary,
578
+ children,
579
+ closeDelay,
594
580
  closeOnBlur = true,
595
581
  closeOnEsc = true,
596
- openDelay,
597
- closeDelay,
582
+ closeOnSelect = true,
583
+ defaultIsOpen,
584
+ defaultValue,
585
+ duration = 0.2,
586
+ emptyMessage = "No results found",
587
+ eventListeners,
588
+ flip,
589
+ format = defaultFormat,
590
+ gutter,
591
+ insertPositionItem = "first",
598
592
  isLazy,
593
+ isOpen: isOpenProp,
594
+ items,
599
595
  lazyBehavior,
600
- animation,
601
- duration = 0.2,
596
+ matchWidth = true,
597
+ maxSelectValues,
598
+ modifiers,
602
599
  offset,
603
- gutter,
600
+ omitSelectedValues = false,
601
+ openDelay,
602
+ placeholder,
603
+ placement = "bottom-start",
604
604
  preventOverflow,
605
- flip,
606
- matchWidth = true,
607
- boundary,
608
- eventListeners,
609
605
  strategy,
610
- placement = "bottom-start",
611
- modifiers,
612
- items,
613
- children,
606
+ value: valueProp,
607
+ optionProps,
608
+ onChange: onChangeProp,
609
+ onClose: onCloseProp,
610
+ onCreate: onCreateProp,
611
+ onKeyDown: onKeyDownProp,
612
+ onOpen: onOpenProp,
613
+ onSearch: onSearchProp,
614
614
  ...rest
615
615
  } = (0, import_form_control.useFormControlProps)(props);
616
616
  const {
@@ -629,8 +629,8 @@ var useAutocomplete = (props) => {
629
629
  const prevValue = (0, import_react4.useRef)(void 0);
630
630
  const [resolvedItems, setResolvedItems] = (0, import_react4.useState)(items ? JSON.parse(JSON.stringify(items)) : void 0);
631
631
  const [value, setValue] = (0, import_use_controllable_state.useControllableState)({
632
- value: valueProp,
633
632
  defaultValue,
633
+ value: valueProp,
634
634
  onChange: onChangeProp
635
635
  });
636
636
  const [label, setLabel] = (0, import_react4.useState)(void 0);
@@ -640,13 +640,13 @@ var useAutocomplete = (props) => {
640
640
  const [isHit, setIsHit] = (0, import_react4.useState)(true);
641
641
  const {
642
642
  isOpen,
643
- onOpen: onInternalOpen,
644
- onClose
643
+ onClose,
644
+ onOpen: onInternalOpen
645
645
  } = (0, import_use_disclosure.useDisclosure)({
646
- isOpen: isOpenProp,
647
646
  defaultIsOpen,
648
- onOpen: onOpenProp,
649
- onClose: onCloseProp
647
+ isOpen: isOpenProp,
648
+ onClose: onCloseProp,
649
+ onOpen: onOpenProp
650
650
  });
651
651
  const isFocused = focusedIndex > -1;
652
652
  const isCreate = focusedIndex === -2 && allowCreate;
@@ -672,7 +672,7 @@ var useAutocomplete = (props) => {
672
672
  );
673
673
  const selectedIndexes = selectedValues.map(({ index }) => index);
674
674
  const enabledValues = descendants.enabledValues(
675
- ({ node, index }) => "target" in node.dataset && !selectedIndexes.includes(index)
675
+ ({ index, node }) => "target" in node.dataset && !selectedIndexes.includes(index)
676
676
  );
677
677
  const validChildren = (0, import_utils7.getValidChildren)(children);
678
678
  const computedChildren = (0, import_react4.useMemo)(
@@ -681,7 +681,7 @@ var useAutocomplete = (props) => {
681
681
  const { label: label2, value: value2, ...props2 } = item;
682
682
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(AutocompleteOption, { value: value2, ...props2, children: label2 }, i);
683
683
  } else if ("items" in item) {
684
- const { label: label2, items: items2 = [], ...props2 } = item;
684
+ const { items: items2 = [], label: label2, ...props2 } = item;
685
685
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(AutocompleteOptionGroup, { label: label2, ...props2, children: items2.map(({ label: label3, value: value2, ...props3 }, i2) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(AutocompleteOption, { value: value2, ...props3, children: label3 }, i2)) }, i);
686
686
  }
687
687
  }),
@@ -696,6 +696,7 @@ var useAutocomplete = (props) => {
696
696
  }, [allowCreate, formControlProps, isAllSelected, isEmpty, onInternalOpen]);
697
697
  const onFocusFirst = (0, import_react4.useCallback)(() => {
698
698
  const id2 = setTimeout(() => {
699
+ var _a;
699
700
  if (isEmpty || isAllSelected) return;
700
701
  const first = descendants.enabledFirstValue(
701
702
  ({ node }) => "target" in node.dataset
@@ -706,7 +707,7 @@ var useAutocomplete = (props) => {
706
707
  } else {
707
708
  if (selectedIndexes.includes(first.index)) {
708
709
  const enabledFirst = enabledValues[0];
709
- setFocusedIndex(enabledFirst.index);
710
+ setFocusedIndex((_a = enabledFirst == null ? void 0 : enabledFirst.index) != null ? _a : -1);
710
711
  } else {
711
712
  setFocusedIndex(first.index);
712
713
  }
@@ -724,6 +725,7 @@ var useAutocomplete = (props) => {
724
725
  ]);
725
726
  const onFocusLast = (0, import_react4.useCallback)(() => {
726
727
  const id2 = setTimeout(() => {
728
+ var _a;
727
729
  if (isEmpty || isAllSelected) return;
728
730
  const last = descendants.enabledLastValue(
729
731
  ({ node }) => "target" in node.dataset
@@ -734,7 +736,7 @@ var useAutocomplete = (props) => {
734
736
  } else {
735
737
  if (selectedIndexes.includes(last.index)) {
736
738
  const enabledLast = enabledValues.reverse()[0];
737
- setFocusedIndex(enabledLast.index);
739
+ setFocusedIndex((_a = enabledLast == null ? void 0 : enabledLast.index) != null ? _a : -1);
738
740
  } else {
739
741
  setFocusedIndex(last.index);
740
742
  }
@@ -766,7 +768,7 @@ var useAutocomplete = (props) => {
766
768
  const onFocusNext = (0, import_react4.useCallback)(
767
769
  (index = focusedIndex) => {
768
770
  const id2 = setTimeout(() => {
769
- var _a;
771
+ var _a, _b;
770
772
  const next = descendants.enabledNextValue(
771
773
  index,
772
774
  ({ node }) => "target" in node.dataset
@@ -777,7 +779,7 @@ var useAutocomplete = (props) => {
777
779
  } else {
778
780
  if (selectedIndexes.includes(next.index)) {
779
781
  const enabledNext = (_a = enabledValues.find(({ index: index2 }) => next.index < index2)) != null ? _a : enabledValues[0];
780
- setFocusedIndex(enabledNext.index);
782
+ setFocusedIndex((_b = enabledNext == null ? void 0 : enabledNext.index) != null ? _b : -1);
781
783
  } else {
782
784
  setFocusedIndex(next.index);
783
785
  }
@@ -797,7 +799,7 @@ var useAutocomplete = (props) => {
797
799
  const onFocusPrev = (0, import_react4.useCallback)(
798
800
  (index = focusedIndex) => {
799
801
  const id2 = setTimeout(() => {
800
- var _a;
802
+ var _a, _b;
801
803
  const prev = descendants.enabledPrevValue(
802
804
  index,
803
805
  ({ node }) => "target" in node.dataset
@@ -808,7 +810,7 @@ var useAutocomplete = (props) => {
808
810
  } else {
809
811
  if (selectedIndexes.includes(prev.index)) {
810
812
  const enabledPrev = (_a = enabledValues.reverse().find(({ index: index2 }) => index2 < prev.index)) != null ? _a : enabledValues[0];
811
- setFocusedIndex(enabledPrev.index);
813
+ setFocusedIndex((_b = enabledPrev == null ? void 0 : enabledPrev.index) != null ? _b : -1);
812
814
  } else {
813
815
  setFocusedIndex(prev.index);
814
816
  }
@@ -832,7 +834,7 @@ var useAutocomplete = (props) => {
832
834
  const values = descendants.values();
833
835
  let isHit2 = false;
834
836
  let isFocused2 = false;
835
- values.forEach(({ node, index }) => {
837
+ values.forEach(({ index, node }) => {
836
838
  var _a;
837
839
  if (format((_a = node.textContent) != null ? _a : "").includes(value2)) {
838
840
  isHit2 = true;
@@ -890,7 +892,7 @@ var useAutocomplete = (props) => {
890
892
  return selectedValues2[0];
891
893
  } else {
892
894
  selectedValues2.forEach((selectedValue) => {
893
- const isSelected = (0, import_utils7.isArray)(prev) && prev.includes(selectedValue != null ? selectedValue : "");
895
+ const isSelected = (0, import_utils7.isArray)(prev) && prev.includes(selectedValue);
894
896
  if (!isSelected) {
895
897
  prev = [...(0, import_utils7.isArray)(prev) ? prev : [], selectedValue];
896
898
  } else if (runOmit) {
@@ -995,7 +997,7 @@ var useAutocomplete = (props) => {
995
997
  ({ label: label2 }) => label2 === firstInsertPositionItem
996
998
  );
997
999
  const targetItem = newItems[i];
998
- if (i !== -1 && "items" in targetItem) {
1000
+ if (i !== -1 && targetItem && "items" in targetItem) {
999
1001
  if (secondInsertPositionItem === "first") {
1000
1002
  targetItem.items = [newItem, ...(_a = targetItem.items) != null ? _a : []];
1001
1003
  } else {
@@ -1079,15 +1081,15 @@ var useAutocomplete = (props) => {
1079
1081
  const actions = {
1080
1082
  ArrowDown: isFocused ? () => onFocusNext() : !isOpen ? (0, import_utils7.funcAll)(onOpen, onFocusFirstOrSelected) : void 0,
1081
1083
  ArrowUp: isFocused ? () => onFocusPrev() : !isOpen ? (0, import_utils7.funcAll)(onOpen, onFocusLastOrSelected) : void 0,
1082
- Space: isCreate ? onCreate : isFocused ? onSelect : !isOpen ? (0, import_utils7.funcAll)(onOpen, onFocusFirstOrSelected) : void 0,
1084
+ Backspace: !isEmptyValue && enabledDelete ? onDelete : void 0,
1085
+ End: isOpen ? onFocusLast : void 0,
1083
1086
  Enter: isCreate ? onCreate : isFocused ? onSelect : !isOpen ? (0, import_utils7.funcAll)(onOpen, onFocusFirstOrSelected) : allowFree && isMulti ? () => {
1084
1087
  if (inputValue) onChange(inputValue);
1085
1088
  setFocusedIndex(0);
1086
1089
  } : void 0,
1087
- Home: isOpen ? onFocusFirst : void 0,
1088
- End: isOpen ? onFocusLast : void 0,
1089
1090
  Escape: closeOnEsc ? onClose : void 0,
1090
- Backspace: !isEmptyValue && enabledDelete ? onDelete : void 0
1091
+ Home: isOpen ? onFocusFirst : void 0,
1092
+ Space: isCreate ? onCreate : isFocused ? onSelect : !isOpen ? (0, import_utils7.funcAll)(onOpen, onFocusFirstOrSelected) : void 0
1091
1093
  };
1092
1094
  const action = actions[ev.key];
1093
1095
  if (!action) return;
@@ -1142,7 +1144,7 @@ var useAutocomplete = (props) => {
1142
1144
  (0, import_react4.useEffect)(() => {
1143
1145
  var _a;
1144
1146
  if (isMulti) {
1145
- if (JSON.stringify((_a = prevValue.current) != null ? _a : []) === JSON.stringify(value != null ? value : []))
1147
+ if (JSON.stringify((_a = prevValue.current) != null ? _a : []) === JSON.stringify(value))
1146
1148
  return;
1147
1149
  const label2 = getSelectedValues(value);
1148
1150
  setLabel(label2);
@@ -1168,34 +1170,34 @@ var useAutocomplete = (props) => {
1168
1170
  });
1169
1171
  (0, import_use_outside_click.useOutsideClick)({
1170
1172
  ref: containerRef,
1171
- handler: onClose,
1172
- enabled: isOpen && (closeOnBlur || !isHit)
1173
+ enabled: isOpen && (closeOnBlur || !isHit),
1174
+ handler: onClose
1173
1175
  });
1174
1176
  const getPopoverProps = (0, import_react4.useCallback)(
1175
1177
  (props2) => ({
1176
- closeOnBlur,
1177
- openDelay,
1178
+ animation,
1179
+ boundary,
1178
1180
  closeDelay,
1181
+ closeOnBlur,
1182
+ duration,
1183
+ eventListeners,
1184
+ flip,
1185
+ gutter,
1179
1186
  isLazy,
1180
1187
  lazyBehavior,
1181
- animation,
1182
- duration,
1188
+ matchWidth,
1189
+ modifiers,
1183
1190
  offset,
1184
- gutter,
1191
+ openDelay,
1192
+ placement,
1185
1193
  preventOverflow,
1186
- flip,
1187
- matchWidth,
1188
- boundary,
1189
- eventListeners,
1190
1194
  strategy,
1191
- placement,
1192
- modifiers,
1193
1195
  ...props2,
1194
- trigger: "never",
1195
1196
  closeOnButton: false,
1196
1197
  isOpen,
1197
- onOpen,
1198
- onClose
1198
+ trigger: "never",
1199
+ onClose,
1200
+ onOpen
1199
1201
  }),
1200
1202
  [
1201
1203
  closeOnBlur,
@@ -1226,8 +1228,8 @@ var useAutocomplete = (props) => {
1226
1228
  ...containerProps,
1227
1229
  ...props2,
1228
1230
  ...formControlProps,
1229
- onClick: (0, import_utils7.handlerAll)(props2.onClick, rest.onClick, onClick),
1230
- onBlur: (0, import_utils7.handlerAll)(props2.onBlur, rest.onBlur, onBlur)
1231
+ onBlur: (0, import_utils7.handlerAll)(props2.onBlur, rest.onBlur, onBlur),
1232
+ onClick: (0, import_utils7.handlerAll)(props2.onClick, rest.onClick, onClick)
1231
1233
  }),
1232
1234
  [containerProps, formControlProps, onBlur, onClick, rest]
1233
1235
  );
@@ -1237,9 +1239,9 @@ var useAutocomplete = (props) => {
1237
1239
  tabIndex: -1,
1238
1240
  ...props2,
1239
1241
  ...formControlProps,
1240
- placeholder,
1241
- "data-active": (0, import_utils7.dataAttr)(isOpen),
1242
1242
  "aria-expanded": (0, import_utils7.dataAttr)(isOpen),
1243
+ "data-active": (0, import_utils7.dataAttr)(isOpen),
1244
+ placeholder,
1243
1245
  onFocus: (0, import_utils7.handlerAll)(props2.onFocus, onFocusProp, onFocus),
1244
1246
  onKeyDown: (0, import_utils7.handlerAll)(props2.onKeyDown, onKeyDownProp, onKeyDown)
1245
1247
  }),
@@ -1255,61 +1257,61 @@ var useAutocomplete = (props) => {
1255
1257
  );
1256
1258
  return {
1257
1259
  id,
1258
- descendants,
1259
- value,
1260
- label,
1261
- inputValue,
1262
- isHit,
1263
- isEmpty,
1264
- computedChildren,
1265
- focusedIndex,
1266
- omitSelectedValues,
1267
- closeOnSelect,
1268
1260
  allowCreate,
1269
1261
  allowFree,
1262
+ closeOnSelect,
1263
+ computedChildren,
1264
+ descendants,
1270
1265
  emptyMessage,
1271
- isOpen,
1266
+ focusedIndex,
1267
+ inputRef,
1268
+ inputValue,
1272
1269
  isAllSelected,
1270
+ isEmpty,
1271
+ isHit,
1272
+ isOpen,
1273
+ label,
1273
1274
  listRef,
1274
- inputRef,
1275
- optionProps,
1276
- formControlProps,
1275
+ omitSelectedValues,
1276
+ pickOptions,
1277
+ rebirthOptions,
1277
1278
  setFocusedIndex,
1278
- onChangeLabel,
1279
+ value,
1280
+ formControlProps,
1281
+ getContainerProps,
1282
+ getFieldProps,
1283
+ getPopoverProps,
1284
+ inputProps,
1285
+ optionProps,
1279
1286
  onChange,
1280
- onSearch,
1281
- onCreate,
1287
+ onChangeLabel,
1282
1288
  onClear,
1283
- onCompositionStart,
1284
- onCompositionEnd,
1285
- pickOptions,
1286
- rebirthOptions,
1287
- onOpen,
1288
1289
  onClose,
1290
+ onCompositionEnd,
1291
+ onCompositionStart,
1292
+ onCreate,
1289
1293
  onFocusFirst,
1290
1294
  onFocusLast,
1291
- onFocusSelected,
1292
1295
  onFocusNext,
1293
1296
  onFocusPrev,
1294
- getPopoverProps,
1295
- getContainerProps,
1296
- getFieldProps,
1297
- inputProps
1297
+ onFocusSelected,
1298
+ onOpen,
1299
+ onSearch
1298
1300
  };
1299
1301
  };
1300
1302
  var useAutocompleteInput = () => {
1301
1303
  const {
1302
1304
  id,
1305
+ focusedIndex,
1303
1306
  inputRef,
1304
- onSearch,
1305
- onCompositionStart,
1306
- onCompositionEnd,
1307
1307
  isAllSelected,
1308
+ isOpen,
1309
+ listRef,
1308
1310
  formControlProps,
1309
1311
  inputProps,
1310
- isOpen,
1311
- focusedIndex,
1312
- listRef
1312
+ onCompositionEnd,
1313
+ onCompositionStart,
1314
+ onSearch
1313
1315
  } = useAutocompleteContext();
1314
1316
  const { value } = useAutocompleteDescendantsContext();
1315
1317
  (0, import_utils7.useUpdateEffect)(() => {
@@ -1321,14 +1323,14 @@ var useAutocompleteInput = () => {
1321
1323
  return {
1322
1324
  ref: (0, import_utils7.mergeRefs)(inputRef, ref),
1323
1325
  ...formControlProps,
1324
- role: "combobox",
1325
- "aria-haspopup": "listbox",
1326
- "aria-autocomplete": "list",
1327
- "aria-expanded": isOpen,
1328
1326
  "aria-activedescendant": (_a = value(focusedIndex)) == null ? void 0 : _a.node.id,
1327
+ "aria-autocomplete": "list",
1329
1328
  "aria-controls": (_b = listRef.current) == null ? void 0 : _b.id,
1329
+ "aria-expanded": isOpen,
1330
+ "aria-haspopup": "listbox",
1330
1331
  autoCapitalize: "none",
1331
1332
  autoComplete: "off",
1333
+ role: "combobox",
1332
1334
  spellCheck: "false",
1333
1335
  ...inputProps,
1334
1336
  ...props,
@@ -1337,15 +1339,15 @@ var useAutocompleteInput = () => {
1337
1339
  pointerEvents: formControlProps.disabled || isAllSelected ? "none" : "auto",
1338
1340
  tabIndex: isAllSelected ? -1 : 0,
1339
1341
  onChange: (0, import_utils7.handlerAll)(props.onChange, onSearch),
1340
- onCompositionStart: (0, import_utils7.handlerAll)(
1341
- props.onCompositionStart,
1342
- inputProps.onCompositionStart,
1343
- onCompositionStart
1344
- ),
1345
1342
  onCompositionEnd: (0, import_utils7.handlerAll)(
1346
1343
  props.onCompositionEnd,
1347
1344
  inputProps.onCompositionEnd,
1348
1345
  onCompositionEnd
1346
+ ),
1347
+ onCompositionStart: (0, import_utils7.handlerAll)(
1348
+ props.onCompositionStart,
1349
+ inputProps.onCompositionStart,
1350
+ onCompositionStart
1349
1351
  )
1350
1352
  };
1351
1353
  },