Skip to content

Commit

Permalink
chore(storybook): 📝 build registry with new stories
Browse files Browse the repository at this point in the history
  • Loading branch information
lloydrichards committed Sep 28, 2023
1 parent d43370a commit 9896354
Show file tree
Hide file tree
Showing 78 changed files with 202 additions and 87 deletions.
44 changes: 22 additions & 22 deletions apps/www/__registry__/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const Index: Record<string, any> = {
type: "components:ui",
registryDependencies: undefined,
component: React.lazy(() => import("@/registry/default/ui/alert")),
files: ["registry/default/ui/alert.tsx"],
files: ["registry/default/ui/alert.tsx","registry/stories/alert.stories.tsx"],
},
"alert-dialog": {
name: "alert-dialog",
Expand Down Expand Up @@ -45,7 +45,7 @@ export const Index: Record<string, any> = {
type: "components:ui",
registryDependencies: undefined,
component: React.lazy(() => import("@/registry/default/ui/badge")),
files: ["registry/default/ui/badge.tsx"],
files: ["registry/default/ui/badge.tsx","registry/stories/badge.stories.tsx"],
},
"button": {
name: "button",
Expand All @@ -59,14 +59,14 @@ export const Index: Record<string, any> = {
type: "components:ui",
registryDependencies: ["button"],
component: React.lazy(() => import("@/registry/default/ui/calendar")),
files: ["registry/default/ui/calendar.tsx"],
files: ["registry/default/ui/calendar.tsx","registry/stories/calendar.stories.tsx"],
},
"card": {
name: "card",
type: "components:ui",
registryDependencies: undefined,
component: React.lazy(() => import("@/registry/default/ui/card")),
files: ["registry/default/ui/card.tsx"],
files: ["registry/default/ui/card.tsx","registry/stories/card.stories.tsx"],
},
"checkbox": {
name: "checkbox",
Expand All @@ -87,7 +87,7 @@ export const Index: Record<string, any> = {
type: "components:ui",
registryDependencies: ["dialog"],
component: React.lazy(() => import("@/registry/default/ui/command")),
files: ["registry/default/ui/command.tsx"],
files: ["registry/default/ui/command.tsx","registry/stories/command.stories.tsx"],
},
"context-menu": {
name: "context-menu",
Expand Down Expand Up @@ -115,7 +115,7 @@ export const Index: Record<string, any> = {
type: "components:ui",
registryDependencies: ["button","label"],
component: React.lazy(() => import("@/registry/default/ui/form")),
files: ["registry/default/ui/form.tsx"],
files: ["registry/default/ui/form.tsx","registry/stories/form.stories.tsx"],
},
"hover-card": {
name: "hover-card",
Expand Down Expand Up @@ -150,7 +150,7 @@ export const Index: Record<string, any> = {
type: "components:ui",
registryDependencies: undefined,
component: React.lazy(() => import("@/registry/default/ui/navigation-menu")),
files: ["registry/default/ui/navigation-menu.tsx"],
files: ["registry/default/ui/navigation-menu.tsx","registry/stories/navigation-menu.stories.tsx"],
},
"popover": {
name: "popover",
Expand Down Expand Up @@ -199,14 +199,14 @@ export const Index: Record<string, any> = {
type: "components:ui",
registryDependencies: undefined,
component: React.lazy(() => import("@/registry/default/ui/sheet")),
files: ["registry/default/ui/sheet.tsx"],
files: ["registry/default/ui/sheet.tsx","registry/stories/sheet.stories.tsx"],
},
"skeleton": {
name: "skeleton",
type: "components:ui",
registryDependencies: undefined,
component: React.lazy(() => import("@/registry/default/ui/skeleton")),
files: ["registry/default/ui/skeleton.tsx"],
files: ["registry/default/ui/skeleton.tsx","registry/stories/skeleton.stories.tsx"],
},
"slider": {
name: "slider",
Expand All @@ -227,7 +227,7 @@ export const Index: Record<string, any> = {
type: "components:ui",
registryDependencies: undefined,
component: React.lazy(() => import("@/registry/default/ui/table")),
files: ["registry/default/ui/table.tsx"],
files: ["registry/default/ui/table.tsx","registry/stories/table.stories.tsx"],
},
"tabs": {
name: "tabs",
Expand Down Expand Up @@ -255,7 +255,7 @@ export const Index: Record<string, any> = {
type: "components:ui",
registryDependencies: undefined,
component: React.lazy(() => import("@/registry/default/ui/toggle")),
files: ["registry/default/ui/toggle.tsx"],
files: ["registry/default/ui/toggle.tsx","registry/stories/toggle.stories.tsx"],
},
"tooltip": {
name: "tooltip",
Expand Down Expand Up @@ -1026,7 +1026,7 @@ export const Index: Record<string, any> = {
type: "components:ui",
registryDependencies: undefined,
component: React.lazy(() => import("@/registry/new-york/ui/alert")),
files: ["registry/new-york/ui/alert.tsx"],
files: ["registry/new-york/ui/alert.tsx","registry/stories/alert.stories.tsx"],
},
"alert-dialog": {
name: "alert-dialog",
Expand Down Expand Up @@ -1054,7 +1054,7 @@ export const Index: Record<string, any> = {
type: "components:ui",
registryDependencies: undefined,
component: React.lazy(() => import("@/registry/new-york/ui/badge")),
files: ["registry/new-york/ui/badge.tsx"],
files: ["registry/new-york/ui/badge.tsx","registry/stories/badge.stories.tsx"],
},
"button": {
name: "button",
Expand All @@ -1068,14 +1068,14 @@ export const Index: Record<string, any> = {
type: "components:ui",
registryDependencies: ["button"],
component: React.lazy(() => import("@/registry/new-york/ui/calendar")),
files: ["registry/new-york/ui/calendar.tsx"],
files: ["registry/new-york/ui/calendar.tsx","registry/stories/calendar.stories.tsx"],
},
"card": {
name: "card",
type: "components:ui",
registryDependencies: undefined,
component: React.lazy(() => import("@/registry/new-york/ui/card")),
files: ["registry/new-york/ui/card.tsx"],
files: ["registry/new-york/ui/card.tsx","registry/stories/card.stories.tsx"],
},
"checkbox": {
name: "checkbox",
Expand All @@ -1096,7 +1096,7 @@ export const Index: Record<string, any> = {
type: "components:ui",
registryDependencies: ["dialog"],
component: React.lazy(() => import("@/registry/new-york/ui/command")),
files: ["registry/new-york/ui/command.tsx"],
files: ["registry/new-york/ui/command.tsx","registry/stories/command.stories.tsx"],
},
"context-menu": {
name: "context-menu",
Expand Down Expand Up @@ -1124,7 +1124,7 @@ export const Index: Record<string, any> = {
type: "components:ui",
registryDependencies: ["button","label"],
component: React.lazy(() => import("@/registry/new-york/ui/form")),
files: ["registry/new-york/ui/form.tsx"],
files: ["registry/new-york/ui/form.tsx","registry/stories/form.stories.tsx"],
},
"hover-card": {
name: "hover-card",
Expand Down Expand Up @@ -1159,7 +1159,7 @@ export const Index: Record<string, any> = {
type: "components:ui",
registryDependencies: undefined,
component: React.lazy(() => import("@/registry/new-york/ui/navigation-menu")),
files: ["registry/new-york/ui/navigation-menu.tsx"],
files: ["registry/new-york/ui/navigation-menu.tsx","registry/stories/navigation-menu.stories.tsx"],
},
"popover": {
name: "popover",
Expand Down Expand Up @@ -1208,14 +1208,14 @@ export const Index: Record<string, any> = {
type: "components:ui",
registryDependencies: undefined,
component: React.lazy(() => import("@/registry/new-york/ui/sheet")),
files: ["registry/new-york/ui/sheet.tsx"],
files: ["registry/new-york/ui/sheet.tsx","registry/stories/sheet.stories.tsx"],
},
"skeleton": {
name: "skeleton",
type: "components:ui",
registryDependencies: undefined,
component: React.lazy(() => import("@/registry/new-york/ui/skeleton")),
files: ["registry/new-york/ui/skeleton.tsx"],
files: ["registry/new-york/ui/skeleton.tsx","registry/stories/skeleton.stories.tsx"],
},
"slider": {
name: "slider",
Expand All @@ -1236,7 +1236,7 @@ export const Index: Record<string, any> = {
type: "components:ui",
registryDependencies: undefined,
component: React.lazy(() => import("@/registry/new-york/ui/table")),
files: ["registry/new-york/ui/table.tsx"],
files: ["registry/new-york/ui/table.tsx","registry/stories/table.stories.tsx"],
},
"tabs": {
name: "tabs",
Expand Down Expand Up @@ -1264,7 +1264,7 @@ export const Index: Record<string, any> = {
type: "components:ui",
registryDependencies: undefined,
component: React.lazy(() => import("@/registry/new-york/ui/toggle")),
files: ["registry/new-york/ui/toggle.tsx"],
files: ["registry/new-york/ui/toggle.tsx","registry/stories/toggle.stories.tsx"],
},
"tooltip": {
name: "tooltip",
Expand Down
2 changes: 1 addition & 1 deletion apps/www/public/registry/colors/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -1996,4 +1996,4 @@
"hslChannel": "343.1 87.7% 15.9%"
}
]
}
}
2 changes: 1 addition & 1 deletion apps/www/public/registry/colors/slate.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,4 @@
},
"inlineColorsTemplate": "@tailwind base;\n@tailwind components;\n@tailwind utilities;\n",
"cssVarsTemplate": "@tailwind base;\n@tailwind components;\n@tailwind utilities;\n \n@layer base {\n :root {\n --background: 0 0% 100%;\n --foreground: 222.2 84% 4.9%;\n\n --card: 0 0% 100%;\n --card-foreground: 222.2 84% 4.9%;\n \n --popover: 0 0% 100%;\n --popover-foreground: 222.2 84% 4.9%;\n \n --primary: 222.2 47.4% 11.2%;\n --primary-foreground: 210 40% 98%;\n \n --secondary: 210 40% 96.1%;\n --secondary-foreground: 222.2 47.4% 11.2%;\n \n --muted: 210 40% 96.1%;\n --muted-foreground: 215.4 16.3% 46.9%;\n \n --accent: 210 40% 96.1%;\n --accent-foreground: 222.2 47.4% 11.2%;\n \n --destructive: 0 84.2% 60.2%;\n --destructive-foreground: 210 40% 98%;\n\n --border: 214.3 31.8% 91.4%;\n --input: 214.3 31.8% 91.4%;\n --ring: 222.2 84% 4.9%;\n \n --radius: 0.5rem;\n }\n \n .dark {\n --background: 222.2 84% 4.9%;\n --foreground: 210 40% 98%;\n \n --card: 222.2 84% 4.9%;\n --card-foreground: 210 40% 98%;\n \n --popover: 222.2 84% 4.9%;\n --popover-foreground: 210 40% 98%;\n \n --primary: 210 40% 98%;\n --primary-foreground: 222.2 47.4% 11.2%;\n \n --secondary: 217.2 32.6% 17.5%;\n --secondary-foreground: 210 40% 98%;\n \n --muted: 217.2 32.6% 17.5%;\n --muted-foreground: 215 20.2% 65.1%;\n \n --accent: 217.2 32.6% 17.5%;\n --accent-foreground: 210 40% 98%;\n \n --destructive: 0 62.8% 30.6%;\n --destructive-foreground: 210 40% 98%;\n \n --border: 217.2 32.6% 17.5%;\n --input: 217.2 32.6% 17.5%;\n --ring: 212.7 26.8% 83.9%;\n }\n}\n \n@layer base {\n * {\n @apply border-border;\n }\n body {\n @apply bg-background text-foreground;\n }\n}"
}
}
33 changes: 22 additions & 11 deletions apps/www/public/registry/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
{
"name": "alert",
"files": [
"ui/alert.tsx"
"ui/alert.tsx",
"stories/alert.stories.tsx"
],
"type": "components:ui"
},
Expand Down Expand Up @@ -56,7 +57,8 @@
{
"name": "badge",
"files": [
"ui/badge.tsx"
"ui/badge.tsx",
"stories/badge.stories.tsx"
],
"type": "components:ui"
},
Expand All @@ -81,14 +83,16 @@
"button"
],
"files": [
"ui/calendar.tsx"
"ui/calendar.tsx",
"stories/calendar.stories.tsx"
],
"type": "components:ui"
},
{
"name": "card",
"files": [
"ui/card.tsx"
"ui/card.tsx",
"stories/card.stories.tsx"
],
"type": "components:ui"
},
Expand Down Expand Up @@ -123,7 +127,8 @@
"dialog"
],
"files": [
"ui/command.tsx"
"ui/command.tsx",
"stories/command.stories.tsx"
],
"type": "components:ui"
},
Expand Down Expand Up @@ -174,7 +179,8 @@
"label"
],
"files": [
"ui/form.tsx"
"ui/form.tsx",
"stories/form.stories.tsx"
],
"type": "components:ui"
},
Expand Down Expand Up @@ -225,7 +231,8 @@
"@radix-ui/react-navigation-menu"
],
"files": [
"ui/navigation-menu.tsx"
"ui/navigation-menu.tsx",
"stories/navigation-menu.stories.tsx"
],
"type": "components:ui"
},
Expand Down Expand Up @@ -301,14 +308,16 @@
"@radix-ui/react-dialog"
],
"files": [
"ui/sheet.tsx"
"ui/sheet.tsx",
"stories/sheet.stories.tsx"
],
"type": "components:ui"
},
{
"name": "skeleton",
"files": [
"ui/skeleton.tsx"
"ui/skeleton.tsx",
"stories/skeleton.stories.tsx"
],
"type": "components:ui"
},
Expand Down Expand Up @@ -337,7 +346,8 @@
{
"name": "table",
"files": [
"ui/table.tsx"
"ui/table.tsx",
"stories/table.stories.tsx"
],
"type": "components:ui"
},
Expand Down Expand Up @@ -378,7 +388,8 @@
"@radix-ui/react-toggle"
],
"files": [
"ui/toggle.tsx"
"ui/toggle.tsx",
"stories/toggle.stories.tsx"
],
"type": "components:ui"
},
Expand Down
2 changes: 1 addition & 1 deletion apps/www/public/registry/styles/default/accordion.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
{
"name": "accordion.stories.tsx",
"content": "import { Meta, StoryObj } from \"@storybook/react\"\n\nimport {\n Accordion,\n AccordionContent,\n AccordionItem,\n AccordionTrigger,\n} from \"../default/ui/accordion\"\n\nconst meta: Meta<typeof Accordion> = {\n title: \"ui/Accordion\",\n component: Accordion,\n tags: [\"autodocs\"],\n argTypes: {},\n}\n\nexport default meta\n\ntype Story = StoryObj<typeof Accordion>\n\nexport const Base: Story = {\n render: (args) => (\n <Accordion {...args}>\n <AccordionItem value=\"item-1\">\n <AccordionTrigger>Is it accessible?</AccordionTrigger>\n <AccordionContent>\n Yes. It adheres to the WAI-ARIA design pattern.\n </AccordionContent>\n </AccordionItem>\n <AccordionItem value=\"item-2\">\n <AccordionTrigger>Is it styled?</AccordionTrigger>\n <AccordionContent>\n Yes. It comes with default styles that matches the other components'\n aesthetic.\n </AccordionContent>\n </AccordionItem>\n <AccordionItem value=\"item-3\">\n <AccordionTrigger>Is it animated?</AccordionTrigger>\n <AccordionContent>\n Yes. It's animated by default, but you can disable it if you prefer.\n </AccordionContent>\n </AccordionItem>\n </Accordion>\n ),\n args: {\n type: \"single\",\n collapsible: true,\n },\n}\n"
"content": "import { Meta, StoryObj } from \"@storybook/react\"\n\nimport {\n Accordion,\n AccordionContent,\n AccordionItem,\n AccordionTrigger,\n} from \"@/registry/default/ui/accordion\"\n\nconst meta: Meta<typeof Accordion> = {\n title: \"ui/Accordion\",\n component: Accordion,\n tags: [\"autodocs\"],\n argTypes: {},\n}\n\nexport default meta\n\ntype Story = StoryObj<typeof Accordion>\n\nexport const Base: Story = {\n render: (args) => (\n <Accordion {...args}>\n <AccordionItem value=\"item-1\">\n <AccordionTrigger>Is it accessible?</AccordionTrigger>\n <AccordionContent>\n Yes. It adheres to the WAI-ARIA design pattern.\n </AccordionContent>\n </AccordionItem>\n <AccordionItem value=\"item-2\">\n <AccordionTrigger>Is it styled?</AccordionTrigger>\n <AccordionContent>\n Yes. It comes with default styles that matches the other components'\n aesthetic.\n </AccordionContent>\n </AccordionItem>\n <AccordionItem value=\"item-3\">\n <AccordionTrigger>Is it animated?</AccordionTrigger>\n <AccordionContent>\n Yes. It's animated by default, but you can disable it if you prefer.\n </AccordionContent>\n </AccordionItem>\n </Accordion>\n ),\n args: {\n type: \"single\",\n collapsible: true,\n },\n}\n"
}
],
"type": "components:ui"
Expand Down
2 changes: 1 addition & 1 deletion apps/www/public/registry/styles/default/alert-dialog.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
{
"name": "alert-dialog.stories.tsx",
"content": "import { Meta, StoryObj } from \"@storybook/react\"\n\nimport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n AlertDialogTrigger,\n} from \"../default/ui/alert-dialog\"\nimport { Button } from \"../default/ui/button\"\n\nconst meta: Meta<typeof AlertDialog> = {\n title: \"ui/AlertDialog\",\n component: AlertDialog,\n tags: [\"autodocs\"],\n argTypes: {},\n}\n\nexport default meta\n\ntype Story = StoryObj<typeof AlertDialog>\n\nexport const Base: Story = {\n render: () => (\n <AlertDialog>\n <AlertDialogTrigger asChild>\n <Button variant=\"outline\">Open</Button>\n </AlertDialogTrigger>\n <AlertDialogContent>\n <AlertDialogHeader>\n <AlertDialogTitle>Are you sure absolutely sure?</AlertDialogTitle>\n <AlertDialogDescription>\n This action cannot be undone. This will permanently delete your\n account and remove your data from our servers.\n </AlertDialogDescription>\n </AlertDialogHeader>\n <AlertDialogFooter>\n <AlertDialogCancel>Cancel</AlertDialogCancel>\n <AlertDialogAction>Continue</AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n ),\n args: {},\n}\n"
"content": "import { Meta, StoryObj } from \"@storybook/react\"\n\nimport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n AlertDialogTrigger,\n} from \"@/registry/default/ui/alert-dialog\"\nimport { Button } from \"@/registry/default/ui/button\"\n\nconst meta: Meta<typeof AlertDialog> = {\n title: \"ui/AlertDialog\",\n component: AlertDialog,\n tags: [\"autodocs\"],\n argTypes: {},\n}\n\nexport default meta\n\ntype Story = StoryObj<typeof AlertDialog>\n\nexport const Base: Story = {\n render: (args) => (\n <AlertDialog {...args}>\n <AlertDialogTrigger asChild>\n <Button variant=\"outline\">Open</Button>\n </AlertDialogTrigger>\n <AlertDialogContent>\n <AlertDialogHeader>\n <AlertDialogTitle>Are you sure absolutely sure?</AlertDialogTitle>\n <AlertDialogDescription>\n This action cannot be undone. This will permanently delete your\n account and remove your data from our servers.\n </AlertDialogDescription>\n </AlertDialogHeader>\n <AlertDialogFooter>\n <AlertDialogCancel>Cancel</AlertDialogCancel>\n <AlertDialogAction>Continue</AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n ),\n args: {},\n}\n"
}
],
"type": "components:ui"
Expand Down
Loading

0 comments on commit 9896354

Please sign in to comment.