@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.35 kB
JavaScript
import{s as h,i as w,c as g,a as m,b as p,S as z,k as y,m as k,d as l,t as r,f as x}from"./chunks/define-CNSKFZCd.js";import{c as i}from"./chunks/cn-CU7UAWzk.js";var C=r("<span aria-hidden=true>"),S=r("<span><span>");const v={new:"bg-tool-blue",online:"bg-tool-green",busy:"bg-tool-red",away:"bg-tool-amber",offline:"bg-muted-foreground"},A={sm:"size-2",md:"size-2.5"};function _(t){const[s,c]=h(t,["status","size","pulse","label","class"]),n=()=>s.status??"new";return(()=>{var a=S(),o=a.firstChild;return w(a,g(z,{get when(){return s.pulse},get children(){var e=C();return m(()=>p(e,i("absolute inline-flex h-full w-full animate-ping rounded-full opacity-75 motion-reduce:hidden",v[n()]))),e}}),o),y(o,k(c,{get class(){return i("relative inline-block rounded-full",v[n()],A[s.size??"sm"])}}),!1,!1),m(e=>{var u=i("relative inline-flex",s.class),d=s.label?"status":void 0,b=s.label,f=s.label?void 0:"true";return u!==e.e&&p(a,e.e=u),d!==e.t&&l(a,"role",e.t=d),b!==e.a&&l(a,"aria-label",e.a=b),f!==e.o&&l(a,"aria-hidden",e.o=f),e},{e:void 0,t:void 0,a:void 0,o:void 0}),a})()}var $=r("<style>:host{display:inline-flex}");x("kai-status",{status:"new",pulse:!1,label:void 0,size:"sm"},(t,{flag:s})=>[$(),g(_,{get status(){return t.status??"new"},get size(){return t.size??"sm"},get pulse(){return s("pulse")},get label(){return t.label},part:"dot"})]);