import { Affix, Breadcrumb, Color, Node, Option } from '@lattice-php/core'; import { Effect } from './effects/types.js'; export type Accordion = { defaultOpen: string | null; gap: Gap | null; }; export type Align = "center" | "end" | "start" | "stretch"; export type Avatar = { name: string | null; shape: AvatarShape; size: Size; src: string | null; }; export type AvatarShape = "circle" | "rounded"; export type Badge = { color: Color | null; label: string; }; export type BadgeEntry = { color: Color | null; description: string | null; label: string | null; name: string; value: unknown; }; export type BooleanEntry = { description: string | null; falseIcon: string; label: string | null; name: string; trueIcon: string; value: unknown; }; export type Breadcrumbs = { items: Breadcrumb[]; }; export type Button = { action: Node | null; buttonType: ButtonType; effects: Effect[]; emphasis: Emphasis | null; href: string | null; icon: string | null; label: string | null; method: HttpMethod | null; modal: Node<"modal"> | null; variant: Variant | null; }; export type ButtonType = "button" | "submit" | "reset"; export type Callout = { action: Node | null; dismissible: boolean; message: Translatable | string; title: Translatable | string | null; unique: string | null; variant: Variant; }; export type Callouts = Record; export type Card = { description: string | null; headerActions: Node[]; title: string | null; tooltip: string | null; }; export type Chart = { categoryFormat: DateFormat | NumberFormat | null; categoryKey: string | null; data: Record[]; description: string | null; grid: boolean; height: number; legend: boolean; series: ChartSeries[]; title: string | null; tooltip: boolean; valueFormat: NumberFormat | null; xAxis: boolean; yAxis: boolean; }; export type ChartSeries = { readonly color: Color | null; readonly dataKey: string; readonly innerRadius: string; readonly maxValue: number | null; readonly name: string; readonly nameKey: string | null; readonly stackId: string | null; readonly type: ChartSeriesType; }; export type ChartSeriesType = "area" | "bar" | "distribution" | "gauge" | "line" | "pie"; export type CloseModal = { readonly modal: string | null; }; export type CodeBlock = { code: string; copyable: boolean; language: CodeBlockLanguage; lineNumbers: boolean; maxHeight: number | null; wrap: boolean; }; export type CodeBlockLanguage = "text" | "json" | "javascript" | "shell" | "php"; export type Collapsible = { collapsed: boolean; rememberState: boolean; tooltip: string | null; trigger: Node[]; }; export type ColumnWidth = "xs" | "sm" | "md" | "lg" | "xl"; export type ComponentEntry = { description: string | null; label: string | null; name: string; value: unknown; }; export type ComponentPropsMap = { accordion: Accordion; avatar: Avatar; badge: Badge; breadcrumbs: Breadcrumbs; button: Button; callouts: Callouts; card: Card; chart: Chart; "code-block": CodeBlock; collapsible: Collapsible; "description-list": DescriptionList; dropdown: Dropdown; "entry.badge": BadgeEntry; "entry.boolean": BooleanEntry; "entry.component": ComponentEntry; "entry.date": DateEntry; "entry.text": TextEntry; "floating-panel": FloatingPanel; grid: Grid; heading: Heading; icon: Icon; image: Image; link: Link; menu: Menu; "menu-item": MenuItem; modal: Modal; popover: Popover; progress: Progress; "raw-block": RawBlock; section: Section; "segmented-control": SegmentedControl; separator: Separator; sidebar: Sidebar; "sidebar.footer": SidebarFooter; stack: Stack; tab: Tab; tabs: Tabs; text: Text; tooltip: Tooltip; topbar: Topbar; }; export type ContentAlign = "start" | "center" | "end"; export type DateEntry = { description: string | null; format: DateFormat; label: string | null; name: string; value: unknown; }; export type DateFormat = { dateStyle: DateTimeStyle | null; kind: string; month: string | null; timeStyle: DateTimeStyle | null; year: string | null; }; export type DateTimeStyle = "full" | "long" | "medium" | "short"; export type DescriptionList = { bleed: boolean; divided: boolean; emptyLabel: string | null; semantic: DescriptionListSemantic; }; export type DescriptionListSemantic = "description-list" | "list"; export type Download = { readonly url: string; }; export type Dropdown = { placement: Placement; trigger: Node[]; }; export type EffectPropsMap = { callout: Callout; "close-modal": CloseModal; download: Download; "locale-change": LocaleChange; "open-modal": OpenModal; redirect: Redirect; "reload-component": ReloadComponent; "reload-page": ReloadPage; "reset-form": ResetForm; "retract-callout": RetractCallout; toast: Toast; "toggle-sidebar": ToggleSidebar; }; export type Emphasis = "solid" | "outline" | "ghost" | "link"; export type FloatingPanel = { label: string | null; offset: number; placement: FloatingPlacement; trigger: Node[]; }; export type FloatingPlacement = "bottom-end" | "bottom-start" | "top-end" | "top-start"; export type Gap = "none" | "xs" | "sm" | "md" | "lg" | "xl"; export type Grid = { columns: Record | null; }; export type Heading = { copyable: boolean; level: number; text: string; tooltip: string | null; }; export type Height = "full" | "screen"; export type HttpMethod = "get" | "post" | "put" | "patch" | "delete"; export type I18nConfig = { readonly enabled: boolean; readonly locales: string[]; readonly preloadLocales: string[]; readonly saveMissing: boolean; readonly timezone: string | null; }; export type Icon = { color: Color | null; name: string; size: Size; }; export type Image = { alt: string | null; circular: boolean; previewSrc: string | null; previewable: boolean; size: number | null; src: string; }; export type Justify = "start" | "center" | "end" | "between" | "around" | "evenly"; export type Link = { action: Node | null; effects: Effect[]; href: string | null; icon: string | null; label: string | null; method: HttpMethod | null; modal: Node<"modal"> | null; prefix: Affix | null; suffix: Affix | null; tabIndex: number | null; unstyled: boolean; }; export type LocaleChange = { readonly locale: string; }; export type Menu = Record; export type MenuItem = { action: Node | null; effects: Effect[]; href: string | null; icon: string | null; label: string | null; method: HttpMethod | null; modal: Node<"modal"> | null; prefix: Affix | null; suffix: Affix | null; }; export type Modal = { closeLabel: string; description: string | null; height: ModalHeight | null; side: Side | null; title: string | null; width: ModalWidth; }; export type ModalHeight = "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "max"; export type ModalWidth = "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "max"; export type NumberFormat = { currency: string | null; kind: string; maximumFractionDigits: number | null; minimumFractionDigits: number | null; notation: string; unit: NumberFormatUnit | null; }; export type NumberFormatUnit = "percent" | "kilogram" | "gram" | "kilometer" | "meter" | "byte" | "kilobyte" | "megabyte" | "gigabyte" | "millisecond" | "second" | "minute" | "hour" | "celsius" | "fahrenheit"; export type OpenModal = { readonly node: Node<"modal">; }; export type Orientation = "horizontal" | "vertical"; export type Placement = "top" | "right" | "bottom" | "left"; export type Popover = { align: ContentAlign; label: string | null; side: Placement; trigger: Node[]; }; export type Progress = { color: Color | null; max: number; shape: ProgressShape; showValue: boolean; size: Size; value: number; }; export type ProgressShape = "bar" | "circle"; export type RawBlock = { html: string; }; export type Redirect = { readonly url: string; }; export type ReloadComponent = { readonly component: string; }; export type ReloadPage = { readonly full: boolean; }; export type ResetForm = { readonly form: string | null; }; export type RetractCallout = { readonly unique: string; }; export type Section = { collapsed: boolean; collapsible: boolean; description: string | null; headerActions: Node[]; rememberState: boolean; title: string | null; tooltip: string | null; }; export type SegmentedControl = { emits: string | null; label: string | null; name: string; options: Option[]; value: string | null; }; export type Separator = { bleed: boolean; orientation: Orientation; }; export type Side = "start" | "end"; export type Sidebar = { collapsible: boolean; rememberState: boolean; }; export type SidebarFooter = Record; export type Size = "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl"; export type Stack = { align: Align | null; direction: Orientation | null; float: Side | null; gap: Gap | null; height: Height | null; justify: Justify | null; sticky: boolean; width: Width | null; }; export type Tab = { confirm: { redirectUrl: string; required: boolean; timeout: number | null; } | null; label: string; value: string; }; export type Tabs = { activeValue: string; alignment: Align; defaultValue: string | null; orientation: Orientation; queryKey: string; sticky: boolean; }; export type Text = { align: TextAlign | null; color: Color | null; copyable: boolean; size: Size; text: string; }; export type TextAlign = "start" | "center"; export type TextEntry = { copyable: boolean; description: string | null; label: string | null; name: string; placeholder: string | null; value: unknown; }; export type Toast = { action: Node | null; dismissible: boolean; duration: number | null; message: Translatable | string; persistent: boolean; variant: Variant; }; export type ToggleSidebar = { readonly target: string | null; }; export type Tooltip = { content: string | null; trigger: Node[]; }; export type Topbar = { sticky: boolean; }; export type Translatable = { key: string; payload: Record; replacements: Record; }; export type UiNodeType = "accordion" | "avatar" | "badge" | "breadcrumbs" | "button" | "callouts" | "card" | "chart" | "code-block" | "collapsible" | "description-list" | "dropdown" | "entry.badge" | "entry.boolean" | "entry.component" | "entry.date" | "entry.text" | "floating-panel" | "grid" | "heading" | "icon" | "image" | "link" | "menu" | "menu-item" | "modal" | "popover" | "progress" | "raw-block" | "section" | "segmented-control" | "separator" | "sidebar" | "sidebar.footer" | "stack" | "tab" | "tabs" | "text" | "tooltip" | "topbar"; export type Variant = "primary" | "secondary" | "success" | "info" | "warning" | "danger"; export type Width = "full" | "auto" | "sm" | "md" | "lg" | "xl" | "fill";