Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,19 @@ const config: StorybookConfig = {
],
framework: '@storybook/react-webpack5',
staticDirs: ['.', '../src'],
typescript: {
reactDocgen: 'react-docgen-typescript',
reactDocgenTypescriptOptions: {
shouldExtractLiteralValuesFromEnum: true,
shouldRemoveUndefinedFromOptional: true,
propFilter: (prop) => {
if (prop.parent) {
return !prop.parent.fileName.includes('node_modules');
}
return true;
}
}
},
webpackFinal: async (config) => {
if (!config.resolve) config.resolve = {};
if (!config.resolve.alias || Array.isArray(config.resolve.alias)) {
Expand Down
3 changes: 1 addition & 2 deletions .storybook/manager-head.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@
name="description"
content="Design System oficial do Devtranslate. Conjunto de componentes React reutilizáveis e padronizados para criar interfaces consistentes e acessíveis."
/>
<link rel="icon" href="https://devtranslate.io/favicon.ico" />
<link rel="icon" href="https://devtranslate.io/favicon.ico" type="image/ico" />
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap"
rel="stylesheet"
/>

<style>
.sidebar-header img {
max-height: 1.5rem;
Expand Down
6 changes: 6 additions & 0 deletions .storybook/preview-head.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,9 @@
href="https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap"
rel="stylesheet"
/>
<style>
h2:not(.sb-anchor, .sb-unstyled, .sb-unstyled h2) {
padding-bottom: 12px;
font-weight: 700;
}
</style>
14 changes: 8 additions & 6 deletions .storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,10 @@ const preview: Preview = {
}
},
backgrounds: {
default: 'Claro',
values: [
{ name: 'Claro', value: theme.color.gray[50] },
{ name: 'Escuro', value: theme.color.gray[900] }
]
options: {
light: { name: 'Light', value: theme.color.gray[50] },
dark: { name: 'Dark', value: theme.color.gray[900] }
}
},
docs: {
theme: storybookTheme
Expand All @@ -53,7 +52,10 @@ const preview: Preview = {
<Story {...context} />
</ThemeProvider>
)
]
],
initialGlobals: {
backgrounds: { value: 'light' }
}
};

export default preview;
Loading