mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-18 11:36:36 +00:00
fix(ui-shell): deprecate ariaLabel prop in HeaderNav
- remove menubar role from HeaderNav - obtain "aria-label" and "aria-labelledby" from $$props
This commit is contained in:
parent
681bd38f52
commit
b1b483472f
1 changed files with 8 additions and 6 deletions
|
@ -1,17 +1,19 @@
|
||||||
<script>
|
<script>
|
||||||
/**
|
/**
|
||||||
* Specify the ARIA label for the nav
|
* Specify the ARIA label for the nav
|
||||||
|
* @deprecated use "aria-label" instead
|
||||||
* @type {string}
|
* @type {string}
|
||||||
*/
|
*/
|
||||||
export let ariaLabel = undefined;
|
export let ariaLabel = undefined;
|
||||||
|
|
||||||
|
$: props = {
|
||||||
|
"aria-label": ariaLabel || $$props["aria-label"],
|
||||||
|
"aria-labelledby": $$props["aria-labelledby"],
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<nav aria-label="{ariaLabel}" class:bx--header__nav="{true}" {...$$restProps}>
|
<nav {...props} class:bx--header__nav="{true}" {...$$restProps}>
|
||||||
<ul
|
<ul {...props} class:bx--header__menu-bar="{true}">
|
||||||
role="menubar"
|
|
||||||
aria-label="{ariaLabel}"
|
|
||||||
class:bx--header__menu-bar="{true}"
|
|
||||||
>
|
|
||||||
<slot />
|
<slot />
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue