UNPKG

@atlaskit/primitives

Version:

Primitives are token-backed low-level building blocks.

47 lines (46 loc) 1.49 kB
/** * @jsxRuntime classic * @jsx jsx */ import { type ComponentPropsWithRef, type ElementType, type ReactNode } from 'react'; import type { BasePrimitiveProps, MetricTextFontSize, TextAlign } from './types'; declare const asAllowlist: readonly ["span", "div"]; type AsElement = (typeof asAllowlist)[number]; type MetricTextPropsBase<T extends ElementType = 'span'> = { /** * HTML tag to be rendered. Defaults to `span`. */ as?: AsElement; /** * Elements rendered within the Text element. */ children: ReactNode; /** * The [HTML `id` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id). */ id?: string; /** * Text alignment. */ align?: TextAlign; /** * Text size. */ size: MetricTextFontSize; /** * Forwarded ref. */ ref?: ComponentPropsWithRef<T>['ref']; }; export type MetricTextProps<T extends ElementType = 'span'> = MetricTextPropsBase<T> & Omit<BasePrimitiveProps, 'xcss'>; /** * __MetricText__ * * MetricText is a primitive component that has the Atlassian Design System's design guidelines baked in. * It is designed for use specifically with displaying metrics and is not to be used for headings or general UI text. * It renders a `span` by default. * * @internal */ declare const MetricText: React.ForwardRefExoticComponent<React.PropsWithoutRef<MetricTextProps<ElementType>> & React.RefAttributes<any>>; export default MetricText;