import { type PropertyValues } from 'lit'; import { UiElement } from '../shared/element.js'; import '../overflow-menu/overflow-menu.js'; import '../menu/menu.js'; export * from './card-media.js'; export * from './card-header.js'; export * from './card-header-media.js'; export * from './card-title-media.js'; export * from './card-title.js'; export * from './card-body.js'; export * from './card-footer.js'; export * from './card-action.js'; export * from './card-actions.js'; /** Carbon card (preview, `cds-card`): productive titles are heading-compact-02, expressive ones heading-03. */ export type CardDensity = 'productive' | 'expressive'; /** * Carbon `Card` (preview in Carbon, `cds-card`): a `$layer` box — no border, no shadow, square — built from parts: * ``, `` (with ``, ``, ``, * ``), `` and `` (with ``s). It follows the * `` it sits on. * * - `href`: the whole card is one link; `clickable`: the whole card is one button (`click`, Enter, Space) — both * get a 1px `border-tile-01`, `layer-hover` / `layer-active` and an arrow footer (`clickable`). Name it with `label` * and don't put other controls inside (Carbon: "clickable cards should not contain interactive elements"). As in * Carbon, its `` is not shown; `` still shows, nested in the one control. * - `selected` (beyond Carbon, whose card has no chosen state): a clickable card looks like a checked * `` (the same `--ui-tile-selected-*` tokens) and reports `aria-pressed`; the card doesn't * toggle itself, the app sets it on `click`. `hide-footer-icon` (beyond Carbon) drops the arrow footer. * - `disabled`: text and arrow greyed, no clicks. * - `horizontal`: the media beside the content (`media-position` start | end, its width from `media-width`). * * @slot - The parts * @slot media - (filled for you) the media of a horizontal card * @slot footer-icon - Replaces the clickable card's arrow * @csspart base - The card (`
`, or `` with `href`) * @fires ui-navigate - detail: { href } (cancelable) on a plain click of a linked card; cancel it to route client-side (README: SPA router) * @cssprop --ui-card-radius - Corner radius (default 0; Kanok: 12px) * @cssprop --ui-card-border - Border of every card, not only clickable ones (default none; Kanok: a hairline) * @cssprop --ui-card-background - Its fill (default `--ui-surface-1`; Kanok paper: a cool grey that sets it apart from the page, no border) * @cssprop --ui-card-clickable-border - Border of a clickable card (default 1px `--ui-border-tile-1`; Kanok: none) * @cssprop --ui-card-overflow - `overflow` of the card (default visible; Kanok: clip, so media follow the rounded corners) * @cssprop --ui-tile-selected-border - Border of a `selected` card, as a checked tile's (default `--ui-layer-selected-inverse`); `--ui-tile-selected-background` / `--ui-tile-selected-hover` its fill */ export declare class UiCard extends UiElement { static readonly shadowRootOptions: ShadowRootInit; static readonly styles: import("lit").CSSResult[]; /** Makes the whole card one link. */ href: string; target: '_self' | '_blank'; /** Makes the whole card one button (listen for `click`). */ clickable: boolean; /** A clickable card shown chosen, as a checked selectable tile, with `aria-pressed` (beyond Carbon; the app toggles it). */ selected?: boolean; /** Removes the clickable card's arrow footer (beyond Carbon). */ hideFooterIcon: boolean; disabled: boolean; /** The accessible name of a linked or clickable card (Carbon asks for one). */ label: string; density: CardDensity; horizontal: boolean; /** Where a horizontal card's media goes. */ mediaPosition: 'start' | 'end'; private readonly localize; protected updated(changed: PropertyValues): void; /** The parts read the card's state (a horizontal card's media goes to its own slot; a clickable card has no footer). */ private readonly syncParts; private readonly onKeydown; private readonly onDisabledClick; /** `aria-pressed` of a clickable card, only once `selected` is used (else the markup stays as Carbon's). */ private pressed; private renderContent; private renderInner; render(): import("lit-html").TemplateResult<1>; } declare global { interface HTMLElementTagNameMap { 'ui-card': UiCard; } }