@progressive-development/pd-forms 0.0.14 → 0.0.15
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 +2 -2
- package/src/PdButton.js +9 -9
- package/src/PdCheckbox.js +20 -20
- package/src/PdInput.js +2 -2
- package/src/PdInputArea.js +2 -2
- package/src/PdSelect.js +2 -2
- package/src/shared-input-styles.js +11 -11
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Webcomponent pd-forms following open-wc recommendations",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE",
|
|
5
5
|
"author": "PD Progressive Development",
|
|
6
|
-
"version": "0.0.
|
|
6
|
+
"version": "0.0.15",
|
|
7
7
|
"main": "index.js",
|
|
8
8
|
"module": "index.js",
|
|
9
9
|
"scripts": {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"storybook:build": "npm run analyze -- --exclude dist && build-storybook"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@progressive-development/pd-icon": "0.0.
|
|
20
|
+
"@progressive-development/pd-icon": "0.0.6",
|
|
21
21
|
"lit": "^2.0.0-rc.4",
|
|
22
22
|
"@lit-labs/motion": "^1.0.0-rc.2"
|
|
23
23
|
},
|
package/src/PdButton.js
CHANGED
|
@@ -117,23 +117,23 @@ export class PdButton extends LitElement {
|
|
|
117
117
|
align-items: center;
|
|
118
118
|
justify-content: center;
|
|
119
119
|
white-space: nowrap;
|
|
120
|
-
--
|
|
121
|
-
--
|
|
120
|
+
--pd-icon-fill: var(--icon-fill-light);
|
|
121
|
+
--pd-icon-fill-hover: var(--icon-fill-light);
|
|
122
122
|
}
|
|
123
123
|
|
|
124
124
|
.button-icon:not([disabled]) {
|
|
125
|
-
--
|
|
126
|
-
--
|
|
125
|
+
--pd-icon-fill: var(--app-primary-color);
|
|
126
|
+
--pd-icon-fill-hover: var(--app-primary-color-dark);
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
-
.button-icon
|
|
129
|
+
.button-icon pd-icon {
|
|
130
130
|
max-width: 1.25rem;
|
|
131
131
|
height: 1.25rem;
|
|
132
132
|
width: 1.25rem;
|
|
133
133
|
margin: 0 .15rem;
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
-
.button-icon.small
|
|
136
|
+
.button-icon.small pd-icon {
|
|
137
137
|
max-width: 1.25rem;
|
|
138
138
|
height: 1.25rem;
|
|
139
139
|
width: 1.25rem;
|
|
@@ -148,16 +148,16 @@ export class PdButton extends LitElement {
|
|
|
148
148
|
fill: var(--app-primary-color);
|
|
149
149
|
}
|
|
150
150
|
|
|
151
|
-
.button-icon:hover
|
|
151
|
+
.button-icon:hover pd-icon,
|
|
152
152
|
.button-icon:hover svg {
|
|
153
153
|
fill: var(--app-primary-color);
|
|
154
154
|
}
|
|
155
155
|
|
|
156
156
|
@media (min-width: 580px) {
|
|
157
|
-
.button-icon
|
|
157
|
+
.button-icon pd-icon {
|
|
158
158
|
margin: 0 .5rem;
|
|
159
159
|
}
|
|
160
|
-
.button-icon.small
|
|
160
|
+
.button-icon.small pd-icon {
|
|
161
161
|
padding-right: .5rem;
|
|
162
162
|
}
|
|
163
163
|
}
|
package/src/PdCheckbox.js
CHANGED
|
@@ -54,7 +54,7 @@ export class PdCheckbox extends PdBaseUIInput {
|
|
|
54
54
|
|
|
55
55
|
|
|
56
56
|
|
|
57
|
-
/* TODO vars used in
|
|
57
|
+
/* TODO vars used in pd-icon */
|
|
58
58
|
--squi-checkbox-checked-color: var(--my-primary);
|
|
59
59
|
--squi-checkbox-unchecked-color: var(--my-ligth);
|
|
60
60
|
--squi-checkbox-bg: var(--my-dark);
|
|
@@ -63,21 +63,21 @@ export class PdCheckbox extends PdBaseUIInput {
|
|
|
63
63
|
|
|
64
64
|
--squi-checkbox-label-disabled-color: var(--app-copy-color, #303030);
|
|
65
65
|
|
|
66
|
-
/* Checkbox
|
|
67
|
-
--
|
|
68
|
-
--
|
|
69
|
-
--
|
|
70
|
-
--
|
|
66
|
+
/* Checkbox pd-icon */
|
|
67
|
+
--pd-icon-fill: var(--my-icon-bg-color);
|
|
68
|
+
--pd-icon-bg: var(--my-icon-fill);
|
|
69
|
+
--pd-icon-fill-active: var(--my-icon-bg-active-color);
|
|
70
|
+
--pd-icon-bg-active: var(--my-icon-active-fill);
|
|
71
71
|
|
|
72
72
|
display: inline-block;
|
|
73
73
|
font-size: .8rem;
|
|
74
74
|
}
|
|
75
|
-
/* Switch
|
|
75
|
+
/* Switch pd-icon */
|
|
76
76
|
:host([isSwitch]) {
|
|
77
|
-
--
|
|
78
|
-
--
|
|
79
|
-
--
|
|
80
|
-
--
|
|
77
|
+
--pd-icon-fill: var(--my-icon-fill);
|
|
78
|
+
--pd-icon-bg: var(--my-icon-bg-color);
|
|
79
|
+
--pd-icon-fill-active: var(--my-icon-active-fill);
|
|
80
|
+
--pd-icon-bg-active: var(--my-icon-bg-active-color);
|
|
81
81
|
}
|
|
82
82
|
div {
|
|
83
83
|
display: flex;
|
|
@@ -98,7 +98,7 @@ export class PdCheckbox extends PdBaseUIInput {
|
|
|
98
98
|
align-items: center;
|
|
99
99
|
justify-content: center;
|
|
100
100
|
}
|
|
101
|
-
.checkbox
|
|
101
|
+
.checkbox pd-icon {
|
|
102
102
|
margin: .25rem;
|
|
103
103
|
}
|
|
104
104
|
.label {
|
|
@@ -145,16 +145,16 @@ export class PdCheckbox extends PdBaseUIInput {
|
|
|
145
145
|
min-width: 2rem;
|
|
146
146
|
background: none;
|
|
147
147
|
|
|
148
|
-
--
|
|
149
|
-
--
|
|
150
|
-
--
|
|
151
|
-
--
|
|
148
|
+
--pd-icon-bg: transparent;
|
|
149
|
+
--pd-icon-fill: var(--card-dark-red);
|
|
150
|
+
--pd-icon-fill-hover: var(--pd-icon-fill);
|
|
151
|
+
--pd-icon-fill-active: var(--card-medium-green);
|
|
152
152
|
}
|
|
153
|
-
.readonly .isChecked.switch-paddle
|
|
153
|
+
.readonly .isChecked.switch-paddle pd-icon {
|
|
154
154
|
transform: translate3d(0, 0, 0);
|
|
155
155
|
left: 0.25rem;
|
|
156
156
|
}
|
|
157
|
-
.switch-paddle
|
|
157
|
+
.switch-paddle pd-icon {
|
|
158
158
|
position: absolute;
|
|
159
159
|
top: 0.25rem;
|
|
160
160
|
left: 0.25rem;
|
|
@@ -168,7 +168,7 @@ export class PdCheckbox extends PdBaseUIInput {
|
|
|
168
168
|
transition: all 0.25s ease-out;
|
|
169
169
|
content: '';
|
|
170
170
|
}
|
|
171
|
-
.isChecked.switch-paddle
|
|
171
|
+
.isChecked.switch-paddle pd-icon {
|
|
172
172
|
left: 2.25rem;
|
|
173
173
|
}
|
|
174
174
|
|
|
@@ -211,7 +211,7 @@ export class PdCheckbox extends PdBaseUIInput {
|
|
|
211
211
|
return html`<div @click="${this.onClick}" class="${classMap({'disabled': this.disabled, 'switch': this.isSwitch, 'readonly': this.readonly})}">
|
|
212
212
|
<a href="#" @click="${this.linkClick}" @keypress="${this.onKeyPress}"
|
|
213
213
|
class="${classMap({'switch-paddle': this.isSwitch, 'checkbox': !this.isSwitch, 'isChecked': checked, 'isUnchecked': !checked})}">
|
|
214
|
-
<
|
|
214
|
+
<pd-icon icon="checkBox" class="${classMap({'switch': this.isSwitch, 'checkBox': !this.isSwitch})}" ?activeIcon="${checked}"></pd-icon>
|
|
215
215
|
</a>
|
|
216
216
|
${this.hasInner
|
|
217
217
|
? html`<span class="label">
|
package/src/PdInput.js
CHANGED
|
@@ -110,10 +110,10 @@ export class PdInput extends PdBaseUIInput {
|
|
|
110
110
|
return html`
|
|
111
111
|
<label for="${this.id}Input">${this.label}</label>
|
|
112
112
|
<div class="input ${classMap({ error: this.errorMsg.length > 0 })}">
|
|
113
|
-
<
|
|
113
|
+
<pd-icon
|
|
114
114
|
icon="toggleCollapse"
|
|
115
115
|
@click="${this._onIconClick}"
|
|
116
|
-
></
|
|
116
|
+
></pd-icon>
|
|
117
117
|
<input
|
|
118
118
|
id="${this.id}Input"
|
|
119
119
|
class="input-style ${this.gradient ? 'gradient' : ''}"
|
package/src/PdInputArea.js
CHANGED
|
@@ -116,8 +116,8 @@ export class PdInputArea extends PdBaseUIInput {
|
|
|
116
116
|
return html`
|
|
117
117
|
<label for="${this.id}InputArea">${this.label}</label>
|
|
118
118
|
<div class="input ${classMap({'error': this.errorMsg.length > 0})}">
|
|
119
|
-
<
|
|
120
|
-
@click="${this._onIconClick}"></
|
|
119
|
+
<pd-icon icon="toggleCollapse"
|
|
120
|
+
@click="${this._onIconClick}"></pd-icon>
|
|
121
121
|
<textarea
|
|
122
122
|
id="${this.id}InputArea"
|
|
123
123
|
class="input-style ${this.gradient ? 'gradient' : ''}"
|
package/src/PdSelect.js
CHANGED
|
@@ -202,10 +202,10 @@ export class PdSelect extends PdBaseUIInput {
|
|
|
202
202
|
return html`
|
|
203
203
|
<label for="${this.id}Select">${this.label}</label>
|
|
204
204
|
<div class="input ${classMap({ error: this.errorMsg.length > 0 })}">
|
|
205
|
-
<
|
|
205
|
+
<pd-icon
|
|
206
206
|
icon="toggleCollapse"
|
|
207
207
|
@click="${this._onIconClick}"
|
|
208
|
-
></
|
|
208
|
+
></pd-icon>
|
|
209
209
|
<select
|
|
210
210
|
id="${this.id}Input"
|
|
211
211
|
class="select-css input-style ${this.gradient ? 'gradient' : ''}"
|
|
@@ -45,8 +45,8 @@ export const SharedInputStyles = css`
|
|
|
45
45
|
.input {
|
|
46
46
|
display: inline-block;
|
|
47
47
|
/*position: relative; Prüfen: Wennd as an ist, felder über scroll-menu?*/
|
|
48
|
-
/*
|
|
49
|
-
--
|
|
48
|
+
/* pd-icon smaller than input */
|
|
49
|
+
--pd-icon-computed-size: calc(var(--my-input-height) * 0.75); /* calc */
|
|
50
50
|
|
|
51
51
|
/* Hack um eine Form Row (input mit Button => Booking) zu bekommen*/
|
|
52
52
|
padding-top: var(--squi-input-padding, 0.5rem);
|
|
@@ -55,28 +55,28 @@ export const SharedInputStyles = css`
|
|
|
55
55
|
color: var(--my-error-color);
|
|
56
56
|
}
|
|
57
57
|
/* squi icon depends on input styles to fit inside */
|
|
58
|
-
|
|
58
|
+
pd-icon {
|
|
59
59
|
display: none;
|
|
60
60
|
position: absolute;
|
|
61
|
-
--
|
|
62
|
-
--
|
|
63
|
-
--
|
|
64
|
-
--
|
|
61
|
+
--pd-icon-height: var(--pd-icon-computed-size, 2rem);
|
|
62
|
+
--pd-icon-width: var(--pd-icon-computed-size, 2rem);
|
|
63
|
+
--pd-icon-fill-color: var(--squi-input-icon-fill-color, currentcolor);
|
|
64
|
+
--pd-icon-stroke-color: var(--squi-input-icon-stroke-color, none);
|
|
65
65
|
}
|
|
66
|
-
|
|
66
|
+
pd-icon:hover {
|
|
67
67
|
cursor: pointer;
|
|
68
68
|
}
|
|
69
69
|
/* Display icon if it's positioned */
|
|
70
|
-
:host([icon-right]) .input
|
|
70
|
+
:host([icon-right]) .input pd-icon {
|
|
71
71
|
display: inline-block;
|
|
72
72
|
right: 0;
|
|
73
73
|
}
|
|
74
|
-
:host([icon-left]) .input
|
|
74
|
+
:host([icon-left]) .input pd-icon {
|
|
75
75
|
display: inline-block;
|
|
76
76
|
left: 0;
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
/* Padding space for
|
|
79
|
+
/* Padding space for pd-icon => Noch input spezifisch? */
|
|
80
80
|
:host([icon-right]) > input {
|
|
81
81
|
padding-right: var(--my-input-height);
|
|
82
82
|
}
|