feat(gui-v2): Storybook stories for the v2 shell components
This commit is contained in:
@@ -1,28 +1,41 @@
|
||||
import type { Preview } from '@storybook/vue3-vite'
|
||||
import { setup } from '@storybook/vue3-vite'
|
||||
|
||||
import { createMemoryHistory, createRouter } from 'vue-router'
|
||||
import { installPrimeVue } from '../src/plugins/primevue'
|
||||
|
||||
// Side-effect: bootstrap the Tabler set so @iconify/vue <Icon> renders
|
||||
// real SVG in Storybook (mirrors main.ts; preview.ts is the SB entry).
|
||||
import '../src/plugins/iconify'
|
||||
|
||||
import '../src/assets/styles/tailwind.css'
|
||||
|
||||
const noop = { template: '<div />' }
|
||||
const routeNames = [
|
||||
'dashboard', 'events', 'organisation', 'members',
|
||||
'organisation-companies', 'organisation-form-failures',
|
||||
'organisation-settings', 'platform', 'platform-organisations',
|
||||
'platform-users', 'platform-form-failures', 'platform-activity-log',
|
||||
]
|
||||
|
||||
export const storyRouter = createRouter({
|
||||
history: createMemoryHistory(),
|
||||
routes: [
|
||||
{ path: '/', name: 'home', component: noop },
|
||||
...routeNames.map(name => ({ path: `/${name}`, name, component: noop })),
|
||||
{ path: '/:pathMatch(.*)*', name: 'catchall', component: noop },
|
||||
],
|
||||
})
|
||||
|
||||
setup((app) => {
|
||||
installPrimeVue(app)
|
||||
app.use(storyRouter)
|
||||
})
|
||||
|
||||
const preview: Preview = {
|
||||
parameters: {
|
||||
controls: {
|
||||
matchers: {
|
||||
color: /(background|color)$/i,
|
||||
date: /Date$/i,
|
||||
},
|
||||
},
|
||||
docs: {
|
||||
toc: true,
|
||||
},
|
||||
a11y: {
|
||||
test: 'todo',
|
||||
},
|
||||
controls: { matchers: { color: /(background|color)$/i, date: /Date$/i } },
|
||||
docs: { toc: true },
|
||||
a11y: { test: 'todo' },
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user