@momentum-design/components 0.129.20 → 0.129.22
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 +2 -2
- package/dist/browser/index.js.map +3 -3
- package/dist/components/alertchip/alertchip.component.d.ts +7 -7
- package/dist/components/alertchip/alertchip.component.js +7 -14
- package/dist/components/alertchip/alertchip.constants.js +2 -1
- package/dist/components/alertchip/alertchip.types.d.ts +1 -1
- package/dist/components/alertchip/alertchip.utils.js +2 -2
- package/dist/components/buttonsimple/buttonsimple.component.d.ts +1 -1
- package/dist/components/card/card.component.d.ts +13 -23
- package/dist/components/card/card.component.js +13 -23
- package/dist/components/cardbutton/cardbutton.component.d.ts +13 -9
- package/dist/components/cardbutton/cardbutton.component.js +13 -9
- package/dist/components/cardcheckbox/cardcheckbox.component.d.ts +21 -15
- package/dist/components/cardcheckbox/cardcheckbox.component.js +21 -15
- package/dist/components/cardradio/cardradio.component.d.ts +21 -15
- package/dist/components/cardradio/cardradio.component.js +21 -15
- package/dist/custom-elements.json +87 -69
- package/dist/react/alertchip/index.d.ts +5 -5
- package/dist/react/alertchip/index.js +5 -5
- package/dist/react/card/index.d.ts +13 -23
- package/dist/react/card/index.js +13 -23
- package/dist/react/cardbutton/index.d.ts +13 -9
- package/dist/react/cardbutton/index.js +13 -9
- package/dist/react/cardcheckbox/index.d.ts +18 -14
- package/dist/react/cardcheckbox/index.js +18 -14
- package/dist/react/cardradio/index.d.ts +19 -14
- package/dist/react/cardradio/index.js +19 -14
- package/dist/utils/mixins/CardComponentMixin.js +7 -2
- package/package.json +1 -1
|
@@ -5,7 +5,7 @@ import type { Events as EventsInherited } from '../../components/buttonsimple/bu
|
|
|
5
5
|
* mdc-alertchip component is an interactive chip that consumers can use to represent an alert.
|
|
6
6
|
*
|
|
7
7
|
* - It supports a leading icon along with label.
|
|
8
|
-
* - It supports 5 variants of alerts -
|
|
8
|
+
* - It supports 5 variants of alerts - error, informational, neutral, success and warning.
|
|
9
9
|
*
|
|
10
10
|
* This component is built by extending Buttonsimple.
|
|
11
11
|
*
|
|
@@ -22,10 +22,10 @@ import type { Events as EventsInherited } from '../../components/buttonsimple/bu
|
|
|
22
22
|
* @csspart icon - The alert icon
|
|
23
23
|
* @csspart label - The text label of the alertchip
|
|
24
24
|
*
|
|
25
|
-
* @event click - (React: onClick) This event is dispatched when the
|
|
26
|
-
* @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the
|
|
27
|
-
* @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the
|
|
28
|
-
* @event focus - (React: onFocus) This event is dispatched when the
|
|
25
|
+
* @event click - (React: onClick) This event is dispatched when the alertchip is clicked.
|
|
26
|
+
* @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the alertchip.
|
|
27
|
+
* @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the alertchip.
|
|
28
|
+
* @event focus - (React: onFocus) This event is dispatched when the alertchip receives focus.
|
|
29
29
|
*/
|
|
30
30
|
declare const reactWrapper: import("@lit/react").ReactWebComponent<Component, {
|
|
31
31
|
onClick: EventName<EventsInherited["onClickEvent"]>;
|
|
@@ -6,7 +6,7 @@ import { TAG_NAME } from '../../components/alertchip/alertchip.constants';
|
|
|
6
6
|
* mdc-alertchip component is an interactive chip that consumers can use to represent an alert.
|
|
7
7
|
*
|
|
8
8
|
* - It supports a leading icon along with label.
|
|
9
|
-
* - It supports 5 variants of alerts -
|
|
9
|
+
* - It supports 5 variants of alerts - error, informational, neutral, success and warning.
|
|
10
10
|
*
|
|
11
11
|
* This component is built by extending Buttonsimple.
|
|
12
12
|
*
|
|
@@ -23,10 +23,10 @@ import { TAG_NAME } from '../../components/alertchip/alertchip.constants';
|
|
|
23
23
|
* @csspart icon - The alert icon
|
|
24
24
|
* @csspart label - The text label of the alertchip
|
|
25
25
|
*
|
|
26
|
-
* @event click - (React: onClick) This event is dispatched when the
|
|
27
|
-
* @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the
|
|
28
|
-
* @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the
|
|
29
|
-
* @event focus - (React: onFocus) This event is dispatched when the
|
|
26
|
+
* @event click - (React: onClick) This event is dispatched when the alertchip is clicked.
|
|
27
|
+
* @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the alertchip.
|
|
28
|
+
* @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the alertchip.
|
|
29
|
+
* @event focus - (React: onFocus) This event is dispatched when the alertchip receives focus.
|
|
30
30
|
*/
|
|
31
31
|
const reactWrapper = createComponent({
|
|
32
32
|
tagName: TAG_NAME,
|
|
@@ -1,32 +1,28 @@
|
|
|
1
1
|
import Component from '../../components/card';
|
|
2
2
|
/**
|
|
3
3
|
* The card component allows users to organize information in a structured and tangible
|
|
4
|
-
* format that is visually appealing. `mdc-card` is a static component
|
|
5
|
-
* the following features:
|
|
6
|
-
* - Image
|
|
7
|
-
* - Header
|
|
8
|
-
* - Icon
|
|
9
|
-
* - Title
|
|
10
|
-
* - Subtitle
|
|
11
|
-
* - Body
|
|
4
|
+
* format that is visually appealing. `mdc-card` is a static component.
|
|
12
5
|
*
|
|
13
|
-
*
|
|
6
|
+
* ## Card Structure
|
|
7
|
+
* - **Image**: Optional visual content at the top
|
|
8
|
+
* - **Header**: Contains icon, title, subtitle, and action buttons
|
|
9
|
+
* - **Body**: Main text content area
|
|
10
|
+
* - **Footer**: Optional footer with links and buttons
|
|
14
11
|
*
|
|
15
|
-
*
|
|
12
|
+
* ## Features
|
|
13
|
+
* - Supports two orientations (vertical and horizontal) and three visual variants (border, ghost, and promotional).
|
|
14
|
+
* - Can be made interactive by adding elements to slots like `icon-button`, `footer-link`, and footer buttons.
|
|
16
15
|
*
|
|
17
|
-
*
|
|
18
|
-
* - `icon-button`: This slot supports action icon buttons in the header section (maximum of 3 buttons).
|
|
19
|
-
* - `footer-link`: This slot is for passing `mdc-link` component within the footer section.
|
|
20
|
-
* - `footer-button-primary`: This slot is for passing primary variant of `mdc-button` component within the footer section.
|
|
21
|
-
* - `footer-button-secondary`: This slot is for passing secondary variant of `mdc-button` component
|
|
22
|
-
* within the footer section.
|
|
16
|
+
* @tagname mdc-card
|
|
23
17
|
*
|
|
24
|
-
*
|
|
18
|
+
* @dependency mdc-icon
|
|
19
|
+
* @dependency mdc-text
|
|
25
20
|
*
|
|
26
21
|
* @slot image - This slot is for overriding the image content of the card
|
|
27
22
|
* @slot before-body - This slot is for passing the content before the body
|
|
28
23
|
* @slot body - This slot is for passing the text content for the card
|
|
29
24
|
* @slot after-body - This slot is for passing the content after the body
|
|
25
|
+
* @slot icon-button - This slot supports action icon buttons in the header section (maximum of 3 buttons)
|
|
30
26
|
* @slot footer-link - This slot is for passing `mdc-link` component within the footer section.
|
|
31
27
|
* @slot footer-button-primary - This slot is for passing primary variant of
|
|
32
28
|
* `mdc-button` component within the footer section.
|
|
@@ -46,13 +42,7 @@ import Component from '../../components/card';
|
|
|
46
42
|
* @csspart icon-button - The icon button part of the card header
|
|
47
43
|
* @csspart text - The text part of the card
|
|
48
44
|
*
|
|
49
|
-
* @tagname mdc-card
|
|
50
|
-
*
|
|
51
|
-
* @dependency mdc-icon
|
|
52
|
-
* @dependency mdc-text
|
|
53
|
-
*
|
|
54
45
|
* @cssproperty --mdc-card-width - The width of the card
|
|
55
|
-
*
|
|
56
46
|
*/
|
|
57
47
|
declare const reactWrapper: import("@lit/react").ReactWebComponent<Component, {}>;
|
|
58
48
|
export default reactWrapper;
|
package/dist/react/card/index.js
CHANGED
|
@@ -4,32 +4,28 @@ import Component from '../../components/card';
|
|
|
4
4
|
import { TAG_NAME } from '../../components/card/card.constants';
|
|
5
5
|
/**
|
|
6
6
|
* The card component allows users to organize information in a structured and tangible
|
|
7
|
-
* format that is visually appealing. `mdc-card` is a static component
|
|
8
|
-
* the following features:
|
|
9
|
-
* - Image
|
|
10
|
-
* - Header
|
|
11
|
-
* - Icon
|
|
12
|
-
* - Title
|
|
13
|
-
* - Subtitle
|
|
14
|
-
* - Body
|
|
7
|
+
* format that is visually appealing. `mdc-card` is a static component.
|
|
15
8
|
*
|
|
16
|
-
*
|
|
9
|
+
* ## Card Structure
|
|
10
|
+
* - **Image**: Optional visual content at the top
|
|
11
|
+
* - **Header**: Contains icon, title, subtitle, and action buttons
|
|
12
|
+
* - **Body**: Main text content area
|
|
13
|
+
* - **Footer**: Optional footer with links and buttons
|
|
17
14
|
*
|
|
18
|
-
*
|
|
15
|
+
* ## Features
|
|
16
|
+
* - Supports two orientations (vertical and horizontal) and three visual variants (border, ghost, and promotional).
|
|
17
|
+
* - Can be made interactive by adding elements to slots like `icon-button`, `footer-link`, and footer buttons.
|
|
19
18
|
*
|
|
20
|
-
*
|
|
21
|
-
* - `icon-button`: This slot supports action icon buttons in the header section (maximum of 3 buttons).
|
|
22
|
-
* - `footer-link`: This slot is for passing `mdc-link` component within the footer section.
|
|
23
|
-
* - `footer-button-primary`: This slot is for passing primary variant of `mdc-button` component within the footer section.
|
|
24
|
-
* - `footer-button-secondary`: This slot is for passing secondary variant of `mdc-button` component
|
|
25
|
-
* within the footer section.
|
|
19
|
+
* @tagname mdc-card
|
|
26
20
|
*
|
|
27
|
-
*
|
|
21
|
+
* @dependency mdc-icon
|
|
22
|
+
* @dependency mdc-text
|
|
28
23
|
*
|
|
29
24
|
* @slot image - This slot is for overriding the image content of the card
|
|
30
25
|
* @slot before-body - This slot is for passing the content before the body
|
|
31
26
|
* @slot body - This slot is for passing the text content for the card
|
|
32
27
|
* @slot after-body - This slot is for passing the content after the body
|
|
28
|
+
* @slot icon-button - This slot supports action icon buttons in the header section (maximum of 3 buttons)
|
|
33
29
|
* @slot footer-link - This slot is for passing `mdc-link` component within the footer section.
|
|
34
30
|
* @slot footer-button-primary - This slot is for passing primary variant of
|
|
35
31
|
* `mdc-button` component within the footer section.
|
|
@@ -49,13 +45,7 @@ import { TAG_NAME } from '../../components/card/card.constants';
|
|
|
49
45
|
* @csspart icon-button - The icon button part of the card header
|
|
50
46
|
* @csspart text - The text part of the card
|
|
51
47
|
*
|
|
52
|
-
* @tagname mdc-card
|
|
53
|
-
*
|
|
54
|
-
* @dependency mdc-icon
|
|
55
|
-
* @dependency mdc-text
|
|
56
|
-
*
|
|
57
48
|
* @cssproperty --mdc-card-width - The width of the card
|
|
58
|
-
*
|
|
59
49
|
*/
|
|
60
50
|
const reactWrapper = createComponent({
|
|
61
51
|
tagName: TAG_NAME,
|
|
@@ -4,21 +4,18 @@ import type { Events as EventsInherited } from '../../components/buttonsimple/bu
|
|
|
4
4
|
/**
|
|
5
5
|
* cardbutton component looks like a card and behaves as a button component.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
7
|
+
* ## Features
|
|
8
|
+
* - Supports two orientations (vertical and horizontal) and three visual variants (border, ghost, and promotional).
|
|
9
|
+
* - Interacting anywhere on the card triggers the click event.
|
|
10
|
+
* - Use `name` and `value` attributes when using within forms.
|
|
11
|
+
*
|
|
12
|
+
* **Note**: Only pass non-interactable elements within the slots to avoid nested interactive elements.
|
|
9
13
|
*
|
|
10
14
|
* @tagname mdc-cardbutton
|
|
11
15
|
*
|
|
12
16
|
* @dependency mdc-icon
|
|
13
17
|
* @dependency mdc-text
|
|
14
18
|
*
|
|
15
|
-
* @event click - (React: onClick) Event that gets dispatched when the card is clicked.
|
|
16
|
-
* @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the card.
|
|
17
|
-
* It fires the click event when enter key is used.
|
|
18
|
-
* @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the card.
|
|
19
|
-
* It fires the click event when space key is used.
|
|
20
|
-
* @event focus - (React: onFocus) Event that gets dispatched when the card receives focus.
|
|
21
|
-
*
|
|
22
19
|
* @slot image - This slot is for overriding the image content of the card
|
|
23
20
|
* @slot before-body - This slot is for passing the content before the body
|
|
24
21
|
* @slot body - This slot is for passing the text content for the card
|
|
@@ -26,6 +23,13 @@ import type { Events as EventsInherited } from '../../components/buttonsimple/bu
|
|
|
26
23
|
* @slot footer-link - This slot is for passing `mdc-link` component within the footer section.
|
|
27
24
|
* @slot footer-button-primary - This slot is for passing primary variant of `mdc-button` component within the footer section.
|
|
28
25
|
*
|
|
26
|
+
* @event click - (React: onClick) Event that gets dispatched when the card is clicked.
|
|
27
|
+
* @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the card.
|
|
28
|
+
* It fires the click event when enter key is used.
|
|
29
|
+
* @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the card.
|
|
30
|
+
* It fires the click event when space key is used.
|
|
31
|
+
* @event focus - (React: onFocus) Event that gets dispatched when the card receives focus.
|
|
32
|
+
*
|
|
29
33
|
* @csspart header - The header part of the card
|
|
30
34
|
* @csspart icon - The icon part of the card header
|
|
31
35
|
* @csspart body - The body part of the card
|
|
@@ -5,21 +5,18 @@ import { TAG_NAME } from '../../components/cardbutton/cardbutton.constants';
|
|
|
5
5
|
/**
|
|
6
6
|
* cardbutton component looks like a card and behaves as a button component.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
8
|
+
* ## Features
|
|
9
|
+
* - Supports two orientations (vertical and horizontal) and three visual variants (border, ghost, and promotional).
|
|
10
|
+
* - Interacting anywhere on the card triggers the click event.
|
|
11
|
+
* - Use `name` and `value` attributes when using within forms.
|
|
12
|
+
*
|
|
13
|
+
* **Note**: Only pass non-interactable elements within the slots to avoid nested interactive elements.
|
|
10
14
|
*
|
|
11
15
|
* @tagname mdc-cardbutton
|
|
12
16
|
*
|
|
13
17
|
* @dependency mdc-icon
|
|
14
18
|
* @dependency mdc-text
|
|
15
19
|
*
|
|
16
|
-
* @event click - (React: onClick) Event that gets dispatched when the card is clicked.
|
|
17
|
-
* @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the card.
|
|
18
|
-
* It fires the click event when enter key is used.
|
|
19
|
-
* @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the card.
|
|
20
|
-
* It fires the click event when space key is used.
|
|
21
|
-
* @event focus - (React: onFocus) Event that gets dispatched when the card receives focus.
|
|
22
|
-
*
|
|
23
20
|
* @slot image - This slot is for overriding the image content of the card
|
|
24
21
|
* @slot before-body - This slot is for passing the content before the body
|
|
25
22
|
* @slot body - This slot is for passing the text content for the card
|
|
@@ -27,6 +24,13 @@ import { TAG_NAME } from '../../components/cardbutton/cardbutton.constants';
|
|
|
27
24
|
* @slot footer-link - This slot is for passing `mdc-link` component within the footer section.
|
|
28
25
|
* @slot footer-button-primary - This slot is for passing primary variant of `mdc-button` component within the footer section.
|
|
29
26
|
*
|
|
27
|
+
* @event click - (React: onClick) Event that gets dispatched when the card is clicked.
|
|
28
|
+
* @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the card.
|
|
29
|
+
* It fires the click event when enter key is used.
|
|
30
|
+
* @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the card.
|
|
31
|
+
* It fires the click event when space key is used.
|
|
32
|
+
* @event focus - (React: onFocus) Event that gets dispatched when the card receives focus.
|
|
33
|
+
*
|
|
30
34
|
* @csspart header - The header part of the card
|
|
31
35
|
* @csspart icon - The icon part of the card header
|
|
32
36
|
* @csspart body - The body part of the card
|
|
@@ -2,15 +2,19 @@ import { type EventName } from '@lit/react';
|
|
|
2
2
|
import Component from '../../components/cardcheckbox';
|
|
3
3
|
import type { Events } from '../../components/cardcheckbox/cardcheckbox.types';
|
|
4
4
|
/**
|
|
5
|
-
* cardcheckbox component extends `mdc-card` and supports checkbox selection interaction
|
|
5
|
+
* cardcheckbox component extends `mdc-card` and supports checkbox selection interaction.
|
|
6
|
+
* Multiple cards can be checked simultaneously.
|
|
6
7
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
8
|
+
* ## Features
|
|
9
|
+
* - Supports two orientations (vertical and horizontal), three visual variants (border, ghost, and promotional), and two selection types (check icon or checkbox component).
|
|
10
|
+
* - Interacting anywhere on the card toggles the checked state and dispatches a `change` event.
|
|
11
|
+
* - Card has `role="checkbox"` and manages `aria-checked` and `aria-disabled` attributes automatically.
|
|
9
12
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
13
|
+
* ## Usage
|
|
14
|
+
* - The `card-title` attribute is required.
|
|
15
|
+
* - When using within a form or group, wrap cards in a container with `role="group"` and provide an `aria-label`.
|
|
12
16
|
*
|
|
13
|
-
*
|
|
17
|
+
* **Note**: Only pass non-interactable elements within the slots to avoid nested interactive elements.
|
|
14
18
|
*
|
|
15
19
|
* @tagname mdc-cardcheckbox
|
|
16
20
|
*
|
|
@@ -24,6 +28,14 @@ import type { Events } from '../../components/cardcheckbox/cardcheckbox.types';
|
|
|
24
28
|
* @slot footer-link - This slot is for passing `mdc-link` component within the footer section.
|
|
25
29
|
* @slot footer-button-primary - This slot is for passing primary variant of `mdc-button` component within the footer section.
|
|
26
30
|
*
|
|
31
|
+
* @event click - (React: onClick) Event that gets dispatched when the card is clicked. It toggles the checked state.
|
|
32
|
+
* @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the card.
|
|
33
|
+
* It toggles the checked state when enter key is used.
|
|
34
|
+
* @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the card.
|
|
35
|
+
* It toggles the checked state when space key is used.
|
|
36
|
+
* @event focus - (React: onFocus) Event that gets dispatched when the card receives focus.
|
|
37
|
+
* @event change - (React: onChange) Event that gets dispatched when the card's checked state changes.
|
|
38
|
+
*
|
|
27
39
|
* @csspart header - The header part of the card
|
|
28
40
|
* @csspart icon - The icon part of the card header
|
|
29
41
|
* @csspart body - The body part of the card
|
|
@@ -39,14 +51,6 @@ import type { Events } from '../../components/cardcheckbox/cardcheckbox.types';
|
|
|
39
51
|
* @csspart check-icon-button - The check icon button part of the card
|
|
40
52
|
*
|
|
41
53
|
* @cssproperty --mdc-card-width - The width of the card
|
|
42
|
-
*
|
|
43
|
-
* @event click - (React: onClick) Event that gets dispatched when the card is clicked. It toggles the checked state.
|
|
44
|
-
* @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the card.
|
|
45
|
-
* It toggles the checked state when enter key is used.
|
|
46
|
-
* @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the card.
|
|
47
|
-
* It toggles the checked state when space key is used.
|
|
48
|
-
* @event focus - (React: onFocus) Event that gets dispatched when the card receives focus.
|
|
49
|
-
* @event change - (React: onChange) Event that gets dispatched when the card's checked state changes.
|
|
50
54
|
*/
|
|
51
55
|
declare const reactWrapper: import("@lit/react").ReactWebComponent<Component, {
|
|
52
56
|
onChange: EventName<Events["onChangeEvent"]>;
|
|
@@ -3,15 +3,19 @@ import { createComponent } from '@lit/react';
|
|
|
3
3
|
import Component from '../../components/cardcheckbox';
|
|
4
4
|
import { TAG_NAME } from '../../components/cardcheckbox/cardcheckbox.constants';
|
|
5
5
|
/**
|
|
6
|
-
* cardcheckbox component extends `mdc-card` and supports checkbox selection interaction
|
|
6
|
+
* cardcheckbox component extends `mdc-card` and supports checkbox selection interaction.
|
|
7
|
+
* Multiple cards can be checked simultaneously.
|
|
7
8
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
9
|
+
* ## Features
|
|
10
|
+
* - Supports two orientations (vertical and horizontal), three visual variants (border, ghost, and promotional), and two selection types (check icon or checkbox component).
|
|
11
|
+
* - Interacting anywhere on the card toggles the checked state and dispatches a `change` event.
|
|
12
|
+
* - Card has `role="checkbox"` and manages `aria-checked` and `aria-disabled` attributes automatically.
|
|
10
13
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
14
|
+
* ## Usage
|
|
15
|
+
* - The `card-title` attribute is required.
|
|
16
|
+
* - When using within a form or group, wrap cards in a container with `role="group"` and provide an `aria-label`.
|
|
13
17
|
*
|
|
14
|
-
*
|
|
18
|
+
* **Note**: Only pass non-interactable elements within the slots to avoid nested interactive elements.
|
|
15
19
|
*
|
|
16
20
|
* @tagname mdc-cardcheckbox
|
|
17
21
|
*
|
|
@@ -25,6 +29,14 @@ import { TAG_NAME } from '../../components/cardcheckbox/cardcheckbox.constants';
|
|
|
25
29
|
* @slot footer-link - This slot is for passing `mdc-link` component within the footer section.
|
|
26
30
|
* @slot footer-button-primary - This slot is for passing primary variant of `mdc-button` component within the footer section.
|
|
27
31
|
*
|
|
32
|
+
* @event click - (React: onClick) Event that gets dispatched when the card is clicked. It toggles the checked state.
|
|
33
|
+
* @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the card.
|
|
34
|
+
* It toggles the checked state when enter key is used.
|
|
35
|
+
* @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the card.
|
|
36
|
+
* It toggles the checked state when space key is used.
|
|
37
|
+
* @event focus - (React: onFocus) Event that gets dispatched when the card receives focus.
|
|
38
|
+
* @event change - (React: onChange) Event that gets dispatched when the card's checked state changes.
|
|
39
|
+
*
|
|
28
40
|
* @csspart header - The header part of the card
|
|
29
41
|
* @csspart icon - The icon part of the card header
|
|
30
42
|
* @csspart body - The body part of the card
|
|
@@ -40,14 +52,6 @@ import { TAG_NAME } from '../../components/cardcheckbox/cardcheckbox.constants';
|
|
|
40
52
|
* @csspart check-icon-button - The check icon button part of the card
|
|
41
53
|
*
|
|
42
54
|
* @cssproperty --mdc-card-width - The width of the card
|
|
43
|
-
*
|
|
44
|
-
* @event click - (React: onClick) Event that gets dispatched when the card is clicked. It toggles the checked state.
|
|
45
|
-
* @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the card.
|
|
46
|
-
* It toggles the checked state when enter key is used.
|
|
47
|
-
* @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the card.
|
|
48
|
-
* It toggles the checked state when space key is used.
|
|
49
|
-
* @event focus - (React: onFocus) Event that gets dispatched when the card receives focus.
|
|
50
|
-
* @event change - (React: onChange) Event that gets dispatched when the card's checked state changes.
|
|
51
55
|
*/
|
|
52
56
|
const reactWrapper = createComponent({
|
|
53
57
|
tagName: TAG_NAME,
|
|
@@ -2,15 +2,20 @@ import { type EventName } from '@lit/react';
|
|
|
2
2
|
import Component from '../../components/cardradio';
|
|
3
3
|
import type { Events } from '../../components/cardradio/cardradio.types';
|
|
4
4
|
/**
|
|
5
|
-
* cardradio component extends `mdc-card` and supports radio selection interaction
|
|
5
|
+
* cardradio component extends `mdc-card` and supports radio selection interaction.
|
|
6
|
+
* Only one card can be selected at a time within the same group (defined by `name` attribute).
|
|
6
7
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
8
|
+
* ## Features
|
|
9
|
+
* - Supports two orientations (vertical and horizontal) and three visual variants (border, ghost, and promotional).
|
|
10
|
+
* - Selecting a card automatically unselects other cards in the same group and dispatches a `change` event.
|
|
11
|
+
* - Supports keyboard navigation with arrow keys to move between cards in the same group.
|
|
12
|
+
* - Card has `role="radio"` and manages `aria-checked` and `aria-disabled` attributes automatically.
|
|
9
13
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
14
|
+
* ## Usage
|
|
15
|
+
* - Both `card-title` and `name` attributes are required.
|
|
16
|
+
* - When using within a form or group, wrap cards in a container with `role="radiogroup"` and provide an `aria-label`.
|
|
12
17
|
*
|
|
13
|
-
*
|
|
18
|
+
* **Note**: Only pass non-interactable elements within the slots to avoid nested interactive elements.
|
|
14
19
|
*
|
|
15
20
|
* @tagname mdc-cardradio
|
|
16
21
|
*
|
|
@@ -24,6 +29,14 @@ import type { Events } from '../../components/cardradio/cardradio.types';
|
|
|
24
29
|
* @slot footer-link - This slot is for passing `mdc-link` component within the footer section.
|
|
25
30
|
* @slot footer-button-primary - This slot is for passing primary variant of `mdc-button` component within the footer section.
|
|
26
31
|
*
|
|
32
|
+
* @event click - (React: onClick) Event that gets dispatched when the card is clicked. It selects the card and unselects others in the same group.
|
|
33
|
+
* @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the card.
|
|
34
|
+
* It selects the card when enter key or arrow keys are used.
|
|
35
|
+
* @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the card.
|
|
36
|
+
* It selects the card when space key is used.
|
|
37
|
+
* @event focus - (React: onFocus) Event that gets dispatched when the card receives focus.
|
|
38
|
+
* @event change - (React: onChange) Event that gets dispatched when the card's checked state changes.
|
|
39
|
+
*
|
|
27
40
|
* @csspart header - The header part of the card
|
|
28
41
|
* @csspart icon - The icon part of the card header
|
|
29
42
|
* @csspart body - The body part of the card
|
|
@@ -39,14 +52,6 @@ import type { Events } from '../../components/cardradio/cardradio.types';
|
|
|
39
52
|
* @csspart check-icon-button - The check icon button part of the card
|
|
40
53
|
*
|
|
41
54
|
* @cssproperty --mdc-card-width - The width of the card
|
|
42
|
-
*
|
|
43
|
-
* @event click - (React: onClick) Event that gets dispatched when the card is clicked. It toggles the checked state.
|
|
44
|
-
* @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the card.
|
|
45
|
-
* It toggles the checked state when enter key is used.
|
|
46
|
-
* @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the card.
|
|
47
|
-
* It toggles the checked state when space key is used.
|
|
48
|
-
* @event focus - (React: onFocus) Event that gets dispatched when the card receives focus.
|
|
49
|
-
* @event change - (React: onChange) Event that gets dispatched when the card's checked state changes.
|
|
50
55
|
*/
|
|
51
56
|
declare const reactWrapper: import("@lit/react").ReactWebComponent<Component, {
|
|
52
57
|
onChange: EventName<Events["onChangeEvent"]>;
|
|
@@ -3,15 +3,20 @@ import { createComponent } from '@lit/react';
|
|
|
3
3
|
import Component from '../../components/cardradio';
|
|
4
4
|
import { TAG_NAME } from '../../components/cardradio/cardradio.constants';
|
|
5
5
|
/**
|
|
6
|
-
* cardradio component extends `mdc-card` and supports radio selection interaction
|
|
6
|
+
* cardradio component extends `mdc-card` and supports radio selection interaction.
|
|
7
|
+
* Only one card can be selected at a time within the same group (defined by `name` attribute).
|
|
7
8
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
9
|
+
* ## Features
|
|
10
|
+
* - Supports two orientations (vertical and horizontal) and three visual variants (border, ghost, and promotional).
|
|
11
|
+
* - Selecting a card automatically unselects other cards in the same group and dispatches a `change` event.
|
|
12
|
+
* - Supports keyboard navigation with arrow keys to move between cards in the same group.
|
|
13
|
+
* - Card has `role="radio"` and manages `aria-checked` and `aria-disabled` attributes automatically.
|
|
10
14
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
15
|
+
* ## Usage
|
|
16
|
+
* - Both `card-title` and `name` attributes are required.
|
|
17
|
+
* - When using within a form or group, wrap cards in a container with `role="radiogroup"` and provide an `aria-label`.
|
|
13
18
|
*
|
|
14
|
-
*
|
|
19
|
+
* **Note**: Only pass non-interactable elements within the slots to avoid nested interactive elements.
|
|
15
20
|
*
|
|
16
21
|
* @tagname mdc-cardradio
|
|
17
22
|
*
|
|
@@ -25,6 +30,14 @@ import { TAG_NAME } from '../../components/cardradio/cardradio.constants';
|
|
|
25
30
|
* @slot footer-link - This slot is for passing `mdc-link` component within the footer section.
|
|
26
31
|
* @slot footer-button-primary - This slot is for passing primary variant of `mdc-button` component within the footer section.
|
|
27
32
|
*
|
|
33
|
+
* @event click - (React: onClick) Event that gets dispatched when the card is clicked. It selects the card and unselects others in the same group.
|
|
34
|
+
* @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the card.
|
|
35
|
+
* It selects the card when enter key or arrow keys are used.
|
|
36
|
+
* @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the card.
|
|
37
|
+
* It selects the card when space key is used.
|
|
38
|
+
* @event focus - (React: onFocus) Event that gets dispatched when the card receives focus.
|
|
39
|
+
* @event change - (React: onChange) Event that gets dispatched when the card's checked state changes.
|
|
40
|
+
*
|
|
28
41
|
* @csspart header - The header part of the card
|
|
29
42
|
* @csspart icon - The icon part of the card header
|
|
30
43
|
* @csspart body - The body part of the card
|
|
@@ -40,14 +53,6 @@ import { TAG_NAME } from '../../components/cardradio/cardradio.constants';
|
|
|
40
53
|
* @csspart check-icon-button - The check icon button part of the card
|
|
41
54
|
*
|
|
42
55
|
* @cssproperty --mdc-card-width - The width of the card
|
|
43
|
-
*
|
|
44
|
-
* @event click - (React: onClick) Event that gets dispatched when the card is clicked. It toggles the checked state.
|
|
45
|
-
* @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the card.
|
|
46
|
-
* It toggles the checked state when enter key is used.
|
|
47
|
-
* @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the card.
|
|
48
|
-
* It toggles the checked state when space key is used.
|
|
49
|
-
* @event focus - (React: onFocus) Event that gets dispatched when the card receives focus.
|
|
50
|
-
* @event change - (React: onChange) Event that gets dispatched when the card's checked state changes.
|
|
51
56
|
*/
|
|
52
57
|
const reactWrapper = createComponent({
|
|
53
58
|
tagName: TAG_NAME,
|
|
@@ -36,12 +36,17 @@ export const CardComponentMixin = (superClass) => {
|
|
|
36
36
|
*/
|
|
37
37
|
this.imageAlt = '';
|
|
38
38
|
/**
|
|
39
|
-
* The variant of the card
|
|
39
|
+
* The variant of the card that represents the border styling.
|
|
40
|
+
* - `border`: Card with border (default)
|
|
41
|
+
* - `ghost`: Card without border
|
|
42
|
+
* - `promotional`: Card with promotional styling
|
|
40
43
|
* @default 'border'
|
|
41
44
|
*/
|
|
42
45
|
this.variant = DEFAULTS.VARIANT;
|
|
43
46
|
/**
|
|
44
|
-
* The orientation of the card.
|
|
47
|
+
* The orientation of the card.
|
|
48
|
+
* - `vertical`: Card in vertical layout with min-width of 20rem (default)
|
|
49
|
+
* - `horizontal`: Card in horizontal layout with min-width of 40rem
|
|
45
50
|
* @default 'vertical'
|
|
46
51
|
*/
|
|
47
52
|
this.orientation = DEFAULTS.ORIENTATION;
|