Skip to content

Commit

Permalink
[@kadena/react-ui] Fix TrackerCard styling
Browse files Browse the repository at this point in the history
  • Loading branch information
MRVDH committed Aug 10, 2023
1 parent d665c86 commit d1b6b85
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packages/libs/react-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@
"@rushstack/eslint-config": "~3.3.0",
"@rushstack/heft": "~0.50.6",
"@rushstack/heft-jest-plugin": "~0.5.12",
"@storybook/addon-actions": "^7.1.0",
"@storybook/addon-a11y": "7.1.0",
"@storybook/addon-actions": "^7.1.0",
"@storybook/addon-controls": "^7.1.0",
"@storybook/addon-essentials": "^7.1.0",
"@storybook/addon-interactions": "^7.1.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { sprinkles } from '../../styles';

import { sprinkles } from '@theme/sprinkles.css';
import { darkThemeClass, vars } from '@theme/vars.css';
import { style, styleVariants } from '@vanilla-extract/css';

export const layoutVariant = styleVariants({
Expand Down Expand Up @@ -77,13 +77,24 @@ export const CardContainer = style([
sprinkles({
display: 'grid',
padding: '$3',
gap: '$4',
gap: '$2',
marginTop: '$sm',
borderRadius: '$sm',
alignItems: 'flex-start',
fontSize: '$sm',
background: '$background',
background: {
lightMode: '$white',
darkMode: '$gray100',
},
}),
{
border: `1px solid ${vars.colors.$borderDefault}`,
selectors: {
[`${darkThemeClass} &`]: {
border: `1px solid ${vars.colors.$gray60}`,
},
},
},
]);

export const ContentContainer = style([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export interface ITrackerCardProps {
helperText?: string;
helperTextType?: 'mild' | 'severe';
icon?: (typeof ProductIcon)[keyof typeof ProductIcon];
variant: keyof typeof layoutVariant;
variant?: keyof typeof layoutVariant;
}

export interface ILabelValue {
Expand All @@ -40,7 +40,7 @@ export const TrackerCard: FC<ITrackerCardProps> = ({
icon,
helperText,
helperTextType = 'mild',
variant,
variant = 'vertical',
}): JSX.Element => {
const classCardContainer = classNames(
CardContainer,
Expand All @@ -64,7 +64,7 @@ export const TrackerCard: FC<ITrackerCardProps> = ({

return (
<div className={classCardContainer} data-testid="kda-tracker-card">
{Icon ? <Icon data-testid="kda-icon" /> : <div />}
{Icon ? <Icon data-testid="kda-icon" size="xl" /> : null}
<div className={ContentContainer}>
<div className={DataContainer} data-testid="kda-data-container">
{labelValues?.map((item, index) => {
Expand Down

1 comment on commit d1b6b85

@vercel
Copy link

@vercel vercel bot commented on d1b6b85 Aug 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

react-ui – ./packages/libs/react-ui

react-ui-delta.vercel.app
react-ui-kadena-js.vercel.app
react-ui-git-main-kadena-js.vercel.app
react-ui.kadena.io

Please sign in to comment.