File tree Expand file tree Collapse file tree 2 files changed +26
-3
lines changed
Expand file tree Collapse file tree 2 files changed +26
-3
lines changed Original file line number Diff line number Diff line change 11'use client'
22
3- import { Box , css , Text } from '@devup-ui/react'
3+ import { Box , css , styled , Text } from '@devup-ui/react'
44import { useState } from 'react'
5+ const color = 'yellow'
6+
7+ const StyledFooter = styled . footer < { type : '1' | '2' } > `
8+ background-color: ${ color } ;
9+ color: ${ ( props ) => ( props . type === '1' ? 'red' : 'white' ) } ;
10+ `
511
612export default function HomePage ( ) {
713 const [ color , setColor ] = useState ( 'yellow' )
814 const [ enabled , setEnabled ] = useState ( false )
915
1016 return (
1117 < div >
18+ < StyledFooter type = "2" > IMPLEMENTATION~</ StyledFooter >
1219 < p
1320 style = { {
1421 backgroundColor : 'blue' ,
Original file line number Diff line number Diff line change @@ -5,13 +5,29 @@ interface StyledCreator {
55 tag : T ,
66 ) : (
77 strings : TemplateStringsArray | DevupPropsWithTheme ,
8+ ...values : (
9+ | ( ( props : React . ComponentProps < T > ) => unknown )
10+ | string
11+ | number
12+ | boolean
13+ | null
14+ | undefined
15+ ) [ ] [ ]
816 ) => ( props : React . ComponentProps < T > ) => React . ReactElement
917}
1018
1119type Styled = StyledCreator & {
12- [ T in keyof React . JSX . IntrinsicElements ] : < P extends React . ComponentProps < T > > (
20+ [ T in keyof React . JSX . IntrinsicElements ] : < P > (
1321 strings : TemplateStringsArray | DevupPropsWithTheme ,
14- ) => ( props : P ) => React . ReactElement
22+ ...values : (
23+ | ( ( props : P & React . ComponentProps < T > ) => unknown )
24+ | string
25+ | number
26+ | boolean
27+ | null
28+ | undefined
29+ ) [ ]
30+ ) => ( props : P & React . ComponentProps < T > ) => React . ReactElement
1531}
1632
1733export const styled : Styled = new Proxy ( Function . prototype , {
You can’t perform that action at this time.
0 commit comments