@adia-ai/web-components 0.8.41 → 0.8.42
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 +21 -0
- package/MIGRATION.md +187 -0
- package/USAGE.md +4 -4
- package/components/action-list/action-item.a2ui.json +8 -3
- package/components/action-list/action-item.yaml +25 -7
- package/components/action-list/action-list.class.js +68 -6
- package/components/action-list/action-list.d.ts +3 -1
- package/components/chart/chart.a2ui.json +18 -3
- package/components/chart/chart.class.js +58 -16
- package/components/chart/chart.d.ts +9 -3
- package/components/chart/chart.yaml +35 -3
- package/components/chart-legend/chart-legend.a2ui.json +6 -1
- package/components/chart-legend/chart-legend.class.js +59 -6
- package/components/chart-legend/chart-legend.css +5 -2
- package/components/chart-legend/chart-legend.d.ts +3 -1
- package/components/chart-legend/chart-legend.yaml +15 -1
- package/components/color-area/color-area.a2ui.json +148 -0
- package/components/color-area/color-area.class.js +657 -0
- package/components/color-area/color-area.css +188 -0
- package/components/color-area/color-area.d.ts +66 -0
- package/components/color-area/color-area.examples.md +19 -0
- package/components/color-area/color-area.js +17 -0
- package/components/color-area/color-area.yaml +183 -0
- package/components/color-input/color-input.a2ui.json +5 -5
- package/components/color-input/color-input.class.js +9 -6
- package/components/color-input/color-input.css +1 -1
- package/components/color-input/color-input.js +2 -2
- package/components/color-input/color-input.yaml +14 -12
- package/components/color-picker/color-picker.a2ui.json +15 -12
- package/components/color-picker/color-picker.class.js +24 -633
- package/components/color-picker/color-picker.css +14 -182
- package/components/color-picker/color-picker.yaml +41 -41
- package/components/description-list/description-list.a2ui.json +1 -1
- package/components/description-list/description-list.css +1 -1
- package/components/description-list/description-list.d.ts +1 -1
- package/components/description-list/description-list.yaml +1 -1
- package/components/field/field.a2ui.json +1 -1
- package/components/field/field.class.js +4 -1
- package/components/field/field.yaml +1 -1
- package/components/index.js +1 -0
- package/components/integration-card/integration-card.examples.md +2 -1
- package/components/menu/menu-item.a2ui.json +8 -3
- package/components/menu/menu-item.yaml +24 -3
- package/components/menu/menu.class.js +34 -6
- package/components/menu/menu.d.ts +3 -1
- package/components/pane/pane.a2ui.json +11 -1
- package/components/pane/pane.class.js +32 -3
- package/components/pane/pane.css +15 -10
- package/components/pane/pane.d.ts +10 -7
- package/components/pane/pane.yaml +15 -1
- package/components/swatch/swatch.yaml +1 -1
- package/components/table-toolbar/table-toolbar.class.js +15 -3
- package/core/icons.js +5 -0
- package/custom-elements.json +191 -16
- package/dist/theme-provider.min.js +1 -1
- package/dist/web-components.min.css +1 -1
- package/dist/web-components.min.js +89 -89
- package/dist/web-components.sheet.js +1 -1
- package/index.d.ts +12 -1
- package/package.json +1 -1
- package/patterns/admin-shell/admin-shell.examples.html +2 -2
- package/patterns/form-system/form-system.examples.html +1 -1
- package/styles/components.css +1 -0
|
@@ -1,182 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
--color-picker-label-fg: var(--a-fg-muted);
|
|
16
|
-
--color-picker-border: var(--md-sys-color-neutral-outline-variant);
|
|
17
|
-
--color-picker-output-bg: var(--a-bg-muted);
|
|
18
|
-
--color-picker-output-radius: var(--a-radius-sm);
|
|
19
|
-
--color-picker-fg-disabled: var(--a-ui-text-disabled);
|
|
20
|
-
|
|
21
|
-
/* ── Spacing ── */
|
|
22
|
-
--color-picker-gap-sm: var(--a-space-1);
|
|
23
|
-
--color-picker-pad-sm: var(--a-space-2);
|
|
24
|
-
|
|
25
|
-
/* ── Interactive ── */
|
|
26
|
-
--color-picker-focus-color: var(--md-sys-color-primary);
|
|
27
|
-
--color-picker-disabled-border: var(--md-sys-color-neutral-outline-variant);
|
|
28
|
-
|
|
29
|
-
/* ── Transitions ── */
|
|
30
|
-
--color-picker-duration: var(--a-duration-fast);
|
|
31
|
-
--color-picker-easing: var(--a-easing);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
:scope {
|
|
35
|
-
box-sizing: border-box;
|
|
36
|
-
display: flex;
|
|
37
|
-
flex-direction: column;
|
|
38
|
-
gap: var(--color-picker-gap);
|
|
39
|
-
width: 100%;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/* ═══════ 2D Color Area ═══════ */
|
|
43
|
-
|
|
44
|
-
[data-area] {
|
|
45
|
-
position: relative;
|
|
46
|
-
width: 100%;
|
|
47
|
-
height: var(--color-picker-area-height);
|
|
48
|
-
border-radius: var(--color-picker-area-radius);
|
|
49
|
-
border: 1px solid var(--color-picker-border);
|
|
50
|
-
overflow: hidden;
|
|
51
|
-
cursor: crosshair;
|
|
52
|
-
touch-action: none;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
[data-area]:focus-visible {
|
|
56
|
-
outline: 2px solid var(--color-picker-focus-color);
|
|
57
|
-
outline-offset: 2px;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
[data-area] canvas {
|
|
61
|
-
image-rendering: auto;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
[data-area-thumb] {
|
|
65
|
-
position: absolute;
|
|
66
|
-
width: var(--color-picker-thumb-size);
|
|
67
|
-
height: var(--color-picker-thumb-size);
|
|
68
|
-
border-radius: 50%;
|
|
69
|
-
border: var(--color-picker-thumb-border);
|
|
70
|
-
box-shadow: var(--color-picker-thumb-shadow);
|
|
71
|
-
transform: translate(-50%, -50%);
|
|
72
|
-
pointer-events: none;
|
|
73
|
-
z-index: 1;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
/* ═══════ Slider Rows (H / C / L) ═══════ */
|
|
77
|
-
|
|
78
|
-
[data-sliders] {
|
|
79
|
-
display: flex;
|
|
80
|
-
flex-direction: column;
|
|
81
|
-
gap: var(--color-picker-gap-sm);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
/* ═══════ Hue Track ═══════ */
|
|
85
|
-
|
|
86
|
-
[data-hue-track] {
|
|
87
|
-
position: relative;
|
|
88
|
-
width: 100%;
|
|
89
|
-
height: var(--color-picker-track-height);
|
|
90
|
-
border-radius: var(--color-picker-track-radius);
|
|
91
|
-
cursor: pointer;
|
|
92
|
-
touch-action: none;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
[data-hue-track]:focus-visible {
|
|
96
|
-
outline: 2px solid var(--color-picker-focus-color);
|
|
97
|
-
outline-offset: 2px;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
[data-hue-thumb] {
|
|
101
|
-
position: absolute;
|
|
102
|
-
top: 50%;
|
|
103
|
-
width: var(--color-picker-thumb-size);
|
|
104
|
-
height: var(--color-picker-thumb-size);
|
|
105
|
-
border-radius: 50%;
|
|
106
|
-
border: var(--color-picker-thumb-border);
|
|
107
|
-
box-shadow: var(--color-picker-thumb-shadow);
|
|
108
|
-
transform: translate(-50%, -50%);
|
|
109
|
-
pointer-events: none;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
/* ═══════ Output Values ═══════ */
|
|
113
|
-
|
|
114
|
-
[data-output] {
|
|
115
|
-
display: flex;
|
|
116
|
-
flex-direction: column;
|
|
117
|
-
gap: var(--color-picker-gap-sm);
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
[data-output-group] {
|
|
121
|
-
display: flex;
|
|
122
|
-
align-items: center;
|
|
123
|
-
gap: var(--color-picker-gap-sm);
|
|
124
|
-
padding: var(--color-picker-gap-sm) var(--color-picker-pad-sm);
|
|
125
|
-
background: var(--color-picker-output-bg);
|
|
126
|
-
border-radius: var(--color-picker-output-radius);
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
[data-output-value] {
|
|
130
|
-
font-family: var(--color-picker-font);
|
|
131
|
-
font-size: var(--color-picker-font-size);
|
|
132
|
-
color: var(--color-picker-fg);
|
|
133
|
-
user-select: all;
|
|
134
|
-
-webkit-user-select: all;
|
|
135
|
-
flex: 1;
|
|
136
|
-
min-width: 0;
|
|
137
|
-
overflow: hidden;
|
|
138
|
-
text-overflow: ellipsis;
|
|
139
|
-
white-space: nowrap;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
/* Copy button */
|
|
143
|
-
[data-copy] {
|
|
144
|
-
flex-shrink: 0;
|
|
145
|
-
display: flex;
|
|
146
|
-
align-items: center;
|
|
147
|
-
justify-content: center;
|
|
148
|
-
background: none;
|
|
149
|
-
border: none;
|
|
150
|
-
padding: 0;
|
|
151
|
-
cursor: pointer;
|
|
152
|
-
color: var(--color-picker-label-fg);
|
|
153
|
-
transition: color var(--color-picker-duration) var(--color-picker-easing);
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
[data-copy]:hover {
|
|
157
|
-
color: var(--color-picker-fg);
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
[data-copy] icon-ui {
|
|
161
|
-
--a-icon-size: var(--color-picker-font-size);
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
/* ═══════ Disabled ═══════ */
|
|
165
|
-
|
|
166
|
-
:scope[disabled] {
|
|
167
|
-
pointer-events: none;
|
|
168
|
-
color: var(--color-picker-fg-disabled);
|
|
169
|
-
}
|
|
170
|
-
:scope[disabled] [data-area],
|
|
171
|
-
:scope[disabled] [data-hue-track] {
|
|
172
|
-
filter: grayscale(1);
|
|
173
|
-
cursor: not-allowed;
|
|
174
|
-
}
|
|
175
|
-
:scope[disabled] slider-ui {
|
|
176
|
-
--slider-fill-bg: var(--color-picker-disabled-border);
|
|
177
|
-
--slider-thumb-bg: var(--color-picker-disabled-border);
|
|
178
|
-
}
|
|
179
|
-
:scope[disabled] [data-output-value] {
|
|
180
|
-
color: var(--color-picker-fg-disabled);
|
|
181
|
-
}
|
|
182
|
-
}
|
|
1
|
+
/* `<color-picker-ui>` is DEPRECATED (ADR-0063, gh#1563) — a thin
|
|
2
|
+
* `UIColorArea` subclass (see color-picker.class.js), never its own
|
|
3
|
+
* independent implementation. Its visual contract lives entirely in
|
|
4
|
+
* ../color-area/color-area.css, whose `@scope (color-area-ui,
|
|
5
|
+
* color-picker-ui)` root and `:is(color-area-ui, color-picker-ui)`
|
|
6
|
+
* selectors already cover this tag — one styling source, not two files
|
|
7
|
+
* drifting apart (`@scope` matches by literal tag name, not JS prototype
|
|
8
|
+
* chain, so the alias tag has to be named in that scope root explicitly —
|
|
9
|
+
* same shape as calendar-picker.css's own `datetime-picker-ui` alias
|
|
10
|
+
* coverage). This file intentionally carries no rules of its own;
|
|
11
|
+
* `packages/web-components/styles/components.css` still imports it so the
|
|
12
|
+
* barrel's per-component import list stays complete and mechanical (no
|
|
13
|
+
* special-cased skip for a deprecated-but-still-shipping tag).
|
|
14
|
+
*/
|
|
@@ -3,21 +3,38 @@
|
|
|
3
3
|
$schema: ../../../../scripts/schemas/component.yaml.schema.json
|
|
4
4
|
name: UIColorPicker
|
|
5
5
|
tag: color-picker-ui
|
|
6
|
-
status:
|
|
6
|
+
status: deprecated
|
|
7
7
|
component: ColorPicker
|
|
8
8
|
category: input
|
|
9
|
-
version:
|
|
9
|
+
version: 2
|
|
10
10
|
description: >-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
DEPRECATED (ADR-0063, gh#1563, gh#1377 B11) — `-picker` is reserved for
|
|
12
|
+
the outer, trigger + popover, form-associated composite shape
|
|
13
|
+
(`calendar-picker-ui` / `date-range-picker-ui` / `datetime-picker-ui` /
|
|
14
|
+
`time-picker-ui`); `color-picker-ui` was the sole violator, playing
|
|
15
|
+
`calendar-grid-ui`'s inline-substrate role under a `-picker` name.
|
|
16
|
+
`<color-picker-ui>` is now a thin `UIColorArea` subclass (see
|
|
17
|
+
color-picker.class.js) rather than an independent implementation — every
|
|
18
|
+
prop/event/token is inherited unchanged from `<color-area-ui>`. Existing
|
|
19
|
+
markup keeps working, but new markup should reach for `<color-area-ui>`
|
|
20
|
+
directly. See `<color-area-ui>` for the full contract.
|
|
16
21
|
# Per ADR-0027 — primitives that programmatically create other primitives
|
|
17
|
-
# do NOT auto-import them. Consumer (or demo shell) must explicitly import
|
|
22
|
+
# do NOT auto-import them. Consumer (or demo shell) must explicitly import
|
|
23
|
+
# the slider-ui module (same one <color-area-ui> itself needs — this alias
|
|
24
|
+
# inherits its render(), not just its class).
|
|
18
25
|
composes:
|
|
19
26
|
- slider-ui
|
|
20
27
|
props:
|
|
28
|
+
# Every prop below is inherited VERBATIM from <color-area-ui> —
|
|
29
|
+
# documented here too (not just "see the base class") because a
|
|
30
|
+
# consumer scanning THIS tag's own catalog entry, or the a2ui pipeline
|
|
31
|
+
# generating THIS tag by name, needs the full contract without a second
|
|
32
|
+
# hop. audit-static-properties-vs-yaml.mjs's component-extends-component
|
|
33
|
+
# exemption (gh#1372/gh#1563) resolves this against <color-area-ui>'s
|
|
34
|
+
# own yaml, so re-declaring the inherited names here is documentation,
|
|
35
|
+
# not a second runtime contract. Nothing overrides a default here (the
|
|
36
|
+
# alias is byte-identical behavior; only the class/tag/component names
|
|
37
|
+
# differ), unlike datetime-picker-ui's own two overridden defaults.
|
|
21
38
|
name:
|
|
22
39
|
description: Form field name
|
|
23
40
|
type: string
|
|
@@ -100,47 +117,29 @@ states:
|
|
|
100
117
|
description: Non-interactive; dimmed.
|
|
101
118
|
attribute: disabled
|
|
102
119
|
traits: []
|
|
103
|
-
tokens: {}
|
|
120
|
+
tokens: {} # No component-owned tokens — styling flows entirely through
|
|
121
|
+
# <color-area-ui>'s own --color-area-* custom properties.
|
|
104
122
|
requiredIcons:
|
|
105
123
|
- copy
|
|
106
124
|
- check
|
|
107
125
|
- warning
|
|
108
126
|
a2ui:
|
|
109
127
|
rules:
|
|
110
|
-
- rule: '
|
|
111
|
-
reason: '
|
|
128
|
+
- rule: 'DEPRECATED — prefer `{"component": "ColorArea"}` over `{"component": "ColorPicker"}`. Both render and behave identically; ColorPicker is a thin compatibility alias.'
|
|
129
|
+
reason: 'ADR-0063/gh#1377 B11 fold — steer new generation at the canonical primitive.'
|
|
112
130
|
- rule: 'For simple color swatches (read-only display) use <swatch-ui>; for hex/rgb text input use <color-input-ui>.'
|
|
113
131
|
reason: 'Surface boundary.'
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
132
|
+
anti_patterns:
|
|
133
|
+
- wrong: |
|
|
134
|
+
{"component": "ColorPicker", "name": "brand"}
|
|
135
|
+
why: |
|
|
136
|
+
ColorPicker is deprecated (ADR-0063, gh#1563) — new generation should
|
|
137
|
+
reach for ColorArea instead.
|
|
138
|
+
fix: |
|
|
139
|
+
{"component": "ColorArea", "name": "brand"}
|
|
117
140
|
examples:
|
|
118
|
-
- name: color-picker-
|
|
119
|
-
description:
|
|
120
|
-
a2ui: >-
|
|
121
|
-
[
|
|
122
|
-
{
|
|
123
|
-
"id": "root",
|
|
124
|
-
"component": "Card",
|
|
125
|
-
"children": [
|
|
126
|
-
"sec"
|
|
127
|
-
]
|
|
128
|
-
},
|
|
129
|
-
{
|
|
130
|
-
"id": "sec",
|
|
131
|
-
"component": "Section",
|
|
132
|
-
"children": [
|
|
133
|
-
"cp"
|
|
134
|
-
]
|
|
135
|
-
},
|
|
136
|
-
{
|
|
137
|
-
"id": "cp",
|
|
138
|
-
"component": "ColorPicker",
|
|
139
|
-
"value": "#6366f1"
|
|
140
|
-
}
|
|
141
|
-
]
|
|
142
|
-
- name: color-picker-panel
|
|
143
|
-
description: Color picker with swatch selection in a card.
|
|
141
|
+
- name: color-picker-legacy
|
|
142
|
+
description: Deprecated tag — prefer ColorArea's own "color-area-demo" example for NEW markup.
|
|
144
143
|
a2ui: >-
|
|
145
144
|
[
|
|
146
145
|
{
|
|
@@ -169,7 +168,8 @@ keywords:
|
|
|
169
168
|
- color
|
|
170
169
|
- picker
|
|
171
170
|
synonyms:
|
|
172
|
-
color-picker: [color-canvas, color-surface, swatch-picker]
|
|
171
|
+
color-picker: [color-canvas, color-surface, swatch-picker, color-area]
|
|
173
172
|
related:
|
|
173
|
+
- color-area
|
|
174
174
|
- grid
|
|
175
175
|
- button
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"$ref": "common_types.json#/$defs/DynamicStringList"
|
|
19
19
|
},
|
|
20
20
|
"align": {
|
|
21
|
-
"description": "Alignment for inline layout. `start` (default): term and value pack to the term column edge. `between`: term left, value right-aligned with `text-align: end`. `stretch`: value fills the remaining track width (e.g. for a `<slider-ui>` / `<select-ui>` / `<color-
|
|
21
|
+
"description": "Alignment for inline layout. `start` (default): term and value pack to the term column edge. `between`: term left, value right-aligned with `text-align: end`. `stretch`: value fills the remaining track width (e.g. for a `<slider-ui>` / `<select-ui>` / `<color-area-ui>` as `<dd>` that should span the full row). Sets `justify-self: stretch` and `width: 100%` on `dd` so block-level form controls inside reach the column edge rather than shrink-wrapping to content.\n",
|
|
22
22
|
"type": "string",
|
|
23
23
|
"enum": [
|
|
24
24
|
"start",
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
|
|
89
89
|
/* §-TBD (v0.5.19, FB-51 #3): align="stretch" lets dd fill the
|
|
90
90
|
remaining inline-grid track width. Useful when dd hosts a block-
|
|
91
|
-
level form control (slider-ui / select-ui / color-
|
|
91
|
+
level form control (slider-ui / select-ui / color-area-ui) that
|
|
92
92
|
would otherwise shrink-wrap to content. width:100% on direct
|
|
93
93
|
children reaches block controls that have their own inline-flex
|
|
94
94
|
:scope rule (e.g. <slider-ui>) so they stretch to track width. */
|
|
@@ -15,7 +15,7 @@ import { UIElement } from '../../core/element.js';
|
|
|
15
15
|
export class UIDescriptionList extends UIElement {
|
|
16
16
|
/** Optional JSON array of {term, description} — alternative to declarative <dt>/<dd> children */
|
|
17
17
|
items: string;
|
|
18
|
-
/** Alignment for inline layout. `start` (default): term and value pack to the term column edge. `between`: term left, value right-aligned with `text-align: end`. `stretch`: value fills the remaining track width (e.g. for a `<slider-ui>` / `<select-ui>` / `<color-
|
|
18
|
+
/** Alignment for inline layout. `start` (default): term and value pack to the term column edge. `between`: term left, value right-aligned with `text-align: end`. `stretch`: value fills the remaining track width (e.g. for a `<slider-ui>` / `<select-ui>` / `<color-area-ui>` as `<dd>` that should span the full row). Sets `justify-self: stretch` and `width: 100%` on `dd` so block-level form controls inside reach the column edge rather than shrink-wrapping to content.
|
|
19
19
|
*/
|
|
20
20
|
align: 'start' | 'between' | 'stretch';
|
|
21
21
|
/** stacked: term above description. inline: term and description on one row. */
|
|
@@ -16,7 +16,7 @@ props:
|
|
|
16
16
|
`start` (default): term and value pack to the term column edge.
|
|
17
17
|
`between`: term left, value right-aligned with `text-align: end`.
|
|
18
18
|
`stretch`: value fills the remaining track width (e.g. for a
|
|
19
|
-
`<slider-ui>` / `<select-ui>` / `<color-
|
|
19
|
+
`<slider-ui>` / `<select-ui>` / `<color-area-ui>` as `<dd>`
|
|
20
20
|
that should span the full row). Sets `justify-self: stretch` and
|
|
21
21
|
`width: 100%` on `dd` so block-level form controls inside reach
|
|
22
22
|
the column edge rather than shrink-wrapping to content.
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
],
|
|
100
100
|
"slots": {
|
|
101
101
|
"default": {
|
|
102
|
-
"description": "The form control — a WIDE control like input-ui, select-ui, textarea-ui, slider-ui, range-ui, calendar-picker-ui, color-
|
|
102
|
+
"description": "The form control — a WIDE control like input-ui, select-ui, textarea-ui, slider-ui, range-ui, calendar-picker-ui, color-area-ui, upload-ui, otp-input-ui. Auto-id'd for the label's [for] binding.\nDO NOT wrap small self-labeling widgets here. check-ui, switch-ui, radio-ui, toggle-ui all carry their own [label] attribute that renders inline next to the control — wrapping them in field-ui produces broken layouts (settings-row `justify-self: end` rule pushes the control to the trailing edge, away from the label that field-ui stamps; the widget's own label then renders again on the right, creating a doubled / right-justified affordance). See anti_patterns below for the canonical alternatives."
|
|
103
103
|
},
|
|
104
104
|
"action": {
|
|
105
105
|
"description": "Button adjacent to the control for inline actions (clear, reset, help popover)."
|
|
@@ -280,7 +280,10 @@ export class UIField extends UIElement {
|
|
|
280
280
|
'check-ui', 'radio-ui', 'switch-ui', 'slider-ui', 'range-ui',
|
|
281
281
|
'otp-input-ui', 'tags-input-ui', 'chat-input-ui', 'autocomplete-input-ui',
|
|
282
282
|
'datetime-picker-ui', 'date-range-picker-ui', 'calendar-picker-ui',
|
|
283
|
-
|
|
283
|
+
// ADR-0063 (gh#1563) — color-picker-ui's real implementation moved to
|
|
284
|
+
// color-area-ui; color-picker-ui is now a thin deprecated alias. Both
|
|
285
|
+
// tags need to resolve here since either may be the one actually used.
|
|
286
|
+
'color-area-ui', 'color-picker-ui', 'upload-ui', 'rating-ui', 'segmented-ui',
|
|
284
287
|
'input', 'textarea', 'select',
|
|
285
288
|
]);
|
|
286
289
|
|
|
@@ -68,7 +68,7 @@ slots:
|
|
|
68
68
|
description: >-
|
|
69
69
|
The form control — a WIDE control like input-ui, select-ui,
|
|
70
70
|
textarea-ui, slider-ui, range-ui, calendar-picker-ui,
|
|
71
|
-
color-
|
|
71
|
+
color-area-ui, upload-ui, otp-input-ui. Auto-id'd for the
|
|
72
72
|
label's [for] binding.
|
|
73
73
|
|
|
74
74
|
DO NOT wrap small self-labeling widgets here. check-ui,
|
package/components/index.js
CHANGED
|
@@ -50,6 +50,7 @@ export { UITooltip } from './tooltip/tooltip.js';
|
|
|
50
50
|
export { UIBadge } from './badge/badge.js';
|
|
51
51
|
export { UIBreadcrumb } from './breadcrumb/breadcrumb.js';
|
|
52
52
|
export { UICommand } from './command/command.js';
|
|
53
|
+
export { UIColorArea } from './color-area/color-area.js';
|
|
53
54
|
export { UIColorPicker } from './color-picker/color-picker.js';
|
|
54
55
|
export { UIColorInput } from './color-input/color-input.js';
|
|
55
56
|
export { UINoodles } from './noodles/noodles.js';
|
|
@@ -16,7 +16,8 @@
|
|
|
16
16
|
|
|
17
17
|
```html
|
|
18
18
|
<integration-card-ui provider="github" name="GitHub" description="Sync issues and pull requests." status="connected">
|
|
19
|
-
<menu-ui slot="actions"
|
|
19
|
+
<menu-ui slot="actions">
|
|
20
|
+
<button-ui slot="trigger" icon="dots-three" variant="ghost" aria-label="More"></button-ui>
|
|
20
21
|
<menu-item-ui action="reauth">Re-authenticate</menu-item-ui>
|
|
21
22
|
<menu-item-ui action="disconnect" variant="danger">Disconnect</menu-item-ui>
|
|
22
23
|
</menu-ui>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
3
|
"$id": "https://adiaui.dev/a2ui/v0_9/components/MenuItem.json",
|
|
4
4
|
"title": "MenuItem",
|
|
5
|
-
"description": "Child of `<menu-ui>`. One actionable row inside a menu, with optional leading icon + label +
|
|
5
|
+
"description": "Child of `<menu-ui>`. One actionable row inside a menu, with optional leading icon + label + description + value. (`subtitle` is a deprecated alias for `description` — ADR-0063, gh#1563.)",
|
|
6
6
|
"type": "object",
|
|
7
7
|
"allOf": [
|
|
8
8
|
{
|
|
@@ -13,6 +13,11 @@
|
|
|
13
13
|
}
|
|
14
14
|
],
|
|
15
15
|
"properties": {
|
|
16
|
+
"description": {
|
|
17
|
+
"description": "Optional secondary description line rendered under the label. Canonical spelling (ADR-0063, gh#1563) replacing `subtitle` — converges menu-item onto the ~20-component corpus majority that already names this concept `description`.",
|
|
18
|
+
"type": "string",
|
|
19
|
+
"default": ""
|
|
20
|
+
},
|
|
16
21
|
"component": {
|
|
17
22
|
"const": "MenuItem"
|
|
18
23
|
},
|
|
@@ -27,7 +32,7 @@
|
|
|
27
32
|
"default": ""
|
|
28
33
|
},
|
|
29
34
|
"subtitle": {
|
|
30
|
-
"description": "
|
|
35
|
+
"description": "DEPRECATED (ADR-0063, gh#1563) — use `description` instead. Same type/default/rendered position; kept working as a dual-read compat shim (one-time console.warn when it's the name that resolves). Removed in 0.9.0. (The `subtitle` SLOT below is a separate surface, deliberately left unrenamed in this pass — see its own description.)",
|
|
31
36
|
"type": "string",
|
|
32
37
|
"default": ""
|
|
33
38
|
},
|
|
@@ -81,7 +86,7 @@
|
|
|
81
86
|
"description": "Custom leading element override; falls through to `[icon]` prop if not slotted."
|
|
82
87
|
},
|
|
83
88
|
"subtitle": {
|
|
84
|
-
"description": "Custom secondary-line content override; falls through to `[
|
|
89
|
+
"description": "Custom secondary-line content override; falls through to the `[description]` prop (or its deprecated `[subtitle]` alias — ADR-0063, gh#1563) if not slotted. The slot's own name is unchanged by that rename — this is a distinct, deliberately-unrenamed surface."
|
|
85
90
|
},
|
|
86
91
|
"text": {
|
|
87
92
|
"description": "Custom label content; falls through to `[text]` prop if not slotted."
|
|
@@ -13,7 +13,7 @@ component: MenuItem
|
|
|
13
13
|
category: navigation
|
|
14
14
|
version: 1
|
|
15
15
|
description: |-
|
|
16
|
-
Child of `<menu-ui>`. One actionable row inside a menu, with optional leading icon + label +
|
|
16
|
+
Child of `<menu-ui>`. One actionable row inside a menu, with optional leading icon + label + description + value. (`subtitle` is a deprecated alias for `description` — ADR-0063, gh#1563.)
|
|
17
17
|
|
|
18
18
|
props:
|
|
19
19
|
icon:
|
|
@@ -25,7 +25,20 @@ props:
|
|
|
25
25
|
type: string
|
|
26
26
|
default: ""
|
|
27
27
|
subtitle:
|
|
28
|
-
description:
|
|
28
|
+
description: >-
|
|
29
|
+
DEPRECATED (ADR-0063, gh#1563) — use `description` instead. Same
|
|
30
|
+
type/default/rendered position; kept working as a dual-read compat
|
|
31
|
+
shim (one-time console.warn when it's the name that resolves).
|
|
32
|
+
Removed in 0.9.0. (The `subtitle` SLOT below is a separate surface,
|
|
33
|
+
deliberately left unrenamed in this pass — see its own description.)
|
|
34
|
+
type: string
|
|
35
|
+
default: ""
|
|
36
|
+
description:
|
|
37
|
+
description: >-
|
|
38
|
+
Optional secondary description line rendered under the label.
|
|
39
|
+
Canonical spelling (ADR-0063, gh#1563) replacing `subtitle` —
|
|
40
|
+
converges menu-item onto the ~20-component corpus majority that
|
|
41
|
+
already names this concept `description`.
|
|
29
42
|
type: string
|
|
30
43
|
default: ""
|
|
31
44
|
value:
|
|
@@ -49,7 +62,11 @@ slots:
|
|
|
49
62
|
text:
|
|
50
63
|
description: Custom label content; falls through to `[text]` prop if not slotted.
|
|
51
64
|
subtitle:
|
|
52
|
-
description:
|
|
65
|
+
description: >-
|
|
66
|
+
Custom secondary-line content override; falls through to the
|
|
67
|
+
`[description]` prop (or its deprecated `[subtitle]` alias — ADR-0063,
|
|
68
|
+
gh#1563) if not slotted. The slot's own name is unchanged by that
|
|
69
|
+
rename — this is a distinct, deliberately-unrenamed surface.
|
|
53
70
|
trailing:
|
|
54
71
|
description: Trailing element pinned to the far edge (shortcut hint, check mark).
|
|
55
72
|
|
|
@@ -84,6 +101,10 @@ a2ui:
|
|
|
84
101
|
(icon/text/subtitle/value/variant/disabled props, icon/text/subtitle/
|
|
85
102
|
trailing slot overrides) for inline, non-popover command rows — use
|
|
86
103
|
it instead when the surface isn't a <menu-ui> popover (#1363 C5).
|
|
104
|
+
NOTE (ADR-0063, gh#1563): <menu-item-ui>'s own `subtitle` PROP is now
|
|
105
|
+
a deprecated alias for `description` — <action-item-ui> still uses
|
|
106
|
+
`subtitle` as its own primary spelling and was NOT renamed in this
|
|
107
|
+
pass (flagged as a discovered follow-up candidate, not fixed here).
|
|
87
108
|
|
|
88
109
|
keywords:
|
|
89
110
|
- menu-item
|
|
@@ -258,7 +258,14 @@ export class UIMenuItem extends UIElement {
|
|
|
258
258
|
static properties = {
|
|
259
259
|
icon: { type: String, default: '', reflect: true },
|
|
260
260
|
text: { type: String, default: '', reflect: true },
|
|
261
|
+
// ADR-0063 (gh#1563) — `subtitle` is DEPRECATED (menu-item was the sole
|
|
262
|
+
// ~20-component-corpus outlier using `subtitle` where every sibling
|
|
263
|
+
// uses `description`); `description` is canonical. `subtitle` stays
|
|
264
|
+
// declared (dual-read compat, 0.8.42). The `subtitle` SLOT (a separate
|
|
265
|
+
// surface — see menu-item.yaml) is deliberately unchanged; only the
|
|
266
|
+
// PROP renames.
|
|
261
267
|
subtitle: { type: String, default: '', reflect: true },
|
|
268
|
+
description: { type: String, default: '', reflect: true },
|
|
262
269
|
value: { type: String, default: '', reflect: true },
|
|
263
270
|
variant: { type: String, default: 'default', reflect: true },
|
|
264
271
|
disabled: { type: Boolean, default: false, reflect: true },
|
|
@@ -266,12 +273,32 @@ export class UIMenuItem extends UIElement {
|
|
|
266
273
|
|
|
267
274
|
static template = () => null;
|
|
268
275
|
|
|
276
|
+
// ADR-0063 (gh#1563) one-shot-per-class deprecation warn for [subtitle].
|
|
277
|
+
static #warnedSubtitle = false;
|
|
278
|
+
|
|
269
279
|
// Set when connected() stamped role="menuitem" itself; a consumer-provided
|
|
270
280
|
// role (e.g. admin-roster's role="menuitemradio", gh#616) is never touched
|
|
271
281
|
// — that consumer also owns tabindex and any checked-state aria.
|
|
272
282
|
#roleStamped = false;
|
|
273
283
|
|
|
274
284
|
connected() {
|
|
285
|
+
// ADR-0063 (gh#1563) compat shim — resolve BEFORE #stamp() reads
|
|
286
|
+
// `this.description`, so there's no wrong-then-right flash. New-name
|
|
287
|
+
// precedence: [description] wins outright when present; only fall
|
|
288
|
+
// back to (and mirror) [subtitle] when [description] is absent.
|
|
289
|
+
if (!this.hasAttribute('description') && this.hasAttribute('subtitle')) {
|
|
290
|
+
this.description = this.subtitle;
|
|
291
|
+
if (!UIMenuItem.#warnedSubtitle) {
|
|
292
|
+
UIMenuItem.#warnedSubtitle = true;
|
|
293
|
+
// eslint-disable-next-line no-console
|
|
294
|
+
console.warn(
|
|
295
|
+
'[AdiaUI] <menu-item-ui [subtitle]> is deprecated — use ' +
|
|
296
|
+
'[description] instead (ADR-0063, gh#1563). Kept working as-is; ' +
|
|
297
|
+
'no behavior change.',
|
|
298
|
+
);
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
|
|
275
302
|
// role="menuitem" ONLY when actually inside a menu container. A menu-ui
|
|
276
303
|
// closes by moving its items back into its own light DOM (see #hide()),
|
|
277
304
|
// where there is no role="menu"/menubar ancestor — a bare role="menuitem"
|
|
@@ -324,10 +351,10 @@ export class UIMenuItem extends UIElement {
|
|
|
324
351
|
this.appendChild(span);
|
|
325
352
|
}
|
|
326
353
|
|
|
327
|
-
if (this.
|
|
354
|
+
if (this.description && !this.#ownChild('[slot="subtitle"]')) {
|
|
328
355
|
const sub = this.#stampMark(document.createElement('span'));
|
|
329
356
|
sub.setAttribute('slot', 'subtitle');
|
|
330
|
-
sub.textContent = this.
|
|
357
|
+
sub.textContent = this.description;
|
|
331
358
|
this.appendChild(sub);
|
|
332
359
|
}
|
|
333
360
|
}
|
|
@@ -357,15 +384,16 @@ export class UIMenuItem extends UIElement {
|
|
|
357
384
|
const textEl = this.#ownChild('[slot="text"]');
|
|
358
385
|
if (this.#wasStamped(textEl)) textEl.textContent = this.text;
|
|
359
386
|
|
|
360
|
-
// Sync subtitle
|
|
387
|
+
// Sync subtitle (backed by the `description` prop — ADR-0063, gh#1563)
|
|
388
|
+
// — only touch elements we stamped.
|
|
361
389
|
const subEl = this.#ownChild('[slot="subtitle"]');
|
|
362
|
-
if (this.
|
|
390
|
+
if (this.description) {
|
|
363
391
|
if (subEl) {
|
|
364
|
-
if (this.#wasStamped(subEl)) subEl.textContent = this.
|
|
392
|
+
if (this.#wasStamped(subEl)) subEl.textContent = this.description;
|
|
365
393
|
} else {
|
|
366
394
|
const el = this.#stampMark(document.createElement('span'));
|
|
367
395
|
el.setAttribute('slot', 'subtitle');
|
|
368
|
-
el.textContent = this.
|
|
396
|
+
el.textContent = this.description;
|
|
369
397
|
this.appendChild(el);
|
|
370
398
|
}
|
|
371
399
|
} else if (this.#wasStamped(subEl)) {
|
|
@@ -41,11 +41,13 @@ export class UIMenuDivider extends UIElement {
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
export class UIMenuItem extends UIElement {
|
|
44
|
+
/** Optional secondary description line rendered under the label. Canonical spelling (ADR-0063, gh#1563) replacing `subtitle` — converges menu-item onto the ~20-component corpus majority that already names this concept `description`. */
|
|
45
|
+
description: string;
|
|
44
46
|
/** Disabled state — blocks pointer + keyboard activation. */
|
|
45
47
|
disabled: boolean;
|
|
46
48
|
/** Optional leading Phosphor icon name. */
|
|
47
49
|
icon: string;
|
|
48
|
-
/**
|
|
50
|
+
/** DEPRECATED (ADR-0063, gh#1563) — use `description` instead. Same type/default/rendered position; kept working as a dual-read compat shim (one-time console.warn when it's the name that resolves). Removed in 0.9.0. (The `subtitle` SLOT below is a separate surface, deliberately left unrenamed in this pass — see its own description.) */
|
|
49
51
|
subtitle: string;
|
|
50
52
|
/** Item label text. */
|
|
51
53
|
text: string;
|
|
@@ -21,6 +21,16 @@
|
|
|
21
21
|
"component": {
|
|
22
22
|
"const": "Pane"
|
|
23
23
|
},
|
|
24
|
+
"edge": {
|
|
25
|
+
"description": "Opts a pane into horizontal-sibling chrome: suppresses the default\nfour-sided border and moves the resize grabber to the inner edge\n(right edge for `leading`, left edge for `trailing`). Also flips the\nresize-drag direction so `trailing` panes grow when dragged leftward.\nUnset keeps the pane-intrinsic chrome (full border, right-edge\ngrabber when resizable). Canonical spelling (ADR-0063, gh#1563)\nreplacing `side`.\n",
|
|
26
|
+
"type": "string",
|
|
27
|
+
"enum": [
|
|
28
|
+
"",
|
|
29
|
+
"leading",
|
|
30
|
+
"trailing"
|
|
31
|
+
],
|
|
32
|
+
"default": ""
|
|
33
|
+
},
|
|
24
34
|
"maxWidth": {
|
|
25
35
|
"description": "Component property: maxWidth.",
|
|
26
36
|
"type": "number",
|
|
@@ -37,7 +47,7 @@
|
|
|
37
47
|
"default": false
|
|
38
48
|
},
|
|
39
49
|
"side": {
|
|
40
|
-
"description": "
|
|
50
|
+
"description": "DEPRECATED (ADR-0063, gh#1563) — use `edge` instead. Same type/default/enum; kept working as a dual-read compat shim (one-time console.warn when it's the name that resolves). Removed in 0.9.0.",
|
|
41
51
|
"type": "string",
|
|
42
52
|
"enum": [
|
|
43
53
|
"",
|