@kitn.ai/ui 0.29.0 → 0.30.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/README.md +11 -7
- package/dist/{Icon-DObhsRtm.js → Icon-BzBET3E-.js} +1 -1
- package/dist/{action-icons-CcgNN2oT.js → action-icons-DaW2pU6m.js} +1 -1
- package/dist/arrow-down-D783iMJj.js +1 -0
- package/dist/arrow-left-0VLM5kyg.js +1 -0
- package/dist/artifact-DGjzHYUT.js +1 -0
- package/dist/{attachments-Qr4kg-2b.js → attachments-YvXHlg88.js} +1 -1
- package/dist/{audio-visualizer-DToYdfSc.js → audio-visualizer-9lz5IHsL.js} +1 -1
- package/dist/{badge-CdEu_jn2.js → badge-Dh_vp8A5.js} +1 -1
- package/dist/{bell-DQAAOpDz.js → bell-CT7_WUwS.js} +1 -1
- package/dist/{button-DkuOnGLy.js → button-C_3te6fm.js} +1 -1
- package/dist/{card-renderer-Jx70m6_l.js → card-renderer-DZVaGH2e.js} +1 -1
- package/dist/check-CiEOVnEN.js +1 -0
- package/dist/{checkbox-D7iRB3nL.js → checkbox-Bu2T2e0U.js} +1 -1
- package/dist/{checkbox-group-B2_rpoPM.js → checkbox-group-BiryEXPQ.js} +1 -1
- package/dist/chevron-down-CSobuZRG.js +1 -0
- package/dist/chevron-right-DR9ZAP-2.js +1 -0
- package/dist/{choice-card-m0BYqqOK.js → choice-card-CM6IjkmL.js} +1 -1
- package/dist/circle-BC66EYF7.js +1 -0
- package/dist/circle-check-BqmahW0O.js +1 -0
- package/dist/{circle-x-BPG0iPst.js → circle-x-Bk-dA5Wf.js} +1 -1
- package/dist/{code-block-ClMLKb7C.js → code-block-B26t-Q7q.js} +1 -1
- package/dist/{collapsible-B4DlWicL.js → collapsible-Bhc636Cf.js} +1 -1
- package/dist/components/builder-composer-triggers.d.ts +62 -0
- package/dist/components/builder-layout.d.ts +54 -0
- package/dist/components/builder-message-actions.d.ts +72 -0
- package/dist/components/builder-panel.d.ts +189 -0
- package/dist/components/builder-preview.d.ts +11 -0
- package/dist/components/builder-shell-controls.d.ts +69 -0
- package/dist/components/builder-skeleton.d.ts +58 -0
- package/dist/components/builder-start.d.ts +75 -0
- package/dist/components/builder-workspace-variants.d.ts +23 -0
- package/dist/components/captions.d.ts +66 -0
- package/dist/{composer-sQ0HcvyG.js → composer-DMI85B6j.js} +1 -1
- package/dist/{confirm-card-rQWDQsnC.js → confirm-card-B0YIAwXp.js} +1 -1
- package/dist/{context-0kg4ZX1J.js → context-DWgfhqWp.js} +1 -1
- package/dist/controllable-BagRpyHv.js +1 -0
- package/dist/{conversation-item-BxwQLaFJ.js → conversation-item-BsOsVGmT.js} +1 -1
- package/dist/{conversation-list-BCfGN1JU.js → conversation-list-aX3Vtc7L.js} +1 -1
- package/dist/{copy-n9u9rqpi.js → copy-BmEwsNhJ.js} +1 -1
- package/dist/{create-tween-uPkArjIG.js → create-tween-CNOAU3Fx.js} +1 -1
- package/dist/{create-tween-C-q-JCM-.js → create-tween-WfqiENls.js} +1 -1
- package/dist/{create-tween-CRrJXxBd.js → create-tween-wlFtW9Kh.js} +1 -1
- package/dist/{create-tween-DZ3RRDHD.js → create-tween-zt79ba32.js} +1 -1
- package/dist/{default-input-CaMrJkgH.js → default-input-DMV5Eaze.js} +1 -1
- package/dist/define-CI0y3eE4.js +1 -0
- package/dist/define.js +40 -40
- package/dist/define.server.js +45 -45
- package/dist/{disclosure-WUImBbDv.js → disclosure-NnACBxsC.js} +1 -1
- package/dist/{dropdown-wZVeJOMd.js → dropdown-DT7G0RGR.js} +1 -1
- package/dist/elements/agent-card.js +1 -1
- package/dist/elements/artifact.js +1 -1
- package/dist/elements/attachments.js +1 -1
- package/dist/elements/audio-visualizer.js +1 -1
- package/dist/elements/avatar.js +1 -1
- package/dist/elements/badge.js +1 -1
- package/dist/elements/button.js +1 -1
- package/dist/elements/card.js +1 -1
- package/dist/elements/cards.js +1 -1
- package/dist/elements/chain-of-thought.js +1 -1
- package/dist/elements/chat-scope-picker.js +1 -1
- package/dist/elements/chat-workspace.js +1 -1
- package/dist/elements/chat.js +1 -1
- package/dist/elements/checkbox-group.js +1 -1
- package/dist/elements/checkbox.js +1 -1
- package/dist/elements/checkpoint.js +1 -1
- package/dist/elements/choice.js +1 -1
- package/dist/elements/coachmark.js +1 -1
- package/dist/elements/code-block.js +1 -1
- package/dist/elements/command.js +1 -1
- package/dist/elements/compare.js +1 -1
- package/dist/elements/composer.js +1 -1
- package/dist/elements/confirm-card.js +1 -1
- package/dist/elements/context-meter.js +1 -1
- package/dist/elements/conversation-item.js +1 -1
- package/dist/elements/conversation-list.js +1 -1
- package/dist/elements/dialog.js +1 -1
- package/dist/elements/dock.js +1 -1
- package/dist/elements/dropdown.js +1 -1
- package/dist/elements/editable-label.js +1 -1
- package/dist/elements/embed.js +1 -1
- package/dist/elements/empty.js +1 -1
- package/dist/elements/feedback-bar.js +1 -1
- package/dist/elements/file-tree.js +1 -1
- package/dist/elements/file-upload.js +1 -1
- package/dist/elements/form.js +1 -1
- package/dist/elements/hover-card.js +1 -1
- package/dist/elements/icon.js +1 -1
- package/dist/elements/image.js +1 -1
- package/dist/elements/input.js +1 -1
- package/dist/elements/kbd.js +1 -1
- package/dist/elements/link-preview.js +1 -1
- package/dist/elements/loader.js +1 -1
- package/dist/elements/markdown.js +1 -1
- package/dist/elements/menu.js +1 -1
- package/dist/elements/message-skills.js +1 -1
- package/dist/elements/message.js +1 -1
- package/dist/elements/model-switcher.js +1 -1
- package/dist/elements/nav.js +1 -1
- package/dist/elements/notice.js +1 -1
- package/dist/elements/pane-grid.js +1 -1
- package/dist/elements/pane-group.js +1 -1
- package/dist/elements/pane.js +1 -1
- package/dist/elements/popover.js +1 -1
- package/dist/elements/progress-bar.js +1 -1
- package/dist/elements/prompt-dock.js +1 -1
- package/dist/elements/prompt-input.js +1 -1
- package/dist/elements/prompt-suggestions.js +1 -1
- package/dist/elements/radio-group.js +1 -1
- package/dist/elements/reasoning.js +1 -1
- package/dist/elements/remote.js +1 -1
- package/dist/elements/resizable.js +1 -1
- package/dist/elements/response-stream.js +1 -1
- package/dist/elements/screen.js +1 -1
- package/dist/elements/scroll-area.js +1 -1
- package/dist/elements/scroll-button.js +1 -1
- package/dist/elements/search.js +1 -1
- package/dist/elements/segmented.js +1 -1
- package/dist/elements/select.js +1 -1
- package/dist/elements/separator.js +1 -1
- package/dist/elements/setting-item.js +1 -1
- package/dist/elements/settings-group.js +1 -1
- package/dist/elements/skeleton.js +1 -1
- package/dist/elements/slider.js +1 -1
- package/dist/elements/source.js +1 -1
- package/dist/elements/status.js +1 -1
- package/dist/elements/switch.js +1 -1
- package/dist/elements/tabs.js +1 -1
- package/dist/elements/tasks.js +1 -1
- package/dist/elements/text-shimmer.js +1 -1
- package/dist/elements/thinking-bar.js +1 -1
- package/dist/elements/thread.js +1 -1
- package/dist/elements/toast.js +1 -1
- package/dist/elements/tool.js +1 -1
- package/dist/elements/tooltip.js +1 -1
- package/dist/elements/voice-input.js +1 -1
- package/dist/elements/voice-output.js +1 -1
- package/dist/{ellipsis-CbOpJnU3.js → ellipsis-6pJ7SxYT.js} +1 -1
- package/dist/{embed-CrfjkbUG.js → embed-BMje-nxj.js} +1 -1
- package/dist/{external-link-ByXAwBBQ.js → external-link-Beh9DKeR.js} +1 -1
- package/dist/{file-text-DMib2qwt.js → file-text-D1GPfZ8Q.js} +1 -1
- package/dist/{file-tree-CJqM2aP7.js → file-tree-Dwj2lqg-.js} +1 -1
- package/dist/{folder-_BAb929C.js → folder-b6D8x1DY.js} +1 -1
- package/dist/{form-DSZgZQZk.js → form-DWgdxDXu.js} +1 -1
- package/dist/{hover-card-BQbul9eq.js → hover-card-CWRkqm40.js} +1 -1
- package/dist/{icon-CdcfRhYI.js → icon-CL0jdhsf.js} +1 -1
- package/dist/index.js +1741 -1725
- package/dist/index.server.js +1582 -1566
- package/dist/{info-DsFjGuI_.js → info-0cOUherQ.js} +1 -1
- package/dist/{input-DKbmkMos.js → input-BH6Ru91Q.js} +1 -1
- package/dist/kai.es.js +1 -1
- package/dist/{kbd-PvdGhX4s.js → kbd-DRAnVtNX.js} +1 -1
- package/dist/{link-zF8PzWfF.js → link-Dlr0vssB.js} +1 -1
- package/dist/{link-preview-DbM1866N.js → link-preview-DODgRyV9.js} +1 -1
- package/dist/loader-KvJB6NrT.js +1 -0
- package/dist/{markdown-LMvmAyBk.js → markdown-DX9tuJVj.js} +1 -1
- package/dist/mcp.es.js +8 -4
- package/dist/{message-BYZECyek.js → message-BqQ7Ot5q.js} +1 -1
- package/dist/{message-BSsgvHvf.js → message-DkaGfBd8.js} +1 -1
- package/dist/message-circle-BPpp5QKv.js +1 -0
- package/dist/message-square-BLbsd9BJ.js +1 -0
- package/dist/{minimize-2-BQRoBV1V.js → minimize-2-CyOHJwcN.js} +1 -1
- package/dist/{model-switcher-CMpCOYcB.js → model-switcher-0hrKDiK2.js} +1 -1
- package/dist/{overlay-Cb-MkyDa.js → overlay-DBMFXie6.js} +1 -1
- package/dist/{panel-right-i8warFxT.js → panel-right-t8SWJL6e.js} +1 -1
- package/dist/{paperclip-ByY3UVO6.js → paperclip-CdzuOjbU.js} +1 -1
- package/dist/play-BXy1u7rW.js +1 -0
- package/dist/primitives/use-auto-resize.d.ts +11 -0
- package/dist/{progress-bar-jVAHvMUf.js → progress-bar-CiBtxMWT.js} +1 -1
- package/dist/{prompt-suggestion-CD-qtNgC.js → prompt-suggestion-I_DHP21i.js} +1 -1
- package/dist/{radio-BsoBMhkF.js → radio-C_p3n39l.js} +1 -1
- package/dist/{reasoning-4kBPtlTx.js → reasoning-BDwy_tIe.js} +1 -1
- package/dist/register-impl-DvEnhIxx.js +424 -0
- package/dist/{resizable-uPmY9VY-.js → resizable-SYC-fStM.js} +1 -1
- package/dist/{rotate-ccw-B2xn93py.js → rotate-ccw-B1nwmwuY.js} +1 -1
- package/dist/{rotate-cw-CMVLoCyH.js → rotate-cw-CLAnBcm1.js} +1 -1
- package/dist/{scroll-area-BqLUo8ZZ.js → scroll-area-zRyXoLhI.js} +1 -1
- package/dist/{scroll-button-DslXiJyL.js → scroll-button-jzrbYCG9.js} +1 -1
- package/dist/{select-2cLRtPGT.js → select-DM-0nEe0.js} +1 -1
- package/dist/{separator-BWQtNJcM.js → separator-BToOOoOt.js} +1 -1
- package/dist/{settings-BBR63jLg.js → settings-PaGo_S4U.js} +1 -1
- package/dist/{settings-group-B2ciy-Iw.js → settings-group-BFXGIfXq.js} +1 -1
- package/dist/{skeleton-CkHI-HgC.js → skeleton-DYpmFnnm.js} +1 -1
- package/dist/{slider-DDR9U-i0.js → slider-ebutAmkQ.js} +1 -1
- package/dist/{solid-DruVOXnf.js → solid-15v_3WVL.js} +3563 -3412
- package/dist/{solid-BzCFdL25.js → solid-5P-otgdi.js} +4502 -4296
- package/dist/solid.d.ts +6 -0
- package/dist/solid.js +259 -254
- package/dist/solid.server.js +259 -254
- package/dist/{source-GEnFF528.js → source-c1gpRl9h.js} +1 -1
- package/dist/{star-CilHq8GP.js → star-pcV_3LqF.js} +1 -1
- package/dist/{store-Ciyk6eZG.js → store-CSgbFFCg.js} +1 -1
- package/dist/{switch-KkeQIbuH.js → switch-Bh2OdLV2.js} +1 -1
- package/dist/{tasks-card-BrN4bggJ.js → tasks-card-CbqQAn2S.js} +1 -1
- package/dist/text-shimmer-BSzgEnDH.js +1 -0
- package/dist/textarea-DrYNt_0z.js +1 -0
- package/dist/theme.tokens.css +22 -21
- package/dist/{thumbs-up-CsT9Wzb9.js → thumbs-up-BL3-NenK.js} +1 -1
- package/dist/{toast-store-tgK6MuMv.js → toast-store-DkOlYczt.js} +1 -1
- package/dist/{tool-DzUjIBT8.js → tool-CeIWUVUe.js} +1 -1
- package/dist/{tooltip-Bkkg_4t0.js → tooltip-GA-nmg06.js} +1 -1
- package/dist/{trash-2-jBKxjGGQ.js → trash-2-CT66QWlm.js} +1 -1
- package/dist/{triangle-alert-DlQ68ppf.js → triangle-alert-CeHLWxhD.js} +1 -1
- package/dist/ui/color-field.d.ts +48 -0
- package/dist/ui/textarea.d.ts +4 -0
- package/dist/ui/toggle-chip.d.ts +40 -0
- package/dist/{upload-TcAHXv9W.js → upload-9Csb0F0J.js} +1 -1
- package/dist/{use-card-resolution-DaZqAdWf.js → use-card-resolution-Zg0a08Z-.js} +1 -1
- package/dist/{variant-aurora-DbW_OWL2.js → variant-aurora-4VBQHIKV.js} +1 -1
- package/dist/{variant-aurora-CNmfHhcx.js → variant-aurora-DBeCAQNk.js} +2 -2
- package/dist/{variant-aurora-D6GsdTPA.js → variant-aurora-FzHVXHby.js} +2 -2
- package/dist/{variant-aurora-BhLuYxJR.js → variant-aurora-LE3fqxgw.js} +1 -1
- package/dist/{variant-custom-BvYHR62b.js → variant-custom-AFRGcOBS.js} +1 -1
- package/dist/{variant-custom-DV2x254s.js → variant-custom-BQkNuPpE.js} +2 -2
- package/dist/{variant-custom-BRvaNHSi.js → variant-custom-DI5R0rln.js} +1 -1
- package/dist/{variant-custom-DMTrEO5w.js → variant-custom-WWnrrRHS.js} +2 -2
- package/dist/{variant-wave-CyBueXj9.js → variant-wave-DUCbH5oI.js} +2 -2
- package/dist/{variant-wave-BNMGrDfj.js → variant-wave-DuQV7DhQ.js} +2 -2
- package/dist/{variant-wave-BpDd8t3Z.js → variant-wave-nSI2sfII.js} +1 -1
- package/dist/{variant-wave-sp-qwsdI.js → variant-wave-wTP5v_jU.js} +1 -1
- package/dist/x-eiO9V6J6.js +1 -0
- package/kit-base.css +311 -0
- package/package.json +17 -2
- package/solid.css +33 -0
- package/theme.css +39 -23
- package/dist/arrow-down-CjRU3JgV.js +0 -1
- package/dist/arrow-left-Bnpb1UEW.js +0 -1
- package/dist/artifact-Bwt7OgcR.js +0 -1
- package/dist/check-njkVdZu2.js +0 -1
- package/dist/chevron-down-B72s6PXR.js +0 -1
- package/dist/chevron-right-BatuHzUm.js +0 -1
- package/dist/circle-check-B62pODB3.js +0 -1
- package/dist/circle-zx0ByzY9.js +0 -1
- package/dist/controllable-CnGpMF6r.js +0 -1
- package/dist/define-By-uL588.js +0 -1
- package/dist/loader-BM4CEz4G.js +0 -1
- package/dist/message-circle-DruwObfX.js +0 -1
- package/dist/message-square-BG6q6mlm.js +0 -1
- package/dist/play-BvKKq3fX.js +0 -1
- package/dist/register-impl-B1hLkrI8.js +0 -424
- package/dist/text-shimmer-Dcj1MHuq.js +0 -1
- package/dist/textarea-Dpvbngbg.js +0 -1
- package/dist/x-Z5UntkIJ.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{q as ve,s as pe,k as S,g as be,j as M,x as F,o as xe,c as l,E as ke,S as b,m as U,i as u,a as z,b as j,F as Q,d as m,w as ye,t as x,e as we}from"./define-By-uL588.js";import{c as q}from"./cn-DN5AWfiS.js";import{B as de}from"./button-DkuOnGLy.js";import{C as se}from"./checkbox-D7iRB3nL.js";import{P as Ce}from"./progress-bar-jVAHvMUf.js";import{u as Se,a as Ie,C as W,D as Te}from"./use-card-resolution-DaZqAdWf.js";import{e as $e}from"./card-routing-0YidER_3.js";import{c as Ee}from"./circle-check-B62pODB3.js";import{c as Re}from"./check-njkVdZu2.js";import{c as Ae}from"./circle-zx0ByzY9.js";var Ne=x('<p class="pt-1 text-xs text-muted-foreground">Up to <!> selected.'),ze=x('<div role=group><div class="divide-y divide-border overflow-hidden rounded-lg border border-border">'),Le=x("<span class=sr-only>"),Ve=x('<div class="flex w-full flex-wrap items-center justify-between gap-2"><span aria-live=polite class="text-xs text-muted-foreground"> selected</span><div class="ml-auto flex items-center gap-2">'),je=x("<label><span>Select all"),oe=x('<span class="text-xs font-normal text-muted-foreground">'),qe=x('<label><span class="flex flex-col gap-0.5"><span>'),Be=x('<div class="flex items-center justify-between gap-3"><span class="text-title font-semibold tracking-tight text-foreground"></span><span aria-live=polite class="shrink-0 text-sm font-medium tabular-nums text-muted-foreground"> / '),De=x('<p class="text-xs text-muted-foreground">Up to <!> selected.'),Me=x('<div><ul class="flex flex-col gap-1">'),Ue=x('<div class="grid grid-rows-[0fr] group-hover:grid-rows-[1fr] group-focus-within:grid-rows-[1fr] motion-safe:transition-[grid-template-rows] motion-safe:duration-200"><span class="overflow-hidden text-xs font-normal text-muted-foreground opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 motion-safe:transition-opacity">'),_e=x('<li><label><input type=checkbox class=sr-only><span aria-hidden=true></span><span class="flex min-w-0 flex-col gap-0.5"><span>'),Pe=x('<ul class="list-disc pl-5 text-sm text-foreground">'),Fe=x('<div class="flex flex-col gap-2"><p class="flex items-center gap-2 text-sm font-medium text-foreground"><span>Selected <!> of '),Oe=x('<p class="text-sm text-muted-foreground">None selected'),Ge=x("<li>");const He="tasks";function Je(e){if(!Array.isArray(e)||e.length===0)return{tasks:[],error:"This card couldn't be displayed."};const s=new Set,t=[];for(const o of e){if(!o||typeof o!="object")continue;const d=o;if(!(typeof d.id!="string"||d.id.length===0)&&!(typeof d.label!="string"||d.label.length===0)){if(s.has(d.id)){console.warn(`[kai-tasks] duplicate task id "${d.id}" ignored`);continue}s.add(d.id),t.push({id:d.id,label:d.label,description:typeof d.description=="string"?d.description:void 0,checked:d.checked===!0,disabled:d.disabled===!0})}}return t.length===0?{tasks:[],error:"This card couldn't be displayed."}:{tasks:t}}function Ke(e){return e.filter(s=>s.checked).map(s=>s.id)}function le(e,s){return e.filter(t=>s.has(t.id)).map(t=>t.id)}function O(e){return e.filter(s=>!s.disabled).map(s=>s.id)}function Qe(e,s){const t=O(e);if(t.length===0)return"unchecked";const o=t.filter(d=>s.has(d)).length;return o===0?"unchecked":o===t.length?"checked":"indeterminate"}function We(e,s){if(e.selectAll!==!0)return!1;const t=O(s).length;return!(e.max!==void 0&&t>e.max)}function Xe(e){return e.mode==="progress"}function Ye(e,s){return{done:e.filter(t=>s.has(t.id)).length,total:e.length}}function ue(e,s){const t=e.min??(e.allowEmpty?0:1);return!(s<t||e.max!==void 0&&s>e.max)}function X(e,s){return e.max!==void 0&&s>=e.max}function Ze(e,s){if(ue(e,s))return;const t=e.min??(e.allowEmpty?0:1);if(s<t)return`Select at least ${t}.`;if(e.max!==void 0&&s>e.max)return`Select at most ${e.max}.`}const et={tasks:[]};function tt(e){const s=ve({cardId:"kai-tasks"},e),[t]=pe(s,["data","cardId","heading","host","hostElement","class","resolution","value","defaultValue","disabled","readonly","onValueChange","controllerRef"]),o=Se(),d=ye(),f=r=>{const a=t.host??o;a?a.emit(r):t.hostElement&&$e(t.hostElement,r)},v=S(()=>{var r;return Je((r=t.data)==null?void 0:r.tasks)}),C=S(()=>v().error===void 0),k=S(()=>v().error??""),h=S(()=>v().tasks),p=S(()=>t.data??et),[w,A]=be(new Set),i=Ie({prop:()=>t.resolution,data:()=>t.data}),R=r=>{const a=new Set(h().map(n=>n.id));return r.filter(n=>a.has(n))};M(F(()=>t.data,()=>{const r=t.value??t.defaultValue??Ke(h());A(new Set(R(r)))})),M(F(()=>t.value,r=>{r&&A(new Set(R(r)))},{defer:!0})),M(F(w,r=>{var a;(a=t.onValueChange)==null||a.call(t,{value:le(h(),r)})},{defer:!0})),M(F(C,r=>{f(r?{kind:"ready",cardId:t.cardId}:{kind:"error",cardId:t.cardId,message:k()})}));const $=()=>t.disabled===!0,y=()=>t.readonly===!0,N=S(()=>w().size),L=S(()=>Xe(p())),D=S(()=>Ye(h(),w())),_=()=>p().confirmLabel??"Confirm",V=S(()=>Qe(h(),w())),P=S(()=>We(p(),h())),B=S(()=>Ze(p(),N())),G=S(()=>ue(p(),N())&&!i.isResolved()&&!$()&&!y()),Y=(r,a,n)=>{if(n){if(X(p(),r.size)&&!r.has(a))return r;r.add(a)}else r.delete(a);return r},H=(r,a)=>{i.isResolved()||$()||y()||A(Y(new Set(w()),r,a))},Z=r=>{if(i.isResolved()||$()||y())return;const a=new Set(w());for(const n of O(h()))r?a.add(n):a.delete(n);A(a)},J=()=>{if(!G())return;const r={selected:le(h(),w())};f({kind:"submit",cardId:t.cardId,data:r}),i.setLocal({kind:"submit",data:r})},ee=()=>{i.isResolved()||(f({kind:"dismiss",cardId:t.cardId}),i.setLocal({kind:"dismissed"}))},te=()=>f({kind:"reopen",cardId:t.cardId});xe(()=>{var r;(r=t.controllerRef)==null||r.call(t,{select:a=>{if(i.isResolved()||$()||y())return;if(a===void 0){Z(!0);return}const n=new Set,g=new Set(O(h()));for(const c of R(a))g.has(c)&&Y(n,c,!0);A(n)},toggle:(a,n)=>{const g=n??!w().has(a);H(a,g)},send:()=>J(),focus:a=>{var n,g;const c=(((n=t.hostElement)==null?void 0:n.shadowRoot)??document).querySelector('[role="group"]');(g=c?.querySelector('input[type="checkbox"]')??c)==null||g.focus(a)},dismiss:()=>ee(),reopen:()=>te()})}),M(()=>{var r;const a=t.hostElement;a&&(((r=i.resolution())==null?void 0:r.kind)==="submit"?a.setAttribute("data-kai-resolved","submitted"):a.removeAttribute("data-kai-resolved"))});const ce=S(()=>{var r;const a=i.resolution();if(!a||a.kind!=="submit")return;const n=(r=a.data)==null?void 0:r.selected,g=Array.isArray(n)?n:[],c=h(),E=c.filter(I=>g.includes(I.id)).map(I=>I.label);return{count:E.length,total:c.length,labels:E}}),re=`kai-tl-reason-${d}`,ge=`kai-tl-count-${d}`,fe=`kai-tl-progress-${d}`,he=`kai-tl-heading-${d}`,ne=()=>{var r;return t.heading??((r=t.data)==null?void 0:r.heading)};return l(b,{get when(){return C()},get fallback(){return l(W,{get heading(){return t.heading},get errorMessage(){return k()}})},get children(){return l(ke,{fallback:()=>(f({kind:"error",cardId:t.cardId,message:"The card failed to render."}),l(W,{get heading(){return t.heading},errorMessage:"The card failed to render."})),get children(){return l(b,{get when(){return!i.isDeferred()},get fallback(){return l(Te,{type:He,get title(){var r;return t.heading??((r=t.data)==null?void 0:r.heading)},onReopen:te})},get children(){return l(W,{get heading(){return U(()=>!!L())()?void 0:ne()},get actions(){return U(()=>!!(L()||i.isResolved()||y()))()?void 0:(()=>{var r=Ve(),a=r.firstChild,n=a.firstChild,g=a.nextSibling;return u(r,l(b,{get when(){var c;return((c=t.data)==null?void 0:c.dismissible)===!0},get children(){return l(de,{type:"button",variant:"ghost","aria-label":"Dismiss",onClick:ee,children:"Dismiss"})}}),a),m(a,"id",ge),u(a,N,n),u(g,l(b,{get when(){return B()},get children(){var c=Le();return m(c,"id",re),u(c,B),c}}),null),u(g,l(de,{type:"button",get disabled(){return!G()},get"aria-describedby"(){return B()?re:void 0},onClick:J,get children(){return _()}}),null),r})()},get children(){return l(b,{get when(){return!i.isResolved()},get fallback(){return l(nt,{get summary(){return ce()},get optimistic(){return i.isOptimistic()}})},get children(){return[l(b,{get when(){return L()},get children(){return l(rt,{get heading(){return ne()},headingId:he,countId:fe,get done(){return D().done},get total(){return D().total},get tasks(){return h()},uid:d,isChecked:r=>w().has(r),isBlocked:r=>$()||r.disabled===!0||!w().has(r.id)&&X(p(),N()),onToggle:(r,a)=>H(r,a),get groupClass(){return t.class},get maxNote(){return U(()=>p().max!==void 0)()?p().max:void 0},get readonly(){return y()}})}}),l(b,{get when(){return!L()},get children(){var r=ze(),a=r.firstChild;return r.$$keydown=n=>{n.key!=="Enter"||n.target.tagName==="INPUT"||G()&&J()},u(a,l(b,{get when(){return P()},get children(){return(()=>{const n=()=>V()==="indeterminate";return(()=>{var g=je(),c=g.firstChild;return u(g,l(se,{get checked(){return V()==="checked"},get disabled(){return $()||y()},get indeterminate(){return n()},get"aria-checked"(){return U(()=>!!n())()?"mixed":V()==="checked"},onChange:E=>Z(E.currentTarget.checked)}),c),z(()=>j(g,q("flex items-center gap-3 px-3 py-2.5 text-sm font-medium transition-colors",y()?"cursor-default":"cursor-pointer",V()==="checked"?"bg-accent text-accent-foreground":y()?"text-foreground":"text-foreground hover:bg-muted/50"))),g})()})()}}),null),u(a,l(Q,{get each(){return h()},children:n=>{const g=()=>w().has(n.id),c=()=>$()||n.disabled||!g()&&X(p(),N()),E=`kai-tl-desc-${d}-${n.id}`;return(()=>{var I=qe(),K=I.firstChild,me=K.firstChild;return u(I,l(se,{class:"mt-0.5",get checked(){return g()},get disabled(){return c()||y()},get"aria-disabled"(){return c()?"true":void 0},get"aria-describedby"(){return n.description?E:void 0},onChange:T=>H(n.id,T.currentTarget.checked)}),K),u(me,()=>n.label),u(K,l(b,{get when(){return n.description},get children(){var T=oe();return m(T,"id",E),u(T,()=>n.description),T}}),null),z(T=>{var ie=q("flex items-start gap-3 px-3 py-2.5 text-sm transition-colors",y()?"cursor-default":c()?"cursor-not-allowed opacity-60":"cursor-pointer hover:bg-muted/50",g()&&!c()?"bg-accent font-medium text-accent-foreground":"text-foreground"),ae=n.id;return ie!==T.e&&j(I,T.e=ie),ae!==T.t&&m(I,"data-task-id",T.t=ae),T},{e:void 0,t:void 0}),I})()}}),null),u(r,l(b,{get when(){return p().max!==void 0},get children(){var n=Ne(),g=n.firstChild,c=g.nextSibling;return c.nextSibling,u(n,()=>p().max,c),n}}),null),z(n=>{var g,c=t.heading??((g=t.data)==null?void 0:g.heading)??"Tasks",E=y()?"true":void 0,I=q("flex flex-col",t.class);return c!==n.e&&m(r,"aria-label",n.e=c),E!==n.t&&m(r,"aria-readonly",n.t=E),I!==n.a&&j(r,n.a=I),n},{e:void 0,t:void 0,a:void 0}),r}})]}})}})}})}})}})}function rt(e){return(()=>{var s=Me(),t=s.firstChild;return u(s,l(b,{get when(){return e.heading},get children(){var o=Be(),d=o.firstChild,f=d.nextSibling,v=f.firstChild;return u(d,()=>e.heading),u(f,()=>e.done,v),u(f,()=>e.total,null),z(C=>{var k=e.headingId,h=e.countId;return k!==C.e&&m(d,"id",C.e=k),h!==C.t&&m(f,"id",C.t=h),C},{e:void 0,t:void 0}),o}}),t),u(s,l(Ce,{get value(){return e.done},get max(){return e.total},tone:"success",get"aria-labelledby"(){return U(()=>!!e.heading)()?e.headingId:void 0},get"aria-label"(){return e.heading?void 0:"Task progress"}}),t),u(t,l(Q,{get each(){return e.tasks},children:o=>{const d=()=>e.isChecked(o.id),f=()=>e.isBlocked(o),v=`kai-tl-pdesc-${e.uid}-${o.id}`;return(()=>{var C=_e(),k=C.firstChild,h=k.firstChild,p=h.nextSibling,w=p.nextSibling,A=w.firstChild;return h.addEventListener("change",i=>e.onToggle(o.id,i.currentTarget.checked)),u(p,l(b,{get when(){return d()},get fallback(){return l(Ae,{size:18})},get children(){return l(Ee,{size:18,class:"text-foreground"})}})),u(A,()=>o.label),u(w,l(b,{get when(){return o.description},get children(){return l(b,{get when(){return d()},get fallback(){return(()=>{var i=oe();return m(i,"id",v),u(i,()=>o.description),i})()},get children(){var i=Ue(),R=i.firstChild;return m(R,"id",v),u(R,()=>o.description),i}})}}),null),z(i=>{var R=q("group flex items-start gap-3 rounded-lg px-2.5 py-2 text-sm transition-colors",!e.readonly&&"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring",!e.readonly&&"has-[:focus-visible]:outline-none has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-inset has-[:focus-visible]:ring-ring",e.readonly?"cursor-default":f()?"cursor-not-allowed opacity-60":"cursor-pointer hover:bg-muted/50"),$=o.id,y=!e.readonly&&d()?0:void 0,N=d()?o.label:void 0,L=d()&&o.description?v:void 0,D=f()||e.readonly,_=f()?"true":void 0,V=o.description?v:void 0,P=q("mt-0.5 shrink-0 text-muted-foreground",d()&&"motion-safe:transition-transform motion-safe:group-hover:scale-110"),B=q("font-medium text-foreground",d()&&"line-through opacity-70 motion-safe:transition-opacity motion-safe:group-hover:opacity-100");return R!==i.e&&j(k,i.e=R),$!==i.t&&m(k,"data-task-id",i.t=$),y!==i.a&&m(k,"tabindex",i.a=y),N!==i.o&&m(k,"aria-label",i.o=N),L!==i.i&&m(k,"aria-describedby",i.i=L),D!==i.n&&(h.disabled=i.n=D),_!==i.s&&m(h,"aria-disabled",i.s=_),V!==i.h&&m(h,"aria-describedby",i.h=V),P!==i.r&&j(p,i.r=P),B!==i.d&&j(A,i.d=B),i},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0}),z(()=>h.checked=d()),C})()}})),u(s,l(b,{get when(){return e.maxNote!==void 0},get children(){var o=De(),d=o.firstChild,f=d.nextSibling;return f.nextSibling,u(o,()=>e.maxNote,f),o}}),null),z(o=>{var d=q("flex flex-col gap-3",e.groupClass),f=e.heading?e.headingId:void 0,v=e.heading?void 0:"Checklist";return d!==o.e&&j(s,o.e=d),f!==o.t&&m(t,"aria-labelledby",o.t=f),v!==o.a&&m(t,"aria-label",o.a=v),o},{e:void 0,t:void 0,a:void 0}),s})()}function nt(e){return(()=>{var s=Fe(),t=s.firstChild,o=t.firstChild,d=o.firstChild,f=d.nextSibling;return f.nextSibling,u(t,l(Re,{size:16,"aria-hidden":"true"}),o),u(o,()=>e.summary.count,f),u(o,()=>e.summary.total,null),u(s,l(b,{get when(){return e.summary.labels.length>0},get fallback(){return Oe()},get children(){var v=Pe();return u(v,l(Q,{get each(){return e.summary.labels},children:C=>(()=>{var k=Ge();return u(k,C),k})()})),v}}),null),z(()=>m(s,"role",e.optimistic?"status":void 0)),s})()}we(["keydown"]);export{tt as T};
|
|
1
|
+
import{q as ve,s as pe,k as S,g as be,j as M,x as F,o as xe,c as l,E as ke,S as b,m as U,i as u,a as z,b as j,F as Q,d as m,w as ye,t as x,e as we}from"./define-CI0y3eE4.js";import{c as q}from"./cn-DN5AWfiS.js";import{B as de}from"./button-C_3te6fm.js";import{C as se}from"./checkbox-Bu2T2e0U.js";import{P as Ce}from"./progress-bar-CiBtxMWT.js";import{u as Se,a as Ie,C as W,D as Te}from"./use-card-resolution-Zg0a08Z-.js";import{e as $e}from"./card-routing-0YidER_3.js";import{c as Ee}from"./circle-check-BqmahW0O.js";import{c as Re}from"./check-CiEOVnEN.js";import{c as Ae}from"./circle-BC66EYF7.js";var Ne=x('<p class="pt-1 text-xs text-muted-foreground">Up to <!> selected.'),ze=x('<div role=group><div class="divide-y divide-border overflow-hidden rounded-lg border border-border">'),Le=x("<span class=sr-only>"),Ve=x('<div class="flex w-full flex-wrap items-center justify-between gap-2"><span aria-live=polite class="text-xs text-muted-foreground"> selected</span><div class="ml-auto flex items-center gap-2">'),je=x("<label><span>Select all"),oe=x('<span class="text-xs font-normal text-muted-foreground">'),qe=x('<label><span class="flex flex-col gap-0.5"><span>'),Be=x('<div class="flex items-center justify-between gap-3"><span class="text-title font-semibold tracking-tight text-foreground"></span><span aria-live=polite class="shrink-0 text-sm font-medium tabular-nums text-muted-foreground"> / '),De=x('<p class="text-xs text-muted-foreground">Up to <!> selected.'),Me=x('<div><ul class="flex flex-col gap-1">'),Ue=x('<div class="grid grid-rows-[0fr] group-hover:grid-rows-[1fr] group-focus-within:grid-rows-[1fr] motion-safe:transition-[grid-template-rows] motion-safe:duration-200"><span class="overflow-hidden text-xs font-normal text-muted-foreground opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 motion-safe:transition-opacity">'),_e=x('<li><label><input type=checkbox class=sr-only><span aria-hidden=true></span><span class="flex min-w-0 flex-col gap-0.5"><span>'),Pe=x('<ul class="list-disc pl-5 text-sm text-foreground">'),Fe=x('<div class="flex flex-col gap-2"><p class="flex items-center gap-2 text-sm font-medium text-foreground"><span>Selected <!> of '),Oe=x('<p class="text-sm text-muted-foreground">None selected'),Ge=x("<li>");const He="tasks";function Je(e){if(!Array.isArray(e)||e.length===0)return{tasks:[],error:"This card couldn't be displayed."};const s=new Set,t=[];for(const o of e){if(!o||typeof o!="object")continue;const d=o;if(!(typeof d.id!="string"||d.id.length===0)&&!(typeof d.label!="string"||d.label.length===0)){if(s.has(d.id)){console.warn(`[kai-tasks] duplicate task id "${d.id}" ignored`);continue}s.add(d.id),t.push({id:d.id,label:d.label,description:typeof d.description=="string"?d.description:void 0,checked:d.checked===!0,disabled:d.disabled===!0})}}return t.length===0?{tasks:[],error:"This card couldn't be displayed."}:{tasks:t}}function Ke(e){return e.filter(s=>s.checked).map(s=>s.id)}function le(e,s){return e.filter(t=>s.has(t.id)).map(t=>t.id)}function O(e){return e.filter(s=>!s.disabled).map(s=>s.id)}function Qe(e,s){const t=O(e);if(t.length===0)return"unchecked";const o=t.filter(d=>s.has(d)).length;return o===0?"unchecked":o===t.length?"checked":"indeterminate"}function We(e,s){if(e.selectAll!==!0)return!1;const t=O(s).length;return!(e.max!==void 0&&t>e.max)}function Xe(e){return e.mode==="progress"}function Ye(e,s){return{done:e.filter(t=>s.has(t.id)).length,total:e.length}}function ue(e,s){const t=e.min??(e.allowEmpty?0:1);return!(s<t||e.max!==void 0&&s>e.max)}function X(e,s){return e.max!==void 0&&s>=e.max}function Ze(e,s){if(ue(e,s))return;const t=e.min??(e.allowEmpty?0:1);if(s<t)return`Select at least ${t}.`;if(e.max!==void 0&&s>e.max)return`Select at most ${e.max}.`}const et={tasks:[]};function tt(e){const s=ve({cardId:"kai-tasks"},e),[t]=pe(s,["data","cardId","heading","host","hostElement","class","resolution","value","defaultValue","disabled","readonly","onValueChange","controllerRef"]),o=Se(),d=ye(),f=r=>{const a=t.host??o;a?a.emit(r):t.hostElement&&$e(t.hostElement,r)},v=S(()=>{var r;return Je((r=t.data)==null?void 0:r.tasks)}),C=S(()=>v().error===void 0),k=S(()=>v().error??""),h=S(()=>v().tasks),p=S(()=>t.data??et),[w,A]=be(new Set),i=Ie({prop:()=>t.resolution,data:()=>t.data}),R=r=>{const a=new Set(h().map(n=>n.id));return r.filter(n=>a.has(n))};M(F(()=>t.data,()=>{const r=t.value??t.defaultValue??Ke(h());A(new Set(R(r)))})),M(F(()=>t.value,r=>{r&&A(new Set(R(r)))},{defer:!0})),M(F(w,r=>{var a;(a=t.onValueChange)==null||a.call(t,{value:le(h(),r)})},{defer:!0})),M(F(C,r=>{f(r?{kind:"ready",cardId:t.cardId}:{kind:"error",cardId:t.cardId,message:k()})}));const $=()=>t.disabled===!0,y=()=>t.readonly===!0,N=S(()=>w().size),L=S(()=>Xe(p())),D=S(()=>Ye(h(),w())),_=()=>p().confirmLabel??"Confirm",V=S(()=>Qe(h(),w())),P=S(()=>We(p(),h())),B=S(()=>Ze(p(),N())),G=S(()=>ue(p(),N())&&!i.isResolved()&&!$()&&!y()),Y=(r,a,n)=>{if(n){if(X(p(),r.size)&&!r.has(a))return r;r.add(a)}else r.delete(a);return r},H=(r,a)=>{i.isResolved()||$()||y()||A(Y(new Set(w()),r,a))},Z=r=>{if(i.isResolved()||$()||y())return;const a=new Set(w());for(const n of O(h()))r?a.add(n):a.delete(n);A(a)},J=()=>{if(!G())return;const r={selected:le(h(),w())};f({kind:"submit",cardId:t.cardId,data:r}),i.setLocal({kind:"submit",data:r})},ee=()=>{i.isResolved()||(f({kind:"dismiss",cardId:t.cardId}),i.setLocal({kind:"dismissed"}))},te=()=>f({kind:"reopen",cardId:t.cardId});xe(()=>{var r;(r=t.controllerRef)==null||r.call(t,{select:a=>{if(i.isResolved()||$()||y())return;if(a===void 0){Z(!0);return}const n=new Set,g=new Set(O(h()));for(const c of R(a))g.has(c)&&Y(n,c,!0);A(n)},toggle:(a,n)=>{const g=n??!w().has(a);H(a,g)},send:()=>J(),focus:a=>{var n,g;const c=(((n=t.hostElement)==null?void 0:n.shadowRoot)??document).querySelector('[role="group"]');(g=c?.querySelector('input[type="checkbox"]')??c)==null||g.focus(a)},dismiss:()=>ee(),reopen:()=>te()})}),M(()=>{var r;const a=t.hostElement;a&&(((r=i.resolution())==null?void 0:r.kind)==="submit"?a.setAttribute("data-kai-resolved","submitted"):a.removeAttribute("data-kai-resolved"))});const ce=S(()=>{var r;const a=i.resolution();if(!a||a.kind!=="submit")return;const n=(r=a.data)==null?void 0:r.selected,g=Array.isArray(n)?n:[],c=h(),E=c.filter(I=>g.includes(I.id)).map(I=>I.label);return{count:E.length,total:c.length,labels:E}}),re=`kai-tl-reason-${d}`,ge=`kai-tl-count-${d}`,fe=`kai-tl-progress-${d}`,he=`kai-tl-heading-${d}`,ne=()=>{var r;return t.heading??((r=t.data)==null?void 0:r.heading)};return l(b,{get when(){return C()},get fallback(){return l(W,{get heading(){return t.heading},get errorMessage(){return k()}})},get children(){return l(ke,{fallback:()=>(f({kind:"error",cardId:t.cardId,message:"The card failed to render."}),l(W,{get heading(){return t.heading},errorMessage:"The card failed to render."})),get children(){return l(b,{get when(){return!i.isDeferred()},get fallback(){return l(Te,{type:He,get title(){var r;return t.heading??((r=t.data)==null?void 0:r.heading)},onReopen:te})},get children(){return l(W,{get heading(){return U(()=>!!L())()?void 0:ne()},get actions(){return U(()=>!!(L()||i.isResolved()||y()))()?void 0:(()=>{var r=Ve(),a=r.firstChild,n=a.firstChild,g=a.nextSibling;return u(r,l(b,{get when(){var c;return((c=t.data)==null?void 0:c.dismissible)===!0},get children(){return l(de,{type:"button",variant:"ghost","aria-label":"Dismiss",onClick:ee,children:"Dismiss"})}}),a),m(a,"id",ge),u(a,N,n),u(g,l(b,{get when(){return B()},get children(){var c=Le();return m(c,"id",re),u(c,B),c}}),null),u(g,l(de,{type:"button",get disabled(){return!G()},get"aria-describedby"(){return B()?re:void 0},onClick:J,get children(){return _()}}),null),r})()},get children(){return l(b,{get when(){return!i.isResolved()},get fallback(){return l(nt,{get summary(){return ce()},get optimistic(){return i.isOptimistic()}})},get children(){return[l(b,{get when(){return L()},get children(){return l(rt,{get heading(){return ne()},headingId:he,countId:fe,get done(){return D().done},get total(){return D().total},get tasks(){return h()},uid:d,isChecked:r=>w().has(r),isBlocked:r=>$()||r.disabled===!0||!w().has(r.id)&&X(p(),N()),onToggle:(r,a)=>H(r,a),get groupClass(){return t.class},get maxNote(){return U(()=>p().max!==void 0)()?p().max:void 0},get readonly(){return y()}})}}),l(b,{get when(){return!L()},get children(){var r=ze(),a=r.firstChild;return r.$$keydown=n=>{n.key!=="Enter"||n.target.tagName==="INPUT"||G()&&J()},u(a,l(b,{get when(){return P()},get children(){return(()=>{const n=()=>V()==="indeterminate";return(()=>{var g=je(),c=g.firstChild;return u(g,l(se,{get checked(){return V()==="checked"},get disabled(){return $()||y()},get indeterminate(){return n()},get"aria-checked"(){return U(()=>!!n())()?"mixed":V()==="checked"},onChange:E=>Z(E.currentTarget.checked)}),c),z(()=>j(g,q("flex items-center gap-3 px-3 py-2.5 text-sm font-medium transition-colors",y()?"cursor-default":"cursor-pointer",V()==="checked"?"bg-accent text-accent-foreground":y()?"text-foreground":"text-foreground hover:bg-muted/50"))),g})()})()}}),null),u(a,l(Q,{get each(){return h()},children:n=>{const g=()=>w().has(n.id),c=()=>$()||n.disabled||!g()&&X(p(),N()),E=`kai-tl-desc-${d}-${n.id}`;return(()=>{var I=qe(),K=I.firstChild,me=K.firstChild;return u(I,l(se,{class:"mt-0.5",get checked(){return g()},get disabled(){return c()||y()},get"aria-disabled"(){return c()?"true":void 0},get"aria-describedby"(){return n.description?E:void 0},onChange:T=>H(n.id,T.currentTarget.checked)}),K),u(me,()=>n.label),u(K,l(b,{get when(){return n.description},get children(){var T=oe();return m(T,"id",E),u(T,()=>n.description),T}}),null),z(T=>{var ie=q("flex items-start gap-3 px-3 py-2.5 text-sm transition-colors",y()?"cursor-default":c()?"cursor-not-allowed opacity-60":"cursor-pointer hover:bg-muted/50",g()&&!c()?"bg-accent font-medium text-accent-foreground":"text-foreground"),ae=n.id;return ie!==T.e&&j(I,T.e=ie),ae!==T.t&&m(I,"data-task-id",T.t=ae),T},{e:void 0,t:void 0}),I})()}}),null),u(r,l(b,{get when(){return p().max!==void 0},get children(){var n=Ne(),g=n.firstChild,c=g.nextSibling;return c.nextSibling,u(n,()=>p().max,c),n}}),null),z(n=>{var g,c=t.heading??((g=t.data)==null?void 0:g.heading)??"Tasks",E=y()?"true":void 0,I=q("flex flex-col",t.class);return c!==n.e&&m(r,"aria-label",n.e=c),E!==n.t&&m(r,"aria-readonly",n.t=E),I!==n.a&&j(r,n.a=I),n},{e:void 0,t:void 0,a:void 0}),r}})]}})}})}})}})}})}function rt(e){return(()=>{var s=Me(),t=s.firstChild;return u(s,l(b,{get when(){return e.heading},get children(){var o=Be(),d=o.firstChild,f=d.nextSibling,v=f.firstChild;return u(d,()=>e.heading),u(f,()=>e.done,v),u(f,()=>e.total,null),z(C=>{var k=e.headingId,h=e.countId;return k!==C.e&&m(d,"id",C.e=k),h!==C.t&&m(f,"id",C.t=h),C},{e:void 0,t:void 0}),o}}),t),u(s,l(Ce,{get value(){return e.done},get max(){return e.total},tone:"success",get"aria-labelledby"(){return U(()=>!!e.heading)()?e.headingId:void 0},get"aria-label"(){return e.heading?void 0:"Task progress"}}),t),u(t,l(Q,{get each(){return e.tasks},children:o=>{const d=()=>e.isChecked(o.id),f=()=>e.isBlocked(o),v=`kai-tl-pdesc-${e.uid}-${o.id}`;return(()=>{var C=_e(),k=C.firstChild,h=k.firstChild,p=h.nextSibling,w=p.nextSibling,A=w.firstChild;return h.addEventListener("change",i=>e.onToggle(o.id,i.currentTarget.checked)),u(p,l(b,{get when(){return d()},get fallback(){return l(Ae,{size:18})},get children(){return l(Ee,{size:18,class:"text-foreground"})}})),u(A,()=>o.label),u(w,l(b,{get when(){return o.description},get children(){return l(b,{get when(){return d()},get fallback(){return(()=>{var i=oe();return m(i,"id",v),u(i,()=>o.description),i})()},get children(){var i=Ue(),R=i.firstChild;return m(R,"id",v),u(R,()=>o.description),i}})}}),null),z(i=>{var R=q("group flex items-start gap-3 rounded-lg px-2.5 py-2 text-sm transition-colors",!e.readonly&&"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring",!e.readonly&&"has-[:focus-visible]:outline-none has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-inset has-[:focus-visible]:ring-ring",e.readonly?"cursor-default":f()?"cursor-not-allowed opacity-60":"cursor-pointer hover:bg-muted/50"),$=o.id,y=!e.readonly&&d()?0:void 0,N=d()?o.label:void 0,L=d()&&o.description?v:void 0,D=f()||e.readonly,_=f()?"true":void 0,V=o.description?v:void 0,P=q("mt-0.5 shrink-0 text-muted-foreground",d()&&"motion-safe:transition-transform motion-safe:group-hover:scale-110"),B=q("font-medium text-foreground",d()&&"line-through opacity-70 motion-safe:transition-opacity motion-safe:group-hover:opacity-100");return R!==i.e&&j(k,i.e=R),$!==i.t&&m(k,"data-task-id",i.t=$),y!==i.a&&m(k,"tabindex",i.a=y),N!==i.o&&m(k,"aria-label",i.o=N),L!==i.i&&m(k,"aria-describedby",i.i=L),D!==i.n&&(h.disabled=i.n=D),_!==i.s&&m(h,"aria-disabled",i.s=_),V!==i.h&&m(h,"aria-describedby",i.h=V),P!==i.r&&j(p,i.r=P),B!==i.d&&j(A,i.d=B),i},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0}),z(()=>h.checked=d()),C})()}})),u(s,l(b,{get when(){return e.maxNote!==void 0},get children(){var o=De(),d=o.firstChild,f=d.nextSibling;return f.nextSibling,u(o,()=>e.maxNote,f),o}}),null),z(o=>{var d=q("flex flex-col gap-3",e.groupClass),f=e.heading?e.headingId:void 0,v=e.heading?void 0:"Checklist";return d!==o.e&&j(s,o.e=d),f!==o.t&&m(t,"aria-labelledby",o.t=f),v!==o.a&&m(t,"aria-label",o.a=v),o},{e:void 0,t:void 0,a:void 0}),s})()}function nt(e){return(()=>{var s=Fe(),t=s.firstChild,o=t.firstChild,d=o.firstChild,f=d.nextSibling;return f.nextSibling,u(t,l(Re,{size:16,"aria-hidden":"true"}),o),u(o,()=>e.summary.count,f),u(o,()=>e.summary.total,null),u(s,l(b,{get when(){return e.summary.labels.length>0},get fallback(){return Oe()},get children(){var v=Pe();return u(v,l(Q,{get each(){return e.summary.labels},children:C=>(()=>{var k=Ge();return u(k,C),k})()})),v}}),null),z(()=>m(s,"role",e.optimistic?"status":void 0)),s})()}we(["keydown"]);export{tt as T};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{s as o,c as i,q as s,D as c}from"./define-CI0y3eE4.js";import{c as m}from"./cn-DN5AWfiS.js";function u(a){const[r,e]=o(a,["as","class","duration","spread","children"]),t=()=>Math.min(Math.max(r.spread??20,5),45),n=()=>r.as??"span";return i(c,s({get component(){return n()},get class(){return m("bg-size-[200%_auto] bg-clip-text font-medium text-transparent","animate-[kai-shimmer_4s_infinite_linear]",r.class)},get style(){return{"background-image":`linear-gradient(to right, var(--color-muted-foreground) ${50-t()}%, var(--color-foreground) 50%, var(--color-muted-foreground) ${50+t()}%)`,"animation-duration":`${r.duration??4}s`}}},e,{get children(){return r.children}}))}export{u as T};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as u,s as l,j as g,x as f,u as m,p as h,q as d,t as p}from"./define-CI0y3eE4.js";import{c}from"./cn-DN5AWfiS.js";function v(n){const e=getComputedStyle(n);let t=parseFloat(e.lineHeight);Number.isNaN(t)&&(t=(parseFloat(e.fontSize)||14)*1.2);const o=(parseFloat(e.paddingTop)||0)+(parseFloat(e.paddingBottom)||0),s=(parseFloat(e.borderTopWidth)||0)+(parseFloat(e.borderBottomWidth)||0);return t+o+s}function x(n={}){let e,t;function o(){if(!e||e.offsetParent===null)return;e.style.height="auto";const r=e.scrollHeight,i=n.minHeight??v(e),a=Math.max(r,i);n.maxHeight&&a>n.maxHeight?(e.style.height=`${n.maxHeight}px`,e.style.overflowY="auto"):(e.style.height=`${a}px`,e.style.overflowY="hidden")}function s(r){e=r,r.addEventListener("input",o),requestAnimationFrame(o),typeof ResizeObserver<"u"&&(t=new ResizeObserver(()=>o()),t.observe(r)),u(()=>{r.removeEventListener("input",o),t?.disconnect()})}return{ref:s,resize:o}}var H=p("<textarea rows=1>");function b(n){const[e,t]=l(n,["class","maxHeight","minHeight","autoResize","value"]),{ref:o,resize:s}=x({maxHeight:e.maxHeight,minHeight:e.minHeight});return g(f(()=>e.value,()=>s(),{defer:!0})),(()=>{var r=H(),i=e.autoResize!==!1?o:void 0;return typeof i=="function"&&m(i,r),h(r,d({get class(){return c("w-full resize-none rounded-md bg-transparent text-sm text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",e.class)},get value(){return e.value}},t),!1,!1),r})()}export{b as T};
|
package/dist/theme.tokens.css
CHANGED
|
@@ -192,20 +192,18 @@
|
|
|
192
192
|
--text-lg: var(--kai-text-lg, 1.125rem); --text-lg--line-height: calc(1.75 / 1.125); /* 18px — section headings, lg prose */
|
|
193
193
|
}
|
|
194
194
|
|
|
195
|
-
@keyframes typing { 0%,100% { transform: translateY(0); opacity: .5 } 50% { transform: translateY(-2px); opacity: 1 } }
|
|
196
|
-
@keyframes loading-dots { 0%,100% { opacity: 0 } 50% { opacity: 1 } }
|
|
197
|
-
@keyframes wave { 0%,100% { transform: scaleY(1) } 50% { transform: scaleY(.6) } }
|
|
198
|
-
@keyframes blink { 0%,100% { opacity: 1 } 50% { opacity: 0 } }
|
|
199
|
-
@keyframes text-blink { 0%,100% { color: var(--color-primary) } 50% { color: var(--color-muted-foreground) } }
|
|
200
|
-
@keyframes bounce-dots { 0%,100% { transform: scale(.8); opacity: .5 } 50% { transform: scale(1.2); opacity: 1 } }
|
|
201
|
-
@keyframes thin-pulse { 0%,100% { transform: scale(.95); opacity: .8 } 50% { transform: scale(1.05); opacity: .4 } }
|
|
202
|
-
@keyframes pulse-dot { 0%,100% { transform: scale(1); opacity: .8 } 50% { transform: scale(1.5); opacity: 1 } }
|
|
203
|
-
@keyframes shimmer-text { 0% { background-position: 150% center } 100% { background-position: -150% center } }
|
|
204
|
-
@keyframes wave-bars { 0%,100% { transform: scaleY(1); opacity: .5 } 50% { transform: scaleY(.6); opacity: 1 } }
|
|
205
|
-
@keyframes shimmer { 0% { background-position: 200% 50% } 100% { background-position: -200% 50% } }
|
|
206
|
-
@keyframes spinner-fade { 0% { opacity: 0 } 100% { opacity: 1 } }
|
|
207
|
-
@keyframes collapsible-down { from { height: 0; opacity: 0 } to { height: var(--kb-collapsible-content-height); opacity: 1 } }
|
|
208
|
-
@keyframes collapsible-up { from { height: var(--kb-collapsible-content-height); opacity: 1 } to { height: 0; opacity: 0 } }
|
|
195
|
+
@keyframes kai-typing { 0%,100% { transform: translateY(0); opacity: .5 } 50% { transform: translateY(-2px); opacity: 1 } }
|
|
196
|
+
@keyframes kai-loading-dots { 0%,100% { opacity: 0 } 50% { opacity: 1 } }
|
|
197
|
+
@keyframes kai-wave { 0%,100% { transform: scaleY(1) } 50% { transform: scaleY(.6) } }
|
|
198
|
+
@keyframes kai-blink { 0%,100% { opacity: 1 } 50% { opacity: 0 } }
|
|
199
|
+
@keyframes kai-text-blink { 0%,100% { color: var(--color-primary) } 50% { color: var(--color-muted-foreground) } }
|
|
200
|
+
@keyframes kai-bounce-dots { 0%,100% { transform: scale(.8); opacity: .5 } 50% { transform: scale(1.2); opacity: 1 } }
|
|
201
|
+
@keyframes kai-thin-pulse { 0%,100% { transform: scale(.95); opacity: .8 } 50% { transform: scale(1.05); opacity: .4 } }
|
|
202
|
+
@keyframes kai-pulse-dot { 0%,100% { transform: scale(1); opacity: .8 } 50% { transform: scale(1.5); opacity: 1 } }
|
|
203
|
+
@keyframes kai-shimmer-text { 0% { background-position: 150% center } 100% { background-position: -150% center } }
|
|
204
|
+
@keyframes kai-wave-bars { 0%,100% { transform: scaleY(1); opacity: .5 } 50% { transform: scaleY(.6); opacity: 1 } }
|
|
205
|
+
@keyframes kai-shimmer { 0% { background-position: 200% 50% } 100% { background-position: -200% 50% } }
|
|
206
|
+
@keyframes kai-spinner-fade { 0% { opacity: 0 } 100% { opacity: 1 } }
|
|
209
207
|
.dark {
|
|
210
208
|
--color-background: var(--kai-color-background, hsl(50 2% 9%));
|
|
211
209
|
--color-foreground: var(--kai-color-foreground, hsl(0 0% 98%));
|
|
@@ -329,21 +327,24 @@
|
|
|
329
327
|
|
|
330
328
|
/* Cross-platform thin scrollbar utility (Firefox + WebKit). Used by ScrollArea
|
|
331
329
|
and any scroll region in the SolidJS-component build (web components also get
|
|
332
|
-
this globally inside their shadow root — see src/elements/styles.css).
|
|
333
|
-
|
|
330
|
+
this globally inside their shadow root — see src/elements/styles.css).
|
|
331
|
+
`kai-` prefixed because this file is merged into a consumer's Tailwind build
|
|
332
|
+
and `.scrollbar-thin` is a name they may well own (no consumer-facing doc ever
|
|
333
|
+
named the old unprefixed class, so no alias is kept). */
|
|
334
|
+
.kai-scrollbar-thin {
|
|
334
335
|
scrollbar-width: thin;
|
|
335
336
|
scrollbar-color: var(--color-scrollbar-thumb) transparent;
|
|
336
337
|
}
|
|
337
|
-
.scrollbar-thin::-webkit-scrollbar { width: 8px; height: 8px; }
|
|
338
|
-
.scrollbar-thin::-webkit-scrollbar-track { background: transparent; }
|
|
339
|
-
.scrollbar-thin::-webkit-scrollbar-thumb {
|
|
338
|
+
.kai-scrollbar-thin::-webkit-scrollbar { width: 8px; height: 8px; }
|
|
339
|
+
.kai-scrollbar-thin::-webkit-scrollbar-track { background: transparent; }
|
|
340
|
+
.kai-scrollbar-thin::-webkit-scrollbar-thumb {
|
|
340
341
|
background-color: var(--color-scrollbar-thumb);
|
|
341
342
|
border-radius: 9999px;
|
|
342
343
|
border: 2px solid transparent;
|
|
343
344
|
background-clip: padding-box;
|
|
344
345
|
}
|
|
345
|
-
.scrollbar-thin::-webkit-scrollbar-thumb:hover { background-color: var(--color-scrollbar-thumb-hover); }
|
|
346
|
-
.scrollbar-thin::-webkit-scrollbar-corner { background: transparent; }
|
|
346
|
+
.kai-scrollbar-thin::-webkit-scrollbar-thumb:hover { background-color: var(--color-scrollbar-thumb-hover); }
|
|
347
|
+
.kai-scrollbar-thin::-webkit-scrollbar-corner { background: transparent; }
|
|
347
348
|
|
|
348
349
|
/* Surface utilities — `bg-surface` / `bg-surface-strong` paint the opaque,
|
|
349
350
|
theme-derived surface tokens (see --color-surface above). Defined explicitly
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{I as m}from"./Icon-
|
|
1
|
+
import{I as m}from"./Icon-BzBET3E-.js";import{c as e,q as o}from"./define-CI0y3eE4.js";var h=[["path",{d:"M17 14V2",key:"8ymqnk"}],["path",{d:"M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z",key:"m61m77"}]],t=a=>e(m,o(a,{name:"ThumbsDown",iconNode:h})),n=t,p=[["path",{d:"M7 10v12",key:"1qc93n"}],["path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z",key:"emmmcr"}]],r=a=>e(m,o(a,{name:"ThumbsUp",iconNode:p})),d=r;export{d as a,n as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{R as f,g as b}from"./define-
|
|
1
|
+
import{R as f,g as b}from"./define-CI0y3eE4.js";import{c as h,p as A}from"./store-CSgbFFCg.js";let o={};function k(e){o.stack&&e.setAttribute("stack",o.stack),o.position&&e.setAttribute("position",o.position),o.max!==void 0&&e.setAttribute("max",String(o.max)),o.appearance&&e.setAttribute("appearance",o.appearance),o.inverse!==void 0&&(o.inverse?e.setAttribute("inverse",""):e.removeAttribute("inverse"))}const x=5e3,w=7e3,{toasts:d,setToasts:a,mounted:q,setMounted:p}=f(()=>{const[e,t]=h([]),[n,i]=b(!1);return{toasts:e,setToasts:t,mounted:n,setMounted:i}});let m=0;function M(){return m+=1,`toast-${m}`}function y(e){const t=e.duration??x;return t===0?0:e.action?Math.max(t,w):t}const u=new Map;let v=!1;function C(e){return e.target??null}function I(e=null){if(typeof document>"u")return;const t=u.get(e);if(t&&t.isConnected)return t;t&&u.delete(e);const n=new Set(u.values()),i=Array.from(document.querySelectorAll("kai-toast-region")).filter(l=>l.isConnected&&!n.has(l)&&C(l)===e);i.length>1&&!v&&(v=!0,console.warn(`[kitn] toast(): ${i.length} candidate <kai-toast-region> elements are in the document; adopting the first in document order. Keep one region per target so the imperative toast() API has an unambiguous home.`));const s=i[0];if(s)return s.toasts=d,u.set(e,s),p(!0),s;const r=document.createElement("kai-toast-region");return document.body.appendChild(r),r.toasts=d,e&&(r.target=e),k(r),u.set(e,r),p(!0),r}function S(e){const t=d.findIndex(n=>n.id===e.id);t>=0?a(t,e):a(A(n=>{n.push(e)}))}function g(e){a(t=>t.filter(n=>n.id!==e))}function T(e){return{id:e,dismiss:()=>g(e),update:t=>{const n=d.findIndex(i=>i.id===e);n>=0&&a(n,i=>({...i,...t}))}}}function c(e,t,n){I(t?.target??null);const i=t?.id??M(),s={id:i,message:e,variant:t?.variant??n,appearance:t?.appearance??o.appearance??"pill",inverse:t?.inverse??o.inverse??!1,description:t?.description,action:t?.action,duration:t?.duration,dismissible:t?.dismissible,target:t?.target};return S(s),T(i)}const O=Object.assign((e,t)=>c(e,t,"neutral"),{success:(e,t)=>c(e,t,"success"),warning:(e,t)=>c(e,t,"warning"),error:(e,t)=>c(e,t,"error"),info:(e,t)=>c(e,t,"info"),dismiss:g,clear:()=>a([])});export{y as r,O as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as t,q as b,s as q,g as B,i as a,S as l,F as E,m as y,a as p,b as L,t as o,n as
|
|
1
|
+
import{c as t,q as b,s as q,g as B,i as a,S as l,F as E,m as y,a as p,b as L,t as o,n as m}from"./define-CI0y3eE4.js";import{c as P}from"./cn-DN5AWfiS.js";import{a as M,b as $,C as D}from"./collapsible-Bhc636Cf.js";import{B as F}from"./button-C_3te6fm.js";import{c as J}from"./chevron-down-CSobuZRG.js";import{I as k}from"./Icon-BzBET3E-.js";import{c as V}from"./circle-x-Bk-dA5Wf.js";import{s as A}from"./settings-PaGo_S4U.js";var G=[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],H=e=>t(k,b(e,{name:"CircleCheckBig",iconNode:G})),K=H,Q=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],U=e=>t(k,b(e,{name:"LoaderCircle",iconNode:Q})),W=U,X=o('<span class="px-2 py-1 rounded-full text-xs font-medium">Processing'),Y=o('<span class="px-2 py-1 rounded-full text-xs font-medium">Ready'),Z=o('<span class="px-2 py-1 rounded-full text-xs font-medium">Completed'),_=o('<span class="px-2 py-1 rounded-full text-xs font-medium">Error'),tt=o('<div><h4 class="text-muted-foreground mb-2 text-sm font-medium">Input</h4><div class="rounded bg-surface-strong p-2 font-mono text-sm">'),et=o('<div><h4 class="text-muted-foreground mb-2 text-sm font-medium">Output</h4><div tabindex=0 class="max-h-60 overflow-auto rounded bg-surface-strong p-2 font-mono text-sm"><pre class=whitespace-pre-wrap>'),rt=o('<div><h4 class="mb-2 text-sm font-medium text-red-600 dark:text-red-400">Error</h4><div class="rounded bg-red-500/10 p-2 text-sm">'),nt=o('<div class="text-muted-foreground text-sm">Processing tool call...'),at=o('<div class="text-muted-foreground pt-2 text-xs"><span class=font-mono>Call ID: '),lt=o('<div class="space-y-3 p-3">'),ot=o("<div>"),st=o('<div class="flex items-center gap-2"><span class="font-mono text-sm font-medium">'),it=o("<div class=mb-1><span class=text-muted-foreground>:</span> <span>");function S(e){return e===null?"null":e===void 0?"undefined":typeof e=="string"?e:typeof e=="object"?JSON.stringify(e,null,2):String(e)}function ut(e){return[t(l,{get when(){return e.state==="input-streaming"},get children(){return t(W,{class:"size-4 animate-spin text-blue-500"})}}),t(l,{get when(){return e.state==="input-available"},get children(){return t(A,{class:"size-4 text-orange-500"})}}),t(l,{get when(){return e.state==="output-available"},get children(){return t(K,{class:"size-4 text-green-500"})}}),t(l,{get when(){return e.state==="output-error"},get children(){return t(V,{class:"size-4 text-red-500"})}})]}const dt={"input-streaming":"var(--color-tool-blue)","input-available":"var(--color-tool-amber)","output-available":"var(--color-tool-green)","output-error":"var(--color-tool-red)"},ct={"input-streaming":"hsl(217 91% 60%)","input-available":"hsl(38 92% 50%)","output-available":"hsl(142 71% 45%)","output-error":"hsl(0 84% 60%)"};function f(e){return{color:dt[e],background:`color-mix(in oklab, ${ct[e]} 15%, transparent)`}}function pt(e){return[t(l,{get when(){return e.state==="input-streaming"},get children(){var r=X();return p(u=>m(r,f("input-streaming"),u)),r}}),t(l,{get when(){return e.state==="input-available"},get children(){var r=Y();return p(u=>m(r,f("input-available"),u)),r}}),t(l,{get when(){return e.state==="output-available"},get children(){var r=Z();return p(u=>m(r,f("output-available"),u)),r}}),t(l,{get when(){return e.state==="output-error"},get children(){var r=_();return p(u=>m(r,f("output-error"),u)),r}})]}function gt(e){const[r,u]=q(e,["toolPart","defaultOpen","disabled","controllerRef","class"]),[z,O]=B(),I=()=>{var d;return((d=z())==null?void 0:d.open())??r.defaultOpen??!1},g=()=>r.toolPart.state,h=()=>r.toolPart.input,w=()=>r.toolPart.output;return(()=>{var d=ot();return a(d,t(D,{get defaultOpen(){return r.defaultOpen},get disabled(){return r.disabled},controllerRef:s=>{var n;O(s),(n=r.controllerRef)==null||n.call(r,s)},get children(){return[t(M,{as:s=>t(F,b({variant:"ghost",class:"h-auto w-full justify-between rounded-b-none px-3 py-2 font-normal"},s,{get children(){return[(()=>{var n=st(),i=n.firstChild;return a(n,t(ut,{get state(){return g()}}),i),a(i,()=>r.toolPart.type),a(n,t(pt,{get state(){return g()}}),null),n})(),t(J,{get class(){return P("size-4 transition-transform",I()&&"rotate-180")}})]}}))}),t($,{class:"overflow-hidden",get children(){var s=lt();return a(s,t(l,{get when(){return y(()=>!!h())()&&Object.keys(h()).length>0},get children(){var n=tt(),i=n.firstChild,c=i.nextSibling;return a(c,t(E,{get each(){return Object.entries(h())},children:([v,j])=>(()=>{var C=it(),x=C.firstChild,R=x.firstChild,N=x.nextSibling,T=N.nextSibling;return a(x,v,R),a(T,()=>S(j)),C})()})),n}}),null),a(s,t(l,{get when(){return w()},get children(){var n=et(),i=n.firstChild,c=i.nextSibling,v=c.firstChild;return a(v,()=>S(w())),n}}),null),a(s,t(l,{get when(){return y(()=>g()==="output-error")()&&r.toolPart.errorText},get children(){var n=rt(),i=n.firstChild,c=i.nextSibling;return a(c,()=>r.toolPart.errorText),n}}),null),a(s,t(l,{get when(){return g()==="input-streaming"},get children(){return nt()}}),null),a(s,t(l,{get when(){return r.toolPart.toolCallId},get children(){var n=at(),i=n.firstChild;return i.firstChild,a(i,()=>r.toolPart.toolCallId,null),n}}),null),s}})]}})),p(()=>L(d,P("mt-3 overflow-hidden rounded-lg bg-surface",r.class))),d})()}export{gt as T};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as M,A as S,w as $,g as s,h as j,c as v,P as q,u as B,d as f,i as G,a as H,l as g,b as J,S as K,t as N}from"./define-
|
|
1
|
+
import{s as M,A as S,w as $,g as s,h as j,c as v,P as q,u as B,d as f,i as G,a as H,l as g,b as J,S as K,t as N}from"./define-CI0y3eE4.js";import{c as Q}from"./cn-DN5AWfiS.js";import{c as U,u as V,a as W,A as X}from"./overlay-DBMFXie6.js";var Y=N("<div role=tooltip style=position:fixed;pointer-events:none>");function Z(R){var b;const[n]=M(R,["content","children","class","openDelay","closeDelay","placement","defaultOpen","disabled","controllerRef","dismissOnClick"]),A=S(),x=$(),[i,t]=s(n.defaultOpen??!1),[r,F]=s(),[h,E]=s();(b=n.controllerRef)==null||b.call(n,{open:i,setOpen:e=>t(e&&!n.disabled)});let a,l=!1;const[I,c]=s(!1),[L,u]=s(!1),w=(e=0)=>{n.disabled||(clearTimeout(a),e?a=window.setTimeout(()=>t(!0),e):t(!0))},p=()=>{clearTimeout(a);const e=n.closeDelay??0;e?a=window.setTimeout(()=>t(!1),e):t(!1)},y=()=>{!I()&&!L()&&p()},T=()=>{n.dismissOnClick!==!1&&(c(!1),u(!1),p())};j(()=>clearTimeout(a));const d=U(i),m=V(r,h,{placement:n.placement??"top",gutter:6,onDisconnect:()=>t(!1)});return W({enabled:i,onDismiss:p,refs:()=>[r(),h()]}),[v(X,{as:"span",class:"inline-flex",ref:F,get"aria-describedby"(){return i()?x:void 0},onPointerEnter:()=>{c(!0),w(n.openDelay??600)},onPointerLeave:()=>{c(!1),y()},onPointerDown:()=>{l=!0,T(),window.setTimeout(()=>{l=!1},0)},onClick:T,onFocusIn:()=>{u(!0),l||w()},onFocusOut:e=>{const o=r();o&&o.contains(e.relatedTarget)||(u(!1),y())},get children(){return n.children}}),v(K,{get when(){return d.present()},get children(){return v(q,{get mount(){return A.portalMount()},get children(){var e=Y();return B(o=>{E(o),d.setRef(o)},e),f(e,"id",x),G(e,()=>n.content),H(o=>{var D=d.state()==="open"?"":void 0,O=d.state()==="closed"?"":void 0,P=`${m.pos().x}px`,k=`${m.pos().y}px`,z=m.hidden()?"hidden":"visible",C=Q("z-50 rounded-md bg-foreground px-2.5 py-1 text-xs text-background shadow-md","animate-in fade-in-0 zoom-in-95 data-[closed]:animate-out data-[closed]:fade-out-0 data-[closed]:zoom-out-95",n.class);return D!==o.e&&f(e,"data-expanded",o.e=D),O!==o.t&&f(e,"data-closed",o.t=O),P!==o.a&&g(e,"left",o.a=P),k!==o.o&&g(e,"top",o.o=k),z!==o.i&&g(e,"visibility",o.i=z),C!==o.n&&J(e,o.n=C),o},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),e}})}})]}export{Z as T};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{I as e}from"./Icon-
|
|
1
|
+
import{I as e}from"./Icon-BzBET3E-.js";import{c as y,q as o}from"./define-CI0y3eE4.js";var k=[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}]],n=a=>y(e,o(a,{name:"Bookmark",iconNode:k})),h=n,d=[["path",{d:"M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z",key:"i9b6wo"}],["line",{x1:"4",x2:"4",y1:"22",y2:"15",key:"1cm3nv"}]],i=a=>y(e,o(a,{name:"Flag",iconNode:d})),m=i,p=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],t=a=>y(e,o(a,{name:"Pencil",iconNode:p})),s=t,c=[["path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8",key:"1b2hhj"}],["polyline",{points:"16 6 12 2 8 6",key:"m901s6"}],["line",{x1:"12",x2:"12",y1:"2",y2:"15",key:"1p0rca"}]],r=a=>y(e,o(a,{name:"Share",iconNode:c})),l=r,x=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]],v=a=>y(e,o(a,{name:"Trash2",iconNode:x})),M=v;export{h as b,m as f,s as p,l as s,M as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{I as e}from"./Icon-
|
|
1
|
+
import{I as e}from"./Icon-BzBET3E-.js";import{c as p,q as o}from"./define-CI0y3eE4.js";var r=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],t=a=>p(e,o(a,{name:"TriangleAlert",iconNode:r})),m=t;export{m as t};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
/** Whether `text` (trimmed) is a syntactically valid hex color. */
|
|
3
|
+
export declare function isValidHex(text: string): boolean;
|
|
4
|
+
export interface ColorFieldProps {
|
|
5
|
+
/** Accessible name for the color control — the swatch/native picker's
|
|
6
|
+
* `aria-label`. The hex text field gets its own derived label so the two
|
|
7
|
+
* controls announce distinctly. */
|
|
8
|
+
label: string;
|
|
9
|
+
/** The committed color as a CSS hex string, or `undefined`/empty for
|
|
10
|
+
* unset. Controlled — this component holds no color state of its own,
|
|
11
|
+
* only the hex text field's in-progress draft (see `onChange`). */
|
|
12
|
+
value?: string;
|
|
13
|
+
/** Placeholder for the hex text field when `value` is unset. */
|
|
14
|
+
placeholder?: string;
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Fires with the next value once it is syntactically valid: immediately
|
|
18
|
+
* for the native color picker (which only ever emits a valid 6-digit hex),
|
|
19
|
+
* or on blur/commit of the hex text field when what's typed matches
|
|
20
|
+
* {@link isValidHex}. An invalid or partial hex in the text field never
|
|
21
|
+
* fires this — the field just doesn't commit, and keeps whatever was
|
|
22
|
+
* typed rather than snapping back (owner ruling, design round 3: "invalid
|
|
23
|
+
* text doesn't nuke state, just doesn't commit").
|
|
24
|
+
*/
|
|
25
|
+
onChange: (value: string) => void;
|
|
26
|
+
class?: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* `ColorField`: a themed rounded-square swatch (the visible trigger for the
|
|
30
|
+
* platform's own color picker) beside a hex text field, kept in sync in both
|
|
31
|
+
* directions.
|
|
32
|
+
*
|
|
33
|
+
* The swatch is a `<label>` wrapping a real `<input type="color">` that is
|
|
34
|
+
* `sr-only` (present, focusable, and labeled for assistive tech — never
|
|
35
|
+
* `display:none` or `tabindex="-1"`) rather than rendered — the platform
|
|
36
|
+
* color dialog is what does the actual picking; this component never draws
|
|
37
|
+
* its own color rectangle. Clicking anywhere on the swatch forwards to the
|
|
38
|
+
* native input via ordinary label/input association; keyboard focus lands on
|
|
39
|
+
* that input, and the VISIBLE focus ring is painted on the wrapping label via
|
|
40
|
+
* `has-[:focus-visible]:` — the same "real hidden control, ring on the
|
|
41
|
+
* decorative wrapper" idiom `tasks-card.tsx` and `choice-card.tsx` already
|
|
42
|
+
* use for their checkbox/radio rows. Enter/Space opening the native color
|
|
43
|
+
* dialog on a focused `<input type="color">` is platform behavior, not
|
|
44
|
+
* something this component implements.
|
|
45
|
+
*
|
|
46
|
+
* No `part=` attributes: not yet wired to a `kai-*` facade.
|
|
47
|
+
*/
|
|
48
|
+
export declare function ColorField(props: ColorFieldProps): JSX.Element;
|
package/dist/ui/textarea.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { JSX } from 'solid-js';
|
|
2
2
|
export interface TextareaProps extends JSX.TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
3
3
|
maxHeight?: number;
|
|
4
|
+
/** Floor the auto-resized height at this many pixels, even when the field
|
|
5
|
+
* is empty. Omit to fall back to `useAutoResize`'s own default (one
|
|
6
|
+
* visible line, derived from computed line-height + padding/border). */
|
|
7
|
+
minHeight?: number;
|
|
4
8
|
autoResize?: boolean;
|
|
5
9
|
}
|
|
6
10
|
export declare function Textarea(props: TextareaProps): JSX.Element;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
declare const toggleChipVariants: (props?: ({
|
|
4
|
+
pressed?: boolean | null | undefined;
|
|
5
|
+
size?: "sm" | "md" | null | undefined;
|
|
6
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
|
+
export interface ToggleChipProps extends Omit<JSX.ButtonHTMLAttributes<HTMLButtonElement>, 'type' | 'role' | 'aria-pressed' | 'onChange' | 'onclick' | 'onClick' | 'onKeyDown' | 'onkeydown' | 'children'>, VariantProps<typeof toggleChipVariants> {
|
|
8
|
+
/** Controlled pressed state. When set, the component defers state to the
|
|
9
|
+
* parent; drive it from `onChange`. Omit for uncontrolled (internal)
|
|
10
|
+
* state — same controlled/uncontrolled shape as `Switch`'s
|
|
11
|
+
* `checked`/`defaultChecked`, renamed to `pressed` because that's the
|
|
12
|
+
* ARIA state a toggle BUTTON carries (`aria-pressed`, not
|
|
13
|
+
* `aria-checked` — this is a button, not a switch/checkbox/radio). */
|
|
14
|
+
pressed?: boolean;
|
|
15
|
+
/** Initial pressed state when uncontrolled. */
|
|
16
|
+
defaultPressed?: boolean;
|
|
17
|
+
/** Disable interaction. */
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
/** Fires with the next pressed state on toggle. */
|
|
20
|
+
onChange?: (pressed: boolean) => void;
|
|
21
|
+
class?: string;
|
|
22
|
+
children?: JSX.Element;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* `ToggleChip`: a small pill button for a two-state, chip-shaped toggle
|
|
26
|
+
* (`aria-pressed`) — the common-case selectors in `builder-panel.tsx`'s
|
|
27
|
+
* attachments accept editor, promoted to a named primitive (owner design
|
|
28
|
+
* round 4). Controlled via `pressed`, or uncontrolled from `defaultPressed`,
|
|
29
|
+
* matching `Switch`'s controlled/uncontrolled convention.
|
|
30
|
+
*
|
|
31
|
+
* No `ChipGroup` wrapper: a row of chips is `<div class="flex flex-wrap
|
|
32
|
+
* gap-1.5">` and nothing more — there is no shared selection state, roving
|
|
33
|
+
* tabindex, or exclusivity to own (unlike `RadioGroup`/`Segmented`, which
|
|
34
|
+
* DO have real grouping logic: one shared `name`, single-select, arrow-key
|
|
35
|
+
* navigation between options). Wrapping a plain flex row in a component
|
|
36
|
+
* would be a component with nothing to do — YAGNI; see the story for the
|
|
37
|
+
* same "just a flex row" idiom used inline.
|
|
38
|
+
*/
|
|
39
|
+
export declare function ToggleChip(props: ToggleChipProps): JSX.Element;
|
|
40
|
+
export { toggleChipVariants };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{I as a}from"./Icon-
|
|
1
|
+
import{I as a}from"./Icon-BzBET3E-.js";import{c as e,q as i}from"./define-CI0y3eE4.js";var p=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]],t=o=>e(a,i(o,{name:"Upload",iconNode:p})),r=t;export{r as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{q as D,s as P,g as z,c as i,i as s,S as a,a as b,d as k,b as T,D as q,m as w,t as c,w as A,e as B,H as E,G as F,j as G,x as H,k as m}from"./define-
|
|
1
|
+
import{q as D,s as P,g as z,c as i,i as s,S as a,a as b,d as k,b as T,D as q,m as w,t as c,w as A,e as B,H as E,G as F,j as G,x as H,k as m}from"./define-CI0y3eE4.js";import{c as C}from"./cn-DN5AWfiS.js";import{B as K}from"./button-C_3te6fm.js";import{t as O}from"./triangle-alert-CeHLWxhD.js";import{x as U}from"./x-eiO9V6J6.js";import{r as _}from"./rotate-ccw-B1nwmwuY.js";var J=c('<h3 class="text-title font-semibold tracking-tight text-foreground">'),N=c('<p class="text-body text-muted-foreground">'),Q=c("<div>"),V=c('<div role=alert class="flex items-start gap-2 rounded-lg border border-destructive/40 bg-destructive/10 p-3 text-sm text-destructive dark:bg-destructive/15 dark:text-red-400"><span>'),W=c('<div class="text-sm text-foreground">'),X=c('<div class="flex flex-wrap items-center justify-end gap-2 pt-1">'),Y=c('<button type=button part=dismiss aria-label=Dismiss class="absolute right-2.5 top-2.5 z-10 shrink-0 rounded p-1 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground">'),Z=c('<div class="overflow-hidden rounded-lg">');function S(t){const o=D({dense:!1},t),[e,d]=P(o,["heading","description","media","actions","errorMessage","dense","headingId","descriptionId","dismissible","onDismiss","href","target","rel","clickable","onCardClick","class","children"]),g=A(),u=()=>e.headingId??`kai-card-heading-${g}`,v=()=>e.descriptionId??`kai-card-description-${g}`,p=()=>e.errorMessage!==void 0&&e.errorMessage!=="",l=()=>!!e.heading||!!e.description,[x,I]=z(!0),M=r=>{var n;r.stopPropagation(),I(!1),(n=e.onDismiss)==null||n.call(e)},h=()=>!!e.href,f=()=>!h()&&!!e.clickable,y=()=>h()||f(),$=r=>{var n;return(n=e.onCardClick)==null?void 0:n.call(e,r)},R=r=>{f()&&(r.key==="Enter"||r.key===" "||r.key==="Spacebar")&&(r.preventDefault(),$(r))},j=()=>e.rel??(e.target==="_blank"?"noopener noreferrer":void 0),L=[i(a,{get when(){return l()},get children(){var r=Q();return s(r,i(a,{get when(){return e.heading},get children(){var n=J();return s(n,()=>e.heading),b(()=>k(n,"id",u())),n}}),null),s(r,i(a,{get when(){return e.description},get children(){var n=N();return s(n,()=>e.description),b(()=>k(n,"id",v())),n}}),null),b(()=>T(r,C("flex flex-col border-b border-border",e.dense?"gap-0.5 pb-2.5":"gap-1 pb-4"))),r}}),i(a,{get when(){return p()},get fallback(){return[i(a,{get when(){return e.children},get children(){var r=W();return s(r,()=>e.children),r}}),i(a,{get when(){return e.actions},get children(){var r=X();return s(r,()=>e.actions),r}})]},get children(){var r=V(),n=r.firstChild;return s(r,i(O,{size:16,class:"mt-0.5 shrink-0","aria-hidden":"true"}),n),s(n,()=>e.errorMessage),r}})];return i(a,{get when(){return x()},get children(){return i(q,D({get component(){return h()?"a":"div"},part:"card",get href(){return w(()=>!!h())()?e.href:void 0},get target(){return w(()=>!!h())()?e.target:void 0},get rel(){return w(()=>!!h())()?j():void 0},get role(){return f()?"button":void 0},get tabindex(){return f()?0:void 0},get onClick(){return y()?$:void 0},get onKeyDown(){return f()?R:void 0},get class(){return C("relative flex flex-col rounded-xl border border-border bg-card text-card-foreground kai-elevation-sm",e.dense?"gap-2.5 p-3.5":"gap-4 p-5",y()&&"cursor-pointer no-underline transition-colors hover:border-ring hover:bg-accent/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",e.class)}},d,{get children(){return[i(a,{get when(){return e.dismissible},get children(){var r=Y();return r.$$click=M,s(r,i(U,{class:"size-3.5","aria-hidden":"true"})),r}}),i(a,{get when(){return e.media},get children(){var r=Z();return s(r,()=>e.media),r}}),L]}}))}})}B(["click"]);var ee=c('<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 re={confirm:"Proposed",choice:"Choose",form:"Form",tasks:"Tasks"};function te(t){const o=re[t];return o?`${o}:`:t.length===0?"Card:":`${t.charAt(0).toUpperCase()}${t.slice(1)}:`}function ne(t){const o=()=>te(t.type),e=()=>t.title??"this card",d=()=>t.reopenLabel??"Reopen",g=()=>`${o()} ${e()} \u2014 dismissed`;return i(S,{dense:!0,get class(){return t.class},get children(){var u=ee(),v=u.firstChild,p=v.firstChild,l=p.nextSibling,x=l.nextSibling;return s(p,o),s(x,e),s(u,i(K,{type:"button",variant:"ghost",size:"sm",get class(){return C("ml-auto gap-1.5")},onClick:()=>t.onReopen(),get children(){return[i(_,{size:14,"aria-hidden":"true"}),i(a,{get when(){return d()},get children(){return d()}})]}}),null),b(()=>k(u,"aria-label",g())),u}})}const ie=F();function se(){return E(ie)}const oe=new Set(["action","submit","expired"]);function ae(t){const[o,e]=z(void 0);G(H(t.data,()=>e(void 0),{defer:!0}));const d=m(()=>t.prop()??o()),g=m(()=>d()!==void 0),u=m(()=>{const l=d();return l!==void 0&&oe.has(l.kind)}),v=m(()=>{var l;return((l=d())==null?void 0:l.kind)==="dismissed"}),p=m(()=>t.prop()===void 0&&o()!==void 0);return{resolution:d,isResolved:g,isTerminal:u,isDeferred:v,isOptimistic:p,setLocal:e}}export{S as C,ne as D,ae as a,se as u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as y,s as b,c as w,a as R,C as A,t as S,b as _}from"./register-impl-
|
|
1
|
+
import{i as y,s as b,c as w,a as R,C as A,t as S,b as _}from"./register-impl-DvEnhIxx.js";import{h as f,l as k,d as M,i as T,o as W}from"./kai.es.js";import{c as n,h as q,S as C,D as z}from"./create-tween-zt79ba32.js";const P=`
|
|
2
2
|
const float PI = 3.14159265359;
|
|
3
3
|
// Strand phase span: 0.5 + pi (fact sheet section 2's "sigma", the
|
|
4
4
|
// midpoint of the interval [1, 2*pi] with the interpolation knob fixed
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ssr as w, ssrAttribute as d, escape as h, ssrStyleProperty as u, createComponent as R } from "solid-js/web";
|
|
2
2
|
import { createEffect as p, createSignal as A, onCleanup as S } from "solid-js";
|
|
3
|
-
import { c, S as _, h as k, D as C } from "./create-tween-
|
|
4
|
-
import { C as T, a as M } from "./solid-
|
|
3
|
+
import { c, S as _, h as k, D as C } from "./create-tween-WfqiENls.js";
|
|
4
|
+
import { C as T, a as M } from "./solid-15v_3WVL.js";
|
|
5
5
|
const W = `
|
|
6
6
|
const float PI = 3.14159265359;
|
|
7
7
|
// Strand phase span: 0.5 + pi (fact sheet section 2's "sigma", the
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { insert as y, createComponent as b, effect as w, setAttribute as R, className as A, setStyleProperty as S, template as k } from "solid-js/web";
|
|
2
2
|
import { createEffect as p, createSignal as C, onCleanup as T } from "solid-js";
|
|
3
|
-
import { c as l, S as _, h as M, D as W } from "./create-tween-
|
|
4
|
-
import { C as z, a as P } from "./solid-
|
|
3
|
+
import { c as l, S as _, h as M, D as W } from "./create-tween-wlFtW9Kh.js";
|
|
4
|
+
import { C as z, a as P } from "./solid-5P-otgdi.js";
|
|
5
5
|
const N = `
|
|
6
6
|
const float PI = 3.14159265359;
|
|
7
7
|
// Strand phase span: 0.5 + pi (fact sheet section 2's "sigma", the
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as f,i as y,c as b,a as w,d as R,b as A,l as S,g as _,h as k,t as M}from"./define-
|
|
1
|
+
import{j as f,i as y,c as b,a as w,d as R,b as A,l as S,g as _,h as k,t as M}from"./define-CI0y3eE4.js";import{c as n,h as T,D as W,S as q}from"./create-tween-CNOAU3Fx.js";import{C,a as z}from"./audio-visualizer-9lz5IHsL.js";const P=`
|
|
2
2
|
const float PI = 3.14159265359;
|
|
3
3
|
// Strand phase span: 0.5 + pi (fact sheet section 2's "sigma", the
|
|
4
4
|
// midpoint of the interval [1, 2*pi] with the interpolation knob fixed
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as w,i as S,s as c,c as m,e as p,t as M,b as A,C as N}from"./register-impl-
|
|
1
|
+
import{d as w,i as S,s as c,c as m,e as p,t as M,b as A,C as N}from"./register-impl-DvEnhIxx.js";import{h as g,c as C,l as y,S as x,d as h}from"./kai.es.js";import{c as $,S as E,h as U,D as j}from"./create-tween-zt79ba32.js";var b=M("<div>");const F={"1f":!0,"1i":!0,"1fv":!0,"2f":!0,"3f":!0,"3fv":!0,"4f":!0,"4fv":!0,Matrix2fv:!0,Matrix3fv:!0,Matrix4fv:!0},O=new Set(["1f","1i"]),V={"2f":2,"3f":3,"4f":4,Matrix2fv:4,Matrix3fv:9,Matrix4fv:16};function D(a,e){if(e==null||typeof e!="object")return`uniform "${a}" is not a valid declaration (expected an object with "type" and "value").`;if(F[e.type]!==!0)return`uniform "${a}" has an unrecognized type "${String(e.type)}".`;if(O.has(e.type))return typeof e.value!="number"||!Number.isFinite(e.value)?`uniform "${a}" is declared "${e.type}" (a number) but its value is not a finite number.`:void 0;if(!Array.isArray(e.value)||e.value.some(s=>typeof s!="number"||!Number.isFinite(s)))return`uniform "${a}" is declared "${e.type}" (an array) but its value is not an array of finite numbers.`;const o=V[e.type];if(o!==void 0&&e.value.length!==o)return`uniform "${a}" is declared "${e.type}", which takes exactly ${o} numbers, but its value has ${e.value.length}.`}function z(a,e){const o=a.bands.length?a.bands:[0],s={uColor:{type:"3fv",value:U(a.color)},uIntensity:{type:"1f",value:a.intensity},uSpeed:{type:"1f",value:a.speed},uComplexity:{type:"1f",value:a.complexity},uVolume:{type:"1f",value:a.volume},uBands:{type:"1fv",value:o,arraySize:o.length}};if(!e)return s;for(const[f,v]of Object.entries(e)){const l=D(f,v);if(l)throw new Error(l)}return{...s,...e}}function I(a){const e=$(.3),o=$(1),s=()=>A(a.state,a.listeningAmplitude);g(()=>{const t=w(s());if(s()==="speaking")e.to(.3+.7*a.volume,{duration:0});else{const r=a.frozen?{duration:0}:{duration:.5,ease:"easeOut"};e.to(Array.isArray(t.intensity)&&a.frozen?t.intensity[0]:t.intensity,r)}o.to(a.frozen?0:t.speed,{duration:0})});const f=C(()=>{var t;try{return{uniforms:z({color:a.color??j,intensity:e.value(),speed:o.value(),complexity:a.complexity??.5,volume:a.volume,bands:a.bands},(t=a.shader)==null?void 0:t.uniforms)}}catch(r){return{error:r instanceof Error?r.message:String(r)}}});let v=!1;g(()=>{const{error:t}=f();if(!t){v=!1;return}v||(v=!0,console.error(`<kai-audio-visualizer variant="custom">: ${t}`),a.onUnavailable())});const l=()=>({height:`${N[a.size]}px`,"aspect-ratio":"1"});return y(x,{get when(){var t;return(t=a.shader)==null?void 0:t.fragment},get fallback(){return(()=>{var t=b();return h(r=>{var n=a.state,i=a.class,u=l();return n!==r.e&&c(t,"data-kai-state",r.e=n),i!==r.t&&m(t,r.t=i),r.a=p(t,u,r.a),r},{e:void 0,t:void 0,a:void 0}),t})()},children:t=>y(x,{get when(){return f().uniforms},get fallback(){return(()=>{var r=b();return h(n=>{var i=a.state,u=a.class,d=l();return i!==n.e&&c(r,"data-kai-state",n.e=i),u!==n.t&&m(r,n.t=u),n.a=p(r,d,n.a),n},{e:void 0,t:void 0,a:void 0}),r})()},children:r=>(()=>{var n=b();return S(n,y(E,{get fragment(){return t()},get precision(){return a.size==="icon"||a.size==="sm"?"mediump":"highp"},get uniforms(){return r()},get animateWhenNotVisible(){return a.animateWhenNotVisible},onError:i=>{/not available/i.test(i)?console.warn('<kai-audio-visualizer variant="custom">: shader unavailable',i):console.error('<kai-audio-visualizer variant="custom">: shader error',i),a.onUnavailable()}})),h(i=>{var u=a.state,d=a.class,k=l();return u!==i.e&&c(n,"data-kai-state",i.e=u),d!==i.t&&m(n,i.t=d),i.a=p(n,k,i.a),i},{e:void 0,t:void 0,a:void 0}),n})()})})}export{z as customUniforms,I as default};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createComponent as m, insert as C, effect as c, setAttribute as y, className as b, style as h, template as E } from "solid-js/web";
|
|
2
2
|
import { createEffect as x, createMemo as N, Show as S } from "solid-js";
|
|
3
|
-
import { c as z, D as k, S as w, h as M } from "./create-tween-
|
|
4
|
-
import { s as R, a as T, C as O } from "./solid-
|
|
3
|
+
import { c as z, D as k, S as w, h as M } from "./create-tween-wlFtW9Kh.js";
|
|
4
|
+
import { s as R, a as T, C as O } from "./solid-5P-otgdi.js";
|
|
5
5
|
var g = /* @__PURE__ */ E("<div>");
|
|
6
6
|
const $ = {
|
|
7
7
|
"1f": !0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as g,k as w,c,S as x,i as S,a as m,d as p,b as y,n as h,t as M}from"./define-
|
|
1
|
+
import{j as g,k as w,c,S as x,i as S,a as m,d as p,b as y,n as h,t as M}from"./define-CI0y3eE4.js";import{c as $,S as A,h as j,D as N}from"./create-tween-CNOAU3Fx.js";import{s as C,a as E,C as U}from"./audio-visualizer-9lz5IHsL.js";var b=M("<div>");const F={"1f":!0,"1i":!0,"1fv":!0,"2f":!0,"3f":!0,"3fv":!0,"4f":!0,"4fv":!0,Matrix2fv:!0,Matrix3fv:!0,Matrix4fv:!0},O=new Set(["1f","1i"]),V={"2f":2,"3f":3,"4f":4,Matrix2fv:4,Matrix3fv:9,Matrix4fv:16};function I(a,e){if(e==null||typeof e!="object")return`uniform "${a}" is not a valid declaration (expected an object with "type" and "value").`;if(F[e.type]!==!0)return`uniform "${a}" has an unrecognized type "${String(e.type)}".`;if(O.has(e.type))return typeof e.value!="number"||!Number.isFinite(e.value)?`uniform "${a}" is declared "${e.type}" (a number) but its value is not a finite number.`:void 0;if(!Array.isArray(e.value)||e.value.some(s=>typeof s!="number"||!Number.isFinite(s)))return`uniform "${a}" is declared "${e.type}" (an array) but its value is not an array of finite numbers.`;const o=V[e.type];if(o!==void 0&&e.value.length!==o)return`uniform "${a}" is declared "${e.type}", which takes exactly ${o} numbers, but its value has ${e.value.length}.`}function k(a,e){const o=a.bands.length?a.bands:[0],s={uColor:{type:"3fv",value:j(a.color)},uIntensity:{type:"1f",value:a.intensity},uSpeed:{type:"1f",value:a.speed},uComplexity:{type:"1f",value:a.complexity},uVolume:{type:"1f",value:a.volume},uBands:{type:"1fv",value:o,arraySize:o.length}};if(!e)return s;for(const[f,v]of Object.entries(e)){const l=I(f,v);if(l)throw new Error(l)}return{...s,...e}}function W(a){const e=$(.3),o=$(1),s=()=>E(a.state,a.listeningAmplitude);g(()=>{const t=C(s());if(s()==="speaking")e.to(.3+.7*a.volume,{duration:0});else{const r=a.frozen?{duration:0}:{duration:.5,ease:"easeOut"};e.to(Array.isArray(t.intensity)&&a.frozen?t.intensity[0]:t.intensity,r)}o.to(a.frozen?0:t.speed,{duration:0})});const f=w(()=>{var t;try{return{uniforms:k({color:a.color??N,intensity:e.value(),speed:o.value(),complexity:a.complexity??.5,volume:a.volume,bands:a.bands},(t=a.shader)==null?void 0:t.uniforms)}}catch(r){return{error:r instanceof Error?r.message:String(r)}}});let v=!1;g(()=>{const{error:t}=f();if(!t){v=!1;return}v||(v=!0,console.error(`<kai-audio-visualizer variant="custom">: ${t}`),a.onUnavailable())});const l=()=>({height:`${U[a.size]}px`,"aspect-ratio":"1"});return c(x,{get when(){var t;return(t=a.shader)==null?void 0:t.fragment},get fallback(){return(()=>{var t=b();return m(r=>{var n=a.state,i=a.class,u=l();return n!==r.e&&p(t,"data-kai-state",r.e=n),i!==r.t&&y(t,r.t=i),r.a=h(t,u,r.a),r},{e:void 0,t:void 0,a:void 0}),t})()},children:t=>c(x,{get when(){return f().uniforms},get fallback(){return(()=>{var r=b();return m(n=>{var i=a.state,u=a.class,d=l();return i!==n.e&&p(r,"data-kai-state",n.e=i),u!==n.t&&y(r,n.t=u),n.a=h(r,d,n.a),n},{e:void 0,t:void 0,a:void 0}),r})()},children:r=>(()=>{var n=b();return S(n,c(A,{get fragment(){return t()},get precision(){return a.size==="icon"||a.size==="sm"?"mediump":"highp"},get uniforms(){return r()},get animateWhenNotVisible(){return a.animateWhenNotVisible},onError:i=>{/not available/i.test(i)?console.warn('<kai-audio-visualizer variant="custom">: shader unavailable',i):console.error('<kai-audio-visualizer variant="custom">: shader error',i),a.onUnavailable()}})),m(i=>{var u=a.state,d=a.class,z=l();return u!==i.e&&p(n,"data-kai-state",i.e=u),d!==i.t&&y(n,i.t=d),i.a=h(n,z,i.a),i},{e:void 0,t:void 0,a:void 0}),n})()})})}export{k as customUniforms,W as default};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createComponent as d, ssr as m, ssrAttribute as s, escape as u, ssrStyle as v } from "solid-js/web";
|
|
2
2
|
import { createEffect as y, createMemo as S, Show as b } from "solid-js";
|
|
3
|
-
import { c as h, D as x, S as $, h as z } from "./create-tween-
|
|
4
|
-
import { s as A, a as C, C as E } from "./solid-
|
|
3
|
+
import { c as h, D as x, S as $, h as z } from "./create-tween-WfqiENls.js";
|
|
4
|
+
import { s as A, a as C, C as E } from "./solid-15v_3WVL.js";
|
|
5
5
|
var g = ["<div", ' style="', '"></div>'], k = ["<div", ' style="', '">', "</div>"];
|
|
6
6
|
const w = {
|
|
7
7
|
"1f": !0,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { insert as h, createComponent as p, effect as g, setAttribute as x, className as y, setStyleProperty as b, template as w } from "solid-js/web";
|
|
2
2
|
import { createEffect as d } from "solid-js";
|
|
3
|
-
import { c as r, S as C, h as S, D as z } from "./create-tween-
|
|
4
|
-
import { C as A, a as U, w as F } from "./solid-
|
|
3
|
+
import { c as r, S as C, h as S, D as z } from "./create-tween-wlFtW9Kh.js";
|
|
4
|
+
import { C as A, a as U, w as F } from "./solid-5P-otgdi.js";
|
|
5
5
|
const R = `
|
|
6
6
|
const float TAU = 6.28318530718;
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ssr as h, ssrAttribute as d, escape as o, ssrStyleProperty as l, createComponent as p } from "solid-js/web";
|
|
2
2
|
import { createEffect as v } from "solid-js";
|
|
3
|
-
import { c, S as g, h as x, D as y } from "./create-tween-
|
|
4
|
-
import { C as b, a as w, w as C } from "./solid-
|
|
3
|
+
import { c, S as g, h as x, D as y } from "./create-tween-WfqiENls.js";
|
|
4
|
+
import { C as b, a as w, w as C } from "./solid-15v_3WVL.js";
|
|
5
5
|
const S = `
|
|
6
6
|
const float TAU = 6.28318530718;
|
|
7
7
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as m,s as h,c as x,a as g,C as y,t as b,b as w,w as C}from"./register-impl-
|
|
1
|
+
import{i as m,s as h,c as x,a as g,C as y,t as b,b as w,w as C}from"./register-impl-DvEnhIxx.js";import{h as v,l as z,d as S}from"./kai.es.js";import{c as r,h as U,S as q,D as F}from"./create-tween-zt79ba32.js";const W=`
|
|
2
2
|
const float TAU = 6.28318530718;
|
|
3
3
|
|
|
4
4
|
// Noise for dithering
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as v,i as m,c as h,a as x,d as g,b as y,l as b,t as w}from"./define-
|
|
1
|
+
import{j as v,i as m,c as h,a as x,d as g,b as y,l as b,t as w}from"./define-CI0y3eE4.js";import{c as r,h as C,D as z,S}from"./create-tween-CNOAU3Fx.js";import{C as U,a as q,w as F}from"./audio-visualizer-9lz5IHsL.js";const W=`
|
|
2
2
|
const float TAU = 6.28318530718;
|
|
3
3
|
|
|
4
4
|
// Noise for dithering
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{I as o}from"./Icon-BzBET3E-.js";import{c as m,q as r}from"./define-CI0y3eE4.js";var e=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],t=a=>m(o,r(a,{name:"X",iconNode:e})),p=t;export{p as x};
|