From f30755b23760d9da7ee49a52c48d4695432f5c46 Mon Sep 17 00:00:00 2001 From: Eric Liu Date: Sun, 26 Jul 2020 17:42:12 -0700 Subject: [PATCH] chore: complete first pass of apply jsdoc annotations to component props --- src/Accordion/AccordionItem.svelte | 2 +- src/Breadcrumb/Breadcrumb.Skeleton.svelte | 4 +- src/Breadcrumb/Breadcrumb.svelte | 2 +- src/Breadcrumb/BreadcrumbItem.svelte | 2 +- src/Button/Button.stories.js | 1 + src/Button/Button.svelte | 82 +++++++++- src/Checkbox/Checkbox.svelte | 2 +- src/CodeSnippet/CodeSnippet.Skeleton.svelte | 6 +- src/CodeSnippet/CodeSnippet.svelte | 39 ++++- src/ComboBox/ComboBox.svelte | 105 ++++++++++-- src/ComposedModal/ComposedModal.svelte | 4 +- src/ComposedModal/ModalBody.svelte | 9 ++ src/ComposedModal/ModalFooter.svelte | 33 +++- src/ComposedModal/ModalHeader.svelte | 34 ++++ src/ContentSwitcher/Switch.svelte | 2 +- src/Copy/Copy.svelte | 2 +- src/DataTable/DataTable.svelte | 39 ++++- src/DataTable/Table.svelte | 31 +++- src/DataTable/TableContainer.svelte | 16 +- src/DataTable/TableHeader.svelte | 9 ++ src/DataTable/TableRow.svelte | 4 + src/DatePicker/DatePicker.svelte | 55 +++++-- src/DatePicker/DatePickerInput.svelte | 9 +- src/Dropdown/Dropdown.svelte | 84 +++++++++- src/FileUploader/FileUploader.svelte | 75 ++++++++- src/FileUploader/FileUploaderButton.svelte | 51 +++++- .../FileUploaderDropContainer.svelte | 53 ++++++- src/FileUploader/FileUploaderItem.svelte | 37 ++++- src/FileUploader/Filename.svelte | 4 +- src/Grid/Column.svelte | 40 ++++- src/Grid/Grid.svelte | 35 ++++ src/Grid/Row.svelte | 30 ++++ src/Icon/Icon.svelte | 2 +- src/InlineLoading/InlineLoading.svelte | 2 +- src/Link/Link.svelte | 2 +- src/ListBox/ListBox.svelte | 4 +- src/ListBox/ListBoxField.svelte | 29 ++++ src/ListBox/ListBoxMenuIcon.svelte | 25 ++- src/ListBox/ListBoxMenuItem.svelte | 9 ++ src/ListBox/ListBoxSelection.svelte | 28 +++- src/Modal/Modal.svelte | 61 ++++++- src/MultiSelect/MultiSelect.svelte | 150 +++++++++++++++--- src/Notification/InlineNotification.svelte | 42 ++++- src/Notification/NotificationButton.svelte | 19 ++- src/Notification/NotificationIcon.svelte | 10 +- .../NotificationTextDetails.svelte | 25 ++- src/Notification/ToastNotification.svelte | 59 ++++++- src/NumberInput/NumberInput.svelte | 108 +++++++++++-- src/OverflowMenu/OverflowMenu.svelte | 33 +++- src/OverflowMenu/OverflowMenuItem.svelte | 52 +++++- src/Pagination/Pagination.svelte | 79 ++++++++- src/PaginationNav/PaginationItem.svelte | 9 ++ src/PaginationNav/PaginationNav.svelte | 37 ++++- src/PaginationNav/PaginationOverflow.svelte | 9 ++ .../ProgressIndicator.Skeleton.svelte | 3 + .../ProgressIndicator.svelte | 22 ++- src/ProgressIndicator/ProgressStep.svelte | 29 ++++ src/RadioButton/RadioButton.svelte | 40 ++++- src/RadioButtonGroup/RadioButtonGroup.svelte | 27 +++- src/Search/Search.svelte | 78 ++++++--- src/Select/Select.Skeleton.svelte | 4 + src/Select/Select.svelte | 36 ++++- src/Select/SelectItem.svelte | 2 +- src/Select/SelectItemGroup.svelte | 9 ++ src/SkeletonText/SkeletonText.svelte | 9 +- src/Slider/Slider.svelte | 10 ++ .../StructuredList.Skeleton.svelte | 11 +- src/StructuredList/StructuredList.svelte | 14 ++ src/StructuredList/StructuredListCell.svelte | 9 ++ src/StructuredList/StructuredListInput.svelte | 24 +++ src/StructuredList/StructuredListRow.svelte | 14 ++ src/Tabs/Tabs.svelte | 16 +- src/TextArea/TextArea.svelte | 41 ++++- src/TextInput/PasswordInput.svelte | 92 +++++++++-- src/TextInput/TextInput.svelte | 44 ++++- src/Tile/ExpandableTile.svelte | 30 ++++ src/Tile/RadioTile.svelte | 20 +++ src/Tile/SelectableTile.svelte | 30 ++++ src/Tile/TileGroup.svelte | 18 ++- src/TimePicker/TimePicker.svelte | 66 +++++++- src/TimePicker/TimePickerSelect.svelte | 39 ++++- src/Tooltip/Tooltip.svelte | 6 +- .../TooltipDefinition.svelte | 4 +- src/TooltipIcon/TooltipIcon.svelte | 4 +- src/UIShell/Content.svelte | 4 +- src/UIShell/GlobalHeader/Header.svelte | 26 ++- .../GlobalHeader/HeaderActionSearch.svelte | 8 +- src/UIShell/GlobalHeader/HeaderNav.svelte | 4 + src/UIShell/GlobalHeader/HeaderNavItem.svelte | 9 ++ src/UIShell/GlobalHeader/HeaderNavMenu.svelte | 19 +++ .../GlobalHeader/HeaderPanelLink.svelte | 4 + src/UIShell/SideNav/HamburgerMenu.svelte | 9 ++ src/UIShell/SideNav/SideNav.svelte | 11 +- src/UIShell/SideNav/SideNavLink.svelte | 21 ++- src/UIShell/SideNav/SideNavMenu.svelte | 14 ++ src/UIShell/SideNav/SideNavMenuItem.svelte | 2 +- src/UIShell/SkipToContent.svelte | 9 ++ 97 files changed, 2327 insertions(+), 259 deletions(-) diff --git a/src/Accordion/AccordionItem.svelte b/src/Accordion/AccordionItem.svelte index ce1dbc0c..14577f8e 100644 --- a/src/Accordion/AccordionItem.svelte +++ b/src/Accordion/AccordionItem.svelte @@ -13,7 +13,7 @@ export let open = false; /** - * Define 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"; diff --git a/src/Breadcrumb/Breadcrumb.Skeleton.svelte b/src/Breadcrumb/Breadcrumb.Skeleton.svelte index ba7c2d72..a4ec13d7 100644 --- a/src/Breadcrumb/Breadcrumb.Skeleton.svelte +++ b/src/Breadcrumb/Breadcrumb.Skeleton.svelte @@ -1,12 +1,12 @@
+ /** + * @typedef {{ id: string; text: string; }} ComboBoxItem + */ + + /** + * Set the combobox items + * @type {ComboBoxItem[]} [items=[]] + */ + export let items = []; + + /** + * Override the display of a combobox item + * @type {(item: ComboBoxItem) => string;} [itemToString = (item: ComboBoxItem) => string;] + */ + export let itemToString = (item) => item.text || item.id; + + /** + * Set the selected item by value index + * @type {number} [selectedIndex=-1] + */ + export let selectedIndex = -1; + + /** + * Specify the selected combobox value + * @type {string} [value=""] + */ + export let value = ""; + + /** + * Set the size of the combobox + * @type {"sm" | "xl"} [size] + */ + export let size = undefined; + + /** + * Set to `true` to disable the combobox + * @type {boolean} [disabled=false] + */ export let disabled = false; + + /** + * Specify the title text of the combobox + * @type {string} [titleText=""] + */ + export let titleText = ""; + + /** + * Specify the placeholder text + * @type {string} [placeholder=""] + */ + export let placeholder = ""; + + /** + * Specify the helper text + * @type {string} [helperText=""] + */ export let helperText = ""; /** - * Set an id for the list box component - * @type {string} [id] + * Specify the invalid state text + * @type {string} [invalidText=""] */ - export let id = "ccs-" + Math.random().toString(36); + export let invalidText = ""; /** * Set to `true` to indicate an invalid state @@ -15,23 +70,45 @@ export let invalid = false; /** - * Specify the invalid state text - * @type {string} [invalidText=""] + * Set to `true` to enable the light variant + * @type {boolean} [light=false] */ - export let invalidText = ""; - - export let items = []; - export let itemToString = (item) => item.text || item.id; export let light = false; + + /** + * Set to `true` to open the combobox menu dropdown + * @type {boolean} [open=false] + */ export let open = false; - export let placeholder = ""; - export let selectedIndex = -1; + + /** + * Determine if an item should be filtered given the current combobox value + * @type {(item: ComboBoxItem, value: string) => boolean} [shouldFilterItem=() => true] + */ export let shouldFilterItem = () => true; - export let size = undefined; - export let titleText = ""; + + /** + * Override the default translation ids + * @type {(id: any) => string;} [translateWithId] + */ export let translateWithId = undefined; - export let value = ""; + + /** + * Set an id for the list box component + * @type {string} [id] + */ + export let id = "ccs-" + Math.random().toString(36); + + /** + * Specify a name attribute for the input + * @type {string} [name] + */ export let name = undefined; + + /** + * Obtain a reference to the input HTML element + * @type {null | HTMLInputElement} [ref=null] + */ export let ref = null; import { afterUpdate } from "svelte"; diff --git a/src/ComposedModal/ComposedModal.svelte b/src/ComposedModal/ComposedModal.svelte index 58c813f5..cb168262 100644 --- a/src/ComposedModal/ComposedModal.svelte +++ b/src/ComposedModal/ComposedModal.svelte @@ -18,13 +18,13 @@ export let danger = false; /** - * Define a class for the inner modal + * Specify a class for the inner modal * @type {string} [containerClass=""] */ export let containerClass = ""; /** - * Define 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]"; diff --git a/src/ComposedModal/ModalBody.svelte b/src/ComposedModal/ModalBody.svelte index d47c3eb9..76af8328 100644 --- a/src/ComposedModal/ModalBody.svelte +++ b/src/ComposedModal/ModalBody.svelte @@ -1,5 +1,14 @@ diff --git a/src/ComposedModal/ModalFooter.svelte b/src/ComposedModal/ModalFooter.svelte index f4a4ea95..d59b74ac 100644 --- a/src/ComposedModal/ModalFooter.svelte +++ b/src/ComposedModal/ModalFooter.svelte @@ -1,9 +1,38 @@ diff --git a/src/DataTable/TableContainer.svelte b/src/DataTable/TableContainer.svelte index 60b6d6af..0eb474ec 100644 --- a/src/DataTable/TableContainer.svelte +++ b/src/DataTable/TableContainer.svelte @@ -1,7 +1,21 @@
+ /** + * Specify the `scope` attribute + * @type {string} [scope="col"] + */ export let scope = "col"; + + /** + * Override the default id translations + * @type {() => string;} [translateWithId = () => "";] + */ export let translateWithId = () => ""; /** diff --git a/src/DataTable/TableRow.svelte b/src/DataTable/TableRow.svelte index 7a43dd1a..bad9aebd 100644 --- a/src/DataTable/TableRow.svelte +++ b/src/DataTable/TableRow.svelte @@ -1,4 +1,8 @@ diff --git a/src/FileUploader/FileUploaderDropContainer.svelte b/src/FileUploader/FileUploaderDropContainer.svelte index 21573cb5..9a21738b 100644 --- a/src/FileUploader/FileUploaderDropContainer.svelte +++ b/src/FileUploader/FileUploaderDropContainer.svelte @@ -1,10 +1,49 @@ diff --git a/src/ListBox/ListBox.svelte b/src/ListBox/ListBox.svelte index a90b32a9..abeef665 100644 --- a/src/ListBox/ListBox.svelte +++ b/src/ListBox/ListBox.svelte @@ -1,12 +1,12 @@ diff --git a/src/ListBox/ListBoxSelection.svelte b/src/ListBox/ListBoxSelection.svelte index 27e1a9a9..05961442 100644 --- a/src/ListBox/ListBoxSelection.svelte +++ b/src/ListBox/ListBoxSelection.svelte @@ -1,10 +1,34 @@