/* eslint-disable */ import type { ElementType, JSX, ComponentPropsWithRef, ComponentType, Component } from 'react' import type { RecipeDefinition, RecipeSelection, RecipeVariantRecord } from './recipe'; import type { Assign, DistributiveOmit, DistributiveUnion, JsxHTMLProps, JsxStyleProps, Pretty } from './system-types'; interface Dict { [k: string]: unknown } export type DataAttrs = Record<`data-${string}`, unknown> export interface UnstyledProps { /** * Whether to remove recipe styles */ unstyled?: boolean | undefined } export interface AsProps { /** * The element to render as */ as?: ElementType | undefined } export type ComponentProps = T extends ComponentType | Component ? JSX.LibraryManagedAttributes : ComponentPropsWithRef export interface StyledComponent { (props: JsxHTMLProps & UnstyledProps & AsProps, Assign>): JSX.Element displayName?: string | undefined } interface RecipeFn { __type: any } export interface JsxFactoryOptions { dataAttr?: boolean defaultProps?: Partial & DataAttrs shouldForwardProp?: (prop: string, variantKeys: string[]) => boolean /** * Used when creating styled components from React components that do not support the css prop. If true, the css prop will be consumed and converted to `className` * @example * import { ark } from "@ark-ui/react/factory" * import { styled } from "@ndla/styled-system/jsx" * const Button = styled(ark.button, { baseComponent: true }) */ baseComponent?: boolean forwardProps?: string[] } export type JsxRecipeProps = JsxHTMLProps & UnstyledProps & AsProps, P>; export type JsxElement = T extends StyledComponent ? StyledComponent>> : StyledComponent export interface JsxFactory { (component: T): StyledComponent (component: T, recipe: RecipeDefinition

, options?: JsxFactoryOptions>>): JsxElement< T, RecipeSelection

> (component: T, recipeFn: P, options?: JsxFactoryOptions>): JsxElement } export type JsxElements = { [K in keyof JSX.IntrinsicElements]: StyledComponent } export type Styled = JsxFactory & JsxElements export type HTMLStyledProps = JsxHTMLProps & UnstyledProps & AsProps, JsxStyleProps> export interface StyledProps extends UnstyledProps, AsProps, JsxStyleProps {} export type StyledVariantProps> = T extends StyledComponent ? Props : never