@adia-ai/web-components 0.0.1
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 +195 -0
- package/a2ui/dockables/action.js +152 -0
- package/a2ui/dockables/base.js +30 -0
- package/a2ui/dockables/controller.js +97 -0
- package/a2ui/dockables/data-source.js +103 -0
- package/a2ui/dockables/index.js +6 -0
- package/a2ui/dockables/lifecycle.js +84 -0
- package/a2ui/dockables/provider.js +59 -0
- package/a2ui/index.js +19 -0
- package/a2ui/manifest-runtime.js +226 -0
- package/a2ui/registry.js +200 -0
- package/a2ui/renderer.js +361 -0
- package/a2ui/root.js +152 -0
- package/a2ui/stream.js +243 -0
- package/a2ui/surface-manifest.js +294 -0
- package/a2ui/surface.js +222 -0
- package/a2ui/wire-factory.js +134 -0
- package/a2ui/wiring-engine.js +209 -0
- package/a2ui/wiring-registry.js +342 -0
- package/components/accordion/accordion.a2ui.json +129 -0
- package/components/accordion/accordion.css +133 -0
- package/components/accordion/accordion.js +125 -0
- package/components/accordion/accordion.yaml +527 -0
- package/components/action-list/action-list.a2ui.json +64 -0
- package/components/action-list/action-list.css +115 -0
- package/components/action-list/action-list.js +149 -0
- package/components/action-list/action-list.yaml +56 -0
- package/components/agent-artifact/agent-artifact.a2ui.json +99 -0
- package/components/agent-artifact/agent-artifact.css +94 -0
- package/components/agent-artifact/agent-artifact.js +169 -0
- package/components/agent-artifact/agent-artifact.yaml +71 -0
- package/components/agent-feedback-bar/agent-feedback-bar.a2ui.json +91 -0
- package/components/agent-feedback-bar/agent-feedback-bar.css +33 -0
- package/components/agent-feedback-bar/agent-feedback-bar.js +152 -0
- package/components/agent-feedback-bar/agent-feedback-bar.yaml +65 -0
- package/components/agent-questions/agent-questions.a2ui.json +89 -0
- package/components/agent-questions/agent-questions.css +146 -0
- package/components/agent-questions/agent-questions.js +189 -0
- package/components/agent-questions/agent-questions.yaml +63 -0
- package/components/agent-reasoning/agent-reasoning.a2ui.json +100 -0
- package/components/agent-reasoning/agent-reasoning.css +273 -0
- package/components/agent-reasoning/agent-reasoning.js +469 -0
- package/components/agent-reasoning/agent-reasoning.yaml +70 -0
- package/components/agent-suggestions/agent-suggestions.a2ui.json +87 -0
- package/components/agent-suggestions/agent-suggestions.css +18 -0
- package/components/agent-suggestions/agent-suggestions.js +87 -0
- package/components/agent-suggestions/agent-suggestions.yaml +59 -0
- package/components/agent-trace/agent-trace.a2ui.json +78 -0
- package/components/agent-trace/agent-trace.css +275 -0
- package/components/agent-trace/agent-trace.js +216 -0
- package/components/agent-trace/agent-trace.yaml +53 -0
- package/components/alert/alert.a2ui.json +211 -0
- package/components/alert/alert.css +88 -0
- package/components/alert/alert.js +96 -0
- package/components/alert/alert.yaml +205 -0
- package/components/avatar/avatar.a2ui.json +215 -0
- package/components/avatar/avatar.css +159 -0
- package/components/avatar/avatar.js +157 -0
- package/components/avatar/avatar.yaml +559 -0
- package/components/badge/badge.a2ui.json +169 -0
- package/components/badge/badge.css +78 -0
- package/components/badge/badge.js +53 -0
- package/components/badge/badge.yaml +612 -0
- package/components/block/block.a2ui.json +135 -0
- package/components/block/block.css +29 -0
- package/components/block/block.js +23 -0
- package/components/block/block.yaml +115 -0
- package/components/breadcrumb/breadcrumb.a2ui.json +86 -0
- package/components/breadcrumb/breadcrumb.css +78 -0
- package/components/breadcrumb/breadcrumb.js +44 -0
- package/components/breadcrumb/breadcrumb.yaml +84 -0
- package/components/button/button.a2ui.json +172 -0
- package/components/button/button.css +168 -0
- package/components/button/button.js +60 -0
- package/components/button/button.yaml +120 -0
- package/components/calendar-picker/calendar-picker.a2ui.json +139 -0
- package/components/calendar-picker/calendar-picker.css +321 -0
- package/components/calendar-picker/calendar-picker.js +324 -0
- package/components/calendar-picker/calendar-picker.yaml +243 -0
- package/components/canvas/canvas.a2ui.json +75 -0
- package/components/canvas/canvas.css +52 -0
- package/components/canvas/canvas.js +179 -0
- package/components/canvas/canvas.yaml +62 -0
- package/components/card/card.a2ui.json +276 -0
- package/components/card/card.css +362 -0
- package/components/card/card.js +58 -0
- package/components/card/card.yaml +527 -0
- package/components/chart/chart.a2ui.json +298 -0
- package/components/chart/chart.css +512 -0
- package/components/chart/chart.js +1075 -0
- package/components/chart/chart.yaml +540 -0
- package/components/chat/chat-input.css +141 -0
- package/components/chat/chat-input.js +242 -0
- package/components/chat/chat.a2ui.json +181 -0
- package/components/chat/chat.css +193 -0
- package/components/chat/chat.js +155 -0
- package/components/chat/chat.yaml +230 -0
- package/components/check/check.a2ui.json +134 -0
- package/components/check/check.css +126 -0
- package/components/check/check.js +58 -0
- package/components/check/check.yaml +109 -0
- package/components/code/code.a2ui.json +153 -0
- package/components/code/code.css +133 -0
- package/components/code/code.js +114 -0
- package/components/code/code.yaml +163 -0
- package/components/col/col.a2ui.json +104 -0
- package/components/col/col.css +36 -0
- package/components/col/col.js +19 -0
- package/components/col/col.yaml +364 -0
- package/components/color-picker/color-picker.a2ui.json +100 -0
- package/components/color-picker/color-picker.css +182 -0
- package/components/color-picker/color-picker.js +537 -0
- package/components/color-picker/color-picker.yaml +105 -0
- package/components/command/command.a2ui.json +221 -0
- package/components/command/command.css +251 -0
- package/components/command/command.js +284 -0
- package/components/command/command.yaml +186 -0
- package/components/description-list/description-list.a2ui.json +89 -0
- package/components/description-list/description-list.css +70 -0
- package/components/description-list/description-list.js +75 -0
- package/components/description-list/description-list.yaml +59 -0
- package/components/divider/divider.a2ui.json +126 -0
- package/components/divider/divider.css +102 -0
- package/components/divider/divider.js +47 -0
- package/components/divider/divider.yaml +366 -0
- package/components/drawer/drawer.a2ui.json +199 -0
- package/components/drawer/drawer.css +342 -0
- package/components/drawer/drawer.js +263 -0
- package/components/drawer/drawer.yaml +366 -0
- package/components/embed/embed.a2ui.json +150 -0
- package/components/embed/embed.css +28 -0
- package/components/embed/embed.js +63 -0
- package/components/embed/embed.yaml +224 -0
- package/components/empty-state/empty-state.a2ui.json +133 -0
- package/components/empty-state/empty-state.css +58 -0
- package/components/empty-state/empty-state.js +87 -0
- package/components/empty-state/empty-state.yaml +314 -0
- package/components/footer/footer.a2ui.json +79 -0
- package/components/footer/footer.yaml +239 -0
- package/components/grid/grid.a2ui.json +171 -0
- package/components/grid/grid.css +37 -0
- package/components/grid/grid.js +21 -0
- package/components/grid/grid.yaml +577 -0
- package/components/header/header.a2ui.json +76 -0
- package/components/header/header.yaml +336 -0
- package/components/heatmap/heatmap.a2ui.json +150 -0
- package/components/heatmap/heatmap.css +146 -0
- package/components/heatmap/heatmap.js +246 -0
- package/components/heatmap/heatmap.yaml +131 -0
- package/components/icon/icon.a2ui.json +79 -0
- package/components/icon/icon.css +20 -0
- package/components/icon/icon.js +26 -0
- package/components/icon/icon.yaml +233 -0
- package/components/image/image.a2ui.json +261 -0
- package/components/image/image.css +76 -0
- package/components/image/image.js +102 -0
- package/components/image/image.yaml +477 -0
- package/components/index.js +85 -0
- package/components/input/input.a2ui.json +284 -0
- package/components/input/input.css +162 -0
- package/components/input/input.js +148 -0
- package/components/input/input.yaml +496 -0
- package/components/inspector/inspector.a2ui.json +67 -0
- package/components/inspector/inspector.css +31 -0
- package/components/inspector/inspector.js +133 -0
- package/components/inspector/inspector.yaml +58 -0
- package/components/kbd/kbd.a2ui.json +96 -0
- package/components/kbd/kbd.css +62 -0
- package/components/kbd/kbd.js +24 -0
- package/components/kbd/kbd.yaml +213 -0
- package/components/list/list.a2ui.json +145 -0
- package/components/list/list.css +103 -0
- package/components/list/list.js +236 -0
- package/components/list/list.yaml +122 -0
- package/components/menu/menu.a2ui.json +146 -0
- package/components/menu/menu.css +146 -0
- package/components/menu/menu.js +296 -0
- package/components/menu/menu.yaml +123 -0
- package/components/modal/modal.a2ui.json +136 -0
- package/components/modal/modal.css +153 -0
- package/components/modal/modal.js +181 -0
- package/components/modal/modal.yaml +114 -0
- package/components/noodles/noodles.a2ui.json +145 -0
- package/components/noodles/noodles.css +118 -0
- package/components/noodles/noodles.js +470 -0
- package/components/noodles/noodles.yaml +123 -0
- package/components/otp-input/otp-input.a2ui.json +104 -0
- package/components/otp-input/otp-input.css +78 -0
- package/components/otp-input/otp-input.js +170 -0
- package/components/otp-input/otp-input.yaml +218 -0
- package/components/pagination/pagination.a2ui.json +122 -0
- package/components/pagination/pagination.css +162 -0
- package/components/pagination/pagination.js +185 -0
- package/components/pagination/pagination.yaml +165 -0
- package/components/pane/pane.a2ui.json +94 -0
- package/components/pane/pane.css +166 -0
- package/components/pane/pane.js +140 -0
- package/components/pane/pane.yaml +197 -0
- package/components/pipeline-status/pipeline-status.a2ui.json +90 -0
- package/components/pipeline-status/pipeline-status.css +162 -0
- package/components/pipeline-status/pipeline-status.js +176 -0
- package/components/pipeline-status/pipeline-status.yaml +99 -0
- package/components/popover/popover.a2ui.json +181 -0
- package/components/popover/popover.css +57 -0
- package/components/popover/popover.js +170 -0
- package/components/popover/popover.yaml +257 -0
- package/components/progress/progress.a2ui.json +199 -0
- package/components/progress/progress.css +88 -0
- package/components/progress/progress.js +64 -0
- package/components/progress/progress.yaml +342 -0
- package/components/progress-row/progress-row.a2ui.json +100 -0
- package/components/progress-row/progress-row.css +57 -0
- package/components/progress-row/progress-row.js +92 -0
- package/components/progress-row/progress-row.yaml +87 -0
- package/components/radio/radio.a2ui.json +232 -0
- package/components/radio/radio.css +102 -0
- package/components/radio/radio.js +73 -0
- package/components/radio/radio.yaml +248 -0
- package/components/range/range.a2ui.json +151 -0
- package/components/range/range.css +148 -0
- package/components/range/range.js +177 -0
- package/components/range/range.yaml +188 -0
- package/components/rating/rating.a2ui.json +105 -0
- package/components/rating/rating.css +92 -0
- package/components/rating/rating.js +138 -0
- package/components/rating/rating.yaml +74 -0
- package/components/richtext/richtext.a2ui.json +82 -0
- package/components/richtext/richtext.css +225 -0
- package/components/richtext/richtext.js +74 -0
- package/components/richtext/richtext.yaml +89 -0
- package/components/row/row.a2ui.json +102 -0
- package/components/row/row.css +51 -0
- package/components/row/row.js +39 -0
- package/components/row/row.yaml +358 -0
- package/components/search/search.a2ui.json +186 -0
- package/components/search/search.css +28 -0
- package/components/search/search.js +124 -0
- package/components/search/search.yaml +154 -0
- package/components/section/section.a2ui.json +78 -0
- package/components/section/section.yaml +338 -0
- package/components/segment/segment.a2ui.json +100 -0
- package/components/segment/segment.css +81 -0
- package/components/segment/segment.js +32 -0
- package/components/segment/segment.yaml +216 -0
- package/components/segmented/segmented.a2ui.json +106 -0
- package/components/segmented/segmented.css +67 -0
- package/components/segmented/segmented.js +149 -0
- package/components/segmented/segmented.yaml +91 -0
- package/components/select/select.a2ui.json +203 -0
- package/components/select/select.css +277 -0
- package/components/select/select.js +388 -0
- package/components/select/select.yaml +375 -0
- package/components/skeleton/skeleton.a2ui.json +120 -0
- package/components/skeleton/skeleton.css +47 -0
- package/components/skeleton/skeleton.js +43 -0
- package/components/skeleton/skeleton.yaml +153 -0
- package/components/slider/slider.a2ui.json +162 -0
- package/components/slider/slider.css +137 -0
- package/components/slider/slider.js +162 -0
- package/components/slider/slider.yaml +299 -0
- package/components/stack/stack.a2ui.json +62 -0
- package/components/stack/stack.css +28 -0
- package/components/stack/stack.js +18 -0
- package/components/stack/stack.yaml +54 -0
- package/components/stat/stat.a2ui.json +246 -0
- package/components/stat/stat.css +101 -0
- package/components/stat/stat.js +91 -0
- package/components/stat/stat.yaml +206 -0
- package/components/stepper/stepper.a2ui.json +77 -0
- package/components/stepper/stepper.css +243 -0
- package/components/stepper/stepper.js +118 -0
- package/components/stepper/stepper.yaml +73 -0
- package/components/stream/stream.a2ui.json +98 -0
- package/components/stream/stream.css +37 -0
- package/components/stream/stream.js +99 -0
- package/components/stream/stream.yaml +87 -0
- package/components/swiper/swiper.a2ui.json +140 -0
- package/components/swiper/swiper.css +267 -0
- package/components/swiper/swiper.js +285 -0
- package/components/swiper/swiper.yaml +268 -0
- package/components/switch/switch.a2ui.json +134 -0
- package/components/switch/switch.css +104 -0
- package/components/switch/switch.js +53 -0
- package/components/switch/switch.yaml +322 -0
- package/components/table/cell-types.js +296 -0
- package/components/table/table.a2ui.json +458 -0
- package/components/table/table.css +531 -0
- package/components/table/table.js +1392 -0
- package/components/table/table.yaml +528 -0
- package/components/tabs/tab.js +34 -0
- package/components/tabs/tabs.a2ui.json +174 -0
- package/components/tabs/tabs.css +162 -0
- package/components/tabs/tabs.js +226 -0
- package/components/tabs/tabs.yaml +255 -0
- package/components/tag/tag.a2ui.json +148 -0
- package/components/tag/tag.css +118 -0
- package/components/tag/tag.js +88 -0
- package/components/tag/tag.yaml +125 -0
- package/components/text/text.a2ui.json +99 -0
- package/components/text/text.css +65 -0
- package/components/text/text.js +35 -0
- package/components/text/text.yaml +360 -0
- package/components/textarea/textarea.a2ui.json +91 -0
- package/components/textarea/textarea.css +93 -0
- package/components/textarea/textarea.js +114 -0
- package/components/textarea/textarea.yaml +79 -0
- package/components/timeline/timeline.a2ui.json +82 -0
- package/components/timeline/timeline.css +389 -0
- package/components/timeline/timeline.js +171 -0
- package/components/timeline/timeline.yaml +185 -0
- package/components/toast/toast.a2ui.json +199 -0
- package/components/toast/toast.css +211 -0
- package/components/toast/toast.js +146 -0
- package/components/toast/toast.yaml +184 -0
- package/components/toggle-group/toggle-group.a2ui.json +126 -0
- package/components/toggle-group/toggle-group.css +102 -0
- package/components/toggle-group/toggle-group.js +147 -0
- package/components/toggle-group/toggle-group.yaml +98 -0
- package/components/toolbar/toolbar.a2ui.json +131 -0
- package/components/toolbar/toolbar.css +132 -0
- package/components/toolbar/toolbar.js +366 -0
- package/components/toolbar/toolbar.yaml +238 -0
- package/components/tooltip/tooltip.a2ui.json +148 -0
- package/components/tooltip/tooltip.css +39 -0
- package/components/tooltip/tooltip.js +96 -0
- package/components/tooltip/tooltip.yaml +201 -0
- package/components/tree/tree.a2ui.json +119 -0
- package/components/tree/tree.css +133 -0
- package/components/tree/tree.js +253 -0
- package/components/tree/tree.yaml +92 -0
- package/components/upload/upload.a2ui.json +185 -0
- package/components/upload/upload.css +115 -0
- package/components/upload/upload.js +189 -0
- package/components/upload/upload.yaml +302 -0
- package/core/anchor.js +187 -0
- package/core/controller.js +182 -0
- package/core/element.js +257 -0
- package/core/form.js +217 -0
- package/core/icons.js +180 -0
- package/core/markdown.js +95 -0
- package/core/polyfills.js +23 -0
- package/core/provider.js +262 -0
- package/core/signals.js +113 -0
- package/core/template.js +226 -0
- package/core/transport.js +77 -0
- package/package.json +38 -0
- package/patterns/adia-chat/adia-chat.a2ui.json +149 -0
- package/patterns/adia-chat/adia-chat.css +10 -0
- package/patterns/adia-chat/adia-chat.js +297 -0
- package/patterns/adia-chat/adia-chat.yaml +118 -0
- package/patterns/adia-chat/css/adia-chat.empty.css +12 -0
- package/patterns/adia-chat/css/adia-chat.layout.css +60 -0
- package/patterns/adia-chat/css/adia-chat.markdown.css +74 -0
- package/patterns/adia-chat/css/adia-chat.messages.css +87 -0
- package/patterns/adia-chat/css/adia-chat.streaming.css +30 -0
- package/patterns/adia-chat/css/adia-chat.tokens.css +95 -0
- package/patterns/adia-chat/index.html +93 -0
- package/patterns/adia-editor/adia-editor.a2ui.json +58 -0
- package/patterns/adia-editor/adia-editor.css +6 -0
- package/patterns/adia-editor/adia-editor.js +56 -0
- package/patterns/adia-editor/adia-editor.yaml +36 -0
- package/patterns/adia-editor/css/adia-editor.layout.css +86 -0
- package/patterns/adia-editor/css/adia-editor.tokens.css +28 -0
- package/patterns/adia-editor/index.html +179 -0
- package/patterns/app-nav/app-nav.a2ui.json +89 -0
- package/patterns/app-nav/app-nav.css +92 -0
- package/patterns/app-nav/app-nav.js +99 -0
- package/patterns/app-nav/app-nav.yaml +54 -0
- package/patterns/app-nav-group/app-nav-group.a2ui.json +82 -0
- package/patterns/app-nav-group/app-nav-group.css +261 -0
- package/patterns/app-nav-group/app-nav-group.js +116 -0
- package/patterns/app-nav-group/app-nav-group.yaml +59 -0
- package/patterns/app-nav-item/app-nav-item.a2ui.json +83 -0
- package/patterns/app-nav-item/app-nav-item.css +156 -0
- package/patterns/app-nav-item/app-nav-item.js +42 -0
- package/patterns/app-nav-item/app-nav-item.yaml +62 -0
- package/patterns/app-shell/app-shell.a2ui.json +114 -0
- package/patterns/app-shell/app-shell.css +14 -0
- package/patterns/app-shell/app-shell.js +251 -0
- package/patterns/app-shell/app-shell.yaml +66 -0
- package/patterns/app-shell/css/app-shell.collapsed.css +86 -0
- package/patterns/app-shell/css/app-shell.helpers.css +42 -0
- package/patterns/app-shell/css/app-shell.main.css +58 -0
- package/patterns/app-shell/css/app-shell.shell.css +44 -0
- package/patterns/app-shell/css/app-shell.sidebar.css +116 -0
- package/patterns/app-shell/css/app-shell.templates.css +214 -0
- package/patterns/app-shell/css/app-shell.tokens.css +116 -0
- package/patterns/app-shell/index.html +112 -0
- package/patterns/gen-ui/gen-ui.a2ui.json +72 -0
- package/patterns/gen-ui/gen-ui.css +83 -0
- package/patterns/gen-ui/gen-ui.js +136 -0
- package/patterns/gen-ui/gen-ui.yaml +43 -0
- package/patterns/index.js +10 -0
- package/patterns/section-nav/section-nav.a2ui.json +91 -0
- package/patterns/section-nav/section-nav.css +59 -0
- package/patterns/section-nav/section-nav.js +42 -0
- package/patterns/section-nav/section-nav.yaml +58 -0
- package/patterns/section-nav-group/section-nav-group.a2ui.json +95 -0
- package/patterns/section-nav-group/section-nav-group.css +74 -0
- package/patterns/section-nav-group/section-nav-group.js +84 -0
- package/patterns/section-nav-group/section-nav-group.yaml +66 -0
- package/patterns/section-nav-item/section-nav-item.a2ui.json +97 -0
- package/patterns/section-nav-item/section-nav-item.css +96 -0
- package/patterns/section-nav-item/section-nav-item.js +66 -0
- package/patterns/section-nav-item/section-nav-item.yaml +70 -0
- package/styles/colors/index.css +6 -0
- package/styles/colors/parameters.css +52 -0
- package/styles/colors/primitives-accent.css +89 -0
- package/styles/colors/primitives-brand.css +89 -0
- package/styles/colors/primitives-danger.css +89 -0
- package/styles/colors/primitives-info.css +89 -0
- package/styles/colors/primitives-neutral.css +91 -0
- package/styles/colors/primitives-shared.css +57 -0
- package/styles/colors/primitives-success.css +89 -0
- package/styles/colors/primitives-warning.css +89 -0
- package/styles/colors/primitives.css +17 -0
- package/styles/colors/scrims.css +182 -0
- package/styles/colors/semantics.css +595 -0
- package/styles/colors/surfaces.css +43 -0
- package/styles/fonts.css +99 -0
- package/styles/layouts/admin.css +7 -0
- package/styles/prose.css +186 -0
- package/styles/styles.css +193 -0
- package/styles/themes.css +155 -0
- package/styles/tokens.css +304 -0
- package/styles/typography.css +853 -0
- package/traits/active-state.js +24 -0
- package/traits/anchor-positioning.js +66 -0
- package/traits/attention-pulse.js +30 -0
- package/traits/confetti-burst.js +65 -0
- package/traits/confetti.js +57 -0
- package/traits/count-up.js +42 -0
- package/traits/define.js +76 -0
- package/traits/dirty-state.js +38 -0
- package/traits/drag-ghost.js +38 -0
- package/traits/draggable.js +73 -0
- package/traits/fade-presence.js +52 -0
- package/traits/focus-trap.js +63 -0
- package/traits/focusable.js +38 -0
- package/traits/glow-focus.js +33 -0
- package/traits/gradient-shift.js +32 -0
- package/traits/haptic-feedback.js +28 -0
- package/traits/hotkey.js +62 -0
- package/traits/hoverable.js +26 -0
- package/traits/index.js +55 -0
- package/traits/inertia-drag.js +133 -0
- package/traits/intersection-observer.js +33 -0
- package/traits/keyboard-nav.js +36 -0
- package/traits/magnetic-hover.js +37 -0
- package/traits/noise-texture.js +30 -0
- package/traits/parallax.js +42 -0
- package/traits/portal.js +27 -0
- package/traits/pressable.js +75 -0
- package/traits/resizable.js +100 -0
- package/traits/resize-observer.js +31 -0
- package/traits/ripple.js +53 -0
- package/traits/roving-tabindex.js +67 -0
- package/traits/scale-press.js +43 -0
- package/traits/scroll-lock.js +27 -0
- package/traits/shimmer-loading.js +44 -0
- package/traits/snap-to-grid.js +28 -0
- package/traits/sound-feedback.js +30 -0
- package/traits/spring-animate.js +56 -0
- package/traits/tilt-hover.js +37 -0
- package/traits/tossable.js +178 -0
- package/traits/typeahead.js +63 -0
- package/traits/typewriter.js +35 -0
- package/traits/validation.js +118 -0
package/package.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@adia-ai/web-components",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "AdiaUI web components — vanilla custom elements + A2UI runtime. Training corpus lives in @adia-ai/gen-ui-training.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": "./index.js",
|
|
8
|
+
"./css": "./index.css",
|
|
9
|
+
"./a2ui": "./a2ui/index.js",
|
|
10
|
+
"./core": "./core/index.js"
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"core/",
|
|
14
|
+
"components/",
|
|
15
|
+
"styles/",
|
|
16
|
+
"traits/",
|
|
17
|
+
"patterns/",
|
|
18
|
+
"a2ui/",
|
|
19
|
+
"index.js",
|
|
20
|
+
"index.css"
|
|
21
|
+
],
|
|
22
|
+
"sideEffects": [
|
|
23
|
+
"*.css",
|
|
24
|
+
"./index.js",
|
|
25
|
+
"./components/**/*.js",
|
|
26
|
+
"./patterns/**/*.js",
|
|
27
|
+
"./core/provider.js"
|
|
28
|
+
],
|
|
29
|
+
"publishConfig": {
|
|
30
|
+
"access": "public",
|
|
31
|
+
"registry": "https://registry.npmjs.org"
|
|
32
|
+
},
|
|
33
|
+
"repository": {
|
|
34
|
+
"type": "git",
|
|
35
|
+
"url": "git+https://github.com/adiahealth/gen-ui-kit.git",
|
|
36
|
+
"directory": "packages/web-components"
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://adiaui.dev/a2ui/v0_9/components/Chat.json",
|
|
4
|
+
"title": "Chat",
|
|
5
|
+
"description": "Behavior-only chat orchestrator. Author supplies the DOM structure via\n[data-chat-messages], [data-chat-input], [data-chat-empty], [data-chat-status]\nelements; adia-chat wires message streaming, markdown rendering, code-block\nupgrades, and an LLM integration path via proxy-url (or via external submit).\n",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"allOf": [
|
|
8
|
+
{
|
|
9
|
+
"$ref": "common_types.json#/$defs/ComponentCommon"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"$ref": "common_types.json#/$defs/CatalogComponentCommon"
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
"properties": {
|
|
16
|
+
"component": {
|
|
17
|
+
"const": "Chat"
|
|
18
|
+
},
|
|
19
|
+
"model": {
|
|
20
|
+
"description": "Model identifier.",
|
|
21
|
+
"type": "string",
|
|
22
|
+
"default": ""
|
|
23
|
+
},
|
|
24
|
+
"provider": {
|
|
25
|
+
"description": "LLM provider name (anthropic | openai | google | stub).",
|
|
26
|
+
"type": "string",
|
|
27
|
+
"default": ""
|
|
28
|
+
},
|
|
29
|
+
"proxyUrl": {
|
|
30
|
+
"description": "API proxy endpoint for LLM calls; enables self-contained chat without external wiring.",
|
|
31
|
+
"type": "string",
|
|
32
|
+
"default": ""
|
|
33
|
+
},
|
|
34
|
+
"streaming": {
|
|
35
|
+
"description": "Active streaming indicator; toggled while a response is being received.",
|
|
36
|
+
"type": "boolean",
|
|
37
|
+
"default": false
|
|
38
|
+
},
|
|
39
|
+
"system": {
|
|
40
|
+
"description": "System prompt prepended to conversations.",
|
|
41
|
+
"type": "string",
|
|
42
|
+
"default": ""
|
|
43
|
+
},
|
|
44
|
+
"thinking": {
|
|
45
|
+
"description": "Enable Anthropic extended-thinking mode.",
|
|
46
|
+
"type": "boolean",
|
|
47
|
+
"default": false
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"required": [
|
|
51
|
+
"component"
|
|
52
|
+
],
|
|
53
|
+
"unevaluatedProperties": false,
|
|
54
|
+
"x-adiaui": {
|
|
55
|
+
"anti_patterns": [],
|
|
56
|
+
"category": "container",
|
|
57
|
+
"events": {
|
|
58
|
+
"abort": {
|
|
59
|
+
"description": "Fired when the user aborts an in-flight request."
|
|
60
|
+
},
|
|
61
|
+
"chunk": {
|
|
62
|
+
"description": "Fired for each streaming chunk.",
|
|
63
|
+
"detail": {
|
|
64
|
+
"snapshot": "string",
|
|
65
|
+
"text": "string"
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"clear": {
|
|
69
|
+
"description": "Fired when the conversation is cleared."
|
|
70
|
+
},
|
|
71
|
+
"done": {
|
|
72
|
+
"description": "Fired when a response completes.",
|
|
73
|
+
"detail": {
|
|
74
|
+
"stopReason": "string",
|
|
75
|
+
"text": "string",
|
|
76
|
+
"usage": "object"
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
"error": {
|
|
80
|
+
"description": "Fired on any LLM / network error.",
|
|
81
|
+
"detail": {
|
|
82
|
+
"error": "Error"
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
"message": {
|
|
86
|
+
"description": "Fired after each message (user or assistant) is appended.",
|
|
87
|
+
"detail": {
|
|
88
|
+
"content": "string",
|
|
89
|
+
"id": "string",
|
|
90
|
+
"role": "string"
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
"submit": {
|
|
94
|
+
"description": "Fired on user message submit (before LLM call begins).",
|
|
95
|
+
"detail": {
|
|
96
|
+
"model": "string",
|
|
97
|
+
"text": "string"
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
"thinking": {
|
|
101
|
+
"description": "Fired when the model emits extended-thinking content.",
|
|
102
|
+
"detail": {
|
|
103
|
+
"text": "string"
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
"examples": [],
|
|
108
|
+
"keywords": [
|
|
109
|
+
"adia-chat",
|
|
110
|
+
"chat",
|
|
111
|
+
"llm",
|
|
112
|
+
"streaming",
|
|
113
|
+
"conversation",
|
|
114
|
+
"agent"
|
|
115
|
+
],
|
|
116
|
+
"name": "AdiaChatElement",
|
|
117
|
+
"related": [
|
|
118
|
+
"ChatInput",
|
|
119
|
+
"Code"
|
|
120
|
+
],
|
|
121
|
+
"slots": {
|
|
122
|
+
"default": {
|
|
123
|
+
"description": "Author provides the structural DOM. Expected markers — [data-chat-messages] (message list), [data-chat-input] (input surface), [data-chat-empty] (empty state), [data-chat-status] (streaming indicator)."
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
"states": [
|
|
127
|
+
{
|
|
128
|
+
"description": "No active request.",
|
|
129
|
+
"name": "idle"
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"description": "An LLM request is in-flight; [data-chat-status] visible.",
|
|
133
|
+
"attribute": "streaming",
|
|
134
|
+
"name": "streaming"
|
|
135
|
+
}
|
|
136
|
+
],
|
|
137
|
+
"synonyms": {
|
|
138
|
+
"chat": [
|
|
139
|
+
"conversation",
|
|
140
|
+
"messages",
|
|
141
|
+
"thread"
|
|
142
|
+
]
|
|
143
|
+
},
|
|
144
|
+
"tag": "adia-chat-ui",
|
|
145
|
+
"tokens": {},
|
|
146
|
+
"traits": [],
|
|
147
|
+
"version": 1
|
|
148
|
+
}
|
|
149
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/* ═══════════════════════════════════════════════════════════════
|
|
2
|
+
adia-chat — Pattern component CSS
|
|
3
|
+
═══════════════════════════════════════════════════════════════ */
|
|
4
|
+
|
|
5
|
+
@import "./css/adia-chat.tokens.css";
|
|
6
|
+
@import "./css/adia-chat.layout.css";
|
|
7
|
+
@import "./css/adia-chat.messages.css";
|
|
8
|
+
@import "./css/adia-chat.streaming.css";
|
|
9
|
+
@import "./css/adia-chat.markdown.css";
|
|
10
|
+
@import "./css/adia-chat.empty.css";
|
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
import { AdiaElement } from '@core/element.js';
|
|
2
|
+
import { renderMarkdown } from '@core/markdown.js';
|
|
3
|
+
import { streamChat } from '@llm/index.js';
|
|
4
|
+
|
|
5
|
+
function escapeHTML(s) {
|
|
6
|
+
return s.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
let msgId = 0;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* <adia-chat-ui> — Chat pattern component.
|
|
13
|
+
*
|
|
14
|
+
* Behavior-only orchestrator: stamps no HTML of its own.
|
|
15
|
+
* The author writes the structure; adia-chat wires the behaviors.
|
|
16
|
+
*
|
|
17
|
+
* Structure:
|
|
18
|
+
* <adia-chat-ui proxy-url="/api/chat" model="claude-sonnet-4-20250514">
|
|
19
|
+
* <header>
|
|
20
|
+
* <span data-chat-name>Claude</span>
|
|
21
|
+
* <span data-chat-status></span>
|
|
22
|
+
* </header>
|
|
23
|
+
* <section data-chat-messages>
|
|
24
|
+
* <empty-state-ui data-chat-empty icon="chat-circle"
|
|
25
|
+
* heading="Hello!" description="Ask me anything.">
|
|
26
|
+
* </empty-state-ui>
|
|
27
|
+
* </section>
|
|
28
|
+
* <footer>
|
|
29
|
+
* <chat-input-ui data-chat-input placeholder="Message..."></chat-input-ui>
|
|
30
|
+
* </footer>
|
|
31
|
+
* </adia-chat-ui>
|
|
32
|
+
*
|
|
33
|
+
* Two modes:
|
|
34
|
+
* 1. Built-in: set proxy-url + model, adia-chat streams via LLM adapters
|
|
35
|
+
* 2. External: listen for 'submit', call your API, use appendChunk() etc.
|
|
36
|
+
*
|
|
37
|
+
* Events: submit, chunk, thinking, done, error, abort, clear
|
|
38
|
+
*/
|
|
39
|
+
class AdiaChatElement extends AdiaElement {
|
|
40
|
+
static properties = {
|
|
41
|
+
streaming: { type: Boolean, default: false, reflect: true },
|
|
42
|
+
provider: { type: String, default: '', reflect: true },
|
|
43
|
+
model: { type: String, default: '', reflect: true },
|
|
44
|
+
system: { type: String, default: '', reflect: true },
|
|
45
|
+
proxyUrl: { type: String, default: '', attribute: 'proxy-url', reflect: true },
|
|
46
|
+
thinking: { type: Boolean, default: false, reflect: true },
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
static template = () => null;
|
|
50
|
+
|
|
51
|
+
#messages = [];
|
|
52
|
+
#abortController = null;
|
|
53
|
+
#messagesEl = null;
|
|
54
|
+
#inputEl = null;
|
|
55
|
+
#emptyEl = null;
|
|
56
|
+
#statusEl = null;
|
|
57
|
+
#apiKey = '';
|
|
58
|
+
|
|
59
|
+
// ── Accessors ──
|
|
60
|
+
|
|
61
|
+
get messages() { return [...this.#messages]; }
|
|
62
|
+
|
|
63
|
+
get conversation() {
|
|
64
|
+
return this.#messages
|
|
65
|
+
.filter(m => m.role === 'user' || m.role === 'assistant')
|
|
66
|
+
.map(m => ({ role: m.role, content: m.content }));
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
set conversation(msgs) {
|
|
70
|
+
this.clear();
|
|
71
|
+
for (const m of msgs) {
|
|
72
|
+
this.appendMessage({ role: m.role, content: m.content, render: true });
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
set apiKey(key) { this.#apiKey = key; }
|
|
77
|
+
|
|
78
|
+
// ── Lifecycle ──
|
|
79
|
+
|
|
80
|
+
connected() {
|
|
81
|
+
this.#messagesEl = this.querySelector('[data-chat-messages]') || this.querySelector('section');
|
|
82
|
+
this.#inputEl = this.querySelector('[data-chat-input]') || this.querySelector('chat-input-ui');
|
|
83
|
+
this.#emptyEl = this.querySelector('[data-chat-empty]');
|
|
84
|
+
this.#statusEl = this.querySelector('[data-chat-status]');
|
|
85
|
+
|
|
86
|
+
this.#inputEl?.addEventListener('submit', this.#onSubmit);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
disconnected() {
|
|
90
|
+
this.#inputEl?.removeEventListener('submit', this.#onSubmit);
|
|
91
|
+
this.abort();
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// ── Events ──
|
|
95
|
+
|
|
96
|
+
#emit(name, detail) {
|
|
97
|
+
this.dispatchEvent(new CustomEvent(name, { bubbles: true, detail }));
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
#onSubmit = (e) => {
|
|
101
|
+
if (this.streaming) return;
|
|
102
|
+
const { text, model } = e.detail || {};
|
|
103
|
+
if (!text) return;
|
|
104
|
+
this.#inputEl.clear();
|
|
105
|
+
|
|
106
|
+
this.#emit('submit', { text, model });
|
|
107
|
+
|
|
108
|
+
// If proxy-url or apiKey is set, auto-send
|
|
109
|
+
if (this.proxyUrl || this.#apiKey) {
|
|
110
|
+
this.send(text, model ? { model } : {});
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
// ── Message management ──
|
|
115
|
+
|
|
116
|
+
appendMessage({ role, content = '', render: renderMd = false }) {
|
|
117
|
+
const id = `msg_${++msgId}`;
|
|
118
|
+
this.#messages.push({ id, role, content });
|
|
119
|
+
|
|
120
|
+
const el = document.createElement('div');
|
|
121
|
+
el.setAttribute('data-role', role);
|
|
122
|
+
el.setAttribute('data-id', id);
|
|
123
|
+
|
|
124
|
+
if (role === 'user') {
|
|
125
|
+
el.innerHTML = `<div data-bubble>${escapeHTML(content)}</div>`;
|
|
126
|
+
} else if (role === 'assistant') {
|
|
127
|
+
const rendered = renderMd && content ? renderMarkdown(content) : escapeHTML(content);
|
|
128
|
+
el.innerHTML = `
|
|
129
|
+
<span data-avatar>AI</span>
|
|
130
|
+
<div data-bubble><div data-content>${rendered}</div>${!renderMd ? '<span data-cursor></span>' : ''}</div>
|
|
131
|
+
`;
|
|
132
|
+
} else if (role === 'error') {
|
|
133
|
+
el.innerHTML = `<icon-ui name="warning"></icon-ui><span>${escapeHTML(content)}</span>`;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
this.#messagesEl?.appendChild(el);
|
|
137
|
+
this.#scrollToBottom();
|
|
138
|
+
this.#emit('message', { id, role, content });
|
|
139
|
+
return el;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
appendChunk(text) {
|
|
143
|
+
const last = this.#messages[this.#messages.length - 1];
|
|
144
|
+
if (!last || last.role !== 'assistant') return;
|
|
145
|
+
last.content += text;
|
|
146
|
+
|
|
147
|
+
const contentEl = this.#messagesEl?.querySelector('[data-role]:last-child [data-content]');
|
|
148
|
+
if (contentEl) {
|
|
149
|
+
contentEl.insertAdjacentText('beforeend', text);
|
|
150
|
+
}
|
|
151
|
+
this.#scrollToBottom();
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
deleteMessage(id) {
|
|
155
|
+
const idx = this.#messages.findIndex(m => m.id === id);
|
|
156
|
+
if (idx === -1) return;
|
|
157
|
+
this.#messages.splice(idx, 1);
|
|
158
|
+
this.#messagesEl?.querySelector(`[data-id="${id}"]`)?.remove();
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
clear() {
|
|
162
|
+
this.#messages.length = 0;
|
|
163
|
+
if (this.#messagesEl) {
|
|
164
|
+
// Preserve empty state element
|
|
165
|
+
const empty = this.#emptyEl;
|
|
166
|
+
this.#messagesEl.innerHTML = '';
|
|
167
|
+
if (empty) this.#messagesEl.appendChild(empty);
|
|
168
|
+
}
|
|
169
|
+
this.#emit('clear');
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
// ── Streaming control ──
|
|
173
|
+
|
|
174
|
+
startStreaming() {
|
|
175
|
+
this.streaming = true;
|
|
176
|
+
if (this.#inputEl) this.#inputEl.disabled = true;
|
|
177
|
+
if (this.#statusEl) this.#statusEl.textContent = 'Typing...';
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
stopStreaming() {
|
|
181
|
+
this.streaming = false;
|
|
182
|
+
if (this.#inputEl) this.#inputEl.disabled = false;
|
|
183
|
+
if (this.#statusEl) this.#statusEl.textContent = '';
|
|
184
|
+
|
|
185
|
+
// Remove cursor
|
|
186
|
+
this.#messagesEl?.querySelector('[data-role]:last-child [data-cursor]')?.remove();
|
|
187
|
+
|
|
188
|
+
// Render markdown in last assistant bubble
|
|
189
|
+
const last = this.#messages[this.#messages.length - 1];
|
|
190
|
+
if (last?.role === 'assistant' && last.content) {
|
|
191
|
+
const contentEl = this.#messagesEl?.querySelector('[data-role]:last-child [data-content]');
|
|
192
|
+
if (contentEl) {
|
|
193
|
+
contentEl.innerHTML = renderMarkdown(last.content);
|
|
194
|
+
// Upgrade code blocks to code-ui
|
|
195
|
+
this.#upgradeCodeBlocks(contentEl);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
this.#inputEl?.focus();
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
abort() {
|
|
203
|
+
if (this.#abortController) {
|
|
204
|
+
this.#abortController.abort();
|
|
205
|
+
this.#abortController = null;
|
|
206
|
+
this.#emit('abort');
|
|
207
|
+
}
|
|
208
|
+
if (this.streaming) this.stopStreaming();
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
// ── LLM send ──
|
|
212
|
+
|
|
213
|
+
async send(text, opts = {}) {
|
|
214
|
+
const model = opts.model || this.model || this.#inputEl?.model;
|
|
215
|
+
if (!model) throw new Error('No model specified');
|
|
216
|
+
|
|
217
|
+
this.appendMessage({ role: 'user', content: text });
|
|
218
|
+
this.appendMessage({ role: 'assistant', content: '' });
|
|
219
|
+
this.startStreaming();
|
|
220
|
+
|
|
221
|
+
this.#abortController = new AbortController();
|
|
222
|
+
|
|
223
|
+
try {
|
|
224
|
+
const streamOpts = {
|
|
225
|
+
provider: this.provider || undefined,
|
|
226
|
+
apiKey: this.#apiKey || undefined,
|
|
227
|
+
model,
|
|
228
|
+
system: this.system || undefined,
|
|
229
|
+
proxyUrl: this.proxyUrl || undefined,
|
|
230
|
+
thinking: this.thinking || undefined,
|
|
231
|
+
messages: this.conversation.slice(0, -1), // exclude empty assistant
|
|
232
|
+
signal: this.#abortController.signal,
|
|
233
|
+
...opts,
|
|
234
|
+
};
|
|
235
|
+
|
|
236
|
+
for await (const chunk of streamChat(streamOpts)) {
|
|
237
|
+
if (chunk.type === 'text') {
|
|
238
|
+
this.appendChunk(chunk.text);
|
|
239
|
+
this.#emit('chunk', { text: chunk.text, snapshot: chunk.snapshot });
|
|
240
|
+
} else if (chunk.type === 'thinking') {
|
|
241
|
+
this.#emit('thinking', { text: chunk.text });
|
|
242
|
+
} else if (chunk.type === 'done') {
|
|
243
|
+
this.#emit('done', { text: chunk.text, usage: chunk.usage, stopReason: chunk.stopReason });
|
|
244
|
+
} else if (chunk.type === 'error') {
|
|
245
|
+
this.appendMessage({ role: 'error', content: chunk.error.message });
|
|
246
|
+
this.#emit('error', { error: chunk.error });
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
} catch (err) {
|
|
250
|
+
if (err.name !== 'AbortError') {
|
|
251
|
+
this.appendMessage({ role: 'error', content: err.message });
|
|
252
|
+
this.#emit('error', { error: err });
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
this.#abortController = null;
|
|
257
|
+
this.stopStreaming();
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
// ── Export / import ──
|
|
261
|
+
|
|
262
|
+
export() {
|
|
263
|
+
return {
|
|
264
|
+
messages: this.#messages.map(m => ({ role: m.role, content: m.content })),
|
|
265
|
+
model: this.model,
|
|
266
|
+
system: this.system,
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
import(data) {
|
|
271
|
+
if (data.model) this.model = data.model;
|
|
272
|
+
if (data.system) this.system = data.system;
|
|
273
|
+
if (data.messages) this.conversation = data.messages;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
// ── Private ──
|
|
277
|
+
|
|
278
|
+
#scrollToBottom() {
|
|
279
|
+
const el = this.#messagesEl;
|
|
280
|
+
if (el) requestAnimationFrame(() => { el.scrollTop = el.scrollHeight; });
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
#upgradeCodeBlocks(container) {
|
|
284
|
+
for (const pre of container.querySelectorAll('pre')) {
|
|
285
|
+
const code = pre.querySelector('code');
|
|
286
|
+
if (!code) continue;
|
|
287
|
+
const lang = code.getAttribute('data-lang') || '';
|
|
288
|
+
const codeN = document.createElement('code-ui');
|
|
289
|
+
if (lang) codeN.setAttribute('language', lang);
|
|
290
|
+
codeN.textContent = code.textContent;
|
|
291
|
+
pre.replaceWith(codeN);
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
customElements.define('adia-chat-ui', AdiaChatElement);
|
|
297
|
+
export { AdiaChatElement };
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
$schema: ../../../../scripts/schemas/component.yaml.schema.json
|
|
2
|
+
name: AdiaChatElement
|
|
3
|
+
tag: adia-chat-ui
|
|
4
|
+
component: Chat
|
|
5
|
+
category: container
|
|
6
|
+
version: 1
|
|
7
|
+
description: |
|
|
8
|
+
Behavior-only chat orchestrator. Author supplies the DOM structure via
|
|
9
|
+
[data-chat-messages], [data-chat-input], [data-chat-empty], [data-chat-status]
|
|
10
|
+
elements; adia-chat wires message streaming, markdown rendering, code-block
|
|
11
|
+
upgrades, and an LLM integration path via proxy-url (or via external submit).
|
|
12
|
+
|
|
13
|
+
props:
|
|
14
|
+
streaming:
|
|
15
|
+
type: boolean
|
|
16
|
+
default: false
|
|
17
|
+
reflect: true
|
|
18
|
+
description: Active streaming indicator; toggled while a response is being received.
|
|
19
|
+
|
|
20
|
+
provider:
|
|
21
|
+
type: string
|
|
22
|
+
default: ""
|
|
23
|
+
reflect: true
|
|
24
|
+
description: LLM provider name (anthropic | openai | google | stub).
|
|
25
|
+
|
|
26
|
+
model:
|
|
27
|
+
type: string
|
|
28
|
+
default: ""
|
|
29
|
+
reflect: true
|
|
30
|
+
description: Model identifier.
|
|
31
|
+
|
|
32
|
+
system:
|
|
33
|
+
type: string
|
|
34
|
+
default: ""
|
|
35
|
+
reflect: true
|
|
36
|
+
description: System prompt prepended to conversations.
|
|
37
|
+
|
|
38
|
+
proxyUrl:
|
|
39
|
+
type: string
|
|
40
|
+
default: ""
|
|
41
|
+
reflect: true
|
|
42
|
+
attribute: proxy-url
|
|
43
|
+
description: API proxy endpoint for LLM calls; enables self-contained chat without external wiring.
|
|
44
|
+
|
|
45
|
+
thinking:
|
|
46
|
+
type: boolean
|
|
47
|
+
default: false
|
|
48
|
+
reflect: true
|
|
49
|
+
description: Enable Anthropic extended-thinking mode.
|
|
50
|
+
|
|
51
|
+
events:
|
|
52
|
+
submit:
|
|
53
|
+
description: Fired on user message submit (before LLM call begins).
|
|
54
|
+
detail:
|
|
55
|
+
text: string
|
|
56
|
+
model: string
|
|
57
|
+
|
|
58
|
+
chunk:
|
|
59
|
+
description: Fired for each streaming chunk.
|
|
60
|
+
detail:
|
|
61
|
+
text: string
|
|
62
|
+
snapshot: string
|
|
63
|
+
|
|
64
|
+
thinking:
|
|
65
|
+
description: Fired when the model emits extended-thinking content.
|
|
66
|
+
detail:
|
|
67
|
+
text: string
|
|
68
|
+
|
|
69
|
+
done:
|
|
70
|
+
description: Fired when a response completes.
|
|
71
|
+
detail:
|
|
72
|
+
text: string
|
|
73
|
+
usage: object
|
|
74
|
+
stopReason: string
|
|
75
|
+
|
|
76
|
+
error:
|
|
77
|
+
description: Fired on any LLM / network error.
|
|
78
|
+
detail:
|
|
79
|
+
error: Error
|
|
80
|
+
|
|
81
|
+
abort:
|
|
82
|
+
description: Fired when the user aborts an in-flight request.
|
|
83
|
+
|
|
84
|
+
clear:
|
|
85
|
+
description: Fired when the conversation is cleared.
|
|
86
|
+
|
|
87
|
+
message:
|
|
88
|
+
description: Fired after each message (user or assistant) is appended.
|
|
89
|
+
detail:
|
|
90
|
+
id: string
|
|
91
|
+
role: string
|
|
92
|
+
content: string
|
|
93
|
+
|
|
94
|
+
slots:
|
|
95
|
+
default:
|
|
96
|
+
description: >-
|
|
97
|
+
Author provides the structural DOM. Expected markers —
|
|
98
|
+
[data-chat-messages] (message list), [data-chat-input] (input surface),
|
|
99
|
+
[data-chat-empty] (empty state), [data-chat-status] (streaming indicator).
|
|
100
|
+
|
|
101
|
+
states:
|
|
102
|
+
- name: idle
|
|
103
|
+
description: No active request.
|
|
104
|
+
- name: streaming
|
|
105
|
+
attribute: streaming
|
|
106
|
+
description: An LLM request is in-flight; [data-chat-status] visible.
|
|
107
|
+
|
|
108
|
+
traits: []
|
|
109
|
+
|
|
110
|
+
a2ui:
|
|
111
|
+
rules:
|
|
112
|
+
- adia-chat is a behavior wrapper; don't nest col-ui/row-ui inside it directly —
|
|
113
|
+
author the structural DOM using [data-chat-*] markers instead.
|
|
114
|
+
|
|
115
|
+
keywords: [adia-chat, chat, llm, streaming, conversation, agent]
|
|
116
|
+
synonyms:
|
|
117
|
+
chat: [conversation, messages, thread]
|
|
118
|
+
related: [ChatInput, Code]
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/* ═══════════════════════════════════════════════════════════════
|
|
2
|
+
adia-chat-ui — Empty state
|
|
3
|
+
═══════════════════════════════════════════════════════════════ */
|
|
4
|
+
|
|
5
|
+
adia-chat-ui [data-chat-empty] {
|
|
6
|
+
margin: auto;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
adia-chat-ui[streaming] [data-chat-empty],
|
|
10
|
+
adia-chat-ui:has([data-role]) [data-chat-empty] {
|
|
11
|
+
display: none;
|
|
12
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/* ═══════════════════════════════════════════════════════════════
|
|
2
|
+
adia-chat-ui — Root layout
|
|
3
|
+
═══════════════════════════════════════════════════════════════ */
|
|
4
|
+
|
|
5
|
+
adia-chat-ui {
|
|
6
|
+
box-sizing: border-box;
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
height: 100%;
|
|
10
|
+
overflow: hidden;
|
|
11
|
+
border: var(--chat-border);
|
|
12
|
+
border-radius: var(--chat-radius);
|
|
13
|
+
background: var(--chat-bg);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/* Header */
|
|
17
|
+
adia-chat-ui > header {
|
|
18
|
+
display: flex;
|
|
19
|
+
align-items: center;
|
|
20
|
+
gap: var(--chat-header-gap);
|
|
21
|
+
min-height: var(--chat-header-height);
|
|
22
|
+
padding: 0 var(--chat-header-px);
|
|
23
|
+
border-bottom: var(--chat-header-border);
|
|
24
|
+
flex-shrink: 0;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
adia-chat-ui > header [data-chat-name] {
|
|
28
|
+
font-weight: var(--chat-weight-semibold);
|
|
29
|
+
font-size: var(--chat-header-name-font);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
adia-chat-ui > header [data-chat-status] {
|
|
33
|
+
font-size: var(--chat-header-status-font);
|
|
34
|
+
color: var(--chat-header-status-fg);
|
|
35
|
+
margin-inline-start: auto;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/* Messages scroll container */
|
|
39
|
+
adia-chat-ui > [data-chat-messages],
|
|
40
|
+
adia-chat-ui > section {
|
|
41
|
+
flex: 1;
|
|
42
|
+
overflow-y: auto;
|
|
43
|
+
padding: var(--chat-messages-py) var(--chat-messages-px);
|
|
44
|
+
display: flex;
|
|
45
|
+
flex-direction: column;
|
|
46
|
+
gap: var(--chat-messages-gap);
|
|
47
|
+
min-height: 0;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/* Footer */
|
|
51
|
+
adia-chat-ui > footer {
|
|
52
|
+
flex-shrink: 0;
|
|
53
|
+
display: flex;
|
|
54
|
+
align-items: center;
|
|
55
|
+
padding: var(--chat-footer-py) var(--chat-footer-px);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
adia-chat-ui > footer chat-input-ui {
|
|
59
|
+
flex: 1;
|
|
60
|
+
}
|