@sykoramaros/marosh-components 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +56 -0
- package/dist/cli/index.cjs +7854 -0
- package/package.json +14 -3
- package/src/App.css +42 -0
- package/src/App.tsx +42 -0
- package/src/components/CustomButton.tsx +32 -0
- package/src/components/Footer.tsx +59 -0
- package/src/components/MainNav.tsx +81 -0
- package/src/components/ui/button.tsx +62 -0
- package/src/components/ui/input.tsx +21 -0
- package/src/components/ui/navigation-menu.tsx +168 -0
- package/src/components/ui/separator.tsx +26 -0
- package/src/components/ui/sheet.tsx +139 -0
- package/src/components/ui/sidebar.tsx +726 -0
- package/src/components/ui/skeleton.tsx +13 -0
- package/src/components/ui/tooltip.tsx +59 -0
- package/src/hooks/use-mobile.ts +19 -0
- package/src/index.css +122 -0
- package/src/index.ts +17 -0
- package/src/lib/utils.ts +6 -0
- package/src/main.tsx +10 -0
package/package.json
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sykoramaros/marosh-components",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"module": "./dist/index.mjs",
|
|
8
8
|
"types": "./dist/index.d.ts",
|
|
9
|
+
"bin": {
|
|
10
|
+
"marosh": "./dist/cli/index.cjs"
|
|
11
|
+
},
|
|
9
12
|
"exports": {
|
|
10
13
|
".": {
|
|
11
14
|
"types": "./dist/index.d.ts",
|
|
@@ -16,11 +19,14 @@
|
|
|
16
19
|
},
|
|
17
20
|
"files": [
|
|
18
21
|
"dist",
|
|
22
|
+
"src",
|
|
19
23
|
"README.md"
|
|
20
24
|
],
|
|
21
25
|
"scripts": {
|
|
22
26
|
"dev": "bun run vite",
|
|
23
|
-
"build": "bun run
|
|
27
|
+
"build": "bun run build:lib && bun run build:cli",
|
|
28
|
+
"build:lib": "bun run vite build",
|
|
29
|
+
"build:cli": "bun run tsup",
|
|
24
30
|
"lint": "bun run eslint .",
|
|
25
31
|
"preview": "bun run vite preview",
|
|
26
32
|
"prepublishOnly": "bun run build"
|
|
@@ -46,20 +52,25 @@
|
|
|
46
52
|
},
|
|
47
53
|
"devDependencies": {
|
|
48
54
|
"@eslint/js": "^9.39.1",
|
|
55
|
+
"@inquirer/prompts": "^8.2.0",
|
|
49
56
|
"@tailwindcss/vite": "^4.1.18",
|
|
50
|
-
"@types/
|
|
57
|
+
"@types/fs-extra": "^11.0.4",
|
|
58
|
+
"@types/node": "^25.0.10",
|
|
51
59
|
"@types/react": "^19.2.5",
|
|
52
60
|
"@types/react-dom": "^19.2.3",
|
|
53
61
|
"@vitejs/plugin-react": "^5.1.1",
|
|
54
62
|
"autoprefixer": "^10.4.23",
|
|
63
|
+
"commander": "^14.0.2",
|
|
55
64
|
"eslint": "^9.39.1",
|
|
56
65
|
"eslint-plugin-react-hooks": "^7.0.1",
|
|
57
66
|
"eslint-plugin-react-refresh": "^0.4.24",
|
|
67
|
+
"fs-extra": "^11.3.3",
|
|
58
68
|
"globals": "^16.5.0",
|
|
59
69
|
"postcss": "^8.5.6",
|
|
60
70
|
"react": "^19.2.0",
|
|
61
71
|
"react-dom": "^19.2.0",
|
|
62
72
|
"tailwindcss": "^4.0.0",
|
|
73
|
+
"tsup": "^8.5.1",
|
|
63
74
|
"tw-animate-css": "^1.4.0",
|
|
64
75
|
"typescript": "~5.9.3",
|
|
65
76
|
"typescript-eslint": "^8.46.4",
|
package/src/App.css
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/* #root {
|
|
2
|
+
max-width: 1280px;
|
|
3
|
+
margin: 0 auto;
|
|
4
|
+
padding: 2rem;
|
|
5
|
+
text-align: center;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.logo {
|
|
9
|
+
height: 6em;
|
|
10
|
+
padding: 1.5em;
|
|
11
|
+
will-change: filter;
|
|
12
|
+
transition: filter 300ms;
|
|
13
|
+
}
|
|
14
|
+
.logo:hover {
|
|
15
|
+
filter: drop-shadow(0 0 2em #646cffaa);
|
|
16
|
+
}
|
|
17
|
+
.logo.react:hover {
|
|
18
|
+
filter: drop-shadow(0 0 2em #61dafbaa);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@keyframes logo-spin {
|
|
22
|
+
from {
|
|
23
|
+
transform: rotate(0deg);
|
|
24
|
+
}
|
|
25
|
+
to {
|
|
26
|
+
transform: rotate(360deg);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
31
|
+
a:nth-of-type(2) .logo {
|
|
32
|
+
animation: logo-spin infinite 20s linear;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.card {
|
|
37
|
+
padding: 2em;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.read-the-docs {
|
|
41
|
+
color: #888;
|
|
42
|
+
} */
|
package/src/App.tsx
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// import "./App.css"
|
|
2
|
+
|
|
3
|
+
import { Button } from "@/components/ui/button"
|
|
4
|
+
import { CustomButton } from "@/components/CustomButton"
|
|
5
|
+
import { MainNav } from "@/components/MainNav"
|
|
6
|
+
import { Menu } from "lucide-react"
|
|
7
|
+
import { Footer } from "@/components/Footer"
|
|
8
|
+
export const App = () => {
|
|
9
|
+
return (
|
|
10
|
+
<>
|
|
11
|
+
<MainNav
|
|
12
|
+
navItems={[
|
|
13
|
+
{ title: "Home", url: "/", icon: Menu },
|
|
14
|
+
{ title: "About", url: "/about", icon: Menu },
|
|
15
|
+
{ title: "Contact", url: "/contact", icon: Menu },
|
|
16
|
+
]}
|
|
17
|
+
/>
|
|
18
|
+
<Button>Shadcn UI Test</Button>
|
|
19
|
+
<CustomButton>Custom Button</CustomButton>
|
|
20
|
+
<Footer
|
|
21
|
+
links={[
|
|
22
|
+
{ title: "Home", url: "/" },
|
|
23
|
+
{ title: "About", url: "/about" },
|
|
24
|
+
{ title: "Contact", url: "/contact" },
|
|
25
|
+
]}
|
|
26
|
+
socialProfiles={[
|
|
27
|
+
{
|
|
28
|
+
title: "Twitter",
|
|
29
|
+
url: "https://twitter.com/shadcn",
|
|
30
|
+
icon: Menu,
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
title: "GitHub",
|
|
34
|
+
url: "https://github.com/shadcn",
|
|
35
|
+
icon: Menu,
|
|
36
|
+
},
|
|
37
|
+
]}
|
|
38
|
+
copyright="© 2026 Marosh Sykora"
|
|
39
|
+
/>
|
|
40
|
+
</>
|
|
41
|
+
)
|
|
42
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Button, type buttonVariants } from "@/components/ui/button"
|
|
2
|
+
import { cn } from "@/lib/utils"
|
|
3
|
+
import { type VariantProps } from "class-variance-authority"
|
|
4
|
+
|
|
5
|
+
export interface CustomButtonProps
|
|
6
|
+
extends
|
|
7
|
+
React.ComponentPropsWithoutRef<"button">,
|
|
8
|
+
VariantProps<typeof buttonVariants> {
|
|
9
|
+
children: React.ReactNode
|
|
10
|
+
className?: string
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const CustomButton = ({
|
|
14
|
+
children,
|
|
15
|
+
className,
|
|
16
|
+
variant,
|
|
17
|
+
size,
|
|
18
|
+
...props
|
|
19
|
+
}: CustomButtonProps) => {
|
|
20
|
+
return (
|
|
21
|
+
<>
|
|
22
|
+
<Button
|
|
23
|
+
className={cn(className)}
|
|
24
|
+
variant={variant}
|
|
25
|
+
size={size}
|
|
26
|
+
{...props}
|
|
27
|
+
>
|
|
28
|
+
{children}
|
|
29
|
+
</Button>
|
|
30
|
+
</>
|
|
31
|
+
)
|
|
32
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { Button } from "@/components/ui/button"
|
|
2
|
+
import { LucideIcon } from "lucide-react"
|
|
3
|
+
import { cn } from "@/lib/utils"
|
|
4
|
+
|
|
5
|
+
export interface FooterLinks {
|
|
6
|
+
title: string
|
|
7
|
+
url: string
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface FooterSocial {
|
|
11
|
+
title: string
|
|
12
|
+
url: string
|
|
13
|
+
icon?: LucideIcon | React.ComponentType
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface FooterProps extends React.ComponentPropsWithoutRef<"footer"> {
|
|
17
|
+
links: FooterLinks[]
|
|
18
|
+
copyright?: string
|
|
19
|
+
socialProfiles: FooterSocial[]
|
|
20
|
+
className?: string
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const Footer = ({
|
|
24
|
+
links,
|
|
25
|
+
copyright,
|
|
26
|
+
socialProfiles,
|
|
27
|
+
className,
|
|
28
|
+
...props
|
|
29
|
+
}: FooterProps) => {
|
|
30
|
+
return (
|
|
31
|
+
<footer className={cn(className)} {...props}>
|
|
32
|
+
<div className="flex flex-col items-center justify-center gap-5 bg-background py-8 border-t">
|
|
33
|
+
<div className="flex justify-center gap-5 sm:gap-8 xl:gap-13">
|
|
34
|
+
{socialProfiles.map((item) => (
|
|
35
|
+
<Button
|
|
36
|
+
variant="secondary"
|
|
37
|
+
size="icon"
|
|
38
|
+
className="rounded-xl"
|
|
39
|
+
key={item.title}
|
|
40
|
+
>
|
|
41
|
+
<a href={item.url}>{item.icon && <item.icon />}</a>
|
|
42
|
+
</Button>
|
|
43
|
+
))}
|
|
44
|
+
</div>
|
|
45
|
+
<div className="flex justify-center gap-5 sm:gap-8 xl:gap-13">
|
|
46
|
+
{links.map((item) => {
|
|
47
|
+
const to = item.url
|
|
48
|
+
return (
|
|
49
|
+
<a key={item.title} href={to}>
|
|
50
|
+
{item.title}
|
|
51
|
+
</a>
|
|
52
|
+
)
|
|
53
|
+
})}
|
|
54
|
+
</div>
|
|
55
|
+
<div className="text-muted">{copyright}</div>
|
|
56
|
+
</div>
|
|
57
|
+
</footer>
|
|
58
|
+
)
|
|
59
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import {
|
|
2
|
+
NavigationMenu,
|
|
3
|
+
NavigationMenuItem,
|
|
4
|
+
NavigationMenuLink,
|
|
5
|
+
NavigationMenuList,
|
|
6
|
+
navigationMenuTriggerStyle,
|
|
7
|
+
} from "@/components/ui/navigation-menu"
|
|
8
|
+
import { Sheet, SheetTrigger, SheetContent } from "@/components/ui/sheet"
|
|
9
|
+
import { Button } from "./ui/button"
|
|
10
|
+
import { Menu, type LucideIcon } from "lucide-react"
|
|
11
|
+
import { cn } from "@/lib/utils"
|
|
12
|
+
// import React from "react"
|
|
13
|
+
|
|
14
|
+
export interface NavItem {
|
|
15
|
+
title: string
|
|
16
|
+
url: string
|
|
17
|
+
icon?: LucideIcon | React.ComponentType
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface MainNavProps extends React.ComponentPropsWithoutRef<"header"> {
|
|
21
|
+
navItems: NavItem[]
|
|
22
|
+
LinkComponent?: React.ComponentType<{
|
|
23
|
+
to: string
|
|
24
|
+
className?: string
|
|
25
|
+
children: React.ReactNode
|
|
26
|
+
}>
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export const MainNav = ({
|
|
30
|
+
navItems,
|
|
31
|
+
LinkComponent = "a" as any,
|
|
32
|
+
className,
|
|
33
|
+
...props
|
|
34
|
+
}: MainNavProps) => {
|
|
35
|
+
return (
|
|
36
|
+
<header className={cn(className)} {...props}>
|
|
37
|
+
<nav className="hidden sm:flex sticky top-0 z-10 items-center px-4 h-14">
|
|
38
|
+
<NavigationMenu>
|
|
39
|
+
<NavigationMenuList>
|
|
40
|
+
{navItems.map((item) => (
|
|
41
|
+
<NavigationMenuItem key={item.title}>
|
|
42
|
+
<NavigationMenuLink
|
|
43
|
+
asChild
|
|
44
|
+
className={navigationMenuTriggerStyle()}
|
|
45
|
+
>
|
|
46
|
+
<LinkComponent to={item.url} className="flex items-center">
|
|
47
|
+
{item.icon && <item.icon />}
|
|
48
|
+
<span>{item.title}</span>
|
|
49
|
+
</LinkComponent>
|
|
50
|
+
</NavigationMenuLink>
|
|
51
|
+
</NavigationMenuItem>
|
|
52
|
+
))}
|
|
53
|
+
</NavigationMenuList>
|
|
54
|
+
</NavigationMenu>
|
|
55
|
+
</nav>
|
|
56
|
+
<nav className="flex sm:hidden">
|
|
57
|
+
<Sheet>
|
|
58
|
+
<SheetTrigger asChild>
|
|
59
|
+
<Button variant="ghost" size="icon">
|
|
60
|
+
<Menu />
|
|
61
|
+
</Button>
|
|
62
|
+
</SheetTrigger>
|
|
63
|
+
<SheetContent side="top" className="p-8">
|
|
64
|
+
<div className="flex flex-col gap-4">
|
|
65
|
+
{navItems.map((item) => (
|
|
66
|
+
<LinkComponent
|
|
67
|
+
key={item.title}
|
|
68
|
+
to={item.url}
|
|
69
|
+
className="flex items-center gap-2"
|
|
70
|
+
>
|
|
71
|
+
{item.icon && <item.icon />}
|
|
72
|
+
<span className="text-base font-medium">{item.title}</span>
|
|
73
|
+
</LinkComponent>
|
|
74
|
+
))}
|
|
75
|
+
</div>
|
|
76
|
+
</SheetContent>
|
|
77
|
+
</Sheet>
|
|
78
|
+
</nav>
|
|
79
|
+
</header>
|
|
80
|
+
)
|
|
81
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import { Slot } from "@radix-ui/react-slot"
|
|
3
|
+
import { cva, type VariantProps } from "class-variance-authority"
|
|
4
|
+
|
|
5
|
+
import { cn } from "@/lib/utils"
|
|
6
|
+
|
|
7
|
+
const buttonVariants = cva(
|
|
8
|
+
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
9
|
+
{
|
|
10
|
+
variants: {
|
|
11
|
+
variant: {
|
|
12
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
13
|
+
destructive:
|
|
14
|
+
"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
|
|
15
|
+
outline:
|
|
16
|
+
"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
|
|
17
|
+
secondary:
|
|
18
|
+
"bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
19
|
+
ghost:
|
|
20
|
+
"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
|
|
21
|
+
link: "text-primary underline-offset-4 hover:underline",
|
|
22
|
+
},
|
|
23
|
+
size: {
|
|
24
|
+
default: "h-9 px-4 py-2 has-[>svg]:px-3",
|
|
25
|
+
sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
|
|
26
|
+
lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
|
|
27
|
+
icon: "size-9",
|
|
28
|
+
"icon-sm": "size-8",
|
|
29
|
+
"icon-lg": "size-10",
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
defaultVariants: {
|
|
33
|
+
variant: "default",
|
|
34
|
+
size: "default",
|
|
35
|
+
},
|
|
36
|
+
}
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
function Button({
|
|
40
|
+
className,
|
|
41
|
+
variant = "default",
|
|
42
|
+
size = "default",
|
|
43
|
+
asChild = false,
|
|
44
|
+
...props
|
|
45
|
+
}: React.ComponentProps<"button"> &
|
|
46
|
+
VariantProps<typeof buttonVariants> & {
|
|
47
|
+
asChild?: boolean
|
|
48
|
+
}) {
|
|
49
|
+
const Comp = asChild ? Slot : "button"
|
|
50
|
+
|
|
51
|
+
return (
|
|
52
|
+
<Comp
|
|
53
|
+
data-slot="button"
|
|
54
|
+
data-variant={variant}
|
|
55
|
+
data-size={size}
|
|
56
|
+
className={cn(buttonVariants({ variant, size, className }))}
|
|
57
|
+
{...props}
|
|
58
|
+
/>
|
|
59
|
+
)
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export { Button, buttonVariants }
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
|
|
3
|
+
import { cn } from "@/lib/utils"
|
|
4
|
+
|
|
5
|
+
function Input({ className, type, ...props }: React.ComponentProps<"input">) {
|
|
6
|
+
return (
|
|
7
|
+
<input
|
|
8
|
+
type={type}
|
|
9
|
+
data-slot="input"
|
|
10
|
+
className={cn(
|
|
11
|
+
"file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
|
12
|
+
"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
|
|
13
|
+
"aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
14
|
+
className
|
|
15
|
+
)}
|
|
16
|
+
{...props}
|
|
17
|
+
/>
|
|
18
|
+
)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export { Input }
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu"
|
|
3
|
+
import { cva } from "class-variance-authority"
|
|
4
|
+
import { ChevronDownIcon } from "lucide-react"
|
|
5
|
+
|
|
6
|
+
import { cn } from "@/lib/utils"
|
|
7
|
+
|
|
8
|
+
function NavigationMenu({
|
|
9
|
+
className,
|
|
10
|
+
children,
|
|
11
|
+
viewport = true,
|
|
12
|
+
...props
|
|
13
|
+
}: React.ComponentProps<typeof NavigationMenuPrimitive.Root> & {
|
|
14
|
+
viewport?: boolean
|
|
15
|
+
}) {
|
|
16
|
+
return (
|
|
17
|
+
<NavigationMenuPrimitive.Root
|
|
18
|
+
data-slot="navigation-menu"
|
|
19
|
+
data-viewport={viewport}
|
|
20
|
+
className={cn(
|
|
21
|
+
"group/navigation-menu relative flex max-w-max flex-1 items-center justify-center",
|
|
22
|
+
className
|
|
23
|
+
)}
|
|
24
|
+
{...props}
|
|
25
|
+
>
|
|
26
|
+
{children}
|
|
27
|
+
{viewport && <NavigationMenuViewport />}
|
|
28
|
+
</NavigationMenuPrimitive.Root>
|
|
29
|
+
)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function NavigationMenuList({
|
|
33
|
+
className,
|
|
34
|
+
...props
|
|
35
|
+
}: React.ComponentProps<typeof NavigationMenuPrimitive.List>) {
|
|
36
|
+
return (
|
|
37
|
+
<NavigationMenuPrimitive.List
|
|
38
|
+
data-slot="navigation-menu-list"
|
|
39
|
+
className={cn(
|
|
40
|
+
"group flex flex-1 list-none items-center justify-center gap-1",
|
|
41
|
+
className
|
|
42
|
+
)}
|
|
43
|
+
{...props}
|
|
44
|
+
/>
|
|
45
|
+
)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function NavigationMenuItem({
|
|
49
|
+
className,
|
|
50
|
+
...props
|
|
51
|
+
}: React.ComponentProps<typeof NavigationMenuPrimitive.Item>) {
|
|
52
|
+
return (
|
|
53
|
+
<NavigationMenuPrimitive.Item
|
|
54
|
+
data-slot="navigation-menu-item"
|
|
55
|
+
className={cn("relative", className)}
|
|
56
|
+
{...props}
|
|
57
|
+
/>
|
|
58
|
+
)
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const navigationMenuTriggerStyle = cva(
|
|
62
|
+
"group inline-flex h-9 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=open]:hover:bg-accent data-[state=open]:text-accent-foreground data-[state=open]:focus:bg-accent data-[state=open]:bg-accent/50 focus-visible:ring-ring/50 outline-none transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1"
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
function NavigationMenuTrigger({
|
|
66
|
+
className,
|
|
67
|
+
children,
|
|
68
|
+
...props
|
|
69
|
+
}: React.ComponentProps<typeof NavigationMenuPrimitive.Trigger>) {
|
|
70
|
+
return (
|
|
71
|
+
<NavigationMenuPrimitive.Trigger
|
|
72
|
+
data-slot="navigation-menu-trigger"
|
|
73
|
+
className={cn(navigationMenuTriggerStyle(), "group", className)}
|
|
74
|
+
{...props}
|
|
75
|
+
>
|
|
76
|
+
{children}{" "}
|
|
77
|
+
<ChevronDownIcon
|
|
78
|
+
className="relative top-[1px] ml-1 size-3 transition duration-300 group-data-[state=open]:rotate-180"
|
|
79
|
+
aria-hidden="true"
|
|
80
|
+
/>
|
|
81
|
+
</NavigationMenuPrimitive.Trigger>
|
|
82
|
+
)
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function NavigationMenuContent({
|
|
86
|
+
className,
|
|
87
|
+
...props
|
|
88
|
+
}: React.ComponentProps<typeof NavigationMenuPrimitive.Content>) {
|
|
89
|
+
return (
|
|
90
|
+
<NavigationMenuPrimitive.Content
|
|
91
|
+
data-slot="navigation-menu-content"
|
|
92
|
+
className={cn(
|
|
93
|
+
"data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 top-0 left-0 w-full p-2 pr-2.5 md:absolute md:w-auto",
|
|
94
|
+
"group-data-[viewport=false]/navigation-menu:bg-popover group-data-[viewport=false]/navigation-menu:text-popover-foreground group-data-[viewport=false]/navigation-menu:data-[state=open]:animate-in group-data-[viewport=false]/navigation-menu:data-[state=closed]:animate-out group-data-[viewport=false]/navigation-menu:data-[state=closed]:zoom-out-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:zoom-in-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:fade-in-0 group-data-[viewport=false]/navigation-menu:data-[state=closed]:fade-out-0 group-data-[viewport=false]/navigation-menu:top-full group-data-[viewport=false]/navigation-menu:mt-1.5 group-data-[viewport=false]/navigation-menu:overflow-hidden group-data-[viewport=false]/navigation-menu:rounded-md group-data-[viewport=false]/navigation-menu:border group-data-[viewport=false]/navigation-menu:shadow group-data-[viewport=false]/navigation-menu:duration-200 **:data-[slot=navigation-menu-link]:focus:ring-0 **:data-[slot=navigation-menu-link]:focus:outline-none",
|
|
95
|
+
className
|
|
96
|
+
)}
|
|
97
|
+
{...props}
|
|
98
|
+
/>
|
|
99
|
+
)
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function NavigationMenuViewport({
|
|
103
|
+
className,
|
|
104
|
+
...props
|
|
105
|
+
}: React.ComponentProps<typeof NavigationMenuPrimitive.Viewport>) {
|
|
106
|
+
return (
|
|
107
|
+
<div
|
|
108
|
+
className={cn(
|
|
109
|
+
"absolute top-full left-0 isolate z-50 flex justify-center"
|
|
110
|
+
)}
|
|
111
|
+
>
|
|
112
|
+
<NavigationMenuPrimitive.Viewport
|
|
113
|
+
data-slot="navigation-menu-viewport"
|
|
114
|
+
className={cn(
|
|
115
|
+
"origin-top-center bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border shadow md:w-[var(--radix-navigation-menu-viewport-width)]",
|
|
116
|
+
className
|
|
117
|
+
)}
|
|
118
|
+
{...props}
|
|
119
|
+
/>
|
|
120
|
+
</div>
|
|
121
|
+
)
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
function NavigationMenuLink({
|
|
125
|
+
className,
|
|
126
|
+
...props
|
|
127
|
+
}: React.ComponentProps<typeof NavigationMenuPrimitive.Link>) {
|
|
128
|
+
return (
|
|
129
|
+
<NavigationMenuPrimitive.Link
|
|
130
|
+
data-slot="navigation-menu-link"
|
|
131
|
+
className={cn(
|
|
132
|
+
"data-[active=true]:focus:bg-accent data-[active=true]:hover:bg-accent data-[active=true]:bg-accent/50 data-[active=true]:text-accent-foreground hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus-visible:ring-ring/50 [&_svg:not([class*='text-'])]:text-muted-foreground flex flex-col gap-1 rounded-sm p-2 text-sm transition-all outline-none focus-visible:ring-[3px] focus-visible:outline-1 [&_svg:not([class*='size-'])]:size-4",
|
|
133
|
+
className
|
|
134
|
+
)}
|
|
135
|
+
{...props}
|
|
136
|
+
/>
|
|
137
|
+
)
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
function NavigationMenuIndicator({
|
|
141
|
+
className,
|
|
142
|
+
...props
|
|
143
|
+
}: React.ComponentProps<typeof NavigationMenuPrimitive.Indicator>) {
|
|
144
|
+
return (
|
|
145
|
+
<NavigationMenuPrimitive.Indicator
|
|
146
|
+
data-slot="navigation-menu-indicator"
|
|
147
|
+
className={cn(
|
|
148
|
+
"data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden",
|
|
149
|
+
className
|
|
150
|
+
)}
|
|
151
|
+
{...props}
|
|
152
|
+
>
|
|
153
|
+
<div className="bg-border relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm shadow-md" />
|
|
154
|
+
</NavigationMenuPrimitive.Indicator>
|
|
155
|
+
)
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export {
|
|
159
|
+
NavigationMenu,
|
|
160
|
+
NavigationMenuList,
|
|
161
|
+
NavigationMenuItem,
|
|
162
|
+
NavigationMenuContent,
|
|
163
|
+
NavigationMenuTrigger,
|
|
164
|
+
NavigationMenuLink,
|
|
165
|
+
NavigationMenuIndicator,
|
|
166
|
+
NavigationMenuViewport,
|
|
167
|
+
navigationMenuTriggerStyle,
|
|
168
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import * as SeparatorPrimitive from "@radix-ui/react-separator"
|
|
3
|
+
|
|
4
|
+
import { cn } from "@/lib/utils"
|
|
5
|
+
|
|
6
|
+
function Separator({
|
|
7
|
+
className,
|
|
8
|
+
orientation = "horizontal",
|
|
9
|
+
decorative = true,
|
|
10
|
+
...props
|
|
11
|
+
}: React.ComponentProps<typeof SeparatorPrimitive.Root>) {
|
|
12
|
+
return (
|
|
13
|
+
<SeparatorPrimitive.Root
|
|
14
|
+
data-slot="separator"
|
|
15
|
+
decorative={decorative}
|
|
16
|
+
orientation={orientation}
|
|
17
|
+
className={cn(
|
|
18
|
+
"bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
|
|
19
|
+
className
|
|
20
|
+
)}
|
|
21
|
+
{...props}
|
|
22
|
+
/>
|
|
23
|
+
)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export { Separator }
|