@momentum-design/components 0.122.19 → 0.122.21

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,8 @@ declare const Badge_base: import("../../utils/mixins/index.types").Constructor<i
35
35
  * @cssproperty --mdc-badge-error-foreground-color - The foreground color of the error badge.
36
36
  * @cssproperty --mdc-badge-error-background-color - The background color of the error badge.
37
37
  * @cssproperty --mdc-badge-overlay-background-color - The background color of the badge overlay.
38
+ * @cssproperty --mdc-badge-dot-width - The width of the dot badge. Default is 0.75rem (12px).
39
+ * @cssproperty --mdc-badge-dot-height - The height of the dot badge. Default is 0.75rem (12px).
38
40
  *
39
41
  * @csspart badge-dot - The dot notification badge.
40
42
  * @csspart badge-icon - The icon badge.
@@ -49,6 +49,8 @@ import styles from './badge.styles';
49
49
  * @cssproperty --mdc-badge-error-foreground-color - The foreground color of the error badge.
50
50
  * @cssproperty --mdc-badge-error-background-color - The background color of the error badge.
51
51
  * @cssproperty --mdc-badge-overlay-background-color - The background color of the badge overlay.
52
+ * @cssproperty --mdc-badge-dot-width - The width of the dot badge. Default is 0.75rem (12px).
53
+ * @cssproperty --mdc-badge-dot-height - The height of the dot badge. Default is 0.75rem (12px).
52
54
  *
53
55
  * @csspart badge-dot - The dot notification badge.
54
56
  * @csspart badge-icon - The icon badge.
@@ -21,6 +21,9 @@ const styles = [
21
21
 
22
22
  --mdc-badge-overlay-background-color: var(--mds-color-theme-background-solid-primary-normal);
23
23
 
24
+ --mdc-badge-dot-width: 0.75rem;
25
+ --mdc-badge-dot-height: 0.75rem;
26
+
24
27
  color: var(--mdc-badge-primary-foreground-color);
25
28
  }
26
29
  :host::part(badge-overlay) {
@@ -35,8 +38,8 @@ const styles = [
35
38
  background-color: var(--mdc-badge-primary-background-color);
36
39
  }
37
40
  :host::part(badge-dot) {
38
- width: 0.75rem;
39
- height: 0.75rem;
41
+ width: var(--mdc-badge-dot-width);
42
+ height: var(--mdc-badge-dot-height);
40
43
  border-radius: 50%;
41
44
  background-color: var(--mdc-badge-primary-background-color);
42
45
  }
@@ -147,6 +147,17 @@ const styles = [
147
147
  left: -0.75rem;
148
148
  top: 0.875rem;
149
149
  }
150
+
151
+ :host mdc-badge {
152
+ --mdc-badge-dot-width: 1rem;
153
+ --mdc-badge-dot-height: 1rem;
154
+ }
155
+
156
+ @media (forced-colors: active) {
157
+ :host(:not([in-menupopover]))::before {
158
+ background-color: ButtonText;
159
+ }
160
+ }
150
161
  `,
151
162
  ...hostFocusRingStyles(),
152
163
  ];
@@ -30,12 +30,7 @@ declare class Tooltip extends Popover {
30
30
  * @default 'description'
31
31
  */
32
32
  tooltipType: TooltipType;
33
- private defaultSlotNodes;
34
33
  connectedCallback(): void;
35
- /**
36
- * @returns The tooltip text.
37
- */
38
- private getTooltipText;
39
34
  /**
40
35
  * Sets the type attribute for the tooltip component.
41
36
  * If the provided type is not included in the TOOLTIP_TYPES,
@@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
7
  var __metadata = (this && this.__metadata) || function (k, v) {
8
8
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
9
  };
10
- import { property, queryAssignedNodes } from 'lit/decorators.js';
10
+ import { property } from 'lit/decorators.js';
11
11
  import { v4 as uuidv4 } from 'uuid';
12
12
  import { ROLE } from '../../utils/roles';
13
13
  import Popover from '../popover/popover.component';
@@ -66,13 +66,6 @@ class Tooltip extends Popover {
66
66
  this.size = false;
67
67
  this.disableAriaExpanded = true;
68
68
  }
69
- /**
70
- * @returns The tooltip text.
71
- */
72
- getTooltipText() {
73
- var _a, _b;
74
- return (((_b = (_a = this.defaultSlotNodes) === null || _a === void 0 ? void 0 : _a.map(node => node.textContent).join(' ')) === null || _b === void 0 ? void 0 : _b.trim()) || '');
75
- }
76
69
  /**
77
70
  * Sets the type attribute for the tooltip component.
78
71
  * If the provided type is not included in the TOOLTIP_TYPES,
@@ -125,7 +118,6 @@ class Tooltip extends Popover {
125
118
  this.setTooltipType(DEFAULTS.TOOLTIP_TYPE);
126
119
  }
127
120
  if (this.triggerElement) {
128
- const tooltipText = this.getTooltipText();
129
121
  switch (this.tooltipType) {
130
122
  case TOOLTIP_TYPES.DESCRIPTION:
131
123
  if (previousTooltipType === TOOLTIP_TYPES.LABEL) {
@@ -148,9 +140,6 @@ class Tooltip extends Popover {
148
140
  }
149
141
  break;
150
142
  }
151
- if (tooltipText.length > 0 && this.tooltipType !== TOOLTIP_TYPES.NONE && !this.ariaLabel) {
152
- this.ariaLabel = tooltipText;
153
- }
154
143
  }
155
144
  }
156
145
  async update(changedProperties) {
@@ -171,8 +160,4 @@ __decorate([
171
160
  property({ type: String, attribute: 'tooltip-type', reflect: true }),
172
161
  __metadata("design:type", String)
173
162
  ], Tooltip.prototype, "tooltipType", void 0);
174
- __decorate([
175
- queryAssignedNodes(),
176
- __metadata("design:type", Array)
177
- ], Tooltip.prototype, "defaultSlotNodes", void 0);
178
163
  export default Tooltip;
@@ -4389,6 +4389,14 @@
4389
4389
  {
4390
4390
  "description": "The background color of the badge overlay.",
4391
4391
  "name": "--mdc-badge-overlay-background-color"
4392
+ },
4393
+ {
4394
+ "description": "The width of the dot badge. Default is 0.75rem (12px).",
4395
+ "name": "--mdc-badge-dot-width"
4396
+ },
4397
+ {
4398
+ "description": "The height of the dot badge. Default is 0.75rem (12px).",
4399
+ "name": "--mdc-badge-dot-height"
4392
4400
  }
4393
4401
  ],
4394
4402
  "cssParts": [
@@ -4654,7 +4662,7 @@
4654
4662
  "module": "/src/models"
4655
4663
  },
4656
4664
  "tagName": "mdc-badge",
4657
- "jsDoc": "/**\n * The `mdc-badge` component is a versatile UI element used to\n * display dot, icons, counters, success, warning and error type badge.\n *\n * Supported badge types:\n * - `dot`: Displays a dot notification badge with a blue color.\n * - `icon`: Displays a badge with a specified icon using the `icon-name` attribute.\n * - `counter`: Displays a badge with a counter value. If the counter exceeds the `max-counter`,\n * it shows `maxCounter+`. The maximum value of the counter is 999 and anything above that will be set to `999+`.\n * - `success`: Displays a success badge with a check circle icon and green color.\n * - `warning`: Displays a warning badge with a warning icon and yellow color.\n * - `error`: Displays a error badge with a error legacy icon and red color.\n *\n * For `icon`, `success`, `warning` and `error` types, the `mdc-icon` component is used to render the icon.\n *\n * For the `counter` type, the `mdc-text` component is used to render the counter value.\n *\n * @dependency mdc-icon\n * @dependency mdc-text\n *\n * @tagname mdc-badge\n *\n * @cssproperty --mdc-badge-primary-foreground-color - The foreground color of the primary badge.\n * @cssproperty --mdc-badge-primary-background-color - The background color of the primary badge.\n * @cssproperty --mdc-badge-secondary-foreground-color - The foreground color of the secondary badge.\n * @cssproperty --mdc-badge-secondary-background-color - The background color of the secondary badge.\n * @cssproperty --mdc-badge-success-foreground-color - The foreground color of the success badge.\n * @cssproperty --mdc-badge-success-background-color - The background color of the success badge.\n * @cssproperty --mdc-badge-warning-foreground-color - The foreground color of the warning badge.\n * @cssproperty --mdc-badge-warning-background-color - The background color of the warning badge.\n * @cssproperty --mdc-badge-error-foreground-color - The foreground color of the error badge.\n * @cssproperty --mdc-badge-error-background-color - The background color of the error badge.\n * @cssproperty --mdc-badge-overlay-background-color - The background color of the badge overlay.\n *\n * @csspart badge-dot - The dot notification badge.\n * @csspart badge-icon - The icon badge.\n * @csspart badge-overlay - The overlay badge.\n * @csspart badge-text - The text badge.\n */",
4665
+ "jsDoc": "/**\n * The `mdc-badge` component is a versatile UI element used to\n * display dot, icons, counters, success, warning and error type badge.\n *\n * Supported badge types:\n * - `dot`: Displays a dot notification badge with a blue color.\n * - `icon`: Displays a badge with a specified icon using the `icon-name` attribute.\n * - `counter`: Displays a badge with a counter value. If the counter exceeds the `max-counter`,\n * it shows `maxCounter+`. The maximum value of the counter is 999 and anything above that will be set to `999+`.\n * - `success`: Displays a success badge with a check circle icon and green color.\n * - `warning`: Displays a warning badge with a warning icon and yellow color.\n * - `error`: Displays a error badge with a error legacy icon and red color.\n *\n * For `icon`, `success`, `warning` and `error` types, the `mdc-icon` component is used to render the icon.\n *\n * For the `counter` type, the `mdc-text` component is used to render the counter value.\n *\n * @dependency mdc-icon\n * @dependency mdc-text\n *\n * @tagname mdc-badge\n *\n * @cssproperty --mdc-badge-primary-foreground-color - The foreground color of the primary badge.\n * @cssproperty --mdc-badge-primary-background-color - The background color of the primary badge.\n * @cssproperty --mdc-badge-secondary-foreground-color - The foreground color of the secondary badge.\n * @cssproperty --mdc-badge-secondary-background-color - The background color of the secondary badge.\n * @cssproperty --mdc-badge-success-foreground-color - The foreground color of the success badge.\n * @cssproperty --mdc-badge-success-background-color - The background color of the success badge.\n * @cssproperty --mdc-badge-warning-foreground-color - The foreground color of the warning badge.\n * @cssproperty --mdc-badge-warning-background-color - The background color of the warning badge.\n * @cssproperty --mdc-badge-error-foreground-color - The foreground color of the error badge.\n * @cssproperty --mdc-badge-error-background-color - The background color of the error badge.\n * @cssproperty --mdc-badge-overlay-background-color - The background color of the badge overlay.\n * @cssproperty --mdc-badge-dot-width - The width of the dot badge. Default is 0.75rem (12px).\n * @cssproperty --mdc-badge-dot-height - The height of the dot badge. Default is 0.75rem (12px).\n *\n * @csspart badge-dot - The dot notification badge.\n * @csspart badge-icon - The icon badge.\n * @csspart badge-overlay - The overlay badge.\n * @csspart badge-text - The text badge.\n */",
4658
4666
  "customElement": true
4659
4667
  }
4660
4668
  ],
@@ -51077,24 +51085,6 @@
51077
51085
  "attribute": "tooltip-type",
51078
51086
  "reflects": true
51079
51087
  },
51080
- {
51081
- "kind": "field",
51082
- "name": "defaultSlotNodes",
51083
- "type": {
51084
- "text": "Array<Node>"
51085
- },
51086
- "privacy": "private"
51087
- },
51088
- {
51089
- "kind": "method",
51090
- "name": "getTooltipText",
51091
- "privacy": "private",
51092
- "return": {
51093
- "type": {
51094
- "text": ""
51095
- }
51096
- }
51097
- },
51098
51088
  {
51099
51089
  "kind": "method",
51100
51090
  "name": "setTooltipType",
@@ -32,6 +32,8 @@ import Component from '../../components/badge';
32
32
  * @cssproperty --mdc-badge-error-foreground-color - The foreground color of the error badge.
33
33
  * @cssproperty --mdc-badge-error-background-color - The background color of the error badge.
34
34
  * @cssproperty --mdc-badge-overlay-background-color - The background color of the badge overlay.
35
+ * @cssproperty --mdc-badge-dot-width - The width of the dot badge. Default is 0.75rem (12px).
36
+ * @cssproperty --mdc-badge-dot-height - The height of the dot badge. Default is 0.75rem (12px).
35
37
  *
36
38
  * @csspart badge-dot - The dot notification badge.
37
39
  * @csspart badge-icon - The icon badge.
@@ -35,6 +35,8 @@ import { TAG_NAME } from '../../components/badge/badge.constants';
35
35
  * @cssproperty --mdc-badge-error-foreground-color - The foreground color of the error badge.
36
36
  * @cssproperty --mdc-badge-error-background-color - The background color of the error badge.
37
37
  * @cssproperty --mdc-badge-overlay-background-color - The background color of the badge overlay.
38
+ * @cssproperty --mdc-badge-dot-width - The width of the dot badge. Default is 0.75rem (12px).
39
+ * @cssproperty --mdc-badge-dot-height - The height of the dot badge. Default is 0.75rem (12px).
38
40
  *
39
41
  * @csspart badge-dot - The dot notification badge.
40
42
  * @csspart badge-icon - The icon badge.
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.122.19",
4
+ "version": "0.122.21",
5
5
  "engines": {
6
6
  "node": ">=20.0.0",
7
7
  "npm": ">=8.0.0"