import * as React from 'react'; // Base types export interface LismCSSValue { base?: string | number; sm?: string | number; md?: string | number; lg?: string | number; xl?: string | number; [key: string]: string | number | undefined; } export type ResponsiveValue = T | LismCSSValue | (T | null)[]; export interface LismBaseProps { // Layout p?: ResponsiveValue; px?: ResponsiveValue; py?: ResponsiveValue; pl?: ResponsiveValue; pr?: ResponsiveValue; pt?: ResponsiveValue; pb?: ResponsiveValue; pis?: ResponsiveValue; pie?: ResponsiveValue; pbs?: ResponsiveValue; pbe?: ResponsiveValue; m?: ResponsiveValue; mx?: ResponsiveValue; my?: ResponsiveValue; ml?: ResponsiveValue; mr?: ResponsiveValue; mt?: ResponsiveValue; mb?: ResponsiveValue; mis?: ResponsiveValue; mie?: ResponsiveValue; mbs?: ResponsiveValue; mbe?: ResponsiveValue; // Sizing w?: ResponsiveValue; h?: ResponsiveValue; minW?: ResponsiveValue; minH?: ResponsiveValue; maxW?: ResponsiveValue; maxH?: ResponsiveValue; // Display d?: ResponsiveValue; pos?: ResponsiveValue; z?: ResponsiveValue; inset?: ResponsiveValue; t?: ResponsiveValue; b?: ResponsiveValue; l?: ResponsiveValue; r?: ResponsiveValue; // Flexbox & Grid gap?: ResponsiveValue; g?: ResponsiveValue; gx?: ResponsiveValue; gy?: ResponsiveValue; ai?: ResponsiveValue; jc?: ResponsiveValue; ac?: ResponsiveValue; ji?: ResponsiveValue; pi?: ResponsiveValue; pc?: ResponsiveValue; as?: ResponsiveValue; js?: ResponsiveValue; aslf?: ResponsiveValue; jslf?: ResponsiveValue; ord?: ResponsiveValue; // Typography fz?: ResponsiveValue; lh?: ResponsiveValue; ff?: ResponsiveValue; fw?: ResponsiveValue; ta?: ResponsiveValue; td?: ResponsiveValue; tt?: ResponsiveValue; ts?: ResponsiveValue; tsh?: ResponsiveValue; lts?: ResponsiveValue; whs?: ResponsiveValue; wbr?: ResponsiveValue; // Colors c?: ResponsiveValue; bgc?: ResponsiveValue; bdc?: ResponsiveValue; keycolor?: ResponsiveValue; // Border bd?: ResponsiveValue; bdw?: ResponsiveValue; bds?: ResponsiveValue; bdl?: ResponsiveValue; bdr?: ResponsiveValue; bdt?: ResponsiveValue; bdb?: ResponsiveValue; bdx?: ResponsiveValue; bdy?: ResponsiveValue; // Border Radius bdrs?: ResponsiveValue; radius?: ResponsiveValue; radii?: ResponsiveValue; // Other aspect?: ResponsiveValue; ar?: ResponsiveValue; op?: ResponsiveValue; of?: ResponsiveValue; ov?: ResponsiveValue; transform?: ResponsiveValue; trs?: ResponsiveValue; filter?: ResponsiveValue; bxsh?: ResponsiveValue; v?: ResponsiveValue; // Logical properties is?: ResponsiveValue; ie?: ResponsiveValue; bs?: ResponsiveValue; be?: ResponsiveValue; // Hover hov?: string | Record; // Context props css?: Record; passVars?: string | string[]; // Utility classes _?: string | string[]; // State classes skipState?: boolean; isFlow?: boolean | string; hasGutter?: boolean | string; isContainer?: boolean | string; isOverwide?: boolean; isFullwide?: boolean; isWide?: boolean; isLayer?: boolean; isLinkBox?: boolean; // HTML attributes className?: string; style?: React.CSSProperties; id?: string; // Other HTML attributes [key: string]: any; } export interface LismProps extends LismBaseProps { as?: React.ElementType; tag?: string; exProps?: Record; children?: React.ReactNode; variant?: string; lismClass?: string; lismState?: string[]; forwardedRef?: React.Ref; } // Component Props export interface BoxProps extends LismProps {} export interface FlexProps extends LismProps { _flex?: string; fxw?: ResponsiveValue; fxd?: ResponsiveValue; fxf?: ResponsiveValue; } export interface FlexItemProps extends LismProps { layout?: React.ElementType; } export interface StackProps extends LismProps {} export interface GridProps extends LismProps { _grid?: string; gd?: ResponsiveValue; gt?: ResponsiveValue; gta?: ResponsiveValue; gtc?: ResponsiveValue; gtr?: ResponsiveValue; gaf?: ResponsiveValue; gar?: ResponsiveValue; gac?: ResponsiveValue; } export interface GridItemProps extends LismProps { layout?: React.ElementType; gc?: ResponsiveValue; gr?: ResponsiveValue; ga?: ResponsiveValue; gcs?: ResponsiveValue; gce?: ResponsiveValue; grs?: ResponsiveValue; gre?: ResponsiveValue; } export interface WithSideProps extends LismProps { sideW?: ResponsiveValue; mainW?: ResponsiveValue; } export interface CenterProps extends GridProps {} export interface ColumnsProps extends GridProps { colSize?: ResponsiveValue; autoType?: ResponsiveValue; } export interface FrameProps extends LismProps {} export interface ContainerProps extends LismProps { size?: ResponsiveValue; layout?: React.ElementType; } export interface LayerProps extends LismProps { layout?: React.ElementType; backdropFilter?: ResponsiveValue; } export interface LinkBoxProps extends LismProps { layout?: React.ElementType; href?: string; } export interface IconProps extends LismProps { icon?: string | { as: React.ElementType } | React.ReactNode; scale?: ResponsiveValue; offset?: ResponsiveValue; label?: string; viewBox?: string; } export interface SpacerProps { h?: ResponsiveValue; w?: ResponsiveValue; } export interface DecoratorProps extends LismProps { size?: ResponsiveValue; } export interface DividerProps extends LismProps {} // Text components export interface TextProps extends LismProps { tag?: string; } export interface LinkProps extends LismProps { href?: string; target?: string; rel?: string; openNewTab?: boolean; } export interface MediaProps extends LismProps { src?: string; alt?: string; width?: string | number; height?: string | number; loading?: 'lazy' | 'eager'; decoding?: 'sync' | 'async' | 'auto'; } // Dummy component export interface DummyProps extends LismProps { tag?: string; pre?: string; length?: 's' | 'm' | 'l'; lang?: 'en' | 'ja'; offset?: number; } // Accordion export interface AccordionProps extends LismProps { allowMultiple?: boolean; defaultIndex?: number | number[]; duration?: number; } export interface AccordionHeaderProps extends FlexProps {} export interface AccordionLabelProps extends LismProps {} export interface AccordionBodyProps extends LismProps { isFlow?: boolean | string; innerProps?: LismProps; } // Tabs export interface TabsProps extends LismProps { tabId?: string; defaultIndex?: number; listProps?: LismProps; } export interface TabListProps extends LismProps {} export interface TabProps extends LismProps {} export interface TabPanelProps extends LismProps {} // Modal export interface ModalProps extends LismProps { layout?: React.ElementType; duration?: ResponsiveValue; offset?: ResponsiveValue; } // Export components export const Lism: React.FC; export const Box: React.FC; export const Flex: React.FC; export const FlexItem: React.FC; export const Cluster: React.FC; export const Stack: React.FC; export const Grid: React.FC; export const GridItem: React.FC; export const WithSide: React.FC; export const Center: React.FC; export const Columns: React.FC; export const Frame: React.FC; export const Container: React.FC; export const Layer: React.FC; export const LinkBox: React.FC; export const Icon: React.FC; export const Spacer: React.FC; export const Decorator: React.FC; export const Divider: React.FC; export const Text: React.FC; export const Link: React.FC; export const Media: React.FC; export const Dummy: React.FC; export const Accordion: React.FC & { Header: React.FC; Label: React.FC; Body: React.FC; }; export const Tabs: React.FC & { List: React.FC; Tab: React.FC; Panel: React.FC; }; export const Modal: React.FC; // Re-export all as default export default { Lism, Box, Flex, FlexItem, Cluster, Stack, Grid, GridItem, WithSide, Center, Columns, Frame, Container, Layer, LinkBox, Icon, Spacer, Decorator, Divider, Text, Link, Media, Dummy, Accordion, Tabs, Modal, };