menu.js 498 B

12345678910111213141516171819202122
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports["default"] = getImplicitRoleForMenu;
  6. var _jsxAstUtils = require("jsx-ast-utils");
  7. /**
  8. * Returns the implicit role for a menu tag.
  9. */
  10. function getImplicitRoleForMenu(attributes) {
  11. var type = (0, _jsxAstUtils.getProp)(attributes, 'type');
  12. if (type) {
  13. var value = (0, _jsxAstUtils.getLiteralPropValue)(type);
  14. return value && value.toUpperCase() === 'TOOLBAR' ? 'toolbar' : '';
  15. }
  16. return '';
  17. }