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

@ -22,7 +22,9 @@ export default ["es", "umd"].map((format) => {
resolve(), resolve(),
commonjs(), commonjs(),
UMD && terser(), UMD && terser(),
!UMD && generateDocs(),
// TODO: replace
// !UMD && generateDocs(),
], ],
}; };
}); });

View file

@ -1,31 +1,25 @@
<script> <script>
/** /**
* Specify alignment of accordion item chevron icon * Specify alignment of accordion item chevron icon
* @type {"start" | "end"} [align="end"] * @type {"start" | "end"}
*/ */
export let align = "end"; export let align = "end";
/** /**
* Specify the size of the accordion * Specify the size of the accordion
* @type {"sm" | "xl"} [size] * @type {"sm" | "xl"}
*/ */
export let size = undefined; export let size = undefined;
/** /** Set to `true` to disable the accordion */
* Set to `true` to disable the accordion
* @type {boolean} [disabled=false]
*/
export let disabled = false; export let disabled = false;
/** /** Set to `true` to display the skeleton state */
* Set to `true` to display the skeleton state
* @type {boolean} [skeleton=false]
*/
export let skeleton = false; export let skeleton = false;
import { setContext } from "svelte"; import { setContext } from "svelte";
import { writable } from "svelte/store"; import { writable } from "svelte/store";
import AccordionSkeleton from "./Accordion.Skeleton.svelte"; import AccordionSkeleton from "./AccordionSkeleton.svelte";
const disableItems = writable(disabled); const disableItems = writable(disabled);

View file

@ -2,26 +2,16 @@
/** /**
* Specify the title of the accordion item heading * Specify the title of the accordion item heading
* Alternatively, use the named slot "title" (e.g. <div slot="title">...</div>) * Alternatively, use the named slot "title" (e.g. <div slot="title">...</div>)
* @type {string} [title="title"]
*/ */
export let title = "title"; export let title = "title";
/** /** Set to `true` to open the first accordion item */
* Set to `true` to open the first accordion item
* @type {boolean} [open=false]
*/
export let open = false; export let open = false;
/** /** Set to `true` to disable the accordion item */
* Set to `true` to disable the accordion item
* @type {boolean} [disabled=false]
*/
export let disabled = false; export let disabled = false;
/** /** Specify the ARIA label for the accordion item chevron icon */
* Specify the ARIA label for the accordion item chevron icon
* @type {string} [iconDescription="Expand/Collapse"]
*/
export let iconDescription = "Expand/Collapse"; export let iconDescription = "Expand/Collapse";
import { onMount, getContext } from "svelte"; import { onMount, getContext } from "svelte";

View file

@ -1,26 +1,20 @@
<script> <script>
/** /** Specify the number of accordion items to render */
* Specify the number of accordion items to render
* @type {number} [count=4]
*/
export let count = 4; export let count = 4;
/** /**
* Specify alignment of accordion item chevron icon * Specify alignment of accordion item chevron icon
* @type {"start" | "end"} [align="end"] * @type {"start" | "end"}
*/ */
export let align = "end"; export let align = "end";
/** /**
* Specify the size of the accordion * Specify the size of the accordion
* @type {"sm" | "xl"} [size] * @type {"sm" | "xl"}
*/ */
export let size = undefined; export let size = undefined;
/** /** Set to `false` to close the first accordion item */
* Set to `false` to close the first accordion item
* @type {boolean} [open=true]
*/
export let open = true; export let open = true;
import ChevronRight16 from "carbon-icons-svelte/lib/ChevronRight16"; import ChevronRight16 from "carbon-icons-svelte/lib/ChevronRight16";

View file

@ -1,3 +1,3 @@
export { default as Accordion } from "./Accordion.svelte"; export { default as Accordion } from "./Accordion.svelte";
export { default as AccordionItem } from "./AccordionItem.svelte"; export { default as AccordionItem } from "./AccordionItem.svelte";
export { default as AccordionSkeleton } from "./Accordion.Skeleton.svelte"; export { default as AccordionSkeleton } from "./AccordionSkeleton.svelte";

View file

@ -1,7 +1,7 @@
<script> <script>
/** /**
* Specify the aspect ratio * Specify the aspect ratio
* @type {"2x1" | "16x9" | "4x3" | "1x1" | "3x4" | "9x16" | "1x2"} [ratio="2x1"] * @type {"2x1" | "16x9" | "4x3" | "1x1" | "3x4" | "9x16" | "1x2"}
*/ */
export let ratio = "2x1"; export let ratio = "2x1";
</script> </script>

View file

@ -1,17 +1,11 @@
<script> <script>
/** /** Set to `true` to hide the breadcrumb trailing slash */
* Set to `true` to hide the breadcrumb trailing slash
* @type {boolean} [noTrailingSlash=false]
*/
export let noTrailingSlash = false; export let noTrailingSlash = false;
/** /** Set to `true` to display skeleton state */
* Set to `true` to display skeleton state
* @type {boolean} [skeleton=false]
*/
export let skeleton = false; export let skeleton = false;
import BreadcrumbSkeleton from "./Breadcrumb.Skeleton.svelte"; import BreadcrumbSkeleton from "./BreadcrumbSkeleton.svelte";
</script> </script>
{#if skeleton} {#if skeleton}

View file

@ -1,14 +1,11 @@
<script> <script>
/** /**
* Set the `href` to use an anchor link * Set the `href` to use an anchor link
* @type {string} [href] * @type {string}
*/ */
export let href = undefined; export let href = undefined;
/** /** Set to `true` if the breadcrumb item represents the current page */
* Set to `true` if the breadcrumb item represents the current page
* @type {boolean} [isCurrentPage=false]
*/
export let isCurrentPage = false; export let isCurrentPage = false;
import { Link } from "../Link"; import { Link } from "../Link";

View file

@ -1,14 +1,8 @@
<script> <script>
/** /** Set to `true` to hide the breadcrumb trailing slash */
* Set to `true` to hide the breadcrumb trailing slash
* @type {boolean} [noTrailingSlash=false]
*/
export let noTrailingSlash = false; export let noTrailingSlash = false;
/** /** Specify the number of breadcrumb items to render */
* Specify the number of breadcrumb items to render
* @type {number} [count=3]
*/
export let count = 3; export let count = 3;
</script> </script>

View file

@ -1,3 +1,3 @@
export { default as Breadcrumb } from "./Breadcrumb.svelte"; export { default as Breadcrumb } from "./Breadcrumb.svelte";
export { default as BreadcrumbItem } from "./BreadcrumbItem.svelte"; export { default as BreadcrumbItem } from "./BreadcrumbItem.svelte";
export { default as BreadcrumbSkeleton } from "./Breadcrumb.Skeleton.svelte"; export { default as BreadcrumbSkeleton } from "./BreadcrumbSkeleton.svelte";

View file

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

View file

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

View file

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

View file

@ -1,3 +1,3 @@
export { default as Button } from "./Button.svelte"; 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"; export { default as ButtonSet } from "./ButtonSet.svelte";

View file

@ -1,72 +1,52 @@
<script> <script>
/** /**
* Specify whether the checkbox is checked * @event {boolean} check
* @type {boolean} [checked=false]
*/ */
/** Specify whether the checkbox is checked */
export let checked = false; export let checked = false;
/** /** Specify whether the checkbox is indeterminate */
* Specify whether the checkbox is indeterminate
* @type {boolean} [indeterminate=false]
*/
export let indeterminate = false; export let indeterminate = false;
/** /** Set to `true` to display the skeleton state */
* Set to `true` to display the skeleton state
* @type {boolean} [skeleton=false]
*/
export let skeleton = false; export let skeleton = false;
/** /** Set to `true` for the checkbox to be read-only */
* Set to `true` for the checkbox to be read-only
* @type {boolean} [readonly=false]
*/
export let readonly = false; export let readonly = false;
/** /** Set to `true` to disable the checkbox */
* Set to `true` to disable the checkbox
* @type {boolean} [disabled=false]
*/
export let disabled = false; export let disabled = false;
/** /** Specify the label text */
* Specify the label text
* @type {string} [labelText=""]
*/
export let labelText = ""; export let labelText = "";
/** /** Set to `true` to visually hide the label text */
* Set to `true` to visually hide the label text
* @type {boolean} [hideLabel=false]
*/
export let hideLabel = false; export let hideLabel = false;
/** /** Set a name for the input element */
* Set a name for the input element
* @type {string} [name=""]
*/
export let name = ""; export let name = "";
/** /**
* Specify the title attribute for the label element * Specify the title attribute for the label element
* @type {string} [title] * @type {string}
*/ */
export let title = undefined; export let title = undefined;
/** /**
* Set an id for the input label * Set an id for the input label
* @type {string} [id] * @type {string}
*/ */
export let id = "ccs-" + Math.random().toString(36); export let id = "ccs-" + Math.random().toString(36);
/** /**
* Obtain a reference to the input HTML element * Obtain a reference to the input HTML element
* @type {null | HTMLInputElement} [ref=null] * @type {null | HTMLInputElement}
*/ */
export let ref = null; export let ref = null;
import { createEventDispatcher } from "svelte"; import { createEventDispatcher } from "svelte";
import CheckboxSkeleton from "./Checkbox.Skeleton.svelte"; import CheckboxSkeleton from "./CheckboxSkeleton.svelte";
const dispatch = createEventDispatcher(); const dispatch = createEventDispatcher();

View file

@ -1,31 +1,25 @@
<script> <script>
/** /** Specify whether the checkbox is checked */
* Specify whether the checkbox is checked
* @type {boolean} [checked=false]
*/
export let checked = false; export let checked = false;
/** /** Specify whether the checkbox is indeterminate */
* Specify whether the checkbox is indeterminate
* @type {boolean} [indeterminate=false]
*/
export let indeterminate = false; export let indeterminate = false;
/** /**
* Specify the title attribute for the label element * Specify the title attribute for the label element
* @type {string} [title] * @type {string}
*/ */
export let title = undefined; export let title = undefined;
/** /**
* Set an id for the input label * Set an id for the input label
* @type {string} [id] * @type {string}
*/ */
export let id = "ccs-" + Math.random().toString(36); export let id = "ccs-" + Math.random().toString(36);
/** /**
* Obtain a reference to the input HTML element * Obtain a reference to the input HTML element
* @type {null | HTMLInputElement} [ref=null] * @type {null | HTMLInputElement}
*/ */
export let ref = null; export let ref = null;
</script> </script>

View file

@ -1,3 +1,3 @@
export { default as Checkbox } from "./Checkbox.svelte"; export { default as Checkbox } from "./Checkbox.svelte";
export { default as CheckboxSkeleton } from "./Checkbox.Skeleton.svelte"; export { default as CheckboxSkeleton } from "./CheckboxSkeleton.svelte";
export { default as InlineCheckbox } from "./InlineCheckbox.svelte"; export { default as InlineCheckbox } from "./InlineCheckbox.svelte";

View file

@ -1,101 +1,77 @@
<script> <script>
/** /**
* Set the type of code snippet * Set the type of code snippet
* @type {"single" | "inline" | "multi"} [type="single"] * @type {"single" | "inline" | "multi"}
*/ */
export let type = "single"; export let type = "single";
/** /**
* Set the code snippet text * Set the code snippet text
* Alternatively, use the default slot (e.g. <CodeSnippet>{`code`}</CodeSnippet>) * Alternatively, use the default slot (e.g. <CodeSnippet>{`code`}</CodeSnippet>)
* @type {string} [code] * @type {string}
*/ */
export let code = undefined; export let code = undefined;
/** /** Set to `true` to expand a multi-line code snippet (type="multi") */
* Set to `true` to expand a multi-line code snippet (type="multi")
* @type {boolean} [expanded=false]
*/
export let expanded = false; export let expanded = false;
/** /** Set to `true` to hide the copy button */
* Set to `true` to hide the copy button
* @type {boolean} [hideCopyButton=false]
*/
export let hideCopyButton = false; export let hideCopyButton = false;
/** /**
* Set to `true` to wrap the text * Set to `true` to wrap the text
* Note that `type` must be "multi" * Note that `type` must be "multi"
* @type {boolean} [wrapText=false]
*/ */
export let wrapText = false; export let wrapText = false;
/** /** Set to `true` to enable the light variant */
* Set to `true` to enable the light variant
* @type {boolean} [light=false]
*/
export let light = false; export let light = false;
/** /** Set to `true` to display the skeleton state */
* Set to `true` to display the skeleton state
* @type {boolean} [skeleton=false]
*/
export let skeleton = false; export let skeleton = false;
/** /**
* Specify the ARIA label for the copy button icon * Specify the ARIA label for the copy button icon
* @type {string} [copyButtonDescription] * @type {string}
*/ */
export let copyButtonDescription = undefined; export let copyButtonDescription = undefined;
/** /**
* Specify the ARIA label of the copy button * Specify the ARIA label of the copy button
* @type {string} [copyLabel] * @type {string}
*/ */
export let copyLabel = undefined; export let copyLabel = undefined;
/** /** Specify the feedback text displayed when clicking the snippet */
* Specify the feedback text displayed when clicking the snippet
* @type {string} [feedback="Copied!"]
*/
export let feedback = "Copied!"; export let feedback = "Copied!";
/** /** Set the timeout duration (ms) to display feedback text */
* Set the timeout duration (ms) to display feedback text
* @type {number} [feedbackTimeout=2000]
*/
export let feedbackTimeout = 2000; export let feedbackTimeout = 2000;
/** /**
* Specify the show less text * Specify the show less text
* `type` must be "multi" * `type` must be "multi"
* @type {string} [showLessText="Show less"]
*/ */
export let showLessText = "Show less"; export let showLessText = "Show less";
/** /**
* Specify the show more text * Specify the show more text
* `type` must be "multi" * `type` must be "multi"
* @type {string} [showLessText="Show more"]
*/ */
export let showMoreText = "Show more"; export let showMoreText = "Show more";
/** /** Set to `true` to enable the show more/less button */
* Set to `true` to enable the show more/less button
* @type {boolean} [showMoreLess=false]
*/
export let showMoreLess = false; export let showMoreLess = false;
/** /**
* Set an id for the code element * Set an id for the code element
* @type {string} [id] * @type {string}
*/ */
export let id = "ccs-" + Math.random().toString(36); export let id = "ccs-" + Math.random().toString(36);
/** /**
* Obtain a reference to the pre HTML element * Obtain a reference to the pre HTML element
* @type {null | HTMLPreElement} [ref=null] * @type {null | HTMLPreElement}
*/ */
export let ref = null; export let ref = null;
@ -104,7 +80,7 @@
import { Button } from "../Button"; import { Button } from "../Button";
import { Copy } from "../Copy"; import { Copy } from "../Copy";
import { CopyButton } from "../CopyButton"; import { CopyButton } from "../CopyButton";
import CodeSnippetSkeleton from "./CodeSnippet.Skeleton.svelte"; import CodeSnippetSkeleton from "./CodeSnippetSkeleton.svelte";
function setShowMoreLess() { function setShowMoreLess() {
const { height } = ref.getBoundingClientRect(); const { height } = ref.getBoundingClientRect();

View file

@ -1,7 +1,7 @@
<script> <script>
/** /**
* Set the type of code snippet * Set the type of code snippet
* @type {"single" | "inline" | "multi"} [type="single"] * @type {"single" | "inline" | "multi"}
*/ */
export let type = "single"; export let type = "single";
</script> </script>

View file

@ -1,2 +1,2 @@
export { default as CodeSnippet } from "./CodeSnippet.svelte"; export { default as CodeSnippet } from "./CodeSnippet.svelte";
export { default as CodeSnippetSkeleton } from "./CodeSnippet.Skeleton.svelte"; export { default as CodeSnippetSkeleton } from "./CodeSnippetSkeleton.svelte";

View file

@ -1,122 +1,96 @@
<script> <script>
/**
* @typedef {{ id: string; text: string; }} ComboBoxItem
* @event {{ selectedId: string; selectedIndex: number; selectedItem: ComboBoxItem }} select
*/
/** /**
* Set the combobox items * Set the combobox items
* @type {ComboBoxItem[]} [items=[]] * @type {ComboBoxItem[]}
*/ */
export let items = []; export let items = [];
/** /**
* Override the display of a combobox item * Override the display of a combobox item
* @type {(item: ComboBoxItem) => string} [itemToString = (item: ComboBoxItem) => string] * @type {(item: ComboBoxItem) => string}
*/ */
export let itemToString = (item) => item.text || item.id; export let itemToString = (item) => item.text || item.id;
/** /**
* Set the selected item by value index * Set the selected item by value index
* @type {number} [selectedIndex=-1] * @type {number}
*/ */
export let selectedIndex = -1; export let selectedIndex = -1;
/** /** Specify the selected combobox value */
* Specify the selected combobox value
* @type {string} [value=""]
*/
export let value = ""; export let value = "";
/** /**
* Set the size of the combobox * Set the size of the combobox
* @type {"sm" | "xl"} [size] * @type {"sm" | "xl"}
*/ */
export let size = undefined; export let size = undefined;
/** /** Set to `true` to disable the combobox */
* Set to `true` to disable the combobox
* @type {boolean} [disabled=false]
*/
export let disabled = false; export let disabled = false;
/** /** Specify the title text of the combobox */
* Specify the title text of the combobox
* @type {string} [titleText=""]
*/
export let titleText = ""; export let titleText = "";
/** /** Specify the placeholder text */
* Specify the placeholder text
* @type {string} [placeholder=""]
*/
export let placeholder = ""; export let placeholder = "";
/** /** Specify the helper text */
* Specify the helper text
* @type {string} [helperText=""]
*/
export let helperText = ""; export let helperText = "";
/** /** Specify the invalid state text */
* Specify the invalid state text
* @type {string} [invalidText=""]
*/
export let invalidText = ""; export let invalidText = "";
/** /** Set to `true` to indicate an invalid state */
* Set to `true` to indicate an invalid state
* @type {boolean} [invalid=false]
*/
export let invalid = false; export let invalid = false;
/** /** Set to `true` to enable the light variant */
* Set to `true` to enable the light variant
* @type {boolean} [light=false]
*/
export let light = false; export let light = false;
/** /** Set to `true` to open the combobox menu dropdown */
* Set to `true` to open the combobox menu dropdown
* @type {boolean} [open=false]
*/
export let open = false; export let open = false;
/** /**
* Determine if an item should be filtered given the current combobox value * Determine if an item should be filtered given the current combobox value
* @type {(item: ComboBoxItem, value: string) => boolean} [shouldFilterItem=() => true] * @type {(item: ComboBoxItem, value: string) => boolean}
*/ */
export let shouldFilterItem = () => true; export let shouldFilterItem = () => true;
/** /**
* Override the default translation ids * Override the default translation ids
* @type {(id: any) => string} [translateWithId] * @type {(id: any) => string}
*/ */
export let translateWithId = undefined; export let translateWithId = undefined;
/** /**
* Set an id for the list box component * Set an id for the list box component
* @type {string} [id] * @type {string}
*/ */
export let id = "ccs-" + Math.random().toString(36); export let id = "ccs-" + Math.random().toString(36);
/** /**
* Specify a name attribute for the input * Specify a name attribute for the input
* @type {string} [name] * @type {string}
*/ */
export let name = undefined; export let name = undefined;
/** /**
* Obtain a reference to the input HTML element * Obtain a reference to the input HTML element
* @type {null | HTMLInputElement} [ref=null] * @type {null | HTMLInputElement}
*/ */
export let ref = null; export let ref = null;
/** /**
* Obtain a reference to the list HTML element * Obtain a reference to the list HTML element
* @type {null | HTMLDivElement} [ref=null] * @type {null | HTMLDivElement}
*/ */
export let listRef = null; export let listRef = null;
/**
* @typedef {{ id: string; text: string; }} ComboBoxItem
*/
import { createEventDispatcher, afterUpdate } from "svelte"; import { createEventDispatcher, afterUpdate } from "svelte";
import WarningFilled16 from "carbon-icons-svelte/lib/WarningFilled16"; import WarningFilled16 from "carbon-icons-svelte/lib/WarningFilled16";
import { import {

View file

@ -1,43 +1,28 @@
<script> <script>
/** /**
* Set the size of the composed modal * Set the size of the composed modal
* @type {"xs" | "sm" | "lg"} [size] * @type {"xs" | "sm" | "lg"}
*/ */
export let size = undefined; export let size = undefined;
/** /** Set to `true` to open the modal */
* Set to `true` to open the modal
* @type {boolean} [open=false]
*/
export let open = false; export let open = false;
/** /** Set to `true` to use the danger variant */
* Set to `true` to use the danger variant
* @type {boolean} [danger=false]
*/
export let danger = false; export let danger = false;
/** /** Set to `true` to prevent the modal from closing when clicking outside */
* Set to `true` to prevent the modal from closing when clicking outside
* @type {boolean} [preventCloseOnClickOutside=false]
*/
export let preventCloseOnClickOutside = false; export let preventCloseOnClickOutside = false;
/** /** Specify a class for the inner modal */
* Specify a class for the inner modal
* @type {string} [containerClass=""]
*/
export let containerClass = ""; export let containerClass = "";
/** /** Specify a selector to be focused when opening the modal */
* Specify a selector to be focused when opening the modal
* @type {string} [selectorPrimaryFocus="[data-modal-primary-focus]"]
*/
export let selectorPrimaryFocus = "[data-modal-primary-focus]"; export let selectorPrimaryFocus = "[data-modal-primary-focus]";
/** /**
* Obtain a reference to the top-level HTML element * Obtain a reference to the top-level HTML element
* @type {null | HTMLElement} [ref=null] * @type {null | HTMLDivElement}
*/ */
export let ref = null; export let ref = null;

View file

@ -1,14 +1,8 @@
<script> <script>
/** /** Set to `true` if the modal contains form elements */
* Set to `true` if the modal contains form elements
* @type {boolean} [hasForm=false]
*/
export let hasForm = false; export let hasForm = false;
/** /** Set to `true` if the modal contains scrolling content */
* Set to `true` if the modal contains scrolling content
* @type {boolean} [hasScrollingContent=false]
*/
export let hasScrollingContent = false; export let hasScrollingContent = false;
</script> </script>

View file

@ -1,38 +1,26 @@
<script> <script>
/** /** Specify the primary button text */
* Specify the primary button text
* @type {string} [primaryButtonText=""]
*/
export let primaryButtonText = ""; export let primaryButtonText = "";
/** /** Set to `true` to disable the primary button */
* Set to `true` to disable the primary button
* @type {boolean} [primaryButtonDisabled=false]
*/
export let primaryButtonDisabled = false; export let primaryButtonDisabled = false;
/** /**
* Specify a class for the primary button * Specify a class for the primary button
* @type {string} [primaryClass] * @type {string}
*/ */
export let primaryClass = undefined; export let primaryClass = undefined;
/** /** Specify the secondary button text */
* Specify the secondary button text
* @type {string} [secondaryButtonText=""]
*/
export let secondaryButtonText = ""; export let secondaryButtonText = "";
/** /**
* Specify a class for the secondary button * Specify a class for the secondary button
* @type {string} [secondaryClass] * @type {string}
*/ */
export let secondaryClass = undefined; export let secondaryClass = undefined;
/** /** Set to `true` to use the danger variant */
* Set to `true` to use the danger variant
* @type {boolean} [danger=false]
*/
export let danger = false; export let danger = false;
import { getContext } from "svelte"; import { getContext } from "svelte";

View file

@ -1,44 +1,23 @@
<script> <script>
/** /** Specify the modal title */
* Specify the modal title
* @type {string} [title=""]
*/
export let title = ""; export let title = "";
/** /** Specify the modal label */
* Specify the modal label
* @type {string} [label=""]
*/
export let label = ""; export let label = "";
/** /** Specify the label class */
* Specify the label class
* @type {string} [labelClass=""]
*/
export let labelClass = ""; export let labelClass = "";
/** /** Specify the title class */
* Specify the title class
* @type {string} [titleClass=""]
*/
export let titleClass = ""; export let titleClass = "";
/** /** Specify the close class */
* Specify the close class
* @type {string} [closeClass=""]
*/
export let closeClass = ""; export let closeClass = "";
/** /** Specify the close icon class */
* Specify the close icon class
* @type {string} [closeIconClass=""]
*/
export let closeIconClass = ""; export let closeIconClass = "";
/** /** Specify the ARIA label for the close icon */
* Specify the ARIA label for the close icon
* @type {string} [iconDescription="Close"]
*/
export let iconDescription = "Close"; export let iconDescription = "Close";
import { getContext } from "svelte"; import { getContext } from "svelte";

View file

@ -1,19 +1,17 @@
<script> <script>
/** /**
* Set the selected index of the switch item * @event {number} change
* @type {number} [selectedIndex=0]
*/ */
/** Set the selected index of the switch item */
export let selectedIndex = 0; export let selectedIndex = 0;
/** /** Set to `true` to enable the light variant */
* Set to `true` to enable the light variant
* @type {boolean} [light=false]
*/
export let light = false; export let light = false;
/** /**
* Specify the size of the content switcher * Specify the size of the content switcher
* @type {"sm" | "xl"} [size] * @type {"sm" | "xl"}
*/ */
export let size = undefined; export let size = undefined;

View file

@ -2,31 +2,24 @@
/** /**
* Specify the switch text * Specify the switch text
* Alternatively, use the named slot "text" (e.g. <span slot="text">...</span>) * Alternatively, use the named slot "text" (e.g. <span slot="text">...</span>)
* @type {string} [text="Provide text"]
*/ */
export let text = "Provide text"; export let text = "Provide text";
/** /** Set to `true` for the switch to be selected */
* Set to `true` for the switch to be selected
* @type {boolean} [selected=false]
*/
export let selected = false; export let selected = false;
/** /** Set to `true` to disable the switch */
* Set to `true` to disable the switch
* @type {boolean} [disabled=false]
*/
export let disabled = false; export let disabled = false;
/** /**
* Set an id for the button element * Set an id for the button element
* @type {string} [id] * @type {string}
*/ */
export let id = "ccs-" + Math.random().toString(36); export let id = "ccs-" + Math.random().toString(36);
/** /**
* Obtain a reference to the button HTML element * Obtain a reference to the button HTML element
* @type {null | HTMLButtonElement} [ref=null] * @type {null | HTMLButtonElement}
*/ */
export let ref = null; export let ref = null;

View file

@ -1,19 +1,13 @@
<script> <script>
/** /** Set the feedback text shown after clicking the button */
* Set the feedback text shown after clicking the button
* @type {string} [feedback="Copied!"]
*/
export let feedback = "Copied!"; export let feedback = "Copied!";
/** /** Set the timeout duration (ms) to display feedback text */
* Set the timeout duration (ms) to display feedback text
* @type {number} [feedbackTimeout=2000]
*/
export let feedbackTimeout = 2000; export let feedbackTimeout = 2000;
/** /**
* Obtain a reference to the button HTML element * Obtain a reference to the button HTML element
* @type {null | HTMLButtonElement} [ref=null] * @type {null | HTMLButtonElement}
*/ */
export let ref = null; export let ref = null;

View file

@ -1,8 +1,5 @@
<script> <script>
/** /** Set the title and ARIA label for the copy button */
* Set the title and ARIA label for the copy button
* @type {string} [iconDescription="Copy to clipboard"]
*/
export let iconDescription = "Copy to clipboard"; export let iconDescription = "Copy to clipboard";
import { Copy } from "../Copy"; import { Copy } from "../Copy";

View file

@ -1,95 +1,87 @@
<script> <script>
/**
* @typedef {{ key: string; value: string; display?: (item) => string; sort?: (a, b) => number; empty?: boolean; columnMenu?: boolean; }} Header
* @typedef {Header[]} Headers
* @slot {{ row: Object; }} expanded-row
* @slot {{ header: Header}} cell-header
* @slot {{ row: Object; cell: Object; }} cell
* @event {{ header?: Header; row?: Object; cell?: Object; }} click
* @event {{ expanded: boolean; }} click:header--expand
* @event {{ header: Header; sortDirection: "ascending" | "descending" | "none" }} click:header
* @event {Object} click:row
* @event {Object} mouseenter:row
* @event {Object} mouseleave:row
* @event {{ expanded: boolean; row: Object; }} click:row--expand
* @event {Object} click:cell
*/
/** /**
* Specify the data table headers * Specify the data table headers
* @type {{ key: string; value: string; display?: (item) => string; sort?: (a, b) => number; empty?: boolean; columnMenu?: boolean; }[]} [headers=[]] * @type {Headers}
*/ */
export let headers = []; export let headers = [];
/** /**
* Specify the rows the data table should render * Specify the rows the data table should render
* keys defined in `headers` are used for the row ids * keys defined in `headers` are used for the row ids
* @type {Object[]} [rows=[]] * @type {Object[]}
*/ */
export let rows = []; export let rows = [];
/** /**
* Set the size of the data table * Set the size of the data table
* @type {"compact" | "short" | "tall"} [size] * @type {"compact" | "short" | "tall"}
*/ */
export let size = undefined; export let size = undefined;
/** /** Specify the title of the data table */
* Specify the title of the data table
* @type {string} [title=""]
*/
export let title = ""; export let title = "";
/** /** Specify the description of the data table */
* Specify the description of the data table
* @type {string} [description=""]
*/
export let description = ""; export let description = "";
/** /** Set to `true` to use zebra styles */
* Set to `true` to use zebra styles
* @type {boolean} [zebra=false]
*/
export let zebra = false; export let zebra = false;
/** /** Set to `true` for the sortable variant */
* Set to `true` for the sortable variant
* @type {boolean} [sortable=false]
*/
export let sortable = false; export let sortable = false;
/** /**
* Set to `true` for the expandable variant * Set to `true` for the expandable variant
* Automatically set to `true` if `batchExpansion` is `true` * Automatically set to `true` if `batchExpansion` is `true`
* @type {boolean} [expandable=false]
*/ */
export let expandable = false; export let expandable = false;
/** /**
* Set to `true` to enable batch expansion * Set to `true` to enable batch expansion
* @type {boolean} [batchExpansion=false]
*/ */
export let batchExpansion = false; export let batchExpansion = false;
/** /**
* Specify the row ids to be expanded * Specify the row ids to be expanded
* @type {string[]} [expandedRowIds=[]] * @type {string[]}
*/ */
export let expandedRowIds = []; export let expandedRowIds = [];
/** /** Set to `true` for the radio selection variant */
* Set to `true` for the radio selection variant
* @type {boolean} [radio=false]
*/
export let radio = false; export let radio = false;
/** /**
* Set to `true` for the selectable variant * Set to `true` for the selectable variant
* Automatically set to `true` if `radio` or `batchSelection` are `true` * Automatically set to `true` if `radio` or `batchSelection` are `true`
* @type {boolean} [selectable=false]
*/ */
export let selectable = false; export let selectable = false;
/** /** Set to `true` to enable batch selection */
* Set to `true` to enable batch selection
* @type {boolean} [batchSelection=false]
*/
export let batchSelection = false; export let batchSelection = false;
/** /**
* Specify the row ids to be selected * Specify the row ids to be selected
* @type {string[]} [selectedRowIds=[]] * @type {string[]}
*/ */
export let selectedRowIds = []; export let selectedRowIds = [];
/** /** Set to `true` to enable a sticky header */
* Set to `true` to enable a sticky header
* @type {boolean} [stickyHeader=false]
*/
export let stickyHeader = false; export let stickyHeader = false;
import { createEventDispatcher, setContext } from "svelte"; import { createEventDispatcher, setContext } from "svelte";

View file

@ -1,38 +1,23 @@
<script> <script>
/** /**
* Set the size of the table * Set the size of the table
* @type {"compact" | "short" | "tall"} [size] * @type {"compact" | "short" | "tall"}
*/ */
export let size = undefined; export let size = undefined;
/** /** Set to `true` to use zebra styles */
* Set to `true` to use zebra styles
* @type {boolean} [zebra=false]
*/
export let zebra = false; export let zebra = false;
/** /** Set to `true` to use static width */
* Set to `true` to use static width
* @type {boolean} [useStaticWidth=false]
*/
export let useStaticWidth = false; export let useStaticWidth = false;
/** /** Set to `true` for the bordered variant */
* Set to `true` for the bordered variant
* @type {boolean} [shouldShowBorder=false]
*/
export let shouldShowBorder = false; export let shouldShowBorder = false;
/** /** Set to `true` for the sortable variant */
* Set to `true` for the sortable variant
* @type {boolean} [sortable=false]
*/
export let sortable = false; export let sortable = false;
/** /** Set to `true` to enable a sticky header */
* Set to `true` to enable a sticky header
* @type {boolean} [stickyHeader=false]
*/
export let stickyHeader = false; export let stickyHeader = false;
</script> </script>

View file

@ -1,20 +1,11 @@
<script> <script>
/** /** Specify the title of the data table */
* Specify the title of the data table
* @type {string} [title=""]
*/
export let title = ""; export let title = "";
/** /** Specify the description of the data table */
* Specify the description of the data table
* @type {string} [description=""]
*/
export let description = ""; export let description = "";
/** /** Set to `true` to enable a sticky header */
* Set to `true` to enable a sticky header
* @type {boolean} [stickyHeader=false]
*/
export let stickyHeader = false; export let stickyHeader = false;
</script> </script>

View file

@ -1,19 +1,16 @@
<script> <script>
/** /** Specify the `scope` attribute */
* Specify the `scope` attribute
* @type {string} [scope="col"]
*/
export let scope = "col"; export let scope = "col";
/** /**
* Override the default id translations * Override the default id translations
* @type {() => string} [translateWithId = () => ""] * @type {() => string}
*/ */
export let translateWithId = () => ""; export let translateWithId = () => "";
/** /**
* Set an id for the top-level element * Set an id for the top-level element
* @type {string} [id] * @type {string}
*/ */
export let id = "ccs-" + Math.random().toString(36); export let id = "ccs-" + Math.random().toString(36);

View file

@ -1,7 +1,7 @@
<script> <script>
/** /**
* Specify the toolbar size * Specify the toolbar size
* @type {"sm" | "default"} [size="default"] * @type {"sm" | "default"}
*/ */
export let size = "default"; export let size = "default";

View file

@ -1,7 +1,7 @@
<script> <script>
/** /**
* Override the total items selected text * Override the total items selected text
* @type {(totalSelected: number) => string} [formatTotalSelected = (totalSelected: number) => string] * @type {(totalSelected: number) => string}
*/ */
export let formatTotalSelected = (totalSelected) => export let formatTotalSelected = (totalSelected) =>
`${totalSelected} item${totalSelected === 1 ? "" : "s"} selected`; `${totalSelected} item${totalSelected === 1 ? "" : "s"} selected`;

View file

@ -1,31 +1,19 @@
<script> <script>
/** /** Specify the value of the search input */
* Specify the value of the search input
* @type {string} [value=""]
*/
export let value = ""; export let value = "";
/** /** Set to `true` to expand the search bar */
* Set to `true` to expand the search bar
* @type {boolean} [expanded=false]
*/
export let expanded = false; export let expanded = false;
/** /** Set to `true` to keep the search bar expanded */
* Set to `true` to keep the search bar expanded
* @type {boolean} [persistent=false]
*/
export let persistent = false; export let persistent = false;
/** /** Specify the tabindex */
* Specify the tabindex
* @type {string} [tabindex="0"]
*/
export let tabindex = "0"; export let tabindex = "0";
/** /**
* Obtain a reference to the input HTML element * Obtain a reference to the input HTML element
* @type {null | HTMLInputElement} [ref=null] * @type {null | HTMLInputElement}
*/ */
export let ref = null; export let ref = null;

View file

@ -1,45 +1,30 @@
<script> <script>
/** /** Specify the number of columns */
* Specify the number of columns
* @type {number} [columns=5]
*/
export let columns = 5; export let columns = 5;
/** /** Specify the number of rows */
* Specify the number of rows
* @type {number} [rows=5]
*/
export let rows = 5; export let rows = 5;
/** /**
* Set the size of the data table * Set the size of the data table
* @type {"compact" | "short" | "tall"} [size] * @type {"compact" | "short" | "tall"}
*/ */
export let size = undefined; export let size = undefined;
/** /** Set to `true` to apply zebra styles to the datatable rows */
* Set to `true` to apply zebra styles to the datatable rows
* @type {boolean} [zebra=false]
*/
export let zebra = false; export let zebra = false;
/** /** Set to `false` to hide the header */
* Set to `false` to hide the header
* @type {boolean} [showHeader=true]
*/
export let showHeader = true; export let showHeader = true;
/** /**
* Set the column headers * Set the column headers
* If `headers` has one more items, `count` is ignored * If `headers` has one more items, `count` is ignored
* @type {string[]} [headers=[]] * @type {string[]}
*/ */
export let headers = []; export let headers = [];
/** /** Set to `false` to hide the toolbar */
* Set to `false` to hide the toolbar
* @type {boolean} [showToolbar=true]
*/
export let showToolbar = true; export let showToolbar = true;
$: cols = Array.from( $: cols = Array.from(

View file

@ -1,61 +1,50 @@
<script> <script>
/**
* @dispatch {string} change
*/
/** /**
* Specify the date picker type * Specify the date picker type
* @type {"simple" | "single" | "range"} [datePickerType="simple"] * @type {"simple" | "single" | "range"}
*/ */
export let datePickerType = "simple"; export let datePickerType = "simple";
/** /** Specify the date picker input value */
* Specify the date picker input value
* @type {string} [value=""]
*/
export let value = ""; export let value = "";
/** /**
* Specify the element to append the calendar to * Specify the element to append the calendar to
* @type {HTMLElement} [appendTo=document.body] * @type {HTMLElement}
*/ */
export let appendTo = document.body; export let appendTo = document.body;
/** /** Specify the date format */
* Specify the date format
* @type {string} [dateFormat="m/d/Y"]
*/
export let dateFormat = "m/d/Y"; export let dateFormat = "m/d/Y";
/** /**
* Specify the maximum date * Specify the maximum date
* @type {null | string | Date} [maxDate=null] * @type {null | string | Date}
*/ */
export let maxDate = null; export let maxDate = null;
/** /**
* Specify the minimum date * Specify the minimum date
* @type {null | string | Date} [minDate=null] * @type {null | string | Date}
*/ */
export let minDate = null; export let minDate = null;
/** /** Specify the locale */
* Specify the locale
* @type {string} [locale="en"]
*/
export let locale = "en"; export let locale = "en";
/** /** Set to `true` to use the short variant */
* Set to `true` to use the short variant
* @type {boolean} [short=false]
*/
export let short = false; export let short = false;
/** /** Set to `true` to enable the light variant */
* Set to `true` to enable the light variant
* @type {boolean} [light=false]
*/
export let light = false; export let light = false;
/** /**
* Set an id for the date picker element * Set an id for the date picker element
* @type {string} [id] * @type {string}
*/ */
export let id = "ccs-" + Math.random().toString(36); export let id = "ccs-" + Math.random().toString(36);

View file

@ -1,79 +1,52 @@
<script> <script>
/** /**
* Set the size of the input * Set the size of the input
* @type {"sm" | "xl"} [size] * @type {"sm" | "xl"}
*/ */
export let size = undefined; export let size = undefined;
/** /** Specify the input type */
* Specify the input type
* @type {string} [type="text"]
*/
export let type = "text"; export let type = "text";
/** /** Specify the input placeholder text */
* Specify the input placeholder text
* @type {string} [placeholder=""]
*/
export let placeholder = ""; export let placeholder = "";
/** /** Specify the Regular Expression for the input value */
* Specify the Regular Expression for the input value
* @type {string} [placeholder="\\d{1,2}\\/\\d{1,2}\\/\\d{4}"]
*/
export let pattern = "\\d{1,2}\\/\\d{1,2}\\/\\d{4}"; export let pattern = "\\d{1,2}\\/\\d{1,2}\\/\\d{4}";
/** /** Set to `true` to disable the input */
* Set to `true` to disable the input
* @type {boolean} [disabled=false]
*/
export let disabled = false; export let disabled = false;
/** /** Specify the ARIA label for the calendar icon */
* Specify the ARIA label for the calendar icon
* @type {string} [iconDescription=""]
*/
export let iconDescription = ""; export let iconDescription = "";
/** /**
* Set an id for the input element * Set an id for the input element
* @type {string} [id] * @type {string}
*/ */
export let id = "ccs-" + Math.random().toString(36); export let id = "ccs-" + Math.random().toString(36);
/** /** Specify the label text */
* Specify the label text
* @type {string} [labelText=""]
*/
export let labelText = ""; export let labelText = "";
/** /** Set to `true` to visually hide the label text */
* Set to `true` to visually hide the label text
* @type {boolean} [hideLabel=false]
*/
export let hideLabel = false; export let hideLabel = false;
/** /** Set to `true` to indicate an invalid state */
* Set to `true` to indicate an invalid state
* @type {boolean} [invalid=false]
*/
export let invalid = false; export let invalid = false;
/** /** Specify the invalid state text */
* Specify the invalid state text
* @type {string} [invalidText=""]
*/
export let invalidText = ""; export let invalidText = "";
/** /**
* Set a name for the input element * Set a name for the input element
* @type {string} [name=""] * @type {string}
*/ */
export let name = undefined; export let name = undefined;
/** /**
* Obtain a reference to the input HTML element * Obtain a reference to the input HTML element
* @type {null | HTMLInputElement} [ref=null] * @type {null | HTMLInputElement}
*/ */
export let ref = null; export let ref = null;

View file

@ -1,13 +1,10 @@
<script> <script>
/** /** Set to `true` to use the range variant */
* Set to `true` to use the range variant
* @type {boolean} [range=false]
*/
export let range = false; export let range = false;
/** /**
* Set an id to be used by the label element * Set an id to be used by the label element
* @type {string} [id] * @type {string}
*/ */
export let id = "ccs-" + Math.random().toString(36); export let id = "ccs-" + Math.random().toString(36);
</script> </script>

View file

@ -1,3 +1,3 @@
export { default as DatePicker } from "./DatePicker.svelte"; export { default as DatePicker } from "./DatePicker.svelte";
export { default as DatePickerInput } from "./DatePickerInput.svelte"; export { default as DatePickerInput } from "./DatePickerInput.svelte";
export { default as DatePickerSkeleton } from "./DatePicker.Skeleton.svelte"; export { default as DatePickerSkeleton } from "./DatePickerSkeleton.svelte";

View file

@ -1,118 +1,95 @@
<script> <script>
/**
* @typedef {string} DropdownItemId
* @typedef {string} DropdownItemText
* @typedef {{ id: DropdownItemId; text: DropdownItemText; }} DropdownItem
* @event {{ selectedId: DropdownItemId, selectedIndex: number, selectedItem: DropdownItem }} select
*/
/** /**
* Set the dropdown items * Set the dropdown items
* @type {DropdownItem[]} [items=[]] * @type {DropdownItem[]}
*/ */
export let items = []; export let items = [];
/** /**
* Override the display of a dropdown item * Override the display of a dropdown item
* @type {(item: DropdownItem) => string} [itemToString = (item: DropdownItem) => DropdownItemText | DropdownItemId] * @type {(item: DropdownItem) => string}
*/ */
export let itemToString = (item) => item.text || item.id; export let itemToString = (item) => item.text || item.id;
/** /**
* Specify the selected item index * Specify the selected item index
* @type {number} [selectedIndex=-1] * @type {number}
*/ */
export let selectedIndex = -1; export let selectedIndex = -1;
/** /**
* Specify the type of dropdown * Specify the type of dropdown
* @type {"default" | "inline"} [type="default"] * @type {"default" | "inline"}
*/ */
export let type = "default"; export let type = "default";
/** /**
* Specify the size of the dropdown field * Specify the size of the dropdown field
* @type {"sm" | "lg" | "xl"} [size] * @type {"sm" | "lg" | "xl"}
*/ */
export let size = undefined; export let size = undefined;
/** /** Set to `true` to open the dropdown */
* Set to `true` to open the dropdown
* @type {boolean} [open=false]
*/
export let open = false; export let open = false;
/** /** Set to `true` to use the inline variant */
* Set to `true` to use the inline variant
* @type {boolean} [inline=false]
*/
export let inline = false; export let inline = false;
/** /** Set to `true` to enable the light variant */
* Set to `true` to enable the light variant
* @type {boolean} [light=false]
*/
export let light = false; export let light = false;
/** /** Set to `true` to disable the dropdown */
* Set to `true` to disable the dropdown
* @type {boolean} [disabled=false]
*/
export let disabled = false; export let disabled = false;
/** /** Specify the title text */
* Specify the title text
* @type {string} [titleText=""]
*/
export let titleText = ""; export let titleText = "";
/** /** Set to `true` to indicate an invalid state */
* Set to `true` to indicate an invalid state
* @type {boolean} [invalid=false]
*/
export let invalid = false; export let invalid = false;
/** /** Specify the invalid state text */
* Specify the invalid state text
* @type {string} [invalidText=""]
*/
export let invalidText = ""; export let invalidText = "";
/** /** Specify the helper text */
* Specify the helper text
* @type {string} [helperText=""]
*/
export let helperText = ""; export let helperText = "";
/** /**
* Specify the list box label * Specify the list box label
* @type {string} [label] * @type {string}
*/ */
export let label = undefined; export let label = undefined;
/** /**
* Override the default translation ids * Override the default translation ids
* @type {(id: any) => string} [translateWithId] * @type {(id: any) => string}
*/ */
export let translateWithId = undefined; export let translateWithId = undefined;
/** /**
* Set an id for the list box component * Set an id for the list box component
* @type {string} [id] * @type {string}
*/ */
export let id = "ccs-" + Math.random().toString(36); export let id = "ccs-" + Math.random().toString(36);
/** /**
* Specify a name attribute for the list box * Specify a name attribute for the list box
* @type {string} [name] * @type {string}
*/ */
export let name = undefined; export let name = undefined;
/** /**
* Obtain a reference to the button HTML element * Obtain a reference to the button HTML element
* @type {null | HTMLButtonElement} [ref=null] * @type {null | HTMLButtonElement}
*/ */
export let ref = null; export let ref = null;
/**
* @typedef {string} DropdownItemId
* @typedef {string} DropdownItemText
* @typedef {{ id: DropdownItemId; text: DropdownItemText; }} DropdownItem
*/
import { createEventDispatcher } from "svelte"; import { createEventDispatcher } from "svelte";
import WarningFilled16 from "carbon-icons-svelte/lib/WarningFilled16"; import WarningFilled16 from "carbon-icons-svelte/lib/WarningFilled16";
import { import {

View file

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

View file

@ -1,2 +1,2 @@
export { default as Dropdown } from "./Dropdown.svelte"; export { default as Dropdown } from "./Dropdown.svelte";
export { default as DropdownSkeleton } from "./Dropdown.Skeleton.svelte"; export { default as DropdownSkeleton } from "./DropdownSkeleton.svelte";

View file

@ -1,70 +1,58 @@
<script> <script>
/**
* @typedef {string[]} Files
* @event {Files} add
* @event {Files} remove
*/
/** /**
* Specify the file uploader status * Specify the file uploader status
* @type {"uploading" | "edit" | "complete"} [status="uploading"] * @type {"uploading" | "edit" | "complete"}
*/ */
export let status = "uploading"; export let status = "uploading";
/** /**
* Specify the accepted file types * Specify the accepted file types
* @type {string[]} [accept=[]] * @type {Files}
*/ */
export let accept = []; export let accept = [];
/** /**
* Obtain the uploaded file names * Obtain the uploaded file names
* @type {string[]} [files=[]] * @type {Files}
*/ */
export let files = []; export let files = [];
/** /** Set to `true` to allow multiple files */
* Set to `true` to allow multiple files
* @type {boolean} [multiple=false]
*/
export let multiple = false; export let multiple = false;
/** /**
* Override the default behavior of clearing the array of uploaded files * Override the default behavior of clearing the array of uploaded files
* @type {() => any} [clearFiles = () => void] * @type {() => void}
*/ */
export const clearFiles = () => { export const clearFiles = () => {
files = []; files = [];
}; };
/** /** Specify the label description */
* Specify the label description
* @type {string} [labelDescription=""]
*/
export let labelDescription = ""; export let labelDescription = "";
/** /** Specify the label title */
* Specify the label title
* @type {string} [labelTitle=""]
*/
export let labelTitle = ""; export let labelTitle = "";
/** /**
* Specify the kind of file uploader button * Specify the kind of file uploader button
* @type {"primary" | "secondary" | "tertiary" | "ghost" | "danger"} [kind="primary"] * @type {"primary" | "secondary" | "tertiary" | "ghost" | "danger"}
*/ */
export let kind = "primary"; export let kind = "primary";
/** /** Specify the button label */
* Specify the button label
* @type {string} [buttonLabel=""]
*/
export let buttonLabel = ""; export let buttonLabel = "";
/** /** Specify the ARIA label used for the status icons */
* Specify the ARIA label used for the status icons
* @type {string} [iconDescription=""]
*/
export let iconDescription = "Provide icon description"; export let iconDescription = "Provide icon description";
/** /** Specify a name attribute for the file button uploader input */
* Specify a name attribute for the file button uploader input
* @type {string} [name]
*/
export let name = ""; export let name = "";
import { createEventDispatcher, afterUpdate } from "svelte"; import { createEventDispatcher, afterUpdate } from "svelte";

View file

@ -1,67 +1,50 @@
<script> <script>
/**
* @typedef {string[]} Files
*/
/** /**
* Specify the accepted file types * Specify the accepted file types
* @type {string[]} [accept=[]] * @type {Files}
*/ */
export let accept = []; export let accept = [];
/** /** Set to `true` to allow multiple files */
* Set to `true` to allow multiple files
* @type {boolean} [multiple=false]
*/
export let multiple = false; export let multiple = false;
/** /** Set to `true` to disable the input */
* Set to `true` to disable the input
* @type {boolean} [disabled=false]
*/
export let disabled = false; export let disabled = false;
/** /** Set to `true` to disable label changes */
* Set to `true` to disable label changes
* @type {boolean} [disableLabelChanges=false]
*/
export let disableLabelChanges = false; export let disableLabelChanges = false;
/** /**
* Specify the kind of file uploader button * Specify the kind of file uploader button
* @type {"primary" | "secondary" | "tertiary" | "ghost" | "danger"} [kind="primary"] * @type {"primary" | "secondary" | "tertiary" | "ghost" | "danger"}]
*/ */
export let kind = "primary"; export let kind = "primary";
/** /** Specify the label text */
* Specify the label text
* @type {string} [labelText="Add file"]
*/
export let labelText = "Add file"; export let labelText = "Add file";
/** /** Specify the label role */
* Specify the label role
* @type {string} [role="button"]
*/
export let role = "button"; export let role = "button";
/** /** Specify `tabindex` attribute */
* Specify `tabindex` attribute
* @type {string} [tabindex="0"]
*/
export let tabindex = "0"; export let tabindex = "0";
/** /**
* Set an id for the input element * Set an id for the input element
* @type {string} [id] * @type {string}
*/ */
export let id = "ccs-" + Math.random().toString(36); export let id = "ccs-" + Math.random().toString(36);
/** /** Specify a name attribute for the input */
* Specify a name attribute for the input
* @type {string} [name]
*/
export let name = ""; export let name = "";
/** /**
* Obtain a reference to the input HTML element * Obtain a reference to the input HTML element
* @type {null | HTMLInputElement} [ref=null] * @type {null | HTMLInputElement}
*/ */
export let ref = null; export let ref = null;
</script> </script>

View file

@ -1,74 +1,57 @@
<script> <script>
/**
* @typedef {string[]} Files
* @event {Files} add
*/
/** /**
* Specify the accepted file types * Specify the accepted file types
* @type {string[]} [accept=[]] * @type {Files}
*/ */
export let accept = []; export let accept = [];
/** /** Set to `true` to allow multiple files */
* Set to `true` to allow multiple files
* @type {boolean} [multiple=false]
*/
export let multiple = false; export let multiple = false;
/** /**
* Override the default behavior of validating uploaded files * Override the default behavior of validating uploaded files
* The default behavior does not validate files * The default behavior does not validate files
* @type {(files: Files) => Files} [validateFiles = (files: Files) => Files] * @type {(files: Files) => Files}
*/ */
export let validateFiles = (files) => files; export let validateFiles = (files) => files;
/** /** Specify the label text */
* Specify the label text
* @type {string} [labelText="Add file"]
*/
export let labelText = "Add file"; export let labelText = "Add file";
/** /** Specify the `role` attribute of the drop container */
* Specify the `role` attribute of the drop container
* @type {string} [role="button"]
*/
export let role = "button"; export let role = "button";
/** /** Set to `true` to disable the input */
* Set to `true` to disable the input
* @type {boolean} [disabled=false]
*/
export let disabled = false; export let disabled = false;
/** /** Specify `tabindex` attribute */
* Specify `tabindex` attribute
* @type {string} [tabindex="0"]
*/
export let tabindex = "0"; export let tabindex = "0";
/** /**
* Set an id for the input element * Set an id for the input element
* @type {string} [id] * @type {string}
*/ */
export let id = "ccs-" + Math.random().toString(36); export let id = "ccs-" + Math.random().toString(36);
/** /** Specify a name attribute for the input */
* Specify a name attribute for the input
* @type {string} [name=""]
*/
export let name = ""; export let name = "";
/** /**
* Obtain a reference to the input HTML element * Obtain a reference to the input HTML element
* @type {null | HTMLInputElement} [ref=null] * @type {null | HTMLInputElement}
*/ */
export let ref = null; export let ref = null;
/**
* @typedef {string[]} Files
*/
import { createEventDispatcher } from "svelte"; import { createEventDispatcher } from "svelte";
const dispatch = createEventDispatcher(); const dispatch = createEventDispatcher();
$: over = false; let over = false;
</script> </script>
<div <div

View file

@ -1,44 +1,33 @@
<script> <script>
/**
* @event {string} delete
*/
/** /**
* Specify the file uploader status * Specify the file uploader status
* @type {"uploading" | "edit" | "complete"} [status="uploading"] * @type {"uploading" | "edit" | "complete"}
*/ */
export let status = "uploading"; export let status = "uploading";
/** /** Specify the ARIA label used for the status icons */
* Specify the ARIA label used for the status icons
* @type {string} [iconDescription=""]
*/
export let iconDescription = ""; export let iconDescription = "";
/** /** Set to `true` to indicate an invalid state */
* Set to `true` to indicate an invalid state
* @type {boolean} [invalid=false]
*/
export let invalid = false; export let invalid = false;
/** /** Specify the error subject text */
* Specify the error subject text
* @type {string} [errorSubject=""]
*/
export let errorSubject = ""; export let errorSubject = "";
/** /** Specify the error body text */
* Specify the error body text
* @type {string} [errorBody=""]
*/
export let errorBody = ""; export let errorBody = "";
/** /**
* Set an id for the top-level element * Set an id for the top-level element
* @type {string} [id] * @type {string}
*/ */
export let id = "ccs-" + Math.random().toString(36); export let id = "ccs-" + Math.random().toString(36);
/** /** Specify the file uploader name */
* Specify the file uploader name
* @type {string} [name=""]
*/
export let name = ""; export let name = "";
import { createEventDispatcher } from "svelte"; import { createEventDispatcher } from "svelte";

View file

@ -1,20 +1,14 @@
<script> <script>
/** /**
* Specify the file name status * Specify the file name status
* @type {"uploading" | "edit" | "complete"} [status="uploading"] * @type {"uploading" | "edit" | "complete"}
*/ */
export let status = "uploading"; export let status = "uploading";
/** /** Specify the ARIA label used for the status icons */
* Specify the ARIA label used for the status icons
* @type {string} [iconDescription=""]
*/
export let iconDescription = ""; export let iconDescription = "";
/** /** Set to `true` to indicate an invalid state */
* Set to `true` to indicate an invalid state
* @type {boolean} [invalid=false]
*/
export let invalid = false; export let invalid = false;
import Close16 from "carbon-icons-svelte/lib/Close16"; import Close16 from "carbon-icons-svelte/lib/Close16";

View file

@ -3,4 +3,4 @@ export { default as FileUploaderButton } from "./FileUploaderButton.svelte";
export { default as FileUploaderItem } from "./FileUploaderItem.svelte"; export { default as FileUploaderItem } from "./FileUploaderItem.svelte";
export { default as FileUploaderDropContainer } from "./FileUploaderDropContainer.svelte"; export { default as FileUploaderDropContainer } from "./FileUploaderDropContainer.svelte";
export { default as Filename } from "./Filename.svelte"; export { default as Filename } from "./Filename.svelte";
export { default as FileUploaderSkeleton } from "./FileUploader.Skeleton.svelte"; export { default as FileUploaderSkeleton } from "./FileUploaderSkeleton.svelte";

View file

@ -1,26 +1,14 @@
<script> <script>
/** /** Set to `true` to indicate an invalid state */
* Set to `true` to indicate an invalid state
* @type {boolean} [invalid=false]
*/
export let invalid = false; export let invalid = false;
/** /** Set to `true` to render a form requirement */
* Set to `true` to render a form requirement
* @type {boolean} [message=false]
*/
export let message = false; export let message = false;
/** /** Specify the message text */
* Specify the message text
* @type {string} [messageText=""]
*/
export let messageText = ""; export let messageText = "";
/** /** Specify the legend text */
* Specify the legend text
* @type {string} [legendText=""]
*/
export let legendText = ""; export let legendText = "";
</script> </script>

View file

@ -1,7 +1,7 @@
<script> <script>
/** /**
* Set an id to be used by the label element * Set an id to be used by the label element
* @type {string} [id] * @type {string}
*/ */
export let id = "ccs-" + Math.random().toString(36); export let id = "ccs-" + Math.random().toString(36);
</script> </script>

View file

@ -1,65 +1,4 @@
<script> <script>
/**
* Set to `true` to render a custom HTML element
* Props are destructured as `props` in the default slot (e.g. <Column let:props><article {...props}>...</article></Column>)
* @type {boolean} [as=false]
*/
export let as = false;
/**
* Set to `true` to remove the gutter
* @type {boolean} [noGutter=false]
*/
export let noGutter = false;
/**
* Set to `true` to remove the left gutter
* @type {boolean} [noGutterLeft=false]
*/
export let noGutterLeft = false;
/**
* Set to `true` to remove the right gutter
* @type {boolean} [noGutterRight=false]
*/
export let noGutterRight = false;
/**
* Specify the aspect ratio of the column
* @type {"2x1" | "16x9" | "9x16" | "1x2" | "4x3" | "3x4" | "1x1"} [aspectRatio]
*/
export let aspectRatio = undefined;
/**
* Set the small breakpoint
* @type {ColumnBreakpoint} [sm]
*/
export let sm = undefined;
/**
* Set the medium breakpoint
* @type {ColumnBreakpoint} [md]
*/
export let md = undefined;
/**
* Set the large breakpoint
* @type {ColumnBreakpoint} [lg]
*/
export let lg = undefined;
/**
* Set the extra large breakpoint
* @type {ColumnBreakpoint} [xlg]
*/
export let xlg = undefined;
/**
* Set the maximum breakpoint
* @type {ColumnBreakpoint} [max]
*/
export let max = undefined;
/** /**
* @typedef {boolean | number} ColumnSize * @typedef {boolean | number} ColumnSize
* @typedef {{span?: ColumnSize; offset: number;}} ColumnSizeDescriptor * @typedef {{span?: ColumnSize; offset: number;}} ColumnSizeDescriptor
@ -67,10 +6,60 @@
*/ */
/** /**
* Column breakpoints * @slot {{ props?: { class: string; } }}
* @constant
* @type {string[]}
*/ */
/**
* Set to `true` to render a custom HTML element
* Props are destructured as `props` in the default slot (e.g. <Column let:props><article {...props}>...</article></Column>)
*/
export let as = false;
/** Set to `true` to remove the gutter */
export let noGutter = false;
/** Set to `true` to remove the left gutter */
export let noGutterLeft = false;
/** Set to `true` to remove the right gutter */
export let noGutterRight = false;
/**
* Specify the aspect ratio of the column
* @type {"2x1" | "16x9" | "9x16" | "1x2" | "4x3" | "3x4" | "1x1"}
*/
export let aspectRatio = undefined;
/**
* Set the small breakpoint
* @type {ColumnBreakpoint}
*/
export let sm = undefined;
/**
* Set the medium breakpoint
* @type {ColumnBreakpoint}
*/
export let md = undefined;
/**
* Set the large breakpoint
* @type {ColumnBreakpoint}
*/
export let lg = undefined;
/**
* Set the extra large breakpoint
* @type {ColumnBreakpoint}
*/
export let xlg = undefined;
/**
* Set the maximum breakpoint
* @type {ColumnBreakpoint}
*/
export let max = undefined;
const breakpoints = ["sm", "md", "lg", "xlg", "max"]; const breakpoints = ["sm", "md", "lg", "xlg", "max"];
$: columnClass = [sm, md, lg, xlg, max] $: columnClass = [sm, md, lg, xlg, max]

View file

@ -1,45 +1,30 @@
<script> <script>
/**
* @slot {{ props?: { class: string; } }}
*/
/** /**
* Set to `true` to render a custom HTML element * Set to `true` to render a custom HTML element
* Props are destructured as `props` in the default slot (e.g. <Grid let:props><header {...props}>...</header></Grid>) * Props are destructured as `props` in the default slot (e.g. <Grid let:props><header {...props}>...</header></Grid>)
* @type {boolean} [as=false]
*/ */
export let as = false; export let as = false;
/** /** Set to `true` to use the condensed variant */
* Set to `true` to use the condensed variant
* @type {boolean} [condensed=false]
*/
export let condensed = false; export let condensed = false;
/** /** Set to `true` to use the narrow variant */
* Set to `true` to use the narrow variant
* @type {boolean} [narrow=false]
*/
export let narrow = false; export let narrow = false;
/** /** Set to `true` to use the fullWidth variant */
* Set to `true` to use the fullWidth variant
* @type {boolean} [fullWidth=false]
*/
export let fullWidth = false; export let fullWidth = false;
/** /** Set to `true` to remove the gutter */
* Set to `true` to remove the gutter
* @type {boolean} [noGutter=false]
*/
export let noGutter = false; export let noGutter = false;
/** /** Set to `true` to remove the left gutter */
* Set to `true` to remove the left gutter
* @type {boolean} [noGutterLeft=false]
*/
export let noGutterLeft = false; export let noGutterLeft = false;
/** /** Set to `true` to remove the right gutter */
* Set to `true` to remove the right gutter
* @type {boolean} [noGutterRight=false]
*/
export let noGutterRight = false; export let noGutterRight = false;
$: props = { $: props = {

View file

@ -1,39 +1,27 @@
<script> <script>
/**
* @slot {{ props?: { class: string; } }}
*/
/** /**
* Set to `true` to render a custom HTML element * Set to `true` to render a custom HTML element
* Props are destructured as `props` in the default slot (e.g. <Row let:props><section {...props}>...</section></Row>) * Props are destructured as `props` in the default slot (e.g. <Row let:props><section {...props}>...</section></Row>)
* @type {boolean} [as=false]
*/ */
export let as = false; export let as = false;
/** /** Set to `true` to use the condensed variant */
* Set to `true` to use the condensed variant
* @type {boolean} [condensed=false]
*/
export let condensed = false; export let condensed = false;
/** /** Set to `true` to use the narrow variant */
* Set to `true` to use the narrow variant
* @type {boolean} [narrow=false]
*/
export let narrow = false; export let narrow = false;
/** /** Set to `true` to remove the gutter */
* Set to `true` to remove the gutter
* @type {boolean} [noGutter=false]
*/
export let noGutter = false; export let noGutter = false;
/** /** Set to `true` to remove the left gutter */
* Set to `true` to remove the left gutter
* @type {boolean} [noGutterLeft=false]
*/
export let noGutterLeft = false; export let noGutterLeft = false;
/** /** Set to `true` to remove the right gutter */
* Set to `true` to remove the right gutter
* @type {boolean} [noGutterRight=false]
*/
export let noGutterRight = false; export let noGutterRight = false;
$: props = { $: props = {

View file

@ -2,17 +2,14 @@
/** /**
* Specify the icon from `carbon-icons-svelte` to render * Specify the icon from `carbon-icons-svelte` to render
* Icon size must be 16px (e.g. `Add16`, `Task16`) * Icon size must be 16px (e.g. `Add16`, `Task16`)
* @type {typeof import("carbon-icons-svelte/lib/Add16").default} [render] * @type {typeof import("carbon-icons-svelte/lib/Add16").default}
*/ */
export let render = undefined; export let render = undefined;
/** /** Set to `true` to display the skeleton state */
* Set to `true` to display the skeleton state
* @type {boolean} [skeleton=false]
*/
export let skeleton = false; export let skeleton = false;
import IconSkeleton from "./Icon.Skeleton.svelte"; import IconSkeleton from "./IconSkeleton.svelte";
</script> </script>
{#if skeleton} {#if skeleton}

View file

@ -1,8 +1,5 @@
<script> <script>
/** /** Set the size of the icon */
* Set the size of the icon
* @type {number} [size=16]
*/
export let size = 16; export let size = 16;
</script> </script>

View file

@ -1,2 +1,2 @@
export { default as Icon } from "./Icon.svelte"; export { default as Icon } from "./Icon.svelte";
export { default as IconSkeleton } from "./Icon.Skeleton.svelte"; export { default as IconSkeleton } from "./IconSkeleton.svelte";

View file

@ -1,26 +1,23 @@
<script> <script>
/** /**
* Set the loading status * Set the loading status
* @type {"active" | "inactive" | "finished" | "error"} [status="active"] * @type {"active" | "inactive" | "finished" | "error"}
*/ */
export let status = "active"; export let status = "active";
/** /**
* Set the loading description * Set the loading description
* @type {string} [description] * @type {string}
*/ */
export let description = undefined; export let description = undefined;
/** /**
* Specify the ARIA label for the loading icon * Specify the ARIA label for the loading icon
* @type {string} [iconDescription="Expand/Collapse"] * @type {string}
*/ */
export let iconDescription = undefined; export let iconDescription = undefined;
/** /** Specify the timeout delay (ms) after `status` is set to "success" */
* Specify the timeout delay (ms) after `status` is set to "success"
* @type {number} [successDelay=1500]
*/
export let successDelay = 1500; export let successDelay = 1500;
import { createEventDispatcher, afterUpdate, onMount } from "svelte"; import { createEventDispatcher, afterUpdate, onMount } from "svelte";

View file

@ -1,37 +1,28 @@
<script> <script>
/** /**
* Specify the size of the link * Specify the size of the link
* @type {"sm" | "lg"} [size] * @type {"sm" | "lg"}
*/ */
export let size = undefined; export let size = undefined;
/** /**
* Specify the href value * Specify the href value
* @type {string} [href] * @type {string}
*/ */
export let href = undefined; export let href = undefined;
/** /** Set to `true` to use the inline variant */
* Set to `true` to use the inline variant
* @type {boolean} [inline=false]
*/
export let inline = false; export let inline = false;
/** /** Set to `true` to disable the checkbox */
* Set to `true` to disable the checkbox
* @type {boolean} [disabled=false]
*/
export let disabled = false; export let disabled = false;
/** /** Set to `true` to allow visited styles */
* Set to `true` to allow visited styles
* @type {boolean} [visited=false]
*/
export let visited = false; export let visited = false;
/** /**
* Obtain a reference to the top-level HTML element * Obtain a reference to the top-level HTML element
* @type {null | HTMLAnchorElement | HTMLParagraphElement} [ref=null] * @type {null | HTMLAnchorElement | HTMLParagraphElement}
*/ */
export let ref = null; export let ref = null;
</script> </script>

View file

@ -1,44 +1,29 @@
<script> <script>
/** /**
* Set the size of the list box * Set the size of the list box
* @type {"sm" | "xl"} [size] * @type {"sm" | "xl"}
*/ */
export let size = undefined; export let size = undefined;
/** /**
* Set the type of the list box * Set the type of the list box
* @type {"default" | "inline"} [type="default"] * @type {"default" | "inline"}
*/ */
export let type = "default"; export let type = "default";
/** /** Set to `true` to open the list box */
* Set to `true` to open the list box
* @type {boolean} [open=false]
*/
export let open = false; export let open = false;
/** /** Set to `true` to enable the light variant */
* Set to `true` to enable the light variant
* @type {boolean} [light=false]
*/
export let light = false; export let light = false;
/** /** Set to `true` to disable the list box */
* Set to `true` to disable the list box
* @type {boolean} [disable=false]
*/
export let disabled = false; export let disabled = false;
/** /** Set to `true` to indicate an invalid state */
* Set to `true` to indicate an invalid state
* @type {boolean} [invalid=false]
*/
export let invalid = false; export let invalid = false;
/** /** Specify the invalid state text */
* Specify the invalid state text
* @type {string} [invalidText=""]
*/
export let invalidText = ""; export let invalidText = "";
</script> </script>

View file

@ -1,51 +1,38 @@
<script> <script>
/** /**
* Set to `true` to disable the list box field * @typedef {"close" | "open"} ListBoxFieldTranslationId
* @type {boolean} [disabled=false]
*/ */
/** Set to `true` to disable the list box field */
export let disabled = false; export let disabled = false;
/** /** Specify the role attribute */
* Specify the role attribute
* @type {string} [role="combobox"]
*/
export let role = "combobox"; export let role = "combobox";
/** /** Specify the tabindex */
* Specify the tabindex
* @type {string} [tabindex="-1"]
*/
export let tabindex = "-1"; export let tabindex = "-1";
/** /** Default translation ids */
* Default translation ids
* @constant
* @type {{ close: "close"; open: "open"; }}
*/
export const translationIds = { close: "close", open: "open" }; export const translationIds = { close: "close", open: "open" };
/** /**
* Override the default translation ids * Override the default translation ids
* @type {(id: ListBoxFieldTranslationId) => string} [translateWithId = (id) => string] * @type {(id: ListBoxFieldTranslationId) => string}
*/ */
export let translateWithId = (id) => defaultTranslations[id]; export let translateWithId = (id) => defaultTranslations[id];
/** /**
* Set an id for the top-level element * Set an id for the top-level element
* @type {string} [id] * @type {string}
*/ */
export let id = "ccs-" + Math.random().toString(36); export let id = "ccs-" + Math.random().toString(36);
/** /**
* Obtain a reference to the top-level HTML element * Obtain a reference to the top-level HTML element
* @type {null | HTMLElement} [ref=null] * @type {null | HTMLDivElement}
*/ */
export let ref = null; export let ref = null;
/**
* @typedef {"close" | "open"} ListBoxFieldTranslationId
*/
import { getContext } from "svelte"; import { getContext } from "svelte";
const defaultTranslations = { const defaultTranslations = {

View file

@ -1,13 +1,13 @@
<script> <script>
/** /**
* Set an id for the top-level element * Set an id for the top-level element
* @type {string} [id] * @type {string}
*/ */
export let id = "ccs-" + Math.random().toString(36); export let id = "ccs-" + Math.random().toString(36);
/** /**
* Obtain a reference to the input HTML element * Obtain a reference to the HTML element
* @type {null | HTMLDivElement} [ref=null] * @type {null | HTMLDivElement}
*/ */
export let ref = null; export let ref = null;
</script> </script>

View file

@ -1,27 +1,20 @@
<script> <script>
/** /**
* Set to `true` to open the list box menu icon * @typedef {"close" | "open"} ListBoxMenuIconTranslationId
* @type {boolean} [open=false]
*/ */
/** Set to `true` to open the list box menu icon */
export let open = false; export let open = false;
/** /** Default translation ids */
* Default translation ids
* @constant
* @type {{ close: "close"; open: "open" }}
*/
export const translationIds = { close: "close", open: "open" }; export const translationIds = { close: "close", open: "open" };
/** /**
* Override the default translation ids * Override the default translation ids
* @type {(id: ListBoxMenuIconTranslationId) => string} [translateWithId = (id) => string] * @type {(id: ListBoxMenuIconTranslationId) => string}
*/ */
export let translateWithId = (id) => defaultTranslations[id]; export let translateWithId = (id) => defaultTranslations[id];
/**
* @typedef {"close" | "open"} ListBoxMenuIconTranslationId
*/
import ChevronDown16 from "carbon-icons-svelte/lib/ChevronDown16"; import ChevronDown16 from "carbon-icons-svelte/lib/ChevronDown16";
const defaultTranslations = { const defaultTranslations = {

View file

@ -1,14 +1,8 @@
<script> <script>
/** /** Set to `true` to enable the active state */
* Set to `true` to enable the active state
* @type {boolean} [active=false]
*/
export let active = false; export let active = false;
/** /** Set to `true` to enable the highlighted state */
* Set to `true` to enable the highlighted state
* @type {boolean} [highlighted=false]
*/
export let highlighted = false; export let highlighted = false;
</script> </script>

View file

@ -1,21 +1,18 @@
<script> <script>
/**
* @typedef {"clearAll" | "clearSelection"} ListBoxSelectionTranslationId
*/
/** /**
* Specify the number of selected items * Specify the number of selected items
* @type {any} [selectionCount] * @type {any}
*/ */
export let selectionCount = undefined; export let selectionCount = undefined;
/** /** Set to `true` to disable the list box selection */
* Set to `true` to disable the list box selection
* @type {boolean} [disabled=false]
*/
export let disabled = false; export let disabled = false;
/** /** Default translation ids */
* Default translation ids
* @constant
* @type {{ clearAll: "clearAll"; clearSelection: "clearSelection" }}
*/
export const translationIds = { export const translationIds = {
clearAll: "clearAll", clearAll: "clearAll",
clearSelection: "clearSelection", clearSelection: "clearSelection",
@ -23,20 +20,16 @@
/** /**
* Override the default translation ids * Override the default translation ids
* @type {(id: ListBoxSelectionTranslationId) => string} [translateWithId = (id) => string] * @type {(id: ListBoxSelectionTranslationId) => string}
*/ */
export let translateWithId = (id) => defaultTranslations[id]; export let translateWithId = (id) => defaultTranslations[id];
/** /**
* Obtain a reference to the top-level HTML element * Obtain a reference to the top-level HTML element
* @type {null | HTMLElement} [ref=null] * @type {null | HTMLElement}
*/ */
export let ref = null; export let ref = null;
/**
* @typedef {"clearAll" | "clearSelection"} ListBoxSelectionTranslationId
*/
import { createEventDispatcher, getContext } from "svelte"; import { createEventDispatcher, getContext } from "svelte";
import Close16 from "carbon-icons-svelte/lib/Close16"; import Close16 from "carbon-icons-svelte/lib/Close16";

View file

@ -1,31 +1,19 @@
<script> <script>
/** /** Set to `true` to use the small variant */
* Set to `true` to use the small variant
* @type {boolean} [small=false]
*/
export let small = false; export let small = false;
/** /** Set to `false` to disable the active state */
* Set to `false` to disable the active state
* @type {boolean} [active=true]
*/
export let active = true; export let active = true;
/** /** Set to `false` to disable the overlay */
* Set to `false` to disable the overlay
* @type {boolean} [withOverlay=false]
*/
export let withOverlay = true; export let withOverlay = true;
/** /** Specify the label description */
* Specify the label description
* @type {string} [description="Active loading indicator"]
*/
export let description = "Active loading indicator"; export let description = "Active loading indicator";
/** /**
* Set an id for the label element * Set an id for the label element
* @type {string} [id] * @type {string}
*/ */
export let id = "ccs-" + Math.random().toString(36); export let id = "ccs-" + Math.random().toString(36);

View file

@ -1,115 +1,76 @@
<script> <script>
/** /**
* Set the size of the modal * Set the size of the modal
* @type {"xs" | "sm" | "lg"} [size] * @type {"xs" | "sm" | "lg"}
*/ */
export let size = undefined; export let size = undefined;
/** /** Set to `true` to open the modal */
* Set to `true` to open the modal
* @type {boolean} [open=false]
*/
export let open = false; export let open = false;
/** /** Set to `true` to use the danger variant */
* Set to `true` to use the danger variant
* @type {boolean} [danger=false]
*/
export let danger = false; export let danger = false;
/** /** Set to `true` to enable alert mode */
* Set to `true` to enable alert mode
* @type {boolean} [alert=false]
*/
export let alert = false; export let alert = false;
/** /** Set to `true` to use the passive variant */
* Set to `true` to use the passive variant
* @type {boolean} [passiveModal=false]
*/
export let passiveModal = false; export let passiveModal = false;
/** /**
* Specify the modal heading * Specify the modal heading
* @type {string} [modalHeading] * @type {string}
*/ */
export let modalHeading = undefined; export let modalHeading = undefined;
/** /**
* Specify the modal label * Specify the modal label
* @type {string} [modalLabel] * @type {string}
*/ */
export let modalLabel = undefined; export let modalLabel = undefined;
/** /**
* Specify the ARIA label for the modal * Specify the ARIA label for the modal
* @type {string} [modalAriaLabel] * @type {string}
*/ */
export let modalAriaLabel = undefined; export let modalAriaLabel = undefined;
/** /** Specify the ARIA label for the close icon */
* Specify the ARIA label for the close icon
* @type {string} [iconDescription="Close the modal"]
*/
export let iconDescription = "Close the modal"; export let iconDescription = "Close the modal";
/** /** Set to `true` if the modal contains form elements */
* Set to `true` if the modal contains form elements
* @type {boolean} [hasForm=false]
*/
export let hasForm = false; export let hasForm = false;
/** /** Set to `true` if the modal contains scrolling content */
* Set to `true` if the modal contains scrolling content
* @type {boolean} [hasScrollingContent=false]
*/
export let hasScrollingContent = false; export let hasScrollingContent = false;
/** /** Specify the primary button text */
* Specify the primary button text
* @type {string} [primaryButtonText=""]
*/
export let primaryButtonText = ""; export let primaryButtonText = "";
/** /** Set to `true` to disable the primary button */
* Set to `true` to disable the primary button
* @type {boolean} [primaryButtonDisabled=false]
*/
export let primaryButtonDisabled = false; export let primaryButtonDisabled = false;
/** /** Set to `true` for the primary button to be triggered when pressing "Enter" */
* Set to `true` for the primary button to be triggered when pressing "Enter"
* @type {boolean} [shouldSubmitOnEnter=true]
*/
export let shouldSubmitOnEnter = true; export let shouldSubmitOnEnter = true;
/** /** Specify the secondary button text */
* Specify the secondary button text
* @type {string} [secondaryButtonText=""]
*/
export let secondaryButtonText = ""; export let secondaryButtonText = "";
/** /** Specify a selector to be focused when opening the modal */
* Specify a selector to be focused when opening the modal
* @type {string} [selectorPrimaryFocus="[data-modal-primary-focus]"]
*/
export let selectorPrimaryFocus = "[data-modal-primary-focus]"; export let selectorPrimaryFocus = "[data-modal-primary-focus]";
/** /** Set to `true` to prevent the modal from closing when clicking outside */
* Set to `true` to prevent the modal from closing when clicking outside
* @type {boolean} [preventCloseOnClickOutside=false]
*/
export let preventCloseOnClickOutside = false; export let preventCloseOnClickOutside = false;
/** /**
* Set an id for the top-level element * Set an id for the top-level element
* @type {string} [id] * @type {string}
*/ */
export let id = "ccs-" + Math.random().toString(36); export let id = "ccs-" + Math.random().toString(36);
/** /**
* Obtain a reference to the top-level HTML element * Obtain a reference to the top-level HTML element
* @type {null | HTMLElement} [ref=null] * @type {null | HTMLDivElement}
*/ */
export let ref = null; export let ref = null;

View file

@ -1,149 +1,110 @@
<script> <script>
/** /**
* Set the multiselect items * Set the multiselect items
* @type {MultiSelectItem[]} [items=[]] * @type {MultiSelectItem[]}
*/ */
export let items = []; export let items = [];
/** /**
* Override the display of a multiselect item * Override the display of a multiselect item
* @type {(item: MultiSelectItem) => string} [itemToString = (item: MultiSelectItem) => MultiSelectItemText | MultiSelectItemId] * @type {(item: MultiSelectItem) => string}
*/ */
export let itemToString = (item) => item.text || item.id; export let itemToString = (item) => item.text || item.id;
/** /**
* Set the selected ids * Set the selected ids
* @type {MultiSelectItemId[]} [selectedIds=[]] * @type {MultiSelectItemId[]}
*/ */
export let selectedIds = []; export let selectedIds = [];
/** /** Specify the multiselect value */
* Specify the multiselect value
* @type {string} [value=""]
*/
export let value = ""; export let value = "";
/** /**
* Set the size of the combobox * Set the size of the combobox
* @type {"sm" | "lg" | "xl"} [size] * @type {"sm" | "lg" | "xl"}
*/ */
export let size = undefined; export let size = undefined;
/** /**
* Specify the type of multiselect * Specify the type of multiselect
* @type {"default" | "inline"} [type="default"] * @type {"default" | "inline"}
*/ */
export let type = "default"; export let type = "default";
/** /**
* Specify the selection feedback after selecting items * Specify the selection feedback after selecting items
* @type {"top" | "fixed" | "top-after-reopen"} [selectionFeedback="top-after-reopen"] * @type {"top" | "fixed" | "top-after-reopen"}
*/ */
export let selectionFeedback = "top-after-reopen"; export let selectionFeedback = "top-after-reopen";
/** /** Set to `true` to disable the dropdown */
* Set to `true` to disable the dropdown
* @type {boolean} [disabled=false]
*/
export let disabled = false; export let disabled = false;
/** /** Set to `true` to filter items */
* Set to `true` to filter items
* @type {boolean} [filterable=false]
*/
export let filterable = false; export let filterable = false;
/** /**
* Override the filtering logic * Override the filtering logic
* The default filtering is an exact string comparison * The default filtering is an exact string comparison
* @type {(item: MultiSelectItem, value: string) => string} [filterItem = (item: MultiSelectItem, value: string) => string] * @type {(item: MultiSelectItem, value: string) => string}
*/ */
export let filterItem = (item, value) => export let filterItem = (item, value) =>
item.text.toLowerCase().includes(value.toLowerCase()); item.text.toLowerCase().includes(value.toLowerCase());
/** /** Set to `true` to open the dropdown */
* Set to `true` to open the dropdown
* @type {boolean} [open=false]
*/
export let open = false; export let open = false;
/** /** Set to `true` to enable the light variant */
* Set to `true` to enable the light variant
* @type {boolean} [light=false]
*/
export let light = false; export let light = false;
/** /** Specify the locale */
* Specify the locale
* @type {string} [locale="en"]
*/
export let locale = "en"; export let locale = "en";
/** /** Specify the placeholder text */
* Specify the placeholder text
* @type {string} [placeholder=""]
*/
export let placeholder = ""; export let placeholder = "";
/** /**
* Override the sorting logic * Override the sorting logic
* The default sorting compare the item text value * The default sorting compare the item text value
* @type {(a: MultiSelectItem, b: MultiSelectItem) => MultiSelectItem} [sortItem = (a: MultiSelectItem, b: MultiSelectItem) => MultiSelectItem] * @type {(a: MultiSelectItem, b: MultiSelectItem) => MultiSelectItem}
*/ */
export let sortItem = (a, b) => export let sortItem = (a, b) =>
a.text.localeCompare(b.text, locale, { numeric: true }); a.text.localeCompare(b.text, locale, { numeric: true });
/** /**
* Override the default translation ids * Override the default translation ids
* @type {(id: any) => string} [translateWithId] * @type {(id: any) => string}
*/ */
export let translateWithId = undefined; export let translateWithId = undefined;
/** /** Specify the title text */
* Specify the title text
* @type {string} [titleText=""]
*/
export let titleText = ""; export let titleText = "";
/** /** Set to `true` to pass the item to `itemToString` in the checkbox */
* Set to `true` to pass the item to `itemToString` in the checkbox
* @type {boolean} [useTitleInItem=false]
*/
export let useTitleInItem = false; export let useTitleInItem = false;
/** /** Set to `true` to indicate an invalid state */
* Set to `true` to indicate an invalid state
* @type {boolean} [invalid=false]
*/
export let invalid = false; export let invalid = false;
/** /** Specify the invalid state text */
* Specify the invalid state text
* @type {string} [invalidText=""]
*/
export let invalidText = ""; export let invalidText = "";
/** /** Specify the helper text */
* Specify the helper text
* @type {string} [helperText=""]
*/
export let helperText = ""; export let helperText = "";
/** /** Specify the list box label */
* Specify the list box label
* @type {string} [label]
*/
export let label = ""; export let label = "";
/** /**
* Set an id for the list box component * Set an id for the list box component
* @type {string} [id] * @type {string}
*/ */
export let id = "ccs-" + Math.random().toString(36); export let id = "ccs-" + Math.random().toString(36);
/** /**
* Specify a name attribute for the select * Specify a name attribute for the select
* @type {string} [name] * @type {string}
*/ */
export let name = undefined; export let name = undefined;

View file

@ -1,56 +1,35 @@
<script> <script>
/** /**
* Set the type of notification * Set the type of notification
* @type {"toast" | "inline"} [notificationType="toast"] * @type {"toast" | "inline"}
*/ */
export let notificationType = "inline"; export let notificationType = "inline";
/** /**
* Specify the kind of notification * Specify the kind of notification
* @type {"error" | "info" | "info-square" | "success" | "warning" | "warning-alt"} [kind="error"] * @type {"error" | "info" | "info-square" | "success" | "warning" | "warning-alt"}
*/ */
export let kind = "error"; export let kind = "error";
/** /** Set to `true` to use the low contrast variant */
* Set to `true` to use the low contrast variant
* @type {boolean} [lowContrast=false]
*/
export let lowContrast = false; export let lowContrast = false;
/** /** Set the timeout duration (ms) to hide the notification after opening it */
* Set the timeout duration (ms) to hide the notification after opening it
* @type {number} [timeout=0]
*/
export let timeout = 0; export let timeout = 0;
/** /** Set the `role` attribute */
* Set the `role` attribute
* @type {string} [role="alert"]
*/
export let role = "alert"; export let role = "alert";
/** /** Specify the title text */
* Specify the title text
* @type {string} [title="Title"]
*/
export let title = "Title"; export let title = "Title";
/** /** Specify the subtitle text */
* Specify the subtitle text
* @type {string} [subtitle=""]
*/
export let subtitle = ""; export let subtitle = "";
/** /** Set to `true` to hide the close button */
* Set to `true` to hide the close button
* @type {boolean} [hideCloseButton=false]
*/
export let hideCloseButton = false; export let hideCloseButton = false;
/** /** Specify the ARIA label for the icon */
* Specify the ARIA label for the icon
* @type {string} [iconDescription="Closes notification"]
*/
export let iconDescription = "Closes notification"; export let iconDescription = "Closes notification";
import { createEventDispatcher, onMount } from "svelte"; import { createEventDispatcher, onMount } from "svelte";

View file

@ -1,26 +1,23 @@
<script> <script>
/** /**
* Set the type of notification * Set the type of notification
* @type {"toast" | "inline"} [notificationType="toast"] * @type {"toast" | "inline"}
*/ */
export let notificationType = "toast"; export let notificationType = "toast";
/** /**
* Specify the icon from `carbon-icons-svelte` to render * Specify the icon from `carbon-icons-svelte` to render
* @type {typeof import("carbon-icons-svelte/lib/Add16").default} [renderIcon] * @type {typeof import("carbon-icons-svelte/lib/Add16").default}
*/ */
export let renderIcon = Close20; export let renderIcon = Close20;
/** /**
* Specify the title of the icon * Specify the title of the icon
* @type {string} [title] * @type {string}
*/ */
export let title = undefined; export let title = undefined;
/** /** Specify the ARIA label for the icon */
* Specify the ARIA label for the icon
* @type {string} [iconDescription="Close icon"]
*/
export let iconDescription = "Close icon"; export let iconDescription = "Close icon";
import Close20 from "carbon-icons-svelte/lib/Close20"; import Close20 from "carbon-icons-svelte/lib/Close20";

View file

@ -1,20 +1,17 @@
<script> <script>
/** /**
* Specify the kind of notification icon * Specify the kind of notification icon
* @type {"error" | "info" | "info-square" | "success" | "warning" | "warning-alt"} [kind="error"] * @type {"error" | "info" | "info-square" | "success" | "warning" | "warning-alt"}
*/ */
export let kind = "error"; export let kind = "error";
/** /**
* Set the type of notification * Set the type of notification
* @type {"toast" | "inline"} [notificationType="toast"] * @type {"toast" | "inline"}
*/ */
export let notificationType = "toast"; export let notificationType = "toast";
/** /** Specify the ARIA label for the icon */
* Specify the ARIA label for the icon
* @type {string} [iconDescription="Closes notification"]
*/
export let iconDescription = "Closes notification"; export let iconDescription = "Closes notification";
import CheckmarkFilled20 from "carbon-icons-svelte/lib/CheckmarkFilled20"; import CheckmarkFilled20 from "carbon-icons-svelte/lib/CheckmarkFilled20";

View file

@ -1,26 +1,17 @@
<script> <script>
/** /**
* Set the type of notification * Set the type of notification
* @type {"toast" | "inline"} [notificationType="toast"] * @type {"toast" | "inline"}
*/ */
export let notificationType = "toast"; export let notificationType = "toast";
/** /** Specify the title text */
* Specify the title text
* @type {string} [title="Title"]
*/
export let title = "Title"; export let title = "Title";
/** /** Specify the subtitle text */
* Specify the subtitle text
* @type {string} [subtitle=""]
*/
export let subtitle = ""; export let subtitle = "";
/** /** Specify the caption text */
* Specify the caption text
* @type {string} [caption="Caption"]
*/
export let caption = "Caption"; export let caption = "Caption";
</script> </script>

View file

@ -1,62 +1,38 @@
<script> <script>
/** /**
* Set the type of notification * Set the type of notification
* @type {"toast" | "inline"} [notificationType="toast"] * @type {"toast" | "inline"}
*/ */
export let notificationType = "toast"; export let notificationType = "toast";
/** /**
* Specify the kind of notification * Specify the kind of notification
* @type {"error" | "info" | "info-square" | "success" | "warning" | "warning-alt"} [kind="error"] * @type {"error" | "info" | "info-square" | "success" | "warning" | "warning-alt"}
*/ */
export let kind = "error"; export let kind = "error";
/** /** Set to `true` to use the low contrast variant */
* Set to `true` to use the low contrast variant
* @type {boolean} [lowContrast=false]
*/
export let lowContrast = false; export let lowContrast = false;
/** /** Set the timeout duration (ms) to hide the notification after opening it */
* Set the timeout duration (ms) to hide the notification after opening it
* @type {number} [timeout=0]
*/
export let timeout = 0; export let timeout = 0;
/** /** Set the `role` attribute */
* Set the `role` attribute
* @type {string} [role="alert"]
*/
export let role = "alert"; export let role = "alert";
/** /** Specify the title text */
* Specify the title text
* @type {string} [title="Title"]
*/
export let title = "Title"; export let title = "Title";
/** /** Specify the subtitle text */
* Specify the subtitle text
* @type {string} [subtitle=""]
*/
export let subtitle = ""; export let subtitle = "";
/** /** Specify the caption text */
* Specify the caption text
* @type {string} [caption="Caption"]
*/
export let caption = "Caption"; export let caption = "Caption";
/** /** Specify the ARIA label for the icon */
* Specify the ARIA label for the icon
* @type {string} [iconDescription="Closes notification"]
*/
export let iconDescription = "Closes notification"; export let iconDescription = "Closes notification";
/** /** Set to `true` to hide the close button */
* Set to `true` to hide the close button
* @type {boolean} [hideCloseButton=false]
*/
export let hideCloseButton = false; export let hideCloseButton = false;
import { createEventDispatcher, onMount } from "svelte"; import { createEventDispatcher, onMount } from "svelte";

View file

@ -1,109 +1,69 @@
<script> <script>
/** /**
* Set the size of the input * Set the size of the input
* @type {"sm" | "xl"} [size] * @type {"sm" | "xl"}
*/ */
export let size = undefined; export let size = undefined;
/** /** Specify the input value */
* Specify the input value
* @type {string} [value=""]
*/
export let value = ""; export let value = "";
/** /** Specify the step increment */
* Specify the step increment
* @type {number} [step=1]
*/
export let step = 1; export let step = 1;
/** /**
* Specify the maximum value * Specify the maximum value
* @type {number} [max] * @type {number}
*/ */
export let max = undefined; export let max = undefined;
/** /**
* Specify the minimum value * Specify the minimum value
* @type {number} [min] * @type {number}
*/ */
export let min = undefined; export let min = undefined;
/** /** Set to `true` to enable the light variant */
* Set to `true` to enable the light variant
* @type {boolean} [light=false]
*/
export let light = false; export let light = false;
/** /** Set to `true` for the input to be read-only */
* Set to `true` for the input to be read-only
* @type {boolean} [readonly=false]
*/
export let readonly = false; export let readonly = false;
/** /** Set to `true` to enable the mobile variant */
* Set to `true` to enable the mobile variant
* @type {boolean} [mobile=false]
*/
export let mobile = false; export let mobile = false;
/** /** Set to `true` to allow for an empty value */
* Set to `true` to allow for an empty value
* @type {boolean} [allowEmpty=false]
*/
export let allowEmpty = false; export let allowEmpty = false;
/** /** Set to `true` to disable the input */
* Set to `true` to disable the input
* @type {boolean} [disabled=false]
*/
export let disabled = false; export let disabled = false;
/** /** Specify the ARIA label for the increment icons */
* Specify the ARIA label for the increment icons
* @type {string} [iconDescription=""]
*/
export let iconDescription = ""; export let iconDescription = "";
/** /** Set to `true` to indicate an invalid state */
* Set to `true` to indicate an invalid state
* @type {boolean} [invalid=false]
*/
export let invalid = false; export let invalid = false;
/** /** Specify the invalid state text */
* Specify the invalid state text
* @type {string} [invalidText="Provide invalidText"]
*/
export let invalidText = ""; export let invalidText = "";
/** /** Specify the helper text */
* Specify the helper text
* @type {string} [helperText=""]
*/
export let helperText = ""; export let helperText = "";
/** /** Specify the label text */
* Specify the label text
* @type {string} [label=""]
*/
export let label = ""; export let label = "";
/** /** Set to `true` to visually hide the label text */
* Set to `true` to visually hide the label text
* @type {boolean} [hideLabel=false]
*/
export let hideLabel = false; export let hideLabel = false;
/** /**
* Override the default translation ids * Override the default translation ids
* @type {(id: NumberInputTranslationId) => string} [translateWithId = (id: NumberInputTranslationId) => string] * @type {(id: NumberInputTranslationId) => string}
*/ */
export let translateWithId = (id) => defaultTranslations[id]; export let translateWithId = (id) => defaultTranslations[id];
/** /**
* Default translation ids * Default translation ids
* @constant
* @type {{ increment: "increment"; decrement: "decrement" }} * @type {{ increment: "increment"; decrement: "decrement" }}
*/ */
export const translationIds = { export const translationIds = {
@ -113,13 +73,13 @@
/** /**
* Set an id for the input element * Set an id for the input element
* @type {string} [id] * @type {string}
*/ */
export let id = "ccs-" + Math.random().toString(36); export let id = "ccs-" + Math.random().toString(36);
/** /**
* Specify a name attribute for the input * Specify a name attribute for the input
* @type {string} [name] * @type {string}
*/ */
export let name = undefined; export let name = undefined;

View file

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

View file

@ -1,2 +1,2 @@
export { default as NumberInput } from "./NumberInput.svelte"; export { default as NumberInput } from "./NumberInput.svelte";
export { default as NumberInputSkeleton } from "./NumberInput.Skeleton.svelte"; export { default as NumberInputSkeleton } from "./NumberInputSkeleton.svelte";

View file

@ -1,14 +1,8 @@
<script> <script>
/** /** Set to `true` to use the nested variant */
* Set to `true` to use the nested variant
* @type {boolean} [nested=false]
*/
export let nested = false; export let nested = false;
/** /** Set to `true` to use native list styles */
* Set to `true` to use native list styles
* @type {boolean} [native=false]
*/
export let native = false; export let native = false;
</script> </script>

View file

@ -1,73 +1,61 @@
<script> <script>
/** /**
* Specify the size of the overflow menu * Specify the size of the overflow menu
* @type {"sm" | "xl"} [size] * @type {"sm" | "xl"}
*/ */
export let size = undefined; export let size = undefined;
/** /**
* Specify the direction of the overflow menu relative to the button * Specify the direction of the overflow menu relative to the button
* @type {"top" | "bottom"} [direction="bottom"] * @type {"top" | "bottom"}
*/ */
export let direction = "bottom"; export let direction = "bottom";
/** /** Set to `true` to open the menu */
* Set to `true` to open the menu
* @type {boolean} [open=false]
*/
export let open = false; export let open = false;
/** /** Set to `true` to enable the light variant */
* Set to `true` to enable the light variant
* @type {boolean} [light=false]
*/
export let light = false; export let light = false;
/** /** Set to `true` to flip the menu relative to the button */
* Set to `true` to flip the menu relative to the button
* @type {boolean} [flipped=false]
*/
export let flipped = false; export let flipped = false;
/** /**
* Specify the menu options class * Specify the menu options class
* @type {string} [menuOptionsClass] * @type {string}
*/ */
export let menuOptionsClass = undefined; export let menuOptionsClass = undefined;
/** /**
* Specify the icon from `carbon-icons-svelte` to render * 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 = OverflowMenuVertical16; export let icon = OverflowMenuVertical16;
/** /**
* Specify the icon class * Specify the icon class
* @type {string} [iconClass] * @type {string}
*/ */
export let iconClass = undefined; export let iconClass = undefined;
/** /** Specify the ARIA label for the icon */
* Specify the ARIA label for the icon
* @type {string} [iconDescription="Open and close list of options"]
*/
export let iconDescription = "Open and close list of options"; export let iconDescription = "Open and close list of options";
/** /**
* Set an id for the button element * Set an id for the button element
* @type {string} [id] * @type {string}
*/ */
export let id = "ccs-" + Math.random().toString(36); export let id = "ccs-" + Math.random().toString(36);
/** /**
* Obtain a reference to the trigger button element * Obtain a reference to the trigger button element
* @type {null | HTMLButtonElement} [ref=null] * @type {null | HTMLButtonElement}
*/ */
export let buttonRef = null; export let buttonRef = null;
/** /**
* Obtain a reference to the overflow menu element * Obtain a reference to the overflow menu element
* @type {null | HTMLUListElement} [ref=null] * @type {null | HTMLUListElement}
*/ */
export let menuRef = null; export let menuRef = null;

View file

@ -2,55 +2,36 @@
/** /**
* Specify the item text * Specify the item text
* Alternatively, use the default slot for a custom element * Alternatively, use the default slot for a custom element
* @type {string} [text="Provide text"]
*/ */
export let text = "Provide text"; export let text = "Provide text";
/** /** Specify the `href` attribute if the item is a link */
* Specify the `href` attribute if the item is a link
* @type {string} [href=""]
*/
export let href = ""; export let href = "";
/** /** Set to `true` if the item should be focused when opening the menu */
* Set to `true` if the item should be focused when opening the menu
* @type {boolean} [primaryFocus=false]
*/
export let primaryFocus = false; export let primaryFocus = false;
/** /** Set to `true` to disable the item */
* Set to `true` to disable the item
* @type {boolean} [disabled=false]
*/
export let disabled = false; export let disabled = false;
/** /** Set to `true` to include a divider */
* Set to `true` to include a divider
* @type {boolean} [hasDivider=false]
*/
export let hasDivider = false; export let hasDivider = false;
/** /** Set to `true` to use the danger variant */
* Set to `true` to use the danger variant
* @type {boolean} [danger=false]
*/
export let danger = false; export let danger = false;
/** /** Set to `false` to omit the button `title` attribute */
* Set to `false` to omit the button `title` attribute
* @type {boolean} [requireTitle=false]
*/
export let requireTitle = true; export let requireTitle = true;
/** /**
* Set an id for the top-level element * Set an id for the top-level element
* @type {string} [id] * @type {string}
*/ */
export let id = "ccs-" + Math.random().toString(36); export let id = "ccs-" + Math.random().toString(36);
/** /**
* Obtain a reference to the HTML element * Obtain a reference to the HTML element
* @type {null | HTMLAnchorElement | HTMLButtonElement} [ref=null] * @type {null | HTMLAnchorElement | HTMLButtonElement}
*/ */
export let ref = null; export let ref = null;

View file

@ -1,99 +1,69 @@
<script> <script>
/** /** Specify the current page index */
* Specify the current page index
* @type {number} [page=1]
*/
export let page = 1; export let page = 1;
/** /** Specify the total number of items */
* Specify the total number of items
* @type {number} [total=0]
*/
export let totalItems = 0; export let totalItems = 0;
/** /** Set to `true` to disable the pagination */
* Set to `true` to disable the pagination
* @type {boolean} [disabled=false]
*/
export let disabled = false; export let disabled = false;
/** /** Specify the forward button text */
* Specify the forward button text
* @type {string} [forwardText="Next page"]
*/
export let forwardText = "Next page"; export let forwardText = "Next page";
/** /** Specify the backward button text */
* Specify the backward button text
* @type {string} [backwardText="Previous page"]
*/
export let backwardText = "Previous page"; export let backwardText = "Previous page";
/** /** Specify the items per page text */
* Specify the items per page text
* @type {string} [itemsPerPageText="Items per page:"]
*/
export let itemsPerPageText = "Items per page:"; export let itemsPerPageText = "Items per page:";
/** /**
* Override the item text * Override the item text
* @type {(min: number, max: number) => string} [itemText = (min: number, max: number) => string] * @type {(min: number, max: number) => string}
*/ */
export let itemText = (min, max) => `${min}${max} items`; export let itemText = (min, max) => `${min}${max} items`;
/** /**
* Override the item range text * Override the item range text
* @type {(min: number, max: number, total: number) => string} [itemRangeText = (min: number, max: number, total: number) => string] * @type {(min: number, max: number, total: number) => string}
*/ */
export let itemRangeText = (min, max, total) => export let itemRangeText = (min, max, total) =>
`${min}${max} of ${total} items`; `${min}${max} of ${total} items`;
/** /** Set to `true` to disable the page input */
* Set to `true` to disable the page input
* @type {boolean} [pageInputDisabled=false]
*/
export let pageInputDisabled = false; export let pageInputDisabled = false;
/** /** Set to `true` to disable the page size input */
* Set to `true` to disable the page size input
* @type {boolean} [pageSizeInputDisabled=false]
*/
export let pageSizeInputDisabled = false; export let pageSizeInputDisabled = false;
/** /** Specify the number of items to display in a page */
* Specify the number of items to display in a page
* @type {number} [pageSize=10]
*/
export let pageSize = 10; export let pageSize = 10;
/** /**
* Specify the available page sizes * Specify the available page sizes
* @type {number[]} [pageSizes=[10]] * @type {number[]}
*/ */
export let pageSizes = [10]; export let pageSizes = [10];
/** /** Set to `true` if the number of pages is unknown */
* Set to `true` if the number of pages is unknown
* @type {boolean} [pagesUnknown=false]
*/
export let pagesUnknown = false; export let pagesUnknown = false;
/** /**
* Override the page text * Override the page text
* @type {(page: number) => string} [pageText = (current: number) => string] * @type {(page: number) => string}
*/ */
export let pageText = (page) => `page ${page}`; export let pageText = (page) => `page ${page}`;
/** /**
* Override the page range text * Override the page range text
* @type {(current: number, total: number) => string} [pageRangeText = (current: number, total: number) => string] * @type {(current: number, total: number) => string}
*/ */
export let pageRangeText = (current, total) => export let pageRangeText = (current, total) =>
`of ${total} page${total === 1 ? "" : "s"}`; `of ${total} page${total === 1 ? "" : "s"}`;
/** /**
* Set an id for the top-level element * Set an id for the top-level element
* @type {string} [id] * @type {string}
*/ */
export let id = "ccs-" + Math.random().toString(36); export let id = "ccs-" + Math.random().toString(36);

View file

@ -1,2 +1,2 @@
export { default as Pagination } from "./Pagination.svelte"; export { default as Pagination } from "./Pagination.svelte";
export { default as PaginationSkeleton } from "./Pagination.Skeleton.svelte"; export { default as PaginationSkeleton } from "./PaginationSkeleton.svelte";

View file

@ -1,14 +1,8 @@
<script> <script>
/** /** Specify the current page index */
* Specify the current page index
* @type {number} [page=0]
*/
export let page = 0; export let page = 0;
/** /** Set to `true` to use the active state */
* Set to `true` to use the active state
* @type {boolean} [active=false]
*/
export let active = false; export let active = false;
</script> </script>

View file

@ -1,38 +1,20 @@
<script> <script>
/** /** Specify the current page index */
* Specify the current page index
* @type {number} [page=0]
*/
export let page = 0; export let page = 0;
/** /** Specify the total number of pages */
* Specify the total number of pages
* @type {number} [total=10]
*/
export let total = 10; export let total = 10;
/** /** Specify the total number of pages to show */
* Specify the total number of pages to show
* @type {number} [shown=10]
*/
export let shown = 10; export let shown = 10;
/** /** Set to `true` to loop the navigation */
* Set to `true` to loop the navigation
* @type {boolean} [loop=false]
*/
export let loop = false; export let loop = false;
/** /** Specify the forward button text */
* Specify the forward button text
* @type {string} [forwardText="Next page"]
*/
export let forwardText = "Next page"; export let forwardText = "Next page";
/** /** Specify the backward button text */
* Specify the backward button text
* @type {string} [backwardText="Next page"]
*/
export let backwardText = "Previous page"; export let backwardText = "Previous page";
import { afterUpdate, createEventDispatcher } from "svelte"; import { afterUpdate, createEventDispatcher } from "svelte";
@ -43,12 +25,6 @@
import { Button } from "../Button"; import { Button } from "../Button";
const dispatch = createEventDispatcher(); const dispatch = createEventDispatcher();
/**
* Minimum number of items to be shown
* @constant
* @type {4}
*/
const MIN = 4; const MIN = 4;
afterUpdate(() => { afterUpdate(() => {

View file

@ -1,14 +1,8 @@
<script> <script>
/** /** Specify the pivot start index */
* Specify the pivot start index
* @type {number} [fromIndex=0]
*/
export let fromIndex = 0; export let fromIndex = 0;
/** /** Specify the pivot end index */
* Specify the pivot end index
* @type {number} [count=0]
*/
export let count = 0; export let count = 0;
import { createEventDispatcher } from "svelte"; import { createEventDispatcher } from "svelte";

View file

@ -1,26 +1,14 @@
<script> <script>
/** /** Specify the current step index */
* Specify the current step index
* @type {number} [currentIndex=0]
*/
export let currentIndex = 0; export let currentIndex = 0;
/** /** Set to `true` to use the vertical variant */
* Set to `true` to use the vertical variant
* @type {boolean} [vertical=false]
*/
export let vertical = false; export let vertical = false;
/** /** Set to `true` to specify whether the progress steps should be split equally in size in the div */
* Set to `true` to specify whether the progress steps should be split equally in size in the div
* @type {boolean} [spaceEqually=false]
*/
export let spaceEqually = false; export let spaceEqually = false;
/** /** Set to `true` to prevent updating `currentIndex` */
* Set to `true` to prevent updating `currentIndex`
* @type {boolean} [preventChangeOnClick=false]
*/
export let preventChangeOnClick = false; export let preventChangeOnClick = false;
import { createEventDispatcher, setContext } from "svelte"; import { createEventDispatcher, setContext } from "svelte";

View file

@ -1,14 +1,8 @@
<script> <script>
/** /** Set to `true` to use the vertical variant */
* Set to `true` to use the vertical variant
* @type {boolean} [vertical=false]
*/
export let vertical = false; export let vertical = false;
/** /** Specify the number of steps to render */
* Specify the number of steps to render
* @type {number} [count=4]
*/
export let count = 4; export let count = 4;
</script> </script>

View file

@ -1,49 +1,28 @@
<script> <script>
/** /** Set to `true` for the complete variant */
* Set to `true` for the complete variant
* @type {boolean} [complete=false]
*/
export let complete = false; export let complete = false;
/** /** Set to `true` to use the current variant */
* Set to `true` to use the current variant
* @type {boolean} [current=false]
*/
export let current = false; export let current = false;
/** /** Set to `true` to disable the progress step */
* Set to `true` to disable the progress step
* @type {boolean} [disabled=false]
*/
export let disabled = false; export let disabled = false;
/** /** Set to `true` to indicate an invalid state */
* Set to `true` to indicate an invalid state
* @type {boolean} [invalid=false]
*/
export let invalid = false; export let invalid = false;
/** /** Specify the step description */
* Specify the step description
* @type {string} [descripton=""]
*/
export let description = ""; export let description = "";
/** /** Specify the step label */
* Specify the step label
* @type {string} [label=""]
*/
export let label = ""; export let label = "";
/** /** Specify the step secondary label */
* Specify the step secondary label
* @type {string} [secondaryLabel=""]
*/
export let secondaryLabel = ""; export let secondaryLabel = "";
/** /**
* Set an id for the top-level element * Set an id for the top-level element
* @type {string} [id] * @type {string}
*/ */
export let id = "ccs-" + Math.random().toString(36); export let id = "ccs-" + Math.random().toString(36);

View file

@ -1,3 +1,3 @@
export { default as ProgressIndicator } from "./ProgressIndicator.svelte"; export { default as ProgressIndicator } from "./ProgressIndicator.svelte";
export { default as ProgressIndicatorSkeleton } from "./ProgressIndicator.Skeleton.svelte"; export { default as ProgressIndicatorSkeleton } from "./ProgressIndicatorSkeleton.svelte";
export { default as ProgressStep } from "./ProgressStep.svelte"; export { default as ProgressStep } from "./ProgressStep.svelte";

View file

@ -1,55 +1,37 @@
<script> <script>
/** /** Specify the value of the radio button */
* Specify the value of the radio button
* @type {string} [value=""]
*/
export let value = ""; export let value = "";
/** /** Set to `true` to check the radio button */
* Set to `true` to check the radio button
* @type {boolean} [checked=false]
*/
export let checked = false; export let checked = false;
/** /** et to `true` to disable the radio button */
* Set to `true` to disable the radio button
* @type {boolean} [disabled=false]
*/
export let disabled = false; export let disabled = false;
/** /**
* Specify the label position * Specify the label position
* @type {"right" | "left"} [labelPosition="right"] * @type {"right" | "left"}
*/ */
export let labelPosition = "right"; export let labelPosition = "right";
/** /** Specify the label text */
* Specify the label text
* @type {string} [labelText=""]
*/
export let labelText = ""; export let labelText = "";
/** /** Set to `true` to visually hide the label text */
* Set to `true` to visually hide the label text
* @type {boolean} [hideLabel=false]
*/
export let hideLabel = false; export let hideLabel = false;
/** /**
* Set an id for the input element * Set an id for the input element
* @type {string} [id] * @type {string}
*/ */
export let id = "ccs-" + Math.random().toString(36); export let id = "ccs-" + Math.random().toString(36);
/** /** Specify a name attribute for the checkbox input */
* Specify a name attribute for the checkbox input
* @type {string} [name=""]
*/
export let name = ""; export let name = "";
/** /**
* Obtain a reference to the input HTML element * Obtain a reference to the input HTML element
* @type {null | HTMLInputElement} [ref=null] * @type {null | HTMLInputElement}
*/ */
export let ref = null; export let ref = null;

View file

@ -1,2 +1,2 @@
export { default as RadioButton } from "./RadioButton.svelte"; export { default as RadioButton } from "./RadioButton.svelte";
export { default as RadioButtonSkeleton } from "./RadioButton.Skeleton.svelte"; export { default as RadioButtonSkeleton } from "./RadioButtonSkeleton.svelte";

View file

@ -1,33 +1,30 @@
<script> <script>
/** /**
* Set the selected radio button value * Set the selected radio button value
* @type {string} [selected] * @type {string}
*/ */
export let selected = undefined; export let selected = undefined;
/** /** Set to `true` to disable the radio buttons */
* Set to `true` to disable the radio buttons
* @type {boolean} [disabled=false]
*/
export let disabled = false; export let disabled = false;
/** /**
* Specify the label position * Specify the label position
* @type {"right" | "left"} [labelPosition="right"] * @type {"right" | "left"}
*/ */
export let labelPosition = "right"; export let labelPosition = "right";
/** /**
* Specify the orientation of the radio buttons * Specify the orientation of the radio buttons
* @type {"horizontal" | "vertical"} [orientation="horizontal"] * @type {"horizontal" | "vertical"}
*/ */
export let orientation = "horizontal"; export let orientation = "horizontal";
/** /**
* Set an id for the container div element * Set an id for the container div element
* @type {string} [id] * @type {string}
*/ */
export let id; export let id = undefined;
import { createEventDispatcher, setContext } from "svelte"; import { createEventDispatcher, setContext } from "svelte";
import { writable } from "svelte/store"; import { writable } from "svelte/store";

View file

@ -50,37 +50,28 @@
/** /**
* Specify the `autocomplete` attribute * Specify the `autocomplete` attribute
* @type {"on" | "off"} [autocomplete="off"] * @type {"on" | "off"}
*/ */
export let autocomplete = "off"; export let autocomplete = "off";
/** /** Set to `true` to auto focus the search element */
* Set to `true` to auto focus the search element
* @type {boolean} [autofocus=false]
*/
export let autofocus = false; export let autofocus = false;
/** /** Specify the close button label text */
* Specify the close button label text
* @type {string} [closeButtonLabelText="Clear search input"]
*/
export let closeButtonLabelText = "Clear search input"; export let closeButtonLabelText = "Clear search input";
/** /** Specify the label text */
* Specify the label text
* @type {string} [labelText=""]
*/
export let labelText = ""; export let labelText = "";
/** /**
* Set an id for the input element * Set an id for the input element
* @type {string} [id] * @type {string}
*/ */
export let id = "ccs-" + Math.random().toString(36); export let id = "ccs-" + Math.random().toString(36);
/** /**
* Obtain a reference to the input HTML element * Obtain a reference to the input HTML element
* @type {null | HTMLInputElement} [ref=null] * @type {null | HTMLInputElement}
*/ */
export let ref = null; export let ref = null;
@ -88,7 +79,7 @@
import Close16 from "carbon-icons-svelte/lib/Close16"; import Close16 from "carbon-icons-svelte/lib/Close16";
import Close20 from "carbon-icons-svelte/lib/Close20"; import Close20 from "carbon-icons-svelte/lib/Close20";
import Search16 from "carbon-icons-svelte/lib/Search16"; import Search16 from "carbon-icons-svelte/lib/Search16";
import SearchSkeleton from "./Search.Skeleton.svelte"; import SearchSkeleton from "./SearchSkeleton.svelte";
const dispatch = createEventDispatcher(); const dispatch = createEventDispatcher();
</script> </script>

View file

@ -2,13 +2,12 @@
/** /**
* @deprecated this prop will be removed in the next major release * @deprecated this prop will be removed in the next major release
* Set to `true` to use the small variant * Set to `true` to use the small variant
* @type {boolean} [small=false]
*/ */
export let small = false; export let small = false;
/** /**
* Specify the size of the search input * Specify the size of the search input
* @type {"sm" | "lg" | "xl"} [size="xl"] * @type {"sm" | "lg" | "xl"}
*/ */
export let size = "xl"; export let size = "xl";
</script> </script>

View file

@ -1,2 +1,2 @@
export { default as Search } from "./Search.svelte"; export { default as Search } from "./Search.svelte";
export { default as SearchSkeleton } from "./Search.Skeleton.svelte"; export { default as SearchSkeleton } from "./SearchSkeleton.svelte";

View file

@ -1,85 +1,55 @@
<script> <script>
/** /** Specify the selected item value */
* Specify the selected item value
* @type {string} [selected]
*/
export let selected = undefined; export let selected = undefined;
/** /**
* Set the size of the select input * Set the size of the select input
* @type {"sm" | "xl"} [size] * @type {"sm" | "xl"}
*/ */
export let size = undefined; export let size = undefined;
/** /** Set to `true` to use the inline variant */
* Set to `true` to use the inline variant
* @type {boolean} [inline=false]
*/
export let inline = false; export let inline = false;
/** /** Set to `true` to enable the light variant */
* Set to `true` to enable the light variant
* @type {boolean} [light=false]
*/
export let light = false; export let light = false;
/** /** Set to `true` to disable the select element */
* Set to `true` to disable the select element
* @type {boolean} [disabled=false]
*/
export let disabled = false; export let disabled = false;
/** /**
* Set an id for the select element * Set an id for the select element
* @type {string} [id] * @type {string}
*/ */
export let id = "ccs-" + Math.random().toString(36); export let id = "ccs-" + Math.random().toString(36);
/** /**
* Specify a name attribute for the select element * Specify a name attribute for the select element
* @type {string} [name] * @type {string}
*/ */
export let name = undefined; export let name = undefined;
/** /** Set to `true` to indicate an invalid state */
* Set to `true` to indicate an invalid state
* @type {boolean} [invalid=false]
*/
export let invalid = false; export let invalid = false;
/** /** Specify the invalid state text */
* Specify the invalid state text
* @type {string} [invalidText=""]
*/
export let invalidText = ""; export let invalidText = "";
/** /** Specify the helper text */
* Specify the helper text
* @type {string} [helperText=""]
*/
export let helperText = ""; export let helperText = "";
/** /** Set to `true` to not render a label */
* Set to `true` to not render a label
* @type {boolean} [noLabel=false]
*/
export let noLabel = false; export let noLabel = false;
/** /** Specify the label text */
* Specify the label text
* @type {string} [labelText=""]
*/
export let labelText = ""; export let labelText = "";
/** /** Set to `true` to visually hide the label text */
* Set to `true` to visually hide the label text
* @type {boolean} [hideLabel=false]
*/
export let hideLabel = false; export let hideLabel = false;
/** /**
* Obtain a reference to the select HTML element * Obtain a reference to the select HTML element
* @type {null | HTMLSelectElement} [ref=null] * @type {null | HTMLSelectElement}
*/ */
export let ref = null; export let ref = null;

Some files were not shown because too many files have changed in this diff Show more