diff --git a/packages/test/index.tsx b/packages/test/index.tsx index 69365642..d0e33115 100644 --- a/packages/test/index.tsx +++ b/packages/test/index.tsx @@ -13,6 +13,8 @@ const { config, styled } = Stitches.createStitches({ }, }) +type CSS = Stitches.CSS + // --------------------------------------------------------------------------- // INSTRUCTIONS: // Test cases are below. @@ -25,7 +27,7 @@ const { config, styled } = Stitches.createStitches({ // USE CASE 1 // --------------------------------------------------------------------------- -const StyledStatus = styled('span', { +const Component1 = styled('button', { color: '$', // we should see `$red100` here variants: { mySize: { @@ -34,14 +36,28 @@ const StyledStatus = styled('span', { }, }) -export const Status: React.ForwardRefExoticComponent> = React.forwardRef( +export const ForwardComponent1: React.ForwardRefExoticComponent> = React.forwardRef( (props, forwardedRef) => { - return + return } ) export default function Home() { - return { }} css={{color: '$'}} mySize="myLarge" /> // we should see `$red100` here + return { + void event // we should see `React.MouseEvent` here + }} + mySize="myLarge" + css={{ + color: '$', // we should see `$red100` here + '&:hover': { + color: '$', // we should see `$red100` here + '&:hover': { + color: '$', // we should see `$red100` here + }, + }, + }} + /> } // --------------------------------------------------------------------------- @@ -49,38 +65,47 @@ export default function Home() { // Uncomment to test // --------------------------------------------------------------------------- -// type CSS = Stitches.CSS - -// const shared: CSS = { -// color: '$red100' -// } +const sharedStylesForComponent2: CSS = { + color: '$', // we should see `$red100` here + '&:hover': { + color: '$', // we should see `$red100` here + '&:hover': { + color: '$', // we should see `$red100` here + }, + }, +} -// const Text = styled('span', shared) +export const Component2 = styled('span', sharedStylesForComponent2) // --------------------------------------------------------------------------- // USE CASE 3 // --------------------------------------------------------------------------- -// type CSS = Stitches.CSS - -// const StyledStatus = styled('span', { -// color: '$', // we should see `$red100` here -// variants: { -// mySize: { -// myLarge: {}, -// }, -// }, -// }) +export const Component3 = styled('span', { + color: '$', // we should see `$red100` here + variants: { + mySize: { + myLarge: {}, + }, + }, +}) -// type StatusVariants = Stitches.VariantProps; -// type StatusProps = { css?: CSS, children?: React.ReactNode } & StatusVariants; +export type Component3Variants = Stitches.VariantProps; +export type Component3Props = { css?: CSS, children?: React.ReactNode } & Component3Variants; -// export const Status = React.forwardRef( -// (props, forwardedRef) => { -// return -// } -// ) +export const ForwardComponent3 = React.forwardRef( + (props, forwardedRef) => { + return + } +) -// export default function Home() { -// return // we should see `$red100` here and `mySize` variant -// } +export function TestForwardComponent3() { + return ( + + ) +}