Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(Autocomplete): add RAC Autocomplete docs #7784

Merged
merged 22 commits into from
Feb 22, 2025
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
128 changes: 64 additions & 64 deletions examples/rac-tailwind/src/App.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion examples/rsp-cra-18/src/AutocompleteExample.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {UNSTABLE_Autocomplete as Autocomplete, Input, Label, Menu, MenuItem, SearchField, Text, useFilter} from 'react-aria-components'
import {Autocomplete, Input, Label, Menu, MenuItem, SearchField, Text, useFilter} from 'react-aria-components'
import {classNames} from '@react-spectrum/utils';
import styles from './autocomplete.css';

Expand Down
2 changes: 1 addition & 1 deletion examples/rsp-next-ts/components/AutocompleteExample.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {UNSTABLE_Autocomplete as Autocomplete, Input, Label, Menu, MenuItem, SearchField, Text, useFilter} from 'react-aria-components'
import {Autocomplete, Input, Label, Menu, MenuItem, SearchField, Text, useFilter} from 'react-aria-components'
import {classNames} from '@react-spectrum/utils';
import React from 'react';
import styles from './autocomplete.module.css';
Expand Down
4 changes: 2 additions & 2 deletions packages/@react-aria/autocomplete/src/useAutocomplete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ export interface AutocompleteAria {
}

/**
* Provides the behavior and accessibility implementation for a autocomplete component.
* A autocomplete combines a text input with a collection, allowing users to filter the collection's contents match a query.
* Provides the behavior and accessibility implementation for an autocomplete component.
* An autocomplete combines a text input with a collection, allowing users to filter the collection's contents match a query.
* @param props - Props for the autocomplete.
* @param state - State for the autocomplete, as returned by `useAutocompleteState`.
*/
Expand Down
4 changes: 2 additions & 2 deletions packages/@react-spectrum/s2/stories/Popover.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ import Help from '../s2wf-icons/S2_Icon_HelpCircle_20_N.svg';
import Lightbulb from '../s2wf-icons/S2_Icon_Lightbulb_20_N.svg';
import type {Meta} from '@storybook/react';
import Org from '../s2wf-icons/S2_Icon_Buildings_20_N.svg';
import {Autocomplete as RACAutocomplete, useFilter} from 'react-aria-components';
import Settings from '../s2wf-icons/S2_Icon_Settings_20_N.svg';
import {style} from '../style/spectrum-theme' with {type: 'macro'};
import {UNSTABLE_Autocomplete, useFilter} from 'react-aria-components';
import User from '../s2wf-icons/S2_Icon_User_20_N.svg';
import Users from '../s2wf-icons/S2_Icon_UserGroup_20_N.svg';

Expand Down Expand Up @@ -171,7 +171,7 @@ AccountMenu.argTypes = {
function Autocomplete(props) {
let {contains} = useFilter({sensitivity: 'base'});
return (
<UNSTABLE_Autocomplete filter={contains} {...props} />
<RACAutocomplete filter={contains} {...props} />
);
}

Expand Down
6 changes: 3 additions & 3 deletions packages/@react-spectrum/s2/test/SearchField.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
* governing permissions and limitations under the License.
*/

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

describe('SearchField', () => {
Expand All @@ -24,14 +24,14 @@ describe('SearchField', () => {

it('should not apply the focus visible styles on the group when typing in the Autocomplete wrapped SearchField', async () => {
let {getByRole} = render(
<UNSTABLE_Autocomplete>
<Autocomplete>
<SearchField autoFocus label="Search" />
<Menu aria-label="test menu">
<MenuItem>Foo</MenuItem>
<MenuItem>Bar</MenuItem>
<MenuItem>Baz</MenuItem>
</Menu>
</UNSTABLE_Autocomplete>
</Autocomplete>
);

let input = getByRole('searchbox');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export interface AutocompleteProps {
export interface AutocompleteStateOptions extends Omit<AutocompleteProps, 'children'> {}

/**
* Provides state management for a autocomplete component.
* Provides state management for an autocomplete component.
*/
export function UNSTABLE_useAutocompleteState(props: AutocompleteStateOptions): AutocompleteState {
let {
Expand Down
Loading