@sellout/ui 0.0.242 → 0.0.243

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.
@@ -45,6 +45,7 @@ export declare type InputProps = {
45
45
  handleIncrement?: any;
46
46
  handleDecrement?: any;
47
47
  codeApply?: string;
48
+ discountCode?: string;
48
49
  };
49
50
  declare const _default: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<unknown>>;
50
51
  export default _default;
@@ -46,9 +46,9 @@ var Button = styled.div(templateObject_4 || (templateObject_4 = __makeTemplateOb
46
46
  if (props.size === InputSizes.Regular)
47
47
  return "40px";
48
48
  return null;
49
- }, function (props) { return props.codeApply ? "17px" : "-1px"; }, function (props) { return (props.onClick ? "pointer" : null); }, function (props) { return (props.onClick ? "pointer" : null); });
49
+ }, function (props) { return (props.codeApply ? "17px" : "-1px"); }, function (props) { return (props.onClick ? "pointer" : null); }, function (props) { return (props.onClick ? "pointer" : null); });
50
50
  var IconContainer = styled.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 18px;\n"], ["\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 18px;\n"])));
51
- var TextContainer = styled.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n color: ", ";\n font-size: 1.7rem;\n text-decoration: underline;\n font-weight: 500;\n"], ["\n color: ", ";\n font-size: 1.7rem;\n text-decoration: underline;\n font-weight: 500;\n"])), function (props) { return (props.canSubmit ? Colors.Orange : Colors.Grey5); });
51
+ var TextContainer = styled.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n color: ", ";\n font-size: 1.7rem;\n text-decoration: underline;\n font-weight: 500;\n"], ["\n color: ", ";\n font-size: 1.7rem;\n text-decoration: underline;\n font-weight: 500;\n"])), function (props) { return (props.canSubmit ? Colors.Orange : Colors.Orange); });
52
52
  var LeftContainer = styled.div(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n margin-left: 16px;\n top: 0px;\n left: 0px;\n background-color: ", ";\n"], ["\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n margin-left: 16px;\n top: 0px;\n left: 0px;\n background-color: ", ";\n"])), Colors.White);
53
53
  var RightContainer = styled.div(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n position: absolute;\n display: flex;\n align-items: center;\n justify-content: center;\n height: ", ";\n width: ", ";\n top: -1px;\n right: -1px;\n background-color: ", ";\n\n &:hover {\n cursor: ", ";\n }\n"], ["\n position: absolute;\n display: flex;\n align-items: center;\n justify-content: center;\n height: ",
54
54
  ";\n width: ",
@@ -77,12 +77,12 @@ var InputStyled = styled.input(templateObject_12 || (templateObject_12 = __makeT
77
77
  return null;
78
78
  }, function (props) { return (props.hasIcon ? "8px" : "16px"); }, function (props) { return props.padding; }, Colors.Grey4, media.mobile(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n font-size: 1.6rem;\n"], ["\n font-size: 1.6rem;\n"]))), media.desktop(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n font-size: 1.4rem;\n"], ["\n font-size: 1.4rem;\n"]))));
79
79
  function Input(_a, inputRef) {
80
- var autoFocus = _a.autoFocus, placeholder = _a.placeholder, value = _a.value, defaultValue = _a.defaultValue, icon = _a.icon, iconColor = _a.iconColor, _b = _a.size, size = _b === void 0 ? InputSizes.Regular : _b, _c = _a.type, type = _c === void 0 ? "text" : _c, onMouseEnter = _a.onMouseEnter, onMouseLeave = _a.onMouseLeave, onChange = _a.onChange, onFocus = _a.onFocus, onBlur = _a.onBlur, onSubmit = _a.onSubmit, onClear = _a.onClear, _d = _a.canSubmit, canSubmit = _d === void 0 ? true : _d, loading = _a.loading, margin = _a.margin, padding = _a.padding, width = _a.width, onEnter = _a.onEnter, label = _a.label, subLabel = _a.subLabel, tip = _a.tip, maxLength = _a.maxLength, iconConditionalColor = _a.iconConditionalColor, validationError = _a.validationError, _e = _a.disabled, disabled = _e === void 0 ? false : _e, _f = _a.incrementButton, incrementButton = _f === void 0 ? false : _f, handleIncrement = _a.handleIncrement, handleDecrement = _a.handleDecrement, codeApply = _a.codeApply;
80
+ var autoFocus = _a.autoFocus, placeholder = _a.placeholder, value = _a.value, defaultValue = _a.defaultValue, icon = _a.icon, iconColor = _a.iconColor, _b = _a.size, size = _b === void 0 ? InputSizes.Regular : _b, _c = _a.type, type = _c === void 0 ? "text" : _c, onMouseEnter = _a.onMouseEnter, onMouseLeave = _a.onMouseLeave, onChange = _a.onChange, onFocus = _a.onFocus, onBlur = _a.onBlur, onSubmit = _a.onSubmit, onClear = _a.onClear, _d = _a.canSubmit, canSubmit = _d === void 0 ? true : _d, loading = _a.loading, margin = _a.margin, padding = _a.padding, width = _a.width, onEnter = _a.onEnter, label = _a.label, subLabel = _a.subLabel, tip = _a.tip, maxLength = _a.maxLength, iconConditionalColor = _a.iconConditionalColor, validationError = _a.validationError, _e = _a.disabled, disabled = _e === void 0 ? false : _e, _f = _a.incrementButton, incrementButton = _f === void 0 ? false : _f, handleIncrement = _a.handleIncrement, handleDecrement = _a.handleDecrement, codeApply = _a.codeApply, discountCode = _a.discountCode;
81
81
  var _g = useState(false), hovered = _g[0], setHovered = _g[1];
82
82
  var _h = useState(false), focused = _h[0], setFocused = _h[1];
83
83
  var submit = function (event) {
84
84
  event.preventDefault();
85
- if (onSubmit && canSubmit && !loading) {
85
+ if (onSubmit && !loading) {
86
86
  onSubmit();
87
87
  }
88
88
  else if (onEnter && !loading) {
@@ -153,8 +153,8 @@ function Input(_a, inputRef) {
153
153
  return (React.createElement(Loader, { size: LoaderSizes.VerySmall, color: Colors.Orange }));
154
154
  }
155
155
  return (React.createElement(React.Fragment, null,
156
- !codeApply && React.createElement(Icon, { icon: Icons.RightChevronCircle, color: canSubmit ? Colors.Orange : Colors.Grey5, size: submitIconSize }),
157
- codeApply && React.createElement(TextContainer, { canSubmit: canSubmit }, "Apply")));
156
+ !codeApply && (React.createElement(Icon, { icon: Icons.RightChevronCircle, color: canSubmit ? Colors.Orange : Colors.Grey5, size: submitIconSize })),
157
+ codeApply && (React.createElement(TextContainer, { canSubmit: canSubmit }, discountCode ? "Clear" : "Apply"))));
158
158
  })())));
159
159
  }
160
160
  if (loading) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sellout/ui",
3
- "version": "0.0.242",
3
+ "version": "0.0.243",
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": "320595924cb2d405f5d9e02f06910c5232d781eb",
73
+ "gitHead": "e361f8266cbe1e4f8b28d89b6a1562d2bbd3e6e6",
74
74
  "peerDependencies": {
75
75
  "react": "^16.13.0",
76
76
  "react-dom": "^16.13.0",