@adia-ai/web-components 0.8.4 → 0.8.5
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 +18 -1
- package/USAGE.md +60 -25
- package/components/adia-mark/adia-mark.a2ui.json +123 -0
- package/components/adia-mark/adia-mark.class.js +64 -0
- package/components/adia-mark/adia-mark.css +48 -0
- package/components/adia-mark/adia-mark.d.ts +20 -0
- package/components/adia-mark/adia-mark.examples.md +26 -0
- package/components/adia-mark/adia-mark.js +17 -0
- package/components/adia-mark/adia-mark.test.js +69 -0
- package/components/adia-mark/adia-mark.yaml +121 -0
- package/components/agent-questions/agent-questions.a2ui.json +2 -1
- package/components/agent-questions/agent-questions.class.js +96 -53
- package/components/agent-questions/agent-questions.css +27 -106
- package/components/agent-questions/agent-questions.yaml +1 -0
- package/components/button/button.class.js +5 -1
- package/components/calendar-grid/calendar-grid.a2ui.json +3 -1
- package/components/calendar-grid/calendar-grid.class.js +11 -6
- package/components/calendar-grid/calendar-grid.css +42 -20
- package/components/calendar-grid/calendar-grid.yaml +5 -0
- package/components/calendar-picker/calendar-picker.a2ui.json +3 -1
- package/components/calendar-picker/calendar-picker.class.js +11 -6
- package/components/calendar-picker/calendar-picker.css +39 -19
- package/components/calendar-picker/calendar-picker.yaml +5 -0
- package/components/chart/chart.class.js +17 -14
- package/components/color-input/color-input.class.js +8 -5
- package/components/color-picker/color-picker.class.js +6 -3
- package/components/field/field.class.js +10 -7
- package/components/fields/fields.class.js +15 -12
- package/components/icon/icon.class.js +9 -5
- package/components/index.js +1 -0
- package/components/nav/nav.class.js +2 -1
- package/components/noodles/noodles.class.js +14 -10
- package/components/page/page.class.js +3 -2
- package/components/select/select.class.js +3 -2
- package/components/swatch/swatch.class.js +27 -24
- package/components/swiper/swiper.class.js +4 -1
- package/components/swiper/swiper.css +13 -4
- package/components/toolbar/toolbar.class.js +11 -6
- package/components/tree/tree.class.js +5 -2
- package/core/data-stream.js +21 -15
- package/core/element.js +36 -1
- package/core/element.test.js +67 -0
- package/core/icons-phosphor.js +86 -22
- package/core/icons.js +22 -8
- package/dist/theme-provider.min.js +2 -2
- package/dist/web-components.min.css +1 -1
- package/dist/web-components.min.js +107 -102
- package/dist/web-components.sheet.js +1 -1
- package/package.json +1 -5
- package/styles/components.css +1 -0
- package/traits/error-shake/error-shake.js +23 -17
- package/traits/fade-presence/fade-presence.js +19 -15
- package/traits/success-checkmark/success-checkmark.js +21 -16
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.5",
|
|
4
4
|
"description": "AdiaUI web components \u2014 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",
|
|
@@ -61,10 +61,6 @@
|
|
|
61
61
|
"types": "./css-module.d.ts",
|
|
62
62
|
"default": "./components/*/*.css"
|
|
63
63
|
},
|
|
64
|
-
"./components/*/*.css": {
|
|
65
|
-
"types": "./css-module.d.ts",
|
|
66
|
-
"default": "./components/*/*.css"
|
|
67
|
-
},
|
|
68
64
|
"./components/*/css/*.css": {
|
|
69
65
|
"types": "./css-module.d.ts",
|
|
70
66
|
"default": "./components/*/css/*.css"
|
package/styles/components.css
CHANGED
|
@@ -49,6 +49,7 @@
|
|
|
49
49
|
@import "../components/card/card.css";
|
|
50
50
|
@import "../components/frame/frame.css";
|
|
51
51
|
@import "../components/avatar/avatar.css";
|
|
52
|
+
@import "../components/adia-mark/adia-mark.css";
|
|
52
53
|
@import "../components/progress/progress.css";
|
|
53
54
|
@import "../components/skeleton/skeleton.css";
|
|
54
55
|
@import "../components/alert/alert.css";
|
|
@@ -121,28 +121,34 @@ export const errorShake = defineTrait({
|
|
|
121
121
|
// synchronously *before* dispatching `validated`, so the observer
|
|
122
122
|
// and event listener can both fire — we de-dupe by tracking the
|
|
123
123
|
// last-known invalid state and only triggering on false → true.
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
124
|
+
// gh#285 — SSR DOM shims (linkedom) have no MutationObserver global.
|
|
125
|
+
// Guard construction; the `validated` event listener below still
|
|
126
|
+
// covers the primary trigger path, so this degrades rather than crashes.
|
|
127
|
+
let observer = null;
|
|
128
|
+
if (typeof MutationObserver !== 'undefined') {
|
|
129
|
+
observer = new MutationObserver((muts) => {
|
|
130
|
+
for (const m of muts) {
|
|
131
|
+
if (m.attributeName === 'data-validation-invalid') {
|
|
132
|
+
const nowInvalid = host.hasAttribute('data-validation-invalid');
|
|
133
|
+
if (nowInvalid && !lastInvalid) shake();
|
|
134
|
+
lastInvalid = nowInvalid;
|
|
135
|
+
} else if (m.attributeName === 'data-error-shake-trigger') {
|
|
136
|
+
// Toggle (any change) fires a shake. Empty-string and "" are
|
|
137
|
+
// both treated as "present" — the convention for boolean attrs.
|
|
138
|
+
if (host.hasAttribute('data-error-shake-trigger')) shake();
|
|
139
|
+
}
|
|
134
140
|
}
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
}
|
|
141
|
+
});
|
|
142
|
+
observer.observe(host, {
|
|
143
|
+
attributes: true,
|
|
144
|
+
attributeFilter: ['data-validation-invalid', 'data-error-shake-trigger'],
|
|
145
|
+
});
|
|
146
|
+
}
|
|
141
147
|
|
|
142
148
|
host.addEventListener('validated', onValidated);
|
|
143
149
|
|
|
144
150
|
return () => {
|
|
145
|
-
observer
|
|
151
|
+
observer?.disconnect();
|
|
146
152
|
host.removeEventListener('validated', onValidated);
|
|
147
153
|
for (const t of activeTimers) clearTimeout(t);
|
|
148
154
|
activeTimers.clear();
|
|
@@ -21,20 +21,24 @@ export const fadePresence = defineTrait({
|
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
24
|
+
// gh#285 — SSR DOM shims (linkedom) have no MutationObserver global;
|
|
25
|
+
// skip construction rather than throwing (progressive enhancement).
|
|
26
|
+
let observer = null;
|
|
27
|
+
if (typeof MutationObserver !== 'undefined') {
|
|
28
|
+
observer = new MutationObserver(() => {
|
|
29
|
+
const visible = host.hasAttribute('data-fade-presence-visible');
|
|
30
|
+
if (visible) {
|
|
31
|
+
host.setAttribute('data-fade-presence-entering', '');
|
|
32
|
+
host.removeAttribute('data-fade-presence-exiting');
|
|
33
|
+
host.style.opacity = '1';
|
|
34
|
+
} else {
|
|
35
|
+
host.setAttribute('data-fade-presence-exiting', '');
|
|
36
|
+
host.removeAttribute('data-fade-presence-entering');
|
|
37
|
+
host.style.opacity = '0';
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
observer.observe(host, { attributes: true, attributeFilter: ['data-fade-presence-visible'] });
|
|
41
|
+
}
|
|
38
42
|
host.addEventListener('transitionend', onTransitionEnd);
|
|
39
43
|
|
|
40
44
|
// Apply initial state
|
|
@@ -43,7 +47,7 @@ export const fadePresence = defineTrait({
|
|
|
43
47
|
}
|
|
44
48
|
|
|
45
49
|
return () => {
|
|
46
|
-
observer
|
|
50
|
+
observer?.disconnect();
|
|
47
51
|
host.removeEventListener('transitionend', onTransitionEnd);
|
|
48
52
|
host.style.opacity = '';
|
|
49
53
|
host.style.transition = '';
|
|
@@ -188,27 +188,32 @@ export const successCheckmark = defineTrait({
|
|
|
188
188
|
if (e?.detail && e.detail.valid === true) draw();
|
|
189
189
|
}
|
|
190
190
|
|
|
191
|
-
//
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
191
|
+
// gh#285 — SSR DOM shims (linkedom) have no MutationObserver global.
|
|
192
|
+
// Guard construction; the `validated` event listener below still
|
|
193
|
+
// covers the primary trigger path, so this degrades rather than crashes.
|
|
194
|
+
let observer = null;
|
|
195
|
+
if (typeof MutationObserver !== 'undefined') {
|
|
196
|
+
observer = new MutationObserver((muts) => {
|
|
197
|
+
for (const m of muts) {
|
|
198
|
+
if (m.attributeName === 'data-validation-valid') {
|
|
199
|
+
const nowValid = host.hasAttribute('data-validation-valid');
|
|
200
|
+
if (nowValid && !lastValid) draw();
|
|
201
|
+
lastValid = nowValid;
|
|
202
|
+
} else if (m.attributeName === 'data-success-checkmark-trigger') {
|
|
203
|
+
if (host.hasAttribute('data-success-checkmark-trigger')) draw();
|
|
204
|
+
}
|
|
200
205
|
}
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
}
|
|
206
|
+
});
|
|
207
|
+
observer.observe(host, {
|
|
208
|
+
attributes: true,
|
|
209
|
+
attributeFilter: ['data-validation-valid', 'data-success-checkmark-trigger'],
|
|
210
|
+
});
|
|
211
|
+
}
|
|
207
212
|
|
|
208
213
|
host.addEventListener('validated', onValidated);
|
|
209
214
|
|
|
210
215
|
return () => {
|
|
211
|
-
observer
|
|
216
|
+
observer?.disconnect();
|
|
212
217
|
host.removeEventListener('validated', onValidated);
|
|
213
218
|
for (const t of activeTimers) clearTimeout(t);
|
|
214
219
|
activeTimers.clear();
|