import { SvelteComponentTyped } from "svelte"; import type { SvelteHTMLElements } from "svelte/elements"; type $RestProps = SvelteHTMLElements["any"]; type $Props = { /** * Set the type scale and spacing for the copy inside. * - `"default"`: 16px body copy and productive headings, for reading pages * - `"condensed"`: 14px body copy with a shorter line height and tighter * spacing than compact, for side panels and inspectors * - `"compact"`: 14px body copy and tighter spacing, for dense product UI * - `"spacious"`: 16px body copy with larger headings and more room * - `"expressive"`: expressive headings that scale with the viewport and * wider spacing, for editorial and marketing pages * @default "default" */ variant?: "condensed" | "compact" | "default" | "spacious" | "expressive"; /** * Set the link color. * - `"default"`: links and heading anchors in the link color * - `"muted"`: links in the text color, underlined, and heading anchors in * the secondary text color; both take the link color on hover. For copy * dense with links, such as reference docs. * * Links have no visited color, like `Link` by default. * @default "default" */ linkTone?: "default" | "muted"; /** * Set how tables size. Either way, the first and last columns line up * with the copy. * - `"fit"`: columns at their content width with a gap between them, so * a short table reads with the copy around it * - `"full"`: the table spans the line length with padded cells, for wide * or data-heavy tables * @default "fit" */ tableWidth?: "fit" | "full"; /** * Set how `kbd` keys look. Either way, keys never change line spacing. * - `"keycap"`: a flat key with a heavier bottom edge * - `"muted"`: no box, semibold text in the secondary color, the way * `Menu` shows shortcuts; for dense copy and long key sequences * @default "keycap" */ kbd?: "keycap" | "muted"; /** * Set to `true` to draw a rule above each `h2` but a first one, to set * sections apart * @default false */ dividers?: boolean; /** * Override the max width. Each variant caps the line length: 80 characters * (condensed and compact), 68 (default), 64 (spacious), or 60 * (expressive). Numbers are treated as pixels; strings accept any CSS * length, or `"none"` to fill the container. */ maxWidth?: number | string | undefined; /** * Set to `true` to skip rendering code blocks (`pre`) and figures while * they are offscreen, with `content-visibility: auto`. They stay in find * in page, anchor navigation, and the accessibility tree. A code block * reserves the height of its lines until it first renders, then its last * rendered height; a figure, and a code block in server-rendered HTML * before the script runs, reserves 10rem. * @default false */ deferOffscreen?: boolean; /** * Specify the tag name. * @default "div" */ tag?: keyof HTMLElementTagNameMap; /** * Obtain a reference to the HTML element. * @default null */ ref?: null | HTMLElement; children?: (this: void) => void; [key: `data-${string}`]: unknown; }; export type ProseProps = Omit<$RestProps, keyof $Props> & $Props; export default class Prose extends SvelteComponentTyped< ProseProps, Record, { default: Record } > {}