pebble-web 2.9.1 → 2.9.3
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/typings/Input.d.ts +8 -6
- package/dist/components/typings/Select.d.ts +2 -2
- package/dist/pebble-web.dev.js +17 -13
- package/dist/pebble-web.dev.js.map +1 -1
- package/dist/pebble-web.es.dev.js +17 -13
- package/dist/pebble-web.es.dev.js.map +1 -1
- package/dist/pebble-web.es.js +15 -11
- package/dist/pebble-web.es.js.map +1 -1
- package/dist/pebble-web.js +15 -11
- package/dist/pebble-web.js.map +1 -1
- package/dist/pebble-web.module.dev.js +17 -13
- package/dist/pebble-web.module.dev.js.map +1 -1
- package/dist/pebble-web.module.js +15 -11
- package/dist/pebble-web.module.js.map +1 -1
- package/dist/pebble-web.umd.dev.js +17 -13
- package/dist/pebble-web.umd.dev.js.map +1 -1
- package/dist/pebble-web.umd.js +15 -11
- package/dist/pebble-web.umd.js.map +1 -1
- package/package.json +3 -3
- package/src/components/DateInput.tsx +1 -1
- package/src/components/Input.tsx +24 -12
- package/src/components/Select.tsx +9 -3
- package/src/components/Sidebar.tsx +1 -1
- package/src/components/__tests__/__snapshots__/phonenumberinput.test.tsx.snap +33 -65
- package/src/components/styles/Modal.styles.ts +1 -1
- package/src/components/typings/Input.ts +16 -5
- package/src/components/typings/Select.ts +2 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pebble-web",
|
|
3
|
-
"version": "2.9.
|
|
3
|
+
"version": "2.9.3",
|
|
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.9.
|
|
47
|
+
"pebble-shared": "^2.9.3"
|
|
48
48
|
},
|
|
49
49
|
"greenkeeper": {
|
|
50
50
|
"ignore": [
|
|
51
51
|
"rheostat"
|
|
52
52
|
]
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "4af3ab593a194d8eeb9540671cb99fcf4bd132a1"
|
|
55
55
|
}
|
|
@@ -114,7 +114,7 @@ export default class DateInput extends React.PureComponent<
|
|
|
114
114
|
onChange={noop}
|
|
115
115
|
type={"tel"}
|
|
116
116
|
value={value}
|
|
117
|
-
placeholder={
|
|
117
|
+
placeholder={placeholder}
|
|
118
118
|
onClick={() => {
|
|
119
119
|
if (disabled) return;
|
|
120
120
|
toggleDropdown();
|
package/src/components/Input.tsx
CHANGED
|
@@ -68,6 +68,8 @@ class Input extends React.PureComponent<InputProps, InputState> {
|
|
|
68
68
|
placeholder,
|
|
69
69
|
className,
|
|
70
70
|
inputClassName,
|
|
71
|
+
highlightClassName,
|
|
72
|
+
loadingClassName,
|
|
71
73
|
fixLabelAtTop,
|
|
72
74
|
value,
|
|
73
75
|
readOnly,
|
|
@@ -103,12 +105,16 @@ class Input extends React.PureComponent<InputProps, InputState> {
|
|
|
103
105
|
value: value || ""
|
|
104
106
|
};
|
|
105
107
|
|
|
106
|
-
const
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
108
|
+
const _highlightClassName = cx(
|
|
109
|
+
highlightStyle,
|
|
110
|
+
{
|
|
111
|
+
_pebble_input_highlight_focused: !!isFocused,
|
|
112
|
+
_pebble_input_highlight_state: !!errorMessage || !!successMessage,
|
|
113
|
+
_pebble_input_highlight_read_only: !!readOnly,
|
|
114
|
+
_pebble_input_highlight_disabled: !!disabled
|
|
115
|
+
},
|
|
116
|
+
highlightClassName
|
|
117
|
+
);
|
|
112
118
|
|
|
113
119
|
const labelClassName = cx(labelStyle, {
|
|
114
120
|
_pebble_input_label_focused: !!(isFocused || !!value || fixLabelAtTop)
|
|
@@ -122,6 +128,8 @@ class Input extends React.PureComponent<InputProps, InputState> {
|
|
|
122
128
|
className
|
|
123
129
|
);
|
|
124
130
|
|
|
131
|
+
const _loadingStyle = cx(loadingStyle, loadingClassName);
|
|
132
|
+
|
|
125
133
|
return (
|
|
126
134
|
<div
|
|
127
135
|
className={_wrapperStyle}
|
|
@@ -135,13 +143,17 @@ class Input extends React.PureComponent<InputProps, InputState> {
|
|
|
135
143
|
<input type={type} {..._inputProps} {...this.props.inputProps} />
|
|
136
144
|
)}
|
|
137
145
|
|
|
138
|
-
|
|
139
|
-
{
|
|
140
|
-
|
|
141
|
-
|
|
146
|
+
{!!placeholder && (
|
|
147
|
+
<label className={labelClassName}>
|
|
148
|
+
{placeholder}
|
|
149
|
+
{required && (
|
|
150
|
+
<span style={{ color: colors.red.base }}> *</span>
|
|
151
|
+
)}
|
|
152
|
+
</label>
|
|
153
|
+
)}
|
|
142
154
|
|
|
143
155
|
<div
|
|
144
|
-
className={
|
|
156
|
+
className={_highlightClassName}
|
|
145
157
|
style={{
|
|
146
158
|
backgroundColor: getColor(errorMessage, successMessage, true)
|
|
147
159
|
}}
|
|
@@ -151,7 +163,7 @@ class Input extends React.PureComponent<InputProps, InputState> {
|
|
|
151
163
|
<Loader
|
|
152
164
|
color={colors.violet.base}
|
|
153
165
|
scale={0.6}
|
|
154
|
-
className={
|
|
166
|
+
className={_loadingStyle}
|
|
155
167
|
/>
|
|
156
168
|
)}
|
|
157
169
|
|
|
@@ -27,6 +27,7 @@ function Select<OptionType>(props: SelectProps<OptionType>) {
|
|
|
27
27
|
errorMessage,
|
|
28
28
|
value,
|
|
29
29
|
dropdownClassName,
|
|
30
|
+
arrowClassName,
|
|
30
31
|
inputProps,
|
|
31
32
|
fullWidthDropdown,
|
|
32
33
|
onDropdownToggle = noop,
|
|
@@ -48,9 +49,14 @@ function Select<OptionType>(props: SelectProps<OptionType>) {
|
|
|
48
49
|
})}
|
|
49
50
|
onOutsideClick={isOpen => onDropdownToggle(isOpen)}
|
|
50
51
|
labelComponent={({ toggleDropdown, isOpen }) => {
|
|
51
|
-
const chevron = cx(
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
const chevron = cx(
|
|
53
|
+
chevronStyle,
|
|
54
|
+
"pi pi-arrow-drop-down",
|
|
55
|
+
{
|
|
56
|
+
__pebble__select__open: isOpen
|
|
57
|
+
},
|
|
58
|
+
arrowClassName
|
|
59
|
+
);
|
|
54
60
|
return (
|
|
55
61
|
<div
|
|
56
62
|
className={cx(inputWrapper, disabled && disabledSelect)}
|
|
@@ -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-10 {
|
|
5
5
|
position: relative;
|
|
6
6
|
display: -webkit-box;
|
|
7
7
|
display: -webkit-flex;
|
|
@@ -16,11 +16,11 @@ exports[`Component: Select default snapshot 1`] = `
|
|
|
16
16
|
height: 68px;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
.emotion-
|
|
19
|
+
.emotion-10._pebble_input_wrapper_textarea {
|
|
20
20
|
height: 110px;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
.emotion-
|
|
23
|
+
.emotion-8 {
|
|
24
24
|
outline: 0;
|
|
25
25
|
border: 0;
|
|
26
26
|
border-bottom: 1px solid #EDEDED;
|
|
@@ -36,43 +36,43 @@ exports[`Component: Select default snapshot 1`] = `
|
|
|
36
36
|
white-space: nowrap;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
.emotion-
|
|
39
|
+
.emotion-8:disabled {
|
|
40
40
|
background-color: #ffffff;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
.emotion-
|
|
43
|
+
.emotion-8::-webkit-input-placeholder {
|
|
44
44
|
color: #E0E0E0;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
.emotion-
|
|
47
|
+
.emotion-8::-moz-placeholder {
|
|
48
48
|
color: #E0E0E0;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
.emotion-
|
|
51
|
+
.emotion-8:-ms-input-placeholder {
|
|
52
52
|
color: #E0E0E0;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
.emotion-
|
|
55
|
+
.emotion-8:-moz-placeholder {
|
|
56
56
|
color: #E0E0E0;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
.emotion-
|
|
59
|
+
.emotion-8::-webkit-input-placeholder {
|
|
60
60
|
color: #E0E0E0;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
.emotion-
|
|
63
|
+
.emotion-8::-moz-placeholder {
|
|
64
64
|
color: #E0E0E0;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
.emotion-
|
|
67
|
+
.emotion-8:-ms-input-placeholder {
|
|
68
68
|
color: #E0E0E0;
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
.emotion-
|
|
71
|
+
.emotion-8::placeholder {
|
|
72
72
|
color: #E0E0E0;
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
.emotion-
|
|
75
|
+
.emotion-2 {
|
|
76
76
|
height: 2px;
|
|
77
77
|
background-color: #6161FF;
|
|
78
78
|
margin-top: -2px;
|
|
@@ -83,43 +83,21 @@ exports[`Component: Select default snapshot 1`] = `
|
|
|
83
83
|
z-index: 9;
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
.emotion-
|
|
87
|
-
.emotion-
|
|
86
|
+
.emotion-2._pebble_input_highlight_state,
|
|
87
|
+
.emotion-2._pebble_input_highlight_focused {
|
|
88
88
|
width: 100%;
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
.emotion-
|
|
92
|
-
color: #9FA6B0;
|
|
93
|
-
font-size: 14px;
|
|
94
|
-
line-height: 12px;
|
|
95
|
-
position: absolute;
|
|
96
|
-
-webkit-transition: all 0.3s cubic-bezier(.64,.09,.08,1);
|
|
97
|
-
transition: all 0.3s cubic-bezier(.64,.09,.08,1);
|
|
98
|
-
-webkit-transform: translate(0,24px);
|
|
99
|
-
-ms-transform: translate(0,24px);
|
|
100
|
-
transform: translate(0,24px);
|
|
101
|
-
pointer-events: none;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
.emotion-2._pebble_input_label_focused {
|
|
105
|
-
font-size: 12px;
|
|
106
|
-
line-height: 10px;
|
|
107
|
-
-webkit-transform: translate(0,0);
|
|
108
|
-
-ms-transform: translate(0,0);
|
|
109
|
-
transform: translate(0,0);
|
|
110
|
-
color: #6B7785;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
.emotion-7 {
|
|
91
|
+
.emotion-6 {
|
|
114
92
|
position: relative;
|
|
115
93
|
}
|
|
116
94
|
|
|
117
|
-
.emotion-
|
|
95
|
+
.emotion-5 {
|
|
118
96
|
cursor: pointer;
|
|
119
97
|
position: relative;
|
|
120
98
|
}
|
|
121
99
|
|
|
122
|
-
.emotion-
|
|
100
|
+
.emotion-4 {
|
|
123
101
|
position: absolute;
|
|
124
102
|
top: 0;
|
|
125
103
|
bottom: 0;
|
|
@@ -130,13 +108,13 @@ exports[`Component: Select default snapshot 1`] = `
|
|
|
130
108
|
font-size: 10px;
|
|
131
109
|
}
|
|
132
110
|
|
|
133
|
-
.emotion-
|
|
111
|
+
.emotion-4.__pebble__select__open {
|
|
134
112
|
-webkit-transform: rotate(180deg);
|
|
135
113
|
-ms-transform: rotate(180deg);
|
|
136
114
|
transform: rotate(180deg);
|
|
137
115
|
}
|
|
138
116
|
|
|
139
|
-
.emotion-
|
|
117
|
+
.emotion-11 {
|
|
140
118
|
display: -webkit-box;
|
|
141
119
|
display: -webkit-flex;
|
|
142
120
|
display: -ms-flexbox;
|
|
@@ -166,7 +144,7 @@ exports[`Component: Select default snapshot 1`] = `
|
|
|
166
144
|
color: #6B7785;
|
|
167
145
|
}
|
|
168
146
|
|
|
169
|
-
.emotion-
|
|
147
|
+
.emotion-7 {
|
|
170
148
|
margin-bottom: 20px;
|
|
171
149
|
width: 80px;
|
|
172
150
|
margin-bottom: 0;
|
|
@@ -227,7 +205,7 @@ exports[`Component: Select default snapshot 1`] = `
|
|
|
227
205
|
color: #E0E0E0;
|
|
228
206
|
}
|
|
229
207
|
|
|
230
|
-
.emotion-
|
|
208
|
+
.emotion-3 {
|
|
231
209
|
position: relative;
|
|
232
210
|
display: -webkit-box;
|
|
233
211
|
display: -webkit-flex;
|
|
@@ -244,12 +222,12 @@ exports[`Component: Select default snapshot 1`] = `
|
|
|
244
222
|
margin-bottom: 0;
|
|
245
223
|
}
|
|
246
224
|
|
|
247
|
-
.emotion-
|
|
225
|
+
.emotion-3._pebble_input_wrapper_textarea {
|
|
248
226
|
height: 110px;
|
|
249
227
|
}
|
|
250
228
|
|
|
251
229
|
<div
|
|
252
|
-
className="emotion-
|
|
230
|
+
className="emotion-11"
|
|
253
231
|
>
|
|
254
232
|
<label
|
|
255
233
|
className="_pebble_input_label_focused emotion-0"
|
|
@@ -257,10 +235,10 @@ exports[`Component: Select default snapshot 1`] = `
|
|
|
257
235
|
Phone No.
|
|
258
236
|
</label>
|
|
259
237
|
<div
|
|
260
|
-
className="emotion-
|
|
238
|
+
className="emotion-7"
|
|
261
239
|
>
|
|
262
240
|
<div
|
|
263
|
-
className="emotion-
|
|
241
|
+
className="emotion-6"
|
|
264
242
|
>
|
|
265
243
|
<div
|
|
266
244
|
style={
|
|
@@ -271,11 +249,11 @@ exports[`Component: Select default snapshot 1`] = `
|
|
|
271
249
|
}
|
|
272
250
|
>
|
|
273
251
|
<div
|
|
274
|
-
className="emotion-
|
|
252
|
+
className="emotion-5"
|
|
275
253
|
onClick={[Function]}
|
|
276
254
|
>
|
|
277
255
|
<div
|
|
278
|
-
className="emotion-
|
|
256
|
+
className="emotion-3"
|
|
279
257
|
onBlur={[Function]}
|
|
280
258
|
onFocus={[Function]}
|
|
281
259
|
>
|
|
@@ -286,13 +264,8 @@ exports[`Component: Select default snapshot 1`] = `
|
|
|
286
264
|
readOnly={true}
|
|
287
265
|
value="+1"
|
|
288
266
|
/>
|
|
289
|
-
<label
|
|
290
|
-
className="emotion-2 _pebble_input_label_focused"
|
|
291
|
-
>
|
|
292
|
-
|
|
293
|
-
</label>
|
|
294
267
|
<div
|
|
295
|
-
className="emotion-
|
|
268
|
+
className="emotion-2 _pebble_input_highlight_read_only"
|
|
296
269
|
style={
|
|
297
270
|
Object {
|
|
298
271
|
"backgroundColor": "#6161FF",
|
|
@@ -302,31 +275,26 @@ exports[`Component: Select default snapshot 1`] = `
|
|
|
302
275
|
|
|
303
276
|
</div>
|
|
304
277
|
<i
|
|
305
|
-
className="emotion-
|
|
278
|
+
className="emotion-4 pi pi-arrow-drop-down"
|
|
306
279
|
/>
|
|
307
280
|
</div>
|
|
308
281
|
</div>
|
|
309
282
|
</div>
|
|
310
283
|
</div>
|
|
311
284
|
<div
|
|
312
|
-
className="emotion-
|
|
285
|
+
className="emotion-10"
|
|
313
286
|
onBlur={[Function]}
|
|
314
287
|
onFocus={[Function]}
|
|
315
288
|
>
|
|
316
289
|
<input
|
|
317
|
-
className="emotion-
|
|
290
|
+
className="emotion-8"
|
|
318
291
|
id="phone-test-input-test"
|
|
319
292
|
onChange={[Function]}
|
|
320
293
|
readOnly={false}
|
|
321
294
|
value=""
|
|
322
295
|
/>
|
|
323
|
-
<label
|
|
324
|
-
className="emotion-2"
|
|
325
|
-
>
|
|
326
|
-
|
|
327
|
-
</label>
|
|
328
296
|
<div
|
|
329
|
-
className="emotion-
|
|
297
|
+
className="emotion-2"
|
|
330
298
|
style={
|
|
331
299
|
Object {
|
|
332
300
|
"backgroundColor": "#6161FF",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
|
|
3
|
-
interface CommonInputProps {
|
|
4
|
-
placeholder
|
|
3
|
+
export interface CommonInputProps {
|
|
4
|
+
placeholder?: string;
|
|
5
5
|
onChange: (text: string) => void;
|
|
6
6
|
value?: string | number;
|
|
7
7
|
className?: string;
|
|
@@ -9,6 +9,8 @@ interface CommonInputProps {
|
|
|
9
9
|
errorMessage?: string;
|
|
10
10
|
fixLabelAtTop?: boolean;
|
|
11
11
|
inputClassName?: string;
|
|
12
|
+
highlightClassName?: string;
|
|
13
|
+
loadingClassName?: string;
|
|
12
14
|
loading?: boolean;
|
|
13
15
|
message?: string;
|
|
14
16
|
onClick?: React.MouseEventHandler<HTMLDivElement>;
|
|
@@ -17,15 +19,24 @@ interface CommonInputProps {
|
|
|
17
19
|
successMessage?: string;
|
|
18
20
|
}
|
|
19
21
|
|
|
22
|
+
export type InputType =
|
|
23
|
+
| "text"
|
|
24
|
+
| "date"
|
|
25
|
+
| "password"
|
|
26
|
+
| "number"
|
|
27
|
+
| "email"
|
|
28
|
+
| "tel";
|
|
29
|
+
|
|
20
30
|
export interface SimpleInputProps extends CommonInputProps {
|
|
21
31
|
inputProps?: React.InputHTMLAttributes<HTMLInputElement> &
|
|
22
32
|
React.RefAttributes<HTMLInputElement>;
|
|
23
33
|
textArea?: false;
|
|
24
|
-
type?:
|
|
34
|
+
type?: InputType;
|
|
25
35
|
}
|
|
26
36
|
|
|
27
|
-
interface TextAreaInputProps extends CommonInputProps {
|
|
28
|
-
inputProps?: React.InputHTMLAttributes<HTMLTextAreaElement
|
|
37
|
+
export interface TextAreaInputProps extends CommonInputProps {
|
|
38
|
+
inputProps?: React.InputHTMLAttributes<HTMLTextAreaElement> &
|
|
39
|
+
React.RefAttributes<HTMLTextAreaElement>;
|
|
29
40
|
textArea: true;
|
|
30
41
|
type?: undefined;
|
|
31
42
|
}
|
|
@@ -4,7 +4,7 @@ import { Extras } from "./OptionGroup";
|
|
|
4
4
|
import { Omit } from "utility-types";
|
|
5
5
|
import { Placement, Modifiers } from "popper.js";
|
|
6
6
|
|
|
7
|
-
interface CommonSelectProps<OptionType> {
|
|
7
|
+
export interface CommonSelectProps<OptionType> {
|
|
8
8
|
className?: string;
|
|
9
9
|
placeholder: string;
|
|
10
10
|
required?: boolean;
|
|
@@ -14,6 +14,7 @@ interface CommonSelectProps<OptionType> {
|
|
|
14
14
|
searchBox?: boolean;
|
|
15
15
|
searchBoxProps?: Omit<SearchProps, "type">;
|
|
16
16
|
dropdownClassName?: string;
|
|
17
|
+
arrowClassName?: string;
|
|
17
18
|
inputProps?: Omit<SimpleInputProps, "onChange" | "value" | "placeholder">;
|
|
18
19
|
fullWidthDropdown?: boolean;
|
|
19
20
|
onDropdownToggle?: (isOpen: boolean) => void;
|