Skip to content

Commit

Permalink
feat(theme): add teradata theming
Browse files Browse the repository at this point in the history
  • Loading branch information
owilliams320 committed Aug 2, 2024
1 parent 70ac5b0 commit 183fbb3
Show file tree
Hide file tree
Showing 8 changed files with 100 additions and 11 deletions.
4 changes: 3 additions & 1 deletion libs/react-components/.storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import type { StorybookConfig } from '@storybook/react-vite';
import { resolve } from 'path';
import { join, resolve } from 'path';
import { terser } from 'rollup-plugin-terser';

const config: StorybookConfig = {
stories: ['../src/lib/**/*.stories.@(js|jsx|ts|tsx|mdx)'],

staticDirs: [join(__dirname, './public')],

addons: [
'@storybook/addon-essentials',
'@storybook/addon-interactions',
Expand Down
8 changes: 8 additions & 0 deletions libs/react-components/.storybook/manager.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { addons } from '@storybook/manager-api';
import '@covalent/tokens/index.css';
import tdTheme from './theme.js';
import './theme.css';

addons.setConfig({
theme: tdTheme,
});
Binary file not shown.
13 changes: 13 additions & 0 deletions libs/react-components/.storybook/teradata.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions libs/react-components/.storybook/theme.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/* Storybook theme overrides */
.sidebar-header {
max-width: 213px;
}
#root > div > div[role='main'] > div {
box-shadow: none;
}

#root > div > div[role='main'] > div {
border: 1px solid rgba(0, 0, 0, 0.12);
}

#storybook-explorer-tree .sidebar-item[data-selected='true'],
#storybook-explorer-tree .sidebar-item[data-selected='true'] svg {
color: var(--cv-light-on-primary);
}

#storybook-explorer-tree .sidebar-item[data-selected='true'],
#storybook-explorer-tree .sidebar-item[data-selected='true'] svg {
color: var(--cv-light-on-primary);
}

#storybook-explorer-tree .sidebar-item[data-selected='false'] svg {
color: var(--cv-light-secondary);
}
41 changes: 41 additions & 0 deletions libs/react-components/.storybook/theme.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import { create } from '@storybook/theming';
import brandImage from './teradata.svg';
import {
CvLightPrimary,
CvLightAccent,
CvLightSurface,
CvLightBackground,
CvDarkOnBackground,
CvLightOnBackground,
CvLightTextIconOnBackground,
} from '@covalent/tokens';

export default create({
base: 'light',

colorPrimary: CvLightPrimary,
colorSecondary: CvLightAccent,

// UI
appBg: CvLightBackground,
appContentBg: CvLightSurface,
appBorderRadius: '8px',

// Text colors
textColor: CvLightOnBackground,
textInverseColor: CvDarkOnBackground,

// Toolbar default and active colors
barTextColor: CvLightTextIconOnBackground,
barSelectedColor: CvLightPrimary,
barHoverColor: CvLightAccent,
barBg: CvLightSurface,

// Form colors
inputBg: 'transparent',

// Branding
brandTitle: 'Teradata Design System',
// brandUrl: 'https://teradata.lol',
brandImage,
});
16 changes: 8 additions & 8 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
"@babel/plugin-transform-react-jsx": "^7.23.4",
"@babel/preset-react": "^7.14.5",
"@chromatic-com/storybook": "^1.5.0",
"@covalent/components": "^8.13.0",
"@covalent/tokens": "^8.13.0",
"@covalent/components": "^8.18.0",
"@covalent/tokens": "^8.18.0",
"@lit/react": "^1.0.5",
"@nx/cypress": "19.0.0",
"@nx/eslint": "19.0.0",
Expand Down

0 comments on commit 183fbb3

Please sign in to comment.