@dile/ui 2.0.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.
Files changed (172) hide show
  1. package/LICENSE +7 -0
  2. package/README.md +3 -0
  3. package/components/app-drawer/app-drawer.js +3 -0
  4. package/components/app-drawer/index.js +1 -0
  5. package/components/app-drawer/src/DileAppDrawer.js +153 -0
  6. package/components/avatar/avatar.js +3 -0
  7. package/components/avatar/index.js +1 -0
  8. package/components/avatar/src/DileAvatar.js +78 -0
  9. package/components/breadcrumbs/breadcrumbs-item.js +3 -0
  10. package/components/breadcrumbs/breadcrumbs.js +4 -0
  11. package/components/breadcrumbs/index.js +2 -0
  12. package/components/breadcrumbs/src/DileBreadcrumbs.js +76 -0
  13. package/components/breadcrumbs/src/DileBreadcrumbsItem.js +51 -0
  14. package/components/button/button-icon.js +3 -0
  15. package/components/button/button.js +3 -0
  16. package/components/button/index.js +2 -0
  17. package/components/button/src/DileButton.js +86 -0
  18. package/components/button/src/DileButtonIcon.js +38 -0
  19. package/components/card/card.js +3 -0
  20. package/components/card/index.js +1 -0
  21. package/components/card/src/DileCard.js +111 -0
  22. package/components/checkbox/checkbox.js +3 -0
  23. package/components/checkbox/index.js +1 -0
  24. package/components/checkbox/src/DileCheckbox.js +154 -0
  25. package/components/confirm/confirm.js +3 -0
  26. package/components/confirm/index.js +1 -0
  27. package/components/confirm/src/DileConfirm.js +121 -0
  28. package/components/datepicker/calendar.js +3 -0
  29. package/components/datepicker/datepicker.js +4 -0
  30. package/components/datepicker/index.js +2 -0
  31. package/components/datepicker/src/DileCalendar.js +72 -0
  32. package/components/datepicker/src/DileDatepicker.js +114 -0
  33. package/components/hamburger/hamburger.js +3 -0
  34. package/components/hamburger/index.js +1 -0
  35. package/components/hamburger/src/DileHamburger.js +129 -0
  36. package/components/icon/icon.js +3 -0
  37. package/components/icon/index.js +1 -0
  38. package/components/icon/src/DileIcon.js +40 -0
  39. package/components/icon-switch/icon-switch-group.js +3 -0
  40. package/components/icon-switch/icon-switch.js +3 -0
  41. package/components/icon-switch/index.js +1 -0
  42. package/components/icon-switch/src/DileIconSwitch.js +54 -0
  43. package/components/icon-switch/src/DileIconSwitchGroup.js +38 -0
  44. package/components/info-box/index.js +1 -0
  45. package/components/info-box/info-box.js +3 -0
  46. package/components/info-box/src/DileInfoBox.js +118 -0
  47. package/components/inline-feedback/index.js +1 -0
  48. package/components/inline-feedback/inline-feedback.js +3 -0
  49. package/components/inline-feedback/src/DileInlineFeedback.js +96 -0
  50. package/components/input/index.js +9 -0
  51. package/components/input/input-integer.js +3 -0
  52. package/components/input/input-message.js +3 -0
  53. package/components/input/input-money.js +3 -0
  54. package/components/input/input-number-mask.js +3 -0
  55. package/components/input/input-percentage.js +3 -0
  56. package/components/input/input-search.js +3 -0
  57. package/components/input/input.js +3 -0
  58. package/components/input/src/DileInput.js +245 -0
  59. package/components/input/src/DileInputInteger.js +45 -0
  60. package/components/input/src/DileInputMessage.js +12 -0
  61. package/components/input/src/DileInputMoney.js +72 -0
  62. package/components/input/src/DileInputNumberMask.js +83 -0
  63. package/components/input/src/DileInputPercentage.js +57 -0
  64. package/components/input/src/DileInputSearch.js +145 -0
  65. package/components/input/src/Mask.js +37 -0
  66. package/components/input/src/message-styles.js +14 -0
  67. package/components/menu-hamburger/index.js +1 -0
  68. package/components/menu-hamburger/menu-hamburger.js +3 -0
  69. package/components/menu-hamburger/src/DileMenuHamburger.js +89 -0
  70. package/components/menu-overlay/index.js +1 -0
  71. package/components/menu-overlay/menu-overlay.js +3 -0
  72. package/components/menu-overlay/src/DileMenuOverlay.js +71 -0
  73. package/components/message/index.js +1 -0
  74. package/components/message/message.js +3 -0
  75. package/components/message/src/DileMessage.js +166 -0
  76. package/components/modal/index.js +1 -0
  77. package/components/modal/modal.js +3 -0
  78. package/components/modal/src/DileModal.js +194 -0
  79. package/components/nav/index.js +1 -0
  80. package/components/nav/nav.js +3 -0
  81. package/components/nav/src/DileNav.js +68 -0
  82. package/components/order-switch/index.js +1 -0
  83. package/components/order-switch/order-switch.js +3 -0
  84. package/components/order-switch/src/DileOrderSwitch.js +74 -0
  85. package/components/pages/index.js +1 -0
  86. package/components/pages/pages.js +3 -0
  87. package/components/pages/src/DilePages.js +178 -0
  88. package/components/password/index.js +1 -0
  89. package/components/password/password.js +3 -0
  90. package/components/password/src/DilePassword.js +34 -0
  91. package/components/progress-bar/index.js +1 -0
  92. package/components/progress-bar/progress-bar.js +3 -0
  93. package/components/progress-bar/src/DileProgressBar.js +89 -0
  94. package/components/radio-group/index.js +2 -0
  95. package/components/radio-group/radio-group.js +3 -0
  96. package/components/radio-group/radio.js +3 -0
  97. package/components/radio-group/src/DileRadio.js +79 -0
  98. package/components/radio-group/src/DileRadioGroup.js +102 -0
  99. package/components/range/index.js +1 -0
  100. package/components/range/range.js +3 -0
  101. package/components/range/src/DileRange.js +119 -0
  102. package/components/rating/index.js +1 -0
  103. package/components/rating/rating.js +4 -0
  104. package/components/rating/src/DileRating.js +119 -0
  105. package/components/rating/src/DileStar.js +63 -0
  106. package/components/rating/star.js +3 -0
  107. package/components/rating-scale-question/index.js +2 -0
  108. package/components/rating-scale-question/rating-scale-option.js +3 -0
  109. package/components/rating-scale-question/rating-scale-question.js +3 -0
  110. package/components/rating-scale-question/src/DileRatingScaleOption.js +184 -0
  111. package/components/rating-scale-question/src/DileRatingScaleQuestion.js +252 -0
  112. package/components/select/index.js +1 -0
  113. package/components/select/select-ajax.js +4 -0
  114. package/components/select/select.js +3 -0
  115. package/components/select/src/DileSelect.js +172 -0
  116. package/components/select/src/DileSelectAjax.js +338 -0
  117. package/components/selector/index.js +2 -0
  118. package/components/selector/selector-item.js +3 -0
  119. package/components/selector/selector.js +3 -0
  120. package/components/selector/src/DileSelector.js +12 -0
  121. package/components/selector/src/DileSelectorItem.js +94 -0
  122. package/components/slide-show/index.js +1 -0
  123. package/components/slide-show/slide-show.js +3 -0
  124. package/components/slide-show/src/DileSlideShow.js +111 -0
  125. package/components/social-icon/index.js +1 -0
  126. package/components/social-icon/social-icon.js +3 -0
  127. package/components/social-icon/src/DileSocialIcon.js +63 -0
  128. package/components/social-icon/src/icons.js +103 -0
  129. package/components/spinner/index.js +1 -0
  130. package/components/spinner/spinner-horizontal.js +3 -0
  131. package/components/spinner/spinner-modal.js +4 -0
  132. package/components/spinner/spinner.js +3 -0
  133. package/components/spinner/src/DileSpinner.js +116 -0
  134. package/components/spinner/src/DileSpinnerHorizontal.js +64 -0
  135. package/components/spinner/src/DileSpinnerMixin.js +13 -0
  136. package/components/spinner/src/DileSpinnerModal.js +51 -0
  137. package/components/tabs/index.js +2 -0
  138. package/components/tabs/src/DileTab.js +60 -0
  139. package/components/tabs/src/DileTabs.js +12 -0
  140. package/components/tabs/tab.js +3 -0
  141. package/components/tabs/tabs.js +4 -0
  142. package/components/textarea/index.js +1 -0
  143. package/components/textarea/src/DileTextarea.js +166 -0
  144. package/components/textarea/textarea.js +3 -0
  145. package/components/toast/index.js +3 -0
  146. package/components/toast/src/DileToast.js +95 -0
  147. package/components/toast/src/DileToastItem.js +92 -0
  148. package/components/toast/src/DileToastPersistent.js +100 -0
  149. package/components/toast/toast-item.js +3 -0
  150. package/components/toast/toast-persistent.js +3 -0
  151. package/components/toast/toast.js +4 -0
  152. package/components/tooltip/chip-tooltip.js +3 -0
  153. package/components/tooltip/index.js +1 -0
  154. package/components/tooltip/src/DileChipTooltip.js +86 -0
  155. package/components/tooltip/src/DileTooltip.js +195 -0
  156. package/components/tooltip/tooltip.js +3 -0
  157. package/mixins/close-document-click/index.js +1 -0
  158. package/mixins/close-document-click/src/DileCloseDocumentClick.js +67 -0
  159. package/mixins/close-on-esc-pressed/index.js +1 -0
  160. package/mixins/close-on-esc-pressed/src/DileCloseOnEscPressed.js +31 -0
  161. package/mixins/form/index.js +3 -0
  162. package/mixins/form/src/DileEmmitChange.js +22 -0
  163. package/mixins/form/src/DileForm.js +116 -0
  164. package/mixins/form/src/DileFormChangeDetect.js +34 -0
  165. package/mixins/overlay/index.js +1 -0
  166. package/mixins/overlay/src/DileOverlay.js +171 -0
  167. package/mixins/selectable/index.js +2 -0
  168. package/mixins/selectable/src/DileSelectable.js +154 -0
  169. package/mixins/selectable/src/DileSelectableItem.js +30 -0
  170. package/mixins/slide-down/index.js +1 -0
  171. package/mixins/slide-down/src/DileSlideDown.js +40 -0
  172. package/package.json +29 -0
@@ -0,0 +1,154 @@
1
+ import { html, css, LitElement } from "lit";
2
+ import { DileEmmitChange } from '../../../mixins/form/index.js';
3
+
4
+ export class DileCheckbox extends DileEmmitChange(LitElement) {
5
+ static get properties() {
6
+ return {
7
+ checked: { type: Boolean },
8
+ disabled: { type: Boolean },
9
+ _hasInner: { type: Boolean },
10
+ name: { type: String },
11
+ };
12
+ }
13
+
14
+ constructor() {
15
+ super();
16
+ this.checked = false;
17
+ this.name = '';
18
+ }
19
+
20
+ static get styles() {
21
+ return css`
22
+ :host {
23
+ display: inline-block;
24
+ }
25
+ div {
26
+ display: flex;
27
+ align-items: center;
28
+ cursor: pointer;
29
+ }
30
+ div.disabled {
31
+ opacity: 0.5;
32
+ cursor: auto;
33
+ }
34
+ .checkbox {
35
+ display: flex;
36
+ background-color: var(--dile-checkbox-checked-color, #30a030);
37
+ border-radius: 4px;
38
+ width: var(--dile-checkbox-size, 20px);
39
+ height: var(--dile-checkbox-size, 20px);
40
+ line-height: 0;
41
+ align-items: center;
42
+ justify-content: center;
43
+ }
44
+ .isUnchecked {
45
+ background-color: var(--dile-checkbox-unchecked-color, #ccc);
46
+ }
47
+ path[fill="none"],
48
+ .checked path[fill="none"] {
49
+ fill: transparent;
50
+ }
51
+ path {
52
+ fill: var(--dile-checkbox-fill-color, #fff);
53
+ }
54
+ .checked path {
55
+ fill: var(--dile-checkbox-unchecked-fill-color, #fff);
56
+ }
57
+ svg {
58
+ width: var(--dile-checkbox-size, 20px);
59
+ height: var(--dile-checkbox-size, 20px);
60
+ line-height: var(--dile-checkbox-size, 20px);
61
+ }
62
+ .label {
63
+ margin-left: 10px;
64
+ font-weight: var(--dile-checkbox-font-weight, normal);
65
+ color: var(--dile-checkbox-label-color, #303030);
66
+ }
67
+ .disabled .label {
68
+ color: var(--dile-checkbox-label-disabled-color, #303030);
69
+ }
70
+ `;
71
+ }
72
+
73
+ firstUpdated() {
74
+ this._hasInner = this.innerHTML.trim().length ? true : false;
75
+ }
76
+
77
+ get value() {
78
+ return this.checked;
79
+ }
80
+
81
+ set value(value) {
82
+ this.checked = value;
83
+ }
84
+
85
+ updated(changedProperties) {
86
+ if (changedProperties.has("checked")) {
87
+ this.emmitChange();
88
+ }
89
+ }
90
+
91
+ render() {
92
+ return html`
93
+ <div @click="${this.doClick}" class="${this.disabled ? "disabled" : ""}">
94
+ <a href="#" @click="${this.linkClick}" @keypress="${this.doKeyPress}" class="checkbox ${this.checked ? "isChecked" : "isUnchecked"}">
95
+ ${this.checked ? this.checkedIcon : this.unCheckedIcon}
96
+ </a>
97
+ ${this._hasInner
98
+ ? html` <span class="label">
99
+ <slot></slot>
100
+ </span>`
101
+ : ""}
102
+ </div>
103
+ `;
104
+ }
105
+
106
+ doClick() {
107
+ if (this.disabled) {
108
+ return;
109
+ }
110
+ this.checked = !this.checked;
111
+ this.dispatchEvent(
112
+ new CustomEvent("dile-checkbox-changed", {
113
+ bubbles: true,
114
+ composed: true,
115
+ detail: {
116
+ checked: this.checked,
117
+ name: this.name,
118
+ }
119
+ })
120
+ );
121
+ }
122
+
123
+ get checkedIcon() {
124
+ return html`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
125
+ <path d="M0 0h24v24H0z" fill="none" />
126
+ <path
127
+ d="M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"
128
+ />
129
+ </svg>`;
130
+ }
131
+ get unCheckedIcon() {
132
+ return html`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
133
+ <path
134
+ d="M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"
135
+ />
136
+ <path d="M0 0h24v24H0z" fill="none" />
137
+ </svg>`;
138
+ }
139
+
140
+ doKeyPress(e) {
141
+ e.preventDefault();
142
+ if (e.keyCode == 32 || e.code == "Space") {
143
+ this.doClick();
144
+ }
145
+ }
146
+
147
+ linkClick(e) {
148
+ e.preventDefault();
149
+ }
150
+
151
+ clear() {
152
+ this.checked = false;
153
+ }
154
+ }
@@ -0,0 +1,3 @@
1
+ import { DileConfirm } from './src/DileConfirm.js';
2
+
3
+ customElements.define("dile-confirm", DileConfirm);
@@ -0,0 +1 @@
1
+ export { DileConfirm } from './src/DileConfirm.js';
@@ -0,0 +1,121 @@
1
+ import { LitElement, html, css } from "lit";
2
+ import "../../modal/modal.js";
3
+
4
+ export class DileConfirm extends LitElement {
5
+ static get styles() {
6
+ return css`
7
+ :host {
8
+ display: block;
9
+ }
10
+ .button {
11
+ border-radius: var(--dile-confirm-border-radius-button, 5px);
12
+ padding: var(--dile-confirm-padding-button, 7px);
13
+ font-size: var(--dile-confirm-font-size-button, 1em);
14
+ text-transform: var(--dile-confirm-text-transform, uppercase);
15
+ text-decoration: none;
16
+ }
17
+ .cancel {
18
+ background-color: var(--dile-confirm-cancel-button-color, #dc3545);
19
+ color: var(--dile-confirm-cancel-text-button-color, #fff);
20
+ font-weight: var(--dile-confirm-font-weight-cancel-button, var(--dile-confirm-font-weight-button, normal));
21
+ }
22
+ .accept {
23
+ background-color: var(--dile-confirm-accept-button-color, #007bff);
24
+ color: var(--dile-confirm-accept-text-button-color, #fff);
25
+ font-weight: var(--dile-confirm-font-weight-accept-button, var(--dile-confirm-font-weight-button, normal));
26
+
27
+ }
28
+ .actions {
29
+ margin-top: var(--dile-confirm-buttons-margin-top, 10px);
30
+ margin-bottom: var(--dile-confirm-buttons-margin-bottom, 10px);
31
+ margin-right: var(--dile-confirm-buttons-margin-right, 0);
32
+ margin-left: var(--dile-confirm-buttons-margin-left, 0);
33
+ text-align: var(--dile-confirm-buttons-text-align, right);
34
+ }
35
+ .actions a {
36
+ margin: 4px;
37
+ white-space: nowrap;
38
+ display: inline-block;
39
+ }
40
+ `;
41
+ }
42
+
43
+ static get properties() {
44
+ return {
45
+ opened: { type: Boolean },
46
+ acceptLabel: { type: String },
47
+ cancelLabel: { type: String },
48
+ blocking: { type: Boolean },
49
+ };
50
+ }
51
+
52
+ constructor() {
53
+ super();
54
+ this.acceptLabel = "Accept";
55
+ this.cancelLabel = "Cancell";
56
+ this.opened = false;
57
+ this.blocking = false;
58
+ }
59
+
60
+ render() {
61
+ return html`
62
+ <dile-modal
63
+ ?blocking="${this.blocking}"
64
+ ?opened="${this.opened}"
65
+ id="modal"
66
+ @dile-modal-background-closed="${this.cancel}"
67
+ >
68
+ <slot></slot>
69
+ <div class="actions">
70
+ <a href="#" class="button cancel" @click="${this._cancelHandler}"
71
+ >${this.cancelLabel}</a
72
+ >
73
+ <a href="#" class="button accept" @click="${this._acceptHandler}"
74
+ >${this.acceptLabel}</a
75
+ >
76
+ </div>
77
+ </dile-modal>
78
+ `;
79
+ }
80
+
81
+ _cancelHandler(e) {
82
+ e.preventDefault();
83
+ this.cancel();
84
+ }
85
+ _acceptHandler(e) {
86
+ e.preventDefault();
87
+ this.accept();
88
+ }
89
+
90
+ open() {
91
+ this.opened = true;
92
+ }
93
+
94
+ close() {
95
+ this.opened = false;
96
+ }
97
+
98
+ firstUpdated() {
99
+ this.modal = this.shadowRoot.getElementById("modal");
100
+ }
101
+
102
+ accept() {
103
+ this.close();
104
+ this.dispatchEvent(
105
+ new CustomEvent("dile-confirm-accepted", {
106
+ bubbles: true,
107
+ composed: true,
108
+ })
109
+ );
110
+ }
111
+
112
+ cancel() {
113
+ this.close();
114
+ this.dispatchEvent(
115
+ new CustomEvent("dile-confirm-cancelled", {
116
+ bubbles: true,
117
+ composed: true,
118
+ })
119
+ );
120
+ }
121
+ }
@@ -0,0 +1,3 @@
1
+ import { DileCalendar } from "./src/DileCalendar.js";
2
+
3
+ window.customElements.define("dile-calendar", DileCalendar);
@@ -0,0 +1,4 @@
1
+ import './calendar.js';
2
+ import { DileDatepicker } from "./src/DileDatepicker.js";
3
+
4
+ window.customElements.define("dile-datepicker", DileDatepicker);
@@ -0,0 +1,2 @@
1
+ export { DileDatepicker } from './src/DileDatepicker.js';
2
+ export { DileCalendar } from './src/DileCalendar.js';
@@ -0,0 +1,72 @@
1
+ import { css } from 'lit';
2
+ import { LionCalendar } from '@lion/calendar';
3
+
4
+ export class DileCalendar extends LionCalendar {
5
+ static get styles() {
6
+ return [
7
+ super.styles,
8
+ css`
9
+ .calendar__navigation {
10
+ display: flex;
11
+ justify-content: var(--dile-calendar-navigation-justify-content, space-between);
12
+ align-items: center;
13
+ margin-top: 0.4rem;
14
+ }
15
+ .calendar__navigation button {
16
+ min-height: auto;
17
+ min-width: 30px;
18
+ }
19
+ .calendar__navigation h2 {
20
+ margin: 0;
21
+ display: flex;
22
+ align-items: center;
23
+ min-height: auto;
24
+ font-size: 0.9rem;
25
+
26
+ }
27
+ @media(min-width: 400px) {
28
+ .calendar__navigation h2 {
29
+ font-size: var(--dile-calendar-navigation-text-size, 1.1rem);
30
+ }
31
+ }
32
+ .calendar__day-button {
33
+ min-width: 26px;
34
+ min-height: 26px;
35
+ background-color: var(--dile-calendar-day-background-color, rgba(90, 90, 90, 0.08));
36
+ color: var(--dile-calendar-day-text-color, #303030);
37
+ border-radius: var(--dile-calendar-day-border-radius, 2px);
38
+ }
39
+ .calendar__day-button[today] {
40
+ background-color: var(--dile-calendar-today-background-color, rgba(90, 90, 90, 0.20));
41
+ }
42
+ .calendar__day-button[next-month], .calendar__day-button[previous-month] {
43
+ color: var(--dile-calendar-out-day-text-color, #777);
44
+ opacity: 0.6;
45
+ }
46
+ .calendar__next-button , .calendar__previous-button{
47
+ background-color: transparent;
48
+ color: var(--dile-calendar-nav-buttons-color, #303030);
49
+ font-size: 1.1em;
50
+ }
51
+ @media(min-width: 350px) {
52
+ .calendar__day-button {
53
+ min-width: var(--dile-calendar-day-size, 28px);
54
+ min-height: var(--dile-calendar-day-size, 28px);
55
+ }
56
+ }
57
+ @media(min-width: 400px) {
58
+ .calendar__day-button {
59
+ min-width: var(--dile-calendar-day-size, 32px);
60
+ min-height: var(--dile-calendar-day-size, 32px);
61
+ }
62
+ }
63
+ @media(min-width: 500px) {
64
+ .calendar__day-button {
65
+ min-width: var(--dile-calendar-day-size, 36px);
66
+ min-height: var(--dile-calendar-day-size, 36px);
67
+ }
68
+ }
69
+ `
70
+ ];
71
+ }
72
+ }
@@ -0,0 +1,114 @@
1
+ import { html, css, LitElement } from "lit";
2
+ import { DileInput } from '../../input/index.js';
3
+ import '../../icon/icon.js';
4
+ import { calendarIcon } from '@dile/icons/index.js';
5
+ import '../../menu-overlay/menu-overlay.js';
6
+ import { formatDate } from '@lion/localize';
7
+
8
+ export class DileDatepicker extends DileInput {
9
+ static get styles() {
10
+ return [
11
+ super.styles,
12
+ css`
13
+ div.container {
14
+ display: flex;
15
+ align-items: flex-end;
16
+ }
17
+ section.input {
18
+ flex-grow: 1;
19
+ margin-right: 10px;
20
+ }
21
+ dile-icon {
22
+ cursor: pointer;
23
+ --dile-icon-size: var(--dile-datepicker-trigger-size, 36px);
24
+ }
25
+ dile-calendar {
26
+ font-size: var(--dile-datepicker-font-size, 0.9rem);
27
+ }
28
+ dile-menu-overlay {
29
+ --dile-menu-overlay-width: var(--dile-datepicker-width, 280px);
30
+ }
31
+ dile-icon {
32
+ --dile-icon-color: var(--dile-datepicker-trigger-color, #39c);
33
+ }
34
+ dile-icon.trigger-disabled {
35
+ --dile-icon-color: var(--dile-datepicker-trigger-disabled-color, #ccc);
36
+ }
37
+ span {
38
+ display: flex;
39
+ margin-bottom: var(--dile-datepicker-trigger-margin-bottom, 0.2em);
40
+ }
41
+ @media(min-width: 350px) {
42
+ dile-menu-overlay {
43
+ --dile-menu-overlay-width: var(--dile-datepicker-width, 300px);
44
+ --dile-menu-overlay-max-width: var(--dile-datepicker-width, 300px);
45
+ }
46
+ }
47
+ @media(min-width: 450px) {
48
+ dile-menu-overlay {
49
+ --dile-menu-overlay-width: var(--dile-datepicker-width, 320px);
50
+ --dile-menu-overlay-max-width: var(--dile-datepicker-width, 320px);
51
+ }
52
+ }
53
+ @media(min-width: 500px) {
54
+ dile-menu-overlay {
55
+ --dile-menu-overlay-width: var(--dile-datepicker-width, 350px);
56
+ --dile-menu-overlay-max-width: var(--dile-datepicker-width, 350px);
57
+ }
58
+ }
59
+ `];
60
+ }
61
+
62
+ static get properties() {
63
+ return {
64
+ firstDayOfWeek: { type: Number },
65
+ horizontalAlign: { type: String },
66
+ verticalAlign: { type: String },
67
+ moveTop: { type: Number },
68
+ moveLeft: { type: Number },
69
+ };
70
+ }
71
+
72
+ constructor() {
73
+ super();
74
+ this.firstDayOfWeek = 0;
75
+ this.horizontalAlign = 'under_right';
76
+ this.verticalAlign = 'center';
77
+ this.moveTop = 0;
78
+ this.moveLeft = 0;
79
+ }
80
+
81
+
82
+ render() {
83
+ return html`
84
+ <div class="container">
85
+ <section class="input">
86
+ ${super.render()}
87
+ </section>
88
+ <span>
89
+ ${this.disabled
90
+ ? html`<dile-icon class="trigger-disabled" .icon="${calendarIcon}"></dile-icon>`
91
+ : html`
92
+ <dile-menu-overlay moveTop="${this.moveTop}" moveLeft="${this.moveLeft}" verticalAlign="${this.verticalAlign}" horizontalAlign="${this.horizontalAlign}" id="menu">
93
+ <dile-icon .icon="${calendarIcon}" slot="trigger"></dile-icon>
94
+ <div slot="content" class="calendar">
95
+ <dile-calendar
96
+ class="demo-calendar"
97
+ .firstDayOfWeek="${this.firstDayOfWeek}"
98
+ @user-selected-date-changed=${this.showDate}
99
+ ></dile-calendar>
100
+ </div>
101
+ </dile-menu-overlay>
102
+ `
103
+ }
104
+ </span>
105
+ </div>
106
+ `;
107
+ }
108
+
109
+ showDate(e) {
110
+ let date = formatDate(e.detail.selectedDate);
111
+ this.value = date;
112
+ this.shadowRoot.getElementById('menu').close();
113
+ }
114
+ }
@@ -0,0 +1,3 @@
1
+ import { DileHamburger } from './src/DileHamburger.js';
2
+
3
+ window.customElements.define('dile-hamburger', DileHamburger);
@@ -0,0 +1 @@
1
+ export { DileHamburger } from './src/DileHamburger.js';
@@ -0,0 +1,129 @@
1
+ import { html, css, LitElement } from "lit";
2
+
3
+ export class DileHamburger extends LitElement {
4
+ static get properties() {
5
+ return {
6
+ active: { type: Boolean },
7
+ };
8
+ }
9
+
10
+ static get styles() {
11
+ return css`
12
+ :host {
13
+ display: inline-block;
14
+ }
15
+ .hamburger {
16
+ padding: var(--dile-hamburger-padding-y, 15px) var(--dile-hamburger-padding-x, 15px);
17
+ display: flex;
18
+ align-items: center;
19
+ cursor: pointer;
20
+ transition-property: opacity, filter;
21
+ transition-duration: 0.15s;
22
+ transition-timing-function: linear;
23
+ font: inherit;
24
+ color: inherit;
25
+ text-transform: none;
26
+ background-color: transparent;
27
+ border: 0;
28
+ margin: 0;
29
+ overflow: visible;
30
+ }
31
+ .hamburger:hover {
32
+ opacity: 0.7;
33
+ }
34
+ .hamburger.is-active:hover {
35
+ opacity: 0.7;
36
+ }
37
+ .hamburger.is-active .hamburger-inner,
38
+ .hamburger.is-active .hamburger-inner::before,
39
+ .hamburger.is-active .hamburger-inner::after {
40
+ background-color: var(--dile-hamburger-active-color, #000);
41
+ }
42
+
43
+ .hamburger-box {
44
+ width: var(--dile-hamburger-width, 24px);
45
+ height: var(--dile-hamburger-height, 24px);
46
+ display: inline-block;
47
+ position: relative;
48
+ }
49
+
50
+ .hamburger-inner {
51
+ display: block;
52
+ top: 50%;
53
+ margin-top: 0px;
54
+ }
55
+ .hamburger-inner,
56
+ .hamburger-inner::before,
57
+ .hamburger-inner::after {
58
+ width: var(--dile-hamburger-width, 24px);
59
+ height: var(--dile-hamburger-line-size, 3px);
60
+ background-color: var(--dile-hamburger-color, #000);
61
+ border-radius: var(--dile-hamburger-line-size, 3px);
62
+ position: absolute;
63
+ transition-property: transform;
64
+ transition-duration: 0.15s;
65
+ transition-timing-function: ease;
66
+ }
67
+ .hamburger-inner::before,
68
+ .hamburger-inner::after {
69
+ content: "";
70
+ display: block;
71
+ }
72
+ .hamburger-inner::before {
73
+ top: var(--dile-hamburger-line-separation, -6px);
74
+ }
75
+ .hamburger-inner::after {
76
+ bottom: var(--dile-hamburger-line-separation, -6px);
77
+ }
78
+
79
+ /*
80
+ * Squeeze
81
+ */
82
+ .hamburger--squeeze .hamburger-inner {
83
+ transition-duration: 0.075s;
84
+ transition-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);
85
+ }
86
+ .hamburger--squeeze .hamburger-inner::before {
87
+ transition: top 0.075s 0.12s ease, opacity 0.075s ease;
88
+ }
89
+ .hamburger--squeeze .hamburger-inner::after {
90
+ transition: bottom 0.075s 0.12s ease,
91
+ transform 0.075s cubic-bezier(0.55, 0.055, 0.675, 0.19);
92
+ }
93
+
94
+ .hamburger--squeeze.is-active .hamburger-inner {
95
+ transform: rotate(45deg);
96
+ transition-delay: 0.12s;
97
+ transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
98
+ }
99
+ .hamburger--squeeze.is-active .hamburger-inner::before {
100
+ top: 0;
101
+ opacity: 0;
102
+ transition: top 0.075s ease, opacity 0.075s 0.12s ease;
103
+ }
104
+ .hamburger--squeeze.is-active .hamburger-inner::after {
105
+ bottom: 0;
106
+ transform: rotate(-90deg);
107
+ transition: bottom 0.075s ease,
108
+ transform 0.075s 0.12s cubic-bezier(0.215, 0.61, 0.355, 1);
109
+ }
110
+
111
+ button:focus {
112
+ outline: none;
113
+ }
114
+ `;
115
+ }
116
+
117
+ render() {
118
+ return html`
119
+ <button
120
+ class="hamburger hamburger--squeeze ${this.active ? "is-active" : ""}"
121
+ type="button"
122
+ >
123
+ <span class="hamburger-box">
124
+ <span class="hamburger-inner"></span>
125
+ </span>
126
+ </button>
127
+ `;
128
+ }
129
+ }
@@ -0,0 +1,3 @@
1
+ import { DileIcon } from "./src/DileIcon.js";
2
+
3
+ window.customElements.define("dile-icon", DileIcon);
@@ -0,0 +1 @@
1
+ export { DileIcon } from './src/DileIcon.js';
@@ -0,0 +1,40 @@
1
+ import { html, css, LitElement } from "lit";
2
+ import { iconStyles } from '@dile/icons/index.js';
3
+
4
+ export class DileIcon extends LitElement {
5
+ static get properties() {
6
+ return {
7
+ icon: { type: Object },
8
+ };
9
+ }
10
+
11
+ static get styles() {
12
+ return [
13
+ iconStyles,
14
+ css`
15
+ :host {
16
+ display: inline-block;
17
+ }
18
+ span {
19
+ display: flex;
20
+ align-items: center;
21
+ }
22
+ path {
23
+ transition-duration: 0.3s;
24
+ transition-timing-function: ease-in-out;
25
+ transition-property: fill;
26
+ }
27
+ :host([rounded]) {
28
+ background-color: var(--dile-icon-rounded-background-color, #eee);
29
+ border-radius: 50%;
30
+ padding: var(--dile-icon-rounded-padding, 0.5rem);
31
+ }
32
+ `];
33
+ }
34
+
35
+ render() {
36
+ return html`
37
+ <span>${this.icon}</span>
38
+ `;
39
+ }
40
+ }
@@ -0,0 +1,3 @@
1
+ import { DileIconSwitchGroup } from "./src/DileIconSwitchGroup.js";
2
+
3
+ window.customElements.define("dile-icon-switch-group", DileIconSwitchGroup);
@@ -0,0 +1,3 @@
1
+ import { DileIconSwitch } from "./src/DileIconSwitch.js";
2
+
3
+ window.customElements.define("dile-icon-switch", DileIconSwitch);
@@ -0,0 +1 @@
1
+ export { DileIconSwitch } from './src/DileIconSwitch.js';