Skip to content

Commit

Permalink
Storybook: Try to fix react-docgen-typescript.
Browse files Browse the repository at this point in the history
  • Loading branch information
filiphsps committed Sep 29, 2024
1 parent 3011ba6 commit d168a21
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 9 deletions.
5 changes: 5 additions & 0 deletions .changeset/flat-coins-breathe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@nordcom/nordstar-storybook': patch
---

- Try to fix `react-docgen-typescript`.
2 changes: 1 addition & 1 deletion packages/storybook/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
.vercel
storybook-static
storybook-static/
4 changes: 2 additions & 2 deletions packages/storybook/.storybook/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@
--font-fallback: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Ubuntu, Cantarell,
'Helvetica Neue', sans-serif;
--font-sans: 'Montserrat', sans-serif;

--font-primary: 'Montserrat', sans-serif;

background: var(--color-background);
color: var(--color-foreground);
font-family: var(--font-heading);
font-family: 'Montserrat', sans-serif;
font-size: 16px;
}

Expand All @@ -21,6 +20,7 @@
}

body {
font-family: 'Montserrat', sans-serif;
color: hsl(var(--color-foreground));
background-color: hsl(var(--color-background));
}
Expand Down
6 changes: 2 additions & 4 deletions packages/storybook/.storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { StorybookConfig } from '@storybook/react-vite';
import path from 'node:path';

const config: StorybookConfig = {
stories: ['../../**/src/**/*.mdx', '../../**/src/**/*.stories.@(ts|tsx)'],
Expand All @@ -26,10 +25,9 @@ const config: StorybookConfig = {
typescript: {
reactDocgen: 'react-docgen-typescript',
reactDocgenTypescriptOptions: {
shouldExtractLiteralValuesFromEnum: true,
tsconfigPath: path.resolve(path.join(process.cwd().split('/packages')[0], 'tsconfig.json'))
shouldExtractLiteralValuesFromEnum: true
},
check: true
check: false
},
docs: {
defaultName: 'Documentation',
Expand Down
19 changes: 19 additions & 0 deletions packages/storybook/.storybook/manager-head.html
Original file line number Diff line number Diff line change
@@ -1 +1,20 @@
<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=Montserrat:ital,wght@0,100..900;1,100..900&display=swap" rel="stylesheet">

<meta name="robots" content="noindex" />

<style>
:root {
--font-sans: Montserrat, sans-serif;
--font-fallback: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Ubuntu, Cantarell,
'Helvetica Neue', sans-serif;
}

body {
font-family: 'Montserrat', sans-serif;
font-size: 16px;
font-optical-sizing: auto;
}
</style>
4 changes: 2 additions & 2 deletions packages/storybook/.storybook/manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const darkTheme: Theme = create({
buttonBorder: '#ed1e79',
colorPrimary: '#ed1e79',
colorSecondary: '#ed1e79',
fontBase: 'var(--font-sans, var(--font-fallback))',
fontBase: "'Montserrat', sans-serif",
fontCode: 'var(--font-mono)',
gridCellSize: 8,
inputBg: '#000000',
Expand Down Expand Up @@ -62,7 +62,7 @@ export const lightTheme: Theme = create({
buttonBorder: '#ed1e79',
colorPrimary: '#ed1e79',
colorSecondary: '#ed1e79',
fontBase: 'var(--font-sans, var(--font-fallback))',
fontBase: "'Montserrat', sans-serif",
fontCode: 'var(--font-mono)',
gridCellSize: 8,
inputBg: '#fefefe',
Expand Down
5 changes: 5 additions & 0 deletions packages/storybook/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"$schema": "https://json.schemastore.org/tsconfig.json",
"extends": "../../tsconfig.json",
"references": [{ "path": "../../tsconfig.json" }]
}

0 comments on commit d168a21

Please sign in to comment.