@progressive-development/pd-dialog 0.1.53 → 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 +1 -1
- package/src/PdPopupDialog.js +23 -11
- package/stories/popup-dialog.stories.js +19 -3
package/package.json
CHANGED
package/src/PdPopupDialog.js
CHANGED
|
@@ -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
|
-
|
|
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,17 @@ export class PdPopupDialog extends LitElement {
|
|
|
153
164
|
);
|
|
154
165
|
}
|
|
155
166
|
|
|
156
|
-
|
|
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
|
|
173
|
+
return html`<pd-icon icon="warningIconFld" class="info-logo warn"></pd-icon>`;
|
|
162
174
|
case 'error':
|
|
163
|
-
return
|
|
175
|
+
return html`<pd-icon icon="errorIconFld" class="info-logo error"></pd-icon>`;
|
|
164
176
|
default:
|
|
165
|
-
return
|
|
177
|
+
return html`<pd-icon icon="infoIconFld" class="info-logo info"></pd-icon>`;
|
|
166
178
|
}
|
|
167
179
|
}
|
|
168
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
|
+
};
|