@adia-ai/web-components 0.8.32 → 0.8.34
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 +51 -0
- package/MIGRATION.md +136 -0
- package/components/accordion/accordion-item.a2ui.json +8 -0
- package/components/accordion/accordion-item.yaml +6 -0
- package/components/accordion/accordion.css +3 -1
- package/components/agent-reasoning/agent-reasoning.a2ui.json +1 -1
- package/components/agent-reasoning/agent-reasoning.yaml +3 -3
- package/components/alert/alert.a2ui.json +3 -5
- package/components/alert/alert.class.js +3 -3
- package/components/alert/alert.css +5 -12
- package/components/alert/alert.d.ts +2 -2
- package/components/alert/alert.yaml +6 -5
- package/components/badge/badge.a2ui.json +6 -9
- package/components/badge/badge.class.js +4 -4
- package/components/badge/badge.css +111 -77
- package/components/badge/badge.d.ts +34 -12
- package/components/badge/badge.examples.md +1 -1
- package/components/badge/badge.yaml +37 -16
- package/components/button/button.a2ui.json +1 -1
- package/components/button/button.css +16 -2
- package/components/button/button.d.ts +2 -2
- package/components/button/button.yaml +1 -1
- package/components/card/card.yaml +1 -1
- package/components/chart/chart.class.js +8 -4
- package/components/combobox/combobox.a2ui.json +1 -1
- package/components/combobox/combobox.yaml +3 -0
- package/components/command/command.a2ui.json +4 -0
- package/components/command/command.class.js +54 -4
- package/components/command/command.d.ts +2 -0
- package/components/command/command.yaml +25 -3
- package/components/date-range-picker/date-range-picker.a2ui.json +1 -1
- package/components/date-range-picker/date-range-picker.class.js +42 -43
- package/components/date-range-picker/date-range-picker.css +11 -0
- package/components/date-range-picker/date-range-picker.yaml +6 -3
- package/components/description-list/description-list.css +16 -4
- package/components/integration-card/integration-card.class.js +11 -2
- package/components/mark/mark.a2ui.json +6 -7
- package/components/mark/mark.class.js +1 -1
- package/components/mark/mark.css +7 -4
- package/components/mark/mark.d.ts +2 -2
- package/components/mark/mark.examples.md +0 -4
- package/components/mark/mark.yaml +16 -6
- package/components/modal/modal.class.js +43 -2
- package/components/modal/modal.css +23 -0
- package/components/nav-group/nav-group.css +15 -4
- package/components/nav-item/nav-item.css +11 -3
- package/components/option-card/option-card.examples.md +1 -1
- package/components/popover/popover.a2ui.json +5 -0
- package/components/popover/popover.class.js +9 -4
- package/components/popover/popover.css +5 -2
- package/components/popover/popover.yaml +8 -0
- package/components/preview/preview.examples.md +1 -1
- package/components/richtext/richtext.css +5 -1
- package/components/segment/segment.css +10 -0
- package/components/step-progress/step-progress.css +16 -3
- package/components/table/cell-types.js +20 -1
- package/components/table/table.a2ui.json +1 -1
- package/components/table/table.class.js +11 -0
- package/components/table/table.css +9 -0
- package/components/table/table.d.ts +1 -1
- package/components/table/table.yaml +1 -1
- package/components/table-toolbar/table-toolbar.class.js +1 -1
- package/components/tabs/tabs.css +3 -1
- package/components/tag/tag.a2ui.json +5 -5
- package/components/tag/tag.class.js +1 -1
- package/components/tag/tag.css +93 -77
- package/components/tag/tag.d.ts +17 -11
- package/components/tag/tag.yaml +30 -19
- package/components/toast/toast.a2ui.json +2 -4
- package/components/toast/toast.css +0 -12
- package/components/toast/toast.yaml +3 -4
- package/core/element.js +31 -0
- package/core/signals.js +3 -1
- package/dist/theme-provider.min.js +2 -2
- package/dist/web-components.min.css +1 -1
- package/dist/web-components.min.js +67 -67
- package/dist/web-components.sheet.js +1 -1
- package/package.json +1 -1
- package/patterns/admin-keys-and-export/admin-keys-and-export.examples.html +1 -1
- package/patterns/agent-memory/agent-memory.examples.html +5 -5
- package/patterns/agent-prompt-library/agent-prompt-library.examples.html +2 -2
- package/patterns/audit-log/audit-log.examples.js +12 -5
- package/patterns/bulk-action-toolbar/bulk-action-toolbar.examples.js +4 -1
- package/patterns/changelog-feed/changelog-feed.examples.html +1 -1
- package/patterns/comments-and-collaboration/comments-and-collaboration.examples.html +1 -1
- package/patterns/conversion-funnel/conversion-funnel.examples.html +1 -1
- package/patterns/diff-review/diff-review.examples.html +9 -9
- package/patterns/filter-bar/filter-bar.examples.html +12 -8
- package/patterns/filter-bar/filter-bar.examples.js +4 -1
- package/patterns/marketing-engagement/marketing-engagement.examples.html +1 -1
- package/patterns/notifications-bell-and-digest/notifications-bell-and-digest.examples.html +1 -1
- package/patterns/permissions-matrix/permissions-matrix.examples.html +1 -1
- package/patterns/permissions-sharing/permissions-sharing.examples.html +1 -1
- package/patterns/profile-public-and-verification/profile-public-and-verification.examples.html +2 -2
- package/patterns/record-detail-drawer/record-detail-drawer.examples.html +1 -1
- package/patterns/responsive-shell-sidebar/responsive-shell-sidebar.examples.html +135 -147
- package/patterns/retention-cohort/retention-cohort.examples.html +1 -1
- package/patterns/retention-cohort/retention-cohort.examples.js +4 -1
- package/patterns/system-banners/system-banners.examples.html +3 -3
- package/styles/colors/semantics/core.css +22 -2
|
@@ -1,14 +1,43 @@
|
|
|
1
1
|
@scope (badge-ui) {
|
|
2
2
|
:where(:scope) {
|
|
3
|
-
/* ── Tokens ──
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
/* ── Tokens ──
|
|
4
|
+
The family-less default was still `--a-bg-muted` + `-on-surface`
|
|
5
|
+
(quiet chrome) even after gh#864 made every family variant solid
|
|
6
|
+
by default — an inconsistency the swap missed, since it only
|
|
7
|
+
touched variants that HAD a family. Moved to the real
|
|
8
|
+
`--md-sys-color-neutral`/`-on-neutral` pair (operator ruling,
|
|
9
|
+
2026-08-10) — the true parallel to `-primary`/`-on-primary` etc.,
|
|
10
|
+
matching badge's own "solid by default" register and <tag-ui>'s
|
|
11
|
+
already-solid neutral default. `[tone="muted"]` (below) still
|
|
12
|
+
opts into the quiet chrome this rule used to carry unconditionally. */
|
|
13
|
+
--badge-bg: var(--md-sys-color-neutral);
|
|
14
|
+
--badge-fg: var(--md-sys-color-neutral-on-neutral);
|
|
15
|
+
/* ── Geometry (issue 845) — aligned to tag-ui's token rhythm. Radius now
|
|
16
|
+
consumes the SAME --a-radius-full pill tag-ui uses (was --a-radius-md,
|
|
17
|
+
a squarer chip) — shape is no longer the differentiation axis between
|
|
18
|
+
the two (operator ruling, issue 845). Padding already shared tag's
|
|
19
|
+
exact token structure pre-845 (see the size-tier comment below) —
|
|
20
|
+
only radius moved. */
|
|
21
|
+
--badge-radius: var(--a-radius-full);
|
|
7
22
|
--badge-px: var(--a-space-1-5);
|
|
8
23
|
--badge-py: var(--a-space-0-5);
|
|
9
24
|
--badge-gap: var(--a-space-1);
|
|
10
|
-
|
|
11
|
-
|
|
25
|
+
/* One rung down the --a-ui-* scale (gh#965) — ladder shifts with it
|
|
26
|
+
(sm=2xs, lg=sm) so tiers stay one rung apart. Mirrors tag-ui. */
|
|
27
|
+
--badge-font-size: var(--a-ui-xs);
|
|
28
|
+
/* ── Typographic register (issue 845; weight revised gh#866) — mono
|
|
29
|
+
TRIAL taken: kbd-ui's own stack (--a-font-family-code, kbd.css) held
|
|
30
|
+
up at small badge sizes (roughly a dozen logical pixels) in both
|
|
31
|
+
schemes once paired with wide tracking (screenshot-verified, see PR
|
|
32
|
+
body) — did not read starved/gappy, so the trial's fallback branch
|
|
33
|
+
(tracked-caps sans) was not needed. Weight moved semibold → medium
|
|
34
|
+
(gh#866) — it no longer distinguishes badge from tag (tag is also
|
|
35
|
+
weight 500). Uppercase + wide tracking + mono + tabular-nums is the
|
|
36
|
+
register now — this is what makes a badge unmistakably NOT a tag
|
|
37
|
+
(which stays proportional sentence-case) at a glance. */
|
|
38
|
+
--badge-font-family: var(--a-font-family-code);
|
|
39
|
+
--badge-weight: var(--a-weight-medium);
|
|
40
|
+
--badge-tracking: var(--a-font-tracking-wider); /* 0.06em — within the +0.04–0.08em ruling */
|
|
12
41
|
|
|
13
42
|
/* ── Size tiers (gh#779) — md (above) is the pixel-identical default.
|
|
14
43
|
Component-owned ladder, not a direct alias of the universal
|
|
@@ -18,8 +47,8 @@
|
|
|
18
47
|
--badge-px-lg: var(--a-space-2);
|
|
19
48
|
--badge-py-sm: var(--a-space-px);
|
|
20
49
|
--badge-py-lg: var(--a-space-1);
|
|
21
|
-
--badge-font-size-sm: var(--a-ui-
|
|
22
|
-
--badge-font-size-lg: var(--a-ui-
|
|
50
|
+
--badge-font-size-sm: var(--a-ui-2xs);
|
|
51
|
+
--badge-font-size-lg: var(--a-ui-sm);
|
|
23
52
|
text-align: start; /* §text-align-reset — blocks inheritance from centered ancestors */
|
|
24
53
|
}
|
|
25
54
|
|
|
@@ -38,8 +67,15 @@
|
|
|
38
67
|
/* font-family floor — see segment.css rationale. */
|
|
39
68
|
font-family: var(--badge-font-family);
|
|
40
69
|
font-size: var(--badge-font-size);
|
|
41
|
-
font-weight:
|
|
70
|
+
font-weight: var(--badge-weight);
|
|
42
71
|
line-height: 1;
|
|
72
|
+
/* ── Register (issue 845) — uppercase + tracking + tabular numerals is the
|
|
73
|
+
badge/tag differentiator now that geometry is shared (see the
|
|
74
|
+
--badge-radius note above). Tag stays proportional sentence-case at
|
|
75
|
+
weight 500 (tag.css) — never uppercase, never tracked. */
|
|
76
|
+
text-transform: uppercase;
|
|
77
|
+
letter-spacing: var(--badge-tracking);
|
|
78
|
+
font-variant-numeric: tabular-nums;
|
|
43
79
|
border-radius: var(--badge-radius);
|
|
44
80
|
white-space: nowrap;
|
|
45
81
|
vertical-align: middle;
|
|
@@ -56,7 +92,7 @@
|
|
|
56
92
|
|
|
57
93
|
/* Leading icon stamped by JS (when [icon] is set). Inherits the badge's
|
|
58
94
|
foreground color so legend chips read as a single color-coded unit
|
|
59
|
-
(e.g.
|
|
95
|
+
(e.g. primary variant → primary-colored dot + primary-colored label).
|
|
60
96
|
ICON-HEIGHT FIX: cap the icon block-size so it cannot exceed the text
|
|
61
97
|
line-height. `line-height:1` on the badge drives the block size via
|
|
62
98
|
the text glyph; an icon taller than 1em would inflate the row. */
|
|
@@ -78,93 +114,91 @@
|
|
|
78
114
|
}
|
|
79
115
|
|
|
80
116
|
/* ── Variants ──
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
117
|
+
Family fg pairs with the family's own solid bg — this is badge's
|
|
118
|
+
default tone (gh#864). Badge and tag had been implementing each
|
|
119
|
+
OTHER's reported default formula (gh#794 flipped tag's bare default to
|
|
120
|
+
solid a day before gh#845 ratified badge's register, with no cross-
|
|
121
|
+
check between the two changes) — this restores badge's own: saturated
|
|
122
|
+
`--a-{family}-bg` + Material's on-color (`-on-{family}`, near-white by
|
|
123
|
+
the fixed-light-on-color law). Reads as a status stamp — the badge IS
|
|
124
|
+
the state. `[tone="muted"]` below opts into the tinted-container pair
|
|
125
|
+
instead (the shape this rule used to carry pre-gh#864).
|
|
126
|
+
|
|
127
|
+
Warning uses --a-warning-bg (semantics.css L3 redirect to the bright-
|
|
128
|
+
amber -20-tint) rather than the raw family token, which would collapse
|
|
129
|
+
to muddy brown-on-brown (-on-warning is dark, the raw mid-tone bg
|
|
130
|
+
isn't). See <tag-ui>'s identical workaround. */
|
|
91
131
|
:scope[variant="info"] {
|
|
92
|
-
--badge-bg: var(--
|
|
93
|
-
--badge-fg: var(--md-sys-color-info-on-
|
|
132
|
+
--badge-bg: var(--a-info-bg);
|
|
133
|
+
--badge-fg: var(--md-sys-color-info-on-info);
|
|
94
134
|
}
|
|
95
135
|
|
|
96
136
|
:scope[variant="success"] {
|
|
97
|
-
--badge-bg: var(--
|
|
98
|
-
--badge-fg: var(--md-sys-color-success-on-
|
|
137
|
+
--badge-bg: var(--a-success-bg);
|
|
138
|
+
--badge-fg: var(--md-sys-color-success-on-success);
|
|
99
139
|
}
|
|
100
140
|
|
|
101
141
|
:scope[variant="warning"] {
|
|
102
|
-
--badge-bg: var(--
|
|
103
|
-
--badge-fg: var(--md-sys-color-warning-on-
|
|
142
|
+
--badge-bg: var(--a-warning-bg);
|
|
143
|
+
--badge-fg: var(--md-sys-color-warning-on-warning);
|
|
104
144
|
}
|
|
105
145
|
|
|
106
146
|
:scope[variant="danger"] {
|
|
107
|
-
--badge-bg: var(--
|
|
108
|
-
--badge-fg: var(--md-sys-color-danger-on-
|
|
147
|
+
--badge-bg: var(--a-danger-bg);
|
|
148
|
+
--badge-fg: var(--md-sys-color-danger-on-danger);
|
|
109
149
|
}
|
|
110
150
|
|
|
111
|
-
/* `primary` is
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
matrix so it tracks the same
|
|
115
|
-
primary variant. */
|
|
151
|
+
/* `primary` is badge's sole brand-emphasis variant (accent retired,
|
|
152
|
+
gh#874 — this rule is the identical solid pair the deleted
|
|
153
|
+
[variant="accent"] rule used to carry; renamed, not restyled).
|
|
154
|
+
Uses the L3 primary-* surface matrix so it tracks the same source
|
|
155
|
+
as button-ui's primary variant. */
|
|
116
156
|
:scope[variant="primary"] {
|
|
117
157
|
--badge-bg: var(--a-primary-bg);
|
|
118
158
|
--badge-fg: var(--md-sys-color-primary-on-primary);
|
|
119
159
|
}
|
|
120
160
|
|
|
121
|
-
/* `muted` and `neutral` are semantic aliases of the base — same tokens
|
|
122
|
-
as the default variant, declared explicitly so the yaml enum and the
|
|
123
|
-
CSS contract agree. Use cases: passive metadata chips (counts, IDs,
|
|
124
|
-
"Not set" states) where the badge should read as quiet chrome. */
|
|
125
|
-
:scope[variant="muted"],
|
|
126
|
-
:scope[variant="neutral"] {
|
|
127
|
-
--badge-bg: var(--a-bg-muted);
|
|
128
|
-
--badge-fg: var(--md-sys-color-neutral-on-surface);
|
|
129
|
-
}
|
|
130
|
-
|
|
131
161
|
/* ── Tone modifier — orthogonal to [variant] ──
|
|
132
|
-
Badge's default tone is `
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
into the transparent-fill + colored-ring
|
|
136
|
-
<tag-ui>;
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
See <tag-ui>'s identical workaround. Token-system follow-up planned. */
|
|
142
|
-
:scope[tone="solid"][variant="info"] {
|
|
143
|
-
--badge-bg: var(--a-info-bg);
|
|
144
|
-
--badge-fg: var(--md-sys-color-info-on-info);
|
|
162
|
+
Badge's default tone is `solid` (the family rules above, gh#864).
|
|
163
|
+
`[tone="muted"]` opts into the tinted-container pair (family-container
|
|
164
|
+
bg + family-on-surface fg — the shape <tag-ui>'s own default now uses,
|
|
165
|
+
gh#864); `[tone="outline"]` into the transparent-fill + colored-ring
|
|
166
|
+
shape. Same vocabulary as <tag-ui>; each component's default now
|
|
167
|
+
matches its own reported target instead of the other's. */
|
|
168
|
+
:scope[tone="muted"][variant="info"] {
|
|
169
|
+
--badge-bg: var(--md-sys-color-info-container);
|
|
170
|
+
--badge-fg: var(--md-sys-color-info-on-surface);
|
|
145
171
|
}
|
|
146
|
-
:scope[tone="
|
|
147
|
-
--badge-bg: var(--
|
|
148
|
-
--badge-fg: var(--md-sys-color-success-on-
|
|
172
|
+
:scope[tone="muted"][variant="success"] {
|
|
173
|
+
--badge-bg: var(--md-sys-color-success-container);
|
|
174
|
+
--badge-fg: var(--md-sys-color-success-on-surface);
|
|
149
175
|
}
|
|
150
|
-
:scope[tone="
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
--badge-bg: var(--a-warning-bg);
|
|
154
|
-
--badge-fg: var(--md-sys-color-warning-on-warning);
|
|
176
|
+
:scope[tone="muted"][variant="warning"] {
|
|
177
|
+
--badge-bg: var(--md-sys-color-warning-container);
|
|
178
|
+
--badge-fg: var(--md-sys-color-warning-on-surface);
|
|
155
179
|
}
|
|
156
|
-
:scope[tone="
|
|
157
|
-
--badge-bg: var(--
|
|
158
|
-
--badge-fg: var(--md-sys-color-danger-on-
|
|
180
|
+
:scope[tone="muted"][variant="danger"] {
|
|
181
|
+
--badge-bg: var(--md-sys-color-danger-container);
|
|
182
|
+
--badge-fg: var(--md-sys-color-danger-on-surface);
|
|
159
183
|
}
|
|
160
|
-
:scope[tone="
|
|
161
|
-
--badge-bg: var(--
|
|
162
|
-
--badge-fg: var(--md-sys-color-primary-on-
|
|
184
|
+
:scope[tone="muted"][variant="primary"] {
|
|
185
|
+
--badge-bg: var(--md-sys-color-primary-container);
|
|
186
|
+
--badge-fg: var(--md-sys-color-primary-on-surface);
|
|
163
187
|
}
|
|
164
|
-
/*
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
188
|
+
/* Family-less muted — the quiet-chrome opt-out for passive metadata
|
|
189
|
+
chips (counts, IDs, "Not set"). bg is the neutral-low fill (gh#873;
|
|
190
|
+
first consumer of this token) paired with neutral-on-surface text —
|
|
191
|
+
NOT the requested neutral-high, which measures ~3:1 against
|
|
192
|
+
neutral-low in both schemes and fails AA at badge's ~12px text size
|
|
193
|
+
(pair is roster-gated in verify:contrast). Distinct from the base
|
|
194
|
+
(no-attribute) default, which is solid neutral/on-neutral (commit
|
|
195
|
+
984a4401e) — muted is the quieter tint, solid is the stamp. NB
|
|
196
|
+
tag-ui's family-less [tone="muted"] intentionally stays on the
|
|
197
|
+
lighter --a-bg-muted pair (gh#778 dense-list rationale) — the two
|
|
198
|
+
components' family-less muteds are no longer the same shape. */
|
|
199
|
+
:scope[tone="muted"]:not([variant="info"]):not([variant="success"]):not([variant="warning"]):not([variant="danger"]):not([variant="primary"]) {
|
|
200
|
+
--badge-bg: var(--md-sys-color-neutral-low);
|
|
201
|
+
--badge-fg: var(--md-sys-color-neutral-on-surface);
|
|
168
202
|
}
|
|
169
203
|
|
|
170
204
|
/* ── `[tone="outline"]` — transparent bg + family-colored border + text ── */
|
|
@@ -188,12 +222,12 @@
|
|
|
188
222
|
--badge-fg: var(--md-sys-color-danger-on-surface);
|
|
189
223
|
--badge-border: var(--md-sys-color-danger-outline);
|
|
190
224
|
}
|
|
191
|
-
:scope[tone="outline"][variant="
|
|
225
|
+
:scope[tone="outline"][variant="primary"] {
|
|
192
226
|
--badge-fg: var(--md-sys-color-primary-on-surface);
|
|
193
227
|
--badge-border: var(--md-sys-color-primary-outline);
|
|
194
228
|
}
|
|
195
229
|
/* Outline on neutral — fg-muted text + subtle ring. */
|
|
196
|
-
:scope[tone="outline"]:not([variant="info"]):not([variant="success"]):not([variant="warning"]):not([variant="danger"]):not([variant="
|
|
230
|
+
:scope[tone="outline"]:not([variant="info"]):not([variant="success"]):not([variant="warning"]):not([variant="danger"]):not([variant="primary"]) {
|
|
197
231
|
--badge-fg: var(--a-fg-muted);
|
|
198
232
|
--badge-border: var(--md-sys-color-neutral-outline);
|
|
199
233
|
}
|
|
@@ -209,7 +243,7 @@
|
|
|
209
243
|
:scope[size="md"] {
|
|
210
244
|
--badge-px: var(--a-space-1-5);
|
|
211
245
|
--badge-py: var(--a-space-0-5);
|
|
212
|
-
--badge-font-size: var(--a-ui-
|
|
246
|
+
--badge-font-size: var(--a-ui-xs);
|
|
213
247
|
}
|
|
214
248
|
:scope[size="lg"] {
|
|
215
249
|
--badge-px: var(--badge-px-lg);
|
|
@@ -6,6 +6,22 @@ event. Use badge-ui for status flags (Beta / New / Deprecated),
|
|
|
6
6
|
notification counts, and unread indicators; use tag-ui for filter
|
|
7
7
|
chips or user-managed labels.
|
|
8
8
|
|
|
9
|
+
REGISTER (gh issue 845; weight revised gh#866): badge and tag share
|
|
10
|
+
the same geometry family — pill radius (`--a-radius-full`) and
|
|
11
|
+
padding token rhythm are identical, so shape is NOT how you tell
|
|
12
|
+
them apart. Typography is: badge is UPPERCASE, mono (kbd-ui's
|
|
13
|
+
`--a-font-family-code` stack), medium weight, wide-tracked
|
|
14
|
+
(`--a-font-tracking-wider`, 0.06em), tabular numerals for counts.
|
|
15
|
+
Tag stays proportional sentence-case, also weight 500 — weight no
|
|
16
|
+
longer distinguishes the two (gh#866); case + tracking + mono carry
|
|
17
|
+
the register split now. Neither component exposes a prop that
|
|
18
|
+
crosses this line; the registers cannot be mixed à la carte.
|
|
19
|
+
Remaining distinctions: badge is non-interactive and carries the
|
|
20
|
+
semantic-color voice (status tones ARE the message, solid by
|
|
21
|
+
default — gh#864); tag is interactive/removable, muted/tinted by
|
|
22
|
+
default for family variants (gh#864), solid by default for the
|
|
23
|
+
family-less variant (gh#794, unaffected by gh#864).
|
|
24
|
+
|
|
9
25
|
*
|
|
10
26
|
* @see https://ui-kit.exe.xyz/site/components/badge
|
|
11
27
|
*
|
|
@@ -23,26 +39,32 @@ export class UIBadge extends UIElement {
|
|
|
23
39
|
icon: string;
|
|
24
40
|
/** Badge size (sm/md/lg). For a denser or larger register, set [scale] on an ancestor. */
|
|
25
41
|
size: 'sm' | 'md' | 'lg';
|
|
26
|
-
/** Semantic status shorthand. Auto-maps to variant and sets text. `new` → success "New"; `updated` → info "Updated"; `deprecated` → warning "Deprecated"; `removed` → danger "Removed"; `beta` →
|
|
42
|
+
/** Semantic status shorthand. Auto-maps to variant and sets text. `new` → success "New"; `updated` → info "Updated"; `deprecated` → warning "Deprecated"; `removed` → danger "Removed"; `beta` → primary "Beta". Use `variant` + `text` directly for custom chips. */
|
|
27
43
|
status: 'new' | 'updated' | 'deprecated' | 'removed' | 'beta';
|
|
28
44
|
/** Badge text content. Falls back to existing textContent. */
|
|
29
45
|
text: string;
|
|
30
46
|
/** Badge display text. Renderer routes this to the `text` attribute via CSS attr(text) on ::after. */
|
|
31
47
|
textContent: string;
|
|
32
|
-
/** Fill style — orthogonal to [variant]. Badge defaults to `
|
|
33
|
-
(
|
|
34
|
-
|
|
35
|
-
- `
|
|
36
|
-
the
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
48
|
+
/** Fill style — orthogonal to [variant]. Badge defaults to `solid`
|
|
49
|
+
(gh#864 — badge and tag were swapped relative to their reported
|
|
50
|
+
default formulas; this restores badge's own). Three values:
|
|
51
|
+
- `solid` (default) — saturated bg + on-strong text. The badge
|
|
52
|
+
IS the state (status stamp). `primary` is badge's sole
|
|
53
|
+
brand-emphasis variant (`accent` retired, gh#874).
|
|
54
|
+
- `muted` — tinted bg + scheme-paired text. Use for quiet
|
|
55
|
+
metadata — counts, IDs, status pills in dense rows. Family-tinted
|
|
56
|
+
`muted` (e.g. `variant="info" tone="muted"`) shares `<tag-ui>`'s
|
|
57
|
+
`[tone="muted"]` shape; family-less `tone="muted"` does NOT
|
|
58
|
+
(gh#873) — it renders the stronger `neutral-low` fill, while
|
|
59
|
+
`<tag-ui>`'s family-less muted stays on the lighter
|
|
60
|
+
`--a-bg-muted` pair (gh#778 dense-list rationale).
|
|
40
61
|
- `outline` — transparent bg + family-colored border + family-
|
|
41
62
|
colored text. Lightest visual weight; good in dense data rows.
|
|
42
|
-
Vocabulary mirrors `<tag-ui>` (which defaults to
|
|
43
|
-
different role as filter /
|
|
63
|
+
Vocabulary mirrors `<tag-ui>` (which now defaults to `muted` for
|
|
64
|
+
its family variants, gh#864 — different role as filter /
|
|
65
|
+
autocomplete chip).
|
|
44
66
|
*/
|
|
45
67
|
tone: 'muted' | 'solid' | 'outline';
|
|
46
68
|
/** Semantic color variant. */
|
|
47
|
-
variant: 'default' | '
|
|
69
|
+
variant: 'default' | 'info' | 'success' | 'warning' | 'danger' | 'primary';
|
|
48
70
|
}
|
|
@@ -14,6 +14,22 @@ description: |
|
|
|
14
14
|
event. Use badge-ui for status flags (Beta / New / Deprecated),
|
|
15
15
|
notification counts, and unread indicators; use tag-ui for filter
|
|
16
16
|
chips or user-managed labels.
|
|
17
|
+
|
|
18
|
+
REGISTER (gh issue 845; weight revised gh#866): badge and tag share
|
|
19
|
+
the same geometry family — pill radius (`--a-radius-full`) and
|
|
20
|
+
padding token rhythm are identical, so shape is NOT how you tell
|
|
21
|
+
them apart. Typography is: badge is UPPERCASE, mono (kbd-ui's
|
|
22
|
+
`--a-font-family-code` stack), medium weight, wide-tracked
|
|
23
|
+
(`--a-font-tracking-wider`, 0.06em), tabular numerals for counts.
|
|
24
|
+
Tag stays proportional sentence-case, also weight 500 — weight no
|
|
25
|
+
longer distinguishes the two (gh#866); case + tracking + mono carry
|
|
26
|
+
the register split now. Neither component exposes a prop that
|
|
27
|
+
crosses this line; the registers cannot be mixed à la carte.
|
|
28
|
+
Remaining distinctions: badge is non-interactive and carries the
|
|
29
|
+
semantic-color voice (status tones ARE the message, solid by
|
|
30
|
+
default — gh#864); tag is interactive/removable, muted/tinted by
|
|
31
|
+
default for family variants (gh#864), solid by default for the
|
|
32
|
+
family-less variant (gh#794, unaffected by gh#864).
|
|
17
33
|
# Per ADR-0027 — primitives that programmatically create other primitives
|
|
18
34
|
# do NOT auto-import them. Consumer (or demo shell) must explicitly import.
|
|
19
35
|
composes:
|
|
@@ -35,7 +51,7 @@ props:
|
|
|
35
51
|
status:
|
|
36
52
|
description: Semantic status shorthand. Auto-maps to variant and sets text.
|
|
37
53
|
`new` → success "New"; `updated` → info "Updated"; `deprecated` → warning
|
|
38
|
-
"Deprecated"; `removed` → danger "Removed"; `beta` →
|
|
54
|
+
"Deprecated"; `removed` → danger "Removed"; `beta` → primary "Beta".
|
|
39
55
|
Use `variant` + `text` directly for custom chips.
|
|
40
56
|
type: string
|
|
41
57
|
default: ""
|
|
@@ -60,30 +76,33 @@ props:
|
|
|
60
76
|
default: default
|
|
61
77
|
enum:
|
|
62
78
|
- default
|
|
63
|
-
- accent
|
|
64
79
|
- info
|
|
65
80
|
- success
|
|
66
81
|
- warning
|
|
67
82
|
- danger
|
|
68
83
|
- primary
|
|
69
|
-
- muted
|
|
70
|
-
- neutral
|
|
71
84
|
tone:
|
|
72
85
|
description: |
|
|
73
|
-
Fill style — orthogonal to [variant]. Badge defaults to `
|
|
74
|
-
(
|
|
75
|
-
|
|
76
|
-
- `
|
|
77
|
-
the
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
86
|
+
Fill style — orthogonal to [variant]. Badge defaults to `solid`
|
|
87
|
+
(gh#864 — badge and tag were swapped relative to their reported
|
|
88
|
+
default formulas; this restores badge's own). Three values:
|
|
89
|
+
- `solid` (default) — saturated bg + on-strong text. The badge
|
|
90
|
+
IS the state (status stamp). `primary` is badge's sole
|
|
91
|
+
brand-emphasis variant (`accent` retired, gh#874).
|
|
92
|
+
- `muted` — tinted bg + scheme-paired text. Use for quiet
|
|
93
|
+
metadata — counts, IDs, status pills in dense rows. Family-tinted
|
|
94
|
+
`muted` (e.g. `variant="info" tone="muted"`) shares `<tag-ui>`'s
|
|
95
|
+
`[tone="muted"]` shape; family-less `tone="muted"` does NOT
|
|
96
|
+
(gh#873) — it renders the stronger `neutral-low` fill, while
|
|
97
|
+
`<tag-ui>`'s family-less muted stays on the lighter
|
|
98
|
+
`--a-bg-muted` pair (gh#778 dense-list rationale).
|
|
81
99
|
- `outline` — transparent bg + family-colored border + family-
|
|
82
100
|
colored text. Lightest visual weight; good in dense data rows.
|
|
83
|
-
Vocabulary mirrors `<tag-ui>` (which defaults to
|
|
84
|
-
different role as filter /
|
|
101
|
+
Vocabulary mirrors `<tag-ui>` (which now defaults to `muted` for
|
|
102
|
+
its family variants, gh#864 — different role as filter /
|
|
103
|
+
autocomplete chip).
|
|
85
104
|
type: string
|
|
86
|
-
default:
|
|
105
|
+
default: solid
|
|
87
106
|
enum:
|
|
88
107
|
- muted
|
|
89
108
|
- solid
|
|
@@ -100,6 +119,8 @@ a2ui:
|
|
|
100
119
|
rules:
|
|
101
120
|
- rule: 'Use for small status/count labels attached to another element (notification counts, status pills, version tags).'
|
|
102
121
|
reason: 'Different from <tag-ui> which is for free-standing taxonomy/filter labels.'
|
|
122
|
+
- rule: 'A bare Badge (no [tone]) renders a solid, saturated status stamp. Set [tone="muted"] for the quieter tinted look on dense metadata rows.'
|
|
123
|
+
reason: 'Badge defaults to solid (gh#864); does not need [tone] set explicitly to read as a status stamp.'
|
|
103
124
|
- rule: 'Place adjacent to or absolutely-positioned over the badged element, not inside it.'
|
|
104
125
|
reason: 'Light-DOM positioning; do not nest inside the badged element''s slot.'
|
|
105
126
|
- rule: 'For dismissable taxonomy labels (filter chips, selected items in multi-select), use <tag-ui> instead.'
|
|
@@ -130,7 +151,7 @@ examples:
|
|
|
130
151
|
"component": "Badge",
|
|
131
152
|
"icon": "dot",
|
|
132
153
|
"text": "Organic",
|
|
133
|
-
"variant": "
|
|
154
|
+
"variant": "primary",
|
|
134
155
|
"size": "sm"
|
|
135
156
|
},
|
|
136
157
|
{
|
|
@@ -84,6 +84,15 @@ button-ui[variant="ghost"][color="warning"]:not([disabled]):hover { --button-f
|
|
|
84
84
|
--button-font-size: var(--a-ui-size);
|
|
85
85
|
--button-font-weight: var(--a-ui-weight);
|
|
86
86
|
--button-font-family: var(--a-font-family-ui);
|
|
87
|
+
/* Leading for the [text] label box ONLY — never the host. The host's
|
|
88
|
+
`line-height: 1` is deliberate (it sizes the icon/[slot="trailing"]
|
|
89
|
+
blocks), but the label's ::after clips to its own line box, so
|
|
90
|
+
inheriting 1 makes half-leading negative and shears descenders
|
|
91
|
+
(g/j/p/q/y, parentheses) by ~0.93px at the default size — gh#906.
|
|
92
|
+
Snug (1.3) contains the font's content box at every [size]; the
|
|
93
|
+
precedent is stat.css:174,198 setting leading on the truncating
|
|
94
|
+
box rather than on the component root. */
|
|
95
|
+
--button-label-line-height: var(--a-leading-snug);
|
|
87
96
|
--button-gap: var(--a-space-1);
|
|
88
97
|
--button-bg-hover: var(--a-bg-strong); /* neutral fill → neutral -strong surface on hover */
|
|
89
98
|
--button-fg-hover: var(--a-ui-text-hover);
|
|
@@ -167,6 +176,9 @@ button-ui[variant="ghost"][color="warning"]:not([disabled]):hover { --button-f
|
|
|
167
176
|
overflow: hidden;
|
|
168
177
|
text-overflow: ellipsis;
|
|
169
178
|
min-width: 0;
|
|
179
|
+
/* `overflow: hidden` (needed for the ellipsis) makes this line box the
|
|
180
|
+
clip box — give it leading tall enough to contain the descenders. */
|
|
181
|
+
line-height: var(--button-label-line-height);
|
|
170
182
|
}
|
|
171
183
|
|
|
172
184
|
/* Display convention (ADR-0037): block-level by default — a text button used
|
|
@@ -252,8 +264,10 @@ button-ui[variant="ghost"][color="warning"]:not([disabled]):hover { --button-f
|
|
|
252
264
|
/* ── Color (semantic axis) ──
|
|
253
265
|
`[color]` carries semantic intent; `variant` carries visual style.
|
|
254
266
|
Together they compose: `<button-ui variant="solid" color="danger">`
|
|
255
|
-
vs `<button-ui variant="outline" color="danger">`.
|
|
256
|
-
`variant="danger"`
|
|
267
|
+
vs `<button-ui variant="outline" color="danger">`. (Corrected,
|
|
268
|
+
variant-color-tone LLD §2: no `variant="danger"` → `color` alias
|
|
269
|
+
JS exists in button.class.js — the prior comment claiming one was
|
|
270
|
+
stale.) */
|
|
257
271
|
:scope[color="danger"] {
|
|
258
272
|
--button-bg: var(--button-bg-danger);
|
|
259
273
|
--button-fg: var(--button-fg-danger);
|
|
@@ -18,7 +18,7 @@ export class UIButton extends UIElement {
|
|
|
18
18
|
/** HTML button type (button, submit, reset) */
|
|
19
19
|
type: string;
|
|
20
20
|
/** Semantic intent — composes with [variant]. `<button-ui variant="solid" color="danger">` = filled destructive action; `<button-ui variant="outline" color="success">` = outlined success affordance. */
|
|
21
|
-
color: 'default' | '
|
|
21
|
+
color: 'default' | 'info' | 'success' | 'warning' | 'danger';
|
|
22
22
|
/** Disables interaction and prevents click/press events */
|
|
23
23
|
disabled: boolean;
|
|
24
24
|
/** Leading Phosphor icon name (rendered before text). */
|
|
@@ -33,7 +33,7 @@ export class UIButton extends UIElement {
|
|
|
33
33
|
textContent: string;
|
|
34
34
|
/** Visual style — `solid` (default fill), `tonal` (soft container fill with in-family text — the emphasis tier between solid and outline; default rides the primary family), `outline`, `ghost`. `default` / `primary` are aliases of `solid`. Style is independent of semantic intent — to express destructive / success / info / warning intent, set [color="…"] alongside (`variant="tonal" color="danger"` = the danger family's container fill). There is deliberately no `variant="secondary"`: `secondary` names a color family in this system, and an unset variant already IS the secondary-rank look (compose-constitution); `tonal` is the named tier for a softer-than-solid filled action.
|
|
35
35
|
For **inline navigation** (Terms of Service, Privacy Policy, footer links, "Sign in" / "Sign up" cross-page affordances) use `<link-ui>` instead — it carries proper `<a href>` semantics, keyboard handling (Enter only, no Space), middle-click open-new-tab, and screen-reader announces "link" instead of "button". Mixing navigation and action affordances under the same primitive is a category error fixed at this junction. */
|
|
36
|
-
variant: 'default' | 'solid' | 'outline' | 'ghost' | 'primary';
|
|
36
|
+
variant: 'default' | 'solid' | 'tonal' | 'outline' | 'ghost' | 'primary';
|
|
37
37
|
|
|
38
38
|
addEventListener(type: 'press', listener: (ev: ButtonPressEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
39
39
|
addEventListener<K extends keyof HTMLElementEventMap>(
|
|
@@ -132,7 +132,7 @@ a2ui:
|
|
|
132
132
|
- The card's <header> grid activates only for DIRECT-child slotted elements. If you need an icon column, place the icon
|
|
133
133
|
element (avatar-ui, icon-ui) directly in the header with slot="icon" — not inside a wrapper.
|
|
134
134
|
- 'Heading slot accepts inline badges/metadata: <span slot="heading"><text-ui strong>Title</text-ui><badge-ui text="New"
|
|
135
|
-
variant="
|
|
135
|
+
variant="primary"></badge-ui></span> renders title + badge on one row.'
|
|
136
136
|
- Description slot also accepts bare <p> or <small> elements as siblings of the heading — they participate in the grid's
|
|
137
137
|
row 2 without needing slot="description".
|
|
138
138
|
- Multiple <section> siblings are allowed and stack vertically. [bleed] on a section removes its margin for edge-to-edge
|
|
@@ -1366,9 +1366,13 @@ export class UIChart extends UIElement {
|
|
|
1366
1366
|
const data = this.#data;
|
|
1367
1367
|
const yKey = this.#yKeys()[0] || this.y;
|
|
1368
1368
|
const vals = data.map(d => +(d[yKey] ?? 0));
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1369
|
+
|
|
1370
|
+
// Fixed 0-floor domain via niceScale — the same convention every other
|
|
1371
|
+
// renderer in this file uses (#renderBar, #renderLine, #renderScatter,
|
|
1372
|
+
// etc). A flat/single-point series then plots against a real baseline
|
|
1373
|
+
// instead of collapsing to the bottom edge (gh#850).
|
|
1374
|
+
const ticks = niceScale(0, Math.max(...vals), 5);
|
|
1375
|
+
const maxVal = ticks[ticks.length - 1];
|
|
1372
1376
|
|
|
1373
1377
|
// Use the actual container dims so the aspect ratio matches what
|
|
1374
1378
|
// the CSS allocates (otherwise the fixed 120×32 viewBox gets
|
|
@@ -1385,7 +1389,7 @@ export class UIChart extends UIElement {
|
|
|
1385
1389
|
const labels = data.map(d => d[this.x] ?? '');
|
|
1386
1390
|
const points = vals.map((v, i) => ({
|
|
1387
1391
|
x: step * i,
|
|
1388
|
-
y: h - ((v
|
|
1392
|
+
y: h - (maxVal ? (v / maxVal) * (h - padY * 2) : 0) - padY,
|
|
1389
1393
|
v,
|
|
1390
1394
|
label: labels[i],
|
|
1391
1395
|
}));
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
},
|
|
99
99
|
"options": {
|
|
100
100
|
"description": "Programmatic option list. Array of {value, label, disabled?, group?} or grouped {label, options:[…]}. Alternative to declarative <option> / <optgroup> children.",
|
|
101
|
-
"$ref": "common_types.json#/$defs/
|
|
101
|
+
"$ref": "common_types.json#/$defs/DynamicObjectList"
|
|
102
102
|
},
|
|
103
103
|
"placeholder": {
|
|
104
104
|
"description": "Placeholder text in the input when value is empty",
|
|
@@ -85,6 +85,9 @@ props:
|
|
|
85
85
|
or grouped {label, options:[…]}. Alternative to declarative
|
|
86
86
|
<option> / <optgroup> children.
|
|
87
87
|
type: array
|
|
88
|
+
# Rich option objects — same DynamicObjectList mapping fix as command-ui.
|
|
89
|
+
items:
|
|
90
|
+
type: object
|
|
88
91
|
default: []
|
|
89
92
|
dynamic: true # JS-set collection prop with a custom setter — deliberately not in static properties
|
|
90
93
|
open:
|
|
@@ -21,6 +21,10 @@
|
|
|
21
21
|
"type": "boolean",
|
|
22
22
|
"default": false
|
|
23
23
|
},
|
|
24
|
+
"options": {
|
|
25
|
+
"description": "Programmatic item list. Array of {value, label, icon?, shortcut?, disabled?} or grouped {label, options:[…]}. `icon` renders as a leading icon-ui, `shortcut` as a trailing keyboard-shortcut hint — the same fields as the data-icon/data-shortcut attributes on declarative <option> children. Alternative to declarative <option data-icon data-shortcut> / <optgroup label> children.",
|
|
26
|
+
"$ref": "common_types.json#/$defs/DynamicObjectList"
|
|
27
|
+
},
|
|
24
28
|
"placeholder": {
|
|
25
29
|
"description": "Placeholder text for the search input",
|
|
26
30
|
"type": "string",
|