@adia-ai/web-components 0.6.36 → 0.6.38
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 +48 -1
- package/components/accordion/accordion-item.a2ui.json +3 -0
- package/components/accordion/accordion-item.yaml +5 -0
- package/components/action-list/action-item.a2ui.json +5 -1
- package/components/action-list/action-item.yaml +7 -0
- package/components/badge/badge.a2ui.json +10 -0
- package/components/badge/badge.css +70 -0
- package/components/badge/badge.yaml +20 -0
- package/components/blockquote/blockquote.a2ui.json +121 -0
- package/components/blockquote/blockquote.class.js +68 -0
- package/components/blockquote/blockquote.css +46 -0
- package/components/blockquote/blockquote.d.ts +31 -0
- package/components/blockquote/blockquote.js +17 -0
- package/components/blockquote/blockquote.yaml +124 -0
- package/components/button/button.css +11 -3
- package/components/calendar-picker/calendar-picker.a2ui.json +15 -0
- package/components/calendar-picker/calendar-picker.class.js +7 -1
- package/components/calendar-picker/calendar-picker.yaml +14 -0
- package/components/card/card.a2ui.json +17 -1
- package/components/card/card.yaml +24 -1
- package/components/color-input/color-input.a2ui.json +2 -2
- package/components/color-input/color-input.class.js +9 -2
- package/components/color-input/color-input.yaml +2 -2
- package/components/combobox/combobox.class.js +4 -0
- package/components/context-menu/context-menu.a2ui.json +159 -0
- package/components/context-menu/context-menu.class.js +275 -0
- package/components/context-menu/context-menu.css +56 -0
- package/components/context-menu/context-menu.d.ts +70 -0
- package/components/context-menu/context-menu.js +17 -0
- package/components/context-menu/context-menu.yaml +136 -0
- package/components/date-range-picker/date-range-picker.a2ui.json +15 -0
- package/components/date-range-picker/date-range-picker.class.js +2 -0
- package/components/date-range-picker/date-range-picker.yaml +14 -0
- package/components/datetime-picker/datetime-picker.a2ui.json +15 -0
- package/components/datetime-picker/datetime-picker.class.js +3 -1
- package/components/datetime-picker/datetime-picker.d.ts +2 -0
- package/components/datetime-picker/datetime-picker.yaml +14 -0
- package/components/empty-state/empty-state.a2ui.json +9 -0
- package/components/empty-state/empty-state.class.js +2 -0
- package/components/empty-state/empty-state.yaml +15 -0
- package/components/feed/feed-item.a2ui.json +5 -0
- package/components/feed/feed-item.yaml +10 -0
- package/components/feed/feed.class.js +13 -5
- package/components/feed/feed.css +14 -0
- package/components/field/field.a2ui.json +6 -0
- package/components/field/field.yaml +10 -0
- package/components/index.js +11 -0
- package/components/inline-edit/inline-edit.a2ui.json +159 -0
- package/components/inline-edit/inline-edit.class.js +184 -0
- package/components/inline-edit/inline-edit.css +62 -0
- package/components/inline-edit/inline-edit.d.ts +52 -0
- package/components/inline-edit/inline-edit.js +12 -0
- package/components/inline-edit/inline-edit.yaml +125 -0
- package/components/integration-card/integration-card.class.js +9 -0
- package/components/integration-card/integration-card.test.js +4 -3
- package/components/list/list-item.a2ui.json +8 -1
- package/components/list/list-item.yaml +12 -0
- package/components/list/list.css +36 -6
- package/components/mark/mark.a2ui.json +109 -0
- package/components/mark/mark.class.js +22 -0
- package/components/mark/mark.css +39 -0
- package/components/mark/mark.d.ts +27 -0
- package/components/mark/mark.js +12 -0
- package/components/mark/mark.yaml +87 -0
- package/components/modal/modal.a2ui.json +9 -0
- package/components/modal/modal.yaml +14 -0
- package/components/nav-group/nav-group.a2ui.json +3 -0
- package/components/nav-group/nav-group.css +7 -1
- package/components/nav-group/nav-group.yaml +5 -0
- package/components/nav-item/nav-item.a2ui.json +3 -0
- package/components/nav-item/nav-item.yaml +5 -0
- package/components/number-format/number-format.a2ui.json +180 -0
- package/components/number-format/number-format.class.js +96 -0
- package/components/number-format/number-format.css +18 -0
- package/components/number-format/number-format.d.ts +68 -0
- package/components/number-format/number-format.js +17 -0
- package/components/number-format/number-format.yaml +204 -0
- package/components/pagination/pagination.a2ui.json +19 -2
- package/components/pagination/pagination.class.js +90 -37
- package/components/pagination/pagination.css +32 -127
- package/components/pagination/pagination.d.ts +8 -2
- package/components/pagination/pagination.test.js +195 -0
- package/components/pagination/pagination.yaml +22 -1
- package/components/password-strength/password-strength.a2ui.json +152 -0
- package/components/password-strength/password-strength.class.js +157 -0
- package/components/password-strength/password-strength.css +80 -0
- package/components/password-strength/password-strength.d.ts +59 -0
- package/components/password-strength/password-strength.js +17 -0
- package/components/password-strength/password-strength.yaml +153 -0
- package/components/popover/popover.css +43 -23
- package/components/popover/popover.yaml +8 -4
- package/components/qr-code/QR-TEST.svg +4 -0
- package/components/qr-code/qr-code.a2ui.json +154 -0
- package/components/qr-code/qr-code.class.js +129 -0
- package/components/qr-code/qr-code.css +41 -0
- package/components/qr-code/qr-code.d.ts +83 -0
- package/components/qr-code/qr-code.js +17 -0
- package/components/qr-code/qr-code.yaml +203 -0
- package/components/qr-code/qr-encoder.js +633 -0
- package/components/relative-time/relative-time.a2ui.json +120 -0
- package/components/relative-time/relative-time.class.js +136 -0
- package/components/relative-time/relative-time.css +22 -0
- package/components/relative-time/relative-time.d.ts +51 -0
- package/components/relative-time/relative-time.js +17 -0
- package/components/relative-time/relative-time.yaml +133 -0
- package/components/segmented/segmented.class.js +15 -3
- package/components/select/select.a2ui.json +3 -0
- package/components/select/select.class.js +4 -0
- package/components/select/select.yaml +5 -0
- package/components/skip-nav/skip-nav.a2ui.json +92 -0
- package/components/skip-nav/skip-nav.class.js +45 -0
- package/components/skip-nav/skip-nav.css +54 -0
- package/components/skip-nav/skip-nav.d.ts +27 -0
- package/components/skip-nav/skip-nav.js +12 -0
- package/components/skip-nav/skip-nav.yaml +68 -0
- package/components/slider/slider.a2ui.json +22 -1
- package/components/slider/slider.class.js +264 -122
- package/components/slider/slider.css +82 -2
- package/components/slider/slider.d.ts +19 -3
- package/components/slider/slider.test.js +55 -0
- package/components/slider/slider.yaml +38 -6
- package/components/stat/stat.css +18 -14
- package/components/stepper/stepper-item.a2ui.json +3 -0
- package/components/stepper/stepper-item.yaml +5 -0
- package/components/table/table.class.js +29 -6
- package/components/table/table.css +31 -4
- package/components/table-toolbar/table-toolbar.class.js +3 -1
- package/components/tag/tag.a2ui.json +3 -2
- package/components/tag/tag.css +35 -11
- package/components/tag/tag.d.ts +14 -0
- package/components/tag/tag.test.js +35 -11
- package/components/tag/tag.yaml +13 -7
- package/components/timeline/timeline-item.a2ui.json +8 -1
- package/components/timeline/timeline-item.yaml +12 -0
- package/components/toast/toast.class.js +12 -4
- package/components/toc/toc.a2ui.json +159 -0
- package/components/toc/toc.class.js +222 -0
- package/components/toc/toc.css +92 -0
- package/components/toc/toc.d.ts +61 -0
- package/components/toc/toc.js +17 -0
- package/components/toc/toc.yaml +180 -0
- package/components/toolbar/toolbar.class.js +3 -0
- package/components/tree/tree-item.a2ui.json +5 -1
- package/components/tree/tree-item.yaml +7 -0
- package/components/tree/tree.a2ui.json +3 -0
- package/components/tree/tree.yaml +5 -0
- package/components/visually-hidden/visually-hidden.a2ui.json +71 -0
- package/components/visually-hidden/visually-hidden.class.js +14 -0
- package/components/visually-hidden/visually-hidden.css +25 -0
- package/components/visually-hidden/visually-hidden.d.ts +26 -0
- package/components/visually-hidden/visually-hidden.js +12 -0
- package/components/visually-hidden/visually-hidden.yaml +54 -0
- package/core/anchor.js +19 -3
- package/dist/web-components.min.css +1 -1
- package/dist/web-components.min.js +100 -89
- package/package.json +1 -1
- package/styles/colors/semantics.css +11 -2
- package/styles/components.css +11 -0
- package/styles/resets.css +10 -0
package/components/list/list.css
CHANGED
|
@@ -126,19 +126,27 @@
|
|
|
126
126
|
min-height: var(--a-space-6);
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
-
|
|
129
|
+
/* Slot positioning uses descendant (not direct-child >) because the
|
|
130
|
+
template engine wraps `${...}` conditional renders in
|
|
131
|
+
<span style="display:contents"> housekeeping nodes — so slot="…"
|
|
132
|
+
children land as grandchildren in template-rendered hosts.
|
|
133
|
+
display:contents makes the wrapper layout-transparent (the grid
|
|
134
|
+
places the inner element), but CSS selectors still see the wrapper
|
|
135
|
+
as a real node. Descendant selectors handle both shapes (direct
|
|
136
|
+
authored children + template-engine-wrapped conditionals). */
|
|
137
|
+
:scope [slot="icon"] {
|
|
130
138
|
grid-column: 1;
|
|
131
139
|
grid-row: 1 / -1;
|
|
132
140
|
align-self: center;
|
|
133
141
|
color: var(--list-item-icon-color);
|
|
134
142
|
}
|
|
135
143
|
|
|
136
|
-
:scope
|
|
144
|
+
:scope [slot="text"] {
|
|
137
145
|
grid-column: 2;
|
|
138
146
|
grid-row: 1;
|
|
139
147
|
}
|
|
140
148
|
|
|
141
|
-
:scope
|
|
149
|
+
:scope [slot="description"] {
|
|
142
150
|
grid-column: 2;
|
|
143
151
|
grid-row: 2;
|
|
144
152
|
color: var(--list-item-desc-color);
|
|
@@ -146,11 +154,33 @@
|
|
|
146
154
|
line-height: 1.3;
|
|
147
155
|
}
|
|
148
156
|
|
|
157
|
+
/* When a [slot="action"] child is present, the grid becomes 3-column:
|
|
158
|
+
icon | content | action. The :has() selector promotes the template
|
|
159
|
+
only when an action exists, so 2-column layouts stay unaffected.
|
|
160
|
+
Action is right-aligned + vertically centered (spans both content rows).
|
|
161
|
+
Used by onboarding-checklist-ui item rows + any consumer that needs an
|
|
162
|
+
end-aligned action button on a list-item row.
|
|
163
|
+
NOTE: NOT using `> [slot="action"]` (direct-child) — the template
|
|
164
|
+
engine wraps conditional `${...}` renders in <span style="display:
|
|
165
|
+
contents"> housekeeping nodes, so slot="action" lands as a grandchild
|
|
166
|
+
in template-rendered hosts. display:contents makes the wrapper a
|
|
167
|
+
transparent grid pass-through at layout time, but CSS selectors still
|
|
168
|
+
see it as a node. Descendant combinator handles both shapes. */
|
|
169
|
+
:scope:has([slot="action"]) {
|
|
170
|
+
grid-template-columns: auto 1fr auto;
|
|
171
|
+
}
|
|
172
|
+
:scope [slot="action"] {
|
|
173
|
+
grid-column: 3;
|
|
174
|
+
grid-row: 1 / -1;
|
|
175
|
+
align-self: center;
|
|
176
|
+
justify-self: end;
|
|
177
|
+
}
|
|
178
|
+
|
|
149
179
|
/* Custom-content escape hatch — consumer authored a [slot="content"]
|
|
150
180
|
child, the auto-stamp early-returned, and the consumer owns the
|
|
151
181
|
full body. Span all columns so the consumer's layout isn't boxed
|
|
152
182
|
into the content column. */
|
|
153
|
-
:scope
|
|
183
|
+
:scope [slot="content"] {
|
|
154
184
|
grid-column: 1 / -1;
|
|
155
185
|
}
|
|
156
186
|
|
|
@@ -167,8 +197,8 @@
|
|
|
167
197
|
box-shadow: inset 2px 0 0 var(--a-accent-strong);
|
|
168
198
|
}
|
|
169
199
|
|
|
170
|
-
:scope[data-active]
|
|
171
|
-
:scope[data-active]
|
|
200
|
+
:scope[data-active] [slot="icon"],
|
|
201
|
+
:scope[data-active] [slot="description"] {
|
|
172
202
|
color: var(--a-accent-strong);
|
|
173
203
|
}
|
|
174
204
|
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://adiaui.dev/a2ui/v0_9/components/Mark.json",
|
|
4
|
+
"title": "Mark",
|
|
5
|
+
"description": "Highlighted inline text — token-driven theme-aware wrapper around the\nnative `<mark>` semantic. Use for search-result match highlighting,\ndiff additions in prose, \"new since last visit\" emphasis, and any\ninline text that needs a visual rail without changing its weight.\n\nDistinct from `<text-ui strong>` (semantic emphasis via weight) and\nfrom `<tag-ui>` (block-shaped pill chrome). mark-ui keeps the inline\ntext flow intact — same line-height, same baseline — just paints a\nbackground highlight behind the matched span.\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": "Mark"
|
|
18
|
+
},
|
|
19
|
+
"variant": {
|
|
20
|
+
"description": "Highlight color variant. Default `warning` is the conventional yellow-marker tone.",
|
|
21
|
+
"type": "string",
|
|
22
|
+
"enum": [
|
|
23
|
+
"warning",
|
|
24
|
+
"info",
|
|
25
|
+
"success",
|
|
26
|
+
"danger",
|
|
27
|
+
"muted"
|
|
28
|
+
],
|
|
29
|
+
"default": "warning"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"required": [
|
|
33
|
+
"component"
|
|
34
|
+
],
|
|
35
|
+
"unevaluatedProperties": false,
|
|
36
|
+
"x-adiaui": {
|
|
37
|
+
"anti_patterns": [
|
|
38
|
+
{
|
|
39
|
+
"fix": "<mark-ui>matched</mark-ui> — same semantic role but theme-aware.",
|
|
40
|
+
"why": "Native <mark> uses UA default (yellow-on-white) that doesn't adapt to theme — invisible in dark mode + jarring in light mode.",
|
|
41
|
+
"wrong": "<mark>matched</mark>"
|
|
42
|
+
}
|
|
43
|
+
],
|
|
44
|
+
"category": "typography",
|
|
45
|
+
"composes": [],
|
|
46
|
+
"events": {},
|
|
47
|
+
"examples": [
|
|
48
|
+
{
|
|
49
|
+
"description": "Highlight the search query within a result title.",
|
|
50
|
+
"a2ui": "[\n { \"id\": \"row\", \"component\": \"Row\", \"children\": [\"pre\", \"mk\", \"post\"] },\n { \"id\": \"pre\", \"component\": \"Text\", \"textContent\": \"Quarterly \" },\n { \"id\": \"mk\", \"component\": \"Mark\", \"textContent\": \"revenue\" },\n { \"id\": \"post\", \"component\": \"Text\", \"textContent\": \" report — Q4 2025\" }\n]\n",
|
|
51
|
+
"name": "search-match"
|
|
52
|
+
}
|
|
53
|
+
],
|
|
54
|
+
"keywords": [
|
|
55
|
+
"mark",
|
|
56
|
+
"highlight",
|
|
57
|
+
"search-match",
|
|
58
|
+
"emphasis"
|
|
59
|
+
],
|
|
60
|
+
"name": "UIMark",
|
|
61
|
+
"related": [
|
|
62
|
+
"text",
|
|
63
|
+
"tag"
|
|
64
|
+
],
|
|
65
|
+
"slots": {
|
|
66
|
+
"default": {
|
|
67
|
+
"description": "The text content to highlight (plain text or inline elements)."
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"states": [
|
|
71
|
+
{
|
|
72
|
+
"description": "Default — highlighted background painted behind the slotted text.",
|
|
73
|
+
"name": "idle"
|
|
74
|
+
}
|
|
75
|
+
],
|
|
76
|
+
"status": "stable",
|
|
77
|
+
"synonyms": {
|
|
78
|
+
"highlight": [
|
|
79
|
+
"mark",
|
|
80
|
+
"emphasis"
|
|
81
|
+
],
|
|
82
|
+
"search-match": [
|
|
83
|
+
"mark",
|
|
84
|
+
"highlight"
|
|
85
|
+
]
|
|
86
|
+
},
|
|
87
|
+
"tag": "mark-ui",
|
|
88
|
+
"tokens": {
|
|
89
|
+
"--mark-bg": {
|
|
90
|
+
"description": "Background color of the highlight.",
|
|
91
|
+
"default": "var(--a-warning-muted)"
|
|
92
|
+
},
|
|
93
|
+
"--mark-fg": {
|
|
94
|
+
"description": "Foreground (text) color inside the highlight.",
|
|
95
|
+
"default": "var(--a-warning-text)"
|
|
96
|
+
},
|
|
97
|
+
"--mark-px": {
|
|
98
|
+
"description": "Horizontal padding around the highlighted text.",
|
|
99
|
+
"default": "var(--a-space-0-5)"
|
|
100
|
+
},
|
|
101
|
+
"--mark-radius": {
|
|
102
|
+
"description": "Border radius of the highlight box.",
|
|
103
|
+
"default": "var(--a-radius-xs)"
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
"traits": [],
|
|
107
|
+
"version": 1
|
|
108
|
+
}
|
|
109
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `<mark-ui>` — token-driven inline text highlight (search-match,
|
|
3
|
+
* "new since", diff prose). Theme-aware wrapper around the native
|
|
4
|
+
* `<mark>` semantic role. Pure CSS atom — no template, no JS behavior.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { UIElement } from '../../core/element.js';
|
|
8
|
+
|
|
9
|
+
export class UIMark extends UIElement {
|
|
10
|
+
static properties = {
|
|
11
|
+
variant: { type: String, default: 'warning', reflect: true }, // warning | info | success | danger | muted
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
static template = () => null;
|
|
15
|
+
|
|
16
|
+
connected() {
|
|
17
|
+
super.connected();
|
|
18
|
+
// Inherit the <mark> role for screen readers — "highlighted" / "marked"
|
|
19
|
+
// is the conventional AT announcement for search matches.
|
|
20
|
+
if (!this.hasAttribute('role')) this.setAttribute('role', 'mark');
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
@scope (mark-ui) {
|
|
2
|
+
:where(:scope) {
|
|
3
|
+
--mark-bg-default: var(--a-warning-muted);
|
|
4
|
+
--mark-fg-default: var(--a-warning-text);
|
|
5
|
+
--mark-px-default: var(--a-space-0-5);
|
|
6
|
+
--mark-radius-default: var(--a-radius-xs);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
:scope {
|
|
10
|
+
/* Inline so it sits in normal text flow without breaking baselines.
|
|
11
|
+
Padding-inline only — vertical padding would push line-height. */
|
|
12
|
+
display: inline;
|
|
13
|
+
box-sizing: border-box;
|
|
14
|
+
padding-inline: var(--mark-px, var(--mark-px-default));
|
|
15
|
+
background: var(--mark-bg, var(--mark-bg-default));
|
|
16
|
+
color: var(--mark-fg, var(--mark-fg-default));
|
|
17
|
+
border-radius: var(--mark-radius, var(--mark-radius-default));
|
|
18
|
+
/* Preserve text decoration from ancestors (e.g. link underlines) */
|
|
19
|
+
text-decoration: inherit;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/* Variants — same role × state pair as alert-ui / tag-ui */
|
|
23
|
+
:scope[variant="info"] {
|
|
24
|
+
--mark-bg-default: var(--a-info-muted);
|
|
25
|
+
--mark-fg-default: var(--a-info-text);
|
|
26
|
+
}
|
|
27
|
+
:scope[variant="success"] {
|
|
28
|
+
--mark-bg-default: var(--a-success-muted);
|
|
29
|
+
--mark-fg-default: var(--a-success-text);
|
|
30
|
+
}
|
|
31
|
+
:scope[variant="danger"] {
|
|
32
|
+
--mark-bg-default: var(--a-danger-muted);
|
|
33
|
+
--mark-fg-default: var(--a-danger-text);
|
|
34
|
+
}
|
|
35
|
+
:scope[variant="muted"] {
|
|
36
|
+
--mark-bg-default: var(--a-bg-muted);
|
|
37
|
+
--mark-fg-default: var(--a-fg);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `<mark-ui>` — Highlighted inline text — token-driven theme-aware wrapper around the
|
|
3
|
+
native `<mark>` semantic. Use for search-result match highlighting,
|
|
4
|
+
diff additions in prose, "new since last visit" emphasis, and any
|
|
5
|
+
inline text that needs a visual rail without changing its weight.
|
|
6
|
+
|
|
7
|
+
Distinct from `<text-ui strong>` (semantic emphasis via weight) and
|
|
8
|
+
from `<tag-ui>` (block-shaped pill chrome). mark-ui keeps the inline
|
|
9
|
+
text flow intact — same line-height, same baseline — just paints a
|
|
10
|
+
background highlight behind the matched span.
|
|
11
|
+
|
|
12
|
+
*
|
|
13
|
+
* @see https://ui-kit.exe.xyz/site/components/mark
|
|
14
|
+
*
|
|
15
|
+
* Type declarations generated by scripts/build/dts-codegen.mjs from
|
|
16
|
+
* the component's `.a2ui.json` sidecar(s). Edit the source `.yaml`,
|
|
17
|
+
* run `npm run build:components`, then `npm run codegen:dts` to
|
|
18
|
+
* regenerate; or hand-author this file fully if rich event types are
|
|
19
|
+
* needed beyond what the yaml `events:` block can express.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
import { UIElement } from '../../core/element.js';
|
|
23
|
+
|
|
24
|
+
export class UIMark extends UIElement {
|
|
25
|
+
/** Highlight color variant. Default `warning` is the conventional yellow-marker tone. */
|
|
26
|
+
variant: 'warning' | 'info' | 'success' | 'danger' | 'muted';
|
|
27
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `<mark-ui>` — auto-registers the tag on import.
|
|
3
|
+
*
|
|
4
|
+
* @see ../../USAGE.md#registration--auto-vs-explicit
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { defineIfFree } from '../../core/register.js';
|
|
8
|
+
import { UIMark } from './mark.class.js';
|
|
9
|
+
|
|
10
|
+
defineIfFree('mark-ui', UIMark);
|
|
11
|
+
|
|
12
|
+
export { UIMark };
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
$schema: ../../../../scripts/schemas/component.yaml.schema.json
|
|
2
|
+
name: UIMark
|
|
3
|
+
tag: mark-ui
|
|
4
|
+
status: stable
|
|
5
|
+
component: Mark
|
|
6
|
+
category: typography
|
|
7
|
+
version: 1
|
|
8
|
+
description: |
|
|
9
|
+
Highlighted inline text — token-driven theme-aware wrapper around the
|
|
10
|
+
native `<mark>` semantic. Use for search-result match highlighting,
|
|
11
|
+
diff additions in prose, "new since last visit" emphasis, and any
|
|
12
|
+
inline text that needs a visual rail without changing its weight.
|
|
13
|
+
|
|
14
|
+
Distinct from `<text-ui strong>` (semantic emphasis via weight) and
|
|
15
|
+
from `<tag-ui>` (block-shaped pill chrome). mark-ui keeps the inline
|
|
16
|
+
text flow intact — same line-height, same baseline — just paints a
|
|
17
|
+
background highlight behind the matched span.
|
|
18
|
+
props:
|
|
19
|
+
variant:
|
|
20
|
+
description: Highlight color variant. Default `warning` is the conventional yellow-marker tone.
|
|
21
|
+
type: string
|
|
22
|
+
default: warning
|
|
23
|
+
enum:
|
|
24
|
+
- warning
|
|
25
|
+
- info
|
|
26
|
+
- success
|
|
27
|
+
- danger
|
|
28
|
+
- muted
|
|
29
|
+
reflect: true
|
|
30
|
+
events: {}
|
|
31
|
+
slots:
|
|
32
|
+
default:
|
|
33
|
+
description: The text content to highlight (plain text or inline elements).
|
|
34
|
+
states:
|
|
35
|
+
- name: idle
|
|
36
|
+
description: Default — highlighted background painted behind the slotted text.
|
|
37
|
+
traits: []
|
|
38
|
+
tokens:
|
|
39
|
+
--mark-bg:
|
|
40
|
+
description: Background color of the highlight.
|
|
41
|
+
default: var(--a-warning-muted)
|
|
42
|
+
--mark-fg:
|
|
43
|
+
description: Foreground (text) color inside the highlight.
|
|
44
|
+
default: var(--a-warning-text)
|
|
45
|
+
--mark-px:
|
|
46
|
+
description: Horizontal padding around the highlighted text.
|
|
47
|
+
default: var(--a-space-0-5)
|
|
48
|
+
--mark-radius:
|
|
49
|
+
description: Border radius of the highlight box.
|
|
50
|
+
default: var(--a-radius-xs)
|
|
51
|
+
a2ui:
|
|
52
|
+
rules:
|
|
53
|
+
- rule: 'Use mark-ui for search-result match highlighting — wrap the matched substring in <mark-ui> within the surrounding text. Inline; preserves text flow.'
|
|
54
|
+
reason: 'Search-result highlight pattern.'
|
|
55
|
+
- rule: 'variant=warning (default) is the conventional yellow-marker tone; info for brand-color highlights; success for "new since" / "added" emphasis; danger for "removed" / "deleted-line" in diff prose.'
|
|
56
|
+
reason: 'Semantic variant vocabulary.'
|
|
57
|
+
- rule: 'Distinct from <text-ui strong> (weight emphasis), <tag-ui> (block pill), <code-ui> (monospace). mark-ui is specifically the "visual rail behind matched text" use case.'
|
|
58
|
+
reason: 'Sibling-component boundary.'
|
|
59
|
+
anti_patterns:
|
|
60
|
+
- wrong: '<mark>matched</mark>'
|
|
61
|
+
why: 'Native <mark> uses UA default (yellow-on-white) that doesn''t adapt to theme — invisible in dark mode + jarring in light mode.'
|
|
62
|
+
fix: '<mark-ui>matched</mark-ui> — same semantic role but theme-aware.'
|
|
63
|
+
examples:
|
|
64
|
+
- name: search-match
|
|
65
|
+
description: Highlight the search query within a result title.
|
|
66
|
+
a2ui: |
|
|
67
|
+
[
|
|
68
|
+
{ "id": "row", "component": "Row", "children": ["pre", "mk", "post"] },
|
|
69
|
+
{ "id": "pre", "component": "Text", "textContent": "Quarterly " },
|
|
70
|
+
{ "id": "mk", "component": "Mark", "textContent": "revenue" },
|
|
71
|
+
{ "id": "post", "component": "Text", "textContent": " report — Q4 2025" }
|
|
72
|
+
]
|
|
73
|
+
keywords:
|
|
74
|
+
- mark
|
|
75
|
+
- highlight
|
|
76
|
+
- search-match
|
|
77
|
+
- emphasis
|
|
78
|
+
synonyms:
|
|
79
|
+
highlight:
|
|
80
|
+
- mark
|
|
81
|
+
- emphasis
|
|
82
|
+
search-match:
|
|
83
|
+
- mark
|
|
84
|
+
- highlight
|
|
85
|
+
related:
|
|
86
|
+
- text
|
|
87
|
+
- tag
|
|
@@ -76,6 +76,15 @@
|
|
|
76
76
|
"slots": {
|
|
77
77
|
"default": {
|
|
78
78
|
"description": "Content placed inside the modal surface. Accepts any elements (card-ui, command-ui, custom markup)."
|
|
79
|
+
},
|
|
80
|
+
"body": {
|
|
81
|
+
"description": "Main body region for prose, forms, or arbitrary content. Sits between header and footer; scrolls when content overflows."
|
|
82
|
+
},
|
|
83
|
+
"footer": {
|
|
84
|
+
"description": "Optional footer region rendered below the body, typically for action buttons. Author-fills with Confirm / Cancel buttons or similar trailing affordances."
|
|
85
|
+
},
|
|
86
|
+
"header": {
|
|
87
|
+
"description": "Optional header region rendered above the body. Author-fillable with title + supporting markup. CSS positions it at the top of the modal surface with consistent padding + the dismiss-close affordance."
|
|
79
88
|
}
|
|
80
89
|
},
|
|
81
90
|
"states": [
|
|
@@ -45,6 +45,20 @@ events:
|
|
|
45
45
|
slots:
|
|
46
46
|
default:
|
|
47
47
|
description: Content placed inside the modal surface. Accepts any elements (card-ui, command-ui, custom markup).
|
|
48
|
+
header:
|
|
49
|
+
description: >-
|
|
50
|
+
Optional header region rendered above the body. Author-fillable with
|
|
51
|
+
title + supporting markup. CSS positions it at the top of the modal
|
|
52
|
+
surface with consistent padding + the dismiss-close affordance.
|
|
53
|
+
body:
|
|
54
|
+
description: >-
|
|
55
|
+
Main body region for prose, forms, or arbitrary content. Sits between
|
|
56
|
+
header and footer; scrolls when content overflows.
|
|
57
|
+
footer:
|
|
58
|
+
description: >-
|
|
59
|
+
Optional footer region rendered below the body, typically for action
|
|
60
|
+
buttons. Author-fills with Confirm / Cancel buttons or similar trailing
|
|
61
|
+
affordances.
|
|
48
62
|
states:
|
|
49
63
|
- name: idle
|
|
50
64
|
description: Default, ready for interaction.
|
|
@@ -98,6 +98,9 @@
|
|
|
98
98
|
},
|
|
99
99
|
"header": {
|
|
100
100
|
"description": "Optional custom header. Auto-generated when missing."
|
|
101
|
+
},
|
|
102
|
+
"icon": {
|
|
103
|
+
"description": "Override the leading [icon] glyph in the auto-generated header with a custom slotted element. Mutually exclusive with the [icon] attribute."
|
|
101
104
|
}
|
|
102
105
|
},
|
|
103
106
|
"states": [
|
|
@@ -26,7 +26,13 @@
|
|
|
26
26
|
box-sizing: border-box;
|
|
27
27
|
display: flex;
|
|
28
28
|
flex-direction: column;
|
|
29
|
-
gap
|
|
29
|
+
/* Fallback to --nav-gap-default (cascaded from the ancestor nav-ui
|
|
30
|
+
where it's defined) so child nav-items get the spec spacing even
|
|
31
|
+
when the override token --nav-gap isn't explicitly set. Without
|
|
32
|
+
the fallback `var(--nav-gap)` resolved to empty → invalid gap →
|
|
33
|
+
items packed at 0 px stride. Reported 2026-05-25; latent since
|
|
34
|
+
Apr-20 snapshot. */
|
|
35
|
+
gap: var(--nav-gap, var(--nav-gap-default, var(--a-space-1)));
|
|
30
36
|
position: relative;
|
|
31
37
|
font-weight: var(--nav-group-text-weight);
|
|
32
38
|
}
|
|
@@ -63,6 +63,11 @@ slots:
|
|
|
63
63
|
description: "Children — typically <nav-item-ui> rows."
|
|
64
64
|
header:
|
|
65
65
|
description: "Optional custom header. Auto-generated when missing."
|
|
66
|
+
icon:
|
|
67
|
+
description: >-
|
|
68
|
+
Override the leading [icon] glyph in the auto-generated header
|
|
69
|
+
with a custom slotted element. Mutually exclusive with the [icon]
|
|
70
|
+
attribute.
|
|
66
71
|
|
|
67
72
|
states:
|
|
68
73
|
- name: closed
|
|
@@ -105,6 +105,9 @@
|
|
|
105
105
|
"slots": {
|
|
106
106
|
"default": {
|
|
107
107
|
"description": "Optional override of the default icon + text + badge stamping."
|
|
108
|
+
},
|
|
109
|
+
"icon": {
|
|
110
|
+
"description": "Override the leading [icon] glyph with a custom slotted element (custom icon-ui, image, avatar). Mutually exclusive with the [icon] attribute — slot child wins."
|
|
108
111
|
}
|
|
109
112
|
},
|
|
110
113
|
"states": [
|
|
@@ -68,6 +68,11 @@ events:
|
|
|
68
68
|
slots:
|
|
69
69
|
default:
|
|
70
70
|
description: "Optional override of the default icon + text + badge stamping."
|
|
71
|
+
icon:
|
|
72
|
+
description: >-
|
|
73
|
+
Override the leading [icon] glyph with a custom slotted element
|
|
74
|
+
(custom icon-ui, image, avatar). Mutually exclusive with the
|
|
75
|
+
[icon] attribute — slot child wins.
|
|
71
76
|
|
|
72
77
|
states:
|
|
73
78
|
- name: idle
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://adiaui.dev/a2ui/v0_9/components/NumberFormat.json",
|
|
4
|
+
"title": "NumberFormat",
|
|
5
|
+
"description": "Display a numeric value with locale-aware formatting — currency,\npercentage, compact (1.2K / 3.4M), unit, or plain decimal. Wraps\n`Intl.NumberFormat`. Distinct from `<input-ui type=\"number\">`\n(an INPUT primitive); this is a DISPLAY primitive — read-only, no\nform participation, no keyboard handling. Pair with `<stat-ui>` for\nKPI surfaces or use standalone inline within prose.\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
|
+
"compactDisplay": {
|
|
17
|
+
"description": "When [notation=\"compact\"], controls the compact-form length.\n`short` = \"1.2M\" (default); `long` = \"1.2 million\".\n",
|
|
18
|
+
"type": "string",
|
|
19
|
+
"enum": [
|
|
20
|
+
"short",
|
|
21
|
+
"long"
|
|
22
|
+
],
|
|
23
|
+
"default": "short"
|
|
24
|
+
},
|
|
25
|
+
"component": {
|
|
26
|
+
"const": "NumberFormat"
|
|
27
|
+
},
|
|
28
|
+
"currency": {
|
|
29
|
+
"description": "ISO 4217 currency code (e.g. \"USD\", \"EUR\", \"JPY\"). Required when\n[number-style=\"currency\"]; ignored otherwise.\n",
|
|
30
|
+
"type": "string",
|
|
31
|
+
"default": ""
|
|
32
|
+
},
|
|
33
|
+
"locale": {
|
|
34
|
+
"description": "BCP-47 locale tag for the formatter. Empty defaults to the\ndocument locale (`<html lang>`) then to browser default.\n",
|
|
35
|
+
"type": "string",
|
|
36
|
+
"default": ""
|
|
37
|
+
},
|
|
38
|
+
"maximumFractionDigits": {
|
|
39
|
+
"description": "Maximum fractional digits (0–20). Default `2` for decimal/\ncurrency/percent, `1` for compact notation.\n",
|
|
40
|
+
"type": "number",
|
|
41
|
+
"default": 2
|
|
42
|
+
},
|
|
43
|
+
"minimumFractionDigits": {
|
|
44
|
+
"description": "Minimum fractional digits (0–20). Padded with trailing zeros.\nUseful for currency display to force \".00\" suffix.\n",
|
|
45
|
+
"type": "number",
|
|
46
|
+
"default": 0
|
|
47
|
+
},
|
|
48
|
+
"notation": {
|
|
49
|
+
"description": "`Intl.NumberFormat` `notation` option. `standard` is the\nthousands-grouped form (1,234,567); `compact` is the abbreviated\nform (1.2M); `scientific` and `engineering` are the exponent\nforms. Defaults to `standard`.\n",
|
|
50
|
+
"type": "string",
|
|
51
|
+
"enum": [
|
|
52
|
+
"standard",
|
|
53
|
+
"compact",
|
|
54
|
+
"scientific",
|
|
55
|
+
"engineering"
|
|
56
|
+
],
|
|
57
|
+
"default": "standard"
|
|
58
|
+
},
|
|
59
|
+
"numberStyle": {
|
|
60
|
+
"description": "`Intl.NumberFormat` `style` option. `decimal` (default) renders a\nplain number with locale-aware grouping. `currency` requires\n[currency] to be set. `percent` formats 0–1 as 0%–100%. `unit`\nrequires [unit] to be set (e.g. \"kilobyte\", \"celsius\").\n",
|
|
61
|
+
"type": "string",
|
|
62
|
+
"enum": [
|
|
63
|
+
"decimal",
|
|
64
|
+
"currency",
|
|
65
|
+
"percent",
|
|
66
|
+
"unit"
|
|
67
|
+
],
|
|
68
|
+
"default": "decimal"
|
|
69
|
+
},
|
|
70
|
+
"signDisplay": {
|
|
71
|
+
"description": "`Intl.NumberFormat` `signDisplay` option. `auto` (default) shows\n\"−\" for negatives only; `always` shows \"+\" / \"−\"; `exceptZero`\nshows sign for non-zero only; `never` hides signs.\n",
|
|
72
|
+
"type": "string",
|
|
73
|
+
"enum": [
|
|
74
|
+
"auto",
|
|
75
|
+
"always",
|
|
76
|
+
"exceptZero",
|
|
77
|
+
"never"
|
|
78
|
+
],
|
|
79
|
+
"default": "auto"
|
|
80
|
+
},
|
|
81
|
+
"unit": {
|
|
82
|
+
"description": "`Intl.NumberFormat` unit identifier (e.g. \"kilometer-per-hour\",\n\"celsius\", \"byte\"). Required when [number-style=\"unit\"]; ignored\notherwise. See MDN's NumberFormat docs for the valid set.\n",
|
|
83
|
+
"type": "string",
|
|
84
|
+
"default": ""
|
|
85
|
+
},
|
|
86
|
+
"value": {
|
|
87
|
+
"description": "The numeric value to format. Empty string or non-numeric value\nrenders nothing.\n",
|
|
88
|
+
"type": "number",
|
|
89
|
+
"default": 0
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
"required": [
|
|
93
|
+
"component"
|
|
94
|
+
],
|
|
95
|
+
"unevaluatedProperties": false,
|
|
96
|
+
"x-adiaui": {
|
|
97
|
+
"anti_patterns": [
|
|
98
|
+
{
|
|
99
|
+
"fix": "<number-format-ui value=\"0.5\" number-style=\"percent\"></number-format-ui>\n",
|
|
100
|
+
"why": "Renders \"5,000%\" — Intl.NumberFormat percent style multiplies the\ninput by 100. value=50 means \"5000%\".\n",
|
|
101
|
+
"wrong": "<number-format-ui value=\"50\" number-style=\"percent\"></number-format-ui>\n"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"fix": "<number-format-ui value=\"9.99\" number-style=\"currency\" currency=\"USD\"></number-format-ui>\n",
|
|
105
|
+
"why": "Missing [currency] code. Renders nothing rather than producing\nmalformed currency output.\n",
|
|
106
|
+
"wrong": "<number-format-ui value=\"9.99\" number-style=\"currency\"></number-format-ui>\n"
|
|
107
|
+
}
|
|
108
|
+
],
|
|
109
|
+
"category": "display",
|
|
110
|
+
"composes": [],
|
|
111
|
+
"events": {},
|
|
112
|
+
"examples": [
|
|
113
|
+
{
|
|
114
|
+
"description": "Plain locale-grouped number — default style.",
|
|
115
|
+
"a2ui": "[\n {\n \"id\": \"n\",\n \"component\": \"NumberFormat\",\n \"value\": 1234567.89\n }\n]\n",
|
|
116
|
+
"name": "decimal"
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"description": "USD currency display.",
|
|
120
|
+
"a2ui": "[\n {\n \"id\": \"n\",\n \"component\": \"NumberFormat\",\n \"value\": 1299.99,\n \"numberStyle\": \"currency\",\n \"currency\": \"USD\"\n }\n]\n",
|
|
121
|
+
"name": "currency"
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"description": "Fraction → percent (0.876 → 87.6%).",
|
|
125
|
+
"a2ui": "[\n {\n \"id\": \"n\",\n \"component\": \"NumberFormat\",\n \"value\": 0.876,\n \"numberStyle\": \"percent\",\n \"maximumFractionDigits\": 1\n }\n]\n",
|
|
126
|
+
"name": "percent"
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"description": "Compact-form (1.2M, 3.4K).",
|
|
130
|
+
"a2ui": "[\n {\n \"id\": \"n\",\n \"component\": \"NumberFormat\",\n \"value\": 1234567,\n \"notation\": \"compact\"\n }\n]\n",
|
|
131
|
+
"name": "compact"
|
|
132
|
+
}
|
|
133
|
+
],
|
|
134
|
+
"keywords": [
|
|
135
|
+
"number-format",
|
|
136
|
+
"format",
|
|
137
|
+
"currency",
|
|
138
|
+
"percent",
|
|
139
|
+
"percentage",
|
|
140
|
+
"compact",
|
|
141
|
+
"number",
|
|
142
|
+
"locale",
|
|
143
|
+
"intl"
|
|
144
|
+
],
|
|
145
|
+
"name": "UINumberFormat",
|
|
146
|
+
"related": [
|
|
147
|
+
"stat",
|
|
148
|
+
"text",
|
|
149
|
+
"badge",
|
|
150
|
+
"input"
|
|
151
|
+
],
|
|
152
|
+
"slots": {},
|
|
153
|
+
"states": [
|
|
154
|
+
{
|
|
155
|
+
"description": "Default, displaying the formatted value.",
|
|
156
|
+
"name": "idle"
|
|
157
|
+
}
|
|
158
|
+
],
|
|
159
|
+
"status": "stable",
|
|
160
|
+
"synonyms": {
|
|
161
|
+
"currency": [
|
|
162
|
+
"number-format",
|
|
163
|
+
"money",
|
|
164
|
+
"price"
|
|
165
|
+
],
|
|
166
|
+
"number": [
|
|
167
|
+
"number-format",
|
|
168
|
+
"format"
|
|
169
|
+
],
|
|
170
|
+
"percent": [
|
|
171
|
+
"number-format",
|
|
172
|
+
"percentage"
|
|
173
|
+
]
|
|
174
|
+
},
|
|
175
|
+
"tag": "number-format-ui",
|
|
176
|
+
"tokens": {},
|
|
177
|
+
"traits": [],
|
|
178
|
+
"version": 1
|
|
179
|
+
}
|
|
180
|
+
}
|