Commit 068388c8 by krds-arun

chore(storybook): normalize quotes and formatting

parent 1b90df82
import type { StorybookConfig } from '@storybook/nextjs-vite'; import type { StorybookConfig } from "@storybook/nextjs-vite";
const config: StorybookConfig = { const config: StorybookConfig = {
stories: ['../components/**/*.stories.@(ts|tsx)'], stories: ["../components/**/*.stories.@(ts|tsx)"],
addons: [ addons: [
'@chromatic-com/storybook', "@chromatic-com/storybook",
'@storybook/addon-vitest', "@storybook/addon-vitest",
'@storybook/addon-a11y', "@storybook/addon-a11y",
'@storybook/addon-docs', "@storybook/addon-docs",
], ],
framework: '@storybook/nextjs-vite', framework: "@storybook/nextjs-vite",
staticDirs: ['../public'], staticDirs: ["../public"],
}; };
export default config; export default config;
import React from 'react' import type { Preview } from "@storybook/nextjs-vite";
import React from "react";
import type { Preview } from '@storybook/nextjs-vite' import "../../maf-uis/maf-ui/css/main.css";
import '../../maf-uis/maf-ui/css/main.css' const decorators: Preview["decorators"] = [
const decorators: Preview['decorators'] = [
(Story) => { (Story) => {
// The MAF theme CSS assumes a fixed header + bottom nav. In Storybook we render only the // The MAF theme CSS assumes a fixed header + bottom nav. In Storybook we render only the
// form canvas, so we remove that extra body padding for correct visual alignment. // form canvas, so we remove that extra body padding for correct visual alignment.
if (typeof document !== 'undefined') { if (typeof document !== "undefined") {
document.body.style.paddingTop = '0px' document.body.style.paddingTop = "0px";
document.body.style.paddingBottom = '0px' document.body.style.paddingBottom = "0px";
} }
return React.createElement( return React.createElement(
'div', "div",
{ {
style: { style: {
minHeight: '100vh', minHeight: "100vh",
background: 'var(--ink)', background: "var(--ink)",
padding: '24px', padding: "24px",
}, },
}, },
React.createElement(Story) React.createElement(Story),
) );
}, },
] ];
const preview: Preview = { const preview: Preview = {
decorators, decorators,
parameters: { parameters: {
backgrounds: { backgrounds: {
default: 'dark', default: "dark",
values: [ values: [
{ {
name: 'dark', name: "dark",
value: '#0a0a0c', value: "#0a0a0c",
}, },
{ {
name: 'light', name: "light",
value: '#f8f9fa', value: "#f8f9fa",
}, },
], ],
}, },
controls: { controls: {
matchers: { matchers: {
color: /(background|color)$/i, color: /(background|color)$/i,
date: /Date$/i, date: /Date$/i,
}, },
}, },
...@@ -54,9 +53,9 @@ const preview: Preview = { ...@@ -54,9 +53,9 @@ const preview: Preview = {
// 'todo' - show a11y violations in the test UI only // 'todo' - show a11y violations in the test UI only
// 'error' - fail CI on a11y violations // 'error' - fail CI on a11y violations
// 'off' - skip a11y checks entirely // 'off' - skip a11y checks entirely
test: 'todo' test: "todo",
} },
}, },
}; };
export default preview; export default preview;
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment