@viasat/beam-web-components 2.21.1 → 2.23.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/Label/Label.d.ts +68 -0
- package/{local/wip/Label → Label}/Label.js +77 -53
- package/custom-elements.json +5550 -5533
- package/{wip → local}/Label/Label.js +72 -50
- package/package.json +6 -6
- package/vscode.html-custom-data.json +383 -378
- package/wip/Label/Label.d.ts +0 -43
- /package/{wip/Label → Label}/index.d.ts +0 -0
- /package/{local/wip/Label → Label}/index.js +0 -0
- /package/{wip → local}/Label/index.js +0 -0
|
@@ -1,86 +1,108 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import { n as
|
|
5
|
-
import { t as
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var w = Object.defineProperty, E = Object.getOwnPropertyDescriptor, g = (e) => {
|
|
1
|
+
import { r as $, a as P, E as k, x as d } from "../chunks/lit-element.CJtt9wj5.js";
|
|
2
|
+
import { n as s, c as C } from "../chunks/register-custom-element.vod7zfGv.js";
|
|
3
|
+
import { n as S } from "../chunks/query-assigned-nodes.Dgvsf6BR.js";
|
|
4
|
+
import { n as g, c as v, g as O } from "../chunks/classNames.C6fNrXWF.js";
|
|
5
|
+
import { t as w } from "../chunks/constants.jOWREYQE.js";
|
|
6
|
+
const E = ':root,:host,.bm-light,.bm-dark .bm-inverse,.bm-dark.bm-inverse,[data-bm-theme~=bm-dark] .bm-inverse,[data-bm-theme~=bm-dark].bm-inverse,.bm-enterprise,.bm-consumer,[data-bm-theme~=bm-light]{--bm-comp-label-color-text: var(--bm-sem-color-text-secondary, #576775);--bm-comp-label-color-icon: var(--bm-sem-color-icon-secondary, #576775);--bm-comp-label-typo-default: var( --bm-sem-typo-label-sm, 600 .875rem/1.25rem "Source Sans Pro" );--bm-comp-label-typo-optional: var( --bm-sem-typo-body-sm, 400 .875rem/1.25rem "Source Sans Pro" );--bm-comp-label-typo-character-count: var( --bm-sem-typo-body-sm, 400 .875rem/1.25rem "Source Sans Pro" );--bm-comp-label-space-gap: var(--bm-sem-space-25, .25rem);--bm-comp-label-space-bottom: var(--bm-sem-space-50, .5rem);--bm-comp-label-size-icon: var(--bm-sem-size-icon-sm, 1rem)}:host,.bm-dark,.bm-light .bm-inverse,.bm-light.bm-inverse,[data-bm-theme~=bm-light] .bm-inverse,[data-bm-theme~=bm-light].bm-inverse,.bm-enterprise,.bm-consumer,[data-bm-theme~=bm-dark]{--bm-comp-label-color-text: var(--bm-sem-color-text-secondary, #c3cdd5);--bm-comp-label-color-icon: var(--bm-sem-color-icon-secondary, #c3cdd5);--bm-comp-label-typo-default: var( --bm-sem-typo-label-sm, 600 .875rem/1.25rem "Source Sans Pro" );--bm-comp-label-typo-optional: var( --bm-sem-typo-body-sm, 400 .875rem/1.25rem "Source Sans Pro" );--bm-comp-label-typo-character-count: var( --bm-sem-typo-body-sm, 400 .875rem/1.25rem "Source Sans Pro" );--bm-comp-label-space-gap: var(--bm-sem-space-25, .25rem);--bm-comp-label-space-bottom: var(--bm-sem-space-50, .5rem);--bm-comp-label-size-icon: var(--bm-sem-size-icon-sm, 1rem)}.bm-label{color:var(--bm-comp-label-color-text);font:var(--bm-comp-label-typo-default);margin-bottom:var(--bm-comp-label-space-bottom, var(--bm-sem-space-0))}.bm-label label{cursor:var(--bm-comp-label-cursor, default);pointer-events:var(--bm-comp-label-pointer-events, inherit)}.bm-label--disabled label{opacity:var(--bm-sem-opacity-disabled)}.bm-label--required label:after{content:"*";color:var(--bm-sem-color-text-negative)}.bm-label--required label:has(:last-child):after{content:""}.bm-label--required label:has(:last-child)>*:last-child:after{content:"*";color:var(--bm-sem-color-text-negative)}.bm-label__optional{font:var(--bm-comp-label-typo-optional);margin-left:var(--bm-comp-label-space-gap)}.bm-label__tooltip{vertical-align:top;display:inline-block;margin-inline-start:var(--bm-comp-label-space-gap)}.bm-label__tooltip button{color:var(--bm-comp-tooltip-color-icon-trigger)}.bm-label__tooltip svg{height:var(--bm-comp-label-size-icon);width:var(--bm-comp-label-size-icon)}.bm-label--no-box{display:contents}';
|
|
7
|
+
var q = Object.defineProperty, N = Object.getOwnPropertyDescriptor, x = (e) => {
|
|
9
8
|
throw TypeError(e);
|
|
10
|
-
},
|
|
11
|
-
for (var
|
|
12
|
-
(
|
|
13
|
-
return
|
|
14
|
-
},
|
|
15
|
-
const { baseClassNamePrefix:
|
|
16
|
-
let o = class extends
|
|
9
|
+
}, l = (e, t, a, i) => {
|
|
10
|
+
for (var r = i > 1 ? void 0 : i ? N(t, a) : t, c = e.length - 1, h; c >= 0; c--)
|
|
11
|
+
(h = e[c]) && (r = (i ? h(t, a, r) : h(r)) || r);
|
|
12
|
+
return i && r && q(t, a, r), r;
|
|
13
|
+
}, z = (e, t, a) => t.has(e) || x("Cannot " + a), m = (e, t, a) => (z(e, t, "read from private field"), a ? a.call(e) : t.get(e)), b = (e, t, a) => t.has(e) ? x("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, a), n, y, u, f;
|
|
14
|
+
const { baseClassNamePrefix: B, subElementClassPrefix: _, classModifierPrefix: p } = O("label");
|
|
15
|
+
let o = class extends P {
|
|
17
16
|
constructor() {
|
|
18
|
-
super(...arguments), this.disabled = !1, this.required = !1,
|
|
17
|
+
super(...arguments), this.disabled = !1, this.required = !1, b(this, n, () => this.requestUpdate()), b(this, y, () => {
|
|
18
|
+
if (this.for) {
|
|
19
|
+
const e = document.getElementById(this.for);
|
|
20
|
+
e == null || e.click();
|
|
21
|
+
}
|
|
19
22
|
this.dispatchEvent(
|
|
20
23
|
new CustomEvent("bm-label-click", {
|
|
21
24
|
bubbles: !0,
|
|
22
25
|
composed: !0
|
|
23
26
|
})
|
|
24
27
|
);
|
|
25
|
-
}),
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
`${
|
|
29
|
-
!
|
|
28
|
+
}), b(this, u, () => d`
|
|
29
|
+
<span
|
|
30
|
+
class="${v(
|
|
31
|
+
`${_}optional`,
|
|
32
|
+
!this.hasOptional && `${p}no-box`
|
|
30
33
|
)}"
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
>
|
|
35
|
+
<slot name="optional" @slotchange=${m(this, n)}> ${this.optional} </slot>
|
|
36
|
+
</span>
|
|
37
|
+
`), b(this, f, () => d`
|
|
38
|
+
<span
|
|
39
|
+
class="${v(
|
|
40
|
+
`${_}tooltip`,
|
|
41
|
+
!this.hasTooltipSlot && `${p}no-box`
|
|
42
|
+
)}"
|
|
43
|
+
>
|
|
44
|
+
<slot name="tooltip" @slotchange=${m(this, n)}></slot>
|
|
45
|
+
</span>
|
|
46
|
+
`);
|
|
37
47
|
}
|
|
38
48
|
get hasOptionalSlot() {
|
|
39
|
-
return
|
|
49
|
+
return g(this.optionalNodes);
|
|
50
|
+
}
|
|
51
|
+
get hasTooltipSlot() {
|
|
52
|
+
return g(this.tooltipNodes);
|
|
53
|
+
}
|
|
54
|
+
get hasOptional() {
|
|
55
|
+
return !!(this.hasOptionalSlot || this.optional);
|
|
40
56
|
}
|
|
41
57
|
render() {
|
|
42
|
-
const e =
|
|
43
|
-
|
|
44
|
-
this.theme &&
|
|
45
|
-
this.disabled && `${
|
|
46
|
-
this.required && !
|
|
58
|
+
const e = v(
|
|
59
|
+
B,
|
|
60
|
+
this.theme && w(this.theme),
|
|
61
|
+
this.disabled && `${p}disabled`,
|
|
62
|
+
this.required && !this.hasOptional && `${p}required`
|
|
47
63
|
);
|
|
48
|
-
return
|
|
64
|
+
return d`
|
|
49
65
|
<div class="${e}">
|
|
50
|
-
<label @click="${
|
|
66
|
+
<label for=${this.for || k} @click="${m(this, y)}">
|
|
51
67
|
<slot name="text">${this.text}</slot>
|
|
52
|
-
${
|
|
68
|
+
${m(this, u).call(this)}
|
|
53
69
|
</label>
|
|
54
|
-
|
|
70
|
+
${m(this, f).call(this)}
|
|
55
71
|
</div>
|
|
56
72
|
`;
|
|
57
73
|
}
|
|
58
74
|
};
|
|
59
|
-
|
|
60
|
-
h = /* @__PURE__ */ new WeakMap();
|
|
61
|
-
v = /* @__PURE__ */ new WeakMap();
|
|
75
|
+
n = /* @__PURE__ */ new WeakMap();
|
|
62
76
|
y = /* @__PURE__ */ new WeakMap();
|
|
63
|
-
|
|
64
|
-
|
|
77
|
+
u = /* @__PURE__ */ new WeakMap();
|
|
78
|
+
f = /* @__PURE__ */ new WeakMap();
|
|
79
|
+
o.styles = $(E);
|
|
80
|
+
l([
|
|
65
81
|
s({ type: Boolean })
|
|
66
82
|
], o.prototype, "disabled", 2);
|
|
67
|
-
|
|
83
|
+
l([
|
|
68
84
|
s({ type: Boolean })
|
|
69
85
|
], o.prototype, "required", 2);
|
|
70
|
-
|
|
86
|
+
l([
|
|
71
87
|
s({ type: String })
|
|
72
88
|
], o.prototype, "text", 2);
|
|
73
|
-
|
|
89
|
+
l([
|
|
74
90
|
s({ type: String })
|
|
75
91
|
], o.prototype, "optional", 2);
|
|
76
|
-
|
|
92
|
+
l([
|
|
93
|
+
s({ type: String })
|
|
94
|
+
], o.prototype, "for", 2);
|
|
95
|
+
l([
|
|
77
96
|
s({ type: String })
|
|
78
97
|
], o.prototype, "theme", 2);
|
|
79
|
-
|
|
80
|
-
|
|
98
|
+
l([
|
|
99
|
+
S({ slot: "optional", flatten: !0 })
|
|
81
100
|
], o.prototype, "optionalNodes", 2);
|
|
82
|
-
|
|
83
|
-
|
|
101
|
+
l([
|
|
102
|
+
S({ slot: "tooltip", flatten: !0 })
|
|
103
|
+
], o.prototype, "tooltipNodes", 2);
|
|
104
|
+
o = l([
|
|
105
|
+
C("bm-label")
|
|
84
106
|
], o);
|
|
85
107
|
export {
|
|
86
108
|
o as BmLabel
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@viasat/beam-web-components",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.23.0",
|
|
4
4
|
"description": "Framework-agnostic web components for the Beam Design System built with Lit, compatible with Angular, Vue, Svelte, and vanilla JavaScript",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Viasat",
|
|
@@ -64,11 +64,11 @@
|
|
|
64
64
|
"access": "public"
|
|
65
65
|
},
|
|
66
66
|
"dependencies": {
|
|
67
|
-
"@viasat/beam-fonts": "2.
|
|
68
|
-
"@viasat/beam-shared": "2.
|
|
69
|
-
"@viasat/beam-styles": "2.
|
|
70
|
-
"@viasat/beam-tokens": "2.
|
|
71
|
-
"@viasat/beam-icons": "2.
|
|
67
|
+
"@viasat/beam-fonts": "2.23.0",
|
|
68
|
+
"@viasat/beam-shared": "2.23.0",
|
|
69
|
+
"@viasat/beam-styles": "2.23.0",
|
|
70
|
+
"@viasat/beam-tokens": "2.23.0",
|
|
71
|
+
"@viasat/beam-icons": "2.23.0",
|
|
72
72
|
"clsx": "^1.2.1",
|
|
73
73
|
"lit": "^3.1.0",
|
|
74
74
|
"@lit/context": "^1.1.1",
|