{"_id":"@bbbtech/storybook-formik","_rev":"3-250c657f8a54d99d4f220d515d3bee44","name":"@bbbtech/storybook-formik","dist-tags":{"latest":"4.0.0"},"versions":{"2.5.0":{"name":"@bbbtech/storybook-formik","version":"2.5.0","keywords":["storybook","react","formik","form","forms","storybook-addon","code","popular"],"author":{"name":"bhishp"},"license":"MIT","_id":"@bbbtech/storybook-formik@2.5.0","maintainers":[{"name":"bhishp","email":"bhishma_p@hotmail.com"}],"homepage":"https://bbbtech.github.io/storybook-formik/","bugs":{"url":"https://github.com/bbbtech/storybook-formik/issues"},"dist":{"shasum":"bb06d002ab7a0a460620b0793429dddc69d309f4","tarball":"https://registry.npmjs.org/@bbbtech/storybook-formik/-/storybook-formik-2.5.0.tgz","fileCount":23,"integrity":"sha512-1Vu07fZrHFAwfprCIzqkhZTrR7bbMeLe+jUH4WquHMuQmd+UZux3p7LSviwark13Zl+zSuQBPDh1t0pRe1Ik1g==","signatures":[{"sig":"MEQCIBoL6sN6UiIrgeUDVg5A8L6gbTJCzDYsdWaOKflRdG5PAiBT9O1DilEEVMR4bRtsQJYhFYIkQEXlRrlN+egCQTa5cw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":51441,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJisGxbACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmozNw//doV19gvPNoK4hBx8zF+l535X5rh5gfxBn7l8wgmFuYZe2Nm+\r\nSXnwh6L2oNQrBSj+C0jYYmdkpucR/Li+sRBni5C9tZD6TD5Znj06rd2LF7ia\r\n5mYHeTNuvzntTq1++8HpOfdN3F0xQPoi4FaUb++Gitm3ObMSzAcWuwGQbLWt\r\n9RsU991aK7MO1al7M/9ljmW1QmW6bmUZy7L81iMl9N2dKKfTKd+skro/zR8p\r\n/zZ7SnGj8Q4P6VteOuk/Yu8H4O2fBW38VPoaZWrXdGQ6VQkOzdK1QFFVYXJz\r\nssJ9yuyivWGhSTUk27T+xbcF4GYNLgJDQMgpts/6xXQi0aAvAskW/nuYktec\r\neermgQPNBUtuhACiu/BOPZukBqUWF9e5MTvURn86B1XHPUx7CdBFtRf25d1S\r\nOP9H/i7QZZQ4+qBE8e+t4+m6gTiVR+/vEo5vfx7vRrNoN2cZQ6qYXdCiNL5a\r\nUTflGZYyr+/jZGEJEZTV7WOI2R8+Svg67K6J9xe75zO039SDqmkRj5WdHeY4\r\ncBxamhSyYdDD86Xvxqnkoe90SJ5sXQZCb0VG3elHLf3ZpaDwHK7Po+j7Hnbr\r\n8F/zSiznkTen7Dm7MKPWn/1NfWmew+ghC6yPHEcZ9MUmXzulaNnta5Drs+xb\r\nu0XEBekdlr5UycHDJKyWd1FYblvfHYdchsg=\r\n=q1PT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/cjs/index.js","module":"dist/esm/index.js","gitHead":"9a9e103725838708624e73358377ca143d67cb1e","scripts":{"test":"jest","build":"npm run build:esm && npm run build:cjs","clean":"rm -rf dist","deploy":"npm run build-storybook && gh-pages -d build-sb","format":"prettier --trailing-comma es5 --single-quote --write 'src/**/*' 'test/**/*' 'README.md' '/docs/**/*.md'","prepack":"npm run build","build:cjs":"tsc --project tsconfig.cjs.json","build:esm":"tsc --project tsconfig.esm.json","storybook":"start-storybook -p 6006","preversion":"npm run clean && npm run build && npm run deploy","build:watch":"concurrently \"npm run build:esm -- --watch\" \"npm run build:cjs -- --watch\"","postversion":"git push && git push --tags && npm publish","build-storybook":"rm -rf build-sb && build-storybook -o build-sb"},"typings":"dist/types/index.d.ts","_npmUser":{"name":"bhishp","email":"bhishma_p@hotmail.com"},"storybook":{"icon":"https://pbs.twimg.com/profile_images/1148688127252471810/-UcA36Bw_400x400.png","displayName":"Formik"},"repository":{"url":"git+https://github.com/bbbtech/storybook-formik.git","type":"git"},"_npmVersion":"8.12.2","description":"A storybook addon that allows you to use components in your stories that rely on Formik context and see internal Formik state in a panel.","directories":{},"_nodeVersion":"16.13.2","dependencies":{"react-json-tree":"^0.15.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"yup":"^0.32.11","jest":"^27.5.1","react":"^16.12.0","formik":"^2.0.6","gh-pages":"^2.1.1","prettier":"^1.19.1","react-dom":"^16.12.0","@types/yup":"^0.26.26","typescript":"^4.2.3","@babel/core":"^7.7.4","@types/jest":"^27.4.1","@types/node":"^12.12.14","@types/react":"^16.9.13","babel-loader":"^8.0.6","concurrently":"^7.1.0","@storybook/api":"^6.4.21","@storybook/react":"^6.4.21","@types/react-dom":"^16.9.4","@babel/preset-env":"^7.16.11","@storybook/addons":"^6.4.21","@babel/preset-react":"^7.16.7","@storybook/components":"^6.4.21","@storybook/addon-links":"^6.4.21","@testing-library/react":"^12.1.4","@babel/preset-typescript":"^7.16.7","@storybook/testing-react":"^1.2.4","@testing-library/jest-dom":"^5.16.4","awesome-typescript-loader":"^5.2.1","@storybook/addon-essentials":"^6.4.21","@types/react-syntax-highlighter":"^13.5.0"},"peerDependencies":{"react":"*","formik":"^1.0.0||^2.0.0","react-dom":"*"},"_npmOperationalInternal":{"tmp":"tmp/storybook-formik_2.5.0_1655729243709_0.8531705629045383","host":"s3://npm-registry-packages"}},"2.6.0":{"name":"@bbbtech/storybook-formik","version":"2.6.0","keywords":["storybook","react","formik","form","forms","storybook-addon","code","popular"],"author":{"name":"bhishp"},"license":"MIT","_id":"@bbbtech/storybook-formik@2.6.0","maintainers":[{"name":"bhishp","email":"bhishma_p@hotmail.com"}],"homepage":"https://bbbtech.github.io/storybook-formik/","bugs":{"url":"https://github.com/bbbtech/storybook-formik/issues"},"dist":{"shasum":"78bf34f84d948b5d4eeef84e9c0fc7dfe7d9838e","tarball":"https://registry.npmjs.org/@bbbtech/storybook-formik/-/storybook-formik-2.6.0.tgz","fileCount":23,"integrity":"sha512-4ZhfxrCkPe+CJqhCPUeCDCNksqfRGujz+UAXiu3dYV/+BNU9NRGITu//jwJvSmHb2ezXTaNZh2NMsTBMGphEAg==","signatures":[{"sig":"MEYCIQCysoNdE2p4aqKjD9zdwBuQUcQ72+48vKujMhmTlFulVAIhAORZlL1Y05QosMfYHC+Rm/i31bydMIlWfWqZhW65RcKh","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":50894,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkLtCPACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr/kBAAg5DtQ8DZWBhv/atYqKRp6wO7j6szUsPZqY2MmJpoylMAUg3y\r\nPGo7Bm0RxmSHUMEfsZ+3lx/QB6Z6UPVHqPkrMSbC34rBbh3HS4u17egW/g/Z\r\nEqNaguoxvFqIaZT7j5sAbBF3We9LygVshT0YKEgKg+MLJBkBh3X+6p5am5P2\r\nvi1BNsgLWRIV6JFJUb2PVtys9Rrfvl+wsT+Edh7biTgq+JthIxxZp73gNJrt\r\nlz376fmnFzs+qg9o+H51YP6pus5emXbip2yrwCe5UA9JXwWKNmg3vm/Qe2rL\r\nCtciIFMLOkdRbMdf0kAPqZQgMY1ii4Mz0c5/8xQJqFnQ/Egmvsz4Ym058qG2\r\naQSQwgO4b/z996zR+qVuKCTvhs7gSi1mneYx4kz37QfeexyMbTt6ff7Ndfwv\r\n2b7GRq9eMDk3xguYm3eNOUXk2g8w8w7rCPeMK+eVMPA3GrRNzX4ADmFOxTlA\r\nCZ+uyBJW8eE++tnutvm/iHGaH46ahENkBXg4bEXWqLEuFSPFlKXmR9bAV4nX\r\nbgd/rRXlD4UQXdcuU1XgfYFIUb0yZotrmkJNlsuXMgGPbWK/LJ0HdmN4WCFa\r\n9J6/nd64JsYGumx2G0ikDIPnHb0EPetq8G0CoDPkr4lS5/IgqxOKPQvtqVP5\r\n0lEaG0cMNKxSk82Id+1ENf0SnysaerTWngc=\r\n=lMPz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/cjs/index.js","module":"dist/esm/index.js","gitHead":"e9623d3112ea6f136da4378e5b4d61991b531963","scripts":{"test":"jest","build":"npm run build:esm && npm run build:cjs","clean":"rm -rf dist","deploy":"npm run build-storybook && gh-pages -d build-sb","format":"prettier --write  --trailing-comma es5 --single-quote 'src/**/*' 'test/**/*' 'README.md' '/docs/**/*.md'","prepack":"npm run build","build:cjs":"tsc --project tsconfig.cjs.json","build:esm":"tsc --project tsconfig.esm.json","storybook":"storybook dev -p 6006","preversion":"npm run clean && npm run build && npm run deploy","build:watch":"concurrently \"npm run build:esm -- --watch\" \"npm run build:cjs -- --watch\"","postversion":"git push && git push --tags && npm publish","format:check":"prettier --check --trailing-comma es5 --single-quote 'src/**/*' 'test/**/*' 'README.md' '/docs/**/*.md'","build-storybook":"rm -rf build-sb && storybook build -o build-sb"},"typings":"dist/types/index.d.ts","_npmUser":{"name":"bhishp","email":"bhishma_p@hotmail.com"},"storybook":{"icon":"https://pbs.twimg.com/profile_images/1148688127252471810/-UcA36Bw_400x400.png","displayName":"Formik"},"repository":{"url":"git+https://github.com/bbbtech/storybook-formik.git","type":"git"},"_npmVersion":"8.12.2","description":"A storybook addon that allows you to use components in your stories that rely on Formik context and see internal Formik state in a panel.","directories":{},"_nodeVersion":"16.13.2","dependencies":{"react-json-tree":"^0.15.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"yup":"^0.32.11","jest":"^27.5.1","react":"^16.12.0","formik":"^2.0.6","gh-pages":"^2.1.1","prettier":"^1.19.1","react-dom":"^16.12.0","storybook":"^7.0.2","@types/yup":"^0.26.26","typescript":"^4.2.3","@babel/core":"^7.7.4","@types/jest":"^27.4.1","@types/node":"^12.12.14","@types/react":"^16.9.13","babel-loader":"^8.0.6","concurrently":"^7.1.0","@storybook/api":"^7.0.2","@storybook/react":"^7.0.2","@types/react-dom":"^16.9.4","@babel/preset-env":"^7.16.11","@storybook/addons":"^7.0.2","@babel/preset-react":"^7.16.7","@storybook/components":"^7.0.2","@storybook/addon-links":"^7.0.2","@testing-library/react":"^12.1.4","react-textarea-autosize":"^8.4.1","@babel/preset-typescript":"^7.16.7","@storybook/testing-react":"^2.0.0","@storybook/react-webpack5":"^7.0.2","@testing-library/jest-dom":"^5.16.4","awesome-typescript-loader":"^5.2.1","@storybook/addon-essentials":"^7.0.2","@types/react-syntax-highlighter":"^13.5.0"},"peerDependencies":{"react":"*","formik":"^1.0.0||^2.0.0","react-dom":"*"},"_npmOperationalInternal":{"tmp":"tmp/storybook-formik_2.6.0_1680789647002_0.7417750726809516","host":"s3://npm-registry-packages"}},"3.0.0":{"name":"@bbbtech/storybook-formik","version":"3.0.0","keywords":["storybook","react","formik","form","forms","storybook-addon","code","popular"],"author":{"name":"bhishp"},"license":"MIT","_id":"@bbbtech/storybook-formik@3.0.0","maintainers":[{"name":"bhishp","email":"bhishma_p@hotmail.com"}],"homepage":"https://bbbtech.github.io/storybook-formik/","bugs":{"url":"https://github.com/bbbtech/storybook-formik/issues"},"dist":{"shasum":"6b4b0c4064777ba7589b5d86feec458bafb0d0fc","tarball":"https://registry.npmjs.org/@bbbtech/storybook-formik/-/storybook-formik-3.0.0.tgz","fileCount":23,"integrity":"sha512-DEZRMJTK0HT4O/K82cCDCAM/cyO9hvhiH9j9X2fDXuaLaB+DW28Axt0Xd0j+94bwvFF7CjzyS/wFulRpOn3KwA==","signatures":[{"sig":"MEUCIQC0heuGzUsV5mE1mXSNJTZ4Y2vpQ2mj8njmFYBcYJLW/QIgRvBjrA3ZldWUezXZTMSf8+D/GaF/ASNyLpa56COyevw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":50750},"main":"dist/cjs/index.js","module":"dist/esm/index.js","gitHead":"69ff70f193ba879a28108250e90cf22cf79c7b2d","scripts":{"test":"jest","build":"npm run build:esm && npm run build:cjs","clean":"rm -rf dist","deploy":"npm run build-storybook && gh-pages -d build-sb","format":"prettier --write  --trailing-comma es5 --single-quote 'src/**/*' 'test/**/*' 'README.md' '/docs/**/*.md'","prepack":"npm run build","build:cjs":"tsc --project tsconfig.cjs.json","build:esm":"tsc --project tsconfig.esm.json","storybook":"storybook dev -p 6006","preversion":"npm run clean && npm run build && npm run deploy","build:watch":"concurrently \"npm run build:esm -- --watch\" \"npm run build:cjs -- --watch\"","postversion":"git push && git push --tags && npm publish","format:check":"prettier --check --trailing-comma es5 --single-quote 'src/**/*' 'test/**/*' 'README.md' '/docs/**/*.md'","build-storybook":"rm -rf build-sb && storybook build -o build-sb"},"typings":"dist/types/index.d.ts","_npmUser":{"name":"bhishp","email":"bhishma_p@hotmail.com"},"storybook":{"icon":"https://pbs.twimg.com/profile_images/1148688127252471810/-UcA36Bw_400x400.png","displayName":"Formik"},"repository":{"url":"git+https://github.com/bbbtech/storybook-formik.git","type":"git"},"_npmVersion":"10.0.0","description":"A storybook addon that allows you to use components in your stories that rely on Formik context and see internal Formik state in a panel.","directories":{},"_nodeVersion":"20.6.0","dependencies":{"react-json-tree":"^0.18.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"yup":"^0.32.11","jest":"^27.5.1","react":"^18.2.0","formik":"^2.0.6","gh-pages":"^2.1.1","prettier":"^1.19.1","react-dom":"^18.2.0","storybook":"^7.0.2","@types/yup":"^0.26.26","typescript":"^4.2.3","@babel/core":"^7.7.4","@types/jest":"^27.4.1","@types/node":"^12.12.14","@types/react":"^16.9.13","babel-loader":"^8.0.6","concurrently":"^7.1.0","@storybook/api":"^7.0.2","@storybook/react":"^7.0.2","@types/react-dom":"^16.9.4","@babel/preset-env":"^7.16.11","@storybook/addons":"^7.0.2","@babel/preset-react":"^7.16.7","@storybook/components":"^7.0.2","@storybook/addon-links":"^7.0.2","@testing-library/react":"^14.0.0","react-textarea-autosize":"^8.4.1","@babel/preset-typescript":"^7.16.7","@storybook/testing-react":"^2.0.0","@storybook/react-webpack5":"^7.0.2","@testing-library/jest-dom":"^5.16.4","awesome-typescript-loader":"^5.2.1","@storybook/addon-essentials":"^7.0.2","@types/react-syntax-highlighter":"^13.5.0"},"peerDependencies":{"react":"*","formik":"^1.0.0||^2.0.0","react-dom":"*"},"_npmOperationalInternal":{"tmp":"tmp/storybook-formik_3.0.0_1694166072255_0.1359591588656024","host":"s3://npm-registry-packages"}},"4.0.0":{"name":"@bbbtech/storybook-formik","version":"4.0.0","description":"A storybook addon that allows you to use components in your stories that rely on Formik context and see internal Formik state in a panel.","repository":{"type":"git","url":"git+https://github.com/bbbtech/storybook-formik.git"},"homepage":"https://bbbtech.github.io/storybook-formik/","main":"dist/cjs/index.js","module":"dist/esm/index.js","typings":"dist/types/index.d.ts","scripts":{"storybook":"storybook dev -p 6006","build-storybook":"rm -rf build-sb && storybook build -o storybook-static","clean":"rm -rf dist","build":"npm run build:esm && npm run build:cjs","build:watch":"concurrently \"npm run build:esm -- --watch\" \"npm run build:cjs -- --watch\"","build:esm":"tsc --project tsconfig.esm.json","build:cjs":"tsc --project tsconfig.cjs.json","prepack":"npm run build","deploy":"npm run build-storybook && gh-pages -d storybook-static","preversion":"npm run clean && npm run build","postversion":"git push && git push --tags && npm publish","format":"prettier --write  --trailing-comma es5 --single-quote 'src/**/*' 'README.MD'","format:check":"prettier --check --trailing-comma es5 --single-quote 'src/**/*' 'README.MD'","test":"jest"},"publishConfig":{"access":"public"},"peerDependencies":{"formik":"^1.0.0||^2.0.0","react":"*","react-dom":"*"},"devDependencies":{"@babel/core":"^7.26.0","@babel/preset-env":"^7.26.0","@babel/preset-react":"^7.25.9","@babel/preset-typescript":"^7.26.0","@storybook/addon-essentials":"^8.4.3","@storybook/addon-links":"^8.4.3","@storybook/builder-vite":"^8.4.3","@storybook/components":"^8.4.3","@storybook/react":"^8.4.3","@storybook/react-vite":"^8.4.4","@testing-library/jest-dom":"^6.6.3","@testing-library/react":"^16.0.1","@types/jest":"^29.5.14","@types/node":"^22.9.0","@types/react":"^18.3.12","@types/react-dom":"^18.3.1","@types/react-syntax-highlighter":"^15.5.13","@types/testing-library__jest-dom":"^5.14.9","concurrently":"^9.1.0","formik":"^2.4.6","gh-pages":"^6.2.0","jest":"^29.7.0","prettier":"^3.3.3","react":"^18.3.1","react-dom":"^18.3.1","react-textarea-autosize":"^8.5.5","storybook":"^8.4.3","typescript":"^5.6.3","yup":"^1.4.0"},"keywords":["storybook","react","formik","form","forms","storybook-addon","code","popular"],"author":{"name":"bhishp"},"license":"MIT","dependencies":{"@storybook/core-events":"^8.4.3","@storybook/manager-api":"^8.4.3","@vitejs/plugin-react":"^4.3.3","jest-environment-jsdom":"^29.7.0","react-json-tree":"^0.19.0","ts-loader":"^9.5.1","vite":"^5.4.11"},"storybook":{"icon":"https://pbs.twimg.com/profile_images/1148688127252471810/-UcA36Bw_400x400.png","displayName":"Formik"},"_id":"@bbbtech/storybook-formik@4.0.0","gitHead":"67ab0e236adea62375ef548c74944530964cd3e0","bugs":{"url":"https://github.com/bbbtech/storybook-formik/issues"},"_nodeVersion":"20.6.0","_npmVersion":"10.0.0","dist":{"integrity":"sha512-M08RUeviZPyLRapxDnzzNkgfwAp9qsMjlXJSlC5OCgsPdqxdeh5sEkkHscCM2jbTi2icEHiL1V+EGIES1GKGtA==","shasum":"2c748f790cd5405945fe49f29ad99e5969b111e2","tarball":"https://registry.npmjs.org/@bbbtech/storybook-formik/-/storybook-formik-4.0.0.tgz","fileCount":23,"unpackedSize":47109,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCfnKyJy1cG3PGaqZB73mw1pADUwg6JsID6Tk8pwjqPAQIgaGErLmCzGNBPqhFHSRjUxOt1IPS19DfIdosLSuMt0sY="}]},"_npmUser":{"name":"bhishp","email":"bhishma_p@hotmail.com"},"directories":{},"maintainers":[{"name":"bhishp","email":"bhishma_p@hotmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/storybook-formik_4.0.0_1737808619501_0.4130348043772065"},"_hasShrinkwrap":false}},"time":{"created":"2022-06-20T12:47:23.637Z","modified":"2025-01-25T12:36:59.908Z","2.5.0":"2022-06-20T12:47:23.922Z","2.6.0":"2023-04-06T14:00:47.197Z","3.0.0":"2023-09-08T09:41:12.434Z","4.0.0":"2025-01-25T12:36:59.710Z"},"bugs":{"url":"https://github.com/bbbtech/storybook-formik/issues"},"author":{"name":"bhishp"},"license":"MIT","homepage":"https://bbbtech.github.io/storybook-formik/","keywords":["storybook","react","formik","form","forms","storybook-addon","code","popular"],"repository":{"type":"git","url":"git+https://github.com/bbbtech/storybook-formik.git"},"description":"A storybook addon that allows you to use components in your stories that rely on Formik context and see internal Formik state in a panel.","maintainers":[{"name":"bhishp","email":"bhishma_p@hotmail.com"}],"readme":"# storybook-formik\n\nA [Storybook](https://storybook.js.org/) Addon and Decorator to wrap Formik Fields and track their state in a Panel.\n\n![example screenshot](https://user-images.githubusercontent.com/12024258/70381969-9c13b400-194b-11ea-8444-582933bf30f5.png)\n\nYou can see the example stories in action [here](https://bbbtech.github.io/storybook-formik/).\n\nThanks to [@jaredpalmer](https://jaredpalmer.com/) for giving us the amazing [formik](https://github.com/jaredpalmer/formik) library and making forms great again.\n\n## Migration to BBB Tech\n\nNote, this package has been migrated to the org: [BBB Tech](https://github.com/bbbtech). The only real difference this\nmeans is that the package needs to be installed with a new command, scoped by the org's slug (i.e. `npm i --save-dev @bbbtech/storybook-formik`)\nand to update the path when registering the package in your main.js.\n\nIt also means that all future versions will be released under the new package, so please migrate your dependency if you\nwant to get future versions.\n\n## Install\n\n```sh\nnpm install --save-dev @bbbtech/storybook-formik\n```\n\nThen register the addon in `.storybook/main.js`\n\n```ts\nmodule.exports = {\n  stories: ['../stories/**/*.stories.tsx'],\n  addons: ['@bbbtech/storybook-formik/register'],\n};\n```\n\n## Usage\n\nSuppose you split your forms into smaller, re-usable components and these 'subforms' rely on formik context, each of these\nsub-forms may be used to build up a larger form, but you still want to test and run them independently. You can use the withFormik\ndecorator so that we can wrap the subform in a Formik component, which will pass down the context as normal.\n\nGiven a simple subform:\n\n```tsx\nimport React from 'react';\nimport { Field } from 'formik';\n\nconst PersonalInfoSubform = () => (\n  <div>\n    <Field name=\"forename\" type=\"input\" />\n    <Field name=\"surname\" type=\"input\" />\n  </div>\n);\n\nexport default PersonalInfoSubform;\n```\n\nYou add the `withFormik` decorator to your stories and can pass any `Formik` props as a parameter to the individual story.\n\n```tsx\nexport const personalInfoSubform = () => (\n  <>\n    <p>\n      The decorator can wrap Components that include Fields (or anything else\n      expecting Formik context). This allows us to better componentise our\n      larger forms.\n    </p>\n    <PersonalInfoSubForm />\n  </>\n);\npersonalInfoSubform.decorators = [withFormik];\n// can use the DecoratorParams type and pass a type for type-safety of initialValues\nconst personalInfoParams: DecoratorParams<PersonalInfo> = {\n  formik: {\n    initialValues: personalInfoInitialValues,\n    validationSchema: personalInfoValidationSchema,\n  },\n};\npersonalInfoSubform.parameters = personalInfoParams;\n```\n\nThis gives you the benefit of rendering formik Fields that are expecting formik context, but also to track the key formik state\nwithin the storybook panel below.\n\nSee the [example stories](https://github.com/bbbtech/storybook-formik/blob/main/stories/) for further examples\n\n### Legacy story format\n\nExample with the `storiesOf` syntax.\n\n```tsx\nimport { storiesOf } from '@storybook/react';\nimport withFormik from '@bbbtech/storybook-formik';\n\nimport PersonalInfoSubform from '<your_component_path>/PersonalInfoSubform';\n\nstoriesOf('Example', module)\n  .addDecorator(withFormik)\n  .add('default', () => <PersonalInfoSubform />, {\n    formik: {\n      initialValues: {\n        forename: 'John',\n        surname: 'Johnerson',\n      },\n    },\n  });\n```\n\n## Arguments\n\nYou can pass any `Formik` component props (initialValues, validationSchema, validateOnBlur, etc) as arguments to a story.\nThese props must be passed under the `formik` parameter key.\n\nIf no initial values are supplied, `{ enableReinitialize: true, initialValues: StoryContext.args || {} }` will be used.\n\n```tsx\nexport const myTextInput = () => (\n  <MyTextInput\n    name=\"formikTweet\"\n    label=\"Describe formik in 80 characters\"\n    placeholder=\"I love formik because...\"\n  />\n);\nmyTextInput.parameters = {\n  formik: {\n    initialValues: {\n      formikTweet: '',\n    },\n    validationSchema: someSchema,\n    onSubmit: v => console.log('I want to log these... ', v),\n  },\n};\n```\n\n### `formik.castValues` with `formik.validationSchema`\n\nIf a `validationSchema` is provided in the `formik` config and `{ castValues: true }`, then `validationSchema.cast(initialValues || StoryContext.args || {})` will be called and the result passed in as `initialValues`.\n\nThis is useful if the form fields require a certain format to their values or when automatically converting `StoryContext.args` into a valid set of `initialValues`.\n\n## Using with Controls\n\nIf using `@storybook/addon-essentials` and `StoryContext.args`, `withFormik` will syncronize the form values with the storybook controls.\n\n```tsx\nexport const myTextInput = () => (\n  <MyTextInput\n    name=\"formikTweet\"\n    label=\"Describe formik in 80 characters\"\n    placeholder=\"I love formik because...\"\n  />\n);\nmyTextInput.args = {\n  formikTweet: '',\n};\nmyTextInput.parameters = {\n  formik: {\n    validationSchema: someSchema,\n    onSubmit: v => console.log('I want to log these... ', v),\n  },\n};\n```\n\n## Mature Examples\n\nIn time, I will add more mature examples that show the usefulness of the subforms pattern on a larger scale. If anyone\nhas any good examples then please do submit them.\n\n## Contributing\n\n### Development\n\nYou can test changes by building the package locally. The flow would be something like this:\n\n- Make changes to addon\n- `npm run build:watch` - builds the dist bundle locally in watch mode\n- `npm run storybook` - runs the package storybook with the example forms, preview changes here\n- `npm run test` - run unit tests\n\n### Releasing a new version\n\nDeployment is pretty basic/simple right now, all you need to do is: `npm version`, and specify a new version, this will\nkick off relevant lifecycle scripts defined in the package.json (including `npm publish` in the `postversion` script)\n","readmeFilename":"README.MD"}