Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/Button/Button.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script>
/**
* @generics {Icon = any} Icon
* @extends {"./ButtonSkeleton.svelte"} ButtonSkeletonProps
* @restProps {button | a | div}
* @slot {{ props: { role: "button"; type?: string; tabindex: any; disabled: boolean; href?: string; class: string; [key: string]: any; } }}
Expand Down Expand Up @@ -30,15 +31,15 @@
* Specify the icon to render.
* Alternatively, use the named slot "icon".
*
* @type {any}
* @type {Icon}
* @example
* ```svelte
* <Button>
* <Icon slot="icon" size={20} />
* </Button>
* ```
*/
export let icon = undefined;
export let icon = /** @type {Icon} */ (undefined);

/**
* Specify the ARIA label for the button icon.
Expand Down
5 changes: 3 additions & 2 deletions src/ComposedModal/ModalFooter.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script>
/**
* @generics {Icon = any} Icon
* @event click:button--secondary
* @property {string} text
*/
Expand All @@ -9,9 +10,9 @@

/**
* Specify the primary button icon.
* @type {any}
* @type {Icon}
*/
export let primaryButtonIcon = undefined;
export let primaryButtonIcon = /** @type {Icon} */ (undefined);

/** Set to `true` to disable the primary button */
export let primaryButtonDisabled = false;
Expand Down
8 changes: 6 additions & 2 deletions src/ContainedList/ContainedListItem.svelte
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<script>
/**
* @generics {Icon = any} Icon
*/

/** Set to `true` to render a `button` element instead of a `div` */
export let interactive = false;

Expand All @@ -8,9 +12,9 @@
/**
* Specify the icon to render.
* Icon is rendered to the left of the item content.
* @type {any}
* @type {Icon}
*/
export let icon = undefined;
export let icon = /** @type {Icon} */ (undefined);

$: tag = interactive ? "button" : "div";
$: props = {
Expand Down
8 changes: 6 additions & 2 deletions src/ContextMenu/ContextMenuOption.svelte
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<script>
/**
* @generics {Icon = any} Icon
*/

/**
* Specify the kind of option.
* @type {"default" | "danger"}
Expand All @@ -14,9 +18,9 @@
/**
* Specify the icon to render.
* Icon is rendered to the left of the label text.
* @type {any}
* @type {Icon}
*/
export let icon = undefined;
export let icon = /** @type {Icon} */ (undefined);

/**
* Specify the label text.
Expand Down
5 changes: 3 additions & 2 deletions src/FileUploader/FileUploaderButton.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script>
/**
* @generics {Icon = any} Icon
* @event {ReadonlyArray<File>} change
*/

Expand Down Expand Up @@ -50,9 +51,9 @@

/**
* Specify the icon to render.
* @type {any}
* @type {Icon}
*/
export let icon = undefined;
export let icon = /** @type {Icon} */ (undefined);

/**
* Specify the ARIA label for the button icon.
Expand Down
8 changes: 6 additions & 2 deletions src/Link/Link.svelte
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<script>
/**
* @generics {Icon = any} Icon
*/

/**
* Specify the size of the link.
* @type {"sm" | "lg"}
Expand All @@ -17,9 +21,9 @@
/**
* Specify the icon to render.
* `inline` must be `false`.
* @type {any}
* @type {Icon}
*/
export let icon = undefined;
export let icon = /** @type {Icon} */ (undefined);

/** Set to `true` to disable the checkbox */
export let disabled = false;
Expand Down
5 changes: 3 additions & 2 deletions src/Modal/Modal.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script>
/**
* @generics {Icon = any} Icon
* @event close
* @type {object}
* @property {"escape-key" | "outside-click" | "close-button"} trigger
Expand Down Expand Up @@ -71,9 +72,9 @@

/**
* Specify the primary button icon.
* @type {any}
* @type {Icon}
*/
export let primaryButtonIcon = undefined;
export let primaryButtonIcon = /** @type {Icon} */ (undefined);

/**
* Set to `true` for the "submit" and "click:button--primary" events
Expand Down
8 changes: 6 additions & 2 deletions src/Notification/NotificationButton.svelte
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<script>
/**
* @generics {Icon = any} Icon
*/

/**
* Set the type of notification.
* @type {"toast" | "inline"}
Expand All @@ -7,9 +11,9 @@

/**
* Specify the icon to render.
* @type {any}
* @type {Icon}
*/
export let icon = Close;
export let icon = /** @type {Icon} */ (Close);

/**
* Specify the title of the icon.
Expand Down
5 changes: 3 additions & 2 deletions src/OverflowMenu/OverflowMenu.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script>
/**
* @generics {Icon = any} Icon
* @event close
* @property {number} [index]
* @property {string} [text]
Expand Down Expand Up @@ -34,9 +35,9 @@

/**
* Specify the icon to render.
* @type {any}
* @type {Icon}
*/
export let icon = OverflowMenuVertical;
export let icon = /** @type {Icon} */ (OverflowMenuVertical);

/**
* Specify the icon class.
Expand Down
6 changes: 3 additions & 3 deletions src/Search/Search.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script>
/**
* @generics {T = any} T
* @generics {T = any, Icon = any} T,Icon
* @event {null} expand
* @event {null} collapse
* @restProps {input}
Expand Down Expand Up @@ -56,9 +56,9 @@

/**
* Specify the icon to render.
* @type {any}
* @type {Icon}
*/
export let icon = IconSearch;
export let icon = /** @type {Icon} */ (IconSearch);

/** Set an id for the input element */
export let id = `ccs-${Math.random().toString(36)}`;
Expand Down
8 changes: 6 additions & 2 deletions src/Tabs/Tab.svelte
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<script>
/**
* @generics {Icon = any} Icon
*/

/**
* Specify the tab label.
* Alternatively, use the default slot.
Expand Down Expand Up @@ -33,9 +37,9 @@
/**
* Specify the icon to render.
* Icon is rendered to the right of the label.
* @type {any}
* @type {Icon}
*/
export let icon = undefined;
export let icon = /** @type {Icon} */ (undefined);

/** Obtain a reference to the anchor HTML element */
export let ref = null;
Expand Down
9 changes: 6 additions & 3 deletions src/Tag/Tag.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<script>
/** @restProps {div | span} */
/**
* @generics {Icon = any} Icon
* @restProps {div | span}
*/

/**
* Specify the type of tag.
Expand Down Expand Up @@ -27,9 +30,9 @@

/**
* Specify the icon to render.
* @type {any}
* @type {Icon}
*/
export let icon = undefined;
export let icon = /** @type {Icon} */ (undefined);

/** Set an id for the filterable tag */
export let id = `ccs-${Math.random().toString(36)}`;
Expand Down
5 changes: 3 additions & 2 deletions src/Tooltip/Tooltip.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script>
/**
* @generics {Icon = any} Icon
* @event {null} open
* @event {null} close
*/
Expand Down Expand Up @@ -31,9 +32,9 @@
/**
* Specify the icon to render for the tooltip button.
* Defaults to `<Information />`.
* @type {any}
* @type {Icon}
*/
export let icon = Information;
export let icon = /** @type {Icon} */ (Information);

/** Specify the ARIA label for the tooltip button */
export let iconDescription = "";
Expand Down
8 changes: 6 additions & 2 deletions src/TooltipIcon/TooltipIcon.svelte
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<script>
/**
* @generics {Icon = any} Icon
*/

/**
* Specify the tooltip text.
* Alternatively, use the "tooltipText" slot.
Expand All @@ -7,9 +11,9 @@

/**
* Specify the icon to render.
* @type {any}
* @type {Icon}
*/
export let icon = undefined;
export let icon = /** @type {Icon} */ (undefined);

/**
* Specify the icon size.
Expand Down
6 changes: 3 additions & 3 deletions src/TreeView/TreeViewNode.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@

<script>
/**
* @generics {Node extends TreeNode<any> = TreeNode<any>} Node
* @generics {Node extends TreeNode<any> = TreeNode<any>, Icon = any} Node,Icon
* @template {TreeNode<any>} Node
* @typedef {import('./TreeView.svelte').TreeNode<Id>} TreeNode<Id=(string|number)>
* @slot {{ node: Node & { expanded: false; leaf: boolean; selected: boolean; } }}
Expand All @@ -69,9 +69,9 @@

/**
* Specify the icon to render.
* @type {any}
* @type {Icon}
*/
export let icon = undefined;
export let icon = /** @type {Icon} */ (undefined);

import { afterUpdate, getContext } from "svelte";

Expand Down
6 changes: 3 additions & 3 deletions src/TreeView/TreeViewNodeList.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script>
/**
* @generics {Id = (string|number)} Id
* @generics {Id = (string|number), Icon = any} Id,Icon
* @template {string | number} Id
* @typedef {{ id: Id; text: string; disabled?: boolean; expanded?: boolean; }} TreeNode<Id>
* @slot {{ node: TreeNode<Id> & { expanded: boolean; leaf: boolean; selected: boolean; } }}
Expand All @@ -17,9 +17,9 @@

/**
* Specify the icon to render.
* @type {any}
* @type {Icon}
*/
export let icon = undefined;
export let icon = /** @type {Icon} */ (undefined);

import { afterUpdate, getContext } from "svelte";
import CaretDown from "../icons/CaretDown.svelte";
Expand Down
12 changes: 8 additions & 4 deletions src/UIShell/HamburgerMenu.svelte
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<script>
/**
* @generics {Icon = any} Icon
*/

/**
* Specify the ARIA label for the button.
* @type {string}
Expand All @@ -10,15 +14,15 @@

/**
* Specify the icon to render for the closed state.
* @type {any}
* @type {Icon}
*/
export let iconMenu = Menu;
export let iconMenu = /** @type {Icon} */ (Menu);

/**
* Specify the icon to render for the opened state.
* @type {any}
* @type {Icon}
*/
export let iconClose = Close;
export let iconClose = /** @type {Icon} */ (Close);

/** Obtain a reference to the HTML button element */
export let ref = null;
Expand Down
12 changes: 8 additions & 4 deletions src/UIShell/Header.svelte
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<script>
/**
* @generics {Icon = any} Icon
*/

/** Set to `false` to hide the side nav by default */
export let expandedByDefault = true;

Expand Down Expand Up @@ -62,15 +66,15 @@

/**
* Specify the icon to render for the closed state.
* @type {any}
* @type {Icon}
*/
export let iconMenu = Menu;
export let iconMenu = /** @type {Icon} */ (Menu);

/**
* Specify the icon to render for the opened state.
* @type {any}
* @type {Icon}
*/
export let iconClose = Close;
export let iconClose = /** @type {Icon} */ (Close);

/**
* Specify the ARIA label for the hamburger menu.
Expand Down
Loading
Loading