interface.ts 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. 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. content: React.ReactNode
  41. };
  42. topSlot?: {
  43. gradientStart?: string;
  44. gradientEnd?: string;
  45. content: React.ReactNode
  46. };
  47. border?: boolean;
  48. borderMotion?: boolean
  49. }
  50. export type AvatarGroupShape = 'circle' | 'square';
  51. export type AvatarGroupSize = 'extra-extra-small' | 'extra-small' | 'small' | 'default' | 'medium' | 'large' | 'extra-large';
  52. export type AvatarGroupOverlapFrom = 'start' | 'end';
  53. export interface AvatarGroupProps {
  54. children?: React.ReactNode;
  55. shape?: AvatarGroupShape;
  56. size?: AvatarGroupSize;
  57. overlapFrom?: AvatarGroupOverlapFrom;
  58. maxCount?: number;
  59. renderMore?: (restNumber?: number, restAvatars?: React.ReactNode[]) => React.ReactNode
  60. }