@momentum-design/components 0.129.14 → 0.129.15
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.
- package/dist/browser/index.js.map +2 -2
- package/dist/components/bullet/bullet.component.d.ts +5 -2
- package/dist/components/bullet/bullet.component.js +5 -2
- package/dist/components/button/button.component.d.ts +65 -29
- package/dist/components/button/button.component.js +65 -29
- package/dist/components/buttongroup/buttongroup.component.d.ts +26 -21
- package/dist/components/buttongroup/buttongroup.component.js +26 -21
- package/dist/components/buttonsimple/buttonsimple.component.d.ts +5 -3
- package/dist/components/buttonsimple/buttonsimple.component.js +5 -3
- package/dist/custom-elements.json +140 -60
- package/dist/react/button/index.d.ts +39 -22
- package/dist/react/button/index.js +39 -22
- package/dist/react/buttongroup/index.d.ts +16 -18
- package/dist/react/buttongroup/index.js +16 -18
- package/dist/react/buttonsimple/index.d.ts +5 -3
- package/dist/react/buttonsimple/index.js +5 -3
- package/dist/utils/mixins/ButtonComponentMixin.js +12 -5
- package/package.json +1 -1
|
@@ -4,28 +4,43 @@ import type { Events as EventsInherited } from '../../components/buttonsimple/bu
|
|
|
4
4
|
/**
|
|
5
5
|
* `mdc-button` is a component that can be configured in various ways to suit different use cases.
|
|
6
6
|
*
|
|
7
|
-
* Button
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* - **
|
|
16
|
-
* - **
|
|
17
|
-
* - **
|
|
18
|
-
*
|
|
19
|
-
* Button
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* - **
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
7
|
+
* ## Button configuration
|
|
8
|
+
*
|
|
9
|
+
* The appearance of the button depends on combination of multiple attributes.
|
|
10
|
+
*
|
|
11
|
+
* ### Button Types
|
|
12
|
+
*
|
|
13
|
+
* The type of button is inferred based on the presence of slot and/or prefix and postfix icons/slots:
|
|
14
|
+
*
|
|
15
|
+
* - **Pill button**: Contains text value, commonly used for call to action, tags, or filters
|
|
16
|
+
* - **Pill button with icons**: Contains an icon on the left or right side of the button
|
|
17
|
+
* - **Icon button**: Represented by just an icon without any text
|
|
18
|
+
*
|
|
19
|
+
* ### Button Variants:
|
|
20
|
+
*
|
|
21
|
+
* Options for button backgrounds and borders:
|
|
22
|
+
*
|
|
23
|
+
* - **Primary**: Solid background color
|
|
24
|
+
* - **Secondary**: Transparent background with solid border
|
|
25
|
+
* - **Tertiary**: No background or border, text-only appearance
|
|
26
|
+
*
|
|
27
|
+
* ### Button Colors
|
|
28
|
+
*
|
|
29
|
+
* Color options for **Primary** and **Secondary** buttons:
|
|
30
|
+
*
|
|
31
|
+
* - **Default**: For standard actions
|
|
32
|
+
* - **Positive**: For success or confirmation actions
|
|
33
|
+
* - **Negative**: For destructive or error actions
|
|
34
|
+
* - **Accent**: For informational actions
|
|
35
|
+
* - **Promotional**: For promotional actions
|
|
36
|
+
*
|
|
37
|
+
* ### Button Sizes
|
|
38
|
+
*
|
|
39
|
+
* Size options for different button configurations in REM:
|
|
40
|
+
*
|
|
41
|
+
* - **Pill button**: 40, 32, 28, 24
|
|
42
|
+
* - **Icon button**: 64, 52, 40, 32, 28, 24
|
|
43
|
+
* - **Tertiary icon button**: 20
|
|
29
44
|
*
|
|
30
45
|
* @dependency mdc-icon
|
|
31
46
|
*
|
|
@@ -38,6 +53,8 @@ import type { Events as EventsInherited } from '../../components/buttonsimple/bu
|
|
|
38
53
|
* @csspart button-text - Text label of the button, passed in default slot
|
|
39
54
|
* @csspart prefix - Content before the text label, passed in `prefix` slot
|
|
40
55
|
* @csspart postfix - Content after the text label, passed in `postfix` slot
|
|
56
|
+
* @csspart prefix-icon - Icon element displayed before the text label when `prefix-icon` attribute is set
|
|
57
|
+
* @csspart postfix-icon - Icon element displayed after the text label when `postfix-icon` attribute is set
|
|
41
58
|
*
|
|
42
59
|
* @cssproperty --mdc-button-height - Height for button size
|
|
43
60
|
* @cssproperty --mdc-button-background - Background of the button
|
|
@@ -5,28 +5,43 @@ import { TAG_NAME } from '../../components/button/button.constants';
|
|
|
5
5
|
/**
|
|
6
6
|
* `mdc-button` is a component that can be configured in various ways to suit different use cases.
|
|
7
7
|
*
|
|
8
|
-
* Button
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* - **
|
|
17
|
-
* - **
|
|
18
|
-
* - **
|
|
19
|
-
*
|
|
20
|
-
* Button
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
* - **
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
8
|
+
* ## Button configuration
|
|
9
|
+
*
|
|
10
|
+
* The appearance of the button depends on combination of multiple attributes.
|
|
11
|
+
*
|
|
12
|
+
* ### Button Types
|
|
13
|
+
*
|
|
14
|
+
* The type of button is inferred based on the presence of slot and/or prefix and postfix icons/slots:
|
|
15
|
+
*
|
|
16
|
+
* - **Pill button**: Contains text value, commonly used for call to action, tags, or filters
|
|
17
|
+
* - **Pill button with icons**: Contains an icon on the left or right side of the button
|
|
18
|
+
* - **Icon button**: Represented by just an icon without any text
|
|
19
|
+
*
|
|
20
|
+
* ### Button Variants:
|
|
21
|
+
*
|
|
22
|
+
* Options for button backgrounds and borders:
|
|
23
|
+
*
|
|
24
|
+
* - **Primary**: Solid background color
|
|
25
|
+
* - **Secondary**: Transparent background with solid border
|
|
26
|
+
* - **Tertiary**: No background or border, text-only appearance
|
|
27
|
+
*
|
|
28
|
+
* ### Button Colors
|
|
29
|
+
*
|
|
30
|
+
* Color options for **Primary** and **Secondary** buttons:
|
|
31
|
+
*
|
|
32
|
+
* - **Default**: For standard actions
|
|
33
|
+
* - **Positive**: For success or confirmation actions
|
|
34
|
+
* - **Negative**: For destructive or error actions
|
|
35
|
+
* - **Accent**: For informational actions
|
|
36
|
+
* - **Promotional**: For promotional actions
|
|
37
|
+
*
|
|
38
|
+
* ### Button Sizes
|
|
39
|
+
*
|
|
40
|
+
* Size options for different button configurations in REM:
|
|
41
|
+
*
|
|
42
|
+
* - **Pill button**: 40, 32, 28, 24
|
|
43
|
+
* - **Icon button**: 64, 52, 40, 32, 28, 24
|
|
44
|
+
* - **Tertiary icon button**: 20
|
|
30
45
|
*
|
|
31
46
|
* @dependency mdc-icon
|
|
32
47
|
*
|
|
@@ -39,6 +54,8 @@ import { TAG_NAME } from '../../components/button/button.constants';
|
|
|
39
54
|
* @csspart button-text - Text label of the button, passed in default slot
|
|
40
55
|
* @csspart prefix - Content before the text label, passed in `prefix` slot
|
|
41
56
|
* @csspart postfix - Content after the text label, passed in `postfix` slot
|
|
57
|
+
* @csspart prefix-icon - Icon element displayed before the text label when `prefix-icon` attribute is set
|
|
58
|
+
* @csspart postfix-icon - Icon element displayed after the text label when `postfix-icon` attribute is set
|
|
42
59
|
*
|
|
43
60
|
* @cssproperty --mdc-button-height - Height for button size
|
|
44
61
|
* @cssproperty --mdc-button-background - Background of the button
|
|
@@ -1,23 +1,21 @@
|
|
|
1
1
|
import Component from '../../components/buttongroup';
|
|
2
2
|
/**
|
|
3
|
-
* buttongroup
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* -
|
|
19
|
-
* - Button group will set the `size` and `variant` attributes on the buttons within it,
|
|
20
|
-
* so any `size` or `variant` set directly on any button will be overridden.
|
|
3
|
+
* `mdc-buttongroup` is a wrapper component that groups multiple buttons together.
|
|
4
|
+
*
|
|
5
|
+
* ## Supported button types
|
|
6
|
+
* - Icon buttons
|
|
7
|
+
* - Pill buttons
|
|
8
|
+
* - Combination of icon and pill buttons
|
|
9
|
+
*
|
|
10
|
+
* ## Features
|
|
11
|
+
* - Horizontal or vertical orientation
|
|
12
|
+
* - Unified size and variant applied to all child buttons
|
|
13
|
+
* - Optional compact mode for reduced height
|
|
14
|
+
* - Supported sizes: 24, 28 (default), 32, 40
|
|
15
|
+
*
|
|
16
|
+
* ## Usage
|
|
17
|
+
* - Only `mdc-button` components are allowed as direct children
|
|
18
|
+
* - The `size` and `variant` set on buttongroup override individual button settings
|
|
21
19
|
*
|
|
22
20
|
* @tagname mdc-buttongroup
|
|
23
21
|
*
|
|
@@ -3,24 +3,22 @@ import { createComponent } from '@lit/react';
|
|
|
3
3
|
import Component from '../../components/buttongroup';
|
|
4
4
|
import { TAG_NAME } from '../../components/buttongroup/buttongroup.constants';
|
|
5
5
|
/**
|
|
6
|
-
* buttongroup
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* -
|
|
22
|
-
* - Button group will set the `size` and `variant` attributes on the buttons within it,
|
|
23
|
-
* so any `size` or `variant` set directly on any button will be overridden.
|
|
6
|
+
* `mdc-buttongroup` is a wrapper component that groups multiple buttons together.
|
|
7
|
+
*
|
|
8
|
+
* ## Supported button types
|
|
9
|
+
* - Icon buttons
|
|
10
|
+
* - Pill buttons
|
|
11
|
+
* - Combination of icon and pill buttons
|
|
12
|
+
*
|
|
13
|
+
* ## Features
|
|
14
|
+
* - Horizontal or vertical orientation
|
|
15
|
+
* - Unified size and variant applied to all child buttons
|
|
16
|
+
* - Optional compact mode for reduced height
|
|
17
|
+
* - Supported sizes: 24, 28 (default), 32, 40
|
|
18
|
+
*
|
|
19
|
+
* ## Usage
|
|
20
|
+
* - Only `mdc-button` components are allowed as direct children
|
|
21
|
+
* - The `size` and `variant` set on buttongroup override individual button settings
|
|
24
22
|
*
|
|
25
23
|
* @tagname mdc-buttongroup
|
|
26
24
|
*
|
|
@@ -6,16 +6,18 @@ import type { Events } from '../../components/buttonsimple/buttonsimple.types';
|
|
|
6
6
|
* It is used as an internal component and is not intended to be used directly by consumers.
|
|
7
7
|
* Consumers should use the `mdc-button` component instead.
|
|
8
8
|
*
|
|
9
|
+
* @tagname mdc-buttonsimple
|
|
10
|
+
*
|
|
11
|
+
* @slot - Text label of the button.
|
|
12
|
+
*
|
|
9
13
|
* @event click - (React: onClick) This event is dispatched when the button is clicked.
|
|
10
14
|
* @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the button.
|
|
11
15
|
* @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the button.
|
|
12
16
|
* @event focus - (React: onFocus) This event is dispatched when the button receives focus.
|
|
13
17
|
*
|
|
14
|
-
* @tagname mdc-buttonsimple
|
|
15
|
-
*
|
|
16
18
|
* @cssproperty --mdc-button-height - Height for button size
|
|
17
19
|
* @cssproperty --mdc-button-background - Background color of the button
|
|
18
|
-
* @cssproperty --mdc-button-border-color -
|
|
20
|
+
* @cssproperty --mdc-button-border-color - Border color of the button
|
|
19
21
|
* @cssproperty --mdc-button-text-color - Text color of the button
|
|
20
22
|
*/
|
|
21
23
|
declare const reactWrapper: import("@lit/react").ReactWebComponent<Component, {
|
|
@@ -7,16 +7,18 @@ import { TAG_NAME } from '../../components/buttonsimple/buttonsimple.constants';
|
|
|
7
7
|
* It is used as an internal component and is not intended to be used directly by consumers.
|
|
8
8
|
* Consumers should use the `mdc-button` component instead.
|
|
9
9
|
*
|
|
10
|
+
* @tagname mdc-buttonsimple
|
|
11
|
+
*
|
|
12
|
+
* @slot - Text label of the button.
|
|
13
|
+
*
|
|
10
14
|
* @event click - (React: onClick) This event is dispatched when the button is clicked.
|
|
11
15
|
* @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the button.
|
|
12
16
|
* @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the button.
|
|
13
17
|
* @event focus - (React: onFocus) This event is dispatched when the button receives focus.
|
|
14
18
|
*
|
|
15
|
-
* @tagname mdc-buttonsimple
|
|
16
|
-
*
|
|
17
19
|
* @cssproperty --mdc-button-height - Height for button size
|
|
18
20
|
* @cssproperty --mdc-button-background - Background color of the button
|
|
19
|
-
* @cssproperty --mdc-button-border-color -
|
|
21
|
+
* @cssproperty --mdc-button-border-color - Border color of the button
|
|
20
22
|
* @cssproperty --mdc-button-text-color - Text color of the button
|
|
21
23
|
*/
|
|
22
24
|
const reactWrapper = createComponent({
|
|
@@ -15,15 +15,22 @@ export const ButtonComponentMixin = (superClass) => {
|
|
|
15
15
|
constructor() {
|
|
16
16
|
super(...arguments);
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
19
|
-
* -
|
|
20
|
-
* -
|
|
21
|
-
* -
|
|
18
|
+
* The visual style variant of the button.
|
|
19
|
+
* - `primary`: Solid background color
|
|
20
|
+
* - `secondary`: Transparent background with solid border
|
|
21
|
+
* - `tertiary`: No background or border, text-only appearance
|
|
22
22
|
* @default primary
|
|
23
23
|
*/
|
|
24
24
|
this.variant = DEFAULTS.VARIANT;
|
|
25
25
|
/**
|
|
26
|
-
*
|
|
26
|
+
* The semantic color of the button.
|
|
27
|
+
* - `positive`: For success or confirmation actions
|
|
28
|
+
* - `negative`: For destructive or error actions
|
|
29
|
+
* - `accent`: For informational actions
|
|
30
|
+
* - `promotional`: For promotional actions
|
|
31
|
+
* - `default`: For standard actions
|
|
32
|
+
*
|
|
33
|
+
* Note: Tertiary buttons always use default color.
|
|
27
34
|
* @default default
|
|
28
35
|
*/
|
|
29
36
|
this.color = DEFAULTS.COLOR;
|