@cryptlex/web-components 1.2.1 → 1.2.2
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.
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { jsxs as m, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import * as g from "react";
|
|
3
|
-
import { Slot as
|
|
3
|
+
import { Slot as v } from "@radix-ui/react-slot";
|
|
4
4
|
import { cva as p } from "class-variance-authority";
|
|
5
|
-
import { cn as
|
|
6
|
-
import { Loader as
|
|
7
|
-
const
|
|
8
|
-
"inline-flex items-center justify-center whitespace-nowrap rounded-lg text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
|
|
5
|
+
import { cn as b } from "../../utils/index.es.js";
|
|
6
|
+
import { Loader as x } from "./loader.es.js";
|
|
7
|
+
const h = p(
|
|
8
|
+
"inline-flex items-center justify-center no-underline whitespace-nowrap rounded-lg text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
|
|
9
9
|
{
|
|
10
10
|
variants: {
|
|
11
11
|
variant: {
|
|
12
|
-
default: "bg-primary text-primary-foreground hover:bg-primary/80",
|
|
13
|
-
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
14
|
-
outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
|
|
15
|
-
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
12
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/80 hover:text-primary-foreground",
|
|
13
|
+
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90 hover:text-destructive-foreground",
|
|
14
|
+
outline: "border border-input text-accent bg-background hover:bg-accent hover:text-accent-foreground",
|
|
15
|
+
secondary: "bg-secondary text-secondary-foreground hover:text-secondary-foreground hover:bg-secondary/80",
|
|
16
16
|
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
17
17
|
link: "text-primary underline-offset-4 hover:underline"
|
|
18
18
|
},
|
|
@@ -35,21 +35,21 @@ const x = p(
|
|
|
35
35
|
size: a,
|
|
36
36
|
loading: t,
|
|
37
37
|
disabled: d,
|
|
38
|
-
asChild:
|
|
38
|
+
asChild: u = !1,
|
|
39
39
|
icon: o,
|
|
40
40
|
children: e,
|
|
41
|
-
...
|
|
41
|
+
...c
|
|
42
42
|
}, f) => {
|
|
43
|
-
const l =
|
|
43
|
+
const l = u ? v : "button", n = o;
|
|
44
44
|
return /* @__PURE__ */ m(
|
|
45
45
|
l,
|
|
46
46
|
{
|
|
47
|
-
className:
|
|
47
|
+
className: b(h({ variant: s, size: a, className: i })),
|
|
48
48
|
ref: f,
|
|
49
49
|
disabled: t || d,
|
|
50
|
-
...
|
|
50
|
+
...c,
|
|
51
51
|
children: [
|
|
52
|
-
t ? /* @__PURE__ */ r(
|
|
52
|
+
t ? /* @__PURE__ */ r(x, {}) : n ? /* @__PURE__ */ r(n, { className: "h-4 w-4" }) : null,
|
|
53
53
|
e ? /* @__PURE__ */ r("div", { className: o && e ? "ml-2" : "", children: e }) : null
|
|
54
54
|
]
|
|
55
55
|
}
|
|
@@ -59,6 +59,6 @@ const x = p(
|
|
|
59
59
|
y.displayName = "Button";
|
|
60
60
|
export {
|
|
61
61
|
y as Button,
|
|
62
|
-
|
|
62
|
+
h as buttonVariants
|
|
63
63
|
};
|
|
64
64
|
//# sourceMappingURL=button.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.es.js","sources":["../../../lib/components/ui/button.tsx"],"sourcesContent":["import * as React from \"react\"\nimport { Slot } from \"@radix-ui/react-slot\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/utils\"\nimport { Loader } from \"./loader\";\nimport { LucideIcon } from \"lucide-react\";\n\nconst buttonVariants = cva(\n \"inline-flex items-center justify-center whitespace-nowrap rounded-lg text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground hover:bg-primary/80\",\n destructive:\n \"bg-destructive text-destructive-foreground hover:bg-destructive/90\",\n outline:\n \"border border-input bg-background hover:bg-accent hover:text-accent-foreground\",\n secondary:\n \"bg-secondary text-secondary-foreground hover:bg-secondary/80\",\n ghost: \"hover:bg-accent hover:text-accent-foreground\",\n link: \"text-primary underline-offset-4 hover:underline\",\n },\n size: {\n default: \"h-10 px-4 py-2\",\n sm: \"h-9 rounded-md px-3\",\n lg: \"h-11 rounded-md px-8\",\n icon: \"h-10 w-10\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n);\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n asChild?: boolean;\n loading?: boolean;\n icon?: LucideIcon;\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n className,\n variant,\n size,\n loading,\n disabled,\n asChild = false,\n icon,\n children,\n ...props\n },\n ref\n ) => {\n const Comp = asChild ? Slot : \"button\";\n const Icon = icon;\n\n return (\n <Comp\n className={cn(buttonVariants({ variant, size, className }))}\n ref={ref}\n disabled={loading || disabled}\n {...props}\n >\n {/* Shows loading when `loading:true` irrespective of icon present or not; otherwise shows button icon if present */}\n {loading ? <Loader /> : Icon ? <Icon className=\"h-4 w-4\" /> : null}\n {/* Margin left only when both icon and children (button text) are present */}\n {children ? (\n <div className={icon && children ? \"ml-2\" : \"\"}>{children}</div>\n ) : null}\n </Comp>\n );\n }\n);\n\nButton.displayName = \"Button\"; // Set display name for better debugging\n\nexport { Button, buttonVariants };\n"],"names":["buttonVariants","cva","Button","React","className","variant","size","loading","disabled","asChild","icon","children","props","ref","Comp","Slot","Icon","jsxs","cn","jsx","Loader"],"mappings":";;;;;;AAQA,MAAMA,IAAiBC;AAAA,EACrB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SAAS;AAAA,QACT,aACE;AAAA,QACF,SACE;AAAA,QACF,WACE;AAAA,QACF,OAAO;AAAA,QACP,MAAM;AAAA,MACR;AAAA,MACA,MAAM;AAAA,QACJ,SAAS;AAAA,QACT,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,MAAM;AAAA,MAAA;AAAA,IAEV;AAAA,IACA,iBAAiB;AAAA,MACf,SAAS;AAAA,MACT,MAAM;AAAA,IAAA;AAAA,EACR;AAEJ,GAUMC,IAASC,EAAM;AAAA,EACnB,CACE;AAAA,IACE,WAAAC;AAAA,IACA,SAAAC;AAAA,IACA,MAAAC;AAAA,IACA,SAAAC;AAAA,IACA,UAAAC;AAAA,IACA,SAAAC,IAAU;AAAA,IACV,MAAAC;AAAA,IACA,UAAAC;AAAA,IACA,GAAGC;AAAA,KAELC,MACG;AACG,UAAAC,IAAOL,IAAUM,IAAO,UACxBC,IAAON;AAGX,WAAA,gBAAAO;AAAA,MAACH;AAAA,MAAA;AAAA,QACC,WAAWI,EAAGlB,EAAe,EAAE,SAAAK,GAAS,MAAAC,GAAM,WAAAF,EAAA,CAAW,CAAC;AAAA,QAC1D,KAAAS;AAAA,QACA,UAAUN,KAAWC;AAAA,QACpB,GAAGI;AAAA,QAGH,UAAA;AAAA,UAAUL,IAAA,gBAAAY,EAACC,KAAO,IAAKJ,sBAAQA,GAAK,EAAA,WAAU,WAAU,IAAK;AAAA,UAE7DL,sBACE,OAAI,EAAA,WAAWD,KAAQC,IAAW,SAAS,IAAK,UAAAA,EAAA,CAAS,IACxD;AAAA,QAAA;AAAA,MAAA;AAAA,IACN;AAAA,EAAA;AAGN;AAEAT,EAAO,cAAc;"}
|
|
1
|
+
{"version":3,"file":"button.es.js","sources":["../../../lib/components/ui/button.tsx"],"sourcesContent":["import * as React from \"react\"\nimport { Slot } from \"@radix-ui/react-slot\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/utils\"\nimport { Loader } from \"./loader\";\nimport { LucideIcon } from \"lucide-react\";\n\nconst buttonVariants = cva(\n \"inline-flex items-center justify-center no-underline whitespace-nowrap rounded-lg text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground hover:bg-primary/80 hover:text-primary-foreground\",\n destructive:\n \"bg-destructive text-destructive-foreground hover:bg-destructive/90 hover:text-destructive-foreground\",\n outline:\n \"border border-input text-accent bg-background hover:bg-accent hover:text-accent-foreground\",\n secondary:\n \"bg-secondary text-secondary-foreground hover:text-secondary-foreground hover:bg-secondary/80\",\n ghost: \"hover:bg-accent hover:text-accent-foreground\",\n link: \"text-primary underline-offset-4 hover:underline\",\n },\n size: {\n default: \"h-10 px-4 py-2\",\n sm: \"h-9 rounded-md px-3\",\n lg: \"h-11 rounded-md px-8\",\n icon: \"h-10 w-10\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n);\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n asChild?: boolean;\n loading?: boolean;\n icon?: LucideIcon;\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n className,\n variant,\n size,\n loading,\n disabled,\n asChild = false,\n icon,\n children,\n ...props\n },\n ref\n ) => {\n const Comp = asChild ? Slot : \"button\";\n const Icon = icon;\n\n return (\n <Comp\n className={cn(buttonVariants({ variant, size, className }))}\n ref={ref}\n disabled={loading || disabled}\n {...props}\n >\n {/* Shows loading when `loading:true` irrespective of icon present or not; otherwise shows button icon if present */}\n {loading ? <Loader /> : Icon ? <Icon className=\"h-4 w-4\" /> : null}\n {/* Margin left only when both icon and children (button text) are present */}\n {children ? (\n <div className={icon && children ? \"ml-2\" : \"\"}>{children}</div>\n ) : null}\n </Comp>\n );\n }\n);\n\nButton.displayName = \"Button\"; // Set display name for better debugging\n\nexport { Button, buttonVariants };\n"],"names":["buttonVariants","cva","Button","React","className","variant","size","loading","disabled","asChild","icon","children","props","ref","Comp","Slot","Icon","jsxs","cn","jsx","Loader"],"mappings":";;;;;;AAQA,MAAMA,IAAiBC;AAAA,EACrB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SAAS;AAAA,QACT,aACE;AAAA,QACF,SACE;AAAA,QACF,WACE;AAAA,QACF,OAAO;AAAA,QACP,MAAM;AAAA,MACR;AAAA,MACA,MAAM;AAAA,QACJ,SAAS;AAAA,QACT,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,MAAM;AAAA,MAAA;AAAA,IAEV;AAAA,IACA,iBAAiB;AAAA,MACf,SAAS;AAAA,MACT,MAAM;AAAA,IAAA;AAAA,EACR;AAEJ,GAUMC,IAASC,EAAM;AAAA,EACnB,CACE;AAAA,IACE,WAAAC;AAAA,IACA,SAAAC;AAAA,IACA,MAAAC;AAAA,IACA,SAAAC;AAAA,IACA,UAAAC;AAAA,IACA,SAAAC,IAAU;AAAA,IACV,MAAAC;AAAA,IACA,UAAAC;AAAA,IACA,GAAGC;AAAA,KAELC,MACG;AACG,UAAAC,IAAOL,IAAUM,IAAO,UACxBC,IAAON;AAGX,WAAA,gBAAAO;AAAA,MAACH;AAAA,MAAA;AAAA,QACC,WAAWI,EAAGlB,EAAe,EAAE,SAAAK,GAAS,MAAAC,GAAM,WAAAF,EAAA,CAAW,CAAC;AAAA,QAC1D,KAAAS;AAAA,QACA,UAAUN,KAAWC;AAAA,QACpB,GAAGI;AAAA,QAGH,UAAA;AAAA,UAAUL,IAAA,gBAAAY,EAACC,KAAO,IAAKJ,sBAAQA,GAAK,EAAA,WAAU,WAAU,IAAK;AAAA,UAE7DL,sBACE,OAAI,EAAA,WAAWD,KAAQC,IAAW,SAAS,IAAK,UAAAA,EAAA,CAAS,IACxD;AAAA,QAAA;AAAA,MAAA;AAAA,IACN;AAAA,EAAA;AAGN;AAEAT,EAAO,cAAc;"}
|
|
@@ -1,49 +1,48 @@
|
|
|
1
|
-
import { jsxs as s, jsx as
|
|
1
|
+
import { jsxs as s, jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import * as r from "react";
|
|
3
|
-
import * as
|
|
3
|
+
import * as t from "@radix-ui/react-navigation-menu";
|
|
4
4
|
import { cva as c } from "class-variance-authority";
|
|
5
|
-
import { cn as
|
|
5
|
+
import { cn as n } from "../../utils/index.es.js";
|
|
6
6
|
import { ChevronDownIcon as f } from "@radix-ui/react-icons";
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
import { buttonVariants as u } from "./button.es.js";
|
|
8
|
+
const p = r.forwardRef(({ className: e, children: a, ...o }, d) => /* @__PURE__ */ s(
|
|
9
|
+
t.Root,
|
|
9
10
|
{
|
|
10
11
|
ref: d,
|
|
11
|
-
className:
|
|
12
|
+
className: n(
|
|
12
13
|
"relative z-10 flex max-w-max flex-1 items-center justify-center",
|
|
13
|
-
|
|
14
|
+
e
|
|
14
15
|
),
|
|
15
16
|
...o,
|
|
16
17
|
children: [
|
|
17
18
|
a,
|
|
18
|
-
/* @__PURE__ */
|
|
19
|
+
/* @__PURE__ */ i(m, {})
|
|
19
20
|
]
|
|
20
21
|
}
|
|
21
22
|
));
|
|
22
|
-
|
|
23
|
-
const
|
|
24
|
-
|
|
23
|
+
p.displayName = t.Root.displayName;
|
|
24
|
+
const g = r.forwardRef(({ className: e, ...a }, o) => /* @__PURE__ */ i(
|
|
25
|
+
t.List,
|
|
25
26
|
{
|
|
26
27
|
ref: o,
|
|
27
|
-
className:
|
|
28
|
+
className: n(
|
|
28
29
|
"group flex flex-1 list-none items-center justify-center space-x-1 flex-wrap",
|
|
29
|
-
|
|
30
|
+
e
|
|
30
31
|
),
|
|
31
32
|
...a
|
|
32
33
|
}
|
|
33
34
|
));
|
|
34
|
-
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
), v = r.forwardRef(({ className: t, children: a, ...o }, d) => /* @__PURE__ */ s(
|
|
38
|
-
e.Trigger,
|
|
35
|
+
g.displayName = t.List.displayName;
|
|
36
|
+
const j = t.Item, v = c(u({ size: "sm", variant: "outline" })), N = r.forwardRef(({ className: e, children: a, ...o }, d) => /* @__PURE__ */ s(
|
|
37
|
+
t.Trigger,
|
|
39
38
|
{
|
|
40
39
|
ref: d,
|
|
41
|
-
className:
|
|
40
|
+
className: n(v(), "group", e),
|
|
42
41
|
...o,
|
|
43
42
|
children: [
|
|
44
43
|
a,
|
|
45
44
|
" ",
|
|
46
|
-
/* @__PURE__ */
|
|
45
|
+
/* @__PURE__ */ i(
|
|
47
46
|
f,
|
|
48
47
|
{
|
|
49
48
|
className: "relative top-[1px] ml-1 h-3 w-3 transition duration-300 group-data-[state=open]:rotate-180",
|
|
@@ -53,70 +52,70 @@ const I = e.Item, g = c(
|
|
|
53
52
|
]
|
|
54
53
|
}
|
|
55
54
|
));
|
|
56
|
-
|
|
57
|
-
const
|
|
58
|
-
|
|
55
|
+
N.displayName = t.Trigger.displayName;
|
|
56
|
+
const h = r.forwardRef(({ className: e, ...a }, o) => /* @__PURE__ */ i(
|
|
57
|
+
t.Content,
|
|
59
58
|
{
|
|
60
59
|
ref: o,
|
|
61
|
-
className:
|
|
60
|
+
className: n(
|
|
62
61
|
"left-0 top-0 w-full 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 md:absolute md:w-auto ",
|
|
63
|
-
|
|
62
|
+
e
|
|
64
63
|
),
|
|
65
64
|
...a
|
|
66
65
|
}
|
|
67
66
|
));
|
|
68
|
-
|
|
69
|
-
const
|
|
70
|
-
|
|
67
|
+
h.displayName = t.Content.displayName;
|
|
68
|
+
const w = t.Link, m = r.forwardRef(({ className: e, ...a }, o) => /* @__PURE__ */ i("div", { className: n("absolute left-0 top-full flex justify-center"), children: /* @__PURE__ */ i(
|
|
69
|
+
t.Viewport,
|
|
71
70
|
{
|
|
72
|
-
className:
|
|
71
|
+
className: n(
|
|
73
72
|
"origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]",
|
|
74
|
-
|
|
73
|
+
e
|
|
75
74
|
),
|
|
76
75
|
ref: o,
|
|
77
76
|
...a
|
|
78
77
|
}
|
|
79
78
|
) }));
|
|
80
|
-
m.displayName =
|
|
81
|
-
const x = r.forwardRef(({ className:
|
|
82
|
-
|
|
79
|
+
m.displayName = t.Viewport.displayName;
|
|
80
|
+
const x = r.forwardRef(({ className: e, ...a }, o) => /* @__PURE__ */ i(
|
|
81
|
+
t.Indicator,
|
|
83
82
|
{
|
|
84
83
|
ref: o,
|
|
85
|
-
className:
|
|
84
|
+
className: n(
|
|
86
85
|
"top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in",
|
|
87
|
-
|
|
86
|
+
e
|
|
88
87
|
),
|
|
89
88
|
...a,
|
|
90
|
-
children: /* @__PURE__ */
|
|
89
|
+
children: /* @__PURE__ */ i("div", { className: "relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md" })
|
|
91
90
|
}
|
|
92
91
|
));
|
|
93
|
-
x.displayName =
|
|
94
|
-
const
|
|
92
|
+
x.displayName = t.Indicator.displayName;
|
|
93
|
+
const y = r.forwardRef(({ className: e, title: a, children: o, ...d }, l) => /* @__PURE__ */ i("li", { children: /* @__PURE__ */ i(w, { asChild: !0, children: /* @__PURE__ */ s(
|
|
95
94
|
"a",
|
|
96
95
|
{
|
|
97
96
|
ref: l,
|
|
98
|
-
className:
|
|
99
|
-
"block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground",
|
|
100
|
-
|
|
97
|
+
className: n(
|
|
98
|
+
"block select-none text-accent space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground",
|
|
99
|
+
e
|
|
101
100
|
),
|
|
102
101
|
...d,
|
|
103
102
|
children: [
|
|
104
|
-
/* @__PURE__ */
|
|
105
|
-
/* @__PURE__ */
|
|
103
|
+
/* @__PURE__ */ i("div", { className: "text-sm font-medium leading-none", children: a }),
|
|
104
|
+
/* @__PURE__ */ i("p", { className: "line-clamp-2 text-sm leading-snug text-muted-foreground", children: o })
|
|
106
105
|
]
|
|
107
106
|
}
|
|
108
107
|
) }) }));
|
|
109
|
-
|
|
108
|
+
y.displayName = "NavigationItemListItem";
|
|
110
109
|
export {
|
|
111
|
-
|
|
112
|
-
|
|
110
|
+
p as NavigationMenu,
|
|
111
|
+
h as NavigationMenuContent,
|
|
113
112
|
x as NavigationMenuIndicator,
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
113
|
+
j as NavigationMenuItem,
|
|
114
|
+
w as NavigationMenuLink,
|
|
115
|
+
g as NavigationMenuList,
|
|
116
|
+
y as NavigationMenuListItem,
|
|
117
|
+
N as NavigationMenuTrigger,
|
|
119
118
|
m as NavigationMenuViewport,
|
|
120
|
-
|
|
119
|
+
v as navigationMenuTriggerStyle
|
|
121
120
|
};
|
|
122
121
|
//# sourceMappingURL=navigation-menu.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation-menu.es.js","sources":["../../../lib/components/ui/navigation-menu.tsx"],"sourcesContent":["import * as React from \"react\"\nimport * as NavigationMenuPrimitive from \"@radix-ui/react-navigation-menu\"\nimport { cva } from \"class-variance-authority\"\nimport { cn } from \"@/utils\"\nimport { ChevronDownIcon } from \"@radix-ui/react-icons\"\n\nconst NavigationMenu = React.forwardRef<\n React.ElementRef<typeof NavigationMenuPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Root>\n>(({ className, children, ...props }, ref) => (\n <NavigationMenuPrimitive.Root\n ref={ref}\n className={cn(\n \"relative z-10 flex max-w-max flex-1 items-center justify-center\",\n className\n )}\n {...props}\n >\n {children}\n <NavigationMenuViewport />\n </NavigationMenuPrimitive.Root>\n))\nNavigationMenu.displayName = NavigationMenuPrimitive.Root.displayName\n\nconst NavigationMenuList = React.forwardRef<\n React.ElementRef<typeof NavigationMenuPrimitive.List>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.List>\n>(({ className, ...props }, ref) => (\n <NavigationMenuPrimitive.List\n ref={ref}\n className={cn(\n \"group flex flex-1 list-none items-center justify-center space-x-1 flex-wrap\",\n className\n )}\n {...props}\n />\n))\nNavigationMenuList.displayName = NavigationMenuPrimitive.List.displayName\n\nconst NavigationMenuItem = NavigationMenuPrimitive.Item\n\nconst navigationMenuTriggerStyle = cva(
|
|
1
|
+
{"version":3,"file":"navigation-menu.es.js","sources":["../../../lib/components/ui/navigation-menu.tsx"],"sourcesContent":["import * as React from \"react\"\nimport * as NavigationMenuPrimitive from \"@radix-ui/react-navigation-menu\"\nimport { cva } from \"class-variance-authority\"\nimport { cn } from \"@/utils\"\nimport { ChevronDownIcon } from \"@radix-ui/react-icons\"\nimport { buttonVariants } from \"./button\"\n\nconst NavigationMenu = React.forwardRef<\n React.ElementRef<typeof NavigationMenuPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Root>\n>(({ className, children, ...props }, ref) => (\n <NavigationMenuPrimitive.Root\n ref={ref}\n className={cn(\n \"relative z-10 flex max-w-max flex-1 items-center justify-center\",\n className\n )}\n {...props}\n >\n {children}\n <NavigationMenuViewport />\n </NavigationMenuPrimitive.Root>\n))\nNavigationMenu.displayName = NavigationMenuPrimitive.Root.displayName\n\nconst NavigationMenuList = React.forwardRef<\n React.ElementRef<typeof NavigationMenuPrimitive.List>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.List>\n>(({ className, ...props }, ref) => (\n <NavigationMenuPrimitive.List\n ref={ref}\n className={cn(\n \"group flex flex-1 list-none items-center justify-center space-x-1 flex-wrap\",\n className\n )}\n {...props}\n />\n))\nNavigationMenuList.displayName = NavigationMenuPrimitive.List.displayName\n\nconst NavigationMenuItem = NavigationMenuPrimitive.Item\n\nconst navigationMenuTriggerStyle = cva(buttonVariants({size:'sm', variant: 'outline'}))\n\nconst NavigationMenuTrigger = React.forwardRef<\n React.ElementRef<typeof NavigationMenuPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Trigger>\n>(({ className, children, ...props }, ref) => (\n <NavigationMenuPrimitive.Trigger\n ref={ref}\n className={cn(navigationMenuTriggerStyle(), \"group\", className)}\n {...props}\n >\n {children}{\" \"}\n <ChevronDownIcon\n className=\"relative top-[1px] ml-1 h-3 w-3 transition duration-300 group-data-[state=open]:rotate-180\"\n aria-hidden=\"true\"\n />\n </NavigationMenuPrimitive.Trigger>\n))\nNavigationMenuTrigger.displayName = NavigationMenuPrimitive.Trigger.displayName\n\nconst NavigationMenuContent = React.forwardRef<\n React.ElementRef<typeof NavigationMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Content>\n>(({ className, ...props }, ref) => (\n <NavigationMenuPrimitive.Content\n ref={ref}\n className={cn(\n \"left-0 top-0 w-full 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 md:absolute md:w-auto \",\n className\n )}\n {...props}\n />\n))\nNavigationMenuContent.displayName = NavigationMenuPrimitive.Content.displayName\n\nconst NavigationMenuLink = NavigationMenuPrimitive.Link\n\nconst NavigationMenuViewport = React.forwardRef<\n React.ElementRef<typeof NavigationMenuPrimitive.Viewport>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Viewport>\n>(({ className, ...props }, ref) => (\n <div className={cn(\"absolute left-0 top-full flex justify-center\")}>\n <NavigationMenuPrimitive.Viewport\n className={cn(\n \"origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]\",\n className\n )}\n ref={ref}\n {...props}\n />\n </div>\n))\nNavigationMenuViewport.displayName =\n NavigationMenuPrimitive.Viewport.displayName\n\nconst NavigationMenuIndicator = React.forwardRef<\n React.ElementRef<typeof NavigationMenuPrimitive.Indicator>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Indicator>\n>(({ className, ...props }, ref) => (\n <NavigationMenuPrimitive.Indicator\n ref={ref}\n className={cn(\n \"top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in\",\n className\n )}\n {...props}\n >\n <div className=\"relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md\" />\n </NavigationMenuPrimitive.Indicator>\n))\nNavigationMenuIndicator.displayName =\n NavigationMenuPrimitive.Indicator.displayName\n\nconst NavigationMenuListItem = React.forwardRef<\n React.ElementRef<\"a\">,\n React.ComponentPropsWithoutRef<\"a\">\n>(({ className, title, children, ...props }, ref) => {\n return (\n <li>\n <NavigationMenuLink asChild>\n <a\n ref={ref}\n className={cn(\n \"block select-none text-accent space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground\",\n className\n )}\n {...props}\n >\n <div className=\"text-sm font-medium leading-none\">{title}</div>\n <p className=\"line-clamp-2 text-sm leading-snug text-muted-foreground\">\n {children}\n </p>\n </a>\n </NavigationMenuLink>\n </li>\n )\n})\nNavigationMenuListItem.displayName = \"NavigationItemListItem\"\n\nexport {\n navigationMenuTriggerStyle,\n NavigationMenu,\n NavigationMenuList,\n NavigationMenuItem,\n NavigationMenuContent,\n NavigationMenuTrigger,\n NavigationMenuLink,\n NavigationMenuIndicator,\n NavigationMenuViewport,\n NavigationMenuListItem\n}\n"],"names":["NavigationMenu","React","className","children","props","ref","jsxs","NavigationMenuPrimitive","cn","NavigationMenuViewport","NavigationMenuList","jsx","NavigationMenuItem","navigationMenuTriggerStyle","cva","buttonVariants","NavigationMenuTrigger","ChevronDownIcon","NavigationMenuContent","NavigationMenuLink","NavigationMenuIndicator","NavigationMenuListItem","title"],"mappings":";;;;;;;AAOM,MAAAA,IAAiBC,EAAM,WAG3B,CAAC,EAAE,WAAAC,GAAW,UAAAC,GAAU,GAAGC,KAASC,MACpC,gBAAAC;AAAA,EAACC,EAAwB;AAAA,EAAxB;AAAA,IACC,KAAAF;AAAA,IACA,WAAWG;AAAA,MACT;AAAA,MACAN;AAAA,IACF;AAAA,IACC,GAAGE;AAAA,IAEH,UAAA;AAAA,MAAAD;AAAA,wBACAM,GAAuB,CAAA,CAAA;AAAA,IAAA;AAAA,EAAA;AAC1B,CACD;AACDT,EAAe,cAAcO,EAAwB,KAAK;AAEpD,MAAAG,IAAqBT,EAAM,WAG/B,CAAC,EAAE,WAAAC,GAAW,GAAGE,EAAM,GAAGC,MAC1B,gBAAAM;AAAA,EAACJ,EAAwB;AAAA,EAAxB;AAAA,IACC,KAAAF;AAAA,IACA,WAA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