maz-ui
Version:
A standalone components library for Vue.Js 3 & Nuxt.Js 3
117 lines (116 loc) • 3.64 kB
TypeScript
import { IconComponent } from '@maz-ui/icons';
import { HTMLAttributes } from 'vue';
import { RouteLocationRaw } from 'vue-router';
import { MazColor } from './types';
export interface MazLinkProps {
/**
* The class attribute of the link
* @default undefined
*/
class?: HTMLAttributes['class'];
/**
* The style attribute of the link
* @default undefined
*/
style?: HTMLAttributes['style'];
/**
* The component to use for the link - if not provided, it will be `router-link` if `to` is provided, will be `a` if `href` is provided, otherwise it will be `button`, you can force the component to be used with `as` prop
* @default depends on the provided props
* @values 'a', 'router-link', 'nuxt-link', 'button'
*/
as?: string | 'a' | 'router-link' | 'nuxt-link' | 'button';
/**
* The id of the link
* @default undefined
*/
id?: string;
/**
* The title of the link
* @default undefined
*/
title?: string;
/**
* The href of the link
* @default undefined
*/
href?: string;
/** The route location (router-link) of the link */
to?: RouteLocationRaw;
/**
* The color of the link
* @default 'primary'
* When 'none', the link will not have any color, so it will inherit the color of the parent
*/
color?: MazColor | 'muted' | 'background' | 'inherit';
/**
* The target of the link
* @default '_self'
* @values '_blank', '_self', '_parent', '_top'
*/
target?: '_blank' | '_self' | '_parent' | '_top' | string;
/**
* The download of the link
* @default undefined
*/
download?: string;
/**
* The rel of the link
* @default undefined
*/
rel?: string;
/**
* The aria-label of the link
* @default undefined
*/
ariaLabel?: string;
/**
* Add an underline to the link
* @default false
*/
underline?: boolean;
/**
* Add an underline only on hover
* @default true
*/
underlineHover?: boolean;
/**
* Add an external icon to the link if target is '_blank'
* @default true
*/
autoExternal?: boolean;
/**
* The name of the icon or component to display on the left of the text
* `@type` `{string | FunctionalComponent | ComponentPublicInstance | Component}`
*/
leftIcon?: string | IconComponent;
/**
* The name of the icon or component to display on the right of the text
* `@type` `{string | FunctionalComponent | ComponentPublicInstance | Component}`
*/
rightIcon?: string | IconComponent;
/**
* The disabled state of the link if the component is a button
* @default false
*/
disabled?: boolean;
}
declare function __VLS_template(): {
attrs: Partial<{}>;
slots: {
'left-icon'?(_: {}): any;
default?(_: {}): any;
'right-icon'?(_: {}): any;
'external-icon'?(_: {}): any;
};
refs: {};
rootEl: any;
};
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
declare const __VLS_component: import('vue').DefineComponent<MazLinkProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<MazLinkProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
export default _default;
type __VLS_WithTemplateSlots<T, S> = T & {
new (): {
$slots: S;
};
};