diff --git a/COMPONENT_INDEX.md b/COMPONENT_INDEX.md index e9ea4ff3..ffd5e15d 100644 --- a/COMPONENT_INDEX.md +++ b/COMPONENT_INDEX.md @@ -1,6 +1,6 @@ # Component Index -> 166 components exported from carbon-components-svelte@0.31.1. +> 167 components exported from carbon-components-svelte@0.31.1. ## Components @@ -167,6 +167,7 @@ - [`ToolbarSearch`](#toolbarsearch) - [`Tooltip`](#tooltip) - [`TooltipDefinition`](#tooltipdefinition) +- [`TooltipFooter`](#tooltipfooter) - [`TooltipIcon`](#tooltipicon) - [`Truncate`](#truncate) - [`UnorderedList`](#unorderedlist) @@ -500,25 +501,25 @@ None. ### Props -| Prop name | Kind | Reactive | Type | Default value | Description | -| :-------------------- | :--------------- | :------- | :--------------------------------------------------- | ------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------- | -| ref | let | Yes | null | HTMLPreElement | null | Obtain a reference to the pre HTML element | -| showMoreLess | let | Yes | boolean | false | Set to `true` to enable the show more/less button | -| expanded | let | Yes | boolean | false | Set to `true` to expand a multi-line code snippet (type="multi") | -| type | let | No | "single" | "inline" | "multi" | "single" | Set the type of code snippet | -| code | let | No | string | -- | Set the code snippet text
Alternatively, use the default slot (e.g., <CodeSnippet>{`code`}</CodeSnippet>) | -| hideCopyButton | let | No | boolean | false | Set to `true` to hide the copy button | -| disabled | let | No | boolean | false | Set to `true` for the disabled variant
Only applies to the "single", "multi" types | -| wrapText | let | No | boolean | false | Set to `true` to wrap the text
Note that `type` must be "multi" | -| light | let | No | boolean | false | Set to `true` to enable the light variant | -| skeleton | let | No | boolean | false | Set to `true` to display the skeleton state | -| copyButtonDescription | let | No | string | -- | Specify the ARIA label for the copy button icon | -| copyLabel | let | No | string | -- | Specify the ARIA label of the copy button | -| feedback | let | No | string | "Copied!" | Specify the feedback text displayed when clicking the snippet | -| feedbackTimeout | let | No | number | 2000 | Set the timeout duration (ms) to display feedback text | -| showLessText | let | No | string | "Show less" | Specify the show less text
`type` must be "multi" | -| showMoreText | let | No | string | "Show more" | Specify the show more text
`type` must be "multi" | -| id | let | No | string | "ccs-" + Math.random().toString(36) | Set an id for the code element | +| Prop name | Kind | Reactive | Type | Default value | Description | +| :-------------------- | :--------------- | :------- | :--------------------------------------------------- | ------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| ref | let | Yes | null | HTMLPreElement | null | Obtain a reference to the pre HTML element | +| showMoreLess | let | Yes | boolean | false | Set to `true` to enable the show more/less button | +| expanded | let | Yes | boolean | false | Set to `true` to expand a multi-line code snippet (type="multi") | +| type | let | No | "single" | "inline" | "multi" | "single" | Set the type of code snippet | +| code | let | No | string | -- | Set the code snippet text
Alternatively, use the default slot (e.g., <CodeSnippet>{`code`}</CodeSnippet>)
You must use the `code` prop to copy the code | +| hideCopyButton | let | No | boolean | false | Set to `true` to hide the copy button | +| disabled | let | No | boolean | false | Set to `true` for the disabled variant
Only applies to the "single", "multi" types | +| wrapText | let | No | boolean | false | Set to `true` to wrap the text
Note that `type` must be "multi" | +| light | let | No | boolean | false | Set to `true` to enable the light variant | +| skeleton | let | No | boolean | false | Set to `true` to display the skeleton state | +| copyButtonDescription | let | No | string | -- | Specify the ARIA label for the copy button icon | +| copyLabel | let | No | string | -- | Specify the ARIA label of the copy button | +| feedback | let | No | string | "Copied!" | Specify the feedback text displayed when clicking the snippet | +| feedbackTimeout | let | No | number | 2000 | Set the timeout duration (ms) to display feedback text | +| showLessText | let | No | string | "Show less" | Specify the show less text
`type` must be "multi" | +| showMoreText | let | No | string | "Show more" | Specify the show more text
`type` must be "multi" | +| id | let | No | string | "ccs-" + Math.random().toString(36) | Set an id for the code element | ### Slots @@ -528,13 +529,14 @@ None. ### Events -| Event name | Type | Detail | -| :----------- | :-------- | :----- | -| click | forwarded | -- | -| mouseover | forwarded | -- | -| mouseenter | forwarded | -- | -| mouseleave | forwarded | -- | -| animationend | forwarded | -- | +| Event name | Type | Detail | +| :----------- | :--------- | :----- | +| click | forwarded | -- | +| mouseover | forwarded | -- | +| mouseenter | forwarded | -- | +| mouseleave | forwarded | -- | +| animationend | forwarded | -- | +| copy | dispatched | -- | ## `CodeSnippetSkeleton` @@ -798,6 +800,7 @@ None. | selected | let | Yes | boolean | false | Set to `true` to use the selected variant | | icon | let | Yes | typeof import("carbon-icons-svelte").CarbonIcon | -- | Specify the icon from `carbon-icons-svelte` to render
Icon is rendered to the left of the label text | | indented | let | Yes | boolean | false | Set to `true` to indent the label | +| kind | let | No | "default" | "danger" | "default" | Specify the kind of option | | disabled | let | No | boolean | false | Set to `true` to enable the disabled state | | labelText | let | No | string | "" | Specify the label text
Alternatively, use the "labelText" slot (e.g., <span slot="labelText">...</span>) | | shortcutText | let | No | string | "" | Specify the shortcut text
Alternatively, use the "shortcutText" slot (e.g., <span slot="shortcutText">...</span>) | @@ -869,6 +872,7 @@ None. | Prop name | Kind | Reactive | Type | Default value | Description | | :-------------- | :--------------- | :------- | :------------------ | -------------------------------- | ------------------------------------------------ | | iconDescription | let | No | string | "Copy to clipboard" | Set the title and ARIA label for the copy button | +| text | let | No | string | -- | Specify the text to copy | ### Slots @@ -876,10 +880,11 @@ None. ### Events -| Event name | Type | Detail | -| :----------- | :-------- | :----- | -| click | forwarded | -- | -| animationend | forwarded | -- | +| Event name | Type | Detail | +| :----------- | :--------- | :----- | +| click | forwarded | -- | +| animationend | forwarded | -- | +| copy | dispatched | -- | ## `DataTable` @@ -894,7 +899,7 @@ export interface DataTableEmptyHeader { key: DataTableKey; empty: boolean; display?: (item: Value) => DataTableValue; - sort?: (a: DataTableValue, b: DataTableValue) => 0 | -1 | 1; + sort?: false | ((a: DataTableValue, b: DataTableValue) => 0 | -1 | 1); columnMenu?: boolean; } @@ -902,7 +907,7 @@ export interface DataTableNonEmptyHeader { key: DataTableKey; value: DataTableValue; display?: (item: Value) => DataTableValue; - sort?: (a: DataTableValue, b: DataTableValue) => 0 | -1 | 1; + sort?: false | ((a: DataTableValue, b: DataTableValue) => 0 | -1 | 1); columnMenu?: boolean; } @@ -952,16 +957,16 @@ export interface DataTableCell { ### Events -| Event name | Type | Detail | -| :------------------- | :--------- | :----------------------------------------------------------------------------------------------------- | -| click | dispatched | { header?: DataTableHeader; row?: DataTableRow; cell?: DataTableCell; } | -| click:header--expand | dispatched | { expanded: boolean; } | -| click:header | dispatched | { header: DataTableHeader; sortDirection: "ascending" | "descending" | "none" } | -| click:row | dispatched | DataTableRow | -| mouseenter:row | dispatched | DataTableRow | -| mouseleave:row | dispatched | DataTableRow | -| click:row--expand | dispatched | { expanded: boolean; row: DataTableRow; } | -| click:cell | dispatched | DataTableCell | +| Event name | Type | Detail | +| :------------------- | :--------- | :------------------------------------------------------------------------------------------------------ | +| click | dispatched | { header?: DataTableHeader; row?: DataTableRow; cell?: DataTableCell; } | +| click:header--expand | dispatched | { expanded: boolean; } | +| click:header | dispatched | { header: DataTableHeader; sortDirection?: "ascending" | "descending" | "none" } | +| click:row | dispatched | DataTableRow | +| mouseenter:row | dispatched | DataTableRow | +| mouseleave:row | dispatched | DataTableRow | +| click:row--expand | dispatched | { expanded: boolean; row: DataTableRow; } | +| click:cell | dispatched | DataTableCell | ## `DataTableSkeleton` @@ -1402,12 +1407,13 @@ None. ### Props -| Prop name | Kind | Reactive | Type | Default value | Description | -| :---------- | :--------------- | :------- | :------------------- | ------------------ | ------------------------------------------ | -| invalid | let | No | boolean | false | Set to `true` to indicate an invalid state | -| message | let | No | boolean | false | Set to `true` to render a form requirement | -| messageText | let | No | string | "" | Specify the message text | -| legendText | let | No | string | "" | Specify the legend text | +| Prop name | Kind | Reactive | Type | Default value | Description | +| :---------- | :--------------- | :------- | :------------------- | ------------------ | --------------------------------------------- | +| invalid | let | No | boolean | false | Set to `true` to indicate an invalid state | +| message | let | No | boolean | false | Set to `true` to render a form requirement | +| noMargin | let | No | boolean | false | Set to `true` for to remove the bottom margin | +| messageText | let | No | string | "" | Specify the message text | +| legendText | let | No | string | "" | Specify the legend text | ### Slots @@ -2323,6 +2329,7 @@ export interface MultiSelectItem { | Prop name | Kind | Reactive | Type | Default value | Description | | :---------------- | :--------------- | :------- | :--------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| inputRef | let | Yes | null | HTMLInputElement | null | Obtain a reference to the input HTML element | | open | let | Yes | boolean | false | Set to `true` to open the dropdown | | value | let | Yes | string | "" | Specify the multiselect value | | selectedIds | let | Yes | MultiSelectItemId[] | [] | Set the selected ids | @@ -2576,13 +2583,13 @@ None. | :--------------- | :--------------- | :------- | :----------------------------------------------------------- | ------------------------------------------------ | ----------------------------------------------------------------- | | menuRef | let | Yes | null | HTMLUListElement | null | Obtain a reference to the overflow menu element | | buttonRef | let | Yes | null | HTMLButtonElement | null | Obtain a reference to the trigger button element | +| icon | let | Yes | typeof import("carbon-icons-svelte").CarbonIcon | -- | Specify the icon from `carbon-icons-svelte` to render | | open | let | Yes | boolean | false | Set to `true` to open the menu | | size | let | No | "sm" | "xl" | -- | Specify the size of the overflow menu | | direction | let | No | "top" | "bottom" | "bottom" | Specify the direction of the overflow menu relative to the button | | light | let | No | boolean | false | Set to `true` to enable the light variant | | flipped | let | No | boolean | false | Set to `true` to flip the menu relative to the button | | menuOptionsClass | let | No | string | -- | Specify the menu options class | -| icon | let | No | typeof import("carbon-icons-svelte").CarbonIcon | -- | Specify the icon from `carbon-icons-svelte` to render | | iconClass | let | No | string | -- | Specify the icon class | | iconDescription | let | No | string | "Open and close list of options" | Specify the ARIA label for the icon | | id | let | No | string | "ccs-" + Math.random().toString(36) | Set an id for the button element | @@ -2945,6 +2952,7 @@ None. | :-------------- | :--------------- | :------- | :------------------- | ------------------------------------------------ | -------------------------------------------------------- | | checked | let | Yes | boolean | false | Set to `true` to check the tile | | light | let | No | boolean | false | Set to `true` to enable the light variant | +| disabled | let | No | boolean | false | Set to `true` to disable the tile | | value | let | No | string | "" | Specify the value of the radio input | | tabindex | let | No | string | "0" | Specify the tabindex | | iconDescription | let | No | string | "Tile checkmark" | Specify the ARIA label for the radio tile checkmark icon | @@ -3002,6 +3010,7 @@ None. | value | let | Yes | string | "" | Specify the value of the search input | | small | let | No | boolean | false | -- | | size | let | No | "sm" | "lg" | "xl" | "xl" | Specify the size of the search input | +| searchClass | let | No | string | "" | Specify the class name passed to the outer div element | | skeleton | let | No | boolean | false | Set to `true` to display the skeleton state | | light | let | No | boolean | false | Set to `true` to enable the light variant | | disabled | let | No | boolean | false | Set to `true` to disable the search input | @@ -3158,6 +3167,7 @@ None. | ref | let | Yes | null | HTMLInputElement | null | Obtain a reference to the input HTML element | | selected | let | Yes | boolean | false | Set to `true` to select the tile | | light | let | No | boolean | false | Set to `true` to enable the light variant | +| disabled | let | No | boolean | false | Set to `true` to disable the tile | | title | let | No | string | "title" | Specify the title of the selectable tile | | value | let | No | string | "value" | Specify the value of the selectable tile | | tabindex | let | No | string | "0" | Specify the tabindex | @@ -3762,11 +3772,12 @@ None. ### Props -| Prop name | Kind | Reactive | Type | Default value | Description | -| :-------------- | :--------------- | :------- | :------------------------ | ------------------------------------------------ | ------------------------------------ | -| scope | let | No | string | "col" | Specify the `scope` attribute | -| translateWithId | let | No | () => string | () => "" | Override the default id translations | -| id | let | No | string | "ccs-" + Math.random().toString(36) | Set an id for the top-level element | +| Prop name | Kind | Reactive | Type | Default value | Description | +| :-------------- | :--------------- | :------- | :------------------------ | ------------------------------------------------ | ------------------------------------------------------ | +| disableSorting | let | No | boolean | false | Set to `true` to disable sorting on this specific cell | +| scope | let | No | string | "col" | Specify the `scope` attribute | +| translateWithId | let | No | () => string | () => "" | Override the default id translations | +| id | let | No | string | "ccs-" + Math.random().toString(36) | Set an id for the top-level element | ### Slots @@ -4464,6 +4475,24 @@ None. | mouseleave | forwarded | -- | | focus | forwarded | -- | +## `TooltipFooter` + +### Props + +| Prop name | Kind | Reactive | Type | Default value | Description | +| :------------------- | :--------------- | :------- | :------------------ | ---------------------------------------------- | --------------------------------------------------------------------------- | +| selectorPrimaryFocus | let | No | string | "a[href], button:not([disabled])" | Specify a selector to be focused inside the footer when opening the tooltip | + +### Slots + +| Slot name | Default | Props | Fallback | +| :-------- | :------ | :---- | :------- | +| -- | Yes | -- | -- | + +### Events + +None. + ## `TooltipIcon` ### Props diff --git a/docs/package.json b/docs/package.json index 36b8b1d1..72c592f2 100644 --- a/docs/package.json +++ b/docs/package.json @@ -11,9 +11,8 @@ "devDependencies": { "@sveltech/routify": "^1.9.9", "autoprefixer": "^10.2.3", - "carbon-components": "10.31.0", + "carbon-components": "10.32.0", "carbon-components-svelte": "../", - "clipboard-copy": "^3.1.0", "mdsvex": "^0.8.8", "npm-run-all": "^4.1.5", "postcss": "^8.2.4", diff --git a/docs/src/COMPONENT_API.json b/docs/src/COMPONENT_API.json index b7c977f7..106ca4c0 100644 --- a/docs/src/COMPONENT_API.json +++ b/docs/src/COMPONENT_API.json @@ -1,5 +1,5 @@ { - "total": 166, + "total": 167, "components": [ { "moduleName": "Accordion", @@ -805,7 +805,7 @@ { "name": "code", "kind": "let", - "description": "Set the code snippet text\nAlternatively, use the default slot (e.g., {`code`})", + "description": "Set the code snippet text\nAlternatively, use the default slot (e.g., {`code`})\nYou must use the `code` prop to copy the code", "type": "string", "isFunction": false, "constant": false, @@ -989,7 +989,12 @@ "name": "mouseleave", "element": "CodeSnippetSkeleton" }, - { "type": "forwarded", "name": "animationend", "element": "CopyButton" } + { + "type": "forwarded", + "name": "animationend", + "element": "CopyButton" + }, + { "type": "dispatched", "name": "copy" } ], "typedefs": [], "rest_props": { "type": "InlineComponent", "name": "CodeSnippetSkeleton" } @@ -1651,6 +1656,16 @@ "moduleName": "ContextMenuOption", "filePath": "src/ContextMenu/ContextMenuOption.svelte", "props": [ + { + "name": "kind", + "kind": "let", + "description": "Specify the kind of option", + "type": "\"default\" | \"danger\"", + "value": "\"default\"", + "isFunction": false, + "constant": false, + "reactive": false + }, { "name": "disabled", "kind": "let", @@ -1857,12 +1872,22 @@ "isFunction": false, "constant": false, "reactive": false + }, + { + "name": "text", + "kind": "let", + "description": "Specify the text to copy", + "type": "string", + "isFunction": false, + "constant": false, + "reactive": false } ], "slots": [], "events": [ { "type": "forwarded", "name": "click", "element": "Copy" }, - { "type": "forwarded", "name": "animationend", "element": "Copy" } + { "type": "forwarded", "name": "animationend", "element": "Copy" }, + { "type": "dispatched", "name": "copy" } ], "typedefs": [], "rest_props": { "type": "InlineComponent", "name": "Copy" }, @@ -2056,7 +2081,7 @@ { "type": "dispatched", "name": "click:header", - "detail": "{ header: DataTableHeader; sortDirection: \"ascending\" | \"descending\" | \"none\" }" + "detail": "{ header: DataTableHeader; sortDirection?: \"ascending\" | \"descending\" | \"none\" }" }, { "type": "dispatched", "name": "click:row", "detail": "DataTableRow" }, { @@ -2092,14 +2117,14 @@ "ts": "type DataTableValue = any" }, { - "type": "{ key: DataTableKey; empty: boolean; display?: (item: Value) => DataTableValue; sort?: (a: DataTableValue, b: DataTableValue) => (0 | -1 | 1); columnMenu?: boolean; }", + "type": "{ key: DataTableKey; empty: boolean; display?: (item: Value) => DataTableValue; sort?: false | ((a: DataTableValue, b: DataTableValue) => (0 | -1 | 1)); columnMenu?: boolean; }", "name": "DataTableEmptyHeader", - "ts": "interface DataTableEmptyHeader { key: DataTableKey; empty: boolean; display?: (item: Value) => DataTableValue; sort?: (a: DataTableValue, b: DataTableValue) => (0 | -1 | 1); columnMenu?: boolean; }" + "ts": "interface DataTableEmptyHeader { key: DataTableKey; empty: boolean; display?: (item: Value) => DataTableValue; sort?: false | ((a: DataTableValue, b: DataTableValue) => (0 | -1 | 1)); columnMenu?: boolean; }" }, { - "type": "{ key: DataTableKey; value: DataTableValue; display?: (item: Value) => DataTableValue; sort?: (a: DataTableValue, b: DataTableValue) => (0 | -1 | 1); columnMenu?: boolean; }", + "type": "{ key: DataTableKey; value: DataTableValue; display?: (item: Value) => DataTableValue; sort?: false | ((a: DataTableValue, b: DataTableValue) => (0 | -1 | 1)); columnMenu?: boolean; }", "name": "DataTableNonEmptyHeader", - "ts": "interface DataTableNonEmptyHeader { key: DataTableKey; value: DataTableValue; display?: (item: Value) => DataTableValue; sort?: (a: DataTableValue, b: DataTableValue) => (0 | -1 | 1); columnMenu?: boolean; }" + "ts": "interface DataTableNonEmptyHeader { key: DataTableKey; value: DataTableValue; display?: (item: Value) => DataTableValue; sort?: false | ((a: DataTableValue, b: DataTableValue) => (0 | -1 | 1)); columnMenu?: boolean; }" }, { "type": "DataTableNonEmptyHeader | DataTableEmptyHeader", @@ -2207,10 +2232,7 @@ ], "typedefs": [], "rest_props": { "type": "Element", "name": "div" }, - "extends": { - "interface": "DataTableHeader", - "import": "\"../DataTable/DataTable\"" - } + "extends": { "interface": "DataTableHeader", "import": "\"./DataTable\"" } }, { "moduleName": "DatePicker", @@ -3499,6 +3521,16 @@ "constant": false, "reactive": false }, + { + "name": "noMargin", + "kind": "let", + "description": "Set to `true` for to remove the bottom margin", + "type": "boolean", + "value": "false", + "isFunction": false, + "constant": false, + "reactive": false + }, { "name": "messageText", "kind": "let", @@ -5766,6 +5798,16 @@ "isFunction": false, "constant": false, "reactive": false + }, + { + "name": "inputRef", + "kind": "let", + "description": "Obtain a reference to the input HTML element", + "type": "null | HTMLInputElement", + "value": "null", + "isFunction": false, + "constant": false, + "reactive": true } ], "slots": [], @@ -6354,7 +6396,7 @@ "type": "typeof import(\"carbon-icons-svelte\").CarbonIcon", "isFunction": false, "constant": false, - "reactive": false + "reactive": true }, { "name": "iconClass", @@ -7518,6 +7560,16 @@ "constant": false, "reactive": false }, + { + "name": "disabled", + "kind": "let", + "description": "Set to `true` to disable the tile", + "type": "boolean", + "value": "false", + "isFunction": false, + "constant": false, + "reactive": false + }, { "name": "value", "kind": "let", @@ -7690,6 +7742,16 @@ "constant": false, "reactive": false }, + { + "name": "searchClass", + "kind": "let", + "description": "Specify the class name passed to the outer div element", + "type": "string", + "value": "\"\"", + "isFunction": false, + "constant": false, + "reactive": false + }, { "name": "skeleton", "kind": "let", @@ -8171,6 +8233,16 @@ "constant": false, "reactive": false }, + { + "name": "disabled", + "kind": "let", + "description": "Set to `true` to disable the tile", + "type": "boolean", + "value": "false", + "isFunction": false, + "constant": false, + "reactive": false + }, { "name": "title", "kind": "let", @@ -9369,6 +9441,16 @@ "moduleName": "TableHeader", "filePath": "src/DataTable/TableHeader.svelte", "props": [ + { + "name": "disableSorting", + "kind": "let", + "description": "Set to `true` to disable sorting on this specific cell", + "type": "boolean", + "value": "false", + "isFunction": false, + "constant": false, + "reactive": false + }, { "name": "scope", "kind": "let", @@ -11157,6 +11239,25 @@ "typedefs": [], "rest_props": { "type": "Element", "name": "div" } }, + { + "moduleName": "TooltipFooter", + "filePath": "src/Tooltip/TooltipFooter.svelte", + "props": [ + { + "name": "selectorPrimaryFocus", + "kind": "let", + "description": "Specify a selector to be focused inside the footer when opening the tooltip", + "type": "string", + "value": "\"a[href], button:not([disabled])\"", + "isFunction": false, + "constant": false, + "reactive": false + } + ], + "slots": [{ "name": "__default__", "default": true, "slot_props": "{}" }], + "events": [], + "typedefs": [] + }, { "moduleName": "TooltipIcon", "filePath": "src/TooltipIcon/TooltipIcon.svelte", diff --git a/docs/src/components/InlineSnippet.svelte b/docs/src/components/InlineSnippet.svelte index a36636d2..f28facf6 100644 --- a/docs/src/components/InlineSnippet.svelte +++ b/docs/src/components/InlineSnippet.svelte @@ -2,17 +2,10 @@ export let code = ""; import { CodeSnippet } from "carbon-components-svelte"; - import copy from "clipboard-copy";
- +