@idia-ui/storybook-docs
v0.3.0
Published
Static Storybook doc, props, and anatomy fragments for idia-ui consumer apps
Readme
@idia-ui/storybook-docs
Static Storybook documentation fragments for idia-ui consumer apps.
The package is generated from ds-brain/.generated/storybook and ships the consumer-facing catalog without requiring the full idia-ui monorepo.
Catalog
| Artifact | Count | | --- | ---: | | Component docs | 75 | | Foundation docs | 10 | | Pattern docs | 17 | | Props JSON | 75 | | Anatomy JSON | 75 |
Runtime API
import {
BrainDocSections,
BRAIN_FRAGMENT_IDS,
FOUNDATION_FRAGMENT_IDS,
PATTERN_FRAGMENT_IDS,
getAnatomyFragment,
getBrainFragment,
getBrainProps,
} from '@idia-ui/storybook-docs'getBrainFragment(id) returns raw generated markdown for component, foundation, and pattern IDs. BrainDocSections renders selected markdown sections for a supplied entity ID.
Props and anatomy metadata are available through getBrainProps(id), getBrainPropsFragment(id), and getAnatomyFragment(id).
Raw Fragments
The published package includes raw files under exported subpaths:
import buttonDoc from '@idia-ui/storybook-docs/fragments/components/button.md'
import colorDoc from '@idia-ui/storybook-docs/fragments/foundations/color.md'
import formsDoc from '@idia-ui/storybook-docs/fragments/patterns/forms.md'
import buttonProps from '@idia-ui/storybook-docs/fragments/props-fragment/button.json'
import buttonAnatomy from '@idia-ui/storybook-docs/fragments/anatomy-fragments/button.json'Consumers need the usual bundler loaders for raw Markdown imports. JSON imports use the host bundler/runtime JSON support.
Bundle Strategy
src/generated/fragments.ts uses eager static maps instead of import.meta.glob. This preserves the existing synchronous API and keeps the package bundler-neutral for Storybook consumers that are not on Vite.
