@momentum-design/components 0.66.2 → 0.66.3
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 +10 -8
- package/dist/browser/index.js.map +2 -2
- package/dist/custom-elements.json +991 -577
- package/dist/react/index.d.ts +2 -2
- package/dist/react/index.js +2 -2
- package/dist/utils/mixins/ButtonComponentMixin.d.ts +6 -6
- package/dist/utils/mixins/ButtonComponentMixin.js +1 -0
- package/dist/utils/mixins/CardComponentMixin.d.ts +4 -4
- package/dist/utils/mixins/CardComponentMixin.js +27 -21
- package/dist/utils/mixins/FocusTrapMixin.d.ts +1 -1
- package/dist/utils/mixins/FocusTrapMixin.js +1 -0
- package/dist/utils/mixins/FormInternalsMixin.d.ts +3 -3
- package/dist/utils/mixins/FormInternalsMixin.js +10 -10
- package/package.json +1 -1
package/dist/react/index.d.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
+
export { default as AlertChip } from './alertchip';
|
1
2
|
export { default as Appheader } from './appheader';
|
2
3
|
export { default as Avatar } from './avatar';
|
3
|
-
export { default as AlertChip } from './alertchip';
|
4
4
|
export { default as AvatarButton } from './avatarbutton';
|
5
5
|
export { default as Badge } from './badge';
|
6
6
|
export { default as Brandvisual } from './brandvisual';
|
@@ -45,8 +45,8 @@ export { default as StaticCheckbox } from './staticcheckbox';
|
|
45
45
|
export { default as StaticRadio } from './staticradio';
|
46
46
|
export { default as StaticToggle } from './statictoggle';
|
47
47
|
export { default as Tab } from './tab';
|
48
|
-
export { default as Text } from './text';
|
49
48
|
export { default as TabList } from './tablist';
|
49
|
+
export { default as Text } from './text';
|
50
50
|
export { default as Textarea } from './textarea';
|
51
51
|
export { default as ThemeProvider } from './themeprovider';
|
52
52
|
export { default as Toggle } from './toggle';
|
package/dist/react/index.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
+
export { default as AlertChip } from './alertchip';
|
1
2
|
export { default as Appheader } from './appheader';
|
2
3
|
export { default as Avatar } from './avatar';
|
3
|
-
export { default as AlertChip } from './alertchip';
|
4
4
|
export { default as AvatarButton } from './avatarbutton';
|
5
5
|
export { default as Badge } from './badge';
|
6
6
|
export { default as Brandvisual } from './brandvisual';
|
@@ -45,8 +45,8 @@ export { default as StaticCheckbox } from './staticcheckbox';
|
|
45
45
|
export { default as StaticRadio } from './staticradio';
|
46
46
|
export { default as StaticToggle } from './statictoggle';
|
47
47
|
export { default as Tab } from './tab';
|
48
|
-
export { default as Text } from './text';
|
49
48
|
export { default as TabList } from './tablist';
|
49
|
+
export { default as Text } from './text';
|
50
50
|
export { default as Textarea } from './textarea';
|
51
51
|
export { default as ThemeProvider } from './themeprovider';
|
52
52
|
export { default as Toggle } from './toggle';
|
@@ -2,15 +2,15 @@ import type { ButtonColor, ButtonTypeInternal, ButtonVariant, IconButtonSize, Pi
|
|
2
2
|
import type { IconNames } from '../../components/icon/icon.types';
|
3
3
|
import type { Component } from '../../models';
|
4
4
|
import type { Constructor } from './index.types';
|
5
|
-
export
|
5
|
+
export declare class ButtonComponentMixinInterface {
|
6
6
|
prefixIcon?: IconNames;
|
7
7
|
postfixIcon?: IconNames;
|
8
8
|
variant: ButtonVariant;
|
9
9
|
color: ButtonColor;
|
10
|
-
typeInternal: ButtonTypeInternal;
|
11
|
-
setSize(size: PillButtonSize | IconButtonSize): void;
|
12
|
-
setVariant(variant: ButtonVariant): void;
|
13
|
-
setColor(color: ButtonColor): void;
|
14
|
-
inferButtonType(): void;
|
10
|
+
protected typeInternal: ButtonTypeInternal;
|
11
|
+
protected setSize(size: PillButtonSize | IconButtonSize): void;
|
12
|
+
protected setVariant(variant: ButtonVariant): void;
|
13
|
+
protected setColor(color: ButtonColor): void;
|
14
|
+
protected inferButtonType(): void;
|
15
15
|
}
|
16
16
|
export declare const ButtonComponentMixin: <T extends Constructor<Component>>(superClass: T) => Constructor<ButtonComponentMixinInterface> & T;
|
@@ -7,6 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
7
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
9
9
|
};
|
10
|
+
/* eslint-disable max-classes-per-file */
|
10
11
|
import { property, state } from 'lit/decorators.js';
|
11
12
|
import { BUTTON_COLORS, BUTTON_TYPE_INTERNAL, BUTTON_VARIANTS, DEFAULTS, ICON_BUTTON_SIZES, PILL_BUTTON_SIZES } from '../../components/button/button.constants';
|
12
13
|
export const ButtonComponentMixin = (superClass) => {
|
@@ -3,7 +3,7 @@ import type { CardOrientation, CardVariant } from '../../components/card/card.ty
|
|
3
3
|
import type { TagName as TagNameType } from '../../components/text/text.types';
|
4
4
|
import type { IconNames } from '../../components/icon/icon.types';
|
5
5
|
import type { Constructor } from './index.types';
|
6
|
-
export
|
6
|
+
export declare class CardComponentMixinInterface {
|
7
7
|
cardTitle: string;
|
8
8
|
subtitle: string;
|
9
9
|
imageSrc: string;
|
@@ -13,8 +13,8 @@ export interface CardComponentMixinInterface {
|
|
13
13
|
titleTagName: TagNameType;
|
14
14
|
subtitleTagName: TagNameType;
|
15
15
|
iconName?: IconNames;
|
16
|
-
renderIcon: () => TemplateResult;
|
17
|
-
renderImage: () => TemplateResult;
|
18
|
-
renderTitle: () => TemplateResult;
|
16
|
+
protected renderIcon: () => TemplateResult;
|
17
|
+
protected renderImage: () => TemplateResult;
|
18
|
+
protected renderTitle: () => TemplateResult;
|
19
19
|
}
|
20
20
|
export declare const CardComponentMixin: <T extends Constructor<LitElement>>(superClass: T) => Constructor<CardComponentMixinInterface> & T;
|
@@ -7,6 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
7
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
9
9
|
};
|
10
|
+
/* eslint-disable max-classes-per-file */
|
10
11
|
import { html, nothing } from 'lit';
|
11
12
|
import { property } from 'lit/decorators.js';
|
12
13
|
import { DEFAULTS } from '../../components/card/card.constants';
|
@@ -15,9 +16,9 @@ export const CardComponentMixin = (superClass) => {
|
|
15
16
|
constructor() {
|
16
17
|
super(...arguments);
|
17
18
|
/**
|
18
|
-
|
19
|
-
|
20
|
-
|
19
|
+
* The title of the card - part of header section
|
20
|
+
* @default ''
|
21
|
+
*/
|
21
22
|
this.cardTitle = '';
|
22
23
|
/**
|
23
24
|
* The subtitle of the card - part of header section
|
@@ -56,37 +57,42 @@ export const CardComponentMixin = (superClass) => {
|
|
56
57
|
this.subtitleTagName = DEFAULTS.TAGNAME;
|
57
58
|
}
|
58
59
|
/**
|
59
|
-
|
60
|
-
|
61
|
-
|
60
|
+
* Renders the image on the card if image source is provided
|
61
|
+
* @returns The image element
|
62
|
+
*/
|
62
63
|
renderImage() {
|
63
64
|
if (!this.imageSrc) {
|
64
65
|
return nothing;
|
65
66
|
}
|
66
|
-
return html `<img part="image" src="${this.imageSrc}" alt="${this.imageAlt}"/>`;
|
67
|
+
return html `<img part="image" src="${this.imageSrc}" alt="${this.imageAlt}" />`;
|
67
68
|
}
|
68
69
|
/**
|
69
|
-
|
70
|
-
|
71
|
-
|
70
|
+
* Renders the icon on the card if icon name is provided
|
71
|
+
* @returns The icon element
|
72
|
+
*/
|
72
73
|
renderIcon() {
|
73
|
-
return this.iconName
|
74
|
-
|
75
|
-
|
76
|
-
|
74
|
+
return this.iconName
|
75
|
+
? html `<mdc-icon
|
76
|
+
part="icon"
|
77
|
+
size="${DEFAULTS.ICON_SIZE}"
|
78
|
+
length-unit="${DEFAULTS.ICON_LENGTH_UNIT}"
|
79
|
+
name="${this.iconName}"
|
80
|
+
></mdc-icon>`
|
77
81
|
: nothing;
|
78
82
|
}
|
79
83
|
/**
|
80
|
-
|
81
|
-
|
82
|
-
|
84
|
+
* Renders the title and subtitle on the card
|
85
|
+
* @returns The title and subtitle elements
|
86
|
+
*/
|
83
87
|
renderTitle() {
|
84
88
|
return html `<div part="title-container">
|
85
89
|
<mdc-text part="title" type="${DEFAULTS.TITLE_TYPE}" tagname="${this.titleTagName}">${this.cardTitle}</mdc-text>
|
86
|
-
${this.subtitle
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
+
${this.subtitle
|
91
|
+
? html `<mdc-text part="subtitle" type="${DEFAULTS.SUBTITLE_TYPE}" tagname="${this.subtitleTagName}"
|
92
|
+
>${this.subtitle}</mdc-text
|
93
|
+
>`
|
94
|
+
: nothing}
|
95
|
+
</div>`;
|
90
96
|
}
|
91
97
|
}
|
92
98
|
__decorate([
|
@@ -7,6 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
7
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
9
9
|
};
|
10
|
+
/* eslint-disable max-classes-per-file */
|
10
11
|
import { property } from 'lit/decorators.js';
|
11
12
|
import { DEFAULTS as POPOVER_DEFAULTS } from '../../components/popover/popover.constants';
|
12
13
|
export const FocusTrapMixin = (superClass) => {
|
@@ -22,15 +22,15 @@ export interface AssociatedFormControl {
|
|
22
22
|
formResetCallback(): void;
|
23
23
|
formStateRestoreCallback(state: string | FormData | File, mode: 'restore' | 'autocomplete'): void;
|
24
24
|
}
|
25
|
-
export
|
25
|
+
export declare class FormInternalsMixinInterface {
|
26
26
|
name: string;
|
27
27
|
value: string;
|
28
28
|
form: HTMLFormElement | null;
|
29
29
|
validity: ValidityState;
|
30
30
|
validationMessage: string;
|
31
31
|
willValidate: boolean;
|
32
|
-
internals: ElementInternals;
|
33
|
-
inputElement: HTMLInputElement | HTMLTextAreaElement;
|
32
|
+
protected internals: ElementInternals;
|
33
|
+
protected inputElement: HTMLInputElement | HTMLTextAreaElement;
|
34
34
|
setValidity(): void;
|
35
35
|
checkValidity(): boolean;
|
36
36
|
reportValidity(): boolean;
|
@@ -14,15 +14,15 @@ export const FormInternalsMixin = (superClass) => {
|
|
14
14
|
constructor() {
|
15
15
|
super(...arguments);
|
16
16
|
/**
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
17
|
+
* Indicates the name of the component group.
|
18
|
+
* They are used to group elements in a form together.
|
19
|
+
* @default ''
|
20
|
+
*/
|
21
21
|
this.name = '';
|
22
22
|
/**
|
23
|
-
|
24
|
-
|
25
|
-
|
23
|
+
* Indicates the value of the component group (ex: input, checkbox, radio, select etc...)
|
24
|
+
* @default ''
|
25
|
+
*/
|
26
26
|
this.value = '';
|
27
27
|
/** @internal */
|
28
28
|
this.internals = this.attachInternals();
|
@@ -43,9 +43,9 @@ export const FormInternalsMixin = (superClass) => {
|
|
43
43
|
this.id = `mdc-input-${uuidv4()}`;
|
44
44
|
}
|
45
45
|
/**
|
46
|
-
|
47
|
-
|
48
|
-
|
46
|
+
* Sets the validity of the input field based on the input field's validity.
|
47
|
+
* @returns void
|
48
|
+
*/
|
49
49
|
setValidity() {
|
50
50
|
if (this.inputElement) {
|
51
51
|
this.internals.setValidity(this.inputElement.validity, this.inputElement.validationMessage, this.inputElement);
|
package/package.json
CHANGED