diff --git a/.storybook/config.tsx b/.storybook/config.tsx index 3448bc4ca..f12e4263b 100644 --- a/.storybook/config.tsx +++ b/.storybook/config.tsx @@ -1,18 +1,16 @@ // @ts-ignore -import { createGlobalStyle, css } from 'styled-components'; +import { withInfo } from '@storybook/addon-info'; +import { withOptions } from '@storybook/addon-options'; // @ts-ignore -import { configure, addDecorator } from '@storybook/react'; +import { addDecorator, configure } from '@storybook/react'; import * as React from 'react'; -import { setDefaults } from '@storybook/addon-info'; -import { withOptions } from '@storybook/addon-options'; -import { ThemeProvider } from '../packages/theme/dist'; +import { withThemes } from 'storybook-styled-components'; +import { createGlobalStyle, css } from 'styled-components'; import { globalStyle } from '../packages/theme'; -import { withInfo } from '@storybook/addon-info'; -import mainTheme from '../packages/theme/src/theme'; -import crmTheme from '../packages/theme/src/theme/crm/'; import { combinedWithComponent } from '../packages/theme/src'; +import crmTheme from '../packages/theme/src/theme/crm/'; import componentTheme from '../packages/theme/src/theme/crm/components'; -import { withThemes } from 'storybook-styled-components'; +import mainTheme from '../packages/theme/src/theme/default'; function loadStories() { req.keys().forEach(filename => req(filename)); diff --git a/examples/speed/package.json b/examples/speed/package.json index 329e3e4a5..dee1367af 100644 --- a/examples/speed/package.json +++ b/examples/speed/package.json @@ -4,7 +4,7 @@ "private": true, "homepage": "./", "dependencies": { - "@vital-ui/react": "latest", + "@vital-ui/react": "*", "formik": "^0.11.11", "rc-color-picker": "^1.2.6", "react": "^16.4.1", diff --git a/examples/speed/yarn.lock b/examples/speed/yarn.lock index ee72fc62f..b32a84275 100644 --- a/examples/speed/yarn.lock +++ b/examples/speed/yarn.lock @@ -64,68 +64,56 @@ hey-listen "^1.0.5" style-value-types "^3.0.7" -"@types/fs-extra@^5.0.4": - version "5.0.4" - resolved "https://registry.yarnpkg.com/@types/fs-extra/-/fs-extra-5.0.4.tgz#b971134d162cc0497d221adde3dbb67502225599" - integrity sha512-DsknoBvD8s+RFfSGjmERJ7ZOP1HI0UZRA3FSI+Zakhrc/Gy26YQsLI+m5V5DHxroHRJqCDLKJp7Hixn8zyaF7g== +"@vital-ui/react-avatar@^0.9.11": + version "0.9.11" + resolved "https://registry.yarnpkg.com/@vital-ui/react-avatar/-/react-avatar-0.9.11.tgz#b1b9be1ed315f188210a433dc980f9009c910b82" + integrity sha512-jEvaSOsnN5U9g2uu38PKNj9al4gvqZhyk5h4laxATxJkpe4GcplBIFbePn5x6hMWHCPOUN3sGKaFerQibNiV/A== dependencies: - "@types/node" "*" - -"@types/node@*": - version "11.9.0" - resolved "https://registry.yarnpkg.com/@types/node/-/node-11.9.0.tgz#35fea17653490dab82e1d5e69731abfdbf13160d" - integrity sha512-ry4DOrC+xenhQbzk1iIPzCZGhhPGEFv7ia7Iu6XXSLVluiJIe9FfG7Iu3mObH9mpxEXCWLCMU4JWbCCR9Oy1Zg== - -"@vital-ui/react-avatar@^0.9.9": - version "0.9.9" - resolved "https://registry.yarnpkg.com/@vital-ui/react-avatar/-/react-avatar-0.9.9.tgz#66ab8f9ba9885c5e3e34c3890d64e26881a8d752" - integrity sha512-DUg1/p7m248vuY7W6KsOyC63VS0OKc9jIPkrYNcyOEAHqvMtEndK7TBZ7KhtWdawLS7gJLElSFtJc+xk75HtRA== - dependencies: - "@vital-ui/react-theme" "^0.9.9" - "@vital-ui/react-utils" "^0.9.9" + "@vital-ui/react-theme" "^0.9.11" + "@vital-ui/react-utils" "^0.9.11" classnames "^2.2.6" -"@vital-ui/react-badge@^0.9.9": - version "0.9.9" - resolved "https://registry.yarnpkg.com/@vital-ui/react-badge/-/react-badge-0.9.9.tgz#d308e50276d77d0f27eafa6dfa9829c5c4caedd1" - integrity sha512-Ap0sNNyXZMoOqXRogVeP/Uk6gk/kYullSBIvG1H8eyMsSWql/gVNnyo3Ct4lH59lCXpRS5qBS3YAz7LIu7KsdQ== +"@vital-ui/react-badge@^0.9.11": + version "0.9.11" + resolved "https://registry.yarnpkg.com/@vital-ui/react-badge/-/react-badge-0.9.11.tgz#4710ce65ddddcccefb04bab47b39ba6147314a22" + integrity sha512-ZBsggx66v1E5zmBxgWao/wBPWvd0gN7DTPEbHgL3Ez4Ot1nJFT6U+qU4Wf0L330F+MjLl9e5Y750sfvQNaD/Tw== dependencies: - "@vital-ui/react-theme" "^0.9.9" - "@vital-ui/react-utils" "^0.9.9" + "@vital-ui/react-theme" "^0.9.11" + "@vital-ui/react-utils" "^0.9.11" classnames "^2.2.6" -"@vital-ui/react-button@^0.9.9": - version "0.9.9" - resolved "https://registry.yarnpkg.com/@vital-ui/react-button/-/react-button-0.9.9.tgz#f1cd0e676528c0999afa7bba3f066d6f6a02a5a4" - integrity sha512-JR8hP1/F1SIRX9THXJstK+XD9MCtXiVDk2bEIfwFU3N2H7hRuYxoVDeoG4nysuZXSCOmMN8pttRo71jWGfxXpA== +"@vital-ui/react-button@^0.9.11": + version "0.9.11" + resolved "https://registry.yarnpkg.com/@vital-ui/react-button/-/react-button-0.9.11.tgz#6f56990791bdb2e2e4815d68d1a83a8acb180c2c" + integrity sha512-/jj7A70KqFKqU2mPYMZfe6pubb11UV/OBAtWYxaC4zH5bfaqZHrnNTztsOefYmvL002KJaBzAdoVZgZwKUCO4Q== dependencies: - "@vital-ui/react-theme" "^0.9.9" - "@vital-ui/react-utils" "^0.9.9" + "@vital-ui/react-theme" "^0.9.11" + "@vital-ui/react-utils" "^0.9.11" classnames "^2.2.6" polished "^2.3.3" styled-map "^3.2.0-rc.1" -"@vital-ui/react-card@^0.9.9": - version "0.9.9" - resolved "https://registry.yarnpkg.com/@vital-ui/react-card/-/react-card-0.9.9.tgz#9fad442dc6bb3837ac155749e56f5b2d83d33b63" - integrity sha512-MiRy2JGHOpQUbr/+P6c4ZXyo6/5doHOWe2no9H5aqfLBjhPnpw932H3CHNJK1uG0dpaf+U6V1b2hQI3D5ogXkQ== +"@vital-ui/react-card@^0.9.11": + version "0.9.11" + resolved "https://registry.yarnpkg.com/@vital-ui/react-card/-/react-card-0.9.11.tgz#27b325d74be0b4a76cca92bc21197a425eecba62" + integrity sha512-+2hakwwDV3RNpc12vJ/anYVCCJyXlYIhIg/RtmsHyHiU4I870cFJGCferUy6IrNIWGX02kVoNV0tO7F9RN+0BQ== dependencies: - "@vital-ui/react-badge" "^0.9.9" - "@vital-ui/react-theme" "^0.9.9" - "@vital-ui/react-utils" "^0.9.9" + "@vital-ui/react-badge" "^0.9.11" + "@vital-ui/react-theme" "^0.9.11" + "@vital-ui/react-utils" "^0.9.11" classnames "^2.2.6" -"@vital-ui/react-form@^0.9.10": - version "0.9.10" - resolved "https://registry.yarnpkg.com/@vital-ui/react-form/-/react-form-0.9.10.tgz#4cf8949fa69a0391d1e21c605b046884f023e2ba" - integrity sha512-gfm2NMyQn8QVxEpn/psro5oRfR55gJaAeLuIXd2VwKVeFDw3E+3+foGuEKjjm9YY3U5SECixqIhbfmhCKqC+bQ== +"@vital-ui/react-form@^0.9.11": + version "0.9.11" + resolved "https://registry.yarnpkg.com/@vital-ui/react-form/-/react-form-0.9.11.tgz#c5de176b90f3f399cde2072ba47340854cd6ead7" + integrity sha512-hcJ0KK0QEMIawfXDbbQRzqj01mMNpNUMNxpd4Rs9WB00UOYuUzmXURfDgaIoapYh0gBDhWY93Y58eBNMcaGNEg== dependencies: - "@vital-ui/react-button" "^0.9.9" + "@vital-ui/react-button" "^0.9.11" "@vital-ui/react-icon" "^0.9.9" - "@vital-ui/react-popup" "^0.9.9" - "@vital-ui/react-theme" "^0.9.9" - "@vital-ui/react-tooltip" "^0.9.9" - "@vital-ui/react-utils" "^0.9.9" + "@vital-ui/react-popup" "^0.9.11" + "@vital-ui/react-theme" "^0.9.11" + "@vital-ui/react-tooltip" "^0.9.11" + "@vital-ui/react-utils" "^0.9.11" classnames "^2.2.6" downshift "^3.1.12" polished "2.3.3" @@ -141,115 +129,113 @@ dependencies: classnames "^2.2.6" -"@vital-ui/react-list@^0.9.9": - version "0.9.9" - resolved "https://registry.yarnpkg.com/@vital-ui/react-list/-/react-list-0.9.9.tgz#90eeed537ecc1fc95bbae840b93c1cc43b1b6140" - integrity sha512-qeS1tFxBuPr+R9/Q0G4jSd5PeOe50/cWjy+gbp2kh8D/3G6jQ+zdHFcRF89C73FkpoIZ9T/c2IFMeRjiAj/zCQ== +"@vital-ui/react-list@^0.9.11": + version "0.9.11" + resolved "https://registry.yarnpkg.com/@vital-ui/react-list/-/react-list-0.9.11.tgz#47429abbacbba1e3a28e0e921437d1f1d86938a1" + integrity sha512-/lrOh9cYltM6GDajGWIfb+ZOf1DEdFj7J3v3zyxuOrxCDq3YZuhsgLQ9XwLPeQrdmq0EZRlCGNEonYI+pIByrQ== dependencies: - "@vital-ui/react-badge" "^0.9.9" - "@vital-ui/react-theme" "^0.9.9" - "@vital-ui/react-utils" "^0.9.9" + "@vital-ui/react-badge" "^0.9.11" + "@vital-ui/react-theme" "^0.9.11" + "@vital-ui/react-utils" "^0.9.11" classnames "^2.2.6" popmotion "8.5.5" -"@vital-ui/react-menu@^0.9.9": - version "0.9.9" - resolved "https://registry.yarnpkg.com/@vital-ui/react-menu/-/react-menu-0.9.9.tgz#e87b46017e1189a36ab5121780b05fe4abf50339" - integrity sha512-QxN0WVyDq3wqGaCKPbl8pIFh4GtFBVVGz/IbGIpql3p1kH26uutN+0EVKE8c/5JjnES+wVhQGIZxgC/Y0Jkyyg== +"@vital-ui/react-menu@^0.9.11": + version "0.9.11" + resolved "https://registry.yarnpkg.com/@vital-ui/react-menu/-/react-menu-0.9.11.tgz#8fe09da498aa119fed98a1a6ac8fccad3a6b2a65" + integrity sha512-NNZffE9Npw4xSNfRKXAQ8PgXmZXZr4VAlWpSHK6Ap1o7vnY5kRpVk32R+O/LMJSWYDrgFmZVZeqRpxNGS4nZzw== dependencies: - "@vital-ui/react-button" "^0.9.9" - "@vital-ui/react-theme" "^0.9.9" + "@vital-ui/react-button" "^0.9.11" + "@vital-ui/react-theme" "^0.9.11" classnames "^2.2.6" -"@vital-ui/react-modal@^0.9.9": - version "0.9.9" - resolved "https://registry.yarnpkg.com/@vital-ui/react-modal/-/react-modal-0.9.9.tgz#84555e556fdef65acf499ed165772b98a5bb8684" - integrity sha512-QGSRzJ5Drl27n92FB0grvmqsPi8AGHuPKb53o9zDWCHolTuRB0aTI+uYoweVWIlvDCgaGTk03GOBZRSR/0gA9w== +"@vital-ui/react-modal@^0.9.11": + version "0.9.11" + resolved "https://registry.yarnpkg.com/@vital-ui/react-modal/-/react-modal-0.9.11.tgz#7d54ae621f2b70a2522b9b61d8d569360c7fa87d" + integrity sha512-zquNav0gdGrQxuLdXs1vNeZTuGZJPCgtuvpeJdkc6XngIE1tksXQ2tCAFEN1FaTcjjITs+XbrfEhGM+ZxyZdJA== dependencies: - "@vital-ui/react-theme" "^0.9.9" - "@vital-ui/react-utils" "^0.9.9" + "@vital-ui/react-theme" "^0.9.11" + "@vital-ui/react-utils" "^0.9.11" classnames "^2.2.6" react-resize-detector "^3.4.0" -"@vital-ui/react-pill@^0.9.9": - version "0.9.9" - resolved "https://registry.yarnpkg.com/@vital-ui/react-pill/-/react-pill-0.9.9.tgz#86b224c160b2110febc8a64de86d4190ff515c83" - integrity sha512-zWBnyJHOmtDqexlounABCuRd0C3//jxWrNQlc1tYls+yzerqvqTkz45DccZs0c34RomGcSAqvo+LzK+PPyTINQ== +"@vital-ui/react-pill@^0.9.11": + version "0.9.11" + resolved "https://registry.yarnpkg.com/@vital-ui/react-pill/-/react-pill-0.9.11.tgz#48de96e2caa473c8171fe3d4cdaae5f1118cad86" + integrity sha512-eRyobWBGlMkvYPlbGtWEGfX/oDVEeZLGWxTbLFiGhOFw30bm2Rt3OgjEFU+7+E2lLwPaw5a6lFF235979ueWZQ== dependencies: - "@vital-ui/react-badge" "^0.9.9" - "@vital-ui/react-theme" "^0.9.9" - "@vital-ui/react-utils" "^0.9.9" + "@vital-ui/react-badge" "^0.9.11" + "@vital-ui/react-theme" "^0.9.11" + "@vital-ui/react-utils" "^0.9.11" classnames "^2.2.6" react-priority-navigation "0.3.1" -"@vital-ui/react-popup@^0.9.9": - version "0.9.9" - resolved "https://registry.yarnpkg.com/@vital-ui/react-popup/-/react-popup-0.9.9.tgz#3f8025b817be39071ef06edad72cf8a47bb6afe6" - integrity sha512-NuiNrQ/TqP4RuSRqviZRpeW53QQpHgW3oLXymP8CMkS4SAPQuI9hjFhuK6zzjRCW3bXemM43Wd0frerBkixEBA== +"@vital-ui/react-popup@^0.9.11": + version "0.9.11" + resolved "https://registry.yarnpkg.com/@vital-ui/react-popup/-/react-popup-0.9.11.tgz#18d47ad1a96d1dbe335c9a331e2d749e2d603ed3" + integrity sha512-YWNapmVZm2Rdphr82WPbnQYDWVgwzSe/mw2GMheM2SIKM5vJsYaRE1kgcaROFrDPSM0QBr0vdARuG2gdX57ezA== dependencies: - "@vital-ui/react-theme" "^0.9.9" - "@vital-ui/react-utils" "^0.9.9" + "@vital-ui/react-theme" "^0.9.11" + "@vital-ui/react-utils" "^0.9.11" classnames "^2.2.6" rc-trigger "2.6.2" -"@vital-ui/react-tabs@^0.9.9": - version "0.9.9" - resolved "https://registry.yarnpkg.com/@vital-ui/react-tabs/-/react-tabs-0.9.9.tgz#bc38f61e5fb954fe17e5a6a7906d4f43f6da70ef" - integrity sha512-uJ4rVgF6T9zqhfSsrH3Id7H/ze3GzAJdxlA6MMl5b5UOHW5ksccJAKhdLumDSvcTt1jMAvoP9Trw9AIY3WsJCg== +"@vital-ui/react-tabs@^0.9.11": + version "0.9.11" + resolved "https://registry.yarnpkg.com/@vital-ui/react-tabs/-/react-tabs-0.9.11.tgz#51943c1f46c872ba7c1aefd4f9827fbd6481e9a9" + integrity sha512-pYhWknj645eqKKzBn+DSZcSa9InDIMFfWjb/d4RxGj4trQNH0x769llVDn/ay6A4rLgK6s4p248OWeq23Mkk3g== dependencies: - "@vital-ui/react-badge" "^0.9.9" - "@vital-ui/react-theme" "^0.9.9" - "@vital-ui/react-utils" "^0.9.9" + "@vital-ui/react-badge" "^0.9.11" + "@vital-ui/react-theme" "^0.9.11" + "@vital-ui/react-utils" "^0.9.11" classnames "^2.2.6" -"@vital-ui/react-theme@^0.9.9": - version "0.9.9" - resolved "https://registry.yarnpkg.com/@vital-ui/react-theme/-/react-theme-0.9.9.tgz#da9cddd18d435ace4a2c58522d50104752e9922f" - integrity sha512-EOmwY6G3yAf+sAue8O/gWsZtbzX24B3au1BL0RJrQnCuELNyxHDrLHz4GTnzmA8ow9NQhTy5fMiOAUVYWn+rjw== +"@vital-ui/react-theme@^0.9.11": + version "0.9.11" + resolved "https://registry.yarnpkg.com/@vital-ui/react-theme/-/react-theme-0.9.11.tgz#83813276d04e4e6582627ce5d1d5a693d9e65974" + integrity sha512-0FJyWSfuey9Aa90y/KKEWepNa4iTaZ/FnkQkRwdTlVxj0EiY1tndYckS+iNikMX5vcECUAa/5Z05ldwsSoVllg== dependencies: - "@types/fs-extra" "^5.0.4" classnames "^2.2.6" - fs-extra "^7.0.0" lodash.merge "^4.6.1" polished "^2.3.3" -"@vital-ui/react-tooltip@^0.9.9": - version "0.9.9" - resolved "https://registry.yarnpkg.com/@vital-ui/react-tooltip/-/react-tooltip-0.9.9.tgz#36a602f6f991fe7b025bb6eff750109193f9f885" - integrity sha512-yZpQ4KDviaiwxaRLa5t5U4vhuMr9ucLNjXxtdCLNsrggum84f58JhcoXI83I5UwiMAz/HMjXliaJ5m0BdGU+5g== +"@vital-ui/react-tooltip@^0.9.11": + version "0.9.11" + resolved "https://registry.yarnpkg.com/@vital-ui/react-tooltip/-/react-tooltip-0.9.11.tgz#100fb9bd5e85280f216472b2e5c58f15d3397dfe" + integrity sha512-EhGG9wQTA6s/aCDnU6HLK+JVhxf/DVQBvGtYHYpQvu69nrqmkkYAzQiG/wpUnMuTFJud3AvMYcariImjk2cSPQ== dependencies: - "@vital-ui/react-theme" "^0.9.9" + "@vital-ui/react-theme" "^0.9.11" classnames "^2.2.6" rc-trigger "2.6.2" -"@vital-ui/react-utils@^0.9.9": - version "0.9.9" - resolved "https://registry.yarnpkg.com/@vital-ui/react-utils/-/react-utils-0.9.9.tgz#2a033422aa1ed667b75bc05fbc763bb9b1ecda32" - integrity sha512-io5xXxMO+LchfgbXU2K0GF/F0EWCA7Pv1mGx7blqySS24Q/LGYcWj/JvRXU1093COgxxvLFWiMNt6rKYVUlNtQ== +"@vital-ui/react-utils@^0.9.11": + version "0.9.11" + resolved "https://registry.yarnpkg.com/@vital-ui/react-utils/-/react-utils-0.9.11.tgz#1f0b9818bdda2bf77965e3f16ebfaaa55db7e6c3" + integrity sha512-oKygkKoCylU9KE3A02g4qWDJOogQfoa/4ElN1t5R6RFMbJWeybJNQXnwxKlg9buVhs9KSlU17+ittD6rfkfqEQ== dependencies: - "@vital-ui/react-theme" "^0.9.9" + "@vital-ui/react-theme" "^0.9.11" classnames "^2.2.6" styled-system "^3.2.1" -"@vital-ui/react@latest": - version "0.9.10" - resolved "https://registry.yarnpkg.com/@vital-ui/react/-/react-0.9.10.tgz#c2ef0a1359b13f472f688eafb1a7aeb24e692b39" - integrity sha512-YSdiENVsAhIbu5I2a9DAWpGR8UyQghsVcSCOmXXDOTJZ+vwpvGEB7GdQceyXdJnLOQr9x/TbE7G5Gz3rohQuqQ== +"@vital-ui/react@*": + version "0.9.11" + resolved "https://registry.yarnpkg.com/@vital-ui/react/-/react-0.9.11.tgz#7c86c5c17064568f7caad53e78da9e2f89b734bf" + integrity sha512-ns4lRNQlgo9D+ofoKu/bs0hhGyU1YcZAQDOgjT+/L5cF0lFMs7yjDgHJ7o53cOkWDp1HJZFnDpYiXbtH8/1RzQ== dependencies: - "@vital-ui/react-avatar" "^0.9.9" - "@vital-ui/react-badge" "^0.9.9" - "@vital-ui/react-button" "^0.9.9" - "@vital-ui/react-card" "^0.9.9" - "@vital-ui/react-form" "^0.9.10" + "@vital-ui/react-avatar" "^0.9.11" + "@vital-ui/react-badge" "^0.9.11" + "@vital-ui/react-button" "^0.9.11" + "@vital-ui/react-card" "^0.9.11" + "@vital-ui/react-form" "^0.9.11" "@vital-ui/react-icon" "^0.9.9" - "@vital-ui/react-list" "^0.9.9" - "@vital-ui/react-menu" "^0.9.9" - "@vital-ui/react-modal" "^0.9.9" - "@vital-ui/react-pill" "^0.9.9" - "@vital-ui/react-tabs" "^0.9.9" - "@vital-ui/react-theme" "^0.9.9" - "@vital-ui/react-tooltip" "^0.9.9" - "@vital-ui/react-utils" "^0.9.9" + "@vital-ui/react-list" "^0.9.11" + "@vital-ui/react-menu" "^0.9.11" + "@vital-ui/react-modal" "^0.9.11" + "@vital-ui/react-pill" "^0.9.11" + "@vital-ui/react-tabs" "^0.9.11" + "@vital-ui/react-theme" "^0.9.11" + "@vital-ui/react-tooltip" "^0.9.11" + "@vital-ui/react-utils" "^0.9.11" abab@^1.0.3: version "1.0.4" @@ -3500,15 +3486,6 @@ fs-extra@^0.30.0: path-is-absolute "^1.0.0" rimraf "^2.2.8" -fs-extra@^7.0.0: - version "7.0.1" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-7.0.1.tgz#4f189c44aa123b895f722804f55ea23eadc348e9" - integrity sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw== - dependencies: - graceful-fs "^4.1.2" - jsonfile "^4.0.0" - universalify "^0.1.0" - fs-minipass@^1.2.5: version "1.2.5" resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.5.tgz#06c277218454ec288df77ada54a03b8702aacb9d" @@ -4810,13 +4787,6 @@ jsonfile@^3.0.0: optionalDependencies: graceful-fs "^4.1.6" -jsonfile@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" - integrity sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss= - optionalDependencies: - graceful-fs "^4.1.6" - jsonify@~0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73" diff --git a/packages/button/src/Button.tsx b/packages/button/src/Button.tsx index e38c9f1a5..483e008fe 100644 --- a/packages/button/src/Button.tsx +++ b/packages/button/src/Button.tsx @@ -44,7 +44,7 @@ export const natureColor = (theme: any) => ({ warning: theme.colors.warning, }); -const buttonBaseStyle = ({ +export const buttonBaseStyle = ({ theme, size, nature, @@ -79,7 +79,7 @@ const buttonBaseStyle = ({ } `; -const subtleStyle = ({ +export const subtleStyle = ({ subtle, selected, theme, @@ -98,7 +98,11 @@ const subtleStyle = ({ } `; -const flatStyle = ({ flat, nature, theme }: StyledButtonProps) => +export const flatStyle = ({ + flat, + nature, + theme, +}: StyledButtonProps) => flat && css` background: ${nature === 'default' @@ -129,7 +133,11 @@ const flatStyle = ({ flat, nature, theme }: StyledButtonProps) => } `; -const lightStyle = ({ light, theme, nature }: StyledButtonProps) => +export const lightStyle = ({ + light, + theme, + nature, +}: StyledButtonProps) => light && css` background: ${theme.button.light.bg}; @@ -143,7 +151,7 @@ const lightStyle = ({ light, theme, nature }: StyledButtonProps) => } `; -const linkStyle = ({ link, theme }: StyledButtonProps) => +export const linkStyle = ({ link, theme }: StyledButtonProps) => link && css` background: ${theme.button.link.bg}; @@ -156,7 +164,11 @@ const linkStyle = ({ link, theme }: StyledButtonProps) => } `; -const linkDarkStyle = ({ link, dark, theme }: StyledButtonProps) => +export const linkDarkStyle = ({ + link, + dark, + theme, +}: StyledButtonProps) => link && dark && css` @@ -175,7 +187,7 @@ const underlineStyle = ({ underline }: StyledButtonProps) => } `; -const circleStyle = ({ circle }: StyledButtonProps) => +export const circleStyle = ({ circle }: StyledButtonProps) => circle && css` display: flex; @@ -222,6 +234,7 @@ export const Button = styled('button').attrs(props => ({ cursor: not-allowed; pointer-events: none; } + ${props => props.theme.button.buttonStyle}; `; Button.defaultProps = { diff --git a/packages/theme/src/ThemeProvider.spec.tsx b/packages/theme/src/ThemeProvider.spec.tsx index 655645176..561d0b1a8 100644 --- a/packages/theme/src/ThemeProvider.spec.tsx +++ b/packages/theme/src/ThemeProvider.spec.tsx @@ -1,7 +1,7 @@ import React from 'react'; import renderer from 'react-test-renderer'; import styled, { withTheme } from 'styled-components'; -import defaultVariables from './theme'; +import defaultVariables from './theme/default'; import ThemeProvider, { combinedWithComponent, } from './ThemeProvider'; diff --git a/packages/theme/src/ThemeProvider.tsx b/packages/theme/src/ThemeProvider.tsx index 5545a4c1f..a383dfd90 100644 --- a/packages/theme/src/ThemeProvider.tsx +++ b/packages/theme/src/ThemeProvider.tsx @@ -2,8 +2,8 @@ import React from 'react'; import { ThemeProvider as Provider } from 'styled-components'; import merge from 'lodash.merge'; -import defaultVariables from './theme'; -import defaultComponentsThemeFn from './theme/components'; +import defaultVariables from './theme/default'; +import defaultComponentsThemeFn from './theme/default/components'; type Props = { theme?: T; diff --git a/packages/theme/src/index.ts b/packages/theme/src/index.ts index a319cd872..0794acbc4 100644 --- a/packages/theme/src/index.ts +++ b/packages/theme/src/index.ts @@ -1,5 +1,5 @@ -import defaultVariables from './theme'; -import defaultComponentsTheme from './theme/components'; +import defaultVariables from './theme/default'; +import defaultComponentsTheme from './theme/default/components'; import * as globalStyle from './globalStyle'; import { colorPaletteGenerator } from './helper'; diff --git a/packages/theme/src/theme/crm/components.ts b/packages/theme/src/theme/crm/components.ts index 4a23da22b..5fb3e2bd5 100644 --- a/packages/theme/src/theme/crm/components.ts +++ b/packages/theme/src/theme/crm/components.ts @@ -41,6 +41,7 @@ export default (theme: T) => ({ inverseColor: theme.colors.info, }, button: { + buttonStyle: undefined, natureColor: { default: theme.colors.secondary700, primary: theme.colors.primary, @@ -68,7 +69,7 @@ export default (theme: T) => ({ }, light: { bg: theme.colors.white, - hoverBg: theme.colors.secondary400, + hoverBg: theme.colors.secondary200, activeBg: theme.colors.secondary200, borderColor: theme.colors.secondary400, }, diff --git a/packages/theme/src/theme/colors.ts b/packages/theme/src/theme/default/colors.ts similarity index 100% rename from packages/theme/src/theme/colors.ts rename to packages/theme/src/theme/default/colors.ts diff --git a/packages/theme/src/theme/components.ts b/packages/theme/src/theme/default/components.ts similarity index 100% rename from packages/theme/src/theme/components.ts rename to packages/theme/src/theme/default/components.ts diff --git a/packages/theme/src/theme/index.ts b/packages/theme/src/theme/default/index.ts similarity index 100% rename from packages/theme/src/theme/index.ts rename to packages/theme/src/theme/default/index.ts diff --git a/packages/theme/src/theme/token.ts b/packages/theme/src/theme/default/token.ts similarity index 100% rename from packages/theme/src/theme/token.ts rename to packages/theme/src/theme/default/token.ts diff --git a/packages/tooltip/src/__snapshots__/Tooltip.spec.tsx.snap b/packages/tooltip/src/__snapshots__/Tooltip.spec.tsx.snap index 1864b9e2d..609842681 100644 --- a/packages/tooltip/src/__snapshots__/Tooltip.spec.tsx.snap +++ b/packages/tooltip/src/__snapshots__/Tooltip.spec.tsx.snap @@ -90,7 +90,7 @@ Object { , "container":