@tachui/primitives
Version:
Basic UI components for tachUI framework
74 lines • 2.63 kB
TypeScript
/**
* Layout Stack Components
*
* SwiftUI-inspired VStack, HStack, and ZStack components with modifier support
*/
import type { ComponentInstance, ComponentProps, DOMNode } from '@tachui/core';
import type { ModifiableComponent, ModifierBuilder } from '@tachui/core';
import { ComponentWithCSSClasses, type CSSClassesProps } from '@tachui/core';
import { type ElementOverrideProps } from '@tachui/core';
/**
* VStack component props
*/
export interface VStackProps {
children?: ComponentInstance[];
spacing?: number;
alignment?: 'leading' | 'center' | 'trailing';
debugLabel?: string;
element?: string;
}
/**
* HStack component props
*/
export interface HStackProps {
children?: ComponentInstance[];
spacing?: number;
alignment?: 'top' | 'center' | 'bottom';
debugLabel?: string;
element?: string;
}
/**
* ZStack component props
*/
export interface ZStackProps {
children?: ComponentInstance[];
alignment?: 'topLeading' | 'top' | 'topTrailing' | 'leading' | 'center' | 'trailing' | 'bottomLeading' | 'bottom' | 'bottomTrailing';
element?: string;
}
/**
* Enhanced component wrapper that adds modifier support and preserves concatenation methods
*/
export declare function withModifiers<P extends ComponentProps>(component: ComponentInstance<P>): ModifiableComponent<P> & {
modifier: ModifierBuilder<ModifiableComponent<P>>;
} & (ComponentInstance<P> extends any ? any : {});
/**
* Layout container component class with element override support
*/
export declare class LayoutComponent extends ComponentWithCSSClasses implements ComponentInstance<ComponentProps & ElementOverrideProps & CSSClassesProps> {
props: ComponentProps & ElementOverrideProps & CSSClassesProps;
private layoutType;
children: ComponentInstance[];
private layoutProps;
readonly type: "component";
readonly id: string;
mounted: boolean;
cleanup: (() => void)[];
private effectiveTag;
constructor(props: ComponentProps & ElementOverrideProps & CSSClassesProps, layoutType: 'vstack' | 'hstack' | 'zstack', children?: ComponentInstance[], layoutProps?: any);
/**
* Find DOM elements for a specific child component within the layout container
*/
private findChildDOMElements;
render(): DOMNode[];
/**
* Cleanup resources
*/
dispose(): void;
}
/**
* SwiftUI-aligned direct exports for layout components
*/
export declare function VStack(props?: VStackProps): any;
export declare function HStack(props?: HStackProps): any;
export declare function ZStack(props?: ZStackProps): any;
//# sourceMappingURL=Stack.d.ts.map