diff --git a/docs/data/joy/components/alert/AlertColors.js b/docs/data/joy/components/alert/AlertColors.js index 1425c169eab282..5bdeddfa1bb6f9 100644 --- a/docs/data/joy/components/alert/AlertColors.js +++ b/docs/data/joy/components/alert/AlertColors.js @@ -29,9 +29,6 @@ export default function AlertColors() { Danger - - Info - Success @@ -41,7 +38,7 @@ export default function AlertColors() { Danger - - Info - Success @@ -41,7 +38,7 @@ export default function AlertColors() { - - - Success - - +
+ Success + Success is walking from failure to failure with no loss of enthusiam. - +
- } - sx={{ alignItems: 'flex-start', '--Alert-gap': '1rem' }} + sx={{ alignItems: 'flex-start', gap: '1rem' }} > - - Network loss, please recheck your connection. + Lost connection + + Please verify your network connection and try again. - diff --git a/docs/data/joy/components/alert/AlertInvertedColors.tsx b/docs/data/joy/components/alert/AlertInvertedColors.tsx index 7a6d2c4b7f945a..430c673439be1b 100644 --- a/docs/data/joy/components/alert/AlertInvertedColors.tsx +++ b/docs/data/joy/components/alert/AlertInvertedColors.tsx @@ -48,14 +48,12 @@ export default function AlertInvertedColors() { } sx={{ alignItems: 'flex-start', overflow: 'hidden' }} > - - - Success - - +
+ Success + Success is walking from failure to failure with no loss of enthusiam. - +
- } - sx={{ alignItems: 'flex-start', '--Alert-gap': '1rem' }} + sx={{ alignItems: 'flex-start', gap: '1rem' }} > - - Network loss, please recheck your connection. + Lost connection + + Please verify your network connection and try again. - diff --git a/docs/data/joy/components/alert/AlertUsage.js b/docs/data/joy/components/alert/AlertUsage.js index 9a19bbdfab2d3f..4df19557f68e39 100644 --- a/docs/data/joy/components/alert/AlertUsage.js +++ b/docs/data/joy/components/alert/AlertUsage.js @@ -10,13 +10,13 @@ export default function AlertUsage() { { propName: 'variant', knob: 'radio', - defaultValue: 'soft', + defaultValue: 'outlined', options: ['plain', 'outlined', 'soft', 'solid'], }, { propName: 'color', knob: 'color', - defaultValue: 'primary', + defaultValue: 'neutral', }, { propName: 'size', diff --git a/docs/data/joy/components/alert/AlertVariousStates.js b/docs/data/joy/components/alert/AlertVariousStates.js index 126bb23397392b..06551d2e7390bd 100644 --- a/docs/data/joy/components/alert/AlertVariousStates.js +++ b/docs/data/joy/components/alert/AlertVariousStates.js @@ -14,7 +14,7 @@ export default function AlertVariousStates() { { title: 'Success', color: 'success', icon: }, { title: 'Warning', color: 'warning', icon: }, { title: 'Error', color: 'danger', icon: }, - { title: 'Info', color: 'info', icon: }, + { title: 'Neutral', color: 'neutral', icon: }, ]; return ( @@ -23,23 +23,18 @@ export default function AlertVariousStates() { + } >
- - {title} - - +
{title}
+ This is a time-sensitive {title} Alert.
diff --git a/docs/data/joy/components/alert/AlertVariousStates.tsx b/docs/data/joy/components/alert/AlertVariousStates.tsx index 0a7e1dce4949ed..d5809cf4f57b3c 100644 --- a/docs/data/joy/components/alert/AlertVariousStates.tsx +++ b/docs/data/joy/components/alert/AlertVariousStates.tsx @@ -19,7 +19,7 @@ export default function AlertVariousStates() { { title: 'Success', color: 'success', icon: }, { title: 'Warning', color: 'warning', icon: }, { title: 'Error', color: 'danger', icon: }, - { title: 'Info', color: 'info', icon: }, + { title: 'Neutral', color: 'neutral', icon: }, ]; return ( @@ -27,23 +27,18 @@ export default function AlertVariousStates() { + } >
- - {title} - - +
{title}
+ This is a time-sensitive {title} Alert.
diff --git a/docs/data/joy/components/alert/AlertWithDangerState.js b/docs/data/joy/components/alert/AlertWithDangerState.js index 05f50d1c54e7ee..b75d502ed76e99 100644 --- a/docs/data/joy/components/alert/AlertWithDangerState.js +++ b/docs/data/joy/components/alert/AlertWithDangerState.js @@ -4,14 +4,13 @@ import * as React from 'react'; import Box from '@mui/joy/Box'; import Alert from '@mui/joy/Alert'; import IconButton from '@mui/joy/IconButton'; -import Typography from '@mui/joy/Typography'; import Button from '@mui/joy/Button'; export default function AlertWithDangerState() { return ( } + startDecorator={} variant="soft" color="danger" endDecorator={ @@ -25,12 +24,10 @@ export default function AlertWithDangerState() { } > - - This file was successfully deleted - + This file was successfully deleted } + startDecorator={} variant="solid" color="danger" endDecorator={ @@ -44,13 +41,11 @@ export default function AlertWithDangerState() { } > - - This file was successfully deleted - + This file was successfully deleted } + startDecorator={} variant="outlined" color="danger" endDecorator={ @@ -64,9 +59,7 @@ export default function AlertWithDangerState() { } > - - This file was successfully deleted - + This file was successfully deleted ); diff --git a/docs/data/joy/components/alert/AlertWithDangerState.tsx b/docs/data/joy/components/alert/AlertWithDangerState.tsx index 05f50d1c54e7ee..b75d502ed76e99 100644 --- a/docs/data/joy/components/alert/AlertWithDangerState.tsx +++ b/docs/data/joy/components/alert/AlertWithDangerState.tsx @@ -4,14 +4,13 @@ import * as React from 'react'; import Box from '@mui/joy/Box'; import Alert from '@mui/joy/Alert'; import IconButton from '@mui/joy/IconButton'; -import Typography from '@mui/joy/Typography'; import Button from '@mui/joy/Button'; export default function AlertWithDangerState() { return ( } + startDecorator={} variant="soft" color="danger" endDecorator={ @@ -25,12 +24,10 @@ export default function AlertWithDangerState() { } > - - This file was successfully deleted - + This file was successfully deleted } + startDecorator={} variant="solid" color="danger" endDecorator={ @@ -44,13 +41,11 @@ export default function AlertWithDangerState() { } > - - This file was successfully deleted - + This file was successfully deleted } + startDecorator={} variant="outlined" color="danger" endDecorator={ @@ -64,9 +59,7 @@ export default function AlertWithDangerState() { } > - - This file was successfully deleted - + This file was successfully deleted ); diff --git a/docs/data/joy/components/alert/AlertWithDecorators.js b/docs/data/joy/components/alert/AlertWithDecorators.js index 300f62dffb5d99..7e3b9718313c79 100644 --- a/docs/data/joy/components/alert/AlertWithDecorators.js +++ b/docs/data/joy/components/alert/AlertWithDecorators.js @@ -15,16 +15,7 @@ export default function AlertWithDecorators() { color="success" startDecorator={} endDecorator={ - } diff --git a/docs/data/joy/components/alert/AlertWithDecorators.tsx b/docs/data/joy/components/alert/AlertWithDecorators.tsx index 300f62dffb5d99..7e3b9718313c79 100644 --- a/docs/data/joy/components/alert/AlertWithDecorators.tsx +++ b/docs/data/joy/components/alert/AlertWithDecorators.tsx @@ -15,16 +15,7 @@ export default function AlertWithDecorators() { color="success" startDecorator={} endDecorator={ - } diff --git a/docs/data/joy/components/aspect-ratio/CarouselRatio.js b/docs/data/joy/components/aspect-ratio/CarouselRatio.js index d24f6b9c2c05ec..6dd36bf6b53457 100644 --- a/docs/data/joy/components/aspect-ratio/CarouselRatio.js +++ b/docs/data/joy/components/aspect-ratio/CarouselRatio.js @@ -39,15 +39,7 @@ export default function CarouselRatio() { }} > {data.map((item) => ( - theme.spacing(2), - }} - > + {item.title} - - {item.title} - {item.description} + + {item.title} + {item.description} ))} diff --git a/docs/data/joy/components/aspect-ratio/CarouselRatio.tsx b/docs/data/joy/components/aspect-ratio/CarouselRatio.tsx index d24f6b9c2c05ec..6dd36bf6b53457 100644 --- a/docs/data/joy/components/aspect-ratio/CarouselRatio.tsx +++ b/docs/data/joy/components/aspect-ratio/CarouselRatio.tsx @@ -39,15 +39,7 @@ export default function CarouselRatio() { }} > {data.map((item) => ( - theme.spacing(2), - }} - > + {item.title} - - {item.title} - {item.description} + + {item.title} + {item.description} ))} diff --git a/docs/data/joy/components/aspect-ratio/CarouselRatio.tsx.preview b/docs/data/joy/components/aspect-ratio/CarouselRatio.tsx.preview new file mode 100644 index 00000000000000..eba9b94163d2d1 --- /dev/null +++ b/docs/data/joy/components/aspect-ratio/CarouselRatio.tsx.preview @@ -0,0 +1,15 @@ +{data.map((item) => ( + + + {item.title} + + + {item.title} + {item.description} + + +))} \ No newline at end of file diff --git a/docs/data/joy/components/aspect-ratio/FlexRowRatio.js b/docs/data/joy/components/aspect-ratio/FlexRowRatio.js index 2baded5c0b110e..f49c7fedcb5fd5 100644 --- a/docs/data/joy/components/aspect-ratio/FlexRowRatio.js +++ b/docs/data/joy/components/aspect-ratio/FlexRowRatio.js @@ -1,8 +1,8 @@ import * as React from 'react'; import AspectRatio from '@mui/joy/AspectRatio'; import Box from '@mui/joy/Box'; +import Card from '@mui/joy/Card'; import Typography from '@mui/joy/Typography'; -import Sheet from '@mui/joy/Sheet'; import FormControl from '@mui/joy/FormControl'; import FormLabel from '@mui/joy/FormLabel'; import Input from '@mui/joy/Input'; @@ -11,20 +11,10 @@ export default function FlexRowRatio() { const [flexBasis, setFlexBasis] = React.useState(200); return ( - + @@ -34,11 +24,11 @@ export default function FlexRowRatio() { alt="" /> - - Yosemite National Park - California, USA - - +
+ Yosemite National Park + California, USA +
+

flexBasis diff --git a/docs/data/joy/components/aspect-ratio/FlexRowRatio.tsx b/docs/data/joy/components/aspect-ratio/FlexRowRatio.tsx index 2baded5c0b110e..f49c7fedcb5fd5 100644 --- a/docs/data/joy/components/aspect-ratio/FlexRowRatio.tsx +++ b/docs/data/joy/components/aspect-ratio/FlexRowRatio.tsx @@ -1,8 +1,8 @@ import * as React from 'react'; import AspectRatio from '@mui/joy/AspectRatio'; import Box from '@mui/joy/Box'; +import Card from '@mui/joy/Card'; import Typography from '@mui/joy/Typography'; -import Sheet from '@mui/joy/Sheet'; import FormControl from '@mui/joy/FormControl'; import FormLabel from '@mui/joy/FormLabel'; import Input from '@mui/joy/Input'; @@ -11,20 +11,10 @@ export default function FlexRowRatio() { const [flexBasis, setFlexBasis] = React.useState(200); return ( - + @@ -34,11 +24,11 @@ export default function FlexRowRatio() { alt="" /> - - Yosemite National Park - California, USA - - +
+ Yosemite National Park + California, USA +
+

flexBasis diff --git a/docs/data/joy/components/aspect-ratio/ListStackRatio.js b/docs/data/joy/components/aspect-ratio/ListStackRatio.js index ccb633dbc24e2c..040e2e7b7e424b 100644 --- a/docs/data/joy/components/aspect-ratio/ListStackRatio.js +++ b/docs/data/joy/components/aspect-ratio/ListStackRatio.js @@ -1,7 +1,7 @@ import * as React from 'react'; import AspectRatio from '@mui/joy/AspectRatio'; import Typography from '@mui/joy/Typography'; -import Sheet from '@mui/joy/Sheet'; +import Card from '@mui/joy/Card'; import List from '@mui/joy/List'; import ListDivider from '@mui/joy/ListDivider'; import ListItem from '@mui/joy/ListItem'; @@ -28,24 +28,13 @@ const data = [ export default function ListStackRatio() { return ( - + {data.map((item, index) => ( - + {item.title} - {item.description} + {item.description} @@ -62,6 +51,6 @@ export default function ListStackRatio() { ))} - + ); } diff --git a/docs/data/joy/components/aspect-ratio/ListStackRatio.tsx b/docs/data/joy/components/aspect-ratio/ListStackRatio.tsx index ccb633dbc24e2c..040e2e7b7e424b 100644 --- a/docs/data/joy/components/aspect-ratio/ListStackRatio.tsx +++ b/docs/data/joy/components/aspect-ratio/ListStackRatio.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import AspectRatio from '@mui/joy/AspectRatio'; import Typography from '@mui/joy/Typography'; -import Sheet from '@mui/joy/Sheet'; +import Card from '@mui/joy/Card'; import List from '@mui/joy/List'; import ListDivider from '@mui/joy/ListDivider'; import ListItem from '@mui/joy/ListItem'; @@ -28,24 +28,13 @@ const data = [ export default function ListStackRatio() { return ( - + {data.map((item, index) => ( - + {item.title} - {item.description} + {item.description} @@ -62,6 +51,6 @@ export default function ListStackRatio() { ))} - + ); } diff --git a/docs/data/joy/components/aspect-ratio/PlaceholderAspectRatio.js b/docs/data/joy/components/aspect-ratio/PlaceholderAspectRatio.js index f2803243a484d7..e6946d755eeca7 100644 --- a/docs/data/joy/components/aspect-ratio/PlaceholderAspectRatio.js +++ b/docs/data/joy/components/aspect-ratio/PlaceholderAspectRatio.js @@ -9,12 +9,12 @@ export default function PlaceholderAspectRatio() {
- +
- Title - Description of the card. + Title + Description of the card.
); diff --git a/docs/data/joy/components/aspect-ratio/PlaceholderAspectRatio.tsx b/docs/data/joy/components/aspect-ratio/PlaceholderAspectRatio.tsx index f2803243a484d7..e6946d755eeca7 100644 --- a/docs/data/joy/components/aspect-ratio/PlaceholderAspectRatio.tsx +++ b/docs/data/joy/components/aspect-ratio/PlaceholderAspectRatio.tsx @@ -9,12 +9,12 @@ export default function PlaceholderAspectRatio() {
- +
- Title - Description of the card. + Title + Description of the card.
); diff --git a/docs/data/joy/components/aspect-ratio/PlaceholderAspectRatio.tsx.preview b/docs/data/joy/components/aspect-ratio/PlaceholderAspectRatio.tsx.preview index 1d4319bb7f300b..af4ff39085ad1e 100644 --- a/docs/data/joy/components/aspect-ratio/PlaceholderAspectRatio.tsx.preview +++ b/docs/data/joy/components/aspect-ratio/PlaceholderAspectRatio.tsx.preview @@ -1,11 +1,11 @@
- +
- Title - Description of the card. + Title + Description of the card.
\ No newline at end of file diff --git a/docs/data/joy/components/autocomplete/InputAppearance.js b/docs/data/joy/components/autocomplete/AutocompleteVariants.js similarity index 95% rename from docs/data/joy/components/autocomplete/InputAppearance.js rename to docs/data/joy/components/autocomplete/AutocompleteVariants.js index 0ee989fb515cfc..dbbc2704f6cdeb 100644 --- a/docs/data/joy/components/autocomplete/InputAppearance.js +++ b/docs/data/joy/components/autocomplete/AutocompleteVariants.js @@ -1,8 +1,9 @@ import * as React from 'react'; import Autocomplete from '@mui/joy/Autocomplete'; +import AutocompleteOption from '@mui/joy/AutocompleteOption'; import Stack from '@mui/joy/Stack'; -export default function InputAppearance() { +export default function AutocompleteVariants() { return ( ( + + {option.label} + + )} sx={{ width: 300 }} /> ( + + {option.label} + + )} sx={{ width: 300 }} /> - + value: @@ -20,7 +20,7 @@ export default function ControllableStates() { - + inputValue: diff --git a/docs/data/joy/components/autocomplete/ControllableStates.tsx b/docs/data/joy/components/autocomplete/ControllableStates.tsx index 46e329a3114250..258d38b74d58db 100644 --- a/docs/data/joy/components/autocomplete/ControllableStates.tsx +++ b/docs/data/joy/components/autocomplete/ControllableStates.tsx @@ -12,7 +12,7 @@ export default function ControllableStates() { return (
- + value: @@ -20,7 +20,7 @@ export default function ControllableStates() { - + inputValue: diff --git a/docs/data/joy/components/autocomplete/CountrySelect.js b/docs/data/joy/components/autocomplete/CountrySelect.js index 760bddbc201890..3d0d980b6f6b3b 100644 --- a/docs/data/joy/components/autocomplete/CountrySelect.js +++ b/docs/data/joy/components/autocomplete/CountrySelect.js @@ -32,7 +32,7 @@ export default function CountrySelect() { {option.label} - + ({option.code}) +{option.phone} diff --git a/docs/data/joy/components/autocomplete/CountrySelect.tsx b/docs/data/joy/components/autocomplete/CountrySelect.tsx index 760bddbc201890..3d0d980b6f6b3b 100644 --- a/docs/data/joy/components/autocomplete/CountrySelect.tsx +++ b/docs/data/joy/components/autocomplete/CountrySelect.tsx @@ -32,7 +32,7 @@ export default function CountrySelect() { {option.label} - + ({option.code}) +{option.phone} diff --git a/docs/data/joy/components/autocomplete/GitHubLabel.js b/docs/data/joy/components/autocomplete/GitHubLabel.js index 354b0cad797b69..f08b08889fd2be 100644 --- a/docs/data/joy/components/autocomplete/GitHubLabel.js +++ b/docs/data/joy/components/autocomplete/GitHubLabel.js @@ -59,7 +59,7 @@ export default function GitHubLabel() { color="neutral" component="button" underline="none" - level="body3" + level="body-xs" aria-describedby={id} onClick={handleClick} sx={{ @@ -80,13 +80,12 @@ export default function GitHubLabel() { {value.map((label) => ( @@ -179,10 +178,8 @@ export default function GitHubLabel() { }} /> - {option.name} - - {option.description} - + {option.name} + {option.description} diff --git a/docs/data/joy/components/autocomplete/GitHubLabel.tsx b/docs/data/joy/components/autocomplete/GitHubLabel.tsx index 549f4da73966a8..b0c519c67da805 100644 --- a/docs/data/joy/components/autocomplete/GitHubLabel.tsx +++ b/docs/data/joy/components/autocomplete/GitHubLabel.tsx @@ -59,7 +59,7 @@ export default function GitHubLabel() { color="neutral" component="button" underline="none" - level="body3" + level="body-xs" aria-describedby={id} onClick={handleClick} sx={{ @@ -80,13 +80,12 @@ export default function GitHubLabel() { {value.map((label) => ( @@ -179,10 +178,8 @@ export default function GitHubLabel() { }} /> - {option.name} - - {option.description} - + {option.name} + {option.description} diff --git a/docs/data/joy/components/autocomplete/Highlights.js b/docs/data/joy/components/autocomplete/Highlights.js index 97b43b929a90f6..f320f496d15a6e 100644 --- a/docs/data/joy/components/autocomplete/Highlights.js +++ b/docs/data/joy/components/autocomplete/Highlights.js @@ -30,7 +30,7 @@ export default function Highlights() { key={index} {...(part.highlight && { variant: 'soft', - color: 'info', + color: 'primary', fontWeight: 'lg', px: '2px', })} diff --git a/docs/data/joy/components/autocomplete/Highlights.tsx b/docs/data/joy/components/autocomplete/Highlights.tsx index 97b43b929a90f6..f320f496d15a6e 100644 --- a/docs/data/joy/components/autocomplete/Highlights.tsx +++ b/docs/data/joy/components/autocomplete/Highlights.tsx @@ -30,7 +30,7 @@ export default function Highlights() { key={index} {...(part.highlight && { variant: 'soft', - color: 'info', + color: 'primary', fontWeight: 'lg', px: '2px', })} diff --git a/docs/data/joy/components/autocomplete/Playground.js b/docs/data/joy/components/autocomplete/Playground.js index 7ddf59304b82c3..71cd6c843bf46f 100644 --- a/docs/data/joy/components/autocomplete/Playground.js +++ b/docs/data/joy/components/autocomplete/Playground.js @@ -33,16 +33,9 @@ export default function Playground() { top: 'var(--MuiDocs-header-height)', zIndex: 2, border: '1px solid', - borderColor: (theme) => - theme.palette.mode === 'dark' - ? 'rgba(62, 80, 96, 0.3)' - : theme.palette.neutral[100], - + borderColor: 'divider', borderRadius: 'xs', - background: (theme) => - theme.palette.mode === 'dark' - ? 'rgba(0,30,60, 0.95)' - : theme.palette.primary[50], + bgcolor: 'background.surface', }} > @@ -57,7 +50,7 @@ export default function Playground() { setFlags([])} - sx={{ ml: 'auto' }} + sx={{ ml: 'auto', mr: 2 }} > Clear all diff --git a/docs/data/joy/components/autocomplete/autocomplete.md b/docs/data/joy/components/autocomplete/autocomplete.md index 0126ee08748ffe..38ad1ba96c0aee 100644 --- a/docs/data/joy/components/autocomplete/autocomplete.md +++ b/docs/data/joy/components/autocomplete/autocomplete.md @@ -73,12 +73,27 @@ To customize the appearance of the options, use `renderOption` prop in combinati The autocomplete component supports the four global variants: `outlined` (default), `soft`, `solid`, and `plain`. -{{"demo": "InputAppearance.js"}} +The variant and color values are propagated to the Autocomplete's `input` and `listbox` slots. + +{{"demo": "AutocompleteVariants.js"}} :::info To learn how to add more variants to the component, check out [Themed componentsβ€”Extend variants](/joy-ui/customization/themed-components/#extend-variants). ::: +To customize the variant and color for a specific slot, use `slotProps`: + +```js + +``` + ### Label Put an `Autocomplete`, a `FormLabel` and a `FormHelperText` (optional) under a `FormControl` component to create an accessible autocomplete. diff --git a/docs/data/joy/components/avatar/AvatarUsage.js b/docs/data/joy/components/avatar/AvatarUsage.js index 1eb3bf7d5238e8..f89582500a3afd 100644 --- a/docs/data/joy/components/avatar/AvatarUsage.js +++ b/docs/data/joy/components/avatar/AvatarUsage.js @@ -19,6 +19,12 @@ export default function AvatarUsage() { knob: 'color', defaultValue: 'neutral', }, + { + propName: 'size', + knob: 'radio', + options: ['sm', 'md', 'lg'], + defaultValue: 'md', + }, ]} renderDemo={(props) => ( M + )} /> diff --git a/docs/data/joy/components/badge/BadgeColors.js b/docs/data/joy/components/badge/BadgeColors.js index 73825541483b3b..386580e936f261 100644 --- a/docs/data/joy/components/badge/BadgeColors.js +++ b/docs/data/joy/components/badge/BadgeColors.js @@ -15,9 +15,6 @@ export default function BadgeColors() { πŸ’Œ - - πŸ’Œ - πŸ’Œ diff --git a/docs/data/joy/components/badge/BadgeColors.tsx b/docs/data/joy/components/badge/BadgeColors.tsx index 73825541483b3b..386580e936f261 100644 --- a/docs/data/joy/components/badge/BadgeColors.tsx +++ b/docs/data/joy/components/badge/BadgeColors.tsx @@ -15,9 +15,6 @@ export default function BadgeColors() { πŸ’Œ - - πŸ’Œ - πŸ’Œ diff --git a/docs/data/joy/components/badge/BadgeColors.tsx.preview b/docs/data/joy/components/badge/BadgeColors.tsx.preview new file mode 100644 index 00000000000000..23c6a001ca8d15 --- /dev/null +++ b/docs/data/joy/components/badge/BadgeColors.tsx.preview @@ -0,0 +1,15 @@ + + πŸ’Œ + + + πŸ’Œ + + + πŸ’Œ + + + πŸ’Œ + + + πŸ’Œ + \ No newline at end of file diff --git a/docs/data/joy/components/badge/ContentBadge.js b/docs/data/joy/components/badge/ContentBadge.js index 2df6bf4cbd0fb2..36ff4117e6b14b 100644 --- a/docs/data/joy/components/badge/ContentBadge.js +++ b/docs/data/joy/components/badge/ContentBadge.js @@ -2,6 +2,7 @@ import * as React from 'react'; import Box from '@mui/joy/Box'; import Badge from '@mui/joy/Badge'; import Typography from '@mui/joy/Typography'; +import Warning from '@mui/icons-material/Warning'; export default function ContentBadge() { return ( @@ -12,6 +13,9 @@ export default function ContentBadge() { πŸ”” + }> + πŸͺ« + ); } diff --git a/docs/data/joy/components/badge/ContentBadge.tsx b/docs/data/joy/components/badge/ContentBadge.tsx index 2df6bf4cbd0fb2..36ff4117e6b14b 100644 --- a/docs/data/joy/components/badge/ContentBadge.tsx +++ b/docs/data/joy/components/badge/ContentBadge.tsx @@ -2,6 +2,7 @@ import * as React from 'react'; import Box from '@mui/joy/Box'; import Badge from '@mui/joy/Badge'; import Typography from '@mui/joy/Typography'; +import Warning from '@mui/icons-material/Warning'; export default function ContentBadge() { return ( @@ -12,6 +13,9 @@ export default function ContentBadge() { πŸ”” + }> + πŸͺ« + ); } diff --git a/docs/data/joy/components/badge/ContentBadge.tsx.preview b/docs/data/joy/components/badge/ContentBadge.tsx.preview index 66a68b23400576..b9fc148b83b609 100644 --- a/docs/data/joy/components/badge/ContentBadge.tsx.preview +++ b/docs/data/joy/components/badge/ContentBadge.tsx.preview @@ -3,4 +3,7 @@ πŸ”” + +}> + πŸͺ« \ No newline at end of file diff --git a/docs/data/joy/components/badge/NumberBadge.js b/docs/data/joy/components/badge/NumberBadge.js index acb6a27ae0cc05..c34814ddbc80ae 100644 --- a/docs/data/joy/components/badge/NumberBadge.js +++ b/docs/data/joy/components/badge/NumberBadge.js @@ -12,10 +12,16 @@ export default function NumberBadge() { const [showZero, setShowZero] = React.useState(false); return ( - πŸ› + πŸ› - setShowZero(event.target.checked)} - checked={showZero} - label="show zero" - /> + setShowZero(event.target.checked)} + checked={showZero} + label="show zero" + /> ); } diff --git a/docs/data/joy/components/badge/NumberBadge.tsx b/docs/data/joy/components/badge/NumberBadge.tsx index acb6a27ae0cc05..c34814ddbc80ae 100644 --- a/docs/data/joy/components/badge/NumberBadge.tsx +++ b/docs/data/joy/components/badge/NumberBadge.tsx @@ -12,10 +12,16 @@ export default function NumberBadge() { const [showZero, setShowZero] = React.useState(false); return ( - πŸ› + πŸ› - setShowZero(event.target.checked)} - checked={showZero} - label="show zero" - /> + setShowZero(event.target.checked)} + checked={showZero} + label="show zero" + /> ); } diff --git a/docs/data/joy/components/breadcrumbs/BasicBreadcrumbs.js b/docs/data/joy/components/breadcrumbs/BasicBreadcrumbs.js index d2a24139ffb239..1cbb03cc5fa266 100644 --- a/docs/data/joy/components/breadcrumbs/BasicBreadcrumbs.js +++ b/docs/data/joy/components/breadcrumbs/BasicBreadcrumbs.js @@ -7,20 +7,11 @@ export default function BasicBreadcrumbs() { return ( {['Home', 'TV Shows', 'Futurama', 'Characters'].map((item) => ( - event.preventDefault()} - key={item} - underline="hover" - color="neutral" - fontSize="inherit" - href="/" - > + {item} ))} - Dr. Zoidberg + Dr. Zoidberg ); } diff --git a/docs/data/joy/components/breadcrumbs/BasicBreadcrumbs.tsx b/docs/data/joy/components/breadcrumbs/BasicBreadcrumbs.tsx index 8b37d5f3bc2a9c..71d757c4f326cb 100644 --- a/docs/data/joy/components/breadcrumbs/BasicBreadcrumbs.tsx +++ b/docs/data/joy/components/breadcrumbs/BasicBreadcrumbs.tsx @@ -7,20 +7,11 @@ export default function BasicBreadcrumbs() { return ( {['Home', 'TV Shows', 'Futurama', 'Characters'].map((item: string) => ( - event.preventDefault()} - key={item} - underline="hover" - color="neutral" - fontSize="inherit" - href="/" - > + {item} ))} - Dr. Zoidberg + Dr. Zoidberg ); } diff --git a/docs/data/joy/components/breadcrumbs/BasicBreadcrumbs.tsx.preview b/docs/data/joy/components/breadcrumbs/BasicBreadcrumbs.tsx.preview new file mode 100644 index 00000000000000..1d8959f2cf45ef --- /dev/null +++ b/docs/data/joy/components/breadcrumbs/BasicBreadcrumbs.tsx.preview @@ -0,0 +1,8 @@ + + {['Home', 'TV Shows', 'Futurama', 'Characters'].map((item: string) => ( + + {item} + + ))} + Dr. Zoidberg + \ No newline at end of file diff --git a/docs/data/joy/components/breadcrumbs/BreadcrumbsSizes.js b/docs/data/joy/components/breadcrumbs/BreadcrumbsSizes.js index 2385d08caeb03b..0ac91d803114ee 100644 --- a/docs/data/joy/components/breadcrumbs/BreadcrumbsSizes.js +++ b/docs/data/joy/components/breadcrumbs/BreadcrumbsSizes.js @@ -9,54 +9,30 @@ export default function BreadcrumbsSizes() { {['Home', 'TV Shows', 'Futurama', 'Characters'].map((item) => ( - event.preventDefault()} - key={item} - underline="hover" - color="neutral" - fontSize="inherit" - href="/" - > + {item} ))} - Dr. Zoidberg + + Dr. Zoidberg {['Home', 'TV Shows', 'Futurama', 'Characters'].map((item) => ( - event.preventDefault()} - key={item} - underline="hover" - color="neutral" - fontSize="inherit" - href="/" - > + {item} ))} - Dr. Zoidberg + + Dr. Zoidberg {['Home', 'TV Shows', 'Futurama', 'Characters'].map((item) => ( - event.preventDefault()} - key={item} - underline="hover" - color="neutral" - fontSize="inherit" - href="/" - > + {item} ))} - Dr. Zoidberg + + Dr. Zoidberg ); diff --git a/docs/data/joy/components/breadcrumbs/BreadcrumbsSizes.tsx b/docs/data/joy/components/breadcrumbs/BreadcrumbsSizes.tsx index 0ecf6686bbc6ac..0ac91d803114ee 100644 --- a/docs/data/joy/components/breadcrumbs/BreadcrumbsSizes.tsx +++ b/docs/data/joy/components/breadcrumbs/BreadcrumbsSizes.tsx @@ -8,55 +8,31 @@ export default function BreadcrumbsSizes() { return ( - {['Home', 'TV Shows', 'Futurama', 'Characters'].map((item: string) => ( - event.preventDefault()} - key={item} - underline="hover" - color="neutral" - fontSize="inherit" - href="/" - > + {['Home', 'TV Shows', 'Futurama', 'Characters'].map((item) => ( + {item} ))} - Dr. Zoidberg + + Dr. Zoidberg - {['Home', 'TV Shows', 'Futurama', 'Characters'].map((item: string) => ( - event.preventDefault()} - key={item} - underline="hover" - color="neutral" - fontSize="inherit" - href="/" - > + {['Home', 'TV Shows', 'Futurama', 'Characters'].map((item) => ( + {item} ))} - Dr. Zoidberg + + Dr. Zoidberg - {['Home', 'TV Shows', 'Futurama', 'Characters'].map((item: string) => ( - event.preventDefault()} - key={item} - underline="hover" - color="neutral" - fontSize="inherit" - href="/" - > + {['Home', 'TV Shows', 'Futurama', 'Characters'].map((item) => ( + {item} ))} - Dr. Zoidberg + + Dr. Zoidberg ); diff --git a/docs/data/joy/components/breadcrumbs/BreadcrumbsUsage.js b/docs/data/joy/components/breadcrumbs/BreadcrumbsUsage.js index 1b8aa125cb06e1..320ed9c3b0d7e2 100644 --- a/docs/data/joy/components/breadcrumbs/BreadcrumbsUsage.js +++ b/docs/data/joy/components/breadcrumbs/BreadcrumbsUsage.js @@ -30,24 +30,20 @@ export default function BreadcrumbsUsage() { event.preventDefault()} - underline="hover" color="neutral" href="/" - fontSize="inherit" > MUI event.preventDefault()} - underline="hover" color="neutral" href="/joy-ui/getting-started/installation/" - fontSize="inherit" > Joy - Breadcrumbs + Breadcrumbs )} /> diff --git a/docs/data/joy/components/breadcrumbs/BreadcrumbsVariables.js b/docs/data/joy/components/breadcrumbs/BreadcrumbsVariables.js index dc9a1f8c728eaa..920860fd76bc3f 100644 --- a/docs/data/joy/components/breadcrumbs/BreadcrumbsVariables.js +++ b/docs/data/joy/components/breadcrumbs/BreadcrumbsVariables.js @@ -17,20 +17,12 @@ export default function BreadcrumbsVariables() { renderDemo={(sx) => ( {['Menu 1', 'Menu 2'].map((item) => ( - event.preventDefault()} - key={item} - underline="hover" - color="neutral" - fontSize="inherit" - href="/" - > + {item} ))} - Menu 3 + + Menu 3 )} /> diff --git a/docs/data/joy/components/breadcrumbs/BreadcrumbsVariables.tsx b/docs/data/joy/components/breadcrumbs/BreadcrumbsVariables.tsx index 26f69ed2b0f0ca..920860fd76bc3f 100644 --- a/docs/data/joy/components/breadcrumbs/BreadcrumbsVariables.tsx +++ b/docs/data/joy/components/breadcrumbs/BreadcrumbsVariables.tsx @@ -16,21 +16,13 @@ export default function BreadcrumbsVariables() { ]} renderDemo={(sx) => ( - {['Menu 1', 'Menu 2'].map((item: string) => ( - event.preventDefault()} - key={item} - underline="hover" - color="neutral" - fontSize="inherit" - href="/" - > + {['Menu 1', 'Menu 2'].map((item) => ( + {item} ))} - Menu 3 + + Menu 3 )} /> diff --git a/docs/data/joy/components/breadcrumbs/BreadcrumbsWithIcon.js b/docs/data/joy/components/breadcrumbs/BreadcrumbsWithIcon.js index c83cd7e63300b4..98983f078764fa 100644 --- a/docs/data/joy/components/breadcrumbs/BreadcrumbsWithIcon.js +++ b/docs/data/joy/components/breadcrumbs/BreadcrumbsWithIcon.js @@ -7,33 +7,17 @@ import Typography from '@mui/joy/Typography'; export default function BreadcrumbsWithIcon() { return ( - event.preventDefault()} - underline="hover" - color="primary" - fontSize="inherit" - href="/" - > - + + United States {['Springfield', 'Simpson'].map((item) => ( - event.preventDefault()} - key={item} - underline="hover" - color="success" - fontSize="inherit" - href="/" - > + {item} ))} - Homer + + Homer ); } diff --git a/docs/data/joy/components/breadcrumbs/BreadcrumbsWithIcon.tsx b/docs/data/joy/components/breadcrumbs/BreadcrumbsWithIcon.tsx index e3f30314190f18..98983f078764fa 100644 --- a/docs/data/joy/components/breadcrumbs/BreadcrumbsWithIcon.tsx +++ b/docs/data/joy/components/breadcrumbs/BreadcrumbsWithIcon.tsx @@ -7,33 +7,17 @@ import Typography from '@mui/joy/Typography'; export default function BreadcrumbsWithIcon() { return ( - event.preventDefault()} - underline="hover" - color="primary" - fontSize="inherit" - href="/" - > - + + United States - {['Springfield', 'Simpson'].map((item: string) => ( - event.preventDefault()} - key={item} - underline="hover" - color="success" - fontSize="inherit" - href="/" - > + {['Springfield', 'Simpson'].map((item) => ( + {item} ))} - Homer + + Homer ); } diff --git a/docs/data/joy/components/breadcrumbs/BreadcrumbsWithIcon.tsx.preview b/docs/data/joy/components/breadcrumbs/BreadcrumbsWithIcon.tsx.preview new file mode 100644 index 00000000000000..3eed5aa3804e4b --- /dev/null +++ b/docs/data/joy/components/breadcrumbs/BreadcrumbsWithIcon.tsx.preview @@ -0,0 +1,13 @@ + + + + United States + + {['Springfield', 'Simpson'].map((item) => ( + + {item} + + ))} + + Homer + \ No newline at end of file diff --git a/docs/data/joy/components/breadcrumbs/BreadcrumbsWithMenu.js b/docs/data/joy/components/breadcrumbs/BreadcrumbsWithMenu.js index e1ce7864c4826f..5c2f89eace33d2 100644 --- a/docs/data/joy/components/breadcrumbs/BreadcrumbsWithMenu.js +++ b/docs/data/joy/components/breadcrumbs/BreadcrumbsWithMenu.js @@ -30,40 +30,16 @@ export default function BreadcrumbsWithMenu() { Breadcrumb 4 - event.preventDefault()} - underline="hover" - color="primary" - href="/" - fontSize="inherit" - > + Breadcrumb 1 - event.preventDefault()} - underline="hover" - color="primary" - href="/" - fontSize="inherit" - > + Breadcrumb 5 - event.preventDefault()} - underline="hover" - color="primary" - href="/" - fontSize="inherit" - > + Breadcrumb 6 diff --git a/docs/data/joy/components/breadcrumbs/BreadcrumbsWithMenu.tsx b/docs/data/joy/components/breadcrumbs/BreadcrumbsWithMenu.tsx index 1dcbacce99efbd..01111f7f9e3e65 100644 --- a/docs/data/joy/components/breadcrumbs/BreadcrumbsWithMenu.tsx +++ b/docs/data/joy/components/breadcrumbs/BreadcrumbsWithMenu.tsx @@ -30,40 +30,16 @@ export default function BreadcrumbsWithMenu() { Breadcrumb 4 - event.preventDefault()} - underline="hover" - color="primary" - href="/" - fontSize="inherit" - > + Breadcrumb 1 - event.preventDefault()} - underline="hover" - color="primary" - href="/" - fontSize="inherit" - > + Breadcrumb 5 - event.preventDefault()} - underline="hover" - color="primary" - href="/" - fontSize="inherit" - > + Breadcrumb 6 diff --git a/docs/data/joy/components/breadcrumbs/CondensedBreadcrumbs.js b/docs/data/joy/components/breadcrumbs/CondensedBreadcrumbs.js index d4024657319795..1aa441a0aebf30 100644 --- a/docs/data/joy/components/breadcrumbs/CondensedBreadcrumbs.js +++ b/docs/data/joy/components/breadcrumbs/CondensedBreadcrumbs.js @@ -23,26 +23,19 @@ export default function CondensedBreadcrumbs() { setCondensed(false); }} variant="plain" - color="info" + color="primary" > β€’β€’β€’ ) : null} {navigationItems.map((item) => ( - event.preventDefault()} - underline="hover" - color="info" - href="/" - fontSize="inherit" - > - + + {item} ))} - - + + bablo.txt diff --git a/docs/data/joy/components/breadcrumbs/CondensedBreadcrumbs.tsx b/docs/data/joy/components/breadcrumbs/CondensedBreadcrumbs.tsx index 27aa8ef9fc1032..1e450e8468c53f 100644 --- a/docs/data/joy/components/breadcrumbs/CondensedBreadcrumbs.tsx +++ b/docs/data/joy/components/breadcrumbs/CondensedBreadcrumbs.tsx @@ -23,26 +23,19 @@ export default function CondensedBreadcrumbs() { setCondensed(false); }} variant="plain" - color="info" + color="primary" > β€’β€’β€’ ) : null} {navigationItems.map((item: string) => ( - event.preventDefault()} - underline="hover" - color="info" - href="/" - fontSize="inherit" - > - + + {item} ))} - - + + bablo.txt diff --git a/docs/data/joy/components/breadcrumbs/SeparatorBreadcrumbs.js b/docs/data/joy/components/breadcrumbs/SeparatorBreadcrumbs.js index 778b740ba80d25..5584e7ae8ea938 100644 --- a/docs/data/joy/components/breadcrumbs/SeparatorBreadcrumbs.js +++ b/docs/data/joy/components/breadcrumbs/SeparatorBreadcrumbs.js @@ -7,18 +7,9 @@ import Typography from '@mui/joy/Typography'; export default function SeparatorBreadcrumbs() { return ( } aria-label="breadcrumbs"> - Amy + Amy {['Characters', 'Futurama', 'TV Shows', 'Home'].map((item) => ( - event.preventDefault()} - key={item} - underline="hover" - color="neutral" - fontSize="inherit" - href="/" - > + {item} ))} diff --git a/docs/data/joy/components/breadcrumbs/SeparatorBreadcrumbs.tsx b/docs/data/joy/components/breadcrumbs/SeparatorBreadcrumbs.tsx index 1a39bfd74da6b1..c7f402ccc503a9 100644 --- a/docs/data/joy/components/breadcrumbs/SeparatorBreadcrumbs.tsx +++ b/docs/data/joy/components/breadcrumbs/SeparatorBreadcrumbs.tsx @@ -7,18 +7,9 @@ import Typography from '@mui/joy/Typography'; export default function SeparatorBreadcrumbs() { return ( } aria-label="breadcrumbs"> - Amy + Amy {['Characters', 'Futurama', 'TV Shows', 'Home'].map((item: string) => ( - event.preventDefault()} - key={item} - underline="hover" - color="neutral" - fontSize="inherit" - href="/" - > + {item} ))} diff --git a/docs/data/joy/components/breadcrumbs/SeparatorBreadcrumbs.tsx.preview b/docs/data/joy/components/breadcrumbs/SeparatorBreadcrumbs.tsx.preview new file mode 100644 index 00000000000000..2339cbc66cd23b --- /dev/null +++ b/docs/data/joy/components/breadcrumbs/SeparatorBreadcrumbs.tsx.preview @@ -0,0 +1,8 @@ +} aria-label="breadcrumbs"> + Amy + {['Characters', 'Futurama', 'TV Shows', 'Home'].map((item: string) => ( + + {item} + + ))} + \ No newline at end of file diff --git a/docs/data/joy/components/button-group/ButtonGroupColors.js b/docs/data/joy/components/button-group/ButtonGroupColors.js index 53c6f939645923..fcbc77510d4f4c 100644 --- a/docs/data/joy/components/button-group/ButtonGroupColors.js +++ b/docs/data/joy/components/button-group/ButtonGroupColors.js @@ -28,17 +28,6 @@ export default function ButtonGroupColors() { - - - - - - Soft - - - - - - - + - + Danger - @@ -51,7 +48,7 @@ export default function ButtonColors() { }} > Danger - @@ -52,7 +49,7 @@ export default function ButtonColors() { }} >
- - Yosemite National Park - - April 24 to May 02, 2021 + Yosemite National Park + April 24 to May 02, 2021 @@ -35,17 +33,17 @@ export default function BasicCard() {
- Total price: + Total price: $2,900
diff --git a/docs/data/joy/components/card/BasicCard.tsx b/docs/data/joy/components/card/BasicCard.tsx index cc6edb8bc0def1..a7ff812c6b4fbd 100644 --- a/docs/data/joy/components/card/BasicCard.tsx +++ b/docs/data/joy/components/card/BasicCard.tsx @@ -11,16 +11,14 @@ export default function BasicCard() { return (
- - Yosemite National Park - - April 24 to May 02, 2021 + Yosemite National Park + April 24 to May 02, 2021 @@ -35,17 +33,17 @@ export default function BasicCard() {
- Total price: + Total price: $2,900
diff --git a/docs/data/joy/components/card/BioCard.js b/docs/data/joy/components/card/BioCard.js index 2438f7926d27d6..a14d71aac2c0c5 100644 --- a/docs/data/joy/components/card/BioCard.js +++ b/docs/data/joy/components/card/BioCard.js @@ -10,6 +10,7 @@ import CardOverflow from '@mui/joy/CardOverflow'; import CardActions from '@mui/joy/CardActions'; import IconButton from '@mui/joy/IconButton'; import Typography from '@mui/joy/Typography'; +import SvgIcon from '@mui/joy/SvgIcon'; export default function BioCard() { return ( @@ -26,14 +27,17 @@ export default function BioCard() { size="sm" variant="soft" color="primary" - sx={{ mt: -1, border: '3px solid', borderColor: 'background.surface' }} + sx={{ + mt: -1, + mb: 1, + border: '3px solid', + borderColor: 'background.surface', + }} > PRO - - Josephine Blanton - - + Josephine Blanton + Hello, this is my bio and I am a PRO member of MUI. I am a developer and I love to code. @@ -46,60 +50,68 @@ export default function BioCard() { }} > - - - + + + + + - - - - + + + + + + - - - + + + + + - - - + + + + +
diff --git a/docs/data/joy/components/card/BioCard.tsx b/docs/data/joy/components/card/BioCard.tsx index 2438f7926d27d6..a14d71aac2c0c5 100644 --- a/docs/data/joy/components/card/BioCard.tsx +++ b/docs/data/joy/components/card/BioCard.tsx @@ -10,6 +10,7 @@ import CardOverflow from '@mui/joy/CardOverflow'; import CardActions from '@mui/joy/CardActions'; import IconButton from '@mui/joy/IconButton'; import Typography from '@mui/joy/Typography'; +import SvgIcon from '@mui/joy/SvgIcon'; export default function BioCard() { return ( @@ -26,14 +27,17 @@ export default function BioCard() { size="sm" variant="soft" color="primary" - sx={{ mt: -1, border: '3px solid', borderColor: 'background.surface' }} + sx={{ + mt: -1, + mb: 1, + border: '3px solid', + borderColor: 'background.surface', + }} > PRO - - Josephine Blanton - - + Josephine Blanton + Hello, this is my bio and I am a PRO member of MUI. I am a developer and I love to code. @@ -46,60 +50,68 @@ export default function BioCard() { }} > - - - + + + + + - - - - + + + + + + - - - + + + + + - - - + + + + + diff --git a/docs/data/joy/components/card/BottomActionsCard.js b/docs/data/joy/components/card/BottomActionsCard.js index f169e160828504..db7f1a4bfed566 100644 --- a/docs/data/joy/components/card/BottomActionsCard.js +++ b/docs/data/joy/components/card/BottomActionsCard.js @@ -37,10 +37,8 @@ export default function BottomActionsCard() { - - NYC Coders - - + NYC Coders + We are a community of developers prepping for coding interviews, participate, chat with others and get better at interviewing. diff --git a/docs/data/joy/components/card/BottomActionsCard.tsx b/docs/data/joy/components/card/BottomActionsCard.tsx index f169e160828504..db7f1a4bfed566 100644 --- a/docs/data/joy/components/card/BottomActionsCard.tsx +++ b/docs/data/joy/components/card/BottomActionsCard.tsx @@ -37,10 +37,8 @@ export default function BottomActionsCard() { - - NYC Coders - - + NYC Coders + We are a community of developers prepping for coding interviews, participate, chat with others and get better at interviewing. diff --git a/docs/data/joy/components/card/CardColors.js b/docs/data/joy/components/card/CardColors.js new file mode 100644 index 00000000000000..611c971ad7ff4b --- /dev/null +++ b/docs/data/joy/components/card/CardColors.js @@ -0,0 +1,108 @@ +import * as React from 'react'; +import Box from '@mui/joy/Box'; +import Button from '@mui/joy/Button'; +import Card from '@mui/joy/Card'; +import FormControl from '@mui/joy/FormControl'; +import FormLabel from '@mui/joy/FormLabel'; +import Typography from '@mui/joy/Typography'; +import Stack from '@mui/joy/Stack'; + +export default function CardColors() { + const [variant, setVariant] = React.useState('plain'); + const [color, setColor] = React.useState('neutral'); + return ( + + + + {color} {variant} card + + + + Variant + + + + + + + + + Color + + + + + + + + + + ); +} diff --git a/docs/data/joy/components/card/CardColors.tsx b/docs/data/joy/components/card/CardColors.tsx new file mode 100644 index 00000000000000..9c238d200c7b87 --- /dev/null +++ b/docs/data/joy/components/card/CardColors.tsx @@ -0,0 +1,109 @@ +import * as React from 'react'; +import Box from '@mui/joy/Box'; +import Button from '@mui/joy/Button'; +import Card from '@mui/joy/Card'; +import FormControl from '@mui/joy/FormControl'; +import FormLabel from '@mui/joy/FormLabel'; +import Typography from '@mui/joy/Typography'; +import Stack from '@mui/joy/Stack'; +import { VariantProp, ColorPaletteProp } from '@mui/joy/styles'; + +export default function CardColors() { + const [variant, setVariant] = React.useState('plain'); + const [color, setColor] = React.useState('neutral'); + return ( + + + + {color} {variant} card + + + + Variant + + + + + + + + + Color + + + + + + + + + + ); +} diff --git a/docs/data/joy/components/card/CardInvertedColors.js b/docs/data/joy/components/card/CardInvertedColors.js new file mode 100644 index 00000000000000..41ed0eec028270 --- /dev/null +++ b/docs/data/joy/components/card/CardInvertedColors.js @@ -0,0 +1,46 @@ +import * as React from 'react'; +import Button from '@mui/joy/Button'; +import Card from '@mui/joy/Card'; +import CardContent from '@mui/joy/CardContent'; +import CardActions from '@mui/joy/CardActions'; +import CircularProgress from '@mui/joy/CircularProgress'; +import Typography from '@mui/joy/Typography'; +import SvgIcon from '@mui/joy/SvgIcon'; + +export default function CardInvertedColors() { + return ( + + + + + + + + + + + Gross profit + $ 432.6M + + + + + + + + ); +} diff --git a/docs/data/joy/components/card/CardInvertedColors.tsx b/docs/data/joy/components/card/CardInvertedColors.tsx new file mode 100644 index 00000000000000..41ed0eec028270 --- /dev/null +++ b/docs/data/joy/components/card/CardInvertedColors.tsx @@ -0,0 +1,46 @@ +import * as React from 'react'; +import Button from '@mui/joy/Button'; +import Card from '@mui/joy/Card'; +import CardContent from '@mui/joy/CardContent'; +import CardActions from '@mui/joy/CardActions'; +import CircularProgress from '@mui/joy/CircularProgress'; +import Typography from '@mui/joy/Typography'; +import SvgIcon from '@mui/joy/SvgIcon'; + +export default function CardInvertedColors() { + return ( + + + + + + + + + + + Gross profit + $ 432.6M + + + + + + + + ); +} diff --git a/docs/data/joy/components/card/CardSizes.js b/docs/data/joy/components/card/CardSizes.js new file mode 100644 index 00000000000000..211aa4d493fa26 --- /dev/null +++ b/docs/data/joy/components/card/CardSizes.js @@ -0,0 +1,13 @@ +import * as React from 'react'; +import Stack from '@mui/joy/Stack'; +import Card from '@mui/joy/Card'; + +export default function CardSizes() { + return ( + + Small card + Medium card (default) + Large card + + ); +} diff --git a/docs/data/joy/components/card/CardSizes.tsx b/docs/data/joy/components/card/CardSizes.tsx new file mode 100644 index 00000000000000..211aa4d493fa26 --- /dev/null +++ b/docs/data/joy/components/card/CardSizes.tsx @@ -0,0 +1,13 @@ +import * as React from 'react'; +import Stack from '@mui/joy/Stack'; +import Card from '@mui/joy/Card'; + +export default function CardSizes() { + return ( + + Small card + Medium card (default) + Large card + + ); +} diff --git a/docs/data/joy/components/card/CardSizes.tsx.preview b/docs/data/joy/components/card/CardSizes.tsx.preview new file mode 100644 index 00000000000000..ab63e5e3e6bb41 --- /dev/null +++ b/docs/data/joy/components/card/CardSizes.tsx.preview @@ -0,0 +1,3 @@ +Small card +Medium card (default) +Large card \ No newline at end of file diff --git a/docs/data/joy/components/card/CardUsage.js b/docs/data/joy/components/card/CardUsage.js index 08cfb0ee1de3a0..ff23573eda755e 100644 --- a/docs/data/joy/components/card/CardUsage.js +++ b/docs/data/joy/components/card/CardUsage.js @@ -56,7 +56,7 @@ export default function CardUsage() { Yosemite - April 24 to May 02, 2021 + April 24 to May 02, 2021 diff --git a/docs/data/joy/components/card/CardVariables.js b/docs/data/joy/components/card/CardVariables.js index 2e88ede3237a92..0092a7a16f8c5f 100644 --- a/docs/data/joy/components/card/CardVariables.js +++ b/docs/data/joy/components/card/CardVariables.js @@ -111,7 +111,7 @@ export default function CardVariables() { Card title - A very very long description. + A very very long description. @@ -159,7 +159,7 @@ export default function CardVariables() { Card title - + Long description. @@ -180,7 +180,7 @@ export default function CardVariables() { }} > - + CSS variables {vars.map((data) => ( @@ -194,7 +194,7 @@ export default function CardVariables() { defaultValue={ Number(data.defaultValue.replace('px', '')) || undefined } - endDecorator={px} + endDecorator={px} type={data.type} sx={{ maxWidth: 160, diff --git a/docs/data/joy/components/card/CardVariants.js b/docs/data/joy/components/card/CardVariants.js new file mode 100644 index 00000000000000..7c6ff6f75257bf --- /dev/null +++ b/docs/data/joy/components/card/CardVariants.js @@ -0,0 +1,49 @@ +import * as React from 'react'; +import Box from '@mui/joy/Box'; +import Card from '@mui/joy/Card'; +import CardContent from '@mui/joy/CardContent'; +import Typography from '@mui/joy/Typography'; + +export default function CardVariants() { + return ( + + + + Plain card (default) + Description of the card. + + + + + + Outlined card + Description of the card. + + + + + + Soft card + Description of the card. + + + + + + + Solid card + + Description of the card. + + + + ); +} diff --git a/docs/data/joy/components/card/CardVariants.tsx b/docs/data/joy/components/card/CardVariants.tsx new file mode 100644 index 00000000000000..7c6ff6f75257bf --- /dev/null +++ b/docs/data/joy/components/card/CardVariants.tsx @@ -0,0 +1,49 @@ +import * as React from 'react'; +import Box from '@mui/joy/Box'; +import Card from '@mui/joy/Card'; +import CardContent from '@mui/joy/CardContent'; +import Typography from '@mui/joy/Typography'; + +export default function CardVariants() { + return ( + + + + Plain card (default) + Description of the card. + + + + + + Outlined card + Description of the card. + + + + + + Soft card + Description of the card. + + + + + + + Solid card + + Description of the card. + + + + ); +} diff --git a/docs/data/joy/components/card/CongratCard.js b/docs/data/joy/components/card/CongratCard.js index 0d21e669967dee..a1e1eeafcdfacd 100644 --- a/docs/data/joy/components/card/CongratCard.js +++ b/docs/data/joy/components/card/CongratCard.js @@ -38,11 +38,11 @@ export default function CongratCard() { }} >
- +
- + 🎊 Congrats Julia 🎊 diff --git a/docs/data/joy/components/card/CongratCard.tsx b/docs/data/joy/components/card/CongratCard.tsx index 0d21e669967dee..a1e1eeafcdfacd 100644 --- a/docs/data/joy/components/card/CongratCard.tsx +++ b/docs/data/joy/components/card/CongratCard.tsx @@ -38,11 +38,11 @@ export default function CongratCard() { }} >
- +
- + 🎊 Congrats Julia 🎊 diff --git a/docs/data/joy/components/card/ContainerResponsive.js b/docs/data/joy/components/card/ContainerResponsive.js index 698f415b18b49f..2e34e65029cfc4 100644 --- a/docs/data/joy/components/card/ContainerResponsive.js +++ b/docs/data/joy/components/card/ContainerResponsive.js @@ -54,7 +54,7 @@ export default function ContainerResponsive() { >
- + - California, USA + California, USA
- Designed by - - Nature itself - + Designed by + Nature itself
diff --git a/docs/data/joy/components/card/ContainerResponsive.tsx b/docs/data/joy/components/card/ContainerResponsive.tsx index 698f415b18b49f..2e34e65029cfc4 100644 --- a/docs/data/joy/components/card/ContainerResponsive.tsx +++ b/docs/data/joy/components/card/ContainerResponsive.tsx @@ -54,7 +54,7 @@ export default function ContainerResponsive() { >
- + - California, USA + California, USA
- Designed by - - Nature itself - + Designed by + Nature itself
diff --git a/docs/data/joy/components/card/CreditCardForm.js b/docs/data/joy/components/card/CreditCardForm.js index 04fe92e533da99..2d852a511e45c0 100644 --- a/docs/data/joy/components/card/CreditCardForm.js +++ b/docs/data/joy/components/card/CreditCardForm.js @@ -25,7 +25,7 @@ export default function CreditCardForm() { resize: 'horizontal', }} > - }> + }> Add new card diff --git a/docs/data/joy/components/card/CreditCardForm.tsx b/docs/data/joy/components/card/CreditCardForm.tsx index 04fe92e533da99..2d852a511e45c0 100644 --- a/docs/data/joy/components/card/CreditCardForm.tsx +++ b/docs/data/joy/components/card/CreditCardForm.tsx @@ -25,7 +25,7 @@ export default function CreditCardForm() { resize: 'horizontal', }} > - }> + }> Add new card diff --git a/docs/data/joy/components/card/DribbbleShot.js b/docs/data/joy/components/card/DribbbleShot.js index 7bf5c5dfe0a02d..183c013ecb5c2e 100644 --- a/docs/data/joy/components/card/DribbbleShot.js +++ b/docs/data/joy/components/card/DribbbleShot.js @@ -105,7 +105,7 @@ export default function DribbbleShot() { } sx={{ @@ -119,7 +119,7 @@ export default function DribbbleShot() { } sx={{ diff --git a/docs/data/joy/components/card/DribbbleShot.tsx b/docs/data/joy/components/card/DribbbleShot.tsx index 7bf5c5dfe0a02d..183c013ecb5c2e 100644 --- a/docs/data/joy/components/card/DribbbleShot.tsx +++ b/docs/data/joy/components/card/DribbbleShot.tsx @@ -105,7 +105,7 @@ export default function DribbbleShot() { } sx={{ @@ -119,7 +119,7 @@ export default function DribbbleShot() { } sx={{ diff --git a/docs/data/joy/components/card/FAQCard.js b/docs/data/joy/components/card/FAQCard.js index e5098b3488e559..6b8273d6db6de6 100644 --- a/docs/data/joy/components/card/FAQCard.js +++ b/docs/data/joy/components/card/FAQCard.js @@ -32,7 +32,7 @@ export default function FAQCard() { px: 'var(--Card-padding)', }} > - + 89 @@ -47,9 +47,7 @@ export default function FAQCard() { /> - - Need Some Help? - + Need Some Help? Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor. diff --git a/docs/data/joy/components/card/FAQCard.tsx b/docs/data/joy/components/card/FAQCard.tsx index e5098b3488e559..6b8273d6db6de6 100644 --- a/docs/data/joy/components/card/FAQCard.tsx +++ b/docs/data/joy/components/card/FAQCard.tsx @@ -32,7 +32,7 @@ export default function FAQCard() { px: 'var(--Card-padding)', }} > - + 89 @@ -47,9 +47,7 @@ export default function FAQCard() { /> - - Need Some Help? - + Need Some Help? Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor. diff --git a/docs/data/joy/components/card/GradientCover.js b/docs/data/joy/components/card/GradientCover.js index 0ac96756482e3d..c053fe11476ebb 100644 --- a/docs/data/joy/components/card/GradientCover.js +++ b/docs/data/joy/components/card/GradientCover.js @@ -23,7 +23,7 @@ export default function GradientCover() { }} /> - + Yosemite National Park - + Yosemite National Park - + Yosemite Park - + - + Yosemite Park - + - Individual License - - $58{' '} - - /month + + + Sketch 55+ + + + Figma + + +
+ + $58{' '} + + /month + + +
+
+ Individual License + + This license allows you to use the Symbol System Design with unlimited + amount of personal and commercial projects. - - - This license allows you to use the Symbol System Design with unlimited amount - of personal and commercial projects. - +
- - Compatible with Sketch 55+ - ); } diff --git a/docs/data/joy/components/card/LicenseCard.tsx b/docs/data/joy/components/card/LicenseCard.tsx index c59cca8a28ccef..768fc3e65476d1 100644 --- a/docs/data/joy/components/card/LicenseCard.tsx +++ b/docs/data/joy/components/card/LicenseCard.tsx @@ -1,8 +1,10 @@ import * as React from 'react'; +import Box from '@mui/joy/Box'; +import Button from '@mui/joy/Button'; import Card from '@mui/joy/Card'; import CardActions from '@mui/joy/CardActions'; +import Chip from '@mui/joy/Chip'; import Typography from '@mui/joy/Typography'; -import Button from '@mui/joy/Button'; export default function LicenseCard() { return ( @@ -11,30 +13,40 @@ export default function LicenseCard() { color="primary" invertedColors sx={{ - width: 343, + boxShadow: 'lg', + width: 400, maxWidth: '100%', // to make the demo resizeable overflow: 'auto', resize: 'horizontal', }} > - Individual License - - $58{' '} - - /month + + + Sketch 55+ + + + Figma + + +
+ + $58{' '} + + /month + + +
+
+ Individual License + + This license allows you to use the Symbol System Design with unlimited + amount of personal and commercial projects. - - - This license allows you to use the Symbol System Design with unlimited amount - of personal and commercial projects. - +
- - Compatible with Sketch 55+ - ); } diff --git a/docs/data/joy/components/card/MediaCover.js b/docs/data/joy/components/card/MediaCover.js index 32a091ea6e3277..7361d473da19dc 100644 --- a/docs/data/joy/components/card/MediaCover.js +++ b/docs/data/joy/components/card/MediaCover.js @@ -22,7 +22,7 @@ export default function MediaCover() { - + Yosemite National Park - + California @@ -52,14 +52,14 @@ export default function MultipleInteractionCard() { 6.3k views 1 hour ago diff --git a/docs/data/joy/components/card/MultipleInteractionCard.tsx b/docs/data/joy/components/card/MultipleInteractionCard.tsx index 9668b2ec40fb06..768d7a305b8706 100644 --- a/docs/data/joy/components/card/MultipleInteractionCard.tsx +++ b/docs/data/joy/components/card/MultipleInteractionCard.tsx @@ -39,12 +39,12 @@ export default function MultipleInteractionCard() { - + Yosemite National Park - + California @@ -52,14 +52,14 @@ export default function MultipleInteractionCard() { 6.3k views 1 hour ago diff --git a/docs/data/joy/components/card/OverflowCard.js b/docs/data/joy/components/card/OverflowCard.js index 997160da063a9a..291c33dcedfdf2 100644 --- a/docs/data/joy/components/card/OverflowCard.js +++ b/docs/data/joy/components/card/OverflowCard.js @@ -20,21 +20,17 @@ export default function OverflowCard() { - - Yosemite National Park - - - California - + Yosemite National Park + California - + 6.3k views - + 1 hour ago diff --git a/docs/data/joy/components/card/OverflowCard.tsx b/docs/data/joy/components/card/OverflowCard.tsx index 997160da063a9a..291c33dcedfdf2 100644 --- a/docs/data/joy/components/card/OverflowCard.tsx +++ b/docs/data/joy/components/card/OverflowCard.tsx @@ -20,21 +20,17 @@ export default function OverflowCard() { - - Yosemite National Park - - - California - + Yosemite National Park + California - + 6.3k views - + 1 hour ago diff --git a/docs/data/joy/components/card/PricingCards.js b/docs/data/joy/components/card/PricingCards.js index 60962444cc6dc1..28ac8138f695df 100644 --- a/docs/data/joy/components/card/PricingCards.js +++ b/docs/data/joy/components/card/PricingCards.js @@ -26,9 +26,7 @@ export default function PricingCards() { BASIC - - Professional - + Professional @@ -58,7 +56,7 @@ export default function PricingCards() { - + 3.990€{' '} / month @@ -83,9 +81,7 @@ export default function PricingCards() { MOST POPULAR - - Unlimited - + Unlimited - + 5.990€{' '} / month diff --git a/docs/data/joy/components/card/PricingCards.tsx b/docs/data/joy/components/card/PricingCards.tsx index 60962444cc6dc1..28ac8138f695df 100644 --- a/docs/data/joy/components/card/PricingCards.tsx +++ b/docs/data/joy/components/card/PricingCards.tsx @@ -26,9 +26,7 @@ export default function PricingCards() { BASIC - - Professional - + Professional @@ -58,7 +56,7 @@ export default function PricingCards() { - + 3.990€{' '} / month @@ -83,9 +81,7 @@ export default function PricingCards() { MOST POPULAR - - Unlimited - + Unlimited - + 5.990€{' '} / month diff --git a/docs/data/joy/components/card/ProductCard.js b/docs/data/joy/components/card/ProductCard.js index 22e82ac431309f..44faf4dcc1846e 100644 --- a/docs/data/joy/components/card/ProductCard.js +++ b/docs/data/joy/components/card/ProductCard.js @@ -23,10 +23,10 @@ export default function ProductCard() { - Bluetooth Headset + Bluetooth Headset Lowest price @@ -47,7 +46,7 @@ export default function ProductCard() { > 2,900 THB - + (Only 7 left in stock!) diff --git a/docs/data/joy/components/card/ProductCard.tsx b/docs/data/joy/components/card/ProductCard.tsx index 22e82ac431309f..44faf4dcc1846e 100644 --- a/docs/data/joy/components/card/ProductCard.tsx +++ b/docs/data/joy/components/card/ProductCard.tsx @@ -23,10 +23,10 @@ export default function ProductCard() { - Bluetooth Headset + Bluetooth Headset Lowest price @@ -47,7 +46,7 @@ export default function ProductCard() { > 2,900 THB - + (Only 7 left in stock!) diff --git a/docs/data/joy/components/card/RowCard.js b/docs/data/joy/components/card/RowCard.js index adcd7bc45409c4..2c19ee4c1ae8c5 100644 --- a/docs/data/joy/components/card/RowCard.js +++ b/docs/data/joy/components/card/RowCard.js @@ -7,11 +7,7 @@ import Typography from '@mui/joy/Typography'; export default function RowCard() { return ( - + Yosemite Park - California, USA + California, USA + Yosemite Park - California, USA + California, USA Alex Morrison - + Senior Journalist
- + Articles 34
- + Followers 980
- + Rating 8.9 diff --git a/docs/data/joy/components/card/UserCard.tsx b/docs/data/joy/components/card/UserCard.tsx index f15e87554f5c05..27d4bf82ac6686 100644 --- a/docs/data/joy/components/card/UserCard.tsx +++ b/docs/data/joy/components/card/UserCard.tsx @@ -74,7 +74,7 @@ export default function UserCard() { Alex Morrison - + Senior Journalist
- + Articles 34
- + Followers 980
- + Rating 8.9 diff --git a/docs/data/joy/components/card/card.md b/docs/data/joy/components/card/card.md index 4fbb0010a21091..d08215058bd57f 100644 --- a/docs/data/joy/components/card/card.md +++ b/docs/data/joy/components/card/card.md @@ -34,6 +34,44 @@ The demo below shows a typical Card that groups together Typography, Aspect Rati ## Customization +### Variants + +The Card component supports Joy UI's four [global variants](/joy-ui/main-features/global-variants/): `plain` (default), `outlined`, `soft`, and `solid`. + +{{"demo": "CardVariants.js"}} + +:::info +To learn how to add your own variants, check out [Themed componentsβ€”Extend variants](/joy-ui/customization/themed-components/#extend-variants). +Note that you lose the global variants when you add custom variants. +::: + +### Sizes + +The Card component comes in three sizes: `sm`, `md` (default), and `lg`. + +Each size has different padding, gap, and font size values. + +{{"demo": "CardSizes.js"}} + +:::info +To learn how to add custom sizes to the component, check out [Themed componentsβ€”Extend sizes](/joy-ui/customization/themed-components/#extend-sizes). +::: + +### Colors + +Every palette included in the theme is available via the `color` prop. +Play around combining different colors with different variants. + +{{"demo": "CardColors.js"}} + +### Inverted colors + +When the Card's variant is `soft` or `solid`, you can use the `invertedColors={true}` prop to invert the colors of the children to have enough contrast. + +To learn more about this, check out [Color Inversion](/joy-ui/main-features/color-inversion/) feature. + +{{"demo": "CardInvertedColors.js"}} + ### Expand to fill ```jsx diff --git a/docs/data/joy/components/checkbox/CheckboxColors.js b/docs/data/joy/components/checkbox/CheckboxColors.js index 177b0c852c3456..57d7c4a2bce278 100644 --- a/docs/data/joy/components/checkbox/CheckboxColors.js +++ b/docs/data/joy/components/checkbox/CheckboxColors.js @@ -8,7 +8,6 @@ export default function CheckboxColors() { - diff --git a/docs/data/joy/components/checkbox/CheckboxColors.tsx b/docs/data/joy/components/checkbox/CheckboxColors.tsx index 177b0c852c3456..57d7c4a2bce278 100644 --- a/docs/data/joy/components/checkbox/CheckboxColors.tsx +++ b/docs/data/joy/components/checkbox/CheckboxColors.tsx @@ -8,7 +8,6 @@ export default function CheckboxColors() { - diff --git a/docs/data/joy/components/checkbox/CheckboxColors.tsx.preview b/docs/data/joy/components/checkbox/CheckboxColors.tsx.preview index cddc06bd540d56..38b62d6bfc0717 100644 --- a/docs/data/joy/components/checkbox/CheckboxColors.tsx.preview +++ b/docs/data/joy/components/checkbox/CheckboxColors.tsx.preview @@ -1,6 +1,5 @@ - \ No newline at end of file diff --git a/docs/data/joy/components/checkbox/ExampleButtonCheckbox.js b/docs/data/joy/components/checkbox/ExampleButtonCheckbox.js index 27c8be8747a045..cf991e1d29c76e 100644 --- a/docs/data/joy/components/checkbox/ExampleButtonCheckbox.js +++ b/docs/data/joy/components/checkbox/ExampleButtonCheckbox.js @@ -16,7 +16,6 @@ export default function ExampleButtonCheckbox() { role="group" orientation="horizontal" sx={{ - bgcolor: 'background.body', flexGrow: 0, '--List-gap': '8px', '--List-padding': '8px', diff --git a/docs/data/joy/components/checkbox/ExampleButtonCheckbox.tsx b/docs/data/joy/components/checkbox/ExampleButtonCheckbox.tsx index 19d2cec78b9d2a..cb311fbd8bb6c2 100644 --- a/docs/data/joy/components/checkbox/ExampleButtonCheckbox.tsx +++ b/docs/data/joy/components/checkbox/ExampleButtonCheckbox.tsx @@ -16,7 +16,6 @@ export default function ExampleButtonCheckbox() { role="group" orientation="horizontal" sx={{ - bgcolor: 'background.body', flexGrow: 0, '--List-gap': '8px', '--List-padding': '8px', diff --git a/docs/data/joy/components/checkbox/ExampleChoiceChipCheckbox.js b/docs/data/joy/components/checkbox/ExampleChoiceChipCheckbox.js index ac16d2a88cad31..ceca95867e6a56 100644 --- a/docs/data/joy/components/checkbox/ExampleChoiceChipCheckbox.js +++ b/docs/data/joy/components/checkbox/ExampleChoiceChipCheckbox.js @@ -10,11 +10,8 @@ import Done from '@mui/icons-material/Done'; export default function ExampleChoiceChipCheckbox() { const [value, setValue] = React.useState([]); return ( - - + + Choose amenities diff --git a/docs/data/joy/components/checkbox/ExampleChoiceChipCheckbox.tsx b/docs/data/joy/components/checkbox/ExampleChoiceChipCheckbox.tsx index ae9a52c12170d9..ac5d99ceabef6a 100644 --- a/docs/data/joy/components/checkbox/ExampleChoiceChipCheckbox.tsx +++ b/docs/data/joy/components/checkbox/ExampleChoiceChipCheckbox.tsx @@ -10,11 +10,8 @@ import Done from '@mui/icons-material/Done'; export default function ExampleChoiceChipCheckbox() { const [value, setValue] = React.useState([]); return ( - - + + Choose amenities diff --git a/docs/data/joy/components/checkbox/ExampleFilterMemberCheckbox.js b/docs/data/joy/components/checkbox/ExampleFilterMemberCheckbox.js index 01114edfde01cd..7a5fff26076820 100644 --- a/docs/data/joy/components/checkbox/ExampleFilterMemberCheckbox.js +++ b/docs/data/joy/components/checkbox/ExampleFilterMemberCheckbox.js @@ -19,7 +19,6 @@ export default function ExampleFilterMemberCheckbox() { variant="outlined" sx={{ p: 2, - bgcolor: 'background.body', borderRadius: 'sm', width: 360, maxWidth: '100%', @@ -29,7 +28,7 @@ export default function ExampleFilterMemberCheckbox() { id="member" sx={{ textTransform: 'uppercase', - fontSize: 'xs2', + fontSize: 'xs', letterSpacing: 'lg', fontWeight: 'lg', color: 'text.secondary', diff --git a/docs/data/joy/components/checkbox/ExampleFilterMemberCheckbox.tsx b/docs/data/joy/components/checkbox/ExampleFilterMemberCheckbox.tsx index e9de59515da594..7e3ef186e25e4d 100644 --- a/docs/data/joy/components/checkbox/ExampleFilterMemberCheckbox.tsx +++ b/docs/data/joy/components/checkbox/ExampleFilterMemberCheckbox.tsx @@ -20,7 +20,7 @@ export default function ExampleFilterMemberCheckbox() { variant="outlined" sx={{ p: 2, - bgcolor: 'background.body', + borderRadius: 'sm', width: 360, maxWidth: '100%', @@ -30,7 +30,7 @@ export default function ExampleFilterMemberCheckbox() { id="member" sx={{ textTransform: 'uppercase', - fontSize: 'xs2', + fontSize: 'xs', letterSpacing: 'lg', fontWeight: 'lg', color: 'text.secondary', diff --git a/docs/data/joy/components/checkbox/ExampleFilterStatusCheckbox.js b/docs/data/joy/components/checkbox/ExampleFilterStatusCheckbox.js index f80008ec27bc72..47c5036fdc1157 100644 --- a/docs/data/joy/components/checkbox/ExampleFilterStatusCheckbox.js +++ b/docs/data/joy/components/checkbox/ExampleFilterStatusCheckbox.js @@ -14,15 +14,12 @@ export default function ExampleFilterStatusCheckbox() { wrongAddress: false, }); return ( - + + - + Read our terms and conditions. diff --git a/docs/data/joy/components/checkbox/ExampleSignUpCheckbox.tsx b/docs/data/joy/components/checkbox/ExampleSignUpCheckbox.tsx index 2402ddcc8909f1..9e4acc3fd4dcd8 100644 --- a/docs/data/joy/components/checkbox/ExampleSignUpCheckbox.tsx +++ b/docs/data/joy/components/checkbox/ExampleSignUpCheckbox.tsx @@ -17,7 +17,7 @@ export default function ExampleSignUpCheckbox() { } /> - + Read our terms and conditions. diff --git a/docs/data/joy/components/checkbox/ExampleSignUpCheckbox.tsx.preview b/docs/data/joy/components/checkbox/ExampleSignUpCheckbox.tsx.preview index b9652048ff5e8e..bee71afb851987 100644 --- a/docs/data/joy/components/checkbox/ExampleSignUpCheckbox.tsx.preview +++ b/docs/data/joy/components/checkbox/ExampleSignUpCheckbox.tsx.preview @@ -8,7 +8,7 @@ } /> - + Read our terms and conditions. diff --git a/docs/data/joy/components/checkbox/GroupCheckboxes.js b/docs/data/joy/components/checkbox/GroupCheckboxes.js index 78f6825dcccee8..11db485221a8a5 100644 --- a/docs/data/joy/components/checkbox/GroupCheckboxes.js +++ b/docs/data/joy/components/checkbox/GroupCheckboxes.js @@ -8,7 +8,7 @@ import Typography from '@mui/joy/Typography'; export default function GroupCheckboxes() { return ( - + Sandwich Dressings diff --git a/docs/data/joy/components/checkbox/GroupCheckboxes.tsx b/docs/data/joy/components/checkbox/GroupCheckboxes.tsx index 78f6825dcccee8..11db485221a8a5 100644 --- a/docs/data/joy/components/checkbox/GroupCheckboxes.tsx +++ b/docs/data/joy/components/checkbox/GroupCheckboxes.tsx @@ -8,7 +8,7 @@ import Typography from '@mui/joy/Typography'; export default function GroupCheckboxes() { return ( - + Sandwich Dressings diff --git a/docs/data/joy/components/checkbox/GroupCheckboxes.tsx.preview b/docs/data/joy/components/checkbox/GroupCheckboxes.tsx.preview index 19297a721c90c5..db702453689f61 100644 --- a/docs/data/joy/components/checkbox/GroupCheckboxes.tsx.preview +++ b/docs/data/joy/components/checkbox/GroupCheckboxes.tsx.preview @@ -1,4 +1,4 @@ - + Sandwich Dressings diff --git a/docs/data/joy/components/checkbox/HoverCheckbox.js b/docs/data/joy/components/checkbox/HoverCheckbox.js index 9c24175b214868..75665f39cc8354 100644 --- a/docs/data/joy/components/checkbox/HoverCheckbox.js +++ b/docs/data/joy/components/checkbox/HoverCheckbox.js @@ -11,9 +11,9 @@ export default function HoverCheckbox() { root: ({ checked, focusVisible }) => ({ sx: !checked ? { - '& svg': { opacity: focusVisible ? 0.32 : 0 }, + '& svg': { opacity: focusVisible ? 1 : 0 }, '&:hover svg': { - opacity: 0.32, + opacity: 1, }, } : undefined, diff --git a/docs/data/joy/components/checkbox/HoverCheckbox.tsx b/docs/data/joy/components/checkbox/HoverCheckbox.tsx index 9c24175b214868..75665f39cc8354 100644 --- a/docs/data/joy/components/checkbox/HoverCheckbox.tsx +++ b/docs/data/joy/components/checkbox/HoverCheckbox.tsx @@ -11,9 +11,9 @@ export default function HoverCheckbox() { root: ({ checked, focusVisible }) => ({ sx: !checked ? { - '& svg': { opacity: focusVisible ? 0.32 : 0 }, + '& svg': { opacity: focusVisible ? 1 : 0 }, '&:hover svg': { - opacity: 0.32, + opacity: 1, }, } : undefined, diff --git a/docs/data/joy/components/checkbox/HoverCheckbox.tsx.preview b/docs/data/joy/components/checkbox/HoverCheckbox.tsx.preview index 9370853c2f328b..bb8b9476b6c843 100644 --- a/docs/data/joy/components/checkbox/HoverCheckbox.tsx.preview +++ b/docs/data/joy/components/checkbox/HoverCheckbox.tsx.preview @@ -5,9 +5,9 @@ root: ({ checked, focusVisible }) => ({ sx: !checked ? { - '& svg': { opacity: focusVisible ? 0.32 : 0 }, + '& svg': { opacity: focusVisible ? 1 : 0 }, '&:hover svg': { - opacity: 0.32, + opacity: 1, }, } : undefined, diff --git a/docs/data/joy/components/checkbox/IconlessCheckbox.js b/docs/data/joy/components/checkbox/IconlessCheckbox.js index 8c1a9b11d4c792..4587e4fa3a50eb 100644 --- a/docs/data/joy/components/checkbox/IconlessCheckbox.js +++ b/docs/data/joy/components/checkbox/IconlessCheckbox.js @@ -8,7 +8,7 @@ import Typography from '@mui/joy/Typography'; export default function IconlessCheckbox() { return ( - + Pizza toppings diff --git a/docs/data/joy/components/checkbox/IconlessCheckbox.tsx b/docs/data/joy/components/checkbox/IconlessCheckbox.tsx index 8c1a9b11d4c792..4587e4fa3a50eb 100644 --- a/docs/data/joy/components/checkbox/IconlessCheckbox.tsx +++ b/docs/data/joy/components/checkbox/IconlessCheckbox.tsx @@ -8,7 +8,7 @@ import Typography from '@mui/joy/Typography'; export default function IconlessCheckbox() { return ( - + Pizza toppings diff --git a/docs/data/joy/components/checkbox/OverlayCheckbox.js b/docs/data/joy/components/checkbox/OverlayCheckbox.js index f4d0413f57f485..f7b8c5209d2f1a 100644 --- a/docs/data/joy/components/checkbox/OverlayCheckbox.js +++ b/docs/data/joy/components/checkbox/OverlayCheckbox.js @@ -11,13 +11,13 @@ export default function OverlayCheckbox() { flexDirection: 'column', gap: 2, width: 300, - '& > div': { p: 2, boxShadow: 'sm', borderRadius: 'xs', display: 'flex' }, + '& > div': { p: 2, borderRadius: 'md', display: 'flex' }, }} > - + - + div': { p: 2, boxShadow: 'sm', borderRadius: 'xs', display: 'flex' }, + '& > div': { p: 2, borderRadius: 'md', display: 'flex' }, }} > - + - + + - + - + Favorite Movies diff --git a/docs/data/joy/components/chip/CheckboxChip.tsx b/docs/data/joy/components/chip/CheckboxChip.tsx index 65b2cea4824582..2aeb6ec19f18a8 100644 --- a/docs/data/joy/components/chip/CheckboxChip.tsx +++ b/docs/data/joy/components/chip/CheckboxChip.tsx @@ -11,7 +11,7 @@ export default function CheckboxChip() { return ( - + Favorite Movies diff --git a/docs/data/joy/components/chip/ChipUsage.js b/docs/data/joy/components/chip/ChipUsage.js index ee5396e9589a3e..96e52e75bb0455 100644 --- a/docs/data/joy/components/chip/ChipUsage.js +++ b/docs/data/joy/components/chip/ChipUsage.js @@ -10,13 +10,13 @@ export default function ChipUsages() { { propName: 'variant', knob: 'radio', - defaultValue: 'solid', + defaultValue: 'soft', options: ['plain', 'outlined', 'soft', 'solid'], }, { propName: 'color', knob: 'color', - defaultValue: 'primary', + defaultValue: 'neutral', }, { propName: 'size', diff --git a/docs/data/joy/components/chip/RadioChip.js b/docs/data/joy/components/chip/RadioChip.js index 76fa5acbe0abc7..e2d620cc9301a7 100644 --- a/docs/data/joy/components/chip/RadioChip.js +++ b/docs/data/joy/components/chip/RadioChip.js @@ -12,7 +12,7 @@ export default function RadioChip() { return ( - + Best Movie diff --git a/docs/data/joy/components/chip/RadioChip.tsx b/docs/data/joy/components/chip/RadioChip.tsx index 76fa5acbe0abc7..e2d620cc9301a7 100644 --- a/docs/data/joy/components/chip/RadioChip.tsx +++ b/docs/data/joy/components/chip/RadioChip.tsx @@ -12,7 +12,7 @@ export default function RadioChip() { return ( - + Best Movie diff --git a/docs/data/joy/components/circular-progress/CircularProgressButton.js b/docs/data/joy/components/circular-progress/CircularProgressButton.js index c14ec84d10a5de..f3be882119e0c0 100644 --- a/docs/data/joy/components/circular-progress/CircularProgressButton.js +++ b/docs/data/joy/components/circular-progress/CircularProgressButton.js @@ -8,23 +8,15 @@ import CircularProgress from '@mui/joy/CircularProgress'; export default function CircularProgressButton() { return ( - + - + {/* eslint-disable-next-line jsx-a11y/anchor-is-valid */} - } + variant="plain" + startDecorator={} sx={{ p: 1 }} > Submitting... diff --git a/docs/data/joy/components/circular-progress/CircularProgressButton.tsx b/docs/data/joy/components/circular-progress/CircularProgressButton.tsx index c14ec84d10a5de..f3be882119e0c0 100644 --- a/docs/data/joy/components/circular-progress/CircularProgressButton.tsx +++ b/docs/data/joy/components/circular-progress/CircularProgressButton.tsx @@ -8,23 +8,15 @@ import CircularProgress from '@mui/joy/CircularProgress'; export default function CircularProgressButton() { return ( - + - + {/* eslint-disable-next-line jsx-a11y/anchor-is-valid */} - } + variant="plain" + startDecorator={} sx={{ p: 1 }} > Submitting... diff --git a/docs/data/joy/components/circular-progress/CircularProgressButton.tsx.preview b/docs/data/joy/components/circular-progress/CircularProgressButton.tsx.preview new file mode 100644 index 00000000000000..e4c6378f929eaa --- /dev/null +++ b/docs/data/joy/components/circular-progress/CircularProgressButton.tsx.preview @@ -0,0 +1,13 @@ + + + + +{/* eslint-disable-next-line jsx-a11y/anchor-is-valid */} +} + sx={{ p: 1 }} +> + Submitting... + \ No newline at end of file diff --git a/docs/data/joy/components/circular-progress/CircularProgressColors.js b/docs/data/joy/components/circular-progress/CircularProgressColors.js index 8754f8dd5c6f0f..7616784f33d59a 100644 --- a/docs/data/joy/components/circular-progress/CircularProgressColors.js +++ b/docs/data/joy/components/circular-progress/CircularProgressColors.js @@ -27,7 +27,6 @@ export default function CircularProgressColors() { - @@ -40,7 +39,7 @@ export default function CircularProgressColors() { }} > - @@ -40,7 +39,7 @@ export default function CircularProgressColors() { }} > - + Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry standard dummy text ever since the 1500s diff --git a/docs/data/joy/components/divider/DividerInCard.tsx b/docs/data/joy/components/divider/DividerInCard.tsx index d0b5f14cda8bc6..05f7558a1e4059 100644 --- a/docs/data/joy/components/divider/DividerInCard.tsx +++ b/docs/data/joy/components/divider/DividerInCard.tsx @@ -30,7 +30,7 @@ export default function DividerInCard() { - + Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry standard dummy text ever since the 1500s diff --git a/docs/data/joy/components/divider/DividerInModalDialog.js b/docs/data/joy/components/divider/DividerInModalDialog.js index 5a94fbeee4c79f..faa015d6f27260 100644 --- a/docs/data/joy/components/divider/DividerInModalDialog.js +++ b/docs/data/joy/components/divider/DividerInModalDialog.js @@ -21,7 +21,7 @@ export default function DividerInModalDialog() { Modal Title - + Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry standard dummy text ever since the 1500s diff --git a/docs/data/joy/components/divider/DividerInModalDialog.tsx b/docs/data/joy/components/divider/DividerInModalDialog.tsx index 5a94fbeee4c79f..faa015d6f27260 100644 --- a/docs/data/joy/components/divider/DividerInModalDialog.tsx +++ b/docs/data/joy/components/divider/DividerInModalDialog.tsx @@ -21,7 +21,7 @@ export default function DividerInModalDialog() { Modal Title - + Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry standard dummy text ever since the 1500s diff --git a/docs/data/joy/components/grid/AutoGrid.js b/docs/data/joy/components/grid/AutoGrid.js index 41161bb6b237c7..987cf360c6e5c1 100644 --- a/docs/data/joy/components/grid/AutoGrid.js +++ b/docs/data/joy/components/grid/AutoGrid.js @@ -6,7 +6,7 @@ import Grid from '@mui/joy/Grid'; const Item = styled(Sheet)(({ theme }) => ({ backgroundColor: theme.palette.mode === 'dark' ? theme.palette.background.level1 : '#fff', - ...theme.typography.body2, + ...theme.typography['body-sm'], padding: theme.spacing(1), textAlign: 'center', borderRadius: 4, diff --git a/docs/data/joy/components/grid/AutoGrid.tsx b/docs/data/joy/components/grid/AutoGrid.tsx index 41161bb6b237c7..987cf360c6e5c1 100644 --- a/docs/data/joy/components/grid/AutoGrid.tsx +++ b/docs/data/joy/components/grid/AutoGrid.tsx @@ -6,7 +6,7 @@ import Grid from '@mui/joy/Grid'; const Item = styled(Sheet)(({ theme }) => ({ backgroundColor: theme.palette.mode === 'dark' ? theme.palette.background.level1 : '#fff', - ...theme.typography.body2, + ...theme.typography['body-sm'], padding: theme.spacing(1), textAlign: 'center', borderRadius: 4, diff --git a/docs/data/joy/components/grid/BasicGrid.js b/docs/data/joy/components/grid/BasicGrid.js index 489cf5a79bc8e3..4caf40a32a593b 100644 --- a/docs/data/joy/components/grid/BasicGrid.js +++ b/docs/data/joy/components/grid/BasicGrid.js @@ -6,7 +6,7 @@ import Grid from '@mui/joy/Grid'; const Item = styled(Sheet)(({ theme }) => ({ backgroundColor: theme.palette.mode === 'dark' ? theme.palette.background.level1 : '#fff', - ...theme.typography.body2, + ...theme.typography['body-sm'], padding: theme.spacing(1), textAlign: 'center', borderRadius: 4, diff --git a/docs/data/joy/components/grid/BasicGrid.tsx b/docs/data/joy/components/grid/BasicGrid.tsx index 489cf5a79bc8e3..4caf40a32a593b 100644 --- a/docs/data/joy/components/grid/BasicGrid.tsx +++ b/docs/data/joy/components/grid/BasicGrid.tsx @@ -6,7 +6,7 @@ import Grid from '@mui/joy/Grid'; const Item = styled(Sheet)(({ theme }) => ({ backgroundColor: theme.palette.mode === 'dark' ? theme.palette.background.level1 : '#fff', - ...theme.typography.body2, + ...theme.typography['body-sm'], padding: theme.spacing(1), textAlign: 'center', borderRadius: 4, diff --git a/docs/data/joy/components/grid/CSSGrid.js b/docs/data/joy/components/grid/CSSGrid.js index 0e8313116230db..647020a7cc927a 100644 --- a/docs/data/joy/components/grid/CSSGrid.js +++ b/docs/data/joy/components/grid/CSSGrid.js @@ -6,7 +6,7 @@ import Sheet from '@mui/joy/Sheet'; const Item = styled(Sheet)(({ theme }) => ({ backgroundColor: theme.palette.mode === 'dark' ? theme.palette.background.level1 : '#fff', - ...theme.typography.body2, + ...theme.typography['body-sm'], padding: theme.spacing(1), textAlign: 'center', borderRadius: 4, diff --git a/docs/data/joy/components/grid/CSSGrid.tsx b/docs/data/joy/components/grid/CSSGrid.tsx index 0e8313116230db..647020a7cc927a 100644 --- a/docs/data/joy/components/grid/CSSGrid.tsx +++ b/docs/data/joy/components/grid/CSSGrid.tsx @@ -6,7 +6,7 @@ import Sheet from '@mui/joy/Sheet'; const Item = styled(Sheet)(({ theme }) => ({ backgroundColor: theme.palette.mode === 'dark' ? theme.palette.background.level1 : '#fff', - ...theme.typography.body2, + ...theme.typography['body-sm'], padding: theme.spacing(1), textAlign: 'center', borderRadius: 4, diff --git a/docs/data/joy/components/grid/ColumnsGrid.js b/docs/data/joy/components/grid/ColumnsGrid.js index 830f252b7bdbd3..dc6a77772f90df 100644 --- a/docs/data/joy/components/grid/ColumnsGrid.js +++ b/docs/data/joy/components/grid/ColumnsGrid.js @@ -6,7 +6,7 @@ import Grid from '@mui/joy/Grid'; const Item = styled(Sheet)(({ theme }) => ({ backgroundColor: theme.palette.mode === 'dark' ? theme.palette.background.level1 : '#fff', - ...theme.typography.body2, + ...theme.typography['body-sm'], padding: theme.spacing(1), textAlign: 'center', borderRadius: 4, diff --git a/docs/data/joy/components/grid/ColumnsGrid.tsx b/docs/data/joy/components/grid/ColumnsGrid.tsx index 830f252b7bdbd3..dc6a77772f90df 100644 --- a/docs/data/joy/components/grid/ColumnsGrid.tsx +++ b/docs/data/joy/components/grid/ColumnsGrid.tsx @@ -6,7 +6,7 @@ import Grid from '@mui/joy/Grid'; const Item = styled(Sheet)(({ theme }) => ({ backgroundColor: theme.palette.mode === 'dark' ? theme.palette.background.level1 : '#fff', - ...theme.typography.body2, + ...theme.typography['body-sm'], padding: theme.spacing(1), textAlign: 'center', borderRadius: 4, diff --git a/docs/data/joy/components/grid/FullWidthGrid.js b/docs/data/joy/components/grid/FullWidthGrid.js index fce8825211aac3..5a0e3f8e5defec 100644 --- a/docs/data/joy/components/grid/FullWidthGrid.js +++ b/docs/data/joy/components/grid/FullWidthGrid.js @@ -6,7 +6,7 @@ import Grid from '@mui/joy/Grid'; const Item = styled(Sheet)(({ theme }) => ({ backgroundColor: theme.palette.mode === 'dark' ? theme.palette.background.level1 : '#fff', - ...theme.typography.body2, + ...theme.typography['body-sm'], padding: theme.spacing(1), textAlign: 'center', borderRadius: 4, diff --git a/docs/data/joy/components/grid/FullWidthGrid.tsx b/docs/data/joy/components/grid/FullWidthGrid.tsx index fce8825211aac3..5a0e3f8e5defec 100644 --- a/docs/data/joy/components/grid/FullWidthGrid.tsx +++ b/docs/data/joy/components/grid/FullWidthGrid.tsx @@ -6,7 +6,7 @@ import Grid from '@mui/joy/Grid'; const Item = styled(Sheet)(({ theme }) => ({ backgroundColor: theme.palette.mode === 'dark' ? theme.palette.background.level1 : '#fff', - ...theme.typography.body2, + ...theme.typography['body-sm'], padding: theme.spacing(1), textAlign: 'center', borderRadius: 4, diff --git a/docs/data/joy/components/grid/ResponsiveGrid.js b/docs/data/joy/components/grid/ResponsiveGrid.js index 8fbcaffa566148..9e5a32c500aa8e 100644 --- a/docs/data/joy/components/grid/ResponsiveGrid.js +++ b/docs/data/joy/components/grid/ResponsiveGrid.js @@ -6,7 +6,7 @@ import Grid from '@mui/joy/Grid'; const Item = styled(Sheet)(({ theme }) => ({ backgroundColor: theme.palette.mode === 'dark' ? theme.palette.background.level1 : '#fff', - ...theme.typography.body2, + ...theme.typography['body-sm'], padding: theme.spacing(1), textAlign: 'center', borderRadius: 4, diff --git a/docs/data/joy/components/grid/ResponsiveGrid.tsx b/docs/data/joy/components/grid/ResponsiveGrid.tsx index 8fbcaffa566148..9e5a32c500aa8e 100644 --- a/docs/data/joy/components/grid/ResponsiveGrid.tsx +++ b/docs/data/joy/components/grid/ResponsiveGrid.tsx @@ -6,7 +6,7 @@ import Grid from '@mui/joy/Grid'; const Item = styled(Sheet)(({ theme }) => ({ backgroundColor: theme.palette.mode === 'dark' ? theme.palette.background.level1 : '#fff', - ...theme.typography.body2, + ...theme.typography['body-sm'], padding: theme.spacing(1), textAlign: 'center', borderRadius: 4, diff --git a/docs/data/joy/components/grid/RowAndColumnSpacing.js b/docs/data/joy/components/grid/RowAndColumnSpacing.js index 70452270927784..042d6d12e6b7fd 100644 --- a/docs/data/joy/components/grid/RowAndColumnSpacing.js +++ b/docs/data/joy/components/grid/RowAndColumnSpacing.js @@ -6,7 +6,7 @@ import Sheet from '@mui/joy/Sheet'; const Item = styled(Sheet)(({ theme }) => ({ backgroundColor: theme.palette.mode === 'dark' ? theme.palette.background.level1 : '#fff', - ...theme.typography.body2, + ...theme.typography['body-sm'], padding: theme.spacing(1), textAlign: 'center', borderRadius: 4, diff --git a/docs/data/joy/components/grid/RowAndColumnSpacing.tsx b/docs/data/joy/components/grid/RowAndColumnSpacing.tsx index 70452270927784..042d6d12e6b7fd 100644 --- a/docs/data/joy/components/grid/RowAndColumnSpacing.tsx +++ b/docs/data/joy/components/grid/RowAndColumnSpacing.tsx @@ -6,7 +6,7 @@ import Sheet from '@mui/joy/Sheet'; const Item = styled(Sheet)(({ theme }) => ({ backgroundColor: theme.palette.mode === 'dark' ? theme.palette.background.level1 : '#fff', - ...theme.typography.body2, + ...theme.typography['body-sm'], padding: theme.spacing(1), textAlign: 'center', borderRadius: 4, diff --git a/docs/data/joy/components/grid/VariableWidthGrid.js b/docs/data/joy/components/grid/VariableWidthGrid.js index 8602bdc1f3e172..b04c4bc357a9cd 100644 --- a/docs/data/joy/components/grid/VariableWidthGrid.js +++ b/docs/data/joy/components/grid/VariableWidthGrid.js @@ -6,7 +6,7 @@ import Grid from '@mui/joy/Grid'; const Item = styled(Sheet)(({ theme }) => ({ backgroundColor: theme.palette.mode === 'dark' ? theme.palette.background.level1 : '#fff', - ...theme.typography.body2, + ...theme.typography['body-sm'], padding: theme.spacing(1), textAlign: 'center', borderRadius: 4, diff --git a/docs/data/joy/components/grid/VariableWidthGrid.tsx b/docs/data/joy/components/grid/VariableWidthGrid.tsx index 8602bdc1f3e172..b04c4bc357a9cd 100644 --- a/docs/data/joy/components/grid/VariableWidthGrid.tsx +++ b/docs/data/joy/components/grid/VariableWidthGrid.tsx @@ -6,7 +6,7 @@ import Grid from '@mui/joy/Grid'; const Item = styled(Sheet)(({ theme }) => ({ backgroundColor: theme.palette.mode === 'dark' ? theme.palette.background.level1 : '#fff', - ...theme.typography.body2, + ...theme.typography['body-sm'], padding: theme.spacing(1), textAlign: 'center', borderRadius: 4, diff --git a/docs/data/joy/components/input/FloatingLabelInput.js b/docs/data/joy/components/input/FloatingLabelInput.js index 576720cb52d9c5..4b6f17dcf5f466 100644 --- a/docs/data/joy/components/input/FloatingLabelInput.js +++ b/docs/data/joy/components/input/FloatingLabelInput.js @@ -67,7 +67,7 @@ const InnerInput = React.forwardRef(function InnerInput(props, ref) { export default function FloatingLabelInput() { return ( } + endDecorator={} slots={{ input: InnerInput }} slotProps={{ input: { placeholder: 'A placeholder', type: 'password' } }} sx={{ diff --git a/docs/data/joy/components/input/FloatingLabelInput.tsx b/docs/data/joy/components/input/FloatingLabelInput.tsx index b342b818b9bbfa..521eb66351af7c 100644 --- a/docs/data/joy/components/input/FloatingLabelInput.tsx +++ b/docs/data/joy/components/input/FloatingLabelInput.tsx @@ -70,7 +70,7 @@ const InnerInput = React.forwardRef< export default function FloatingLabelInput() { return ( } + endDecorator={} slots={{ input: InnerInput }} slotProps={{ input: { placeholder: 'A placeholder', type: 'password' } }} sx={{ diff --git a/docs/data/joy/components/input/FloatingLabelInput.tsx.preview b/docs/data/joy/components/input/FloatingLabelInput.tsx.preview index ca4b7ae60349d7..65cdc1846a0b39 100644 --- a/docs/data/joy/components/input/FloatingLabelInput.tsx.preview +++ b/docs/data/joy/components/input/FloatingLabelInput.tsx.preview @@ -1,5 +1,5 @@ } + endDecorator={} slots={{ input: InnerInput }} slotProps={{ input: { placeholder: 'A placeholder', type: 'password' } }} sx={{ diff --git a/docs/data/joy/components/input/InputColors.js b/docs/data/joy/components/input/InputColors.js index c36d484d77fcb8..d98b50891bffd4 100644 --- a/docs/data/joy/components/input/InputColors.js +++ b/docs/data/joy/components/input/InputColors.js @@ -16,7 +16,6 @@ export default function InputColors() { - diff --git a/docs/data/joy/components/input/InputColors.tsx b/docs/data/joy/components/input/InputColors.tsx index c36d484d77fcb8..d98b50891bffd4 100644 --- a/docs/data/joy/components/input/InputColors.tsx +++ b/docs/data/joy/components/input/InputColors.tsx @@ -16,7 +16,6 @@ export default function InputColors() { - diff --git a/docs/data/joy/components/input/InputColors.tsx.preview b/docs/data/joy/components/input/InputColors.tsx.preview index 2f96befb8909cf..469c897f26eb68 100644 --- a/docs/data/joy/components/input/InputColors.tsx.preview +++ b/docs/data/joy/components/input/InputColors.tsx.preview @@ -1,6 +1,5 @@ - \ No newline at end of file diff --git a/docs/data/joy/components/input/InputDecorators.js b/docs/data/joy/components/input/InputDecorators.js index 48c7eb82123de3..e779b87160d580 100644 --- a/docs/data/joy/components/input/InputDecorators.js +++ b/docs/data/joy/components/input/InputDecorators.js @@ -17,6 +17,11 @@ export default function InputDecorators() { variant="plain" value={currency} onChange={(_, value) => setCurrency(value)} + slotProps={{ + listbox: { + variant: 'outlined', + }, + }} sx={{ mr: -1.5, '&:hover': { bgcolor: 'transparent' } }} > diff --git a/docs/data/joy/components/input/InputDecorators.tsx b/docs/data/joy/components/input/InputDecorators.tsx index 64f1337e341098..dbcbb77fccbe74 100644 --- a/docs/data/joy/components/input/InputDecorators.tsx +++ b/docs/data/joy/components/input/InputDecorators.tsx @@ -17,6 +17,11 @@ export default function InputDecorators() { variant="plain" value={currency} onChange={(_, value) => setCurrency(value!)} + slotProps={{ + listbox: { + variant: 'outlined', + }, + }} sx={{ mr: -1.5, '&:hover': { bgcolor: 'transparent' } }} > diff --git a/docs/data/joy/components/input/PasswordMeterInput.js b/docs/data/joy/components/input/PasswordMeterInput.js index 334ea7c54ac836..f976edde58b73c 100644 --- a/docs/data/joy/components/input/PasswordMeterInput.js +++ b/docs/data/joy/components/input/PasswordMeterInput.js @@ -32,7 +32,7 @@ export default function PasswordMeterInput() { }} /> {value.length < 3 && 'Very weak'} diff --git a/docs/data/joy/components/input/PasswordMeterInput.tsx b/docs/data/joy/components/input/PasswordMeterInput.tsx index 334ea7c54ac836..f976edde58b73c 100644 --- a/docs/data/joy/components/input/PasswordMeterInput.tsx +++ b/docs/data/joy/components/input/PasswordMeterInput.tsx @@ -32,7 +32,7 @@ export default function PasswordMeterInput() { }} /> {value.length < 3 && 'Very weak'} diff --git a/docs/data/joy/components/linear-progress/LinearProgressColors.js b/docs/data/joy/components/linear-progress/LinearProgressColors.js index 51ca565134bbdd..8ce599998e8c6d 100644 --- a/docs/data/joy/components/linear-progress/LinearProgressColors.js +++ b/docs/data/joy/components/linear-progress/LinearProgressColors.js @@ -23,7 +23,6 @@ export default function LinearProgressColors() { - @@ -36,7 +35,7 @@ export default function LinearProgressColors() { }} > - @@ -37,7 +36,7 @@ export default function LinearProgressColors() { }} > - - - `${theme.vars.palette.primary.softColor} transparent transparent`, - animation: `${circulate} 1s ease infinite`, - }} - /> - - } - > + }> Processing... - HIRING! + + hiring } - sx={{ '--Link-gap': '0.5rem', pr: 0, pl: 1 }} + sx={{ '--Link-gap': '0.5rem', pl: 1, py: 0.5, borderRadius: 'md' }} > Careers diff --git a/docs/data/joy/components/link/DecoratorExamples.tsx b/docs/data/joy/components/link/DecoratorExamples.tsx index 2b2a6842f12aab..11df5f86dcae6c 100644 --- a/docs/data/joy/components/link/DecoratorExamples.tsx +++ b/docs/data/joy/components/link/DecoratorExamples.tsx @@ -1,71 +1,29 @@ import * as React from 'react'; -import { keyframes } from '@mui/system'; import Box from '@mui/joy/Box'; +import CircularProgress from '@mui/joy/CircularProgress'; import Link from '@mui/joy/Link'; import Chip from '@mui/joy/Chip'; -const circulate = keyframes({ - '0%': { - transform: 'rotate(0deg)', - }, - '100%': { - transform: 'rotate(360deg)', - }, -}); - export default function DecoratorExamples() { return ( - - - `${theme.vars.palette.primary.softColor} transparent transparent`, - animation: `${circulate} 1s ease infinite`, - }} - /> - - } - > + }> Processing... - HIRING! + + hiring } - sx={{ '--Link-gap': '0.5rem', pr: 0, pl: 1 }} + sx={{ '--Link-gap': '0.5rem', pl: 1, py: 0.5, borderRadius: 'md' }} > Careers diff --git a/docs/data/joy/components/link/LinkAndTypography.js b/docs/data/joy/components/link/LinkAndTypography.js index 5783028dd65f25..b68f00bdca01ba 100644 --- a/docs/data/joy/components/link/LinkAndTypography.js +++ b/docs/data/joy/components/link/LinkAndTypography.js @@ -31,7 +31,7 @@ export default function LinkAndTypography() { Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore{' '} - }> + }> Magna Aliqua . Maecenas sed enim ut sem viverra aliquet eget. diff --git a/docs/data/joy/components/link/LinkAndTypography.tsx b/docs/data/joy/components/link/LinkAndTypography.tsx index 5783028dd65f25..b68f00bdca01ba 100644 --- a/docs/data/joy/components/link/LinkAndTypography.tsx +++ b/docs/data/joy/components/link/LinkAndTypography.tsx @@ -31,7 +31,7 @@ export default function LinkAndTypography() { Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore{' '} - }> + }> Magna Aliqua . Maecenas sed enim ut sem viverra aliquet eget. diff --git a/docs/data/joy/components/link/LinkCard.js b/docs/data/joy/components/link/LinkCard.js index f2bd4f1aed41be..c57a7b01024c91 100644 --- a/docs/data/joy/components/link/LinkCard.js +++ b/docs/data/joy/components/link/LinkCard.js @@ -8,15 +8,7 @@ import CenterFocusWeak from '@mui/icons-material/CenterFocusWeak'; export default function LinkCard() { return ( - +
@@ -32,10 +24,10 @@ export default function LinkCard() { Joy UI - Components that spark joy! + Components that spark joy!
- + Click the and TAB to test the focus
diff --git a/docs/data/joy/components/link/LinkCard.tsx b/docs/data/joy/components/link/LinkCard.tsx index f2bd4f1aed41be..c57a7b01024c91 100644 --- a/docs/data/joy/components/link/LinkCard.tsx +++ b/docs/data/joy/components/link/LinkCard.tsx @@ -8,15 +8,7 @@ import CenterFocusWeak from '@mui/icons-material/CenterFocusWeak'; export default function LinkCard() { return ( - +
@@ -32,10 +24,10 @@ export default function LinkCard() { Joy UI - Components that spark joy! + Components that spark joy!
- + Click the and TAB to test the focus
diff --git a/docs/data/joy/components/link/LinkColors.js b/docs/data/joy/components/link/LinkColors.js index 2d4e6a73fd8b01..a6651ce88fd30c 100644 --- a/docs/data/joy/components/link/LinkColors.js +++ b/docs/data/joy/components/link/LinkColors.js @@ -32,9 +32,6 @@ export default function LinkColors() { Danger - - Info - Success @@ -51,7 +48,7 @@ export default function LinkColors() { }} > Danger - - Info - Success @@ -52,7 +49,7 @@ export default function LinkColors() { }} > H4 - - H5 + + Title Large - - H6 + + Title Medium - - Body 1 + + Title Small - - Body 2 + + Body Large - - Body 3 + Body Medium + + Body Small + + + Body Extra Small
); diff --git a/docs/data/joy/components/link/LinkLevels.tsx b/docs/data/joy/components/link/LinkLevels.tsx index c31c45e0b291b3..adbb0db2b2f368 100644 --- a/docs/data/joy/components/link/LinkLevels.tsx +++ b/docs/data/joy/components/link/LinkLevels.tsx @@ -17,20 +17,24 @@ export default function LinkLevels() { H4 - - H5 + + Title Large - - H6 + + Title Medium - - Body 1 + + Title Small - - Body 2 + + Body Large - - Body 3 + Body Medium + + Body Small + + + Body Extra Small
); diff --git a/docs/data/joy/components/link/LinkUsage.js b/docs/data/joy/components/link/LinkUsage.js index 4a5aa06169890a..feceec54e58199 100644 --- a/docs/data/joy/components/link/LinkUsage.js +++ b/docs/data/joy/components/link/LinkUsage.js @@ -10,8 +10,20 @@ export default function LinkUsage() { { propName: 'level', knob: 'select', - options: ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'body1', 'body2', 'body3'], - defaultValue: 'body1', + options: [ + 'h1', + 'h2', + 'h3', + 'h4', + 'title-lg', + 'title-md', + 'title-sm', + 'body-lg', + 'body-md', + 'body-sm', + 'body-xs', + ], + defaultValue: 'body-md', }, { propName: 'underline', diff --git a/docs/data/joy/components/list/BasicList.js b/docs/data/joy/components/list/BasicList.js index 01cc14e9a2f52e..8dab791134c790 100644 --- a/docs/data/joy/components/list/BasicList.js +++ b/docs/data/joy/components/list/BasicList.js @@ -8,7 +8,7 @@ export default function BasicList() {
diff --git a/docs/data/joy/components/list/BasicList.tsx b/docs/data/joy/components/list/BasicList.tsx index 01cc14e9a2f52e..8dab791134c790 100644 --- a/docs/data/joy/components/list/BasicList.tsx +++ b/docs/data/joy/components/list/BasicList.tsx @@ -8,7 +8,7 @@ export default function BasicList() {
diff --git a/docs/data/joy/components/list/BasicList.tsx.preview b/docs/data/joy/components/list/BasicList.tsx.preview index 7eba3c3c4d9164..561cfa99cef2ea 100644 --- a/docs/data/joy/components/list/BasicList.tsx.preview +++ b/docs/data/joy/components/list/BasicList.tsx.preview @@ -1,6 +1,6 @@ diff --git a/docs/data/joy/components/list/DecoratedList.js b/docs/data/joy/components/list/DecoratedList.js index 2656b14174bb10..3a088cb5d86181 100644 --- a/docs/data/joy/components/list/DecoratedList.js +++ b/docs/data/joy/components/list/DecoratedList.js @@ -9,17 +9,14 @@ export default function DecoratedList() {
Ingredients - + πŸ§… 1 red onion diff --git a/docs/data/joy/components/list/DecoratedList.tsx b/docs/data/joy/components/list/DecoratedList.tsx index 2656b14174bb10..3a088cb5d86181 100644 --- a/docs/data/joy/components/list/DecoratedList.tsx +++ b/docs/data/joy/components/list/DecoratedList.tsx @@ -9,17 +9,14 @@ export default function DecoratedList() {
Ingredients - + πŸ§… 1 red onion diff --git a/docs/data/joy/components/list/DividedList.js b/docs/data/joy/components/list/DividedList.js index cdb57a7b71ea7e..915a1dd59bcad1 100644 --- a/docs/data/joy/components/list/DividedList.js +++ b/docs/data/joy/components/list/DividedList.js @@ -19,30 +19,25 @@ export default function DividedList() { > {[undefined, 'gutter', 'startDecorator', 'startContent'].map((inset) => ( - + {inset ? `inset="${inset}"` : '(default)'} - + Mabel Boyle - + Boyd Burt diff --git a/docs/data/joy/components/list/DividedList.tsx b/docs/data/joy/components/list/DividedList.tsx index 30ce851b4f6c8a..3ca55b9b47b963 100644 --- a/docs/data/joy/components/list/DividedList.tsx +++ b/docs/data/joy/components/list/DividedList.tsx @@ -20,30 +20,25 @@ export default function DividedList() { {([undefined, 'gutter', 'startDecorator', 'startContent'] as const).map( (inset) => ( - + {inset ? `inset="${inset}"` : '(default)'} - + Mabel Boyle - + Boyd Burt diff --git a/docs/data/joy/components/list/EllipsisList.js b/docs/data/joy/components/list/EllipsisList.js index dd2f6064e45f17..d26dd86c24bd3b 100644 --- a/docs/data/joy/components/list/EllipsisList.js +++ b/docs/data/joy/components/list/EllipsisList.js @@ -12,10 +12,8 @@ export default function EllipsisList() { Inbox @@ -25,23 +23,23 @@ export default function EllipsisList() { sx={{ '--ListItemDecorator-size': '56px' }} > - + - Brunch this weekend? - + Brunch this weekend? + I'll be in your neighborhood doing errands this Tuesday. - + - Summer BBQ - + Summer BBQ + Wish I could come, but I'm out of town this Friday. diff --git a/docs/data/joy/components/list/EllipsisList.tsx b/docs/data/joy/components/list/EllipsisList.tsx index dd2f6064e45f17..d26dd86c24bd3b 100644 --- a/docs/data/joy/components/list/EllipsisList.tsx +++ b/docs/data/joy/components/list/EllipsisList.tsx @@ -12,10 +12,8 @@ export default function EllipsisList() { Inbox @@ -25,23 +23,23 @@ export default function EllipsisList() { sx={{ '--ListItemDecorator-size': '56px' }} > - + - Brunch this weekend? - + Brunch this weekend? + I'll be in your neighborhood doing errands this Tuesday. - + - Summer BBQ - + Summer BBQ + Wish I could come, but I'm out of town this Friday. diff --git a/docs/data/joy/components/list/ExampleCollapsibleList.js b/docs/data/joy/components/list/ExampleCollapsibleList.js index 8a5c958e99c62b..821c5149ded610 100644 --- a/docs/data/joy/components/list/ExampleCollapsibleList.js +++ b/docs/data/joy/components/list/ExampleCollapsibleList.js @@ -1,7 +1,7 @@ import * as React from 'react'; import Box from '@mui/joy/Box'; import List from '@mui/joy/List'; -import ListItem, { listItemClasses } from '@mui/joy/ListItem'; +import ListItem from '@mui/joy/ListItem'; import ListItemButton, { listItemButtonClasses } from '@mui/joy/ListItemButton'; import IconButton from '@mui/joy/IconButton'; import Typography from '@mui/joy/Typography'; @@ -38,14 +38,10 @@ export default function ExampleCollapsibleList() { '--ListItem-startActionWidth': '0px', '--ListItem-startActionTranslateX': '-50%', [`& .${listItemButtonClasses.root}`]: { - borderLeft: '1px solid', - borderColor: 'divider', + borderLeftColor: 'divider', }, [`& .${listItemButtonClasses.root}.${listItemButtonClasses.selected}`]: { - borderColor: 'currentColor', - }, - [`& .${listItemClasses.nested} > .${listItemButtonClasses.root}`]: { - border: 'none', + borderLeftColor: 'currentColor', }, '& [class*="startAction"]': { color: 'var(--joy-palette-text-tertiary)', @@ -54,7 +50,7 @@ export default function ExampleCollapsibleList() { > }> - + Documentation @@ -93,7 +89,7 @@ export default function ExampleCollapsibleList() { > Tutorial - + 9 @@ -144,7 +140,7 @@ export default function ExampleCollapsibleList() { > How-to Guides - + 39 diff --git a/docs/data/joy/components/list/ExampleCollapsibleList.tsx b/docs/data/joy/components/list/ExampleCollapsibleList.tsx index 598f843843a1b8..985d404b6eaf48 100644 --- a/docs/data/joy/components/list/ExampleCollapsibleList.tsx +++ b/docs/data/joy/components/list/ExampleCollapsibleList.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import Box from '@mui/joy/Box'; import List from '@mui/joy/List'; -import ListItem, { listItemClasses } from '@mui/joy/ListItem'; +import ListItem from '@mui/joy/ListItem'; import ListItemButton, { listItemButtonClasses } from '@mui/joy/ListItemButton'; import IconButton from '@mui/joy/IconButton'; import Typography from '@mui/joy/Typography'; @@ -40,14 +40,10 @@ export default function ExampleCollapsibleList() { '--ListItem-startActionTranslateX': '-50%', [`& .${listItemButtonClasses.root}`]: { - borderLeft: '1px solid', - borderColor: 'divider', + borderLeftColor: 'divider', }, [`& .${listItemButtonClasses.root}.${listItemButtonClasses.selected}`]: { - borderColor: 'currentColor', - }, - [`& .${listItemClasses.nested} > .${listItemButtonClasses.root}`]: { - border: 'none', + borderLeftColor: 'currentColor', }, '& [class*="startAction"]': { color: 'var(--joy-palette-text-tertiary)', @@ -56,7 +52,7 @@ export default function ExampleCollapsibleList() { > }> - + Documentation @@ -95,7 +91,7 @@ export default function ExampleCollapsibleList() { > Tutorial - + 9 @@ -146,7 +142,7 @@ export default function ExampleCollapsibleList() { > How-to Guides - + 39 diff --git a/docs/data/joy/components/list/ExampleGmailList.js b/docs/data/joy/components/list/ExampleGmailList.js index be67bec0367ef7..2f686844ccab23 100644 --- a/docs/data/joy/components/list/ExampleGmailList.js +++ b/docs/data/joy/components/list/ExampleGmailList.js @@ -22,10 +22,8 @@ export default function ExampleGmailList() { theme.vars.palette.text.secondary, '--ListItem-minHeight': '32px', '--List-nestedInsetStart': '13px', [`& .${listItemDecoratorClasses.root}`]: { @@ -40,15 +38,17 @@ export default function ExampleGmailList() { setIndex(0)} > Inbox - + 1,950 @@ -56,7 +56,6 @@ export default function ExampleGmailList() { setIndex(1)} > @@ -69,8 +68,7 @@ export default function ExampleGmailList() { setIndex(2)} > @@ -83,7 +81,6 @@ export default function ExampleGmailList() { setIndex(3)} > @@ -91,13 +88,12 @@ export default function ExampleGmailList() { Social - 4,320 + 4,320 setIndex(4)} > @@ -105,7 +101,7 @@ export default function ExampleGmailList() { Updates - 22,252 + 22,252 diff --git a/docs/data/joy/components/list/ExampleGmailList.tsx b/docs/data/joy/components/list/ExampleGmailList.tsx index be67bec0367ef7..2f686844ccab23 100644 --- a/docs/data/joy/components/list/ExampleGmailList.tsx +++ b/docs/data/joy/components/list/ExampleGmailList.tsx @@ -22,10 +22,8 @@ export default function ExampleGmailList() { theme.vars.palette.text.secondary, '--ListItem-minHeight': '32px', '--List-nestedInsetStart': '13px', [`& .${listItemDecoratorClasses.root}`]: { @@ -40,15 +38,17 @@ export default function ExampleGmailList() { setIndex(0)} > Inbox - + 1,950 @@ -56,7 +56,6 @@ export default function ExampleGmailList() { setIndex(1)} > @@ -69,8 +68,7 @@ export default function ExampleGmailList() { setIndex(2)} > @@ -83,7 +81,6 @@ export default function ExampleGmailList() { setIndex(3)} > @@ -91,13 +88,12 @@ export default function ExampleGmailList() { Social - 4,320 + 4,320 setIndex(4)} > @@ -105,7 +101,7 @@ export default function ExampleGmailList() { Updates - 22,252 + 22,252 diff --git a/docs/data/joy/components/list/ExampleIOSList.js b/docs/data/joy/components/list/ExampleIOSList.js index 18c6f2dd52678b..3293aea42a60f6 100644 --- a/docs/data/joy/components/list/ExampleIOSList.js +++ b/docs/data/joy/components/list/ExampleIOSList.js @@ -80,7 +80,7 @@ export default function ExampleIOSList() { iCloud+ Feature Updates - + @@ -100,7 +100,7 @@ export default function ExampleIOSList() { Apple TV+ Free Year Available - + Included with your recent Apple device purchase. Must be accepted within 90 days of activation. @@ -163,7 +163,7 @@ export default function ExampleIOSList() { Wi-Fi Mars - + @@ -176,23 +176,19 @@ export default function ExampleIOSList() { Bluetooth On - + - + Cellular - + diff --git a/docs/data/joy/components/list/ExampleIOSList.tsx b/docs/data/joy/components/list/ExampleIOSList.tsx index 18c6f2dd52678b..3293aea42a60f6 100644 --- a/docs/data/joy/components/list/ExampleIOSList.tsx +++ b/docs/data/joy/components/list/ExampleIOSList.tsx @@ -80,7 +80,7 @@ export default function ExampleIOSList() { iCloud+ Feature Updates - + @@ -100,7 +100,7 @@ export default function ExampleIOSList() { Apple TV+ Free Year Available - + Included with your recent Apple device purchase. Must be accepted within 90 days of activation. @@ -163,7 +163,7 @@ export default function ExampleIOSList() { Wi-Fi Mars - + @@ -176,23 +176,19 @@ export default function ExampleIOSList() { Bluetooth On - + - + Cellular - + diff --git a/docs/data/joy/components/list/HorizontalDividedList.js b/docs/data/joy/components/list/HorizontalDividedList.js index 662b3e93e8b1cc..859c6de8c1acd7 100644 --- a/docs/data/joy/components/list/HorizontalDividedList.js +++ b/docs/data/joy/components/list/HorizontalDividedList.js @@ -11,31 +11,29 @@ export default function HorizontalDividedList() { orientation="horizontal" variant="outlined" sx={{ - bgcolor: 'background.body', - borderRadius: 'sm', - boxShadow: 'sm', flexGrow: 0, mx: 'auto', '--ListItemDecorator-size': '48px', '--ListItem-paddingY': '1rem', + borderRadius: 'sm', }} > - + Mabel Boyle - + Boyd Burt - + Adam Tris diff --git a/docs/data/joy/components/list/HorizontalDividedList.tsx b/docs/data/joy/components/list/HorizontalDividedList.tsx index 662b3e93e8b1cc..859c6de8c1acd7 100644 --- a/docs/data/joy/components/list/HorizontalDividedList.tsx +++ b/docs/data/joy/components/list/HorizontalDividedList.tsx @@ -11,31 +11,29 @@ export default function HorizontalDividedList() { orientation="horizontal" variant="outlined" sx={{ - bgcolor: 'background.body', - borderRadius: 'sm', - boxShadow: 'sm', flexGrow: 0, mx: 'auto', '--ListItemDecorator-size': '48px', '--ListItem-paddingY': '1rem', + borderRadius: 'sm', }} > - + Mabel Boyle - + Boyd Burt - + Adam Tris diff --git a/docs/data/joy/components/list/ListVariables.js b/docs/data/joy/components/list/ListVariables.js index 531b2d3595244b..8e5ea9abc32789 100644 --- a/docs/data/joy/components/list/ListVariables.js +++ b/docs/data/joy/components/list/ListVariables.js @@ -34,7 +34,6 @@ export default function ListVariables() { ...sx, width: 300, ...theme.variants.outlined.neutral, - bgcolor: 'background.body', })} > @@ -57,7 +56,7 @@ export default function ListVariables() { setSmall(event.target.checked)} endDecorator={ - Toggle small nested list + Toggle small nested list } sx={{ mb: 2 }} /> @@ -25,9 +25,7 @@ export default function NestedList() { size={small ? 'sm' : undefined} sx={{ width: 200, - bgcolor: 'background.body', borderRadius: 'sm', - boxShadow: 'sm', }} > diff --git a/docs/data/joy/components/list/NestedList.tsx b/docs/data/joy/components/list/NestedList.tsx index 0efdde73c046dd..dae6f614768d8f 100644 --- a/docs/data/joy/components/list/NestedList.tsx +++ b/docs/data/joy/components/list/NestedList.tsx @@ -16,7 +16,7 @@ export default function NestedList() { checked={small} onChange={(event) => setSmall(event.target.checked)} endDecorator={ - Toggle small nested list + Toggle small nested list } sx={{ mb: 2 }} /> @@ -25,9 +25,7 @@ export default function NestedList() { size={small ? 'sm' : undefined} sx={{ width: 200, - bgcolor: 'background.body', borderRadius: 'sm', - boxShadow: 'sm', }} > diff --git a/docs/data/joy/components/list/SizesList.js b/docs/data/joy/components/list/SizesList.js index 42fb75d1158b60..fbe74f01634c24 100644 --- a/docs/data/joy/components/list/SizesList.js +++ b/docs/data/joy/components/list/SizesList.js @@ -14,24 +14,22 @@ export default function SizesList() { flexGrow: 1, display: 'flex', justifyContent: 'center', - gap: 6, + gap: 2, flexWrap: 'wrap', '& > *': { minWidth: 0, flexBasis: 200 }, }} > {['sm', 'md', 'lg'].map((size) => ( - + size="{size}" diff --git a/docs/data/joy/components/list/SizesList.tsx b/docs/data/joy/components/list/SizesList.tsx index 78ae51e8dde45a..64009b17b9404d 100644 --- a/docs/data/joy/components/list/SizesList.tsx +++ b/docs/data/joy/components/list/SizesList.tsx @@ -14,24 +14,22 @@ export default function SizesList() { flexGrow: 1, display: 'flex', justifyContent: 'center', - gap: 6, + gap: 2, flexWrap: 'wrap', '& > *': { minWidth: 0, flexBasis: 200 }, }} > {(['sm', 'md', 'lg'] as const).map((size) => ( - + size="{size}" diff --git a/docs/data/joy/components/list/list.md b/docs/data/joy/components/list/list.md index 8856ba7ff00370..2cdcc82b373d56 100644 --- a/docs/data/joy/components/list/list.md +++ b/docs/data/joy/components/list/list.md @@ -169,7 +169,7 @@ The `ListItemButton` and the secondary action render as siblings, that way, the ### Selected Use the `selected` prop to signal whether a `ListItemButton` is selected or not. -It applies `color="primary"` and a few extra styles (e.g. font weight) to visually communicate the selected state. +It applies `color="primary"` of the active variant to visually communicate the selected state. :::info A selected `ListItemButton` does not apply `:hover` and `:active` global variant styles. diff --git a/docs/data/joy/components/menu/MenuIconSideNavExample.js b/docs/data/joy/components/menu/MenuIconSideNavExample.js index 38f7ac56c8e13c..eb09a244862948 100644 --- a/docs/data/joy/components/menu/MenuIconSideNavExample.js +++ b/docs/data/joy/components/menu/MenuIconSideNavExample.js @@ -138,7 +138,7 @@ export default function MenuIconSideNavExample() { }, 200); }; return ( - + + { setOpen(!open); }} - sx={{ borderRadius: 0 }} > Open menu @@ -65,7 +64,7 @@ export default function MenuListComposition() { Single 1.15 diff --git a/docs/data/joy/components/menu/MenuListComposition.tsx b/docs/data/joy/components/menu/MenuListComposition.tsx index f0e6dcd5b8095d..dffc75cb5a4937 100644 --- a/docs/data/joy/components/menu/MenuListComposition.tsx +++ b/docs/data/joy/components/menu/MenuListComposition.tsx @@ -42,7 +42,6 @@ export default function MenuListComposition(): JSX.Element { onClick={() => { setOpen(!open); }} - sx={{ borderRadius: 0 }} > Open menu @@ -65,7 +64,7 @@ export default function MenuListComposition(): JSX.Element { Single 1.15 diff --git a/docs/data/joy/components/menu/MenuListGroup.js b/docs/data/joy/components/menu/MenuListGroup.js index 30095c3d51147e..1c443f9dd9bb10 100644 --- a/docs/data/joy/components/menu/MenuListGroup.js +++ b/docs/data/joy/components/menu/MenuListGroup.js @@ -24,7 +24,7 @@ export default function MenuListGroup() { diff --git a/docs/data/joy/components/menu/MenuListGroup.tsx b/docs/data/joy/components/menu/MenuListGroup.tsx index 30095c3d51147e..1c443f9dd9bb10 100644 --- a/docs/data/joy/components/menu/MenuListGroup.tsx +++ b/docs/data/joy/components/menu/MenuListGroup.tsx @@ -24,7 +24,7 @@ export default function MenuListGroup() { diff --git a/docs/data/joy/components/menu/MenuToolbarExample.js b/docs/data/joy/components/menu/MenuToolbarExample.js index f3f329ec8578ab..addd741849d120 100644 --- a/docs/data/joy/components/menu/MenuToolbarExample.js +++ b/docs/data/joy/components/menu/MenuToolbarExample.js @@ -42,7 +42,7 @@ const MenuBarButton = React.forwardRef( boxShadow: '0 2px 8px 0px rgba(0 0 0 / 0.38)', '--List-padding': 'var(--ListDivider-gap)', '--ListItem-minHeight': '32px', - [`& .${menuItemClasses.root}`]: { + [`&& .${menuItemClasses.root}`]: { transition: 'none', '&:hover': { ...theme.variants.solid.primary, @@ -63,7 +63,7 @@ export default function MenuToolbarExample() { const [menuIndex, setMenuIndex] = React.useState(null); const renderShortcut = (text) => ( - + {text} ); @@ -127,10 +127,8 @@ export default function MenuToolbarExample() { data-joy-color-scheme="dark" sx={{ bgcolor: 'background.body', - px: 2, borderRadius: '4px', maxWidth: 'fit-content', - '--ListItem-radius': '8px', }} > diff --git a/docs/data/joy/components/menu/SelectedMenu.js b/docs/data/joy/components/menu/SelectedMenu.js index 9b0ca9ac73d488..d3e2fe643567ce 100644 --- a/docs/data/joy/components/menu/SelectedMenu.js +++ b/docs/data/joy/components/menu/SelectedMenu.js @@ -24,16 +24,10 @@ export default function SelectedMenu() { > Random project - + Production - web - + Staging - web diff --git a/docs/data/joy/components/menu/SelectedMenu.tsx b/docs/data/joy/components/menu/SelectedMenu.tsx index 85512edfc77de1..44a796d4e934d9 100644 --- a/docs/data/joy/components/menu/SelectedMenu.tsx +++ b/docs/data/joy/components/menu/SelectedMenu.tsx @@ -24,16 +24,10 @@ export default function SelectedMenu() { > Random project - + Production - web - + Staging - web diff --git a/docs/data/joy/components/modal/AlertDialogModal.js b/docs/data/joy/components/modal/AlertDialogModal.js index 446c1e1f13cd34..6e9b5da8c70aaf 100644 --- a/docs/data/joy/components/modal/AlertDialogModal.js +++ b/docs/data/joy/components/modal/AlertDialogModal.js @@ -29,7 +29,7 @@ export default function AlertDialogModal() { > } > Confirmation diff --git a/docs/data/joy/components/modal/AlertDialogModal.tsx b/docs/data/joy/components/modal/AlertDialogModal.tsx index b84b8c83c8b912..47d7e34ba4766e 100644 --- a/docs/data/joy/components/modal/AlertDialogModal.tsx +++ b/docs/data/joy/components/modal/AlertDialogModal.tsx @@ -29,7 +29,7 @@ export default function AlertDialogModal() { > } > Confirmation diff --git a/docs/data/joy/components/modal/BasicModal.js b/docs/data/joy/components/modal/BasicModal.js index 989527efeaa415..407c3ef39d01e7 100644 --- a/docs/data/joy/components/modal/BasicModal.js +++ b/docs/data/joy/components/modal/BasicModal.js @@ -35,7 +35,7 @@ export default function BasicModal() { right: 'calc(-1/4 * var(--IconButton-size))', boxShadow: '0 2px 12px 0 rgba(0 0 0 / 0.2)', borderRadius: '50%', - bgcolor: 'background.body', + bgcolor: 'background.surface', }} /> - + Create new project - + Fill in the information of the project.
- + Create new project - + Fill in the information of the project. - + Vertical scroll example - + Vertical scroll example - + Transition modal - + Transition modal - + Keep mounted modal diff --git a/docs/data/joy/components/modal/KeepMountedModal.tsx b/docs/data/joy/components/modal/KeepMountedModal.tsx index 03bd8d1786a8b1..b17d2d2bc5af2c 100644 --- a/docs/data/joy/components/modal/KeepMountedModal.tsx +++ b/docs/data/joy/components/modal/KeepMountedModal.tsx @@ -16,7 +16,7 @@ export default function KeepMountedModal() { aria-labelledby="keep-mounted-modal-title" aria-describedby="keep-mounted-modal-description" > - + Keep mounted modal diff --git a/docs/data/joy/components/modal/LayoutModalDialog.js b/docs/data/joy/components/modal/LayoutModalDialog.js index 064cb092b3ff2a..8dd0a3d58c9574 100644 --- a/docs/data/joy/components/modal/LayoutModalDialog.js +++ b/docs/data/joy/components/modal/LayoutModalDialog.js @@ -37,7 +37,7 @@ export default function LayoutModalDialog() { layout={layout} > - + Modal Dialog diff --git a/docs/data/joy/components/modal/LayoutModalDialog.tsx b/docs/data/joy/components/modal/LayoutModalDialog.tsx index 8c4667457be9dc..39ce58c9de0c13 100644 --- a/docs/data/joy/components/modal/LayoutModalDialog.tsx +++ b/docs/data/joy/components/modal/LayoutModalDialog.tsx @@ -39,7 +39,7 @@ export default function LayoutModalDialog() { layout={layout} > - + Modal Dialog diff --git a/docs/data/joy/components/modal/ModalDialogOverflow.js b/docs/data/joy/components/modal/ModalDialogOverflow.js index 869f1181aea074..4f5b0f39d9d157 100644 --- a/docs/data/joy/components/modal/ModalDialogOverflow.js +++ b/docs/data/joy/components/modal/ModalDialogOverflow.js @@ -46,7 +46,7 @@ export default function ModalDialogOverflow() { - + Overflow content - + Overflow content - + Modal title - + A description of the dialog should give primary message or purpose of the dialog. diff --git a/docs/data/joy/components/modal/NestedModals.js b/docs/data/joy/components/modal/NestedModals.js index 27e8345df63765..550d74b046f1ab 100644 --- a/docs/data/joy/components/modal/NestedModals.js +++ b/docs/data/joy/components/modal/NestedModals.js @@ -28,7 +28,7 @@ function NestedModals({ random }) { }, })} > - + Infinite modals diff --git a/docs/data/joy/components/modal/NestedModals.tsx b/docs/data/joy/components/modal/NestedModals.tsx index d352dddf48f7c7..e7a2c81c088bcc 100644 --- a/docs/data/joy/components/modal/NestedModals.tsx +++ b/docs/data/joy/components/modal/NestedModals.tsx @@ -31,7 +31,7 @@ function NestedModals({ random }: NestedModalsProps) { }, })} > - + Infinite modals diff --git a/docs/data/joy/components/modal/ResponsiveModal.js b/docs/data/joy/components/modal/ResponsiveModal.js index f9e913af677466..8cca2ed3ede8c4 100644 --- a/docs/data/joy/components/modal/ResponsiveModal.js +++ b/docs/data/joy/components/modal/ResponsiveModal.js @@ -28,7 +28,7 @@ export default function ResponsiveModal() { }, })} > - + Are you absolutely sure? diff --git a/docs/data/joy/components/modal/ResponsiveModal.tsx b/docs/data/joy/components/modal/ResponsiveModal.tsx index f9e913af677466..8cca2ed3ede8c4 100644 --- a/docs/data/joy/components/modal/ResponsiveModal.tsx +++ b/docs/data/joy/components/modal/ResponsiveModal.tsx @@ -28,7 +28,7 @@ export default function ResponsiveModal() { }, })} > - + Are you absolutely sure? diff --git a/docs/data/joy/components/modal/ServerModal.js b/docs/data/joy/components/modal/ServerModal.js index 1d3b03b7bce449..589a5f546e6e53 100644 --- a/docs/data/joy/components/modal/ServerModal.js +++ b/docs/data/joy/components/modal/ServerModal.js @@ -34,7 +34,7 @@ export default function ServerModal() { aria-describedby="server-modal-description" layout="center" > - + Server-side modal diff --git a/docs/data/joy/components/modal/ServerModal.tsx b/docs/data/joy/components/modal/ServerModal.tsx index 1d3b03b7bce449..589a5f546e6e53 100644 --- a/docs/data/joy/components/modal/ServerModal.tsx +++ b/docs/data/joy/components/modal/ServerModal.tsx @@ -34,7 +34,7 @@ export default function ServerModal() { aria-describedby="server-modal-description" layout="center" > - + Server-side modal diff --git a/docs/data/joy/components/modal/SizeModalDialog.js b/docs/data/joy/components/modal/SizeModalDialog.js index 9077e959794fb2..8a07015dffe206 100644 --- a/docs/data/joy/components/modal/SizeModalDialog.js +++ b/docs/data/joy/components/modal/SizeModalDialog.js @@ -43,10 +43,10 @@ export default function SizeModalDialog() { size={size} > - + Modal Dialog - + This is a `{size}` modal dialog. diff --git a/docs/data/joy/components/modal/SizeModalDialog.tsx b/docs/data/joy/components/modal/SizeModalDialog.tsx index ccf6854dff78ce..4cabbb827fd6ef 100644 --- a/docs/data/joy/components/modal/SizeModalDialog.tsx +++ b/docs/data/joy/components/modal/SizeModalDialog.tsx @@ -45,10 +45,10 @@ export default function SizeModalDialog() { size={size} > - + Modal Dialog - + This is a `{size}` modal dialog. diff --git a/docs/data/joy/components/modal/VariantModalDialog.js b/docs/data/joy/components/modal/VariantModalDialog.js index 9471d8e4e58e4b..a717d0d5b5cf4a 100644 --- a/docs/data/joy/components/modal/VariantModalDialog.js +++ b/docs/data/joy/components/modal/VariantModalDialog.js @@ -55,7 +55,7 @@ export default function VariantModalDialog() { variant={variant} > - + Modal Dialog diff --git a/docs/data/joy/components/modal/VariantModalDialog.tsx b/docs/data/joy/components/modal/VariantModalDialog.tsx index 1ed7248bd8164e..f6e280ea61cf67 100644 --- a/docs/data/joy/components/modal/VariantModalDialog.tsx +++ b/docs/data/joy/components/modal/VariantModalDialog.tsx @@ -57,7 +57,7 @@ export default function VariantModalDialog() { variant={variant} > - + Modal Dialog diff --git a/docs/data/joy/components/radio-button/ExamplePaymentChannels.js b/docs/data/joy/components/radio-button/ExamplePaymentChannels.js index 71a5475c017fc7..0a88ee82fe7697 100644 --- a/docs/data/joy/components/radio-button/ExamplePaymentChannels.js +++ b/docs/data/joy/components/radio-button/ExamplePaymentChannels.js @@ -6,7 +6,7 @@ import ListDivider from '@mui/joy/ListDivider'; import Radio from '@mui/joy/Radio'; import RadioGroup from '@mui/joy/RadioGroup'; import Typography from '@mui/joy/Typography'; -import Switch, { switchClasses } from '@mui/joy/Switch'; +import Switch from '@mui/joy/Switch'; export default function ExamplePaymentChannels() { const [orientation, setOrientation] = React.useState('vertical'); @@ -22,27 +22,21 @@ export default function ExamplePaymentChannels() { > Pay with setOrientation(event.target.checked ? 'horizontal' : 'vertical') } - sx={{ - [`&&:not(.${switchClasses.checked})`]: { - '--Switch-trackBackground': (theme) => - theme.vars.palette.background.level3, - }, - }} /> {['Credit Card', 'Paypal', 'QR Code'].map((value, index) => ( diff --git a/docs/data/joy/components/radio-button/ExamplePaymentChannels.tsx b/docs/data/joy/components/radio-button/ExamplePaymentChannels.tsx index ab541342d73845..42e533446b9464 100644 --- a/docs/data/joy/components/radio-button/ExamplePaymentChannels.tsx +++ b/docs/data/joy/components/radio-button/ExamplePaymentChannels.tsx @@ -6,7 +6,7 @@ import ListDivider from '@mui/joy/ListDivider'; import Radio from '@mui/joy/Radio'; import RadioGroup from '@mui/joy/RadioGroup'; import Typography from '@mui/joy/Typography'; -import Switch, { switchClasses } from '@mui/joy/Switch'; +import Switch from '@mui/joy/Switch'; export default function ExamplePaymentChannels() { const [orientation, setOrientation] = @@ -23,27 +23,21 @@ export default function ExamplePaymentChannels() { > Pay with ) => setOrientation(event.target.checked ? 'horizontal' : 'vertical') } - sx={{ - [`&&:not(.${switchClasses.checked})`]: { - '--Switch-trackBackground': (theme) => - theme.vars.palette.background.level3, - }, - }} /> {['Credit Card', 'Paypal', 'QR Code'].map((value, index) => ( diff --git a/docs/data/joy/components/radio-button/ExampleProductAttributes.js b/docs/data/joy/components/radio-button/ExampleProductAttributes.js index 1b52896fb8cb13..61e2505a108d25 100644 --- a/docs/data/joy/components/radio-button/ExampleProductAttributes.js +++ b/docs/data/joy/components/radio-button/ExampleProductAttributes.js @@ -16,7 +16,7 @@ export default function ExampleProductAttributes() { fontWeight: 'xl', textTransform: 'uppercase', fontSize: 'xs', - letterSpacing: '0.15rem', + letterSpacing: '0.1em', }} > Color @@ -26,49 +26,47 @@ export default function ExampleProductAttributes() { defaultValue="warning" sx={{ gap: 2, flexWrap: 'wrap', flexDirection: 'row' }} > - {['primary', 'neutral', 'danger', 'info', 'success', 'warning'].map( - (color) => ( - ( + + } + value={color} + slotProps={{ + input: { 'aria-label': color }, + radio: { + sx: { + display: 'contents', + '--variant-borderWidth': '2px', + }, + }, + }} sx={{ - position: 'relative', - width: 40, - height: 40, - flexShrink: 0, - bgcolor: `${color}.solidBg`, - borderRadius: '50%', - display: 'flex', - alignItems: 'center', - justifyContent: 'center', + '--joy-focus-outlineOffset': '4px', + '--joy-palette-focusVisible': (theme) => + theme.vars.palette[color][500], + [`& .${radioClasses.action}.${radioClasses.focusVisible}`]: { + outlineWidth: '2px', + }, }} - > - } - value={color} - slotProps={{ - input: { 'aria-label': color }, - radio: { - sx: { - display: 'contents', - '--variant-borderWidth': '2px', - }, - }, - }} - sx={{ - '--joy-focus-outlineOffset': '4px', - '--joy-palette-focusVisible': (theme) => - theme.vars.palette[color][500], - [`& .${radioClasses.action}.${radioClasses.focusVisible}`]: { - outlineWidth: '2px', - }, - }} - /> - - ), - )} + /> + + ))}
Size diff --git a/docs/data/joy/components/radio-button/ExampleProductAttributes.tsx b/docs/data/joy/components/radio-button/ExampleProductAttributes.tsx index 1f86055b381d5d..1fc22d5c2492b0 100644 --- a/docs/data/joy/components/radio-button/ExampleProductAttributes.tsx +++ b/docs/data/joy/components/radio-button/ExampleProductAttributes.tsx @@ -16,7 +16,7 @@ export default function ExampleProductAttributes() { fontWeight: 'xl', textTransform: 'uppercase', fontSize: 'xs', - letterSpacing: '0.15rem', + letterSpacing: '0.1em', }} > Color @@ -26,49 +26,49 @@ export default function ExampleProductAttributes() { defaultValue="warning" sx={{ gap: 2, flexWrap: 'wrap', flexDirection: 'row' }} > - {( - ['primary', 'neutral', 'danger', 'info', 'success', 'warning'] as const - ).map((color) => ( - - } - value={color} - slotProps={{ - input: { 'aria-label': color }, - radio: { - sx: { - display: 'contents', - '--variant-borderWidth': '2px', - }, - }, - }} + {(['primary', 'neutral', 'danger', 'success', 'warning'] as const).map( + (color) => ( + - theme.vars.palette[color][500], - [`& .${radioClasses.action}.${radioClasses.focusVisible}`]: { - outlineWidth: '2px', - }, + position: 'relative', + width: 40, + height: 40, + flexShrink: 0, + bgcolor: `${color}.solidBg`, + borderRadius: '50%', + display: 'flex', + alignItems: 'center', + justifyContent: 'center', }} - /> - - ))} + > + } + value={color} + slotProps={{ + input: { 'aria-label': color }, + radio: { + sx: { + display: 'contents', + '--variant-borderWidth': '2px', + }, + }, + }} + sx={{ + '--joy-focus-outlineOffset': '4px', + '--joy-palette-focusVisible': (theme) => + theme.vars.palette[color][500], + [`& .${radioClasses.action}.${radioClasses.focusVisible}`]: { + outlineWidth: '2px', + }, + }} + /> + + ), + )}

Size diff --git a/docs/data/joy/components/radio-button/ExampleSegmentedControls.js b/docs/data/joy/components/radio-button/ExampleSegmentedControls.js index 7e1ca625021bfb..03968470e5a7ea 100644 --- a/docs/data/joy/components/radio-button/ExampleSegmentedControls.js +++ b/docs/data/joy/components/radio-button/ExampleSegmentedControls.js @@ -20,7 +20,7 @@ export default function ExampleSegmentedControls() { sx={{ minHeight: 48, padding: '4px', - borderRadius: 'md', + borderRadius: '12px', bgcolor: 'neutral.softBg', '--RadioGroup-gap': '4px', '--Radio-actionRadius': '8px', @@ -43,7 +43,7 @@ export default function ExampleSegmentedControls() { sx: { ...(checked && { bgcolor: 'background.surface', - boxShadow: 'md', + boxShadow: 'sm', '&:hover': { bgcolor: 'background.surface', }, diff --git a/docs/data/joy/components/radio-button/ExampleSegmentedControls.tsx b/docs/data/joy/components/radio-button/ExampleSegmentedControls.tsx index 4f63796f008e23..20f1ad0198d9db 100644 --- a/docs/data/joy/components/radio-button/ExampleSegmentedControls.tsx +++ b/docs/data/joy/components/radio-button/ExampleSegmentedControls.tsx @@ -22,7 +22,7 @@ export default function ExampleSegmentedControls() { sx={{ minHeight: 48, padding: '4px', - borderRadius: 'md', + borderRadius: '12px', bgcolor: 'neutral.softBg', '--RadioGroup-gap': '4px', '--Radio-actionRadius': '8px', @@ -45,7 +45,7 @@ export default function ExampleSegmentedControls() { sx: { ...(checked && { bgcolor: 'background.surface', - boxShadow: 'md', + boxShadow: 'sm', '&:hover': { bgcolor: 'background.surface', }, diff --git a/docs/data/joy/components/radio-button/IconlessRadio.js b/docs/data/joy/components/radio-button/IconlessRadio.js index ca4662bdc0933a..4f9d7a5f9f24ef 100644 --- a/docs/data/joy/components/radio-button/IconlessRadio.js +++ b/docs/data/joy/components/radio-button/IconlessRadio.js @@ -33,7 +33,6 @@ export default function IconlessRadio() { p: 2, borderRadius: 'md', boxShadow: 'sm', - bgcolor: 'background.body', }} > {[1, 2, 3].map((num) => ( theme.vars.radius.md, + mb: 2, }} /> - Person {num} + + Person {num} + ))} diff --git a/docs/data/joy/components/radio-button/OverlayRadio.tsx b/docs/data/joy/components/radio-button/OverlayRadio.tsx index 3115d687be66e6..2c339a47d71f1d 100644 --- a/docs/data/joy/components/radio-button/OverlayRadio.tsx +++ b/docs/data/joy/components/radio-button/OverlayRadio.tsx @@ -16,7 +16,7 @@ export default function OverlayRadio() { name="member" defaultValue="person1" orientation="horizontal" - sx={{ gap: 2, mt: 1 }} + sx={{ gap: 2 }} > {[1, 2, 3].map((num) => ( theme.vars.radius.md, + mb: 2, }} /> - Person {num} + + Person {num} + ))} diff --git a/docs/data/joy/components/radio-button/RadioButtonsGroup.js b/docs/data/joy/components/radio-button/RadioButtonsGroup.js index cfb87f2ec56e4e..0033cc0cdf939d 100644 --- a/docs/data/joy/components/radio-button/RadioButtonsGroup.js +++ b/docs/data/joy/components/radio-button/RadioButtonsGroup.js @@ -9,7 +9,7 @@ export default function RadioButtonsGroup() { return ( Gender - + Gender - + Gender - + - diff --git a/docs/data/joy/components/radio-button/RadioColors.tsx b/docs/data/joy/components/radio-button/RadioColors.tsx index 1768fd4355c252..31e8370b7240c8 100644 --- a/docs/data/joy/components/radio-button/RadioColors.tsx +++ b/docs/data/joy/components/radio-button/RadioColors.tsx @@ -12,7 +12,6 @@ export default function RadioColors() { - diff --git a/docs/data/joy/components/radio-button/RadioColors.tsx.preview b/docs/data/joy/components/radio-button/RadioColors.tsx.preview index 9940aaada64f37..41e542a921f098 100644 --- a/docs/data/joy/components/radio-button/RadioColors.tsx.preview +++ b/docs/data/joy/components/radio-button/RadioColors.tsx.preview @@ -4,7 +4,6 @@ - diff --git a/docs/data/joy/components/radio-button/RadioFocus.js b/docs/data/joy/components/radio-button/RadioFocus.js index a10e98a68d803d..57968824b95ce8 100644 --- a/docs/data/joy/components/radio-button/RadioFocus.js +++ b/docs/data/joy/components/radio-button/RadioFocus.js @@ -9,7 +9,7 @@ export default function RadioFocus() { return ( Focus - + Focus - + Focus - + {['Individual', 'Team', 'Enterprise'].map((item, index) => ( - + {[, , ][index]} diff --git a/docs/data/joy/components/radio-button/RadioPositionEnd.tsx b/docs/data/joy/components/radio-button/RadioPositionEnd.tsx index 8159e733f165a0..37ad9b2196dfec 100644 --- a/docs/data/joy/components/radio-button/RadioPositionEnd.tsx +++ b/docs/data/joy/components/radio-button/RadioPositionEnd.tsx @@ -21,11 +21,7 @@ export default function RadioPositionEnd() { }} > {['Individual', 'Team', 'Enterprise'].map((item, index) => ( - + {[, , ][index]} diff --git a/docs/data/joy/components/radio-button/RadioUsage.js b/docs/data/joy/components/radio-button/RadioUsage.js index b1ad59e1c036a3..64ba200e024abb 100644 --- a/docs/data/joy/components/radio-button/RadioUsage.js +++ b/docs/data/joy/components/radio-button/RadioUsage.js @@ -13,13 +13,13 @@ export default function RadioUsage() { { propName: 'variant', knob: 'radio', - defaultValue: 'soft', + defaultValue: 'outlined', options: ['plain', 'outlined', 'soft', 'solid'], }, { propName: 'color', knob: 'color', - defaultValue: 'primary', + defaultValue: 'neutral', }, { propName: 'size', @@ -41,7 +41,6 @@ export default function RadioUsage() { orientation={orientation} defaultValue="1" name="radio-button-usage" - sx={{ mt: 1 }} > diff --git a/docs/data/joy/components/select/ControlledOpenSelect.js b/docs/data/joy/components/select/ControlledOpenSelect.js index 00008cfd621a73..073b17dd5918a3 100644 --- a/docs/data/joy/components/select/ControlledOpenSelect.js +++ b/docs/data/joy/components/select/ControlledOpenSelect.js @@ -16,7 +16,7 @@ export default function ControlledOpenSelect() { return (
diff --git a/docs/data/joy/components/skeleton/AnimationSkeleton.tsx b/docs/data/joy/components/skeleton/AnimationSkeleton.tsx index 65d033316322a3..cd4886b7f61af8 100644 --- a/docs/data/joy/components/skeleton/AnimationSkeleton.tsx +++ b/docs/data/joy/components/skeleton/AnimationSkeleton.tsx @@ -18,7 +18,7 @@ export default function AnimationSkeleton() {
diff --git a/docs/data/joy/components/skeleton/BasicCardSkeleton.js b/docs/data/joy/components/skeleton/BasicCardSkeleton.js index 2e69144760b153..17be895ee78435 100644 --- a/docs/data/joy/components/skeleton/BasicCardSkeleton.js +++ b/docs/data/joy/components/skeleton/BasicCardSkeleton.js @@ -15,7 +15,7 @@ export default function BasicCardSkeleton() { Yosemite National Park - + April 24 to May 02, 2021
- + Total price: diff --git a/docs/data/joy/components/skeleton/BasicCardSkeleton.tsx b/docs/data/joy/components/skeleton/BasicCardSkeleton.tsx index 2e69144760b153..17be895ee78435 100644 --- a/docs/data/joy/components/skeleton/BasicCardSkeleton.tsx +++ b/docs/data/joy/components/skeleton/BasicCardSkeleton.tsx @@ -15,7 +15,7 @@ export default function BasicCardSkeleton() { Yosemite National Park - + April 24 to May 02, 2021
- + Total price: diff --git a/docs/data/joy/components/skeleton/CommentSkeleton.js b/docs/data/joy/components/skeleton/CommentSkeleton.js index 0fca187d7bcb29..1c5265eb6d264a 100644 --- a/docs/data/joy/components/skeleton/CommentSkeleton.js +++ b/docs/data/joy/components/skeleton/CommentSkeleton.js @@ -13,13 +13,13 @@ export default function CommentSkeleton() {
- +
- - - + + + ); diff --git a/docs/data/joy/components/skeleton/CommentSkeleton.tsx b/docs/data/joy/components/skeleton/CommentSkeleton.tsx index 0fca187d7bcb29..1c5265eb6d264a 100644 --- a/docs/data/joy/components/skeleton/CommentSkeleton.tsx +++ b/docs/data/joy/components/skeleton/CommentSkeleton.tsx @@ -13,13 +13,13 @@ export default function CommentSkeleton() {
- +
- - - + + + ); diff --git a/docs/data/joy/components/skeleton/InlineSkeleton.js b/docs/data/joy/components/skeleton/InlineSkeleton.js index 7e457777c7cd31..03b019c28afcda 100644 --- a/docs/data/joy/components/skeleton/InlineSkeleton.js +++ b/docs/data/joy/components/skeleton/InlineSkeleton.js @@ -20,7 +20,7 @@ export default function InlineSkeleton() { A heading
HISTORY, PURPOSE AND USAGE diff --git a/docs/data/joy/components/skeleton/InlineSkeleton.tsx b/docs/data/joy/components/skeleton/InlineSkeleton.tsx index 7e457777c7cd31..03b019c28afcda 100644 --- a/docs/data/joy/components/skeleton/InlineSkeleton.tsx +++ b/docs/data/joy/components/skeleton/InlineSkeleton.tsx @@ -20,7 +20,7 @@ export default function InlineSkeleton() { A heading HISTORY, PURPOSE AND USAGE diff --git a/docs/data/joy/components/skeleton/TextBlockSkeleton.js b/docs/data/joy/components/skeleton/TextBlockSkeleton.js index 5f372113578209..6dfd56cdf4bafd 100644 --- a/docs/data/joy/components/skeleton/TextBlockSkeleton.js +++ b/docs/data/joy/components/skeleton/TextBlockSkeleton.js @@ -12,14 +12,14 @@ export default function TextBlockSkeleton() { h2 Typeface - - body1 Typeface + + body-md Typeface - - body2 Typeface + + body-sm Typeface - - body3 Typeface + + body-xs Typeface ); } diff --git a/docs/data/joy/components/skeleton/TextBlockSkeleton.tsx b/docs/data/joy/components/skeleton/TextBlockSkeleton.tsx index 5f372113578209..6dfd56cdf4bafd 100644 --- a/docs/data/joy/components/skeleton/TextBlockSkeleton.tsx +++ b/docs/data/joy/components/skeleton/TextBlockSkeleton.tsx @@ -12,14 +12,14 @@ export default function TextBlockSkeleton() { h2 Typeface - - body1 Typeface + + body-md Typeface - - body2 Typeface + + body-sm Typeface - - body3 Typeface + + body-xs Typeface ); } diff --git a/docs/data/joy/components/skeleton/TextBlockSkeleton.tsx.preview b/docs/data/joy/components/skeleton/TextBlockSkeleton.tsx.preview index a3d0f0a359f131..a9ba6a08868ded 100644 --- a/docs/data/joy/components/skeleton/TextBlockSkeleton.tsx.preview +++ b/docs/data/joy/components/skeleton/TextBlockSkeleton.tsx.preview @@ -4,11 +4,11 @@ h2 Typeface - -body1 Typeface + +body-md Typeface - -body2 Typeface + +body-sm Typeface - -body3 Typeface \ No newline at end of file + +body-xs Typeface \ No newline at end of file diff --git a/docs/data/joy/components/stack/BasicStack.js b/docs/data/joy/components/stack/BasicStack.js index fe96a00bedc855..1bb7416cec5f29 100644 --- a/docs/data/joy/components/stack/BasicStack.js +++ b/docs/data/joy/components/stack/BasicStack.js @@ -7,7 +7,7 @@ import { styled } from '@mui/joy/styles'; const Item = styled(Sheet)(({ theme }) => ({ backgroundColor: theme.palette.mode === 'dark' ? theme.palette.background.level1 : '#fff', - ...theme.typography.body2, + ...theme.typography['body-sm'], padding: theme.spacing(1), textAlign: 'center', borderRadius: 4, diff --git a/docs/data/joy/components/stack/BasicStack.tsx b/docs/data/joy/components/stack/BasicStack.tsx index fe96a00bedc855..1bb7416cec5f29 100644 --- a/docs/data/joy/components/stack/BasicStack.tsx +++ b/docs/data/joy/components/stack/BasicStack.tsx @@ -7,7 +7,7 @@ import { styled } from '@mui/joy/styles'; const Item = styled(Sheet)(({ theme }) => ({ backgroundColor: theme.palette.mode === 'dark' ? theme.palette.background.level1 : '#fff', - ...theme.typography.body2, + ...theme.typography['body-sm'], padding: theme.spacing(1), textAlign: 'center', borderRadius: 4, diff --git a/docs/data/joy/components/stack/DirectionStack.js b/docs/data/joy/components/stack/DirectionStack.js index fd9153fc286444..e4db4711d8c9a3 100644 --- a/docs/data/joy/components/stack/DirectionStack.js +++ b/docs/data/joy/components/stack/DirectionStack.js @@ -6,7 +6,7 @@ import { styled } from '@mui/joy/styles'; const Item = styled(Sheet)(({ theme }) => ({ backgroundColor: theme.palette.mode === 'dark' ? theme.palette.background.level1 : '#fff', - ...theme.typography.body2, + ...theme.typography['body-sm'], padding: theme.spacing(1), textAlign: 'center', borderRadius: 4, diff --git a/docs/data/joy/components/stack/DirectionStack.tsx b/docs/data/joy/components/stack/DirectionStack.tsx index fd9153fc286444..e4db4711d8c9a3 100644 --- a/docs/data/joy/components/stack/DirectionStack.tsx +++ b/docs/data/joy/components/stack/DirectionStack.tsx @@ -6,7 +6,7 @@ import { styled } from '@mui/joy/styles'; const Item = styled(Sheet)(({ theme }) => ({ backgroundColor: theme.palette.mode === 'dark' ? theme.palette.background.level1 : '#fff', - ...theme.typography.body2, + ...theme.typography['body-sm'], padding: theme.spacing(1), textAlign: 'center', borderRadius: 4, diff --git a/docs/data/joy/components/stack/DividerStack.js b/docs/data/joy/components/stack/DividerStack.js index 869db1e7d4517e..3451afa7ca399f 100644 --- a/docs/data/joy/components/stack/DividerStack.js +++ b/docs/data/joy/components/stack/DividerStack.js @@ -8,7 +8,7 @@ import { styled } from '@mui/joy/styles'; const Item = styled(Sheet)(({ theme }) => ({ backgroundColor: theme.palette.mode === 'dark' ? theme.palette.background.level1 : '#fff', - ...theme.typography.body2, + ...theme.typography['body-sm'], padding: theme.spacing(1), textAlign: 'center', borderRadius: 4, diff --git a/docs/data/joy/components/stack/DividerStack.tsx b/docs/data/joy/components/stack/DividerStack.tsx index 869db1e7d4517e..3451afa7ca399f 100644 --- a/docs/data/joy/components/stack/DividerStack.tsx +++ b/docs/data/joy/components/stack/DividerStack.tsx @@ -8,7 +8,7 @@ import { styled } from '@mui/joy/styles'; const Item = styled(Sheet)(({ theme }) => ({ backgroundColor: theme.palette.mode === 'dark' ? theme.palette.background.level1 : '#fff', - ...theme.typography.body2, + ...theme.typography['body-sm'], padding: theme.spacing(1), textAlign: 'center', borderRadius: 4, diff --git a/docs/data/joy/components/stack/FlexboxGapStack.js b/docs/data/joy/components/stack/FlexboxGapStack.js index 3d8c09b36dc3ac..33d144ca45a120 100644 --- a/docs/data/joy/components/stack/FlexboxGapStack.js +++ b/docs/data/joy/components/stack/FlexboxGapStack.js @@ -7,7 +7,7 @@ import { styled } from '@mui/joy/styles'; const Item = styled(Sheet)(({ theme }) => ({ backgroundColor: theme.palette.mode === 'dark' ? theme.palette.background.level1 : '#fff', - ...theme.typography.body2, + ...theme.typography['body-sm'], padding: theme.spacing(1), textAlign: 'center', borderRadius: 4, diff --git a/docs/data/joy/components/stack/FlexboxGapStack.tsx b/docs/data/joy/components/stack/FlexboxGapStack.tsx index 3d8c09b36dc3ac..33d144ca45a120 100644 --- a/docs/data/joy/components/stack/FlexboxGapStack.tsx +++ b/docs/data/joy/components/stack/FlexboxGapStack.tsx @@ -7,7 +7,7 @@ import { styled } from '@mui/joy/styles'; const Item = styled(Sheet)(({ theme }) => ({ backgroundColor: theme.palette.mode === 'dark' ? theme.palette.background.level1 : '#fff', - ...theme.typography.body2, + ...theme.typography['body-sm'], padding: theme.spacing(1), textAlign: 'center', borderRadius: 4, diff --git a/docs/data/joy/components/stack/InteractiveStack.js b/docs/data/joy/components/stack/InteractiveStack.js index 9d9db740baaa46..febf8e63bfe255 100644 --- a/docs/data/joy/components/stack/InteractiveStack.js +++ b/docs/data/joy/components/stack/InteractiveStack.js @@ -13,7 +13,7 @@ import { styled } from '@mui/joy/styles'; const Item = styled(Sheet)(({ theme }) => ({ backgroundColor: theme.palette.mode === 'dark' ? theme.palette.background.level1 : '#fff', - ...theme.typography.body2, + ...theme.typography['body-sm'], padding: theme.spacing(1), textAlign: 'center', borderRadius: 4, diff --git a/docs/data/joy/components/stack/InteractiveStack.tsx b/docs/data/joy/components/stack/InteractiveStack.tsx index 1643857e1e15c4..a31100d97d8c36 100644 --- a/docs/data/joy/components/stack/InteractiveStack.tsx +++ b/docs/data/joy/components/stack/InteractiveStack.tsx @@ -13,7 +13,7 @@ import { styled } from '@mui/joy/styles'; const Item = styled(Sheet)(({ theme }) => ({ backgroundColor: theme.palette.mode === 'dark' ? theme.palette.background.level1 : '#fff', - ...theme.typography.body2, + ...theme.typography['body-sm'], padding: theme.spacing(1), textAlign: 'center', borderRadius: 4, diff --git a/docs/data/joy/components/stack/ResponsiveStack.js b/docs/data/joy/components/stack/ResponsiveStack.js index 4949a0ea55fa29..acc2bb6c6ab7e9 100644 --- a/docs/data/joy/components/stack/ResponsiveStack.js +++ b/docs/data/joy/components/stack/ResponsiveStack.js @@ -6,7 +6,7 @@ import { styled } from '@mui/joy/styles'; const Item = styled(Sheet)(({ theme }) => ({ backgroundColor: theme.palette.mode === 'dark' ? theme.palette.background.level1 : '#fff', - ...theme.typography.body2, + ...theme.typography['body-sm'], padding: theme.spacing(1), textAlign: 'center', borderRadius: 4, diff --git a/docs/data/joy/components/stack/ResponsiveStack.tsx b/docs/data/joy/components/stack/ResponsiveStack.tsx index 4949a0ea55fa29..acc2bb6c6ab7e9 100644 --- a/docs/data/joy/components/stack/ResponsiveStack.tsx +++ b/docs/data/joy/components/stack/ResponsiveStack.tsx @@ -6,7 +6,7 @@ import { styled } from '@mui/joy/styles'; const Item = styled(Sheet)(({ theme }) => ({ backgroundColor: theme.palette.mode === 'dark' ? theme.palette.background.level1 : '#fff', - ...theme.typography.body2, + ...theme.typography['body-sm'], padding: theme.spacing(1), textAlign: 'center', borderRadius: 4, diff --git a/docs/data/joy/components/stack/ZeroWidthStack.js b/docs/data/joy/components/stack/ZeroWidthStack.js index 70c89d61f5ab3e..fe6430db37ecac 100644 --- a/docs/data/joy/components/stack/ZeroWidthStack.js +++ b/docs/data/joy/components/stack/ZeroWidthStack.js @@ -7,7 +7,7 @@ import { styled } from '@mui/joy/styles'; import Typography from '@mui/joy/Typography'; const Item = styled(Sheet)(({ theme }) => ({ - ...theme.typography.body2, + ...theme.typography['body-sm'], padding: theme.spacing(1), textAlign: 'center', borderRadius: 4, diff --git a/docs/data/joy/components/stack/ZeroWidthStack.tsx b/docs/data/joy/components/stack/ZeroWidthStack.tsx index 70c89d61f5ab3e..fe6430db37ecac 100644 --- a/docs/data/joy/components/stack/ZeroWidthStack.tsx +++ b/docs/data/joy/components/stack/ZeroWidthStack.tsx @@ -7,7 +7,7 @@ import { styled } from '@mui/joy/styles'; import Typography from '@mui/joy/Typography'; const Item = styled(Sheet)(({ theme }) => ({ - ...theme.typography.body2, + ...theme.typography['body-sm'], padding: theme.spacing(1), textAlign: 'center', borderRadius: 4, diff --git a/docs/data/joy/components/switch/ExampleTrackChild.js b/docs/data/joy/components/switch/ExampleTrackChild.js index 9b91fd0de6a7f6..7f96a0624a7ffa 100644 --- a/docs/data/joy/components/switch/ExampleTrackChild.js +++ b/docs/data/joy/components/switch/ExampleTrackChild.js @@ -1,29 +1,53 @@ import * as React from 'react'; import Switch from '@mui/joy/Switch'; +import Stack from '@mui/joy/Stack'; import Typography from '@mui/joy/Typography'; export default function ExampleTrackChild() { return ( - - - On - - - Off - - - ), - }, - }} - sx={{ - '--Switch-thumbSize': '27px', - '--Switch-trackWidth': '64px', - '--Switch-trackHeight': '31px', - }} - /> + + + + On + + + Off + + + ), + }, + }} + sx={{ + '--Switch-thumbSize': '27px', + '--Switch-trackWidth': '64px', + '--Switch-trackHeight': '31px', + }} + /> + + I + 0 + + ), + sx: { + justifyContent: 'space-around', + }, + }, + }} + sx={{ + '--Switch-thumbSize': '27px', + '--Switch-trackWidth': '52px', + '--Switch-trackHeight': '31px', + }} + /> + ); } diff --git a/docs/data/joy/components/switch/ExampleTrackChild.tsx b/docs/data/joy/components/switch/ExampleTrackChild.tsx index 9b91fd0de6a7f6..7f96a0624a7ffa 100644 --- a/docs/data/joy/components/switch/ExampleTrackChild.tsx +++ b/docs/data/joy/components/switch/ExampleTrackChild.tsx @@ -1,29 +1,53 @@ import * as React from 'react'; import Switch from '@mui/joy/Switch'; +import Stack from '@mui/joy/Stack'; import Typography from '@mui/joy/Typography'; export default function ExampleTrackChild() { return ( - - - On - - - Off - - - ), - }, - }} - sx={{ - '--Switch-thumbSize': '27px', - '--Switch-trackWidth': '64px', - '--Switch-trackHeight': '31px', - }} - /> + + + + On + + + Off + + + ), + }, + }} + sx={{ + '--Switch-thumbSize': '27px', + '--Switch-trackWidth': '64px', + '--Switch-trackHeight': '31px', + }} + /> + + I + 0 + + ), + sx: { + justifyContent: 'space-around', + }, + }, + }} + sx={{ + '--Switch-thumbSize': '27px', + '--Switch-trackWidth': '52px', + '--Switch-trackHeight': '31px', + }} + /> + ); } diff --git a/docs/data/joy/components/switch/SwitchControl.js b/docs/data/joy/components/switch/SwitchControl.js index 4a3796a97c721e..13de9b76d7a8ce 100644 --- a/docs/data/joy/components/switch/SwitchControl.js +++ b/docs/data/joy/components/switch/SwitchControl.js @@ -20,7 +20,7 @@ export default function SwitchControl() { checked={checked} onChange={(event) => setChecked(event.target.checked)} color={checked ? 'success' : 'neutral'} - variant="outlined" + variant={checked ? 'solid' : 'outlined'} endDecorator={checked ? 'On' : 'Off'} slotProps={{ endDecorator: { diff --git a/docs/data/joy/components/switch/SwitchControl.tsx b/docs/data/joy/components/switch/SwitchControl.tsx index 901e1d6db947a1..86a8a23f4face6 100644 --- a/docs/data/joy/components/switch/SwitchControl.tsx +++ b/docs/data/joy/components/switch/SwitchControl.tsx @@ -22,7 +22,7 @@ export default function SwitchControl() { setChecked(event.target.checked) } color={checked ? 'success' : 'neutral'} - variant="outlined" + variant={checked ? 'solid' : 'outlined'} endDecorator={checked ? 'On' : 'Off'} slotProps={{ endDecorator: { diff --git a/docs/data/joy/components/switch/SwitchUsage.js b/docs/data/joy/components/switch/SwitchUsage.js index 29b32e84c49f45..fd1f15030fbf3f 100644 --- a/docs/data/joy/components/switch/SwitchUsage.js +++ b/docs/data/joy/components/switch/SwitchUsage.js @@ -3,6 +3,7 @@ import Switch from '@mui/joy/Switch'; import JoyUsageDemo from 'docs/src/modules/components/JoyUsageDemo'; export default function SwitchUsage() { + const [checked, setChecked] = React.useState(false); return ( } + renderDemo={(props) => ( + setChecked(event.target.checked)} + /> + )} /> ); } diff --git a/docs/data/joy/components/table/TableCollapsibleRow.js b/docs/data/joy/components/table/TableCollapsibleRow.js index c4e85a38c90ab5..4d7764f1c8bcea 100644 --- a/docs/data/joy/components/table/TableCollapsibleRow.js +++ b/docs/data/joy/components/table/TableCollapsibleRow.js @@ -61,7 +61,7 @@ function Row(props) { variant="soft" sx={{ p: 1, pl: 6, boxShadow: 'inset 0 3px 6px 0 rgba(0 0 0 / 0.08)' }} > - + History ; initialOpen?: boolean variant="soft" sx={{ p: 1, pl: 6, boxShadow: 'inset 0 3px 6px 0 rgba(0 0 0 / 0.08)' }} > - + History
- + ← Scroll direction β†’ - + ← Scroll direction β†’ ({ - '& tr > *:first-child': { bgcolor: 'info.softBg' }, + '& tr > *:first-child': { bgcolor: 'success.softBg' }, '& th[scope="col"]': theme.variants.solid.neutral, '& td': theme.variants.soft.neutral, })} diff --git a/docs/data/joy/components/table/TableGlobalVariant.tsx b/docs/data/joy/components/table/TableGlobalVariant.tsx index a2c6719c21fdfb..7b97ab45e3abd7 100644 --- a/docs/data/joy/components/table/TableGlobalVariant.tsx +++ b/docs/data/joy/components/table/TableGlobalVariant.tsx @@ -6,7 +6,7 @@ export default function TableGlobalVariant() {
({ - '& tr > *:first-child': { bgcolor: 'info.softBg' }, + '& tr > *:first-child': { bgcolor: 'success.softBg' }, '& th[scope="col"]': theme.variants.solid.neutral, '& td': theme.variants.soft.neutral, })} diff --git a/docs/data/joy/components/table/TableScrollingShadows.js b/docs/data/joy/components/table/TableScrollingShadows.js index c043592107ef1e..3cec95661072ce 100644 --- a/docs/data/joy/components/table/TableScrollingShadows.js +++ b/docs/data/joy/components/table/TableScrollingShadows.js @@ -23,7 +23,7 @@ const rows = [ export default function TableScrollingShadows() { return (
- + The table body is scrollable. - + The table body is scrollable. ) : ( - theme.vars.palette.info.softBg, + theme.vars.palette.success.softBg, '& thead th:nth-child(1)': { width: '40px', }, diff --git a/docs/data/joy/components/table/TableSortAndSelection.tsx b/docs/data/joy/components/table/TableSortAndSelection.tsx index 10872c4d13b147..af9c7ddc93376c 100644 --- a/docs/data/joy/components/table/TableSortAndSelection.tsx +++ b/docs/data/joy/components/table/TableSortAndSelection.tsx @@ -264,7 +264,7 @@ function EnhancedTableToolbar(props: EnhancedTableToolbarProps) { ) : ( - theme.vars.palette.info.softBg, + theme.vars.palette.success.softBg, '& thead th:nth-child(1)': { width: '40px', }, diff --git a/docs/data/joy/components/table/TableStickyHeader.js b/docs/data/joy/components/table/TableStickyHeader.js index 090ad901e83012..74e807460234a1 100644 --- a/docs/data/joy/components/table/TableStickyHeader.js +++ b/docs/data/joy/components/table/TableStickyHeader.js @@ -26,7 +26,7 @@ function sum(column) { export default function TableStickyHeader() { return (
- + The table body is scrollable. diff --git a/docs/data/joy/components/table/TableStickyHeader.tsx b/docs/data/joy/components/table/TableStickyHeader.tsx index 8ea61c757c9f93..f1f9e9f432db65 100644 --- a/docs/data/joy/components/table/TableStickyHeader.tsx +++ b/docs/data/joy/components/table/TableStickyHeader.tsx @@ -31,7 +31,7 @@ function sum(column: 'calories' | 'fat' | 'carbs' | 'protein') { export default function TableStickyHeader() { return (
- + The table body is scrollable. diff --git a/docs/data/joy/components/table/TableTextEllipsis.js b/docs/data/joy/components/table/TableTextEllipsis.js index ba9bfb41f78ee2..bad48f3dedc22d 100644 --- a/docs/data/joy/components/table/TableTextEllipsis.js +++ b/docs/data/joy/components/table/TableTextEllipsis.js @@ -29,7 +29,7 @@ export default function TableTextEllipsis() { Morty D Ardiousdellois Addami - + Writer, Youtuber diff --git a/docs/data/joy/components/table/TableTextEllipsis.tsx b/docs/data/joy/components/table/TableTextEllipsis.tsx index ba9bfb41f78ee2..bad48f3dedc22d 100644 --- a/docs/data/joy/components/table/TableTextEllipsis.tsx +++ b/docs/data/joy/components/table/TableTextEllipsis.tsx @@ -29,7 +29,7 @@ export default function TableTextEllipsis() { Morty D Ardiousdellois Addami - + Writer, Youtuber diff --git a/docs/data/joy/components/table/TableUsage.js b/docs/data/joy/components/table/TableUsage.js index e67a716dd3d6e7..7b2da59f1d6bd7 100644 --- a/docs/data/joy/components/table/TableUsage.js +++ b/docs/data/joy/components/table/TableUsage.js @@ -55,7 +55,7 @@ export default function ButtonUsage() { renderDemo={(props) => ( setColor(newValue)} > - {['neutral', 'primary', 'danger', 'info', 'success', 'warning'].map( - (item) => ( - - ), - )} + {['neutral', 'primary', 'danger', 'success', 'warning'].map((item) => ( + + ))} diff --git a/docs/data/joy/components/table/TableVariants.tsx b/docs/data/joy/components/table/TableVariants.tsx index bec3b79094ae23..9c91085c8d0962 100644 --- a/docs/data/joy/components/table/TableVariants.tsx +++ b/docs/data/joy/components/table/TableVariants.tsx @@ -63,13 +63,11 @@ export default function TableVariants() { value={color} onChange={(event, newValue) => setColor(newValue as typeof color)} > - {['neutral', 'primary', 'danger', 'info', 'success', 'warning'].map( - (item) => ( - - ), - )} + {['neutral', 'primary', 'danger', 'success', 'warning'].map((item) => ( + + ))} diff --git a/docs/data/joy/components/tabs/TabDisabled.js b/docs/data/joy/components/tabs/TabDisabled.js index c2c759e35ae056..d1695e9dc28e40 100644 --- a/docs/data/joy/components/tabs/TabDisabled.js +++ b/docs/data/joy/components/tabs/TabDisabled.js @@ -5,7 +5,7 @@ import Tab from '@mui/joy/Tab'; export default function TabDisabled() { return ( - + First tab Second tab diff --git a/docs/data/joy/components/tabs/TabDisabled.tsx b/docs/data/joy/components/tabs/TabDisabled.tsx index c2c759e35ae056..d1695e9dc28e40 100644 --- a/docs/data/joy/components/tabs/TabDisabled.tsx +++ b/docs/data/joy/components/tabs/TabDisabled.tsx @@ -5,7 +5,7 @@ import Tab from '@mui/joy/Tab'; export default function TabDisabled() { return ( - + First tab Second tab diff --git a/docs/data/joy/components/tabs/TabDisabled.tsx.preview b/docs/data/joy/components/tabs/TabDisabled.tsx.preview index 5c90d27f5570fe..fb178b27ee297c 100644 --- a/docs/data/joy/components/tabs/TabDisabled.tsx.preview +++ b/docs/data/joy/components/tabs/TabDisabled.tsx.preview @@ -1,4 +1,4 @@ - + First tab Second tab diff --git a/docs/data/joy/components/tabs/TabsBasic.js b/docs/data/joy/components/tabs/TabsBasic.js index 7700d27fd85703..85a0ba2db744b7 100644 --- a/docs/data/joy/components/tabs/TabsBasic.js +++ b/docs/data/joy/components/tabs/TabsBasic.js @@ -6,19 +6,19 @@ import TabPanel from '@mui/joy/TabPanel'; export default function TabsBasic() { return ( - + First tab Second tab Third tab - + First tab panel - + Second tab panel - + Third tab panel diff --git a/docs/data/joy/components/tabs/TabsBasic.tsx b/docs/data/joy/components/tabs/TabsBasic.tsx index 7700d27fd85703..85a0ba2db744b7 100644 --- a/docs/data/joy/components/tabs/TabsBasic.tsx +++ b/docs/data/joy/components/tabs/TabsBasic.tsx @@ -6,19 +6,19 @@ import TabPanel from '@mui/joy/TabPanel'; export default function TabsBasic() { return ( - + First tab Second tab Third tab - + First tab panel - + Second tab panel - + Third tab panel diff --git a/docs/data/joy/components/tabs/TabsBasic.tsx.preview b/docs/data/joy/components/tabs/TabsBasic.tsx.preview index 35e69f3f6771f4..088ef73b86168b 100644 --- a/docs/data/joy/components/tabs/TabsBasic.tsx.preview +++ b/docs/data/joy/components/tabs/TabsBasic.tsx.preview @@ -1,16 +1,16 @@ - + First tab Second tab Third tab - + First tab panel - + Second tab panel - + Third tab panel \ No newline at end of file diff --git a/docs/data/joy/components/tabs/TabsBottomNavExample.js b/docs/data/joy/components/tabs/TabsBottomNavExample.js index 1beb9df78485c7..2267777076214a 100644 --- a/docs/data/joy/components/tabs/TabsBottomNavExample.js +++ b/docs/data/joy/components/tabs/TabsBottomNavExample.js @@ -11,7 +11,7 @@ import Person from '@mui/icons-material/Person'; export default function TabsBottomNavExample() { const [index, setIndex] = React.useState(0); - const colors = ['primary', 'info', 'danger', 'success']; + const colors = ['primary', 'danger', 'success', 'warning']; return ( setIndex(value)} sx={(theme) => ({ - borderRadius: 'xl', + p: 1, + borderRadius: '24px', maxWidth: 400, mx: 'auto', boxShadow: theme.shadow.sm, - '--Tabs-gap': '8px', '--joy-shadowChannel': theme.vars.palette[colors[index]].darkChannel, [`& .${tabClasses.root}`]: { - boxShadow: 'none', - borderRadius: 'lg', whiteSpace: 'nowrap', transition: '0.3s', - fontWeight: 'lg', + fontWeight: 'md', flex: 1, [`&:not(.${tabClasses.selected}):not(:hover)`]: { opacity: 0.72, @@ -48,10 +47,11 @@ export default function TabsBottomNavExample() { }, })} > - + @@ -59,8 +59,9 @@ export default function TabsBottomNavExample() { Home @@ -68,8 +69,9 @@ export default function TabsBottomNavExample() { Likes @@ -77,8 +79,9 @@ export default function TabsBottomNavExample() { Search diff --git a/docs/data/joy/components/tabs/TabsBottomNavExample.tsx b/docs/data/joy/components/tabs/TabsBottomNavExample.tsx index 7da14b85ed4a83..6ade044bb8a479 100644 --- a/docs/data/joy/components/tabs/TabsBottomNavExample.tsx +++ b/docs/data/joy/components/tabs/TabsBottomNavExample.tsx @@ -11,7 +11,7 @@ import Person from '@mui/icons-material/Person'; export default function TabsBottomNavExample() { const [index, setIndex] = React.useState(0); - const colors = ['primary', 'info', 'danger', 'success'] as const; + const colors = ['primary', 'danger', 'success', 'warning'] as const; return ( setIndex(value as number)} sx={(theme) => ({ - borderRadius: 'xl', + p: 1, + borderRadius: '24px', maxWidth: 400, mx: 'auto', boxShadow: theme.shadow.sm, - '--Tabs-gap': '8px', '--joy-shadowChannel': theme.vars.palette[colors[index]].darkChannel, [`& .${tabClasses.root}`]: { - boxShadow: 'none', - borderRadius: 'lg', whiteSpace: 'nowrap', transition: '0.3s', - fontWeight: 'lg', + fontWeight: 'md', flex: 1, [`&:not(.${tabClasses.selected}):not(:hover)`]: { opacity: 0.72, @@ -48,10 +47,11 @@ export default function TabsBottomNavExample() { }, })} > - + @@ -59,8 +59,9 @@ export default function TabsBottomNavExample() { Home @@ -68,8 +69,9 @@ export default function TabsBottomNavExample() { Likes @@ -77,8 +79,9 @@ export default function TabsBottomNavExample() { Search diff --git a/docs/data/joy/components/tabs/TabsBrowserExample.js b/docs/data/joy/components/tabs/TabsBrowserExample.js new file mode 100644 index 00000000000000..5145ec35ec7713 --- /dev/null +++ b/docs/data/joy/components/tabs/TabsBrowserExample.js @@ -0,0 +1,157 @@ +import * as React from 'react'; +import Tabs from '@mui/joy/Tabs'; +import TabList from '@mui/joy/TabList'; +import Tab, { tabClasses } from '@mui/joy/Tab'; +import ListItemDecorator from '@mui/joy/ListItemDecorator'; +import SvgIcon from '@mui/joy/SvgIcon'; + +export default function TabsBrowserExample() { + const [index, setIndex] = React.useState(0); + return ( + setIndex(newValue)} + > + + + + + + Google Search + + + + + + Twitter + + + + + + Dribbble + + + + + + React + + + + ); +} + +function GoogleIcon() { + return ( + + + + + + + + + + + ); +} +function TwitterIcon() { + return ( + + + + + + ); +} + +function DribbbleIcon() { + return ( + + + + + + + + ); +} + +function ReactIcon() { + return ( + + + + + + + + + + + ); +} diff --git a/docs/data/joy/components/tabs/TabsBrowserExample.tsx b/docs/data/joy/components/tabs/TabsBrowserExample.tsx new file mode 100644 index 00000000000000..e600658cde5c6c --- /dev/null +++ b/docs/data/joy/components/tabs/TabsBrowserExample.tsx @@ -0,0 +1,157 @@ +import * as React from 'react'; +import Tabs from '@mui/joy/Tabs'; +import TabList from '@mui/joy/TabList'; +import Tab, { tabClasses } from '@mui/joy/Tab'; +import ListItemDecorator from '@mui/joy/ListItemDecorator'; +import SvgIcon from '@mui/joy/SvgIcon'; + +export default function TabsBrowserExample() { + const [index, setIndex] = React.useState(0); + return ( + setIndex(newValue as number)} + > + + + + + + Google Search + + + + + + Twitter + + + + + + Dribbble + + + + + + React + + + + ); +} + +function GoogleIcon() { + return ( + + + + + + + + + + + ); +} +function TwitterIcon() { + return ( + + + + + + ); +} + +function DribbbleIcon() { + return ( + + + + + + + + ); +} + +function ReactIcon() { + return ( + + + + + + + + + + + ); +} diff --git a/docs/data/joy/components/tabs/TabsFlex.js b/docs/data/joy/components/tabs/TabsFlex.js new file mode 100644 index 00000000000000..b2c3b60eb41a48 --- /dev/null +++ b/docs/data/joy/components/tabs/TabsFlex.js @@ -0,0 +1,27 @@ +import * as React from 'react'; +import Tabs from '@mui/joy/Tabs'; +import TabList from '@mui/joy/TabList'; +import Tab from '@mui/joy/Tab'; +import Stack from '@mui/joy/Stack'; + +export default function TabsFlex() { + return ( + + + + First tab + Example of a very long tab label + Third tab + + + + + + First tab + Example of a very long tab label + Third tab + + + + ); +} diff --git a/docs/data/joy/components/tabs/TabsFlex.tsx b/docs/data/joy/components/tabs/TabsFlex.tsx new file mode 100644 index 00000000000000..b2c3b60eb41a48 --- /dev/null +++ b/docs/data/joy/components/tabs/TabsFlex.tsx @@ -0,0 +1,27 @@ +import * as React from 'react'; +import Tabs from '@mui/joy/Tabs'; +import TabList from '@mui/joy/TabList'; +import Tab from '@mui/joy/Tab'; +import Stack from '@mui/joy/Stack'; + +export default function TabsFlex() { + return ( + + + + First tab + Example of a very long tab label + Third tab + + + + + + First tab + Example of a very long tab label + Third tab + + + + ); +} diff --git a/docs/data/joy/components/tabs/TabsFlex.tsx.preview b/docs/data/joy/components/tabs/TabsFlex.tsx.preview new file mode 100644 index 00000000000000..b404f77fbb15d2 --- /dev/null +++ b/docs/data/joy/components/tabs/TabsFlex.tsx.preview @@ -0,0 +1,15 @@ + + + First tab + Example of a very long tab label + Third tab + + + + + + First tab + Example of a very long tab label + Third tab + + \ No newline at end of file diff --git a/docs/data/joy/components/tabs/TabsFlexPlacement.js b/docs/data/joy/components/tabs/TabsFlexPlacement.js new file mode 100644 index 00000000000000..c19d65bdfdcf6b --- /dev/null +++ b/docs/data/joy/components/tabs/TabsFlexPlacement.js @@ -0,0 +1,69 @@ +import * as React from 'react'; +import Box from '@mui/joy/Box'; +import FormControl from '@mui/joy/FormControl'; +import FormLabel from '@mui/joy/FormLabel'; +import Select from '@mui/joy/Select'; +import Option from '@mui/joy/Option'; +import Tabs from '@mui/joy/Tabs'; +import TabList from '@mui/joy/TabList'; +import Tab from '@mui/joy/Tab'; +import TabPanel from '@mui/joy/TabPanel'; + +export default function TabsFlexPlacement() { + const [direction, setDirection] = React.useState('column'); + const [placement, setPlacement] = React.useState('bottom'); + return ( + + + Flex direction + + + + Placement + + + + + + Tab A + + + Tab B + + + Tab C + + + Content of Tab A + Content of Tab B + Content of Tab C + + + ); +} diff --git a/docs/data/joy/components/tabs/TabsFlexPlacement.tsx b/docs/data/joy/components/tabs/TabsFlexPlacement.tsx new file mode 100644 index 00000000000000..c773f237c5b2fc --- /dev/null +++ b/docs/data/joy/components/tabs/TabsFlexPlacement.tsx @@ -0,0 +1,73 @@ +import * as React from 'react'; +import Box from '@mui/joy/Box'; +import FormControl from '@mui/joy/FormControl'; +import FormLabel from '@mui/joy/FormLabel'; +import Select from '@mui/joy/Select'; +import Option from '@mui/joy/Option'; +import Tabs from '@mui/joy/Tabs'; +import TabList from '@mui/joy/TabList'; +import Tab from '@mui/joy/Tab'; +import TabPanel from '@mui/joy/TabPanel'; + +export default function TabsFlexPlacement() { + const [direction, setDirection] = React.useState< + 'row' | 'column' | 'row-reverse' | 'column-reverse' + >('column'); + const [placement, setPlacement] = React.useState< + 'top' | 'bottom' | 'left' | 'right' + >('bottom'); + return ( + + + Flex direction + + + + Placement + + + + + + Tab A + + + Tab B + + + Tab C + + + Content of Tab A + Content of Tab B + Content of Tab C + + + ); +} diff --git a/docs/data/joy/components/tabs/TabsIcon.js b/docs/data/joy/components/tabs/TabsIcon.js index 66468d48e80194..d0201996a043ac 100644 --- a/docs/data/joy/components/tabs/TabsIcon.js +++ b/docs/data/joy/components/tabs/TabsIcon.js @@ -8,7 +8,7 @@ import PersonPinIcon from '@mui/icons-material/PersonPin'; export default function TabsIcon() { return ( - + diff --git a/docs/data/joy/components/tabs/TabsIcon.tsx b/docs/data/joy/components/tabs/TabsIcon.tsx index 66468d48e80194..d0201996a043ac 100644 --- a/docs/data/joy/components/tabs/TabsIcon.tsx +++ b/docs/data/joy/components/tabs/TabsIcon.tsx @@ -8,7 +8,7 @@ import PersonPinIcon from '@mui/icons-material/PersonPin'; export default function TabsIcon() { return ( - + diff --git a/docs/data/joy/components/tabs/TabsIcon.tsx.preview b/docs/data/joy/components/tabs/TabsIcon.tsx.preview index 2ee615ae539293..5ee4abdd0e0f67 100644 --- a/docs/data/joy/components/tabs/TabsIcon.tsx.preview +++ b/docs/data/joy/components/tabs/TabsIcon.tsx.preview @@ -1,4 +1,4 @@ - + diff --git a/docs/data/joy/components/tabs/TabsIconWithText.js b/docs/data/joy/components/tabs/TabsIconWithText.js index 1e10c2dcd06480..1b257eb4f7727b 100644 --- a/docs/data/joy/components/tabs/TabsIconWithText.js +++ b/docs/data/joy/components/tabs/TabsIconWithText.js @@ -3,18 +3,15 @@ import Tabs from '@mui/joy/Tabs'; import TabList from '@mui/joy/TabList'; import Tab from '@mui/joy/Tab'; import ListItemDecorator from '@mui/joy/ListItemDecorator'; +import Stack from '@mui/joy/Stack'; import PhoneIcon from '@mui/icons-material/Phone'; import FavoriteIcon from '@mui/icons-material/Favorite'; import PersonPinIcon from '@mui/icons-material/PersonPin'; export default function TabsIconWithText() { return ( -
- + + @@ -36,8 +33,8 @@ export default function TabsIconWithText() { - - + + @@ -58,6 +55,6 @@ export default function TabsIconWithText() { -
+ ); } diff --git a/docs/data/joy/components/tabs/TabsIconWithText.tsx b/docs/data/joy/components/tabs/TabsIconWithText.tsx index 1e10c2dcd06480..1b257eb4f7727b 100644 --- a/docs/data/joy/components/tabs/TabsIconWithText.tsx +++ b/docs/data/joy/components/tabs/TabsIconWithText.tsx @@ -3,18 +3,15 @@ import Tabs from '@mui/joy/Tabs'; import TabList from '@mui/joy/TabList'; import Tab from '@mui/joy/Tab'; import ListItemDecorator from '@mui/joy/ListItemDecorator'; +import Stack from '@mui/joy/Stack'; import PhoneIcon from '@mui/icons-material/Phone'; import FavoriteIcon from '@mui/icons-material/Favorite'; import PersonPinIcon from '@mui/icons-material/PersonPin'; export default function TabsIconWithText() { return ( -
- + + @@ -36,8 +33,8 @@ export default function TabsIconWithText() { - - + + @@ -58,6 +55,6 @@ export default function TabsIconWithText() { -
+ ); } diff --git a/docs/data/joy/components/tabs/TabsIndicatorPlacement.js b/docs/data/joy/components/tabs/TabsIndicatorPlacement.js new file mode 100644 index 00000000000000..5c6343a1f06d17 --- /dev/null +++ b/docs/data/joy/components/tabs/TabsIndicatorPlacement.js @@ -0,0 +1,38 @@ +import * as React from 'react'; +import Tabs from '@mui/joy/Tabs'; +import TabList from '@mui/joy/TabList'; +import Tab from '@mui/joy/Tab'; +import TabPanel from '@mui/joy/TabPanel'; + +export default function TabsIndicatorPlacement() { + return ( + + + + Top + + + Right + + + Bottom + + + Left + + + + IndicatorPlacement Top + + + IndicatorPlacement Right + + + IndicatorPlacement Bottom + + + IndicatorPlacement Left + + + ); +} diff --git a/docs/data/joy/components/tabs/TabsIndicatorPlacement.tsx b/docs/data/joy/components/tabs/TabsIndicatorPlacement.tsx new file mode 100644 index 00000000000000..5c6343a1f06d17 --- /dev/null +++ b/docs/data/joy/components/tabs/TabsIndicatorPlacement.tsx @@ -0,0 +1,38 @@ +import * as React from 'react'; +import Tabs from '@mui/joy/Tabs'; +import TabList from '@mui/joy/TabList'; +import Tab from '@mui/joy/Tab'; +import TabPanel from '@mui/joy/TabPanel'; + +export default function TabsIndicatorPlacement() { + return ( + + + + Top + + + Right + + + Bottom + + + Left + + + + IndicatorPlacement Top + + + IndicatorPlacement Right + + + IndicatorPlacement Bottom + + + IndicatorPlacement Left + + + ); +} diff --git a/docs/data/joy/components/tabs/TabsPageExample.js b/docs/data/joy/components/tabs/TabsPageExample.js index f9282c8e99ad35..915b48892859f3 100644 --- a/docs/data/joy/components/tabs/TabsPageExample.js +++ b/docs/data/joy/components/tabs/TabsPageExample.js @@ -14,7 +14,6 @@ export default function TabsPageExample() { return ( setIndex(value)} - sx={{ '--Tabs-gap': '0px' }} > - + Deals{' '} - + Library{' '} - Search library + Search library - ({ - '--bg': theme.vars.palette.background.level3, - height: '1px', - background: 'var(--bg)', - boxShadow: '0 0 0 100vmax var(--bg)', - clipPath: 'inset(0 -100vmax)', - })} - /> ({ '--bg': theme.vars.palette.background.surface, background: 'var(--bg)', boxShadow: '0 0 0 100vmax var(--bg)', clipPath: 'inset(0 -100vmax)', - px: 4, - py: 2, })} > @@ -109,7 +84,6 @@ export default function TabsPageExample() { level="h2" component="div" fontSize="lg" - mb={2} textColor="text.primary" > Deals panel @@ -120,7 +94,6 @@ export default function TabsPageExample() { level="h2" component="div" fontSize="lg" - mb={2} textColor="text.primary" > Library panel diff --git a/docs/data/joy/components/tabs/TabsPageExample.tsx b/docs/data/joy/components/tabs/TabsPageExample.tsx index 6b6e2ec967e690..745afb97f0faf2 100644 --- a/docs/data/joy/components/tabs/TabsPageExample.tsx +++ b/docs/data/joy/components/tabs/TabsPageExample.tsx @@ -14,7 +14,6 @@ export default function TabsPageExample() { return ( setIndex(value as number)} - sx={{ '--Tabs-gap': '0px' }} > - + Deals{' '} - + Library{' '} - Search library + Search library - ({ - '--bg': theme.vars.palette.background.level3, - height: '1px', - background: 'var(--bg)', - boxShadow: '0 0 0 100vmax var(--bg)', - clipPath: 'inset(0 -100vmax)', - })} - /> ({ '--bg': theme.vars.palette.background.surface, background: 'var(--bg)', boxShadow: '0 0 0 100vmax var(--bg)', clipPath: 'inset(0 -100vmax)', - px: 4, - py: 2, })} > @@ -109,7 +84,6 @@ export default function TabsPageExample() { level="h2" component="div" fontSize="lg" - mb={2} textColor="text.primary" > Deals panel @@ -120,7 +94,6 @@ export default function TabsPageExample() { level="h2" component="div" fontSize="lg" - mb={2} textColor="text.primary" > Library panel diff --git a/docs/data/joy/components/tabs/TabsPricingExample.js b/docs/data/joy/components/tabs/TabsPricingExample.js index e6a22747b00c2d..d703c2ba99df60 100644 --- a/docs/data/joy/components/tabs/TabsPricingExample.js +++ b/docs/data/joy/components/tabs/TabsPricingExample.js @@ -8,78 +8,72 @@ import Typography from '@mui/joy/Typography'; export default function TabsPricingExample() { return ( ({ + sx={{ width: 343, - '--Tabs-gap': '0px', borderRadius: 'lg', boxShadow: 'sm', overflow: 'auto', - border: `1px solid ${theme.vars.palette.divider}`, - })} + }} > - Community - Pro - Premium + + Community + + + Pro + + + Premium + - + Get started with the industry-standard React UI library, MIT-licensed. - + $0{' '} - Free forever - + Best for professional developers building enterprise or data-rich applications. - + $15{' '} / dev / month - + The most advanced features for data-rich applications, as well as the highest priority for support. - + ({ + sx={{ width: 343, - '--Tabs-gap': '0px', borderRadius: 'lg', boxShadow: 'sm', overflow: 'auto', - border: `1px solid ${theme.vars.palette.divider}`, - })} + }} > - Community - Pro - Premium + + Community + + + Pro + + + Premium + - + Get started with the industry-standard React UI library, MIT-licensed. - + $0{' '} - Free forever - + Best for professional developers building enterprise or data-rich applications. - + $15{' '} / dev / month - + The most advanced features for data-rich applications, as well as the highest priority for support. - + + + Feature + Specifications + Review + Support + + + ); +} diff --git a/docs/data/joy/components/tabs/TabsSegmentedControls.tsx b/docs/data/joy/components/tabs/TabsSegmentedControls.tsx new file mode 100644 index 00000000000000..18e897e077a0b3 --- /dev/null +++ b/docs/data/joy/components/tabs/TabsSegmentedControls.tsx @@ -0,0 +1,29 @@ +import * as React from 'react'; +import Tabs from '@mui/joy/Tabs'; +import TabList from '@mui/joy/TabList'; +import Tab, { tabClasses } from '@mui/joy/Tab'; + +export default function TabsSegmentedControls() { + return ( + + + Feature + Specifications + Review + Support + + + ); +} diff --git a/docs/data/joy/components/tabs/TabsSticky.js b/docs/data/joy/components/tabs/TabsSticky.js new file mode 100644 index 00000000000000..108881f7d591f6 --- /dev/null +++ b/docs/data/joy/components/tabs/TabsSticky.js @@ -0,0 +1,45 @@ +import * as React from 'react'; +import Tabs from '@mui/joy/Tabs'; +import TabList from '@mui/joy/TabList'; +import Tab from '@mui/joy/Tab'; + +export default function TabsSticky() { + const [sticky, setSticky] = React.useState('top'); + const items = [ + + + Sticky top + + + Sticky bottom + + , +
+ {[...new Array(50)].map((_, index) => ( +
Long content
+ ))} +
, + ]; + return ( + setSticky(newValue)} + sx={{ + p: 1, + maxHeight: 200, + overflowY: 'auto', + }} + > + {sticky === 'top' ? items : items.reverse()} + + ); +} diff --git a/docs/data/joy/components/tabs/TabsUnderlineExample.js b/docs/data/joy/components/tabs/TabsUnderlineExample.js deleted file mode 100644 index 87d45d8571a5d7..00000000000000 --- a/docs/data/joy/components/tabs/TabsUnderlineExample.js +++ /dev/null @@ -1,38 +0,0 @@ -import * as React from 'react'; -import Tabs from '@mui/joy/Tabs'; -import TabList from '@mui/joy/TabList'; -import Tab, { tabClasses } from '@mui/joy/Tab'; - -export default function TabsUnderlineExample() { - return ( - - - Feature - Specifications - Review - Support - - - ); -} diff --git a/docs/data/joy/components/tabs/TabsUnderlineExample.tsx b/docs/data/joy/components/tabs/TabsUnderlineExample.tsx deleted file mode 100644 index 87d45d8571a5d7..00000000000000 --- a/docs/data/joy/components/tabs/TabsUnderlineExample.tsx +++ /dev/null @@ -1,38 +0,0 @@ -import * as React from 'react'; -import Tabs from '@mui/joy/Tabs'; -import TabList from '@mui/joy/TabList'; -import Tab, { tabClasses } from '@mui/joy/Tab'; - -export default function TabsUnderlineExample() { - return ( - - - Feature - Specifications - Review - Support - - - ); -} diff --git a/docs/data/joy/components/tabs/TabsUnderlinePlacement.js b/docs/data/joy/components/tabs/TabsUnderlinePlacement.js new file mode 100644 index 00000000000000..af19233d001416 --- /dev/null +++ b/docs/data/joy/components/tabs/TabsUnderlinePlacement.js @@ -0,0 +1,44 @@ +import * as React from 'react'; +import Tabs from '@mui/joy/Tabs'; +import TabList from '@mui/joy/TabList'; +import Tab from '@mui/joy/Tab'; +import TabPanel from '@mui/joy/TabPanel'; + +export default function TabsUnderlinePlacement() { + const [placement, setPlacement] = React.useState('top'); + return ( + setPlacement(newValue)} + > + + + Top + + + Right + + + Bottom + + + Left + + + + underlinePlacement Top + + + underlinePlacement Bottom + + + underlinePlacement Left + + + underlinePlacement Right + + + ); +} diff --git a/docs/data/joy/components/tabs/TabsUnderlinePlacement.tsx b/docs/data/joy/components/tabs/TabsUnderlinePlacement.tsx new file mode 100644 index 00000000000000..4f80f1a27f089a --- /dev/null +++ b/docs/data/joy/components/tabs/TabsUnderlinePlacement.tsx @@ -0,0 +1,46 @@ +import * as React from 'react'; +import Tabs from '@mui/joy/Tabs'; +import TabList from '@mui/joy/TabList'; +import Tab from '@mui/joy/Tab'; +import TabPanel from '@mui/joy/TabPanel'; + +export default function TabsUnderlinePlacement() { + const [placement, setPlacement] = React.useState< + 'top' | 'bottom' | 'left' | 'right' + >('top'); + return ( + setPlacement(newValue as typeof placement)} + > + + + Top + + + Right + + + Bottom + + + Left + + + + underlinePlacement Top + + + underlinePlacement Bottom + + + underlinePlacement Left + + + underlinePlacement Right + + + ); +} diff --git a/docs/data/joy/components/tabs/TabsUsage.js b/docs/data/joy/components/tabs/TabsUsage.js index e3d13fcfbd4dd8..f70c53e0f79e08 100644 --- a/docs/data/joy/components/tabs/TabsUsage.js +++ b/docs/data/joy/components/tabs/TabsUsage.js @@ -3,6 +3,7 @@ import JoyUsageDemo from 'docs/src/modules/components/JoyUsageDemo'; import Tabs from '@mui/joy/Tabs'; import TabList from '@mui/joy/TabList'; import Tab from '@mui/joy/Tab'; +import TabPanel from '@mui/joy/TabPanel'; export default function TabsUsage() { const [index, setIndex] = React.useState(0); @@ -11,13 +12,15 @@ export default function TabsUsage() { componentName="Tabs" data={[ { + formLabel: 'Selected tab variant', propName: 'variant', knob: 'radio', - defaultValue: 'outlined', + defaultValue: 'plain', options: ['plain', 'outlined', 'soft', 'solid'], codeBlockDisplay: false, }, { + formLabel: 'Selected tab color', propName: 'color', knob: 'color', defaultValue: 'neutral', @@ -29,6 +32,33 @@ export default function TabsUsage() { options: ['sm', 'md', 'lg'], defaultValue: 'md', }, + { + propName: 'orientation', + knob: 'radio', + options: ['horizontal', 'vertical'], + defaultValue: 'horizontal', + }, + { + formLabel: 'Disable TabList underline', + propName: 'disableUnderline', + knob: 'switch', + defaultValue: false, + codeBlockDisplay: false, + }, + { + formLabel: 'Tab indicator inset', + propName: 'indicatorInset', + knob: 'switch', + defaultValue: false, + codeBlockDisplay: false, + }, + { + formLabel: 'Disable Tab indicator', + propName: 'disableIndicator', + knob: 'switch', + defaultValue: false, + codeBlockDisplay: false, + }, { propName: 'children', defaultValue: '$children', @@ -37,40 +67,67 @@ export default function TabsUsage() { getCodeBlock={(code, props) => code.replace( '$children', - ` - ... -
`, + ` + ...
+
+ ...`, ) } - renderDemo={({ size, ...props }) => ( - setIndex(value)} - sx={{ borderRadius: 'lg' }} - > - + renderDemo={({ + color, + variant, + disableUnderline, + indicatorInset, + disableIndicator, + ...props + }) => ( + setIndex(value)}> + Tab A Tab B Tab C + Content of Tab A + Content of Tab B + Content of Tab C )} /> diff --git a/docs/data/joy/components/tabs/TabsVariables.js b/docs/data/joy/components/tabs/TabsVariables.js index 841137a764b728..a0dea65bff441e 100644 --- a/docs/data/joy/components/tabs/TabsVariables.js +++ b/docs/data/joy/components/tabs/TabsVariables.js @@ -12,10 +12,22 @@ export default function ListVariables() { childrenAccepted data={[ { - var: '--Tabs-gap', - defaultValue: '4px', + var: '--Tabs-spacing', + defaultValue: '16px', helperText: "Controls TabList's gap and TabPanel's padding.", }, + { + var: '--Tab-indicatorThickness', + defaultValue: '2px', + }, + { + var: '--Tab-indicatorSize', + defaultValue: '0px', + }, + { + var: '--Tab-indicatorRadius', + defaultValue: '0px', + }, ]} renderDemo={(sx) => ( diff --git a/docs/data/joy/components/tabs/TabsVariants.js b/docs/data/joy/components/tabs/TabsVariants.js index 2ece9310e8b59e..a4c1f5fa620ca6 100644 --- a/docs/data/joy/components/tabs/TabsVariants.js +++ b/docs/data/joy/components/tabs/TabsVariants.js @@ -12,7 +12,6 @@ export default function TabsVariants() { aria-label="Plain tabs" value={index} onChange={(event, value) => setIndex(value)} - sx={{ borderRadius: 'lg' }} > First tab @@ -25,24 +24,23 @@ export default function TabsVariants() { aria-label="Outlined tabs" value={index} onChange={(event, value) => setIndex(value)} - sx={{ borderRadius: 'lg' }} > - + First tab Second tab Third tab @@ -53,7 +51,6 @@ export default function TabsVariants() { aria-label="Soft tabs" value={index} onChange={(event, value) => setIndex(value)} - sx={{ borderRadius: 'lg' }} > setIndex(value as number)} - sx={{ borderRadius: 'lg' }} > First tab @@ -25,24 +24,23 @@ export default function TabsVariants() { aria-label="Outlined tabs" value={index} onChange={(event, value) => setIndex(value as number)} - sx={{ borderRadius: 'lg' }} > - + First tab Second tab Third tab @@ -53,7 +51,6 @@ export default function TabsVariants() { aria-label="Soft tabs" value={index} onChange={(event, value) => setIndex(value as number)} - sx={{ borderRadius: 'lg' }} > First tab Second tab Third tab - + First tab panel - + Second tab panel - + Third tab panel diff --git a/docs/data/joy/components/tabs/TabsVertical.tsx b/docs/data/joy/components/tabs/TabsVertical.tsx index 89f5a645637703..fb67f5d87e023c 100644 --- a/docs/data/joy/components/tabs/TabsVertical.tsx +++ b/docs/data/joy/components/tabs/TabsVertical.tsx @@ -9,20 +9,20 @@ export default function TabsVertical() { First tab Second tab Third tab - + First tab panel - + Second tab panel - + Third tab panel diff --git a/docs/data/joy/components/tabs/tabs.md b/docs/data/joy/components/tabs/tabs.md index 7e7e2f2c5cb97d..a94331fdfa2af9 100644 --- a/docs/data/joy/components/tabs/tabs.md +++ b/docs/data/joy/components/tabs/tabs.md @@ -80,6 +80,44 @@ Keyboard navigation (e.g. arrow keys) will adapt automatically to the used orien {{"demo": "TabsVertical.js"}} +### Placement + +To change the placement, you should provide the value of `top`, `bottom`, `left` or `right`. + +This prop can be applied on the TabList component to change the `underlinePlacement` as in the example: + +{{"demo": "TabsUnderlinePlacement.js"}} + +Or, it can be applied on the Tab component to change the `indicatorPlacement`: + +{{"demo": "TabsIndicatorPlacement.js"}} + +The flex direction of the Tabs component will need to be changed based on each placement. + +{{"demo": "TabsFlexPlacement.js"}} + +### Sticky + +For long content, you can use the `sticky="top"` prop on the TabList component to keep the tabs visible while scrolling. + +To stick the TabList at the bottom, use `sticky="bottom"` and render the TabList at the end of the Tabs component. + +{{"demo": "TabsSticky.js"}} + +### Tab flex + +Use the `tabFlex` prop on the TabList component to make the Tab elements fill the available space as shown in the example below. + +The first demo, `tabFlex={1}`, the Tab elements will fill the available space equally. + +The second demo, `tabFlex="auto`, the Tab elements will fill the available space equally, but the width of each Tab element will be based on the content. + +{{"demo": "TabsFlex.js"}} + +:::success +The value of the `tabFlex` can be any valid [CSS flex](https://developer.mozilla.org/en-US/docs/Web/CSS/flex) value. +::: + ### Icon Since `TabList` uses the same style as the [`List`](/joy-ui/react-list/) component, you can use the icon directly as a child or use `ListItemDecorator` with a text. @@ -121,18 +159,32 @@ You can use those to customize the component on both the `sx` prop and the theme ## Common examples -### Underlined tabs +### Segmented controls + +To mimic the iOS segmented controls, add the border-radius to the `sx` prop of the TabList and set the selected Tab's background to `background.surface`. -{{"demo": "TabsUnderlineExample.js"}} +{{"demo": "TabsSegmentedControls.js"}} + +### Browser tabs + +In this example, the Tab's variant is set to `outlined` and the indicator is moved to the top via `indicatorPlacement="top"`. The borders of the Tab are set to `transparent` based on the selected state. + +{{"demo": "TabsBrowserExample.js"}} ### Pricing tabs +This example removes the background of the selected Tab by targeting `[aria-selected="true"]` on the `sx` prop. + {{"demo": "TabsPricingExample.js"}} ### With counter chips +To render tab items at the center of the TabList, use `justifyContent: 'center'` on the `sx` prop of the TabList and set `flex: initial` to each of the Tab to override the default `flex-grow`. + {{"demo": "TabsPageExample.js"}} ### Mobile bottom navigation +In this example, each Tab's is applied with one of the theme's color palette when it is selected. + {{"demo": "TabsBottomNavExample.js"}} diff --git a/docs/data/joy/components/textarea/TextareaDecorators.js b/docs/data/joy/components/textarea/TextareaDecorators.js index ff8b19d5c44614..551425456cb52f 100644 --- a/docs/data/joy/components/textarea/TextareaDecorators.js +++ b/docs/data/joy/components/textarea/TextareaDecorators.js @@ -28,7 +28,7 @@ export default function TextareaDecorators() {
} endDecorator={ - + {text.length} character(s) } diff --git a/docs/data/joy/components/textarea/TextareaDecorators.tsx b/docs/data/joy/components/textarea/TextareaDecorators.tsx index 8a8fb24b285d08..a7eda4084210a0 100644 --- a/docs/data/joy/components/textarea/TextareaDecorators.tsx +++ b/docs/data/joy/components/textarea/TextareaDecorators.tsx @@ -28,7 +28,7 @@ export default function TextareaDecorators() {
} endDecorator={ - + {text.length} character(s) } diff --git a/docs/data/joy/components/button-group/FigmaButtonGroup.js b/docs/data/joy/components/toggle-button-group/FigmaButtonGroup.js similarity index 61% rename from docs/data/joy/components/button-group/FigmaButtonGroup.js rename to docs/data/joy/components/toggle-button-group/FigmaButtonGroup.js index f567256020329a..aed19366770a08 100644 --- a/docs/data/joy/components/button-group/FigmaButtonGroup.js +++ b/docs/data/joy/components/toggle-button-group/FigmaButtonGroup.js @@ -1,6 +1,5 @@ import * as React from 'react'; - -import ButtonGroup from '@mui/joy/ButtonGroup'; +import ToggleButtonGroup from '@mui/joy/ToggleButtonGroup'; import IconButton from '@mui/joy/IconButton'; import FormatAlignLeftIcon from '@mui/icons-material/FormatAlignLeft'; import FormatAlignCenterIcon from '@mui/icons-material/FormatAlignCenter'; @@ -8,35 +7,37 @@ import FormatAlignRightIcon from '@mui/icons-material/FormatAlignRight'; import FormatAlignJustifyIcon from '@mui/icons-material/FormatAlignJustify'; export default function FigmaButtonGroup() { - const [index, setIndex] = React.useState(0); - const getVariant = (itemIndex) => (itemIndex === index ? 'soft' : 'plain'); + const [index, setIndex] = React.useState('0'); return ( - { + setIndex(newIndex); + }} aria-label="figma button group" sx={{ '--ButtonGroup-radius': '3px', '--ButtonGroup-separatorSize': '0px', '--ButtonGroup-connected': '0', - '--joy-palette-neutral-plainHoverBg': 'transparent', - '--joy-palette-neutral-plainActiveBg': 'transparent', '&:hover': { boxShadow: 'inset 0px 0px 0px 1px var(--joy-palette-neutral-softBg)', '--ButtonGroup-connected': '1', }, }} > - setIndex(0)}> + - setIndex(1)}> + - setIndex(2)}> + - setIndex(3)}> + - + ); } diff --git a/docs/data/joy/components/button-group/FigmaButtonGroup.tsx b/docs/data/joy/components/toggle-button-group/FigmaButtonGroup.tsx similarity index 59% rename from docs/data/joy/components/button-group/FigmaButtonGroup.tsx rename to docs/data/joy/components/toggle-button-group/FigmaButtonGroup.tsx index 3900e80070bb15..8bff958d1afd52 100644 --- a/docs/data/joy/components/button-group/FigmaButtonGroup.tsx +++ b/docs/data/joy/components/toggle-button-group/FigmaButtonGroup.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; -import { VariantProp } from '@mui/joy/styles'; -import ButtonGroup from '@mui/joy/ButtonGroup'; +import ToggleButtonGroup from '@mui/joy/ToggleButtonGroup'; import IconButton from '@mui/joy/IconButton'; import FormatAlignLeftIcon from '@mui/icons-material/FormatAlignLeft'; import FormatAlignCenterIcon from '@mui/icons-material/FormatAlignCenter'; @@ -8,36 +7,37 @@ import FormatAlignRightIcon from '@mui/icons-material/FormatAlignRight'; import FormatAlignJustifyIcon from '@mui/icons-material/FormatAlignJustify'; export default function FigmaButtonGroup() { - const [index, setIndex] = React.useState(0); - const getVariant = (itemIndex: number): VariantProp => - itemIndex === index ? 'soft' : 'plain'; + const [index, setIndex] = React.useState('0'); return ( - { + setIndex(newIndex); + }} aria-label="figma button group" sx={{ '--ButtonGroup-radius': '3px', '--ButtonGroup-separatorSize': '0px', '--ButtonGroup-connected': '0', - '--joy-palette-neutral-plainHoverBg': 'transparent', - '--joy-palette-neutral-plainActiveBg': 'transparent', '&:hover': { boxShadow: 'inset 0px 0px 0px 1px var(--joy-palette-neutral-softBg)', '--ButtonGroup-connected': '1', }, }} > - setIndex(0)}> + - setIndex(1)}> + - setIndex(2)}> + - setIndex(3)}> + - + ); } diff --git a/docs/data/joy/components/toggle-button-group/ToggleGroupToolbar.js b/docs/data/joy/components/toggle-button-group/ToggleGroupToolbar.js index c24147b7fa8a4f..85d32b4ba54b15 100644 --- a/docs/data/joy/components/toggle-button-group/ToggleGroupToolbar.js +++ b/docs/data/joy/components/toggle-button-group/ToggleGroupToolbar.js @@ -22,7 +22,7 @@ export default function ToggleGroupToolbar() { return ( @@ -56,7 +55,6 @@ export default function ToggleGroupToolbar() { setFormats(newFormats); }} aria-label="text formatting" - sx={{ borderRadius: 'xs' }} > @@ -93,7 +91,7 @@ export default function ToggleGroupToolbar() { } - sx={{ borderRadius: 'xs', pl: 1 }} + sx={{ pl: 1 }} > @@ -56,7 +55,6 @@ export default function ToggleGroupToolbar() { setFormats(newFormats); }} aria-label="text formatting" - sx={{ borderRadius: 'xs' }} > @@ -93,7 +91,7 @@ export default function ToggleGroupToolbar() { } - sx={{ borderRadius: 'xs', pl: 1 }} + sx={{ pl: 1 }} > ` can be an object or an array ## Common examples +### Figma-like toggle group + +Use the CSS variable `--ButtonGroup-connected` to control when border radius of the buttons in-between should be removed. + +To create a Figma-like button group where the buttons are connected when users hover on any of the buttons, set the `--ButtonGroup-connected` to `0` and change to `1` on hover. + +{{"demo": "FigmaButtonGroup.js"}} + ### Editor toolbar {{"demo": "ToggleGroupToolbar.js"}} diff --git a/docs/data/joy/components/tooltip/GitHubTooltip.js b/docs/data/joy/components/tooltip/GitHubTooltip.js index b05725e57e985a..93db9fa9be9145 100644 --- a/docs/data/joy/components/tooltip/GitHubTooltip.js +++ b/docs/data/joy/components/tooltip/GitHubTooltip.js @@ -51,7 +51,7 @@ export default function GitHubTooltip() { bug πŸ› - + package: system diff --git a/docs/data/joy/components/tooltip/GitHubTooltip.tsx b/docs/data/joy/components/tooltip/GitHubTooltip.tsx index b05725e57e985a..93db9fa9be9145 100644 --- a/docs/data/joy/components/tooltip/GitHubTooltip.tsx +++ b/docs/data/joy/components/tooltip/GitHubTooltip.tsx @@ -51,7 +51,7 @@ export default function GitHubTooltip() { bug πŸ› - + package: system diff --git a/docs/data/joy/components/tooltip/TooltipColors.js b/docs/data/joy/components/tooltip/TooltipColors.js index b00c58b6c3e7e8..f1308af17d6499 100644 --- a/docs/data/joy/components/tooltip/TooltipColors.js +++ b/docs/data/joy/components/tooltip/TooltipColors.js @@ -39,11 +39,6 @@ export default function TooltipColors() { Danger - - - - - diff --git a/docs/data/joy/customization/theme-colors/PaletteThemeViewer.js b/docs/data/joy/customization/theme-colors/PaletteThemeViewer.js index a4f377986e0c74..85d5ee93348c32 100644 --- a/docs/data/joy/customization/theme-colors/PaletteThemeViewer.js +++ b/docs/data/joy/customization/theme-colors/PaletteThemeViewer.js @@ -121,7 +121,7 @@ export default function PaletteThemeViewer() { zIndex: 1, }} > - }> + }> Copied @@ -203,7 +203,6 @@ export default function PaletteThemeViewer() { fontSize="xs" startDecorator={renderSwatch('light', token)} fontFamily="code" - letterSpacing="sm" textAlign="left" sx={{ alignItems: 'flex-start', cursor: 'copy' }} onClick={() => copy(light[token])} @@ -219,7 +218,6 @@ export default function PaletteThemeViewer() { fontSize="xs" startDecorator={renderSwatch('dark', token)} fontFamily="code" - letterSpacing="sm" textAlign="left" sx={{ alignItems: 'flex-start', cursor: 'copy' }} onClick={() => copy(dark[token])} diff --git a/docs/data/joy/customization/theme-colors/PaletteThemeViewer.tsx b/docs/data/joy/customization/theme-colors/PaletteThemeViewer.tsx index 41c21655936455..3ed93780fd4a41 100644 --- a/docs/data/joy/customization/theme-colors/PaletteThemeViewer.tsx +++ b/docs/data/joy/customization/theme-colors/PaletteThemeViewer.tsx @@ -120,7 +120,7 @@ export default function PaletteThemeViewer() { zIndex: 1, }} > - }> + }> Copied
@@ -202,7 +202,6 @@ export default function PaletteThemeViewer() { fontSize="xs" startDecorator={renderSwatch('light', token)} fontFamily="code" - letterSpacing="sm" textAlign="left" sx={{ alignItems: 'flex-start', cursor: 'copy' }} onClick={() => copy(light[token])} @@ -218,7 +217,6 @@ export default function PaletteThemeViewer() { fontSize="xs" startDecorator={renderSwatch('dark', token)} fontFamily="code" - letterSpacing="sm" textAlign="left" sx={{ alignItems: 'flex-start', cursor: 'copy' }} onClick={() => copy(dark[token])} diff --git a/docs/data/joy/customization/theme-shadow/ShadowThemeViewer.js b/docs/data/joy/customization/theme-shadow/ShadowThemeViewer.js index c8b02dea01246c..979230c710f208 100644 --- a/docs/data/joy/customization/theme-shadow/ShadowThemeViewer.js +++ b/docs/data/joy/customization/theme-shadow/ShadowThemeViewer.js @@ -76,7 +76,7 @@ export default function ShadowThemeViewer() { zIndex: 1, }} > - }> + }> Copied @@ -115,7 +115,6 @@ export default function ShadowThemeViewer() { textAlign="left" fontSize="xs" fontFamily="code" - letterSpacing="sm" onClick={() => copy(token)} > {formatShadowLayers(defaultTheme.shadow[token])} diff --git a/docs/data/joy/customization/theme-shadow/ShadowThemeViewer.tsx b/docs/data/joy/customization/theme-shadow/ShadowThemeViewer.tsx index 6a60bfa0d76ba5..62b85a8b72c4f9 100644 --- a/docs/data/joy/customization/theme-shadow/ShadowThemeViewer.tsx +++ b/docs/data/joy/customization/theme-shadow/ShadowThemeViewer.tsx @@ -76,7 +76,7 @@ export default function ShadowThemeViewer() { zIndex: 1, }} > - }> + }> Copied @@ -115,7 +115,6 @@ export default function ShadowThemeViewer() { textAlign="left" fontSize="xs" fontFamily="code" - letterSpacing="sm" onClick={() => copy(token)} > {formatShadowLayers(defaultTheme.shadow[token])} diff --git a/docs/data/joy/customization/theme-typography/CustomTypographyLevel.js b/docs/data/joy/customization/theme-typography/CustomTypographyLevel.js index 5306f1fd3c6433..f1ba6d0a0550b1 100644 --- a/docs/data/joy/customization/theme-typography/CustomTypographyLevel.js +++ b/docs/data/joy/customization/theme-typography/CustomTypographyLevel.js @@ -4,7 +4,7 @@ import Box from '@mui/joy/Box'; const customTheme = extendTheme({ typography: { - display1: { + h1: { // `--joy` is the default CSS variable prefix. // If you have a custom prefix, you have to use it instead. // For more details about the custom prefix, go to https://mui.com/joy-ui/customization/using-css-variables/#custom-prefix @@ -20,7 +20,7 @@ const customTheme = extendTheme({ export default function CustomTypographyLevel() { return ( - theme.typography.display1}>Gradient text + theme.typography.h1}>Gradient text ); } diff --git a/docs/data/joy/customization/theme-typography/CustomTypographyLevel.tsx b/docs/data/joy/customization/theme-typography/CustomTypographyLevel.tsx index 5306f1fd3c6433..f1ba6d0a0550b1 100644 --- a/docs/data/joy/customization/theme-typography/CustomTypographyLevel.tsx +++ b/docs/data/joy/customization/theme-typography/CustomTypographyLevel.tsx @@ -4,7 +4,7 @@ import Box from '@mui/joy/Box'; const customTheme = extendTheme({ typography: { - display1: { + h1: { // `--joy` is the default CSS variable prefix. // If you have a custom prefix, you have to use it instead. // For more details about the custom prefix, go to https://mui.com/joy-ui/customization/using-css-variables/#custom-prefix @@ -20,7 +20,7 @@ const customTheme = extendTheme({ export default function CustomTypographyLevel() { return ( - theme.typography.display1}>Gradient text + theme.typography.h1}>Gradient text ); } diff --git a/docs/data/joy/customization/theme-typography/CustomTypographyLevel.tsx.preview b/docs/data/joy/customization/theme-typography/CustomTypographyLevel.tsx.preview index 8efdd6c11eff6a..3c0983c203e2a0 100644 --- a/docs/data/joy/customization/theme-typography/CustomTypographyLevel.tsx.preview +++ b/docs/data/joy/customization/theme-typography/CustomTypographyLevel.tsx.preview @@ -1,3 +1,3 @@ - theme.typography.display1}>Gradient text + theme.typography.h1}>Gradient text \ No newline at end of file diff --git a/docs/data/joy/customization/theme-typography/NewTypographyLevel.js b/docs/data/joy/customization/theme-typography/NewTypographyLevel.js index 2accfe85a9ecab..d5f34378bd8c3b 100644 --- a/docs/data/joy/customization/theme-typography/NewTypographyLevel.js +++ b/docs/data/joy/customization/theme-typography/NewTypographyLevel.js @@ -6,10 +6,11 @@ import Typography from '@mui/joy/Typography'; const customTheme = extendTheme({ typography: { kbd: { - backgroundColor: 'var(--joy-palette-background-surface)', + background: + 'linear-gradient(to top, var(--joy-palette-background-level2), var(--joy-palette-background-surface))', border: '1px solid var(--joy-palette-neutral-outlinedBorder)', borderRadius: 'var(--joy-radius-xs)', - boxShadow: '0 2px 0px 0px var(--joy-palette-background-level3)', + boxShadow: 'var(--joy-shadow-sm)', padding: '0.125em 0.375em', }, }, diff --git a/docs/data/joy/customization/theme-typography/TypographyThemeViewer.js b/docs/data/joy/customization/theme-typography/TypographyThemeViewer.js index ee50a0b5e286a8..5476857f6aa878 100644 --- a/docs/data/joy/customization/theme-typography/TypographyThemeViewer.js +++ b/docs/data/joy/customization/theme-typography/TypographyThemeViewer.js @@ -90,11 +90,6 @@ export default function TypographyThemeViewer() { Line height -
@@ -146,7 +141,6 @@ export default function TypographyThemeViewer() { {defaultTheme.typography[level].color || '-'} @@ -170,14 +164,13 @@ export default function TypographyThemeViewer() { {defaultTheme.typography[level].fontSize || '-'} - {['fontWeight', 'lineHeight', 'letterSpacing'].map((field) => ( + {['fontWeight', 'lineHeight'].map((field) => ( @@ -147,7 +142,6 @@ export default function TypographyThemeViewer() { {defaultTheme.typography[level].color || '-'} @@ -171,42 +165,38 @@ export default function TypographyThemeViewer() { {defaultTheme.typography[level].fontSize || '-'} - {(['fontWeight', 'lineHeight', 'letterSpacing'] as const).map( - (field) => ( - - ), - )} + {defaultTheme.typography[level][field] || '-'} + + + + ))} ))} diff --git a/docs/data/joy/customization/theme-typography/theme-typography.md b/docs/data/joy/customization/theme-typography/theme-typography.md index f566c5ec3fa8e8..cf8a8aaa5f06f3 100644 --- a/docs/data/joy/customization/theme-typography/theme-typography.md +++ b/docs/data/joy/customization/theme-typography/theme-typography.md @@ -8,7 +8,7 @@ Joy UI includes a typography system within the theme to help you create consiste The default system consists of 13 built-in levels: -- `body1` - the baseline typography for the application, used as the default configuration in the [Typography](/joy-ui/react-typography/) and [CssBaseline](/joy-ui/react-css-baseline/) components. +- `body-md` - the baseline typography for the application, used as the default configuration in the [Typography](/joy-ui/react-typography/) and [CssBaseline](/joy-ui/react-css-baseline/) components. - `body2` through `body5` - can be used for secondary and tertiary information. - The `h1` to `h6` levels follow the semantic HTML headings. - The `display1` and `display2` usually appear as taglines for marketing and landing pages. @@ -40,10 +40,8 @@ Use `undefined` as a value to remove any unneeded levels: ```js const customTheme = extendTheme({ typography: { - h5: undefined, - h6: undefined, - body4: undefined, - body5: undefined, + 'title-sm': undefined, + 'title-xs': undefined, }, }); ``` @@ -54,10 +52,8 @@ For TypeScript, you must augment the theme structure to exclude the default leve // You can put this to any file that's included in your tsconfig declare module '@mui/joy/styles' { interface TypographySystemOverrides { - h5: false; - h6: false; - body4: false; - body5: false; + 'title-sm': false; + 'title-xs': false; } } ``` @@ -87,8 +83,8 @@ There are several ways that you can use the theme typography in your application - [Typography](/joy-ui/react-typography/) component: use the `level` prop to change between theme typography levels: ```jsx - // use the `theme.typography.body2` styles - Secondary info + // use the `theme.typography['body-sm']` styles + Secondary info ``` - [CSS Baseline](/joy-ui/react-css-baseline/) component: by default, it applies the `body1` level to the global stylesheet: @@ -96,15 +92,15 @@ There are several ways that you can use the theme typography in your application ```jsx - // inherits the `theme.typography.body1` styles + // inherits the `theme.typography['body-md']` styles

Hello World

``` - [`sx`](/joy-ui/customization/approaches/#sx-prop) prop: use `typography: $level` to get the specific theme typography level: ```jsx - // to apply the `theme.typography.body2` styles: - Small text + // to apply the `theme.typography['body-sm']` styles: + Small text ``` - [`styled`](/joy-ui/customization/approaches/#reusable-component): create a custom component and apply the style from `theme.typography.*` directly: @@ -113,7 +109,7 @@ There are several ways that you can use the theme typography in your application import { styled } from '@mui/joy/styles'; const Tag = styled('span')((theme) => ({ - ...theme.typography.body2, + ...theme.typography['body-sm'], color: 'inherit', borderRadius: theme.vars.radius.xs, boxShadow: theme.vars.shadow.sm, diff --git a/docs/data/joy/getting-started/installation/installation.md b/docs/data/joy/getting-started/installation/installation.md index 9bbd95c1e44877..b88b8f76572a7d 100644 --- a/docs/data/joy/getting-started/installation/installation.md +++ b/docs/data/joy/getting-started/installation/installation.md @@ -32,20 +32,19 @@ Please note that [react](https://www.npmjs.com/package/react) and [react-dom](ht }, ``` -## Public Sans font +## Inter font -Joy UI is designed to use the [Public Sans](https://fonts.google.com/specimen/Public+Sans) +Joy UI is designed to use the [Inter](https://fonts.google.com/specimen/Inter) font by default. You may add it to your project with npm via [Fontsource](https://fontsource.org/), or with the Google Fonts CDN. - ```bash npm -npm install @fontsource/public-sans +npm install @fontsource/inter ``` ```bash yarn -yarn add @fontsource/public-sans +yarn add @fontsource/inter ``` ```bash pnpm @@ -57,16 +56,18 @@ yarn add @fontsource/public-sans Then you can import it in your entry point like this: ```tsx -import '@fontsource/public-sans'; +import '@fontsource/inter'; ``` ### Google Web Fonts -To install the Public Sans font in your project using the Google Web Fonts CDN, add the following code snippet inside your project's `` tag: +To install the Inter font in your project using the Google Web Fonts CDN, add the following code snippet inside your project's `` tag: ```html + + ``` diff --git a/docs/data/joy/getting-started/templates/TemplateCollection.js b/docs/data/joy/getting-started/templates/TemplateCollection.js index 2e3b27cb5140f9..60966f7d820c29 100644 --- a/docs/data/joy/getting-started/templates/TemplateCollection.js +++ b/docs/data/joy/getting-started/templates/TemplateCollection.js @@ -263,7 +263,7 @@ export default function TemplateCollection() { }} > {author && ( - + Built by{' '} β€’ - + Designed by{' '} { if (mode === 'light') { setMode('dark'); @@ -55,7 +54,7 @@ function ColorSchemeToggle() { export default function EmailExample() { const [drawerOpen, setDrawerOpen] = React.useState(false); return ( - + {drawerOpen && ( setDrawerOpen(false)}> @@ -89,7 +88,7 @@ export default function EmailExample() { @@ -100,12 +99,13 @@ export default function EmailExample() { } endDecorator={ - - - / + + + ⌘ + k } @@ -115,21 +115,23 @@ export default function EmailExample() { xs: 'none', sm: 'flex', }, + boxShadow: 'sm', }} /> + @@ -140,8 +142,8 @@ export default function EmailExample() { control={ @@ -180,30 +182,17 @@ export default function EmailExample() { justifyContent: 'space-between', }} > - + Unread - + You've read all messages in your inbox. @@ -217,23 +206,10 @@ export default function EmailExample() { justifyContent: 'space-between', }} > - + Everything else - + diff --git a/docs/data/joy/getting-started/templates/email/components/EmailContent.tsx b/docs/data/joy/getting-started/templates/email/components/EmailContent.tsx index 32824c5aa5c430..8f2d8c62d6936c 100644 --- a/docs/data/joy/getting-started/templates/email/components/EmailContent.tsx +++ b/docs/data/joy/getting-started/templates/email/components/EmailContent.tsx @@ -43,10 +43,10 @@ export default function EmailContent() { sx={{ borderRadius: 'sm' }} /> - + Alex Jonnold - + 21 Oct 2022 @@ -54,13 +54,13 @@ export default function EmailContent() { - - + - + @@ -69,7 +69,7 @@ export default function EmailContent() { - + Details for our Yosemite Park hike From - {}}> + {}}> alex.jonnold@hike.com to - {}}> + {}}> steve@mail.com - + Hello, my friend!

@@ -133,7 +133,7 @@ export default function EmailContent() { See you soon, Alex Jonnold
- + Attachments - - + + videos-hike.zip - 100 MB + 100 MB diff --git a/docs/data/joy/getting-started/templates/email/components/Mails.tsx b/docs/data/joy/getting-started/templates/email/components/Mails.tsx index 5653e768f7e606..9647d9d190c65c 100644 --- a/docs/data/joy/getting-started/templates/email/components/Mails.tsx +++ b/docs/data/joy/getting-started/templates/email/components/Mails.tsx @@ -42,7 +42,7 @@ export default function EmailList() { @@ -61,14 +61,14 @@ export default function EmailList() { mb: 0.5, }} > - {item.name} - + {item.name} + {item.date} {item.title} - {item.body} + {item.body} diff --git a/docs/data/joy/getting-started/templates/email/components/Navigation.tsx b/docs/data/joy/getting-started/templates/email/components/Navigation.tsx index d32f3f0838cbbc..b0122d2d2cb575 100644 --- a/docs/data/joy/getting-started/templates/email/components/Navigation.tsx +++ b/docs/data/joy/getting-started/templates/email/components/Navigation.tsx @@ -22,12 +22,7 @@ export default function EmailNav() { Browse - + @@ -38,8 +33,8 @@ export default function EmailNav() { }} > - - + + Inbox @@ -47,7 +42,7 @@ export default function EmailNav() { - + Sent @@ -55,7 +50,7 @@ export default function EmailNav() { - + Draft @@ -63,7 +58,7 @@ export default function EmailNav() { - + Flagged @@ -71,7 +66,7 @@ export default function EmailNav() { - + Trash @@ -82,12 +77,7 @@ export default function EmailNav() { Tags - + @@ -137,7 +127,7 @@ export default function EmailNav() { width: '10px', height: '10px', borderRadius: '99px', - bgcolor: 'warning.200', + bgcolor: 'warning.300', }} /> diff --git a/docs/data/joy/getting-started/templates/email/theme.tsx b/docs/data/joy/getting-started/templates/email/theme.tsx deleted file mode 100644 index 02de5b0186517d..00000000000000 --- a/docs/data/joy/getting-started/templates/email/theme.tsx +++ /dev/null @@ -1,25 +0,0 @@ -import { extendTheme } from '@mui/joy/styles'; - -export default extendTheme({ - colorSchemes: { - light: { - palette: { - background: { - body: 'var(--joy-palette-neutral-50)', - }, - }, - }, - dark: { - palette: { - background: { - body: 'var(--joy-palette-common-black)', - surface: 'var(--joy-palette-neutral-900)', - }, - }, - }, - }, - fontFamily: { - // display: "'Inter', var(--joy-fontFamily-fallback)", - // body: "'Inter', var(--joy-fontFamily-fallback)", - }, -}); diff --git a/docs/data/joy/getting-started/templates/files/App.tsx b/docs/data/joy/getting-started/templates/files/App.tsx index 0505f1b19298e2..366cbb893f489e 100644 --- a/docs/data/joy/getting-started/templates/files/App.tsx +++ b/docs/data/joy/getting-started/templates/files/App.tsx @@ -15,6 +15,10 @@ import Input from '@mui/joy/Input'; import IconButton from '@mui/joy/IconButton'; import Divider from '@mui/joy/Divider'; import Sheet from '@mui/joy/Sheet'; +import Table from '@mui/joy/Table'; +import Tabs from '@mui/joy/Tabs'; +import TabList from '@mui/joy/TabList'; +import Tab from '@mui/joy/Tab'; import List from '@mui/joy/List'; import ListItem from '@mui/joy/ListItem'; import ListItemButton from '@mui/joy/ListItemButton'; @@ -33,7 +37,6 @@ import CloseIcon from '@mui/icons-material/Close'; import BookRoundedIcon from '@mui/icons-material/BookRounded'; // custom -import filesTheme from './theme'; import Menu from './components/Menu'; import Layout from './components/Layout'; import Navigation from './components/Navigation'; @@ -45,14 +48,14 @@ function ColorSchemeToggle() { setMounted(true); }, []); if (!mounted) { - return ; + return ; } return ( { if (mode === 'light') { setMode('dark'); @@ -69,7 +72,7 @@ function ColorSchemeToggle() { export default function FilesExample() { const [drawerOpen, setDrawerOpen] = React.useState(false); return ( - + {drawerOpen && ( setDrawerOpen(false)}> @@ -108,7 +111,7 @@ export default function FilesExample() { @@ -119,12 +122,13 @@ export default function FilesExample() { } endDecorator={ - - / + + ⌘ + k } @@ -134,21 +138,23 @@ export default function FilesExample() { xs: 'none', sm: 'flex', }, + boxShadow: 'sm', }} /> + @@ -159,8 +165,8 @@ export default function FilesExample() { control={ @@ -178,8 +184,8 @@ export default function FilesExample() { { label: 'Files', active: true, - href: '/joy-ui/getting-started/templates/files/', 'aria-current': 'page', + href: '/joy-ui/getting-started/templates/files/', }, ]} /> @@ -199,102 +205,107 @@ export default function FilesExample() { > *': { - p: 2, - '&:nth-child(n):not(:nth-last-child(-n+4))': { - borderBottom: '1px solid', - borderColor: 'divider', - }, - }, - }} + sx={{ borderRadius: 'sm', gridColumn: '1/-1' }} > - - Folder name - - - Date modified - - - Size - - - Users - - - } - sx={{ alignItems: 'flex-start' }} - > - Travel pictures - - 21 October 2011, 3PM - - 987.5MB - - - - - - - - - - } - sx={{ alignItems: 'flex-start' }} +
- - Letter spacing - -
diff --git a/docs/data/joy/customization/theme-typography/TypographyThemeViewer.tsx b/docs/data/joy/customization/theme-typography/TypographyThemeViewer.tsx index adecfe200def30..2f561fba32f8a0 100644 --- a/docs/data/joy/customization/theme-typography/TypographyThemeViewer.tsx +++ b/docs/data/joy/customization/theme-typography/TypographyThemeViewer.tsx @@ -91,11 +91,6 @@ export default function TypographyThemeViewer() { Line height - - - Letter spacing - -
- )[ - extractFromVar( - defaultTheme.typography[level][field] as string, - field, - ) - ] || '' - } - sx={{ pointerEvents: 'none' }} + {(['fontWeight', 'lineHeight'] as const).map((field) => ( + + )[ + extractFromVar( + defaultTheme.typography[level][field] as string, + field, + ) + ] || '' + } + sx={{ pointerEvents: 'none' }} + > + - - {defaultTheme.typography[level][field] || '-'} - - -
- Important documents - - 26 May 2010, 7PM - - 123.3KB - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + +
Folder nameDate modifiedSizeUsers
+ } + sx={{ alignItems: 'flex-start' }} + > + Travel pictures + + 21 October 2011, 3PM + + 987.5MB + + + + + + + + +
+ } + sx={{ alignItems: 'flex-start' }} + > + Important documents + + 26 May 2010, 7PM + + 123.3KB + + + + + + + + +
+ } sx={{ alignItems: 'flex-start' }} > Travel pictures - + 987.5MB @@ -369,7 +380,7 @@ export default function FilesExample() { /> - 21 October 2011, 3PM + 21 October 2011, 3PM @@ -386,13 +397,13 @@ export default function FilesExample() { }} > } sx={{ alignItems: 'flex-start' }} > Important documents - + 123.3KB @@ -429,7 +440,7 @@ export default function FilesExample() { /> - 26 May 2010, 7PM + 26 May 2010, 7PM @@ -465,7 +476,7 @@ export default function FilesExample() { photos-travel.zip - + Added 25 May 2011 @@ -475,6 +486,8 @@ export default function FilesExample() { theme.vars.radius.sm, boxShadow: 'none', @@ -501,16 +514,12 @@ export default function FilesExample() { }} > - torres-del-paine.png - + torres-del-paine.png + Added 5 Aug 2016 - + @@ -544,7 +553,7 @@ export default function FilesExample() { platform_ios.zip - + Added 26 May 2011 @@ -569,27 +578,16 @@ export default function FilesExample() { - - - - + + + + Details + + + Activity + + + - + Shared with @@ -629,38 +627,38 @@ export default function FilesExample() { '& > *:nth-child(odd)': { color: 'text.secondary' }, }} > - Type - + Type + Image - Size - + Size + 3,6 MB (3,258,385 bytes) - Storage used - + Storage used + 3,6 MB (3,258,385 bytes) - Location - + Location + Travel pictures - Owner - + Owner + Michael Scott - Modified - + Modified + 26 October 2016 - Created - + Created + 5 August 2016 diff --git a/docs/data/joy/getting-started/templates/files/components/Navigation.tsx b/docs/data/joy/getting-started/templates/files/components/Navigation.tsx index bfecd94035107f..2295a88ec3cb54 100644 --- a/docs/data/joy/getting-started/templates/files/components/Navigation.tsx +++ b/docs/data/joy/getting-started/templates/files/components/Navigation.tsx @@ -36,8 +36,8 @@ export default function Navigation() { }} > - - + + My files diff --git a/docs/data/joy/getting-started/templates/files/theme.tsx b/docs/data/joy/getting-started/templates/files/theme.tsx deleted file mode 100644 index 02de5b0186517d..00000000000000 --- a/docs/data/joy/getting-started/templates/files/theme.tsx +++ /dev/null @@ -1,25 +0,0 @@ -import { extendTheme } from '@mui/joy/styles'; - -export default extendTheme({ - colorSchemes: { - light: { - palette: { - background: { - body: 'var(--joy-palette-neutral-50)', - }, - }, - }, - dark: { - palette: { - background: { - body: 'var(--joy-palette-common-black)', - surface: 'var(--joy-palette-neutral-900)', - }, - }, - }, - }, - fontFamily: { - // display: "'Inter', var(--joy-fontFamily-fallback)", - // body: "'Inter', var(--joy-fontFamily-fallback)", - }, -}); diff --git a/docs/data/joy/getting-started/templates/framesx-web-blocks/blocks/HeroLeft01.tsx b/docs/data/joy/getting-started/templates/framesx-web-blocks/blocks/HeroLeft01.tsx index 8a4b02aaea2301..7d9c8539d0979c 100644 --- a/docs/data/joy/getting-started/templates/framesx-web-blocks/blocks/HeroLeft01.tsx +++ b/docs/data/joy/getting-started/templates/framesx-web-blocks/blocks/HeroLeft01.tsx @@ -31,7 +31,7 @@ export default function HeroLeft01() { - + The new version is out. - + This is where a notification message will appear.
Enter text into this container.
@@ -40,7 +40,7 @@ export default function HeroLeft07() {
+ ({ '[data-feather], .feather': { - color: 'var(--Icon-color)', + color: `var(--Icon-color, ${theme.vars.palette.text.icon})`, margin: 'var(--Icon-margin)', - fontSize: 'var(--Icon-fontSize, 20px)', + fontSize: `var(--Icon-fontSize, ${theme.vars.fontSize.xl})`, width: '1em', height: '1em', }, - }} + })} /> diff --git a/docs/data/joy/getting-started/templates/messages/components/ChatBubble.tsx b/docs/data/joy/getting-started/templates/messages/components/ChatBubble.tsx index e53b3cb44543be..53afcfbf33a804 100644 --- a/docs/data/joy/getting-started/templates/messages/components/ChatBubble.tsx +++ b/docs/data/joy/getting-started/templates/messages/components/ChatBubble.tsx @@ -32,10 +32,10 @@ export default function ChatBubble({ spacing={2} sx={{ mb: 0.25 }} > - + {sender === 'You' ? sender : sender.name} - {timestamp} + {timestamp} {attachment ? (
{attachment.fileName} - {attachment.size} + {attachment.size}
diff --git a/docs/data/joy/getting-started/templates/messages/components/ChatListItem.tsx b/docs/data/joy/getting-started/templates/messages/components/ChatListItem.tsx index 2a5afdbe8f2f2c..fd7ab359b1bdb3 100644 --- a/docs/data/joy/getting-started/templates/messages/components/ChatListItem.tsx +++ b/docs/data/joy/getting-started/templates/messages/components/ChatListItem.tsx @@ -36,7 +36,6 @@ export default function ChatListItem({ setSelectedChat({ id, sender, messages }); }} selected={selected} - variant={selected ? 'soft' : 'plain'} color="neutral" sx={{ flexDirection: 'column', @@ -51,10 +50,14 @@ export default function ChatListItem({ {sender.name} - {sender.username} + {sender.username}
- + 5 mins ago {messages[0].unread && ( @@ -63,7 +66,7 @@ export default function ChatListItem({ {sender.name} - {sender.username} + + {sender.username}
diff --git a/docs/data/joy/getting-started/templates/messages/components/MyMessages.tsx b/docs/data/joy/getting-started/templates/messages/components/MyMessages.tsx index 28d996bed53ed0..b984a8e4dbf7e5 100644 --- a/docs/data/joy/getting-started/templates/messages/components/MyMessages.tsx +++ b/docs/data/joy/getting-started/templates/messages/components/MyMessages.tsx @@ -10,7 +10,6 @@ export default function MyProfile() { return ( ({ - color: theme.vars.palette.text.tertiary, -})); - export default function Sidebar() { return ( Home - + @@ -116,7 +111,7 @@ export default function Sidebar() { Dashboard - + @@ -125,7 +120,7 @@ export default function Sidebar() { Projects - + @@ -134,7 +129,7 @@ export default function Sidebar() { Tasks - + @@ -143,7 +138,7 @@ export default function Sidebar() { Reporting - + @@ -156,7 +151,7 @@ export default function Sidebar() { - + View all @@ -203,7 +198,7 @@ export default function Sidebar() { Used space - + Your team has used 80% of your available space. Need more? @@ -223,7 +218,7 @@ export default function Sidebar() { Steve E. - @steveEberger + @steveEberger diff --git a/docs/data/joy/getting-started/templates/messages/theme.ts b/docs/data/joy/getting-started/templates/messages/theme.ts deleted file mode 100644 index c63a488573e1f3..00000000000000 --- a/docs/data/joy/getting-started/templates/messages/theme.ts +++ /dev/null @@ -1,66 +0,0 @@ -import { extendTheme } from '@mui/joy/styles'; - -export default extendTheme({ - colorSchemes: { - light: { - palette: { - background: { - body: 'var(--joy-palette-neutral-50)', - }, - }, - }, - dark: { - palette: { - neutral: { - outlinedBorder: 'var(--joy-palette-neutral-700)', - }, - }, - }, - }, - components: { - JoyAutocomplete: { - styleOverrides: { - root: { - boxShadow: 'var(--joy-shadow-xs)', - }, - }, - }, - JoyButton: { - styleOverrides: { - root: { - boxShadow: 'var(--joy-shadow-xs)', - }, - }, - }, - JoyInput: { - styleOverrides: { - root: { - boxShadow: 'var(--joy-shadow-xs)', - }, - }, - }, - JoyTextarea: { - styleOverrides: { - root: { - boxShadow: 'var(--joy-shadow-xs)', - }, - }, - }, - JoySelect: { - styleOverrides: { - root: { - boxShadow: 'var(--joy-shadow-xs)', - }, - }, - }, - JoyStack: { - defaultProps: { - useFlexGap: true, - }, - }, - }, - fontFamily: { - display: "'Inter', var(--joy-fontFamily-fallback)", - body: "'Inter', var(--joy-fontFamily-fallback)", - }, -}); diff --git a/docs/data/joy/getting-started/templates/order-dashboard/App.tsx b/docs/data/joy/getting-started/templates/order-dashboard/App.tsx index e5d92e90b20782..45afc87d7319fe 100644 --- a/docs/data/joy/getting-started/templates/order-dashboard/App.tsx +++ b/docs/data/joy/getting-started/templates/order-dashboard/App.tsx @@ -13,7 +13,6 @@ import SecondSidebar from './components/SecondSidebar'; import OrderTable from './components/OrderTable'; import Header from './components/Header'; import ColorSchemeToggle from './components/ColorSchemeToggle'; -import customTheme from './theme'; const useEnhancedEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect; @@ -31,17 +30,17 @@ export default function JoyOrderDashboardTemplate() { }, [status]); return ( - + ({ '[data-feather], .feather': { - color: 'var(--Icon-color)', + color: `var(--Icon-color, ${theme.vars.palette.text.icon})`, margin: 'var(--Icon-margin)', - fontSize: 'var(--Icon-fontSize, 20px)', + fontSize: `var(--Icon-fontSize, ${theme.vars.fontSize.xl})`, width: '1em', height: '1em', }, - }} + })} /> @@ -104,7 +103,7 @@ export default function JoyOrderDashboardTemplate() { > Dashboard - + Orders diff --git a/docs/data/joy/getting-started/templates/order-dashboard/components/FirstSidebar.tsx b/docs/data/joy/getting-started/templates/order-dashboard/components/FirstSidebar.tsx index a2c908a6e3c448..4b7564f2ef7d7d 100644 --- a/docs/data/joy/getting-started/templates/order-dashboard/components/FirstSidebar.tsx +++ b/docs/data/joy/getting-started/templates/order-dashboard/components/FirstSidebar.tsx @@ -13,8 +13,8 @@ export default function FirstSidebar() { return ( Status + Customer - @@ -211,7 +212,7 @@ export default function OrderTable() { }} > } sx={{ flexGrow: 1 }} @@ -261,7 +262,11 @@ export default function OrderTable() { > Search for order - } /> + } + /> {renderFilters()} @@ -287,6 +292,7 @@ export default function OrderTable() { '--Table-headerUnderlineThickness': '1px', '--TableRow-hoverBackground': (theme) => theme.vars.palette.background.level1, + '--TableCell-paddingY': '12px', }} > @@ -386,12 +392,15 @@ export default function OrderTable() {
{row.customer.name} - {row.customer.email} + + {row.customer.email} +
@@ -426,7 +435,7 @@ export default function OrderTable() { >
- + Page 1 of 10
- + @@ -131,10 +130,10 @@ export default function SecondSidebar() {
- + Olivia Ryhe - olivia@email.com + olivia@email.com
diff --git a/docs/data/joy/getting-started/templates/order-dashboard/theme.ts b/docs/data/joy/getting-started/templates/order-dashboard/theme.ts deleted file mode 100644 index 4742b97f2f8147..00000000000000 --- a/docs/data/joy/getting-started/templates/order-dashboard/theme.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { extendTheme } from '@mui/joy/styles'; - -export default extendTheme({ - fontFamily: { - display: "'Inter', var(--joy-fontFamily-fallback)", - body: "'Inter', var(--joy-fontFamily-fallback)", - }, -}); diff --git a/docs/data/joy/getting-started/templates/profile-dashboard/App.tsx b/docs/data/joy/getting-started/templates/profile-dashboard/App.tsx index 09f6735546a8ad..5fd4e480cf58c0 100644 --- a/docs/data/joy/getting-started/templates/profile-dashboard/App.tsx +++ b/docs/data/joy/getting-started/templates/profile-dashboard/App.tsx @@ -4,7 +4,6 @@ import GlobalStyles from '@mui/joy/GlobalStyles'; import CssBaseline from '@mui/joy/CssBaseline'; import Box from '@mui/joy/Box'; import useScript from './useScript'; -import customTheme from './theme'; import Sidebar from './components/Sidebar'; import Header from './components/Header'; import MyProfile from './components/MyProfile'; @@ -25,17 +24,17 @@ export default function JoyOrderDashboardTemplate() { }, [status]); return ( - + ({ '[data-feather], .feather': { - color: 'var(--Icon-color)', + color: `var(--Icon-color, ${theme.vars.palette.text.icon})`, margin: 'var(--Icon-margin)', - fontSize: 'var(--Icon-fontSize, 20px)', + fontSize: `var(--Icon-fontSize, ${theme.vars.fontSize.xl})`, width: '1em', height: '1em', }, - }} + })} /> diff --git a/docs/data/joy/getting-started/templates/profile-dashboard/components/DropZone.tsx b/docs/data/joy/getting-started/templates/profile-dashboard/components/DropZone.tsx index c9cd575dcb32b4..b08ee630ebe9c5 100644 --- a/docs/data/joy/getting-started/templates/profile-dashboard/components/DropZone.tsx +++ b/docs/data/joy/getting-started/templates/profile-dashboard/components/DropZone.tsx @@ -38,7 +38,7 @@ export default function DropZone({ sx, ...props }: CardProps) {
- + Click to upload {' '} diff --git a/docs/data/joy/getting-started/templates/profile-dashboard/components/FileUpload.tsx b/docs/data/joy/getting-started/templates/profile-dashboard/components/FileUpload.tsx index 46fdf696e3eeaa..7f50326288d249 100644 --- a/docs/data/joy/getting-started/templates/profile-dashboard/components/FileUpload.tsx +++ b/docs/data/joy/getting-started/templates/profile-dashboard/components/FileUpload.tsx @@ -50,7 +50,7 @@ export default function FileUpload({ {fileName} - {fileSize} + {fileSize} My profile - + ({ - '--List-padding': '0px', - '--ListItem-minHeight': 'var(--Tab-height)', '--Chip-minHeight': '20px', - '--_TabList-bg': theme.vars.palette.background.body, - backgroundColor: 'var(--_TabList-bg)', - boxShadow: `inset 0 -1px 0 0 ${theme.vars.palette.divider}`, - position: 'sticky', + '--ListItem-minHeight': '48px', top: 'calc(-1 * (var(--main-paddingTop, 0px) - var(--Header-height, 0px)))', zIndex: 10, width: '100%', overflow: 'auto hidden', alignSelf: 'flex-start', - borderRadius: 0, scrollSnapType: 'inline', '&::after': { pointerEvents: 'none', @@ -90,7 +76,7 @@ export default function MyProfile() { zIndex: 1, right: 0, borderBottom: '1px solid transparent', - background: `linear-gradient(to left, var(--_TabList-bg), rgb(0 0 0 / 0))`, + background: `linear-gradient(to left, ${theme.vars.palette.background.body}, rgb(0 0 0 / 0))`, backgroundClip: 'content-box', }, '&::-webkit-scrollbar': { @@ -98,51 +84,51 @@ export default function MyProfile() { display: 'none', }, [`& .${tabClasses.root}`]: { + '--focus-outline-offset': '-2px', '&:first-of-type': { ml: 'calc(-1 * var(--ListItem-paddingX))', }, scrollSnapAlign: 'start', bgcolor: 'transparent', - boxShadow: 'none', flex: 'none', '&:hover': { bgcolor: 'transparent', }, [`&.${tabClasses.selected}`]: { color: 'primary.plainColor', - '&:before': { - content: '""', - display: 'block', - position: 'absolute', - zIndex: 1, - bottom: 0, - left: 'var(--ListItem-paddingLeft)', - right: 'var(--ListItem-paddingRight)', - height: '2px', - bgcolor: 'primary.500', - }, + bgcolor: 'transparent', [`& .${chipClasses.root}`]: theme.variants.solid.primary, }, }, })} > - Account settings - + + Account settings + + Team{' '} 2 - Plan - + + Plan + + Billing{' '} 4 - Notifications - Integrations - API + + Notifications + + + Integrations + + + API + -
+ ); } diff --git a/docs/data/joy/getting-started/templates/profile-dashboard/components/Sidebar.tsx b/docs/data/joy/getting-started/templates/profile-dashboard/components/Sidebar.tsx index 6451c22b4e493c..faa78e1cb2bfbf 100644 --- a/docs/data/joy/getting-started/templates/profile-dashboard/components/Sidebar.tsx +++ b/docs/data/joy/getting-started/templates/profile-dashboard/components/Sidebar.tsx @@ -72,7 +72,7 @@ export default function Sidebar() { left: 0, width: '100vw', height: '100vh', - bgcolor: 'background.body', + opacity: 'calc(var(--SideNavigation-slideIn, 0) - 0.2)', transition: 'opacity 0.4s', transform: { @@ -159,7 +159,7 @@ export default function Sidebar() { - + My Profile @@ -206,7 +206,7 @@ export default function Sidebar() { Used space - + Your team has used 80% of your available space. Need more? @@ -227,7 +227,7 @@ export default function Sidebar() { Siriwat K. - siriwatk@test.com + siriwatk@test.com diff --git a/docs/data/joy/getting-started/templates/profile-dashboard/theme.ts b/docs/data/joy/getting-started/templates/profile-dashboard/theme.ts deleted file mode 100644 index d58b38d2e5f4fc..00000000000000 --- a/docs/data/joy/getting-started/templates/profile-dashboard/theme.ts +++ /dev/null @@ -1,61 +0,0 @@ -import { extendTheme } from '@mui/joy/styles'; - -export default extendTheme({ - colorSchemes: { - light: { - palette: { - background: { - body: 'var(--joy-palette-neutral-50)', - }, - }, - }, - dark: { - palette: { - neutral: { - outlinedBorder: 'var(--joy-palette-neutral-700)', - }, - }, - }, - }, - components: { - JoyAutocomplete: { - styleOverrides: { - root: { - boxShadow: 'var(--joy-shadow-xs)', - }, - }, - }, - JoyButton: { - styleOverrides: { - root: { - boxShadow: 'var(--joy-shadow-xs)', - }, - }, - }, - JoyInput: { - styleOverrides: { - root: { - boxShadow: 'var(--joy-shadow-xs)', - }, - }, - }, - JoyTextarea: { - styleOverrides: { - root: { - boxShadow: 'var(--joy-shadow-xs)', - }, - }, - }, - JoySelect: { - styleOverrides: { - root: { - boxShadow: 'var(--joy-shadow-xs)', - }, - }, - }, - }, - fontFamily: { - display: "'Inter', var(--joy-fontFamily-fallback)", - body: "'Inter', var(--joy-fontFamily-fallback)", - }, -}); diff --git a/docs/data/joy/getting-started/templates/rental-dashboard/App.tsx b/docs/data/joy/getting-started/templates/rental-dashboard/App.tsx index e1350e85e01e61..fa1a766df74c00 100644 --- a/docs/data/joy/getting-started/templates/rental-dashboard/App.tsx +++ b/docs/data/joy/getting-started/templates/rental-dashboard/App.tsx @@ -9,7 +9,6 @@ import Stack from '@mui/joy/Stack'; import useScript from './useScript'; import FirstSidebar from './components/FirstSidebar'; import Header from './components/Header'; -import customTheme from './theme'; import RentalCard from './components/RentalCard'; import Main from './components/Main'; import HeaderSection from './components/HeaderSection'; @@ -34,17 +33,17 @@ export default function RentalDashboard() { }, [status]); return ( - + ({ '[data-feather], .feather': { - color: 'var(--Icon-color)', + color: `var(--Icon-color, ${theme.vars.palette.text.icon})`, margin: 'var(--Icon-margin)', - fontSize: 'var(--Icon-fontSize, 20px)', + fontSize: `var(--Icon-fontSize, ${theme.vars.fontSize.xl})`, width: '1em', height: '1em', }, - }} + })} /> diff --git a/docs/data/joy/getting-started/templates/rental-dashboard/components/FirstSidebar.tsx b/docs/data/joy/getting-started/templates/rental-dashboard/components/FirstSidebar.tsx index 1e1a40a9189245..f36be022f12156 100644 --- a/docs/data/joy/getting-started/templates/rental-dashboard/components/FirstSidebar.tsx +++ b/docs/data/joy/getting-started/templates/rental-dashboard/components/FirstSidebar.tsx @@ -79,12 +79,7 @@ export default function FirstSidebar() { - openSidebar()} - > + openSidebar()}> diff --git a/docs/data/joy/getting-started/templates/rental-dashboard/components/HeaderSection.tsx b/docs/data/joy/getting-started/templates/rental-dashboard/components/HeaderSection.tsx index 73affc456eff10..dbec55f8481033 100644 --- a/docs/data/joy/getting-started/templates/rental-dashboard/components/HeaderSection.tsx +++ b/docs/data/joy/getting-started/templates/rental-dashboard/components/HeaderSection.tsx @@ -24,7 +24,7 @@ export default function HeaderSection() { > 232 stays in Melbourne - + Book your next stay at one of our properties.
diff --git a/docs/data/joy/getting-started/templates/rental-dashboard/components/Pagination.tsx b/docs/data/joy/getting-started/templates/rental-dashboard/components/Pagination.tsx index 9e1d436454d210..9671d994ce3f78 100644 --- a/docs/data/joy/getting-started/templates/rental-dashboard/components/Pagination.tsx +++ b/docs/data/joy/getting-started/templates/rental-dashboard/components/Pagination.tsx @@ -19,7 +19,7 @@ export default function Pagination() { >
- + Page 1 of 10 + Sign in to your account - + Welcome back
@@ -213,7 +208,7 @@ export default function JoySignInSideTemplate() { - + © Your company {new Date().getFullYear()} diff --git a/docs/data/joy/getting-started/templates/sign-in-side/theme.ts b/docs/data/joy/getting-started/templates/sign-in-side/theme.ts deleted file mode 100644 index 4742b97f2f8147..00000000000000 --- a/docs/data/joy/getting-started/templates/sign-in-side/theme.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { extendTheme } from '@mui/joy/styles'; - -export default extendTheme({ - fontFamily: { - display: "'Inter', var(--joy-fontFamily-fallback)", - body: "'Inter', var(--joy-fontFamily-fallback)", - }, -}); diff --git a/docs/data/joy/getting-started/templates/team/App.tsx b/docs/data/joy/getting-started/templates/team/App.tsx index d99be8351d3403..63c9b934569305 100644 --- a/docs/data/joy/getting-started/templates/team/App.tsx +++ b/docs/data/joy/getting-started/templates/team/App.tsx @@ -38,7 +38,6 @@ import GroupRoundedIcon from '@mui/icons-material/GroupRounded'; import BookRoundedIcon from '@mui/icons-material/BookRounded'; // custom -import teamTheme from './theme'; import Menu from './components/Menu'; import Layout from './components/Layout'; @@ -49,14 +48,14 @@ function ColorSchemeToggle() { setMounted(true); }, []); if (!mounted) { - return ; + return ; } return ( { if (mode === 'light') { setMode('dark'); @@ -92,8 +91,8 @@ function TeamNav() { }} > - - + + People @@ -115,7 +114,7 @@ function TeamNav() { Policies @@ -132,7 +131,7 @@ function TeamNav() { export default function TeamExample() { const [drawerOpen, setDrawerOpen] = React.useState(false); return ( - + {drawerOpen && ( setDrawerOpen(false)}> @@ -166,7 +165,7 @@ export default function TeamExample() { @@ -177,12 +176,13 @@ export default function TeamExample() { } endDecorator={ - - - / + + + ⌘ + k } @@ -192,21 +192,23 @@ export default function TeamExample() { xs: 'none', sm: 'flex', }, + boxShadow: 'sm', }} /> + @@ -217,8 +219,8 @@ export default function TeamExample() { control={ @@ -257,15 +259,7 @@ export default function TeamExample() { justifyContent: 'space-between', }} > - - Filter by - + Filter by @@ -278,8 +272,8 @@ export default function TeamExample() { justifyContent: 'space-between', }} > - - By keywords + + Keywords - + Location - + Education - + Previous experience Andrew Smith - UI Designer + UI Designer @@ -492,9 +486,9 @@ export default function TeamExample() { Senior designer - Dribbble + Dribbble - 2015-now + 2015-now @@ -506,9 +500,9 @@ export default function TeamExample() { Designer - Pinterest + Pinterest - 2012-2015 + 2012-2015
Email diff --git a/docs/data/joy/getting-started/tutorial/tutorial-pt.md b/docs/data/joy/getting-started/tutorial/tutorial-pt.md index b452fe10b4f283..a4d25e62055241 100644 --- a/docs/data/joy/getting-started/tutorial/tutorial-pt.md +++ b/docs/data/joy/getting-started/tutorial/tutorial-pt.md @@ -83,7 +83,7 @@ import Typography from '@mui/joy/Typography'; Welcome! - Sign in to continue + Sign in to continue
; ``` diff --git a/docs/data/joy/getting-started/tutorial/tutorial-zh.md b/docs/data/joy/getting-started/tutorial/tutorial-zh.md index b452fe10b4f283..a4d25e62055241 100644 --- a/docs/data/joy/getting-started/tutorial/tutorial-zh.md +++ b/docs/data/joy/getting-started/tutorial/tutorial-zh.md @@ -83,7 +83,7 @@ import Typography from '@mui/joy/Typography'; Welcome! - Sign in to continue + Sign in to continue
; ``` diff --git a/docs/data/joy/getting-started/tutorial/tutorial.md b/docs/data/joy/getting-started/tutorial/tutorial.md index 688ab35cd78dd4..1d862b7f0dc79f 100644 --- a/docs/data/joy/getting-started/tutorial/tutorial.md +++ b/docs/data/joy/getting-started/tutorial/tutorial.md @@ -108,7 +108,7 @@ Replace `Welcome!` inside your Sheet component with this `
`: Welcome! - Sign in to continue. + Sign in to continue.
``` diff --git a/docs/data/joy/getting-started/usage/usage.md b/docs/data/joy/getting-started/usage/usage.md index 6117e41391e36e..4b93c3908aa1f8 100644 --- a/docs/data/joy/getting-started/usage/usage.md +++ b/docs/data/joy/getting-started/usage/usage.md @@ -48,5 +48,5 @@ It fixes some inconsistencies across browsers and devices while providing resets ### Default font -Joy UI uses the Public Sans font by default. -See [Installationβ€”Public Sans font](/joy-ui/getting-started/installation/#public-sans-font) for complete details. +Joy UI uses the Inter font by default. +See [Installationβ€”Inter font](/joy-ui/getting-started/installation/#inter-font) for complete details. diff --git a/docs/data/joy/main-features/automatic-adjustment/ListThemes.js b/docs/data/joy/main-features/automatic-adjustment/ListThemes.js index f945649fc890b3..17ab64d8c7946c 100644 --- a/docs/data/joy/main-features/automatic-adjustment/ListThemes.js +++ b/docs/data/joy/main-features/automatic-adjustment/ListThemes.js @@ -24,13 +24,12 @@ export default function ButtonThemes() { '--ListItem-paddingLeft': '5px', '--ListItem-paddingRight': '5px', '--ListItem-paddingY': '0px', - '--ListItem-fontSize': '14px', '--List-nestedInsetStart': '28px', - '--ListItemDecorator-color': 'var(--joy-palette-primary-plainColor)', + fontSize: '14px', }, cozy: { '--List-radius': '20px', - '--ListItem-minHeight': '48px', + '--ListItem-minHeight': '44px', '--List-padding': '8px', '--List-gap': '8px', '--List-nestedInsetStart': 'var(--ListItemDecorator-size)', @@ -57,14 +56,7 @@ export default function ButtonThemes() { > - + diff --git a/docs/data/joy/main-features/color-inversion/ColorInversionFooter.js b/docs/data/joy/main-features/color-inversion/ColorInversionFooter.js index e655155cbac6e6..c9f599adb6a59e 100644 --- a/docs/data/joy/main-features/color-inversion/ColorInversionFooter.js +++ b/docs/data/joy/main-features/color-inversion/ColorInversionFooter.js @@ -41,14 +41,7 @@ export default function ColorInversionFooter() { variant="soft" size="sm" onClick={() => { - const colors = [ - 'primary', - 'neutral', - 'danger', - 'info', - 'success', - 'warning', - ]; + const colors = ['primary', 'neutral', 'danger', 'success', 'warning']; const nextColor = colors.indexOf(color); setColor(colors[nextColor + 1] ?? colors[0]); @@ -104,8 +97,8 @@ export default function ColorInversionFooter() { - Intro to the MUI ecosystem - + Intro to the MUI ecosystem + MUI blog diff --git a/docs/data/joy/main-features/color-inversion/ColorInversionFooter.tsx b/docs/data/joy/main-features/color-inversion/ColorInversionFooter.tsx index 19522780f8345e..933728dc1ce6a3 100644 --- a/docs/data/joy/main-features/color-inversion/ColorInversionFooter.tsx +++ b/docs/data/joy/main-features/color-inversion/ColorInversionFooter.tsx @@ -45,7 +45,6 @@ export default function ColorInversionFooter() { 'primary', 'neutral', 'danger', - 'info', 'success', 'warning', ]; @@ -103,8 +102,8 @@ export default function ColorInversionFooter() { - Intro to the MUI ecosystem - + Intro to the MUI ecosystem + MUI blog diff --git a/docs/data/joy/main-features/color-inversion/ColorInversionHeader.js b/docs/data/joy/main-features/color-inversion/ColorInversionHeader.js index 2ed564444a48e5..25d3cd590c5dca 100644 --- a/docs/data/joy/main-features/color-inversion/ColorInversionHeader.js +++ b/docs/data/joy/main-features/color-inversion/ColorInversionHeader.js @@ -43,14 +43,7 @@ export default function ColorInversionHeader() { variant="soft" size="sm" onClick={() => { - const colors = [ - 'primary', - 'neutral', - 'danger', - 'info', - 'success', - 'warning', - ]; + const colors = ['primary', 'neutral', 'danger', 'success', 'warning']; const nextColor = colors.indexOf(color); setColor(colors[nextColor + 1] ?? colors[0]); @@ -123,7 +116,7 @@ export default function ColorInversionHeader() { ⌘K diff --git a/docs/data/joy/main-features/color-inversion/ColorInversionHeader.tsx b/docs/data/joy/main-features/color-inversion/ColorInversionHeader.tsx index b433e1f42b2aee..acf66252151040 100644 --- a/docs/data/joy/main-features/color-inversion/ColorInversionHeader.tsx +++ b/docs/data/joy/main-features/color-inversion/ColorInversionHeader.tsx @@ -47,7 +47,6 @@ export default function ColorInversionHeader() { 'primary', 'neutral', 'danger', - 'info', 'success', 'warning', ]; @@ -122,7 +121,7 @@ export default function ColorInversionHeader() { ⌘K diff --git a/docs/data/joy/main-features/color-inversion/ColorInversionMarketing.js b/docs/data/joy/main-features/color-inversion/ColorInversionMarketing.js index 431725d023f214..580c0bb6f9b880 100644 --- a/docs/data/joy/main-features/color-inversion/ColorInversionMarketing.js +++ b/docs/data/joy/main-features/color-inversion/ColorInversionMarketing.js @@ -25,7 +25,7 @@ export default function ColorInversionMarketing() { bgcolor: color === 'primary' ? '#042449' : undefined, p: { xs: '36px', md: '70px' }, pt: { xs: '24px', md: '60px' }, - borderRadius: 'sm', + borderRadius: 'lg', overflow: 'hidden', '& button': { borderRadius: 'xl' }, }} @@ -71,14 +71,7 @@ export default function ColorInversionMarketing() { borderRadius: '50%', }} onClick={() => { - const colors = [ - 'primary', - 'neutral', - 'danger', - 'info', - 'success', - 'warning', - ]; + const colors = ['primary', 'neutral', 'danger', 'success', 'warning']; const nextColor = colors.indexOf(color); setColor(colors[nextColor + 1] ?? colors[0]); diff --git a/docs/data/joy/main-features/color-inversion/ColorInversionMarketing.tsx b/docs/data/joy/main-features/color-inversion/ColorInversionMarketing.tsx index acc91306b24964..0cef662c4f6f54 100644 --- a/docs/data/joy/main-features/color-inversion/ColorInversionMarketing.tsx +++ b/docs/data/joy/main-features/color-inversion/ColorInversionMarketing.tsx @@ -25,7 +25,7 @@ export default function ColorInversionMarketing() { bgcolor: color === 'primary' ? '#042449' : undefined, p: { xs: '36px', md: '70px' }, pt: { xs: '24px', md: '60px' }, - borderRadius: 'sm', + borderRadius: 'lg', overflow: 'hidden', '& button': { borderRadius: 'xl' }, }} @@ -75,7 +75,6 @@ export default function ColorInversionMarketing() { 'primary', 'neutral', 'danger', - 'info', 'success', 'warning', ]; diff --git a/docs/data/joy/main-features/color-inversion/ColorInversionMotivation.js b/docs/data/joy/main-features/color-inversion/ColorInversionMotivation.js index 54a68b4da1e6fc..822606a78376a9 100644 --- a/docs/data/joy/main-features/color-inversion/ColorInversionMotivation.js +++ b/docs/data/joy/main-features/color-inversion/ColorInversionMotivation.js @@ -10,7 +10,7 @@ import KeyboardArrowRightIcon from '@mui/icons-material/KeyboardArrowRight'; export default function ColorInversionMotivation() { const demo = ( - + - + Learn how to build super fast websites. - + Chip: - + Solid - + Soft - + Outlined - + Plain - + Checkbox: diff --git a/docs/data/joy/main-features/global-variants/LevelOfImportance.js b/docs/data/joy/main-features/global-variants/LevelOfImportance.js index e5578ab46e2b41..d6bdf2e5a48a5b 100644 --- a/docs/data/joy/main-features/global-variants/LevelOfImportance.js +++ b/docs/data/joy/main-features/global-variants/LevelOfImportance.js @@ -24,7 +24,7 @@ export default function LevelOfImportance() { @@ -57,7 +57,7 @@ export default function LevelOfImportance() { sx={{ borderRadius: 'md', overflow: 'auto', - borderColor: 'background.level2', + borderColor: 'var(--joy-palette-neutral-outlinedBorder)', bgcolor: 'background.level1', }} > @@ -69,7 +69,7 @@ export default function LevelOfImportance() { display: 'flex', p: 1.5, gap: 1.5, - '& > button': { bgcolor: 'background.body' }, + '& > button': { bgcolor: 'background.surface' }, }} > diff --git a/docs/data/joy/migration/PaletteChanges.js b/docs/data/joy/migration/PaletteChanges.js new file mode 100644 index 00000000000000..2eb60bfe5b138e --- /dev/null +++ b/docs/data/joy/migration/PaletteChanges.js @@ -0,0 +1,183 @@ +import * as React from 'react'; +import colors from '@mui/joy/colors'; +import Box from '@mui/joy/Box'; +import AspectRatio from '@mui/joy/AspectRatio'; +import List from '@mui/joy/List'; +import ListSubheader from '@mui/joy/ListSubheader'; +import ListItem from '@mui/joy/ListItem'; +import Typography from '@mui/joy/Typography'; +import Sheet from '@mui/joy/Sheet'; +import SvgIcon from '@mui/joy/SvgIcon'; + +const primary = { + 50: '#F4FAFF', + 100: '#DDF1FF', + 200: '#ADDBFF', + 300: '#6FB6FF', + 400: '#3990FF', + 500: '#096BDE', + 600: '#054DA7', + 700: '#02367D', + 800: '#072859', + 900: '#00153C', +}; + +const neutral = { + 50: '#F7F7F8', + 100: '#EBEBEF', + 200: '#D8D8DF', + 300: '#B9B9C6', + 400: '#8F8FA3', + 500: '#73738C', + 600: '#5A5A72', + 700: '#434356', + 800: '#25252D', + 900: '#131318', +}; + +const danger = { + 50: '#FFF8F6', + 100: '#FFE9E8', + 200: '#FFC7C5', + 300: '#FF9192', + 400: '#FA5255', + 500: '#D3232F', + 600: '#A10E25', + 700: '#77061B', + 800: '#580013', + 900: '#39000D', +}; + +const success = { + 50: '#F3FEF5', + 100: '#D7F5DD', + 200: '#77EC95', + 300: '#4CC76E', + 400: '#2CA24D', + 500: '#1A7D36', + 600: '#0F5D26', + 700: '#034318', + 800: '#002F0F', + 900: '#001D09', +}; + +const warning = { + 50: '#FFF8C5', + 100: '#FAE17D', + 200: '#EAC54F', + 300: '#D4A72C', + 400: '#BF8700', + 500: '#9A6700', + 600: '#7D4E00', + 700: '#633C01', + 800: '#4D2D00', + 900: '#3B2300', +}; + +const oldColors = { + primary, + neutral, + danger, + success, + warning, + common: { + white: '#FFF', + black: '#09090D', + }, +}; +const newColors = { + primary: colors.blue, + neutral: colors.grey, + danger: colors.red, + success: colors.green, + warning: colors.yellow, + common: { + white: '#FCFCFD', + black: '#09090B', + }, +}; + +export default function PaletteChanges() { + return ( + + {['primary', 'neutral', 'danger', 'success', 'warning', 'common'].map( + (color) => { + const oldColorRange = oldColors[color]; + const newColorRange = newColors[color]; + return ( + + + + {color} {color === 'common' ? '(white & black)' : '(50 - 900)'} + + {Object.keys(newColorRange).map((key) => { + return ( + + +
+ + {oldColorRange[key]} + + + + + + +
+ + {newColorRange[key]} + + ); + })} + + + ); + }, + )} + + ); +} diff --git a/docs/data/joy/migration/TitleBodyIconExample.js b/docs/data/joy/migration/TitleBodyIconExample.js new file mode 100644 index 00000000000000..0a790f3ad80bdd --- /dev/null +++ b/docs/data/joy/migration/TitleBodyIconExample.js @@ -0,0 +1,100 @@ +import * as React from 'react'; +import Box from '@mui/joy/Box'; +import Stack from '@mui/joy/Stack'; +import Typography from '@mui/joy/Typography'; +import SvgIcon from '@mui/joy/SvgIcon'; + +export default function TitleBodyIconExample() { + return ( + + + + + + + + +
+ + title-lg: Title of the component + + + body-md: This is the description of the component that contain + some information of it. + +
+
+ + + + + + + +
+ + title-md: Title of the component + + + body-md: This is the description of the component that contain + some information of it. + + + body-sm: Metadata, e.g. a date. + +
+
+ + + + + + + +
+ + title-sm: Title of the component + + + body-sm: This is the description of the component that contain + some information of it. + + + body-xs: Metadata, e.g. a date. + +
+
+
+
+ ); +} diff --git a/docs/data/joy/migration/TitleBodyIconExample.tsx b/docs/data/joy/migration/TitleBodyIconExample.tsx new file mode 100644 index 00000000000000..0a790f3ad80bdd --- /dev/null +++ b/docs/data/joy/migration/TitleBodyIconExample.tsx @@ -0,0 +1,100 @@ +import * as React from 'react'; +import Box from '@mui/joy/Box'; +import Stack from '@mui/joy/Stack'; +import Typography from '@mui/joy/Typography'; +import SvgIcon from '@mui/joy/SvgIcon'; + +export default function TitleBodyIconExample() { + return ( + + + + + + + + +
+ + title-lg: Title of the component + + + body-md: This is the description of the component that contain + some information of it. + +
+
+ + + + + + + +
+ + title-md: Title of the component + + + body-md: This is the description of the component that contain + some information of it. + + + body-sm: Metadata, e.g. a date. + +
+
+ + + + + + + +
+ + title-sm: Title of the component + + + body-sm: This is the description of the component that contain + some information of it. + + + body-xs: Metadata, e.g. a date. + +
+
+
+
+ ); +} diff --git a/docs/data/joy/migration/migrating-default-theme.md b/docs/data/joy/migration/migrating-default-theme.md new file mode 100644 index 00000000000000..ed402542ce262f --- /dev/null +++ b/docs/data/joy/migration/migrating-default-theme.md @@ -0,0 +1,1042 @@ +# Migrating to the new theme + +

This guide walks through recent Joy UI default theme upgrades and how to update to it.

+ +With the introduction of Joy UI's v5.0.0-beta.0, its default theme went under some significant restructuring and polish. +Several changes were made, including renaming, removing, and adding new tokens. +This guide walks through each and every one of them and provides instructions for a smooth migration process. + +## Color & Typography + +### Purple palette removed + +The purple palette has been removed as we updated the primary color. +In case you want to continue using it, copy the snippet below to your project: + +```js +const purple = { + 50: '#FDF7FF', + 100: '#F4EAFF', + 200: '#E1CBFF', + 300: '#C69EFF', + 400: '#A374F9', + 500: '#814DDE', + 600: '#5F35AE', + 700: '#452382', + 800: '#301761', + 900: '#1D0A42', +}; +``` + +### Info palette removed + +The info palette has been removed to simplify the color set. +We've realized that, in most cases, the neutral palette is used for info-related components and use cases. +Additionally, we noticed a strong overlap between `info` and `neutral`, which motivated further this change. + +```diff +- ++ +``` + +If you want to continue using it, add the palette directly to the theme object file: + +```js +import { extendTheme } from '@mui/joy/styles'; + +const info = { + 50: '#FDF7FF', + 100: '#F4EAFF', + 200: '#E1CBFF', + 300: '#C69EFF', + 400: '#A374F9', + 500: '#814DDE', + 600: '#5F35AE', + 700: '#452382', + 800: '#301761', + 900: '#1D0A42', +}; + +const theme = extendTheme({ + colorSchemes: { + light: { + palette: { + info: { + ...info, + plainColor: `var(--joy-palette-info-600)`, + plainHoverBg: `var(--joy-palette-info-100)`, + plainActiveBg: `var(--joy-palette-info-200)`, + plainDisabledColor: `var(--joy-palette-info-200)`, + outlinedColor: `var(--joy-palette-info-500)`, + outlinedBorder: `var(--joy-palette-info-200)`, + outlinedHoverBg: `var(--joy-palette-info-100)`, + outlinedHoverBorder: `var(--joy-palette-info-300)`, + outlinedActiveBg: `var(--joy-palette-info-200)`, + outlinedDisabledColor: `var(--joy-palette-info-100)`, + outlinedDisabledBorder: `var(--joy-palette-info-100)`, + softColor: `var(--joy-palette-info-600)`, + softBg: `var(--joy-palette-info-100)`, + softHoverBg: `var(--joy-palette-info-200)`, + softActiveBg: `var(--joy-palette-info-300)`, + softDisabledColor: `var(--joy-palette-info-300)`, + softDisabledBg: `var(--joy-paletteinfo}-50)`, + solidColor: '#fff', + solidBg: `var(--joy-palette-info-500)`, + solidHoverBg: `var(--joy-palette-info-600)`, + solidActiveBg: `var(--joy-palette-info-700)`, + solidDisabledColor: `#fff`, + solidDisabledBg: `var(--joy-palette-info-200)`, + }, + }, + }, + dark: { + palette: { + info: { + ...info, + plainColor: `var(--joy-palette-info-300)`, + plainHoverBg: `var(--joy-palette-info-800)`, + plainActiveBg: `var(--joy-palette-info-700)`, + plainDisabledColor: `var(--joy-palette-info-800)`, + outlinedColor: `var(--joy-palette-info-200)`, + outlinedBorder: `var(--joy-palette-info-700)`, + outlinedHoverBg: `var(--joy-palette-info-800)`, + outlinedHoverBorder: `var(--joy-palette-info-600)`, + outlinedActiveBg: `var(--joy-palette-info-900)`, + outlinedDisabledColor: `var(--joy-palette-info-800)`, + outlinedDisabledBorder: `var(--joy-palette-info-800)`, + softColor: `var(--joy-palette-info-200)`, + softBg: `var(--joy-palette-info-900)`, + softHoverBg: `var(--joy-palette-info-800)`, + softActiveBg: `var(--joy-palette-info-700)`, + softDisabledColor: `var(--joy-palette-info-800)`, + softDisabledBg: `var(--joy-palette-info-900)`, + solidColor: `#fff`, + solidBg: `var(--joy-palette-info-600)`, + solidHoverBg: `var(--joy-palette-info-700)`, + solidActiveBg: `var(--joy-palette-info-800)`, + solidDisabledColor: `var(--joy-palette-info-700)`, + solidDisabledBg: `var(--joy-palette-info-900)`, + }, + }, + }, + }, +}); +``` + +Then provide the `theme` to the `CssVarsProvider`: + +```js +import { CssVarsProvider, extendTheme } from '@mui/joy/styles'; + +const theme = extendTheme({ … }); + +function App() { + return …; +} +``` + +#### TypeScript + +If working with TypeScript, add the `info` palette to the theme's palette types via module augmentation: + +```ts +// You can put this to any file that's included in your tsconfig +import type { PaletteRange } from '@mui/joy/styles'; + +declare module '@mui/joy/styles' { + interface ColorPalettePropOverrides { + // apply to all Joy UI components that support `color` prop + info: true; + } + + interface Palette { + // this will make the node `info` configurable in `extendTheme` + // and add `info` to the theme's palette. + info: PaletteRange; + } +} +``` + +### Other palettes + +Each and every color of all palettes have been refined for better contrast ratios, vibrance, and personality. +Here's a before and after: + +{{"demo": "PaletteChanges.js"}} + +#### Keep the old colors + +To keep using the old colors, add them to your theme: + +
+Primary + +```js +const primary = { + 50: '#F4FAFF', + 100: '#DDF1FF', + 200: '#ADDBFF', + 300: '#6FB6FF', + 400: '#3990FF', + 500: '#096BDE', + 600: '#054DA7', + 700: '#02367D', + 800: '#072859', + 900: '#00153C', +}; + +extendTheme({ + colorSchemes: { + light: { + palette: { + primary: { + ...primary, + plainColor: `var(--joy-palette-primary-600)`, + plainHoverBg: `var(--joy-palette-primary-100)`, + plainActiveBg: `var(--joy-palette-primary-200)`, + plainDisabledColor: `var(--joy-palette-primary-200)`, + + outlinedColor: `var(--joy-palette-primary-500)`, + outlinedBorder: `var(--joy-palette-primary-200)`, + outlinedHoverBg: `var(--joy-palette-primary-100)`, + outlinedHoverBorder: `var(--joy-palette-primary-300)`, + outlinedActiveBg: `var(--joy-palette-primary-200)`, + outlinedDisabledColor: `var(--joy-palette-primary-100)`, + outlinedDisabledBorder: `var(--joy-palette-primary-100)`, + + softColor: `var(--joy-palette-primary-600)`, + softBg: `var(--joy-palette-primary-100)`, + softHoverBg: `var(--joy-palette-primary-200)`, + softActiveBg: `var(--joy-palette-primary-300)`, + softDisabledColor: `var(--joy-palette-primary-300)`, + softDisabledBg: `var(--joy-palette-primary}-)50`, + + solidColor: '#fff', + solidBg: `var(--joy-palette-primary-500)`, + solidHoverBg: `var(--joy-palette-primary-600)`, + solidActiveBg: `var(--joy-palette-primary-700)`, + solidDisabledColor: `#fff`, + solidDisabledBg: `var(--joy-palette-primary-200)`, + }, + }, + }, + dark: { + palette: { + primary: { + ...primary, + plainColor: `var(--joy-palette-primary-300)`, + plainHoverBg: `var(--joy-palette-primary-800)`, + plainActiveBg: `var(--joy-palette-primary-700)`, + plainDisabledColor: `var(--joy-palette-primary-800)`, + + outlinedColor: `var(--joy-palette-primary-200)`, + outlinedBorder: `var(--joy-palette-primary-700)`, + outlinedHoverBg: `var(--joy-palette-primary-800)`, + outlinedHoverBorder: `var(--joy-palette-primary-600)`, + outlinedActiveBg: `var(--joy-palette-primary-900)`, + outlinedDisabledColor: `var(--joy-palette-primary-800)`, + outlinedDisabledBorder: `var(--joy-palette-primary-800)`, + + softColor: `var(--joy-palette-primary-200)`, + softBg: `var(--joy-palette-primary-900)`, + softHoverBg: `var(--joy-palette-primary-800)`, + softActiveBg: `var(--joy-palette-primary-700)`, + softDisabledColor: `var(--joy-palette-primary-800)`, + softDisabledBg: `var(--joy-palette-primary-900)`, + + solidColor: `#fff`, + solidBg: `var(--joy-palette-primary-600)`, + solidHoverBg: `var(--joy-palette-primary-700)`, + solidActiveBg: `var(--joy-palette-primary-800)`, + solidDisabledColor: `var(--joy-palette-primary-700)`, + solidDisabledBg: `var(--joy-palette-primary-900)`, + }, + }, + }, + }, +}); +``` + +
+ +
+Neutral + +```js +const neutral = { + 50: '#F7F7F8', + 100: '#EBEBEF', + 200: '#D8D8DF', + 300: '#B9B9C6', + 400: '#8F8FA3', + 500: '#73738C', + 600: '#5A5A72', + 700: '#434356', + 800: '#25252D', + 900: '#131318', +}; + +extendTheme({ + colorSchemes: { + light: { + palette: { + neutral: { + ...neutral, + plainColor: `var(--joy-palette-neutral-800)`, + plainHoverColor: `var(--joy-palette-neutral-900)`, + plainHoverBg: `var(--joy-palette-neutral-100)`, + plainActiveBg: `var(--joy-palette-neutral-200)`, + plainDisabledColor: `var(--joy-palette-neutral-300)`, + + outlinedColor: `var(--joy-palette-neutral-800)`, + outlinedBorder: `var(--joy-palette-neutral-200)`, + outlinedHoverColor: `var(--joy-palette-neutral-900)`, + outlinedHoverBg: `var(--joy-palette-neutral-100)`, + outlinedHoverBorder: `var(--joy-palette-neutral-300)`, + outlinedActiveBg: `var(--joy-palette-neutral-200)`, + outlinedDisabledColor: `var(--joy-palette-neutral-300)`, + outlinedDisabledBorder: `var(--joy-palette-neutral-100)`, + + softColor: `var(--joy-palette-neutral-800)`, + softBg: `var(--joy-palette-neutral-100)`, + softHoverColor: `var(--joy-palette-neutral-900)`, + softHoverBg: `var(--joy-palette-neutral-200)`, + softActiveBg: `var(--joy-palette-neutral-300)`, + softDisabledColor: `var(--joy-palette-neutral-300)`, + softDisabledBg: `var(--joy-palette-neutral-50)`, + solidColor: `var(--joy-palette-common-white)`, + solidBg: `var(--joy-palette-neutral-600)`, + solidHoverBg: `var(--joy-palette-neutral-700)`, + solidActiveBg: `var(--joy-palette-neutral-800)`, + solidDisabledColor: `var(--joy-palette-neutral-300)`, + solidDisabledBg: `var(--joy-palette-neutral-50)`, + }, + common: { + white: '#FFF', + black: '#09090D', + }, + text: { + secondary: 'var(--joy-palette-neutral-600)', + tertiary: 'var(--joy-palette-neutral-500)', + }, + background: { + body: 'var(--joy-palette-common-white)', + tooltip: 'var(--joy-palette-neutral-800)', + backdrop: 'rgba(255 255 255 / 0.5)', + }, + }, + }, + dark: { + palette: { + neutral: { + ...neutral, + plainColor: `var(--joy-palette-neutral-200)`, + plainHoverColor: `var(--joy-palette-neutral-50)`, + plainHoverBg: `var(--joy-palette-neutral-800)`, + plainActiveBg: `var(--joy-palette-neutral-700)`, + plainDisabledColor: `var(--joy-palette-neutral-700)`, + + outlinedColor: `var(--joy-palette-neutral-200)`, + outlinedBorder: `var(--joy-palette-neutral-800)`, + outlinedHoverColor: `var(--joy-palette-neutral-50)`, + outlinedHoverBg: `var(--joy-palette-neutral-800)`, + outlinedHoverBorder: `var(--joy-palette-neutral-700)`, + outlinedActiveBg: `var(--joy-palette-neutral-800)`, + outlinedDisabledColor: `var(--joy-palette-neutral-800)`, + outlinedDisabledBorder: `var(--joy-palette-neutral-800)`, + + softColor: `var(--joy-palette-neutral-200)`, + softBg: `var(--joy-palette-neutral-800)`, + softHoverColor: `var(--joy-palette-neutral-50)`, + softHoverBg: `var(--joy-palette-neutral-700)`, + softActiveBg: `var(--joy-palette-neutral-600)`, + softDisabledColor: `var(--joy-palette-neutral-700)`, + softDisabledBg: `var(--joy-palette-neutral-900)`, + + solidColor: `var(--joy-palette-common-white)`, + solidBg: `var(--joy-palette-neutral-600)`, + solidHoverBg: `var(--joy-palette-neutral-700)`, + solidActiveBg: `var(--joy-palette-neutral-800)`, + solidDisabledColor: `var(--joy-palette-neutral-700)`, + solidDisabledBg: `var(--joy-palette-neutral-900)`, + }, + common: { + white: '#FFF', + black: '#09090D', + }, + background: { + body: 'var(--joy-palette-neutral-900)', + surface: 'var(--joy-palette-common-black)', + popup: 'var(--joy-palette-neutral-900)', + level1: 'var(--joy-palette-neutral-800)', + level2: 'var(--joy-palette-neutral-700)', + level3: 'var(--joy-palette-neutral-600)', + }, + }, + }, + }, +}); +``` + +
+ +
+Danger + +```js +const danger = { + 50: '#FFF8F6', + 100: '#FFE9E8', + 200: '#FFC7C5', + 300: '#FF9192', + 400: '#FA5255', + 500: '#D3232F', + 600: '#A10E25', + 700: '#77061B', + 800: '#580013', + 900: '#39000D', +}; + +extendTheme({ + colorSchemes: { + light: { + palette: { + danger: { + ...danger, + plainColor: `var(--joy-palette-danger-600)`, + plainHoverBg: `var(--joy-palette-danger-100)`, + plainActiveBg: `var(--joy-palette-danger-200)`, + plainDisabledColor: `var(--joy-palette-danger-200)`, + + outlinedColor: `var(--joy-palette-danger-500)`, + outlinedBorder: `var(--joy-palette-danger-200)`, + outlinedHoverBg: `var(--joy-palette-danger-100)`, + outlinedHoverBorder: `var(--joy-palette-danger-300)`, + outlinedActiveBg: `var(--joy-palette-danger-200)`, + outlinedDisabledColor: `var(--joy-palette-danger-100)`, + outlinedDisabledBorder: `var(--joy-palette-danger-100)`, + + softColor: `var(--joy-palette-danger-600)`, + softBg: `var(--joy-palette-danger-100)`, + softHoverBg: `var(--joy-palette-danger-200)`, + softActiveBg: `var(--joy-palette-danger-300)`, + softDisabledColor: `var(--joy-palette-danger-300)`, + softDisabledBg: `var(--joy-palette-danger}-)50`, + + solidColor: '#fff', + solidBg: `var(--joy-palette-danger-500)`, + solidHoverBg: `var(--joy-palette-danger-600)`, + solidActiveBg: `var(--joy-palette-danger-700)`, + solidDisabledColor: `#fff`, + solidDisabledBg: `var(--joy-palette-danger-200)`, + }, + }, + }, + dark: { + palette: { + danger: { + ...danger, + plainColor: `var(--joy-palette-danger-300)`, + plainHoverBg: `var(--joy-palette-danger-800)`, + plainActiveBg: `var(--joy-palette-danger-700)`, + plainDisabledColor: `var(--joy-palette-danger-800)`, + + outlinedColor: `var(--joy-palette-danger-200)`, + outlinedBorder: `var(--joy-palette-danger-700)`, + outlinedHoverBg: `var(--joy-palette-danger-800)`, + outlinedHoverBorder: `var(--joy-palette-danger-600)`, + outlinedActiveBg: `var(--joy-palette-danger-900)`, + outlinedDisabledColor: `var(--joy-palette-danger-800)`, + outlinedDisabledBorder: `var(--joy-palette-danger-800)`, + + softColor: `var(--joy-palette-danger-200)`, + softBg: `var(--joy-palette-danger-900)`, + softHoverBg: `var(--joy-palette-danger-800)`, + softActiveBg: `var(--joy-palette-danger-700)`, + softDisabledColor: `var(--joy-palette-danger-800)`, + softDisabledBg: `var(--joy-palette-danger-900)`, + + solidColor: `#fff`, + solidBg: `var(--joy-palette-danger-600)`, + solidHoverBg: `var(--joy-palette-danger-700)`, + solidActiveBg: `var(--joy-palette-danger-800)`, + solidDisabledColor: `var(--joy-palette-danger-700)`, + solidDisabledBg: `var(--joy-palette-danger-900)`, + }, + }, + }, + }, +}); +``` + +
+ +
+Success + +```js +const success = { + 50: '#F3FEF5', + 100: '#D7F5DD', + 200: '#77EC95', + 300: '#4CC76E', + 400: '#2CA24D', + 500: '#1A7D36', + 600: '#0F5D26', + 700: '#034318', + 800: '#002F0F', + 900: '#001D09', +}; + +extendTheme({ + colorSchemes: { + light: { + palette: { + success: { + ...success, + plainColor: `var(--joy-palette-success-600)`, + plainHoverBg: `var(--joy-palette-success-100)`, + plainActiveBg: `var(--joy-palette-success-200)`, + plainDisabledColor: `var(--joy-palette-success-200)`, + + outlinedColor: `var(--joy-palette-success-500)`, + outlinedBorder: `var(--joy-palette-success-200)`, + outlinedHoverBg: `var(--joy-palette-success-100)`, + outlinedHoverBorder: `var(--joy-palette-success-300)`, + outlinedActiveBg: `var(--joy-palette-success-200)`, + outlinedDisabledColor: `var(--joy-palette-success-100)`, + outlinedDisabledBorder: `var(--joy-palette-success-100)`, + + softColor: `var(--joy-palette-success-600)`, + softBg: `var(--joy-palette-success-100)`, + softHoverBg: `var(--joy-palette-success-200)`, + softActiveBg: `var(--joy-palette-success-300)`, + softDisabledColor: `var(--joy-palette-success-300)`, + softDisabledBg: `var(--joy-palette-success}-)50`, + + solidColor: '#fff', + solidBg: `var(--joy-palette-success-500)`, + solidHoverBg: `var(--joy-palette-success-600)`, + solidActiveBg: `var(--joy-palette-success-700)`, + solidDisabledColor: `#fff`, + solidDisabledBg: `var(--joy-palette-success-200)`, + }, + }, + }, + dark: { + palette: { + success: { + ...success, + plainColor: `var(--joy-palette-success-300)`, + plainHoverBg: `var(--joy-palette-success-800)`, + plainActiveBg: `var(--joy-palette-success-700)`, + plainDisabledColor: `var(--joy-palette-success-800)`, + + outlinedColor: `var(--joy-palette-success-200)`, + outlinedBorder: `var(--joy-palette-success-700)`, + outlinedHoverBg: `var(--joy-palette-success-800)`, + outlinedHoverBorder: `var(--joy-palette-success-600)`, + outlinedActiveBg: `var(--joy-palette-success-900)`, + outlinedDisabledColor: `var(--joy-palette-success-800)`, + outlinedDisabledBorder: `var(--joy-palette-success-800)`, + + softColor: `var(--joy-palette-success-200)`, + softBg: `var(--joy-palette-success-900)`, + softHoverBg: `var(--joy-palette-success-800)`, + softActiveBg: `var(--joy-palette-success-700)`, + softDisabledColor: `var(--joy-palette-success-800)`, + softDisabledBg: `var(--joy-palette-success-900)`, + + solidColor: '#fff', + solidBg: `var(--joy-palette-success-600)`, + solidHoverBg: `var(--joy-palette-success-700)`, + solidActiveBg: `var(--joy-palette-success-800)`, + solidDisabledColor: `var(--joy-palette-success-700)`, + solidDisabledBg: `var(--joy-palette-success-900)`, + }, + }, + }, + }, +}); +``` + +
+ +
+Warning + +```js +const warning = { + 50: '#FFF8C5', + 100: '#FAE17D', + 200: '#EAC54F', + 300: '#D4A72C', + 400: '#BF8700', + 500: '#9A6700', + 600: '#7D4E00', + 700: '#633C01', + 800: '#4D2D00', + 900: '#3B2300', +}; + +extendTheme({ + colorSchemes: { + light: { + palette: { + warning: { + ...warning, + plainColor: `var(--joy-palette-warning-800)`, + plainHoverBg: `var(--joy-palette-warning-50)`, + plainActiveBg: `var(--joy-palette-warning-200)`, + plainDisabledColor: `var(--joy-palette-warning-200)`, + + outlinedColor: `var(--joy-palette-warning-800)`, + outlinedBorder: `var(--joy-palette-warning-200)`, + outlinedHoverBg: `var(--joy-palette-warning-50)`, + outlinedHoverBorder: `var(--joy-palette-warning-300)`, + outlinedActiveBg: `var(--joy-palette-warning-200)`, + outlinedDisabledColor: `var(--joy-palette-warning-100)`, + outlinedDisabledBorder: `var(--joy-palette-warning-100)`, + + softColor: `var(--joy-palette-warning-800)`, + softBg: `var(--joy-palette-warning-50)`, + softHoverBg: `var(--joy-palette-warning-100)`, + softActiveBg: `var(--joy-palette-warning-200)`, + softDisabledColor: `var(--joy-palette-warning-200)`, + softDisabledBg: `var(--joy-palette-warning-50)`, + + solidColor: `var(--joy-palette-warning-800)`, + solidBg: `var(--joy-palette-warning-200)`, + solidHoverBg: `var(--joy-palette-warning-300)`, + solidActiveBg: `var(--joy-palette-warning-400)`, + solidDisabledColor: `var(--joy-palette-warning-200)`, + solidDisabledBg: `var(--joy-palette-warning-50)`, + }, + }, + }, + dark: { + palette: { + warning: { + ...warning, + plainColor: `var(--joy-palette-warning-300)`, + plainHoverBg: `var(--joy-palette-warning-800)`, + plainActiveBg: `var(--joy-palette-warning-700)`, + plainDisabledColor: `var(--joy-palette-warning-800)`, + + outlinedColor: `var(--joy-palette-warning-200)`, + outlinedBorder: `var(--joy-palette-warning-700)`, + outlinedHoverBg: `var(--joy-palette-warning-800)`, + outlinedHoverBorder: `var(--joy-palette-warning-600)`, + outlinedActiveBg: `var(--joy-palette-warning-900)`, + outlinedDisabledColor: `var(--joy-palette-warning-800)`, + outlinedDisabledBorder: `var(--joy-palette-warning-800)`, + + softColor: `var(--joy-palette-warning-200)`, + softBg: `var(--joy-palette-warning-900)`, + softHoverBg: `var(--joy-palette-warning-800)`, + softActiveBg: `var(--joy-palette-warning-700)`, + softDisabledColor: `var(--joy-palette-warning-800)`, + softDisabledBg: `var(--joy-palette-warning-900)`, + + solidColor: `var(--joy-palette-common-black)`, + solidBg: `var(--joy-palette-warning-300)`, + solidHoverBg: `var(--joy-palette-warning-400)`, + solidActiveBg: `var(--joy-palette-warning-500)`, + solidDisabledColor: `var(--joy-palette-warning-700)`, + solidDisabledBg: `var(--joy-palette-warning-900)`, + }, + }, + }, + }, +}); +``` + +
+ +### Font family + +The default theme typeface has been changed to [`Inter`](https://fonts.google.com/specimen/Inter?query=inter). +Follow the [installation guide](/joy-ui/getting-started/installation/#inter-font) to install it. + +To keep the old font family, add the following to your theme: + +```js +extendTheme({ + fontFamily: { + display: '"Public Sans", var(--joy-fontFamily-fallback)', + body: '"Public Sans", var(--joy-fontFamily-fallback)', + }, +}); +``` + +### Font size + +The font size scale has been reduced to: + +```diff + { +- xl7: '4.5rem', +- xl6: '3.75rem', +- xl5: '3rem', + xl4: '2.25rem', + xl3: '1.875rem', + xl2: '1.5rem', + xl: '1.25rem', + lg: '1.125rem', + md: '1rem', + sm: '0.875rem', + xs: '0.75rem', +- xs2: '0.625rem', +- xs3: '0.5rem', + } +``` + +To keep the old font size scale, add the following to your theme: + +```js +extendTheme({ + fontSize: { + xl7: '4.5rem', + xl6: '3.75rem', + xl5: '3rem', + xs2: '0.625rem', + xs3: '0.5rem', + }, +}); +``` + +#### TypeScript + +If working with TypeScript, add the old font size scale to the theme's type via module augmentation: + +```ts +// You can put this to any file that's included in your tsconfig +declare module '@mui/joy/styles' { + interface FontSizeOverrides { + xl7: true; + xl6: true; + xl5: true; + xs2: true; + xs3: true; + } +} +``` + +### Font weight + +The font weight scale has been reduced to: + +```diff + { +- xs: 200, + sm: 300, + md: 500, + lg: 600, + xl: 700, +- xl2: 800, +- xl3: 900, + } +``` + +To keep the old font weight scale, add the following to your theme: + +```js +extendTheme({ + fontWeight: { + xs: 200, + xl2: 800, + xl3: 900, + }, +}); +``` + +#### TypeScript + +If working with TypeScript, add the old font weight scale to the theme's type via module augmentation: + +```ts +// You can put this to any file that's included in your tsconfig +declare module '@mui/joy/styles' { + interface FontWeightOverrides { + xs: true; + xl2: true; + xl3: true; + } +} +``` + +### Line height + +The font size scale has been changed to: + +```diff + { +- sm: 1.25, +- md: 1.5, +- lg: 1.7, ++ xs: 1.33334, // largest font sizes for h1, h2 ++ sm: 1.42858, // normal font sizes ++ md: 1.5, // normal font sizes ++ lg: 1.55556, // large font sizes for components ++ xl: 1.66667, // smallest font sizes + } +``` + +### Letter spacing + +The letter spacing scale has been removed. +To add it back, add the following to your theme: + +```js +extendTheme({ + letterSpacing: { + sm: '-0.01em', + md: '0.083em', + lg: '0.125em', + }, +}); +``` + +#### TypeScript + +If working with TypeScript, add the old letter spacing scale to the theme's type via module augmentation: + +```ts +// You can put this to any file that's included in your tsconfig +declare module '@mui/joy/styles' { + interface ThemeScales { + letterSpacing: { + sm: string; + md: string; + lg: string; + }; + } +} +``` + +### Level + +The default typography level scale (`theme.typography.*`) has been restructured to: + +```diff + h1 + h2 + h3 + h4 ++ title-lg ++ title-md ++ title-sm ++ body-lg ++ body-md ++ body-sm ++ body-xs +- display1 +- display2 +- h5 // recommend to use `title-lg` instead +- h6 // recommend to use `title-md` instead +- body1 // recommend to use `body-md` instead +- body2 // recommend to use `body-sm` instead +- body3 // recommend to use `body-xs` instead +- body4 +- body5 +``` + +The reason behind this restructure is to make the levels more consistent and easier to use. +The `h1` through `h4` levels are intended to be used for page headings, while the `title-*` and `body-*` levels are intended to be used as page paragraphs and as component texts. + +The `title-*` and `body-*` levels are designed to be composable which align perfectly with each size of the `SvgIcon` component: + +{{"demo": "TitleBodyIconExample.js"}} + +### Shadow + +The shadow scale remains the same but all values have been changed. + +To keep the old shadow scale, add the following to your theme: + +```js +extendTheme({ + shadow: { + xs: `var(--joy-shadowRing, 0 0 #000), + 0 1px 2px 0 rgba(var(--joy-shadowChannel, 187 187 187) / 0.12)`, + sm: `var(--joy-shadowRing, 0 0 #000), + 0.3px 0.8px 1.1px rgba(var(--joy-shadowChannel, 187 187 187) / 0.11), + 0.5px 1.3px 1.8px -0.6px rgba(var(--joy-shadowChannel, 187 187 187) / 0.18), + 1.1px 2.7px 3.8px -1.2px rgba(var(--joy-shadowChannel, 187 187 187) / 0.26)`, + md: `var(--joy-shadowRing, 0 0 #000), + 0.3px 0.8px 1.1px rgba(var(--joy-shadowChannel, 187 187 187) / 0.12), + 1.1px 2.8px 3.9px -0.4px rgba(var(--joy-shadowChannel, 187 187 187) / 0.17), + 2.4px 6.1px 8.6px -0.8px rgba(var(--joy-shadowChannel, 187 187 187) / 0.23), + 5.3px 13.3px 18.8px -1.2px rgba(var(--joy-shadowChannel, 187 187 187) / 0.29)`, + lg: `var(--joy-shadowRing, 0 0 #000), + 0.3px 0.8px 1.1px rgba(var(--joy-shadowChannel, 187 187 187) / 0.11), + 1.8px 4.5px 6.4px -0.2px rgba(var(--joy-shadowChannel, 187 187 187) / 0.13), + 3.2px 7.9px 11.2px -0.4px rgba(var(--joy-shadowChannel, 187 187 187) / 0.16), + 4.8px 12px 17px -0.5px rgba(var(--joy-shadowChannel, 187 187 187) / 0.19), + 7px 17.5px 24.7px -0.7px rgba(var(--joy-shadowChannel, 187 187 187) / 0.21)`, + xl: `var(--joy-shadowRing, 0 0 #000), + 0.3px 0.8px 1.1px rgba(var(--joy-shadowChannel, 187 187 187) / 0.11), + 1.8px 4.5px 6.4px -0.2px rgba(var(--joy-shadowChannel, 187 187 187) / 0.13), + 3.2px 7.9px 11.2px -0.4px rgba(var(--joy-shadowChannel, 187 187 187) / 0.16), + 4.8px 12px 17px -0.5px rgba(var(--joy-shadowChannel, 187 187 187) / 0.19), + 7px 17.5px 24.7px -0.7px rgba(var(--joy-shadowChannel, 187 187 187) / 0.21), + 10.2px 25.5px 36px -0.9px rgba(var(--joy-shadowChannel, 187 187 187) / 0.24), + 14.8px 36.8px 52.1px -1.1px rgba(var(--joy-shadowChannel, 187 187 187) / 0.27), 21px 52.3px 74px -1.2px rgba(var(--joy-shadowChannel, 187 187 187) / 0.29)`, + }, +}); +``` + +## Components + +### Alert + +The default variant has been changed to `outlined` and the default color has been changed to `neutral`. + +To keep the old default variant and color, add the following to your theme: + +```js +extendTheme({ + components: { + JoyAlert: { + defaultProps: { + variant: 'soft', + color: 'primary', + }, + }, + }, +}); +``` + +### Autocomplete + +The variant and color are now the same for `input` and `listbox` slots. + +If you want to use a different variant for a specific slot, use `slotProps`. In the following example, the `listbox` slot uses the `plain` variant: + +```js + +``` + +### Chip + +The default variant has been changed to `soft` and the default color has been changed to `neutral`. + +To keep the old default variant and color, add the following to your theme: + +```js +extendTheme({ + components: { + JoyChip: { + defaultProps: { + variant: 'solid', + color: 'primary', + }, + }, + }, +}); +``` + +### ChipDelete + +The default variant has been changed to `plain` and the default color has been changed to `neutral`. + +To keep the old default variant and color, add the following to your theme: + +```js +extendTheme({ + components: { + JoyChipDelete: { + defaultProps: { + variant: 'solid', + color: 'primary', + }, + }, + }, +}); +``` + +### IconButton + +The default variant has been changed to `plain` and the default color has been changed to `neutral`. + +To keep the old default variant and color, add the following to your theme: + +```js +extendTheme({ + components: { + JoyIconButton: { + defaultProps: { + variant: 'soft', + color: 'primary', + }, + }, + }, +}); +``` + +### Tabs + +The [Tabs](/joy-ui/react-tabs/) component has been redesigned following feedback we've received on [this GitHub issue](https://github.com/mui/material-ui/issues/36782). + +{{"demo": "../components/tabs/TabsBasic.js"}} + +To keep the old Tabs design, add the following to your theme: + +```js +extendTheme({ + components: { + JoyTabList: { + defaultProps: { + variant: 'soft', + disableUnderline: true, + }, + styleOverrides: { + root: { + gap: '0.25rem', + padding: '0.25rem', + '--List-padding': '0.25rem', + borderRadius: 'var(--joy-radius-xl)', + '--List-radius': 'var(--joy-radius-xl)', + }, + }, + }, + JoyTab: { + defaultProps: { + disableIndicator: true, + }, + styleOverrides: { + root: { + '&[aria-selected="true"]': { + boxShadow: 'var(--joy-shadow-sm)', + backgroundColor: 'var(--joy-palette-background-surface)', + }, + }, + }, + }, + }, +}); +``` + +### Select + +The variant and color are now the same for `button` and `listbox` slots. + +If you want to use a different variant for a specific slot, use `slotProps`. In the following example, the `listbox` slot uses the `plain` variant: + +```js + + )} + + ); }, - }, - }} - value={(resolvedValue || 'none') as string} - onChange={(event, val) => - setProps((latestProps) => ({ - ...latestProps, - [propName]: val, - })) - } - > - {options.map((value) => ( -
Email diff --git a/examples/joy-next-app-router-ts/src/app/sign-up/page.tsx b/examples/joy-next-app-router-ts/src/app/sign-up/page.tsx index 7a8883dc131dba..f2451d7ef42fb4 100644 --- a/examples/joy-next-app-router-ts/src/app/sign-up/page.tsx +++ b/examples/joy-next-app-router-ts/src/app/sign-up/page.tsx @@ -37,7 +37,7 @@ export default function SignUp() { Welcome πŸ‘‹ - Sign up for an account. + Sign up for an account.
Email diff --git a/packages/api-docs-builder/ApiBuilders/ComponentApiBuilder.ts b/packages/api-docs-builder/ApiBuilders/ComponentApiBuilder.ts index 255668f6cde090..26a657b7a0e50d 100644 --- a/packages/api-docs-builder/ApiBuilders/ComponentApiBuilder.ts +++ b/packages/api-docs-builder/ApiBuilders/ComponentApiBuilder.ts @@ -490,7 +490,7 @@ const attachPropsTable = (reactApi: ReactApi) => { try { prop = createDescribeableProp(propDescriptor, propName); } catch (error) { - propErrors.push([propName, error as Error]); + propErrors.push([`[${reactApi.name}] \`${propName}\``, error as Error]); prop = null; } if (prop === null) { diff --git a/packages/mui-joy/src/Alert/Alert.spec.tsx b/packages/mui-joy/src/Alert/Alert.spec.tsx index 860a99f9c21601..cc11ff86543ab5 100644 --- a/packages/mui-joy/src/Alert/Alert.spec.tsx +++ b/packages/mui-joy/src/Alert/Alert.spec.tsx @@ -15,7 +15,6 @@ import Alert, { AlertOwnerState } from '@mui/joy/Alert'; // `color` ; ; -; ; ; ; diff --git a/packages/mui-joy/src/Alert/Alert.test.tsx b/packages/mui-joy/src/Alert/Alert.test.tsx index 9b47494ae77364..535719b37be4ef 100644 --- a/packages/mui-joy/src/Alert/Alert.test.tsx +++ b/packages/mui-joy/src/Alert/Alert.test.tsx @@ -32,10 +32,10 @@ describe('', () => { it('soft by default', () => { const { getByRole } = render(); - expect(getByRole('alert')).to.have.class(classes.variantSoft); + expect(getByRole('alert')).to.have.class(classes.variantOutlined); }); - (['outlined', 'soft', 'solid'] as const).forEach((variant) => { + (['plain', 'soft', 'solid'] as const).forEach((variant) => { it(`should render ${variant}`, () => { const { getByRole } = render(); @@ -50,10 +50,10 @@ describe('', () => { it('adds a primary class by default', () => { const { getByRole } = render(); - expect(getByRole('alert')).to.have.class(classes.colorPrimary); + expect(getByRole('alert')).to.have.class(classes.colorNeutral); }); - (['primary', 'success', 'info', 'danger', 'neutral', 'warning'] as const).forEach((color) => { + (['primary', 'success', 'danger', 'neutral', 'warning'] as const).forEach((color) => { it(`should render ${color}`, () => { const { getByRole } = render(); diff --git a/packages/mui-joy/src/Alert/Alert.tsx b/packages/mui-joy/src/Alert/Alert.tsx index c27b23b1b41078..ff47ef78cc12fa 100644 --- a/packages/mui-joy/src/Alert/Alert.tsx +++ b/packages/mui-joy/src/Alert/Alert.tsx @@ -11,6 +11,7 @@ import { ColorInversionProvider, useColorInversion } from '../styles/ColorInvers import useSlot from '../utils/useSlot'; import { getAlertUtilityClass } from './alertClasses'; import { AlertProps, AlertOwnerState, AlertTypeMap } from './AlertProps'; +import { resolveSxValue } from '../styles/styleUtils'; const useUtilityClasses = (ownerState: AlertOwnerState) => { const { variant, color, size } = ownerState; @@ -33,79 +34,78 @@ const AlertRoot = styled('div', { name: 'JoyAlert', slot: 'Root', overridesResolver: (props, styles) => styles.root, -})<{ ownerState: AlertOwnerState }>(({ theme, ownerState }) => [ - { - '--Alert-radius': theme.vars.radius.sm, - '--Alert-decoratorChildRadius': - 'max((var(--Alert-radius) - var(--variant-borderWidth, 0px)) - var(--Alert-padding), min(var(--Alert-padding) + var(--variant-borderWidth, 0px), var(--Alert-radius) / 2))', - '--Button-minHeight': 'var(--Alert-decoratorChildHeight)', - '--IconButton-size': 'var(--Alert-decoratorChildHeight)', - '--Button-radius': 'var(--Alert-decoratorChildRadius)', - '--IconButton-radius': 'var(--Alert-decoratorChildRadius)', - ...(ownerState.size === 'sm' && { - '--Alert-padding': '0.5rem', - '--Alert-gap': '0.375rem', - '--Alert-decoratorChildHeight': '1.5rem', - '--Icon-fontSize': '1.125rem', - fontSize: theme.vars.fontSize.sm, - }), - ...(ownerState.size === 'md' && { - '--Alert-padding': '0.75rem', - '--Alert-gap': '0.5rem', - '--Alert-decoratorChildHeight': '2rem', - '--Icon-fontSize': '1.25rem', - fontSize: theme.vars.fontSize.sm, +})<{ ownerState: AlertOwnerState }>(({ theme, ownerState }) => { + const { p, padding, borderRadius } = resolveSxValue({ theme, ownerState }, [ + 'p', + 'padding', + 'borderRadius', + ]); + return [ + { + '--Alert-radius': theme.vars.radius.sm, + '--Alert-decoratorChildRadius': + 'max((var(--Alert-radius) - var(--variant-borderWidth, 0px)) - var(--Alert-padding), min(var(--Alert-padding) + var(--variant-borderWidth, 0px), var(--Alert-radius) / 2))', + '--Button-minHeight': 'var(--Alert-decoratorChildHeight)', + '--IconButton-size': 'var(--Alert-decoratorChildHeight)', + '--Button-radius': 'var(--Alert-decoratorChildRadius)', + '--IconButton-radius': 'var(--Alert-decoratorChildRadius)', + '--Icon-color': 'currentColor', + ...(ownerState.size === 'sm' && { + '--Alert-padding': '0.5rem', + '--Alert-decoratorChildHeight': '1.5rem', + '--Icon-fontSize': theme.vars.fontSize.xl, + gap: '0.5rem', + }), + ...(ownerState.size === 'md' && { + '--Alert-padding': '0.75rem', + '--Alert-decoratorChildHeight': '2rem', + '--Icon-fontSize': theme.vars.fontSize.xl, + gap: '0.625rem', + }), + ...(ownerState.size === 'lg' && { + '--Alert-padding': '1rem', + '--Alert-decoratorChildHeight': '2.375rem', + '--Icon-fontSize': theme.vars.fontSize.xl2, + gap: '0.875rem', + }), + backgroundColor: theme.vars.palette.background.surface, + display: 'flex', + position: 'relative', + alignItems: 'center', + padding: `var(--Alert-padding)`, + borderRadius: 'var(--Alert-radius)', + boxShadow: theme.vars.shadow.xs, + ...theme.typography[`body-${({ sm: 'xs', md: 'sm', lg: 'md' } as const)[ownerState.size!]}`], fontWeight: theme.vars.fontWeight.md, - }), - ...(ownerState.size === 'lg' && { - '--Alert-padding': '1rem', - '--Alert-gap': '0.75rem', - '--Alert-decoratorChildHeight': '2.375rem', - '--Icon-fontSize': '1.5rem', - fontSize: theme.vars.fontSize.md, - fontWeight: theme.vars.fontWeight.md, - }), - fontFamily: theme.vars.fontFamily.body, - lineHeight: theme.vars.lineHeight.md, - backgroundColor: 'transparent', - display: 'flex', - position: 'relative', - alignItems: 'center', - padding: `var(--Alert-padding)`, - borderRadius: 'var(--Alert-radius)', - ...theme.variants[ownerState.variant!]?.[ownerState.color!], - }, - ownerState.color !== 'context' && - ownerState.invertedColors && - theme.colorInversion[ownerState.variant!]?.[ownerState.color!], -]); + ...theme.variants[ownerState.variant!]?.[ownerState.color!], + }, + ownerState.color !== 'context' && + ownerState.invertedColors && + theme.colorInversion[ownerState.variant!]?.[ownerState.color!], + p !== undefined && { '--Alert-padding': p }, + padding !== undefined && { '--Alert-padding': padding }, + borderRadius !== undefined && { '--Alert-radius': borderRadius }, + ]; +}); const AlertStartDecorator = styled('span', { name: 'JoyAlert', slot: 'StartDecorator', overridesResolver: (props, styles) => styles.startDecorator, -})<{ ownerState: AlertOwnerState }>(({ theme, ownerState }) => ({ +})<{ ownerState: AlertOwnerState }>({ display: 'inherit', flex: 'none', - marginInlineEnd: 'var(--Alert-gap)', - ...(ownerState.color !== 'context' && { - color: theme.vars.palette[ownerState.color!]?.[`${ownerState.variant!}Color`], - }), -})); +}); const AlertEndDecorator = styled('span', { name: 'JoyAlert', slot: 'EndDecorator', overridesResolver: (props, styles) => styles.endDecorator, -})<{ ownerState: AlertOwnerState }>(({ theme, ownerState }) => ({ +})<{ ownerState: AlertOwnerState }>({ display: 'inherit', flex: 'none', - marginInlineStart: 'var(--Alert-gap)', marginLeft: 'auto', - ...(ownerState.color !== 'context' && { - color: theme.vars.palette[ownerState.color!]?.[`${ownerState.variant!}Color`], - }), -})); +}); /** * * Demos: @@ -125,10 +125,10 @@ const Alert = React.forwardRef(function Alert(inProps, ref) { const { children, className, - color: colorProp = 'primary', + color: colorProp = 'neutral', invertedColors = false, role = 'alert', - variant = 'soft', + variant = 'outlined', size = 'md', startDecorator, endDecorator, @@ -212,10 +212,10 @@ Alert.propTypes /* remove-proptypes */ = { className: PropTypes.string, /** * The color of the component. It supports those theme colors that make sense for this component. - * @default 'primary' + * @default 'neutral' */ color: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([ - PropTypes.oneOf(['danger', 'info', 'neutral', 'primary', 'success', 'warning']), + PropTypes.oneOf(['danger', 'neutral', 'primary', 'success', 'warning']), PropTypes.string, ]), /** @@ -277,7 +277,7 @@ Alert.propTypes /* remove-proptypes */ = { ]), /** * The [global variant](https://mui.com/joy-ui/main-features/global-variants/) to use. - * @default 'soft' + * @default 'outlined' */ variant: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([ PropTypes.oneOf(['outlined', 'plain', 'soft', 'solid']), diff --git a/packages/mui-joy/src/Alert/AlertProps.ts b/packages/mui-joy/src/Alert/AlertProps.ts index fcda2317c97c97..b79749d972e662 100644 --- a/packages/mui-joy/src/Alert/AlertProps.ts +++ b/packages/mui-joy/src/Alert/AlertProps.ts @@ -41,7 +41,7 @@ export interface AlertTypeMap

{ AlertSlotsAndSlotProps & { /** * The color of the component. It supports those theme colors that make sense for this component. - * @default 'primary' + * @default 'neutral' */ color?: OverridableStringUnion; /** @@ -73,7 +73,7 @@ export interface AlertTypeMap

{ sx?: SxProps; /** * The [global variant](https://mui.com/joy-ui/main-features/global-variants/) to use. - * @default 'soft' + * @default 'outlined' */ variant?: OverridableStringUnion; }; diff --git a/packages/mui-joy/src/Alert/alertClasses.ts b/packages/mui-joy/src/Alert/alertClasses.ts index 9f22b93d5738d7..b470ec43d6b2aa 100644 --- a/packages/mui-joy/src/Alert/alertClasses.ts +++ b/packages/mui-joy/src/Alert/alertClasses.ts @@ -7,8 +7,6 @@ export interface AlertClasses { colorPrimary: string; /** Class name applied to the root element if `color="danger"`. */ colorDanger: string; - /** Class name applied to the root element if `color="info"`. */ - colorInfo: string; /** Class name applied to the root element if `color="neutral"`. */ colorNeutral: string; /** Class name applied to the root element if `color="success"`. */ @@ -49,7 +47,6 @@ const alertClasses: AlertClasses = generateUtilityClasses('MuiAlert', [ 'endDecorator', 'colorPrimary', 'colorDanger', - 'colorInfo', 'colorNeutral', 'colorSuccess', 'colorWarning', diff --git a/packages/mui-joy/src/AspectRatio/AspectRatio.test.tsx b/packages/mui-joy/src/AspectRatio/AspectRatio.test.tsx index d77306f5950237..5dc77a5ba452fb 100644 --- a/packages/mui-joy/src/AspectRatio/AspectRatio.test.tsx +++ b/packages/mui-joy/src/AspectRatio/AspectRatio.test.tsx @@ -62,7 +62,7 @@ describe('', () => { expect(getByTestId('root').firstChild).to.have.class(classes.colorNeutral); }); - (['primary', 'success', 'info', 'danger', 'neutral', 'warning'] as const).forEach((color) => { + (['primary', 'success', 'danger', 'neutral', 'warning'] as const).forEach((color) => { it(`should render ${color}`, () => { const { getByTestId } = render( diff --git a/packages/mui-joy/src/AspectRatio/AspectRatio.tsx b/packages/mui-joy/src/AspectRatio/AspectRatio.tsx index 480dae813bfeb4..c5aadf95b810f8 100644 --- a/packages/mui-joy/src/AspectRatio/AspectRatio.tsx +++ b/packages/mui-joy/src/AspectRatio/AspectRatio.tsx @@ -30,7 +30,7 @@ const AspectRatioRoot = styled('div', { name: 'JoyAspectRatio', slot: 'Root', overridesResolver: (props, styles) => styles.root, -})<{ ownerState: AspectRatioOwnerState }>(({ ownerState }) => { +})<{ ownerState: AspectRatioOwnerState }>(({ ownerState, theme }) => { const minHeight = typeof ownerState.minHeight === 'number' ? `${ownerState.minHeight}px` : ownerState.minHeight; const maxHeight = @@ -40,6 +40,10 @@ const AspectRatioRoot = styled('div', { '--AspectRatio-paddingBottom': `clamp(var(--AspectRatio-minHeight), calc(100% / (${ownerState.ratio})), var(--AspectRatio-maxHeight))`, '--AspectRatio-maxHeight': maxHeight || '9999px', '--AspectRatio-minHeight': minHeight || '0px', + '--Icon-color': + ownerState.color !== 'neutral' || ownerState.variant === 'solid' + ? 'currentColor' + : theme.vars.palette.text.icon, borderRadius: 'var(--AspectRatio-radius)', flexDirection: 'column', margin: 'var(--AspectRatio-margin)', @@ -50,38 +54,37 @@ const AspectRatioContent = styled('div', { name: 'JoyAspectRatio', slot: 'Content', overridesResolver: (props, styles) => styles.content, -})<{ ownerState: AspectRatioOwnerState }>(({ theme, ownerState }) => [ - { - flex: 1, - position: 'relative', - borderRadius: 'inherit', - height: 0, - paddingBottom: 'calc(var(--AspectRatio-paddingBottom) - 2 * var(--variant-borderWidth, 0px))', - overflow: 'hidden', - transition: 'inherit', // makes it easy to add transition to the content - // use data-attribute instead of :first-child to support zero config SSR (emotion) - // use nested selector for integrating with nextjs image `fill` layout (spans are inserted on top of the img) - '& [data-first-child]': { - display: 'flex', - justifyContent: 'center', - alignItems: 'center', - boxSizing: 'border-box', - position: 'absolute', +})<{ ownerState: AspectRatioOwnerState }>(({ theme, ownerState }) => ({ + flex: 1, + position: 'relative', + borderRadius: 'inherit', + height: 0, + paddingBottom: 'calc(var(--AspectRatio-paddingBottom) - 2 * var(--variant-borderWidth, 0px))', + overflow: 'hidden', + transition: 'inherit', // makes it easy to add transition to the content + // use data-attribute instead of :first-child to support zero config SSR (emotion) + // use nested selector for integrating with nextjs image `fill` layout (spans are inserted on top of the img) + '& [data-first-child]': { + display: 'flex', + justifyContent: 'center', + alignItems: 'center', + boxSizing: 'border-box', + position: 'absolute', + width: '100%', + height: '100%', + objectFit: ownerState.objectFit, + margin: 0, + padding: 0, + '& > img': { + // support art-direction that uses width: '100%', height: '100%', objectFit: ownerState.objectFit, - margin: 0, - padding: 0, - '& > img': { - // support art-direction that uses - width: '100%', - height: '100%', - objectFit: ownerState.objectFit, - }, }, }, - theme.variants[ownerState.variant!]?.[ownerState.color!], -]); + ...theme.typography['body-md'], + ...theme.variants[ownerState.variant!]?.[ownerState.color!], +})); /** * @@ -171,7 +174,7 @@ AspectRatio.propTypes /* remove-proptypes */ = { * The color of the component. It supports those theme colors that make sense for this component. * @default 'neutral' */ - color: PropTypes.oneOf(['danger', 'info', 'neutral', 'primary', 'success', 'warning']), + color: PropTypes.oneOf(['danger', 'neutral', 'primary', 'success', 'warning']), /** * The component used for the root node. * Either a string to use a HTML element or a component. diff --git a/packages/mui-joy/src/AspectRatio/aspectRatioClasses.ts b/packages/mui-joy/src/AspectRatio/aspectRatioClasses.ts index 472845f5d49c5a..d7213e28652929 100644 --- a/packages/mui-joy/src/AspectRatio/aspectRatioClasses.ts +++ b/packages/mui-joy/src/AspectRatio/aspectRatioClasses.ts @@ -11,8 +11,6 @@ export interface AspectRatioClasses { colorNeutral: string; /** Class name applied to the content element if `color="danger"`. */ colorDanger: string; - /** Class name applied to the content element if `color="info"`. */ - colorInfo: string; /** Class name applied to the content element if `color="success"`. */ colorSuccess: string; /** Class name applied to the content element if `color="warning"`. */ @@ -41,7 +39,6 @@ const aspectRatioClasses: AspectRatioClasses = generateUtilityClasses('MuiAspect 'colorPrimary', 'colorNeutral', 'colorDanger', - 'colorInfo', 'colorSuccess', 'colorWarning', 'colorContext', diff --git a/packages/mui-joy/src/Autocomplete/Autocomplete.tsx b/packages/mui-joy/src/Autocomplete/Autocomplete.tsx index a8e6dd98a6d688..0923d96e027319 100644 --- a/packages/mui-joy/src/Autocomplete/Autocomplete.tsx +++ b/packages/mui-joy/src/Autocomplete/Autocomplete.tsx @@ -18,6 +18,7 @@ import { useThemeProps } from '../styles'; import ClearIcon from '../internal/svg-icons/Close'; import ArrowDropDownIcon from '../internal/svg-icons/ArrowDropDown'; import styled from '../styles/styled'; +import { VariantColorProvider, getChildVariantAndColor } from '../styles/variantColorInheritance'; // slot components import { StyledIconButton } from '../IconButton/IconButton'; // default render components @@ -60,13 +61,6 @@ const defaultRenderGroup = (params: AutocompleteRenderGroupParams) => ( ); -const defaultVariantMapping = { - plain: 'plain', - outlined: 'plain', - soft: 'soft', - solid: 'solid', -}; - const useUtilityClasses = (ownerState: OwnerState) => { const { disabled, @@ -213,14 +207,15 @@ const AutocompletePopupIndicator = styled(StyledIconButton as unknown as 'button name: 'JoyAutocomplete', slot: 'PopupIndicator', overridesResolver: (props, styles) => styles.popupIndicator, -})<{ ownerState: OwnerState }>(({ ownerState }) => ({ +})<{ ownerState: OwnerState }>({ alignSelf: 'center', marginInlineStart: 'calc(var(--_Input-paddingBlock) / 2)', marginInlineEnd: 'calc(var(--Input-decoratorChildOffset) * -1)', - ...(ownerState.popupOpen && { + [`&.${autocompleteClasses.popupIndicatorOpen}`]: { transform: 'rotate(180deg)', - }), -})); + '--Icon-color': 'currentColor', + }, +}); const AutocompleteListbox = styled(StyledAutocompleteListbox, { name: 'JoyAutocomplete', @@ -361,7 +356,8 @@ const Autocomplete = React.forwardRef(function Autocomplete( const formControl = React.useContext(FormControlContext); const error = inProps.error ?? formControl?.error ?? errorProp; const size = inProps.size ?? formControl?.size ?? sizeProp; - const color = getColor(inProps.color, error ? 'danger' : formControl?.color ?? colorProp); + const rootColor = inProps.color ?? (error ? 'danger' : formControl?.color ?? colorProp); + const color = getColor(inProps.color, rootColor); const disabled = disabledProp ?? formControl?.disabled ?? false; const { @@ -543,8 +539,10 @@ const Autocomplete = React.forwardRef(function Autocomplete( ownerState, getSlotOwnerState: (mergedProps) => ({ size: mergedProps.size || size, - variant: mergedProps.variant || defaultVariantMapping[variant] || 'plain', - color: mergedProps.color || 'neutral', + variant: + mergedProps.variant || getChildVariantAndColor(variant, rootColor).variant || 'plain', + color: mergedProps.color || getChildVariantAndColor(variant, rootColor).color || 'neutral', + disableColorInversion: !!inProps.color, }), additionalProps: { 'aria-label': clearText, @@ -560,8 +558,10 @@ const Autocomplete = React.forwardRef(function Autocomplete( ownerState, getSlotOwnerState: (mergedProps) => ({ size: mergedProps.size || size, - variant: mergedProps.variant || defaultVariantMapping[variant] || 'plain', - color: mergedProps.color || 'neutral', + variant: + mergedProps.variant || getChildVariantAndColor(variant, rootColor).variant || 'plain', + color: mergedProps.color || getChildVariantAndColor(variant, rootColor).color || 'neutral', + disableColorInversion: !!inProps.color, }), additionalProps: { disabled, @@ -579,8 +579,8 @@ const Autocomplete = React.forwardRef(function Autocomplete( ownerState, getSlotOwnerState: (mergedProps) => ({ size: mergedProps.size || size, - variant: mergedProps.variant || 'outlined', - color: mergedProps.color || 'neutral', + variant: mergedProps.variant || variant, + color: mergedProps.color || (!mergedProps.disablePortal ? rootColor : color), disableColorInversion: !mergedProps.disablePortal, }), additionalProps: { @@ -640,8 +640,9 @@ const Autocomplete = React.forwardRef(function Autocomplete( externalForwardedProps, ownerState, getSlotOwnerState: (mergedProps) => ({ - variant: mergedProps.variant || 'plain', - color: mergedProps.color || 'neutral', + variant: + mergedProps.variant || getChildVariantAndColor(variant, rootColor).variant || 'plain', + color: mergedProps.color || getChildVariantAndColor(variant, rootColor).color || 'neutral', disableColorInversion: !listboxProps.disablePortal, }), additionalProps: { @@ -683,41 +684,43 @@ const Autocomplete = React.forwardRef(function Autocomplete( let popup = null; if (anchorEl) { popup = ( - - - {groupedOptions.map((option, index) => { - if (groupBy) { - const typedOption = option as AutocompleteGroupedOption; - return renderGroup({ - key: String(typedOption.key), - group: typedOption.group, - children: typedOption.options.map((option2, index2) => - renderListOption(option2, typedOption.index + index2), - ), - }); - } - return renderListOption(option, index); - })} - {loading && groupedOptions.length === 0 ? ( - {loadingText} - ) : null} - {groupedOptions.length === 0 && !freeSolo && !loading ? ( - {noOptionsText} - ) : null} - - + + + + {groupedOptions.map((option, index) => { + if (groupBy) { + const typedOption = option as AutocompleteGroupedOption; + return renderGroup({ + key: String(typedOption.key), + group: typedOption.group, + children: typedOption.options.map((option2, index2) => + renderListOption(option2, typedOption.index + index2), + ), + }); + } + return renderListOption(option, index); + })} + {loading && groupedOptions.length === 0 ? ( + {loadingText} + ) : null} + {groupedOptions.length === 0 && !freeSolo && !loading ? ( + {noOptionsText} + ) : null} + + + ); if (!listboxProps.disablePortal) { @@ -809,7 +812,7 @@ Autocomplete.propTypes /* remove-proptypes */ = { * The color of the component. It supports those theme colors that make sense for this component. * @default 'neutral' */ - color: PropTypes.oneOf(['danger', 'info', 'neutral', 'primary', 'success', 'warning']), + color: PropTypes.oneOf(['danger', 'neutral', 'primary', 'success', 'warning']), /** * The default value. Use when the component is not controlled. * @default props.multiple ? [] : null diff --git a/packages/mui-joy/src/Autocomplete/autocompleteClasses.ts b/packages/mui-joy/src/Autocomplete/autocompleteClasses.ts index 35bf90f81b6d1d..7fcf8d969fdf0a 100644 --- a/packages/mui-joy/src/Autocomplete/autocompleteClasses.ts +++ b/packages/mui-joy/src/Autocomplete/autocompleteClasses.ts @@ -47,8 +47,6 @@ export interface AutocompleteClasses { colorNeutral: string; /** Class name applied to the root element if `color="danger"`. */ colorDanger: string; - /** Class name applied to the root element if `color="info"`. */ - colorInfo: string; /** Class name applied to the root element if `color="success"`. */ colorSuccess: string; /** Class name applied to the root element if `color="warning"`. */ @@ -101,7 +99,6 @@ const autocompleteClasses: AutocompleteClasses = generateUtilityClasses('MuiAuto 'colorPrimary', 'colorNeutral', 'colorDanger', - 'colorInfo', 'colorSuccess', 'colorWarning', 'colorContext', diff --git a/packages/mui-joy/src/AutocompleteListbox/AutocompleteListbox.tsx b/packages/mui-joy/src/AutocompleteListbox/AutocompleteListbox.tsx index cbf3ac020b1d22..d7fbbe9bb78bd7 100644 --- a/packages/mui-joy/src/AutocompleteListbox/AutocompleteListbox.tsx +++ b/packages/mui-joy/src/AutocompleteListbox/AutocompleteListbox.tsx @@ -7,6 +7,7 @@ import { unstable_capitalize as capitalize } from '@mui/utils'; import composeClasses from '@mui/base/composeClasses'; import { StyledList } from '../List/List'; import { styled, useThemeProps } from '../styles'; +import { VariantColorProvider } from '../styles/variantColorInheritance'; import { getAutocompleteListboxUtilityClass } from './autocompleteListboxClasses'; import { AutocompleteListboxOwnerState, @@ -52,7 +53,6 @@ export const StyledAutocompleteListbox = styled(StyledList)<{ const variantStyle = theme.variants[ownerState.variant!]?.[ownerState.color!]; return { '--focus-outline-offset': `calc(${theme.vars.focus.thickness} * -1)`, // to prevent the focus outline from being cut by overflow - '--List-radius': theme.vars.radius.sm, '--ListItem-stickyBackground': variantStyle?.backgroundColor || variantStyle?.background || @@ -60,6 +60,7 @@ export const StyledAutocompleteListbox = styled(StyledList)<{ '--ListItem-stickyTop': 'calc(var(--List-padding, var(--ListDivider-gap)) * -1)', ...scopedVariables, boxShadow: theme.shadow.md, + borderRadius: `var(--List-radius, ${theme.vars.radius.sm})`, ...(!variantStyle?.backgroundColor && { backgroundColor: theme.vars.palette.background.popup, }), @@ -142,7 +143,11 @@ const AutocompleteListbox = React.forwardRef(function AutocompleteListbox(inProp }, }); - return {children}; + return ( + + {children} + + ); }) as OverridableComponent; AutocompleteListbox.propTypes /* remove-proptypes */ = { @@ -163,7 +168,7 @@ AutocompleteListbox.propTypes /* remove-proptypes */ = { * @default 'neutral' */ color: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([ - PropTypes.oneOf(['danger', 'info', 'neutral', 'primary', 'success', 'warning']), + PropTypes.oneOf(['danger', 'neutral', 'primary', 'success', 'warning']), PropTypes.string, ]), /** diff --git a/packages/mui-joy/src/AutocompleteListbox/autocompleteListboxClasses.ts b/packages/mui-joy/src/AutocompleteListbox/autocompleteListboxClasses.ts index 91a3a84d29a26d..631781a39c7e66 100644 --- a/packages/mui-joy/src/AutocompleteListbox/autocompleteListboxClasses.ts +++ b/packages/mui-joy/src/AutocompleteListbox/autocompleteListboxClasses.ts @@ -15,8 +15,6 @@ export interface AutocompleteListboxClasses { colorNeutral: string; /** Classname applied to the root element if `color="danger"`. */ colorDanger: string; - /** Classname applied to the root element if `color="info"`. */ - colorInfo: string; /** Classname applied to the root element if `color="success"`. */ colorSuccess: string; /** Classname applied to the root element if `color="warning"`. */ @@ -49,7 +47,6 @@ const autocompleteListboxClasses: AutocompleteListboxClasses = generateUtilityCl 'colorPrimary', 'colorNeutral', 'colorDanger', - 'colorInfo', 'colorSuccess', 'colorWarning', 'colorContext', diff --git a/packages/mui-joy/src/AutocompleteOption/AutocompleteOption.tsx b/packages/mui-joy/src/AutocompleteOption/AutocompleteOption.tsx index 38608b3aeaf3d0..9c2268c32ebab9 100644 --- a/packages/mui-joy/src/AutocompleteOption/AutocompleteOption.tsx +++ b/packages/mui-joy/src/AutocompleteOption/AutocompleteOption.tsx @@ -7,9 +7,8 @@ import { unstable_capitalize as capitalize } from '@mui/utils'; import composeClasses from '@mui/base/composeClasses'; import { StyledListItemButton } from '../ListItemButton/ListItemButton'; import { styled, useThemeProps } from '../styles'; -import autocompleteOptionClasses, { - getAutocompleteOptionUtilityClass, -} from './autocompleteOptionClasses'; +import { useVariantColor } from '../styles/variantColorInheritance'; +import { getAutocompleteOptionUtilityClass } from './autocompleteOptionClasses'; import { AutocompleteOptionOwnerState, AutocompleteOptionTypeMap } from './AutocompleteOptionProps'; import { useColorInversion } from '../styles/ColorInversion'; import useSlot from '../utils/useSlot'; @@ -33,17 +32,9 @@ export const StyledAutocompleteOption = styled(StyledListItemButton as unknown a }>(({ theme, ownerState }) => ({ '&[aria-disabled="true"]': theme.variants[`${ownerState.variant!}Disabled`]?.[ownerState.color!], '&[aria-selected="true"]': { - color: theme.variants.soft?.[ownerState.color === 'context' ? 'context' : 'primary']?.color, - backgroundColor: - theme.variants.soft?.[ownerState.color === 'context' ? 'context' : 'primary'] - ?.backgroundColor, + ...theme.variants[`${ownerState.variant!}Active`]?.[ownerState.color!], fontWeight: theme.vars.fontWeight.md, }, - [`&.${autocompleteOptionClasses.focused}:not([aria-selected="true"]):not(:hover)`]: { - // create the focused style similar to the hover state - backgroundColor: - theme.variants[`${ownerState.variant!}Hover`]?.[ownerState.color!]?.backgroundColor, - }, })); const AutocompleteOptionRoot = styled(StyledAutocompleteOption, { @@ -71,14 +62,18 @@ const AutocompleteOption = React.forwardRef(function AutocompleteOption(inProps, children, component = 'li', color: colorProp = 'neutral', - variant = 'plain', + variant: variantProp = 'plain', className, slots = {}, slotProps = {}, ...other } = props; + const { variant = variantProp, color: inheritedColor = colorProp } = useVariantColor( + inProps.variant, + inProps.color, + ); const { getColor } = useColorInversion(variant); - const color = getColor(inProps.color, colorProp); + const color = getColor(inProps.color, inheritedColor); const ownerState = { ...props, @@ -123,7 +118,7 @@ AutocompleteOption.propTypes /* remove-proptypes */ = { * @default 'neutral' */ color: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([ - PropTypes.oneOf(['danger', 'info', 'neutral', 'primary', 'success', 'warning']), + PropTypes.oneOf(['danger', 'neutral', 'primary', 'success', 'warning']), PropTypes.string, ]), /** diff --git a/packages/mui-joy/src/AutocompleteOption/autocompleteOptionClasses.ts b/packages/mui-joy/src/AutocompleteOption/autocompleteOptionClasses.ts index f2b1bd6cab5a84..9aa2d229c2a573 100644 --- a/packages/mui-joy/src/AutocompleteOption/autocompleteOptionClasses.ts +++ b/packages/mui-joy/src/AutocompleteOption/autocompleteOptionClasses.ts @@ -13,8 +13,6 @@ export interface AutocompleteOptionClasses { colorNeutral: string; /** Class name applied to the root element if `color="danger"`. */ colorDanger: string; - /** Class name applied to the root element if `color="info"`. */ - colorInfo: string; /** Class name applied to the root element if `color="success"`. */ colorSuccess: string; /** Class name applied to the root element if `color="warning"`. */ @@ -46,7 +44,6 @@ const autocompleteOptionClasses: AutocompleteOptionClasses = generateUtilityClas 'colorPrimary', 'colorNeutral', 'colorDanger', - 'colorInfo', 'colorSuccess', 'colorWarning', 'colorContext', diff --git a/packages/mui-joy/src/Avatar/Avatar.spec.tsx b/packages/mui-joy/src/Avatar/Avatar.spec.tsx index 513b1c181f901e..35b3b93782c454 100644 --- a/packages/mui-joy/src/Avatar/Avatar.spec.tsx +++ b/packages/mui-joy/src/Avatar/Avatar.spec.tsx @@ -15,7 +15,6 @@ import { expectType } from '@mui/types'; // `color` ; ; -; ; ; ; diff --git a/packages/mui-joy/src/Avatar/Avatar.test.tsx b/packages/mui-joy/src/Avatar/Avatar.test.tsx index def9a25ca96a93..29f031769b961a 100644 --- a/packages/mui-joy/src/Avatar/Avatar.test.tsx +++ b/packages/mui-joy/src/Avatar/Avatar.test.tsx @@ -60,7 +60,7 @@ describe('', () => { expect(getByTestId('root')).to.have.class(classes.colorNeutral); }); - (['primary', 'success', 'info', 'danger', 'neutral', 'warning'] as const).forEach((color) => { + (['primary', 'success', 'danger', 'neutral', 'warning'] as const).forEach((color) => { it(`should render ${color}`, () => { const { getByTestId } = render(); diff --git a/packages/mui-joy/src/Avatar/Avatar.tsx b/packages/mui-joy/src/Avatar/Avatar.tsx index 57e08c51439aad..fd2eb21fa1e240 100644 --- a/packages/mui-joy/src/Avatar/Avatar.tsx +++ b/packages/mui-joy/src/Avatar/Avatar.tsx @@ -34,41 +34,40 @@ const AvatarRoot = styled('div', { name: 'JoyAvatar', slot: 'Root', overridesResolver: (props, styles) => styles.root, -})<{ ownerState: AvatarOwnerState }>(({ theme, ownerState }) => { - return [ - { - ...(ownerState.size === 'sm' && { - width: `var(--Avatar-size, 2rem)`, - height: `var(--Avatar-size, 2rem)`, - fontSize: `calc(var(--Avatar-size, 2rem) * 0.4375)`, // default as 14px - }), - ...(ownerState.size === 'md' && { - width: `var(--Avatar-size, 2.5rem)`, - height: `var(--Avatar-size, 2.5rem)`, - fontSize: `calc(var(--Avatar-size, 2.5rem) * 0.4)`, // default as 16px - }), - ...(ownerState.size === 'lg' && { - width: `var(--Avatar-size, 3rem)`, - height: `var(--Avatar-size, 3rem)`, - fontSize: `calc(var(--Avatar-size, 3rem) * 0.375)`, // default as 18px - }), - marginInlineStart: 'var(--Avatar-marginInlineStart)', - boxShadow: `var(--Avatar-ring)`, - fontFamily: theme.vars.fontFamily.body, - fontWeight: theme.vars.fontWeight.md, - position: 'relative', - display: 'flex', - alignItems: 'center', - justifyContent: 'center', - flexShrink: 0, - lineHeight: 1, - overflow: 'hidden', - borderRadius: 'var(--Avatar-radius, 50%)', - userSelect: 'none', - }, - theme.variants[ownerState.variant!]?.[ownerState.color!], - ]; -}); +})<{ ownerState: AvatarOwnerState }>(({ theme, ownerState }) => ({ + '--Icon-color': + ownerState.color !== 'neutral' || ownerState.variant === 'solid' + ? 'currentColor' + : theme.vars.palette.text.icon, + ...theme.typography[`title-${ownerState.size!}`], + ...(ownerState.size === 'sm' && { + width: `var(--Avatar-size, 2rem)`, + height: `var(--Avatar-size, 2rem)`, + fontSize: `calc(var(--Avatar-size, 2rem) * 0.4375)`, // default as 14px + }), + ...(ownerState.size === 'md' && { + width: `var(--Avatar-size, 2.5rem)`, + height: `var(--Avatar-size, 2.5rem)`, + fontSize: `calc(var(--Avatar-size, 2.5rem) * 0.4)`, // default as 16px + }), + ...(ownerState.size === 'lg' && { + width: `var(--Avatar-size, 3rem)`, + height: `var(--Avatar-size, 3rem)`, + fontSize: `calc(var(--Avatar-size, 3rem) * 0.375)`, // default as 18px + }), + marginInlineStart: 'var(--Avatar-marginInlineStart)', + boxShadow: `var(--Avatar-ring)`, + position: 'relative', + display: 'flex', + alignItems: 'center', + justifyContent: 'center', + flexShrink: 0, + lineHeight: 1, + overflow: 'hidden', + borderRadius: 'var(--Avatar-radius, 50%)', + userSelect: 'none', + ...theme.variants[ownerState.variant!]?.[ownerState.color!], +})); const AvatarImg = styled('img', { name: 'JoyAvatar', @@ -258,7 +257,7 @@ Avatar.propTypes /* remove-proptypes */ = { * @default 'neutral' */ color: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([ - PropTypes.oneOf(['danger', 'info', 'neutral', 'primary', 'success', 'warning']), + PropTypes.oneOf(['danger', 'neutral', 'primary', 'success', 'warning']), PropTypes.string, ]), /** diff --git a/packages/mui-joy/src/Avatar/avatarClasses.ts b/packages/mui-joy/src/Avatar/avatarClasses.ts index 29842d1ac4dc4f..53a348f63cc41f 100644 --- a/packages/mui-joy/src/Avatar/avatarClasses.ts +++ b/packages/mui-joy/src/Avatar/avatarClasses.ts @@ -9,8 +9,6 @@ export interface AvatarClasses { colorNeutral: string; /** Class name applied to the root element if `color="danger"`. */ colorDanger: string; - /** Class name applied to the root element if `color="info"`. */ - colorInfo: string; /** Class name applied to the root element if `color="success"`. */ colorSuccess: string; /** Class name applied to the root element if `color="warning"`. */ @@ -46,7 +44,6 @@ const avatarClasses: AvatarClasses = generateUtilityClasses('MuiAvatar', [ 'colorPrimary', 'colorNeutral', 'colorDanger', - 'colorInfo', 'colorSuccess', 'colorWarning', 'colorContext', diff --git a/packages/mui-joy/src/AvatarGroup/AvatarGroup.tsx b/packages/mui-joy/src/AvatarGroup/AvatarGroup.tsx index 28deb0f6038d23..a412fd30ebf48e 100644 --- a/packages/mui-joy/src/AvatarGroup/AvatarGroup.tsx +++ b/packages/mui-joy/src/AvatarGroup/AvatarGroup.tsx @@ -118,7 +118,7 @@ AvatarGroup.propTypes /* remove-proptypes */ = { * @default 'neutral' */ color: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([ - PropTypes.oneOf(['danger', 'info', 'neutral', 'primary', 'success', 'warning']), + PropTypes.oneOf(['danger', 'neutral', 'primary', 'success', 'warning']), PropTypes.string, ]), /** diff --git a/packages/mui-joy/src/Badge/Badge.spec.tsx b/packages/mui-joy/src/Badge/Badge.spec.tsx index bed59927bac9dc..d1ffd8a9781220 100644 --- a/packages/mui-joy/src/Badge/Badge.spec.tsx +++ b/packages/mui-joy/src/Badge/Badge.spec.tsx @@ -14,7 +14,6 @@ import { expectType } from '@mui/types'; // `color` ; ; -; ; ; ; diff --git a/packages/mui-joy/src/Badge/Badge.test.tsx b/packages/mui-joy/src/Badge/Badge.test.tsx index 9fc41c650a0f0c..13921cb3f5d864 100644 --- a/packages/mui-joy/src/Badge/Badge.test.tsx +++ b/packages/mui-joy/src/Badge/Badge.test.tsx @@ -121,7 +121,7 @@ describe('', () => { expect(findBadge(container)).to.have.class(classes.colorPrimary); }); - (['primary', 'success', 'info', 'danger', 'neutral', 'warning'] as const).forEach((color) => { + (['primary', 'success', 'danger', 'neutral', 'warning'] as const).forEach((color) => { it(`should render ${color}`, () => { const { container } = render(); diff --git a/packages/mui-joy/src/Badge/Badge.tsx b/packages/mui-joy/src/Badge/Badge.tsx index e05eb3c2d3e18d..3bff899460b790 100644 --- a/packages/mui-joy/src/Badge/Badge.tsx +++ b/packages/mui-joy/src/Badge/Badge.tsx @@ -41,7 +41,6 @@ const BadgeRoot = styled('span', { '--Badge-minHeight': '1rem', }), '--Badge-paddingX': '0.25rem', - fontSize: theme.vars.fontSize.xs, }), ...(ownerState.size === 'md' && { '--Badge-minHeight': '0.75rem', @@ -49,7 +48,6 @@ const BadgeRoot = styled('span', { '--Badge-minHeight': '1.25rem', }), '--Badge-paddingX': '0.375rem', - fontSize: theme.vars.fontSize.sm, }), ...(ownerState.size === 'lg' && { '--Badge-minHeight': '1rem', @@ -57,7 +55,6 @@ const BadgeRoot = styled('span', { '--Badge-minHeight': '1.5rem', }), '--Badge-paddingX': '0.5rem', - fontSize: theme.vars.fontSize.md, }), '--Badge-ringSize': '2px', '--Badge-ring': `0 0 0 var(--Badge-ringSize) var(--Badge-ringColor, ${theme.vars.palette.background.surface})`, @@ -105,7 +102,11 @@ const BadgeBadge = styled('span', { ownerState.anchorOrigin?.horizontal === 'left' ? 'translateX(-50%)' : 'translateX(50%)'; const transformOriginY = ownerState.anchorOrigin?.vertical === 'top' ? '0%' : '100%'; const transformOriginX = ownerState.anchorOrigin?.horizontal === 'left' ? '0%' : '100%'; + const typography = + theme.typography[`body-${({ sm: 'xs', md: 'sm', lg: 'md' } as const)[ownerState.size!]}`]; return { + '--Icon-color': 'currentColor', + '--Icon-fontSize': `calc(1em * ${typography.lineHeight ?? '1'})`, display: 'inline-flex', flexWrap: 'wrap', justifyContent: 'center', @@ -114,11 +115,8 @@ const BadgeBadge = styled('span', { position: 'absolute', boxSizing: 'border-box', boxShadow: 'var(--Badge-ring)', - fontFamily: theme.vars.fontFamily.body, - fontWeight: theme.vars.fontWeight.md, lineHeight: 1, - padding: - 'calc(var(--Badge-paddingX) / 2 - var(--variant-borderWidth, 0px)) calc(var(--Badge-paddingX) - var(--variant-borderWidth, 0px))', + padding: '0 calc(var(--Badge-paddingX) - var(--variant-borderWidth, 0px))', minHeight: 'var(--Badge-minHeight)', minWidth: 'var(--Badge-minHeight)', borderRadius: 'var(--Badge-radius, var(--Badge-minHeight))', @@ -131,6 +129,8 @@ const BadgeBadge = styled('span', { [`&.${badgeClasses.invisible}`]: { transform: `scale(0) ${translateX} ${translateY}`, }, + ...typography, + fontWeight: theme.vars.fontWeight.md, ...theme.variants[ownerState.variant!]?.[ownerState.color!], }; }); @@ -262,7 +262,7 @@ Badge.propTypes /* remove-proptypes */ = { * @default 'primary' */ color: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([ - PropTypes.oneOf(['danger', 'info', 'neutral', 'primary', 'success', 'warning']), + PropTypes.oneOf(['danger', 'neutral', 'primary', 'success', 'warning']), PropTypes.string, ]), /** diff --git a/packages/mui-joy/src/Badge/badgeClasses.ts b/packages/mui-joy/src/Badge/badgeClasses.ts index 7eb357e4524186..b1a09c78215ad0 100644 --- a/packages/mui-joy/src/Badge/badgeClasses.ts +++ b/packages/mui-joy/src/Badge/badgeClasses.ts @@ -17,8 +17,6 @@ export interface BadgeClasses { colorPrimary: string; /** Class name applied to the badge `span` element if `color="danger"`. */ colorDanger: string; - /** Class name applied to the badge `span` element if `color="info"`. */ - colorInfo: string; /** Class name applied to the badge `span` element if `color="neutral"`. */ colorNeutral: string; /** Class name applied to the badge `span` element if `color="success"`. */ @@ -64,7 +62,6 @@ const badgeClasses: BadgeClasses = generateUtilityClasses('MuiBadge', [ 'anchorOriginBottomLeft', 'colorPrimary', 'colorDanger', - 'colorInfo', 'colorNeutral', 'colorSuccess', 'colorWarning', diff --git a/packages/mui-joy/src/Box/Box.spec.tsx b/packages/mui-joy/src/Box/Box.spec.tsx index 7b3662b686389d..ca49fa91520c91 100644 --- a/packages/mui-joy/src/Box/Box.spec.tsx +++ b/packages/mui-joy/src/Box/Box.spec.tsx @@ -5,7 +5,7 @@ function ThemeValuesCanBeSpread() { ; ({ - ...theme.typography.body1, + ...theme.typography['body-md'], color: theme.palette.primary[500], })} />; @@ -17,7 +17,7 @@ function ThemeValuesCanBeSpread() { />; theme.variants.outlined, (theme) => ({ '&:hover': theme.variants.outlinedHover, diff --git a/packages/mui-joy/src/Breadcrumbs/Breadcrumbs.tsx b/packages/mui-joy/src/Breadcrumbs/Breadcrumbs.tsx index 0befd96117fd15..e228d46a9bf6ad 100644 --- a/packages/mui-joy/src/Breadcrumbs/Breadcrumbs.tsx +++ b/packages/mui-joy/src/Breadcrumbs/Breadcrumbs.tsx @@ -2,7 +2,10 @@ import * as React from 'react'; import PropTypes from 'prop-types'; import { OverridableComponent } from '@mui/types'; -import { unstable_capitalize as capitalize } from '@mui/utils'; +import { + unstable_capitalize as capitalize, + unstable_isMuiElement as isMuiElement, +} from '@mui/utils'; import { unstable_composeClasses as composeClasses } from '@mui/base'; import clsx from 'clsx'; import { useThemeProps } from '../styles'; @@ -10,6 +13,7 @@ import useSlot from '../utils/useSlot'; import styled from '../styles/styled'; import { getBreadcrumbsUtilityClass } from './breadcrumbsClasses'; import { BreadcrumbsProps, BreadcrumbsOwnerState, BreadcrumbsTypeMap } from './BreadcrumbsProps'; +import { TypographyInheritContext } from '../Typography/Typography'; const useUtilityClasses = (ownerState: BreadcrumbsOwnerState) => { const { size } = ownerState; @@ -31,20 +35,17 @@ const BreadcrumbsRoot = styled('nav', { })<{ ownerState: BreadcrumbsOwnerState }>(({ theme, ownerState }) => ({ ...(ownerState.size === 'sm' && { '--Breadcrumbs-gap': '0.25rem', - fontSize: theme.vars.fontSize.sm, padding: '0.5rem', }), ...(ownerState.size === 'md' && { '--Breadcrumbs-gap': '0.375rem', - fontSize: theme.vars.fontSize.md, padding: '0.75rem', }), ...(ownerState.size === 'lg' && { '--Breadcrumbs-gap': '0.5rem', - fontSize: theme.vars.fontSize.lg, padding: '1rem', }), - lineHeight: 1, + ...theme.typography[`body-${ownerState.size!}`], })); const BreadcrumbsOl = styled('ol', { @@ -63,9 +64,12 @@ const BreadcrumbsOl = styled('ol', { const BreadcrumbsLi = styled('li', { name: 'JoyBreadcrumbs', - slot: 'Ol', - overridesResolver: (props, styles) => styles.ol, -})<{ ownerState: BreadcrumbsOwnerState }>({}); + slot: 'Li', + overridesResolver: (props, styles) => styles.li, +})<{ ownerState: BreadcrumbsOwnerState }>({ + display: 'flex', + alignItems: 'center', +}); const BreadcrumbsSeparator = styled('li', { name: 'JoyBreadcrumbs', @@ -144,34 +148,38 @@ const Breadcrumbs = React.forwardRef(function Breadcrumbs(inProps, ref) { ownerState, }); - const allItems = React.Children.toArray(children) - .filter((child) => { + const allItems = ( + React.Children.toArray(children).filter((child) => { return React.isValidElement(child); - }) - .map((child, index) => ( - - {child} - - )); + }) as Array + ).map((child, index) => ( + + {isMuiElement(child, ['Typography']) + ? React.cloneElement(child, { component: child.props.component ?? 'span' }) + : child} + + )); return ( - - - {allItems.reduce((acc: React.ReactNode[], current: React.ReactNode, index: number) => { - if (index < allItems.length - 1) { - acc = acc.concat( - current, - - {separator} - , - ); - } else { - acc.push(current); - } - return acc; - }, [])} - - + + + + {allItems.reduce((acc: React.ReactNode[], current: React.ReactNode, index: number) => { + if (index < allItems.length - 1) { + acc = acc.concat( + current, + + {separator} + , + ); + } else { + acc.push(current); + } + return acc; + }, [])} + + + ); }) as OverridableComponent; diff --git a/packages/mui-joy/src/Button/Button.spec.tsx b/packages/mui-joy/src/Button/Button.spec.tsx index f53fd0d4ed013d..40f5642e216e03 100644 --- a/packages/mui-joy/src/Button/Button.spec.tsx +++ b/packages/mui-joy/src/Button/Button.spec.tsx @@ -29,7 +29,6 @@ function handleClick4(event: React.MouseEvent) {} ; ; ; -; ; ; // @ts-expect-error no `black` color diff --git a/packages/mui-joy/src/Button/Button.test.tsx b/packages/mui-joy/src/Button/Button.test.tsx index 4906a03a210910..a1271e18fc3d6f 100644 --- a/packages/mui-joy/src/Button/Button.test.tsx +++ b/packages/mui-joy/src/Button/Button.test.tsx @@ -130,7 +130,7 @@ describe('Joy