@hashicorp/design-system-components
Version:
Helios Design System Components
77 lines (76 loc) • 2.9 kB
TypeScript
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/
import Component from '@glimmer/component';
import { HdsLinkIconPositionValues, HdsLinkColorValues, HdsLinkStandaloneSizeValues } from './types.ts';
import type { HdsInteractiveSignature } from '../interactive/';
import type { HdsLinkColors, HdsLinkIconPositions, HdsLinkStandaloneSizes } from './types.ts';
import type { HdsIconSignature } from '../icon';
import type Owner from '@ember/owner';
export interface HdsLinkStandaloneSignature {
Args: HdsInteractiveSignature['Args'] & {
size?: HdsLinkStandaloneSizes;
color?: HdsLinkColors;
text: string;
icon: HdsIconSignature['Args']['name'];
iconPosition?: HdsLinkIconPositions;
};
Element: HdsInteractiveSignature['Element'];
}
export declare const DEFAULT_ICON_POSITION = HdsLinkIconPositionValues.Leading;
export declare const DEFAULT_COLOR = HdsLinkColorValues.Primary;
export declare const DEFAULT_SIZE = HdsLinkStandaloneSizeValues.Medium;
export declare const ICON_POSITIONS: HdsLinkIconPositions[];
export declare const COLORS: HdsLinkColors[];
export declare const SIZES: HdsLinkStandaloneSizes[];
export default class HdsLinkStandalone extends Component<HdsLinkStandaloneSignature> {
constructor(owner: Owner, args: HdsLinkStandaloneSignature['Args']);
/**
* @param text
* @type {string}
* @description The text of the link. If no text value is defined an error will be thrown.
*/
get text(): string;
/**
* @param color
* @type {string}
* @default primary
* @description Determines the color of link to be used; acceptable values are `primary` and `secondary`
*/
get color(): HdsLinkColors;
/**
* @param icon
* @type {string|null}
* @default null
* @description The name of the icon to be used. An icon name must be defined.
*/
get icon(): HdsIconSignature['Args']['name'];
/**
* @param iconPosition
* @type {HdsLinkIconPositions}
* @default leading
* @description Positions the icon before or after the text; allowed values are `leading` or `trailing`
*/
get iconPosition(): HdsLinkIconPositions;
/**
* @param size
* @type {HdsLinkStandaloneSizes}
* @default medium
* @description The size of the standalone link; acceptable values are `small`, `medium`, and `large`
*/
get size(): HdsLinkStandaloneSizes;
/**
* @param iconSize
* @type {string}
* @default 16
* @description ensures that the correct icon size is used. Automatically calculated.
*/
get iconSize(): HdsIconSignature['Args']['size'];
/**
* Get the class names to apply to the component.
* @method LinkStandalone#classNames
* @return {string} The "class" attribute to apply to the component.
*/
get classNames(): string;
}