feat(SW-375): new tokens
new asset generation logic BREAKING CHANGE: New tokens.
This commit is contained in:
@@ -1,35 +1,21 @@
|
||||
import { withoutVitePlugins } from '@storybook/builder-vite'
|
||||
|
||||
import { dirname, join } from 'path'
|
||||
import type { StorybookConfig } from '@storybook/react-vite'
|
||||
|
||||
const config: StorybookConfig = {
|
||||
stories: ['../lib/**/*.mdx', '../lib/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
|
||||
typescript: {
|
||||
check: false,
|
||||
reactDocgen: 'react-docgen-typescript',
|
||||
},
|
||||
staticDirs: ['../public'],
|
||||
addons: [
|
||||
'@storybook/addon-links',
|
||||
'@storybook/addon-essentials',
|
||||
'@storybook/addon-onboarding',
|
||||
'@storybook/addon-interactions',
|
||||
getAbsolutePath('@storybook/addon-essentials'),
|
||||
getAbsolutePath('@storybook/addon-interactions'),
|
||||
getAbsolutePath('@storybook/addon-links'),
|
||||
getAbsolutePath('@storybook/addon-themes'),
|
||||
],
|
||||
framework: {
|
||||
name: '@storybook/react-vite',
|
||||
name: getAbsolutePath('@storybook/react-vite'),
|
||||
options: {},
|
||||
},
|
||||
docs: {
|
||||
autodocs: true,
|
||||
},
|
||||
viteFinal: async (config) => {
|
||||
return {
|
||||
...config,
|
||||
plugins: await withoutVitePlugins(config.plugins, [
|
||||
'vite:lib-inject-css',
|
||||
'vite:dts',
|
||||
]),
|
||||
}
|
||||
},
|
||||
}
|
||||
export default config
|
||||
|
||||
function getAbsolutePath(value: string): any {
|
||||
return dirname(require.resolve(join(value, 'package.json')))
|
||||
}
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
import { addons } from '@storybook/manager-api'
|
||||
|
||||
addons.setConfig({
|
||||
sidebar: {
|
||||
collapsedRoots: ['current-web'],
|
||||
},
|
||||
})
|
||||
@@ -1,21 +0,0 @@
|
||||
import type { Preview } from '@storybook/react'
|
||||
|
||||
import '../lib/style-new.css'
|
||||
|
||||
const preview: Preview = {
|
||||
parameters: {
|
||||
controls: {
|
||||
matchers: {
|
||||
color: /(background|color)$/i,
|
||||
date: /Date$/i,
|
||||
},
|
||||
},
|
||||
options: {
|
||||
storySort: {
|
||||
order: ['*', 'Current web'],
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
export default preview
|
||||
37
packages/design-system/.storybook/preview.tsx
Normal file
37
packages/design-system/.storybook/preview.tsx
Normal file
@@ -0,0 +1,37 @@
|
||||
import { withThemeByClassName } from '@storybook/addon-themes'
|
||||
|
||||
import type { Preview, ReactRenderer } from '@storybook/react'
|
||||
|
||||
import '../lib/style.css'
|
||||
import '../lib/fonts.css'
|
||||
|
||||
export const themes = {
|
||||
themes: {
|
||||
Scandic: 'scandic',
|
||||
'Scandic Go': 'scandic-go',
|
||||
'Downtown Camper': 'downtown-camper',
|
||||
'Grand Hotel': 'grand-hotel',
|
||||
Haymarket: 'haymarket',
|
||||
'Hotel Norge': 'hotel-norge',
|
||||
Marski: 'marski',
|
||||
},
|
||||
defaultTheme: 'Scandic',
|
||||
}
|
||||
|
||||
const preview: Preview = {
|
||||
decorators: [withThemeByClassName<ReactRenderer>(themes)],
|
||||
parameters: {
|
||||
docs: {
|
||||
toc: true,
|
||||
},
|
||||
controls: { matchers: { color: /(background|color)$/i, date: /Date$/i } },
|
||||
options: {
|
||||
storySort: {
|
||||
order: ['Introduction', 'Global', 'Components', 'Compositions', '*'],
|
||||
},
|
||||
},
|
||||
},
|
||||
tags: ['autodocs'],
|
||||
}
|
||||
|
||||
export default preview
|
||||
Reference in New Issue
Block a user