feat(gnosis-vue): Add shared story meta files, update React stories, and add Vue 3 Storybook with stories#630
Conversation
- Create 35 shared .meta.ts files in src/components/ with pure TypeScript Storybook meta configurations and per-story args (no JSX, no framework imports) - Add gnosis-vue/.storybook/preview.ts configuring veaury React integration - Create 18 Vue story files in gnosis-vue/src/stories/ importing from shared metas - Update gnosis-vue/package.json with Storybook devDependencies and scripts Co-authored-by: Copilot <[email protected]>
Co-authored-by: marios-tsigkas <[email protected]>
… from meta files Co-authored-by: marios-tsigkas <[email protected]>
…orybook and Vite dependencies. Refactor Vite config for improved aliasing and update index.ts to wrap React components with theme support.
…all React components Ensuring theme support is consistently applied. Update import statement for React to use namespace import.
…ating component wrapping
…/epignosis/gnosis into copilot/add-shared-meta-files
…s-vue-directory' of https://github.com/epignosis/gnosis into copilot/add-shared-meta-files
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0ecc1a87aa
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ), | ||
| ], | ||
| }; | ||
| export default { ...drawerMeta, component: DrawerComponent }; |
There was a problem hiding this comment.
Restore Drawer portal root in story metadata
The default export no longer includes the decorator that rendered <DrawerComponent.Root />, so this story no longer creates the #drawerRoot node required by Drawer's portal logic in Drawer.tsx (document.getElementById("drawerRoot")). In Storybook this means clicking “Open Drawer” does not render the drawer content at all, because the component returns null when the root element is missing.
Useful? React with 👍 / 👎.
| @@ -0,0 +1,41 @@ | |||
| import { colors } from "@theme/default/colors"; | |||
There was a problem hiding this comment.
Avoid unresolved @theme imports in shared meta
This shared meta file now imports @theme/default/colors, but it is consumed by gnosis-vue/src/stories/* under gnosis-vue/tsconfig.json, which has no paths mapping for @theme. As a result, vue-tsc --noEmit for gnosis-vue fails with TS2307 when it type-checks these imported meta files (same pattern also appears in Chip/Tag meta), breaking the package build pipeline.
Useful? React with 👍 / 👎.
Description
Extracts Storybook configuration from all React stories into shared
.meta.tsfiles (pure TS, no JSX/framework imports), enabling both React and Vue Storybooks to consume the sametitle,argTypes,args, and per-story arg objects from a single source of truth.Changes
Shared
.meta.tsfiles —src/components/**/*.meta.ts(35 files)*Metaobject and named per-story arg objectsReact stories updated —
src/components/**/*.stories.tsx(35 files)export defaultnow spreads the imported meta and addscomponent:.argsreplaced with named imports from the.meta.tsVue Storybook config —
gnosis-vue/.storybook/main.ts— already present; left unchangedpreview.ts— new; initialises veaury'screateRootfor React-in-Vue renderingVue stories —
gnosis-vue/src/stories/(18 files)src/components/and renders via Vuetemplatestrings withv-bind/v-modelFixes
Original prompt
Summary
Add Vue 3 Storybook setup and shared story metadata to the existing
gnosis-vue/package on thecopilot/add-gnosis-vue-directorybranch in the epignosis/gnosis repo (PR #629).What to do
1. Create shared
.meta.tsfiles for existing React componentsExtract the non-JSX parts (title, argTypes, args, per-story arg objects) from existing React
.stories.tsxfiles into new.meta.tsfiles next to them. These files should export plain objects with NO framework-specific code (no React, no Vue, no JSX).Create
.meta.tsfiles for ALL components that currently have.stories.tsxfiles. Look at each existing story file and extract:Here are examples of the pattern to follow:
src/components/Button/Button.meta.ts— extract fromsrc/components/Button/Button.stories.tsx:src/components/FormElements/Input/Input.meta.ts— extract fromsrc/components/FormElements/Input/Input.stories.tsx:Do this for ALL components with stories: Alert, Avatar, Badge, Breadcrumbs, Button, Card, Chip, Drawer, Dropdown, Grid, Heading, Loader, Modal, Pagination, ProgressBar, Result, Sidebar, StatusTag, Tabs, Tag, Text, Toast, Tooltip, and all FormElements (Checkbox, CheckboxGroup, Input, RadioButtonGroup, RadioGroup, Select, Textarea, ToggleSwitch).
2. Update existing React
.stories.tsxfiles to import from.meta.tsUpdate each React story file to import the meta and args from its
.meta.tsfile instead of defining them inline. The JSX templates stay unchanged. For example,Button.stories.tsxwould change itsexport defaultto use the importedbuttonMetaand each story's.argsto use the imported arg objects.3. Create Vue Storybook config files
gnosis-vue/.storybook/main.ts:Note: This file may already exist from a previous commit. If so, keep it as-is.
gnosis-vue/.storybook/preview.ts:4. Create Vue story files in
gnosis-vue/src/stories/Create Vue stories that import from the shared
.meta.tsfiles and use Vue templates. Create stories for the key components: Button, Input, Select...This pull request was created from Copilot chat.
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.