@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
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Non-side-effect class export for `<color-
|
|
2
|
+
* Non-side-effect class export for `<color-area-ui>`.
|
|
3
3
|
*
|
|
4
4
|
* Importing this file gives you the class(es) without auto-registering the tag.
|
|
5
5
|
* Useful for test isolation, subclassing with tag-name override, or selective
|
|
6
6
|
* composition.
|
|
7
7
|
*
|
|
8
|
-
* The auto-register path stays at `@adia-ai/web-components/components/color-
|
|
8
|
+
* The auto-register path stays at `@adia-ai/web-components/components/color-area`
|
|
9
9
|
* (which imports this file + calls `defineIfFree()`).
|
|
10
10
|
*
|
|
11
11
|
* @see ../../USAGE.md#registration--auto-vs-explicit
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
|
-
* <color-
|
|
15
|
+
* <color-area-ui value="#3b82f6" format="hex"></color-area-ui>
|
|
16
16
|
*
|
|
17
|
-
* OKLCH-native color picker with 2D area + H/C/L sliders
|
|
17
|
+
* OKLCH-native color picker with 2D area + H/C/L sliders (ADR-0063,
|
|
18
|
+
* gh#1563 — renamed from `<color-picker-ui>`, which was cut in 0.8.43,
|
|
19
|
+
* gh#1617; this is the sole tag now).
|
|
18
20
|
*
|
|
19
21
|
* Layout:
|
|
20
22
|
* [═══════════ color area (chroma x lightness) ═══════════]
|
|
@@ -122,7 +124,7 @@ function gamutMapChroma(L, C, H) {
|
|
|
122
124
|
|
|
123
125
|
// ── Component ────────────────────────────────────────────
|
|
124
126
|
|
|
125
|
-
export class
|
|
127
|
+
export class UIColorArea extends UIFormElement {
|
|
126
128
|
// §154 (v0.5.3): Phosphor icons this primitive auto-stamps (without
|
|
127
129
|
// consumer markup). Aggregated by installIconLoadersForRegistered()
|
|
128
130
|
// across all defined elements. Audited by check-required-icons.mjs
|
|
@@ -453,11 +455,11 @@ export class UIColorPicker extends UIFormElement {
|
|
|
453
455
|
}
|
|
454
456
|
// No regex match — warn once per element so consumers can correct.
|
|
455
457
|
// WeakSet dedup matches v0.5.5 §184 §8 button-ui icon-only pattern.
|
|
456
|
-
if (!
|
|
457
|
-
|
|
458
|
+
if (!UIColorArea.#warnedBadParse.has(this)) {
|
|
459
|
+
UIColorArea.#warnedBadParse.add(this);
|
|
458
460
|
// eslint-disable-next-line no-console
|
|
459
461
|
console.warn(
|
|
460
|
-
`<color-
|
|
462
|
+
`<color-area-ui>: could not parse value=${JSON.stringify(val)}. ` +
|
|
461
463
|
`Expected #rrggbb or oklch(L C H) with numeric, NaN, 'none' (CSS L4 ` +
|
|
462
464
|
`powerless), or % channels. Picker is keeping prior state.`,
|
|
463
465
|
);
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
/* ADR-0063 (gh#1563) — `color-picker-ui` was a thin alias subclassing
|
|
2
|
+
* `UIColorArea`; cut in 0.8.43 (gh#1617). `color-area-ui` is the sole tag
|
|
3
|
+
* now. */
|
|
4
|
+
@scope (color-area-ui) {
|
|
5
|
+
:where(:scope) {
|
|
6
|
+
/* ── Tokens ── */
|
|
7
|
+
--color-area-gap: var(--a-space-2);
|
|
8
|
+
--color-area-area-height: 10rem;
|
|
9
|
+
--color-area-area-radius: var(--a-radius-md);
|
|
10
|
+
--color-area-track-height: 0.75rem;
|
|
11
|
+
--color-area-track-radius: var(--a-radius-full);
|
|
12
|
+
--color-area-thumb-size: 1.125rem;
|
|
13
|
+
--color-area-thumb-border: 2px solid var(--a-chrome-border);
|
|
14
|
+
--color-area-thumb-shadow: 0 0 0 1px var(--a-chrome-ring-subtle), 0 2px 4px var(--a-chrome-shadow-soft);
|
|
15
|
+
--color-area-font: var(--a-font-family-code);
|
|
16
|
+
--color-area-font-size: var(--a-ui-sm);
|
|
17
|
+
--color-area-fg: var(--md-sys-color-neutral-on-surface);
|
|
18
|
+
--color-area-label-fg: var(--a-fg-muted);
|
|
19
|
+
--color-area-border: var(--md-sys-color-neutral-outline-variant);
|
|
20
|
+
--color-area-output-bg: var(--a-bg-muted);
|
|
21
|
+
--color-area-output-radius: var(--a-radius-sm);
|
|
22
|
+
--color-area-fg-disabled: var(--a-ui-text-disabled);
|
|
23
|
+
|
|
24
|
+
/* ── Spacing ── */
|
|
25
|
+
--color-area-gap-sm: var(--a-space-1);
|
|
26
|
+
--color-area-pad-sm: var(--a-space-2);
|
|
27
|
+
|
|
28
|
+
/* ── Interactive ── */
|
|
29
|
+
--color-area-focus-color: var(--md-sys-color-primary);
|
|
30
|
+
--color-area-disabled-border: var(--md-sys-color-neutral-outline-variant);
|
|
31
|
+
|
|
32
|
+
/* ── Transitions ── */
|
|
33
|
+
--color-area-duration: var(--a-duration-fast);
|
|
34
|
+
--color-area-easing: var(--a-easing);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
:scope {
|
|
38
|
+
box-sizing: border-box;
|
|
39
|
+
display: flex;
|
|
40
|
+
flex-direction: column;
|
|
41
|
+
gap: var(--color-area-gap);
|
|
42
|
+
width: 100%;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/* ═══════ 2D Color Area ═══════ */
|
|
46
|
+
|
|
47
|
+
[data-area] {
|
|
48
|
+
position: relative;
|
|
49
|
+
width: 100%;
|
|
50
|
+
height: var(--color-area-area-height);
|
|
51
|
+
border-radius: var(--color-area-area-radius);
|
|
52
|
+
border: 1px solid var(--color-area-border);
|
|
53
|
+
overflow: hidden;
|
|
54
|
+
cursor: crosshair;
|
|
55
|
+
touch-action: none;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
[data-area]:focus-visible {
|
|
59
|
+
outline: 2px solid var(--color-area-focus-color);
|
|
60
|
+
outline-offset: 2px;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
[data-area] canvas {
|
|
64
|
+
image-rendering: auto;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
[data-area-thumb] {
|
|
68
|
+
position: absolute;
|
|
69
|
+
width: var(--color-area-thumb-size);
|
|
70
|
+
height: var(--color-area-thumb-size);
|
|
71
|
+
border-radius: 50%;
|
|
72
|
+
border: var(--color-area-thumb-border);
|
|
73
|
+
box-shadow: var(--color-area-thumb-shadow);
|
|
74
|
+
transform: translate(-50%, -50%);
|
|
75
|
+
pointer-events: none;
|
|
76
|
+
z-index: 1;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/* ═══════ Slider Rows (H / C / L) ═══════ */
|
|
80
|
+
|
|
81
|
+
[data-sliders] {
|
|
82
|
+
display: flex;
|
|
83
|
+
flex-direction: column;
|
|
84
|
+
gap: var(--color-area-gap-sm);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/* ═══════ Hue Track ═══════ */
|
|
88
|
+
|
|
89
|
+
[data-hue-track] {
|
|
90
|
+
position: relative;
|
|
91
|
+
width: 100%;
|
|
92
|
+
height: var(--color-area-track-height);
|
|
93
|
+
border-radius: var(--color-area-track-radius);
|
|
94
|
+
cursor: pointer;
|
|
95
|
+
touch-action: none;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
[data-hue-track]:focus-visible {
|
|
99
|
+
outline: 2px solid var(--color-area-focus-color);
|
|
100
|
+
outline-offset: 2px;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
[data-hue-thumb] {
|
|
104
|
+
position: absolute;
|
|
105
|
+
top: 50%;
|
|
106
|
+
width: var(--color-area-thumb-size);
|
|
107
|
+
height: var(--color-area-thumb-size);
|
|
108
|
+
border-radius: 50%;
|
|
109
|
+
border: var(--color-area-thumb-border);
|
|
110
|
+
box-shadow: var(--color-area-thumb-shadow);
|
|
111
|
+
transform: translate(-50%, -50%);
|
|
112
|
+
pointer-events: none;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/* ═══════ Output Values ═══════ */
|
|
116
|
+
|
|
117
|
+
[data-output] {
|
|
118
|
+
display: flex;
|
|
119
|
+
flex-direction: column;
|
|
120
|
+
gap: var(--color-area-gap-sm);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
[data-output-group] {
|
|
124
|
+
display: flex;
|
|
125
|
+
align-items: center;
|
|
126
|
+
gap: var(--color-area-gap-sm);
|
|
127
|
+
padding: var(--color-area-gap-sm) var(--color-area-pad-sm);
|
|
128
|
+
background: var(--color-area-output-bg);
|
|
129
|
+
border-radius: var(--color-area-output-radius);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
[data-output-value] {
|
|
133
|
+
font-family: var(--color-area-font);
|
|
134
|
+
font-size: var(--color-area-font-size);
|
|
135
|
+
color: var(--color-area-fg);
|
|
136
|
+
user-select: all;
|
|
137
|
+
-webkit-user-select: all;
|
|
138
|
+
flex: 1;
|
|
139
|
+
min-width: 0;
|
|
140
|
+
overflow: hidden;
|
|
141
|
+
text-overflow: ellipsis;
|
|
142
|
+
white-space: nowrap;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/* Copy button */
|
|
146
|
+
[data-copy] {
|
|
147
|
+
flex-shrink: 0;
|
|
148
|
+
display: flex;
|
|
149
|
+
align-items: center;
|
|
150
|
+
justify-content: center;
|
|
151
|
+
background: none;
|
|
152
|
+
border: none;
|
|
153
|
+
padding: 0;
|
|
154
|
+
cursor: pointer;
|
|
155
|
+
color: var(--color-area-label-fg);
|
|
156
|
+
transition: color var(--color-area-duration) var(--color-area-easing);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
[data-copy]:hover {
|
|
160
|
+
color: var(--color-area-fg);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
[data-copy] icon-ui {
|
|
164
|
+
--a-icon-size: var(--color-area-font-size);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/* ═══════ Disabled ═══════ */
|
|
168
|
+
|
|
169
|
+
:scope[disabled] {
|
|
170
|
+
pointer-events: none;
|
|
171
|
+
color: var(--color-area-fg-disabled);
|
|
172
|
+
}
|
|
173
|
+
:scope[disabled] [data-area],
|
|
174
|
+
:scope[disabled] [data-hue-track] {
|
|
175
|
+
filter: grayscale(1);
|
|
176
|
+
cursor: not-allowed;
|
|
177
|
+
}
|
|
178
|
+
:scope[disabled] slider-ui {
|
|
179
|
+
--slider-fill-bg: var(--color-area-disabled-border);
|
|
180
|
+
--slider-thumb-bg: var(--color-area-disabled-border);
|
|
181
|
+
}
|
|
182
|
+
:scope[disabled] [data-output-value] {
|
|
183
|
+
color: var(--color-area-fg-disabled);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `<color-area-ui>` — OKLCH-native color picker with 2D area and H/C/L sliders. Form-associated input emitting OKLCH color strings; canonical color authoring surface in the AdiaUI token system. Use for color input in design tools or theming UIs; for simple color swatches use <swatch-ui> or <color-input-ui> instead. Renamed from `<color-picker-ui>` (ADR-0063, gh#1563 — `-picker` is reserved for the outer trigger + popover composite shape; this is the inline substrate, mirroring <calendar-grid-ui>'s naming precedent). `<color-picker-ui>` was cut in 0.8.43 (gh#1617) — this is the sole tag now.
|
|
3
|
+
*
|
|
4
|
+
* @see https://ui-kit.exe.xyz/site/components/color-area
|
|
5
|
+
*
|
|
6
|
+
* Type declarations generated by scripts/build/dts-codegen.mjs from
|
|
7
|
+
* the component's `.a2ui.json` sidecar(s). Edit the source `.yaml`,
|
|
8
|
+
* run `npm run build:components`, then `npm run codegen:dts` to
|
|
9
|
+
* regenerate; or hand-author this file fully if rich event types are
|
|
10
|
+
* needed beyond what the yaml `events:` block can express.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import { UIElement } from '../../core/element.js';
|
|
14
|
+
|
|
15
|
+
export type ColorAreaChangeEvent = CustomEvent<unknown>;
|
|
16
|
+
export interface ColorAreaConstraintClampEventDetail {
|
|
17
|
+
/** Array of `{ axis, requested, clamped, reason }` objects. axis is
|
|
18
|
+
one of "l" / "c" / "h". reason names the triggering constraint
|
|
19
|
+
prop. Empty arrays are never emitted.
|
|
20
|
+
*/
|
|
21
|
+
clamps: unknown[];
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export type ColorAreaConstraintClampEvent = CustomEvent<ColorAreaConstraintClampEventDetail>;
|
|
25
|
+
export type ColorAreaInputEvent = CustomEvent<unknown>;
|
|
26
|
+
|
|
27
|
+
export class UIColorArea extends UIElement {
|
|
28
|
+
/** Reference hue (degrees) for the [hue-drift-max] constraint. Default
|
|
29
|
+
NaN — falls back to the picker's hue at first commit so the consumer
|
|
30
|
+
can pre-seed the picker and constrain drift from that initial value.
|
|
31
|
+
*/
|
|
32
|
+
baseHue: number;
|
|
33
|
+
/** Disables all interaction */
|
|
34
|
+
disabled: boolean;
|
|
35
|
+
/** Output format for the value property */
|
|
36
|
+
format: 'hex' | 'oklch';
|
|
37
|
+
/** Generation constraint — maximum allowed signed-shortest-path hue
|
|
38
|
+
deviation (degrees) from [base-hue] (or the first-committed hue
|
|
39
|
+
if [base-hue] is unset). Default NaN (no constraint). Wrap-aware
|
|
40
|
+
so a drift of 350 degrees resolves as -10.
|
|
41
|
+
*/
|
|
42
|
+
hueDriftMax: number;
|
|
43
|
+
/** Generation constraint (v0.4.9 §99h, FEEDBACK-02 #7) — clamp the
|
|
44
|
+
OKLCH chroma channel to at most this value before commit. Out-of-
|
|
45
|
+
bound mutations round-trip to the nearest in-bound equivalent +
|
|
46
|
+
fire `constraint-clamp`. Default Infinity (no constraint).
|
|
47
|
+
*/
|
|
48
|
+
maxChroma: number;
|
|
49
|
+
/** Generation constraint — clamp OKLCH lightness to at most this value (0..1). Default 1 (no constraint). */
|
|
50
|
+
maxL: number;
|
|
51
|
+
/** Generation constraint — clamp OKLCH lightness to at least this value (0..1). Default 0 (no constraint). */
|
|
52
|
+
minL: number;
|
|
53
|
+
/** Form field name */
|
|
54
|
+
name: string;
|
|
55
|
+
/** Current color as hex string */
|
|
56
|
+
value: string;
|
|
57
|
+
|
|
58
|
+
addEventListener(type: 'change', listener: (ev: ColorAreaChangeEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
59
|
+
addEventListener(type: 'constraint-clamp', listener: (ev: ColorAreaConstraintClampEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
60
|
+
addEventListener(type: 'input', listener: (ev: ColorAreaInputEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
61
|
+
addEventListener<K extends keyof HTMLElementEventMap>(
|
|
62
|
+
type: K,
|
|
63
|
+
listener: (this: UIColorArea, ev: HTMLElementEventMap[K]) => unknown,
|
|
64
|
+
options?: boolean | AddEventListenerOptions,
|
|
65
|
+
): void;
|
|
66
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# color-area — Examples
|
|
2
|
+
|
|
3
|
+
## Default
|
|
4
|
+
|
|
5
|
+
```html
|
|
6
|
+
<color-area-ui></color-area-ui>
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## Pre-set Colors
|
|
10
|
+
|
|
11
|
+
```html
|
|
12
|
+
<color-area-ui value="#3b82f6"></color-area-ui>
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## disabled
|
|
16
|
+
|
|
17
|
+
```html
|
|
18
|
+
<color-area-ui value="#3b82f6" disabled></color-area-ui>
|
|
19
|
+
```
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `<color-area-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 { UIColorArea } from '@adia-ai/web-components/components/color-area/class';
|
|
8
|
+
*
|
|
9
|
+
* @see ../../USAGE.md#registration--auto-vs-explicit
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import { defineIfFree } from '../../core/register.js';
|
|
13
|
+
import { UIColorArea } from './color-area.class.js';
|
|
14
|
+
|
|
15
|
+
defineIfFree('color-area-ui', UIColorArea);
|
|
16
|
+
|
|
17
|
+
export { UIColorArea };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# Generated by scripts/migrate-yamls-to-v1.mjs — migrated to v1 contract.
|
|
2
2
|
# Edit this file; run `npm run build:components` to regenerate a2ui.json.
|
|
3
3
|
$schema: ../../../../scripts/schemas/component.yaml.schema.json
|
|
4
|
-
name:
|
|
5
|
-
tag: color-
|
|
4
|
+
name: UIColorArea
|
|
5
|
+
tag: color-area-ui
|
|
6
6
|
status: stable
|
|
7
|
-
component:
|
|
7
|
+
component: ColorArea
|
|
8
8
|
category: input
|
|
9
9
|
version: 1
|
|
10
10
|
description: >-
|
|
@@ -12,7 +12,11 @@ description: >-
|
|
|
12
12
|
Form-associated input emitting OKLCH color strings; canonical color
|
|
13
13
|
authoring surface in the AdiaUI token system. Use for color input in
|
|
14
14
|
design tools or theming UIs; for simple color swatches use <swatch-ui>
|
|
15
|
-
or <color-input-ui> instead.
|
|
15
|
+
or <color-input-ui> instead. Renamed from `<color-picker-ui>`
|
|
16
|
+
(ADR-0063, gh#1563 — `-picker` is reserved for the outer trigger +
|
|
17
|
+
popover composite shape; this is the inline substrate, mirroring
|
|
18
|
+
<calendar-grid-ui>'s naming precedent). `<color-picker-ui>` was cut in
|
|
19
|
+
0.8.43 (gh#1617) — this is the sole tag now.
|
|
16
20
|
# Per ADR-0027 — primitives that programmatically create other primitives
|
|
17
21
|
# do NOT auto-import them. Consumer (or demo shell) must explicitly import.
|
|
18
22
|
composes:
|
|
@@ -111,11 +115,13 @@ a2ui:
|
|
|
111
115
|
reason: 'Canonical color-authoring surface.'
|
|
112
116
|
- rule: 'For simple color swatches (read-only display) use <swatch-ui>; for hex/rgb text input use <color-input-ui>.'
|
|
113
117
|
reason: 'Surface boundary.'
|
|
118
|
+
- rule: 'Renamed from <color-picker-ui> (ADR-0063, gh#1563); the old tag was cut in 0.8.43 (gh#1617) — ColorArea is the sole tag now.'
|
|
119
|
+
reason: 'Picker-naming convention: -picker names the outer trigger+popover composite, never the inline substrate.'
|
|
114
120
|
- rule: 'Output format defaults to oklch(); set format= to override (hex, rgb, hsl).'
|
|
115
121
|
reason: 'Format knob.'
|
|
116
122
|
anti_patterns: []
|
|
117
123
|
examples:
|
|
118
|
-
- name: color-
|
|
124
|
+
- name: color-area-demo
|
|
119
125
|
description: Color picker card with a color picker component for selecting colors with swatches.
|
|
120
126
|
a2ui: >-
|
|
121
127
|
[
|
|
@@ -135,11 +141,11 @@ examples:
|
|
|
135
141
|
},
|
|
136
142
|
{
|
|
137
143
|
"id": "cp",
|
|
138
|
-
"component": "
|
|
144
|
+
"component": "ColorArea",
|
|
139
145
|
"value": "#6366f1"
|
|
140
146
|
}
|
|
141
147
|
]
|
|
142
|
-
- name: color-
|
|
148
|
+
- name: color-area-panel
|
|
143
149
|
description: Color picker with swatch selection in a card.
|
|
144
150
|
a2ui: >-
|
|
145
151
|
[
|
|
@@ -159,17 +165,19 @@ examples:
|
|
|
159
165
|
},
|
|
160
166
|
{
|
|
161
167
|
"id": "cp",
|
|
162
|
-
"component": "
|
|
168
|
+
"component": "ColorArea",
|
|
163
169
|
"value": "#3b82f6"
|
|
164
170
|
}
|
|
165
171
|
]
|
|
166
172
|
keywords:
|
|
173
|
+
- colorarea
|
|
174
|
+
- color-area
|
|
167
175
|
- colorpicker
|
|
168
176
|
- color-picker
|
|
169
177
|
- color
|
|
170
178
|
- picker
|
|
171
179
|
synonyms:
|
|
172
|
-
color-
|
|
180
|
+
color-area: [color-canvas, color-surface, swatch-picker, color-picker]
|
|
173
181
|
related:
|
|
174
182
|
- grid
|
|
175
183
|
- button
|
|
@@ -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/ColorInput.json",
|
|
4
4
|
"title": "ColorInput",
|
|
5
|
-
"description": "Compact form-bearing color input — opens a popover-anchored\n`<color-
|
|
5
|
+
"description": "Compact form-bearing color input — opens a popover-anchored\n`<color-area-ui>` from an inline swatch button. §302 (v0.5.12,\nFEEDBACK-29 re-bucket from v0.6.0). Canonicalizes the USAGE.md §221f\nOption B recipe (popover + button + color-area) into a single\nform-associated tag for inline form contexts (settings drawer \"source\ncolor\" field, swatch-row inline-edit, etc.). Composes `<color-area-ui>`\n(ADR-0063, gh#1563 — renamed from `<color-picker-ui>`, cut in 0.8.43,\ngh#1617); `color-input-ui`'s own tag/name is unaffected.",
|
|
6
6
|
"type": "object",
|
|
7
7
|
"allOf": [
|
|
8
8
|
{
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"default": "NaN"
|
|
42
42
|
},
|
|
43
43
|
"maxChroma": {
|
|
44
|
-
"description": "Generation constraint forwarded to the inner `<color-
|
|
44
|
+
"description": "Generation constraint forwarded to the inner `<color-area-ui>` (v0.5.13\n§-TBD, FB-33 §1). Clamp the OKLCH chroma channel to at most this value.\nDefault Infinity (no constraint).\n",
|
|
45
45
|
"type": "number",
|
|
46
46
|
"default": "Infinity"
|
|
47
47
|
},
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"default": false
|
|
67
67
|
},
|
|
68
68
|
"placement": {
|
|
69
|
-
"description": "Popover placement relative to the trigger. Default `bottom` centers the color-
|
|
69
|
+
"description": "Popover placement relative to the trigger. Default `bottom` centers the color-area panel under the swatch button (ADR-0034 Rule 2 — panel wider than trigger).",
|
|
70
70
|
"type": "string",
|
|
71
71
|
"enum": [
|
|
72
72
|
"top",
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
"composes": [
|
|
97
97
|
"button-ui",
|
|
98
98
|
"popover-ui",
|
|
99
|
-
"color-
|
|
99
|
+
"color-area-ui"
|
|
100
100
|
],
|
|
101
101
|
"events": {
|
|
102
102
|
"change": {
|
|
@@ -177,7 +177,7 @@
|
|
|
177
177
|
"name": "UIColorInput",
|
|
178
178
|
"parts": {},
|
|
179
179
|
"related": [
|
|
180
|
-
"color-
|
|
180
|
+
"color-area",
|
|
181
181
|
"popover",
|
|
182
182
|
"button",
|
|
183
183
|
"swatch"
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
*
|
|
18
18
|
* Compact form-bearing color input. §302 (v0.5.12, FEEDBACK-29 re-bucket).
|
|
19
19
|
*
|
|
20
|
-
* Canonicalizes the USAGE.md §221f recipe (popover + button + color-
|
|
20
|
+
* Canonicalizes the USAGE.md §221f recipe (popover + button + color-area)
|
|
21
21
|
* into a single form-associated tag. Builds its inner DOM in `connected()`
|
|
22
22
|
* as light-DOM children:
|
|
23
23
|
*
|
|
@@ -27,10 +27,13 @@
|
|
|
27
27
|
* <span class="color-input__swatch"></span>
|
|
28
28
|
* <span class="color-input__value"></span>
|
|
29
29
|
* </button-ui>
|
|
30
|
-
* <color-
|
|
30
|
+
* <color-area-ui slot="content"></color-area-ui>
|
|
31
31
|
* </popover-ui>
|
|
32
32
|
* </color-input-ui>
|
|
33
33
|
*
|
|
34
|
+
* Composes `<color-area-ui>` (ADR-0063, gh#1563 — renamed from
|
|
35
|
+
* `<color-picker-ui>`, cut in 0.8.43, gh#1617).
|
|
36
|
+
*
|
|
34
37
|
* Form-associated via UIFormElement + ElementInternals.
|
|
35
38
|
*/
|
|
36
39
|
|
|
@@ -44,7 +47,7 @@ export class UIColorInput extends UIFormElement {
|
|
|
44
47
|
format: { type: String, default: 'hex', reflect: true },
|
|
45
48
|
placement: { type: String, default: 'bottom', reflect: true }, // ADR-0034 Rule 2: color picker panel >> swatch trigger
|
|
46
49
|
open: { type: Boolean, default: false, reflect: true },
|
|
47
|
-
// Generation-constraint props forwarded to the inner <color-
|
|
50
|
+
// Generation-constraint props forwarded to the inner <color-area-ui>.
|
|
48
51
|
// v0.5.13 §-TBD (FB-33 §1) — full parity with color-picker's 5 constraint
|
|
49
52
|
// props (`maxChroma` / `maxL` / `minL` / `hueDriftMax` / `baseHue`) so
|
|
50
53
|
// <color-input-ui> adoption doesn't force a UX regression on consumers
|
|
@@ -105,7 +108,7 @@ export class UIColorInput extends UIFormElement {
|
|
|
105
108
|
if (this.firstElementChild) {
|
|
106
109
|
this.#popover = this.querySelector(':scope > popover-ui');
|
|
107
110
|
this.#button = this.querySelector(':scope > popover-ui > button-ui[slot="trigger"]');
|
|
108
|
-
this.#picker = this.querySelector(':scope > popover-ui > color-
|
|
111
|
+
this.#picker = this.querySelector(':scope > popover-ui > color-area-ui[slot="content"]');
|
|
109
112
|
this.#swatch = this.querySelector('.color-input__swatch');
|
|
110
113
|
this.#valueLabel = this.querySelector('.color-input__value');
|
|
111
114
|
if (this.#popover && this.#button && this.#picker) return;
|
|
@@ -130,7 +133,7 @@ export class UIColorInput extends UIFormElement {
|
|
|
130
133
|
|
|
131
134
|
button.append(swatch, valueLabel);
|
|
132
135
|
|
|
133
|
-
const picker = document.createElement('color-
|
|
136
|
+
const picker = document.createElement('color-area-ui');
|
|
134
137
|
picker.setAttribute('slot', 'content');
|
|
135
138
|
picker.setAttribute('format', this.format);
|
|
136
139
|
picker.setAttribute('value', this.value);
|
|
@@ -197,7 +200,7 @@ export class UIColorInput extends UIFormElement {
|
|
|
197
200
|
this.#syncFromValue();
|
|
198
201
|
// Forward the inner picker's parsed OKLCH channel scalars (v0.5.13 §-TBD,
|
|
199
202
|
// FB-33 §1-adjacent). Consumers writing OKLCH-native logic get the parsed
|
|
200
|
-
// {l, c, h} for free, matching <color-
|
|
203
|
+
// {l, c, h} for free, matching <color-area-ui>'s detail shape.
|
|
201
204
|
this.dispatchEvent(new CustomEvent(kind, {
|
|
202
205
|
bubbles: true,
|
|
203
206
|
composed: true,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* <color-input-ui> — compact form-bearing color input.
|
|
3
3
|
*
|
|
4
4
|
* §302 (v0.5.12, FEEDBACK-29 re-bucket). Light-DOM composition of
|
|
5
|
-
* <popover-ui> + <button-ui> + <color-
|
|
5
|
+
* <popover-ui> + <button-ui> + <color-area-ui>. The host element
|
|
6
6
|
* carries form-control sizing tokens; inner button + popover keep
|
|
7
7
|
* their own primitive styling.
|
|
8
8
|
*/
|
|
@@ -7,12 +7,12 @@
|
|
|
7
7
|
* import { UIColorInput } from '@adia-ai/web-components/components/color-input/class';
|
|
8
8
|
*
|
|
9
9
|
* Per ADR-0027, this module does NOT auto-import the composed primitives
|
|
10
|
-
* (`<popover-ui>`, `<button-ui>`, `<color-
|
|
10
|
+
* (`<popover-ui>`, `<button-ui>`, `<color-area-ui>`). Consumers must
|
|
11
11
|
* register them explicitly before mounting `<color-input-ui>`:
|
|
12
12
|
*
|
|
13
13
|
* import '@adia-ai/web-components/components/popover';
|
|
14
14
|
* import '@adia-ai/web-components/components/button';
|
|
15
|
-
* import '@adia-ai/web-components/components/color-
|
|
15
|
+
* import '@adia-ai/web-components/components/color-area';
|
|
16
16
|
* import '@adia-ai/web-components/components/color-input';
|
|
17
17
|
*
|
|
18
18
|
* @see ../../USAGE.md#registration--auto-vs-explicit
|
|
@@ -7,20 +7,22 @@ category: input
|
|
|
7
7
|
version: 1
|
|
8
8
|
description: |-
|
|
9
9
|
Compact form-bearing color input — opens a popover-anchored
|
|
10
|
-
`<color-
|
|
10
|
+
`<color-area-ui>` from an inline swatch button. §302 (v0.5.12,
|
|
11
11
|
FEEDBACK-29 re-bucket from v0.6.0). Canonicalizes the USAGE.md §221f
|
|
12
|
-
Option B recipe (popover + button + color-
|
|
12
|
+
Option B recipe (popover + button + color-area) into a single
|
|
13
13
|
form-associated tag for inline form contexts (settings drawer "source
|
|
14
|
-
color" field, swatch-row inline-edit, etc.).
|
|
14
|
+
color" field, swatch-row inline-edit, etc.). Composes `<color-area-ui>`
|
|
15
|
+
(ADR-0063, gh#1563 — renamed from `<color-picker-ui>`, cut in 0.8.43,
|
|
16
|
+
gh#1617); `color-input-ui`'s own tag/name is unaffected.
|
|
15
17
|
# Per ADR-0027 — primitives that programmatically create other primitives
|
|
16
18
|
# do NOT auto-import them. The consumer (or demo shell) explicitly imports
|
|
17
19
|
# the composed primitives. This element creates `<button-ui>` +
|
|
18
|
-
# `<popover-ui>` + `<color-
|
|
20
|
+
# `<popover-ui>` + `<color-area-ui>` light-DOM children but assumes the
|
|
19
21
|
# consumer has already imported their auto-register modules.
|
|
20
22
|
composes:
|
|
21
23
|
- button-ui
|
|
22
24
|
- popover-ui
|
|
23
|
-
- color-
|
|
25
|
+
- color-area-ui
|
|
24
26
|
props:
|
|
25
27
|
name:
|
|
26
28
|
description: Form field name.
|
|
@@ -44,7 +46,7 @@ props:
|
|
|
44
46
|
default: false
|
|
45
47
|
reflect: true
|
|
46
48
|
placement:
|
|
47
|
-
description: Popover placement relative to the trigger. Default `bottom` centers the color-
|
|
49
|
+
description: Popover placement relative to the trigger. Default `bottom` centers the color-area panel under the swatch button (ADR-0034 Rule 2 — panel wider than trigger).
|
|
48
50
|
type: string
|
|
49
51
|
default: bottom
|
|
50
52
|
reflect: true
|
|
@@ -64,7 +66,7 @@ props:
|
|
|
64
66
|
reflect: true
|
|
65
67
|
maxChroma:
|
|
66
68
|
description: |
|
|
67
|
-
Generation constraint forwarded to the inner `<color-
|
|
69
|
+
Generation constraint forwarded to the inner `<color-area-ui>` (v0.5.13
|
|
68
70
|
§-TBD, FB-33 §1). Clamp the OKLCH chroma channel to at most this value.
|
|
69
71
|
Default Infinity (no constraint).
|
|
70
72
|
type: number
|
|
@@ -146,7 +148,7 @@ a2ui:
|
|
|
146
148
|
rules:
|
|
147
149
|
- >-
|
|
148
150
|
Use <color-input-ui> for any form-row color field — it
|
|
149
|
-
canonicalizes the popover + button + color-
|
|
151
|
+
canonicalizes the popover + button + color-area recipe and is
|
|
150
152
|
the only form-bearing color primitive. Do not hand-roll the
|
|
151
153
|
composition; reach for color-input-ui directly.
|
|
152
154
|
- >-
|
|
@@ -158,17 +160,17 @@ a2ui:
|
|
|
158
160
|
- >-
|
|
159
161
|
For brand-palette constraints, set [maxChroma] / [minL] / [maxL]
|
|
160
162
|
/ [hueDriftMax] (with [baseHue]) on the host — they forward to
|
|
161
|
-
the inner <color-
|
|
163
|
+
the inner <color-area-ui> and clamp generation. Useful for
|
|
162
164
|
Tokens-Studio-style guarded color generation.
|
|
163
165
|
- >-
|
|
164
|
-
Use <color-
|
|
166
|
+
Use <color-area-ui> DIRECTLY (no color-input-ui wrapper) only
|
|
165
167
|
for full-surface editors where the picker IS the page (e.g.
|
|
166
168
|
Tokens Studio main canvas). For inline form-row use, always
|
|
167
169
|
reach for <color-input-ui>.
|
|
168
170
|
- >-
|
|
169
171
|
Per ADR-0027 (cross-primitive composition imports), consumer
|
|
170
172
|
pages MUST explicitly import <button-ui>, <popover-ui>, and
|
|
171
|
-
<color-
|
|
173
|
+
<color-area-ui> before <color-input-ui>. The primitive composes
|
|
172
174
|
them but does NOT auto-register them.
|
|
173
175
|
anti_patterns: []
|
|
174
176
|
examples:
|
|
@@ -209,7 +211,7 @@ synonyms:
|
|
|
209
211
|
inline-color-picker:
|
|
210
212
|
- color-input
|
|
211
213
|
related:
|
|
212
|
-
- color-
|
|
214
|
+
- color-area
|
|
213
215
|
- popover
|
|
214
216
|
- button
|
|
215
217
|
- swatch
|
|
@@ -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. */
|