{"_id":"@areslabs/with-color-theme","_rev":"1-3b5f277b0f9d434db514da71ad4f4ce7","name":"@areslabs/with-color-theme","dist-tags":{"latest":"0.0.1"},"versions":{"1.0.0":{"name":"@areslabs/with-color-theme","version":"1.0.0","description":"```shell npm install @areslabs/with-color-theme ```","main":"index.js","client":"index.web.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"keywords":[],"license":"ISC","dependencies":{"hoist-non-react-statics":"3.3.2"},"peerDependencies":{"react-native":"0.66.3"},"_id":"@areslabs/with-color-theme@1.0.0","_nodeVersion":"14.17.6","_npmVersion":"6.14.15","_npmUser":{"name":"areslabsbot","email":"332442181@qq.com"},"dist":{"integrity":"sha512-V3Flp9lbmmUnk0sAzHI92ORVHkVEdZJE5qcmxC7ZDKAoG+nNzR7CZ60iwV3BD+LJD4ngbbtCE7RabcjV2S2C0g==","shasum":"87dd46a5732f1c9ce03ea2cb87aa1837e2c2ac49","tarball":"https://registry.npmjs.org/@areslabs/with-color-theme/-/with-color-theme-1.0.0.tgz","fileCount":9,"unpackedSize":8688,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDVF5DLBf3MVL9/ATJ6/C8xnV40p6bgRaq1qxoeXfORJAIgIUpAWIY6AGBmIbWsaTnS7E1ddq487VPXDueem1oeYjY="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJixrMYACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqZwQ/+Ii9MDQZBR6dv2zbRpg7MiZloB5f7WMsgTUlj8WAV8YRPwFNg\r\n0kAJ6K5PGO+w8wc0avCat6wDGCoGsM2iMXoIu+zLvnLlFuSDdwFuVGXbGsqu\r\no77+gZkScpeALkpyW+8aQemEeEuHhVwvGeweaJ3vZbOyiywmhSpFpQQZBFlG\r\nfEaDoVEMfbrFgGiXN6392PtdGbSGVUcc92lf0WBEZ8o6awT/ABafJRISFu1M\r\njLXnRxQMs0N1vywOos5fhLpziUDsMz+/zeXwGynh33OsK+bv7vdyjSsw8Xft\r\n2RTiUDAZ/gbSrRaJAkEAWcyFmyagLKmBH6kYusaDWomVjKMnCWXvOcPzKY7N\r\n30aV9ktKLkBL2KW2BZwOx2IF/QTACDONSkdEE7JH2B2lbclH5IzFx0Tjeb/O\r\nNao4M8lWbfY2+pc9IClui9EhZajOfikj2PW++C4DQ199YEYssSioRaaqpQTA\r\ne/5qrrw1+9EqeWUQw9Liyc0OHRM8P98eoTe16+d3GrNr8urDGNj48gsXGvgg\r\ndSH3oy0h+wjo75w+fzjYso+RsX96e0zuJYU0+ZJrfPfUS9GANtRc9JV+CBoQ\r\ntFPncNgTfVd/X5nV/U7Rfr2acSXh4YpmZeXedwMTJQhJyoHRA7kH9wB9EEkd\r\nlTmbVYirYlEMB2HJuaVCAe9tBGih0eWc83w=\r\n=GLFI\r\n-----END PGP SIGNATURE-----\r\n"},"directories":{},"maintainers":[{"name":"jameshen","email":"jameshen@gmail.com"},{"name":"ykforerlang","email":"1527997464@qq.com"},{"name":"yvettelau","email":"542783088@qq.com"},{"name":"areslabsbot","email":"332442181@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/with-color-theme_1.0.0_1657189143761_0.6532350074894693"},"_hasShrinkwrap":false},"0.0.1":{"name":"@areslabs/with-color-theme","version":"0.0.1","description":"```shell npm install @jdreact/with-color-theme ```","main":"index.js","client":"index.web.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"keywords":[],"license":"ISC","dependencies":{"hoist-non-react-statics":"^3.0.0"},"peerDependencies":{"react":"*","react-native":"*"},"gitHead":"36deea8d26b5271805bce6e155dc8adb7cdf528f","_id":"@areslabs/with-color-theme@0.0.1","_nodeVersion":"16.13.0","_npmVersion":"8.19.4","dist":{"integrity":"sha512-Dlwmm+ehy6FWVikkkhJz15hKWYpd+IWwaeiBMtvgFXQHiaOGoMbVStSOXlIMfBSDstGshpbwnxOprSOSidkBrQ==","shasum":"a40c45e19b41a6a8195aecbbf9f4c31e7c85c597","tarball":"https://registry.npmjs.org/@areslabs/with-color-theme/-/with-color-theme-0.0.1.tgz","fileCount":11,"unpackedSize":12960,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBLPdp32ORHxbSiwgyJPmffXtusRUiCChdNJMbIt8QthAiBi9E/uyl8vtww6XG+5vpt+4Uuzy7TdOQK/ju5QbGPdag=="}]},"_npmUser":{"name":"areslabsbot","email":"332442181@qq.com"},"directories":{},"maintainers":[{"name":"jameshen","email":"jameshen@gmail.com"},{"name":"ykforerlang","email":"1527997464@qq.com"},{"name":"yvettelau","email":"542783088@qq.com"},{"name":"areslabsbot","email":"332442181@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/with-color-theme_0.0.1_1697113369503_0.057294846934276444"},"_hasShrinkwrap":false}},"time":{"created":"2022-07-07T10:19:03.718Z","1.0.0":"2022-07-07T10:19:03.973Z","modified":"2023-10-12T12:22:49.937Z","0.0.1":"2023-10-12T12:22:49.649Z"},"maintainers":[{"name":"jameshen","email":"jameshen@gmail.com"},{"name":"ykforerlang","email":"1527997464@qq.com"},{"name":"yvettelau","email":"542783088@qq.com"},{"name":"areslabsbot","email":"332442181@qq.com"}],"description":"```shell npm install @jdreact/with-color-theme ```","keywords":[],"license":"ISC","readme":"### 安装依赖\n\n```shell\nnpm install @jdreact/with-color-theme\n```\n\n### 说明\n\n`@jdreact/with-color-theme` 提供了\n\n- ThemeContext\n\n- ThemeProvider\n\n在入口页中引入 `ThemeProvider`.\n\n如:\n\n```js\nimport { ThemeProvider } from '@jdreact/with-color-theme';\nclass JDReactAPIDemos extends Component {\n    render() {\n        return (\n            <ThemeProvider>\n                <Navigation />\n            </ThemeProvider>\n        );\n    }\n}\n```\n- withColorTheme\n\n`withColorTheme` 是一个高阶组件，使用方法为 `withColorTheme(options)(WrapperComponent)`\n\n`options` 可以缺省，但是如果需要通过 `ref` 获取组件实例，那么必须传递 `{forwardRef: true}`\n\n如:\n\n```js\nmodule.exports = withColorTheme({forwardRef: true})(ViewExample);\n```\n\n> 和 `react-redux` 一起使用:\n\n```js\nmodule.exports = connect(mapStateToProps,mapDispatchToProps,null,{forwardRef: true})(withColorTheme({forwardRef: true})(ViewExample));\n```\n- mergeStyle\n\n`mergeStyle(styles, key, colorTheme)`\n\n- `styles` 是属性对象\n- `key` 是 `styles` 中一个 `key` 值\n- `colorTheme` 是当前的主题， `light` / `dark`\n\n如:\n\n```js\nmergeStyle(styles, 'content', this.props.colorTheme)`\n```\n\n返回的值为: \n\n```js\n[styles.content, styles.contentDark] //colortheme 为 dark 时\n[styles.content, styles.contentLight] //colortheme 为 light 时\n```\n\n将 `styles.content` 中的颜色设置，移至 `styles.contentDark` 和 `styles.contentLight` 中\n\n- setFirstCharUppercase(str)\n\n将字符串的首字母转大写","readmeFilename":"README.md"}