File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 1
- import type { ThemingProps } from "@chakra-ui/react"
1
+ import type { StyleConfig , ThemingProps } from "@chakra-ui/react"
2
2
import type { ArgTypes } from "@storybook/react"
3
3
4
4
// Type declarations below pulled directly from `@chakra-ui/storybook-addon`
@@ -49,10 +49,10 @@ export type ThemingArgTypeKey = "variant" | "size"
49
49
* @param componentName component name to create the ArgTypes for
50
50
*/
51
51
export function getThemingArgTypes <
52
- Theme extends Record < string , unknown > ,
52
+ Theme extends Record < string , unknown > & { components ?: Record < string , StyleConfig > } ,
53
53
ComponentName extends KeyOf < Theme [ "components" ] >
54
54
> ( theme : Theme , componentName : ComponentName ) {
55
- const component = theme . components [ componentName ]
55
+ const component = theme . components ?. [ componentName ]
56
56
if ( ! component ) {
57
57
return undefined
58
58
}
You can’t perform that action at this time.
0 commit comments