import * as react from 'react'; import { FieldsetHTMLAttributes, ReactNode, InputHTMLAttributes, ButtonHTMLAttributes, RefAttributes, ReactElement, AnchorHTMLAttributes, HTMLAttributes, RefObject, MouseEvent, ElementType, ComponentPropsWithoutRef, SelectHTMLAttributes, TextareaHTMLAttributes, SVGAttributes } from 'react'; import { ACCENTS } from '@apliteni/apliteni-ui'; declare function Icon({ name }: { name: string; }): react.JSX.Element; type CheckboxProps = Omit, 'type' | 'children'> & { label: ReactNode; /** Shown under the label words and described to assistive technology. */ hint?: ReactNode; type?: 'checkbox' | 'radio'; }; declare const Checkbox: react.ForwardRefExoticComponent, "type" | "children"> & { label: ReactNode; /** Shown under the label words and described to assistive technology. */ hint?: ReactNode; type?: "checkbox" | "radio"; } & react.RefAttributes>; type CheckListProps = Omit, 'children'> & { legend: ReactNode; children: ReactNode; }; /** A group of `Checkbox` children under a legend. */ declare function CheckList({ legend, children, className, ...props }: CheckListProps): react.JSX.Element; type SwitchProps = Omit, 'type' | 'children'> & { label: string; }; declare const Switch: react.ForwardRefExoticComponent, "type" | "children"> & { label: string; } & react.RefAttributes>; type ButtonOptions = { variant?: 'primary' | 'secondary' | 'ghost' | 'danger' | 'link'; size?: 'xs' | 'sm' | 'md' | 'lg'; icon?: string; /** Decorative caller artwork, before the label; takes precedence over icon. */ leading?: ReactNode; iconRight?: string; iconOnly?: boolean; block?: boolean; /** In flight: keeps focus, blocks activation, announces progress, and shows dots. */ busy?: boolean; /** Message after busy ends; an empty string leaves outcome announcements to the caller. */ completionMessage?: string; children?: ReactNode; }; type NativeButtonProps = ButtonOptions & ButtonHTMLAttributes & { href?: never; }; type ButtonLinkProps = ButtonOptions & AnchorHTMLAttributes & { href: string; disabled?: boolean; }; type ButtonProps = NativeButtonProps | ButtonLinkProps; type ButtonElement = HTMLButtonElement | HTMLAnchorElement; declare const Button: { (props: NativeButtonProps & RefAttributes): ReactElement; (props: ButtonLinkProps & RefAttributes): ReactElement; (props: ButtonProps & RefAttributes): ReactElement; displayName?: string; }; declare function Badge({ variant, children }: { variant?: string; children: ReactNode; }): react.JSX.Element; type AvatarProps = { /** The app's stable id for the person. It picks the hue, so one person keeps one hue. */ personKey?: string | number; /** The person's name. The mark shows its first and last initials; empty draws the `user` glyph. */ name?: string | null; /** A photo. The letters show if it fails to load. */ src?: string; size?: 24 | 32; /** A dashed ring in place of a person: no value, or a "No one" row. */ empty?: boolean; }; declare function Avatar({ personKey, name, src, size, empty }: AvatarProps): react.JSX.Element; type PillProps = HTMLAttributes & { variant?: 'live' | 'soon'; }; declare const Pill: react.ForwardRefExoticComponent & { variant?: "live" | "soon"; } & react.RefAttributes>; type StatusDotProps = Omit, 'children'> & { live?: boolean; }; declare const StatusDot: react.ForwardRefExoticComponent, "children"> & { live?: boolean; } & react.RefAttributes>; type Level = 2 | 3 | 4 | 5 | 6; type CardProps = { title?: ReactNode; sub?: ReactNode; level?: Level; /** `accent` tints the card with the accent and `live` with green. */ variant?: 'accent' | 'live'; /** `sm` trims the vertical padding. `lg` is the centred landing card. */ pad?: 'sm' | 'lg'; /** Glyph name for the chip before the title. Needs a `title`. */ icon?: string; /** Makes the whole card a link. Its title is then a plain block, because a link holds no heading. */ href?: string; className?: string; children?: ReactNode; }; declare function Card({ title, sub, level, variant, pad, icon, href, className, children }: CardProps): react.JSX.Element; type CalloutVariant = 'neutral' | 'info' | 'success' | 'warn' | 'danger'; interface CalloutProps { variant?: CalloutVariant; icon?: string; children: ReactNode; actions?: ReactNode; } declare function Callout({ variant, icon, children, actions }: CalloutProps): react.JSX.Element; type StatTone = 'good' | 'bad' | 'neutral'; type StatVariant = 'band' | 'tiles' | 'open'; interface StatDelta { value: string | null; tone?: StatTone; basis?: string; tooltip?: string; direction?: 'up' | 'down' | 'flat'; } interface StatFigure { label: string; value: ReactNode; /** Context that is not a change, such as "of revenue": no arrow, no tone. It * takes the row a change would take, and leads that row beside one. A short * phrase: the row is one line, and a longer caption is clipped. */ caption?: string; delta?: StatDelta; trend?: ReactNode; } interface StatBandProps { stats: StatFigure[]; variant?: StatVariant; basis?: string; /** Existing caption before the figures; used when basis is omitted. */ basisId?: string; label?: string; id?: string; } declare function StatBand({ stats, variant, basis, basisId: sharedBasisId, label, id }: StatBandProps): react.JSX.Element; type ConfirmProps = { open: boolean; title: string; body: ReactNode; confirmLabel: string; cancelLabel: string; danger?: boolean; busy?: boolean; onConfirm: () => void; onCancel: () => void; }; declare function Confirm({ open, title, body, confirmLabel, cancelLabel, danger, busy, onConfirm, onCancel, }: ConfirmProps): react.JSX.Element; type FeedbackPayload = { note: string; excerpt: string; anchor: string; sectionLabel: string; sectionTitle: string; }; type FeedbackResult = { ok: boolean; error?: string; }; type FeedbackSection = { label?: string; title?: string; anchor?: string; }; type FeedbackProps = { /** The element whose text a reader may select. Pass a ref to it. */ container: RefObject; /** Files the note. Resolve `{ ok: true }` when it is sent, or `{ ok: false, error }` to keep the form open with the error in place. */ onSend: (payload: FeedbackPayload) => Promise; /** Shortest selection that offers the pill. */ minChars?: number; /** Shapes the chip and the payload from the heading above the selection. */ section?: (heading: Element | null) => FeedbackSection; label?: string; placeholder?: string; /** The one line shown once the note is sent. */ sentMessage?: string; }; declare function Feedback({ container, onSend, minChars, section, label, placeholder, sentMessage, }: FeedbackProps): react.ReactPortal; type ModalProps = { open: boolean; title: string; onClose: () => void; footer?: ReactNode; children?: ReactNode; role?: 'dialog' | 'alertdialog'; initialFocusRef?: RefObject; }; declare function Modal({ open, title, onClose, footer, children, initialFocusRef, role }: ModalProps): react.ReactPortal | null; type DrawerProps = { open: boolean; title: string; onClose: () => void; side?: 'right' | 'left' | 'top' | 'bottom'; size?: 'sm' | 'md' | 'lg'; footer?: ReactNode; /** Controls in the header, between the title and the close button. */ headerActions?: ReactNode; children?: ReactNode; closeLabel?: string; initialFocusRef?: RefObject; }; declare function Drawer({ open, title, onClose, side, size, footer, headerActions, children, closeLabel, initialFocusRef, }: DrawerProps): react.ReactPortal | null; type CommandItem = { id: string; label: string; description?: string; icon?: string; /** Aliases a reader might type instead of the label. */ keywords?: string[]; /** Drawn as , never read out: the row already says what it does. */ shortcut?: string | string[]; badge?: string; /** A row that goes somewhere. Cmd or Ctrl held on Enter opens it in a tab. */ href?: string; /** A row that destroys something. It must carry `onConfirm`, or it is disabled. */ danger?: boolean; /** What a destructive row opens instead of running. */ onConfirm?: () => void; disabled?: boolean; }; type CommandGroup = { label?: string; items: CommandItem[]; }; type CommandPaletteProps = { open: boolean; onClose: () => void; groups: CommandGroup[]; /** What the reader chose. `newTab` is Cmd or Ctrl held, for a row with an href. */ onSelect?: (item: CommandItem, meta: { newTab: boolean; }) => void; label?: string; placeholder?: string; empty?: string; density?: 'compact' | 'roomy'; hint?: boolean; /** * false → the caller ranks. `groups` is rendered in the order it is given and * `onQueryChange` is where the query goes — the shape a palette fed by a * server takes, where the rest of the results are not on this page to rank. */ rank?: boolean; onQueryChange?: (query: string) => void; }; declare function CommandPalette({ open, onClose, groups, onSelect, label, placeholder, empty, density, hint, rank, onQueryChange, }: CommandPaletteProps): react.ReactPortal | null; type Column = { key: keyof T & string; label: ReactNode; num?: boolean; sortable?: boolean; render?: (row: T) => ReactNode; /** * `true` marks this column's body cells as holding one link and nothing else, so the * link fills its cell and its focus ring outlines the cell rather than the words. It is * the consumer's to declare because CSS counts elements and not words: a cell reading * "Invoice 1162" with the number linked looks the same to a selector, and filling that * one would put the number on a line of its own. The header cell is never marked — it * holds a label, or a sort button that keeps its own ring. * why: docs/components.md#dense-financial-tables */ linked?: boolean; /** Renders this column's body cells as row headers (`th scope="row"`), as the kit's compact table does. */ rowHeader?: boolean; /** `title` gives the column the remaining width, `code` sets a handle or id in the table's small text, `long` is running text that gets its own line in a stacked row, `strong` bolds a figure, `act` right-aligns a row action. */ cell?: 'title' | 'code' | 'long' | 'strong' | 'act'; }; type TableSort = { key: (keyof T & string) | undefined; dir: 1 | -1; }; type SelectionProps = { selectable: false; selected?: Set; onToggle?: (name: string) => void; onTogglePage?: (names: string[]) => void; } | { selectable?: true; selected: Set; onToggle: (name: string) => void; onTogglePage: (names: string[]) => void; }; type PagerProps = { page?: never; onPageChange?: (page: number) => void; total?: never; hasMore?: never; } | { page: number; onPageChange: (page: number) => void; total: number; hasMore?: boolean; } | { page: number; onPageChange: (page: number) => void; total: null; hasMore: boolean; }; type DataTableProps = { columns: Column[]; rows: T[]; /** The kit's `--zebra`, `--hover` (on unless `false`) and `--stack` hooks. A stacked table lays each row out as a block below the phone step, so no column scrolls out of reach. */ zebra?: boolean; hover?: boolean; stack?: boolean; /** Marks a row the reader landed on (`target`) or a revoked one (`dead`). A dead row is muted, so put the word that names its state in one of its cells. */ rowState?: (row: T) => 'target' | 'dead' | undefined; /** Table footer rows, such as totals: `` elements with a `th scope="row"` label. */ footer?: ReactNode; /** A caption read by assistive technology only. */ caption?: string; dense?: boolean; density?: 'default' | 'dense' | 'compact'; stickyHeader?: boolean; pinnedIdentity?: boolean; scrollLabel?: string; empty?: ReactNode; pageSize?: number; pageSizes?: readonly number[] | null; onPageSizeChange?: (size: number) => void; /** `false` renders no pager at all — for a surface that supplies its own. */ pager?: boolean; /** * The pager's accessible name. Two tables on one page otherwise publish two * landmarks called "Pagination", and a reader listing the landmarks cannot tell * which one moves which table. Axe will not catch it: `landmark-unique` is a * best-practice rule and the kit's gate runs only the WCAG A/AA tags. */ pagerLabel?: string; loading?: boolean; } & SelectionProps & PagerProps & ({ sort?: never; onSortChange?: (sort: TableSort) => void; } | { sort: TableSort; onSortChange: (sort: TableSort) => void; }); declare function sortTableRows(rows: T[], sort: TableSort): T[]; declare function DataTable({ columns, rows, zebra, hover, stack, rowState, footer, caption, dense, density, stickyHeader, pinnedIdentity, scrollLabel, empty, pageSize, pageSizes, onPageSizeChange, pager, pagerLabel, loading, selectable, selected, onToggle, onTogglePage, sort: controlledSort, onSortChange, page: controlledPage, onPageChange, total, hasMore, }: DataTableProps): react.JSX.Element; type PaginationProps = { page?: number; pageSize?: number; /** Rows in the whole result. `null` — the honest answer for a caller who cannot count. */ total?: number | null; /** Read only when `total` is null: whether a page exists after this one. */ hasMore?: boolean; pageSizes?: readonly number[] | null; variant?: 'steps' | 'numbered' | 'jump'; label?: string; loading?: boolean; id?: string; onPageChange?: (page: number) => void; onPageSizeChange?: (size: number) => void; }; declare function Pagination({ page, pageSize, total, hasMore, pageSizes, variant, label, loading, id, onPageChange, onPageSizeChange, }: PaginationProps): react.JSX.Element | null; type SkeletonProps = { /** A count of bars, or explicit widths when a ragged prose edge matters. */ lines?: number | string[]; width?: string; height?: string; radius?: string; className?: string; }; declare function Skeleton({ lines, width, height, radius, className }: SkeletonProps): react.JSX.Element; type SkeletonTableProps = { rows?: number; cols?: number; head?: boolean; }; declare function SkeletonTable({ rows, cols, head }: SkeletonTableProps): react.JSX.Element; type BusyRegionProps = { busy: boolean; /** Spoken while it works. */ label?: string; /** Spoken when it finishes — the specific line ("14 invoices") beats "Loaded". */ message?: string; /** Placeholder while busy. Defaults to a three-bar skeleton. */ placeholder?: ReactNode; className?: string; children?: ReactNode; }; declare function BusyRegion({ busy, label, message, placeholder, className, children, }: BusyRegionProps): react.JSX.Element; type DeniedProps = { title?: string; sub?: string; /** The scope or role the reader is missing, verbatim. */ need?: string; icon?: string; className?: string; /** Buttons. Nothing is assumed about what a reader can do next. */ children?: ReactNode; }; declare function Denied({ title, sub, need, icon, className, children, }: DeniedProps): react.JSX.Element; /** * `'month'` and `'range'` work in whole months, `'day'` and `'day-range'` in * whole dates. The two range modes behave alike: a start, then an end, with the * days or months between them shown as the span. */ type DatePickerMode = 'month' | 'range' | 'day' | 'day-range'; /** Either end may be null while the reader is still picking. */ type DatePickerRange = { start: string | null; end: string | null; }; type DatePickerPreset = { label: string; range: DatePickerRange; }; type DatePickerProps = { mode?: DatePickerMode; /** `'YYYY-MM'` in month mode, `'YYYY-MM-DD'` in day mode. Controlled. */ value?: string | null; /** Where an uncontrolled picker starts. */ defaultValue?: string | null; onChange?: (value: string | null) => void; /** Range mode, controlled. */ range?: DatePickerRange; defaultRange?: DatePickerRange; /** Fires on each end, so a half-picked range is visible to the host too. */ onRangeChange?: (range: DatePickerRange) => void; /** Bounds, inclusive, in the mode's own grain. */ min?: string; max?: string; /** Periods that cannot be picked, in the mode's own grain. */ disabledPeriods?: readonly string[]; /** Range mode: the shortcuts beside the grid. */ presets?: readonly DatePickerPreset[]; placeholder?: string; /** * Names the trigger and the panel where the screen around them does not. * With a value, the trigger's own text is already its name. */ ariaLabel?: string; id?: string; disabled?: boolean; /** The edge the panel hugs. */ align?: 'start' | 'end'; /** Month and weekday names come from here. */ locale?: string; /** 0 is Sunday. Day mode only. */ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6; /** `'YYYY-MM-DD'`. Given one, the grid marks it; stories and tests pass it to stay fixed. */ today?: string; /** * Render the sheet rather than the popover whatever the viewport is. Left * out, the picker follows the kit's narrowest step. A host that already knows * it is on a phone — or renders on a server, where no viewport is readable — * says so here. */ sheet?: boolean; open?: boolean; defaultOpen?: boolean; onOpenChange?: (open: boolean) => void; }; declare function DatePicker({ mode, value, defaultValue, onChange, range, defaultRange, onRangeChange, min, max, disabledPeriods, presets, placeholder, ariaLabel, id, disabled, align, locale, weekStartsOn, today, sheet, open: openProp, defaultOpen, onOpenChange, }: DatePickerProps): react.JSX.Element; type DropdownBadge = string | { text: string; tone?: string; }; type DropdownAvatar = { key?: string | number; name?: string | null; src?: string; empty?: boolean; }; type DropdownItem = { label: string; /** The pick, as `onSelect` reports it and as `data-value` carries it. */ value?: string | number; description?: string; /** A kit glyph name, drawn in the row's leading slot. */ icon?: string; /** A person's mark in the leading slot, in place of `icon`. `key` picks the hue, `name` the * letters, `src` a photo. `{ empty: true }` is the dashed ring of a "No one" row. */ avatar?: DropdownAvatar; badge?: DropdownBadge; selected?: boolean; disabled?: boolean; danger?: boolean; /** A row that goes somewhere. A `select` row never becomes a link, as the factory decides it. */ href?: string; target?: string; }; /** A rule between rows. `'---'` is the factory's shorthand for the same thing. */ type DropdownSeparator = '---' | { separator: true; }; type DropdownEntry = DropdownItem | DropdownSeparator; type DropdownSection = { label?: string; items?: DropdownEntry[]; }; /** The field above the rows. `true` takes every default. */ type DropdownSearch = { placeholder?: string; /** Names the field. Without one it is named "Search " + the dropdown's name. */ label?: string; /** The no-match line. `{q}` in it stands for the query. */ empty?: string; /** The nudge under it. */ hint?: string; /** What the field holds before it is opened; every open starts from the whole list. */ query?: string; /** The size of the whole set, for "Search 214 people" in the placeholder and the field's * name. `true` counts the rows, less a "No one" row. */ count?: number | true; /** What the set is called in that line. Defaults to "people". */ noun?: string; }; /** * What a row has to carry to be a row: the classes, the role, the tab stop the * panel moves itself, the pick and the click. Spread it onto whatever element the * row should be — a router ``, a `