@momentum-design/components 0.129.16 → 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 };
@@ -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
  {
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.16",
4
+ "version": "0.129.17",
5
5
  "engines": {
6
6
  "node": ">=20.0.0",
7
7
  "npm": ">=8.0.0"