@react-stately/autocomplete 3.0.0-alpha.0 → 3.0.0-beta.0

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.
package/dist/import.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import {UNSTABLE_useAutocompleteState as $94680be9a48a8f2d$export$130b939e942a109d} from "./useAutocompleteState.mjs";
1
+ import {useAutocompleteState as $94680be9a48a8f2d$export$ce1595f6e1a63433} from "./useAutocompleteState.mjs";
2
2
 
3
3
  /*
4
4
  * Copyright 2024 Adobe. All rights reserved.
@@ -13,5 +13,5 @@ import {UNSTABLE_useAutocompleteState as $94680be9a48a8f2d$export$130b939e942a10
13
13
  */
14
14
 
15
15
 
16
- export {$94680be9a48a8f2d$export$130b939e942a109d as UNSTABLE_useAutocompleteState};
16
+ export {$94680be9a48a8f2d$export$ce1595f6e1a63433 as useAutocompleteState};
17
17
  //# sourceMappingURL=module.js.map
package/dist/main.js CHANGED
@@ -5,7 +5,7 @@ function $parcel$export(e, n, v, s) {
5
5
  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
6
6
  }
7
7
 
8
- $parcel$export(module.exports, "UNSTABLE_useAutocompleteState", () => $af5197e4b74cd279$exports.UNSTABLE_useAutocompleteState);
8
+ $parcel$export(module.exports, "useAutocompleteState", () => $af5197e4b74cd279$exports.useAutocompleteState);
9
9
  /*
10
10
  * Copyright 2024 Adobe. All rights reserved.
11
11
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
package/dist/main.js.map CHANGED
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC","sources":["packages/@react-stately/autocomplete/src/index.ts"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport {UNSTABLE_useAutocompleteState} from './useAutocompleteState';\n\nexport type {AutocompleteProps, AutocompleteStateOptions, AutocompleteState} from './useAutocompleteState';\n"],"names":[],"version":3,"file":"main.js.map"}
1
+ {"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC","sources":["packages/@react-stately/autocomplete/src/index.ts"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport {useAutocompleteState} from './useAutocompleteState';\n\nexport type {AutocompleteProps, AutocompleteStateOptions, AutocompleteState} from './useAutocompleteState';\n"],"names":[],"version":3,"file":"main.js.map"}
package/dist/module.js CHANGED
@@ -1,4 +1,4 @@
1
- import {UNSTABLE_useAutocompleteState as $94680be9a48a8f2d$export$130b939e942a109d} from "./useAutocompleteState.module.js";
1
+ import {useAutocompleteState as $94680be9a48a8f2d$export$ce1595f6e1a63433} from "./useAutocompleteState.module.js";
2
2
 
3
3
  /*
4
4
  * Copyright 2024 Adobe. All rights reserved.
@@ -13,5 +13,5 @@ import {UNSTABLE_useAutocompleteState as $94680be9a48a8f2d$export$130b939e942a10
13
13
  */
14
14
 
15
15
 
16
- export {$94680be9a48a8f2d$export$130b939e942a109d as UNSTABLE_useAutocompleteState};
16
+ export {$94680be9a48a8f2d$export$ce1595f6e1a63433 as useAutocompleteState};
17
17
  //# sourceMappingURL=module.js.map
@@ -1 +1 @@
1
- {"mappings":";;AAAA;;;;;;;;;;CAUC","sources":["packages/@react-stately/autocomplete/src/index.ts"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport {UNSTABLE_useAutocompleteState} from './useAutocompleteState';\n\nexport type {AutocompleteProps, AutocompleteStateOptions, AutocompleteState} from './useAutocompleteState';\n"],"names":[],"version":3,"file":"module.js.map"}
1
+ {"mappings":";;AAAA;;;;;;;;;;CAUC","sources":["packages/@react-stately/autocomplete/src/index.ts"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport {useAutocompleteState} from './useAutocompleteState';\n\nexport type {AutocompleteProps, AutocompleteStateOptions, AutocompleteState} from './useAutocompleteState';\n"],"names":[],"version":3,"file":"module.js.map"}
package/dist/types.d.ts CHANGED
@@ -22,8 +22,8 @@ export interface AutocompleteProps {
22
22
  export interface AutocompleteStateOptions extends Omit<AutocompleteProps, 'children'> {
23
23
  }
24
24
  /**
25
- * Provides state management for a autocomplete component.
25
+ * Provides state management for an autocomplete component.
26
26
  */
27
- export function UNSTABLE_useAutocompleteState(props: AutocompleteStateOptions): AutocompleteState;
27
+ export function useAutocompleteState(props: AutocompleteStateOptions): AutocompleteState;
28
28
 
29
29
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"mappings":";AAeA;IACE,mDAAmD;IACnD,UAAU,EAAE,MAAM,CAAC;IACnB,gDAAgD;IAChD,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,6EAA6E;IAC7E,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,kFAAkF;IAClF,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAA;CAC7C;AAED;IACE,wDAAwD;IACxD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kEAAkE;IAClE,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,wEAAwE;IACxE,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,0HAA0H;IAC1H,QAAQ,EAAE,SAAS,CAAA;CACpB;AAGD,yCAA0C,SAAQ,IAAI,CAAC,iBAAiB,EAAE,UAAU,CAAC;CAAG;AAExF;;GAEG;AACH,8CAA8C,KAAK,EAAE,wBAAwB,GAAG,iBAAiB,CA0BhG","sources":["packages/@react-stately/autocomplete/src/packages/@react-stately/autocomplete/src/useAutocompleteState.ts","packages/@react-stately/autocomplete/src/packages/@react-stately/autocomplete/src/index.ts","packages/@react-stately/autocomplete/src/index.ts"],"sourcesContent":[null,null,"/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport {UNSTABLE_useAutocompleteState} from './useAutocompleteState';\n\nexport type {AutocompleteProps, AutocompleteStateOptions, AutocompleteState} from './useAutocompleteState';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
1
+ {"mappings":";AAeA;IACE,mDAAmD;IACnD,UAAU,EAAE,MAAM,CAAC;IACnB,gDAAgD;IAChD,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,6EAA6E;IAC7E,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,kFAAkF;IAClF,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAA;CAC7C;AAED;IACE,wDAAwD;IACxD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kEAAkE;IAClE,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,wEAAwE;IACxE,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,0HAA0H;IAC1H,QAAQ,EAAE,SAAS,CAAA;CACpB;AAGD,yCAA0C,SAAQ,IAAI,CAAC,iBAAiB,EAAE,UAAU,CAAC;CAAG;AAExF;;GAEG;AACH,qCAAqC,KAAK,EAAE,wBAAwB,GAAG,iBAAiB,CA0BvF","sources":["packages/@react-stately/autocomplete/src/packages/@react-stately/autocomplete/src/useAutocompleteState.ts","packages/@react-stately/autocomplete/src/packages/@react-stately/autocomplete/src/index.ts","packages/@react-stately/autocomplete/src/index.ts"],"sourcesContent":[null,null,"/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport {useAutocompleteState} from './useAutocompleteState';\n\nexport type {AutocompleteProps, AutocompleteStateOptions, AutocompleteState} from './useAutocompleteState';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
@@ -6,7 +6,7 @@ function $parcel$export(e, n, v, s) {
6
6
  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
7
7
  }
8
8
 
9
- $parcel$export(module.exports, "UNSTABLE_useAutocompleteState", () => $af5197e4b74cd279$export$130b939e942a109d);
9
+ $parcel$export(module.exports, "useAutocompleteState", () => $af5197e4b74cd279$export$ce1595f6e1a63433);
10
10
  /*
11
11
  * Copyright 2024 Adobe. All rights reserved.
12
12
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
@@ -19,7 +19,7 @@ $parcel$export(module.exports, "UNSTABLE_useAutocompleteState", () => $af5197e4b
19
19
  * governing permissions and limitations under the License.
20
20
  */
21
21
 
22
- function $af5197e4b74cd279$export$130b939e942a109d(props) {
22
+ function $af5197e4b74cd279$export$ce1595f6e1a63433(props) {
23
23
  let { onInputChange: propsOnInputChange, inputValue: propsInputValue, defaultInputValue: propsDefaultInputValue = '' } = props;
24
24
  let onInputChange = (value)=>{
25
25
  if (propsOnInputChange) propsOnInputChange(value);
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC;;AAiCM,SAAS,0CAA8B,KAA+B;IAC3E,IAAI,EACF,eAAe,kBAAkB,EACjC,YAAY,eAAe,EAC3B,mBAAmB,yBAAyB,EAAE,EAC/C,GAAG;IAEJ,IAAI,gBAAgB,CAAC;QACnB,IAAI,oBACF,mBAAmB;IAEvB;IAEA,IAAI,CAAC,eAAe,iBAAiB,GAAG,CAAA,GAAA,qBAAO,EAAiB;IAChE,IAAI,CAAC,YAAY,cAAc,GAAG,CAAA,GAAA,2CAAiB,EACjD,iBACA,wBACA;IAGF,OAAO;oBACL;uBACA;uBACA;0BACA;IACF;AACF","sources":["packages/@react-stately/autocomplete/src/useAutocompleteState.ts"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {ReactNode, useState} from 'react';\nimport {useControlledState} from '@react-stately/utils';\n\nexport interface AutocompleteState {\n /** The current value of the autocomplete input. */\n inputValue: string,\n /** Sets the value of the autocomplete input. */\n setInputValue(value: string): void,\n /** The id of the current aria-activedescendant of the autocomplete input. */\n focusedNodeId: string | null,\n /** Sets the id of the current aria-activedescendant of the autocomplete input. */\n setFocusedNodeId(value: string | null): void\n}\n\nexport interface AutocompleteProps {\n /** The value of the autocomplete input (controlled). */\n inputValue?: string,\n /** The default value of the autocomplete input (uncontrolled). */\n defaultInputValue?: string,\n /** Handler that is called when the autocomplete input value changes. */\n onInputChange?: (value: string) => void,\n /** The children wrapped by the autocomplete. Consists of at least an input element and a collection element to filter. */\n children: ReactNode\n}\n\n// Emulate our other stately hooks which accept all \"base\" props even if not used\nexport interface AutocompleteStateOptions extends Omit<AutocompleteProps, 'children'> {}\n\n/**\n * Provides state management for a autocomplete component.\n */\nexport function UNSTABLE_useAutocompleteState(props: AutocompleteStateOptions): AutocompleteState {\n let {\n onInputChange: propsOnInputChange,\n inputValue: propsInputValue,\n defaultInputValue: propsDefaultInputValue = ''\n } = props;\n\n let onInputChange = (value) => {\n if (propsOnInputChange) {\n propsOnInputChange(value);\n }\n };\n\n let [focusedNodeId, setFocusedNodeId] = useState<string | null>(null);\n let [inputValue, setInputValue] = useControlledState(\n propsInputValue,\n propsDefaultInputValue!,\n onInputChange\n );\n\n return {\n inputValue,\n setInputValue,\n focusedNodeId,\n setFocusedNodeId\n };\n}\n"],"names":[],"version":3,"file":"useAutocompleteState.main.js.map"}
1
+ {"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC;;AAiCM,SAAS,0CAAqB,KAA+B;IAClE,IAAI,EACF,eAAe,kBAAkB,EACjC,YAAY,eAAe,EAC3B,mBAAmB,yBAAyB,EAAE,EAC/C,GAAG;IAEJ,IAAI,gBAAgB,CAAC;QACnB,IAAI,oBACF,mBAAmB;IAEvB;IAEA,IAAI,CAAC,eAAe,iBAAiB,GAAG,CAAA,GAAA,qBAAO,EAAiB;IAChE,IAAI,CAAC,YAAY,cAAc,GAAG,CAAA,GAAA,2CAAiB,EACjD,iBACA,wBACA;IAGF,OAAO;oBACL;uBACA;uBACA;0BACA;IACF;AACF","sources":["packages/@react-stately/autocomplete/src/useAutocompleteState.ts"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {ReactNode, useState} from 'react';\nimport {useControlledState} from '@react-stately/utils';\n\nexport interface AutocompleteState {\n /** The current value of the autocomplete input. */\n inputValue: string,\n /** Sets the value of the autocomplete input. */\n setInputValue(value: string): void,\n /** The id of the current aria-activedescendant of the autocomplete input. */\n focusedNodeId: string | null,\n /** Sets the id of the current aria-activedescendant of the autocomplete input. */\n setFocusedNodeId(value: string | null): void\n}\n\nexport interface AutocompleteProps {\n /** The value of the autocomplete input (controlled). */\n inputValue?: string,\n /** The default value of the autocomplete input (uncontrolled). */\n defaultInputValue?: string,\n /** Handler that is called when the autocomplete input value changes. */\n onInputChange?: (value: string) => void,\n /** The children wrapped by the autocomplete. Consists of at least an input element and a collection element to filter. */\n children: ReactNode\n}\n\n// Emulate our other stately hooks which accept all \"base\" props even if not used\nexport interface AutocompleteStateOptions extends Omit<AutocompleteProps, 'children'> {}\n\n/**\n * Provides state management for an autocomplete component.\n */\nexport function useAutocompleteState(props: AutocompleteStateOptions): AutocompleteState {\n let {\n onInputChange: propsOnInputChange,\n inputValue: propsInputValue,\n defaultInputValue: propsDefaultInputValue = ''\n } = props;\n\n let onInputChange = (value) => {\n if (propsOnInputChange) {\n propsOnInputChange(value);\n }\n };\n\n let [focusedNodeId, setFocusedNodeId] = useState<string | null>(null);\n let [inputValue, setInputValue] = useControlledState(\n propsInputValue,\n propsDefaultInputValue!,\n onInputChange\n );\n\n return {\n inputValue,\n setInputValue,\n focusedNodeId,\n setFocusedNodeId\n };\n}\n"],"names":[],"version":3,"file":"useAutocompleteState.main.js.map"}
@@ -13,7 +13,7 @@ import {useControlledState as $LM92H$useControlledState} from "@react-stately/ut
13
13
  * governing permissions and limitations under the License.
14
14
  */
15
15
 
16
- function $94680be9a48a8f2d$export$130b939e942a109d(props) {
16
+ function $94680be9a48a8f2d$export$ce1595f6e1a63433(props) {
17
17
  let { onInputChange: propsOnInputChange, inputValue: propsInputValue, defaultInputValue: propsDefaultInputValue = '' } = props;
18
18
  let onInputChange = (value)=>{
19
19
  if (propsOnInputChange) propsOnInputChange(value);
@@ -29,5 +29,5 @@ function $94680be9a48a8f2d$export$130b939e942a109d(props) {
29
29
  }
30
30
 
31
31
 
32
- export {$94680be9a48a8f2d$export$130b939e942a109d as UNSTABLE_useAutocompleteState};
32
+ export {$94680be9a48a8f2d$export$ce1595f6e1a63433 as useAutocompleteState};
33
33
  //# sourceMappingURL=useAutocompleteState.module.js.map
@@ -13,7 +13,7 @@ import {useControlledState as $LM92H$useControlledState} from "@react-stately/ut
13
13
  * governing permissions and limitations under the License.
14
14
  */
15
15
 
16
- function $94680be9a48a8f2d$export$130b939e942a109d(props) {
16
+ function $94680be9a48a8f2d$export$ce1595f6e1a63433(props) {
17
17
  let { onInputChange: propsOnInputChange, inputValue: propsInputValue, defaultInputValue: propsDefaultInputValue = '' } = props;
18
18
  let onInputChange = (value)=>{
19
19
  if (propsOnInputChange) propsOnInputChange(value);
@@ -29,5 +29,5 @@ function $94680be9a48a8f2d$export$130b939e942a109d(props) {
29
29
  }
30
30
 
31
31
 
32
- export {$94680be9a48a8f2d$export$130b939e942a109d as UNSTABLE_useAutocompleteState};
32
+ export {$94680be9a48a8f2d$export$ce1595f6e1a63433 as useAutocompleteState};
33
33
  //# sourceMappingURL=useAutocompleteState.module.js.map
@@ -1 +1 @@
1
- {"mappings":";;;AAAA;;;;;;;;;;CAUC;;AAiCM,SAAS,0CAA8B,KAA+B;IAC3E,IAAI,EACF,eAAe,kBAAkB,EACjC,YAAY,eAAe,EAC3B,mBAAmB,yBAAyB,EAAE,EAC/C,GAAG;IAEJ,IAAI,gBAAgB,CAAC;QACnB,IAAI,oBACF,mBAAmB;IAEvB;IAEA,IAAI,CAAC,eAAe,iBAAiB,GAAG,CAAA,GAAA,eAAO,EAAiB;IAChE,IAAI,CAAC,YAAY,cAAc,GAAG,CAAA,GAAA,yBAAiB,EACjD,iBACA,wBACA;IAGF,OAAO;oBACL;uBACA;uBACA;0BACA;IACF;AACF","sources":["packages/@react-stately/autocomplete/src/useAutocompleteState.ts"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {ReactNode, useState} from 'react';\nimport {useControlledState} from '@react-stately/utils';\n\nexport interface AutocompleteState {\n /** The current value of the autocomplete input. */\n inputValue: string,\n /** Sets the value of the autocomplete input. */\n setInputValue(value: string): void,\n /** The id of the current aria-activedescendant of the autocomplete input. */\n focusedNodeId: string | null,\n /** Sets the id of the current aria-activedescendant of the autocomplete input. */\n setFocusedNodeId(value: string | null): void\n}\n\nexport interface AutocompleteProps {\n /** The value of the autocomplete input (controlled). */\n inputValue?: string,\n /** The default value of the autocomplete input (uncontrolled). */\n defaultInputValue?: string,\n /** Handler that is called when the autocomplete input value changes. */\n onInputChange?: (value: string) => void,\n /** The children wrapped by the autocomplete. Consists of at least an input element and a collection element to filter. */\n children: ReactNode\n}\n\n// Emulate our other stately hooks which accept all \"base\" props even if not used\nexport interface AutocompleteStateOptions extends Omit<AutocompleteProps, 'children'> {}\n\n/**\n * Provides state management for a autocomplete component.\n */\nexport function UNSTABLE_useAutocompleteState(props: AutocompleteStateOptions): AutocompleteState {\n let {\n onInputChange: propsOnInputChange,\n inputValue: propsInputValue,\n defaultInputValue: propsDefaultInputValue = ''\n } = props;\n\n let onInputChange = (value) => {\n if (propsOnInputChange) {\n propsOnInputChange(value);\n }\n };\n\n let [focusedNodeId, setFocusedNodeId] = useState<string | null>(null);\n let [inputValue, setInputValue] = useControlledState(\n propsInputValue,\n propsDefaultInputValue!,\n onInputChange\n );\n\n return {\n inputValue,\n setInputValue,\n focusedNodeId,\n setFocusedNodeId\n };\n}\n"],"names":[],"version":3,"file":"useAutocompleteState.module.js.map"}
1
+ {"mappings":";;;AAAA;;;;;;;;;;CAUC;;AAiCM,SAAS,0CAAqB,KAA+B;IAClE,IAAI,EACF,eAAe,kBAAkB,EACjC,YAAY,eAAe,EAC3B,mBAAmB,yBAAyB,EAAE,EAC/C,GAAG;IAEJ,IAAI,gBAAgB,CAAC;QACnB,IAAI,oBACF,mBAAmB;IAEvB;IAEA,IAAI,CAAC,eAAe,iBAAiB,GAAG,CAAA,GAAA,eAAO,EAAiB;IAChE,IAAI,CAAC,YAAY,cAAc,GAAG,CAAA,GAAA,yBAAiB,EACjD,iBACA,wBACA;IAGF,OAAO;oBACL;uBACA;uBACA;0BACA;IACF;AACF","sources":["packages/@react-stately/autocomplete/src/useAutocompleteState.ts"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {ReactNode, useState} from 'react';\nimport {useControlledState} from '@react-stately/utils';\n\nexport interface AutocompleteState {\n /** The current value of the autocomplete input. */\n inputValue: string,\n /** Sets the value of the autocomplete input. */\n setInputValue(value: string): void,\n /** The id of the current aria-activedescendant of the autocomplete input. */\n focusedNodeId: string | null,\n /** Sets the id of the current aria-activedescendant of the autocomplete input. */\n setFocusedNodeId(value: string | null): void\n}\n\nexport interface AutocompleteProps {\n /** The value of the autocomplete input (controlled). */\n inputValue?: string,\n /** The default value of the autocomplete input (uncontrolled). */\n defaultInputValue?: string,\n /** Handler that is called when the autocomplete input value changes. */\n onInputChange?: (value: string) => void,\n /** The children wrapped by the autocomplete. Consists of at least an input element and a collection element to filter. */\n children: ReactNode\n}\n\n// Emulate our other stately hooks which accept all \"base\" props even if not used\nexport interface AutocompleteStateOptions extends Omit<AutocompleteProps, 'children'> {}\n\n/**\n * Provides state management for an autocomplete component.\n */\nexport function useAutocompleteState(props: AutocompleteStateOptions): AutocompleteState {\n let {\n onInputChange: propsOnInputChange,\n inputValue: propsInputValue,\n defaultInputValue: propsDefaultInputValue = ''\n } = props;\n\n let onInputChange = (value) => {\n if (propsOnInputChange) {\n propsOnInputChange(value);\n }\n };\n\n let [focusedNodeId, setFocusedNodeId] = useState<string | null>(null);\n let [inputValue, setInputValue] = useControlledState(\n propsInputValue,\n propsDefaultInputValue!,\n onInputChange\n );\n\n return {\n inputValue,\n setInputValue,\n focusedNodeId,\n setFocusedNodeId\n };\n}\n"],"names":[],"version":3,"file":"useAutocompleteState.module.js.map"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-stately/autocomplete",
3
- "version": "3.0.0-alpha.0",
3
+ "version": "3.0.0-beta.0",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
@@ -31,5 +31,5 @@
31
31
  "publishConfig": {
32
32
  "access": "public"
33
33
  },
34
- "gitHead": "09e7f44bebdc9d89122926b2b439a0a38a2814ea"
34
+ "gitHead": "4d3c72c94eea2d72eb3a0e7d56000c6ef7e39726"
35
35
  }
package/src/index.ts CHANGED
@@ -10,6 +10,6 @@
10
10
  * governing permissions and limitations under the License.
11
11
  */
12
12
 
13
- export {UNSTABLE_useAutocompleteState} from './useAutocompleteState';
13
+ export {useAutocompleteState} from './useAutocompleteState';
14
14
 
15
15
  export type {AutocompleteProps, AutocompleteStateOptions, AutocompleteState} from './useAutocompleteState';
@@ -39,9 +39,9 @@ export interface AutocompleteProps {
39
39
  export interface AutocompleteStateOptions extends Omit<AutocompleteProps, 'children'> {}
40
40
 
41
41
  /**
42
- * Provides state management for a autocomplete component.
42
+ * Provides state management for an autocomplete component.
43
43
  */
44
- export function UNSTABLE_useAutocompleteState(props: AutocompleteStateOptions): AutocompleteState {
44
+ export function useAutocompleteState(props: AutocompleteStateOptions): AutocompleteState {
45
45
  let {
46
46
  onInputChange: propsOnInputChange,
47
47
  inputValue: propsInputValue,