diff --git a/react/src/components/Box.tsx b/react/src/components/Box.tsx index 30e52532..003c2fa7 100644 --- a/react/src/components/Box.tsx +++ b/react/src/components/Box.tsx @@ -1,6 +1,8 @@ import { styled } from '../stitches.config' import type { VariantProps } from '../utils' -export const Box = styled('div') +export const Box = styled('div', { + display: 'block' +}) export type BoxProps = VariantProps diff --git a/react/src/components/Flex.tsx b/react/src/components/Flex.tsx index f24187bc..8507eba2 100644 --- a/react/src/components/Flex.tsx +++ b/react/src/components/Flex.tsx @@ -13,4 +13,7 @@ export const Flex = styled(Box, { } }) -export type FlexVariant = VariantProps +export type FlexProps = VariantProps + +// FIXME[1.0]: remove this alias +export type FlexVariant = FlexProps diff --git a/react/src/utils.tsx b/react/src/utils.tsx index 20b61f00..61f610a5 100644 --- a/react/src/utils.tsx +++ b/react/src/utils.tsx @@ -1,4 +1,8 @@ -import React, { Component, ComponentProps, ComponentType } from 'react' +import React, { ComponentProps, ComponentType } from 'react' + +// XXX: export type { VariantProps } from '@stitches/react' + +export type VariantProps = JSX.IntrinsicAttributes & (T extends ComponentType ? ComponentProps : T) export function identity (v: any) { return v @@ -21,5 +25,3 @@ export function withFixedProps ( return } } - -export type VariantProps : T> = T & JSX.IntrinsicAttributes