diff --git a/app/gluons/header/page.tsx b/app/gluons/header/page.tsx new file mode 100644 index 0000000..4775cd2 --- /dev/null +++ b/app/gluons/header/page.tsx @@ -0,0 +1,51 @@ +import { Demo } from "@/components/demo"; +import { Header, HeaderCenter, HeaderContainer, HeaderLeft, HeaderMobileMenuTrigger, HeaderRight } from "@/components/gluons/header"; +import { Button } from "@/components/ui/button"; +import { AlignLeft } from "lucide-react"; + +const HeaderPage = async () => { + + return ( + +
+ + + + Logo + + + Center + + + Right + + +
+
+
+
+
+ {Array.from({ length: 3 }).map((_, i) => ( +
+ ))} +
+
+
+ {Array.from({ length: 4 }).map((_, i) => ( +
+ ))} +
+
+
+
+
+ ) +} + +export default HeaderPage; \ No newline at end of file diff --git a/components/demo-preview.tsx b/components/demo-preview.tsx index 21047c7..2b04fec 100644 --- a/components/demo-preview.tsx +++ b/components/demo-preview.tsx @@ -2,10 +2,9 @@ import { Card, CardContent, CardHeader } from "@/components/ui/card"; import { Button } from "@/components/ui/button"; -import { Laptop, LayoutDashboard, Smartphone, Tablet } from "lucide-react"; +import { Laptop, Smartphone, Tablet } from "lucide-react"; import { useState } from "react"; import { cn } from "@/lib/utils"; -import { Sidebar } from "./sidebar"; type DevicePreview = "desktop" | "tablet" | "smartphone" @@ -57,12 +56,12 @@ export const DemoPreview = ({ -
- +>(({ className, ...props}, ref) => ( +
+ +)); +Header.displayName = "Header"; + +const HeaderContainer = React.forwardRef< + HTMLDivElement, + React.HTMLAttributes +>(({ className, ...props }, ref) => ( +
+)); +HeaderContainer.displayName = "HeaderContainer"; + +const HeaderLeft = React.forwardRef< + HTMLDivElement, + React.HTMLAttributes +>(({ className, ...props }, ref) => ( +
+)); +HeaderLeft.displayName = "HeaderLeft"; + +const headerCenterVariants = cva( + "relative flex-1 hidden @lg:flex flex-row items-center justify-center h-full gap-4", + { + variants: { + align: { + left: "justify-start", + center: "justify-center", + right: "justify-end", + } + }, + defaultVariants: { + align: "center", + }, + } +); + +export interface HeaderCenterProps + extends React.HTMLAttributes, + VariantProps { + asChild?: boolean; + } + +const HeaderCenter = React.forwardRef< + HTMLDivElement, + HeaderCenterProps +>(({ className, align, asChild = false, ...props }, ref) => { + const Comp = asChild ? Slot : "div" + return ( + + ); +}); +HeaderCenter.displayName = "HeaderCenter"; + +const HeaderRight = React.forwardRef< + HTMLDivElement, + React.HTMLAttributes +>(({ className, ...props }, ref) => ( +
+)); +HeaderRight.displayName = "HeaderRight"; + +const HeaderMobileMenuTrigger = React.forwardRef< + HTMLButtonElement, + React.ButtonHTMLAttributes +>(({ className, ...props }, ref) => ( + +)); +HeaderMobileMenuTrigger.displayName = "HeaderMobileMenuTrigger"; + +const HeaderMobileMenu = React.forwardRef< + HTMLDivElement, + React.HTMLAttributes +>(({ className, ...props }, ref) => ( +
+)); +HeaderMobileMenu.displayName = "HeaderMobileMenu"; + +export { + Header, + HeaderContainer, + HeaderLeft, + HeaderCenter, + headerCenterVariants, + HeaderRight, + HeaderMobileMenuTrigger, + HeaderMobileMenu, +}; \ No newline at end of file diff --git a/components/gluons/hover-grid.tsx b/components/gluons/hover-grid.tsx index e8830b8..725f54f 100644 --- a/components/gluons/hover-grid.tsx +++ b/components/gluons/hover-grid.tsx @@ -52,7 +52,11 @@ const HoverGridLeader = React.forwardRef< >(({ className, children, ...props }, ref) => (
{children} @@ -66,7 +70,11 @@ const HoverGridContent = React.forwardRef< >(({ className, ...props }, ref) => (
)); @@ -90,7 +98,10 @@ const HoverGridDescription = React.forwardRef< >(({ className, ...props }, ref) => (

)); @@ -102,7 +113,9 @@ const HoverGridFooter = React.forwardRef< >(({ className, ...props }, ref) => (

)); diff --git a/components/sidebar/navigation.tsx b/components/sidebar/navigation.tsx index 2fecb49..e4e7735 100644 --- a/components/sidebar/navigation.tsx +++ b/components/sidebar/navigation.tsx @@ -1,34 +1,36 @@ "use client"; -import { Cpu, Laptop, Layout, Tag } from "lucide-react"; - import { NavItem } from "./nav-item"; export const Navigation = () => { const routes = [ { - label: "Getting Started", - href: "#", + label: "Carousel", + href: "/gluons/carousel", + }, + { + label: "Content Accordion", + href: "/gluons/content-accordion", }, { - label: "Docs", - href: "#", + label: "Header", + href: "/gluons/header", }, { - label: "Gluons", - href: "#", + label: "HoverGrid", + href: "/gluons/hover-grid", }, { - label: "Components", - href: "#", + label: "Playground", + href: "/gluons/playground", }, ]; return (

    - {routes.map((route) => ( + {routes.map((route, i) => ( diff --git a/utils/get-demo-preview-id.tsx b/utils/get-demo-preview-id.tsx new file mode 100644 index 0000000..db2c113 --- /dev/null +++ b/utils/get-demo-preview-id.tsx @@ -0,0 +1,10 @@ +"use client" + +let demoContainer: HTMLElement | null = null; + +if (typeof document !== 'undefined') { + demoContainer = document.getElementById("demoPreviewContainer"); + console.log(demoContainer, "demoContainer"); +} + +export const demoPreviewId = demoContainer; \ No newline at end of file