UNPKG

@vuesax-alpha/nightly

Version:
1 lines 3.38 kB
{"version":3,"file":"avatar.mjs","sources":["../../../../../../packages/components/avatar/src/avatar.ts"],"sourcesContent":["import { buildProps, isValidComponentColor } from '@vuesax-alpha/utils'\nimport { vuesaxColors } from '@vuesax-alpha/constants'\nimport { useColorProp } from '@vuesax-alpha/hooks'\nimport type { ExtractPropTypes } from 'vue'\nimport type Avatar from './avatar.vue'\n\nexport const avatarProps = buildProps({\n /**\n * @description Component color - Accept Vuesax's color, Hex, rgb\n */\n color: useColorProp,\n\n /**\n * @description Badge position\n * @enum | top-right | bottom-right | bottom-left | top-left\n * @default 'bottom-right'\n */\n badgePosition: {\n type: String,\n values: ['top-right', 'bottom-right', 'bottom-left', 'top-left'] as const,\n default: 'bottom-right',\n },\n\n /**\n * @description Change the color of the badge inside the avatar.\n * @default 'primary'\n */\n badgeColor: {\n type: String,\n values: vuesaxColors,\n validator: isValidComponentColor,\n default: 'primary',\n },\n\n /**\n * @description Determine if the badge is active.\n */\n badge: { type: Boolean },\n\n /**\n * @description Add a border to the avatar.\n */\n history: { type: Boolean },\n\n /**\n * @description truefalse\tChange the color of the border to a gradient.\n */\n historyGradient: { type: Boolean },\n\n /**\n * @description Add a loading animation to the avatar.\n */\n loading: { type: Boolean },\n\n /**\n * @description Determine if the avatar has a pointer cursor.\n */\n pointer: { type: Boolean },\n\n /**\n * @description Change the style of the avatar by making it [square | circulating | rounded]\n * @enum | circle | square | default |\n * @default 'default'\n */\n shape: {\n type: String,\n values: ['circle', 'square', 'default'] as const,\n default: 'default',\n },\n\n /**\n * @description Change the size of the avatar component.\n */\n size: {\n type: [Number, String],\n },\n\n /**\n * @description Add an animation to the writing badge.\n */\n writing: { type: Boolean },\n\n /** @deprecated */\n circle: {\n type: Boolean,\n },\n /** @deprecated */\n square: {\n type: Boolean,\n },\n} as const)\n\nexport type AvatarProps = ExtractPropTypes<typeof avatarProps>\nexport type AvatarInstance = InstanceType<typeof Avatar>\n"],"names":[],"mappings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