@momentum-design/components 0.129.11 → 0.129.12

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.
@@ -1,4 +1,4 @@
1
- import type { CSSResult } from 'lit';
1
+ import type { CSSResult, TemplateResult } from 'lit';
2
2
  import { Component } from '../../models';
3
3
  import type { BannerVariant } from './banner.types';
4
4
  /**
@@ -51,7 +51,7 @@ declare class Banner extends Component {
51
51
  /**
52
52
  * Banner label text
53
53
  */
54
- label: string;
54
+ label?: string;
55
55
  /**
56
56
  * Banner secondary label text
57
57
  *
@@ -74,7 +74,7 @@ declare class Banner extends Component {
74
74
  * @returns Template result containing label and optional secondary label elements
75
75
  */
76
76
  private getTextLabel;
77
- render(): import("lit-html").TemplateResult<1>;
77
+ render(): TemplateResult<1>;
78
78
  static styles: Array<CSSResult>;
79
79
  }
80
80
  export default Banner;
@@ -63,10 +63,6 @@ class Banner extends Component {
63
63
  * @default 'custom'
64
64
  */
65
65
  this.variant = DEFAULTS.VARIANT;
66
- /**
67
- * Banner label text
68
- */
69
- this.label = '';
70
66
  }
71
67
  /**
72
68
  * @internal
@@ -79,12 +75,7 @@ class Banner extends Component {
79
75
  if (!iconName)
80
76
  return nothing;
81
77
  return html `
82
- <mdc-icon
83
- name="${iconName}"
84
- size="${DEFAULTS.PREFIX_ICON_SIZE}"
85
- part="leading-icon"
86
- length-unit="rem"
87
- ></mdc-icon>
78
+ <mdc-icon name="${iconName}" size="${DEFAULTS.PREFIX_ICON_SIZE}" part="leading-icon" length-unit="rem"></mdc-icon>
88
79
  `;
89
80
  }
90
81
  /**
@@ -115,12 +106,11 @@ class Banner extends Component {
115
106
  `;
116
107
  }
117
108
  render() {
118
- var _a;
119
109
  return html `
120
110
  <slot name="content">
121
111
  <div part="leading">
122
112
  <slot name="leading-icon">
123
- ${this.variant !== DEFAULTS.VARIANT ? this.renderIcon((_a = getIconNameForVariant(this.variant)) !== null && _a !== void 0 ? _a : '') : nothing}
113
+ ${this.variant !== DEFAULTS.VARIANT ? this.renderIcon(getIconNameForVariant(this.variant)) : nothing}
124
114
  </slot>
125
115
  <slot name="leading-text">
126
116
  <div part="leading-text">${this.getTextLabel()}</div>
@@ -1,3 +1,4 @@
1
+ import type { IconNames } from '../icon/icon.types';
1
2
  declare const TAG_NAME: "mdc-banner";
2
3
  /**
3
4
  * Banner variants
@@ -13,10 +14,10 @@ declare const BANNER_VARIANT: {
13
14
  * Icon names for variants
14
15
  */
15
16
  declare const VARIANT_ICON_NAMES: {
16
- readonly INFORMATIONAL_ICON_NAME: "info-circle-bold";
17
- readonly SUCCESS_ICON_NAME: "check-circle-bold";
18
- readonly WARNING_ICON_NAME: "warning-bold";
19
- readonly ERROR_ICON_NAME: "error-legacy-bold";
17
+ readonly INFORMATIONAL_ICON_NAME: Extract<IconNames, "info-circle-bold">;
18
+ readonly SUCCESS_ICON_NAME: Extract<IconNames, "check-circle-bold">;
19
+ readonly WARNING_ICON_NAME: Extract<IconNames, "warning-bold">;
20
+ readonly ERROR_ICON_NAME: Extract<IconNames, "error-legacy-bold">;
20
21
  };
21
22
  /**
22
23
  * Default values
@@ -25,4 +26,4 @@ declare const DEFAULTS: {
25
26
  readonly VARIANT: "custom";
26
27
  readonly PREFIX_ICON_SIZE: 1.25;
27
28
  };
28
- export { TAG_NAME, BANNER_VARIANT, DEFAULTS, VARIANT_ICON_NAMES };
29
+ export { BANNER_VARIANT, DEFAULTS, TAG_NAME, VARIANT_ICON_NAMES };
@@ -26,4 +26,4 @@ const DEFAULTS = {
26
26
  VARIANT: BANNER_VARIANT.CUSTOM,
27
27
  PREFIX_ICON_SIZE: 1.25,
28
28
  };
29
- export { TAG_NAME, BANNER_VARIANT, DEFAULTS, VARIANT_ICON_NAMES };
29
+ export { BANNER_VARIANT, DEFAULTS, TAG_NAME, VARIANT_ICON_NAMES };
@@ -1,3 +1,4 @@
1
+ import type { IconNames } from '../icon/icon.types';
1
2
  import type { BannerVariant } from './banner.types';
2
- declare const getIconNameForVariant: (variant: BannerVariant) => string | null;
3
+ declare const getIconNameForVariant: (variant: BannerVariant) => IconNames | null;
3
4
  export { getIconNameForVariant };
@@ -4797,9 +4797,8 @@
4797
4797
  "kind": "field",
4798
4798
  "name": "label",
4799
4799
  "type": {
4800
- "text": "string"
4800
+ "text": "string | undefined"
4801
4801
  },
4802
- "default": "''",
4803
4802
  "description": "Banner label text",
4804
4803
  "attribute": "label",
4805
4804
  "reflects": true
@@ -4839,9 +4838,8 @@
4839
4838
  {
4840
4839
  "name": "label",
4841
4840
  "type": {
4842
- "text": "string"
4841
+ "text": "string | undefined"
4843
4842
  },
4844
- "default": "''",
4845
4843
  "description": "Banner label text",
4846
4844
  "fieldName": "label"
4847
4845
  },
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@momentum-design/components",
3
3
  "packageManager": "yarn@3.2.4",
4
- "version": "0.129.11",
4
+ "version": "0.129.12",
5
5
  "engines": {
6
6
  "node": ">=20.0.0",
7
7
  "npm": ">=8.0.0"