@tapflowio/relay 0.14.0 → 0.16.0
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/api/builds.d.ts +35 -0
- package/dist/api/builds.d.ts.map +1 -1
- package/dist/api/builds.js +62 -30
- package/dist/api/builds.js.map +1 -1
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +18 -4
- package/dist/lib/config.js.map +1 -1
- package/dist/lib/dataDir.d.ts +8 -0
- package/dist/lib/dataDir.d.ts.map +1 -0
- package/dist/lib/dataDir.js +18 -0
- package/dist/lib/dataDir.js.map +1 -0
- package/package.json +4 -4
- package/public/assets/{AppCenter-DbFf7BKA.js → AppCenter-DHKav0MA.js} +2 -2
- package/public/assets/AppCenter-DHKav0MA.js.br +0 -0
- package/public/assets/Default-FOVo8D6L.js +1 -0
- package/public/assets/Default-FOVo8D6L.js.br +0 -0
- package/public/assets/Invite-DdjwJ4DV.js +1 -0
- package/public/assets/Invite-DdjwJ4DV.js.br +0 -0
- package/public/assets/{MacResources-D-j1pG9s.js → MacResources-Dl1w6E1h.js} +2 -2
- package/public/assets/MacResources-Dl1w6E1h.js.br +0 -0
- package/public/assets/{NotFound-BwAREUV8.js → NotFound-BMUavI-G.js} +1 -1
- package/public/assets/NotFound-BMUavI-G.js.br +0 -0
- package/public/assets/{QASession-Du5LOUTZ.js → QASession-BzfWUo9F.js} +6 -6
- package/public/assets/QASession-BzfWUo9F.js.br +0 -0
- package/public/assets/{ResetPassword-C6cya_7-.js → ResetPassword-Yn2hnB_M.js} +1 -1
- package/public/assets/ResetPassword-Yn2hnB_M.js.br +0 -0
- package/public/assets/{Setup-DHS2ZvMu.js → Setup-BaGV0xx6.js} +1 -1
- package/public/assets/Setup-BaGV0xx6.js.br +0 -0
- package/public/assets/{Team-DkIXb37o.js → Team-BOwoos5_.js} +2 -2
- package/public/assets/Team-BOwoos5_.js.br +0 -0
- package/public/assets/Tokens-Bu1FtE_n.js +1 -0
- package/public/assets/Tokens-Bu1FtE_n.js.br +0 -0
- package/public/assets/{alert-dialog-CPQLr1ij.js → alert-dialog-dsCcQ1NM.js} +1 -1
- package/public/assets/alert-dialog-dsCcQ1NM.js.br +0 -0
- package/public/assets/{badge-B63ynAZJ.js → badge-CNtq_oBK.js} +1 -1
- package/public/assets/badge-CNtq_oBK.js.br +0 -0
- package/public/assets/{build-format-CcGvUI_j.js → build-format-D6egYX-U.js} +1 -1
- package/public/assets/build-format-D6egYX-U.js.br +0 -0
- package/public/assets/dialog-Blqnc3tq.js +11 -0
- package/public/assets/dialog-Blqnc3tq.js.br +0 -0
- package/public/assets/index-IvDXNTVd.js +274 -0
- package/public/assets/index-IvDXNTVd.js.br +0 -0
- package/public/assets/{pencil-BAhJ8VF-.js → pencil-CzKUUBmE.js} +1 -1
- package/public/assets/pencil-CzKUUBmE.js.br +0 -0
- package/public/assets/{table-IfQacRqI.js → table-CU0HMyju.js} +1 -1
- package/public/assets/table-CU0HMyju.js.br +0 -0
- package/public/assets/tabs-C9nZOMC5.js +1 -0
- package/public/assets/tabs-C9nZOMC5.js.br +0 -0
- package/public/assets/{trash-2-Bfw6hch4.js → trash-2-Bw_edyHa.js} +1 -1
- package/public/assets/trash-2-Bw_edyHa.js.br +0 -0
- package/public/index.html +1 -1
- package/public/index.html.br +0 -0
- package/public/assets/AppCenter-DbFf7BKA.js.br +0 -0
- package/public/assets/Default-BXiTKHz2.js +0 -1
- package/public/assets/Default-BXiTKHz2.js.br +0 -0
- package/public/assets/Invite-Dw4wdx9j.js +0 -1
- package/public/assets/Invite-Dw4wdx9j.js.br +0 -0
- package/public/assets/MacResources-D-j1pG9s.js.br +0 -0
- package/public/assets/NotFound-BwAREUV8.js.br +0 -2
- package/public/assets/QASession-Du5LOUTZ.js.br +0 -0
- package/public/assets/ResetPassword-C6cya_7-.js.br +0 -0
- package/public/assets/Setup-DHS2ZvMu.js.br +0 -0
- package/public/assets/Team-DkIXb37o.js.br +0 -0
- package/public/assets/Tokens-DxZUmUPI.js +0 -1
- package/public/assets/Tokens-DxZUmUPI.js.br +0 -0
- package/public/assets/alert-dialog-CPQLr1ij.js.br +0 -0
- package/public/assets/badge-B63ynAZJ.js.br +0 -0
- package/public/assets/build-format-CcGvUI_j.js.br +0 -0
- package/public/assets/dialog-CEEdc-Oq.js +0 -11
- package/public/assets/dialog-CEEdc-Oq.js.br +0 -0
- package/public/assets/index-D8ViYmeP.js +0 -274
- package/public/assets/index-D8ViYmeP.js.br +0 -0
- package/public/assets/pencil-BAhJ8VF-.js.br +0 -0
- package/public/assets/table-IfQacRqI.js.br +0 -0
- package/public/assets/tabs-DKQ2XF1o.js +0 -1
- package/public/assets/tabs-DKQ2XF1o.js.br +0 -0
- package/public/assets/trash-2-Bfw6hch4.js.br +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{Y as _,a7 as
|
|
1
|
+
import{Y as _,a7 as n,ai as z,aa as J,a4 as e,B as t,L as D,I as q,i as G,C as U,d as Y,e as K,b as W,a9 as j,a5 as I,a8 as u,H as X}from"./index-IvDXNTVd.js";import{D as Z,f as ee,a as se,d as ae,e as ie,S as N,i as w,j as T,g as k,h as i}from"./dialog-Blqnc3tq.js";import{A as ne,c as te,f as le,g as re,d as ce,e as oe,b as de,a as me}from"./alert-dialog-dsCcQ1NM.js";import{T as he,d as xe,e as A,c as l,a as je,b as r}from"./table-CU0HMyju.js";/**
|
|
2
2
|
* @license lucide-react v0.577.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
5
5
|
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const ue=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]],ve=_("user-plus",ue),pe=I({email:u().email(),role:u().min(1)}),ge=I({token:u(),emailSent:X()});function Ce(){const[v,R]=
|
|
6
|
+
*/const ue=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]],ve=_("user-plus",ue),pe=I({email:u().email(),role:u().min(1)}),ge=I({token:u(),emailSent:X()});function Ce(){const[v,R]=n.useState([]),[E,p]=n.useState({}),[g,f]=n.useState(""),[H,b]=n.useState(!1),[o,d]=n.useState(null),{register:O,handleSubmit:V,control:L,reset:P,formState:{errors:S,isSubmitting:y}}=z({resolver:J(pe),mode:"onBlur",defaultValues:{email:"",role:"QA"}});function m(){fetch("/api/v1/team/members",{credentials:"include"}).then(s=>s.json()).then(R)}n.useEffect(()=>{m()},[]);async function $(s){try{const a=await fetch("/api/v1/team/invite",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:s.email,role:s.role})});if(!a.ok)throw new Error(`Server error: ${a.status}`);const h=ge.parse(await a.json()),c=`${location.origin}/invite?token=${h.token}`;f(c),navigator.clipboard.writeText(c).catch(()=>{}),h.emailSent?j.success(`Invite email sent to ${s.email}`):j.warning("Invite link copied — email could not be sent. Check your SMTP settings.")}catch{j.error("Failed to create invite link")}}function F(s){b(s),s||(f(""),P())}async function M(s,a){await fetch(`/api/v1/team/members/${s}`,{method:"PATCH",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({role:a})}),m()}async function Q(s){const c=(await(await fetch(`/api/v1/team/members/${s}/send-reset`,{method:"POST",credentials:"include"})).json()).emailSent?"Sent":"No SMTP";p(x=>({...x,[s]:c})),setTimeout(()=>p(x=>{const C={...x};return delete C[s],C}),3e3)}async function B(s){await fetch(`/api/v1/team/members/${s}`,{method:"DELETE",credentials:"include"}),d(null),m()}return e.jsxs("div",{className:"flex flex-col gap-6 max-w-[900px] mx-auto w-full p-6",children:[e.jsx(ne,{open:o!==null,onOpenChange:s=>{s||d(null)},children:e.jsxs(te,{children:[e.jsxs(le,{children:[e.jsx(re,{children:"Remove this member?"}),e.jsx(ce,{children:"This member will lose access to the team immediately."})]}),e.jsxs(oe,{children:[e.jsx(de,{children:"Cancel"}),e.jsx(me,{className:"bg-destructive/10 text-destructive hover:bg-destructive/20 border-0",onClick:()=>o!==null&&B(o),children:"Remove"})]})]})}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h1",{className:"text-xl font-semibold",children:"Team"}),e.jsxs(Z,{open:H,onOpenChange:F,children:[e.jsx(ee,{asChild:!0,children:e.jsxs(t,{size:"sm",children:[e.jsx(ve,{className:"mr-2 h-4 w-4"}),"Invite member"]})}),e.jsxs(se,{className:"sm:max-w-md",children:[e.jsx(ae,{children:e.jsx(ie,{children:"Invite team member"})}),g?e.jsxs("div",{className:"flex flex-col gap-3 pt-2",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Invite link copied to clipboard:"}),e.jsx("code",{className:"rounded bg-muted px-3 py-2 text-xs break-all",children:g}),e.jsx(t,{onClick:()=>b(!1),children:"Done"})]}):e.jsxs("form",{onSubmit:V($),className:"flex flex-col gap-4 pt-2",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(D,{htmlFor:"invite-email",children:"Email"}),e.jsx(q,{id:"invite-email",type:"email",...O("email")}),S.email&&e.jsx("p",{className:"text-sm text-destructive",children:S.email.message})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(D,{htmlFor:"invite-role",children:"Role"}),e.jsx(G,{name:"role",control:L,render:({field:s})=>e.jsxs(N,{value:s.value,onValueChange:s.onChange,children:[e.jsx(w,{id:"invite-role",children:e.jsx(T,{})}),e.jsxs(k,{children:[e.jsx(i,{value:"Admin",children:"Admin"}),e.jsx(i,{value:"Developer",children:"Developer"}),e.jsx(i,{value:"QA",children:"QA"}),e.jsx(i,{value:"Viewer",children:"Viewer"})]})]})})]}),e.jsx(t,{type:"submit",disabled:y,children:y?"Creating link…":"Generate invite link"})]})]})]})]}),e.jsxs(U,{children:[e.jsx(Y,{children:e.jsxs(K,{children:["Members (",v.length,")"]})}),e.jsx(W,{className:"px-4 pt-0 pb-2",children:e.jsxs(he,{children:[e.jsx(xe,{children:e.jsxs(A,{children:[e.jsx(l,{children:"Nickname"}),e.jsx(l,{children:"Email"}),e.jsx(l,{children:"Role"}),e.jsx(l,{children:"Joined"}),e.jsx(l,{className:"w-10"})]})}),e.jsx(je,{children:v.map(s=>e.jsxs(A,{className:"hover:bg-transparent",children:[e.jsx(r,{className:"font-medium",children:s.display_name||"—"}),e.jsx(r,{className:"text-muted-foreground text-sm",children:s.email}),e.jsx(r,{children:e.jsxs(N,{value:s.role,onValueChange:a=>M(s.id,a),children:[e.jsx(w,{className:"h-7 w-28",children:e.jsx(T,{})}),e.jsxs(k,{children:[e.jsx(i,{value:"Admin",children:"Admin"}),e.jsx(i,{value:"Developer",children:"Developer"}),e.jsx(i,{value:"QA",children:"QA"}),e.jsx(i,{value:"Viewer",children:"Viewer"})]})]})}),e.jsx(r,{className:"text-muted-foreground text-sm",children:new Date(s.joined_at).toLocaleDateString()}),e.jsx(r,{children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(t,{variant:"secondary",size:"nav",onClick:()=>Q(s.id),children:E[s.id]??"Reset pwd"}),e.jsx(t,{variant:"destructive",size:"nav",onClick:()=>d(s.id),children:"Remove"})]})})]},s.id))})]})})]})]})}export{Ce as TeamSettings};
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a7 as n,ai as $,aa as H,a4 as e,B as d,a9 as t,L as k,I as S,C as O,d as z,e as V,c as W,b as M,a5 as J,a8 as A}from"./index-IvDXNTVd.js";import{B as I}from"./badge-CNtq_oBK.js";import{A as U,c as q,f as G,g as K,d as Q,e as X,b as Y}from"./alert-dialog-dsCcQ1NM.js";import{D as Z,f as ee,a as se,d as te,e as ae,S as ne,i as re,j as oe,g as ie,h as B}from"./dialog-Blqnc3tq.js";import{T as le,d as ce,e as w,c as x,a as de,b as i}from"./table-CU0HMyju.js";import{P as xe,T as he}from"./trash-2-Bw_edyHa.js";async function me(){const a=window.location.protocol==="https:"?"wss":"ws";if(["localhost","127.0.0.1","[::1]"].includes(window.location.hostname))try{const h=await fetch("/api/v1/relay/host",{credentials:"include"});if(h.ok){const{lanHost:l,port:o}=await h.json();if(l)return`${a}://${l}:${o}`}}catch{}return`${a}://${window.location.host}`}const pe=J({name:A().min(1),expiresDays:A().refine(a=>{const r=parseInt(a,10);return!isNaN(r)&&r>=1&&r<=365},{message:"Must be between 1 and 365"})});function ye(){const[a,r]=n.useState([]),[h,l]=n.useState(!1),[o,y]=n.useState(""),[c,v]=n.useState("api"),[N,b]=n.useState(""),[u,j]=n.useState(null),{register:T,handleSubmit:E,reset:_,formState:{errors:m,isSubmitting:C}}=$({resolver:H(pe),mode:"onBlur",defaultValues:{name:"",expiresDays:"30"}});function g(){fetch("/api/v1/tokens",{credentials:"include"}).then(s=>s.json()).then(r)}n.useEffect(()=>{g()},[]);async function F(s){try{const p=await fetch("/api/v1/tokens",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:s.name,expires_in_days:parseInt(s.expiresDays,10),...c==="agent"?{scope:"agent"}:{}})});if(!p.ok){const f=await p.json().catch(()=>null);t.error((f==null?void 0:f.error)??"Failed to create token");return}const P=await p.json();c==="agent"&&b(await me()),t.success("Token created"),y(P.token),g()}catch{t.error("Network error")}}function R(s){l(s),s||(y(""),v("api"),b(""),_())}async function L(s){try{return(await fetch(`/api/v1/tokens/${s}`,{method:"DELETE",credentials:"include"})).ok?(t.success("Token revoked"),g(),!0):(t.error("Failed to revoke token"),!1)}catch{return t.error("Network error"),!1}}function D(s){return s.expires_at&&new Date(s.expires_at)<new Date}return e.jsxs("div",{className:"flex flex-col gap-6 max-w-[900px] mx-auto w-full p-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h1",{className:"text-xl font-semibold",children:"Personal Access Tokens"}),e.jsxs(Z,{open:h,onOpenChange:R,children:[e.jsx(ee,{asChild:!0,children:e.jsxs(d,{size:"sm",children:[e.jsx(xe,{className:"mr-2 h-4 w-4"}),"New token"]})}),e.jsxs(se,{className:"sm:max-w-md",children:[e.jsx(te,{children:e.jsx(ae,{children:"Create token"})}),o?e.jsxs("div",{className:"flex flex-col gap-3 pt-2",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Copy this token now — it won't be shown again."}),e.jsx("code",{className:"rounded bg-muted px-3 py-2 text-xs break-all font-mono",children:o}),c==="agent"&&N&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Run this on the agent Mac to connect it to this relay:"}),e.jsx("code",{className:"rounded bg-muted px-3 py-2 text-xs break-all font-mono",children:`tapflow agent start --relay ${N} --token ${o}`})]}),e.jsx(d,{onClick:()=>{navigator.clipboard.writeText(o).then(()=>{t.success("Token copied to clipboard"),l(!1)}).catch(()=>t.error("Failed to copy — copy manually"))},children:"Copy & close"})]}):e.jsxs("form",{onSubmit:E(F),className:"flex flex-col gap-4 pt-2",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(k,{htmlFor:"token-name",children:"Name"}),e.jsx(S,{id:"token-name",placeholder:"e.g. ci-deploy",...T("name")}),m.name&&e.jsx("p",{className:"text-sm text-destructive",children:m.name.message})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(k,{htmlFor:"expires",children:"Expires in (days)"}),e.jsx(S,{id:"expires",type:"number",...T("expiresDays")}),m.expiresDays&&e.jsx("p",{className:"text-sm text-destructive",children:m.expiresDays.message})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(k,{htmlFor:"token-type",children:"Type"}),e.jsxs(ne,{value:c,onValueChange:s=>v(s),children:[e.jsx(re,{id:"token-type",children:e.jsx(oe,{})}),e.jsxs(ie,{children:[e.jsx(B,{value:"api",children:"API — CI uploads & API access"}),e.jsx(B,{value:"agent",children:"Agent — connect remote device agents (Admin only)"})]})]})]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Scope: ",e.jsx(I,{variant:"secondary",children:c==="agent"?"agent":"view, builds:write"})]}),e.jsx(d,{type:"submit",disabled:C,children:C?"Creating…":"Create token"})]})]})]})]}),e.jsxs(O,{children:[e.jsxs(z,{children:[e.jsx(V,{children:"Active tokens"}),e.jsxs(W,{children:["Use these tokens with ",e.jsx("code",{className:"text-xs",children:"Authorization: Bearer <token>"})," for API deployments."]})]}),e.jsx(M,{className:"px-4 pt-0 pb-2",children:e.jsxs(le,{children:[e.jsx(ce,{children:e.jsxs(w,{children:[e.jsx(x,{children:"Name"}),e.jsx(x,{children:"Scope"}),e.jsx(x,{children:"Last used"}),e.jsx(x,{children:"Expires"}),e.jsx(x,{className:"w-10"})]})}),e.jsx(de,{children:a.length===0?e.jsx(w,{children:e.jsx(i,{colSpan:5,className:"h-20 text-center text-muted-foreground",children:"No tokens yet."})}):a.map(s=>e.jsxs(w,{className:"hover:bg-transparent",children:[e.jsx(i,{className:"font-medium",children:s.name}),e.jsx(i,{children:e.jsx(I,{variant:"secondary",children:s.scope})}),e.jsx(i,{className:"text-muted-foreground text-sm",children:s.last_used_at?new Date(s.last_used_at).toLocaleDateString():"Never"}),e.jsx(i,{children:s.expires_at?e.jsx("span",{className:D(s)?"text-destructive text-sm":"text-muted-foreground text-sm",children:D(s)?"Expired":new Date(s.expires_at).toLocaleDateString()}):e.jsx("span",{className:"text-muted-foreground text-sm",children:"Never"})}),e.jsx(i,{children:e.jsx(d,{variant:"destructive",size:"icon",className:"h-7 w-7","aria-label":"Revoke token",onClick:()=>j(s.id),children:e.jsx(he,{className:"h-4 w-4"})})})]},s.id))})]})})]}),e.jsx(U,{open:u!==null,onOpenChange:s=>{s||j(null)},children:e.jsxs(q,{children:[e.jsxs(G,{children:[e.jsx(K,{children:"Revoke token?"}),e.jsx(Q,{children:"Any active API calls using this token will immediately fail."})]}),e.jsxs(X,{children:[e.jsx(Y,{children:"Cancel"}),e.jsx(d,{variant:"destructive",onClick:async()=>{if(u===null)return;await L(u)&&j(null)},children:"Revoke"})]})]})})]})}export{ye as TokenSettings};
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a4 as o,D as F,a7 as r,p as L,W as D,n as k,ae as A,k as H,N as G,o as V,l as J,j as m,m as K,Q,K as n,J as u}from"./index-
|
|
1
|
+
import{a4 as o,D as F,a7 as r,p as L,W as D,n as k,ae as A,k as H,N as G,o as V,l as J,j as m,m as K,Q,K as n,J as u}from"./index-IvDXNTVd.js";var v="AlertDialog",[W]=Q(v,[D]),i=D(),N=e=>{const{__scopeAlertDialog:a,...t}=e,l=i(a);return o.jsx(F,{...l,...t,modal:!0})};N.displayName=v;var Y="AlertDialogTrigger",x=r.forwardRef((e,a)=>{const{__scopeAlertDialog:t,...l}=e,s=i(t);return o.jsx(L,{...s,...l,ref:a})});x.displayName=Y;var q="AlertDialogPortal",y=e=>{const{__scopeAlertDialog:a,...t}=e,l=i(a);return o.jsx(k,{...l,...t})};y.displayName=q;var B="AlertDialogOverlay",R=r.forwardRef((e,a)=>{const{__scopeAlertDialog:t,...l}=e,s=i(t);return o.jsx(K,{...s,...l,ref:a})});R.displayName=B;var _="AlertDialogContent",[U,X]=W(_),j=r.forwardRef((e,a)=>{const{__scopeAlertDialog:t,children:l,...s}=e,d=i(t),p=r.useRef(null),z=A(a,p),g=r.useRef(null);return o.jsx(U,{scope:t,cancelRef:g,children:o.jsx(H,{role:"alertdialog",...d,...s,ref:z,onOpenAutoFocus:G(s.onOpenAutoFocus,c=>{var f;c.preventDefault(),(f=g.current)==null||f.focus({preventScroll:!0})}),onPointerDownOutside:c=>c.preventDefault(),onInteractOutside:c=>c.preventDefault(),children:l})})});j.displayName=_;var Z="AlertDialogTitle",C=r.forwardRef((e,a)=>{const{__scopeAlertDialog:t,...l}=e,s=i(t);return o.jsx(V,{...s,...l,ref:a})});C.displayName=Z;var ee="AlertDialogDescription",T=r.forwardRef((e,a)=>{const{__scopeAlertDialog:t,...l}=e,s=i(t);return o.jsx(J,{...s,...l,ref:a})});T.displayName=ee;var ae="AlertDialogAction",w=r.forwardRef((e,a)=>{const{__scopeAlertDialog:t,...l}=e,s=i(t);return o.jsx(m,{...s,...l,ref:a})});w.displayName=ae;var E="AlertDialogCancel",P=r.forwardRef((e,a)=>{const{__scopeAlertDialog:t,...l}=e,{cancelRef:s}=X(E,t),d=i(t),p=A(a,s);return o.jsx(m,{...d,...l,ref:p})});P.displayName=E;var te=N,oe=x,le=y,O=R,S=j,M=w,$=P,b=C,I=T;const De=te,Ae=oe,re=le,h=r.forwardRef(({className:e,...a},t)=>o.jsx(O,{className:n("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...a,ref:t}));h.displayName=O.displayName;const se=r.forwardRef(({className:e,...a},t)=>o.jsxs(re,{children:[o.jsx(h,{}),o.jsx(S,{ref:t,className:n("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...a})]}));se.displayName=S.displayName;const ie=({className:e,...a})=>o.jsx("div",{className:n("flex flex-col space-y-2 text-center sm:text-left",e),...a});ie.displayName="AlertDialogHeader";const ne=({className:e,...a})=>o.jsx("div",{className:n("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...a});ne.displayName="AlertDialogFooter";const ce=r.forwardRef(({className:e,...a},t)=>o.jsx(b,{ref:t,className:n("text-lg font-semibold",e),...a}));ce.displayName=b.displayName;const de=r.forwardRef(({className:e,...a},t)=>o.jsx(I,{ref:t,className:n("text-sm text-muted-foreground",e),...a}));de.displayName=I.displayName;const pe=r.forwardRef(({className:e,...a},t)=>o.jsx(M,{ref:t,className:n(u(),e),...a}));pe.displayName=M.displayName;const ge=r.forwardRef(({className:e,...a},t)=>o.jsx($,{ref:t,className:n(u({variant:"outline"}),"mt-2 sm:mt-0",e),...a}));ge.displayName=$.displayName;export{De as A,pe as a,ge as b,se as c,de as d,ne as e,ie as f,ce as g,Ae as h};
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a4 as n,K as d,a1 as o}from"./index-
|
|
1
|
+
import{a4 as n,K as d,a1 as o}from"./index-IvDXNTVd.js";const s=o("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground",destructive:"border-transparent bg-destructive text-destructive-foreground",outline:"text-foreground"},tone:{backlog:"border-transparent bg-zinc-100 text-zinc-600 dark:bg-zinc-800 dark:text-zinc-400",progress:"border-transparent bg-blue-50 text-blue-700 dark:bg-blue-950 dark:text-blue-300",done:"border-transparent bg-green-50 text-green-700 dark:bg-green-950 dark:text-green-300",rejected:"border-transparent bg-red-50 text-red-700 dark:bg-red-950 dark:text-red-300",ios:"border-transparent bg-sky-50 text-sky-700 dark:bg-sky-950 dark:text-sky-300",android:"border-transparent bg-emerald-50 text-emerald-700 dark:bg-emerald-950 dark:text-emerald-300"}},defaultVariants:{variant:"default"}});function g({className:r,variant:e,tone:t,...a}){return n.jsx("div",{className:d(s({variant:e,tone:t}),r),...a})}export{g as B};
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{Y as Ae,a7 as n,a4 as r,ae as F,ak as Y,u as M,ag as xt,af as Me,aj as Ne,w as vt,V as St,A as wt,N as _,P as yt,t as Ct,ad as be,a6 as ke,Z as Le,O as Nt,Q as bt,a3 as Tt,ah as It,R as Pt,F as Rt,q as _t,a0 as Et,h as jt,a as Dt,K as E,f as Mt,D as Ot,p as At,n as kt,k as Ve,j as Lt,X as Vt,o as Be,m as He,l as Fe}from"./index-IvDXNTVd.js";/**
|
|
2
|
+
* @license lucide-react v0.577.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const Bt=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Ue=Ae("chevron-down",Bt);/**
|
|
7
|
+
* @license lucide-react v0.577.0 - ISC
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the ISC license.
|
|
10
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/const Ht=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Ft=Ae("chevron-up",Ht);function Oe(t,[o,e]){return Math.min(e,Math.max(o,t))}function Ut(t){const o=n.useRef({value:t,previous:t});return n.useMemo(()=>(o.current.value!==t&&(o.current.previous=o.current.value,o.current.value=t),o.current.previous),[t])}var Wt=[" ","Enter","ArrowUp","ArrowDown"],Kt=[" ","Enter"],re="Select",[pe,fe,$t]=Nt(re),[se]=bt(re,[$t,Le]),me=Le(),[zt,X]=se(re),[Gt,Yt]=se(re),qt="SelectProvider";function We(t){const{__scopeSelect:o,children:e,open:s,defaultOpen:a,onOpenChange:f,value:c,defaultValue:i,onValueChange:l,dir:p,name:v,autoComplete:w,disabled:N,required:P,form:C,internal_do_not_use_render:d}=t,x=me(o),[g,m]=n.useState(null),[u,I]=n.useState(null),[R,Q]=n.useState(!1),O=xt(p),[L,ae]=Me({prop:s,defaultProp:a??!1,onChange:f,caller:re}),[J,A]=Me({prop:c,defaultProp:i,onChange:l,caller:re}),U=n.useRef(null),ee=n.useRef(J);n.useEffect(()=>{const j=C?g==null?void 0:g.ownerDocument.getElementById(C):g==null?void 0:g.form;if(j instanceof HTMLFormElement){const H=()=>A(ee.current);return j.addEventListener("reset",H),()=>j.removeEventListener("reset",H)}},[C,g,A]);const $=g?!!C||!!g.closest("form"):!0,[V,W]=n.useState(new Set),z=Ne(),G=Array.from(V).map(j=>j.props.value).join(";"),B=n.useCallback(j=>{W(H=>new Set(H).add(j))},[]),le=n.useCallback(j=>{W(H=>{const K=new Set(H);return K.delete(j),K})},[]),te={required:P,trigger:g,onTriggerChange:m,valueNode:u,onValueNodeChange:I,valueNodeHasChildren:R,onValueNodeHasChildrenChange:Q,contentId:z,value:J,onValueChange:A,open:L,onOpenChange:ae,dir:O,triggerPointerDownPosRef:U,disabled:N,name:v,autoComplete:w,form:C,nativeOptions:V,nativeSelectKey:G,isFormControl:$};return r.jsx(vt,{...x,children:r.jsx(zt,{scope:o,...te,children:r.jsx(pe.Provider,{scope:o,children:r.jsx(Gt,{scope:o,onNativeOptionAdd:B,onNativeOptionRemove:le,children:uo(d)?d(te):e})})})})}We.displayName=qt;var Ke=t=>{const{__scopeSelect:o,children:e,...s}=t;return r.jsx(We,{__scopeSelect:o,...s,internal_do_not_use_render:({isFormControl:a})=>r.jsxs(r.Fragment,{children:[e,a?r.jsx(ut,{__scopeSelect:o}):null]})})};Ke.displayName=re;var $e="SelectTrigger",Te=n.forwardRef((t,o)=>{const{__scopeSelect:e,disabled:s=!1,...a}=t,f=me(e),c=X($e,e),i=c.disabled||s,l=F(o,c.onTriggerChange),p=fe(e),v=n.useRef("touch"),[w,N,P]=pt(d=>{const x=p().filter(u=>!u.disabled),g=x.find(u=>u.value===c.value),m=ft(x,d,g);m!==void 0&&c.onValueChange(m.value)}),C=d=>{i||(c.onOpenChange(!0),P()),d&&(c.triggerPointerDownPosRef.current={x:Math.round(d.pageX),y:Math.round(d.pageY)})};return r.jsx(wt,{asChild:!0,...f,children:r.jsx(M.button,{type:"button",role:"combobox","aria-controls":c.open?c.contentId:void 0,"aria-expanded":c.open,"aria-required":c.required,"aria-autocomplete":"none",dir:c.dir,"data-state":c.open?"open":"closed",disabled:i,"data-disabled":i?"":void 0,"data-placeholder":he(c.value)?"":void 0,...a,ref:l,onClick:_(a.onClick,d=>{d.currentTarget.focus(),v.current!=="mouse"&&C(d)}),onPointerDown:_(a.onPointerDown,d=>{v.current=d.pointerType;const x=d.target;x.hasPointerCapture(d.pointerId)&&x.releasePointerCapture(d.pointerId),d.button===0&&d.ctrlKey===!1&&d.pointerType==="mouse"&&(C(d),d.preventDefault())}),onKeyDown:_(a.onKeyDown,d=>{const x=w.current!=="";!(d.ctrlKey||d.altKey||d.metaKey)&&d.key.length===1&&N(d.key),!(x&&d.key===" ")&&Wt.includes(d.key)&&(C(),d.preventDefault())})})})});Te.displayName=$e;var ze="SelectValue",Ge=n.forwardRef((t,o)=>{const{__scopeSelect:e,className:s,style:a,children:f,placeholder:c="",...i}=t,l=X(ze,e),{onValueNodeHasChildrenChange:p}=l,v=f!==void 0,w=F(o,l.onValueNodeChange);Y(()=>{p(v)},[p,v]);const N=he(l.value);return r.jsx(M.span,{...i,asChild:N?!1:i.asChild,ref:w,style:{pointerEvents:"none"},children:r.jsx(n.Fragment,{children:N?c:f},N?"placeholder":"value")})});Ge.displayName=ze;var Xt="SelectIcon",Ye=n.forwardRef((t,o)=>{const{__scopeSelect:e,children:s,...a}=t;return r.jsx(M.span,{"aria-hidden":!0,...a,ref:o,children:s||"▼"})});Ye.displayName=Xt;var qe="SelectPortal",[Zt,Qt]=se(qe,{forceMount:void 0}),Xe=t=>{const{__scopeSelect:o,forceMount:e,...s}=t;return r.jsx(Zt,{scope:t.__scopeSelect,forceMount:e,children:r.jsx(yt,{asChild:!0,...s})})};Xe.displayName=qe;var q="SelectContent",Ie=n.forwardRef((t,o)=>{const e=Qt(q,t.__scopeSelect),{forceMount:s=e.forceMount,...a}=t,f=X(q,t.__scopeSelect),[c,i]=n.useState();return Y(()=>{i(new DocumentFragment)},[]),r.jsx(Ct,{present:s||f.open,children:({present:l})=>l?r.jsx(Je,{...a,ref:o}):r.jsx(Ze,{...a,fragment:c})})});Ie.displayName=q;var Ze=n.forwardRef((t,o)=>{const{__scopeSelect:e,children:s,fragment:a}=t;return a?ke.createPortal(r.jsx(Qe,{scope:e,children:r.jsx(pe.Slot,{scope:e,children:r.jsx("div",{ref:o,children:s})})}),a):null});Ze.displayName="SelectContentFragment";var k=10,[Qe,Z]=se(q),Jt="SelectContentImpl",eo=Et("SelectContent.RemoveScroll"),Je=n.forwardRef((t,o)=>{const{__scopeSelect:e}=t,{position:s="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:f,onPointerDownOutside:c,side:i,sideOffset:l,align:p,alignOffset:v,arrowPadding:w,collisionBoundary:N,collisionPadding:P,sticky:C,hideWhenDetached:d,avoidCollisions:x,...g}=t,m=X(q,e),[u,I]=n.useState(null),[R,Q]=n.useState(null),O=F(o,I),[L,ae]=n.useState(null),[J,A]=n.useState(null),U=fe(e),[ee,$]=n.useState(!1),V=n.useRef(!1);n.useEffect(()=>{if(u)return Tt(u)},[u]),It();const W=n.useCallback(h=>{const[T,...D]=U().map(y=>y.ref.current),[b]=D.slice(-1),S=document.activeElement;for(const y of h)if(y===S||(y==null||y.scrollIntoView({block:"nearest"}),y===T&&R&&(R.scrollTop=0),y===b&&R&&(R.scrollTop=R.scrollHeight),y==null||y.focus(),document.activeElement!==S))return},[U,R]),z=n.useCallback(()=>W([L,u]),[W,L,u]);n.useEffect(()=>{ee&&z()},[ee,z]);const{onOpenChange:G,triggerPointerDownPosRef:B}=m;n.useEffect(()=>{if(u){let h={x:0,y:0};const T=b=>{var S,y;h={x:Math.abs(Math.round(b.pageX)-(((S=B.current)==null?void 0:S.x)??0)),y:Math.abs(Math.round(b.pageY)-(((y=B.current)==null?void 0:y.y)??0))}},D=b=>{h.x<=10&&h.y<=10?b.preventDefault():b.composedPath().includes(u)||G(!1),document.removeEventListener("pointermove",T),B.current=null};return B.current!==null&&(document.addEventListener("pointermove",T),document.addEventListener("pointerup",D,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",T),document.removeEventListener("pointerup",D,{capture:!0})}}},[u,G,B]),n.useEffect(()=>{const h=()=>G(!1);return window.addEventListener("blur",h),window.addEventListener("resize",h),()=>{window.removeEventListener("blur",h),window.removeEventListener("resize",h)}},[G]);const[le,te]=pt(h=>{const T=U().filter(S=>!S.disabled),D=T.find(S=>S.ref.current===document.activeElement),b=ft(T,h,D);b&&setTimeout(()=>{var S;return(S=b.ref.current)==null?void 0:S.focus()})}),j=n.useCallback((h,T,D)=>{const b=!V.current&&!D;(m.value!==void 0&&m.value===T||b)&&(ae(h),b&&(V.current=!0))},[m.value]),H=n.useCallback(()=>u==null?void 0:u.focus(),[u]),K=n.useCallback((h,T,D)=>{const b=!V.current&&!D;(m.value!==void 0&&m.value===T||b)&&A(h)},[m.value]),de=s==="popper"?Se:et,ce=de===Se?{side:i,sideOffset:l,align:p,alignOffset:v,arrowPadding:w,collisionBoundary:N,collisionPadding:P,sticky:C,hideWhenDetached:d,avoidCollisions:x}:{};return r.jsx(Qe,{scope:e,content:u,viewport:R,onViewportChange:Q,itemRefCallback:j,selectedItem:L,onItemLeave:H,itemTextRefCallback:K,focusSelectedItem:z,selectedItemText:J,position:s,isPositioned:ee,searchRef:le,children:r.jsx(Pt,{as:eo,allowPinchZoom:!0,children:r.jsx(Rt,{asChild:!0,trapped:m.open,onMountAutoFocus:h=>{h.preventDefault()},onUnmountAutoFocus:_(a,h=>{var T;(T=m.trigger)==null||T.focus({preventScroll:!0}),h.preventDefault()}),children:r.jsx(_t,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:f,onPointerDownOutside:c,onFocusOutside:h=>h.preventDefault(),onDismiss:()=>m.onOpenChange(!1),children:r.jsx(de,{role:"listbox",id:m.contentId,"data-state":m.open?"open":"closed",dir:m.dir,onContextMenu:h=>h.preventDefault(),...g,...ce,onPlaced:()=>$(!0),ref:O,style:{display:"flex",flexDirection:"column",outline:"none",...g.style},onKeyDown:_(g.onKeyDown,h=>{const T=h.ctrlKey||h.altKey||h.metaKey;if(h.key==="Tab"&&h.preventDefault(),!T&&h.key.length===1&&te(h.key),["ArrowUp","ArrowDown","Home","End"].includes(h.key)){let b=U().filter(S=>!S.disabled).map(S=>S.ref.current);if(["ArrowUp","End"].includes(h.key)&&(b=b.slice().reverse()),["ArrowUp","ArrowDown"].includes(h.key)){const S=h.target,y=b.indexOf(S);b=b.slice(y+1)}setTimeout(()=>W(b)),h.preventDefault()}})})})})})})});Je.displayName=Jt;var to="SelectItemAlignedPosition",et=n.forwardRef((t,o)=>{const{__scopeSelect:e,onPlaced:s,...a}=t,f=X(q,e),c=Z(q,e),[i,l]=n.useState(null),[p,v]=n.useState(null),w=F(o,v),N=fe(e),P=n.useRef(!1),C=n.useRef(!0),{viewport:d,selectedItem:x,selectedItemText:g,focusSelectedItem:m}=c,u=n.useCallback(()=>{if(f.trigger&&f.valueNode&&i&&p&&d&&x&&g){const O=f.trigger.getBoundingClientRect(),L=p.getBoundingClientRect(),ae=f.valueNode.getBoundingClientRect(),J=g.getBoundingClientRect();if(f.dir!=="rtl"){const S=J.left-L.left,y=ae.left-S,oe=O.left-y,ne=O.width+oe,ge=Math.max(ne,L.width),xe=window.innerWidth-k,ve=Oe(y,[k,Math.max(k,xe-ge)]);i.style.minWidth=ne+"px",i.style.left=ve+"px"}else{const S=L.right-J.right,y=window.innerWidth-ae.right-S,oe=window.innerWidth-O.right-y,ne=O.width+oe,ge=Math.max(ne,L.width),xe=window.innerWidth-k,ve=Oe(y,[k,Math.max(k,xe-ge)]);i.style.minWidth=ne+"px",i.style.right=ve+"px"}const A=N(),U=window.innerHeight-k*2,ee=d.scrollHeight,$=window.getComputedStyle(p),V=parseInt($.borderTopWidth,10),W=parseInt($.paddingTop,10),z=parseInt($.borderBottomWidth,10),G=parseInt($.paddingBottom,10),B=V+W+ee+G+z,le=Math.min(x.offsetHeight*5,B),te=window.getComputedStyle(d),j=parseInt(te.paddingTop,10),H=parseInt(te.paddingBottom,10),K=O.top+O.height/2-k,de=U-K,ce=x.offsetHeight/2,h=x.offsetTop+ce,T=V+W+h,D=B-T;if(T<=K){const S=A.length>0&&x===A[A.length-1].ref.current;i.style.bottom="0px";const y=p.clientHeight-d.offsetTop-d.offsetHeight,oe=Math.max(de,ce+(S?H:0)+y+z),ne=T+oe;i.style.height=ne+"px"}else{const S=A.length>0&&x===A[0].ref.current;i.style.top="0px";const oe=Math.max(K,V+d.offsetTop+(S?j:0)+ce)+D;i.style.height=oe+"px",d.scrollTop=T-K+d.offsetTop}i.style.margin=`${k}px 0`,i.style.minHeight=le+"px",i.style.maxHeight=U+"px",s==null||s(),requestAnimationFrame(()=>P.current=!0)}},[N,f.trigger,f.valueNode,i,p,d,x,g,f.dir,s]);Y(()=>u(),[u]);const[I,R]=n.useState();Y(()=>{p&&R(window.getComputedStyle(p).zIndex)},[p]);const Q=n.useCallback(O=>{O&&C.current===!0&&(u(),m==null||m(),C.current=!1)},[u,m]);return r.jsx(no,{scope:e,contentWrapper:i,shouldExpandOnScrollRef:P,onScrollButtonChange:Q,children:r.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:I},children:r.jsx(M.div,{...a,ref:w,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});et.displayName=to;var oo="SelectPopperPosition",Se=n.forwardRef((t,o)=>{const{__scopeSelect:e,align:s="start",collisionPadding:a=k,...f}=t,c=me(e);return r.jsx(jt,{...c,...f,ref:o,align:s,collisionPadding:a,style:{boxSizing:"border-box",...f.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Se.displayName=oo;var[no,Pe]=se(q,{}),we="SelectViewport",tt=n.forwardRef((t,o)=>{const{__scopeSelect:e,nonce:s,...a}=t,f=Z(we,e),c=Pe(we,e),i=F(o,f.onViewportChange),l=n.useRef(0);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),r.jsx(pe.Slot,{scope:e,children:r.jsx(M.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:i,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:_(a.onScroll,p=>{const v=p.currentTarget,{contentWrapper:w,shouldExpandOnScrollRef:N}=c;if(N!=null&&N.current&&w){const P=Math.abs(l.current-v.scrollTop);if(P>0){const C=window.innerHeight-k*2,d=parseFloat(w.style.minHeight),x=parseFloat(w.style.height),g=Math.max(d,x);if(g<C){const m=g+P,u=Math.min(C,m),I=m-u;w.style.height=u+"px",w.style.bottom==="0px"&&(v.scrollTop=I>0?I:0,w.style.justifyContent="flex-end")}}}l.current=v.scrollTop})})})]})});tt.displayName=we;var ot="SelectGroup",[ro,so]=se(ot),ao=n.forwardRef((t,o)=>{const{__scopeSelect:e,...s}=t,a=Ne();return r.jsx(ro,{scope:e,id:a,children:r.jsx(M.div,{role:"group","aria-labelledby":a,...s,ref:o})})});ao.displayName=ot;var nt="SelectLabel",Re=n.forwardRef((t,o)=>{const{__scopeSelect:e,...s}=t,a=so(nt,e);return r.jsx(M.div,{id:a.id,...s,ref:o})});Re.displayName=nt;var ue="SelectItem",[lo,rt]=se(ue),_e=n.forwardRef((t,o)=>{const{__scopeSelect:e,value:s,disabled:a=!1,textValue:f,...c}=t,i=X(ue,e),l=Z(ue,e),p=i.value===s,[v,w]=n.useState(f??""),[N,P]=n.useState(!1),C=be(u=>{var I;return(I=l.itemRefCallback)==null?void 0:I.call(l,u,s,a)}),d=F(o,C),x=Ne(),g=n.useRef("touch"),m=()=>{a||(i.onValueChange(s),i.onOpenChange(!1))};return r.jsx(lo,{scope:e,value:s,disabled:a,textId:x,isSelected:p,onItemTextChange:n.useCallback(u=>{w(I=>I||((u==null?void 0:u.textContent)??"").trim())},[]),children:r.jsx(pe.ItemSlot,{scope:e,value:s,disabled:a,textValue:v,children:r.jsx(M.div,{role:"option","aria-labelledby":x,"data-highlighted":N?"":void 0,"aria-selected":p&&N,"data-state":p?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...c,ref:d,onFocus:_(c.onFocus,()=>P(!0)),onBlur:_(c.onBlur,()=>P(!1)),onClick:_(c.onClick,()=>{g.current!=="mouse"&&m()}),onPointerUp:_(c.onPointerUp,()=>{g.current==="mouse"&&m()}),onPointerDown:_(c.onPointerDown,u=>{g.current=u.pointerType}),onPointerMove:_(c.onPointerMove,u=>{var I;g.current=u.pointerType,a?(I=l.onItemLeave)==null||I.call(l):g.current==="mouse"&&u.currentTarget.focus({preventScroll:!0})}),onPointerLeave:_(c.onPointerLeave,u=>{var I;u.currentTarget===document.activeElement&&((I=l.onItemLeave)==null||I.call(l))}),onKeyDown:_(c.onKeyDown,u=>{var R;a||u.target!==u.currentTarget||((R=l.searchRef)==null?void 0:R.current)!==""&&u.key===" "||(Kt.includes(u.key)&&m(),u.key===" "&&u.preventDefault())})})})})});_e.displayName=ue;var ie="SelectItemText",st=n.forwardRef((t,o)=>{const{__scopeSelect:e,className:s,style:a,...f}=t,c=X(ie,e),i=Z(ie,e),l=rt(ie,e),p=Yt(ie,e),[v,w]=n.useState(null),N=be(m=>{var u;return(u=i.itemTextRefCallback)==null?void 0:u.call(i,m,l.value,l.disabled)}),P=F(o,w,l.onItemTextChange,N),C=v==null?void 0:v.textContent,d=n.useMemo(()=>r.jsx("option",{value:l.value,disabled:l.disabled,children:C},l.value),[l.disabled,l.value,C]),{onNativeOptionAdd:x,onNativeOptionRemove:g}=p;return Y(()=>(x(d),()=>g(d)),[x,g,d]),r.jsxs(r.Fragment,{children:[r.jsx(M.span,{id:l.textId,...f,ref:P}),l.isSelected&&c.valueNode&&!c.valueNodeHasChildren&&!he(c.value)?ke.createPortal(f.children,c.valueNode):null]})});st.displayName=ie;var at="SelectItemIndicator",lt=n.forwardRef((t,o)=>{const{__scopeSelect:e,...s}=t;return rt(at,e).isSelected?r.jsx(M.span,{"aria-hidden":!0,...s,ref:o}):null});lt.displayName=at;var ye="SelectScrollUpButton",Ee=n.forwardRef((t,o)=>{const e=Z(ye,t.__scopeSelect),s=Pe(ye,t.__scopeSelect),[a,f]=n.useState(!1),c=F(o,s.onScrollButtonChange);return Y(()=>{if(e.viewport&&e.isPositioned){let i=function(){const p=l.scrollTop>0;f(p)};const l=e.viewport;return i(),l.addEventListener("scroll",i),()=>l.removeEventListener("scroll",i)}},[e.viewport,e.isPositioned]),a?r.jsx(ct,{...t,ref:c,onAutoScroll:()=>{const{viewport:i,selectedItem:l}=e;i&&l&&(i.scrollTop=i.scrollTop-l.offsetHeight)}}):null});Ee.displayName=ye;var Ce="SelectScrollDownButton",je=n.forwardRef((t,o)=>{const e=Z(Ce,t.__scopeSelect),s=Pe(Ce,t.__scopeSelect),[a,f]=n.useState(!1),c=F(o,s.onScrollButtonChange);return Y(()=>{if(e.viewport&&e.isPositioned){let i=function(){const p=l.scrollHeight-l.clientHeight,v=Math.ceil(l.scrollTop)<p;f(v)};const l=e.viewport;return i(),l.addEventListener("scroll",i),()=>l.removeEventListener("scroll",i)}},[e.viewport,e.isPositioned]),a?r.jsx(ct,{...t,ref:c,onAutoScroll:()=>{const{viewport:i,selectedItem:l}=e;i&&l&&(i.scrollTop=i.scrollTop+l.offsetHeight)}}):null});je.displayName=Ce;var ct=n.forwardRef((t,o)=>{const{__scopeSelect:e,onAutoScroll:s,...a}=t,f=Z("SelectScrollButton",e),c=n.useRef(null),i=fe(e),l=n.useCallback(()=>{c.current!==null&&(window.clearInterval(c.current),c.current=null)},[]);return n.useEffect(()=>()=>l(),[l]),Y(()=>{var v;const p=i().find(w=>w.ref.current===document.activeElement);(v=p==null?void 0:p.ref.current)==null||v.scrollIntoView({block:"nearest"})},[i]),r.jsx(M.div,{"aria-hidden":!0,...a,ref:o,style:{flexShrink:0,...a.style},onPointerDown:_(a.onPointerDown,()=>{c.current===null&&(c.current=window.setInterval(s,50))}),onPointerMove:_(a.onPointerMove,()=>{var p;(p=f.onItemLeave)==null||p.call(f),c.current===null&&(c.current=window.setInterval(s,50))}),onPointerLeave:_(a.onPointerLeave,()=>{l()})})}),co="SelectSeparator",De=n.forwardRef((t,o)=>{const{__scopeSelect:e,...s}=t;return r.jsx(M.div,{"aria-hidden":!0,...s,ref:o})});De.displayName=co;var it="SelectArrow",io=n.forwardRef((t,o)=>{const{__scopeSelect:e,...s}=t,a=me(e);return Z(it,e).position==="popper"?r.jsx(Dt,{...a,...s,ref:o}):null});io.displayName=it;var dt="SelectBubbleInput",ut=n.forwardRef(({__scopeSelect:t,...o},e)=>{const s=X(dt,t),{value:a,onValueChange:f,required:c,disabled:i,name:l,autoComplete:p,form:v}=s,{nativeOptions:w,nativeSelectKey:N}=s,P=n.useRef(null),C=F(e,P),d=a??"",x=Ut(d),g=Array.from(w).some(m=>(m.props.value??"")==="");return n.useEffect(()=>{const m=P.current;if(!m)return;const u=window.HTMLSelectElement.prototype,R=Object.getOwnPropertyDescriptor(u,"value").set;if(x!==d&&R){const Q=new Event("change",{bubbles:!0});R.call(m,d),m.dispatchEvent(Q)}},[x,d]),r.jsxs(M.select,{"aria-hidden":!0,required:c,tabIndex:-1,name:l,autoComplete:p,disabled:i,form:v,onChange:m=>f(m.target.value),...o,style:{...St,...o.style},ref:C,defaultValue:d,children:[he(a)&&!g?r.jsx("option",{value:""}):null,Array.from(w)]},N)});ut.displayName=dt;function uo(t){return typeof t=="function"}function he(t){return t===""||t===void 0}function pt(t){const o=be(t),e=n.useRef(""),s=n.useRef(0),a=n.useCallback(c=>{const i=e.current+c;o(i),(function l(p){e.current=p,window.clearTimeout(s.current),p!==""&&(s.current=window.setTimeout(()=>l(""),1e3))})(i)},[o]),f=n.useCallback(()=>{e.current="",window.clearTimeout(s.current)},[]);return n.useEffect(()=>()=>window.clearTimeout(s.current),[]),[e,a,f]}function ft(t,o,e){const a=o.length>1&&Array.from(o).every(p=>p===o[0])?o[0]:o,f=e?t.indexOf(e):-1;let c=po(t,Math.max(f,0));a.length===1&&(c=c.filter(p=>p!==e));const l=c.find(p=>p.textValue.toLowerCase().startsWith(a.toLowerCase()));return l!==e?l:void 0}function po(t,o){return t.map((e,s)=>t[(o+s)%t.length])}const To=Ke,Io=Ge,fo=n.forwardRef(({className:t,children:o,...e},s)=>r.jsxs(Te,{ref:s,className:E("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),...e,children:[o,r.jsx(Ye,{asChild:!0,children:r.jsx(Ue,{className:"h-4 w-4 opacity-50"})})]}));fo.displayName=Te.displayName;const mt=n.forwardRef(({className:t,...o},e)=>r.jsx(Ee,{ref:e,className:E("flex cursor-default items-center justify-center py-1",t),...o,children:r.jsx(Ft,{className:"h-4 w-4"})}));mt.displayName=Ee.displayName;const ht=n.forwardRef(({className:t,...o},e)=>r.jsx(je,{ref:e,className:E("flex cursor-default items-center justify-center py-1",t),...o,children:r.jsx(Ue,{className:"h-4 w-4"})}));ht.displayName=je.displayName;const mo=n.forwardRef(({className:t,children:o,position:e="popper",...s},a)=>r.jsx(Xe,{children:r.jsxs(Ie,{ref:a,className:E("relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-select-content-transform-origin]",e==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:e,...s,children:[r.jsx(mt,{}),r.jsx(tt,{className:E("p-1",e==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:o}),r.jsx(ht,{})]})}));mo.displayName=Ie.displayName;const ho=n.forwardRef(({className:t,...o},e)=>r.jsx(Re,{ref:e,className:E("py-1.5 pl-8 pr-2 text-sm font-semibold",t),...o}));ho.displayName=Re.displayName;const go=n.forwardRef(({className:t,children:o,...e},s)=>r.jsxs(_e,{ref:s,className:E("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...e,children:[r.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:r.jsx(lt,{children:r.jsx(Mt,{className:"h-4 w-4"})})}),r.jsx(st,{children:o})]}));go.displayName=_e.displayName;const xo=n.forwardRef(({className:t,...o},e)=>r.jsx(De,{ref:e,className:E("-mx-1 my-1 h-px bg-muted",t),...o}));xo.displayName=De.displayName;const Po=Ot,Ro=At,vo=kt,gt=n.forwardRef(({className:t,...o},e)=>r.jsx(He,{ref:e,className:E("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...o}));gt.displayName=He.displayName;const So=n.forwardRef(({className:t,children:o,...e},s)=>r.jsxs(vo,{children:[r.jsx(gt,{}),r.jsxs(Ve,{ref:s,className:E("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",t),...e,children:[o,r.jsxs(Lt,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[r.jsx(Vt,{className:"h-4 w-4"}),r.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));So.displayName=Ve.displayName;const wo=({className:t,...o})=>r.jsx("div",{className:E("flex flex-col space-y-1.5 text-center sm:text-left",t),...o});wo.displayName="DialogHeader";const yo=({className:t,...o})=>r.jsx("div",{className:E("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...o});yo.displayName="DialogFooter";const Co=n.forwardRef(({className:t,...o},e)=>r.jsx(Be,{ref:e,className:E("text-lg font-semibold leading-none tracking-tight",t),...o}));Co.displayName=Be.displayName;const No=n.forwardRef(({className:t,...o},e)=>r.jsx(Fe,{ref:e,className:E("text-sm text-muted-foreground",t),...o}));No.displayName=Fe.displayName;export{Ue as C,Po as D,To as S,So as a,No as b,yo as c,wo as d,Co as e,Ro as f,mo as g,go as h,fo as i,Io as j,Oe as k,Ut as u};
|
|
Binary file
|