dap-design-system
Version:
Official design system for the DÁP (dap.gov.hu)
99 lines (98 loc) • 4.9 kB
TypeScript
import { default as DapDSFileInputListItem, FileListElement } from '../components/file-input/file-input-list-item.component';
export type Common<T> = Pick<T, keyof T>;
export type Size = 'lg' | 'md' | 'sm' | 'xs' | 'xxs' | 'xl' | 'xxl';
export type CommonSize = Extract<Size, 'xs' | 'sm' | 'lg'>;
export type CommonFormElementSize = Extract<Size, 'sm' | 'md' | 'lg'>;
export type Layout = 'horizontal' | 'vertical';
export type ElementSpacing = 'both' | 'bottom' | 'none' | 'top';
export type LinkSize = Extract<Size, 'lg' | 'md' | 'sm' | 'xs'>;
export type LinkVariant = 'brand' | 'inverted' | 'neutral' | 'warning';
export type ListItemVariant = 'empty' | 'fail' | 'info' | 'notapplicable' | 'number' | 'pass';
export type ListItemStatus = 'brand' | 'negative' | 'neutral' | 'positive';
export type InputStatus = 'error' | 'success';
export type InputTypes = 'button' | 'color' | 'email' | 'file' | 'hidden' | 'number' | 'password' | 'reset' | 'submit' | 'text' | 'time' | 'url' | 'tel';
export type Placement = 'bottom' | 'center' | 'left' | 'right' | 'top';
export type LabelPlacement = Extract<Placement, 'left' | 'right'>;
export type DescriptionPlacement = Extract<Placement, 'bottom' | 'top'>;
export type BackgroundShade = 'base' | 'medium' | 'strong' | 'subtle';
export type Alignment = 'horizontal' | 'vertical';
export type ButtonSize = Extract<Size, 'lg' | 'md' | 'sm' | 'xs'>;
export type ButtonShape = 'button' | 'circle';
export type CSSFlexDirection = 'column' | 'column-reverse' | 'row' | 'row-reverse';
export type Spacing = 0 | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 1000 | 1200 | 1400 | 1600 | 1800 | 2000 | 2400 | 3000 | 4000 | 5000 | 6000;
export type PopupPlacement = 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-end' | 'left-start' | 'right' | 'right-end' | 'right-start' | 'top' | 'top-end' | 'top-start';
export type PopupTrigger = 'click' | 'focus' | 'hover' | 'hover focus' | 'manual';
export type TooltipMode = 'tooltip' | 'toggle';
export type LinkTarget = '_blank' | '_parent' | '_self' | '_top';
export type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
export type FloatingStrategy = 'absolute' | 'fixed';
export type SnackbarPosition = 'bottom-center' | 'bottom-left' | 'bottom-right' | 'top-center' | 'top-right';
export type AlertType = 'default' | 'error' | 'information' | 'successful';
export type FeedbackType = 'negative' | 'positive' | 'warning';
export type ButtonVariant = 'primary' | 'outline' | 'subtle' | 'clean' | 'primary-inverted' | 'outline-inverted' | 'subtle-inverted' | 'clean-inverted' | 'subtle-neutral' | 'subtle-quiet' | 'subtle-quiet-inverted' | 'subtle-menu' | 'subtle-menu-item';
export type HtmlButtonType = 'button' | 'submit' | 'reset';
export type ActionType = {
href?: string;
target?: LinkTarget;
rel?: string;
text?: string;
variant?: ButtonVariant;
func?: () => void;
};
export type MessageOptionsType = {
duration?: number;
/** When true, the message stays until the user closes it manually (auto-dismiss disabled). */
persistent?: boolean;
alertType?: AlertType;
actions?: ActionType[];
closeButton?: string;
customStyle?: Record<string, string>;
};
export type SnackbarMessage = {
id: string;
message: string;
options?: MessageOptionsType;
};
export type AvatarShape = 'circle' | 'rounded' | 'square';
export type AvatarVariant = 'icon' | 'image' | 'initials';
export type BadgeType = 'brand' | 'info' | 'negative' | 'neutral' | 'positive' | 'warning';
export type CalloutVariant = 'brand' | 'info' | 'negative' | 'positive' | 'warning';
export type FileType = 'audio' | 'document' | 'image' | 'pdf' | 'unknown' | 'video';
export type FileItemTemplate = {
component: DapDSFileInputListItem;
file: File;
fileObjectUrl: string;
href: string;
target: string;
rel: string;
download: string;
showFileLink: string;
showFileSize: string;
showDeleteButton: string;
formattedSize: string;
feedback: string;
feedbackType: string;
loading: boolean;
showThumbnail: string;
fileType: string;
fileLinkLabel?: string;
thumbnailUrl?: string | null;
thumbnailSize?: string;
handleFileClick: (event: Event) => void;
handleDelete: (file: FileListElement | File) => void;
};
export interface TimeSelection {
hour: number;
minute: number;
second?: number;
}
export interface TimePreset {
label: string;
value: string;
}
export type CloseSource = 'cancel-button' | 'close-button' | 'esc' | 'ok-button' | 'overlay';
export type AccordionVariant = 'default' | 'collapsed' | 'clean' | 'clean-collapsed';
export type TabNavigationMode = 'group' | 'items';
export type DialogState = 'closed' | 'opening' | 'open' | 'closing';
export type AriaCurrent = 'page' | 'step' | 'location' | 'date' | 'time' | 'true';
export type SidenavSpacing = 'top' | 'bottom' | 'both' | 'none';