@progressive-development/pd-dialog 0.1.52 → 0.1.54

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.52",
6
+ "version": "0.1.54",
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 {
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">
@@ -132,6 +143,7 @@ export class PdPopupDialog extends LitElement {
132
143
  data-key="${bt.key}"
133
144
  @button-clicked="${this._handleButtonEvent}"
134
145
  ?disabled="${bt.disabled}"
146
+ ?primary="${bt.primary}"
135
147
  text="${bt.name}"
136
148
  ></pd-button>
137
149
  `
@@ -152,16 +164,17 @@ export class PdPopupDialog extends LitElement {
152
164
  );
153
165
  }
154
166
 
155
- _getImageNameForType() {
167
+ _getIconForType() {
168
+ if (!this.type) {
169
+ return "";
170
+ }
156
171
  switch (this.type) {
157
- case 'info':
158
- return 'information';
159
172
  case 'warn':
160
- return 'warning';
173
+ return html`<pd-icon icon="warningIconFld" class="info-logo warn"></pd-icon>`;
161
174
  case 'error':
162
- return 'error';
175
+ return html`<pd-icon icon="errorIconFld" class="info-logo error"></pd-icon>`;
163
176
  default:
164
- return 'information';
177
+ return html`<pd-icon icon="infoIconFld" class="info-logo info"></pd-icon>`;
165
178
  }
166
179
  }
167
180
 
@@ -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,20 @@ 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 PopupWarnDialog = PopupTemplate.bind({});
35
+ PopupWarnDialog.args = {
36
+ type: "warn",
37
+ };
38
+
39
+ export const PopupErrorDialog = PopupTemplate.bind({});
40
+ PopupErrorDialog.args = {
41
+ type: "error",
42
+ };