@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,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* <progress-row-ui label="Documents" value="42" meta="32 GB"></progress-row-ui>
|
|
3
|
+
*
|
|
4
|
+
* Inline labeled progress row. Used for storage quotas, capacity
|
|
5
|
+
* breakdowns, budget/usage indicators.
|
|
6
|
+
*
|
|
7
|
+
* Layout:
|
|
8
|
+
* ┌──────────────────────────────────────┐
|
|
9
|
+
* │ Label Meta │ ← flex row, space-between
|
|
10
|
+
* │ ████████░░░░░░░░░░░░░░░░ │ ← progress bar below
|
|
11
|
+
* └──────────────────────────────────────┘
|
|
12
|
+
*
|
|
13
|
+
* Properties:
|
|
14
|
+
* label — left-hand label text
|
|
15
|
+
* value — 0-100 progress value (null or -1 = indeterminate)
|
|
16
|
+
* meta — right-hand meta text (e.g. "32 GB", "4.2k / 10k")
|
|
17
|
+
* variant — success | warning | danger (colors the fill; inherits otherwise)
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
import { AdiaElement } from '@core/element.js';
|
|
21
|
+
|
|
22
|
+
class AdiaProgressRow extends AdiaElement {
|
|
23
|
+
static properties = {
|
|
24
|
+
label: { type: String, default: '', reflect: true },
|
|
25
|
+
value: { type: Number, default: null, reflect: true },
|
|
26
|
+
meta: { type: String, default: '', reflect: true },
|
|
27
|
+
variant: { type: String, default: 'default', reflect: true },
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
static template = () => null;
|
|
31
|
+
|
|
32
|
+
#labelEl = null;
|
|
33
|
+
#metaEl = null;
|
|
34
|
+
#progressEl = null;
|
|
35
|
+
|
|
36
|
+
connected() {
|
|
37
|
+
this.setAttribute('role', 'group');
|
|
38
|
+
|
|
39
|
+
this.#labelEl = this.querySelector(':scope > [slot="label"]');
|
|
40
|
+
if (!this.#labelEl) {
|
|
41
|
+
this.#labelEl = document.createElement('span');
|
|
42
|
+
this.#labelEl.setAttribute('slot', 'label');
|
|
43
|
+
this.appendChild(this.#labelEl);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
this.#metaEl = this.querySelector(':scope > [slot="meta"]');
|
|
47
|
+
if (!this.#metaEl) {
|
|
48
|
+
this.#metaEl = document.createElement('span');
|
|
49
|
+
this.#metaEl.setAttribute('slot', 'meta');
|
|
50
|
+
this.appendChild(this.#metaEl);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
this.#progressEl = this.querySelector(':scope > progress-ui');
|
|
54
|
+
if (!this.#progressEl) {
|
|
55
|
+
this.#progressEl = document.createElement('progress-ui');
|
|
56
|
+
this.appendChild(this.#progressEl);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
disconnected() {
|
|
61
|
+
this.#labelEl = null;
|
|
62
|
+
this.#metaEl = null;
|
|
63
|
+
this.#progressEl = null;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
render() {
|
|
67
|
+
if (!this.#labelEl) return;
|
|
68
|
+
|
|
69
|
+
this.#labelEl.textContent = this.label;
|
|
70
|
+
this.#labelEl.hidden = !this.label;
|
|
71
|
+
|
|
72
|
+
this.#metaEl.textContent = this.meta;
|
|
73
|
+
this.#metaEl.hidden = !this.meta;
|
|
74
|
+
|
|
75
|
+
if (this.value != null && this.value >= 0) {
|
|
76
|
+
this.#progressEl.setAttribute('value', String(this.value));
|
|
77
|
+
} else {
|
|
78
|
+
this.#progressEl.removeAttribute('value');
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// ARIA: label the group so screen readers announce "Documents, 42 percent"
|
|
82
|
+
if (this.label) {
|
|
83
|
+
this.setAttribute('aria-label', this.meta ? `${this.label}, ${this.meta}` : this.label);
|
|
84
|
+
} else {
|
|
85
|
+
this.removeAttribute('aria-label');
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
customElements.define('progress-row-ui', AdiaProgressRow);
|
|
91
|
+
|
|
92
|
+
export { AdiaProgressRow };
|
|
@@ -0,0 +1,87 @@
|
|
|
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: AdiaProgressRow
|
|
5
|
+
tag: progress-row-ui
|
|
6
|
+
component: ProgressRow
|
|
7
|
+
category: data
|
|
8
|
+
version: 1
|
|
9
|
+
description: Inline labeled progress row with label, progress bar, and meta text. Used for storage
|
|
10
|
+
quotas, capacity breakdowns, usage indicators.
|
|
11
|
+
props:
|
|
12
|
+
label:
|
|
13
|
+
description: Left-hand label text
|
|
14
|
+
type: string
|
|
15
|
+
default: ""
|
|
16
|
+
meta:
|
|
17
|
+
description: Right-hand meta text (e.g. '32 GB', '4.2k / 10k')
|
|
18
|
+
type: string
|
|
19
|
+
default: ""
|
|
20
|
+
value:
|
|
21
|
+
description: Progress value 0-100 (-1 = indeterminate)
|
|
22
|
+
type: number
|
|
23
|
+
default: -1
|
|
24
|
+
max:
|
|
25
|
+
description: Upper bound for value. Defaults to 100.
|
|
26
|
+
type: number
|
|
27
|
+
default: 100
|
|
28
|
+
icon:
|
|
29
|
+
description: Optional Phosphor icon name rendered leading the label.
|
|
30
|
+
type: string
|
|
31
|
+
default: ""
|
|
32
|
+
variant:
|
|
33
|
+
description: Color variant for the progress fill
|
|
34
|
+
type: string
|
|
35
|
+
default: ""
|
|
36
|
+
enum:
|
|
37
|
+
- success
|
|
38
|
+
- warning
|
|
39
|
+
- danger
|
|
40
|
+
- info
|
|
41
|
+
- primary
|
|
42
|
+
events: {}
|
|
43
|
+
slots:
|
|
44
|
+
label:
|
|
45
|
+
description: "Label region — control label."
|
|
46
|
+
meta:
|
|
47
|
+
description: "Child content region for the `meta` slot."
|
|
48
|
+
states:
|
|
49
|
+
- name: idle
|
|
50
|
+
description: Default, ready for interaction.
|
|
51
|
+
traits: []
|
|
52
|
+
tokens: {}
|
|
53
|
+
a2ui:
|
|
54
|
+
rules: []
|
|
55
|
+
anti_patterns: []
|
|
56
|
+
examples:
|
|
57
|
+
- name: basic-progress-row
|
|
58
|
+
description: Basic ProgressRow usage
|
|
59
|
+
a2ui: >-
|
|
60
|
+
[
|
|
61
|
+
{
|
|
62
|
+
"id": "root",
|
|
63
|
+
"component": "Card",
|
|
64
|
+
"children": [
|
|
65
|
+
"sec"
|
|
66
|
+
]
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"id": "sec",
|
|
70
|
+
"component": "Section",
|
|
71
|
+
"children": [
|
|
72
|
+
"comp"
|
|
73
|
+
]
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"id": "comp",
|
|
77
|
+
"component": "ProgressRow",
|
|
78
|
+
"label": "Example ProgressRow"
|
|
79
|
+
}
|
|
80
|
+
]
|
|
81
|
+
keywords:
|
|
82
|
+
- progressrow
|
|
83
|
+
- progress-row
|
|
84
|
+
- progress
|
|
85
|
+
- row
|
|
86
|
+
synonyms: {}
|
|
87
|
+
related: []
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://adiaui.dev/a2ui/v0_9/components/Radio.json",
|
|
4
|
+
"title": "Radio",
|
|
5
|
+
"description": "Radio button with pure CSS dot. Groups by name attribute. Form-associated.",
|
|
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
|
+
"required": {
|
|
17
|
+
"description": "Marks the radio group as requiring a selection for form validation",
|
|
18
|
+
"type": "boolean",
|
|
19
|
+
"default": false
|
|
20
|
+
},
|
|
21
|
+
"checked": {
|
|
22
|
+
"description": "Whether this radio option is currently selected",
|
|
23
|
+
"type": "boolean",
|
|
24
|
+
"default": false
|
|
25
|
+
},
|
|
26
|
+
"component": {
|
|
27
|
+
"const": "Radio"
|
|
28
|
+
},
|
|
29
|
+
"disabled": {
|
|
30
|
+
"description": "Disables interaction and dims the control",
|
|
31
|
+
"type": "boolean",
|
|
32
|
+
"default": false
|
|
33
|
+
},
|
|
34
|
+
"error": {
|
|
35
|
+
"description": "Validation error message displayed by the parent form wrapper",
|
|
36
|
+
"type": "string",
|
|
37
|
+
"default": ""
|
|
38
|
+
},
|
|
39
|
+
"hint": {
|
|
40
|
+
"description": "Helper text displayed below the label",
|
|
41
|
+
"type": "string",
|
|
42
|
+
"default": ""
|
|
43
|
+
},
|
|
44
|
+
"label": {
|
|
45
|
+
"description": "Label text, rendered via CSS attr(label) on ::after",
|
|
46
|
+
"type": "string",
|
|
47
|
+
"default": ""
|
|
48
|
+
},
|
|
49
|
+
"name": {
|
|
50
|
+
"description": "Form control name for form data submission",
|
|
51
|
+
"type": "string",
|
|
52
|
+
"default": ""
|
|
53
|
+
},
|
|
54
|
+
"readonly": {
|
|
55
|
+
"description": "Prevents value changes while keeping the control focusable",
|
|
56
|
+
"type": "boolean",
|
|
57
|
+
"default": false
|
|
58
|
+
},
|
|
59
|
+
"value": {
|
|
60
|
+
"description": "Form value submitted when checked (defaults to 'on' if empty)",
|
|
61
|
+
"type": "string",
|
|
62
|
+
"default": ""
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
"required": [
|
|
66
|
+
"component"
|
|
67
|
+
],
|
|
68
|
+
"unevaluatedProperties": false,
|
|
69
|
+
"x-adiaui": {
|
|
70
|
+
"anti_patterns": [],
|
|
71
|
+
"category": "input",
|
|
72
|
+
"events": {
|
|
73
|
+
"change": {
|
|
74
|
+
"description": "Fired when this radio becomes selected (bubbles)"
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
"examples": [
|
|
78
|
+
{
|
|
79
|
+
"description": "Card with radio group for plan selection: Basic, Pro, and Enterprise tiers.",
|
|
80
|
+
"a2ui": "[\n {\n \"id\": \"root\",\n \"component\": \"Card\",\n \"children\": [\n \"hdr\",\n \"sec\",\n \"ftr\"\n ]\n },\n {\n \"id\": \"hdr\",\n \"component\": \"Header\",\n \"children\": [\n \"title\",\n \"desc\"\n ]\n },\n {\n \"id\": \"title\",\n \"component\": \"Text\",\n \"slot\": \"heading\",\n \"textContent\": \"Choose a Plan\",\n \"variant\": \"section\"\n },\n {\n \"id\": \"desc\",\n \"component\": \"Text\",\n \"slot\": \"description\",\n \"variant\": \"caption\",\n \"textContent\": \"Select the plan that works best for you\"\n },\n {\n \"id\": \"sec\",\n \"component\": \"Section\",\n \"children\": [\n \"options\"\n ]\n },\n {\n \"id\": \"options\",\n \"component\": \"Column\",\n \"children\": [\n \"basic\",\n \"pro\",\n \"enterprise\"\n ],\n \"gap\": \"3\"\n },\n {\n \"id\": \"basic\",\n \"component\": \"Radio\",\n \"label\": \"Basic — $9/mo\",\n \"value\": \"basic\",\n \"name\": \"plan\"\n },\n {\n \"id\": \"pro\",\n \"component\": \"Radio\",\n \"label\": \"Pro — $29/mo\",\n \"value\": \"pro\",\n \"name\": \"plan\"\n },\n {\n \"id\": \"enterprise\",\n \"component\": \"Radio\",\n \"label\": \"Enterprise — $99/mo\",\n \"value\": \"enterprise\",\n \"name\": \"plan\"\n },\n {\n \"id\": \"ftr\",\n \"component\": \"Footer\",\n \"children\": [\n \"confirm-btn\"\n ]\n },\n {\n \"id\": \"confirm-btn\",\n \"component\": \"Button\",\n \"text\": \"Confirm Plan\",\n \"variant\": \"primary\",\n \"block\": true,\n \"slot\": \"action\"\n }\n]",
|
|
81
|
+
"name": "radio-group"
|
|
82
|
+
}
|
|
83
|
+
],
|
|
84
|
+
"keywords": [
|
|
85
|
+
"radio",
|
|
86
|
+
"options",
|
|
87
|
+
"select",
|
|
88
|
+
"checkbox",
|
|
89
|
+
"toggle",
|
|
90
|
+
"switch",
|
|
91
|
+
"survey",
|
|
92
|
+
"questionnaire",
|
|
93
|
+
"poll"
|
|
94
|
+
],
|
|
95
|
+
"name": "AdiaRadio",
|
|
96
|
+
"related": [
|
|
97
|
+
"button"
|
|
98
|
+
],
|
|
99
|
+
"slots": {
|
|
100
|
+
"dot": {
|
|
101
|
+
"description": "Radio dot indicator, sized via --dot-size"
|
|
102
|
+
},
|
|
103
|
+
"hint": {
|
|
104
|
+
"description": "Hint text container, rendered via CSS attr(hint) on ::after"
|
|
105
|
+
},
|
|
106
|
+
"label": {
|
|
107
|
+
"description": "Label text container, rendered via CSS attr(label) on ::after"
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
"states": [
|
|
111
|
+
{
|
|
112
|
+
"description": "Default, ready for interaction.",
|
|
113
|
+
"name": "idle"
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"description": "Non-interactive; dimmed.",
|
|
117
|
+
"attribute": "disabled",
|
|
118
|
+
"name": "disabled"
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"description": "Keyboard focus ring.",
|
|
122
|
+
"name": "focused",
|
|
123
|
+
"selector": ":focus-visible"
|
|
124
|
+
}
|
|
125
|
+
],
|
|
126
|
+
"synonyms": {
|
|
127
|
+
"checkbox": [
|
|
128
|
+
"radio",
|
|
129
|
+
"checklist",
|
|
130
|
+
"form"
|
|
131
|
+
],
|
|
132
|
+
"options": [
|
|
133
|
+
"settings",
|
|
134
|
+
"radio",
|
|
135
|
+
"segmented",
|
|
136
|
+
"accordion"
|
|
137
|
+
],
|
|
138
|
+
"poll": [
|
|
139
|
+
"form",
|
|
140
|
+
"radio",
|
|
141
|
+
"chart"
|
|
142
|
+
],
|
|
143
|
+
"questionnaire": [
|
|
144
|
+
"form",
|
|
145
|
+
"create",
|
|
146
|
+
"radio",
|
|
147
|
+
"wizard"
|
|
148
|
+
],
|
|
149
|
+
"select": [
|
|
150
|
+
"radio",
|
|
151
|
+
"segmented",
|
|
152
|
+
"form"
|
|
153
|
+
],
|
|
154
|
+
"survey": [
|
|
155
|
+
"form",
|
|
156
|
+
"create",
|
|
157
|
+
"radio"
|
|
158
|
+
],
|
|
159
|
+
"switch": [
|
|
160
|
+
"segmented",
|
|
161
|
+
"radio",
|
|
162
|
+
"settings"
|
|
163
|
+
],
|
|
164
|
+
"toggle": [
|
|
165
|
+
"segmented",
|
|
166
|
+
"radio",
|
|
167
|
+
"settings"
|
|
168
|
+
]
|
|
169
|
+
},
|
|
170
|
+
"tag": "radio-ui",
|
|
171
|
+
"tokens": {
|
|
172
|
+
"--radio-checked-background": {
|
|
173
|
+
"description": "Override checked state background"
|
|
174
|
+
},
|
|
175
|
+
"--radio-checked-border-color": {
|
|
176
|
+
"description": "Override checked state border color"
|
|
177
|
+
},
|
|
178
|
+
"--radio-checked-foreground": {
|
|
179
|
+
"description": "Override inner dot color when checked"
|
|
180
|
+
},
|
|
181
|
+
"--radio-disabled-opacity": {
|
|
182
|
+
"description": "Override disabled state opacity"
|
|
183
|
+
},
|
|
184
|
+
"--radio-dot-background": {
|
|
185
|
+
"description": "Override default dot background"
|
|
186
|
+
},
|
|
187
|
+
"--radio-dot-border-color": {
|
|
188
|
+
"description": "Override default dot border color"
|
|
189
|
+
},
|
|
190
|
+
"--radio-dot-radius": {
|
|
191
|
+
"description": "Override dot border radius"
|
|
192
|
+
},
|
|
193
|
+
"--radio-dot-size": {
|
|
194
|
+
"description": "Override dot diameter (default: 64% of --a-content-height)"
|
|
195
|
+
},
|
|
196
|
+
"--radio-focus-color": {
|
|
197
|
+
"description": "Override focus ring color"
|
|
198
|
+
},
|
|
199
|
+
"--radio-gap": {
|
|
200
|
+
"description": "Override gap between dot and label"
|
|
201
|
+
},
|
|
202
|
+
"--radio-hint-color": {
|
|
203
|
+
"description": "Override hint text color"
|
|
204
|
+
},
|
|
205
|
+
"--radio-hint-font-size": {
|
|
206
|
+
"description": "Override hint font size"
|
|
207
|
+
},
|
|
208
|
+
"--radio-hover-border-color": {
|
|
209
|
+
"description": "Override hover state border color"
|
|
210
|
+
},
|
|
211
|
+
"--radio-label-color": {
|
|
212
|
+
"description": "Override label text color"
|
|
213
|
+
},
|
|
214
|
+
"--radio-label-font-family": {
|
|
215
|
+
"description": "Override label font family"
|
|
216
|
+
},
|
|
217
|
+
"--radio-label-font-size": {
|
|
218
|
+
"description": "Override label font size"
|
|
219
|
+
},
|
|
220
|
+
"--radio-label-line-height": {
|
|
221
|
+
"description": "Override label line height"
|
|
222
|
+
},
|
|
223
|
+
"--radio-transition": {
|
|
224
|
+
"description": "Override transition timing"
|
|
225
|
+
}
|
|
226
|
+
},
|
|
227
|
+
"traits": [
|
|
228
|
+
"focusable"
|
|
229
|
+
],
|
|
230
|
+
"version": 1
|
|
231
|
+
}
|
|
232
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
@scope (radio-ui) {
|
|
2
|
+
:where(:scope) {
|
|
3
|
+
/* ── Layout ── (size scales with universal [size] attribute via --a-toggle-size) */
|
|
4
|
+
--radio-size: var(--a-toggle-size);
|
|
5
|
+
--radio-gap: var(--a-space-2);
|
|
6
|
+
--radio-radius: var(--a-radius-full);
|
|
7
|
+
|
|
8
|
+
/* ── Colors ── */
|
|
9
|
+
--radio-bg: var(--a-ui-bg);
|
|
10
|
+
--radio-border: var(--a-ui-border);
|
|
11
|
+
--radio-border-hover: var(--a-fg-subtle);
|
|
12
|
+
--radio-bg-hover: var(--a-bg-muted);
|
|
13
|
+
|
|
14
|
+
/* ── State: checked ── */
|
|
15
|
+
--radio-bg-checked: var(--a-primary);
|
|
16
|
+
--radio-border-checked: var(--a-primary);
|
|
17
|
+
--radio-fg-checked: white;
|
|
18
|
+
--radio-bg-checked-hover: var(--a-primary-hover);
|
|
19
|
+
|
|
20
|
+
/* ── State: disabled ── */
|
|
21
|
+
--radio-fg-disabled: var(--a-fg-muted);
|
|
22
|
+
|
|
23
|
+
/* ── State: focus ── */
|
|
24
|
+
--radio-focus-ring: var(--a-focus-ring);
|
|
25
|
+
|
|
26
|
+
/* ── Typography ── */
|
|
27
|
+
--radio-font-size: var(--a-ui-size);
|
|
28
|
+
|
|
29
|
+
/* ── Transition ── */
|
|
30
|
+
--radio-duration: var(--a-duration-fast);
|
|
31
|
+
--radio-easing: var(--a-easing);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
:scope {
|
|
35
|
+
/* ── Base ── */
|
|
36
|
+
box-sizing: border-box;
|
|
37
|
+
display: inline-flex;
|
|
38
|
+
align-items: center;
|
|
39
|
+
gap: var(--radio-gap);
|
|
40
|
+
cursor: pointer;
|
|
41
|
+
user-select: none;
|
|
42
|
+
font-size: var(--radio-font-size);
|
|
43
|
+
outline: none;
|
|
44
|
+
}
|
|
45
|
+
:scope[disabled] { cursor: not-allowed; color: var(--radio-fg-disabled); }
|
|
46
|
+
|
|
47
|
+
/* Dot */
|
|
48
|
+
[slot="dot"] {
|
|
49
|
+
flex-shrink: 0;
|
|
50
|
+
width: var(--radio-size);
|
|
51
|
+
height: var(--radio-size);
|
|
52
|
+
border: 1.5px solid var(--radio-border);
|
|
53
|
+
border-radius: var(--radio-radius);
|
|
54
|
+
background: var(--radio-bg);
|
|
55
|
+
display: inline-flex;
|
|
56
|
+
align-items: center;
|
|
57
|
+
justify-content: center;
|
|
58
|
+
transition:
|
|
59
|
+
background var(--radio-duration) var(--radio-easing),
|
|
60
|
+
border-color var(--radio-duration) var(--radio-easing);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/* Inner dot — scales from 0 to 40% when checked */
|
|
64
|
+
[slot="dot"]::after {
|
|
65
|
+
content: '';
|
|
66
|
+
width: 0;
|
|
67
|
+
height: 0;
|
|
68
|
+
border-radius: var(--radio-radius);
|
|
69
|
+
background: var(--radio-fg-checked);
|
|
70
|
+
transition:
|
|
71
|
+
width var(--radio-duration) var(--radio-easing),
|
|
72
|
+
height var(--radio-duration) var(--radio-easing);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
:scope[checked] [slot="dot"]::after {
|
|
76
|
+
width: calc(var(--radio-size) * 0.6);
|
|
77
|
+
height: calc(var(--radio-size) * 0.6);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
:scope:not([disabled]):hover [slot="dot"] {
|
|
81
|
+
border-color: var(--radio-border-hover);
|
|
82
|
+
background: var(--radio-bg-hover);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
:scope[checked] [slot="dot"] {
|
|
86
|
+
background: var(--radio-bg-checked);
|
|
87
|
+
border-color: var(--radio-border-checked);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
:scope[checked]:not([disabled]):hover [slot="dot"] {
|
|
91
|
+
background: var(--radio-bg-checked-hover);
|
|
92
|
+
border-color: var(--radio-bg-checked-hover);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/* Label */
|
|
96
|
+
:scope[label]::after { content: attr(label); }
|
|
97
|
+
|
|
98
|
+
/* Focus */
|
|
99
|
+
:scope:focus-visible [slot="dot"] { box-shadow: var(--radio-focus-ring); }
|
|
100
|
+
|
|
101
|
+
/* Size handled by universal [size] attribute system. */
|
|
102
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* <radio-ui> — Radio button. The host IS the control.
|
|
3
|
+
* Pure CSS dot via [slot="dot"]::after inner circle. No SVG, no inset shadow hack.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { AdiaFormElement } from '@core/form.js';
|
|
7
|
+
import { html } from '@core/element.js';
|
|
8
|
+
|
|
9
|
+
class AdiaRadio extends AdiaFormElement {
|
|
10
|
+
static properties = {
|
|
11
|
+
...AdiaFormElement.properties,
|
|
12
|
+
checked: { type: Boolean, default: false, reflect: true },
|
|
13
|
+
label: { type: String, default: '', reflect: true },
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
static template = () => html`<span slot="dot"></span>`;
|
|
17
|
+
|
|
18
|
+
connected() {
|
|
19
|
+
super.connected();
|
|
20
|
+
this.setAttribute('role', 'radio');
|
|
21
|
+
this.setAttribute('tabindex', '0');
|
|
22
|
+
this.addEventListener('click', this.#select);
|
|
23
|
+
this.addEventListener('keydown', this.#onKey);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
render() {
|
|
27
|
+
this.setAttribute('aria-checked', String(this.checked));
|
|
28
|
+
if (this.label) this.setAttribute('aria-label', this.label);
|
|
29
|
+
if (this.checked) this.syncValue(this.value || 'on');
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
#select = () => {
|
|
33
|
+
if (this.disabled || this.checked) return;
|
|
34
|
+
const group = this.closest('fieldset, [role="radiogroup"]') || this.parentElement;
|
|
35
|
+
if (group) {
|
|
36
|
+
for (const r of group.querySelectorAll(`radio-ui[name="${this.name}"]`)) {
|
|
37
|
+
if (r !== this && r.checked) r.checked = false;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
this.checked = true;
|
|
41
|
+
this.dispatchEvent(new Event('change', { bubbles: true }));
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
#onKey = (e) => {
|
|
45
|
+
if (e.key === ' ' || e.key === 'Enter') { e.preventDefault(); this.#select(); }
|
|
46
|
+
if (e.key === 'ArrowDown' || e.key === 'ArrowRight') {
|
|
47
|
+
e.preventDefault();
|
|
48
|
+
const next = this.#sibling(1);
|
|
49
|
+
if (next) { next.focus(); next.click(); }
|
|
50
|
+
}
|
|
51
|
+
if (e.key === 'ArrowUp' || e.key === 'ArrowLeft') {
|
|
52
|
+
e.preventDefault();
|
|
53
|
+
const prev = this.#sibling(-1);
|
|
54
|
+
if (prev) { prev.focus(); prev.click(); }
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
#sibling(dir) {
|
|
59
|
+
const group = this.closest('fieldset, [role="radiogroup"]') || this.parentElement;
|
|
60
|
+
const radios = [...(group?.querySelectorAll(`radio-ui[name="${this.name}"]`) || [])];
|
|
61
|
+
const i = radios.indexOf(this);
|
|
62
|
+
return radios[(i + dir + radios.length) % radios.length] || null;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
disconnected() {
|
|
66
|
+
super.disconnected();
|
|
67
|
+
this.removeEventListener('click', this.#select);
|
|
68
|
+
this.removeEventListener('keydown', this.#onKey);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
customElements.define('radio-ui', AdiaRadio);
|
|
72
|
+
|
|
73
|
+
export { AdiaRadio };
|