Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ARCH-720): use design-tokens #4808

Merged
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
5 changes: 5 additions & 0 deletions .changeset/angry-moles-happen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@talend/react-faceted-search': major
---

feat: use design-tokens for colors
5 changes: 5 additions & 0 deletions .changeset/flat-crabs-visit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@talend/react-dataviz': major
---

feat: colors now use design-tokens
5 changes: 5 additions & 0 deletions .changeset/strange-ligers-bathe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@talend/react-forms': major
---

All colors are now based on design-tokens
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@use '~@talend/bootstrap-theme/src/theme/guidelines' as *;

@use '~@talend/design-tokens/lib/tokens';
@import '../bar-chart';

$module: colored-bar;
Expand Down Expand Up @@ -41,6 +41,6 @@ $module: colored-bar;
}

&__secondary-bar {
fill: $alto;
fill: tokens.$coral-color-charts-neutral-weak;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ context('<HorizontalBarChart />', () => {
/>,
);

// eslint-disable-next-line cypress/unsafe-to-chain-command
cy.get('.recharts-bar-rectangle')
.first()
.trigger('mousemove')
Expand Down Expand Up @@ -54,6 +55,7 @@ context('<HorizontalBarChart />', () => {
/>,
);

// eslint-disable-next-line cypress/unsafe-to-chain-command
cy.get('.recharts-bar-rectangle')
.first()
.trigger('mousemove')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
@use '~@talend/bootstrap-theme/src/theme/guidelines' as *;

.tooltip-cursor {
pointer-events: all;
cursor: pointer;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
@use '~@talend/bootstrap-theme/src/theme/guidelines' as *;

@import '../bar-chart';

.vertical-bar-chart {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ context('<HorizontalBarChart />', () => {
getTooltipContent={() => <div data-testid="tooltip">tooltip</div>}
/>,
);

// eslint-disable-next-line cypress/unsafe-to-chain-command
cy.get('.recharts-bar-rectangle')
.first()
.trigger('mousemove')
Expand All @@ -41,6 +43,8 @@ context('<HorizontalBarChart />', () => {
getTooltipContent={getTooltipContent}
/>,
);

// eslint-disable-next-line cypress/unsafe-to-chain-command
cy.get('.recharts-bar-rectangle')
.first()
.trigger('mousemove')
Expand Down
15 changes: 8 additions & 7 deletions packages/dataviz/src/components/BarChart/_bar-chart.scss
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
@use '~@talend/bootstrap-theme/src/theme/guidelines' as *;
@use '~@talend/design-tokens/lib/tokens';

$pattern-bar-primary-color: tint($jaffa, 70%);
$pattern-bar-secondary-color: shade($jaffa, 30%);
$pattern-bar-primary-color: tokens.$coral-color-charts-warning-weak;
$pattern-bar-secondary-color: tokens.$coral-color-charts-warning-strong;

$value-bar-primary-color: tint($lochmara, 70%);
$value-bar-secondary-color: shade($lochmara, 30%);
$value-bar-primary-color: tokens.$coral-color-charts-default-weak;
$value-bar-secondary-color: tokens.$coral-color-charts-default-strong;

$grey-bar-color: $alto;
$grey-bar-color: tokens.$coral-color-charts-neutral-weak;

@mixin override-recharts-styles() {
// We can't use custom classname on axis
Expand All @@ -19,11 +20,11 @@ $grey-bar-color: $alto;
.recharts-yAxis {
text {
font-size: 1.2rem;
fill: $gray;
fill: tokens.$coral-color-neutral-text;
}

line {
stroke: $gray;
stroke: tokens.$coral-color-neutral-text;
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
@use '~@talend/bootstrap-theme/src/theme/guidelines' as *;

@use '~@talend/design-tokens/lib/tokens';
// Imported (almost) as-is from TDP

.box-plot {
font: 11px 'Source Sans Pro', sans-serif;

line,
rect {
fill: #19426C;
stroke: black;
fill: tokens.$coral-color-charts-default-strong;
stroke: tokens.$coral-color-charts-neutral-strong;
stroke-width: 1px;
}

&__whiskerPolyg {
fill: none;
stroke: black;
stroke: tokens.$coral-color-charts-neutral-strong;
stroke-width: 2;
}

Expand All @@ -25,24 +25,24 @@
&__mean {
fill: white;
opacity: 0.5;
stroke: #19426C;
stroke: tokens.$coral-color-charts-default-strong;
shape-rendering: geometricPrecision;
stroke-width: 0.8;
}

&__max-min-labels {
fill: #0675C1;
fill: tokens.$coral-color-charts-default;
}

&__low-quantile-labels {
fill: #689734;
fill: tokens.$coral-color-charts-success-strong;
}

&__up-quantile-labels {
fill: #BA4C50;
fill: tokens.$coral-color-charts-danger-strong;
}

&__mean-labels {
fill: $white;
fill: tokens.$coral-color-charts-neutral-weak;
}
}
19 changes: 10 additions & 9 deletions packages/dataviz/src/components/GeoChart/GeoChart.module.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
@use '~@talend/bootstrap-theme/src/theme/guidelines' as *;
@use '~@talend/design-tokens/lib/tokens';

:export {
scaleMinColor: tint($regal-blue, 80%); /* stylelint-disable-line property-no-unknown */
scaleMaxColor: shade($regal-blue, 30%); /* stylelint-disable-line property-no-unknown */
scaleMinColor: tokens.$coral-color-charts-default-weak; /* stylelint-disable-line property-no-unknown */
scaleMaxColor: tokens.$coral-color-charts-default-strong; /* stylelint-disable-line property-no-unknown */
}

.geo-chart {
Expand All @@ -14,16 +15,16 @@
}

&__feature {
stroke: $white;
stroke: tokens.$coral-color-charts-neutral;
stroke-width: 1px;
vector-effect: non-scaling-stroke;

&--disabled {
fill: $silver;
fill: tokens.$coral-color-charts-neutral-weak;
}

&:not(&--disabled):hover {
fill: $lochmara !important; /* stylelint-disable-line declaration-no-important */
fill: tokens.$coral-color-charts-default !important; /* stylelint-disable-line declaration-no-important */
cursor: pointer;
}
}
Expand All @@ -49,20 +50,20 @@
}

&__zoom-icon {
color: $black;
color: tokens.$coral-color-charts-neutral;
width: 100%;
height: 100%;

&:not(:hover) .ti-background {
color: $silver;
color: tokens.$coral-color-charts-neutral;
}

&:hover {
color: $lochmara;
color: tokens.$coral-color-charts-neutral-hover;
}

&:active {
color: $regal-blue;
color: tokens.$coral-color-charts-default;
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@use '~@talend/bootstrap-theme/src/theme/guidelines' as *;
@use '~@talend/design-tokens/lib/tokens';

$module: key-value-tooltip;

Expand All @@ -17,7 +18,7 @@ $module: key-value-tooltip;
margin-top: 0; // override dt margin
font-weight: $font-weight-regular;
line-height: $line-height-base;
color: $white;
color: tokens.$coral-color-neutral-background;

&::after {
content: ':';
Expand All @@ -26,12 +27,12 @@ $module: key-value-tooltip;

&__value {
margin-left: 5px;
color: $scooter;
color: tokens.$coral-color-accent-text-weak-active;
}

&--pattern {
.#{$module}__value {
color: $jaffa;
color: tokens.$coral-color-danger-text-weak;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { LineChartEntry, LineChartOptions, LineOptions, LineStatus } from './Lin

import { CustomTooltip } from './LineChartTooltip.component';
import { CustomLegend } from './LineChartLegend.component';
import style from './LineChart.module.scss';

export interface LineChartProps {
data: LineChartEntry[];
Expand Down Expand Up @@ -129,7 +130,7 @@ function LineChart({
return (
<>
<ResponsiveContainer width={width || '100%'} height={height || '100%'} debounce={1}>
<RLineChart data={data} margin={margin || {}}>
<RLineChart data={data} margin={margin || {}} className={style.container}>
{!!showGridLines && (
<CartesianGrid
stroke={tokens.coralColorNeutralBackgroundMedium}
Expand Down
10 changes: 10 additions & 0 deletions packages/dataviz/src/components/LineChart/LineChart.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@

$module: line-chart;

.container {
:global(.recharts-cartesian-axis-line) {
stroke: tokens.$coral-color-neutral-text;
}

:global(.recharts-text) {
fill: tokens.$coral-color-neutral-text;
}
}

.#{$module} {
&-custom-tooltip {
list-style: none;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
@use '~@talend/bootstrap-theme/src/theme/guidelines' as *;
@use '~@talend/design-tokens/lib/tokens';

$module: range-filter;

.#{$module} {
:global(.rc-slider-mark-text),
:global(.rc-slider-mark-text-active) {
color: tokens.$coral-color-neutral-text;
}

&__slider {
margin: 20px 0 30px;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ function RangeFilter({
id={`${id}-range-filter-min-input`}
value={range.min}
onChange={(value: number) => {
console.log('4444');
onAfterChange({
// Tricky one: we want the corrected value (i.e. day start) to stay between limits
min: Math.min(Math.max(getMinValue(value), limits.min), range.max),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* stylelint-disable declaration-no-important */
@use '~@talend/bootstrap-theme/src/theme/guidelines' as *;

.date-time-input-field {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
@use '~@talend/bootstrap-theme/src/theme/guidelines' as *;

@use '~@talend/design-tokens/lib/_tokens.scss';
@use '~@talend/design-tokens/lib/tokens';

.dataviz-tooltip {
padding: tokens.$coral-spacing-m;

color: tokens.$coral-color-neutral-text-inverted;
color: tokens.$coral-color-assistive-text;
font: tokens.$coral-paragraph-m;

background: tokens.$coral-color-assistive-background;
border: tokens.$coral-border-s-solid rgba(0, 0, 0, 0.103);
border: tokens.$coral-border-s-solid tokens.$coral-color-neutral-border;
border-radius: tokens.$coral-radius-s;

&__title {
Expand Down
1 change: 0 additions & 1 deletion packages/faceted-search/.storybook/preview.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ThemeProvider } from '@talend/design-system';

Check warning on line 1 in packages/faceted-search/.storybook/preview.js

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

packages/faceted-search/.storybook/preview.js#L1

[import/no-unresolved] Unable to resolve path to module '@talend/design-system'.
import { namespaces as tuiNamespaces } from '@talend/locales-tui-components/namespaces';

Check warning on line 2 in packages/faceted-search/.storybook/preview.js

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

packages/faceted-search/.storybook/preview.js#L2

[@talend/import-depth] '@talend/locales-tui-components/namespaces' import too deep. No more than @talend/locales-tui-components

Check warning on line 2 in packages/faceted-search/.storybook/preview.js

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

packages/faceted-search/.storybook/preview.js#L2

[import/no-extraneous-dependencies] '@talend/locales-tui-components' should be listed in the project's dependencies, not devDependencies.
import { namespaces as facetedNamespaces } from '@talend/locales-tui-faceted-search/namespaces';

Check warning on line 3 in packages/faceted-search/.storybook/preview.js

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

packages/faceted-search/.storybook/preview.js#L3

[@talend/import-depth] '@talend/locales-tui-faceted-search/namespaces' import too deep. No more than @talend/locales-tui-faceted-search

Check warning on line 3 in packages/faceted-search/.storybook/preview.js

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

packages/faceted-search/.storybook/preview.js#L3

[import/no-extraneous-dependencies] '@talend/locales-tui-faceted-search' should be listed in the project's dependencies, not devDependencies.

export const i18n = {
namespaces: [...tuiNamespaces, ...facetedNamespaces],
Expand All @@ -20,7 +20,6 @@
height: '100%',
width: '100%',
overflow: 'auto',
backgroundColor: 'rgba(145, 209, 237, 0.1)',
}}
>
<ThemeProvider>
Expand Down
1 change: 1 addition & 0 deletions packages/faceted-search/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"@talend/daikon-tql-client": "^1.3.1",
"@talend/utils": "^2.5.1",
"@talend/react-bootstrap": "^1.35.2",
"@talend/design-tokens": "2.7.3",
"classnames": "^2.3.2",
"date-fns": "^1.30.1",
"invariant": "^2.2.4",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
@use '~@talend/bootstrap-theme/src/theme/guidelines' as *;
@use '~@talend/design-tokens/lib/tokens';

$circle-size-large: 2.2rem !default;
$circle-size-small: 1.8rem !default;

.tc-badge-operator {
align-items: center;
background: rgba(255, 255, 255, 0.5);
background: tokens.$coral-color-neutral-background;
border-radius: 10rem;
display: inline-flex;
justify-content: center;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@use '~@talend/bootstrap-theme/src/theme/guidelines' as *;
@use '~@talend/design-tokens/lib/tokens';

// stylelint-disable property-no-vendor-prefix

Expand Down Expand Up @@ -60,7 +61,7 @@
font-size: 3.2rem;
font-weight: $font-weight-semi-bold;
width: 8rem;
color: $dove-gray;
color: tokens.$coral-color-neutral-text-weak;
box-shadow: none;
height: 4.7rem;
padding: 0;
Expand All @@ -85,7 +86,7 @@
justify-content: space-between;

.tc-badge-slider-form-error {
color: $brand-danger;
color: tokens.$coral-color-danger-text;
}
}
}
Loading
Loading