welcome-ui
Version:
Customizable design system with react • styled-components • styled-system and ariakit.
22 lines (21 loc) • 1.23 kB
TypeScript
import { SystemProps } from '@xstyled/styled-components';
import { PropsWithoutRef, default as React } from 'react';
export declare const shouldForwardProp: (prop: string) => boolean;
export type As<Props = any> = React.ElementType<Props>;
export type CreateWuiComponent<Component extends As, Options = {}> = {
<AsComponent extends As>(props: CreateWuiProps<AsComponent, Options> & {
as: AsComponent;
}): JSX.Element;
(props: CreateWuiProps<Component, Options>): JSX.Element;
displayName?: string;
};
export type CreateWuiProps<Component extends As, Props = {}> = MergeProps<Omit<React.ComponentProps<Component>, keyof WuiProps>, Props, WuiProps & WuiTestProps & {
as?: As;
}>;
export type MergeProps<ComponentProps, Props, WuiProps> = RightJoinProps<ComponentProps, Props> & RightJoinProps<WuiProps, Props>;
export type RightJoinProps<SourceProps, OverrideProps> = Omit<SourceProps, keyof OverrideProps> & OverrideProps;
export type WuiProps = SystemProps;
export interface WuiTestProps {
dataTestId?: string;
}
export declare const forwardRef: <Component extends As, Props = {}>(component: React.ForwardRefRenderFunction<any, PropsWithoutRef<Props>>) => CreateWuiComponent<Component, Props>;