@octopusdeploy/design-system-components
Version:
The design systems component library.
19 lines (18 loc) • 949 B
TypeScript
import type { DesignSystemLinkHref } from "../../routing";
import { type CategoryTagProps } from "./CategoryTag";
import { type TagProps } from "./Tag";
/** A tag in the group: a plain `Tag`, or a `CategoryTag` when it carries a `color`. */
export type TagGroupItem = TagProps | CategoryTagProps;
export interface TagGroupProps {
/** Array of tags to render. Items with a `color` render as a `CategoryTag`, others as a `Tag`. */
tags: TagGroupItem[];
/** Limit the number of visible tags */
limit?: {
/** Maximum number of tags to display before showing '+X more' */
count: number;
/** Link for the '+X more' text. Should navigate to a page where all tags can be viewed. */
link: DesignSystemLinkHref;
};
}
export declare function isCategoryTag(tag: TagGroupItem): tag is CategoryTagProps;
export declare function TagGroup({ tags, limit }: TagGroupProps): import("react/jsx-runtime").JSX.Element;