Skip to content

Commit

Permalink
badge demos renamed
Browse files Browse the repository at this point in the history
  • Loading branch information
christophermorin committed Sep 22, 2023
1 parent bb5285b commit b3f41d1
Show file tree
Hide file tree
Showing 17 changed files with 80 additions and 80 deletions.
8 changes: 4 additions & 4 deletions docs/data/base/components/badge/AccessibleBadges.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import { styled } from '@mui/system';
import { Badge, badgeClasses } from '@mui/base/Badge';
import { Badge as BaseBadge, badgeClasses } from '@mui/base/Badge';
import MailIcon from '@mui/icons-material/Mail';

function notificationsLabel(count) {
Expand All @@ -16,9 +16,9 @@ function notificationsLabel(count) {
export default function AccessibleBadges() {
return (
<div aria-label={notificationsLabel(100)}>
<StyledBadge badgeContent={100}>
<Badge badgeContent={100}>
<MailIcon />
</StyledBadge>
</Badge>
</div>
);
}
Expand All @@ -31,7 +31,7 @@ const grey = {
900: '#24292f',
};

const StyledBadge = styled(Badge)(
const Badge = styled(BaseBadge)(
({ theme }) => `
box-sizing: border-box;
margin: 0;
Expand Down
8 changes: 4 additions & 4 deletions docs/data/base/components/badge/AccessibleBadges.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import { styled } from '@mui/system';
import { Badge, badgeClasses } from '@mui/base/Badge';
import { Badge as BaseBadge, badgeClasses } from '@mui/base/Badge';
import MailIcon from '@mui/icons-material/Mail';

function notificationsLabel(count: number) {
Expand All @@ -16,9 +16,9 @@ function notificationsLabel(count: number) {
export default function AccessibleBadges() {
return (
<div aria-label={notificationsLabel(100)}>
<StyledBadge badgeContent={100}>
<Badge badgeContent={100}>
<MailIcon />
</StyledBadge>
</Badge>
</div>
);
}
Expand All @@ -31,7 +31,7 @@ const grey = {
900: '#24292f',
};

const StyledBadge = styled(Badge)(
const Badge = styled(BaseBadge)(
({ theme }) => `
box-sizing: border-box;
margin: 0;
Expand Down
4 changes: 2 additions & 2 deletions docs/data/base/components/badge/AccessibleBadges.tsx.preview
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<StyledBadge badgeContent={100}>
<Badge badgeContent={100}>
<MailIcon />
</StyledBadge>
</Badge>
16 changes: 8 additions & 8 deletions docs/data/base/components/badge/BadgeMax.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import * as React from 'react';
import Stack from '@mui/material/Stack';
import { styled } from '@mui/system';
import { Badge, badgeClasses } from '@mui/base/Badge';
import { Badge as BaseBadge, badgeClasses } from '@mui/base/Badge';
import MailIcon from '@mui/icons-material/Mail';

export default function BadgeMax() {
return (
<Stack spacing={4} direction="row">
<StyledBadge badgeContent={99}>
<Badge badgeContent={99}>
<MailIcon />
</StyledBadge>
<StyledBadge badgeContent={100}>
</Badge>
<Badge badgeContent={100}>
<MailIcon />
</StyledBadge>
<StyledBadge badgeContent={1000} max={999}>
</Badge>
<Badge badgeContent={1000} max={999}>
<MailIcon />
</StyledBadge>
</Badge>
</Stack>
);
}
Expand All @@ -28,7 +28,7 @@ const grey = {
900: '#24292f',
};

const StyledBadge = styled(Badge)(
const Badge = styled(BaseBadge)(
({ theme }) => `
box-sizing: border-box;
margin: 0;
Expand Down
16 changes: 8 additions & 8 deletions docs/data/base/components/badge/BadgeMax.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import * as React from 'react';
import Stack from '@mui/material/Stack';
import { styled } from '@mui/system';
import { Badge, badgeClasses } from '@mui/base/Badge';
import { Badge as BaseBadge, badgeClasses } from '@mui/base/Badge';
import MailIcon from '@mui/icons-material/Mail';

export default function BadgeMax() {
return (
<Stack spacing={4} direction="row">
<StyledBadge badgeContent={99}>
<Badge badgeContent={99}>
<MailIcon />
</StyledBadge>
<StyledBadge badgeContent={100}>
</Badge>
<Badge badgeContent={100}>
<MailIcon />
</StyledBadge>
<StyledBadge badgeContent={1000} max={999}>
</Badge>
<Badge badgeContent={1000} max={999}>
<MailIcon />
</StyledBadge>
</Badge>
</Stack>
);
}
Expand All @@ -28,7 +28,7 @@ const grey = {
900: '#24292f',
};

const StyledBadge = styled(Badge)(
const Badge = styled(BaseBadge)(
({ theme }) => `
box-sizing: border-box;
margin: 0;
Expand Down
12 changes: 6 additions & 6 deletions docs/data/base/components/badge/BadgeMax.tsx.preview
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<StyledBadge badgeContent={99}>
<Badge badgeContent={99}>
<MailIcon />
</StyledBadge>
<StyledBadge badgeContent={100}>
</Badge>
<Badge badgeContent={100}>
<MailIcon />
</StyledBadge>
<StyledBadge badgeContent={1000} max={999}>
</Badge>
<Badge badgeContent={1000} max={999}>
<MailIcon />
</StyledBadge>
</Badge>
12 changes: 6 additions & 6 deletions docs/data/base/components/badge/BadgeVisibility.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react';
import Box from '@mui/material/Box';
import { styled } from '@mui/system';
import { Badge, badgeClasses } from '@mui/base/Badge';
import { Badge as BaseBadge, badgeClasses } from '@mui/base/Badge';
import ButtonGroup from '@mui/material/ButtonGroup';
import Button from '@mui/material/Button';
import AddIcon from '@mui/icons-material/Add';
Expand Down Expand Up @@ -33,9 +33,9 @@ export default function BadgeVisibility() {
}}
>
<div>
<StyledBadge badgeContent={count}>
<Badge badgeContent={count}>
<MailIcon />
</StyledBadge>
</Badge>
<ButtonGroup>
<Button
aria-label="reduce"
Expand All @@ -56,9 +56,9 @@ export default function BadgeVisibility() {
</ButtonGroup>
</div>
<div>
<StyledBadge badgeContent={count} invisible={invisible}>
<Badge badgeContent={count} invisible={invisible}>
<MailIcon />
</StyledBadge>
</Badge>
<FormControlLabel
sx={{ color: 'text.primary' }}
control={<Switch checked={!invisible} onChange={handleBadgeVisibility} />}
Expand All @@ -77,7 +77,7 @@ const grey = {
900: '#24292f',
};

const StyledBadge = styled(Badge)(
const Badge = styled(BaseBadge)(
({ theme }) => `
box-sizing: border-box;
margin: 0;
Expand Down
12 changes: 6 additions & 6 deletions docs/data/base/components/badge/BadgeVisibility.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react';
import Box from '@mui/material/Box';
import { styled } from '@mui/system';
import { Badge, badgeClasses } from '@mui/base/Badge';
import { Badge as BaseBadge, badgeClasses } from '@mui/base/Badge';
import ButtonGroup from '@mui/material/ButtonGroup';
import Button from '@mui/material/Button';
import AddIcon from '@mui/icons-material/Add';
Expand Down Expand Up @@ -33,9 +33,9 @@ export default function BadgeVisibility() {
}}
>
<div>
<StyledBadge badgeContent={count}>
<Badge badgeContent={count}>
<MailIcon />
</StyledBadge>
</Badge>
<ButtonGroup>
<Button
aria-label="reduce"
Expand All @@ -56,9 +56,9 @@ export default function BadgeVisibility() {
</ButtonGroup>
</div>
<div>
<StyledBadge badgeContent={count} invisible={invisible}>
<Badge badgeContent={count} invisible={invisible}>
<MailIcon />
</StyledBadge>
</Badge>
<FormControlLabel
sx={{ color: 'text.primary' }}
control={<Switch checked={!invisible} onChange={handleBadgeVisibility} />}
Expand All @@ -77,7 +77,7 @@ const grey = {
900: '#24292f',
};

const StyledBadge = styled(Badge)(
const Badge = styled(BaseBadge)(
({ theme }) => `
box-sizing: border-box;
margin: 0;
Expand Down
12 changes: 6 additions & 6 deletions docs/data/base/components/badge/ShowZeroBadge.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import * as React from 'react';
import Stack from '@mui/material/Stack';
import { styled } from '@mui/system';
import { Badge, badgeClasses } from '@mui/base/Badge';
import { Badge as BaseBadge, badgeClasses } from '@mui/base/Badge';
import MailIcon from '@mui/icons-material/Mail';

export default function ShowZeroBadge() {
return (
<Stack spacing={4} direction="row">
<StyledBadge badgeContent={0}>
<Badge badgeContent={0}>
<MailIcon />
</StyledBadge>
<StyledBadge badgeContent={0} showZero>
</Badge>
<Badge badgeContent={0} showZero>
<MailIcon />
</StyledBadge>
</Badge>
</Stack>
);
}
Expand All @@ -26,7 +26,7 @@ const grey = {
900: '#24292f',
};

const StyledBadge = styled(Badge)(
const Badge = styled(BaseBadge)(
({ theme }) => `
box-sizing: border-box;
margin: 0;
Expand Down
12 changes: 6 additions & 6 deletions docs/data/base/components/badge/ShowZeroBadge.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import * as React from 'react';
import Stack from '@mui/material/Stack';
import { styled } from '@mui/system';
import { Badge, badgeClasses } from '@mui/base/Badge';
import { Badge as BaseBadge, badgeClasses } from '@mui/base/Badge';
import MailIcon from '@mui/icons-material/Mail';

export default function ShowZeroBadge() {
return (
<Stack spacing={4} direction="row">
<StyledBadge badgeContent={0}>
<Badge badgeContent={0}>
<MailIcon />
</StyledBadge>
<StyledBadge badgeContent={0} showZero>
</Badge>
<Badge badgeContent={0} showZero>
<MailIcon />
</StyledBadge>
</Badge>
</Stack>
);
}
Expand All @@ -26,7 +26,7 @@ const grey = {
900: '#24292f',
};

const StyledBadge = styled(Badge)(
const Badge = styled(BaseBadge)(
({ theme }) => `
box-sizing: border-box;
margin: 0;
Expand Down
8 changes: 4 additions & 4 deletions docs/data/base/components/badge/ShowZeroBadge.tsx.preview
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<StyledBadge badgeContent={0}>
<Badge badgeContent={0}>
<MailIcon />
</StyledBadge>
<StyledBadge badgeContent={0} showZero>
</Badge>
<Badge badgeContent={0} showZero>
<MailIcon />
</StyledBadge>
</Badge>
8 changes: 4 additions & 4 deletions docs/data/base/components/badge/UnstyledBadge/system/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import { styled, Box } from '@mui/system';
import { Badge, badgeClasses } from '@mui/base/Badge';
import { Badge as BaseBadge, badgeClasses } from '@mui/base/Badge';

function BadgeContent() {
return (
Expand All @@ -21,9 +21,9 @@ function BadgeContent() {

export default function UnstyledBadge() {
return (
<StyledBadge badgeContent={5}>
<Badge badgeContent={5}>
<BadgeContent />
</StyledBadge>
</Badge>
);
}

Expand All @@ -37,7 +37,7 @@ const grey = {
900: '#24292f',
};

const StyledBadge = styled(Badge)(
const Badge = styled(BaseBadge)(
({ theme }) => `
box-sizing: border-box;
margin: 0;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import { styled, Box } from '@mui/system';
import { Badge, badgeClasses } from '@mui/base/Badge';
import { Badge as BaseBadge, badgeClasses } from '@mui/base/Badge';

function BadgeContent() {
return (
Expand All @@ -21,9 +21,9 @@ function BadgeContent() {

export default function UnstyledBadge() {
return (
<StyledBadge badgeContent={5}>
<Badge badgeContent={5}>
<BadgeContent />
</StyledBadge>
</Badge>
);
}

Expand All @@ -37,7 +37,7 @@ const grey = {
900: '#24292f',
};

const StyledBadge = styled(Badge)(
const Badge = styled(BaseBadge)(
({ theme }) => `
box-sizing: border-box;
margin: 0;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<StyledBadge badgeContent={5}>
<Badge badgeContent={5}>
<BadgeContent />
</StyledBadge>
</Badge>
Loading

0 comments on commit b3f41d1

Please sign in to comment.