@momentum-design/components 0.104.0 → 0.104.2

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 (98) hide show
  1. package/dist/browser/index.js +86 -82
  2. package/dist/browser/index.js.map +3 -3
  3. package/dist/components/accordionbutton/accordionbutton.types.d.ts +5 -2
  4. package/dist/components/animation/animation.types.d.ts +11 -3
  5. package/dist/components/brandvisual/brandvisual.types.d.ts +8 -2
  6. package/dist/components/button/button.component.d.ts +5 -1
  7. package/dist/components/button/button.component.js +19 -11
  8. package/dist/components/buttonlink/buttonlink.types.d.ts +6 -4
  9. package/dist/components/buttonsimple/buttonsimple.types.d.ts +6 -5
  10. package/dist/components/cardbutton/cardbutton.types.d.ts +6 -4
  11. package/dist/components/cardcheckbox/cardcheckbox.component.d.ts +0 -1
  12. package/dist/components/cardcheckbox/cardcheckbox.component.js +0 -1
  13. package/dist/components/cardcheckbox/cardcheckbox.types.d.ts +6 -6
  14. package/dist/components/cardradio/cardradio.component.d.ts +0 -1
  15. package/dist/components/cardradio/cardradio.component.js +0 -1
  16. package/dist/components/cardradio/cardradio.types.d.ts +6 -5
  17. package/dist/components/checkbox/checkbox.types.d.ts +4 -2
  18. package/dist/components/dialog/dialog.types.d.ts +17 -6
  19. package/dist/components/input/input.types.d.ts +6 -6
  20. package/dist/components/inputchip/inputchip.types.d.ts +3 -1
  21. package/dist/components/link/link.types.d.ts +6 -5
  22. package/dist/components/linkbutton/linkbutton.types.d.ts +6 -5
  23. package/dist/components/linksimple/linksimple.types.d.ts +6 -4
  24. package/dist/components/listitem/listitem.types.d.ts +14 -13
  25. package/dist/components/menuitem/menuitem.component.d.ts +4 -0
  26. package/dist/components/menuitem/menuitem.component.js +4 -0
  27. package/dist/components/menuitem/menuitem.types.d.ts +10 -4
  28. package/dist/components/menuitemcheckbox/menuitemcheckbox.types.d.ts +5 -4
  29. package/dist/components/menuitemradio/menuitemradio.types.d.ts +5 -4
  30. package/dist/components/menupopover/menupopover.types.d.ts +4 -7
  31. package/dist/components/menusection/menusection.types.d.ts +3 -4
  32. package/dist/components/navmenuitem/navmenuitem.types.d.ts +10 -6
  33. package/dist/components/option/option.types.d.ts +6 -4
  34. package/dist/components/password/password.types.d.ts +6 -4
  35. package/dist/components/popover/popover.types.d.ts +5 -5
  36. package/dist/components/radio/radio.types.d.ts +4 -2
  37. package/dist/components/select/select.types.d.ts +6 -6
  38. package/dist/components/sidenavigation/sidenavigation.types.d.ts +6 -2
  39. package/dist/components/stepperitem/stepperitem.types.d.ts +5 -4
  40. package/dist/components/tab/tab.types.d.ts +6 -2
  41. package/dist/components/tablist/tablist.types.d.ts +5 -2
  42. package/dist/components/textarea/textarea.types.d.ts +7 -6
  43. package/dist/components/toast/toast.types.d.ts +3 -2
  44. package/dist/components/toggle/toggle.types.d.ts +4 -3
  45. package/dist/components/toggletip/toggletip.types.d.ts +6 -4
  46. package/dist/components/typewriter/typewriter.types.d.ts +3 -5
  47. package/dist/components/virtualizedlist/virtualizedlist.types.d.ts +3 -1
  48. package/dist/custom-elements.json +947 -941
  49. package/dist/react/accordion/index.d.ts +3 -1
  50. package/dist/react/accordionbutton/index.d.ts +3 -1
  51. package/dist/react/alertchip/index.d.ts +4 -4
  52. package/dist/react/animation/index.d.ts +9 -3
  53. package/dist/react/avatarbutton/index.d.ts +4 -4
  54. package/dist/react/brandvisual/index.d.ts +6 -2
  55. package/dist/react/button/index.d.ts +9 -5
  56. package/dist/react/button/index.js +5 -1
  57. package/dist/react/buttonlink/index.d.ts +4 -4
  58. package/dist/react/buttonsimple/index.d.ts +4 -4
  59. package/dist/react/cardbutton/index.d.ts +4 -4
  60. package/dist/react/cardcheckbox/index.d.ts +4 -6
  61. package/dist/react/cardcheckbox/index.js +0 -2
  62. package/dist/react/cardradio/index.d.ts +4 -6
  63. package/dist/react/cardradio/index.js +0 -2
  64. package/dist/react/checkbox/index.d.ts +2 -2
  65. package/dist/react/chip/index.d.ts +4 -4
  66. package/dist/react/dialog/index.d.ts +15 -5
  67. package/dist/react/filterchip/index.d.ts +4 -4
  68. package/dist/react/index.d.ts +3 -3
  69. package/dist/react/index.js +3 -3
  70. package/dist/react/input/index.d.ts +3 -3
  71. package/dist/react/inputchip/index.d.ts +1 -1
  72. package/dist/react/link/index.d.ts +4 -4
  73. package/dist/react/linkbutton/index.d.ts +4 -4
  74. package/dist/react/linksimple/index.d.ts +4 -4
  75. package/dist/react/listitem/index.d.ts +8 -8
  76. package/dist/react/menuitem/index.d.ts +12 -8
  77. package/dist/react/menuitem/index.js +4 -0
  78. package/dist/react/menuitemcheckbox/index.d.ts +9 -9
  79. package/dist/react/menuitemradio/index.d.ts +9 -9
  80. package/dist/react/navmenuitem/index.d.ts +12 -9
  81. package/dist/react/option/index.d.ts +8 -8
  82. package/dist/react/password/index.d.ts +3 -3
  83. package/dist/react/radio/index.d.ts +2 -2
  84. package/dist/react/searchfield/index.d.ts +3 -3
  85. package/dist/react/select/index.d.ts +3 -3
  86. package/dist/react/sidenavigation/index.d.ts +4 -1
  87. package/dist/react/stepperitem/index.d.ts +3 -3
  88. package/dist/react/tab/index.d.ts +8 -5
  89. package/dist/react/tablist/index.d.ts +3 -1
  90. package/dist/react/textarea/index.d.ts +5 -5
  91. package/dist/react/toast/index.d.ts +1 -1
  92. package/dist/react/toggle/index.d.ts +2 -2
  93. package/dist/react/virtualizedlist/index.d.ts +1 -1
  94. package/dist/utils/mixins/ButtonComponentMixin.js +11 -4
  95. package/dist/utils/types.d.ts +9 -1
  96. package/package.json +1 -1
  97. package/dist/components/selectlistbox/selectlistbox.types.d.ts +0 -3
  98. package/dist/components/selectlistbox/selectlistbox.types.js +0 -1
@@ -1,8 +1,11 @@
1
- import type { ValueOf } from '../../utils/types';
1
+ import type { TypedCustomEvent, ValueOf } from '../../utils/types';
2
+ import type AccordionButton from './accordionbutton.component';
2
3
  import { ICON_NAME, VARIANT } from './accordionbutton.constants';
3
4
  type Variant = ValueOf<typeof VARIANT>;
4
5
  type IconName = ValueOf<typeof ICON_NAME>;
5
6
  interface Events {
6
- onShownEvent: Event;
7
+ onShownEvent: TypedCustomEvent<AccordionButton, {
8
+ expanded: boolean;
9
+ }>;
7
10
  }
8
11
  export type { Variant, IconName, Events };
@@ -1,12 +1,20 @@
1
1
  import type AnimationNames from '@momentum-design/animations/dist/types/types';
2
+ import type { TypedCustomEvent } from '../../utils/types';
3
+ import type Animation from './animation.component';
2
4
  /** Event mapping for React */
3
5
  interface Events {
4
6
  /** This event is dispatched when the animation is loaded */
5
- onLoadEvent: Event;
7
+ onLoadEvent: TypedCustomEvent<Animation, {
8
+ name: AnimationNames;
9
+ }>;
6
10
  /** This event is dispatched when all animation loops completed */
7
- onCompleteEvent: Event;
11
+ onCompleteEvent: TypedCustomEvent<Animation, {
12
+ name: AnimationNames;
13
+ }>;
8
14
  /** This event is dispatched when animation loading failed */
9
- onErrorEvent: Event;
15
+ onErrorEvent: TypedCustomEvent<Animation, {
16
+ error: Error;
17
+ }>;
10
18
  }
11
19
  type LoopType = `${boolean | number}`;
12
20
  export type { Events, AnimationNames, LoopType };
@@ -1,6 +1,12 @@
1
1
  import type BrandVisualNames from '@momentum-design/brand-visuals/dist/types/types';
2
+ import type { TypedCustomEvent } from '../../utils/types';
3
+ import type Brandvisual from './brandvisual.component';
2
4
  interface Events {
3
- onLoadEvent: Event;
4
- onErrorEvent: Event;
5
+ onLoadEvent: TypedCustomEvent<Brandvisual, {
6
+ name: BrandVisualNames;
7
+ }>;
8
+ onErrorEvent: TypedCustomEvent<Brandvisual, {
9
+ error: Error;
10
+ }>;
5
11
  }
6
12
  export type { BrandVisualNames, Events };
@@ -28,15 +28,19 @@ declare const Button_base: import("../../utils/mixins/index.types").Constructor<
28
28
  * - **Pill button**: A button that contains text value. Commonly used for call to action, tags, or filters.
29
29
  * - **Pill button with icons**: A button containing an icon either on the left or right side of the button.
30
30
  * - **Icon button**: A button represented by just an icon without any text.
31
- * The type of button is inferred based on the presence of slot and/or prefix and postfix icons.
31
+ * The type of button is inferred based on the presence of slot and/or prefix and postfix icons/slots.
32
32
  *
33
33
  * @dependency mdc-icon
34
34
  *
35
35
  * @tagname mdc-button
36
36
  *
37
37
  * @slot - Text label of the button.
38
+ * @slot prefix - Content to be displayed before the text label.
39
+ * @slot postfix - Content to be displayed after the text label.
38
40
  *
39
41
  * @csspart button-text - Text label of the button, passed in default slot
42
+ * @csspart prefix - Content before the text label, passed in `prefix` slot
43
+ * @csspart postfix - Content after the text label, passed in `postfix` slot
40
44
  */
41
45
  declare class Button extends Button_base {
42
46
  /**
@@ -39,15 +39,19 @@ import { getIconNameWithoutStyle } from './button.utils';
39
39
  * - **Pill button**: A button that contains text value. Commonly used for call to action, tags, or filters.
40
40
  * - **Pill button with icons**: A button containing an icon either on the left or right side of the button.
41
41
  * - **Icon button**: A button represented by just an icon without any text.
42
- * The type of button is inferred based on the presence of slot and/or prefix and postfix icons.
42
+ * The type of button is inferred based on the presence of slot and/or prefix and postfix icons/slots.
43
43
  *
44
44
  * @dependency mdc-icon
45
45
  *
46
46
  * @tagname mdc-button
47
47
  *
48
48
  * @slot - Text label of the button.
49
+ * @slot prefix - Content to be displayed before the text label.
50
+ * @slot postfix - Content to be displayed after the text label.
49
51
  *
50
52
  * @csspart button-text - Text label of the button, passed in default slot
53
+ * @csspart prefix - Content before the text label, passed in `prefix` slot
54
+ * @csspart postfix - Content after the text label, passed in `postfix` slot
51
55
  */
52
56
  class Button extends ButtonComponentMixin(Buttonsimple) {
53
57
  constructor() {
@@ -124,21 +128,25 @@ class Button extends ButtonComponentMixin(Buttonsimple) {
124
128
  }
125
129
  render() {
126
130
  return html `
127
- ${this.prefixFilledIconName
131
+ <slot name="prefix" part="prefix">
132
+ ${this.prefixFilledIconName
128
133
  ? html ` <mdc-icon
129
- name="${this.prefixFilledIconName}"
130
- part="prefix-icon"
131
- length-unit="rem"
132
- ></mdc-icon>`
134
+ name="${this.prefixFilledIconName}"
135
+ part="prefix-icon"
136
+ length-unit="rem"
137
+ ></mdc-icon>`
133
138
  : ''}
139
+ </slot>
134
140
  <slot @slotchange=${this.inferButtonType} part="button-text"></slot>
135
- ${this.postfixFilledIconName
141
+ <slot name="postfix" part="postfix">
142
+ ${this.postfixFilledIconName
136
143
  ? html ` <mdc-icon
137
- name="${this.postfixFilledIconName}"
138
- part="postfix-icon"
139
- length-unit="rem"
140
- ></mdc-icon>`
144
+ name="${this.postfixFilledIconName}"
145
+ part="postfix-icon"
146
+ length-unit="rem"
147
+ ></mdc-icon>`
141
148
  : ''}
149
+ </slot>
142
150
  `;
143
151
  }
144
152
  }
@@ -1,7 +1,9 @@
1
+ import type { OverrideEventTarget } from "../../utils/types";
2
+ import type ButtonLink from "./buttonlink.component";
1
3
  interface Events {
2
- onClickEvent: MouseEvent;
3
- onKeyDownEvent: KeyboardEvent;
4
- onFocusEvent: FocusEvent;
5
- onBlurEvent: Event;
4
+ onClickEvent: OverrideEventTarget<MouseEvent, ButtonLink>;
5
+ onKeyDownEvent: OverrideEventTarget<KeyboardEvent, ButtonLink>;
6
+ onFocusEvent: OverrideEventTarget<FocusEvent, ButtonLink>;
7
+ onBlurEvent: OverrideEventTarget<FocusEvent, ButtonLink>;
6
8
  }
7
9
  export type { Events };
@@ -1,11 +1,12 @@
1
- import type { ValueOf } from '../../utils/types';
1
+ import type { OverrideEventTarget, ValueOf } from '../../utils/types';
2
+ import type ButtonSimple from './buttonsimple.component';
2
3
  import { BUTTON_TYPE, BUTTON_SIZES } from './buttonsimple.constants';
3
4
  type ButtonSize = ValueOf<typeof BUTTON_SIZES>;
4
5
  type ButtonType = ValueOf<typeof BUTTON_TYPE>;
5
6
  interface Events {
6
- onClickEvent: MouseEvent;
7
- onKeyDownEvent: KeyboardEvent;
8
- onKeyUpEvent: KeyboardEvent;
9
- onFocusEvent: FocusEvent;
7
+ onClickEvent: OverrideEventTarget<MouseEvent, ButtonSimple>;
8
+ onKeyDownEvent: OverrideEventTarget<KeyboardEvent, ButtonSimple>;
9
+ onKeyUpEvent: OverrideEventTarget<KeyboardEvent, ButtonSimple>;
10
+ onFocusEvent: OverrideEventTarget<FocusEvent, ButtonSimple>;
10
11
  }
11
12
  export type { ButtonSize, ButtonType, Events };
@@ -1,7 +1,9 @@
1
+ import type { OverrideEventTarget } from "../../utils/types";
2
+ import type CardButton from "./cardbutton.component";
1
3
  interface Events {
2
- onClickEvent: MouseEvent;
3
- onKeyDownEvent: KeyboardEvent;
4
- onKeyUpEvent: KeyboardEvent;
5
- onFocusEvent: FocusEvent;
4
+ onClickEvent: OverrideEventTarget<MouseEvent, CardButton>;
5
+ onKeyDownEvent: OverrideEventTarget<KeyboardEvent, CardButton>;
6
+ onKeyUpEvent: OverrideEventTarget<KeyboardEvent, CardButton>;
7
+ onFocusEvent: OverrideEventTarget<FocusEvent, CardButton>;
6
8
  }
7
9
  export type { Events };
@@ -46,7 +46,6 @@ declare const CardCheckbox_base: import("../../utils/mixins/index.types").Constr
46
46
  * It toggles the checked state when enter key is used.
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
- * @event change - (React: onChange) Event that gets dispatched when the card state changes.
50
49
  * @event focus - (React: onFocus) Event that gets dispatched when the card receives focus.
51
50
  *
52
51
  */
@@ -60,7 +60,6 @@ import styles from './cardcheckbox.styles';
60
60
  * It toggles the checked state when enter key is used.
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
- * @event change - (React: onChange) Event that gets dispatched when the card state changes.
64
63
  * @event focus - (React: onFocus) Event that gets dispatched when the card receives focus.
65
64
  *
66
65
  */
@@ -1,11 +1,11 @@
1
- import type { ValueOf } from '../../utils/types';
1
+ import type { OverrideEventTarget, ValueOf } from '../../utils/types';
2
+ import type CardCheckbox from './cardcheckbox.component';
2
3
  import { SELECTION_TYPE } from './cardcheckbox.constants';
3
4
  type SelectionType = ValueOf<typeof SELECTION_TYPE>;
4
5
  interface Events {
5
- onClickEvent: MouseEvent;
6
- onKeyDownEvent: KeyboardEvent;
7
- onKeyUpEvent: KeyboardEvent;
8
- onFocusEvent: FocusEvent;
9
- onChangeEvent: Event;
6
+ onClickEvent: OverrideEventTarget<MouseEvent, CardCheckbox>;
7
+ onKeyDownEvent: OverrideEventTarget<KeyboardEvent, CardCheckbox>;
8
+ onKeyUpEvent: OverrideEventTarget<KeyboardEvent, CardCheckbox>;
9
+ onFocusEvent: OverrideEventTarget<FocusEvent, CardCheckbox>;
10
10
  }
11
11
  export { SelectionType, Events };
@@ -45,7 +45,6 @@ declare const CardRadio_base: import("../../utils/mixins/index.types").Construct
45
45
  * It toggles the checked state when enter key is used.
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
- * @event change - (React: onChange) Event that gets dispatched when the card state changes.
49
48
  * @event focus - (React: onFocus) Event that gets dispatched when the card receives focus.
50
49
  *
51
50
  */
@@ -60,7 +60,6 @@ import styles from './cardradio.styles';
60
60
  * It toggles the checked state when enter key is used.
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
- * @event change - (React: onChange) Event that gets dispatched when the card state changes.
64
63
  * @event focus - (React: onFocus) Event that gets dispatched when the card receives focus.
65
64
  *
66
65
  */
@@ -1,8 +1,9 @@
1
+ import type { OverrideEventTarget } from '../../utils/types';
2
+ import type CardRadio from './cardradio.component';
1
3
  interface Events {
2
- onClickEvent: MouseEvent;
3
- onKeyDownEvent: KeyboardEvent;
4
- onKeyUpEvent: KeyboardEvent;
5
- onFocusEvent: FocusEvent;
6
- onChangeEvent: Event;
4
+ onClickEvent: OverrideEventTarget<MouseEvent, CardRadio>;
5
+ onKeyDownEvent: OverrideEventTarget<KeyboardEvent, CardRadio>;
6
+ onKeyUpEvent: OverrideEventTarget<KeyboardEvent, CardRadio>;
7
+ onFocusEvent: OverrideEventTarget<FocusEvent, CardRadio>;
7
8
  }
8
9
  export type { Events };
@@ -1,5 +1,7 @@
1
+ import type { OverrideEventTarget, TypedCustomEvent } from "../../utils/types";
2
+ import type Checkbox from "./checkbox.component";
1
3
  interface Events {
2
- onChangeEvent: Event;
3
- onFocusEvent: FocusEvent;
4
+ onChangeEvent: TypedCustomEvent<Checkbox>;
5
+ onFocusEvent: OverrideEventTarget<FocusEvent, Checkbox>;
4
6
  }
5
7
  export type { Events };
@@ -1,13 +1,24 @@
1
- import type { ValueOf } from '../../utils/types';
1
+ import type { TypedCustomEvent, ValueOf } from '../../utils/types';
2
+ import type Dialog from './dialog.component';
2
3
  import { DIALOG_ROLE, DIALOG_SIZE, DIALOG_VARIANT } from './dialog.constants';
3
4
  type DialogRole = (typeof DIALOG_ROLE)[number];
4
5
  type DialogSize = ValueOf<typeof DIALOG_SIZE>;
5
6
  type DialogVariant = ValueOf<typeof DIALOG_VARIANT>;
6
7
  interface Events {
7
- onShownEvent: Event;
8
- onHiddenEvent: Event;
9
- onCreatedEvent: Event;
10
- onDestroyedEvent: Event;
11
- onCloseEvent: Event;
8
+ onShownEvent: TypedCustomEvent<Dialog, {
9
+ show: boolean;
10
+ }>;
11
+ onHiddenEvent: TypedCustomEvent<Dialog, {
12
+ show: boolean;
13
+ }>;
14
+ onCreatedEvent: TypedCustomEvent<Dialog, {
15
+ show: boolean;
16
+ }>;
17
+ onDestroyedEvent: TypedCustomEvent<Dialog, {
18
+ show: boolean;
19
+ }>;
20
+ onCloseEvent: TypedCustomEvent<Dialog, {
21
+ show: boolean;
22
+ }>;
12
23
  }
13
24
  export type { DialogSize, DialogRole, DialogVariant, Events };
@@ -1,16 +1,16 @@
1
- import type { TypedEvent, ValueOf } from '../../utils/types';
1
+ import type { OverrideEventTarget, TypedCustomEvent, ValueOf } from '../../utils/types';
2
2
  import type Input from './input.component';
3
3
  import { AUTO_CAPITALIZE, AUTO_COMPLETE, INPUT_TYPE } from './input.constants';
4
4
  type AutoCapitalizeType = ValueOf<typeof AUTO_CAPITALIZE>;
5
5
  type AutoCompleteType = ValueOf<typeof AUTO_COMPLETE>;
6
6
  type InputType = ValueOf<typeof INPUT_TYPE>;
7
- type InputClearEvent = TypedEvent<Input>;
8
- type InputChangeEvent = TypedEvent<Input>;
7
+ type InputClearEvent = TypedCustomEvent<Input>;
8
+ type InputChangeEvent = TypedCustomEvent<Input>;
9
9
  interface Events {
10
- onInputEvent: InputEvent;
10
+ onInputEvent: OverrideEventTarget<InputEvent, Input>;
11
11
  onChangeEvent: InputChangeEvent;
12
- onFocusEvent: FocusEvent;
13
- onBlurEvent: FocusEvent;
12
+ onFocusEvent: OverrideEventTarget<FocusEvent, Input>;
13
+ onBlurEvent: OverrideEventTarget<FocusEvent, Input>;
14
14
  onClearEvent: InputClearEvent;
15
15
  }
16
16
  export type { AutoCapitalizeType, AutoCompleteType, InputType, InputClearEvent, InputChangeEvent, Events };
@@ -1,4 +1,6 @@
1
+ import type { TypedCustomEvent } from "../../utils/types";
2
+ import type InputChip from "./inputchip.component";
1
3
  interface Events {
2
- onRemoveEvent: Event;
4
+ onRemoveEvent: TypedCustomEvent<InputChip>;
3
5
  }
4
6
  export type { Events };
@@ -1,10 +1,11 @@
1
- import type { ValueOf } from '../../utils/types';
1
+ import type { OverrideEventTarget, ValueOf } from '../../utils/types';
2
+ import type Link from './link.component';
2
3
  import { LINK_SIZES } from './link.constants';
3
4
  type LinkSize = ValueOf<typeof LINK_SIZES>;
4
5
  interface Events {
5
- onClickEvent: MouseEvent;
6
- onBlurEvent: Event;
7
- onKeyDownEvent: KeyboardEvent;
8
- onFocusEvent: FocusEvent;
6
+ onClickEvent: OverrideEventTarget<MouseEvent, Link>;
7
+ onBlurEvent: OverrideEventTarget<FocusEvent, Link>;
8
+ onKeyDownEvent: OverrideEventTarget<KeyboardEvent, Link>;
9
+ onFocusEvent: OverrideEventTarget<FocusEvent, Link>;
9
10
  }
10
11
  export type { LinkSize, Events };
@@ -1,10 +1,11 @@
1
- import type { ValueOf } from '../../utils/types';
1
+ import type { OverrideEventTarget, ValueOf } from '../../utils/types';
2
+ import type LinkButton from './linkbutton.component';
2
3
  import { LINKBUTTON_SIZES } from './linkbutton.constants';
3
4
  type LinkButtonSize = ValueOf<typeof LINKBUTTON_SIZES>;
4
5
  interface Events {
5
- onClickEvent: MouseEvent;
6
- onKeyDownEvent: KeyboardEvent;
7
- onFocusEvent: FocusEvent;
8
- onBlurEvent: Event;
6
+ onClickEvent: OverrideEventTarget<MouseEvent, LinkButton>;
7
+ onKeyDownEvent: OverrideEventTarget<KeyboardEvent, LinkButton>;
8
+ onFocusEvent: OverrideEventTarget<FocusEvent, LinkButton>;
9
+ onBlurEvent: OverrideEventTarget<FocusEvent, LinkButton>;
9
10
  }
10
11
  export type { Events, LinkButtonSize };
@@ -1,7 +1,9 @@
1
+ import type { OverrideEventTarget } from "../../utils/types";
2
+ import type LinkSimple from "./linksimple.component";
1
3
  interface Events {
2
- onClickEvent: MouseEvent;
3
- onBlurEvent: Event;
4
- onKeyDownEvent: KeyboardEvent;
5
- onFocusEvent: FocusEvent;
4
+ onClickEvent: OverrideEventTarget<MouseEvent, LinkSimple>;
5
+ onBlurEvent: OverrideEventTarget<FocusEvent, LinkSimple>;
6
+ onKeyDownEvent: OverrideEventTarget<KeyboardEvent, LinkSimple>;
7
+ onFocusEvent: OverrideEventTarget<FocusEvent, LinkSimple>;
6
8
  }
7
9
  export type { Events };
@@ -1,21 +1,22 @@
1
- import type { ValueOf } from '../../utils/types';
1
+ import type { OverrideEventTarget, TypedCustomEvent, ValueOf } from '../../utils/types';
2
+ import type ListItem from './listitem.component';
2
3
  import { LISTITEM_VARIANTS } from './listitem.constants';
3
4
  export type ListItemVariants = ValueOf<typeof LISTITEM_VARIANTS>;
4
5
  export interface Events {
5
- onClickEvent: MouseEvent;
6
- onKeyDownEvent: KeyboardEvent;
7
- onKeyUpEvent: KeyboardEvent;
8
- onFocusEvent: FocusEvent;
9
- onEnabledEvent: Event;
10
- onDisabledEvent: Event;
11
- onCreatedEvent: Event;
12
- onDestroyedEvent: Event;
6
+ onClickEvent: OverrideEventTarget<MouseEvent, ListItem>;
7
+ onKeyDownEvent: OverrideEventTarget<KeyboardEvent, ListItem>;
8
+ onKeyUpEvent: OverrideEventTarget<KeyboardEvent, ListItem>;
9
+ onFocusEvent: OverrideEventTarget<FocusEvent, ListItem>;
10
+ onEnabledEvent: TypedCustomEvent<ListItem>;
11
+ onDisabledEvent: TypedCustomEvent<ListItem>;
12
+ onCreatedEvent: TypedCustomEvent<ListItem>;
13
+ onDestroyedEvent: TypedCustomEvent<ListItem>;
13
14
  }
14
15
  declare global {
15
16
  interface GlobalEventHandlersEventMap {
16
- disabled: Event;
17
- enabled: Event;
18
- created: Event;
19
- destroyed: Event;
17
+ disabled: TypedCustomEvent<ListItem>;
18
+ enabled: TypedCustomEvent<ListItem>;
19
+ created: TypedCustomEvent<ListItem>;
20
+ destroyed: TypedCustomEvent<ListItem>;
20
21
  }
21
22
  }
@@ -31,6 +31,10 @@ import type { ArrowPositions, ArrowDirections } from './menuitem.types';
31
31
  * @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the menuitem.
32
32
  * @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the menuitem.
33
33
  * @event focus - (React: onFocus) This event is dispatched when the menuitem receives focus.
34
+ * @event enabled - (React: onEnabled) This event is dispatched after the menuitem is enabled
35
+ * @event disabled - (React: onDisabled) This event is dispatched after the menuitem is disabled
36
+ * @event created - (React: onCreated) This event is dispatched after the menuitem is created (added to the DOM)
37
+ * @event destroyed - (React: onDestroyed) This event is dispatched after the menuitem is destroyed (removed from the DOM)
34
38
  */
35
39
  declare class MenuItem extends ListItem {
36
40
  /**
@@ -45,6 +45,10 @@ import styles from './menuitem.styles';
45
45
  * @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the menuitem.
46
46
  * @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the menuitem.
47
47
  * @event focus - (React: onFocus) This event is dispatched when the menuitem receives focus.
48
+ * @event enabled - (React: onEnabled) This event is dispatched after the menuitem is enabled
49
+ * @event disabled - (React: onDisabled) This event is dispatched after the menuitem is disabled
50
+ * @event created - (React: onCreated) This event is dispatched after the menuitem is created (added to the DOM)
51
+ * @event destroyed - (React: onDestroyed) This event is dispatched after the menuitem is destroyed (removed from the DOM)
48
52
  */
49
53
  class MenuItem extends ListItem {
50
54
  constructor() {
@@ -1,9 +1,15 @@
1
- import type { ValueOf } from '../../utils/types';
1
+ import type { OverrideEventTarget, TypedCustomEvent, ValueOf } from '../../utils/types';
2
+ import type MenuItem from './menuitem.component';
2
3
  import { ARROW_POSITIONS, ARROW_DIRECTIONS } from './menuitem.constants';
3
4
  interface Events {
4
- onChangeEvent: Event;
5
- onClickEvent: MouseEvent;
6
- onFocusEvent: FocusEvent;
5
+ onClickEvent: OverrideEventTarget<MouseEvent, MenuItem>;
6
+ onKeyDownEvent: OverrideEventTarget<KeyboardEvent, MenuItem>;
7
+ onKeyUpEvent: OverrideEventTarget<KeyboardEvent, MenuItem>;
8
+ onFocusEvent: OverrideEventTarget<FocusEvent, MenuItem>;
9
+ onEnabledEvent: TypedCustomEvent<MenuItem>;
10
+ onDisabledEvent: TypedCustomEvent<MenuItem>;
11
+ onCreatedEvent: TypedCustomEvent<MenuItem>;
12
+ onDestroyedEvent: TypedCustomEvent<MenuItem>;
7
13
  }
8
14
  type ArrowPositions = ValueOf<typeof ARROW_POSITIONS>;
9
15
  type ArrowDirections = ValueOf<typeof ARROW_DIRECTIONS>;
@@ -1,9 +1,10 @@
1
- import { ValueOf } from '../../utils/types';
1
+ import type { OverrideEventTarget, TypedCustomEvent, ValueOf } from '../../utils/types';
2
+ import type MenuItemCheckbox from './menuitemcheckbox.component';
2
3
  import { INDICATOR } from './menuitemcheckbox.constants';
3
4
  type Indicator = ValueOf<typeof INDICATOR>;
4
5
  interface Events {
5
- onChangeEvent: Event;
6
- onClickEvent: MouseEvent;
7
- onFocusEvent: FocusEvent;
6
+ onChangeEvent: TypedCustomEvent<MenuItemCheckbox>;
7
+ onClickEvent: OverrideEventTarget<MouseEvent, MenuItemCheckbox>;
8
+ onFocusEvent: OverrideEventTarget<FocusEvent, MenuItemCheckbox>;
8
9
  }
9
10
  export type { Events, Indicator };
@@ -1,9 +1,10 @@
1
- import { ValueOf } from '../../utils/types';
1
+ import type { TypedCustomEvent, OverrideEventTarget, ValueOf } from '../../utils/types';
2
+ import type MenuItemRadio from './menuitemradio.component';
2
3
  import { INDICATOR } from './menuitemradio.constants';
3
4
  type Indicator = ValueOf<typeof INDICATOR>;
4
5
  interface Events {
5
- onChangeEvent: Event;
6
- onClickEvent: MouseEvent;
7
- onFocusEvent: FocusEvent;
6
+ onChangeEvent: TypedCustomEvent<MenuItemRadio>;
7
+ onClickEvent: OverrideEventTarget<MouseEvent, MenuItemRadio>;
8
+ onFocusEvent: OverrideEventTarget<FocusEvent, MenuItemRadio>;
8
9
  }
9
10
  export type { Events, Indicator };
@@ -1,10 +1,7 @@
1
- import type MenuItem from '../menuitem';
2
- export type MenuPopoverChangeEvent = Event & {
3
- target: MenuItem;
4
- };
5
- export type MenuPopoverActionEvent = Event & {
6
- target: MenuItem;
7
- };
1
+ import type { TypedCustomEvent } from '../../utils/types';
2
+ import type MenuItem from '../menuitem/menuitem.component';
3
+ export type MenuPopoverChangeEvent = TypedCustomEvent<MenuItem>;
4
+ export type MenuPopoverActionEvent = TypedCustomEvent<MenuItem>;
8
5
  export interface Events {
9
6
  onChangeEvent: MenuPopoverChangeEvent;
10
7
  onActionEvent: MenuPopoverActionEvent;
@@ -1,7 +1,6 @@
1
- import type MenuItem from '../menuitem';
2
- export type MenuSectionChangeEvent = Event & {
3
- target: MenuItem;
4
- };
1
+ import type { TypedCustomEvent } from '../../utils/types';
2
+ import type MenuItem from '../menuitem/menuitem.component';
3
+ export type MenuSectionChangeEvent = TypedCustomEvent<MenuItem>;
5
4
  export interface Events {
6
5
  onChangeEvent: MenuSectionChangeEvent;
7
6
  }
@@ -1,11 +1,15 @@
1
- import { ValueOf } from '../../utils/types';
1
+ import type { OverrideEventTarget, TypedCustomEvent, ValueOf } from '../../utils/types';
2
+ import type NavMenuItem from './navmenuitem.component';
2
3
  import { ALLOWED_BADGE_TYPES } from './navmenuitem.constants';
3
4
  type BadgeType = ValueOf<typeof ALLOWED_BADGE_TYPES>;
4
5
  interface Events {
5
- onClickEvent: MouseEvent;
6
- onKeyDownEvent: KeyboardEvent;
7
- onKeyUpEvent: KeyboardEvent;
8
- onFocusEvent: FocusEvent;
9
- onActiveChangeEvent: Event;
6
+ onClickEvent: OverrideEventTarget<MouseEvent, NavMenuItem>;
7
+ onKeyDownEvent: OverrideEventTarget<KeyboardEvent, NavMenuItem>;
8
+ onKeyUpEvent: OverrideEventTarget<KeyboardEvent, NavMenuItem>;
9
+ onFocusEvent: OverrideEventTarget<FocusEvent, NavMenuItem>;
10
+ onActiveChangeEvent: TypedCustomEvent<NavMenuItem, {
11
+ navId: string;
12
+ active: boolean;
13
+ }>;
10
14
  }
11
15
  export type { Events, BadgeType };
@@ -1,7 +1,9 @@
1
+ import type { OverrideEventTarget } from "../../utils/types";
2
+ import type Option from "./option.component";
1
3
  interface Events {
2
- onClickEvent: MouseEvent;
3
- onKeyDownEvent: KeyboardEvent;
4
- onKeyUpEvent: KeyboardEvent;
5
- onFocusEvent: FocusEvent;
4
+ onClickEvent: OverrideEventTarget<MouseEvent, Option>;
5
+ onKeyDownEvent: OverrideEventTarget<KeyboardEvent, Option>;
6
+ onKeyUpEvent: OverrideEventTarget<KeyboardEvent, Option>;
7
+ onFocusEvent: OverrideEventTarget<FocusEvent, Option>;
6
8
  }
7
9
  export type { Events };
@@ -1,7 +1,9 @@
1
+ import type { OverrideEventTarget, TypedCustomEvent } from "../../utils/types";
2
+ import type Password from "./password.component";
1
3
  interface Events {
2
- onInputEvent: InputEvent;
3
- onChangeEvent: Event;
4
- onFocusEvent: FocusEvent;
5
- onBlurEvent: FocusEvent;
4
+ onInputEvent: OverrideEventTarget<InputEvent, Password>;
5
+ onChangeEvent: TypedCustomEvent<Password>;
6
+ onFocusEvent: OverrideEventTarget<FocusEvent, Password>;
7
+ onBlurEvent: OverrideEventTarget<FocusEvent, Password>;
6
8
  }
7
9
  export type { Events };
@@ -1,19 +1,19 @@
1
- import type { ValueOf, TypedEvent } from '../../utils/types';
1
+ import type { ValueOf, TypedCustomEvent } from '../../utils/types';
2
2
  import type Popover from './popover.component';
3
3
  import { POPOVER_PLACEMENT, TRIGGER, COLOR } from './popover.constants';
4
4
  type PopoverPlacement = ValueOf<typeof POPOVER_PLACEMENT>;
5
5
  type PopoverColor = ValueOf<typeof COLOR>;
6
6
  type PopoverTrigger = ValueOf<typeof TRIGGER> | `${ValueOf<typeof TRIGGER>} ${ValueOf<typeof TRIGGER>}`;
7
- type PopoverShownEvent = TypedEvent<Popover, {
7
+ type PopoverShownEvent = TypedCustomEvent<Popover, {
8
8
  show: boolean;
9
9
  }>;
10
- type PopoverHiddenEvent = TypedEvent<Popover, {
10
+ type PopoverHiddenEvent = TypedCustomEvent<Popover, {
11
11
  show: boolean;
12
12
  }>;
13
- type PopoverCreatedEvent = TypedEvent<Popover, {
13
+ type PopoverCreatedEvent = TypedCustomEvent<Popover, {
14
14
  show: boolean;
15
15
  }>;
16
- type PopoverDestroyedEvent = TypedEvent<Popover, {
16
+ type PopoverDestroyedEvent = TypedCustomEvent<Popover, {
17
17
  show: boolean;
18
18
  }>;
19
19
  interface Events {
@@ -1,5 +1,7 @@
1
+ import type { OverrideEventTarget, TypedCustomEvent } from "../../utils/types";
2
+ import type Radio from "./radio.component";
1
3
  interface Events {
2
- onChangeEvent: Event;
3
- onFocusEvent: FocusEvent;
4
+ onChangeEvent: TypedCustomEvent<Radio>;
5
+ onFocusEvent: OverrideEventTarget<FocusEvent, Radio>;
4
6
  }
5
7
  export type { Events };