@sonamu-kit/react-components 0.5.1 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ui/alert-dialog.d.ts +1 -1
- package/dist/components/ui/alert-dialog.js +40 -31
- package/dist/components/ui/alert-dialog.js.map +1 -1
- package/dist/components/ui/context-menu.d.ts +1 -1
- package/dist/components/ui/context-menu.js +45 -36
- package/dist/components/ui/context-menu.js.map +1 -1
- package/dist/components/ui/dialog.d.ts +1 -1
- package/dist/components/ui/dialog.js +33 -24
- package/dist/components/ui/dialog.js.map +1 -1
- package/dist/components/ui/drawer.d.ts +1 -1
- package/dist/components/ui/drawer.js +36 -31
- package/dist/components/ui/drawer.js.map +1 -1
- package/dist/components/ui/dropdown-menu.d.ts +1 -1
- package/dist/components/ui/dropdown-menu.js +45 -36
- package/dist/components/ui/dropdown-menu.js.map +1 -1
- package/dist/components/ui/menubar.d.ts +1 -1
- package/dist/components/ui/menubar.js +55 -50
- package/dist/components/ui/menubar.js.map +1 -1
- package/dist/components/ui/popover.js +22 -17
- package/dist/components/ui/popover.js.map +1 -1
- package/dist/components/ui/sheet.d.ts +1 -1
- package/dist/components/ui/sheet.js +36 -27
- package/dist/components/ui/sheet.js.map +1 -1
- package/dist/contexts/index.d.ts +1 -0
- package/dist/contexts/index.js +3 -1
- package/dist/contexts/portal-container.d.ts +18 -0
- package/dist/contexts/portal-container.js +16 -0
- package/dist/contexts/portal-container.js.map +1 -0
- package/dist/index.js +66 -65
- package/package.json +2 -1
|
@@ -2,7 +2,7 @@ import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
declare const AlertDialog: React.FC<AlertDialogPrimitive.AlertDialogProps>;
|
|
4
4
|
declare const AlertDialogTrigger: React.ForwardRefExoticComponent<AlertDialogPrimitive.AlertDialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
5
|
-
declare
|
|
5
|
+
declare function AlertDialogPortal({ container, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Portal>): React.JSX.Element;
|
|
6
6
|
declare const AlertDialogOverlay: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
7
7
|
declare const AlertDialogContent: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
8
8
|
declare const AlertDialogHeader: {
|
|
@@ -1,55 +1,64 @@
|
|
|
1
1
|
import { cn as e } from "../../lib/utils.js";
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
2
|
+
import { usePortalContainer as t } from "../../contexts/portal-container.js";
|
|
3
|
+
import { buttonVariants as n } from "./button.js";
|
|
4
|
+
import * as r from "react";
|
|
5
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
6
|
+
import * as o from "@radix-ui/react-alert-dialog";
|
|
6
7
|
// src/components/ui/alert-dialog.tsx
|
|
7
|
-
var
|
|
8
|
+
var s = o.Root, c = o.Trigger;
|
|
9
|
+
function l({ container: e, ...n }) {
|
|
10
|
+
let r = t();
|
|
11
|
+
return /* @__PURE__ */ i(o.Portal, {
|
|
12
|
+
container: e ?? r,
|
|
13
|
+
...n
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
var u = r.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ i(o.Overlay, {
|
|
8
17
|
className: e("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", t),
|
|
9
18
|
...n,
|
|
10
|
-
ref:
|
|
19
|
+
ref: r
|
|
11
20
|
}));
|
|
12
|
-
|
|
13
|
-
var
|
|
14
|
-
ref:
|
|
21
|
+
u.displayName = o.Overlay.displayName;
|
|
22
|
+
var d = r.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ a(l, { children: [/* @__PURE__ */ i(u, {}), /* @__PURE__ */ i(o.Content, {
|
|
23
|
+
ref: r,
|
|
15
24
|
className: e("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", t),
|
|
16
25
|
...n
|
|
17
26
|
})] }));
|
|
18
|
-
|
|
19
|
-
var
|
|
27
|
+
d.displayName = o.Content.displayName;
|
|
28
|
+
var f = ({ className: t, ...n }) => /* @__PURE__ */ i("div", {
|
|
20
29
|
className: e("flex flex-col space-y-2 text-center sm:text-left", t),
|
|
21
30
|
...n
|
|
22
31
|
});
|
|
23
|
-
|
|
24
|
-
var
|
|
32
|
+
f.displayName = "AlertDialogHeader";
|
|
33
|
+
var p = ({ className: t, ...n }) => /* @__PURE__ */ i("div", {
|
|
25
34
|
className: e("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", t),
|
|
26
35
|
...n
|
|
27
36
|
});
|
|
28
|
-
|
|
29
|
-
var
|
|
30
|
-
ref:
|
|
37
|
+
p.displayName = "AlertDialogFooter";
|
|
38
|
+
var m = r.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ i(o.Title, {
|
|
39
|
+
ref: r,
|
|
31
40
|
className: e("text-lg font-semibold", t),
|
|
32
41
|
...n
|
|
33
42
|
}));
|
|
34
|
-
|
|
35
|
-
var
|
|
36
|
-
ref:
|
|
43
|
+
m.displayName = o.Title.displayName;
|
|
44
|
+
var h = r.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ i(o.Description, {
|
|
45
|
+
ref: r,
|
|
37
46
|
className: e("text-sm text-muted-foreground", t),
|
|
38
47
|
...n
|
|
39
48
|
}));
|
|
40
|
-
|
|
41
|
-
var
|
|
42
|
-
ref:
|
|
43
|
-
className: e(
|
|
44
|
-
...
|
|
49
|
+
h.displayName = o.Description.displayName;
|
|
50
|
+
var g = r.forwardRef(({ className: t, ...r }, a) => /* @__PURE__ */ i(o.Action, {
|
|
51
|
+
ref: a,
|
|
52
|
+
className: e(n(), t),
|
|
53
|
+
...r
|
|
45
54
|
}));
|
|
46
|
-
|
|
47
|
-
var
|
|
48
|
-
ref:
|
|
49
|
-
className: e(
|
|
50
|
-
...
|
|
55
|
+
g.displayName = o.Action.displayName;
|
|
56
|
+
var _ = r.forwardRef(({ className: t, ...r }, a) => /* @__PURE__ */ i(o.Cancel, {
|
|
57
|
+
ref: a,
|
|
58
|
+
className: e(n({ variant: "outline" }), "mt-2 sm:mt-0", t),
|
|
59
|
+
...r
|
|
51
60
|
}));
|
|
52
|
-
|
|
53
|
-
export {
|
|
61
|
+
_.displayName = o.Cancel.displayName;
|
|
62
|
+
export { s as AlertDialog, g as AlertDialogAction, _ as AlertDialogCancel, d as AlertDialogContent, h as AlertDialogDescription, p as AlertDialogFooter, f as AlertDialogHeader, u as AlertDialogOverlay, l as AlertDialogPortal, m as AlertDialogTitle, c as AlertDialogTrigger };
|
|
54
63
|
|
|
55
64
|
//# sourceMappingURL=alert-dialog.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alert-dialog.js","names":["React","React$1","AlertDialogPrimitive","AlertDialog","AlertDialogTrigger","AlertDialogPortal","
|
|
1
|
+
{"version":3,"file":"alert-dialog.js","names":["React","React$1","AlertDialogPrimitive","AlertDialog","AlertDialogTrigger","AlertDialogPortal","props","fallback","usePortalContainer","container","AlertDialogOverlay","cn","className","AlertDialogContent","AlertDialogHeader","AlertDialogFooter","AlertDialogTitle","AlertDialogDescription","AlertDialogAction","buttonVariants","AlertDialogCancel"],"sources":["../../../src/components/ui/alert-dialog.tsx"],"sourcesContent":["import * as AlertDialogPrimitive from \"@radix-ui/react-alert-dialog\";\nimport * as React from \"react\";\n\nimport { usePortalContainer } from \"../../contexts/portal-container\";\nimport { cn } from \"../../lib/utils\";\nimport { buttonVariants } from \"./button\";\n\nconst AlertDialog = AlertDialogPrimitive.Root;\n\nconst AlertDialogTrigger = AlertDialogPrimitive.Trigger;\n\nfunction AlertDialogPortal({\n container,\n ...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Portal>) {\n const fallback = usePortalContainer();\n return <AlertDialogPrimitive.Portal container={container ?? fallback} {...props} />;\n}\n\nconst AlertDialogOverlay = React.forwardRef<\n React.ComponentRef<typeof AlertDialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Overlay\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 ref={ref}\n />\n));\nAlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;\n\nconst AlertDialogContent = React.forwardRef<\n React.ComponentRef<typeof AlertDialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content>\n>(({ className, ...props }, ref) => (\n <AlertDialogPortal>\n <AlertDialogOverlay />\n <AlertDialogPrimitive.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 </AlertDialogPortal>\n));\nAlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;\n\nconst AlertDialogHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div className={cn(\"flex flex-col space-y-2 text-center sm:text-left\", className)} {...props} />\n);\nAlertDialogHeader.displayName = \"AlertDialogHeader\";\n\nconst AlertDialogFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2\", className)}\n {...props}\n />\n);\nAlertDialogFooter.displayName = \"AlertDialogFooter\";\n\nconst AlertDialogTitle = React.forwardRef<\n React.ComponentRef<typeof AlertDialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Title\n ref={ref}\n className={cn(\"text-lg font-semibold\", className)}\n {...props}\n />\n));\nAlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;\n\nconst AlertDialogDescription = React.forwardRef<\n React.ComponentRef<typeof AlertDialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Description\n ref={ref}\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n));\nAlertDialogDescription.displayName = AlertDialogPrimitive.Description.displayName;\n\nconst AlertDialogAction = React.forwardRef<\n React.ComponentRef<typeof AlertDialogPrimitive.Action>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Action>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Action ref={ref} className={cn(buttonVariants(), className)} {...props} />\n));\nAlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;\n\nconst AlertDialogCancel = React.forwardRef<\n React.ComponentRef<typeof AlertDialogPrimitive.Cancel>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Cancel>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Cancel\n ref={ref}\n className={cn(buttonVariants({ variant: \"outline\" }), \"mt-2 sm:mt-0\", className)}\n {...props}\n />\n));\nAlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;\n\nexport {\n AlertDialog,\n AlertDialogPortal,\n AlertDialogOverlay,\n AlertDialogTrigger,\n AlertDialogContent,\n AlertDialogHeader,\n AlertDialogFooter,\n AlertDialogTitle,\n AlertDialogDescription,\n AlertDialogAction,\n AlertDialogCancel,\n};\n"],"mappings":";;;;;;;AAOA,IAAMG,IAAcD,EAAqB,MAEnCE,IAAqBF,EAAqB;AAEhD,SAASG,EAAkB,EACzB,cACA,GAAGC,KACwD;CAC3D,IAAMC,IAAWC,EAAmB;CACpC,OAAO,kBAACN,EAAqB,QAAtB;EAA6B,WAAWO,KAAaF;EAAU,GAAID;CAAQ,CAAA;AACpF;AAEA,IAAMI,IAAqBV,EAAM,YAG9B,EAAE,cAAW,GAAGM,KAAS,MAC1B,kBAACJ,EAAqB,SAAtB;CACE,WAAWS,EACT,2JACAC,CACF;CACA,GAAIN;CACC;AACN,CAAA,CACF;AACD,EAAmB,cAAcJ,EAAqB,QAAQ;AAE9D,IAAMW,IAAqBb,EAAM,YAG9B,EAAE,cAAW,GAAGM,KAAS,MAC1B,kBAACD,GAAD,EAAA,UAAA,CACE,kBAACK,GAAD,CAAqB,CAAA,GACrB,kBAACR,EAAqB,SAAtB;CACO;CACL,WAAWS,EACT,+fACAC,CACF;CACA,GAAIN;AACL,CAAA,CACgB,EAAA,CAAA,CACpB;AACD,EAAmB,cAAcJ,EAAqB,QAAQ;AAE9D,IAAMY,KAAqB,EAAE,cAAW,GAAGR,QACzC,kBAAC,OAAD;CAAK,WAAWK,EAAG,oDAAoDC,CAAS;CAAG,GAAIN;AAAQ,CAAA;AAEjG,EAAkB,cAAc;AAEhC,IAAMS,KAAqB,EAAE,cAAW,GAAGT,QACzC,kBAAC,OAAD;CACE,WAAWK,EAAG,iEAAiEC,CAAS;CACxF,GAAIN;AACL,CAAA;AAEH,EAAkB,cAAc;AAEhC,IAAMU,IAAmBhB,EAAM,YAG5B,EAAE,cAAW,GAAGM,KAAS,MAC1B,kBAACJ,EAAqB,OAAtB;CACO;CACL,WAAWS,EAAG,yBAAyBC,CAAS;CAChD,GAAIN;AACL,CAAA,CACF;AACD,EAAiB,cAAcJ,EAAqB,MAAM;AAE1D,IAAMe,IAAyBjB,EAAM,YAGlC,EAAE,cAAW,GAAGM,KAAS,MAC1B,kBAACJ,EAAqB,aAAtB;CACO;CACL,WAAWS,EAAG,iCAAiCC,CAAS;CACxD,GAAIN;AACL,CAAA,CACF;AACD,EAAuB,cAAcJ,EAAqB,YAAY;AAEtE,IAAMgB,IAAoBlB,EAAM,YAG7B,EAAE,cAAW,GAAGM,KAAS,MAC1B,kBAACJ,EAAqB,QAAtB;CAAkC;CAAK,WAAWS,EAAGQ,EAAe,GAAGP,CAAS;CAAG,GAAIN;AAAQ,CAAA,CAChG;AACD,EAAkB,cAAcJ,EAAqB,OAAO;AAE5D,IAAMkB,IAAoBpB,EAAM,YAG7B,EAAE,cAAW,GAAGM,KAAS,MAC1B,kBAACJ,EAAqB,QAAtB;CACO;CACL,WAAWS,EAAGQ,EAAe,EAAE,SAAS,UAAU,CAAC,GAAG,gBAAgBP,CAAS;CAC/E,GAAIN;AACL,CAAA,CACF;AACD,EAAkB,cAAcJ,EAAqB,OAAO"}
|
|
@@ -3,7 +3,7 @@ import * as React from "react";
|
|
|
3
3
|
declare const ContextMenu: React.FC<ContextMenuPrimitive.ContextMenuProps>;
|
|
4
4
|
declare const ContextMenuTrigger: React.ForwardRefExoticComponent<ContextMenuPrimitive.ContextMenuTriggerProps & React.RefAttributes<HTMLSpanElement>>;
|
|
5
5
|
declare const ContextMenuGroup: React.ForwardRefExoticComponent<ContextMenuPrimitive.ContextMenuGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
-
declare
|
|
6
|
+
declare function ContextMenuPortal({ container, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Portal>): React.JSX.Element;
|
|
7
7
|
declare const ContextMenuSub: React.FC<ContextMenuPrimitive.ContextMenuSubProps>;
|
|
8
8
|
declare const ContextMenuRadioGroup: React.ForwardRefExoticComponent<ContextMenuPrimitive.ContextMenuRadioGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
9
9
|
declare const ContextMenuSubTrigger: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuSubTriggerProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
@@ -1,74 +1,83 @@
|
|
|
1
1
|
import { cn as e } from "../../lib/utils.js";
|
|
2
|
-
import t from "../../
|
|
3
|
-
import n from "../../_virtual/~icons/lucide/
|
|
4
|
-
import r from "../../_virtual/~icons/lucide/
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
2
|
+
import { usePortalContainer as t } from "../../contexts/portal-container.js";
|
|
3
|
+
import n from "../../_virtual/~icons/lucide/chevron-right.js";
|
|
4
|
+
import r from "../../_virtual/~icons/lucide/check.js";
|
|
5
|
+
import i from "../../_virtual/~icons/lucide/circle.js";
|
|
6
|
+
import * as a from "react";
|
|
7
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
8
|
+
import * as c from "@radix-ui/react-context-menu";
|
|
8
9
|
// src/components/ui/context-menu.tsx
|
|
9
|
-
var
|
|
10
|
+
var l = c.Root, u = c.Trigger, d = c.Group;
|
|
11
|
+
function f({ container: e, ...n }) {
|
|
12
|
+
let r = t();
|
|
13
|
+
return /* @__PURE__ */ o(c.Portal, {
|
|
14
|
+
container: e ?? r,
|
|
15
|
+
...n
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
var p = c.Sub, m = c.RadioGroup, h = a.forwardRef(({ className: t, inset: r, children: i, ...a }, l) => /* @__PURE__ */ s(c.SubTrigger, {
|
|
10
19
|
ref: l,
|
|
11
|
-
className: e("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground", r && "pl-8",
|
|
12
|
-
...
|
|
13
|
-
children: [i, /* @__PURE__ */
|
|
20
|
+
className: e("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground", r && "pl-8", t),
|
|
21
|
+
...a,
|
|
22
|
+
children: [i, /* @__PURE__ */ o(n, { className: "ml-auto h-4 w-4" })]
|
|
14
23
|
}));
|
|
15
|
-
|
|
16
|
-
var
|
|
24
|
+
h.displayName = c.SubTrigger.displayName;
|
|
25
|
+
var g = a.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ o(c.SubContent, {
|
|
17
26
|
ref: r,
|
|
18
27
|
className: e("z-50 min-w-32 overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md 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 origin-[--radix-context-menu-content-transform-origin]", t),
|
|
19
28
|
...n
|
|
20
29
|
}));
|
|
21
|
-
|
|
22
|
-
var
|
|
30
|
+
g.displayName = c.SubContent.displayName;
|
|
31
|
+
var _ = a.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ o(f, { children: /* @__PURE__ */ o(c.Content, {
|
|
23
32
|
ref: r,
|
|
24
33
|
className: e("z-50 max-h-[--radix-context-menu-content-available-height] min-w-32 overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md animate-in fade-in-80 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 origin-[--radix-context-menu-content-transform-origin]", t),
|
|
25
34
|
...n
|
|
26
35
|
}) }));
|
|
27
|
-
|
|
28
|
-
var
|
|
36
|
+
_.displayName = c.Content.displayName;
|
|
37
|
+
var v = a.forwardRef(({ className: t, inset: n, ...r }, i) => /* @__PURE__ */ o(c.Item, {
|
|
29
38
|
ref: i,
|
|
30
39
|
className: e("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50", n && "pl-8", t),
|
|
31
40
|
...r
|
|
32
41
|
}));
|
|
33
|
-
|
|
34
|
-
var
|
|
42
|
+
v.displayName = c.Item.displayName;
|
|
43
|
+
var y = a.forwardRef(({ className: t, children: n, checked: i, ...a }, l) => /* @__PURE__ */ s(c.CheckboxItem, {
|
|
35
44
|
ref: l,
|
|
36
45
|
className: e("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50", t),
|
|
37
46
|
checked: i,
|
|
38
|
-
...
|
|
39
|
-
children: [/* @__PURE__ */
|
|
47
|
+
...a,
|
|
48
|
+
children: [/* @__PURE__ */ o("span", {
|
|
40
49
|
className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center",
|
|
41
|
-
children: /* @__PURE__ */
|
|
42
|
-
}),
|
|
50
|
+
children: /* @__PURE__ */ o(c.ItemIndicator, { children: /* @__PURE__ */ o(r, { className: "h-4 w-4" }) })
|
|
51
|
+
}), n]
|
|
43
52
|
}));
|
|
44
|
-
|
|
45
|
-
var
|
|
46
|
-
ref:
|
|
53
|
+
y.displayName = c.CheckboxItem.displayName;
|
|
54
|
+
var b = a.forwardRef(({ className: t, children: n, ...r }, a) => /* @__PURE__ */ s(c.RadioItem, {
|
|
55
|
+
ref: a,
|
|
47
56
|
className: e("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50", t),
|
|
48
|
-
...
|
|
49
|
-
children: [/* @__PURE__ */
|
|
57
|
+
...r,
|
|
58
|
+
children: [/* @__PURE__ */ o("span", {
|
|
50
59
|
className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center",
|
|
51
|
-
children: /* @__PURE__ */
|
|
60
|
+
children: /* @__PURE__ */ o(c.ItemIndicator, { children: /* @__PURE__ */ o(i, { className: "h-2 w-2 fill-current" }) })
|
|
52
61
|
}), n]
|
|
53
62
|
}));
|
|
54
|
-
|
|
55
|
-
var
|
|
63
|
+
b.displayName = c.RadioItem.displayName;
|
|
64
|
+
var x = a.forwardRef(({ className: t, inset: n, ...r }, i) => /* @__PURE__ */ o(c.Label, {
|
|
56
65
|
ref: i,
|
|
57
66
|
className: e("px-2 py-1.5 text-sm font-semibold text-foreground", n && "pl-8", t),
|
|
58
67
|
...r
|
|
59
68
|
}));
|
|
60
|
-
|
|
61
|
-
var
|
|
69
|
+
x.displayName = c.Label.displayName;
|
|
70
|
+
var S = a.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ o(c.Separator, {
|
|
62
71
|
ref: r,
|
|
63
72
|
className: e("-mx-1 my-1 h-px bg-border", t),
|
|
64
73
|
...n
|
|
65
74
|
}));
|
|
66
|
-
|
|
67
|
-
var
|
|
75
|
+
S.displayName = c.Separator.displayName;
|
|
76
|
+
var C = ({ className: t, ...n }) => /* @__PURE__ */ o("span", {
|
|
68
77
|
className: e("ml-auto text-xs tracking-widest text-muted-foreground", t),
|
|
69
78
|
...n
|
|
70
79
|
});
|
|
71
|
-
|
|
72
|
-
export {
|
|
80
|
+
C.displayName = "ContextMenuShortcut";
|
|
81
|
+
export { l as ContextMenu, y as ContextMenuCheckboxItem, _ as ContextMenuContent, d as ContextMenuGroup, v as ContextMenuItem, x as ContextMenuLabel, f as ContextMenuPortal, m as ContextMenuRadioGroup, b as ContextMenuRadioItem, S as ContextMenuSeparator, C as ContextMenuShortcut, p as ContextMenuSub, g as ContextMenuSubContent, h as ContextMenuSubTrigger, u as ContextMenuTrigger };
|
|
73
82
|
|
|
74
83
|
//# sourceMappingURL=context-menu.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-menu.js","names":["React","ChevronRightIcon","CheckIcon","CircleIcon","ForwardRef","ForwardRef$1","ForwardRef$2","React$1","ContextMenuPrimitive","ContextMenu","ContextMenuTrigger","ContextMenuGroup","ContextMenuPortal","ContextMenuSub","ContextMenuRadioGroup","ContextMenuSubTrigger","props","cn","inset","className","children","ContextMenuSubContent","ContextMenuContent","ContextMenuItem","ContextMenuCheckboxItem","ContextMenuRadioItem","ContextMenuLabel","ContextMenuSeparator","ContextMenuShortcut"],"sources":["../../../src/components/ui/context-menu.tsx"],"sourcesContent":["import * as ContextMenuPrimitive from \"@radix-ui/react-context-menu\";\nimport * as React from \"react\";\nimport CheckIcon from \"~icons/lucide/check\";\nimport ChevronRightIcon from \"~icons/lucide/chevron-right\";\nimport CircleIcon from \"~icons/lucide/circle\";\n\nimport { cn } from \"../../lib/utils\";\n\nconst ContextMenu = ContextMenuPrimitive.Root;\n\nconst ContextMenuTrigger = ContextMenuPrimitive.Trigger;\n\nconst ContextMenuGroup = ContextMenuPrimitive.Group;\n\nconst ContextMenuPortal = ContextMenuPrimitive.Portal;\n\nconst ContextMenuSub = ContextMenuPrimitive.Sub;\n\nconst ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup;\n\nconst ContextMenuSubTrigger = React.forwardRef<\n React.ComponentRef<typeof ContextMenuPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubTrigger> & {\n inset?: boolean;\n }\n>(({ className, inset, children, ...props }, ref) => (\n <ContextMenuPrimitive.SubTrigger\n ref={ref}\n className={cn(\n \"flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground\",\n inset && \"pl-8\",\n className,\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto h-4 w-4\" />\n </ContextMenuPrimitive.SubTrigger>\n));\nContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName;\n\nconst ContextMenuSubContent = React.forwardRef<\n React.ComponentRef<typeof ContextMenuPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n <ContextMenuPrimitive.SubContent\n ref={ref}\n className={cn(\n \"z-50 min-w-32 overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md 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 origin-[--radix-context-menu-content-transform-origin]\",\n className,\n )}\n {...props}\n />\n));\nContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName;\n\nconst ContextMenuContent = React.forwardRef<\n React.ComponentRef<typeof ContextMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Content>\n>(({ className, ...props }, ref) => (\n <ContextMenuPrimitive.Portal>\n <ContextMenuPrimitive.Content\n ref={ref}\n className={cn(\n \"z-50 max-h-[--radix-context-menu-content-available-height] min-w-32 overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md animate-in fade-in-80 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 origin-[--radix-context-menu-content-transform-origin]\",\n className,\n )}\n {...props}\n />\n </ContextMenuPrimitive.Portal>\n));\nContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName;\n\nconst ContextMenuItem = React.forwardRef<\n React.ComponentRef<typeof ContextMenuPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Item> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <ContextMenuPrimitive.Item\n ref={ref}\n className={cn(\n \"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50\",\n inset && \"pl-8\",\n className,\n )}\n {...props}\n />\n));\nContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName;\n\nconst ContextMenuCheckboxItem = React.forwardRef<\n React.ComponentRef<typeof ContextMenuPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n <ContextMenuPrimitive.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-sm outline-none 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 <ContextMenuPrimitive.ItemIndicator>\n <CheckIcon className=\"h-4 w-4\" />\n </ContextMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </ContextMenuPrimitive.CheckboxItem>\n));\nContextMenuCheckboxItem.displayName = ContextMenuPrimitive.CheckboxItem.displayName;\n\nconst ContextMenuRadioItem = React.forwardRef<\n React.ComponentRef<typeof ContextMenuPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <ContextMenuPrimitive.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-sm outline-none 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 <ContextMenuPrimitive.ItemIndicator>\n <CircleIcon className=\"h-2 w-2 fill-current\" />\n </ContextMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </ContextMenuPrimitive.RadioItem>\n));\nContextMenuRadioItem.displayName = ContextMenuPrimitive.RadioItem.displayName;\n\nconst ContextMenuLabel = React.forwardRef<\n React.ComponentRef<typeof ContextMenuPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Label> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <ContextMenuPrimitive.Label\n ref={ref}\n className={cn(\"px-2 py-1.5 text-sm font-semibold text-foreground\", inset && \"pl-8\", className)}\n {...props}\n />\n));\nContextMenuLabel.displayName = ContextMenuPrimitive.Label.displayName;\n\nconst ContextMenuSeparator = React.forwardRef<\n React.ComponentRef<typeof ContextMenuPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <ContextMenuPrimitive.Separator\n ref={ref}\n className={cn(\"-mx-1 my-1 h-px bg-border\", className)}\n {...props}\n />\n));\nContextMenuSeparator.displayName = ContextMenuPrimitive.Separator.displayName;\n\nconst ContextMenuShortcut = ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>) => {\n return (\n <span\n className={cn(\"ml-auto text-xs tracking-widest text-muted-foreground\", className)}\n {...props}\n />\n );\n};\nContextMenuShortcut.displayName = \"ContextMenuShortcut\";\n\nexport {\n ContextMenu,\n ContextMenuTrigger,\n ContextMenuContent,\n ContextMenuItem,\n ContextMenuCheckboxItem,\n ContextMenuRadioItem,\n ContextMenuLabel,\n ContextMenuSeparator,\n ContextMenuShortcut,\n ContextMenuGroup,\n ContextMenuPortal,\n ContextMenuSub,\n ContextMenuSubContent,\n ContextMenuSubTrigger,\n ContextMenuRadioGroup,\n};\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"context-menu.js","names":["React","ChevronRightIcon","CheckIcon","CircleIcon","ForwardRef","ForwardRef$1","ForwardRef$2","React$1","ContextMenuPrimitive","ContextMenu","ContextMenuTrigger","ContextMenuGroup","ContextMenuPortal","props","fallback","usePortalContainer","container","ContextMenuSub","ContextMenuRadioGroup","ContextMenuSubTrigger","cn","inset","className","children","ContextMenuSubContent","ContextMenuContent","ContextMenuItem","ContextMenuCheckboxItem","ContextMenuRadioItem","ContextMenuLabel","ContextMenuSeparator","ContextMenuShortcut"],"sources":["../../../src/components/ui/context-menu.tsx"],"sourcesContent":["import * as ContextMenuPrimitive from \"@radix-ui/react-context-menu\";\nimport * as React from \"react\";\nimport CheckIcon from \"~icons/lucide/check\";\nimport ChevronRightIcon from \"~icons/lucide/chevron-right\";\nimport CircleIcon from \"~icons/lucide/circle\";\n\nimport { usePortalContainer } from \"../../contexts/portal-container\";\nimport { cn } from \"../../lib/utils\";\n\nconst ContextMenu = ContextMenuPrimitive.Root;\n\nconst ContextMenuTrigger = ContextMenuPrimitive.Trigger;\n\nconst ContextMenuGroup = ContextMenuPrimitive.Group;\n\nfunction ContextMenuPortal({\n container,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.Portal>) {\n const fallback = usePortalContainer();\n return <ContextMenuPrimitive.Portal container={container ?? fallback} {...props} />;\n}\n\nconst ContextMenuSub = ContextMenuPrimitive.Sub;\n\nconst ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup;\n\nconst ContextMenuSubTrigger = React.forwardRef<\n React.ComponentRef<typeof ContextMenuPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubTrigger> & {\n inset?: boolean;\n }\n>(({ className, inset, children, ...props }, ref) => (\n <ContextMenuPrimitive.SubTrigger\n ref={ref}\n className={cn(\n \"flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground\",\n inset && \"pl-8\",\n className,\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto h-4 w-4\" />\n </ContextMenuPrimitive.SubTrigger>\n));\nContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName;\n\nconst ContextMenuSubContent = React.forwardRef<\n React.ComponentRef<typeof ContextMenuPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n <ContextMenuPrimitive.SubContent\n ref={ref}\n className={cn(\n \"z-50 min-w-32 overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md 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 origin-[--radix-context-menu-content-transform-origin]\",\n className,\n )}\n {...props}\n />\n));\nContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName;\n\nconst ContextMenuContent = React.forwardRef<\n React.ComponentRef<typeof ContextMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Content>\n>(({ className, ...props }, ref) => (\n <ContextMenuPortal>\n <ContextMenuPrimitive.Content\n ref={ref}\n className={cn(\n \"z-50 max-h-[--radix-context-menu-content-available-height] min-w-32 overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md animate-in fade-in-80 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 origin-[--radix-context-menu-content-transform-origin]\",\n className,\n )}\n {...props}\n />\n </ContextMenuPortal>\n));\nContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName;\n\nconst ContextMenuItem = React.forwardRef<\n React.ComponentRef<typeof ContextMenuPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Item> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <ContextMenuPrimitive.Item\n ref={ref}\n className={cn(\n \"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50\",\n inset && \"pl-8\",\n className,\n )}\n {...props}\n />\n));\nContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName;\n\nconst ContextMenuCheckboxItem = React.forwardRef<\n React.ComponentRef<typeof ContextMenuPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n <ContextMenuPrimitive.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-sm outline-none 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 <ContextMenuPrimitive.ItemIndicator>\n <CheckIcon className=\"h-4 w-4\" />\n </ContextMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </ContextMenuPrimitive.CheckboxItem>\n));\nContextMenuCheckboxItem.displayName = ContextMenuPrimitive.CheckboxItem.displayName;\n\nconst ContextMenuRadioItem = React.forwardRef<\n React.ComponentRef<typeof ContextMenuPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <ContextMenuPrimitive.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-sm outline-none 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 <ContextMenuPrimitive.ItemIndicator>\n <CircleIcon className=\"h-2 w-2 fill-current\" />\n </ContextMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </ContextMenuPrimitive.RadioItem>\n));\nContextMenuRadioItem.displayName = ContextMenuPrimitive.RadioItem.displayName;\n\nconst ContextMenuLabel = React.forwardRef<\n React.ComponentRef<typeof ContextMenuPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Label> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <ContextMenuPrimitive.Label\n ref={ref}\n className={cn(\"px-2 py-1.5 text-sm font-semibold text-foreground\", inset && \"pl-8\", className)}\n {...props}\n />\n));\nContextMenuLabel.displayName = ContextMenuPrimitive.Label.displayName;\n\nconst ContextMenuSeparator = React.forwardRef<\n React.ComponentRef<typeof ContextMenuPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <ContextMenuPrimitive.Separator\n ref={ref}\n className={cn(\"-mx-1 my-1 h-px bg-border\", className)}\n {...props}\n />\n));\nContextMenuSeparator.displayName = ContextMenuPrimitive.Separator.displayName;\n\nconst ContextMenuShortcut = ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>) => {\n return (\n <span\n className={cn(\"ml-auto text-xs tracking-widest text-muted-foreground\", className)}\n {...props}\n />\n );\n};\nContextMenuShortcut.displayName = \"ContextMenuShortcut\";\n\nexport {\n ContextMenu,\n ContextMenuTrigger,\n ContextMenuContent,\n ContextMenuItem,\n ContextMenuCheckboxItem,\n ContextMenuRadioItem,\n ContextMenuLabel,\n ContextMenuSeparator,\n ContextMenuShortcut,\n ContextMenuGroup,\n ContextMenuPortal,\n ContextMenuSub,\n ContextMenuSubContent,\n ContextMenuSubTrigger,\n ContextMenuRadioGroup,\n};\n"],"mappings":"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"}
|
|
@@ -2,7 +2,7 @@ import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
declare const Dialog: React.FC<DialogPrimitive.DialogProps>;
|
|
4
4
|
declare const DialogTrigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
5
|
-
declare
|
|
5
|
+
declare function DialogPortal({ container, ...props }: React.ComponentProps<typeof DialogPrimitive.Portal>): React.JSX.Element;
|
|
6
6
|
declare const DialogClose: React.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
7
7
|
declare const DialogOverlay: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
8
8
|
declare const DialogContent: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1,51 +1,60 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn as e } from "../../lib/utils.js";
|
|
3
|
-
import t from "../../
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
3
|
+
import { usePortalContainer as t } from "../../contexts/portal-container.js";
|
|
4
|
+
import n from "../../_virtual/~icons/lucide/x.js";
|
|
5
|
+
import * as r from "react";
|
|
6
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
7
|
+
import * as o from "@radix-ui/react-dialog";
|
|
7
8
|
// src/components/ui/dialog.tsx
|
|
8
|
-
var
|
|
9
|
-
|
|
9
|
+
var s = o.Root, c = o.Trigger;
|
|
10
|
+
function l({ container: e, ...n }) {
|
|
11
|
+
let r = t();
|
|
12
|
+
return /* @__PURE__ */ i(o.Portal, {
|
|
13
|
+
container: e ?? r,
|
|
14
|
+
...n
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
var u = o.Close, d = r.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ i(o.Overlay, {
|
|
18
|
+
ref: r,
|
|
10
19
|
className: e("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", t),
|
|
11
20
|
...n
|
|
12
21
|
}));
|
|
13
|
-
|
|
14
|
-
var
|
|
15
|
-
ref:
|
|
16
|
-
className: e("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",
|
|
22
|
+
d.displayName = o.Overlay.displayName;
|
|
23
|
+
var f = r.forwardRef(({ className: t, children: r, ...s }, c) => /* @__PURE__ */ a(l, { children: [/* @__PURE__ */ i(d, {}), /* @__PURE__ */ a(o.Content, {
|
|
24
|
+
ref: c,
|
|
25
|
+
className: e("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", t),
|
|
17
26
|
...s,
|
|
18
|
-
children: [
|
|
27
|
+
children: [r, /* @__PURE__ */ a(o.Close, {
|
|
19
28
|
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",
|
|
20
|
-
children: [/* @__PURE__ */
|
|
29
|
+
children: [/* @__PURE__ */ i(n, { className: "h-4 w-4" }), /* @__PURE__ */ i("span", {
|
|
21
30
|
className: "sr-only",
|
|
22
31
|
children: "Close"
|
|
23
32
|
})]
|
|
24
33
|
})]
|
|
25
34
|
})] }));
|
|
26
|
-
|
|
27
|
-
var
|
|
35
|
+
f.displayName = o.Content.displayName;
|
|
36
|
+
var p = ({ className: t, ...n }) => /* @__PURE__ */ i("div", {
|
|
28
37
|
className: e("flex flex-col space-y-1.5 text-center sm:text-left", t),
|
|
29
38
|
...n
|
|
30
39
|
});
|
|
31
|
-
|
|
32
|
-
var
|
|
40
|
+
p.displayName = "DialogHeader";
|
|
41
|
+
var m = ({ className: t, ...n }) => /* @__PURE__ */ i("div", {
|
|
33
42
|
className: e("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", t),
|
|
34
43
|
...n
|
|
35
44
|
});
|
|
36
|
-
|
|
37
|
-
var
|
|
38
|
-
ref:
|
|
45
|
+
m.displayName = "DialogFooter";
|
|
46
|
+
var h = r.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ i(o.Title, {
|
|
47
|
+
ref: r,
|
|
39
48
|
className: e("text-lg font-semibold leading-none tracking-tight", t),
|
|
40
49
|
...n
|
|
41
50
|
}));
|
|
42
|
-
|
|
43
|
-
var
|
|
44
|
-
ref:
|
|
51
|
+
h.displayName = o.Title.displayName;
|
|
52
|
+
var g = r.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ i(o.Description, {
|
|
53
|
+
ref: r,
|
|
45
54
|
className: e("text-sm text-muted-foreground", t),
|
|
46
55
|
...n
|
|
47
56
|
}));
|
|
48
|
-
|
|
49
|
-
export {
|
|
57
|
+
g.displayName = o.Description.displayName;
|
|
58
|
+
export { s as Dialog, u as DialogClose, f as DialogContent, g as DialogDescription, m as DialogFooter, p as DialogHeader, d as DialogOverlay, l as DialogPortal, h as DialogTitle, c as DialogTrigger };
|
|
50
59
|
|
|
51
60
|
//# sourceMappingURL=dialog.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.js","names":["React","XIcon","ForwardRef","React$1","DialogPrimitive","Dialog","DialogTrigger","DialogPortal","
|
|
1
|
+
{"version":3,"file":"dialog.js","names":["React","XIcon","ForwardRef","React$1","DialogPrimitive","Dialog","DialogTrigger","DialogPortal","props","fallback","usePortalContainer","container","DialogClose","DialogOverlay","cn","className","DialogContent","children","DialogHeader","DialogFooter","DialogTitle","DialogDescription"],"sources":["../../../src/components/ui/dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport * as React from \"react\";\nimport XIcon from \"~icons/lucide/x\";\n\nimport { usePortalContainer } from \"../../contexts/portal-container\";\nimport { cn } from \"../../lib/utils\";\n\nconst Dialog = DialogPrimitive.Root;\n\nconst DialogTrigger = DialogPrimitive.Trigger;\n\nfunction DialogPortal({\n container,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Portal>) {\n const fallback = usePortalContainer();\n return <DialogPrimitive.Portal container={container ?? fallback} {...props} />;\n}\n\nconst DialogClose = DialogPrimitive.Close;\n\nconst DialogOverlay = React.forwardRef<\n React.ComponentRef<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.ComponentRef<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 <XIcon 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 = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div className={cn(\"flex flex-col space-y-1.5 text-center sm:text-left\", className)} {...props} />\n);\nDialogHeader.displayName = \"DialogHeader\";\n\nconst DialogFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2\", className)}\n {...props}\n />\n);\nDialogFooter.displayName = \"DialogFooter\";\n\nconst DialogTitle = React.forwardRef<\n React.ComponentRef<typeof DialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Title\n ref={ref}\n className={cn(\"text-lg font-semibold leading-none tracking-tight\", className)}\n {...props}\n />\n));\nDialogTitle.displayName = DialogPrimitive.Title.displayName;\n\nconst DialogDescription = React.forwardRef<\n React.ComponentRef<typeof DialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Description\n ref={ref}\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n));\nDialogDescription.displayName = DialogPrimitive.Description.displayName;\n\nexport {\n Dialog,\n DialogPortal,\n DialogOverlay,\n DialogClose,\n DialogTrigger,\n DialogContent,\n DialogHeader,\n DialogFooter,\n DialogTitle,\n DialogDescription,\n};\n"],"mappings":";;;;;;;;AASA,IAAMK,IAASD,EAAgB,MAEzBE,IAAgBF,EAAgB;AAEtC,SAASG,EAAa,EACpB,cACA,GAAGC,KACmD;CACtD,IAAMC,IAAWC,EAAmB;CACpC,OAAO,kBAACN,EAAgB,QAAjB;EAAwB,WAAWO,KAAaF;EAAU,GAAID;CAAQ,CAAA;AAC/E;AAEA,IAAMI,IAAcR,EAAgB,OAE9BS,IAAgBb,EAAM,YAGzB,EAAE,cAAW,GAAGQ,KAAS,MAC1B,kBAACJ,EAAgB,SAAjB;CACO;CACL,WAAWU,EACT,0JACAC,CACF;CACA,GAAIP;AACL,CAAA,CACF;AACD,EAAc,cAAcJ,EAAgB,QAAQ;AAEpD,IAAMY,IAAgBhB,EAAM,YAGzB,EAAE,cAAW,aAAU,GAAGQ,KAAS,MACpC,kBAACD,GAAD,EAAA,UAAA,CACE,kBAACM,GAAD,CAAgB,CAAA,GAChB,kBAACT,EAAgB,SAAjB;CACO;CACL,WAAWU,EACT,+fACAC,CACF;CACA,GAAIP;CANN,UAAA,CAQGS,GACD,kBAACb,EAAgB,OAAjB;EAAuB,WAAU;EAAjC,UAAA,CACE,kBAACH,GAAD,EAAO,WAAU,UAAW,CAAA,GAC5B,kBAAC,QAAD;GAAM,WAAU;GAAU,UAAA;EAAW,CAAA,CAChB;CACA,CAAA,CAAA;AACb,CAAA,CAAA,EAAA,CAAA,CACf;AACD,EAAc,cAAcG,EAAgB,QAAQ;AAEpD,IAAMc,KAAgB,EAAE,cAAW,GAAGV,QACpC,kBAAC,OAAD;CAAK,WAAWM,EAAG,sDAAsDC,CAAS;CAAG,GAAIP;AAAQ,CAAA;AAEnG,EAAa,cAAc;AAE3B,IAAMW,KAAgB,EAAE,cAAW,GAAGX,QACpC,kBAAC,OAAD;CACE,WAAWM,EAAG,iEAAiEC,CAAS;CACxF,GAAIP;AACL,CAAA;AAEH,EAAa,cAAc;AAE3B,IAAMY,IAAcpB,EAAM,YAGvB,EAAE,cAAW,GAAGQ,KAAS,MAC1B,kBAACJ,EAAgB,OAAjB;CACO;CACL,WAAWU,EAAG,qDAAqDC,CAAS;CAC5E,GAAIP;AACL,CAAA,CACF;AACD,EAAY,cAAcJ,EAAgB,MAAM;AAEhD,IAAMiB,IAAoBrB,EAAM,YAG7B,EAAE,cAAW,GAAGQ,KAAS,MAC1B,kBAACJ,EAAgB,aAAjB;CACO;CACL,WAAWU,EAAG,iCAAiCC,CAAS;CACxD,GAAIP;AACL,CAAA,CACF;AACD,EAAkB,cAAcJ,EAAgB,YAAY"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Drawer as DrawerPrimitive } from 'vaul';
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
declare const Drawer: {
|
|
4
|
-
({ shouldScaleBackground, ...props }: React.ComponentProps<typeof DrawerPrimitive.Root>): React.JSX.Element;
|
|
4
|
+
({ shouldScaleBackground, container, ...props }: React.ComponentProps<typeof DrawerPrimitive.Root>): React.JSX.Element;
|
|
5
5
|
displayName: string;
|
|
6
6
|
};
|
|
7
7
|
declare const DrawerTrigger: React.ForwardRefExoticComponent<import('@radix-ui/react-dialog').DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -1,49 +1,54 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn as e } from "../../lib/utils.js";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
3
|
+
import { usePortalContainer as t } from "../../contexts/portal-container.js";
|
|
4
|
+
import * as n from "react";
|
|
5
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
6
|
+
import { Drawer as a } from "vaul";
|
|
6
7
|
// src/components/ui/drawer.tsx
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
var o = ({ shouldScaleBackground: e = !0, container: n, ...i }) => {
|
|
9
|
+
let o = t();
|
|
10
|
+
return /* @__PURE__ */ r(a.Root, {
|
|
11
|
+
shouldScaleBackground: e,
|
|
12
|
+
container: n ?? o,
|
|
13
|
+
...i
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
o.displayName = "Drawer";
|
|
17
|
+
var s = a.Trigger, c = a.Portal, l = a.Close, u = n.forwardRef(({ className: t, ...n }, i) => /* @__PURE__ */ r(a.Overlay, {
|
|
18
|
+
ref: i,
|
|
14
19
|
className: e("fixed inset-0 z-50 bg-black/80", t),
|
|
15
|
-
...
|
|
20
|
+
...n
|
|
16
21
|
}));
|
|
17
|
-
|
|
18
|
-
var
|
|
19
|
-
ref:
|
|
22
|
+
u.displayName = a.Overlay.displayName;
|
|
23
|
+
var d = n.forwardRef(({ className: t, children: n, ...o }, s) => /* @__PURE__ */ i(c, { children: [/* @__PURE__ */ r(u, {}), /* @__PURE__ */ i(a.Content, {
|
|
24
|
+
ref: s,
|
|
20
25
|
className: e("fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background", t),
|
|
21
26
|
...o,
|
|
22
|
-
children: [/* @__PURE__ */
|
|
27
|
+
children: [/* @__PURE__ */ r("div", { className: "mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted" }), n]
|
|
23
28
|
})] }));
|
|
24
|
-
|
|
25
|
-
var
|
|
29
|
+
d.displayName = "DrawerContent";
|
|
30
|
+
var f = ({ className: t, ...n }) => /* @__PURE__ */ r("div", {
|
|
26
31
|
className: e("grid gap-1.5 p-4 text-center sm:text-left", t),
|
|
27
|
-
...
|
|
32
|
+
...n
|
|
28
33
|
});
|
|
29
|
-
|
|
30
|
-
var
|
|
34
|
+
f.displayName = "DrawerHeader";
|
|
35
|
+
var p = ({ className: t, ...n }) => /* @__PURE__ */ r("div", {
|
|
31
36
|
className: e("mt-auto flex flex-col gap-2 p-4", t),
|
|
32
|
-
...
|
|
37
|
+
...n
|
|
33
38
|
});
|
|
34
|
-
|
|
35
|
-
var
|
|
36
|
-
ref:
|
|
39
|
+
p.displayName = "DrawerFooter";
|
|
40
|
+
var m = n.forwardRef(({ className: t, ...n }, i) => /* @__PURE__ */ r(a.Title, {
|
|
41
|
+
ref: i,
|
|
37
42
|
className: e("text-lg font-semibold leading-none tracking-tight", t),
|
|
38
|
-
...
|
|
43
|
+
...n
|
|
39
44
|
}));
|
|
40
|
-
|
|
41
|
-
var
|
|
42
|
-
ref:
|
|
45
|
+
m.displayName = a.Title.displayName;
|
|
46
|
+
var h = n.forwardRef(({ className: t, ...n }, i) => /* @__PURE__ */ r(a.Description, {
|
|
47
|
+
ref: i,
|
|
43
48
|
className: e("text-sm text-muted-foreground", t),
|
|
44
|
-
...
|
|
49
|
+
...n
|
|
45
50
|
}));
|
|
46
|
-
|
|
47
|
-
export {
|
|
51
|
+
h.displayName = a.Description.displayName;
|
|
52
|
+
export { o as Drawer, l as DrawerClose, d as DrawerContent, h as DrawerDescription, p as DrawerFooter, f as DrawerHeader, u as DrawerOverlay, c as DrawerPortal, m as DrawerTitle, s as DrawerTrigger };
|
|
48
53
|
|
|
49
54
|
//# sourceMappingURL=drawer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drawer.js","names":["Drawer","DrawerPrimitive","React","React$1","Drawer$1","props","Drawer","DrawerTrigger","DrawerPortal","DrawerClose","DrawerOverlay","cn","className","DrawerContent","children","DrawerHeader","DrawerFooter","DrawerTitle","DrawerDescription"],"sources":["../../../src/components/ui/drawer.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { Drawer as DrawerPrimitive } from \"vaul\";\n\nimport { cn } from \"../../lib/utils\";\n\nconst Drawer = ({\n shouldScaleBackground = true,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Root>) => (\n
|
|
1
|
+
{"version":3,"file":"drawer.js","names":["Drawer","DrawerPrimitive","React","React$1","Drawer$1","props","fallback","usePortalContainer","Drawer","container","DrawerTrigger","DrawerPortal","DrawerClose","DrawerOverlay","cn","className","DrawerContent","children","DrawerHeader","DrawerFooter","DrawerTitle","DrawerDescription"],"sources":["../../../src/components/ui/drawer.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { Drawer as DrawerPrimitive } from \"vaul\";\n\nimport { usePortalContainer } from \"../../contexts/portal-container\";\nimport { cn } from \"../../lib/utils\";\n\n// vaul은 Portal에 준 container, Root에 준 container 차례로 읽으므로, 맥락의 요소는 Root에 기본값으로만 줍니다.\nconst Drawer = ({\n shouldScaleBackground = true,\n container,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Root>) => {\n const fallback = usePortalContainer();\n return (\n <DrawerPrimitive.Root\n shouldScaleBackground={shouldScaleBackground}\n container={container ?? fallback}\n {...props}\n />\n );\n};\nDrawer.displayName = \"Drawer\";\n\nconst DrawerTrigger = DrawerPrimitive.Trigger;\n\nconst DrawerPortal = DrawerPrimitive.Portal;\n\nconst DrawerClose = DrawerPrimitive.Close;\n\nconst DrawerOverlay = React.forwardRef<\n React.ComponentRef<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.ComponentRef<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 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.ComponentRef<typeof DrawerPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DrawerPrimitive.Title\n ref={ref}\n className={cn(\"text-lg font-semibold leading-none tracking-tight\", className)}\n {...props}\n />\n));\nDrawerTitle.displayName = DrawerPrimitive.Title.displayName;\n\nconst DrawerDescription = React.forwardRef<\n React.ComponentRef<typeof DrawerPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DrawerPrimitive.Description\n ref={ref}\n className={cn(\"text-sm 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"],"mappings":";;;;;;;AASA,IAAMA,KAAU,EACd,2BAAwB,IACxB,cACA,GAAGK,QACoD;CACvD,IAAMC,IAAWC,EAAmB;CACpC,OACE,kBAACN,EAAgB,MAAjB;EACyB;EACvB,WAAWQ,KAAaH;EACxB,GAAID;CACL,CAAA;AAEL;AACA,EAAO,cAAc;AAErB,IAAMK,IAAgBT,EAAgB,SAEhCU,IAAeV,EAAgB,QAE/BW,IAAcX,EAAgB,OAE9BY,IAAgBX,EAAM,YAGzB,EAAE,cAAW,GAAGG,KAAS,MAC1B,kBAACJ,EAAgB,SAAjB;CACO;CACL,WAAWa,EAAG,kCAAkCC,CAAS;CACzD,GAAIV;AACL,CAAA,CACF;AACD,EAAc,cAAcJ,EAAgB,QAAQ;AAEpD,IAAMe,IAAgBd,EAAM,YAGzB,EAAE,cAAW,aAAU,GAAGG,KAAS,MACpC,kBAACM,GAAD,EAAA,UAAA,CACE,kBAACE,GAAD,CAAgB,CAAA,GAChB,kBAACZ,EAAgB,SAAjB;CACO;CACL,WAAWa,EACT,kGACAC,CACF;CACA,GAAIV;CANN,UAAA,CAQE,kBAAC,OAAD,EAAK,WAAU,mDAAoD,CAAA,GAClEY,CACsB;AACb,CAAA,CAAA,EAAA,CAAA,CACf;AACD,EAAc,cAAc;AAE5B,IAAMC,KAAgB,EAAE,cAAW,GAAGb,QACpC,kBAAC,OAAD;CAAK,WAAWS,EAAG,6CAA6CC,CAAS;CAAG,GAAIV;AAAQ,CAAA;AAE1F,EAAa,cAAc;AAE3B,IAAMc,KAAgB,EAAE,cAAW,GAAGd,QACpC,kBAAC,OAAD;CAAK,WAAWS,EAAG,mCAAmCC,CAAS;CAAG,GAAIV;AAAQ,CAAA;AAEhF,EAAa,cAAc;AAE3B,IAAMe,IAAclB,EAAM,YAGvB,EAAE,cAAW,GAAGG,KAAS,MAC1B,kBAACJ,EAAgB,OAAjB;CACO;CACL,WAAWa,EAAG,qDAAqDC,CAAS;CAC5E,GAAIV;AACL,CAAA,CACF;AACD,EAAY,cAAcJ,EAAgB,MAAM;AAEhD,IAAMoB,IAAoBnB,EAAM,YAG7B,EAAE,cAAW,GAAGG,KAAS,MAC1B,kBAACJ,EAAgB,aAAjB;CACO;CACL,WAAWa,EAAG,iCAAiCC,CAAS;CACxD,GAAIV;AACL,CAAA,CACF;AACD,EAAkB,cAAcJ,EAAgB,YAAY"}
|