svelte-5-ui-lib
Version:
Svelte 5 UI Lib is a UI library built from scratch to leverage Svelte 5's runes system, creating smooth, reactive components.
31 lines (30 loc) • 1.15 kB
TypeScript
import type { Snippet } from 'svelte';
import type { HTMLAttributes, HTMLAnchorAttributes } from 'svelte/elements';
type CardSizeType = 'sm' | 'md' | 'lg' | 'xl' | 'xs' | undefined;
type PaddingType = 'sm' | 'lg' | 'md' | 'xl' | 'xs' | 'none' | undefined;
type ShadowType = 'sm' | 'normal' | 'lg' | 'md' | 'xl' | '2xl' | 'inner' | undefined;
type ColorType = 'gray' | 'primary' | 'secondary' | 'red' | 'orange' | 'amber' | 'yellow' | 'lime' | 'green' | 'emerald' | 'teal' | 'cyan' | 'sky' | 'blue' | 'indigo' | 'violet' | 'purple' | 'fuchsia' | 'pink' | 'rose' | undefined;
type ImgType = {
src?: string | undefined | null;
alt?: string | undefined | null;
};
interface BaseCardProps {
children: Snippet;
horizontal?: boolean;
color?: ColorType;
target?: string;
shadow?: ShadowType;
reverse?: boolean;
img?: ImgType;
padding?: PaddingType;
size?: CardSizeType;
class?: string;
imgClass?: string;
contentClass?: string;
}
type CardProps = BaseCardProps & (({
href: string;
} & HTMLAnchorAttributes) | ({
href?: never;
} & HTMLAttributes<HTMLDivElement>));
export { type CardProps };