Skip to content

Commit

Permalink
chore: remove default 'aria-label' value from Skeleton (microsoft#31970)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomi-msft committed Jul 10, 2024
1 parent 1b6cc50 commit 8cdac1a
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "chore: remove default 'aria-label' value from Skeleton and update stories",
"packageName": "@fluentui/react-skeleton",
"email": "ololubek@microsoft.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,4 @@ describe('Skeleton', () => {
const result = render(<Skeleton />);
expect(result.getByRole('progressbar').getAttribute('aria-busy')).toBeDefined();
});
it('adds a proper aria-label to Skeleton', () => {
const result = render(<Skeleton />);
expect(result.getByRole('progressbar').getAttribute('aria-label')).toEqual('Loading Content');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ exports[`Skeleton renders a default state 1`] = `
<div>
<div
aria-busy="true"
aria-label="Loading Content"
class="fui-Skeleton"
role="progressbar"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ export const useSkeleton_unstable = (props: SkeletonProps, ref: React.Ref<HTMLEl
ref: ref as React.Ref<HTMLDivElement>,
role: 'progressbar',
'aria-busy': true,
'aria-label': 'Loading Content',
...props,
}),
{ elementType: 'div' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ export const Animation = (props: Partial<SkeletonProps>) => {
return (
<div className={styles.invertedWrapper}>
<Field validationMessage="Wave animation" validationState="none">
<Skeleton {...props}>
<Skeleton {...props} aria-label="Loading Content">
<SkeletonItem />
</Skeleton>
</Field>
<Field validationMessage="Pulse animation" validationState="none">
<Skeleton {...props} animation="pulse">
<Skeleton {...props} animation="pulse" aria-label="Loading Content">
<SkeletonItem />
</Skeleton>
</Field>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ export const Appearance = (props: Partial<SkeletonProps>) => {
return (
<div className={styles.invertedWrapper}>
<Field validationMessage="Opaque Appearance" validationState="none">
<Skeleton {...props}>
<Skeleton {...props} aria-label="Loading Content">
<SkeletonItem />
</Skeleton>
</Field>
<Field validationMessage="Translucent Appearance" validationState="none">
<Skeleton {...props} appearance="translucent">
<Skeleton {...props} appearance="translucent" aria-label="Loading Content">
<SkeletonItem />
</Skeleton>
</Field>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Skeleton, SkeletonItem } from '@fluentui/react-components';
import type { SkeletonProps } from '@fluentui/react-components';

export const Default = (props: Partial<SkeletonProps>) => (
<Skeleton {...props}>
<Skeleton {...props} aria-label="Loading Content">
<SkeletonItem />
</Skeleton>
);
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const Shape = () => {
const styles = useStyles();
return (
<div className={styles.invertedWrapper}>
<Skeleton className={styles.row}>
<Skeleton className={styles.row} aria-label="Loading Content">
<SkeletonItem size={64} shape="circle" />
<SkeletonItem size={64} shape="rectangle" />
<SkeletonItem size={64} shape="square" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const Size = () => {
{SIZES.map(size => (
<div key={size} className={styles.innerWrapper}>
<Text align="center">{size}</Text>
<Skeleton>
<Skeleton aria-label="Loading Content">
<SkeletonItem size={size} />
</Skeleton>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const Row = (props: Partial<SkeletonProps>) => {
const styles = useStyles();
return (
<div className={styles.invertedWrapper}>
<Skeleton {...props}>
<Skeleton {...props} aria-label="Loading Content">
<div className={styles.firstRow}>
<SkeletonItem shape="circle" size={24} />
<SkeletonItem shape="rectangle" size={16} />
Expand Down

0 comments on commit 8cdac1a

Please sign in to comment.