From 5b30b2d0ab718ccd4924250c0c322609a2c0ad69 Mon Sep 17 00:00:00 2001 From: Pavel Prichodko <14926950+prichodko@users.noreply.github.com> Date: Mon, 23 Jan 2023 14:36:39 +0100 Subject: [PATCH] add storybook-dark-mode addon --- packages/components/.storybook/main.ts | 7 +- .../components/.storybook/preview-head.html | 4 +- packages/components/package.json | 3 +- yarn.lock | 87 +++++++++++++++++-- 4 files changed, 89 insertions(+), 12 deletions(-) diff --git a/packages/components/.storybook/main.ts b/packages/components/.storybook/main.ts index a5acdc21..88cb25aa 100644 --- a/packages/components/.storybook/main.ts +++ b/packages/components/.storybook/main.ts @@ -7,14 +7,15 @@ const config: StorybookConfig = { '@storybook/addon-essentials', '@storybook/addon-interactions', 'storybook-addon-designs', + 'storybook-dark-mode' ], framework: { name: '@storybook/react-vite', - options: {}, + options: {} }, docs: { - autodocs: 'tag', - }, + autodocs: 'tag' + } } export default config diff --git a/packages/components/.storybook/preview-head.html b/packages/components/.storybook/preview-head.html index 05da1e9d..7100922b 100644 --- a/packages/components/.storybook/preview-head.html +++ b/packages/components/.storybook/preview-head.html @@ -1,3 +1,3 @@ \ No newline at end of file + window.global = window + diff --git a/packages/components/package.json b/packages/components/package.json index 7ec7dadd..b1c25268 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -22,6 +22,7 @@ "react-native-web": "^0.18.0" }, "dependencies": { + "@status-im/icons": "*", "@tamagui/animations-css": "1.0.15", "@tamagui/animations-react-native": "1.0.15", "@tamagui/core": "1.0.15", @@ -29,7 +30,6 @@ "@tamagui/react-native-media-driver": "1.0.15", "@tamagui/shorthands": "1.0.15", "@tamagui/theme-base": "1.0.15", - "@status-im/icons": "*", "tamagui": "1.0.15" }, "devDependencies": { @@ -48,6 +48,7 @@ "react-native-web": "^0.18.0", "storybook": "7.0.0-beta.21", "storybook-addon-designs": "7.0.0-beta.2", + "storybook-dark-mode": "^2.0.5", "vite": "^4.0.4" } } diff --git a/yarn.lock b/yarn.lock index a2861671..2a8a186e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4856,7 +4856,7 @@ memoizerific "^1.11.3" prop-types "^15.7.2" -"@storybook/addons@6.5.15": +"@storybook/addons@6.5.15", "@storybook/addons@^6.5.14": version "6.5.15" resolved "https://registry.yarnpkg.com/@storybook/addons/-/addons-6.5.15.tgz#3c3fafbf3c9ce2182d652cb6682f6581ba6580e1" integrity sha512-xT31SuSX+kYGyxCNK2nqL7WTxucs3rSmhiCLovJcUjYk+QquV3c2c53Ki7lwwdDbzfXFcNAe0HJ4hoTN4jhn0Q== @@ -4873,7 +4873,7 @@ global "^4.4.0" regenerator-runtime "^0.13.7" -"@storybook/api@6.5.15": +"@storybook/api@6.5.15", "@storybook/api@^6.5.14": version "6.5.15" resolved "https://registry.yarnpkg.com/@storybook/api/-/api-6.5.15.tgz#a189dac82a57ae9cfac43c887207b1075a2a2e96" integrity sha512-BBE0KXKvj1/3jTghbIoWfrcDM0t+xO7EYtWWAXD6XlhGsZVD2Dy82Z52ONyLulMDRpMWl0OYy3h6A1YnFUH25w== @@ -5109,6 +5109,20 @@ memoizerific "^1.11.3" util-deprecate "^1.0.2" +"@storybook/components@^6.5.14": + version "6.5.15" + resolved "https://registry.yarnpkg.com/@storybook/components/-/components-6.5.15.tgz#8145be807bf48c1d010f29114411f390a9e3228f" + integrity sha512-bHTT0Oa3s4g+MBMaLBbX9ofMtb1AW59AzIUNGrfqW1XqJMGuUHMiJ7TSo+i5dRSFpbFygnwMEG9LfHxpR2Z0Dw== + dependencies: + "@storybook/client-logger" "6.5.15" + "@storybook/csf" "0.0.2--canary.4566f4d.1" + "@storybook/theming" "6.5.15" + core-js "^3.8.2" + memoizerific "^1.11.3" + qs "^6.10.0" + regenerator-runtime "^0.13.7" + util-deprecate "^1.0.2" + "@storybook/core-client@7.0.0-beta.21": version "7.0.0-beta.21" resolved "https://registry.yarnpkg.com/@storybook/core-client/-/core-client-7.0.0-beta.21.tgz#0d7265a1820f2aaf3c69daf99152a3bf14f93f5b" @@ -5146,7 +5160,7 @@ slash "^3.0.0" ts-dedent "^2.0.0" -"@storybook/core-events@6.5.15": +"@storybook/core-events@6.5.15", "@storybook/core-events@^6.5.14": version "6.5.15" resolved "https://registry.yarnpkg.com/@storybook/core-events/-/core-events-6.5.15.tgz#c12f645b50231c50eb9b26038aa67ab92b1ba24e" integrity sha512-B1Ba6l5W7MeNclclqMMTMHgYgfdpB5SIhNCQFnzIz8blynzRhNFMdxvbAl6Je5G0S4xydYYd7Lno2kXQebs7HA== @@ -5479,7 +5493,7 @@ "@testing-library/user-event" "^13.2.1" ts-dedent "^2.2.0" -"@storybook/theming@6.5.15": +"@storybook/theming@6.5.15", "@storybook/theming@^6.5.14": version "6.5.15" resolved "https://registry.yarnpkg.com/@storybook/theming/-/theming-6.5.15.tgz#048461b37ad0c29dc8d91a065a6bf1c90067524c" integrity sha512-pgdW0lVZKKXQ4VhIfLHycMmwFSVOY7vLTKnytag4Y8Yz+aXm0bwDN/QxPntFzDH47F1Rcy2ywNnvty8ooDTvuA== @@ -15666,7 +15680,16 @@ react-docgen@6.0.0-alpha.3: resolve "^1.17.0" strip-indent "^3.0.0" -react-dom@18.1.0, "react-dom@^16.8.0 || ^17.0.0", react-dom@^17.0.0, react-dom@^18.1.0, react-dom@^18.2.0: +"react-dom@^16.8.0 || ^17.0.0", react-dom@^17.0.0: + version "17.0.2" + resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-17.0.2.tgz#ecffb6845e3ad8dbfcdc498f0d0a939736502c23" + integrity sha512-s4h96KtLDUQlsENhMn1ar8t2bEa+q/YAtj8pPPdIjPDGBDIVNsrD9aXNWqspUe6AzKCIG0C1HZZLqLV7qpOBGA== + dependencies: + loose-envify "^1.1.0" + object-assign "^4.1.1" + scheduler "^0.20.2" + +react-dom@^18.1.0: version "18.1.0" resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-18.1.0.tgz#7f6dd84b706408adde05e1df575b3a024d7e8a2f" integrity sha512-fU1Txz7Budmvamp7bshe4Zi32d0ll7ect+ccxNu9FlObT605GOEB8BfO4tmRJ39R5Zj831VCpvQ05QPBW5yb+w== @@ -15674,6 +15697,14 @@ react-dom@18.1.0, "react-dom@^16.8.0 || ^17.0.0", react-dom@^17.0.0, react-dom@^ loose-envify "^1.1.0" scheduler "^0.22.0" +react-dom@^18.2.0: + version "18.2.0" + resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-18.2.0.tgz#22aaf38708db2674ed9ada224ca4aa708d821e3d" + integrity sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g== + dependencies: + loose-envify "^1.1.0" + scheduler "^0.23.0" + react-element-to-jsx-string@^15.0.0: version "15.0.0" resolved "https://registry.yarnpkg.com/react-element-to-jsx-string/-/react-element-to-jsx-string-15.0.0.tgz#1cafd5b6ad41946ffc8755e254da3fc752a01ac6" @@ -15928,13 +15959,28 @@ react-style-singleton@^2.2.1: invariant "^2.2.4" tslib "^2.0.0" -react@18.1.0, "react@^16.8.0 || ^17.0.0", react@^17.0.0, react@^18.2.0: +react@18.1.0: version "18.1.0" resolved "https://registry.yarnpkg.com/react/-/react-18.1.0.tgz#6f8620382decb17fdc5cc223a115e2adbf104890" integrity sha512-4oL8ivCz5ZEPyclFQXaNksK3adutVS8l2xzZU0cqEFrE9Sb7fC0EFK5uEk74wIreL1DERyjvsU915j1pcT2uEQ== dependencies: loose-envify "^1.1.0" +"react@^16.8.0 || ^17.0.0", react@^17.0.0: + version "17.0.2" + resolved "https://registry.yarnpkg.com/react/-/react-17.0.2.tgz#d0b5cc516d29eb3eee383f75b62864cfb6800037" + integrity sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA== + dependencies: + loose-envify "^1.1.0" + object-assign "^4.1.1" + +react@^18.2.0: + version "18.2.0" + resolved "https://registry.yarnpkg.com/react/-/react-18.2.0.tgz#555bd98592883255fa00de14f1151a917b5d77d5" + integrity sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ== + dependencies: + loose-envify "^1.1.0" + read-pkg-up@^7.0.1: version "7.0.1" resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-7.0.1.tgz#f3a6135758459733ae2b95638056e1854e7ef507" @@ -16465,6 +16511,14 @@ sax@>=0.6.0, sax@^1.2.4: resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw== +scheduler@^0.20.2: + version "0.20.2" + resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.20.2.tgz#4baee39436e34aa93b4874bddcbf0fe8b8b50e91" + integrity sha512-2eWfGgAqqWFGqtdMmcL5zCMK1U8KlXv8SQFGglL3CEtd0aDVDWgeF/YoCmvln55m5zSk3J/20hTaSBeSObsQDQ== + dependencies: + loose-envify "^1.1.0" + object-assign "^4.1.1" + scheduler@^0.22.0: version "0.22.0" resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.22.0.tgz#83a5d63594edf074add9a7198b1bae76c3db01b8" @@ -16472,6 +16526,13 @@ scheduler@^0.22.0: dependencies: loose-envify "^1.1.0" +scheduler@^0.23.0: + version "0.23.0" + resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.23.0.tgz#ba8041afc3d30eb206a487b6b384002e4e61fdfe" + integrity sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw== + dependencies: + loose-envify "^1.1.0" + schema-utils@^2.6.5: version "2.7.1" resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-2.7.1.tgz#1ca4f32d1b24c590c203b8e7a50bf0ea4cd394d7" @@ -16968,6 +17029,20 @@ storybook-addon-designs@7.0.0-beta.2: dependencies: "@figspec/react" "^1.0.0" +storybook-dark-mode@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/storybook-dark-mode/-/storybook-dark-mode-2.0.5.tgz#a15e8a43bf4b60745f73fd362133ba565a3bc61e" + integrity sha512-egOMu2tgGttGAMtFZcDLZobs1xc7LzFOh+pRVqaW59AVp05ABdQ3Hj6IX2Pz7tYGmF9AmaK+nBv0hDFxPe7Hfg== + dependencies: + "@storybook/addons" "^6.5.14" + "@storybook/api" "^6.5.14" + "@storybook/components" "^6.5.14" + "@storybook/core-events" "^6.5.14" + "@storybook/theming" "^6.5.14" + fast-deep-equal "^3.1.3" + global "^4.4.0" + memoizerific "^1.11.3" + storybook@7.0.0-beta.21: version "7.0.0-beta.21" resolved "https://registry.yarnpkg.com/storybook/-/storybook-7.0.0-beta.21.tgz#bc5515057fa910551accd19a76e240b083f2a5c0"