Skip to content

Commit 2a5ee7a

Browse files
committed
fix type
1 parent 7354f37 commit 2a5ee7a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

.storybook/types.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { ThemingProps } from "@chakra-ui/react"
1+
import type { StyleConfig, ThemingProps } from "@chakra-ui/react"
22
import type { ArgTypes } from "@storybook/react"
33

44
// Type declarations below pulled directly from `@chakra-ui/storybook-addon`
@@ -49,10 +49,10 @@ export type ThemingArgTypeKey = "variant" | "size"
4949
* @param componentName component name to create the ArgTypes for
5050
*/
5151
export function getThemingArgTypes<
52-
Theme extends Record<string, unknown>,
52+
Theme extends Record<string, unknown> & { components?: Record<string, StyleConfig> },
5353
ComponentName extends KeyOf<Theme["components"]>
5454
>(theme: Theme, componentName: ComponentName) {
55-
const component = theme.components[componentName]
55+
const component = theme.components?.[componentName]
5656
if (!component) {
5757
return undefined
5858
}

0 commit comments

Comments
 (0)