From b19696b9f120c5cdab551e910e24d06cc6eb1282 Mon Sep 17 00:00:00 2001 From: Eric Y Liu Date: Fri, 2 Apr 2021 04:40:27 -0700 Subject: [PATCH] feat(context-menu): support danger kind for ContextMenuOption --- COMPONENT_INDEX.md | 1 + docs/src/COMPONENT_API.json | 10 ++++++++++ docs/src/pages/framed/ContextMenu/ContextMenu.svelte | 2 ++ src/ContextMenu/ContextMenuOption.svelte | 7 +++++++ tests/ContextMenu.test.svelte | 1 + types/ContextMenu/ContextMenuOption.d.ts | 6 ++++++ 6 files changed, 27 insertions(+) diff --git a/COMPONENT_INDEX.md b/COMPONENT_INDEX.md index 6ed4788d..79f942c5 100644 --- a/COMPONENT_INDEX.md +++ b/COMPONENT_INDEX.md @@ -800,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>) | diff --git a/docs/src/COMPONENT_API.json b/docs/src/COMPONENT_API.json index e1353c54..31b0c9f6 100644 --- a/docs/src/COMPONENT_API.json +++ b/docs/src/COMPONENT_API.json @@ -1656,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", diff --git a/docs/src/pages/framed/ContextMenu/ContextMenu.svelte b/docs/src/pages/framed/ContextMenu/ContextMenu.svelte index 8ea32eb9..f2c44d78 100644 --- a/docs/src/pages/framed/ContextMenu/ContextMenu.svelte +++ b/docs/src/pages/framed/ContextMenu/ContextMenu.svelte @@ -42,4 +42,6 @@ + + diff --git a/src/ContextMenu/ContextMenuOption.svelte b/src/ContextMenu/ContextMenuOption.svelte index 8bd17780..a07913ae 100644 --- a/src/ContextMenu/ContextMenuOption.svelte +++ b/src/ContextMenu/ContextMenuOption.svelte @@ -1,4 +1,10 @@