UNPKG

@kitn.ai/ui

Version:

Framework-agnostic, Shadow-DOM web components for building AI chat interfaces — works in React, Vue, Angular, Svelte, or plain HTML. Authored in SolidJS.

2 lines (1 loc) 1.94 kB
import{c as o,m,i as p,S as f,a as g,d as h,t as v,w as x,v as C,g as k,h as b,l as w,j as i}from"./define-CNSKFZCd.js";import{c as $}from"./cn-CU7UAWzk.js";import{B as y}from"./button-DBDZebGr.js";import{C as R}from"./card-YfCyI4fH.js";import{I as S}from"./Icon-C2LTALdM.js";var L=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],D=s=>o(S,m(s,{name:"RotateCcw",iconNode:L})),M=D,T=v('<div role=group class="flex flex-wrap items-center gap-x-2 gap-y-1"><span class="min-w-0 text-sm text-muted-foreground"><span class="font-medium text-foreground"></span> <span class=text-foreground></span><span class=text-muted-foreground> \u2014 dismissed');const j={confirm:"Proposed",choice:"Choose",form:"Form",tasks:"Tasks"};function q(s){const t=j[s];return t?`${t}:`:s.length===0?"Card:":`${s.charAt(0).toUpperCase()}${s.slice(1)}:`}function z(s){const t=()=>q(s.type),a=()=>s.title??"this card",e=()=>s.reopenLabel??"Reopen",c=()=>`${t()} ${a()} \u2014 dismissed`;return o(R,{dense:!0,get class(){return s.class},get children(){var n=T(),l=n.firstChild,d=l.firstChild,r=d.nextSibling,u=r.nextSibling;return p(d,t),p(u,a),p(n,o(y,{type:"button",variant:"ghost",size:"sm",get class(){return $("ml-auto gap-1.5")},onClick:()=>s.onReopen(),get children(){return[o(M,{size:14,"aria-hidden":"true"}),o(f,{get when(){return e()},get children(){return e()}})]}}),null),g(()=>h(n,"aria-label",c())),n}})}const A=C();function F(){return x(A)}const I=new Set(["action","submit","expired"]);function N(s){const[t,a]=k(void 0);b(w(s.data,()=>a(void 0),{defer:!0}));const e=i(()=>s.prop()??t()),c=i(()=>e()!==void 0),n=i(()=>{const r=e();return r!==void 0&&I.has(r.kind)}),l=i(()=>{var r;return((r=e())==null?void 0:r.kind)==="dismissed"}),d=i(()=>s.prop()===void 0&&t()!==void 0);return{resolution:e,isResolved:c,isTerminal:n,isDeferred:l,isOptimistic:d,setLocal:a}}export{z as D,N as a,F as u};