{"version":3,"file":"Text.cjs","sourceRoot":"","sources":["../../../src/jsx/components/Text.ts"],"names":[],"mappings":";;;AAIA,gDAAmD;AA2CnD,MAAM,IAAI,GAAG,MAAM,CAAC;AAEpB;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACU,QAAA,IAAI,GAAG,IAAA,+BAAmB,EAAyB,IAAI,CAAC,CAAC","sourcesContent":["import type { StandardFormattingElement } from './formatting';\nimport type { IconElement } from './Icon';\nimport type { LinkElement } from './Link';\nimport type { SkeletonElement } from './Skeleton';\nimport { createSnapComponent } from '../component';\nimport type { SnapsChildren } from '../component';\n\n/**\n * The children of the {@link Text} component.\n */\nexport type TextChildren = SnapsChildren<\n  | string\n  | StandardFormattingElement\n  | LinkElement\n  | IconElement\n  | SkeletonElement\n>;\n\n/**\n * The colors available to the Text {@link Text} component.\n */\nexport type TextColors =\n  | 'default'\n  | 'alternative'\n  | 'muted'\n  | 'error'\n  | 'success'\n  | 'warning';\n\n/**\n * The props of the {@link Text} component.\n *\n * @property children - The text to display.\n * @property alignment - The alignment of the text.\n * @property color - The color of the text.\n * @property size - The size of the text. Defaults to `md`.\n * @property fontWeight - The font weight of the text. Defaults to `regular`.\n * @category Component Props\n */\nexport type TextProps = {\n  children: TextChildren;\n  alignment?: 'start' | 'center' | 'end' | undefined;\n  color?: TextColors | undefined;\n  size?: 'sm' | 'md' | undefined;\n  fontWeight?: 'regular' | 'medium' | 'bold' | undefined;\n};\n\nconst TYPE = 'Text';\n\n/**\n * A text component, which is used to display text.\n *\n * @param props - The props of the component.\n * @param props.alignment - The alignment of the text.\n * @param props.color - The color of the text.\n * @param props.children - The text to display.\n * @param props.size - The size of the text. Defaults to `md`.\n * @param props.fontWeight - The font weight of the text. Defaults to `regular`.\n * @returns A text element.\n * @example\n * <Text>\n *   Hello <Bold>world</Bold>!\n * </Text>\n * @example\n * <Text alignment=\"end\">\n *   Hello <Bold>world</Bold>!\n * </Text>\n * @example\n * <Text size=\"sm\">\n *   Hello <Bold>world</Bold>!\n * </Text>\n * @example\n * <Text fontWeight=\"medium\">\n *   Hello <Bold>world</Bold>!\n * </Text>\n * @category Components\n */\nexport const Text = createSnapComponent<TextProps, typeof TYPE>(TYPE);\n\n/**\n * A text element.\n *\n * @see {@link Text}\n * @category Elements\n */\nexport type TextElement = ReturnType<typeof Text>;\n"]}