diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a93bde5..92dccc8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -244,7 +244,7 @@ When adding a new item, you will create/edit these files: | `mc-skeleton` | ✅ | ✅ | | `mc-badge` | ✅ | ✅ | | `mc-avatar` | ✅ | ✅ | -| `mc-drawer` | ✅ | | +| `mc-drawer` | ✅ | ✅ | | `mc-hover-card` | ✅ | ✅ | | `mc-slider` | ✅ | | | `mc-carousel` | ✅ | ✅ | diff --git a/packages/web/__registry__/index.tsx b/packages/web/__registry__/index.tsx index 4392625..b979dcd 100644 --- a/packages/web/__registry__/index.tsx +++ b/packages/web/__registry__/index.tsx @@ -2449,6 +2449,19 @@ export const Index: Record = { }, ], }, + 'mc-drawer': { + name: 'mc-drawer', + description: 'A drawer component for MicroClub UI', + type: 'registry:component', + files: [ + { + path: 'registry/ui/mc-drawer.tsx', + content: + "'use client';\nimport * as React from 'react';\nimport { Drawer as McDrawerPrimitive } from 'vaul';\nimport { cn } from '@/lib/utils';\n\nfunction McDrawer({ ...props }: React.ComponentProps) {\n return ;\n}\n\nfunction McDrawerTrigger({ ...props }: React.ComponentProps) {\n return ;\n}\n\nfunction McDrawerPortal({ ...props }: React.ComponentProps) {\n return ;\n}\n\nfunction McDrawerClose({ ...props }: React.ComponentProps) {\n return ;\n}\n\nfunction McDrawerOverlay({\n className,\n ...props\n}: React.ComponentProps) {\n return (\n \n );\n}\n\nfunction McDrawerContent({\n className,\n children,\n ...props\n}: React.ComponentProps) {\n return (\n \n \n \n \n );\n}\n\ninterface McDrawerNavItemProps extends React.ComponentProps<'button'> {\n icon?: React.ReactNode;\n hasArrow?: boolean;\n rightElement?: React.ReactNode;\n}\n\nfunction McDrawerNavItem({\n icon,\n hasArrow = false,\n rightElement,\n children,\n className,\n ...props\n}: McDrawerNavItemProps) {\n return (\n \n \n {icon && (\n \n {icon}\n \n )}\n {children}\n \n\n {rightElement ??\n (hasArrow && (\n \n \n \n ))}\n \n );\n}\nexport {\n McDrawer,\n McDrawerPortal,\n McDrawerOverlay,\n McDrawerTrigger,\n McDrawerClose,\n McDrawerContent,\n McDrawerHeader,\n McDrawerFooter,\n McDrawerTitle,\n McDrawerDescription,\n McDrawerNav,\n McDrawerNavItem,\n};\n", + type: 'registry:component', + }, + ], + }, 'mc-hover-card': { name: 'mc-hover-card', description: 'A hover card component for MicroClub UI', @@ -2955,6 +2968,22 @@ export const Index: Record = { source: 'import {\n McAvatar,\n McAvatarBadge,\n McAvatarFallback,\n McAvatarGroup,\n McAvatarGroupCount,\n McAvatarImage,\n} from \'@/registry/ui/mc-avatar\';\n\nexport default function AvatarDemo() {\n return (\n
\n \n \n CN\n \n \n \n ER\n \n \n \n \n \n CN\n \n \n \n LR\n \n \n \n ER\n \n +3\n \n
\n );\n}\n', }, + 'mc-drawer-demo': { + name: 'mc-drawer-demo', + description: 'Demo for MicroClub drawer', + type: 'registry:example', + files: [ + { + path: 'registry/examples/mc-drawer-demo.tsx', + content: + '\'use client\';\n\nimport { Moon } from \'lucide-react\';\nimport {\n McDrawer,\n McDrawerClose,\n McDrawerContent,\n McDrawerDescription,\n McDrawerHeader,\n McDrawerNav,\n McDrawerNavItem,\n McDrawerTitle,\n McDrawerTrigger,\n} from \'../ui/mc-drawer\';\n\nconst navItems = [\n { label: \'Account\', hasArrow: true },\n { label: \'Socials\', hasArrow: false },\n { label: \'Settings\', hasArrow: true },\n { label: \'Help\', hasArrow: true },\n { label: \'Info\', hasArrow: true },\n];\n\nfunction DesktopWithIcons() {\n return (\n \n \n Drawer — icons\n \n\n \n Navigation — icons\n \n\n
\n } rightElement={}>\n Dark mode\n \n\n {navItems.map(({ label, hasArrow }) => (\n } hasArrow={hasArrow}>\n {label}\n \n ))}\n
\n
\n
\n );\n}\n\nfunction DesktopNoIcons() {\n return (\n \n \n Drawer — no icons\n \n\n \n Navigation — no icons\n \n\n
\n }>Dark mode\n\n {navItems.map(({ label, hasArrow }) => (\n \n {label}\n \n ))}\n
\n
\n
\n );\n}\n\nfunction MobileSheet() {\n return (\n \n \n Drawer — mobile\n \n\n \n
\n \n Edit profile\n \n Make changes to your profile here. Click save when you're done.\n \n \n\n
\n
\n \n \n
\n\n
\n \n \n
\n
\n\n \n Save changes\n \n
\n
\n
\n );\n}\n\nexport default function DrawerDemo() {\n return (\n
\n \n \n \n
\n );\n}\n\nfunction ToggleSwitch() {\n return (\n \n \n \n );\n}\n', + type: 'registry:example', + }, + ], + component: React.lazy(() => import('@/registry/examples/mc-drawer-demo.tsx')), + source: + '\'use client\';\n\nimport { Moon } from \'lucide-react\';\nimport {\n McDrawer,\n McDrawerClose,\n McDrawerContent,\n McDrawerDescription,\n McDrawerHeader,\n McDrawerNav,\n McDrawerNavItem,\n McDrawerTitle,\n McDrawerTrigger,\n} from \'../ui/mc-drawer\';\n\nconst navItems = [\n { label: \'Account\', hasArrow: true },\n { label: \'Socials\', hasArrow: false },\n { label: \'Settings\', hasArrow: true },\n { label: \'Help\', hasArrow: true },\n { label: \'Info\', hasArrow: true },\n];\n\nfunction DesktopWithIcons() {\n return (\n \n \n Drawer — icons\n \n\n \n Navigation — icons\n \n\n
\n } rightElement={}>\n Dark mode\n \n\n {navItems.map(({ label, hasArrow }) => (\n } hasArrow={hasArrow}>\n {label}\n \n ))}\n
\n
\n
\n );\n}\n\nfunction DesktopNoIcons() {\n return (\n \n \n Drawer — no icons\n \n\n \n Navigation — no icons\n \n\n
\n }>Dark mode\n\n {navItems.map(({ label, hasArrow }) => (\n \n {label}\n \n ))}\n
\n
\n
\n );\n}\n\nfunction MobileSheet() {\n return (\n \n \n Drawer — mobile\n \n\n \n
\n \n Edit profile\n \n Make changes to your profile here. Click save when you're done.\n \n \n\n
\n
\n \n \n
\n\n
\n \n \n
\n
\n\n \n Save changes\n \n
\n
\n
\n );\n}\n\nexport default function DrawerDemo() {\n return (\n
\n \n \n \n
\n );\n}\n\nfunction ToggleSwitch() {\n return (\n \n \n \n );\n}\n', + }, 'mc-hover-card-demo': { name: 'mc-hover-card-demo', description: 'Demo for MicroClub Hover Card', diff --git a/packages/web/__registry__/registry.autogenerated.json b/packages/web/__registry__/registry.autogenerated.json index 0f967a2..9617e84 100644 --- a/packages/web/__registry__/registry.autogenerated.json +++ b/packages/web/__registry__/registry.autogenerated.json @@ -2545,6 +2545,19 @@ ], "type": "registry:component" }, + { + "name": "mc-drawer", + "title": "MicroClub Drawer", + "description": "A drawer component for MicroClub UI", + "dependencies": ["vaul"], + "files": [ + { + "path": "registry/ui/mc-drawer.tsx", + "type": "registry:component" + } + ], + "type": "registry:component" + }, { "name": "mc-hover-card", "title": "MicroClub Hover Card", diff --git a/packages/web/app/globals.css b/packages/web/app/globals.css index 87c2edd..8d158d8 100644 --- a/packages/web/app/globals.css +++ b/packages/web/app/globals.css @@ -200,6 +200,10 @@ --blur-lg: 7px; --blur-xl: 9px; + --spacing-drawer: 26.6875rem; + --spacing-drawer-nav: 4.5rem; + --spacing-drawer-item: 4.125rem; + --font-dm-sans: var(--font-dm-sans); --font-plus-jakarta-sans: var(--font-plus-jakarta-sans); --font-heading: var(--font-sans); diff --git a/packages/web/content/docs/components/index.mdx b/packages/web/content/docs/components/index.mdx index a144b18..f251abf 100644 --- a/packages/web/content/docs/components/index.mdx +++ b/packages/web/content/docs/components/index.mdx @@ -96,6 +96,9 @@ description: Explore all available UI components in the MicroClub UI library. A component for displaying user profile images. + + A slide-out panel for navigation or content. + A card that appears on hover with additional information. @@ -116,9 +119,6 @@ description: Explore all available UI components in the MicroClub UI library. A component that displays progress of an operation. - - A slide-out panel for navigation or content. - A component for selecting a value from a range. diff --git a/packages/web/content/docs/components/mc-drawer.mdx b/packages/web/content/docs/components/mc-drawer.mdx index eb31665..7563d9b 100644 --- a/packages/web/content/docs/components/mc-drawer.mdx +++ b/packages/web/content/docs/components/mc-drawer.mdx @@ -3,7 +3,213 @@ title: MC Drawer description: A slide-out panel for navigation or content. --- - - This component is coming soon. Check our [contributing guide](/docs/introduction#contributing) for - more information. - +## Overview + +The `mc-drawer` component is a responsive slide-out panel for navigation, settings, forms, and +secondary workflows. It is built on top of **vaul**, with MicroClub styling for overlays, side +panels, bottom sheets, nav rows, headers, footers, and accessible close controls. + +Use it when content should stay close to the current page without taking the user into a full +route change. + +## Preview + + + + + + + + + + +## Add to Your Project + +Deploy `mc-drawer` directly to your `components/ui` directory: + + + npx mcoli-ui@latest add mc-drawer + pnpm dlx mcoli-ui@latest add mc-drawer + yarn dlx mcoli-ui@latest add mc-drawer + bunx mcoli-ui@latest add mc-drawer + + +### Manual Setup + +If you prefer manual control: + + + +Install the core dependencies + + + npm install vaul + pnpm add vaul + yarn add vaul + bun add vaul + + +Copy the source code + + + +Adjust import paths + +Ensure your `@/lib/utils` or equivalent classname helper is correctly imported. + + + +## Usage + +```tsx +import { + McDrawer, + McDrawerContent, + McDrawerDescription, + McDrawerHeader, + McDrawerTitle, + McDrawerTrigger, +} from '@/components/ui/mc-drawer'; + +export default function Example() { + return ( + + Open drawer + + + Settings + Update your workspace preferences. + + + + ); +} +``` + +## Examples + +### Navigation Drawer + +```tsx +import { Moon } from 'lucide-react'; +import { + McDrawer, + McDrawerContent, + McDrawerNav, + McDrawerNavItem, + McDrawerTitle, + McDrawerTrigger, +} from '@/components/ui/mc-drawer'; + +export function NavigationDrawer() { + return ( + + Open navigation + + Navigation + +
+ } hasArrow> + Account + + } hasArrow> + Settings + +
+
+
+ ); +} +``` + +### Bottom Sheet + +```tsx +import { + McDrawer, + McDrawerClose, + McDrawerContent, + McDrawerDescription, + McDrawerHeader, + McDrawerTitle, + McDrawerTrigger, +} from '@/components/ui/mc-drawer'; + +export function ProfileDrawer() { + return ( + + Edit profile + +
+ + Edit profile + Save your changes before closing the drawer. + + + + + + Save changes + +
+
+
+ ); +} +``` + +## API Reference + +### Root Components + +| Component | Description | +| ----------------- | ------------------------------------------------------ | +| `McDrawer` | Root wrapper that manages drawer state and direction | +| `McDrawerTrigger` | Element that opens the drawer | +| `McDrawerContent` | Drawer panel rendered in a portal with overlay support | +| `McDrawerPortal` | Portal wrapper from the underlying drawer primitive | +| `McDrawerOverlay` | Fixed overlay displayed behind the drawer content | +| `McDrawerClose` | Element that closes the drawer | + +### Layout Components + +| Component | Description | +| --------------------- | ------------------------------------------------ | +| `McDrawerHeader` | Header region for titles and descriptions | +| `McDrawerFooter` | Footer region for actions | +| `McDrawerTitle` | Accessible drawer title | +| `McDrawerDescription` | Accessible supporting description | +| `McDrawerNav` | Top navigation row with a built-in close control | +| `McDrawerNavItem` | Full-width drawer navigation item | + +### Common Props + +#### `McDrawer` + +| Prop | Type | Default | Description | +| -------------- | ---------------------------------------- | ----------- | -------------------------------------- | +| `direction` | `"top" \| "right" \| "bottom" \| "left"` | `"bottom"` | Side where the drawer opens | +| `open` | `boolean` | `undefined` | Controlled open state | +| `onOpenChange` | `(open: boolean) => void` | `undefined` | Callback fired when open state changes | + +#### `McDrawerContent` + +| Prop | Type | Default | Description | +| ----------- | ----------- | ----------- | ---------------------------------- | +| `className` | `string` | `undefined` | Additional classes for the panel | +| `children` | `ReactNode` | `undefined` | Content rendered inside the drawer | + +#### `McDrawerNavItem` + +| Prop | Type | Default | Description | +| -------------- | ----------- | ----------- | ----------------------------------------- | +| `icon` | `ReactNode` | `undefined` | Optional leading icon | +| `hasArrow` | `boolean` | `false` | Shows a trailing chevron | +| `rightElement` | `ReactNode` | `undefined` | Custom trailing element, such as a switch | +| `className` | `string` | `undefined` | Additional classes for the item | + +All other relevant props from `vaul` are supported on their matching wrappers. diff --git a/packages/web/content/docs/components/meta.json b/packages/web/content/docs/components/meta.json index e194760..c50ba5a 100644 --- a/packages/web/content/docs/components/meta.json +++ b/packages/web/content/docs/components/meta.json @@ -32,13 +32,13 @@ "mc-skeleton", "mc-badge", "mc-avatar", + "mc-drawer", "mc-hover-card", "mc-carousel", "---Coming Soon---", "mc-data-table", "mc-collapsible", "mc-progress", - "mc-drawer", "mc-slider" ] } diff --git a/packages/web/package.json b/packages/web/package.json index 616a74e..6cd0ab2 100644 --- a/packages/web/package.json +++ b/packages/web/package.json @@ -40,7 +40,8 @@ "react-day-picker": "^10.0.1", "react-dom": "^19.2.4", "sonner": "^2.0.7", - "tailwind-merge": "^3.5.0" + "tailwind-merge": "^3.5.0", + "vaul": "^1.1.2" }, "devDependencies": { "@storybook/nextjs": "^10.4.1", diff --git a/packages/web/public/r/mc-drawer-card.json b/packages/web/public/r/mc-drawer-card.json new file mode 100644 index 0000000..a8cdc7d --- /dev/null +++ b/packages/web/public/r/mc-drawer-card.json @@ -0,0 +1,15 @@ +{ + "$schema": "https://ui.shadcn.com/schema/registry-item.json", + "name": "mc-drawer-card", + "title": "MicroClub Drawer", + "description": "A drawer component for MicroClub UI", + "dependencies": ["@base-ui/react"], + "files": [ + { + "path": "registry/ui/mc-drawer.tsx", + "content": "", + "type": "registry:component" + } + ], + "type": "registry:component" +} diff --git a/packages/web/public/r/mc-drawer.json b/packages/web/public/r/mc-drawer.json new file mode 100644 index 0000000..8ac1eca --- /dev/null +++ b/packages/web/public/r/mc-drawer.json @@ -0,0 +1,15 @@ +{ + "$schema": "https://ui.shadcn.com/schema/registry-item.json", + "name": "mc-drawer", + "title": "MicroClub Drawer", + "description": "A drawer component for MicroClub UI", + "dependencies": ["vaul"], + "files": [ + { + "path": "registry/ui/mc-drawer.tsx", + "content": "'use client';\nimport * as React from 'react';\nimport { Drawer as McDrawerPrimitive } from 'vaul';\nimport { cn } from '@/lib/utils';\n\nfunction McDrawer({ ...props }: React.ComponentProps) {\n return ;\n}\n\nfunction McDrawerTrigger({ ...props }: React.ComponentProps) {\n return ;\n}\n\nfunction McDrawerPortal({ ...props }: React.ComponentProps) {\n return ;\n}\n\nfunction McDrawerClose({ ...props }: React.ComponentProps) {\n return ;\n}\n\nfunction McDrawerOverlay({\n className,\n ...props\n}: React.ComponentProps) {\n return (\n \n );\n}\n\nfunction McDrawerContent({\n className,\n children,\n ...props\n}: React.ComponentProps) {\n return (\n \n \n \n \n );\n}\n\ninterface McDrawerNavItemProps extends React.ComponentProps<'button'> {\n icon?: React.ReactNode;\n hasArrow?: boolean;\n rightElement?: React.ReactNode;\n}\n\nfunction McDrawerNavItem({\n icon,\n hasArrow = false,\n rightElement,\n children,\n className,\n ...props\n}: McDrawerNavItemProps) {\n return (\n \n \n {icon && (\n \n {icon}\n \n )}\n {children}\n \n\n {rightElement ??\n (hasArrow && (\n \n \n \n ))}\n \n );\n}\nexport {\n McDrawer,\n McDrawerPortal,\n McDrawerOverlay,\n McDrawerTrigger,\n McDrawerClose,\n McDrawerContent,\n McDrawerHeader,\n McDrawerFooter,\n McDrawerTitle,\n McDrawerDescription,\n McDrawerNav,\n McDrawerNavItem,\n};\n", + "type": "registry:component" + } + ], + "type": "registry:component" +} diff --git a/packages/web/public/r/registry.json b/packages/web/public/r/registry.json index 0f967a2..9617e84 100644 --- a/packages/web/public/r/registry.json +++ b/packages/web/public/r/registry.json @@ -2545,6 +2545,19 @@ ], "type": "registry:component" }, + { + "name": "mc-drawer", + "title": "MicroClub Drawer", + "description": "A drawer component for MicroClub UI", + "dependencies": ["vaul"], + "files": [ + { + "path": "registry/ui/mc-drawer.tsx", + "type": "registry:component" + } + ], + "type": "registry:component" + }, { "name": "mc-hover-card", "title": "MicroClub Hover Card", diff --git a/packages/web/registry/examples/mc-drawer-demo.tsx b/packages/web/registry/examples/mc-drawer-demo.tsx new file mode 100644 index 0000000..58d1773 --- /dev/null +++ b/packages/web/registry/examples/mc-drawer-demo.tsx @@ -0,0 +1,148 @@ +'use client'; + +import { Moon } from 'lucide-react'; +import { + McDrawer, + McDrawerClose, + McDrawerContent, + McDrawerDescription, + McDrawerHeader, + McDrawerNav, + McDrawerNavItem, + McDrawerTitle, + McDrawerTrigger, +} from '../ui/mc-drawer'; + +const navItems = [ + { label: 'Account', hasArrow: true }, + { label: 'Socials', hasArrow: false }, + { label: 'Settings', hasArrow: true }, + { label: 'Help', hasArrow: true }, + { label: 'Info', hasArrow: true }, +]; + +function DesktopWithIcons() { + return ( + + + Drawer — icons + + + + Navigation — icons + + +
+ } rightElement={}> + Dark mode + + + {navItems.map(({ label, hasArrow }) => ( + } hasArrow={hasArrow}> + {label} + + ))} +
+
+
+ ); +} + +function DesktopNoIcons() { + return ( + + + Drawer — no icons + + + + Navigation — no icons + + +
+ }>Dark mode + + {navItems.map(({ label, hasArrow }) => ( + + {label} + + ))} +
+
+
+ ); +} + +function MobileSheet() { + return ( + + + Drawer — mobile + + + +
+ + Edit profile + + Make changes to your profile here. Click save when you're done. + + + +
+
+ + +
+ +
+ + +
+
+ + + Save changes + +
+
+
+ ); +} + +export default function DrawerDemo() { + return ( +
+ + + +
+ ); +} + +function ToggleSwitch() { + return ( +
+ +
+ ); +} diff --git a/packages/web/registry/registry-examples.ts b/packages/web/registry/registry-examples.ts index 963eb51..8541a6e 100644 --- a/packages/web/registry/registry-examples.ts +++ b/packages/web/registry/registry-examples.ts @@ -393,6 +393,19 @@ export const examples: Registry['items'] = [ ], registryDependencies: [`${REGISTRY_URL}/r/mc-avatar.json`], }, + { + name: 'mc-drawer-demo', + type: 'registry:example', + title: 'MicroClub Drawer Demo', + description: 'Demo for MicroClub drawer', + files: [ + { + path: 'examples/mc-drawer-demo.tsx', + type: 'registry:example', + }, + ], + registryDependencies: [`${REGISTRY_URL}/r/mc-drawer.json`], + }, { name: 'mc-hover-card-demo', type: 'registry:example', diff --git a/packages/web/registry/registry-ui.ts b/packages/web/registry/registry-ui.ts index c185a6c..1978a25 100644 --- a/packages/web/registry/registry-ui.ts +++ b/packages/web/registry/registry-ui.ts @@ -391,6 +391,19 @@ export const ui: Registry['items'] = [ ], dependencies: ['@base-ui/react'], }, + { + name: 'mc-drawer', + type: 'registry:component', + title: 'MicroClub Drawer', + description: 'A drawer component for MicroClub UI', + files: [ + { + path: 'ui/mc-drawer.tsx', + type: 'registry:component', + }, + ], + dependencies: ['vaul'], + }, { name: 'mc-hover-card', type: 'registry:component', @@ -404,7 +417,6 @@ export const ui: Registry['items'] = [ ], dependencies: ['@base-ui/react'], }, - { name: 'mc-carousel', type: 'registry:component', diff --git a/packages/web/registry/ui/mc-drawer.tsx b/packages/web/registry/ui/mc-drawer.tsx new file mode 100644 index 0000000..5356450 --- /dev/null +++ b/packages/web/registry/ui/mc-drawer.tsx @@ -0,0 +1,228 @@ +'use client'; +import * as React from 'react'; +import { Drawer as McDrawerPrimitive } from 'vaul'; +import { cn } from '@/lib/utils'; + +function McDrawer({ ...props }: React.ComponentProps) { + return ; +} + +function McDrawerTrigger({ ...props }: React.ComponentProps) { + return ; +} + +function McDrawerPortal({ ...props }: React.ComponentProps) { + return ; +} + +function McDrawerClose({ ...props }: React.ComponentProps) { + return ; +} + +function McDrawerOverlay({ + className, + ...props +}: React.ComponentProps) { + return ( + + ); +} + +function McDrawerContent({ + className, + children, + ...props +}: React.ComponentProps) { + return ( + + + +
+ {children} + + + ); +} + +function McDrawerHeader({ className, ...props }: React.ComponentProps<'div'>) { + return ( +
+ ); +} + +function McDrawerFooter({ className, ...props }: React.ComponentProps<'div'>) { + return ( +
+ ); +} + +function McDrawerTitle({ + className, + ...props +}: React.ComponentProps) { + return ( + + ); +} + +function McDrawerDescription({ + className, + ...props +}: React.ComponentProps) { + return ( + + ); +} + +function McDrawerNav({ className, ...props }: React.ComponentProps<'div'>) { + return ( +
+ + + +
+ ); +} + +interface McDrawerNavItemProps extends React.ComponentProps<'button'> { + icon?: React.ReactNode; + hasArrow?: boolean; + rightElement?: React.ReactNode; +} + +function McDrawerNavItem({ + icon, + hasArrow = false, + rightElement, + children, + className, + ...props +}: McDrawerNavItemProps) { + return ( + + ); +} +export { + McDrawer, + McDrawerPortal, + McDrawerOverlay, + McDrawerTrigger, + McDrawerClose, + McDrawerContent, + McDrawerHeader, + McDrawerFooter, + McDrawerTitle, + McDrawerDescription, + McDrawerNav, + McDrawerNavItem, +}; diff --git a/packages/web/stories/McDrawer.stories.tsx b/packages/web/stories/McDrawer.stories.tsx new file mode 100644 index 0000000..4c011b3 --- /dev/null +++ b/packages/web/stories/McDrawer.stories.tsx @@ -0,0 +1,44 @@ +import type { Meta, StoryObj } from '@storybook/nextjs'; +import { + McDrawer, + McDrawerClose, + McDrawerContent, + McDrawerDescription, + McDrawerHeader, + McDrawerTitle, + McDrawerTrigger, +} from '@/registry/ui/mc-drawer'; + +function DrawerDemo() { + return ( +
+ + + Open drawer + + + + Settings + Update your workspace preferences. + + + Save + + + +
+ ); +} + +const meta: Meta = { + title: 'Components/McDrawer', + component: DrawerDemo, + parameters: { + layout: 'centered', + }, +}; + +export default meta; +type Story = StoryObj; + +export const Default: Story = {}; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c1ca57c..8393b4f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -92,6 +92,9 @@ importers: tailwind-merge: specifier: ^3.5.0 version: 3.5.0 + vaul: + specifier: ^1.1.2 + version: 1.1.2(@types/react-dom@19.2.3(@types/react@19.2.14))(@types/react@19.2.14)(react-dom@19.2.5(react@19.2.5))(react@19.2.5) devDependencies: '@storybook/nextjs': specifier: ^10.4.1 @@ -6644,6 +6647,7 @@ packages: tsconfck@3.1.6: resolution: {integrity: sha512-ks6Vjr/jEw0P1gmOVwutM3B7fWxoWBL2KRDb1JfqGVawBmO5UsvmWOQFGHBPl5yxYz4eERr19E6L7NMv+Fej4w==} engines: {node: ^18 || >=20} + deprecated: unmaintained hasBin: true peerDependencies: typescript: ^5.0.0 @@ -6844,6 +6848,12 @@ packages: resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==} engines: {node: '>= 0.8'} + vaul@1.1.2: + resolution: {integrity: sha512-ZFkClGpWyI2WUQjdLJ/BaGuV6AVQiJ3uELGk3OYtP+B6yCO7Cmn9vPFXVJkRaGkOJu3m8bQMgtyzNHixULceQA==} + peerDependencies: + react: ^16.8 || ^17.0 || ^18.0 || ^19.0.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0.0 || ^19.0.0-rc + vfile-location@5.0.3: resolution: {integrity: sha512-5yXvWDEgqeiYiBe1lbxYF7UMAIm/IcopxMHrMQDq3nvKcjPKIhZklUKL+AE7J7uApI4kwe2snsK+eI6UTj9EHg==} @@ -14603,6 +14613,15 @@ snapshots: vary@1.1.2: {} + vaul@1.1.2(@types/react-dom@19.2.3(@types/react@19.2.14))(@types/react@19.2.14)(react-dom@19.2.5(react@19.2.5))(react@19.2.5): + dependencies: + '@radix-ui/react-dialog': 1.1.15(@types/react-dom@19.2.3(@types/react@19.2.14))(@types/react@19.2.14)(react-dom@19.2.5(react@19.2.5))(react@19.2.5) + react: 19.2.5 + react-dom: 19.2.5(react@19.2.5) + transitivePeerDependencies: + - '@types/react' + - '@types/react-dom' + vfile-location@5.0.3: dependencies: '@types/unist': 3.0.3