@runlume/admin-ui 0.2.1 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +40 -0
- package/README.md +34 -0
- package/dist-package/components/calendar.cjs +1 -1
- package/dist-package/components/calendar.d.ts.map +1 -1
- package/dist-package/components/calendar.js +1 -1
- package/dist-package/components/charts.cjs +1 -1
- package/dist-package/components/charts.d.ts.map +1 -1
- package/dist-package/components/charts.js +3 -2
- package/dist-package/components/rate.cjs +1 -1
- package/dist-package/components/rate.d.ts.map +1 -1
- package/dist-package/components/rate.js +20 -15
- package/dist-package/components/transfer.cjs +1 -1
- package/dist-package/components/transfer.d.ts.map +1 -1
- package/dist-package/components/transfer.js +2 -1
- package/dist-package/components/ui/alert-dialog.cjs +1 -1
- package/dist-package/components/ui/alert-dialog.d.ts +1 -1
- package/dist-package/components/ui/alert-dialog.d.ts.map +1 -1
- package/dist-package/components/ui/alert-dialog.js +42 -39
- package/dist-package/components/ui/context-menu.cjs +1 -1
- package/dist-package/components/ui/context-menu.d.ts +7 -6
- package/dist-package/components/ui/context-menu.d.ts.map +1 -1
- package/dist-package/components/ui/context-menu.js +28 -24
- package/dist-package/components/ui/dialog.cjs +1 -1
- package/dist-package/components/ui/dialog.d.ts +1 -1
- package/dist-package/components/ui/dialog.d.ts.map +1 -1
- package/dist-package/components/ui/dialog.js +85 -84
- package/dist-package/components/ui/dropdown-menu.cjs +1 -1
- package/dist-package/components/ui/dropdown-menu.d.ts +2 -2
- package/dist-package/components/ui/dropdown-menu.d.ts.map +1 -1
- package/dist-package/components/ui/dropdown-menu.js +74 -69
- package/dist-package/components/ui/native-select.cjs +1 -1
- package/dist-package/components/ui/native-select.d.ts.map +1 -1
- package/dist-package/components/ui/native-select.js +73 -70
- package/dist-package/components/ui/scroll-area.cjs +1 -1
- package/dist-package/components/ui/scroll-area.d.ts.map +1 -1
- package/dist-package/components/ui/scroll-area.js +1 -0
- package/dist-package/components/ui/sheet.cjs +1 -1
- package/dist-package/components/ui/sheet.d.ts +1 -1
- package/dist-package/components/ui/sheet.d.ts.map +1 -1
- package/dist-package/components/ui/sheet.js +45 -42
- package/dist-package/lib/overlay-suppression.cjs +1 -0
- package/dist-package/lib/overlay-suppression.d.ts +25 -0
- package/dist-package/lib/overlay-suppression.d.ts.map +1 -0
- package/dist-package/lib/overlay-suppression.js +36 -0
- package/dist-package/styles.css +1 -1
- package/package.json +5 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/
|
|
1
|
+
"use client";const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/overlay-suppression.cjs"),n=require("../../lib/utils.cjs"),r=require("./button.cjs"),i=require("../../lib/use-ui-translation.cjs"),a=require("../../lib/dialog-focus.cjs");let o=require("react");o=e.__toESM(o,1);let s=require("radix-ui"),c=require("lucide-react"),l=require("react/jsx-runtime");function u({...e}){return(0,l.jsx)(s.Dialog.Root,{"data-slot":`dialog`,...e})}function d({...e}){return(0,l.jsx)(s.Dialog.Trigger,{"data-slot":`dialog-trigger`,...e})}function f({...e}){return(0,l.jsx)(s.Dialog.Portal,{"data-slot":`dialog-portal`,...e})}function p({...e}){return(0,l.jsx)(s.Dialog.Close,{"data-slot":`dialog-close`,...e})}function m({className:e,...t}){return(0,l.jsx)(s.Dialog.Overlay,{"data-slot":`dialog-overlay`,className:n.cn(`fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0`,e),...t})}function h({className:e,children:u,showCloseButton:d=!0,onOpenAutoFocus:p,draggable:h=!1,zIndex:g,top:_,ref:v,...y}){let{t:b}=i.useUiTranslation(),[x,S]=o.useState({x:0,y:0}),[C,w]=o.useState(!1),T=o.useRef(null),E=t.useOverlayBackgroundSuppression(),D=o.useMemo(()=>t.composeRefs(T,E,v),[E,v]),O=o.useRef(null);o.useEffect(()=>{let e=T.current;e&&(C?e.style.transitionProperty=`none`:e.style.removeProperty(`transition-property`))},[C]),o.useEffect(()=>{let e=T.current;e&&_!==void 0&&(e.style.top=`${_}px`)},[_]);let k=!!h,A=String(h)===`always`,j=k?{"--tw-translate-x":`calc(-50% + ${x.x}px)`,"--tw-translate-y":_===void 0?`calc(-50% + ${x.y}px)`:`${x.y}px`}:void 0;return(0,l.jsxs)(f,{"data-slot":`dialog-portal`,children:[(0,l.jsx)(m,{style:g?{zIndex:g}:void 0}),(0,l.jsxs)(s.Dialog.Content,{"data-slot":`dialog-content`,"data-draggable":k||void 0,"data-drag-touch":A||void 0,"data-dragging":C||void 0,ref:D,style:{...g?{zIndex:g}:{},...j},onDoubleClick:()=>{k&&S({x:0,y:0})},onKeyDown:e=>{if(!k||e.metaKey||e.ctrlKey||e.altKey)return;let t=e.target;if(t.tagName===`INPUT`||t.tagName===`TEXTAREA`)return;let n=e.shiftKey?48:16,r={ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,-1],ArrowDown:[0,1]}[e.key];r&&(e.preventDefault(),S(e=>({x:Math.max(-320,Math.min(320,e.x+(r[0]??0)*n)),y:Math.max(-320,Math.min(320,e.y+(r[1]??0)*n))})))},className:n.cn(`fixed left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-lg`,_===void 0?`top-[50%] translate-x-[-50%] translate-y-[-50%]`:`translate-x-[-50%]`,e),...y,onOpenAutoFocus:e=>{p?.(e),e.defaultPrevented||a.avoidInitialCloseFocus(e)},children:[k&&(0,l.jsx)(`span`,{"data-slot":`dialog-drag-handle`,"aria-hidden":`true`,onPointerDown:e=>{(A||window.matchMedia(`(hover: hover) and (pointer: fine)`).matches)&&(e.currentTarget.setPointerCapture(e.pointerId),O.current={x:e.clientX,y:e.clientY,origin:x})},onPointerMove:e=>{if(!O.current)return;let t=Math.hypot(e.clientX-O.current.x,e.clientY-O.current.y);if(!C&&t<4)return;C||w(!0);let n={x:O.current.origin.x+(e.clientX-O.current.x),y:O.current.origin.y+(e.clientY-O.current.y)};S({x:Math.max(-320,Math.min(320,n.x)),y:Math.max(-320,Math.min(320,n.y))})},onPointerUp:()=>{O.current=null,w(!1)},onPointerCancel:()=>{O.current=null,w(!1)},className:`absolute inset-x-0 top-0 h-14 cursor-grab active:cursor-grabbing`}),u,k&&(x.x!==0||x.y!==0)&&(0,l.jsx)(r.Button,{type:`button`,variant:`ghost`,size:`xs`,className:`absolute bottom-3 left-4 text-xs text-muted-foreground`,onClick:()=>S({x:0,y:0}),children:b(`resetPosition`)}),d&&(0,l.jsxs)(s.Dialog.Close,{"data-slot":`dialog-close`,className:`absolute top-4 right-4 z-10 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,children:[(0,l.jsx)(c.XIcon,{}),(0,l.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function g({className:e,...t}){return(0,l.jsx)(`div`,{"data-slot":`dialog-header`,className:n.cn(`flex flex-col gap-2 text-center sm:text-left`,e),...t})}function _({className:e,showCloseButton:t=!1,children:i,...a}){return(0,l.jsxs)(`div`,{"data-slot":`dialog-footer`,className:n.cn(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...a,children:[i,t&&(0,l.jsx)(s.Dialog.Close,{asChild:!0,children:(0,l.jsx)(r.Button,{variant:`outline`,children:`Close`})})]})}function v({className:e,...t}){return(0,l.jsx)(s.Dialog.Title,{"data-slot":`dialog-title`,className:n.cn(`text-lg leading-none font-semibold`,e),...t})}function y({className:e,...t}){return(0,l.jsx)(s.Dialog.Description,{"data-slot":`dialog-description`,className:n.cn(`text-sm text-muted-foreground`,e),...t})}exports.Dialog=u,exports.DialogClose=p,exports.DialogContent=h,exports.DialogDescription=y,exports.DialogFooter=_,exports.DialogHeader=g,exports.DialogOverlay=m,exports.DialogPortal=f,exports.DialogTitle=v,exports.DialogTrigger=d;
|
|
@@ -5,7 +5,7 @@ declare function DialogTrigger({ ...props }: React.ComponentProps<typeof DialogP
|
|
|
5
5
|
declare function DialogPortal({ ...props }: React.ComponentProps<typeof DialogPrimitive.Portal>): React.JSX.Element;
|
|
6
6
|
declare function DialogClose({ ...props }: React.ComponentProps<typeof DialogPrimitive.Close>): React.JSX.Element;
|
|
7
7
|
declare function DialogOverlay({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Overlay>): React.JSX.Element;
|
|
8
|
-
declare function DialogContent({ className, children, showCloseButton, onOpenAutoFocus, draggable, zIndex, top, ...props }: Omit<React.ComponentProps<typeof DialogPrimitive.Content>, 'draggable'> & {
|
|
8
|
+
declare function DialogContent({ className, children, showCloseButton, onOpenAutoFocus, draggable, zIndex, top, ref, ...props }: Omit<React.ComponentProps<typeof DialogPrimitive.Content>, 'draggable'> & {
|
|
9
9
|
showCloseButton?: boolean;
|
|
10
10
|
/**
|
|
11
11
|
* 允许拖动标题栏:`true` 只在精细指针(鼠标/触控板)生效;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../../src/components/ui/dialog.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../../src/components/ui/dialog.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAM9B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,UAAU,CAAA;AAIpD,iBAAS,MAAM,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,qBAE9E;AAED,iBAAS,aAAa,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,qBAExF;AAED,iBAAS,YAAY,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,MAAM,CAAC,qBAEtF;AAED,iBAAS,WAAW,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,qBAEpF;AAED,iBAAS,aAAa,CAAC,EACrB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,qBAWtD;AAED,iBAAS,aAAa,CAAC,EACrB,SAAS,EACT,QAAQ,EACR,eAAsB,EACtB,eAAe,EACf,SAAiB,EACjB,MAAM,EACN,GAAG,EACH,GAAG,EACH,GAAG,KAAK,EACT,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,EAAE,WAAW,CAAC,GAAG;IAC3E,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAA;IAC9B,4BAA4B;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,0BAA0B;IAC1B,GAAG,CAAC,EAAE,MAAM,CAAA;CACb,qBA+IA;AAED,iBAAS,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAQzE;AAED,iBAAS,YAAY,CAAC,EACpB,SAAS,EACT,eAAuB,EACvB,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG;IAC/B,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B,qBAeA;AAED,iBAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,qBAQ/F;AAED,iBAAS,iBAAiB,CAAC,EACzB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,WAAW,CAAC,qBAQ1D;AAED,OAAO,EACL,MAAM,EACN,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,WAAW,EACX,aAAa,GACd,CAAA"}
|
|
@@ -1,80 +1,81 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
2
|
+
import { composeRefs as e, useOverlayBackgroundSuppression as t } from "../../lib/overlay-suppression.js";
|
|
3
|
+
import { cn as n } from "../../lib/utils.js";
|
|
4
|
+
import { Button as r } from "./button.js";
|
|
5
|
+
import { useUiTranslation as i } from "../../lib/use-ui-translation.js";
|
|
6
|
+
import { avoidInitialCloseFocus as a } from "../../lib/dialog-focus.js";
|
|
7
|
+
import * as o from "react";
|
|
8
|
+
import { Dialog as s } from "radix-ui";
|
|
9
|
+
import { XIcon as c } from "lucide-react";
|
|
10
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
10
11
|
//#region src/components/ui/dialog.tsx
|
|
11
|
-
function
|
|
12
|
-
return /* @__PURE__ */ s
|
|
12
|
+
function d({ ...e }) {
|
|
13
|
+
return /* @__PURE__ */ l(s.Root, {
|
|
13
14
|
"data-slot": "dialog",
|
|
14
15
|
...e
|
|
15
16
|
});
|
|
16
17
|
}
|
|
17
|
-
function
|
|
18
|
-
return /* @__PURE__ */ s
|
|
18
|
+
function f({ ...e }) {
|
|
19
|
+
return /* @__PURE__ */ l(s.Trigger, {
|
|
19
20
|
"data-slot": "dialog-trigger",
|
|
20
21
|
...e
|
|
21
22
|
});
|
|
22
23
|
}
|
|
23
|
-
function
|
|
24
|
-
return /* @__PURE__ */ s
|
|
24
|
+
function p({ ...e }) {
|
|
25
|
+
return /* @__PURE__ */ l(s.Portal, {
|
|
25
26
|
"data-slot": "dialog-portal",
|
|
26
27
|
...e
|
|
27
28
|
});
|
|
28
29
|
}
|
|
29
|
-
function
|
|
30
|
-
return /* @__PURE__ */ s
|
|
30
|
+
function m({ ...e }) {
|
|
31
|
+
return /* @__PURE__ */ l(s.Close, {
|
|
31
32
|
"data-slot": "dialog-close",
|
|
32
33
|
...e
|
|
33
34
|
});
|
|
34
35
|
}
|
|
35
|
-
function
|
|
36
|
-
return /* @__PURE__ */ s
|
|
36
|
+
function h({ className: e, ...t }) {
|
|
37
|
+
return /* @__PURE__ */ l(s.Overlay, {
|
|
37
38
|
"data-slot": "dialog-overlay",
|
|
38
|
-
className:
|
|
39
|
-
...
|
|
39
|
+
className: n("fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0", e),
|
|
40
|
+
...t
|
|
40
41
|
});
|
|
41
42
|
}
|
|
42
|
-
function
|
|
43
|
-
let { t:
|
|
43
|
+
function g({ className: d, children: f, showCloseButton: m = !0, onOpenAutoFocus: g, draggable: _ = !1, zIndex: v, top: y, ref: b, ...x }) {
|
|
44
|
+
let { t: S } = i(), [C, w] = o.useState({
|
|
44
45
|
x: 0,
|
|
45
46
|
y: 0
|
|
46
|
-
}), [
|
|
47
|
-
|
|
48
|
-
let e =
|
|
49
|
-
e && (
|
|
50
|
-
}, [
|
|
51
|
-
let e =
|
|
52
|
-
e &&
|
|
53
|
-
}, [
|
|
54
|
-
let
|
|
55
|
-
"--tw-translate-x": `calc(-50% + ${
|
|
56
|
-
"--tw-translate-y":
|
|
47
|
+
}), [T, E] = o.useState(!1), D = o.useRef(null), O = t(), k = o.useMemo(() => e(D, O, b), [O, b]), A = o.useRef(null);
|
|
48
|
+
o.useEffect(() => {
|
|
49
|
+
let e = D.current;
|
|
50
|
+
e && (T ? e.style.transitionProperty = "none" : e.style.removeProperty("transition-property"));
|
|
51
|
+
}, [T]), o.useEffect(() => {
|
|
52
|
+
let e = D.current;
|
|
53
|
+
e && y !== void 0 && (e.style.top = `${y}px`);
|
|
54
|
+
}, [y]);
|
|
55
|
+
let j = !!_, M = String(_) === "always", N = j ? {
|
|
56
|
+
"--tw-translate-x": `calc(-50% + ${C.x}px)`,
|
|
57
|
+
"--tw-translate-y": y === void 0 ? `calc(-50% + ${C.y}px)` : `${C.y}px`
|
|
57
58
|
} : void 0;
|
|
58
|
-
return /* @__PURE__ */
|
|
59
|
+
return /* @__PURE__ */ u(p, {
|
|
59
60
|
"data-slot": "dialog-portal",
|
|
60
|
-
children: [/* @__PURE__ */
|
|
61
|
+
children: [/* @__PURE__ */ l(h, { style: v ? { zIndex: v } : void 0 }), /* @__PURE__ */ u(s.Content, {
|
|
61
62
|
"data-slot": "dialog-content",
|
|
62
|
-
"data-draggable":
|
|
63
|
-
"data-drag-touch":
|
|
64
|
-
"data-dragging":
|
|
65
|
-
ref:
|
|
63
|
+
"data-draggable": j || void 0,
|
|
64
|
+
"data-drag-touch": M || void 0,
|
|
65
|
+
"data-dragging": T || void 0,
|
|
66
|
+
ref: k,
|
|
66
67
|
style: {
|
|
67
|
-
...
|
|
68
|
-
...
|
|
68
|
+
...v ? { zIndex: v } : {},
|
|
69
|
+
...N
|
|
69
70
|
},
|
|
70
71
|
onDoubleClick: () => {
|
|
71
|
-
|
|
72
|
+
j && w({
|
|
72
73
|
x: 0,
|
|
73
74
|
y: 0
|
|
74
75
|
});
|
|
75
76
|
},
|
|
76
77
|
onKeyDown: (e) => {
|
|
77
|
-
if (!
|
|
78
|
+
if (!j || e.metaKey || e.ctrlKey || e.altKey) return;
|
|
78
79
|
let t = e.target;
|
|
79
80
|
if (t.tagName === "INPUT" || t.tagName === "TEXTAREA") return;
|
|
80
81
|
let n = e.shiftKey ? 48 : 16, r = {
|
|
@@ -83,65 +84,65 @@ function m({ className: l, children: u, showCloseButton: f = !0, onOpenAutoFocus
|
|
|
83
84
|
ArrowUp: [0, -1],
|
|
84
85
|
ArrowDown: [0, 1]
|
|
85
86
|
}[e.key];
|
|
86
|
-
r && (e.preventDefault(),
|
|
87
|
+
r && (e.preventDefault(), w((e) => ({
|
|
87
88
|
x: Math.max(-320, Math.min(320, e.x + (r[0] ?? 0) * n)),
|
|
88
89
|
y: Math.max(-320, Math.min(320, e.y + (r[1] ?? 0) * n))
|
|
89
90
|
})));
|
|
90
91
|
},
|
|
91
|
-
className:
|
|
92
|
-
...
|
|
92
|
+
className: n("fixed left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-lg", y === void 0 ? "top-[50%] translate-x-[-50%] translate-y-[-50%]" : "translate-x-[-50%]", d),
|
|
93
|
+
...x,
|
|
93
94
|
onOpenAutoFocus: (e) => {
|
|
94
|
-
|
|
95
|
+
g?.(e), e.defaultPrevented || a(e);
|
|
95
96
|
},
|
|
96
97
|
children: [
|
|
97
|
-
|
|
98
|
+
j && /* @__PURE__ */ l("span", {
|
|
98
99
|
"data-slot": "dialog-drag-handle",
|
|
99
100
|
"aria-hidden": "true",
|
|
100
101
|
onPointerDown: (e) => {
|
|
101
|
-
(
|
|
102
|
+
(M || window.matchMedia("(hover: hover) and (pointer: fine)").matches) && (e.currentTarget.setPointerCapture(e.pointerId), A.current = {
|
|
102
103
|
x: e.clientX,
|
|
103
104
|
y: e.clientY,
|
|
104
|
-
origin:
|
|
105
|
+
origin: C
|
|
105
106
|
});
|
|
106
107
|
},
|
|
107
108
|
onPointerMove: (e) => {
|
|
108
|
-
if (!
|
|
109
|
-
let t = Math.hypot(e.clientX -
|
|
110
|
-
if (!
|
|
111
|
-
|
|
109
|
+
if (!A.current) return;
|
|
110
|
+
let t = Math.hypot(e.clientX - A.current.x, e.clientY - A.current.y);
|
|
111
|
+
if (!T && t < 4) return;
|
|
112
|
+
T || E(!0);
|
|
112
113
|
let n = {
|
|
113
|
-
x:
|
|
114
|
-
y:
|
|
114
|
+
x: A.current.origin.x + (e.clientX - A.current.x),
|
|
115
|
+
y: A.current.origin.y + (e.clientY - A.current.y)
|
|
115
116
|
};
|
|
116
|
-
|
|
117
|
+
w({
|
|
117
118
|
x: Math.max(-320, Math.min(320, n.x)),
|
|
118
119
|
y: Math.max(-320, Math.min(320, n.y))
|
|
119
120
|
});
|
|
120
121
|
},
|
|
121
122
|
onPointerUp: () => {
|
|
122
|
-
|
|
123
|
+
A.current = null, E(!1);
|
|
123
124
|
},
|
|
124
125
|
onPointerCancel: () => {
|
|
125
|
-
|
|
126
|
+
A.current = null, E(!1);
|
|
126
127
|
},
|
|
127
128
|
className: "absolute inset-x-0 top-0 h-14 cursor-grab active:cursor-grabbing"
|
|
128
129
|
}),
|
|
129
|
-
|
|
130
|
-
|
|
130
|
+
f,
|
|
131
|
+
j && (C.x !== 0 || C.y !== 0) && /* @__PURE__ */ l(r, {
|
|
131
132
|
type: "button",
|
|
132
133
|
variant: "ghost",
|
|
133
134
|
size: "xs",
|
|
134
135
|
className: "absolute bottom-3 left-4 text-xs text-muted-foreground",
|
|
135
|
-
onClick: () =>
|
|
136
|
+
onClick: () => w({
|
|
136
137
|
x: 0,
|
|
137
138
|
y: 0
|
|
138
139
|
}),
|
|
139
|
-
children:
|
|
140
|
+
children: S("resetPosition")
|
|
140
141
|
}),
|
|
141
|
-
|
|
142
|
+
m && /* @__PURE__ */ u(s.Close, {
|
|
142
143
|
"data-slot": "dialog-close",
|
|
143
144
|
className: "absolute top-4 right-4 z-10 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
144
|
-
children: [/* @__PURE__ */
|
|
145
|
+
children: [/* @__PURE__ */ l(c, {}), /* @__PURE__ */ l("span", {
|
|
145
146
|
className: "sr-only",
|
|
146
147
|
children: "Close"
|
|
147
148
|
})]
|
|
@@ -150,40 +151,40 @@ function m({ className: l, children: u, showCloseButton: f = !0, onOpenAutoFocus
|
|
|
150
151
|
})]
|
|
151
152
|
});
|
|
152
153
|
}
|
|
153
|
-
function
|
|
154
|
-
return /* @__PURE__ */
|
|
154
|
+
function _({ className: e, ...t }) {
|
|
155
|
+
return /* @__PURE__ */ l("div", {
|
|
155
156
|
"data-slot": "dialog-header",
|
|
156
|
-
className:
|
|
157
|
-
...
|
|
157
|
+
className: n("flex flex-col gap-2 text-center sm:text-left", e),
|
|
158
|
+
...t
|
|
158
159
|
});
|
|
159
160
|
}
|
|
160
|
-
function
|
|
161
|
-
return /* @__PURE__ */
|
|
161
|
+
function v({ className: e, showCloseButton: t = !1, children: i, ...a }) {
|
|
162
|
+
return /* @__PURE__ */ u("div", {
|
|
162
163
|
"data-slot": "dialog-footer",
|
|
163
|
-
className:
|
|
164
|
-
...
|
|
165
|
-
children: [i,
|
|
164
|
+
className: n("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", e),
|
|
165
|
+
...a,
|
|
166
|
+
children: [i, t && /* @__PURE__ */ l(s.Close, {
|
|
166
167
|
asChild: !0,
|
|
167
|
-
children: /* @__PURE__ */
|
|
168
|
+
children: /* @__PURE__ */ l(r, {
|
|
168
169
|
variant: "outline",
|
|
169
170
|
children: "Close"
|
|
170
171
|
})
|
|
171
172
|
})]
|
|
172
173
|
});
|
|
173
174
|
}
|
|
174
|
-
function
|
|
175
|
-
return /* @__PURE__ */ s
|
|
175
|
+
function y({ className: e, ...t }) {
|
|
176
|
+
return /* @__PURE__ */ l(s.Title, {
|
|
176
177
|
"data-slot": "dialog-title",
|
|
177
|
-
className:
|
|
178
|
-
...
|
|
178
|
+
className: n("text-lg leading-none font-semibold", e),
|
|
179
|
+
...t
|
|
179
180
|
});
|
|
180
181
|
}
|
|
181
|
-
function
|
|
182
|
-
return /* @__PURE__ */ s
|
|
182
|
+
function b({ className: e, ...t }) {
|
|
183
|
+
return /* @__PURE__ */ l(s.Description, {
|
|
183
184
|
"data-slot": "dialog-description",
|
|
184
|
-
className:
|
|
185
|
-
...
|
|
185
|
+
className: n("text-sm text-muted-foreground", e),
|
|
186
|
+
...t
|
|
186
187
|
});
|
|
187
188
|
}
|
|
188
189
|
//#endregion
|
|
189
|
-
export {
|
|
190
|
+
export { d as Dialog, m as DialogClose, g as DialogContent, b as DialogDescription, v as DialogFooter, _ as DialogHeader, h as DialogOverlay, p as DialogPortal, y as DialogTitle, f as DialogTrigger };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs");let
|
|
1
|
+
"use client";const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/overlay-suppression.cjs"),n=require("../../lib/utils.cjs");let r=require("react");r=e.__toESM(r,1);let i=require("radix-ui"),a=require("lucide-react"),o=require("react/jsx-runtime");function s({...e}){return(0,o.jsx)(i.DropdownMenu.Root,{"data-slot":`dropdown-menu`,...e})}function c({...e}){return(0,o.jsx)(i.DropdownMenu.Portal,{"data-slot":`dropdown-menu-portal`,...e})}function l({...e}){return(0,o.jsx)(i.DropdownMenu.Trigger,{"data-slot":`dropdown-menu-trigger`,...e})}function u({className:e,sideOffset:a=4,ref:s,...c}){let l=r.useRef(null),u=t.useOverlayBackgroundSuppression(),d=r.useMemo(()=>t.composeRefs(l,u,s),[u,s]);return(0,o.jsx)(i.DropdownMenu.Portal,{children:(0,o.jsx)(i.DropdownMenu.Content,{"data-slot":`dropdown-menu-content`,ref:d,sideOffset:a,className:n.cn(`z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md 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 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,e),...c})})}function d({...e}){return(0,o.jsx)(i.DropdownMenu.Group,{"data-slot":`dropdown-menu-group`,...e})}function f({className:e,inset:t,variant:r=`default`,...a}){return(0,o.jsx)(i.DropdownMenu.Item,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":r,className:n.cn(`relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:text-destructive!`,e),...a})}function p({className:e,children:t,checked:r,indicator:s=`leading`,...c}){let l=s===`trailing`;return(0,o.jsxs)(i.DropdownMenu.CheckboxItem,{"data-slot":`dropdown-menu-checkbox-item`,className:n.cn(`relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,l&&`gap-2 pl-2`,e),checked:r,...c,children:[(0,o.jsx)(`span`,{className:n.cn(`pointer-events-none flex size-3.5 items-center justify-center`,l?`order-last`:`absolute left-2`),children:(0,o.jsx)(i.DropdownMenu.ItemIndicator,{children:(0,o.jsx)(a.CheckIcon,{className:`size-4`})})}),t]})}function m({...e}){return(0,o.jsx)(i.DropdownMenu.RadioGroup,{"data-slot":`dropdown-menu-radio-group`,...e})}function h({className:e,children:t,...r}){return(0,o.jsxs)(i.DropdownMenu.RadioItem,{"data-slot":`dropdown-menu-radio-item`,className:n.cn(`relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...r,children:[(0,o.jsx)(`span`,{className:`pointer-events-none absolute left-2 flex size-3.5 items-center justify-center`,children:(0,o.jsx)(i.DropdownMenu.ItemIndicator,{children:(0,o.jsx)(a.CircleIcon,{className:`size-2 fill-current`})})}),t]})}function g({className:e,inset:t,...r}){return(0,o.jsx)(i.DropdownMenu.Label,{"data-slot":`dropdown-menu-label`,"data-inset":t,className:n.cn(`px-2 py-1.5 text-sm font-medium data-[inset]:pl-8`,e),...r})}function _({className:e,...t}){return(0,o.jsx)(i.DropdownMenu.Separator,{"data-slot":`dropdown-menu-separator`,className:n.cn(`-mx-1 my-1 h-px bg-border`,e),...t})}function v({className:e,...t}){return(0,o.jsx)(`span`,{"data-slot":`dropdown-menu-shortcut`,className:n.cn(`ml-auto text-xs tracking-widest text-muted-foreground`,e),...t})}function y({...e}){return(0,o.jsx)(i.DropdownMenu.Sub,{"data-slot":`dropdown-menu-sub`,...e})}function b({className:e,inset:t,children:r,...s}){return(0,o.jsxs)(i.DropdownMenu.SubTrigger,{"data-slot":`dropdown-menu-sub-trigger`,"data-inset":t,className:n.cn(`flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[inset]:pl-8 data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground`,e),...s,children:[r,(0,o.jsx)(a.ChevronRightIcon,{className:`ml-auto size-4`})]})}function x({className:e,ref:a,...s}){let c=r.useRef(null),l=t.useOverlayBackgroundSuppression(),u=r.useMemo(()=>t.composeRefs(c,l,a),[l,a]);return(0,o.jsx)(i.DropdownMenu.SubContent,{"data-slot":`dropdown-menu-sub-content`,ref:u,className:n.cn(`z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg 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 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,e),...s})}exports.DropdownMenu=s,exports.DropdownMenuCheckboxItem=p,exports.DropdownMenuContent=u,exports.DropdownMenuGroup=d,exports.DropdownMenuItem=f,exports.DropdownMenuLabel=g,exports.DropdownMenuPortal=c,exports.DropdownMenuRadioGroup=m,exports.DropdownMenuRadioItem=h,exports.DropdownMenuSeparator=_,exports.DropdownMenuShortcut=v,exports.DropdownMenuSub=y,exports.DropdownMenuSubContent=x,exports.DropdownMenuSubTrigger=b,exports.DropdownMenuTrigger=l;
|
|
@@ -3,7 +3,7 @@ import { DropdownMenu as DropdownMenuPrimitive } from 'radix-ui';
|
|
|
3
3
|
declare function DropdownMenu({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Root>): React.JSX.Element;
|
|
4
4
|
declare function DropdownMenuPortal({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>): React.JSX.Element;
|
|
5
5
|
declare function DropdownMenuTrigger({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>): React.JSX.Element;
|
|
6
|
-
declare function DropdownMenuContent({ className, sideOffset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Content>): React.JSX.Element;
|
|
6
|
+
declare function DropdownMenuContent({ className, sideOffset, ref, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Content>): React.JSX.Element;
|
|
7
7
|
declare function DropdownMenuGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Group>): React.JSX.Element;
|
|
8
8
|
declare function DropdownMenuItem({ className, inset, variant, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {
|
|
9
9
|
inset?: boolean;
|
|
@@ -24,6 +24,6 @@ declare function DropdownMenuSub({ ...props }: React.ComponentProps<typeof Dropd
|
|
|
24
24
|
declare function DropdownMenuSubTrigger({ className, inset, children, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
|
|
25
25
|
inset?: boolean;
|
|
26
26
|
}): React.JSX.Element;
|
|
27
|
-
declare function DropdownMenuSubContent({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>): React.JSX.Element;
|
|
27
|
+
declare function DropdownMenuSubContent({ className, ref, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>): React.JSX.Element;
|
|
28
28
|
export { DropdownMenu, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, };
|
|
29
29
|
//# sourceMappingURL=dropdown-menu.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown-menu.d.ts","sourceRoot":"","sources":["../../../src/components/ui/dropdown-menu.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"dropdown-menu.d.ts","sourceRoot":"","sources":["../../../src/components/ui/dropdown-menu.tsx"],"names":[],"mappings":"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"}
|
|
@@ -1,124 +1,129 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import "
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
2
|
+
import { composeRefs as e, useOverlayBackgroundSuppression as t } from "../../lib/overlay-suppression.js";
|
|
3
|
+
import { cn as n } from "../../lib/utils.js";
|
|
4
|
+
import * as r from "react";
|
|
5
|
+
import { DropdownMenu as i } from "radix-ui";
|
|
6
|
+
import { CheckIcon as a, ChevronRightIcon as o, CircleIcon as s } from "lucide-react";
|
|
7
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
7
8
|
//#region src/components/ui/dropdown-menu.tsx
|
|
8
|
-
function
|
|
9
|
-
return /* @__PURE__ */
|
|
9
|
+
function u({ ...e }) {
|
|
10
|
+
return /* @__PURE__ */ c(i.Root, {
|
|
10
11
|
"data-slot": "dropdown-menu",
|
|
11
12
|
...e
|
|
12
13
|
});
|
|
13
14
|
}
|
|
14
|
-
function
|
|
15
|
-
return /* @__PURE__ */
|
|
15
|
+
function d({ ...e }) {
|
|
16
|
+
return /* @__PURE__ */ c(i.Portal, {
|
|
16
17
|
"data-slot": "dropdown-menu-portal",
|
|
17
18
|
...e
|
|
18
19
|
});
|
|
19
20
|
}
|
|
20
|
-
function
|
|
21
|
-
return /* @__PURE__ */
|
|
21
|
+
function f({ ...e }) {
|
|
22
|
+
return /* @__PURE__ */ c(i.Trigger, {
|
|
22
23
|
"data-slot": "dropdown-menu-trigger",
|
|
23
24
|
...e
|
|
24
25
|
});
|
|
25
26
|
}
|
|
26
|
-
function
|
|
27
|
-
|
|
27
|
+
function p({ className: a, sideOffset: o = 4, ref: s, ...l }) {
|
|
28
|
+
let u = r.useRef(null), d = t(), f = r.useMemo(() => e(u, d, s), [d, s]);
|
|
29
|
+
return /* @__PURE__ */ c(i.Portal, { children: /* @__PURE__ */ c(i.Content, {
|
|
28
30
|
"data-slot": "dropdown-menu-content",
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
ref: f,
|
|
32
|
+
sideOffset: o,
|
|
33
|
+
className: n("z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md 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 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95", a),
|
|
34
|
+
...l
|
|
32
35
|
}) });
|
|
33
36
|
}
|
|
34
|
-
function
|
|
35
|
-
return /* @__PURE__ */
|
|
37
|
+
function m({ ...e }) {
|
|
38
|
+
return /* @__PURE__ */ c(i.Group, {
|
|
36
39
|
"data-slot": "dropdown-menu-group",
|
|
37
40
|
...e
|
|
38
41
|
});
|
|
39
42
|
}
|
|
40
|
-
function
|
|
41
|
-
return /* @__PURE__ */
|
|
43
|
+
function h({ className: e, inset: t, variant: r = "default", ...a }) {
|
|
44
|
+
return /* @__PURE__ */ c(i.Item, {
|
|
42
45
|
"data-slot": "dropdown-menu-item",
|
|
43
|
-
"data-inset":
|
|
44
|
-
"data-variant":
|
|
45
|
-
className:
|
|
46
|
-
...
|
|
46
|
+
"data-inset": t,
|
|
47
|
+
"data-variant": r,
|
|
48
|
+
className: n("relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:text-destructive!", e),
|
|
49
|
+
...a
|
|
47
50
|
});
|
|
48
51
|
}
|
|
49
|
-
function
|
|
50
|
-
let u =
|
|
51
|
-
return /* @__PURE__ */
|
|
52
|
+
function g({ className: e, children: t, checked: r, indicator: o = "leading", ...s }) {
|
|
53
|
+
let u = o === "trailing";
|
|
54
|
+
return /* @__PURE__ */ l(i.CheckboxItem, {
|
|
52
55
|
"data-slot": "dropdown-menu-checkbox-item",
|
|
53
|
-
className:
|
|
54
|
-
checked:
|
|
55
|
-
...
|
|
56
|
-
children: [/* @__PURE__ */
|
|
57
|
-
className:
|
|
58
|
-
children: /* @__PURE__ */
|
|
59
|
-
}),
|
|
56
|
+
className: n("relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", u && "gap-2 pl-2", e),
|
|
57
|
+
checked: r,
|
|
58
|
+
...s,
|
|
59
|
+
children: [/* @__PURE__ */ c("span", {
|
|
60
|
+
className: n("pointer-events-none flex size-3.5 items-center justify-center", u ? "order-last" : "absolute left-2"),
|
|
61
|
+
children: /* @__PURE__ */ c(i.ItemIndicator, { children: /* @__PURE__ */ c(a, { className: "size-4" }) })
|
|
62
|
+
}), t]
|
|
60
63
|
});
|
|
61
64
|
}
|
|
62
|
-
function
|
|
63
|
-
return /* @__PURE__ */
|
|
65
|
+
function _({ ...e }) {
|
|
66
|
+
return /* @__PURE__ */ c(i.RadioGroup, {
|
|
64
67
|
"data-slot": "dropdown-menu-radio-group",
|
|
65
68
|
...e
|
|
66
69
|
});
|
|
67
70
|
}
|
|
68
|
-
function
|
|
69
|
-
return /* @__PURE__ */
|
|
71
|
+
function v({ className: e, children: t, ...r }) {
|
|
72
|
+
return /* @__PURE__ */ l(i.RadioItem, {
|
|
70
73
|
"data-slot": "dropdown-menu-radio-item",
|
|
71
|
-
className:
|
|
72
|
-
...
|
|
73
|
-
children: [/* @__PURE__ */
|
|
74
|
+
className: n("relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", e),
|
|
75
|
+
...r,
|
|
76
|
+
children: [/* @__PURE__ */ c("span", {
|
|
74
77
|
className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",
|
|
75
|
-
children: /* @__PURE__ */
|
|
76
|
-
}),
|
|
78
|
+
children: /* @__PURE__ */ c(i.ItemIndicator, { children: /* @__PURE__ */ c(s, { className: "size-2 fill-current" }) })
|
|
79
|
+
}), t]
|
|
77
80
|
});
|
|
78
81
|
}
|
|
79
|
-
function
|
|
80
|
-
return /* @__PURE__ */
|
|
82
|
+
function y({ className: e, inset: t, ...r }) {
|
|
83
|
+
return /* @__PURE__ */ c(i.Label, {
|
|
81
84
|
"data-slot": "dropdown-menu-label",
|
|
82
|
-
"data-inset":
|
|
83
|
-
className:
|
|
84
|
-
...
|
|
85
|
+
"data-inset": t,
|
|
86
|
+
className: n("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8", e),
|
|
87
|
+
...r
|
|
85
88
|
});
|
|
86
89
|
}
|
|
87
|
-
function
|
|
88
|
-
return /* @__PURE__ */
|
|
90
|
+
function b({ className: e, ...t }) {
|
|
91
|
+
return /* @__PURE__ */ c(i.Separator, {
|
|
89
92
|
"data-slot": "dropdown-menu-separator",
|
|
90
|
-
className:
|
|
91
|
-
...
|
|
93
|
+
className: n("-mx-1 my-1 h-px bg-border", e),
|
|
94
|
+
...t
|
|
92
95
|
});
|
|
93
96
|
}
|
|
94
|
-
function
|
|
95
|
-
return /* @__PURE__ */
|
|
97
|
+
function x({ className: e, ...t }) {
|
|
98
|
+
return /* @__PURE__ */ c("span", {
|
|
96
99
|
"data-slot": "dropdown-menu-shortcut",
|
|
97
|
-
className:
|
|
98
|
-
...
|
|
100
|
+
className: n("ml-auto text-xs tracking-widest text-muted-foreground", e),
|
|
101
|
+
...t
|
|
99
102
|
});
|
|
100
103
|
}
|
|
101
|
-
function
|
|
102
|
-
return /* @__PURE__ */
|
|
104
|
+
function S({ ...e }) {
|
|
105
|
+
return /* @__PURE__ */ c(i.Sub, {
|
|
103
106
|
"data-slot": "dropdown-menu-sub",
|
|
104
107
|
...e
|
|
105
108
|
});
|
|
106
109
|
}
|
|
107
|
-
function
|
|
108
|
-
return /* @__PURE__ */
|
|
110
|
+
function C({ className: e, inset: t, children: r, ...a }) {
|
|
111
|
+
return /* @__PURE__ */ l(i.SubTrigger, {
|
|
109
112
|
"data-slot": "dropdown-menu-sub-trigger",
|
|
110
|
-
"data-inset":
|
|
111
|
-
className:
|
|
112
|
-
...
|
|
113
|
-
children: [
|
|
113
|
+
"data-inset": t,
|
|
114
|
+
className: n("flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[inset]:pl-8 data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground", e),
|
|
115
|
+
...a,
|
|
116
|
+
children: [r, /* @__PURE__ */ c(o, { className: "ml-auto size-4" })]
|
|
114
117
|
});
|
|
115
118
|
}
|
|
116
|
-
function
|
|
117
|
-
|
|
119
|
+
function w({ className: a, ref: o, ...s }) {
|
|
120
|
+
let l = r.useRef(null), u = t(), d = r.useMemo(() => e(l, u, o), [u, o]);
|
|
121
|
+
return /* @__PURE__ */ c(i.SubContent, {
|
|
118
122
|
"data-slot": "dropdown-menu-sub-content",
|
|
119
|
-
|
|
120
|
-
|
|
123
|
+
ref: d,
|
|
124
|
+
className: n("z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg 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 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95", a),
|
|
125
|
+
...s
|
|
121
126
|
});
|
|
122
127
|
}
|
|
123
128
|
//#endregion
|
|
124
|
-
export {
|
|
129
|
+
export { u as DropdownMenu, g as DropdownMenuCheckboxItem, p as DropdownMenuContent, m as DropdownMenuGroup, h as DropdownMenuItem, y as DropdownMenuLabel, d as DropdownMenuPortal, _ as DropdownMenuRadioGroup, v as DropdownMenuRadioItem, b as DropdownMenuSeparator, x as DropdownMenuShortcut, S as DropdownMenuSub, w as DropdownMenuSubContent, C as DropdownMenuSubTrigger, f as DropdownMenuTrigger };
|