@adia-ai/web-components 0.5.11 → 0.5.13
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 +2270 -0
- package/color/index.d.ts +137 -0
- package/color/index.js +305 -0
- package/components/color-input/class.js +221 -0
- package/components/color-input/color-input.a2ui.json +218 -0
- package/components/color-input/color-input.css +47 -0
- package/components/color-input/color-input.d.ts +87 -0
- package/components/color-input/color-input.js +26 -0
- package/components/color-input/color-input.yaml +188 -0
- package/components/index.js +1 -0
- package/components/stat/stat-ui.d.ts +38 -0
- package/components/swatch/class.js +28 -0
- package/components/swatch/swatch.a2ui.json +14 -2
- package/components/swatch/swatch.css +32 -0
- package/components/swatch/swatch.d.ts +13 -3
- package/components/swatch/swatch.yaml +35 -4
- package/package.json +17 -2
- package/styles/components.css +1 -0
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
],
|
|
15
15
|
"properties": {
|
|
16
16
|
"autoContrast": {
|
|
17
|
-
"description": "When set, computes the swatch color's OKLab L and switches the label /\ndetail color between light + dark so it remains legible against the\ntile background.
|
|
17
|
+
"description": "When set, computes the swatch color's OKLab L and switches the label /\ndetail color between light + dark so it remains legible against the\ntile background. Active when `label-position=\"overlay\"` (where the\nlabel sits ON the tile). Uses a 1px canvas probe to handle any CSS\ncolor form (oklch / hex / hsl / named / var() references).\n",
|
|
18
18
|
"type": "boolean",
|
|
19
19
|
"default": false
|
|
20
20
|
},
|
|
@@ -51,6 +51,15 @@
|
|
|
51
51
|
"type": "string",
|
|
52
52
|
"default": ""
|
|
53
53
|
},
|
|
54
|
+
"labelPosition": {
|
|
55
|
+
"description": "§253 (v0.5.12, FB-23 §1). Position the label relative to the tile.\n`below` (default) stacks label under the tile (current shape=\"block\"\nlayout — `flex-direction: column`). `overlay` renders the label\nINSIDE the tile via absolute positioning; pair with `[auto-contrast]`\nto keep the label legible against the tile color (`data-on-light` /\n`data-on-dark` classes auto-stamped per OKLab-L probe). Only meaningful\nwhen `shape=\"block\"` (other shapes are too small for in-tile labels).\nUnblocks Tokens Studio's C1.3 dogfood migration (label-inside-the-tile\npattern; blocked 3 cycles on this design call).",
|
|
56
|
+
"type": "string",
|
|
57
|
+
"enum": [
|
|
58
|
+
"below",
|
|
59
|
+
"overlay"
|
|
60
|
+
],
|
|
61
|
+
"default": "below"
|
|
62
|
+
},
|
|
54
63
|
"selectable": {
|
|
55
64
|
"description": "When set, makes the swatch keyboard-focusable + clickable. Sets role=\"button\" + tabindex=\"0\". Dispatches a \"select\" event on activation (click / Enter / Space).",
|
|
56
65
|
"type": "boolean",
|
|
@@ -140,7 +149,10 @@
|
|
|
140
149
|
],
|
|
141
150
|
"slots": {
|
|
142
151
|
"default": {
|
|
143
|
-
"description": "Optional rich label content. When present, replaces the [label]
|
|
152
|
+
"description": "Optional rich label content. When present, replaces the [label]\nattribute's text. Consumer chrome positioned absolutely against the\nswatch tile should use `[slot=\"chrome\"]` instead — default-slot\nchildren are funneled into the label region.\n"
|
|
153
|
+
},
|
|
154
|
+
"chrome": {
|
|
155
|
+
"description": "§-TBD (v0.5.13, FB-34 §1). Sibling-of-tile chrome — gamut badges,\noverride/tracked dots, custom indicators — that survives stamping as\na direct host sibling rather than being funneled into the label. Pair\nwith consumer-authored CSS `position: absolute` against the host\n(the host carries `position: relative` when `shape=\"block\"`, so\n`top/right/bottom/left` offsets anchor to the tile's geometry).\nCloses the C1.3 dogfood chrome-overlay composition gap.\n"
|
|
144
156
|
}
|
|
145
157
|
},
|
|
146
158
|
"states": [
|
|
@@ -141,6 +141,38 @@
|
|
|
141
141
|
white-space: nowrap;
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
+
/* ═══════ §253 (v0.5.12, FB-23 §1): label-position="overlay" ═══════
|
|
145
|
+
Renders the label INSIDE the block tile via absolute positioning.
|
|
146
|
+
Pair with [auto-contrast] for OKLab-L-driven legibility (existing
|
|
147
|
+
`data-on-light` / `data-on-dark` classes stamp on the label per
|
|
148
|
+
the OKLab-L probe; see auto-contrast rules below).
|
|
149
|
+
|
|
150
|
+
The host becomes the positioning context (default flex-column flow
|
|
151
|
+
for the tile + detail line remains); the label is pulled out of
|
|
152
|
+
flow + absolutely positioned to overlap the tile's full bounds
|
|
153
|
+
(`top: 0; height: var(--_block-h)`). Tile is the first flex child
|
|
154
|
+
with the same height, so the absolute label aligns exactly to it.
|
|
155
|
+
|
|
156
|
+
Only meaningful when `shape="block"` (other shapes are too small
|
|
157
|
+
for in-tile labels). Unblocks Tokens Studio's C1.3 dogfood
|
|
158
|
+
migration (label-inside-the-tile pattern; blocked 3 cycles on this
|
|
159
|
+
design call). */
|
|
160
|
+
:scope[shape="block"][label-position="overlay"] {
|
|
161
|
+
position: relative;
|
|
162
|
+
}
|
|
163
|
+
:scope[shape="block"][label-position="overlay"] > [data-label] {
|
|
164
|
+
position: absolute;
|
|
165
|
+
top: 0;
|
|
166
|
+
inset-inline: 0;
|
|
167
|
+
height: var(--_block-h, var(--swatch-tile-lg));
|
|
168
|
+
display: flex;
|
|
169
|
+
align-items: center;
|
|
170
|
+
justify-content: center;
|
|
171
|
+
margin-block-start: 0; /* override the below-tile margin */
|
|
172
|
+
padding: var(--a-space-1) var(--a-space-2);
|
|
173
|
+
pointer-events: none; /* don't intercept clicks on the tile */
|
|
174
|
+
}
|
|
175
|
+
|
|
144
176
|
/* ═══════ Sizes ═══════
|
|
145
177
|
Override the dot/square diameter (`--_size`) and the block-shape
|
|
146
178
|
height (`--_block-h`) for each size preset. Line/dashed widths use
|
|
@@ -31,9 +31,9 @@ export type SwatchSelectEvent = CustomEvent<SwatchSelectEventDetail>;
|
|
|
31
31
|
export class UISwatch extends UIElement {
|
|
32
32
|
/** When set, computes the swatch color's OKLab L and switches the label /
|
|
33
33
|
detail color between light + dark so it remains legible against the
|
|
34
|
-
tile background.
|
|
35
|
-
ON the tile). Uses a 1px canvas probe to handle any CSS
|
|
36
|
-
(oklch / hex / hsl / named / var() references).
|
|
34
|
+
tile background. Active when `label-position="overlay"` (where the
|
|
35
|
+
label sits ON the tile). Uses a 1px canvas probe to handle any CSS
|
|
36
|
+
color form (oklch / hex / hsl / named / var() references).
|
|
37
37
|
*/
|
|
38
38
|
autoContrast: boolean;
|
|
39
39
|
/** Optional marker(s) rendered in the upper-right of the tile. Single value
|
|
@@ -54,6 +54,16 @@ are silently dropped.
|
|
|
54
54
|
detail: string;
|
|
55
55
|
/** Optional label rendered next to (or below, for shape="block") the swatch. Use the default slot for richer content. */
|
|
56
56
|
label: string;
|
|
57
|
+
/** §253 (v0.5.12, FB-23 §1). Position the label relative to the tile.
|
|
58
|
+
`below` (default) stacks label under the tile (current shape="block"
|
|
59
|
+
layout — `flex-direction: column`). `overlay` renders the label
|
|
60
|
+
INSIDE the tile via absolute positioning; pair with `[auto-contrast]`
|
|
61
|
+
to keep the label legible against the tile color (`data-on-light` /
|
|
62
|
+
`data-on-dark` classes auto-stamped per OKLab-L probe). Only meaningful
|
|
63
|
+
when `shape="block"` (other shapes are too small for in-tile labels).
|
|
64
|
+
Unblocks Tokens Studio's C1.3 dogfood migration (label-inside-the-tile
|
|
65
|
+
pattern; blocked 3 cycles on this design call). */
|
|
66
|
+
labelPosition: 'below' | 'overlay';
|
|
57
67
|
/** When set, makes the swatch keyboard-focusable + clickable. Sets role="button" + tabindex="0". Dispatches a "select" event on activation (click / Enter / Space). */
|
|
58
68
|
selectable: boolean;
|
|
59
69
|
/** Reflected visual selected state. Pair with [selectable] to make the swatch behave like a radio-style picker. Sets aria-pressed. */
|
|
@@ -80,12 +80,30 @@ props:
|
|
|
80
80
|
description: |
|
|
81
81
|
When set, computes the swatch color's OKLab L and switches the label /
|
|
82
82
|
detail color between light + dark so it remains legible against the
|
|
83
|
-
tile background.
|
|
84
|
-
ON the tile). Uses a 1px canvas probe to handle any CSS
|
|
85
|
-
(oklch / hex / hsl / named / var() references).
|
|
83
|
+
tile background. Active when `label-position="overlay"` (where the
|
|
84
|
+
label sits ON the tile). Uses a 1px canvas probe to handle any CSS
|
|
85
|
+
color form (oklch / hex / hsl / named / var() references).
|
|
86
86
|
type: boolean
|
|
87
87
|
default: false
|
|
88
88
|
reflect: true
|
|
89
|
+
labelPosition:
|
|
90
|
+
description: |-
|
|
91
|
+
§253 (v0.5.12, FB-23 §1). Position the label relative to the tile.
|
|
92
|
+
`below` (default) stacks label under the tile (current shape="block"
|
|
93
|
+
layout — `flex-direction: column`). `overlay` renders the label
|
|
94
|
+
INSIDE the tile via absolute positioning; pair with `[auto-contrast]`
|
|
95
|
+
to keep the label legible against the tile color (`data-on-light` /
|
|
96
|
+
`data-on-dark` classes auto-stamped per OKLab-L probe). Only meaningful
|
|
97
|
+
when `shape="block"` (other shapes are too small for in-tile labels).
|
|
98
|
+
Unblocks Tokens Studio's C1.3 dogfood migration (label-inside-the-tile
|
|
99
|
+
pattern; blocked 3 cycles on this design call).
|
|
100
|
+
type: string
|
|
101
|
+
default: below
|
|
102
|
+
reflect: true
|
|
103
|
+
attribute: label-position
|
|
104
|
+
enum:
|
|
105
|
+
- below
|
|
106
|
+
- overlay
|
|
89
107
|
events:
|
|
90
108
|
select:
|
|
91
109
|
description: Fired when a selectable swatch is activated (click / Enter / Space). detail carries the swatch's value, color, and label.
|
|
@@ -101,7 +119,20 @@ events:
|
|
|
101
119
|
description: The [label] attribute value.
|
|
102
120
|
slots:
|
|
103
121
|
default:
|
|
104
|
-
description:
|
|
122
|
+
description: |
|
|
123
|
+
Optional rich label content. When present, replaces the [label]
|
|
124
|
+
attribute's text. Consumer chrome positioned absolutely against the
|
|
125
|
+
swatch tile should use `[slot="chrome"]` instead — default-slot
|
|
126
|
+
children are funneled into the label region.
|
|
127
|
+
chrome:
|
|
128
|
+
description: |
|
|
129
|
+
§-TBD (v0.5.13, FB-34 §1). Sibling-of-tile chrome — gamut badges,
|
|
130
|
+
override/tracked dots, custom indicators — that survives stamping as
|
|
131
|
+
a direct host sibling rather than being funneled into the label. Pair
|
|
132
|
+
with consumer-authored CSS `position: absolute` against the host
|
|
133
|
+
(the host carries `position: relative` when `shape="block"`, so
|
|
134
|
+
`top/right/bottom/left` offsets anchor to the tile's geometry).
|
|
135
|
+
Closes the C1.3 dogfood chrome-overlay composition gap.
|
|
105
136
|
states:
|
|
106
137
|
- name: idle
|
|
107
138
|
description: Default, ready for display.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adia-ai/web-components",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.13",
|
|
4
4
|
"description": "AdiaUI web components — vanilla custom elements. A2UI runtime (renderer, registry, streams, wiring) lives in @adia-ai/a2ui-runtime.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "./index.d.ts",
|
|
@@ -23,6 +23,14 @@
|
|
|
23
23
|
"types": "./components/*/*.d.ts",
|
|
24
24
|
"default": "./components/*/*.js"
|
|
25
25
|
},
|
|
26
|
+
"./components/stat": {
|
|
27
|
+
"types": "./components/stat/stat-ui.d.ts",
|
|
28
|
+
"default": "./components/stat/stat-ui.js"
|
|
29
|
+
},
|
|
30
|
+
"./components/stat/stat-ui.js": {
|
|
31
|
+
"types": "./components/stat/stat-ui.d.ts",
|
|
32
|
+
"default": "./components/stat/stat-ui.js"
|
|
33
|
+
},
|
|
26
34
|
"./components/*/class": {
|
|
27
35
|
"types": "./components/*/*.d.ts",
|
|
28
36
|
"default": "./components/*/class.js"
|
|
@@ -33,10 +41,15 @@
|
|
|
33
41
|
"./styles/*": "./styles/*",
|
|
34
42
|
"./traits": "./traits/index.js",
|
|
35
43
|
"./traits/*": "./traits/*.js",
|
|
44
|
+
"./color": {
|
|
45
|
+
"types": "./color/index.d.ts",
|
|
46
|
+
"default": "./color/index.js"
|
|
47
|
+
},
|
|
36
48
|
"./package.json": "./package.json"
|
|
37
49
|
},
|
|
38
50
|
"files": [
|
|
39
51
|
"core/",
|
|
52
|
+
"color/",
|
|
40
53
|
"components/",
|
|
41
54
|
"!components/**/*.html",
|
|
42
55
|
"!components/**/*.examples.js",
|
|
@@ -50,7 +63,9 @@
|
|
|
50
63
|
"index.js",
|
|
51
64
|
"index.css",
|
|
52
65
|
"index.d.ts",
|
|
53
|
-
"USAGE.md"
|
|
66
|
+
"USAGE.md",
|
|
67
|
+
"README.md",
|
|
68
|
+
"CHANGELOG.md"
|
|
54
69
|
],
|
|
55
70
|
"sideEffects": [
|
|
56
71
|
"*.css",
|
package/styles/components.css
CHANGED
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
@import "../components/breadcrumb/breadcrumb.css";
|
|
41
41
|
@import "../components/command/command.css";
|
|
42
42
|
@import "../components/color-picker/color-picker.css";
|
|
43
|
+
@import "../components/color-input/color-input.css";
|
|
43
44
|
@import "../components/noodles/noodles.css";
|
|
44
45
|
@import "../components/table/table.css";
|
|
45
46
|
@import "../components/table-toolbar/table-toolbar.css";
|