@momentum-design/components 0.129.15 → 0.129.17

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.
@@ -109,14 +109,6 @@ declare class Badge extends Badge_base {
109
109
  * Otherwise, the role will be null.
110
110
  */
111
111
  private setRoleByAriaLabel;
112
- /**
113
- * Generates the badge content based on the badge type.
114
- * Utilizes various helper methods to create the appropriate badge template based on the
115
- * current badge type. Supports 'dot', 'icon', 'counter', 'success', 'warning', and 'error'
116
- * types, returning the corresponding template result for each type.
117
- * @returns the TemplateResult for the current badge type.
118
- */
119
- private getBadgeContentBasedOnType;
120
112
  update(changedProperties: PropertyValues): void;
121
113
  render(): TemplateResult;
122
114
  static styles: Array<CSSResult>;
@@ -78,7 +78,7 @@ class Badge extends IconNameMixin(Component) {
78
78
  * where the badge will be layered on top of a button.
79
79
  * @default false
80
80
  */
81
- this.overlay = false;
81
+ this.overlay = DEFAULTS.OVERLAY;
82
82
  /**
83
83
  * Aria-label attribute to be set for accessibility
84
84
  * @default null
@@ -156,14 +156,13 @@ class Badge extends IconNameMixin(Component) {
156
156
  this.role = null;
157
157
  }
158
158
  }
159
- /**
160
- * Generates the badge content based on the badge type.
161
- * Utilizes various helper methods to create the appropriate badge template based on the
162
- * current badge type. Supports 'dot', 'icon', 'counter', 'success', 'warning', and 'error'
163
- * types, returning the corresponding template result for each type.
164
- * @returns the TemplateResult for the current badge type.
165
- */
166
- getBadgeContentBasedOnType() {
159
+ update(changedProperties) {
160
+ super.update(changedProperties);
161
+ if (changedProperties.has('ariaLabel')) {
162
+ this.setRoleByAriaLabel();
163
+ }
164
+ }
165
+ render() {
167
166
  if (this.variant && !Object.values(ICON_VARIANT).includes(this.variant)) {
168
167
  this.variant = DEFAULTS.VARIANT;
169
168
  }
@@ -185,15 +184,6 @@ class Badge extends IconNameMixin(Component) {
185
184
  return this.getBadgeDot();
186
185
  }
187
186
  }
188
- update(changedProperties) {
189
- super.update(changedProperties);
190
- if (changedProperties.has('ariaLabel')) {
191
- this.setRoleByAriaLabel();
192
- }
193
- }
194
- render() {
195
- return this.getBadgeContentBasedOnType();
196
- }
197
187
  }
198
188
  Badge.styles = [...Component.styles, ...styles];
199
189
  __decorate([
@@ -214,7 +204,7 @@ __decorate([
214
204
  ], Badge.prototype, "maxCounter", void 0);
215
205
  __decorate([
216
206
  property({ type: Boolean }),
217
- __metadata("design:type", Object)
207
+ __metadata("design:type", Boolean)
218
208
  ], Badge.prototype, "overlay", void 0);
219
209
  __decorate([
220
210
  property({ type: String, attribute: 'aria-label' }),
@@ -23,5 +23,6 @@ declare const DEFAULTS: {
23
23
  readonly MAX_COUNTER_LIMIT: 999;
24
24
  readonly VARIANT: "primary";
25
25
  readonly ICON_SIZE: 1;
26
+ readonly OVERLAY: false;
26
27
  };
27
- export { TAG_NAME, DEFAULTS, TYPE, ICON_VARIANT, ICON_NAMES_LIST };
28
+ export { DEFAULTS, ICON_NAMES_LIST, ICON_VARIANT, TAG_NAME, TYPE };
@@ -23,5 +23,6 @@ const DEFAULTS = {
23
23
  MAX_COUNTER_LIMIT: 999,
24
24
  VARIANT: ICON_VARIANT.PRIMARY,
25
25
  ICON_SIZE: 1,
26
+ OVERLAY: false,
26
27
  };
27
- export { TAG_NAME, DEFAULTS, TYPE, ICON_VARIANT, ICON_NAMES_LIST };
28
+ export { DEFAULTS, ICON_NAMES_LIST, ICON_VARIANT, TAG_NAME, TYPE };
@@ -17,6 +17,8 @@ import type { BrandVisualNames } from './brandvisual.types';
17
17
  * @event load - (React: onLoad) This event is dispatched when the brandvisual has been successfully loaded.
18
18
  * @event error - (React: onError) This event is dispatched when the brandvisual fetching has failed.
19
19
  *
20
+ * @csspart brandvisual - Set styles for the brandvisual svg container
21
+ * @csspart brandvisualImage - Set styles for the brandvisual image container
20
22
  */
21
23
  declare class Brandvisual extends Component {
22
24
  private brandVisualData?;
@@ -27,6 +27,8 @@ import styles from './brandvisual.styles';
27
27
  * @event load - (React: onLoad) This event is dispatched when the brandvisual has been successfully loaded.
28
28
  * @event error - (React: onError) This event is dispatched when the brandvisual fetching has failed.
29
29
  *
30
+ * @csspart brandvisual - Set styles for the brandvisual svg container
31
+ * @csspart brandvisualImage - Set styles for the brandvisual image container
30
32
  */
31
33
  class Brandvisual extends Component {
32
34
  async getBrandVisualData() {
@@ -118,7 +120,7 @@ __decorate([
118
120
  __metadata("design:type", String)
119
121
  ], Brandvisual.prototype, "name", void 0);
120
122
  __decorate([
121
- property({ type: String, reflect: true }),
123
+ property({ type: String, reflect: true, attribute: 'alt-text' }),
122
124
  __metadata("design:type", String)
123
125
  ], Brandvisual.prototype, "altText", void 0);
124
126
  export default Brandvisual;
@@ -4496,17 +4496,6 @@
4496
4496
  "description": "Counter is the number which can be provided in the badge.",
4497
4497
  "attribute": "counter"
4498
4498
  },
4499
- {
4500
- "kind": "method",
4501
- "name": "getBadgeContentBasedOnType",
4502
- "privacy": "private",
4503
- "return": {
4504
- "type": {
4505
- "text": ""
4506
- }
4507
- },
4508
- "description": "Generates the badge content based on the badge type.\nUtilizes various helper methods to create the appropriate badge template based on the\ncurrent badge type. Supports 'dot', 'icon', 'counter', 'success', 'warning', and 'error'\ntypes, returning the corresponding template result for each type."
4509
- },
4510
4499
  {
4511
4500
  "kind": "method",
4512
4501
  "name": "getBadgeCounterText",
@@ -4607,8 +4596,8 @@
4607
4596
  "type": {
4608
4597
  "text": "boolean"
4609
4598
  },
4610
- "default": "false",
4611
4599
  "description": "Overlay is to add a thin outline to the badge.\nThis will help distinguish between the badge and the button,\nwhere the badge will be layered on top of a button.",
4600
+ "default": "false",
4612
4601
  "attribute": "overlay"
4613
4602
  },
4614
4603
  {
@@ -4684,8 +4673,8 @@
4684
4673
  "type": {
4685
4674
  "text": "boolean"
4686
4675
  },
4687
- "default": "false",
4688
4676
  "description": "Overlay is to add a thin outline to the badge.\nThis will help distinguish between the badge and the button,\nwhere the badge will be layered on top of a button.",
4677
+ "default": "false",
4689
4678
  "fieldName": "overlay"
4690
4679
  },
4691
4680
  {
@@ -4906,6 +4895,16 @@
4906
4895
  "kind": "class",
4907
4896
  "description": "The `mdc-brandvisual` component is responsible for rendering logos dynamically & ensures they are\ndisplayed correctly within applications.\n\nFeatures:\n- Dynamically loads brandvisuals based on the `name` attribute.\n- Emits a `load` event when the brandvisual is successfully fetched.\n- Emits an `error` event when the brandvisual import fails.\n- Supports accessibility best practices.\n- Used for brand representation within the design system.",
4908
4897
  "name": "Brandvisual",
4898
+ "cssParts": [
4899
+ {
4900
+ "description": "Set styles for the brandvisual svg container",
4901
+ "name": "brandvisual"
4902
+ },
4903
+ {
4904
+ "description": "Set styles for the brandvisual image container",
4905
+ "name": "brandvisualImage"
4906
+ }
4907
+ ],
4909
4908
  "members": [
4910
4909
  {
4911
4910
  "kind": "field",
@@ -4914,7 +4913,7 @@
4914
4913
  "text": "string | undefined"
4915
4914
  },
4916
4915
  "description": "Alt text for the brandvisual image for accessibility.\nThis will only be set if the brandvisual is an image (png).",
4917
- "attribute": "altText",
4916
+ "attribute": "alt-text",
4918
4917
  "reflects": true
4919
4918
  },
4920
4919
  {
@@ -5046,7 +5045,7 @@
5046
5045
  "fieldName": "name"
5047
5046
  },
5048
5047
  {
5049
- "name": "altText",
5048
+ "name": "alt-text",
5050
5049
  "type": {
5051
5050
  "text": "string | undefined"
5052
5051
  },
@@ -5059,7 +5058,7 @@
5059
5058
  "module": "/src/models"
5060
5059
  },
5061
5060
  "tagName": "mdc-brandvisual",
5062
- "jsDoc": "/**\n * The `mdc-brandvisual` component is responsible for rendering logos dynamically & ensures they are\n * displayed correctly within applications.\n *\n * Features:\n * - Dynamically loads brandvisuals based on the `name` attribute.\n * - Emits a `load` event when the brandvisual is successfully fetched.\n * - Emits an `error` event when the brandvisual import fails.\n * - Supports accessibility best practices.\n * - Used for brand representation within the design system.\n *\n * @tagname mdc-brandvisual\n *\n * @event load - (React: onLoad) This event is dispatched when the brandvisual has been successfully loaded.\n * @event error - (React: onError) This event is dispatched when the brandvisual fetching has failed.\n *\n */",
5061
+ "jsDoc": "/**\n * The `mdc-brandvisual` component is responsible for rendering logos dynamically & ensures they are\n * displayed correctly within applications.\n *\n * Features:\n * - Dynamically loads brandvisuals based on the `name` attribute.\n * - Emits a `load` event when the brandvisual is successfully fetched.\n * - Emits an `error` event when the brandvisual import fails.\n * - Supports accessibility best practices.\n * - Used for brand representation within the design system.\n *\n * @tagname mdc-brandvisual\n *\n * @event load - (React: onLoad) This event is dispatched when the brandvisual has been successfully loaded.\n * @event error - (React: onError) This event is dispatched when the brandvisual fetching has failed.\n *\n * @csspart brandvisual - Set styles for the brandvisual svg container\n * @csspart brandvisualImage - Set styles for the brandvisual image container\n */",
5063
5062
  "customElement": true
5064
5063
  }
5065
5064
  ],
@@ -17,6 +17,8 @@ import type { Events } from '../../components/brandvisual/brandvisual.types';
17
17
  * @event load - (React: onLoad) This event is dispatched when the brandvisual has been successfully loaded.
18
18
  * @event error - (React: onError) This event is dispatched when the brandvisual fetching has failed.
19
19
  *
20
+ * @csspart brandvisual - Set styles for the brandvisual svg container
21
+ * @csspart brandvisualImage - Set styles for the brandvisual image container
20
22
  */
21
23
  declare const reactWrapper: import("@lit/react").ReactWebComponent<Component, {
22
24
  onLoad: EventName<Events["onLoadEvent"]>;
@@ -18,6 +18,8 @@ import { TAG_NAME } from '../../components/brandvisual/brandvisual.constants';
18
18
  * @event load - (React: onLoad) This event is dispatched when the brandvisual has been successfully loaded.
19
19
  * @event error - (React: onError) This event is dispatched when the brandvisual fetching has failed.
20
20
  *
21
+ * @csspart brandvisual - Set styles for the brandvisual svg container
22
+ * @csspart brandvisualImage - Set styles for the brandvisual image container
21
23
  */
22
24
  const reactWrapper = createComponent({
23
25
  tagName: TAG_NAME,
@@ -11,6 +11,7 @@ declare const ROLE: {
11
11
  readonly LIST: "list";
12
12
  readonly LISTBOX: "listbox";
13
13
  readonly LISTITEM: "listitem";
14
+ readonly MAIN: "main";
14
15
  readonly MENU: "menu";
15
16
  readonly MENUBAR: "menubar";
16
17
  readonly MENUITEM: "menuitem";
@@ -11,6 +11,7 @@ const ROLE = {
11
11
  LIST: 'list',
12
12
  LISTBOX: 'listbox',
13
13
  LISTITEM: 'listitem',
14
+ MAIN: 'main',
14
15
  MENU: 'menu',
15
16
  MENUBAR: 'menubar',
16
17
  MENUITEM: 'menuitem',
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.15",
4
+ "version": "0.129.17",
5
5
  "engines": {
6
6
  "node": ">=20.0.0",
7
7
  "npm": ">=8.0.0"