dlg-ui 1.0.27 → 1.0.28

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,20 @@
1
+ <div class="modal-backdrop {{if this.isOpen "modal-open" "modal-closed"}}">
2
+ <div class="modal">
3
+ <a {{on "click" this.toggleModal}}><FaIcon @icon={{this.icon}} class="modal-x"/></a>
4
+ <div class="modal-header">
5
+ <h1 style="margin-top: 0;">{{yield to="header"}}</h1>
6
+ </div>
7
+ <div class="modal-body">
8
+ {{yield to="body"}}
9
+ </div>
10
+ <div class="modal-footer">
11
+ <ButtonPrimary @onClick={{this.toggleModal}}>
12
+ Cancel
13
+ </ButtonPrimary>
14
+ <ButtonPrimary @onClick={{this.acceptAndClose}} style="margin-left: 1em;">
15
+ Done
16
+ </ButtonPrimary>
17
+ {{yield to="footer"}}
18
+ </div>
19
+ </div>
20
+ </div>
@@ -0,0 +1,25 @@
1
+ import Component from '@glimmer/component';
2
+ import { faCircleXmark } from '@fortawesome/free-solid-svg-icons';
3
+
4
+ export default class ModalComponent extends Component {
5
+ get isOpen() {
6
+ return this.args.isOpen ?? false;
7
+ }
8
+
9
+ get icon() {
10
+ return faCircleXmark;
11
+ }
12
+
13
+ acceptAndClose = () => {
14
+ if (this.args.onAccept) {
15
+ this.args.onAccept();
16
+ }
17
+ this.toggleModal();
18
+ }
19
+
20
+ toggleModal = () => {
21
+ if (this.args.toggleModal) {
22
+ this.args.toggleModal();
23
+ }
24
+ }
25
+ }
@@ -0,0 +1,49 @@
1
+ .modal {
2
+ position: absolute;
3
+ top: 25%;
4
+ left: 50%;
5
+ transform: translate(-50%, -50%);
6
+ display: flex;
7
+ flex-direction: column;
8
+ background: white;
9
+ box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
10
+ padding: 1em;
11
+ }
12
+
13
+ .modal-backdrop {
14
+ position: fixed;
15
+ top: 0;
16
+ left: 0;
17
+ width: 100%;
18
+ height: 100%;
19
+ background: rgba(0, 0, 0, 0.5);
20
+ z-index: 999;
21
+ }
22
+
23
+ .modal-backdrop.modal-closed {
24
+ display: none;
25
+ }
26
+
27
+ .modal-header {
28
+ display: flex;
29
+ justify-content: space-between;
30
+ margin-right: 100px;
31
+ }
32
+
33
+ .modal-body {
34
+ margin-bottom: 1em;
35
+ }
36
+
37
+ .modal-footer {
38
+ display: flex;
39
+ justify-content: flex-end;
40
+ }
41
+
42
+ .modal-x {
43
+ cursor: pointer;
44
+ min-height: 2em;
45
+ min-width: 2em;
46
+ position: absolute;
47
+ top: 10px;
48
+ right: 10px;
49
+ }
@@ -0,0 +1 @@
1
+ export { default } from 'dlg-ui/components/modal';
package/index.js CHANGED
@@ -32,6 +32,7 @@ module.exports = {
32
32
  'navbar.css',
33
33
  'player-card.css',
34
34
  'button.css',
35
+ 'modal.css',
35
36
  ];
36
37
 
37
38
  // Start with existing addon.css content (without the @import statements)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dlg-ui",
3
- "version": "1.0.27",
3
+ "version": "1.0.28",
4
4
  "description": "The default blueprint for ember-cli addons.",
5
5
  "keywords": [
6
6
  "ember-addon"
@@ -12,19 +12,6 @@
12
12
  "doc": "doc",
13
13
  "test": "tests"
14
14
  },
15
- "scripts": {
16
- "build": "ember build --environment=production",
17
- "lint": "npm-run-all --print-name --aggregate-output --continue-on-error --parallel \"lint:!(fix)\"",
18
- "lint:fix": "npm-run-all --print-name --aggregate-output --continue-on-error --parallel \"lint:*:fix\"",
19
- "lint:hbs": "ember-template-lint .",
20
- "lint:hbs:fix": "ember-template-lint . --fix",
21
- "lint:js": "eslint . --cache",
22
- "lint:js:fix": "eslint . --fix",
23
- "start": "ember serve",
24
- "test": "npm-run-all --print-name \"lint\" \"test:*\"",
25
- "test:ember": "ember test",
26
- "test:ember-compatibility": "ember try:each"
27
- },
28
15
  "dependencies": {
29
16
  "@ember/string": "^3.1.1",
30
17
  "ember-cli-babel": "^8.2.0",
@@ -82,5 +69,18 @@
82
69
  },
83
70
  "ember-addon": {
84
71
  "configPath": "tests/dummy/config"
72
+ },
73
+ "scripts": {
74
+ "build": "ember build --environment=production",
75
+ "lint": "npm-run-all --print-name --aggregate-output --continue-on-error --parallel \"lint:!(fix)\"",
76
+ "lint:fix": "npm-run-all --print-name --aggregate-output --continue-on-error --parallel \"lint:*:fix\"",
77
+ "lint:hbs": "ember-template-lint .",
78
+ "lint:hbs:fix": "ember-template-lint . --fix",
79
+ "lint:js": "eslint . --cache",
80
+ "lint:js:fix": "eslint . --fix",
81
+ "start": "ember serve",
82
+ "test": "npm-run-all --print-name \"lint\" \"test:*\"",
83
+ "test:ember": "ember test",
84
+ "test:ember-compatibility": "ember try:each"
85
85
  }
86
- }
86
+ }