{"version":3,"file":"avatar.mjs","sources":["../../../../../../packages/components/avatar/src/avatar.ts"],"sourcesContent":["import {\r\n  buildProps,\r\n  definePropType,\r\n  iconPropType,\r\n  isNumber,\r\n  componentSizes\r\n} from '@sgui-plus/utils'\r\nimport type { ExtractPropTypes } from 'vue'\r\nimport type { ObjectFitProperty } from 'csstype'\r\n\r\nexport const avatarProps = buildProps({\r\n  /**\r\n   * @description avatar size.\r\n   */\r\n  size: {\r\n    type: [Number, String],\r\n    values: componentSizes,\r\n    default: '',\r\n    validator: (val: unknown): val is number => isNumber(val),\r\n  },\r\n  /**\r\n   * @description avatar shape.\r\n   */\r\n  shape: {\r\n    type: String,\r\n    values: ['circle', 'square'],\r\n    default: 'circle',\r\n  },\r\n  /**\r\n   * @description representation type to icon, more info on icon component.\r\n   */\r\n  icon: {\r\n    type: iconPropType,\r\n  },\r\n  /**\r\n   * @description the source of the image for an image avatar.\r\n   */\r\n  src: {\r\n    type: String,\r\n    default: '',\r\n  },\r\n  /**\r\n   * @description native attribute `alt` of image avatar.\r\n   */\r\n  alt: String,\r\n  /**\r\n   * @description native attribute srcset of image avatar.\r\n   */\r\n  srcSet: String,\r\n  /**\r\n   * @description set how the image fit its container for an image avatar.\r\n   */\r\n  fit: {\r\n    type: definePropType<ObjectFitProperty>(String),\r\n    default: 'cover',\r\n  },\r\n} as const)\r\nexport type AvatarProps = ExtractPropTypes<typeof avatarProps>\r\n\r\nexport const avatarEmits = {\r\n  error: (evt: Event) => evt instanceof Event,\r\n}\r\nexport type AvatarEmits = typeof avatarEmits\r\n"],"names":[],"mappings":";;;;;;AAOY,MAAC,WAAW,GAAG,UAAU,CAAC;AACtC,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;AAC1B,IAAI,MAAM,EAAE,cAAc;AAC1B,IAAI,OAAO,EAAE,EAAE;AACf,IAAI,SAAS,EAAE,CAAC,GAAG,KAAK,QAAQ,CAAC,GAAG,CAAC;AACrC,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC;AAChC,IAAI,OAAO,EAAE,QAAQ;AACrB,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,YAAY;AACtB,GAAG;AACH,EAAE,GAAG,EAAE;AACP,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,GAAG,EAAE,MAAM;AACb,EAAE,MAAM,EAAE,MAAM;AAChB,EAAE,GAAG,EAAE;AACP,IAAI,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC;AAChC,IAAI,OAAO,EAAE,OAAO;AACpB,GAAG;AACH,CAAC,EAAE;AACS,MAAC,WAAW,GAAG;AAC3B,EAAE,KAAK,EAAE,CAAC,GAAG,KAAK,GAAG,YAAY,KAAK;AACtC;;;;"}