mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 18:31:06 +00:00
chore: add more prop annotations
This commit is contained in:
parent
8c1ffd4cb0
commit
773b18d314
75 changed files with 877 additions and 137 deletions
|
@ -1,8 +1,32 @@
|
|||
<script>
|
||||
/**
|
||||
* Define the tooltip text
|
||||
* @types {string} [tooltipText=""]
|
||||
*/
|
||||
export let tooltipText = "";
|
||||
export let align = "center"; // "start" | "center" | "end"
|
||||
export let direction = "bottom"; // "top" | "bottom"
|
||||
|
||||
/**
|
||||
* Set the alignment of the tooltip relative to the icon
|
||||
* @type {"start" | "center" | "end"} [align="center"]
|
||||
*/
|
||||
export let align = "center";
|
||||
|
||||
/**
|
||||
* Set the direction of the tooltip relative to the icon
|
||||
* @type {"top" | "bottom"} [direction="bottom"]
|
||||
*/
|
||||
export let direction = "bottom";
|
||||
|
||||
/**
|
||||
* Set an id for the tooltip div element
|
||||
* @type {string} [id]
|
||||
*/
|
||||
export let id = "ccs-" + Math.random().toString(36);
|
||||
|
||||
/**
|
||||
* Obtain a reference to the button HTML element
|
||||
* @type {null | HTMLElement} [ref=null]
|
||||
*/
|
||||
export let ref = null;
|
||||
|
||||
$: hidden = false;
|
||||
|
@ -10,8 +34,8 @@
|
|||
</script>
|
||||
|
||||
<svelte:body
|
||||
on:keydown={e => {
|
||||
if (e.key === 'Escape') {
|
||||
on:keydown={({ key }) => {
|
||||
if (key === 'Escape') {
|
||||
hidden = true;
|
||||
}
|
||||
}} />
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue