@cryptlex/web-components 1.4.0 → 1.5.0
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 +4 -13
- package/dist/components/data-table/column-picker.es.js +3 -4
- package/dist/components/data-table/column-picker.es.js.map +1 -1
- package/dist/components/data-table/data-table.es.js +84 -83
- package/dist/components/data-table/data-table.es.js.map +1 -1
- package/dist/components/data-table/page-size.es.js +5 -5
- package/dist/components/data-table/page-size.es.js.map +1 -1
- package/dist/components/data-table/paginator.es.js +25 -31
- package/dist/components/data-table/paginator.es.js.map +1 -1
- package/dist/components/data-table/table-actions.es.js +26 -27
- package/dist/components/data-table/table-actions.es.js.map +1 -1
- package/dist/components/data-table/table-commons.es.js +5 -4
- package/dist/components/data-table/table-commons.es.js.map +1 -1
- package/dist/components/data-table/table-content.es.js +34 -31
- package/dist/components/data-table/table-content.es.js.map +1 -1
- package/dist/components/data-table/table-filter.es.js +42 -45
- package/dist/components/data-table/table-filter.es.js.map +1 -1
- package/dist/components/key-value-card/key-value-card.es.js +17 -14
- package/dist/components/key-value-card/key-value-card.es.js.map +1 -1
- package/dist/components/sidebar/app-layout.es.js +11 -15
- package/dist/components/sidebar/app-layout.es.js.map +1 -1
- package/dist/components/sidebar/breadcrumb.es.js +2 -3
- package/dist/components/sidebar/breadcrumb.es.js.map +1 -1
- package/dist/components/sidebar/nav-main.es.js +18 -18
- package/dist/components/sidebar/nav-main.es.js.map +1 -1
- package/dist/components/static-data-table/data-table.es.js +14 -14
- package/dist/components/static-data-table/data-table.es.js.map +1 -1
- package/dist/components/ui/accordion.es.js +9 -9
- package/dist/components/ui/accordion.es.js.map +1 -1
- package/dist/components/ui/avatar.es.js +16 -16
- package/dist/components/ui/avatar.es.js.map +1 -1
- package/dist/components/ui/badge.es.js +5 -24
- package/dist/components/ui/badge.es.js.map +1 -1
- package/dist/components/ui/breadcrumb.es.js +10 -10
- package/dist/components/ui/breadcrumb.es.js.map +1 -1
- package/dist/components/ui/button.es.js +17 -18
- package/dist/components/ui/button.es.js.map +1 -1
- package/dist/components/ui/calendar.es.js +8 -8
- package/dist/components/ui/calendar.es.js.map +1 -1
- package/dist/components/ui/card.es.js +21 -21
- package/dist/components/ui/card.es.js.map +1 -1
- package/dist/components/ui/chart.es.js +76 -102
- package/dist/components/ui/chart.es.js.map +1 -1
- package/dist/components/ui/checkbox.es.js +13 -19
- package/dist/components/ui/checkbox.es.js.map +1 -1
- package/dist/components/ui/command.es.js +4 -4
- package/dist/components/ui/command.es.js.map +1 -1
- package/dist/components/ui/copy-button.es.js +20 -34
- package/dist/components/ui/copy-button.es.js.map +1 -1
- package/dist/components/ui/dialog.es.js +32 -32
- package/dist/components/ui/dialog.es.js.map +1 -1
- package/dist/components/ui/drawer.es.js +2 -2
- package/dist/components/ui/drawer.es.js.map +1 -1
- package/dist/components/ui/dropdown-menu.es.js +74 -82
- package/dist/components/ui/dropdown-menu.es.js.map +1 -1
- package/dist/components/ui/input-otp.es.js +17 -17
- package/dist/components/ui/input-otp.es.js.map +1 -1
- package/dist/components/ui/input.es.js +7 -7
- package/dist/components/ui/input.es.js.map +1 -1
- package/dist/components/ui/link-button.es.js +6 -6
- package/dist/components/ui/link-button.es.js.map +1 -1
- package/dist/components/ui/mutli-select.es.js +52 -52
- package/dist/components/ui/mutli-select.es.js.map +1 -1
- package/dist/components/ui/navigation-menu.es.js +34 -34
- package/dist/components/ui/navigation-menu.es.js.map +1 -1
- package/dist/components/ui/pagination.es.js +38 -38
- package/dist/components/ui/pagination.es.js.map +1 -1
- package/dist/components/ui/password-input.es.js +13 -13
- package/dist/components/ui/password-input.es.js.map +1 -1
- package/dist/components/ui/radio-group.es.js +11 -11
- package/dist/components/ui/radio-group.es.js.map +1 -1
- package/dist/components/ui/search-input.es.js +11 -11
- package/dist/components/ui/search-input.es.js.map +1 -1
- package/dist/components/ui/select.es.js +31 -49
- package/dist/components/ui/select.es.js.map +1 -1
- package/dist/components/ui/sheet.es.js +17 -17
- package/dist/components/ui/sheet.es.js.map +1 -1
- package/dist/components/ui/sidebar.es.js +2 -3
- package/dist/components/ui/sidebar.es.js.map +1 -1
- package/dist/components/ui/table-page-layout.es.js +2 -2
- package/dist/components/ui/table-page-layout.es.js.map +1 -1
- package/dist/components/ui/table.es.js +37 -37
- package/dist/components/ui/table.es.js.map +1 -1
- package/dist/components/ui/tabs.es.js +2 -2
- package/dist/components/ui/tabs.es.js.map +1 -1
- package/dist/components/ui/tooltip.es.js +8 -8
- package/dist/components/ui/tooltip.es.js.map +1 -1
- package/dist/index.es.d.ts +29 -54
- package/dist/index.es.js +253 -256
- package/dist/utils/index.es.js.map +1 -1
- package/lib/index.css +24 -5
- package/lib/tailwind.preset.css +52 -40
- package/lib/tokens.css +0 -9
- package/package.json +1 -1
|
@@ -1,92 +1,92 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as o, jsxs as
|
|
3
|
-
import * as
|
|
4
|
-
import * as e from "@radix-ui/react-dialog";
|
|
2
|
+
import { jsx as o, jsxs as n } from "react/jsx-runtime";
|
|
3
|
+
import * as a from "@radix-ui/react-dialog";
|
|
5
4
|
import { Cross2Icon as c } from "@radix-ui/react-icons";
|
|
5
|
+
import * as l from "react";
|
|
6
6
|
import { cn as i } from "../../utils/index.es.js";
|
|
7
|
-
const b =
|
|
8
|
-
|
|
7
|
+
const b = a.Root, h = a.Trigger, m = a.Portal, v = a.Close, r = l.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ o(
|
|
8
|
+
a.Overlay,
|
|
9
9
|
{
|
|
10
10
|
ref: s,
|
|
11
11
|
className: i(
|
|
12
|
-
"fixed inset-0 z-50 bg-
|
|
13
|
-
|
|
12
|
+
"fixed inset-0 z-50 bg-background/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
13
|
+
e
|
|
14
14
|
),
|
|
15
15
|
...t
|
|
16
16
|
}
|
|
17
17
|
));
|
|
18
|
-
|
|
19
|
-
const f = l.forwardRef(({ className:
|
|
20
|
-
/* @__PURE__ */ o(
|
|
21
|
-
/* @__PURE__ */
|
|
22
|
-
|
|
18
|
+
r.displayName = a.Overlay.displayName;
|
|
19
|
+
const f = l.forwardRef(({ className: e, children: t, ...s }, d) => /* @__PURE__ */ n(m, { children: [
|
|
20
|
+
/* @__PURE__ */ o(r, {}),
|
|
21
|
+
/* @__PURE__ */ n(
|
|
22
|
+
a.Content,
|
|
23
23
|
{
|
|
24
|
-
ref:
|
|
24
|
+
ref: d,
|
|
25
25
|
className: i(
|
|
26
|
-
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95
|
|
27
|
-
|
|
26
|
+
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 sm:rounded-lg",
|
|
27
|
+
e
|
|
28
28
|
),
|
|
29
29
|
...s,
|
|
30
30
|
children: [
|
|
31
31
|
t,
|
|
32
|
-
/* @__PURE__ */
|
|
33
|
-
/* @__PURE__ */ o(c, { className: "
|
|
32
|
+
/* @__PURE__ */ n(a.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [
|
|
33
|
+
/* @__PURE__ */ o(c, { className: "size-4" }),
|
|
34
34
|
/* @__PURE__ */ o("span", { className: "sr-only", children: "Close" })
|
|
35
35
|
] })
|
|
36
36
|
]
|
|
37
37
|
}
|
|
38
38
|
)
|
|
39
39
|
] }));
|
|
40
|
-
f.displayName =
|
|
40
|
+
f.displayName = a.Content.displayName;
|
|
41
41
|
const p = ({
|
|
42
|
-
className:
|
|
42
|
+
className: e,
|
|
43
43
|
...t
|
|
44
44
|
}) => /* @__PURE__ */ o(
|
|
45
45
|
"div",
|
|
46
46
|
{
|
|
47
47
|
className: i(
|
|
48
48
|
"flex flex-col space-y-1.5 text-center sm:text-left",
|
|
49
|
-
|
|
49
|
+
e
|
|
50
50
|
),
|
|
51
51
|
...t
|
|
52
52
|
}
|
|
53
53
|
);
|
|
54
54
|
p.displayName = "DialogHeader";
|
|
55
55
|
const g = ({
|
|
56
|
-
className:
|
|
56
|
+
className: e,
|
|
57
57
|
...t
|
|
58
58
|
}) => /* @__PURE__ */ o(
|
|
59
59
|
"div",
|
|
60
60
|
{
|
|
61
61
|
className: i(
|
|
62
62
|
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
|
|
63
|
-
|
|
63
|
+
e
|
|
64
64
|
),
|
|
65
65
|
...t
|
|
66
66
|
}
|
|
67
67
|
);
|
|
68
68
|
g.displayName = "DialogFooter";
|
|
69
|
-
const u = l.forwardRef(({ className:
|
|
70
|
-
|
|
69
|
+
const u = l.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ o(
|
|
70
|
+
a.Title,
|
|
71
71
|
{
|
|
72
72
|
ref: s,
|
|
73
73
|
className: i(
|
|
74
|
-
"
|
|
75
|
-
|
|
74
|
+
"h3",
|
|
75
|
+
e
|
|
76
76
|
),
|
|
77
77
|
...t
|
|
78
78
|
}
|
|
79
79
|
));
|
|
80
|
-
u.displayName =
|
|
81
|
-
const y = l.forwardRef(({ className:
|
|
82
|
-
|
|
80
|
+
u.displayName = a.Title.displayName;
|
|
81
|
+
const y = l.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ o(
|
|
82
|
+
a.Description,
|
|
83
83
|
{
|
|
84
84
|
ref: s,
|
|
85
|
-
className: i("text-body text-muted-foreground",
|
|
85
|
+
className: i("text-body text-muted-foreground", e),
|
|
86
86
|
...t
|
|
87
87
|
}
|
|
88
88
|
));
|
|
89
|
-
y.displayName =
|
|
89
|
+
y.displayName = a.Description.displayName;
|
|
90
90
|
export {
|
|
91
91
|
b as Dialog,
|
|
92
92
|
v as DialogClose,
|
|
@@ -94,7 +94,7 @@ export {
|
|
|
94
94
|
y as DialogDescription,
|
|
95
95
|
g as DialogFooter,
|
|
96
96
|
p as DialogHeader,
|
|
97
|
-
|
|
97
|
+
r as DialogOverlay,
|
|
98
98
|
m as DialogPortal,
|
|
99
99
|
u as DialogTitle,
|
|
100
100
|
h as DialogTrigger
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.es.js","sources":["../../../lib/components/ui/dialog.tsx"],"sourcesContent":["\"use client\"\n\nimport * as
|
|
1
|
+
{"version":3,"file":"dialog.es.js","sources":["../../../lib/components/ui/dialog.tsx"],"sourcesContent":["\"use client\"\n\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\"\nimport { Cross2Icon } from \"@radix-ui/react-icons\"\nimport * as React from \"react\"\n\nimport { cn } from \"@/utils\"\n\nconst Dialog = DialogPrimitive.Root\n\nconst DialogTrigger = DialogPrimitive.Trigger\n\nconst DialogPortal = DialogPrimitive.Portal\n\nconst DialogClose = DialogPrimitive.Close\n\nconst DialogOverlay = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Overlay\n ref={ref}\n className={cn(\n \"fixed inset-0 z-50 bg-background/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\",\n className\n )}\n {...props}\n />\n))\nDialogOverlay.displayName = DialogPrimitive.Overlay.displayName\n\nconst DialogContent = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>\n>(({ className, children, ...props }, ref) => (\n <DialogPortal>\n <DialogOverlay />\n <DialogPrimitive.Content\n ref={ref}\n className={cn(\n \"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 sm:rounded-lg\",\n className\n )}\n {...props}\n >\n {children}\n <DialogPrimitive.Close className=\"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground\">\n <Cross2Icon className=\"size-4\" />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n </DialogPrimitive.Content>\n </DialogPortal>\n))\nDialogContent.displayName = DialogPrimitive.Content.displayName\n\nconst DialogHeader = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n \"flex flex-col space-y-1.5 text-center sm:text-left\",\n className\n )}\n {...props}\n />\n)\nDialogHeader.displayName = \"DialogHeader\"\n\nconst DialogFooter = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n \"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2\",\n className\n )}\n {...props}\n />\n)\nDialogFooter.displayName = \"DialogFooter\"\n\nconst DialogTitle = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Title\n ref={ref}\n className={cn(\n \"h3\",\n className\n )}\n {...props}\n />\n))\nDialogTitle.displayName = DialogPrimitive.Title.displayName\n\nconst DialogDescription = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Description\n ref={ref}\n className={cn(\"text-body text-muted-foreground\", className)}\n {...props}\n />\n))\nDialogDescription.displayName = DialogPrimitive.Description.displayName\n\nexport {\n Dialog, DialogClose,\n DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger\n}\n\n"],"names":["Dialog","DialogPrimitive","DialogTrigger","DialogPortal","DialogClose","DialogOverlay","React","className","props","ref","jsx","cn","DialogContent","children","jsxs","Cross2Icon","DialogHeader","DialogFooter","DialogTitle","DialogDescription"],"mappings":";;;;;;AAQA,MAAMA,IAASC,EAAgB,MAEzBC,IAAgBD,EAAgB,SAEhCE,IAAeF,EAAgB,QAE/BG,IAAcH,EAAgB,OAE9BI,IAAgBC,EAAM,WAG1B,CAAC,EAAE,WAAAC,GAAW,GAAGC,EAAM,GAAGC,MAC1B,gBAAAC;AAAA,EAACT,EAAgB;AAAA,EAAhB;AAAA,IACC,KAAAQ;AAAA,IACA,WAAWE;AAAA,MACT;AAAA,MACAJ;AAAA,IACF;AAAA,IACC,GAAGC;AAAA,EAAA;AACN,CACD;AACDH,EAAc,cAAcJ,EAAgB,QAAQ;AAEpD,MAAMW,IAAgBN,EAAM,WAG1B,CAAC,EAAE,WAAAC,GAAW,UAAAM,GAAU,GAAGL,EAAM,GAAGC,MACpC,gBAAAK,EAACX,GACC,EAAA,UAAA;AAAA,EAAA,gBAAAO,EAACL,GAAc,EAAA;AAAA,EACf,gBAAAS;AAAA,IAACb,EAAgB;AAAA,IAAhB;AAAA,MACC,KAAAQ;AAAA,MACA,WAAWE;AAAA,QACT;AAAA,QACAJ;AAAA,MACF;AAAA,MACC,GAAGC;AAAA,MAEH,UAAA;AAAA,QAAAK;AAAA,QACA,gBAAAC,EAAAb,EAAgB,OAAhB,EAA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
|
@@ -12,7 +12,7 @@ const u = a.Trigger, n = a.Portal, b = a.Close, i = l.forwardRef(({ className: e
|
|
|
12
12
|
a.Overlay,
|
|
13
13
|
{
|
|
14
14
|
ref: o,
|
|
15
|
-
className: s("fixed inset-0 z-50 bg-
|
|
15
|
+
className: s("fixed inset-0 z-50 bg-background/80", e),
|
|
16
16
|
...r
|
|
17
17
|
}
|
|
18
18
|
));
|
|
@@ -38,7 +38,7 @@ const f = ({ className: e, ...r }) => /* @__PURE__ */ t("div", { className: s("g
|
|
|
38
38
|
f.displayName = "DrawerHeader";
|
|
39
39
|
const w = ({ className: e, ...r }) => /* @__PURE__ */ t("div", { className: s("mt-auto flex flex-col gap-2 p-4", e), ...r });
|
|
40
40
|
w.displayName = "DrawerFooter";
|
|
41
|
-
const D = l.forwardRef(({ className: e, ...r }, o) => /* @__PURE__ */ t(a.Title, { ref: o, className: s("
|
|
41
|
+
const D = l.forwardRef(({ className: e, ...r }, o) => /* @__PURE__ */ t(a.Title, { ref: o, className: s("h3", e), ...r }));
|
|
42
42
|
D.displayName = a.Title.displayName;
|
|
43
43
|
const x = l.forwardRef(({ className: e, ...r }, o) => /* @__PURE__ */ t(
|
|
44
44
|
a.Description,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drawer.es.js","sources":["../../../lib/components/ui/drawer.tsx"],"sourcesContent":["'use client';\nimport * as React from 'react';\nimport { Drawer as DrawerPrimitive } from 'vaul';\n\nimport { cn } from '@/utils';\n\nconst Drawer = ({\n shouldScaleBackground = true,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Root>) => (\n <DrawerPrimitive.Root shouldScaleBackground={shouldScaleBackground} {...props} />\n);\nDrawer.displayName = 'Drawer';\n\nconst DrawerTrigger = DrawerPrimitive.Trigger;\n\nconst DrawerPortal: React.FC<React.ComponentProps<typeof DrawerPrimitive.Portal>> =\n DrawerPrimitive.Portal;\n\nconst DrawerClose = DrawerPrimitive.Close;\n\nconst DrawerOverlay = React.forwardRef<\n React.ElementRef<typeof DrawerPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <DrawerPrimitive.Overlay\n ref={ref}\n className={cn('fixed inset-0 z-50 bg-
|
|
1
|
+
{"version":3,"file":"drawer.es.js","sources":["../../../lib/components/ui/drawer.tsx"],"sourcesContent":["'use client';\nimport * as React from 'react';\nimport { Drawer as DrawerPrimitive } from 'vaul';\n\nimport { cn } from '@/utils';\n\nconst Drawer = ({\n shouldScaleBackground = true,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Root>) => (\n <DrawerPrimitive.Root shouldScaleBackground={shouldScaleBackground} {...props} />\n);\nDrawer.displayName = 'Drawer';\n\nconst DrawerTrigger = DrawerPrimitive.Trigger;\n\nconst DrawerPortal: React.FC<React.ComponentProps<typeof DrawerPrimitive.Portal>> =\n DrawerPrimitive.Portal;\n\nconst DrawerClose = DrawerPrimitive.Close;\n\nconst DrawerOverlay = React.forwardRef<\n React.ElementRef<typeof DrawerPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <DrawerPrimitive.Overlay\n ref={ref}\n className={cn('fixed inset-0 z-50 bg-background/80', className)}\n {...props}\n />\n));\nDrawerOverlay.displayName = DrawerPrimitive.Overlay.displayName;\n\nconst DrawerContent = React.forwardRef<\n React.ElementRef<typeof DrawerPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content>\n>(({ className, children, ...props }, ref) => (\n <DrawerPortal>\n <DrawerOverlay />\n <DrawerPrimitive.Content\n ref={ref}\n style={{ userSelect: 'text' }}\n className={cn(\n 'fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background',\n className,\n )}\n {...props}\n >\n {children}\n </DrawerPrimitive.Content>\n </DrawerPortal>\n));\nDrawerContent.displayName = 'DrawerContent';\n\nconst DrawerHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div className={cn('grid gap-1.5 p-4 text-center sm:text-left', className)} {...props} />\n);\nDrawerHeader.displayName = 'DrawerHeader';\n\nconst DrawerFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div className={cn('mt-auto flex flex-col gap-2 p-4', className)} {...props} />\n);\nDrawerFooter.displayName = 'DrawerFooter';\n\nconst DrawerTitle = React.forwardRef<\n React.ElementRef<typeof DrawerPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DrawerPrimitive.Title ref={ref} className={cn('h3', className)} {...props} />\n));\nDrawerTitle.displayName = DrawerPrimitive.Title.displayName;\n\nconst DrawerDescription = React.forwardRef<\n React.ElementRef<typeof DrawerPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DrawerPrimitive.Description\n ref={ref}\n className={cn('text-body text-muted-foreground', className)}\n {...props}\n />\n));\nDrawerDescription.displayName = DrawerPrimitive.Description.displayName;\n\nexport {\n Drawer,\n DrawerClose,\n DrawerContent,\n DrawerDescription,\n DrawerFooter,\n DrawerHeader,\n DrawerOverlay,\n DrawerPortal,\n DrawerTitle,\n DrawerTrigger\n};\n\n"],"names":["Drawer","shouldScaleBackground","props","DrawerPrimitive","DrawerTrigger","DrawerPortal","DrawerClose","DrawerOverlay","React","className","ref","jsx","cn","DrawerContent","children","jsxs","DrawerHeader","DrawerFooter","DrawerTitle","DrawerDescription"],"mappings":";;;;;AAMA,MAAMA,IAAS,CAAC;AAAA,EACd,uBAAAC,IAAwB;AAAA,EACxB,GAAGC;AACL,wBACGC,EAAgB,MAAhB,EAAqB,uBAAAF,GAA+C,GAAGC,EAAO,CAAA;AAEjFF,EAAO,cAAc;AAErB,MAAMI,IAAgBD,EAAgB,SAEhCE,IACJF,EAAgB,QAEZG,IAAcH,EAAgB,OAE9BI,IAAgB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E1C,MAAAgB,IAAoBX,EAAM,WAG9B,CAAC,EAAE,WAAAC,GAAW,GAAGP,EAAM,GAAGQ,MAC1B,gBAAAC;AAAA,EAACR,EAAgB;AAAA,EAAhB;AAAA,IACC,KAAAO;AAAA,IACA,WAAWE,EAAG,mCAAmCH,CAAS;AAAA,IACzD,GAAGP;AAAA,EAAA;AACN,CACD;AACDiB,EAAkB,cAAchB,EAAgB,YAAY;"}
|
|
@@ -1,145 +1,137 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
1
|
+
import { jsxs as m, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { Button as p, buttonVariants as l } from "./button.es.js";
|
|
3
|
+
import { cn as d } from "../../utils/index.es.js";
|
|
3
4
|
import * as e from "@radix-ui/react-dropdown-menu";
|
|
4
|
-
import { ChevronRightIcon as c, CheckIcon as
|
|
5
|
-
import
|
|
6
|
-
const
|
|
5
|
+
import { ChevronRightIcon as c, CheckIcon as u, DotFilledIcon as f } from "@radix-ui/react-icons";
|
|
6
|
+
import * as r from "react";
|
|
7
|
+
const v = e.Root, C = e.Trigger, S = e.Group, k = e.Portal, T = e.Sub, G = e.RadioGroup, w = r.forwardRef(({ className: o, inset: t, children: a, ...s }, i) => /* @__PURE__ */ m(
|
|
7
8
|
e.SubTrigger,
|
|
8
9
|
{
|
|
9
10
|
ref: i,
|
|
10
|
-
className:
|
|
11
|
+
className: d(
|
|
11
12
|
"flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-body outline-hidden focus:bg-accent data-[state=open]:bg-accent",
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
t && "pl-8",
|
|
14
|
+
o
|
|
14
15
|
),
|
|
15
|
-
...
|
|
16
|
+
...s,
|
|
16
17
|
children: [
|
|
17
18
|
a,
|
|
18
|
-
/* @__PURE__ */ n(c, { className: "ml-auto
|
|
19
|
+
/* @__PURE__ */ n(c, { className: "ml-auto size-4" })
|
|
19
20
|
]
|
|
20
21
|
}
|
|
21
22
|
));
|
|
22
|
-
|
|
23
|
-
const
|
|
23
|
+
w.displayName = e.SubTrigger.displayName;
|
|
24
|
+
const b = r.forwardRef(({ className: o, ...t }, a) => /* @__PURE__ */ n(
|
|
24
25
|
e.SubContent,
|
|
25
26
|
{
|
|
26
27
|
ref: a,
|
|
27
|
-
className:
|
|
28
|
-
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover
|
|
29
|
-
|
|
28
|
+
className: d(
|
|
29
|
+
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
30
|
+
o
|
|
30
31
|
),
|
|
31
|
-
...
|
|
32
|
+
...t
|
|
32
33
|
}
|
|
33
34
|
));
|
|
34
|
-
|
|
35
|
-
const
|
|
35
|
+
b.displayName = e.SubContent.displayName;
|
|
36
|
+
const N = r.forwardRef(({ className: o, sideOffset: t = 4, ...a }, s) => /* @__PURE__ */ n(e.Portal, { children: /* @__PURE__ */ n(
|
|
36
37
|
e.Content,
|
|
37
38
|
{
|
|
38
|
-
ref:
|
|
39
|
-
sideOffset:
|
|
40
|
-
className:
|
|
41
|
-
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover
|
|
39
|
+
ref: s,
|
|
40
|
+
sideOffset: t,
|
|
41
|
+
className: d(
|
|
42
|
+
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md",
|
|
42
43
|
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
43
|
-
|
|
44
|
+
o
|
|
44
45
|
),
|
|
45
46
|
...a
|
|
46
47
|
}
|
|
47
48
|
) }));
|
|
48
|
-
|
|
49
|
-
const
|
|
50
|
-
|
|
49
|
+
N.displayName = e.Content.displayName;
|
|
50
|
+
const g = r.forwardRef(({ className: o, ...t }, a) => /* @__PURE__ */ n(
|
|
51
|
+
p,
|
|
51
52
|
{
|
|
52
|
-
ref:
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
ref: a,
|
|
54
|
+
variant: "ghost",
|
|
55
|
+
className: d(
|
|
56
|
+
"rounded-none w-full",
|
|
57
|
+
o
|
|
57
58
|
),
|
|
58
|
-
...
|
|
59
|
+
...t
|
|
59
60
|
}
|
|
60
61
|
));
|
|
61
|
-
|
|
62
|
-
const h =
|
|
62
|
+
g.displayName = e.Item.displayName;
|
|
63
|
+
const h = r.forwardRef(({ className: o, children: t, checked: a, ...s }, i) => /* @__PURE__ */ m(
|
|
63
64
|
e.CheckboxItem,
|
|
64
65
|
{
|
|
65
66
|
ref: i,
|
|
66
|
-
className:
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
className: d(
|
|
68
|
+
l({ size: "sm", variant: "ghost" }),
|
|
69
|
+
"w-full",
|
|
70
|
+
o
|
|
69
71
|
),
|
|
70
72
|
checked: a,
|
|
71
|
-
...
|
|
73
|
+
...s,
|
|
72
74
|
children: [
|
|
73
|
-
/* @__PURE__ */ n(
|
|
74
|
-
|
|
75
|
+
/* @__PURE__ */ n(e.ItemIndicator, { className: "absolute left-2 size-icon", children: /* @__PURE__ */ n(u, { className: "size-icon" }) }),
|
|
76
|
+
t
|
|
75
77
|
]
|
|
76
78
|
}
|
|
77
79
|
));
|
|
78
80
|
h.displayName = e.CheckboxItem.displayName;
|
|
79
|
-
const y =
|
|
81
|
+
const y = r.forwardRef(({ className: o, children: t, ...a }, s) => /* @__PURE__ */ m(
|
|
80
82
|
e.RadioItem,
|
|
81
83
|
{
|
|
82
|
-
ref:
|
|
83
|
-
className:
|
|
84
|
-
|
|
85
|
-
|
|
84
|
+
ref: s,
|
|
85
|
+
className: d(
|
|
86
|
+
l({ size: "sm", variant: "ghost" }),
|
|
87
|
+
"w-full",
|
|
88
|
+
o
|
|
86
89
|
),
|
|
87
90
|
...a,
|
|
88
91
|
children: [
|
|
89
|
-
/* @__PURE__ */ n(
|
|
90
|
-
|
|
92
|
+
/* @__PURE__ */ n(e.ItemIndicator, { className: "absolute left-2 size-4", children: /* @__PURE__ */ n(f, { className: "size-4 fill-current" }) }),
|
|
93
|
+
t
|
|
91
94
|
]
|
|
92
95
|
}
|
|
93
96
|
));
|
|
94
97
|
y.displayName = e.RadioItem.displayName;
|
|
95
|
-
const
|
|
98
|
+
const D = r.forwardRef(({ className: o, ...t }, a) => /* @__PURE__ */ n(
|
|
96
99
|
e.Label,
|
|
97
|
-
{
|
|
98
|
-
ref: d,
|
|
99
|
-
className: r(
|
|
100
|
-
"px-2 py-1.5 text-body font-semibold",
|
|
101
|
-
o && "pl-8",
|
|
102
|
-
t
|
|
103
|
-
),
|
|
104
|
-
...a
|
|
105
|
-
}
|
|
106
|
-
));
|
|
107
|
-
g.displayName = e.Label.displayName;
|
|
108
|
-
const N = s.forwardRef(({ className: t, ...o }, a) => /* @__PURE__ */ n(
|
|
109
|
-
e.Separator,
|
|
110
100
|
{
|
|
111
101
|
ref: a,
|
|
112
|
-
className:
|
|
113
|
-
|
|
102
|
+
className: d(
|
|
103
|
+
"p-2 border-b caption",
|
|
104
|
+
o
|
|
105
|
+
),
|
|
106
|
+
...t
|
|
114
107
|
}
|
|
115
108
|
));
|
|
116
|
-
|
|
117
|
-
const
|
|
118
|
-
className:
|
|
119
|
-
...
|
|
109
|
+
D.displayName = e.Label.displayName;
|
|
110
|
+
const M = ({
|
|
111
|
+
className: o,
|
|
112
|
+
...t
|
|
120
113
|
}) => /* @__PURE__ */ n(
|
|
121
114
|
"span",
|
|
122
115
|
{
|
|
123
|
-
className:
|
|
124
|
-
...
|
|
116
|
+
className: d("ml-auto text-caption tracking-widest opacity-60", o),
|
|
117
|
+
...t
|
|
125
118
|
}
|
|
126
119
|
);
|
|
127
|
-
|
|
120
|
+
M.displayName = "DropdownMenuShortcut";
|
|
128
121
|
export {
|
|
129
|
-
|
|
122
|
+
v as DropdownMenu,
|
|
130
123
|
h as DropdownMenuCheckboxItem,
|
|
131
|
-
|
|
124
|
+
N as DropdownMenuContent,
|
|
132
125
|
S as DropdownMenuGroup,
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
126
|
+
g as DropdownMenuItem,
|
|
127
|
+
D as DropdownMenuLabel,
|
|
128
|
+
k as DropdownMenuPortal,
|
|
129
|
+
G as DropdownMenuRadioGroup,
|
|
137
130
|
y as DropdownMenuRadioItem,
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
R as DropdownMenuTrigger
|
|
131
|
+
M as DropdownMenuShortcut,
|
|
132
|
+
T as DropdownMenuSub,
|
|
133
|
+
b as DropdownMenuSubContent,
|
|
134
|
+
w as DropdownMenuSubTrigger,
|
|
135
|
+
C as DropdownMenuTrigger
|
|
144
136
|
};
|
|
145
137
|
//# sourceMappingURL=dropdown-menu.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown-menu.es.js","sources":["../../../lib/components/ui/dropdown-menu.tsx"],"sourcesContent":["import * as React from \"react\"\nimport * as DropdownMenuPrimitive from \"@radix-ui/react-dropdown-menu\"\nimport {\n CheckIcon,\n ChevronRightIcon,\n DotFilledIcon,\n} from \"@radix-ui/react-icons\"\n\nimport { cn } from \"@/utils\"\n\nconst DropdownMenu = DropdownMenuPrimitive.Root\n\nconst DropdownMenuTrigger = DropdownMenuPrimitive.Trigger\n\nconst DropdownMenuGroup = DropdownMenuPrimitive.Group\n\nconst DropdownMenuPortal = DropdownMenuPrimitive.Portal\n\nconst DropdownMenuSub = DropdownMenuPrimitive.Sub\n\nconst DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup\n\nconst DropdownMenuSubTrigger = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean\n }\n>(({ className, inset, children, ...props }, ref) => (\n <DropdownMenuPrimitive.SubTrigger\n ref={ref}\n className={cn(\n \"flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-body outline-hidden focus:bg-accent data-[state=open]:bg-accent\",\n inset && \"pl-8\",\n className\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto h-4 w-4\" />\n </DropdownMenuPrimitive.SubTrigger>\n))\nDropdownMenuSubTrigger.displayName =\n DropdownMenuPrimitive.SubTrigger.displayName\n\nconst DropdownMenuSubContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.SubContent\n ref={ref}\n className={cn(\n \"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n className\n )}\n {...props}\n />\n))\nDropdownMenuSubContent.displayName =\n DropdownMenuPrimitive.SubContent.displayName\n\nconst DropdownMenuContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n \"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md\",\n \"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n className\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n))\nDropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName\n\nconst DropdownMenuItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Item\n ref={ref}\n className={cn(\n \"relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-body outline-hidden transition-colors focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0\",\n inset && \"pl-8\",\n className\n )}\n {...props}\n />\n))\nDropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName\n\nconst DropdownMenuCheckboxItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n <DropdownMenuPrimitive.CheckboxItem\n ref={ref}\n className={cn(\n \"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-body outline-hidden transition-colors focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50\",\n className\n )}\n checked={checked}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CheckIcon className=\"h-4 w-4\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n))\nDropdownMenuCheckboxItem.displayName =\n DropdownMenuPrimitive.CheckboxItem.displayName\n\nconst DropdownMenuRadioItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <DropdownMenuPrimitive.RadioItem\n ref={ref}\n className={cn(\n \"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-body outline-hidden transition-colors focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50\",\n className\n )}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <DotFilledIcon className=\"h-4 w-4 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n))\nDropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName\n\nconst DropdownMenuLabel = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Label\n ref={ref}\n className={cn(\n \"px-2 py-1.5 text-body font-semibold\",\n inset && \"pl-8\",\n className\n )}\n {...props}\n />\n))\nDropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName\n\nconst DropdownMenuSeparator = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.Separator\n ref={ref}\n className={cn(\"-mx-1 my-1 h-px bg-muted\", className)}\n {...props}\n />\n))\nDropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName\n\nconst DropdownMenuShortcut = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => {\n return (\n <span\n className={cn(\"ml-auto text-caption tracking-widest opacity-60\", className)}\n {...props}\n />\n )\n}\nDropdownMenuShortcut.displayName = \"DropdownMenuShortcut\"\n\nexport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuGroup,\n DropdownMenuPortal,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuRadioGroup,\n}\n"],"names":["DropdownMenu","DropdownMenuPrimitive","DropdownMenuTrigger","DropdownMenuGroup","DropdownMenuPortal","DropdownMenuSub","DropdownMenuRadioGroup","DropdownMenuSubTrigger","React","className","inset","children","props","ref","jsxs","cn","jsx","ChevronRightIcon","DropdownMenuSubContent","DropdownMenuContent","sideOffset","DropdownMenuItem","DropdownMenuCheckboxItem","checked","CheckIcon","DropdownMenuRadioItem","DotFilledIcon","DropdownMenuLabel","DropdownMenuSeparator","DropdownMenuShortcut"],"mappings":";;;;;AAUA,MAAMA,IAAeC,EAAsB,MAErCC,IAAsBD,EAAsB,SAE5CE,IAAoBF,EAAsB,OAE1CG,IAAqBH,EAAsB,QAE3CI,IAAkBJ,EAAsB,KAExCK,IAAyBL,EAAsB,YAE/CM,IAAyBC,EAAM,WAKnC,CAAC,EAAE,WAAAC,GAAW,OAAAC,GAAO,UAAAC,GAAU,GAAGC,KAASC,MAC3C,gBAAAC;AAAA,EAACb,EAAsB;AAAA,EAAtB;AAAA,IACC,KAAAY;AAAA,IACA,WAAWE;AAAA,MACT;AAAA,MACAL,KAAS;AAAA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AAM,WAGlC,CAAC,EAAE,WAAAC,GAAW,GAAGG,EAAM,GAAGC,MAC1B,gBAAAG;AAAA,EAACf,EAAsB;AAAA,EAAtB;AAAA,IACC,KAAAY;AAAA,IACA,WAAWE,EAAG,4BAA4BN,CAAS;AAAA,IAClD,GAAGG;AAAA,EAAA;AACN,CACD;AACDgB,EAAsB,cAAc3B,EAAsB,UAAU;AAEpE,MAAM4B,IAAuB,CAAC;AAAA,EAC5B,WAAApB;AAAA,EACA,GAAGG;AACL,MAEI,gBAAAI;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAWD,EAAG,mDAAmDN,CAAS;AAAA,IACzE,GAAGG;AAAA,EAAA;AACN;AAGJiB,EAAqB,cAAc;"}
|
|
1
|
+
{"version":3,"file":"dropdown-menu.es.js","sources":["../../../lib/components/ui/dropdown-menu.tsx"],"sourcesContent":["import { Button, buttonVariants } from \"@/components/ui/button\"\nimport { cn } from \"@/utils\"\nimport * as DropdownMenuPrimitive from \"@radix-ui/react-dropdown-menu\"\n// TODO Lucide icons??\nimport {\n CheckIcon,\n ChevronRightIcon,\n DotFilledIcon,\n} from \"@radix-ui/react-icons\"\nimport * as React from \"react\"\n\nconst DropdownMenu = DropdownMenuPrimitive.Root\n\nconst DropdownMenuTrigger = DropdownMenuPrimitive.Trigger\n\nconst DropdownMenuGroup = DropdownMenuPrimitive.Group\n\nconst DropdownMenuPortal = DropdownMenuPrimitive.Portal\n\nconst DropdownMenuSub = DropdownMenuPrimitive.Sub\n\nconst DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup\n\n\n/**\n * TODO\n * Focus on trigger.\n * Focus on content after trigger is pressed?\n * List keyboard navigation in buttons within DropdownItems\n */\n\nconst DropdownMenuSubTrigger = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean\n }\n>(({ className, inset, children, ...props }, ref) => (\n <DropdownMenuPrimitive.SubTrigger\n ref={ref}\n className={cn(\n \"flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-body outline-hidden focus:bg-accent data-[state=open]:bg-accent\",\n inset && \"pl-8\",\n className\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto size-4\" />\n </DropdownMenuPrimitive.SubTrigger>\n))\nDropdownMenuSubTrigger.displayName =\n DropdownMenuPrimitive.SubTrigger.displayName\n\nconst DropdownMenuSubContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.SubContent\n ref={ref}\n className={cn(\n \"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n className\n )}\n {...props}\n />\n))\nDropdownMenuSubContent.displayName =\n DropdownMenuPrimitive.SubContent.displayName\n\nconst DropdownMenuContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n \"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md\",\n \"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n className\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n))\nDropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName\n\nconst DropdownMenuItem = React.forwardRef<\n React.ElementRef<typeof Button>,\n React.ComponentPropsWithoutRef<typeof Button>\n>(({ className, ...props }, ref) => (\n <Button\n ref={ref}\n variant={'ghost'}\n className={cn(\n \"rounded-none w-full\",\n className\n )}\n {...props}\n />\n))\nDropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName\n\nconst DropdownMenuCheckboxItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n <DropdownMenuPrimitive.CheckboxItem\n ref={ref}\n className={cn(\n buttonVariants({ size: 'sm', variant: 'ghost' }),\n \"w-full\",\n className\n )}\n checked={checked}\n {...props}\n >\n <DropdownMenuPrimitive.ItemIndicator className=\"absolute left-2 size-icon\">\n <CheckIcon className=\"size-icon\" />\n </DropdownMenuPrimitive.ItemIndicator>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n))\nDropdownMenuCheckboxItem.displayName =\n DropdownMenuPrimitive.CheckboxItem.displayName\n\nconst DropdownMenuRadioItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <DropdownMenuPrimitive.RadioItem\n ref={ref}\n className={cn(\n buttonVariants({ size: 'sm', variant: 'ghost' }),\n \"w-full\",\n className\n )}\n {...props}\n >\n <DropdownMenuPrimitive.ItemIndicator className=\"absolute left-2 size-4\">\n <DotFilledIcon className=\"size-4 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n))\nDropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName\n\nconst DropdownMenuLabel = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.Label\n ref={ref}\n className={cn(\n \"p-2 border-b caption\",\n className\n )}\n {...props}\n />\n))\nDropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName\n\n\n// TODO just use an HR instead of separators, why is this even????????\n\nconst DropdownMenuShortcut = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => {\n return (\n <span\n className={cn(\"ml-auto text-caption tracking-widest opacity-60\", className)}\n {...props}\n />\n )\n}\nDropdownMenuShortcut.displayName = \"DropdownMenuShortcut\"\n\nexport {\n DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem,\n DropdownMenuShortcut, DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger, DropdownMenuTrigger\n}\n\n"],"names":["DropdownMenu","DropdownMenuPrimitive","DropdownMenuTrigger","DropdownMenuGroup","DropdownMenuPortal","DropdownMenuSub","DropdownMenuRadioGroup","DropdownMenuSubTrigger","React","className","inset","children","props","ref","jsxs","cn","jsx","ChevronRightIcon","DropdownMenuSubContent","DropdownMenuContent","sideOffset","DropdownMenuItem","Button","DropdownMenuCheckboxItem","checked","buttonVariants","CheckIcon","DropdownMenuRadioItem","DotFilledIcon","DropdownMenuLabel","DropdownMenuShortcut"],"mappings":";;;;;;AAWA,MAAMA,IAAeC,EAAsB,MAErCC,IAAsBD,EAAsB,SAE5CE,IAAoBF,EAAsB,OAE1CG,IAAqBH,EAAsB,QAE3CI,IAAkBJ,EAAsB,KAExCK,IAAyBL,EAAsB,YAU/CM,IAAyBC,EAAM,WAKnC,CAAC,EAAE,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AA,EAAtB;AAAA,IACC,KAAAY;AAAA,IACA,WAAWE;AAAA,MACT;AAAA,MACAN;AAAA,IACF;AAAA,IACC,GAAGG;AAAA,EAAA;AACN,CACD;AACDiB,EAAkB,cAAc5B,EAAsB,MAAM;AAK5D,MAAM6B,IAAuB,CAAC;AAAA,EAC5B,WAAArB;AAAA,EACA,GAAGG;AACL,MAEI,gBAAAI;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAWD,EAAG,mDAAmDN,CAAS;AAAA,IACzE,GAAGG;AAAA,EAAA;AACN;AAGJkB,EAAqB,cAAc;"}
|
|
@@ -1,44 +1,44 @@
|
|
|
1
1
|
import { jsx as r, jsxs as c } from "react/jsx-runtime";
|
|
2
|
+
import { cn as n } from "../../utils/index.es.js";
|
|
3
|
+
import { MinusIcon as m } from "@radix-ui/react-icons";
|
|
4
|
+
import { OTPInput as u, OTPInputContext as f } from "input-otp";
|
|
2
5
|
import * as o from "react";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { MinusIcon as f } from "@radix-ui/react-icons";
|
|
6
|
-
const x = o.forwardRef(({ className: e, containerClassName: t, ...a }, n) => /* @__PURE__ */ r(
|
|
7
|
-
m,
|
|
6
|
+
const x = o.forwardRef(({ className: e, containerClassName: t, ...a }, s) => /* @__PURE__ */ r(
|
|
7
|
+
u,
|
|
8
8
|
{
|
|
9
|
-
ref:
|
|
10
|
-
containerClassName:
|
|
9
|
+
ref: s,
|
|
10
|
+
containerClassName: n(
|
|
11
11
|
"flex items-center gap-2 has-disabled:opacity-50",
|
|
12
12
|
t
|
|
13
13
|
),
|
|
14
|
-
className:
|
|
14
|
+
className: n("disabled:cursor-not-allowed", e),
|
|
15
15
|
...a
|
|
16
16
|
}
|
|
17
17
|
));
|
|
18
18
|
x.displayName = "InputOTP";
|
|
19
|
-
const I = o.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ r("div", { ref: a, className:
|
|
19
|
+
const I = o.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ r("div", { ref: a, className: n("flex items-center", e), ...t }));
|
|
20
20
|
I.displayName = "InputOTPGroup";
|
|
21
|
-
const O = o.forwardRef(({ index: e, className: t, ...a },
|
|
22
|
-
const i = o.useContext(
|
|
21
|
+
const O = o.forwardRef(({ index: e, className: t, ...a }, s) => {
|
|
22
|
+
const i = o.useContext(f), { char: d, hasFakeCaret: p, isActive: l } = i.slots[e];
|
|
23
23
|
return /* @__PURE__ */ c(
|
|
24
24
|
"div",
|
|
25
25
|
{
|
|
26
|
-
ref:
|
|
27
|
-
className:
|
|
28
|
-
"relative flex h-
|
|
29
|
-
|
|
26
|
+
ref: s,
|
|
27
|
+
className: n(
|
|
28
|
+
"relative flex h-input w-9 items-center justify-center border-2 border-input text-body shadow-xs transition-all first:rounded-l-md last:rounded-r-md",
|
|
29
|
+
l ? "z-10 border-2 border-primary" : "",
|
|
30
30
|
t
|
|
31
31
|
),
|
|
32
32
|
...a,
|
|
33
33
|
children: [
|
|
34
34
|
d,
|
|
35
|
-
|
|
35
|
+
p && /* @__PURE__ */ r("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ r("div", { className: "h-4 w-px animate-caret-blink bg-foreground duration-1000" }) })
|
|
36
36
|
]
|
|
37
37
|
}
|
|
38
38
|
);
|
|
39
39
|
});
|
|
40
40
|
O.displayName = "InputOTPSlot";
|
|
41
|
-
const P = o.forwardRef(({ ...e }, t) => /* @__PURE__ */ r("div", { ref: t, role: "separator", ...e, children: /* @__PURE__ */ r(
|
|
41
|
+
const P = o.forwardRef(({ ...e }, t) => /* @__PURE__ */ r("div", { ref: t, role: "separator", ...e, children: /* @__PURE__ */ r(m, {}) }));
|
|
42
42
|
P.displayName = "InputOTPSeparator";
|
|
43
43
|
export {
|
|
44
44
|
x as InputOTP,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-otp.es.js","sources":["../../../lib/components/ui/input-otp.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"input-otp.es.js","sources":["../../../lib/components/ui/input-otp.tsx"],"sourcesContent":["import { cn } from \"@/utils\"\nimport { MinusIcon } from \"@radix-ui/react-icons\"\nimport { OTPInput, OTPInputContext } from \"input-otp\"\nimport * as React from \"react\"\n\nconst InputOTP = React.forwardRef<\n React.ElementRef<typeof OTPInput>,\n React.ComponentPropsWithoutRef<typeof OTPInput>\n>(({ className, containerClassName, ...props }, ref) => (\n <OTPInput\n ref={ref}\n containerClassName={cn(\n \"flex items-center gap-2 has-disabled:opacity-50\",\n containerClassName\n )}\n className={cn(\"disabled:cursor-not-allowed\", className)}\n {...props}\n />\n))\nInputOTP.displayName = \"InputOTP\"\n\nconst InputOTPGroup = React.forwardRef<\n React.ElementRef<\"div\">,\n React.ComponentPropsWithoutRef<\"div\">\n>(({ className, ...props }, ref) => (\n <div ref={ref} className={cn(\"flex items-center\", className)} {...props} />\n))\nInputOTPGroup.displayName = \"InputOTPGroup\"\n\nconst InputOTPSlot = React.forwardRef<\n React.ElementRef<\"div\">,\n React.ComponentPropsWithoutRef<\"div\"> & { index: number }\n>(({ index, className, ...props }, ref) => {\n const inputOTPContext = React.useContext(OTPInputContext)\n const { char, hasFakeCaret, isActive } = inputOTPContext.slots[index]\n\n return (\n <div\n ref={ref}\n className={cn(\n \"relative flex h-input w-9 items-center justify-center border-2 border-input text-body shadow-xs transition-all first:rounded-l-md last:rounded-r-md\",\n isActive ? \"z-10 border-2 border-primary\" : \"\",\n className,\n )}\n {...props}\n >\n {char}\n {hasFakeCaret && (\n <div className=\"pointer-events-none absolute inset-0 flex items-center justify-center\">\n <div className=\"h-4 w-px animate-caret-blink bg-foreground duration-1000\" />\n </div>\n )}\n </div>\n )\n})\nInputOTPSlot.displayName = \"InputOTPSlot\"\n\nconst InputOTPSeparator = React.forwardRef<\n React.ElementRef<\"div\">,\n React.ComponentPropsWithoutRef<\"div\">\n>(({ ...props }, ref) => (\n <div ref={ref} role=\"separator\" {...props}>\n <MinusIcon />\n </div>\n))\nInputOTPSeparator.displayName = \"InputOTPSeparator\"\n\nexport { InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot }\n\n"],"names":["InputOTP","React","className","containerClassName","props","ref","jsx","OTPInput","cn","InputOTPGroup","InputOTPSlot","index","inputOTPContext","OTPInputContext","char","hasFakeCaret","isActive","jsxs","InputOTPSeparator","MinusIcon"],"mappings":";;;;;AAKM,MAAAA,IAAWC,EAAM,WAGrB,CAAC,EAAE,WAAAC,GAAW,oBAAAC,GAAoB,GAAGC,KAASC,MAC9C,gBAAAC;AAAA,EAACC;AAAA,EAAA;AAAA,IACC,KAAAF;AAAA,IACA,oBAAoBG;AAAA,MAClB;AAAA,MACAL;AAAA,IACF;AAAA,IACA,WAAWK,EAAG,+BAA+BN,CAAS;AAAA,IACrD,GAAGE;AAAA,EAAA;AACN,CACD;AACDJ,EAAS,cAAc;AAEjB,MAAAS,IAAgBR,EAAM,WAG1B,CAAC,EAAE,WAAAC,GAAW,GAAGE,EAAS,GAAAC,wBACzB,OAAI,EAAA,KAAAA,GAAU,WAAWG,EAAG,qBAAqBN,CAAS,GAAI,GAAGE,GAAO,CAC1E;AACDK,EAAc,cAAc;AAEtB,MAAAC,IAAeT,EAAM,WAGzB,CAAC,EAAE,OAAAU,GAAO,WAAAT,GAAW,GAAGE,EAAM,GAAGC,MAAQ;AACnC,QAAAO,IAAkBX,EAAM,WAAWY,CAAe,GAClD,EAAE,MAAAC,GAAM,cAAAC,GAAc,UAAAC,EAAa,IAAAJ,EAAgB,MAAMD,CAAK;AAGlE,SAAA,gBAAAM;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAZ;AAAA,MACA,WAAWG;AAAA,QACT;AAAA,QACAQ,IAAW,kCAAkC;AAAA,QAC7Cd;AAAA,MACF;AAAA,MACC,GAAGE;AAAA,MAEH,UAAA;AAAA,QAAAU;AAAA,QACAC,uBACE,OAAI,EAAA,WAAU,yEACb,UAAC,gBAAAT,EAAA,OAAA,EAAI,WAAU,2DAA2D,CAAA,EAC5E,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAEJ;AAEJ,CAAC;AACDI,EAAa,cAAc;AAE3B,MAAMQ,IAAoBjB,EAAM,WAG9B,CAAC,EAAE,GAAGG,KAASC,wBACd,OAAI,EAAA,KAAAA,GAAU,MAAK,aAAa,GAAGD,GAClC,UAAC,gBAAAE,EAAAa,GAAA,CAAU,CAAA,GACb,CACD;AACDD,EAAkB,cAAc;"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import * as d from "react";
|
|
3
3
|
import { cn as l } from "../../utils/index.es.js";
|
|
4
|
-
const
|
|
5
|
-
({ className: e, type: r, ...o }, t) => /* @__PURE__ */
|
|
4
|
+
const n = d.forwardRef(
|
|
5
|
+
({ className: e, type: r, ...o }, t) => /* @__PURE__ */ i(
|
|
6
6
|
"input",
|
|
7
7
|
{
|
|
8
8
|
type: r,
|
|
9
9
|
className: l(
|
|
10
|
-
"flex h-
|
|
10
|
+
"flex h-input w-full rounded-lg border border-input bg-background px-3 py-2 text-body file:border-0 file:bg-transparent file:text-body file:font-medium placeholder:text-muted-foreground focus-visible:outline-hidden focus-visible:border-2 focus-visible:border-primary disabled:cursor-not-allowed disabled:opacity-50",
|
|
11
11
|
e
|
|
12
12
|
),
|
|
13
13
|
ref: t,
|
|
@@ -15,8 +15,8 @@ const a = i.forwardRef(
|
|
|
15
15
|
}
|
|
16
16
|
)
|
|
17
17
|
);
|
|
18
|
-
|
|
18
|
+
n.displayName = "Input";
|
|
19
19
|
export {
|
|
20
|
-
|
|
20
|
+
n as Input
|
|
21
21
|
};
|
|
22
22
|
//# sourceMappingURL=input.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.es.js","sources":["../../../lib/components/ui/input.tsx"],"sourcesContent":["import * as React from \"react\"
|
|
1
|
+
{"version":3,"file":"input.es.js","sources":["../../../lib/components/ui/input.tsx"],"sourcesContent":["import * as React from \"react\";\n\nimport { cn } from \"@/utils\";\n\nexport interface InputProps\n extends React.InputHTMLAttributes<HTMLInputElement> { }\n//Input\nconst Input = React.forwardRef<HTMLInputElement, InputProps>(\n ({ className, type, ...props }, ref) => {\n return (\n <input\n type={type}\n className={cn(\n \"flex h-input w-full rounded-lg border border-input bg-background px-3 py-2 text-body file:border-0 file:bg-transparent file:text-body file:font-medium placeholder:text-muted-foreground focus-visible:outline-hidden focus-visible:border-2 focus-visible:border-primary disabled:cursor-not-allowed disabled:opacity-50\",\n className\n )}\n ref={ref}\n {...props}\n />\n );\n }\n);\nInput.displayName = \"Input\";\n\nexport { Input };\n"],"names":["Input","React","className","type","props","ref","jsx","cn"],"mappings":";;;AAOA,MAAMA,IAAQC,EAAM;AAAA,EAClB,CAAC,EAAE,WAAAC,GAAW,MAAAC,GAAM,GAAGC,EAAA,GAASC,MAE5B,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,MAAAH;AAAA,MACA,WAAWI;AAAA,QACT;AAAA,QACAL;AAAA,MACF;AAAA,MACA,KAAAG;AAAA,MACC,GAAGD;AAAA,IAAA;AAAA,EACN;AAGN;AACAJ,EAAM,cAAc;"}
|