mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-14 18:01:06 +00:00
refactor(types): shorten ref, id JSDocs, use CarbonIcon type, export component props
This commit is contained in:
parent
d38e6d8be6
commit
75d4b4cf03
219 changed files with 5168 additions and 5259 deletions
39
types/Tile/ClickableTile.d.ts
vendored
39
types/Tile/ClickableTile.d.ts
vendored
|
@ -1,25 +1,26 @@
|
|||
/// <reference types="svelte" />
|
||||
|
||||
export interface ClickableTileProps extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["a"]> {
|
||||
/**
|
||||
* Set to `true` to click the tile
|
||||
* @default false
|
||||
*/
|
||||
clicked?: boolean;
|
||||
|
||||
/**
|
||||
* Set to `true` to enable the light variant
|
||||
* @default false
|
||||
*/
|
||||
light?: boolean;
|
||||
|
||||
/**
|
||||
* Set the `href`
|
||||
*/
|
||||
href?: string;
|
||||
}
|
||||
|
||||
export default class ClickableTile {
|
||||
$$prop_def: svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["a"]> & {
|
||||
/**
|
||||
* Set to `true` to click the tile
|
||||
* @default false
|
||||
*/
|
||||
clicked?: boolean;
|
||||
|
||||
/**
|
||||
* Set to `true` to enable the light variant
|
||||
* @default false
|
||||
*/
|
||||
light?: boolean;
|
||||
|
||||
/**
|
||||
* Set the `href`
|
||||
*/
|
||||
href?: string;
|
||||
};
|
||||
|
||||
$$prop_def: ClickableTileProps;
|
||||
$$slot_def: {
|
||||
default: {};
|
||||
};
|
||||
|
|
112
types/Tile/ExpandableTile.d.ts
vendored
112
types/Tile/ExpandableTile.d.ts
vendored
|
@ -1,61 +1,63 @@
|
|||
/// <reference types="svelte" />
|
||||
|
||||
export interface ExpandableTileProps extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["div"]> {
|
||||
/**
|
||||
* Set to `true` to expand the tile
|
||||
* @default false
|
||||
*/
|
||||
expanded?: boolean;
|
||||
|
||||
/**
|
||||
* Set to `true` to enable the light variant
|
||||
* @default false
|
||||
*/
|
||||
light?: boolean;
|
||||
|
||||
/**
|
||||
* Specify the max height of the tile (number of pixels)
|
||||
* @default 0
|
||||
*/
|
||||
tileMaxHeight?: number;
|
||||
|
||||
/**
|
||||
* Specify the padding of the tile (number of pixels)
|
||||
* @default 0
|
||||
*/
|
||||
tilePadding?: number;
|
||||
|
||||
/**
|
||||
* Specify the icon text of the collapsed tile
|
||||
* @default "Interact to expand Tile"
|
||||
*/
|
||||
tileCollapsedIconText?: string;
|
||||
|
||||
/**
|
||||
* Specify the icon text of the expanded tile
|
||||
* @default "Interact to collapse Tile"
|
||||
*/
|
||||
tileExpandedIconText?: string;
|
||||
|
||||
/**
|
||||
* Specify the tabindex
|
||||
* @default "0"
|
||||
*/
|
||||
tabindex?: string;
|
||||
|
||||
/**
|
||||
* Set an id for the top-level div element
|
||||
* @default "ccs-" + Math.random().toString(36)
|
||||
*/
|
||||
id?: string;
|
||||
|
||||
/**
|
||||
* Obtain a reference to the top-level element
|
||||
* @default null
|
||||
*/
|
||||
ref?: null | HTMLDivElement;
|
||||
}
|
||||
|
||||
export default class ExpandableTile {
|
||||
$$prop_def: svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["div"]> & {
|
||||
/**
|
||||
* Set to `true` to expand the tile
|
||||
* @default false
|
||||
*/
|
||||
expanded?: boolean;
|
||||
|
||||
/**
|
||||
* Set to `true` to enable the light variant
|
||||
* @default false
|
||||
*/
|
||||
light?: boolean;
|
||||
|
||||
/**
|
||||
* Specify the max height of the tile (number of pixels)
|
||||
* @default 0
|
||||
*/
|
||||
tileMaxHeight?: number;
|
||||
|
||||
/**
|
||||
* Specify the padding of the tile (number of pixels)
|
||||
* @default 0
|
||||
*/
|
||||
tilePadding?: number;
|
||||
|
||||
/**
|
||||
* Specify the icon text of the collapsed tile
|
||||
* @default "Interact to expand Tile"
|
||||
*/
|
||||
tileCollapsedIconText?: string;
|
||||
|
||||
/**
|
||||
* Specify the icon text of the expanded tile
|
||||
* @default "Interact to collapse Tile"
|
||||
*/
|
||||
tileExpandedIconText?: string;
|
||||
|
||||
/**
|
||||
* Specify the tabindex
|
||||
* @default "0"
|
||||
*/
|
||||
tabindex?: string;
|
||||
|
||||
/**
|
||||
* Set an id for the top-level div element
|
||||
*/
|
||||
id?: string;
|
||||
|
||||
/**
|
||||
* Obtain a reference to the top-level element
|
||||
* @default null
|
||||
*/
|
||||
ref?: null | HTMLDivElement;
|
||||
};
|
||||
|
||||
$$prop_def: ExpandableTileProps;
|
||||
$$slot_def: {
|
||||
above: {};
|
||||
below: {};
|
||||
|
|
88
types/Tile/RadioTile.d.ts
vendored
88
types/Tile/RadioTile.d.ts
vendored
|
@ -1,49 +1,51 @@
|
|||
/// <reference types="svelte" />
|
||||
|
||||
export interface RadioTileProps extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["label"]> {
|
||||
/**
|
||||
* Set to `true` to check the tile
|
||||
* @default false
|
||||
*/
|
||||
checked?: boolean;
|
||||
|
||||
/**
|
||||
* Set to `true` to enable the light variant
|
||||
* @default false
|
||||
*/
|
||||
light?: boolean;
|
||||
|
||||
/**
|
||||
* Specify the value of the radio input
|
||||
* @default ""
|
||||
*/
|
||||
value?: string;
|
||||
|
||||
/**
|
||||
* Specify the tabindex
|
||||
* @default "0"
|
||||
*/
|
||||
tabindex?: string;
|
||||
|
||||
/**
|
||||
* Specify the ARIA label for the radio tile checkmark icon
|
||||
* @default "Tile checkmark"
|
||||
*/
|
||||
iconDescription?: string;
|
||||
|
||||
/**
|
||||
* Set an id for the input element
|
||||
* @default "ccs-" + Math.random().toString(36)
|
||||
*/
|
||||
id?: string;
|
||||
|
||||
/**
|
||||
* Specify a name attribute for the input
|
||||
* @default ""
|
||||
*/
|
||||
name?: string;
|
||||
}
|
||||
|
||||
export default class RadioTile {
|
||||
$$prop_def: svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["label"]> & {
|
||||
/**
|
||||
* Set to `true` to check the tile
|
||||
* @default false
|
||||
*/
|
||||
checked?: boolean;
|
||||
|
||||
/**
|
||||
* Set to `true` to enable the light variant
|
||||
* @default false
|
||||
*/
|
||||
light?: boolean;
|
||||
|
||||
/**
|
||||
* Specify the value of the radio input
|
||||
* @default ""
|
||||
*/
|
||||
value?: string;
|
||||
|
||||
/**
|
||||
* Specify the tabindex
|
||||
* @default "0"
|
||||
*/
|
||||
tabindex?: string;
|
||||
|
||||
/**
|
||||
* Specify the ARIA label for the radio tile checkmark icon
|
||||
* @default "Tile checkmark"
|
||||
*/
|
||||
iconDescription?: string;
|
||||
|
||||
/**
|
||||
* Set an id for the input element
|
||||
*/
|
||||
id?: string;
|
||||
|
||||
/**
|
||||
* Specify a name attribute for the input
|
||||
* @default ""
|
||||
*/
|
||||
name?: string;
|
||||
};
|
||||
|
||||
$$prop_def: RadioTileProps;
|
||||
$$slot_def: {
|
||||
default: {};
|
||||
};
|
||||
|
|
112
types/Tile/SelectableTile.d.ts
vendored
112
types/Tile/SelectableTile.d.ts
vendored
|
@ -1,61 +1,63 @@
|
|||
/// <reference types="svelte" />
|
||||
|
||||
export interface SelectableTileProps extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["label"]> {
|
||||
/**
|
||||
* Set to `true` to select the tile
|
||||
* @default false
|
||||
*/
|
||||
selected?: boolean;
|
||||
|
||||
/**
|
||||
* Set to `true` to enable the light variant
|
||||
* @default false
|
||||
*/
|
||||
light?: boolean;
|
||||
|
||||
/**
|
||||
* Specify the title of the selectable tile
|
||||
* @default "title"
|
||||
*/
|
||||
title?: string;
|
||||
|
||||
/**
|
||||
* Specify the value of the selectable tile
|
||||
* @default "value"
|
||||
*/
|
||||
value?: string;
|
||||
|
||||
/**
|
||||
* Specify the tabindex
|
||||
* @default "0"
|
||||
*/
|
||||
tabindex?: string;
|
||||
|
||||
/**
|
||||
* Specify the ARIA label for the selectable tile checkmark icon
|
||||
* @default "Tile checkmark"
|
||||
*/
|
||||
iconDescription?: string;
|
||||
|
||||
/**
|
||||
* Set an id for the input element
|
||||
* @default "ccs-" + Math.random().toString(36)
|
||||
*/
|
||||
id?: string;
|
||||
|
||||
/**
|
||||
* Specify a name attribute for the input
|
||||
* @default ""
|
||||
*/
|
||||
name?: string;
|
||||
|
||||
/**
|
||||
* Obtain a reference to the input HTML element
|
||||
* @default null
|
||||
*/
|
||||
ref?: null | HTMLInputElement;
|
||||
}
|
||||
|
||||
export default class SelectableTile {
|
||||
$$prop_def: svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["label"]> & {
|
||||
/**
|
||||
* Set to `true` to select the tile
|
||||
* @default false
|
||||
*/
|
||||
selected?: boolean;
|
||||
|
||||
/**
|
||||
* Set to `true` to enable the light variant
|
||||
* @default false
|
||||
*/
|
||||
light?: boolean;
|
||||
|
||||
/**
|
||||
* Specify the title of the selectable tile
|
||||
* @default "title"
|
||||
*/
|
||||
title?: string;
|
||||
|
||||
/**
|
||||
* Specify the value of the selectable tile
|
||||
* @default "value"
|
||||
*/
|
||||
value?: string;
|
||||
|
||||
/**
|
||||
* Specify the tabindex
|
||||
* @default "0"
|
||||
*/
|
||||
tabindex?: string;
|
||||
|
||||
/**
|
||||
* Specify the ARIA label for the selectable tile checkmark icon
|
||||
* @default "Tile checkmark"
|
||||
*/
|
||||
iconDescription?: string;
|
||||
|
||||
/**
|
||||
* Set an id for the input element
|
||||
*/
|
||||
id?: string;
|
||||
|
||||
/**
|
||||
* Specify a name attribute for the input
|
||||
* @default ""
|
||||
*/
|
||||
name?: string;
|
||||
|
||||
/**
|
||||
* Obtain a reference to the input HTML element
|
||||
* @default null
|
||||
*/
|
||||
ref?: null | HTMLInputElement;
|
||||
};
|
||||
|
||||
$$prop_def: SelectableTileProps;
|
||||
$$slot_def: {
|
||||
default: {};
|
||||
};
|
||||
|
|
17
types/Tile/Tile.d.ts
vendored
17
types/Tile/Tile.d.ts
vendored
|
@ -1,14 +1,15 @@
|
|||
/// <reference types="svelte" />
|
||||
|
||||
export default class Tile {
|
||||
$$prop_def: svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["div"]> & {
|
||||
/**
|
||||
* Set to `true` to enable the light variant
|
||||
* @default false
|
||||
*/
|
||||
light?: boolean;
|
||||
};
|
||||
export interface TileProps extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["div"]> {
|
||||
/**
|
||||
* Set to `true` to enable the light variant
|
||||
* @default false
|
||||
*/
|
||||
light?: boolean;
|
||||
}
|
||||
|
||||
export default class Tile {
|
||||
$$prop_def: TileProps;
|
||||
$$slot_def: {
|
||||
default: {};
|
||||
};
|
||||
|
|
39
types/Tile/TileGroup.d.ts
vendored
39
types/Tile/TileGroup.d.ts
vendored
|
@ -1,25 +1,26 @@
|
|||
/// <reference types="svelte" />
|
||||
|
||||
export interface TileGroupProps extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["fieldset"]> {
|
||||
/**
|
||||
* Specify the selected tile value
|
||||
*/
|
||||
selected?: string;
|
||||
|
||||
/**
|
||||
* Set to `true` to disable the tile group
|
||||
* @default false
|
||||
*/
|
||||
disabled?: boolean;
|
||||
|
||||
/**
|
||||
* Specify the legend text
|
||||
* @default ""
|
||||
*/
|
||||
legend?: string;
|
||||
}
|
||||
|
||||
export default class TileGroup {
|
||||
$$prop_def: svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["fieldset"]> & {
|
||||
/**
|
||||
* Specify the selected tile value
|
||||
*/
|
||||
selected?: string;
|
||||
|
||||
/**
|
||||
* Set to `true` to disable the tile group
|
||||
* @default false
|
||||
*/
|
||||
disabled?: boolean;
|
||||
|
||||
/**
|
||||
* Specify the legend text
|
||||
* @default ""
|
||||
*/
|
||||
legend?: string;
|
||||
};
|
||||
|
||||
$$prop_def: TileGroupProps;
|
||||
$$slot_def: {
|
||||
default: {};
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue