Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: [M3-9404] - 4.0.0 Design Tokens - New Spacing & Badge Tokens #11757

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Tech Stories
---

4.0.0 Design Tokens - New Spacing & Badge Tokens ([#11757](https://github.com/linode/manager/pull/11757))
2 changes: 1 addition & 1 deletion packages/manager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"@fontsource/nunito-sans": "^5.1.1",
"@hookform/resolvers": "3.9.1",
"@linode/api-v4": "workspace:*",
"@linode/design-language-system": "^3.0.0",
"@linode/design-language-system": "^4.0.0",
"@linode/search": "workspace:*",
"@linode/ui": "workspace:*",
"@linode/validation": "workspace:*",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ export const StyledAccordion = styled(Accordion, {
fontWeight: theme.tokens.font.FontWeight.Extrabold,
letterSpacing: theme.tokens.typography.Heading.OverlineLetterSpacing,
lineHeight: theme.tokens.font.LineHeight.Xxxs,
paddingLeft: theme.tokens.spacing[50],
paddingRight: theme.tokens.spacing[50],
paddingLeft: theme.tokens.spacing.S12,
paddingRight: theme.tokens.spacing.S12,
textTransform: 'uppercase',
transition: theme.transitions.create(['opacity']),
...(props.isCollapsed && {
Expand Down Expand Up @@ -130,16 +130,16 @@ export const StyledAccordion = styled(Accordion, {
backgroundColor: theme.tokens.color.Neutrals[90],
maxHeight: '48px',
minHeight: '48px',
paddingLeft: theme.tokens.spacing[50],
paddingRight: theme.tokens.spacing[40],
paddingLeft: theme.tokens.spacing.S12,
paddingRight: theme.tokens.spacing.S8,
svg: {
fill: theme.tokens.color.Neutrals['White'],
stroke: 'transparent',
},
},
// Spacing between the accordion and the next accordion
'.MuiCollapse-entered .MuiAccordionDetails-root': {
marginBottom: theme.tokens.spacing[40],
marginBottom: theme.tokens.spacing.S8,
},
backgroundColor: theme.tokens.color.Neutrals[90],
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,5 @@ const StyledIconButton = styled(IconButton, {
transition: theme.transitions.create(['color']),
width: '16px',
},
padding: theme.tokens.spacing[60],
padding: theme.tokens.spacing.S16,
}));
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ export const TypeToConfirm = (props: TypeToConfirmProps) => {
{isCloseAccount && (
<FormGroup
sx={(theme) => ({
marginTop: theme.tokens.spacing[20],
paddingLeft: theme.tokens.spacing[10],
marginTop: theme.tokens.spacing.S4,
paddingLeft: theme.tokens.spacing.S2,
})}
>
<FormControlLabel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ const CloseAccountDialog = ({ closeDialog, open }: Props) => {
}}
typographyStyleSx={(theme) => ({
borderTop: `1px solid ${theme.tokens.border.Normal}`,
marginBottom: theme.tokens.spacing[40],
marginTop: theme.tokens.spacing[60],
paddingTop: theme.tokens.spacing[60],
marginBottom: theme.tokens.spacing.S8,
marginTop: theme.tokens.spacing.S16,
paddingTop: theme.tokens.spacing.S16,
width: '100%',
})}
expand
Expand Down Expand Up @@ -117,7 +117,7 @@ const CloseAccountDialog = ({ closeDialog, open }: Props) => {
</StyledNoticeWrapper>
<Typography
sx={(theme) => ({
marginTop: theme.tokens.spacing[60],
marginTop: theme.tokens.spacing.S16,
order: 1,
})}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -454,15 +454,15 @@ const UpdateContactInformationForm = ({ focusEmail, onClose }: Props) => {
sx={{
alignItems: 'flex-start',
display: 'flex',
marginTop: (theme) => theme.tokens.spacing[60],
marginTop: (theme) => theme.tokens.spacing.S16,
}}
>
<Checkbox
onChange={() =>
setBillingAgreementChecked(!billingAgreementChecked)
}
sx={(theme) => ({
marginRight: theme.tokens.spacing[40],
marginRight: theme.tokens.spacing.S8,
padding: 0,
})}
checked={billingAgreementChecked}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const InternalAdminBanner = (props: InternalAdminBannerProps) => {
return (
<Box
bgcolor={(theme) => theme.tokens.color.Pink[40]}
padding={(theme) => theme.tokens.spacing[60]}
padding={(theme) => theme.tokens.spacing.S16}
textAlign="center"
>
<Typography
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,19 +186,19 @@ const StyledChip = styled(Chip, {
})<{ adjustBorderRadius: boolean }>(({ theme, ...props }) => ({
'& .MuiChip-icon': {
margin: 0,
marginLeft: theme.tokens.spacing[10],
marginLeft: theme.tokens.spacing.S2,
},
'& .MuiChip-label': {
padding: 0,
},
backgroundColor: theme.tokens.header.Badge.Background,
borderRadius: props.adjustBorderRadius ? theme.tokens.spacing[50] : '50%',
borderRadius: props.adjustBorderRadius ? theme.tokens.spacing.S12 : '50%',
color: theme.tokens.header.Badge.Text,
flexDirection: 'row-reverse',
font: theme.tokens.typography.Label.Bold.Xs,
justifyContent: 'center',
left: 20,
padding: `${theme.tokens.spacing[20]} ${theme.tokens.spacing[30]}`,
padding: `${theme.tokens.spacing.S4} ${theme.tokens.spacing.S6}`,
position: 'absolute',
top: '-3px',
}));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ const SearchBarComponent = (props: SearchProps) => {
top: '50%',
transform: 'translate(-50%, -50%)',
visibility: searchActive ? 'visible' : 'hidden',
width: `calc(100% - ${theme.tokens.spacing[80]})`,
width: `calc(100% - ${theme.tokens.spacing.S32})`,
zIndex: searchActive ? 3 : 0,
},
}}
Expand Down Expand Up @@ -433,7 +433,7 @@ const SearchBarComponent = (props: SearchProps) => {
}}
sx={(theme) => ({
'& .MuiInput-root .MuiInput-input': {
padding: `${theme.tokens.spacing[30]} ${theme.tokens.spacing[40]}`,
padding: `${theme.tokens.spacing.S6} ${theme.tokens.spacing.S8}`,
},
'&.MuiAutocomplete-root': {
'&.Mui-focused, &.Mui-focused:hover': {
Expand All @@ -443,7 +443,7 @@ const SearchBarComponent = (props: SearchProps) => {
borderColor: theme.tokens.header.Search.Border.Hover,
},
'.MuiInput-root': {
paddingRight: theme.tokens.spacing[40],
paddingRight: theme.tokens.spacing.S8,
},
border: `1px solid ${theme.tokens.header.Search.Border.Default}`,
},
Expand Down
24 changes: 12 additions & 12 deletions packages/manager/src/features/TopMenu/TopMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export const TopMenu = React.memo((props: TopMenuProps) => {
<TopMenuTooltip title="Expand side menu">
<IconButton
sx={(theme) => ({
padding: theme.tokens.spacing[60],
padding: theme.tokens.spacing.S16,
})}
aria-label="open menu"
color="inherit"
Expand All @@ -65,13 +65,13 @@ export const TopMenu = React.memo((props: TopMenuProps) => {
)}
<Box
gap={(theme) => ({
md: theme.tokens.spacing[80],
xs: theme.tokens.spacing[50],
md: theme.tokens.spacing.S32,
xs: theme.tokens.spacing.S12,
})}
sx={(theme) => ({
paddingLeft: {
md: 0,
sm: theme.tokens.spacing[60],
sm: theme.tokens.spacing.S16,
},
})}
alignItems="center"
Expand Down Expand Up @@ -104,17 +104,17 @@ export const TopMenu = React.memo((props: TopMenuProps) => {
<Stack
sx={(theme) => ({
gap: {
sm: theme.tokens.spacing[70],
xs: theme.tokens.spacing[40],
sm: theme.tokens.spacing.S24,
xs: theme.tokens.spacing.S8,
},
paddingLeft: {
sm: theme.tokens.spacing[80],
xs: theme.tokens.spacing[60],
sm: theme.tokens.spacing.S32,
xs: theme.tokens.spacing.S16,
},
paddingRight: {
md: 0,
sm: theme.tokens.spacing[60],
xs: theme.tokens.spacing[40],
sm: theme.tokens.spacing.S16,
xs: theme.tokens.spacing.S8,
},
})}
alignItems="center"
Expand All @@ -125,8 +125,8 @@ export const TopMenu = React.memo((props: TopMenuProps) => {
<Box
gap={{
md: 0,
sm: theme.tokens.spacing[60],
xs: theme.tokens.spacing[40],
sm: theme.tokens.spacing.S16,
xs: theme.tokens.spacing.S8,
}}
display="flex"
>
Expand Down
2 changes: 1 addition & 1 deletion packages/manager/src/features/TopMenu/TopMenuTooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ export const topMenuIconButtonSx = (theme: Theme) => ({
color: theme.tokens.header.Icon.Hover,
},
color: theme.tokens.header.Icon.Default,
padding: theme.tokens.spacing[40],
padding: theme.tokens.spacing.S8,
});
4 changes: 2 additions & 2 deletions packages/manager/src/features/TopMenu/UserMenu/UserMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ const StyledUserMenuButton = styled(Button, {
font: theme.tokens.typography.Label.Bold.S,
},
marginLeft: 0,
marginRight: theme.tokens.spacing[40],
marginRight: theme.tokens.spacing.S8,
},
'.MuiStack-root .MuiTypography-root': {
color: open
Expand All @@ -181,6 +181,6 @@ const StyledUserMenuButton = styled(Button, {
},
},
[theme.breakpoints.down('sm')]: {
padding: `${theme.tokens.spacing[30]} ${theme.tokens.spacing[40]}`,
padding: `${theme.tokens.spacing.S6} ${theme.tokens.spacing.S8}`,
},
}));
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ export const UserMenuPopover = (props: UserMenuPopoverProps) => {
slotProps={{
paper: {
sx: (theme) => ({
paddingX: theme.tokens.spacing[70],
paddingY: theme.tokens.spacing[60],
paddingX: theme.tokens.spacing.S24,
paddingY: theme.tokens.spacing.S16,
}),
},
}}
Expand All @@ -174,10 +174,10 @@ export const UserMenuPopover = (props: UserMenuPopoverProps) => {
>
<Stack
data-qa-user-menu
gap={(theme) => theme.tokens.spacing[60]}
gap={(theme) => theme.tokens.spacing.S16}
minWidth={250}
>
<Stack display="flex" gap={(theme) => theme.tokens.spacing[40]}>
<Stack display="flex" gap={(theme) => theme.tokens.spacing.S8}>
{canSwitchBetweenParentOrProxyAccount && (
<Typography>Current account:</Typography>
)}
Expand Down Expand Up @@ -218,8 +218,8 @@ export const UserMenuPopover = (props: UserMenuPopoverProps) => {
<Heading>Account</Heading>
<Divider />
<Stack
gap={(theme) => theme.tokens.spacing[40]}
mt={(theme) => theme.tokens.spacing[40]}
gap={(theme) => theme.tokens.spacing.S8}
mt={(theme) => theme.tokens.spacing.S8}
>
{accountLinks.map((menuLink) =>
menuLink.hide ? null : (
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/ui": Tech Stories
---

4.0.0 Design Tokens - New Spacing & Badge Tokens ([#11757](https://github.com/linode/manager/pull/11757))
2 changes: 1 addition & 1 deletion packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"dependencies": {
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"@linode/design-language-system": "^3.0.0",
"@linode/design-language-system": "^4.0.0",
"@mui/icons-material": "^6.4.5",
"@mui/material": "^6.4.5",
"@mui/utils": "^6.4.3",
Expand Down
28 changes: 14 additions & 14 deletions packages/ui/src/foundations/themes/dark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -424,34 +424,34 @@ export const darkTheme: ThemeOptions = {
color: Button.Primary.Default.Text,
},
colorError: {
backgroundColor: Badge.Negative.Background,
color: Badge.Negative.Text,
backgroundColor: Badge.Negative.Subtle.Background,
color: Badge.Negative.Subtle.Text,
},
colorInfo: {
backgroundColor: Badge.Informative.Background,
color: Badge.Informative.Text,
backgroundColor: Badge.Informative.Subtle.Background,
color: Badge.Informative.Subtle.Text,
},
colorPrimary: {
backgroundColor: Badge.Informative.Background,
color: Badge.Informative.Text,
backgroundColor: Badge.Informative.Subtle.Background,
color: Badge.Informative.Subtle.Text,
},
colorSecondary: {
'&.MuiChip-clickable': {
'&:hover': {
backgroundColor: Badge.Informative.Background,
color: Badge.Informative.Text,
backgroundColor: Badge.Informative.Subtle.Background,
color: Badge.Informative.Subtle.Text,
},
},
backgroundColor: Badge.Informative.Background,
color: Badge.Informative.Text,
backgroundColor: Badge.Informative.Subtle.Background,
color: Badge.Informative.Subtle.Text,
},
colorSuccess: {
backgroundColor: Badge.Positive.Background,
color: Badge.Positive.Text,
backgroundColor: Badge.Positive.Subtle.Background,
color: Badge.Positive.Subtle.Text,
},
colorWarning: {
backgroundColor: Badge.Warning.Background,
color: Badge.Warning.Text,
backgroundColor: Badge.Warning.Subtle.Background,
color: Badge.Warning.Subtle.Text,
},
outlined: {
'& .MuiChip-label': {
Expand Down
Loading