chore: add more prop annotations

This commit is contained in:
Eric Liu 2020-07-25 06:26:49 -07:00
commit 773b18d314
75 changed files with 877 additions and 137 deletions

View file

@ -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;
}
}} />