import { SvelteComponentTyped } from "svelte"; import type { SvelteHTMLElements } from "svelte/elements"; type $RestProps = SvelteHTMLElements["div"] & SvelteHTMLElements["button"] & SvelteHTMLElements["a"]; type $Props = { /** * Specify the type of tag. */ type?: "red" | "magenta" | "purple" | "blue" | "cyan" | "teal" | "green" | "gray" | "cool-gray" | "warm-gray" | "high-contrast" | "outline" | undefined; /** * Specify the size of the tag. * Defaults to `"default"`, or to the `size` of a parent `TagSet`. * Also accepts Carbon v11's `"md"` (`"default"`). */ size?: "xs" | "sm" | "default" | "lg" | "md" | undefined; /** * Set to `true` to use filterable variant * @default false */ filter?: boolean; /** * Set to `true` to disable a filterable tag * @default false */ disabled?: boolean; /** * Set to `true` to render a `button` element instead of a `div` * @default false */ interactive?: boolean; /** * Specify the `href` attribute to render the tag as an anchor. * Mutually exclusive with `filter`; when both are set, `filter` takes precedence. */ href?: string | undefined; /** * Set to `true` to display the skeleton state * @default false */ skeleton?: boolean; /** * Set to `true` to omit the default outer margin. * @deprecated has no effect -- tags have no outer margin, as in Carbon * v11. Space tags with their container, such as `Stack` or `TagSet`. * @default false */ inline?: boolean; /** * Set the label of the close button in a filterable tag. * Shown in a tooltip on hover and focus, and leads the button's accessible name. * The tag element gets no native `title` attribute from this prop. * @default "Clear filter" */ title?: string; /** * Override the tag's 208px width cap. * Accepts any CSS length (for example `"8rem"`, `"120px"`, or `"100%"` to fit the container). * At any width, a truncated label shows its full text in a tooltip. */ maxWidth?: string | undefined; /** * Specify the icon to render. */ icon?: Icon | undefined; /** * Specify a value that identifies the tag inside a `TagSet`. * Returned as `tag.value` in the set's `close:tag` event. */ value?: string | number | undefined; /** * Set an id for the filterable tag * @default uniqueId() */ id?: string; /** * Obtain a reference to the outer HTML element. * @default null */ ref?: null | HTMLAnchorElement | HTMLButtonElement | HTMLDivElement; decorator?: (this: void) => void; children?: (this: void, ...args: [{ props: { class: "bx--tag__label" } }]) => void; [key: `data-${string}`]: unknown; }; export type TagProps = Omit<$RestProps, keyof $Props> & $Props; export default class Tag extends SvelteComponentTyped< TagProps, { click: WindowEventMap["click"]; close: CustomEvent; mouseenter: WindowEventMap["mouseenter"]; mouseleave: WindowEventMap["mouseleave"]; mouseover: WindowEventMap["mouseover"]; }, { default: { props: { class: "bx--tag__label" } }; decorator: Record; icon: Record; } > {}