@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.
@@ -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 Variants:
8
- * - **Primary**: Solid background color.
9
- * - **Secondary**: Transparent background with a solid border.
10
- * - **Tertiary**: No background or border, appears as plain text but retains all button functionalities.
11
- *
12
- * Button Colors:
13
- * - **Positive**: Green color.
14
- * - **Negative**: Red color.
15
- * - **Accent**: Blue color.
16
- * - **Promotional**: Purple color.
17
- * - **Default**: White color.
18
- *
19
- * Button Sizes (in REM units):
20
- * - **Pill button**: 40, 32, 28, 24.
21
- * - **Icon button**: 64, 52, 40, 32, 28, 24.
22
- * - **Tertiary icon button**: 20.
23
- *
24
- * Button Types:
25
- * - **Pill button**: A button that contains text value. Commonly used for call to action, tags, or filters.
26
- * - **Pill button with icons**: A button containing an icon either on the left or right side of the button.
27
- * - **Icon button**: A button represented by just an icon without any text.
28
- * The type of button is inferred based on the presence of slot and/or prefix and postfix icons/slots.
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 Variants:
9
- * - **Primary**: Solid background color.
10
- * - **Secondary**: Transparent background with a solid border.
11
- * - **Tertiary**: No background or border, appears as plain text but retains all button functionalities.
12
- *
13
- * Button Colors:
14
- * - **Positive**: Green color.
15
- * - **Negative**: Red color.
16
- * - **Accent**: Blue color.
17
- * - **Promotional**: Purple color.
18
- * - **Default**: White color.
19
- *
20
- * Button Sizes (in REM units):
21
- * - **Pill button**: 40, 32, 28, 24.
22
- * - **Icon button**: 64, 52, 40, 32, 28, 24.
23
- * - **Tertiary icon button**: 20.
24
- *
25
- * Button Types:
26
- * - **Pill button**: A button that contains text value. Commonly used for call to action, tags, or filters.
27
- * - **Pill button with icons**: A button containing an icon either on the left or right side of the button.
28
- * - **Icon button**: A button represented by just an icon without any text.
29
- * The type of button is inferred based on the presence of slot and/or prefix and postfix icons/slots.
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 component, is a wrapper to group multiple buttons.
4
- * It can support icon buttons, combination of icon and pill buttons, and text buttons.
5
- * Button group can be positioned in horizontal orientation and vertical orientation.
6
- *
7
- * The sizes of buttons within the button group can be set using the `size` attribute on the button group,
8
- * which will apply the size to all buttons within the group.
9
- *
10
- * Buttons of sizes 24, 28, 32, and 40 are only supported inside a button group. Default size is 28.
11
- *
12
- * The variant of buttons within the button group can be set using the `variant` attribute on the button group,
13
- * which will apply the variant to all buttons within the group. Default variant is `primary`.
14
- *
15
- * All buttons are placed horizontally by default. To change the orientation to vertical, set the `orientation` attribute to `vertical`.
16
- *
17
- * Things to note:
18
- * - Button group will allow only `mdc-button` components as its direct children.
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 component, is a wrapper to group multiple buttons.
7
- * It can support icon buttons, combination of icon and pill buttons, and text buttons.
8
- * Button group can be positioned in horizontal orientation and vertical orientation.
9
- *
10
- * The sizes of buttons within the button group can be set using the `size` attribute on the button group,
11
- * which will apply the size to all buttons within the group.
12
- *
13
- * Buttons of sizes 24, 28, 32, and 40 are only supported inside a button group. Default size is 28.
14
- *
15
- * The variant of buttons within the button group can be set using the `variant` attribute on the button group,
16
- * which will apply the variant to all buttons within the group. Default variant is `primary`.
17
- *
18
- * All buttons are placed horizontally by default. To change the orientation to vertical, set the `orientation` attribute to `vertical`.
19
- *
20
- * Things to note:
21
- * - Button group will allow only `mdc-button` components as its direct children.
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 - Borer color of the button
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 - Borer color of the button
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
- * There are 3 variants of button: primary, secondary, tertiary. They are styled differently.
19
- * - **Primary**: Solid background color.
20
- * - **Secondary**: Transparent background with a solid border.
21
- * - **Tertiary**: No background or border, appears as plain text but retains all button functionalities.
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
- * There are 5 colors for button: positive, negative, accent, promotional, default.
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;
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.14",
4
+ "version": "0.129.15",
5
5
  "engines": {
6
6
  "node": ">=20.0.0",
7
7
  "npm": ">=8.0.0"