58 lines
1.3 KiB
TypeScript
58 lines
1.3 KiB
TypeScript
import type { Preview } from '@storybook/vue3-vite'
|
|
import { setup } from '@storybook/vue3-vite'
|
|
import PrimeVue from 'primevue/config'
|
|
import '@nychthemeron/library/theme'
|
|
|
|
setup((app) => {
|
|
app.use(PrimeVue, { unstyled: true })
|
|
})
|
|
|
|
const preview: Preview = {
|
|
parameters: {
|
|
layout: 'centered',
|
|
toolbar: {
|
|
theme: {
|
|
items: [
|
|
{ value: 'hades', title: 'Dark (Hades)', left: '🌙' },
|
|
{ value: 'apollo', title: 'Light (Apollo)', left: '☀️' },
|
|
],
|
|
dynamicTitle: true,
|
|
},
|
|
},
|
|
docs: {
|
|
description: {
|
|
component: 'Component documentation',
|
|
},
|
|
},
|
|
},
|
|
decorators: [
|
|
(story, context) => {
|
|
const theme = context.globals.theme || 'hades'
|
|
|
|
return {
|
|
setup() {
|
|
document.documentElement.setAttribute('data-theme', theme)
|
|
},
|
|
components: { story },
|
|
template: '<story />',
|
|
}
|
|
},
|
|
],
|
|
globalTypes: {
|
|
theme: {
|
|
name: 'Theme',
|
|
description: 'Global theme for all components',
|
|
defaultValue: 'hades',
|
|
toolbar: {
|
|
icon: 'paintbrush',
|
|
items: [
|
|
{ value: 'hades', title: 'Dark (Hades)' },
|
|
{ value: 'apollo', title: 'Light (Apollo)' },
|
|
],
|
|
dynamicTitle: true,
|
|
},
|
|
},
|
|
},
|
|
}
|
|
|
|
export default preview
|