import { SlotProps } from "../types.mjs"; import { textSize } from "../utils/styleProps.mjs"; import { CursorProp, FontSizeProp, FontStyleProp, FontWeightProp, LineHeightProp, TextAlignProp, TextWrapProp, WhiteSpaceProps } from "@marigold/system"; import { JSX, ReactNode } from "react"; import RAC from "react-aria-components"; import { AriaLabelingProps } from "@marigold/types"; /** * The shared body-text variant scale. Reused by `Description` so body * primitives share one variant vocabulary. Will become a typography * token in a future PR. */ export type TextVariant = 'default' | 'muted'; /** * The shared body-text size scale. Derived from the `textSize` style-prop * record in `@marigold/system` so the two stay in lockstep. Other body * primitives derive their size unions from this via `Extract`. * Will become a typography token in a future PR. */ export type TextSize = 'default' | keyof typeof textSize; type RemovedProps = 'elementType' | 'slot' | keyof JSX.IntrinsicElements['div'] | keyof JSX.IntrinsicElements['span'] | keyof JSX.IntrinsicElements['p']; export interface TextProps extends AriaLabelingProps, Omit, SlotProps, TextAlignProp, FontSizeProp, FontWeightProp, FontStyleProp, LineHeightProp, CursorProp, TextWrapProp, WhiteSpaceProps { /** * Children of the component. */ children?: ReactNode; /** * Set the text color. * @default currentColor */ color?: string; /** * Element to render * @default "div" */ as?: 'div' | 'p' | 'span'; /** * Visual variant of the component. Which values exist is defined by the theme * and listed in the "Appearance" section of the component's documentation. */ variant?: TextVariant | (string & {}); /** * Size of the component. Which values exist is defined by the theme and listed * in the "Appearance" section of the component's documentation. */ size?: TextSize | (string & {}); } declare const Text: ({ variant, size, color, align, cursor, weight, fontSize, fontStyle, lineHeight, wrap, whiteSpace, children, as, slot, ...props }: TextProps) => JSX.Element; export { Text };