From 94174c1eab3a820f1bfecfbe2bcb52ac44679cc6 Mon Sep 17 00:00:00 2001 From: shadcn Date: Thu, 2 Jul 2026 12:46:18 +0400 Subject: [PATCH] fix: pointer events --- apps/v4/public/r/styles/base-luma/drawer.json | 2 +- apps/v4/public/r/styles/base-lyra/drawer.json | 2 +- apps/v4/public/r/styles/base-maia/drawer.json | 2 +- apps/v4/public/r/styles/base-mira/drawer.json | 2 +- apps/v4/public/r/styles/base-nova/drawer.json | 2 +- apps/v4/public/r/styles/base-rhea/drawer.json | 2 +- apps/v4/public/r/styles/base-sera/drawer.json | 2 +- apps/v4/public/r/styles/base-vega/drawer.json | 2 +- apps/v4/registry/bases/base/ui/drawer.tsx | 2 +- apps/v4/styles/base-luma/ui/drawer.tsx | 2 +- apps/v4/styles/base-lyra/ui/drawer.tsx | 2 +- apps/v4/styles/base-maia/ui/drawer.tsx | 2 +- apps/v4/styles/base-mira/ui/drawer.tsx | 2 +- apps/v4/styles/base-nova/ui-rtl/drawer.tsx | 2 +- apps/v4/styles/base-nova/ui/drawer.tsx | 2 +- apps/v4/styles/base-rhea/ui/drawer.tsx | 2 +- apps/v4/styles/base-sera/ui/drawer.tsx | 2 +- apps/v4/styles/base-vega/ui/drawer.tsx | 2 +- 18 files changed, 18 insertions(+), 18 deletions(-) diff --git a/apps/v4/public/r/styles/base-luma/drawer.json b/apps/v4/public/r/styles/base-luma/drawer.json index d61a42cf60..4c7f2cc3d2 100644 --- a/apps/v4/public/r/styles/base-luma/drawer.json +++ b/apps/v4/public/r/styles/base-luma/drawer.json @@ -7,7 +7,7 @@ "files": [ { "path": "registry/base-luma/ui/drawer.tsx", - "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { Drawer as DrawerPrimitive } from \"@base-ui/react/drawer\"\n\nimport { cn } from \"@/registry/base-luma/lib/utils\"\n\ntype DrawerContextProps = {\n hasSnapPoints: boolean\n modal: DrawerPrimitive.Root.Props[\"modal\"]\n showSwipeHandle: boolean\n swipeDirection: NonNullable\n}\n\nconst DrawerContext = React.createContext(null)\n\nfunction useDrawer() {\n const context = React.useContext(DrawerContext)\n\n if (!context) {\n throw new Error(\"useDrawer must be used within a Drawer.\")\n }\n\n return context\n}\n\nfunction Drawer({\n modal = true,\n showSwipeHandle = false,\n snapPoints,\n swipeDirection = \"down\",\n ...props\n}: DrawerPrimitive.Root.Props & {\n showSwipeHandle?: boolean\n}) {\n const hasSnapPoints = snapPoints != null && snapPoints.length > 0\n const contextValue = React.useMemo(\n () => ({ hasSnapPoints, modal, showSwipeHandle, swipeDirection }),\n [hasSnapPoints, modal, showSwipeHandle, swipeDirection]\n )\n\n return (\n \n \n \n )\n}\n\nfunction DrawerTrigger({ ...props }: DrawerPrimitive.Trigger.Props) {\n return \n}\n\nfunction DrawerPortal({ ...props }: DrawerPrimitive.Portal.Props) {\n return \n}\n\nfunction DrawerClose({ ...props }: DrawerPrimitive.Close.Props) {\n return \n}\n\nfunction DrawerOverlay({\n className,\n ...props\n}: DrawerPrimitive.Backdrop.Props) {\n return (\n \n )\n}\n\nfunction DrawerSwipeHandle({\n className,\n ...props\n}: React.ComponentProps<\"div\">) {\n return (\n \n )\n}\n\nfunction DrawerContent({\n className,\n children,\n ...props\n}: DrawerPrimitive.Popup.Props) {\n const { hasSnapPoints, modal, showSwipeHandle, swipeDirection } = useDrawer()\n const swipeAxis =\n swipeDirection === \"down\" || swipeDirection === \"up\" ? \"y\" : \"x\"\n\n return (\n \n {modal === true && (\n \n )}\n \n \n {showSwipeHandle && }\n \n {children}\n \n \n \n \n )\n}\n\nfunction DrawerHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n \n )\n}\n\nfunction DrawerFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n \n )\n}\n\nfunction DrawerTitle({ className, ...props }: DrawerPrimitive.Title.Props) {\n return (\n \n )\n}\n\nfunction DrawerDescription({\n className,\n ...props\n}: DrawerPrimitive.Description.Props) {\n return (\n \n )\n}\n\nexport {\n Drawer,\n DrawerPortal,\n DrawerOverlay,\n DrawerSwipeHandle,\n DrawerTrigger,\n DrawerClose,\n DrawerContent,\n DrawerHeader,\n DrawerFooter,\n DrawerTitle,\n DrawerDescription,\n}\n", + "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { Drawer as DrawerPrimitive } from \"@base-ui/react/drawer\"\n\nimport { cn } from \"@/registry/base-luma/lib/utils\"\n\ntype DrawerContextProps = {\n hasSnapPoints: boolean\n modal: DrawerPrimitive.Root.Props[\"modal\"]\n showSwipeHandle: boolean\n swipeDirection: NonNullable\n}\n\nconst DrawerContext = React.createContext(null)\n\nfunction useDrawer() {\n const context = React.useContext(DrawerContext)\n\n if (!context) {\n throw new Error(\"useDrawer must be used within a Drawer.\")\n }\n\n return context\n}\n\nfunction Drawer({\n modal = true,\n showSwipeHandle = false,\n snapPoints,\n swipeDirection = \"down\",\n ...props\n}: DrawerPrimitive.Root.Props & {\n showSwipeHandle?: boolean\n}) {\n const hasSnapPoints = snapPoints != null && snapPoints.length > 0\n const contextValue = React.useMemo(\n () => ({ hasSnapPoints, modal, showSwipeHandle, swipeDirection }),\n [hasSnapPoints, modal, showSwipeHandle, swipeDirection]\n )\n\n return (\n \n \n \n )\n}\n\nfunction DrawerTrigger({ ...props }: DrawerPrimitive.Trigger.Props) {\n return \n}\n\nfunction DrawerPortal({ ...props }: DrawerPrimitive.Portal.Props) {\n return \n}\n\nfunction DrawerClose({ ...props }: DrawerPrimitive.Close.Props) {\n return \n}\n\nfunction DrawerOverlay({\n className,\n ...props\n}: DrawerPrimitive.Backdrop.Props) {\n return (\n \n )\n}\n\nfunction DrawerSwipeHandle({\n className,\n ...props\n}: React.ComponentProps<\"div\">) {\n return (\n \n )\n}\n\nfunction DrawerContent({\n className,\n children,\n ...props\n}: DrawerPrimitive.Popup.Props) {\n const { hasSnapPoints, modal, showSwipeHandle, swipeDirection } = useDrawer()\n const swipeAxis =\n swipeDirection === \"down\" || swipeDirection === \"up\" ? \"y\" : \"x\"\n\n return (\n \n {modal === true && (\n \n )}\n \n \n {showSwipeHandle && }\n \n {children}\n \n \n \n \n )\n}\n\nfunction DrawerHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n \n )\n}\n\nfunction DrawerFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n \n )\n}\n\nfunction DrawerTitle({ className, ...props }: DrawerPrimitive.Title.Props) {\n return (\n \n )\n}\n\nfunction DrawerDescription({\n className,\n ...props\n}: DrawerPrimitive.Description.Props) {\n return (\n \n )\n}\n\nexport {\n Drawer,\n DrawerPortal,\n DrawerOverlay,\n DrawerSwipeHandle,\n DrawerTrigger,\n DrawerClose,\n DrawerContent,\n DrawerHeader,\n DrawerFooter,\n DrawerTitle,\n DrawerDescription,\n}\n", "type": "registry:ui" } ], diff --git a/apps/v4/public/r/styles/base-lyra/drawer.json b/apps/v4/public/r/styles/base-lyra/drawer.json index 9b6b7f4af4..3d5eb9cefa 100644 --- a/apps/v4/public/r/styles/base-lyra/drawer.json +++ b/apps/v4/public/r/styles/base-lyra/drawer.json @@ -7,7 +7,7 @@ "files": [ { "path": "registry/base-lyra/ui/drawer.tsx", - "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { Drawer as DrawerPrimitive } from \"@base-ui/react/drawer\"\n\nimport { cn } from \"@/registry/base-lyra/lib/utils\"\n\ntype DrawerContextProps = {\n hasSnapPoints: boolean\n modal: DrawerPrimitive.Root.Props[\"modal\"]\n showSwipeHandle: boolean\n swipeDirection: NonNullable\n}\n\nconst DrawerContext = React.createContext(null)\n\nfunction useDrawer() {\n const context = React.useContext(DrawerContext)\n\n if (!context) {\n throw new Error(\"useDrawer must be used within a Drawer.\")\n }\n\n return context\n}\n\nfunction Drawer({\n modal = true,\n showSwipeHandle = false,\n snapPoints,\n swipeDirection = \"down\",\n ...props\n}: DrawerPrimitive.Root.Props & {\n showSwipeHandle?: boolean\n}) {\n const hasSnapPoints = snapPoints != null && snapPoints.length > 0\n const contextValue = React.useMemo(\n () => ({ hasSnapPoints, modal, showSwipeHandle, swipeDirection }),\n [hasSnapPoints, modal, showSwipeHandle, swipeDirection]\n )\n\n return (\n \n \n \n )\n}\n\nfunction DrawerTrigger({ ...props }: DrawerPrimitive.Trigger.Props) {\n return \n}\n\nfunction DrawerPortal({ ...props }: DrawerPrimitive.Portal.Props) {\n return \n}\n\nfunction DrawerClose({ ...props }: DrawerPrimitive.Close.Props) {\n return \n}\n\nfunction DrawerOverlay({\n className,\n ...props\n}: DrawerPrimitive.Backdrop.Props) {\n return (\n \n )\n}\n\nfunction DrawerSwipeHandle({\n className,\n ...props\n}: React.ComponentProps<\"div\">) {\n return (\n \n )\n}\n\nfunction DrawerContent({\n className,\n children,\n ...props\n}: DrawerPrimitive.Popup.Props) {\n const { hasSnapPoints, modal, showSwipeHandle, swipeDirection } = useDrawer()\n const swipeAxis =\n swipeDirection === \"down\" || swipeDirection === \"up\" ? \"y\" : \"x\"\n\n return (\n \n {modal === true && (\n \n )}\n \n \n {showSwipeHandle && }\n \n {children}\n \n \n \n \n )\n}\n\nfunction DrawerHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n \n )\n}\n\nfunction DrawerFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n \n )\n}\n\nfunction DrawerTitle({ className, ...props }: DrawerPrimitive.Title.Props) {\n return (\n \n )\n}\n\nfunction DrawerDescription({\n className,\n ...props\n}: DrawerPrimitive.Description.Props) {\n return (\n \n )\n}\n\nexport {\n Drawer,\n DrawerPortal,\n DrawerOverlay,\n DrawerSwipeHandle,\n DrawerTrigger,\n DrawerClose,\n DrawerContent,\n DrawerHeader,\n DrawerFooter,\n DrawerTitle,\n DrawerDescription,\n}\n", + "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { Drawer as DrawerPrimitive } from \"@base-ui/react/drawer\"\n\nimport { cn } from \"@/registry/base-lyra/lib/utils\"\n\ntype DrawerContextProps = {\n hasSnapPoints: boolean\n modal: DrawerPrimitive.Root.Props[\"modal\"]\n showSwipeHandle: boolean\n swipeDirection: NonNullable\n}\n\nconst DrawerContext = React.createContext(null)\n\nfunction useDrawer() {\n const context = React.useContext(DrawerContext)\n\n if (!context) {\n throw new Error(\"useDrawer must be used within a Drawer.\")\n }\n\n return context\n}\n\nfunction Drawer({\n modal = true,\n showSwipeHandle = false,\n snapPoints,\n swipeDirection = \"down\",\n ...props\n}: DrawerPrimitive.Root.Props & {\n showSwipeHandle?: boolean\n}) {\n const hasSnapPoints = snapPoints != null && snapPoints.length > 0\n const contextValue = React.useMemo(\n () => ({ hasSnapPoints, modal, showSwipeHandle, swipeDirection }),\n [hasSnapPoints, modal, showSwipeHandle, swipeDirection]\n )\n\n return (\n \n \n \n )\n}\n\nfunction DrawerTrigger({ ...props }: DrawerPrimitive.Trigger.Props) {\n return \n}\n\nfunction DrawerPortal({ ...props }: DrawerPrimitive.Portal.Props) {\n return \n}\n\nfunction DrawerClose({ ...props }: DrawerPrimitive.Close.Props) {\n return \n}\n\nfunction DrawerOverlay({\n className,\n ...props\n}: DrawerPrimitive.Backdrop.Props) {\n return (\n \n )\n}\n\nfunction DrawerSwipeHandle({\n className,\n ...props\n}: React.ComponentProps<\"div\">) {\n return (\n \n )\n}\n\nfunction DrawerContent({\n className,\n children,\n ...props\n}: DrawerPrimitive.Popup.Props) {\n const { hasSnapPoints, modal, showSwipeHandle, swipeDirection } = useDrawer()\n const swipeAxis =\n swipeDirection === \"down\" || swipeDirection === \"up\" ? \"y\" : \"x\"\n\n return (\n \n {modal === true && (\n \n )}\n \n \n {showSwipeHandle && }\n \n {children}\n \n \n \n \n )\n}\n\nfunction DrawerHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n \n )\n}\n\nfunction DrawerFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n \n )\n}\n\nfunction DrawerTitle({ className, ...props }: DrawerPrimitive.Title.Props) {\n return (\n \n )\n}\n\nfunction DrawerDescription({\n className,\n ...props\n}: DrawerPrimitive.Description.Props) {\n return (\n \n )\n}\n\nexport {\n Drawer,\n DrawerPortal,\n DrawerOverlay,\n DrawerSwipeHandle,\n DrawerTrigger,\n DrawerClose,\n DrawerContent,\n DrawerHeader,\n DrawerFooter,\n DrawerTitle,\n DrawerDescription,\n}\n", "type": "registry:ui" } ], diff --git a/apps/v4/public/r/styles/base-maia/drawer.json b/apps/v4/public/r/styles/base-maia/drawer.json index a17377b08a..bd13ec62dc 100644 --- a/apps/v4/public/r/styles/base-maia/drawer.json +++ b/apps/v4/public/r/styles/base-maia/drawer.json @@ -7,7 +7,7 @@ "files": [ { "path": "registry/base-maia/ui/drawer.tsx", - "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { Drawer as DrawerPrimitive } from \"@base-ui/react/drawer\"\n\nimport { cn } from \"@/registry/base-maia/lib/utils\"\n\ntype DrawerContextProps = {\n hasSnapPoints: boolean\n modal: DrawerPrimitive.Root.Props[\"modal\"]\n showSwipeHandle: boolean\n swipeDirection: NonNullable\n}\n\nconst DrawerContext = React.createContext(null)\n\nfunction useDrawer() {\n const context = React.useContext(DrawerContext)\n\n if (!context) {\n throw new Error(\"useDrawer must be used within a Drawer.\")\n }\n\n return context\n}\n\nfunction Drawer({\n modal = true,\n showSwipeHandle = false,\n snapPoints,\n swipeDirection = \"down\",\n ...props\n}: DrawerPrimitive.Root.Props & {\n showSwipeHandle?: boolean\n}) {\n const hasSnapPoints = snapPoints != null && snapPoints.length > 0\n const contextValue = React.useMemo(\n () => ({ hasSnapPoints, modal, showSwipeHandle, swipeDirection }),\n [hasSnapPoints, modal, showSwipeHandle, swipeDirection]\n )\n\n return (\n \n \n \n )\n}\n\nfunction DrawerTrigger({ ...props }: DrawerPrimitive.Trigger.Props) {\n return \n}\n\nfunction DrawerPortal({ ...props }: DrawerPrimitive.Portal.Props) {\n return \n}\n\nfunction DrawerClose({ ...props }: DrawerPrimitive.Close.Props) {\n return \n}\n\nfunction DrawerOverlay({\n className,\n ...props\n}: DrawerPrimitive.Backdrop.Props) {\n return (\n \n )\n}\n\nfunction DrawerSwipeHandle({\n className,\n ...props\n}: React.ComponentProps<\"div\">) {\n return (\n \n )\n}\n\nfunction DrawerContent({\n className,\n children,\n ...props\n}: DrawerPrimitive.Popup.Props) {\n const { hasSnapPoints, modal, showSwipeHandle, swipeDirection } = useDrawer()\n const swipeAxis =\n swipeDirection === \"down\" || swipeDirection === \"up\" ? \"y\" : \"x\"\n\n return (\n \n {modal === true && (\n \n )}\n \n \n {showSwipeHandle && }\n \n {children}\n \n \n \n \n )\n}\n\nfunction DrawerHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n \n )\n}\n\nfunction DrawerFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n \n )\n}\n\nfunction DrawerTitle({ className, ...props }: DrawerPrimitive.Title.Props) {\n return (\n \n )\n}\n\nfunction DrawerDescription({\n className,\n ...props\n}: DrawerPrimitive.Description.Props) {\n return (\n \n )\n}\n\nexport {\n Drawer,\n DrawerPortal,\n DrawerOverlay,\n DrawerSwipeHandle,\n DrawerTrigger,\n DrawerClose,\n DrawerContent,\n DrawerHeader,\n DrawerFooter,\n DrawerTitle,\n DrawerDescription,\n}\n", + "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { Drawer as DrawerPrimitive } from \"@base-ui/react/drawer\"\n\nimport { cn } from \"@/registry/base-maia/lib/utils\"\n\ntype DrawerContextProps = {\n hasSnapPoints: boolean\n modal: DrawerPrimitive.Root.Props[\"modal\"]\n showSwipeHandle: boolean\n swipeDirection: NonNullable\n}\n\nconst DrawerContext = React.createContext(null)\n\nfunction useDrawer() {\n const context = React.useContext(DrawerContext)\n\n if (!context) {\n throw new Error(\"useDrawer must be used within a Drawer.\")\n }\n\n return context\n}\n\nfunction Drawer({\n modal = true,\n showSwipeHandle = false,\n snapPoints,\n swipeDirection = \"down\",\n ...props\n}: DrawerPrimitive.Root.Props & {\n showSwipeHandle?: boolean\n}) {\n const hasSnapPoints = snapPoints != null && snapPoints.length > 0\n const contextValue = React.useMemo(\n () => ({ hasSnapPoints, modal, showSwipeHandle, swipeDirection }),\n [hasSnapPoints, modal, showSwipeHandle, swipeDirection]\n )\n\n return (\n \n \n \n )\n}\n\nfunction DrawerTrigger({ ...props }: DrawerPrimitive.Trigger.Props) {\n return \n}\n\nfunction DrawerPortal({ ...props }: DrawerPrimitive.Portal.Props) {\n return \n}\n\nfunction DrawerClose({ ...props }: DrawerPrimitive.Close.Props) {\n return \n}\n\nfunction DrawerOverlay({\n className,\n ...props\n}: DrawerPrimitive.Backdrop.Props) {\n return (\n \n )\n}\n\nfunction DrawerSwipeHandle({\n className,\n ...props\n}: React.ComponentProps<\"div\">) {\n return (\n \n )\n}\n\nfunction DrawerContent({\n className,\n children,\n ...props\n}: DrawerPrimitive.Popup.Props) {\n const { hasSnapPoints, modal, showSwipeHandle, swipeDirection } = useDrawer()\n const swipeAxis =\n swipeDirection === \"down\" || swipeDirection === \"up\" ? \"y\" : \"x\"\n\n return (\n \n {modal === true && (\n \n )}\n \n \n {showSwipeHandle && }\n \n {children}\n \n \n \n \n )\n}\n\nfunction DrawerHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n \n )\n}\n\nfunction DrawerFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n \n )\n}\n\nfunction DrawerTitle({ className, ...props }: DrawerPrimitive.Title.Props) {\n return (\n \n )\n}\n\nfunction DrawerDescription({\n className,\n ...props\n}: DrawerPrimitive.Description.Props) {\n return (\n \n )\n}\n\nexport {\n Drawer,\n DrawerPortal,\n DrawerOverlay,\n DrawerSwipeHandle,\n DrawerTrigger,\n DrawerClose,\n DrawerContent,\n DrawerHeader,\n DrawerFooter,\n DrawerTitle,\n DrawerDescription,\n}\n", "type": "registry:ui" } ], diff --git a/apps/v4/public/r/styles/base-mira/drawer.json b/apps/v4/public/r/styles/base-mira/drawer.json index e00baf97a0..98af43ae40 100644 --- a/apps/v4/public/r/styles/base-mira/drawer.json +++ b/apps/v4/public/r/styles/base-mira/drawer.json @@ -7,7 +7,7 @@ "files": [ { "path": "registry/base-mira/ui/drawer.tsx", - "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { Drawer as DrawerPrimitive } from \"@base-ui/react/drawer\"\n\nimport { cn } from \"@/registry/base-mira/lib/utils\"\n\ntype DrawerContextProps = {\n hasSnapPoints: boolean\n modal: DrawerPrimitive.Root.Props[\"modal\"]\n showSwipeHandle: boolean\n swipeDirection: NonNullable\n}\n\nconst DrawerContext = React.createContext(null)\n\nfunction useDrawer() {\n const context = React.useContext(DrawerContext)\n\n if (!context) {\n throw new Error(\"useDrawer must be used within a Drawer.\")\n }\n\n return context\n}\n\nfunction Drawer({\n modal = true,\n showSwipeHandle = false,\n snapPoints,\n swipeDirection = \"down\",\n ...props\n}: DrawerPrimitive.Root.Props & {\n showSwipeHandle?: boolean\n}) {\n const hasSnapPoints = snapPoints != null && snapPoints.length > 0\n const contextValue = React.useMemo(\n () => ({ hasSnapPoints, modal, showSwipeHandle, swipeDirection }),\n [hasSnapPoints, modal, showSwipeHandle, swipeDirection]\n )\n\n return (\n \n \n \n )\n}\n\nfunction DrawerTrigger({ ...props }: DrawerPrimitive.Trigger.Props) {\n return \n}\n\nfunction DrawerPortal({ ...props }: DrawerPrimitive.Portal.Props) {\n return \n}\n\nfunction DrawerClose({ ...props }: DrawerPrimitive.Close.Props) {\n return \n}\n\nfunction DrawerOverlay({\n className,\n ...props\n}: DrawerPrimitive.Backdrop.Props) {\n return (\n \n )\n}\n\nfunction DrawerSwipeHandle({\n className,\n ...props\n}: React.ComponentProps<\"div\">) {\n return (\n \n )\n}\n\nfunction DrawerContent({\n className,\n children,\n ...props\n}: DrawerPrimitive.Popup.Props) {\n const { hasSnapPoints, modal, showSwipeHandle, swipeDirection } = useDrawer()\n const swipeAxis =\n swipeDirection === \"down\" || swipeDirection === \"up\" ? \"y\" : \"x\"\n\n return (\n \n {modal === true && (\n \n )}\n \n \n {showSwipeHandle && }\n \n {children}\n \n \n \n \n )\n}\n\nfunction DrawerHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n \n )\n}\n\nfunction DrawerFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n \n )\n}\n\nfunction DrawerTitle({ className, ...props }: DrawerPrimitive.Title.Props) {\n return (\n \n )\n}\n\nfunction DrawerDescription({\n className,\n ...props\n}: DrawerPrimitive.Description.Props) {\n return (\n \n )\n}\n\nexport {\n Drawer,\n DrawerPortal,\n DrawerOverlay,\n DrawerSwipeHandle,\n DrawerTrigger,\n DrawerClose,\n DrawerContent,\n DrawerHeader,\n DrawerFooter,\n DrawerTitle,\n DrawerDescription,\n}\n", + "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { Drawer as DrawerPrimitive } from \"@base-ui/react/drawer\"\n\nimport { cn } from \"@/registry/base-mira/lib/utils\"\n\ntype DrawerContextProps = {\n hasSnapPoints: boolean\n modal: DrawerPrimitive.Root.Props[\"modal\"]\n showSwipeHandle: boolean\n swipeDirection: NonNullable\n}\n\nconst DrawerContext = React.createContext(null)\n\nfunction useDrawer() {\n const context = React.useContext(DrawerContext)\n\n if (!context) {\n throw new Error(\"useDrawer must be used within a Drawer.\")\n }\n\n return context\n}\n\nfunction Drawer({\n modal = true,\n showSwipeHandle = false,\n snapPoints,\n swipeDirection = \"down\",\n ...props\n}: DrawerPrimitive.Root.Props & {\n showSwipeHandle?: boolean\n}) {\n const hasSnapPoints = snapPoints != null && snapPoints.length > 0\n const contextValue = React.useMemo(\n () => ({ hasSnapPoints, modal, showSwipeHandle, swipeDirection }),\n [hasSnapPoints, modal, showSwipeHandle, swipeDirection]\n )\n\n return (\n \n \n \n )\n}\n\nfunction DrawerTrigger({ ...props }: DrawerPrimitive.Trigger.Props) {\n return \n}\n\nfunction DrawerPortal({ ...props }: DrawerPrimitive.Portal.Props) {\n return \n}\n\nfunction DrawerClose({ ...props }: DrawerPrimitive.Close.Props) {\n return \n}\n\nfunction DrawerOverlay({\n className,\n ...props\n}: DrawerPrimitive.Backdrop.Props) {\n return (\n \n )\n}\n\nfunction DrawerSwipeHandle({\n className,\n ...props\n}: React.ComponentProps<\"div\">) {\n return (\n \n )\n}\n\nfunction DrawerContent({\n className,\n children,\n ...props\n}: DrawerPrimitive.Popup.Props) {\n const { hasSnapPoints, modal, showSwipeHandle, swipeDirection } = useDrawer()\n const swipeAxis =\n swipeDirection === \"down\" || swipeDirection === \"up\" ? \"y\" : \"x\"\n\n return (\n \n {modal === true && (\n \n )}\n \n \n {showSwipeHandle && }\n \n {children}\n \n \n \n \n )\n}\n\nfunction DrawerHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n \n )\n}\n\nfunction DrawerFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n \n )\n}\n\nfunction DrawerTitle({ className, ...props }: DrawerPrimitive.Title.Props) {\n return (\n \n )\n}\n\nfunction DrawerDescription({\n className,\n ...props\n}: DrawerPrimitive.Description.Props) {\n return (\n \n )\n}\n\nexport {\n Drawer,\n DrawerPortal,\n DrawerOverlay,\n DrawerSwipeHandle,\n DrawerTrigger,\n DrawerClose,\n DrawerContent,\n DrawerHeader,\n DrawerFooter,\n DrawerTitle,\n DrawerDescription,\n}\n", "type": "registry:ui" } ], diff --git a/apps/v4/public/r/styles/base-nova/drawer.json b/apps/v4/public/r/styles/base-nova/drawer.json index d2178105ee..dfadf60388 100644 --- a/apps/v4/public/r/styles/base-nova/drawer.json +++ b/apps/v4/public/r/styles/base-nova/drawer.json @@ -7,7 +7,7 @@ "files": [ { "path": "registry/base-nova/ui/drawer.tsx", - "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { Drawer as DrawerPrimitive } from \"@base-ui/react/drawer\"\n\nimport { cn } from \"@/registry/base-nova/lib/utils\"\n\ntype DrawerContextProps = {\n hasSnapPoints: boolean\n modal: DrawerPrimitive.Root.Props[\"modal\"]\n showSwipeHandle: boolean\n swipeDirection: NonNullable\n}\n\nconst DrawerContext = React.createContext(null)\n\nfunction useDrawer() {\n const context = React.useContext(DrawerContext)\n\n if (!context) {\n throw new Error(\"useDrawer must be used within a Drawer.\")\n }\n\n return context\n}\n\nfunction Drawer({\n modal = true,\n showSwipeHandle = false,\n snapPoints,\n swipeDirection = \"down\",\n ...props\n}: DrawerPrimitive.Root.Props & {\n showSwipeHandle?: boolean\n}) {\n const hasSnapPoints = snapPoints != null && snapPoints.length > 0\n const contextValue = React.useMemo(\n () => ({ hasSnapPoints, modal, showSwipeHandle, swipeDirection }),\n [hasSnapPoints, modal, showSwipeHandle, swipeDirection]\n )\n\n return (\n \n \n \n )\n}\n\nfunction DrawerTrigger({ ...props }: DrawerPrimitive.Trigger.Props) {\n return \n}\n\nfunction DrawerPortal({ ...props }: DrawerPrimitive.Portal.Props) {\n return \n}\n\nfunction DrawerClose({ ...props }: DrawerPrimitive.Close.Props) {\n return \n}\n\nfunction DrawerOverlay({\n className,\n ...props\n}: DrawerPrimitive.Backdrop.Props) {\n return (\n \n )\n}\n\nfunction DrawerSwipeHandle({\n className,\n ...props\n}: React.ComponentProps<\"div\">) {\n return (\n \n )\n}\n\nfunction DrawerContent({\n className,\n children,\n ...props\n}: DrawerPrimitive.Popup.Props) {\n const { hasSnapPoints, modal, showSwipeHandle, swipeDirection } = useDrawer()\n const swipeAxis =\n swipeDirection === \"down\" || swipeDirection === \"up\" ? \"y\" : \"x\"\n\n return (\n \n {modal === true && (\n \n )}\n \n \n {showSwipeHandle && }\n \n {children}\n \n \n \n \n )\n}\n\nfunction DrawerHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n \n )\n}\n\nfunction DrawerFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n \n )\n}\n\nfunction DrawerTitle({ className, ...props }: DrawerPrimitive.Title.Props) {\n return (\n \n )\n}\n\nfunction DrawerDescription({\n className,\n ...props\n}: DrawerPrimitive.Description.Props) {\n return (\n \n )\n}\n\nexport {\n Drawer,\n DrawerPortal,\n DrawerOverlay,\n DrawerSwipeHandle,\n DrawerTrigger,\n DrawerClose,\n DrawerContent,\n DrawerHeader,\n DrawerFooter,\n DrawerTitle,\n DrawerDescription,\n}\n", + "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { Drawer as DrawerPrimitive } from \"@base-ui/react/drawer\"\n\nimport { cn } from \"@/registry/base-nova/lib/utils\"\n\ntype DrawerContextProps = {\n hasSnapPoints: boolean\n modal: DrawerPrimitive.Root.Props[\"modal\"]\n showSwipeHandle: boolean\n swipeDirection: NonNullable\n}\n\nconst DrawerContext = React.createContext(null)\n\nfunction useDrawer() {\n const context = React.useContext(DrawerContext)\n\n if (!context) {\n throw new Error(\"useDrawer must be used within a Drawer.\")\n }\n\n return context\n}\n\nfunction Drawer({\n modal = true,\n showSwipeHandle = false,\n snapPoints,\n swipeDirection = \"down\",\n ...props\n}: DrawerPrimitive.Root.Props & {\n showSwipeHandle?: boolean\n}) {\n const hasSnapPoints = snapPoints != null && snapPoints.length > 0\n const contextValue = React.useMemo(\n () => ({ hasSnapPoints, modal, showSwipeHandle, swipeDirection }),\n [hasSnapPoints, modal, showSwipeHandle, swipeDirection]\n )\n\n return (\n \n \n \n )\n}\n\nfunction DrawerTrigger({ ...props }: DrawerPrimitive.Trigger.Props) {\n return \n}\n\nfunction DrawerPortal({ ...props }: DrawerPrimitive.Portal.Props) {\n return \n}\n\nfunction DrawerClose({ ...props }: DrawerPrimitive.Close.Props) {\n return \n}\n\nfunction DrawerOverlay({\n className,\n ...props\n}: DrawerPrimitive.Backdrop.Props) {\n return (\n \n )\n}\n\nfunction DrawerSwipeHandle({\n className,\n ...props\n}: React.ComponentProps<\"div\">) {\n return (\n \n )\n}\n\nfunction DrawerContent({\n className,\n children,\n ...props\n}: DrawerPrimitive.Popup.Props) {\n const { hasSnapPoints, modal, showSwipeHandle, swipeDirection } = useDrawer()\n const swipeAxis =\n swipeDirection === \"down\" || swipeDirection === \"up\" ? \"y\" : \"x\"\n\n return (\n \n {modal === true && (\n \n )}\n \n \n {showSwipeHandle && }\n \n {children}\n \n \n \n \n )\n}\n\nfunction DrawerHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n \n )\n}\n\nfunction DrawerFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n \n )\n}\n\nfunction DrawerTitle({ className, ...props }: DrawerPrimitive.Title.Props) {\n return (\n \n )\n}\n\nfunction DrawerDescription({\n className,\n ...props\n}: DrawerPrimitive.Description.Props) {\n return (\n \n )\n}\n\nexport {\n Drawer,\n DrawerPortal,\n DrawerOverlay,\n DrawerSwipeHandle,\n DrawerTrigger,\n DrawerClose,\n DrawerContent,\n DrawerHeader,\n DrawerFooter,\n DrawerTitle,\n DrawerDescription,\n}\n", "type": "registry:ui" } ], diff --git a/apps/v4/public/r/styles/base-rhea/drawer.json b/apps/v4/public/r/styles/base-rhea/drawer.json index b3995413b9..8c41f5674f 100644 --- a/apps/v4/public/r/styles/base-rhea/drawer.json +++ b/apps/v4/public/r/styles/base-rhea/drawer.json @@ -7,7 +7,7 @@ "files": [ { "path": "registry/base-rhea/ui/drawer.tsx", - "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { Drawer as DrawerPrimitive } from \"@base-ui/react/drawer\"\n\nimport { cn } from \"@/registry/base-rhea/lib/utils\"\n\ntype DrawerContextProps = {\n hasSnapPoints: boolean\n modal: DrawerPrimitive.Root.Props[\"modal\"]\n showSwipeHandle: boolean\n swipeDirection: NonNullable\n}\n\nconst DrawerContext = React.createContext(null)\n\nfunction useDrawer() {\n const context = React.useContext(DrawerContext)\n\n if (!context) {\n throw new Error(\"useDrawer must be used within a Drawer.\")\n }\n\n return context\n}\n\nfunction Drawer({\n modal = true,\n showSwipeHandle = false,\n snapPoints,\n swipeDirection = \"down\",\n ...props\n}: DrawerPrimitive.Root.Props & {\n showSwipeHandle?: boolean\n}) {\n const hasSnapPoints = snapPoints != null && snapPoints.length > 0\n const contextValue = React.useMemo(\n () => ({ hasSnapPoints, modal, showSwipeHandle, swipeDirection }),\n [hasSnapPoints, modal, showSwipeHandle, swipeDirection]\n )\n\n return (\n \n \n \n )\n}\n\nfunction DrawerTrigger({ ...props }: DrawerPrimitive.Trigger.Props) {\n return \n}\n\nfunction DrawerPortal({ ...props }: DrawerPrimitive.Portal.Props) {\n return \n}\n\nfunction DrawerClose({ ...props }: DrawerPrimitive.Close.Props) {\n return \n}\n\nfunction DrawerOverlay({\n className,\n ...props\n}: DrawerPrimitive.Backdrop.Props) {\n return (\n \n )\n}\n\nfunction DrawerSwipeHandle({\n className,\n ...props\n}: React.ComponentProps<\"div\">) {\n return (\n \n )\n}\n\nfunction DrawerContent({\n className,\n children,\n ...props\n}: DrawerPrimitive.Popup.Props) {\n const { hasSnapPoints, modal, showSwipeHandle, swipeDirection } = useDrawer()\n const swipeAxis =\n swipeDirection === \"down\" || swipeDirection === \"up\" ? \"y\" : \"x\"\n\n return (\n \n {modal === true && (\n \n )}\n \n \n {showSwipeHandle && }\n \n {children}\n \n \n \n \n )\n}\n\nfunction DrawerHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n \n )\n}\n\nfunction DrawerFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n \n )\n}\n\nfunction DrawerTitle({ className, ...props }: DrawerPrimitive.Title.Props) {\n return (\n \n )\n}\n\nfunction DrawerDescription({\n className,\n ...props\n}: DrawerPrimitive.Description.Props) {\n return (\n \n )\n}\n\nexport {\n Drawer,\n DrawerPortal,\n DrawerOverlay,\n DrawerSwipeHandle,\n DrawerTrigger,\n DrawerClose,\n DrawerContent,\n DrawerHeader,\n DrawerFooter,\n DrawerTitle,\n DrawerDescription,\n}\n", + "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { Drawer as DrawerPrimitive } from \"@base-ui/react/drawer\"\n\nimport { cn } from \"@/registry/base-rhea/lib/utils\"\n\ntype DrawerContextProps = {\n hasSnapPoints: boolean\n modal: DrawerPrimitive.Root.Props[\"modal\"]\n showSwipeHandle: boolean\n swipeDirection: NonNullable\n}\n\nconst DrawerContext = React.createContext(null)\n\nfunction useDrawer() {\n const context = React.useContext(DrawerContext)\n\n if (!context) {\n throw new Error(\"useDrawer must be used within a Drawer.\")\n }\n\n return context\n}\n\nfunction Drawer({\n modal = true,\n showSwipeHandle = false,\n snapPoints,\n swipeDirection = \"down\",\n ...props\n}: DrawerPrimitive.Root.Props & {\n showSwipeHandle?: boolean\n}) {\n const hasSnapPoints = snapPoints != null && snapPoints.length > 0\n const contextValue = React.useMemo(\n () => ({ hasSnapPoints, modal, showSwipeHandle, swipeDirection }),\n [hasSnapPoints, modal, showSwipeHandle, swipeDirection]\n )\n\n return (\n \n \n \n )\n}\n\nfunction DrawerTrigger({ ...props }: DrawerPrimitive.Trigger.Props) {\n return \n}\n\nfunction DrawerPortal({ ...props }: DrawerPrimitive.Portal.Props) {\n return \n}\n\nfunction DrawerClose({ ...props }: DrawerPrimitive.Close.Props) {\n return \n}\n\nfunction DrawerOverlay({\n className,\n ...props\n}: DrawerPrimitive.Backdrop.Props) {\n return (\n \n )\n}\n\nfunction DrawerSwipeHandle({\n className,\n ...props\n}: React.ComponentProps<\"div\">) {\n return (\n \n )\n}\n\nfunction DrawerContent({\n className,\n children,\n ...props\n}: DrawerPrimitive.Popup.Props) {\n const { hasSnapPoints, modal, showSwipeHandle, swipeDirection } = useDrawer()\n const swipeAxis =\n swipeDirection === \"down\" || swipeDirection === \"up\" ? \"y\" : \"x\"\n\n return (\n \n {modal === true && (\n \n )}\n \n \n {showSwipeHandle && }\n \n {children}\n \n \n \n \n )\n}\n\nfunction DrawerHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n \n )\n}\n\nfunction DrawerFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n \n )\n}\n\nfunction DrawerTitle({ className, ...props }: DrawerPrimitive.Title.Props) {\n return (\n \n )\n}\n\nfunction DrawerDescription({\n className,\n ...props\n}: DrawerPrimitive.Description.Props) {\n return (\n \n )\n}\n\nexport {\n Drawer,\n DrawerPortal,\n DrawerOverlay,\n DrawerSwipeHandle,\n DrawerTrigger,\n DrawerClose,\n DrawerContent,\n DrawerHeader,\n DrawerFooter,\n DrawerTitle,\n DrawerDescription,\n}\n", "type": "registry:ui" } ], diff --git a/apps/v4/public/r/styles/base-sera/drawer.json b/apps/v4/public/r/styles/base-sera/drawer.json index 0e48d9481d..e5509a4069 100644 --- a/apps/v4/public/r/styles/base-sera/drawer.json +++ b/apps/v4/public/r/styles/base-sera/drawer.json @@ -7,7 +7,7 @@ "files": [ { "path": "registry/base-sera/ui/drawer.tsx", - "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { Drawer as DrawerPrimitive } from \"@base-ui/react/drawer\"\n\nimport { cn } from \"@/registry/base-sera/lib/utils\"\n\ntype DrawerContextProps = {\n hasSnapPoints: boolean\n modal: DrawerPrimitive.Root.Props[\"modal\"]\n showSwipeHandle: boolean\n swipeDirection: NonNullable\n}\n\nconst DrawerContext = React.createContext(null)\n\nfunction useDrawer() {\n const context = React.useContext(DrawerContext)\n\n if (!context) {\n throw new Error(\"useDrawer must be used within a Drawer.\")\n }\n\n return context\n}\n\nfunction Drawer({\n modal = true,\n showSwipeHandle = false,\n snapPoints,\n swipeDirection = \"down\",\n ...props\n}: DrawerPrimitive.Root.Props & {\n showSwipeHandle?: boolean\n}) {\n const hasSnapPoints = snapPoints != null && snapPoints.length > 0\n const contextValue = React.useMemo(\n () => ({ hasSnapPoints, modal, showSwipeHandle, swipeDirection }),\n [hasSnapPoints, modal, showSwipeHandle, swipeDirection]\n )\n\n return (\n \n \n \n )\n}\n\nfunction DrawerTrigger({ ...props }: DrawerPrimitive.Trigger.Props) {\n return \n}\n\nfunction DrawerPortal({ ...props }: DrawerPrimitive.Portal.Props) {\n return \n}\n\nfunction DrawerClose({ ...props }: DrawerPrimitive.Close.Props) {\n return \n}\n\nfunction DrawerOverlay({\n className,\n ...props\n}: DrawerPrimitive.Backdrop.Props) {\n return (\n \n )\n}\n\nfunction DrawerSwipeHandle({\n className,\n ...props\n}: React.ComponentProps<\"div\">) {\n return (\n \n )\n}\n\nfunction DrawerContent({\n className,\n children,\n ...props\n}: DrawerPrimitive.Popup.Props) {\n const { hasSnapPoints, modal, showSwipeHandle, swipeDirection } = useDrawer()\n const swipeAxis =\n swipeDirection === \"down\" || swipeDirection === \"up\" ? \"y\" : \"x\"\n\n return (\n \n {modal === true && (\n \n )}\n \n \n {showSwipeHandle && }\n \n {children}\n \n \n \n \n )\n}\n\nfunction DrawerHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n \n )\n}\n\nfunction DrawerFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n \n )\n}\n\nfunction DrawerTitle({ className, ...props }: DrawerPrimitive.Title.Props) {\n return (\n \n )\n}\n\nfunction DrawerDescription({\n className,\n ...props\n}: DrawerPrimitive.Description.Props) {\n return (\n \n )\n}\n\nexport {\n Drawer,\n DrawerPortal,\n DrawerOverlay,\n DrawerSwipeHandle,\n DrawerTrigger,\n DrawerClose,\n DrawerContent,\n DrawerHeader,\n DrawerFooter,\n DrawerTitle,\n DrawerDescription,\n}\n", + "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { Drawer as DrawerPrimitive } from \"@base-ui/react/drawer\"\n\nimport { cn } from \"@/registry/base-sera/lib/utils\"\n\ntype DrawerContextProps = {\n hasSnapPoints: boolean\n modal: DrawerPrimitive.Root.Props[\"modal\"]\n showSwipeHandle: boolean\n swipeDirection: NonNullable\n}\n\nconst DrawerContext = React.createContext(null)\n\nfunction useDrawer() {\n const context = React.useContext(DrawerContext)\n\n if (!context) {\n throw new Error(\"useDrawer must be used within a Drawer.\")\n }\n\n return context\n}\n\nfunction Drawer({\n modal = true,\n showSwipeHandle = false,\n snapPoints,\n swipeDirection = \"down\",\n ...props\n}: DrawerPrimitive.Root.Props & {\n showSwipeHandle?: boolean\n}) {\n const hasSnapPoints = snapPoints != null && snapPoints.length > 0\n const contextValue = React.useMemo(\n () => ({ hasSnapPoints, modal, showSwipeHandle, swipeDirection }),\n [hasSnapPoints, modal, showSwipeHandle, swipeDirection]\n )\n\n return (\n \n \n \n )\n}\n\nfunction DrawerTrigger({ ...props }: DrawerPrimitive.Trigger.Props) {\n return \n}\n\nfunction DrawerPortal({ ...props }: DrawerPrimitive.Portal.Props) {\n return \n}\n\nfunction DrawerClose({ ...props }: DrawerPrimitive.Close.Props) {\n return \n}\n\nfunction DrawerOverlay({\n className,\n ...props\n}: DrawerPrimitive.Backdrop.Props) {\n return (\n \n )\n}\n\nfunction DrawerSwipeHandle({\n className,\n ...props\n}: React.ComponentProps<\"div\">) {\n return (\n \n )\n}\n\nfunction DrawerContent({\n className,\n children,\n ...props\n}: DrawerPrimitive.Popup.Props) {\n const { hasSnapPoints, modal, showSwipeHandle, swipeDirection } = useDrawer()\n const swipeAxis =\n swipeDirection === \"down\" || swipeDirection === \"up\" ? \"y\" : \"x\"\n\n return (\n \n {modal === true && (\n \n )}\n \n \n {showSwipeHandle && }\n \n {children}\n \n \n \n \n )\n}\n\nfunction DrawerHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n \n )\n}\n\nfunction DrawerFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n \n )\n}\n\nfunction DrawerTitle({ className, ...props }: DrawerPrimitive.Title.Props) {\n return (\n \n )\n}\n\nfunction DrawerDescription({\n className,\n ...props\n}: DrawerPrimitive.Description.Props) {\n return (\n \n )\n}\n\nexport {\n Drawer,\n DrawerPortal,\n DrawerOverlay,\n DrawerSwipeHandle,\n DrawerTrigger,\n DrawerClose,\n DrawerContent,\n DrawerHeader,\n DrawerFooter,\n DrawerTitle,\n DrawerDescription,\n}\n", "type": "registry:ui" } ], diff --git a/apps/v4/public/r/styles/base-vega/drawer.json b/apps/v4/public/r/styles/base-vega/drawer.json index aa471a2239..7694a6d479 100644 --- a/apps/v4/public/r/styles/base-vega/drawer.json +++ b/apps/v4/public/r/styles/base-vega/drawer.json @@ -7,7 +7,7 @@ "files": [ { "path": "registry/base-vega/ui/drawer.tsx", - "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { Drawer as DrawerPrimitive } from \"@base-ui/react/drawer\"\n\nimport { cn } from \"@/registry/base-vega/lib/utils\"\n\ntype DrawerContextProps = {\n hasSnapPoints: boolean\n modal: DrawerPrimitive.Root.Props[\"modal\"]\n showSwipeHandle: boolean\n swipeDirection: NonNullable\n}\n\nconst DrawerContext = React.createContext(null)\n\nfunction useDrawer() {\n const context = React.useContext(DrawerContext)\n\n if (!context) {\n throw new Error(\"useDrawer must be used within a Drawer.\")\n }\n\n return context\n}\n\nfunction Drawer({\n modal = true,\n showSwipeHandle = false,\n snapPoints,\n swipeDirection = \"down\",\n ...props\n}: DrawerPrimitive.Root.Props & {\n showSwipeHandle?: boolean\n}) {\n const hasSnapPoints = snapPoints != null && snapPoints.length > 0\n const contextValue = React.useMemo(\n () => ({ hasSnapPoints, modal, showSwipeHandle, swipeDirection }),\n [hasSnapPoints, modal, showSwipeHandle, swipeDirection]\n )\n\n return (\n \n \n \n )\n}\n\nfunction DrawerTrigger({ ...props }: DrawerPrimitive.Trigger.Props) {\n return \n}\n\nfunction DrawerPortal({ ...props }: DrawerPrimitive.Portal.Props) {\n return \n}\n\nfunction DrawerClose({ ...props }: DrawerPrimitive.Close.Props) {\n return \n}\n\nfunction DrawerOverlay({\n className,\n ...props\n}: DrawerPrimitive.Backdrop.Props) {\n return (\n \n )\n}\n\nfunction DrawerSwipeHandle({\n className,\n ...props\n}: React.ComponentProps<\"div\">) {\n return (\n \n )\n}\n\nfunction DrawerContent({\n className,\n children,\n ...props\n}: DrawerPrimitive.Popup.Props) {\n const { hasSnapPoints, modal, showSwipeHandle, swipeDirection } = useDrawer()\n const swipeAxis =\n swipeDirection === \"down\" || swipeDirection === \"up\" ? \"y\" : \"x\"\n\n return (\n \n {modal === true && (\n \n )}\n \n \n {showSwipeHandle && }\n \n {children}\n \n \n \n \n )\n}\n\nfunction DrawerHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n \n )\n}\n\nfunction DrawerFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n \n )\n}\n\nfunction DrawerTitle({ className, ...props }: DrawerPrimitive.Title.Props) {\n return (\n \n )\n}\n\nfunction DrawerDescription({\n className,\n ...props\n}: DrawerPrimitive.Description.Props) {\n return (\n \n )\n}\n\nexport {\n Drawer,\n DrawerPortal,\n DrawerOverlay,\n DrawerSwipeHandle,\n DrawerTrigger,\n DrawerClose,\n DrawerContent,\n DrawerHeader,\n DrawerFooter,\n DrawerTitle,\n DrawerDescription,\n}\n", + "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { Drawer as DrawerPrimitive } from \"@base-ui/react/drawer\"\n\nimport { cn } from \"@/registry/base-vega/lib/utils\"\n\ntype DrawerContextProps = {\n hasSnapPoints: boolean\n modal: DrawerPrimitive.Root.Props[\"modal\"]\n showSwipeHandle: boolean\n swipeDirection: NonNullable\n}\n\nconst DrawerContext = React.createContext(null)\n\nfunction useDrawer() {\n const context = React.useContext(DrawerContext)\n\n if (!context) {\n throw new Error(\"useDrawer must be used within a Drawer.\")\n }\n\n return context\n}\n\nfunction Drawer({\n modal = true,\n showSwipeHandle = false,\n snapPoints,\n swipeDirection = \"down\",\n ...props\n}: DrawerPrimitive.Root.Props & {\n showSwipeHandle?: boolean\n}) {\n const hasSnapPoints = snapPoints != null && snapPoints.length > 0\n const contextValue = React.useMemo(\n () => ({ hasSnapPoints, modal, showSwipeHandle, swipeDirection }),\n [hasSnapPoints, modal, showSwipeHandle, swipeDirection]\n )\n\n return (\n \n \n \n )\n}\n\nfunction DrawerTrigger({ ...props }: DrawerPrimitive.Trigger.Props) {\n return \n}\n\nfunction DrawerPortal({ ...props }: DrawerPrimitive.Portal.Props) {\n return \n}\n\nfunction DrawerClose({ ...props }: DrawerPrimitive.Close.Props) {\n return \n}\n\nfunction DrawerOverlay({\n className,\n ...props\n}: DrawerPrimitive.Backdrop.Props) {\n return (\n \n )\n}\n\nfunction DrawerSwipeHandle({\n className,\n ...props\n}: React.ComponentProps<\"div\">) {\n return (\n \n )\n}\n\nfunction DrawerContent({\n className,\n children,\n ...props\n}: DrawerPrimitive.Popup.Props) {\n const { hasSnapPoints, modal, showSwipeHandle, swipeDirection } = useDrawer()\n const swipeAxis =\n swipeDirection === \"down\" || swipeDirection === \"up\" ? \"y\" : \"x\"\n\n return (\n \n {modal === true && (\n \n )}\n \n \n {showSwipeHandle && }\n \n {children}\n \n \n \n \n )\n}\n\nfunction DrawerHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n \n )\n}\n\nfunction DrawerFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n \n )\n}\n\nfunction DrawerTitle({ className, ...props }: DrawerPrimitive.Title.Props) {\n return (\n \n )\n}\n\nfunction DrawerDescription({\n className,\n ...props\n}: DrawerPrimitive.Description.Props) {\n return (\n \n )\n}\n\nexport {\n Drawer,\n DrawerPortal,\n DrawerOverlay,\n DrawerSwipeHandle,\n DrawerTrigger,\n DrawerClose,\n DrawerContent,\n DrawerHeader,\n DrawerFooter,\n DrawerTitle,\n DrawerDescription,\n}\n", "type": "registry:ui" } ], diff --git a/apps/v4/registry/bases/base/ui/drawer.tsx b/apps/v4/registry/bases/base/ui/drawer.tsx index 91fdb540c6..505f7326fe 100644 --- a/apps/v4/registry/bases/base/ui/drawer.tsx +++ b/apps/v4/registry/bases/base/ui/drawer.tsx @@ -114,7 +114,7 @@ function DrawerContent({