@vavt/react-ui 1.2.0 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{MessageBox-BSMYQenX.cjs → MessageBox-D7Ib1f7K.cjs} +1 -1
- package/dist/{MessageBox-DipOfKXI.js → MessageBox-DDP6UWFU.js} +1 -1
- package/dist/{Modal-BOI8r4y1.cjs → Modal-DPxZEr2v.cjs} +1 -1
- package/dist/Modal-Du7aVdWl.js +239 -0
- package/dist/Notification-CJraaZIi.js +197 -0
- package/dist/Notification-D6m4qHKz.cjs +1 -0
- package/dist/Tag-4iZGcfrg.cjs +1 -0
- package/dist/Tag-TeYTDdHt.js +51 -0
- package/dist/cjs/MessageBox.cjs +1 -1
- package/dist/cjs/Modal.cjs +1 -1
- package/dist/cjs/Notification.cjs +1 -0
- package/dist/cjs/Tag.cjs +1 -1
- package/dist/cjs/global.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/register.cjs +1 -1
- package/dist/css/MessageBox.css +1 -1
- package/dist/css/Modal.css +1 -1
- package/dist/css/Notification.css +1 -0
- package/dist/css/Tag.css +1 -1
- package/dist/es/MessageBox.mjs +1 -1
- package/dist/es/Modal.mjs +1 -1
- package/dist/es/Notification.mjs +3 -0
- package/dist/es/Tag.mjs +1 -1
- package/dist/es/global.mjs +1 -1
- package/dist/es/index.mjs +20 -19
- package/dist/es/register.mjs +1 -1
- package/dist/index.css +1 -1
- package/dist/{registry-BLaletUC.js → registry-BUQSQSwB.js} +37 -35
- package/dist/registry-DF1N2ITX.cjs +1 -0
- package/dist/style/Notification.cjs +8 -0
- package/dist/style/Notification.mjs +8 -0
- package/dist/types/Notification/Notification.d.cts +4 -0
- package/dist/types/Notification/Notification.d.ts +4 -0
- package/dist/types/Notification/host.d.cts +9 -0
- package/dist/types/Notification/host.d.ts +9 -0
- package/dist/types/Notification/index.d.cts +5 -0
- package/dist/types/Notification/index.d.ts +5 -0
- package/dist/types/Notification/service.d.cts +5 -0
- package/dist/types/Notification/service.d.ts +5 -0
- package/dist/types/Notification/type.d.cts +55 -0
- package/dist/types/Notification/type.d.ts +55 -0
- package/dist/types/Tag/index.d.cts +1 -1
- package/dist/types/Tag/index.d.ts +1 -1
- package/dist/types/Tag/type.d.cts +5 -0
- package/dist/types/Tag/type.d.ts +5 -0
- package/dist/types/global.d.cts +2 -0
- package/dist/types/global.d.ts +2 -0
- package/dist/types/index.d.cts +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/registry.d.cts +1 -0
- package/dist/types/registry.d.ts +1 -0
- package/package.json +1 -1
- package/dist/Modal-De9igZ5e.js +0 -238
- package/dist/Tag-Cf9M_HT6.cjs +0 -1
- package/dist/Tag-CkfqoSwA.js +0 -42
- package/dist/registry-hU7S5myb.cjs +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./state-BuUx1onZ.cjs"),t=require("./Button-qURrKHQ0.cjs"),n=require("./focus-D-h8CbGr.cjs"),r=require("./Modal-
|
|
1
|
+
const e=require("./state-BuUx1onZ.cjs"),t=require("./Button-qURrKHQ0.cjs"),n=require("./focus-D-h8CbGr.cjs"),r=require("./Modal-DPxZEr2v.cjs");let i=require("lucide-react"),a=require("react"),o=require("react/jsx-runtime"),s=require("react-dom/client");var c={info:i.Info,success:i.CircleCheck,warning:i.CircleAlert,error:i.CircleX},l={info:`primary`,success:`success`,warning:`warning`,error:`error`},u={[n.t]:!0},d=e=>(typeof e==`object`||typeof e==`function`)&&e!==null&&`then`in e&&typeof e.then==`function`,f=(0,a.forwardRef)((n,s)=>{let{open:f,defaultOpen:p=!1,title:m=`提示`,type:h=`info`,showCancelButton:g=!1,confirmButtonText:_=`确定`,confirmButtonLoadingText:v,cancelButtonText:y=`取消`,width:b=420,closeOnClickOverlay:x=!1,closeOnPressEscape:S=!0,showClose:C=!0,draggable:w=!1,className:T,children:E,onChange:D,onConfirm:O,onCancel:k,onClose:A,onConfirmError:j,...M}=n,N=e.t(n,`open`),[P,F]=e.n({value:!!f,defaultValue:p,controlled:N,onChange:D}),[I,L]=(0,a.useState)(!1),R=(0,a.useRef)(!1),z=e=>{R.current||(e===`cancel`?k?.():A?.(),F(!1))},B=async()=>{if(!R.current)try{let e=O?.();d(e)&&(R.current=!0,L(!0),await e),F(!1)}catch(e){j?.(e)}finally{R.current=!1,L(!1)}},V=c[h],H=[`vl-message-box`,`is-${h}`,T||``].filter(Boolean).join(` `);return(0,o.jsx)(r.t,{...M,ref:s,open:P,title:m,width:b,draggable:w,closeOnClickOverlay:!I&&x,closeOnPressEscape:!I&&S,showClose:!1,className:H,header:(0,o.jsxs)(`div`,{className:`vl-message-box__header`,children:[(0,o.jsx)(`div`,{className:`vl-message-box__title`,children:m}),C?(0,o.jsx)(`button`,{type:`button`,className:`vl-modal__close`,"aria-label":`关闭消息框`,disabled:I,onClick:()=>z(`close`),children:(0,o.jsx)(i.X,{size:20,"aria-hidden":`true`})}):null]}),footer:(0,o.jsxs)(`div`,{className:`vl-message-box__actions`,children:[g?(0,o.jsx)(t.t,{disabled:I,onClick:()=>z(`cancel`),children:y}):null,(0,o.jsx)(t.t,{...u,status:l[h],variant:`solid`,loading:I,loadingText:v,onClick:B,children:_})]}),onChange:e=>{e||z(`close`)},children:(0,o.jsxs)(`div`,{className:`vl-message-box__content`,children:[(0,o.jsx)(V,{className:`vl-message-box__icon`,"aria-hidden":`true`}),(0,o.jsx)(`div`,{className:`vl-message-box__message`,children:E})]})})});f.displayName=`VlMessageBox`;var p=(e,t={},n)=>typeof document>`u`?Promise.reject(Error(`VlMessageBox imperative APIs are only available in a browser environment.`)):new Promise((r,i)=>{let c=document.createElement(`div`);c.className=`vl-message-box-container`,document.body.appendChild(c);let l=(0,s.createRoot)(c);l.render((0,o.jsx)(()=>{let[s,u]=(0,a.useState)(!0);return(0,o.jsx)(f,{...t,open:s,showCancelButton:n,onChange:u,onConfirm:async()=>{await t.onConfirm?.(),r(`confirm`)},onCancel:()=>{t.onCancel?.(),i(`cancel`)},onClose:()=>{t.onClose?.(),i(`close`)},onAfterClose:()=>{try{t.onAfterClose?.()}finally{queueMicrotask(()=>{l.unmount(),c.remove()})}},children:e})},{}))}),m=Object.assign(f,{alert:(e,t)=>p(e,t,!1),confirm:(e,t)=>p(e,t,!0)});Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return m}});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { n as e, t } from "./state-BSDh-Ob2.js";
|
|
2
2
|
import { t as n } from "./Button-CwkWSWau.js";
|
|
3
3
|
import { t as r } from "./focus-BDDJyKk3.js";
|
|
4
|
-
import { t as i } from "./Modal-
|
|
4
|
+
import { t as i } from "./Modal-Du7aVdWl.js";
|
|
5
5
|
import { CircleAlert as a, CircleCheck as o, CircleX as s, Info as c, X as l } from "lucide-react";
|
|
6
6
|
import { forwardRef as u, useRef as d, useState as f } from "react";
|
|
7
7
|
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./effect-BpNxm_06.cjs"),t=require("./state-BuUx1onZ.cjs"),n=require("./client-BkoqeUs3.cjs"),r=require("./refs-DCqd87V8.cjs"),i=require("./content-DCGQZQp8.cjs"),a=require("./number-B7qJF_ZY.cjs"),o=require("./id-CF0zOP1G.cjs"),s=require("./layer-BgiUZy_t.cjs"),c=require("./dialog-shell-CzeGytVj.cjs"),ee=require("./Scrollbar-CEQT6Ao_.cjs");let te=require("lucide-react"),l=require("react"),u=require("react/jsx-runtime");var ne=.25,re=0,ie=e=>{if(typeof e==`number`)return Number.isFinite(e)?e:0;if(typeof e==`string`){let t=e.trim();if(t.endsWith(`vh`)){let e=parseFloat(t);return Number.isFinite(e)?window.innerHeight*e/100:0}if(t.endsWith(`px`)){let e=parseFloat(t);return Number.isFinite(e)?e:0}let n=parseFloat(t);return Number.isFinite(n)?n:0}return 0},d=(0,l.forwardRef)((d,f)=>{let{open:p,defaultOpen:ae=!1,title:m,width:oe=520,offsetY:h=re,center:g=!1,mask:se=!0,closeOnClickOverlay:ce=!0,closeOnPressEscape:le=!0,showClose:_=!0,lockScroll:ue=!0,destroyOnClose:v=!1,draggable:y=!0,fullscreen:b=!1,zIndex:de,header:x,footer:S,className:fe,style:C,children:pe,onClick:me,onChange:he,onOpen:w,onClose:T,onAfterClose:ge,"aria-label":_e,"aria-labelledby":ve,"aria-describedby":ye,...be}=d,E=n.t(),xe=typeof C?.zIndex==`number`?C.zIndex:void 0,D=s.r({defaultZIndex:s.n.modal,zIndex:de??xe,withMask:!0}),O=(0,l.useRef)(null),Se=(0,l.useMemo)(()=>r.n(O,f),[f]),Ce=t.t(d,`open`),[k,A]=t.n({value:!!p,defaultValue:ae,controlled:Ce,onChange:he}),[we,j]=(0,l.useState)(!1),M=(0,l.useRef)({x:0,y:0}),N=(0,l.useRef)(!1),P=(0,l.useRef)(!1),F=(0,l.useRef)({x:0,y:0}),I=(0,l.useRef)(null),L=(0,l.useRef)(!1),R=(0,l.useRef)(null),z=(0,l.useRef)(null),B=o.t(`vl-modal-title`),V=(0,l.useCallback)(()=>A(!1),[A]),{isTopLayer:H}=c.r({active:E&&k,containerRef:O,closeOnPressEscape:le,lockScroll:ue,onRequestClose:V}),U=(0,l.useCallback)(e=>{O.current&&(O.current.style.visibility=e?`visible`:`hidden`)},[]),W=(0,l.useCallback)((e,t)=>{M.current={x:e,y:t},O.current&&(O.current.style.left=`${e}px`,O.current.style.top=`${t}px`)},[]),G=(0,l.useCallback)((e,t)=>{let n=e.getBoundingClientRect();return{rect:n,maxX:Math.max(t,window.innerWidth-n.width-t),maxY:Math.max(t,window.innerHeight-n.height-t)}},[]),K=(0,l.useCallback)(()=>{let e=O.current;if(!e||typeof window>`u`)return;if(b){W(0,0),N.current=!1;return}let{rect:t,maxX:n,maxY:r}=G(e,12),i=(g?(window.innerHeight-t.height)/2:window.innerHeight*ne)+ie(h);W(Math.round(a.t((window.innerWidth-t.width)/2,12,n)),Math.round(a.t(i,12,r)))},[g,b,G,h,W]),q=(0,l.useCallback)(()=>{let e=O.current;if(!e)return;let{maxX:t,maxY:n}=G(e,12);W(Math.round(a.t(M.current.x,12,t)),Math.round(a.t(M.current.y,12,n)))},[G,W]),J=(0,l.useCallback)((e,t)=>{let n=O.current;if(!n||b)return;let{maxX:r,maxY:i}=G(n,12),o=a.t(e-F.current.x,12,r),s=a.t(t-F.current.y,12,i);W(Math.round(o),Math.round(s)),N.current=!0},[b,G,W]),Y=(0,l.useRef)(J);e.t(()=>{Y.current=J},[J]);let Te=(0,l.useCallback)(e=>{P.current&&Y.current(e.clientX,e.clientY)},[]),X=(0,l.useCallback)(()=>{z.current?.abort(),z.current=null,I.current?.(),I.current=null},[]),Z=(0,l.useCallback)(()=>{P.current&&(P.current=!1,j(!1),X())},[X]),Ee=e=>{if(!y||b||!k||!H()||e.button!==0||e.target.closest(`.vl-modal__close`))return;let t=O.current;if(!t)return;e.preventDefault();let
|
|
1
|
+
const e=require("./effect-BpNxm_06.cjs"),t=require("./state-BuUx1onZ.cjs"),n=require("./client-BkoqeUs3.cjs"),r=require("./refs-DCqd87V8.cjs"),i=require("./content-DCGQZQp8.cjs"),a=require("./number-B7qJF_ZY.cjs"),o=require("./id-CF0zOP1G.cjs"),s=require("./layer-BgiUZy_t.cjs"),c=require("./dialog-shell-CzeGytVj.cjs"),ee=require("./Scrollbar-CEQT6Ao_.cjs");let te=require("lucide-react"),l=require("react"),u=require("react/jsx-runtime");var ne=.25,re=0,ie=e=>{if(typeof e==`number`)return Number.isFinite(e)?e:0;if(typeof e==`string`){let t=e.trim();if(t.endsWith(`vh`)){let e=parseFloat(t);return Number.isFinite(e)?window.innerHeight*e/100:0}if(t.endsWith(`px`)){let e=parseFloat(t);return Number.isFinite(e)?e:0}let n=parseFloat(t);return Number.isFinite(n)?n:0}return 0},d=(0,l.forwardRef)((d,f)=>{let{open:p,defaultOpen:ae=!1,title:m,width:oe=520,offsetY:h=re,center:g=!1,mask:se=!0,closeOnClickOverlay:ce=!0,closeOnPressEscape:le=!0,showClose:_=!0,lockScroll:ue=!0,destroyOnClose:v=!1,draggable:y=!0,fullscreen:b=!1,zIndex:de,header:x,footer:S,className:fe,style:C,children:pe,onClick:me,onChange:he,onOpen:w,onClose:T,onAfterClose:ge,"aria-label":_e,"aria-labelledby":ve,"aria-describedby":ye,...be}=d,E=n.t(),xe=typeof C?.zIndex==`number`?C.zIndex:void 0,D=s.r({defaultZIndex:s.n.modal,zIndex:de??xe,withMask:!0}),O=(0,l.useRef)(null),Se=(0,l.useMemo)(()=>r.n(O,f),[f]),Ce=t.t(d,`open`),[k,A]=t.n({value:!!p,defaultValue:ae,controlled:Ce,onChange:he}),[we,j]=(0,l.useState)(!1),M=(0,l.useRef)({x:0,y:0}),N=(0,l.useRef)(!1),P=(0,l.useRef)(!1),F=(0,l.useRef)({x:0,y:0}),I=(0,l.useRef)(null),L=(0,l.useRef)(!1),R=(0,l.useRef)(null),z=(0,l.useRef)(null),B=o.t(`vl-modal-title`),V=(0,l.useCallback)(()=>A(!1),[A]),{isTopLayer:H}=c.r({active:E&&k,containerRef:O,closeOnPressEscape:le,lockScroll:ue,onRequestClose:V}),U=(0,l.useCallback)(e=>{O.current&&(O.current.style.visibility=e?`visible`:`hidden`)},[]),W=(0,l.useCallback)((e,t)=>{M.current={x:e,y:t},O.current&&(O.current.style.left=`${e}px`,O.current.style.top=`${t}px`)},[]),G=(0,l.useCallback)((e,t)=>{let n=e.getBoundingClientRect();return{rect:n,maxX:Math.max(t,window.innerWidth-n.width-t),maxY:Math.max(t,window.innerHeight-n.height-t)}},[]),K=(0,l.useCallback)(()=>{let e=O.current;if(!e||typeof window>`u`)return;if(b){W(0,0),N.current=!1;return}let{rect:t,maxX:n,maxY:r}=G(e,12),i=(g?(window.innerHeight-t.height)/2:window.innerHeight*ne)+ie(h);W(Math.round(a.t((window.innerWidth-t.width)/2,12,n)),Math.round(a.t(i,12,r)))},[g,b,G,h,W]),q=(0,l.useCallback)(()=>{let e=O.current;if(!e)return;let{maxX:t,maxY:n}=G(e,12);W(Math.round(a.t(M.current.x,12,t)),Math.round(a.t(M.current.y,12,n)))},[G,W]),J=(0,l.useCallback)((e,t)=>{let n=O.current;if(!n||b)return;let{maxX:r,maxY:i}=G(n,12),o=a.t(e-F.current.x,12,r),s=a.t(t-F.current.y,12,i);W(Math.round(o),Math.round(s)),N.current=!0},[b,G,W]),Y=(0,l.useRef)(J);e.t(()=>{Y.current=J},[J]);let Te=(0,l.useCallback)(e=>{P.current&&Y.current(e.clientX,e.clientY)},[]),X=(0,l.useCallback)(()=>{z.current?.abort(),z.current=null,I.current?.(),I.current=null},[]),Z=(0,l.useCallback)(()=>{P.current&&(P.current=!1,j(!1),X())},[X]),Ee=e=>{if(!y||b||!k||!H()||e.button!==0||e.target.closest(`.vl-modal__close, .vl-modal__title, .vl-message-box__title, [class*='__title'], [data-drag-cancel], button, input, textarea, select, a`))return;let t=O.current;if(!t)return;let n=window.getSelection();n&&n.rangeCount>0&&n.removeAllRanges(),e.preventDefault();let r=t.getBoundingClientRect();F.current={x:e.clientX-r.left,y:e.clientY-r.top},P.current=!0,j(!0),I.current=c.n(),z.current=new AbortController;let{signal:i}=z.current;window.addEventListener(`pointermove`,Te,{signal:i}),window.addEventListener(`pointerup`,Z,{once:!0,signal:i})};(0,l.useEffect)(()=>{let e=L.current;k&&!e?w?.():!k&&e&&T?.(),L.current=k},[k,w,T]),e.t(()=>{!k||!E||(U(!1),b?W(0,0):!v&&N.current?q():K(),U(!0))},[k,E,b,v,K,q,W,U]),(0,l.useEffect)(()=>{k||Z()},[k,Z]),(0,l.useEffect)(()=>{if(!k)return;let e=()=>{P.current||(R.current!==null&&window.clearTimeout(R.current),R.current=window.setTimeout(()=>{R.current=null,N.current?q():K()},100))};return window.addEventListener(`resize`,e,{passive:!0}),()=>{window.removeEventListener(`resize`,e),R.current!==null&&(window.clearTimeout(R.current),R.current=null)}},[k,K,q]),(0,l.useEffect)(()=>()=>{X(),R.current!==null&&(window.clearTimeout(R.current),R.current=null)},[X]);let De=()=>{ce&&H()&&V()},Oe=e=>{e.stopPropagation(),me?.(e)},ke=[`vl-modal`,we?`is-dragging`:``,g?`is-center`:``,b?`is-fullscreen`:``,fe||``].filter(Boolean).join(` `),Ae=[`vl-modal__header`,y&&!b?`is-draggable`:``].filter(Boolean).join(` `),Q={...C};D.zIndex!==void 0&&(Q.zIndex=D.zIndex),b?(Q.width=`100vw`,Q.height=`100vh`):Q.width=a.n(oe)??`520px`;let $=x??(m?(0,u.jsx)(`div`,{id:B,className:`vl-modal__title`,children:m}):null),je=ve??(!x&&m?B:void 0),Me=_e??(je?void 0:typeof m==`string`?m:`对话框`);return(0,u.jsx)(s.t,{layer:D.layer,children:(0,u.jsxs)(c.t,{clientReady:E,open:k,mask:se,destroyOnClose:v,maskTransitionName:`vl-modal-mask`,transitionName:`vl-modal`,maskClassName:`vl-modal__mask`,panelClassName:ke,panelStyle:Q,maskStyle:D.maskZIndex===void 0?void 0:{zIndex:D.maskZIndex},panelRef:Se,role:`dialog`,ariaLabel:Me,ariaLabelledBy:je,ariaDescribedBy:ye,onMaskClick:De,onPanelClick:Oe,onAfterLeave:()=>{Z(),v&&(N.current=!1),ge?.()},panelProps:be,children:[i.t($)||_?(0,u.jsx)(`div`,{className:Ae,onPointerDown:Ee,children:(0,u.jsxs)(`div`,{className:`vl-modal__headerInner`,children:[(0,u.jsx)(`div`,{className:`vl-modal__headerMain`,children:$}),_?(0,u.jsx)(`button`,{type:`button`,className:`vl-modal__close`,"aria-label":`关闭对话框`,onClick:V,children:(0,u.jsx)(te.X,{size:20,"aria-hidden":`true`})}):null]})}):null,(0,u.jsx)(ee.t,{className:`vl-modal__body`,children:pe}),i.t(S)?(0,u.jsx)(`div`,{className:`vl-modal__footer`,children:S}):null]})})});d.displayName=`VlModal`;var f=d,p=d;Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return p}});
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
import { t as e } from "./effect-nifYL_rH.js";
|
|
2
|
+
import { n as t, t as n } from "./state-BSDh-Ob2.js";
|
|
3
|
+
import { t as r } from "./client-pj_wzx28.js";
|
|
4
|
+
import { n as i } from "./refs-D5IYOBaf.js";
|
|
5
|
+
import { t as a } from "./content-Dllrr-7G.js";
|
|
6
|
+
import { n as o, t as s } from "./number-BN2jHM6Z.js";
|
|
7
|
+
import { t as ee } from "./id-CHixuHb7.js";
|
|
8
|
+
import { n as te, r as ne, t as re } from "./layer-DDm97-sb.js";
|
|
9
|
+
import { n as ie, r as ae, t as oe } from "./dialog-shell-CdYlPT9f.js";
|
|
10
|
+
import { t as se } from "./Scrollbar-BdMGZrYi.js";
|
|
11
|
+
import { X as ce } from "lucide-react";
|
|
12
|
+
import { forwardRef as c, useCallback as l, useEffect as u, useMemo as le, useRef as d, useState as ue } from "react";
|
|
13
|
+
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
14
|
+
//#region components/Modal/Modal.tsx
|
|
15
|
+
var de = .25, fe = 0, pe = (e) => {
|
|
16
|
+
if (typeof e == "number") return Number.isFinite(e) ? e : 0;
|
|
17
|
+
if (typeof e == "string") {
|
|
18
|
+
let t = e.trim();
|
|
19
|
+
if (t.endsWith("vh")) {
|
|
20
|
+
let e = parseFloat(t);
|
|
21
|
+
return Number.isFinite(e) ? window.innerHeight * e / 100 : 0;
|
|
22
|
+
}
|
|
23
|
+
if (t.endsWith("px")) {
|
|
24
|
+
let e = parseFloat(t);
|
|
25
|
+
return Number.isFinite(e) ? e : 0;
|
|
26
|
+
}
|
|
27
|
+
let n = parseFloat(t);
|
|
28
|
+
return Number.isFinite(n) ? n : 0;
|
|
29
|
+
}
|
|
30
|
+
return 0;
|
|
31
|
+
}, m = c((c, m) => {
|
|
32
|
+
let { open: me, defaultOpen: he = !1, title: h, width: ge = 520, offsetY: g = fe, center: _ = !1, mask: _e = !0, closeOnClickOverlay: ve = !0, closeOnPressEscape: ye = !0, showClose: v = !0, lockScroll: be = !0, destroyOnClose: y = !1, draggable: b = !0, fullscreen: x = !1, zIndex: xe, header: S, footer: C, className: Se, style: w, children: Ce, onClick: we, onChange: Te, onOpen: T, onClose: E, onAfterClose: Ee, "aria-label": De, "aria-labelledby": Oe, "aria-describedby": ke, ...Ae } = c, D = r(), je = typeof w?.zIndex == "number" ? w.zIndex : void 0, O = ne({
|
|
33
|
+
defaultZIndex: te.modal,
|
|
34
|
+
zIndex: xe ?? je,
|
|
35
|
+
withMask: !0
|
|
36
|
+
}), k = d(null), Me = le(() => i(k, m), [m]), Ne = n(c, "open"), [A, j] = t({
|
|
37
|
+
value: !!me,
|
|
38
|
+
defaultValue: he,
|
|
39
|
+
controlled: Ne,
|
|
40
|
+
onChange: Te
|
|
41
|
+
}), [Pe, M] = ue(!1), N = d({
|
|
42
|
+
x: 0,
|
|
43
|
+
y: 0
|
|
44
|
+
}), P = d(!1), F = d(!1), I = d({
|
|
45
|
+
x: 0,
|
|
46
|
+
y: 0
|
|
47
|
+
}), L = d(null), R = d(!1), z = d(null), B = d(null), V = ee("vl-modal-title"), H = l(() => j(!1), [j]), { isTopLayer: U } = ae({
|
|
48
|
+
active: D && A,
|
|
49
|
+
containerRef: k,
|
|
50
|
+
closeOnPressEscape: ye,
|
|
51
|
+
lockScroll: be,
|
|
52
|
+
onRequestClose: H
|
|
53
|
+
}), W = l((e) => {
|
|
54
|
+
k.current && (k.current.style.visibility = e ? "visible" : "hidden");
|
|
55
|
+
}, []), G = l((e, t) => {
|
|
56
|
+
N.current = {
|
|
57
|
+
x: e,
|
|
58
|
+
y: t
|
|
59
|
+
}, k.current && (k.current.style.left = `${e}px`, k.current.style.top = `${t}px`);
|
|
60
|
+
}, []), K = l((e, t) => {
|
|
61
|
+
let n = e.getBoundingClientRect();
|
|
62
|
+
return {
|
|
63
|
+
rect: n,
|
|
64
|
+
maxX: Math.max(t, window.innerWidth - n.width - t),
|
|
65
|
+
maxY: Math.max(t, window.innerHeight - n.height - t)
|
|
66
|
+
};
|
|
67
|
+
}, []), q = l(() => {
|
|
68
|
+
let e = k.current;
|
|
69
|
+
if (!e || typeof window > "u") return;
|
|
70
|
+
if (x) {
|
|
71
|
+
G(0, 0), P.current = !1;
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
let { rect: t, maxX: n, maxY: r } = K(e, 12), i = (_ ? (window.innerHeight - t.height) / 2 : window.innerHeight * de) + pe(g);
|
|
75
|
+
G(Math.round(s((window.innerWidth - t.width) / 2, 12, n)), Math.round(s(i, 12, r)));
|
|
76
|
+
}, [
|
|
77
|
+
_,
|
|
78
|
+
x,
|
|
79
|
+
K,
|
|
80
|
+
g,
|
|
81
|
+
G
|
|
82
|
+
]), J = l(() => {
|
|
83
|
+
let e = k.current;
|
|
84
|
+
if (!e) return;
|
|
85
|
+
let { maxX: t, maxY: n } = K(e, 12);
|
|
86
|
+
G(Math.round(s(N.current.x, 12, t)), Math.round(s(N.current.y, 12, n)));
|
|
87
|
+
}, [K, G]), Y = l((e, t) => {
|
|
88
|
+
let n = k.current;
|
|
89
|
+
if (!n || x) return;
|
|
90
|
+
let { maxX: r, maxY: i } = K(n, 12), a = s(e - I.current.x, 12, r), o = s(t - I.current.y, 12, i);
|
|
91
|
+
G(Math.round(a), Math.round(o)), P.current = !0;
|
|
92
|
+
}, [
|
|
93
|
+
x,
|
|
94
|
+
K,
|
|
95
|
+
G
|
|
96
|
+
]), Fe = d(Y);
|
|
97
|
+
e(() => {
|
|
98
|
+
Fe.current = Y;
|
|
99
|
+
}, [Y]);
|
|
100
|
+
let Ie = l((e) => {
|
|
101
|
+
F.current && Fe.current(e.clientX, e.clientY);
|
|
102
|
+
}, []), X = l(() => {
|
|
103
|
+
B.current?.abort(), B.current = null, L.current?.(), L.current = null;
|
|
104
|
+
}, []), Z = l(() => {
|
|
105
|
+
F.current && (F.current = !1, M(!1), X());
|
|
106
|
+
}, [X]), Le = (e) => {
|
|
107
|
+
if (!b || x || !A || !U() || e.button !== 0 || e.target.closest(".vl-modal__close, .vl-modal__title, .vl-message-box__title, [class*='__title'], [data-drag-cancel], button, input, textarea, select, a")) return;
|
|
108
|
+
let t = k.current;
|
|
109
|
+
if (!t) return;
|
|
110
|
+
let n = window.getSelection();
|
|
111
|
+
n && n.rangeCount > 0 && n.removeAllRanges(), e.preventDefault();
|
|
112
|
+
let r = t.getBoundingClientRect();
|
|
113
|
+
I.current = {
|
|
114
|
+
x: e.clientX - r.left,
|
|
115
|
+
y: e.clientY - r.top
|
|
116
|
+
}, F.current = !0, M(!0), L.current = ie(), B.current = new AbortController();
|
|
117
|
+
let { signal: i } = B.current;
|
|
118
|
+
window.addEventListener("pointermove", Ie, { signal: i }), window.addEventListener("pointerup", Z, {
|
|
119
|
+
once: !0,
|
|
120
|
+
signal: i
|
|
121
|
+
});
|
|
122
|
+
};
|
|
123
|
+
u(() => {
|
|
124
|
+
let e = R.current;
|
|
125
|
+
A && !e ? T?.() : !A && e && E?.(), R.current = A;
|
|
126
|
+
}, [
|
|
127
|
+
A,
|
|
128
|
+
T,
|
|
129
|
+
E
|
|
130
|
+
]), e(() => {
|
|
131
|
+
!A || !D || (W(!1), x ? G(0, 0) : !y && P.current ? J() : q(), W(!0));
|
|
132
|
+
}, [
|
|
133
|
+
A,
|
|
134
|
+
D,
|
|
135
|
+
x,
|
|
136
|
+
y,
|
|
137
|
+
q,
|
|
138
|
+
J,
|
|
139
|
+
G,
|
|
140
|
+
W
|
|
141
|
+
]), u(() => {
|
|
142
|
+
A || Z();
|
|
143
|
+
}, [A, Z]), u(() => {
|
|
144
|
+
if (!A) return;
|
|
145
|
+
let e = () => {
|
|
146
|
+
F.current || (z.current !== null && window.clearTimeout(z.current), z.current = window.setTimeout(() => {
|
|
147
|
+
z.current = null, P.current ? J() : q();
|
|
148
|
+
}, 100));
|
|
149
|
+
};
|
|
150
|
+
return window.addEventListener("resize", e, { passive: !0 }), () => {
|
|
151
|
+
window.removeEventListener("resize", e), z.current !== null && (window.clearTimeout(z.current), z.current = null);
|
|
152
|
+
};
|
|
153
|
+
}, [
|
|
154
|
+
A,
|
|
155
|
+
q,
|
|
156
|
+
J
|
|
157
|
+
]), u(() => () => {
|
|
158
|
+
X(), z.current !== null && (window.clearTimeout(z.current), z.current = null);
|
|
159
|
+
}, [X]);
|
|
160
|
+
let Re = () => {
|
|
161
|
+
ve && U() && H();
|
|
162
|
+
}, ze = (e) => {
|
|
163
|
+
e.stopPropagation(), we?.(e);
|
|
164
|
+
}, Be = [
|
|
165
|
+
"vl-modal",
|
|
166
|
+
Pe ? "is-dragging" : "",
|
|
167
|
+
_ ? "is-center" : "",
|
|
168
|
+
x ? "is-fullscreen" : "",
|
|
169
|
+
Se || ""
|
|
170
|
+
].filter(Boolean).join(" "), Ve = ["vl-modal__header", b && !x ? "is-draggable" : ""].filter(Boolean).join(" "), Q = { ...w };
|
|
171
|
+
O.zIndex !== void 0 && (Q.zIndex = O.zIndex), x ? (Q.width = "100vw", Q.height = "100vh") : Q.width = o(ge) ?? "520px";
|
|
172
|
+
let He = S ?? (h ? /* @__PURE__ */ f("div", {
|
|
173
|
+
id: V,
|
|
174
|
+
className: "vl-modal__title",
|
|
175
|
+
children: h
|
|
176
|
+
}) : null), $ = Oe ?? (!S && h ? V : void 0), Ue = De ?? ($ ? void 0 : typeof h == "string" ? h : "对话框");
|
|
177
|
+
return /* @__PURE__ */ f(re, {
|
|
178
|
+
layer: O.layer,
|
|
179
|
+
children: /* @__PURE__ */ p(oe, {
|
|
180
|
+
clientReady: D,
|
|
181
|
+
open: A,
|
|
182
|
+
mask: _e,
|
|
183
|
+
destroyOnClose: y,
|
|
184
|
+
maskTransitionName: "vl-modal-mask",
|
|
185
|
+
transitionName: "vl-modal",
|
|
186
|
+
maskClassName: "vl-modal__mask",
|
|
187
|
+
panelClassName: Be,
|
|
188
|
+
panelStyle: Q,
|
|
189
|
+
maskStyle: O.maskZIndex === void 0 ? void 0 : { zIndex: O.maskZIndex },
|
|
190
|
+
panelRef: Me,
|
|
191
|
+
role: "dialog",
|
|
192
|
+
ariaLabel: Ue,
|
|
193
|
+
ariaLabelledBy: $,
|
|
194
|
+
ariaDescribedBy: ke,
|
|
195
|
+
onMaskClick: Re,
|
|
196
|
+
onPanelClick: ze,
|
|
197
|
+
onAfterLeave: () => {
|
|
198
|
+
Z(), y && (P.current = !1), Ee?.();
|
|
199
|
+
},
|
|
200
|
+
panelProps: Ae,
|
|
201
|
+
children: [
|
|
202
|
+
a(He) || v ? /* @__PURE__ */ f("div", {
|
|
203
|
+
className: Ve,
|
|
204
|
+
onPointerDown: Le,
|
|
205
|
+
children: /* @__PURE__ */ p("div", {
|
|
206
|
+
className: "vl-modal__headerInner",
|
|
207
|
+
children: [/* @__PURE__ */ f("div", {
|
|
208
|
+
className: "vl-modal__headerMain",
|
|
209
|
+
children: He
|
|
210
|
+
}), v ? /* @__PURE__ */ f("button", {
|
|
211
|
+
type: "button",
|
|
212
|
+
className: "vl-modal__close",
|
|
213
|
+
"aria-label": "关闭对话框",
|
|
214
|
+
onClick: H,
|
|
215
|
+
children: /* @__PURE__ */ f(ce, {
|
|
216
|
+
size: 20,
|
|
217
|
+
"aria-hidden": "true"
|
|
218
|
+
})
|
|
219
|
+
}) : null]
|
|
220
|
+
})
|
|
221
|
+
}) : null,
|
|
222
|
+
/* @__PURE__ */ f(se, {
|
|
223
|
+
className: "vl-modal__body",
|
|
224
|
+
children: Ce
|
|
225
|
+
}),
|
|
226
|
+
a(C) ? /* @__PURE__ */ f("div", {
|
|
227
|
+
className: "vl-modal__footer",
|
|
228
|
+
children: C
|
|
229
|
+
}) : null
|
|
230
|
+
]
|
|
231
|
+
})
|
|
232
|
+
});
|
|
233
|
+
});
|
|
234
|
+
m.displayName = "VlModal";
|
|
235
|
+
//#endregion
|
|
236
|
+
//#region components/Modal/index.ts
|
|
237
|
+
var me = m, he = m;
|
|
238
|
+
//#endregion
|
|
239
|
+
export { me as n, he as t };
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { t as e } from "./icon-Cbvuv4yF.js";
|
|
2
|
+
import { t } from "./effect-nifYL_rH.js";
|
|
3
|
+
import { n, t as r } from "./state-BSDh-Ob2.js";
|
|
4
|
+
import { t as i } from "./Transition-DiO4GsP3.js";
|
|
5
|
+
import { CircleAlert as a, CircleCheck as o, CircleX as s, Info as c, X as l } from "lucide-react";
|
|
6
|
+
import { forwardRef as u, useCallback as d, useEffect as f, useRef as p, useState as m } from "react";
|
|
7
|
+
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
8
|
+
import { createPortal as _ } from "react-dom";
|
|
9
|
+
import { createRoot as v } from "react-dom/client";
|
|
10
|
+
//#region components/Notification/host.ts
|
|
11
|
+
var y = /* @__PURE__ */ new Map(), b = (e) => {
|
|
12
|
+
let t = y.get(e);
|
|
13
|
+
if (!t || !document.body.contains(t.element)) {
|
|
14
|
+
let n = document.createElement("div");
|
|
15
|
+
n.className = `vl-notification-host is-${e}`, document.body.appendChild(n), t = {
|
|
16
|
+
element: n,
|
|
17
|
+
users: 0
|
|
18
|
+
}, y.set(e, t);
|
|
19
|
+
}
|
|
20
|
+
t.users += 1;
|
|
21
|
+
let n = t;
|
|
22
|
+
return {
|
|
23
|
+
element: n.element,
|
|
24
|
+
release: () => {
|
|
25
|
+
--n.users, !(n.users > 0) && (n.element.remove(), y.get(e) === n && y.delete(e));
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
}, x = {
|
|
29
|
+
info: c,
|
|
30
|
+
success: o,
|
|
31
|
+
warning: a,
|
|
32
|
+
error: s
|
|
33
|
+
}, S = u((a, o) => {
|
|
34
|
+
let { open: s, defaultOpen: c = !1, title: u, status: v = "info", icon: y, placement: S = "top-right", duration: C = 4500, closable: w = !0, pauseOnHover: T = !0, pauseOnFocus: ee = !0, closeOnPressEscape: te = !0, action: E, onChange: D, onClose: O, onAfterClose: k, onMouseEnter: A, onMouseLeave: j, onFocusCapture: M, onBlurCapture: N, onKeyDown: P, role: F = v === "error" || v === "warning" ? "alert" : "status", className: I, children: L, ...R } = a, [z, B] = n({
|
|
35
|
+
value: !!s,
|
|
36
|
+
defaultValue: c,
|
|
37
|
+
controlled: r(a, "open"),
|
|
38
|
+
onChange: D
|
|
39
|
+
}), [V, H] = m(null), [U, W] = m(!1), [G, K] = m(!1), [ne, re] = m(!0), q = p(C), J = p(!1), Y = p({
|
|
40
|
+
open: z,
|
|
41
|
+
onClose: O
|
|
42
|
+
});
|
|
43
|
+
t(() => {
|
|
44
|
+
Y.current = {
|
|
45
|
+
open: z,
|
|
46
|
+
onClose: O
|
|
47
|
+
};
|
|
48
|
+
}), t(() => {
|
|
49
|
+
z && (J.current = !1);
|
|
50
|
+
}, [z]);
|
|
51
|
+
let X = d(() => {
|
|
52
|
+
!Y.current.open || J.current || (J.current = !0, B(!1), Y.current.onClose?.());
|
|
53
|
+
}, [B]);
|
|
54
|
+
f(() => {
|
|
55
|
+
let e = b(S);
|
|
56
|
+
return H(e.element), e.release;
|
|
57
|
+
}, [S]), f(() => {
|
|
58
|
+
let e = () => re(!document.hidden);
|
|
59
|
+
return e(), document.addEventListener("visibilitychange", e), () => document.removeEventListener("visibilitychange", e);
|
|
60
|
+
}, []), f(() => {
|
|
61
|
+
q.current = C, z || (W(!1), K(!1));
|
|
62
|
+
}, [z, C]);
|
|
63
|
+
let Z = !ne || T && U || ee && G;
|
|
64
|
+
if (f(() => {
|
|
65
|
+
if (!V || !z || C <= 0 || Z) return;
|
|
66
|
+
let e = Date.now(), t = window.setTimeout(X, q.current);
|
|
67
|
+
return () => {
|
|
68
|
+
window.clearTimeout(t), q.current = Math.max(0, q.current - (Date.now() - e));
|
|
69
|
+
};
|
|
70
|
+
}, [
|
|
71
|
+
V,
|
|
72
|
+
z,
|
|
73
|
+
C,
|
|
74
|
+
Z,
|
|
75
|
+
X
|
|
76
|
+
]), !V) return null;
|
|
77
|
+
let Q = y === void 0 ? x[v] : y, $ = u != null && u !== !1;
|
|
78
|
+
return _(/* @__PURE__ */ h(i, {
|
|
79
|
+
show: z,
|
|
80
|
+
name: "vl-notification-fade",
|
|
81
|
+
onAfterLeave: k,
|
|
82
|
+
children: /* @__PURE__ */ g("div", {
|
|
83
|
+
...R,
|
|
84
|
+
ref: o,
|
|
85
|
+
className: [
|
|
86
|
+
"vl-notification",
|
|
87
|
+
`is-${v}`,
|
|
88
|
+
$ ? "has-title" : "",
|
|
89
|
+
I || ""
|
|
90
|
+
].filter(Boolean).join(" "),
|
|
91
|
+
role: F,
|
|
92
|
+
"aria-atomic": R["aria-atomic"] ?? !0,
|
|
93
|
+
"aria-hidden": !z || R["aria-hidden"] || void 0,
|
|
94
|
+
onMouseEnter: (e) => {
|
|
95
|
+
W(!0), A?.(e);
|
|
96
|
+
},
|
|
97
|
+
onMouseLeave: (e) => {
|
|
98
|
+
W(!1), j?.(e);
|
|
99
|
+
},
|
|
100
|
+
onFocusCapture: (e) => {
|
|
101
|
+
K(!0), M?.(e);
|
|
102
|
+
},
|
|
103
|
+
onBlurCapture: (e) => {
|
|
104
|
+
e.currentTarget.contains(e.relatedTarget) || K(!1), N?.(e);
|
|
105
|
+
},
|
|
106
|
+
onKeyDown: (e) => {
|
|
107
|
+
P?.(e), !(e.defaultPrevented || e.key !== "Escape" || !te) && (e.stopPropagation(), X());
|
|
108
|
+
},
|
|
109
|
+
children: [
|
|
110
|
+
Q ? e(Q, "vl-notification__icon") : null,
|
|
111
|
+
/* @__PURE__ */ g("div", {
|
|
112
|
+
className: "vl-notification__body",
|
|
113
|
+
children: [
|
|
114
|
+
$ ? /* @__PURE__ */ h("div", {
|
|
115
|
+
className: "vl-notification__title",
|
|
116
|
+
children: u
|
|
117
|
+
}) : null,
|
|
118
|
+
L === void 0 ? null : /* @__PURE__ */ h("div", {
|
|
119
|
+
className: "vl-notification__content",
|
|
120
|
+
children: L
|
|
121
|
+
}),
|
|
122
|
+
E ? /* @__PURE__ */ h("div", {
|
|
123
|
+
className: "vl-notification__action",
|
|
124
|
+
children: E
|
|
125
|
+
}) : null
|
|
126
|
+
]
|
|
127
|
+
}),
|
|
128
|
+
w ? /* @__PURE__ */ h("button", {
|
|
129
|
+
type: "button",
|
|
130
|
+
className: "vl-notification__close",
|
|
131
|
+
"aria-label": "关闭通知",
|
|
132
|
+
title: "关闭通知",
|
|
133
|
+
disabled: !z,
|
|
134
|
+
onClick: X,
|
|
135
|
+
children: /* @__PURE__ */ h(l, { "aria-hidden": "true" })
|
|
136
|
+
}) : null
|
|
137
|
+
]
|
|
138
|
+
})
|
|
139
|
+
}), V);
|
|
140
|
+
});
|
|
141
|
+
S.displayName = "VlNotification";
|
|
142
|
+
//#endregion
|
|
143
|
+
//#region components/Notification/service.tsx
|
|
144
|
+
var C = /* @__PURE__ */ new Set(), w = (e) => {
|
|
145
|
+
if (typeof document > "u") throw Error("VlNotification imperative APIs are only available in a browser environment.");
|
|
146
|
+
let { content: t, onClose: n, onAfterClose: r, ...i } = e, a = document.createElement("div");
|
|
147
|
+
a.className = "vl-notification-container", document.body.appendChild(a);
|
|
148
|
+
let o = v(a), s = !0, c = !1, l = !1, u = () => {
|
|
149
|
+
l || (l = !0, C.delete(f), queueMicrotask(() => {
|
|
150
|
+
o.unmount(), a.remove(), r?.();
|
|
151
|
+
}));
|
|
152
|
+
}, d = () => {
|
|
153
|
+
o.render(/* @__PURE__ */ h(S, {
|
|
154
|
+
...i,
|
|
155
|
+
ref: (e) => {
|
|
156
|
+
e && (c = !0);
|
|
157
|
+
},
|
|
158
|
+
open: s,
|
|
159
|
+
onChange: () => f.close(),
|
|
160
|
+
onAfterClose: u,
|
|
161
|
+
children: t
|
|
162
|
+
}));
|
|
163
|
+
}, f = { close: () => {
|
|
164
|
+
if (!(!s || l)) {
|
|
165
|
+
s = !1, C.delete(f);
|
|
166
|
+
try {
|
|
167
|
+
n?.();
|
|
168
|
+
} finally {
|
|
169
|
+
c ? d() : u();
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
} };
|
|
173
|
+
return C.add(f), d(), f;
|
|
174
|
+
}, T = Object.assign(S, {
|
|
175
|
+
open: w,
|
|
176
|
+
info: (e) => w({
|
|
177
|
+
...e,
|
|
178
|
+
status: "info"
|
|
179
|
+
}),
|
|
180
|
+
success: (e) => w({
|
|
181
|
+
...e,
|
|
182
|
+
status: "success"
|
|
183
|
+
}),
|
|
184
|
+
warning: (e) => w({
|
|
185
|
+
...e,
|
|
186
|
+
status: "warning"
|
|
187
|
+
}),
|
|
188
|
+
error: (e) => w({
|
|
189
|
+
...e,
|
|
190
|
+
status: "error"
|
|
191
|
+
}),
|
|
192
|
+
closeAll: () => {
|
|
193
|
+
[...C].forEach((e) => e.close());
|
|
194
|
+
}
|
|
195
|
+
});
|
|
196
|
+
//#endregion
|
|
197
|
+
export { T as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./icon-DRLyKu8p.cjs"),t=require("./effect-BpNxm_06.cjs"),n=require("./state-BuUx1onZ.cjs"),r=require("./Transition-X_89ga-e.cjs");let i=require("lucide-react"),a=require("react"),o=require("react/jsx-runtime"),s=require("react-dom"),c=require("react-dom/client");var l=new Map,u=e=>{let t=l.get(e);if(!t||!document.body.contains(t.element)){let n=document.createElement(`div`);n.className=`vl-notification-host is-${e}`,document.body.appendChild(n),t={element:n,users:0},l.set(e,t)}t.users+=1;let n=t;return{element:n.element,release:()=>{--n.users,!(n.users>0)&&(n.element.remove(),l.get(e)===n&&l.delete(e))}}},d={info:i.Info,success:i.CircleCheck,warning:i.CircleAlert,error:i.CircleX},f=(0,a.forwardRef)((c,l)=>{let{open:f,defaultOpen:p=!1,title:m,status:h=`info`,icon:g,placement:_=`top-right`,duration:v=4500,closable:y=!0,pauseOnHover:b=!0,pauseOnFocus:x=!0,closeOnPressEscape:S=!0,action:C,onChange:w,onClose:T,onAfterClose:E,onMouseEnter:D,onMouseLeave:O,onFocusCapture:k,onBlurCapture:A,onKeyDown:j,role:M=h===`error`||h===`warning`?`alert`:`status`,className:N,children:P,...F}=c,[I,L]=n.n({value:!!f,defaultValue:p,controlled:n.t(c,`open`),onChange:w}),[R,z]=(0,a.useState)(null),[B,V]=(0,a.useState)(!1),[H,U]=(0,a.useState)(!1),[W,G]=(0,a.useState)(!0),K=(0,a.useRef)(v),q=(0,a.useRef)(!1),J=(0,a.useRef)({open:I,onClose:T});t.t(()=>{J.current={open:I,onClose:T}}),t.t(()=>{I&&(q.current=!1)},[I]);let Y=(0,a.useCallback)(()=>{!J.current.open||q.current||(q.current=!0,L(!1),J.current.onClose?.())},[L]);(0,a.useEffect)(()=>{let e=u(_);return z(e.element),e.release},[_]),(0,a.useEffect)(()=>{let e=()=>G(!document.hidden);return e(),document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[]),(0,a.useEffect)(()=>{K.current=v,I||(V(!1),U(!1))},[I,v]);let X=!W||b&&B||x&&H;if((0,a.useEffect)(()=>{if(!R||!I||v<=0||X)return;let e=Date.now(),t=window.setTimeout(Y,K.current);return()=>{window.clearTimeout(t),K.current=Math.max(0,K.current-(Date.now()-e))}},[R,I,v,X,Y]),!R)return null;let Z=g===void 0?d[h]:g,Q=m!=null&&m!==!1;return(0,s.createPortal)((0,o.jsx)(r.t,{show:I,name:`vl-notification-fade`,onAfterLeave:E,children:(0,o.jsxs)(`div`,{...F,ref:l,className:[`vl-notification`,`is-${h}`,Q?`has-title`:``,N||``].filter(Boolean).join(` `),role:M,"aria-atomic":F[`aria-atomic`]??!0,"aria-hidden":!I||F[`aria-hidden`]||void 0,onMouseEnter:e=>{V(!0),D?.(e)},onMouseLeave:e=>{V(!1),O?.(e)},onFocusCapture:e=>{U(!0),k?.(e)},onBlurCapture:e=>{e.currentTarget.contains(e.relatedTarget)||U(!1),A?.(e)},onKeyDown:e=>{j?.(e),!(e.defaultPrevented||e.key!==`Escape`||!S)&&(e.stopPropagation(),Y())},children:[Z?e.t(Z,`vl-notification__icon`):null,(0,o.jsxs)(`div`,{className:`vl-notification__body`,children:[Q?(0,o.jsx)(`div`,{className:`vl-notification__title`,children:m}):null,P===void 0?null:(0,o.jsx)(`div`,{className:`vl-notification__content`,children:P}),C?(0,o.jsx)(`div`,{className:`vl-notification__action`,children:C}):null]}),y?(0,o.jsx)(`button`,{type:`button`,className:`vl-notification__close`,"aria-label":`关闭通知`,title:`关闭通知`,disabled:!I,onClick:Y,children:(0,o.jsx)(i.X,{"aria-hidden":`true`})}):null]})}),R)});f.displayName=`VlNotification`;var p=new Set,m=e=>{if(typeof document>`u`)throw Error(`VlNotification imperative APIs are only available in a browser environment.`);let{content:t,onClose:n,onAfterClose:r,...i}=e,a=document.createElement(`div`);a.className=`vl-notification-container`,document.body.appendChild(a);let s=(0,c.createRoot)(a),l=!0,u=!1,d=!1,m=()=>{d||(d=!0,p.delete(g),queueMicrotask(()=>{s.unmount(),a.remove(),r?.()}))},h=()=>{s.render((0,o.jsx)(f,{...i,ref:e=>{e&&(u=!0)},open:l,onChange:()=>g.close(),onAfterClose:m,children:t}))},g={close:()=>{if(!(!l||d)){l=!1,p.delete(g);try{n?.()}finally{u?h():m()}}}};return p.add(g),h(),g},h=Object.assign(f,{open:m,info:e=>m({...e,status:`info`}),success:e=>m({...e,status:`success`}),warning:e=>m({...e,status:`warning`}),error:e=>m({...e,status:`error`}),closeAll:()=>{[...p].forEach(e=>e.close())}});Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return h}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./icon-DRLyKu8p.cjs");let t=require("lucide-react"),n=require("react"),r=require("react/jsx-runtime");var i={sm:12,md:14,lg:16},a=(0,n.forwardRef)((n,a)=>{let{status:o,size:s=`md`,icon:c,closable:l=!1,disabled:u=!1,tag:d=`span`,className:f,children:p,onClose:m,...h}=n,g=[`vl-tag`,o?`is-${o}`:``,s?`size-${s}`:``,u?`is-disabled`:``,f||``].filter(Boolean).join(` `),_=e=>{u||m?.(e)};return(0,r.jsxs)(d,{ref:a,className:g,...h,children:[e.t(c,`vl-tag__icon`),p==null?null:(0,r.jsx)(`span`,{className:`vl-tag__content`,children:p}),l?(0,r.jsx)(`button`,{type:`button`,className:`vl-tag__close`,disabled:u,"aria-label":typeof p==`string`?`移除 ${p}`:`移除标签`,onClick:e=>{e.stopPropagation(),_(e)},children:(0,r.jsx)(t.X,{size:i[s],"aria-hidden":`true`})}):null]})});a.displayName=`VlTag`;var o=a,s=a;Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return s}});
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { t as e } from "./icon-Cbvuv4yF.js";
|
|
2
|
+
import { X as t } from "lucide-react";
|
|
3
|
+
import { forwardRef as n } from "react";
|
|
4
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
5
|
+
//#region components/Tag/Tag.tsx
|
|
6
|
+
var a = {
|
|
7
|
+
sm: 12,
|
|
8
|
+
md: 14,
|
|
9
|
+
lg: 16
|
|
10
|
+
}, o = n((n, o) => {
|
|
11
|
+
let { status: s, size: c = "md", icon: l, closable: u = !1, disabled: d = !1, tag: f = "span", className: p, children: m, onClose: h, ...g } = n, _ = [
|
|
12
|
+
"vl-tag",
|
|
13
|
+
s ? `is-${s}` : "",
|
|
14
|
+
c ? `size-${c}` : "",
|
|
15
|
+
d ? "is-disabled" : "",
|
|
16
|
+
p || ""
|
|
17
|
+
].filter(Boolean).join(" "), v = (e) => {
|
|
18
|
+
d || h?.(e);
|
|
19
|
+
};
|
|
20
|
+
return /* @__PURE__ */ i(f, {
|
|
21
|
+
ref: o,
|
|
22
|
+
className: _,
|
|
23
|
+
...g,
|
|
24
|
+
children: [
|
|
25
|
+
e(l, "vl-tag__icon"),
|
|
26
|
+
m == null ? null : /* @__PURE__ */ r("span", {
|
|
27
|
+
className: "vl-tag__content",
|
|
28
|
+
children: m
|
|
29
|
+
}),
|
|
30
|
+
u ? /* @__PURE__ */ r("button", {
|
|
31
|
+
type: "button",
|
|
32
|
+
className: "vl-tag__close",
|
|
33
|
+
disabled: d,
|
|
34
|
+
"aria-label": typeof m == "string" ? `移除 ${m}` : "移除标签",
|
|
35
|
+
onClick: (e) => {
|
|
36
|
+
e.stopPropagation(), v(e);
|
|
37
|
+
},
|
|
38
|
+
children: /* @__PURE__ */ r(t, {
|
|
39
|
+
size: a[c],
|
|
40
|
+
"aria-hidden": "true"
|
|
41
|
+
})
|
|
42
|
+
}) : null
|
|
43
|
+
]
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
o.displayName = "VlTag";
|
|
47
|
+
//#endregion
|
|
48
|
+
//#region components/Tag/index.ts
|
|
49
|
+
var s = o, c = o;
|
|
50
|
+
//#endregion
|
|
51
|
+
export { s as n, c as t };
|
package/dist/cjs/MessageBox.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../MessageBox-
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../MessageBox-D7Ib1f7K.cjs");exports.VlMessageBox=e.t,exports.default=e.t;
|
package/dist/cjs/Modal.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../Modal-
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../Modal-DPxZEr2v.cjs");exports.VlModal=e.n,exports.default=e.t;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../Notification-D6m4qHKz.cjs");exports.VlNotification=e.t,exports.default=e.t;
|
package/dist/cjs/Tag.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../Tag-
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../Tag-4iZGcfrg.cjs");exports.VlTag=e.n,exports.default=e.t;
|
package/dist/cjs/global.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../registry-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../registry-DF1N2ITX.cjs");exports.globalComponents=e.t,exports.registerGlobalComponents=e.n;
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../Alert-tPSJmCXK.cjs"),t=require("../Anchor-CmuV1Ump.cjs"),n=require("../Announcement-D0hZE2sM.cjs"),r=require("../Button-qURrKHQ0.cjs"),i=require("../Card-BkZhLXQ5.cjs"),a=require("../Checkbox-CzNGP2tH.cjs"),o=require("../Col-qcq7T83y.cjs"),s=require("../Transition-X_89ga-e.cjs"),c=require("../Input-C9ESmbJ7.cjs"),l=require("../Tabs-BZ0Zc0bL.cjs"),u=require("../NumberInput-Dp1vTDkW.cjs"),d=require("../Cron-MhbYMEeJ.cjs"),f=require("../Dropdown-PHqXNiAZ.cjs"),p=require("../DatePicker-Bj709smn.cjs"),m=require("../DateTimePicker-ZSScsk-j.cjs"),h=require("../Divider-BnmUNmy2.cjs"),g=require("../Drawer-DcbgMkub.cjs"),_=require("../Empty-Dny96c3p.cjs"),v=require("../Form-BkyDHPEI.cjs"),y=require("../Tooltip-DDjGLjoV.cjs"),b=require("../Loading-C2pY-4fA.cjs"),x=require("../Scrollbar-CEQT6Ao_.cjs"),S=require("../Modal-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../Alert-tPSJmCXK.cjs"),t=require("../Anchor-CmuV1Ump.cjs"),n=require("../Announcement-D0hZE2sM.cjs"),r=require("../Button-qURrKHQ0.cjs"),i=require("../Card-BkZhLXQ5.cjs"),a=require("../Checkbox-CzNGP2tH.cjs"),o=require("../Col-qcq7T83y.cjs"),s=require("../Transition-X_89ga-e.cjs"),c=require("../Input-C9ESmbJ7.cjs"),l=require("../Tabs-BZ0Zc0bL.cjs"),u=require("../NumberInput-Dp1vTDkW.cjs"),d=require("../Cron-MhbYMEeJ.cjs"),f=require("../Dropdown-PHqXNiAZ.cjs"),p=require("../DatePicker-Bj709smn.cjs"),m=require("../DateTimePicker-ZSScsk-j.cjs"),h=require("../Divider-BnmUNmy2.cjs"),g=require("../Drawer-DcbgMkub.cjs"),_=require("../Empty-Dny96c3p.cjs"),v=require("../Form-BkyDHPEI.cjs"),y=require("../Tooltip-DDjGLjoV.cjs"),b=require("../Loading-C2pY-4fA.cjs"),x=require("../Scrollbar-CEQT6Ao_.cjs"),S=require("../Modal-DPxZEr2v.cjs"),C=require("../MessageBox-D7Ib1f7K.cjs"),w=require("../Notification-D6m4qHKz.cjs"),T=require("../Select-C6O0tmM_.cjs"),E=require("../Pagination-DatEegaF.cjs"),D=require("../Progress-DTAjlgwZ.cjs"),O=require("./Radio.cjs"),k=require("./Row.cjs"),A=require("../Sidebar-BPXVnP7y.cjs"),j=require("../Slider-CU9OS2HB.cjs"),M=require("../Space-DJGRG2rt.cjs"),N=require("../Switch-CpXDMcPW.cjs"),P=require("../Table-BNGO_7Rx.cjs"),F=require("../Tag-4iZGcfrg.cjs"),I=require("../Textarea-CEhAvE10.cjs"),L=require("../Timeline-ROggEQnD.cjs"),R=require("../TimePicker-DoGbwfkU.cjs"),z=require("../Upload-wHEEoe1c.cjs"),B=require("../registry-DF1N2ITX.cjs");exports.VlAlert=e.n,exports.VlAnchor=t.n,exports.VlAnnouncement=n.n,exports.VlButton=r.n,exports.VlButtonGroup=r.r,exports.VlCard=i.n,exports.VlCheckbox=a.n,exports.VlCheckboxGroup=a.r,exports.VlCol=o.n,exports.VlCron=d.n,exports.VlDatePicker=p.n,exports.VlDateTimePicker=m.n,exports.VlDivider=h.n,exports.VlDrawer=g.n,exports.VlDropdown=f.n,exports.VlEmpty=_.n,exports.VlForm=v.t,exports.VlFormItem=v.n,exports.VlInput=c.n,exports.VlLoading=b.n,exports.VlMessageBox=C.t,exports.VlModal=S.n,exports.VlNotification=w.t,exports.VlNumberInput=u.n,exports.VlPagination=E.n,exports.VlProgress=D.n,exports.VlRadio=O.VlRadio,exports.VlRadioGroup=O.VlRadioGroup,exports.VlRow=k.VlRow,exports.VlScrollbar=x.n,exports.VlSelect=T.n,exports.VlSidebar=A.n,exports.VlSlider=j.n,exports.VlSpace=M.n,exports.VlSwitch=N.n,exports.VlTable=P.n,exports.VlTabs=l.n,exports.VlTag=F.n,exports.VlTextarea=I.n,exports.VlTimePicker=R.n,exports.VlTimeline=L.n,exports.VlTooltip=y.n,exports.VlTransition=s.n,exports.VlUpload=z.n,exports.globalComponents=B.t,exports.registerGlobalComponents=B.n;
|
package/dist/cjs/register.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../registry-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../registry-DF1N2ITX.cjs");require("./global.cjs"),typeof window<`u`&&e.n(),exports.globalComponents=e.t,exports.registerGlobalComponents=e.n;
|
package/dist/css/MessageBox.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.vl-message-box{--vl-message-box-icon-color:var(--vl-color-info-text);font-size:var(--vl-font-size-md);line-height:var(--vl-line-height-normal)}.vl-message-box.is-success{--vl-message-box-icon-color:var(--vl-color-success-text)}.vl-message-box.is-warning{--vl-message-box-icon-color:var(--vl-color-warning-text)}.vl-message-box.is-error{--vl-message-box-icon-color:var(--vl-color-danger-text)}.vl-message-box .vl-modal__close:disabled{color:var(--vl-color-text-disabled);cursor:not-allowed;background:0 0}.vl-message-box__header{align-items:center;gap:var(--vl-space-3);min-width:0;display:flex}.vl-message-box__title{min-width:0;font-size:var(--vl-font-size-lg);font-weight:var(--vl-font-weight-semibold);line-height:var(--vl-line-height-tight);white-space:nowrap;text-overflow:ellipsis;flex:1;overflow:hidden}.vl-message-box__content{align-items:flex-start;gap:var(--vl-space-3);min-width:0;display:flex}.vl-message-box__icon{width:24px;height:24px;color:var(--vl-message-box-icon-color);flex:none}.vl-message-box__message{min-width:0;color:var(--vl-color-text-secondary);overflow-wrap:anywhere;flex:1}.vl-message-box__actions{justify-content:flex-end;gap:var(--vl-space-2);width:100%;display:flex}@media (width<=480px){.vl-message-box__actions{flex-wrap:wrap}.vl-message-box__actions .vl-button{flex:120px;align-self:stretch}}
|
|
1
|
+
.vl-message-box{--vl-message-box-icon-color:var(--vl-color-info-text);font-size:var(--vl-font-size-md);line-height:var(--vl-line-height-normal)}.vl-message-box.is-success{--vl-message-box-icon-color:var(--vl-color-success-text)}.vl-message-box.is-warning{--vl-message-box-icon-color:var(--vl-color-warning-text)}.vl-message-box.is-error{--vl-message-box-icon-color:var(--vl-color-danger-text)}.vl-message-box .vl-modal__close:disabled{color:var(--vl-color-text-disabled);cursor:not-allowed;background:0 0}.vl-message-box__header{align-items:center;gap:var(--vl-space-3);min-width:0;display:flex}.vl-message-box__title{min-width:0;font-size:var(--vl-font-size-lg);font-weight:var(--vl-font-weight-semibold);line-height:var(--vl-line-height-tight);white-space:nowrap;text-overflow:ellipsis;-webkit-user-select:text;user-select:text;cursor:text;flex:1;overflow:hidden}.vl-message-box__content{align-items:flex-start;gap:var(--vl-space-3);min-width:0;display:flex}.vl-message-box__icon{width:24px;height:24px;color:var(--vl-message-box-icon-color);flex:none}.vl-message-box__message{min-width:0;color:var(--vl-color-text-secondary);overflow-wrap:anywhere;flex:1}.vl-message-box__actions{justify-content:flex-end;gap:var(--vl-space-2);width:100%;display:flex}@media (width<=480px){.vl-message-box__actions{flex-wrap:wrap}.vl-message-box__actions .vl-button{flex:120px;align-self:stretch}}
|
package/dist/css/Modal.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{--vl-modal-mask-bg:var(--vl-color-bg-mask);--vl-modal-border:var(--vl-overlay-border);--vl-modal-content-bg:var(--vl-overlay-bg);--vl-modal-shadow:var(--vl-overlay-shadow);--vl-modal-control-bg:var(--vl-color-bg-surface);--vl-modal-control-border:var(--vl-color-border);--vl-modal-control-border-hover:var(--vl-color-border-dark);--vl-modal-control-border-focus:var(--vl-color-brand-primary-text);--vl-modal-action-bg:var(--vl-color-bg-surface);--vl-modal-action-border:var(--vl-color-border);--vl-modal-action-hover-bg:var(--vl-color-bg-hover);--vl-modal-action-hover-border:var(--vl-color-border-dark);--vl-modal-close-hover-bg:var(--vl-color-bg-hover)}:root[data-theme=dark]{--vl-modal-mask-bg:var(--vl-color-bg-mask);--vl-modal-border:var(--vl-overlay-border);--vl-modal-content-bg:var(--vl-color-bg-elevated);--vl-modal-shadow:var(--vl-overlay-shadow);--vl-modal-control-bg:var(--vl-color-bg-surface);--vl-modal-control-border:var(--vl-color-border);--vl-modal-control-border-hover:var(--vl-color-border-dark);--vl-modal-control-border-focus:var(--vl-color-brand-primary-text);--vl-modal-action-bg:var(--vl-color-bg-surface);--vl-modal-action-border:var(--vl-color-border);--vl-modal-action-hover-bg:var(--vl-color-bg-hover);--vl-modal-action-hover-border:var(--vl-color-border-dark);--vl-modal-close-hover-bg:var(--vl-color-bg-hover)}.vl-modal__mask{z-index:calc(var(--vl-z-modal) - 1);background:var(--vl-modal-mask-bg);-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);position:fixed;inset:0}.vl-modal{--vl-control-bg:var(--vl-modal-control-bg);--vl-control-hover-bg:var(--vl-modal-control-bg);--vl-control-border:var(--vl-modal-control-border);--vl-control-border-hover:var(--vl-modal-control-border-hover);--vl-control-border-focus:var(--vl-modal-control-border-focus);--vl-button-default-bg:var(--vl-modal-action-bg);--vl-button-default-border:var(--vl-modal-action-border);--vl-button-default-hover-bg:var(--vl-modal-action-hover-bg);--vl-button-default-hover-text:var(--vl-color-text-primary);--vl-button-default-hover-border:var(--vl-modal-action-hover-border);background-color:var(--vl-modal-content-bg);border:1px solid var(--vl-modal-border);border-radius:var(--vl-radius-lg);box-shadow:var(--vl-modal-shadow);z-index:var(--vl-z-modal);max-width:min(720px,100vw - 32px);max-height:min(80vh,680px);color:var(--vl-color-text-primary);font-size:var(--vl-font-size-md);line-height:var(--vl-line-height-normal);border-style:solid;border-width:1px;border-color:var(--vl-modal-border);outline:none;flex-direction:column;display:flex;position:fixed;overflow:hidden}.vl-modal:focus-visible{border-color:var(--vl-color-brand-primary-text)}.vl-modal.is-dragging{cursor:grabbing}.vl-modal.is-fullscreen{border-radius:0;width:100vw;max-width:100vw;height:100vh;max-height:100vh}.vl-modal__header{padding:var(--vl-space-3) var(--vl-space-4);-webkit-user-select:none;user-select:none}.vl-
|
|
1
|
+
:root{--vl-modal-mask-bg:var(--vl-color-bg-mask);--vl-modal-border:var(--vl-overlay-border);--vl-modal-content-bg:var(--vl-overlay-bg);--vl-modal-shadow:var(--vl-overlay-shadow);--vl-modal-control-bg:var(--vl-color-bg-surface);--vl-modal-control-border:var(--vl-color-border);--vl-modal-control-border-hover:var(--vl-color-border-dark);--vl-modal-control-border-focus:var(--vl-color-brand-primary-text);--vl-modal-action-bg:var(--vl-color-bg-surface);--vl-modal-action-border:var(--vl-color-border);--vl-modal-action-hover-bg:var(--vl-color-bg-hover);--vl-modal-action-hover-border:var(--vl-color-border-dark);--vl-modal-close-hover-bg:var(--vl-color-bg-hover)}:root[data-theme=dark]{--vl-modal-mask-bg:var(--vl-color-bg-mask);--vl-modal-border:var(--vl-overlay-border);--vl-modal-content-bg:var(--vl-color-bg-elevated);--vl-modal-shadow:var(--vl-overlay-shadow);--vl-modal-control-bg:var(--vl-color-bg-surface);--vl-modal-control-border:var(--vl-color-border);--vl-modal-control-border-hover:var(--vl-color-border-dark);--vl-modal-control-border-focus:var(--vl-color-brand-primary-text);--vl-modal-action-bg:var(--vl-color-bg-surface);--vl-modal-action-border:var(--vl-color-border);--vl-modal-action-hover-bg:var(--vl-color-bg-hover);--vl-modal-action-hover-border:var(--vl-color-border-dark);--vl-modal-close-hover-bg:var(--vl-color-bg-hover)}.vl-modal__mask{z-index:calc(var(--vl-z-modal) - 1);background:var(--vl-modal-mask-bg);-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);position:fixed;inset:0}.vl-modal{--vl-control-bg:var(--vl-modal-control-bg);--vl-control-hover-bg:var(--vl-modal-control-bg);--vl-control-border:var(--vl-modal-control-border);--vl-control-border-hover:var(--vl-modal-control-border-hover);--vl-control-border-focus:var(--vl-modal-control-border-focus);--vl-button-default-bg:var(--vl-modal-action-bg);--vl-button-default-border:var(--vl-modal-action-border);--vl-button-default-hover-bg:var(--vl-modal-action-hover-bg);--vl-button-default-hover-text:var(--vl-color-text-primary);--vl-button-default-hover-border:var(--vl-modal-action-hover-border);background-color:var(--vl-modal-content-bg);border:1px solid var(--vl-modal-border);border-radius:var(--vl-radius-lg);box-shadow:var(--vl-modal-shadow);z-index:var(--vl-z-modal);max-width:min(720px,100vw - 32px);max-height:min(80vh,680px);color:var(--vl-color-text-primary);font-size:var(--vl-font-size-md);line-height:var(--vl-line-height-normal);border-style:solid;border-width:1px;border-color:var(--vl-modal-border);outline:none;flex-direction:column;display:flex;position:fixed;overflow:hidden}.vl-modal:focus-visible{border-color:var(--vl-color-brand-primary-text)}.vl-modal.is-dragging,.vl-modal.is-dragging .vl-modal__header,.vl-modal.is-dragging .vl-modal__title{cursor:grabbing}.vl-modal.is-fullscreen{border-radius:0;width:100vw;max-width:100vw;height:100vh;max-height:100vh}.vl-modal__header{padding:var(--vl-space-3) var(--vl-space-4)}.vl-modal__header.is-draggable{cursor:grab;-webkit-user-select:none;user-select:none}.vl-modal__headerInner{align-items:center;gap:var(--vl-space-3);display:flex}.vl-modal__headerMain{flex:1;min-width:0}.vl-modal__title{width:fit-content;max-width:100%;font-size:var(--vl-font-size-lg);font-weight:var(--vl-font-weight-semibold);line-height:var(--vl-line-height-tight);white-space:nowrap;text-overflow:ellipsis;-webkit-user-select:text;user-select:text;cursor:text;overflow:hidden}.vl-modal__close{appearance:none;color:var(--vl-color-text-secondary);border-radius:var(--vl-radius-sm);cursor:pointer;width:32px;height:32px;transition:color var(--vl-duration-fast) var(--vl-easing-ease), background-color var(--vl-duration-fast) var(--vl-easing-ease);background:0 0;border:0;outline:none;justify-content:center;align-items:center;display:inline-flex}.vl-modal__close:hover{color:var(--vl-color-text-primary);background-color:var(--vl-modal-close-hover-bg)}.vl-modal__close:active{color:var(--vl-color-text-secondary)}.vl-modal__close:focus-visible{background:var(--vl-color-bg-hover);color:var(--vl-color-text-primary)}.vl-modal__close svg{width:1.5em;height:1.5em}.vl-modal__body{flex:1;min-height:0}.vl-modal__body.vl-scrollbar{flex-direction:column;block-size:0;display:flex}.vl-modal__body .vl-scrollbar__viewport{min-height:0;block-size:auto;padding:var(--vl-space-4);flex:auto}.vl-modal.is-center .vl-modal__body{text-align:center}.vl-modal.is-center .vl-modal__footer{justify-content:center}.vl-modal__footer{padding:var(--vl-space-3) var(--vl-space-4);border-top:1px solid var(--vl-color-border);background-color:var(--vl-modal-content-bg);flex-shrink:0;justify-content:flex-end;display:flex}.vl-modal-mask-enter-active{transition:opacity var(--vl-duration-normal) var(--vl-easing-emphasized)}.vl-modal-mask-leave-active{transition:opacity var(--vl-duration-fast) var(--vl-easing-exit)}.vl-modal-mask-enter-from,.vl-modal-mask-leave-to{opacity:0}.vl-modal-mask-enter-to,.vl-modal-mask-leave-from{opacity:1}.vl-modal-enter-active{transition:opacity var(--vl-duration-fast) var(--vl-easing-standard), transform var(--vl-duration-normal) var(--vl-easing-emphasized);will-change:transform, opacity}.vl-modal-leave-active{transition:opacity var(--vl-duration-fast) var(--vl-easing-exit), transform var(--vl-duration-fast) var(--vl-easing-exit);will-change:transform, opacity}.vl-modal-enter-from{opacity:0;transform:translateY(6px)scale(.96)}.vl-modal-leave-to{opacity:0;transform:translateY(4px)scale(.98)}.vl-modal-enter-to,.vl-modal-leave-from{opacity:1;transform:translateY(0)scale(1)}.vl-modal.is-fullscreen.vl-modal-enter-from{transform:translateY(8px)}.vl-modal.is-fullscreen.vl-modal-leave-to{transform:translateY(4px)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.vl-notification-host{--vl-notification-enter-x:24px;z-index:var(--vl-z-toast);gap:var(--vl-space-3);box-sizing:border-box;width:384px;max-width:100%;max-height:100dvh;padding:var(--vl-space-4);pointer-events:none;flex-direction:column;display:flex;position:fixed;overflow:hidden auto}.vl-notification-host:empty{display:none}.vl-notification-host.is-top-right,.vl-notification-host.is-top-left{top:0}.vl-notification-host.is-bottom-right,.vl-notification-host.is-bottom-left{flex-direction:column-reverse;bottom:0}.vl-notification-host.is-top-right,.vl-notification-host.is-bottom-right{right:0}.vl-notification-host.is-top-left,.vl-notification-host.is-bottom-left{--vl-notification-enter-x:-24px;left:0}.vl-notification{background-color:var(--vl-color-bg-surface);border:1px solid var(--vl-color-border-light);border-radius:var(--vl-radius-md);box-shadow:var(--vl-shadow-md);--vl-notification-accent:var(--vl-color-info-text);align-items:flex-start;gap:var(--vl-space-3);box-sizing:border-box;width:100%;min-width:0;padding:var(--vl-space-4);color:var(--vl-color-text-primary);font-size:var(--vl-font-size-md);line-height:var(--vl-line-height-normal);overflow-wrap:anywhere;pointer-events:auto;flex:none;display:flex;position:relative}.vl-notification.is-success{--vl-notification-accent:var(--vl-color-success-text)}.vl-notification.is-warning{--vl-notification-accent:var(--vl-color-warning-text)}.vl-notification.is-error{--vl-notification-accent:var(--vl-color-danger-text)}.vl-notification__icon{width:20px;height:20px;color:var(--vl-notification-accent);flex:none;margin-top:1px}.vl-notification__body{flex:auto;min-width:0}.vl-notification__title{font-weight:var(--vl-font-weight-semibold)}.vl-notification__title+.vl-notification__content{margin-top:var(--vl-space-1)}.vl-notification__content{color:var(--vl-color-text-secondary)}.vl-notification__action{gap:var(--vl-space-2);margin-top:var(--vl-space-3);flex-wrap:wrap;display:flex}.vl-notification__close{border-radius:var(--vl-radius-sm);width:28px;height:28px;color:var(--vl-color-text-secondary);cursor:pointer;background:0 0;border:0;outline:none;flex:none;justify-content:center;align-items:center;margin:-3px -4px 0 0;padding:0;display:inline-flex}.vl-notification__close:hover,.vl-notification__close:focus-visible{background:var(--vl-color-bg-hover);color:var(--vl-color-text-primary)}.vl-notification__close svg{width:16px;height:16px}.vl-notification-fade-enter-active,.vl-notification-fade-leave-active{transition:opacity var(--vl-duration-medium) var(--vl-easing-standard), transform var(--vl-duration-medium) var(--vl-easing-emphasized)}.vl-notification-fade-enter-from,.vl-notification-fade-leave-to{opacity:0;transform:translateX(var(--vl-notification-enter-x))}@media (prefers-reduced-motion:reduce){.vl-notification-fade-enter-active,.vl-notification-fade-leave-active{transition:none}.vl-notification-fade-enter-from,.vl-notification-fade-leave-to{transform:none}}
|