claude-alfred 0.3.19 → 0.3.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ja.md +27 -1
- package/README.md +27 -1
- package/content/hooks/hooks.json +0 -5
- package/dist/cli.mjs +2 -2
- package/dist/{directives-BtMZZnDe.mjs → directives-DfzKzUAL.mjs} +1 -1
- package/dist/{dispatcher-Bl7px8hy.mjs → dispatcher-BDl_Flyx.mjs} +6 -6
- package/dist/{post-tool-BRoelm73.mjs → post-tool-BawR4gHR.mjs} +5 -5
- package/dist/{post-tool-BL5YKl-j.mjs → post-tool-DpBkq5ik.mjs} +4 -4
- package/dist/{pre-compact-DEqTQ_7v.mjs → pre-compact-Cncx9q7L.mjs} +1 -1
- package/dist/{pre-tool-YJGmHuiU.mjs → pre-tool-Dyp4S8cV.mjs} +43 -6
- package/dist/{review-gate-0cGEW7jx.mjs → review-gate-7Pfe_A-8.mjs} +1 -1
- package/dist/{server-DaiRsZ3w.mjs → server-D3b54XYU.mjs} +74 -30
- package/dist/{session-start-CrZszyvc.mjs → session-start-CU4-KivX.mjs} +3 -3
- package/dist/{state-XSGGyez_.mjs → state-Cih-8_Zc.mjs} +1 -1
- package/dist/{stop-gh3SchT6.mjs → stop-CGv96IQd.mjs} +2 -2
- package/dist/{user-prompt-la6CpECb.mjs → user-prompt-BPAOU8f-.mjs} +3 -3
- package/package.json +1 -1
- package/web/dist/assets/activity-BMH0Gseq.js +3 -0
- package/web/dist/assets/{alert-dialog-DOk2vAC0.js → alert-dialog-Df-NKKik.js} +1 -1
- package/web/dist/assets/button-BC81_2hy.js +1 -0
- package/web/dist/assets/dist-CCslGrjS.js +1 -0
- package/web/dist/assets/es2015-C0wv2Iox.js +41 -0
- package/web/dist/assets/index-BedjjxO2.css +1 -0
- package/web/dist/assets/index-ClD5S_3_.js +138 -0
- package/web/dist/assets/{knowledge-BVNS0rvw.js → knowledge-Cf76s4T9.js} +8 -8
- package/web/dist/assets/routes-DZR7VbL6.js +1 -0
- package/web/dist/assets/{stagger-container-Cw2dfuIA.js → stagger-container-ClpnejW9.js} +1 -1
- package/web/dist/assets/{tasks-6gs3T7RP.js → tasks-Byg4aFbV.js} +1 -1
- package/web/dist/assets/{tasks._slug-D_xK_slB.js → tasks._slug-jxqMGzVd.js} +10 -10
- package/web/dist/index.html +4 -4
- package/web/dist/assets/activity-CRNPQErc.js +0 -3
- package/web/dist/assets/button-DHDUbkWK.js +0 -1
- package/web/dist/assets/dist-Dkaca6_h.js +0 -1
- package/web/dist/assets/index-R19UEUEr.js +0 -178
- package/web/dist/assets/index-r1JIc2ya.css +0 -1
- package/web/dist/assets/routes-BVHQFTM8.js +0 -1
- package/web/dist/assets/tooltip-z-i3XAtt.js +0 -1
- /package/web/dist/assets/{dist-CzjiYFd3.js → dist-CbLvV7YE.js} +0 -0
package/web/dist/index.html
CHANGED
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>alfred dashboard</title>
|
|
7
|
-
<script type="module" crossorigin src="/assets/index-
|
|
7
|
+
<script type="module" crossorigin src="/assets/index-ClD5S_3_.js"></script>
|
|
8
8
|
<link rel="modulepreload" crossorigin href="/assets/badge-C_nJR3_P.js">
|
|
9
|
-
<link rel="modulepreload" crossorigin href="/assets/button-
|
|
10
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
9
|
+
<link rel="modulepreload" crossorigin href="/assets/button-BC81_2hy.js">
|
|
10
|
+
<link rel="modulepreload" crossorigin href="/assets/es2015-C0wv2Iox.js">
|
|
11
11
|
<link rel="modulepreload" crossorigin href="/assets/link-CfxeT0ji.js">
|
|
12
12
|
<link rel="modulepreload" crossorigin href="/assets/useParams-BHiGLTRd.js">
|
|
13
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
13
|
+
<link rel="stylesheet" crossorigin href="/assets/index-BedjjxO2.css">
|
|
14
14
|
</head>
|
|
15
15
|
<body>
|
|
16
16
|
<div id="root"></div>
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{$t as e,Ht as t,Nt as n,Rt as r,Tn as i,a,d as o,en as s,i as c,j as l,n as u,p as d,t as f,zt as p}from"./badge-C_nJR3_P.js";import{n as m,r as h,t as g}from"./dist-Dkaca6_h.js";import{a as _,c as v,i as y,o as b,t as x}from"./button-DHDUbkWK.js";import{t as S}from"./dist-CzjiYFd3.js";import{t as C}from"./progress-3fcfVnZl.js";import{y as w}from"./index-R19UEUEr.js";import{i as ee,n as te,r as T,t as E}from"./card-D-KKTUrZ.js";import{t as D}from"./skeleton-ByYY54GV.js";var O=i(s(),1),k=e(),A=`Tabs`,[j,ne]=c(A,[h]),M=h(),[N,P]=j(A),F=O.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,onValueChange:i,defaultValue:o,orientation:s=`horizontal`,dir:c,activationMode:l=`automatic`,...u}=e,d=S(c),[f,p]=b({prop:r,onChange:i,defaultProp:o??``,caller:A});return(0,k.jsx)(N,{scope:n,baseId:y(),value:f,onValueChange:p,orientation:s,dir:d,activationMode:l,children:(0,k.jsx)(a.div,{dir:d,"data-orientation":s,...u,ref:t})})});F.displayName=A;var I=`TabsList`,L=O.forwardRef((e,t)=>{let{__scopeTabs:n,loop:r=!0,...i}=e,o=P(I,n),s=M(n);return(0,k.jsx)(m,{asChild:!0,...s,orientation:o.orientation,dir:o.dir,loop:r,children:(0,k.jsx)(a.div,{role:`tablist`,"aria-orientation":o.orientation,...i,ref:t})})});L.displayName=I;var R=`TabsTrigger`,z=O.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,disabled:i=!1,...o}=e,s=P(R,n),c=M(n),l=H(s.baseId,r),u=U(s.baseId,r),d=r===s.value;return(0,k.jsx)(g,{asChild:!0,...c,focusable:!i,active:d,children:(0,k.jsx)(a.button,{type:`button`,role:`tab`,"aria-selected":d,"aria-controls":u,"data-state":d?`active`:`inactive`,"data-disabled":i?``:void 0,disabled:i,id:l,...o,ref:t,onMouseDown:v(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?s.onValueChange(r):e.preventDefault()}),onKeyDown:v(e.onKeyDown,e=>{[` `,`Enter`].includes(e.key)&&s.onValueChange(r)}),onFocus:v(e.onFocus,()=>{let e=s.activationMode!==`manual`;!d&&!i&&e&&s.onValueChange(r)})})})});z.displayName=R;var B=`TabsContent`,V=O.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,forceMount:i,children:o,...s}=e,c=P(B,n),l=H(c.baseId,r),u=U(c.baseId,r),d=r===c.value,f=O.useRef(d);return O.useEffect(()=>{let e=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,k.jsx)(_,{present:i||d,children:({present:n})=>(0,k.jsx)(a.div,{"data-state":d?`active`:`inactive`,"data-orientation":c.orientation,role:`tabpanel`,"aria-labelledby":l,hidden:!n,id:u,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:f.current?`0s`:void 0},children:n&&o})})});V.displayName=B;function H(e,t){return`${e}-trigger-${t}`}function U(e,t){return`${e}-content-${t}`}var W=F,G=L,K=z;function q({epic:e}){let{t}=p(),r=e.tasks??[];return r.some(e=>(e.depends_on?.length??0)>0)?(0,k.jsxs)(`div`,{className:`mt-2 space-y-1`,children:[(0,k.jsx)(`p`,{className:`text-[10px] font-medium text-muted-foreground uppercase tracking-wider`,children:t(`epic.dependencies`)}),(0,k.jsx)(`div`,{className:`flex flex-wrap gap-x-4 gap-y-1`,children:r.filter(e=>(e.depends_on?.length??0)>0).map(e=>(0,k.jsxs)(`div`,{className:`flex items-center gap-1 text-xs`,children:[e.depends_on.map((e,t)=>(0,k.jsxs)(`span`,{className:`flex items-center gap-1`,children:[t>0&&(0,k.jsx)(`span`,{className:`text-muted-foreground`,children:`+`}),(0,k.jsx)(`span`,{className:l(`rounded-full px-1.5 py-0 border text-[10px]`,r.find(t=>t.slug===e)?.status===`completed`?`border-green-300 text-green-700 dark:border-green-800 dark:text-green-400`:`border-border text-muted-foreground`),children:e})]},e)),(0,k.jsx)(n,{className:`size-3 text-muted-foreground`}),(0,k.jsx)(`span`,{className:l(`rounded-full px-1.5 py-0 border text-[10px] font-medium`,e.status===`completed`?`border-green-300 text-green-700 dark:border-green-800 dark:text-green-400`:`border-border text-foreground`),children:e.slug})]},e.slug))})]}):null}function J({className:e,...t}){return(0,k.jsx)(`div`,{"data-slot":`table-container`,className:`relative w-full overflow-x-auto`,children:(0,k.jsx)(`table`,{"data-slot":`table`,className:l(`w-full caption-bottom text-sm`,e),...t})})}function Y({className:e,...t}){return(0,k.jsx)(`thead`,{"data-slot":`table-header`,className:l(`[&_tr]:border-b`,e),...t})}function X({className:e,...t}){return(0,k.jsx)(`tbody`,{"data-slot":`table-body`,className:l(`[&_tr:last-child]:border-0`,e),...t})}function Z({className:e,...t}){return(0,k.jsx)(`tr`,{"data-slot":`table-row`,className:l(`border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted`,e),...t})}function Q({className:e,...t}){return(0,k.jsx)(`th`,{"data-slot":`table-head`,className:l(`h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]`,e),...t})}function $({className:e,...t}){return(0,k.jsx)(`td`,{"data-slot":`table-cell`,className:l(`p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]`,e),...t})}function re({className:e,orientation:t=`horizontal`,...n}){return(0,k.jsx)(W,{"data-slot":`tabs`,"data-orientation":t,orientation:t,className:l(`group/tabs flex gap-2 data-[orientation=horizontal]:flex-col`,e),...n})}var ie=u(`group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-[orientation=horizontal]/tabs:h-8 group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col data-[variant=line]:rounded-none`,{variants:{variant:{default:`bg-muted`,line:`gap-1 bg-transparent`}},defaultVariants:{variant:`default`}});function ae({className:e,variant:t=`default`,...n}){return(0,k.jsx)(G,{"data-slot":`tabs-list`,"data-variant":t,className:l(ie({variant:t}),e),...n})}function oe({className:e,...t}){return(0,k.jsx)(K,{"data-slot":`tabs-trigger`,className:l(`relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-lg border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-foreground/60 transition-colors group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none dark:text-muted-foreground dark:hover:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,`group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent`,`data-[state=active]:bg-background data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 dark:data-[state=active]:text-foreground`,`after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100`,e),...t})}var se=[`all`,`spec.init`,`spec.complete`,`review.submit`],ce=10080*60*1e3;function le(){let{t:e}=p(),[n,r]=(0,O.useState)(`all`),[i,a]=(0,O.useState)(!1),[s,c]=(0,O.useState)(``),[l,u]=(0,O.useState)(``),{data:f,isLoading:m}=t(o(100,n===`all`?void 0:n)),{data:h}=t(d()),g=f?.entries??[],_=(0,O.useMemo)(()=>{let e=g;if(!i&&!s&&!l){let t=Date.now()-ce;e=e.filter(e=>{try{return new Date(e.timestamp).getTime()>=t}catch{return!0}})}if(s){let t=new Date(s).getTime();e=e.filter(e=>{try{return new Date(e.timestamp).getTime()>=t}catch{return!0}})}if(l){let t=new Date(l).getTime()+864e5;e=e.filter(e=>{try{return new Date(e.timestamp).getTime()<t}catch{return!0}})}return e},[g,i,s,l]),v=!i&&_.length<g.length,y=(h?.epics??[]).filter(e=>e.status!==`completed`&&e.status!==`done`);return(0,k.jsxs)(`div`,{className:`space-y-6`,children:[(0,k.jsxs)(`div`,{className:`sticky top-14 z-10 pt-6 pb-3 -mt-6 flex items-center gap-4 backdrop-blur-sm`,children:[(0,k.jsx)(re,{value:n,onValueChange:r,children:(0,k.jsx)(ae,{children:se.map(t=>(0,k.jsx)(oe,{value:t,className:`text-xs`,children:t===`all`?e(`activity.all`):t},t))})}),(0,k.jsxs)(`div`,{className:`flex items-center gap-2 text-xs ml-auto`,children:[(0,k.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity.fromDate`)}),(0,k.jsx)(`input`,{type:`date`,value:s,onChange:e=>c(e.target.value),className:`rounded-lg border bg-card px-2 py-1 text-xs h-7`}),(0,k.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity.toDate`)}),(0,k.jsx)(`input`,{type:`date`,value:l,onChange:e=>u(e.target.value),className:`rounded-lg border bg-card px-2 py-1 text-xs h-7`}),(0,k.jsx)(x,{size:`sm`,variant:`outline`,className:`h-7 text-xs gap-1`,onClick:()=>{let e=_.map(e=>`${e.timestamp},${e.action},${e.target},"${(e.detail??``).replace(/"/g,`""`)}"`).join(`
|
|
2
|
-
`),t=new Blob([`timestamp,action,target,detail
|
|
3
|
-
`+e],{type:`text/csv`}),n=URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=`activity.csv`,r.click(),URL.revokeObjectURL(n)},children:e(`activity.exportCsv`)})]})]}),m?(0,k.jsx)(`div`,{className:`space-y-2`,children:Array.from({length:5}).map((e,t)=>(0,k.jsx)(D,{className:`h-10 w-full`},`skel-${t}`))}):(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(ue,{entries:_}),v&&(0,k.jsx)(`div`,{className:`flex justify-center`,children:(0,k.jsx)(x,{variant:`outline`,size:`sm`,onClick:()=>a(!0),children:e(`activity.showOlder`)})})]}),y.length>0&&(0,k.jsx)(pe,{epics:y})]})}function ue({entries:e}){let{t,locale:n}=p(),[r,i]=(0,O.useState)(null);return(0,k.jsxs)(J,{children:[(0,k.jsx)(Y,{children:(0,k.jsxs)(Z,{children:[(0,k.jsx)(Q,{className:`w-44`,children:t(`activity.timestamp`)}),(0,k.jsx)(Q,{className:`w-32`,children:t(`activity.action`)}),(0,k.jsx)(Q,{children:t(`activity.target`)}),(0,k.jsx)(Q,{children:t(`activity.detail`)})]})}),(0,k.jsxs)(X,{children:[e.map((e,t)=>{let a=r===t,o=!!e.detail&&e.detail.length>40;return(0,k.jsxs)(Z,{className:o?`cursor-pointer hover:bg-accent/50`:``,onClick:()=>o&&i(a?null:t),children:[(0,k.jsx)($,{className:`text-xs text-muted-foreground font-mono align-top`,children:me(e.timestamp,n)}),(0,k.jsx)($,{className:`align-top`,children:(0,k.jsx)(fe,{action:e.action})}),(0,k.jsx)($,{className:`text-sm align-top`,children:e.target}),(0,k.jsx)($,{className:`text-xs text-muted-foreground`,children:a?(0,k.jsx)(`div`,{className:`whitespace-pre-wrap break-words max-w-lg`,children:e.detail}):(0,k.jsx)(`div`,{className:`max-w-xs truncate`,children:e.detail})})]},`${e.timestamp}-${t}`)}),e.length===0&&(0,k.jsx)(Z,{children:(0,k.jsx)($,{colSpan:4,children:(0,k.jsx)(w,{scene:`bow`,messageKey:`empty.noActivity`})})})]})]})}var de={"spec.init":`#40513b`,"spec.complete":`#2d8b7a`,"spec.delete":`#c0392b`,"review.submit":`#628141`,"living-spec.update":`#7b6b8d`};function fe({action:e}){let t=de[e]??`#6b7280`;return(0,k.jsx)(f,{variant:`outline`,className:`text-xs`,style:{borderColor:`${t}40`,color:t},children:e})}function pe({epics:e}){let{t}=p();return(0,k.jsxs)(`div`,{className:`space-y-3`,children:[(0,k.jsx)(`h3`,{className:`text-sm font-medium text-foreground`,children:t(`activity.epics`)}),(0,k.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:e.map(e=>{let t=e.total>0?e.completed/e.total*100:0;return(0,k.jsxs)(E,{children:[(0,k.jsx)(T,{className:`pb-2`,children:(0,k.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,k.jsx)(ee,{className:`text-sm`,children:e.name}),(0,k.jsx)(f,{variant:`outline`,className:`text-xs`,children:e.status})]})}),(0,k.jsxs)(te,{className:`space-y-2`,children:[(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,k.jsx)(C,{value:t,className:`flex-1`}),(0,k.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[e.completed,`/`,e.total]})]}),e.tasks&&e.tasks.length>0&&(0,k.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:e.tasks.map(e=>(0,k.jsx)(f,{variant:`outline`,className:`text-[10px]`,style:{borderColor:e.status===`completed`||e.status===`done`?`rgba(45,139,122,0.3)`:`rgba(107,114,128,0.3)`,color:e.status===`completed`||e.status===`done`?`#2d8b7a`:`#6b7280`},children:e.slug},e.slug))}),(0,k.jsx)(q,{epic:e})]})]},e.slug)})})]})}function me(e,t=`en`){try{return new Date(e).toLocaleString(r(t),{month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`})}catch{return e}}export{le as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$t as e,Tn as t,en as n,j as r,n as i,s as a,u as o}from"./badge-C_nJR3_P.js";typeof window<`u`&&window.document&&window.document.createElement;function s(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}var c=t(n(),1),l=globalThis?.document?c.useLayoutEffect:()=>{},u=c.useInsertionEffect||l;function d({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=f({defaultProp:t,onChange:n}),s=e!==void 0,l=s?e:i;{let t=c.useRef(e!==void 0);c.useEffect(()=>{let e=t.current;if(e!==s){let t=e?`controlled`:`uncontrolled`,n=s?`controlled`:`uncontrolled`;console.warn(`${r} is changing from ${t} to ${n}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}t.current=s},[s,r])}return[l,c.useCallback(t=>{if(s){let n=p(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function f({defaultProp:e,onChange:t}){let[n,r]=c.useState(e),i=c.useRef(n),a=c.useRef(t);return u(()=>{a.current=t},[t]),c.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function p(e){return typeof e==`function`}function m(e,t){return c.useReducer((e,n)=>t[e][n]??e,e)}var h=e=>{let{present:t,children:n}=e,r=g(t),i=typeof n==`function`?n({present:r.isPresent}):c.Children.only(n),a=o(r.ref,v(i));return typeof n==`function`||r.isPresent?c.cloneElement(i,{ref:a}):null};h.displayName=`Presence`;function g(e){let[t,n]=c.useState(),r=c.useRef(null),i=c.useRef(e),a=c.useRef(`none`),[o,s]=m(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return c.useEffect(()=>{let e=_(r.current);a.current=o===`mounted`?e:`none`},[o]),l(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=_(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),l(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=_(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(s(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},c=e=>{e.target===t&&(a.current=_(r.current))};return t.addEventListener(`animationstart`,c),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,c),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else s(`ANIMATION_END`)},[t,s]),{isPresent:[`mounted`,`unmountSuspended`].includes(o),ref:c.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function _(e){return e?.animationName||`none`}function v(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var y=c.useId||(()=>void 0),b=0;function x(e){let[t,n]=c.useState(y());return l(()=>{e||n(e=>e??String(b++))},[e]),e||(t?`radix-${t}`:``)}function S(e){let t=c.useRef(e);return c.useEffect(()=>{t.current=e}),c.useMemo(()=>(...e)=>t.current?.(...e),[])}var C=e(),w=i(`inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-colors outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/90`,destructive:`bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40`,outline:`border bg-background hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80`,ghost:`hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50`,link:`text-primary underline-offset-4 hover:underline`,brutalist:`bg-primary text-primary-foreground shadow-[3px_3px_0_var(--color-brand-dark)] hover:translate-x-[1px] hover:translate-y-[1px] hover:shadow-[2px_2px_0_var(--color-brand-dark)] active:translate-x-[2px] active:translate-y-[2px] active:shadow-[1px_1px_0_var(--color-brand-dark)]`},size:{default:`h-8 px-4 py-2 has-[>svg]:px-3`,xs:`h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5`,lg:`h-10 rounded-md px-6 has-[>svg]:px-4`,icon:`size-9`,"icon-xs":`size-6 rounded-md [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-8`,"icon-lg":`size-10`}},defaultVariants:{variant:`default`,size:`default`}});function T({className:e,variant:t=`default`,size:n=`default`,asChild:i=!1,...o}){return(0,C.jsx)(i?a:`button`,{"data-slot":`button`,"data-variant":t,"data-size":n,className:r(w({variant:t,size:n,className:e})),...o})}export{h as a,s as c,x as i,w as n,d as o,S as r,l as s,T as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$t as e,Tn as t,a as n,c as r,en as i,i as a,u as o}from"./badge-C_nJR3_P.js";import{c as s,i as c,o as l,r as u}from"./button-DHDUbkWK.js";import{t as d}from"./dist-CzjiYFd3.js";var f=t(i(),1),p=e();function m(e){let t=e+`CollectionProvider`,[n,i]=a(t),[s,c]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=e=>{let{scope:t,children:n}=e,r=f.useRef(null),i=f.useRef(new Map).current;return(0,p.jsx)(s,{scope:t,itemMap:i,collectionRef:r,children:n})};l.displayName=t;let u=e+`CollectionSlot`,d=r(u),m=f.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,p.jsx)(d,{ref:o(t,c(u,n).collectionRef),children:r})});m.displayName=u;let h=e+`CollectionItemSlot`,g=`data-radix-collection-item`,_=r(h),v=f.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,a=f.useRef(null),s=o(t,a),l=c(h,n);return f.useEffect(()=>(l.itemMap.set(a,{ref:a,...i}),()=>void l.itemMap.delete(a))),(0,p.jsx)(_,{[g]:``,ref:s,children:r})});v.displayName=h;function y(t){let n=c(e+`CollectionConsumer`,t);return f.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${g}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:l,Slot:m,ItemSlot:v},y,i]}var h=`rovingFocusGroup.onEntryFocus`,g={bubbles:!1,cancelable:!0},_=`RovingFocusGroup`,[v,y,b]=m(_),[x,S]=a(_,[b]),[C,w]=x(_),T=f.forwardRef((e,t)=>(0,p.jsx)(v.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,p.jsx)(v.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,p.jsx)(E,{...e,ref:t})})}));T.displayName=_;var E=f.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:r,orientation:i,loop:a=!1,dir:c,currentTabStopId:m,defaultCurrentTabStopId:v,onCurrentTabStopIdChange:b,onEntryFocus:x,preventScrollOnEntryFocus:S=!1,...w}=e,T=f.useRef(null),E=o(t,T),D=d(c),[O,k]=l({prop:m,defaultProp:v??null,onChange:b,caller:_}),[A,j]=f.useState(!1),N=u(x),P=y(r),F=f.useRef(!1),[I,L]=f.useState(0);return f.useEffect(()=>{let e=T.current;if(e)return e.addEventListener(h,N),()=>e.removeEventListener(h,N)},[N]),(0,p.jsx)(C,{scope:r,orientation:i,dir:D,loop:a,currentTabStopId:O,onItemFocus:f.useCallback(e=>k(e),[k]),onItemShiftTab:f.useCallback(()=>j(!0),[]),onFocusableItemAdd:f.useCallback(()=>L(e=>e+1),[]),onFocusableItemRemove:f.useCallback(()=>L(e=>e-1),[]),children:(0,p.jsx)(n.div,{tabIndex:A||I===0?-1:0,"data-orientation":i,...w,ref:E,style:{outline:`none`,...e.style},onMouseDown:s(e.onMouseDown,()=>{F.current=!0}),onFocus:s(e.onFocus,e=>{let t=!F.current;if(e.target===e.currentTarget&&t&&!A){let t=new CustomEvent(h,g);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=P().filter(e=>e.focusable);M([e.find(e=>e.active),e.find(e=>e.id===O),...e].filter(Boolean).map(e=>e.ref.current),S)}}F.current=!1}),onBlur:s(e.onBlur,()=>j(!1))})})}),D=`RovingFocusGroupItem`,O=f.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:r,focusable:i=!0,active:a=!1,tabStopId:o,children:l,...u}=e,d=c(),m=o||d,h=w(D,r),g=h.currentTabStopId===m,_=y(r),{onFocusableItemAdd:b,onFocusableItemRemove:x,currentTabStopId:S}=h;return f.useEffect(()=>{if(i)return b(),()=>x()},[i,b,x]),(0,p.jsx)(v.ItemSlot,{scope:r,id:m,focusable:i,active:a,children:(0,p.jsx)(n.span,{tabIndex:g?0:-1,"data-orientation":h.orientation,...u,ref:t,onMouseDown:s(e.onMouseDown,e=>{i?h.onItemFocus(m):e.preventDefault()}),onFocus:s(e.onFocus,()=>h.onItemFocus(m)),onKeyDown:s(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){h.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=j(e,h.orientation,h.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=_().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=h.loop?N(n,r+1):n.slice(r+1)}setTimeout(()=>M(n))}}),children:typeof l==`function`?l({isCurrentTabStop:g,hasTabStop:S!=null}):l})})});O.displayName=D;var k={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function A(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function j(e,t,n){let r=A(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return k[r]}function M(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function N(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var P=T,F=O;export{P as n,S as r,F as t};
|