Skip to content
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

[Joy] Add template UIs & first look blog post #32791

Merged
merged 178 commits into from
Jun 7, 2022
Merged
Show file tree
Hide file tree
Changes from 176 commits
Commits
Show all changes
178 commits
Select commit Hold shift + click to select a range
b409692
create files
danilo-leal May 17, 2022
31561df
fix display name logic
siriwatknp May 17, 2022
3052409
add blank pages
siriwatknp May 17, 2022
675c32c
add layout to email
siriwatknp May 17, 2022
f6e023c
starting to set up the list component
danilo-leal May 18, 2022
9ee7502
add categories
danilo-leal May 18, 2022
269720b
change mock text
danilo-leal May 18, 2022
cab8873
add list
danilo-leal May 18, 2022
1465952
add basic header
danilo-leal May 18, 2022
109a0a1
tweaking
danilo-leal May 18, 2022
40102fe
arranging icons
danilo-leal May 18, 2022
670643d
color improvements
danilo-leal May 18, 2022
070dd7f
further color tweaks
danilo-leal May 18, 2022
3fac042
start email body
danilo-leal May 18, 2022
eca8815
evolving with the email body
danilo-leal May 18, 2022
268eb8c
use '
danilo-leal May 18, 2022
f759681
adjusting buttons size
danilo-leal May 18, 2022
781ca1b
redesign typographic scale
danilo-leal May 18, 2022
30ceda9
fix lint
danilo-leal May 18, 2022
0f287f4
yarn proptypes
danilo-leal May 18, 2022
d769960
innit blog post
danilo-leal May 18, 2022
a878c61
first draft
danilo-leal May 18, 2022
01cb411
making progress on the blog writing
danilo-leal May 18, 2022
3e02471
blog post continuation
danilo-leal May 19, 2022
da8f09e
continue adding the UI
danilo-leal May 19, 2022
82158aa
iterating on colors
danilo-leal May 19, 2022
ada0ef0
Merge branch 'master' of https://github.com/mui/material-ui into joy-…
siriwatknp May 20, 2022
518ff6d
update search
siriwatknp May 20, 2022
ed3f8e1
add font and dark mode button
siriwatknp May 20, 2022
29b641d
Merge branch 'joy-example-uis' of https://github.com/danilo-leal/mate…
danilo-leal May 20, 2022
899aea9
continue email layout
danilo-leal May 20, 2022
eb149a6
adding common palette
danilo-leal May 20, 2022
b0e40a2
general adjustments
danilo-leal May 20, 2022
8b7d3de
adding a custom token
danilo-leal May 20, 2022
612bac7
color iteration
danilo-leal May 24, 2022
7e3cef3
further completion of the ui
danilo-leal May 24, 2022
44fb6a8
continue blog post
danilo-leal May 24, 2022
2727298
change publication date
danilo-leal May 24, 2022
a429f2e
extend typography component
danilo-leal May 24, 2022
f1d72e1
fine adjustments
danilo-leal May 24, 2022
70fbcec
yarn proptypes
danilo-leal May 24, 2022
46d7257
Merge branch 'master' of https://github.com/mui/material-ui into joy-…
siriwatknp May 24, 2022
a9e53b3
use Card
siriwatknp May 24, 2022
3d71bb7
refactor and split into components
siriwatknp May 24, 2022
e90302b
fix tests and typings
siriwatknp May 24, 2022
17ccdc3
augment palette background
siriwatknp May 24, 2022
6f35d1d
run proptypes
siriwatknp May 24, 2022
46cec4b
fix spec
siriwatknp May 24, 2022
abcabe7
Merge branch 'master' of https://github.com/mui/material-ui into joy-…
siriwatknp May 27, 2022
00b9e06
remove unnecessary customization
siriwatknp May 27, 2022
adf0487
Merge branch 'master' of https://github.com/mui/material-ui into joy-…
siriwatknp May 28, 2022
ba9f205
extract to layout
siriwatknp May 28, 2022
c301e0c
add initial team example
siriwatknp May 28, 2022
ed9f4ac
add Slider to team example
siriwatknp May 28, 2022
b350b31
add Files example
siriwatknp May 28, 2022
4c6cf1b
update FilesNav
siriwatknp May 28, 2022
d6a932d
Merge branch 'master' of https://github.com/mui/material-ui into joy-…
siriwatknp May 29, 2022
239856a
use textColor props
siriwatknp May 29, 2022
3505fd3
title change
danilo-leal May 30, 2022
97eb59b
continue adjusting example UIs
danilo-leal May 30, 2022
bcfb529
customizing the files example UI
danilo-leal May 30, 2022
90effa3
files ui tweaks
danilo-leal May 30, 2022
fbe4d7a
side nav of the teams UI
danilo-leal May 30, 2022
38089e7
tweaks to the teams UI
danilo-leal May 30, 2022
813835d
Sam's and Matt's review
danilo-leal May 30, 2022
fb03cde
change the files name
danilo-leal May 30, 2022
aa7a9f6
add images to blog post
danilo-leal May 30, 2022
7b85b41
ending note iteration
danilo-leal May 30, 2022
baf59a2
line breaks
danilo-leal May 30, 2022
b554a54
change ui example name
danilo-leal May 30, 2022
2995eb7
remove unused imports
danilo-leal May 31, 2022
212da02
typo
danilo-leal May 31, 2022
610c994
fix lint
danilo-leal May 31, 2022
19717f6
add more font weights
danilo-leal May 31, 2022
edb080e
change Button's font sizes and weight
danilo-leal May 31, 2022
00c0775
iterate a bit more on colors
danilo-leal May 31, 2022
e62d649
documentation tweaks
danilo-leal May 31, 2022
58144b5
yearn docs:typescript:formatted
danilo-leal May 31, 2022
684d287
add createJoyTemplate to code sandbox
siriwatknp May 31, 2022
3fa21fc
add raw-loader to read raw templates
siriwatknp May 31, 2022
ad3be13
add templates index page
siriwatknp May 31, 2022
c8fc67d
move email from experiments to templates
siriwatknp May 31, 2022
b4929a6
add description as github location
siriwatknp May 31, 2022
f118e88
move team example to templates
siriwatknp May 31, 2022
7e6d768
move files example to templates
siriwatknp May 31, 2022
ea55e0b
update template thumbnail
siriwatknp May 31, 2022
ba7142e
cleanup experiments
siriwatknp May 31, 2022
7c529d8
adjust thumbnail ratio
siriwatknp May 31, 2022
d644276
exclude Template collection from visual regrssion
siriwatknp May 31, 2022
409e1d5
feat(button): default text decoration as none
siriwatknp Jun 1, 2022
faadde8
adjust layout
siriwatknp Jun 1, 2022
08489b3
add Menu to examples
siriwatknp Jun 1, 2022
9dbc002
update typo link
siriwatknp Jun 1, 2022
24bda7b
fix icon button display
siriwatknp Jun 1, 2022
001a1b0
move Core features articles inside the Getting started folder
danilo-leal Jun 1, 2022
fea18bb
tweaks to the menu
danilo-leal Jun 1, 2022
82bc29a
change Button's default font weight
danilo-leal Jun 1, 2022
2003a12
update email mock content
danilo-leal Jun 1, 2022
0275fcb
adjust responsive email content
danilo-leal Jun 1, 2022
1c6530d
tweaks to the Templates page
danilo-leal Jun 1, 2022
4edd421
move the Templates page over to the Getting started folder
danilo-leal Jun 1, 2022
c5f6c29
iterating on the blog post
danilo-leal Jun 1, 2022
f958c2e
fix URLs
danilo-leal Jun 1, 2022
fd14f09
more iteration on the blog post
danilo-leal Jun 1, 2022
7f2553c
a little bit more of iteration
danilo-leal Jun 1, 2022
1e5d7c9
fix menu links
danilo-leal Jun 1, 2022
82d0721
change bg name
danilo-leal Jun 1, 2022
994f672
bg name
danilo-leal Jun 1, 2022
0cd8780
fix lint
danilo-leal Jun 1, 2022
5bb4988
typescript formatted
danilo-leal Jun 1, 2022
9f9eb59
link global variants
danilo-leal Jun 2, 2022
37329ba
add blog post to templates
danilo-leal Jun 2, 2022
25a5952
add emoji
danilo-leal Jun 2, 2022
e19b531
fix aspect ratio demo
danilo-leal Jun 2, 2022
562e569
trim up copywriting
danilo-leal Jun 2, 2022
05efd6b
edit blog post copywriting
danilo-leal Jun 2, 2022
70b6959
more copywriting editing
danilo-leal Jun 2, 2022
523b677
separating paragraphs
danilo-leal Jun 2, 2022
a00f28b
add code example
siriwatknp Jun 2, 2022
3b1dc65
Merge branch 'joy-example-uis' of github.com:danilo-leal/material-ui …
siriwatknp Jun 2, 2022
a40fc6a
add chip and checkbox GlobalVariantComponents
siriwatknp Jun 2, 2022
c170ea8
update snippet
siriwatknp Jun 2, 2022
87d7a01
update images
danilo-leal Jun 2, 2022
a9b0efd
global varians illustration
danilo-leal Jun 2, 2022
58133b3
neglect a demo from visual regression
siriwatknp Jun 2, 2022
cc380a1
add component integration illustration
danilo-leal Jun 2, 2022
726d9a9
Merge branch 'joy-example-uis' of https://github.com/danilo-leal/mate…
danilo-leal Jun 2, 2022
73055fb
add id to toggle button
siriwatknp Jun 2, 2022
c5a5740
remove js files
siriwatknp Jun 2, 2022
1690e5c
init generateTemplateScreenshot script
siriwatknp Jun 2, 2022
68fb959
ignore templates for formatting TS demos
siriwatknp Jun 2, 2022
f5fa0cf
fix ignore logic
siriwatknp Jun 2, 2022
586059a
Merge branch 'master' of https://github.com/mui/material-ui into joy-…
siriwatknp Jun 2, 2022
13f7537
remove shadow
siriwatknp Jun 2, 2022
f92b7f7
fix script
siriwatknp Jun 2, 2022
2d3e988
save screenshots
siriwatknp Jun 2, 2022
738bcf2
simplify logiv
siriwatknp Jun 2, 2022
d9aec96
fix logic
siriwatknp Jun 2, 2022
5aac76a
update screenshots and template collection page
siriwatknp Jun 2, 2022
479ed0d
use jpg
siriwatknp Jun 2, 2022
9feec28
replace with jpg
siriwatknp Jun 2, 2022
70baea2
optimize images
siriwatknp Jun 2, 2022
d5f4f02
use jpg
siriwatknp Jun 2, 2022
cc2a255
save screenshots
siriwatknp Jun 2, 2022
bef1fbe
fix test
siriwatknp Jun 3, 2022
2f96800
Merge branch 'master' of https://github.com/mui/material-ui into joy-…
siriwatknp Jun 5, 2022
a885bf3
remove temporary slider and use Joy slider
siriwatknp Jun 5, 2022
9c2fe5a
Marija's review
danilo-leal Jun 6, 2022
3b6790d
Sam's and Matt's review
danilo-leal Jun 6, 2022
6c6eb3b
more reviews
danilo-leal Jun 6, 2022
16ef0a3
fix a few styles
danilo-leal Jun 6, 2022
6e2d805
Matt's review on other files
danilo-leal Jun 6, 2022
2fbc821
documentation tweaks
danilo-leal Jun 6, 2022
f640e99
fix example uis background color
danilo-leal Jun 6, 2022
69f0dad
add "common" background color variant
danilo-leal Jun 6, 2022
f6a0271
documentation general design revision
danilo-leal Jun 6, 2022
ea07fba
ignore joy usage regression
siriwatknp Jun 6, 2022
7a903cd
fix slider and regenerate template screenshots
siriwatknp Jun 6, 2022
b7a4414
minor adjustment
siriwatknp Jun 6, 2022
2b121aa
Merge branch 'master' of https://github.com/mui/material-ui into joy-…
danilo-leal Jun 6, 2022
23b26c3
Merge branch 'joy-example-uis' of https://github.com/danilo-leal/mate…
danilo-leal Jun 6, 2022
354648a
fix avatars
siriwatknp Jun 6, 2022
160fb7f
capture new screenshots
siriwatknp Jun 6, 2022
b299a26
Merge branch 'joy-example-uis' of github.com:danilo-leal/material-ui …
siriwatknp Jun 6, 2022
3e1d1cc
change release date
danilo-leal Jun 7, 2022
ddf748e
iterating on the dark mode paragraph
danilo-leal Jun 7, 2022
0a16f7a
clean up
danilo-leal Jun 7, 2022
6d08698
fix test
siriwatknp Jun 7, 2022
c38f50f
redirect joy-ui to overview page in development
siriwatknp Jun 7, 2022
7f176bd
change background.common to surface
siriwatknp Jun 7, 2022
166429a
remove toolbar from usage & variables demos
siriwatknp Jun 7, 2022
046b2f9
remove toolbar from chip variables demo
siriwatknp Jun 7, 2022
082d28f
Merge branch 'master' of https://github.com/mui/material-ui into joy-…
danilo-leal Jun 7, 2022
151d371
Merge branch 'joy-example-uis' of https://github.com/danilo-leal/mate…
danilo-leal Jun 7, 2022
1841c30
fix menu a11y
siriwatknp Jun 7, 2022
c2c115d
Merge branch 'joy-example-uis' of github.com:danilo-leal/material-ui …
siriwatknp Jun 7, 2022
f854279
change title to be consistent with docs
danilo-leal Jun 7, 2022
e8c2875
Merge branch 'joy-example-uis' of https://github.com/danilo-leal/mate…
danilo-leal Jun 7, 2022
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
8 changes: 3 additions & 5 deletions docs/data/joy/components/aspect-ratio/FlexRowRatio.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import Sheet from '@mui/joy/Sheet';
export default function FlexRowRatio() {
const [flexBasis, setFlexBasis] = React.useState(200);
return (
<Box sx={{ display: 'flex', alignItems: 'center', gap: 2 }}>
<Box sx={{ display: 'flex', flexDirection: 'column', alignItems: 'center' }}>
<Sheet
variant="outlined"
sx={{
Expand All @@ -32,9 +32,7 @@ export default function FlexRowRatio() {
/>
</AspectRatio>
<Box>
<Typography mb={1} fontWeight="md">
Yosemite National Park
</Typography>
<Typography fontWeight="md">Yosemite National Park</Typography>
<Typography level="body2">California, USA</Typography>
</Box>
</Sheet>
Expand All @@ -47,7 +45,7 @@ export default function FlexRowRatio() {
type="number"
value={flexBasis}
onChange={(event) => setFlexBasis(event.target.value)}
sx={{ maxWidth: 120, mx: 'auto' }}
sx={{ mx: 'auto', width: '100%' }}
/>
</Box>
);
Expand Down
4 changes: 2 additions & 2 deletions docs/data/joy/components/aspect-ratio/MediaRatio.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ import Typography from '@mui/joy/Typography';

export default function MediaRatio() {
return (
<Box sx={{ width: 300 }}>
<Box sx={{ width: 300, borderRadius: 'sm', p: 1 }}>
<AspectRatio objectFit="contain">
<img
src="https://images.unsplash.com/photo-1502657877623-f66bf489d236?crop=entropy&cs=tinysrgb&fm=jpg&ixlib=rb-1.2.1&q=80&raw_url=true&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=2369"
alt=""
/>
</AspectRatio>
<Typography level="body2" mt={1} textAlign="center">
<Typography level="body3" mt={2} textAlign="center">
An example of using <code>contain</code> value
</Typography>
</Box>
Expand Down
9 changes: 5 additions & 4 deletions docs/data/joy/components/aspect-ratio/aspect-ratio.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ title: React Aspect Ratio component

<p class="description">The Aspect Ratio component shapes the content with the specified ratio.</p>

The default implementation combines `height: 0px` with percentage padding-bottom to create the proper aspect ratio of the content. (It will be replaced by the [CSS aspect-ratio](https://developer.mozilla.org/en-US/docs/Web/CSS/aspect-ratio) in the future once it has sufficient various browser support).
The default aspect ratio implementation combines `height: 0px` with percentage padding-bottom to create the proper aspect ratio for the content.
(It will be replaced by the [CSS aspect-ratio](https://developer.mozilla.org/en-US/docs/Web/CSS/aspect-ratio) in the future once it has sufficient browser support).

- The content to fit the area of the aspect ratio component must be its first direct child.
- It is designed to be composed with other components, eg. [`Card`](/joy-ui/react-card/).
- It's designed to be composed with other components, e.g. [`Card`](/joy-ui/react-card/).

## Basic usage

Expand Down Expand Up @@ -55,10 +56,10 @@ Make sure to keep your content concise given the limited width real estate avail
Since the texts are short, we can set `white-space: nowrap` to make the title stay in one line.
The `min-width` CSS property is necessary on the aspect ratio component to prevent it from shrinking to zero.

{{"demo": "CarouselRatio.js", "bg": true}}
{{"demo": "CarouselRatio.js"}}

### List stack

This is a simple illustration of composing aspect ratio with list components.

{{"demo": "ListStackRatio.js", "bg": true}}
{{"demo": "ListStackRatio.js"}}
15 changes: 8 additions & 7 deletions docs/data/joy/components/avatar/AvatarGroupVariables.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import * as React from 'react';
import Avatar from '@mui/joy/Avatar';
import AvatarGroup from '@mui/joy/AvatarGroup';
import Box from '@mui/joy/Box';
import Sheet from '@mui/joy/Sheet';
import TextField from '@mui/joy/TextField';
import Typography from '@mui/joy/Typography';
import BrandingProvider from 'docs/src/BrandingProvider';
Expand Down Expand Up @@ -45,7 +46,7 @@ export default function GroupedAvatars() {
<Box
sx={{
width: '100%',
mt: 2,
mt: 1,
display: 'grid',
gridTemplateColumns: '1fr auto',
gridTemplateRows: '1fr auto',
Expand All @@ -71,25 +72,25 @@ export default function GroupedAvatars() {
<Avatar>+3</Avatar>
</AvatarGroup>
</Box>
<Box
<Sheet
variant="outlined"
sx={{
gridRow: 'span 2',
display: 'flex',
flexWrap: 'wrap',
gap: 2,
p: 2,
bgcolor: 'background.level1',
borderRadius: 'xs',
borderRadius: 'sm',
}}
>
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 2 }}>
<Typography fontWeight="lg">CSS variables</Typography>
<Typography fontWeight="xl">CSS variables</Typography>
{vars.map((data) => (
<TextField
key={data.var}
label={data.var}
size="sm"
variant="soft"
variant="outlined"
defaultValue={Number(data.defaultValue.replace('px', '')) || undefined}
endDecorator={<Typography level="body3">px</Typography>}
type={data.type}
Expand Down Expand Up @@ -118,7 +119,7 @@ export default function GroupedAvatars() {
/>
))}
</Box>
</Box>
</Sheet>
<BrandingProvider mode="dark">
<HighlighedCode
code={`<AvatarGroup${formatSx(sx)}>
Expand Down
15 changes: 8 additions & 7 deletions docs/data/joy/components/avatar/AvatarGroupVariables.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import * as React from 'react';
import Avatar from '@mui/joy/Avatar';
import AvatarGroup from '@mui/joy/AvatarGroup';
import Box from '@mui/joy/Box';
import Sheet from '@mui/joy/Sheet';
import TextField from '@mui/joy/TextField';
import Typography from '@mui/joy/Typography';
import BrandingProvider from 'docs/src/BrandingProvider';
Expand Down Expand Up @@ -45,7 +46,7 @@ export default function GroupedAvatars() {
<Box
sx={{
width: '100%',
mt: 2,
mt: 1,
display: 'grid',
gridTemplateColumns: '1fr auto',
gridTemplateRows: '1fr auto',
Expand All @@ -71,25 +72,25 @@ export default function GroupedAvatars() {
<Avatar>+3</Avatar>
</AvatarGroup>
</Box>
<Box
<Sheet
variant="outlined"
sx={{
gridRow: 'span 2',
display: 'flex',
flexWrap: 'wrap',
gap: 2,
p: 2,
bgcolor: 'background.level1',
borderRadius: 'xs',
borderRadius: 'sm',
}}
>
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 2 }}>
<Typography fontWeight="lg">CSS variables</Typography>
<Typography fontWeight="xl">CSS variables</Typography>
{vars.map((data) => (
<TextField
key={data.var}
label={data.var}
size="sm"
variant="soft"
variant="outlined"
defaultValue={Number(data.defaultValue.replace('px', '')) || undefined}
endDecorator={<Typography level="body3">px</Typography>}
type={data.type}
Expand Down Expand Up @@ -118,7 +119,7 @@ export default function GroupedAvatars() {
/>
))}
</Box>
</Box>
</Sheet>
<BrandingProvider mode="dark">
<HighlighedCode
code={`<AvatarGroup${formatSx(sx)}>
Expand Down
92 changes: 49 additions & 43 deletions docs/data/joy/components/avatar/AvatarVariantsAndColors.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import * as React from 'react';
import Avatar from '@mui/joy/Avatar';
import Box from '@mui/joy/Box';
import Badge from '@mui/joy/Badge';
import Sheet from '@mui/joy/Sheet';
import RadioGroup from '@mui/joy/RadioGroup';
import Radio from '@mui/joy/Radio';
import Chip from '@mui/joy/Chip';
import Typography from '@mui/joy/Typography';
import Check from '@mui/icons-material/Check';

export default function AvatarVariantsAndColors() {
const [variant, setVariant] = React.useState('soft');
Expand All @@ -24,16 +23,22 @@ export default function AvatarVariantsAndColors() {
IN
</Avatar>
</Box>
<Box
<Sheet
variant="outlined"
sx={{
maxWidth: 343,
p: 2,
bgcolor: 'background.level1',
borderRadius: 'xs',
borderRadius: 'sm',
}}
>
<Typography id="avatar-variant-selector" fontWeight="lg" mb={1}>
Variant
<Typography
level="body2"
fontWeight="xl"
id="avatar-variant-selector"
textColor="text.primary"
mb={1}
>
Variants
</Typography>
<RadioGroup
row
Expand All @@ -43,32 +48,36 @@ export default function AvatarVariantsAndColors() {
onChange={(event) => setVariant(event.target.value)}
sx={{ flexWrap: 'wrap', gap: 1 }}
>
{['plain', 'outlined', 'soft', 'solid'].map((value) => {
{['solid', 'soft', 'outlined', 'plain'].map((value) => {
const checked = variant === value;
return (
<Badge
key={value}
<Chip
size="sm"
badgeContent={<Check fontSize="sm" />}
badgeInset="8%"
invisible={!checked}
sx={{ '--Badge-paddingX': '0px' }}
variant="plain"
color={checked ? 'primary' : 'neutral'}
>
<Chip variant="plain">
<Radio
variant={checked ? 'outlined' : 'plain'}
label={value}
value={value}
disableIcon
overlay
/>
</Chip>
</Badge>
<Radio
size="sm"
variant={checked ? 'solid' : 'outlined'}
color={checked ? 'primary' : 'neutral'}
label={<Typography>{value}</Typography>}
value={value}
disableIcon
overlay
/>
</Chip>
);
})}
</RadioGroup>

<Typography id="avatar-color-selector" fontWeight="lg" mb={1} mt={3}>
<Typography
id="avatar-color-selector"
level="body2"
fontWeight="xl"
textColor="text.primary"
mb={1}
mt={3}
>
Color
</Typography>
<RadioGroup
Expand All @@ -79,33 +88,30 @@ export default function AvatarVariantsAndColors() {
onChange={(event) => setColor(event.target.value)}
sx={{ flexWrap: 'wrap', gap: 1 }}
>
{['neutral', 'primary', 'danger', 'info', 'success', 'warning'].map(
{['primary', 'neutral', 'danger', 'info', 'success', 'warning'].map(
(value) => {
const checked = color === value;
return (
<Badge
key={value}
<Chip
size="sm"
badgeContent={<Check fontSize="sm" />}
badgeInset="8%"
invisible={!checked}
sx={{ '--Badge-paddingX': '0px' }}
variant="plain"
color={checked ? 'primary' : 'neutral'}
>
<Chip variant="plain">
<Radio
variant={checked ? 'outlined' : 'plain'}
label={value}
value={value}
disableIcon
overlay
/>
</Chip>
</Badge>
<Radio
size="sm"
variant={checked ? 'solid' : 'outlined'}
color={checked ? 'primary' : 'neutral'}
label={<Typography>{value}</Typography>}
value={value}
disableIcon
overlay
/>
</Chip>
);
},
)}
</RadioGroup>
</Box>
</Sheet>
</Box>
);
}
Loading