UNPKG

@vuesax-alpha/nightly

Version:
1 lines 5.75 kB
{"version":3,"file":"button.mjs","sources":["../../../../../../packages/components/button/src/button.ts"],"sourcesContent":["import { useColorProp } from '@vuesax-alpha/hooks'\nimport { buildProps } from '@vuesax-alpha/utils'\n\nimport type { ExtractPropTypes } from 'vue'\nimport type Button from './button.vue'\n\nexport const buttonTypes = [\n 'default',\n 'border',\n 'flat',\n 'floating',\n 'gradient',\n 'shadow',\n 'relief',\n 'transparent',\n] as const\n\nexport const buttonSizes = ['xl', 'large', 'default', 'small', 'mini'] as const\n\nexport const buttonProps = buildProps({\n /**\n * @description Determine if the component is active and change its style to that state.\n */\n active: { type: Boolean },\n\n /**\n * @description Determine if the animation is active for the user when hovering.\n */\n animateInactive: { type: Boolean },\n\n /**\n * @description Change the type of animation, this property only works if you have the slot animate.\n * @enum `scale` | `rotate` | `vertical`\n */\n animationType: {\n type: String,\n values: ['scale', 'rotate', 'vertical'] as const,\n },\n\n /**\n * @description Change the width of the component to the possible total determined by the parent element.\n */\n block: {\n type: Boolean,\n },\n\n /**\n * @description Component color - Accept Vuesax's color, Hex, rgb\n * @default 'primary'\n */\n color: { ...useColorProp, default: 'primary' },\n\n /**\n * @description Determine if the component contains only one icon,\n * by adding this property the component has an equal width and height.\n */\n icon: {\n type: Boolean,\n },\n\n /**\n * @description Add a loading animation to the avatar.\n */\n loading: { type: Boolean },\n\n /**\n * @description Change the style of the avatar by making it [square | circulating | rounded]\n * @enum | `circle` | `square` |\n */\n shape: {\n type: String,\n values: ['circle', 'square'] as const,\n },\n\n /**\n * @description Change the size of the avatar component.\n * @enum | `xl` | `large` | `default` | `small` | `mini` |\n * @default 'default'\n */\n size: {\n type: [Number, String],\n values: buttonSizes,\n default: 'default',\n },\n\n /**\n * @description ripple style\n * @enum `cut` | `reverse`\n */\n ripple: {\n type: String,\n values: ['cut', 'reverse'] as const,\n },\n\n /**\n * @description Change the style of the component and its states.\n * @enum `default` | `border` | `flat` | `floating` | `gradient` | `shadow` | `relief` | `transparent`\n * @default 'default'\n */\n type: {\n type: String,\n values: buttonTypes,\n default: 'default',\n },\n\n /**\n * Determine if the component has the upload status active\n * by changing the style and adding the animation.\n */\n upload: {\n type: Boolean,\n },\n /** @deprecated @description use prop `type` instead */\n border: { type: Boolean },\n /** @deprecated @description use prop `type` instead */\n flat: { type: Boolean },\n /** @deprecated @description use prop `type` instead */\n floating: { type: Boolean },\n /** @deprecated @description use prop `type` instead */\n gradient: { type: Boolean },\n /** @deprecated @description use prop `type` instead */\n shadow: { type: Boolean },\n /** @deprecated @description use prop `type` instead */\n relief: { type: Boolean },\n /** @deprecated @description use prop `type` instead */\n transparent: { type: Boolean },\n /** @deprecated @description use prop `shape` instead */\n square: { type: Boolean },\n /** @deprecated @description use prop `shape` instead */\n circle: { type: Boolean },\n /** @deprecated */\n to: { type: [String, Object] },\n /** @deprecated */\n href: { type: String },\n /** @deprecated */\n blank: { type: Boolean },\n} as const)\n\nexport type ButtonProps = ExtractPropTypes<typeof buttonProps>\nexport type ButtonInstance = InstanceType<typeof Button>\n"],"names":[],"mappings":";;;;;AAMO,MAAM,WAAc,GAAA;AAAA,EACzB,SAAA;AAAA,EACA,QAAA;AAAA,EACA,MAAA;AAAA,EACA,UAAA;AAAA,EACA,UAAA;AAAA,EACA,QAAA;AAAA,EACA,QAAA;AAAA,EACA,aAAA;AACF,EAAA;AAEO,MAAM,cAAc,CAAC,IAAA,EAAM,OAAS,EAAA,SAAA,EAAW,SAAS,MAAM,EAAA;AAE9D,MAAM,cAAc,UAAW,CAAA;AAAA,EAIpC,MAAA,EAAQ,EAAE,IAAA,EAAM,OAAQ,EAAA;AAAA,EAKxB,eAAA,EAAiB,EAAE,IAAA,EAAM,OAAQ,EAAA;AAAA,EAMjC,aAAe,EAAA;AAAA,IACb,IAAM,EAAA,MAAA;AAAA,IACN,MAAQ,EAAA,CAAC,OAAS,EAAA,QAAA,EAAU,UAAU,CAAA;AAAA,GACxC;AAAA,EAKA,KAAO,EAAA;AAA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