refactor: update/fix JSDoc props

This commit is contained in:
Eric Liu 2020-11-04 06:04:25 -08:00
commit d38e6d8be6
204 changed files with 992 additions and 2359 deletions

View file

@ -1,92 +1,76 @@
<script>
/**
* Specify the kind of button
* @type {"primary" | "secondary" | "tertiary" | "ghost" | "danger" | "danger-tertiary" | "danger-ghost"} [kind="primary"]
* @type {"primary" | "secondary" | "tertiary" | "ghost" | "danger" | "danger-tertiary" | "danger-ghost"}
*/
export let kind = "primary";
/**
* Specify the size of button
* @type {"default" | "field" | "small"} [size="default"]
* @type {"default" | "field" | "small"}
*/
export let size = "default";
/**
* Set to `true` for the icon-only variant
* @type {boolean} [hasIconOnly=false]
*/
/** Set to `true` for the icon-only variant */
export let hasIconOnly = false;
/**
* Specify the icon from `carbon-icons-svelte` to render
* @type {typeof import("carbon-icons-svelte/lib/Add16").default} [icon]
* @type {typeof import("carbon-icons-svelte/lib/Add16").default}
*/
export let icon = undefined;
/**
* Specify the ARIA label for the button icon
* @type {string} [iconDescription]
* @type {string}
*/
export let iconDescription = undefined;
/**
* Set the alignment of the tooltip relative to the icon
* `hasIconOnly` must be set to `true`
* @type {"start" | "center" | "end"} [tooltipAlignment]
* @type {"start" | "center" | "end"}
*/
export let tooltipAlignment = undefined;
/**
* Set the position of the tooltip relative to the icon
* @type {"top" | "right" | "bottom" | "left"} [tooltipPosition]
* @type {"top" | "right" | "bottom" | "left"}
*/
export let tooltipPosition = undefined;
/**
* Set to `true` to render a custom HTML element
* Props are destructured as `props` in the default slot (e.g. <Button let:props><div {...props}>...</div></Button>)
* @type {boolean} [as=false]
*/
export let as = false;
/**
* Set to `true` to display the skeleton state
* @type {boolean} [skeleton=false]
*/
/** Set to `true` to display the skeleton state */
export let skeleton = false;
/**
* Set to `true` to disable the button
* @type {boolean} [disabled=false]
*/
/** Set to `true` to disable the button */
export let disabled = false;
/**
* Set the `href` to use an anchor link
* @type {string} [href]
* @type {string}
*/
export let href = undefined;
/**
* Specify the tabindex
* @type {string} [tabindex="0"]
*/
/** Specify the tabindex */
export let tabindex = "0";
/**
* Specify the `type` attribute for the button element
* @type {string} [type="button"]
*/
/** Specify the `type` attribute for the button element */
export let type = "button";
/**
* Obtain a reference to the HTML element
* @type {null | HTMLAnchorElement | HTMLButtonElement} [ref=null]
* @type {null | HTMLAnchorElement | HTMLButtonElement}
*/
export let ref = null;
import { getContext } from "svelte";
import ButtonSkeleton from "./Button.Skeleton.svelte";
import ButtonSkeleton from "./ButtonSkeleton.svelte";
const ctx = getContext("ComposedModal");

View file

@ -1,8 +1,5 @@
<script>
/**
* Set to `true` to stack the buttons vertically
* @type {boolean} [stacked=false]
*/
/** Set to `true` to stack the buttons vertically */
export let stacked = false;
</script>

View file

@ -1,20 +1,17 @@
<script>
/**
* Set the `href` to use an anchor link
* @type {string} [href]
* @type {string}
*/
export let href = undefined;
/**
* Specify the size of button skeleton
* @type {"default" | "field" | "small"} [size="default"]
* @type {"default" | "field" | "small"}
*/
export let size = "default";
/**
* Set to `true` to use the small variant
* @type {boolean} [small=false]
*/
/** Set to `true` to use the small variant */
export let small = false;
</script>

View file

@ -1,3 +1,3 @@
export { default as Button } from "./Button.svelte";
export { default as ButtonSkeleton } from "./Button.Skeleton.svelte";
export { default as ButtonSkeleton } from "./ButtonSkeleton.svelte";
export { default as ButtonSet } from "./ButtonSet.svelte";