Skip to content

Commit

Permalink
enhance(ui): RunInfo - add xlarge variation
Browse files Browse the repository at this point in the history
  • Loading branch information
vio committed May 25, 2024
1 parent 9ad63a3 commit d2bc728
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
4 changes: 4 additions & 0 deletions packages/ui/src/components/run-info/run-info.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,7 @@
.large .baselineMetric {
font-size: var(--size-small);
}

.xlarge .currentMetric {
font-size: var(--size-xxxxlarge);
}
2 changes: 1 addition & 1 deletion packages/ui/src/components/run-info/run-info.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default {
},
argTypes: {
size: {
options: ['small', 'medium', 'large'],
options: ['small', 'medium', 'large', 'xlarge'],
control: { type: 'select' },
},
},
Expand Down
14 changes: 7 additions & 7 deletions packages/ui/src/components/run-info/run-info.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useMemo } from 'react';
import React, { type ReactNode, useMemo } from 'react';
import cx from 'classnames';

import { Icon } from '../../ui/icon';
Expand All @@ -25,17 +25,17 @@ const getMetricParams = (value: string): [string, string?] => {
};

export interface RunInfoProps {
title?: string;
titleHoverCard?: React.ReactNode;
titleTooltip?: React.ReactNode;
current?: React.ReactNode;
title?: ReactNode;
titleHoverCard?: ReactNode;
titleTooltip?: ReactNode;
current?: ReactNode;
baseline?: string;
delta?: string;
deltaPercentage?: string;
deltaType?: string;

as?: React.ElementType;
size?: 'small' | 'medium' | 'large';
size?: 'small' | 'medium' | 'large' | 'xlarge';

showBaseline?: boolean;
loading?: boolean;
Expand Down Expand Up @@ -66,7 +66,7 @@ export const RunInfo = ({
(delta || deltaPercentage) && css.showDelta,
);

const currentValueParams: [React.ReactNode, string?] = useMemo(() => {
const currentValueParams: [ReactNode, string?] = useMemo(() => {
if (!enhance || typeof current !== 'string') {
return [current];
}
Expand Down
1 change: 1 addition & 0 deletions packages/ui/src/css/variables.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
--size-xlarge: 1.266rem;
--size-xxlarge: 1.424rem;
--size-xxxlarge: 1.602rem;
--size-xxxxlarge: 1.802rem;

--line-height: 1.66;
--line-height-heading: 1.33;
Expand Down

0 comments on commit d2bc728

Please sign in to comment.