mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 10:21:05 +00:00
refactor(types): shorten ref, id JSDocs, use CarbonIcon type, export component props
This commit is contained in:
parent
d38e6d8be6
commit
75d4b4cf03
219 changed files with 5168 additions and 5259 deletions
161
types/Tooltip/Tooltip.d.ts
vendored
161
types/Tooltip/Tooltip.d.ts
vendored
|
@ -1,88 +1,91 @@
|
|||
/// <reference types="svelte" />
|
||||
|
||||
export interface TooltipProps extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["div"]> {
|
||||
/**
|
||||
* Set the direction of the tooltip relative to the button
|
||||
* @default "bottom"
|
||||
*/
|
||||
direction?: "top" | "right" | "bottom" | "left";
|
||||
|
||||
/**
|
||||
* Set to `true` to open the tooltip
|
||||
* @default false
|
||||
*/
|
||||
open?: boolean;
|
||||
|
||||
/**
|
||||
* Set to `true` to hide the tooltip icon
|
||||
* @default false
|
||||
*/
|
||||
hideIcon?: boolean;
|
||||
|
||||
/**
|
||||
* Specify the icon from `carbon-icons-svelte` to render for the tooltip button
|
||||
* Icon size must be 16px (e.g. `Add16`, `Task16`)
|
||||
*/
|
||||
icon?: import("carbon-icons-svelte").CarbonIcon;
|
||||
|
||||
/**
|
||||
* Specify the ARIA label for the tooltip button
|
||||
* @default ""
|
||||
*/
|
||||
iconDescription?: string;
|
||||
|
||||
/**
|
||||
* Specify the icon name attribute
|
||||
* @default ""
|
||||
*/
|
||||
iconName?: string;
|
||||
|
||||
/**
|
||||
* Set the button tabindex
|
||||
* @default "0"
|
||||
*/
|
||||
tabindex?: string;
|
||||
|
||||
/**
|
||||
* Set an id for the tooltip
|
||||
* @default "ccs-" + Math.random().toString(36)
|
||||
*/
|
||||
tooltipId?: string;
|
||||
|
||||
/**
|
||||
* Set an id for the tooltip button
|
||||
* @default "ccs-" + Math.random().toString(36)
|
||||
*/
|
||||
triggerId?: string;
|
||||
|
||||
/**
|
||||
* Set the tooltip button text
|
||||
* @default ""
|
||||
*/
|
||||
triggerText?: string;
|
||||
|
||||
/**
|
||||
* Obtain a reference to the trigger text HTML element
|
||||
* @default null
|
||||
*/
|
||||
ref?: null | HTMLDivElement;
|
||||
|
||||
/**
|
||||
* Obtain a reference to the tooltip HTML element
|
||||
* @default null
|
||||
*/
|
||||
refTooltip?: null | HTMLDivElement;
|
||||
|
||||
/**
|
||||
* Obtain a reference to the icon HTML element
|
||||
* @default null
|
||||
*/
|
||||
refIcon?: null | HTMLDivElement;
|
||||
}
|
||||
|
||||
export default class Tooltip {
|
||||
$$prop_def: svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["div"]> & {
|
||||
/**
|
||||
* Set the direction of the tooltip relative to the button
|
||||
* @default "bottom"
|
||||
*/
|
||||
direction?: "top" | "right" | "bottom" | "left";
|
||||
|
||||
/**
|
||||
* Set to `true` to open the tooltip
|
||||
* @default false
|
||||
*/
|
||||
open?: boolean;
|
||||
|
||||
/**
|
||||
* Set to `true` to hide the tooltip icon
|
||||
* @default false
|
||||
*/
|
||||
hideIcon?: boolean;
|
||||
|
||||
/**
|
||||
* Specify the icon from `carbon-icons-svelte` to render for the tooltip button
|
||||
* Icon size must be 16px (e.g. `Add16`, `Task16`)
|
||||
*/
|
||||
icon?: typeof import("carbon-icons-svelte/lib/Add16").default;
|
||||
|
||||
/**
|
||||
* Specify the ARIA label for the tooltip button
|
||||
* @default ""
|
||||
*/
|
||||
iconDescription?: string;
|
||||
|
||||
/**
|
||||
* Specify the icon name attribute
|
||||
* @default ""
|
||||
*/
|
||||
iconName?: string;
|
||||
|
||||
/**
|
||||
* Set the button tabindex
|
||||
* @default "0"
|
||||
*/
|
||||
tabindex?: string;
|
||||
|
||||
/**
|
||||
* Set an id for the tooltip
|
||||
*/
|
||||
tooltipId?: string;
|
||||
|
||||
/**
|
||||
* Set an id for the tooltip button
|
||||
*/
|
||||
triggerId?: string;
|
||||
|
||||
/**
|
||||
* Set the tooltip button text
|
||||
* @default ""
|
||||
*/
|
||||
triggerText?: string;
|
||||
|
||||
/**
|
||||
* Obtain a reference to the trigger text HTML element
|
||||
* @default null
|
||||
*/
|
||||
ref?: null | HTMLElement;
|
||||
|
||||
/**
|
||||
* Obtain a reference to the tooltip HTML element
|
||||
* @default null
|
||||
*/
|
||||
refTooltip?: null | HTMLElement;
|
||||
|
||||
/**
|
||||
* Obtain a reference to the icon HTML element
|
||||
* @default null
|
||||
*/
|
||||
refIcon?: null | HTMLElement;
|
||||
};
|
||||
|
||||
$$prop_def: TooltipProps;
|
||||
$$slot_def: {
|
||||
default: {};
|
||||
triggerText: {};
|
||||
icon: {};
|
||||
triggerText: {};
|
||||
};
|
||||
|
||||
$on(eventname: "undefined", cb: (event: CustomEvent<any>) => void): () => void;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue