@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
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# Generated by scripts/migrate-yamls-to-v1.mjs — migrated to v1 contract.
|
|
2
|
+
# Edit this file; run `npm run build:components` to regenerate a2ui.json.
|
|
3
|
+
$schema: ../../../../scripts/schemas/component.yaml.schema.json
|
|
4
|
+
name: AdiaCheck
|
|
5
|
+
tag: check-ui
|
|
6
|
+
component: Check
|
|
7
|
+
category: layout
|
|
8
|
+
version: 1
|
|
9
|
+
description: Checkbox. The host IS the control.
|
|
10
|
+
props:
|
|
11
|
+
name:
|
|
12
|
+
description: Form field name
|
|
13
|
+
type: string
|
|
14
|
+
default: ""
|
|
15
|
+
required:
|
|
16
|
+
description: Marks as required
|
|
17
|
+
type: boolean
|
|
18
|
+
default: false
|
|
19
|
+
reflect: true
|
|
20
|
+
checked:
|
|
21
|
+
description: Whether the checkbox is checked
|
|
22
|
+
type: boolean
|
|
23
|
+
default: false
|
|
24
|
+
reflect: true
|
|
25
|
+
disabled:
|
|
26
|
+
description: Disables the checkbox
|
|
27
|
+
type: boolean
|
|
28
|
+
default: false
|
|
29
|
+
reflect: true
|
|
30
|
+
hint:
|
|
31
|
+
description: Help text below the label
|
|
32
|
+
type: string
|
|
33
|
+
default: ""
|
|
34
|
+
indeterminate:
|
|
35
|
+
description: Indeterminate state (dash indicator). Cleared on toggle.
|
|
36
|
+
type: boolean
|
|
37
|
+
default: false
|
|
38
|
+
label:
|
|
39
|
+
description: Label text beside the checkbox
|
|
40
|
+
type: string
|
|
41
|
+
default: ""
|
|
42
|
+
value:
|
|
43
|
+
description: Form value (submitted as 'on' when checked)
|
|
44
|
+
type: string
|
|
45
|
+
default: ""
|
|
46
|
+
events:
|
|
47
|
+
change:
|
|
48
|
+
description: Fired when checked state changes
|
|
49
|
+
slots:
|
|
50
|
+
box:
|
|
51
|
+
description: Visual checkbox indicator
|
|
52
|
+
hint:
|
|
53
|
+
description: Help text below the label
|
|
54
|
+
label:
|
|
55
|
+
description: Label text beside the checkbox
|
|
56
|
+
states:
|
|
57
|
+
- name: idle
|
|
58
|
+
description: Default, ready for interaction.
|
|
59
|
+
- name: disabled
|
|
60
|
+
description: Non-interactive; dimmed.
|
|
61
|
+
attribute: disabled
|
|
62
|
+
traits: []
|
|
63
|
+
tokens:
|
|
64
|
+
--check-box-background:
|
|
65
|
+
description: Unchecked background
|
|
66
|
+
--check-box-border-color:
|
|
67
|
+
description: Unchecked border color
|
|
68
|
+
--check-box-radius:
|
|
69
|
+
description: Checkbox border radius
|
|
70
|
+
--check-box-size:
|
|
71
|
+
description: Checkbox indicator size
|
|
72
|
+
--check-checked-background:
|
|
73
|
+
description: Checked/indeterminate background
|
|
74
|
+
--check-checked-border-color:
|
|
75
|
+
description: Checked/indeterminate border
|
|
76
|
+
--check-checked-foreground:
|
|
77
|
+
description: Checkmark/dash color
|
|
78
|
+
a2ui:
|
|
79
|
+
rules: []
|
|
80
|
+
anti_patterns: []
|
|
81
|
+
examples:
|
|
82
|
+
- name: basic-check
|
|
83
|
+
description: Basic Check usage
|
|
84
|
+
a2ui: >-
|
|
85
|
+
[
|
|
86
|
+
{
|
|
87
|
+
"id": "root",
|
|
88
|
+
"component": "Card",
|
|
89
|
+
"children": [
|
|
90
|
+
"sec"
|
|
91
|
+
]
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"id": "sec",
|
|
95
|
+
"component": "Section",
|
|
96
|
+
"children": [
|
|
97
|
+
"comp"
|
|
98
|
+
]
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"id": "comp",
|
|
102
|
+
"component": "Check",
|
|
103
|
+
"label": "Example Check"
|
|
104
|
+
}
|
|
105
|
+
]
|
|
106
|
+
keywords:
|
|
107
|
+
- check
|
|
108
|
+
synonyms: {}
|
|
109
|
+
related: []
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://adiaui.dev/a2ui/v0_9/components/Code.json",
|
|
4
|
+
"title": "Code",
|
|
5
|
+
"description": "Inline or block code display with optional language label and copy button.",
|
|
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": "Code"
|
|
18
|
+
},
|
|
19
|
+
"inline": {
|
|
20
|
+
"description": "Inline code (vs block)",
|
|
21
|
+
"type": "boolean",
|
|
22
|
+
"default": false
|
|
23
|
+
},
|
|
24
|
+
"language": {
|
|
25
|
+
"description": "Language hint for syntax highlighting",
|
|
26
|
+
"type": "string",
|
|
27
|
+
"default": ""
|
|
28
|
+
},
|
|
29
|
+
"lineNumbers": {
|
|
30
|
+
"description": "Show line number gutter alongside the code",
|
|
31
|
+
"type": "boolean",
|
|
32
|
+
"default": false
|
|
33
|
+
},
|
|
34
|
+
"text": {
|
|
35
|
+
"description": "Code text content",
|
|
36
|
+
"type": "string",
|
|
37
|
+
"default": ""
|
|
38
|
+
},
|
|
39
|
+
"wrap": {
|
|
40
|
+
"description": "Enable word wrapping",
|
|
41
|
+
"type": "boolean",
|
|
42
|
+
"default": false
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"required": [
|
|
46
|
+
"component"
|
|
47
|
+
],
|
|
48
|
+
"unevaluatedProperties": false,
|
|
49
|
+
"x-adiaui": {
|
|
50
|
+
"anti_patterns": [],
|
|
51
|
+
"category": "display",
|
|
52
|
+
"events": {
|
|
53
|
+
"copy": {
|
|
54
|
+
"description": "Fired when text is copied to clipboard"
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"examples": [
|
|
58
|
+
{
|
|
59
|
+
"description": "Code display block with syntax highlighting, language label, and a copy-to-clipboard button.",
|
|
60
|
+
"a2ui": "[\n {\n \"id\": \"root\",\n \"component\": \"Card\",\n \"children\": [\n \"hdr\",\n \"body\"\n ]\n },\n {\n \"id\": \"hdr\",\n \"component\": \"Header\",\n \"slots\": {\n \"heading\": \"Example\",\n \"action\": \"copy-btn\"\n },\n \"children\": [\n \"lang-badge\"\n ]\n },\n {\n \"id\": \"lang-badge\",\n \"component\": \"Badge\",\n \"attrs\": {\n \"variant\": \"default\"\n },\n \"content\": \"TypeScript\"\n },\n {\n \"id\": \"copy-btn\",\n \"component\": \"Button\",\n \"attrs\": {\n \"variant\": \"ghost\",\n \"icon\": \"copy\",\n \"size\": \"sm\",\n \"aria-label\": \"Copy code\"\n }\n },\n {\n \"id\": \"body\",\n \"component\": \"Section\",\n \"children\": [\n \"code\"\n ]\n },\n {\n \"id\": \"code\",\n \"component\": \"Code\",\n \"attrs\": {\n \"language\": \"typescript\",\n \"showLineNumbers\": true\n },\n \"content\": \"import { render } from '@a2ui/core';\\n\\nconst App = () => {\\n return render({\\n component: 'Card',\\n children: ['Hello, world!']\\n });\\n};\"\n }\n]",
|
|
61
|
+
"name": "code-block"
|
|
62
|
+
}
|
|
63
|
+
],
|
|
64
|
+
"keywords": [
|
|
65
|
+
"code",
|
|
66
|
+
"snippet",
|
|
67
|
+
"syntax",
|
|
68
|
+
"programming",
|
|
69
|
+
"ide",
|
|
70
|
+
"terminal",
|
|
71
|
+
"editor",
|
|
72
|
+
"document",
|
|
73
|
+
"api",
|
|
74
|
+
"developer"
|
|
75
|
+
],
|
|
76
|
+
"name": "AdiaCode",
|
|
77
|
+
"related": [
|
|
78
|
+
"badge",
|
|
79
|
+
"button"
|
|
80
|
+
],
|
|
81
|
+
"slots": {
|
|
82
|
+
"default": {
|
|
83
|
+
"description": "Raw text fallback when the text property is not set"
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
"states": [
|
|
87
|
+
{
|
|
88
|
+
"description": "Default, ready for interaction.",
|
|
89
|
+
"name": "idle"
|
|
90
|
+
}
|
|
91
|
+
],
|
|
92
|
+
"synonyms": {
|
|
93
|
+
"api": [
|
|
94
|
+
"api",
|
|
95
|
+
"key",
|
|
96
|
+
"table",
|
|
97
|
+
"code"
|
|
98
|
+
],
|
|
99
|
+
"code": [
|
|
100
|
+
"code",
|
|
101
|
+
"block",
|
|
102
|
+
"markdown",
|
|
103
|
+
"editor"
|
|
104
|
+
],
|
|
105
|
+
"developer": [
|
|
106
|
+
"api",
|
|
107
|
+
"key",
|
|
108
|
+
"code",
|
|
109
|
+
"block"
|
|
110
|
+
],
|
|
111
|
+
"document": [
|
|
112
|
+
"markdown",
|
|
113
|
+
"editor",
|
|
114
|
+
"code"
|
|
115
|
+
],
|
|
116
|
+
"editor": [
|
|
117
|
+
"markdown",
|
|
118
|
+
"editor",
|
|
119
|
+
"code",
|
|
120
|
+
"block"
|
|
121
|
+
],
|
|
122
|
+
"ide": [
|
|
123
|
+
"code",
|
|
124
|
+
"block",
|
|
125
|
+
"markdown",
|
|
126
|
+
"editor",
|
|
127
|
+
"split"
|
|
128
|
+
],
|
|
129
|
+
"programming": [
|
|
130
|
+
"code",
|
|
131
|
+
"block",
|
|
132
|
+
"markdown"
|
|
133
|
+
],
|
|
134
|
+
"snippet": [
|
|
135
|
+
"code",
|
|
136
|
+
"block"
|
|
137
|
+
],
|
|
138
|
+
"syntax": [
|
|
139
|
+
"code",
|
|
140
|
+
"block"
|
|
141
|
+
],
|
|
142
|
+
"terminal": [
|
|
143
|
+
"code",
|
|
144
|
+
"block",
|
|
145
|
+
"command"
|
|
146
|
+
]
|
|
147
|
+
},
|
|
148
|
+
"tag": "code-ui",
|
|
149
|
+
"tokens": {},
|
|
150
|
+
"traits": [],
|
|
151
|
+
"version": 1
|
|
152
|
+
}
|
|
153
|
+
}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
@scope (code-ui) {
|
|
2
|
+
:where(:scope) {
|
|
3
|
+
/* ── Layout ── */
|
|
4
|
+
--code-px: var(--a-space-3);
|
|
5
|
+
--code-py: var(--a-space-2);
|
|
6
|
+
--code-radius: var(--a-radius-md);
|
|
7
|
+
--code-radius-sm: var(--a-radius-sm);
|
|
8
|
+
--code-copy-px: var(--a-space-1);
|
|
9
|
+
|
|
10
|
+
/* ── Colors ── */
|
|
11
|
+
--code-bg: var(--a-bg-muted);
|
|
12
|
+
--code-fg: var(--a-fg);
|
|
13
|
+
--code-border: var(--a-border-subtle);
|
|
14
|
+
--code-header-bg: var(--a-bg-subtle);
|
|
15
|
+
--code-header-fg: var(--a-fg-muted);
|
|
16
|
+
--code-copy-hover-bg: var(--a-bg-muted);
|
|
17
|
+
--code-copy-hover-fg: var(--a-fg);
|
|
18
|
+
|
|
19
|
+
/* ── Typography ── */
|
|
20
|
+
--code-font: var(--a-font-family-code);
|
|
21
|
+
--code-font-size: var(--a-ui-sm);
|
|
22
|
+
--code-header-font: var(--a-ui-sm);
|
|
23
|
+
|
|
24
|
+
/* ── Transition ── */
|
|
25
|
+
--code-duration: var(--a-duration-fast);
|
|
26
|
+
--code-easing: var(--a-easing);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/* ── Block (default) ── */
|
|
30
|
+
:scope {
|
|
31
|
+
box-sizing: border-box;
|
|
32
|
+
display: block;
|
|
33
|
+
border: 1px solid var(--code-border);
|
|
34
|
+
border-radius: var(--code-radius);
|
|
35
|
+
overflow: hidden;
|
|
36
|
+
background: var(--code-bg);
|
|
37
|
+
color: var(--code-fg);
|
|
38
|
+
font-family: var(--code-font);
|
|
39
|
+
font-size: var(--code-font-size);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/* Header — chrome band above the code block */
|
|
43
|
+
> header {
|
|
44
|
+
display: flex;
|
|
45
|
+
flex-direction: row;
|
|
46
|
+
align-items: center;
|
|
47
|
+
justify-content: space-between;
|
|
48
|
+
padding: var(--code-py) var(--code-px);
|
|
49
|
+
background: var(--code-header-bg);
|
|
50
|
+
border-bottom: 1px solid var(--code-border);
|
|
51
|
+
font-size: var(--code-header-font);
|
|
52
|
+
color: var(--code-header-fg);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
> header [slot="label"] {
|
|
56
|
+
font-weight: 500;
|
|
57
|
+
text-transform: uppercase;
|
|
58
|
+
letter-spacing: 0.05em;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/* Copy button — ghost style */
|
|
62
|
+
> header [slot="copy"] {
|
|
63
|
+
all: unset;
|
|
64
|
+
cursor: pointer;
|
|
65
|
+
font-size: var(--code-header-font);
|
|
66
|
+
color: var(--code-header-fg);
|
|
67
|
+
padding: 2px var(--code-copy-px);
|
|
68
|
+
border-radius: var(--code-radius-sm);
|
|
69
|
+
transition:
|
|
70
|
+
background var(--code-duration) var(--code-easing),
|
|
71
|
+
color var(--code-duration) var(--code-easing);
|
|
72
|
+
}
|
|
73
|
+
> header [slot="copy"]:hover {
|
|
74
|
+
background: var(--code-copy-hover-bg);
|
|
75
|
+
color: var(--code-copy-hover-fg);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/* Pre > Code — reset any ambient page styling (margins, borders,
|
|
79
|
+
radii, backgrounds) so the <code-ui> chrome is the single source
|
|
80
|
+
of visual framing. */
|
|
81
|
+
> pre {
|
|
82
|
+
margin: 0;
|
|
83
|
+
border: none;
|
|
84
|
+
border-radius: 0;
|
|
85
|
+
background: transparent;
|
|
86
|
+
padding: var(--code-py) var(--code-px);
|
|
87
|
+
overflow-x: auto;
|
|
88
|
+
font-family: var(--code-font);
|
|
89
|
+
font-size: var(--code-font-size);
|
|
90
|
+
line-height: 1.5;
|
|
91
|
+
scrollbar-width: none;
|
|
92
|
+
}
|
|
93
|
+
> pre::-webkit-scrollbar {
|
|
94
|
+
display: none;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
> pre > code {
|
|
98
|
+
margin: 0;
|
|
99
|
+
padding: 0;
|
|
100
|
+
border: none;
|
|
101
|
+
border-radius: 0;
|
|
102
|
+
background: transparent;
|
|
103
|
+
font-family: inherit;
|
|
104
|
+
font-size: inherit;
|
|
105
|
+
color: inherit;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/* Footer — optional chrome band below the code block
|
|
109
|
+
(line counts, byte size, language family, etc.) */
|
|
110
|
+
> footer {
|
|
111
|
+
display: flex;
|
|
112
|
+
flex-direction: row;
|
|
113
|
+
align-items: center;
|
|
114
|
+
justify-content: space-between;
|
|
115
|
+
padding: var(--code-py) var(--code-px);
|
|
116
|
+
background: var(--code-header-bg);
|
|
117
|
+
border-top: 1px solid var(--code-border);
|
|
118
|
+
font-size: var(--code-header-font);
|
|
119
|
+
color: var(--code-header-fg);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/* ── Inline ── */
|
|
123
|
+
:scope[inline] {
|
|
124
|
+
display: inline;
|
|
125
|
+
padding: 0.1em 0.4em;
|
|
126
|
+
background: var(--code-bg);
|
|
127
|
+
border: none;
|
|
128
|
+
border-radius: var(--code-radius-sm);
|
|
129
|
+
font-family: var(--code-font);
|
|
130
|
+
font-size: 0.9em;
|
|
131
|
+
overflow: visible;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* <code-ui language="js">const x = 42;</code-ui>
|
|
3
|
+
* <code-ui language="css" inline>color: red</code-ui>
|
|
4
|
+
* <code-ui language="json" text='{ "hello": "world" }'></code-ui>
|
|
5
|
+
*
|
|
6
|
+
* Inline or block code display with optional language label and copy button.
|
|
7
|
+
* The body comes from (a) declarative children, or (b) the `text` attribute —
|
|
8
|
+
* the `text` path is reactive, so setting `code.setAttribute('text', newText)`
|
|
9
|
+
* updates the rendered code in place.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import { AdiaElement } from '@core/element.js';
|
|
13
|
+
|
|
14
|
+
class AdiaCode extends AdiaElement {
|
|
15
|
+
static properties = {
|
|
16
|
+
language: { type: String, default: '', reflect: true },
|
|
17
|
+
inline: { type: Boolean, default: false, reflect: true },
|
|
18
|
+
text: { type: String, default: '', reflect: true },
|
|
19
|
+
lineNumbers: { type: Boolean, default: false, reflect: true, attribute: 'line-numbers' },
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
static template = () => null;
|
|
23
|
+
|
|
24
|
+
#copyBtn = null;
|
|
25
|
+
#copyTimer = null;
|
|
26
|
+
|
|
27
|
+
#onCopyClick = () => this.#copy();
|
|
28
|
+
|
|
29
|
+
connected() {
|
|
30
|
+
if (!this.inline && !this.querySelector(':scope > pre')) {
|
|
31
|
+
this.#stampBlock();
|
|
32
|
+
}
|
|
33
|
+
this.#copyBtn = this.querySelector(':scope > header [slot="copy"]');
|
|
34
|
+
if (this.#copyBtn) {
|
|
35
|
+
this.#copyBtn.addEventListener('click', this.#onCopyClick);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
disconnected() {
|
|
40
|
+
if (this.#copyTimer != null) {
|
|
41
|
+
clearTimeout(this.#copyTimer);
|
|
42
|
+
this.#copyTimer = null;
|
|
43
|
+
}
|
|
44
|
+
if (this.#copyBtn) {
|
|
45
|
+
this.#copyBtn.removeEventListener('click', this.#onCopyClick);
|
|
46
|
+
this.#copyBtn = null;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
#stampBlock() {
|
|
51
|
+
// Prefer the `text` attribute when present; otherwise read the authored
|
|
52
|
+
// textContent. Either way, the block is rebuilt from semantic elements
|
|
53
|
+
// so whitespace in source HTML doesn't leak into the rendered <code>.
|
|
54
|
+
const raw = (this.text || this.textContent || '').trim();
|
|
55
|
+
this.textContent = '';
|
|
56
|
+
|
|
57
|
+
// Header — semantic <header> with labelled children
|
|
58
|
+
const header = document.createElement('header');
|
|
59
|
+
|
|
60
|
+
const label = document.createElement('span');
|
|
61
|
+
label.setAttribute('slot', 'label');
|
|
62
|
+
label.textContent = this.language || 'code';
|
|
63
|
+
header.appendChild(label);
|
|
64
|
+
|
|
65
|
+
const copyBtn = document.createElement('div');
|
|
66
|
+
copyBtn.setAttribute('role', 'button');
|
|
67
|
+
copyBtn.setAttribute('tabindex', '0');
|
|
68
|
+
copyBtn.setAttribute('slot', 'copy');
|
|
69
|
+
copyBtn.textContent = 'Copy';
|
|
70
|
+
header.appendChild(copyBtn);
|
|
71
|
+
|
|
72
|
+
// Pre > Code — direct semantic elements, no slot attr
|
|
73
|
+
const pre = document.createElement('pre');
|
|
74
|
+
const code = document.createElement('code');
|
|
75
|
+
code.textContent = raw;
|
|
76
|
+
pre.appendChild(code);
|
|
77
|
+
|
|
78
|
+
this.appendChild(header);
|
|
79
|
+
this.appendChild(pre);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
#copy() {
|
|
83
|
+
const code = this.querySelector(':scope > pre > code');
|
|
84
|
+
if (!code) return;
|
|
85
|
+
navigator.clipboard.writeText(code.textContent).then(() => {
|
|
86
|
+
const btn = this.querySelector(':scope > header [slot="copy"]');
|
|
87
|
+
if (!btn) return;
|
|
88
|
+
const prev = btn.textContent;
|
|
89
|
+
btn.textContent = 'Copied!';
|
|
90
|
+
if (this.#copyTimer != null) clearTimeout(this.#copyTimer);
|
|
91
|
+
this.#copyTimer = setTimeout(() => {
|
|
92
|
+
this.#copyTimer = null;
|
|
93
|
+
btn.textContent = prev;
|
|
94
|
+
}, 1500);
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
render() {
|
|
99
|
+
const label = this.querySelector(':scope > header [slot="label"]');
|
|
100
|
+
if (label && this.language) label.textContent = this.language;
|
|
101
|
+
|
|
102
|
+
// Keep the rendered code in sync with the reactive `text` property so
|
|
103
|
+
// callers can drive updates via setAttribute('text', ...).
|
|
104
|
+
if (!this.inline) {
|
|
105
|
+
const code = this.querySelector(':scope > pre > code');
|
|
106
|
+
if (code && code.textContent !== this.text && this.text !== '') {
|
|
107
|
+
code.textContent = this.text;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
customElements.define('code-ui', AdiaCode);
|
|
113
|
+
|
|
114
|
+
export { AdiaCode };
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
# Generated by scripts/migrate-yamls-to-v1.mjs — migrated to v1 contract.
|
|
2
|
+
# Edit this file; run `npm run build:components` to regenerate a2ui.json.
|
|
3
|
+
$schema: ../../../../scripts/schemas/component.yaml.schema.json
|
|
4
|
+
name: AdiaCode
|
|
5
|
+
tag: code-ui
|
|
6
|
+
component: Code
|
|
7
|
+
category: display
|
|
8
|
+
version: 1
|
|
9
|
+
description: Inline or block code display with optional language label and copy button.
|
|
10
|
+
props:
|
|
11
|
+
inline:
|
|
12
|
+
description: Inline code (vs block)
|
|
13
|
+
type: boolean
|
|
14
|
+
default: false
|
|
15
|
+
language:
|
|
16
|
+
description: Language hint for syntax highlighting
|
|
17
|
+
type: string
|
|
18
|
+
default: ""
|
|
19
|
+
lineNumbers:
|
|
20
|
+
description: Show line number gutter alongside the code
|
|
21
|
+
type: boolean
|
|
22
|
+
default: false
|
|
23
|
+
attribute: line-numbers
|
|
24
|
+
text:
|
|
25
|
+
description: Code text content
|
|
26
|
+
type: string
|
|
27
|
+
default: ""
|
|
28
|
+
wrap:
|
|
29
|
+
description: Enable word wrapping
|
|
30
|
+
type: boolean
|
|
31
|
+
default: false
|
|
32
|
+
events:
|
|
33
|
+
copy:
|
|
34
|
+
description: Fired when text is copied to clipboard
|
|
35
|
+
slots:
|
|
36
|
+
default:
|
|
37
|
+
description: Raw text fallback when the text property is not set
|
|
38
|
+
states:
|
|
39
|
+
- name: idle
|
|
40
|
+
description: Default, ready for interaction.
|
|
41
|
+
traits: []
|
|
42
|
+
tokens: {}
|
|
43
|
+
a2ui:
|
|
44
|
+
rules: []
|
|
45
|
+
anti_patterns: []
|
|
46
|
+
examples:
|
|
47
|
+
- name: code-block
|
|
48
|
+
description: Code display block with syntax highlighting, language label, and a copy-to-clipboard button.
|
|
49
|
+
a2ui: >-
|
|
50
|
+
[
|
|
51
|
+
{
|
|
52
|
+
"id": "root",
|
|
53
|
+
"component": "Card",
|
|
54
|
+
"children": [
|
|
55
|
+
"hdr",
|
|
56
|
+
"body"
|
|
57
|
+
]
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"id": "hdr",
|
|
61
|
+
"component": "Header",
|
|
62
|
+
"slots": {
|
|
63
|
+
"heading": "Example",
|
|
64
|
+
"action": "copy-btn"
|
|
65
|
+
},
|
|
66
|
+
"children": [
|
|
67
|
+
"lang-badge"
|
|
68
|
+
]
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"id": "lang-badge",
|
|
72
|
+
"component": "Badge",
|
|
73
|
+
"attrs": {
|
|
74
|
+
"variant": "default"
|
|
75
|
+
},
|
|
76
|
+
"content": "TypeScript"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"id": "copy-btn",
|
|
80
|
+
"component": "Button",
|
|
81
|
+
"attrs": {
|
|
82
|
+
"variant": "ghost",
|
|
83
|
+
"icon": "copy",
|
|
84
|
+
"size": "sm",
|
|
85
|
+
"aria-label": "Copy code"
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"id": "body",
|
|
90
|
+
"component": "Section",
|
|
91
|
+
"children": [
|
|
92
|
+
"code"
|
|
93
|
+
]
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"id": "code",
|
|
97
|
+
"component": "Code",
|
|
98
|
+
"attrs": {
|
|
99
|
+
"language": "typescript",
|
|
100
|
+
"showLineNumbers": true
|
|
101
|
+
},
|
|
102
|
+
"content": "import { render } from '@a2ui/core';\n\nconst App = () => {\n return render({\n component: 'Card',\n children: ['Hello, world!']\n });\n};"
|
|
103
|
+
}
|
|
104
|
+
]
|
|
105
|
+
keywords:
|
|
106
|
+
- code
|
|
107
|
+
- snippet
|
|
108
|
+
- syntax
|
|
109
|
+
- programming
|
|
110
|
+
- ide
|
|
111
|
+
- terminal
|
|
112
|
+
- editor
|
|
113
|
+
- document
|
|
114
|
+
- api
|
|
115
|
+
- developer
|
|
116
|
+
synonyms:
|
|
117
|
+
api:
|
|
118
|
+
- api
|
|
119
|
+
- key
|
|
120
|
+
- table
|
|
121
|
+
- code
|
|
122
|
+
code:
|
|
123
|
+
- code
|
|
124
|
+
- block
|
|
125
|
+
- markdown
|
|
126
|
+
- editor
|
|
127
|
+
developer:
|
|
128
|
+
- api
|
|
129
|
+
- key
|
|
130
|
+
- code
|
|
131
|
+
- block
|
|
132
|
+
document:
|
|
133
|
+
- markdown
|
|
134
|
+
- editor
|
|
135
|
+
- code
|
|
136
|
+
editor:
|
|
137
|
+
- markdown
|
|
138
|
+
- editor
|
|
139
|
+
- code
|
|
140
|
+
- block
|
|
141
|
+
ide:
|
|
142
|
+
- code
|
|
143
|
+
- block
|
|
144
|
+
- markdown
|
|
145
|
+
- editor
|
|
146
|
+
- split
|
|
147
|
+
programming:
|
|
148
|
+
- code
|
|
149
|
+
- block
|
|
150
|
+
- markdown
|
|
151
|
+
snippet:
|
|
152
|
+
- code
|
|
153
|
+
- block
|
|
154
|
+
syntax:
|
|
155
|
+
- code
|
|
156
|
+
- block
|
|
157
|
+
terminal:
|
|
158
|
+
- code
|
|
159
|
+
- block
|
|
160
|
+
- command
|
|
161
|
+
related:
|
|
162
|
+
- badge
|
|
163
|
+
- button
|