Align v10.48 (#907)

* chore(deps-dev): upgrade carbon-components to v10.48.0

* feat(ui-shell): support HeaderNavMenu with current item

* refactor(tile): remove unnecessary "position: relative" style

* refactor(tile): remove unused ref

* feat(inline-notification): make title/subtitle slottable

Closes #883

* feat(toast-notification): make title/subtitle/caption slottable

* chore(notification): deprecate NotificationTextDetails
This commit is contained in:
Eric Liu 2021-11-12 16:25:02 -08:00 committed by GitHub
commit 27ba4350cf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 128 additions and 40 deletions

View file

@ -14,7 +14,23 @@
/** Obtain a reference to the HTML anchor element */
export let ref = null;
import { setContext } from "svelte";
import { writable } from "svelte/store";
import ChevronDown16 from "../../icons/ChevronDown16.svelte";
const selectedItems = writable({});
setContext("HeaderNavMenu", {
updateSelectedItems(item) {
selectedItems.update((_items) => ({
..._items,
[item.id]: item.isSelected,
}));
},
});
$: isCurrentSubmenu =
Object.values($selectedItems).filter(Boolean).length > 0;
</script>
<svelte:window
@ -29,7 +45,10 @@
}}"
/>
<li class:bx--header__submenu="{true}">
<li
class:bx--header__submenu="{true}"
class:bx--header__submenu--current="{isCurrentSubmenu}"
>
<a
bind:this="{ref}"
role="menuitem"
@ -41,6 +60,7 @@
class:bx--header__menu-item="{true}"
class:bx--header__menu-title="{true}"
{...$$restProps}
style="{$$restProps.style}; z-index: 1"
on:keydown
on:keydown="{({ key }) => {
if (key === 'Enter') {