@adia-ai/web-components 0.8.41 → 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 +35 -0
- package/MIGRATION.md +240 -3
- package/USAGE.md +4 -4
- package/color/index.js +1 -1
- package/components/action-list/action-item.a2ui.json +7 -7
- package/components/action-list/action-item.yaml +21 -9
- package/components/action-list/action-list.class.js +13 -7
- package/components/action-list/action-list.d.ts +2 -2
- 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 +8 -8
- package/components/chart/chart.class.js +21 -19
- package/components/chart/chart.d.ts +6 -6
- package/components/chart/chart.yaml +16 -9
- package/components/chart-legend/chart-legend.a2ui.json +7 -11
- package/components/chart-legend/chart-legend.class.js +17 -8
- package/components/chart-legend/chart-legend.css +5 -2
- package/components/chart-legend/chart-legend.d.ts +2 -2
- package/components/chart-legend/chart-legend.yaml +12 -8
- package/components/check/check.css +9 -0
- package/components/{color-picker/color-picker.a2ui.json → color-area/color-area.a2ui.json} +15 -12
- package/components/{color-picker/color-picker.class.js → color-area/color-area.class.js} +10 -8
- package/components/color-area/color-area.css +185 -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-picker/color-picker.yaml → color-area/color-area.yaml} +17 -9
- 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/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/drilldown/drilldown.a2ui.json +3 -0
- package/components/drilldown/drilldown.css +8 -1
- package/components/drilldown/drilldown.yaml +2 -0
- package/components/field/field.a2ui.json +1 -1
- package/components/field/field.class.js +5 -2
- package/components/field/field.yaml +1 -1
- package/components/index.js +1 -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/integration-card/integration-card.examples.md +2 -1
- package/components/menu/menu-item.a2ui.json +7 -7
- package/components/menu/menu-item.yaml +20 -7
- package/components/menu/menu.class.js +13 -7
- package/components/menu/menu.d.ts +2 -2
- package/components/pane/pane.a2ui.json +11 -11
- package/components/pane/pane.class.js +8 -4
- package/components/pane/pane.css +15 -10
- package/components/pane/pane.d.ts +10 -9
- package/components/pane/pane.yaml +9 -7
- 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/swatch/swatch.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 +166 -14
- 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 +3 -1
- package/custom-elements.json +147 -468
- 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 +88 -85
- package/dist/web-components.sheet.js +1 -1
- package/index.d.ts +9 -13
- package/package.json +1 -1
- package/patterns/admin-shell/admin-shell.examples.html +2 -2
- 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/patterns/form-system/form-system.examples.html +1 -1
- package/styles/colors/semantics/features.css +8 -1
- package/styles/components.css +1 -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.css +0 -182
- 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/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
|
@@ -97,15 +97,15 @@ export type {
|
|
|
97
97
|
} from './components/option-card/option-card.js';
|
|
98
98
|
|
|
99
99
|
export type {
|
|
100
|
-
|
|
100
|
+
UIColorArea,
|
|
101
101
|
ColorFormat,
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
} from './components/color-
|
|
102
|
+
ColorAreaChangeEvent,
|
|
103
|
+
ColorAreaInputEvent,
|
|
104
|
+
ColorAreaChangeEventDetail,
|
|
105
|
+
ColorAreaClampRecord,
|
|
106
|
+
ColorAreaConstraintClampEvent,
|
|
107
|
+
ColorAreaConstraintClampEventDetail,
|
|
108
|
+
} from './components/color-area/color-area.js';
|
|
109
109
|
|
|
110
110
|
export type {
|
|
111
111
|
UIRating,
|
|
@@ -191,7 +191,6 @@ export * from './components/pane/pane.js';
|
|
|
191
191
|
export * from './components/pipeline-status/pipeline-status.js';
|
|
192
192
|
export * from './components/popover/popover.js';
|
|
193
193
|
export * from './components/progress/progress.js';
|
|
194
|
-
export * from './components/progress-row/progress-row.js';
|
|
195
194
|
export * from './components/richtext/richtext.js';
|
|
196
195
|
export * from './components/row/row.js';
|
|
197
196
|
export * from './components/segment/segment.js';
|
|
@@ -209,7 +208,6 @@ export * from './components/tag/tag.js';
|
|
|
209
208
|
export * from './components/text/text.js';
|
|
210
209
|
export * from './components/timeline/timeline.js';
|
|
211
210
|
export * from './components/toast/toast.js';
|
|
212
|
-
export * from './components/toggle-group/toggle-group.js';
|
|
213
211
|
export * from './components/toggle-scheme/toggle-scheme.js';
|
|
214
212
|
export * from './components/toolbar/toolbar.js';
|
|
215
213
|
export * from './components/tooltip/tooltip.js';
|
|
@@ -240,7 +238,7 @@ declare global {
|
|
|
240
238
|
'search-ui': import('./components/search/search.js').UISearch;
|
|
241
239
|
'otp-input-ui': import('./components/otp-input/otp-input.js').UIOtpInput;
|
|
242
240
|
'option-card-ui': import('./components/option-card/option-card.js').UIOptionCard;
|
|
243
|
-
'color-
|
|
241
|
+
'color-area-ui': import('./components/color-area/color-area.js').UIColorArea;
|
|
244
242
|
'rating-ui': import('./components/rating/rating.js').UIRating;
|
|
245
243
|
'code-ui': import('./components/code/code.js').UICode;
|
|
246
244
|
'calendar-picker-ui': import('./components/calendar-picker/calendar-picker.js').UICalendarPicker;
|
|
@@ -296,7 +294,6 @@ declare global {
|
|
|
296
294
|
'pipeline-status-ui': import('./components/pipeline-status/pipeline-status.js').UIPipelineStatus;
|
|
297
295
|
'popover-ui': import('./components/popover/popover.js').UIPopover;
|
|
298
296
|
'progress-ui': import('./components/progress/progress.js').UIProgress;
|
|
299
|
-
'progress-row-ui': import('./components/progress-row/progress-row.js').UIProgressRow;
|
|
300
297
|
'richtext-ui': import('./components/richtext/richtext.js').UIRichText;
|
|
301
298
|
'row-ui': import('./components/row/row.js').UIRow;
|
|
302
299
|
'segment-ui': import('./components/segment/segment.js').UISegment;
|
|
@@ -314,7 +311,6 @@ declare global {
|
|
|
314
311
|
'text-ui': import('./components/text/text.js').UIText;
|
|
315
312
|
'timeline-ui': import('./components/timeline/timeline.js').UITimeline;
|
|
316
313
|
'toast-ui': import('./components/toast/toast.js').UIToast;
|
|
317
|
-
'toggle-group-ui': import('./components/toggle-group/toggle-group.js').UIToggleGroup;
|
|
318
314
|
'toggle-scheme-ui': import('./components/toggle-scheme/toggle-scheme.js').UIToggleScheme;
|
|
319
315
|
'toolbar-ui': import('./components/toolbar/toolbar.js').UIToolbar;
|
|
320
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",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
<admin-statusbar slot="footer">
|
|
43
43
|
<select-ui avatar="…" value="user" variant="ghost" style="flex:1"></select-ui>
|
|
44
44
|
</admin-statusbar>
|
|
45
|
-
<div data-resize></div>
|
|
45
|
+
<div data-sidebar-resize></div>
|
|
46
46
|
</admin-sidebar>
|
|
47
47
|
|
|
48
48
|
<!-- MAIN content column — breadcrumb topbar · scrollable page · status footer -->
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
<button-ui slot="action" data-sidebar-toggle="trailing" icon="x" variant="ghost" size="sm"></button-ui>
|
|
87
87
|
</admin-topbar>
|
|
88
88
|
<section-ui>…</section-ui>
|
|
89
|
-
<div data-resize></div>
|
|
89
|
+
<div data-sidebar-resize></div>
|
|
90
90
|
</admin-sidebar>
|
|
91
91
|
|
|
92
92
|
<!-- Command palette — top-level child, NOT nested in admin-content -->
|
|
@@ -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>
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
<tr><td>Segmented</td><td><code>segmented-ui</code></td><td>String</td></tr>
|
|
54
54
|
<tr><td>OTP Input</td><td><code>otp-input-ui</code></td><td>String</td></tr>
|
|
55
55
|
<tr><td>Calendar Picker</td><td><code>calendar-picker-ui</code></td><td>Date string</td></tr>
|
|
56
|
-
<tr><td>Color Picker</td><td><code>color-
|
|
56
|
+
<tr><td>Color Picker</td><td><code>color-area-ui</code></td><td>Color string</td></tr>
|
|
57
57
|
<tr><td>Upload</td><td><code>upload-ui</code></td><td>File(s)</td></tr>
|
|
58
58
|
</tbody>
|
|
59
59
|
</table>
|
|
@@ -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
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
@import "../components/badge/badge.css";
|
|
43
43
|
@import "../components/breadcrumb/breadcrumb.css";
|
|
44
44
|
@import "../components/command/command.css";
|
|
45
|
-
@import "../components/color-
|
|
45
|
+
@import "../components/color-area/color-area.css";
|
|
46
46
|
@import "../components/color-input/color-input.css";
|
|
47
47
|
@import "../components/noodles/noodles.css";
|
|
48
48
|
@import "../components/table/table.css";
|
|
@@ -100,16 +100,13 @@
|
|
|
100
100
|
@import "../components/image/image.css";
|
|
101
101
|
@import "../components/search/search.css";
|
|
102
102
|
@import "../components/stat/stat.css";
|
|
103
|
-
@import "../components/progress-row/progress-row.css";
|
|
104
103
|
@import "../components/action-list/action-list.css";
|
|
105
104
|
@import "../components/empty-state/empty-state.css";
|
|
106
105
|
@import "../components/calendar-grid/calendar-grid.css";
|
|
107
106
|
@import "../components/calendar-picker/calendar-picker.css";
|
|
108
|
-
@import "../components/datetime-picker/datetime-picker.css";
|
|
109
107
|
@import "../components/embed/embed.css";
|
|
110
108
|
@import "../components/block/block.css";
|
|
111
109
|
@import "../components/text/text.css";
|
|
112
|
-
@import "../components/toggle-group/toggle-group.css";
|
|
113
110
|
@import "../components/toggle-scheme/toggle-scheme.css";
|
|
114
111
|
@import "../components/demo-toggle/demo-toggle.css";
|
|
115
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,182 +0,0 @@
|
|
|
1
|
-
@scope (color-picker-ui) {
|
|
2
|
-
:where(:scope) {
|
|
3
|
-
/* ── Tokens ── */
|
|
4
|
-
--color-picker-gap: var(--a-space-2);
|
|
5
|
-
--color-picker-area-height: 10rem;
|
|
6
|
-
--color-picker-area-radius: var(--a-radius-md);
|
|
7
|
-
--color-picker-track-height: 0.75rem;
|
|
8
|
-
--color-picker-track-radius: var(--a-radius-full);
|
|
9
|
-
--color-picker-thumb-size: 1.125rem;
|
|
10
|
-
--color-picker-thumb-border: 2px solid var(--a-chrome-border);
|
|
11
|
-
--color-picker-thumb-shadow: 0 0 0 1px var(--a-chrome-ring-subtle), 0 2px 4px var(--a-chrome-shadow-soft);
|
|
12
|
-
--color-picker-font: var(--a-font-family-code);
|
|
13
|
-
--color-picker-font-size: var(--a-ui-sm);
|
|
14
|
-
--color-picker-fg: var(--md-sys-color-neutral-on-surface);
|
|
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,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 };
|