Skip to content

Commit

Permalink
fix(style): import visualizations style in visualizations-react bundle (
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinFabre-ods authored Mar 26, 2024
1 parent 67a822d commit 2157be9
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 20 deletions.
1 change: 0 additions & 1 deletion packages/visualizations-react/.storybook/preview.js
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
import '@opendatasoft/visualizations/dist/index.css';
import './theme.css';
19 changes: 0 additions & 19 deletions packages/visualizations-react/.storybook/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,3 @@ h3 {
a:link, a:visited, a:active {
color: #774936;
}

/* Style for the Custom style Table story */
.table-story--custom-style .table-wrapper {
border-color: #fcd4cf;
}
.table-story--custom-style thead {
border-bottom-color: #f94346;
border-bottom-width: 2px;
background-color: #fd635d;
color:#ffffff;
}

.table-story--custom-style tbody tr {
border-bottom-color: #fcd4cf;
}
.table-story--custom-style tbody tr:hover {
background-color: #f9aea4;
}

2 changes: 2 additions & 0 deletions packages/visualizations-react/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@ module.exports = {
moduleNameMapper: {
src: '<rootDir>/src',
reactify: '<rootDir>/src/reactify',
// https://jestjs.io/docs/webpack#handling-static-assets
'\\.css$': '<rootDir>/test/__mocks__/styleMock.js',
},
};
2 changes: 2 additions & 0 deletions packages/visualizations-react/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import '@opendatasoft/visualizations/dist/index.css';

import {
Chart as _Chart,
KpiCard as _KpiCard,
Expand Down
2 changes: 2 additions & 0 deletions packages/visualizations-react/stories/Table/Table.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import React from 'react';
import { ComponentMeta, ComponentStory } from '@storybook/react';
import { Column, TableOptions, TableData, Async } from '@opendatasoft/visualizations';

import './custom-style.css';

import { Table } from '../../src';

import value from './data';
Expand Down
16 changes: 16 additions & 0 deletions packages/visualizations-react/stories/Table/custom-style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.table-story--custom-style .table-wrapper {
border-color: #fcd4cf;
}
.table-story--custom-style thead {
border-bottom-color: #f94346;
border-bottom-width: 2px;
background-color: #fd635d;
color:#ffffff;
}

.table-story--custom-style tbody tr {
border-bottom-color: #fcd4cf;
}
.table-story--custom-style tbody tr:hover {
background-color: #f9aea4;
}
1 change: 1 addition & 0 deletions packages/visualizations-react/test/__mocks__/styleMock.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = {};

1 comment on commit 2157be9

@github-actions
Copy link

Choose a reason for hiding this comment

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

Coverage for this commit

95.21%

Coverage Report
FileBranchesFuncsLinesUncovered Lines
src
   index.ts100%100%100%
src/client
   error.ts100%100%100%
   index.ts75.32%100%96.88%124, 13, 146, 148, 148–149, 15, 15, 151, 162, 169, 169, 17, 17, 171, 176, 179, 182, 184, 52, 82
   types.ts100%100%100%
src/odsql
   clauses.ts71.43%80%90.91%14, 32, 42
   index.ts83.72%95.65%94.12%111, 140, 25, 28, 56–57, 57, 57–58, 68, 78–79

Please sign in to comment.