@kitn.ai/ui 0.26.0 → 0.28.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 +25 -6
- package/bin/mcp.js +16 -3
- package/bin/route.js +23 -0
- package/bin/route.test.js +58 -0
- package/dist/{elements/chunks/Icon--Y8vsFal.js → Icon-DObhsRtm.js} +1 -1
- package/dist/action-icons-CcgNN2oT.js +1 -0
- package/dist/arrow-down-CjRU3JgV.js +1 -0
- package/dist/arrow-left-Bnpb1UEW.js +1 -0
- package/dist/artifact-Bwt7OgcR.js +1 -0
- package/dist/assets/dev-5XzXYR21.js +91 -0
- package/dist/attachments-Qr4kg-2b.js +1 -0
- package/dist/{elements/chunks/audio-visualizer-D7lB6mvR.js → audio-visualizer-DToYdfSc.js} +1 -1
- package/dist/badge-CdEu_jn2.js +1 -0
- package/dist/bash-InADTalH.js +1 -6
- package/dist/bell-DQAAOpDz.js +1 -0
- package/dist/{elements/chunks/button-flUbeufF.js → button-DkuOnGLy.js} +1 -1
- package/dist/card-renderer-Jx70m6_l.js +1 -0
- package/dist/card-routing-0YidER_3.js +1 -0
- package/dist/check-njkVdZu2.js +1 -0
- package/dist/checkbox-D7iRB3nL.js +1 -0
- package/dist/checkbox-group-B2_rpoPM.js +1 -0
- package/dist/chevron-down-B72s6PXR.js +1 -0
- package/dist/chevron-right-BatuHzUm.js +1 -0
- package/dist/choice-card-m0BYqqOK.js +1 -0
- package/dist/circle-check-B62pODB3.js +1 -0
- package/dist/circle-x-BPG0iPst.js +1 -0
- package/dist/circle-zx0ByzY9.js +1 -0
- package/dist/{elements/chunks/cn-CU7UAWzk.js → cn-DN5AWfiS.js} +1 -1
- package/dist/code-block-ClMLKb7C.js +1 -0
- package/dist/{elements/chunks/collapsible-BzbXpPzr.js → collapsible-B4DlWicL.js} +1 -1
- package/dist/components/attachment-types.d.ts +7 -0
- package/dist/components/audio-visualizer/fit-scale.d.ts +1 -1
- package/dist/components/card-renderer.d.ts +13 -0
- package/dist/components/card.d.ts +4 -0
- package/dist/components/chat-thread.d.ts +135 -2
- package/dist/components/conversation-item.d.ts +35 -7
- package/dist/components/conversation-list.d.ts +17 -5
- package/dist/components/conversation-panel.d.ts +29 -0
- package/dist/components/form-widgets.d.ts +67 -2
- package/dist/components/form.d.ts +48 -1
- package/dist/components/home-panel.d.ts +34 -0
- package/dist/components/message.d.ts +25 -3
- package/dist/components/reasoning.d.ts +6 -0
- package/dist/components/scroll-button.d.ts +11 -0
- package/dist/components/thread.d.ts +5 -0
- package/dist/components/tool-types.d.ts +9 -0
- package/dist/components/widget-tab-bar.d.ts +16 -0
- package/dist/composer-sQ0HcvyG.js +106 -0
- package/dist/confirm-card-rQWDQsnC.js +1 -0
- package/dist/construct-cli.es.js +1337 -0
- package/dist/{elements/chunks/context-VLIL3sJ-.js → context-0kg4ZX1J.js} +1 -1
- package/dist/controllable-CnGpMF6r.js +1 -0
- package/dist/conversation-item-BxwQLaFJ.js +1 -0
- package/dist/conversation-list-BCfGN1JU.js +1 -0
- package/dist/copy-n9u9rqpi.js +1 -0
- package/dist/core-AYMC6_lb.js +12 -5874
- package/dist/{create-tween-BFT6c-Y8.js → create-tween-C-q-JCM-.js} +1 -1
- package/dist/{create-tween-CJNlzoaO.js → create-tween-CRrJXxBd.js} +1 -1
- package/dist/{create-tween-CQED4T0g.js → create-tween-DZ3RRDHD.js} +1 -1
- package/dist/{elements/chunks/create-tween-c4Z8TDYz.js → create-tween-uPkArjIG.js} +2 -2
- package/dist/css-M7EaDHN_.js +1 -6
- package/dist/custom-elements.json +1433 -202
- package/dist/default-input-CaMrJkgH.js +1 -0
- package/dist/define-By-uL588.js +1 -0
- package/dist/define.d.ts +4 -0
- package/dist/define.js +510 -0
- package/dist/define.server.d.ts +5 -0
- package/dist/define.server.js +506 -0
- package/dist/{elements/chunks/disclosure-CcNbyLy0.js → disclosure-WUImBbDv.js} +1 -1
- package/dist/{elements/chunks/dropdown-BgWTthUx.js → dropdown-wZVeJOMd.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/autoloader.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.d.ts +1 -0
- package/dist/elements/checkbox-group.js +1 -0
- package/dist/elements/checkbox.d.ts +1 -0
- package/dist/elements/checkbox.js +1 -0
- 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/define-entry.d.ts +12 -0
- package/dist/elements/dialog.js +1 -1
- package/dist/elements/dock.js +102 -8
- package/dist/elements/dropdown.js +1 -1
- package/dist/elements/editable-label.js +1 -1
- package/dist/elements/element-data-types.d.ts +37 -0
- 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.d.ts +1 -0
- package/dist/elements/pane-grid.js +1 -0
- 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.d.ts +1 -0
- package/dist/elements/radio-group.js +1 -0
- 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 +2 -2
- 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.d.ts +1 -0
- package/dist/elements/select.js +1 -0
- 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.d.ts +1 -0
- package/dist/elements/slider.js +1 -0
- package/dist/elements/slots.d.ts +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/elements.d.ts +380 -26
- package/dist/{elements/chunks/ellipsis-7gU33mL2.js → ellipsis-CbOpJnU3.js} +1 -1
- package/dist/embed-CrfjkbUG.js +1 -0
- package/dist/engine-javascript-vq0WuIJl.js +14 -2516
- package/dist/{elements/chunks/external-link-CSOEsNlx.js → external-link-ByXAwBBQ.js} +1 -1
- package/dist/file-text-DMib2qwt.js +1 -0
- package/dist/{elements/chunks/file-tree-zvB2i7P9.js → file-tree-CJqM2aP7.js} +1 -1
- package/dist/folder-_BAb929C.js +1 -0
- package/dist/form-DSZgZQZk.js +1 -0
- package/dist/github-dark-dimmed-DUshB20C.js +1 -4
- package/dist/github-light-JYsPkUQd.js +1 -4
- package/dist/hover-card-BQbul9eq.js +1 -0
- package/dist/html-CPZ3oZQ7.js +1 -10
- package/dist/icon-CdcfRhYI.js +1 -0
- package/dist/{elements/chunks/index-BCRhi84a.js → index-xu_pdcPi.js} +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.js +7474 -5857
- package/dist/index.server.js +5965 -4762
- package/dist/info-DsFjGuI_.js +1 -0
- package/dist/input-DKbmkMos.js +1 -0
- package/dist/javascript-C25yR2R2.js +1 -6
- package/dist/json-DxJze_jm.js +1 -6
- package/dist/kai.es.js +1 -1
- package/dist/kbd-PvdGhX4s.js +1 -0
- package/dist/{elements/chunks/link-preview-OQ9IEq0f.js → link-preview-DbM1866N.js} +1 -1
- package/dist/link-zF8PzWfF.js +1 -0
- package/dist/loader-BM4CEz4G.js +1 -0
- package/dist/{elements/chunks/markdown-DgBFaGAz.js → markdown-LMvmAyBk.js} +7 -7
- package/dist/mcp.es.js +1361 -81
- package/dist/message-BSsgvHvf.js +1 -0
- package/dist/message-BYZECyek.js +1 -0
- package/dist/message-circle-DruwObfX.js +1 -0
- package/dist/message-square-BG6q6mlm.js +1 -0
- package/dist/{elements/chunks/minimize-2-DPIUKTrT.js → minimize-2-BQRoBV1V.js} +1 -1
- package/dist/{elements/chunks/model-switcher-DsT8tFB0.js → model-switcher-CMpCOYcB.js} +1 -1
- package/dist/{elements/chunks/overlay-DuiwdXjm.js → overlay-Cb-MkyDa.js} +1 -1
- package/dist/panel-right-i8warFxT.js +1 -0
- package/dist/paperclip-ByY3UVO6.js +1 -0
- package/dist/play-BvKKq3fX.js +1 -0
- package/dist/primitives/card-data-types.d.ts +49 -0
- package/dist/primitives/card-routing.d.ts +1 -33
- package/dist/primitives/card-validate.d.ts +2 -2
- package/dist/primitives/chat-config.d.ts +29 -2
- package/dist/primitives/conversation-store.d.ts +54 -0
- package/dist/primitives/field-mask.d.ts +96 -0
- package/dist/primitives/field-semantics.d.ts +36 -0
- package/dist/primitives/input-mask.d.ts +46 -0
- package/dist/primitives/url-scheme-policy.d.ts +34 -0
- package/dist/primitives/use-resize-observer.d.ts +2 -2
- package/dist/progress-bar-jVAHvMUf.js +1 -0
- package/dist/prompt-suggestion-CD-qtNgC.js +1 -0
- package/dist/radio-BsoBMhkF.js +1 -0
- package/dist/react/index.d.ts +586 -19
- package/dist/react.js +223 -187
- package/dist/reasoning-4kBPtlTx.js +1 -0
- package/dist/register-impl-B1hLkrI8.js +424 -0
- package/dist/{elements/chunks/resizable-D181b4fM.js → resizable-uPmY9VY-.js} +1 -1
- package/dist/rotate-ccw-B2xn93py.js +1 -0
- package/dist/rotate-cw-CMVLoCyH.js +1 -0
- package/dist/schemas/form.schema.json +21 -1
- package/dist/schemas/tool-defs.d.ts +11 -1
- package/dist/schemas.js +81 -81
- package/dist/scroll-area-BqLUo8ZZ.js +1 -0
- package/dist/scroll-button-DslXiJyL.js +1 -0
- package/dist/select-2cLRtPGT.js +1 -0
- package/dist/{elements/chunks/separator-CeJHQqLW.js → separator-BWQtNJcM.js} +1 -1
- package/dist/{elements/chunks/settings-CqaHgJF9.js → settings-BBR63jLg.js} +1 -1
- package/dist/{elements/chunks/settings-group-CjqjLCOn.js → settings-group-B2ciy-Iw.js} +1 -1
- package/dist/{elements/chunks/skeleton-D8akBnKS.js → skeleton-CkHI-HgC.js} +1 -1
- package/dist/slider-DDR9U-i0.js +1 -0
- package/dist/{solid-BtdqNZI7.js → solid-BzCFdL25.js} +9771 -7594
- package/dist/{solid-CnavwBye.js → solid-DruVOXnf.js} +7893 -6183
- package/dist/solid.d.ts +16 -2
- package/dist/solid.js +256 -243
- package/dist/solid.server.js +256 -243
- package/dist/source-GEnFF528.js +1 -0
- package/dist/star-CilHq8GP.js +1 -0
- package/dist/state/index.d.ts +1 -1
- package/dist/state/mock.d.ts +32 -2
- package/dist/state.js +133 -108
- package/dist/store-Ciyk6eZG.js +1 -0
- package/dist/svelte--5p79yCD.js +1 -15
- package/dist/switch-KkeQIbuH.js +1 -0
- package/dist/tasks-card-BrN4bggJ.js +1 -0
- package/dist/text-shimmer-Dcj1MHuq.js +1 -0
- package/dist/textarea-Dpvbngbg.js +1 -0
- package/dist/theme.tokens.css +110 -13
- package/dist/{elements/chunks/thumbs-up-DX2Ijk3H.js → thumbs-up-CsT9Wzb9.js} +1 -1
- package/dist/toast-store-tgK6MuMv.js +1 -0
- package/dist/{elements/chunks/tool-DKQ2D1DP.js → tool-DzUjIBT8.js} +1 -1
- package/dist/{elements/chunks/tooltip-B0G99y8w.js → tooltip-Bkkg_4t0.js} +1 -1
- package/dist/trash-2-jBKxjGGQ.js +1 -0
- package/dist/{elements/chunks/triangle-alert-F9cyUEyy.js → triangle-alert-DlQ68ppf.js} +1 -1
- package/dist/tsx-B8rCNbgL.js +1 -6
- package/dist/types.d.ts +48 -3
- package/dist/typescript-RycA9KXf.js +1 -6
- package/dist/ui/checkbox-group.d.ts +83 -0
- package/dist/ui/checkbox.d.ts +40 -0
- package/dist/ui/dock.d.ts +51 -0
- package/dist/ui/icon.d.ts +3 -0
- package/dist/ui/input.d.ts +48 -2
- package/dist/ui/radio.d.ts +85 -0
- package/dist/ui/select.d.ts +71 -0
- package/dist/ui/slider.d.ts +65 -0
- package/dist/ui/switch.d.ts +9 -2
- package/dist/upload-TcAHXv9W.js +1 -0
- package/dist/url-scheme-policy-DR5DgvkM.js +1 -0
- package/dist/use-card-resolution-DaZqAdWf.js +1 -0
- package/dist/{elements/chunks/variant-aurora-qt6Zct8M.js → variant-aurora-BhLuYxJR.js} +1 -1
- package/dist/{variant-aurora-B8II3-I1.js → variant-aurora-CNmfHhcx.js} +2 -2
- package/dist/{variant-aurora-CMNWOSJR.js → variant-aurora-D6GsdTPA.js} +2 -2
- package/dist/{variant-aurora-CcuDMWwQ.js → variant-aurora-DbW_OWL2.js} +1 -1
- package/dist/{elements/chunks/variant-custom-tJp22_BQ.js → variant-custom-BRvaNHSi.js} +1 -1
- package/dist/{variant-custom-L16JLLZy.js → variant-custom-BvYHR62b.js} +1 -1
- package/dist/{variant-custom-BdvYC7af.js → variant-custom-DMTrEO5w.js} +2 -2
- package/dist/{variant-custom-C714mqKl.js → variant-custom-DV2x254s.js} +2 -2
- package/dist/{variant-wave-ecwykeyL.js → variant-wave-BNMGrDfj.js} +2 -2
- package/dist/{variant-wave-2S4La2Ka.js → variant-wave-BpDd8t3Z.js} +1 -1
- package/dist/{variant-wave-D7ruiA1W.js → variant-wave-CyBueXj9.js} +2 -2
- package/dist/{elements/chunks/variant-wave-CaQ5ti39.js → variant-wave-sp-qwsdI.js} +1 -1
- package/dist/vue-BmIZj4XD.js +1 -33
- package/dist/x-Z5UntkIJ.js +1 -0
- package/frameworks/react/index.tsx +210 -22
- package/llms-full.txt +1184 -22
- package/llms.txt +6 -3
- package/package.json +17 -4
- package/src/agent-tooling/README.md +192 -0
- package/src/agent-tooling/catalog/invariants.ts +3 -3
- package/src/agent-tooling/catalog/surfaces.ts +72 -0
- package/src/agent-tooling/construct/cli-entry.ts +8 -0
- package/src/agent-tooling/construct/cli.ts +147 -0
- package/src/agent-tooling/construct/codegen.ts +1635 -0
- package/src/agent-tooling/construct/construct.v1.schema.json +319 -0
- package/src/agent-tooling/construct/dev.ts +148 -0
- package/src/agent-tooling/construct/fixtures/demo-widget.construct.json +7 -0
- package/src/agent-tooling/construct/fixtures/ops-console.construct.json +44 -0
- package/src/agent-tooling/construct/fixtures/owner-widget.construct.json +32 -0
- package/src/agent-tooling/construct/schema.ts +452 -0
- package/src/agent-tooling/mcp/server.ts +2 -1
- package/src/agent-tooling/mcp/tools/construct.ts +130 -0
- package/src/agent-tooling/mcp/tools/debug.ts +126 -4
- package/src/agent-tooling/mcp/tools/reference.ts +104 -3
- package/src/agent-tooling/recipes/composed-thread.ts +714 -0
- package/src/agent-tooling/recipes/index.ts +22 -0
- package/src/agent-tooling/recipes/types.ts +32 -0
- package/src/agent-tooling/registry.ts +5 -0
- package/src/components/attachment-types.ts +7 -0
- package/src/components/audio-visualizer/fit-scale.ts +1 -1
- package/src/components/card-renderer.tsx +39 -8
- package/src/components/card.tsx +10 -2
- package/src/components/chat-scope-picker.tsx +2 -2
- package/src/components/chat-thread.tsx +602 -43
- package/src/components/choice-card.tsx +102 -37
- package/src/components/coachmark.tsx +1 -1
- package/src/components/code-block.tsx +2 -2
- package/src/components/composer.tsx +89 -15
- package/src/components/confirm-card.tsx +20 -4
- package/src/components/conversation-item.tsx +56 -9
- package/src/components/conversation-list.tsx +25 -10
- package/src/components/conversation-panel.tsx +118 -0
- package/src/components/empty.tsx +14 -3
- package/src/components/file-tree.tsx +5 -1
- package/src/components/form-widgets.tsx +257 -195
- package/src/components/form.tsx +297 -9
- package/src/components/home-panel.tsx +159 -0
- package/src/components/loader.tsx +12 -5
- package/src/components/message-skills.tsx +1 -1
- package/src/components/message.tsx +71 -11
- package/src/components/prompt-input.tsx +7 -1
- package/src/components/prompt-suggestion.tsx +4 -1
- package/src/components/reasoning.tsx +30 -3
- package/src/components/response-compare.tsx +2 -2
- package/src/components/scroll-button.tsx +56 -4
- package/src/components/source.tsx +6 -1
- package/src/components/tasks-card.tsx +58 -16
- package/src/components/thread.tsx +10 -1
- package/src/components/toast.tsx +1 -1
- package/src/components/tool-types.ts +9 -0
- package/src/components/widget-tab-bar.tsx +73 -0
- package/src/elements/attachments.tsx +3 -1
- package/src/elements/chat-workspace.tsx +1 -1
- package/src/elements/chat.tsx +115 -5
- package/src/elements/checkbox-group.tsx +164 -0
- package/src/elements/checkbox.tsx +134 -0
- package/src/elements/compiled.css +1 -1
- package/src/elements/composer.tsx +12 -1
- package/src/elements/conversation-item.tsx +62 -22
- package/src/elements/conversation-list.tsx +2 -2
- package/src/elements/define-entry.ts +12 -0
- package/src/elements/dock.tsx +11 -0
- package/src/elements/element-data-types.ts +40 -0
- package/src/elements/element-manifest.json +24 -0
- package/src/elements/element-meta.json +767 -34
- package/src/elements/element-nonscalar.json +17 -0
- package/src/elements/element-types.d.ts +380 -26
- package/src/elements/feedback-bar.tsx +5 -0
- package/src/elements/icon-names.json +29 -0
- package/src/elements/input.tsx +312 -23
- package/src/elements/message.tsx +2 -0
- package/src/elements/pane-grid.tsx +111 -0
- package/src/elements/prompt-input.tsx +8 -2
- package/src/elements/radio-group.tsx +129 -0
- package/src/elements/register-impl.ts +6 -0
- package/src/elements/scroll-button.tsx +54 -6
- package/src/elements/select.tsx +165 -0
- package/src/elements/slider.tsx +171 -0
- package/src/elements/slots.ts +1 -1
- package/src/elements/styles.css +89 -3
- package/src/elements/thread.tsx +2 -0
- package/src/elements/toast.tsx +14 -1
- package/src/index.ts +5 -2
- package/src/primitives/card-data-types.ts +49 -0
- package/src/primitives/card-host.tsx +4 -2
- package/src/primitives/card-routing.ts +7 -56
- package/src/primitives/card-schemas/form.schema.json +21 -1
- package/src/primitives/card-validate.ts +10 -2
- package/src/primitives/chat-config.tsx +33 -6
- package/src/primitives/conversation-store.ts +248 -0
- package/src/primitives/field-mask.ts +256 -0
- package/src/primitives/field-semantics.ts +115 -0
- package/src/primitives/input-mask.ts +853 -0
- package/src/primitives/toast-store.ts +66 -4
- package/src/primitives/url-scheme-policy.ts +70 -0
- package/src/primitives/use-resize-observer.ts +2 -2
- package/src/schemas/tool-defs.ts +12 -2
- package/src/solid.ts +20 -2
- package/src/state/index.ts +1 -1
- package/src/state/mock.ts +92 -6
- package/src/types.ts +45 -3
- package/src/ui/agent-card.tsx +2 -2
- package/src/ui/avatar.tsx +1 -1
- package/src/ui/checkbox-group.tsx +153 -0
- package/src/ui/checkbox.tsx +63 -0
- package/src/ui/dock.tsx +192 -7
- package/src/ui/icon.tsx +53 -0
- package/src/ui/input.tsx +249 -9
- package/src/ui/kbd.tsx +1 -1
- package/src/ui/nav.tsx +1 -1
- package/src/ui/pane-group.tsx +2 -2
- package/src/ui/radio.tsx +150 -0
- package/src/ui/select.tsx +168 -0
- package/src/ui/slider.tsx +178 -0
- package/src/ui/switch.tsx +49 -18
- package/src/utils/cn.ts +11 -5
- package/theme.css +112 -13
- package/dist/elements/chunks/action-icons-D9u3OzYW.js +0 -1
- package/dist/elements/chunks/arrow-left-CVh1TeN7.js +0 -1
- package/dist/elements/chunks/artifact-BkYcfIlZ.js +0 -1
- package/dist/elements/chunks/attachments-DwfNlubq.js +0 -1
- package/dist/elements/chunks/badge-Q0-Cmwzz.js +0 -1
- package/dist/elements/chunks/bash-InADTalH.js +0 -1
- package/dist/elements/chunks/card-renderer-3Dyl-FpN.js +0 -1
- package/dist/elements/chunks/card-routing-BK09BdmL.js +0 -1
- package/dist/elements/chunks/check-B5kBPKeo.js +0 -1
- package/dist/elements/chunks/chevron-down-DZ1GS39h.js +0 -1
- package/dist/elements/chunks/chevron-right-CvP7OUd2.js +0 -1
- package/dist/elements/chunks/choice-card-D4QUIOWZ.js +0 -1
- package/dist/elements/chunks/circle-CDf9g6MQ.js +0 -1
- package/dist/elements/chunks/circle-check-CA47Nqbz.js +0 -1
- package/dist/elements/chunks/circle-x-CJ_HVbC8.js +0 -1
- package/dist/elements/chunks/code-block-BdLiTitd.js +0 -1
- package/dist/elements/chunks/composer-Byve-n8K.js +0 -69
- package/dist/elements/chunks/confirm-card-B0flE3MN.js +0 -1
- package/dist/elements/chunks/controllable-DTwTIlwp.js +0 -1
- package/dist/elements/chunks/conversation-item-BDztezOG.js +0 -1
- package/dist/elements/chunks/copy-Nf-kqxXH.js +0 -1
- package/dist/elements/chunks/core-AYMC6_lb.js +0 -12
- package/dist/elements/chunks/css-M7EaDHN_.js +0 -1
- package/dist/elements/chunks/default-input-C2iLFq0b.js +0 -1
- package/dist/elements/chunks/define-wjHR1MkU.js +0 -1
- package/dist/elements/chunks/download-C4V7tBdb.js +0 -1
- package/dist/elements/chunks/embed-D3KewsIJ.js +0 -1
- package/dist/elements/chunks/engine-javascript-vq0WuIJl.js +0 -141
- package/dist/elements/chunks/file-text-D1G8khle.js +0 -1
- package/dist/elements/chunks/folder-WW2LGLid.js +0 -1
- package/dist/elements/chunks/form-CQirdC4W.js +0 -1
- package/dist/elements/chunks/github-dark-dimmed-DUshB20C.js +0 -1
- package/dist/elements/chunks/github-light-JYsPkUQd.js +0 -1
- package/dist/elements/chunks/hover-card-CJJkfHTK.js +0 -1
- package/dist/elements/chunks/html-CPZ3oZQ7.js +0 -1
- package/dist/elements/chunks/icon-Cfgmf4fa.js +0 -1
- package/dist/elements/chunks/info-DX3YMOt6.js +0 -1
- package/dist/elements/chunks/input-BtW9U6Sq.js +0 -1
- package/dist/elements/chunks/javascript-C25yR2R2.js +0 -1
- package/dist/elements/chunks/json-DxJze_jm.js +0 -1
- package/dist/elements/chunks/kbd-LGXwuT_V.js +0 -1
- package/dist/elements/chunks/link-2My69BqT.js +0 -1
- package/dist/elements/chunks/loader-iOxc_Tu-.js +0 -1
- package/dist/elements/chunks/message-VMZohrXx.js +0 -1
- package/dist/elements/chunks/message-circle-CpXMM-_n.js +0 -1
- package/dist/elements/chunks/message-square-DxcWtETQ.js +0 -1
- package/dist/elements/chunks/message-tZmV2A3p.js +0 -1
- package/dist/elements/chunks/paperclip-CRZVp4z_.js +0 -1
- package/dist/elements/chunks/progress-bar-DNy66e_E.js +0 -1
- package/dist/elements/chunks/prompt-suggestion-Bn64Nl7L.js +0 -1
- package/dist/elements/chunks/reasoning-Emn9N4-T.js +0 -1
- package/dist/elements/chunks/rotate-cw-CPWe37D9.js +0 -1
- package/dist/elements/chunks/scroll-area-ClZkZxIk.js +0 -1
- package/dist/elements/chunks/scroll-button-DPE-t3x_.js +0 -1
- package/dist/elements/chunks/share-CyfnNEqp.js +0 -1
- package/dist/elements/chunks/source-UWCvmVak.js +0 -1
- package/dist/elements/chunks/star-DoHFAikQ.js +0 -1
- package/dist/elements/chunks/store-Cjq0qwYN.js +0 -1
- package/dist/elements/chunks/svelte--5p79yCD.js +0 -1
- package/dist/elements/chunks/tasks-card-CmZ5xh6v.js +0 -1
- package/dist/elements/chunks/text-shimmer-DYn09zrz.js +0 -1
- package/dist/elements/chunks/textarea-skiGHURM.js +0 -1
- package/dist/elements/chunks/toast-store-CFnQpThX.js +0 -1
- package/dist/elements/chunks/tsx-B8rCNbgL.js +0 -1
- package/dist/elements/chunks/typescript-RycA9KXf.js +0 -1
- package/dist/elements/chunks/use-card-resolution-DoA2f_EU.js +0 -1
- package/dist/elements/chunks/vue-BmIZj4XD.js +0 -1
- package/dist/elements/chunks/x-B6UnOiLw.js +0 -1
- package/dist/llms/llms-full.txt +0 -2949
- package/dist/llms/llms.txt +0 -156
- package/dist/register-impl-DpE7icIb.js +0 -293
- package/dist/ui/stat.d.ts +0 -16
- package/src/ui/stat.tsx +0 -41
- /package/dist/{elements/chunks/card-tags-D8lZ-C_U.js → card-tags-D8lZ-C_U.js} +0 -0
- /package/dist/{elements/chunks/link-preview-DNILK391.js → link-preview-DNILK391.js} +0 -0
- /package/dist/{elements/chunks/slots-DaNjX0rc.js → slots-DaNjX0rc.js} +0 -0
package/dist/elements/compare.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{q as X,s as Y,w as Z,k as f,g as P,j as H,x as j,c as s,E as ee,i as u,S as v,d as R,I as U,a as k,b as C,u as te,t as m,m as re,e as ae,f as ne,A as oe,C as ie}from"../define-By-uL588.js";import{c as T}from"../cn-DN5AWfiS.js";import{B as de}from"../button-DkuOnGLy.js";import{C as q}from"../use-card-resolution-DaZqAdWf.js";import{M as O}from"../message-BYZECyek.js";import{T as le}from"../text-shimmer-Dcj1MHuq.js";import{c as se}from"../check-njkVdZu2.js";function ce(e){if(!Array.isArray(e))return{candidates:null,error:"This comparison couldn't be displayed."};if(e.length!==2)return{candidates:null,error:`A comparison needs exactly two candidates (got ${e.length}).`};const i=[],d=new Set;for(const r of e){if(!r||typeof r!="object")return{candidates:null,error:"This comparison couldn't be displayed."};const a=r;if(typeof a.id!="string"||a.id.length===0)return{candidates:null,error:"Each candidate needs a non-empty id."};if(d.has(a.id))return{candidates:null,error:`Duplicate candidate id "${a.id}".`};d.add(a.id),i.push({id:a.id,content:typeof a.content=="string"?a.content:"",reasoning:a.reasoning,tools:Array.isArray(a.tools)?a.tools:void 0,attachments:Array.isArray(a.attachments)?a.attachments:void 0,label:typeof a.label=="string"?a.label:void 0,model:typeof a.model=="string"?a.model:void 0,streaming:a.streaming===!0})}return{candidates:[i[0],i[1]]}}function ue(e,i){const d=e.filter(r=>r.id!==i).map(r=>r.id);return{chosenId:i,rejectedIds:d,at:Date.now()}}function pe(e){return e?e.some(i=>i.streaming===!0):!1}function B(e){const i=[];e.reasoning&&i.push({type:"reasoning",text:e.reasoning.text,label:e.reasoning.label});for(const d of e.tools??[])i.push({type:"tool",tool:d});for(const d of e.attachments??[])i.push({type:"file",attachment:d});return e.content&&i.push({type:"text",text:e.content}),i}var ge=m('<p class="text-sm text-foreground">'),me=m('<div role=tablist aria-label="Switch response">'),fe=m("<div role=radiogroup>"),ve=m("<div>"),he=m("<button type=button role=tab>"),ye=m('<span class="text-xs font-semibold uppercase tracking-wide text-muted-foreground">'),be=m('<span class="text-xs text-muted-foreground">'),xe=m('<div class="flex items-center gap-2">'),ke=m('<div><div class="min-w-0 flex-1">'),we=m('<div class="flex flex-col gap-2 rounded-lg border border-border bg-accent/40 p-3"><div class="flex items-center gap-2 text-sm font-medium text-accent-foreground"><span>Selected'),Ae=m('<p class="text-sm text-muted-foreground">Response selected.'),Se=m("<div class=min-w-0>");function Re(e){const[i,d]=P(void 0);H(j(e.data,()=>d(void 0),{defer:!0}));const r=f(()=>e.prop()??i()),a=f(()=>r()!==void 0),c=f(()=>e.prop()===void 0&&i()!==void 0);return{value:r,isResolved:a,isOptimistic:c,setLocal:d}}function Ce(e){var i;const d=X({compareId:"kai-compare",layout:"auto"},e),[r]=Y(d,["data","compareId","selection","layout","class","controllerRef","onSelect","onReady","onError"]),a=Z(),c=f(()=>{var t;return ce((t=r.data)==null?void 0:t.candidates)}),h=f(()=>c().candidates!==null),g=f(()=>c().error??""),b=f(()=>c().candidates),x=Re({prop:()=>r.selection,data:()=>r.data}),E=f(()=>pe(b())),[I,w]=P(0),[D,z]=P(0);let $;H(j(()=>r.data,()=>{w(0),z(0)})),H(j([h,E],([t,n])=>{var l,o;if(!t){(l=r.onError)==null||l.call(r,g());return}n||(o=r.onReady)==null||o.call(r)}));const G=f(()=>{var t;return(t=x.value())==null?void 0:t.chosenId}),_=f(()=>{var t;const n=G();return n===void 0||(t=b())==null?void 0:t.find(l=>l.id===n)}),M=t=>{var n;if(x.isResolved()||E())return;const l=b();if(!l)return;const o=ue(l,t.id);(n=r.onSelect)==null||n.call(r,o),x.setLocal(o)},F=(t,n)=>{var l;const o=$?.querySelectorAll('[role="radio"]');(l=o?.[t])==null||l.focus(n)};(i=r.controllerRef)==null||i.call(r,{select:t=>{var n;const l=(n=b())==null?void 0:n.find(o=>o.id===t);l&&M(l)},focus:t=>F(I(),t)});const J=t=>{if(x.isResolved())return;const n=b();if(!n)return;const l=o=>{w(o),z(o),F(o)};if(t.key==="ArrowRight"||t.key==="ArrowDown"||t.key==="ArrowLeft"||t.key==="ArrowUp")t.preventDefault(),l(I()===0?1:0);else if(t.key==="Home")t.preventDefault(),l(0);else if(t.key==="End")t.preventDefault(),l(1);else if(t.key===" "||t.key==="Enter"){t.preventDefault();const o=n[I()];o&&M(o)}},K=f(()=>{const t=r.layout;return t==="columns"?"grid grid-cols-2 gap-3":t==="tabs"?"grid grid-cols-1 gap-3":"grid grid-cols-1 gap-3 @[640px]/compare:grid-cols-2"}),N=()=>r.layout==="tabs"||r.layout==="auto",Q=()=>r.layout==="auto"?"@[640px]/compare:hidden":"",V=t=>{const n=r.layout;return n==="columns"||t===D()?"":n==="tabs"?"hidden":"hidden @[640px]/compare:block"},L=`kai-compare-prompt-${a}`,W=()=>{var t;return((t=r.data)==null?void 0:t.prompt)??"Compare two responses"};return s(v,{get when(){return h()},get fallback(){return s(q,{get errorMessage(){return g()||"This comparison couldn't be displayed."}})},get children(){return s(ee,{fallback:()=>{var t;return(t=r.onError)==null||t.call(r,"The comparison failed to render."),s(q,{errorMessage:"The comparison failed to render."})},get children(){var t=ve();return u(t,s(v,{get when(){var n;return(n=r.data)==null?void 0:n.prompt},get children(){var n=ge();return R(n,"id",L),u(n,()=>{var l;return(l=r.data)==null?void 0:l.prompt}),n}}),null),u(t,s(v,{get when(){return!x.isResolved()},get fallback(){return s($e,{get candidate(){return _()},get optimistic(){return x.isOptimistic()}})},get children(){return[s(v,{get when(){return N()},get children(){var n=me();return u(n,s(U,{get each(){return b()??[]},children:(l,o)=>(()=>{var p=he();return p.$$click=()=>{z(o),w(o)},u(p,()=>l().label??`Response ${l().id}`),k(y=>{var A=D()===o,S=T("rounded-md px-3 py-1 text-xs font-medium transition-colors",D()===o?"bg-muted text-foreground":"text-muted-foreground hover:text-foreground");return A!==y.e&&R(p,"aria-selected",y.e=A),S!==y.t&&C(p,y.t=S),y},{e:void 0,t:void 0}),p})()})),k(()=>C(n,T("flex gap-1",Q()))),n}}),(()=>{var n=fe();n.$$keydown=J;var l=$;return typeof l=="function"?te(l,n):$=n,u(n,s(U,{get each(){return b()??[]},children:(o,p)=>s(Ie,{get candidate(){return o()},get tabStop(){return p===I()},get disabled(){return E()},hiddenClass:()=>V(p),onFocus:()=>w(p),onPick:()=>{w(p),M(o())}})})),k(o=>{var p,y=W(),A=(p=r.data)!=null&&p.prompt?L:void 0,S=K();return y!==o.e&&R(n,"aria-label",o.e=y),A!==o.t&&R(n,"aria-describedby",o.t=A),S!==o.a&&C(n,o.a=S),o},{e:void 0,t:void 0,a:void 0}),n})()]}}),null),k(()=>C(t,T("flex flex-col gap-3",r.layout==="auto"&&"@container/compare",r.class))),t}})}})}function Ie(e){const i=()=>e.candidate.label??e.candidate.model??e.candidate.id;return(()=>{var d=ke(),r=d.firstChild;return u(d,s(v,{get when(){return e.candidate.label||e.candidate.model},get children(){var a=xe();return u(a,s(v,{get when(){return e.candidate.label},get children(){var c=ye();return u(c,()=>e.candidate.label),c}}),null),u(a,s(v,{get when(){return e.candidate.model},get children(){var c=be();return u(c,()=>e.candidate.model),c}}),null),a}}),r),u(r,s(v,{get when(){return e.candidate.streaming},get fallback(){return s(O,{get parts(){return B(e.candidate)},isUser:!1,markdown:!0})},get children(){return s(le,{class:"text-sm",children:"Generating response\u2026"})}})),u(d,s(de,{type:"button",role:"radio","aria-checked":!1,get"aria-label"(){return`Pick ${i()}`},get"data-candidate-id"(){return e.candidate.id},variant:"outline",size:"sm",class:"mt-auto w-full",get disabled(){return e.disabled},get tabindex(){return e.tabStop?0:-1},get onFocus(){return e.onFocus},onClick:a=>{a.stopPropagation(),e.onPick()},children:"Pick this"}),null),k(()=>{var a;return C(d,T("flex min-w-0 flex-col gap-3 rounded-lg border border-border bg-background/40 p-3",(a=e.hiddenClass)==null?void 0:a.call(e)))}),d})()}function $e(e){return(()=>{var i=we(),d=i.firstChild,r=d.firstChild;return r.firstChild,u(d,s(se,{size:16,"aria-hidden":"true"}),r),u(r,(()=>{var a=re(()=>{var c;return!!((c=e.candidate)!=null&&c.label)});return()=>a()?`: ${e.candidate.label}`:""})(),null),u(i,s(v,{get when(){return e.candidate},get fallback(){return Ae()},children:a=>(()=>{var c=Se();return u(c,s(O,{get parts(){return B(a())},isUser:!1,markdown:!0})),c})()}),null),k(()=>R(i,"role",e.optimistic?"status":void 0)),i})()}ae(["keydown","click"]),ne("kai-compare",{data:void 0,compareId:void 0,selection:void 0,layout:"auto",proseSize:void 0,codeTheme:void 0,codeHighlight:void 0},(e,{element:i,dispatch:d,expose:r})=>{const a=()=>e.compareId??(i.id||"kai-compare"),c=oe();let h;return r({select:g=>h?.select(g),focus:g=>h?.focus(g)}),s(ie,{get proseSize(){return e.proseSize},get codeTheme(){return e.codeTheme},get codeHighlight(){return e.codeHighlight},get portalMount(){return c.portalMount()},get children(){return s(Ce,{get data(){return e.data},get compareId(){return a()},get selection(){return e.selection},get layout(){return e.layout??"auto"},controllerRef:g=>h=g,onSelect:g=>d("kai-compare-select",g),onReady:()=>d("kai-ready",{compareId:a()}),onError:g=>d("kai-error",{compareId:a(),message:g})})}})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as d,g as u,c as s}from"
|
|
1
|
+
import{f as d,g as u,c as s}from"../define-By-uL588.js";import{C as c}from"../composer-sQ0HcvyG.js";function v(e,r,n){var o;return{id:e.getAttribute("item-id")??"",label:((o=e.textContent)==null?void 0:o.trim())||e.getAttribute("label")||e.getAttribute("item-id")||"",icon:e.getAttribute("icon")??void 0,promptText:e.getAttribute("prompt-text")??void 0,data:void 0}}d("kai-composer",{value:void 0,placeholder:void 0,disabled:!1,loading:!1,maxHeight:240,submitOnEnter:!0,triggers:void 0,highlights:void 0,kindIcons:void 0},(e,{dispatch:r,flag:n,expose:o})=>{const[l,g]=u(e.value),a=()=>e.value??l();let i;return o({focus:t=>i?.focus(t),blur:()=>i?.blur(),clear:()=>i?.clear(),send:()=>i?.send(),insertEntity:t=>i?.insertEntity(t)}),s(c,{get value(){return a()},get placeholder(){return e.placeholder},get disabled(){return n("disabled")},get loading(){return n("loading")},get maxHeight(){return e.maxHeight},get submitOnEnter(){return n("submitOnEnter")},get triggers(){return e.triggers},get highlights(){return e.highlights},get kindIcons(){return e.kindIcons},onChange:t=>{g(t.doc),r("kai-value-change",{doc:t.doc,text:t.text,entities:t.entities})},onSubmit:t=>{r("kai-submit",{doc:t.doc,text:t.text,entities:t.entities})},onEntityAdd:t=>r("kai-entity-add",{entity:t}),onEntityRemove:t=>r("kai-entity-remove",{entity:t}),onTrigger:t=>r("kai-trigger",t),onTriggerClose:()=>r("kai-trigger-close",{}),onFocus:t=>r("kai-focus",{originalEvent:t}),onBlur:t=>r("kai-blur",{originalEvent:t}),controllerRef:t=>i=t})});export{v as parseKaiTriggerItemElement};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as d,c as u}from"
|
|
1
|
+
import{f as d,c as u}from"../define-By-uL588.js";import{C as s}from"../confirm-card-rQWDQsnC.js";d("kai-confirm",{data:void 0,cardId:void 0,heading:void 0,autofocus:!1,resolution:void 0},(r,{element:i,flag:t,expose:n})=>{let o;return n({focus:e=>o?.focus(e),confirm:e=>o?.confirm(e),dismiss:()=>o?.dismiss(),reopen:()=>o?.reopen()}),u(s,{get data(){return r.data},get cardId(){return r.cardId??(i.id||"kai-confirm")},get heading(){return r.heading},get autofocus(){return t("autofocus")},get resolution(){return r.resolution},controllerRef:e=>o=e,hostElement:i})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as d,
|
|
1
|
+
import{f as d,k as g,j as i,x as l,c as t,i as r,S as s,t as T}from"../define-By-uL588.js";import{h as k,C as x,a as m,b as v,c as p,d as w,e as f,f as C,i as j,j as D,g as S,D as b,k as y}from"../context-0kg4ZX1J.js";var E=T("<div class=space-y-1.5>");d("kai-context",{context:void 0,warnThreshold:void 0,dangerThreshold:void 0},(e,{dispatch:c})=>{const o=()=>e.warnThreshold??b,a=()=>e.dangerThreshold??y,h=g(()=>{const n=e.context;return n?k(n.usedTokens/n.maxTokens,o(),a()):"ok"});return i(l(h,(n,u)=>{u!==void 0&&n!==u&&c("kai-threshold-change",{level:n})})),t(s,{get when(){return e.context},get children(){return t(x,{get usedTokens(){return e.context.usedTokens},get maxTokens(){return e.context.maxTokens},get inputTokens(){return e.context.inputTokens},get outputTokens(){return e.context.outputTokens},get reasoningTokens(){return e.context.reasoningTokens},get cacheTokens(){return e.context.cacheTokens},get estimatedCost(){return e.context.estimatedCost},get warnThreshold(){return o()},get dangerThreshold(){return a()},get children(){return[t(m,{}),t(v,{get children(){return[t(p,{}),t(w,{get children(){var n=E();return r(n,t(f,{}),null),r(n,t(C,{}),null),r(n,t(s,{get when(){return e.context.reasoningTokens},get children(){return t(j,{})}}),null),r(n,t(s,{get when(){return e.context.cacheTokens},get children(){return t(D,{})}}),null),n}}),t(S,{})]}})]}})}})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as
|
|
1
|
+
import{f as b,g as c,o as h,h as w,c as _,v as r,m as n,t as a}from"../define-By-uL588.js";import{r as $,a as A}from"../slots-DaNjX0rc.js";import{S as I}from"../conversation-item-BxwQLaFJ.js";import{i as m,r as S}from"../conversation-list-BCfGN1JU.js";var k=a("<slot>"),M=a("<slot name=leading>"),O=a("<slot name=meta>"),C=a("<slot name=menu>");b("kai-conversation-item",{conversationId:void 0,active:void 0,compact:void 0},(v,{element:e,flag:i,reflectFlag:u,dispatch:d})=>{const[o,l]=c({}),[g,p]=c(!1);h(()=>{const t=()=>l($(e,A));t();const s=new MutationObserver(t);s.observe(e,{childList:!0,attributes:!0,subtree:!0}),w(()=>s.disconnect()),e.hasAttribute("role")||e.setAttribute("role","listitem"),p(m(e))});const f=()=>{m(e)&&d("kai-select",{id:S(e)})};return u("active"),_(I,{get conversationId(){return v.conversationId},get active(){return i("active")},get compact(){return i("compact")},hostSemantics:!0,get onActivate(){return g()?f:void 0},get leading(){return n(()=>!!o().leading)()?(()=>{var t=M();return t._$owner=r(),t})():void 0},get meta(){return n(()=>!!o().meta)()?(()=>{var t=O();return t._$owner=r(),t})():void 0},get menu(){return n(()=>!!o().menu)()?(()=>{var t=C();return t._$owner=r(),t})():void 0},get children(){var t=k();return t._$owner=r(),t}})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as l,m as U,s as F,g as I,l as C,o as T,i as m,S as f,u as H,a as E,F as K,j as A,b as G,t as d,d as J,e as Q,f as V,h as W,k as X,v as N}from"./chunks/define-wjHR1MkU.js";import{c as Y}from"./chunks/controllable-DTwTIlwp.js";import{r as Z,b as ee}from"./chunks/slots-DaNjX0rc.js";import{c as M}from"./chunks/cn-CU7UAWzk.js";import{a as te,b as re,C as ne}from"./chunks/collapsible-BzbXpPzr.js";import{B as q}from"./chunks/button-flUbeufF.js";import{B as oe}from"./chunks/badge-Q0-Cmwzz.js";import{S as _}from"./chunks/scroll-area-ClZkZxIk.js";import{C as z}from"./chunks/conversation-item-BDztezOG.js";import{I as ae}from"./chunks/Icon--Y8vsFal.js";var le=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]],ie=o=>l(ae,U(o,{name:"PanelLeftOpen",iconNode:le})),ce=ie,se=d('<div class="px-3 pb-2"><div class="flex items-center gap-2 rounded-md bg-surface-strong px-2.5 py-1.5"><svg width=13 height=13 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 class=text-muted-foreground><circle cx=11 cy=11 r=8></circle><line x1=21 y1=21 x2=16.65 y2=16.65></line></svg><input type=text placeholder="Search chats..."aria-label="Search chats"class="bg-transparent text-[13px] text-foreground placeholder:text-muted-foreground rounded-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring w-full">'),ue=d('<div role=list aria-label=Conversations part=items class="space-y-0.5 py-1">'),de=d('<div class="flex flex-1 flex-col items-center justify-center gap-1 p-6 text-center text-sm text-muted-foreground">No conversations match your search'),ge=d('<div class="space-y-0.5 py-1">'),he=d('<div class="shrink-0 border-t border-border">'),ve=d("<div>"),pe=d('<svg width=16 height=16 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><line x1=3 y1=12 x2=21 y2=12></line><line x1=3 y1=6 x2=21 y2=6></line><line x1=3 y1=18 x2=21 y2=18>'),fe=d('<svg width=16 height=16 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><line x1=12 y1=5 x2=12 y2=19></line><line x1=5 y1=12 x2=19 y2=12>'),me=d('<div class="flex items-center justify-between p-3 pb-2"><div class="flex items-center gap-2"><span class="text-sm font-semibold text-foreground">Chats'),xe=d('<div class="flex flex-1 flex-col items-center justify-center gap-1 p-6 text-center text-sm text-muted-foreground">No conversations yet'),ye=d('<svg width=10 height=10 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><polyline points="6 9 12 15 18 9">'),we=d("<span>"),be=d('<div class="pl-2 mt-0.5 space-y-0.5">');function ke(o){return l(q,{variant:"ghost",size:"icon-sm","aria-label":"Open sidebar",get class(){return M("rounded-full bg-card/80 shadow-sm backdrop-blur",o.class)},get onClick(){return o.onExpand},get children(){return l(ce,{class:"size-4"})}})}function R(o){const e=o.conversationId;return typeof e=="string"&&e?e:o.getAttribute("conversation-id")??o.id}function Ce(o){const e=n=>{const r=o.getItems();return n.composedPath().find(s=>r.includes(s))},v=n=>{var r;return((r=n.shadowRoot)==null?void 0:r.querySelector("[data-kai-item-body]"))??n},g=n=>n.composedPath().some(r=>r instanceof Element&&(r.hasAttribute("data-kai-item-menu")||r.getAttribute("slot")==="menu")),p=(n,r,s)=>{n.getAttribute(r)!==s&&n.setAttribute(r,s)},w=n=>{const r=new Map;for(const s of n){const u=v(s);u===s&&s.localName.includes("-")||r.set(s,u)}return r},x=(n,r)=>{for(const[s,u]of w(n))p(u,"tabindex",s===r?"0":"-1")};return{sync:()=>{const n=o.getItems(),r=o.getActiveId(),s=w(n);let u;for(const[a,t]of s){const c=r!==void 0&&R(a)===r;t.hasAttribute("role")||t.setAttribute("role","button"),p(t,"aria-current",c?"true":"false");const h=a;h.active!==c&&(h.active=c),c&&(u=a)}x(n,u??s.keys().next().value)},handleClick(n){const r=e(n);!r||g(n)||o.onSelect(R(r))},handleKeyDown(n){const r=o.getItems();if(r.length===0)return;const s=e(n);if(n.key==="Enter"||n.key===" "){if(!s||g(n))return;n.preventDefault(),o.onSelect(R(s));return}let u;const a=s?r.indexOf(s):r.findIndex(t=>v(t).getAttribute("tabindex")==="0");n.key==="ArrowDown"?u=r[Math.min(a+1,r.length-1)]:n.key==="ArrowUp"?u=r[Math.max(a-1,0)]:n.key==="Home"?u=r[0]:n.key==="End"&&(u=r[r.length-1]),u&&(n.preventDefault(),x(r,u),v(u).focus())}}}function Se(o){const[e]=F(o,["groups","conversations","activeId","onSelect","onNewChat","onToggleSidebar","header","footer","empty","compact","onSearchChange","controllerRef","items","itemsKeyDown","itemsClick","class"]),[v,g]=I(""),p=C(()=>e.items!=null),w=C(()=>e.conversations.length===0);let x;const n=a=>{var t;g(a),(t=e.onSearchChange)==null||t.call(e,a)};T(()=>{var a;(a=e.controllerRef)==null||a.call(e,{focus:t=>x?.focus(t),clearSearch:()=>n("")})});const r=C(()=>{const a=v().toLowerCase();return a?e.conversations.filter(t=>t.title.toLowerCase().includes(a)):e.conversations}),s=C(()=>{const a=new Map;for(const t of r()){const c=t.groupId;a.has(c)||a.set(c,[]),a.get(c).push(t)}return a}),u=C(()=>{const a=new Set((e.groups??[]).map(t=>t.id));return r().filter(t=>t.groupId==null||!a.has(t.groupId))});return(()=>{var a=ve();return m(a,l(f,{get when(){return e.header},get fallback(){return(()=>{var t=me(),c=t.firstChild,h=c.firstChild;return m(c,l(q,{variant:"ghost",size:"icon-sm","aria-label":"Toggle sidebar",get onClick(){return e.onToggleSidebar},get children(){return pe()}}),h),m(t,l(q,{variant:"ghost",size:"icon-sm","aria-label":"New chat",get onClick(){return e.onNewChat},get children(){return fe()}}),null),t})()},get children(){return e.header}}),null),m(a,l(f,{get when(){return p()||!w()},get children(){var t=se(),c=t.firstChild,h=c.firstChild,k=h.nextSibling;k.$$input=b=>n(b.currentTarget.value);var y=x;return typeof y=="function"?H(y,k):x=k,E(()=>k.value=v()),t}}),null),m(a,l(f,{get when(){return p()},get children(){return l(_,{class:"flex-1 px-2",get children(){var t=ue();return t.$$click=c=>{var h;return(h=e.itemsClick)==null?void 0:h.call(e,c)},t.$$keydown=c=>{var h;return(h=e.itemsKeyDown)==null?void 0:h.call(e,c)},m(t,()=>e.items),t}})}}),null),m(a,l(f,{get when(){return A(()=>!p())()&&!w()},get fallback(){return l(f,{get when(){return!p()},get children(){return l(f,{get when(){return e.empty},get fallback(){return xe()},get children(){return e.empty}})}})},get children(){return[l(f,{get when(){return r().length===0},get children(){return de()}}),l(f,{get when(){return r().length>0},get children(){return l(_,{class:"flex-1 px-2",get children(){return[l(K,{get each(){return e.groups},children:t=>{const c=C(()=>s().get(t.id)??[]);return l(f,{get when(){return c().length>0},get children(){return l(L,{get name(){return t.name},get count(){return c().length},get conversations(){return c()},get activeId(){return e.activeId},get onSelect(){return e.onSelect},get compact(){return e.compact}})}})}}),l(f,{get when(){return u().length>0},get children(){return l(f,{get when(){return e.compact},get fallback(){return l(L,{name:"Ungrouped",get count(){return u().length},get conversations(){return u()},get activeId(){return e.activeId},get onSelect(){return e.onSelect}})},get children(){var t=ge();return m(t,l(K,{get each(){return u()},children:c=>l(z,{conversation:c,get isActive(){return c.id===e.activeId},get onSelect(){return e.onSelect},compact:!0})})),t}})}})]}})}})]}}),null),m(a,l(f,{get when(){return e.footer},get children(){var t=he();return m(t,()=>e.footer),t}}),null),E(()=>G(a,M("flex flex-col h-full bg-sidebar",e.class))),a})()}function L(o){const[e,v]=I(!0);return l(ne,{get open(){return e()},onOpenChange:v,get children(){return[l(te,{class:"flex items-center gap-1.5 w-full px-1.5 py-1 rounded-md text-[13px] text-muted-foreground font-medium hover:bg-muted/30 transition-colors cursor-pointer mt-1.5",get children(){return[(()=>{var g=ye();return E(()=>J(g,"class",M("transition-transform",!e()&&"-rotate-90"))),g})(),(()=>{var g=we();return m(g,()=>o.name),g})(),l(oe,{variant:"count",class:"ml-auto text-[11px]",get children(){return o.count}})]}}),l(re,{get children(){var g=be();return m(g,l(K,{get each(){return o.conversations},children:p=>l(z,{conversation:p,get isActive(){return p.id===o.activeId},get onSelect(){return o.onSelect},get compact(){return o.compact}})})),g}})]}})}Q(["input","keydown","click"]);var Ie=d("<slot>"),Ae=d("<slot name=header>"),$e=d("<slot name=footer>"),De=d("<slot name=empty>");function j(o){var e;return{id:o.getAttribute("id")??"",title:((e=o.textContent)==null?void 0:e.trim())??"",groupId:o.getAttribute("group-id")??void 0,messageCount:0,updatedAt:""}}V("kai-conversations",{groups:[],conversations:[],activeId:void 0,collapsed:void 0,defaultCollapsed:void 0,compact:void 0},(o,{dispatch:e,element:v,expose:g,flag:p})=>{const[w,x]=I([]),[n,r]=I([]),[s,u]=I({});T(()=>{const i=()=>{const $=[...v.querySelectorAll("kai-conversation")];x($.map(j));const D=[...v.querySelectorAll(":scope > kai-conversation-item")];r(B=>B.length===D.length&&D.every((P,O)=>P===B[O])?B:D),u(Z(v,ee)),D.length&&c.sync()};i();const S=new MutationObserver(i);S.observe(v,{childList:!0,attributes:!0,subtree:!0}),W(()=>S.disconnect())});const a=()=>n().length>0,t=()=>[...o.conversations??[],...w()],c=Ce({getItems:n,getActiveId:()=>o.activeId,onSelect:i=>e("kai-conversation-select",{id:i})});X(()=>{a()&&c.sync()});const[h,k]=Y(()=>o.collapsed,p("defaultCollapsed")),y=i=>{k(i),e("kai-collapse-toggle",{collapsed:i})};let b;return g({focus:i=>{var S,$;b?b.focus(i):($=(S=v.shadowRoot)==null?void 0:S.querySelector("input"))==null||$.focus(i)},clear:()=>b?.clearSearch(),select:i=>e("kai-conversation-select",{id:i}),collapse:()=>y(!0),expand:()=>y(!1),toggle:()=>y(!h())}),l(f,{get when(){return!h()},get fallback(){return l(ke,{onExpand:()=>y(!1)})},get children(){return l(Se,{get groups(){return o.groups??[]},get conversations(){return t()},get activeId(){return o.activeId},onSelect:i=>e("kai-conversation-select",{id:i}),onNewChat:()=>e("kai-new-chat"),onToggleSidebar:()=>{e("kai-toggle-sidebar"),y(!0)},get compact(){return p("compact")},onSearchChange:i=>e("kai-search",{query:i}),controllerRef:i=>b=i,get items(){return A(()=>!!a())()?(()=>{var i=Ie();return i._$owner=N(),i})():void 0},get itemsKeyDown(){return c.handleKeyDown},get itemsClick(){return c.handleClick},get header(){return A(()=>!!s().header)()?(()=>{var i=Ae();return i._$owner=N(),i})():void 0},get footer(){return A(()=>!!s().footer)()?(()=>{var i=$e();return i._$owner=N(),i})():void 0},get empty(){return A(()=>!!s().empty)()?(()=>{var i=De();return i._$owner=N(),i})():void 0}})}})});export{j as parseKaiConversationElement};
|
|
1
|
+
import{f as D,g as m,o as R,h as j,j as E,c as h,m as d,v as u,S as L,t as g}from"../define-By-uL588.js";import{c as M}from"../controllable-CnGpMF6r.js";import{r as N,b as T}from"../slots-DaNjX0rc.js";import{c as z,C as B,a as F}from"../conversation-list-BCfGN1JU.js";var H=g("<slot>"),O=g("<slot name=header>"),V=g("<slot name=footer>"),W=g("<slot name=empty>");function b(r){var t;return{id:r.getAttribute("id")??"",title:((t=r.textContent)==null?void 0:t.trim())??"",groupId:r.getAttribute("group-id")??void 0,messageCount:0,updatedAt:""}}D("kai-conversations",{groups:[],conversations:[],activeId:void 0,collapsed:void 0,defaultCollapsed:void 0,compact:void 0},(r,{dispatch:t,element:o,expose:C,flag:f})=>{const[S,I]=m([]),[k,A]=m([]),[v,x]=m({});R(()=>{const e=()=>{const c=[...o.querySelectorAll("kai-conversation")];I(c.map(b));const l=[...o.querySelectorAll(":scope > kai-conversation-item")];A(p=>p.length===l.length&&l.every(($,K)=>$===p[K])?p:l),x(N(o,T)),l.length&&i.sync()};e();const s=new MutationObserver(e);s.observe(o,{childList:!0,attributes:!0,subtree:!0}),j(()=>s.disconnect())});const y=()=>k().length>0,q=()=>[...r.conversations??[],...S()],i=z({getItems:k,getActiveId:()=>r.activeId,onSelect:e=>t("kai-conversation-select",{id:e})});E(()=>{y()&&i.sync()});const[w,_]=M(()=>r.collapsed,f("defaultCollapsed")),a=e=>{_(e),t("kai-collapse-toggle",{collapsed:e})};let n;return C({focus:e=>{var s,c;n?n.focus(e):(c=(s=o.shadowRoot)==null?void 0:s.querySelector("input"))==null||c.focus(e)},clear:()=>n?.clearSearch(),select:e=>t("kai-conversation-select",{id:e}),collapse:()=>a(!0),expand:()=>a(!1),toggle:()=>a(!w())}),h(L,{get when(){return!w()},get fallback(){return h(F,{onExpand:()=>a(!1)})},get children(){return h(B,{get groups(){return r.groups??[]},get conversations(){return q()},get activeId(){return r.activeId},onSelect:e=>t("kai-conversation-select",{id:e}),onNewChat:()=>t("kai-new-chat"),onToggleSidebar:()=>{t("kai-toggle-sidebar"),a(!0)},get compact(){return f("compact")},onSearchChange:e=>t("kai-search",{query:e}),controllerRef:e=>n=e,get items(){return d(()=>!!y())()?(()=>{var e=H();return e._$owner=u(),e})():void 0},get itemsKeyDown(){return i.handleKeyDown},get itemsClick(){return i.handleClick},get header(){return d(()=>!!v().header)()?(()=>{var e=O();return e._$owner=u(),e})():void 0},get footer(){return d(()=>!!v().footer)()?(()=>{var e=V();return e._$owner=u(),e})():void 0},get empty(){return d(()=>!!v().empty)()?(()=>{var e=W();return e._$owner=u(),e})():void 0}})}})});export{b as parseKaiConversationElement};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @kitn.ai/ui/define — the facade seam, public.
|
|
3
|
+
*
|
|
4
|
+
* The construct engine's GENERATED projects (and any consumer who wants to wrap
|
|
5
|
+
* a pure-Solid interior as one self-registering element) import from here. Its
|
|
6
|
+
* own subpath rather than ./solid because define.tsx carries ELEMENT_CSS (the
|
|
7
|
+
* full compiled kit CSS) and solid-element — weight ./solid consumers must not
|
|
8
|
+
* pay. SSR-safe by construction: defineWebComponent no-ops without
|
|
9
|
+
* customElements (see define.tsx).
|
|
10
|
+
*/
|
|
11
|
+
export { defineWebComponent } from './define.js';
|
|
12
|
+
export type { WebComponentContext } from './define.js';
|
package/dist/elements/dialog.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as B,g as $,w as F,
|
|
1
|
+
import{A as B,g as $,w as F,j as G,c as x,P as I,u as D,i as w,S as O,d as p,a as J,b as H,t as h,e as N,f as Q,o as U,h as V,v as E,m as L}from"../define-By-uL588.js";import{c as z}from"../cn-DN5AWfiS.js";import{c as X}from"../overlay-Cb-MkyDa.js";import{w as Y}from"../disclosure-WUImBbDv.js";var Z=h('<header part=header class="shrink-0 border-b border-border px-5 py-4 text-base font-semibold text-foreground">'),ee=h('<footer part=footer class="flex shrink-0 items-center justify-end gap-2 border-t border-border px-5 py-3">'),te=h('<div part=backdrop><div part=panel role=dialog aria-modal=true tabindex=-1><div part=body class="min-h-0 flex-1 overflow-auto px-5 py-4 text-sm text-foreground">');const _=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])','[tabindex]:not([tabindex="-1"])'].join(",");function oe(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)&&getComputedStyle(t).visibility!=="hidden"}function ne(t){const a=[],u=f=>{for(const l of Array.from(f.children))if(l instanceof HTMLSlotElement)for(const i of l.assignedElements())i instanceof HTMLElement&&(i.matches(_)&&a.push(i),u(i));else l instanceof HTMLElement&&(l.matches(_)&&a.push(l),u(l))};return u(t),a.filter(oe)}function A(){var t;let a=document.activeElement;for(;(t=a?.shadowRoot)!=null&&t.activeElement;)a=a.shadowRoot.activeElement;return a}function re(t){var a;const u=B(),[f,l]=$(t.defaultOpen??!1),i=`kai-dialog-title-${F()}`,v=()=>t.open!==void 0,m=()=>v()?!!t.open:f(),b=o=>{var n;v()||l(o),(n=t.onOpenChange)==null||n.call(t,o)};(a=t.controllerRef)==null||a.call(t,{open:m,setOpen:b});const c=X(m);let y,d,r=null,k=!1;G(o=>{const n=m();if(n&&!o)r=A(),queueMicrotask(()=>d?.focus());else if(!n&&o){const s=r;r=null,s&&s.isConnected&&queueMicrotask(()=>s.focus())}return n},!1);const K=o=>{if(o.key==="Escape"){o.stopPropagation(),b(!1);return}if(o.key!=="Tab"||!d)return;const n=ne(d);if(!n.length){o.preventDefault(),d.focus();return}const s=A(),e=s?n.indexOf(s):-1;o.shiftKey?e<=0&&(o.preventDefault(),n[n.length-1].focus()):(e===-1||e===n.length-1)&&(o.preventDefault(),n[0].focus())},W=o=>{k&&o.target===y&&b(!1),k=!1};return x(O,{get when(){return c.present()},get children(){return x(I,{get mount(){return u.portalMount()},get children(){var o=te(),n=o.firstChild,s=n.firstChild;return o.$$keydown=K,o.$$click=W,o.$$pointerdown=e=>{k=e.target===e.currentTarget},D(e=>{y=e,c.setRef(e)},o),D(e=>{var g;d=e,(g=t.panelRef)==null||g.call(t,e)},n),w(n,x(O,{get when(){return t.header},get children(){var e=Z();return p(e,"id",i),w(e,()=>t.header),e}}),s),w(s,()=>t.children),w(n,x(O,{get when(){return t.footer},get children(){var e=ee();return w(e,()=>t.footer),e}}),null),J(e=>{var g=c.state()==="open"?"":void 0,M=c.state()==="closed"?"":void 0,R=z("fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4","animate-in fade-in-0 data-[closed]:animate-out data-[closed]:fade-out-0 motion-reduce:animate-none"),C=t.header?i:void 0,S=t.header?void 0:t["aria-label"],T=c.state()==="open"?"":void 0,j=c.state()==="closed"?"":void 0,q=z("flex max-h-[85vh] w-full max-w-lg flex-col overflow-hidden rounded-xl border border-border bg-background text-foreground shadow-xl outline-none","animate-in fade-in-0 zoom-in-95 data-[closed]:animate-out data-[closed]:fade-out-0 data-[closed]:zoom-out-95 motion-reduce:animate-none",t.class);return g!==e.e&&p(o,"data-expanded",e.e=g),M!==e.t&&p(o,"data-closed",e.t=M),R!==e.a&&H(o,e.a=R),C!==e.o&&p(n,"aria-labelledby",e.o=C),S!==e.i&&p(n,"aria-label",e.i=S),T!==e.n&&p(n,"data-expanded",e.n=T),j!==e.s&&p(n,"data-closed",e.s=j),q!==e.h&&H(n,e.h=q),e},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0}),o}})}})}N(["pointerdown","click","keydown"]);var ae=h("<slot>"),le=h("<slot name=header>"),ie=h("<slot name=footer>");const P="Dialog";function de(t){return typeof t=="string"&&t.trim()!==""?t:P}Q("kai-dialog",{open:void 0,defaultOpen:void 0,label:P},(t,a)=>{const{flag:u,element:f,expose:l}=a;let i,v;Y(a,()=>i,()=>t.open);const[m,b]=$(!1),[c,y]=$(!1),d=()=>{b(!!f.querySelector(':scope > [slot="header"]')),y(!!f.querySelector(':scope > [slot="footer"]'))};return U(()=>{if(d(),typeof MutationObserver=="function"){const r=new MutationObserver(d);r.observe(f,{childList:!0}),V(()=>r.disconnect())}}),l({focus:r=>v?.focus(r)}),x(re,{get defaultOpen(){return u("defaultOpen")},get"aria-label"(){return de(t.label)},get header(){return L(()=>!!m())()?(()=>{var r=le();return r._$owner=E(),r})():void 0},get footer(){return L(()=>!!c())()?(()=>{var r=ie();return r._$owner=E(),r})():void 0},controllerRef:r=>i=r,panelRef:r=>v=r,get children(){var r=ae();return r._$owner=E(),r}})});
|
package/dist/elements/dock.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c,w as
|
|
1
|
+
import{c as d,w as U,g as Y,j as W,z as B,u as H,d as p,i as v,m as _,S as C,a as V,J as q,l as E,t as f,e as j,f as J,v as x}from"../define-By-uL588.js";import{x as K}from"../x-Z5UntkIJ.js";import{m as G}from"../message-circle-DruwObfX.js";import{w as Q}from"../disclosure-WUImBbDv.js";var Z=f(`<style>
|
|
2
2
|
:host { display: contents; }
|
|
3
3
|
|
|
4
4
|
[data-kai-dock] {
|
|
@@ -37,7 +37,12 @@ import{c,w as F,g as U,k as V,z as N,u as D,d as h,i as x,j as Y,S as H,a as q,H
|
|
|
37
37
|
/* ABOVE the panel, always. At <=480px the panel goes fixed/inset:0 and it comes
|
|
38
38
|
after the launcher in DOM order, so at z-index:auto it painted OVER the launcher
|
|
39
39
|
and a touch user lost every pointer route to closing. Both reference
|
|
40
|
-
implementations stacked the launcher over the panel for the same reason.
|
|
40
|
+
implementations stacked the launcher over the panel for the same reason. The
|
|
41
|
+
launcher itself is now HIDDEN while the panel is open at that width (see the
|
|
42
|
+
<=480px block below) in favour of the in-panel [part="close"] X, but this
|
|
43
|
+
z-index still matters for the moment between "open" landing and the panel's
|
|
44
|
+
own transition finishing, and for any consumer CSS that reintroduces the
|
|
45
|
+
launcher there. */
|
|
41
46
|
z-index: 1;
|
|
42
47
|
flex: none;
|
|
43
48
|
display: inline-flex;
|
|
@@ -66,6 +71,58 @@ import{c,w as F,g as U,k as V,z as N,u as D,d as h,i as x,j as Y,S as H,a as q,H
|
|
|
66
71
|
[data-kai-dock] [part="launcher"]:focus-visible { outline: 2px solid var(--color-ring); outline-offset: 2px; }
|
|
67
72
|
[data-kai-dock] [part="launcher"]:disabled { opacity: 0.55; cursor: not-allowed; }
|
|
68
73
|
|
|
74
|
+
/* The mobile-only close affordance rendered INSIDE the panel. Hidden by default and
|
|
75
|
+
only switched on inside the <=480px media block below, alongside the rule that
|
|
76
|
+
hides the launcher while the panel is open at that width \u2014 same query drives both,
|
|
77
|
+
CSS-only, no JS viewport logic. Absolutely positioned against the panel, which is
|
|
78
|
+
the panel's own containing block once the narrow-viewport rule below sets it to
|
|
79
|
+
position: fixed.
|
|
80
|
+
|
|
81
|
+
The inset is a CONSUMER-OVERRIDABLE TOKEN, same idiom as every other geometry
|
|
82
|
+
value in this file (--kai-dock-width and friends). The dock is content-agnostic \u2014
|
|
83
|
+
it never reads what is slotted into the panel \u2014 so it cannot know whether that
|
|
84
|
+
content renders its own trailing controls (a ChatThread header-end slot with
|
|
85
|
+
share/settings icons, say) in the same top-right corner.
|
|
86
|
+
|
|
87
|
+
The mobile block below reserves a BAND of the panel's own padding above whatever
|
|
88
|
+
is slotted, sized to this button's own footprint, so nothing paints under this X
|
|
89
|
+
by default -- verified fix (round 1) against a real ChatThread header-end slot
|
|
90
|
+
colliding with it at 375px. Owner feedback on the real widget (round 2): for a
|
|
91
|
+
construct with only a title in the header, that band read as a dead empty strip
|
|
92
|
+
with the X floating alone in it -- "that doesn't look like the empty component
|
|
93
|
+
either, lets do better." The actual fix composes instead of reserving space:
|
|
94
|
+
ChatThread now has its own headerEndContent escape hatch (see its prop doc) so a
|
|
95
|
+
caller puts the close control INSIDE the header row, sharing it with the title --
|
|
96
|
+
zero collision by construction, no band needed. hideClose on this component (see
|
|
97
|
+
its prop doc) then suppresses this built-in X for exactly that case, and the
|
|
98
|
+
band above is scoped to :not([data-hide-close]) so it comes off ONLY there --
|
|
99
|
+
every other consumer (anyone who hasn't opted into hideClose, including a
|
|
100
|
+
hand-authored dock with real header-end content) keeps the band, same as round 1
|
|
101
|
+
shipped, so the collision it fixed stays fixed for them. What remains here for
|
|
102
|
+
that default case is a plain absolute overlay, top-right of the panel, with
|
|
103
|
+
these consumer-overridable inset tokens for the rare case it should deliberately
|
|
104
|
+
sit in front of something (e.g. a single small badge). */
|
|
105
|
+
[data-kai-dock] [part="close"] {
|
|
106
|
+
display: none;
|
|
107
|
+
position: absolute;
|
|
108
|
+
inset-block-start: var(--kai-dock-close-inset-block, 0.75rem);
|
|
109
|
+
inset-inline-end: var(--kai-dock-close-inset-inline, 0.75rem);
|
|
110
|
+
z-index: 1;
|
|
111
|
+
align-items: center;
|
|
112
|
+
justify-content: center;
|
|
113
|
+
inline-size: 2.25rem;
|
|
114
|
+
block-size: 2.25rem;
|
|
115
|
+
padding: 0;
|
|
116
|
+
border: 0;
|
|
117
|
+
border-radius: 9999px;
|
|
118
|
+
background: var(--color-background);
|
|
119
|
+
color: var(--color-foreground);
|
|
120
|
+
box-shadow: 0 2px 8px -2px rgb(0 0 0 / 0.3);
|
|
121
|
+
cursor: pointer;
|
|
122
|
+
}
|
|
123
|
+
[data-kai-dock] [part="close"]:hover { background: var(--color-muted, var(--color-background)); }
|
|
124
|
+
[data-kai-dock] [part="close"]:focus-visible { outline: 2px solid var(--color-ring); outline-offset: 2px; }
|
|
125
|
+
|
|
69
126
|
[data-kai-dock] [part="badge"] {
|
|
70
127
|
position: absolute;
|
|
71
128
|
inset-block-start: 3px;
|
|
@@ -73,7 +130,7 @@ import{c,w as F,g as U,k as V,z as N,u as D,d as h,i as x,j as Y,S as H,a as q,H
|
|
|
73
130
|
inline-size: 0.75rem;
|
|
74
131
|
block-size: 0.75rem;
|
|
75
132
|
border-radius: 9999px;
|
|
76
|
-
background: var(--color-
|
|
133
|
+
background: var(--color-unread);
|
|
77
134
|
box-shadow: 0 0 0 2px var(--color-primary);
|
|
78
135
|
}
|
|
79
136
|
|
|
@@ -120,10 +177,12 @@ import{c,w as F,g as U,k as V,z as N,u as D,d as h,i as x,j as Y,S as H,a as q,H
|
|
|
120
177
|
[data-kai-dock][data-position^="top"] [part="panel"][data-closed] { transform: translateY(-0.5rem); }
|
|
121
178
|
|
|
122
179
|
/* Narrow viewports take the panel full-bleed. A SHIPPED DEFAULT, not a prop: both
|
|
123
|
-
references wrote this rule independently, which makes it a HOW.
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
180
|
+
references wrote this rule independently, which makes it a HOW. While the panel is
|
|
181
|
+
OPEN at this width the launcher hides and the panel's own [part="close"] X becomes
|
|
182
|
+
the pointer close route instead \u2014 a FAB floating over a full-bleed panel read as
|
|
183
|
+
wrong (owner feedback) and Escape alone strands a touch user with no visible
|
|
184
|
+
affordance at all. Closed, the launcher is unaffected: it is the panel's own
|
|
185
|
+
[data-expanded] state that gates both rules below, not the media query alone. */
|
|
127
186
|
@media (max-width: 480px) {
|
|
128
187
|
[data-kai-dock] [part="panel"] {
|
|
129
188
|
position: fixed;
|
|
@@ -135,6 +194,41 @@ import{c,w as F,g as U,k as V,z as N,u as D,d as h,i as x,j as Y,S as H,a as q,H
|
|
|
135
194
|
border: 0;
|
|
136
195
|
border-radius: 0;
|
|
137
196
|
}
|
|
197
|
+
|
|
198
|
+
/* Reserve a band for the built-in [part="close"] X ABOVE whatever is slotted,
|
|
199
|
+
rather than overlaying it on top of the panel's own content \u2014 the fix round 1
|
|
200
|
+
collision protection (verified against a real ChatThread header-end slot at
|
|
201
|
+
375px: without this, the X painted directly over trailing icon buttons).
|
|
202
|
+
DERIVED from the button's own inset + size tokens, not a second hand-typed
|
|
203
|
+
number.
|
|
204
|
+
|
|
205
|
+
SCOPED to :not([data-hide-close]) \u2014 round 2 (owner feedback: the band read as
|
|
206
|
+
a dead strip when nothing but the X occupied it) removed this UNCONDITIONALLY
|
|
207
|
+
and reintroduced the very collision round 1 fixed, for every consumer who
|
|
208
|
+
never opted into hideClose. hideClose is only true for a caller that supplies
|
|
209
|
+
its OWN close control in its own header row (ChatThread's headerEndContent is
|
|
210
|
+
the one that does today) \u2014 the built-in X and this band both come off
|
|
211
|
+
together for that case, since there is nothing left for the band to protect.
|
|
212
|
+
Every other consumer -- including a hand-authored kai-dock with real
|
|
213
|
+
slot="header-end" content and no opinion on hideClose -- keeps the band, the
|
|
214
|
+
same as round 1 shipped. */
|
|
215
|
+
[data-kai-dock]:not([data-hide-close]) [part="panel"] {
|
|
216
|
+
padding-block-start: calc(2 * var(--kai-dock-close-inset-block, 0.75rem) + 2.25rem);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/* The full-bleed panel gets its own close affordance instead of relying on the
|
|
220
|
+
launcher, which is hidden below while the panel is open at this width \u2014 a FAB
|
|
221
|
+
floating over a full-bleed panel with no other visible close route is exactly
|
|
222
|
+
what the owner flagged. Escape and the X both still work; the launcher comes
|
|
223
|
+
back the instant the panel closes because data-expanded is gone by then.
|
|
224
|
+
Absolutely positioned, so the padding-block-start above (a content-box
|
|
225
|
+
concern) does not shift IT \u2014 only the in-flow slotted content. Content that
|
|
226
|
+
supplies its own close control passes hideClose, which drops the button from
|
|
227
|
+
the render tree entirely (see the component body) rather than being gated
|
|
228
|
+
here \u2014 so this rule stays a plain, unconditional width-query switch; the band
|
|
229
|
+
above is what actually varies with hideClose. */
|
|
230
|
+
[data-kai-dock] [part="close"] { display: inline-flex; }
|
|
231
|
+
[data-kai-dock]:has([part="panel"][data-expanded]) [part="launcher"] { display: none; }
|
|
138
232
|
}
|
|
139
233
|
|
|
140
234
|
@media (prefers-reduced-motion: reduce) {
|
|
@@ -146,4 +240,4 @@ import{c,w as F,g as U,k as V,z as N,u as D,d as h,i as x,j as Y,S as H,a as q,H
|
|
|
146
240
|
[data-kai-dock] [part="panel"][data-expanded] { transition: none; }
|
|
147
241
|
[data-kai-dock] [part="panel"][data-closed] { transform: none; }
|
|
148
242
|
}
|
|
149
|
-
`),
|
|
243
|
+
`),ee=f("<span part=badge aria-hidden=true>"),te=f("<button type=button part=close>"),ae=f("<div data-kai-dock><button part=launcher type=button><span aria-hidden=true style=display:inline-flex></span></button><div part=panel role=dialog aria-modal=false tabindex=-1>");function F(){return d(G,{size:24})}function z(){return d(K,{size:24})}function oe(){var e;let s=document.activeElement;for(;(e=s?.shadowRoot)!=null&&e.activeElement;)s=s.shadowRoot.activeElement;return s}function ne(e,s){let o=s;for(;o;){if(o===e)return!0;const w=o instanceof Element?o.assignedSlot:null;if(w){o=w;continue}if(o.parentNode){o=o.parentNode;continue}o=o instanceof ShadowRoot?o.host:null}return!1}function ie(e){var s;const o=`kai-dock-panel-${U()}`,[w,O]=Y(e.defaultOpen??!1),b=()=>e.open!==void 0,n=()=>b()?!!e.open:w(),h=r=>{var i;b()||O(r),(i=e.onOpenChange)==null||i.call(e,r)};(s=e.controllerRef)==null||s.call(e,{open:n,setOpen:h});let k,g;const a=()=>e.label??"Chat",c=()=>n()?e.closeLabel??`Close ${a()}`:e.openLabel??`Open ${a()}`,y=()=>{var r;const i=e.focusOnOpen??"content";if(i!=="none"){if(i==="content"){const m=(r=e.contentTarget)==null?void 0:r.call(e);if(m?.focus(),m&&ne(k,oe()))return}k?.focus()}};W(r=>{const i=n();return i!==r&&queueMicrotask(i?y:()=>g?.focus()),i},B(()=>e.open??e.defaultOpen??!1));const P=r=>{r.key!=="Escape"||!n()||h(!1)};return[Z(),(()=>{var r=ae(),i=r.firstChild,m=i.firstChild,l=i.nextSibling;return r.$$keydown=P,i.$$click=()=>h(!n()),H(t=>{var u;g=t,(u=e.launcherRef)==null||u.call(e,t)},i),p(i,"aria-controls",o),v(i,d(C,{get when(){return _(()=>!!e.unread)()&&!n()},get children(){return ee()}}),m),v(m,d(C,{get when(){return n()},get fallback(){return e.launcher??d(F,{})},get children(){return e.launcherOpen??e.launcher??d(z,{})}})),H(t=>{var u;k=t,(u=e.panelRef)==null||u.call(e,t)},l),p(l,"id",o),v(l,d(C,{get when(){return!e.hideClose},get children(){var t=te();return t.$$click=()=>h(!1),v(t,d(z,{})),V(()=>p(t,"aria-label",c())),t}}),null),v(l,()=>e.children,null),V(t=>{var u=e.position??"bottom-end",T=!!e.hideClose,I=n()?"true":"false",S=c(),R=e.disabled||void 0,N=a(),L=n()?"":void 0,D=n()?void 0:"",A=!n(),$=n()?"visible":"hidden",M=n()?"1":"0",X=n()?"auto":"none";return u!==t.e&&p(r,"data-position",t.e=u),T!==t.t&&q(r,"data-hide-close",t.t=T),I!==t.a&&p(i,"aria-expanded",t.a=I),S!==t.o&&p(i,"aria-label",t.o=S),R!==t.i&&(i.disabled=t.i=R),N!==t.n&&p(l,"aria-label",t.n=N),L!==t.s&&p(l,"data-expanded",t.s=L),D!==t.h&&p(l,"data-closed",t.h=D),A!==t.r&&q(l,"inert",t.r=A),$!==t.d&&E(l,"visibility",t.d=$),M!==t.l&&E(l,"opacity",t.l=M),X!==t.u&&E(l,"pointer-events",t.u=X),t},{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,l:void 0,u:void 0}),r})()]}j(["keydown","click"]);var re=f("<slot name=panel>"),se=f("<slot>"),le=f("<slot name=launcher>"),de=f("<slot name=launcher-open><slot name=launcher>");J("kai-dock",{open:void 0,defaultOpen:void 0,position:"bottom-end",label:"Chat",openLabel:void 0,closeLabel:void 0,unread:void 0,disabled:void 0,hideClose:void 0,focusOnOpen:"content"},(e,s)=>{const{flag:o,element:w,expose:O,reflectFlag:b}=s;let n,h,k;Q(s,()=>n,()=>e.open),b("unread"),b("disabled"),b("defaultOpen"),b("hideClose");const g=B(()=>o("open")||o("defaultOpen"));return O({focus:a=>{var c;return(c=n!=null&&n.open()?h:k)==null?void 0:c.focus(a)}}),d(ie,{defaultOpen:g,get position(){return e.position},get label(){return e.label},get openLabel(){return e.openLabel},get closeLabel(){return e.closeLabel},get unread(){return o("unread")},get disabled(){return o("disabled")},get hideClose(){return o("hideClose")},get focusOnOpen(){return e.focusOnOpen},contentTarget:()=>{const a=h?.querySelectorAll("slot");for(const c of Array.from(a??[])){const y=c.assignedElements()[0];if(y instanceof HTMLElement)return y}},controllerRef:a=>n=a,panelRef:a=>h=a,launcherRef:a=>k=a,get launcher(){return(()=>{var a=le();return a._$owner=x(),v(a,d(F,{})),a})()},get launcherOpen(){return(()=>{var a=de(),c=a.firstChild;return a._$owner=x(),c._$owner=x(),v(c,d(z,{})),a})()},get children(){return[(()=>{var a=re();return a._$owner=x(),a})(),(()=>{var a=se();return a._$owner=x(),a})()]}})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as c,c as t,v as s,i as n,S as i,
|
|
1
|
+
import{f as c,c as t,v as s,i as n,S as i,m as u,t as o}from"../define-By-uL588.js";import{D as f,a as m,c as p}from"../dropdown-wZVeJOMd.js";import{r as d}from"../icon-CdcfRhYI.js";import{c as b}from"../cn-DN5AWfiS.js";import{w as v}from"../disclosure-WUImBbDv.js";import{e as h}from"../ellipsis-CbOpJnU3.js";var w=o("<style>:host([full]){display:block}"),I=o("<slot name=trigger>"),x=o("<slot>");c("kai-dropdown",{triggerIcon:void 0,triggerLabel:void 0,triggerIconTrailing:void 0,label:void 0,full:!1,open:void 0,defaultOpen:void 0,disabled:void 0},(r,g)=>{const{flag:l}=g;let a;return v(g,()=>a,()=>r.open),[w(),t(p,{get defaultOpen(){return l("defaultOpen")},get disabled(){return l("disabled")},controllerRef:e=>a=e,get children(){return[t(f,{get class(){return b("inline-flex items-center rounded-md transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",r.triggerLabel?"gap-1.5 px-2 py-1.5 text-sm font-medium text-muted-foreground hover:bg-accent hover:text-foreground":"justify-center p-1.5 text-foreground hover:bg-muted",l("full")&&"w-full")},get"aria-label"(){return u(()=>!!r.triggerLabel)()?void 0:r.label??"Open menu"},get children(){var e=I();return e._$owner=s(),n(e,t(i,{get when(){return r.triggerIcon},get children(){return d(r.triggerIcon,{class:"size-4 shrink-0"})}}),null),n(e,t(i,{get when(){return r.triggerLabel},get children(){return r.triggerLabel}}),null),n(e,t(i,{get when(){return r.triggerIconTrailing},get children(){return d(r.triggerIconTrailing,{class:"size-3.5 shrink-0 opacity-60"})}}),null),n(e,t(i,{get when(){return u(()=>!r.triggerIcon)()&&!r.triggerLabel},get children(){return t(h,{class:"size-4"})}}),null),e}}),t(m,{class:"min-w-[10rem]",get children(){var e=x();return e._$owner=s(),e}})]}})]});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as y,
|
|
1
|
+
import{g as y,j as g,i as E,c as k,a as D,d as q,b as S,S as C,t as x,z as p,u as R,e as j,f as z}from"../define-By-uL588.js";import{c as $}from"../cn-DN5AWfiS.js";import{I as K}from"../input-DKbmkMos.js";var F=x("<span>"),I=x("<span part=text>");function T(a){const[s,r]=y(!!a.editing);g(()=>r(!!a.editing));const[n,u]=y(a.value);g(()=>u(a.value));let c,l=!1;const f=()=>{const e=c?.querySelector("input");e&&(e.focus(),e.select())};g(()=>{s()&&queueMicrotask(f)});const m=()=>{a.disabled||r(!0)},v=e=>{var d;p(s)&&(r(!1),e!==p(n)&&(u(e),(d=a.onRename)==null||d.call(a,e)))},o=()=>{var e;p(s)&&(r(!1),(e=a.onCancel)==null||e.call(a))},h=e=>{const d=e.currentTarget;e.key==="Enter"?(e.preventDefault(),l=!0,v(d.value)):e.key==="Escape"&&(e.preventDefault(),l=!0,o())},t=e=>{if(l){l=!1;return}v(e)};return(()=>{var e=F(),d=c;return typeof d=="function"?R(d,e):c=e,E(e,k(C,{get when(){return s()},get fallback(){return(()=>{var b=I();return b.$$keydown=i=>{!a.disabled&&(i.key==="Enter"||i.key==="F2")&&(i.preventDefault(),m())},b.$$dblclick=m,E(b,()=>n()||a.placeholder||""),D(i=>{var A=a.disabled?void 0:0,w=$("inline-block max-w-full truncate rounded px-1 py-0.5 text-sm text-foreground",a.disabled?"cursor-default opacity-60":"cursor-text hover:bg-muted",!n()&&"text-muted-foreground");return A!==i.e&&q(b,"tabindex",i.e=A),w!==i.t&&S(b,i.t=w),i},{e:void 0,t:void 0}),b})()},get children(){return k(K,{get value(){return n()},get placeholder(){return a.placeholder},get disabled(){return a.disabled},size:"sm",class:"h-7 py-0",get"aria-label"(){return a.placeholder??"Edit label"},onKeyDown:h,onValueChange:t})}})),D(()=>S(e,$("inline-flex max-w-full items-center",a.class))),e})()}j(["dblclick","keydown"]);var B=x("<style>:host{display:inline-flex}");z("kai-editable-label",{value:void 0,editing:!1,placeholder:void 0,disabled:!1},(a,s)=>{const{element:r,dispatch:n,flag:u,expose:c}=s,[l,f]=y(a.value??r.getAttribute("value")??""),m=t=>t==null?r.getAttribute("value")??"":String(t);Object.defineProperty(r,"value",{get:()=>l(),set:t=>{const e=m(t);p(l)!==e&&f(e)},configurable:!0,enumerable:!0}),g(()=>{const t=l();t?r.getAttribute("value")!==t&&r.setAttribute("value",t):r.hasAttribute("value")&&r.removeAttribute("value")});const[v,o]=y(u("editing"));g(()=>o(u("editing"))),g(()=>{v()?r.hasAttribute("editing")||r.setAttribute("editing",""):r.hasAttribute("editing")&&r.removeAttribute("editing")});const h=()=>{var t;return((t=r.shadowRoot)==null?void 0:t.querySelector("input"))??null};return c({edit:()=>{u("disabled")||o(!0)},commit:()=>{var t;(t=h())==null||t.blur()},cancel:()=>{const t=h();t?t.dispatchEvent(new KeyboardEvent("keydown",{key:"Escape",bubbles:!0,composed:!0})):p(v)&&(o(!1),n("kai-cancel",{}))}}),[B(),k(T,{get value(){return l()},get editing(){return v()},get placeholder(){return a.placeholder},get disabled(){return u("disabled")},onRename:t=>{o(!1),t!==p(l)&&(f(t),n("kai-rename",{value:t}))},onCancel:()=>{o(!1),n("kai-cancel",{})}})]});
|
|
@@ -34,6 +34,43 @@ export interface KaiSegmentedOption {
|
|
|
34
34
|
label: string;
|
|
35
35
|
icon?: string;
|
|
36
36
|
}
|
|
37
|
+
/** A single row of `<kai-radio-group>`.
|
|
38
|
+
*
|
|
39
|
+
* Distinct from the Solid `RadioOption`, whose `label` and `description` are JSX
|
|
40
|
+
* nodes: on the element both are plain strings, because an element property has to
|
|
41
|
+
* survive being assigned from HTML/React/Vue/Svelte with no framework in between. */
|
|
42
|
+
export interface KaiRadioOption {
|
|
43
|
+
value: string;
|
|
44
|
+
label: string;
|
|
45
|
+
description?: string;
|
|
46
|
+
disabled?: boolean;
|
|
47
|
+
}
|
|
48
|
+
/** A single row of `<kai-checkbox-group>`.
|
|
49
|
+
*
|
|
50
|
+
* Distinct from the Solid `CheckboxOption`, whose `value` is generic and whose
|
|
51
|
+
* `label` and `description` are JSX nodes: on the element all three are plain
|
|
52
|
+
* strings, because an element property has to survive being assigned from
|
|
53
|
+
* HTML/React/Vue/Svelte with no framework in between. Structurally identical to
|
|
54
|
+
* `KaiRadioOption`, and kept as its own name anyway: the two elements are free to
|
|
55
|
+
* diverge, and a consumer typing a checkbox list should not have to import the radio
|
|
56
|
+
* group's type to do it. */
|
|
57
|
+
export interface KaiCheckboxOption {
|
|
58
|
+
value: string;
|
|
59
|
+
label: string;
|
|
60
|
+
description?: string;
|
|
61
|
+
disabled?: boolean;
|
|
62
|
+
}
|
|
63
|
+
/** A single choice in `<kai-select>`.
|
|
64
|
+
*
|
|
65
|
+
* Distinct from the Solid `SelectOption`, whose `value` is generic: on the element
|
|
66
|
+
* it is a string, because a native `<option>`'s value is a string and an element
|
|
67
|
+
* property has to survive being assigned from HTML/React/Vue/Svelte with no
|
|
68
|
+
* framework in between. `label` defaults to `value`. */
|
|
69
|
+
export interface KaiSelectOption {
|
|
70
|
+
value: string;
|
|
71
|
+
label?: string;
|
|
72
|
+
disabled?: boolean;
|
|
73
|
+
}
|
|
37
74
|
/** A single citation in `<kai-sources>`' `sources` property. Also the shape
|
|
38
75
|
* `<kai-source>` light-DOM children are parsed into. */
|
|
39
76
|
export interface KaiSourceItem {
|
package/dist/elements/embed.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as t,c as e}from"
|
|
1
|
+
import{f as t,c as e}from"../define-By-uL588.js";import{E as o}from"../embed-CrfjkbUG.js";import{e as m}from"../card-routing-0YidER_3.js";t("kai-embed",{cardId:void 0,data:void 0},(r,{element:a})=>e(o,{get cardId(){return r.cardId??""},get data(){return r.data??{provider:"generic"}},onEmit:d=>m(a,d)}));
|
package/dist/elements/empty.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as i,
|
|
1
|
+
import{s as i,p as c,q as l,i as d,t as a,f,c as s,v as o,S as m}from"../define-By-uL588.js";import{c as g}from"../index-xu_pdcPi.js";import{c as u}from"../cn-DN5AWfiS.js";var v=a("<div data-slot=empty>"),h=a("<div data-slot=empty-header>"),p=a("<div data-slot=empty-media>"),x=a("<div data-slot=empty-title>"),y=a("<p data-slot=empty-description>"),w=a("<div data-slot=empty-content>");function b(r){const[t,n]=i(r,["class","children"]);return(()=>{var e=v();return c(e,l({get class(){return u("flex min-w-0 flex-1 flex-col items-center justify-center gap-6 rounded-lg p-6",t.class)}},n),!1,!0),d(e,()=>t.children),e})()}function k(r){const[t,n]=i(r,["class","children"]);return(()=>{var e=h();return c(e,l({get class(){return u("flex max-w-sm flex-col items-center gap-2 text-center",t.class)}},n),!1,!0),d(e,()=>t.children),e})()}const T=g("flex shrink-0 items-center justify-center mb-2 [&_svg]:size-6",{variants:{variant:{default:"bg-transparent",icon:"bg-muted text-foreground size-10 rounded-lg"}},defaultVariants:{variant:"default"}});function _(r){const[t,n]=i(r,["class","variant","children"]);return(()=>{var e=p();return c(e,l({get"data-variant"(){return t.variant??"default"},get class(){return u(T({variant:t.variant}),t.class)}},n),!1,!0),d(e,()=>t.children),e})()}function j(r){const[t,n]=i(r,["class","children"]);return(()=>{var e=x();return c(e,l({get class(){return u("text-title font-medium tracking-tight text-center text-balance",t.class)}},n),!1,!0),d(e,()=>t.children),e})()}function z(r){const[t,n]=i(r,["class","children"]);return(()=>{var e=y();return c(e,l({get class(){return u("text-muted-foreground text-body text-center text-balance [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary",t.class)}},n),!1,!0),d(e,()=>t.children),e})()}function $(r){const[t,n]=i(r,["class","children"]);return(()=>{var e=w();return c(e,l({get class(){return u("flex w-full max-w-sm min-w-0 flex-col items-center gap-2 text-sm text-balance",t.class)}},n),!1,!0),d(e,()=>t.children),e})()}var q=a("<slot name=media>"),C=a("<slot>");f("kai-empty",{emptyTitle:"",description:""},r=>s(b,{get children(){return[s(k,{get children(){return[s(_,{variant:"icon",get children(){var t=q();return t._$owner=o(),t}}),s(m,{get when(){return r.emptyTitle},get children(){return s(j,{get children(){return r.emptyTitle}})}}),s(m,{get when(){return r.description},get children(){return s(z,{get children(){return r.description}})}})]}}),s($,{get children(){var t=C();return t._$owner=o(),t}})]}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as v,i as t,c as r,M as x,S,F as W,a as T,d as B,b as $,r as H,t as g,e as I,f as N}from"
|
|
1
|
+
import{g as v,i as t,c as r,M as x,S,F as W,a as T,d as B,b as $,r as H,t as g,e as I,f as N}from"../define-By-uL588.js";import{c as j}from"../cn-DN5AWfiS.js";import{B as z}from"../button-DkuOnGLy.js";import{T as q}from"../textarea-Dpvbngbg.js";import{a as A,t as E}from"../thumbs-up-CsT9Wzb9.js";import{c as G}from"../check-njkVdZu2.js";import{x as D}from"../x-Z5UntkIJ.js";var J=g('<div class="flex w-full items-center justify-between"><div class="flex flex-1 items-center justify-start gap-4 py-3 pl-4"><span class="text-foreground font-medium"></span></div><div class="flex items-center justify-center gap-0.5 px-3 py-0"><button type=button class="text-muted-foreground hover:text-foreground flex size-8 items-center justify-center rounded-md transition-colors"aria-label=Helpful></button><button type=button class="text-muted-foreground hover:text-foreground flex size-8 items-center justify-center rounded-md transition-colors"aria-label="Not helpful"></button></div><div class="border-border flex items-center justify-center border-l"><button type=button class="text-muted-foreground hover:text-foreground flex items-center justify-center rounded-md p-3"aria-label=Close>'),K=g('<div class="flex flex-wrap gap-1.5">'),O=g('<div class="flex w-[min(22rem,80vw)] flex-col gap-2.5 p-3"><div class="flex items-center justify-between"><span class="text-foreground font-medium"></span><button type=button aria-label=Skip class="text-muted-foreground hover:text-foreground"></button></div><div class="flex justify-end gap-2">'),Q=g('<div class="flex items-center gap-2 px-4 py-3"role=status><span class="text-foreground font-medium">'),R=g("<div>"),U=g("<button type=button>");function V(e){const[u,f]=v("ask"),[b,M]=v(),[p,L]=v(),[k,P]=v(""),y=i=>{var l;M(i),(l=e.onFeedback)==null||l.call(e,i),f(i==="not-helpful"&&e.collectDetail?"detail":"thanks")},F=()=>{var i;(i=e.onSubmitDetail)==null||i.call(e,{value:b(),category:p(),comment:k()||void 0}),f("thanks")};return(()=>{var i=R();return t(i,r(H,{get children(){return[r(x,{get when(){return u()==="ask"},get children(){var l=J(),n=l.firstChild,m=n.firstChild,h=n.nextSibling,s=h.firstChild,a=s.nextSibling,c=h.nextSibling,o=c.firstChild;return t(n,r(S,{get when(){return e.icon},get children(){return e.icon}}),m),t(m,()=>e.title),s.$$click=()=>y("helpful"),t(s,r(A,{class:"size-4"})),a.$$click=()=>y("not-helpful"),t(a,r(E,{class:"size-4"})),o.$$click=()=>{var d;return(d=e.onClose)==null?void 0:d.call(e)},t(o,r(D,{class:"size-5"})),l}}),r(x,{get when(){return u()==="detail"},get children(){var l=O(),n=l.firstChild,m=n.firstChild,h=m.nextSibling,s=n.nextSibling;return t(m,()=>e.detailTitle??"What went wrong?"),h.$$click=()=>f("thanks"),t(h,r(D,{class:"size-4"})),t(l,r(S,{get when(){var a;return(a=e.categories)==null?void 0:a.length},get children(){var a=K();return t(a,r(W,{get each(){return e.categories},children:c=>(()=>{var o=U();return o.$$click=()=>L(p()===c?void 0:c),t(o,c),T(d=>{var w=p()===c,C=j("rounded-full border px-2.5 py-1 text-xs transition-colors",p()===c?"border-primary bg-primary text-primary-foreground":"border-border text-muted-foreground hover:text-foreground");return w!==d.e&&B(o,"aria-pressed",d.e=w),C!==d.t&&$(o,d.t=C),d},{e:void 0,t:void 0}),o})()})),a}}),s),t(l,r(q,{get value(){return k()},onInput:a=>P(a.currentTarget.value),get placeholder(){return e.detailPlaceholder??"Tell us more (optional)"},class:"border-border min-h-[3rem] rounded-md border px-2 py-1.5"}),s),t(s,r(z,{variant:"ghost",size:"sm",onClick:()=>f("thanks"),children:"Skip"}),null),t(s,r(z,{variant:"default",size:"sm",onClick:F,get children(){return e.submitLabel??"Submit"}}),null),l}}),r(x,{get when(){return u()==="thanks"},get children(){var l=Q(),n=l.firstChild;return t(l,r(G,{class:"size-4 text-emerald-500"}),n),t(n,()=>e.thanksMessage??"Thanks for your feedback"),l}})]}})),T(()=>$(i,j("bg-background border-border inline-flex rounded-[12px] border text-sm",e.class))),i})()}I(["click"]),N("kai-feedback-bar",{barTitle:"Was this helpful?",collectDetail:void 0,categories:void 0,detailTitle:void 0,detailPlaceholder:void 0,submitLabel:void 0,thanksMessage:void 0},(e,{dispatch:u,flag:f})=>r(V,{get title(){return e.barTitle},get collectDetail(){return f("collectDetail")},get categories(){return e.categories},get detailTitle(){return e.detailTitle},get detailPlaceholder(){return e.detailPlaceholder},get submitLabel(){return e.submitLabel},get thanksMessage(){return e.thanksMessage},onFeedback:b=>u("kai-feedback",{value:b}),onSubmitDetail:b=>u("kai-feedback-detail",b),onClose:()=>u("kai-close")}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as d,i as m,c as n,t as i}from"
|
|
1
|
+
import{f as d,i as m,c as n,t as i}from"../define-By-uL588.js";import{F as f}from"../file-tree-CJqM2aP7.js";var h=i("<style>:host{display:block;height:100%;min-height:0}"),o=i('<div style="display:grid;grid-template-rows:minmax(0, 1fr);grid-template-columns:minmax(0, 1fr);height:100%;min-height:0"><div class="overflow-auto scrollbar-thin py-1.5"style=min-height:0>');d("kai-file-tree",{files:[],activeFile:void 0,defaultExpanded:void 0,summary:!1},(e,{dispatch:a,flag:r})=>[h(),(()=>{var t=o(),l=t.firstChild;return m(l,n(f,{get files(){return e.files},get activeFile(){return e.activeFile},get defaultExpanded(){return e.defaultExpanded},get summary(){return r("summary")},onSelect:s=>a("kai-select",{path:s})})),t})()]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{s as b,H as x,p as y,q as A,i as h,g as $,j as w,h as F,c as v,u as R,a as T,d as j,m as D,G as P,t as f,e as q,f as z,v as C}from"../define-By-uL588.js";import{u as G}from"../upload-TcAHXv9W.js";var I=f("<input type=file class=hidden aria-hidden=true>"),_=f("<button type=button>");const E=P();function H(o){const[r]=b(o,["onFilesAdded","children","multiple","accept","disabled"]);let s;const[d,u]=$(!1);let a=0;const g=()=>r.multiple??!0,m=e=>{const t=Array.from(e);g()?r.onFilesAdded(t):r.onFilesAdded(t.slice(0,1))};w(()=>{const e=n=>{n.preventDefault(),n.stopPropagation()},t=n=>{var p;e(n),a++,(p=n.dataTransfer)!=null&&p.items.length&&u(!0)},i=n=>{e(n),a--,a===0&&u(!1)},c=n=>{var p;e(n),u(!1),a=0,(p=n.dataTransfer)!=null&&p.files.length&&m(n.dataTransfer.files)},l=window;l.addEventListener("dragenter",t),l.addEventListener("dragleave",i),l.addEventListener("dragover",e),l.addEventListener("drop",c),F(()=>{l.removeEventListener("dragenter",t),l.removeEventListener("dragleave",i),l.removeEventListener("dragover",e),l.removeEventListener("drop",c)})});const L=e=>{var t;const i=e.target;(t=i.files)!=null&&t.length&&(m(i.files),i.value="")},k={isDragging:d,get inputRef(){return s},setInputRef:e=>{s=e},multiple:r.multiple,disabled:r.disabled};return v(E.Provider,{value:k,get children(){return[(()=>{var e=I();return e.$$input=L,R(t=>{s=t},e),T(t=>{var i=g(),c=r.accept,l=r.disabled;return i!==t.e&&(e.multiple=t.e=i),c!==t.t&&j(e,"accept",t.t=c),l!==t.a&&(e.disabled=t.a=l),t},{e:void 0,t:void 0,a:void 0}),e})(),D(()=>r.children)]}})}function O(o){const[r,s]=b(o,["class","children"]),d=x(E),u=()=>{var a;return(a=d?.inputRef)==null?void 0:a.click()};return(()=>{var a=_();return a.$$click=u,y(a,A({get class(){return r.class}},s),!1,!0),h(a,()=>r.children),a})()}q(["input","click"]);var S=f("<slot>");z("kai-file-upload",{multiple:!0,accept:void 0,disabled:!1,label:"Click or drop files to upload"},(o,{dispatch:r,flag:s})=>v(H,{get multiple(){return s("multiple")},get accept(){return o.accept},get disabled(){return s("disabled")},onFilesAdded:d=>r("kai-files-added",{files:d}),get children(){return v(O,{class:"border-border bg-surface hover:bg-muted/60 text-muted-foreground flex w-full cursor-pointer flex-col items-center justify-center gap-2 rounded-xl border border-dashed px-6 py-8 text-sm transition-colors",get children(){return[v(G,{class:"size-5"}),(()=>{var d=S();return d._$owner=C(),h(d,()=>o.label),d})()]}})}}));
|
package/dist/elements/form.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as o,c as s}from"
|
|
1
|
+
import{f as o,c as s}from"../define-By-uL588.js";import{F as n}from"../form-DSZgZQZk.js";o("kai-form",{data:void 0,cardId:void 0,heading:void 0,resolution:void 0,values:void 0,defaultValues:void 0,disabled:!1},(d,{element:a,dispatch:t,flag:i,expose:r})=>{let e;return r({focus:l=>e?.focus(l),send:()=>e?.send(),validate:()=>e?.validate()??{valid:!1},reset:()=>e?.reset(),dismiss:()=>e?.dismiss(),reopen:()=>e?.reopen()}),s(n,{get data(){return d.data},get cardId(){return d.cardId??(a.id||"kai-form")},get heading(){return d.heading},get resolution(){return d.resolution},get values(){return d.values},get defaultValues(){return d.defaultValues},get disabled(){return i("disabled")},onValuesChange:l=>t("kai-values-change",l),controllerRef:l=>e=l,hostElement:a})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as s,c as o,v as d,
|
|
1
|
+
import{f as s,c as o,v as d,m as i,t as a}from"../define-By-uL588.js";import{a as c,b as p,H as u}from"../hover-card-BQbul9eq.js";import{w as v}from"../disclosure-WUImBbDv.js";var m=a("<style>:host{display:inline-block}"),f=a("<slot>"),g=a("<slot name=card>");s("kai-hover-card",{openDelay:void 0,closeDelay:void 0,placement:void 0,open:void 0,defaultOpen:void 0,disabled:void 0},(l,n)=>{const{flag:r}=n;let t;return v(n,()=>t,()=>l.open),[m(),o(u,{get openDelay(){return i(()=>l.openDelay!=null)()?Number(l.openDelay):void 0},get closeDelay(){return i(()=>l.closeDelay!=null)()?Number(l.closeDelay):void 0},get defaultOpen(){return r("defaultOpen")},get disabled(){return r("disabled")},controllerRef:e=>t=e,get children(){return[o(c,{get children(){var e=f();return e._$owner=d(),e}}),o(p,{get placement(){return l.placement??void 0},get children(){var e=g();return e._$owner=d(),e}})]}})]});
|
package/dist/elements/icon.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as l,i as m,a as n,b as r,t as a}from"
|
|
1
|
+
import{f as l,i as m,a as n,b as r,t as a}from"../define-By-uL588.js";import{r as o}from"../icon-CdcfRhYI.js";import{c as f}from"../cn-DN5AWfiS.js";var t=a("<style>:host{display:inline-flex}"),z=a("<span part=icon>");const e={sm:"size-3.5",md:"size-4",lg:"size-5"};l("kai-icon",{name:"",size:"md"},i=>[t(),(()=>{var s=z();return m(s,()=>o(i.name,{class:"size-full",imgClass:"size-full",spanClass:"size-full"})),n(()=>r(s,f("inline-flex shrink-0",e[i.size??"md"]??e.md))),s})()]);
|
package/dist/elements/image.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as b,g as v,
|
|
1
|
+
import{s as b,g as v,j as f,h as y,c as o,a as p,d as m,b as h,S as w,t as T,f as R}from"../define-By-uL588.js";import{c}from"../cn-DN5AWfiS.js";import{S as U}from"../skeleton-CkHI-HgC.js";var j=T("<img role=img>");function k(r,e){if(r&&e)return`data:${e};base64,${r}`}function A(r){const[e,L]=b(r,["base64","uint8Array","mediaType","class","alt"]),[g,n]=v(void 0),l=()=>e.mediaType??"image/png";f(()=>{const t=e.uint8Array,a=l();if(t&&a){const i=new Blob([t],{type:a}),s=URL.createObjectURL(i);n(s),y(()=>URL.revokeObjectURL(s))}else n(void 0)});const d=()=>k(e.base64,l())??g();return o(w,{get when(){return d()},get fallback(){return o(U,{get"aria-label"(){return e.alt},role:"img",get class(){return c("h-auto max-w-full overflow-hidden",e.class)}})},get children(){var t=j();return p(a=>{var i=d(),s=e.alt,u=c("h-auto max-w-full overflow-hidden rounded-md",e.class);return i!==a.e&&m(t,"src",a.e=i),s!==a.t&&m(t,"alt",a.t=s),u!==a.a&&h(t,a.a=u),a},{e:void 0,t:void 0,a:void 0}),t}})}R("kai-image",{base64:void 0,bytes:void 0,alt:"",mediaType:void 0},r=>o(A,{get alt(){return r.alt??""},get base64(){return r.base64},get uint8Array(){return r.bytes},get mediaType(){return r.mediaType}}));
|
package/dist/elements/input.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as
|
|
1
|
+
import{f as O,g as b,j as V,z as o,o as $,h as q,c as C,d as D,v as L,t as w}from"../define-By-uL588.js";import{I as _,D as B,f as G,c as H,n as J,d as K,g as N,b as Q}from"../input-DKbmkMos.js";var T=w("<slot>"),U=w("<style>:host{display:block}");const W=["leading","trailing"];O("kai-input",{type:"text",value:void 0,placeholder:void 0,label:void 0,hint:void 0,error:void 0,size:"md",disabled:void 0,readonly:void 0,required:void 0,invalid:void 0,name:void 0,autocomplete:void 0,inputmode:void 0,format:void 0,guide:void 0,semantic:void 0,caseMode:void 0,copyPolicy:void 0},(t,j)=>{const{element:r,dispatch:v,flag:g,expose:P}=j,m=()=>{const e=t.format;return e!==void 0&&e!==""},h=e=>{const a={canonical:e,formatted:e};if(e===""||!m())return a;const n=t.semantic??"custom",i=t.format,c=i===B?G(n).defaultFormat:i;if(c===void 0)return a;try{const s=H(c,t.guide),A=J(s,e,t.caseMode??"preserve");return{canonical:N(s,Q(s,A),n),formatted:K(s,A)}}catch{return a}},M=h(t.value??r.getAttribute("value")??""),[u,p]=b(M.canonical),[l,f]=b(M.formatted),F=e=>e==null?r.getAttribute("value")??"":String(e),R=e=>{o(u)!==e&&p(e),o(l)!==e&&f(e)},d=()=>{var e;return((e=r.shadowRoot)==null?void 0:e.querySelector("input"))??null};let y=!1;const k=(e,a=!1)=>{if(!a&&o(u)===e)return;const n=d();if(n===null||!m()){R(e);return}y=!0;try{n.value=e,n.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))}finally{y=!1}};Object.defineProperty(r,"value",{get:()=>u(),set:e=>k(F(e)),configurable:!0,enumerable:!0});{let e=!0;V(()=>{if(t.format,t.guide,t.semantic,t.caseMode,e){e=!1;return}queueMicrotask(()=>{var a;const n=m()?o(u):((a=d())==null?void 0:a.value)??o(l),i=h(n);o(u)!==i.canonical&&p(i.canonical),o(l)!==i.formatted&&f(i.formatted)})})}V(()=>{const e=u();e?r.getAttribute("value")!==e&&r.setAttribute("value",e):r.hasAttribute("value")&&r.removeAttribute("value")});const[S,x]=b(r.getAttribute("autocapitalize")??void 0),[E,I]=b({leading:!1,trailing:!1});$(()=>{const e=()=>{const c={};for(const s of W)c[s]=!!r.querySelector(`:scope > [slot="${s}"]`);I(c)};e();const a=new MutationObserver(e);a.observe(r,{childList:!0,subtree:!1}),q(()=>a.disconnect());const n=()=>x(r.getAttribute("autocapitalize")??void 0);n();const i=new MutationObserver(n);i.observe(r,{attributes:!0,attributeFilter:["autocapitalize"]}),q(()=>i.disconnect())});const z=e=>E()[e]?(()=>{var a=T();return D(a,"name",e),a._$owner=L(),a})():void 0;return P({focus:e=>{var a;return(a=d())==null?void 0:a.focus(e)},select:()=>{var e;return(e=d())==null?void 0:e.select()},getRawValue:()=>o(u),getFormattedValue:()=>{var e;return((e=d())==null?void 0:e.value)??o(l)},clear:()=>{k("",!0),v("kai-change",{value:o(u),formattedValue:o(l)})}}),[U(),C(_,{get type(){return t.type??"text"},get value(){return l()},get placeholder(){return t.placeholder},get label(){return t.label},get hint(){return t.hint},get error(){return t.error},get size(){return t.size??"md"},get invalid(){return g("invalid")},get disabled(){return g("disabled")},get readonly(){return g("readonly")},get required(){return g("required")},get name(){return t.name},get autocomplete(){return t.autocomplete},get inputmode(){return t.inputmode},get autocapitalize(){return S()},get format(){return t.format},get guide(){return t.guide},get semantic(){return t.semantic},get caseMode(){return t.caseMode},get copyPolicy(){return t.copyPolicy},get leading(){return z("leading")},get trailing(){return z("trailing")},onValueInput:e=>{var a;p(e),f(((a=d())==null?void 0:a.value)??e),y||v("kai-input",{value:e,formattedValue:o(l)})},onValueChange:e=>{var a;p(e),m()||f(e),v("kai-change",{value:e,formattedValue:((a=d())==null?void 0:a.value)??e})},onMaskReject:e=>v("kai-input-rejected",e)})]});
|