Skip to content

Commit

Permalink
loading: Announce fullscreen LoadingBlanket assertively (#1916)
Browse files Browse the repository at this point in the history
  • Loading branch information
stowball authored Jan 5, 2025
1 parent ddbcf4a commit 55637c9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/itchy-coats-argue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@ag.ds-next/react': patch
---

loading: Announce `'fullscreen'` `LoadingBlanket` assertively.
4 changes: 3 additions & 1 deletion packages/react/src/loading/LoadingBlanket.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ export const LoadingBlanket = ({
<LoadingBlanketContainer fullScreen={fullScreen}>
<LoadingBlanketContent>
<LoadingDots size={fullScreen ? 'lg' : 'md'} />
<LoadingBlanketLabel>{label}</LoadingBlanketLabel>
<LoadingBlanketLabel role={fullScreen ? 'alert' : 'status'}>
{label}
</LoadingBlanketLabel>
</LoadingBlanketContent>
</LoadingBlanketContainer>
);
8 changes: 6 additions & 2 deletions packages/react/src/loading/LoadingBlanketLabel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@ import { Text } from '../text';

export type LoadingBlanketLabelProps = {
children: ReactNode;
role: 'alert' | 'status';
};

export const LoadingBlanketLabel = ({ children }: LoadingBlanketLabelProps) => (
<Text fontSize="lg" fontWeight="bold" lineHeight="heading" role="status">
export const LoadingBlanketLabel = ({
children,
role,
}: LoadingBlanketLabelProps) => (
<Text fontSize="lg" fontWeight="bold" lineHeight="heading" role={role}>
{children}
</Text>
);

0 comments on commit 55637c9

Please sign in to comment.