Skip to content

Commit 7df1a84

Browse files
authored
docs(Autocomplete): add RAC Autocomplete docs (#7784)
1 parent 8efed80 commit 7df1a84

File tree

18 files changed

+607
-110
lines changed

18 files changed

+607
-110
lines changed

examples/rac-tailwind/src/App.js

+64-64
Large diffs are not rendered by default.

examples/rsp-cra-18/src/AutocompleteExample.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {UNSTABLE_Autocomplete as Autocomplete, Input, Label, Menu, MenuItem, SearchField, Text, useFilter} from 'react-aria-components'
1+
import {Autocomplete, Input, Label, Menu, MenuItem, SearchField, Text, useFilter} from 'react-aria-components'
22
import {classNames} from '@react-spectrum/utils';
33
import styles from './autocomplete.css';
44

examples/rsp-next-ts/components/AutocompleteExample.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {UNSTABLE_Autocomplete as Autocomplete, Input, Label, Menu, MenuItem, SearchField, Text, useFilter} from 'react-aria-components'
1+
import {Autocomplete, Input, Label, Menu, MenuItem, SearchField, Text, useFilter} from 'react-aria-components'
22
import {classNames} from '@react-spectrum/utils';
33
import React from 'react';
44
import styles from './autocomplete.module.css';

packages/@react-aria/autocomplete/src/useAutocomplete.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ export interface AutocompleteAria {
5454
}
5555

5656
/**
57-
* Provides the behavior and accessibility implementation for a autocomplete component.
58-
* A autocomplete combines a text input with a collection, allowing users to filter the collection's contents match a query.
57+
* Provides the behavior and accessibility implementation for an autocomplete component.
58+
* An autocomplete combines a text input with a collection, allowing users to filter the collection's contents match a query.
5959
* @param props - Props for the autocomplete.
6060
* @param state - State for the autocomplete, as returned by `useAutocompleteState`.
6161
*/

packages/@react-spectrum/s2/stories/Popover.stories.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ import Help from '../s2wf-icons/S2_Icon_HelpCircle_20_N.svg';
1818
import Lightbulb from '../s2wf-icons/S2_Icon_Lightbulb_20_N.svg';
1919
import type {Meta} from '@storybook/react';
2020
import Org from '../s2wf-icons/S2_Icon_Buildings_20_N.svg';
21+
import {Autocomplete as RACAutocomplete, useFilter} from 'react-aria-components';
2122
import Settings from '../s2wf-icons/S2_Icon_Settings_20_N.svg';
2223
import {style} from '../style/spectrum-theme' with {type: 'macro'};
23-
import {UNSTABLE_Autocomplete, useFilter} from 'react-aria-components';
2424
import User from '../s2wf-icons/S2_Icon_User_20_N.svg';
2525
import Users from '../s2wf-icons/S2_Icon_UserGroup_20_N.svg';
2626

@@ -171,7 +171,7 @@ AccountMenu.argTypes = {
171171
function Autocomplete(props) {
172172
let {contains} = useFilter({sensitivity: 'base'});
173173
return (
174-
<UNSTABLE_Autocomplete filter={contains} {...props} />
174+
<RACAutocomplete filter={contains} {...props} />
175175
);
176176
}
177177

packages/@react-spectrum/s2/test/SearchField.test.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
* governing permissions and limitations under the License.
1111
*/
1212

13+
import {Autocomplete} from 'react-aria-components';
1314
import {Menu, MenuItem, SearchField} from '../src';
1415
import {pointerMap, render} from '@react-spectrum/test-utils-internal';
1516
import React from 'react';
16-
import {UNSTABLE_Autocomplete} from 'react-aria-components';
1717
import userEvent from '@testing-library/user-event';
1818

1919
describe('SearchField', () => {
@@ -24,14 +24,14 @@ describe('SearchField', () => {
2424

2525
it('should not apply the focus visible styles on the group when typing in the Autocomplete wrapped SearchField', async () => {
2626
let {getByRole} = render(
27-
<UNSTABLE_Autocomplete>
27+
<Autocomplete>
2828
<SearchField autoFocus label="Search" />
2929
<Menu aria-label="test menu">
3030
<MenuItem>Foo</MenuItem>
3131
<MenuItem>Bar</MenuItem>
3232
<MenuItem>Baz</MenuItem>
3333
</Menu>
34-
</UNSTABLE_Autocomplete>
34+
</Autocomplete>
3535
);
3636

3737
let input = getByRole('searchbox');

packages/@react-stately/autocomplete/src/useAutocompleteState.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export interface AutocompleteProps {
3939
export interface AutocompleteStateOptions extends Omit<AutocompleteProps, 'children'> {}
4040

4141
/**
42-
* Provides state management for a autocomplete component.
42+
* Provides state management for an autocomplete component.
4343
*/
4444
export function UNSTABLE_useAutocompleteState(props: AutocompleteStateOptions): AutocompleteState {
4545
let {

0 commit comments

Comments
 (0)