Skip to content

chore: RAC storybook updates, Loader api fix #8381

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

Merged
merged 30 commits into from
Jul 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
1b1a5b4
chore: make module boundaries explicit
snowystinger Jun 10, 2025
839a311
fix s2 illustrations
snowystinger Jun 10, 2025
10f0fb9
fix lint and ts for React 18/19
snowystinger Jun 10, 2025
9d10e62
fix 16, 17
snowystinger Jun 10, 2025
f66bcf2
Merge branch 'main' into ts-more-explicit-modules
snowystinger Jun 10, 2025
10e1e2f
Merge branch 'main' into ts-more-explicit-modules
snowystinger Jun 11, 2025
b420bfc
fix return types to work with isolated modules for renderOverrides
snowystinger Jun 11, 2025
bc8f241
fix inference
snowystinger Jun 11, 2025
b499c68
chore: ts explicit module boundary RAC
snowystinger Jun 11, 2025
def0d48
remove the harder to deal with satisfies
snowystinger Jun 11, 2025
3cfc455
Merge branch 'main' into ts-RAC-explicit-modules
snowystinger Jun 11, 2025
adf8a2a
Merge branch 'main' into ts-RAC-explicit-modules
snowystinger Jun 16, 2025
0a31622
Merge branch 'main' into ts-RAC-explicit-modules
snowystinger Jun 24, 2025
f8999f6
Merge branch 'main' into ts-RAC-explicit-modules
snowystinger Jun 27, 2025
dc76b1a
revert changes to source
snowystinger Jun 27, 2025
5e103b8
fix story
snowystinger Jun 27, 2025
8821f23
add back in loader fixes
snowystinger Jun 27, 2025
e3fe809
Merge branch 'main' into ts-RAC-explicit-modules
snowystinger Jun 29, 2025
2f94e81
fix copy-pasta
snowystinger Jun 29, 2025
d3091c1
Merge branch 'ts-RAC-explicit-modules' of github.com:adobe/react-spec…
snowystinger Jun 29, 2025
7b5180e
Merge branch 'main' into ts-RAC-explicit-modules
snowystinger Jul 7, 2025
adb0b9f
Merge branch 'main' into ts-RAC-explicit-modules
snowystinger Jul 7, 2025
3762567
fix lint
snowystinger Jul 7, 2025
94198a3
review comments
snowystinger Jul 7, 2025
d768ce3
Merge branch 'main' into ts-RAC-explicit-modules
snowystinger Jul 8, 2025
b505d48
Merge branch 'main' into ts-RAC-explicit-modules
snowystinger Jul 9, 2025
8842f17
Merge branch 'main' into ts-RAC-explicit-modules
snowystinger Jul 11, 2025
004187f
fix lint
snowystinger Jul 11, 2025
290fedb
Merge branch 'main' into ts-RAC-explicit-modules
snowystinger Jul 13, 2025
73e4f01
fix story types
snowystinger Jul 13, 2025
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
2 changes: 1 addition & 1 deletion packages/react-aria-components/src/GridList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ export interface GridListLoadMoreItemProps extends Omit<LoadMoreSentinelProps, '
isLoading?: boolean
}

export const GridListLoadMoreItem = createLeafComponent('loader', function GridListLoadingIndicator<T extends object>(props: GridListLoadMoreItemProps, ref: ForwardedRef<HTMLDivElement>, item: Node<T>) {
export const GridListLoadMoreItem = createLeafComponent('loader', function GridListLoadingIndicator(props: GridListLoadMoreItemProps, ref: ForwardedRef<HTMLDivElement>, item: Node<object>) {
let state = useContext(ListStateContext)!;
let {isVirtualized} = useContext(CollectionRendererContext);
let {isLoading, onLoadMore, scrollOffset, ...otherProps} = props;
Expand Down
4 changes: 2 additions & 2 deletions packages/react-aria-components/src/ListBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ export interface ListBoxLoadMoreItemProps extends Omit<LoadMoreSentinelProps, 'c
isLoading?: boolean
}

export const ListBoxLoadMoreItem = createLeafComponent('loader', function ListBoxLoadingIndicator<T extends object>(props: ListBoxLoadMoreItemProps, ref: ForwardedRef<HTMLDivElement>, item: Node<T>) {
export const ListBoxLoadMoreItem = createLeafComponent('loader', function ListBoxLoadingIndicator(props: ListBoxLoadMoreItemProps, ref: ForwardedRef<HTMLDivElement>, item: Node<object>) {
let state = useContext(ListStateContext)!;
let {isLoading, onLoadMore, scrollOffset, ...otherProps} = props;

Expand Down Expand Up @@ -525,7 +525,7 @@ export const ListBoxLoadMoreItem = createLeafComponent('loader', function ListBo
// aria-selected isn't needed here since this option is not selectable.
// eslint-disable-next-line jsx-a11y/role-has-required-aria-props
role="option"
ref={ref}>
ref={ref as ForwardedRef<HTMLDivElement>}>
{renderProps.children}
</div>
)}
Expand Down
4 changes: 2 additions & 2 deletions packages/react-aria-components/src/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1359,7 +1359,7 @@ export interface TableLoadMoreItemProps extends Omit<LoadMoreSentinelProps, 'col
isLoading?: boolean
}

export const TableLoadMoreItem = createLeafComponent('loader', function TableLoadingIndicator<T extends object>(props: TableLoadMoreItemProps, ref: ForwardedRef<HTMLTableRowElement>, item: Node<T>) {
export const TableLoadMoreItem = createLeafComponent('loader', function TableLoadingIndicator(props: TableLoadMoreItemProps, ref: ForwardedRef<HTMLTableRowElement>, item: Node<object>) {
let state = useContext(TableStateContext)!;
let {isVirtualized} = useContext(CollectionRendererContext);
let {isLoading, onLoadMore, scrollOffset, ...otherProps} = props;
Expand Down Expand Up @@ -1411,7 +1411,7 @@ export const TableLoadMoreItem = createLeafComponent('loader', function TableLoa
{...mergeProps(filterDOMProps(props, {global: true}), rowProps)}
{...renderProps}
role="row"
ref={ref as any}>
ref={ref as ForwardedRef<HTMLTableRowElement>}>
<TD role="rowheader" {...rowHeaderProps} style={style}>
{renderProps.children}
</TD>
Expand Down
41 changes: 23 additions & 18 deletions packages/react-aria-components/stories/Autocomplete.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
*/

import {action} from '@storybook/addon-actions';
import {Autocomplete, Button, Collection, DialogTrigger, Header, Input, Keyboard, Label, ListBox, ListBoxSection, ListLayout, Popover, SearchField, Select, SelectValue, Separator, SubmenuTrigger, Text, TextField, Virtualizer} from 'react-aria-components';
import {Menu, MenuItem, MenuSection, MenuTrigger} from '../src/Menu';
import {Autocomplete, Button, Collection, DialogTrigger, Header, Input, Keyboard, Label, ListBox, ListBoxSection, ListLayout, Menu, MenuItem, MenuSection, MenuTrigger, Popover, SearchField, Select, SelectValue, Separator, SubmenuTrigger, Text, TextField, Virtualizer} from 'react-aria-components';
import {Meta, StoryObj} from '@storybook/react';
import {MyListBoxItem, MyMenuItem} from './utils';
import React from 'react';
import styles from '../example/index.css';
Expand All @@ -21,6 +21,7 @@ import {useFilter} from 'react-aria';

export default {
title: 'React Aria Components/Autocomplete',
component: Autocomplete,
args: {
onAction: action('onAction'),
selectionMode: 'multiple',
Expand All @@ -46,7 +47,11 @@ export default {
options: ['clearSelection', 'none']
}
}
};
} as Meta<typeof Autocomplete>;

export type AutocompleteStory = StoryObj<typeof Autocomplete>;
export type MenuStory = StoryObj<typeof Menu>;
export type ListBoxStory = StoryObj<typeof ListBox>;

let StaticMenu = (props) => {
return (
Expand Down Expand Up @@ -113,7 +118,7 @@ function AutocompleteWrapper(props) {
);
}

export const AutocompleteExample = {
export const AutocompleteExample: AutocompleteStory = {
render: (args) => {
return (
<AutocompleteWrapper>
Expand All @@ -131,7 +136,7 @@ export const AutocompleteExample = {
name: 'Autocomplete complex static with textfield'
};

export const AutocompleteSearchfield = {
export const AutocompleteSearchfield: AutocompleteStory = {
render: (args) => {
return (
<AutocompleteWrapper defaultInputValue="Ba">
Expand Down Expand Up @@ -289,7 +294,7 @@ let dynamicRenderFuncSections = (item: ItemNode) => {
}
};

export const AutocompleteMenuDynamic = {
export const AutocompleteMenuDynamic: AutocompleteStory = {
render: (args) => {
return (
<>
Expand All @@ -313,7 +318,7 @@ export const AutocompleteMenuDynamic = {
name: 'Autocomplete, dynamic menu'
};

export const AutocompleteOnActionOnMenuItems = {
export const AutocompleteOnActionOnMenuItems: AutocompleteStory = {
render: (args) => {
return (
<AutocompleteWrapper>
Expand Down Expand Up @@ -342,7 +347,7 @@ interface AutocompleteItem {

let items: AutocompleteItem[] = [{id: '1', name: 'Foo'}, {id: '2', name: 'Bar'}, {id: '3', name: 'Baz'}];

export const AutocompleteDisabledKeys = {
export const AutocompleteDisabledKeys: AutocompleteStory = {
render: (args) => {
return (
<AutocompleteWrapper>
Expand All @@ -362,7 +367,7 @@ export const AutocompleteDisabledKeys = {
name: 'Autocomplete, disabled key'
};

const AsyncExample = (args) => {
const AsyncExample = (args: any): React.ReactElement => {
let list = useAsyncList<AutocompleteItem>({
async load({filterText}) {
let json = await new Promise(resolve => {
Expand Down Expand Up @@ -413,7 +418,7 @@ const AsyncExample = (args) => {
);
};

export const AutocompleteAsyncLoadingExample = {
export const AutocompleteAsyncLoadingExample: StoryObj<typeof AsyncExample> = {
render: (args) => {
return <AsyncExample {...args} />;
},
Expand Down Expand Up @@ -445,14 +450,14 @@ const CaseSensitiveFilter = (args) => {
);
};

export const AutocompleteCaseSensitive = {
export const AutocompleteCaseSensitive: AutocompleteStory = {
render: (args) => {
return <CaseSensitiveFilter {...args} />;
},
name: 'Autocomplete, case sensitive filter'
};

export const AutocompleteWithListbox = {
export const AutocompleteWithListbox: AutocompleteStory = {
render: (args) => {
return (
<DialogTrigger>
Expand Down Expand Up @@ -529,7 +534,7 @@ function VirtualizedListBox(props) {
);
}

export const AutocompleteWithVirtualizedListbox = {
export const AutocompleteWithVirtualizedListbox: AutocompleteStory = {
render: (args) => {
return (
<DialogTrigger>
Expand Down Expand Up @@ -615,7 +620,7 @@ function ShellExample() {
);
}

export const AutocompleteInPopover = {
export const AutocompleteInPopover: MenuStory = {
render: () => {
return (
<MenuTrigger>
Expand Down Expand Up @@ -660,7 +665,7 @@ export const AutocompleteInPopover = {
}
};

export const AutocompleteInPopoverDialogTrigger = {
export const AutocompleteInPopoverDialogTrigger: MenuStory = {
render: () => {
return (
<DialogTrigger>
Expand Down Expand Up @@ -771,7 +776,7 @@ const MyMenu2 = () => {
);
};

export function AutocompleteWithExtraButtons() {
export function AutocompleteWithExtraButtons(): React.ReactElement {
return (
<div>
<input />
Expand All @@ -787,7 +792,7 @@ export function AutocompleteWithExtraButtons() {
// TODO: note that Space is used to select an item in a multiselect menu but that is also reserved for the
// autocomplete input field. Should we add logic to allow Space to select menu items when focus is in the Menu
// or is that a rare/unlikely use case for menus in general?
export const AutocompleteMenuInPopoverDialogTrigger = {
export const AutocompleteMenuInPopoverDialogTrigger: MenuStory = {
render: (args) => {
return (
<DialogTrigger>
Expand Down Expand Up @@ -831,7 +836,7 @@ export const AutocompleteMenuInPopoverDialogTrigger = {

let manyItems = [...Array(100)].map((_, i) => ({id: i, name: `Item ${i}`}));

export const AutocompleteSelect = () => (
export const AutocompleteSelect = (): React.ReactElement => (
<Select style={{marginBottom: 40, position: 'relative'}}>
<Label style={{display: 'block'}}>Test</Label>
<Button>
Expand Down
53 changes: 30 additions & 23 deletions packages/react-aria-components/stories/Breadcrumbs.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,31 @@
*/

import {Breadcrumb, Breadcrumbs, Link} from 'react-aria-components';
import {Meta, StoryObj} from '@storybook/react';
import React from 'react';

export default {
title: 'React Aria Components/Breadcrumbs',
component: Breadcrumbs
};
} as Meta<typeof Breadcrumbs>;

export type BreadcrumbsStory = StoryObj<typeof Breadcrumbs>;

export const BreadcrumbsExample = (args: any) => (
<Breadcrumbs {...args}>
<Breadcrumb>
<Link href="/">Home</Link>
</Breadcrumb>
<Breadcrumb>
<Link href="/react-aria">React Aria</Link>
</Breadcrumb>
<Breadcrumb>
<Link href="/react-aria">Breadcrumbs</Link>
</Breadcrumb>
</Breadcrumbs>
);
export const BreadcrumbsExample: BreadcrumbsStory = {
render: (args: any) => (
<Breadcrumbs {...args}>
<Breadcrumb>
<Link href="/">Home</Link>
</Breadcrumb>
<Breadcrumb>
<Link href="/react-aria">React Aria</Link>
</Breadcrumb>
<Breadcrumb>
<Link href="/react-aria">Breadcrumbs</Link>
</Breadcrumb>
</Breadcrumbs>
)
};

interface ItemValue {
id: string,
Expand All @@ -42,12 +47,14 @@ let items: Array<ItemValue> = [
{id: 'Breadcrumbs', url: '/react-aria/breadcrumbs'}
];

export const DynamicBreadcrumbsExample = (args: any) => (
<Breadcrumbs {...args} items={items}>
{(item: ItemValue) => (
<Breadcrumb>
<Link href={item.url}>{item.id}</Link>
</Breadcrumb>
)}
</Breadcrumbs>
);
export const DynamicBreadcrumbsExample: BreadcrumbsStory = {
render: (args: any) => (
<Breadcrumbs {...args} items={items}>
{(item: ItemValue) => (
<Breadcrumb>
<Link href={item.url}>{item.id}</Link>
</Breadcrumb>
)}
</Breadcrumbs>
)
};
24 changes: 14 additions & 10 deletions packages/react-aria-components/stories/Button.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,25 @@
import {action} from '@storybook/addon-actions';
import {Button, ProgressBar, Text} from 'react-aria-components';
import {mergeProps} from '@react-aria/utils';
import {Meta, StoryObj} from '@storybook/react';
import React, {useEffect, useRef, useState} from 'react';
import * as styles from './button-ripple.css';
import * as styles2 from './button-pending.css';

export default {
title: 'React Aria Components/Button'
};
title: 'React Aria Components/Button',
component: Button
} as Meta<typeof Button>;

export const ButtonExample = () => {
return (
export type ButtonStory = StoryObj<typeof Button>;

export const ButtonExample: ButtonStory = {
render: () => (
<Button data-testid="button-example" onPress={action('onPress')} onClick={action('onClick')}>Press me</Button>
);
)
};

export const PendingButton = {
export const PendingButton: ButtonStory = {
render: (args) => <PendingButtonExample {...args} />,
args: {
children: 'Press me'
Expand Down Expand Up @@ -79,10 +83,10 @@ function PendingButtonExample(props) {
);
}

export const RippleButtonExample = () => {
return (
export const RippleButtonExample: ButtonStory = {
render: () => (
<RippleButton data-testid="button-example">Press me</RippleButton>
);
)
};

function RippleButton(props) {
Expand Down Expand Up @@ -148,7 +152,7 @@ function ButtonPerformanceExample() {
);
}

export const ButtonPerformance = {
export const ButtonPerformance: ButtonStory = {
render: (args) => <ButtonPerformanceExample {...args} />,
parameters: {
description: {
Expand Down
Loading