@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,389 @@
|
|
|
1
|
+
/* ═══════════════════════════════════════════════════════════════
|
|
2
|
+
TIMELINE-N + TIMELINE-ITEM-N
|
|
3
|
+
|
|
4
|
+
Grid-based layout with three columns:
|
|
5
|
+
[marker] var(--timeline-marker-w) [content] 1fr [aside] auto
|
|
6
|
+
|
|
7
|
+
Items are subgrid of the container, so their dots/labels/aside
|
|
8
|
+
align perfectly to a single vertical axis regardless of size.
|
|
9
|
+
|
|
10
|
+
When timeline-ui is nested inside agent-reasoning-ui (or another
|
|
11
|
+
grid ancestor that exposes the same columns), it inherits them
|
|
12
|
+
via subgrid so the nested rows align to the outer grid.
|
|
13
|
+
|
|
14
|
+
For numbered-wizard patterns, use <stepper-ui>.
|
|
15
|
+
═══════════════════════════════════════════════════════════════ */
|
|
16
|
+
|
|
17
|
+
/* ── Container ── */
|
|
18
|
+
@scope (timeline-ui) {
|
|
19
|
+
:where(:scope) {
|
|
20
|
+
/* Grid */
|
|
21
|
+
--timeline-marker-w: 1.25rem;
|
|
22
|
+
--timeline-gap-col: var(--a-space-2);
|
|
23
|
+
--timeline-gap-row: var(--a-space-3);
|
|
24
|
+
|
|
25
|
+
/* Dot */
|
|
26
|
+
--timeline-dot-size: 0.625rem;
|
|
27
|
+
--timeline-dot-bg: var(--a-border);
|
|
28
|
+
--timeline-dot-bg-active: var(--a-accent-bg);
|
|
29
|
+
--timeline-dot-bg-done: var(--a-success-bg);
|
|
30
|
+
--timeline-dot-bg-error: var(--a-danger-bg);
|
|
31
|
+
--timeline-dot-bg-warning: var(--a-warning-bg);
|
|
32
|
+
|
|
33
|
+
/* Sub-dot (outcomes) */
|
|
34
|
+
--timeline-subdot-size: 4px;
|
|
35
|
+
--timeline-subdot-bg: var(--a-fg-subtle);
|
|
36
|
+
|
|
37
|
+
/* Connector line */
|
|
38
|
+
--timeline-line-size: 2px;
|
|
39
|
+
--timeline-line-fg: var(--a-border-subtle);
|
|
40
|
+
--timeline-line-fg-done: var(--a-border);
|
|
41
|
+
|
|
42
|
+
/* Icon (replaces dot) */
|
|
43
|
+
--timeline-icon-size: 1rem;
|
|
44
|
+
--timeline-icon-bg: var(--a-bg-muted);
|
|
45
|
+
--timeline-icon-fg: var(--a-fg-subtle);
|
|
46
|
+
--timeline-icon-bg-success: var(--a-success-muted);
|
|
47
|
+
--timeline-icon-fg-success: var(--a-success);
|
|
48
|
+
--timeline-icon-bg-accent: var(--a-accent-muted);
|
|
49
|
+
--timeline-icon-fg-accent: var(--a-accent);
|
|
50
|
+
--timeline-icon-bg-warning: var(--a-warning-muted);
|
|
51
|
+
--timeline-icon-fg-warning: var(--a-warning);
|
|
52
|
+
--timeline-icon-bg-danger: var(--a-danger-muted);
|
|
53
|
+
--timeline-icon-fg-danger: var(--a-danger);
|
|
54
|
+
|
|
55
|
+
/* Typography */
|
|
56
|
+
--timeline-label-weight: var(--a-weight-medium);
|
|
57
|
+
--timeline-label-size: var(--a-ui-size);
|
|
58
|
+
--timeline-label-fg: var(--a-fg);
|
|
59
|
+
--timeline-label-fg-muted: var(--a-fg-muted);
|
|
60
|
+
--timeline-desc-fg: var(--a-fg-subtle);
|
|
61
|
+
--timeline-desc-size: var(--a-ui-sm);
|
|
62
|
+
--timeline-time-fg: var(--a-fg-muted);
|
|
63
|
+
--timeline-time-size: var(--a-ui-sm);
|
|
64
|
+
--timeline-outcome-fg: var(--a-fg-muted);
|
|
65
|
+
|
|
66
|
+
/* Motion */
|
|
67
|
+
--timeline-duration: var(--a-duration-fast);
|
|
68
|
+
--timeline-easing: var(--a-easing-out);
|
|
69
|
+
--timeline-spin-duration: 0.8s;
|
|
70
|
+
--timeline-pulse-duration: 2s;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
:scope {
|
|
74
|
+
box-sizing: border-box;
|
|
75
|
+
display: grid;
|
|
76
|
+
grid-template-columns:
|
|
77
|
+
[marker] var(--timeline-marker-w)
|
|
78
|
+
[content] 1fr
|
|
79
|
+
[aside] auto;
|
|
80
|
+
column-gap: var(--timeline-gap-col);
|
|
81
|
+
row-gap: var(--timeline-gap-row);
|
|
82
|
+
min-width: 0;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/* Compact variant (agent-reasoning + chat-adjacent) */
|
|
86
|
+
:scope[size="sm"] {
|
|
87
|
+
--timeline-marker-w: 1rem;
|
|
88
|
+
--timeline-dot-size: 6px;
|
|
89
|
+
--timeline-gap-row: var(--a-space-2);
|
|
90
|
+
--timeline-label-size: var(--a-ui-sm);
|
|
91
|
+
--timeline-label-weight: var(--a-weight-normal);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/* Horizontal layout — fall back to flow layout; drops subgrid.
|
|
95
|
+
Horizontal timelines don't need column alignment since items sit
|
|
96
|
+
side-by-side, not stacked. */
|
|
97
|
+
:scope[orientation="horizontal"] {
|
|
98
|
+
display: flex;
|
|
99
|
+
flex-direction: row;
|
|
100
|
+
gap: 0;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/* When nested inside agent-reasoning-ui or other grid ancestors that
|
|
105
|
+
expose the same three named columns, inherit them via subgrid so
|
|
106
|
+
the inner rows align to the outer axis. */
|
|
107
|
+
agent-reasoning-ui timeline-ui:not([orientation="horizontal"]),
|
|
108
|
+
[data-reasoning-iteration] timeline-ui:not([orientation="horizontal"]) {
|
|
109
|
+
grid-template-columns: subgrid;
|
|
110
|
+
grid-column: 1 / -1;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/* ── Item base: each item is its own subgrid row ── */
|
|
114
|
+
|
|
115
|
+
timeline-item-ui {
|
|
116
|
+
box-sizing: border-box;
|
|
117
|
+
display: grid;
|
|
118
|
+
grid-template-columns: subgrid;
|
|
119
|
+
grid-column: 1 / -1;
|
|
120
|
+
grid-auto-rows: auto;
|
|
121
|
+
align-items: baseline;
|
|
122
|
+
position: relative;
|
|
123
|
+
min-width: 0;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/* Stamp default slot children when the author didn't — see timeline.js */
|
|
127
|
+
timeline-item-ui [slot] {
|
|
128
|
+
min-width: 0;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/* ═══════ Marker (dot) — positioned absolutely in the marker column ═══════ */
|
|
132
|
+
|
|
133
|
+
timeline-item-ui::before {
|
|
134
|
+
content: '';
|
|
135
|
+
position: absolute;
|
|
136
|
+
left: calc((var(--timeline-marker-w) - var(--timeline-dot-size)) / 2);
|
|
137
|
+
top: calc((1.4em - var(--timeline-dot-size)) / 2 + 1px);
|
|
138
|
+
width: var(--timeline-dot-size);
|
|
139
|
+
height: var(--timeline-dot-size);
|
|
140
|
+
border-radius: 50%;
|
|
141
|
+
background: var(--timeline-dot-bg);
|
|
142
|
+
box-sizing: border-box;
|
|
143
|
+
z-index: 1;
|
|
144
|
+
transition: background var(--timeline-duration) var(--timeline-easing);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/* State: completed → success dot */
|
|
148
|
+
timeline-item-ui[completed]::before {
|
|
149
|
+
background: var(--timeline-dot-bg-done);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/* State: active → accent dot */
|
|
153
|
+
timeline-item-ui[active]::before {
|
|
154
|
+
background: var(--timeline-dot-bg-active);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/* State: error → danger dot */
|
|
158
|
+
timeline-item-ui[error]::before {
|
|
159
|
+
background: var(--timeline-dot-bg-error);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/* Variant: success / accent / warning / danger (for non-active items) */
|
|
163
|
+
timeline-item-ui[variant="success"]:not([active]):not([error])::before { background: var(--timeline-dot-bg-done); }
|
|
164
|
+
timeline-item-ui[variant="accent"]:not([active]):not([error])::before { background: var(--timeline-dot-bg-active); }
|
|
165
|
+
timeline-item-ui[variant="warning"]:not([active]):not([error])::before { background: var(--timeline-dot-bg-warning); }
|
|
166
|
+
timeline-item-ui[variant="danger"]:not([active]):not([error])::before { background: var(--timeline-dot-bg-error); }
|
|
167
|
+
|
|
168
|
+
/* Spinner on active items — render as a ring that spins */
|
|
169
|
+
timeline-item-ui[active][spinner]::before {
|
|
170
|
+
background: transparent;
|
|
171
|
+
border: 2px solid var(--timeline-dot-bg);
|
|
172
|
+
border-top-color: var(--timeline-dot-bg-active);
|
|
173
|
+
animation: tl-spin var(--timeline-spin-duration) linear infinite;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/* When size=sm, ring is 1.5px so the small dot still looks crisp */
|
|
177
|
+
timeline-ui[size="sm"] > timeline-item-ui[active][spinner]::before {
|
|
178
|
+
border-width: 1.5px;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/* ═══════ Connector line ═══════ */
|
|
182
|
+
|
|
183
|
+
timeline-item-ui::after {
|
|
184
|
+
content: '';
|
|
185
|
+
position: absolute;
|
|
186
|
+
left: calc((var(--timeline-marker-w) - var(--timeline-line-size)) / 2);
|
|
187
|
+
top: calc((1.4em + var(--timeline-dot-size)) / 2 + 2px);
|
|
188
|
+
bottom: calc(-1 * var(--timeline-gap-row));
|
|
189
|
+
width: var(--timeline-line-size);
|
|
190
|
+
background: var(--timeline-line-fg);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
timeline-item-ui[completed]::after { background: var(--timeline-line-fg-done); }
|
|
194
|
+
timeline-item-ui[data-last]::after { display: none; }
|
|
195
|
+
|
|
196
|
+
/* ═══════ Icon mode — icon-ui in [slot="icon"] replaces the dot ═══════ */
|
|
197
|
+
|
|
198
|
+
timeline-item-ui:has(> [slot="icon"])::before { display: none; }
|
|
199
|
+
|
|
200
|
+
timeline-item-ui > [slot="icon"] {
|
|
201
|
+
grid-column: marker;
|
|
202
|
+
grid-row: 1;
|
|
203
|
+
justify-self: center;
|
|
204
|
+
align-self: baseline;
|
|
205
|
+
margin-top: calc((1.4em - var(--timeline-icon-size)) / 2);
|
|
206
|
+
width: var(--timeline-icon-size);
|
|
207
|
+
height: var(--timeline-icon-size);
|
|
208
|
+
border-radius: 50%;
|
|
209
|
+
background: var(--timeline-icon-bg);
|
|
210
|
+
color: var(--timeline-icon-fg);
|
|
211
|
+
display: inline-flex;
|
|
212
|
+
align-items: center;
|
|
213
|
+
justify-content: center;
|
|
214
|
+
--a-icon-size: calc(var(--timeline-icon-size) * 0.625);
|
|
215
|
+
z-index: 1;
|
|
216
|
+
box-sizing: border-box;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/* Variant icons */
|
|
220
|
+
timeline-item-ui[variant="success"] > [slot="icon"] { background: var(--timeline-icon-bg-success); color: var(--timeline-icon-fg-success); }
|
|
221
|
+
timeline-item-ui[variant="accent"] > [slot="icon"] { background: var(--timeline-icon-bg-accent); color: var(--timeline-icon-fg-accent); }
|
|
222
|
+
timeline-item-ui[variant="warning"] > [slot="icon"] { background: var(--timeline-icon-bg-warning); color: var(--timeline-icon-fg-warning); }
|
|
223
|
+
timeline-item-ui[variant="danger"] > [slot="icon"] { background: var(--timeline-icon-bg-danger); color: var(--timeline-icon-fg-danger); }
|
|
224
|
+
|
|
225
|
+
/* Push connector line past the icon circle */
|
|
226
|
+
timeline-item-ui:has(> [slot="icon"])::after {
|
|
227
|
+
top: calc((1.4em + var(--timeline-icon-size)) / 2 + 2px);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/* ═══════ Content slots ═══════ */
|
|
231
|
+
|
|
232
|
+
timeline-item-ui > [slot="label"] {
|
|
233
|
+
grid-column: content;
|
|
234
|
+
grid-row: 1;
|
|
235
|
+
font-weight: var(--timeline-label-weight);
|
|
236
|
+
font-size: var(--timeline-label-size);
|
|
237
|
+
color: var(--timeline-label-fg);
|
|
238
|
+
line-height: 1.4;
|
|
239
|
+
overflow-wrap: break-word;
|
|
240
|
+
min-width: 0;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
timeline-item-ui[completed] > [slot="label"] {
|
|
244
|
+
color: var(--timeline-label-fg-muted);
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
timeline-item-ui > [slot="description"] {
|
|
248
|
+
grid-column: content / -1;
|
|
249
|
+
grid-row: 2;
|
|
250
|
+
color: var(--timeline-desc-fg);
|
|
251
|
+
font-size: var(--timeline-desc-size);
|
|
252
|
+
line-height: 1.5;
|
|
253
|
+
margin-top: var(--a-space-0-5);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
timeline-item-ui > [slot="time"] {
|
|
257
|
+
grid-column: aside;
|
|
258
|
+
grid-row: 1;
|
|
259
|
+
color: var(--timeline-time-fg);
|
|
260
|
+
font-size: var(--timeline-time-size);
|
|
261
|
+
font-variant-numeric: tabular-nums;
|
|
262
|
+
line-height: 1.4;
|
|
263
|
+
white-space: nowrap;
|
|
264
|
+
justify-self: end;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/* Hide empty slots so they don't steal grid track space */
|
|
268
|
+
timeline-item-ui > [slot]:empty {
|
|
269
|
+
display: none;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
/* ═══════ Outcomes — nested sub-rows ═══════ */
|
|
273
|
+
|
|
274
|
+
timeline-item-ui > [slot="outcomes"] {
|
|
275
|
+
grid-column: content / -1;
|
|
276
|
+
grid-row: 3;
|
|
277
|
+
margin: var(--a-space-1) 0 0 0;
|
|
278
|
+
padding: 0;
|
|
279
|
+
list-style: none;
|
|
280
|
+
display: flex;
|
|
281
|
+
flex-direction: column;
|
|
282
|
+
gap: var(--a-space-0-5);
|
|
283
|
+
color: var(--timeline-outcome-fg);
|
|
284
|
+
font-size: var(--timeline-desc-size);
|
|
285
|
+
line-height: 1.4;
|
|
286
|
+
animation: tl-fade var(--timeline-duration) var(--timeline-easing);
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
timeline-item-ui > [slot="outcomes"][hidden] { display: none; }
|
|
290
|
+
|
|
291
|
+
timeline-item-ui > [slot="outcomes"] > li {
|
|
292
|
+
position: relative;
|
|
293
|
+
padding-left: 0.75rem;
|
|
294
|
+
overflow-wrap: break-word;
|
|
295
|
+
min-width: 0;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
timeline-item-ui > [slot="outcomes"] > li::before {
|
|
299
|
+
content: '';
|
|
300
|
+
position: absolute;
|
|
301
|
+
left: calc((0.75rem - var(--timeline-subdot-size)) / 2);
|
|
302
|
+
top: calc((1.4em - var(--timeline-subdot-size)) / 2 + 1px);
|
|
303
|
+
width: var(--timeline-subdot-size);
|
|
304
|
+
height: var(--timeline-subdot-size);
|
|
305
|
+
border-radius: 50%;
|
|
306
|
+
background: var(--timeline-subdot-bg);
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
/* ═══════ Toggle chevron (outcomes) ═══════ */
|
|
310
|
+
|
|
311
|
+
/* Positioned absolutely at the item's trailing edge so it coexists with
|
|
312
|
+
[slot="time"] (which also lives in the aside column). The item itself
|
|
313
|
+
is position: relative. */
|
|
314
|
+
timeline-item-ui > [data-timeline-toggle] {
|
|
315
|
+
position: absolute;
|
|
316
|
+
inset-inline-end: 0;
|
|
317
|
+
top: calc((1.4em - 1em) / 2);
|
|
318
|
+
background: none;
|
|
319
|
+
border: none;
|
|
320
|
+
padding: 0 var(--a-space-0-5);
|
|
321
|
+
margin: 0;
|
|
322
|
+
cursor: pointer;
|
|
323
|
+
color: inherit;
|
|
324
|
+
display: inline-flex;
|
|
325
|
+
align-items: center;
|
|
326
|
+
justify-content: center;
|
|
327
|
+
line-height: 0;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
/* Reserve room so the time isn't overlapped by the chevron */
|
|
331
|
+
timeline-item-ui:has(> [data-timeline-toggle]) > [slot="time"] {
|
|
332
|
+
margin-inline-end: 1.5rem;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
timeline-item-ui > [data-timeline-toggle]:focus-visible {
|
|
336
|
+
outline: 2px solid var(--a-focus-ring, var(--a-accent));
|
|
337
|
+
outline-offset: 2px;
|
|
338
|
+
border-radius: var(--a-radius-sm);
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
/* ═══════ Horizontal layout — flow, not grid ═══════ */
|
|
342
|
+
|
|
343
|
+
timeline-ui[orientation="horizontal"] > timeline-item-ui {
|
|
344
|
+
display: flex;
|
|
345
|
+
flex-direction: column;
|
|
346
|
+
flex: 1 1 0;
|
|
347
|
+
min-width: 0;
|
|
348
|
+
padding-top: calc(var(--timeline-dot-size) + var(--timeline-gap-col));
|
|
349
|
+
text-align: center;
|
|
350
|
+
position: relative;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
timeline-ui[orientation="horizontal"] > timeline-item-ui::before {
|
|
354
|
+
left: 50%;
|
|
355
|
+
top: 0;
|
|
356
|
+
transform: translateX(-50%);
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
timeline-ui[orientation="horizontal"] > timeline-item-ui::after {
|
|
360
|
+
left: 50%;
|
|
361
|
+
top: calc(var(--timeline-dot-size) / 2 - var(--timeline-line-size) / 2);
|
|
362
|
+
right: -50%;
|
|
363
|
+
bottom: auto;
|
|
364
|
+
width: 100%;
|
|
365
|
+
height: var(--timeline-line-size);
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
timeline-ui[orientation="horizontal"] > timeline-item-ui > [slot="label"],
|
|
369
|
+
timeline-ui[orientation="horizontal"] > timeline-item-ui > [slot="description"],
|
|
370
|
+
timeline-ui[orientation="horizontal"] > timeline-item-ui > [slot="time"] {
|
|
371
|
+
grid-column: auto;
|
|
372
|
+
grid-row: auto;
|
|
373
|
+
margin-top: var(--a-space-1);
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
/* ═══════ Animations ═══════ */
|
|
377
|
+
|
|
378
|
+
@keyframes tl-spin {
|
|
379
|
+
to { transform: rotate(360deg); }
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
@keyframes tl-fade {
|
|
383
|
+
from { opacity: 0; transform: translateY(-2px); }
|
|
384
|
+
to { opacity: 1; transform: none; }
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
@media (prefers-reduced-motion: reduce) {
|
|
388
|
+
timeline-item-ui[active][spinner]::before { animation: none; }
|
|
389
|
+
}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* <timeline-ui> — Vertical (or horizontal) event / progress log.
|
|
3
|
+
*
|
|
4
|
+
* Each <timeline-item-ui> is one entry, with its own state (completed / active
|
|
5
|
+
* / error), optional icon, duration, and an expandable outcomes list.
|
|
6
|
+
*
|
|
7
|
+
* <timeline-ui>
|
|
8
|
+
* <timeline-item-ui text="Shipped" time="2h ago" completed></timeline-item-ui>
|
|
9
|
+
* <timeline-item-ui text="Delivery" time="now" active spinner></timeline-item-ui>
|
|
10
|
+
* <timeline-item-ui text="Received" ></timeline-item-ui>
|
|
11
|
+
* </timeline-ui>
|
|
12
|
+
*
|
|
13
|
+
* For agent reasoning / pipeline views, set size="sm" and use
|
|
14
|
+
* duration, outcomes, spinner, error
|
|
15
|
+
*
|
|
16
|
+
* <timeline-ui size="sm">
|
|
17
|
+
* <timeline-item-ui text="search" duration="850ms" completed></timeline-item-ui>
|
|
18
|
+
* <timeline-item-ui text="generate" active spinner></timeline-item-ui>
|
|
19
|
+
* </timeline-ui>
|
|
20
|
+
*
|
|
21
|
+
* For wizard / numbered-circle patterns, use the dedicated <stepper-ui>.
|
|
22
|
+
*
|
|
23
|
+
* Attributes (container):
|
|
24
|
+
* orientation — vertical (default) | horizontal
|
|
25
|
+
* size — md (default) | sm
|
|
26
|
+
*
|
|
27
|
+
* Attributes (item):
|
|
28
|
+
* text — primary label
|
|
29
|
+
* description — secondary text (optional)
|
|
30
|
+
* time — right-aligned timestamp (optional; mutually exclusive with duration)
|
|
31
|
+
* duration — right-aligned duration label (e.g. "850ms", "2s"); also set when live=true
|
|
32
|
+
* icon — icon-ui name (replaces the dot when set)
|
|
33
|
+
* variant — default | success | accent | warning | danger (colors the dot/icon)
|
|
34
|
+
* completed — boolean; renders "done" state
|
|
35
|
+
* active — boolean; renders "active" state
|
|
36
|
+
* error — boolean; renders "error" state (red dot)
|
|
37
|
+
* spinner — boolean; spinning dot while active
|
|
38
|
+
*
|
|
39
|
+
* JS (item):
|
|
40
|
+
* .outcomes = string[] // renders an expandable sub-list under the row
|
|
41
|
+
*/
|
|
42
|
+
|
|
43
|
+
import { AdiaElement } from '@core/element.js';
|
|
44
|
+
|
|
45
|
+
// ── Container ──────────────────────────────────────────────────
|
|
46
|
+
|
|
47
|
+
class AdiaTimeline extends AdiaElement {
|
|
48
|
+
static properties = {
|
|
49
|
+
orientation: { type: String, default: 'vertical', reflect: true },
|
|
50
|
+
size: { type: String, default: 'md', reflect: true },
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
static template = () => null;
|
|
54
|
+
|
|
55
|
+
render() {
|
|
56
|
+
const items = [...this.querySelectorAll(':scope > timeline-item-ui')];
|
|
57
|
+
for (const item of items) item.removeAttribute('data-last');
|
|
58
|
+
const last = items[items.length - 1];
|
|
59
|
+
if (last) last.setAttribute('data-last', '');
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
customElements.define('timeline-ui', AdiaTimeline);
|
|
64
|
+
|
|
65
|
+
// ── Item ───────────────────────────────────────────────────────
|
|
66
|
+
|
|
67
|
+
class AdiaTimelineItem extends AdiaElement {
|
|
68
|
+
static properties = {
|
|
69
|
+
text: { type: String, default: '', reflect: true },
|
|
70
|
+
description: { type: String, default: '', reflect: true },
|
|
71
|
+
time: { type: String, default: '', reflect: true },
|
|
72
|
+
duration: { type: String, default: '', reflect: true },
|
|
73
|
+
icon: { type: String, default: '', reflect: true },
|
|
74
|
+
variant: { type: String, default: 'default', reflect: true },
|
|
75
|
+
completed: { type: Boolean, default: false, reflect: true },
|
|
76
|
+
active: { type: Boolean, default: false, reflect: true },
|
|
77
|
+
error: { type: Boolean, default: false, reflect: true },
|
|
78
|
+
spinner: { type: Boolean, default: false, reflect: true },
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
static template = () => null;
|
|
82
|
+
|
|
83
|
+
#outcomes = [];
|
|
84
|
+
#expanded = false;
|
|
85
|
+
|
|
86
|
+
get outcomes() { return this.#outcomes; }
|
|
87
|
+
set outcomes(v) {
|
|
88
|
+
this.#outcomes = Array.isArray(v) ? v.slice() : [];
|
|
89
|
+
this.render();
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
connected() {
|
|
93
|
+
if (!this.querySelector(':scope > [slot="label"]')) {
|
|
94
|
+
// Author provided just text/time — stamp the default slot structure
|
|
95
|
+
this.innerHTML = `
|
|
96
|
+
<span slot="label"></span>
|
|
97
|
+
<span slot="description"></span>
|
|
98
|
+
<span slot="time"></span>
|
|
99
|
+
`;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
render() {
|
|
104
|
+
const label = this.querySelector(':scope > [slot="label"]');
|
|
105
|
+
const desc = this.querySelector(':scope > [slot="description"]');
|
|
106
|
+
const time = this.querySelector(':scope > [slot="time"]');
|
|
107
|
+
if (label) label.textContent = this.text;
|
|
108
|
+
if (desc) desc.textContent = this.description;
|
|
109
|
+
if (time) time.textContent = this.duration || this.time;
|
|
110
|
+
|
|
111
|
+
if (this.icon) {
|
|
112
|
+
let iconEl = this.querySelector(':scope > [slot="icon"]');
|
|
113
|
+
if (!iconEl) {
|
|
114
|
+
iconEl = document.createElement('icon-ui');
|
|
115
|
+
iconEl.setAttribute('slot', 'icon');
|
|
116
|
+
this.prepend(iconEl);
|
|
117
|
+
}
|
|
118
|
+
iconEl.setAttribute('name', this.icon);
|
|
119
|
+
} else {
|
|
120
|
+
this.querySelector(':scope > [slot="icon"]')?.remove();
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// Outcomes sub-list + toggle chevron
|
|
124
|
+
let body = this.querySelector(':scope > [slot="outcomes"]');
|
|
125
|
+
if (this.#outcomes.length > 0) {
|
|
126
|
+
if (!body) {
|
|
127
|
+
body = document.createElement('ul');
|
|
128
|
+
body.setAttribute('slot', 'outcomes');
|
|
129
|
+
this.appendChild(body);
|
|
130
|
+
}
|
|
131
|
+
body.innerHTML = '';
|
|
132
|
+
for (const o of this.#outcomes) {
|
|
133
|
+
const li = document.createElement('li');
|
|
134
|
+
li.textContent = o;
|
|
135
|
+
body.appendChild(li);
|
|
136
|
+
}
|
|
137
|
+
body.hidden = !this.#expanded;
|
|
138
|
+
|
|
139
|
+
// Toggle chevron lives on the row — we stamp a button once
|
|
140
|
+
let toggle = this.querySelector(':scope > [data-timeline-toggle]');
|
|
141
|
+
if (!toggle) {
|
|
142
|
+
toggle = document.createElement('button');
|
|
143
|
+
toggle.type = 'button';
|
|
144
|
+
toggle.setAttribute('data-timeline-toggle', '');
|
|
145
|
+
toggle.setAttribute('aria-label', 'Toggle details');
|
|
146
|
+
toggle.addEventListener('click', (e) => {
|
|
147
|
+
e.stopPropagation();
|
|
148
|
+
this.#expanded = !this.#expanded;
|
|
149
|
+
this.render();
|
|
150
|
+
this.dispatchEvent(new CustomEvent('timeline-toggle', {
|
|
151
|
+
bubbles: true, detail: { expanded: this.#expanded },
|
|
152
|
+
}));
|
|
153
|
+
});
|
|
154
|
+
this.appendChild(toggle);
|
|
155
|
+
}
|
|
156
|
+
toggle.innerHTML = '';
|
|
157
|
+
const caret = document.createElement('icon-ui');
|
|
158
|
+
caret.setAttribute('name', this.#expanded ? 'caret-down' : 'caret-right');
|
|
159
|
+
caret.setAttribute('color', 'muted');
|
|
160
|
+
caret.setAttribute('size', 'sm');
|
|
161
|
+
toggle.appendChild(caret);
|
|
162
|
+
} else {
|
|
163
|
+
this.querySelector(':scope > [data-timeline-toggle]')?.remove();
|
|
164
|
+
body?.remove();
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
customElements.define('timeline-item-ui', AdiaTimelineItem);
|
|
170
|
+
|
|
171
|
+
export { AdiaTimeline, AdiaTimelineItem };
|