@momentum-design/components 0.16.14 → 0.16.15

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.
@@ -0,0 +1,7 @@
1
+ import Modalcontainer from './modalcontainer.component';
2
+ declare global {
3
+ interface HTMLElementTagNameMap {
4
+ ['mdc-modalcontainer']: Modalcontainer;
5
+ }
6
+ }
7
+ export default Modalcontainer;
@@ -0,0 +1,4 @@
1
+ import Modalcontainer from './modalcontainer.component';
2
+ import { TAG_NAME } from './modalcontainer.constants';
3
+ Modalcontainer.register(TAG_NAME);
4
+ export default Modalcontainer;
@@ -0,0 +1,44 @@
1
+ import { CSSResult } from 'lit';
2
+ import { Component } from '../../models';
3
+ import type { ModalContainerColor, ModalContainerElevation, ModalContainerRole } from './modalcontainer.types';
4
+ /**
5
+ * The `mdc-modalcontainer` component is an element used to
6
+ * display a modal container that can further be used in popover.
7
+ *
8
+ * @tagname mdc-modalcontainer
9
+ *
10
+ * @cssproperty --mdc-modalcontainer-primary-background-color - primary background color of the modalcontainer
11
+ * @cssproperty --mdc-modalcontainer-border-color - border color of the modalcontainer
12
+ * @cssproperty --mdc-modalcontainer-inverted-background-color - inverted background color of the modalcontainer
13
+ * @cssproperty --mdc-modalcontainer-inverted-border-color - inverted border color of the modalcontainer
14
+ * @cssproperty --mdc-modalcontainer-inverted-text-color - inverted text color of the modalcontainer
15
+ *
16
+ * @slot - Default slot for modal container
17
+ */
18
+ declare class Modalcontainer extends Component {
19
+ /**
20
+ * Color of the modalcontainer
21
+ * - **tonal**
22
+ * - **contrast**
23
+ * @default tonal
24
+ */
25
+ color: ModalContainerColor;
26
+ /**
27
+ * Elevation of the modalcontainer where each value corresponds to a different drop shadow.
28
+ * - **0**
29
+ * - **1**
30
+ * - **2**
31
+ * - **3**
32
+ * - **4**
33
+ * @default 0
34
+ */
35
+ elevation: ModalContainerElevation;
36
+ /**
37
+ * Role of the modalcontainer
38
+ * @default dialog
39
+ */
40
+ role: ModalContainerRole;
41
+ render(): import("lit-html").TemplateResult<1>;
42
+ static styles: Array<CSSResult>;
43
+ }
44
+ export default Modalcontainer;
@@ -0,0 +1,85 @@
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
+ /**
17
+ * The `mdc-modalcontainer` component is an element used to
18
+ * display a modal container that can further be used in popover.
19
+ *
20
+ * @tagname mdc-modalcontainer
21
+ *
22
+ * @cssproperty --mdc-modalcontainer-primary-background-color - primary background color of the modalcontainer
23
+ * @cssproperty --mdc-modalcontainer-border-color - border color of the modalcontainer
24
+ * @cssproperty --mdc-modalcontainer-inverted-background-color - inverted background color of the modalcontainer
25
+ * @cssproperty --mdc-modalcontainer-inverted-border-color - inverted border color of the modalcontainer
26
+ * @cssproperty --mdc-modalcontainer-inverted-text-color - inverted text color of the modalcontainer
27
+ *
28
+ * @slot - Default slot for modal container
29
+ */
30
+ class Modalcontainer extends Component {
31
+ constructor() {
32
+ super(...arguments);
33
+ /**
34
+ * Color of the modalcontainer
35
+ * - **tonal**
36
+ * - **contrast**
37
+ * @default tonal
38
+ */
39
+ this.color = DEFAULTS.COLOR;
40
+ /**
41
+ * Elevation of the modalcontainer where each value corresponds to a different drop shadow.
42
+ * - **0**
43
+ * - **1**
44
+ * - **2**
45
+ * - **3**
46
+ * - **4**
47
+ * @default 0
48
+ */
49
+ this.elevation = DEFAULTS.ELEVATION;
50
+ /**
51
+ * Role of the modalcontainer
52
+ * @default dialog
53
+ */
54
+ this.role = DEFAULTS.ROLE;
55
+ }
56
+ render() {
57
+ return html `
58
+ <div
59
+ id='mdc-modal-container'
60
+ class='mdc-modal-container'
61
+ ?contrast="${this.color === 'contrast'}"
62
+ role="${this.role}"
63
+ aria-modal='true'
64
+ aria-label=${ifDefined(this.ariaLabel)}
65
+ data-elevation="${this.elevation}"
66
+ >
67
+ <slot></slot>
68
+ </div>
69
+ `;
70
+ }
71
+ }
72
+ Modalcontainer.styles = [...Component.styles, ...styles];
73
+ __decorate([
74
+ property({ type: String, reflect: true }),
75
+ __metadata("design:type", String)
76
+ ], Modalcontainer.prototype, "color", void 0);
77
+ __decorate([
78
+ property({ type: Number, reflect: true }),
79
+ __metadata("design:type", Number)
80
+ ], Modalcontainer.prototype, "elevation", void 0);
81
+ __decorate([
82
+ property({ type: String }),
83
+ __metadata("design:type", String)
84
+ ], Modalcontainer.prototype, "role", void 0);
85
+ export default Modalcontainer;
@@ -0,0 +1,23 @@
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 ROLE: {
14
+ readonly DIALOG: "dialog";
15
+ readonly ALERT_DIALOG: "alertdialog";
16
+ };
17
+ declare const DEFAULTS: {
18
+ readonly COLOR: "tonal";
19
+ readonly ELEVATION: 0;
20
+ readonly ROLE: "dialog";
21
+ readonly CHILDREN: "Lorem ipsum dolor sit amet";
22
+ };
23
+ export { TAG_NAME, COLOR, DEFAULTS, ELEVATION, ROLE };
@@ -0,0 +1,24 @@
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 ROLE = {
15
+ DIALOG: 'dialog',
16
+ ALERT_DIALOG: 'alertdialog',
17
+ };
18
+ const DEFAULTS = {
19
+ COLOR: COLOR.TONAL,
20
+ ELEVATION: ELEVATION[0],
21
+ ROLE: ROLE.DIALOG,
22
+ CHILDREN: 'Lorem ipsum dolor sit amet',
23
+ };
24
+ export { TAG_NAME, COLOR, DEFAULTS, ELEVATION, ROLE };
@@ -0,0 +1,2 @@
1
+ declare const styles: import("lit").CSSResult[];
2
+ export default styles;
@@ -0,0 +1,45 @@
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
+ .mdc-modal-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
+ .mdc-modal-container[contrast] {
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
+ .mdc-modal-container[data-elevation='1'] {
32
+ filter: var(--mdc-modalcontainer-elevation-1);
33
+ }
34
+ .mdc-modal-container[data-elevation='2'] {
35
+ filter: var(--mdc-modalcontainer-elevation-2);
36
+ }
37
+ .mdc-modal-container[data-elevation='3'] {
38
+ filter: var(--mdc-modalcontainer-elevation-3);
39
+ }
40
+ .mdc-modal-container[data-elevation='4'] {
41
+ filter: var(--mdc-modalcontainer-elevation-4);
42
+ }
43
+ `,
44
+ ];
45
+ export default styles;
@@ -0,0 +1,5 @@
1
+ import type { ValueOf } from '../../utils/types';
2
+ import { COLOR, ELEVATION, ROLE } from './modalcontainer.constants';
3
+ export type ModalContainerColor = ValueOf<typeof COLOR>;
4
+ export type ModalContainerElevation = ValueOf<typeof ELEVATION>;
5
+ export type ModalContainerRole = ValueOf<typeof ROLE>;
@@ -2769,6 +2769,125 @@
2769
2769
  }
2770
2770
  ]
2771
2771
  },
2772
+ {
2773
+ "kind": "javascript-module",
2774
+ "path": "components/modalcontainer/modalcontainer.component.js",
2775
+ "declarations": [
2776
+ {
2777
+ "kind": "class",
2778
+ "description": "The `mdc-modalcontainer` component is an element used to\ndisplay a modal container that can further be used in popover.",
2779
+ "name": "Modalcontainer",
2780
+ "cssProperties": [
2781
+ {
2782
+ "description": "primary background color of the modalcontainer",
2783
+ "name": "--mdc-modalcontainer-primary-background-color"
2784
+ },
2785
+ {
2786
+ "description": "border color of the modalcontainer",
2787
+ "name": "--mdc-modalcontainer-border-color"
2788
+ },
2789
+ {
2790
+ "description": "inverted background color of the modalcontainer",
2791
+ "name": "--mdc-modalcontainer-inverted-background-color"
2792
+ },
2793
+ {
2794
+ "description": "inverted border color of the modalcontainer",
2795
+ "name": "--mdc-modalcontainer-inverted-border-color"
2796
+ },
2797
+ {
2798
+ "description": "inverted text color of the modalcontainer",
2799
+ "name": "--mdc-modalcontainer-inverted-text-color"
2800
+ }
2801
+ ],
2802
+ "slots": [
2803
+ {
2804
+ "description": "Default slot for modal container",
2805
+ "name": ""
2806
+ }
2807
+ ],
2808
+ "members": [
2809
+ {
2810
+ "kind": "field",
2811
+ "name": "color",
2812
+ "type": {
2813
+ "text": "ModalContainerColor"
2814
+ },
2815
+ "description": "Color of the modalcontainer\n- **tonal**\n- **contrast**",
2816
+ "default": "tonal",
2817
+ "attribute": "color",
2818
+ "reflects": true
2819
+ },
2820
+ {
2821
+ "kind": "field",
2822
+ "name": "elevation",
2823
+ "type": {
2824
+ "text": "ModalContainerElevation"
2825
+ },
2826
+ "description": "Elevation of the modalcontainer where each value corresponds to a different drop shadow.\n- **0**\n- **1**\n- **2**\n- **3**\n- **4**",
2827
+ "default": "0",
2828
+ "attribute": "elevation",
2829
+ "reflects": true
2830
+ },
2831
+ {
2832
+ "kind": "field",
2833
+ "name": "role",
2834
+ "type": {
2835
+ "text": "ModalContainerRole"
2836
+ },
2837
+ "description": "Role of the modalcontainer",
2838
+ "default": "dialog",
2839
+ "attribute": "role"
2840
+ }
2841
+ ],
2842
+ "attributes": [
2843
+ {
2844
+ "name": "color",
2845
+ "type": {
2846
+ "text": "ModalContainerColor"
2847
+ },
2848
+ "description": "Color of the modalcontainer\n- **tonal**\n- **contrast**",
2849
+ "default": "tonal",
2850
+ "fieldName": "color"
2851
+ },
2852
+ {
2853
+ "name": "elevation",
2854
+ "type": {
2855
+ "text": "ModalContainerElevation"
2856
+ },
2857
+ "description": "Elevation of the modalcontainer where each value corresponds to a different drop shadow.\n- **0**\n- **1**\n- **2**\n- **3**\n- **4**",
2858
+ "default": "0",
2859
+ "fieldName": "elevation"
2860
+ },
2861
+ {
2862
+ "name": "role",
2863
+ "type": {
2864
+ "text": "ModalContainerRole"
2865
+ },
2866
+ "description": "Role of the modalcontainer",
2867
+ "default": "dialog",
2868
+ "fieldName": "role"
2869
+ }
2870
+ ],
2871
+ "superclass": {
2872
+ "name": "Component",
2873
+ "module": "/src/models"
2874
+ },
2875
+ "tagName": "mdc-modalcontainer",
2876
+ "jsDoc": "/**\n * The `mdc-modalcontainer` component is an element used to\n * display a modal container that can further be used in popover.\n *\n * @tagname mdc-modalcontainer\n *\n * @cssproperty --mdc-modalcontainer-primary-background-color - primary background color of the modalcontainer\n * @cssproperty --mdc-modalcontainer-border-color - border color of the modalcontainer\n * @cssproperty --mdc-modalcontainer-inverted-background-color - inverted background color of the modalcontainer\n * @cssproperty --mdc-modalcontainer-inverted-border-color - inverted border color of the modalcontainer\n * @cssproperty --mdc-modalcontainer-inverted-text-color - inverted text color of the modalcontainer\n *\n * @slot - Default slot for modal container\n */",
2877
+ "customElement": true
2878
+ }
2879
+ ],
2880
+ "exports": [
2881
+ {
2882
+ "kind": "js",
2883
+ "name": "default",
2884
+ "declaration": {
2885
+ "name": "Modalcontainer",
2886
+ "module": "components/modalcontainer/modalcontainer.component.js"
2887
+ }
2888
+ }
2889
+ ]
2890
+ },
2772
2891
  {
2773
2892
  "kind": "javascript-module",
2774
2893
  "path": "components/presence/presence.component.js",
package/dist/index.d.ts CHANGED
@@ -9,8 +9,9 @@ import Button from './components/button';
9
9
  import Bullet from './components/bullet';
10
10
  import Marker from './components/marker';
11
11
  import Divider from './components/divider';
12
+ import Modalcontainer from './components/modalcontainer';
12
13
  import Buttonsimple from './components/buttonsimple';
13
14
  import Avatarbutton from './components/avatarbutton';
14
15
  import type { TextType } from './components/text/text.types';
15
- export { ThemeProvider, Icon, IconProvider, Avatar, Badge, Presence, Text, Button, Bullet, Marker, Divider, Buttonsimple, Avatarbutton, };
16
+ export { ThemeProvider, Icon, IconProvider, Avatar, Badge, Presence, Text, Button, Bullet, Marker, Divider, Modalcontainer, Buttonsimple, Avatarbutton, };
16
17
  export type { TextType, };
package/dist/index.js CHANGED
@@ -9,6 +9,7 @@ import Button from './components/button';
9
9
  import Bullet from './components/bullet';
10
10
  import Marker from './components/marker';
11
11
  import Divider from './components/divider';
12
+ import Modalcontainer from './components/modalcontainer';
12
13
  import Buttonsimple from './components/buttonsimple';
13
14
  import Avatarbutton from './components/avatarbutton';
14
- export { ThemeProvider, Icon, IconProvider, Avatar, Badge, Presence, Text, Button, Bullet, Marker, Divider, Buttonsimple, Avatarbutton, };
15
+ export { ThemeProvider, Icon, IconProvider, Avatar, Badge, Presence, Text, Button, Bullet, Marker, Divider, Modalcontainer, Buttonsimple, Avatarbutton, };
@@ -9,6 +9,7 @@ export { default as FormfieldWrapper } from './formfieldwrapper';
9
9
  export { default as Icon } from './icon';
10
10
  export { default as IconProvider } from './iconprovider';
11
11
  export { default as Marker } from './marker';
12
+ export { default as Modalcontainer } from './modalcontainer';
12
13
  export { default as Presence } from './presence';
13
14
  export { default as Text } from './text';
14
15
  export { default as ThemeProvider } from './themeprovider';
@@ -9,6 +9,7 @@ export { default as FormfieldWrapper } from './formfieldwrapper';
9
9
  export { default as Icon } from './icon';
10
10
  export { default as IconProvider } from './iconprovider';
11
11
  export { default as Marker } from './marker';
12
+ export { default as Modalcontainer } from './modalcontainer';
12
13
  export { default as Presence } from './presence';
13
14
  export { default as Text } from './text';
14
15
  export { default as ThemeProvider } from './themeprovider';
@@ -0,0 +1,17 @@
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;
@@ -0,0 +1,26 @@
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;
package/package.json CHANGED
@@ -36,5 +36,5 @@
36
36
  "lit": "^3.2.0",
37
37
  "uuid": "^11.0.5"
38
38
  },
39
- "version": "0.16.14"
39
+ "version": "0.16.15"
40
40
  }