feat: structure
This commit is contained in:
+6
-2
@@ -4,6 +4,7 @@ import type { StorybookConfig } from 'storybook-react-rsbuild';
|
||||
const config: StorybookConfig = {
|
||||
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(ts|tsx)'],
|
||||
addons: ['@storybook/addon-docs'],
|
||||
staticDirs: ['../src/assets'],
|
||||
framework: {
|
||||
name: 'storybook-react-rsbuild',
|
||||
options: {},
|
||||
@@ -13,9 +14,12 @@ const config: StorybookConfig = {
|
||||
reactDocgen: 'react-docgen-typescript',
|
||||
reactDocgenTypescriptOptions: {
|
||||
shouldExtractLiteralValuesFromEnum: true,
|
||||
// Keep our own props; drop the noise inherited from node_modules.
|
||||
// Keep our own props + Radix primitives; drop other node_modules noise.
|
||||
propFilter: (prop) =>
|
||||
prop.parent ? !/node_modules/.test(prop.parent.fileName) : true,
|
||||
prop.parent
|
||||
? !/node_modules/.test(prop.parent.fileName) ||
|
||||
/node_modules\/radix-ui/.test(prop.parent.fileName)
|
||||
: true,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
<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=Onest:wght@300;400;500;600;700;800&family=Geist+Mono:wght@400;500;600&display=swap" rel="stylesheet">
|
||||
<style>
|
||||
@font-face {
|
||||
font-family: 'Anta';
|
||||
src: url('/Anta-Regular.ttf') format('truetype');
|
||||
font-weight: 400;
|
||||
font-style: normal;
|
||||
font-display: swap;
|
||||
}
|
||||
</style>
|
||||
@@ -2,8 +2,9 @@ import { useEffect, type ReactNode } from 'react';
|
||||
import type { Preview, Decorator } from 'storybook-react-rsbuild';
|
||||
import { Tooltip } from 'radix-ui';
|
||||
|
||||
/* The shipped library surface, exactly as a consumer would load it. */
|
||||
import '../src/styles/fonts.css';
|
||||
/* The shipped library surface, exactly as a consumer would load it.
|
||||
Fonts are loaded via preview-head.html (Google Fonts link + Anta @font-face)
|
||||
to avoid bundler inlining the @import url() mid-stylesheet. */
|
||||
import '../src/styles/index.css';
|
||||
/* Storybook-only canvas styling (background, docs blocks). */
|
||||
import './preview.css';
|
||||
|
||||
Reference in New Issue
Block a user