@covalent/components 11.13.0 → 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.
@@ -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 n=require("./query-assigned-elements-8EurZY45.js"),l=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%}.icon-lockup cv-typography{flex:1 0 0}.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,y=Object.getOwnPropertyDescriptor,e=(s,o,c,i)=>{for(var t=i>1?void 0:i?y(o,c):o,a=s.length-1,r;a>=0;a--)(r=s[a])&&(t=(i?r(o,c,t):r(t))||t);return i&&t&&h(o,c,t),t};exports.CovalentIconLockup=class extends n.s{constructor(){super(...arguments),this.covalentIcon=!1,this.filledIcon=!1,this.icon="",this.scale="body1",this.state="neutral",this.trailingIcon=!1,this._hasIconSlot=!1}checkIconSlot(){var c;const o=(c=this.shadowRoot)==null?void 0:c.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 n.x`<slot name="icon"></slot>
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: var(--cv-typography-${this.scale}-line-height, 16px)`}"
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 n.x`
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=[n.i`
13
- ${n.r(v)}
14
- `];e([l.n({type:Boolean,reflect:!0})],exports.CovalentIconLockup.prototype,"covalentIcon",2);e([l.n({type:Boolean,reflect:!0})],exports.CovalentIconLockup.prototype,"filledIcon",2);e([l.n({type:String})],exports.CovalentIconLockup.prototype,"icon",2);e([l.n({type:String})],exports.CovalentIconLockup.prototype,"scale",2);e([l.n({type:String})],exports.CovalentIconLockup.prototype,"state",2);e([l.n({type:Boolean})],exports.CovalentIconLockup.prototype,"trailingIcon",2);e([u.t()],exports.CovalentIconLockup.prototype,"_hasIconSlot",2);exports.CovalentIconLockup=e([n.e("cv-icon-lockup")],exports.CovalentIconLockup);const d=exports.CovalentIconLockup;exports.default=d;
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 f, s as u, x as p, e as y } from "./query-assigned-elements-D930kELM.mjs";
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 d } from "./state-B_tK3mBm.mjs";
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%}.icon-lockup cv-typography{flex:1 0 0}.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, l, s) => {
9
- for (var c = s > 1 ? void 0 : s ? I(i, l) : i, r = t.length - 1, a; r >= 0; r--)
10
- (a = t[r]) && (c = (s ? a(i, l, c) : a(c)) || c);
11
- return s && c && m(i, l, c), c;
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 u {
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._hasIconSlot = !1;
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: var(--cv-typography-${this.scale}-line-height, 16px)`}"
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
- f`
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
- d()
102
+ y()
91
103
  ], o.prototype, "_hasIconSlot", 2);
92
104
  o = e([
93
- y("cv-icon-lockup")
105
+ d("cv-icon-lockup")
94
106
  ], o);
95
- const L = o;
107
+ const b = o;
96
108
  export {
97
109
  o as CovalentIconLockup,
98
- L as default
110
+ b as default
99
111
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@covalent/components",
3
- "version": "11.13.0",
3
+ "version": "11.13.1",
4
4
  "description": "a catalog of material components for covalent",
5
5
  "main": "./index.js",
6
6
  "module": "./index.mjs",