Skip to content

Commit 86d5c54

Browse files
committed
Add Chakra UI add-on for Storybook
Wraps each Storybook story with ChakraProvider, making the expected styles work.
1 parent 3b1c34e commit 86d5c54

File tree

3 files changed

+50
-7
lines changed

3 files changed

+50
-7
lines changed

apps/storybook/.storybook/main.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ module.exports = {
55
],
66
"addons": [
77
"@storybook/addon-links",
8-
"@storybook/addon-essentials"
8+
"@storybook/addon-essentials",
9+
"@snek-at/storybook-addon-chakra-ui", // Must come after @storybook addons
910
],
1011
"framework": "@storybook/react",
1112
};

apps/storybook/package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@
3434
"@babel/core": "^7.16.0",
3535
"@babel/preset-env": "^7.16.4",
3636
"@babel/preset-typescript": "^7.16.0",
37+
"@chakra-ui/icons": "^1.1.1",
38+
"@chakra-ui/system": "^1.8.2",
39+
"@emotion/react": "^11.7.0",
40+
"@emotion/styled": "^11.6.0",
41+
"@snek-at/storybook-addon-chakra-ui": "^1.0.0-beta.1",
3742
"react": "^17.0.2",
3843
"react-dom": "^17.0.2",
3944
"webpack": "^4.46.0"

yarn.lock

Lines changed: 43 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1303,6 +1303,14 @@
13031303
dependencies:
13041304
"@chakra-ui/utils" "1.9.1"
13051305

1306+
"@chakra-ui/icons@^1.1.1":
1307+
version "1.1.1"
1308+
resolved "https://registry.yarnpkg.com/@chakra-ui/icons/-/icons-1.1.1.tgz#e4b191fd38be999c4434ff2b1fb69a5eaf3cf226"
1309+
integrity sha512-/+u6euCOFw6J1DZW7NcVFtib4mygJBoqRdsKiU1Z3uiTC+zQTBzcCt54NQ+kK8rhuNzJ+odahnt/AbjBJgZ+5A==
1310+
dependencies:
1311+
"@chakra-ui/icon" "1.2.1"
1312+
"@types/react" "^17.0.15"
1313+
13061314
"@chakra-ui/image@1.1.1":
13071315
version "1.1.1"
13081316
resolved "https://registry.yarnpkg.com/@chakra-ui/image/-/image-1.1.1.tgz#39ecb77155e9e1fbbc68e825eb46405808805a8c"
@@ -1467,7 +1475,7 @@
14671475
dependencies:
14681476
"@chakra-ui/utils" "^1.9.1"
14691477

1470-
"@chakra-ui/react@^1.6.8":
1478+
"@chakra-ui/react@^1.6.6", "@chakra-ui/react@^1.6.8":
14711479
version "1.7.2"
14721480
resolved "https://registry.yarnpkg.com/@chakra-ui/react/-/react-1.7.2.tgz#7613f33d4adc2384d2fa8675cb6e94780e5c4cbe"
14731481
integrity sha512-2RxJHqYLSSB/dQQ9M4APxMopPfsU89A++63v8U8jiR7J8sUaa6Ded9ypTiIUY09J8v7mJAus4/ZSJxG7Zfd7aA==
@@ -1580,7 +1588,7 @@
15801588
"@chakra-ui/checkbox" "1.6.1"
15811589
"@chakra-ui/utils" "1.9.1"
15821590

1583-
"@chakra-ui/system@1.8.2":
1591+
"@chakra-ui/system@1.8.2", "@chakra-ui/system@^1.8.2":
15841592
version "1.8.2"
15851593
resolved "https://registry.yarnpkg.com/@chakra-ui/system/-/system-1.8.2.tgz#243820e8b0000a6874cc57218245462d11001695"
15861594
integrity sha512-k/43bv5exPGc6hBVcq5dUdGC+0pmQthJP/VqcTUt0oIc3oyoVSAnJhpmBkFHXYNqj6yYd2K7qdD2PjjbZ5KCLA==
@@ -1798,7 +1806,7 @@
17981806
resolved "https://registry.yarnpkg.com/@emotion/memoize/-/memoize-0.7.5.tgz#2c40f81449a4e554e9fc6396910ed4843ec2be50"
17991807
integrity sha512-igX9a37DR2ZPGYtV6suZ6whr8pTFtyHL3K/oLUotxpSVO2ASaprmAe2Dkq7tBo7CRY7MMDrAa9nuQP9/YG8FxQ==
18001808

1801-
"@emotion/react@^11.4.1":
1809+
"@emotion/react@^11", "@emotion/react@^11.4.1", "@emotion/react@^11.7.0":
18021810
version "11.7.0"
18031811
resolved "https://registry.yarnpkg.com/@emotion/react/-/react-11.7.0.tgz#b179da970ac0e8415de3ac165deadf8d9c4bf89f"
18041812
integrity sha512-WL93hf9+/2s3cA1JVJlz8+Uy6p6QWukqQFOm2OZO5ki51hfucHMOmbSjiyC3t2Y4RI8XUmBoepoc/24ny/VBbA==
@@ -1861,7 +1869,7 @@
18611869
"@emotion/styled-base" "^10.3.0"
18621870
babel-plugin-emotion "^10.0.27"
18631871

1864-
"@emotion/styled@^11.3.0":
1872+
"@emotion/styled@^11", "@emotion/styled@^11.3.0", "@emotion/styled@^11.6.0":
18651873
version "11.6.0"
18661874
resolved "https://registry.yarnpkg.com/@emotion/styled/-/styled-11.6.0.tgz#9230d1a7bcb2ebf83c6a579f4c80e0664132d81d"
18671875
integrity sha512-mxVtVyIOTmCAkFbwIp+nCjTXJNgcz4VWkOYQro87jE2QBTydnkiYusMrRGFtzuruiGK4dDaNORk4gH049iiQuw==
@@ -2346,6 +2354,18 @@
23462354
resolved "https://registry.yarnpkg.com/@rushstack/eslint-patch/-/eslint-patch-1.1.0.tgz#7f698254aadf921e48dda8c0a6b304026b8a9323"
23472355
integrity sha512-JLo+Y592QzIE+q7Dl2pMUtt4q8SKYI5jDrZxrozEQxnGVOyYE+GWK9eLkwTaeN9DDctlaRAQ3TBmzZ1qdLE30A==
23482356

2357+
"@snek-at/storybook-addon-chakra-ui@^1.0.0-beta.1":
2358+
version "1.0.0-beta.1"
2359+
resolved "https://registry.yarnpkg.com/@snek-at/storybook-addon-chakra-ui/-/storybook-addon-chakra-ui-1.0.0-beta.1.tgz#ace030aebb523ab7b355b54756fa353eb0209f5f"
2360+
integrity sha512-JMPsULgbmXOr3v3ePgS+QJlk/7dw+YtGm4xkG5HPr/warLwPWuGXIavrEmSCUPYVP0redSDlNksT5wqMoYHQow==
2361+
dependencies:
2362+
"@chakra-ui/react" "^1.6.6"
2363+
"@emotion/react" "^11"
2364+
"@emotion/styled" "^11"
2365+
"@storybook/addons" "^6.3.7"
2366+
framer-motion "^4"
2367+
react "^17.0.2"
2368+
23492369
"@storybook/addon-actions@6.4.3", "@storybook/addon-actions@^6.4.3":
23502370
version "6.4.3"
23512371
resolved "https://registry.yarnpkg.com/@storybook/addon-actions/-/addon-actions-6.4.3.tgz#324b67fecd72a259dba49a4c34c5cece400e66d9"
@@ -2573,6 +2593,23 @@
25732593
global "^4.4.0"
25742594
regenerator-runtime "^0.13.7"
25752595

2596+
"@storybook/addons@^6.3.7":
2597+
version "6.4.1"
2598+
resolved "https://registry.yarnpkg.com/@storybook/addons/-/addons-6.4.1.tgz#841ed6f0daae7333f85c25a9399213fcb58f521a"
2599+
integrity sha512-gTCOuQnkqh0Wr39G4jZ79lqDc/U6cQX2wNKOfOsQN4hMKKn0lzn14GQ03jwie1+3Y1Fe/Q2P348Y9o0zms/z+w==
2600+
dependencies:
2601+
"@storybook/api" "6.4.1"
2602+
"@storybook/channels" "6.4.1"
2603+
"@storybook/client-logger" "6.4.1"
2604+
"@storybook/core-events" "6.4.1"
2605+
"@storybook/csf" "0.0.2--canary.87bc651.0"
2606+
"@storybook/router" "6.4.1"
2607+
"@storybook/theming" "6.4.1"
2608+
"@types/webpack-env" "^1.16.0"
2609+
core-js "^3.8.2"
2610+
global "^4.4.0"
2611+
regenerator-runtime "^0.13.7"
2612+
25762613
"@storybook/api@6.4.3":
25772614
version "6.4.3"
25782615
resolved "https://registry.yarnpkg.com/@storybook/api/-/api-6.4.3.tgz#ae30c75be8559cb6b54195989b50a7e3ccf4cb23"
@@ -3389,7 +3426,7 @@
33893426
dependencies:
33903427
"@types/react" "*"
33913428

3392-
"@types/react@*", "@types/react@^17.0.19":
3429+
"@types/react@*", "@types/react@^17.0.15", "@types/react@^17.0.19":
33933430
version "17.0.37"
33943431
resolved "https://registry.yarnpkg.com/@types/react/-/react-17.0.37.tgz#6884d0aa402605935c397ae689deed115caad959"
33953432
integrity sha512-2FS1oTqBGcH/s0E+CjrCCR9+JMpsu9b69RTFO+40ua43ZqP5MmQ4iUde/dMjWR909KxZwmOQIFq6AV6NjEG5xg==
@@ -6677,7 +6714,7 @@ fragment-cache@^0.2.1:
66776714
dependencies:
66786715
map-cache "^0.2.2"
66796716

6680-
framer-motion@^4.1.17:
6717+
framer-motion@^4, framer-motion@^4.1.17:
66816718
version "4.1.17"
66826719
resolved "https://registry.yarnpkg.com/framer-motion/-/framer-motion-4.1.17.tgz#4029469252a62ea599902e5a92b537120cc89721"
66836720
integrity sha512-thx1wvKzblzbs0XaK2X0G1JuwIdARcoNOW7VVwjO8BUltzXPyONGAElLu6CiCScsOQRI7FIk/45YTFtJw5Yozw==

0 commit comments

Comments
 (0)