diff --git a/docs/data/base/components/autocomplete/AutocompleteIntroduction/system/index.js b/docs/data/base/components/autocomplete/AutocompleteIntroduction/system/index.js index 47593a14592705..b5adaa20c616cf 100644 --- a/docs/data/base/components/autocomplete/AutocompleteIntroduction/system/index.js +++ b/docs/data/base/components/autocomplete/AutocompleteIntroduction/system/index.js @@ -122,6 +122,7 @@ const blue = { 400: '#3399FF', 500: '#007FFF', 600: '#0072E5', + 700: '#0059B2', 900: '#003A75', }; @@ -146,8 +147,8 @@ const StyledAutocompleteRoot = styled('div')( color: ${theme.palette.mode === 'dark' ? grey[300] : grey[500]}; background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'}; border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; - box-shadow: 0px 4px 6px ${ - theme.palette.mode === 'dark' ? 'rgba(0,0,0, 0.50)' : 'rgba(0,0,0, 0.05)' + box-shadow: 0px 2px 4px ${ + theme.palette.mode === 'dark' ? 'rgba(0,0,0, 0.5)' : 'rgba(0,0,0, 0.05)' }; display: flex; gap: 5px; @@ -157,7 +158,7 @@ const StyledAutocompleteRoot = styled('div')( &.focused { border-color: ${blue[400]}; - box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[500] : blue[200]}; + box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[700] : blue[200]}; } &:hover { @@ -211,7 +212,7 @@ const StyledListbox = styled('ul')( border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]}; box-shadow: 0px 4px 6px ${ - theme.palette.mode === 'dark' ? 'rgba(0,0,0, 0.50)' : 'rgba(0,0,0, 0.05)' + theme.palette.mode === 'dark' ? 'rgba(0,0,0, 0.3)' : 'rgba(0,0,0, 0.05)' }; `, ); diff --git a/docs/data/base/components/autocomplete/AutocompleteIntroduction/system/index.tsx b/docs/data/base/components/autocomplete/AutocompleteIntroduction/system/index.tsx index 32447970f4c752..7ef07de478eb8e 100644 --- a/docs/data/base/components/autocomplete/AutocompleteIntroduction/system/index.tsx +++ b/docs/data/base/components/autocomplete/AutocompleteIntroduction/system/index.tsx @@ -105,6 +105,7 @@ const blue = { 400: '#3399FF', 500: '#007FFF', 600: '#0072E5', + 700: '#0059B2', 900: '#003A75', }; @@ -129,8 +130,8 @@ const StyledAutocompleteRoot = styled('div')( color: ${theme.palette.mode === 'dark' ? grey[300] : grey[500]}; background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'}; border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; - box-shadow: 0px 4px 6px ${ - theme.palette.mode === 'dark' ? 'rgba(0,0,0, 0.50)' : 'rgba(0,0,0, 0.05)' + box-shadow: 0px 2px 4px ${ + theme.palette.mode === 'dark' ? 'rgba(0,0,0, 0.5)' : 'rgba(0,0,0, 0.05)' }; display: flex; gap: 5px; @@ -140,7 +141,7 @@ const StyledAutocompleteRoot = styled('div')( &.focused { border-color: ${blue[400]}; - box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[500] : blue[200]}; + box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[700] : blue[200]}; } &:hover { @@ -194,7 +195,7 @@ const StyledListbox = styled('ul')( border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]}; box-shadow: 0px 4px 6px ${ - theme.palette.mode === 'dark' ? 'rgba(0,0,0, 0.50)' : 'rgba(0,0,0, 0.05)' + theme.palette.mode === 'dark' ? 'rgba(0,0,0, 0.3)' : 'rgba(0,0,0, 0.05)' }; `, ); diff --git a/docs/data/base/components/autocomplete/AutocompleteIntroduction/tailwind/index.js b/docs/data/base/components/autocomplete/AutocompleteIntroduction/tailwind/index.js index d80f7a1d5c54f7..05dbe02b814927 100644 --- a/docs/data/base/components/autocomplete/AutocompleteIntroduction/tailwind/index.js +++ b/docs/data/base/components/autocomplete/AutocompleteIntroduction/tailwind/index.js @@ -79,7 +79,7 @@ const Autocomplete = React.forwardRef(function Autocomplete(props, ref) { /> - {anchorEl ? ( + {anchorEl && ( - ) : null} + )} ); }); diff --git a/docs/data/base/components/autocomplete/AutocompleteIntroduction/tailwind/index.tsx b/docs/data/base/components/autocomplete/AutocompleteIntroduction/tailwind/index.tsx index bb3f5d16d9cbaf..fc4cb52385565b 100644 --- a/docs/data/base/components/autocomplete/AutocompleteIntroduction/tailwind/index.tsx +++ b/docs/data/base/components/autocomplete/AutocompleteIntroduction/tailwind/index.tsx @@ -80,7 +80,7 @@ const Autocomplete = React.forwardRef(function Autocomplete( /> - {anchorEl ? ( + {anchorEl && ( - ) : null} + )} ); }); diff --git a/docs/data/base/components/autocomplete/ControlledStates.js b/docs/data/base/components/autocomplete/ControlledStates.js index e795ac73d10e07..d94672d0c49044 100644 --- a/docs/data/base/components/autocomplete/ControlledStates.js +++ b/docs/data/base/components/autocomplete/ControlledStates.js @@ -56,6 +56,7 @@ const blue = { 400: '#3399FF', 500: '#007FFF', 600: '#0072E5', + 700: '#0059B2', 900: '#003A75', }; @@ -74,7 +75,6 @@ const grey = { const StyledAutocomplete = styled('div')` position: relative; - margin: 1.5rem 0; `; const StyledInputRoot = styled('div')( @@ -85,7 +85,9 @@ const StyledInputRoot = styled('div')( color: ${theme.palette.mode === 'dark' ? grey[300] : grey[500]}; background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'}; border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; - box-shadow: 0px 2px 2px ${theme.palette.mode === 'dark' ? grey[900] : grey[50]}; + box-shadow: 0px 2px 4px ${ + theme.palette.mode === 'dark' ? 'rgba(0,0,0, 0.5)' : 'rgba(0,0,0, 0.05)' + }; display: flex; gap: 5px; padding-right: 5px; @@ -94,7 +96,7 @@ const StyledInputRoot = styled('div')( &.focused { border-color: ${blue[400]}; - box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[500] : blue[200]}; + box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[700] : blue[200]}; } &:hover { @@ -142,7 +144,9 @@ const StyledListbox = styled('ul')( background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'}; border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]}; - box-shadow: 0px 4px 30px ${theme.palette.mode === 'dark' ? grey[900] : grey[200]}; + box-shadow: 0px 4px 6px ${ + theme.palette.mode === 'dark' ? 'rgba(0,0,0, 0.50)' : 'rgba(0,0,0, 0.05)' + }; `, ); @@ -187,12 +191,16 @@ const StyledOption = styled('li')( const Layout = styled('div')` display: flex; flex-flow: column nowrap; + gap: 4px; `; const Pre = styled('pre')(({ theme }) => ({ margin: '0.5rem 0', + fontSize: '0.75rem', '& code': { - backgroundColor: theme.palette.mode === 'light' ? '#ebebef' : '#25252d', + backgroundColor: theme.palette.mode === 'light' ? grey[100] : grey[900], + border: '1px solid', + borderColor: theme.palette.mode === 'light' ? grey[300] : grey[700], color: theme.palette.mode === 'light' ? '#000' : '#fff', padding: '0.125rem 0.25rem', borderRadius: 3, diff --git a/docs/data/base/components/autocomplete/ControlledStates.tsx b/docs/data/base/components/autocomplete/ControlledStates.tsx index 4bb540fe33578c..2c6406829eeb74 100644 --- a/docs/data/base/components/autocomplete/ControlledStates.tsx +++ b/docs/data/base/components/autocomplete/ControlledStates.tsx @@ -56,6 +56,7 @@ const blue = { 400: '#3399FF', 500: '#007FFF', 600: '#0072E5', + 700: '#0059B2', 900: '#003A75', }; @@ -74,7 +75,6 @@ const grey = { const StyledAutocomplete = styled('div')` position: relative; - margin: 1.5rem 0; `; const StyledInputRoot = styled('div')( @@ -85,7 +85,9 @@ const StyledInputRoot = styled('div')( color: ${theme.palette.mode === 'dark' ? grey[300] : grey[500]}; background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'}; border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; - box-shadow: 0px 2px 2px ${theme.palette.mode === 'dark' ? grey[900] : grey[50]}; + box-shadow: 0px 2px 4px ${ + theme.palette.mode === 'dark' ? 'rgba(0,0,0, 0.5)' : 'rgba(0,0,0, 0.05)' + }; display: flex; gap: 5px; padding-right: 5px; @@ -94,7 +96,7 @@ const StyledInputRoot = styled('div')( &.focused { border-color: ${blue[400]}; - box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[500] : blue[200]}; + box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[700] : blue[200]}; } &:hover { @@ -142,7 +144,9 @@ const StyledListbox = styled('ul')( background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'}; border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]}; - box-shadow: 0px 4px 30px ${theme.palette.mode === 'dark' ? grey[900] : grey[200]}; + box-shadow: 0px 4px 6px ${ + theme.palette.mode === 'dark' ? 'rgba(0,0,0, 0.50)' : 'rgba(0,0,0, 0.05)' + }; `, ); @@ -187,12 +191,16 @@ const StyledOption = styled('li')( const Layout = styled('div')` display: flex; flex-flow: column nowrap; + gap: 4px; `; const Pre = styled('pre')(({ theme }) => ({ margin: '0.5rem 0', + fontSize: '0.75rem', '& code': { - backgroundColor: theme.palette.mode === 'light' ? '#ebebef' : '#25252d', + backgroundColor: theme.palette.mode === 'light' ? grey[100] : grey[900], + border: '1px solid', + borderColor: theme.palette.mode === 'light' ? grey[300] : grey[700], color: theme.palette.mode === 'light' ? '#000' : '#fff', padding: '0.125rem 0.25rem', borderRadius: 3, diff --git a/docs/data/base/components/autocomplete/UseAutocomplete.js b/docs/data/base/components/autocomplete/UseAutocomplete.js index 47acbc2343b82a..1f23f2985c422a 100644 --- a/docs/data/base/components/autocomplete/UseAutocomplete.js +++ b/docs/data/base/components/autocomplete/UseAutocomplete.js @@ -49,6 +49,7 @@ const blue = { 400: '#3399FF', 500: '#007FFF', 600: '#0072E5', + 700: '#0059B2', 900: '#003A75', }; @@ -81,7 +82,9 @@ const StyledAutocompleteRoot = styled('div')( color: ${theme.palette.mode === 'dark' ? grey[300] : grey[500]}; background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'}; border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; - box-shadow: 0px 2px 2px ${theme.palette.mode === 'dark' ? grey[900] : grey[50]}; + box-shadow: 0px 2px 4px ${ + theme.palette.mode === 'dark' ? 'rgba(0,0,0, 0.5)' : 'rgba(0,0,0, 0.05)' + }; display: flex; gap: 5px; padding-right: 5px; @@ -90,7 +93,7 @@ const StyledAutocompleteRoot = styled('div')( &.focused { border-color: ${blue[400]}; - box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[500] : blue[200]}; + box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[600] : blue[200]}; } &:hover { @@ -136,7 +139,7 @@ const StyledListbox = styled('ul')( background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'}; border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]}; - box-shadow: 0px 4px 6px ${ + box-shadow: 0px 2px 3px ${ theme.palette.mode === 'dark' ? 'rgba(0,0,0, 0.50)' : 'rgba(0,0,0, 0.05)' }; `, diff --git a/docs/data/base/components/autocomplete/UseAutocomplete.tsx b/docs/data/base/components/autocomplete/UseAutocomplete.tsx index be8b95aa2e66db..6b0e9701dc0f3b 100644 --- a/docs/data/base/components/autocomplete/UseAutocomplete.tsx +++ b/docs/data/base/components/autocomplete/UseAutocomplete.tsx @@ -51,6 +51,7 @@ const blue = { 400: '#3399FF', 500: '#007FFF', 600: '#0072E5', + 700: '#0059B2', 900: '#003A75', }; @@ -83,7 +84,9 @@ const StyledAutocompleteRoot = styled('div')( color: ${theme.palette.mode === 'dark' ? grey[300] : grey[500]}; background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'}; border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; - box-shadow: 0px 2px 2px ${theme.palette.mode === 'dark' ? grey[900] : grey[50]}; + box-shadow: 0px 2px 4px ${ + theme.palette.mode === 'dark' ? 'rgba(0,0,0, 0.5)' : 'rgba(0,0,0, 0.05)' + }; display: flex; gap: 5px; padding-right: 5px; @@ -92,7 +95,7 @@ const StyledAutocompleteRoot = styled('div')( &.focused { border-color: ${blue[400]}; - box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[500] : blue[200]}; + box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[600] : blue[200]}; } &:hover { @@ -138,7 +141,7 @@ const StyledListbox = styled('ul')( background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'}; border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]}; - box-shadow: 0px 4px 6px ${ + box-shadow: 0px 2px 3px ${ theme.palette.mode === 'dark' ? 'rgba(0,0,0, 0.50)' : 'rgba(0,0,0, 0.05)' }; `, diff --git a/docs/data/base/components/autocomplete/UseAutocompletePopper.js b/docs/data/base/components/autocomplete/UseAutocompletePopper.js index 1953f2a977ee5c..eeb08684a1c36f 100644 --- a/docs/data/base/components/autocomplete/UseAutocompletePopper.js +++ b/docs/data/base/components/autocomplete/UseAutocompletePopper.js @@ -69,6 +69,7 @@ const blue = { 400: '#3399FF', 500: '#007FFF', 600: '#0072E5', + 700: '#0059B2', 900: '#003A75', }; @@ -93,7 +94,9 @@ const StyledAutocompleteRoot = styled('div')( color: ${theme.palette.mode === 'dark' ? grey[300] : grey[500]}; background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'}; border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; - box-shadow: 0px 2px 2px ${theme.palette.mode === 'dark' ? grey[900] : grey[50]}; + box-shadow: 0px 2px 4px ${ + theme.palette.mode === 'dark' ? 'rgba(0,0,0, 0.5)' : 'rgba(0,0,0, 0.05)' + }; display: flex; gap: 5px; padding-right: 5px; @@ -103,7 +106,7 @@ const StyledAutocompleteRoot = styled('div')( &.focused { border-color: ${blue[400]}; - box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[500] : blue[200]}; + box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[700] : blue[200]}; } &:hover { @@ -155,7 +158,9 @@ const StyledListbox = styled('ul')( background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'}; border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]}; - box-shadow: 0px 4px 30px ${theme.palette.mode === 'dark' ? grey[900] : grey[200]}; + box-shadow: 0px 4px 6px ${ + theme.palette.mode === 'dark' ? 'rgba(0,0,0, 0.50)' : 'rgba(0,0,0, 0.05)' + }; `, ); diff --git a/docs/data/base/components/autocomplete/UseAutocompletePopper.tsx b/docs/data/base/components/autocomplete/UseAutocompletePopper.tsx index 64a624887ccdf0..ad4f1ecac192f0 100644 --- a/docs/data/base/components/autocomplete/UseAutocompletePopper.tsx +++ b/docs/data/base/components/autocomplete/UseAutocompletePopper.tsx @@ -77,6 +77,7 @@ const blue = { 400: '#3399FF', 500: '#007FFF', 600: '#0072E5', + 700: '#0059B2', 900: '#003A75', }; @@ -101,7 +102,9 @@ const StyledAutocompleteRoot = styled('div')( color: ${theme.palette.mode === 'dark' ? grey[300] : grey[500]}; background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'}; border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; - box-shadow: 0px 2px 2px ${theme.palette.mode === 'dark' ? grey[900] : grey[50]}; + box-shadow: 0px 2px 4px ${ + theme.palette.mode === 'dark' ? 'rgba(0,0,0, 0.5)' : 'rgba(0,0,0, 0.05)' + }; display: flex; gap: 5px; padding-right: 5px; @@ -111,7 +114,7 @@ const StyledAutocompleteRoot = styled('div')( &.focused { border-color: ${blue[400]}; - box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[500] : blue[200]}; + box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[700] : blue[200]}; } &:hover { @@ -163,7 +166,9 @@ const StyledListbox = styled('ul')( background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'}; border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]}; - box-shadow: 0px 4px 30px ${theme.palette.mode === 'dark' ? grey[900] : grey[200]}; + box-shadow: 0px 4px 6px ${ + theme.palette.mode === 'dark' ? 'rgba(0,0,0, 0.50)' : 'rgba(0,0,0, 0.05)' + }; `, ); diff --git a/docs/data/base/components/badge/BadgeVisibility.js b/docs/data/base/components/badge/BadgeVisibility.js index 270e118fe342a2..aa692503627ce3 100644 --- a/docs/data/base/components/badge/BadgeVisibility.js +++ b/docs/data/base/components/badge/BadgeVisibility.js @@ -1,92 +1,44 @@ import * as React from 'react'; -import Box from '@mui/material/Box'; -import { styled } from '@mui/system'; import { Badge as BaseBadge, badgeClasses } from '@mui/base/Badge'; -import ButtonGroup from '@mui/material/ButtonGroup'; -import Button from '@mui/material/Button'; +// Auxiliary demo components +import { styled, Stack } from '@mui/system'; +import { Button, buttonClasses } from '@mui/base/Button'; +import { Switch, switchClasses } from '@mui/base/Switch'; +import Divider from '@mui/material/Divider'; +// Icons import AddIcon from '@mui/icons-material/Add'; import RemoveIcon from '@mui/icons-material/Remove'; import MailIcon from '@mui/icons-material/Mail'; -import Switch from '@mui/material/Switch'; -import FormControlLabel from '@mui/material/FormControlLabel'; -export default function BadgeVisibility() { - const [count, setCount] = React.useState(1); - const [invisible, setInvisible] = React.useState(false); - - const handleBadgeVisibility = () => { - setInvisible(!invisible); - }; - - return ( - *': { - marginBottom: 2, - }, - [`& .${badgeClasses.root}`]: { - marginRight: 4, - }, - }} - > -
- - - - - - - -
-
- - - - } - label="Show Badge" - /> -
-
- ); -} const blue = { + 200: '#99CCF3', 500: '#007FFF', }; const grey = { + 50: '#f6f8fa', + 100: '#eaeef2', + 200: '#d0d7de', 300: '#afb8c1', + 400: '#8c959f', + 500: '#6e7781', + 600: '#57606a', + 700: '#424a53', + 800: '#32383f', 900: '#24292f', }; const Badge = styled(BaseBadge)( ({ theme }) => ` box-sizing: border-box; + position: relative; + display: flex; + align-self: center; margin: 0; padding: 0; - font-size: 14px; list-style: none; font-family: IBM Plex Sans, sans-serif; - position: relative; - display: inline-block; + font-size: 14px; line-height: 1; & .${badgeClasses.badge} { @@ -107,7 +59,7 @@ const Badge = styled(BaseBadge)( background: ${blue[500]}; box-shadow: 0px 4px 6x ${theme.palette.mode === 'dark' ? grey[900] : grey[300]}; transform: translate(50%, -50%); - transform-origin: 100% 0; + transform-origin: 100% 0; } & .${badgeClasses.invisible} { @@ -116,3 +68,152 @@ const Badge = styled(BaseBadge)( } `, ); + +const StyledButton = styled(Button)( + ({ theme }) => ` + cursor: pointer; + padding: 4px 8px; + display: flex; + align-items: center; + border-radius: 8px; + transition: all 150ms ease; + background-color: transparent; + border: 1px solid ${theme.palette.mode === 'dark' ? grey[800] : grey[200]}; + + &:hover { + background: ${theme.palette.mode === 'dark' ? grey[800] : grey[50]}; + } + + &.${buttonClasses.active} { + background: ${theme.palette.mode === 'dark' ? grey[900] : grey[100]}; + } + + &.${buttonClasses.focusVisible} { + box-shadow: 0 3px 20px 0 rgba(61, 71, 82, 0.1), 0 0 0 4px rgba(0, 127, 255, 0.5); + outline: none; + } + `, +); + +const Root = styled('span')( + ({ theme }) => ` + position: relative; + display: inline-block; + width: 32px; + height: 20px; + cursor: pointer; + + + & .${switchClasses.track} { + background: ${theme.palette.mode === 'dark' ? grey[600] : grey[400]}; + border-radius: 16px; + display: block; + height: 100%; + width: 100%; + position: absolute; + } + + & .${switchClasses.thumb} { + position: relative; + display: block; + width: 14px; + height: 14px; + top: 3px; + left: 3px; + border-radius: 16px; + background-color: #fff; + transition-property: all; + transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); + transition-duration: 120ms; + } + + &.${switchClasses.focusVisible} .${switchClasses.track} { + box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? grey[700] : blue[200]}; + } + + &.${switchClasses.checked} { + .${switchClasses.thumb} { + left: 15px; + top: 3px; + background-color: #fff; + } + + .${switchClasses.track} { + background: ${blue[500]}; + } + } + + & .${switchClasses.input} { + cursor: inherit; + position: absolute; + width: 100%; + height: 100%; + top: 0; + left: 0; + opacity: 0; + z-index: 1; + margin: 0; + } + `, +); + +const StyledLabel = styled('label')( + ({ theme }) => ` + font-family: IBM Plex Sans, sans-serif; + font-size: 0.875rem; + color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]}; + `, +); + +export default function BadgeVisibility() { + const [count, setCount] = React.useState(1); + const [invisible, setInvisible] = React.useState(false); + + const handleBadgeVisibility = () => { + setInvisible(!invisible); + }; + + return ( + + + + + + + { + setCount(Math.max(count - 1, 0)); + }} + > + + + { + setCount(count + 1); + }} + > + + + + + Show badge + + + + + ); +} diff --git a/docs/data/base/components/badge/BadgeVisibility.tsx b/docs/data/base/components/badge/BadgeVisibility.tsx index 270e118fe342a2..aa692503627ce3 100644 --- a/docs/data/base/components/badge/BadgeVisibility.tsx +++ b/docs/data/base/components/badge/BadgeVisibility.tsx @@ -1,92 +1,44 @@ import * as React from 'react'; -import Box from '@mui/material/Box'; -import { styled } from '@mui/system'; import { Badge as BaseBadge, badgeClasses } from '@mui/base/Badge'; -import ButtonGroup from '@mui/material/ButtonGroup'; -import Button from '@mui/material/Button'; +// Auxiliary demo components +import { styled, Stack } from '@mui/system'; +import { Button, buttonClasses } from '@mui/base/Button'; +import { Switch, switchClasses } from '@mui/base/Switch'; +import Divider from '@mui/material/Divider'; +// Icons import AddIcon from '@mui/icons-material/Add'; import RemoveIcon from '@mui/icons-material/Remove'; import MailIcon from '@mui/icons-material/Mail'; -import Switch from '@mui/material/Switch'; -import FormControlLabel from '@mui/material/FormControlLabel'; -export default function BadgeVisibility() { - const [count, setCount] = React.useState(1); - const [invisible, setInvisible] = React.useState(false); - - const handleBadgeVisibility = () => { - setInvisible(!invisible); - }; - - return ( - *': { - marginBottom: 2, - }, - [`& .${badgeClasses.root}`]: { - marginRight: 4, - }, - }} - > -
- - - - - - - -
-
- - - - } - label="Show Badge" - /> -
-
- ); -} const blue = { + 200: '#99CCF3', 500: '#007FFF', }; const grey = { + 50: '#f6f8fa', + 100: '#eaeef2', + 200: '#d0d7de', 300: '#afb8c1', + 400: '#8c959f', + 500: '#6e7781', + 600: '#57606a', + 700: '#424a53', + 800: '#32383f', 900: '#24292f', }; const Badge = styled(BaseBadge)( ({ theme }) => ` box-sizing: border-box; + position: relative; + display: flex; + align-self: center; margin: 0; padding: 0; - font-size: 14px; list-style: none; font-family: IBM Plex Sans, sans-serif; - position: relative; - display: inline-block; + font-size: 14px; line-height: 1; & .${badgeClasses.badge} { @@ -107,7 +59,7 @@ const Badge = styled(BaseBadge)( background: ${blue[500]}; box-shadow: 0px 4px 6x ${theme.palette.mode === 'dark' ? grey[900] : grey[300]}; transform: translate(50%, -50%); - transform-origin: 100% 0; + transform-origin: 100% 0; } & .${badgeClasses.invisible} { @@ -116,3 +68,152 @@ const Badge = styled(BaseBadge)( } `, ); + +const StyledButton = styled(Button)( + ({ theme }) => ` + cursor: pointer; + padding: 4px 8px; + display: flex; + align-items: center; + border-radius: 8px; + transition: all 150ms ease; + background-color: transparent; + border: 1px solid ${theme.palette.mode === 'dark' ? grey[800] : grey[200]}; + + &:hover { + background: ${theme.palette.mode === 'dark' ? grey[800] : grey[50]}; + } + + &.${buttonClasses.active} { + background: ${theme.palette.mode === 'dark' ? grey[900] : grey[100]}; + } + + &.${buttonClasses.focusVisible} { + box-shadow: 0 3px 20px 0 rgba(61, 71, 82, 0.1), 0 0 0 4px rgba(0, 127, 255, 0.5); + outline: none; + } + `, +); + +const Root = styled('span')( + ({ theme }) => ` + position: relative; + display: inline-block; + width: 32px; + height: 20px; + cursor: pointer; + + + & .${switchClasses.track} { + background: ${theme.palette.mode === 'dark' ? grey[600] : grey[400]}; + border-radius: 16px; + display: block; + height: 100%; + width: 100%; + position: absolute; + } + + & .${switchClasses.thumb} { + position: relative; + display: block; + width: 14px; + height: 14px; + top: 3px; + left: 3px; + border-radius: 16px; + background-color: #fff; + transition-property: all; + transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); + transition-duration: 120ms; + } + + &.${switchClasses.focusVisible} .${switchClasses.track} { + box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? grey[700] : blue[200]}; + } + + &.${switchClasses.checked} { + .${switchClasses.thumb} { + left: 15px; + top: 3px; + background-color: #fff; + } + + .${switchClasses.track} { + background: ${blue[500]}; + } + } + + & .${switchClasses.input} { + cursor: inherit; + position: absolute; + width: 100%; + height: 100%; + top: 0; + left: 0; + opacity: 0; + z-index: 1; + margin: 0; + } + `, +); + +const StyledLabel = styled('label')( + ({ theme }) => ` + font-family: IBM Plex Sans, sans-serif; + font-size: 0.875rem; + color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]}; + `, +); + +export default function BadgeVisibility() { + const [count, setCount] = React.useState(1); + const [invisible, setInvisible] = React.useState(false); + + const handleBadgeVisibility = () => { + setInvisible(!invisible); + }; + + return ( + + + + + + + { + setCount(Math.max(count - 1, 0)); + }} + > + + + { + setCount(count + 1); + }} + > + + + + + Show badge + + + + + ); +} diff --git a/docs/data/base/components/button/UnstyledButtonCustom.js b/docs/data/base/components/button/UnstyledButtonCustom.js index 4f4e2399fafeaf..c057fef09c7499 100644 --- a/docs/data/base/components/button/UnstyledButtonCustom.js +++ b/docs/data/base/components/button/UnstyledButtonCustom.js @@ -35,7 +35,8 @@ const blue = { 200: '#99CCF3', 400: '#3399FF', 500: '#007FFF', - 600: '#0072E5', + 600: '#0072E6', + 700: '#0059B3', 800: '#004C99', 900: '#003A75', }; @@ -44,7 +45,7 @@ const CustomButtonRoot = styled(ButtonRoot)( ({ theme }) => ` overflow: visible; cursor: pointer; - --main-color: ${theme.palette.mode === 'light' ? blue[600] : blue[100]}; + --main-color: ${theme.palette.mode === 'light' ? blue[600] : blue[200]}; --hover-color: ${theme.palette.mode === 'light' ? blue[50] : blue[900]}; --active-color: ${theme.palette.mode === 'light' ? blue[100] : blue[800]}; @@ -57,15 +58,15 @@ const CustomButtonRoot = styled(ButtonRoot)( & .bg { stroke: var(--main-color); stroke-width: 1; - filter: drop-shadow(0 4px 20px rgba(0, 0, 0, 0.1)); + filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.1)); fill: transparent; } & .borderEffect { stroke: var(--main-color); stroke-width: 2; - stroke-dasharray: 150 600; - stroke-dashoffset: 150; + stroke-dasharray: 120 600; + stroke-dashoffset: 120; fill: transparent; } @@ -82,14 +83,14 @@ const CustomButtonRoot = styled(ButtonRoot)( &:focus, &.${buttonClasses.focusVisible} { - outline: 2px solid ${theme.palette.mode === 'dark' ? blue[400] : blue[200]}; + outline: 2px solid ${theme.palette.mode === 'dark' ? blue[700] : blue[200]}; outline-offset: 2px; } &.${buttonClasses.active} { & .bg { fill: var(--active-color); - transition: fill 300ms ease-out; + transition: fill 150ms ease-out; } } @@ -106,11 +107,10 @@ const CustomButtonRoot = styled(ButtonRoot)( align-items: center; justify-content: center; color: var(--main-color); - text-transform: uppercase; } & svg { - margin: 0 5px; + margin: 0 4px; } }`, ); diff --git a/docs/data/base/components/button/UnstyledButtonCustom.tsx b/docs/data/base/components/button/UnstyledButtonCustom.tsx index 72413739662779..e98295562540a0 100644 --- a/docs/data/base/components/button/UnstyledButtonCustom.tsx +++ b/docs/data/base/components/button/UnstyledButtonCustom.tsx @@ -36,7 +36,8 @@ const blue = { 200: '#99CCF3', 400: '#3399FF', 500: '#007FFF', - 600: '#0072E5', + 600: '#0072E6', + 700: '#0059B3', 800: '#004C99', 900: '#003A75', }; @@ -45,7 +46,7 @@ const CustomButtonRoot = styled(ButtonRoot)( ({ theme }: { theme: Theme }) => ` overflow: visible; cursor: pointer; - --main-color: ${theme.palette.mode === 'light' ? blue[600] : blue[100]}; + --main-color: ${theme.palette.mode === 'light' ? blue[600] : blue[200]}; --hover-color: ${theme.palette.mode === 'light' ? blue[50] : blue[900]}; --active-color: ${theme.palette.mode === 'light' ? blue[100] : blue[800]}; @@ -58,15 +59,15 @@ const CustomButtonRoot = styled(ButtonRoot)( & .bg { stroke: var(--main-color); stroke-width: 1; - filter: drop-shadow(0 4px 20px rgba(0, 0, 0, 0.1)); + filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.1)); fill: transparent; } & .borderEffect { stroke: var(--main-color); stroke-width: 2; - stroke-dasharray: 150 600; - stroke-dashoffset: 150; + stroke-dasharray: 120 600; + stroke-dashoffset: 120; fill: transparent; } @@ -83,14 +84,14 @@ const CustomButtonRoot = styled(ButtonRoot)( &:focus, &.${buttonClasses.focusVisible} { - outline: 2px solid ${theme.palette.mode === 'dark' ? blue[400] : blue[200]}; + outline: 2px solid ${theme.palette.mode === 'dark' ? blue[700] : blue[200]}; outline-offset: 2px; } &.${buttonClasses.active} { & .bg { fill: var(--active-color); - transition: fill 300ms ease-out; + transition: fill 150ms ease-out; } } @@ -107,11 +108,10 @@ const CustomButtonRoot = styled(ButtonRoot)( align-items: center; justify-content: center; color: var(--main-color); - text-transform: uppercase; } & svg { - margin: 0 5px; + margin: 0 4px; } }`, ); diff --git a/docs/data/base/components/button/UnstyledButtonIntroduction/css/index.js b/docs/data/base/components/button/UnstyledButtonIntroduction/css/index.js index 3dae77721c653b..d4b3d39c329352 100644 --- a/docs/data/base/components/button/UnstyledButtonIntroduction/css/index.js +++ b/docs/data/base/components/button/UnstyledButtonIntroduction/css/index.js @@ -1,5 +1,6 @@ import * as React from 'react'; -import { Button, buttonClasses } from '@mui/base/Button'; +import { Button } from '@mui/base/Button'; +import { useTheme } from '@mui/system'; import Stack from '@mui/material/Stack'; export default function UnstyledButtonsIntroduction() { @@ -29,11 +30,24 @@ const cyan = { 900: '#022127', }; +const grey = { + 200: '#d0d7de', + 700: '#424a53', +}; + +function useIsDarkMode() { + const theme = useTheme(); + return theme.palette.mode === 'dark'; +} + function Styles() { + // Replace this with your app logic for determining dark mode + const isDarkMode = useIsDarkMode(); + return ( ); diff --git a/docs/data/base/components/button/UnstyledButtonIntroduction/css/index.tsx b/docs/data/base/components/button/UnstyledButtonIntroduction/css/index.tsx index 3dae77721c653b..d4b3d39c329352 100644 --- a/docs/data/base/components/button/UnstyledButtonIntroduction/css/index.tsx +++ b/docs/data/base/components/button/UnstyledButtonIntroduction/css/index.tsx @@ -1,5 +1,6 @@ import * as React from 'react'; -import { Button, buttonClasses } from '@mui/base/Button'; +import { Button } from '@mui/base/Button'; +import { useTheme } from '@mui/system'; import Stack from '@mui/material/Stack'; export default function UnstyledButtonsIntroduction() { @@ -29,11 +30,24 @@ const cyan = { 900: '#022127', }; +const grey = { + 200: '#d0d7de', + 700: '#424a53', +}; + +function useIsDarkMode() { + const theme = useTheme(); + return theme.palette.mode === 'dark'; +} + function Styles() { + // Replace this with your app logic for determining dark mode + const isDarkMode = useIsDarkMode(); + return ( ); diff --git a/docs/data/base/components/button/UnstyledButtonIntroduction/system/index.js b/docs/data/base/components/button/UnstyledButtonIntroduction/system/index.js index b16483005ffd01..e40e926764481e 100644 --- a/docs/data/base/components/button/UnstyledButtonIntroduction/system/index.js +++ b/docs/data/base/components/button/UnstyledButtonIntroduction/system/index.js @@ -1,5 +1,5 @@ import * as React from 'react'; -import { Button as BaseButton, buttonClasses } from '@mui/base/Button'; +import { Button as BaseButton } from '@mui/base/Button'; import { styled } from '@mui/system'; import Stack from '@mui/material/Stack'; @@ -13,15 +13,17 @@ export default function UnstyledButtonsIntroduction() { } const blue = { + 200: '#99CCFF', + 300: '#66B2FF', + 400: '#3399FF', 500: '#007FFF', 600: '#0072E5', - 700: '#0059B2', + 700: '#0066CC', }; const grey = { - 100: '#eaeef2', - 300: '#afb8c1', - 900: '#24292f', + 200: '#d0d7de', + 700: '#424a53', }; const Button = styled(BaseButton)( @@ -36,25 +38,35 @@ const Button = styled(BaseButton)( color: white; transition: all 150ms ease; cursor: pointer; - border: none; - box-shadow: 0px 4px 30px ${theme.palette.mode === 'dark' ? grey[900] : grey[100]}; + border: 1px solid ${blue[500]}; + box-shadow: 0 2px 4px ${ + theme.palette.mode === 'dark' ? 'rgba(0, 0, 0, 0.5)' : 'rgba(0, 127, 255, 0.5)' + }, inset 0 1.5px 1px ${blue[400]}, inset 0 -2px 1px ${blue[600]}; &:hover { background-color: ${blue[600]}; } - &.${buttonClasses.active} { + &:active { background-color: ${blue[700]}; + box-shadow: none; } - &.${buttonClasses.focusVisible} { - box-shadow: 0 3px 20px 0 rgba(61, 71, 82, 0.1), 0 0 0 5px rgba(0, 127, 255, 0.5); + &:focus-visible { + box-shadow: 0 0 0 4px ${theme.palette.mode === 'dark' ? blue[300] : blue[200]}; outline: none; } - &.${buttonClasses.disabled} { - opacity: 0.5; + &:disabled { + background-color: ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; + color: ${theme.palette.mode === 'dark' ? grey[200] : grey[700]}; + border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; cursor: not-allowed; + box-shadow: none; + + &:hover { + background-color: ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; + } } `, ); diff --git a/docs/data/base/components/button/UnstyledButtonIntroduction/system/index.tsx b/docs/data/base/components/button/UnstyledButtonIntroduction/system/index.tsx index b16483005ffd01..e40e926764481e 100644 --- a/docs/data/base/components/button/UnstyledButtonIntroduction/system/index.tsx +++ b/docs/data/base/components/button/UnstyledButtonIntroduction/system/index.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import { Button as BaseButton, buttonClasses } from '@mui/base/Button'; +import { Button as BaseButton } from '@mui/base/Button'; import { styled } from '@mui/system'; import Stack from '@mui/material/Stack'; @@ -13,15 +13,17 @@ export default function UnstyledButtonsIntroduction() { } const blue = { + 200: '#99CCFF', + 300: '#66B2FF', + 400: '#3399FF', 500: '#007FFF', 600: '#0072E5', - 700: '#0059B2', + 700: '#0066CC', }; const grey = { - 100: '#eaeef2', - 300: '#afb8c1', - 900: '#24292f', + 200: '#d0d7de', + 700: '#424a53', }; const Button = styled(BaseButton)( @@ -36,25 +38,35 @@ const Button = styled(BaseButton)( color: white; transition: all 150ms ease; cursor: pointer; - border: none; - box-shadow: 0px 4px 30px ${theme.palette.mode === 'dark' ? grey[900] : grey[100]}; + border: 1px solid ${blue[500]}; + box-shadow: 0 2px 4px ${ + theme.palette.mode === 'dark' ? 'rgba(0, 0, 0, 0.5)' : 'rgba(0, 127, 255, 0.5)' + }, inset 0 1.5px 1px ${blue[400]}, inset 0 -2px 1px ${blue[600]}; &:hover { background-color: ${blue[600]}; } - &.${buttonClasses.active} { + &:active { background-color: ${blue[700]}; + box-shadow: none; } - &.${buttonClasses.focusVisible} { - box-shadow: 0 3px 20px 0 rgba(61, 71, 82, 0.1), 0 0 0 5px rgba(0, 127, 255, 0.5); + &:focus-visible { + box-shadow: 0 0 0 4px ${theme.palette.mode === 'dark' ? blue[300] : blue[200]}; outline: none; } - &.${buttonClasses.disabled} { - opacity: 0.5; + &:disabled { + background-color: ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; + color: ${theme.palette.mode === 'dark' ? grey[200] : grey[700]}; + border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; cursor: not-allowed; + box-shadow: none; + + &:hover { + background-color: ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; + } } `, ); diff --git a/docs/data/base/components/button/UnstyledButtonIntroduction/tailwind/index.js b/docs/data/base/components/button/UnstyledButtonIntroduction/tailwind/index.js index f887ed0d501825..96a8c746bb3d0c 100644 --- a/docs/data/base/components/button/UnstyledButtonIntroduction/tailwind/index.js +++ b/docs/data/base/components/button/UnstyledButtonIntroduction/tailwind/index.js @@ -3,23 +3,34 @@ import PropTypes from 'prop-types'; import { Button as BaseButton } from '@mui/base/Button'; import Stack from '@mui/material/Stack'; import clsx from 'clsx'; +import { useTheme } from '@mui/system'; + +function useIsDarkMode() { + const theme = useTheme(); + return theme.palette.mode === 'dark'; +} export default function UnstyledButtonsIntroduction() { + // Replace this with your app logic for determining dark mode + const isDarkMode = useIsDarkMode(); + return ( - - - - +
+ + Button + Disabled + +
); } -const Button = React.forwardRef((props, ref) => { +const CustomButton = React.forwardRef((props, ref) => { const { className, ...other } = props; return ( { ); }); -Button.propTypes = { +CustomButton.propTypes = { className: PropTypes.string, }; diff --git a/docs/data/base/components/button/UnstyledButtonIntroduction/tailwind/index.tsx b/docs/data/base/components/button/UnstyledButtonIntroduction/tailwind/index.tsx index d92fffecf769c0..8a6709ac7701e0 100644 --- a/docs/data/base/components/button/UnstyledButtonIntroduction/tailwind/index.tsx +++ b/docs/data/base/components/button/UnstyledButtonIntroduction/tailwind/index.tsx @@ -2,26 +2,39 @@ import * as React from 'react'; import { Button as BaseButton, ButtonProps } from '@mui/base/Button'; import Stack from '@mui/material/Stack'; import clsx from 'clsx'; +import { useTheme } from '@mui/system'; + +function useIsDarkMode() { + const theme = useTheme(); + return theme.palette.mode === 'dark'; +} export default function UnstyledButtonsIntroduction() { + // Replace this with your app logic for determining dark mode + const isDarkMode = useIsDarkMode(); + return ( - - - - +
+ + Button + Disabled + +
); } -const Button = React.forwardRef((props, ref) => { - const { className, ...other } = props; - return ( - - ); -}); +const CustomButton = React.forwardRef( + (props, ref) => { + const { className, ...other } = props; + return ( + + ); + }, +); diff --git a/docs/data/base/components/button/UnstyledButtonIntroduction/tailwind/index.tsx.preview b/docs/data/base/components/button/UnstyledButtonIntroduction/tailwind/index.tsx.preview index b7b5add52ab6c2..53f6465d2c7cfb 100644 --- a/docs/data/base/components/button/UnstyledButtonIntroduction/tailwind/index.tsx.preview +++ b/docs/data/base/components/button/UnstyledButtonIntroduction/tailwind/index.tsx.preview @@ -1,2 +1,4 @@ - - \ No newline at end of file + + Button + Disabled + \ No newline at end of file diff --git a/docs/data/base/components/button/UnstyledButtonsDisabledFocus.js b/docs/data/base/components/button/UnstyledButtonsDisabledFocus.js index 0171d48acef2cb..1541fa924064a7 100644 --- a/docs/data/base/components/button/UnstyledButtonsDisabledFocus.js +++ b/docs/data/base/components/button/UnstyledButtonsDisabledFocus.js @@ -15,23 +15,35 @@ export default function UnstyledButtonsDisabledFocus() { } const blue = { + 200: '#99CCFF', + 300: '#66B2FF', + 400: '#3399FF', 500: '#007FFF', 600: '#0072E5', - 700: '#0059B2', + 700: '#0066CC', }; -const Button = styled(BaseButton)` - font-family: 'IBM Plex Sans', sans-serif; +const grey = { + 200: '#d0d7de', + 700: '#424a53', +}; + +const Button = styled(BaseButton)( + ({ theme }) => ` + font-family: IBM Plex Sans, sans-serif; + font-weight: 600; font-size: 0.875rem; line-height: 1.5; background-color: ${blue[500]}; - color: white; - border-radius: 8px; - font-weight: 600; padding: 8px 16px; - cursor: pointer; + border-radius: 8px; + color: white; transition: all 150ms ease; - border: none; + cursor: pointer; + border: 1px solid ${blue[500]}; + box-shadow: 0 2px 1px ${ + theme.palette.mode === 'dark' ? 'rgba(0, 0, 0, 0.5)' : 'rgba(45, 45, 60, 0.2)' + }, inset 0 1.5px 1px ${blue[400]}, inset 0 -2px 1px ${blue[600]}; &:hover { background-color: ${blue[600]}; @@ -39,15 +51,23 @@ const Button = styled(BaseButton)` &.${buttonClasses.active} { background-color: ${blue[700]}; + box-shadow: none; } &.${buttonClasses.focusVisible} { - box-shadow: 0 4px 20px 0 rgb(61 71 82 / 0.1), 0 0 0 5px rgb(0 127 255 / 0.5); + box-shadow: 0 0 0 4px ${theme.palette.mode === 'dark' ? blue[300] : blue[200]}; outline: none; } &.${buttonClasses.disabled} { - opacity: 0.5; + background-color: ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; + color: ${theme.palette.mode === 'dark' ? grey[200] : grey[700]}}; + border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; cursor: not-allowed; + box-shadow: none; + &:hover { + background-color: ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; + } } -`; +`, +); diff --git a/docs/data/base/components/button/UnstyledButtonsDisabledFocus.tsx b/docs/data/base/components/button/UnstyledButtonsDisabledFocus.tsx index 0171d48acef2cb..1541fa924064a7 100644 --- a/docs/data/base/components/button/UnstyledButtonsDisabledFocus.tsx +++ b/docs/data/base/components/button/UnstyledButtonsDisabledFocus.tsx @@ -15,23 +15,35 @@ export default function UnstyledButtonsDisabledFocus() { } const blue = { + 200: '#99CCFF', + 300: '#66B2FF', + 400: '#3399FF', 500: '#007FFF', 600: '#0072E5', - 700: '#0059B2', + 700: '#0066CC', }; -const Button = styled(BaseButton)` - font-family: 'IBM Plex Sans', sans-serif; +const grey = { + 200: '#d0d7de', + 700: '#424a53', +}; + +const Button = styled(BaseButton)( + ({ theme }) => ` + font-family: IBM Plex Sans, sans-serif; + font-weight: 600; font-size: 0.875rem; line-height: 1.5; background-color: ${blue[500]}; - color: white; - border-radius: 8px; - font-weight: 600; padding: 8px 16px; - cursor: pointer; + border-radius: 8px; + color: white; transition: all 150ms ease; - border: none; + cursor: pointer; + border: 1px solid ${blue[500]}; + box-shadow: 0 2px 1px ${ + theme.palette.mode === 'dark' ? 'rgba(0, 0, 0, 0.5)' : 'rgba(45, 45, 60, 0.2)' + }, inset 0 1.5px 1px ${blue[400]}, inset 0 -2px 1px ${blue[600]}; &:hover { background-color: ${blue[600]}; @@ -39,15 +51,23 @@ const Button = styled(BaseButton)` &.${buttonClasses.active} { background-color: ${blue[700]}; + box-shadow: none; } &.${buttonClasses.focusVisible} { - box-shadow: 0 4px 20px 0 rgb(61 71 82 / 0.1), 0 0 0 5px rgb(0 127 255 / 0.5); + box-shadow: 0 0 0 4px ${theme.palette.mode === 'dark' ? blue[300] : blue[200]}; outline: none; } &.${buttonClasses.disabled} { - opacity: 0.5; + background-color: ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; + color: ${theme.palette.mode === 'dark' ? grey[200] : grey[700]}}; + border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; cursor: not-allowed; + box-shadow: none; + &:hover { + background-color: ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; + } } -`; +`, +); diff --git a/docs/data/base/components/button/UnstyledButtonsDisabledFocusCustom.js b/docs/data/base/components/button/UnstyledButtonsDisabledFocusCustom.js index c62571925fe9cb..c7724d595bfa30 100644 --- a/docs/data/base/components/button/UnstyledButtonsDisabledFocusCustom.js +++ b/docs/data/base/components/button/UnstyledButtonsDisabledFocusCustom.js @@ -17,39 +17,59 @@ export default function UnstyledButtonsDisabledFocusCustom() { } const blue = { + 200: '#99CCFF', + 300: '#66B2FF', + 400: '#3399FF', 500: '#007FFF', 600: '#0072E5', - 700: '#0059B2', + 700: '#0066CC', }; -const Button = styled(BaseButton)` - font-family: 'IBM Plex Sans', sans-serif; +const grey = { + 200: '#d0d7de', + 700: '#424a53', +}; + +const Button = styled(BaseButton)( + ({ theme }) => ` + font-family: IBM Plex Sans, sans-serif; + font-weight: 600; font-size: 0.875rem; line-height: 1.5; background-color: ${blue[500]}; - color: white; - border-radius: 8px; - font-weight: 600; padding: 8px 16px; - cursor: pointer; + border-radius: 8px; + color: white; transition: all 150ms ease; - border: none; + cursor: pointer; + border: 1px solid ${blue[500]}; + box-shadow: 0 2px 1px ${ + theme.palette.mode === 'dark' ? 'rgba(0, 0, 0, 0.5)' : 'rgba(45, 45, 60, 0.2)' + }, inset 0 1.5px 1px ${blue[400]}, inset 0 -2px 1px ${blue[600]}; - &:hover:not(.${buttonClasses.disabled}) { + &:hover { background-color: ${blue[600]}; } &.${buttonClasses.active} { background-color: ${blue[700]}; + box-shadow: none; } &.${buttonClasses.focusVisible} { - box-shadow: 0 4px 20px 0 rgb(61 71 82 / 0.1), 0 0 0 5px rgb(0 127 255 / 0.5); + box-shadow: 0 0 0 4px ${theme.palette.mode === 'dark' ? blue[300] : blue[200]}; outline: none; } &.${buttonClasses.disabled} { - opacity: 0.5; + background-color: ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; + color: ${theme.palette.mode === 'dark' ? grey[200] : grey[700]}}; + border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; cursor: not-allowed; + box-shadow: none; + &:hover { + background-color: ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; + } } -`; +`, +); diff --git a/docs/data/base/components/button/UnstyledButtonsDisabledFocusCustom.tsx b/docs/data/base/components/button/UnstyledButtonsDisabledFocusCustom.tsx index 0c75b3d74b92d2..e5244190898e67 100644 --- a/docs/data/base/components/button/UnstyledButtonsDisabledFocusCustom.tsx +++ b/docs/data/base/components/button/UnstyledButtonsDisabledFocusCustom.tsx @@ -22,39 +22,59 @@ export default function UnstyledButtonsDisabledFocusCustom() { } const blue = { + 200: '#99CCFF', + 300: '#66B2FF', + 400: '#3399FF', 500: '#007FFF', 600: '#0072E5', - 700: '#0059B2', + 700: '#0066CC', }; -const Button = styled(BaseButton)` - font-family: 'IBM Plex Sans', sans-serif; +const grey = { + 200: '#d0d7de', + 700: '#424a53', +}; + +const Button = styled(BaseButton)( + ({ theme }) => ` + font-family: IBM Plex Sans, sans-serif; + font-weight: 600; font-size: 0.875rem; line-height: 1.5; background-color: ${blue[500]}; - color: white; - border-radius: 8px; - font-weight: 600; padding: 8px 16px; - cursor: pointer; + border-radius: 8px; + color: white; transition: all 150ms ease; - border: none; + cursor: pointer; + border: 1px solid ${blue[500]}; + box-shadow: 0 2px 1px ${ + theme.palette.mode === 'dark' ? 'rgba(0, 0, 0, 0.5)' : 'rgba(45, 45, 60, 0.2)' + }, inset 0 1.5px 1px ${blue[400]}, inset 0 -2px 1px ${blue[600]}; - &:hover:not(.${buttonClasses.disabled}) { + &:hover { background-color: ${blue[600]}; } &.${buttonClasses.active} { background-color: ${blue[700]}; + box-shadow: none; } &.${buttonClasses.focusVisible} { - box-shadow: 0 4px 20px 0 rgb(61 71 82 / 0.1), 0 0 0 5px rgb(0 127 255 / 0.5); + box-shadow: 0 0 0 4px ${theme.palette.mode === 'dark' ? blue[300] : blue[200]}; outline: none; } &.${buttonClasses.disabled} { - opacity: 0.5; + background-color: ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; + color: ${theme.palette.mode === 'dark' ? grey[200] : grey[700]}}; + border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; cursor: not-allowed; + box-shadow: none; + &:hover { + background-color: ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; + } } -` as PolymorphicComponent; +`, +) as PolymorphicComponent; diff --git a/docs/data/base/components/button/UnstyledButtonsSimple/css/index.js b/docs/data/base/components/button/UnstyledButtonsSimple/css/index.js index f7cdde1f0fd0be..2d76dd5384de1d 100644 --- a/docs/data/base/components/button/UnstyledButtonsSimple/css/index.js +++ b/docs/data/base/components/button/UnstyledButtonsSimple/css/index.js @@ -1,5 +1,6 @@ import * as React from 'react'; -import { Button, buttonClasses } from '@mui/base/Button'; +import { Button } from '@mui/base/Button'; +import { useTheme } from '@mui/system'; import Stack from '@mui/material/Stack'; export default function UnstyledButtonsSimple() { @@ -29,35 +30,58 @@ const cyan = { 900: '#022127', }; +const grey = { + 200: '#d0d7de', + 700: '#424a53', +}; + +function useIsDarkMode() { + const theme = useTheme(); + return theme.palette.mode === 'dark'; +} + function Styles() { + // Replace this with your app logic for determining dark mode + const isDarkMode = useIsDarkMode(); + return ( diff --git a/docs/data/base/components/button/UnstyledButtonsSimple/css/index.tsx b/docs/data/base/components/button/UnstyledButtonsSimple/css/index.tsx index f7cdde1f0fd0be..2d76dd5384de1d 100644 --- a/docs/data/base/components/button/UnstyledButtonsSimple/css/index.tsx +++ b/docs/data/base/components/button/UnstyledButtonsSimple/css/index.tsx @@ -1,5 +1,6 @@ import * as React from 'react'; -import { Button, buttonClasses } from '@mui/base/Button'; +import { Button } from '@mui/base/Button'; +import { useTheme } from '@mui/system'; import Stack from '@mui/material/Stack'; export default function UnstyledButtonsSimple() { @@ -29,35 +30,58 @@ const cyan = { 900: '#022127', }; +const grey = { + 200: '#d0d7de', + 700: '#424a53', +}; + +function useIsDarkMode() { + const theme = useTheme(); + return theme.palette.mode === 'dark'; +} + function Styles() { + // Replace this with your app logic for determining dark mode + const isDarkMode = useIsDarkMode(); + return ( diff --git a/docs/data/base/components/button/UnstyledButtonsSimple/system/index.js b/docs/data/base/components/button/UnstyledButtonsSimple/system/index.js index de8dc38e8101d4..d04aadf10e0544 100644 --- a/docs/data/base/components/button/UnstyledButtonsSimple/system/index.js +++ b/docs/data/base/components/button/UnstyledButtonsSimple/system/index.js @@ -1,5 +1,5 @@ import * as React from 'react'; -import { Button as BaseButton, buttonClasses } from '@mui/base/Button'; +import { Button as BaseButton } from '@mui/base/Button'; import { styled } from '@mui/system'; import Stack from '@mui/material/Stack'; @@ -13,39 +13,60 @@ export default function UnstyledButtonsSimple() { } const blue = { + 200: '#99CCFF', + 300: '#66B2FF', + 400: '#3399FF', 500: '#007FFF', 600: '#0072E5', - 700: '#0059B2', + 700: '#0066CC', }; -const Button = styled(BaseButton)` - font-family: 'IBM Plex Sans', sans-serif; +const grey = { + 200: '#d0d7de', + 700: '#424a53', +}; + +const Button = styled(BaseButton)( + ({ theme }) => ` + font-family: IBM Plex Sans, sans-serif; + font-weight: 600; font-size: 0.875rem; line-height: 1.5; background-color: ${blue[500]}; - color: white; - border-radius: 8px; - font-weight: 600; padding: 8px 16px; - cursor: pointer; + border-radius: 8px; + color: white; transition: all 150ms ease; - border: none; + cursor: pointer; + border: 1px solid ${blue[500]}; + box-shadow: 0 2px 1px ${ + theme.palette.mode === 'dark' ? 'rgba(0, 0, 0, 0.5)' : 'rgba(45, 45, 60, 0.2)' + }, inset 0 1.5px 1px ${blue[400]}, inset 0 -2px 1px ${blue[600]}; - &:hover:not(:disabled) { + &:hover { background-color: ${blue[600]}; } - &:active:not(:disabled) { + &:active { background-color: ${blue[700]}; + box-shadow: none; } - &.${buttonClasses.focusVisible} { - box-shadow: 0 4px 20px 0 rgb(61 71 82 / 0.1), 0 0 0 5px rgb(0 127 255 / 0.5); + &:focus-visible { + box-shadow: 0 0 0 4px ${theme.palette.mode === 'dark' ? blue[300] : blue[200]}; outline: none; } - &.${buttonClasses.disabled} { - opacity: 0.5; + &:disabled { + background-color: ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; + color: ${theme.palette.mode === 'dark' ? grey[200] : grey[700]}; + border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; cursor: not-allowed; + box-shadow: none; + + &:hover { + background-color: ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; + } } -`; +`, +); diff --git a/docs/data/base/components/button/UnstyledButtonsSimple/system/index.tsx b/docs/data/base/components/button/UnstyledButtonsSimple/system/index.tsx index de8dc38e8101d4..d04aadf10e0544 100644 --- a/docs/data/base/components/button/UnstyledButtonsSimple/system/index.tsx +++ b/docs/data/base/components/button/UnstyledButtonsSimple/system/index.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import { Button as BaseButton, buttonClasses } from '@mui/base/Button'; +import { Button as BaseButton } from '@mui/base/Button'; import { styled } from '@mui/system'; import Stack from '@mui/material/Stack'; @@ -13,39 +13,60 @@ export default function UnstyledButtonsSimple() { } const blue = { + 200: '#99CCFF', + 300: '#66B2FF', + 400: '#3399FF', 500: '#007FFF', 600: '#0072E5', - 700: '#0059B2', + 700: '#0066CC', }; -const Button = styled(BaseButton)` - font-family: 'IBM Plex Sans', sans-serif; +const grey = { + 200: '#d0d7de', + 700: '#424a53', +}; + +const Button = styled(BaseButton)( + ({ theme }) => ` + font-family: IBM Plex Sans, sans-serif; + font-weight: 600; font-size: 0.875rem; line-height: 1.5; background-color: ${blue[500]}; - color: white; - border-radius: 8px; - font-weight: 600; padding: 8px 16px; - cursor: pointer; + border-radius: 8px; + color: white; transition: all 150ms ease; - border: none; + cursor: pointer; + border: 1px solid ${blue[500]}; + box-shadow: 0 2px 1px ${ + theme.palette.mode === 'dark' ? 'rgba(0, 0, 0, 0.5)' : 'rgba(45, 45, 60, 0.2)' + }, inset 0 1.5px 1px ${blue[400]}, inset 0 -2px 1px ${blue[600]}; - &:hover:not(:disabled) { + &:hover { background-color: ${blue[600]}; } - &:active:not(:disabled) { + &:active { background-color: ${blue[700]}; + box-shadow: none; } - &.${buttonClasses.focusVisible} { - box-shadow: 0 4px 20px 0 rgb(61 71 82 / 0.1), 0 0 0 5px rgb(0 127 255 / 0.5); + &:focus-visible { + box-shadow: 0 0 0 4px ${theme.palette.mode === 'dark' ? blue[300] : blue[200]}; outline: none; } - &.${buttonClasses.disabled} { - opacity: 0.5; + &:disabled { + background-color: ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; + color: ${theme.palette.mode === 'dark' ? grey[200] : grey[700]}; + border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; cursor: not-allowed; + box-shadow: none; + + &:hover { + background-color: ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; + } } -`; +`, +); diff --git a/docs/data/base/components/button/UnstyledButtonsSimple/tailwind/index.js b/docs/data/base/components/button/UnstyledButtonsSimple/tailwind/index.js index 1339ee876c8f34..49d7bfb820ac2b 100644 --- a/docs/data/base/components/button/UnstyledButtonsSimple/tailwind/index.js +++ b/docs/data/base/components/button/UnstyledButtonsSimple/tailwind/index.js @@ -3,23 +3,36 @@ import PropTypes from 'prop-types'; import { Button as BaseButton } from '@mui/base/Button'; import Stack from '@mui/material/Stack'; import clsx from 'clsx'; +import { useTheme } from '@mui/system'; + +function useIsDarkMode() { + const theme = useTheme(); + return theme.palette.mode === 'dark'; +} export default function UnstyledButtonsSimple() { + // Replace this with your app logic for determining dark mode + const isDarkMode = useIsDarkMode(); + return ( - - - - +
+ + + Button + + Disabled + +
); } -const Button = React.forwardRef((props, ref) => { +const CustomButton = React.forwardRef((props, ref) => { const { className, ...other } = props; return ( { ); }); -Button.propTypes = { +CustomButton.propTypes = { className: PropTypes.string, }; diff --git a/docs/data/base/components/button/UnstyledButtonsSimple/tailwind/index.tsx b/docs/data/base/components/button/UnstyledButtonsSimple/tailwind/index.tsx index 16e2d86ba2b877..8d9009a8a58943 100644 --- a/docs/data/base/components/button/UnstyledButtonsSimple/tailwind/index.tsx +++ b/docs/data/base/components/button/UnstyledButtonsSimple/tailwind/index.tsx @@ -2,26 +2,41 @@ import * as React from 'react'; import { Button as BaseButton, ButtonProps } from '@mui/base/Button'; import Stack from '@mui/material/Stack'; import clsx from 'clsx'; +import { useTheme } from '@mui/system'; + +function useIsDarkMode() { + const theme = useTheme(); + return theme.palette.mode === 'dark'; +} export default function UnstyledButtonsSimple() { + // Replace this with your app logic for determining dark mode + const isDarkMode = useIsDarkMode(); + return ( - - - - +
+ + + Button + + Disabled + +
); } -const Button = React.forwardRef((props, ref) => { - const { className, ...other } = props; - return ( - - ); -}); +const CustomButton = React.forwardRef( + (props, ref) => { + const { className, ...other } = props; + return ( + + ); + }, +); diff --git a/docs/data/base/components/button/UnstyledButtonsSimple/tailwind/index.tsx.preview b/docs/data/base/components/button/UnstyledButtonsSimple/tailwind/index.tsx.preview index d96ba614272a34..25ff0c531391b5 100644 --- a/docs/data/base/components/button/UnstyledButtonsSimple/tailwind/index.tsx.preview +++ b/docs/data/base/components/button/UnstyledButtonsSimple/tailwind/index.tsx.preview @@ -1,2 +1,6 @@ - - \ No newline at end of file + + + Button + + Disabled + \ No newline at end of file diff --git a/docs/data/base/components/button/UnstyledButtonsSpan.js b/docs/data/base/components/button/UnstyledButtonsSpan.js index e4933ae60abfac..98ba103d2ae061 100644 --- a/docs/data/base/components/button/UnstyledButtonsSpan.js +++ b/docs/data/base/components/button/UnstyledButtonsSpan.js @@ -15,23 +15,35 @@ export default function UnstyledButtonsSpan() { } const blue = { + 200: '#99CCFF', + 300: '#66B2FF', + 400: '#3399FF', 500: '#007FFF', 600: '#0072E5', - 700: '#0059B2', + 700: '#0066CC', }; -const Button = styled(BaseButton)` - font-family: 'IBM Plex Sans', sans-serif; +const grey = { + 200: '#d0d7de', + 700: '#424a53', +}; + +const Button = styled(BaseButton)( + ({ theme }) => ` + font-family: IBM Plex Sans, sans-serif; + font-weight: 600; font-size: 0.875rem; line-height: 1.5; background-color: ${blue[500]}; - color: white; - border-radius: 8px; - font-weight: 600; padding: 8px 16px; - cursor: pointer; + border-radius: 8px; + color: white; transition: all 150ms ease; - border: none; + cursor: pointer; + border: 1px solid ${blue[500]}; + box-shadow: 0 2px 1px ${ + theme.palette.mode === 'dark' ? 'rgba(0, 0, 0, 0.5)' : 'rgba(45, 45, 60, 0.2)' + }, inset 0 1.5px 1px ${blue[400]}, inset 0 -2px 1px ${blue[600]}; &:hover { background-color: ${blue[600]}; @@ -39,15 +51,23 @@ const Button = styled(BaseButton)` &.${buttonClasses.active} { background-color: ${blue[700]}; + box-shadow: none; } &.${buttonClasses.focusVisible} { - box-shadow: 0 4px 20px 0 rgb(61 71 82 / 0.1), 0 0 0 5px rgb(0 127 255 / 0.5); + box-shadow: 0 0 0 4px ${theme.palette.mode === 'dark' ? blue[300] : blue[200]}; outline: none; } &.${buttonClasses.disabled} { - opacity: 0.5; + background-color: ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; + color: ${theme.palette.mode === 'dark' ? grey[200] : grey[700]}}; + border: 0; cursor: not-allowed; + box-shadow: none; + &:hover { + background-color: ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; + } } -`; + `, +); diff --git a/docs/data/base/components/button/UnstyledButtonsSpan.tsx b/docs/data/base/components/button/UnstyledButtonsSpan.tsx index fb788475dc3a32..03bdfe07ad8458 100644 --- a/docs/data/base/components/button/UnstyledButtonsSpan.tsx +++ b/docs/data/base/components/button/UnstyledButtonsSpan.tsx @@ -20,23 +20,35 @@ export default function UnstyledButtonsSpan() { } const blue = { + 200: '#99CCFF', + 300: '#66B2FF', + 400: '#3399FF', 500: '#007FFF', 600: '#0072E5', - 700: '#0059B2', + 700: '#0066CC', }; -const Button = styled(BaseButton)` - font-family: 'IBM Plex Sans', sans-serif; +const grey = { + 200: '#d0d7de', + 700: '#424a53', +}; + +const Button = styled(BaseButton)( + ({ theme }) => ` + font-family: IBM Plex Sans, sans-serif; + font-weight: 600; font-size: 0.875rem; line-height: 1.5; background-color: ${blue[500]}; - color: white; - border-radius: 8px; - font-weight: 600; padding: 8px 16px; - cursor: pointer; + border-radius: 8px; + color: white; transition: all 150ms ease; - border: none; + cursor: pointer; + border: 1px solid ${blue[500]}; + box-shadow: 0 2px 1px ${ + theme.palette.mode === 'dark' ? 'rgba(0, 0, 0, 0.5)' : 'rgba(45, 45, 60, 0.2)' + }, inset 0 1.5px 1px ${blue[400]}, inset 0 -2px 1px ${blue[600]}; &:hover { background-color: ${blue[600]}; @@ -44,15 +56,23 @@ const Button = styled(BaseButton)` &.${buttonClasses.active} { background-color: ${blue[700]}; + box-shadow: none; } &.${buttonClasses.focusVisible} { - box-shadow: 0 4px 20px 0 rgb(61 71 82 / 0.1), 0 0 0 5px rgb(0 127 255 / 0.5); + box-shadow: 0 0 0 4px ${theme.palette.mode === 'dark' ? blue[300] : blue[200]}; outline: none; } &.${buttonClasses.disabled} { - opacity: 0.5; + background-color: ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; + color: ${theme.palette.mode === 'dark' ? grey[200] : grey[700]}}; + border: 0; cursor: not-allowed; + box-shadow: none; + &:hover { + background-color: ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; + } } -` as PolymorphicComponent; + `, +) as PolymorphicComponent; diff --git a/docs/data/base/components/button/UnstyledButtonsSpan/css/index.js b/docs/data/base/components/button/UnstyledButtonsSpan/css/index.js index 07b3949ac8f65e..4b73dbd2e18a0b 100644 --- a/docs/data/base/components/button/UnstyledButtonsSpan/css/index.js +++ b/docs/data/base/components/button/UnstyledButtonsSpan/css/index.js @@ -1,5 +1,6 @@ import * as React from 'react'; -import { Button, buttonClasses } from '@mui/base/Button'; +import { Button } from '@mui/base/Button'; +import { useTheme } from '@mui/system'; import Stack from '@mui/material/Stack'; export default function UnstyledButtonsSpan() { @@ -31,32 +32,54 @@ const cyan = { 900: '#022127', }; +const grey = { + 200: '#d0d7de', + 700: '#424a53', +}; + +function useIsDarkMode() { + const theme = useTheme(); + return theme.palette.mode === 'dark'; +} + function Styles() { + // Replace this with your app logic for determining dark mode + const isDarkMode = useIsDarkMode(); return ( + .CustomButton { + font-family: IBM Plex Sans, sans-serif; + font-weight: 600; + font-size: 0.875rem; + line-height: 1.5; + background-color: ${cyan[500]}; + padding: 8px 16px; + border-radius: 8px; + color: white; + transition: all 150ms ease; + cursor: pointer; + border: 1px solid ${cyan[500]}; + box-shadow: 0 2px 1px ${ + isDarkMode ? 'rgba(0, 0, 0, 0.5)' : 'rgba(45, 45, 60, 0.2)' + }, inset 0 1.5px 1px ${cyan[400]}, inset 0 -2px 1px ${cyan[600]}; + } + .CustomButton:hover { + background-color: ${cyan[600]}; + } + .CustomButton:active { + background-color: ${cyan[700]}; + } + .CustomButton:focusVisible { + box-shadow: 0 0 0 4px ${isDarkMode ? cyan[300] : cyan[200]}; + outline: none; + } + .CustomButton[aria-disabled='true'] { + background-color: ${isDarkMode ? grey[700] : grey[200]}; + color: ${isDarkMode ? grey[200] : grey[700]}; + border: 0; + cursor: not-allowed; + box-shadow: none; + } + `} ); } diff --git a/docs/data/base/components/button/UnstyledButtonsSpan/css/index.tsx b/docs/data/base/components/button/UnstyledButtonsSpan/css/index.tsx index 07b3949ac8f65e..4b73dbd2e18a0b 100644 --- a/docs/data/base/components/button/UnstyledButtonsSpan/css/index.tsx +++ b/docs/data/base/components/button/UnstyledButtonsSpan/css/index.tsx @@ -1,5 +1,6 @@ import * as React from 'react'; -import { Button, buttonClasses } from '@mui/base/Button'; +import { Button } from '@mui/base/Button'; +import { useTheme } from '@mui/system'; import Stack from '@mui/material/Stack'; export default function UnstyledButtonsSpan() { @@ -31,32 +32,54 @@ const cyan = { 900: '#022127', }; +const grey = { + 200: '#d0d7de', + 700: '#424a53', +}; + +function useIsDarkMode() { + const theme = useTheme(); + return theme.palette.mode === 'dark'; +} + function Styles() { + // Replace this with your app logic for determining dark mode + const isDarkMode = useIsDarkMode(); return ( + .CustomButton { + font-family: IBM Plex Sans, sans-serif; + font-weight: 600; + font-size: 0.875rem; + line-height: 1.5; + background-color: ${cyan[500]}; + padding: 8px 16px; + border-radius: 8px; + color: white; + transition: all 150ms ease; + cursor: pointer; + border: 1px solid ${cyan[500]}; + box-shadow: 0 2px 1px ${ + isDarkMode ? 'rgba(0, 0, 0, 0.5)' : 'rgba(45, 45, 60, 0.2)' + }, inset 0 1.5px 1px ${cyan[400]}, inset 0 -2px 1px ${cyan[600]}; + } + .CustomButton:hover { + background-color: ${cyan[600]}; + } + .CustomButton:active { + background-color: ${cyan[700]}; + } + .CustomButton:focusVisible { + box-shadow: 0 0 0 4px ${isDarkMode ? cyan[300] : cyan[200]}; + outline: none; + } + .CustomButton[aria-disabled='true'] { + background-color: ${isDarkMode ? grey[700] : grey[200]}; + color: ${isDarkMode ? grey[200] : grey[700]}; + border: 0; + cursor: not-allowed; + box-shadow: none; + } + `} ); } diff --git a/docs/data/base/components/button/UnstyledButtonsSpan/system/index.js b/docs/data/base/components/button/UnstyledButtonsSpan/system/index.js index e4933ae60abfac..8bba4b2d3f951c 100644 --- a/docs/data/base/components/button/UnstyledButtonsSpan/system/index.js +++ b/docs/data/base/components/button/UnstyledButtonsSpan/system/index.js @@ -1,5 +1,5 @@ import * as React from 'react'; -import { Button as BaseButton, buttonClasses } from '@mui/base/Button'; +import { Button as BaseButton } from '@mui/base/Button'; import { styled } from '@mui/system'; import Stack from '@mui/material/Stack'; @@ -15,39 +15,60 @@ export default function UnstyledButtonsSpan() { } const blue = { + 200: '#99CCFF', + 300: '#66B2FF', + 400: '#3399FF', 500: '#007FFF', 600: '#0072E5', - 700: '#0059B2', + 700: '#0066CC', }; -const Button = styled(BaseButton)` - font-family: 'IBM Plex Sans', sans-serif; +const grey = { + 200: '#d0d7de', + 700: '#424a53', +}; + +const Button = styled(BaseButton)( + ({ theme }) => ` + font-family: IBM Plex Sans, sans-serif; + font-weight: 600; font-size: 0.875rem; line-height: 1.5; background-color: ${blue[500]}; - color: white; - border-radius: 8px; - font-weight: 600; padding: 8px 16px; - cursor: pointer; + border-radius: 8px; + color: white; transition: all 150ms ease; - border: none; + cursor: pointer; + border: 1px solid ${blue[500]}; + box-shadow: 0 2px 1px ${ + theme.palette.mode === 'dark' ? 'rgba(0, 0, 0, 0.5)' : 'rgba(45, 45, 60, 0.2)' + }, inset 0 1.5px 1px ${blue[400]}, inset 0 -2px 1px ${blue[600]}; &:hover { background-color: ${blue[600]}; } - &.${buttonClasses.active} { + &:active { background-color: ${blue[700]}; + box-shadow: none; } - &.${buttonClasses.focusVisible} { - box-shadow: 0 4px 20px 0 rgb(61 71 82 / 0.1), 0 0 0 5px rgb(0 127 255 / 0.5); + &:focus-visible { + box-shadow: 0 0 0 4px ${theme.palette.mode === 'dark' ? blue[300] : blue[200]}; outline: none; } - &.${buttonClasses.disabled} { - opacity: 0.5; + &.Mui-disabled { + background-color: ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; + color: ${theme.palette.mode === 'dark' ? grey[200] : grey[700]}; + border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; cursor: not-allowed; + box-shadow: none; + } + + &.Mui-disabled:hover { + background-color: ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; } -`; +`, +); diff --git a/docs/data/base/components/button/UnstyledButtonsSpan/system/index.tsx b/docs/data/base/components/button/UnstyledButtonsSpan/system/index.tsx index fb788475dc3a32..8bba4b2d3f951c 100644 --- a/docs/data/base/components/button/UnstyledButtonsSpan/system/index.tsx +++ b/docs/data/base/components/button/UnstyledButtonsSpan/system/index.tsx @@ -1,12 +1,7 @@ import * as React from 'react'; -import { - Button as BaseButton, - buttonClasses, - ButtonTypeMap, -} from '@mui/base/Button'; +import { Button as BaseButton } from '@mui/base/Button'; import { styled } from '@mui/system'; import Stack from '@mui/material/Stack'; -import { PolymorphicComponent } from '@mui/base/utils'; export default function UnstyledButtonsSpan() { return ( @@ -20,39 +15,60 @@ export default function UnstyledButtonsSpan() { } const blue = { + 200: '#99CCFF', + 300: '#66B2FF', + 400: '#3399FF', 500: '#007FFF', 600: '#0072E5', - 700: '#0059B2', + 700: '#0066CC', }; -const Button = styled(BaseButton)` - font-family: 'IBM Plex Sans', sans-serif; +const grey = { + 200: '#d0d7de', + 700: '#424a53', +}; + +const Button = styled(BaseButton)( + ({ theme }) => ` + font-family: IBM Plex Sans, sans-serif; + font-weight: 600; font-size: 0.875rem; line-height: 1.5; background-color: ${blue[500]}; - color: white; - border-radius: 8px; - font-weight: 600; padding: 8px 16px; - cursor: pointer; + border-radius: 8px; + color: white; transition: all 150ms ease; - border: none; + cursor: pointer; + border: 1px solid ${blue[500]}; + box-shadow: 0 2px 1px ${ + theme.palette.mode === 'dark' ? 'rgba(0, 0, 0, 0.5)' : 'rgba(45, 45, 60, 0.2)' + }, inset 0 1.5px 1px ${blue[400]}, inset 0 -2px 1px ${blue[600]}; &:hover { background-color: ${blue[600]}; } - &.${buttonClasses.active} { + &:active { background-color: ${blue[700]}; + box-shadow: none; } - &.${buttonClasses.focusVisible} { - box-shadow: 0 4px 20px 0 rgb(61 71 82 / 0.1), 0 0 0 5px rgb(0 127 255 / 0.5); + &:focus-visible { + box-shadow: 0 0 0 4px ${theme.palette.mode === 'dark' ? blue[300] : blue[200]}; outline: none; } - &.${buttonClasses.disabled} { - opacity: 0.5; + &.Mui-disabled { + background-color: ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; + color: ${theme.palette.mode === 'dark' ? grey[200] : grey[700]}; + border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; cursor: not-allowed; + box-shadow: none; + } + + &.Mui-disabled:hover { + background-color: ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; } -` as PolymorphicComponent; +`, +); diff --git a/docs/data/base/components/button/UnstyledButtonsSpan/tailwind/index.js b/docs/data/base/components/button/UnstyledButtonsSpan/tailwind/index.js index 1413e86cb49628..5fd52f0d74ea8f 100644 --- a/docs/data/base/components/button/UnstyledButtonsSpan/tailwind/index.js +++ b/docs/data/base/components/button/UnstyledButtonsSpan/tailwind/index.js @@ -3,32 +3,55 @@ import PropTypes from 'prop-types'; import { Button as BaseButton } from '@mui/base/Button'; import Stack from '@mui/material/Stack'; import clsx from 'clsx'; +import { useTheme } from '@mui/system'; + +function useIsDarkMode() { + const theme = useTheme(); + return theme.palette.mode === 'dark'; +} export default function UnstyledButtonsSimple() { + // Replace this with your app logic for determining dark mode + const isDarkMode = useIsDarkMode(); + return ( - - - - +
+ + + Button + + + Disabled + + +
); } -const Button = React.forwardRef((props, ref) => { - const { className, ...other } = props; +const CustomButton = React.forwardRef((props, ref) => { + const { className, disabled, ...other } = props; return ( ); }); -Button.propTypes = { +CustomButton.propTypes = { className: PropTypes.string, + /** + * If `true`, the component is disabled. + * @default false + */ + disabled: PropTypes.bool, }; diff --git a/docs/data/base/components/button/UnstyledButtonsSpan/tailwind/index.tsx b/docs/data/base/components/button/UnstyledButtonsSpan/tailwind/index.tsx index 2f3356ffac01e4..4e7aef776baed9 100644 --- a/docs/data/base/components/button/UnstyledButtonsSpan/tailwind/index.tsx +++ b/docs/data/base/components/button/UnstyledButtonsSpan/tailwind/index.tsx @@ -2,28 +2,48 @@ import * as React from 'react'; import { Button as BaseButton, ButtonProps } from '@mui/base/Button'; import Stack from '@mui/material/Stack'; import clsx from 'clsx'; +import { useTheme } from '@mui/system'; + +function useIsDarkMode() { + const theme = useTheme(); + return theme.palette.mode === 'dark'; +} export default function UnstyledButtonsSimple() { + // Replace this with your app logic for determining dark mode + const isDarkMode = useIsDarkMode(); + return ( - - - - +
+ + + Button + + + Disabled + + +
); } -const Button = React.forwardRef((props, ref) => { - const { className, ...other } = props; - return ( - - ); -}); +const CustomButton = React.forwardRef( + (props, ref) => { + const { className, disabled, ...other } = props; + return ( + + ); + }, +); diff --git a/docs/data/base/components/button/UnstyledButtonsSpan/tailwind/index.tsx.preview b/docs/data/base/components/button/UnstyledButtonsSpan/tailwind/index.tsx.preview index 1a2ded5e53c887..6eae560418bde6 100644 --- a/docs/data/base/components/button/UnstyledButtonsSpan/tailwind/index.tsx.preview +++ b/docs/data/base/components/button/UnstyledButtonsSpan/tailwind/index.tsx.preview @@ -1,4 +1,8 @@ - - \ No newline at end of file + + + Button + + + Disabled + + \ No newline at end of file diff --git a/docs/data/base/components/button/UnstyledLinkButton.js b/docs/data/base/components/button/UnstyledLinkButton.js index ddddc49946132c..8ddf9a4a4fd5b0 100644 --- a/docs/data/base/components/button/UnstyledLinkButton.js +++ b/docs/data/base/components/button/UnstyledLinkButton.js @@ -1,5 +1,5 @@ import * as React from 'react'; -import { Button as BaseButton, buttonClasses } from '@mui/base/Button'; +import { Button as BaseButton } from '@mui/base/Button'; import { styled } from '@mui/system'; import Stack from '@mui/material/Stack'; import Link from 'next/link'; @@ -16,43 +16,60 @@ export default function UnstyledLinkButton() { } const blue = { + 200: '#99CCFF', + 300: '#66B2FF', + 400: '#3399FF', 500: '#007FFF', 600: '#0072E5', - 700: '#0059B2', + 700: '#0066CC', }; const grey = { - 100: '#eaeef2', - 300: '#afb8c1', - 900: '#24292f', + 200: '#d0d7de', + 700: '#424a53', }; const Button = styled(BaseButton)( ({ theme }) => ` font-family: IBM Plex Sans, sans-serif; - font-weight: bold; + font-weight: 600; font-size: 0.875rem; + line-height: 1.5; background-color: ${blue[500]}; padding: 8px 16px; border-radius: 8px; - line-height: 1.5; color: white; transition: all 150ms ease; cursor: pointer; - border: none; - box-shadow: 0px 4px 30px ${theme.palette.mode === 'dark' ? grey[900] : grey[100]}; + border: 1px solid ${blue[500]}; + box-shadow: 0 2px 1px ${ + theme.palette.mode === 'dark' ? 'rgba(0, 0, 0, 0.5)' : 'rgba(45, 45, 60, 0.2)' + }, inset 0 1.5px 1px ${blue[400]}, inset 0 -2px 1px ${blue[600]}; &:hover { background-color: ${blue[600]}; } - &.${buttonClasses.active} { + &:active { background-color: ${blue[700]}; + box-shadow: none; } - &.${buttonClasses.focusVisible} { - box-shadow: 0 3px 20px 0 rgba(61, 71, 82, 0.1), 0 0 0 5px rgba(0, 127, 255, 0.5); + &:focus-visible { + box-shadow: 0 0 0 4px ${theme.palette.mode === 'dark' ? blue[300] : blue[200]}; outline: none; } + + &:disabled { + background-color: ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; + color: ${theme.palette.mode === 'dark' ? grey[200] : grey[700]}; + border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; + cursor: not-allowed; + box-shadow: none; + + &:hover { + background-color: ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; + } + } `, ); diff --git a/docs/data/base/components/button/UnstyledLinkButton.tsx b/docs/data/base/components/button/UnstyledLinkButton.tsx index ddddc49946132c..8ddf9a4a4fd5b0 100644 --- a/docs/data/base/components/button/UnstyledLinkButton.tsx +++ b/docs/data/base/components/button/UnstyledLinkButton.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import { Button as BaseButton, buttonClasses } from '@mui/base/Button'; +import { Button as BaseButton } from '@mui/base/Button'; import { styled } from '@mui/system'; import Stack from '@mui/material/Stack'; import Link from 'next/link'; @@ -16,43 +16,60 @@ export default function UnstyledLinkButton() { } const blue = { + 200: '#99CCFF', + 300: '#66B2FF', + 400: '#3399FF', 500: '#007FFF', 600: '#0072E5', - 700: '#0059B2', + 700: '#0066CC', }; const grey = { - 100: '#eaeef2', - 300: '#afb8c1', - 900: '#24292f', + 200: '#d0d7de', + 700: '#424a53', }; const Button = styled(BaseButton)( ({ theme }) => ` font-family: IBM Plex Sans, sans-serif; - font-weight: bold; + font-weight: 600; font-size: 0.875rem; + line-height: 1.5; background-color: ${blue[500]}; padding: 8px 16px; border-radius: 8px; - line-height: 1.5; color: white; transition: all 150ms ease; cursor: pointer; - border: none; - box-shadow: 0px 4px 30px ${theme.palette.mode === 'dark' ? grey[900] : grey[100]}; + border: 1px solid ${blue[500]}; + box-shadow: 0 2px 1px ${ + theme.palette.mode === 'dark' ? 'rgba(0, 0, 0, 0.5)' : 'rgba(45, 45, 60, 0.2)' + }, inset 0 1.5px 1px ${blue[400]}, inset 0 -2px 1px ${blue[600]}; &:hover { background-color: ${blue[600]}; } - &.${buttonClasses.active} { + &:active { background-color: ${blue[700]}; + box-shadow: none; } - &.${buttonClasses.focusVisible} { - box-shadow: 0 3px 20px 0 rgba(61, 71, 82, 0.1), 0 0 0 5px rgba(0, 127, 255, 0.5); + &:focus-visible { + box-shadow: 0 0 0 4px ${theme.palette.mode === 'dark' ? blue[300] : blue[200]}; outline: none; } + + &:disabled { + background-color: ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; + color: ${theme.palette.mode === 'dark' ? grey[200] : grey[700]}; + border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; + cursor: not-allowed; + box-shadow: none; + + &:hover { + background-color: ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; + } + } `, ); diff --git a/docs/data/base/components/button/UseButton.js b/docs/data/base/components/button/UseButton.js index 86fa65d66bcef7..652eb00212fedf 100644 --- a/docs/data/base/components/button/UseButton.js +++ b/docs/data/base/components/button/UseButton.js @@ -45,39 +45,60 @@ export default function UseButton() { } const blue = { + 200: '#99CCFF', + 300: '#66B2FF', + 400: '#3399FF', 500: '#007FFF', 600: '#0072E5', - 700: '#0059B2', + 700: '#0066CC', }; -const CustomButtonRoot = styled('button')` - font-family: 'IBM Plex Sans', sans-serif; +const grey = { + 200: '#d0d7de', + 700: '#424a53', +}; + +const CustomButtonRoot = styled('button')( + ({ theme }) => ` + font-family: IBM Plex Sans, sans-serif; + font-weight: 600; font-size: 0.875rem; line-height: 1.5; background-color: ${blue[500]}; - color: white; - border-radius: 8px; - font-weight: 600; padding: 8px 16px; - cursor: pointer; + border-radius: 8px; + color: white; transition: all 150ms ease; - border: none; + cursor: pointer; + border: 1px solid ${blue[500]}; + box-shadow: 0 2px 1px ${ + theme.palette.mode === 'dark' ? 'rgba(0, 0, 0, 0.5)' : 'rgba(45, 45, 60, 0.2)' + }, inset 0 1.5px 1px ${blue[400]}, inset 0 -2px 1px ${blue[600]}; &:hover { background-color: ${blue[600]}; } - &.active { + &:active { background-color: ${blue[700]}; + box-shadow: none; } - &.focusVisible { - box-shadow: 0 4px 20px 0 rgb(61 71 82 / 0.1), 0 0 0 5px rgb(0 127 255 / 0.5); + &:focus-visible { + box-shadow: 0 0 0 4px ${theme.palette.mode === 'dark' ? blue[300] : blue[200]}; outline: none; } - &.disabled { - opacity: 0.5; + &:disabled { + background-color: ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; + color: ${theme.palette.mode === 'dark' ? grey[200] : grey[700]}; + border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; cursor: not-allowed; + box-shadow: none; + + &:hover { + background-color: ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; + } } -`; +`, +); diff --git a/docs/data/base/components/button/UseButton.tsx b/docs/data/base/components/button/UseButton.tsx index 5a5186b11fdb42..51fa3861051cbe 100644 --- a/docs/data/base/components/button/UseButton.tsx +++ b/docs/data/base/components/button/UseButton.tsx @@ -38,39 +38,60 @@ export default function UseButton() { } const blue = { + 200: '#99CCFF', + 300: '#66B2FF', + 400: '#3399FF', 500: '#007FFF', 600: '#0072E5', - 700: '#0059B2', + 700: '#0066CC', }; -const CustomButtonRoot = styled('button')` - font-family: 'IBM Plex Sans', sans-serif; +const grey = { + 200: '#d0d7de', + 700: '#424a53', +}; + +const CustomButtonRoot = styled('button')( + ({ theme }) => ` + font-family: IBM Plex Sans, sans-serif; + font-weight: 600; font-size: 0.875rem; line-height: 1.5; background-color: ${blue[500]}; - color: white; - border-radius: 8px; - font-weight: 600; padding: 8px 16px; - cursor: pointer; + border-radius: 8px; + color: white; transition: all 150ms ease; - border: none; + cursor: pointer; + border: 1px solid ${blue[500]}; + box-shadow: 0 2px 1px ${ + theme.palette.mode === 'dark' ? 'rgba(0, 0, 0, 0.5)' : 'rgba(45, 45, 60, 0.2)' + }, inset 0 1.5px 1px ${blue[400]}, inset 0 -2px 1px ${blue[600]}; &:hover { background-color: ${blue[600]}; } - &.active { + &:active { background-color: ${blue[700]}; + box-shadow: none; } - &.focusVisible { - box-shadow: 0 4px 20px 0 rgb(61 71 82 / 0.1), 0 0 0 5px rgb(0 127 255 / 0.5); + &:focus-visible { + box-shadow: 0 0 0 4px ${theme.palette.mode === 'dark' ? blue[300] : blue[200]}; outline: none; } - &.disabled { - opacity: 0.5; + &:disabled { + background-color: ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; + color: ${theme.palette.mode === 'dark' ? grey[200] : grey[700]}; + border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; cursor: not-allowed; + box-shadow: none; + + &:hover { + background-color: ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; + } } -`; +`, +); diff --git a/docs/data/base/components/form-control/BasicFormControl/css/index.js b/docs/data/base/components/form-control/BasicFormControl/css/index.js index 457b77cfc28f04..acc31a00f807c0 100644 --- a/docs/data/base/components/form-control/BasicFormControl/css/index.js +++ b/docs/data/base/components/form-control/BasicFormControl/css/index.js @@ -119,22 +119,24 @@ function Styles() { {` .CustomInput .${inputClasses.input} { width: 320px; - font-size: 0.875rem; font-family: IBM Plex Sans, sans-serif; + font-size: 0.875rem; font-weight: 400; line-height: 1.5; padding: 8px 12px; border-radius: 8px; color: ${isDarkMode ? grey[300] : grey[900]}; background: ${isDarkMode ? grey[900] : '#fff'}; - border: 1px solid ${isDarkMode ? grey[800] : grey[300]}; + border: 1px solid ${isDarkMode ? grey[700] : grey[200]}; + box-shadow: 0px 2px 2px ${isDarkMode ? grey[900] : grey[50]}; } - .CustomInput .${inputClasses.input}:hover { - background: ${isDarkMode ? '' : grey[100]}; - border-color: ${isDarkMode ? grey[700] : grey[400]}; + .CustomInput .${inputClasses.input}:hover { + border-color: ${cyan[400]}; } - .CustomInput .${inputClasses.input}:focus { - outline: 3px solid ${isDarkMode ? cyan[600] : cyan[100]}; + .CustomInput .${inputClasses.input}:focus { + outline: 0; + border-color: ${cyan[400]}; + box-shadow: 0 0 0 3px ${isDarkMode ? cyan[600] : cyan[200]}; } `} diff --git a/docs/data/base/components/form-control/BasicFormControl/css/index.tsx b/docs/data/base/components/form-control/BasicFormControl/css/index.tsx index 46197fae28b4ac..f18df60da0ef5f 100644 --- a/docs/data/base/components/form-control/BasicFormControl/css/index.tsx +++ b/docs/data/base/components/form-control/BasicFormControl/css/index.tsx @@ -119,22 +119,24 @@ function Styles() { {` .CustomInput .${inputClasses.input} { width: 320px; - font-size: 0.875rem; font-family: IBM Plex Sans, sans-serif; + font-size: 0.875rem; font-weight: 400; line-height: 1.5; padding: 8px 12px; border-radius: 8px; color: ${isDarkMode ? grey[300] : grey[900]}; background: ${isDarkMode ? grey[900] : '#fff'}; - border: 1px solid ${isDarkMode ? grey[800] : grey[300]}; + border: 1px solid ${isDarkMode ? grey[700] : grey[200]}; + box-shadow: 0px 2px 2px ${isDarkMode ? grey[900] : grey[50]}; } - .CustomInput .${inputClasses.input}:hover { - background: ${isDarkMode ? '' : grey[100]}; - border-color: ${isDarkMode ? grey[700] : grey[400]}; + .CustomInput .${inputClasses.input}:hover { + border-color: ${cyan[400]}; } - .CustomInput .${inputClasses.input}:focus { - outline: 3px solid ${isDarkMode ? cyan[600] : cyan[100]}; + .CustomInput .${inputClasses.input}:focus { + outline: 0; + border-color: ${cyan[400]}; + box-shadow: 0 0 0 3px ${isDarkMode ? cyan[600] : cyan[200]}; } `} diff --git a/docs/data/base/components/form-control/BasicFormControl/system/index.js b/docs/data/base/components/form-control/BasicFormControl/system/index.js index f2b89b5af1061b..d3a401bd831183 100644 --- a/docs/data/base/components/form-control/BasicFormControl/system/index.js +++ b/docs/data/base/components/form-control/BasicFormControl/system/index.js @@ -19,23 +19,25 @@ const StyledInput = styled(Input)( .${inputClasses.input} { width: 320px; - font-size: 0.875rem; font-family: IBM Plex Sans, sans-serif; + font-size: 0.875rem; font-weight: 400; line-height: 1.5; - color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]}; - background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'}; - border: 1px solid ${theme.palette.mode === 'dark' ? grey[800] : grey[300]}; padding: 8px 12px; border-radius: 8px; + color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]}; + background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'}; + border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; + box-shadow: 0px 2px 2px ${theme.palette.mode === 'dark' ? grey[900] : grey[50]}; &:hover { - background: ${theme.palette.mode === 'dark' ? '' : grey[100]}; - border-color: ${theme.palette.mode === 'dark' ? grey[700] : grey[400]}; + border-color: ${blue[400]}; } &:focus { - outline: 3px solid ${theme.palette.mode === 'dark' ? blue[600] : blue[100]}; + outline: 0; + border-color: ${blue[400]}; + box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[600] : blue[200]}; } } `, @@ -99,9 +101,11 @@ const HelperText = styled((props) => { const blue = { 100: '#DAECFF', - 200: '#80BFFF', + 200: '#b6daff', 400: '#3399FF', + 500: '#007FFF', 600: '#0072E5', + 900: '#003A75', }; const grey = { diff --git a/docs/data/base/components/form-control/BasicFormControl/system/index.tsx b/docs/data/base/components/form-control/BasicFormControl/system/index.tsx index a76d389e9f983c..23b80503f934f1 100644 --- a/docs/data/base/components/form-control/BasicFormControl/system/index.tsx +++ b/docs/data/base/components/form-control/BasicFormControl/system/index.tsx @@ -19,23 +19,25 @@ const StyledInput = styled(Input)( .${inputClasses.input} { width: 320px; - font-size: 0.875rem; font-family: IBM Plex Sans, sans-serif; + font-size: 0.875rem; font-weight: 400; line-height: 1.5; - color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]}; - background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'}; - border: 1px solid ${theme.palette.mode === 'dark' ? grey[800] : grey[300]}; padding: 8px 12px; border-radius: 8px; + color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]}; + background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'}; + border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; + box-shadow: 0px 2px 2px ${theme.palette.mode === 'dark' ? grey[900] : grey[50]}; &:hover { - background: ${theme.palette.mode === 'dark' ? '' : grey[100]}; - border-color: ${theme.palette.mode === 'dark' ? grey[700] : grey[400]}; + border-color: ${blue[400]}; } &:focus { - outline: 3px solid ${theme.palette.mode === 'dark' ? blue[600] : blue[100]}; + outline: 0; + border-color: ${blue[400]}; + box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[600] : blue[200]}; } } `, @@ -101,9 +103,11 @@ const HelperText = styled((props: {}) => { const blue = { 100: '#DAECFF', - 200: '#80BFFF', + 200: '#b6daff', 400: '#3399FF', + 500: '#007FFF', 600: '#0072E5', + 900: '#003A75', }; const grey = { diff --git a/docs/data/base/components/form-control/BasicFormControl/tailwind/index.js b/docs/data/base/components/form-control/BasicFormControl/tailwind/index.js index 70cc33b485a2ce..a256d4d8ff650f 100644 --- a/docs/data/base/components/form-control/BasicFormControl/tailwind/index.js +++ b/docs/data/base/components/form-control/BasicFormControl/tailwind/index.js @@ -23,7 +23,7 @@ export default function BasicFormControl() { slotProps={{ input: { className: - 'w-80 text-sm font-normal font-sans leading-normal text-slate-900 dark:text-slate-300 bg-white dark:bg-slate-800 border border-solid border-slate-200 dark:border-slate-700 px-3 py-2 rounded-lg hover:bg-slate-100 hover:dark:bg-slate-900 hover:border-slate-400 hover:dark:border-slate-700 focus:outline-0 focus:shadow-outline-purple', + 'w-80 text-sm font-sans font-normal leading-5 px-3 py-2 rounded-lg shadow-md shadow-slate-100 dark:shadow-slate-900 focus:shadow-outline-purple dark:focus:shadow-outline-purple focus:shadow-lg border border-solid border-slate-300 hover:border-purple-500 dark:hover:border-purple-500 focus:border-purple-500 dark:focus:border-purple-500 dark:border-slate-600 bg-white dark:bg-slate-900 text-slate-900 dark:text-slate-300 focus-visible:outline-0', }, }} /> diff --git a/docs/data/base/components/form-control/BasicFormControl/tailwind/index.tsx b/docs/data/base/components/form-control/BasicFormControl/tailwind/index.tsx index 075842a9b4edf1..d3cbca6446e435 100644 --- a/docs/data/base/components/form-control/BasicFormControl/tailwind/index.tsx +++ b/docs/data/base/components/form-control/BasicFormControl/tailwind/index.tsx @@ -22,7 +22,7 @@ export default function BasicFormControl() { slotProps={{ input: { className: - 'w-80 text-sm font-normal font-sans leading-normal text-slate-900 dark:text-slate-300 bg-white dark:bg-slate-800 border border-solid border-slate-200 dark:border-slate-700 px-3 py-2 rounded-lg hover:bg-slate-100 hover:dark:bg-slate-900 hover:border-slate-400 hover:dark:border-slate-700 focus:outline-0 focus:shadow-outline-purple', + 'w-80 text-sm font-sans font-normal leading-5 px-3 py-2 rounded-lg shadow-md shadow-slate-100 dark:shadow-slate-900 focus:shadow-outline-purple dark:focus:shadow-outline-purple focus:shadow-lg border border-solid border-slate-300 hover:border-purple-500 dark:hover:border-purple-500 focus:border-purple-500 dark:focus:border-purple-500 dark:border-slate-600 bg-white dark:bg-slate-900 text-slate-900 dark:text-slate-300 focus-visible:outline-0', }, }} /> diff --git a/docs/data/base/components/form-control/BasicFormControl/tailwind/index.tsx.preview b/docs/data/base/components/form-control/BasicFormControl/tailwind/index.tsx.preview index c2e8de0d897c7d..f5d74c426a9415 100644 --- a/docs/data/base/components/form-control/BasicFormControl/tailwind/index.tsx.preview +++ b/docs/data/base/components/form-control/BasicFormControl/tailwind/index.tsx.preview @@ -5,7 +5,7 @@ slotProps={{ input: { className: - 'w-80 text-sm font-normal font-sans leading-normal text-slate-900 dark:text-slate-300 bg-white dark:bg-slate-800 border border-solid border-slate-200 dark:border-slate-700 px-3 py-2 rounded-lg hover:bg-slate-100 hover:dark:bg-slate-900 hover:border-slate-400 hover:dark:border-slate-700 focus:outline-0 focus:shadow-outline-purple', + 'w-80 text-sm font-sans font-normal leading-5 px-3 py-2 rounded-lg shadow-md shadow-slate-100 dark:shadow-slate-900 focus:shadow-outline-purple dark:focus:shadow-outline-purple focus:shadow-lg border border-solid border-slate-300 hover:border-purple-500 dark:hover:border-purple-500 focus:border-purple-500 dark:focus:border-purple-500 dark:border-slate-600 bg-white dark:bg-slate-900 text-slate-900 dark:text-slate-300 focus-visible:outline-0', }, }} /> diff --git a/docs/data/base/components/form-control/FormControlFunctionChild.js b/docs/data/base/components/form-control/FormControlFunctionChild.js index 1d15c03b3e2ff4..c766da4a0de5d8 100644 --- a/docs/data/base/components/form-control/FormControlFunctionChild.js +++ b/docs/data/base/components/form-control/FormControlFunctionChild.js @@ -22,23 +22,25 @@ const StyledInput = styled(Input)( .${inputClasses.input} { width: 320px; - font-size: 0.875rem; font-family: IBM Plex Sans, sans-serif; + font-size: 0.875rem; font-weight: 400; line-height: 1.5; - color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]}; - background: ${theme.palette.mode === 'dark' ? grey[900] : grey[50]}; - border: 1px solid ${theme.palette.mode === 'dark' ? grey[800] : grey[300]}; + padding: 8px 12px; border-radius: 8px; - padding: 12px 12px; + color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]}; + background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'}; + border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; + box-shadow: 0px 2px 2px ${theme.palette.mode === 'dark' ? grey[900] : grey[50]}; &:hover { - background: ${theme.palette.mode === 'dark' ? '' : grey[100]}; - border-color: ${theme.palette.mode === 'dark' ? grey[700] : grey[400]}; + border-color: ${blue[400]}; } &:focus { - outline: 3px solid ${theme.palette.mode === 'dark' ? blue[600] : blue[100]}; + outline: 0; + border-color: ${blue[400]}; + box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[600] : blue[200]}; } } diff --git a/docs/data/base/components/form-control/FormControlFunctionChild.tsx b/docs/data/base/components/form-control/FormControlFunctionChild.tsx index 2ec9f57b26b993..a952029df0cba8 100644 --- a/docs/data/base/components/form-control/FormControlFunctionChild.tsx +++ b/docs/data/base/components/form-control/FormControlFunctionChild.tsx @@ -22,23 +22,25 @@ const StyledInput = styled(Input)( .${inputClasses.input} { width: 320px; - font-size: 0.875rem; font-family: IBM Plex Sans, sans-serif; + font-size: 0.875rem; font-weight: 400; line-height: 1.5; - color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]}; - background: ${theme.palette.mode === 'dark' ? grey[900] : grey[50]}; - border: 1px solid ${theme.palette.mode === 'dark' ? grey[800] : grey[300]}; + padding: 8px 12px; border-radius: 8px; - padding: 12px 12px; + color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]}; + background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'}; + border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; + box-shadow: 0px 2px 2px ${theme.palette.mode === 'dark' ? grey[900] : grey[50]}; &:hover { - background: ${theme.palette.mode === 'dark' ? '' : grey[100]}; - border-color: ${theme.palette.mode === 'dark' ? grey[700] : grey[400]}; + border-color: ${blue[400]}; } &:focus { - outline: 3px solid ${theme.palette.mode === 'dark' ? blue[600] : blue[100]}; + outline: 0; + border-color: ${blue[400]}; + box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[600] : blue[200]}; } } diff --git a/docs/data/base/components/input/InputAdornments.js b/docs/data/base/components/input/InputAdornments.js index 53ccfa9ad38663..8ab68d2ff47854 100644 --- a/docs/data/base/components/input/InputAdornments.js +++ b/docs/data/base/components/input/InputAdornments.js @@ -1,11 +1,10 @@ import * as React from 'react'; import PropTypes from 'prop-types'; -import Box from '@mui/material/Box'; +import { Box, styled } from '@mui/system'; import { Button } from '@mui/base/Button'; import { Input as BaseInput, inputClasses } from '@mui/base/Input'; import Visibility from '@mui/icons-material/Visibility'; import VisibilityOff from '@mui/icons-material/VisibilityOff'; -import { styled } from '@mui/system'; const Input = React.forwardRef(function CustomInput(props, ref) { const { slots, ...other } = props; @@ -79,11 +78,16 @@ export default function InputAdornments() { endAdornment={ - {values.showPassword ? : } + {values.showPassword ? ( + + ) : ( + + )} } @@ -98,6 +102,7 @@ const blue = { 400: '#3399FF', 500: '#007FFF', 600: '#0072E5', + 700: '#0059B2', }; const grey = { @@ -121,7 +126,9 @@ const InputRoot = styled('div')( color: ${theme.palette.mode === 'dark' ? grey[300] : grey[500]}; background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'}; border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; - box-shadow: 0px 2px 2px ${theme.palette.mode === 'dark' ? grey[900] : grey[50]}; + box-shadow: 0px 2px 4px ${ + theme.palette.mode === 'dark' ? 'rgba(0,0,0, 0.5)' : 'rgba(0,0,0, 0.05)' + }; display: flex; align-items: center; justify-content: center; @@ -129,7 +136,7 @@ const InputRoot = styled('div')( &.${inputClasses.focused} { border-color: ${blue[400]}; - box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[500] : blue[200]}; + box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[600] : blue[200]}; } &:hover { diff --git a/docs/data/base/components/input/InputAdornments.tsx b/docs/data/base/components/input/InputAdornments.tsx index 3d48b596be6d66..4fda1c5368f3ef 100644 --- a/docs/data/base/components/input/InputAdornments.tsx +++ b/docs/data/base/components/input/InputAdornments.tsx @@ -1,10 +1,9 @@ import * as React from 'react'; -import Box from '@mui/material/Box'; +import { Box, styled } from '@mui/system'; import { Button } from '@mui/base/Button'; import { Input as BaseInput, InputProps, inputClasses } from '@mui/base/Input'; import Visibility from '@mui/icons-material/Visibility'; import VisibilityOff from '@mui/icons-material/VisibilityOff'; -import { styled } from '@mui/system'; const Input = React.forwardRef(function CustomInput( props: InputProps, @@ -77,11 +76,16 @@ export default function InputAdornments() { endAdornment={ - {values.showPassword ? : } + {values.showPassword ? ( + + ) : ( + + )} } @@ -96,6 +100,7 @@ const blue = { 400: '#3399FF', 500: '#007FFF', 600: '#0072E5', + 700: '#0059B2', }; const grey = { @@ -119,7 +124,9 @@ const InputRoot = styled('div')( color: ${theme.palette.mode === 'dark' ? grey[300] : grey[500]}; background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'}; border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; - box-shadow: 0px 2px 2px ${theme.palette.mode === 'dark' ? grey[900] : grey[50]}; + box-shadow: 0px 2px 4px ${ + theme.palette.mode === 'dark' ? 'rgba(0,0,0, 0.5)' : 'rgba(0,0,0, 0.05)' + }; display: flex; align-items: center; justify-content: center; @@ -127,7 +134,7 @@ const InputRoot = styled('div')( &.${inputClasses.focused} { border-color: ${blue[400]}; - box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[500] : blue[200]}; + box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[600] : blue[200]}; } &:hover { diff --git a/docs/data/base/components/input/InputMultiline.js b/docs/data/base/components/input/InputMultiline.js index 01815fac298d65..3d592879711ef9 100644 --- a/docs/data/base/components/input/InputMultiline.js +++ b/docs/data/base/components/input/InputMultiline.js @@ -7,7 +7,7 @@ const Input = React.forwardRef(function CustomInput(props, ref) { ` - width: 320px; - font-family: IBM Plex Sans, sans-serif; - font-size: 0.875rem; - font-weight: 400; - line-height: 1.5; - padding: 8px 12px; - border-radius: 8px; - color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]}; - background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'}; - border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; - box-shadow: 0px 2px 2px ${theme.palette.mode === 'dark' ? grey[900] : grey[50]}; - - &:hover { - border-color: ${blue[400]}; - } - - &:focus { - border-color: ${blue[400]}; - box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[500] : blue[200]}; - } - - // firefox - &:focus-visible { - outline: 0; - } -`, -); - const TextareaElement = styled('textarea', { shouldForwardProp: (prop) => !['ownerState', 'minRows', 'maxRows'].includes(prop.toString()), @@ -87,11 +58,13 @@ const TextareaElement = styled('textarea', { font-weight: 400; line-height: 1.5rem; padding: 8px 12px; - border-radius: 8px; + border-radius: 8px 8px 0 8px; color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]}; background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'}; border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; - box-shadow: 0px 2px 2px ${theme.palette.mode === 'dark' ? grey[900] : grey[50]}; + box-shadow: 0px 2px 4px ${ + theme.palette.mode === 'dark' ? 'rgba(0,0,0, 0.5)' : 'rgba(0,0,0, 0.05)' + }; &:hover { border-color: ${blue[400]}; @@ -99,7 +72,7 @@ const TextareaElement = styled('textarea', { &:focus { border-color: ${blue[400]}; - box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[500] : blue[200]}; + box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[700] : blue[200]}; } // firefox diff --git a/docs/data/base/components/input/InputMultiline.tsx b/docs/data/base/components/input/InputMultiline.tsx index a3cd09d624a012..fab8f1be4cbf66 100644 --- a/docs/data/base/components/input/InputMultiline.tsx +++ b/docs/data/base/components/input/InputMultiline.tsx @@ -10,7 +10,7 @@ const Input = React.forwardRef(function CustomInput( ` - width: 320px; - font-family: IBM Plex Sans, sans-serif; - font-size: 0.875rem; - font-weight: 400; - line-height: 1.5; - padding: 8px 12px; - border-radius: 8px; - color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]}; - background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'}; - border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; - box-shadow: 0px 2px 2px ${theme.palette.mode === 'dark' ? grey[900] : grey[50]}; - - &:hover { - border-color: ${blue[400]}; - } - - &:focus { - border-color: ${blue[400]}; - box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[500] : blue[200]}; - } - - // firefox - &:focus-visible { - outline: 0; - } -`, -); - const TextareaElement = styled('textarea', { shouldForwardProp: (prop) => !['ownerState', 'minRows', 'maxRows'].includes(prop.toString()), @@ -90,11 +61,13 @@ const TextareaElement = styled('textarea', { font-weight: 400; line-height: 1.5rem; padding: 8px 12px; - border-radius: 8px; + border-radius: 8px 8px 0 8px; color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]}; background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'}; border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; - box-shadow: 0px 2px 2px ${theme.palette.mode === 'dark' ? grey[900] : grey[50]}; + box-shadow: 0px 2px 4px ${ + theme.palette.mode === 'dark' ? 'rgba(0,0,0, 0.5)' : 'rgba(0,0,0, 0.05)' + }; &:hover { border-color: ${blue[400]}; @@ -102,7 +75,7 @@ const TextareaElement = styled('textarea', { &:focus { border-color: ${blue[400]}; - box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[500] : blue[200]}; + box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[700] : blue[200]}; } // firefox diff --git a/docs/data/base/components/input/InputMultilineAutosize.js b/docs/data/base/components/input/InputMultilineAutosize.js index dcc0779e5702c4..2026ecf40a5b4a 100644 --- a/docs/data/base/components/input/InputMultilineAutosize.js +++ b/docs/data/base/components/input/InputMultilineAutosize.js @@ -8,7 +8,7 @@ const Input = React.forwardRef(function CustomInput(props, ref) { ` - width: 320px; - font-family: IBM Plex Sans, sans-serif; - font-size: 0.875rem; - font-weight: 400; - line-height: 1.5; - padding: 8px 12px; - border-radius: 8px; - color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]}; - background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'}; - border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; - box-shadow: 0px 2px 2px ${theme.palette.mode === 'dark' ? grey[900] : grey[50]}; - - &:hover { - border-color: ${blue[400]}; - } - - &:focus { - border-color: ${blue[400]}; - box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[500] : blue[200]}; - } - - // firefox - &:focus-visible { - outline: 0; - } -`, -); - const TextareaElement = styled(TextareaAutosize)( ({ theme }) => ` width: 320px; @@ -85,11 +56,13 @@ const TextareaElement = styled(TextareaAutosize)( font-weight: 400; line-height: 1.5rem; padding: 8px 12px; - border-radius: 8px; + border-radius: 8px 8px 0 8px; color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]}; background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'}; border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; - box-shadow: 0px 2px 2px ${theme.palette.mode === 'dark' ? grey[900] : grey[50]}; + box-shadow: 0px 2px 4px ${ + theme.palette.mode === 'dark' ? 'rgba(0,0,0, 0.5)' : 'rgba(0,0,0, 0.05)' + }; &:hover { border-color: ${blue[400]}; diff --git a/docs/data/base/components/input/InputMultilineAutosize.tsx b/docs/data/base/components/input/InputMultilineAutosize.tsx index 7f50f9eeea76f1..1cee3e28cf0351 100644 --- a/docs/data/base/components/input/InputMultilineAutosize.tsx +++ b/docs/data/base/components/input/InputMultilineAutosize.tsx @@ -11,7 +11,7 @@ const Input = React.forwardRef(function CustomInput( ` - width: 320px; - font-family: IBM Plex Sans, sans-serif; - font-size: 0.875rem; - font-weight: 400; - line-height: 1.5; - padding: 8px 12px; - border-radius: 8px; - color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]}; - background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'}; - border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; - box-shadow: 0px 2px 2px ${theme.palette.mode === 'dark' ? grey[900] : grey[50]}; - - &:hover { - border-color: ${blue[400]}; - } - - &:focus { - border-color: ${blue[400]}; - box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[500] : blue[200]}; - } - - // firefox - &:focus-visible { - outline: 0; - } -`, -); - const TextareaElement = styled(TextareaAutosize)( ({ theme }) => ` width: 320px; @@ -88,11 +59,13 @@ const TextareaElement = styled(TextareaAutosize)( font-weight: 400; line-height: 1.5rem; padding: 8px 12px; - border-radius: 8px; + border-radius: 8px 8px 0 8px; color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]}; background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'}; border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; - box-shadow: 0px 2px 2px ${theme.palette.mode === 'dark' ? grey[900] : grey[50]}; + box-shadow: 0px 2px 4px ${ + theme.palette.mode === 'dark' ? 'rgba(0,0,0, 0.5)' : 'rgba(0,0,0, 0.05)' + }; &:hover { border-color: ${blue[400]}; diff --git a/docs/data/base/components/input/UnstyledInputBasic/css/index.js b/docs/data/base/components/input/UnstyledInputBasic/css/index.js index a64877d635bed1..267fffdaf76aee 100644 --- a/docs/data/base/components/input/UnstyledInputBasic/css/index.js +++ b/docs/data/base/components/input/UnstyledInputBasic/css/index.js @@ -72,7 +72,7 @@ function Styles() { &:focus { border-color: ${cyan[400]}; - box-shadow: 0 0 0 3px ${isDarkMode ? cyan[500] : cyan[200]}; + box-shadow: 0 0 0 3px ${isDarkMode ? cyan[600] : cyan[200]}; } &:focus-visible { diff --git a/docs/data/base/components/input/UnstyledInputBasic/css/index.tsx b/docs/data/base/components/input/UnstyledInputBasic/css/index.tsx index a64877d635bed1..267fffdaf76aee 100644 --- a/docs/data/base/components/input/UnstyledInputBasic/css/index.tsx +++ b/docs/data/base/components/input/UnstyledInputBasic/css/index.tsx @@ -72,7 +72,7 @@ function Styles() { &:focus { border-color: ${cyan[400]}; - box-shadow: 0 0 0 3px ${isDarkMode ? cyan[500] : cyan[200]}; + box-shadow: 0 0 0 3px ${isDarkMode ? cyan[600] : cyan[200]}; } &:focus-visible { diff --git a/docs/data/base/components/input/UnstyledInputBasic/system/index.js b/docs/data/base/components/input/UnstyledInputBasic/system/index.js index a2a77d121f090b..5e2411801ec107 100644 --- a/docs/data/base/components/input/UnstyledInputBasic/system/index.js +++ b/docs/data/base/components/input/UnstyledInputBasic/system/index.js @@ -51,7 +51,7 @@ const InputElement = styled('input')( &:focus { border-color: ${blue[400]}; - box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[500] : blue[200]}; + box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[600] : blue[200]}; } // firefox diff --git a/docs/data/base/components/input/UnstyledInputBasic/system/index.tsx b/docs/data/base/components/input/UnstyledInputBasic/system/index.tsx index a1a75d1be3b22c..18abe87b2be58e 100644 --- a/docs/data/base/components/input/UnstyledInputBasic/system/index.tsx +++ b/docs/data/base/components/input/UnstyledInputBasic/system/index.tsx @@ -54,7 +54,7 @@ const InputElement = styled('input')( &:focus { border-color: ${blue[400]}; - box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[500] : blue[200]}; + box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[600] : blue[200]}; } // firefox diff --git a/docs/data/base/components/input/UnstyledInputIntroduction/css/index.js b/docs/data/base/components/input/UnstyledInputIntroduction/css/index.js index 7db613fae34b34..d21a199bd02242 100644 --- a/docs/data/base/components/input/UnstyledInputIntroduction/css/index.js +++ b/docs/data/base/components/input/UnstyledInputIntroduction/css/index.js @@ -64,7 +64,9 @@ function Styles() { color: ${isDarkMode ? grey[300] : grey[900]}; background: ${isDarkMode ? grey[900] : '#fff'}; border: 1px solid ${isDarkMode ? grey[700] : grey[200]}; - box-shadow: 0px 2px 24px ${isDarkMode ? cyan[800] : cyan[100]}; + box-shadow: 0px 2px 4px ${ + isDarkMode ? 'rgba(0,0,0, 0.5)' : 'rgba(0,0,0, 0.05)' + }; &:hover { border-color: ${cyan[400]}; diff --git a/docs/data/base/components/input/UnstyledInputIntroduction/css/index.tsx b/docs/data/base/components/input/UnstyledInputIntroduction/css/index.tsx index 7db613fae34b34..d21a199bd02242 100644 --- a/docs/data/base/components/input/UnstyledInputIntroduction/css/index.tsx +++ b/docs/data/base/components/input/UnstyledInputIntroduction/css/index.tsx @@ -64,7 +64,9 @@ function Styles() { color: ${isDarkMode ? grey[300] : grey[900]}; background: ${isDarkMode ? grey[900] : '#fff'}; border: 1px solid ${isDarkMode ? grey[700] : grey[200]}; - box-shadow: 0px 2px 24px ${isDarkMode ? cyan[800] : cyan[100]}; + box-shadow: 0px 2px 4px ${ + isDarkMode ? 'rgba(0,0,0, 0.5)' : 'rgba(0,0,0, 0.05)' + }; &:hover { border-color: ${cyan[400]}; diff --git a/docs/data/base/components/input/UnstyledInputIntroduction/system/index.js b/docs/data/base/components/input/UnstyledInputIntroduction/system/index.js index 1a7ccc2f1608a2..639d71cb3df671 100644 --- a/docs/data/base/components/input/UnstyledInputIntroduction/system/index.js +++ b/docs/data/base/components/input/UnstyledInputIntroduction/system/index.js @@ -44,7 +44,9 @@ const InputElement = styled('input')( color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]}; background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'}; border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; - box-shadow: 0px 2px 24px ${theme.palette.mode === 'dark' ? blue[900] : blue[100]}; + box-shadow: 0px 2px 4px ${ + theme.palette.mode === 'dark' ? 'rgba(0,0,0, 0.5)' : 'rgba(0,0,0, 0.05)' + }; &:hover { border-color: ${blue[400]}; diff --git a/docs/data/base/components/input/UnstyledInputIntroduction/system/index.tsx b/docs/data/base/components/input/UnstyledInputIntroduction/system/index.tsx index f7da1c165b0de0..baa932fff2a6c3 100644 --- a/docs/data/base/components/input/UnstyledInputIntroduction/system/index.tsx +++ b/docs/data/base/components/input/UnstyledInputIntroduction/system/index.tsx @@ -47,7 +47,9 @@ const InputElement = styled('input')( color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]}; background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'}; border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; - box-shadow: 0px 2px 24px ${theme.palette.mode === 'dark' ? blue[900] : blue[100]}; + box-shadow: 0px 2px 4px ${ + theme.palette.mode === 'dark' ? 'rgba(0,0,0, 0.5)' : 'rgba(0,0,0, 0.05)' + }; &:hover { border-color: ${blue[400]}; diff --git a/docs/data/base/components/input/UnstyledInputIntroduction/tailwind/index.js b/docs/data/base/components/input/UnstyledInputIntroduction/tailwind/index.js index 863bce82d7ee99..f92fd7173a997c 100644 --- a/docs/data/base/components/input/UnstyledInputIntroduction/tailwind/index.js +++ b/docs/data/base/components/input/UnstyledInputIntroduction/tailwind/index.js @@ -34,7 +34,7 @@ const Input = React.forwardRef((props, ref) => { return { ...resolvedSlotProps, className: clsx( - 'w-80 text-sm font-normal font-sans leading-5 px-3 py-2 rounded-lg shadow-md shadow-slate-100 dark:shadow-slate-900 focus:shadow-outline-purple dark:focus:shadow-outline-purple focus:shadow-lg border border-solid border-slate-300 hover:border-purple-500 dark:hover:border-purple-500 focus:border-purple-500 dark:focus:border-purple-500 dark:border-slate-600 bg-white dark:bg-slate-900 text-slate-900 dark:text-slate-300 focus-visible:outline-0', + 'w-80 text-sm font-normal font-sans leading-5 px-3 py-2 rounded-lg shadow-md shadow-slate-100 dark:shadow-slate-900 focus:shadow-outline-purple dark:focus:shadow-outline-purple dark:outline-purple-600 focus:shadow-lg border border-solid border-slate-300 hover:border-purple-500 dark:hover:border-purple-500 focus:border-purple-500 dark:focus:border-purple-600 dark:border-slate-600 bg-white dark:bg-slate-900 text-slate-900 dark:text-slate-300 focus-visible:outline-0', resolvedSlotProps?.className, ), }; diff --git a/docs/data/base/components/input/UnstyledInputIntroduction/tailwind/index.tsx b/docs/data/base/components/input/UnstyledInputIntroduction/tailwind/index.tsx index 521b5e2b822c6e..102d996ae90908 100644 --- a/docs/data/base/components/input/UnstyledInputIntroduction/tailwind/index.tsx +++ b/docs/data/base/components/input/UnstyledInputIntroduction/tailwind/index.tsx @@ -34,7 +34,7 @@ const Input = React.forwardRef((props, ref) => { return { ...resolvedSlotProps, className: clsx( - 'w-80 text-sm font-normal font-sans leading-5 px-3 py-2 rounded-lg shadow-md shadow-slate-100 dark:shadow-slate-900 focus:shadow-outline-purple dark:focus:shadow-outline-purple focus:shadow-lg border border-solid border-slate-300 hover:border-purple-500 dark:hover:border-purple-500 focus:border-purple-500 dark:focus:border-purple-500 dark:border-slate-600 bg-white dark:bg-slate-900 text-slate-900 dark:text-slate-300 focus-visible:outline-0', + 'w-80 text-sm font-normal font-sans leading-5 px-3 py-2 rounded-lg shadow-md shadow-slate-100 dark:shadow-slate-900 focus:shadow-outline-purple dark:focus:shadow-outline-purple dark:outline-purple-600 focus:shadow-lg border border-solid border-slate-300 hover:border-purple-500 dark:hover:border-purple-500 focus:border-purple-500 dark:focus:border-purple-600 dark:border-slate-600 bg-white dark:bg-slate-900 text-slate-900 dark:text-slate-300 focus-visible:outline-0', resolvedSlotProps?.className, ), }; diff --git a/docs/data/base/components/input/UseInput.js b/docs/data/base/components/input/UseInput.js index ef81f4af696f38..55eb776818ef54 100644 --- a/docs/data/base/components/input/UseInput.js +++ b/docs/data/base/components/input/UseInput.js @@ -28,6 +28,7 @@ const blue = { 400: '#3399FF', 500: '#007FFF', 600: '#0072E5', + 700: '#0059B2', }; const grey = { @@ -55,7 +56,9 @@ const StyledInputElement = styled('input')( color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]}; background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'}; border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; - box-shadow: 0px 2px 2px ${theme.palette.mode === 'dark' ? grey[900] : grey[50]}; + box-shadow: 0px 2px 4px ${ + theme.palette.mode === 'dark' ? 'rgba(0,0,0, 0.5)' : 'rgba(0,0,0, 0.05)' + }; &:hover { border-color: ${blue[400]}; @@ -63,7 +66,7 @@ const StyledInputElement = styled('input')( &:focus { border-color: ${blue[400]}; - box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[500] : blue[200]}; + box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[600] : blue[200]}; } // firefox diff --git a/docs/data/base/components/input/UseInput.tsx b/docs/data/base/components/input/UseInput.tsx index 244addad780d32..853a256ba02b71 100644 --- a/docs/data/base/components/input/UseInput.tsx +++ b/docs/data/base/components/input/UseInput.tsx @@ -31,6 +31,7 @@ const blue = { 400: '#3399FF', 500: '#007FFF', 600: '#0072E5', + 700: '#0059B2', }; const grey = { @@ -58,7 +59,9 @@ const StyledInputElement = styled('input')( color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]}; background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'}; border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; - box-shadow: 0px 2px 2px ${theme.palette.mode === 'dark' ? grey[900] : grey[50]}; + box-shadow: 0px 2px 4px ${ + theme.palette.mode === 'dark' ? 'rgba(0,0,0, 0.5)' : 'rgba(0,0,0, 0.05)' + }; &:hover { border-color: ${blue[400]}; @@ -66,7 +69,7 @@ const StyledInputElement = styled('input')( &:focus { border-color: ${blue[400]}; - box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[500] : blue[200]}; + box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[600] : blue[200]}; } // firefox diff --git a/docs/data/base/components/menu/MenuIntroduction/css/index.js b/docs/data/base/components/menu/MenuIntroduction/css/index.js index 6e0530275de76e..8a9793cf215952 100644 --- a/docs/data/base/components/menu/MenuIntroduction/css/index.js +++ b/docs/data/base/components/menu/MenuIntroduction/css/index.js @@ -60,16 +60,16 @@ const cyan = { }; const grey = { - 50: '#f6f8fa', - 100: '#eaeef2', - 200: '#d0d7de', - 300: '#afb8c1', - 400: '#8c959f', - 500: '#6e7781', - 600: '#57606a', - 700: '#424a53', - 800: '#32383f', - 900: '#24292f', + 50: '#F3F6F9', + 100: '#E5EAF2', + 200: '#DAE2ED', + 300: '#C7D0DD', + 400: '#B0B8C4', + 500: '#9DA8B7', + 600: '#6B7A90', + 700: '#434D5B', + 800: '#303740', + 900: '#1C2025', }; function useIsDarkMode() { @@ -128,32 +128,34 @@ function Styles() { .TriggerButtonIntroduction { font-family: IBM Plex Sans, sans-serif; - font-size: 0.875rem; font-weight: 600; - box-sizing: border-box; - min-height: calc(1.5em + 22px); - border-radius: 12px; - padding: 8px 14px; + font-size: 0.875rem; line-height: 1.5; - background: ${isDarkMode ? grey[900] : '#fff'}; + padding: 8px 16px; + border-radius: 8px; + color: white; + transition: all 150ms ease; cursor: pointer; + background: ${isDarkMode ? grey[900] : '#fff'}; border: 1px solid ${isDarkMode ? grey[700] : grey[200]}; - color: ${isDarkMode ? grey[300] : grey[900]}; + color: ${isDarkMode ? grey[200] : grey[900]}; + box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); + + &:hover { + background: ${isDarkMode ? grey[800] : grey[50]}; + border-color: ${isDarkMode ? grey[600] : grey[300]}; + } - transition-property: all; - transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); - transition-duration: 120ms; + &:active { + background: ${isDarkMode ? grey[700] : grey[100]}; + } + + &:focus-visible { + box-shadow: 0 0 0 4px ${isDarkMode ? cyan[300] : cyan[200]}; + outline: none; + } } - .TriggerButtonIntroduction:hover { - background: ${isDarkMode ? grey[800] : grey[50]}; - border-color: ${isDarkMode ? grey[600] : grey[300]}; - } - - .TriggerButtonIntroduction:focus-visible { - border-color: ${cyan[400]}; - outline: 3px solid ${isDarkMode ? cyan[500] : cyan[200]}; - } .CustomMenuIntroduction { z-index: 1; diff --git a/docs/data/base/components/menu/MenuIntroduction/css/index.tsx b/docs/data/base/components/menu/MenuIntroduction/css/index.tsx index 70ee0fda43b8c4..3ef0c7e9860ceb 100644 --- a/docs/data/base/components/menu/MenuIntroduction/css/index.tsx +++ b/docs/data/base/components/menu/MenuIntroduction/css/index.tsx @@ -60,16 +60,16 @@ const cyan = { }; const grey = { - 50: '#f6f8fa', - 100: '#eaeef2', - 200: '#d0d7de', - 300: '#afb8c1', - 400: '#8c959f', - 500: '#6e7781', - 600: '#57606a', - 700: '#424a53', - 800: '#32383f', - 900: '#24292f', + 50: '#F3F6F9', + 100: '#E5EAF2', + 200: '#DAE2ED', + 300: '#C7D0DD', + 400: '#B0B8C4', + 500: '#9DA8B7', + 600: '#6B7A90', + 700: '#434D5B', + 800: '#303740', + 900: '#1C2025', }; function useIsDarkMode() { @@ -128,32 +128,34 @@ function Styles() { .TriggerButtonIntroduction { font-family: IBM Plex Sans, sans-serif; - font-size: 0.875rem; font-weight: 600; - box-sizing: border-box; - min-height: calc(1.5em + 22px); - border-radius: 12px; - padding: 8px 14px; + font-size: 0.875rem; line-height: 1.5; - background: ${isDarkMode ? grey[900] : '#fff'}; + padding: 8px 16px; + border-radius: 8px; + color: white; + transition: all 150ms ease; cursor: pointer; + background: ${isDarkMode ? grey[900] : '#fff'}; border: 1px solid ${isDarkMode ? grey[700] : grey[200]}; - color: ${isDarkMode ? grey[300] : grey[900]}; + color: ${isDarkMode ? grey[200] : grey[900]}; + box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); + + &:hover { + background: ${isDarkMode ? grey[800] : grey[50]}; + border-color: ${isDarkMode ? grey[600] : grey[300]}; + } - transition-property: all; - transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); - transition-duration: 120ms; + &:active { + background: ${isDarkMode ? grey[700] : grey[100]}; + } + + &:focus-visible { + box-shadow: 0 0 0 4px ${isDarkMode ? cyan[300] : cyan[200]}; + outline: none; + } } - .TriggerButtonIntroduction:hover { - background: ${isDarkMode ? grey[800] : grey[50]}; - border-color: ${isDarkMode ? grey[600] : grey[300]}; - } - - .TriggerButtonIntroduction:focus-visible { - border-color: ${cyan[400]}; - outline: 3px solid ${isDarkMode ? cyan[500] : cyan[200]}; - } .CustomMenuIntroduction { z-index: 1; diff --git a/docs/data/base/components/menu/MenuIntroduction/system/index.js b/docs/data/base/components/menu/MenuIntroduction/system/index.js index 4d5f34ddb2b8fa..5e7c7c36312592 100644 --- a/docs/data/base/components/menu/MenuIntroduction/system/index.js +++ b/docs/data/base/components/menu/MenuIntroduction/system/index.js @@ -27,25 +27,29 @@ export default function MenuIntroduction() { } const blue = { - 100: '#DAECFF', + 50: '#F0F7FF', + 100: '#C2E0FF', 200: '#99CCF3', + 300: '#66B2FF', 400: '#3399FF', 500: '#007FFF', - 600: '#0072E5', + 600: '#0072E6', + 700: '#0059B3', + 800: '#004C99', 900: '#003A75', }; const grey = { - 50: '#f6f8fa', - 100: '#eaeef2', - 200: '#d0d7de', - 300: '#afb8c1', - 400: '#8c959f', - 500: '#6e7781', - 600: '#57606a', - 700: '#424a53', - 800: '#32383f', - 900: '#24292f', + 50: '#F3F6F9', + 100: '#E5EAF2', + 200: '#DAE2ED', + 300: '#C7D0DD', + 400: '#B0B8C4', + 500: '#9DA8B7', + 600: '#6B7A90', + 700: '#434D5B', + 800: '#303740', + 900: '#1C2025', }; const Listbox = styled('ul')( @@ -90,8 +94,8 @@ const MenuItem = styled(BaseMenuItem)( } &:hover:not(.${menuItemClasses.disabled}) { - background-color: ${theme.palette.mode === 'dark' ? grey[800] : grey[100]}; - color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]}; + background-color: ${theme.palette.mode === 'dark' ? blue[900] : blue[50]}; + color: ${theme.palette.mode === 'dark' ? blue[100] : blue[900]}; } `, ); @@ -99,29 +103,31 @@ const MenuItem = styled(BaseMenuItem)( const MenuButton = styled(BaseMenuButton)( ({ theme }) => ` font-family: IBM Plex Sans, sans-serif; - font-size: 0.875rem; font-weight: 600; - box-sizing: border-box; - min-height: calc(1.5em + 22px); - border-radius: 12px; - padding: 8px 14px; + font-size: 0.875rem; line-height: 1.5; + padding: 8px 16px; + border-radius: 8px; + color: white; + transition: all 150ms ease; + cursor: pointer; background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'}; border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; - color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]}; - - transition-property: all; - transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); - transition-duration: 120ms; + color: ${theme.palette.mode === 'dark' ? grey[200] : grey[900]}; + box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); &:hover { background: ${theme.palette.mode === 'dark' ? grey[800] : grey[50]}; border-color: ${theme.palette.mode === 'dark' ? grey[600] : grey[300]}; } + &:active { + background: ${theme.palette.mode === 'dark' ? grey[700] : grey[100]}; + } + &:focus-visible { - border-color: ${blue[400]}; - outline: 3px solid ${theme.palette.mode === 'dark' ? blue[500] : blue[200]}; + box-shadow: 0 0 0 4px ${theme.palette.mode === 'dark' ? blue[300] : blue[200]}; + outline: none; } `, ); diff --git a/docs/data/base/components/menu/MenuIntroduction/system/index.tsx b/docs/data/base/components/menu/MenuIntroduction/system/index.tsx index fdb17c7e40c206..d5ce5a00829dd2 100644 --- a/docs/data/base/components/menu/MenuIntroduction/system/index.tsx +++ b/docs/data/base/components/menu/MenuIntroduction/system/index.tsx @@ -27,25 +27,29 @@ export default function MenuIntroduction() { } const blue = { - 100: '#DAECFF', + 50: '#F0F7FF', + 100: '#C2E0FF', 200: '#99CCF3', + 300: '#66B2FF', 400: '#3399FF', 500: '#007FFF', - 600: '#0072E5', + 600: '#0072E6', + 700: '#0059B3', + 800: '#004C99', 900: '#003A75', }; const grey = { - 50: '#f6f8fa', - 100: '#eaeef2', - 200: '#d0d7de', - 300: '#afb8c1', - 400: '#8c959f', - 500: '#6e7781', - 600: '#57606a', - 700: '#424a53', - 800: '#32383f', - 900: '#24292f', + 50: '#F3F6F9', + 100: '#E5EAF2', + 200: '#DAE2ED', + 300: '#C7D0DD', + 400: '#B0B8C4', + 500: '#9DA8B7', + 600: '#6B7A90', + 700: '#434D5B', + 800: '#303740', + 900: '#1C2025', }; const Listbox = styled('ul')( @@ -90,8 +94,8 @@ const MenuItem = styled(BaseMenuItem)( } &:hover:not(.${menuItemClasses.disabled}) { - background-color: ${theme.palette.mode === 'dark' ? grey[800] : grey[100]}; - color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]}; + background-color: ${theme.palette.mode === 'dark' ? blue[900] : blue[50]}; + color: ${theme.palette.mode === 'dark' ? blue[100] : blue[900]}; } `, ); @@ -99,29 +103,31 @@ const MenuItem = styled(BaseMenuItem)( const MenuButton = styled(BaseMenuButton)( ({ theme }) => ` font-family: IBM Plex Sans, sans-serif; - font-size: 0.875rem; font-weight: 600; - box-sizing: border-box; - min-height: calc(1.5em + 22px); - border-radius: 12px; - padding: 8px 14px; + font-size: 0.875rem; line-height: 1.5; + padding: 8px 16px; + border-radius: 8px; + color: white; + transition: all 150ms ease; + cursor: pointer; background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'}; border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; - color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]}; - - transition-property: all; - transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); - transition-duration: 120ms; + color: ${theme.palette.mode === 'dark' ? grey[200] : grey[900]}; + box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); &:hover { background: ${theme.palette.mode === 'dark' ? grey[800] : grey[50]}; border-color: ${theme.palette.mode === 'dark' ? grey[600] : grey[300]}; } + &:active { + background: ${theme.palette.mode === 'dark' ? grey[700] : grey[100]}; + } + &:focus-visible { - border-color: ${blue[400]}; - outline: 3px solid ${theme.palette.mode === 'dark' ? blue[500] : blue[200]}; + box-shadow: 0 0 0 4px ${theme.palette.mode === 'dark' ? blue[300] : blue[200]}; + outline: none; } `, ); diff --git a/docs/data/base/components/menu/MenuIntroduction/tailwind/index.js b/docs/data/base/components/menu/MenuIntroduction/tailwind/index.js index 6cb844adb3525d..0269a77e2bc4ae 100644 --- a/docs/data/base/components/menu/MenuIntroduction/tailwind/index.js +++ b/docs/data/base/components/menu/MenuIntroduction/tailwind/index.js @@ -98,7 +98,7 @@ const MenuButton = React.forwardRef((props, ref) => { ( - Dashboard + My account Profile - My account + Language settings Log out @@ -60,16 +60,16 @@ const cyan = { }; const grey = { - 50: '#f6f8fa', - 100: '#eaeef2', - 200: '#d0d7de', - 300: '#afb8c1', - 400: '#8c959f', - 500: '#6e7781', - 600: '#57606a', - 700: '#424a53', - 800: '#32383f', - 900: '#24292f', + 50: '#F3F6F9', + 100: '#E5EAF2', + 200: '#DAE2ED', + 300: '#C7D0DD', + 400: '#B0B8C4', + 500: '#9DA8B7', + 600: '#6B7A90', + 700: '#434D5B', + 800: '#303740', + 900: '#1C2025', }; function useIsDarkMode() { @@ -83,7 +83,7 @@ function Styles() { return ( diff --git a/docs/data/base/components/menu/MenuSimple/css/index.tsx b/docs/data/base/components/menu/MenuSimple/css/index.tsx index 90749a10a77fd2..a08f2a585c735f 100644 --- a/docs/data/base/components/menu/MenuSimple/css/index.tsx +++ b/docs/data/base/components/menu/MenuSimple/css/index.tsx @@ -14,28 +14,28 @@ export default function MenuSimple() { return ( - Dashboard + My account Profile - My account + Language settings Log out @@ -60,16 +60,16 @@ const cyan = { }; const grey = { - 50: '#f6f8fa', - 100: '#eaeef2', - 200: '#d0d7de', - 300: '#afb8c1', - 400: '#8c959f', - 500: '#6e7781', - 600: '#57606a', - 700: '#424a53', - 800: '#32383f', - 900: '#24292f', + 50: '#F3F6F9', + 100: '#E5EAF2', + 200: '#DAE2ED', + 300: '#C7D0DD', + 400: '#B0B8C4', + 500: '#9DA8B7', + 600: '#6B7A90', + 700: '#434D5B', + 800: '#303740', + 900: '#1C2025', }; function useIsDarkMode() { @@ -83,7 +83,7 @@ function Styles() { return ( diff --git a/docs/data/base/components/menu/MenuSimple/system/index.js b/docs/data/base/components/menu/MenuSimple/system/index.js index 768f2753c58189..fca67ddc4cc089 100644 --- a/docs/data/base/components/menu/MenuSimple/system/index.js +++ b/docs/data/base/components/menu/MenuSimple/system/index.js @@ -14,10 +14,12 @@ export default function MenuSimple() { return ( - Dashboard + My account Profile - My account + + Language settings + Log out @@ -26,26 +28,28 @@ export default function MenuSimple() { const blue = { 50: '#F0F7FF', - 100: '#DAECFF', + 100: '#C2E0FF', 200: '#99CCF3', 300: '#66B2FF', 400: '#3399FF', 500: '#007FFF', - 600: '#0072E5', + 600: '#0072E6', + 700: '#0059B3', + 800: '#004C99', 900: '#003A75', }; const grey = { - 50: '#f6f8fa', - 100: '#eaeef2', - 200: '#d0d7de', - 300: '#afb8c1', - 400: '#8c959f', - 500: '#6e7781', - 600: '#57606a', - 700: '#424a53', - 800: '#32383f', - 900: '#24292f', + 50: '#F3F6F9', + 100: '#E5EAF2', + 200: '#DAE2ED', + 300: '#C7D0DD', + 400: '#B0B8C4', + 500: '#9DA8B7', + 600: '#6B7A90', + 700: '#434D5B', + 800: '#303740', + 900: '#1C2025', }; const Listbox = styled('ul')( @@ -62,7 +66,9 @@ const Listbox = styled('ul')( background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'}; border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]}; - box-shadow: 0px 2px 16px ${theme.palette.mode === 'dark' ? grey[900] : grey[200]}; + box-shadow: 0px 4px 6px ${ + theme.palette.mode === 'dark' ? 'rgba(0,0,0, 0.50)' : 'rgba(0,0,0, 0.05)' + }; z-index: 1; `, ); @@ -90,8 +96,8 @@ const MenuItem = styled(BaseMenuItem)( } &:hover:not(.${menuItemClasses.disabled}) { - background-color: ${theme.palette.mode === 'dark' ? grey[800] : grey[100]}; - color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]}; + background-color: ${theme.palette.mode === 'dark' ? blue[900] : blue[50]}; + color: ${theme.palette.mode === 'dark' ? blue[100] : blue[900]}; } `, ); @@ -101,27 +107,29 @@ const MenuButton = styled(BaseMenuButton)( font-family: IBM Plex Sans, sans-serif; font-weight: 600; font-size: 0.875rem; - box-sizing: border-box; - border-radius: 8px; - padding: 8px 16px; line-height: 1.5; - background: transparent; - border: 1px solid ${theme.palette.mode === 'dark' ? grey[800] : grey[200]}; - color: ${theme.palette.mode === 'dark' ? blue[300] : blue[500]}; + padding: 8px 16px; + border-radius: 8px; + color: white; + transition: all 150ms ease; cursor: pointer; - - transition-property: all; - transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); - transition-duration: 120ms; + background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'}; + border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; + color: ${theme.palette.mode === 'dark' ? grey[200] : grey[900]}; + box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); &:hover { background: ${theme.palette.mode === 'dark' ? grey[800] : grey[50]}; border-color: ${theme.palette.mode === 'dark' ? grey[600] : grey[300]}; } + &:active { + background: ${theme.palette.mode === 'dark' ? grey[700] : grey[100]}; + } + &:focus-visible { - border-color: ${blue[400]}; - outline: 3px solid ${theme.palette.mode === 'dark' ? blue[500] : blue[200]}; + box-shadow: 0 0 0 4px ${theme.palette.mode === 'dark' ? blue[300] : blue[200]}; + outline: none; } `, ); diff --git a/docs/data/base/components/menu/MenuSimple/system/index.tsx b/docs/data/base/components/menu/MenuSimple/system/index.tsx index 55fa325ee259c4..bb87629ee6d423 100644 --- a/docs/data/base/components/menu/MenuSimple/system/index.tsx +++ b/docs/data/base/components/menu/MenuSimple/system/index.tsx @@ -14,10 +14,12 @@ export default function MenuSimple() { return ( - Dashboard + My account Profile - My account + + Language settings + Log out @@ -26,26 +28,28 @@ export default function MenuSimple() { const blue = { 50: '#F0F7FF', - 100: '#DAECFF', + 100: '#C2E0FF', 200: '#99CCF3', 300: '#66B2FF', 400: '#3399FF', 500: '#007FFF', - 600: '#0072E5', + 600: '#0072E6', + 700: '#0059B3', + 800: '#004C99', 900: '#003A75', }; const grey = { - 50: '#f6f8fa', - 100: '#eaeef2', - 200: '#d0d7de', - 300: '#afb8c1', - 400: '#8c959f', - 500: '#6e7781', - 600: '#57606a', - 700: '#424a53', - 800: '#32383f', - 900: '#24292f', + 50: '#F3F6F9', + 100: '#E5EAF2', + 200: '#DAE2ED', + 300: '#C7D0DD', + 400: '#B0B8C4', + 500: '#9DA8B7', + 600: '#6B7A90', + 700: '#434D5B', + 800: '#303740', + 900: '#1C2025', }; const Listbox = styled('ul')( @@ -62,7 +66,9 @@ const Listbox = styled('ul')( background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'}; border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]}; - box-shadow: 0px 2px 16px ${theme.palette.mode === 'dark' ? grey[900] : grey[200]}; + box-shadow: 0px 4px 6px ${ + theme.palette.mode === 'dark' ? 'rgba(0,0,0, 0.50)' : 'rgba(0,0,0, 0.05)' + }; z-index: 1; `, ); @@ -90,8 +96,8 @@ const MenuItem = styled(BaseMenuItem)( } &:hover:not(.${menuItemClasses.disabled}) { - background-color: ${theme.palette.mode === 'dark' ? grey[800] : grey[100]}; - color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]}; + background-color: ${theme.palette.mode === 'dark' ? blue[900] : blue[50]}; + color: ${theme.palette.mode === 'dark' ? blue[100] : blue[900]}; } `, ); @@ -101,27 +107,29 @@ const MenuButton = styled(BaseMenuButton)( font-family: IBM Plex Sans, sans-serif; font-weight: 600; font-size: 0.875rem; - box-sizing: border-box; - border-radius: 8px; - padding: 8px 16px; line-height: 1.5; - background: transparent; - border: 1px solid ${theme.palette.mode === 'dark' ? grey[800] : grey[200]}; - color: ${theme.palette.mode === 'dark' ? blue[300] : blue[500]}; + padding: 8px 16px; + border-radius: 8px; + color: white; + transition: all 150ms ease; cursor: pointer; - - transition-property: all; - transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); - transition-duration: 120ms; + background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'}; + border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; + color: ${theme.palette.mode === 'dark' ? grey[200] : grey[900]}; + box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); &:hover { background: ${theme.palette.mode === 'dark' ? grey[800] : grey[50]}; border-color: ${theme.palette.mode === 'dark' ? grey[600] : grey[300]}; } + &:active { + background: ${theme.palette.mode === 'dark' ? grey[700] : grey[100]}; + } + &:focus-visible { - border-color: ${blue[400]}; - outline: 3px solid ${theme.palette.mode === 'dark' ? blue[500] : blue[200]}; + box-shadow: 0 0 0 4px ${theme.palette.mode === 'dark' ? blue[300] : blue[200]}; + outline: none; } `, ); diff --git a/docs/data/base/components/menu/MenuSimple/system/index.tsx.preview b/docs/data/base/components/menu/MenuSimple/system/index.tsx.preview index 9ee84b87e564d7..7dd86352523212 100644 --- a/docs/data/base/components/menu/MenuSimple/system/index.tsx.preview +++ b/docs/data/base/components/menu/MenuSimple/system/index.tsx.preview @@ -1,8 +1,10 @@ - Dashboard + My account Profile - My account + + Language settings + Log out \ No newline at end of file diff --git a/docs/data/base/components/menu/MenuSimple/tailwind/index.js b/docs/data/base/components/menu/MenuSimple/tailwind/index.js index f56ac73595c42f..3f340b60516636 100644 --- a/docs/data/base/components/menu/MenuSimple/tailwind/index.js +++ b/docs/data/base/components/menu/MenuSimple/tailwind/index.js @@ -25,11 +25,11 @@ export default function MenuSimple() { return (
- Dashboard + My account Profile - - My account + + Language settings Log out @@ -98,7 +98,7 @@ const MenuButton = React.forwardRef((props, ref) => { - Dashboard + My account Profile - - My account + + Language settings Log out @@ -88,7 +88,7 @@ const MenuButton = React.forwardRef( - Dashboard + My account Profile - - My account + + Language settings Log out diff --git a/docs/data/base/components/menu/UseMenu.js b/docs/data/base/components/menu/UseMenu.js index 2053fb5680b27c..6782ca4744d3ee 100644 --- a/docs/data/base/components/menu/UseMenu.js +++ b/docs/data/base/components/menu/UseMenu.js @@ -4,9 +4,9 @@ import clsx from 'clsx'; import { useMenu, MenuProvider } from '@mui/base/useMenu'; import { useMenuItem } from '@mui/base/useMenuItem'; import { Popper } from '@mui/base/Popper'; -import { GlobalStyles } from '@mui/system'; import { useDropdown, DropdownContext } from '@mui/base/useDropdown'; import { useMenuButton } from '@mui/base/useMenuButton'; +import { useTheme } from '@mui/system'; const Menu = React.forwardRef(function Menu(props, ref) { const { children, ...other } = props; @@ -74,7 +74,6 @@ export default function UseMenu() { return ( - Theme @@ -85,33 +84,47 @@ export default function UseMenu() { Dark + ); } -const grey = { - 50: '#f6f8fa', - 100: '#eaeef2', - 200: '#d0d7de', - 300: '#afb8c1', - 400: '#8c959f', - 500: '#6e7781', - 600: '#57606a', - 700: '#424a53', - 800: '#32383f', - 900: '#24292f', -}; - const blue = { - 100: '#DAECFF', + 50: '#F0F7FF', + 100: '#C2E0FF', 200: '#99CCF3', + 300: '#66B2FF', 400: '#3399FF', 500: '#007FFF', - 600: '#0072E5', + 600: '#0072E6', + 700: '#0059B3', + 800: '#004C99', 900: '#003A75', }; -const styles = ` +const grey = { + 50: '#F3F6F9', + 100: '#E5EAF2', + 200: '#DAE2ED', + 300: '#C7D0DD', + 400: '#B0B8C4', + 500: '#9DA8B7', + 600: '#6B7A90', + 700: '#434D5B', + 800: '#303740', + 900: '#1C2025', +}; + +function useIsDarkMode() { + const theme = useTheme(); + return theme.palette.mode === 'dark'; +} + +function Styles() { + // Replace this with your app logic for determining dark mode + const isDarkMode = useIsDarkMode(); + return ( + + ); +} diff --git a/docs/data/base/components/menu/UseMenu.tsx b/docs/data/base/components/menu/UseMenu.tsx index 129b7b2615f71b..869cb0cb29c5c3 100644 --- a/docs/data/base/components/menu/UseMenu.tsx +++ b/docs/data/base/components/menu/UseMenu.tsx @@ -3,9 +3,9 @@ import clsx from 'clsx'; import { useMenu, MenuProvider } from '@mui/base/useMenu'; import { useMenuItem } from '@mui/base/useMenuItem'; import { Popper } from '@mui/base/Popper'; -import { GlobalStyles } from '@mui/system'; import { useDropdown, DropdownContext } from '@mui/base/useDropdown'; import { useMenuButton } from '@mui/base/useMenuButton'; +import { useTheme } from '@mui/system'; const Menu = React.forwardRef(function Menu( props: React.ComponentPropsWithoutRef<'ul'>, @@ -73,7 +73,6 @@ export default function UseMenu() { return ( - Theme @@ -84,33 +83,47 @@ export default function UseMenu() { Dark + ); } -const grey = { - 50: '#f6f8fa', - 100: '#eaeef2', - 200: '#d0d7de', - 300: '#afb8c1', - 400: '#8c959f', - 500: '#6e7781', - 600: '#57606a', - 700: '#424a53', - 800: '#32383f', - 900: '#24292f', -}; - const blue = { - 100: '#DAECFF', + 50: '#F0F7FF', + 100: '#C2E0FF', 200: '#99CCF3', + 300: '#66B2FF', 400: '#3399FF', 500: '#007FFF', - 600: '#0072E5', + 600: '#0072E6', + 700: '#0059B3', + 800: '#004C99', 900: '#003A75', }; -const styles = ` +const grey = { + 50: '#F3F6F9', + 100: '#E5EAF2', + 200: '#DAE2ED', + 300: '#C7D0DD', + 400: '#B0B8C4', + 500: '#9DA8B7', + 600: '#6B7A90', + 700: '#434D5B', + 800: '#303740', + 900: '#1C2025', +}; + +function useIsDarkMode() { + const theme = useTheme(); + return theme.palette.mode === 'dark'; +} + +function Styles() { + // Replace this with your app logic for determining dark mode + const isDarkMode = useIsDarkMode(); + return ( + + ); +} diff --git a/docs/data/base/components/menu/UseMenu.tsx.preview b/docs/data/base/components/menu/UseMenu.tsx.preview index 7a2ef42544a44c..cef5c709001ef8 100644 --- a/docs/data/base/components/menu/UseMenu.tsx.preview +++ b/docs/data/base/components/menu/UseMenu.tsx.preview @@ -1,5 +1,4 @@ - Theme @@ -10,4 +9,5 @@ Dark + \ No newline at end of file diff --git a/docs/data/base/components/menu/WrappedMenuItems.js b/docs/data/base/components/menu/WrappedMenuItems.js index 59f44e1a4f7bab..c1e101d069edc1 100644 --- a/docs/data/base/components/menu/WrappedMenuItems.js +++ b/docs/data/base/components/menu/WrappedMenuItems.js @@ -55,25 +55,29 @@ export default function WrappedMenuItems() { } const blue = { - 100: '#DAECFF', + 50: '#F0F7FF', + 100: '#C2E0FF', 200: '#99CCF3', + 300: '#66B2FF', 400: '#3399FF', 500: '#007FFF', - 600: '#0072E5', + 600: '#0072E6', + 700: '#0059B3', + 800: '#004C99', 900: '#003A75', }; const grey = { - 50: '#f6f8fa', - 100: '#eaeef2', - 200: '#d0d7de', - 300: '#afb8c1', - 400: '#8c959f', - 500: '#6e7781', - 600: '#57606a', - 700: '#424a53', - 800: '#32383f', - 900: '#24292f', + 50: '#F3F6F9', + 100: '#E5EAF2', + 200: '#DAE2ED', + 300: '#C7D0DD', + 400: '#B0B8C4', + 500: '#9DA8B7', + 600: '#6B7A90', + 700: '#434D5B', + 800: '#303740', + 900: '#1C2025', }; const Listbox = styled('ul')( @@ -127,30 +131,33 @@ const MenuItem = styled(BaseMenuItem)( const MenuButton = styled(BaseMenuButton)( ({ theme }) => ` font-family: IBM Plex Sans, sans-serif; + font-weight: 600; font-size: 0.875rem; - box-sizing: border-box; - min-height: calc(1.5em + 22px); - border-radius: 12px; - padding: 8px 14px; line-height: 1.5; + padding: 8px 16px; + border-radius: 8px; + color: white; + transition: all 150ms ease; + cursor: pointer; background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'}; border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; - color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]}; - - transition-property: all; - transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); - transition-duration: 120ms; + color: ${theme.palette.mode === 'dark' ? grey[200] : grey[900]}; + box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); &:hover { background: ${theme.palette.mode === 'dark' ? grey[800] : grey[50]}; border-color: ${theme.palette.mode === 'dark' ? grey[600] : grey[300]}; } + &:active { + background: ${theme.palette.mode === 'dark' ? grey[700] : grey[100]}; + } + &:focus-visible { - border-color: ${blue[400]}; - outline: 3px solid ${theme.palette.mode === 'dark' ? blue[500] : blue[200]}; + box-shadow: 0 0 0 4px ${theme.palette.mode === 'dark' ? blue[300] : blue[200]}; + outline: none; } - `, +`, ); const MenuSectionRoot = styled('li')` diff --git a/docs/data/base/components/menu/WrappedMenuItems.tsx b/docs/data/base/components/menu/WrappedMenuItems.tsx index 6babb051d84232..e3a41517232f97 100644 --- a/docs/data/base/components/menu/WrappedMenuItems.tsx +++ b/docs/data/base/components/menu/WrappedMenuItems.tsx @@ -49,25 +49,29 @@ export default function WrappedMenuItems() { } const blue = { - 100: '#DAECFF', + 50: '#F0F7FF', + 100: '#C2E0FF', 200: '#99CCF3', + 300: '#66B2FF', 400: '#3399FF', 500: '#007FFF', - 600: '#0072E5', + 600: '#0072E6', + 700: '#0059B3', + 800: '#004C99', 900: '#003A75', }; const grey = { - 50: '#f6f8fa', - 100: '#eaeef2', - 200: '#d0d7de', - 300: '#afb8c1', - 400: '#8c959f', - 500: '#6e7781', - 600: '#57606a', - 700: '#424a53', - 800: '#32383f', - 900: '#24292f', + 50: '#F3F6F9', + 100: '#E5EAF2', + 200: '#DAE2ED', + 300: '#C7D0DD', + 400: '#B0B8C4', + 500: '#9DA8B7', + 600: '#6B7A90', + 700: '#434D5B', + 800: '#303740', + 900: '#1C2025', }; const Listbox = styled('ul')( @@ -121,30 +125,33 @@ const MenuItem = styled(BaseMenuItem)( const MenuButton = styled(BaseMenuButton)( ({ theme }) => ` font-family: IBM Plex Sans, sans-serif; + font-weight: 600; font-size: 0.875rem; - box-sizing: border-box; - min-height: calc(1.5em + 22px); - border-radius: 12px; - padding: 8px 14px; line-height: 1.5; + padding: 8px 16px; + border-radius: 8px; + color: white; + transition: all 150ms ease; + cursor: pointer; background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'}; border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; - color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]}; - - transition-property: all; - transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); - transition-duration: 120ms; + color: ${theme.palette.mode === 'dark' ? grey[200] : grey[900]}; + box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); &:hover { background: ${theme.palette.mode === 'dark' ? grey[800] : grey[50]}; border-color: ${theme.palette.mode === 'dark' ? grey[600] : grey[300]}; } + &:active { + background: ${theme.palette.mode === 'dark' ? grey[700] : grey[100]}; + } + &:focus-visible { - border-color: ${blue[400]}; - outline: 3px solid ${theme.palette.mode === 'dark' ? blue[500] : blue[200]}; + box-shadow: 0 0 0 4px ${theme.palette.mode === 'dark' ? blue[300] : blue[200]}; + outline: none; } - `, +`, ); interface MenuSectionProps { diff --git a/docs/data/base/components/modal/KeepMountedModal.js b/docs/data/base/components/modal/KeepMountedModal.js index 6026b39393fb9c..50895cd2ead6c9 100644 --- a/docs/data/base/components/modal/KeepMountedModal.js +++ b/docs/data/base/components/modal/KeepMountedModal.js @@ -22,10 +22,10 @@ export default function KeepMountedModal() { slots={{ backdrop: StyledBackdrop }} keepMounted > - +

Text in a modal

Aliquid amet deserunt earum!

-
+
); @@ -48,9 +48,12 @@ Backdrop.propTypes = { }; const blue = { - 200: '#99CCF3', + 200: '#99CCFF', + 300: '#66B2FF', 400: '#3399FF', 500: '#007FFF', + 600: '#0072E5', + 700: '#0066CC', }; const grey = { @@ -89,36 +92,74 @@ const StyledBackdrop = styled(Backdrop)` -webkit-tap-highlight-color: transparent; `; -const style = (theme) => ({ +const style = { width: 400, - borderRadius: '12px', - padding: '16px 32px 24px 32px', - backgroundColor: theme.palette.mode === 'dark' ? '#0A1929' : 'white', - boxShadow: `0px 2px 24px ${theme.palette.mode === 'dark' ? '#000' : '#383838'}`, -}); +}; + +const ModalContent = styled(Box)( + ({ theme }) => ` + width: 400, + display: flex; + flex-direction: column; + gap: 8px; + overflow: hidden; + background-color: ${theme.palette.mode === 'dark' ? grey[900] : '#FFF'}; + border-radius: 8px; + border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; + box-shadow: 0px 4px 12px ${ + theme.palette.mode === 'dark' ? 'rgba(0,0,0, 0.50)' : 'rgba(0,0,0, 0.20)' + }; + padding: 1rem; + color: ${theme.palette.mode === 'dark' ? grey[50] : grey[900]}; + font-family: IBM Plex Sans, sans-serif; + font-weight: 500; + text-align: start; + position: relative; + + + & .modal-title { + margin: 0; + line-height: 1.5rem; + margin-right: 0.5rem; + } + + & .modal-description { + margin: 0; + line-height: 1.5rem; + font-weight: 400; + color: ${theme.palette.mode === 'dark' ? grey[400] : grey[800]}; + } + `, +); const TriggerButton = styled('button')( ({ theme }) => ` font-family: IBM Plex Sans, sans-serif; - font-size: 0.875rem; font-weight: 600; - box-sizing: border-box; - min-height: calc(1.5em + 22px); - border-radius: 12px; - padding: 6px 12px; + font-size: 0.875rem; line-height: 1.5; - background: transparent; - border: 1px solid ${theme.palette.mode === 'dark' ? grey[800] : grey[200]}; - color: ${theme.palette.mode === 'dark' ? grey[100] : grey[900]}; + padding: 8px 16px; + border-radius: 8px; + color: white; + transition: all 150ms ease; + cursor: pointer; + background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'}; + border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; + color: ${theme.palette.mode === 'dark' ? grey[200] : grey[900]}; + box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); &:hover { background: ${theme.palette.mode === 'dark' ? grey[800] : grey[50]}; border-color: ${theme.palette.mode === 'dark' ? grey[600] : grey[300]}; } + &:active { + background: ${theme.palette.mode === 'dark' ? grey[700] : grey[100]}; + } + &:focus-visible { - border-color: ${blue[400]}; - outline: 3px solid ${theme.palette.mode === 'dark' ? blue[500] : blue[200]}; + box-shadow: 0 0 0 4px ${theme.palette.mode === 'dark' ? blue[300] : blue[200]}; + outline: none; } - `, +`, ); diff --git a/docs/data/base/components/modal/KeepMountedModal.tsx b/docs/data/base/components/modal/KeepMountedModal.tsx index d6e8f96415d3d2..d779552fefd6de 100644 --- a/docs/data/base/components/modal/KeepMountedModal.tsx +++ b/docs/data/base/components/modal/KeepMountedModal.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import clsx from 'clsx'; -import { styled, Box, Theme } from '@mui/system'; +import { styled, Box } from '@mui/system'; import { Modal as BaseModal } from '@mui/base/Modal'; export default function KeepMountedModal() { @@ -21,10 +21,10 @@ export default function KeepMountedModal() { slots={{ backdrop: StyledBackdrop }} keepMounted > - +

Text in a modal

Aliquid amet deserunt earum!

-
+ ); @@ -45,9 +45,12 @@ const Backdrop = React.forwardRef< }); const blue = { - 200: '#99CCF3', + 200: '#99CCFF', + 300: '#66B2FF', 400: '#3399FF', 500: '#007FFF', + 600: '#0072E5', + 700: '#0066CC', }; const grey = { @@ -86,36 +89,74 @@ const StyledBackdrop = styled(Backdrop)` -webkit-tap-highlight-color: transparent; `; -const style = (theme: Theme) => ({ +const style = { width: 400, - borderRadius: '12px', - padding: '16px 32px 24px 32px', - backgroundColor: theme.palette.mode === 'dark' ? '#0A1929' : 'white', - boxShadow: `0px 2px 24px ${theme.palette.mode === 'dark' ? '#000' : '#383838'}`, -}); +}; + +const ModalContent = styled(Box)( + ({ theme }) => ` + width: 400, + display: flex; + flex-direction: column; + gap: 8px; + overflow: hidden; + background-color: ${theme.palette.mode === 'dark' ? grey[900] : '#FFF'}; + border-radius: 8px; + border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; + box-shadow: 0px 4px 12px ${ + theme.palette.mode === 'dark' ? 'rgba(0,0,0, 0.50)' : 'rgba(0,0,0, 0.20)' + }; + padding: 1rem; + color: ${theme.palette.mode === 'dark' ? grey[50] : grey[900]}; + font-family: IBM Plex Sans, sans-serif; + font-weight: 500; + text-align: start; + position: relative; + + + & .modal-title { + margin: 0; + line-height: 1.5rem; + margin-right: 0.5rem; + } + + & .modal-description { + margin: 0; + line-height: 1.5rem; + font-weight: 400; + color: ${theme.palette.mode === 'dark' ? grey[400] : grey[800]}; + } + `, +); const TriggerButton = styled('button')( ({ theme }) => ` font-family: IBM Plex Sans, sans-serif; - font-size: 0.875rem; font-weight: 600; - box-sizing: border-box; - min-height: calc(1.5em + 22px); - border-radius: 12px; - padding: 6px 12px; + font-size: 0.875rem; line-height: 1.5; - background: transparent; - border: 1px solid ${theme.palette.mode === 'dark' ? grey[800] : grey[200]}; - color: ${theme.palette.mode === 'dark' ? grey[100] : grey[900]}; + padding: 8px 16px; + border-radius: 8px; + color: white; + transition: all 150ms ease; + cursor: pointer; + background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'}; + border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; + color: ${theme.palette.mode === 'dark' ? grey[200] : grey[900]}; + box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); &:hover { background: ${theme.palette.mode === 'dark' ? grey[800] : grey[50]}; border-color: ${theme.palette.mode === 'dark' ? grey[600] : grey[300]}; } + &:active { + background: ${theme.palette.mode === 'dark' ? grey[700] : grey[100]}; + } + &:focus-visible { - border-color: ${blue[400]}; - outline: 3px solid ${theme.palette.mode === 'dark' ? blue[500] : blue[200]}; + box-shadow: 0 0 0 4px ${theme.palette.mode === 'dark' ? blue[300] : blue[200]}; + outline: none; } - `, +`, ); diff --git a/docs/data/base/components/modal/KeepMountedModal.tsx.preview b/docs/data/base/components/modal/KeepMountedModal.tsx.preview index 33a32b939f309e..4ef1d15ad243f9 100644 --- a/docs/data/base/components/modal/KeepMountedModal.tsx.preview +++ b/docs/data/base/components/modal/KeepMountedModal.tsx.preview @@ -9,8 +9,8 @@ slots={{ backdrop: StyledBackdrop }} keepMounted > - +

Text in a modal

Aliquid amet deserunt earum!

-
+ \ No newline at end of file diff --git a/docs/data/base/components/modal/ModalUnstyled.js b/docs/data/base/components/modal/ModalUnstyled.js index af5ecc33e0661d..21f8e2243f9ccb 100644 --- a/docs/data/base/components/modal/ModalUnstyled.js +++ b/docs/data/base/components/modal/ModalUnstyled.js @@ -21,10 +21,14 @@ export default function ModalUnstyled() { onClose={handleClose} slots={{ backdrop: StyledBackdrop }} > - -

Text in a modal

-

Aliquid amet deserunt earum!

-
+ +

+ Text in a modal +

+

+ Aliquid amet deserunt earum! +

+
); @@ -47,9 +51,12 @@ Backdrop.propTypes = { }; const blue = { - 200: '#99CCF3', + 200: '#99CCFF', + 300: '#66B2FF', 400: '#3399FF', 500: '#007FFF', + 600: '#0072E5', + 700: '#0066CC', }; const grey = { @@ -82,36 +89,73 @@ const StyledBackdrop = styled(Backdrop)` -webkit-tap-highlight-color: transparent; `; -const style = (theme) => ({ +const style = { width: 400, - borderRadius: '12px', - padding: '16px 32px 24px 32px', - backgroundColor: theme.palette.mode === 'dark' ? '#0A1929' : 'white', - boxShadow: `0px 2px 24px ${theme.palette.mode === 'dark' ? '#000' : '#383838'}`, -}); +}; + +const ModalContent = styled(Box)( + ({ theme }) => ` + display: flex; + flex-direction: column; + gap: 8px; + overflow: hidden; + background-color: ${theme.palette.mode === 'dark' ? grey[900] : '#FFF'}; + border-radius: 8px; + border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; + box-shadow: 0px 4px 12px ${ + theme.palette.mode === 'dark' ? 'rgba(0,0,0, 0.50)' : 'rgba(0,0,0, 0.20)' + }; + padding: 1rem; + color: ${theme.palette.mode === 'dark' ? grey[50] : grey[900]}; + font-family: IBM Plex Sans, sans-serif; + font-weight: 500; + text-align: start; + position: relative; + + + & .modal-title { + margin: 0; + line-height: 1.5rem; + margin-right: 0.5rem; + } + + & .modal-description { + margin: 0; + line-height: 1.5rem; + font-weight: 400; + color: ${theme.palette.mode === 'dark' ? grey[400] : grey[800]}; + } + `, +); const TriggerButton = styled('button')( ({ theme }) => ` font-family: IBM Plex Sans, sans-serif; - font-size: 0.875rem; font-weight: 600; - box-sizing: border-box; - min-height: calc(1.5em + 22px); - border-radius: 12px; - padding: 6px 12px; + font-size: 0.875rem; line-height: 1.5; - background: transparent; - border: 1px solid ${theme.palette.mode === 'dark' ? grey[800] : grey[200]}; - color: ${theme.palette.mode === 'dark' ? grey[100] : grey[900]}; + padding: 8px 16px; + border-radius: 8px; + color: white; + transition: all 150ms ease; + cursor: pointer; + background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'}; + border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; + color: ${theme.palette.mode === 'dark' ? grey[200] : grey[900]}; + box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); &:hover { background: ${theme.palette.mode === 'dark' ? grey[800] : grey[50]}; border-color: ${theme.palette.mode === 'dark' ? grey[600] : grey[300]}; } + &:active { + background: ${theme.palette.mode === 'dark' ? grey[700] : grey[100]}; + } + &:focus-visible { - border-color: ${blue[400]}; - outline: 3px solid ${theme.palette.mode === 'dark' ? blue[500] : blue[200]}; + box-shadow: 0 0 0 4px ${theme.palette.mode === 'dark' ? blue[300] : blue[200]}; + outline: none; } - `, +`, ); diff --git a/docs/data/base/components/modal/ModalUnstyled.tsx b/docs/data/base/components/modal/ModalUnstyled.tsx index 71ef020445cd82..3f4af42e337d13 100644 --- a/docs/data/base/components/modal/ModalUnstyled.tsx +++ b/docs/data/base/components/modal/ModalUnstyled.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import clsx from 'clsx'; -import { styled, Box, Theme } from '@mui/system'; +import { styled, Box } from '@mui/system'; import { Modal as BaseModal } from '@mui/base/Modal'; export default function ModalUnstyled() { @@ -20,10 +20,14 @@ export default function ModalUnstyled() { onClose={handleClose} slots={{ backdrop: StyledBackdrop }} > - -

Text in a modal

-

Aliquid amet deserunt earum!

-
+ +

+ Text in a modal +

+

+ Aliquid amet deserunt earum! +

+
); @@ -44,9 +48,12 @@ const Backdrop = React.forwardRef< }); const blue = { - 200: '#99CCF3', + 200: '#99CCFF', + 300: '#66B2FF', 400: '#3399FF', 500: '#007FFF', + 600: '#0072E5', + 700: '#0066CC', }; const grey = { @@ -79,36 +86,73 @@ const StyledBackdrop = styled(Backdrop)` -webkit-tap-highlight-color: transparent; `; -const style = (theme: Theme) => ({ +const style = { width: 400, - borderRadius: '12px', - padding: '16px 32px 24px 32px', - backgroundColor: theme.palette.mode === 'dark' ? '#0A1929' : 'white', - boxShadow: `0px 2px 24px ${theme.palette.mode === 'dark' ? '#000' : '#383838'}`, -}); +}; + +const ModalContent = styled(Box)( + ({ theme }) => ` + display: flex; + flex-direction: column; + gap: 8px; + overflow: hidden; + background-color: ${theme.palette.mode === 'dark' ? grey[900] : '#FFF'}; + border-radius: 8px; + border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; + box-shadow: 0px 4px 12px ${ + theme.palette.mode === 'dark' ? 'rgba(0,0,0, 0.50)' : 'rgba(0,0,0, 0.20)' + }; + padding: 1rem; + color: ${theme.palette.mode === 'dark' ? grey[50] : grey[900]}; + font-family: IBM Plex Sans, sans-serif; + font-weight: 500; + text-align: start; + position: relative; + + + & .modal-title { + margin: 0; + line-height: 1.5rem; + margin-right: 0.5rem; + } + + & .modal-description { + margin: 0; + line-height: 1.5rem; + font-weight: 400; + color: ${theme.palette.mode === 'dark' ? grey[400] : grey[800]}; + } + `, +); const TriggerButton = styled('button')( ({ theme }) => ` font-family: IBM Plex Sans, sans-serif; - font-size: 0.875rem; font-weight: 600; - box-sizing: border-box; - min-height: calc(1.5em + 22px); - border-radius: 12px; - padding: 6px 12px; + font-size: 0.875rem; line-height: 1.5; - background: transparent; - border: 1px solid ${theme.palette.mode === 'dark' ? grey[800] : grey[200]}; - color: ${theme.palette.mode === 'dark' ? grey[100] : grey[900]}; + padding: 8px 16px; + border-radius: 8px; + color: white; + transition: all 150ms ease; + cursor: pointer; + background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'}; + border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; + color: ${theme.palette.mode === 'dark' ? grey[200] : grey[900]}; + box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); &:hover { background: ${theme.palette.mode === 'dark' ? grey[800] : grey[50]}; border-color: ${theme.palette.mode === 'dark' ? grey[600] : grey[300]}; } + &:active { + background: ${theme.palette.mode === 'dark' ? grey[700] : grey[100]}; + } + &:focus-visible { - border-color: ${blue[400]}; - outline: 3px solid ${theme.palette.mode === 'dark' ? blue[500] : blue[200]}; + box-shadow: 0 0 0 4px ${theme.palette.mode === 'dark' ? blue[300] : blue[200]}; + outline: none; } - `, +`, ); diff --git a/docs/data/base/components/modal/ModalUnstyled.tsx.preview b/docs/data/base/components/modal/ModalUnstyled.tsx.preview deleted file mode 100644 index 4f395cfb0d8d10..00000000000000 --- a/docs/data/base/components/modal/ModalUnstyled.tsx.preview +++ /dev/null @@ -1,15 +0,0 @@ - - Open modal - - - -

Text in a modal

-

Aliquid amet deserunt earum!

-
-
\ No newline at end of file diff --git a/docs/data/base/components/modal/NestedModal.js b/docs/data/base/components/modal/NestedModal.js index 582897be8bddd7..c35072a41bf29f 100644 --- a/docs/data/base/components/modal/NestedModal.js +++ b/docs/data/base/components/modal/NestedModal.js @@ -24,13 +24,15 @@ export default function NestedModal() { aria-describedby="parent-modal-description" slots={{ backdrop: StyledBackdrop }} > - -

Text in a modal

-

+ +

+ Text in a modal +

+

Duis mollis, est non commodo luctus, nisi erat porttitor ligula.

-
+ ); @@ -47,7 +49,7 @@ function ChildModal() { return ( - + Open Child Modal - -

Text in a child modal

-

+ +

+ Text in a child modal +

+

Lorem ipsum, dolor sit amet consectetur adipisicing elit.

- -
+ Close Child Modal +
); @@ -84,9 +88,12 @@ Backdrop.propTypes = { }; const blue = { - 200: '#99CCF3', + 200: '#99CCFF', + 300: '#66B2FF', 400: '#3399FF', 500: '#007FFF', + 600: '#0072E5', + 700: '#0066CC', }; const grey = { @@ -119,40 +126,119 @@ const StyledBackdrop = styled(Backdrop)` -webkit-tap-highlight-color: transparent; `; -const style = (theme) => ({ +const style = { position: 'absolute', top: '50%', left: '50%', transform: 'translate(-50%, -50%)', width: 400, - borderRadius: '12px', - padding: '16px 32px 24px 32px', - backgroundColor: theme.palette.mode === 'dark' ? '#0A1929' : 'white', - boxShadow: `0px 2px 24px ${theme.palette.mode === 'dark' ? '#000' : '#383838'}`, -}); +}; + +const ModalContent = styled(Box)( + ({ theme }) => ` + display: flex; + flex-direction: column; + gap: 8px; + overflow: hidden; + background-color: ${theme.palette.mode === 'dark' ? grey[900] : '#FFF'}; + border-radius: 8px; + border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; + box-shadow: 0px 4px 12px ${ + theme.palette.mode === 'dark' ? 'rgba(0,0,0, 0.50)' : 'rgba(0,0,0, 0.20)' + }; + padding: 1rem; + color: ${theme.palette.mode === 'dark' ? grey[50] : grey[900]}; + font-family: IBM Plex Sans, sans-serif; + font-weight: 500; + text-align: start; + position: relative; + + + & .modal-title { + margin: 0; + line-height: 1.5rem; + margin-right: 0.5rem; + } + + & .modal-description { + margin: 0; + line-height: 1.5rem; + font-weight: 400; + color: ${theme.palette.mode === 'dark' ? grey[400] : grey[800]}; + } + `, +); const TriggerButton = styled(Button)( ({ theme }) => ` font-family: IBM Plex Sans, sans-serif; - font-size: 0.875rem; font-weight: 600; - box-sizing: border-box; - min-height: calc(1.5em + 22px); - border-radius: 12px; - padding: 6px 12px; + font-size: 0.875rem; line-height: 1.5; - background: transparent; - border: 1px solid ${theme.palette.mode === 'dark' ? grey[800] : grey[200]}; - color: ${theme.palette.mode === 'dark' ? grey[100] : grey[900]}; - + padding: 8px 16px; + border-radius: 8px; + color: white; + transition: all 150ms ease; + cursor: pointer; + background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'}; + border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; + color: ${theme.palette.mode === 'dark' ? grey[200] : grey[900]}; + box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); + &:hover { background: ${theme.palette.mode === 'dark' ? grey[800] : grey[50]}; border-color: ${theme.palette.mode === 'dark' ? grey[600] : grey[300]}; } + + &.active { + background-color: ${blue[700]}; + box-shadow: none; + } + + &.focusVisible { + box-shadow: 0 0 0 4px ${theme.palette.mode === 'dark' ? blue[300] : blue[200]}; + outline: none; + } +`, +); + +const ModalButton = styled(Button)( + ({ theme }) => ` + font-family: IBM Plex Sans, sans-serif; + font-weight: 600; + font-size: 0.875rem; + line-height: 1.5; + background-color: ${blue[500]}; + padding: 8px 16px; + border-radius: 8px; + color: white; + transition: all 150ms ease; + cursor: pointer; + border: 1px solid ${blue[500]}; + box-shadow: 0 2px 1px ${ + theme.palette.mode === 'dark' ? 'rgba(0, 0, 0, 0.5)' : 'rgba(45, 45, 60, 0.2)' + }, inset 0 1.5px 1px ${blue[400]}, inset 0 -2px 1px ${blue[600]}; + + &:hover { + background-color: ${blue[600]}; + } + + &:active { + background: ${theme.palette.mode === 'dark' ? grey[700] : grey[100]}; + } &:focus-visible { - border-color: ${blue[400]}; - outline: 3px solid ${theme.palette.mode === 'dark' ? blue[500] : blue[200]}; + box-shadow: 0 0 0 4px ${theme.palette.mode === 'dark' ? blue[300] : blue[200]}; + outline: none; } - `, + + &.disabled { + opacity: 0.4; + cursor: not-allowed; + box-shadow: none; + &:hover { + background-color: ${blue[500]}; + } + } +`, ); diff --git a/docs/data/base/components/modal/NestedModal.tsx b/docs/data/base/components/modal/NestedModal.tsx index 3529538d9bf7fc..cdb4f047f8e942 100644 --- a/docs/data/base/components/modal/NestedModal.tsx +++ b/docs/data/base/components/modal/NestedModal.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import clsx from 'clsx'; -import { styled, Box, Theme } from '@mui/system'; +import { styled, Box } from '@mui/system'; import { Modal as BaseModal } from '@mui/base/Modal'; import { Button } from '@mui/base/Button'; @@ -23,13 +23,15 @@ export default function NestedModal() { aria-describedby="parent-modal-description" slots={{ backdrop: StyledBackdrop }} > - -

Text in a modal

-

+ +

+ Text in a modal +

+

Duis mollis, est non commodo luctus, nisi erat porttitor ligula.

-
+ ); @@ -46,7 +48,7 @@ function ChildModal() { return ( - + Open Child Modal - -

Text in a child modal

-

+ +

+ Text in a child modal +

+

Lorem ipsum, dolor sit amet consectetur adipisicing elit.

- -
+ Close Child Modal +
); @@ -81,9 +85,12 @@ const Backdrop = React.forwardRef< }); const blue = { - 200: '#99CCF3', + 200: '#99CCFF', + 300: '#66B2FF', 400: '#3399FF', 500: '#007FFF', + 600: '#0072E5', + 700: '#0066CC', }; const grey = { @@ -116,40 +123,119 @@ const StyledBackdrop = styled(Backdrop)` -webkit-tap-highlight-color: transparent; `; -const style = (theme: Theme) => ({ +const style = { position: 'absolute' as 'absolute', top: '50%', left: '50%', transform: 'translate(-50%, -50%)', width: 400, - borderRadius: '12px', - padding: '16px 32px 24px 32px', - backgroundColor: theme.palette.mode === 'dark' ? '#0A1929' : 'white', - boxShadow: `0px 2px 24px ${theme.palette.mode === 'dark' ? '#000' : '#383838'}`, -}); +}; + +const ModalContent = styled(Box)( + ({ theme }) => ` + display: flex; + flex-direction: column; + gap: 8px; + overflow: hidden; + background-color: ${theme.palette.mode === 'dark' ? grey[900] : '#FFF'}; + border-radius: 8px; + border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; + box-shadow: 0px 4px 12px ${ + theme.palette.mode === 'dark' ? 'rgba(0,0,0, 0.50)' : 'rgba(0,0,0, 0.20)' + }; + padding: 1rem; + color: ${theme.palette.mode === 'dark' ? grey[50] : grey[900]}; + font-family: IBM Plex Sans, sans-serif; + font-weight: 500; + text-align: start; + position: relative; + + + & .modal-title { + margin: 0; + line-height: 1.5rem; + margin-right: 0.5rem; + } + + & .modal-description { + margin: 0; + line-height: 1.5rem; + font-weight: 400; + color: ${theme.palette.mode === 'dark' ? grey[400] : grey[800]}; + } + `, +); const TriggerButton = styled(Button)( ({ theme }) => ` font-family: IBM Plex Sans, sans-serif; - font-size: 0.875rem; font-weight: 600; - box-sizing: border-box; - min-height: calc(1.5em + 22px); - border-radius: 12px; - padding: 6px 12px; + font-size: 0.875rem; line-height: 1.5; - background: transparent; - border: 1px solid ${theme.palette.mode === 'dark' ? grey[800] : grey[200]}; - color: ${theme.palette.mode === 'dark' ? grey[100] : grey[900]}; - + padding: 8px 16px; + border-radius: 8px; + color: white; + transition: all 150ms ease; + cursor: pointer; + background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'}; + border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; + color: ${theme.palette.mode === 'dark' ? grey[200] : grey[900]}; + box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); + &:hover { background: ${theme.palette.mode === 'dark' ? grey[800] : grey[50]}; border-color: ${theme.palette.mode === 'dark' ? grey[600] : grey[300]}; } + + &.active { + background-color: ${blue[700]}; + box-shadow: none; + } + + &.focusVisible { + box-shadow: 0 0 0 4px ${theme.palette.mode === 'dark' ? blue[300] : blue[200]}; + outline: none; + } +`, +); + +const ModalButton = styled(Button)( + ({ theme }) => ` + font-family: IBM Plex Sans, sans-serif; + font-weight: 600; + font-size: 0.875rem; + line-height: 1.5; + background-color: ${blue[500]}; + padding: 8px 16px; + border-radius: 8px; + color: white; + transition: all 150ms ease; + cursor: pointer; + border: 1px solid ${blue[500]}; + box-shadow: 0 2px 1px ${ + theme.palette.mode === 'dark' ? 'rgba(0, 0, 0, 0.5)' : 'rgba(45, 45, 60, 0.2)' + }, inset 0 1.5px 1px ${blue[400]}, inset 0 -2px 1px ${blue[600]}; + + &:hover { + background-color: ${blue[600]}; + } + + &:active { + background: ${theme.palette.mode === 'dark' ? grey[700] : grey[100]}; + } &:focus-visible { - border-color: ${blue[400]}; - outline: 3px solid ${theme.palette.mode === 'dark' ? blue[500] : blue[200]}; + box-shadow: 0 0 0 4px ${theme.palette.mode === 'dark' ? blue[300] : blue[200]}; + outline: none; } - `, + + &.disabled { + opacity: 0.4; + cursor: not-allowed; + box-shadow: none; + &:hover { + background-color: ${blue[500]}; + } + } +`, ); diff --git a/docs/data/base/components/modal/NestedModal.tsx.preview b/docs/data/base/components/modal/NestedModal.tsx.preview deleted file mode 100644 index 4b9ce294257b4c..00000000000000 --- a/docs/data/base/components/modal/NestedModal.tsx.preview +++ /dev/null @@ -1,16 +0,0 @@ -Open modal - - -

Text in a modal

-

- Duis mollis, est non commodo luctus, nisi erat porttitor ligula. -

- -
-
\ No newline at end of file diff --git a/docs/data/base/components/modal/ServerModal.js b/docs/data/base/components/modal/ServerModal.js index b37223e11b4719..d7940e16afe050 100644 --- a/docs/data/base/components/modal/ServerModal.js +++ b/docs/data/base/components/modal/ServerModal.js @@ -29,17 +29,38 @@ export default function ServerModal() { aria-describedby="server-modal-description" container={() => rootRef.current} > - -

Server-side modal

- + +

+ Server-side modal +

+ If you disable JavaScript, you will still see me. -
+ ); } +const grey = { + 50: '#f6f8fa', + 100: '#eaeef2', + 200: '#d0d7de', + 300: '#afb8c1', + 400: '#8c959f', + 500: '#6e7781', + 600: '#57606a', + 700: '#424a53', + 800: '#32383f', + 900: '#24292f', +}; + +const blue = { + 200: '#99CCF3', + 300: '#66B2FF', + 700: '#0059B2', +}; + const Modal = styled(BaseModal)` position: fixed; z-index: 1300; @@ -52,11 +73,30 @@ const Modal = styled(BaseModal)` font-family: 'IBM Plex Sans', sans-serif; `; -const style = (theme) => ({ +const style = { position: 'relative', width: 400, - borderRadius: '12px', - padding: '16px 32px 24px 32px', - backgroundColor: theme.palette.mode === 'dark' ? '#132F4C' : 'white', - boxShadow: `0px 2px 8px ${theme.palette.mode === 'dark' ? '#000' : '#BCBCBC'}`, -}); + height: 120, +}; + +const ModalContent = styled(Box)( + ({ theme }) => ` + font-family: IBM Plex Sans, sans-serif; + font-weight: 600; + font-size: 0.875rem; + line-height: 1.5; + padding: 8px 16px; + border-radius: 8px; + color: white; + transition: all 150ms ease; + background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'}; + border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; + color: ${theme.palette.mode === 'dark' ? grey[200] : grey[900]}; + box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); + + &:focus-visible { + box-shadow: 0 0 0 4px ${theme.palette.mode === 'dark' ? blue[300] : blue[200]}; + outline: none; + } + `, +); diff --git a/docs/data/base/components/modal/ServerModal.tsx b/docs/data/base/components/modal/ServerModal.tsx index 7f32fa649d1296..3573ac5787c037 100644 --- a/docs/data/base/components/modal/ServerModal.tsx +++ b/docs/data/base/components/modal/ServerModal.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import { Modal as BaseModal } from '@mui/base/Modal'; -import { Box, styled, Theme } from '@mui/system'; +import { Box, styled } from '@mui/system'; export default function ServerModal() { const rootRef = React.useRef(null); @@ -29,17 +29,38 @@ export default function ServerModal() { aria-describedby="server-modal-description" container={() => rootRef.current} > - -

Server-side modal

- + +

+ Server-side modal +

+ If you disable JavaScript, you will still see me. -
+ ); } +const grey = { + 50: '#f6f8fa', + 100: '#eaeef2', + 200: '#d0d7de', + 300: '#afb8c1', + 400: '#8c959f', + 500: '#6e7781', + 600: '#57606a', + 700: '#424a53', + 800: '#32383f', + 900: '#24292f', +}; + +const blue = { + 200: '#99CCF3', + 300: '#66B2FF', + 700: '#0059B2', +}; + const Modal = styled(BaseModal)` position: fixed; z-index: 1300; @@ -52,11 +73,30 @@ const Modal = styled(BaseModal)` font-family: 'IBM Plex Sans', sans-serif; `; -const style = (theme: Theme) => ({ +const style = { position: 'relative', width: 400, - borderRadius: '12px', - padding: '16px 32px 24px 32px', - backgroundColor: theme.palette.mode === 'dark' ? '#132F4C' : 'white', - boxShadow: `0px 2px 8px ${theme.palette.mode === 'dark' ? '#000' : '#BCBCBC'}`, -}); + height: 120, +}; + +const ModalContent = styled(Box)( + ({ theme }) => ` + font-family: IBM Plex Sans, sans-serif; + font-weight: 600; + font-size: 0.875rem; + line-height: 1.5; + padding: 8px 16px; + border-radius: 8px; + color: white; + transition: all 150ms ease; + background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'}; + border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; + color: ${theme.palette.mode === 'dark' ? grey[200] : grey[900]}; + box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); + + &:focus-visible { + box-shadow: 0 0 0 4px ${theme.palette.mode === 'dark' ? blue[300] : blue[200]}; + outline: none; + } + `, +); diff --git a/docs/data/base/components/modal/ServerModal.tsx.preview b/docs/data/base/components/modal/ServerModal.tsx.preview deleted file mode 100644 index 5c86cecbbab215..00000000000000 --- a/docs/data/base/components/modal/ServerModal.tsx.preview +++ /dev/null @@ -1,16 +0,0 @@ - rootRef.current} -> - -

Server-side modal

- - If you disable JavaScript, you will still see me. - -
-
\ No newline at end of file diff --git a/docs/data/base/components/modal/SpringModal.js b/docs/data/base/components/modal/SpringModal.js index 02114d58ec7841..03b4694df3e542 100644 --- a/docs/data/base/components/modal/SpringModal.js +++ b/docs/data/base/components/modal/SpringModal.js @@ -22,12 +22,14 @@ export default function SpringModal() { slots={{ backdrop: StyledBackdrop }} > - -

Text in a modal

- + +

+ Text in a modal +

+ Duis mollis, est non commodo luctus, nisi erat porttitor ligula. -
+
@@ -92,9 +94,12 @@ Fade.propTypes = { }; const blue = { - 200: '#99CCF3', + 200: '#99CCFF', + 300: '#66B2FF', 400: '#3399FF', 500: '#007FFF', + 600: '#0072E5', + 700: '#0066CC', }; const grey = { @@ -110,40 +115,77 @@ const grey = { 900: '#24292f', }; -const style = (theme) => ({ +const style = { position: 'absolute', top: '50%', left: '50%', transform: 'translate(-50%, -50%)', width: 400, - borderRadius: '12px', - padding: '16px 32px 24px 32px', - backgroundColor: theme.palette.mode === 'dark' ? '#0A1929' : 'white', - boxShadow: 16, -}); +}; + +const ModalContent = styled(Box)( + ({ theme }) => ` + display: flex; + flex-direction: column; + gap: 8px; + overflow: hidden; + background-color: ${theme.palette.mode === 'dark' ? grey[900] : '#FFF'}; + border-radius: 8px; + border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; + box-shadow: 0px 4px 12px ${ + theme.palette.mode === 'dark' ? 'rgba(0,0,0, 0.50)' : 'rgba(0,0,0, 0.20)' + }; + padding: 1rem; + color: ${theme.palette.mode === 'dark' ? grey[50] : grey[900]}; + font-family: IBM Plex Sans, sans-serif; + font-weight: 500; + text-align: start; + position: relative; + + + & .modal-title { + margin: 0; + line-height: 1.5rem; + margin-right: 0.5rem; + } + + & .modal-description { + margin: 0; + line-height: 1.5rem; + font-weight: 400; + color: ${theme.palette.mode === 'dark' ? grey[400] : grey[800]}; + } + `, +); const TriggerButton = styled(Button)( ({ theme }) => ` font-family: IBM Plex Sans, sans-serif; - font-size: 0.875rem; font-weight: 600; - box-sizing: border-box; - min-height: calc(1.5em + 22px); - border-radius: 12px; - padding: 6px 12px; + font-size: 0.875rem; line-height: 1.5; - background: transparent; - border: 1px solid ${theme.palette.mode === 'dark' ? grey[800] : grey[200]}; - color: ${theme.palette.mode === 'dark' ? grey[100] : grey[900]}; + padding: 8px 16px; + border-radius: 8px; + color: white; + transition: all 150ms ease; + cursor: pointer; + background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'}; + border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; + color: ${theme.palette.mode === 'dark' ? grey[200] : grey[900]}; + box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); &:hover { background: ${theme.palette.mode === 'dark' ? grey[800] : grey[50]}; border-color: ${theme.palette.mode === 'dark' ? grey[600] : grey[300]}; } + &:active { + background: ${theme.palette.mode === 'dark' ? grey[700] : grey[100]}; + } + &:focus-visible { - border-color: ${blue[400]}; - outline: 3px solid ${theme.palette.mode === 'dark' ? blue[500] : blue[200]}; + box-shadow: 0 0 0 4px ${theme.palette.mode === 'dark' ? blue[300] : blue[200]}; + outline: none; } - `, +`, ); diff --git a/docs/data/base/components/modal/SpringModal.tsx b/docs/data/base/components/modal/SpringModal.tsx index 2fd9571ce2c973..5c7aa3e698a07b 100644 --- a/docs/data/base/components/modal/SpringModal.tsx +++ b/docs/data/base/components/modal/SpringModal.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import { Box, styled, Theme } from '@mui/system'; +import { Box, styled } from '@mui/system'; import { Modal as BaseModal } from '@mui/base/Modal'; import { Button } from '@mui/base/Button'; import { useSpring, animated } from '@react-spring/web'; @@ -21,12 +21,14 @@ export default function SpringModal() { slots={{ backdrop: StyledBackdrop }} > - -

Text in a modal

- + +

+ Text in a modal +

+ Duis mollis, est non commodo luctus, nisi erat porttitor ligula. -
+
@@ -91,9 +93,12 @@ const Fade = React.forwardRef(function Fade(props, re }); const blue = { - 200: '#99CCF3', + 200: '#99CCFF', + 300: '#66B2FF', 400: '#3399FF', 500: '#007FFF', + 600: '#0072E5', + 700: '#0066CC', }; const grey = { @@ -109,40 +114,77 @@ const grey = { 900: '#24292f', }; -const style = (theme: Theme) => ({ +const style = { position: 'absolute' as 'absolute', top: '50%', left: '50%', transform: 'translate(-50%, -50%)', width: 400, - borderRadius: '12px', - padding: '16px 32px 24px 32px', - backgroundColor: theme.palette.mode === 'dark' ? '#0A1929' : 'white', - boxShadow: 16, -}); +}; + +const ModalContent = styled(Box)( + ({ theme }) => ` + display: flex; + flex-direction: column; + gap: 8px; + overflow: hidden; + background-color: ${theme.palette.mode === 'dark' ? grey[900] : '#FFF'}; + border-radius: 8px; + border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; + box-shadow: 0px 4px 12px ${ + theme.palette.mode === 'dark' ? 'rgba(0,0,0, 0.50)' : 'rgba(0,0,0, 0.20)' + }; + padding: 1rem; + color: ${theme.palette.mode === 'dark' ? grey[50] : grey[900]}; + font-family: IBM Plex Sans, sans-serif; + font-weight: 500; + text-align: start; + position: relative; + + + & .modal-title { + margin: 0; + line-height: 1.5rem; + margin-right: 0.5rem; + } + + & .modal-description { + margin: 0; + line-height: 1.5rem; + font-weight: 400; + color: ${theme.palette.mode === 'dark' ? grey[400] : grey[800]}; + } + `, +); const TriggerButton = styled(Button)( ({ theme }) => ` font-family: IBM Plex Sans, sans-serif; - font-size: 0.875rem; font-weight: 600; - box-sizing: border-box; - min-height: calc(1.5em + 22px); - border-radius: 12px; - padding: 6px 12px; + font-size: 0.875rem; line-height: 1.5; - background: transparent; - border: 1px solid ${theme.palette.mode === 'dark' ? grey[800] : grey[200]}; - color: ${theme.palette.mode === 'dark' ? grey[100] : grey[900]}; + padding: 8px 16px; + border-radius: 8px; + color: white; + transition: all 150ms ease; + cursor: pointer; + background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'}; + border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; + color: ${theme.palette.mode === 'dark' ? grey[200] : grey[900]}; + box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); &:hover { background: ${theme.palette.mode === 'dark' ? grey[800] : grey[50]}; border-color: ${theme.palette.mode === 'dark' ? grey[600] : grey[300]}; } + &:active { + background: ${theme.palette.mode === 'dark' ? grey[700] : grey[100]}; + } + &:focus-visible { - border-color: ${blue[400]}; - outline: 3px solid ${theme.palette.mode === 'dark' ? blue[500] : blue[200]}; + box-shadow: 0 0 0 4px ${theme.palette.mode === 'dark' ? blue[300] : blue[200]}; + outline: none; } - `, +`, ); diff --git a/docs/data/base/components/modal/TransitionsModal.js b/docs/data/base/components/modal/TransitionsModal.js index 815cc05cf40a59..e874ce84d3b834 100644 --- a/docs/data/base/components/modal/TransitionsModal.js +++ b/docs/data/base/components/modal/TransitionsModal.js @@ -22,12 +22,14 @@ export default function TransitionsModal() { slots={{ backdrop: StyledBackdrop }} > - -

Text in a modal

- - Duis mollis, est non commodo luctus, nisi erat porttitor ligula. - -
+ +

+ Text in a child modal +

+

+ Lorem ipsum, dolor sit amet consectetur adipisicing elit. +

+
@@ -48,9 +50,12 @@ Backdrop.propTypes = { }; const blue = { - 200: '#99CCF3', + 200: '#99CCFF', + 300: '#66B2FF', 400: '#3399FF', 500: '#007FFF', + 600: '#0072E5', + 700: '#0066CC', }; const grey = { @@ -83,40 +88,77 @@ const StyledBackdrop = styled(Backdrop)` -webkit-tap-highlight-color: transparent; `; -const style = (theme) => ({ +const style = { position: 'absolute', top: '50%', left: '50%', transform: 'translate(-50%, -50%)', width: 400, - borderRadius: '12px', - padding: '16px 32px 24px 32px', - backgroundColor: theme.palette.mode === 'dark' ? '#0A1929' : 'white', - boxShadow: `0px 2px 24px ${theme.palette.mode === 'dark' ? '#000' : '#383838'}`, -}); +}; + +const ModalContent = styled(Box)( + ({ theme }) => ` + display: flex; + flex-direction: column; + gap: 8px; + overflow: hidden; + background-color: ${theme.palette.mode === 'dark' ? grey[900] : '#FFF'}; + border-radius: 8px; + border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; + box-shadow: 0px 4px 12px ${ + theme.palette.mode === 'dark' ? 'rgba(0,0,0, 0.50)' : 'rgba(0,0,0, 0.20)' + }; + padding: 1rem; + color: ${theme.palette.mode === 'dark' ? grey[50] : grey[900]}; + font-family: IBM Plex Sans, sans-serif; + font-weight: 500; + text-align: start; + position: relative; + + + & .modal-title { + margin: 0; + line-height: 1.5rem; + margin-right: 0.5rem; + } + + & .modal-description { + margin: 0; + line-height: 1.5rem; + font-weight: 400; + color: ${theme.palette.mode === 'dark' ? grey[400] : grey[800]}; + } + `, +); const TriggerButton = styled(Button)( ({ theme }) => ` font-family: IBM Plex Sans, sans-serif; - font-size: 0.875rem; font-weight: 600; - box-sizing: border-box; - min-height: calc(1.5em + 22px); - border-radius: 12px; - padding: 6px 12px; + font-size: 0.875rem; line-height: 1.5; - background: transparent; - border: 1px solid ${theme.palette.mode === 'dark' ? grey[800] : grey[200]}; - color: ${theme.palette.mode === 'dark' ? grey[100] : grey[900]}; + padding: 8px 16px; + border-radius: 8px; + color: white; + transition: all 150ms ease; + cursor: pointer; + background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'}; + border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; + color: ${theme.palette.mode === 'dark' ? grey[200] : grey[900]}; + box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); &:hover { background: ${theme.palette.mode === 'dark' ? grey[800] : grey[50]}; border-color: ${theme.palette.mode === 'dark' ? grey[600] : grey[300]}; } + &:active { + background: ${theme.palette.mode === 'dark' ? grey[700] : grey[100]}; + } + &:focus-visible { - border-color: ${blue[400]}; - outline: 3px solid ${theme.palette.mode === 'dark' ? blue[500] : blue[200]}; + box-shadow: 0 0 0 4px ${theme.palette.mode === 'dark' ? blue[300] : blue[200]}; + outline: none; } - `, +`, ); diff --git a/docs/data/base/components/modal/TransitionsModal.tsx b/docs/data/base/components/modal/TransitionsModal.tsx index 5d1730c6a44082..5f5e574aa8618f 100644 --- a/docs/data/base/components/modal/TransitionsModal.tsx +++ b/docs/data/base/components/modal/TransitionsModal.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import { Box, styled, Theme } from '@mui/system'; +import { Box, styled } from '@mui/system'; import { Modal as BaseModal } from '@mui/base/Modal'; import Fade from '@mui/material/Fade'; import { Button } from '@mui/base/Button'; @@ -21,12 +21,14 @@ export default function TransitionsModal() { slots={{ backdrop: StyledBackdrop }} > - -

Text in a modal

- - Duis mollis, est non commodo luctus, nisi erat porttitor ligula. - -
+ +

+ Text in a child modal +

+

+ Lorem ipsum, dolor sit amet consectetur adipisicing elit. +

+
@@ -45,9 +47,12 @@ const Backdrop = React.forwardRef( ); const blue = { - 200: '#99CCF3', + 200: '#99CCFF', + 300: '#66B2FF', 400: '#3399FF', 500: '#007FFF', + 600: '#0072E5', + 700: '#0066CC', }; const grey = { @@ -80,40 +85,77 @@ const StyledBackdrop = styled(Backdrop)` -webkit-tap-highlight-color: transparent; `; -const style = (theme: Theme) => ({ +const style = { position: 'absolute' as 'absolute', top: '50%', left: '50%', transform: 'translate(-50%, -50%)', width: 400, - borderRadius: '12px', - padding: '16px 32px 24px 32px', - backgroundColor: theme.palette.mode === 'dark' ? '#0A1929' : 'white', - boxShadow: `0px 2px 24px ${theme.palette.mode === 'dark' ? '#000' : '#383838'}`, -}); +}; + +const ModalContent = styled(Box)( + ({ theme }) => ` + display: flex; + flex-direction: column; + gap: 8px; + overflow: hidden; + background-color: ${theme.palette.mode === 'dark' ? grey[900] : '#FFF'}; + border-radius: 8px; + border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; + box-shadow: 0px 4px 12px ${ + theme.palette.mode === 'dark' ? 'rgba(0,0,0, 0.50)' : 'rgba(0,0,0, 0.20)' + }; + padding: 1rem; + color: ${theme.palette.mode === 'dark' ? grey[50] : grey[900]}; + font-family: IBM Plex Sans, sans-serif; + font-weight: 500; + text-align: start; + position: relative; + + + & .modal-title { + margin: 0; + line-height: 1.5rem; + margin-right: 0.5rem; + } + + & .modal-description { + margin: 0; + line-height: 1.5rem; + font-weight: 400; + color: ${theme.palette.mode === 'dark' ? grey[400] : grey[800]}; + } + `, +); const TriggerButton = styled(Button)( ({ theme }) => ` font-family: IBM Plex Sans, sans-serif; - font-size: 0.875rem; font-weight: 600; - box-sizing: border-box; - min-height: calc(1.5em + 22px); - border-radius: 12px; - padding: 6px 12px; + font-size: 0.875rem; line-height: 1.5; - background: transparent; - border: 1px solid ${theme.palette.mode === 'dark' ? grey[800] : grey[200]}; - color: ${theme.palette.mode === 'dark' ? grey[100] : grey[900]}; + padding: 8px 16px; + border-radius: 8px; + color: white; + transition: all 150ms ease; + cursor: pointer; + background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'}; + border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; + color: ${theme.palette.mode === 'dark' ? grey[200] : grey[900]}; + box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); &:hover { background: ${theme.palette.mode === 'dark' ? grey[800] : grey[50]}; border-color: ${theme.palette.mode === 'dark' ? grey[600] : grey[300]}; } + &:active { + background: ${theme.palette.mode === 'dark' ? grey[700] : grey[100]}; + } + &:focus-visible { - border-color: ${blue[400]}; - outline: 3px solid ${theme.palette.mode === 'dark' ? blue[500] : blue[200]}; + box-shadow: 0 0 0 4px ${theme.palette.mode === 'dark' ? blue[300] : blue[200]}; + outline: none; } - `, +`, ); diff --git a/docs/data/base/components/modal/UseModal.js b/docs/data/base/components/modal/UseModal.js index 2223c591e8f59c..c3a3aeb875a3b2 100644 --- a/docs/data/base/components/modal/UseModal.js +++ b/docs/data/base/components/modal/UseModal.js @@ -2,7 +2,7 @@ import * as React from 'react'; import PropTypes from 'prop-types'; import clsx from 'clsx'; -import { Box, styled } from '@mui/system'; +import { styled } from '@mui/system'; import { Portal } from '@mui/base/Portal'; import { FocusTrap } from '@mui/base/FocusTrap'; import { Button } from '@mui/base/Button'; @@ -25,12 +25,14 @@ export default function UseModal() { closeAfterTransition > - -

Text in a modal

- + +

+ Text in a modal +

+ Duis mollis, est non commodo luctus, nisi erat porttitor ligula. -
+
@@ -182,9 +184,12 @@ Backdrop.propTypes = { }; const blue = { - 200: '#99CCF3', + 200: '#99CCFF', + 300: '#66B2FF', 400: '#3399FF', 500: '#007FFF', + 600: '#0072E5', + 700: '#0066CC', }; const grey = { @@ -200,17 +205,48 @@ const grey = { 900: '#24292f', }; -const style = (theme) => ({ +const style = { position: 'absolute', top: '50%', left: '50%', transform: 'translate(-50%, -50%)', width: 400, - borderRadius: '12px', - padding: '16px 32px 24px 32px', - backgroundColor: theme.palette.mode === 'dark' ? '#0A1929' : 'white', - boxShadow: `0px 2px 24px ${theme.palette.mode === 'dark' ? '#000' : '#383838'}`, -}); +}; + +const ModalContent = styled('div')( + ({ theme }) => ` + display: flex; + flex-direction: column; + gap: 8px; + overflow: hidden; + background-color: ${theme.palette.mode === 'dark' ? grey[900] : '#FFF'}; + border-radius: 8px; + border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; + box-shadow: 0px 4px 12px ${ + theme.palette.mode === 'dark' ? 'rgba(0,0,0, 0.50)' : 'rgba(0,0,0, 0.20)' + }; + padding: 1rem; + color: ${theme.palette.mode === 'dark' ? grey[50] : grey[900]}; + font-family: IBM Plex Sans, sans-serif; + font-weight: 500; + text-align: start; + position: relative; + + + & .modal-title { + margin: 0; + line-height: 1.5rem; + margin-right: 0.5rem; + } + + & .modal-description { + margin: 0; + line-height: 1.5rem; + font-weight: 400; + color: ${theme.palette.mode === 'dark' ? grey[400] : grey[800]}; + } + `, +); const CustomModalRoot = styled('div')` position: fixed; @@ -232,25 +268,31 @@ const CustomModalBackdrop = styled(Backdrop)` const TriggerButton = styled(Button)( ({ theme }) => ` font-family: IBM Plex Sans, sans-serif; - font-size: 0.875rem; font-weight: 600; - box-sizing: border-box; - min-height: calc(1.5em + 22px); - border-radius: 12px; - padding: 6px 12px; + font-size: 0.875rem; line-height: 1.5; - background: transparent; - border: 1px solid ${theme.palette.mode === 'dark' ? grey[800] : grey[200]}; - color: ${theme.palette.mode === 'dark' ? grey[100] : grey[900]}; + padding: 8px 16px; + border-radius: 8px; + color: white; + transition: all 150ms ease; + cursor: pointer; + background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'}; + border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; + color: ${theme.palette.mode === 'dark' ? grey[200] : grey[900]}; + box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); &:hover { background: ${theme.palette.mode === 'dark' ? grey[800] : grey[50]}; border-color: ${theme.palette.mode === 'dark' ? grey[600] : grey[300]}; } + &:active { + background: ${theme.palette.mode === 'dark' ? grey[700] : grey[100]}; + } + &:focus-visible { - border-color: ${blue[400]}; - outline: 3px solid ${theme.palette.mode === 'dark' ? blue[500] : blue[200]}; + box-shadow: 0 0 0 4px ${theme.palette.mode === 'dark' ? blue[300] : blue[200]}; + outline: none; } - `, +`, ); diff --git a/docs/data/base/components/modal/UseModal.tsx b/docs/data/base/components/modal/UseModal.tsx index 6d69e3f7b9884b..8d7c0aac2f916b 100644 --- a/docs/data/base/components/modal/UseModal.tsx +++ b/docs/data/base/components/modal/UseModal.tsx @@ -1,7 +1,7 @@ 'use client'; import * as React from 'react'; import clsx from 'clsx'; -import { Box, styled, Theme } from '@mui/system'; +import { styled } from '@mui/system'; import { Portal } from '@mui/base/Portal'; import { FocusTrap } from '@mui/base/FocusTrap'; import { Button } from '@mui/base/Button'; @@ -24,12 +24,14 @@ export default function UseModal() { closeAfterTransition > - -

Text in a modal

- + +

+ Text in a modal +

+ Duis mollis, est non commodo luctus, nisi erat porttitor ligula. -
+
@@ -174,9 +176,12 @@ const Backdrop = React.forwardRef( ); const blue = { - 200: '#99CCF3', + 200: '#99CCFF', + 300: '#66B2FF', 400: '#3399FF', 500: '#007FFF', + 600: '#0072E5', + 700: '#0066CC', }; const grey = { @@ -192,17 +197,48 @@ const grey = { 900: '#24292f', }; -const style = (theme: Theme) => ({ +const style = { position: 'absolute' as 'absolute', top: '50%', left: '50%', transform: 'translate(-50%, -50%)', width: 400, - borderRadius: '12px', - padding: '16px 32px 24px 32px', - backgroundColor: theme.palette.mode === 'dark' ? '#0A1929' : 'white', - boxShadow: `0px 2px 24px ${theme.palette.mode === 'dark' ? '#000' : '#383838'}`, -}); +}; + +const ModalContent = styled('div')( + ({ theme }) => ` + display: flex; + flex-direction: column; + gap: 8px; + overflow: hidden; + background-color: ${theme.palette.mode === 'dark' ? grey[900] : '#FFF'}; + border-radius: 8px; + border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; + box-shadow: 0px 4px 12px ${ + theme.palette.mode === 'dark' ? 'rgba(0,0,0, 0.50)' : 'rgba(0,0,0, 0.20)' + }; + padding: 1rem; + color: ${theme.palette.mode === 'dark' ? grey[50] : grey[900]}; + font-family: IBM Plex Sans, sans-serif; + font-weight: 500; + text-align: start; + position: relative; + + + & .modal-title { + margin: 0; + line-height: 1.5rem; + margin-right: 0.5rem; + } + + & .modal-description { + margin: 0; + line-height: 1.5rem; + font-weight: 400; + color: ${theme.palette.mode === 'dark' ? grey[400] : grey[800]}; + } + `, +); const CustomModalRoot = styled('div')` position: fixed; @@ -224,25 +260,31 @@ const CustomModalBackdrop = styled(Backdrop)` const TriggerButton = styled(Button)( ({ theme }) => ` font-family: IBM Plex Sans, sans-serif; - font-size: 0.875rem; font-weight: 600; - box-sizing: border-box; - min-height: calc(1.5em + 22px); - border-radius: 12px; - padding: 6px 12px; + font-size: 0.875rem; line-height: 1.5; - background: transparent; - border: 1px solid ${theme.palette.mode === 'dark' ? grey[800] : grey[200]}; - color: ${theme.palette.mode === 'dark' ? grey[100] : grey[900]}; + padding: 8px 16px; + border-radius: 8px; + color: white; + transition: all 150ms ease; + cursor: pointer; + background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'}; + border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; + color: ${theme.palette.mode === 'dark' ? grey[200] : grey[900]}; + box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); &:hover { background: ${theme.palette.mode === 'dark' ? grey[800] : grey[50]}; border-color: ${theme.palette.mode === 'dark' ? grey[600] : grey[300]}; } + &:active { + background: ${theme.palette.mode === 'dark' ? grey[700] : grey[100]}; + } + &:focus-visible { - border-color: ${blue[400]}; - outline: 3px solid ${theme.palette.mode === 'dark' ? blue[500] : blue[200]}; + box-shadow: 0 0 0 4px ${theme.palette.mode === 'dark' ? blue[300] : blue[200]}; + outline: none; } - `, +`, ); diff --git a/docs/data/base/components/number-input/NumberInputAdornments.js b/docs/data/base/components/number-input/NumberInputAdornments.js index 5e9e64a20c7d5b..e03cd51c28a99e 100644 --- a/docs/data/base/components/number-input/NumberInputAdornments.js +++ b/docs/data/base/components/number-input/NumberInputAdornments.js @@ -1,10 +1,9 @@ import * as React from 'react'; +import { Box, styled } from '@mui/system'; import { Unstable_NumberInput as BaseNumberInput, numberInputClasses, } from '@mui/base/Unstable_NumberInput'; -import Box from '@mui/material/Box'; -import { styled } from '@mui/system'; const NumberInput = React.forwardRef(function CustomNumberInput(props, ref) { return ( @@ -44,16 +43,17 @@ export default function NumberInputAdornments() { - + + } @@ -76,10 +76,11 @@ const InputAdornment = styled('div')( const blue = { 100: '#DAECFF', - 200: '#b6daff', + 200: '#B6DAFF', 400: '#3399FF', 500: '#007FFF', 600: '#0072E5', + 700: '#0059B2', 900: '#003A75', }; @@ -104,15 +105,18 @@ const InputRoot = styled('div')( color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]}; background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'}; border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; + box-shadow: 0px 2px 4px ${ + theme.palette.mode === 'dark' ? 'rgba(0,0,0, 0.5)' : 'rgba(0,0,0, 0.05)' + }; display: grid; grid-template-columns: auto 1fr auto 19px; grid-template-rows: 1fr 1fr; overflow: hidden; - + padding: 4px; &.${numberInputClasses.focused} { border-color: ${blue[400]}; - box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[600] : blue[200]}; + box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[700] : blue[200]}; } &:hover { @@ -126,19 +130,21 @@ const InputRoot = styled('div')( `, ); -const InputElement = styled('input')` +const InputElement = styled('input')( + ({ theme }) => ` font-size: 0.875rem; font-family: inherit; font-weight: 400; line-height: 1.5; grid-row: 1/3; - color: inherit; + color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]}; background: inherit; border: none; border-radius: inherit; padding: 8px 12px; outline: 0; -`; +`, +); const Button = styled('button')( ({ theme }) => ` @@ -149,7 +155,7 @@ const Button = styled('button')( appearance: none; padding: 0; width: 19px; - height: 19px; + height: 20px; font-family: system-ui, sans-serif; font-size: 0.875rem; line-height: 1; @@ -157,7 +163,6 @@ const Button = styled('button')( background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'}; border: 0; color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]}; - transition-property: all; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 120ms; @@ -171,11 +176,42 @@ const Button = styled('button')( &.${numberInputClasses.incrementButton} { grid-column: 4/5; grid-row: 1/2; + border-top-left-radius: 4px; + border-top-right-radius: 4px; + border: 1px solid; + border-bottom: 0; + border-color: ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; + background: ${theme.palette.mode === 'dark' ? grey[900] : grey[50]}; + color: ${theme.palette.mode === 'dark' ? grey[200] : grey[900]}; + + &:hover { + cursor: pointer; + color: #FFF; + background: ${theme.palette.mode === 'dark' ? blue[600] : blue[500]}; + border-color: ${theme.palette.mode === 'dark' ? blue[400] : blue[600]}; + } } &.${numberInputClasses.decrementButton} { grid-column: 4/5; grid-row: 2/3; + border-bottom-left-radius: 4px; + border-bottom-right-radius: 4px; + border: 1px solid; + border-color: ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; + background: ${theme.palette.mode === 'dark' ? grey[900] : grey[50]}; + color: ${theme.palette.mode === 'dark' ? grey[200] : grey[900]}; + + &:hover { + cursor: pointer; + color: #FFF; + background: ${theme.palette.mode === 'dark' ? blue[600] : blue[500]}; + border-color: ${theme.palette.mode === 'dark' ? blue[400] : blue[600]}; + } + } + + & .arrow { + transform: translateY(-1px); } & .arrow { diff --git a/docs/data/base/components/number-input/NumberInputAdornments.tsx b/docs/data/base/components/number-input/NumberInputAdornments.tsx index acee9ba93a6bb5..96acd5b473fbf8 100644 --- a/docs/data/base/components/number-input/NumberInputAdornments.tsx +++ b/docs/data/base/components/number-input/NumberInputAdornments.tsx @@ -1,11 +1,10 @@ import * as React from 'react'; +import { Box, styled } from '@mui/system'; import { Unstable_NumberInput as BaseNumberInput, NumberInputProps, numberInputClasses, } from '@mui/base/Unstable_NumberInput'; -import Box from '@mui/material/Box'; -import { styled } from '@mui/system'; const NumberInput = React.forwardRef(function CustomNumberInput( props: NumberInputProps, @@ -48,16 +47,17 @@ export default function NumberInputAdornments() { - + + } @@ -80,10 +80,11 @@ const InputAdornment = styled('div')( const blue = { 100: '#DAECFF', - 200: '#b6daff', + 200: '#B6DAFF', 400: '#3399FF', 500: '#007FFF', 600: '#0072E5', + 700: '#0059B2', 900: '#003A75', }; @@ -108,15 +109,18 @@ const InputRoot = styled('div')( color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]}; background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'}; border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; + box-shadow: 0px 2px 4px ${ + theme.palette.mode === 'dark' ? 'rgba(0,0,0, 0.5)' : 'rgba(0,0,0, 0.05)' + }; display: grid; grid-template-columns: auto 1fr auto 19px; grid-template-rows: 1fr 1fr; overflow: hidden; - + padding: 4px; &.${numberInputClasses.focused} { border-color: ${blue[400]}; - box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[600] : blue[200]}; + box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[700] : blue[200]}; } &:hover { @@ -130,19 +134,21 @@ const InputRoot = styled('div')( `, ); -const InputElement = styled('input')` +const InputElement = styled('input')( + ({ theme }) => ` font-size: 0.875rem; font-family: inherit; font-weight: 400; line-height: 1.5; grid-row: 1/3; - color: inherit; + color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]}; background: inherit; border: none; border-radius: inherit; padding: 8px 12px; outline: 0; -`; +`, +); const Button = styled('button')( ({ theme }) => ` @@ -153,7 +159,7 @@ const Button = styled('button')( appearance: none; padding: 0; width: 19px; - height: 19px; + height: 20px; font-family: system-ui, sans-serif; font-size: 0.875rem; line-height: 1; @@ -161,7 +167,6 @@ const Button = styled('button')( background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'}; border: 0; color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]}; - transition-property: all; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 120ms; @@ -175,11 +180,42 @@ const Button = styled('button')( &.${numberInputClasses.incrementButton} { grid-column: 4/5; grid-row: 1/2; + border-top-left-radius: 4px; + border-top-right-radius: 4px; + border: 1px solid; + border-bottom: 0; + border-color: ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; + background: ${theme.palette.mode === 'dark' ? grey[900] : grey[50]}; + color: ${theme.palette.mode === 'dark' ? grey[200] : grey[900]}; + + &:hover { + cursor: pointer; + color: #FFF; + background: ${theme.palette.mode === 'dark' ? blue[600] : blue[500]}; + border-color: ${theme.palette.mode === 'dark' ? blue[400] : blue[600]}; + } } &.${numberInputClasses.decrementButton} { grid-column: 4/5; grid-row: 2/3; + border-bottom-left-radius: 4px; + border-bottom-right-radius: 4px; + border: 1px solid; + border-color: ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; + background: ${theme.palette.mode === 'dark' ? grey[900] : grey[50]}; + color: ${theme.palette.mode === 'dark' ? grey[200] : grey[900]}; + + &:hover { + cursor: pointer; + color: #FFF; + background: ${theme.palette.mode === 'dark' ? blue[600] : blue[500]}; + border-color: ${theme.palette.mode === 'dark' ? blue[400] : blue[600]}; + } + } + + & .arrow { + transform: translateY(-1px); } & .arrow { diff --git a/docs/data/base/components/number-input/NumberInputBasic/css/index.js b/docs/data/base/components/number-input/NumberInputBasic/css/index.js index dd13755aa9771e..70cbf6f30f31cb 100644 --- a/docs/data/base/components/number-input/NumberInputBasic/css/index.js +++ b/docs/data/base/components/number-input/NumberInputBasic/css/index.js @@ -11,15 +11,9 @@ export default function NumberInputBasic() { diff --git a/docs/data/base/components/number-input/NumberInputBasic/css/index.tsx b/docs/data/base/components/number-input/NumberInputBasic/css/index.tsx index dd13755aa9771e..70cbf6f30f31cb 100644 --- a/docs/data/base/components/number-input/NumberInputBasic/css/index.tsx +++ b/docs/data/base/components/number-input/NumberInputBasic/css/index.tsx @@ -11,15 +11,9 @@ export default function NumberInputBasic() { diff --git a/docs/data/base/components/number-input/NumberInputBasic/css/index.tsx.preview b/docs/data/base/components/number-input/NumberInputBasic/css/index.tsx.preview new file mode 100644 index 00000000000000..db90ab67b7cf7d --- /dev/null +++ b/docs/data/base/components/number-input/NumberInputBasic/css/index.tsx.preview @@ -0,0 +1,13 @@ + + + + \ No newline at end of file diff --git a/docs/data/base/components/number-input/NumberInputBasic/system/index.js b/docs/data/base/components/number-input/NumberInputBasic/system/index.js index 439be288e65d64..70871bd517a31c 100644 --- a/docs/data/base/components/number-input/NumberInputBasic/system/index.js +++ b/docs/data/base/components/number-input/NumberInputBasic/system/index.js @@ -74,11 +74,12 @@ const StyledInputRoot = styled('div')( grid-template-columns: 1fr 19px; grid-template-rows: 1fr 1fr; overflow: hidden; - + column-gap: 8px; + padding: 4px; &.${numberInputClasses.focused} { border-color: ${blue[400]}; - box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[500] : blue[200]}; + box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[600] : blue[200]}; } &:hover { @@ -121,8 +122,8 @@ const StyledButton = styled('button')( height: 19px; font-family: system-ui, sans-serif; font-size: 0.875rem; + line-height: 1; box-sizing: border-box; - line-height: 1.2; background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'}; border: 0; color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]}; @@ -139,11 +140,39 @@ const StyledButton = styled('button')( &.${numberInputClasses.incrementButton} { grid-column: 2/3; grid-row: 1/2; + border-top-left-radius: 4px; + border-top-right-radius: 4px; + border: 1px solid; + border-bottom: 0; + &:hover { + cursor: pointer; + background: ${blue[400]}; + color: ${grey[50]}; + } + + border-color: ${theme.palette.mode === 'dark' ? grey[800] : grey[200]}; + background: ${theme.palette.mode === 'dark' ? grey[900] : grey[50]}; + color: ${theme.palette.mode === 'dark' ? grey[200] : grey[900]}; } &.${numberInputClasses.decrementButton} { grid-column: 2/3; grid-row: 2/3; + border-bottom-left-radius: 4px; + border-bottom-right-radius: 4px; + border: 1px solid; + &:hover { + cursor: pointer; + background: ${blue[400]}; + color: ${grey[50]}; + } + + border-color: ${theme.palette.mode === 'dark' ? grey[800] : grey[200]}; + background: ${theme.palette.mode === 'dark' ? grey[900] : grey[50]}; + color: ${theme.palette.mode === 'dark' ? grey[200] : grey[900]}; + } + & .arrow { + transform: translateY(-1px); } `, ); diff --git a/docs/data/base/components/number-input/NumberInputBasic/system/index.tsx b/docs/data/base/components/number-input/NumberInputBasic/system/index.tsx index be5f40104183c4..8181caf068c0c6 100644 --- a/docs/data/base/components/number-input/NumberInputBasic/system/index.tsx +++ b/docs/data/base/components/number-input/NumberInputBasic/system/index.tsx @@ -78,11 +78,12 @@ const StyledInputRoot = styled('div')( grid-template-columns: 1fr 19px; grid-template-rows: 1fr 1fr; overflow: hidden; - + column-gap: 8px; + padding: 4px; &.${numberInputClasses.focused} { border-color: ${blue[400]}; - box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[500] : blue[200]}; + box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[600] : blue[200]}; } &:hover { @@ -125,8 +126,8 @@ const StyledButton = styled('button')( height: 19px; font-family: system-ui, sans-serif; font-size: 0.875rem; + line-height: 1; box-sizing: border-box; - line-height: 1.2; background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'}; border: 0; color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]}; @@ -143,11 +144,39 @@ const StyledButton = styled('button')( &.${numberInputClasses.incrementButton} { grid-column: 2/3; grid-row: 1/2; + border-top-left-radius: 4px; + border-top-right-radius: 4px; + border: 1px solid; + border-bottom: 0; + &:hover { + cursor: pointer; + background: ${blue[400]}; + color: ${grey[50]}; + } + + border-color: ${theme.palette.mode === 'dark' ? grey[800] : grey[200]}; + background: ${theme.palette.mode === 'dark' ? grey[900] : grey[50]}; + color: ${theme.palette.mode === 'dark' ? grey[200] : grey[900]}; } &.${numberInputClasses.decrementButton} { grid-column: 2/3; grid-row: 2/3; + border-bottom-left-radius: 4px; + border-bottom-right-radius: 4px; + border: 1px solid; + &:hover { + cursor: pointer; + background: ${blue[400]}; + color: ${grey[50]}; + } + + border-color: ${theme.palette.mode === 'dark' ? grey[800] : grey[200]}; + background: ${theme.palette.mode === 'dark' ? grey[900] : grey[50]}; + color: ${theme.palette.mode === 'dark' ? grey[200] : grey[900]}; + } + & .arrow { + transform: translateY(-1px); } `, ); diff --git a/docs/data/base/components/number-input/NumberInputBasic/tailwind/index.js b/docs/data/base/components/number-input/NumberInputBasic/tailwind/index.js index 154538e99c5363..a80e865c6e3bba 100644 --- a/docs/data/base/components/number-input/NumberInputBasic/tailwind/index.js +++ b/docs/data/base/components/number-input/NumberInputBasic/tailwind/index.js @@ -31,7 +31,7 @@ const NumberInput = React.forwardRef(function NumberInput(props, ref) { return { ...resolvedSlotProps, className: clsx( - 'grid grid-cols-[1fr_19px] grid-rows-2 overflow-hidden font-sans rounded-lg text-slate-900 dark:text-slate-300 border border-solid bg-white dark:bg-slate-900 hover:border-violet-400 dark:hover:border-violet-400 focus-visible:outline-0 ', + 'grid grid-cols-[1fr_8px] grid-rows-2 overflow-hidden font-sans rounded-lg text-slate-900 dark:text-slate-300 border border-solid bg-white dark:bg-slate-900 hover:border-violet-400 dark:hover:border-violet-400 focus-visible:outline-0 p-1', ownerState.focused ? 'border-violet-400 dark:border-violet-400 shadow-lg shadow-outline-purple dark:shadow-outline-purple' : 'border-slate-300 dark:border-slate-600 shadow-md shadow-slate-100 dark:shadow-slate-900', @@ -61,7 +61,7 @@ const NumberInput = React.forwardRef(function NumberInput(props, ref) { ...resolvedSlotProps, children: '▴', className: clsx( - 'font-[system-ui] flex flex-row flex-nowrap justify-center items-center appearance-none p-0 w-[19px] h-[19px] text-sm box-border leading-[1.2] border-0 bg-white dark:bg-slate-900 text-slate-900 dark:text-slate-300 transition-all duration-[120ms] hover:cursor-pointer hover:bg-slate-50 dark:hover:bg-slate-800 border-slate-300 dark:border-slate-600 col-start-2 col-end-3 row-start-1 row-end-2', + 'font-[system-ui] flex flex-row flex-nowrap justify-center items-center p-0 w-[19px] h-[19px] border border-solid outline-none text-sm box-border leading-[1.2] rounded-t-md border-slate-200 bg-slate-50 dark:bg-slate-900 text-slate-900 dark:text-slate-300 transition-all duration-[120ms] hover:cursor-pointer hover:bg-purple-500 hover:text-slate-50 dark:hover:bg-slate-800 dark:border-slate-600 col-start-3 col-end-3 row-start-1 row-end-2', resolvedSlotProps?.className, ), }; @@ -75,7 +75,7 @@ const NumberInput = React.forwardRef(function NumberInput(props, ref) { ...resolvedSlotProps, children: '▾', className: clsx( - 'font-[system-ui] flex flex-row flex-nowrap justify-center items-center appearance-none p-0 w-[19px] h-[19px] text-sm box-border leading-[1.2] border-0 bg-white dark:bg-slate-900 text-slate-900 dark:text-slate-300 transition-all duration-[120ms] hover:cursor-pointer hover:bg-slate-50 dark:hover:bg-slate-800 border-slate-300 dark:border-slate-600 col-start-2 col-end-3 row-start-2 row-end-3', + 'font-[system-ui] flex flex-row flex-nowrap justify-center items-center p-0 w-[19px] h-[19px] border border-solid outline-none text-sm box-border leading-[1.2] rounded-b-md border-slate-200 border-t-0 bg-slate-50 dark:bg-slate-900 text-slate-900 dark:text-slate-300 transition-all duration-[120ms] hover:cursor-pointer hover:bg-purple-500 hover:text-slate-50 dark:hover:bg-slate-800 dark:border-slate-600 col-start-3 col-end-3 row-start-2 row-end-3', resolvedSlotProps?.className, ), }; diff --git a/docs/data/base/components/number-input/NumberInputBasic/tailwind/index.tsx b/docs/data/base/components/number-input/NumberInputBasic/tailwind/index.tsx index 082b0b257505be..c86017469b433b 100644 --- a/docs/data/base/components/number-input/NumberInputBasic/tailwind/index.tsx +++ b/docs/data/base/components/number-input/NumberInputBasic/tailwind/index.tsx @@ -38,7 +38,7 @@ const NumberInput = React.forwardRef(function NumberInput( return { ...resolvedSlotProps, className: clsx( - 'grid grid-cols-[1fr_19px] grid-rows-2 overflow-hidden font-sans rounded-lg text-slate-900 dark:text-slate-300 border border-solid bg-white dark:bg-slate-900 hover:border-violet-400 dark:hover:border-violet-400 focus-visible:outline-0 ', + 'grid grid-cols-[1fr_8px] grid-rows-2 overflow-hidden font-sans rounded-lg text-slate-900 dark:text-slate-300 border border-solid bg-white dark:bg-slate-900 hover:border-violet-400 dark:hover:border-violet-400 focus-visible:outline-0 p-1', ownerState.focused ? 'border-violet-400 dark:border-violet-400 shadow-lg shadow-outline-purple dark:shadow-outline-purple' : 'border-slate-300 dark:border-slate-600 shadow-md shadow-slate-100 dark:shadow-slate-900', @@ -68,7 +68,7 @@ const NumberInput = React.forwardRef(function NumberInput( ...resolvedSlotProps, children: '▴', className: clsx( - 'font-[system-ui] flex flex-row flex-nowrap justify-center items-center appearance-none p-0 w-[19px] h-[19px] text-sm box-border leading-[1.2] border-0 bg-white dark:bg-slate-900 text-slate-900 dark:text-slate-300 transition-all duration-[120ms] hover:cursor-pointer hover:bg-slate-50 dark:hover:bg-slate-800 border-slate-300 dark:border-slate-600 col-start-2 col-end-3 row-start-1 row-end-2', + 'font-[system-ui] flex flex-row flex-nowrap justify-center items-center p-0 w-[19px] h-[19px] border border-solid outline-none text-sm box-border leading-[1.2] rounded-t-md border-slate-200 bg-slate-50 dark:bg-slate-900 text-slate-900 dark:text-slate-300 transition-all duration-[120ms] hover:cursor-pointer hover:bg-purple-500 hover:text-slate-50 dark:hover:bg-slate-800 dark:border-slate-600 col-start-3 col-end-3 row-start-1 row-end-2', resolvedSlotProps?.className, ), }; @@ -82,7 +82,7 @@ const NumberInput = React.forwardRef(function NumberInput( ...resolvedSlotProps, children: '▾', className: clsx( - 'font-[system-ui] flex flex-row flex-nowrap justify-center items-center appearance-none p-0 w-[19px] h-[19px] text-sm box-border leading-[1.2] border-0 bg-white dark:bg-slate-900 text-slate-900 dark:text-slate-300 transition-all duration-[120ms] hover:cursor-pointer hover:bg-slate-50 dark:hover:bg-slate-800 border-slate-300 dark:border-slate-600 col-start-2 col-end-3 row-start-2 row-end-3', + 'font-[system-ui] flex flex-row flex-nowrap justify-center items-center p-0 w-[19px] h-[19px] border border-solid outline-none text-sm box-border leading-[1.2] rounded-b-md border-slate-200 border-t-0 bg-slate-50 dark:bg-slate-900 text-slate-900 dark:text-slate-300 transition-all duration-[120ms] hover:cursor-pointer hover:bg-purple-500 hover:text-slate-50 dark:hover:bg-slate-800 dark:border-slate-600 col-start-3 col-end-3 row-start-2 row-end-3', resolvedSlotProps?.className, ), }; diff --git a/docs/data/base/components/number-input/NumberInputIntroduction/css/index.js b/docs/data/base/components/number-input/NumberInputIntroduction/css/index.js index 63ec2558e475e2..64a0ca7d0fe5ef 100644 --- a/docs/data/base/components/number-input/NumberInputIntroduction/css/index.js +++ b/docs/data/base/components/number-input/NumberInputIntroduction/css/index.js @@ -5,21 +5,15 @@ import { } from '@mui/base/Unstable_NumberInput'; import { useTheme } from '@mui/system'; -export default function NumberInputIntroduction() { +export default function NumberInputBasic() { return ( ▾, - }, - incrementButton: { - className: 'CustomNumberInput-button CustomNumberInput-incrementButton', - children: ▴, - }, + input: { className: 'input' }, + decrementButton: { className: 'btn decrement', children: '▾' }, + incrementButton: { className: 'btn increment', children: '▴' }, }} aria-label="Demo number input" placeholder="Type a number…" @@ -69,18 +63,20 @@ function Styles() { {` .CustomNumberInput { font-family: IBM Plex Sans, sans-serif; - font-size: 0.875rem; font-weight: 400; - line-height: 1.5; border-radius: 8px; color: ${isDarkMode ? grey[300] : grey[900]}; background: ${isDarkMode ? grey[900] : '#fff'}; border: 1px solid ${isDarkMode ? grey[700] : grey[200]}; - box-shadow: 0px 2px 24px ${isDarkMode ? grey[900] : grey[100]}; + box-shadow: 0px 2px 4px ${ + isDarkMode ? 'rgba(0,0,0, 0.5)' : 'rgba(0,0,0, 0.05)' + }; display: grid; grid-template-columns: 1fr 19px; grid-template-rows: 1fr 1fr; overflow: hidden; + column-gap: 8px; + padding: 4px; } .CustomNumberInput:hover { @@ -89,17 +85,17 @@ function Styles() { .CustomNumberInput.${numberInputClasses.focused} { border-color: ${cyan[400]}; - box-shadow: 0 0 0 3px ${isDarkMode ? cyan[600] : cyan[200]}; + box-shadow: 0 0 0 3px ${isDarkMode ? cyan[500] : cyan[200]}; } - .CustomNumberInput .CustomNumberInput-input { + .CustomNumberInput .input { + font-size: 0.875rem; font-family: inherit; - font-size: inherit; - font-weight: inherit; - line-height: inherit; + font-weight: 400; + line-height: 1.5; grid-column: 1/2; grid-row: 1/3; - color: red; + color: ${isDarkMode ? grey[300] : grey[900]}; background: inherit; border: none; border-radius: inherit; @@ -107,11 +103,11 @@ function Styles() { outline: 0; } - .CustomNumberInput .CustomNumberInput-button:focus-visible { + .CustomNumberInput .input:focus-visible { outline: 0; } - .CustomNumberInput .CustomNumberInput-button { + .CustomNumberInput .btn { display: flex; flex-flow: row nowrap; justify-content: center; @@ -122,32 +118,59 @@ function Styles() { height: 19px; font-family: system-ui, sans-serif; font-size: 0.875rem; - box-sizing: border-box; line-height: 1; + box-sizing: border-box; background: ${isDarkMode ? grey[900] : '#fff'}; - color: ${isDarkMode ? grey[300] : grey[900]}; border: 0; - + color: ${isDarkMode ? grey[300] : grey[900]}; transition-property: all; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 120ms; } - .CustomNumberInput .CustomNumberInput-button:hover { + .CustomNumberInput .btn:hover { background: ${isDarkMode ? grey[800] : grey[50]}; border-color: ${isDarkMode ? grey[600] : grey[300]}; cursor: pointer; } - .CustomNumberInput .CustomNumberInput-button.CustomNumberInput-incrementButton { + .CustomNumberInput .btn.increment { grid-column: 2/3; grid-row: 1/2; + border-top-left-radius: 4px; + border-top-right-radius: 4px; + border: 1px solid; + border-bottom: 0; + border-color: ${isDarkMode ? grey[800] : grey[200]}; + background: ${isDarkMode ? grey[900] : grey[50]}; + color: ${isDarkMode ? grey[200] : grey[900]}; + + &:hover { + cursor: pointer; + color: #FFF; + background: ${isDarkMode ? cyan[100] : cyan[500]}; + border-color: ${isDarkMode ? cyan[400] : cyan[600]}; + } } - .CustomNumberInput .CustomNumberInput-button.CustomNumberInput-decrementButton { + .CustomNumberInput .btn.decrement { grid-column: 2/3; grid-row: 2/3; - } + border-bottom-left-radius: 4px; + border-bottom-right-radius: 4px; + border: 1px solid; + border-color: ${isDarkMode ? grey[800] : grey[200]}; + background: ${isDarkMode ? grey[900] : grey[50]}; + color: ${isDarkMode ? grey[200] : grey[900]}; + + &:hover { + cursor: pointer; + color: #FFF; + background: ${isDarkMode ? cyan[100] : cyan[500]}; + border-color: ${isDarkMode ? cyan[400] : cyan[600]}; + } + } + & .arrow { transform: translateY(-1px); } diff --git a/docs/data/base/components/number-input/NumberInputIntroduction/css/index.tsx b/docs/data/base/components/number-input/NumberInputIntroduction/css/index.tsx index 63ec2558e475e2..64a0ca7d0fe5ef 100644 --- a/docs/data/base/components/number-input/NumberInputIntroduction/css/index.tsx +++ b/docs/data/base/components/number-input/NumberInputIntroduction/css/index.tsx @@ -5,21 +5,15 @@ import { } from '@mui/base/Unstable_NumberInput'; import { useTheme } from '@mui/system'; -export default function NumberInputIntroduction() { +export default function NumberInputBasic() { return ( ▾, - }, - incrementButton: { - className: 'CustomNumberInput-button CustomNumberInput-incrementButton', - children: ▴, - }, + input: { className: 'input' }, + decrementButton: { className: 'btn decrement', children: '▾' }, + incrementButton: { className: 'btn increment', children: '▴' }, }} aria-label="Demo number input" placeholder="Type a number…" @@ -69,18 +63,20 @@ function Styles() { {` .CustomNumberInput { font-family: IBM Plex Sans, sans-serif; - font-size: 0.875rem; font-weight: 400; - line-height: 1.5; border-radius: 8px; color: ${isDarkMode ? grey[300] : grey[900]}; background: ${isDarkMode ? grey[900] : '#fff'}; border: 1px solid ${isDarkMode ? grey[700] : grey[200]}; - box-shadow: 0px 2px 24px ${isDarkMode ? grey[900] : grey[100]}; + box-shadow: 0px 2px 4px ${ + isDarkMode ? 'rgba(0,0,0, 0.5)' : 'rgba(0,0,0, 0.05)' + }; display: grid; grid-template-columns: 1fr 19px; grid-template-rows: 1fr 1fr; overflow: hidden; + column-gap: 8px; + padding: 4px; } .CustomNumberInput:hover { @@ -89,17 +85,17 @@ function Styles() { .CustomNumberInput.${numberInputClasses.focused} { border-color: ${cyan[400]}; - box-shadow: 0 0 0 3px ${isDarkMode ? cyan[600] : cyan[200]}; + box-shadow: 0 0 0 3px ${isDarkMode ? cyan[500] : cyan[200]}; } - .CustomNumberInput .CustomNumberInput-input { + .CustomNumberInput .input { + font-size: 0.875rem; font-family: inherit; - font-size: inherit; - font-weight: inherit; - line-height: inherit; + font-weight: 400; + line-height: 1.5; grid-column: 1/2; grid-row: 1/3; - color: red; + color: ${isDarkMode ? grey[300] : grey[900]}; background: inherit; border: none; border-radius: inherit; @@ -107,11 +103,11 @@ function Styles() { outline: 0; } - .CustomNumberInput .CustomNumberInput-button:focus-visible { + .CustomNumberInput .input:focus-visible { outline: 0; } - .CustomNumberInput .CustomNumberInput-button { + .CustomNumberInput .btn { display: flex; flex-flow: row nowrap; justify-content: center; @@ -122,32 +118,59 @@ function Styles() { height: 19px; font-family: system-ui, sans-serif; font-size: 0.875rem; - box-sizing: border-box; line-height: 1; + box-sizing: border-box; background: ${isDarkMode ? grey[900] : '#fff'}; - color: ${isDarkMode ? grey[300] : grey[900]}; border: 0; - + color: ${isDarkMode ? grey[300] : grey[900]}; transition-property: all; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 120ms; } - .CustomNumberInput .CustomNumberInput-button:hover { + .CustomNumberInput .btn:hover { background: ${isDarkMode ? grey[800] : grey[50]}; border-color: ${isDarkMode ? grey[600] : grey[300]}; cursor: pointer; } - .CustomNumberInput .CustomNumberInput-button.CustomNumberInput-incrementButton { + .CustomNumberInput .btn.increment { grid-column: 2/3; grid-row: 1/2; + border-top-left-radius: 4px; + border-top-right-radius: 4px; + border: 1px solid; + border-bottom: 0; + border-color: ${isDarkMode ? grey[800] : grey[200]}; + background: ${isDarkMode ? grey[900] : grey[50]}; + color: ${isDarkMode ? grey[200] : grey[900]}; + + &:hover { + cursor: pointer; + color: #FFF; + background: ${isDarkMode ? cyan[100] : cyan[500]}; + border-color: ${isDarkMode ? cyan[400] : cyan[600]}; + } } - .CustomNumberInput .CustomNumberInput-button.CustomNumberInput-decrementButton { + .CustomNumberInput .btn.decrement { grid-column: 2/3; grid-row: 2/3; - } + border-bottom-left-radius: 4px; + border-bottom-right-radius: 4px; + border: 1px solid; + border-color: ${isDarkMode ? grey[800] : grey[200]}; + background: ${isDarkMode ? grey[900] : grey[50]}; + color: ${isDarkMode ? grey[200] : grey[900]}; + + &:hover { + cursor: pointer; + color: #FFF; + background: ${isDarkMode ? cyan[100] : cyan[500]}; + border-color: ${isDarkMode ? cyan[400] : cyan[600]}; + } + } + & .arrow { transform: translateY(-1px); } diff --git a/docs/data/base/components/number-input/NumberInputIntroduction/css/index.tsx.preview b/docs/data/base/components/number-input/NumberInputIntroduction/css/index.tsx.preview new file mode 100644 index 00000000000000..db90ab67b7cf7d --- /dev/null +++ b/docs/data/base/components/number-input/NumberInputIntroduction/css/index.tsx.preview @@ -0,0 +1,13 @@ + + + + \ No newline at end of file diff --git a/docs/data/base/components/number-input/NumberInputIntroduction/system/index.js b/docs/data/base/components/number-input/NumberInputIntroduction/system/index.js index b5f664826340b9..f8b579b7ef1ac7 100644 --- a/docs/data/base/components/number-input/NumberInputIntroduction/system/index.js +++ b/docs/data/base/components/number-input/NumberInputIntroduction/system/index.js @@ -5,7 +5,7 @@ import { } from '@mui/base/Unstable_NumberInput'; import { styled } from '@mui/system'; -const NumberInput = React.forwardRef(function CustomNumberInput(props, ref) { +const CustomNumberInput = React.forwardRef(function CustomNumberInput(props, ref) { return ( ▴, + children: '▴', }, decrementButton: { - children: ▾, + children: '▾', }, }} {...props} @@ -29,29 +29,31 @@ const NumberInput = React.forwardRef(function CustomNumberInput(props, ref) { }); export default function NumberInputIntroduction() { - return ; + return ( + + ); } const blue = { 100: '#DAECFF', - 200: '#b6daff', + 200: '#80BFFF', 400: '#3399FF', 500: '#007FFF', 600: '#0072E5', - 900: '#003A75', + 700: '#0059B2', }; const grey = { - 50: '#f6f8fa', - 100: '#eaeef2', - 200: '#d0d7de', - 300: '#afb8c1', - 400: '#8c959f', - 500: '#6e7781', - 600: '#57606a', - 700: '#424a53', - 800: '#32383f', - 900: '#24292f', + 50: '#F3F6F9', + 100: '#E7EBF0', + 200: '#E0E3E7', + 300: '#CDD2D7', + 400: '#B2BAC2', + 500: '#A0AAB4', + 600: '#6F7E8C', + 700: '#3E5060', + 800: '#2D3843', + 900: '#1A2027', }; const StyledInputRoot = styled('div')( @@ -62,16 +64,19 @@ const StyledInputRoot = styled('div')( color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]}; background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'}; border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; - box-shadow: 0px 2px 24px ${theme.palette.mode === 'dark' ? blue[900] : blue[100]}; + box-shadow: 0px 2px 4px ${ + theme.palette.mode === 'dark' ? 'rgba(0,0,0, 0.5)' : 'rgba(0,0,0, 0.05)' + }; display: grid; grid-template-columns: 1fr 19px; grid-template-rows: 1fr 1fr; overflow: hidden; - + column-gap: 8px; + padding: 4px; &.${numberInputClasses.focused} { border-color: ${blue[400]}; - box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[600] : blue[200]}; + box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[700] : blue[200]}; } &:hover { @@ -132,11 +137,42 @@ const StyledButton = styled('button')( &.${numberInputClasses.incrementButton} { grid-column: 2/3; grid-row: 1/2; + border-top-left-radius: 4px; + border-top-right-radius: 4px; + border: 1px solid; + border-bottom: 0; + border-color: ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; + background: ${theme.palette.mode === 'dark' ? grey[900] : grey[50]}; + color: ${theme.palette.mode === 'dark' ? grey[200] : grey[900]}; + + &:hover { + cursor: pointer; + color: #FFF; + background: ${theme.palette.mode === 'dark' ? blue[600] : blue[500]}; + border-color: ${theme.palette.mode === 'dark' ? blue[400] : blue[600]}; + } } &.${numberInputClasses.decrementButton} { grid-column: 2/3; grid-row: 2/3; + border-bottom-left-radius: 4px; + border-bottom-right-radius: 4px; + border: 1px solid; + border-color: ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; + background: ${theme.palette.mode === 'dark' ? grey[900] : grey[50]}; + color: ${theme.palette.mode === 'dark' ? grey[200] : grey[900]}; + } + + &:hover { + cursor: pointer; + color: #FFF; + background: ${theme.palette.mode === 'dark' ? blue[600] : blue[500]}; + border-color: ${theme.palette.mode === 'dark' ? blue[400] : blue[600]}; + } + + & .arrow { + transform: translateY(-1px); } & .arrow { diff --git a/docs/data/base/components/number-input/NumberInputIntroduction/system/index.tsx b/docs/data/base/components/number-input/NumberInputIntroduction/system/index.tsx index 6d1938463f71a4..6dfd3fc0c46f55 100644 --- a/docs/data/base/components/number-input/NumberInputIntroduction/system/index.tsx +++ b/docs/data/base/components/number-input/NumberInputIntroduction/system/index.tsx @@ -6,7 +6,7 @@ import { } from '@mui/base/Unstable_NumberInput'; import { styled } from '@mui/system'; -const NumberInput = React.forwardRef(function CustomNumberInput( +const CustomNumberInput = React.forwardRef(function CustomNumberInput( props: NumberInputProps, ref: React.ForwardedRef, ) { @@ -20,10 +20,10 @@ const NumberInput = React.forwardRef(function CustomNumberInput( }} slotProps={{ incrementButton: { - children: ▴, + children: '▴', }, decrementButton: { - children: ▾, + children: '▾', }, }} {...props} @@ -33,29 +33,31 @@ const NumberInput = React.forwardRef(function CustomNumberInput( }); export default function NumberInputIntroduction() { - return ; + return ( + + ); } const blue = { 100: '#DAECFF', - 200: '#b6daff', + 200: '#80BFFF', 400: '#3399FF', 500: '#007FFF', 600: '#0072E5', - 900: '#003A75', + 700: '#0059B2', }; const grey = { - 50: '#f6f8fa', - 100: '#eaeef2', - 200: '#d0d7de', - 300: '#afb8c1', - 400: '#8c959f', - 500: '#6e7781', - 600: '#57606a', - 700: '#424a53', - 800: '#32383f', - 900: '#24292f', + 50: '#F3F6F9', + 100: '#E7EBF0', + 200: '#E0E3E7', + 300: '#CDD2D7', + 400: '#B2BAC2', + 500: '#A0AAB4', + 600: '#6F7E8C', + 700: '#3E5060', + 800: '#2D3843', + 900: '#1A2027', }; const StyledInputRoot = styled('div')( @@ -66,16 +68,19 @@ const StyledInputRoot = styled('div')( color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]}; background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'}; border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; - box-shadow: 0px 2px 24px ${theme.palette.mode === 'dark' ? blue[900] : blue[100]}; + box-shadow: 0px 2px 4px ${ + theme.palette.mode === 'dark' ? 'rgba(0,0,0, 0.5)' : 'rgba(0,0,0, 0.05)' + }; display: grid; grid-template-columns: 1fr 19px; grid-template-rows: 1fr 1fr; overflow: hidden; - + column-gap: 8px; + padding: 4px; &.${numberInputClasses.focused} { border-color: ${blue[400]}; - box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[600] : blue[200]}; + box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[700] : blue[200]}; } &:hover { @@ -136,11 +141,42 @@ const StyledButton = styled('button')( &.${numberInputClasses.incrementButton} { grid-column: 2/3; grid-row: 1/2; + border-top-left-radius: 4px; + border-top-right-radius: 4px; + border: 1px solid; + border-bottom: 0; + border-color: ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; + background: ${theme.palette.mode === 'dark' ? grey[900] : grey[50]}; + color: ${theme.palette.mode === 'dark' ? grey[200] : grey[900]}; + + &:hover { + cursor: pointer; + color: #FFF; + background: ${theme.palette.mode === 'dark' ? blue[600] : blue[500]}; + border-color: ${theme.palette.mode === 'dark' ? blue[400] : blue[600]}; + } } &.${numberInputClasses.decrementButton} { grid-column: 2/3; grid-row: 2/3; + border-bottom-left-radius: 4px; + border-bottom-right-radius: 4px; + border: 1px solid; + border-color: ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; + background: ${theme.palette.mode === 'dark' ? grey[900] : grey[50]}; + color: ${theme.palette.mode === 'dark' ? grey[200] : grey[900]}; + } + + &:hover { + cursor: pointer; + color: #FFF; + background: ${theme.palette.mode === 'dark' ? blue[600] : blue[500]}; + border-color: ${theme.palette.mode === 'dark' ? blue[400] : blue[600]}; + } + + & .arrow { + transform: translateY(-1px); } & .arrow { diff --git a/docs/data/base/components/number-input/NumberInputIntroduction/system/index.tsx.preview b/docs/data/base/components/number-input/NumberInputIntroduction/system/index.tsx.preview index b8d7d59c3a3688..fa6c5c5dc81d85 100644 --- a/docs/data/base/components/number-input/NumberInputIntroduction/system/index.tsx.preview +++ b/docs/data/base/components/number-input/NumberInputIntroduction/system/index.tsx.preview @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/docs/data/base/components/number-input/NumberInputIntroduction/tailwind/index.js b/docs/data/base/components/number-input/NumberInputIntroduction/tailwind/index.js index 65dbad2750b421..a80e865c6e3bba 100644 --- a/docs/data/base/components/number-input/NumberInputIntroduction/tailwind/index.js +++ b/docs/data/base/components/number-input/NumberInputIntroduction/tailwind/index.js @@ -3,7 +3,7 @@ import PropTypes from 'prop-types'; import { Unstable_NumberInput as BaseNumberInput } from '@mui/base/Unstable_NumberInput'; import clsx from 'clsx'; -export default function NumberInputIntroduction() { +export default function NumberInputBasic() { const [value, setValue] = React.useState(); return ( (); return ( , + children: , className: 'increment', }, decrementButton: { - children: , + children: , }, }} {...props} @@ -39,6 +39,7 @@ const blue = { 400: '#3399ff', 500: '#007fff', 600: '#0072e5', + 700: '#0059B2', 800: '#004c99', }; @@ -76,8 +77,11 @@ const StyledInput = styled('input')( color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]}; background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'}; border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; - border-radius: 4px; - margin: 0 4px; + box-shadow: 0px 2px 4px ${ + theme.palette.mode === 'dark' ? 'rgba(0,0,0, 0.5)' : 'rgba(0,0,0, 0.05)' + }; + border-radius: 8px; + margin: 0 8px; padding: 10px 12px; outline: 0; min-width: 0; @@ -90,7 +94,7 @@ const StyledInput = styled('input')( &:focus { border-color: ${blue[400]}; - box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[500] : blue[200]}; + box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[700] : blue[200]}; } &:focus-visible { @@ -105,12 +109,13 @@ const StyledButton = styled('button')( font-size: 0.875rem; box-sizing: border-box; line-height: 1.5; - border: 0; + border: 1px solid; border-radius: 999px; - color: ${theme.palette.mode === 'dark' ? blue[300] : blue[600]}; - background: transparent; - width: 40px; - height: 40px; + border-color: ${theme.palette.mode === 'dark' ? grey[800] : grey[200]}; + background: ${theme.palette.mode === 'dark' ? grey[900] : grey[50]}; + color: ${theme.palette.mode === 'dark' ? grey[200] : grey[900]}; + width: 32px; + height: 32px; display: flex; flex-flow: row nowrap; justify-content: center; @@ -120,8 +125,10 @@ const StyledButton = styled('button')( transition-duration: 120ms; &:hover { - background: ${theme.palette.mode === 'dark' ? blue[800] : blue[100]}; cursor: pointer; + background: ${theme.palette.mode === 'dark' ? blue[700] : blue[500]}; + border-color: ${theme.palette.mode === 'dark' ? blue[500] : blue[400]}; + color: ${grey[50]}; } &:focus-visible { diff --git a/docs/data/base/components/number-input/QuantityInput/system/index.tsx b/docs/data/base/components/number-input/QuantityInput.tsx similarity index 79% rename from docs/data/base/components/number-input/QuantityInput/system/index.tsx rename to docs/data/base/components/number-input/QuantityInput.tsx index a03f52a34b4b45..58d7f83e5f6384 100644 --- a/docs/data/base/components/number-input/QuantityInput/system/index.tsx +++ b/docs/data/base/components/number-input/QuantityInput.tsx @@ -21,11 +21,11 @@ const NumberInput = React.forwardRef(function CustomNumberInput( }} slotProps={{ incrementButton: { - children: , + children: , className: 'increment', }, decrementButton: { - children: , + children: , }, }} {...props} @@ -45,6 +45,7 @@ const blue = { 400: '#3399ff', 500: '#007fff', 600: '#0072e5', + 700: '#0059B2', 800: '#004c99', }; @@ -82,8 +83,11 @@ const StyledInput = styled('input')( color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]}; background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'}; border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; - border-radius: 4px; - margin: 0 4px; + box-shadow: 0px 2px 4px ${ + theme.palette.mode === 'dark' ? 'rgba(0,0,0, 0.5)' : 'rgba(0,0,0, 0.05)' + }; + border-radius: 8px; + margin: 0 8px; padding: 10px 12px; outline: 0; min-width: 0; @@ -96,7 +100,7 @@ const StyledInput = styled('input')( &:focus { border-color: ${blue[400]}; - box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[500] : blue[200]}; + box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[700] : blue[200]}; } &:focus-visible { @@ -111,12 +115,13 @@ const StyledButton = styled('button')( font-size: 0.875rem; box-sizing: border-box; line-height: 1.5; - border: 0; + border: 1px solid; border-radius: 999px; - color: ${theme.palette.mode === 'dark' ? blue[300] : blue[600]}; - background: transparent; - width: 40px; - height: 40px; + border-color: ${theme.palette.mode === 'dark' ? grey[800] : grey[200]}; + background: ${theme.palette.mode === 'dark' ? grey[900] : grey[50]}; + color: ${theme.palette.mode === 'dark' ? grey[200] : grey[900]}; + width: 32px; + height: 32px; display: flex; flex-flow: row nowrap; justify-content: center; @@ -126,8 +131,10 @@ const StyledButton = styled('button')( transition-duration: 120ms; &:hover { - background: ${theme.palette.mode === 'dark' ? blue[800] : blue[100]}; cursor: pointer; + background: ${theme.palette.mode === 'dark' ? blue[700] : blue[500]}; + border-color: ${theme.palette.mode === 'dark' ? blue[500] : blue[400]}; + color: ${grey[50]}; } &:focus-visible { diff --git a/docs/data/base/components/number-input/QuantityInput/system/index.tsx.preview b/docs/data/base/components/number-input/QuantityInput.tsx.preview similarity index 100% rename from docs/data/base/components/number-input/QuantityInput/system/index.tsx.preview rename to docs/data/base/components/number-input/QuantityInput.tsx.preview diff --git a/docs/data/base/components/number-input/QuantityInput/css/index.js b/docs/data/base/components/number-input/QuantityInput/css/index.js deleted file mode 100644 index 59b4292e619ed8..00000000000000 --- a/docs/data/base/components/number-input/QuantityInput/css/index.js +++ /dev/null @@ -1,152 +0,0 @@ -import * as React from 'react'; -import { Unstable_NumberInput as BaseNumberInput } from '@mui/base/Unstable_NumberInput'; -import { useTheme } from '@mui/system'; -import RemoveIcon from '@mui/icons-material/Remove'; -import AddIcon from '@mui/icons-material/Add'; - -const NumberInput = React.forwardRef(function CustomNumberInput(props, ref) { - return ( - , - className: 'btn', - }, - incrementButton: { - children: , - className: 'btn increment', - }, - }} - {...props} - ref={ref} - /> - ); -}); - -export default function QuantityInput() { - return ( - - - - - ); -} - -const cyan = { - 50: '#E9F8FC', - 100: '#BDEBF4', - 200: '#99D8E5', - 300: '#66BACC', - 400: '#1F94AD', - 500: '#0D5463', - 600: '#094855', - 700: '#063C47', - 800: '#043039', - 900: '#022127', -}; - -const grey = { - 50: '#F3F6F9', - 100: '#E7EBF0', - 200: '#E0E3E7', - 300: '#CDD2D7', - 400: '#B2BAC2', - 500: '#A0AAB4', - 600: '#6F7E8C', - 700: '#3E5060', - 800: '#2D3843', - 900: '#1A2027', -}; - -function useIsDarkMode() { - const theme = useTheme(); - return theme.palette.mode === 'dark'; -} - -function Styles() { - // Replace this with your app logic for determining dark mode - const isDarkMode = useIsDarkMode(); - - return ( - - ); -} diff --git a/docs/data/base/components/number-input/QuantityInput/css/index.tsx b/docs/data/base/components/number-input/QuantityInput/css/index.tsx deleted file mode 100644 index 094407b1c56b1d..00000000000000 --- a/docs/data/base/components/number-input/QuantityInput/css/index.tsx +++ /dev/null @@ -1,158 +0,0 @@ -import * as React from 'react'; -import { - Unstable_NumberInput as BaseNumberInput, - NumberInputProps, -} from '@mui/base/Unstable_NumberInput'; -import { useTheme } from '@mui/system'; -import RemoveIcon from '@mui/icons-material/Remove'; -import AddIcon from '@mui/icons-material/Add'; - -const NumberInput = React.forwardRef(function CustomNumberInput( - props: NumberInputProps, - ref: React.ForwardedRef, -) { - return ( - , - className: 'btn', - }, - incrementButton: { - children: , - className: 'btn increment', - }, - }} - {...props} - ref={ref} - /> - ); -}); - -export default function QuantityInput() { - return ( - - - - - ); -} - -const cyan = { - 50: '#E9F8FC', - 100: '#BDEBF4', - 200: '#99D8E5', - 300: '#66BACC', - 400: '#1F94AD', - 500: '#0D5463', - 600: '#094855', - 700: '#063C47', - 800: '#043039', - 900: '#022127', -}; - -const grey = { - 50: '#F3F6F9', - 100: '#E7EBF0', - 200: '#E0E3E7', - 300: '#CDD2D7', - 400: '#B2BAC2', - 500: '#A0AAB4', - 600: '#6F7E8C', - 700: '#3E5060', - 800: '#2D3843', - 900: '#1A2027', -}; - -function useIsDarkMode() { - const theme = useTheme(); - return theme.palette.mode === 'dark'; -} - -function Styles() { - // Replace this with your app logic for determining dark mode - const isDarkMode = useIsDarkMode(); - - return ( - - ); -} diff --git a/docs/data/base/components/number-input/QuantityInput/css/index.tsx.preview b/docs/data/base/components/number-input/QuantityInput/css/index.tsx.preview deleted file mode 100644 index c4344d47ab4639..00000000000000 --- a/docs/data/base/components/number-input/QuantityInput/css/index.tsx.preview +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/docs/data/base/components/number-input/QuantityInput/tailwind/index.js b/docs/data/base/components/number-input/QuantityInput/tailwind/index.js deleted file mode 100644 index 8e55dcd555ffd4..00000000000000 --- a/docs/data/base/components/number-input/QuantityInput/tailwind/index.js +++ /dev/null @@ -1,37 +0,0 @@ -import * as React from 'react'; -import { Unstable_NumberInput as BaseNumberInput } from '@mui/base/Unstable_NumberInput'; -import RemoveIcon from '@mui/icons-material/Remove'; -import AddIcon from '@mui/icons-material/Add'; - -const NumberInput = React.forwardRef(function CustomNumberInput(props, ref) { - return ( - , - className: - 'order-1 text-sm font-sans box-border leading-normal border-0 rounded-full bg-transparent w-10 h-10 flex flex-row flex-nowrap justify-center items-center transition-all duration-[120ms] focus-visible:outline-0 hover:cursor-pointer hover:bg-purple-100 dark:hover:bg-purple-800', - }, - decrementButton: { - children: , - className: - 'text-sm font-sans box-border leading-normal border-0 rounded-full bg-transparent w-10 h-10 flex flex-row flex-nowrap justify-center items-center transition-all duration-[120ms] focus-visible:outline-0 hover:cursor-pointer hover:bg-purple-100 dark:hover:bg-purple-800', - }, - }} - {...props} - ref={ref} - /> - ); -}); - -export default function QuantityInput() { - return ; -} diff --git a/docs/data/base/components/number-input/QuantityInput/tailwind/index.tsx b/docs/data/base/components/number-input/QuantityInput/tailwind/index.tsx deleted file mode 100644 index 09c598c7bf7754..00000000000000 --- a/docs/data/base/components/number-input/QuantityInput/tailwind/index.tsx +++ /dev/null @@ -1,43 +0,0 @@ -import * as React from 'react'; -import { - Unstable_NumberInput as BaseNumberInput, - NumberInputProps, -} from '@mui/base/Unstable_NumberInput'; -import RemoveIcon from '@mui/icons-material/Remove'; -import AddIcon from '@mui/icons-material/Add'; - -const NumberInput = React.forwardRef(function CustomNumberInput( - props: NumberInputProps, - ref: React.ForwardedRef, -) { - return ( - , - className: - 'order-1 text-sm font-sans box-border leading-normal border-0 rounded-full bg-transparent w-10 h-10 flex flex-row flex-nowrap justify-center items-center transition-all duration-[120ms] focus-visible:outline-0 hover:cursor-pointer hover:bg-purple-100 dark:hover:bg-purple-800', - }, - decrementButton: { - children: , - className: - 'text-sm font-sans box-border leading-normal border-0 rounded-full bg-transparent w-10 h-10 flex flex-row flex-nowrap justify-center items-center transition-all duration-[120ms] focus-visible:outline-0 hover:cursor-pointer hover:bg-purple-100 dark:hover:bg-purple-800', - }, - }} - {...props} - ref={ref} - /> - ); -}); - -export default function QuantityInput() { - return ; -} diff --git a/docs/data/base/components/number-input/QuantityInput/tailwind/index.tsx.preview b/docs/data/base/components/number-input/QuantityInput/tailwind/index.tsx.preview deleted file mode 100644 index d2d67aef296ef2..00000000000000 --- a/docs/data/base/components/number-input/QuantityInput/tailwind/index.tsx.preview +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/docs/data/base/components/number-input/UseNumberInput.js b/docs/data/base/components/number-input/UseNumberInput.js index 59a2158dd55279..8253c80274bbc0 100644 --- a/docs/data/base/components/number-input/UseNumberInput.js +++ b/docs/data/base/components/number-input/UseNumberInput.js @@ -20,32 +20,10 @@ const CustomNumberInput = React.forwardRef(function CustomNumberInput(props, ref return ( - - - - + ▴ - - - - + ▾ @@ -60,10 +38,12 @@ export default function UseNumberInput() { const blue = { 100: '#DAECFF', - 200: '#b6daff', + 200: '#B6DAFF', 400: '#3399FF', 500: '#007FFF', 600: '#0072E5', + 700: '#0059B2', + 900: '#003A75', }; const grey = { @@ -81,90 +61,109 @@ const grey = { const StyledInputRoot = styled('div')( ({ theme }) => ` - font-family: IBM Plex Sans, sans-serif; - font-size: 0.875rem; - font-weight: 400; - line-height: 1.5; - - display: grid; - grid-template-columns: 24px 1fr; - grid-template-rows: 1fr 1fr; - column-gap: 8px; - padding: 6px; - - border-radius: 6px; - border-style: solid; - border-width: 1px; - - color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]}; - background: ${theme.palette.mode === 'dark' ? grey[900] : grey[50]}; - - border-color: ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; - box-shadow: 0px 2px 2px ${theme.palette.mode === 'dark' ? grey[900] : grey[50]}; + font-family: IBM Plex Sans, sans-serif; + font-weight: 400; + border-radius: 8px; + color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]}; + background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'}; + border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; + box-shadow: 0px 2px 4px ${ + theme.palette.mode === 'dark' ? 'rgba(0,0,0, 0.5)' : 'rgba(0,0,0, 0.05)' + }; + display: grid; + grid-template-columns: 1fr 19px; + grid-template-rows: 1fr 1fr; + overflow: hidden; + column-gap: 8px; + padding: 4px; &.focused { border-color: ${blue[400]}; - box-shadow: - inset 0 0 0 1px ${blue[400]}, - 0px 2px 2px ${theme.palette.mode === 'dark' ? grey[900] : grey[50]}; + box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[700] : blue[200]}; & button:hover { background: ${blue[400]}; } + // firefox + &:focus-visible { + outline: 0; } `, ); -const StyledInputElement = styled('input')` - grid-column: 2/3; +const StyledInputElement = styled('input')( + ({ theme }) => ` + font-size: 0.875rem; + font-family: inherit; + font-weight: 400; + line-height: 1.5; + grid-column: 1/2; grid-row: 1/3; - background: none; - border: 0; + color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]}; + background: inherit; + border: none; + border-radius: inherit; + padding: 8px 12px; outline: 0; - padding: 0; -`; +`, +); const StyledStepperButton = styled('button')( ({ theme }) => ` - width: 1.5rem; - height: 1rem; - display: flex; - flex-flow: row nowrap; - justify-content: center; - align-items: center; - font-size: 0.875rem; - box-sizing: border-box; - border: 0; - padding: 0; - - & > svg { - transform: scale(0.8); - } - - &.increment, - &.decrement { - &:hover { - cursor: pointer; - background: ${blue[400]}; - color: ${grey[50]}; - } - - background: ${theme.palette.mode === 'dark' ? grey[600] : grey[200]}; - color: ${theme.palette.mode === 'dark' ? grey[200] : grey[900]}; - } + display: flex; + flex-flow: row nowrap; + justify-content: center; + align-items: center; + appearance: none; + padding: 0; + width: 19px; + height: 19px; + font-family: system-ui, sans-serif; + font-size: 0.875rem; + line-height: 1; + box-sizing: border-box; + background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'}; + border: 0; + color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]}; + transition-property: all; + transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); + transition-duration: 120ms; &.increment { - grid-column: 1/2; + grid-column: 2/3; grid-row: 1/2; border-top-left-radius: 4px; border-top-right-radius: 4px; + border: 1px solid; + border-bottom: 0; + border-color: ${theme.palette.mode === 'dark' ? grey[800] : grey[200]}; + background: ${theme.palette.mode === 'dark' ? grey[900] : grey[50]}; + color: ${theme.palette.mode === 'dark' ? grey[200] : grey[900]}; + + &:hover { + cursor: pointer; + color: #FFF; + background: ${theme.palette.mode === 'dark' ? blue[600] : blue[500]}; + border-color: ${theme.palette.mode === 'dark' ? blue[400] : blue[600]}; + } } &.decrement { - grid-column: 1/2; + grid-column: 2/3; grid-row: 2/3; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; - } + border: 1px solid; + border-color: ${theme.palette.mode === 'dark' ? grey[800] : grey[200]}; + background: ${theme.palette.mode === 'dark' ? grey[900] : grey[50]}; + color: ${theme.palette.mode === 'dark' ? grey[200] : grey[900]}; + + &:hover { + cursor: pointer; + color: #FFF; + background: ${theme.palette.mode === 'dark' ? blue[600] : blue[500]}; + border-color: ${theme.palette.mode === 'dark' ? blue[400] : blue[600]}; + } + } `, ); diff --git a/docs/data/base/components/number-input/UseNumberInput.tsx b/docs/data/base/components/number-input/UseNumberInput.tsx index 3a7b1b6311e4af..fab7acfc3074bb 100644 --- a/docs/data/base/components/number-input/UseNumberInput.tsx +++ b/docs/data/base/components/number-input/UseNumberInput.tsx @@ -26,32 +26,10 @@ const CustomNumberInput = React.forwardRef(function CustomNumberInput( return ( - - - - + ▴ - - - - + ▾ @@ -66,10 +44,12 @@ export default function UseNumberInput() { const blue = { 100: '#DAECFF', - 200: '#b6daff', + 200: '#B6DAFF', 400: '#3399FF', 500: '#007FFF', 600: '#0072E5', + 700: '#0059B2', + 900: '#003A75', }; const grey = { @@ -87,90 +67,109 @@ const grey = { const StyledInputRoot: React.ElementType = styled('div')( ({ theme }) => ` - font-family: IBM Plex Sans, sans-serif; - font-size: 0.875rem; - font-weight: 400; - line-height: 1.5; - - display: grid; - grid-template-columns: 24px 1fr; - grid-template-rows: 1fr 1fr; - column-gap: 8px; - padding: 6px; - - border-radius: 6px; - border-style: solid; - border-width: 1px; - - color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]}; - background: ${theme.palette.mode === 'dark' ? grey[900] : grey[50]}; - - border-color: ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; - box-shadow: 0px 2px 2px ${theme.palette.mode === 'dark' ? grey[900] : grey[50]}; + font-family: IBM Plex Sans, sans-serif; + font-weight: 400; + border-radius: 8px; + color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]}; + background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'}; + border: 1px solid ${theme.palette.mode === 'dark' ? grey[700] : grey[200]}; + box-shadow: 0px 2px 4px ${ + theme.palette.mode === 'dark' ? 'rgba(0,0,0, 0.5)' : 'rgba(0,0,0, 0.05)' + }; + display: grid; + grid-template-columns: 1fr 19px; + grid-template-rows: 1fr 1fr; + overflow: hidden; + column-gap: 8px; + padding: 4px; &.focused { border-color: ${blue[400]}; - box-shadow: - inset 0 0 0 1px ${blue[400]}, - 0px 2px 2px ${theme.palette.mode === 'dark' ? grey[900] : grey[50]}; + box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[700] : blue[200]}; & button:hover { background: ${blue[400]}; } + // firefox + &:focus-visible { + outline: 0; } `, ); -const StyledInputElement = styled('input')` - grid-column: 2/3; +const StyledInputElement = styled('input')( + ({ theme }) => ` + font-size: 0.875rem; + font-family: inherit; + font-weight: 400; + line-height: 1.5; + grid-column: 1/2; grid-row: 1/3; - background: none; - border: 0; + color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]}; + background: inherit; + border: none; + border-radius: inherit; + padding: 8px 12px; outline: 0; - padding: 0; -`; +`, +); const StyledStepperButton = styled('button')( ({ theme }) => ` - width: 1.5rem; - height: 1rem; - display: flex; - flex-flow: row nowrap; - justify-content: center; - align-items: center; - font-size: 0.875rem; - box-sizing: border-box; - border: 0; - padding: 0; - - & > svg { - transform: scale(0.8); - } - - &.increment, - &.decrement { - &:hover { - cursor: pointer; - background: ${blue[400]}; - color: ${grey[50]}; - } - - background: ${theme.palette.mode === 'dark' ? grey[600] : grey[200]}; - color: ${theme.palette.mode === 'dark' ? grey[200] : grey[900]}; - } + display: flex; + flex-flow: row nowrap; + justify-content: center; + align-items: center; + appearance: none; + padding: 0; + width: 19px; + height: 19px; + font-family: system-ui, sans-serif; + font-size: 0.875rem; + line-height: 1; + box-sizing: border-box; + background: ${theme.palette.mode === 'dark' ? grey[900] : '#fff'}; + border: 0; + color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]}; + transition-property: all; + transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); + transition-duration: 120ms; &.increment { - grid-column: 1/2; + grid-column: 2/3; grid-row: 1/2; border-top-left-radius: 4px; border-top-right-radius: 4px; + border: 1px solid; + border-bottom: 0; + border-color: ${theme.palette.mode === 'dark' ? grey[800] : grey[200]}; + background: ${theme.palette.mode === 'dark' ? grey[900] : grey[50]}; + color: ${theme.palette.mode === 'dark' ? grey[200] : grey[900]}; + + &:hover { + cursor: pointer; + color: #FFF; + background: ${theme.palette.mode === 'dark' ? blue[600] : blue[500]}; + border-color: ${theme.palette.mode === 'dark' ? blue[400] : blue[600]}; + } } &.decrement { - grid-column: 1/2; + grid-column: 2/3; grid-row: 2/3; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; - } + border: 1px solid; + border-color: ${theme.palette.mode === 'dark' ? grey[800] : grey[200]}; + background: ${theme.palette.mode === 'dark' ? grey[900] : grey[50]}; + color: ${theme.palette.mode === 'dark' ? grey[200] : grey[900]}; + + &:hover { + cursor: pointer; + color: #FFF; + background: ${theme.palette.mode === 'dark' ? blue[600] : blue[500]}; + border-color: ${theme.palette.mode === 'dark' ? blue[400] : blue[600]}; + } + } `, ); diff --git a/docs/data/base/components/number-input/UseNumberInputCompact/system/index.js b/docs/data/base/components/number-input/UseNumberInputCompact.js similarity index 68% rename from docs/data/base/components/number-input/UseNumberInputCompact/system/index.js rename to docs/data/base/components/number-input/UseNumberInputCompact.js index dad7fbdb51aa1e..4cbabce3f89da2 100644 --- a/docs/data/base/components/number-input/UseNumberInputCompact/system/index.js +++ b/docs/data/base/components/number-input/UseNumberInputCompact.js @@ -2,6 +2,8 @@ import * as React from 'react'; import { unstable_useNumberInput as useNumberInput } from '@mui/base/unstable_useNumberInput'; import { styled } from '@mui/system'; import { unstable_useForkRef as useForkRef } from '@mui/utils'; +import ArrowDropUpRoundedIcon from '@mui/icons-material/ArrowDropUpRounded'; +import ArrowDropDownRoundedIcon from '@mui/icons-material/ArrowDropDownRounded'; const CompactNumberInput = React.forwardRef(function CompactNumberInput(props, ref) { const { @@ -17,33 +19,11 @@ const CompactNumberInput = React.forwardRef(function CompactNumberInput(props, r return ( - - - - - - - - - - + + + + @@ -62,7 +42,7 @@ export default function UseNumberInputCompact() { value={value} onChange={(event, val) => setValue(val)} /> -
Current value: {value ?? ' '}
+
Current value: {value ?? ' '}
); } @@ -73,6 +53,7 @@ const blue = { 400: '#3399FF', 500: '#007FFF', 600: '#0072E5', + 700: '#0059B2', }; const grey = { @@ -91,23 +72,21 @@ const grey = { const StyledInputRoot = styled('div')( ({ theme }) => ` display: grid; - grid-template-columns: 2.5rem; + grid-template-columns: 2rem; grid-template-rows: 2rem 2rem; grid-template-areas: "increment" "decrement"; row-gap: 1px; - border-radius: 0.5rem; + overflow: auto; + border-radius: 8px; border-style: solid; border-width: 1px; color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]}; - background: ${theme.palette.mode === 'dark' ? grey[800] : grey[200]}; border-color: ${theme.palette.mode === 'dark' ? grey[800] : grey[200]}; - overflow: auto; - - &:hover { - border-color: ${blue[500]}; - } + box-shadow: 0px 2px 4px ${ + theme.palette.mode === 'dark' ? 'rgba(0,0,0, 0.5)' : 'rgba(0,0,0, 0.05)' + }; `, ); @@ -122,7 +101,6 @@ const StyledStepperButton = styled('button')( flex-flow: nowrap; justify-content: center; align-items: center; - font-size: 0.875rem; box-sizing: border-box; border: 0; @@ -132,26 +110,21 @@ const StyledStepperButton = styled('button')( &:hover { cursor: pointer; - background: ${blue[500]}; + background: ${theme.palette.mode === 'dark' ? blue[700] : blue[500]}; color: ${grey[50]}; } &:focus-visible { outline: 0; - background: ${blue[500]}; - color: ${theme.palette.mode === 'dark' ? grey[300] : grey[50]}; + box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[700] : blue[200]}; } &.increment { grid-area: increment; - border-top-left-radius: 0.35rem; - border-top-right-radius: 0.35rem; } &.decrement { grid-area: decrement; - border-bottom-left-radius: 0.35rem; - border-bottom-right-radius: 0.35rem; } `, ); @@ -160,5 +133,9 @@ const Layout = styled('div')` display: flex; flex-flow: row nowrap; align-items: center; - column-gap: 2rem; + column-gap: 1rem; +`; + +const Pre = styled('pre')` + font-size: 0.75rem; `; diff --git a/docs/data/base/components/number-input/UseNumberInputCompact/system/index.tsx b/docs/data/base/components/number-input/UseNumberInputCompact.tsx similarity index 70% rename from docs/data/base/components/number-input/UseNumberInputCompact/system/index.tsx rename to docs/data/base/components/number-input/UseNumberInputCompact.tsx index c34dda26ac3e64..d88bf2607e6100 100644 --- a/docs/data/base/components/number-input/UseNumberInputCompact/system/index.tsx +++ b/docs/data/base/components/number-input/UseNumberInputCompact.tsx @@ -5,6 +5,8 @@ import { } from '@mui/base/unstable_useNumberInput'; import { styled } from '@mui/system'; import { unstable_useForkRef as useForkRef } from '@mui/utils'; +import ArrowDropUpRoundedIcon from '@mui/icons-material/ArrowDropUpRounded'; +import ArrowDropDownRoundedIcon from '@mui/icons-material/ArrowDropDownRounded'; const CompactNumberInput = React.forwardRef(function CompactNumberInput( props: Omit, 'onChange'> & @@ -24,33 +26,11 @@ const CompactNumberInput = React.forwardRef(function CompactNumberInput( return ( - - - - - - - - - - + + + + @@ -70,7 +50,7 @@ export default function UseNumberInputCompact() { onChange={(event, val) => setValue(val)} /> -
Current value: {value ?? ' '}
+
Current value: {value ?? ' '}
); } @@ -81,6 +61,7 @@ const blue = { 400: '#3399FF', 500: '#007FFF', 600: '#0072E5', + 700: '#0059B2', }; const grey = { @@ -99,23 +80,21 @@ const grey = { const StyledInputRoot = styled('div')( ({ theme }) => ` display: grid; - grid-template-columns: 2.5rem; + grid-template-columns: 2rem; grid-template-rows: 2rem 2rem; grid-template-areas: "increment" "decrement"; row-gap: 1px; - border-radius: 0.5rem; + overflow: auto; + border-radius: 8px; border-style: solid; border-width: 1px; color: ${theme.palette.mode === 'dark' ? grey[300] : grey[900]}; - background: ${theme.palette.mode === 'dark' ? grey[800] : grey[200]}; border-color: ${theme.palette.mode === 'dark' ? grey[800] : grey[200]}; - overflow: auto; - - &:hover { - border-color: ${blue[500]}; - } + box-shadow: 0px 2px 4px ${ + theme.palette.mode === 'dark' ? 'rgba(0,0,0, 0.5)' : 'rgba(0,0,0, 0.05)' + }; `, ); @@ -130,7 +109,6 @@ const StyledStepperButton = styled('button')( flex-flow: nowrap; justify-content: center; align-items: center; - font-size: 0.875rem; box-sizing: border-box; border: 0; @@ -140,26 +118,21 @@ const StyledStepperButton = styled('button')( &:hover { cursor: pointer; - background: ${blue[500]}; + background: ${theme.palette.mode === 'dark' ? blue[700] : blue[500]}; color: ${grey[50]}; } &:focus-visible { outline: 0; - background: ${blue[500]}; - color: ${theme.palette.mode === 'dark' ? grey[300] : grey[50]}; + box-shadow: 0 0 0 3px ${theme.palette.mode === 'dark' ? blue[700] : blue[200]}; } &.increment { grid-area: increment; - border-top-left-radius: 0.35rem; - border-top-right-radius: 0.35rem; } &.decrement { grid-area: decrement; - border-bottom-left-radius: 0.35rem; - border-bottom-right-radius: 0.35rem; } `, ); @@ -168,5 +141,9 @@ const Layout = styled('div')` display: flex; flex-flow: row nowrap; align-items: center; - column-gap: 2rem; + column-gap: 1rem; +`; + +const Pre = styled('pre')` + font-size: 0.75rem; `; diff --git a/docs/data/base/components/number-input/UseNumberInputCompact/system/index.tsx.preview b/docs/data/base/components/number-input/UseNumberInputCompact.tsx.preview similarity index 81% rename from docs/data/base/components/number-input/UseNumberInputCompact/system/index.tsx.preview rename to docs/data/base/components/number-input/UseNumberInputCompact.tsx.preview index bc55f0dc37f866..8fd4f5a62fd3eb 100644 --- a/docs/data/base/components/number-input/UseNumberInputCompact/system/index.tsx.preview +++ b/docs/data/base/components/number-input/UseNumberInputCompact.tsx.preview @@ -7,5 +7,5 @@ onChange={(event, val) => setValue(val)} /> -
Current value: {value ?? ' '}
+
Current value: {value ?? ' '}
\ No newline at end of file diff --git a/docs/data/base/components/number-input/UseNumberInputCompact/css/index.js b/docs/data/base/components/number-input/UseNumberInputCompact/css/index.js deleted file mode 100644 index db9839f26f0646..00000000000000 --- a/docs/data/base/components/number-input/UseNumberInputCompact/css/index.js +++ /dev/null @@ -1,183 +0,0 @@ -import * as React from 'react'; -import { unstable_useNumberInput as useNumberInput } from '@mui/base/unstable_useNumberInput'; -import { useTheme } from '@mui/system'; -import { unstable_useForkRef as useForkRef } from '@mui/utils'; - -const CompactNumberInput = React.forwardRef(function CompactNumberInput(props, ref) { - const { - getRootProps, - getInputProps, - getIncrementButtonProps, - getDecrementButtonProps, - } = useNumberInput(props); - - const inputProps = getInputProps(); - - inputProps.ref = useForkRef(inputProps.ref, ref); - - return ( -
- - - -
- ); -}); - -export default function UseNumberInputCompact() { - const [value, setValue] = React.useState(); - - return ( -
- setValue(val)} - className="my-input" - /> -
Current value: {value ?? ' '}
- - -
- ); -} - -const cyan = { - 50: '#E9F8FC', - 100: '#BDEBF4', - 200: '#99D8E5', - 300: '#66BACC', - 400: '#1F94AD', - 500: '#0D5463', - 600: '#094855', - 700: '#063C47', - 800: '#043039', - 900: '#022127', -}; - -const grey = { - 50: '#F3F6F9', - 100: '#E7EBF0', - 200: '#E0E3E7', - 300: '#CDD2D7', - 400: '#B2BAC2', - 500: '#A0AAB4', - 600: '#6F7E8C', - 700: '#3E5060', - 800: '#2D3843', - 900: '#1A2027', -}; - -function useIsDarkMode() { - const theme = useTheme(); - return theme.palette.mode === 'dark'; -} - -function Styles() { - // Replace this with your app logic for determining dark mode - const isDarkMode = useIsDarkMode(); - - return ( - - ); -} diff --git a/docs/data/base/components/number-input/UseNumberInputCompact/css/index.tsx b/docs/data/base/components/number-input/UseNumberInputCompact/css/index.tsx deleted file mode 100644 index 70e06e9d560090..00000000000000 --- a/docs/data/base/components/number-input/UseNumberInputCompact/css/index.tsx +++ /dev/null @@ -1,191 +0,0 @@ -import * as React from 'react'; -import { - unstable_useNumberInput as useNumberInput, - UseNumberInputParameters, -} from '@mui/base/unstable_useNumberInput'; -import { useTheme } from '@mui/system'; -import { unstable_useForkRef as useForkRef } from '@mui/utils'; - -const CompactNumberInput = React.forwardRef(function CompactNumberInput( - props: Omit, 'onChange'> & - UseNumberInputParameters, - ref: React.ForwardedRef, -) { - const { - getRootProps, - getInputProps, - getIncrementButtonProps, - getDecrementButtonProps, - } = useNumberInput(props); - - const inputProps = getInputProps(); - - inputProps.ref = useForkRef(inputProps.ref, ref); - - return ( -
- - - -
- ); -}); - -export default function UseNumberInputCompact() { - const [value, setValue] = React.useState(); - - return ( -
- setValue(val)} - className="my-input" - /> - -
Current value: {value ?? ' '}
- - -
- ); -} - -const cyan = { - 50: '#E9F8FC', - 100: '#BDEBF4', - 200: '#99D8E5', - 300: '#66BACC', - 400: '#1F94AD', - 500: '#0D5463', - 600: '#094855', - 700: '#063C47', - 800: '#043039', - 900: '#022127', -}; - -const grey = { - 50: '#F3F6F9', - 100: '#E7EBF0', - 200: '#E0E3E7', - 300: '#CDD2D7', - 400: '#B2BAC2', - 500: '#A0AAB4', - 600: '#6F7E8C', - 700: '#3E5060', - 800: '#2D3843', - 900: '#1A2027', -}; - -function useIsDarkMode() { - const theme = useTheme(); - return theme.palette.mode === 'dark'; -} - -function Styles() { - // Replace this with your app logic for determining dark mode - const isDarkMode = useIsDarkMode(); - - return ( - - ); -} diff --git a/docs/data/base/components/number-input/UseNumberInputCompact/css/index.tsx.preview b/docs/data/base/components/number-input/UseNumberInputCompact/css/index.tsx.preview deleted file mode 100644 index e586cf96949b12..00000000000000 --- a/docs/data/base/components/number-input/UseNumberInputCompact/css/index.tsx.preview +++ /dev/null @@ -1,12 +0,0 @@ - setValue(val)} - className="my-input" -/> - -
Current value: {value ?? ' '}
- - \ No newline at end of file diff --git a/docs/data/base/components/number-input/UseNumberInputCompact/tailwind/index.js b/docs/data/base/components/number-input/UseNumberInputCompact/tailwind/index.js deleted file mode 100644 index 84ae15110033aa..00000000000000 --- a/docs/data/base/components/number-input/UseNumberInputCompact/tailwind/index.js +++ /dev/null @@ -1,88 +0,0 @@ -import * as React from 'react'; -import PropTypes from 'prop-types'; -import { unstable_useNumberInput as useNumberInput } from '@mui/base/unstable_useNumberInput'; -import { unstable_useForkRef as useForkRef } from '@mui/utils'; -import clsx from 'clsx'; - -const CompactNumberInput = React.forwardRef(function CompactNumberInput(props, ref) { - const { className, ...rest } = props; - const { - getRootProps, - getInputProps, - getIncrementButtonProps, - getDecrementButtonProps, - } = useNumberInput(rest); - - const inputProps = getInputProps(); - - inputProps.ref = useForkRef(inputProps.ref, ref); - - return ( -
- - - -
- ); -}); - -CompactNumberInput.propTypes = { - className: PropTypes.string, -}; - -export default function UseNumberInputCompact() { - const [value, setValue] = React.useState(); - - return ( -
- setValue(val)} - /> -
Current value: {value ?? ' '}
-
- ); -} diff --git a/docs/data/base/components/number-input/UseNumberInputCompact/tailwind/index.tsx b/docs/data/base/components/number-input/UseNumberInputCompact/tailwind/index.tsx deleted file mode 100644 index ff2373d6132a99..00000000000000 --- a/docs/data/base/components/number-input/UseNumberInputCompact/tailwind/index.tsx +++ /dev/null @@ -1,91 +0,0 @@ -import * as React from 'react'; -import { - unstable_useNumberInput as useNumberInput, - UseNumberInputParameters, -} from '@mui/base/unstable_useNumberInput'; -import { unstable_useForkRef as useForkRef } from '@mui/utils'; -import clsx from 'clsx'; - -const CompactNumberInput = React.forwardRef(function CompactNumberInput( - props: Omit, 'onChange'> & - UseNumberInputParameters, - ref: React.ForwardedRef, -) { - const { className, ...rest } = props; - const { - getRootProps, - getInputProps, - getIncrementButtonProps, - getDecrementButtonProps, - } = useNumberInput(rest); - - const inputProps = getInputProps(); - - inputProps.ref = useForkRef(inputProps.ref, ref); - - return ( -
- - - -
- ); -}); - -export default function UseNumberInputCompact() { - const [value, setValue] = React.useState(); - - return ( -
- setValue(val)} - /> - -
Current value: {value ?? ' '}
-
- ); -} diff --git a/docs/data/base/components/number-input/UseNumberInputCompact/tailwind/index.tsx.preview b/docs/data/base/components/number-input/UseNumberInputCompact/tailwind/index.tsx.preview deleted file mode 100644 index 4dcd66b1bc1aac..00000000000000 --- a/docs/data/base/components/number-input/UseNumberInputCompact/tailwind/index.tsx.preview +++ /dev/null @@ -1,9 +0,0 @@ - setValue(val)} -/> - -
Current value: {value ?? ' '}
\ No newline at end of file diff --git a/docs/data/base/components/number-input/number-input.md b/docs/data/base/components/number-input/number-input.md index 0e571953395493..72fc33be492381 100644 --- a/docs/data/base/components/number-input/number-input.md +++ b/docs/data/base/components/number-input/number-input.md @@ -116,7 +116,7 @@ Here's an example of a custom component built using the `useNumberInput` hook wi Here's an example of a "compact" number input component using the hook that only consists of the stepper buttons. In this demo, `onChange` is used to write the latest value of the component to a state variable. -{{"demo": "UseNumberInputCompact", "defaultCodeOpen": false}} +{{"demo": "UseNumberInputCompact.js", "defaultCodeOpen": false}} ## Customization @@ -139,7 +139,7 @@ If you only define one or the other, the opposite end of the range will be open- The demo below shows a Number Input with a an accepted range of 1 to 99: -{{"demo": "QuantityInput", "defaultCodeOpen": false}} +{{"demo": "QuantityInput.js", "defaultCodeOpen": false}} ### Incremental steps diff --git a/docs/data/base/components/popper/UnstyledPopperBasic/css/index.js b/docs/data/base/components/popper/UnstyledPopperBasic/css/index.js index 707d9c7aa48701..e8c1dc8bf8f852 100644 --- a/docs/data/base/components/popper/UnstyledPopperBasic/css/index.js +++ b/docs/data/base/components/popper/UnstyledPopperBasic/css/index.js @@ -68,37 +68,44 @@ function Styles() {