import { SvelteComponentTyped, type ComponentConstructorOptions } from "svelte"; import type { SvelteHTMLElements } from "svelte/elements"; type $RestProps = NoInfer; type $Elements = { [$Tag in keyof HTMLElementTagNameMap]: Omit<$RestProps<$Tag>, keyof $Props<$Tag>> }; type $Props = { /** * Set the Carbon type style. Use `"inherit"` to apply no type style and * keep the parent's font size, weight, and line height, for example to * recolor text inside a component slot. * @default "body-01" */ type?: "inherit" | "label-01" | "label-02" | "helper-text-01" | "helper-text-02" | "legal-01" | "legal-02" | "body-compact-01" | "body-compact-02" | "body-01" | "body-02" | "code-01" | "code-02" | "heading-compact-01" | "heading-compact-02" | "heading-01" | "heading-02" | "heading-03" | "heading-04" | "heading-05" | "heading-06" | "heading-07" | "fluid-heading-03" | "fluid-heading-04" | "fluid-heading-05" | "fluid-heading-06" | "fluid-paragraph-01" | "fluid-quotation-01" | "fluid-quotation-02" | "fluid-display-01" | "fluid-display-02" | "fluid-display-03" | "fluid-display-04"; /** * Set the text color using a Carbon text token. */ color?: "primary" | "secondary" | "placeholder" | "helper" | "on-color" | "inverse" | "error" | "success" | "link" | "disabled" | undefined; /** * Set the font weight. */ weight?: "light" | "regular" | "semibold" | undefined; /** * Set to `true` to render italic text * @default false */ italic?: boolean; /** * Set the font family. */ family?: "mono" | "sans" | "serif" | "sans-condensed" | "sans-hebrew" | undefined; /** * Set text wrapping behavior. */ wrap?: "break-word" | "nowrap" | undefined; /** * Set to `true` to balance line lengths across broken headings and short blocks * @default false */ balance?: boolean; /** * Set to `true` to avoid orphaned words at the end of wrapped paragraphs * @default false */ pretty?: boolean; /** * Set the max width. Numbers are treated as pixels; strings accept any CSS length (e.g. `"38ch"`, `"20rem"`). */ maxWidth?: number | string | undefined; /** * Set to `true` to span the full width of the container * @default false */ fullWidth?: boolean; /** * Truncate text after this many lines. Values above `1` use multiline mode (end clamp only). */ lines?: number | undefined; /** * Specify `"end"` or `"front"`. `"front"` only works when `lines` is `1`. * @default "end" */ clamp?: "end" | "front"; /** * Specify the tag name. * @default "p" */ tag?: Tag; children?: (this: void) => void; [key: `data-${string}`]: unknown; }; export type TextProps = $Elements[Tag] & $Props; export default class Text extends SvelteComponentTyped< TextProps, Record, { default: Record } > { constructor(options: ComponentConstructorOptions>); }