Skip to content

Commit

Permalink
CCR-77 Fix chart container disabled title color (#166)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vlad Baranchuk authored Apr 21, 2021
1 parent 10aa38f commit 5d40ea8
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 31 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions lib/components/ChartContainer/ChartContainer.css
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@
height: 36px;
}

.disabledTitle {
color: var(--vds-color-slate-lighter);
}

.content {
padding: 12px 24px 24px;
}
8 changes: 6 additions & 2 deletions lib/components/ChartContainer/ChartContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,12 @@ function ChartContainer({
disabled,
children,
}) {
const subtitleStyle = cn(styles.subtitle, onBackClick ? styles.withBack : styles.withNoBack);
const titleStyle = cn(styles.title, onBackClick ? styles.leftItem : styles.withNoBack);
const subtitleStyle = cn(styles.subtitle, onBackClick ? styles.withBack : styles.withNoBack, {
[styles.disabledTitle]: disabled,
});
const titleStyle = cn(styles.title, onBackClick ? styles.leftItem : styles.withNoBack, {
[styles.disabledTitle]: disabled,
});

return (
<div className={styles.container}>
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "virtuoso-design-system",
"version": "1.19.10",
"version": "1.19.11",
"description": "A set of reusable elements that enable Virtru designers and Virtru engineers to create consistent Virtru products.",
"author": "Virtru CI <[email protected]>",
"main": "dist/bundle.cjs.js",
Expand Down
62 changes: 35 additions & 27 deletions stories/vrc-stories/ChartContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,28 @@ import styles from 'lib/styles/build/js/design_tokens';
import ChartContainer from '@/components/ChartContainer/ChartContainer';
import Select from '@/components/Select/Select';

const children = (
<div
style={{
background: styles.vds.color.red.lightest.value,
width: '930px',
height: '300px',
border: `1px solid ${styles.vds.color.slate.darker.value}`,
borderRadius: '5px',
}}
/>
);
const props = {
const chartProps = {
title: 'Where is my protected data going?',
subtitle: (
<>
<span> 30,212 recipients at </span>
<span style={{ fontWeight: styles.vds.font.weight.bold.value }}> company-one.com </span>
</>
),
children: (
<div
style={{
background: styles.vds.color.red.lightest.value,
width: '930px',
height: '300px',
border: `1px solid ${styles.vds.color.slate.darker.value}`,
borderRadius: '5px',
}}
/>
),
};

const select = (
const WrappedSelect = (props) => (
<div style={{ width: '240px' }}>
<Select
value="Select another domain"
Expand All @@ -47,6 +47,7 @@ const select = (
]}
placeholder="Select another domain"
isSearchable
{...props}
/>
</div>
);
Expand All @@ -60,11 +61,9 @@ storiesOf('ChartContainer', module)
onSettingsClick={() => {
alert('settings');
}}
select={select}
{...props}
>
{children}
</ChartContainer>
select={<WrappedSelect />}
{...chartProps}
/>
))
.add('no select', () => (
<ChartContainer
Expand All @@ -74,19 +73,28 @@ storiesOf('ChartContainer', module)
onSettingsClick={() => {
alert('settings');
}}
{...props}
>
{children}
</ChartContainer>
{...chartProps}
/>
))
.add('no back', () => (
<ChartContainer
onSettingsClick={() => {
alert('settings');
}}
{...props}
>
{children}
</ChartContainer>
{...chartProps}
/>
))
.add('minimal', () => <ChartContainer {...props}>{children}</ChartContainer>);
.add('minimal', () => <ChartContainer {...chartProps} />)
.add('disabled', () => (
<ChartContainer
disabled
onBackClick={() => {
alert('back');
}}
onSettingsClick={() => {
alert('settings');
}}
select={<WrappedSelect isDisabled />}
{...chartProps}
/>
));

0 comments on commit 5d40ea8

Please sign in to comment.