@momentum-design/components 0.122.18 → 0.122.20

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
  }
@@ -2,9 +2,24 @@ import { CSSResult, PropertyValues } from 'lit';
2
2
  import { Component } from '../../models';
3
3
  import type { ButtonGroupOrientation, ButtonGroupSize, ButtonGroupVariant } from './buttongroup.types';
4
4
  /**
5
- * buttongroup component, is a styled wrapper for multiple buttons.
5
+ * buttongroup component, is a wrapper to group multiple buttons.
6
6
  * It can support icon buttons, combination of icon and pill buttons, and text buttons.
7
- * They are available in horizontal and vertical orientation.
7
+ * Button group can be positioned in horizontal orientation and vertical orientation.
8
+ *
9
+ * The sizes of buttons within the button group can be set using the `size` attribute on the button group,
10
+ * which will apply the size to all buttons within the group.
11
+ *
12
+ * Buttons of sizes 24, 28, 32, and 40 are only supported inside a button group. Default size is 28.
13
+ *
14
+ * The variant of buttons within the button group can be set using the `variant` attribute on the button group,
15
+ * which will apply the variant to all buttons within the group. Default variant is `primary`.
16
+ *
17
+ * All buttons are placed horizontally by default. To change the orientation to vertical, set the `orientation` attribute to `vertical`.
18
+ *
19
+ * Things to note:
20
+ * - Button group will allow only `mdc-button` components as its direct children.
21
+ * - Button group will set the `size` and `variant` attributes on the buttons within it,
22
+ * so any `size` or `variant` set directly on any button will be overridden.
8
23
  *
9
24
  * @tagname mdc-buttongroup
10
25
  *
@@ -13,9 +13,24 @@ import { Component } from '../../models';
13
13
  import { DEFAULTS } from './buttongroup.constants';
14
14
  import styles from './buttongroup.styles';
15
15
  /**
16
- * buttongroup component, is a styled wrapper for multiple buttons.
16
+ * buttongroup component, is a wrapper to group multiple buttons.
17
17
  * It can support icon buttons, combination of icon and pill buttons, and text buttons.
18
- * They are available in horizontal and vertical orientation.
18
+ * Button group can be positioned in horizontal orientation and vertical orientation.
19
+ *
20
+ * The sizes of buttons within the button group can be set using the `size` attribute on the button group,
21
+ * which will apply the size to all buttons within the group.
22
+ *
23
+ * Buttons of sizes 24, 28, 32, and 40 are only supported inside a button group. Default size is 28.
24
+ *
25
+ * The variant of buttons within the button group can be set using the `variant` attribute on the button group,
26
+ * which will apply the variant to all buttons within the group. Default variant is `primary`.
27
+ *
28
+ * All buttons are placed horizontally by default. To change the orientation to vertical, set the `orientation` attribute to `vertical`.
29
+ *
30
+ * Things to note:
31
+ * - Button group will allow only `mdc-button` components as its direct children.
32
+ * - Button group will set the `size` and `variant` attributes on the buttons within it,
33
+ * so any `size` or `variant` set directly on any button will be overridden.
19
34
  *
20
35
  * @tagname mdc-buttongroup
21
36
  *
@@ -57,14 +57,14 @@ const styles = css `
57
57
  position: absolute;
58
58
  height: 100%;
59
59
  border-inline-end: var(--mdc-buttongroup-border-width) solid var(--mdc-buttongroup-divider-color);
60
- inset-inline-end: calc(var(--mdc-buttongroup-border-width) / 2);
60
+ inset-inline-start: 100%;
61
61
  }
62
62
  :host([variant='secondary'][orientation='vertical']) ::slotted(mdc-button:not(:last-of-type))::after {
63
63
  content: '';
64
64
  position: absolute;
65
65
  width: 100%;
66
66
  border-block-end: var(--mdc-buttongroup-border-width) solid var(--mdc-buttongroup-divider-color);
67
- inset-block-end: calc(var(--mdc-buttongroup-border-width) / 2);
67
+ inset-block-end: 0%;
68
68
  }
69
69
 
70
70
  :host([orientation='vertical']) ::slotted(mdc-button:first-of-type) {
@@ -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
  ];