@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,246 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* <heatmap-ui> — Grid-based heatmap / density / day-grid visualization.
|
|
3
|
+
*
|
|
4
|
+
* Attributes:
|
|
5
|
+
* type — 'day-grid' | 'matrix' | 'density' (default 'matrix')
|
|
6
|
+
* rows — Number (default 7)
|
|
7
|
+
* cols — Number (default 12)
|
|
8
|
+
* scale — 'linear' | 'log' | 'quantile' (default 'linear')
|
|
9
|
+
* data — JSON string OR .data property [{ r, c, v, label? }]
|
|
10
|
+
* legend — Boolean (default true)
|
|
11
|
+
* color-scheme — 'accent' | 'success' | 'warning' | 'data-ramp' (default 'data-ramp')
|
|
12
|
+
* start-date — ISO date (for day-grid to label months)
|
|
13
|
+
* aspect — 'square' | 'wide' (default 'wide')
|
|
14
|
+
*
|
|
15
|
+
* Events:
|
|
16
|
+
* cell-hover — { detail: { r, c, v, label } }
|
|
17
|
+
* cell-click — { detail: { r, c, v, label } }
|
|
18
|
+
*
|
|
19
|
+
* Slots:
|
|
20
|
+
* title — optional header title
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
import { AdiaElement } from '@core/element.js';
|
|
24
|
+
|
|
25
|
+
const MONTHS = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];
|
|
26
|
+
|
|
27
|
+
class AdiaHeatmap extends AdiaElement {
|
|
28
|
+
static properties = {
|
|
29
|
+
type: { type: String, default: 'matrix', reflect: true },
|
|
30
|
+
rows: { type: Number, default: 7, reflect: true },
|
|
31
|
+
cols: { type: Number, default: 12, reflect: true },
|
|
32
|
+
scale: { type: String, default: 'linear', reflect: true },
|
|
33
|
+
legend: { type: Boolean, default: true, reflect: true },
|
|
34
|
+
colorScheme: { type: String, default: 'data-ramp', reflect: true, attribute: 'color-scheme' },
|
|
35
|
+
startDate: { type: String, default: '', reflect: true, attribute: 'start-date' },
|
|
36
|
+
aspect: { type: String, default: 'wide', reflect: true },
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
static template = () => null;
|
|
40
|
+
|
|
41
|
+
#data = [];
|
|
42
|
+
#bound = false;
|
|
43
|
+
|
|
44
|
+
set data(arr) {
|
|
45
|
+
if (typeof arr === 'string') {
|
|
46
|
+
try { arr = JSON.parse(arr); } catch { arr = []; }
|
|
47
|
+
}
|
|
48
|
+
this.#data = Array.isArray(arr) ? arr : [];
|
|
49
|
+
this.#requestRender();
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
get data() { return this.#data; }
|
|
53
|
+
|
|
54
|
+
connected() {
|
|
55
|
+
this.setAttribute('role', 'img');
|
|
56
|
+
// Parse data attribute if present
|
|
57
|
+
const raw = this.getAttribute('data');
|
|
58
|
+
if (raw && !this.#data.length) {
|
|
59
|
+
try { this.#data = JSON.parse(raw); } catch { /* ignore */ }
|
|
60
|
+
}
|
|
61
|
+
if (!this.#bound) {
|
|
62
|
+
this.#bound = true;
|
|
63
|
+
this.addEventListener('pointerover', this.#onHover);
|
|
64
|
+
this.addEventListener('click', this.#onClick);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
disconnected() {
|
|
69
|
+
this.removeEventListener('pointerover', this.#onHover);
|
|
70
|
+
this.removeEventListener('click', this.#onClick);
|
|
71
|
+
this.#bound = false;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
#raf = null;
|
|
75
|
+
#requestRender() {
|
|
76
|
+
if (!this.isConnected || this.#raf) return;
|
|
77
|
+
this.#raf = requestAnimationFrame(() => {
|
|
78
|
+
this.#raf = null;
|
|
79
|
+
this.render();
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// ── Bucket value to 0..4 based on scale + data min/max ──
|
|
84
|
+
|
|
85
|
+
#buckets() {
|
|
86
|
+
const values = this.#data.map((d) => Number(d.v) || 0);
|
|
87
|
+
if (!values.length) return (_) => 0;
|
|
88
|
+
let min = Math.min(...values);
|
|
89
|
+
let max = Math.max(...values);
|
|
90
|
+
if (min === max) return (_) => 4;
|
|
91
|
+
const scale = this.scale;
|
|
92
|
+
if (scale === 'log') {
|
|
93
|
+
const lo = Math.log(Math.max(1, min));
|
|
94
|
+
const hi = Math.log(Math.max(1, max));
|
|
95
|
+
return (v) => {
|
|
96
|
+
const l = Math.log(Math.max(1, Number(v) || 0));
|
|
97
|
+
const t = (l - lo) / (hi - lo);
|
|
98
|
+
return Math.min(4, Math.max(0, Math.round(t * 4)));
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
if (scale === 'quantile') {
|
|
102
|
+
const sorted = [...values].sort((a, b) => a - b);
|
|
103
|
+
const q = (p) => sorted[Math.floor(p * (sorted.length - 1))];
|
|
104
|
+
const breaks = [q(0.2), q(0.4), q(0.6), q(0.8)];
|
|
105
|
+
return (v) => {
|
|
106
|
+
const n = Number(v) || 0;
|
|
107
|
+
if (n <= breaks[0]) return 0;
|
|
108
|
+
if (n <= breaks[1]) return 1;
|
|
109
|
+
if (n <= breaks[2]) return 2;
|
|
110
|
+
if (n <= breaks[3]) return 3;
|
|
111
|
+
return 4;
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
// linear
|
|
115
|
+
return (v) => {
|
|
116
|
+
const n = Number(v) || 0;
|
|
117
|
+
const t = (n - min) / (max - min);
|
|
118
|
+
return Math.min(4, Math.max(0, Math.round(t * 4)));
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
render() {
|
|
123
|
+
const rows = Math.max(1, this.rows || 7);
|
|
124
|
+
const cols = Math.max(1, this.cols || 12);
|
|
125
|
+
|
|
126
|
+
// Build a map for fast lookup
|
|
127
|
+
const map = new Map();
|
|
128
|
+
for (const d of this.#data) {
|
|
129
|
+
if (d && d.r != null && d.c != null) map.set(`${d.r},${d.c}`, d);
|
|
130
|
+
}
|
|
131
|
+
const bucketOf = this.#buckets();
|
|
132
|
+
|
|
133
|
+
// ── Outer host layout: clear everything except <title> slot ──
|
|
134
|
+
// Keep only slotted title children if present.
|
|
135
|
+
const title = this.querySelector(':scope > [slot="title"]');
|
|
136
|
+
this.replaceChildren();
|
|
137
|
+
if (title) this.appendChild(title);
|
|
138
|
+
|
|
139
|
+
// ── Optional month-labels row (day-grid mode) ──
|
|
140
|
+
if (this.type === 'day-grid' && this.startDate) {
|
|
141
|
+
const labels = document.createElement('div');
|
|
142
|
+
labels.setAttribute('data-months', '');
|
|
143
|
+
const start = new Date(this.startDate);
|
|
144
|
+
if (!Number.isNaN(start.getTime())) {
|
|
145
|
+
// For day-grid: rows=7 (days of week), cols=weeks. Label months at column
|
|
146
|
+
// positions where the 1st of the month falls.
|
|
147
|
+
const marks = [];
|
|
148
|
+
for (let c = 0; c < cols; c++) {
|
|
149
|
+
const d = new Date(start);
|
|
150
|
+
d.setDate(d.getDate() + c * 7);
|
|
151
|
+
if (c === 0 || d.getDate() <= 7) {
|
|
152
|
+
marks.push({ col: c, label: MONTHS[d.getMonth()] });
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
for (const m of marks) {
|
|
156
|
+
const span = document.createElement('span');
|
|
157
|
+
span.setAttribute('data-month-label', '');
|
|
158
|
+
span.style.gridColumn = String(m.col + 1);
|
|
159
|
+
span.textContent = m.label;
|
|
160
|
+
labels.appendChild(span);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
labels.style.gridTemplateColumns = `repeat(${cols}, minmax(0, 1fr))`;
|
|
164
|
+
this.appendChild(labels);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
// ── Grid of cells ──
|
|
168
|
+
const grid = document.createElement('div');
|
|
169
|
+
grid.setAttribute('data-grid', '');
|
|
170
|
+
grid.style.gridTemplateColumns = `repeat(${cols}, minmax(0, 1fr))`;
|
|
171
|
+
grid.style.gridTemplateRows = `repeat(${rows}, 1fr)`;
|
|
172
|
+
for (let r = 0; r < rows; r++) {
|
|
173
|
+
for (let c = 0; c < cols; c++) {
|
|
174
|
+
const d = map.get(`${r},${c}`);
|
|
175
|
+
const cell = document.createElement('div');
|
|
176
|
+
cell.setAttribute('data-cell', '');
|
|
177
|
+
cell.setAttribute('role', 'gridcell');
|
|
178
|
+
cell.dataset.r = String(r);
|
|
179
|
+
cell.dataset.c = String(c);
|
|
180
|
+
if (d != null) {
|
|
181
|
+
const v = Number(d.v) || 0;
|
|
182
|
+
const bucket = bucketOf(v);
|
|
183
|
+
cell.dataset.bucket = String(bucket);
|
|
184
|
+
cell.dataset.v = String(v);
|
|
185
|
+
if (d.label) cell.setAttribute('aria-label', d.label);
|
|
186
|
+
} else {
|
|
187
|
+
cell.dataset.empty = '';
|
|
188
|
+
}
|
|
189
|
+
grid.appendChild(cell);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
this.appendChild(grid);
|
|
193
|
+
|
|
194
|
+
// ── Legend ──
|
|
195
|
+
if (this.legend) {
|
|
196
|
+
const legend = document.createElement('div');
|
|
197
|
+
legend.setAttribute('data-legend', '');
|
|
198
|
+
const less = document.createElement('span');
|
|
199
|
+
less.setAttribute('data-legend-label', '');
|
|
200
|
+
less.textContent = 'Less';
|
|
201
|
+
legend.appendChild(less);
|
|
202
|
+
for (let i = 0; i < 5; i++) {
|
|
203
|
+
const swatch = document.createElement('span');
|
|
204
|
+
swatch.setAttribute('data-legend-swatch', '');
|
|
205
|
+
swatch.dataset.bucket = String(i);
|
|
206
|
+
legend.appendChild(swatch);
|
|
207
|
+
}
|
|
208
|
+
const more = document.createElement('span');
|
|
209
|
+
more.setAttribute('data-legend-label', '');
|
|
210
|
+
more.textContent = 'More';
|
|
211
|
+
legend.appendChild(more);
|
|
212
|
+
this.appendChild(legend);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
#findCell(target) {
|
|
217
|
+
return target?.closest?.('[data-cell]');
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
#onHover = (e) => {
|
|
221
|
+
const cell = this.#findCell(e.target);
|
|
222
|
+
if (!cell || !cell.dataset.v) return;
|
|
223
|
+
const r = Number(cell.dataset.r);
|
|
224
|
+
const c = Number(cell.dataset.c);
|
|
225
|
+
const v = Number(cell.dataset.v);
|
|
226
|
+
const label = cell.getAttribute('aria-label') || '';
|
|
227
|
+
this.dispatchEvent(new CustomEvent('cell-hover', {
|
|
228
|
+
detail: { r, c, v, label }, bubbles: true,
|
|
229
|
+
}));
|
|
230
|
+
};
|
|
231
|
+
|
|
232
|
+
#onClick = (e) => {
|
|
233
|
+
const cell = this.#findCell(e.target);
|
|
234
|
+
if (!cell || !cell.dataset.v) return;
|
|
235
|
+
const r = Number(cell.dataset.r);
|
|
236
|
+
const c = Number(cell.dataset.c);
|
|
237
|
+
const v = Number(cell.dataset.v);
|
|
238
|
+
const label = cell.getAttribute('aria-label') || '';
|
|
239
|
+
this.dispatchEvent(new CustomEvent('cell-click', {
|
|
240
|
+
detail: { r, c, v, label }, bubbles: true,
|
|
241
|
+
}));
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
customElements.define('heatmap-ui', AdiaHeatmap);
|
|
246
|
+
export { AdiaHeatmap };
|
|
@@ -0,0 +1,131 @@
|
|
|
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: AdiaHeatmap
|
|
5
|
+
tag: heatmap-ui
|
|
6
|
+
component: Heatmap
|
|
7
|
+
category: data-display
|
|
8
|
+
version: 1
|
|
9
|
+
description: Grid heatmap with 5-bucket data ramp — supports day-grid (GitHub contributions),
|
|
10
|
+
matrix, and density modes.
|
|
11
|
+
props:
|
|
12
|
+
type:
|
|
13
|
+
description: Heatmap type
|
|
14
|
+
type: string
|
|
15
|
+
default: matrix
|
|
16
|
+
enum:
|
|
17
|
+
- day-grid
|
|
18
|
+
- matrix
|
|
19
|
+
- density
|
|
20
|
+
aspect:
|
|
21
|
+
description: Aspect ratio
|
|
22
|
+
type: string
|
|
23
|
+
default: wide
|
|
24
|
+
enum:
|
|
25
|
+
- square
|
|
26
|
+
- wide
|
|
27
|
+
colorScheme:
|
|
28
|
+
description: Color ramp
|
|
29
|
+
type: string
|
|
30
|
+
default: data-ramp
|
|
31
|
+
enum:
|
|
32
|
+
- accent
|
|
33
|
+
- success
|
|
34
|
+
- warning
|
|
35
|
+
- data-ramp
|
|
36
|
+
attribute: color-scheme
|
|
37
|
+
cols:
|
|
38
|
+
description: Column count
|
|
39
|
+
type: number
|
|
40
|
+
default: 12
|
|
41
|
+
legend:
|
|
42
|
+
description: Show Less/More legend strip
|
|
43
|
+
type: boolean
|
|
44
|
+
default: true
|
|
45
|
+
rows:
|
|
46
|
+
description: Row count
|
|
47
|
+
type: number
|
|
48
|
+
default: 7
|
|
49
|
+
scale:
|
|
50
|
+
description: Value-to-bucket scale
|
|
51
|
+
type: string
|
|
52
|
+
default: linear
|
|
53
|
+
enum:
|
|
54
|
+
- linear
|
|
55
|
+
- log
|
|
56
|
+
- quantile
|
|
57
|
+
startDate:
|
|
58
|
+
description: ISO start date; labels months in day-grid mode
|
|
59
|
+
type: string
|
|
60
|
+
default: ""
|
|
61
|
+
attribute: start-date
|
|
62
|
+
events:
|
|
63
|
+
cell-click:
|
|
64
|
+
description: "Fired on cell-click."
|
|
65
|
+
cell-hover:
|
|
66
|
+
description: "Fired on cell-hover."
|
|
67
|
+
slots:
|
|
68
|
+
title:
|
|
69
|
+
description: "Child content region for the `title` slot."
|
|
70
|
+
states:
|
|
71
|
+
- name: idle
|
|
72
|
+
description: Default, ready for interaction.
|
|
73
|
+
traits: []
|
|
74
|
+
tokens: {}
|
|
75
|
+
a2ui:
|
|
76
|
+
rules: []
|
|
77
|
+
anti_patterns: []
|
|
78
|
+
examples:
|
|
79
|
+
- name: basic-heatmap
|
|
80
|
+
description: Basic 7x12 matrix heatmap with random data.
|
|
81
|
+
a2ui: >-
|
|
82
|
+
[
|
|
83
|
+
{
|
|
84
|
+
"id": "root",
|
|
85
|
+
"component": "Card",
|
|
86
|
+
"children": [
|
|
87
|
+
"sec"
|
|
88
|
+
]
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"id": "sec",
|
|
92
|
+
"component": "Section",
|
|
93
|
+
"children": [
|
|
94
|
+
"hm"
|
|
95
|
+
]
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"id": "hm",
|
|
99
|
+
"component": "Heatmap",
|
|
100
|
+
"type": "matrix",
|
|
101
|
+
"rows": 7,
|
|
102
|
+
"cols": 12,
|
|
103
|
+
"legend": true,
|
|
104
|
+
"colorScheme": "data-ramp"
|
|
105
|
+
}
|
|
106
|
+
]
|
|
107
|
+
keywords:
|
|
108
|
+
- heatmap
|
|
109
|
+
- heat-map
|
|
110
|
+
- density
|
|
111
|
+
- matrix
|
|
112
|
+
- contribution
|
|
113
|
+
- calendar
|
|
114
|
+
- grid
|
|
115
|
+
- intensity
|
|
116
|
+
- activity
|
|
117
|
+
synonyms:
|
|
118
|
+
activity:
|
|
119
|
+
- heatmap
|
|
120
|
+
- calendar
|
|
121
|
+
- contribution
|
|
122
|
+
contribution:
|
|
123
|
+
- heatmap
|
|
124
|
+
- calendar
|
|
125
|
+
- activity
|
|
126
|
+
density:
|
|
127
|
+
- heatmap
|
|
128
|
+
- matrix
|
|
129
|
+
related:
|
|
130
|
+
- chart
|
|
131
|
+
- calendar-picker
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://adiaui.dev/a2ui/v0_9/components/Icon.json",
|
|
4
|
+
"title": "Icon",
|
|
5
|
+
"description": "SVG icon from the icon registry. Renders inline SVG from getIcon().",
|
|
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": "Icon"
|
|
18
|
+
},
|
|
19
|
+
"label": {
|
|
20
|
+
"description": "Accessible label. Sets role=img and aria-label.",
|
|
21
|
+
"type": "string",
|
|
22
|
+
"default": ""
|
|
23
|
+
},
|
|
24
|
+
"name": {
|
|
25
|
+
"description": "Icon name from registry",
|
|
26
|
+
"type": "string",
|
|
27
|
+
"default": ""
|
|
28
|
+
},
|
|
29
|
+
"size": {
|
|
30
|
+
"description": "Icon size. Accepts the named scale (xs/sm/md/lg/xl) or a pixel value as a string (\"12\", \"16\", \"24\", \"32\", \"48\"). Overrides --a-icon-size.",
|
|
31
|
+
"type": "string",
|
|
32
|
+
"default": ""
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"required": [
|
|
36
|
+
"component"
|
|
37
|
+
],
|
|
38
|
+
"unevaluatedProperties": false,
|
|
39
|
+
"x-adiaui": {
|
|
40
|
+
"anti_patterns": [],
|
|
41
|
+
"category": "display",
|
|
42
|
+
"events": {},
|
|
43
|
+
"examples": [
|
|
44
|
+
{
|
|
45
|
+
"description": "Command palette card with search input and a list of command options.",
|
|
46
|
+
"a2ui": "[\n {\n \"id\": \"root\",\n \"component\": \"Card\",\n \"children\": [\n \"hdr\",\n \"sec\"\n ]\n },\n {\n \"id\": \"hdr\",\n \"component\": \"Header\",\n \"children\": [\n \"search\"\n ]\n },\n {\n \"id\": \"search\",\n \"component\": \"Input\",\n \"placeholder\": \"Type a command or search...\",\n \"icon\": \"search\"\n },\n {\n \"id\": \"sec\",\n \"component\": \"Section\",\n \"children\": [\n \"options\"\n ]\n },\n {\n \"id\": \"options\",\n \"component\": \"Column\",\n \"gap\": \"1\",\n \"children\": [\n \"opt1\",\n \"opt2\",\n \"opt3\",\n \"opt4\",\n \"opt5\"\n ]\n },\n {\n \"id\": \"opt1\",\n \"component\": \"Row\",\n \"gap\": \"2\",\n \"children\": [\n \"i1\",\n \"l1\"\n ]\n },\n {\n \"id\": \"i1\",\n \"component\": \"Icon\",\n \"name\": \"file\"\n },\n {\n \"id\": \"l1\",\n \"component\": \"Text\",\n \"textContent\": \"Open File\"\n },\n {\n \"id\": \"opt2\",\n \"component\": \"Row\",\n \"gap\": \"2\",\n \"children\": [\n \"i2\",\n \"l2\"\n ]\n },\n {\n \"id\": \"i2\",\n \"component\": \"Icon\",\n \"name\": \"gear\"\n },\n {\n \"id\": \"l2\",\n \"component\": \"Text\",\n \"textContent\": \"Settings\"\n },\n {\n \"id\": \"opt3\",\n \"component\": \"Row\",\n \"gap\": \"2\",\n \"children\": [\n \"i3\",\n \"l3\"\n ]\n },\n {\n \"id\": \"i3\",\n \"component\": \"Icon\",\n \"name\": \"palette\"\n },\n {\n \"id\": \"l3\",\n \"component\": \"Text\",\n \"textContent\": \"Change Theme\"\n },\n {\n \"id\": \"opt4\",\n \"component\": \"Row\",\n \"gap\": \"2\",\n \"children\": [\n \"i4\",\n \"l4\"\n ]\n },\n {\n \"id\": \"i4\",\n \"component\": \"Icon\",\n \"name\": \"users\"\n },\n {\n \"id\": \"l4\",\n \"component\": \"Text\",\n \"textContent\": \"Manage Users\"\n },\n {\n \"id\": \"opt5\",\n \"component\": \"Row\",\n \"gap\": \"2\",\n \"children\": [\n \"i5\",\n \"l5\"\n ]\n },\n {\n \"id\": \"i5\",\n \"component\": \"Icon\",\n \"name\": \"sign-out\"\n },\n {\n \"id\": \"l5\",\n \"component\": \"Text\",\n \"textContent\": \"Sign Out\"\n }\n]",
|
|
47
|
+
"name": "command-palette"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"description": "Empty state component with icon, heading, description, and call-to-action button.",
|
|
51
|
+
"a2ui": "[\n {\n \"id\": \"root\",\n \"component\": \"EmptyState\",\n \"children\": [\n \"content\"\n ]\n },\n {\n \"id\": \"content\",\n \"component\": \"Column\",\n \"align\": \"center\",\n \"gap\": \"3\",\n \"children\": [\n \"icon\",\n \"heading\",\n \"desc\",\n \"cta\"\n ]\n },\n {\n \"id\": \"icon\",\n \"component\": \"Icon\",\n \"name\": \"inbox\",\n \"size\": \"xl\"\n },\n {\n \"id\": \"heading\",\n \"component\": \"Text\",\n \"variant\": \"heading\",\n \"textContent\": \"No items yet\"\n },\n {\n \"id\": \"desc\",\n \"component\": \"Text\",\n \"variant\": \"body\",\n \"textContent\": \"Get started by creating your first item. It only takes a moment.\"\n },\n {\n \"id\": \"cta\",\n \"component\": \"Button\",\n \"text\": \"Create Item\",\n \"icon\": \"plus\",\n \"variant\": \"primary\"\n }\n]",
|
|
52
|
+
"name": "empty-state"
|
|
53
|
+
}
|
|
54
|
+
],
|
|
55
|
+
"keywords": [
|
|
56
|
+
"icon"
|
|
57
|
+
],
|
|
58
|
+
"name": "AdiaIcon",
|
|
59
|
+
"related": [
|
|
60
|
+
"input",
|
|
61
|
+
"empty-state",
|
|
62
|
+
"button",
|
|
63
|
+
"badge",
|
|
64
|
+
"slider"
|
|
65
|
+
],
|
|
66
|
+
"slots": {},
|
|
67
|
+
"states": [
|
|
68
|
+
{
|
|
69
|
+
"description": "Default, ready for interaction.",
|
|
70
|
+
"name": "idle"
|
|
71
|
+
}
|
|
72
|
+
],
|
|
73
|
+
"synonyms": {},
|
|
74
|
+
"tag": "icon-ui",
|
|
75
|
+
"tokens": {},
|
|
76
|
+
"traits": [],
|
|
77
|
+
"version": 1
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
@scope (icon-ui) {
|
|
2
|
+
:where(:scope) {
|
|
3
|
+
--icon-size: var(--a-icon-size, calc(1em + 0.125rem));
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
:scope {
|
|
7
|
+
box-sizing: border-box;
|
|
8
|
+
display: inline-flex;
|
|
9
|
+
align-items: center;
|
|
10
|
+
justify-content: center;
|
|
11
|
+
width: var(--icon-size);
|
|
12
|
+
height: var(--icon-size);
|
|
13
|
+
flex-shrink: 0;
|
|
14
|
+
line-height: 0;
|
|
15
|
+
}
|
|
16
|
+
svg {
|
|
17
|
+
width: 100%;
|
|
18
|
+
height: 100%;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { AdiaElement, signal, html } from '@core/element.js';
|
|
2
|
+
import { getIcon } from '@core/icons.js';
|
|
3
|
+
|
|
4
|
+
class AdiaIcon extends AdiaElement {
|
|
5
|
+
static properties = {
|
|
6
|
+
name: { type: String, default: '', reflect: true },
|
|
7
|
+
size: { type: String, default: '', reflect: true },
|
|
8
|
+
label: { type: String, default: '', reflect: true },
|
|
9
|
+
/** regular | thin | light | bold | fill | duotone */
|
|
10
|
+
weight: { type: String, default: 'regular', reflect: true },
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
connected() {
|
|
14
|
+
this.setAttribute('role', this.label ? 'img' : 'presentation');
|
|
15
|
+
if (!this.label) this.setAttribute('aria-hidden', 'true');
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
render() {
|
|
19
|
+
if (this.label) this.setAttribute('aria-label', this.label);
|
|
20
|
+
const svg = getIcon(this.name, this.weight || 'regular');
|
|
21
|
+
if (svg && this.innerHTML !== svg) this.innerHTML = svg;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
customElements.define('icon-ui', AdiaIcon);
|
|
25
|
+
|
|
26
|
+
export { AdiaIcon };
|