@momentum-design/components 0.27.3 → 0.27.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/index.js +15 -15
- package/dist/browser/index.js.map +3 -3
- package/dist/components/avatarbutton/avatarbutton.component.d.ts +5 -0
- package/dist/components/avatarbutton/avatarbutton.component.js +5 -0
- package/dist/components/button/button.component.d.ts +5 -0
- package/dist/components/button/button.component.js +26 -17
- package/dist/components/buttonsimple/buttonsimple.component.d.ts +5 -0
- package/dist/components/buttonsimple/buttonsimple.component.js +5 -0
- package/dist/components/checkbox/checkbox.component.d.ts +3 -0
- package/dist/components/checkbox/checkbox.component.js +3 -0
- package/dist/components/input/input.component.d.ts +5 -0
- package/dist/components/input/input.component.js +5 -0
- package/dist/components/radio/radio.component.d.ts +3 -0
- package/dist/components/radio/radio.component.js +3 -0
- package/dist/components/tab/tab.component.d.ts +5 -0
- package/dist/components/tab/tab.component.js +5 -0
- package/dist/components/toggle/toggle.component.d.ts +3 -0
- package/dist/components/toggle/toggle.component.js +3 -0
- package/dist/components/virtualizedlist/virtualizedlist.component.d.ts +2 -0
- package/dist/components/virtualizedlist/virtualizedlist.component.js +2 -0
- package/dist/custom-elements.json +1052 -832
- package/dist/react/avatarbutton/index.d.ts +11 -1
- package/dist/react/avatarbutton/index.js +11 -1
- package/dist/react/button/index.d.ts +11 -1
- package/dist/react/button/index.js +11 -1
- package/dist/react/buttonsimple/index.d.ts +11 -1
- package/dist/react/buttonsimple/index.js +11 -1
- package/dist/react/checkbox/index.d.ts +8 -1
- package/dist/react/checkbox/index.js +8 -1
- package/dist/react/index.d.ts +1 -1
- package/dist/react/index.js +1 -1
- package/dist/react/input/index.d.ts +12 -1
- package/dist/react/input/index.js +12 -1
- package/dist/react/radio/index.d.ts +8 -1
- package/dist/react/radio/index.js +8 -1
- package/dist/react/tab/index.d.ts +11 -1
- package/dist/react/tab/index.js +11 -1
- package/dist/react/toggle/index.d.ts +8 -1
- package/dist/react/toggle/index.js +8 -1
- package/dist/react/virtualizedlist/index.d.ts +5 -1
- package/dist/react/virtualizedlist/index.js +5 -1
- package/package.json +1 -1
@@ -10,6 +10,11 @@ declare const AvatarButton_base: import("../../utils/mixins/index.types").Constr
|
|
10
10
|
*
|
11
11
|
* @dependency mdc-avatar
|
12
12
|
*
|
13
|
+
* @event click - (React: onClick) This event is dispatched when the avatarbutton is clicked.
|
14
|
+
* @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the avatarbutton.
|
15
|
+
* @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the avatarbutton.
|
16
|
+
* @event focus - (React: onFocus) This event is dispatched when the avatarbutton receives focus.
|
17
|
+
*
|
13
18
|
* @tagname mdc-avatarbutton
|
14
19
|
*/
|
15
20
|
declare class AvatarButton extends AvatarButton_base {
|
@@ -24,6 +24,11 @@ import styles from './avatarbutton.styles';
|
|
24
24
|
*
|
25
25
|
* @dependency mdc-avatar
|
26
26
|
*
|
27
|
+
* @event click - (React: onClick) This event is dispatched when the avatarbutton is clicked.
|
28
|
+
* @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the avatarbutton.
|
29
|
+
* @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the avatarbutton.
|
30
|
+
* @event focus - (React: onFocus) This event is dispatched when the avatarbutton receives focus.
|
31
|
+
*
|
27
32
|
* @tagname mdc-avatarbutton
|
28
33
|
*/
|
29
34
|
class AvatarButton extends AvatarComponentMixin(IconNameMixin(Buttonsimple)) {
|
@@ -30,6 +30,11 @@ import type { ButtonColor, ButtonVariant, IconButtonSize, PillButtonSize } from
|
|
30
30
|
*
|
31
31
|
* @dependency mdc-icon
|
32
32
|
*
|
33
|
+
* @event click - (React: onClick) This event is dispatched when the button is clicked.
|
34
|
+
* @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the button.
|
35
|
+
* @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the button.
|
36
|
+
* @event focus - (React: onFocus) This event is dispatched when the button receives focus.
|
37
|
+
*
|
33
38
|
* @tagname mdc-button
|
34
39
|
*
|
35
40
|
* @slot - Text label of the button.
|
@@ -41,6 +41,11 @@ import { getIconNameWithoutStyle, getIconSize } from './button.utils';
|
|
41
41
|
*
|
42
42
|
* @dependency mdc-icon
|
43
43
|
*
|
44
|
+
* @event click - (React: onClick) This event is dispatched when the button is clicked.
|
45
|
+
* @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the button.
|
46
|
+
* @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the button.
|
47
|
+
* @event focus - (React: onFocus) This event is dispatched when the button receives focus.
|
48
|
+
*
|
44
49
|
* @tagname mdc-button
|
45
50
|
*
|
46
51
|
* @slot - Text label of the button.
|
@@ -152,8 +157,8 @@ class Button extends Buttonsimple {
|
|
152
157
|
setSize(size) {
|
153
158
|
const isIconType = this.typeInternal === BUTTON_TYPE_INTERNAL.ICON;
|
154
159
|
const isValidSize = isIconType
|
155
|
-
?
|
156
|
-
&& !(size === ICON_BUTTON_SIZES[20] && this.variant !== BUTTON_VARIANTS.TERTIARY)
|
160
|
+
? Object.values(ICON_BUTTON_SIZES).includes(size)
|
161
|
+
&& !(size === ICON_BUTTON_SIZES[20] && this.variant !== BUTTON_VARIANTS.TERTIARY)
|
157
162
|
: Object.values(PILL_BUTTON_SIZES).includes(size);
|
158
163
|
this.setAttribute('size', isValidSize ? `${size}` : `${DEFAULTS.SIZE}`);
|
159
164
|
this.iconSize = getIconSize(size);
|
@@ -178,7 +183,7 @@ class Button extends Buttonsimple {
|
|
178
183
|
*/
|
179
184
|
inferButtonType() {
|
180
185
|
var _a, _b;
|
181
|
-
const slot = (_b = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('slot')) === null || _b === void 0 ? void 0 : _b.assignedNodes().length;
|
186
|
+
const slot = (_b = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('slot')) === null || _b === void 0 ? void 0 : _b.assignedNodes().filter((node) => { var _a; return node.nodeType !== Node.TEXT_NODE || ((_a = node.textContent) === null || _a === void 0 ? void 0 : _a.trim()); }).length;
|
182
187
|
if (slot && (this.prefixIcon || this.postfixIcon)) {
|
183
188
|
this.typeInternal = BUTTON_TYPE_INTERNAL.PILL_WITH_ICON;
|
184
189
|
this.setAttribute('data-btn-type', 'pill-with-icon');
|
@@ -194,21 +199,25 @@ class Button extends Buttonsimple {
|
|
194
199
|
}
|
195
200
|
render() {
|
196
201
|
return html `
|
197
|
-
${this.prefixIcon
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
202
|
+
${this.prefixIcon
|
203
|
+
? html ` <mdc-icon
|
204
|
+
name="${this.prefixIcon}"
|
205
|
+
part="prefix-icon"
|
206
|
+
size=${this.iconSize}
|
207
|
+
length-unit="rem"
|
208
|
+
>
|
209
|
+
</mdc-icon>`
|
210
|
+
: ''}
|
204
211
|
<slot @slotchange=${this.inferButtonType}></slot>
|
205
|
-
${this.postfixIcon
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
+
${this.postfixIcon
|
213
|
+
? html ` <mdc-icon
|
214
|
+
name="${this.postfixIcon}"
|
215
|
+
part="postfix-icon"
|
216
|
+
size=${this.iconSize}
|
217
|
+
length-unit="rem"
|
218
|
+
>
|
219
|
+
</mdc-icon>`
|
220
|
+
: ''}
|
212
221
|
`;
|
213
222
|
}
|
214
223
|
}
|
@@ -8,6 +8,11 @@ declare const Buttonsimple_base: import("../../utils/mixins/index.types").Constr
|
|
8
8
|
* It is used as an internal component and is not intended to be used directly by consumers.
|
9
9
|
* Consumers should use the `mdc-button` component instead.
|
10
10
|
*
|
11
|
+
* @event click - (React: onClick) This event is dispatched when the button is clicked.
|
12
|
+
* @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the button.
|
13
|
+
* @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the button.
|
14
|
+
* @event focus - (React: onFocus) This event is dispatched when the button receives focus.
|
15
|
+
*
|
11
16
|
* @tagname mdc-buttonsimple
|
12
17
|
*/
|
13
18
|
declare class Buttonsimple extends Buttonsimple_base {
|
@@ -19,6 +19,11 @@ import styles from './buttonsimple.styles';
|
|
19
19
|
* It is used as an internal component and is not intended to be used directly by consumers.
|
20
20
|
* Consumers should use the `mdc-button` component instead.
|
21
21
|
*
|
22
|
+
* @event click - (React: onClick) This event is dispatched when the button is clicked.
|
23
|
+
* @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the button.
|
24
|
+
* @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the button.
|
25
|
+
* @event focus - (React: onFocus) This event is dispatched when the button receives focus.
|
26
|
+
*
|
22
27
|
* @tagname mdc-buttonsimple
|
23
28
|
*/
|
24
29
|
class Buttonsimple extends TabIndexMixin(DisabledMixin(Component)) {
|
@@ -13,6 +13,9 @@ declare const Checkbox_base: import("../../utils/mixins/index.types").Constructo
|
|
13
13
|
*
|
14
14
|
* @tagname mdc-checkbox
|
15
15
|
*
|
16
|
+
* @event change - (React: onChange) Event that gets dispatched when the checkbox state changes.
|
17
|
+
* @event focus - (React: onFocus) Event that gets dispatched when the checkbox receives focus.
|
18
|
+
*
|
16
19
|
* @cssproperty --mdc-checkbox-background-color-hover - Allows customization of the background color on hover.
|
17
20
|
* @cssproperty --mdc-checkbox-border-color - Border color in high contrast.
|
18
21
|
* @cssproperty --mdc-checkbox-checked-background-color - Background color for a selected checkbox.
|
@@ -29,6 +29,9 @@ import styles from './checkbox.styles';
|
|
29
29
|
*
|
30
30
|
* @tagname mdc-checkbox
|
31
31
|
*
|
32
|
+
* @event change - (React: onChange) Event that gets dispatched when the checkbox state changes.
|
33
|
+
* @event focus - (React: onFocus) Event that gets dispatched when the checkbox receives focus.
|
34
|
+
*
|
32
35
|
* @cssproperty --mdc-checkbox-background-color-hover - Allows customization of the background color on hover.
|
33
36
|
* @cssproperty --mdc-checkbox-border-color - Border color in high contrast.
|
34
37
|
* @cssproperty --mdc-checkbox-checked-background-color - Background color for a selected checkbox.
|
@@ -17,6 +17,11 @@ declare const Input_base: import("../../utils/mixins/index.types").Constructor<i
|
|
17
17
|
*
|
18
18
|
* @tagname mdc-input
|
19
19
|
*
|
20
|
+
* @event input - (React: onInput) This event is dispatched when the value of the input field changes (every press).
|
21
|
+
* @event change - (React: onChange) This event is dispatched when the value of the input field changes (on blur).
|
22
|
+
* @event focus - (React: onFocus) This event is dispatched when the input receives focus.
|
23
|
+
* @event blur - (React: onBlur) This event is dispatched when the input loses focus.
|
24
|
+
*
|
20
25
|
* @dependency mdc-icon
|
21
26
|
* @dependency mdc-text
|
22
27
|
* @dependency mdc-button
|
@@ -31,6 +31,11 @@ import { DataAriaLabelMixin } from '../../utils/mixins/DataAriaLabelMixin';
|
|
31
31
|
*
|
32
32
|
* @tagname mdc-input
|
33
33
|
*
|
34
|
+
* @event input - (React: onInput) This event is dispatched when the value of the input field changes (every press).
|
35
|
+
* @event change - (React: onChange) This event is dispatched when the value of the input field changes (on blur).
|
36
|
+
* @event focus - (React: onFocus) This event is dispatched when the input receives focus.
|
37
|
+
* @event blur - (React: onBlur) This event is dispatched when the input loses focus.
|
38
|
+
*
|
34
39
|
* @dependency mdc-icon
|
35
40
|
* @dependency mdc-text
|
36
41
|
* @dependency mdc-button
|
@@ -10,6 +10,9 @@ declare const Radio_base: import("../../utils/mixins/index.types").Constructor<i
|
|
10
10
|
*
|
11
11
|
* @tagname mdc-radio
|
12
12
|
*
|
13
|
+
* @event change - (React: onChange) Event that gets dispatched when the radio state changes.
|
14
|
+
* @event focus - (React: onFocus) Event that gets dispatched when the radio receives focus.
|
15
|
+
*
|
13
16
|
* @cssproperty --mdc-radio-inner-circle-size - size of the inner circle
|
14
17
|
* @cssproperty --mdc-radio-text-disabled-color - color of the label when disabled
|
15
18
|
* @cssproperty --mdc-radio-disabled-border-color - color of the radio button border when disabled
|
@@ -25,6 +25,9 @@ import { DEFAULTS as FORMFIELD_DEFAULTS } from '../formfieldwrapper/formfieldwra
|
|
25
25
|
*
|
26
26
|
* @tagname mdc-radio
|
27
27
|
*
|
28
|
+
* @event change - (React: onChange) Event that gets dispatched when the radio state changes.
|
29
|
+
* @event focus - (React: onFocus) Event that gets dispatched when the radio receives focus.
|
30
|
+
*
|
28
31
|
* @cssproperty --mdc-radio-inner-circle-size - size of the inner circle
|
29
32
|
* @cssproperty --mdc-radio-text-disabled-color - color of the label when disabled
|
30
33
|
* @cssproperty --mdc-radio-disabled-border-color - color of the radio button border when disabled
|
@@ -19,6 +19,11 @@ declare const Tab_base: import("../../utils/mixins/index.types").Constructor<imp
|
|
19
19
|
* @dependency mdc-icon
|
20
20
|
* @dependency mdc-text
|
21
21
|
*
|
22
|
+
* @event click - (React: onClick) This event is dispatched when the tab is clicked.
|
23
|
+
* @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the tab.
|
24
|
+
* @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the tab.
|
25
|
+
* @event focus - (React: onFocus) This event is dispatched when the tab receives focus.
|
26
|
+
*
|
22
27
|
* @tagname mdc-tab
|
23
28
|
*
|
24
29
|
* @cssproperty --mdc-tab-content-gap - Gap between the badge(if provided), icon and text.
|
@@ -32,6 +32,11 @@ import { IconNameMixin } from '../../utils/mixins/IconNameMixin';
|
|
32
32
|
* @dependency mdc-icon
|
33
33
|
* @dependency mdc-text
|
34
34
|
*
|
35
|
+
* @event click - (React: onClick) This event is dispatched when the tab is clicked.
|
36
|
+
* @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the tab.
|
37
|
+
* @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the tab.
|
38
|
+
* @event focus - (React: onFocus) This event is dispatched when the tab receives focus.
|
39
|
+
*
|
35
40
|
* @tagname mdc-tab
|
36
41
|
*
|
37
42
|
* @cssproperty --mdc-tab-content-gap - Gap between the badge(if provided), icon and text.
|
@@ -16,6 +16,9 @@ declare const Toggle_base: import("../../utils/mixins/index.types").Constructor<
|
|
16
16
|
*
|
17
17
|
* @tagname mdc-toggle
|
18
18
|
*
|
19
|
+
* @event change - (React: onChange) Event that gets dispatched when the toggle state changes.
|
20
|
+
* @event focus - (React: onFocus) Event that gets dispatched when the toggle receives focus.
|
21
|
+
*
|
19
22
|
* @cssproperty --mdc-toggle-width - width of the toggle
|
20
23
|
* @cssproperty --mdc-toggle-height - height of the toggle
|
21
24
|
* @cssproperty --mdc-toggle-width-compact - width of the toggle when it's size is compact
|
@@ -31,6 +31,9 @@ import { DataAriaLabelMixin } from '../../utils/mixins/DataAriaLabelMixin';
|
|
31
31
|
*
|
32
32
|
* @tagname mdc-toggle
|
33
33
|
*
|
34
|
+
* @event change - (React: onChange) Event that gets dispatched when the toggle state changes.
|
35
|
+
* @event focus - (React: onFocus) Event that gets dispatched when the toggle receives focus.
|
36
|
+
*
|
34
37
|
* @cssproperty --mdc-toggle-width - width of the toggle
|
35
38
|
* @cssproperty --mdc-toggle-height - height of the toggle
|
36
39
|
* @cssproperty --mdc-toggle-width-compact - width of the toggle when it's size is compact
|
@@ -13,6 +13,8 @@ import { SetListDataProps, VirtualizerProps } from './virtualizedlist.types';
|
|
13
13
|
*
|
14
14
|
* @tagname mdc-virtualizedlist
|
15
15
|
*
|
16
|
+
* @event onscroll - (React: onScroll) Event that gets called when user scrolls inside of list.
|
17
|
+
*
|
16
18
|
* @slot - Client side List with nested list items.
|
17
19
|
*/
|
18
20
|
declare class VirtualizedList extends Component {
|
@@ -24,6 +24,8 @@ import { DEFAULTS } from './virtualizedlist.constants';
|
|
24
24
|
*
|
25
25
|
* @tagname mdc-virtualizedlist
|
26
26
|
*
|
27
|
+
* @event onscroll - (React: onScroll) Event that gets called when user scrolls inside of list.
|
28
|
+
*
|
27
29
|
* @slot - Client side List with nested list items.
|
28
30
|
*/
|
29
31
|
class VirtualizedList extends Component {
|