@progressive-development/pd-dialog 0.1.53 → 0.1.55

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/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Progressive Development dialog components.",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "author": "PD Progressive Development",
6
- "version": "0.1.53",
6
+ "version": "0.1.55",
7
7
  "main": "index.js",
8
8
  "module": "index.js",
9
9
  "scripts": {
@@ -74,6 +74,21 @@ export class PdPopupDialog extends LitElement {
74
74
  width: 2em;
75
75
  }
76
76
 
77
+ .error {
78
+ --pd-icon-col: #FF3232;
79
+ --pd-icon-stroke-width: 0;
80
+ }
81
+
82
+ .info, .help {
83
+ --pd-icon-col: #6B86FF;
84
+ --pd-icon-stroke-width: 0;
85
+ }
86
+
87
+ .warn {
88
+ --pd-icon-col: #FFBF00;
89
+ --pd-icon-stroke-width: 0;
90
+ }
91
+
77
92
  .content {
78
93
  padding: 0.5rem 1rem 1rem 1rem;
79
94
  background-color: var(--pd-popup-header-font-col, var(--pd-default-bg-col));
@@ -115,11 +130,7 @@ export class PdPopupDialog extends LitElement {
115
130
  <!-- Modal content -->
116
131
  <div class="modal-content">
117
132
  <div class="header">
118
- <img
119
- src="/images/${this._getImageNameForType()}.svg"
120
- class="info-logo"
121
- alt=""
122
- />
133
+ ${this._getIconForType()}
123
134
  <span class="header-txt">${this.title}</span>
124
135
  </div>
125
136
  <div class="content">
@@ -153,16 +164,19 @@ export class PdPopupDialog extends LitElement {
153
164
  );
154
165
  }
155
166
 
156
- _getImageNameForType() {
167
+ _getIconForType() {
168
+ if (!this.type) {
169
+ return "";
170
+ }
157
171
  switch (this.type) {
158
- case 'info':
159
- return 'information';
160
172
  case 'warn':
161
- return 'warning';
173
+ return html`<pd-icon icon="warningIconFld" class="info-logo warn"></pd-icon>`;
162
174
  case 'error':
163
- return 'error';
175
+ return html`<pd-icon icon="errorIconFld" class="info-logo error"></pd-icon>`;
176
+ case 'help':
177
+ return html`<pd-icon icon="helpIconFld" class="info-logo help"></pd-icon>`;
164
178
  default:
165
- return 'information';
179
+ return html`<pd-icon icon="infoIconFld" class="info-logo info"></pd-icon>`;
166
180
  }
167
181
  }
168
182
 
@@ -7,11 +7,11 @@ export default {
7
7
  argTypes: {},
8
8
  };
9
9
 
10
- function PopupTemplate() {
10
+ function PopupTemplate({type}) {
11
11
  return html`
12
12
  <h1>Dialog Test</h1>
13
13
  <button>Ok</button>
14
- <pd-popup-dialog title="Title Information">
14
+ <pd-popup-dialog title="Title Information" type="${type}">
15
15
  <div slot="content">
16
16
  <p>
17
17
  Tank you for your order. And another prima text here. Maybe more than
@@ -23,4 +23,25 @@ function PopupTemplate() {
23
23
  }
24
24
 
25
25
  export const PopupDialog = PopupTemplate.bind({});
26
- PopupDialog.args = {};
26
+ PopupDialog.args = {
27
+ };
28
+
29
+ export const PopupInfoDialog = PopupTemplate.bind({});
30
+ PopupInfoDialog.args = {
31
+ type: "info",
32
+ };
33
+
34
+ export const PopupHelpDialog = PopupTemplate.bind({});
35
+ PopupHelpDialog.args = {
36
+ type: "help",
37
+ };
38
+
39
+ export const PopupWarnDialog = PopupTemplate.bind({});
40
+ PopupWarnDialog.args = {
41
+ type: "warn",
42
+ };
43
+
44
+ export const PopupErrorDialog = PopupTemplate.bind({});
45
+ PopupErrorDialog.args = {
46
+ type: "error",
47
+ };