@saas-ui/storybook-addon 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/CHANGELOG.md +497 -0
  2. package/README.md +97 -0
  3. package/dist/chunk-E3MMX4DM.js +4973 -0
  4. package/dist/chunk-GII4NPN2.js +81 -0
  5. package/dist/chunk-HSBRF2QZ.js +18 -0
  6. package/dist/chunk-N4JZ67DU.js +26 -0
  7. package/dist/chunk-NOGSFSIA.js +52 -0
  8. package/dist/chunk-QNOLFHPG.js +63 -0
  9. package/dist/chunk-SGM3YTWS.js +82 -0
  10. package/dist/chunk-SVHNULTN.js +24 -0
  11. package/dist/chunk-UK7U2PBM.js +70 -0
  12. package/dist/constants.cjs +46 -0
  13. package/dist/constants.d.ts +11 -0
  14. package/dist/constants.js +15 -0
  15. package/dist/feature/arg-types.cjs +76 -0
  16. package/dist/feature/arg-types.d.ts +46 -0
  17. package/dist/feature/arg-types.js +7 -0
  18. package/dist/feature/color-mode/ColorModeSync.cjs +57 -0
  19. package/dist/feature/color-mode/ColorModeSync.d.ts +6 -0
  20. package/dist/feature/color-mode/ColorModeSync.js +8 -0
  21. package/dist/feature/color-mode/ColorModeTool.cjs +95 -0
  22. package/dist/feature/color-mode/ColorModeTool.d.ts +6 -0
  23. package/dist/feature/color-mode/ColorModeTool.js +8 -0
  24. package/dist/feature/color-mode/ThemeTool.cjs +5038 -0
  25. package/dist/feature/color-mode/ThemeTool.d.ts +6 -0
  26. package/dist/feature/color-mode/ThemeTool.js +8 -0
  27. package/dist/feature/decorator/ChakraProviderDecorator.cjs +168 -0
  28. package/dist/feature/decorator/ChakraProviderDecorator.d.ts +5 -0
  29. package/dist/feature/decorator/ChakraProviderDecorator.js +10 -0
  30. package/dist/feature/direction/DirectionTool.cjs +127 -0
  31. package/dist/feature/direction/DirectionTool.d.ts +6 -0
  32. package/dist/feature/direction/DirectionTool.js +8 -0
  33. package/dist/feature/direction/useDirection.cjs +59 -0
  34. package/dist/feature/direction/useDirection.d.ts +6 -0
  35. package/dist/feature/direction/useDirection.js +8 -0
  36. package/dist/index.cjs +99 -0
  37. package/dist/index.d.ts +4 -0
  38. package/dist/index.js +19 -0
  39. package/dist/preset/decorators.cjs +173 -0
  40. package/dist/preset/decorators.d.ts +3 -0
  41. package/dist/preset/decorators.js +13 -0
  42. package/dist/preset/index.cjs +60 -0
  43. package/dist/preset/index.d.ts +5 -0
  44. package/dist/preset/index.js +27 -0
  45. package/dist/preset/register.cjs +5175 -0
  46. package/dist/preset/register.d.ts +2 -0
  47. package/dist/preset/register.js +40 -0
  48. package/package.json +120 -0
  49. package/theming-arg-types.png +0 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,497 @@
1
+ # @chakra-ui/storybook-addon
2
+
3
+ ## 4.0.17
4
+
5
+ ### Patch Changes
6
+
7
+ - [`ddbb1b4c4`](https://github.com/chakra-ui/chakra-ui/commit/ddbb1b4c49b8f124c0368929357e2891265a50c0)
8
+ Thanks [@segunadebayo](https://github.com/segunadebayo)! - Bump all packages
9
+
10
+ ## 4.0.16
11
+
12
+ ### Patch Changes
13
+
14
+ - [#7154](https://github.com/chakra-ui/chakra-ui/pull/7154)
15
+ [`2d7398a01`](https://github.com/chakra-ui/chakra-ui/commit/2d7398a0142b5bdd3f68ce05bd159fc824cda5ef)
16
+ Thanks [@segunadebayo](https://github.com/segunadebayo)! - ## All components
17
+
18
+ Improved the bundling setup for all components.
19
+
20
+ - Switched to the `.mjs` file extension for correct ESM behavior
21
+ - Switched to the latest `tsup` will uses automatic JSX runtime detection
22
+ removing the need for manually inject classic `React` import
23
+ - Moved `tsup` config to `package.json` since it's very minimal
24
+ - Removed `clean-package.config.json` in favor of the `package.json` property
25
+ - Fixed issue where Storybook addon (dark mode and RTL) was not working
26
+
27
+ ## 4.0.15
28
+
29
+ ### Patch Changes
30
+
31
+ - Updated dependencies
32
+ [[`37b7a130a`](https://github.com/chakra-ui/chakra-ui/commit/37b7a130aaff0cbb97f206978315075eb06e5100)]:
33
+ - @chakra-ui/icons@2.0.14
34
+
35
+ ## 4.0.14
36
+
37
+ ### Patch Changes
38
+
39
+ - Updated dependencies []:
40
+ - @chakra-ui/icons@2.0.13
41
+
42
+ ## 4.0.13
43
+
44
+ ### Patch Changes
45
+
46
+ - [#6945](https://github.com/chakra-ui/chakra-ui/pull/6945)
47
+ [`75eaba929`](https://github.com/chakra-ui/chakra-ui/commit/75eaba9293e2c7d5bd6aed2037df05128f335930)
48
+ Thanks [@anddoutoi](https://github.com/anddoutoi)! - Fix issue where using
49
+ `@chakra-ui/react` in a TypeScript project with `"type": "module"` in
50
+ `package.json` and `"moduleResolution": "Node16"` in `tsconfig.json` cannot
51
+ find the types.
52
+ - Updated dependencies
53
+ [[`75eaba929`](https://github.com/chakra-ui/chakra-ui/commit/75eaba9293e2c7d5bd6aed2037df05128f335930)]:
54
+ - @chakra-ui/icons@2.0.12
55
+
56
+ ## 4.0.12
57
+
58
+ ### Patch Changes
59
+
60
+ - [#6726](https://github.com/chakra-ui/chakra-ui/pull/6726)
61
+ [`22968783f`](https://github.com/chakra-ui/chakra-ui/commit/22968783f509bca1b4196d7d1772a872a131e845)
62
+ Thanks [@kibs](https://github.com/kibs)! - Allow setting the storybook chakra
63
+ theme via a callback function, with access to the context
64
+
65
+ * [#6725](https://github.com/chakra-ui/chakra-ui/pull/6725)
66
+ [`5409199a0`](https://github.com/chakra-ui/chakra-ui/commit/5409199a0427f5f895267fc7f3698dc3a6cffc05)
67
+ Thanks [@kibs](https://github.com/kibs)! - Allow getThemingArgTypes to return
68
+ args when colorScheme is not supported by component
69
+ * Updated dependencies
70
+ [[`9de39921b`](https://github.com/chakra-ui/chakra-ui/commit/9de39921b983ad0eb2df7195e3b683c2e2e9e290)]:
71
+ - @chakra-ui/icons@2.0.11
72
+
73
+ ## 4.0.11
74
+
75
+ ### Patch Changes
76
+
77
+ - Updated dependencies []:
78
+ - @chakra-ui/icons@2.0.10
79
+
80
+ ## 4.0.10
81
+
82
+ ### Patch Changes
83
+
84
+ - [#6580](https://github.com/chakra-ui/chakra-ui/pull/6580)
85
+ [`c22fa1a87`](https://github.com/chakra-ui/chakra-ui/commit/c22fa1a87f18ce43415e5c0f91d5988d476e7a31)
86
+ Thanks [@itkrt2y](https://github.com/itkrt2y)! - remove an unused dependency
87
+
88
+ - Updated dependencies []:
89
+ - @chakra-ui/icons@2.0.9
90
+
91
+ ## 4.0.9
92
+
93
+ ### Patch Changes
94
+
95
+ - [#6508](https://github.com/chakra-ui/chakra-ui/pull/6508)
96
+ [`445661955`](https://github.com/chakra-ui/chakra-ui/commit/445661955dff1329156b535ef50c7cf27b8663a9)
97
+ Thanks [@anubra266](https://github.com/anubra266)! - - Initial release of
98
+ react hooks
99
+ - Refactor all packages to reduce bundle size
100
+ - Refactor code for proper prop doc generatation
101
+ - Updated dependencies
102
+ [[`445661955`](https://github.com/chakra-ui/chakra-ui/commit/445661955dff1329156b535ef50c7cf27b8663a9)]:
103
+ - @chakra-ui/icons@2.0.9
104
+
105
+ ## 4.0.8
106
+
107
+ ### Patch Changes
108
+
109
+ - Force release
110
+
111
+ - Updated dependencies []:
112
+ - @chakra-ui/icons@2.0.8
113
+
114
+ ## 4.0.7
115
+
116
+ ### Patch Changes
117
+
118
+ - [`3dc27e05e`](https://github.com/chakra-ui/chakra-ui/commit/3dc27e05e97a1320c4400de6a03feb787160eafb)
119
+ Thanks [@segunadebayo](https://github.com/segunadebayo)! - Fix issue with
120
+ nullish operator in storybook
121
+
122
+ - Updated dependencies []:
123
+ - @chakra-ui/icons@2.0.7
124
+
125
+ ## 4.0.6
126
+
127
+ ### Patch Changes
128
+
129
+ - Force new release
130
+
131
+ - Updated dependencies []:
132
+ - @chakra-ui/icons@2.0.6
133
+
134
+ ## 4.0.5
135
+
136
+ ### Patch Changes
137
+
138
+ - [#6356](https://github.com/chakra-ui/chakra-ui/pull/6356)
139
+ [`1839e22eb`](https://github.com/chakra-ui/chakra-ui/commit/1839e22ebad1c2a52795eac5fd0b3eb38ae03f9c)
140
+ Thanks [@segunadebayo](https://github.com/segunadebayo)! - - Force release due
141
+ to change in build configuration
142
+ - Update package `main` and `module` entries
143
+ - Updated dependencies
144
+ [[`1839e22eb`](https://github.com/chakra-ui/chakra-ui/commit/1839e22ebad1c2a52795eac5fd0b3eb38ae03f9c)]:
145
+ - @chakra-ui/icons@2.0.5
146
+
147
+ ## 4.0.4
148
+
149
+ ### Patch Changes
150
+
151
+ - Updated dependencies []:
152
+ - @chakra-ui/react@2.2.4
153
+ - @chakra-ui/icons@2.0.4
154
+
155
+ ## 4.0.3
156
+
157
+ ### Patch Changes
158
+
159
+ - Updated dependencies []:
160
+ - @chakra-ui/react@2.2.3
161
+ - @chakra-ui/icons@2.0.3
162
+
163
+ ## 4.0.2
164
+
165
+ ### Patch Changes
166
+
167
+ - Updated dependencies
168
+ [[`612529653`](https://github.com/chakra-ui/chakra-ui/commit/61252965371f1abc5bc6680c14bbd08f97667ea9)]:
169
+ - @chakra-ui/react@2.2.2
170
+
171
+ ## 4.0.1
172
+
173
+ ### Patch Changes
174
+
175
+ - Updated dependencies []:
176
+ - @chakra-ui/react@2.2.1
177
+
178
+ ## 4.0.0
179
+
180
+ ### Patch Changes
181
+
182
+ - [`06f29f8cd`](https://github.com/chakra-ui/chakra-ui/commit/06f29f8cdbb10ff1da523e0d0e958b9990d041e1)
183
+ Thanks [@segunadebayo](https://github.com/segunadebayo)! - Bump all packages
184
+ to resolve deps issues
185
+
186
+ * [#6152](https://github.com/chakra-ui/chakra-ui/pull/6152)
187
+ [`06a09312a`](https://github.com/chakra-ui/chakra-ui/commit/06a09312a5c776350a81e099106be9afda5e8cdd)
188
+ Thanks [@itkrt2y](https://github.com/itkrt2y)! - Update storybook dependency
189
+
190
+ * Updated dependencies
191
+ [[`400a2091a`](https://github.com/chakra-ui/chakra-ui/commit/400a2091a9463cedb697b32d1ff182c238cd4754),
192
+ [`06f29f8cd`](https://github.com/chakra-ui/chakra-ui/commit/06f29f8cdbb10ff1da523e0d0e958b9990d041e1)]:
193
+ - @chakra-ui/react@2.2.0
194
+ - @chakra-ui/icons@2.0.2
195
+
196
+ ## 3.0.2
197
+
198
+ ### Patch Changes
199
+
200
+ - Updated dependencies []:
201
+ - @chakra-ui/react@2.1.2
202
+
203
+ ## 3.0.1
204
+
205
+ ### Patch Changes
206
+
207
+ - Updated dependencies
208
+ [[`e8cce77b2`](https://github.com/chakra-ui/chakra-ui/commit/e8cce77b27714277db576b45d03d2570d590ab8e)]:
209
+ - @chakra-ui/react@2.1.1
210
+ - @chakra-ui/icons@2.0.1
211
+
212
+ ## 3.0.0
213
+
214
+ ### Patch Changes
215
+
216
+ - Updated dependencies
217
+ [[`3319eca8b`](https://github.com/chakra-ui/chakra-ui/commit/3319eca8bf02b892ea345a68294110919e2963cb),
218
+ [`ddea8d143`](https://github.com/chakra-ui/chakra-ui/commit/ddea8d143e76c0e4758e6ea4b4d881f88b34452d)]:
219
+ - @chakra-ui/react@2.1.0
220
+
221
+ ## 2.0.2
222
+
223
+ ### Patch Changes
224
+
225
+ - Updated dependencies []:
226
+ - @chakra-ui/react@2.0.2
227
+
228
+ ## 2.0.1
229
+
230
+ ### Patch Changes
231
+
232
+ - Updated dependencies []:
233
+ - @chakra-ui/react@2.0.1
234
+
235
+ ## 2.0.0
236
+
237
+ ### Major Changes
238
+
239
+ - [#5879](https://github.com/chakra-ui/chakra-ui/pull/5879)
240
+ [`c390af485`](https://github.com/chakra-ui/chakra-ui/commit/c390af4859bcbcf12c982c677492cd6d4960889f)
241
+ Thanks [@TimKolberger](https://github.com/TimKolberger)! - Bump all packages
242
+ to next major for Chakra UI version 2.
243
+
244
+ * [#5989](https://github.com/chakra-ui/chakra-ui/pull/5989)
245
+ [`ed692c0ae`](https://github.com/chakra-ui/chakra-ui/commit/ed692c0ae670bcac92b3da50d141afc6e233dee7)
246
+ Thanks [@TimKolberger](https://github.com/TimKolberger)! - Omit `src`
247
+ directory from being published to npm
248
+
249
+ - [#5922](https://github.com/chakra-ui/chakra-ui/pull/5922)
250
+ [`9b3f71ed3`](https://github.com/chakra-ui/chakra-ui/commit/9b3f71ed358f8e0f5a795a02a861a13fa966b341)
251
+ Thanks [@TimKolberger](https://github.com/TimKolberger)! - Bumped the
252
+ supported version of storybook to >6.4 to support other bundlers than webpack.
253
+
254
+ Disable the new Storybook feature flag `emotionAlias` to prevent version
255
+ mismatch issues with emotion:
256
+
257
+ ```js live=false
258
+ module.exports = {
259
+ addons: ['@chakra-ui/storybook-addon'],
260
+ features: {
261
+ emotionAlias: false,
262
+ },
263
+ }
264
+ ```
265
+
266
+ The ColorMode Toggle moved to the Storybook toolbar together with a new layout
267
+ direction toggle (ltr/rtl).
268
+
269
+ A new helper function extracts the ArgTypes for a given Chakra UI component.
270
+ You can quickly preview all variants, sizes and colorSchemes of your
271
+ components which are present in your Chakra UI Theme.
272
+
273
+ ```tsx
274
+ // button.stories.tsx
275
+ import { getThemingArgTypes } from '@chakra-ui/storybook-addon'
276
+ import { theme } from '<your-theme>'
277
+
278
+ export default {
279
+ title: 'Components / Forms / Button',
280
+ argTypes: getThemingArgTypes(theme, 'Button'),
281
+ }
282
+
283
+ interface StoryProps extends ThemingProps<'Button'> {}
284
+
285
+ export const Basic: StoryFn<StoryProps> = (props) => (
286
+ <Button {...props}>Button</Button>
287
+ )
288
+ ```
289
+
290
+ * [#5882](https://github.com/chakra-ui/chakra-ui/pull/5882)
291
+ [`41b3119f5`](https://github.com/chakra-ui/chakra-ui/commit/41b3119f59226f7c70942d6fd0f46480f9bcf196)
292
+ Thanks [@TimKolberger](https://github.com/TimKolberger)! - Bump peer
293
+ dependency to React and ReactDOM to >=18
294
+
295
+ ### Minor Changes
296
+
297
+ - [#5922](https://github.com/chakra-ui/chakra-ui/pull/5922)
298
+ [`9b3f71ed3`](https://github.com/chakra-ui/chakra-ui/commit/9b3f71ed358f8e0f5a795a02a861a13fa966b341)
299
+ Thanks [@TimKolberger](https://github.com/TimKolberger)! - Replace the button
300
+ on the corner with a toggle tool
301
+
302
+ ### Patch Changes
303
+
304
+ - [#5990](https://github.com/chakra-ui/chakra-ui/pull/5990)
305
+ [`dfc759a5e`](https://github.com/chakra-ui/chakra-ui/commit/dfc759a5eae79b6147a0dfcbafb71ea398021861)
306
+ Thanks [@TimKolberger](https://github.com/TimKolberger)! - Fixed an issue
307
+ where the storybook addon did not use the default theme if none was provided
308
+ - Updated dependencies
309
+ [[`c390af485`](https://github.com/chakra-ui/chakra-ui/commit/c390af4859bcbcf12c982c677492cd6d4960889f),
310
+ [`ed692c0ae`](https://github.com/chakra-ui/chakra-ui/commit/ed692c0ae670bcac92b3da50d141afc6e233dee7),
311
+ [`c7a1a53ac`](https://github.com/chakra-ui/chakra-ui/commit/c7a1a53ace53020e23c1b92d48ff16d8d8e95709),
312
+ [`41b3119f5`](https://github.com/chakra-ui/chakra-ui/commit/41b3119f59226f7c70942d6fd0f46480f9bcf196)]:
313
+ - @chakra-ui/icons@2.0.0
314
+ - @chakra-ui/react@2.0.0
315
+
316
+ ## 2.0.0-next.5
317
+
318
+ ### Major Changes
319
+
320
+ - [#5989](https://github.com/chakra-ui/chakra-ui/pull/5989)
321
+ [`ed692c0ae`](https://github.com/chakra-ui/chakra-ui/commit/ed692c0ae670bcac92b3da50d141afc6e233dee7)
322
+ Thanks [@TimKolberger](https://github.com/TimKolberger)! - Omit `src`
323
+ directory from being published to npm
324
+
325
+ ### Patch Changes
326
+
327
+ - [#5990](https://github.com/chakra-ui/chakra-ui/pull/5990)
328
+ [`dfc759a5e`](https://github.com/chakra-ui/chakra-ui/commit/dfc759a5eae79b6147a0dfcbafb71ea398021861)
329
+ Thanks [@TimKolberger](https://github.com/TimKolberger)! - Fixed an issue
330
+ where the storybook addon did not use the default theme if none was provided
331
+ - Updated dependencies
332
+ [[`ed692c0ae`](https://github.com/chakra-ui/chakra-ui/commit/ed692c0ae670bcac92b3da50d141afc6e233dee7)]:
333
+ - @chakra-ui/icons@2.0.0-next.2
334
+ - @chakra-ui/react@2.0.0-next.5
335
+
336
+ ## 2.0.0-next.4
337
+
338
+ ### Major Changes
339
+
340
+ - [#5922](https://github.com/chakra-ui/chakra-ui/pull/5922)
341
+ [`9b3f71ed3`](https://github.com/chakra-ui/chakra-ui/commit/9b3f71ed358f8e0f5a795a02a861a13fa966b341)
342
+ Thanks [@TimKolberger](https://github.com/TimKolberger)! - Bumped the
343
+ supported version of storybook to >6.4 to support other bundlers than webpack.
344
+
345
+ Disable the new Storybook feature flag `emotionAlias` to prevent version
346
+ mismatch issues with emotion:
347
+
348
+ ```js live=false
349
+ module.exports = {
350
+ addons: ['@chakra-ui/storybook-addon'],
351
+ features: {
352
+ emotionAlias: false,
353
+ },
354
+ }
355
+ ```
356
+
357
+ The ColorMode Toggle moved to the Storybook toolbar together with a new layout
358
+ direction toggle (ltr/rtl).
359
+
360
+ A new helper function extracts the ArgTypes for a given Chakra UI component.
361
+ You can quickly preview all variants, sizes and colorSchemes of your
362
+ components which are present in your Chakra UI Theme.
363
+
364
+ ```tsx
365
+ // button.stories.tsx
366
+ import { getThemingArgTypes } from '@chakra-ui/storybook-addon'
367
+ import { theme } from '<your-theme>'
368
+
369
+ export default {
370
+ title: 'Components / Forms / Button',
371
+ argTypes: getThemingArgTypes(theme, 'Button'),
372
+ }
373
+
374
+ interface StoryProps extends ThemingProps<'Button'> {}
375
+
376
+ export const Basic: StoryFn<StoryProps> = (props) => (
377
+ <Button {...props}>Button</Button>
378
+ )
379
+ ```
380
+
381
+ ### Minor Changes
382
+
383
+ - [#5922](https://github.com/chakra-ui/chakra-ui/pull/5922)
384
+ [`9b3f71ed3`](https://github.com/chakra-ui/chakra-ui/commit/9b3f71ed358f8e0f5a795a02a861a13fa966b341)
385
+ Thanks [@TimKolberger](https://github.com/TimKolberger)! - Replace the button
386
+ on the corner with a toggle tool
387
+
388
+ ### Patch Changes
389
+
390
+ - Updated dependencies []:
391
+ - @chakra-ui/react@2.0.0-next.4
392
+
393
+ ## 2.0.0-next.3
394
+
395
+ ### Patch Changes
396
+
397
+ - Updated dependencies []:
398
+ - @chakra-ui/react@2.0.0-next.3
399
+
400
+ ## 2.0.0-next.2
401
+
402
+ ### Major Changes
403
+
404
+ - [#5882](https://github.com/chakra-ui/chakra-ui/pull/5882)
405
+ [`41b3119f5`](https://github.com/chakra-ui/chakra-ui/commit/41b3119f59226f7c70942d6fd0f46480f9bcf196)
406
+ Thanks [@TimKolberger](https://github.com/TimKolberger)! - Bump peer
407
+ depencency to React and ReactDOM to >=18
408
+
409
+ ### Patch Changes
410
+
411
+ - Updated dependencies
412
+ [[`41b3119f5`](https://github.com/chakra-ui/chakra-ui/commit/41b3119f59226f7c70942d6fd0f46480f9bcf196)]:
413
+ - @chakra-ui/icons@2.0.0-next.1
414
+ - @chakra-ui/react@2.0.0-next.2
415
+
416
+ ## 2.0.0-next.1
417
+
418
+ ### Major Changes
419
+
420
+ - [#5879](https://github.com/chakra-ui/chakra-ui/pull/5879)
421
+ [`c390af485`](https://github.com/chakra-ui/chakra-ui/commit/c390af4859bcbcf12c982c677492cd6d4960889f)
422
+ Thanks [@TimKolberger](https://github.com/TimKolberger)! - Bump all packages
423
+ to next major for Chakra UI version 2.
424
+
425
+ ### Patch Changes
426
+
427
+ - Updated dependencies
428
+ [[`c390af485`](https://github.com/chakra-ui/chakra-ui/commit/c390af4859bcbcf12c982c677492cd6d4960889f)]:
429
+ - @chakra-ui/icons@2.0.0-next.0
430
+ - @chakra-ui/react@2.0.0-next.1
431
+
432
+ ## 2.0.0-next.0
433
+
434
+ ### Patch Changes
435
+
436
+ - Updated dependencies
437
+ [[`c7a1a53ac`](https://github.com/chakra-ui/chakra-ui/commit/c7a1a53ace53020e23c1b92d48ff16d8d8e95709)]:
438
+ - @chakra-ui/react@2.0.0-next.0
439
+
440
+ ## 1.0.3
441
+
442
+ ### Patch Changes
443
+
444
+ - [`e1fe48cbe`](https://github.com/chakra-ui/chakra-ui/commit/e1fe48cbe37324744cfe6184d785c093cda1125e)
445
+ Thanks [@TimKolberger](https://github.com/TimKolberger)! - Bumped patch
446
+ version for every package to fix release process. Root cause was a bug in our
447
+ CI configuration.
448
+ - Updated dependencies
449
+ [[`e1fe48cbe`](https://github.com/chakra-ui/chakra-ui/commit/e1fe48cbe37324744cfe6184d785c093cda1125e)]:
450
+ - @chakra-ui/icons@1.1.7
451
+
452
+ ## 1.0.2
453
+
454
+ ### Patch Changes
455
+
456
+ - [#5536](https://github.com/chakra-ui/chakra-ui/pull/5536)
457
+ [`a503acabe`](https://github.com/chakra-ui/chakra-ui/commit/a503acabefcaea86cb7f40a6305830f09d2d6083)
458
+ Thanks [@TimKolberger](https://github.com/TimKolberger)! - Bumped patch
459
+ version for every package to fix release process.
460
+
461
+ - Updated dependencies
462
+ [[`a503acabe`](https://github.com/chakra-ui/chakra-ui/commit/a503acabefcaea86cb7f40a6305830f09d2d6083)]:
463
+ - @chakra-ui/icons@1.1.5
464
+
465
+ ## 1.0.1
466
+
467
+ ### Patch Changes
468
+
469
+ - [#5340](https://github.com/chakra-ui/chakra-ui/pull/5340)
470
+ [`ab247507a`](https://github.com/chakra-ui/chakra-ui/commit/ab247507ab6d30be356b657f652331801e880e52)
471
+ Thanks [@TimKolberger](https://github.com/TimKolberger)! - Added dependency to
472
+ @chakra-ui/icons
473
+
474
+ ## 1.0.0
475
+
476
+ ### Major Changes
477
+
478
+ - [#5126](https://github.com/chakra-ui/chakra-ui/pull/5126)
479
+ [`712cc3d1e`](https://github.com/chakra-ui/chakra-ui/commit/712cc3d1e6193ec7d98d195abdb124809f9b9b06)
480
+ Thanks [@ngxCoder](https://github.com/ngxCoder)! - The official Storybook
481
+ Addon for Chakra UI.
482
+
483
+ ```sh
484
+ yarn add -D @chakra-ui/storybook-addon
485
+ ```
486
+
487
+ ```sh
488
+ npm i -D @chakra-ui/storybook-addon
489
+ ```
490
+
491
+ Add the addon to your configuration in `.storybook/main.js`:
492
+
493
+ ```js live=false
494
+ module.exports = {
495
+ addons: ['@chakra-ui/storybook-addon'],
496
+ }
497
+ ```
package/README.md ADDED
@@ -0,0 +1,97 @@
1
+ # @chakra-ui/storybook-addon
2
+
3
+ Use Chakra UI in your Storybook stories.
4
+
5
+ This Plugin wraps each of your stories with [`ChakraProvider`][chakraprovider]
6
+ which can be configured using Storybook parameters.
7
+
8
+ ## Installation
9
+
10
+ ### yarn
11
+
12
+ ```sh
13
+ yarn add -D @chakra-ui/storybook-addon
14
+ ```
15
+
16
+ ### npm
17
+
18
+ ```sh
19
+ npm i -D @chakra-ui/storybook-addon
20
+ ```
21
+
22
+ Add the addon to your configuration in `.storybook/main.js` and disable the
23
+ emotion alias (available with Storybook >6.4).
24
+
25
+ ```js
26
+ module.exports = {
27
+ addons: ['@chakra-ui/storybook-addon'],
28
+ features: {
29
+ emotionAlias: false,
30
+ },
31
+ }
32
+ ```
33
+
34
+ ## Configuring `ChakraProvider`
35
+
36
+ If you need to customize the props passed to `ChakraProvider` for your stories
37
+ (to use a custom `theme`, for example), you'll need to create custom Storybook
38
+ parameters.
39
+
40
+ To set global parameters for this addon, add a `chakra` object to the
41
+ `parameters` export in `.storybook/preview.js`:
42
+
43
+ ```js
44
+ import myTheme from '../theme'
45
+
46
+ export const parameters = {
47
+ chakra: {
48
+ theme: myTheme,
49
+ },
50
+ }
51
+ ```
52
+
53
+ The `chakra` parameters take the same shape as the `props` for `ChakraProvider`.
54
+ [See the `ChakraProvider` props table][chakraprovider] to see the list of
55
+ possible parameters.
56
+
57
+ ### Overriding `ChakraProvider` configuration for individual components or stories
58
+
59
+ Storybook allows you to define parameters at multiple levels: global, component,
60
+ and story. We recommend setting default parameters at the global level, and
61
+ overriding them at the component or story when necessary. See the
62
+ [Storybook Parameters documentation](https://storybook.js.org/docs/react/writing-stories/parameters)
63
+ for more information.
64
+
65
+ ## Color Mode Tool
66
+
67
+ You will be able to toggle your color mode with the button in the toolbar. It
68
+ tries to sync with your theme through the localstorage key.
69
+
70
+ ## Story Controls for Theme Components
71
+
72
+ Get controls for the theming props `variant`, `size` and `colorScheme` in your
73
+ stories with `getThemingArgTypes(theme, componentName)`.
74
+
75
+ ```tsx
76
+ import { Meta, StoryFn } from '@storybook/react'
77
+ import { getThemingArgTypes } from '@chakra-ui/storybook-addon'
78
+ import { theme } from '<your-theme>'
79
+
80
+ export default {
81
+ title: 'Components / Forms / Button',
82
+ // get controls for `variant`, `size` and `colorScheme`
83
+ argTypes: getThemingArgTypes(theme, 'Button'),
84
+ } as Meta
85
+
86
+ interface StoryProps extends ThemingProps<'Button'> {}
87
+
88
+ export const Basic: StoryFn<StoryProps> = (props) => (
89
+ <Button {...props}>Button</Button>
90
+ )
91
+ ```
92
+
93
+ This will render input fields to choose the theming prop values:
94
+
95
+ ![Storybook screenshot with controls tab](theming-arg-types.png)
96
+
97
+ [chakraprovider]: https://chakra-ui.com/docs/getting-started#chakraprovider-props