sepidnes's picture
Add RAG implementation with backend, frontend and aimakerspace
56fda74
raw
history blame
1.01 kB
import { Theme } from '@emotion/react'
import styled from './base'
import { ReactJSXIntrinsicElements } from './jsx-namespace'
import { tags } from './tags'
import {
CreateStyledComponent,
CreateStyled as BaseCreateStyled
} from './types'
export type {
ArrayInterpolation,
ComponentSelector,
CSSObject,
FunctionInterpolation,
Interpolation
} from '@emotion/serialize'
export type {
CreateStyledComponent,
FilteringStyledOptions,
StyledComponent,
StyledOptions
} from './types'
export type StyledTags = {
[Tag in keyof ReactJSXIntrinsicElements]: CreateStyledComponent<
{
theme?: Theme
as?: React.ElementType
},
ReactJSXIntrinsicElements[Tag]
>
}
export interface CreateStyled extends BaseCreateStyled, StyledTags {}
// bind it to avoid mutating the original function
const newStyled = styled.bind(null) as CreateStyled
tags.forEach(tagName => {
;(newStyled as any)[tagName] = newStyled(tagName as keyof typeof newStyled)
})
export default newStyled