@@ -43,7 +43,7 @@ export const cleanCommonProps = <
4343 return { ...innerProps } ;
4444} ;
4545
46- /** A typeguard to ensure the default size on the Input component is valid. */
46+ /** A type guard to ensure the default size on the Input component is valid. */
4747const isSize = ( size : unknown ) : size is Size => {
4848 const isString = typeof size === "string" ;
4949 return isString && [ "sm" , "md" , "lg" ] . includes ( size ) ;
@@ -70,17 +70,16 @@ const getDefaultSize = (size: unknown): Size => {
7070export const useSize = ( size : SizeProp | undefined ) : Size => {
7171 const chakraContext = useChakraContext ( ) ;
7272 const defaultSize = getDefaultSize (
73- // TODO: This doesn't seem to work as expected
74- chakraContext . getSlotRecipe ( "select" ) ?. defaultSize
73+ chakraContext . getSlotRecipe ( "select" ) ?. defaultVariants ?. size
7574 ) ;
7675
7776 // Ensure that the size used is one of the options, either `sm`, `md`, or `lg`
78- const definedSize = size ?? defaultSize ;
7977 // Or, if a breakpoint is passed, get the size based on the current screen size
80- return (
81- // @ts -expect-error - I'm not sure why this is throwing an error - TODO: Figure this out
82- useBreakpointValue ( definedSize , { fallback : defaultSize } ) ?? defaultSize
83- ) ;
78+ const responsiveSize = ( typeof size === "string" ? [ size ] : size ) ?? [
79+ defaultSize ,
80+ ] ;
81+
82+ return useBreakpointValue ( responsiveSize ) ?? defaultSize ;
8483} ;
8584
8685export function useColorMode ( ) {
0 commit comments