Skip to content
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
4 changes: 2 additions & 2 deletions static/app/components/core/alert/alert.chonk.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export const TrailingItems = chonkStyled('div')<ChonkAlertProps>`
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;
Expand All @@ -159,7 +159,7 @@ export const TrailingItems = chonkStyled('div')<ChonkAlertProps>`
`;

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};
`;
Expand Down
12 changes: 8 additions & 4 deletions static/app/components/core/alert/alert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ const AlertPanel = styled('div')<AlertProps & {hovered: boolean}>`
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)};
Expand Down Expand Up @@ -245,22 +245,26 @@ 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
);

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%;
Expand Down
4 changes: 2 additions & 2 deletions static/app/components/core/badge/badge.chonk.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ export function ChonkBadge(props: ChonkBadgeProps) {
const StyledChonkBadge = chonkStyled('span')<ChonkBadgeProps>`
${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};
`;

Expand Down
4 changes: 2 additions & 2 deletions static/app/components/core/badge/badge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ const StyledBadge = styled('span')<BadgeProps>`
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};

Expand Down
2 changes: 1 addition & 1 deletion static/app/components/core/badge/tag.chonk.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
2 changes: 1 addition & 1 deletion static/app/components/core/badge/tag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export function Tag({
const TagPill = styled('div')<{
type: NonNullable<TagProps['type']>;
}>`
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;
Expand Down
2 changes: 1 addition & 1 deletion static/app/components/core/button/styles.chonk.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,

Expand Down
2 changes: 1 addition & 1 deletion static/app/components/core/button/styles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'};

Expand Down
6 changes: 3 additions & 3 deletions static/app/components/core/code/codeBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 =>
Expand Down
2 changes: 1 addition & 1 deletion static/app/components/core/code/inlineCode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions static/app/components/core/compactSelect/control.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -588,10 +588,10 @@ const MenuHeader = styled('div')<{size: NonNullable<ControlProps['size']>}>`
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};
`;

Expand All @@ -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)};
`;
Expand All @@ -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)};
Expand Down
14 changes: 7 additions & 7 deletions static/app/components/core/compactSelect/styles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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;

Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions static/app/components/core/input/input.chonk.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down
2 changes: 1 addition & 1 deletion static/app/components/core/input/input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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']}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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};
`;
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion static/app/components/core/menuListItem/menuListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'})})}

Expand All @@ -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;
`;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion static/app/components/core/slider/slider.chonk.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion static/app/components/core/tabs/tab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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};
`}
}
Expand Down
4 changes: 2 additions & 2 deletions static/app/components/core/text/heading.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion static/app/components/core/text/styles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export function getFontSize(
size: NonNullable<ResponsiveValue<TextProps<any>['size']>>,
theme: Theme
) {
return theme.fontSize[size];
return theme.font.size[size];
}

type ResponsiveValue<T> = T extends Responsive<infer U> ? U : T;
4 changes: 2 additions & 2 deletions static/app/components/core/text/text.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions static/app/components/core/textarea/textarea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Expand All @@ -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
)`};
`
Expand Down
2 changes: 1 addition & 1 deletion static/app/components/core/tooltip/tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
`;
Loading