interface.ts 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. import React, { CSSProperties } from 'react';
  2. import { BaseProps } from '../_base/baseComponent';
  3. export type AvatarShape = 'circle' | 'square';
  4. export type AvatarSize = 'extra-extra-small' | 'extra-small' | 'small' | 'default' | 'medium' | 'large' | 'extra-large';
  5. export type AvatarColor =
  6. | 'amber'
  7. | 'blue'
  8. | 'cyan'
  9. | 'green'
  10. | 'grey'
  11. | 'indigo'
  12. | 'light-blue'
  13. | 'light-green'
  14. | 'lime'
  15. | 'orange'
  16. | 'pink'
  17. | 'purple'
  18. | 'red'
  19. | 'teal'
  20. | 'violet'
  21. | 'yellow';
  22. export interface AvatarProps extends BaseProps {
  23. children?: React.ReactNode;
  24. color?: AvatarColor;
  25. shape?: AvatarShape;
  26. size?: string;
  27. hoverMask?: React.ReactNode;
  28. src?: string;
  29. srcSet?: string;
  30. alt?: string;
  31. gap?: number;
  32. onError?: React.MouseEventHandler;
  33. onClick?: React.MouseEventHandler;
  34. onMouseEnter?: React.MouseEventHandler;
  35. onMouseLeave?: React.MouseEventHandler;
  36. imgAttr?: React.ImgHTMLAttributes<HTMLImageElement>;
  37. bottomSlot?: {
  38. render?: () => React.ReactNode;
  39. shape?: "circle"|"square";
  40. text: React.ReactNode;
  41. bgColor: string;
  42. textColor: string;
  43. className: string;
  44. style?: CSSProperties
  45. };
  46. topSlot?: {
  47. render?: () => React.ReactNode;
  48. gradientStart?: string;
  49. gradientEnd?: string;
  50. text: React.ReactNode;
  51. textColor: string;
  52. className: string;
  53. style?: CSSProperties
  54. };
  55. border?: {
  56. color?: string;
  57. motion?: boolean
  58. } | boolean;
  59. contentMotion?: boolean
  60. }
  61. export type AvatarGroupShape = 'circle' | 'square';
  62. export type AvatarGroupSize = 'extra-extra-small' | 'extra-small' | 'small' | 'default' | 'medium' | 'large' | 'extra-large';
  63. export type AvatarGroupOverlapFrom = 'start' | 'end';
  64. export interface AvatarGroupProps {
  65. children?: React.ReactNode;
  66. shape?: AvatarGroupShape;
  67. size?: string;
  68. overlapFrom?: AvatarGroupOverlapFrom;
  69. maxCount?: number;
  70. renderMore?: (restNumber?: number, restAvatars?: React.ReactNode[]) => React.ReactNode
  71. }