@adia-ai/web-components 0.6.33 → 0.6.35
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/CHANGELOG.md +64 -0
- package/color/index.js +1 -1
- package/components/accordion/accordion-item.yaml +2 -2
- package/components/accordion/accordion.css +2 -2
- package/components/accordion/accordion.js +1 -1
- package/components/action-list/action-item.yaml +2 -2
- package/components/action-list/action-list.css +2 -2
- package/components/action-list/action-list.js +1 -1
- package/components/agent-artifact/{class.js → agent-artifact.class.js} +1 -1
- package/components/agent-artifact/agent-artifact.css +31 -31
- package/components/agent-artifact/agent-artifact.js +1 -1
- package/components/agent-feedback-bar/agent-feedback-bar.css +10 -10
- package/components/agent-feedback-bar/agent-feedback-bar.js +1 -1
- package/components/agent-questions/agent-questions.css +57 -57
- package/components/agent-questions/agent-questions.js +1 -1
- package/components/agent-reasoning/agent-reasoning.css +62 -62
- package/components/agent-reasoning/agent-reasoning.js +1 -1
- package/components/agent-suggestions/agent-suggestions.css +4 -4
- package/components/agent-suggestions/agent-suggestions.js +1 -1
- package/components/agent-trace/agent-trace.css +53 -53
- package/components/alert/alert.a2ui.json +64 -1
- package/components/alert/{class.js → alert.class.js} +189 -2
- package/components/alert/alert.css +119 -41
- package/components/alert/alert.d.ts +14 -0
- package/components/alert/alert.js +1 -1
- package/components/alert/alert.test.js +184 -0
- package/components/alert/alert.yaml +114 -1
- package/components/avatar/avatar-group.yaml +2 -2
- package/components/avatar/avatar.css +27 -27
- package/components/avatar/avatar.js +1 -1
- package/components/badge/badge.css +27 -27
- package/components/badge/badge.js +1 -1
- package/components/block/block.css +16 -16
- package/components/block/block.js +1 -1
- package/components/breadcrumb/breadcrumb.css +23 -23
- package/components/breadcrumb/breadcrumb.js +1 -1
- package/components/button/button.css +101 -91
- package/components/button/button.js +1 -1
- package/components/calendar-grid/calendar-grid.a2ui.json +146 -0
- package/components/calendar-grid/calendar-grid.class.js +326 -0
- package/components/calendar-grid/calendar-grid.css +246 -0
- package/components/calendar-grid/calendar-grid.d.ts +41 -0
- package/components/calendar-grid/calendar-grid.js +17 -0
- package/components/calendar-grid/calendar-grid.yaml +136 -0
- package/components/calendar-picker/calendar-picker.css +139 -139
- package/components/calendar-picker/calendar-picker.js +1 -1
- package/components/canvas/canvas.css +12 -12
- package/components/card/card.css +83 -83
- package/components/card/card.js +1 -1
- package/components/chart/chart.css +224 -224
- package/components/chart/chart.js +1 -1
- package/components/chart-legend/chart-legend.css +26 -26
- package/components/chart-legend/chart-legend.js +1 -1
- package/components/chat-thread/chat-input.a2ui.json +1 -1
- package/components/chat-thread/chat-input.js +6 -1
- package/components/chat-thread/chat-input.yaml +4 -1
- package/components/chat-thread/chat-thread.js +1 -1
- package/components/check/check.css +40 -40
- package/components/check/check.js +1 -1
- package/components/code/code.css +125 -125
- package/components/code/code.js +1 -1
- package/components/col/col.css +15 -15
- package/components/col/col.js +1 -1
- package/components/color-input/color-input.js +1 -1
- package/components/color-picker/color-picker.css +55 -55
- package/components/color-picker/color-picker.js +1 -1
- package/components/combobox/combobox.a2ui.json +363 -0
- package/components/combobox/combobox.class.js +861 -0
- package/components/combobox/combobox.css +244 -0
- package/components/combobox/combobox.d.ts +113 -0
- package/components/combobox/combobox.examples.md +59 -0
- package/components/combobox/combobox.js +17 -0
- package/components/combobox/combobox.test.js +181 -0
- package/components/combobox/combobox.yaml +369 -0
- package/components/command/command.css +90 -90
- package/components/command/command.js +1 -1
- package/components/date-range-picker/date-range-picker.a2ui.json +300 -0
- package/components/date-range-picker/date-range-picker.class.js +791 -0
- package/components/date-range-picker/date-range-picker.css +224 -0
- package/components/date-range-picker/date-range-picker.d.ts +82 -0
- package/components/date-range-picker/date-range-picker.examples.md +37 -0
- package/components/date-range-picker/date-range-picker.js +17 -0
- package/components/date-range-picker/date-range-picker.test.js +387 -0
- package/components/date-range-picker/date-range-picker.yaml +285 -0
- package/components/datetime-picker/datetime-picker.a2ui.json +334 -0
- package/components/datetime-picker/datetime-picker.class.js +706 -0
- package/components/datetime-picker/datetime-picker.css +150 -0
- package/components/datetime-picker/datetime-picker.d.ts +86 -0
- package/components/datetime-picker/datetime-picker.examples.md +46 -0
- package/components/datetime-picker/datetime-picker.js +17 -0
- package/components/datetime-picker/datetime-picker.test.js +454 -0
- package/components/datetime-picker/datetime-picker.yaml +332 -0
- package/components/demo-toggle/demo-toggle.css +27 -27
- package/components/demo-toggle/demo-toggle.js +1 -1
- package/components/description-list/description-list.css +18 -18
- package/components/description-list/description-list.js +1 -1
- package/components/divider/divider.css +24 -24
- package/components/divider/divider.js +1 -1
- package/components/drawer/drawer.js +1 -1
- package/components/embed/embed.css +6 -6
- package/components/embed/embed.js +1 -1
- package/components/empty-state/empty-state.css +27 -27
- package/components/empty-state/empty-state.js +1 -1
- package/components/feed/feed.css +12 -12
- package/components/feed/feed.js +1 -1
- package/components/field/field.css +28 -28
- package/components/field/field.js +1 -1
- package/components/field/field.test.js +1 -1
- package/components/fields/fields.css +5 -5
- package/components/fields/fields.js +1 -1
- package/components/grid/grid.css +5 -5
- package/components/grid/grid.js +1 -1
- package/components/heatmap/heatmap.css +63 -63
- package/components/heatmap/heatmap.js +1 -1
- package/components/icon/icon.css +12 -12
- package/components/icon/icon.js +1 -1
- package/components/image/image.css +14 -14
- package/components/image/image.js +1 -1
- package/components/index.js +11 -0
- package/components/inline-message/inline-message.a2ui.json +143 -0
- package/components/inline-message/inline-message.class.js +169 -0
- package/components/inline-message/inline-message.css +75 -0
- package/components/inline-message/inline-message.d.ts +31 -0
- package/components/inline-message/inline-message.examples.md +19 -0
- package/components/inline-message/inline-message.js +17 -0
- package/components/inline-message/inline-message.test.js +203 -0
- package/components/inline-message/inline-message.yaml +205 -0
- package/components/input/input.css +67 -67
- package/components/input/input.js +1 -1
- package/components/input/input.yaml +5 -4
- package/components/inspector/inspector.css +6 -6
- package/components/inspector/inspector.js +1 -1
- package/components/integration-card/integration-card.a2ui.json +268 -0
- package/components/integration-card/integration-card.class.js +410 -0
- package/components/integration-card/integration-card.css +169 -0
- package/components/integration-card/integration-card.d.ts +63 -0
- package/components/integration-card/integration-card.examples.md +41 -0
- package/components/integration-card/integration-card.js +17 -0
- package/components/integration-card/integration-card.test.js +306 -0
- package/components/integration-card/integration-card.yaml +280 -0
- package/components/kbd/kbd.css +32 -32
- package/components/kbd/kbd.js +1 -1
- package/components/link/link.css +12 -12
- package/components/link/link.js +1 -1
- package/components/list/list-item.yaml +2 -2
- package/components/list/list.css +8 -8
- package/components/list/list.js +1 -1
- package/components/list-window/list-window.a2ui.json +277 -0
- package/components/list-window/list-window.class.js +688 -0
- package/components/list-window/list-window.css +124 -0
- package/components/list-window/list-window.d.ts +84 -0
- package/components/list-window/list-window.examples.md +73 -0
- package/components/list-window/list-window.js +17 -0
- package/components/list-window/list-window.test.js +303 -0
- package/components/list-window/list-window.yaml +270 -0
- package/components/loading-overlay/loading-overlay.a2ui.json +176 -0
- package/components/loading-overlay/loading-overlay.class.js +203 -0
- package/components/loading-overlay/loading-overlay.css +81 -0
- package/components/loading-overlay/loading-overlay.d.ts +24 -0
- package/components/loading-overlay/loading-overlay.examples.md +50 -0
- package/components/loading-overlay/loading-overlay.js +17 -0
- package/components/loading-overlay/loading-overlay.test.js +257 -0
- package/components/loading-overlay/loading-overlay.yaml +260 -0
- package/components/menu/menu-divider.yaml +1 -1
- package/components/menu/menu-item.yaml +1 -1
- package/components/menu/menu.a2ui.json +3 -0
- package/components/menu/menu.css +8 -8
- package/components/menu/menu.js +1 -1
- package/components/menu/menu.yaml +7 -0
- package/components/modal/{class.js → modal.class.js} +12 -1
- package/components/modal/modal.css +54 -44
- package/components/modal/modal.js +1 -1
- package/components/nav/nav.css +40 -40
- package/components/nav/nav.js +1 -1
- package/components/nav-group/nav-group.css +52 -52
- package/components/nav-group/nav-group.js +1 -1
- package/components/nav-item/nav-item.css +44 -44
- package/components/nav-item/nav-item.js +1 -1
- package/components/noodles/noodles.css +31 -31
- package/components/noodles/noodles.js +1 -1
- package/components/option-card/option-card.css +69 -69
- package/components/option-card/option-card.js +1 -1
- package/components/otp-input/otp-input.css +30 -30
- package/components/otp-input/otp-input.js +1 -1
- package/components/page/page.css +18 -18
- package/components/page/page.js +1 -1
- package/components/pagination/pagination.css +61 -61
- package/components/pagination/pagination.js +1 -1
- package/components/pane/pane.css +57 -57
- package/components/pane/pane.js +1 -1
- package/components/pipeline-status/pipeline-status.css +65 -65
- package/components/pipeline-status/pipeline-status.js +1 -1
- package/components/popover/popover.a2ui.json +8 -1
- package/components/popover/popover.css +17 -17
- package/components/popover/popover.js +1 -1
- package/components/popover/popover.yaml +14 -1
- package/components/progress/progress.css +23 -23
- package/components/progress/progress.js +1 -1
- package/components/progress-row/progress-row.css +17 -17
- package/components/progress-row/progress-row.js +1 -1
- package/components/radio/radio.css +39 -39
- package/components/radio/radio.js +1 -1
- package/components/range/range.css +55 -55
- package/components/range/range.js +1 -1
- package/components/rating/rating.css +28 -28
- package/components/rating/rating.js +1 -1
- package/components/richtext/richtext.css +133 -133
- package/components/richtext/richtext.js +1 -1
- package/components/row/row.css +19 -19
- package/components/row/row.js +1 -1
- package/components/search/search.css +5 -5
- package/components/search/search.js +1 -1
- package/components/segment/segment.css +24 -24
- package/components/segment/segment.js +1 -1
- package/components/segmented/segmented.css +25 -25
- package/components/segmented/segmented.js +1 -1
- package/components/select/select.a2ui.json +58 -4
- package/components/select/{class.js → select.class.js} +415 -6
- package/components/select/select.css +242 -84
- package/components/select/select.d.ts +31 -1
- package/components/select/select.js +1 -1
- package/components/select/select.test.js +202 -0
- package/components/select/select.yaml +126 -5
- package/components/skeleton/skeleton.css +14 -14
- package/components/skeleton/skeleton.js +1 -1
- package/components/slider/slider.css +46 -46
- package/components/slider/slider.js +1 -1
- package/components/spinner/spinner.a2ui.json +198 -0
- package/components/spinner/spinner.class.js +99 -0
- package/components/spinner/spinner.css +221 -0
- package/components/spinner/spinner.d.ts +26 -0
- package/components/spinner/spinner.examples.md +26 -0
- package/components/spinner/spinner.js +17 -0
- package/components/spinner/spinner.test.js +272 -0
- package/components/spinner/spinner.yaml +238 -0
- package/components/stack/stack.css +11 -11
- package/components/stack/stack.js +1 -1
- package/components/stat/stat.css +25 -25
- package/components/step-progress/step-progress.css +20 -20
- package/components/step-progress/step-progress.js +1 -1
- package/components/stepper/stepper-item.yaml +1 -1
- package/components/stepper/stepper.css +29 -29
- package/components/stepper/stepper.js +1 -1
- package/components/stream/stream.css +12 -12
- package/components/stream/stream.js +1 -1
- package/components/swatch/swatch.css +68 -68
- package/components/swatch/swatch.js +1 -1
- package/components/swiper/swiper.css +57 -57
- package/components/swiper/swiper.js +1 -1
- package/components/switch/switch.css +52 -52
- package/components/switch/switch.js +1 -1
- package/components/table/table.css +163 -163
- package/components/table/table.js +1 -1
- package/components/table-toolbar/{class.js → table-toolbar.class.js} +1 -1
- package/components/table-toolbar/table-toolbar.css +32 -32
- package/components/table-toolbar/table-toolbar.js +1 -1
- package/components/tabs/tab.yaml +2 -2
- package/components/tabs/tabs.css +51 -51
- package/components/tabs/tabs.js +1 -1
- package/components/tag/tag.css +48 -48
- package/components/tag/tag.js +1 -1
- package/components/tags-input/tags-input.a2ui.json +337 -0
- package/components/tags-input/tags-input.class.js +776 -0
- package/components/tags-input/tags-input.css +201 -0
- package/components/tags-input/tags-input.d.ts +120 -0
- package/components/tags-input/tags-input.examples.md +92 -0
- package/components/tags-input/tags-input.js +17 -0
- package/components/tags-input/tags-input.test.js +368 -0
- package/components/tags-input/tags-input.yaml +367 -0
- package/components/text/text.css +44 -44
- package/components/text/text.js +1 -1
- package/components/textarea/textarea.a2ui.json +1 -1
- package/components/textarea/textarea.css +46 -46
- package/components/textarea/textarea.js +1 -1
- package/components/textarea/textarea.yaml +11 -8
- package/components/time-picker/time-picker.a2ui.json +267 -0
- package/components/time-picker/time-picker.class.js +693 -0
- package/components/time-picker/time-picker.css +122 -0
- package/components/time-picker/time-picker.d.ts +75 -0
- package/components/time-picker/time-picker.examples.md +35 -0
- package/components/time-picker/time-picker.js +17 -0
- package/components/time-picker/time-picker.test.js +287 -0
- package/components/time-picker/time-picker.yaml +256 -0
- package/components/timeline/timeline-item.yaml +2 -2
- package/components/timeline/{class.js → timeline.class.js} +1 -1
- package/components/timeline/timeline.css +50 -50
- package/components/timeline/timeline.js +1 -1
- package/components/toast/toast.css +58 -58
- package/components/toast/toast.js +1 -1
- package/components/toggle-group/toggle-group.css +6 -6
- package/components/toggle-group/toggle-group.js +1 -1
- package/components/toggle-group/toggle-option.yaml +1 -1
- package/components/toggle-scheme/toggle-scheme.css +2 -2
- package/components/toggle-scheme/toggle-scheme.js +1 -1
- package/components/toolbar/toolbar-group.yaml +1 -1
- package/components/toolbar/toolbar.css +17 -17
- package/components/toolbar/toolbar.js +1 -1
- package/components/tooltip/tooltip.css +2 -2
- package/components/tooltip/tooltip.js +1 -1
- package/components/tree/tree-item.yaml +1 -1
- package/components/tree/tree.css +37 -37
- package/components/tree/tree.js +1 -1
- package/components/upload/upload.css +49 -49
- package/components/upload/upload.js +1 -1
- package/dist/web-components.min.css +1 -1
- package/dist/web-components.min.js +146 -87
- package/package.json +3 -3
- package/styles/components.css +11 -0
- /package/components/accordion/{class.js → accordion.class.js} +0 -0
- /package/components/action-list/{class.js → action-list.class.js} +0 -0
- /package/components/agent-feedback-bar/{class.js → agent-feedback-bar.class.js} +0 -0
- /package/components/agent-questions/{class.js → agent-questions.class.js} +0 -0
- /package/components/agent-reasoning/{class.js → agent-reasoning.class.js} +0 -0
- /package/components/agent-suggestions/{class.js → agent-suggestions.class.js} +0 -0
- /package/components/avatar/{class.js → avatar.class.js} +0 -0
- /package/components/badge/{class.js → badge.class.js} +0 -0
- /package/components/block/{class.js → block.class.js} +0 -0
- /package/components/breadcrumb/{class.js → breadcrumb.class.js} +0 -0
- /package/components/button/{class.js → button.class.js} +0 -0
- /package/components/calendar-picker/{class.js → calendar-picker.class.js} +0 -0
- /package/components/card/{class.js → card.class.js} +0 -0
- /package/components/chart/{class.js → chart.class.js} +0 -0
- /package/components/chart-legend/{class.js → chart-legend.class.js} +0 -0
- /package/components/chat-thread/{class.js → chat-thread.class.js} +0 -0
- /package/components/check/{class.js → check.class.js} +0 -0
- /package/components/code/{class.js → code.class.js} +0 -0
- /package/components/col/{class.js → col.class.js} +0 -0
- /package/components/color-input/{class.js → color-input.class.js} +0 -0
- /package/components/color-picker/{class.js → color-picker.class.js} +0 -0
- /package/components/command/{class.js → command.class.js} +0 -0
- /package/components/demo-toggle/{class.js → demo-toggle.class.js} +0 -0
- /package/components/description-list/{class.js → description-list.class.js} +0 -0
- /package/components/divider/{class.js → divider.class.js} +0 -0
- /package/components/drawer/{class.js → drawer.class.js} +0 -0
- /package/components/embed/{class.js → embed.class.js} +0 -0
- /package/components/empty-state/{class.js → empty-state.class.js} +0 -0
- /package/components/feed/{class.js → feed.class.js} +0 -0
- /package/components/field/{class.js → field.class.js} +0 -0
- /package/components/fields/{class.js → fields.class.js} +0 -0
- /package/components/grid/{class.js → grid.class.js} +0 -0
- /package/components/heatmap/{class.js → heatmap.class.js} +0 -0
- /package/components/icon/{class.js → icon.class.js} +0 -0
- /package/components/image/{class.js → image.class.js} +0 -0
- /package/components/input/{class.js → input.class.js} +0 -0
- /package/components/inspector/{class.js → inspector.class.js} +0 -0
- /package/components/kbd/{class.js → kbd.class.js} +0 -0
- /package/components/link/{class.js → link.class.js} +0 -0
- /package/components/list/{class.js → list.class.js} +0 -0
- /package/components/menu/{class.js → menu.class.js} +0 -0
- /package/components/nav/{class.js → nav.class.js} +0 -0
- /package/components/nav-group/{class.js → nav-group.class.js} +0 -0
- /package/components/nav-item/{class.js → nav-item.class.js} +0 -0
- /package/components/noodles/{class.js → noodles.class.js} +0 -0
- /package/components/option-card/{class.js → option-card.class.js} +0 -0
- /package/components/otp-input/{class.js → otp-input.class.js} +0 -0
- /package/components/page/{class.js → page.class.js} +0 -0
- /package/components/pagination/{class.js → pagination.class.js} +0 -0
- /package/components/pane/{class.js → pane.class.js} +0 -0
- /package/components/pipeline-status/{class.js → pipeline-status.class.js} +0 -0
- /package/components/popover/{class.js → popover.class.js} +0 -0
- /package/components/progress/{class.js → progress.class.js} +0 -0
- /package/components/progress-row/{class.js → progress-row.class.js} +0 -0
- /package/components/radio/{class.js → radio.class.js} +0 -0
- /package/components/range/{class.js → range.class.js} +0 -0
- /package/components/rating/{class.js → rating.class.js} +0 -0
- /package/components/richtext/{class.js → richtext.class.js} +0 -0
- /package/components/row/{class.js → row.class.js} +0 -0
- /package/components/search/{class.js → search.class.js} +0 -0
- /package/components/segment/{class.js → segment.class.js} +0 -0
- /package/components/segmented/{class.js → segmented.class.js} +0 -0
- /package/components/skeleton/{class.js → skeleton.class.js} +0 -0
- /package/components/slider/{class.js → slider.class.js} +0 -0
- /package/components/stack/{class.js → stack.class.js} +0 -0
- /package/components/step-progress/{class.js → step-progress.class.js} +0 -0
- /package/components/stepper/{class.js → stepper.class.js} +0 -0
- /package/components/stream/{class.js → stream.class.js} +0 -0
- /package/components/swatch/{class.js → swatch.class.js} +0 -0
- /package/components/swiper/{class.js → swiper.class.js} +0 -0
- /package/components/switch/{class.js → switch.class.js} +0 -0
- /package/components/table/{class.js → table.class.js} +0 -0
- /package/components/tabs/{class.js → tabs.class.js} +0 -0
- /package/components/tag/{class.js → tag.class.js} +0 -0
- /package/components/text/{class.js → text.class.js} +0 -0
- /package/components/textarea/{class.js → textarea.class.js} +0 -0
- /package/components/toast/{class.js → toast.class.js} +0 -0
- /package/components/toggle-group/{class.js → toggle-group.class.js} +0 -0
- /package/components/toggle-scheme/{class.js → toggle-scheme.class.js} +0 -0
- /package/components/toolbar/{class.js → toolbar.class.js} +0 -0
- /package/components/tooltip/{class.js → tooltip.class.js} +0 -0
- /package/components/tree/{class.js → tree.class.js} +0 -0
- /package/components/upload/{class.js → upload.class.js} +0 -0
package/components/icon/icon.css
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
@scope (icon-ui) {
|
|
2
2
|
:where(:scope) {
|
|
3
|
-
--icon-size: var(--a-icon-size, calc(1em + 0.125rem));
|
|
3
|
+
--icon-size-default: var(--a-icon-size, calc(1em + 0.125rem));
|
|
4
4
|
}
|
|
5
5
|
|
|
6
6
|
:scope {
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
display: inline-flex;
|
|
9
9
|
align-items: center;
|
|
10
10
|
justify-content: center;
|
|
11
|
-
width: var(--icon-size);
|
|
12
|
-
height: var(--icon-size);
|
|
11
|
+
width: var(--icon-size, var(--icon-size-default));
|
|
12
|
+
height: var(--icon-size, var(--icon-size-default));
|
|
13
13
|
flex-shrink: 0;
|
|
14
14
|
line-height: 0;
|
|
15
15
|
}
|
|
@@ -24,13 +24,13 @@
|
|
|
24
24
|
icon-ui set its own size locally. xs / xl / 2xl / 3xl / 4xl
|
|
25
25
|
extend the scale beyond the universal range for hero placeholder
|
|
26
26
|
contexts. `fill` matches the parent box. */
|
|
27
|
-
:scope[size="xs"] { --icon-size: 0.75rem; } /* 12px */
|
|
28
|
-
:scope[size="sm"] { --icon-size: 0.875rem; } /* 14px */
|
|
29
|
-
:scope[size="md"] { --icon-size: 1rem; } /* 16px */
|
|
30
|
-
:scope[size="lg"] { --icon-size: 1.25rem; } /* 20px */
|
|
31
|
-
:scope[size="xl"] { --icon-size: 2rem; } /* 32px */
|
|
32
|
-
:scope[size="2xl"] { --icon-size: 3rem; } /* 48px */
|
|
33
|
-
:scope[size="3xl"] { --icon-size: 4rem; } /* 64px */
|
|
34
|
-
:scope[size="4xl"] { --icon-size: 6rem; } /* 96px */
|
|
35
|
-
:scope[size="fill"] { --icon-size: 100%; }
|
|
27
|
+
:scope[size="xs"] { --icon-size-default: 0.75rem; } /* 12px */
|
|
28
|
+
:scope[size="sm"] { --icon-size-default: 0.875rem; } /* 14px */
|
|
29
|
+
:scope[size="md"] { --icon-size-default: 1rem; } /* 16px */
|
|
30
|
+
:scope[size="lg"] { --icon-size-default: 1.25rem; } /* 20px */
|
|
31
|
+
:scope[size="xl"] { --icon-size-default: 2rem; } /* 32px */
|
|
32
|
+
:scope[size="2xl"] { --icon-size-default: 3rem; } /* 48px */
|
|
33
|
+
:scope[size="3xl"] { --icon-size-default: 4rem; } /* 64px */
|
|
34
|
+
:scope[size="4xl"] { --icon-size-default: 6rem; } /* 96px */
|
|
35
|
+
:scope[size="fill"] { --icon-size-default: 100%; }
|
|
36
36
|
}
|
package/components/icon/icon.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
@scope (image-ui) {
|
|
2
2
|
:where(:scope) {
|
|
3
3
|
/* ── Layout ── */
|
|
4
|
-
--image-radius: 0;
|
|
4
|
+
--image-radius-default: 0;
|
|
5
5
|
|
|
6
6
|
/* ── Colors ── */
|
|
7
|
-
--image-bg: var(--a-bg-muted);
|
|
7
|
+
--image-bg-default: var(--a-bg-muted);
|
|
8
8
|
|
|
9
9
|
/* ── Transition ── */
|
|
10
|
-
--image-duration: var(--a-duration);
|
|
11
|
-
--image-easing: var(--a-easing);
|
|
10
|
+
--image-duration-default: var(--a-duration);
|
|
11
|
+
--image-easing-default: var(--a-easing);
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
:scope {
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
display: inline-block;
|
|
18
18
|
position: relative;
|
|
19
19
|
overflow: hidden;
|
|
20
|
-
background: var(--image-bg);
|
|
21
|
-
border-radius: var(--image-radius);
|
|
20
|
+
background: var(--image-bg, var(--image-bg-default));
|
|
21
|
+
border-radius: var(--image-radius, var(--image-radius-default));
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
/* ── Image ── */
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
height: 100%;
|
|
29
29
|
object-fit: cover;
|
|
30
30
|
opacity: 0;
|
|
31
|
-
transition: opacity var(--image-duration) var(--image-easing);
|
|
31
|
+
transition: opacity var(--image-duration, var(--image-duration-default)) var(--image-easing, var(--image-easing-default));
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
:scope[data-loaded] [slot="image"] {
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
[slot="skeleton"] {
|
|
46
46
|
position: absolute;
|
|
47
47
|
inset: 0;
|
|
48
|
-
transition: opacity var(--image-duration) var(--image-easing);
|
|
48
|
+
transition: opacity var(--image-duration, var(--image-duration-default)) var(--image-easing, var(--image-easing-default));
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
:scope[data-loaded] [slot="skeleton"] {
|
|
@@ -54,10 +54,10 @@
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
/* ── Radius variants ── */
|
|
57
|
-
:scope[radius="sm"] { --image-radius: var(--a-radius-sm); }
|
|
58
|
-
:scope[radius="md"] { --image-radius: var(--a-radius-md); }
|
|
59
|
-
:scope[radius="lg"] { --image-radius: var(--a-radius-lg); }
|
|
60
|
-
:scope[radius="full"] { --image-radius: var(--a-radius-full); }
|
|
57
|
+
:scope[radius="sm"] { --image-radius-default: var(--a-radius-sm); }
|
|
58
|
+
:scope[radius="md"] { --image-radius-default: var(--a-radius-md); }
|
|
59
|
+
:scope[radius="lg"] { --image-radius-default: var(--a-radius-lg); }
|
|
60
|
+
:scope[radius="full"] { --image-radius-default: var(--a-radius-full); }
|
|
61
61
|
|
|
62
62
|
/* ── Size mode — fills the container.
|
|
63
63
|
Layout-changing attribute; sanctioned in component-token-contract.md. */
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
/* ── Raw — strips chrome (background + radius) for edge-to-edge rendering.
|
|
71
71
|
Comes after radius variants so it overrides them by source order. */
|
|
72
72
|
:scope[raw] {
|
|
73
|
-
--image-bg: transparent;
|
|
74
|
-
--image-radius: 0;
|
|
73
|
+
--image-bg-default: transparent;
|
|
74
|
+
--image-radius-default: 0;
|
|
75
75
|
}
|
|
76
76
|
}
|
package/components/index.js
CHANGED
|
@@ -25,6 +25,7 @@ export { UITextarea } from './textarea/textarea.js';
|
|
|
25
25
|
export { UICheck } from './check/check.js';
|
|
26
26
|
export { UIRadio } from './radio/radio.js';
|
|
27
27
|
export { UIOptionCard } from './option-card/option-card.js';
|
|
28
|
+
export { UIIntegrationCard } from './integration-card/integration-card.js';
|
|
28
29
|
export { UISwitch } from './switch/switch.js';
|
|
29
30
|
export { UISlider } from './slider/slider.js';
|
|
30
31
|
export { UISelect } from './select/select.js';
|
|
@@ -60,7 +61,10 @@ export { UIAvatar, UIAvatarGroup } from './avatar/avatar.js';
|
|
|
60
61
|
export { UIProgress } from './progress/progress.js';
|
|
61
62
|
export { UIStepProgress } from './step-progress/step-progress.js';
|
|
62
63
|
export { UISkeleton } from './skeleton/skeleton.js';
|
|
64
|
+
export { UISpinner } from './spinner/spinner.js';
|
|
65
|
+
export { UILoadingOverlay } from './loading-overlay/loading-overlay.js';
|
|
63
66
|
export { UIAlert } from './alert/alert.js';
|
|
67
|
+
export { UIInlineMessage } from './inline-message/inline-message.js';
|
|
64
68
|
export { UIKbd } from './kbd/kbd.js';
|
|
65
69
|
export { UITag } from './tag/tag.js';
|
|
66
70
|
export { UISwatch } from './swatch/swatch.js';
|
|
@@ -78,6 +82,7 @@ export { UIDivider } from './divider/divider.js';
|
|
|
78
82
|
export { UIPagination } from './pagination/pagination.js';
|
|
79
83
|
export { UICode } from './code/code.js';
|
|
80
84
|
export { UIList, UIListItem } from './list/list.js';
|
|
85
|
+
export { UIListWindow } from './list-window/list-window.js';
|
|
81
86
|
export { UIMenu, UIMenuItem, UIMenuDivider } from './menu/menu.js';
|
|
82
87
|
export { UIToolbar, UIToolbarGroup } from './toolbar/toolbar.js';
|
|
83
88
|
export { UINav } from './nav/nav.js';
|
|
@@ -86,11 +91,17 @@ export { UINavItem } from './nav-item/nav-item.js';
|
|
|
86
91
|
export { UIOtpInput } from './otp-input/otp-input.js';
|
|
87
92
|
export { UIImage } from './image/image.js';
|
|
88
93
|
export { UISearch } from './search/search.js';
|
|
94
|
+
export { UICombobox } from './combobox/combobox.js';
|
|
95
|
+
export { UITagsInput } from './tags-input/tags-input.js';
|
|
89
96
|
export { UIStat } from './stat/stat.js';
|
|
90
97
|
export { UIProgressRow } from './progress-row/progress-row.js';
|
|
91
98
|
export { UIActionList, UIActionItem } from './action-list/action-list.js';
|
|
92
99
|
export { UIEmptyState } from './empty-state/empty-state.js';
|
|
100
|
+
export { UICalendarGrid } from './calendar-grid/calendar-grid.js';
|
|
93
101
|
export { UICalendarPicker } from './calendar-picker/calendar-picker.js';
|
|
102
|
+
export { UIDateRangePicker } from './date-range-picker/date-range-picker.js';
|
|
103
|
+
export { UITimePicker } from './time-picker/time-picker.js';
|
|
104
|
+
export { UIDatetimePicker } from './datetime-picker/datetime-picker.js';
|
|
94
105
|
export { UIEmbed } from './embed/embed.js';
|
|
95
106
|
export { UIBlock } from './block/block.js';
|
|
96
107
|
export { UIText } from './text/text.js';
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://adiaui.dev/a2ui/v0_9/components/InlineMessage.json",
|
|
4
|
+
"title": "InlineMessage",
|
|
5
|
+
"description": "In-flow message glyph + text used in form-field rows for validation\nfeedback, hint copy, and inline confirmations. Distinguished from\n<alert-ui> (banner / surface-bearing notice) by carrying no surface\nfill, no border, no padding box — severity is foreground color +\nicon only. Variants map to severity (info / success / warning /\ndanger). Nests inside <field-ui>, <col-ui>, <row-ui> without\nbreaking field rhythm. Non-interactive annotation only.\n",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"allOf": [
|
|
8
|
+
{
|
|
9
|
+
"$ref": "common_types.json#/$defs/ComponentCommon"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"$ref": "common_types.json#/$defs/CatalogComponentCommon"
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
"properties": {
|
|
16
|
+
"component": {
|
|
17
|
+
"const": "InlineMessage"
|
|
18
|
+
},
|
|
19
|
+
"icon": {
|
|
20
|
+
"description": "Phosphor glyph override; each [variant] ships a sensible default (info / check-circle / warning / x-circle).",
|
|
21
|
+
"$ref": "common_types.json#/$defs/DynamicString"
|
|
22
|
+
},
|
|
23
|
+
"live": {
|
|
24
|
+
"description": "Sets `aria-live` on the host for dynamic message updates. Empty = no live region (static annotation).",
|
|
25
|
+
"type": "string",
|
|
26
|
+
"enum": [
|
|
27
|
+
"",
|
|
28
|
+
"polite",
|
|
29
|
+
"assertive"
|
|
30
|
+
],
|
|
31
|
+
"default": ""
|
|
32
|
+
},
|
|
33
|
+
"text": {
|
|
34
|
+
"description": "Single-line message text. Default-slot content wins when present.",
|
|
35
|
+
"$ref": "common_types.json#/$defs/DynamicString"
|
|
36
|
+
},
|
|
37
|
+
"variant": {
|
|
38
|
+
"description": "Semantic severity tone — drives icon + foreground color. Default carries no leading icon (pure hint copy).",
|
|
39
|
+
"$ref": "common_types.json#/$defs/DynamicString"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"required": [
|
|
43
|
+
"component"
|
|
44
|
+
],
|
|
45
|
+
"unevaluatedProperties": false,
|
|
46
|
+
"x-adiaui": {
|
|
47
|
+
"anti_patterns": [],
|
|
48
|
+
"category": "feedback",
|
|
49
|
+
"composes": [
|
|
50
|
+
"icon-ui"
|
|
51
|
+
],
|
|
52
|
+
"events": {},
|
|
53
|
+
"examples": [
|
|
54
|
+
{
|
|
55
|
+
"description": "Email field with a danger inline-message under the input.",
|
|
56
|
+
"a2ui": "[\n {\n \"id\": \"root\",\n \"component\": \"Field\",\n \"label\": \"Email\",\n \"children\": [\n \"input\",\n \"msg\"\n ]\n },\n {\n \"id\": \"input\",\n \"component\": \"Input\",\n \"type\": \"email\"\n },\n {\n \"id\": \"msg\",\n \"component\": \"InlineMessage\",\n \"variant\": \"danger\",\n \"text\": \"Email address is required\"\n }\n]",
|
|
57
|
+
"name": "field-validation"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"description": "Password field with a muted hint (default variant, no icon).",
|
|
61
|
+
"a2ui": "[\n {\n \"id\": \"root\",\n \"component\": \"Field\",\n \"label\": \"Password\",\n \"children\": [\n \"input\",\n \"hint\"\n ]\n },\n {\n \"id\": \"input\",\n \"component\": \"Input\",\n \"type\": \"password\"\n },\n {\n \"id\": \"hint\",\n \"component\": \"InlineMessage\",\n \"text\": \"At least 8 characters\"\n }\n]",
|
|
62
|
+
"name": "password-hint"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"description": "Username field with a polite live-region success confirmation.",
|
|
66
|
+
"a2ui": "[\n {\n \"id\": \"root\",\n \"component\": \"Field\",\n \"label\": \"Username\",\n \"children\": [\n \"input\",\n \"msg\"\n ]\n },\n {\n \"id\": \"input\",\n \"component\": \"Input\"\n },\n {\n \"id\": \"msg\",\n \"component\": \"InlineMessage\",\n \"variant\": \"success\",\n \"live\": \"polite\",\n \"text\": \"Username is available\"\n }\n]",
|
|
67
|
+
"name": "username-success"
|
|
68
|
+
}
|
|
69
|
+
],
|
|
70
|
+
"keywords": [
|
|
71
|
+
"inline",
|
|
72
|
+
"message",
|
|
73
|
+
"hint",
|
|
74
|
+
"helper",
|
|
75
|
+
"validation",
|
|
76
|
+
"error",
|
|
77
|
+
"field-error",
|
|
78
|
+
"helper-text",
|
|
79
|
+
"error-text",
|
|
80
|
+
"form-feedback",
|
|
81
|
+
"status",
|
|
82
|
+
"notice"
|
|
83
|
+
],
|
|
84
|
+
"name": "UIInlineMessage",
|
|
85
|
+
"related": [
|
|
86
|
+
"alert",
|
|
87
|
+
"field",
|
|
88
|
+
"input",
|
|
89
|
+
"text"
|
|
90
|
+
],
|
|
91
|
+
"slots": {
|
|
92
|
+
"default": {
|
|
93
|
+
"description": "Message body — text or inline DOM (e.g. <link-ui>, <kbd-ui>). Wins over the [text] attribute when present. Stays inline so the message reads as one annotation line under the field."
|
|
94
|
+
},
|
|
95
|
+
"leading": {
|
|
96
|
+
"description": "Leading icon slot. Stamped automatically from [icon] or the variant's default glyph. Consumer-provided <icon-ui slot=\"leading\"> is preserved across [variant] changes (never overwritten)."
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
"states": [
|
|
100
|
+
{
|
|
101
|
+
"description": "Default, ready for screen-reader pickup.",
|
|
102
|
+
"name": "idle"
|
|
103
|
+
}
|
|
104
|
+
],
|
|
105
|
+
"status": "stable",
|
|
106
|
+
"synonyms": {
|
|
107
|
+
"error": [
|
|
108
|
+
"error",
|
|
109
|
+
"alert",
|
|
110
|
+
"validation"
|
|
111
|
+
],
|
|
112
|
+
"helper": [
|
|
113
|
+
"hint",
|
|
114
|
+
"help",
|
|
115
|
+
"tooltip"
|
|
116
|
+
],
|
|
117
|
+
"hint": [
|
|
118
|
+
"hint",
|
|
119
|
+
"tooltip",
|
|
120
|
+
"help"
|
|
121
|
+
],
|
|
122
|
+
"message": [
|
|
123
|
+
"alert",
|
|
124
|
+
"notification",
|
|
125
|
+
"hint"
|
|
126
|
+
],
|
|
127
|
+
"notice": [
|
|
128
|
+
"alert",
|
|
129
|
+
"banner",
|
|
130
|
+
"hint"
|
|
131
|
+
],
|
|
132
|
+
"validation": [
|
|
133
|
+
"validation",
|
|
134
|
+
"error",
|
|
135
|
+
"alert"
|
|
136
|
+
]
|
|
137
|
+
},
|
|
138
|
+
"tag": "inline-message-ui",
|
|
139
|
+
"tokens": {},
|
|
140
|
+
"traits": [],
|
|
141
|
+
"version": 1
|
|
142
|
+
}
|
|
143
|
+
}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Non-side-effect class export for `<inline-message-ui>`.
|
|
3
|
+
*
|
|
4
|
+
* Importing this file gives you the class without auto-registering the tag.
|
|
5
|
+
* Useful for test isolation, subclassing with tag-name override, or selective
|
|
6
|
+
* composition.
|
|
7
|
+
*
|
|
8
|
+
* The auto-register path stays at `@adia-ai/web-components/components/inline-message`
|
|
9
|
+
* (which imports this file + calls `defineIfFree()`).
|
|
10
|
+
*
|
|
11
|
+
* @see ../../USAGE.md#registration--auto-vs-explicit
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* <inline-message-ui text="Email address is required" variant="danger"></inline-message-ui>
|
|
16
|
+
* <inline-message-ui text="At least 8 characters"></inline-message-ui> ← default hint
|
|
17
|
+
* <inline-message-ui variant="success" live="polite" text="Saved"></inline-message-ui>
|
|
18
|
+
*
|
|
19
|
+
* In-flow message glyph + text for form-field rows. Distinguished from
|
|
20
|
+
* <alert-ui>: no surface fill, no border, no padding box — severity is
|
|
21
|
+
* foreground color + icon only.
|
|
22
|
+
*
|
|
23
|
+
* Variants: default (muted, no icon) | info | success | warning | danger
|
|
24
|
+
* Slots: leading (icon — auto-stamped from variant), default (text body)
|
|
25
|
+
*
|
|
26
|
+
* The host carries no role of its own (transparent inline annotation).
|
|
27
|
+
* Screen-reader pickup happens through the surrounding <field-ui>'s
|
|
28
|
+
* `aria-describedby` wiring. For dynamic message updates, opt into
|
|
29
|
+
* a live region with [live="polite"] or [live="assertive"].
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
import { UIElement } from '../../core/element.js';
|
|
33
|
+
|
|
34
|
+
// variant → default icon name. Pure default carries no icon (muted hint).
|
|
35
|
+
const VARIANT_ICON = {
|
|
36
|
+
info: 'info',
|
|
37
|
+
success: 'check-circle',
|
|
38
|
+
warning: 'warning',
|
|
39
|
+
danger: 'x-circle',
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export class UIInlineMessage extends UIElement {
|
|
43
|
+
static properties = {
|
|
44
|
+
text: { type: String, default: '', reflect: false },
|
|
45
|
+
variant: { type: String, default: 'default', reflect: true },
|
|
46
|
+
icon: { type: String, default: '', reflect: true },
|
|
47
|
+
live: { type: String, default: '', reflect: true },
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
// Static parts — single `parts.leading` for the auto-stamped icon
|
|
51
|
+
// (per SPEC-033 §8). render() re-runs ensure/drop based on current
|
|
52
|
+
// variant + icon + the absence of consumer-provided slotted icon.
|
|
53
|
+
static parts = {
|
|
54
|
+
leading: '<icon-ui slot="leading"></icon-ui>',
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
static requiredIcons = ['info', 'check-circle', 'warning', 'x-circle'];
|
|
58
|
+
|
|
59
|
+
static template = () => null;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Was the current leading icon consumer-provided (preserve across
|
|
63
|
+
* variant changes) or auto-stamped by us (re-stamp on variant change)?
|
|
64
|
+
* Detected by the `_uiPart` marker that `ensure()` sets on stamped
|
|
65
|
+
* parts plus our own `data-im-auto` tag so a consumer-replaced node
|
|
66
|
+
* doesn't get clobbered. See `ensure()` in core/element.js.
|
|
67
|
+
*/
|
|
68
|
+
#ownsLeading(node) {
|
|
69
|
+
return !!(node && (node._uiPart || node.hasAttribute('data-im-auto')));
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
connected() {
|
|
73
|
+
// Stamp leading icon if variant supplies one and consumer hasn't
|
|
74
|
+
// already slotted their own. render() will mirror this on changes.
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
render() {
|
|
78
|
+
// ── aria-live wiring ──
|
|
79
|
+
// [live=""] → strip aria-live. [live=polite|assertive] → reflect.
|
|
80
|
+
if (this.live) {
|
|
81
|
+
this.setAttribute('aria-live', this.live);
|
|
82
|
+
} else if (this.hasAttribute('aria-live')) {
|
|
83
|
+
this.removeAttribute('aria-live');
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// ── default-slot text body ──
|
|
87
|
+
// If [text] is set and the consumer hasn't slotted body content,
|
|
88
|
+
// mirror [text] into textContent of the host so CSS lays it out
|
|
89
|
+
// alongside the leading icon. Detection of "consumer slotted body":
|
|
90
|
+
// any non-slotted child text/element survives across renders.
|
|
91
|
+
//
|
|
92
|
+
// NOTE: we never overwrite consumer-provided body content. We tag
|
|
93
|
+
// our own text node so we can replace it on subsequent renders
|
|
94
|
+
// without touching the consumer's nodes.
|
|
95
|
+
this.#syncBodyText();
|
|
96
|
+
|
|
97
|
+
// ── leading icon stamping ──
|
|
98
|
+
// Resolve which icon to show: explicit [icon] wins, then the
|
|
99
|
+
// variant's default. Default variant has no icon (pure hint).
|
|
100
|
+
const resolvedIcon = this.icon || VARIANT_ICON[this.variant] || '';
|
|
101
|
+
|
|
102
|
+
// Inspect the current `[slot="leading"]` child. If consumer-provided
|
|
103
|
+
// (no _uiPart flag, no data-im-auto), leave it untouched — they
|
|
104
|
+
// own it across variant changes.
|
|
105
|
+
const existingLeading = this.querySelector(':scope > [slot="leading"]');
|
|
106
|
+
if (existingLeading && !this.#ownsLeading(existingLeading)) {
|
|
107
|
+
// Consumer owns the leading slot; do nothing.
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
if (resolvedIcon) {
|
|
112
|
+
const leading = this.ensure('leading');
|
|
113
|
+
if (leading) {
|
|
114
|
+
// Mark as auto-stamped so subsequent renders / variant changes
|
|
115
|
+
// re-stamp without prompting "is this consumer-owned?" ambiguity.
|
|
116
|
+
leading.setAttribute('data-im-auto', '');
|
|
117
|
+
if (leading.getAttribute('name') !== resolvedIcon) {
|
|
118
|
+
leading.setAttribute('name', resolvedIcon);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
} else {
|
|
122
|
+
this.drop('leading');
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Mirror [text] into the host body without clobbering consumer-slotted
|
|
128
|
+
* nodes. We anchor our text node with a `data-im-text` marker on a
|
|
129
|
+
* `<span>` wrapper; on subsequent renders we update that span's
|
|
130
|
+
* textContent. Any non-marked child (including the leading slot) is
|
|
131
|
+
* left untouched.
|
|
132
|
+
*/
|
|
133
|
+
#syncBodyText() {
|
|
134
|
+
// Find our auto-stamped text span, if any.
|
|
135
|
+
let bodySpan = this.querySelector(':scope > [data-im-text]');
|
|
136
|
+
|
|
137
|
+
// Detect any consumer-provided body content: child nodes that
|
|
138
|
+
// are NOT the leading slot and NOT our text span. If present,
|
|
139
|
+
// we drop our text span entirely (consumer wins).
|
|
140
|
+
const hasConsumerBody = Array.from(this.childNodes).some((n) => {
|
|
141
|
+
if (n === bodySpan) return false;
|
|
142
|
+
if (n.nodeType === Node.ELEMENT_NODE) {
|
|
143
|
+
if (n.getAttribute && n.getAttribute('slot') === 'leading') return false;
|
|
144
|
+
return true;
|
|
145
|
+
}
|
|
146
|
+
// Non-empty text node from author markup
|
|
147
|
+
if (n.nodeType === Node.TEXT_NODE && n.textContent.trim()) return true;
|
|
148
|
+
return false;
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
if (hasConsumerBody) {
|
|
152
|
+
if (bodySpan) bodySpan.remove();
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
if (this.text) {
|
|
157
|
+
if (!bodySpan) {
|
|
158
|
+
bodySpan = document.createElement('span');
|
|
159
|
+
bodySpan.setAttribute('data-im-text', '');
|
|
160
|
+
this.appendChild(bodySpan);
|
|
161
|
+
}
|
|
162
|
+
if (bodySpan.textContent !== this.text) {
|
|
163
|
+
bodySpan.textContent = this.text;
|
|
164
|
+
}
|
|
165
|
+
} else if (bodySpan) {
|
|
166
|
+
bodySpan.remove();
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
@scope (inline-message-ui) {
|
|
2
|
+
:where(:scope) {
|
|
3
|
+
/* ── Colors ──
|
|
4
|
+
Default is muted hint copy (no fill behind, so use the on-canvas
|
|
5
|
+
`--a-fg-muted`). Severity variants drop in `--a-{family}-text`
|
|
6
|
+
(light-dark(20-shade, 20-tint)) — the on-canvas text family, not
|
|
7
|
+
`--a-{family}-fg` (which is on-fill / on-strong-bg). */
|
|
8
|
+
--inline-message-fg-default: var(--a-fg-muted);
|
|
9
|
+
--inline-message-icon-fg-default: currentColor;
|
|
10
|
+
|
|
11
|
+
/* ── Layout ── */
|
|
12
|
+
--inline-message-gap-default: var(--a-space-1);
|
|
13
|
+
--inline-message-icon-size-default: var(--a-ui-sm);
|
|
14
|
+
|
|
15
|
+
/* ── Typography ── */
|
|
16
|
+
--inline-message-font-size-default: var(--a-ui-sm);
|
|
17
|
+
--inline-message-line-height-default: var(--a-leading-snug);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
:scope {
|
|
21
|
+
/* ── Base ──
|
|
22
|
+
inline-flex so the message reads as a single inline-flow annotation
|
|
23
|
+
(icon + text on one row), with baseline alignment so the icon optically
|
|
24
|
+
sits on the text baseline. No background, no border, no padding box —
|
|
25
|
+
SPEC-033 §3 principle 1: in-flow not surface-bearing. */
|
|
26
|
+
box-sizing: border-box;
|
|
27
|
+
display: inline-flex;
|
|
28
|
+
align-items: baseline;
|
|
29
|
+
gap: var(--inline-message-gap, var(--inline-message-gap-default));
|
|
30
|
+
color: var(--inline-message-fg, var(--inline-message-fg-default));
|
|
31
|
+
font-size: var(--inline-message-font-size, var(--inline-message-font-size-default));
|
|
32
|
+
line-height: var(--inline-message-line-height, var(--inline-message-line-height-default));
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/* ── Leading icon ──
|
|
36
|
+
`align-self: center` so the icon optically centers against the first
|
|
37
|
+
text line (baseline alignment on the parent would otherwise drop the
|
|
38
|
+
icon below the text baseline). The icon inherits foreground via
|
|
39
|
+
`color: currentColor` so it tracks the variant's color shift without
|
|
40
|
+
a second token wiring.
|
|
41
|
+
|
|
42
|
+
`order: -1` is the visual-lead anchor: `ensure()` always appends the
|
|
43
|
+
stamped leading slot AFTER the body text-span (because #syncBodyText
|
|
44
|
+
runs first in render()), so DOM order is [text, icon]. The flex
|
|
45
|
+
`order` flips visual order back to [icon, text] without requiring
|
|
46
|
+
us to splice nodes ahead of consumer-provided body content. Same
|
|
47
|
+
pattern used by alert.css. */
|
|
48
|
+
:scope > [slot="leading"] {
|
|
49
|
+
flex-shrink: 0;
|
|
50
|
+
align-self: center;
|
|
51
|
+
color: var(--inline-message-icon-fg, var(--inline-message-icon-fg-default));
|
|
52
|
+
--a-icon-size: var(--inline-message-icon-size, var(--inline-message-icon-size-default));
|
|
53
|
+
order: -1;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/* ── Variants ──
|
|
57
|
+
Token-only: severity changes foreground color (matched icon comes from
|
|
58
|
+
the variant's default in inline-message.class.js). No padding / display / layout
|
|
59
|
+
changes — these are variants, not modes (per css-patterns.md). */
|
|
60
|
+
:scope[variant="info"] {
|
|
61
|
+
--inline-message-fg-default: var(--a-info-text);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
:scope[variant="success"] {
|
|
65
|
+
--inline-message-fg-default: var(--a-success-text);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
:scope[variant="warning"] {
|
|
69
|
+
--inline-message-fg-default: var(--a-warning-text);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
:scope[variant="danger"] {
|
|
73
|
+
--inline-message-fg-default: var(--a-danger-text);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `<inline-message-ui>` — In-flow message glyph + text used in form-field rows for validation
|
|
3
|
+
feedback, hint copy, and inline confirmations. Distinguished from
|
|
4
|
+
<alert-ui> (banner / surface-bearing notice) by carrying no surface
|
|
5
|
+
fill, no border, no padding box — severity is foreground color +
|
|
6
|
+
icon only. Variants map to severity (info / success / warning /
|
|
7
|
+
danger). Nests inside <field-ui>, <col-ui>, <row-ui> without
|
|
8
|
+
breaking field rhythm. Non-interactive annotation only.
|
|
9
|
+
|
|
10
|
+
*
|
|
11
|
+
* @see https://ui-kit.exe.xyz/site/components/inline-message
|
|
12
|
+
*
|
|
13
|
+
* Type declarations generated by scripts/build/dts-codegen.mjs from
|
|
14
|
+
* the component's `.a2ui.json` sidecar(s). Edit the source `.yaml`,
|
|
15
|
+
* run `npm run build:components`, then `npm run codegen:dts` to
|
|
16
|
+
* regenerate; or hand-author this file fully if rich event types are
|
|
17
|
+
* needed beyond what the yaml `events:` block can express.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
import { UIElement } from '../../core/element.js';
|
|
21
|
+
|
|
22
|
+
export class UIInlineMessage extends UIElement {
|
|
23
|
+
/** Phosphor glyph override; each [variant] ships a sensible default (info / check-circle / warning / x-circle). */
|
|
24
|
+
icon: string;
|
|
25
|
+
/** Sets `aria-live` on the host for dynamic message updates. Empty = no live region (static annotation). */
|
|
26
|
+
live: '' | 'polite' | 'assertive';
|
|
27
|
+
/** Single-line message text. Default-slot content wins when present. */
|
|
28
|
+
text: string;
|
|
29
|
+
/** Semantic severity tone — drives icon + foreground color. Default carries no leading icon (pure hint copy). */
|
|
30
|
+
variant: string;
|
|
31
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# inline-message — Examples
|
|
2
|
+
|
|
3
|
+
## variant
|
|
4
|
+
|
|
5
|
+
```html
|
|
6
|
+
<inline-message-ui text="At least 8 characters"></inline-message-ui>
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## icon
|
|
10
|
+
|
|
11
|
+
```html
|
|
12
|
+
<inline-message-ui icon="lightbulb" text="Tip: use a passphrase, not a password"></inline-message-ui>
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## live
|
|
16
|
+
|
|
17
|
+
```html
|
|
18
|
+
<inline-message-ui variant="success" live="polite" text="Saved"></inline-message-ui>
|
|
19
|
+
```
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `<inline-message-ui>` — auto-registers the tag on import.
|
|
3
|
+
*
|
|
4
|
+
* For non-side-effect class import (test isolation, tag override), use
|
|
5
|
+
* the `class` subpath:
|
|
6
|
+
*
|
|
7
|
+
* import { UIInlineMessage } from '@adia-ai/web-components/components/inline-message/class';
|
|
8
|
+
*
|
|
9
|
+
* @see ../../USAGE.md#registration--auto-vs-explicit
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import { defineIfFree } from '../../core/register.js';
|
|
13
|
+
import { UIInlineMessage } from './inline-message.class.js';
|
|
14
|
+
|
|
15
|
+
defineIfFree('inline-message-ui', UIInlineMessage);
|
|
16
|
+
|
|
17
|
+
export { UIInlineMessage };
|