diff --git a/COMPONENT_INDEX.md b/COMPONENT_INDEX.md index a152e04f..427030f6 100644 --- a/COMPONENT_INDEX.md +++ b/COMPONENT_INDEX.md @@ -860,11 +860,12 @@ None. ### Slots -| Slot name | Default | Props | Fallback | -| :----------- | :------ | :---- | :-------------------------- | -| -- | Yes | -- | -- | -| labelText | No | -- | {labelText} | -| shortcutText | No | -- | {shortcutText} | +| Slot name | Default | Props | Fallback | +| :----------- | :------ | :---- | :---------------------------------------------------- | +| -- | Yes | -- | -- | +| icon | No | -- | <svelte:component this="{icon}" /> | +| labelText | No | -- | {labelText} | +| shortcutText | No | -- | {shortcutText} | ### Events @@ -1631,6 +1632,8 @@ None. | Slot name | Default | Props | Fallback | | :-------- | :------ | :---- | :---------------------------------------------------------- | | -- | Yes | -- | -- | +| closeIcon | No | -- | <svelte:component this="{closeIcon}" /> | +| icon | No | -- | <svelte:component this="{icon}" /> | | text | No | -- | {#if text}<span>{text}</span>{/if} | ### Events @@ -1653,7 +1656,9 @@ None. ### Slots -None. +| Slot name | Default | Props | Fallback | +| :-------- | :------ | :---- | :---------------------------------------------------- | +| icon | No | -- | <svelte:component this="{icon}" /> | ### Events @@ -2035,9 +2040,10 @@ None. ### Slots -| Slot name | Default | Props | Fallback | -| :-------- | :------ | :---- | :------- | -| -- | Yes | -- | -- | +| Slot name | Default | Props | Fallback | +| :-------- | :------ | :---- | :---------------------------------------------------- | +| -- | Yes | -- | -- | +| icon | No | -- | <svelte:component this="{icon}" /> | ### Events @@ -3436,7 +3442,9 @@ None. ### Slots -None. +| Slot name | Default | Props | Fallback | +| :-------- | :------ | :---- | :---------------------------------------------------- | +| icon | No | -- | <svelte:component this="{icon}" /> | ### Events @@ -3457,9 +3465,10 @@ None. ### Slots -| Slot name | Default | Props | Fallback | -| :-------- | :------ | :---- | :------- | -| -- | Yes | -- | -- | +| Slot name | Default | Props | Fallback | +| :-------- | :------ | :---- | :---------------------------------------------------- | +| -- | Yes | -- | -- | +| icon | No | -- | <svelte:component this="{icon}" /> | ### Events @@ -4068,9 +4077,10 @@ None. ### Slots -| Slot name | Default | Props | Fallback | -| :-------- | :------ | :----------------------------------------------------- | :------- | -| -- | Yes | { props: { class: 'bx--tag\_\_label' } } | -- | +| Slot name | Default | Props | Fallback | +| :-------- | :------ | :----------------------------------------------------- | :---------------------------------------------------- | +| -- | Yes | { props: { class: 'bx--tag\_\_label' } } | -- | +| icon | No | -- | <svelte:component this="{icon}" /> | ### Events diff --git a/docs/src/COMPONENT_API.json b/docs/src/COMPONENT_API.json index 5505675e..eb5eda97 100644 --- a/docs/src/COMPONENT_API.json +++ b/docs/src/COMPONENT_API.json @@ -2075,6 +2075,12 @@ "moduleExports": [], "slots": [ { "name": "__default__", "default": true, "slot_props": "{}" }, + { + "name": "icon", + "default": false, + "fallback": "", + "slot_props": "{}" + }, { "name": "labelText", "default": false, @@ -4621,6 +4627,18 @@ "moduleExports": [], "slots": [ { "name": "__default__", "default": true, "slot_props": "{}" }, + { + "name": "closeIcon", + "default": false, + "fallback": "", + "slot_props": "{}" + }, + { + "name": "icon", + "default": false, + "fallback": "", + "slot_props": "{}" + }, { "name": "text", "default": false, @@ -4683,7 +4701,14 @@ } ], "moduleExports": [], - "slots": [], + "slots": [ + { + "name": "icon", + "default": false, + "fallback": "", + "slot_props": "{}" + } + ], "events": [], "typedefs": [], "rest_props": { "type": "Element", "name": "a" } @@ -5507,7 +5532,15 @@ } ], "moduleExports": [], - "slots": [{ "name": "__default__", "default": true, "slot_props": "{}" }], + "slots": [ + { "name": "__default__", "default": true, "slot_props": "{}" }, + { + "name": "icon", + "default": false, + "fallback": "", + "slot_props": "{}" + } + ], "events": [ { "type": "forwarded", "name": "click", "element": "p" }, { "type": "forwarded", "name": "mouseover", "element": "p" }, @@ -10117,7 +10150,14 @@ } ], "moduleExports": [], - "slots": [], + "slots": [ + { + "name": "icon", + "default": false, + "fallback": "", + "slot_props": "{}" + } + ], "events": [{ "type": "forwarded", "name": "click", "element": "a" }], "typedefs": [], "rest_props": { "type": "Element", "name": "a" } @@ -10170,7 +10210,15 @@ } ], "moduleExports": [], - "slots": [{ "name": "__default__", "default": true, "slot_props": "{}" }], + "slots": [ + { "name": "__default__", "default": true, "slot_props": "{}" }, + { + "name": "icon", + "default": false, + "fallback": "", + "slot_props": "{}" + } + ], "events": [{ "type": "forwarded", "name": "click", "element": "button" }], "typedefs": [], "rest_props": { "type": "Element", "name": "button" } @@ -11546,6 +11594,12 @@ "name": "__default__", "default": true, "slot_props": "{ props: { class: 'bx--tag__label' } }" + }, + { + "name": "icon", + "default": false, + "fallback": "", + "slot_props": "{}" } ], "events": [ diff --git a/src/ContextMenu/ContextMenuOption.svelte b/src/ContextMenu/ContextMenuOption.svelte index 6cd3e833..d67caa80 100644 --- a/src/ContextMenu/ContextMenuOption.svelte +++ b/src/ContextMenu/ContextMenuOption.svelte @@ -245,7 +245,9 @@ > {#if indented}
- + + +
{/if} @@ -268,7 +270,9 @@ > {#if indented}
- + + +
{/if} diff --git a/src/Link/Link.svelte b/src/Link/Link.svelte index 0da97518..65732cc4 100644 --- a/src/Link/Link.svelte +++ b/src/Link/Link.svelte @@ -45,9 +45,14 @@ on:mouseenter on:mouseleave > - {#if !inline && icon}
- -
{/if} + + {#if !inline && ($$slots.icon || icon)} +
+ + + +
+ {/if}

{:else} {#if !inline && icon}
- -
{/if}
+ + {#if !inline && ($$slots.icon || icon)} +
+ + + +
+ {/if} + {/if} diff --git a/src/Tag/Tag.svelte b/src/Tag/Tag.svelte index a7174d95..3862b1a6 100644 --- a/src/Tag/Tag.svelte +++ b/src/Tag/Tag.svelte @@ -120,9 +120,11 @@ on:mouseenter on:mouseleave > - {#if icon} + {#if $$slots.icon || icon}
- + + +
{/if} @@ -153,9 +155,11 @@ on:mouseenter on:mouseleave > - {#if icon} + {#if $$slots.icon || icon}
- + + +
{/if} diff --git a/src/UIShell/GlobalHeader/HeaderAction.svelte b/src/UIShell/GlobalHeader/HeaderAction.svelte index 34197d1a..fdf8958e 100644 --- a/src/UIShell/GlobalHeader/HeaderAction.svelte +++ b/src/UIShell/GlobalHeader/HeaderAction.svelte @@ -64,9 +64,13 @@ }}" > {#if isOpen} - + + + {:else} - + + + {/if} {#if text}{text}{/if} diff --git a/src/UIShell/GlobalHeader/HeaderActionLink.svelte b/src/UIShell/GlobalHeader/HeaderActionLink.svelte index 508594e2..3283b398 100644 --- a/src/UIShell/GlobalHeader/HeaderActionLink.svelte +++ b/src/UIShell/GlobalHeader/HeaderActionLink.svelte @@ -26,7 +26,9 @@ rel="{$$restProps.target === '_blank' ? 'noopener noreferrer' : undefined}" {...$$restProps} > - + + +