廓形仪rn版本-技术调研
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
887 B

  1. import React from 'react';
  2. import type { VariantProps } from '@gluestack-ui/nativewind-utils';
  3. import { textStyle } from './styles';
  4. type ITextProps = React.ComponentProps<'span'> & VariantProps<typeof textStyle>;
  5. const Text = React.forwardRef<React.ComponentRef<'span'>, ITextProps>(
  6. function Text(
  7. {
  8. className,
  9. isTruncated,
  10. bold,
  11. underline,
  12. strikeThrough,
  13. size = 'md',
  14. sub,
  15. italic,
  16. highlight,
  17. ...props
  18. }: { className?: string } & ITextProps,
  19. ref
  20. ) {
  21. return (
  22. <span
  23. className={textStyle({
  24. isTruncated,
  25. bold,
  26. underline,
  27. strikeThrough,
  28. size,
  29. sub,
  30. italic,
  31. highlight,
  32. class: className,
  33. })}
  34. {...props}
  35. ref={ref}
  36. />
  37. );
  38. }
  39. );
  40. Text.displayName = 'Text';
  41. export { Text };