@heroui/autocomplete 2.3.21 → 2.3.22

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.
@@ -34,15 +34,15 @@ var import_input = require("@heroui/input");
34
34
  var import_framer_motion = require("framer-motion");
35
35
 
36
36
  // src/use-autocomplete.ts
37
- var import_system = require("@heroui/system");
38
- var import_use_safe_layout_effect = require("@heroui/use-safe-layout-effect");
39
- var import_theme = require("@heroui/theme");
40
- var import_i18n = require("@react-aria/i18n");
41
- var import_combobox = require("@react-stately/combobox");
42
- var import_react_utils = require("@heroui/react-utils");
43
- var import_react = require("react");
44
- var import_shared_utils = require("@heroui/shared-utils");
45
37
  var import_utils = require("@react-aria/utils");
38
+ var import_shared_utils = require("@heroui/shared-utils");
39
+ var import_react = require("react");
40
+ var import_react_utils = require("@heroui/react-utils");
41
+ var import_combobox = require("@react-stately/combobox");
42
+ var import_i18n = require("@react-aria/i18n");
43
+ var import_theme = require("@heroui/theme");
44
+ var import_use_safe_layout_effect = require("@heroui/use-safe-layout-effect");
45
+ var import_system = require("@heroui/system");
46
46
  var import_combobox2 = require("@react-aria/combobox");
47
47
  var import_form = require("@heroui/form");
48
48
  var import_aria_utils = require("@heroui/aria-utils");
@@ -87,6 +87,7 @@ function useAutocomplete(originalProps) {
87
87
  errorMessage,
88
88
  onOpenChange,
89
89
  onClose,
90
+ onClear,
90
91
  isReadOnly = false,
91
92
  ...otherProps
92
93
  } = props;
@@ -300,6 +301,7 @@ function useAutocomplete(originalProps) {
300
301
  }
301
302
  state.setInputValue("");
302
303
  state.open();
304
+ onClear == null ? void 0 : onClear();
303
305
  },
304
306
  "data-visible": !!state.selectedItem || ((_a2 = state.inputValue) == null ? void 0 : _a2.length) > 0,
305
307
  className: slots.clearButton({
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import {
3
3
  autocomplete_default
4
- } from "./chunk-R4R544ZH.mjs";
5
- import "./chunk-ORFKRCF3.mjs";
4
+ } from "./chunk-FWJM6QZX.mjs";
5
+ import "./chunk-ENG265Z6.mjs";
6
6
  export {
7
7
  autocomplete_default as default
8
8
  };
@@ -1,15 +1,15 @@
1
1
  "use client";
2
2
 
3
3
  // src/use-autocomplete.ts
4
- import { mapPropsVariants, useProviderContext } from "@heroui/system";
5
- import { useSafeLayoutEffect } from "@heroui/use-safe-layout-effect";
6
- import { autocomplete } from "@heroui/theme";
7
- import { useFilter } from "@react-aria/i18n";
8
- import { useComboBoxState } from "@react-stately/combobox";
9
- import { useDOMRef } from "@heroui/react-utils";
10
- import { useEffect, useMemo, useRef } from "react";
11
- import { clsx, dataAttr, objectToDeps } from "@heroui/shared-utils";
12
4
  import { chain, mergeProps } from "@react-aria/utils";
5
+ import { clsx, dataAttr, objectToDeps } from "@heroui/shared-utils";
6
+ import { useEffect, useMemo, useRef } from "react";
7
+ import { useDOMRef } from "@heroui/react-utils";
8
+ import { useComboBoxState } from "@react-stately/combobox";
9
+ import { useFilter } from "@react-aria/i18n";
10
+ import { autocomplete } from "@heroui/theme";
11
+ import { useSafeLayoutEffect } from "@heroui/use-safe-layout-effect";
12
+ import { mapPropsVariants, useProviderContext } from "@heroui/system";
13
13
  import { useComboBox } from "@react-aria/combobox";
14
14
  import { FormContext, useSlottedContext } from "@heroui/form";
15
15
  import { ariaShouldCloseOnInteractOutside } from "@heroui/aria-utils";
@@ -54,6 +54,7 @@ function useAutocomplete(originalProps) {
54
54
  errorMessage,
55
55
  onOpenChange,
56
56
  onClose,
57
+ onClear,
57
58
  isReadOnly = false,
58
59
  ...otherProps
59
60
  } = props;
@@ -267,6 +268,7 @@ function useAutocomplete(originalProps) {
267
268
  }
268
269
  state.setInputValue("");
269
270
  state.open();
271
+ onClear == null ? void 0 : onClear();
270
272
  },
271
273
  "data-visible": !!state.selectedItem || ((_a2 = state.inputValue) == null ? void 0 : _a2.length) > 0,
272
274
  className: slots.clearButton({
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  useAutocomplete
4
- } from "./chunk-ORFKRCF3.mjs";
4
+ } from "./chunk-ENG265Z6.mjs";
5
5
 
6
6
  // src/autocomplete.tsx
7
7
  import { forwardRef } from "@heroui/system";
package/dist/index.js CHANGED
@@ -40,15 +40,15 @@ var import_input = require("@heroui/input");
40
40
  var import_framer_motion = require("framer-motion");
41
41
 
42
42
  // src/use-autocomplete.ts
43
- var import_system = require("@heroui/system");
44
- var import_use_safe_layout_effect = require("@heroui/use-safe-layout-effect");
45
- var import_theme = require("@heroui/theme");
46
- var import_i18n = require("@react-aria/i18n");
47
- var import_combobox = require("@react-stately/combobox");
48
- var import_react_utils = require("@heroui/react-utils");
49
- var import_react = require("react");
50
- var import_shared_utils = require("@heroui/shared-utils");
51
43
  var import_utils = require("@react-aria/utils");
44
+ var import_shared_utils = require("@heroui/shared-utils");
45
+ var import_react = require("react");
46
+ var import_react_utils = require("@heroui/react-utils");
47
+ var import_combobox = require("@react-stately/combobox");
48
+ var import_i18n = require("@react-aria/i18n");
49
+ var import_theme = require("@heroui/theme");
50
+ var import_use_safe_layout_effect = require("@heroui/use-safe-layout-effect");
51
+ var import_system = require("@heroui/system");
52
52
  var import_combobox2 = require("@react-aria/combobox");
53
53
  var import_form = require("@heroui/form");
54
54
  var import_aria_utils = require("@heroui/aria-utils");
@@ -93,6 +93,7 @@ function useAutocomplete(originalProps) {
93
93
  errorMessage,
94
94
  onOpenChange,
95
95
  onClose,
96
+ onClear,
96
97
  isReadOnly = false,
97
98
  ...otherProps
98
99
  } = props;
@@ -306,6 +307,7 @@ function useAutocomplete(originalProps) {
306
307
  }
307
308
  state.setInputValue("");
308
309
  state.open();
310
+ onClear == null ? void 0 : onClear();
309
311
  },
310
312
  "data-visible": !!state.selectedItem || ((_a2 = state.inputValue) == null ? void 0 : _a2.length) > 0,
311
313
  className: slots.clearButton({
package/dist/index.mjs CHANGED
@@ -1,10 +1,10 @@
1
1
  "use client";
2
2
  import {
3
3
  autocomplete_default
4
- } from "./chunk-R4R544ZH.mjs";
4
+ } from "./chunk-FWJM6QZX.mjs";
5
5
  import {
6
6
  useAutocomplete
7
- } from "./chunk-ORFKRCF3.mjs";
7
+ } from "./chunk-ENG265Z6.mjs";
8
8
 
9
9
  // src/index.ts
10
10
  import { ListboxItem, ListboxSection } from "@heroui/listbox";
@@ -105,6 +105,11 @@ interface Props<T> extends Omit<HTMLHeroUIProps<"input">, keyof ComboBoxProps<T>
105
105
  * Callback fired when the select menu is closed.
106
106
  */
107
107
  onClose?: () => void;
108
+ /**
109
+ * Callback fired when the value is cleared.
110
+ * if you pass this prop, the clear button will be shown.
111
+ */
112
+ onClear?: () => void;
108
113
  /**
109
114
  * Whether to enable virtualization of the listbox items.
110
115
  * By default, virtualization is automatically enabled when the number of items is greater than 50.
@@ -105,6 +105,11 @@ interface Props<T> extends Omit<HTMLHeroUIProps<"input">, keyof ComboBoxProps<T>
105
105
  * Callback fired when the select menu is closed.
106
106
  */
107
107
  onClose?: () => void;
108
+ /**
109
+ * Callback fired when the value is cleared.
110
+ * if you pass this prop, the clear button will be shown.
111
+ */
112
+ onClear?: () => void;
108
113
  /**
109
114
  * Whether to enable virtualization of the listbox items.
110
115
  * By default, virtualization is automatically enabled when the number of items is greater than 50.
@@ -24,15 +24,15 @@ __export(use_autocomplete_exports, {
24
24
  useAutocomplete: () => useAutocomplete
25
25
  });
26
26
  module.exports = __toCommonJS(use_autocomplete_exports);
27
- var import_system = require("@heroui/system");
28
- var import_use_safe_layout_effect = require("@heroui/use-safe-layout-effect");
29
- var import_theme = require("@heroui/theme");
30
- var import_i18n = require("@react-aria/i18n");
31
- var import_combobox = require("@react-stately/combobox");
32
- var import_react_utils = require("@heroui/react-utils");
33
- var import_react = require("react");
34
- var import_shared_utils = require("@heroui/shared-utils");
35
27
  var import_utils = require("@react-aria/utils");
28
+ var import_shared_utils = require("@heroui/shared-utils");
29
+ var import_react = require("react");
30
+ var import_react_utils = require("@heroui/react-utils");
31
+ var import_combobox = require("@react-stately/combobox");
32
+ var import_i18n = require("@react-aria/i18n");
33
+ var import_theme = require("@heroui/theme");
34
+ var import_use_safe_layout_effect = require("@heroui/use-safe-layout-effect");
35
+ var import_system = require("@heroui/system");
36
36
  var import_combobox2 = require("@react-aria/combobox");
37
37
  var import_form = require("@heroui/form");
38
38
  var import_aria_utils = require("@heroui/aria-utils");
@@ -77,6 +77,7 @@ function useAutocomplete(originalProps) {
77
77
  errorMessage,
78
78
  onOpenChange,
79
79
  onClose,
80
+ onClear,
80
81
  isReadOnly = false,
81
82
  ...otherProps
82
83
  } = props;
@@ -290,6 +291,7 @@ function useAutocomplete(originalProps) {
290
291
  }
291
292
  state.setInputValue("");
292
293
  state.open();
294
+ onClear == null ? void 0 : onClear();
293
295
  },
294
296
  "data-visible": !!state.selectedItem || ((_a2 = state.inputValue) == null ? void 0 : _a2.length) > 0,
295
297
  className: slots.clearButton({
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  useAutocomplete
4
- } from "./chunk-ORFKRCF3.mjs";
4
+ } from "./chunk-ENG265Z6.mjs";
5
5
  export {
6
6
  useAutocomplete
7
7
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@heroui/autocomplete",
3
- "version": "2.3.21",
3
+ "version": "2.3.22",
4
4
  "description": "An autocomplete combines a text input with a listbox, allowing users to filter a list of options to items matching a query.",
5
5
  "keywords": [
6
6
  "autocomplete"
@@ -32,27 +32,22 @@
32
32
  "react-dom": ">=18 || >=19.0.0-rc.0"
33
33
  },
34
34
  "dependencies": {
35
- "@react-aria/combobox": "3.12.3",
36
- "@react-aria/focus": "3.20.3",
37
- "@react-aria/i18n": "3.12.9",
38
- "@react-aria/interactions": "3.25.1",
39
- "@react-aria/utils": "3.29.0",
40
- "@react-aria/visually-hidden": "3.8.23",
41
- "@react-stately/combobox": "3.10.5",
42
- "@react-types/combobox": "3.13.5",
43
- "@react-types/shared": "3.29.1",
44
- "@heroui/aria-utils": "2.2.17",
45
- "@heroui/button": "2.2.20",
46
- "@heroui/input": "2.4.20",
47
- "@heroui/listbox": "2.3.19",
48
- "@heroui/popover": "2.3.20",
49
- "@heroui/form": "2.1.19",
50
- "@heroui/react-utils": "2.1.10",
51
- "@heroui/scroll-shadow": "2.3.13",
52
- "@heroui/shared-icons": "2.1.8",
35
+ "@react-aria/combobox": "3.12.4",
36
+ "@react-aria/i18n": "3.12.10",
37
+ "@react-aria/utils": "3.29.1",
38
+ "@react-stately/combobox": "3.10.6",
39
+ "@react-types/combobox": "3.13.6",
40
+ "@react-types/shared": "3.30.0",
41
+ "@heroui/form": "2.1.20",
42
+ "@heroui/aria-utils": "2.2.18",
43
+ "@heroui/button": "2.2.21",
44
+ "@heroui/input": "2.4.21",
45
+ "@heroui/listbox": "2.3.20",
46
+ "@heroui/popover": "2.3.21",
47
+ "@heroui/react-utils": "2.1.11",
48
+ "@heroui/scroll-shadow": "2.3.14",
49
+ "@heroui/shared-icons": "2.1.9",
53
50
  "@heroui/shared-utils": "2.1.9",
54
- "@heroui/spinner": "2.2.17",
55
- "@heroui/use-aria-button": "2.2.14",
56
51
  "@heroui/use-safe-layout-effect": "2.1.7"
57
52
  },
58
53
  "clean-package": "../../../clean-package.config.json",