@sellout/ui 0.0.208 → 0.0.210
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.
|
@@ -41,7 +41,7 @@ var StyledButton = styled.div(templateObject_1 || (templateObject_1 = __makeTemp
|
|
|
41
41
|
}
|
|
42
42
|
if (props.type === ButtonTypes.Thin) {
|
|
43
43
|
if (props.state === ButtonStates.Warning) {
|
|
44
|
-
return "
|
|
44
|
+
return "30px";
|
|
45
45
|
}
|
|
46
46
|
return "30px";
|
|
47
47
|
}
|
|
@@ -175,7 +175,7 @@ var Text = styled.span(templateObject_2 || (templateObject_2 = __makeTemplateObj
|
|
|
175
175
|
}, function (props) {
|
|
176
176
|
if (props.type === ButtonTypes.Thin) {
|
|
177
177
|
if (props.icon) {
|
|
178
|
-
return
|
|
178
|
+
return "-1px";
|
|
179
179
|
}
|
|
180
180
|
return "0";
|
|
181
181
|
}
|
|
@@ -203,7 +203,8 @@ function Button(_a) {
|
|
|
203
203
|
icon && iconPosition === ButtonIconPosition.Left && iconEl,
|
|
204
204
|
text && (React.createElement(Text, { type: type, state: state, icon: Boolean(icon), iconPosition: iconPosition, textColor: textColor }, text)),
|
|
205
205
|
icon &&
|
|
206
|
-
iconPosition === ButtonIconPosition.Right &&
|
|
206
|
+
iconPosition === ButtonIconPosition.Right &&
|
|
207
|
+
iconEl));
|
|
207
208
|
})()));
|
|
208
209
|
})())));
|
|
209
210
|
}
|
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
import Joi from '@hapi/joi';
|
|
2
2
|
|
|
3
3
|
// Email Validation
|
|
4
|
-
var email = Joi
|
|
5
|
-
.string()
|
|
4
|
+
var email = Joi.string()
|
|
6
5
|
.required()
|
|
7
6
|
.email({ tlds: { allow: false } })
|
|
8
7
|
.error(function () {
|
|
9
|
-
return new Error(
|
|
8
|
+
return new Error("Please enter a valid email.");
|
|
10
9
|
});
|
|
11
10
|
// Password Validation
|
|
12
11
|
// could force users to be more secure ->
|
|
13
12
|
// https://stackoverflow.com/questions/19605150/regex-for-password-must-contain-at-least-eight-characters-at-least-one-number-a
|
|
14
|
-
var password = Joi
|
|
15
|
-
.string()
|
|
13
|
+
var password = Joi.string()
|
|
16
14
|
.required()
|
|
17
15
|
.min(8)
|
|
18
16
|
.max(30)
|
|
@@ -21,33 +19,31 @@ var password = Joi
|
|
|
21
19
|
console.log(error);
|
|
22
20
|
switch (error.code) {
|
|
23
21
|
case "string.min":
|
|
24
|
-
return new Error(
|
|
22
|
+
return new Error("Password must be greater than 8 Characters.");
|
|
25
23
|
case "string.max":
|
|
26
|
-
return new Error(
|
|
24
|
+
return new Error("Password must be fewer than 30 characters.");
|
|
27
25
|
case "string.empty":
|
|
28
|
-
return new Error(
|
|
26
|
+
return new Error("Please enter a password.");
|
|
29
27
|
default:
|
|
30
|
-
return new Error(
|
|
28
|
+
return new Error("Password validation error.");
|
|
31
29
|
}
|
|
32
30
|
});
|
|
33
31
|
});
|
|
34
32
|
// full name validation - only checks for first and last name via single space character
|
|
35
33
|
// all characters are valid, gotta support X Æ A-12 now
|
|
36
34
|
// should maybe fix, idk, it accepts stuff like Mike\tPollard
|
|
37
|
-
var fullName = Joi
|
|
38
|
-
.string()
|
|
35
|
+
var fullName = Joi.string()
|
|
39
36
|
.required()
|
|
40
37
|
.pattern(new RegExp("^[^\\s]+(\\s[^\\s]+)+$"))
|
|
41
38
|
.error(function () {
|
|
42
|
-
return new Error(
|
|
39
|
+
return new Error("Please enter your first and last name");
|
|
43
40
|
});
|
|
44
41
|
// Phone number validation, need to test internationally
|
|
45
|
-
var phoneNumber = Joi
|
|
46
|
-
.string()
|
|
42
|
+
var phoneNumber = Joi.string()
|
|
47
43
|
.required()
|
|
48
44
|
.pattern(new RegExp("^(\\+\\d{1,2}\\s?)?1?\\-?\\.?\\s?\\(?\\d{3}\\)?[\\s.-]?\\d{3}[\\s.-]?\\d{4}$"))
|
|
49
45
|
.error(function () {
|
|
50
|
-
return new Error(
|
|
46
|
+
return new Error("Please enter a valid phone number.");
|
|
51
47
|
});
|
|
52
48
|
|
|
53
49
|
export { email, fullName, password, phoneNumber };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sellout/ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.210",
|
|
4
4
|
"main": "build/index.js",
|
|
5
5
|
"module": "build/index.es.js",
|
|
6
6
|
"files": [
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"shortid": "^2.2.16",
|
|
71
71
|
"use-places-autocomplete": "^1.9.4"
|
|
72
72
|
},
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "35ada21eb9cba96e19691dae000bd889dfc98503",
|
|
74
74
|
"peerDependencies": {
|
|
75
75
|
"react": "^16.13.0",
|
|
76
76
|
"react-dom": "^16.13.0",
|