@mgdis/mg-components 4.2.1 → 5.1.0

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 (105) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/{mg-badge_23.cjs.entry.js → mg-badge_27.cjs.entry.js} +2590 -121
  3. package/dist/cjs/mg-components.cjs.js +1 -1
  4. package/dist/collection/collection-manifest.json +2 -0
  5. package/dist/collection/components/atoms/mg-badge/mg-badge.js +1 -3
  6. package/dist/collection/components/atoms/mg-button/doc/mg-button.stories.js +1 -2
  7. package/dist/collection/components/atoms/mg-button/mg-button.css +113 -67
  8. package/dist/collection/components/atoms/mg-button/mg-button.js +89 -64
  9. package/dist/collection/components/atoms/mg-card/doc/mg-card.stories.js +18 -0
  10. package/dist/collection/components/atoms/mg-card/mg-card.css +7 -0
  11. package/dist/collection/components/atoms/mg-card/mg-card.js +26 -0
  12. package/dist/collection/components/atoms/mg-divider/doc/mg-divider.stories.js +18 -0
  13. package/dist/collection/components/atoms/mg-divider/mg-divider.css +9 -0
  14. package/dist/collection/components/atoms/mg-divider/mg-divider.js +57 -0
  15. package/dist/collection/components/atoms/mg-icon/mg-icon.conf.js +3 -0
  16. package/dist/collection/components/atoms/mg-input-title/mg-input-title.js +1 -3
  17. package/dist/collection/components/atoms/mg-tooltip/doc/mg-tooltip.stories.js +0 -5
  18. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.conf.js +0 -20
  19. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.css +1 -1
  20. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +6 -7
  21. package/dist/collection/components/molecules/inputs/MgInput.js +1 -3
  22. package/dist/collection/components/molecules/mg-details/doc/mg-details.stories.js +1 -0
  23. package/dist/collection/components/molecules/mg-details/mg-details.css +29 -0
  24. package/dist/collection/components/molecules/mg-details/mg-details.js +26 -4
  25. package/dist/collection/components/molecules/mg-form/mg-form.js +2 -3
  26. package/dist/collection/components/molecules/mg-illustrated-message/doc/mg-illustrated-message.stories.js +2 -1
  27. package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.css +15 -7
  28. package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js +27 -2
  29. package/dist/collection/components/molecules/mg-modal/doc/mg-modal.stories.js +1 -1
  30. package/dist/collection/components/molecules/mg-modal/mg-modal.css +2 -1
  31. package/dist/collection/components/molecules/mg-modal/mg-modal.js +53 -7
  32. package/dist/collection/components/molecules/mg-pagination/mg-pagination.js +4 -3
  33. package/dist/collection/components/molecules/mg-panel/doc/mg-panel.stories.js +1 -1
  34. package/dist/collection/components/molecules/mg-panel/mg-panel.css +12 -20
  35. package/dist/collection/components/molecules/mg-panel/mg-panel.js +2 -4
  36. package/dist/collection/components/molecules/mg-popover/doc/mg-popover.stories.js +0 -5
  37. package/dist/collection/components/molecules/mg-popover/mg-popover.css +3 -3
  38. package/dist/collection/components/molecules/mg-popover/mg-popover.js +10 -10
  39. package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +1 -3
  40. package/dist/collection/utils/components.utils.js +10 -6
  41. package/dist/collection/variables.css +22 -1
  42. package/dist/components/MgInput.js +1 -3
  43. package/dist/components/components.utils.js +11 -7
  44. package/dist/components/index.d.ts +2 -0
  45. package/dist/components/index.js +2 -0
  46. package/dist/components/mg-badge2.js +1 -3
  47. package/dist/components/mg-button2.js +63 -13
  48. package/dist/components/mg-card.d.ts +11 -0
  49. package/dist/components/mg-card.js +42 -0
  50. package/dist/components/mg-details.js +8 -3
  51. package/dist/components/mg-divider.d.ts +11 -0
  52. package/dist/components/mg-divider.js +51 -0
  53. package/dist/components/mg-form.js +2 -3
  54. package/dist/components/mg-icon2.js +3 -0
  55. package/dist/components/mg-illustrated-message.js +12 -4
  56. package/dist/components/mg-input-title2.js +1 -3
  57. package/dist/components/mg-modal.js +54 -8
  58. package/dist/components/mg-pagination.js +4 -3
  59. package/dist/components/mg-panel.js +3 -5
  60. package/dist/components/mg-popover.js +11 -10
  61. package/dist/components/mg-tabs.js +1 -3
  62. package/dist/components/mg-tooltip2.js +7 -10
  63. package/dist/esm/loader.js +1 -1
  64. package/dist/esm/{mg-badge_23.entry.js → mg-badge_27.entry.js} +2538 -73
  65. package/dist/esm/mg-components.js +1 -1
  66. package/dist/mg-components/mg-components.css +1 -1
  67. package/dist/mg-components/mg-components.esm.js +1 -1
  68. package/dist/mg-components/p-e131701a.entry.js +1 -0
  69. package/dist/mg-components/variables.css +22 -1
  70. package/dist/types/components/atoms/mg-button/doc/mg-button.stories.d.ts +2 -2
  71. package/dist/types/components/atoms/mg-button/mg-button.conf.d.ts +5 -1
  72. package/dist/types/components/atoms/mg-button/mg-button.d.ts +25 -17
  73. package/dist/types/components/atoms/mg-card/doc/mg-card.stories.d.ts +6 -0
  74. package/dist/types/components/atoms/mg-card/mg-card.d.ts +11 -0
  75. package/dist/types/components/atoms/mg-divider/doc/mg-divider.stories.d.ts +6 -0
  76. package/dist/types/components/atoms/mg-divider/mg-divider.d.ts +15 -0
  77. package/dist/types/components/atoms/mg-tooltip/doc/mg-tooltip.stories.d.ts +0 -6
  78. package/dist/types/components/atoms/mg-tooltip/mg-tooltip.conf.d.ts +0 -8
  79. package/dist/types/components/atoms/mg-tooltip/mg-tooltip.d.ts +1 -1
  80. package/dist/types/components/molecules/mg-details/mg-details.d.ts +4 -0
  81. package/dist/types/components/molecules/mg-illustrated-message/mg-illustrated-message.d.ts +4 -0
  82. package/dist/types/components/molecules/mg-modal/mg-modal.d.ts +8 -0
  83. package/dist/types/components/molecules/mg-pagination/mg-pagination.d.ts +1 -0
  84. package/dist/types/components/molecules/mg-popover/doc/mg-popover.stories.d.ts +0 -6
  85. package/dist/types/components/molecules/mg-popover/mg-popover.d.ts +1 -1
  86. package/dist/types/components.d.ts +64 -31
  87. package/dist/types/utils/components.utils.d.ts +7 -3
  88. package/package.json +4 -3
  89. package/dist/cjs/index-179621c8.js +0 -244
  90. package/dist/cjs/mg-modal.cjs.entry.js +0 -130
  91. package/dist/cjs/mg-popover.cjs.entry.js +0 -171
  92. package/dist/cjs/popper-11d5f714.js +0 -1801
  93. package/dist/collection/components/molecules/mg-popover/mg-popover.conf.js +0 -20
  94. package/dist/collection/variables.scss +0 -212
  95. package/dist/esm/index-7efedd97.js +0 -238
  96. package/dist/esm/mg-modal.entry.js +0 -126
  97. package/dist/esm/mg-popover.entry.js +0 -167
  98. package/dist/esm/popper-f860750c.js +0 -1799
  99. package/dist/mg-components/p-25452f60.entry.js +0 -1
  100. package/dist/mg-components/p-5f89600c.js +0 -1
  101. package/dist/mg-components/p-a20fc541.entry.js +0 -1
  102. package/dist/mg-components/p-e08bc19a.entry.js +0 -1
  103. package/dist/mg-components/p-ec26fc38.js +0 -1
  104. package/dist/mg-components/variables.scss +0 -212
  105. package/dist/types/components/molecules/mg-popover/mg-popover.conf.d.ts +0 -8
@@ -1,10 +1,13 @@
1
- import { ButtonType } from './mg-button.conf';
1
+ import { VariantType, ButtonType } from './mg-button.conf';
2
2
  import { ClassList } from '../../../utils/components.utils';
3
3
  export declare class MgButton {
4
4
  /************
5
5
  * Internal *
6
6
  ************/
7
7
  private onClickElementFn;
8
+ private classDisabled;
9
+ private classLoading;
10
+ private classFullWidth;
8
11
  /**************
9
12
  * Decorators *
10
13
  **************/
@@ -15,8 +18,8 @@ export declare class MgButton {
15
18
  /**
16
19
  * Define button variant
17
20
  */
18
- variant: string;
19
- validateVariant(newValue: string, oldValue?: string): void;
21
+ variant: VariantType;
22
+ validateVariant(newValue: VariantType, oldValue?: VariantType): void;
20
23
  /**
21
24
  * Identifier is used for the element ID (id is a reserved prop in Stencil.js)
22
25
  */
@@ -28,9 +31,13 @@ export declare class MgButton {
28
31
  label: string;
29
32
  /**
30
33
  * Define button type
31
- * Default: 'submit', as HTMLButtonElement type is submit by default
32
34
  */
33
35
  type: ButtonType;
36
+ /**
37
+ * Set button to full-width
38
+ */
39
+ fullWidth: boolean;
40
+ validateFullWidth(newValue: any): void;
34
41
  /**
35
42
  * Define form id to attach button with.
36
43
  * If this attribute is not set, the <button> is associated with its ancestor <form> element.
@@ -51,19 +58,6 @@ export declare class MgButton {
51
58
  * Parent component have to remove the attribute 'disabled' when the process ends.
52
59
  */
53
60
  disableOnClick: boolean;
54
- /**
55
- * Prop to set aria-expanded on button element
56
- */
57
- expanded: boolean;
58
- /**
59
- * Prop to set aria-controls on button element
60
- */
61
- controls: string;
62
- /**
63
- * Option to set aria-haspopup
64
- * The aria-haspopup state informs assistive technology users that there is a popup and the type of popup it is, but provides no interactivity.
65
- */
66
- haspopup: boolean | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog';
67
61
  /**
68
62
  * Define if button is loading, default to false.
69
63
  * Trigger when button is clicked or key-up ['enter', 'space], then value change to true.
@@ -82,6 +76,20 @@ export declare class MgButton {
82
76
  * @returns {void}
83
77
  */
84
78
  private handleClick;
79
+ /**
80
+ * Handle onKeyDown event
81
+ *
82
+ * @param {KeyboardEvent} event keyboard event
83
+ * @returns {void}
84
+ */
85
+ private handleKeydown;
86
+ /**
87
+ * Handle onKeyUp event
88
+ *
89
+ * @param {KeyboardEvent} event keyboard event
90
+ * @returns {void}
91
+ */
92
+ private handleKeyup;
85
93
  /**
86
94
  * Check if props are well configured on init
87
95
  *
@@ -0,0 +1,6 @@
1
+ declare const _default: {
2
+ component: string;
3
+ title: string;
4
+ };
5
+ export default _default;
6
+ export declare const MgCard: any;
@@ -0,0 +1,11 @@
1
+ export declare class MgCard {
2
+ /*************
3
+ * Lifecycle *
4
+ *************/
5
+ /**
6
+ * Render
7
+ *
8
+ * @returns {HTMLElement} HTML Element
9
+ */
10
+ render(): HTMLElement;
11
+ }
@@ -0,0 +1,6 @@
1
+ declare const _default: {
2
+ component: string;
3
+ title: string;
4
+ };
5
+ export default _default;
6
+ export declare const MgDivider: any;
@@ -0,0 +1,15 @@
1
+ export declare class MgDivider {
2
+ /**************
3
+ * Decorators *
4
+ **************/
5
+ /**
6
+ * Define component size
7
+ */
8
+ size: 'regular' | 'full';
9
+ /**
10
+ * Render
11
+ *
12
+ * @returns {HTMLElement} HTML Element
13
+ */
14
+ render(): HTMLElement;
15
+ }
@@ -6,15 +6,9 @@ declare const _default: {
6
6
  };
7
7
  argTypes: {
8
8
  placement: {
9
- options: readonly ["auto", "auto-start", "auto-end", "top", "top-start", "top-end", "bottom", "bottom-start", "bottom-end", "right", "right-start", "right-end", "left", "left-start", "left-end"];
10
9
  control: {
11
10
  type: string;
12
11
  };
13
- table: {
14
- defaultValue: {
15
- summary: string;
16
- };
17
- };
18
12
  };
19
13
  };
20
14
  };
@@ -1,11 +1,3 @@
1
- /**
2
- * List of all possibles placements
3
- */
4
- export declare const placements: readonly ["auto", "auto-start", "auto-end", "top", "top-start", "top-end", "bottom", "bottom-start", "bottom-end", "right", "right-start", "right-end", "left", "left-start", "left-end"];
5
- /**
6
- * Placement type from placements
7
- */
8
- export declare type Placement = typeof placements[number];
9
1
  export declare enum Guard {
10
2
  FOCUS = "focus",
11
3
  HOVER_TOOLTIP_ELEMENT = "hoverTooltipGuard",
@@ -1,4 +1,4 @@
1
- import { Placement } from './mg-tooltip.conf';
1
+ import { Placement } from '@popperjs/core';
2
2
  export declare class MgTooltip {
3
3
  /************
4
4
  * Internal *
@@ -16,6 +16,10 @@ export declare class MgDetails {
16
16
  */
17
17
  toggleOpened: string;
18
18
  validateTitles(newValue: string): void;
19
+ /**
20
+ * Hide summary element
21
+ */
22
+ hideSummary: boolean;
19
23
  /**
20
24
  * Define if details are diplayed
21
25
  */
@@ -10,6 +10,10 @@ export declare class MgIllustratedMessage {
10
10
  * Define illustration size
11
11
  */
12
12
  size: 'regular' | 'small';
13
+ /**
14
+ * Define component orientation
15
+ */
16
+ direction: 'vertical' | 'horizontal';
13
17
  /*************
14
18
  * Lifecycle *
15
19
  *************/
@@ -4,6 +4,7 @@ export declare class MgModal {
4
4
  /************
5
5
  * Internal *
6
6
  ************/
7
+ private modalFocusableElements;
7
8
  private classHide;
8
9
  private closeButtonId;
9
10
  private titleId;
@@ -60,6 +61,7 @@ export declare class MgModal {
60
61
  * @returns {void}
61
62
  */
62
63
  handleKeyDown(event: KeyboardEvent): void;
64
+ private setFocus;
63
65
  /*************
64
66
  * Handlers *
65
67
  *************/
@@ -78,6 +80,12 @@ export declare class MgModal {
78
80
  * @returns {void}
79
81
  */
80
82
  componentWillLoad(): void;
83
+ /**
84
+ * Add observer on component to set focus when displayed
85
+ *
86
+ * @returns {void}
87
+ */
88
+ componentDidLoad(): void;
81
89
  /**
82
90
  * Render
83
91
  *
@@ -56,6 +56,7 @@ export declare class MgPagination {
56
56
  * Go to 'previous/next' page button handler
57
57
  *
58
58
  * @param {string} action navigation action
59
+ * @param {boolean} disabled button disable state
59
60
  * @returns {void}
60
61
  */
61
62
  private handleGoToPage;
@@ -12,15 +12,9 @@ declare const _default: {
12
12
  };
13
13
  argTypes: {
14
14
  placement: {
15
- options: readonly ["auto", "auto-start", "auto-end", "top", "top-start", "top-end", "bottom", "bottom-start", "bottom-end", "right", "right-start", "right-end", "left", "left-start", "left-end"];
16
15
  control: {
17
16
  type: string;
18
17
  };
19
- table: {
20
- defaultValue: {
21
- summary: string;
22
- };
23
- };
24
18
  };
25
19
  };
26
20
  };
@@ -1,5 +1,5 @@
1
1
  import { EventEmitter } from '../../../stencil-public-runtime';
2
- import { Placement } from './mg-popover.conf';
2
+ import { Placement } from '@popperjs/core';
3
3
  export declare class MgPopover {
4
4
  /************
5
5
  * Internal *
@@ -6,15 +6,14 @@
6
6
  */
7
7
  import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
8
8
  import { BadgeType } from "./components/atoms/mg-badge/mg-badge.conf";
9
- import { ButtonType } from "./components/atoms/mg-button/mg-button.conf";
9
+ import { ButtonType, VariantType } from "./components/atoms/mg-button/mg-button.conf";
10
10
  import { CheckboxValue } from "./components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf";
11
11
  import { Width } from "./components/molecules/inputs/MgInput.conf";
12
12
  import { RadioOption } from "./components/molecules/inputs/mg-input-radio/mg-input-radio.conf";
13
13
  import { SelectOption } from "./components/molecules/inputs/mg-input-select/mg-input-select.conf";
14
14
  import { ToggleValue } from "./components/molecules/inputs/mg-input-toggle/mg-input-toggle.conf";
15
- import { Placement } from "./components/molecules/mg-popover/mg-popover.conf";
15
+ import { Placement } from "@popperjs/core";
16
16
  import { TabItem } from "./components/molecules/mg-tabs/mg-tabs.conf";
17
- import { Placement as Placement1 } from "./components/atoms/mg-tooltip/mg-tooltip.conf";
18
17
  export namespace Components {
19
18
  interface MgBadge {
20
19
  /**
@@ -35,10 +34,6 @@ export namespace Components {
35
34
  "variant": string;
36
35
  }
37
36
  interface MgButton {
38
- /**
39
- * Prop to set aria-controls on button element
40
- */
41
- "controls": string;
42
37
  /**
43
38
  * Option to set input disable on click, in order to prevent multi-click. Parent component have to remove the attribute 'disabled' when the process ends.
44
39
  */
@@ -47,18 +42,14 @@ export namespace Components {
47
42
  * Disable button
48
43
  */
49
44
  "disabled": boolean;
50
- /**
51
- * Prop to set aria-expanded on button element
52
- */
53
- "expanded": boolean;
54
45
  /**
55
46
  * Define form id to attach button with. If this attribute is not set, the <button> is associated with its ancestor <form> element.
56
47
  */
57
48
  "form": string;
58
49
  /**
59
- * Option to set aria-haspopup The aria-haspopup state informs assistive technology users that there is a popup and the type of popup it is, but provides no interactivity.
50
+ * Set button to full-width
60
51
  */
61
- "haspopup": boolean | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog';
52
+ "fullWidth": boolean;
62
53
  /**
63
54
  * Identifier is used for the element ID (id is a reserved prop in Stencil.js)
64
55
  */
@@ -72,13 +63,15 @@ export namespace Components {
72
63
  */
73
64
  "label": string;
74
65
  /**
75
- * Define button type Default: 'submit', as HTMLButtonElement type is submit by default
66
+ * Define button type
76
67
  */
77
68
  "type": ButtonType;
78
69
  /**
79
70
  * Define button variant
80
71
  */
81
- "variant": string;
72
+ "variant": VariantType;
73
+ }
74
+ interface MgCard {
82
75
  }
83
76
  interface MgCharacterLeft {
84
77
  /**
@@ -99,6 +92,10 @@ export namespace Components {
99
92
  * Define if details are diplayed
100
93
  */
101
94
  "expanded": boolean;
95
+ /**
96
+ * Hide summary element
97
+ */
98
+ "hideSummary": boolean;
102
99
  /**
103
100
  * Displayed title when details are closed
104
101
  */
@@ -108,6 +105,12 @@ export namespace Components {
108
105
  */
109
106
  "toggleOpened": string;
110
107
  }
108
+ interface MgDivider {
109
+ /**
110
+ * Define component size
111
+ */
112
+ "size": 'regular' | 'full';
113
+ }
111
114
  interface MgForm {
112
115
  /**
113
116
  * Define if form is disabled
@@ -158,6 +161,10 @@ export namespace Components {
158
161
  "variant": string;
159
162
  }
160
163
  interface MgIllustratedMessage {
164
+ /**
165
+ * Define component orientation
166
+ */
167
+ "direction": 'vertical' | 'horizontal';
161
168
  /**
162
169
  * Define illustration size
163
170
  */
@@ -1015,7 +1022,7 @@ export namespace Components {
1015
1022
  /**
1016
1023
  * Tooltip placement
1017
1024
  */
1018
- "placement": Placement1;
1025
+ "placement": Placement;
1019
1026
  }
1020
1027
  }
1021
1028
  export interface MgDetailsCustomEvent<T> extends CustomEvent<T> {
@@ -1099,6 +1106,12 @@ declare global {
1099
1106
  prototype: HTMLMgButtonElement;
1100
1107
  new (): HTMLMgButtonElement;
1101
1108
  };
1109
+ interface HTMLMgCardElement extends Components.MgCard, HTMLStencilElement {
1110
+ }
1111
+ var HTMLMgCardElement: {
1112
+ prototype: HTMLMgCardElement;
1113
+ new (): HTMLMgCardElement;
1114
+ };
1102
1115
  interface HTMLMgCharacterLeftElement extends Components.MgCharacterLeft, HTMLStencilElement {
1103
1116
  }
1104
1117
  var HTMLMgCharacterLeftElement: {
@@ -1111,6 +1124,12 @@ declare global {
1111
1124
  prototype: HTMLMgDetailsElement;
1112
1125
  new (): HTMLMgDetailsElement;
1113
1126
  };
1127
+ interface HTMLMgDividerElement extends Components.MgDivider, HTMLStencilElement {
1128
+ }
1129
+ var HTMLMgDividerElement: {
1130
+ prototype: HTMLMgDividerElement;
1131
+ new (): HTMLMgDividerElement;
1132
+ };
1114
1133
  interface HTMLMgFormElement extends Components.MgForm, HTMLStencilElement {
1115
1134
  }
1116
1135
  var HTMLMgFormElement: {
@@ -1240,8 +1259,10 @@ declare global {
1240
1259
  interface HTMLElementTagNameMap {
1241
1260
  "mg-badge": HTMLMgBadgeElement;
1242
1261
  "mg-button": HTMLMgButtonElement;
1262
+ "mg-card": HTMLMgCardElement;
1243
1263
  "mg-character-left": HTMLMgCharacterLeftElement;
1244
1264
  "mg-details": HTMLMgDetailsElement;
1265
+ "mg-divider": HTMLMgDividerElement;
1245
1266
  "mg-form": HTMLMgFormElement;
1246
1267
  "mg-icon": HTMLMgIconElement;
1247
1268
  "mg-illustrated-message": HTMLMgIllustratedMessageElement;
@@ -1285,10 +1306,6 @@ declare namespace LocalJSX {
1285
1306
  "variant"?: string;
1286
1307
  }
1287
1308
  interface MgButton {
1288
- /**
1289
- * Prop to set aria-controls on button element
1290
- */
1291
- "controls"?: string;
1292
1309
  /**
1293
1310
  * Option to set input disable on click, in order to prevent multi-click. Parent component have to remove the attribute 'disabled' when the process ends.
1294
1311
  */
@@ -1297,18 +1314,14 @@ declare namespace LocalJSX {
1297
1314
  * Disable button
1298
1315
  */
1299
1316
  "disabled"?: boolean;
1300
- /**
1301
- * Prop to set aria-expanded on button element
1302
- */
1303
- "expanded"?: boolean;
1304
1317
  /**
1305
1318
  * Define form id to attach button with. If this attribute is not set, the <button> is associated with its ancestor <form> element.
1306
1319
  */
1307
1320
  "form"?: string;
1308
1321
  /**
1309
- * Option to set aria-haspopup The aria-haspopup state informs assistive technology users that there is a popup and the type of popup it is, but provides no interactivity.
1322
+ * Set button to full-width
1310
1323
  */
1311
- "haspopup"?: boolean | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog';
1324
+ "fullWidth"?: boolean;
1312
1325
  /**
1313
1326
  * Identifier is used for the element ID (id is a reserved prop in Stencil.js)
1314
1327
  */
@@ -1322,13 +1335,15 @@ declare namespace LocalJSX {
1322
1335
  */
1323
1336
  "label"?: string;
1324
1337
  /**
1325
- * Define button type Default: 'submit', as HTMLButtonElement type is submit by default
1338
+ * Define button type
1326
1339
  */
1327
1340
  "type"?: ButtonType;
1328
1341
  /**
1329
1342
  * Define button variant
1330
1343
  */
1331
- "variant"?: string;
1344
+ "variant"?: VariantType;
1345
+ }
1346
+ interface MgCard {
1332
1347
  }
1333
1348
  interface MgCharacterLeft {
1334
1349
  /**
@@ -1349,6 +1364,10 @@ declare namespace LocalJSX {
1349
1364
  * Define if details are diplayed
1350
1365
  */
1351
1366
  "expanded"?: boolean;
1367
+ /**
1368
+ * Hide summary element
1369
+ */
1370
+ "hideSummary"?: boolean;
1352
1371
  /**
1353
1372
  * Emmited event when expanded change
1354
1373
  */
@@ -1356,11 +1375,17 @@ declare namespace LocalJSX {
1356
1375
  /**
1357
1376
  * Displayed title when details are closed
1358
1377
  */
1359
- "toggleClosed"?: string;
1378
+ "toggleClosed": string;
1360
1379
  /**
1361
1380
  * Displayed title when details are opened
1362
1381
  */
1363
- "toggleOpened"?: string;
1382
+ "toggleOpened": string;
1383
+ }
1384
+ interface MgDivider {
1385
+ /**
1386
+ * Define component size
1387
+ */
1388
+ "size"?: 'regular' | 'full';
1364
1389
  }
1365
1390
  interface MgForm {
1366
1391
  /**
@@ -1415,6 +1440,10 @@ declare namespace LocalJSX {
1415
1440
  "variant"?: string;
1416
1441
  }
1417
1442
  interface MgIllustratedMessage {
1443
+ /**
1444
+ * Define component orientation
1445
+ */
1446
+ "direction"?: 'vertical' | 'horizontal';
1418
1447
  /**
1419
1448
  * Define illustration size
1420
1449
  */
@@ -2335,13 +2364,15 @@ declare namespace LocalJSX {
2335
2364
  /**
2336
2365
  * Tooltip placement
2337
2366
  */
2338
- "placement"?: Placement1;
2367
+ "placement"?: Placement;
2339
2368
  }
2340
2369
  interface IntrinsicElements {
2341
2370
  "mg-badge": MgBadge;
2342
2371
  "mg-button": MgButton;
2372
+ "mg-card": MgCard;
2343
2373
  "mg-character-left": MgCharacterLeft;
2344
2374
  "mg-details": MgDetails;
2375
+ "mg-divider": MgDivider;
2345
2376
  "mg-form": MgForm;
2346
2377
  "mg-icon": MgIcon;
2347
2378
  "mg-illustrated-message": MgIllustratedMessage;
@@ -2371,8 +2402,10 @@ declare module "@stencil/core" {
2371
2402
  interface IntrinsicElements {
2372
2403
  "mg-badge": LocalJSX.MgBadge & JSXBase.HTMLAttributes<HTMLMgBadgeElement>;
2373
2404
  "mg-button": LocalJSX.MgButton & JSXBase.HTMLAttributes<HTMLMgButtonElement>;
2405
+ "mg-card": LocalJSX.MgCard & JSXBase.HTMLAttributes<HTMLMgCardElement>;
2374
2406
  "mg-character-left": LocalJSX.MgCharacterLeft & JSXBase.HTMLAttributes<HTMLMgCharacterLeftElement>;
2375
2407
  "mg-details": LocalJSX.MgDetails & JSXBase.HTMLAttributes<HTMLMgDetailsElement>;
2408
+ "mg-divider": LocalJSX.MgDivider & JSXBase.HTMLAttributes<HTMLMgDividerElement>;
2376
2409
  "mg-form": LocalJSX.MgForm & JSXBase.HTMLAttributes<HTMLMgFormElement>;
2377
2410
  "mg-icon": LocalJSX.MgIcon & JSXBase.HTMLAttributes<HTMLMgIconElement>;
2378
2411
  "mg-illustrated-message": LocalJSX.MgIllustratedMessage & JSXBase.HTMLAttributes<HTMLMgIllustratedMessageElement>;
@@ -5,7 +5,7 @@
5
5
  * @param {number} length ID length
6
6
  * @returns {string} ID
7
7
  */
8
- export declare function createID(prefix?: string, length?: number): string;
8
+ export declare const createID: (prefix?: string, length?: number) => string;
9
9
  /**
10
10
  * Class to manage component classlist
11
11
  * Set() are not working when imported in project
@@ -47,7 +47,7 @@ export declare class ClassList {
47
47
  * @param {string[]} items items to check
48
48
  * @returns {boolean} all items are string
49
49
  */
50
- export declare function allItemsAreString(items: string[]): boolean;
50
+ export declare const allItemsAreString: (items: string[]) => boolean;
51
51
  /**
52
52
  * Check if element is a heading
53
53
  *
@@ -55,4 +55,8 @@ export declare function allItemsAreString(items: string[]): boolean;
55
55
  * @param {string[]} tagNames allowed tag names list
56
56
  * @returns {boolean} element is a heading
57
57
  */
58
- export declare function isTagName(element: Element, tagNames: string[]): boolean;
58
+ export declare const isTagName: (element: Element, tagNames: string[]) => boolean;
59
+ /**
60
+ * Focusable elements query selector
61
+ */
62
+ export declare const focusableElements = "a[href], button, input, textarea, select, details, [tabindex]:not([tabindex=\"-1\"]), [identifier]";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mgdis/mg-components",
3
- "version": "4.2.1",
3
+ "version": "5.1.0",
4
4
  "description": "MG Components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",
@@ -42,7 +42,7 @@
42
42
  },
43
43
  "dependencies": {
44
44
  "@popperjs/core": "^2.11.2",
45
- "@stencil/core": "^2.18.0",
45
+ "@stencil/core": "^2.18.1",
46
46
  "normalize.css": "^8.0.1"
47
47
  },
48
48
  "devDependencies": {
@@ -70,13 +70,14 @@
70
70
  "eslint-plugin-jsdoc": "^38.0.6",
71
71
  "eslint-plugin-jsx-a11y": "^6.6.1",
72
72
  "eslint-plugin-react": "^7.26.1",
73
- "eslint-plugin-storybook": "^0.6.4",
73
+ "eslint-plugin-storybook": "^0.6.6",
74
74
  "husky": "^7.0.4",
75
75
  "jest": "^26.6.3",
76
76
  "jest-cli": "^26.6.3",
77
77
  "jest-image-snapshot": "^4.5.1",
78
78
  "jest-junit": "^13.0.0",
79
79
  "jsx-dom": "^8.0.1-beta.1",
80
+ "mutation-observer": "^1.0.3",
80
81
  "npm-run-all": "^4.1.5",
81
82
  "prettier": "^2.5.1",
82
83
  "puppeteer": "^13.3.2",