@dile/ui 2.0.3 → 2.0.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.
@@ -14,6 +14,9 @@ export class DileIcon extends LitElement {
14
14
  css`
15
15
  :host {
16
16
  display: inline-block;
17
+ transition-duration: 0.3s;
18
+ transition-timing-function: ease-in-out;
19
+ transition-property: background-color;
17
20
  }
18
21
  span {
19
22
  display: flex;
@@ -0,0 +1,4 @@
1
+ import './modal.js';
2
+ import { DileModalHelp } from './src/DileModalHelp.js';
3
+
4
+ customElements.define("dile-modal-help", DileModalHelp);
@@ -0,0 +1,83 @@
1
+ import { LitElement, html, css } from 'lit';
2
+ import { helpIcon } from '@dile/icons';
3
+ import '../../icon/icon.js';
4
+ import '../../button/button-icon.js'
5
+
6
+ export class DileModalHelp extends LitElement {
7
+ static styles = [
8
+ css`
9
+ :host {
10
+ display: flex;
11
+ align-items: center;
12
+ --dile-modal-width: var(--dile-modal-help-width, 95vw);
13
+ --dile-modal-height: auto;
14
+ --dile-modal-max-height: 95vh;
15
+ color: #303030;
16
+ }
17
+ h1 {
18
+ margin: 0 0 1rem;
19
+ font-size: 1.5rem;
20
+ font-weight: 300;
21
+ color: var(--primary-dark-color);
22
+ padding-bottom: 0.5rem;
23
+ border-bottom: 1px solid var(--primary-color);
24
+ }
25
+ .content {
26
+ overflow: auto;
27
+ max-height: 90vh;
28
+ }
29
+ @media(min-width: 380px) {
30
+ :host {
31
+ --dile-modal-width: var(--dile-modal-help-width, 85vw);
32
+ }
33
+ }
34
+ @media(min-width: 580px) {
35
+ :host {
36
+ --dile-modal-width: var(--dile-modal-help-width, 65vw);
37
+ }
38
+ }
39
+ `
40
+ ];
41
+
42
+ static get properties() {
43
+ return {
44
+ label: { type: String },
45
+ icon: { type: Object },
46
+ title: { type: String },
47
+ onlyIcon: { type: Boolean },
48
+ };
49
+ }
50
+
51
+ constructor() {
52
+ super();
53
+ this.label = 'Help';
54
+ this.icon = helpIcon;
55
+ }
56
+
57
+ render() {
58
+ return html`
59
+ ${this.onlyIcon
60
+ ? html`<dile-icon .icon=${this.icon} @click=${this.open}></dile-icon>`
61
+ : html`
62
+ <dile-button-icon
63
+ .icon="${this.icon}"
64
+ @click=${this.open}
65
+ >${this.label}</dile-button-icon>
66
+ `
67
+ }
68
+ <dile-modal id="elmodal" showCloseIcon>
69
+ <div class="content">
70
+ ${this.title
71
+ ? html`<h1>${this.title}</h1>`
72
+ : ''
73
+ }
74
+ <slot></slot>
75
+ </div>
76
+ </dile-modal>
77
+ `;
78
+ }
79
+
80
+ open() {
81
+ this.shadowRoot.getElementById('elmodal').open();
82
+ }
83
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dile/ui",
3
- "version": "2.0.3",
3
+ "version": "2.0.5",
4
4
  "description": "UI Core components from dile-components.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -26,5 +26,5 @@
26
26
  "publishConfig": {
27
27
  "access": "public"
28
28
  },
29
- "gitHead": "41b99158b3537b02a2e823bdd162cfdd0b7e7323"
29
+ "gitHead": "5729fddd17447802e7e0da3fff761c11dcf24b53"
30
30
  }