@covalent/components 11.12.1 → 11.13.1
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/icon-lockup/icon-lockup.d.ts +6 -0
- package/icon-lockup.js +6 -6
- package/icon-lockup.mjs +27 -15
- package/index.scss +0 -0
- package/package.json +1 -1
|
@@ -35,6 +35,12 @@ export declare class CovalentIconLockup extends LitElement {
|
|
|
35
35
|
* If false, the icon is displayed before the text.
|
|
36
36
|
*/
|
|
37
37
|
trailingIcon: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Icon size per scale. Scales not listed fall back to the
|
|
40
|
+
* corresponding typography line-height CSS variable.
|
|
41
|
+
*/
|
|
42
|
+
private readonly ICON_SIZE_MAP;
|
|
43
|
+
private get iconSize();
|
|
38
44
|
/**
|
|
39
45
|
* Tracks if the icon slot has content.
|
|
40
46
|
*/
|
package/icon-lockup.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("./query-assigned-elements-8EurZY45.js"),i=require("./property-DYTC_2-m.js"),u=require("./state-C3HoXfoa.js"),p=require("./class-map-DTzB8z-1.js");require("./typography.js");require("./icon.js");const v='.filled{font-variation-settings:"FILL" 1}.hidden{display:none}.icon-lockup{align-items:center;display:flex;gap:4px;max-width:100%;color:var(--cv-theme-on-surface)}.icon-lockup cv-typography{flex:1 0 0}.icon-lockup cv-icon.covalent-icon{--mdc-icon-font: "covalent-icons"}.icon-lockup--primary,.icon-lockup--loading{color:var(--cv-theme-primary)}.icon-lockup--positive{color:var(--cv-theme-positive)}.icon-lockup--negative{color:var(--cv-theme-negative)}.icon-lockup--caution{color:var(--cv-theme-caution)}.text{font-feature-settings:"liga" off,"clig" off;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.trailing-icon{flex-direction:row-reverse}';var h=Object.defineProperty,d=Object.getOwnPropertyDescriptor,e=(s,o,n,l)=>{for(var t=l>1?void 0:l?d(o,n):o,a=s.length-1,r;a>=0;a--)(r=s[a])&&(t=(l?r(o,n,t):r(t))||t);return l&&t&&h(o,n,t),t};exports.CovalentIconLockup=class extends c.s{constructor(){super(...arguments),this.covalentIcon=!1,this.filledIcon=!1,this.icon="",this.scale="body1",this.state="neutral",this.trailingIcon=!1,this.ICON_SIZE_MAP={headline1:"96px",headline2:"80px",headline3:"64px",headline4:"48px",headline5:"32px",subtitle1:"24px",subtitle2:"20px",button:"20px"},this._hasIconSlot=!1}get iconSize(){return this.ICON_SIZE_MAP[this.scale]??`var(--cv-typography-${this.scale}-line-height, 16px)`}checkIconSlot(){var n;const o=(n=this.shadowRoot)==null?void 0:n.querySelector('slot[name="icon"]');this._hasIconSlot=o&&o.assignedNodes().length>0}iconTemplate(){const o={"covalent-icon":this.covalentIcon,filled:this.filledIcon,hidden:this._hasIconSlot};return c.x`<slot name="icon"></slot>
|
|
2
2
|
<cv-icon
|
|
3
3
|
class=${p.o(o)}
|
|
4
|
-
style="${`font-size:
|
|
4
|
+
style="${`font-size: ${this.iconSize}`}"
|
|
5
5
|
>
|
|
6
6
|
${this.icon}
|
|
7
|
-
</cv-icon>`}render(){const o={"icon-lockup":!0,[`icon-lockup--${this.state}`]:this.state,"trailing-icon":this.trailingIcon};return
|
|
7
|
+
</cv-icon>`}render(){const o={"icon-lockup":!0,[`icon-lockup--${this.state}`]:this.state,"trailing-icon":this.trailingIcon};return c.x`
|
|
8
8
|
<cv-typography class=${p.o(o)} scale="${this.scale}">
|
|
9
9
|
${this.iconTemplate()}
|
|
10
10
|
<div class="text"><slot></slot></div>
|
|
11
11
|
</cv-typography>
|
|
12
|
-
`}updated(o){super.updated(o),this.checkIconSlot()}};exports.CovalentIconLockup.styles=[
|
|
13
|
-
${
|
|
14
|
-
`];e([
|
|
12
|
+
`}updated(o){super.updated(o),this.checkIconSlot()}};exports.CovalentIconLockup.styles=[c.i`
|
|
13
|
+
${c.r(v)}
|
|
14
|
+
`];e([i.n({type:Boolean,reflect:!0})],exports.CovalentIconLockup.prototype,"covalentIcon",2);e([i.n({type:Boolean,reflect:!0})],exports.CovalentIconLockup.prototype,"filledIcon",2);e([i.n({type:String})],exports.CovalentIconLockup.prototype,"icon",2);e([i.n({type:String})],exports.CovalentIconLockup.prototype,"scale",2);e([i.n({type:String})],exports.CovalentIconLockup.prototype,"state",2);e([i.n({type:Boolean})],exports.CovalentIconLockup.prototype,"trailingIcon",2);e([u.t()],exports.CovalentIconLockup.prototype,"_hasIconSlot",2);exports.CovalentIconLockup=e([c.e("cv-icon-lockup")],exports.CovalentIconLockup);const I=exports.CovalentIconLockup;exports.default=I;
|
package/icon-lockup.mjs
CHANGED
|
@@ -1,18 +1,30 @@
|
|
|
1
|
-
import { r as v, i as
|
|
1
|
+
import { r as v, i as u, s as f, x as p, e as d } from "./query-assigned-elements-D930kELM.mjs";
|
|
2
2
|
import { n } from "./property-DJzm_oB9.mjs";
|
|
3
|
-
import { t as
|
|
3
|
+
import { t as y } from "./state-B_tK3mBm.mjs";
|
|
4
4
|
import { o as h } from "./class-map-DPUylGZM.mjs";
|
|
5
5
|
import "./typography.mjs";
|
|
6
6
|
import "./icon.mjs";
|
|
7
|
-
const g = '.filled{font-variation-settings:"FILL" 1}.hidden{display:none}.icon-lockup{align-items:center;display:flex;gap:4px;max-width:100
|
|
8
|
-
var m = Object.defineProperty, I = Object.getOwnPropertyDescriptor, e = (t, i,
|
|
9
|
-
for (var c =
|
|
10
|
-
(
|
|
11
|
-
return
|
|
7
|
+
const g = '.filled{font-variation-settings:"FILL" 1}.hidden{display:none}.icon-lockup{align-items:center;display:flex;gap:4px;max-width:100%;color:var(--cv-theme-on-surface)}.icon-lockup cv-typography{flex:1 0 0}.icon-lockup cv-icon.covalent-icon{--mdc-icon-font: "covalent-icons"}.icon-lockup--primary,.icon-lockup--loading{color:var(--cv-theme-primary)}.icon-lockup--positive{color:var(--cv-theme-positive)}.icon-lockup--negative{color:var(--cv-theme-negative)}.icon-lockup--caution{color:var(--cv-theme-caution)}.text{font-feature-settings:"liga" off,"clig" off;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.trailing-icon{flex-direction:row-reverse}';
|
|
8
|
+
var m = Object.defineProperty, I = Object.getOwnPropertyDescriptor, e = (t, i, s, l) => {
|
|
9
|
+
for (var c = l > 1 ? void 0 : l ? I(i, s) : i, a = t.length - 1, r; a >= 0; a--)
|
|
10
|
+
(r = t[a]) && (c = (l ? r(i, s, c) : r(c)) || c);
|
|
11
|
+
return l && c && m(i, s, c), c;
|
|
12
12
|
};
|
|
13
|
-
let o = class extends
|
|
13
|
+
let o = class extends f {
|
|
14
14
|
constructor() {
|
|
15
|
-
super(...arguments), this.covalentIcon = !1, this.filledIcon = !1, this.icon = "", this.scale = "body1", this.state = "neutral", this.trailingIcon = !1, this.
|
|
15
|
+
super(...arguments), this.covalentIcon = !1, this.filledIcon = !1, this.icon = "", this.scale = "body1", this.state = "neutral", this.trailingIcon = !1, this.ICON_SIZE_MAP = {
|
|
16
|
+
headline1: "96px",
|
|
17
|
+
headline2: "80px",
|
|
18
|
+
headline3: "64px",
|
|
19
|
+
headline4: "48px",
|
|
20
|
+
headline5: "32px",
|
|
21
|
+
subtitle1: "24px",
|
|
22
|
+
subtitle2: "20px",
|
|
23
|
+
button: "20px"
|
|
24
|
+
}, this._hasIconSlot = !1;
|
|
25
|
+
}
|
|
26
|
+
get iconSize() {
|
|
27
|
+
return this.ICON_SIZE_MAP[this.scale] ?? `var(--cv-typography-${this.scale}-line-height, 16px)`;
|
|
16
28
|
}
|
|
17
29
|
/**
|
|
18
30
|
* Checks if there is content in the icon slot and updates `hasIconSlot`.
|
|
@@ -37,7 +49,7 @@ let o = class extends u {
|
|
|
37
49
|
return p`<slot name="icon"></slot>
|
|
38
50
|
<cv-icon
|
|
39
51
|
class=${h(t)}
|
|
40
|
-
style="${`font-size:
|
|
52
|
+
style="${`font-size: ${this.iconSize}`}"
|
|
41
53
|
>
|
|
42
54
|
${this.icon}
|
|
43
55
|
</cv-icon>`;
|
|
@@ -64,7 +76,7 @@ let o = class extends u {
|
|
|
64
76
|
}
|
|
65
77
|
};
|
|
66
78
|
o.styles = [
|
|
67
|
-
|
|
79
|
+
u`
|
|
68
80
|
${v(g)}
|
|
69
81
|
`
|
|
70
82
|
];
|
|
@@ -87,13 +99,13 @@ e([
|
|
|
87
99
|
n({ type: Boolean })
|
|
88
100
|
], o.prototype, "trailingIcon", 2);
|
|
89
101
|
e([
|
|
90
|
-
|
|
102
|
+
y()
|
|
91
103
|
], o.prototype, "_hasIconSlot", 2);
|
|
92
104
|
o = e([
|
|
93
|
-
|
|
105
|
+
d("cv-icon-lockup")
|
|
94
106
|
], o);
|
|
95
|
-
const
|
|
107
|
+
const b = o;
|
|
96
108
|
export {
|
|
97
109
|
o as CovalentIconLockup,
|
|
98
|
-
|
|
110
|
+
b as default
|
|
99
111
|
};
|
package/index.scss
CHANGED
|
File without changes
|