diff --git a/src/lib/Box/Box.tsx b/src/lib/Box/Box.tsx index 5738f5b9..6c160138 100644 --- a/src/lib/Box/Box.tsx +++ b/src/lib/Box/Box.tsx @@ -6,9 +6,11 @@ import type { CssProperties } from '../utils'; const Div = styled('div', {}); /** Not all properties supported */ -type Props = StitchesProps & +type Props = Omit, 'as'> & { [prop in typeof acceptedProperties[number]]?: CssProperties[prop]; + } & { + as?: JSX.IntrinsicElements | React.ElementType; }; const Box: React.FC = ({ children, css, ...props }) => { diff --git a/src/lib/Button/Button.tsx b/src/lib/Button/Button.tsx index ab1b6de0..4470b979 100644 --- a/src/lib/Button/Button.tsx +++ b/src/lib/Button/Button.tsx @@ -3,7 +3,6 @@ import React from 'react'; import { styled } from '../stitches.config'; import { FlexBox, FlexType } from '../Flex'; import { IconBox } from '../Icon/Icon'; -import { StitchesProps } from '@stitches/react'; const ButtonRoot = styled(FlexBox as FlexType<'button'>, { 'transition': '0.2s ease-in-out', @@ -131,8 +130,8 @@ const ButtonRoot = styled(FlexBox as FlexType<'button'>, { }, }); -const Button = React.forwardRef>( - ({ variant = 'primary', size = 'md', space = '$2', css, style, className, as = 'button', ...props }, ref) => { +const Button = React.forwardRef>( + ({ variant = 'primary', size = 'md', space = '$2', css, style, className, ...props }, ref) => { return (