@citygross/components 0.7.146 → 0.7.147

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.
@@ -61,8 +61,16 @@ var ZipCodeInput = function (_a) {
61
61
  inputRefs.current[index].blur();
62
62
  }
63
63
  };
64
+ React.useEffect(function () {
65
+ var _a;
66
+ if (inputRefs && inputRefs.current && inputRefs.current[0]) {
67
+ (_a = inputRefs.current[0]) === null || _a === void 0 ? void 0 : _a.focus();
68
+ }
69
+ }, []);
64
70
  return (React__default["default"].createElement(ZipCodeInput_styles.InputWrapper, null, Array.from(Array(5).keys()).map(function (index) { return (React__default["default"].createElement("div", { key: index },
65
- React__default["default"].createElement(ZipCodeInput_styles.ZipCodeInputBox, { type: "number", onInput: function (e) { return (e.currentTarget.value = e.currentTarget.value.slice(0, 1)); }, onKeyUp: function (e) { return handleInput(index, e); }, verified: verified, backgroundColor: backgroundColor, verifiedBackground: verifiedBackground, marginLeft: index === 3, ref: function (ref) { return (inputRefs.current[index] = ref); }, autoFocus: index === 0 && autoFocus }))); })));
71
+ React__default["default"].createElement(ZipCodeInput_styles.ZipCodeInputBox, { type: "number", onInput: function (e) {
72
+ return (e.currentTarget.value = e.currentTarget.value.slice(0, 1));
73
+ }, onKeyUp: function (e) { return handleInput(index, e); }, verified: verified, backgroundColor: backgroundColor, verifiedBackground: verifiedBackground, marginLeft: index === 3, ref: function (ref) { return (inputRefs.current[index] = ref); }, autoFocus: index === 0 && autoFocus }))); })));
66
74
  };
67
75
 
68
76
  exports.ZipCodeInput = ZipCodeInput;
@@ -1 +1 @@
1
- {"version":3,"file":"ZipCodeInput.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"ZipCodeInput.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,4 +1,4 @@
1
- import React, { useRef } from 'react';
1
+ import React, { useRef, useEffect } from 'react';
2
2
  import { InputWrapper, ZipCodeInputBox } from './ZipCodeInput.styles.js';
3
3
 
4
4
  var ZipCodeInput = function (_a) {
@@ -53,8 +53,16 @@ var ZipCodeInput = function (_a) {
53
53
  inputRefs.current[index].blur();
54
54
  }
55
55
  };
56
+ useEffect(function () {
57
+ var _a;
58
+ if (inputRefs && inputRefs.current && inputRefs.current[0]) {
59
+ (_a = inputRefs.current[0]) === null || _a === void 0 ? void 0 : _a.focus();
60
+ }
61
+ }, []);
56
62
  return (React.createElement(InputWrapper, null, Array.from(Array(5).keys()).map(function (index) { return (React.createElement("div", { key: index },
57
- React.createElement(ZipCodeInputBox, { type: "number", onInput: function (e) { return (e.currentTarget.value = e.currentTarget.value.slice(0, 1)); }, onKeyUp: function (e) { return handleInput(index, e); }, verified: verified, backgroundColor: backgroundColor, verifiedBackground: verifiedBackground, marginLeft: index === 3, ref: function (ref) { return (inputRefs.current[index] = ref); }, autoFocus: index === 0 && autoFocus }))); })));
63
+ React.createElement(ZipCodeInputBox, { type: "number", onInput: function (e) {
64
+ return (e.currentTarget.value = e.currentTarget.value.slice(0, 1));
65
+ }, onKeyUp: function (e) { return handleInput(index, e); }, verified: verified, backgroundColor: backgroundColor, verifiedBackground: verifiedBackground, marginLeft: index === 3, ref: function (ref) { return (inputRefs.current[index] = ref); }, autoFocus: index === 0 && autoFocus }))); })));
58
66
  };
59
67
 
60
68
  export { ZipCodeInput };
@@ -1 +1 @@
1
- {"version":3,"file":"ZipCodeInput.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"ZipCodeInput.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@citygross/components",
3
- "version": "0.7.146",
3
+ "version": "0.7.147",
4
4
  "license": "ISC",
5
5
  "sideEffects": false,
6
6
  "main": "./build/cjs/components/src/index.js",
@@ -62,14 +62,14 @@
62
62
  "styled-components": "^5.2.1"
63
63
  },
64
64
  "dependencies": {
65
- "@citygross/design-tokens": "^0.2.45",
65
+ "@citygross/design-tokens": "^0.2.46",
66
66
  "@citygross/icons": "^0.1.8",
67
67
  "@citygross/react-use-bg-wizard": "^0.0.8",
68
- "@citygross/typography": "^0.0.75",
68
+ "@citygross/typography": "^0.0.76",
69
69
  "@citygross/utils": "^0.0.22",
70
70
  "framer-motion": "^4.1.17",
71
71
  "moment": "^2.29.1",
72
72
  "react-loading-skeleton": "^2.2.0"
73
73
  },
74
- "gitHead": "6361ed25a4713644fbf4ce8595ace2023eadf9c7"
74
+ "gitHead": "ce5a6f0a14a0f7d1c26a3de7d409c292acc73e2e"
75
75
  }