@radix-ui/themes
Version:
[](https://radix-ui.com/themes)
38 lines (34 loc) • 840 B
text/typescript
import {
weightPropDef,
textAlignPropDef,
leadingTrimPropDef,
highContrastPropDef,
colorPropDef,
textWrapPropDef,
truncatePropDef,
asChildPropDef,
} from '../props/index.js';
import type { PropDef } from '../props/index.js';
const as = ['span', 'div', 'label', 'p'] as const;
const sizes = ['1', '2', '3', '4', '5', '6', '7', '8', '9'] as const;
const textPropDefs = {
as: { type: 'enum', values: as, default: 'span' },
...asChildPropDef,
size: {
type: 'enum',
className: 'rt-r-size',
values: sizes,
responsive: true,
},
...weightPropDef,
...textAlignPropDef,
...leadingTrimPropDef,
...truncatePropDef,
...textWrapPropDef,
...colorPropDef,
...highContrastPropDef,
} satisfies {
as: PropDef<(typeof as)[number]>;
size: PropDef<(typeof sizes)[number]>;
};
export { textPropDefs };