@esri/calcite-components
Version:
Web Components for Esri's Calcite Design System.
40 lines (22 loc) • 1.55 kB
TypeScript
import type { LuminaJsx } from "@arcgis/lumina";
import type { CamelCase } from "type-fest";
export type Alignment = "start" | "center" | "end";
export type Appearance = "solid" | "outline" | "outline-fill" | "transparent";
export type FlipContext = "both" | "start" | "end";
export type Height = Scale;
export type Kind = "brand" | "danger" | "info" | "inverse" | "neutral" | "warning" | "success";
export type Layout = "horizontal" | "vertical" | "grid" | "inline" | "center" | "auto" | "fixed" | "none" | "horizontal-single";
export type LogicalFlowPosition = "inline-start" | "inline-end" | "block-start" | "block-end";
export type Position = "start" | "end" | "top" | "bottom";
export type SelectionAppearance = "icon" | "border" | "neutral" | "highlight";
export type SelectionMode = "single" | "none" | "children" | "single-persist" | "multichildren" | "ancestors" | "multiple";
export type Scale = "s" | "m" | "l";
export type Status = "invalid" | "valid" | "idle";
export type Width = Scale | "auto" | "half" | "full";
export type IconType = "chevron" | "caret" | "ellipsis" | "overflow" | "plus-minus";
export type CollapseDirection = "down" | "up";
export type InteractionMode = "interactive" | "static";
export type AriaAttributesCamelCased = {
[K in Exclude<keyof LuminaJsx.AriaAttributes, "role"> as CamelCase<RemoveAriaPrefix<K & string>>]: LuminaJsx.AriaAttributes[K];
};
export type RemoveAriaPrefix<K extends string> = K extends `aria-${infer Rest}` ? Rest : K extends `aria${infer Rest}` ? Uncapitalize<Rest> : K;