From 5fad0cb3c777113cadfea82cba7d973acea1ee02 Mon Sep 17 00:00:00 2001
From: Eric Liu let
| Yes | null | HTMLUListElement
| null
| Obtain a reference to the unordered list HTML element |
+| y | let
| Yes | number
| 0
| Specify the vertical offset of the menu position |
+| x | let
| Yes | number
| 0
| Specify the horizontal offset of the menu position |
+| open | let
| Yes | boolean
| false
| Set to `true` to open the menu
Either `x` and `y` must be greater than zero |
+
+### Slots
+
+| Slot name | Default | Props | Fallback |
+| :-------- | :------ | :---- | :------- |
+| -- | Yes | -- | -- |
+
+### Events
+
+| Event name | Type | Detail |
+| :--------- | :--------- | :----- |
+| click | forwarded | -- |
+| keydown | forwarded | -- |
+| open | dispatched | -- |
+| close | dispatched | -- |
+
+## `ContextMenuDivider`
+
+### Props
+
+None.
+
+### Slots
+
+None.
+
+### Events
+
+None.
+
+## `ContextMenuGroup`
+
+### Props
+
+| Prop name | Kind | Reactive | Type | Default value | Description |
+| :---------- | :--------------- | :------- | :-------------------- | --------------- | ---------------------- |
+| selectedIds | let
| Yes | string[]
| []
| -- |
+| labelText | let
| No | string
| ""
| Specify the label text |
+
+### Slots
+
+| Slot name | Default | Props | Fallback |
+| :-------- | :------ | :---- | :------- |
+| -- | Yes | -- | -- |
+
+### Events
+
+None.
+
+## `ContextMenuOption`
+
+### Props
+
+| Prop name | Kind | Reactive | Type | Default value | Description |
+| :----------- | :--------------- | :------- | :----------------------------------------------------------- | ------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------- |
+| ref | let
| Yes | null | HTMLLIElement
| null
| Obtain a reference to the list item HTML element |
+| selectable | let
| Yes | boolean
| false
| Set to `true` to enable the selectable variant
Automatically set to `true` if `selected` is `true` |
+| 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 |
+| 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>) |
+| id | let
| No | string
| "ccs-" + Math.random().toString(36)
| Specify the id
It's recommended to provide an id as a value to bind to within a selectable/radio menu group |
+
+### Slots
+
+| Slot name | Default | Props | Fallback |
+| :----------- | :------ | :---- | :-------------------------- |
+| -- | Yes | -- | -- |
+| labelText | No | -- | {labelText}
|
+| shortcutText | No | -- | {shortcutText}
|
+
+### Events
+
+| Event name | Type | Detail |
+| :--------- | :--------- | :----- |
+| keydown | forwarded | -- |
+| mouseenter | forwarded | -- |
+| mouseleave | forwarded | -- |
+| click | dispatched | -- |
+
+## `ContextMenuRadioGroup`
+
+### Props
+
+| Prop name | Kind | Reactive | Type | Default value | Description |
+| :--------- | :--------------- | :------- | :------------------ | --------------- | ------------------------------- |
+| selectedId | let
| Yes | string
| ""
| Set the selected radio group id |
+| labelText | let
| No | string
| ""
| Specify the label text |
+
+### Slots
+
+| Slot name | Default | Props | Fallback |
+| :-------- | :------ | :---- | :------- |
+| -- | Yes | -- | -- |
+
+### Events
+
+None.
+
## `Copy`
### Props
@@ -2238,7 +2355,7 @@ None.
| Event name | Type | Detail |
| :--------- | :--------- | :-------------------------------------------------------------------------------------------------- |
| select | dispatched | { selectedIds: string[]; selected: MultiSelectItem[]; unselected: MultiSelectItem[]; }
|
-| clear | forwarded | -- |
+| clear | dispatched | any
|
| keydown | forwarded | -- |
| focus | forwarded | -- |
| blur | forwarded | -- |
@@ -2541,9 +2658,11 @@ None.
### Events
-| Event name | Type | Detail |
-| :--------- | :--------- | :----------------------------------------------- |
-| update | dispatched | { pageSize: number; page: number; }
|
+| Event name | Type | Detail |
+| :--------------------- | :--------- | :----------------------------------------------- |
+| update | dispatched | { pageSize: number; page: number; }
|
+| click:button--previous | dispatched | { page: number; }
|
+| click:button--next | dispatched | { page: number; }
|
## `PaginationNav`
@@ -2632,6 +2751,32 @@ None.
| focus | forwarded | -- |
| blur | forwarded | -- |
+## `Popover`
+
+### Props
+
+| Prop name | Kind | Reactive | Type | Default value | Description |
+| :------------------ | :--------------- | :------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------ | ------------------------------------------------------ |
+| open | let
| Yes | boolean
| false
| Set to `true` to display the popover |
+| closeOnOutsideClick | let
| No | boolean
| false
| Set to `true` to close the popover on an outside click |
+| caret | let
| No | boolean
| false
| Set to `true` render a caret |
+| align | let
| No | "top" | "top-left" | "top-right" | "bottom" | "bottom-left" | "bottom-right" | "left" | "left-bottom" | "left-top" | "right" | "right-bottom" | "right-top"
| "top"
| Specify the alignment of the caret |
+| light | let
| No | boolean
| false
| Set to `true` to enable the light variant |
+| highContrast | let
| No | boolean
| false
| Set to `true` to enable the high contrast variant |
+| relative | let
| No | boolean
| false
| Set to `true` to use a relative position |
+
+### Slots
+
+| Slot name | Default | Props | Fallback |
+| :-------- | :------ | :---- | :------- |
+| -- | Yes | -- | -- |
+
+### Events
+
+| Event name | Type | Detail |
+| :------------ | :--------- | :----- |
+| click:outside | dispatched | -- |
+
## `ProgressIndicator`
### Props
@@ -2920,6 +3065,8 @@ None.
| name | let
| No | string
| -- | Specify a name attribute for the select element |
| invalid | let
| No | boolean
| false
| Set to `true` to indicate an invalid state |
| invalidText | let
| No | string
| ""
| Specify the invalid state text |
+| warn | let
| No | boolean
| false
| Set to `true` to indicate an warning state |
+| warnText | let
| No | string
| ""
| Specify the warning state text |
| helperText | let
| No | string
| ""
| Specify the helper text |
| noLabel | let
| No | boolean
| false
| Set to `true` to not render a label |
| labelText | let
| No | string
| ""
| Specify the label text |
@@ -3682,9 +3829,10 @@ None.
### Props
-| Prop name | Kind | Reactive | Type | Default value | Description |
-| :-------- | :--------------- | :------- | :------------------ | -------------- | ------------------------------------ |
-| count | let
| No | number
| 4
| Specify the number of tabs to render |
+| Prop name | Kind | Reactive | Type | Default value | Description |
+| :-------- | :--------------- | :------- | :---------------------------------------- | ---------------------- | ------------------------------------ |
+| count | let
| No | number
| 4
| Specify the number of tabs to render |
+| type | let
| No | "default" | "container"
| "default"
| Specify the type of tabs |
### Slots
diff --git a/docs/package.json b/docs/package.json
index f4d109ec..36b8b1d1 100644
--- a/docs/package.json
+++ b/docs/package.json
@@ -11,7 +11,7 @@
"devDependencies": {
"@sveltech/routify": "^1.9.9",
"autoprefixer": "^10.2.3",
- "carbon-components": "10.30.0",
+ "carbon-components": "10.31.0",
"carbon-components-svelte": "../",
"clipboard-copy": "^3.1.0",
"mdsvex": "^0.8.8",
diff --git a/docs/src/COMPONENT_API.json b/docs/src/COMPONENT_API.json
index aee2c87c..393b36ab 100644
--- a/docs/src/COMPONENT_API.json
+++ b/docs/src/COMPONENT_API.json
@@ -1,5 +1,5 @@
{
- "total": 160,
+ "total": 166,
"components": [
{
"moduleName": "Accordion",
@@ -1556,6 +1556,244 @@
"typedefs": [],
"rest_props": { "type": "Element", "name": "div" }
},
+ {
+ "moduleName": "ContextMenu",
+ "filePath": "src/ContextMenu/ContextMenu.svelte",
+ "props": [
+ {
+ "name": "open",
+ "kind": "let",
+ "description": "Set to `true` to open the menu\nEither `x` and `y` must be greater than zero",
+ "type": "boolean",
+ "value": "false",
+ "isFunction": false,
+ "constant": false,
+ "reactive": true
+ },
+ {
+ "name": "x",
+ "kind": "let",
+ "description": "Specify the horizontal offset of the menu position",
+ "type": "number",
+ "value": "0",
+ "isFunction": false,
+ "constant": false,
+ "reactive": true
+ },
+ {
+ "name": "y",
+ "kind": "let",
+ "description": "Specify the vertical offset of the menu position",
+ "type": "number",
+ "value": "0",
+ "isFunction": false,
+ "constant": false,
+ "reactive": true
+ },
+ {
+ "name": "ref",
+ "kind": "let",
+ "description": "Obtain a reference to the unordered list HTML element",
+ "type": "null | HTMLUListElement",
+ "value": "null",
+ "isFunction": false,
+ "constant": false,
+ "reactive": true
+ }
+ ],
+ "slots": [{ "name": "__default__", "default": true, "slot_props": "{}" }],
+ "events": [
+ { "type": "forwarded", "name": "click", "element": "ul" },
+ { "type": "forwarded", "name": "keydown", "element": "ul" },
+ { "type": "dispatched", "name": "open" },
+ { "type": "dispatched", "name": "close" }
+ ],
+ "typedefs": [],
+ "rest_props": { "type": "Element", "name": "ul" }
+ },
+ {
+ "moduleName": "ContextMenuDivider",
+ "filePath": "src/ContextMenu/ContextMenuDivider.svelte",
+ "props": [],
+ "slots": [],
+ "events": [],
+ "typedefs": []
+ },
+ {
+ "moduleName": "ContextMenuGroup",
+ "filePath": "src/ContextMenu/ContextMenuGroup.svelte",
+ "props": [
+ {
+ "name": "selectedIds",
+ "kind": "let",
+ "type": "string[]",
+ "value": "[]",
+ "isFunction": false,
+ "constant": false,
+ "reactive": true
+ },
+ {
+ "name": "labelText",
+ "kind": "let",
+ "description": "Specify the label text",
+ "type": "string",
+ "value": "\"\"",
+ "isFunction": false,
+ "constant": false,
+ "reactive": false
+ }
+ ],
+ "slots": [{ "name": "__default__", "default": true, "slot_props": "{}" }],
+ "events": [],
+ "typedefs": []
+ },
+ {
+ "moduleName": "ContextMenuOption",
+ "filePath": "src/ContextMenu/ContextMenuOption.svelte",
+ "props": [
+ {
+ "name": "disabled",
+ "kind": "let",
+ "description": "Set to `true` to enable the disabled state",
+ "type": "boolean",
+ "value": "false",
+ "isFunction": false,
+ "constant": false,
+ "reactive": false
+ },
+ {
+ "name": "indented",
+ "kind": "let",
+ "description": "Set to `true` to indent the label",
+ "type": "boolean",
+ "value": "false",
+ "isFunction": false,
+ "constant": false,
+ "reactive": true
+ },
+ {
+ "name": "icon",
+ "kind": "let",
+ "description": "Specify the icon from `carbon-icons-svelte` to render\nIcon is rendered to the left of the label text",
+ "type": "typeof import(\"carbon-icons-svelte\").CarbonIcon",
+ "isFunction": false,
+ "constant": false,
+ "reactive": true
+ },
+ {
+ "name": "labelText",
+ "kind": "let",
+ "description": "Specify the label text\nAlternatively, use the \"labelText\" slot (e.g., ...)",
+ "type": "string",
+ "value": "\"\"",
+ "isFunction": false,
+ "constant": false,
+ "reactive": false
+ },
+ {
+ "name": "selected",
+ "kind": "let",
+ "description": "Set to `true` to use the selected variant",
+ "type": "boolean",
+ "value": "false",
+ "isFunction": false,
+ "constant": false,
+ "reactive": true
+ },
+ {
+ "name": "selectable",
+ "kind": "let",
+ "description": "Set to `true` to enable the selectable variant\nAutomatically set to `true` if `selected` is `true`",
+ "type": "boolean",
+ "value": "false",
+ "isFunction": false,
+ "constant": false,
+ "reactive": true
+ },
+ {
+ "name": "shortcutText",
+ "kind": "let",
+ "description": "Specify the shortcut text\nAlternatively, use the \"shortcutText\" slot (e.g., ...)",
+ "type": "string",
+ "value": "\"\"",
+ "isFunction": false,
+ "constant": false,
+ "reactive": false
+ },
+ {
+ "name": "id",
+ "kind": "let",
+ "description": "Specify the id\nIt's recommended to provide an id as a value to bind to within a selectable/radio menu group",
+ "type": "string",
+ "value": "\"ccs-\" + Math.random().toString(36)",
+ "isFunction": false,
+ "constant": false,
+ "reactive": false
+ },
+ {
+ "name": "ref",
+ "kind": "let",
+ "description": "Obtain a reference to the list item HTML element",
+ "type": "null | HTMLLIElement",
+ "value": "null",
+ "isFunction": false,
+ "constant": false,
+ "reactive": true
+ }
+ ],
+ "slots": [
+ { "name": "__default__", "default": true, "slot_props": "{}" },
+ {
+ "name": "labelText",
+ "default": false,
+ "fallback": "{labelText}",
+ "slot_props": "{}"
+ },
+ {
+ "name": "shortcutText",
+ "default": false,
+ "fallback": "{shortcutText}",
+ "slot_props": "{}"
+ }
+ ],
+ "events": [
+ { "type": "forwarded", "name": "keydown", "element": "li" },
+ { "type": "forwarded", "name": "mouseenter", "element": "li" },
+ { "type": "forwarded", "name": "mouseleave", "element": "li" },
+ { "type": "dispatched", "name": "click" }
+ ],
+ "typedefs": [],
+ "rest_props": { "type": "Element", "name": "li" }
+ },
+ {
+ "moduleName": "ContextMenuRadioGroup",
+ "filePath": "src/ContextMenu/ContextMenuRadioGroup.svelte",
+ "props": [
+ {
+ "name": "selectedId",
+ "kind": "let",
+ "description": "Set the selected radio group id",
+ "type": "string",
+ "value": "\"\"",
+ "isFunction": false,
+ "constant": false,
+ "reactive": true
+ },
+ {
+ "name": "labelText",
+ "kind": "let",
+ "description": "Specify the label text",
+ "type": "string",
+ "value": "\"\"",
+ "isFunction": false,
+ "constant": false,
+ "reactive": false
+ }
+ ],
+ "slots": [{ "name": "__default__", "default": true, "slot_props": "{}" }],
+ "events": [],
+ "typedefs": []
+ },
{
"moduleName": "Copy",
"filePath": "src/Copy/Copy.svelte",
@@ -5539,7 +5777,7 @@
"name": "select",
"detail": "{ selectedIds: string[]; selected: MultiSelectItem[]; unselected: MultiSelectItem[]; }"
},
- { "type": "forwarded", "name": "clear", "element": "ListBoxSelection" },
+ { "type": "dispatched", "name": "clear", "detail": "any" },
{ "type": "forwarded", "name": "keydown", "element": "input" },
{ "type": "forwarded", "name": "focus", "element": "input" },
{ "type": "forwarded", "name": "blur", "element": "input" }
@@ -6475,6 +6713,16 @@
"type": "dispatched",
"name": "update",
"detail": "{ pageSize: number; page: number; }"
+ },
+ {
+ "type": "dispatched",
+ "name": "click:button--previous",
+ "detail": "{ page: number; }"
+ },
+ {
+ "type": "dispatched",
+ "name": "click:button--next",
+ "detail": "{ page: number; }"
}
],
"typedefs": [],
@@ -6778,6 +7026,86 @@
"typedefs": [],
"rest_props": { "type": "Element", "name": "input" }
},
+ {
+ "moduleName": "Popover",
+ "filePath": "src/Popover/Popover.svelte",
+ "props": [
+ {
+ "name": "open",
+ "kind": "let",
+ "description": "Set to `true` to display the popover",
+ "type": "boolean",
+ "value": "false",
+ "isFunction": false,
+ "constant": false,
+ "reactive": true
+ },
+ {
+ "name": "closeOnOutsideClick",
+ "kind": "let",
+ "description": "Set to `true` to close the popover on an outside click",
+ "type": "boolean",
+ "value": "false",
+ "isFunction": false,
+ "constant": false,
+ "reactive": false
+ },
+ {
+ "name": "caret",
+ "kind": "let",
+ "description": "Set to `true` render a caret",
+ "type": "boolean",
+ "value": "false",
+ "isFunction": false,
+ "constant": false,
+ "reactive": false
+ },
+ {
+ "name": "align",
+ "kind": "let",
+ "description": "Specify the alignment of the caret",
+ "type": "\"top\" | \"top-left\" | \"top-right\" | \"bottom\" | \"bottom-left\" | \"bottom-right\" | \"left\" | \"left-bottom\" | \"left-top\" | \"right\" | \"right-bottom\" | \"right-top\"",
+ "value": "\"top\"",
+ "isFunction": false,
+ "constant": false,
+ "reactive": false
+ },
+ {
+ "name": "light",
+ "kind": "let",
+ "description": "Set to `true` to enable the light variant",
+ "type": "boolean",
+ "value": "false",
+ "isFunction": false,
+ "constant": false,
+ "reactive": false
+ },
+ {
+ "name": "highContrast",
+ "kind": "let",
+ "description": "Set to `true` to enable the high contrast variant",
+ "type": "boolean",
+ "value": "false",
+ "isFunction": false,
+ "constant": false,
+ "reactive": false
+ },
+ {
+ "name": "relative",
+ "kind": "let",
+ "description": "Set to `true` to use a relative position",
+ "type": "boolean",
+ "value": "false",
+ "isFunction": false,
+ "constant": false,
+ "reactive": false
+ }
+ ],
+ "slots": [{ "name": "__default__", "default": true, "slot_props": "{}" }],
+ "events": [{ "type": "dispatched", "name": "click:outside" }],
+ "typedefs": [],
+ "rest_props": { "type": "Element", "name": "div" }
+ },
{
"moduleName": "ProgressIndicator",
"filePath": "src/ProgressIndicator/ProgressIndicator.svelte",
@@ -7638,6 +7966,26 @@
"constant": false,
"reactive": false
},
+ {
+ "name": "warn",
+ "kind": "let",
+ "description": "Set to `true` to indicate an warning state",
+ "type": "boolean",
+ "value": "false",
+ "isFunction": false,
+ "constant": false,
+ "reactive": false
+ },
+ {
+ "name": "warnText",
+ "kind": "let",
+ "description": "Specify the warning state text",
+ "type": "string",
+ "value": "\"\"",
+ "isFunction": false,
+ "constant": false,
+ "reactive": false
+ },
{
"name": "helperText",
"kind": "let",
@@ -9148,6 +9496,16 @@
"isFunction": false,
"constant": false,
"reactive": false
+ },
+ {
+ "name": "type",
+ "kind": "let",
+ "description": "Specify the type of tabs",
+ "type": "\"default\" | \"container\"",
+ "value": "\"default\"",
+ "isFunction": false,
+ "constant": false,
+ "reactive": false
}
],
"slots": [],
diff --git a/docs/src/components/Preview.svelte b/docs/src/components/Preview.svelte
index f9fc8d16..481a4f2b 100644
--- a/docs/src/components/Preview.svelte
+++ b/docs/src/components/Preview.svelte
@@ -55,6 +55,10 @@
max-width: 56rem;
}
+ .code-override .bx--snippet {
+ max-width: none;
+ }
+
.code-override .bx--copy-btn,
.code-override .bx--snippet,
.code-override button.bx--btn.bx--snippet-btn--expand {
diff --git a/docs/src/layouts/ComponentLayout.svelte b/docs/src/layouts/ComponentLayout.svelte
index 238f0a52..5ce07727 100644
--- a/docs/src/layouts/ComponentLayout.svelte
+++ b/docs/src/layouts/ComponentLayout.svelte
@@ -208,7 +208,12 @@
}
}
- .preview-viewer > .bx--aspect-ratio {
+ .preview-viewer > .bx--aspect-ratio,
+ .preview-viewer [data-outline] {
outline: 1px solid var(--cds-interactive-04);
}
+
+ [data-outline] {
+ position: relative;
+ }
diff --git a/docs/src/pages/_layout.svelte b/docs/src/pages/_layout.svelte
index 3b1a616d..bb4359af 100644
--- a/docs/src/pages/_layout.svelte
+++ b/docs/src/pages/_layout.svelte
@@ -20,7 +20,7 @@
import Footer from "../components/Footer.svelte";
const deprecated = ["ToggleSmall", "Icon"];
- const new_components = ["ImageLoader", "LocalStorage"];
+ const new_components = ["Popover", "ContextMenu"];
let isOpen = false;
let isSideNavOpen = true;
@@ -105,10 +105,18 @@
>
{child.title}
{#if deprecated.includes(child.title)}
-