tango-ui-cw
Version:
A lightweight ui library with ClayW
57 lines (49 loc) • 1.11 kB
TypeScript
import type {
CSSProperties,
HTMLAttributes,
ReactNode,
Ref,
} from "react";
/** Space 布局变体 */
export type SpaceType =
| "default"
| "inline"
| "circle"
| "triangle"
| "halfCircle"
| "fixed"
| "absolute"
| "relative";
/** sx 单个 slot 值 */
export interface SxSlotValue {
tw?: string;
className?: string;
css?: CSSProperties;
style?: CSSProperties;
}
/** sx 字符串 / 对象 / slot */
export type SxValue =
| string
| SxSlotValue
| Record<string, SxSlotValue | string | undefined>;
export interface SpaceProps
extends Omit<HTMLAttributes<HTMLDivElement>, "style"> {
/** 布局变体 */
type?: SpaceType;
/** 样式扩展 */
sx?: SxValue;
/** 行内样式 */
style?: CSSProperties;
/** 额外 CSS 类名 */
className?: string;
/** 子元素 */
children?: ReactNode;
/** ref 转发 */
ref?: Ref<HTMLDivElement>;
}
/** 默认导出:Space 组件 */
declare const Space: React.ForwardRefExoticComponent<
SpaceProps & React.RefAttributes<HTMLDivElement>
>;
export default Space;
export type { SpaceType, SxValue, SxSlotValue };