mirror of
https://github.com/bitwarden/browser
synced 2025-12-06 00:13:28 +00:00
* rearrange button docs * Enhance avatar docs * Enhance badge docs * Enhance banner docs * add util to format args for snippets * update banner snippets * WIP * bind boolean args so they work correctly in Storybook * simplify button stories * Update callout docs * use title component for checkbox docs * use title and description component for chip select docs * update color password story docs * update disclosure docs * add import to icon docs * updated icon-button docs * update link docs * Update prgress docs * updated search field docs * remove html type definitions * add import for progress * updated toast docs * remove example from docs. format args for snippet * Update badges docs * handle array arg values correctly * Update badges list docs * fix dupe key error from taost story * remove unnecessary typeof check * remove banner usage example * add breadcrumbs import statement and jsdoc * add color password import statement * fixing type mismaches * fix typos * Add missing generics to format function * fix typo * update callout icon spacing to match Figma * add back max width container
58 lines
1.2 KiB
TypeScript
58 lines
1.2 KiB
TypeScript
import { setCompodocJson } from "@storybook/addon-docs/angular";
|
|
import { withThemeByClassName } from "@storybook/addon-themes";
|
|
import { componentWrapperDecorator } from "@storybook/angular";
|
|
import type { Preview } from "@storybook/angular";
|
|
|
|
import docJson from "../documentation.json";
|
|
setCompodocJson(docJson);
|
|
|
|
const wrapperDecorator = componentWrapperDecorator((story) => {
|
|
return /*html*/ `
|
|
<div class="tw-bg-background tw-px-5 tw-py-10">
|
|
${story}
|
|
</div>
|
|
`;
|
|
});
|
|
|
|
const preview: Preview = {
|
|
decorators: [
|
|
withThemeByClassName({
|
|
themes: {
|
|
light: "theme_light",
|
|
dark: "theme_dark",
|
|
},
|
|
defaultTheme: "light",
|
|
}),
|
|
wrapperDecorator,
|
|
],
|
|
parameters: {
|
|
a11y: {
|
|
element: "#storybook-root",
|
|
},
|
|
controls: {
|
|
matchers: {
|
|
color: /(background|color)$/i,
|
|
date: /Date$/,
|
|
},
|
|
},
|
|
options: {
|
|
storySort: {
|
|
method: "alphabetical",
|
|
order: ["Documentation", ["Introduction", "Colors", "Icons"], "Component Library"],
|
|
},
|
|
},
|
|
docs: {
|
|
source: {
|
|
type: "dynamic",
|
|
excludeDecorators: true,
|
|
},
|
|
},
|
|
backgrounds: {
|
|
disable: true,
|
|
},
|
|
},
|
|
tags: ["autodocs"],
|
|
};
|
|
|
|
export default preview;
|