@momentum-design/components 0.129.13 → 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/appheader/appheader.component.d.ts +16 -12
- package/dist/components/appheader/appheader.component.js +16 -12
- package/dist/components/avatar/avatar.component.d.ts +22 -15
- package/dist/components/avatar/avatar.component.js +22 -15
- package/dist/components/avatarbutton/avatarbutton.component.d.ts +13 -11
- package/dist/components/avatarbutton/avatarbutton.component.js +13 -11
- 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 +166 -80
- package/dist/react/appheader/index.d.ts +16 -12
- package/dist/react/appheader/index.js +16 -12
- package/dist/react/avatar/index.d.ts +25 -18
- package/dist/react/avatar/index.js +25 -18
- package/dist/react/avatarbutton/index.d.ts +13 -11
- package/dist/react/avatarbutton/index.js +13 -11
- 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
|
@@ -1,22 +1,26 @@
|
|
|
1
1
|
import Component from '../../components/appheader';
|
|
2
2
|
/**
|
|
3
|
-
* The `mdc-appheader` component provides a structured and accessible app header layout.
|
|
4
|
-
* It consists of three primary sections: leading, center, and trailing.
|
|
3
|
+
* The `mdc-appheader` component provides a structured and accessible app header layout with three sections: leading, center, and trailing.
|
|
5
4
|
*
|
|
6
|
-
*
|
|
7
|
-
* -
|
|
8
|
-
* -
|
|
5
|
+
* ## Layout sections
|
|
6
|
+
* - **Leading** - Typically holds brand logo, brand name, or menu icon
|
|
7
|
+
* - **Center** - Can contain search bar, icons, navigation links, or action controls
|
|
8
|
+
* - **Trailing** - Generally includes profile avatar, icons, settings, or additional action controls
|
|
9
|
+
*
|
|
10
|
+
* Each section automatically handles flex alignment: leading aligns left, center aligns center, trailing aligns right.
|
|
9
11
|
*
|
|
10
12
|
* @tagname mdc-appheader
|
|
11
13
|
*
|
|
12
|
-
* @slot leading -
|
|
13
|
-
* @slot center -
|
|
14
|
-
* @slot trailing -
|
|
14
|
+
* @slot leading - Content for the leading section (left-aligned).
|
|
15
|
+
* @slot center - Content for the center section (center-aligned).
|
|
16
|
+
* @slot trailing - Content for the trailing section (right-aligned).
|
|
17
|
+
*
|
|
18
|
+
* @cssproperty --mdc-appheader-height - Height of the app header. Default is 4rem (64px).
|
|
15
19
|
*
|
|
16
|
-
* @csspart container - The main container
|
|
17
|
-
* @csspart leading-section - The leading section
|
|
18
|
-
* @csspart center-section - The center section
|
|
19
|
-
* @csspart trailing-section - The trailing section
|
|
20
|
+
* @csspart container - The main header container.
|
|
21
|
+
* @csspart leading-section - The leading section wrapper (left side).
|
|
22
|
+
* @csspart center-section - The center section wrapper (middle).
|
|
23
|
+
* @csspart trailing-section - The trailing section wrapper (right side).
|
|
20
24
|
*/
|
|
21
25
|
declare const reactWrapper: import("@lit/react").ReactWebComponent<Component, {}>;
|
|
22
26
|
export default reactWrapper;
|
|
@@ -3,23 +3,27 @@ import { createComponent } from '@lit/react';
|
|
|
3
3
|
import Component from '../../components/appheader';
|
|
4
4
|
import { TAG_NAME } from '../../components/appheader/appheader.constants';
|
|
5
5
|
/**
|
|
6
|
-
* The `mdc-appheader` component provides a structured and accessible app header layout.
|
|
7
|
-
* It consists of three primary sections: leading, center, and trailing.
|
|
6
|
+
* The `mdc-appheader` component provides a structured and accessible app header layout with three sections: leading, center, and trailing.
|
|
8
7
|
*
|
|
9
|
-
*
|
|
10
|
-
* -
|
|
11
|
-
* -
|
|
8
|
+
* ## Layout sections
|
|
9
|
+
* - **Leading** - Typically holds brand logo, brand name, or menu icon
|
|
10
|
+
* - **Center** - Can contain search bar, icons, navigation links, or action controls
|
|
11
|
+
* - **Trailing** - Generally includes profile avatar, icons, settings, or additional action controls
|
|
12
|
+
*
|
|
13
|
+
* Each section automatically handles flex alignment: leading aligns left, center aligns center, trailing aligns right.
|
|
12
14
|
*
|
|
13
15
|
* @tagname mdc-appheader
|
|
14
16
|
*
|
|
15
|
-
* @slot leading -
|
|
16
|
-
* @slot center -
|
|
17
|
-
* @slot trailing -
|
|
17
|
+
* @slot leading - Content for the leading section (left-aligned).
|
|
18
|
+
* @slot center - Content for the center section (center-aligned).
|
|
19
|
+
* @slot trailing - Content for the trailing section (right-aligned).
|
|
20
|
+
*
|
|
21
|
+
* @cssproperty --mdc-appheader-height - Height of the app header. Default is 4rem (64px).
|
|
18
22
|
*
|
|
19
|
-
* @csspart container - The main container
|
|
20
|
-
* @csspart leading-section - The leading section
|
|
21
|
-
* @csspart center-section - The center section
|
|
22
|
-
* @csspart trailing-section - The trailing section
|
|
23
|
+
* @csspart container - The main header container.
|
|
24
|
+
* @csspart leading-section - The leading section wrapper (left side).
|
|
25
|
+
* @csspart center-section - The center section wrapper (middle).
|
|
26
|
+
* @csspart trailing-section - The trailing section wrapper (right side).
|
|
23
27
|
*/
|
|
24
28
|
const reactWrapper = createComponent({
|
|
25
29
|
tagName: TAG_NAME,
|
|
@@ -1,23 +1,30 @@
|
|
|
1
1
|
import Component from '../../components/avatar';
|
|
2
2
|
/**
|
|
3
|
-
* The `mdc-avatar` component
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* While
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
3
|
+
* The `mdc-avatar` component represents a person or a space. It displays as a photo, initials, icon, or counter.
|
|
4
|
+
*
|
|
5
|
+
* ## Display Priority
|
|
6
|
+
*
|
|
7
|
+
* When multiple attributes are provided, the component determines what to display based on this priority:
|
|
8
|
+
* 1. **Photo** (`src`) - Takes highest priority
|
|
9
|
+
* - While loading: Shows `initials` as placeholder if provided (instant), otherwise shows icon (requires loading)
|
|
10
|
+
* - After loading: Shows the photo
|
|
11
|
+
* - On error: Placeholder remains visible (initials or icon)
|
|
12
|
+
* 2. **Icon** (`icon-name`) - Takes priority if no `src` is provided
|
|
13
|
+
* - Shows custom icon if `icon-name` is set (requires icon library to load)
|
|
14
|
+
* - **Note:** If both `icon-name` and `initials` are provided (without `src`), icon takes precedence and initials are ignored.
|
|
15
|
+
* This means users may see a delay while the icon loads, even though initials render instantly.
|
|
16
|
+
* - Defaults to `user-regular` icon if no other content is available
|
|
17
|
+
* 3. **Initials** (`initials`) - Displayed only if no `src` or `icon-name` is provided
|
|
18
|
+
* - Shows first two characters, converted to uppercase
|
|
19
|
+
* - Renders instantly (no loading required)
|
|
20
|
+
* 4. **Counter** (`counter`) - Displayed only if none of the above are provided
|
|
21
|
+
* - Shows numeric value (max 99+)
|
|
22
|
+
* - Negative values display as 0
|
|
23
|
+
*
|
|
24
|
+
* ## Behavior
|
|
25
|
+
* - Non-interactive and non-focusable component (use `mdc-avatarbutton` for clickable avatars)
|
|
26
|
+
* - Shows loading indicator overlay when `is-typing` is true (displays on top of existing content)
|
|
27
|
+
* - Presence indicator hidden when counter is set or when typing
|
|
21
28
|
*
|
|
22
29
|
* @dependency mdc-icon
|
|
23
30
|
* @dependency mdc-presence
|
|
@@ -3,24 +3,31 @@ import { createComponent } from '@lit/react';
|
|
|
3
3
|
import Component from '../../components/avatar';
|
|
4
4
|
import { TAG_NAME } from '../../components/avatar/avatar.constants';
|
|
5
5
|
/**
|
|
6
|
-
* The `mdc-avatar` component
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* While
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
6
|
+
* The `mdc-avatar` component represents a person or a space. It displays as a photo, initials, icon, or counter.
|
|
7
|
+
*
|
|
8
|
+
* ## Display Priority
|
|
9
|
+
*
|
|
10
|
+
* When multiple attributes are provided, the component determines what to display based on this priority:
|
|
11
|
+
* 1. **Photo** (`src`) - Takes highest priority
|
|
12
|
+
* - While loading: Shows `initials` as placeholder if provided (instant), otherwise shows icon (requires loading)
|
|
13
|
+
* - After loading: Shows the photo
|
|
14
|
+
* - On error: Placeholder remains visible (initials or icon)
|
|
15
|
+
* 2. **Icon** (`icon-name`) - Takes priority if no `src` is provided
|
|
16
|
+
* - Shows custom icon if `icon-name` is set (requires icon library to load)
|
|
17
|
+
* - **Note:** If both `icon-name` and `initials` are provided (without `src`), icon takes precedence and initials are ignored.
|
|
18
|
+
* This means users may see a delay while the icon loads, even though initials render instantly.
|
|
19
|
+
* - Defaults to `user-regular` icon if no other content is available
|
|
20
|
+
* 3. **Initials** (`initials`) - Displayed only if no `src` or `icon-name` is provided
|
|
21
|
+
* - Shows first two characters, converted to uppercase
|
|
22
|
+
* - Renders instantly (no loading required)
|
|
23
|
+
* 4. **Counter** (`counter`) - Displayed only if none of the above are provided
|
|
24
|
+
* - Shows numeric value (max 99+)
|
|
25
|
+
* - Negative values display as 0
|
|
26
|
+
*
|
|
27
|
+
* ## Behavior
|
|
28
|
+
* - Non-interactive and non-focusable component (use `mdc-avatarbutton` for clickable avatars)
|
|
29
|
+
* - Shows loading indicator overlay when `is-typing` is true (displays on top of existing content)
|
|
30
|
+
* - Presence indicator hidden when counter is set or when typing
|
|
24
31
|
*
|
|
25
32
|
* @dependency mdc-icon
|
|
26
33
|
* @dependency mdc-presence
|
|
@@ -2,25 +2,27 @@ import { type EventName } from '@lit/react';
|
|
|
2
2
|
import Component from '../../components/avatarbutton';
|
|
3
3
|
import type { Events as EventsInherited } from '../../components/buttonsimple/buttonsimple.types';
|
|
4
4
|
/**
|
|
5
|
-
* The `mdc-avatarbutton` component is an
|
|
5
|
+
* The `mdc-avatarbutton` component is an interactive, clickable version of `mdc-avatar`.
|
|
6
|
+
* It wraps the avatar component in a button, making it focusable and actionable.
|
|
6
7
|
*
|
|
7
|
-
* This component
|
|
8
|
-
*
|
|
8
|
+
* This component extends `buttonsimple` and includes all avatar display features (photo, initials, icon, counter, presence).
|
|
9
|
+
* Use CSS parts to customize the avatar's appearance inside the button.
|
|
9
10
|
*
|
|
10
|
-
*
|
|
11
|
+
* ## Accessibility
|
|
12
|
+
* - Always provide an `aria-label` attribute to describe the button's purpose
|
|
11
13
|
*
|
|
12
14
|
* @dependency mdc-avatar
|
|
13
15
|
*
|
|
14
|
-
* @event click - (React: onClick)
|
|
15
|
-
* @event keydown - (React: onKeyDown)
|
|
16
|
-
* @event keyup - (React: onKeyUp)
|
|
17
|
-
* @event focus - (React: onFocus)
|
|
16
|
+
* @event click - (React: onClick) Dispatched when the avatar button is clicked.
|
|
17
|
+
* @event keydown - (React: onKeyDown) Dispatched when a key is pressed on the avatar button.
|
|
18
|
+
* @event keyup - (React: onKeyUp) Dispatched when a key is released on the avatar button.
|
|
19
|
+
* @event focus - (React: onFocus) Dispatched when the avatar button receives focus.
|
|
18
20
|
*
|
|
19
21
|
* @tagname mdc-avatarbutton
|
|
20
22
|
*
|
|
21
|
-
* @cssproperty --mdc-avatarbutton-overlay-background-color-rest - Background color of the overlay in rest state
|
|
22
|
-
* @cssproperty --mdc-avatarbutton-overlay-background-color-hover - Background color of the overlay in hover state
|
|
23
|
-
* @cssproperty --mdc-avatarbutton-overlay-background-color-active - Background color of the overlay in active state
|
|
23
|
+
* @cssproperty --mdc-avatarbutton-overlay-background-color-rest - Background color of the overlay in rest state.
|
|
24
|
+
* @cssproperty --mdc-avatarbutton-overlay-background-color-hover - Background color of the overlay in hover state.
|
|
25
|
+
* @cssproperty --mdc-avatarbutton-overlay-background-color-active - Background color of the overlay in active state.
|
|
24
26
|
*
|
|
25
27
|
* @csspart overlay - The overlay part of the avatar button.
|
|
26
28
|
* @csspart content - The main content of the avatar.
|
|
@@ -3,25 +3,27 @@ import { createComponent } from '@lit/react';
|
|
|
3
3
|
import Component from '../../components/avatarbutton';
|
|
4
4
|
import { TAG_NAME } from '../../components/avatarbutton/avatarbutton.constants';
|
|
5
5
|
/**
|
|
6
|
-
* The `mdc-avatarbutton` component is an
|
|
6
|
+
* The `mdc-avatarbutton` component is an interactive, clickable version of `mdc-avatar`.
|
|
7
|
+
* It wraps the avatar component in a button, making it focusable and actionable.
|
|
7
8
|
*
|
|
8
|
-
* This component
|
|
9
|
-
*
|
|
9
|
+
* This component extends `buttonsimple` and includes all avatar display features (photo, initials, icon, counter, presence).
|
|
10
|
+
* Use CSS parts to customize the avatar's appearance inside the button.
|
|
10
11
|
*
|
|
11
|
-
*
|
|
12
|
+
* ## Accessibility
|
|
13
|
+
* - Always provide an `aria-label` attribute to describe the button's purpose
|
|
12
14
|
*
|
|
13
15
|
* @dependency mdc-avatar
|
|
14
16
|
*
|
|
15
|
-
* @event click - (React: onClick)
|
|
16
|
-
* @event keydown - (React: onKeyDown)
|
|
17
|
-
* @event keyup - (React: onKeyUp)
|
|
18
|
-
* @event focus - (React: onFocus)
|
|
17
|
+
* @event click - (React: onClick) Dispatched when the avatar button is clicked.
|
|
18
|
+
* @event keydown - (React: onKeyDown) Dispatched when a key is pressed on the avatar button.
|
|
19
|
+
* @event keyup - (React: onKeyUp) Dispatched when a key is released on the avatar button.
|
|
20
|
+
* @event focus - (React: onFocus) Dispatched when the avatar button receives focus.
|
|
19
21
|
*
|
|
20
22
|
* @tagname mdc-avatarbutton
|
|
21
23
|
*
|
|
22
|
-
* @cssproperty --mdc-avatarbutton-overlay-background-color-rest - Background color of the overlay in rest state
|
|
23
|
-
* @cssproperty --mdc-avatarbutton-overlay-background-color-hover - Background color of the overlay in hover state
|
|
24
|
-
* @cssproperty --mdc-avatarbutton-overlay-background-color-active - Background color of the overlay in active state
|
|
24
|
+
* @cssproperty --mdc-avatarbutton-overlay-background-color-rest - Background color of the overlay in rest state.
|
|
25
|
+
* @cssproperty --mdc-avatarbutton-overlay-background-color-hover - Background color of the overlay in hover state.
|
|
26
|
+
* @cssproperty --mdc-avatarbutton-overlay-background-color-active - Background color of the overlay in active state.
|
|
25
27
|
*
|
|
26
28
|
* @csspart overlay - The overlay part of the avatar button.
|
|
27
29
|
* @csspart content - The main content of the avatar.
|
|
@@ -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;
|