@vonage/vivid 5.4.0 → 5.5.0
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/bundled/base-color-picker.cjs +18 -13
- package/bundled/base-color-picker.js +98 -81
- package/bundled/calendar-picker.template.cjs +1 -1
- package/bundled/calendar-picker.template.js +2 -2
- package/bundled/char-count.cjs +1 -1
- package/bundled/char-count.js +1 -1
- package/bundled/definition10.cjs +1 -1
- package/bundled/definition10.js +2 -2
- package/bundled/definition11.cjs +12 -19
- package/bundled/definition11.js +73 -204
- package/bundled/definition12.cjs +19 -10
- package/bundled/definition12.js +217 -36
- package/bundled/definition13.cjs +10 -1
- package/bundled/definition13.js +38 -14
- package/bundled/definition14.cjs +1 -5
- package/bundled/definition14.js +15 -24
- package/bundled/definition15.cjs +5 -30
- package/bundled/definition15.js +22 -73
- package/bundled/definition16.cjs +30 -19
- package/bundled/definition16.js +74 -97
- package/bundled/definition17.cjs +19 -13
- package/bundled/definition17.js +83 -117
- package/bundled/definition18.cjs +13 -12
- package/bundled/definition18.js +114 -71
- package/bundled/definition19.cjs +16 -16
- package/bundled/definition19.js +87 -84
- package/bundled/definition2.cjs +9 -9
- package/bundled/definition2.js +84 -129
- package/bundled/definition3.cjs +1 -1
- package/bundled/definition3.js +1 -1
- package/bundled/listbox.cjs +1 -1
- package/bundled/listbox.js +1 -1
- package/bundled/localized.cjs +1 -1
- package/bundled/localized.js +48 -35
- package/bundled/mixins.cjs +1 -1
- package/bundled/mixins.js +1 -1
- package/bundled/picker-field.template.cjs +14 -14
- package/bundled/picker-field.template.js +35 -56
- package/bundled/time-selection-picker.template.cjs +12 -12
- package/bundled/time-selection-picker.template.js +13 -12
- package/bundled/trapped-focus.cjs +1 -0
- package/bundled/trapped-focus.js +26 -0
- package/bundled/vivid-element.cjs +1 -1
- package/bundled/vivid-element.js +1 -1
- package/calendar/index.cjs +13 -13
- package/calendar/index.js +172 -144
- package/color-picker/definition.cjs +208 -112
- package/color-picker/definition.js +208 -112
- package/color-picker/index.cjs +104 -75
- package/color-picker/index.js +412 -326
- package/combobox/index.cjs +1 -1
- package/combobox/index.js +1 -1
- package/contextual-help/index.cjs +1 -1
- package/contextual-help/index.js +1 -1
- package/custom-elements.json +49 -0
- package/data-grid/index.cjs +1 -1
- package/data-grid/index.js +1 -1
- package/date-picker/index.cjs +1 -1
- package/date-picker/index.js +2 -2
- package/date-range-picker/index.cjs +1 -1
- package/date-range-picker/index.js +2 -2
- package/date-time-picker/index.cjs +1 -1
- package/date-time-picker/index.js +2 -2
- package/dial-pad/definition.cjs +139 -0
- package/dial-pad/definition.js +139 -0
- package/dial-pad/index.cjs +27 -20
- package/dial-pad/index.js +177 -100
- package/divider/index.cjs +1 -1
- package/divider/index.js +1 -1
- package/icon/definition.cjs +56 -22
- package/icon/definition.js +56 -22
- package/lib/color-picker/color-picker.d.ts +390 -12
- package/lib/color-picker/locale.d.ts +4 -0
- package/lib/date-picker/date-picker.d.ts +38 -38
- package/lib/date-range-picker/date-range-picker.d.ts +20 -20
- package/lib/date-time-picker/date-time-picker.d.ts +40 -40
- package/lib/dial-pad/dial-pad.d.ts +1 -0
- package/lib/icon/icon.d.ts +1 -0
- package/lib/simple-color-picker/simple-color-picker.d.ts +2 -1
- package/lib/time-picker/time-picker.d.ts +20 -20
- package/locales/de-DE.cjs +16 -3
- package/locales/de-DE.js +16 -3
- package/locales/en-GB.cjs +17 -4
- package/locales/en-GB.js +17 -4
- package/locales/en-US.cjs +17 -4
- package/locales/en-US.js +17 -4
- package/locales/ja-JP.cjs +16 -3
- package/locales/ja-JP.js +16 -3
- package/locales/zh-CN.cjs +15 -2
- package/locales/zh-CN.js +15 -2
- package/number-field/index.cjs +1 -1
- package/number-field/index.js +3 -3
- package/option/index.cjs +1 -1
- package/option/index.js +1 -1
- package/package.json +1 -1
- package/progress-ring/index.cjs +1 -1
- package/progress-ring/index.js +1 -1
- package/radio/index.cjs +1 -1
- package/radio/index.js +1 -1
- package/radio-group/index.cjs +1 -1
- package/radio-group/index.js +1 -1
- package/rich-text-editor/index.cjs +1 -1
- package/rich-text-editor/index.js +3 -3
- package/searchable-select/index.cjs +1 -1
- package/searchable-select/index.js +3 -3
- package/select/definition.cjs +6 -3
- package/select/definition.js +6 -3
- package/selectable-box/index.cjs +1 -1
- package/selectable-box/index.js +1 -1
- package/shared/color-picker/base-color-picker.d.ts +2 -1
- package/shared/picker-field/mixins/calendar-picker.d.ts +10 -10
- package/shared/picker-field/mixins/calendar-picker.template.d.ts +10 -10
- package/shared/picker-field/mixins/min-max-calendar-picker.d.ts +20 -20
- package/shared/picker-field/mixins/single-date-picker.d.ts +28 -28
- package/shared/picker-field/mixins/single-value-picker.d.ts +8 -8
- package/shared/picker-field/mixins/time-selection-picker.d.ts +20 -20
- package/shared/picker-field/mixins/time-selection-picker.template.d.ts +20 -20
- package/simple-color-picker/definition.cjs +8 -6
- package/simple-color-picker/definition.js +8 -6
- package/simple-color-picker/index.cjs +6 -6
- package/simple-color-picker/index.js +41 -39
- package/styles/core/all.css +1 -1
- package/styles/core/theme.css +1 -1
- package/styles/core/typography.css +1 -1
- package/styles/tokens/theme-dark.css +4 -4
- package/styles/tokens/theme-light.css +4 -4
- package/styles/tokens/vivid-2-compat.css +1 -1
- package/tag/definition.cjs +34 -14
- package/tag/definition.js +34 -14
- package/tag/index.cjs +25 -12
- package/tag/index.js +64 -47
- package/tag-group/definition.cjs +1 -2
- package/tag-group/definition.js +1 -2
- package/tag-group/index.cjs +1 -1
- package/tag-group/index.js +11 -12
- package/text-area/index.cjs +1 -1
- package/text-area/index.js +2 -2
- package/time-picker/index.cjs +1 -1
- package/time-picker/index.js +1 -1
- package/toggletip/index.cjs +1 -1
- package/toggletip/index.js +1 -1
- package/tooltip/definition.cjs +2 -2
- package/tooltip/definition.js +2 -2
- package/tooltip/index.cjs +1 -1
- package/tooltip/index.js +1 -1
- package/unbundled/base-color-picker.cjs +36 -18
- package/unbundled/base-color-picker.js +36 -18
- package/unbundled/calendar-picker.template.cjs +1 -1
- package/unbundled/calendar-picker.template.js +1 -1
- package/unbundled/picker-field.template.cjs +2 -35
- package/unbundled/picker-field.template.js +2 -34
- package/unbundled/time-selection-picker.template.cjs +2 -1
- package/unbundled/time-selection-picker.template.js +2 -1
- package/unbundled/trapped-focus.cjs +37 -0
- package/unbundled/trapped-focus.js +34 -0
- package/unbundled/vivid-element.cjs +1 -1
- package/unbundled/vivid-element.js +1 -1
- package/visually-hidden/index.cjs +1 -1
- package/visually-hidden/index.js +1 -1
- package/bundled/_has.cjs +0 -1
- package/bundled/_has.js +0 -34
package/bundled/definition17.cjs
CHANGED
|
@@ -1,13 +1,19 @@
|
|
|
1
|
-
"use strict";const
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
"use strict";const p=require("./definition9.cjs"),n=require("./vivid-element.cjs"),d=require("./anchored.cjs"),u=require("./localized.cjs"),g=require("./index.cjs"),m=require("./when.cjs"),v=require("./class-names.cjs"),f=":host :host{display:var(--_popup-display, inline)}:host :host([slotted-anchor]){--_popup-display: contents}.content-wrapper{width:var(--toggletip-inline-size, auto);padding:16px;max-inline-size:var(--toggletip-max-inline-size, 30ch)}.headline{margin:0;font:var(--vvd-typography-base-bold)}.action-items{display:flex;justify-content:flex-end;gap:10px}::slotted([slot=action-items]){margin-block-start:16px}";var b=Object.defineProperty,r=(s,e,i,t)=>{for(var o=void 0,l=s.length-1,c;l>=0;l--)(c=s[l])&&(o=c(e,i,o)||o);return o&&b(e,i,o),o};class a extends u.Localized(d.Anchored(n.VividElement)){constructor(){super(...arguments),this.#e=null,this.alternate=!1,this.placement="right",this.open=!1,this.#t=()=>{this.open||n.Updates.enqueue(()=>this.open=!0)},this.#n=e=>{const i=!this.contains(e.target),t=this._anchorEl?.contains(e.target);(i||t)&&(this.open=!1)},this.#o=e=>{e.key==="Escape"&&(this.open=!1)}}#e;openChanged(e,i){e!==void 0&&(i?this.setAttribute("role","status"):this.removeAttribute("role"),this.#i(),this._anchorEl&&this.#s(this._anchorEl))}connectedCallback(){super.connectedCallback(),this.#i()}disconnectedCallback(){super.disconnectedCallback(),this.#i()}_anchorElChanged(e,i){e&&this.#r(e),i&&this.#a(i)}#a(e){e.addEventListener("click",this.#t,!0),this.#e=e.ariaLabel,e.ariaLabel=`${this.locale.toggletip.anchorLabel(e.ariaLabel||"")}`,this.#s(e)}#s(e){e.setAttribute("aria-expanded",this.open.toString()),e.setAttribute("data-expanded",this.open.toString())}#r(e){e.removeEventListener("click",this.#t,!0),e.ariaLabel&&(e.ariaLabel=this.#e),e.removeAttribute("aria-expanded"),e.removeAttribute("data-expanded")}#t;#i(){document.removeEventListener("click",this.#n),document.removeEventListener("keydown",this.#o),this.open&&this.isConnected&&(document.addEventListener("click",this.#n),document.addEventListener("keydown",this.#o))}#n;#o}r([n.attr],a.prototype,"headline");r([n.attr({mode:"boolean"})],a.prototype,"alternate");r([n.attr({mode:"fromView"})],a.prototype,"placement");r([n.attr({mode:"boolean"})],a.prototype,"open");const y=s=>v.classNames("control"),k=s=>{const e=s.tagFor(p.Popup),i=d.anchorSlotTemplateFactory();return n.html`
|
|
2
|
+
${i}
|
|
3
|
+
<${e}
|
|
4
|
+
@keydown="${(t,{event:o})=>!(t.open&&g.handleEscapeKeyAndStopPropogation(o))}"
|
|
5
|
+
class="${y}"
|
|
6
|
+
arrow
|
|
7
|
+
:anchor="${t=>t._anchorEl}"
|
|
8
|
+
:open="${t=>t.open}"
|
|
9
|
+
?alternate="${t=>!t.alternate}"
|
|
10
|
+
placement="${t=>t.placement}"
|
|
11
|
+
exportparts="vvd-theme-alternate"
|
|
12
|
+
>
|
|
13
|
+
<div class="content-wrapper">
|
|
14
|
+
${m.when(t=>t.headline,n.html`<h2 class="headline">${t=>t.headline}</h2>`)}
|
|
15
|
+
<slot></slot>
|
|
16
|
+
<div class="action-items"><slot name="action-items"></slot></div>
|
|
17
|
+
</div>
|
|
18
|
+
</${e}>
|
|
19
|
+
`},h=n.defineVividComponent("toggletip",a,k,[p.popupDefinition],{styles:f}),E=n.createRegisterFunction(h);exports.Toggletip=a;exports.registerToggletip=E;exports.toggletipDefinition=h;
|
package/bundled/definition17.js
CHANGED
|
@@ -1,137 +1,103 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { w as
|
|
7
|
-
import { c as
|
|
8
|
-
const
|
|
9
|
-
var
|
|
10
|
-
for (var
|
|
11
|
-
(
|
|
12
|
-
return
|
|
1
|
+
import { P as d, p as h } from "./definition9.js";
|
|
2
|
+
import { V as m, U as u, a, h as c, c as f, d as g } from "./vivid-element.js";
|
|
3
|
+
import { A as v, a as b } from "./anchored.js";
|
|
4
|
+
import { L as y } from "./localized.js";
|
|
5
|
+
import { h as k } from "./index.js";
|
|
6
|
+
import { w as L } from "./when.js";
|
|
7
|
+
import { c as E } from "./class-names.js";
|
|
8
|
+
const x = ":host :host{display:var(--_popup-display, inline)}:host :host([slotted-anchor]){--_popup-display: contents}.content-wrapper{width:var(--toggletip-inline-size, auto);padding:16px;max-inline-size:var(--toggletip-max-inline-size, 30ch)}.headline{margin:0;font:var(--vvd-typography-base-bold)}.action-items{display:flex;justify-content:flex-end;gap:10px}::slotted([slot=action-items]){margin-block-start:16px}";
|
|
9
|
+
var A = Object.defineProperty, r = (n, e, i, t) => {
|
|
10
|
+
for (var o = void 0, l = n.length - 1, p; l >= 0; l--)
|
|
11
|
+
(p = n[l]) && (o = p(e, i, o) || o);
|
|
12
|
+
return o && A(e, i, o), o;
|
|
13
13
|
};
|
|
14
|
-
class
|
|
15
|
-
y(b(p))
|
|
16
|
-
) {
|
|
14
|
+
class s extends y(v(m)) {
|
|
17
15
|
constructor() {
|
|
18
|
-
super(), this.
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
const e = this.#e, o = this.#a;
|
|
27
|
-
e && e.length > 1 && e.some((r) => r.checked) && (this.setValidity({ valueMissing: !1 }), this.errorValidationMessage = "", o && (o.errorValidationMessage = ""));
|
|
28
|
-
}, this.#r = () => {
|
|
29
|
-
if (this.elementInternals && !this.validity.valueMissing) {
|
|
30
|
-
const e = this.#e, o = this.#a;
|
|
31
|
-
e && e.length > 1 && e.forEach((t) => {
|
|
32
|
-
t.elementInternals.setValidity({ valueMissing: !1 }), t.errorValidationMessage = "", o && (o.errorValidationMessage = "");
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
}, this.proxy.setAttribute("type", "radio"), this.proxy.setAttribute("name", this.name), this.checked = this.defaultChecked, this.dirtyChecked = !1;
|
|
16
|
+
super(...arguments), this.#e = null, this.alternate = !1, this.placement = "right", this.open = !1, this.#t = () => {
|
|
17
|
+
this.open || u.enqueue(() => this.open = !0);
|
|
18
|
+
}, this.#o = (e) => {
|
|
19
|
+
const i = !this.contains(e.target), t = this._anchorEl?.contains(e.target);
|
|
20
|
+
(i || t) && (this.open = !1);
|
|
21
|
+
}, this.#n = (e) => {
|
|
22
|
+
e.key === "Escape" && (this.open = !1);
|
|
23
|
+
};
|
|
36
24
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
*/
|
|
41
|
-
readOnlyChanged() {
|
|
42
|
-
this.proxy instanceof HTMLInputElement && (this.proxy.readOnly = this.readOnly);
|
|
25
|
+
#e;
|
|
26
|
+
openChanged(e, i) {
|
|
27
|
+
e !== void 0 && (i ? this.setAttribute("role", "status") : this.removeAttribute("role"), this.#i(), this._anchorEl && this.#s(this._anchorEl));
|
|
43
28
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
*/
|
|
47
|
-
defaultCheckedChanged() {
|
|
48
|
-
this.$fastController.isConnected && !this.dirtyChecked && (this.isInsideRadioGroup() || (this.checked = this.defaultChecked, this.dirtyChecked = !1));
|
|
29
|
+
connectedCallback() {
|
|
30
|
+
super.connectedCallback(), this.#i();
|
|
49
31
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
*/
|
|
53
|
-
nameChanged(e, o) {
|
|
54
|
-
super.nameChanged(e, o), o !== null ? this.proxy.setAttribute("name", this.name) : this.proxy.removeAttribute("name"), s.enqueue(this.validate);
|
|
32
|
+
disconnectedCallback() {
|
|
33
|
+
super.disconnectedCallback(), this.#i();
|
|
55
34
|
}
|
|
56
35
|
/**
|
|
57
36
|
* @internal
|
|
58
37
|
*/
|
|
59
|
-
|
|
60
|
-
|
|
38
|
+
_anchorElChanged(e, i) {
|
|
39
|
+
e && this.#r(e), i && this.#a(i);
|
|
61
40
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
'[data-vvd-component="radio-group"]'
|
|
65
|
-
) !== null;
|
|
41
|
+
#a(e) {
|
|
42
|
+
e.addEventListener("click", this.#t, !0), this.#e = e.ariaLabel, e.ariaLabel = `${this.locale.toggletip.anchorLabel(e.ariaLabel || "")}`, this.#s(e);
|
|
66
43
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
*/
|
|
70
|
-
clickHandler(e) {
|
|
71
|
-
!this.disabled && !this.readOnly && !this.checked && (this.checked = !0);
|
|
44
|
+
#s(e) {
|
|
45
|
+
e.setAttribute("aria-expanded", this.open.toString()), e.setAttribute("data-expanded", this.open.toString());
|
|
72
46
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
`${this.tagName.toLocaleLowerCase()}[name="${this.name}"]`
|
|
76
|
-
);
|
|
77
|
-
return e ? Array.from(e) : [];
|
|
47
|
+
#r(e) {
|
|
48
|
+
e.removeEventListener("click", this.#t, !0), e.ariaLabel && (e.ariaLabel = this.#e), e.removeAttribute("aria-expanded"), e.removeAttribute("data-expanded");
|
|
78
49
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
);
|
|
83
|
-
return e || null;
|
|
50
|
+
#t;
|
|
51
|
+
#i() {
|
|
52
|
+
document.removeEventListener("click", this.#o), document.removeEventListener("keydown", this.#n), this.open && this.isConnected && (document.addEventListener("click", this.#o), document.addEventListener("keydown", this.#n));
|
|
84
53
|
}
|
|
85
54
|
#o;
|
|
86
|
-
#
|
|
87
|
-
/**
|
|
88
|
-
* @internal
|
|
89
|
-
*/
|
|
90
|
-
validate(e) {
|
|
91
|
-
super.validate(e), this.proxy && (this.errorValidationMessage = this.validationMessage || "", this.validity.valueMissing ? this.#o() : this.#r());
|
|
92
|
-
}
|
|
55
|
+
#n;
|
|
93
56
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
],
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
],
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
],
|
|
103
|
-
|
|
104
|
-
"
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
</
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
57
|
+
r([
|
|
58
|
+
a
|
|
59
|
+
], s.prototype, "headline");
|
|
60
|
+
r([
|
|
61
|
+
a({ mode: "boolean" })
|
|
62
|
+
], s.prototype, "alternate");
|
|
63
|
+
r([
|
|
64
|
+
a({ mode: "fromView" })
|
|
65
|
+
], s.prototype, "placement");
|
|
66
|
+
r([
|
|
67
|
+
a({ mode: "boolean" })
|
|
68
|
+
], s.prototype, "open");
|
|
69
|
+
const C = (n) => E("control"), _ = (n) => {
|
|
70
|
+
const e = n.tagFor(d), i = b();
|
|
71
|
+
return c`
|
|
72
|
+
${i}
|
|
73
|
+
<${e}
|
|
74
|
+
@keydown="${(t, { event: o }) => !(t.open && k(o))}"
|
|
75
|
+
class="${C}"
|
|
76
|
+
arrow
|
|
77
|
+
:anchor="${(t) => t._anchorEl}"
|
|
78
|
+
:open="${(t) => t.open}"
|
|
79
|
+
?alternate="${(t) => !t.alternate}"
|
|
80
|
+
placement="${(t) => t.placement}"
|
|
81
|
+
exportparts="vvd-theme-alternate"
|
|
82
|
+
>
|
|
83
|
+
<div class="content-wrapper">
|
|
84
|
+
${L((t) => t.headline, c`<h2 class="headline">${(t) => t.headline}</h2>`)}
|
|
85
|
+
<slot></slot>
|
|
86
|
+
<div class="action-items"><slot name="action-items"></slot></div>
|
|
87
|
+
</div>
|
|
88
|
+
</${e}>
|
|
89
|
+
`;
|
|
90
|
+
}, $ = g(
|
|
91
|
+
"toggletip",
|
|
92
|
+
s,
|
|
93
|
+
_,
|
|
94
|
+
[h],
|
|
129
95
|
{
|
|
130
|
-
styles:
|
|
96
|
+
styles: x
|
|
131
97
|
}
|
|
132
|
-
),
|
|
98
|
+
), j = f($);
|
|
133
99
|
export {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
100
|
+
s as T,
|
|
101
|
+
j as r,
|
|
102
|
+
$ as t
|
|
137
103
|
};
|
package/bundled/definition18.cjs
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
"use strict";const
|
|
2
|
-
${
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
"use strict";const r=require("./vivid-element.cjs"),v=require("./form-associated.cjs"),p=require("./with-error-text.cjs"),h=require("./form-element.cjs"),u=require("./key-codes.cjs"),b=require("./when.cjs"),m=require("./class-names.cjs"),f=':host(:focus-visible){outline:none}:host([disabled]){cursor:not-allowed}.base.connotation-cta{--_connotation-color-primary: var(--vvd-radio-cta-primary, var(--vvd-color-cta-500));--_connotation-color-primary-text: var(--vvd-radio-cta-primary-text, var(--vvd-color-canvas));--_connotation-color-primary-increment: var(--vvd-radio-cta-primary-increment, var(--vvd-color-cta-600));--_connotation-color-intermediate: var(--vvd-radio-cta-intermediate, var(--vvd-color-cta-500));--_connotation-color-firm: var(--vvd-radio-cta-firm, var(--vvd-color-cta-600));--_connotation-color-fierce: var(--vvd-radio-cta-fierce, var(--vvd-color-cta-700))}.base:not(.connotation-cta){--_connotation-color-primary: var(--vvd-radio-accent-primary, var(--vvd-color-canvas-text));--_connotation-color-primary-text: var(--vvd-radio-accent-primary-text, var(--vvd-color-canvas));--_connotation-color-primary-increment: var(--vvd-radio-accent-primary-increment, var(--vvd-color-neutral-800));--_connotation-color-intermediate: var(--vvd-radio-accent-intermediate, var(--vvd-color-neutral-500));--_connotation-color-firm: var(--vvd-radio-accent-firm, var(--vvd-color-canvas-text));--_connotation-color-fierce: var(--vvd-radio-accent-fierce, var(--vvd-color-neutral-700))}.base{--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-canvas);--_appearance-color-outline: var(--vvd-color-neutral-500)}@media (hover: hover){.base:hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-canvas);--_appearance-color-outline: var(--vvd-color-neutral-700)}}.base.hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-canvas);--_appearance-color-outline: var(--vvd-color-neutral-700)}.base:checked:where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-primary-text);--_appearance-color-fill: var(--_connotation-color-primary);--_appearance-color-outline: var(--_connotation-color-primary)}.base.checked:where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-primary-text);--_appearance-color-fill: var(--_connotation-color-primary);--_appearance-color-outline: var(--_connotation-color-primary)}@media (hover: hover){.base:checked:hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-primary-text);--_appearance-color-fill: var(--_connotation-color-primary-increment);--_appearance-color-outline: var(--_connotation-color-primary-increment)}}.base.checked.hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-primary-text);--_appearance-color-fill: var(--_connotation-color-primary-increment);--_appearance-color-outline: var(--_connotation-color-primary-increment)}.base:disabled{--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: var(--vvd-color-neutral-100);--_appearance-color-outline: var(--vvd-color-neutral-300)}.base.disabled{--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: var(--vvd-color-neutral-100);--_appearance-color-outline: var(--vvd-color-neutral-300)}.base.readonly:where(:not(.disabled,:disabled)){--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-neutral-200);--_appearance-color-outline: var(--vvd-color-neutral-400)}.base{display:inline-flex;align-items:center;cursor:pointer;gap:8px}@supports (user-select: none){.base{user-select:none}}.base.disabled{pointer-events:none}.control{position:relative;flex-shrink:0;border-radius:50%;block-size:calc(1px*(20 + 4*clamp(-1,var(--vvd-size-density, 0),2)));box-shadow:inset 0 0 0 2px var(--_appearance-color-outline);inline-size:calc(1px*(20 + 4*clamp(-1,var(--vvd-size-density, 0),2)))}.base:not(.checked) .control{background-color:var(--_appearance-color-fill)}.control:after{position:absolute;border-radius:inherit;background-color:var(--_appearance-color-outline);content:"";inset:5px;opacity:1;transition:opacity .2s}.base:not(.checked) .control:after{opacity:0}:host(:focus-visible) .control{--focus-stroke-gap-color: transparent;position:relative}:host(:focus-visible) .control:before{box-shadow:0 0 0 4px color-mix(in srgb,var(--vvd-color-cta-500),transparent 85%),inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:1px solid var(--focus-stroke-color, var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset, 0px));position:absolute;display:block;border-radius:var(--focus-border-radius, inherit);block-size:calc(100% + var(--focus-block-size-addition, 4px));content:"";inline-size:calc(100% + var(--focus-block-size-addition, 4px));inset-block-start:50%;inset-inline-start:50%;transform:translate(-50%,-50%)}label{color:var(--vvd-color-canvas-text);cursor:pointer;font:var(--vvd-typography-base)}';var y=Object.defineProperty,l=(a,e,o,i)=>{for(var t=void 0,c=a.length-1,s;c>=0;c--)(s=a[c])&&(t=s(e,o,t)||t);return t&&y(e,o,t),t};class n extends p.WithErrorText(h.FormElement(v.CheckableFormAssociated(r.VividElement))){constructor(){super(),this.initialValue="on",this.defaultSlottedNodes=[],this.keypressHandler=e=>{switch(e.key){case u.keySpace:!this.checked&&!this.readOnly&&(this.checked=!0);return}return!0},this.proxy=document.createElement("input"),this.#o=()=>{const e=this.#e,o=this.#a;e&&e.length>1&&e.some(t=>t.checked)&&(this.setValidity({valueMissing:!1}),this.errorValidationMessage="",o&&(o.errorValidationMessage=""))},this.#r=()=>{if(this.elementInternals&&!this.validity.valueMissing){const e=this.#e,o=this.#a;e&&e.length>1&&e.forEach(i=>{i.elementInternals.setValidity({valueMissing:!1}),i.errorValidationMessage="",o&&(o.errorValidationMessage="")})}},this.proxy.setAttribute("type","radio"),this.proxy.setAttribute("name",this.name),this.checked=this.defaultChecked,this.dirtyChecked=!1}readOnlyChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.readOnly=this.readOnly)}defaultCheckedChanged(){this.$fastController.isConnected&&!this.dirtyChecked&&(this.isInsideRadioGroup()||(this.checked=this.defaultChecked,this.dirtyChecked=!1))}nameChanged(e,o){super.nameChanged(e,o),o!==null?this.proxy.setAttribute("name",this.name):this.proxy.removeAttribute("name"),r.Updates.enqueue(this.validate)}connectedCallback(){super.connectedCallback(),r.Updates.enqueue(this.validate),this.parentElement.getAttribute("data-vvd-component")!=="radio-group"&&this.getAttribute("tabindex")===null&&(this.disabled||this.setAttribute("tabindex","0")),this.defaultChecked&&(this.dirtyChecked||this.isInsideRadioGroup()||(this.checked=this.defaultChecked,this.dirtyChecked=!1))}isInsideRadioGroup(){return this.closest('[data-vvd-component="radio-group"]')!==null}clickHandler(e){!this.disabled&&!this.readOnly&&!this.checked&&(this.checked=!0)}get#e(){const e=this.parentElement?.querySelectorAll(`${this.tagName.toLocaleLowerCase()}[name="${this.name}"]`);return e?Array.from(e):[]}get#a(){const e=this.closest(`${this.tagName.toLocaleLowerCase()}-group[name="${this.name}"]`);return e||null}#o;#r;validate(e){super.validate(e),this.proxy&&(this.errorValidationMessage=this.validationMessage||"",this.validity.valueMissing?this.#o():this.#r())}}l([r.attr],n.prototype,"connotation");l([r.attr({attribute:"readonly",mode:"boolean"})],n.prototype,"readOnly");l([r.observable],n.prototype,"defaultSlottedNodes");const _=({connotation:a,checked:e,readOnly:o,disabled:i})=>m.classNames("base",[`connotation-${a}`,!!a],["checked",!!e],["readonly",!!o],["disabled",!!i]),k=r.html`<template
|
|
2
|
+
aria-checked="${a=>a?.checked}"
|
|
3
|
+
aria-disabled="${a=>a?.disabled}"
|
|
4
|
+
aria-required="${a=>a?.required}"
|
|
5
|
+
@keypress="${(a,e)=>a?.keypressHandler(e.event)}"
|
|
6
|
+
@click="${(a,e)=>a?.clickHandler(e.event)}"
|
|
7
|
+
role="radio"
|
|
8
|
+
>
|
|
9
|
+
<div class="${_}">
|
|
10
|
+
<div class="control"></div>
|
|
11
|
+
${b.when(a=>a?.label,r.html`<label class="label">${a=>a?.label}</label>`)}
|
|
12
|
+
</div>
|
|
13
|
+
</template>`,d=r.defineVividComponent("radio",n,k,[],{styles:f}),x=r.createRegisterFunction(d);exports.Radio=n;exports.radioDefinition=d;exports.registerRadio=x;
|
package/bundled/definition18.js
CHANGED
|
@@ -1,94 +1,137 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { V as p, U as s, a as v, o as h, h as d, c as u, d as m } from "./vivid-element.js";
|
|
2
|
+
import { C as b } from "./form-associated.js";
|
|
3
|
+
import { W as f } from "./with-error-text.js";
|
|
4
|
+
import { F as y } from "./form-element.js";
|
|
5
|
+
import { l as _ } from "./key-codes.js";
|
|
6
|
+
import { w as x } from "./when.js";
|
|
7
|
+
import { c as k } from "./class-names.js";
|
|
8
|
+
const g = ':host(:focus-visible){outline:none}:host([disabled]){cursor:not-allowed}.base.connotation-cta{--_connotation-color-primary: var(--vvd-radio-cta-primary, var(--vvd-color-cta-500));--_connotation-color-primary-text: var(--vvd-radio-cta-primary-text, var(--vvd-color-canvas));--_connotation-color-primary-increment: var(--vvd-radio-cta-primary-increment, var(--vvd-color-cta-600));--_connotation-color-intermediate: var(--vvd-radio-cta-intermediate, var(--vvd-color-cta-500));--_connotation-color-firm: var(--vvd-radio-cta-firm, var(--vvd-color-cta-600));--_connotation-color-fierce: var(--vvd-radio-cta-fierce, var(--vvd-color-cta-700))}.base:not(.connotation-cta){--_connotation-color-primary: var(--vvd-radio-accent-primary, var(--vvd-color-canvas-text));--_connotation-color-primary-text: var(--vvd-radio-accent-primary-text, var(--vvd-color-canvas));--_connotation-color-primary-increment: var(--vvd-radio-accent-primary-increment, var(--vvd-color-neutral-800));--_connotation-color-intermediate: var(--vvd-radio-accent-intermediate, var(--vvd-color-neutral-500));--_connotation-color-firm: var(--vvd-radio-accent-firm, var(--vvd-color-canvas-text));--_connotation-color-fierce: var(--vvd-radio-accent-fierce, var(--vvd-color-neutral-700))}.base{--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-canvas);--_appearance-color-outline: var(--vvd-color-neutral-500)}@media (hover: hover){.base:hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-canvas);--_appearance-color-outline: var(--vvd-color-neutral-700)}}.base.hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-canvas);--_appearance-color-outline: var(--vvd-color-neutral-700)}.base:checked:where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-primary-text);--_appearance-color-fill: var(--_connotation-color-primary);--_appearance-color-outline: var(--_connotation-color-primary)}.base.checked:where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-primary-text);--_appearance-color-fill: var(--_connotation-color-primary);--_appearance-color-outline: var(--_connotation-color-primary)}@media (hover: hover){.base:checked:hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-primary-text);--_appearance-color-fill: var(--_connotation-color-primary-increment);--_appearance-color-outline: var(--_connotation-color-primary-increment)}}.base.checked.hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-primary-text);--_appearance-color-fill: var(--_connotation-color-primary-increment);--_appearance-color-outline: var(--_connotation-color-primary-increment)}.base:disabled{--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: var(--vvd-color-neutral-100);--_appearance-color-outline: var(--vvd-color-neutral-300)}.base.disabled{--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: var(--vvd-color-neutral-100);--_appearance-color-outline: var(--vvd-color-neutral-300)}.base.readonly:where(:not(.disabled,:disabled)){--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-neutral-200);--_appearance-color-outline: var(--vvd-color-neutral-400)}.base{display:inline-flex;align-items:center;cursor:pointer;gap:8px}@supports (user-select: none){.base{user-select:none}}.base.disabled{pointer-events:none}.control{position:relative;flex-shrink:0;border-radius:50%;block-size:calc(1px*(20 + 4*clamp(-1,var(--vvd-size-density, 0),2)));box-shadow:inset 0 0 0 2px var(--_appearance-color-outline);inline-size:calc(1px*(20 + 4*clamp(-1,var(--vvd-size-density, 0),2)))}.base:not(.checked) .control{background-color:var(--_appearance-color-fill)}.control:after{position:absolute;border-radius:inherit;background-color:var(--_appearance-color-outline);content:"";inset:5px;opacity:1;transition:opacity .2s}.base:not(.checked) .control:after{opacity:0}:host(:focus-visible) .control{--focus-stroke-gap-color: transparent;position:relative}:host(:focus-visible) .control:before{box-shadow:0 0 0 4px color-mix(in srgb,var(--vvd-color-cta-500),transparent 85%),inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:1px solid var(--focus-stroke-color, var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset, 0px));position:absolute;display:block;border-radius:var(--focus-border-radius, inherit);block-size:calc(100% + var(--focus-block-size-addition, 4px));content:"";inline-size:calc(100% + var(--focus-block-size-addition, 4px));inset-block-start:50%;inset-inline-start:50%;transform:translate(-50%,-50%)}label{color:var(--vvd-color-canvas-text);cursor:pointer;font:var(--vvd-typography-base)}';
|
|
9
|
+
var C = Object.defineProperty, c = (a, e, o, t) => {
|
|
10
|
+
for (var r = void 0, n = a.length - 1, l; n >= 0; n--)
|
|
11
|
+
(l = a[n]) && (r = l(e, o, r) || r);
|
|
12
|
+
return r && C(e, o, r), r;
|
|
11
13
|
};
|
|
12
|
-
class i extends f(
|
|
14
|
+
class i extends f(
|
|
15
|
+
y(b(p))
|
|
16
|
+
) {
|
|
13
17
|
constructor() {
|
|
14
|
-
super(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
super(), this.initialValue = "on", this.defaultSlottedNodes = [], this.keypressHandler = (e) => {
|
|
19
|
+
switch (e.key) {
|
|
20
|
+
case _:
|
|
21
|
+
!this.checked && !this.readOnly && (this.checked = !0);
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
return !0;
|
|
25
|
+
}, this.proxy = document.createElement("input"), this.#o = () => {
|
|
26
|
+
const e = this.#e, o = this.#a;
|
|
27
|
+
e && e.length > 1 && e.some((r) => r.checked) && (this.setValidity({ valueMissing: !1 }), this.errorValidationMessage = "", o && (o.errorValidationMessage = ""));
|
|
28
|
+
}, this.#r = () => {
|
|
29
|
+
if (this.elementInternals && !this.validity.valueMissing) {
|
|
30
|
+
const e = this.#e, o = this.#a;
|
|
31
|
+
e && e.length > 1 && e.forEach((t) => {
|
|
32
|
+
t.elementInternals.setValidity({ valueMissing: !1 }), t.errorValidationMessage = "", o && (o.errorValidationMessage = "");
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
}, this.proxy.setAttribute("type", "radio"), this.proxy.setAttribute("name", this.name), this.checked = this.defaultChecked, this.dirtyChecked = !1;
|
|
21
36
|
}
|
|
22
|
-
|
|
23
|
-
|
|
37
|
+
// Map to proxy element
|
|
38
|
+
/**
|
|
39
|
+
* @internal
|
|
40
|
+
*/
|
|
41
|
+
readOnlyChanged() {
|
|
42
|
+
this.proxy instanceof HTMLInputElement && (this.proxy.readOnly = this.readOnly);
|
|
24
43
|
}
|
|
25
|
-
|
|
26
|
-
|
|
44
|
+
/**
|
|
45
|
+
* @internal
|
|
46
|
+
*/
|
|
47
|
+
defaultCheckedChanged() {
|
|
48
|
+
this.$fastController.isConnected && !this.dirtyChecked && (this.isInsideRadioGroup() || (this.checked = this.defaultChecked, this.dirtyChecked = !1));
|
|
27
49
|
}
|
|
28
50
|
/**
|
|
29
51
|
* @internal
|
|
30
52
|
*/
|
|
31
|
-
|
|
32
|
-
e
|
|
53
|
+
nameChanged(e, o) {
|
|
54
|
+
super.nameChanged(e, o), o !== null ? this.proxy.setAttribute("name", this.name) : this.proxy.removeAttribute("name"), s.enqueue(this.validate);
|
|
33
55
|
}
|
|
34
|
-
|
|
35
|
-
|
|
56
|
+
/**
|
|
57
|
+
* @internal
|
|
58
|
+
*/
|
|
59
|
+
connectedCallback() {
|
|
60
|
+
super.connectedCallback(), s.enqueue(this.validate), this.parentElement.getAttribute("data-vvd-component") !== "radio-group" && this.getAttribute("tabindex") === null && (this.disabled || this.setAttribute("tabindex", "0")), this.defaultChecked && (this.dirtyChecked || this.isInsideRadioGroup() || (this.checked = this.defaultChecked, this.dirtyChecked = !1));
|
|
61
|
+
}
|
|
62
|
+
isInsideRadioGroup() {
|
|
63
|
+
return this.closest(
|
|
64
|
+
'[data-vvd-component="radio-group"]'
|
|
65
|
+
) !== null;
|
|
36
66
|
}
|
|
37
|
-
|
|
38
|
-
|
|
67
|
+
/**
|
|
68
|
+
* @internal
|
|
69
|
+
*/
|
|
70
|
+
clickHandler(e) {
|
|
71
|
+
!this.disabled && !this.readOnly && !this.checked && (this.checked = !0);
|
|
39
72
|
}
|
|
40
|
-
#
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
73
|
+
get #e() {
|
|
74
|
+
const e = this.parentElement?.querySelectorAll(
|
|
75
|
+
`${this.tagName.toLocaleLowerCase()}[name="${this.name}"]`
|
|
76
|
+
);
|
|
77
|
+
return e ? Array.from(e) : [];
|
|
44
78
|
}
|
|
45
|
-
#
|
|
46
|
-
|
|
79
|
+
get #a() {
|
|
80
|
+
const e = this.closest(
|
|
81
|
+
`${this.tagName.toLocaleLowerCase()}-group[name="${this.name}"]`
|
|
82
|
+
);
|
|
83
|
+
return e || null;
|
|
47
84
|
}
|
|
48
|
-
#
|
|
85
|
+
#o;
|
|
86
|
+
#r;
|
|
49
87
|
/**
|
|
50
88
|
* @internal
|
|
51
89
|
*/
|
|
52
|
-
|
|
53
|
-
e
|
|
90
|
+
validate(e) {
|
|
91
|
+
super.validate(e), this.proxy && (this.errorValidationMessage = this.validationMessage || "", this.validity.valueMissing ? this.#o() : this.#r());
|
|
54
92
|
}
|
|
55
93
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
], i.prototype, "
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
], i.prototype, "
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
], i.prototype, "
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
94
|
+
c([
|
|
95
|
+
v
|
|
96
|
+
], i.prototype, "connotation");
|
|
97
|
+
c([
|
|
98
|
+
v({ attribute: "readonly", mode: "boolean" })
|
|
99
|
+
], i.prototype, "readOnly");
|
|
100
|
+
c([
|
|
101
|
+
h
|
|
102
|
+
], i.prototype, "defaultSlottedNodes");
|
|
103
|
+
const w = ({ connotation: a, checked: e, readOnly: o, disabled: t }) => k(
|
|
104
|
+
"base",
|
|
105
|
+
[`connotation-${a}`, !!a],
|
|
106
|
+
["checked", !!e],
|
|
107
|
+
["readonly", !!o],
|
|
108
|
+
["disabled", !!t]
|
|
109
|
+
), $ = d`<template
|
|
110
|
+
aria-checked="${(a) => a?.checked}"
|
|
111
|
+
aria-disabled="${(a) => a?.disabled}"
|
|
112
|
+
aria-required="${(a) => a?.required}"
|
|
113
|
+
@keypress="${(a, e) => a?.keypressHandler(e.event)}"
|
|
114
|
+
@click="${(a, e) => a?.clickHandler(e.event)}"
|
|
115
|
+
role="radio"
|
|
116
|
+
>
|
|
117
|
+
<div class="${w}">
|
|
118
|
+
<div class="control"></div>
|
|
119
|
+
${x(
|
|
120
|
+
(a) => a?.label,
|
|
121
|
+
d`<label class="label">${(a) => a?.label}</label>`
|
|
122
|
+
)}
|
|
123
|
+
</div>
|
|
124
|
+
</template>`, V = m(
|
|
125
|
+
"radio",
|
|
83
126
|
i,
|
|
84
|
-
|
|
85
|
-
[
|
|
127
|
+
$,
|
|
128
|
+
[],
|
|
86
129
|
{
|
|
87
|
-
styles:
|
|
130
|
+
styles: g
|
|
88
131
|
}
|
|
89
|
-
),
|
|
132
|
+
), q = u(V);
|
|
90
133
|
export {
|
|
91
|
-
i as
|
|
92
|
-
|
|
93
|
-
|
|
134
|
+
i as R,
|
|
135
|
+
V as a,
|
|
136
|
+
q as r
|
|
94
137
|
};
|