@cryptlex/web-components 1.3.2 → 1.3.4
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/dist/components/data-table/column-picker.es.js +78 -0
- package/dist/components/data-table/column-picker.es.js.map +1 -0
- package/dist/components/data-table/data-table.es.js +197 -0
- package/dist/components/data-table/data-table.es.js.map +1 -0
- package/dist/components/data-table/page-size.es.js +23 -0
- package/dist/components/data-table/page-size.es.js.map +1 -0
- package/dist/components/data-table/paginator.es.js +63 -0
- package/dist/components/data-table/paginator.es.js.map +1 -0
- package/dist/components/data-table/table-actions.es.js +78 -0
- package/dist/components/data-table/table-actions.es.js.map +1 -0
- package/dist/components/data-table/table-commons.es.js +52 -0
- package/dist/components/data-table/table-commons.es.js.map +1 -0
- package/dist/components/data-table/table-content.es.js +46 -0
- package/dist/components/data-table/table-content.es.js.map +1 -0
- package/dist/components/data-table/table-utils/constants.es.js +274 -0
- package/dist/components/data-table/table-utils/constants.es.js.map +1 -0
- package/dist/components/data-table/table-utils/createTableFetchFn.es.js +24 -0
- package/dist/components/data-table/table-utils/createTableFetchFn.es.js.map +1 -0
- package/dist/components/data-table/table-utils/date.es.js +12 -0
- package/dist/components/data-table/table-utils/date.es.js.map +1 -0
- package/dist/components/data-table/table-utils/link-display.es.js +21 -0
- package/dist/components/data-table/table-utils/link-display.es.js.map +1 -0
- package/dist/components/data-table/table-utils/string.es.js +19 -0
- package/dist/components/data-table/table-utils/string.es.js.map +1 -0
- package/dist/components/data-table/table-utils/types.es.js +5 -0
- package/dist/components/data-table/table-utils/types.es.js.map +1 -0
- package/dist/components/info-card/info-card.es.js +71 -0
- package/dist/components/info-card/info-card.es.js.map +1 -0
- package/dist/components/sidebar/app-layout.es.js +83 -0
- package/dist/components/sidebar/app-layout.es.js.map +1 -0
- package/dist/components/sidebar/nav-main.es.js +76 -0
- package/dist/components/sidebar/nav-main.es.js.map +1 -0
- package/dist/components/sidebar/sidebar.es.js +10 -0
- package/dist/components/sidebar/sidebar.es.js.map +1 -0
- package/dist/components/static-data-table/data-table.es.js +30 -0
- package/dist/components/static-data-table/data-table.es.js.map +1 -0
- package/dist/components/ui/avatar.es.js +12 -14
- package/dist/components/ui/avatar.es.js.map +1 -1
- package/dist/components/ui/button.es.js +12 -22
- package/dist/components/ui/button.es.js.map +1 -1
- package/dist/components/ui/chart.es.js +40 -51
- package/dist/components/ui/chart.es.js.map +1 -1
- package/dist/components/ui/collapsible.es.js +1 -0
- package/dist/components/ui/collapsible.es.js.map +1 -1
- package/dist/components/ui/dialog.es.js +23 -22
- package/dist/components/ui/dialog.es.js.map +1 -1
- package/dist/components/ui/drawer.es.js +16 -48
- package/dist/components/ui/drawer.es.js.map +1 -1
- package/dist/components/ui/form.es.js +28 -29
- package/dist/components/ui/form.es.js.map +1 -1
- package/dist/components/ui/mutli-select.es.js +195 -0
- package/dist/components/ui/mutli-select.es.js.map +1 -0
- package/dist/components/ui/password-input.es.js +9 -8
- package/dist/components/ui/password-input.es.js.map +1 -1
- package/dist/components/ui/search-input.es.js +42 -0
- package/dist/components/ui/search-input.es.js.map +1 -0
- package/dist/components/ui/select.es.js +4 -9
- package/dist/components/ui/select.es.js.map +1 -1
- package/dist/components/ui/separator.es.js +17 -18
- package/dist/components/ui/separator.es.js.map +1 -1
- package/dist/components/ui/sheet.es.js +12 -37
- package/dist/components/ui/sheet.es.js.map +1 -1
- package/dist/components/ui/sidebar.es.js +286 -264
- package/dist/components/ui/sidebar.es.js.map +1 -1
- package/dist/components/ui/sonner.es.js +3 -2
- package/dist/components/ui/sonner.es.js.map +1 -1
- package/dist/components/ui/table-page-layout.es.js +14 -0
- package/dist/components/ui/table-page-layout.es.js.map +1 -0
- package/dist/components/ui/tooltip.es.js +9 -8
- package/dist/components/ui/tooltip.es.js.map +1 -1
- package/dist/index.es.d.ts +248 -2
- package/dist/index.es.js +247 -200
- package/dist/index.es.js.map +1 -1
- package/dist/utils/index.es.js +13 -8
- package/dist/utils/index.es.js.map +1 -1
- package/package.json +13 -3
|
@@ -1,34 +1,35 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsx as o, jsxs as n } from "react/jsx-runtime";
|
|
2
3
|
import * as l from "react";
|
|
3
|
-
import * as
|
|
4
|
+
import * as e from "@radix-ui/react-dialog";
|
|
4
5
|
import { Cross2Icon as c } from "@radix-ui/react-icons";
|
|
5
6
|
import { cn as i } from "../../utils/index.es.js";
|
|
6
|
-
const b =
|
|
7
|
-
|
|
7
|
+
const b = e.Root, h = e.Trigger, m = e.Portal, v = e.Close, d = l.forwardRef(({ className: a, ...t }, s) => /* @__PURE__ */ o(
|
|
8
|
+
e.Overlay,
|
|
8
9
|
{
|
|
9
10
|
ref: s,
|
|
10
11
|
className: i(
|
|
11
12
|
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
12
|
-
|
|
13
|
+
a
|
|
13
14
|
),
|
|
14
15
|
...t
|
|
15
16
|
}
|
|
16
17
|
));
|
|
17
|
-
d.displayName =
|
|
18
|
-
const f = l.forwardRef(({ className:
|
|
18
|
+
d.displayName = e.Overlay.displayName;
|
|
19
|
+
const f = l.forwardRef(({ className: a, children: t, ...s }, r) => /* @__PURE__ */ n(m, { children: [
|
|
19
20
|
/* @__PURE__ */ o(d, {}),
|
|
20
21
|
/* @__PURE__ */ n(
|
|
21
|
-
|
|
22
|
+
e.Content,
|
|
22
23
|
{
|
|
23
24
|
ref: r,
|
|
24
25
|
className: i(
|
|
25
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 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
|
|
26
|
-
|
|
27
|
+
a
|
|
27
28
|
),
|
|
28
29
|
...s,
|
|
29
30
|
children: [
|
|
30
31
|
t,
|
|
31
|
-
/* @__PURE__ */ n(
|
|
32
|
+
/* @__PURE__ */ n(e.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none 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: [
|
|
32
33
|
/* @__PURE__ */ o(c, { className: "h-4 w-4" }),
|
|
33
34
|
/* @__PURE__ */ o("span", { className: "sr-only", children: "Close" })
|
|
34
35
|
] })
|
|
@@ -36,56 +37,56 @@ const f = l.forwardRef(({ className: e, children: t, ...s }, r) => /* @__PURE__
|
|
|
36
37
|
}
|
|
37
38
|
)
|
|
38
39
|
] }));
|
|
39
|
-
f.displayName =
|
|
40
|
+
f.displayName = e.Content.displayName;
|
|
40
41
|
const p = ({
|
|
41
|
-
className:
|
|
42
|
+
className: a,
|
|
42
43
|
...t
|
|
43
44
|
}) => /* @__PURE__ */ o(
|
|
44
45
|
"div",
|
|
45
46
|
{
|
|
46
47
|
className: i(
|
|
47
48
|
"flex flex-col space-y-1.5 text-center sm:text-left",
|
|
48
|
-
|
|
49
|
+
a
|
|
49
50
|
),
|
|
50
51
|
...t
|
|
51
52
|
}
|
|
52
53
|
);
|
|
53
54
|
p.displayName = "DialogHeader";
|
|
54
55
|
const g = ({
|
|
55
|
-
className:
|
|
56
|
+
className: a,
|
|
56
57
|
...t
|
|
57
58
|
}) => /* @__PURE__ */ o(
|
|
58
59
|
"div",
|
|
59
60
|
{
|
|
60
61
|
className: i(
|
|
61
62
|
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
|
|
62
|
-
|
|
63
|
+
a
|
|
63
64
|
),
|
|
64
65
|
...t
|
|
65
66
|
}
|
|
66
67
|
);
|
|
67
68
|
g.displayName = "DialogFooter";
|
|
68
|
-
const u = l.forwardRef(({ className:
|
|
69
|
-
|
|
69
|
+
const u = l.forwardRef(({ className: a, ...t }, s) => /* @__PURE__ */ o(
|
|
70
|
+
e.Title,
|
|
70
71
|
{
|
|
71
72
|
ref: s,
|
|
72
73
|
className: i(
|
|
73
74
|
"text-heading-3",
|
|
74
|
-
|
|
75
|
+
a
|
|
75
76
|
),
|
|
76
77
|
...t
|
|
77
78
|
}
|
|
78
79
|
));
|
|
79
|
-
u.displayName =
|
|
80
|
-
const y = l.forwardRef(({ className:
|
|
81
|
-
|
|
80
|
+
u.displayName = e.Title.displayName;
|
|
81
|
+
const y = l.forwardRef(({ className: a, ...t }, s) => /* @__PURE__ */ o(
|
|
82
|
+
e.Description,
|
|
82
83
|
{
|
|
83
84
|
ref: s,
|
|
84
|
-
className: i("text-body text-muted-foreground",
|
|
85
|
+
className: i("text-body text-muted-foreground", a),
|
|
85
86
|
...t
|
|
86
87
|
}
|
|
87
88
|
));
|
|
88
|
-
y.displayName =
|
|
89
|
+
y.displayName = e.Description.displayName;
|
|
89
90
|
export {
|
|
90
91
|
b as Dialog,
|
|
91
92
|
v as DialogClose,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.es.js","sources":["../../../lib/components/ui/dialog.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\"\nimport { Cross2Icon } from \"@radix-ui/react-icons\"\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-black/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 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] 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-none 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=\"h-4 w-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 \"text-heading-3\",\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,\n DialogPortal,\n DialogOverlay,\n DialogTrigger,\n DialogClose,\n DialogContent,\n DialogHeader,\n DialogFooter,\n DialogTitle,\n DialogDescription,\n}\n"],"names":["Dialog","DialogPrimitive","DialogTrigger","DialogPortal","DialogClose","DialogOverlay","React","className","props","ref","jsx","cn","DialogContent","children","jsxs","Cross2Icon","DialogHeader","DialogFooter","DialogTitle","DialogDescription"],"mappings":"
|
|
1
|
+
{"version":3,"file":"dialog.es.js","sources":["../../../lib/components/ui/dialog.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\"\nimport { Cross2Icon } from \"@radix-ui/react-icons\"\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-black/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 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] 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-none 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=\"h-4 w-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 \"text-heading-3\",\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,\n DialogPortal,\n DialogOverlay,\n DialogTrigger,\n DialogClose,\n DialogContent,\n DialogHeader,\n DialogFooter,\n DialogTitle,\n DialogDescription,\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,MAAM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AA,MACT;AAAA,MACAJ;AAAA,IACF;AAAA,IACC,GAAGC;AAAA,EAAA;AACN,CACD;AACDU,EAAY,cAAcjB,EAAgB,MAAM;AAE1C,MAAAkB,IAAoBb,EAAM,WAG9B,CAAC,EAAE,WAAAC,GAAW,GAAGC,EAAM,GAAGC,MAC1B,gBAAAC;AAAA,EAACT,EAAgB;AAAA,EAAhB;AAAA,IACC,KAAAQ;AAAA,IACA,WAAWE,EAAG,mCAAmCJ,CAAS;AAAA,IACzD,GAAGC;AAAA,EAAA;AACN,CACD;AACDW,EAAkB,cAAclB,EAAgB,YAAY;"}
|
|
@@ -1,19 +1,14 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsx as t, jsxs as i } from "react/jsx-runtime";
|
|
2
3
|
import * as l from "react";
|
|
3
4
|
import { Drawer as a } from "vaul";
|
|
4
5
|
import { cn as s } from "../../utils/index.es.js";
|
|
5
|
-
const
|
|
6
|
+
const c = ({
|
|
6
7
|
shouldScaleBackground: e = !0,
|
|
7
8
|
...r
|
|
8
|
-
}) => /* @__PURE__ */ t(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
shouldScaleBackground: e,
|
|
12
|
-
...r
|
|
13
|
-
}
|
|
14
|
-
);
|
|
15
|
-
n.displayName = "Drawer";
|
|
16
|
-
const u = a.Trigger, c = a.Portal, b = a.Close, d = l.forwardRef(({ className: e, ...r }, o) => /* @__PURE__ */ t(
|
|
9
|
+
}) => /* @__PURE__ */ t(a.Root, { shouldScaleBackground: e, ...r });
|
|
10
|
+
c.displayName = "Drawer";
|
|
11
|
+
const u = a.Trigger, n = a.Portal, b = a.Close, d = l.forwardRef(({ className: e, ...r }, o) => /* @__PURE__ */ t(
|
|
17
12
|
a.Overlay,
|
|
18
13
|
{
|
|
19
14
|
ref: o,
|
|
@@ -22,12 +17,13 @@ const u = a.Trigger, c = a.Portal, b = a.Close, d = l.forwardRef(({ className: e
|
|
|
22
17
|
}
|
|
23
18
|
));
|
|
24
19
|
d.displayName = a.Overlay.displayName;
|
|
25
|
-
const p = l.forwardRef(({ className: e, children: r, ...o }, m) => /* @__PURE__ */ i(
|
|
20
|
+
const p = l.forwardRef(({ className: e, children: r, ...o }, m) => /* @__PURE__ */ i(n, { children: [
|
|
26
21
|
/* @__PURE__ */ t(d, {}),
|
|
27
22
|
/* @__PURE__ */ i(
|
|
28
23
|
a.Content,
|
|
29
24
|
{
|
|
30
25
|
ref: m,
|
|
26
|
+
style: { userSelect: "text" },
|
|
31
27
|
className: s(
|
|
32
28
|
"fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background",
|
|
33
29
|
e
|
|
@@ -41,41 +37,13 @@ const p = l.forwardRef(({ className: e, children: r, ...o }, m) => /* @__PURE__
|
|
|
41
37
|
)
|
|
42
38
|
] }));
|
|
43
39
|
p.displayName = "DrawerContent";
|
|
44
|
-
const f = ({
|
|
45
|
-
className: e,
|
|
46
|
-
...r
|
|
47
|
-
}) => /* @__PURE__ */ t(
|
|
48
|
-
"div",
|
|
49
|
-
{
|
|
50
|
-
className: s("grid gap-1.5 p-4 text-center sm:text-left", e),
|
|
51
|
-
...r
|
|
52
|
-
}
|
|
53
|
-
);
|
|
40
|
+
const f = ({ className: e, ...r }) => /* @__PURE__ */ t("div", { className: s("grid gap-1.5 p-4 text-center sm:text-left", e), ...r });
|
|
54
41
|
f.displayName = "DrawerHeader";
|
|
55
|
-
const w = ({
|
|
56
|
-
className: e,
|
|
57
|
-
...r
|
|
58
|
-
}) => /* @__PURE__ */ t(
|
|
59
|
-
"div",
|
|
60
|
-
{
|
|
61
|
-
className: s("mt-auto flex flex-col gap-2 p-4", e),
|
|
62
|
-
...r
|
|
63
|
-
}
|
|
64
|
-
);
|
|
42
|
+
const w = ({ className: e, ...r }) => /* @__PURE__ */ t("div", { className: s("mt-auto flex flex-col gap-2 p-4", e), ...r });
|
|
65
43
|
w.displayName = "DrawerFooter";
|
|
44
|
+
const x = l.forwardRef(({ className: e, ...r }, o) => /* @__PURE__ */ t(a.Title, { ref: o, className: s("text-heading-3", e), ...r }));
|
|
45
|
+
x.displayName = a.Title.displayName;
|
|
66
46
|
const D = l.forwardRef(({ className: e, ...r }, o) => /* @__PURE__ */ t(
|
|
67
|
-
a.Title,
|
|
68
|
-
{
|
|
69
|
-
ref: o,
|
|
70
|
-
className: s(
|
|
71
|
-
"text-heading-3",
|
|
72
|
-
e
|
|
73
|
-
),
|
|
74
|
-
...r
|
|
75
|
-
}
|
|
76
|
-
));
|
|
77
|
-
D.displayName = a.Title.displayName;
|
|
78
|
-
const x = l.forwardRef(({ className: e, ...r }, o) => /* @__PURE__ */ t(
|
|
79
47
|
a.Description,
|
|
80
48
|
{
|
|
81
49
|
ref: o,
|
|
@@ -83,17 +51,17 @@ const x = l.forwardRef(({ className: e, ...r }, o) => /* @__PURE__ */ t(
|
|
|
83
51
|
...r
|
|
84
52
|
}
|
|
85
53
|
));
|
|
86
|
-
|
|
54
|
+
D.displayName = a.Description.displayName;
|
|
87
55
|
export {
|
|
88
|
-
|
|
56
|
+
c as Drawer,
|
|
89
57
|
b as DrawerClose,
|
|
90
58
|
p as DrawerContent,
|
|
91
|
-
|
|
59
|
+
D as DrawerDescription,
|
|
92
60
|
w as DrawerFooter,
|
|
93
61
|
f as DrawerHeader,
|
|
94
62
|
d as DrawerOverlay,
|
|
95
|
-
|
|
96
|
-
|
|
63
|
+
n as DrawerPortal,
|
|
64
|
+
x as DrawerTitle,
|
|
97
65
|
u as DrawerTrigger
|
|
98
66
|
};
|
|
99
67
|
//# sourceMappingURL=drawer.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drawer.es.js","sources":["../../../lib/components/ui/drawer.tsx"],"sourcesContent":["
|
|
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-black/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 <div className=\"mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted\" />\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('text-heading-3', 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 DrawerPortal,\n DrawerOverlay,\n DrawerTrigger,\n DrawerClose,\n DrawerContent,\n DrawerHeader,\n DrawerFooter,\n DrawerTitle,\n DrawerDescription,\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,IAAgBC,EAAM,WAG1B,CAAC,EAAE,WAAAC,GAAW,GAAGP,EAAM,GAAGQ,MAC1B,gBAAAC;AAAA,EAACR,EAAgB;AAAA,EAAhB;AAAA,IACC,KAAAO;AAAA,IACA,WAAWE,EAAG,kCAAkCH,CAAS;AAAA,IACxD,GAAGP;AAAA,EAAA;AACN,CACD;AACDK,EAAc,cAAcJ,EAAgB,QAAQ;AAEpD,MAAMU,IAAgBL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H,CAAS;AAAA,IACzD,GAAGP;AAAA,EAAA;AACN,CACD;AACDiB,EAAkB,cAAchB,EAAgB,YAAY;"}
|
|
@@ -1,18 +1,17 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
-
import * as s from "react";
|
|
3
3
|
import { Slot as F } from "@radix-ui/react-slot";
|
|
4
|
+
import * as s from "react";
|
|
4
5
|
import { FormProvider as u, Controller as p, useFormContext as x } from "react-hook-form";
|
|
5
|
-
import { cn as a } from "../../utils/index.es.js";
|
|
6
6
|
import { Label as I } from "./label.es.js";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
), M = ({
|
|
7
|
+
import { cn as a } from "../../utils/index.es.js";
|
|
8
|
+
const D = u, l = s.createContext({}), M = ({
|
|
10
9
|
...e
|
|
11
|
-
}) => /* @__PURE__ */ i(
|
|
12
|
-
const e = s.useContext(
|
|
10
|
+
}) => /* @__PURE__ */ i(l.Provider, { value: { name: e.name }, children: /* @__PURE__ */ i(p, { ...e }) }), d = () => {
|
|
11
|
+
const e = s.useContext(l), t = s.useContext(f), { getFieldState: r, formState: o } = x(), m = r(e.name, o);
|
|
13
12
|
if (!e)
|
|
14
13
|
throw new Error("useFormField should be used within <FormField>");
|
|
15
|
-
const { id: n } =
|
|
14
|
+
const { id: n } = t;
|
|
16
15
|
return {
|
|
17
16
|
id: n,
|
|
18
17
|
name: e.name,
|
|
@@ -21,33 +20,33 @@ const D = u, f = s.createContext(
|
|
|
21
20
|
formMessageId: `${n}-form-item-message`,
|
|
22
21
|
...m
|
|
23
22
|
};
|
|
24
|
-
},
|
|
25
|
-
{}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
23
|
+
}, f = s.createContext({}), C = s.forwardRef(
|
|
24
|
+
({ className: e, ...t }, r) => {
|
|
25
|
+
const o = s.useId();
|
|
26
|
+
return /* @__PURE__ */ i(f.Provider, { value: { id: o }, children: /* @__PURE__ */ i("div", { ref: r, className: a("space-y-2", e), ...t }) });
|
|
27
|
+
}
|
|
28
|
+
);
|
|
30
29
|
C.displayName = "FormItem";
|
|
31
|
-
const g = s.forwardRef(({ className: e, ...
|
|
32
|
-
const { error:
|
|
30
|
+
const g = s.forwardRef(({ className: e, ...t }, r) => {
|
|
31
|
+
const { error: o, formItemId: m } = d();
|
|
33
32
|
return /* @__PURE__ */ i(
|
|
34
33
|
I,
|
|
35
34
|
{
|
|
36
35
|
ref: r,
|
|
37
|
-
className: a(
|
|
36
|
+
className: a(o && "text-destructive", e),
|
|
38
37
|
htmlFor: m,
|
|
39
|
-
...
|
|
38
|
+
...t
|
|
40
39
|
}
|
|
41
40
|
);
|
|
42
41
|
});
|
|
43
42
|
g.displayName = "FormLabel";
|
|
44
|
-
const v = s.forwardRef(({ ...e },
|
|
45
|
-
const { error: r, formItemId:
|
|
43
|
+
const v = s.forwardRef(({ ...e }, t) => {
|
|
44
|
+
const { error: r, formItemId: o, formDescriptionId: m, formMessageId: n } = d();
|
|
46
45
|
return /* @__PURE__ */ i(
|
|
47
46
|
F,
|
|
48
47
|
{
|
|
49
|
-
ref:
|
|
50
|
-
id:
|
|
48
|
+
ref: t,
|
|
49
|
+
id: o,
|
|
51
50
|
"aria-describedby": r ? `${m} ${n}` : `${m}`,
|
|
52
51
|
"aria-invalid": !!r,
|
|
53
52
|
...e
|
|
@@ -55,25 +54,25 @@ const v = s.forwardRef(({ ...e }, o) => {
|
|
|
55
54
|
);
|
|
56
55
|
});
|
|
57
56
|
v.displayName = "FormControl";
|
|
58
|
-
const N = s.forwardRef(({ className: e, ...
|
|
59
|
-
const { formDescriptionId:
|
|
57
|
+
const N = s.forwardRef(({ className: e, ...t }, r) => {
|
|
58
|
+
const { formDescriptionId: o } = d();
|
|
60
59
|
return /* @__PURE__ */ i(
|
|
61
60
|
"p",
|
|
62
61
|
{
|
|
63
62
|
ref: r,
|
|
64
|
-
id:
|
|
63
|
+
id: o,
|
|
65
64
|
className: a("text-caption text-muted-foreground", e),
|
|
66
|
-
...
|
|
65
|
+
...t
|
|
67
66
|
}
|
|
68
67
|
);
|
|
69
68
|
});
|
|
70
69
|
N.displayName = "FormDescription";
|
|
71
|
-
const w = s.forwardRef(({ className: e, children:
|
|
72
|
-
const { error: m, formMessageId: n } = d(), c = m ? String(m == null ? void 0 : m.message) :
|
|
70
|
+
const w = s.forwardRef(({ className: e, children: t, ...r }, o) => {
|
|
71
|
+
const { error: m, formMessageId: n } = d(), c = m ? String(m == null ? void 0 : m.message) : t;
|
|
73
72
|
return c ? /* @__PURE__ */ i(
|
|
74
73
|
"p",
|
|
75
74
|
{
|
|
76
|
-
ref:
|
|
75
|
+
ref: o,
|
|
77
76
|
id: n,
|
|
78
77
|
className: a("text-caption font-medium text-destructive", e),
|
|
79
78
|
...r,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form.es.js","sources":["../../../lib/components/ui/form.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"form.es.js","sources":["../../../lib/components/ui/form.tsx"],"sourcesContent":["'use client';\nimport * as LabelPrimitive from '@radix-ui/react-label';\nimport { Slot } from '@radix-ui/react-slot';\nimport * as React from 'react';\nimport {\n Controller,\n ControllerProps,\n FieldPath,\n FieldValues,\n FormProvider,\n useFormContext,\n} from 'react-hook-form';\n\nimport { Label } from '@/components/ui/label';\nimport { cn } from '@/utils';\n\nconst Form = FormProvider;\n\ntype FormFieldContextValue<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n> = {\n name: TName;\n};\n\nconst FormFieldContext = React.createContext<FormFieldContextValue>({} as FormFieldContextValue);\n\nconst FormField = <\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n>({\n ...props\n}: ControllerProps<TFieldValues, TName>) => {\n return (\n <FormFieldContext.Provider value={{ name: props.name }}>\n <Controller {...props} />\n </FormFieldContext.Provider>\n );\n};\n\nconst useFormField = () => {\n const fieldContext = React.useContext(FormFieldContext);\n const itemContext = React.useContext(FormItemContext);\n const { getFieldState, formState } = useFormContext();\n\n const fieldState = getFieldState(fieldContext.name, formState);\n\n if (!fieldContext) {\n throw new Error('useFormField should be used within <FormField>');\n }\n\n const { id } = itemContext;\n\n return {\n id,\n name: fieldContext.name,\n formItemId: `${id}-form-item`,\n formDescriptionId: `${id}-form-item-description`,\n formMessageId: `${id}-form-item-message`,\n ...fieldState,\n };\n};\n\ntype FormItemContextValue = {\n id: string;\n};\n\nconst FormItemContext = React.createContext<FormItemContextValue>({} as FormItemContextValue);\n\nconst FormItem = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => {\n const id = React.useId();\n\n return (\n <FormItemContext.Provider value={{ id }}>\n <div ref={ref} className={cn('space-y-2', className)} {...props} />\n </FormItemContext.Provider>\n );\n },\n);\nFormItem.displayName = 'FormItem';\n\nconst FormLabel = React.forwardRef<\n React.ElementRef<typeof LabelPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>\n>(({ className, ...props }, ref) => {\n const { error, formItemId } = useFormField();\n\n return (\n <Label\n ref={ref}\n className={cn(error && 'text-destructive', className)}\n htmlFor={formItemId}\n {...props}\n />\n );\n});\nFormLabel.displayName = 'FormLabel';\n\nconst FormControl = React.forwardRef<\n React.ElementRef<typeof Slot>,\n React.ComponentPropsWithoutRef<typeof Slot>\n>(({ ...props }, ref) => {\n const { error, formItemId, formDescriptionId, formMessageId } = useFormField();\n\n return (\n <Slot\n ref={ref}\n id={formItemId}\n aria-describedby={!error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`}\n aria-invalid={!!error}\n {...props}\n />\n );\n});\nFormControl.displayName = 'FormControl';\n\nconst FormDescription = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => {\n const { formDescriptionId } = useFormField();\n\n return (\n <p\n ref={ref}\n id={formDescriptionId}\n className={cn('text-caption text-muted-foreground', className)}\n {...props}\n />\n );\n});\nFormDescription.displayName = 'FormDescription';\n\nconst FormMessage = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, children, ...props }, ref) => {\n const { error, formMessageId } = useFormField();\n const body = error ? String(error?.message) : children;\n\n if (!body) {\n return null;\n }\n\n return (\n <p\n ref={ref}\n id={formMessageId}\n className={cn('text-caption font-medium text-destructive', className)}\n {...props}\n >\n {body}\n </p>\n );\n});\nFormMessage.displayName = 'FormMessage';\n\nexport {\n Form,\n FormControl,\n FormDescription,\n FormField,\n FormItem,\n FormLabel,\n FormMessage,\n useFormField,\n};\n"],"names":["Form","FormProvider","FormFieldContext","React","FormField","props","jsx","Controller","useFormField","fieldContext","itemContext","FormItemContext","getFieldState","formState","useFormContext","fieldState","id","FormItem","className","ref","cn","FormLabel","error","formItemId","Label","FormControl","formDescriptionId","formMessageId","Slot","FormDescription","FormMessage","children","body"],"mappings":";;;;;;;AAgBA,MAAMA,IAAOC,GASPC,IAAmBC,EAAM,cAAqC,EAA2B,GAEzFC,IAAY,CAGhB;AAAA,EACA,GAAGC;AACL,MAEK,gBAAAC,EAAAJ,EAAiB,UAAjB,EAA0B,OAAO,EAAE,MAAMG,EAAM,KAAA,GAC9C,UAAA,gBAAAC,EAACC,GAAY,EAAA,GAAGF,EAAO,CAAA,GACzB,GAIEG,IAAe,MAAM;AACnB,QAAAC,IAAeN,EAAM,WAAWD,CAAgB,GAChDQ,IAAcP,EAAM,WAAWQ,CAAe,GAC9C,EAAE,eAAAC,GAAe,WAAAC,EAAU,IAAIC,EAAe,GAE9CC,IAAaH,EAAcH,EAAa,MAAMI,CAAS;AAE7D,MAAI,CAACJ;AACG,UAAA,IAAI,MAAM,gDAAgD;AAG5D,QAAA,EAAE,IAAAO,MAAON;AAER,SAAA;AAAA,IACL,IAAAM;AAAA,IACA,MAAMP,EAAa;AAAA,IACnB,YAA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DoB,EAAY,cAAc;AAEpB,MAAAI,IAAkB1B,EAAM,WAG5B,CAAC,EAAE,WAAAe,GAAW,GAAGb,EAAM,GAAGc,MAAQ;AAC5B,QAAA,EAAE,mBAAAO,EAAkB,IAAIlB,EAAa;AAGzC,SAAA,gBAAAF;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAa;AAAA,MACA,IAAIO;AAAA,MACJ,WAAWN,EAAG,sCAAsCF,CAAS;AAAA,MAC5D,GAAGb;AAAA,IAAA;AAAA,EACN;AAEJ,CAAC;AACDwB,EAAgB,cAAc;AAExB,MAAAC,IAAc3B,EAAM,WAGxB,CAAC,EAAE,WAAAe,GAAW,UAAAa,GAAU,GAAG1B,EAAM,GAAGc,MAAQ;AAC5C,QAAM,EAAE,OAAAG,GAAO,eAAAK,EAAc,IAAInB,EAAa,GACxCwB,IAAOV,IAAQ,OAAOA,KAAA,gBAAAA,EAAO,OAAO,IAAIS;AAE9C,SAAKC,IAKH,gBAAA1B;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAa;AAAA,MACA,IAAIQ;AAAA,MACJ,WAAWP,EAAG,6CAA6CF,CAAS;AAAA,MACnE,GAAGb;AAAA,MAEH,UAAA2B;AAAA,IAAA;AAAA,EACH,IAXO;AAaX,CAAC;AACDF,EAAY,cAAc;"}
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as n, jsx as e, Fragment as j } from "react/jsx-runtime";
|
|
3
|
+
import { Badge as E } from "./badge.es.js";
|
|
4
|
+
import { Button as I } from "./button.es.js";
|
|
5
|
+
import { CommandInput as k, CommandList as P, CommandEmpty as F, CommandGroup as h, CommandItem as d, CommandSeparator as v } from "./command.es.js";
|
|
6
|
+
import "./accordion.es.js";
|
|
7
|
+
import "./avatar.es.js";
|
|
8
|
+
import "./breadcrumb.es.js";
|
|
9
|
+
import "./calendar.es.js";
|
|
10
|
+
import "./card.es.js";
|
|
11
|
+
import "./chart.es.js";
|
|
12
|
+
import "./checkbox.es.js";
|
|
13
|
+
import "@radix-ui/react-collapsible";
|
|
14
|
+
import "./dialog.es.js";
|
|
15
|
+
import "./drawer.es.js";
|
|
16
|
+
import "./dropdown-menu.es.js";
|
|
17
|
+
import "./form.es.js";
|
|
18
|
+
import "./input.es.js";
|
|
19
|
+
import "./input-otp.es.js";
|
|
20
|
+
import "./label.es.js";
|
|
21
|
+
import { cn as D } from "../../utils/index.es.js";
|
|
22
|
+
import { XIcon as O, ChevronDown as y, Command as B, CheckIcon as K } from "lucide-react";
|
|
23
|
+
import "./navigation-menu.es.js";
|
|
24
|
+
import "./pagination.es.js";
|
|
25
|
+
import "./password-input.es.js";
|
|
26
|
+
import "./popover.es.js";
|
|
27
|
+
import "./radio-group.es.js";
|
|
28
|
+
import * as c from "react";
|
|
29
|
+
import "./select.es.js";
|
|
30
|
+
import { Separator as g } from "./separator.es.js";
|
|
31
|
+
import "./sheet.es.js";
|
|
32
|
+
import "./sidebar.es.js";
|
|
33
|
+
import "sonner";
|
|
34
|
+
import "./table.es.js";
|
|
35
|
+
import "./tabs.es.js";
|
|
36
|
+
import "./tooltip.es.js";
|
|
37
|
+
import { Popover as R, PopoverTrigger as M, PopoverContent as A } from "@radix-ui/react-popover";
|
|
38
|
+
import { cva as G } from "class-variance-authority";
|
|
39
|
+
G(
|
|
40
|
+
"m-1 transition ease-in-out delay-150 hover:-translate-y-1 hover:scale-110 duration-300",
|
|
41
|
+
{
|
|
42
|
+
variants: {
|
|
43
|
+
variant: {
|
|
44
|
+
default: "border-foreground/10 drop-shadow-md text-foreground bg-card hover:bg-card/80",
|
|
45
|
+
secondary: "border-foreground/10 bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
46
|
+
destructive: "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",
|
|
47
|
+
inverted: "inverted"
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
defaultVariants: {
|
|
51
|
+
variant: "default"
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
const L = c.forwardRef(
|
|
56
|
+
({
|
|
57
|
+
className: T,
|
|
58
|
+
variant: X,
|
|
59
|
+
asChild: _ = !1,
|
|
60
|
+
options: p,
|
|
61
|
+
defaultValue: m,
|
|
62
|
+
onValueChange: l,
|
|
63
|
+
disabled: q,
|
|
64
|
+
placeholder: x,
|
|
65
|
+
animation: z = 0,
|
|
66
|
+
...b
|
|
67
|
+
}, w) => {
|
|
68
|
+
const [t, s] = c.useState(m || []), i = c.useRef(new Set(t)), [u, a] = c.useState(!1);
|
|
69
|
+
c.useEffect(() => {
|
|
70
|
+
s(m || []), i.current = new Set(m);
|
|
71
|
+
}, [m]);
|
|
72
|
+
const N = (r) => {
|
|
73
|
+
r.key === "Enter" ? a(!0) : r.key === "Backspace" && !r.target.value && (t.pop(), s([...t]), i.current.delete(t[t.length - 1]), l([...t]));
|
|
74
|
+
}, C = (r) => {
|
|
75
|
+
i.current.has(r) ? (i.current.delete(r), s(t.filter((o) => o !== r))) : (i.current.add(r), s([...t, r])), l(Array.from(i.current));
|
|
76
|
+
};
|
|
77
|
+
return /* @__PURE__ */ n(R, { open: u, onOpenChange: a, children: [
|
|
78
|
+
/* @__PURE__ */ e(M, { asChild: !0, children: /* @__PURE__ */ e(
|
|
79
|
+
I,
|
|
80
|
+
{
|
|
81
|
+
ref: w,
|
|
82
|
+
...b,
|
|
83
|
+
onClick: () => a(!u),
|
|
84
|
+
className: "flex w-full p-1 rounded-md border min-h-10 h-auto items-center justify-between bg-inherit hover:bg-card",
|
|
85
|
+
children: t.length > 0 ? /* @__PURE__ */ n("div", { className: "flex justify-between items-center w-full", children: [
|
|
86
|
+
/* @__PURE__ */ e("div", { className: "flex flex-wrap items-center", children: t.map((r) => {
|
|
87
|
+
const o = p.find((S) => S.value === r), f = o == null ? void 0 : o.icon;
|
|
88
|
+
return /* @__PURE__ */ n(E, { children: [
|
|
89
|
+
f && /* @__PURE__ */ e(f, { className: "h-6 w-6 mr-2" }),
|
|
90
|
+
o == null ? void 0 : o.label
|
|
91
|
+
] }, r);
|
|
92
|
+
}) }),
|
|
93
|
+
/* @__PURE__ */ n("div", { className: "flex items-center justify-between", children: [
|
|
94
|
+
/* @__PURE__ */ e(
|
|
95
|
+
O,
|
|
96
|
+
{
|
|
97
|
+
className: "h-4 mx-2 cursor-pointer text-muted-foreground",
|
|
98
|
+
onClick: (r) => {
|
|
99
|
+
s([]), i.current.clear(), l([]), r.stopPropagation();
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
),
|
|
103
|
+
/* @__PURE__ */ e(g, { orientation: "vertical", className: "flex min-h-6 h-full" }),
|
|
104
|
+
/* @__PURE__ */ e(y, { className: "h-4 mx-2 cursor-pointer text-muted-foreground" })
|
|
105
|
+
] })
|
|
106
|
+
] }) : /* @__PURE__ */ n("div", { className: "flex items-center justify-between w-full mx-auto", children: [
|
|
107
|
+
/* @__PURE__ */ e("span", { className: "text-sm text-muted-foreground mx-3", children: x }),
|
|
108
|
+
/* @__PURE__ */ e(y, { className: "h-4 cursor-pointer text-muted-foreground mx-2" })
|
|
109
|
+
] })
|
|
110
|
+
}
|
|
111
|
+
) }),
|
|
112
|
+
/* @__PURE__ */ e(
|
|
113
|
+
A,
|
|
114
|
+
{
|
|
115
|
+
className: "w-[200px] p-0 drop-shadow-sm",
|
|
116
|
+
align: "start",
|
|
117
|
+
onEscapeKeyDown: () => a(!1),
|
|
118
|
+
children: /* @__PURE__ */ n(B, { children: [
|
|
119
|
+
/* @__PURE__ */ e(k, { placeholder: "Search...", onKeyDown: N }),
|
|
120
|
+
/* @__PURE__ */ n(P, { children: [
|
|
121
|
+
/* @__PURE__ */ e(F, { children: "No results found." }),
|
|
122
|
+
/* @__PURE__ */ e(h, { children: p.map((r) => {
|
|
123
|
+
const o = i.current.has(r.value);
|
|
124
|
+
return /* @__PURE__ */ n(
|
|
125
|
+
d,
|
|
126
|
+
{
|
|
127
|
+
onSelect: () => C(r.value),
|
|
128
|
+
style: {
|
|
129
|
+
pointerEvents: "auto",
|
|
130
|
+
opacity: 1
|
|
131
|
+
},
|
|
132
|
+
className: "cursor-pointer",
|
|
133
|
+
children: [
|
|
134
|
+
/* @__PURE__ */ e(
|
|
135
|
+
"div",
|
|
136
|
+
{
|
|
137
|
+
className: D(
|
|
138
|
+
"mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",
|
|
139
|
+
o ? "bg-primary text-primary-foreground" : "opacity-50 [&_svg]:invisible"
|
|
140
|
+
),
|
|
141
|
+
children: /* @__PURE__ */ e(K, { className: "h-4 w-4" })
|
|
142
|
+
}
|
|
143
|
+
),
|
|
144
|
+
r.icon && /* @__PURE__ */ e(r.icon, { className: "mr-2 h-4 w-4 text-muted-foreground" }),
|
|
145
|
+
/* @__PURE__ */ e("span", { children: r.label })
|
|
146
|
+
]
|
|
147
|
+
},
|
|
148
|
+
r.value
|
|
149
|
+
);
|
|
150
|
+
}) }),
|
|
151
|
+
/* @__PURE__ */ e(v, {}),
|
|
152
|
+
/* @__PURE__ */ e(h, { children: /* @__PURE__ */ n("div", { className: "flex items-center justify-between", children: [
|
|
153
|
+
t.length > 0 && /* @__PURE__ */ n(j, { children: [
|
|
154
|
+
/* @__PURE__ */ e(
|
|
155
|
+
d,
|
|
156
|
+
{
|
|
157
|
+
onSelect: () => {
|
|
158
|
+
s([]), i.current.clear(), l([]);
|
|
159
|
+
},
|
|
160
|
+
style: {
|
|
161
|
+
pointerEvents: "auto",
|
|
162
|
+
opacity: 1
|
|
163
|
+
},
|
|
164
|
+
className: "flex-1 justify-center cursor-pointer",
|
|
165
|
+
children: "Clear"
|
|
166
|
+
}
|
|
167
|
+
),
|
|
168
|
+
/* @__PURE__ */ e(g, { orientation: "vertical", className: "flex min-h-6 h-full" })
|
|
169
|
+
] }),
|
|
170
|
+
/* @__PURE__ */ e(v, {}),
|
|
171
|
+
/* @__PURE__ */ e(
|
|
172
|
+
d,
|
|
173
|
+
{
|
|
174
|
+
onSelect: () => a(!1),
|
|
175
|
+
style: {
|
|
176
|
+
pointerEvents: "auto",
|
|
177
|
+
opacity: 1
|
|
178
|
+
},
|
|
179
|
+
className: "flex-1 justify-center cursor-pointer",
|
|
180
|
+
children: "Close"
|
|
181
|
+
}
|
|
182
|
+
)
|
|
183
|
+
] }) })
|
|
184
|
+
] })
|
|
185
|
+
] })
|
|
186
|
+
}
|
|
187
|
+
)
|
|
188
|
+
] });
|
|
189
|
+
}
|
|
190
|
+
);
|
|
191
|
+
L.displayName = "MultiSelectFormField";
|
|
192
|
+
export {
|
|
193
|
+
L as default
|
|
194
|
+
};
|
|
195
|
+
//# sourceMappingURL=mutli-select.es.js.map
|