{"$schema":"https:\/\/ui.particle.academy\/schema\/registry-item.json","name":"text","type":"registry:ui","title":"Text","description":"Text from react-fancy","package":"react-fancy","dependencies":[],"registryDependencies":[],"files":[{"path":"components\/fancy\/text\/Text.tsx","content":"import { forwardRef } from \"react\";\r\nimport { cn } from \"..\/..\/utils\/cn\";\r\nimport type { TextProps } from \".\/Text.types\";\r\n\r\nconst sizeClasses: Record<NonNullable<TextProps[\"size\"]>, string> = {\r\n  xs: \"text-xs\",\r\n  sm: \"text-sm\",\r\n  md: \"text-base\",\r\n  lg: \"text-lg\",\r\n};\r\n\r\nconst weightClasses: Record<NonNullable<TextProps[\"weight\"]>, string> = {\r\n  normal: \"font-normal\",\r\n  medium: \"font-medium\",\r\n  semibold: \"font-semibold\",\r\n  bold: \"font-bold\",\r\n};\r\n\r\nconst colorClasses: Record<NonNullable<TextProps[\"color\"]>, string> = {\r\n  default: \"text-zinc-900 dark:text-zinc-100\",\r\n  muted: \"text-zinc-500 dark:text-zinc-400\",\r\n  accent: \"text-blue-600 dark:text-blue-400\",\r\n  danger: \"text-red-600 dark:text-red-400\",\r\n  success: \"text-emerald-600 dark:text-emerald-400\",\r\n};\r\n\r\nexport const Text = forwardRef<HTMLElement, TextProps>(\r\n  (\r\n    {\r\n      as: Tag = \"p\",\r\n      size = \"md\",\r\n      weight = \"normal\",\r\n      color = \"default\",\r\n      className,\r\n      children,\r\n      ...props\r\n    },\r\n    ref,\r\n  ) => {\r\n    return (\r\n      <Tag\r\n        ref={ref as React.Ref<never>}\r\n        data-react-fancy-text=\"\"\r\n        className={cn(\r\n          sizeClasses[size],\r\n          weightClasses[weight],\r\n          colorClasses[color],\r\n          className,\r\n        )}\r\n        {...props}\r\n      >\r\n        {children}\r\n      <\/Tag>\r\n    );\r\n  },\r\n);\r\n\r\nText.displayName = \"Text\";\r\n","type":"registry:ui","target":"components\/fancy\/text\/Text.tsx"},{"path":"components\/fancy\/text\/Text.types.ts","content":"import type { HTMLAttributes } from \"react\";\r\n\r\nexport interface TextProps extends HTMLAttributes<HTMLElement> {\r\n  \/** Which element to render *\/\r\n  as?: \"p\" | \"span\" | \"div\" | \"label\";\r\n  \/** Text size *\/\r\n  size?: \"xs\" | \"sm\" | \"md\" | \"lg\";\r\n  \/** Font weight *\/\r\n  weight?: \"normal\" | \"medium\" | \"semibold\" | \"bold\";\r\n  \/** Text color preset *\/\r\n  color?: \"default\" | \"muted\" | \"accent\" | \"danger\" | \"success\";\r\n}\r\n","type":"registry:ui","target":"components\/fancy\/text\/Text.types.ts"},{"path":"components\/fancy\/text\/index.ts","content":"export { Text } from \".\/Text\";\r\nexport type { TextProps } from \".\/Text.types\";\r\n","type":"registry:ui","target":"components\/fancy\/text\/index.ts"}]}