@momentum-design/components 0.30.1 → 0.31.1
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 +150 -205
- package/dist/browser/index.js.map +4 -4
- package/dist/components/popover/index.d.ts +0 -1
- package/dist/components/popover/index.js +0 -1
- package/dist/components/popover/popover.component.d.ts +18 -9
- package/dist/components/popover/popover.component.js +71 -70
- package/dist/components/popover/popover.constants.d.ts +5 -1
- package/dist/components/popover/popover.constants.js +5 -2
- package/dist/components/popover/popover.styles.js +22 -25
- package/dist/components/popover/popover.types.d.ts +2 -1
- package/dist/components/popover/popover.utils.d.ts +1 -0
- package/dist/components/popover/popover.utils.js +30 -11
- package/dist/custom-elements.json +44 -436
- package/dist/react/index.d.ts +0 -1
- package/dist/react/index.js +0 -1
- package/dist/react/popover/index.d.ts +3 -2
- package/dist/react/popover/index.js +3 -2
- package/package.json +1 -1
- package/dist/components/modalcontainer/index.d.ts +0 -7
- package/dist/components/modalcontainer/index.js +0 -4
- package/dist/components/modalcontainer/modalcontainer.component.d.ts +0 -50
- package/dist/components/modalcontainer/modalcontainer.component.js +0 -96
- package/dist/components/modalcontainer/modalcontainer.constants.d.ts +0 -20
- package/dist/components/modalcontainer/modalcontainer.constants.js +0 -21
- package/dist/components/modalcontainer/modalcontainer.styles.d.ts +0 -2
- package/dist/components/modalcontainer/modalcontainer.styles.js +0 -45
- package/dist/components/modalcontainer/modalcontainer.types.d.ts +0 -4
- package/dist/components/modalcontainer/modalcontainer.types.js +0 -1
- package/dist/react/modalcontainer/index.d.ts +0 -17
- package/dist/react/modalcontainer/index.js +0 -26
- package/dist/utils/mixins/DataAriaDescribedbyMixin.d.ts +0 -6
- package/dist/utils/mixins/DataAriaDescribedbyMixin.js +0 -30
- package/dist/utils/mixins/DataAriaLabelledbyMixin.d.ts +0 -6
- package/dist/utils/mixins/DataAriaLabelledbyMixin.js +0 -29
@@ -1,50 +0,0 @@
|
|
1
|
-
import { CSSResult } from 'lit';
|
2
|
-
import { Component } from '../../models';
|
3
|
-
import type { ModalContainerColor, ModalContainerElevation } from './modalcontainer.types';
|
4
|
-
declare const Modalcontainer_base: import("../../utils/mixins/index.types").Constructor<import("../../utils/mixins/DataAriaLabelMixin").DataAriaLabelMixinInterface> & import("../../utils/mixins/index.types").Constructor<import("../../utils/mixins/DataAriaLabelledbyMixin").DataAriaLabelledbyMixinInterface> & import("../../utils/mixins/index.types").Constructor<import("../../utils/mixins/DataAriaDescribedbyMixin").DataAriaDescribedbyMixinInterface> & typeof Component;
|
5
|
-
/**
|
6
|
-
* The `mdc-modalcontainer` component is an element used to
|
7
|
-
* display a modal container that can further be used in popover.
|
8
|
-
*
|
9
|
-
* @tagname mdc-modalcontainer
|
10
|
-
*
|
11
|
-
* @cssproperty --mdc-modalcontainer-primary-background-color - primary background color of the modalcontainer
|
12
|
-
* @cssproperty --mdc-modalcontainer-border-color - border color of the modalcontainer
|
13
|
-
* @cssproperty --mdc-modalcontainer-inverted-background-color - inverted background color of the modalcontainer
|
14
|
-
* @cssproperty --mdc-modalcontainer-inverted-border-color - inverted border color of the modalcontainer
|
15
|
-
* @cssproperty --mdc-modalcontainer-inverted-text-color - inverted text color of the modalcontainer
|
16
|
-
*
|
17
|
-
* @slot - Default slot for modal container
|
18
|
-
*/
|
19
|
-
declare class Modalcontainer extends Modalcontainer_base {
|
20
|
-
/**
|
21
|
-
* Color of the modalcontainer
|
22
|
-
* - **tonal**
|
23
|
-
* - **contrast**
|
24
|
-
* @default tonal
|
25
|
-
*/
|
26
|
-
color: ModalContainerColor;
|
27
|
-
/**
|
28
|
-
* Elevation of the modalcontainer where each value corresponds to a different drop shadow.
|
29
|
-
* - **0**
|
30
|
-
* - **1**
|
31
|
-
* - **2**
|
32
|
-
* - **3**
|
33
|
-
* - **4**
|
34
|
-
* @default 0
|
35
|
-
*/
|
36
|
-
elevation: ModalContainerElevation;
|
37
|
-
/**
|
38
|
-
* Role of the modalcontainer
|
39
|
-
* @default dialog
|
40
|
-
*/
|
41
|
-
dataRole: HTMLElement['role'];
|
42
|
-
/**
|
43
|
-
* Aria modal of the modalcontainer
|
44
|
-
* @default false
|
45
|
-
*/
|
46
|
-
dataAriaModal: boolean;
|
47
|
-
render(): import("lit-html").TemplateResult<1>;
|
48
|
-
static styles: Array<CSSResult>;
|
49
|
-
}
|
50
|
-
export default Modalcontainer;
|
@@ -1,96 +0,0 @@
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
6
|
-
};
|
7
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
8
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
9
|
-
};
|
10
|
-
import { html } from 'lit';
|
11
|
-
import { property } from 'lit/decorators.js';
|
12
|
-
import { ifDefined } from 'lit/directives/if-defined.js';
|
13
|
-
import styles from './modalcontainer.styles';
|
14
|
-
import { Component } from '../../models';
|
15
|
-
import { DEFAULTS } from './modalcontainer.constants';
|
16
|
-
import { DataAriaLabelMixin } from '../../utils/mixins/DataAriaLabelMixin';
|
17
|
-
import { DataAriaDescribedbyMixin } from '../../utils/mixins/DataAriaDescribedbyMixin';
|
18
|
-
import { DataAriaLabelledbyMixin } from '../../utils/mixins/DataAriaLabelledbyMixin';
|
19
|
-
/**
|
20
|
-
* The `mdc-modalcontainer` component is an element used to
|
21
|
-
* display a modal container that can further be used in popover.
|
22
|
-
*
|
23
|
-
* @tagname mdc-modalcontainer
|
24
|
-
*
|
25
|
-
* @cssproperty --mdc-modalcontainer-primary-background-color - primary background color of the modalcontainer
|
26
|
-
* @cssproperty --mdc-modalcontainer-border-color - border color of the modalcontainer
|
27
|
-
* @cssproperty --mdc-modalcontainer-inverted-background-color - inverted background color of the modalcontainer
|
28
|
-
* @cssproperty --mdc-modalcontainer-inverted-border-color - inverted border color of the modalcontainer
|
29
|
-
* @cssproperty --mdc-modalcontainer-inverted-text-color - inverted text color of the modalcontainer
|
30
|
-
*
|
31
|
-
* @slot - Default slot for modal container
|
32
|
-
*/
|
33
|
-
class Modalcontainer extends DataAriaLabelMixin(DataAriaLabelledbyMixin(DataAriaDescribedbyMixin(Component))) {
|
34
|
-
constructor() {
|
35
|
-
super(...arguments);
|
36
|
-
/**
|
37
|
-
* Color of the modalcontainer
|
38
|
-
* - **tonal**
|
39
|
-
* - **contrast**
|
40
|
-
* @default tonal
|
41
|
-
*/
|
42
|
-
this.color = DEFAULTS.COLOR;
|
43
|
-
/**
|
44
|
-
* Elevation of the modalcontainer where each value corresponds to a different drop shadow.
|
45
|
-
* - **0**
|
46
|
-
* - **1**
|
47
|
-
* - **2**
|
48
|
-
* - **3**
|
49
|
-
* - **4**
|
50
|
-
* @default 0
|
51
|
-
*/
|
52
|
-
this.elevation = DEFAULTS.ELEVATION;
|
53
|
-
/**
|
54
|
-
* Role of the modalcontainer
|
55
|
-
* @default dialog
|
56
|
-
*/
|
57
|
-
this.dataRole = DEFAULTS.ROLE;
|
58
|
-
/**
|
59
|
-
* Aria modal of the modalcontainer
|
60
|
-
* @default false
|
61
|
-
*/
|
62
|
-
this.dataAriaModal = DEFAULTS.ARIA_MODAL;
|
63
|
-
}
|
64
|
-
render() {
|
65
|
-
return html `
|
66
|
-
<div
|
67
|
-
role="${ifDefined(this.dataRole)}"
|
68
|
-
aria-modal=${ifDefined(this.dataAriaModal === true ? 'true' : undefined)}
|
69
|
-
aria-label="${ifDefined(this.dataAriaLabel)}"
|
70
|
-
aria-labelledby="${ifDefined(this.dataAriaLabelledby)}"
|
71
|
-
aria-describedby="${ifDefined(this.dataAriaDescribedby)}"
|
72
|
-
part="container"
|
73
|
-
>
|
74
|
-
<slot></slot>
|
75
|
-
</div>
|
76
|
-
`;
|
77
|
-
}
|
78
|
-
}
|
79
|
-
Modalcontainer.styles = [...Component.styles, ...styles];
|
80
|
-
__decorate([
|
81
|
-
property({ type: String, reflect: true }),
|
82
|
-
__metadata("design:type", String)
|
83
|
-
], Modalcontainer.prototype, "color", void 0);
|
84
|
-
__decorate([
|
85
|
-
property({ type: Number, reflect: true }),
|
86
|
-
__metadata("design:type", Number)
|
87
|
-
], Modalcontainer.prototype, "elevation", void 0);
|
88
|
-
__decorate([
|
89
|
-
property({ type: String, reflect: true, attribute: 'data-role' }),
|
90
|
-
__metadata("design:type", Object)
|
91
|
-
], Modalcontainer.prototype, "dataRole", void 0);
|
92
|
-
__decorate([
|
93
|
-
property({ type: Boolean, reflect: true, attribute: 'data-aria-modal' }),
|
94
|
-
__metadata("design:type", Boolean)
|
95
|
-
], Modalcontainer.prototype, "dataAriaModal", void 0);
|
96
|
-
export default Modalcontainer;
|
@@ -1,20 +0,0 @@
|
|
1
|
-
declare const TAG_NAME: "mdc-modalcontainer";
|
2
|
-
declare const COLOR: {
|
3
|
-
readonly TONAL: "tonal";
|
4
|
-
readonly CONTRAST: "contrast";
|
5
|
-
};
|
6
|
-
declare const ELEVATION: {
|
7
|
-
readonly 0: 0;
|
8
|
-
readonly 1: 1;
|
9
|
-
readonly 2: 2;
|
10
|
-
readonly 3: 3;
|
11
|
-
readonly 4: 4;
|
12
|
-
};
|
13
|
-
declare const DEFAULTS: {
|
14
|
-
readonly COLOR: "tonal";
|
15
|
-
readonly ELEVATION: 0;
|
16
|
-
readonly ROLE: "dialog";
|
17
|
-
readonly ARIA_MODAL: false;
|
18
|
-
readonly CHILDREN: "Lorem ipsum dolor sit amet";
|
19
|
-
};
|
20
|
-
export { TAG_NAME, COLOR, DEFAULTS, ELEVATION };
|
@@ -1,21 +0,0 @@
|
|
1
|
-
import utils from '../../utils/tag-name';
|
2
|
-
const TAG_NAME = utils.constructTagName('modalcontainer');
|
3
|
-
const COLOR = {
|
4
|
-
TONAL: 'tonal',
|
5
|
-
CONTRAST: 'contrast',
|
6
|
-
};
|
7
|
-
const ELEVATION = {
|
8
|
-
0: 0,
|
9
|
-
1: 1,
|
10
|
-
2: 2,
|
11
|
-
3: 3,
|
12
|
-
4: 4,
|
13
|
-
};
|
14
|
-
const DEFAULTS = {
|
15
|
-
COLOR: COLOR.TONAL,
|
16
|
-
ELEVATION: ELEVATION[0],
|
17
|
-
ROLE: 'dialog',
|
18
|
-
ARIA_MODAL: false,
|
19
|
-
CHILDREN: 'Lorem ipsum dolor sit amet',
|
20
|
-
};
|
21
|
-
export { TAG_NAME, COLOR, DEFAULTS, ELEVATION };
|
@@ -1,45 +0,0 @@
|
|
1
|
-
import { css } from 'lit';
|
2
|
-
import { hostFitContentStyles } from '../../utils/styles';
|
3
|
-
const styles = [
|
4
|
-
hostFitContentStyles,
|
5
|
-
css `
|
6
|
-
:host {
|
7
|
-
--mdc-modalcontainer-primary-background-color: var(--mds-color-theme-background-solid-primary-normal);
|
8
|
-
--mdc-modalcontainer-border-color: var(--mds-color-theme-outline-secondary-normal);
|
9
|
-
--mdc-modalcontainer-inverted-background-color: var(--mds-color-theme-inverted-background-normal);
|
10
|
-
--mdc-modalcontainer-inverted-border-color: var(--mds-color-theme-inverted-outline-primary-normal);
|
11
|
-
--mdc-modalcontainer-inverted-text-color: var(--mds-color-theme-inverted-text-primary-normal);
|
12
|
-
--mdc-modalcontainer-elevation-1: var(--mds-elevation-1);
|
13
|
-
--mdc-modalcontainer-elevation-2: var(--mds-elevation-2);
|
14
|
-
--mdc-modalcontainer-elevation-3: var(--mds-elevation-3);
|
15
|
-
--mdc-modalcontainer-elevation-4: var(--mds-elevation-4);
|
16
|
-
}
|
17
|
-
|
18
|
-
:host::part(container) {
|
19
|
-
padding: 0.75rem;
|
20
|
-
background-color: var(--mdc-modalcontainer-primary-background-color);
|
21
|
-
border-radius: 0.5rem;
|
22
|
-
border: 0.0625rem solid var(--mdc-modalcontainer-border-color);
|
23
|
-
}
|
24
|
-
|
25
|
-
:host([color='contrast'])::part(container) {
|
26
|
-
background-color: var(--mdc-modalcontainer-inverted-background-color);
|
27
|
-
border: 0.0625rem solid var(--mdc-modalcontainer-inverted-border-color);
|
28
|
-
color: var(--mdc-modalcontainer-inverted-text-color);
|
29
|
-
}
|
30
|
-
|
31
|
-
:host([elevation='1'])::part(container) {
|
32
|
-
filter: var(--mdc-modalcontainer-elevation-1);
|
33
|
-
}
|
34
|
-
:host([elevation='2'])::part(container) {
|
35
|
-
filter: var(--mdc-modalcontainer-elevation-2);
|
36
|
-
}
|
37
|
-
:host([elevation='3'])::part(container) {
|
38
|
-
filter: var(--mdc-modalcontainer-elevation-3);
|
39
|
-
}
|
40
|
-
:host([elevation='4'])::part(container) {
|
41
|
-
filter: var(--mdc-modalcontainer-elevation-4);
|
42
|
-
}
|
43
|
-
`,
|
44
|
-
];
|
45
|
-
export default styles;
|
@@ -1 +0,0 @@
|
|
1
|
-
export {};
|
@@ -1,17 +0,0 @@
|
|
1
|
-
import Component from '../../components/modalcontainer';
|
2
|
-
/**
|
3
|
-
* The `mdc-modalcontainer` component is an element used to
|
4
|
-
* display a modal container that can further be used in popover.
|
5
|
-
*
|
6
|
-
* @tagname mdc-modalcontainer
|
7
|
-
*
|
8
|
-
* @cssproperty --mdc-modalcontainer-primary-background-color - primary background color of the modalcontainer
|
9
|
-
* @cssproperty --mdc-modalcontainer-border-color - border color of the modalcontainer
|
10
|
-
* @cssproperty --mdc-modalcontainer-inverted-background-color - inverted background color of the modalcontainer
|
11
|
-
* @cssproperty --mdc-modalcontainer-inverted-border-color - inverted border color of the modalcontainer
|
12
|
-
* @cssproperty --mdc-modalcontainer-inverted-text-color - inverted text color of the modalcontainer
|
13
|
-
*
|
14
|
-
* @slot - Default slot for modal container
|
15
|
-
*/
|
16
|
-
declare const reactWrapper: import("@lit/react").ReactWebComponent<Component, {}>;
|
17
|
-
export default reactWrapper;
|
@@ -1,26 +0,0 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
import { createComponent } from '@lit/react';
|
3
|
-
import Component from '../../components/modalcontainer';
|
4
|
-
import { TAG_NAME } from '../../components/modalcontainer/modalcontainer.constants';
|
5
|
-
/**
|
6
|
-
* The `mdc-modalcontainer` component is an element used to
|
7
|
-
* display a modal container that can further be used in popover.
|
8
|
-
*
|
9
|
-
* @tagname mdc-modalcontainer
|
10
|
-
*
|
11
|
-
* @cssproperty --mdc-modalcontainer-primary-background-color - primary background color of the modalcontainer
|
12
|
-
* @cssproperty --mdc-modalcontainer-border-color - border color of the modalcontainer
|
13
|
-
* @cssproperty --mdc-modalcontainer-inverted-background-color - inverted background color of the modalcontainer
|
14
|
-
* @cssproperty --mdc-modalcontainer-inverted-border-color - inverted border color of the modalcontainer
|
15
|
-
* @cssproperty --mdc-modalcontainer-inverted-text-color - inverted text color of the modalcontainer
|
16
|
-
*
|
17
|
-
* @slot - Default slot for modal container
|
18
|
-
*/
|
19
|
-
const reactWrapper = createComponent({
|
20
|
-
tagName: TAG_NAME,
|
21
|
-
elementClass: Component,
|
22
|
-
react: React,
|
23
|
-
events: {},
|
24
|
-
displayName: 'Modalcontainer',
|
25
|
-
});
|
26
|
-
export default reactWrapper;
|
@@ -1,6 +0,0 @@
|
|
1
|
-
import { LitElement } from 'lit';
|
2
|
-
import type { Constructor } from './index.types';
|
3
|
-
export interface DataAriaDescribedbyMixinInterface {
|
4
|
-
dataAriaDescribedby: string | null;
|
5
|
-
}
|
6
|
-
export declare const DataAriaDescribedbyMixin: <T extends Constructor<LitElement>>(superClass: T) => Constructor<DataAriaDescribedbyMixinInterface> & T;
|
@@ -1,30 +0,0 @@
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
6
|
-
};
|
7
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
8
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
9
|
-
};
|
10
|
-
import { property } from 'lit/decorators.js';
|
11
|
-
export const DataAriaDescribedbyMixin = (superClass) => {
|
12
|
-
class InnerMixinClass extends superClass {
|
13
|
-
constructor() {
|
14
|
-
super(...arguments);
|
15
|
-
/**
|
16
|
-
* Defines an ID reference to one or more elements that provide additional
|
17
|
-
* descriptive information for the current element.
|
18
|
-
* The `aria-describedby` attribute to be set for accessibility.
|
19
|
-
* @default null
|
20
|
-
*/
|
21
|
-
this.dataAriaDescribedby = null;
|
22
|
-
}
|
23
|
-
}
|
24
|
-
__decorate([
|
25
|
-
property({ type: String, reflect: true, attribute: 'data-aria-describedby' }),
|
26
|
-
__metadata("design:type", Object)
|
27
|
-
], InnerMixinClass.prototype, "dataAriaDescribedby", void 0);
|
28
|
-
// Cast return type to your mixin's interface intersected with the superClass type
|
29
|
-
return InnerMixinClass;
|
30
|
-
};
|
@@ -1,6 +0,0 @@
|
|
1
|
-
import { LitElement } from 'lit';
|
2
|
-
import type { Constructor } from './index.types';
|
3
|
-
export interface DataAriaLabelledbyMixinInterface {
|
4
|
-
dataAriaLabelledby: string | null;
|
5
|
-
}
|
6
|
-
export declare const DataAriaLabelledbyMixin: <T extends Constructor<LitElement>>(superClass: T) => Constructor<DataAriaLabelledbyMixinInterface> & T;
|
@@ -1,29 +0,0 @@
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
6
|
-
};
|
7
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
8
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
9
|
-
};
|
10
|
-
import { property } from 'lit/decorators.js';
|
11
|
-
export const DataAriaLabelledbyMixin = (superClass) => {
|
12
|
-
class InnerMixinClass extends superClass {
|
13
|
-
constructor() {
|
14
|
-
super(...arguments);
|
15
|
-
/**
|
16
|
-
* Defines an ID reference to one or more elements that label the current element.
|
17
|
-
* The `aria-labelledby` attribute to be set for accessibility.
|
18
|
-
* @default null
|
19
|
-
*/
|
20
|
-
this.dataAriaLabelledby = null;
|
21
|
-
}
|
22
|
-
}
|
23
|
-
__decorate([
|
24
|
-
property({ type: String, reflect: true, attribute: 'data-aria-labelledby' }),
|
25
|
-
__metadata("design:type", Object)
|
26
|
-
], InnerMixinClass.prototype, "dataAriaLabelledby", void 0);
|
27
|
-
// Cast return type to your mixin's interface intersected with the superClass type
|
28
|
-
return InnerMixinClass;
|
29
|
-
};
|