interface.ts 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. import React 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?: AvatarSize;
  27. hoverMask?: React.ReactNode;
  28. src?: string;
  29. srcSet?: string;
  30. alt?: string;
  31. onError?: React.MouseEventHandler;
  32. onClick?: React.MouseEventHandler;
  33. onMouseEnter?: React.MouseEventHandler;
  34. onMouseLeave?: React.MouseEventHandler;
  35. imgAttr?: React.ImgHTMLAttributes<HTMLImageElement>;
  36. }
  37. export type AvatarGroupShape = 'circle' | 'square';
  38. export type AvatarGroupSize = 'extra-extra-small' | 'extra-small' | 'small' | 'medium' | 'large' | 'extra-large';
  39. export type AvatarGroupOverlapFrom = 'start' | 'end';
  40. export interface AvatarGroupProps {
  41. children?: React.ReactNode;
  42. shape?: AvatarGroupShape;
  43. size?: AvatarGroupSize;
  44. overlapFrom?: AvatarGroupOverlapFrom;
  45. maxCount?: number;
  46. renderMore?: (restNumber?: number, restAvatars?: React.ReactNode[]) => React.ReactNode;
  47. }