@yamada-ui/autocomplete 1.5.4-next-20241005220055 → 1.6.0-dev-20241011151311

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 +56 -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 +303 -292
  35. package/dist/autocomplete.js.map +1 -1
  36. package/dist/autocomplete.mjs +12 -12
  37. package/dist/{chunk-5GKGL6BL.mjs → chunk-2HJUFFCU.mjs} +16 -16
  38. package/dist/chunk-2HJUFFCU.mjs.map +1 -0
  39. package/dist/{chunk-6F3LT7J6.mjs → chunk-4SBNPEK7.mjs} +7 -7
  40. package/dist/{chunk-6F3LT7J6.mjs.map → chunk-4SBNPEK7.mjs.map} +1 -1
  41. package/dist/{chunk-JMX72TSD.mjs → chunk-67X7JKWL.mjs} +7 -7
  42. package/dist/{chunk-JMX72TSD.mjs.map → chunk-67X7JKWL.mjs.map} +1 -1
  43. package/dist/{chunk-5LPWFWE6.mjs → chunk-6OLHNK7O.mjs} +46 -34
  44. package/dist/chunk-6OLHNK7O.mjs.map +1 -0
  45. package/dist/{chunk-QPIWG4ZF.mjs → chunk-7LZUXESV.mjs} +63 -61
  46. package/dist/chunk-7LZUXESV.mjs.map +1 -0
  47. package/dist/{chunk-S2HFYJVI.mjs → chunk-AIBJWPRA.mjs} +13 -13
  48. package/dist/chunk-AIBJWPRA.mjs.map +1 -0
  49. package/dist/{chunk-Q2HZVVOI.mjs → chunk-K5HCHHCJ.mjs} +16 -16
  50. package/dist/chunk-K5HCHHCJ.mjs.map +1 -0
  51. package/dist/{chunk-HZECQUHV.mjs → chunk-Q33EMTO2.mjs} +40 -40
  52. package/dist/{chunk-HZECQUHV.mjs.map → chunk-Q33EMTO2.mjs.map} +1 -1
  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-OLOU5HFC.mjs → chunk-WERCEZNJ.mjs} +168 -166
  62. package/dist/chunk-WERCEZNJ.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 +356 -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 +326 -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 +43 -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 +225 -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
package/dist/index.mjs CHANGED
@@ -1,29 +1,29 @@
1
1
  "use client"
2
2
  import {
3
3
  MultiAutocomplete
4
- } from "./chunk-QPIWG4ZF.mjs";
4
+ } from "./chunk-7LZUXESV.mjs";
5
5
  import {
6
6
  Autocomplete
7
- } from "./chunk-HZECQUHV.mjs";
8
- import "./chunk-OLOU5HFC.mjs";
7
+ } from "./chunk-Q33EMTO2.mjs";
8
+ import "./chunk-WERCEZNJ.mjs";
9
9
  import {
10
10
  AutocompleteCreate
11
- } from "./chunk-Q2HZVVOI.mjs";
11
+ } from "./chunk-K5HCHHCJ.mjs";
12
12
  import {
13
13
  AutocompleteEmpty
14
- } from "./chunk-5GKGL6BL.mjs";
15
- import "./chunk-S53LMDD7.mjs";
16
- import "./chunk-R76HPAN4.mjs";
14
+ } from "./chunk-2HJUFFCU.mjs";
15
+ import "./chunk-VTBUO5SK.mjs";
16
+ import "./chunk-TR4X4EEG.mjs";
17
17
  import {
18
18
  AutocompleteOptionGroup
19
- } from "./chunk-6F3LT7J6.mjs";
20
- import "./chunk-JMX72TSD.mjs";
19
+ } from "./chunk-4SBNPEK7.mjs";
20
+ import "./chunk-67X7JKWL.mjs";
21
21
  import {
22
22
  AutocompleteOption
23
- } from "./chunk-S2HFYJVI.mjs";
24
- import "./chunk-5LPWFWE6.mjs";
25
- import "./chunk-7SWSKLSA.mjs";
26
- import "./chunk-JPUKYLBW.mjs";
23
+ } from "./chunk-AIBJWPRA.mjs";
24
+ import "./chunk-6OLHNK7O.mjs";
25
+ import "./chunk-V6YCG642.mjs";
26
+ import "./chunk-WDQYM4FP.mjs";
27
27
  export {
28
28
  Autocomplete,
29
29
  AutocompleteCreate,
@@ -8,8 +8,8 @@ import { AutocompleteEmptyProps } from './autocomplete-empty.mjs';
8
8
  import { AutocompleteIconProps } from './autocomplete-icon.mjs';
9
9
  import { AutocompleteListProps } from './autocomplete-list.mjs';
10
10
  import { UseAutocompleteProps } from './use-autocomplete.mjs';
11
- import 'react/jsx-runtime';
12
11
  import '@yamada-ui/use-descendant';
12
+ import 'react/jsx-runtime';
13
13
  import '@yamada-ui/form-control';
14
14
  import '@yamada-ui/popover';
15
15
  import '@yamada-ui/utils';
@@ -20,26 +20,42 @@ import './use-autocomplete-option-group.mjs';
20
20
 
21
21
  interface MultiAutocompleteOptions {
22
22
  /**
23
- * The visual separator between each value.
23
+ * If `true`, the list element will be closed when value is selected.
24
24
  *
25
- * @default ','
25
+ * @default false
26
26
  */
27
- separator?: string;
27
+ closeOnSelect?: boolean;
28
28
  /**
29
29
  * The custom display value to use.
30
30
  */
31
31
  component?: FC<{
32
- value: string | number;
33
- label: string;
34
32
  index: number;
33
+ label: string;
34
+ value: number | string;
35
35
  onRemove: MouseEventHandler<HTMLElement>;
36
36
  }>;
37
37
  /**
38
- * If `true`, keep the placeholder.
39
- *
40
- * @default false
38
+ * The border color when the input is invalid.
41
39
  */
42
- keepPlaceholder?: boolean;
40
+ errorBorderColor?: string;
41
+ /**
42
+ * The border color when the input is focused.
43
+ */
44
+ focusBorderColor?: string;
45
+ /**
46
+ * The footer of the autocomplete content element.
47
+ */
48
+ footer?: FC<{
49
+ value: string[] | undefined;
50
+ onClose: () => void;
51
+ }> | ReactNode;
52
+ /**
53
+ * The header of the autocomplete content element.
54
+ */
55
+ header?: FC<{
56
+ value: string[] | undefined;
57
+ onClose: () => void;
58
+ }> | ReactNode;
43
59
  /**
44
60
  * If `true`, display the select clear icon.
45
61
  *
@@ -47,13 +63,21 @@ interface MultiAutocompleteOptions {
47
63
  */
48
64
  isClearable?: boolean;
49
65
  /**
50
- * The border color when the input is focused.
66
+ * If `true`, keep the placeholder.
67
+ *
68
+ * @default false
51
69
  */
52
- focusBorderColor?: string;
70
+ keepPlaceholder?: boolean;
53
71
  /**
54
- * The border color when the input is invalid.
72
+ * The visual separator between each value.
73
+ *
74
+ * @default ','
55
75
  */
56
- errorBorderColor?: string;
76
+ separator?: string;
77
+ /**
78
+ * Props for multi autocomplete clear icon element.
79
+ */
80
+ clearIconProps?: AutocompleteIconProps;
57
81
  /**
58
82
  * Props for multi autocomplete container element.
59
83
  */
@@ -63,25 +87,29 @@ interface MultiAutocompleteOptions {
63
87
  */
64
88
  contentProps?: Omit<MotionProps, "children">;
65
89
  /**
66
- * Props for multi autocomplete list element.
90
+ * Props for autocomplete create element.
67
91
  */
68
- listProps?: Omit<AutocompleteListProps, "children">;
92
+ createProps?: Omit<AutocompleteCreateProps, "children">;
69
93
  /**
70
- * Props for multi autocomplete field element.
94
+ * Props for autocomplete empty element.
71
95
  */
72
- fieldProps?: Omit<MultiAutocompleteFieldProps, "component" | "separator" | "keepPlaceholder" | "inputProps" | "children">;
96
+ emptyProps?: Omit<AutocompleteEmptyProps, "children">;
73
97
  /**
74
- * Props for multi autocomplete input element.
98
+ * Props for multi autocomplete field element.
75
99
  */
76
- inputProps?: HTMLUIProps<"input">;
100
+ fieldProps?: Omit<MultiAutocompleteFieldProps, "children" | "component" | "inputProps" | "keepPlaceholder" | "separator">;
77
101
  /**
78
102
  * Props for multi autocomplete icon element.
79
103
  */
80
104
  iconProps?: AutocompleteIconProps;
81
105
  /**
82
- * Props for multi autocomplete clear icon element.
106
+ * Props for multi autocomplete input element.
83
107
  */
84
- clearIconProps?: AutocompleteIconProps;
108
+ inputProps?: HTMLUIProps<"input">;
109
+ /**
110
+ * Props for multi autocomplete list element.
111
+ */
112
+ listProps?: Omit<AutocompleteListProps, "children">;
85
113
  /**
86
114
  * Props to be forwarded to the portal component.
87
115
  *
@@ -89,34 +117,6 @@ interface MultiAutocompleteOptions {
89
117
  *
90
118
  */
91
119
  portalProps?: Omit<PortalProps, "children">;
92
- /**
93
- * If `true`, the list element will be closed when value is selected.
94
- *
95
- * @default false
96
- */
97
- closeOnSelect?: boolean;
98
- /**
99
- * Props for autocomplete create element.
100
- */
101
- createProps?: Omit<AutocompleteCreateProps, "children">;
102
- /**
103
- * Props for autocomplete empty element.
104
- */
105
- emptyProps?: Omit<AutocompleteEmptyProps, "children">;
106
- /**
107
- * The header of the autocomplete content element.
108
- */
109
- header?: ReactNode | FC<{
110
- value: string[] | undefined;
111
- onClose: () => void;
112
- }>;
113
- /**
114
- * The footer of the autocomplete content element.
115
- */
116
- footer?: ReactNode | FC<{
117
- value: string[] | undefined;
118
- onClose: () => void;
119
- }>;
120
120
  }
121
121
  interface MultiAutocompleteProps extends ThemeProps<"MultiAutocomplete">, Omit<UseAutocompleteProps<string[]>, "closeOnSelect">, MultiAutocompleteOptions {
122
122
  }
@@ -126,7 +126,7 @@ interface MultiAutocompleteProps extends ThemeProps<"MultiAutocomplete">, Omit<U
126
126
  * @see Docs https://yamada-ui.com/components/forms/multi-autocomplete
127
127
  */
128
128
  declare const MultiAutocomplete: _yamada_ui_core.Component<"input", MultiAutocompleteProps>;
129
- interface MultiAutocompleteFieldProps extends HTMLUIProps, Pick<MultiAutocompleteProps, "component" | "separator" | "keepPlaceholder" | "inputProps"> {
129
+ interface MultiAutocompleteFieldProps extends HTMLUIProps, Pick<MultiAutocompleteProps, "component" | "inputProps" | "keepPlaceholder" | "separator"> {
130
130
  }
131
131
 
132
132
  export { MultiAutocomplete, type MultiAutocompleteProps };
@@ -8,8 +8,8 @@ import { AutocompleteEmptyProps } from './autocomplete-empty.js';
8
8
  import { AutocompleteIconProps } from './autocomplete-icon.js';
9
9
  import { AutocompleteListProps } from './autocomplete-list.js';
10
10
  import { UseAutocompleteProps } from './use-autocomplete.js';
11
- import 'react/jsx-runtime';
12
11
  import '@yamada-ui/use-descendant';
12
+ import 'react/jsx-runtime';
13
13
  import '@yamada-ui/form-control';
14
14
  import '@yamada-ui/popover';
15
15
  import '@yamada-ui/utils';
@@ -20,26 +20,42 @@ import './use-autocomplete-option-group.js';
20
20
 
21
21
  interface MultiAutocompleteOptions {
22
22
  /**
23
- * The visual separator between each value.
23
+ * If `true`, the list element will be closed when value is selected.
24
24
  *
25
- * @default ','
25
+ * @default false
26
26
  */
27
- separator?: string;
27
+ closeOnSelect?: boolean;
28
28
  /**
29
29
  * The custom display value to use.
30
30
  */
31
31
  component?: FC<{
32
- value: string | number;
33
- label: string;
34
32
  index: number;
33
+ label: string;
34
+ value: number | string;
35
35
  onRemove: MouseEventHandler<HTMLElement>;
36
36
  }>;
37
37
  /**
38
- * If `true`, keep the placeholder.
39
- *
40
- * @default false
38
+ * The border color when the input is invalid.
41
39
  */
42
- keepPlaceholder?: boolean;
40
+ errorBorderColor?: string;
41
+ /**
42
+ * The border color when the input is focused.
43
+ */
44
+ focusBorderColor?: string;
45
+ /**
46
+ * The footer of the autocomplete content element.
47
+ */
48
+ footer?: FC<{
49
+ value: string[] | undefined;
50
+ onClose: () => void;
51
+ }> | ReactNode;
52
+ /**
53
+ * The header of the autocomplete content element.
54
+ */
55
+ header?: FC<{
56
+ value: string[] | undefined;
57
+ onClose: () => void;
58
+ }> | ReactNode;
43
59
  /**
44
60
  * If `true`, display the select clear icon.
45
61
  *
@@ -47,13 +63,21 @@ interface MultiAutocompleteOptions {
47
63
  */
48
64
  isClearable?: boolean;
49
65
  /**
50
- * The border color when the input is focused.
66
+ * If `true`, keep the placeholder.
67
+ *
68
+ * @default false
51
69
  */
52
- focusBorderColor?: string;
70
+ keepPlaceholder?: boolean;
53
71
  /**
54
- * The border color when the input is invalid.
72
+ * The visual separator between each value.
73
+ *
74
+ * @default ','
55
75
  */
56
- errorBorderColor?: string;
76
+ separator?: string;
77
+ /**
78
+ * Props for multi autocomplete clear icon element.
79
+ */
80
+ clearIconProps?: AutocompleteIconProps;
57
81
  /**
58
82
  * Props for multi autocomplete container element.
59
83
  */
@@ -63,25 +87,29 @@ interface MultiAutocompleteOptions {
63
87
  */
64
88
  contentProps?: Omit<MotionProps, "children">;
65
89
  /**
66
- * Props for multi autocomplete list element.
90
+ * Props for autocomplete create element.
67
91
  */
68
- listProps?: Omit<AutocompleteListProps, "children">;
92
+ createProps?: Omit<AutocompleteCreateProps, "children">;
69
93
  /**
70
- * Props for multi autocomplete field element.
94
+ * Props for autocomplete empty element.
71
95
  */
72
- fieldProps?: Omit<MultiAutocompleteFieldProps, "component" | "separator" | "keepPlaceholder" | "inputProps" | "children">;
96
+ emptyProps?: Omit<AutocompleteEmptyProps, "children">;
73
97
  /**
74
- * Props for multi autocomplete input element.
98
+ * Props for multi autocomplete field element.
75
99
  */
76
- inputProps?: HTMLUIProps<"input">;
100
+ fieldProps?: Omit<MultiAutocompleteFieldProps, "children" | "component" | "inputProps" | "keepPlaceholder" | "separator">;
77
101
  /**
78
102
  * Props for multi autocomplete icon element.
79
103
  */
80
104
  iconProps?: AutocompleteIconProps;
81
105
  /**
82
- * Props for multi autocomplete clear icon element.
106
+ * Props for multi autocomplete input element.
83
107
  */
84
- clearIconProps?: AutocompleteIconProps;
108
+ inputProps?: HTMLUIProps<"input">;
109
+ /**
110
+ * Props for multi autocomplete list element.
111
+ */
112
+ listProps?: Omit<AutocompleteListProps, "children">;
85
113
  /**
86
114
  * Props to be forwarded to the portal component.
87
115
  *
@@ -89,34 +117,6 @@ interface MultiAutocompleteOptions {
89
117
  *
90
118
  */
91
119
  portalProps?: Omit<PortalProps, "children">;
92
- /**
93
- * If `true`, the list element will be closed when value is selected.
94
- *
95
- * @default false
96
- */
97
- closeOnSelect?: boolean;
98
- /**
99
- * Props for autocomplete create element.
100
- */
101
- createProps?: Omit<AutocompleteCreateProps, "children">;
102
- /**
103
- * Props for autocomplete empty element.
104
- */
105
- emptyProps?: Omit<AutocompleteEmptyProps, "children">;
106
- /**
107
- * The header of the autocomplete content element.
108
- */
109
- header?: ReactNode | FC<{
110
- value: string[] | undefined;
111
- onClose: () => void;
112
- }>;
113
- /**
114
- * The footer of the autocomplete content element.
115
- */
116
- footer?: ReactNode | FC<{
117
- value: string[] | undefined;
118
- onClose: () => void;
119
- }>;
120
120
  }
121
121
  interface MultiAutocompleteProps extends ThemeProps<"MultiAutocomplete">, Omit<UseAutocompleteProps<string[]>, "closeOnSelect">, MultiAutocompleteOptions {
122
122
  }
@@ -126,7 +126,7 @@ interface MultiAutocompleteProps extends ThemeProps<"MultiAutocomplete">, Omit<U
126
126
  * @see Docs https://yamada-ui.com/components/forms/multi-autocomplete
127
127
  */
128
128
  declare const MultiAutocomplete: _yamada_ui_core.Component<"input", MultiAutocompleteProps>;
129
- interface MultiAutocompleteFieldProps extends HTMLUIProps, Pick<MultiAutocompleteProps, "component" | "separator" | "keepPlaceholder" | "inputProps"> {
129
+ interface MultiAutocompleteFieldProps extends HTMLUIProps, Pick<MultiAutocompleteProps, "component" | "inputProps" | "keepPlaceholder" | "separator"> {
130
130
  }
131
131
 
132
132
  export { MultiAutocomplete, type MultiAutocompleteProps };