Files
web/packages/design-system/.storybook/preview.tsx
Bianca Widstam 5f8d77e54a Merged in fix/SW-1655-tripadvisor-icon-map (pull request #2695)
fix(SW-1655): update design tripadvisor on hotel map card

* fix(SW-1655): update design tripadvisor on hotel map card

* fix(SW-1655): update radius

* fix(SW-1655): use tripadvisor chip, create different variants

* fix(SW-1655): update variants, storybook, and global css


Approved-by: Joakim Jäderberg
2025-08-26 13:08:28 +00:00

78 lines
2.2 KiB
TypeScript

import { withThemeByClassName } from '@storybook/addon-themes'
import { IntlProvider } from 'react-intl'
import type { Preview, ReactRenderer } from '@storybook/nextjs-vite'
import { reactIntl } from './reactIntl'
import '../lib/fonts.css'
import '../lib/normalize.css'
import '../lib/style.css'
import '../lib/design-system-new-deprecated.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: [
// Theme decorator
withThemeByClassName<ReactRenderer>(themes),
(Story) => (
// eslint-disable-next-line @typescript-eslint/no-explicit-any
<IntlProvider locale="en" {...(reactIntl as any)}>
<Story />
</IntlProvider>
),
],
initialGlobals: {
locale: reactIntl.defaultLocale,
locales: {
en: { icon: '🇬🇧', title: 'English', right: 'EN' },
sv: { icon: '🇸🇪', title: 'Svenska', right: 'SV' },
da: { icon: '🇩🇰', title: 'Dansk', right: 'DA' },
no: { icon: '🇳🇴', title: 'Norsk', right: 'NO' },
fi: { icon: '🇫🇮', title: 'Suomi', right: 'FI' },
de: { icon: '🇩🇪', title: 'Deutsch', right: 'DE' },
},
backgrounds: { value: 'scandicSubtle' },
},
parameters: {
reactIntl,
nextjs: {
appDirectory: true,
},
docs: {
toc: true,
},
controls: { matchers: { color: /(background|color)$/i, date: /Date$/i } },
options: {
storySort: {
order: ['Introduction', 'Global', 'Components', 'Compositions', '*'],
},
},
backgrounds: {
options: {
// 👇 Scandic
scandicPrimary: { name: 'Scandic Primary', value: '#FAF6F2' },
scandicSubtle: { name: 'Scandic Subtle', value: '#F2ECE6' },
scandicPrimaryDark: { name: 'Scandic Primary Dark', value: '#4D001B' },
// 👇 Default values
storybookDark: { name: 'Storybook Dark', value: '#333' },
storybookLight: { name: 'Storybook Light', value: '#F7F9F2' },
},
},
},
tags: ['autodocs'],
}
export default preview