vira
Version:
A simple and highly versatile design system using element-vir.
46 lines (45 loc) • 1.81 kB
TypeScript
import { type PartialWithUndefined } from '@augment-vir/common';
import { type AttributeValues, type CSSResult } from 'element-vir';
import { type SpaRoute, type SpaRouter } from 'spa-router-vir';
/**
* The route properties required for using {@link ViraLink} with a route.
*
* @category Internal
*/
export type ViraLinkRoute = Readonly<{
route: SpaRoute<any, any, any>;
router: Pick<SpaRouter<any, any, any>, 'createRouteUrl' | 'setRouteOnDirectNavigation'>;
scrollToTop?: boolean;
}>;
/**
* A hyperlink wrapper element that can be configured to emit route change events rather than just
* being a raw link.
*
* @category Link
* @category Elements
* @see https://electrovir.github.io/element-vir/vira/book/elements/vira-link
*/
export declare const ViraLink: import("element-vir").DeclarativeElementDefinition<"vira-link", import("type-fest/source/require-exactly-one.js")._RequireExactlyOne<{
/**
* A full raw URL link that will navigate the current window away or open a new tab. If this
* property is provided for the inputs, don't provide a route property.
*/
link: {
url: string;
newTab: boolean;
};
/**
* A route that'll change that current page without navigating the window. If this property
* is provided for the inputs, don't provide a link property.
*/
route: ViraLinkRoute;
}, "link" | "route"> & PartialWithUndefined<{
/** Styles that will be applied directly to the inner elements. */
stylePassthrough: Readonly<PartialWithUndefined<{
a: CSSResult;
}>>;
/** Attributes that will be applied directly to the inner elements. */
attributePassthrough: Readonly<PartialWithUndefined<{
a: AttributeValues;
}>>;
}>, {}, {}, "vira-link-", "vira-link-hover-color", readonly []>;