@pstdio/ui
v0.40.0
Published
Shared React UI package for Prompt Studio apps. This package owns:
Readme
@pstdio/ui
Shared React UI package for Prompt Studio apps. This package owns:
- reusable components
- design tokens and Chakra theme configuration
- Storybook stories used as UI test cases
Run Locally
From repo root:
bun run storybook:uiFrom packages/ui:
bun run storybookBuild distributable package:
bun run --cwd packages/ui buildRun Storybook tests:
bun run --cwd packages/ui test-storybookPackage Layout
src/components/*: components and colocated stories (*.stories.tsx)src/theme/*: theme, recipes, tokens, and theme helperssrc/index.ts: public exports for@pstdio/ui.storybook/*: Storybook configuration and Vitest setup
The root entry holds the light, widely reused components. A feature that pulls a
heavy dependency, such as the Lexical editor, Monaco, Mermaid, or the terminal,
gets its own entry: ./rich-text, ./param-editor, ./kanban-renderer,
./data-table, ./chat-ui, ./diff, ./mermaid, ./terminal. Nothing reachable
from the root entry may import one of those, or every consumer's bundler emits the
heavy chunks even when the consumer never renders the feature.
Contributor Workflow
- Implement or update the component in
src/components. - Add or update stories next to the component to cover important user-visible states.
- If the component is public, export it from
src/index.ts, or from the entry that owns its heavy dependency. - If you add a new package entrypoint, update
package.json#exports. - Run validations before opening a PR.
Validation Checklist
From repo root:
bun run format
bun run lint
bun run build
bun run testUI-specific check:
bun run --cwd packages/ui test-storybookStory Guidelines
- Treat each story as a reproducible test case for a real UI state.
- Include states like default, loading, empty, error, long content, and disabled where relevant.
- For non-visual behavior, add
playinteractions and assertions in the story. - Keep stories deterministic: avoid real network calls.
