Skip to content

Commit

Permalink
Merge pull request #610 from equinor/feat/select-variants
Browse files Browse the repository at this point in the history
Added variants to select components
  • Loading branch information
mariush2 committed Jun 27, 2024
2 parents 8e30872 + 8f0a1ac commit ef27c22
Show file tree
Hide file tree
Showing 37 changed files with 1,908 additions and 2,445 deletions.
17 changes: 14 additions & 3 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const config = {
stories: ['../src/intro.mdx', '../src/**/*.stories.@(ts|tsx)'],

addons: [
'@storybook/addon-links',
'@storybook/addon-essentials',
Expand All @@ -9,19 +10,24 @@ const config = {
'storybook-addon-data-theme-switcher',
'storybook-addon-react-docgen',
'./addons/GitHubSearchAddon/manager.js',
'@storybook/addon-mdx-gfm'
],

build: {
sourcemap: false,
},

core: {},

framework: {
name: '@storybook/react-vite',
options: {},
},
docs: {
autodocs: true,
},

docs: {},

staticDirs: ['../static'],

async viteFinal(config) {
return {
...config,
Expand All @@ -39,9 +45,14 @@ const config = {
},
};
},

env: () => ({
VITE_IS_MOCK: 'true',
}),

typescript: {
reactDocgen: 'react-docgen-typescript'
}
};

export default config;
9 changes: 8 additions & 1 deletion .storybook/preview.jsx → .storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import Template from 'src/components/Template/Template';
import { darkTokens } from 'src/style/darkTokens';
import { spacingTokens } from 'src/style/spacingTokens';
import { SnackbarProvider } from 'src/providers/SnackbarProvider';
import { Preview, StoryFn } from '@storybook/react';

const { colors } = tokens;

Expand All @@ -19,7 +20,7 @@ export const globalTypes = {
};

export const decorators = [
(Story) => {
(Story: StoryFn) => {
// Apply styles using the darkTokens variable
const darkStyleElement = document.createElement('style');
darkStyleElement.innerHTML = darkTokens;
Expand Down Expand Up @@ -58,3 +59,9 @@ export const parameters = {
],
},
};

const preview: Preview = {
tags: ['autodocs']
};

export default preview;
Loading

0 comments on commit ef27c22

Please sign in to comment.