@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,136 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://adiaui.dev/a2ui/v0_9/components/Modal.json",
|
|
4
|
+
"title": "Modal",
|
|
5
|
+
"description": "Centered dialog overlay using native <dialog>. Focus trapping, Escape key, backdrop.",
|
|
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
|
+
"anchor": {
|
|
17
|
+
"description": "ID of the element to anchor to (popover mode only). Positions the surface below the anchor element.",
|
|
18
|
+
"type": "string",
|
|
19
|
+
"default": ""
|
|
20
|
+
},
|
|
21
|
+
"component": {
|
|
22
|
+
"const": "Modal"
|
|
23
|
+
},
|
|
24
|
+
"mode": {
|
|
25
|
+
"description": "Surface type. Dialog uses showModal() with backdrop and focus trap. Popover uses the Popover API with light dismiss and optional anchor positioning.",
|
|
26
|
+
"type": "string",
|
|
27
|
+
"enum": [
|
|
28
|
+
"dialog",
|
|
29
|
+
"popover"
|
|
30
|
+
],
|
|
31
|
+
"default": "dialog"
|
|
32
|
+
},
|
|
33
|
+
"open": {
|
|
34
|
+
"description": "Alias for show (backwards compatibility). Either property controls visibility.",
|
|
35
|
+
"type": "boolean",
|
|
36
|
+
"default": false
|
|
37
|
+
},
|
|
38
|
+
"permanent": {
|
|
39
|
+
"description": "When true, suppress backdrop click and Escape key dismissal of the overlay",
|
|
40
|
+
"type": "boolean",
|
|
41
|
+
"default": false
|
|
42
|
+
},
|
|
43
|
+
"show": {
|
|
44
|
+
"description": "Controls overlay visibility. Setting to true opens the surface with entry animation.",
|
|
45
|
+
"type": "boolean",
|
|
46
|
+
"default": false
|
|
47
|
+
},
|
|
48
|
+
"size": {
|
|
49
|
+
"description": "Width preset. sm=24rem, md=32rem, lg=48rem, full=95vw.",
|
|
50
|
+
"type": "string",
|
|
51
|
+
"enum": [
|
|
52
|
+
"sm",
|
|
53
|
+
"md",
|
|
54
|
+
"lg",
|
|
55
|
+
"xl"
|
|
56
|
+
],
|
|
57
|
+
"default": "md"
|
|
58
|
+
},
|
|
59
|
+
"text": {
|
|
60
|
+
"description": "Aria label applied to the surface element for accessibility",
|
|
61
|
+
"type": "string",
|
|
62
|
+
"default": ""
|
|
63
|
+
},
|
|
64
|
+
"trigger": {
|
|
65
|
+
"description": "ID of the element that opens this modal (sets aria-controls + click handler).",
|
|
66
|
+
"type": "string",
|
|
67
|
+
"default": ""
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"required": [
|
|
71
|
+
"component"
|
|
72
|
+
],
|
|
73
|
+
"unevaluatedProperties": false,
|
|
74
|
+
"x-adiaui": {
|
|
75
|
+
"anti_patterns": [],
|
|
76
|
+
"category": "container",
|
|
77
|
+
"events": {
|
|
78
|
+
"close": {
|
|
79
|
+
"description": "Fired when the overlay is dismissed via backdrop click, Escape key, popover toggle, or programmatic hide(). Bubbles."
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
"examples": [
|
|
83
|
+
{
|
|
84
|
+
"description": "Basic Modal usage",
|
|
85
|
+
"a2ui": "[\n {\n \"id\": \"root\",\n \"component\": \"Card\",\n \"children\": [\n \"sec\"\n ]\n },\n {\n \"id\": \"sec\",\n \"component\": \"Section\",\n \"children\": [\n \"comp\"\n ]\n },\n {\n \"id\": \"comp\",\n \"component\": \"Modal\",\n \"text\": \"Example Modal\"\n }\n]",
|
|
86
|
+
"name": "basic-modal"
|
|
87
|
+
}
|
|
88
|
+
],
|
|
89
|
+
"keywords": [
|
|
90
|
+
"modal"
|
|
91
|
+
],
|
|
92
|
+
"name": "AdiaModal",
|
|
93
|
+
"related": [],
|
|
94
|
+
"slots": {
|
|
95
|
+
"default": {
|
|
96
|
+
"description": "Content placed inside the modal surface. Accepts any elements (card-ui, command-ui, custom markup)."
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
"states": [
|
|
100
|
+
{
|
|
101
|
+
"description": "Default, ready for interaction.",
|
|
102
|
+
"name": "idle"
|
|
103
|
+
}
|
|
104
|
+
],
|
|
105
|
+
"synonyms": {},
|
|
106
|
+
"tag": "modal-ui",
|
|
107
|
+
"tokens": {
|
|
108
|
+
"--modal-backdrop": {
|
|
109
|
+
"description": "Override backdrop color (dialog mode)"
|
|
110
|
+
},
|
|
111
|
+
"--modal-background": {
|
|
112
|
+
"description": "Override surface background color"
|
|
113
|
+
},
|
|
114
|
+
"--modal-border-color": {
|
|
115
|
+
"description": "Override surface border color"
|
|
116
|
+
},
|
|
117
|
+
"--modal-duration": {
|
|
118
|
+
"description": "Override open/close animation duration"
|
|
119
|
+
},
|
|
120
|
+
"--modal-easing-in": {
|
|
121
|
+
"description": "Override entry animation easing curve"
|
|
122
|
+
},
|
|
123
|
+
"--modal-easing-out": {
|
|
124
|
+
"description": "Override exit animation easing curve"
|
|
125
|
+
},
|
|
126
|
+
"--modal-radius": {
|
|
127
|
+
"description": "Override surface border radius"
|
|
128
|
+
},
|
|
129
|
+
"--modal-shadow": {
|
|
130
|
+
"description": "Override surface box shadow"
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
"traits": [],
|
|
134
|
+
"version": 1
|
|
135
|
+
}
|
|
136
|
+
}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
/* ═══════════════════════════════════════════════════════════════
|
|
2
|
+
MODAL-N — Centered dialog overlay using native <dialog>.
|
|
3
|
+
═══════════════════════════════════════════════════════════════ */
|
|
4
|
+
|
|
5
|
+
@scope (modal-ui) {
|
|
6
|
+
:where(:scope) {
|
|
7
|
+
--modal-width: 32rem;
|
|
8
|
+
--modal-radius: var(--a-radius-lg);
|
|
9
|
+
--modal-bg: var(--a-bg-subtle);
|
|
10
|
+
--modal-border: var(--a-border-subtle);
|
|
11
|
+
--modal-shadow: var(--a-shadow-lg);
|
|
12
|
+
--modal-backdrop: var(--a-scrim-dialog);
|
|
13
|
+
--modal-duration: var(--a-duration);
|
|
14
|
+
--modal-easing: var(--a-easing-out);
|
|
15
|
+
--modal-heading-size: var(--a-ui-lg);
|
|
16
|
+
--modal-heading-weight: var(--a-weight-semibold);
|
|
17
|
+
--modal-header-fg: var(--a-fg);
|
|
18
|
+
--modal-close-fg: var(--a-fg-muted);
|
|
19
|
+
--modal-close-hover: var(--a-fg);
|
|
20
|
+
--modal-pad-header: var(--a-space-3);
|
|
21
|
+
--modal-pad-body: var(--a-space-4);
|
|
22
|
+
--modal-pad-footer: var(--a-space-3);
|
|
23
|
+
--modal-font-family: var(--a-font-family);
|
|
24
|
+
--modal-footer-gap: var(--a-space-2);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
:scope {
|
|
28
|
+
box-sizing: border-box;
|
|
29
|
+
display: contents;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/* ── Size variants ── */
|
|
33
|
+
:scope[size="sm"] { --modal-width: min(24rem, 90vw); }
|
|
34
|
+
:scope[size="md"] { --modal-width: min(32rem, 90vw); }
|
|
35
|
+
:scope[size="lg"] { --modal-width: min(48rem, 90vw); }
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/* ═══════ Closed ═══════ */
|
|
39
|
+
|
|
40
|
+
modal-ui > [slot="dialog"]:not([open]) { display: none; }
|
|
41
|
+
|
|
42
|
+
/* ═══════ Full-viewport dialog shell ═══════ */
|
|
43
|
+
|
|
44
|
+
modal-ui > [slot="dialog"][open] {
|
|
45
|
+
box-sizing: border-box;
|
|
46
|
+
position: fixed;
|
|
47
|
+
inset: 0;
|
|
48
|
+
width: 100%;
|
|
49
|
+
height: 100%;
|
|
50
|
+
max-width: none;
|
|
51
|
+
max-height: none;
|
|
52
|
+
margin: 0;
|
|
53
|
+
padding: 0;
|
|
54
|
+
border: none;
|
|
55
|
+
background: transparent;
|
|
56
|
+
overflow: clip;
|
|
57
|
+
display: flex;
|
|
58
|
+
align-items: center;
|
|
59
|
+
justify-content: center;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/* ═══════ Backdrop ═══════ */
|
|
63
|
+
|
|
64
|
+
modal-ui > [slot="dialog"]::backdrop {
|
|
65
|
+
background: var(--modal-backdrop);
|
|
66
|
+
opacity: 0;
|
|
67
|
+
transition: opacity var(--modal-duration) var(--modal-easing);
|
|
68
|
+
}
|
|
69
|
+
modal-ui > [slot="dialog"][data-open]::backdrop { opacity: 1; }
|
|
70
|
+
modal-ui > [slot="dialog"][data-closing]::backdrop { opacity: 0; }
|
|
71
|
+
|
|
72
|
+
/* ── Top-layer: cannot inherit component tokens ── */
|
|
73
|
+
|
|
74
|
+
/* ═══════ Content panel ═══════ */
|
|
75
|
+
|
|
76
|
+
modal-ui > [slot="dialog"] > [slot="panel"] {
|
|
77
|
+
box-sizing: border-box;
|
|
78
|
+
display: flex;
|
|
79
|
+
flex-direction: column;
|
|
80
|
+
width: var(--modal-width);
|
|
81
|
+
max-height: 85vh;
|
|
82
|
+
background: var(--modal-bg);
|
|
83
|
+
color: var(--modal-header-fg);
|
|
84
|
+
font-family: var(--a-font-family); /* top-layer: --a-* required */
|
|
85
|
+
border: 1px solid var(--modal-border);
|
|
86
|
+
border-radius: var(--modal-radius);
|
|
87
|
+
box-shadow: var(--modal-shadow);
|
|
88
|
+
overflow: hidden;
|
|
89
|
+
opacity: 0;
|
|
90
|
+
transform: scale(0.95);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/* ═══════ Open animation ═══════ */
|
|
94
|
+
|
|
95
|
+
modal-ui > [slot="dialog"][data-open] > [slot="panel"] {
|
|
96
|
+
transition: transform var(--modal-duration) var(--modal-easing),
|
|
97
|
+
opacity var(--modal-duration) var(--modal-easing);
|
|
98
|
+
transform: scale(1);
|
|
99
|
+
opacity: 1;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/* ═══════ Close animation ═══════ */
|
|
103
|
+
|
|
104
|
+
modal-ui > [slot="dialog"][data-closing] > [slot="panel"] {
|
|
105
|
+
transition: transform var(--modal-duration) var(--modal-easing),
|
|
106
|
+
opacity var(--modal-duration) var(--modal-easing);
|
|
107
|
+
transform: scale(0.95);
|
|
108
|
+
opacity: 0;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/* ═══════ Header ═══════ */
|
|
112
|
+
|
|
113
|
+
modal-ui [slot="header"] {
|
|
114
|
+
display: flex;
|
|
115
|
+
align-items: center;
|
|
116
|
+
justify-content: space-between;
|
|
117
|
+
padding: var(--modal-pad-header) var(--modal-pad-body);
|
|
118
|
+
border-bottom: 1px solid var(--modal-border);
|
|
119
|
+
font-size: var(--modal-heading-size);
|
|
120
|
+
font-weight: var(--modal-heading-weight);
|
|
121
|
+
color: var(--modal-header-fg);
|
|
122
|
+
flex-shrink: 0;
|
|
123
|
+
}
|
|
124
|
+
modal-ui [slot="header"]::before {
|
|
125
|
+
content: attr(text);
|
|
126
|
+
flex: 1;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/* ═══════ Close button (button-ui) ═══════ */
|
|
130
|
+
|
|
131
|
+
modal-ui [slot="close"] {
|
|
132
|
+
flex-shrink: 0;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/* ═══════ Body ═══════ */
|
|
136
|
+
|
|
137
|
+
modal-ui [slot="body"] {
|
|
138
|
+
padding: var(--modal-pad-body);
|
|
139
|
+
flex: 1;
|
|
140
|
+
overflow: auto;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/* ═══════ Footer ═══════ */
|
|
144
|
+
|
|
145
|
+
modal-ui [slot="footer"] {
|
|
146
|
+
display: flex;
|
|
147
|
+
align-items: center;
|
|
148
|
+
justify-content: flex-end;
|
|
149
|
+
gap: var(--a-space-2); /* top-layer: --a-* required */
|
|
150
|
+
padding: var(--modal-pad-footer) var(--modal-pad-body);
|
|
151
|
+
border-top: 1px solid var(--modal-border);
|
|
152
|
+
flex-shrink: 0;
|
|
153
|
+
}
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* <modal-ui> — Centered dialog overlay.
|
|
3
|
+
*
|
|
4
|
+
* Uses native <dialog> for focus trapping, Escape key, and ::backdrop.
|
|
5
|
+
* Content panel scales in/out with CSS transitions.
|
|
6
|
+
* Exit animation plays before dialog.close() via [data-closing].
|
|
7
|
+
*
|
|
8
|
+
* Structure (stamped automatically):
|
|
9
|
+
* <modal-ui size="md">
|
|
10
|
+
* <dialog slot="dialog">
|
|
11
|
+
* <div slot="panel">
|
|
12
|
+
* <div slot="header">Title × </div>
|
|
13
|
+
* <div slot="body">...content...</div>
|
|
14
|
+
* <div slot="footer">...actions...</div>
|
|
15
|
+
* </div>
|
|
16
|
+
* </dialog>
|
|
17
|
+
* </modal-ui>
|
|
18
|
+
*
|
|
19
|
+
* Usage:
|
|
20
|
+
* <modal-ui text="Confirm" size="md">
|
|
21
|
+
* <section>Modal content here</section>
|
|
22
|
+
* </modal-ui>
|
|
23
|
+
*
|
|
24
|
+
* modal.show();
|
|
25
|
+
* modal.hide();
|
|
26
|
+
* modal.open = true;
|
|
27
|
+
*
|
|
28
|
+
* Events:
|
|
29
|
+
* close — fired after the modal finishes closing
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
import { AdiaElement, html } from '@core/element.js';
|
|
33
|
+
|
|
34
|
+
class AdiaModal extends AdiaElement {
|
|
35
|
+
#bound = false;
|
|
36
|
+
#closing = false;
|
|
37
|
+
#previousFocus = null;
|
|
38
|
+
#closeTimer = null;
|
|
39
|
+
#openRaf = null;
|
|
40
|
+
#dialogRef = null;
|
|
41
|
+
|
|
42
|
+
static properties = {
|
|
43
|
+
text: { type: String, default: '', reflect: true },
|
|
44
|
+
size: { type: String, default: 'md', reflect: true },
|
|
45
|
+
permanent: { type: Boolean, default: false, reflect: true },
|
|
46
|
+
open: { type: Boolean, default: false, reflect: true },
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
static parts = {
|
|
50
|
+
dialog: '<dialog slot="dialog"></dialog>',
|
|
51
|
+
panel: '<div slot="panel"></div>',
|
|
52
|
+
header: '<header slot="header"></header>',
|
|
53
|
+
close: '<button-ui slot="close" icon="x" variant="ghost" size="sm" aria-label="Close"></button-ui>',
|
|
54
|
+
body: '<section slot="body"></section>',
|
|
55
|
+
footer: '<footer slot="footer"></footer>',
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
static template = () => html``;
|
|
59
|
+
|
|
60
|
+
#onPress = (e) => {
|
|
61
|
+
if (e.target.closest('[slot="close"]')) this.open = false;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
#onDialogCancel = (e) => {
|
|
65
|
+
e.preventDefault();
|
|
66
|
+
if (!this.permanent) this.open = false;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
#onDialogClose = () => {
|
|
70
|
+
this.open = false;
|
|
71
|
+
this.#previousFocus?.focus();
|
|
72
|
+
this.#previousFocus = null;
|
|
73
|
+
this.dispatchEvent(new Event('close', { bubbles: true }));
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
#onDialogClick = (e) => {
|
|
77
|
+
if (e.target === this.#dialogRef && !this.permanent) this.open = false;
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
connected() {
|
|
81
|
+
this.addEventListener('press', this.#onPress);
|
|
82
|
+
|
|
83
|
+
// Bind dialog listeners as soon as the dialog part is available.
|
|
84
|
+
const dialog = this.ensure('dialog');
|
|
85
|
+
if (dialog && !this.#bound) {
|
|
86
|
+
this.#bound = true;
|
|
87
|
+
this.#dialogRef = dialog;
|
|
88
|
+
dialog.addEventListener('cancel', this.#onDialogCancel);
|
|
89
|
+
dialog.addEventListener('close', this.#onDialogClose);
|
|
90
|
+
dialog.addEventListener('click', this.#onDialogClick);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
disconnected() {
|
|
95
|
+
this.removeEventListener('press', this.#onPress);
|
|
96
|
+
if (this.#dialogRef) {
|
|
97
|
+
this.#dialogRef.removeEventListener('cancel', this.#onDialogCancel);
|
|
98
|
+
this.#dialogRef.removeEventListener('close', this.#onDialogClose);
|
|
99
|
+
this.#dialogRef.removeEventListener('click', this.#onDialogClick);
|
|
100
|
+
}
|
|
101
|
+
if (this.#openRaf != null) {
|
|
102
|
+
cancelAnimationFrame(this.#openRaf);
|
|
103
|
+
this.#openRaf = null;
|
|
104
|
+
}
|
|
105
|
+
if (this.#closeTimer != null) {
|
|
106
|
+
clearTimeout(this.#closeTimer);
|
|
107
|
+
this.#closeTimer = null;
|
|
108
|
+
}
|
|
109
|
+
this.#bound = false;
|
|
110
|
+
this.#dialogRef = null;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
#getDuration() {
|
|
114
|
+
const raw = getComputedStyle(this).getPropertyValue('--modal-duration').trim();
|
|
115
|
+
return parseFloat(raw) || 200;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
render() {
|
|
119
|
+
const dialog = this.ensure('dialog');
|
|
120
|
+
|
|
121
|
+
if (this.text) {
|
|
122
|
+
dialog.setAttribute('aria-label', this.text);
|
|
123
|
+
this.setAttribute('aria-label', this.text);
|
|
124
|
+
} else {
|
|
125
|
+
dialog.removeAttribute('aria-label');
|
|
126
|
+
this.removeAttribute('aria-label');
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
const panel = this.ensure('panel');
|
|
130
|
+
if (panel.parentElement !== dialog) dialog.appendChild(panel);
|
|
131
|
+
|
|
132
|
+
const header = this.ensure('header');
|
|
133
|
+
if (header.parentElement !== panel) panel.prepend(header);
|
|
134
|
+
header.setAttribute('text', this.text);
|
|
135
|
+
|
|
136
|
+
if (!this.permanent) {
|
|
137
|
+
const close = this.ensure('close');
|
|
138
|
+
if (close.parentElement !== header) header.appendChild(close);
|
|
139
|
+
} else {
|
|
140
|
+
this.drop('close');
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
const body = this.ensure('body');
|
|
144
|
+
if (body.parentElement !== panel) panel.appendChild(body);
|
|
145
|
+
|
|
146
|
+
const footer = this.ensure('footer');
|
|
147
|
+
if (footer.parentElement !== panel) panel.appendChild(footer);
|
|
148
|
+
|
|
149
|
+
// Sync open state
|
|
150
|
+
if (this.open && !dialog.open) {
|
|
151
|
+
this.#closing = false;
|
|
152
|
+
this.#previousFocus = document.activeElement;
|
|
153
|
+
dialog.showModal();
|
|
154
|
+
this.#openRaf = requestAnimationFrame(() => {
|
|
155
|
+
this.#openRaf = null;
|
|
156
|
+
dialog.setAttribute('data-open', '');
|
|
157
|
+
});
|
|
158
|
+
} else if (!this.open && dialog.open && !this.#closing) {
|
|
159
|
+
this.#animateClose(dialog);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
#animateClose(dialog) {
|
|
164
|
+
this.#closing = true;
|
|
165
|
+
dialog.removeAttribute('data-open');
|
|
166
|
+
dialog.setAttribute('data-closing', '');
|
|
167
|
+
|
|
168
|
+
this.#closeTimer = setTimeout(() => {
|
|
169
|
+
this.#closeTimer = null;
|
|
170
|
+
this.#closing = false;
|
|
171
|
+
dialog.removeAttribute('data-closing');
|
|
172
|
+
if (dialog.open) dialog.close();
|
|
173
|
+
}, this.#getDuration());
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
show() { this.open = true; }
|
|
177
|
+
hide() { this.open = false; }
|
|
178
|
+
}
|
|
179
|
+
customElements.define('modal-ui', AdiaModal);
|
|
180
|
+
|
|
181
|
+
export { AdiaModal };
|
|
@@ -0,0 +1,114 @@
|
|
|
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: AdiaModal
|
|
5
|
+
tag: modal-ui
|
|
6
|
+
component: Modal
|
|
7
|
+
category: container
|
|
8
|
+
version: 1
|
|
9
|
+
description: Centered dialog overlay using native <dialog>. Focus trapping, Escape key, backdrop.
|
|
10
|
+
props:
|
|
11
|
+
anchor:
|
|
12
|
+
description: ID of the element to anchor to (popover mode only). Positions the surface below the
|
|
13
|
+
anchor element.
|
|
14
|
+
type: string
|
|
15
|
+
default: ""
|
|
16
|
+
trigger:
|
|
17
|
+
description: ID of the element that opens this modal (sets aria-controls + click handler).
|
|
18
|
+
type: string
|
|
19
|
+
default: ""
|
|
20
|
+
mode:
|
|
21
|
+
description: Surface type. Dialog uses showModal() with backdrop and focus trap. Popover uses the
|
|
22
|
+
Popover API with light dismiss and optional anchor positioning.
|
|
23
|
+
type: string
|
|
24
|
+
default: dialog
|
|
25
|
+
enum:
|
|
26
|
+
- dialog
|
|
27
|
+
- popover
|
|
28
|
+
open:
|
|
29
|
+
description: Alias for show (backwards compatibility). Either property controls visibility.
|
|
30
|
+
type: boolean
|
|
31
|
+
default: false
|
|
32
|
+
reflect: true
|
|
33
|
+
permanent:
|
|
34
|
+
description: When true, suppress backdrop click and Escape key dismissal of the overlay
|
|
35
|
+
type: boolean
|
|
36
|
+
default: false
|
|
37
|
+
show:
|
|
38
|
+
description: Controls overlay visibility. Setting to true opens the surface with entry animation.
|
|
39
|
+
type: boolean
|
|
40
|
+
default: false
|
|
41
|
+
size:
|
|
42
|
+
description: Width preset. sm=24rem, md=32rem, lg=48rem, full=95vw.
|
|
43
|
+
type: string
|
|
44
|
+
default: md
|
|
45
|
+
enum:
|
|
46
|
+
- sm
|
|
47
|
+
- md
|
|
48
|
+
- lg
|
|
49
|
+
- xl
|
|
50
|
+
text:
|
|
51
|
+
description: Aria label applied to the surface element for accessibility
|
|
52
|
+
type: string
|
|
53
|
+
default: ""
|
|
54
|
+
events:
|
|
55
|
+
close:
|
|
56
|
+
description: Fired when the overlay is dismissed via backdrop click, Escape key, popover toggle, or
|
|
57
|
+
programmatic hide(). Bubbles.
|
|
58
|
+
slots:
|
|
59
|
+
default:
|
|
60
|
+
description: Content placed inside the modal surface. Accepts any elements (card-ui, command-ui,
|
|
61
|
+
custom markup).
|
|
62
|
+
states:
|
|
63
|
+
- name: idle
|
|
64
|
+
description: Default, ready for interaction.
|
|
65
|
+
traits: []
|
|
66
|
+
tokens:
|
|
67
|
+
--modal-backdrop:
|
|
68
|
+
description: Override backdrop color (dialog mode)
|
|
69
|
+
--modal-background:
|
|
70
|
+
description: Override surface background color
|
|
71
|
+
--modal-border-color:
|
|
72
|
+
description: Override surface border color
|
|
73
|
+
--modal-duration:
|
|
74
|
+
description: Override open/close animation duration
|
|
75
|
+
--modal-easing-in:
|
|
76
|
+
description: Override entry animation easing curve
|
|
77
|
+
--modal-easing-out:
|
|
78
|
+
description: Override exit animation easing curve
|
|
79
|
+
--modal-radius:
|
|
80
|
+
description: Override surface border radius
|
|
81
|
+
--modal-shadow:
|
|
82
|
+
description: Override surface box shadow
|
|
83
|
+
a2ui:
|
|
84
|
+
rules: []
|
|
85
|
+
anti_patterns: []
|
|
86
|
+
examples:
|
|
87
|
+
- name: basic-modal
|
|
88
|
+
description: Basic Modal usage
|
|
89
|
+
a2ui: >-
|
|
90
|
+
[
|
|
91
|
+
{
|
|
92
|
+
"id": "root",
|
|
93
|
+
"component": "Card",
|
|
94
|
+
"children": [
|
|
95
|
+
"sec"
|
|
96
|
+
]
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"id": "sec",
|
|
100
|
+
"component": "Section",
|
|
101
|
+
"children": [
|
|
102
|
+
"comp"
|
|
103
|
+
]
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"id": "comp",
|
|
107
|
+
"component": "Modal",
|
|
108
|
+
"text": "Example Modal"
|
|
109
|
+
}
|
|
110
|
+
]
|
|
111
|
+
keywords:
|
|
112
|
+
- modal
|
|
113
|
+
synonyms: {}
|
|
114
|
+
related: []
|