One-time prettier --write so the new format:check CI gate starts green. .prettierignore excludes generated (api-client.ts, documentation.json), vendored (public/cibg-huisstijl), and backend (dotnet format owns it). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
32 lines
1.2 KiB
TypeScript
32 lines
1.2 KiB
TypeScript
import type { Preview } from '@storybook/angular';
|
|
import { componentWrapperDecorator } from '@storybook/angular';
|
|
import { setCompodocJson } from '@storybook/addon-docs/angular';
|
|
import docJson from '../documentation.json';
|
|
setCompodocJson(docJson);
|
|
|
|
// Activate CIBG's official palette in the story iframe. The override is `body.brand--cibg`,
|
|
// so it must sit on <body> (a wrapper <div> won't match) — mirrors index.html.
|
|
if (typeof document !== 'undefined') document.body.classList.add('brand--cibg');
|
|
|
|
const preview: Preview = {
|
|
// CIBG/Bootstrap styles bare elements — no theme wrapper class needed; just pad.
|
|
// The token bridge lives in styles.scss (loaded via the app build target).
|
|
decorators: [componentWrapperDecorator((story) => `<div style="padding:1.5rem">${story}</div>`)],
|
|
parameters: {
|
|
layout: 'padded',
|
|
// Accessibility (axe) via @storybook/addon-a11y. Runs WCAG 2.0/2.1 A+AA rule
|
|
// sets on every story; flag violations in the a11y panel.
|
|
a11y: {
|
|
config: { runOnly: { type: 'tag', values: ['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa'] } },
|
|
},
|
|
controls: {
|
|
matchers: {
|
|
color: /(background|color)$/i,
|
|
date: /Date$/i,
|
|
},
|
|
},
|
|
},
|
|
};
|
|
|
|
export default preview;
|