diff --git a/static/app/components/core/alert/alert.chonk.tsx b/static/app/components/core/alert/alert.chonk.tsx index 9e766b40eaadf3..08feb5c1de4753 100644 --- a/static/app/components/core/alert/alert.chonk.tsx +++ b/static/app/components/core/alert/alert.chonk.tsx @@ -137,7 +137,7 @@ export const TrailingItems = chonkStyled('div')` grid-auto-columns: max-content; grid-template-rows: 100%; gap: ${p => p.theme.space.md}; - font-size: ${p => p.theme.fontSize.md}; + font-size: ${p => p.theme.font.size.md}; grid-row: 2; grid-column: 1 / -1; justify-items: start; @@ -159,7 +159,7 @@ export const TrailingItems = chonkStyled('div')` `; export const Message = chonkStyled('div')` - line-height: ${p => p.theme.text.lineHeightBody}; + line-height: ${p => p.theme.font.lineHeight.comfortable}; place-content: center; padding-block: ${p => p.theme.space.xs}; `; diff --git a/static/app/components/core/alert/alert.tsx b/static/app/components/core/alert/alert.tsx index a3ebd87bdbf7ae..f68476656e67b4 100644 --- a/static/app/components/core/alert/alert.tsx +++ b/static/app/components/core/alert/alert.tsx @@ -187,7 +187,7 @@ const AlertPanel = styled('div')` grid-template-columns: ${p => getAlertGridLayout(p)}; gap: ${space(1)}; color: ${p => getAlertColors(p.theme, p.type).color}; - font-size: ${p => p.theme.fontSize.md}; + font-size: ${p => p.theme.font.size.md}; border-radius: ${p => p.theme.borderRadius}; border: 1px solid ${p => getAlertColors(p.theme, p.type).border}; padding: ${space(1.5)} ${space(2)}; @@ -245,7 +245,9 @@ const IconWrapper = withChonk( styled('div')<{type: AlertProps['type']}>` display: flex; align-items: center; - height: calc(${p => p.theme.fontSize.md} * ${p => p.theme.text.lineHeightBody}); + height: calc( + ${p => p.theme.font.size.md} * ${p => p.theme.font.lineHeight.comfortable} + ); `, ChonkAlert.IconWrapper ); @@ -253,14 +255,16 @@ const IconWrapper = withChonk( const Message = withChonk( styled('span')` position: relative; - line-height: ${p => p.theme.text.lineHeightBody}; + line-height: ${p => p.theme.font.lineHeight.comfortable}; `, ChonkAlert.Message ); const TrailingItems = withChonk( styled('div')<{showIcon: boolean}>` - height: calc(${p => p.theme.fontSize.md} * ${p => p.theme.text.lineHeightBody}); + height: calc( + ${p => p.theme.font.size.md} * ${p => p.theme.font.lineHeight.comfortable} + ); display: grid; grid-auto-flow: column; grid-template-rows: 100%; diff --git a/static/app/components/core/badge/badge.chonk.tsx b/static/app/components/core/badge/badge.chonk.tsx index 8379bb295ce8ca..d91f2466baec00 100644 --- a/static/app/components/core/badge/badge.chonk.tsx +++ b/static/app/components/core/badge/badge.chonk.tsx @@ -34,13 +34,13 @@ export function ChonkBadge(props: ChonkBadgeProps) { const StyledChonkBadge = chonkStyled('span')` ${p => ({...makeChonkBadgeTheme(p, p.theme)})}; border-radius: ${p => p.theme.radius.sm}; - font-size: ${p => p.theme.fontSize.sm}; + font-size: ${p => p.theme.font.size.sm}; display: inline-flex; align-items: center; line-height: initial; height: 20px; - font-weight: ${p => p.theme.fontWeight.bold}; + font-weight: ${p => p.theme.font.weight.medium}; padding: ${p => p.theme.space.xs} ${p => p.theme.space.xs}; `; diff --git a/static/app/components/core/badge/badge.tsx b/static/app/components/core/badge/badge.tsx index de8d6733712777..11eee0444816ac 100644 --- a/static/app/components/core/badge/badge.tsx +++ b/static/app/components/core/badge/badge.tsx @@ -77,8 +77,8 @@ const StyledBadge = styled('span')` min-width: 20px; line-height: 20px; border-radius: 20px; - font-weight: ${p => p.theme.fontWeight.normal}; - font-size: ${p => p.theme.fontSize.xs}; + font-weight: ${p => p.theme.font.weight.regular}; + font-size: ${p => p.theme.font.size.xs}; padding: 0 ${space(0.75)}; transition: background ${p => p.theme.motion.snap.fast}; diff --git a/static/app/components/core/badge/tag.chonk.tsx b/static/app/components/core/badge/tag.chonk.tsx index c18e8c4ef2fb3a..e79514d59cd8d7 100644 --- a/static/app/components/core/badge/tag.chonk.tsx +++ b/static/app/components/core/badge/tag.chonk.tsx @@ -30,7 +30,7 @@ export const TagPill = chonkStyled('div')<{ ${p => ({...makeTagPillTheme(p.type, p.theme)})}; height: 20px; - font-size: ${p => p.theme.fontSize.sm}; + font-size: ${p => p.theme.font.size.sm}; display: inline-flex; align-items: center; border-radius: ${p => p.theme.radius.xs}; diff --git a/static/app/components/core/badge/tag.tsx b/static/app/components/core/badge/tag.tsx index 0de690a15525a7..7fe09d092a6add 100644 --- a/static/app/components/core/badge/tag.tsx +++ b/static/app/components/core/badge/tag.tsx @@ -73,7 +73,7 @@ export function Tag({ const TagPill = styled('div')<{ type: NonNullable; }>` - font-size: ${p => p.theme.fontSize.sm}; + font-size: ${p => p.theme.font.size.sm}; background-color: ${p => p.theme.tag[p.type].background}; border: solid 1px ${p => p.theme.tag[p.type].border}; display: inline-flex; diff --git a/static/app/components/core/button/styles.chonk.tsx b/static/app/components/core/button/styles.chonk.tsx index d33a11480af71d..1c8e995bd8bc38 100644 --- a/static/app/components/core/button/styles.chonk.tsx +++ b/static/app/components/core/button/styles.chonk.tsx @@ -67,7 +67,7 @@ export function DO_NOT_USE_getChonkButtonStyles( alignItems: 'center', justifyContent: 'center', - fontWeight: p.theme.fontWeight.bold, + fontWeight: p.theme.font.weight.medium, opacity: p.busy || p.disabled ? 0.6 : undefined, diff --git a/static/app/components/core/button/styles.tsx b/static/app/components/core/button/styles.tsx index d22b5177485ed6..8796fca9e6f5bf 100644 --- a/static/app/components/core/button/styles.tsx +++ b/static/app/components/core/button/styles.tsx @@ -184,7 +184,7 @@ export function DO_NOT_USE_getButtonStyles( display: inline-block; border-radius: ${p.theme.borderRadius}; text-transform: none; - font-weight: ${p.theme.fontWeight.bold}; + font-weight: ${p.theme.font.weight.medium}; cursor: ${p.disabled ? 'not-allowed' : p.busy ? 'wait' : 'pointer'}; opacity: ${(p.busy || p.disabled) && '0.65'}; diff --git a/static/app/components/core/code/codeBlock.tsx b/static/app/components/core/code/codeBlock.tsx index 35dd7272978bc6..9d07d34a3c460b 100644 --- a/static/app/components/core/code/codeBlock.tsx +++ b/static/app/components/core/code/codeBlock.tsx @@ -237,10 +237,10 @@ const Header = styled('div')<{isFloating: boolean}>` display: flex; align-items: center; - font-family: ${p => p.theme.text.familyMono}; - font-size: ${p => p.theme.fontSize.sm}; + font-family: ${p => p.theme.font.family.mono}; + font-size: ${p => p.theme.font.size.sm}; color: var(--prism-base); - font-weight: ${p => p.theme.fontWeight.bold}; + font-weight: ${p => p.theme.font.weight.medium}; z-index: 2; ${p => diff --git a/static/app/components/core/code/inlineCode.tsx b/static/app/components/core/code/inlineCode.tsx index 3a07f7250cd5cc..33c623a1403a1a 100644 --- a/static/app/components/core/code/inlineCode.tsx +++ b/static/app/components/core/code/inlineCode.tsx @@ -8,7 +8,7 @@ export const inlineCodeStyles = (theme: Theme) => css` padding: 0; border: none; - font-family: ${theme.text.familyMono}; + font-family: ${theme.font.family.mono}; /** * adjust height of x character to 57% of bounding box * to match Rubik's x-height (magic number) diff --git a/static/app/components/core/compactSelect/control.tsx b/static/app/components/core/compactSelect/control.tsx index c627e9281f29a6..2619b6694f3197 100644 --- a/static/app/components/core/compactSelect/control.tsx +++ b/static/app/components/core/compactSelect/control.tsx @@ -588,10 +588,10 @@ const MenuHeader = styled('div')<{size: NonNullable}>` box-shadow: none; } - line-height: ${p => p.theme.text.lineHeightBody}; + line-height: ${p => p.theme.font.lineHeight.comfortable}; z-index: 2; - font-size: ${p => (p.size === 'xs' ? p.theme.fontSize.xs : p.theme.fontSize.sm)}; + font-size: ${p => (p.size === 'xs' ? p.theme.font.size.xs : p.theme.font.size.sm)}; color: ${p => p.theme.headingColor}; `; @@ -603,7 +603,7 @@ const MenuHeaderTrailingItems = styled('div')` const MenuTitle = styled('span')` font-size: inherit; /* Inherit font size from MenuHeader */ - font-weight: ${p => p.theme.fontWeight.bold}; + font-weight: ${p => p.theme.font.weight.medium}; white-space: nowrap; margin-right: ${space(2)}; `; @@ -618,7 +618,7 @@ const StyledLoadingIndicator = styled(LoadingIndicator)` const ClearButton = styled(Button)` font-size: inherit; /* Inherit font size from MenuHeader */ - font-weight: ${p => p.theme.fontWeight.normal}; + font-weight: ${p => p.theme.font.weight.regular}; color: ${p => p.theme.subText}; padding: 0 ${space(0.5)}; margin: -${space(0.25)} -${space(0.5)}; diff --git a/static/app/components/core/compactSelect/styles.tsx b/static/app/components/core/compactSelect/styles.tsx index 519e7a56e8d047..e97c96a481ee0c 100644 --- a/static/app/components/core/compactSelect/styles.tsx +++ b/static/app/components/core/compactSelect/styles.tsx @@ -48,8 +48,8 @@ export const ListWrap = styled('ul')` export const ListLabel = styled('p')` display: inline-block; - font-weight: ${p => p.theme.fontWeight.bold}; - font-size: ${p => p.theme.fontSize.xs}; + font-weight: ${p => p.theme.font.weight.medium}; + font-size: ${p => p.theme.font.size.xs}; color: ${p => p.theme.subText}; text-transform: uppercase; white-space: nowrap; @@ -94,8 +94,8 @@ export const SectionHeader = styled('div')` export const SectionTitle = styled('p')` display: inline-block; - font-weight: ${p => p.theme.fontWeight.bold}; - font-size: ${p => p.theme.fontSize.xs}; + font-weight: ${p => p.theme.font.weight.medium}; + font-size: ${p => p.theme.font.size.xs}; color: ${p => p.theme.subText}; text-transform: uppercase; white-space: nowrap; @@ -107,8 +107,8 @@ export const SectionTitle = styled('p')` export const SectionToggleButton = styled(Button)<{visible: boolean}>` padding: 0 ${space(0.5)}; margin: 0 -${space(0.5)} 0 ${space(2)}; - font-weight: ${p => p.theme.fontWeight.normal}; - font-size: ${p => p.theme.fontSize.sm}; + font-weight: ${p => p.theme.font.weight.regular}; + font-size: ${p => p.theme.font.size.sm}; color: ${p => p.theme.subText}; transition: opacity 0.1s; @@ -178,7 +178,7 @@ export const SizeLimitMessage = styled('li')` margin: ${space(0.5)} ${space(1.5)} ${space(0.5)}; padding: ${space(0.75)} ${space(1)} 0; - font-size: ${p => p.theme.fontSize.sm}; + font-size: ${p => p.theme.font.size.sm}; color: ${p => p.theme.subText}; list-style-type: none; white-space: nowrap; diff --git a/static/app/components/core/input/input.chonk.tsx b/static/app/components/core/input/input.chonk.tsx index 2503271cb83a06..6eb83dd82f326e 100644 --- a/static/app/components/core/input/input.chonk.tsx +++ b/static/app/components/core/input/input.chonk.tsx @@ -18,10 +18,10 @@ export const chonkInputStyles = ({ ...debossedBackground(theme), boxShadow, border: `1px solid ${theme.tokens.border.primary}`, - fontWeight: theme.fontWeight.normal, + fontWeight: theme.font.weight.regular, resize: 'vertical', transition: `border ${theme.motion.smooth.fast}, box-shadow ${theme.motion.smooth.fast}`, - ...(monospace ? {fontFamily: theme.text.familyMono} : {}), + ...(monospace ? {fontFamily: theme.font.family.mono} : {}), ...(readOnly ? {cursor: 'default'} : {}), ...theme.form[size], diff --git a/static/app/components/core/input/input.tsx b/static/app/components/core/input/input.tsx index fa6f4e3ce40bbc..6ed2fda9ee28d9 100644 --- a/static/app/components/core/input/input.tsx +++ b/static/app/components/core/input/input.tsx @@ -64,7 +64,7 @@ const legacyInputStyles = (p: InputStylesProps & {theme: Theme}) => css` border 0.1s, box-shadow 0.1s; - ${p.monospace ? `font-family: ${p.theme.text.familyMono};` : ''} + ${p.monospace ? `font-family: ${p.theme.font.family.mono};` : ''} ${p.readOnly ? 'cursor: default;' : ''} ${p.theme.form[p.size ?? 'md']} diff --git a/static/app/components/core/input/numberDragInput.stories.tsx b/static/app/components/core/input/numberDragInput.stories.tsx index 77ecb2efe9da9f..3673dae6cf76d4 100644 --- a/static/app/components/core/input/numberDragInput.stories.tsx +++ b/static/app/components/core/input/numberDragInput.stories.tsx @@ -73,6 +73,6 @@ export default Storybook.story('NumberDragInput', (story, APIReference) => { }); const Label = styled('div')` - font-size: ${p => p.theme.fontSize.sm}; + font-size: ${p => p.theme.font.size.sm}; color: ${p => p.theme.subText}; `; diff --git a/static/app/components/core/menuListItem/menuListItem.chonk.tsx b/static/app/components/core/menuListItem/menuListItem.chonk.tsx index c030a58c164a01..86f2c3eebf1fae 100644 --- a/static/app/components/core/menuListItem/menuListItem.chonk.tsx +++ b/static/app/components/core/menuListItem/menuListItem.chonk.tsx @@ -142,7 +142,7 @@ export const ChonkLabelWrap = chonkStyled('div')` `; export const ChonkDetails = chonkStyled('div')<{disabled: boolean; priority: Priority}>` - font-size: ${p => p.theme.fontSize.sm}; + font-size: ${p => p.theme.font.size.sm}; color: ${p => p.theme.subText}; line-height: 1.4; margin-bottom: 0; diff --git a/static/app/components/core/menuListItem/menuListItem.tsx b/static/app/components/core/menuListItem/menuListItem.tsx index ceb89ec8b92810..12d95c02aac254 100644 --- a/static/app/components/core/menuListItem/menuListItem.tsx +++ b/static/app/components/core/menuListItem/menuListItem.tsx @@ -434,7 +434,7 @@ const Label = withChonk( const Details = withChonk( styled('div')<{disabled: boolean; priority: Priority}>` - font-size: ${p => p.theme.fontSize.sm}; + font-size: ${p => p.theme.font.size.sm}; color: ${p => p.theme.subText}; line-height: 1.2; margin-bottom: 0; diff --git a/static/app/components/core/segmentedControl/segmentedControl.chonk.tsx b/static/app/components/core/segmentedControl/segmentedControl.chonk.tsx index 699282d3102272..501d38df0a201e 100644 --- a/static/app/components/core/segmentedControl/segmentedControl.chonk.tsx +++ b/static/app/components/core/segmentedControl/segmentedControl.chonk.tsx @@ -69,7 +69,7 @@ export const ChonkStyledSegmentWrap = chonkStyled('label')<{ z-index: ${p => (p.isSelected ? 1 : undefined)}; padding: ${p => segmentedWrapPadding[p.size]}; - font-weight: ${p => p.theme.fontWeight.normal}; + font-weight: ${p => p.theme.font.weight.regular}; ${p => ({...DO_NOT_USE_getChonkButtonStyles({...p, disabled: p.isDisabled, priority: p.isSelected && p.priority === 'primary' ? 'primary' : 'default'})})} @@ -91,7 +91,7 @@ export const ChonkStyledSegmentWrap = chonkStyled('label')<{ export const ChonkStyledVisibleLabel = chonkStyled('span')` ${p => p.theme.overflowEllipsis} user-select: none; - font-weight: ${p => p.theme.fontWeight.bold}; + font-weight: ${p => p.theme.font.weight.medium}; text-align: center; `; diff --git a/static/app/components/core/segmentedControl/segmentedControl.tsx b/static/app/components/core/segmentedControl/segmentedControl.tsx index 6750556ea89361..4fa8d47c4a3984 100644 --- a/static/app/components/core/segmentedControl/segmentedControl.tsx +++ b/static/app/components/core/segmentedControl/segmentedControl.tsx @@ -286,7 +286,7 @@ const SegmentWrap = withChonk( min-width: 0; padding: ${p => segmentedWrapPadding[p.size]}; - font-weight: ${p => p.theme.fontWeight.normal}; + font-weight: ${p => p.theme.font.weight.regular}; ${p => !p.isDisabled && @@ -473,7 +473,7 @@ const VisibleLabel = withChonk( font-weight: ${p => (p.isSelected ? 600 : 400)}; letter-spacing: ${p => (p.isSelected ? '-0.015em' : 'inherit')}; text-align: center; - line-height: ${p => p.theme.text.lineHeightBody}; + line-height: ${p => p.theme.font.lineHeight.comfortable}; ${getTextColor} `, ChonkStyledVisibleLabel diff --git a/static/app/components/core/slider/slider.chonk.tsx b/static/app/components/core/slider/slider.chonk.tsx index 861f6e4f975a25..56325cfd2a6947 100644 --- a/static/app/components/core/slider/slider.chonk.tsx +++ b/static/app/components/core/slider/slider.chonk.tsx @@ -216,7 +216,7 @@ const SliderOutput = chonkStyled('output')` display: flex; align-items: center; justify-content: center; - font-size: ${p => p.theme.fontSize.sm}; + font-size: ${p => p.theme.font.size.sm}; position: absolute; height: 24px; width: calc(100% - 16px); diff --git a/static/app/components/core/tabs/tab.tsx b/static/app/components/core/tabs/tab.tsx index 5f4ff848ba7549..2d47544e4bf4e5 100644 --- a/static/app/components/core/tabs/tab.tsx +++ b/static/app/components/core/tabs/tab.tsx @@ -216,7 +216,7 @@ const FloatingTabWrap = styled('li', {shouldForwardProp: tabsShouldForwardProp}) &[aria-selected='true'] { ${p => css` color: ${p.theme.purple400}; - font-weight: ${p.theme.fontWeight.bold}; + font-weight: ${p.theme.font.weight.medium}; background-color: ${p.theme.purple100}; `} } diff --git a/static/app/components/core/text/heading.tsx b/static/app/components/core/text/heading.tsx index 6af2fb71295a3f..1bc07fc51b4048 100644 --- a/static/app/components/core/text/heading.tsx +++ b/static/app/components/core/text/heading.tsx @@ -51,8 +51,8 @@ export const Heading = styled( white-space: ${p => (p.wrap ? p.wrap : p.ellipsis ? 'nowrap' : undefined)}; text-wrap: ${p => p.textWrap ?? undefined}; - font-family: ${p => (p.monospace ? p.theme.text.familyMono : p.theme.text.family)}; - font-weight: ${p => p.theme.fontWeight.bold}; + font-family: ${p => p.theme.font.family[p.monospace ? 'mono' : 'sans']}; + font-weight: ${p => p.theme.font.weight.medium}; font-variant-numeric: ${p => [ p.tabular ? 'tabular-nums' : undefined, diff --git a/static/app/components/core/text/styles.tsx b/static/app/components/core/text/styles.tsx index ff91d053e247b9..59d65bc93edbe1 100644 --- a/static/app/components/core/text/styles.tsx +++ b/static/app/components/core/text/styles.tsx @@ -37,7 +37,7 @@ export function getFontSize( size: NonNullable['size']>>, theme: Theme ) { - return theme.fontSize[size]; + return theme.font.size[size]; } type ResponsiveValue = T extends Responsive ? U : T; diff --git a/static/app/components/core/text/text.tsx b/static/app/components/core/text/text.tsx index eb289d8c8293b8..6efe6e73eb00ca 100644 --- a/static/app/components/core/text/text.tsx +++ b/static/app/components/core/text/text.tsx @@ -149,8 +149,8 @@ export const Text = styled( : 'block' : undefined}; - font-family: ${p => (p.monospace ? p.theme.text.familyMono : p.theme.text.family)}; - font-weight: ${p => (p.bold ? p.theme.fontWeight.bold : undefined)}; + font-family: ${p => p.theme.font.family[p.monospace ? 'mono' : 'sans']}; + font-weight: ${p => (p.bold ? p.theme.font.weight.medium : undefined)}; font-variant-numeric: ${p => [ p.tabular ? 'tabular-nums' : undefined, diff --git a/static/app/components/core/textarea/textarea.tsx b/static/app/components/core/textarea/textarea.tsx index c93ad84cd69664..a792faffddf9dc 100644 --- a/static/app/components/core/textarea/textarea.tsx +++ b/static/app/components/core/textarea/textarea.tsx @@ -51,7 +51,7 @@ const StyledTextArea = styled(TextAreaControl, { shouldForwardProp: (p: string) => ['autosize', 'maxRows'].includes(p) || isPropValid(p), })` ${inputStyles}; - line-height: ${p => p.theme.text.lineHeightBody}; + line-height: ${p => p.theme.font.lineHeight.comfortable}; /** Allow react-textarea-autosize to freely control height based on props. */ ${p => p.autosize && @@ -69,12 +69,12 @@ export const TextArea = withChonk( /* this calculation reduces padding to account for the line-height, which ensures text is still correctly centered. */ ${({theme, size = 'md'}) => `padding-top: calc( (${theme.form[size].height} - - (${theme.form[size].fontSize} * ${theme.text.lineHeightBody}) + (${theme.form[size].fontSize} * ${theme.font.lineHeight.comfortable}) ) / 2 )`}; ${({theme, size = 'md'}) => `padding-bottom: calc( (${theme.form[size].height} - - (${theme.form[size].fontSize} * ${theme.text.lineHeightBody}) + (${theme.form[size].fontSize} * ${theme.font.lineHeight.comfortable}) ) / 2 )`}; ` diff --git a/static/app/components/core/tooltip/tooltip.tsx b/static/app/components/core/tooltip/tooltip.tsx index a19ea497f98976..6d22fcac2f2282 100644 --- a/static/app/components/core/tooltip/tooltip.tsx +++ b/static/app/components/core/tooltip/tooltip.tsx @@ -116,7 +116,7 @@ const TooltipContent = styled(Overlay, { overflow-wrap: break-word; max-width: ${p => p.maxWidth ?? 225}px; color: ${p => p.theme.textColor}; - font-size: ${p => p.theme.fontSize.sm}; + font-size: ${p => p.theme.font.size.sm}; line-height: 1.2; text-align: center; `;