d2-ui
Version:
18 lines (13 loc) • 433 B
JavaScript
import getAttribute from '../getAttribute';
import { getLiteralAttributeValue } from '../getAttributeValue';
/**
* Returns the implicit role for a menu tag.
*/
export default function getImplicitRoleForMenu(attributes) {
const type = getAttribute(attributes, 'type');
if (type) {
const value = getLiteralAttributeValue(type);
return (value && value.toUpperCase() === 'TOOLBAR') ? 'toolbar' : '';
}
return '';
}