@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.
Files changed (29) hide show
  1. package/dist/browser/index.js +2 -2
  2. package/dist/browser/index.js.map +3 -3
  3. package/dist/components/alertchip/alertchip.component.d.ts +7 -7
  4. package/dist/components/alertchip/alertchip.component.js +7 -14
  5. package/dist/components/alertchip/alertchip.constants.js +2 -1
  6. package/dist/components/alertchip/alertchip.types.d.ts +1 -1
  7. package/dist/components/alertchip/alertchip.utils.js +2 -2
  8. package/dist/components/buttonsimple/buttonsimple.component.d.ts +1 -1
  9. package/dist/components/card/card.component.d.ts +13 -23
  10. package/dist/components/card/card.component.js +13 -23
  11. package/dist/components/cardbutton/cardbutton.component.d.ts +13 -9
  12. package/dist/components/cardbutton/cardbutton.component.js +13 -9
  13. package/dist/components/cardcheckbox/cardcheckbox.component.d.ts +21 -15
  14. package/dist/components/cardcheckbox/cardcheckbox.component.js +21 -15
  15. package/dist/components/cardradio/cardradio.component.d.ts +21 -15
  16. package/dist/components/cardradio/cardradio.component.js +21 -15
  17. package/dist/custom-elements.json +87 -69
  18. package/dist/react/alertchip/index.d.ts +5 -5
  19. package/dist/react/alertchip/index.js +5 -5
  20. package/dist/react/card/index.d.ts +13 -23
  21. package/dist/react/card/index.js +13 -23
  22. package/dist/react/cardbutton/index.d.ts +13 -9
  23. package/dist/react/cardbutton/index.js +13 -9
  24. package/dist/react/cardcheckbox/index.d.ts +18 -14
  25. package/dist/react/cardcheckbox/index.js +18 -14
  26. package/dist/react/cardradio/index.d.ts +19 -14
  27. package/dist/react/cardradio/index.js +19 -14
  28. package/dist/utils/mixins/CardComponentMixin.js +7 -2
  29. package/package.json +1 -1
@@ -6,7 +6,7 @@ declare const AlertChip_base: import("../../utils/mixins/index.types").Construct
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 - neutral, warning, error, success, and informational
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,18 +23,18 @@ declare const AlertChip_base: import("../../utils/mixins/index.types").Construct
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 chip is clicked.
27
- * @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the chip.
28
- * @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the chip.
29
- * @event focus - (React: onFocus) This event is dispatched when the chip receives focus.
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
  declare class AlertChip extends AlertChip_base {
32
32
  /**
33
33
  * The variant of the alertchip. It supports 5 variants
34
34
  * - neutral
35
- * - warning
36
35
  * - error
37
36
  * - success
37
+ * - warning
38
38
  * - informational
39
39
  *
40
40
  * @default neutral
@@ -46,7 +46,7 @@ declare class AlertChip extends AlertChip_base {
46
46
  * We recommend limiting the <b>maximum length of the label text to 20 characters</b>,
47
47
  * including empty spaces to split words.
48
48
  */
49
- label: string;
49
+ label?: string;
50
50
  connectedCallback(): void;
51
51
  render(): import("lit-html").TemplateResult<1>;
52
52
  static styles: Array<CSSResult>;
@@ -19,7 +19,7 @@ import { getAlertIcon } from './alertchip.utils';
19
19
  * mdc-alertchip component is an interactive chip that consumers can use to represent an alert.
20
20
  *
21
21
  * - It supports a leading icon along with label.
22
- * - It supports 5 variants of alerts - neutral, warning, error, success, and informational
22
+ * - It supports 5 variants of alerts - error, informational, neutral, success and warning.
23
23
  *
24
24
  * This component is built by extending Buttonsimple.
25
25
  *
@@ -36,10 +36,10 @@ import { getAlertIcon } from './alertchip.utils';
36
36
  * @csspart icon - The alert icon
37
37
  * @csspart label - The text label of the alertchip
38
38
  *
39
- * @event click - (React: onClick) This event is dispatched when the chip is clicked.
40
- * @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the chip.
41
- * @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the chip.
42
- * @event focus - (React: onFocus) This event is dispatched when the chip receives focus.
39
+ * @event click - (React: onClick) This event is dispatched when the alertchip is clicked.
40
+ * @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the alertchip.
41
+ * @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the alertchip.
42
+ * @event focus - (React: onFocus) This event is dispatched when the alertchip receives focus.
43
43
  */
44
44
  class AlertChip extends IconNameMixin(Buttonsimple) {
45
45
  constructor() {
@@ -47,21 +47,14 @@ class AlertChip extends IconNameMixin(Buttonsimple) {
47
47
  /**
48
48
  * The variant of the alertchip. It supports 5 variants
49
49
  * - neutral
50
- * - warning
51
50
  * - error
52
51
  * - success
52
+ * - warning
53
53
  * - informational
54
54
  *
55
55
  * @default neutral
56
56
  */
57
57
  this.variant = DEFAULTS.VARIANT;
58
- /**
59
- * The visible label text of the alertchip.
60
- *
61
- * We recommend limiting the <b>maximum length of the label text to 20 characters</b>,
62
- * including empty spaces to split words.
63
- */
64
- this.label = '';
65
58
  }
66
59
  connectedCallback() {
67
60
  super.connectedCallback();
@@ -89,6 +82,6 @@ __decorate([
89
82
  ], AlertChip.prototype, "variant", void 0);
90
83
  __decorate([
91
84
  property({ type: String }),
92
- __metadata("design:type", Object)
85
+ __metadata("design:type", String)
93
86
  ], AlertChip.prototype, "label", void 0);
94
87
  export default AlertChip;
@@ -1,3 +1,4 @@
1
+ import { ROLE } from '../../utils/roles';
1
2
  import utils from '../../utils/tag-name';
2
3
  import { BUTTON_SIZES } from '../buttonsimple/buttonsimple.constants';
3
4
  import { TYPE, VALID_TEXT_TAGS } from '../text/text.constants';
@@ -14,6 +15,6 @@ const DEFAULTS = {
14
15
  TEXT_TYPE: TYPE.BODY_MIDSIZE_REGULAR,
15
16
  TAG_NAME: VALID_TEXT_TAGS.SPAN,
16
17
  SIZE: BUTTON_SIZES[24],
17
- ROLE: 'button',
18
+ ROLE: ROLE.BUTTON,
18
19
  };
19
20
  export { DEFAULTS, TAG_NAME, VARIANTS };
@@ -3,7 +3,7 @@ import type { IconNames } from '../icon/icon.types';
3
3
  import type AlertChip from './alertchip.component';
4
4
  import { VARIANTS } from './alertchip.constants';
5
5
  type VariantType = ValueOf<typeof VARIANTS>;
6
- type IconListType = Extract<IconNames, 'error-legacy-badge-filled' | 'warning-badge-filled' | 'check-circle-badge-filled' | 'dnd-presence-badge-filled' | 'info-badge-filled'>;
6
+ type IconListType = Extract<IconNames, 'error-legacy-badge-filled' | 'info-badge-filled' | 'dnd-presence-badge-filled' | 'check-circle-badge-filled' | 'warning-badge-filled'>;
7
7
  interface Events {
8
8
  onClickEvent: OverrideEventTarget<MouseEvent, AlertChip>;
9
9
  onKeyDownEvent: OverrideEventTarget<KeyboardEvent, AlertChip>;
@@ -2,10 +2,10 @@ import { VARIANTS } from './alertchip.constants';
2
2
  const getAlertIcon = (type) => {
3
3
  const alertIcon = {
4
4
  [VARIANTS.ERROR]: 'error-legacy-badge-filled',
5
- [VARIANTS.WARNING]: 'warning-badge-filled',
6
- [VARIANTS.SUCCESS]: 'check-circle-badge-filled',
7
5
  [VARIANTS.INFORMATIONAL]: 'info-badge-filled',
8
6
  [VARIANTS.NEUTRAL]: 'dnd-presence-badge-filled',
7
+ [VARIANTS.SUCCESS]: 'check-circle-badge-filled',
8
+ [VARIANTS.WARNING]: 'warning-badge-filled',
9
9
  };
10
10
  return alertIcon[type];
11
11
  };
@@ -67,7 +67,7 @@ declare class Buttonsimple extends Buttonsimple_base {
67
67
  * a comma separated string.
68
68
  * For example: `aria-pressed,aria-expanded`
69
69
  *
70
- * @default 'aria-pressed' (when)
70
+ * @default 'aria-pressed'
71
71
  */
72
72
  ariaStateKey?: string;
73
73
  /**
@@ -3,32 +3,28 @@ import { Component } from '../../models';
3
3
  declare const Card_base: import("../../utils/mixins/index.types").Constructor<import("../../utils/mixins/CardComponentMixin").CardComponentMixinInterface> & import("../../utils/mixins/index.types").Constructor<import("../../utils/mixins/FooterMixin").FooterMixinInterface> & typeof Component;
4
4
  /**
5
5
  * The card component allows users to organize information in a structured and tangible
6
- * format that is visually appealing. `mdc-card` is a static component that supports
7
- * the following features:
8
- * - Image
9
- * - Header
10
- * - Icon
11
- * - Title
12
- * - Subtitle
13
- * - Body
6
+ * format that is visually appealing. `mdc-card` is a static component.
14
7
  *
15
- * The card can either be vertically or horizontally oriented. The vertical card has a min-width of 20rem and the horizontal card has a min-width of 40rem.
8
+ * ## Card Structure
9
+ * - **Image**: Optional visual content at the top
10
+ * - **Header**: Contains icon, title, subtitle, and action buttons
11
+ * - **Body**: Main text content area
12
+ * - **Footer**: Optional footer with links and buttons
16
13
  *
17
- * There are 2 variants for the card that represent the border styling - 'border' and 'ghost'.
14
+ * ## Features
15
+ * - Supports two orientations (vertical and horizontal) and three visual variants (border, ghost, and promotional).
16
+ * - Can be made interactive by adding elements to slots like `icon-button`, `footer-link`, and footer buttons.
18
17
  *
19
- * To make this card interactive, use the following slots:
20
- * - `icon-button`: This slot supports action icon buttons in the header section (maximum of 3 buttons).
21
- * - `footer-link`: This slot is for passing `mdc-link` component within the footer section.
22
- * - `footer-button-primary`: This slot is for passing primary variant of `mdc-button` component within the footer section.
23
- * - `footer-button-secondary`: This slot is for passing secondary variant of `mdc-button` component
24
- * within the footer section.
18
+ * @tagname mdc-card
25
19
  *
26
- * Interactive card additionally supports 'promotional' variant that represents the border styling - 'promotional'.
20
+ * @dependency mdc-icon
21
+ * @dependency mdc-text
27
22
  *
28
23
  * @slot image - This slot is for overriding the image content of the card
29
24
  * @slot before-body - This slot is for passing the content before the body
30
25
  * @slot body - This slot is for passing the text content for the card
31
26
  * @slot after-body - This slot is for passing the content after the body
27
+ * @slot icon-button - This slot supports action icon buttons in the header section (maximum of 3 buttons)
32
28
  * @slot footer-link - This slot is for passing `mdc-link` component within the footer section.
33
29
  * @slot footer-button-primary - This slot is for passing primary variant of
34
30
  * `mdc-button` component within the footer section.
@@ -48,13 +44,7 @@ declare const Card_base: import("../../utils/mixins/index.types").Constructor<im
48
44
  * @csspart icon-button - The icon button part of the card header
49
45
  * @csspart text - The text part of the card
50
46
  *
51
- * @tagname mdc-card
52
- *
53
- * @dependency mdc-icon
54
- * @dependency mdc-text
55
- *
56
47
  * @cssproperty --mdc-card-width - The width of the card
57
- *
58
48
  */
59
49
  declare class Card extends Card_base {
60
50
  /**
@@ -17,32 +17,28 @@ import { DEFAULTS } from './card.constants';
17
17
  import styles from './card.styles';
18
18
  /**
19
19
  * The card component allows users to organize information in a structured and tangible
20
- * format that is visually appealing. `mdc-card` is a static component that supports
21
- * the following features:
22
- * - Image
23
- * - Header
24
- * - Icon
25
- * - Title
26
- * - Subtitle
27
- * - Body
20
+ * format that is visually appealing. `mdc-card` is a static component.
28
21
  *
29
- * The card can either be vertically or horizontally oriented. The vertical card has a min-width of 20rem and the horizontal card has a min-width of 40rem.
22
+ * ## Card Structure
23
+ * - **Image**: Optional visual content at the top
24
+ * - **Header**: Contains icon, title, subtitle, and action buttons
25
+ * - **Body**: Main text content area
26
+ * - **Footer**: Optional footer with links and buttons
30
27
  *
31
- * There are 2 variants for the card that represent the border styling - 'border' and 'ghost'.
28
+ * ## Features
29
+ * - Supports two orientations (vertical and horizontal) and three visual variants (border, ghost, and promotional).
30
+ * - Can be made interactive by adding elements to slots like `icon-button`, `footer-link`, and footer buttons.
32
31
  *
33
- * To make this card interactive, use the following slots:
34
- * - `icon-button`: This slot supports action icon buttons in the header section (maximum of 3 buttons).
35
- * - `footer-link`: This slot is for passing `mdc-link` component within the footer section.
36
- * - `footer-button-primary`: This slot is for passing primary variant of `mdc-button` component within the footer section.
37
- * - `footer-button-secondary`: This slot is for passing secondary variant of `mdc-button` component
38
- * within the footer section.
32
+ * @tagname mdc-card
39
33
  *
40
- * Interactive card additionally supports 'promotional' variant that represents the border styling - 'promotional'.
34
+ * @dependency mdc-icon
35
+ * @dependency mdc-text
41
36
  *
42
37
  * @slot image - This slot is for overriding the image content of the card
43
38
  * @slot before-body - This slot is for passing the content before the body
44
39
  * @slot body - This slot is for passing the text content for the card
45
40
  * @slot after-body - This slot is for passing the content after the body
41
+ * @slot icon-button - This slot supports action icon buttons in the header section (maximum of 3 buttons)
46
42
  * @slot footer-link - This slot is for passing `mdc-link` component within the footer section.
47
43
  * @slot footer-button-primary - This slot is for passing primary variant of
48
44
  * `mdc-button` component within the footer section.
@@ -62,13 +58,7 @@ import styles from './card.styles';
62
58
  * @csspart icon-button - The icon button part of the card header
63
59
  * @csspart text - The text part of the card
64
60
  *
65
- * @tagname mdc-card
66
- *
67
- * @dependency mdc-icon
68
- * @dependency mdc-text
69
- *
70
61
  * @cssproperty --mdc-card-width - The width of the card
71
- *
72
62
  */
73
63
  class Card extends CardComponentMixin(FooterMixin(Component)) {
74
64
  constructor() {
@@ -4,21 +4,18 @@ declare const CardButton_base: import("../../utils/mixins/index.types").Construc
4
4
  /**
5
5
  * cardbutton component looks like a card and behaves as a button component.
6
6
  *
7
- * **Note**: This is a single selection card i.e. interacting anywhere on the card would trigger the click event.
8
- * Make sure to pass only non-interactable elements within the slots.
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 @@ declare const CardButton_base: import("../../utils/mixins/index.types").Construc
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
@@ -6,21 +6,18 @@ import styles from './cardbutton.styles';
6
6
  /**
7
7
  * cardbutton component looks like a card and behaves as a button component.
8
8
  *
9
- * **Note**: This is a single selection card i.e. interacting anywhere on the card would trigger the click event.
10
- * Make sure to pass only non-interactable elements within the slots.
9
+ * ## Features
10
+ * - Supports two orientations (vertical and horizontal) and three visual variants (border, ghost, and promotional).
11
+ * - Interacting anywhere on the card triggers the click event.
12
+ * - Use `name` and `value` attributes when using within forms.
13
+ *
14
+ * **Note**: Only pass non-interactable elements within the slots to avoid nested interactive elements.
11
15
  *
12
16
  * @tagname mdc-cardbutton
13
17
  *
14
18
  * @dependency mdc-icon
15
19
  * @dependency mdc-text
16
20
  *
17
- * @event click - (React: onClick) Event that gets dispatched when the card is clicked.
18
- * @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the card.
19
- * It fires the click event when enter key is used.
20
- * @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the card.
21
- * It fires the click event when space key is used.
22
- * @event focus - (React: onFocus) Event that gets dispatched when the card receives focus.
23
- *
24
21
  * @slot image - This slot is for overriding the image content of the card
25
22
  * @slot before-body - This slot is for passing the content before the body
26
23
  * @slot body - This slot is for passing the text content for the card
@@ -28,6 +25,13 @@ import styles from './cardbutton.styles';
28
25
  * @slot footer-link - This slot is for passing `mdc-link` component within the footer section.
29
26
  * @slot footer-button-primary - This slot is for passing primary variant of `mdc-button` component within the footer section.
30
27
  *
28
+ * @event click - (React: onClick) Event that gets dispatched when the card is clicked.
29
+ * @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the card.
30
+ * It fires the click event when enter key is used.
31
+ * @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the card.
32
+ * It fires the click event when space key is used.
33
+ * @event focus - (React: onFocus) Event that gets dispatched when the card receives focus.
34
+ *
31
35
  * @csspart header - The header part of the card
32
36
  * @csspart icon - The icon part of the card header
33
37
  * @csspart body - The body part of the card
@@ -3,15 +3,19 @@ import Card from '../card/card.component';
3
3
  import type { SelectionType } from './cardcheckbox.types';
4
4
  declare const CardCheckbox_base: import("../../utils/mixins/index.types").Constructor<import("../../utils/mixins/DisabledMixin").DisabledMixinInterface> & import("../../utils/mixins/index.types").Constructor<import("../../utils/mixins/TabIndexMixin").TabIndexMixinInterface> & typeof Card;
5
5
  /**
6
- * cardcheckbox component extends `mdc-card` and supports checkbox selection interaction addtionally.
6
+ * cardcheckbox component extends `mdc-card` and supports checkbox selection interaction.
7
+ * Multiple cards can be checked simultaneously.
7
8
  *
8
- * While using this component within a form or group of cards, make sure cards are in a role = "checkbox-group".
9
- * This card would have events for selected and unselected (similar to checkbox)
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
- * **Note**: This is a single selection card i.e. interacting anywhere on the card would toggle the checked state.
12
- * Make sure to pass only non-interactable elements within the slots.
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
- * Make sure to pass the `card-title` mandatorily for this card.
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 @@ declare const CardCheckbox_base: import("../../utils/mixins/index.types").Constr
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 @@ declare const CardCheckbox_base: import("../../utils/mixins/index.types").Constr
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
  declare class CardCheckbox extends CardCheckbox_base {
53
57
  /**
@@ -56,7 +60,9 @@ declare class CardCheckbox extends CardCheckbox_base {
56
60
  */
57
61
  checked: boolean;
58
62
  /**
59
- * The selection type of the card. It can either be set to 'check' or 'checkbox'
63
+ * The selection type of the card that determines the visual indicator.
64
+ * - `check`: Shows a check icon when selected
65
+ * - `checkbox`: Shows a checkbox component when selected or unselected
60
66
  * @default 'check'
61
67
  */
62
68
  selectionType: SelectionType;
@@ -17,15 +17,19 @@ import { KEYS } from '../../utils/keys';
17
17
  import { CHECK_MARK, DEFAULTS, SELECTION_TYPE } from './cardcheckbox.constants';
18
18
  import styles from './cardcheckbox.styles';
19
19
  /**
20
- * cardcheckbox component extends `mdc-card` and supports checkbox selection interaction addtionally.
20
+ * cardcheckbox component extends `mdc-card` and supports checkbox selection interaction.
21
+ * Multiple cards can be checked simultaneously.
21
22
  *
22
- * While using this component within a form or group of cards, make sure cards are in a role = "checkbox-group".
23
- * This card would have events for selected and unselected (similar to checkbox)
23
+ * ## Features
24
+ * - Supports two orientations (vertical and horizontal), three visual variants (border, ghost, and promotional), and two selection types (check icon or checkbox component).
25
+ * - Interacting anywhere on the card toggles the checked state and dispatches a `change` event.
26
+ * - Card has `role="checkbox"` and manages `aria-checked` and `aria-disabled` attributes automatically.
24
27
  *
25
- * **Note**: This is a single selection card i.e. interacting anywhere on the card would toggle the checked state.
26
- * Make sure to pass only non-interactable elements within the slots.
28
+ * ## Usage
29
+ * - The `card-title` attribute is required.
30
+ * - When using within a form or group, wrap cards in a container with `role="group"` and provide an `aria-label`.
27
31
  *
28
- * Make sure to pass the `card-title` mandatorily for this card.
32
+ * **Note**: Only pass non-interactable elements within the slots to avoid nested interactive elements.
29
33
  *
30
34
  * @tagname mdc-cardcheckbox
31
35
  *
@@ -39,6 +43,14 @@ import styles from './cardcheckbox.styles';
39
43
  * @slot footer-link - This slot is for passing `mdc-link` component within the footer section.
40
44
  * @slot footer-button-primary - This slot is for passing primary variant of `mdc-button` component within the footer section.
41
45
  *
46
+ * @event click - (React: onClick) Event that gets dispatched when the card is clicked. It toggles the checked state.
47
+ * @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the card.
48
+ * It toggles the checked state when enter key is used.
49
+ * @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the card.
50
+ * It toggles the checked state when space key is used.
51
+ * @event focus - (React: onFocus) Event that gets dispatched when the card receives focus.
52
+ * @event change - (React: onChange) Event that gets dispatched when the card's checked state changes.
53
+ *
42
54
  * @csspart header - The header part of the card
43
55
  * @csspart icon - The icon part of the card header
44
56
  * @csspart body - The body part of the card
@@ -54,14 +66,6 @@ import styles from './cardcheckbox.styles';
54
66
  * @csspart check-icon-button - The check icon button part of the card
55
67
  *
56
68
  * @cssproperty --mdc-card-width - The width of the card
57
- *
58
- * @event click - (React: onClick) Event that gets dispatched when the card is clicked. It toggles the checked state.
59
- * @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the card.
60
- * It toggles the checked state when enter key is used.
61
- * @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the card.
62
- * It toggles the checked state when space key is used.
63
- * @event focus - (React: onFocus) Event that gets dispatched when the card receives focus.
64
- * @event change - (React: onChange) Event that gets dispatched when the card's checked state changes.
65
69
  */
66
70
  class CardCheckbox extends DisabledMixin(TabIndexMixin(Card)) {
67
71
  constructor() {
@@ -72,7 +76,9 @@ class CardCheckbox extends DisabledMixin(TabIndexMixin(Card)) {
72
76
  */
73
77
  this.checked = false;
74
78
  /**
75
- * The selection type of the card. It can either be set to 'check' or 'checkbox'
79
+ * The selection type of the card that determines the visual indicator.
80
+ * - `check`: Shows a check icon when selected
81
+ * - `checkbox`: Shows a checkbox component when selected or unselected
76
82
  * @default 'check'
77
83
  */
78
84
  this.selectionType = DEFAULTS.SELECTION_TYPE;
@@ -2,15 +2,20 @@ import { CSSResult, nothing, PropertyValues } from 'lit';
2
2
  import Card from '../card/card.component';
3
3
  declare const CardRadio_base: import("../../utils/mixins/index.types").Constructor<import("../../utils/mixins/DisabledMixin").DisabledMixinInterface> & import("../../utils/mixins/index.types").Constructor<import("../../utils/mixins/TabIndexMixin").TabIndexMixinInterface> & typeof Card;
4
4
  /**
5
- * cardradio component extends `mdc-card` and supports radio selection interaction addtionally.
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
- * While using this component within a form or group of cards, make sure cards are in a role = "radio-group".
8
- * This card would have events for selected and unselected (similar to radio)
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
- * **Note**: This is a single selection card i.e. interacting anywhere on the card would toggle the checked state.
11
- * Make sure to pass only non-interactable elements within the slots.
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
- * Make sure to pass the `card-title` mandatorily for this card.
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 @@ declare const CardRadio_base: import("../../utils/mixins/index.types").Construct
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 @@ declare const CardRadio_base: import("../../utils/mixins/index.types").Construct
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 class CardRadio extends CardRadio_base {
52
57
  /**
@@ -55,7 +60,8 @@ declare class CardRadio extends CardRadio_base {
55
60
  */
56
61
  checked: boolean;
57
62
  /**
58
- * The name of the radio.
63
+ * The name of the radio group. Cards with the same name are grouped together,
64
+ * ensuring only one card in the group can be selected at a time.
59
65
  * @default ''
60
66
  */
61
67
  name: string;
@@ -17,15 +17,20 @@ import { ROLE } from '../../utils/roles';
17
17
  import { KEYS } from '../../utils/keys';
18
18
  import styles from './cardradio.styles';
19
19
  /**
20
- * cardradio component extends `mdc-card` and supports radio selection interaction addtionally.
20
+ * cardradio component extends `mdc-card` and supports radio selection interaction.
21
+ * Only one card can be selected at a time within the same group (defined by `name` attribute).
21
22
  *
22
- * While using this component within a form or group of cards, make sure cards are in a role = "radio-group".
23
- * This card would have events for selected and unselected (similar to radio)
23
+ * ## Features
24
+ * - Supports two orientations (vertical and horizontal) and three visual variants (border, ghost, and promotional).
25
+ * - Selecting a card automatically unselects other cards in the same group and dispatches a `change` event.
26
+ * - Supports keyboard navigation with arrow keys to move between cards in the same group.
27
+ * - Card has `role="radio"` and manages `aria-checked` and `aria-disabled` attributes automatically.
24
28
  *
25
- * **Note**: This is a single selection card i.e. interacting anywhere on the card would toggle the checked state.
26
- * Make sure to pass only non-interactable elements within the slots.
29
+ * ## Usage
30
+ * - Both `card-title` and `name` attributes are required.
31
+ * - When using within a form or group, wrap cards in a container with `role="radiogroup"` and provide an `aria-label`.
27
32
  *
28
- * Make sure to pass the `card-title` mandatorily for this card.
33
+ * **Note**: Only pass non-interactable elements within the slots to avoid nested interactive elements.
29
34
  *
30
35
  * @tagname mdc-cardradio
31
36
  *
@@ -39,6 +44,14 @@ import styles from './cardradio.styles';
39
44
  * @slot footer-link - This slot is for passing `mdc-link` component within the footer section.
40
45
  * @slot footer-button-primary - This slot is for passing primary variant of `mdc-button` component within the footer section.
41
46
  *
47
+ * @event click - (React: onClick) Event that gets dispatched when the card is clicked. It selects the card and unselects others in the same group.
48
+ * @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the card.
49
+ * It selects the card when enter key or arrow keys are used.
50
+ * @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the card.
51
+ * It selects the card when space key is used.
52
+ * @event focus - (React: onFocus) Event that gets dispatched when the card receives focus.
53
+ * @event change - (React: onChange) Event that gets dispatched when the card's checked state changes.
54
+ *
42
55
  * @csspart header - The header part of the card
43
56
  * @csspart icon - The icon part of the card header
44
57
  * @csspart body - The body part of the card
@@ -54,14 +67,6 @@ import styles from './cardradio.styles';
54
67
  * @csspart check-icon-button - The check icon button part of the card
55
68
  *
56
69
  * @cssproperty --mdc-card-width - The width of the card
57
- *
58
- * @event click - (React: onClick) Event that gets dispatched when the card is clicked. It toggles the checked state.
59
- * @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the card.
60
- * It toggles the checked state when enter key is used.
61
- * @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the card.
62
- * It toggles the checked state when space key is used.
63
- * @event focus - (React: onFocus) Event that gets dispatched when the card receives focus.
64
- * @event change - (React: onChange) Event that gets dispatched when the card's checked state changes.
65
70
  */
66
71
  class CardRadio extends DisabledMixin(TabIndexMixin(Card)) {
67
72
  constructor() {
@@ -72,7 +77,8 @@ class CardRadio extends DisabledMixin(TabIndexMixin(Card)) {
72
77
  */
73
78
  this.checked = false;
74
79
  /**
75
- * The name of the radio.
80
+ * The name of the radio group. Cards with the same name are grouped together,
81
+ * ensuring only one card in the group can be selected at a time.
76
82
  * @default ''
77
83
  */
78
84
  this.name = '';