@payfit/unity-components
Version:
261 lines (260 loc) • 5.95 kB
TypeScript
import { VariantProps } from '@payfit/unity-themes';
import { CSSProperties, HTMLAttributes } from 'react';
import { LinkProps as AriaLinkProps } from 'react-aria-components/Link';
export declare const link: import('tailwind-variants').TVReturnType<{
variant: {
inline: {
base: string;
icon: string;
};
standalone: {
base: string;
icon: string;
};
};
size: {
default: {
base: string;
};
large: {
base: string;
};
small: {
base: string;
};
inherit: {
base: string;
};
};
color: {
primary: {
base: string[];
};
secondary: {
base: string[];
};
inherit: {
base: string;
};
};
isDisabled: {
true: {
base: string;
};
false: {
base: string;
};
};
isTruncated: {
true: {
base: string;
};
false: {
base: string;
};
};
}, {
base: string[];
icon: string[];
}, undefined, {
variant: {
inline: {
base: string;
icon: string;
};
standalone: {
base: string;
icon: string;
};
};
size: {
default: {
base: string;
};
large: {
base: string;
};
small: {
base: string;
};
inherit: {
base: string;
};
};
color: {
primary: {
base: string[];
};
secondary: {
base: string[];
};
inherit: {
base: string;
};
};
isDisabled: {
true: {
base: string;
};
false: {
base: string;
};
};
isTruncated: {
true: {
base: string;
};
false: {
base: string;
};
};
}, {
base: string[];
icon: string[];
}, import('tailwind-variants').TVReturnType<{
variant: {
inline: {
base: string;
icon: string;
};
standalone: {
base: string;
icon: string;
};
};
size: {
default: {
base: string;
};
large: {
base: string;
};
small: {
base: string;
};
inherit: {
base: string;
};
};
color: {
primary: {
base: string[];
};
secondary: {
base: string[];
};
inherit: {
base: string;
};
};
isDisabled: {
true: {
base: string;
};
false: {
base: string;
};
};
isTruncated: {
true: {
base: string;
};
false: {
base: string;
};
};
}, {
base: string[];
icon: string[];
}, undefined, unknown, unknown, undefined>>;
type LinkVariantProps = VariantProps<typeof link>;
export type RawLinkProps = Omit<AriaLinkProps, 'style' | 'className'> & {
/**
* The URL the link navigates to.
*/
href: HTMLAnchorElement['href'];
/**
* The link id
*/
id?: HTMLAttributes<HTMLAnchorElement>['id'];
/**
* The link's size.
* @default 'inherit'
*/
size?: LinkVariantProps['size'];
/**
* The link's display variant. Links can be inline with text or standalone (block).
* @default 'inline'
*/
variant?: LinkVariantProps['variant'];
/**
* The link's color.
* @default 'primary'
*/
color?: LinkVariantProps['color'];
/**
* Whether the link navigates to an external page. If true, the link will open in a new tab and display an indicator icon.
* @default false
*/
isExternal?: boolean;
/**
* Whether the link marks the current section or page.
* @default false
*/
isCurrent?: Pick<HTMLAttributes<HTMLAnchorElement>, 'aria-current'> | undefined;
/**
* When true, the active state will only be applied if the location is matched exactly.
* @default false
*/
isExact?: boolean;
maxCharactersTruncation?: number;
maxWidthTruncation?: CSSProperties['maxWidth'];
};
/**
* Links allow users to navigate to different pages or sections.
*/
declare const RawLink: import('react').ForwardRefExoticComponent<Omit<AriaLinkProps, "style" | "className"> & {
/**
* The URL the link navigates to.
*/
href: HTMLAnchorElement["href"];
/**
* The link id
*/
id?: HTMLAttributes<HTMLAnchorElement>["id"];
/**
* The link's size.
* @default 'inherit'
*/
size?: LinkVariantProps["size"];
/**
* The link's display variant. Links can be inline with text or standalone (block).
* @default 'inline'
*/
variant?: LinkVariantProps["variant"];
/**
* The link's color.
* @default 'primary'
*/
color?: LinkVariantProps["color"];
/**
* Whether the link navigates to an external page. If true, the link will open in a new tab and display an indicator icon.
* @default false
*/
isExternal?: boolean;
/**
* Whether the link marks the current section or page.
* @default false
*/
isCurrent?: Pick<HTMLAttributes<HTMLAnchorElement>, "aria-current"> | undefined;
/**
* When true, the active state will only be applied if the location is matched exactly.
* @default false
*/
isExact?: boolean;
maxCharactersTruncation?: number;
maxWidthTruncation?: CSSProperties["maxWidth"];
} & {
children?: import('react').ReactNode | undefined;
} & import('react').RefAttributes<HTMLAnchorElement>>;
export { RawLink };