@adia-ai/web-components 0.8.42 → 0.8.43
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 +14 -0
- package/MIGRATION.md +130 -80
- package/USAGE.md +1 -1
- package/color/index.js +1 -1
- package/components/action-list/action-item.a2ui.json +3 -8
- package/components/action-list/action-item.yaml +10 -16
- package/components/action-list/action-list.class.js +5 -61
- package/components/action-list/action-list.d.ts +1 -3
- package/components/button/button.yaml +1 -1
- package/components/calendar-picker/calendar-picker.a2ui.json +1 -1
- package/components/calendar-picker/calendar-picker.class.js +2 -3
- package/components/calendar-picker/calendar-picker.css +16 -18
- package/components/calendar-picker/calendar-picker.yaml +2 -2
- package/components/card/card.css +3 -3
- package/components/chart/chart.a2ui.json +3 -18
- package/components/chart/chart.class.js +4 -44
- package/components/chart/chart.d.ts +3 -9
- package/components/chart/chart.yaml +6 -31
- package/components/chart-legend/chart-legend.a2ui.json +3 -12
- package/components/chart-legend/chart-legend.class.js +10 -54
- package/components/chart-legend/chart-legend.d.ts +1 -3
- package/components/chart-legend/chart-legend.yaml +9 -19
- package/components/check/check.css +9 -0
- package/components/color-area/color-area.a2ui.json +1 -1
- package/components/color-area/color-area.class.js +2 -2
- package/components/color-area/color-area.css +4 -7
- package/components/color-area/color-area.d.ts +1 -1
- package/components/color-area/color-area.yaml +3 -3
- package/components/color-input/color-input.a2ui.json +1 -1
- package/components/color-input/color-input.class.js +1 -1
- package/components/color-input/color-input.yaml +2 -2
- package/components/drilldown/drilldown.a2ui.json +3 -0
- package/components/drilldown/drilldown.css +8 -1
- package/components/drilldown/drilldown.yaml +2 -0
- package/components/field/field.class.js +5 -5
- package/components/index.js +0 -4
- package/components/input/input.a2ui.json +4 -4
- package/components/input/input.class.js +8 -0
- package/components/input/input.css +6 -0
- package/components/input/input.yaml +11 -8
- package/components/menu/menu-item.a2ui.json +3 -8
- package/components/menu/menu-item.yaml +13 -21
- package/components/menu/menu.class.js +5 -27
- package/components/menu/menu.d.ts +1 -3
- package/components/pane/pane.a2ui.json +2 -12
- package/components/pane/pane.class.js +5 -30
- package/components/pane/pane.d.ts +3 -5
- package/components/pane/pane.yaml +7 -19
- package/components/progress/progress.a2ui.json +1 -1
- package/components/progress/progress.class.js +2 -2
- package/components/progress/progress.d.ts +1 -1
- package/components/progress/progress.yaml +2 -2
- package/components/radio/radio.css +7 -0
- package/components/search/search.css +10 -1
- package/components/segment/segment.a2ui.json +1 -2
- package/components/segment/segment.css +10 -0
- package/components/segment/segment.yaml +1 -2
- package/components/segmented/segmented.a2ui.json +1 -3
- package/components/segmented/segmented.class.js +2 -2
- package/components/segmented/segmented.yaml +2 -4
- package/components/select/select.css +6 -0
- package/components/step-progress/step-progress.yaml +1 -1
- package/components/switch/switch.css +8 -0
- package/components/table-toolbar/table-toolbar.a2ui.json +42 -1
- package/components/table-toolbar/table-toolbar.class.js +151 -11
- package/components/table-toolbar/table-toolbar.css +46 -0
- package/components/table-toolbar/table-toolbar.d.ts +13 -1
- package/components/table-toolbar/table-toolbar.yaml +104 -14
- package/components/textarea/textarea.css +4 -0
- package/components/time-picker/time-picker.yaml +3 -2
- package/components/tree/tree.yaml +1 -1
- package/components/upload/upload.class.js +16 -0
- package/components/upload/upload.d.ts +7 -0
- package/components/upload/upload.yaml +7 -3
- package/core/icons.js +2 -5
- package/custom-elements.json +101 -597
- package/dist/host.min.css +1 -1
- package/dist/host.sheet.js +1 -1
- package/dist/theme-provider.min.js +1 -1
- package/dist/web-components.min.css +1 -1
- package/dist/web-components.min.js +92 -89
- package/dist/web-components.sheet.js +1 -1
- package/index.d.ts +0 -15
- package/package.json +1 -1
- package/patterns/chart-in-card/chart-in-card.examples.html +10 -10
- package/patterns/conversion-funnel/conversion-funnel.html +2 -2
- package/patterns/editor-shell/editor-shell.examples.html +3 -3
- package/styles/colors/semantics/features.css +8 -1
- package/styles/components.css +0 -4
- package/traits/arrow-grid-nav/arrow-grid-nav.js +1 -1
- package/traits/resize-observer/resize-observer.js +1 -1
- package/components/color-picker/color-picker.a2ui.json +0 -148
- package/components/color-picker/color-picker.class.js +0 -46
- package/components/color-picker/color-picker.css +0 -14
- package/components/color-picker/color-picker.d.ts +0 -99
- package/components/color-picker/color-picker.examples.md +0 -19
- package/components/color-picker/color-picker.js +0 -17
- package/components/color-picker/color-picker.yaml +0 -175
- package/components/datetime-picker/datetime-picker.a2ui.json +0 -256
- package/components/datetime-picker/datetime-picker.class.js +0 -58
- package/components/datetime-picker/datetime-picker.css +0 -11
- package/components/datetime-picker/datetime-picker.d.ts +0 -87
- package/components/datetime-picker/datetime-picker.examples.md +0 -25
- package/components/datetime-picker/datetime-picker.js +0 -17
- package/components/datetime-picker/datetime-picker.yaml +0 -254
- package/components/progress-row/progress-row.a2ui.json +0 -107
- package/components/progress-row/progress-row.class.js +0 -118
- package/components/progress-row/progress-row.css +0 -60
- package/components/progress-row/progress-row.d.ts +0 -24
- package/components/progress-row/progress-row.examples.md +0 -7
- package/components/progress-row/progress-row.js +0 -17
- package/components/progress-row/progress-row.yaml +0 -85
- package/components/toggle-group/toggle-group.a2ui.json +0 -148
- package/components/toggle-group/toggle-group.class.js +0 -195
- package/components/toggle-group/toggle-group.css +0 -127
- package/components/toggle-group/toggle-group.d.ts +0 -50
- package/components/toggle-group/toggle-group.examples.md +0 -33
- package/components/toggle-group/toggle-group.js +0 -18
- package/components/toggle-group/toggle-group.yaml +0 -135
- package/components/toggle-group/toggle-option.a2ui.json +0 -86
- package/components/toggle-group/toggle-option.yaml +0 -75
package/index.d.ts
CHANGED
|
@@ -107,16 +107,6 @@ export type {
|
|
|
107
107
|
ColorAreaConstraintClampEventDetail,
|
|
108
108
|
} from './components/color-area/color-area.js';
|
|
109
109
|
|
|
110
|
-
export type {
|
|
111
|
-
UIColorPicker,
|
|
112
|
-
ColorPickerChangeEvent,
|
|
113
|
-
ColorPickerInputEvent,
|
|
114
|
-
ColorPickerChangeEventDetail,
|
|
115
|
-
ColorPickerClampRecord,
|
|
116
|
-
ColorPickerConstraintClampEvent,
|
|
117
|
-
ColorPickerConstraintClampEventDetail,
|
|
118
|
-
} from './components/color-picker/color-picker.js';
|
|
119
|
-
|
|
120
110
|
export type {
|
|
121
111
|
UIRating,
|
|
122
112
|
RatingChangeEvent,
|
|
@@ -201,7 +191,6 @@ export * from './components/pane/pane.js';
|
|
|
201
191
|
export * from './components/pipeline-status/pipeline-status.js';
|
|
202
192
|
export * from './components/popover/popover.js';
|
|
203
193
|
export * from './components/progress/progress.js';
|
|
204
|
-
export * from './components/progress-row/progress-row.js';
|
|
205
194
|
export * from './components/richtext/richtext.js';
|
|
206
195
|
export * from './components/row/row.js';
|
|
207
196
|
export * from './components/segment/segment.js';
|
|
@@ -219,7 +208,6 @@ export * from './components/tag/tag.js';
|
|
|
219
208
|
export * from './components/text/text.js';
|
|
220
209
|
export * from './components/timeline/timeline.js';
|
|
221
210
|
export * from './components/toast/toast.js';
|
|
222
|
-
export * from './components/toggle-group/toggle-group.js';
|
|
223
211
|
export * from './components/toggle-scheme/toggle-scheme.js';
|
|
224
212
|
export * from './components/toolbar/toolbar.js';
|
|
225
213
|
export * from './components/tooltip/tooltip.js';
|
|
@@ -251,7 +239,6 @@ declare global {
|
|
|
251
239
|
'otp-input-ui': import('./components/otp-input/otp-input.js').UIOtpInput;
|
|
252
240
|
'option-card-ui': import('./components/option-card/option-card.js').UIOptionCard;
|
|
253
241
|
'color-area-ui': import('./components/color-area/color-area.js').UIColorArea;
|
|
254
|
-
'color-picker-ui': import('./components/color-picker/color-picker.js').UIColorPicker;
|
|
255
242
|
'rating-ui': import('./components/rating/rating.js').UIRating;
|
|
256
243
|
'code-ui': import('./components/code/code.js').UICode;
|
|
257
244
|
'calendar-picker-ui': import('./components/calendar-picker/calendar-picker.js').UICalendarPicker;
|
|
@@ -307,7 +294,6 @@ declare global {
|
|
|
307
294
|
'pipeline-status-ui': import('./components/pipeline-status/pipeline-status.js').UIPipelineStatus;
|
|
308
295
|
'popover-ui': import('./components/popover/popover.js').UIPopover;
|
|
309
296
|
'progress-ui': import('./components/progress/progress.js').UIProgress;
|
|
310
|
-
'progress-row-ui': import('./components/progress-row/progress-row.js').UIProgressRow;
|
|
311
297
|
'richtext-ui': import('./components/richtext/richtext.js').UIRichText;
|
|
312
298
|
'row-ui': import('./components/row/row.js').UIRow;
|
|
313
299
|
'segment-ui': import('./components/segment/segment.js').UISegment;
|
|
@@ -325,7 +311,6 @@ declare global {
|
|
|
325
311
|
'text-ui': import('./components/text/text.js').UIText;
|
|
326
312
|
'timeline-ui': import('./components/timeline/timeline.js').UITimeline;
|
|
327
313
|
'toast-ui': import('./components/toast/toast.js').UIToast;
|
|
328
|
-
'toggle-group-ui': import('./components/toggle-group/toggle-group.js').UIToggleGroup;
|
|
329
314
|
'toggle-scheme-ui': import('./components/toggle-scheme/toggle-scheme.js').UIToggleScheme;
|
|
330
315
|
'toolbar-ui': import('./components/toolbar/toolbar.js').UIToolbar;
|
|
331
316
|
'tooltip-ui': import('./components/tooltip/tooltip.js').UITooltip;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adia-ai/web-components",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.43",
|
|
4
4
|
"description": "AdiaUI web components \u2014 vanilla custom elements. A2UI runtime (renderer, registry, streams, wiring) lives in @adia-ai/a2ui.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "./index.d.ts",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
<text-ui slot="description" color="subtle">Last 12 months</text-ui>
|
|
53
53
|
</header>
|
|
54
54
|
<section>
|
|
55
|
-
<chart-ui id="pat-revenue" type="bar" x="month" y="revenue"
|
|
55
|
+
<chart-ui id="pat-revenue" type="bar" x="month" y="revenue" no-values></chart-ui>
|
|
56
56
|
</section>
|
|
57
57
|
<footer>
|
|
58
58
|
<button-ui text="View report" variant="outline" stretch></button-ui>
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
</span>
|
|
78
78
|
</header>
|
|
79
79
|
<section>
|
|
80
|
-
<chart-ui id="pat-mrr" type="line" x="month" y="revenue" smooth="0.4"
|
|
80
|
+
<chart-ui id="pat-mrr" type="line" x="month" y="revenue" smooth="0.4" no-values></chart-ui>
|
|
81
81
|
</section>
|
|
82
82
|
</card-ui>
|
|
83
83
|
</div>
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
</header>
|
|
100
100
|
<section>
|
|
101
101
|
<col-ui gap="3">
|
|
102
|
-
<chart-ui id="pat-sessions" type="bar" x="day" y="sessions"
|
|
102
|
+
<chart-ui id="pat-sessions" type="bar" x="day" y="sessions" no-values></chart-ui>
|
|
103
103
|
<grid-ui columns="3" gap="2">
|
|
104
104
|
<card-ui><section><stat-ui label="Desktop" value="2,840"></stat-ui></section></card-ui>
|
|
105
105
|
<card-ui><section><stat-ui label="Mobile" value="1,590"></stat-ui></section></card-ui>
|
|
@@ -126,7 +126,7 @@
|
|
|
126
126
|
<text-ui slot="description" color="subtle">January – March 2024</text-ui>
|
|
127
127
|
</header>
|
|
128
128
|
<section>
|
|
129
|
-
<chart-ui id="pat-trend-revenue" type="area" x="month" y="revenue"
|
|
129
|
+
<chart-ui id="pat-trend-revenue" type="area" x="month" y="revenue" no-values></chart-ui>
|
|
130
130
|
</section>
|
|
131
131
|
<footer>
|
|
132
132
|
<span slot="heading">Trending up by 5.2% this month</span>
|
|
@@ -175,7 +175,7 @@
|
|
|
175
175
|
</segmented-ui>
|
|
176
176
|
</header>
|
|
177
177
|
<section>
|
|
178
|
-
<chart-ui id="pat-filter-sessions" type="line" x="day" y="sessions"
|
|
178
|
+
<chart-ui id="pat-filter-sessions" type="line" x="day" y="sessions" no-values></chart-ui>
|
|
179
179
|
</section>
|
|
180
180
|
</card-ui>
|
|
181
181
|
</div>
|
|
@@ -186,8 +186,8 @@
|
|
|
186
186
|
<h2 variant="section">Full-bleed chart + legend band</h2>
|
|
187
187
|
<p data-note>
|
|
188
188
|
<code>bleed</code> only earns true edge-to-edge treatment for bare plotted
|
|
189
|
-
marks — a sparkline, or another chart type with both <code>
|
|
190
|
-
and <code>
|
|
189
|
+
marks — a sparkline, or another chart type with both <code>no-grid</code>
|
|
190
|
+
and <code>no-values</code> set (gh#1095). A multi-series chart still
|
|
191
191
|
needs a legend, so keep <code><chart-legend-ui></code> OUT of the
|
|
192
192
|
bled section — wire it to the chart via <code>[for]</code> in a normal
|
|
193
193
|
(inset) section below instead. It reads as its own band beneath the
|
|
@@ -204,7 +204,7 @@
|
|
|
204
204
|
<text-ui slot="description" color="subtle">Last 6 months</text-ui>
|
|
205
205
|
</header>
|
|
206
206
|
<section bleed>
|
|
207
|
-
<chart-ui id="pat-bleed-legend-chart" type="multi-line" x="month" y="revenue,users,churn"
|
|
207
|
+
<chart-ui id="pat-bleed-legend-chart" type="multi-line" x="month" y="revenue,users,churn" no-grid no-values></chart-ui>
|
|
208
208
|
</section>
|
|
209
209
|
<section>
|
|
210
210
|
<chart-legend-ui for="pat-bleed-legend-chart" shape="line"></chart-legend-ui>
|
|
@@ -239,9 +239,9 @@
|
|
|
239
239
|
<h2 variant="section">Rules</h2>
|
|
240
240
|
<ul>
|
|
241
241
|
<li>For sparklines, set <code>bleed</code> on the card's <code><section></code> so the line touches the edges.</li>
|
|
242
|
-
<li><code>bleed</code> is a bare-marks affordance, not a general "edge-to-edge chart" switch (gh#1095). It's safe for a sparkline, or for any other chart <code>type</code> that also sets both <code>
|
|
242
|
+
<li><code>bleed</code> is a bare-marks affordance, not a general "edge-to-edge chart" switch (gh#1095). It's safe for a sparkline, or for any other chart <code>type</code> that also sets both <code>no-grid</code> and <code>no-values</code> — i.e. nothing that renders axis ticks, gridlines, or value text. A chart that still shows guides or values needs the card's normal inset so that text doesn't collide with (and clip under) the card's rounded corners; card.css restores the inset automatically if it detects either case, so a forgotten <code>no-grid</code>/<code>no-values</code> fails safe rather than clipping silently.</li>
|
|
243
243
|
<li>Never put <code><chart-legend-ui></code> inside a <code>bleed</code> section — its badge rows need their own breathing room too. Place it in a plain <code><section></code> immediately after the chart's section, wired via <code>chart-legend-ui[for="<chart id>"]</code> (mirrors <code>.legendData</code>; see the "Full-bleed chart + legend band" example above and <a href="/site/components/chart-legend">chart-legend-ui</a>'s own <code>for</code> docs). card.css also restores the section's inset if a legend ends up inside a bled section anyway, so the fallback stays readable rather than edge-clipped.</li>
|
|
244
|
-
<li>Put <code>
|
|
244
|
+
<li>Put <code>no-values</code> on bar/line charts inside cards — the stat in the header already shows the current number.</li>
|
|
245
245
|
<li>Use <code><stat-ui></code> in the heading slot only when the card's primary metric is a single number; otherwise use <code><h3></code> + description.</li>
|
|
246
246
|
<li>Keep breakdowns shallow — 3–4 stats max. More belongs in a full section, not inside a tile.</li>
|
|
247
247
|
</ul>
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
<link rel="stylesheet" href="../../components/button/button.css">
|
|
15
15
|
<link rel="stylesheet" href="../../components/card/card.css">
|
|
16
16
|
<link rel="stylesheet" href="../../components/col/col.css">
|
|
17
|
-
<link rel="stylesheet" href="../../components/progress
|
|
17
|
+
<link rel="stylesheet" href="../../components/progress/progress.css">
|
|
18
18
|
<link rel="stylesheet" href="../../components/row/row.css">
|
|
19
19
|
<link rel="stylesheet" href="../../components/segment/segment.css">
|
|
20
20
|
<link rel="stylesheet" href="../../components/segmented/segmented.css">
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
<script type="module" src="../../components/button/button.js"></script>
|
|
27
27
|
<script type="module" src="../../components/card/card.js"></script>
|
|
28
28
|
<script type="module" src="../../components/col/col.js"></script>
|
|
29
|
-
<script type="module" src="../../components/progress
|
|
29
|
+
<script type="module" src="../../components/progress/progress.js"></script>
|
|
30
30
|
<script type="module" src="../../components/row/row.js"></script>
|
|
31
31
|
<script type="module" src="../../components/segment/segment.js"></script>
|
|
32
32
|
<script type="module" src="../../components/segmented/segmented.js"></script>
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
|
|
43
43
|
<!-- Leading sidebar — layer tree / outline / file browser -->
|
|
44
44
|
<editor-sidebar slot="leading" collapsible persist="structure">
|
|
45
|
-
<pane-ui
|
|
45
|
+
<pane-ui edge="leading" resizable size="sm">
|
|
46
46
|
<header>Layers</header>
|
|
47
47
|
<section>
|
|
48
48
|
<tree-ui>...</tree-ui>
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
|
|
68
68
|
<!-- Trailing sidebar (optional) — inspector / properties panel -->
|
|
69
69
|
<editor-sidebar slot="trailing" collapsible persist="inspector">
|
|
70
|
-
<pane-ui
|
|
70
|
+
<pane-ui edge="trailing" resizable size="sm">
|
|
71
71
|
<header>Inspector</header>
|
|
72
72
|
<section>
|
|
73
73
|
<field-ui label="Width"><input-ui type="number"></input-ui></field-ui>
|
|
@@ -121,7 +121,7 @@
|
|
|
121
121
|
<h2 variant="section">Authoring rules</h2>
|
|
122
122
|
<ul>
|
|
123
123
|
<li><strong>Cluster-namespaced children only.</strong> Inside <code><editor-shell></code>: <code><editor-toolbar></code>, <code><editor-sidebar></code>, <code><editor-canvas></code>, <code><editor-statusbar></code>. Don't author raw <code><header></code>, <code><footer></code>, <code><div data-editor-body></code>, <code><div data-canvas></code> — retired in v0.4.0.</li>
|
|
124
|
-
<li><strong>Each sidebar wraps a <code><pane-ui></code>.</strong> The pane owns resize; the sidebar owns slot positioning + collapse + persist. <code><pane-ui
|
|
124
|
+
<li><strong>Each sidebar wraps a <code><pane-ui></code>.</strong> The pane owns resize; the sidebar owns slot positioning + collapse + persist. <code><pane-ui edge="leading|trailing"></code> is required so the resize handle lands on the correct edge.</li>
|
|
125
125
|
<li><strong>Canvas reflects <code>[empty]</code>.</strong> Use <code>:has(editor-canvas[empty])</code> to style the shell differently when nothing's open.</li>
|
|
126
126
|
<li><strong>Focus mode is one attribute.</strong> Setting <code>focus-mode</code> on the shell propagates to <code>[full-screen]</code> on the canvas and <code>[focused]</code> on the active sidebar — no JS coordination needed.</li>
|
|
127
127
|
</ul>
|
|
@@ -60,7 +60,14 @@
|
|
|
60
60
|
--a-ui-bg-hover: var(--a-canvas-0-scrim);
|
|
61
61
|
--a-ui-bg-active: var(--a-canvas-0);
|
|
62
62
|
--a-ui-bg-selected: var(--a-bg-selected);
|
|
63
|
-
|
|
63
|
+
/* gh#1596 (2026-08-17): was --a-canvas-1 (a surface-ladder tint) — a
|
|
64
|
+
disabled filled control (button/input/textarea/otp-input/upload/tag,
|
|
65
|
+
each via their own --<component>-bg-disabled indirection below) still
|
|
66
|
+
read as a "dimmed active control" rather than inert. Container-low is
|
|
67
|
+
the same 10%-tint role --a-bg-hover/--a-bg-muted already use for
|
|
68
|
+
rest-state de-emphasis (semantics/core.css) — disabled rides that same
|
|
69
|
+
ladder instead of a one-off surface tint. */
|
|
70
|
+
--a-ui-bg-disabled: var(--md-sys-color-neutral-container-low);
|
|
64
71
|
--a-ui-bg-invalid: var(--a-danger-muted);
|
|
65
72
|
|
|
66
73
|
--a-ui-text: var(--a-fg-strong);
|
package/styles/components.css
CHANGED
|
@@ -43,7 +43,6 @@
|
|
|
43
43
|
@import "../components/breadcrumb/breadcrumb.css";
|
|
44
44
|
@import "../components/command/command.css";
|
|
45
45
|
@import "../components/color-area/color-area.css";
|
|
46
|
-
@import "../components/color-picker/color-picker.css";
|
|
47
46
|
@import "../components/color-input/color-input.css";
|
|
48
47
|
@import "../components/noodles/noodles.css";
|
|
49
48
|
@import "../components/table/table.css";
|
|
@@ -101,16 +100,13 @@
|
|
|
101
100
|
@import "../components/image/image.css";
|
|
102
101
|
@import "../components/search/search.css";
|
|
103
102
|
@import "../components/stat/stat.css";
|
|
104
|
-
@import "../components/progress-row/progress-row.css";
|
|
105
103
|
@import "../components/action-list/action-list.css";
|
|
106
104
|
@import "../components/empty-state/empty-state.css";
|
|
107
105
|
@import "../components/calendar-grid/calendar-grid.css";
|
|
108
106
|
@import "../components/calendar-picker/calendar-picker.css";
|
|
109
|
-
@import "../components/datetime-picker/datetime-picker.css";
|
|
110
107
|
@import "../components/embed/embed.css";
|
|
111
108
|
@import "../components/block/block.css";
|
|
112
109
|
@import "../components/text/text.css";
|
|
113
|
-
@import "../components/toggle-group/toggle-group.css";
|
|
114
110
|
@import "../components/toggle-scheme/toggle-scheme.css";
|
|
115
111
|
@import "../components/demo-toggle/demo-toggle.css";
|
|
116
112
|
@import "../components/richtext/richtext.css";
|
|
@@ -27,7 +27,7 @@ export const arrowGridNav = defineTrait({
|
|
|
27
27
|
attributes: ['data-arrow-grid-nav-active', 'data-grid-active-row', 'data-grid-active-col'],
|
|
28
28
|
events: ['grid-activate', 'grid-edge', 'grid-cell-change'],
|
|
29
29
|
config: ['data-grid-columns', 'data-grid-mode'],
|
|
30
|
-
prefixes: ['grid'], // ADR-0060 — grandfathered;
|
|
30
|
+
prefixes: ['grid'], // ADR-0060 — grandfathered; the historical `data-grid` graze (admin-shell's layout helper) was renamed away at the 0.9.0 rename-wave cut (docs/ops/plan/plan-090-rename-wave.md W3, gh#1562) — KNOWN_GRAZING_PAIRS is now empty
|
|
31
31
|
setup({ host }) {
|
|
32
32
|
let activeRow = 0;
|
|
33
33
|
let activeCol = 0;
|
|
@@ -7,7 +7,7 @@ export const resizeObserver = defineTrait({
|
|
|
7
7
|
attributes: ['data-resize-observer-observed', 'data-resize-width', 'data-resize-height'],
|
|
8
8
|
events: ['element-resize'],
|
|
9
9
|
config: [],
|
|
10
|
-
prefixes: ['resize'], // ADR-0060 — grandfathered;
|
|
10
|
+
prefixes: ['resize'], // ADR-0060 — grandfathered; table's `data-resize-handle` graze was renamed away in gh#1332, and shells' `data-resize` graze was renamed away at the 0.9.0 rename-wave cut (docs/ops/plan/plan-090-rename-wave.md W3, gh#1562) — KNOWN_GRAZING_PAIRS is now empty
|
|
11
11
|
setup({ host }) {
|
|
12
12
|
// Guard for older browsers + non-DOM test environments (happy-dom, jsdom
|
|
13
13
|
// without polyfill). The trait becomes a no-op rather than throwing on
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"$id": "https://adiaui.dev/a2ui/v0_9/components/ColorPicker.json",
|
|
4
|
-
"title": "ColorPicker",
|
|
5
|
-
"description": "DEPRECATED (ADR-0063, gh#1563, gh#1377 B11) — `-picker` is reserved for the outer, trigger + popover, form-associated composite shape (`calendar-picker-ui` / `date-range-picker-ui` / `datetime-picker-ui` / `time-picker-ui`); `color-picker-ui` was the sole violator, playing `calendar-grid-ui`'s inline-substrate role under a `-picker` name. `<color-picker-ui>` is now a thin `UIColorArea` subclass (see color-picker.class.js) rather than an independent implementation — every prop/event/token is inherited unchanged from `<color-area-ui>`. Existing markup keeps working, but new markup should reach for `<color-area-ui>` directly. See `<color-area-ui>` for the full contract.",
|
|
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
|
-
"baseHue": {
|
|
17
|
-
"description": "Reference hue (degrees) for the [hue-drift-max] constraint. Default\nNaN — falls back to the picker's hue at first commit so the consumer\ncan pre-seed the picker and constrain drift from that initial value.\n",
|
|
18
|
-
"type": "number",
|
|
19
|
-
"default": "NaN"
|
|
20
|
-
},
|
|
21
|
-
"component": {
|
|
22
|
-
"const": "ColorPicker"
|
|
23
|
-
},
|
|
24
|
-
"disabled": {
|
|
25
|
-
"description": "Disables all interaction",
|
|
26
|
-
"type": "boolean",
|
|
27
|
-
"default": false
|
|
28
|
-
},
|
|
29
|
-
"format": {
|
|
30
|
-
"description": "Output format for the value property",
|
|
31
|
-
"type": "string",
|
|
32
|
-
"enum": [
|
|
33
|
-
"hex",
|
|
34
|
-
"oklch"
|
|
35
|
-
],
|
|
36
|
-
"default": "hex"
|
|
37
|
-
},
|
|
38
|
-
"hueDriftMax": {
|
|
39
|
-
"description": "Generation constraint — maximum allowed signed-shortest-path hue\ndeviation (degrees) from [base-hue] (or the first-committed hue\nif [base-hue] is unset). Default NaN (no constraint). Wrap-aware\nso a drift of 350 degrees resolves as -10.\n",
|
|
40
|
-
"type": "number",
|
|
41
|
-
"default": "NaN"
|
|
42
|
-
},
|
|
43
|
-
"maxChroma": {
|
|
44
|
-
"description": "Generation constraint (v0.4.9 §99h, FEEDBACK-02 #7) — clamp the\nOKLCH chroma channel to at most this value before commit. Out-of-\nbound mutations round-trip to the nearest in-bound equivalent +\nfire `constraint-clamp`. Default Infinity (no constraint).\n",
|
|
45
|
-
"type": "number",
|
|
46
|
-
"default": "Infinity"
|
|
47
|
-
},
|
|
48
|
-
"maxL": {
|
|
49
|
-
"description": "Generation constraint — clamp OKLCH lightness to at most this value (0..1). Default 1 (no constraint).",
|
|
50
|
-
"type": "number",
|
|
51
|
-
"default": 1
|
|
52
|
-
},
|
|
53
|
-
"minL": {
|
|
54
|
-
"description": "Generation constraint — clamp OKLCH lightness to at least this value (0..1). Default 0 (no constraint).",
|
|
55
|
-
"type": "number",
|
|
56
|
-
"default": 0
|
|
57
|
-
},
|
|
58
|
-
"name": {
|
|
59
|
-
"description": "Form field name",
|
|
60
|
-
"type": "string",
|
|
61
|
-
"default": ""
|
|
62
|
-
},
|
|
63
|
-
"value": {
|
|
64
|
-
"description": "Current color as hex string",
|
|
65
|
-
"type": "string",
|
|
66
|
-
"default": "#3b82f6"
|
|
67
|
-
}
|
|
68
|
-
},
|
|
69
|
-
"required": [
|
|
70
|
-
"component"
|
|
71
|
-
],
|
|
72
|
-
"unevaluatedProperties": false,
|
|
73
|
-
"x-adiaui": {
|
|
74
|
-
"anti_patterns": [
|
|
75
|
-
{
|
|
76
|
-
"fix": "{\"component\": \"ColorArea\", \"name\": \"brand\"}\n",
|
|
77
|
-
"why": "ColorPicker is deprecated (ADR-0063, gh#1563) — new generation should\nreach for ColorArea instead.\n",
|
|
78
|
-
"wrong": "{\"component\": \"ColorPicker\", \"name\": \"brand\"}\n"
|
|
79
|
-
}
|
|
80
|
-
],
|
|
81
|
-
"category": "input",
|
|
82
|
-
"composes": [
|
|
83
|
-
"slider-ui"
|
|
84
|
-
],
|
|
85
|
-
"events": {
|
|
86
|
-
"change": {
|
|
87
|
-
"description": "Fired on every color change"
|
|
88
|
-
},
|
|
89
|
-
"constraint-clamp": {
|
|
90
|
-
"description": "Fired immediately before `change` / `input` when one or more\nconsumer-declared constraints (max-chroma / max-l / min-l /\nhue-drift-max) clamped a channel away from the user-requested\nvalue. detail.clamps is an array of axis-specific clamp records.\n",
|
|
91
|
-
"detail": {
|
|
92
|
-
"clamps": {
|
|
93
|
-
"description": "Array of `{ axis, requested, clamped, reason }` objects. axis is\none of \"l\" / \"c\" / \"h\". reason names the triggering constraint\nprop. Empty arrays are never emitted.\n",
|
|
94
|
-
"type": "array"
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
},
|
|
98
|
-
"input": {
|
|
99
|
-
"description": "Fired during continuous interaction (drag)"
|
|
100
|
-
}
|
|
101
|
-
},
|
|
102
|
-
"examples": [
|
|
103
|
-
{
|
|
104
|
-
"description": "Deprecated tag — prefer ColorArea's own \"color-area-demo\" example for NEW markup.",
|
|
105
|
-
"a2ui": "[\n {\n \"id\": \"root\",\n \"component\": \"Card\",\n \"children\": [\n \"sec\"\n ]\n },\n {\n \"id\": \"sec\",\n \"component\": \"Section\",\n \"children\": [\n \"cp\"\n ]\n },\n {\n \"id\": \"cp\",\n \"component\": \"ColorPicker\",\n \"value\": \"#3b82f6\"\n }\n]",
|
|
106
|
-
"name": "color-picker-legacy"
|
|
107
|
-
}
|
|
108
|
-
],
|
|
109
|
-
"keywords": [
|
|
110
|
-
"colorpicker",
|
|
111
|
-
"color-picker",
|
|
112
|
-
"color",
|
|
113
|
-
"picker"
|
|
114
|
-
],
|
|
115
|
-
"name": "UIColorPicker",
|
|
116
|
-
"parts": {},
|
|
117
|
-
"related": [
|
|
118
|
-
"color-area",
|
|
119
|
-
"grid",
|
|
120
|
-
"button"
|
|
121
|
-
],
|
|
122
|
-
"slots": {},
|
|
123
|
-
"states": [
|
|
124
|
-
{
|
|
125
|
-
"description": "Default, ready for interaction.",
|
|
126
|
-
"name": "idle"
|
|
127
|
-
},
|
|
128
|
-
{
|
|
129
|
-
"description": "Non-interactive; dimmed.",
|
|
130
|
-
"attribute": "disabled",
|
|
131
|
-
"name": "disabled"
|
|
132
|
-
}
|
|
133
|
-
],
|
|
134
|
-
"status": "deprecated",
|
|
135
|
-
"synonyms": {
|
|
136
|
-
"color-picker": [
|
|
137
|
-
"color-canvas",
|
|
138
|
-
"color-surface",
|
|
139
|
-
"swatch-picker",
|
|
140
|
-
"color-area"
|
|
141
|
-
]
|
|
142
|
-
},
|
|
143
|
-
"tag": "color-picker-ui",
|
|
144
|
-
"tokens": {},
|
|
145
|
-
"traits": [],
|
|
146
|
-
"version": 2
|
|
147
|
-
}
|
|
148
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Non-side-effect class export for `<color-picker-ui>`.
|
|
3
|
-
*
|
|
4
|
-
* Importing this file gives you the class without auto-registering the tag.
|
|
5
|
-
* Useful for test isolation, subclassing with tag-name override, or selective
|
|
6
|
-
* composition.
|
|
7
|
-
*
|
|
8
|
-
* The auto-register path stays at `@adia-ai/web-components/components/color-picker`
|
|
9
|
-
* (which imports this file + calls `defineIfFree()`).
|
|
10
|
-
*
|
|
11
|
-
* @see ../../USAGE.md#registration--auto-vs-explicit
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* <color-picker-ui> — DEPRECATED (ADR-0063, gh#1563, gh#1377 B11).
|
|
16
|
-
*
|
|
17
|
-
* `-picker` is reserved for the outer, trigger + popover, form-associated
|
|
18
|
-
* composite shape (`calendar-picker-ui` / `date-range-picker-ui` /
|
|
19
|
-
* `datetime-picker-ui` / `time-picker-ui`) — `color-picker-ui` was the sole
|
|
20
|
-
* violator, playing `calendar-grid-ui`'s inline-substrate role under a
|
|
21
|
-
* `-picker` name. The real implementation moved to `<color-area-ui>`
|
|
22
|
-
* (mirrors `calendar-grid-ui`'s own plain, shape-describing substrate
|
|
23
|
-
* naming). `<color-picker-ui>` is now a thin compatibility alias per
|
|
24
|
-
* ADR-0057's `status: deprecated` shape (same pattern as
|
|
25
|
-
* `<datetime-picker-ui>` → `<calendar-picker-ui>`, gh#1372): it subclasses
|
|
26
|
-
* `UIColorArea` directly rather than re-implementing any behavior.
|
|
27
|
-
*
|
|
28
|
-
* Migrate: `<color-picker-ui>` → `<color-area-ui>`. This tag keeps
|
|
29
|
-
* working — it IS `<color-area-ui>` under the hood — but will be removed
|
|
30
|
-
* in a future major; new markup should reach for `<color-area-ui>`
|
|
31
|
-
* directly.
|
|
32
|
-
*
|
|
33
|
-
* @see ../color-area/color-area.class.js
|
|
34
|
-
*/
|
|
35
|
-
|
|
36
|
-
import { UIColorArea } from '../color-area/color-area.class.js';
|
|
37
|
-
|
|
38
|
-
export class UIColorPicker extends UIColorArea {
|
|
39
|
-
// Same value as UIColorArea's — the alias stamps no icon of its own —
|
|
40
|
-
// but restated literally because scripts/release/check-required-icons.mjs
|
|
41
|
-
// text-scans each component's own class.js and cannot resolve inheritance
|
|
42
|
-
// (gh#1503, same rationale datetime-picker.class.js documents).
|
|
43
|
-
static requiredIcons = ['copy', 'check', 'warning'];
|
|
44
|
-
|
|
45
|
-
static properties = { ...UIColorArea.properties };
|
|
46
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
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
|
-
*/
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `<color-picker-ui>` — OKLCH-native color picker with 2D area + H/C/L sliders.
|
|
3
|
-
*
|
|
4
|
-
* Form-associated (extends UIFormElement). The `[format]` attribute controls
|
|
5
|
-
* whether `value` is read/written as a `#rrggbb` hex string or an `oklch(L C H)`
|
|
6
|
-
* string, but the event detail always carries BOTH forms plus the parsed
|
|
7
|
-
* OKLCH channel scalars — consumers don't need to parse the string.
|
|
8
|
-
*
|
|
9
|
-
* @see https://ui-kit.exe.xyz/site/components/color-picker
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
import { UIFormElement } from '../../core/form.js';
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Output format selected by the `[format]` attribute. Drives the shape of
|
|
16
|
-
* `value` (and the matching `detail.value` field). Both `hex` and `oklch`
|
|
17
|
-
* forms are always present on the event detail regardless of `[format]`.
|
|
18
|
-
*/
|
|
19
|
-
export type ColorFormat = 'hex' | 'oklch';
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Detail payload for both `change` (commit) and `input` (continuous drag)
|
|
23
|
-
* events. Carries parsed channel scalars + both string forms — `value`
|
|
24
|
-
* mirrors the picker's current `[format]`, while `hex` and `oklch` are
|
|
25
|
-
* always populated parallel views.
|
|
26
|
-
*/
|
|
27
|
-
export interface ColorPickerChangeEventDetail {
|
|
28
|
-
/** Format-respecting string. Equals `hex` when `[format="hex"]`; equals `oklch` when `[format="oklch"]`. */
|
|
29
|
-
value: string;
|
|
30
|
-
/** OKLCH lightness (0–1). */
|
|
31
|
-
l: number;
|
|
32
|
-
/** OKLCH chroma (0–~0.4). */
|
|
33
|
-
c: number;
|
|
34
|
-
/** OKLCH hue (0–360, degrees). */
|
|
35
|
-
h: number;
|
|
36
|
-
/** Hex string (`#rrggbb`). Gamut-mapped to sRGB. */
|
|
37
|
-
hex: string;
|
|
38
|
-
/** OKLCH string (`oklch(L C H)`, fixed precision). */
|
|
39
|
-
oklch: string;
|
|
40
|
-
}
|
|
41
|
-
export type ColorPickerChangeEvent = CustomEvent<ColorPickerChangeEventDetail>;
|
|
42
|
-
export type ColorPickerInputEvent = CustomEvent<ColorPickerChangeEventDetail>;
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Axis-specific clamp record. Fires when a consumer-declared constraint
|
|
46
|
-
* (max-chroma / max-l / min-l / hue-drift-max) clamped a user-requested
|
|
47
|
-
* channel value to its in-bound equivalent.
|
|
48
|
-
*/
|
|
49
|
-
export interface ColorPickerClampRecord {
|
|
50
|
-
/** OKLCH axis that was clamped. */
|
|
51
|
-
axis: 'l' | 'c' | 'h';
|
|
52
|
-
/** Channel value the user requested before the clamp. */
|
|
53
|
-
requested: number;
|
|
54
|
-
/** Channel value the picker actually committed after the clamp. */
|
|
55
|
-
clamped: number;
|
|
56
|
-
/** Constraint prop that triggered the clamp. */
|
|
57
|
-
reason: 'max-l' | 'min-l' | 'max-chroma' | 'hue-drift-max';
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Detail payload for the `constraint-clamp` event — fired immediately
|
|
62
|
-
* before the corresponding `change` / `input` when one or more axes
|
|
63
|
-
* were clamped to fit the consumer's declared constraints. `clamps`
|
|
64
|
-
* is never empty.
|
|
65
|
-
*/
|
|
66
|
-
export interface ColorPickerConstraintClampEventDetail {
|
|
67
|
-
clamps: ColorPickerClampRecord[];
|
|
68
|
-
}
|
|
69
|
-
export type ColorPickerConstraintClampEvent = CustomEvent<ColorPickerConstraintClampEventDetail>;
|
|
70
|
-
|
|
71
|
-
export class UIColorPicker extends UIFormElement {
|
|
72
|
-
/** Form field name. */
|
|
73
|
-
name: string;
|
|
74
|
-
/** Disables all interaction. */
|
|
75
|
-
disabled: boolean;
|
|
76
|
-
/** Current color as a string in the active `format`. */
|
|
77
|
-
value: string;
|
|
78
|
-
/** Output format — drives the shape of `value`. Detail always carries both `hex` and `oklch`. */
|
|
79
|
-
format: ColorFormat;
|
|
80
|
-
/** Clamp the OKLCH chroma channel to at most this value. `Infinity` = unconstrained. */
|
|
81
|
-
maxChroma: number;
|
|
82
|
-
/** Clamp the OKLCH lightness channel to at most this value (0..1). `1` = unconstrained. */
|
|
83
|
-
maxL: number;
|
|
84
|
-
/** Clamp the OKLCH lightness channel to at least this value (0..1). `0` = unconstrained. */
|
|
85
|
-
minL: number;
|
|
86
|
-
/** Maximum allowed signed-shortest-path hue drift in degrees from `baseHue`. `NaN` = unconstrained. */
|
|
87
|
-
hueDriftMax: number;
|
|
88
|
-
/** Reference hue (degrees) for the `hueDriftMax` constraint. `NaN` = use the picker's hue at first commit. */
|
|
89
|
-
baseHue: number;
|
|
90
|
-
|
|
91
|
-
addEventListener<K extends keyof HTMLElementEventMap>(
|
|
92
|
-
type: K,
|
|
93
|
-
listener: (this: UIColorPicker, ev: HTMLElementEventMap[K]) => unknown,
|
|
94
|
-
options?: boolean | AddEventListenerOptions,
|
|
95
|
-
): void;
|
|
96
|
-
addEventListener(type: 'change', listener: (ev: ColorPickerChangeEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
97
|
-
addEventListener(type: 'input', listener: (ev: ColorPickerInputEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
98
|
-
addEventListener(type: 'constraint-clamp', listener: (ev: ColorPickerConstraintClampEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
99
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
# color-picker — Examples
|
|
2
|
-
|
|
3
|
-
## Default
|
|
4
|
-
|
|
5
|
-
```html
|
|
6
|
-
<color-picker-ui></color-picker-ui>
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
## Pre-set Colors
|
|
10
|
-
|
|
11
|
-
```html
|
|
12
|
-
<color-picker-ui value="#3b82f6"></color-picker-ui>
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
## disabled
|
|
16
|
-
|
|
17
|
-
```html
|
|
18
|
-
<color-picker-ui value="#3b82f6" disabled></color-picker-ui>
|
|
19
|
-
```
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `<color-picker-ui>` — auto-registers the tag on import.
|
|
3
|
-
*
|
|
4
|
-
* For non-side-effect class import (test isolation, tag override), use
|
|
5
|
-
* the `class` subpath:
|
|
6
|
-
*
|
|
7
|
-
* import { UIColorPicker } from '@adia-ai/web-components/components/color-picker/class';
|
|
8
|
-
*
|
|
9
|
-
* @see ../../USAGE.md#registration--auto-vs-explicit
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
import { defineIfFree } from '../../core/register.js';
|
|
13
|
-
import { UIColorPicker } from './color-picker.class.js';
|
|
14
|
-
|
|
15
|
-
defineIfFree('color-picker-ui', UIColorPicker);
|
|
16
|
-
|
|
17
|
-
export { UIColorPicker };
|