pebble-web 2.11.0 → 2.12.0
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/dist/components/styles/Input.styles.d.ts +1 -0
- package/dist/components/typings/Input.d.ts +3 -0
- package/dist/pebble-web.dev.js +36 -25
- package/dist/pebble-web.dev.js.map +1 -1
- package/dist/pebble-web.es.dev.js +36 -25
- package/dist/pebble-web.es.dev.js.map +1 -1
- package/dist/pebble-web.es.js +26 -17
- package/dist/pebble-web.es.js.map +1 -1
- package/dist/pebble-web.js +26 -17
- package/dist/pebble-web.js.map +1 -1
- package/dist/pebble-web.module.dev.js +36 -25
- package/dist/pebble-web.module.dev.js.map +1 -1
- package/dist/pebble-web.module.js +26 -17
- package/dist/pebble-web.module.js.map +1 -1
- package/dist/pebble-web.umd.dev.js +38 -25
- package/dist/pebble-web.umd.dev.js.map +1 -1
- package/dist/pebble-web.umd.js +28 -17
- package/dist/pebble-web.umd.js.map +1 -1
- package/package.json +3 -3
- package/src/components/Input.tsx +32 -15
- package/src/components/__tests__/__snapshots__/phonenumberinput.test.tsx.snap +65 -47
- package/src/components/__tests__/__snapshots__/select.test.tsx.snap +126 -81
- package/src/components/styles/Input.styles.ts +9 -5
- package/src/components/typings/Input.ts +3 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pebble-web",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.12.0",
|
|
4
4
|
"author": "ritz078 <rkritesh078@gmail.com>",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/pebble-web.js",
|
|
@@ -44,12 +44,12 @@
|
|
|
44
44
|
"utility-types": "^3.10.0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"pebble-shared": "^2.
|
|
47
|
+
"pebble-shared": "^2.12.0"
|
|
48
48
|
},
|
|
49
49
|
"greenkeeper": {
|
|
50
50
|
"ignore": [
|
|
51
51
|
"rheostat"
|
|
52
52
|
]
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "de48b77f535067ed0a9c6577c3cef146e5c65114"
|
|
55
55
|
}
|
package/src/components/Input.tsx
CHANGED
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
labelStyle,
|
|
7
7
|
wrapperStyle,
|
|
8
8
|
messageStyle,
|
|
9
|
+
inputWrapperStyle,
|
|
9
10
|
inputStyle,
|
|
10
11
|
inputReadOnlyStyle,
|
|
11
12
|
inputDisabledStyle,
|
|
@@ -67,6 +68,7 @@ class Input extends React.PureComponent<InputProps, InputState> {
|
|
|
67
68
|
type,
|
|
68
69
|
placeholder,
|
|
69
70
|
className,
|
|
71
|
+
inputWrapperClassName,
|
|
70
72
|
inputClassName,
|
|
71
73
|
highlightClassName,
|
|
72
74
|
loadingClassName,
|
|
@@ -80,12 +82,16 @@ class Input extends React.PureComponent<InputProps, InputState> {
|
|
|
80
82
|
textArea,
|
|
81
83
|
required,
|
|
82
84
|
onClick,
|
|
83
|
-
loading
|
|
85
|
+
loading,
|
|
86
|
+
leftElement,
|
|
87
|
+
rightElement
|
|
84
88
|
} = this.props;
|
|
85
89
|
const { isFocused } = this.state;
|
|
86
90
|
|
|
87
91
|
const _message = errorMessage || successMessage || message;
|
|
88
92
|
|
|
93
|
+
const _inputWrapperClassName = cx(inputWrapperStyle, inputWrapperClassName);
|
|
94
|
+
|
|
89
95
|
const _inputClassName = cx(
|
|
90
96
|
inputStyle,
|
|
91
97
|
{
|
|
@@ -117,7 +123,12 @@ class Input extends React.PureComponent<InputProps, InputState> {
|
|
|
117
123
|
);
|
|
118
124
|
|
|
119
125
|
const labelClassName = cx(labelStyle, {
|
|
120
|
-
_pebble_input_label_focused: !!(
|
|
126
|
+
_pebble_input_label_focused: !!(
|
|
127
|
+
isFocused ||
|
|
128
|
+
value ||
|
|
129
|
+
fixLabelAtTop ||
|
|
130
|
+
leftElement
|
|
131
|
+
)
|
|
121
132
|
});
|
|
122
133
|
|
|
123
134
|
const _wrapperStyle = cx(
|
|
@@ -137,11 +148,25 @@ class Input extends React.PureComponent<InputProps, InputState> {
|
|
|
137
148
|
onBlur={this.removeFocus}
|
|
138
149
|
onClick={onClick}
|
|
139
150
|
>
|
|
140
|
-
{
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
151
|
+
<div className={_inputWrapperClassName}>
|
|
152
|
+
{leftElement?.()}
|
|
153
|
+
|
|
154
|
+
{this.props.textArea ? (
|
|
155
|
+
<textarea {..._inputProps} {...this.props.inputProps} />
|
|
156
|
+
) : (
|
|
157
|
+
<input type={type} {..._inputProps} {...this.props.inputProps} />
|
|
158
|
+
)}
|
|
159
|
+
|
|
160
|
+
{loading && (
|
|
161
|
+
<Loader
|
|
162
|
+
color={colors.violet.base}
|
|
163
|
+
scale={0.6}
|
|
164
|
+
className={_loadingStyle}
|
|
165
|
+
/>
|
|
166
|
+
)}
|
|
167
|
+
|
|
168
|
+
{rightElement?.()}
|
|
169
|
+
</div>
|
|
145
170
|
|
|
146
171
|
{!!placeholder && (
|
|
147
172
|
<label className={labelClassName}>
|
|
@@ -159,14 +184,6 @@ class Input extends React.PureComponent<InputProps, InputState> {
|
|
|
159
184
|
}}
|
|
160
185
|
/>
|
|
161
186
|
|
|
162
|
-
{loading && (
|
|
163
|
-
<Loader
|
|
164
|
-
color={colors.violet.base}
|
|
165
|
-
scale={0.6}
|
|
166
|
-
className={_loadingStyle}
|
|
167
|
-
/>
|
|
168
|
-
)}
|
|
169
|
-
|
|
170
187
|
{_message && (
|
|
171
188
|
<div
|
|
172
189
|
className={messageStyle}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
3
|
exports[`Component: Select default snapshot 1`] = `
|
|
4
|
-
.emotion-
|
|
4
|
+
.emotion-12 {
|
|
5
5
|
position: relative;
|
|
6
6
|
display: -webkit-box;
|
|
7
7
|
display: -webkit-flex;
|
|
@@ -16,14 +16,25 @@ exports[`Component: Select default snapshot 1`] = `
|
|
|
16
16
|
height: 68px;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
.emotion-
|
|
19
|
+
.emotion-12._pebble_input_wrapper_textarea {
|
|
20
20
|
height: 110px;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
.emotion-
|
|
23
|
+
.emotion-2 {
|
|
24
|
+
display: -webkit-box;
|
|
25
|
+
display: -webkit-flex;
|
|
26
|
+
display: -ms-flexbox;
|
|
27
|
+
display: flex;
|
|
28
|
+
-webkit-align-items: baseline;
|
|
29
|
+
-webkit-box-align: baseline;
|
|
30
|
+
-ms-flex-align: baseline;
|
|
31
|
+
align-items: baseline;
|
|
32
|
+
border-bottom: 1px solid #EDEDED;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.emotion-9 {
|
|
24
36
|
outline: 0;
|
|
25
37
|
border: 0;
|
|
26
|
-
border-bottom: 1px solid #EDEDED;
|
|
27
38
|
padding: 24px 0 12px 0;
|
|
28
39
|
height: 48px;
|
|
29
40
|
border-radius: 0;
|
|
@@ -36,43 +47,43 @@ exports[`Component: Select default snapshot 1`] = `
|
|
|
36
47
|
white-space: nowrap;
|
|
37
48
|
}
|
|
38
49
|
|
|
39
|
-
.emotion-
|
|
50
|
+
.emotion-9:disabled {
|
|
40
51
|
background-color: #ffffff;
|
|
41
52
|
}
|
|
42
53
|
|
|
43
|
-
.emotion-
|
|
54
|
+
.emotion-9::-webkit-input-placeholder {
|
|
44
55
|
color: #E0E0E0;
|
|
45
56
|
}
|
|
46
57
|
|
|
47
|
-
.emotion-
|
|
58
|
+
.emotion-9::-moz-placeholder {
|
|
48
59
|
color: #E0E0E0;
|
|
49
60
|
}
|
|
50
61
|
|
|
51
|
-
.emotion-
|
|
62
|
+
.emotion-9:-ms-input-placeholder {
|
|
52
63
|
color: #E0E0E0;
|
|
53
64
|
}
|
|
54
65
|
|
|
55
|
-
.emotion-
|
|
66
|
+
.emotion-9:-moz-placeholder {
|
|
56
67
|
color: #E0E0E0;
|
|
57
68
|
}
|
|
58
69
|
|
|
59
|
-
.emotion-
|
|
70
|
+
.emotion-9::-webkit-input-placeholder {
|
|
60
71
|
color: #E0E0E0;
|
|
61
72
|
}
|
|
62
73
|
|
|
63
|
-
.emotion-
|
|
74
|
+
.emotion-9::-moz-placeholder {
|
|
64
75
|
color: #E0E0E0;
|
|
65
76
|
}
|
|
66
77
|
|
|
67
|
-
.emotion-
|
|
78
|
+
.emotion-9:-ms-input-placeholder {
|
|
68
79
|
color: #E0E0E0;
|
|
69
80
|
}
|
|
70
81
|
|
|
71
|
-
.emotion-
|
|
82
|
+
.emotion-9::placeholder {
|
|
72
83
|
color: #E0E0E0;
|
|
73
84
|
}
|
|
74
85
|
|
|
75
|
-
.emotion-
|
|
86
|
+
.emotion-3 {
|
|
76
87
|
height: 2px;
|
|
77
88
|
background-color: #6161FF;
|
|
78
89
|
margin-top: -2px;
|
|
@@ -83,21 +94,21 @@ exports[`Component: Select default snapshot 1`] = `
|
|
|
83
94
|
z-index: 9;
|
|
84
95
|
}
|
|
85
96
|
|
|
86
|
-
.emotion-
|
|
87
|
-
.emotion-
|
|
97
|
+
.emotion-3._pebble_input_highlight_state,
|
|
98
|
+
.emotion-3._pebble_input_highlight_focused {
|
|
88
99
|
width: 100%;
|
|
89
100
|
}
|
|
90
101
|
|
|
91
|
-
.emotion-
|
|
102
|
+
.emotion-7 {
|
|
92
103
|
position: relative;
|
|
93
104
|
}
|
|
94
105
|
|
|
95
|
-
.emotion-
|
|
106
|
+
.emotion-6 {
|
|
96
107
|
cursor: pointer;
|
|
97
108
|
position: relative;
|
|
98
109
|
}
|
|
99
110
|
|
|
100
|
-
.emotion-
|
|
111
|
+
.emotion-5 {
|
|
101
112
|
position: absolute;
|
|
102
113
|
top: 0;
|
|
103
114
|
bottom: 0;
|
|
@@ -108,13 +119,13 @@ exports[`Component: Select default snapshot 1`] = `
|
|
|
108
119
|
font-size: 10px;
|
|
109
120
|
}
|
|
110
121
|
|
|
111
|
-
.emotion-
|
|
122
|
+
.emotion-5.__pebble__select__open {
|
|
112
123
|
-webkit-transform: rotate(180deg);
|
|
113
124
|
-ms-transform: rotate(180deg);
|
|
114
125
|
transform: rotate(180deg);
|
|
115
126
|
}
|
|
116
127
|
|
|
117
|
-
.emotion-
|
|
128
|
+
.emotion-13 {
|
|
118
129
|
display: -webkit-box;
|
|
119
130
|
display: -webkit-flex;
|
|
120
131
|
display: -ms-flexbox;
|
|
@@ -144,7 +155,7 @@ exports[`Component: Select default snapshot 1`] = `
|
|
|
144
155
|
color: #6B7785;
|
|
145
156
|
}
|
|
146
157
|
|
|
147
|
-
.emotion-
|
|
158
|
+
.emotion-8 {
|
|
148
159
|
margin-bottom: 20px;
|
|
149
160
|
width: 80px;
|
|
150
161
|
margin-bottom: 0;
|
|
@@ -153,7 +164,6 @@ exports[`Component: Select default snapshot 1`] = `
|
|
|
153
164
|
.emotion-1 {
|
|
154
165
|
outline: 0;
|
|
155
166
|
border: 0;
|
|
156
|
-
border-bottom: 1px solid #EDEDED;
|
|
157
167
|
padding: 24px 0 12px 0;
|
|
158
168
|
height: 48px;
|
|
159
169
|
border-radius: 0;
|
|
@@ -205,7 +215,7 @@ exports[`Component: Select default snapshot 1`] = `
|
|
|
205
215
|
color: #E0E0E0;
|
|
206
216
|
}
|
|
207
217
|
|
|
208
|
-
.emotion-
|
|
218
|
+
.emotion-4 {
|
|
209
219
|
position: relative;
|
|
210
220
|
display: -webkit-box;
|
|
211
221
|
display: -webkit-flex;
|
|
@@ -222,12 +232,12 @@ exports[`Component: Select default snapshot 1`] = `
|
|
|
222
232
|
margin-bottom: 0;
|
|
223
233
|
}
|
|
224
234
|
|
|
225
|
-
.emotion-
|
|
235
|
+
.emotion-4._pebble_input_wrapper_textarea {
|
|
226
236
|
height: 110px;
|
|
227
237
|
}
|
|
228
238
|
|
|
229
239
|
<div
|
|
230
|
-
className="emotion-
|
|
240
|
+
className="emotion-13"
|
|
231
241
|
>
|
|
232
242
|
<label
|
|
233
243
|
className="_pebble_input_label_focused emotion-0"
|
|
@@ -235,10 +245,10 @@ exports[`Component: Select default snapshot 1`] = `
|
|
|
235
245
|
Phone No.
|
|
236
246
|
</label>
|
|
237
247
|
<div
|
|
238
|
-
className="emotion-
|
|
248
|
+
className="emotion-8"
|
|
239
249
|
>
|
|
240
250
|
<div
|
|
241
|
-
className="emotion-
|
|
251
|
+
className="emotion-7"
|
|
242
252
|
>
|
|
243
253
|
<div
|
|
244
254
|
style={
|
|
@@ -249,23 +259,27 @@ exports[`Component: Select default snapshot 1`] = `
|
|
|
249
259
|
}
|
|
250
260
|
>
|
|
251
261
|
<div
|
|
252
|
-
className="emotion-
|
|
262
|
+
className="emotion-6"
|
|
253
263
|
onClick={[Function]}
|
|
254
264
|
>
|
|
255
265
|
<div
|
|
256
|
-
className="emotion-
|
|
266
|
+
className="emotion-4"
|
|
257
267
|
onBlur={[Function]}
|
|
258
268
|
onFocus={[Function]}
|
|
259
269
|
>
|
|
260
|
-
<input
|
|
261
|
-
className="emotion-1"
|
|
262
|
-
id="phone-select-input-test"
|
|
263
|
-
onChange={[Function]}
|
|
264
|
-
readOnly={true}
|
|
265
|
-
value="+1"
|
|
266
|
-
/>
|
|
267
270
|
<div
|
|
268
|
-
className="emotion-2
|
|
271
|
+
className="emotion-2"
|
|
272
|
+
>
|
|
273
|
+
<input
|
|
274
|
+
className="emotion-1"
|
|
275
|
+
id="phone-select-input-test"
|
|
276
|
+
onChange={[Function]}
|
|
277
|
+
readOnly={true}
|
|
278
|
+
value="+1"
|
|
279
|
+
/>
|
|
280
|
+
</div>
|
|
281
|
+
<div
|
|
282
|
+
className="emotion-3 _pebble_input_highlight_read_only"
|
|
269
283
|
style={
|
|
270
284
|
Object {
|
|
271
285
|
"backgroundColor": "#6161FF",
|
|
@@ -275,26 +289,30 @@ exports[`Component: Select default snapshot 1`] = `
|
|
|
275
289
|
|
|
276
290
|
</div>
|
|
277
291
|
<i
|
|
278
|
-
className="emotion-
|
|
292
|
+
className="emotion-5 pi pi-arrow-drop-down"
|
|
279
293
|
/>
|
|
280
294
|
</div>
|
|
281
295
|
</div>
|
|
282
296
|
</div>
|
|
283
297
|
</div>
|
|
284
298
|
<div
|
|
285
|
-
className="emotion-
|
|
299
|
+
className="emotion-12"
|
|
286
300
|
onBlur={[Function]}
|
|
287
301
|
onFocus={[Function]}
|
|
288
302
|
>
|
|
289
|
-
<input
|
|
290
|
-
className="emotion-8"
|
|
291
|
-
id="phone-test-input-test"
|
|
292
|
-
onChange={[Function]}
|
|
293
|
-
readOnly={false}
|
|
294
|
-
value=""
|
|
295
|
-
/>
|
|
296
303
|
<div
|
|
297
304
|
className="emotion-2"
|
|
305
|
+
>
|
|
306
|
+
<input
|
|
307
|
+
className="emotion-9"
|
|
308
|
+
id="phone-test-input-test"
|
|
309
|
+
onChange={[Function]}
|
|
310
|
+
readOnly={false}
|
|
311
|
+
value=""
|
|
312
|
+
/>
|
|
313
|
+
</div>
|
|
314
|
+
<div
|
|
315
|
+
className="emotion-3"
|
|
298
316
|
style={
|
|
299
317
|
Object {
|
|
300
318
|
"backgroundColor": "#6161FF",
|