UNPKG

@makigas/genshi-svelte

Version:

The Svelte Components required to integrate Genshi into a Svelte application

27 lines (26 loc) 1.35 kB
import type { HTMLAttributes } from 'svelte/elements'; export type Density = 'gapless' | 'compact' | 'normal' | 'cozy'; export type Size = 'xs' | 'sm' | 'md' | 'lg' | 'xl'; export type Color = 'normal' | 'suggested' | 'destructive'; export type Validation = 'valid' | 'invalid' | null | undefined | false; export interface FormControlProps<T> { label: string; helper?: string; disabled?: boolean; validation?: Validation; size?: Size; inputProps?: Partial<T>; controlProps?: Partial<HTMLAttributes<HTMLDivElement>>; } /** * @generic E the element * @generic P the prop value * @generic M the modifier * @param element the element type * @param mapping */ export declare function modifierClass<E extends string, P extends string, M extends string>(element: E, mapping: Record<P, M | null>, modifier: P): `${E}--${M}` | null; export declare function densityClass<T extends string>(element: T, density: Density): `${T}--gapless` | `${T}--compact` | `${T}--cozy` | null; export declare function colorClass<T extends string>(element: T, color: Color): `${T}--suggested` | `${T}--destructive` | null; export declare function sizeClass<T extends string>(element: T, size: Size): `${T}--xs` | `${T}--sm` | `${T}--lg` | `${T}--xl` | null; export declare function ariaInvalid(valid: Validation): 'true' | 'false' | undefined;