veza/apps/web/dist_verification/assets/useIsRateLimited-HpmSVPdB.js

2 lines
3.3 KiB
JavaScript
Raw Normal View History

import{a as s,j as r}from"./vendor-react-BHG7lGYR.js";import{d,z as x}from"./index-BWcMVITa.js";import{D as w}from"./dropdown-BYn_8IId.js";import{l as h,au as b}from"./vendor-icons-DaGlTw4_.js";const C=({open:o,onOpenChange:e,children:t})=>{const[n,a]=s.useState(!1),m=o!==void 0,p=l=>{m||a(l),e?.(l)},i=s.Children.toArray(t).find(l=>s.isValidElement(l)&&l.type===c),u=s.Children.toArray(t).find(l=>s.isValidElement(l)&&l.type===f);return!i||!u?r.jsx(r.Fragment,{children:t}):r.jsx(w,{trigger:i,onOpenChange:p,children:s.isValidElement(u)?u.props.children:u})},c=s.forwardRef(({className:o,children:e,asChild:t,...n},a)=>t&&s.isValidElement(e)?s.cloneElement(e,{ref:a,className:d(o,e.props.className),...n}):r.jsx("button",{ref:a,className:d("outline-none",o),...n,children:e}));c.displayName="DropdownMenuTrigger";const f=s.forwardRef(({className:o,align:e="start",sideOffset:t=4,children:n,...a},m)=>r.jsx("div",{ref:m,className:d("z-50 min-w-[8rem] overflow-hidden rounded-md border border-kodo-steel bg-kodo-ink p-1 text-white shadow-lg","animate-fadeIn",o),style:{marginTop:`${t}px`},...a,children:n}));f.displayName="DropdownMenuContent";const y=s.forwardRef(({className:o,inset:e,onKeyDown:t,onClick:n,...a},m)=>{const p=i=>{(i.key==="Enter"||i.key===" ")&&(i.preventDefault(),n&&!a.disabled&&n(i)),t&&t(i)};return r.jsx("button",{ref:m,role:"menuitem",className:d("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none","transition-colors focus:bg-white/5 focus:text-white disabled:pointer-events-none disabled:opacity-50","text-kodo-text-main hover:text-white w-full text-left",e&&"pl-8",o),onKeyDown:p,onClick:n,...a})});y.displayName="DropdownMenuItem";const D=s.forwardRef(({className:o,children:e,checked:t,onCheckedChange:n,...a},m)=>r.jsxs("button",{ref:m,onClick:()=>n?.(!t),className:d("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none","transition-colors focus:bg-white/5 focus:text-white disabled:pointer-events-none disabled:opacity-50","text-kodo-text-main hover:text-white w-full text-left",o),...a,children:[r.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t&&r.jsx(h,{className:"h-4 w-4 text-kodo-steel"})}),e]}));D.displayName="DropdownMenuCheckboxItem";const N=s.forwardRef(({className:o,children:e,checked:t,...n},a)=>r.jsxs("button",{ref:a,className:d("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none","transition-colors focus:bg-white/5 focus:text-white disabled:pointer-events-none disabled:opacity-50","text-kodo-text-main hover:text-white w-full text-left",o),...n,children:[r.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t&&r.jsx(b,{className:"h-2 w-2 fill-current text-kodo-steel"})}),e]}));N.displayName="DropdownMenuRadioItem";const g=s.forwardRef(({className:o,inset:e,...t},n)=>r.jsx("div",{ref:n,className:d("px-2 py-1.5 text-sm font-semibold text-kodo-content-dim",e&&"pl-8",o),...t}));g.displayName="DropdownMenuLabel";const j=s.forwardRef(({className:o,...e},t)=>r.jsx("div",{ref:t,className:d("-mx-1 my-1 h-px bg-kodo-steel",o),...e}));j.displayName="DropdownMenuSeparator";function I(){return x(e=>e.isLimited)}export{C as D,c as a,f as b,y as c,I as u};