mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-16 10:51:06 +00:00
chore: complete first pass of apply jsdoc annotations to component props
This commit is contained in:
parent
566a281d81
commit
f30755b237
97 changed files with 2327 additions and 259 deletions
|
@ -1,7 +1,7 @@
|
|||
<script>
|
||||
/**
|
||||
* Set an id for the main element
|
||||
* @type {string} [id]
|
||||
* Specify the id for the main element
|
||||
* @type {string} [id="main-content"]
|
||||
*/
|
||||
export let id = "main-content";
|
||||
</script>
|
||||
|
|
|
@ -1,9 +1,33 @@
|
|||
<script>
|
||||
/**
|
||||
* Set to `true` to open the side nav
|
||||
* @type {boolean} [isSideNavOpen=false]
|
||||
*/
|
||||
export let isSideNavOpen = false;
|
||||
|
||||
/**
|
||||
* Specify the ARIA label for the header
|
||||
* @type {string} [uiShellAriaLabel]
|
||||
*/
|
||||
export let uiShellAriaLabel = undefined;
|
||||
|
||||
/**
|
||||
* Specify the `href` attribute
|
||||
* @type {string} [href]
|
||||
*/
|
||||
export let href = undefined;
|
||||
|
||||
/**
|
||||
* Specify the company name
|
||||
* @type {string} [company]
|
||||
*/
|
||||
export let company = undefined;
|
||||
|
||||
/**
|
||||
* Specify the platform name
|
||||
* @type {string} [platformName]
|
||||
*/
|
||||
export let platformName = undefined;
|
||||
export let isSideNavOpen = undefined;
|
||||
|
||||
import HamburgerMenu from "../SideNav/HamburgerMenu.svelte";
|
||||
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
<script>
|
||||
export let searchIsActive = undefined;
|
||||
/**
|
||||
* Set to `true` to focus the search
|
||||
* @type {boolean} [searchIsActive=false]
|
||||
*/
|
||||
export let searchIsActive = false;
|
||||
|
||||
import { createEventDispatcher } from "svelte";
|
||||
import Close20 from "carbon-icons-svelte/lib/Close20";
|
||||
|
@ -18,7 +22,7 @@
|
|||
function dispatchInputs(event) {
|
||||
const params = {
|
||||
action: "search",
|
||||
textInput: event.target.value
|
||||
textInput: event.target.value,
|
||||
};
|
||||
dispatch("inputSearch", params);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
<script>
|
||||
/**
|
||||
* Specify the ARIA label for the nav
|
||||
* @type {string} [ariaLabel]
|
||||
*/
|
||||
export let ariaLabel = undefined;
|
||||
</script>
|
||||
|
||||
|
|
|
@ -1,5 +1,14 @@
|
|||
<script>
|
||||
/**
|
||||
* Specify the `href` attribute
|
||||
* @type {string} [href]
|
||||
*/
|
||||
export let href = undefined;
|
||||
|
||||
/**
|
||||
* Specify the text
|
||||
* @type {string} [text]
|
||||
*/
|
||||
export let text = undefined;
|
||||
</script>
|
||||
|
||||
|
|
|
@ -1,7 +1,26 @@
|
|||
<script>
|
||||
/**
|
||||
* Set to `true` to toggle the expanded state
|
||||
* @type {boolean} [expanded=false]
|
||||
*/
|
||||
export let expanded = false;
|
||||
|
||||
/**
|
||||
* Specify the `href` attribute
|
||||
* @type {string} [href="/"]
|
||||
*/
|
||||
export let href = "/";
|
||||
|
||||
/**
|
||||
* Specify the text
|
||||
* @type {string} [text]
|
||||
*/
|
||||
export let text = undefined;
|
||||
|
||||
/**
|
||||
* Specify the ARIA label for the chevron icon
|
||||
* @type {string} [iconDescription="Expand/Collapse"]
|
||||
*/
|
||||
export let iconDescription = "Expand/Collapse";
|
||||
|
||||
import ChevronDown16 from "carbon-icons-svelte/lib/ChevronDown16";
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
<script>
|
||||
/**
|
||||
* Specify the `href` attribute
|
||||
* @type {string} [href]
|
||||
*/
|
||||
export let href = undefined;
|
||||
</script>
|
||||
|
||||
|
|
|
@ -1,5 +1,14 @@
|
|||
<script>
|
||||
/**
|
||||
* Specify the ARIA label for the button
|
||||
* @type {string} [ariaLabel]
|
||||
*/
|
||||
export let ariaLabel = undefined;
|
||||
|
||||
/**
|
||||
* Set to `true` to toggle the open state
|
||||
* @type {boolean} [isOpen=false]
|
||||
*/
|
||||
export let isOpen = false;
|
||||
|
||||
import { fly } from "svelte/transition";
|
||||
|
|
|
@ -1,6 +1,15 @@
|
|||
<script>
|
||||
/**
|
||||
* Specify the ARIA label for the nav
|
||||
* @type {string} [ariaLabel]
|
||||
*/
|
||||
export let ariaLabel = undefined;
|
||||
export let isOpen = undefined;
|
||||
|
||||
/**
|
||||
* Set to `true` to toggle the expanded state
|
||||
* @type {boolean} [isOpen=false]
|
||||
*/
|
||||
export let isOpen = false;
|
||||
</script>
|
||||
|
||||
<nav
|
||||
|
|
|
@ -1,7 +1,26 @@
|
|||
<script>
|
||||
/**
|
||||
* Set to `true` to select the current link
|
||||
* @type {boolean} [isSelected=false]
|
||||
*/
|
||||
export let isSelected = false;
|
||||
|
||||
/**
|
||||
* Specify the `href` attribute
|
||||
* @type {string} [href]
|
||||
*/
|
||||
export let href = undefined;
|
||||
|
||||
/**
|
||||
* Specify the text
|
||||
* @type {string} [text]
|
||||
*/
|
||||
export let text = undefined;
|
||||
|
||||
/**
|
||||
* Specify the icon props
|
||||
* @type {{ render: typeof import("carbon-icons-svelte/lib/Add16").default; skeleton: boolean; }} [icon]
|
||||
*/
|
||||
export let icon = undefined;
|
||||
|
||||
import { Icon } from "../../Icon";
|
||||
|
@ -9,7 +28,7 @@
|
|||
|
||||
<li class:bx--side-nav__item={true}>
|
||||
<a
|
||||
aria-current={isSelected ? 'page' : ''}
|
||||
aria-current={isSelected ? 'page' : undefined}
|
||||
{href}
|
||||
class:bx--side-nav__link={true}
|
||||
class:bx--side-nav__link--current={isSelected}
|
||||
|
|
|
@ -1,6 +1,20 @@
|
|||
<script>
|
||||
/**
|
||||
* Set to `true` to toggle the expanded state
|
||||
* @type {boolean} [expanded]
|
||||
*/
|
||||
export let expanded = false;
|
||||
|
||||
/**
|
||||
* Specify the text
|
||||
* @type {string} [text]
|
||||
*/
|
||||
export let text = undefined;
|
||||
|
||||
/**
|
||||
* Specify the icon props
|
||||
* @type {{ render: typeof import("carbon-icons-svelte/lib/Add16").default; skeleton: boolean; }} [icon]
|
||||
*/
|
||||
export let icon = undefined;
|
||||
|
||||
import ChevronDown16 from "carbon-icons-svelte/lib/ChevronDown16";
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<li role="none" class:bx--side-nav__menu-item={true}>
|
||||
<a
|
||||
role="menuitem"
|
||||
aria-current={isSelected ? 'page' : ''}
|
||||
aria-current={isSelected ? 'page' : undefined}
|
||||
{href}
|
||||
class:bx--side-nav__link={true}
|
||||
{...$$restProps}
|
||||
|
|
|
@ -1,5 +1,14 @@
|
|||
<script>
|
||||
/**
|
||||
* Specify the `href` attribute
|
||||
* @type {string} [href="#main-content"]
|
||||
*/
|
||||
export let href = "#main-content";
|
||||
|
||||
/**
|
||||
* Specify the tabindex
|
||||
* @type {string} [tabindex="0"]
|
||||
*/
|
||||
export let tabindex = "0";
|
||||
</script>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue