', () => {
describe('
', () => {
const mockProps: ChartProps = {
showLegend: true,
- theme: `Default`,
+ theme: `Light`,
labelFormatter: (value) => `${value}`,
dimensions: {width: 500, height: 500},
data: [
diff --git a/packages/polaris-viz/src/components/HorizontalBarChart/tests/Chart.test.tsx b/packages/polaris-viz/src/components/HorizontalBarChart/tests/Chart.test.tsx
index eeacc0eee..f031579ff 100644
--- a/packages/polaris-viz/src/components/HorizontalBarChart/tests/Chart.test.tsx
+++ b/packages/polaris-viz/src/components/HorizontalBarChart/tests/Chart.test.tsx
@@ -1,5 +1,6 @@
import {mount} from '@shopify/react-testing';
import type {DataSeries} from '@shopify/polaris-viz-core';
+import {LIGHT_THEME} from '@shopify/polaris-viz-core';
import {HorizontalBarChartXAxisLabels} from '../../../components/HorizontalBarChartXAxisLabels';
import {LegendContainer} from '../../LegendContainer';
@@ -98,14 +99,8 @@ describe('
', () => {
const defs = chart.find(GradientDefs);
expect(defs?.props.seriesColors).toStrictEqual([
- [
- {color: '#7f4afa', offset: 0},
- {color: '#997afc', offset: 100},
- ],
- [
- {color: '#3672bb', offset: 0},
- {color: '#4b92e5', offset: 100},
- ],
+ LIGHT_THEME.seriesColors.upToEight[0],
+ LIGHT_THEME.seriesColors.upToEight[1],
]);
});
@@ -136,10 +131,7 @@ describe('
', () => {
expect(defs?.props.seriesColors).toStrictEqual([
'red',
- [
- {color: '#7f4afa', offset: 0},
- {color: '#997afc', offset: 100},
- ],
+ LIGHT_THEME.seriesColors.upToEight[0],
]);
});
});
diff --git a/packages/polaris-viz/src/components/HorizontalGridLines/HorizontalGridLines.test.tsx b/packages/polaris-viz/src/components/HorizontalGridLines/HorizontalGridLines.test.tsx
index e3d1deadd..5fc2d10ed 100644
--- a/packages/polaris-viz/src/components/HorizontalGridLines/HorizontalGridLines.test.tsx
+++ b/packages/polaris-viz/src/components/HorizontalGridLines/HorizontalGridLines.test.tsx
@@ -10,7 +10,6 @@ const MOCK_PROPS: Props = {
ticks: [],
transform: {x: 10, y: 20},
width: 100,
- theme: 'Default',
};
describe('
', () => {
@@ -47,7 +46,7 @@ describe('
', () => {
expect(actual).toContainReactComponent('line', {
x2: 100,
transform: `translate(10,20)`,
- stroke: '#43434e',
+ stroke: '#eeeeef',
});
});
diff --git a/packages/polaris-viz/src/components/Labels/Labels.chromatic.stories.tsx b/packages/polaris-viz/src/components/Labels/Labels.chromatic.stories.tsx
index c79435505..1146d11cb 100644
--- a/packages/polaris-viz/src/components/Labels/Labels.chromatic.stories.tsx
+++ b/packages/polaris-viz/src/components/Labels/Labels.chromatic.stories.tsx
@@ -1,7 +1,7 @@
import {storiesOf} from '@storybook/react';
import {XAxis} from '../XAxis';
-import {ChartContext} from '@shopify/polaris-viz-core';
+import {ChartContext, DEFAULT_THEME_NAME} from '@shopify/polaris-viz-core';
import characterWidths from '../../data/character-widths.json';
import characterWidthOffsets from '../../data/character-width-offsets.json';
@@ -100,7 +100,7 @@ function Wrapper({storyName, chartWidth, children}) {
characterWidthOffsets,
id: '',
isPerformanceImpacted: false,
- theme: 'Default',
+ theme: DEFAULT_THEME_NAME,
}}
>
{children}
diff --git a/packages/polaris-viz/src/components/LineChart/stories/InteractiveCustomLegend.stories.tsx b/packages/polaris-viz/src/components/LineChart/stories/InteractiveCustomLegend.stories.tsx
index 012b05b5b..61e2f8aa9 100644
--- a/packages/polaris-viz/src/components/LineChart/stories/InteractiveCustomLegend.stories.tsx
+++ b/packages/polaris-viz/src/components/LineChart/stories/InteractiveCustomLegend.stories.tsx
@@ -3,7 +3,7 @@ import type {Story} from '@storybook/react';
export {META as default} from './meta';
import {LinePreview} from '../../..';
-import {DEFAULT_THEME} from '../../../constants';
+import {DARK_THEME} from '../../../constants';
import type {LineChartProps} from '../..';
import {DEFAULT_DATA, DEFAULT_PROPS, Template} from './data';
@@ -36,7 +36,7 @@ InteractiveCustomLegend.args = {
{name}
diff --git a/packages/polaris-viz/src/components/LineChart/stories/playground/ExternalTooltip.stories.tsx b/packages/polaris-viz/src/components/LineChart/stories/playground/ExternalTooltip.stories.tsx
index 4b77c6941..4c81ce922 100644
--- a/packages/polaris-viz/src/components/LineChart/stories/playground/ExternalTooltip.stories.tsx
+++ b/packages/polaris-viz/src/components/LineChart/stories/playground/ExternalTooltip.stories.tsx
@@ -21,7 +21,7 @@ function Card(args: LineChartProps) {
padding: 10,
}}
>
-
+
);
}
diff --git a/packages/polaris-viz/src/components/LineChartPredictive/components/CustomLegend/tests/CustomLegend.test.tsx b/packages/polaris-viz/src/components/LineChartPredictive/components/CustomLegend/tests/CustomLegend.test.tsx
index 2f959ad0b..950a75277 100644
--- a/packages/polaris-viz/src/components/LineChartPredictive/components/CustomLegend/tests/CustomLegend.test.tsx
+++ b/packages/polaris-viz/src/components/LineChartPredictive/components/CustomLegend/tests/CustomLegend.test.tsx
@@ -28,7 +28,7 @@ const MOCK_PROPS: Props = {
],
predictiveSeriesNames: [],
seriesNameFormatter: (value) => `${value}`,
- theme: 'Default',
+ theme: 'Light',
getColorVisionEventAttrs: jest.fn(),
getColorVisionStyles: jest.fn(),
};
diff --git a/packages/polaris-viz/src/components/LineChartRelational/components/CustomLegend/tests/CustomLegend.test.tsx b/packages/polaris-viz/src/components/LineChartRelational/components/CustomLegend/tests/CustomLegend.test.tsx
index bef892cf3..abc9fa71c 100644
--- a/packages/polaris-viz/src/components/LineChartRelational/components/CustomLegend/tests/CustomLegend.test.tsx
+++ b/packages/polaris-viz/src/components/LineChartRelational/components/CustomLegend/tests/CustomLegend.test.tsx
@@ -1,5 +1,5 @@
import {mount} from '@shopify/react-testing';
-import type {DataSeries} from '@shopify/polaris-viz-core';
+import {DEFAULT_THEME_NAME} from '@shopify/polaris-viz-core';
import type {Props} from '../CustomLegend';
import {CustomLegend} from '../CustomLegend';
@@ -48,7 +48,7 @@ const MOCK_PROPS: Props = {
},
],
seriesNameFormatter: (value) => `${value}`,
- theme: 'Default',
+ theme: DEFAULT_THEME_NAME,
getColorVisionEventAttrs: jest.fn(),
getColorVisionStyles: jest.fn(),
};
diff --git a/packages/polaris-viz/src/components/LineChartRelational/stories/Default.stories.tsx b/packages/polaris-viz/src/components/LineChartRelational/stories/Default.stories.tsx
index 42836b1cf..28f0fb048 100644
--- a/packages/polaris-viz/src/components/LineChartRelational/stories/Default.stories.tsx
+++ b/packages/polaris-viz/src/components/LineChartRelational/stories/Default.stories.tsx
@@ -12,5 +12,4 @@ Default.args = {
data: DEFAULT_DATA,
isAnimated: false,
showLegend: true,
- theme: 'Uplift',
};
diff --git a/packages/polaris-viz/src/components/LineChartRelational/stories/data.tsx b/packages/polaris-viz/src/components/LineChartRelational/stories/data.tsx
index 7cdc7150b..79b126533 100644
--- a/packages/polaris-viz/src/components/LineChartRelational/stories/data.tsx
+++ b/packages/polaris-viz/src/components/LineChartRelational/stories/data.tsx
@@ -1,7 +1,7 @@
import type {Story} from '@storybook/react';
import type {RenderTooltipContentData} from 'types';
import type {DataSeries} from '@shopify/polaris-viz-core';
-import {UPLIFT_THEME} from '@shopify/polaris-viz-core';
+import {LIGHT_THEME} from '@shopify/polaris-viz-core';
import type {LineChartProps} from 'components/LineChart/LineChart';
import {LineChartRelational} from '../LineChartRelational';
@@ -81,7 +81,7 @@ export const DEFAULT_DATA: DataSeries[] = [
{value: 849, key: '2020-03-13T12:00:00'},
{value: 129, key: '2020-03-14T12:00:00'},
],
- color: UPLIFT_THEME.seriesColors.upToEight[0],
+ color: LIGHT_THEME.seriesColors.upToEight[0],
},
{
name: '75th Percentile',
@@ -131,7 +131,7 @@ export const DEFAULT_DATA: DataSeries[] = [
{value: 623, key: '2020-03-13T12:00:00'},
{value: 21, key: '2020-03-14T12:00:00'},
],
- color: UPLIFT_THEME.seriesColors.upToEight[5],
+ color: LIGHT_THEME.seriesColors.upToEight[5],
styleOverride: {
line: {
hasArea: false,
diff --git a/packages/polaris-viz/src/components/PolarisVizProvider/stories/PolarisVizProvider.chromatic.stories.tsx b/packages/polaris-viz/src/components/PolarisVizProvider/stories/PolarisVizProvider.chromatic.stories.tsx
index 1e04a0d79..a34b0477d 100644
--- a/packages/polaris-viz/src/components/PolarisVizProvider/stories/PolarisVizProvider.chromatic.stories.tsx
+++ b/packages/polaris-viz/src/components/PolarisVizProvider/stories/PolarisVizProvider.chromatic.stories.tsx
@@ -10,6 +10,7 @@ import {SparkBarChart} from '../../SparkBarChart';
import {SparkLineChart} from '../../SparkLineChart';
import {StackedAreaChart} from '../../StackedAreaChart';
import {PolarisVizProvider} from '../PolarisVizProvider';
+import {DEFAULT_THEME_NAME} from '@shopify/polaris-viz-core';
export default {
title: `chromatic/PolarisVizProvider/Chromatic`,
@@ -133,18 +134,18 @@ DefaultTheme.args = {};
export const OverideDefaultTheme: Story = Template.bind({});
OverideDefaultTheme.args = {
- theme: 'Uplift',
+ theme: 'Dark',
};
export const DefaultThemeWithSingle: Story = Template.bind({});
DefaultThemeWithSingle.args = {
- singleTheme: 'Light',
+ singleTheme: DEFAULT_THEME_NAME,
};
export const OverideDefaultThemeWithSingle: Story = Template.bind({});
OverideDefaultThemeWithSingle.args = {
- theme: 'Uplift',
- singleTheme: 'Default',
+ theme: 'Dark',
+ singleTheme: DEFAULT_THEME_NAME,
};
diff --git a/packages/polaris-viz/src/components/SimpleBarChart/stories/InteractiveCustomLegend.stories.tsx b/packages/polaris-viz/src/components/SimpleBarChart/stories/InteractiveCustomLegend.stories.tsx
index beb7dd8fe..4d9464b36 100644
--- a/packages/polaris-viz/src/components/SimpleBarChart/stories/InteractiveCustomLegend.stories.tsx
+++ b/packages/polaris-viz/src/components/SimpleBarChart/stories/InteractiveCustomLegend.stories.tsx
@@ -2,7 +2,7 @@ import type {Story} from '@storybook/react';
export {META as default} from './meta';
-import {DEFAULT_THEME} from '../../../constants';
+import {DARK_THEME} from '../../../constants';
import type {SimpleBarChartProps} from '..';
import {SquareColorPreview} from '../../SquareColorPreview';
@@ -34,7 +34,7 @@ InteractiveCustomLegend.args = {
{...getColorVisionEventAttrs(index)}
>