Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
5 changes: 4 additions & 1 deletion packages/@react-spectrum/s2/src/Disclosure.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,10 @@ const panelStyles = style({
font: 'body',
height: '--disclosure-panel-height',
overflow: 'clip',
transition: '[height]'
transition: {
default: '[height]',
'@media (prefers-reduced-motion: reduce)': 'none'
}
});

const panelInner = style({
Expand Down
4 changes: 4 additions & 0 deletions packages/dev/s2-docs/pages/react-aria/SegmentedControl.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
border-radius: 8px;
background: var(--gray-50);
outline: 2px solid var(--gray-600);

@media (prefers-reduced-motion: reduce) {
transition: none;
}
}

.segmented-control-item {
Expand Down
4 changes: 4 additions & 0 deletions packages/react-aria-components/docs/Disclosure.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ import {ChevronRight} from 'lucide-react';
height: var(--disclosure-panel-height);
transition: height 250ms;
overflow: clip;

@media (prefers-reduced-motion: reduce) {
transition: none;
}
}
```

Expand Down
4 changes: 4 additions & 0 deletions packages/react-aria-components/docs/Tabs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ import {Tabs, TabList, Tab, TabPanel, SelectionIndicator} from 'react-aria-compo
position: absolute;
transition-property: translate, width, height;
transition-duration: 200ms;

@media (prefers-reduced-motion: reduce) {
transition: none;
}
}

&[data-hovered],
Expand Down
4 changes: 4 additions & 0 deletions packages/react-aria-components/docs/ToggleButtonGroup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,10 @@ import {ToggleButtonGroup, ToggleButton, SelectionIndicator} from 'react-aria-co
border-radius: 8px;
background: var(--gray-50);
outline: 2px solid var(--gray-600);

@media (prefers-reduced-motion: reduce) {
transition: none;
}
}

.react-aria-ToggleButton {
Expand Down
4 changes: 4 additions & 0 deletions starters/docs/src/Disclosure.css
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,8 @@
height: var(--disclosure-panel-height);
transition: height 250ms;
overflow: clip;

@media (prefers-reduced-motion: reduce) {
transition: none;
}
}
4 changes: 4 additions & 0 deletions starters/docs/src/Tabs.css
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@
position: absolute;
transition-property: translate, width, height;
transition-duration: 200ms;

@media (prefers-reduced-motion: reduce) {
transition: none;
}
}

&[data-selected] {
Expand Down
2 changes: 1 addition & 1 deletion starters/tailwind/src/Disclosure.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export interface DisclosurePanelProps extends AriaDisclosurePanelProps {

export function DisclosurePanel({ children, ...props }: DisclosurePanelProps) {
return (
<AriaDisclosurePanel {...props} className={composeTailwindRenderProps(props.className, 'h-(--disclosure-panel-height) transition-[height] overflow-clip')}>
<AriaDisclosurePanel {...props} className={composeTailwindRenderProps(props.className, 'h-(--disclosure-panel-height) motion-safe:transition-[height] overflow-clip')}>
<div className="px-4 py-2">{children}</div>
</AriaDisclosurePanel>
);
Expand Down
2 changes: 1 addition & 1 deletion starters/tailwind/src/Tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export function Tab(props: TabProps) {
)}>
{composeRenderProps(props.children, children => (<>
{children}
<SelectionIndicator className="absolute top-0 left-0 w-full h-full z-10 bg-white rounded-full mix-blend-difference transition-[translate,width,height]" />
<SelectionIndicator className="absolute top-0 left-0 w-full h-full z-10 bg-white rounded-full mix-blend-difference motion-safe:transition-[translate,width,height] " />
</>))}
</RACTab>
);
Expand Down