{"_id":"@attopartners/formal","_rev":"3-4517ac617942ee1d35bcc7f483eef5bc","name":"@attopartners/formal","dist-tags":{"latest":"0.1.7"},"versions":{"0.1.4":{"version":"0.1.4","name":"@attopartners/formal","author":{"name":"Kevin Wolf","email":"hi@kevinwolf.me"},"description":"Elegant form management primitives for the react hooks era","license":"MIT","homepage":"https://github.com/kevinwolfcr/formal#readme","repository":{"type":"git","url":"git+https://github.com/kevinwolfcr/formal.git"},"bugs":{"url":"https://github.com/kevinwolfcr/formal/issues"},"main":"lib/formal.js","types":"lib/formal.d.ts","directories":{"lib":"lib","test":"__tests__"},"publishConfig":{"access":"public"},"scripts":{"prebuild":"rm -rf ./lib","build":"tsc","test":"echo \"Error: run tests from root\" && exit 1"},"dependencies":{"react-fast-compare":"^2.0.4"},"peerDependencies":{"react":">=16.8","yup":"*"},"devDependencies":{"@types/yup":"^0.26.12","react":"^16.8.6","react-dom":"^16.8.6","react-hooks-testing-library":"^0.4.0","yup":"^0.27.0"},"gitHead":"a7efbbbfa9209b812abb992b8f6abe43d9bd49e4","_id":"@attopartners/formal@0.1.4","_nodeVersion":"11.13.0","_npmVersion":"lerna/3.14.1/node@v11.13.0+x64 (darwin)","dist":{"integrity":"sha512-uB6CMYS5gbc1rox7YzeU6nMnivncSEbUpA4RR+V+o8BxL40kkDrihes/x6aJWI/IJ8Zf68ZEy/S9F77kt1F/sw==","shasum":"2f50e805310b50eb7646501fdb1de83dec947265","tarball":"https://registry.npmjs.org/@attopartners/formal/-/formal-0.1.4.tgz","fileCount":4,"unpackedSize":8162,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc3rdXCRA9TVsSAnZWagAAMwcP/0eW85Ja4i9cyAZzDsRi\nQ2VP41xhmyY3HFyPzenA+4/7Sq76/DK7grjvV9XMOUYL4sVcBoFyJv3YrJdf\nZK3wpx+DOE76x49jt7gGq8zRwaGG7vRXO9A3kwZEdqg/0A9SV1ynFRd3w9O5\nQzvukiMXijWjDX8iKSjSrd2H4N0KQrYvok0ezx6gDGzmWLT6uZIamBCVgXTD\nfbbxsYpz/klV4lKN/tAfng3NctDghnMI2OWUhd9hPZLlRFqAuo5HAQXimj+Z\n6zv6tw6DdJtJQLcdJOVxuL5OT8A35Rt2/x3G4UIaKV2zoOuXKzso6/ex8Cr0\nQh3OvbWrN9kBuGxqHZeNTxGTR9o8ckHMpMSupjXr7ryV2uPH7jlPohkdn/kO\n3VpWC/RI2qno7vl9ODovr2IRPKxaWIa7CBiQgu/jD8Dkflt9l++zcGOrRTJr\nY+gYnAQSkKBZXgFUXHNUIgkHvjbNRFlPM3aVIPGdZERrjxdb0hvfDmmC+TOT\nBaen69/Oe/QkBIurkTmdBOjNVwYPEPoIMXR352WtIKsLm83rOp7YPQFT3U/r\nIEt08CKwK37CKosvbCWHnt/fJOESqKUtIokb9jDgEz76/GV+8/lEf2SFM1S/\nfLVWC63/b2e/fm3xSF4eN7OaA0G0mB3HWjxgfG2GaFx68wMd3psaVeREqBMj\nXq9P\r\n=8JbU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG8IEZUmubRWG60+hzt2KhWhpFVz+pMb5DtJcilGiIx9AiAuwBeQYJbXz9wBvgYrPR1cEPIqMO7ZrscB38v+1PWJ2A=="}]},"maintainers":[{"name":"attopartners","email":"stuart@attopartners.com"}],"_npmUser":{"name":"attopartners","email":"stuart@attopartners.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/formal_0.1.4_1558099798183_0.3930071888933684"},"_hasShrinkwrap":false},"0.1.5":{"version":"0.1.5","name":"@attopartners/formal","author":{"name":"Kevin Wolf","email":"hi@kevinwolf.me"},"description":"Elegant form management primitives for the react hooks era","license":"MIT","homepage":"https://github.com/kevinwolfcr/formal#readme","repository":{"type":"git","url":"git+https://github.com/kevinwolfcr/formal.git"},"bugs":{"url":"https://github.com/kevinwolfcr/formal/issues"},"main":"lib/formal.js","types":"lib/formal.d.ts","directories":{"lib":"lib","test":"__tests__"},"publishConfig":{"access":"public"},"scripts":{"prebuild":"rm -rf ./lib","build":"tsc","test":"echo \"Error: run tests from root\" && exit 1"},"dependencies":{"react-fast-compare":"^2.0.4"},"peerDependencies":{"react":">=16.8","yup":"*"},"devDependencies":{"@types/yup":"^0.26.12","react":"^16.8.6","react-dom":"^16.8.6","react-hooks-testing-library":"^0.4.0","yup":"^0.27.0"},"gitHead":"063e2e84e131269eb1dff4b0a4d9d15b47c0d5a5","_id":"@attopartners/formal@0.1.5","_nodeVersion":"11.13.0","_npmVersion":"lerna/3.14.1/node@v11.13.0+x64 (darwin)","dist":{"integrity":"sha512-iowp+DwhqVO2hdhyvrcDxG6GIuGBH4dNkWhQInT8FqXPMZAHruIaDjAPcMmHrZ080ciGB3hu339PFBF1tjdihg==","shasum":"86826ff1fcc84c7673fc37d7002ef82cd1f876bd","tarball":"https://registry.npmjs.org/@attopartners/formal/-/formal-0.1.5.tgz","fileCount":4,"unpackedSize":8316,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc3rewCRA9TVsSAnZWagAAvLcQAKL7SMVAMIhPqZC1zocn\nBivOpSVcX5NtXR1bHUujrLY5cIOIDi9MkWshYfgqQIaRBJ84DFQo0Sf1dOcu\nYov81Y7DU30bGIS63rZoeqiCAp6cYuVChJe3lB2mp2pyvPA0+PLTQV9vJfYB\nC6cYvLMytbnM+E0icW5qNNPl1LAp8ac9C60bgI91PoNSYCyC9heYRVEdL+0J\n1HqgTErRn65W28Fjil+w00TN4Ggfu1e2AJOaWMKuLlV7zMxR6GZ+k9kmvS6n\nnkiaoiqGlXNTGc0vLqz9fhVtj0ph+ZTSO7BjJjPH8vX4v2s7sGePFFBiV05Z\nII1tHGX1xyAV01sGTvGGGSgeBojvoG1yBqKd4HP9brvL5hBg6/L8EjpPNnwh\nFewQNfi3NvuYqQ669uiI+SajUNxpyVUWXuR6gNq7PZLjz9pLbQD19tuBQYOf\nhnKDkQe7dZCaKPaY863Xf8/zj8ascqLBdV7cVshfuG32BJ63s6K40ugM+YuJ\nJUWK9AYWXlAoDjDhXzg8gBMbH5dumpLvJYtM/oYigvQzM2nwjA5uZwAzFlTf\ne/5hJeitRn6XQnAJJihE+Sb4AkFkrRo2rWvyqjhA7UECfMGNDTLpGXYhgUKp\nRG2p/AQvfBydSlNnanRZCASzvIRIvu45t3T0mSm9/FzXwr/A37My10uem6xQ\nmJK6\r\n=hAyE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD7qH5FCezR2VuXRuW1U340bfN3Iurw7H8D03KIMTmfRgIhAIhr/yRVFMvpp4hFam7uBN3+6FjXytTSqoejBLtB+A5v"}]},"maintainers":[{"name":"attopartners","email":"stuart@attopartners.com"}],"_npmUser":{"name":"attopartners","email":"stuart@attopartners.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/formal_0.1.5_1558099887973_0.5972067361223186"},"_hasShrinkwrap":false},"0.1.7":{"version":"0.1.7","name":"@attopartners/formal","author":{"name":"Kevin Wolf","email":"hi@kevinwolf.me"},"description":"Elegant form management primitives for the react hooks era","license":"MIT","homepage":"https://github.com/kevinwolfcr/formal#readme","repository":{"type":"git","url":"git+https://github.com/kevinwolfcr/formal.git"},"bugs":{"url":"https://github.com/kevinwolfcr/formal/issues"},"main":"lib/formal.js","types":"lib/formal.d.ts","directories":{"lib":"lib","test":"__tests__"},"publishConfig":{"access":"public"},"scripts":{"prebuild":"rm -rf ./lib","build":"tsc","test":"echo \"Error: run tests from root\" && exit 1"},"dependencies":{"react-fast-compare":"^2.0.4"},"peerDependencies":{"react":">=16.8","yup":"*"},"devDependencies":{"@types/yup":"^0.26.12","react":"^16.8.6","react-dom":"^16.8.6","react-hooks-testing-library":"^0.4.0","yup":"^0.27.0"},"gitHead":"3bc553c5be61aeb3f147a9752e6774664974eca7","_id":"@attopartners/formal@0.1.7","_nodeVersion":"11.13.0","_npmVersion":"lerna/3.14.1/node@v11.13.0+x64 (darwin)","dist":{"integrity":"sha512-PtpIDV8Q1k6BHihEw3iqmiA6CjTTXjjB21Od4WPsXv6wGvIyFfHRehh6Fyopdfp6Dnu++6PzMKG8kqhTGTPaIg==","shasum":"2d7e22c2c4ea4660970c8b378055fed0ef87feb1","tarball":"https://registry.npmjs.org/@attopartners/formal/-/formal-0.1.7.tgz","fileCount":12,"unpackedSize":20254,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc3rjpCRA9TVsSAnZWagAAz+YP/idPS2m5inu7QXb32QUA\nhjgqWzgj0h3/kARvSwAd9nOt9vtiZispR/mZIXFPVuMa7IMqRHRJ1gZT1/DM\neDrTQHLleM6RRJEKoVhrhwC6sbzAMlXtyUasB1qUCzYR34pQZf1IuUuhAoXF\n5Pg8RGepChq8mci8Egt8p9xpA4VweDZIDvJLCXZj8vDyrn5dmt7co1SZDO/7\nTCzNBLETxz5qdGUCFf9/UAi3cUGVNS9b5Xz4Q+EIPSMI5vcDuyxhBUsDKAVn\nXayaQwp9D5oZVgO3Gv/SXinyzCrsHN4IgGfJ3xhignXHnLRm776X/rCjtZOu\nC6mHcjUuaiKlm600ybWt/7KcwMVptdS9hAFp23Kofg6hi5UOLXGK1AQfSF0k\ncQ1ipVl/qHFOUinFyMsOvlY0NeyfKWdkeGa07trMhAeCqD2DEJwP9dNamn3A\nupVlSwDtI5b3/pkPl1o8QnLKea5rCdVdQjwj1j8izU6bDVyzqx5ZP9fOZLVL\nv6gylcoOCpQVez+Q8txISKLHAgEQzgAFoqnCixNHo+j9W88kkPKoHbtpI9XX\nXBE/qsip2Gag2nM6h/r9CQPnl7ikzV37JaD2x7wIr7CjYsmD7p1G9VmfOKLw\nLAehIHr2xRthIFMStEwebJHFz+ANVL99HRVdim2mNMM4QHvXZccPSRz48bOY\nRakW\r\n=tP4L\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDoNivotopiL4n/NHC1EZ1QZdeBYul5u5xvnjijwQzr+AiAtMwLFnulz1kn0nw3QQrybYohXbbb6rwlQuBv1ZxLLOw=="}]},"maintainers":[{"name":"attopartners","email":"stuart@attopartners.com"}],"_npmUser":{"name":"attopartners","email":"stuart@attopartners.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/formal_0.1.7_1558100201183_0.4781936757050089"},"_hasShrinkwrap":false}},"time":{"created":"2019-05-17T13:29:58.158Z","0.1.4":"2019-05-17T13:29:58.304Z","modified":"2022-04-04T16:20:47.672Z","0.1.5":"2019-05-17T13:31:28.199Z","0.1.7":"2019-05-17T13:36:41.302Z"},"maintainers":[{"name":"attopartners","email":"stuart@attopartners.com"}],"description":"Elegant form management primitives for the react hooks era","homepage":"https://github.com/kevinwolfcr/formal#readme","repository":{"type":"git","url":"git+https://github.com/kevinwolfcr/formal.git"},"author":{"name":"Kevin Wolf","email":"hi@kevinwolf.me"},"bugs":{"url":"https://github.com/kevinwolfcr/formal/issues"},"license":"MIT","readme":"<a href=\"https://npmjs.com/package/@kevinwolf/formal\"><img src=\"https://img.shields.io/npm/v/@kevinwolf/formal.svg?label=npm&style=flat-square\" alt=\"@kevinwolf/formal\"></a>\n<a href=\"https://npmjs.com/package/@kevinwolf/formal\"><img src=\"https://img.shields.io/npm/dm/@kevinwolf/formal.svg?label=downloads&style=flat-square\" alt=\"@kevinwolf/formal\"></a>\n\n# @kevinwolf/formal\n\n👔 Elegant form management primitives for the react hooks era.\n\n## Table of Contents\n\n<!-- START doctoc generated TOC please keep comment here to allow auto update -->\n<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->\n\n- [Install](#install)\n- [Usage with React](#usage-with-react)\n- [Usage with React Native](#usage-with-react-native)\n- [Reducing boilerplate](#reducing-boilerplate)\n- [Extended documentation](#extended-documentation)\n\n<!-- END doctoc generated TOC please keep comment here to allow auto update -->\n\n## Install\n\n```shell\nyarn add @kevinwolf/formal\n```\n\n## Usage with React\n\n> Note: this boilerplate can be [reduced](#reducing-boilerplate).\n\n```typescript\nimport React from \"react\";\nimport * as yup from \"yup\";\nimport useFormal from \"@kevinwolf/formal\";\n\nconst schema = yup.object().shape({\n  firstName: yup.string().required(),\n  lastName: yup.string().required(),\n  email: yup\n    .string()\n    .email()\n    .required()\n});\n\nconst initialValues = {\n  firstName: \"Tony\",\n  lastName: \"Stark\",\n  email: \"ironman@avengers.io\"\n};\n\nexport default function App() {\n  const formal = useFormal(initialValues, {\n    schema,\n    onSubmit: values => console.log(\"Your values are:\", values)\n  });\n\n  const handleSubmit = e => {\n    e.preventDefault();\n    formal.submit();\n  };\n\n  return (\n    <form onSubmit={handleSubmit}>\n      <div>\n        <label htmlFor=\"firstName\">First Name</label>\n        <input\n          type=\"text\"\n          id=\"firstName\"\n          name=\"firstName\"\n          value={formal.values.firstName}\n          onChange={e => formal.change(\"firstName\", e.target.value)}\n        />\n        {formal.errors.firstName && <div>{formal.errors.firstName}</div>}\n      </div>\n\n      <div>\n        <label htmlFor=\"lastName\">Last Name</label>\n        <input\n          type=\"text\"\n          id=\"lastName\"\n          name=\"lastName\"\n          value={formal.values.lastName}\n          onChange={e => formal.change(\"lastName\", e.target.value)}\n        />\n        {formal.errors.lastName && <div>{formal.errors.lastName}</div>}\n      </div>\n\n      <div>\n        <label htmlFor=\"email\">Email</label>\n        <input\n          type=\"text\"\n          id=\"email\"\n          name=\"email\"\n          value={formal.values.email}\n          onChange={e => formal.change(\"email\", e.target.value)}\n        />\n        {formal.errors.email && <div>{formal.errors.email}</div>}\n      </div>\n\n      <button type=\"submit\">Submit</button>\n    </form>\n  );\n}\n```\n\n## Usage with React Native\n\n```typescript\nimport React from \"react\";\nimport { View, Text, TextInput, Button } from \"react-native\";\nimport * as yup from \"yup\";\nimport useFormal from \"@kevinwolf/formal\";\n\nconst schema = yup.object().shape({\n  firstName: yup.string().required(),\n  lastName: yup.string().required(),\n  email: yup\n    .string()\n    .email()\n    .required()\n});\n\nconst initialValues = {\n  firstName: \"Tony\",\n  lastName: \"Stark\",\n  email: \"ironman@avengers.io\"\n};\n\nexport default function App() {\n  const formal = useFormal(initialValues, {\n    schema,\n    onSubmit: values => console.log(\"Your values are:\", values)\n  });\n\n  return (\n    <View>\n      <View>\n        <Text>First Name</Text>\n        <TextInput\n          value={formal.values.firstName}\n          onChangeText={text => formal.change(\"firstName\", text)}\n        />\n        {formal.errors.firstName && <Text>{formal.errors.firstName}</Text>}\n      </View>\n\n      <View>\n        <Text>Last Name</Text>\n        <TextInput\n          value={formal.values.lastName}\n          onChangeText={text => formal.change(\"lastName\", text)}\n        />\n        {formal.errors.lastName && <Text>{formal.errors.lastName}</Text>}\n      </View>\n\n      <View>\n        <Text>Email</Text>\n        <TextInput\n          value={formal.values.email}\n          onChangeText={text => formal.change(\"email\", text)}\n        />\n        {formal.errors.email && <Text>{formal.errors.email}</Text>}\n      </View>\n\n      <Button onPress={formal.submit} title=\"Submit\" />\n    </View>\n  );\n}\n```\n\n## Reducing boilerplate\n\nIn order to reduce boilerplate, you can install one of two packages depending on whether you are on web or mobile. That way, you will receive some prop getters that you just have to spread to your inputs and buttons. ✨\n\n- [@kevinwolf/formal-web](http://npmjs.com/package/@kevinwolf/formal-web)\n- [@kevinwolf/formal-native](http://npmjs.com/package/@kevinwolf/formal-native)\n\n## Extended documentation\n\nFor extended documentation, examples and contributing guidelines, please refer to [the monorepo containing this package](https://github.com/kevinwolfcr/formal).\n","readmeFilename":"README.md"}