fix(ui-shell): remove iconDescription prop from HeaderNavMenu #566

Fixes #566
This commit is contained in:
Eric Y Liu 2021-03-20 16:18:52 -07:00
commit db3e84b0e5
4 changed files with 8 additions and 31 deletions

View file

@ -1663,12 +1663,11 @@ None.
### Props ### Props
| Prop name | Kind | Reactive | Type | Default value | Description | | Prop name | Kind | Reactive | Type | Default value | Description |
| :-------------- | :--------------- | :------- | :----------------------------------------- | ------------------------------ | --------------------------------------------- | | :-------- | :--------------- | :------- | :----------------------------------------- | ------------------ | --------------------------------------------- |
| ref | <code>let</code> | Yes | <code>null &#124; HTMLAnchorElement</code> | <code>null</code> | Obtain a reference to the HTML anchor element | | ref | <code>let</code> | Yes | <code>null &#124; HTMLAnchorElement</code> | <code>null</code> | Obtain a reference to the HTML anchor element |
| expanded | <code>let</code> | Yes | <code>boolean</code> | <code>false</code> | Set to `true` to toggle the expanded state | | expanded | <code>let</code> | Yes | <code>boolean</code> | <code>false</code> | Set to `true` to toggle the expanded state |
| href | <code>let</code> | No | <code>string</code> | <code>"/"</code> | Specify the `href` attribute | | href | <code>let</code> | No | <code>string</code> | <code>"/"</code> | Specify the `href` attribute |
| text | <code>let</code> | No | <code>string</code> | -- | Specify the text | | text | <code>let</code> | No | <code>string</code> | -- | Specify the text |
| iconDescription | <code>let</code> | No | <code>string</code> | <code>"Expand/Collapse"</code> | Specify the ARIA label for the chevron icon |
### Slots ### Slots

View file

@ -4057,16 +4057,6 @@
"isFunction": false, "isFunction": false,
"constant": false, "constant": false,
"reactive": true "reactive": true
},
{
"name": "iconDescription",
"kind": "let",
"description": "Specify the ARIA label for the chevron icon",
"type": "string",
"value": "\"Expand/Collapse\"",
"isFunction": false,
"constant": false,
"reactive": false
} }
], ],
"slots": [{ "name": "__default__", "default": true, "slot_props": "{}" }], "slots": [{ "name": "__default__", "default": true, "slot_props": "{}" }],

View file

@ -14,9 +14,6 @@
/** Obtain a reference to the HTML anchor element */ /** Obtain a reference to the HTML anchor element */
export let ref = null; export let ref = null;
/** Specify the ARIA label for the chevron icon */
export let iconDescription = "Expand/Collapse";
import ChevronDown16 from "carbon-icons-svelte/lib/ChevronDown16"; import ChevronDown16 from "carbon-icons-svelte/lib/ChevronDown16";
</script> </script>
@ -32,7 +29,7 @@
}}" }}"
/> />
<li class:bx--header__submenu="{true}" title="{iconDescription}"> <li class:bx--header__submenu="{true}">
<a <a
bind:this="{ref}" bind:this="{ref}"
role="menuitem" role="menuitem"
@ -59,10 +56,7 @@
on:blur on:blur
> >
{text} {text}
<ChevronDown16 <ChevronDown16 class="bx--header__menu-arrow" />
aria-label="{iconDescription}"
class="bx--header__menu-arrow"
/>
</a> </a>
<ul role="menu" aria-label="{text}" class:bx--header__menu="{true}"> <ul role="menu" aria-label="{text}" class:bx--header__menu="{true}">
<slot /> <slot />

View file

@ -25,12 +25,6 @@ export interface HeaderNavMenuProps
* @default null * @default null
*/ */
ref?: null | HTMLAnchorElement; ref?: null | HTMLAnchorElement;
/**
* Specify the ARIA label for the chevron icon
* @default "Expand/Collapse"
*/
iconDescription?: string;
} }
export default class HeaderNavMenu extends SvelteComponentTyped< export default class HeaderNavMenu extends SvelteComponentTyped<