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,109 +1,73 @@
<script>
/**
* Set the size of the input
* @type {"sm" | "xl"} [size]
* @type {"sm" | "xl"}
*/
export let size = undefined;
/**
* Specify the input value
* @type {string} [value=""]
*/
/** Specify the input value */
export let value = "";
/**
* Specify the input type
* @type {string} [type="password"]
*/
/** Specify the input type */
export let type = "password";
/**
* Specify the placeholder text
* @type {string} [placeholder=""]
*/
/** Specify the placeholder text */
export let placeholder = "";
/**
* Specify the hide password label text
* @type {string} [hidePasswordLabel="Hide password"]
*/
/** Specify the hide password label text */
export let hidePasswordLabel = "Hide password";
/**
* Specify the show password label text
* @type {string} [showPasswordLabel="Show password"]
*/
/** Specify the show password label text */
export let showPasswordLabel = "Show password";
/**
* Set the alignment of the tooltip relative to the icon
* @type {"start" | "center" | "end"} [tooltipAlignment="center"]
* @type {"start" | "center" | "end"}
*/
export let tooltipAlignment = undefined;
/**
* Set the position of the tooltip relative to the icon
* @type {"top" | "right" | "bottom" | "left"} [tooltipPosition="bottom"]
* @type {"top" | "right" | "bottom" | "left"}
*/
export let tooltipPosition = undefined;
/**
* Set to `true` to enable the light variant
* @type {boolean} [light=false]
*/
/** Set to `true` to enable the light variant */
export let light = false;
/**
* Set to `true` to disable the input
* @type {boolean} [disabled=false]
*/
/** Set to `true` to disable the input */
export let disabled = false;
/**
* Specify the helper text
* @type {string} [helperText=""]
*/
/** Specify the helper text */
export let helperText = "";
/**
* Specify the label text
* @type {string} [labelText=""]
*/
/** Specify the label text */
export let labelText = "";
/**
* Set to `true` to visually hide the label text
* @type {boolean} [hideLabel=false]
*/
/** Set to `true` to visually hide the label text */
export let hideLabel = false;
/**
* Set to `true` to indicate an invalid state
* @type {boolean} [invalid=false]
*/
/** Set to `true` to indicate an invalid state */
export let invalid = false;
/**
* Specify the text for the invalid state
* @type {string} [invalidText=""]
*/
/** Specify the text for the invalid state */
export let invalidText = "";
/**
* Set an id for the input element
* @type {string} [id]
* @type {string}
*/
export let id = "ccs-" + Math.random().toString(36);
/**
* Specify a name attribute for the input
* @type {string} [name]
* @type {string}
*/
export let name = undefined;
/**
* Obtain a reference to the input HTML element
* @type {null | HTMLInputElement} [ref=null]
* @type {null | HTMLInputElement}
*/
export let ref = null;

View file

@ -1,110 +1,68 @@
<script>
/**
* Set the size of the input
* @type {"sm" | "xl"} [size]
* @type {"sm" | "xl"}
*/
export let size = undefined;
/**
* Specify the input value
* @type {string} [value=""]
*/
/** Specify the input value */
export let value = "";
/**
* Specify the input type
* @type {string} [type=""]
*/
/** Specify the input type */
export let type = "";
/**
* Specify the placeholder text
* @type {string} [placeholder=""]
*/
/** Specify the placeholder text */
export let placeholder = "";
/**
* Set to `true` to enable the light variant
* @type {boolean} [light=false]
*/
/** Set to `true` to enable the light variant */
export let light = false;
/**
* Set to `true` to disable the input
* @type {boolean} [disabled=false]
*/
/** Set to `true` to disable the input */
export let disabled = false;
/**
* Specify the helper text
* @type {string} [helperText=""]
*/
/** Specify the helper text */
export let helperText = "";
/**
* Set an id for the input element
* @type {string} [id]
* @type {string}
*/
export let id = "ccs-" + Math.random().toString(36);
/**
* Specify a name attribute for the input
* @type {string} [name]
* @type {string}
*/
export let name = undefined;
/**
* Specify the label text
* @type {string} [labelText=""]
*/
/** Specify the label text */
export let labelText = "";
/**
* Set to `true` to visually hide the label text
* @type {boolean} [hideLabel=false]
*/
/** Set to `true` to visually hide the label text */
export let hideLabel = false;
/**
* Set to `true` to indicate an invalid state
* @type {boolean} [invalid=false]
*/
/** Set to `true` to indicate an invalid state */
export let invalid = false;
/**
* Specify the invalid state text
* @type {string} [invalidText=""]
*/
/** Specify the invalid state text */
export let invalidText = "";
/**
* Set to `true` to indicate an warning state
* @type {boolean} [warn=false]
*/
/** Set to `true` to indicate an warning state */
export let warn = false;
/**
* Specify the warning state text
* @type {string} [warnText=""]
*/
/** Specify the warning state text */
export let warnText = "";
/**
* Obtain a reference to the input HTML element
* @type {null | HTMLInputElement} [ref=null]
* @type {null | HTMLInputElement}
*/
export let ref = null;
/**
* Set to `true` to mark the field as required
* @type {boolean} [required=false]
*/
/** Set to `true` to mark the field as required */
export let required = false;
/**
* Set to `true` to use inline version
* @type {boolean} [inline=false]
*/
/** Set to `true` to use inline version */
export let inline = false;
import { getContext } from "svelte";

View file

@ -1,8 +1,5 @@
<script>
/**
* Set to `true` to hide the label text
* @type {boolean} [hideLabel=false]
*/
/** Set to `true` to hide the label text */
export let hideLabel = false;
</script>

View file

@ -1,3 +1,3 @@
export { default as TextInput } from "./TextInput.svelte";
export { default as TextInputSkeleton } from "./TextInput.Skeleton.svelte";
export { default as TextInputSkeleton } from "./TextInputSkeleton.svelte";
export { default as PasswordInput } from "./PasswordInput.svelte";