@momentum-design/components 0.104.11 → 0.104.12

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.
@@ -47,7 +47,7 @@ declare const CardCheckbox_base: import("../../utils/mixins/index.types").Constr
47
47
  * @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the card.
48
48
  * It toggles the checked state when space key is used.
49
49
  * @event focus - (React: onFocus) Event that gets dispatched when the card receives focus.
50
- *
50
+ * @event change - (React: onChange) Event that gets dispatched when the card's checked state changes.
51
51
  */
52
52
  declare class CardCheckbox extends CardCheckbox_base {
53
53
  /**
@@ -61,7 +61,7 @@ import styles from './cardcheckbox.styles';
61
61
  * @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the card.
62
62
  * It toggles the checked state when space key is used.
63
63
  * @event focus - (React: onFocus) Event that gets dispatched when the card receives focus.
64
- *
64
+ * @event change - (React: onChange) Event that gets dispatched when the card's checked state changes.
65
65
  */
66
66
  class CardCheckbox extends DisabledMixin(TabIndexMixin(Card)) {
67
67
  constructor() {
@@ -101,6 +101,7 @@ class CardCheckbox extends DisabledMixin(TabIndexMixin(Card)) {
101
101
  if (!this.disabled) {
102
102
  this.checked = !this.checked;
103
103
  }
104
+ this.dispatchEvent(new Event('change', { bubbles: true, composed: true }));
104
105
  }
105
106
  /**
106
107
  * Toggles the checked state when enter key is used
@@ -1,11 +1,13 @@
1
- import type { OverrideEventTarget, ValueOf } from '../../utils/types';
1
+ import type { OverrideEventTarget, TypedCustomEvent, ValueOf } from '../../utils/types';
2
2
  import type CardCheckbox from './cardcheckbox.component';
3
3
  import { SELECTION_TYPE } from './cardcheckbox.constants';
4
4
  type SelectionType = ValueOf<typeof SELECTION_TYPE>;
5
+ type CardCheckboxChangeEvent = TypedCustomEvent<CardCheckbox>;
5
6
  interface Events {
6
7
  onClickEvent: OverrideEventTarget<MouseEvent, CardCheckbox>;
7
8
  onKeyDownEvent: OverrideEventTarget<KeyboardEvent, CardCheckbox>;
8
9
  onKeyUpEvent: OverrideEventTarget<KeyboardEvent, CardCheckbox>;
9
10
  onFocusEvent: OverrideEventTarget<FocusEvent, CardCheckbox>;
11
+ onChangeEvent: CardCheckboxChangeEvent;
10
12
  }
11
13
  export { SelectionType, Events };
@@ -46,7 +46,7 @@ declare const CardRadio_base: import("../../utils/mixins/index.types").Construct
46
46
  * @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the card.
47
47
  * It toggles the checked state when space key is used.
48
48
  * @event focus - (React: onFocus) Event that gets dispatched when the card receives focus.
49
- *
49
+ * @event change - (React: onChange) Event that gets dispatched when the card's checked state changes.
50
50
  */
51
51
  declare class CardRadio extends CardRadio_base {
52
52
  /**
@@ -61,7 +61,7 @@ import styles from './cardradio.styles';
61
61
  * @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the card.
62
62
  * It toggles the checked state when space key is used.
63
63
  * @event focus - (React: onFocus) Event that gets dispatched when the card receives focus.
64
- *
64
+ * @event change - (React: onChange) Event that gets dispatched when the card's checked state changes.
65
65
  */
66
66
  class CardRadio extends DisabledMixin(TabIndexMixin(Card)) {
67
67
  constructor() {
@@ -96,7 +96,7 @@ class CardRadio extends DisabledMixin(TabIndexMixin(Card)) {
96
96
  * Dispatches the change event.
97
97
  */
98
98
  toggleChecked() {
99
- if (this.disabled)
99
+ if (this.disabled || this.checked)
100
100
  return;
101
101
  const cards = this.getAllCardsWithinSameGroup();
102
102
  cards.forEach(card => {
@@ -106,6 +106,7 @@ class CardRadio extends DisabledMixin(TabIndexMixin(Card)) {
106
106
  card.checked = false;
107
107
  });
108
108
  this.checked = true;
109
+ this.dispatchEvent(new Event('change', { bubbles: true, composed: true }));
109
110
  }
110
111
  setDisabled(disabled) {
111
112
  this.setAttribute('aria-disabled', `${disabled}`);
@@ -1,9 +1,11 @@
1
- import type { OverrideEventTarget } from '../../utils/types';
1
+ import type { OverrideEventTarget, TypedCustomEvent } from '../../utils/types';
2
2
  import type CardRadio from './cardradio.component';
3
+ type CardRadioChangeEvent = TypedCustomEvent<CardRadio>;
3
4
  interface Events {
4
5
  onClickEvent: OverrideEventTarget<MouseEvent, CardRadio>;
5
6
  onKeyDownEvent: OverrideEventTarget<KeyboardEvent, CardRadio>;
6
7
  onKeyUpEvent: OverrideEventTarget<KeyboardEvent, CardRadio>;
7
8
  onFocusEvent: OverrideEventTarget<FocusEvent, CardRadio>;
9
+ onChangeEvent: CardRadioChangeEvent;
8
10
  }
9
11
  export type { Events };
@@ -6873,6 +6873,14 @@
6873
6873
  }
6874
6874
  ],
6875
6875
  "events": [
6876
+ {
6877
+ "name": "change",
6878
+ "type": {
6879
+ "text": "Event"
6880
+ },
6881
+ "description": "(React: onChange) Event that gets dispatched when the card's checked state changes.",
6882
+ "reactName": "onChange"
6883
+ },
6876
6884
  {
6877
6885
  "description": "(React: onClick) Event that gets dispatched when the card is clicked. It toggles the checked state.",
6878
6886
  "name": "click",
@@ -7071,7 +7079,7 @@
7071
7079
  "module": "/src/components/card/card.component"
7072
7080
  },
7073
7081
  "tagName": "mdc-cardcheckbox",
7074
- "jsDoc": "/**\n * cardcheckbox component extends `mdc-card` and supports checkbox selection interaction addtionally.\n *\n * While using this component within a form or group of cards, make sure cards are in a role = \"checkbox-group\".\n * This card would have events for selected and unselected (similar to checkbox)\n *\n * **Note**: This is a single selection card i.e. interacting anywhere on the card would toggle the checked state.\n * Make sure to pass only non-interactable elements within the slots.\n *\n * Make sure to pass the `card-title` mandatorily for this card.\n *\n * @tagname mdc-cardcheckbox\n *\n * @dependency mdc-icon\n * @dependency mdc-staticcheckbox\n * @dependency mdc-text\n *\n * @slot before-body - This slot is for passing the content before the body\n * @slot body - This slot is for passing the text content for the card\n * @slot after-body - This slot is for passing the content after the body\n * @slot footer-link - This slot is for passing `mdc-link` component within the footer section.\n * @slot footer-button-primary - This slot is for passing primary variant of `mdc-button` component within the footer section.\n *\n * @csspart header - The header part of the card\n * @csspart icon - The icon part of the card header\n * @csspart body - The body part of the card\n * @csspart image - The image part of the card\n * @csspart footer - The footer part of the card\n * @csspart footer-link - The link part of the card footer\n * @csspart footer-button-primary - The primary button part of the card footer\n * @csspart footer-button-secondary - The secondary button part of the card footer\n * @csspart icon-button - The icon button part of the card header\n * @csspart text - The text part of the card\n * @csspart check - The check part of the card\n * @csspart check-icon - The check icon part of the card\n * @csspart check-icon-button - The check icon button part of the card\n *\n * @cssproperty --mdc-card-width - The width of the card\n *\n * @event click - (React: onClick) Event that gets dispatched when the card is clicked. It toggles the checked state.\n * @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the card.\n * It toggles the checked state when enter key is used.\n * @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the card.\n * It toggles the checked state when space key is used.\n * @event focus - (React: onFocus) Event that gets dispatched when the card receives focus.\n *\n */",
7082
+ "jsDoc": "/**\n * cardcheckbox component extends `mdc-card` and supports checkbox selection interaction addtionally.\n *\n * While using this component within a form or group of cards, make sure cards are in a role = \"checkbox-group\".\n * This card would have events for selected and unselected (similar to checkbox)\n *\n * **Note**: This is a single selection card i.e. interacting anywhere on the card would toggle the checked state.\n * Make sure to pass only non-interactable elements within the slots.\n *\n * Make sure to pass the `card-title` mandatorily for this card.\n *\n * @tagname mdc-cardcheckbox\n *\n * @dependency mdc-icon\n * @dependency mdc-staticcheckbox\n * @dependency mdc-text\n *\n * @slot before-body - This slot is for passing the content before the body\n * @slot body - This slot is for passing the text content for the card\n * @slot after-body - This slot is for passing the content after the body\n * @slot footer-link - This slot is for passing `mdc-link` component within the footer section.\n * @slot footer-button-primary - This slot is for passing primary variant of `mdc-button` component within the footer section.\n *\n * @csspart header - The header part of the card\n * @csspart icon - The icon part of the card header\n * @csspart body - The body part of the card\n * @csspart image - The image part of the card\n * @csspart footer - The footer part of the card\n * @csspart footer-link - The link part of the card footer\n * @csspart footer-button-primary - The primary button part of the card footer\n * @csspart footer-button-secondary - The secondary button part of the card footer\n * @csspart icon-button - The icon button part of the card header\n * @csspart text - The text part of the card\n * @csspart check - The check part of the card\n * @csspart check-icon - The check icon part of the card\n * @csspart check-icon-button - The check icon button part of the card\n *\n * @cssproperty --mdc-card-width - The width of the card\n *\n * @event click - (React: onClick) Event that gets dispatched when the card is clicked. It toggles the checked state.\n * @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the card.\n * It toggles the checked state when enter key is used.\n * @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the card.\n * It toggles the checked state when space key is used.\n * @event focus - (React: onFocus) Event that gets dispatched when the card receives focus.\n * @event change - (React: onChange) Event that gets dispatched when the card's checked state changes.\n */",
7075
7083
  "customElement": true
7076
7084
  }
7077
7085
  ],
@@ -7612,6 +7620,14 @@
7612
7620
  }
7613
7621
  ],
7614
7622
  "events": [
7623
+ {
7624
+ "name": "change",
7625
+ "type": {
7626
+ "text": "Event"
7627
+ },
7628
+ "description": "(React: onChange) Event that gets dispatched when the card's checked state changes.",
7629
+ "reactName": "onChange"
7630
+ },
7615
7631
  {
7616
7632
  "description": "(React: onClick) Event that gets dispatched when the card is clicked. It toggles the checked state.",
7617
7633
  "name": "click",
@@ -7810,7 +7826,7 @@
7810
7826
  "module": "/src/components/card/card.component"
7811
7827
  },
7812
7828
  "tagName": "mdc-cardradio",
7813
- "jsDoc": "/**\n * cardradio component extends `mdc-card` and supports radio selection interaction addtionally.\n *\n * While using this component within a form or group of cards, make sure cards are in a role = \"radio-group\".\n * This card would have events for selected and unselected (similar to radio)\n *\n * **Note**: This is a single selection card i.e. interacting anywhere on the card would toggle the checked state.\n * Make sure to pass only non-interactable elements within the slots.\n *\n * Make sure to pass the `card-title` mandatorily for this card.\n *\n * @tagname mdc-cardradio\n *\n * @dependency mdc-icon\n * @dependency mdc-staticradio\n * @dependency mdc-text\n *\n * @slot before-body - This slot is for passing the content before the body\n * @slot body - This slot is for passing the text content for the card\n * @slot after-body - This slot is for passing the content after the body\n * @slot footer-link - This slot is for passing `mdc-link` component within the footer section.\n * @slot footer-button-primary - This slot is for passing primary variant of `mdc-button` component within the footer section.\n *\n * @csspart header - The header part of the card\n * @csspart icon - The icon part of the card header\n * @csspart body - The body part of the card\n * @csspart image - The image part of the card\n * @csspart footer - The footer part of the card\n * @csspart footer-link - The link part of the card footer\n * @csspart footer-button-primary - The primary button part of the card footer\n * @csspart footer-button-secondary - The secondary button part of the card footer\n * @csspart icon-button - The icon button part of the card header\n * @csspart text - The text part of the card\n * @csspart check - The check part of the card\n * @csspart check-icon - The check icon part of the card\n * @csspart check-icon-button - The check icon button part of the card\n *\n * @cssproperty --mdc-card-width - The width of the card\n *\n * @event click - (React: onClick) Event that gets dispatched when the card is clicked. It toggles the checked state.\n * @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the card.\n * It toggles the checked state when enter key is used.\n * @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the card.\n * It toggles the checked state when space key is used.\n * @event focus - (React: onFocus) Event that gets dispatched when the card receives focus.\n *\n */",
7829
+ "jsDoc": "/**\n * cardradio component extends `mdc-card` and supports radio selection interaction addtionally.\n *\n * While using this component within a form or group of cards, make sure cards are in a role = \"radio-group\".\n * This card would have events for selected and unselected (similar to radio)\n *\n * **Note**: This is a single selection card i.e. interacting anywhere on the card would toggle the checked state.\n * Make sure to pass only non-interactable elements within the slots.\n *\n * Make sure to pass the `card-title` mandatorily for this card.\n *\n * @tagname mdc-cardradio\n *\n * @dependency mdc-icon\n * @dependency mdc-staticradio\n * @dependency mdc-text\n *\n * @slot before-body - This slot is for passing the content before the body\n * @slot body - This slot is for passing the text content for the card\n * @slot after-body - This slot is for passing the content after the body\n * @slot footer-link - This slot is for passing `mdc-link` component within the footer section.\n * @slot footer-button-primary - This slot is for passing primary variant of `mdc-button` component within the footer section.\n *\n * @csspart header - The header part of the card\n * @csspart icon - The icon part of the card header\n * @csspart body - The body part of the card\n * @csspart image - The image part of the card\n * @csspart footer - The footer part of the card\n * @csspart footer-link - The link part of the card footer\n * @csspart footer-button-primary - The primary button part of the card footer\n * @csspart footer-button-secondary - The secondary button part of the card footer\n * @csspart icon-button - The icon button part of the card header\n * @csspart text - The text part of the card\n * @csspart check - The check part of the card\n * @csspart check-icon - The check icon part of the card\n * @csspart check-icon-button - The check icon button part of the card\n *\n * @cssproperty --mdc-card-width - The width of the card\n *\n * @event click - (React: onClick) Event that gets dispatched when the card is clicked. It toggles the checked state.\n * @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the card.\n * It toggles the checked state when enter key is used.\n * @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the card.\n * It toggles the checked state when space key is used.\n * @event focus - (React: onFocus) Event that gets dispatched when the card receives focus.\n * @event change - (React: onChange) Event that gets dispatched when the card's checked state changes.\n */",
7814
7830
  "customElement": true
7815
7831
  }
7816
7832
  ],
@@ -45,9 +45,12 @@ import Component from '../../components/cardcheckbox';
45
45
  * @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the card.
46
46
  * It toggles the checked state when space key is used.
47
47
  * @event focus - (React: onFocus) Event that gets dispatched when the card receives focus.
48
- *
48
+ * @event change - (React: onChange) Event that gets dispatched when the card's checked state changes.
49
49
  */
50
50
  declare const reactWrapper: import("@lit/react").ReactWebComponent<Component, {
51
+ onChange: EventName<CustomEvent<unknown> & {
52
+ target: Component;
53
+ }>;
51
54
  onClick: EventName<import("../../utils/types").OverrideEventTarget<MouseEvent, Component>>;
52
55
  onKeyDown: EventName<import("../../utils/types").OverrideEventTarget<KeyboardEvent, Component>>;
53
56
  onKeyUp: EventName<import("../../utils/types").OverrideEventTarget<KeyboardEvent, Component>>;
@@ -47,13 +47,14 @@ import { TAG_NAME } from '../../components/cardcheckbox/cardcheckbox.constants';
47
47
  * @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the card.
48
48
  * It toggles the checked state when space key is used.
49
49
  * @event focus - (React: onFocus) Event that gets dispatched when the card receives focus.
50
- *
50
+ * @event change - (React: onChange) Event that gets dispatched when the card's checked state changes.
51
51
  */
52
52
  const reactWrapper = createComponent({
53
53
  tagName: TAG_NAME,
54
54
  elementClass: Component,
55
55
  react: React,
56
56
  events: {
57
+ onChange: 'change',
57
58
  onClick: 'click',
58
59
  onKeyDown: 'keydown',
59
60
  onKeyUp: 'keyup',
@@ -45,9 +45,12 @@ import Component from '../../components/cardradio';
45
45
  * @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the card.
46
46
  * It toggles the checked state when space key is used.
47
47
  * @event focus - (React: onFocus) Event that gets dispatched when the card receives focus.
48
- *
48
+ * @event change - (React: onChange) Event that gets dispatched when the card's checked state changes.
49
49
  */
50
50
  declare const reactWrapper: import("@lit/react").ReactWebComponent<Component, {
51
+ onChange: EventName<CustomEvent<unknown> & {
52
+ target: Component;
53
+ }>;
51
54
  onClick: EventName<import("../../utils/types").OverrideEventTarget<MouseEvent, Component>>;
52
55
  onKeyDown: EventName<import("../../utils/types").OverrideEventTarget<KeyboardEvent, Component>>;
53
56
  onKeyUp: EventName<import("../../utils/types").OverrideEventTarget<KeyboardEvent, Component>>;
@@ -47,13 +47,14 @@ import { TAG_NAME } from '../../components/cardradio/cardradio.constants';
47
47
  * @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the card.
48
48
  * It toggles the checked state when space key is used.
49
49
  * @event focus - (React: onFocus) Event that gets dispatched when the card receives focus.
50
- *
50
+ * @event change - (React: onChange) Event that gets dispatched when the card's checked state changes.
51
51
  */
52
52
  const reactWrapper = createComponent({
53
53
  tagName: TAG_NAME,
54
54
  elementClass: Component,
55
55
  react: React,
56
56
  events: {
57
+ onChange: 'change',
57
58
  onClick: 'click',
58
59
  onKeyDown: 'keydown',
59
60
  onKeyUp: 'keyup',
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@momentum-design/components",
3
3
  "packageManager": "yarn@3.2.4",
4
- "version": "0.104.11",
4
+ "version": "0.104.12",
5
5
  "engines": {
6
6
  "node": ">=20.0.0",
7
7
  "npm": ">=8.0.0"