mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 18:31:06 +00:00
refactor: update/fix JSDoc props
This commit is contained in:
parent
3c04f122b0
commit
d38e6d8be6
204 changed files with 992 additions and 2359 deletions
|
@ -1,8 +1,5 @@
|
|||
<script>
|
||||
/**
|
||||
* Specify the id for the main element
|
||||
* @type {string} [id="main-content"]
|
||||
*/
|
||||
/** Specify the id for the main element */
|
||||
export let id = "main-content";
|
||||
</script>
|
||||
|
||||
|
|
|
@ -1,44 +1,37 @@
|
|||
<script>
|
||||
/**
|
||||
* Set to `false` to hide the side nav by default
|
||||
* @type {boolean} [expandedByDefault=true]
|
||||
*/
|
||||
/** Set to `false` to hide the side nav by default */
|
||||
export let expandedByDefault = true;
|
||||
|
||||
/**
|
||||
* Set to `true` to open the side nav
|
||||
* @type {boolean} [isSideNavOpen=false]
|
||||
*/
|
||||
/** Set to `true` to open the side nav */
|
||||
export let isSideNavOpen = false;
|
||||
|
||||
/**
|
||||
* Specify the ARIA label for the header
|
||||
* @type {string} [uiShellAriaLabel]
|
||||
* @type {string}
|
||||
*/
|
||||
export let uiShellAriaLabel = undefined;
|
||||
|
||||
/**
|
||||
* Specify the `href` attribute
|
||||
* @type {string} [href]
|
||||
* @type {string}
|
||||
*/
|
||||
export let href = undefined;
|
||||
|
||||
/**
|
||||
* Specify the company name
|
||||
* @type {string} [company]
|
||||
* @type {string}
|
||||
*/
|
||||
export let company = undefined;
|
||||
|
||||
/**
|
||||
* Specify the platform name
|
||||
* Alternatively, use the named slot "platform" (e.g. <span slot="platform">...</span>)
|
||||
* @type {string} [platformName=""]
|
||||
*/
|
||||
export let platformName = "";
|
||||
|
||||
/**
|
||||
* Obtain a reference to the HTML anchor element
|
||||
* @type {null | HTMLAnchorElement} [ref=null]
|
||||
* @type {null | HTMLAnchorElement}
|
||||
*/
|
||||
export let ref = null;
|
||||
|
||||
|
|
|
@ -1,26 +1,23 @@
|
|||
<script>
|
||||
/**
|
||||
* Set to `true` to open the panel
|
||||
* @type {boolean} [isOpen=false]
|
||||
*/
|
||||
/** Set to `true` to open the panel */
|
||||
export let isOpen = false;
|
||||
|
||||
/**
|
||||
* Specify the icon props
|
||||
* @type {{ render: typeof import("carbon-icons-svelte/lib/Add16").default; skeleton: boolean; }} [icon]
|
||||
* @type {{ render: typeof import("carbon-icons-svelte/lib/Add16").default; skeleton: boolean; }}
|
||||
*/
|
||||
export let icon = undefined;
|
||||
|
||||
/**
|
||||
* Specify the text
|
||||
* Alternatively, use the named slot "text" (e.g. <div slot="text">...</div>)
|
||||
* @type {string} [text]
|
||||
* @type {string}
|
||||
*/
|
||||
export let text = undefined;
|
||||
|
||||
/**
|
||||
* Obtain a reference to the button HTML element
|
||||
* @type {null | HTMLButtonElement} [ref=null]
|
||||
* @type {null | HTMLButtonElement}
|
||||
*/
|
||||
export let ref = null;
|
||||
|
||||
|
|
|
@ -1,25 +1,22 @@
|
|||
<script>
|
||||
/**
|
||||
* Set to `true` to use the active state
|
||||
* @type {boolean} [linkIsActive=false]
|
||||
*/
|
||||
/** Set to `true` to use the active state */
|
||||
export let linkIsActive = false;
|
||||
|
||||
/**
|
||||
* Specify the `href` attribute
|
||||
* @type {string} [href]
|
||||
* @type {string}
|
||||
*/
|
||||
export let href = undefined;
|
||||
|
||||
/**
|
||||
* Specify the icon props
|
||||
* @type {{ render: typeof import("carbon-icons-svelte/lib/Add16").default; skeleton: boolean; }} [icon]
|
||||
* @type {{ render: typeof import("carbon-icons-svelte/lib/Add16").default; skeleton: boolean; }}
|
||||
*/
|
||||
export let icon = undefined;
|
||||
|
||||
/**
|
||||
* Obtain a reference to the HTML anchor element
|
||||
* @type {null | HTMLAnchorElement} [ref=null]
|
||||
* @type {null | HTMLAnchorElement}
|
||||
*/
|
||||
export let ref = null;
|
||||
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
<script>
|
||||
/**
|
||||
* Set to `true` to focus the search
|
||||
* @type {boolean} [searchIsActive=false]
|
||||
* @event {{ action: "search"; textInput: string; }} inputSearch
|
||||
*/
|
||||
|
||||
/** Set to `true` to focus the search */
|
||||
export let searchIsActive = false;
|
||||
|
||||
import { createEventDispatcher } from "svelte";
|
||||
|
@ -24,6 +25,7 @@
|
|||
action: "search",
|
||||
textInput: event.target.value,
|
||||
};
|
||||
|
||||
dispatch("inputSearch", params);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<script>
|
||||
/**
|
||||
* Specify the ARIA label for the nav
|
||||
* @type {string} [ariaLabel]
|
||||
* @type {string}
|
||||
*/
|
||||
export let ariaLabel = undefined;
|
||||
</script>
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
<script>
|
||||
/**
|
||||
* Specify the `href` attribute
|
||||
* @type {string} [href]
|
||||
* @type {string}
|
||||
*/
|
||||
export let href = undefined;
|
||||
|
||||
/**
|
||||
* Specify the text
|
||||
* @type {string} [text]
|
||||
* @type {string}
|
||||
*/
|
||||
export let text = undefined;
|
||||
|
||||
/**
|
||||
* Obtain a reference to the HTML anchor element
|
||||
* @type {null | HTMLAnchorElement} [ref=null]
|
||||
* @type {null | HTMLAnchorElement}
|
||||
*/
|
||||
export let ref = null;
|
||||
</script>
|
||||
|
|
|
@ -1,32 +1,23 @@
|
|||
<script>
|
||||
/**
|
||||
* Set to `true` to toggle the expanded state
|
||||
* @type {boolean} [expanded=false]
|
||||
*/
|
||||
/** Set to `true` to toggle the expanded state */
|
||||
export let expanded = false;
|
||||
|
||||
/**
|
||||
* Specify the `href` attribute
|
||||
* @type {string} [href="/"]
|
||||
*/
|
||||
/** Specify the `href` attribute */
|
||||
export let href = "/";
|
||||
|
||||
/**
|
||||
* Specify the text
|
||||
* @type {string} [text]
|
||||
* @type {string}
|
||||
*/
|
||||
export let text = undefined;
|
||||
|
||||
/**
|
||||
* Obtain a reference to the HTML anchor element
|
||||
* @type {null | HTMLAnchorElement} [ref=null]
|
||||
* @type {null | HTMLAnchorElement}
|
||||
*/
|
||||
export let ref = null;
|
||||
|
||||
/**
|
||||
* Specify the ARIA label for the chevron icon
|
||||
* @type {string} [iconDescription="Expand/Collapse"]
|
||||
*/
|
||||
/** Specify the ARIA label for the chevron icon */
|
||||
export let iconDescription = "Expand/Collapse";
|
||||
|
||||
import ChevronDown16 from "carbon-icons-svelte/lib/ChevronDown16";
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
<script>
|
||||
/**
|
||||
* Specify the `href` attribute
|
||||
* @type {string} [href]
|
||||
* @type {string}
|
||||
*/
|
||||
export let href = undefined;
|
||||
|
||||
/**
|
||||
* Obtain a reference to the HTML anchor element
|
||||
* @type {null | HTMLAnchorElement} [ref=null]
|
||||
* @type {null | HTMLAnchorElement}
|
||||
*/
|
||||
export let ref = null;
|
||||
</script>
|
||||
|
|
|
@ -1,19 +1,16 @@
|
|||
<script>
|
||||
/**
|
||||
* Set to `true` to use the active variant
|
||||
* @type {boolean} [isActive=false]
|
||||
*/
|
||||
/** Set to `true` to use the active variant */
|
||||
export let isActive = false;
|
||||
|
||||
/**
|
||||
* Specify the icon 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;
|
||||
|
||||
/**
|
||||
* Obtain a reference to the HTML button element
|
||||
* @type {null | HTMLButtonElement} [ref=null]
|
||||
* @type {null | HTMLButtonElement}
|
||||
*/
|
||||
export let ref = null;
|
||||
</script>
|
||||
|
|
|
@ -1,19 +1,16 @@
|
|||
<script>
|
||||
/**
|
||||
* Specify the ARIA label for the button
|
||||
* @type {string} [ariaLabel]
|
||||
* @type {string}
|
||||
*/
|
||||
export let ariaLabel = undefined;
|
||||
|
||||
/**
|
||||
* Set to `true` to toggle the open state
|
||||
* @type {boolean} [isOpen=false]
|
||||
*/
|
||||
/** Set to `true` to toggle the open state */
|
||||
export let isOpen = false;
|
||||
|
||||
/**
|
||||
* Obtain a reference to the HTML button element
|
||||
* @type {null | HTMLButtonElement} [ref=null]
|
||||
* @type {null | HTMLButtonElement}
|
||||
*/
|
||||
export let ref = null;
|
||||
|
||||
|
|
|
@ -1,20 +1,14 @@
|
|||
<script>
|
||||
/**
|
||||
* Set to `true` to use the fixed variant
|
||||
* @type {boolean} [fixed=false]
|
||||
*/
|
||||
/** Set to `true` to use the fixed variant */
|
||||
export let fixed = false;
|
||||
|
||||
/**
|
||||
* Specify the ARIA label for the nav
|
||||
* @type {string} [ariaLabel]
|
||||
* @type {string}
|
||||
*/
|
||||
export let ariaLabel = undefined;
|
||||
|
||||
/**
|
||||
* Set to `true` to toggle the expanded state
|
||||
* @type {boolean} [isOpen=false]
|
||||
*/
|
||||
/** Set to `true` to toggle the expanded state */
|
||||
export let isOpen = false;
|
||||
</script>
|
||||
|
||||
|
|
|
@ -1,31 +1,28 @@
|
|||
<script>
|
||||
/**
|
||||
* Set to `true` to select the current link
|
||||
* @type {boolean} [isSelected=false]
|
||||
*/
|
||||
/** Set to `true` to select the current link */
|
||||
export let isSelected = false;
|
||||
|
||||
/**
|
||||
* Specify the `href` attribute
|
||||
* @type {string} [href]
|
||||
* @type {string}
|
||||
*/
|
||||
export let href = undefined;
|
||||
|
||||
/**
|
||||
* Specify the text
|
||||
* @type {string} [text]
|
||||
* @type {string}
|
||||
*/
|
||||
export let text = undefined;
|
||||
|
||||
/**
|
||||
* Specify the icon props
|
||||
* @type {{ render: typeof import("carbon-icons-svelte/lib/Add16").default; skeleton: boolean; }} [icon]
|
||||
* @type {{ render: typeof import("carbon-icons-svelte/lib/Add16").default; skeleton: boolean; }}
|
||||
*/
|
||||
export let icon = undefined;
|
||||
|
||||
/**
|
||||
* Obtain a reference to the HTML anchor element
|
||||
* @type {null | HTMLAnchorElement} [ref=null]
|
||||
* @type {null | HTMLAnchorElement}
|
||||
*/
|
||||
export let ref = null;
|
||||
|
||||
|
|
|
@ -1,25 +1,22 @@
|
|||
<script>
|
||||
/**
|
||||
* Set to `true` to toggle the expanded state
|
||||
* @type {boolean} [expanded]
|
||||
*/
|
||||
/** Set to `true` to toggle the expanded state */
|
||||
export let expanded = false;
|
||||
|
||||
/**
|
||||
* Specify the text
|
||||
* @type {string} [text]
|
||||
* @type {string}
|
||||
*/
|
||||
export let text = undefined;
|
||||
|
||||
/**
|
||||
* Specify the icon props
|
||||
* @type {{ render: typeof import("carbon-icons-svelte/lib/Add16").default; skeleton: boolean; }} [icon]
|
||||
* @type {{ render: typeof import("carbon-icons-svelte/lib/Add16").default; skeleton: boolean; }}
|
||||
*/
|
||||
export let icon = undefined;
|
||||
|
||||
/**
|
||||
* Obtain a reference to the HTML button element
|
||||
* @type {null | HTMLButtonElement} [ref=null]
|
||||
* @type {null | HTMLButtonElement}
|
||||
*/
|
||||
export let ref = null;
|
||||
|
||||
|
|
|
@ -1,25 +1,25 @@
|
|||
<script>
|
||||
/**
|
||||
* Set to `true` to select the item
|
||||
* @type {boolean} [isSelected]
|
||||
* @type {boolean}
|
||||
*/
|
||||
export let isSelected = undefined;
|
||||
|
||||
/**
|
||||
* Specify the `href` attribute
|
||||
* @type {string} [href]
|
||||
* @type {string}
|
||||
*/
|
||||
export let href = undefined;
|
||||
|
||||
/**
|
||||
* Specify the item text
|
||||
* @type {string} [text]
|
||||
* @type {string}
|
||||
*/
|
||||
export let text = undefined;
|
||||
|
||||
/**
|
||||
* Obtain a reference to the HTML anchor element
|
||||
* @type {null | HTMLAnchorElement} [ref=null]
|
||||
* @type {null | HTMLAnchorElement}
|
||||
*/
|
||||
export let ref = null;
|
||||
</script>
|
||||
|
|
|
@ -1,14 +1,8 @@
|
|||
<script>
|
||||
/**
|
||||
* Specify the `href` attribute
|
||||
* @type {string} [href="#main-content"]
|
||||
*/
|
||||
/** Specify the `href` attribute */
|
||||
export let href = "#main-content";
|
||||
|
||||
/**
|
||||
* Specify the tabindex
|
||||
* @type {string} [tabindex="0"]
|
||||
*/
|
||||
/** Specify the tabindex */
|
||||
export let tabindex = "0";
|
||||
</script>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue