import { Alert as ChakraAlert, Box as ChakraBox, Button as ChakraButton, Center as ChakraCenter, HStack as ChakraHStack, Icon as ChakraIcon, Input as ChakraInput, Spinner as ChakraSpinner, Stack as ChakraStack, Text as ChakraText } from "@chakra-ui/react"; import type { ReactNode } from "react"; type AnyProps = Record; function normalizeSpacingProps(props: AnyProps) { const next = { ...props }; if (next.spacing !== undefined && next.gap === undefined) { next.gap = next.spacing; } delete next.spacing; return next; } function normalizeInteractiveProps(props: AnyProps) { const next = normalizeSpacingProps(props); if (next.isDisabled !== undefined && next.disabled === undefined) { next.disabled = next.isDisabled; } if (next.isLoading !== undefined && next.loading === undefined) { next.loading = next.isLoading; } delete next.isDisabled; delete next.isLoading; return next; } export const Center = ChakraCenter as any; export const Icon = ChakraIcon as any; export const Input = ChakraInput as any; export const Spinner = ChakraSpinner as any; export function Stack(props: AnyProps) { return ; } export function HStack(props: AnyProps) { return ; } export function Text(props: AnyProps) { const next = { ...props }; if (next.noOfLines !== undefined && next.lineClamp === undefined) { next.lineClamp = next.noOfLines; } delete next.noOfLines; return ; } export function Button(props: AnyProps) { const { leftIcon, rightIcon, children, ...rest } = normalizeInteractiveProps(props); return ( {leftIcon ?? null} {children} {rightIcon ?? null} ); } export function Alert({ children, status = "info", ...props }: AnyProps) { return ( {children} ); } export function AlertIcon() { return ; } export function AlertDescription({ children, ...props }: { children: ReactNode } & AnyProps) { return {children}; } export function FormControl({ children, ...props }: AnyProps) { return {children}; } export function FormLabel(props: AnyProps) { return ; }