Files
web/packages/design-system/.storybook/preview.tsx
Joakim Jäderberg f531c7a49f Merged in feature/storybook-tests (pull request #2623)
Feature/storybook tests

* feature: add interaction tests for storybook and upgrade storybook@9

* add a11y testing for storybook

* Merge branch 'master' of bitbucket.org:scandic-swap/web into feature/storybook-tests

* Test and build only required packages

* .

* .

* .

* .

* .

* .

* .

* disable playwright tests in netlify ci

* .

* debug out process.env

* don't run playwright on CI

* remove unused netlify-plugin-playwright-cache

* .

* .

* .

* .

* .

* .

* remove turbo dependancy to design-system#test

* merge

* merge


Approved-by: Anton Gunnarsson
2025-08-14 06:25:08 +00:00

50 lines
1.3 KiB
TypeScript

import { withThemeByClassName } from '@storybook/addon-themes'
import type { Preview, ReactRenderer } from '@storybook/react-vite'
import '../lib/fonts.css'
import '../lib/style.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', '*'],
},
},
backgrounds: {
values: [
// 👇 Scandic
{ name: 'Scandic Primary', value: '#FAF6F2' },
{ name: 'Scandic Subtle', value: '#F2ECE6' },
{ name: 'Scandic Primary Dark', value: '#4D001B' },
// 👇 Default values
{ name: 'Storybook Dark', value: '#333' },
{ name: 'Storybook Light', value: '#F7F9F2' },
],
default: 'Scandic Primary',
},
},
tags: ['autodocs'],
}
export default preview