New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-aria

Package Overview
Dependencies
Maintainers
1
Versions
852
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-aria - npm Package Compare versions

Comparing version 0.4.0 to 0.5.0

lib/Manager.js

5

CHANGELOG.md
## CHANGELOG
### 0.5.0
Removed `Aria` prefix from each component name
Added the ability to include `node_modules/react-aria/Menu` and `node_modules/react-aria/Tabs` if you don't need the kitchen sink
### 0.4.0

@@ -3,0 +8,0 @@ Trying to fix yarn add

1388

dist/react-aria.js
/*!
* React Aria 0.4.0
* React Aria 0.5.0
* https://github.com/souporserious/react-aria

@@ -8,10 +8,10 @@ * Copyright (c) 2016 React Aria Authors

if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory(require("react"), require("focus-group"), require("no-scroll"), require("teeny-tap"), require("react-dom"), require("focus-trap"));
module.exports = factory(require("react"), require("react-dom"), require("focus-trap"), require("focus-group"), require("no-scroll"), require("teeny-tap"));
else if(typeof define === 'function' && define.amd)
define(["react", "focus-group", "no-scroll", "teeny-tap", "react-dom", "focus-trap"], factory);
define(["react", "react-dom", "focus-trap", "focus-group", "no-scroll", "teeny-tap"], factory);
else if(typeof exports === 'object')
exports["ReactARIA"] = factory(require("react"), require("focus-group"), require("no-scroll"), require("teeny-tap"), require("react-dom"), require("focus-trap"));
exports["ReactARIA"] = factory(require("react"), require("react-dom"), require("focus-trap"), require("focus-group"), require("no-scroll"), require("teeny-tap"));
else
root["ReactARIA"] = factory(root["React"], root["createFocusGroup"], root["noScroll"], root["createTapListener"], root["ReactDOM"], root["focusTrap"]);
})(this, function(__WEBPACK_EXTERNAL_MODULE_2__, __WEBPACK_EXTERNAL_MODULE_3__, __WEBPACK_EXTERNAL_MODULE_4__, __WEBPACK_EXTERNAL_MODULE_6__, __WEBPACK_EXTERNAL_MODULE_9__, __WEBPACK_EXTERNAL_MODULE_11__) {
root["ReactARIA"] = factory(root["React"], root["ReactDOM"], root["focusTrap"], root["createFocusGroup"], root["noScroll"], root["createTapListener"]);
})(this, function(__WEBPACK_EXTERNAL_MODULE_3__, __WEBPACK_EXTERNAL_MODULE_4__, __WEBPACK_EXTERNAL_MODULE_7__, __WEBPACK_EXTERNAL_MODULE_14__, __WEBPACK_EXTERNAL_MODULE_15__, __WEBPACK_EXTERNAL_MODULE_17__) {
return /******/ (function(modules) { // webpackBootstrap

@@ -68,54 +68,36 @@ /******/ // The module cache

});
exports.AriaPanel = exports.AriaTab = exports.AriaTabList = exports.AriaItem = exports.AriaPopover = exports.AriaToggle = exports.AriaManager = undefined;
exports.Manager = undefined;
var _AriaManager2 = __webpack_require__(1);
var _Menu = __webpack_require__(1);
var _AriaManager3 = _interopRequireDefault(_AriaManager2);
Object.keys(_Menu).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function get() {
return _Menu[key];
}
});
});
var _AriaToggle2 = __webpack_require__(8);
var _Tabs = __webpack_require__(9);
var _AriaToggle3 = _interopRequireDefault(_AriaToggle2);
Object.keys(_Tabs).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function get() {
return _Tabs[key];
}
});
});
var _AriaPopover2 = __webpack_require__(10);
var _Manager2 = __webpack_require__(13);
var _AriaPopover3 = _interopRequireDefault(_AriaPopover2);
var _Manager3 = _interopRequireDefault(_Manager2);
var _AriaItem2 = __webpack_require__(12);
var _AriaItem3 = _interopRequireDefault(_AriaItem2);
var _AriaTabList2 = __webpack_require__(13);
var _AriaTabList3 = _interopRequireDefault(_AriaTabList2);
var _AriaTab2 = __webpack_require__(14);
var _AriaTab3 = _interopRequireDefault(_AriaTab2);
var _AriaPanel2 = __webpack_require__(15);
var _AriaPanel3 = _interopRequireDefault(_AriaPanel2);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.AriaManager = _AriaManager3.default;
exports.AriaToggle = _AriaToggle3.default;
exports.AriaPopover = _AriaPopover3.default;
exports.AriaItem = _AriaItem3.default;
exports.AriaTabList = _AriaTabList3.default;
exports.AriaTab = _AriaTab3.default;
exports.AriaPanel = _AriaPanel3.default;
exports.Manager = _Manager3.default;
// rename
// export Manager from './Manager'
// export Toggle from './Toggle'
// export Popover from './Popover'
// export Item from './Item'
// export TabList from './TabList'
// export Tab from './Tab'
// export Panel from './Panel'
// usage
// <Aria.Manager/> || <Manager/>
/***/ },

@@ -130,461 +112,24 @@ /* 1 */

});
exports.Item = exports.Popover = exports.Toggle = undefined;
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _Toggle2 = __webpack_require__(2);
var _react = __webpack_require__(2);
var _Toggle3 = _interopRequireDefault(_Toggle2);
var _react2 = _interopRequireDefault(_react);
var _Popover2 = __webpack_require__(6);
var _focusGroup = __webpack_require__(3);
var _Popover3 = _interopRequireDefault(_Popover2);
var _focusGroup2 = _interopRequireDefault(_focusGroup);
var _Item2 = __webpack_require__(8);
var _noScroll = __webpack_require__(4);
var _Item3 = _interopRequireDefault(_Item2);
var _noScroll2 = _interopRequireDefault(_noScroll);
var _eventsHandler = __webpack_require__(5);
var _eventsHandler2 = _interopRequireDefault(_eventsHandler);
var _specialAssign = __webpack_require__(7);
var _specialAssign2 = _interopRequireDefault(_specialAssign);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
exports.Toggle = _Toggle3.default;
exports.Popover = _Popover3.default;
exports.Item = _Item3.default;
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var isTarget = function isTarget(node, target) {
return node === target || node.contains(target);
};
var KEYS = {
tab: 9,
escape: 27,
end: 35,
home: 36,
arrowLeft: 37,
arrowUp: 38,
arrowRight: 39,
arrowDown: 40
};
var checkedProps = {
type: _react.PropTypes.oneOf(['menu', 'popover', 'modal', 'tooltip', 'alert', 'tabs', 'accordion']).isRequired,
tag: _react.PropTypes.string,
trapFocus: _react.PropTypes.bool,
freezeScroll: _react.PropTypes.bool,
activeTabId: _react.PropTypes.oneOfType([_react.PropTypes.string, _react.PropTypes.number]),
children: _react.PropTypes.oneOfType([_react.PropTypes.func, _react.PropTypes.node]).isRequired,
keybindings: _react.PropTypes.shape({
next: _react.PropTypes.oneOfType([_react.PropTypes.object, _react.PropTypes.array]),
prev: _react.PropTypes.oneOfType([_react.PropTypes.object, _react.PropTypes.array]),
first: _react.PropTypes.oneOfType([_react.PropTypes.object, _react.PropTypes.array]),
last: _react.PropTypes.oneOfType([_react.PropTypes.object, _react.PropTypes.array])
}),
wrap: _react.PropTypes.bool,
stringSearch: _react.PropTypes.bool,
stringSearchDelay: _react.PropTypes.number,
collapsible: _react.PropTypes.bool,
openPopoverOn: _react.PropTypes.oneOf(['tap', 'hover']),
closeOnOutsideClick: _react.PropTypes.bool,
closeOnItemSelection: _react.PropTypes.bool,
accordion: _react.PropTypes.bool,
onPopoverOpen: _react.PropTypes.func,
onPopoverClose: _react.PropTypes.func,
onItemSelection: _react.PropTypes.func
};
var AriaManager = function (_Component) {
_inherits(AriaManager, _Component);
function AriaManager(props) {
_classCallCheck(this, AriaManager);
var _this = _possibleConstructorReturn(this, (AriaManager.__proto__ || Object.getPrototypeOf(AriaManager)).call(this, props));
_this._onItemSelection = function (item, e) {
var value = item.value || item.node.innerHTML;
if (_this.props.closeOnItemSelection) {
_this.closePopover();
}
_this.props.onItemSelection(value, e);
};
_this._setToggleNode = function (node) {
_this._toggle = node;
};
_this._setPopoverNode = function (node) {
_this._popover = node;
};
_this._addMember = function (member) {
var activeTabId = _this.props.activeTabId;
var id = member.id;
var index = member.index;
var node = member.node;
var text = member.text;
if (index === undefined) {
_this._members.push(member);
} else {
_this._members.splice(index, 0, member);
}
_this._focusGroup.addMember({
node: node,
text: text || node.innerHTML
});
if (member.type === 'tab') {
if (activeTabId === id) {
_this._activateTab(activeTabId, true, false);
} else {
_this._handleFirstTabSelection(id);
}
}
};
_this._removeMember = function (member) {
var pos = _this._members.indexOf(member);
if (pos > -1) {
_this._members.splice(member, 1);
_this._focusGroup.removeMember(member.node);
}
};
_this._focusItem = function (index) {
_this._focusGroup.focusNodeAtIndex(index);
};
_this.openPopover = function () {
var focusFirstMember = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
var _this$props = _this.props;
var freezeScroll = _this$props.freezeScroll;
var onPopoverOpen = _this$props.onPopoverOpen;
if (_this.state.isPopoverOpen) return;
_this.setState({ isPopoverOpen: true });
if (freezeScroll) {
_noScroll2.default.on();
}
onPopoverOpen();
if (focusFirstMember) {
setTimeout(function () {
_this._focusItem(0);
}, 60);
}
};
_this.closePopover = function () {
var focusToggle = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
var _this$props2 = _this.props;
var freezeScroll = _this$props2.freezeScroll;
var onPopoverClose = _this$props2.onPopoverClose;
if (!_this.state.isPopoverOpen) return;
_this.setState({ isPopoverOpen: false });
if (freezeScroll) {
_noScroll2.default.off();
}
onPopoverClose();
if (focusToggle) {
setTimeout(function () {
_this._toggle.focus();
}, 60);
}
};
_this.togglePopover = function (focus) {
if (!_this.state.isPopoverOpen) {
_this.openPopover(focus);
} else {
_this.closePopover(focus);
}
};
_this._addPanel = function (panel) {
var activeTabId = _this.props.activeTabId;
var controlledBy = panel.controlledBy;
_this._panels.push(panel);
if (activeTabId === controlledBy) {
_this._activateTab(activeTabId, true, false);
} else {
_this._handleFirstTabSelection(panel.controlledBy);
}
};
_this._focusTab = function (id) {
var tabToFocus = _this._members.filter(function (tab) {
return tab.id === id;
});
if (tabToFocus) {
tabToFocus.node.focus();
}
};
_this._activateTab = function (id, forceActivate) {
var shouldChange = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
var _this$props3 = _this.props;
var type = _this$props3.type;
var onChange = _this$props3.onChange;
if (type === 'tabs') {
if (id === _this._activeTabId && !forceActivate) {
return;
} else {
_this._activeTabId = id;
}
}
// shouldChange makes sure we don't fire callbacks when we don't need to
if (shouldChange && typeof onChange === 'function') {
onChange(id);
// if onChange is being used we don't need to go any farther since the
// user is now controlling state
return;
}
for (var i = _this._members.length; i--;) {
var tab = _this._members[i];
if (type === 'accordion') {
if (tab.id === id) {
tab.toggleActiveState();
}
} else {
tab.setActiveState(id === tab.id);
}
}
for (var _i = _this._panels.length; _i--;) {
var panel = _this._panels[_i];
if (type === 'accordion') {
if (panel.controlledBy === id) {
panel.toggleActiveState();
}
} else {
panel.setActiveState(id === panel.controlledBy);
}
}
};
_this.state = {
isPopoverOpen: false
};
_this._focusGroup = (0, _focusGroup2.default)(props);
_this._toggle = null;
_this._popover = null;
_this._members = [];
_this._panels = [];
_this._activeTabId = props.activeTabId;
_this._uuid = 'RA' + Math.abs(~~(Math.random() * new Date()));
return _this;
}
_createClass(AriaManager, [{
key: 'getChildContext',
value: function getChildContext() {
return {
ariaManager: {
uuid: this._uuid,
type: this.props.type,
trapFocus: this.props.trapFocus,
initialFocus: this.props.initialFocus,
isPopoverOpen: this.state.isPopoverOpen,
onItemSelection: this._onItemSelection,
setToggleNode: this._setToggleNode,
setPopoverNode: this._setPopoverNode,
addMember: this._addMember,
addPanel: this._addPanel,
removeMember: this._removeMember,
activateTab: this._activateTab,
focusItem: this._focusItem,
openPopover: this.openPopover,
closePopover: this.closePopover,
togglePopover: this.togglePopover
}
};
}
}, {
key: 'componentWillMount',
value: function componentWillMount() {
this._focusGroup.activate();
_eventsHandler2.default.add(this);
}
}, {
key: 'componentWillUnmount',
value: function componentWillUnmount() {
this._focusGroup.deactivate();
_eventsHandler2.default.remove(this);
}
}, {
key: '_onTap',
value: function _onTap(e) {
if (this.props.openPopoverOn === 'tap') {
this._handleTapOrHover(e);
}
}
}, {
key: '_onHover',
value: function _onHover(e) {
if (this.props.openPopoverOn === 'hover') {
this._handleTapOrHover(e);
}
}
}, {
key: '_handleTapOrHover',
value: function _handleTapOrHover(e) {
var _props = this.props;
var openPopoverOn = _props.openPopoverOn;
var closeOnOutsideClick = _props.closeOnOutsideClick;
var target = e.target;
if (this._toggle) {
var toggleDisabled = this._toggle.getAttribute('disabled');
if (isTarget(this._toggle, target) && toggleDisabled === null) {
if (openPopoverOn === 'tap') {
this.togglePopover(false);
} else {
this.openPopover(false);
}
return;
} else if (closeOnOutsideClick && this._popover && !isTarget(this._popover, target)) {
this.closePopover(false);
return;
}
}
for (var i = this._members.length; i--;) {
var member = this._members[i];
if (member.node === target) {
if (member.type === 'item') {
this._onItemSelection(member, e);
} else {
this._activateTab(member.id);
}
return;
}
}
}
}, {
key: '_onKeyDown',
value: function _onKeyDown(_ref) {
var keyCode = _ref.keyCode;
if (this.state.isPopoverOpen) {
if (!this.props.trapFocus && keyCode === KEYS.tab) {
this.closePopover(false);
} else if (keyCode === KEYS.escape) {
this.closePopover();
}
}
}
}, {
key: '_handleFirstTabSelection',
value: function _handleFirstTabSelection(id) {
if (this.props.type === 'tabs' && !this._activeTabId || id === this._activeTabId) {
this._activateTab(id, true, false);
}
}
}, {
key: 'render',
value: function render() {
var _props2 = this.props;
var tag = _props2.tag;
var children = _props2.children;
var props = (0, _specialAssign2.default)({}, this.props, checkedProps);
if (typeof children === 'function') {
return children(this.state.isPopoverOpen);
}
return (0, _react.createElement)(tag, props, children);
}
}]);
return AriaManager;
}(_react.Component);
AriaManager.childContextTypes = {
ariaManager: _react.PropTypes.object.isRequired
};
AriaManager.propTypes = checkedProps;
AriaManager.defaultProps = {
tag: 'div',
trapFocus: false,
freezeScroll: false,
keybindings: {
next: [{ keyCode: KEYS.arrowDown }, { keyCode: KEYS.arrowRight }],
prev: [{ keyCode: KEYS.arrowUp }, { keyCode: KEYS.arrowLeft }],
first: { keyCode: KEYS.home },
last: { keyCode: KEYS.end }
},
wrap: true,
stringSearch: true,
stringSearchDelay: 600,
collapsible: false,
openPopoverOn: 'tap',
closeOnOutsideClick: true,
closeOnItemSelection: true,
onPopoverOpen: function onPopoverOpen() {
return null;
},
onPopoverClose: function onPopoverClose() {
return null;
},
onItemSelection: function onItemSelection() {
return null;
}
};
exports.default = AriaManager;
module.exports = exports['default'];
/***/ },
/* 2 */
/***/ function(module, exports) {
module.exports = __WEBPACK_EXTERNAL_MODULE_2__;
/***/ },
/* 3 */
/***/ function(module, exports) {
module.exports = __WEBPACK_EXTERNAL_MODULE_3__;
/***/ },
/* 4 */
/***/ function(module, exports) {
module.exports = __WEBPACK_EXTERNAL_MODULE_4__;
/***/ },
/* 5 */
/***/ function(module, exports, __webpack_require__) {

@@ -598,99 +143,13 @@

var _teenyTap = __webpack_require__(6);
var _teenyTap2 = _interopRequireDefault(_teenyTap);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = {
_queue: [],
add: function add(component) {
this._queue.push(component);
// attach listeners if this was the first component added
if (this._queue.length === 1) {
this._attachListeners();
}
},
remove: function remove(component) {
var pos = this._queue.indexOf(component);
if (pos > -1) {
this._queue.splice(pos, 1);
}
// detach listeners if this was the last component removed
if (this._queue.length <= 0) {
this._detachListeners();
}
},
_attachListeners: function _attachListeners() {
this._tapListener = (0, _teenyTap2.default)(document.documentElement, this._documentEvent.bind(this, '_onTap'));
document.addEventListener('mouseover', this._documentEvent.bind(this, '_onHover'));
document.addEventListener('keydown', this._documentEvent.bind(this, '_onKeyDown'));
},
_detachListeners: function _detachListeners() {
this._tapListener.remove();
document.removeEventListener('mouseover', this._documentEvent);
document.removeEventListener('keydown', this._documentEvent);
},
_documentEvent: function _documentEvent(method, e) {
for (var i = this._queue.length; i--;) {
this._queue[i][method](e);
}
}
};
module.exports = exports['default'];
/***/ },
/* 6 */
/***/ function(module, exports) {
module.exports = __WEBPACK_EXTERNAL_MODULE_6__;
/***/ },
/* 7 */
/***/ function(module, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = specialAssign;
function specialAssign(a, b, reserved) {
for (var x in b) {
if (!b.hasOwnProperty(x) || reserved[x]) continue;
a[x] = b[x];
}
return a;
}
module.exports = exports["default"];
/***/ },
/* 8 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _react = __webpack_require__(2);
var _react = __webpack_require__(3);
var _react2 = _interopRequireDefault(_react);
var _reactDom = __webpack_require__(9);
var _reactDom = __webpack_require__(4);
var _reactDom2 = _interopRequireDefault(_reactDom);
var _specialAssign = __webpack_require__(7);
var _specialAssign = __webpack_require__(5);

@@ -712,6 +171,6 @@ var _specialAssign2 = _interopRequireDefault(_specialAssign);

var AriaToggle = function (_Component) {
_inherits(AriaToggle, _Component);
var Toggle = function (_Component) {
_inherits(Toggle, _Component);
function AriaToggle() {
function Toggle() {
var _ref;

@@ -721,3 +180,3 @@

_classCallCheck(this, AriaToggle);
_classCallCheck(this, Toggle);

@@ -728,3 +187,3 @@ for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {

return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = AriaToggle.__proto__ || Object.getPrototypeOf(AriaToggle)).call.apply(_ref, [this].concat(args))), _this), _this._handleKeyDown = function (e) {
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Toggle.__proto__ || Object.getPrototypeOf(Toggle)).call.apply(_ref, [this].concat(args))), _this), _this._handleKeyDown = function (e) {
if (['ArrowUp', 'ArrowDown', ' '].indexOf(e.key) > -1 || _this.props.tag !== 'button' && e.key === 'Enter') {

@@ -743,3 +202,3 @@ if (!_this.context.ariaManager.isPopoverOpen) {

_createClass(AriaToggle, [{
_createClass(Toggle, [{
key: 'componentDidMount',

@@ -788,23 +247,48 @@ value: function componentDidMount() {

return AriaToggle;
return Toggle;
}(_react.Component);
AriaToggle.contextTypes = {
Toggle.contextTypes = {
ariaManager: _react.PropTypes.object.isRequired
};
AriaToggle.propTypes = checkedProps;
AriaToggle.defaultProps = {
Toggle.propTypes = checkedProps;
Toggle.defaultProps = {
tag: 'button'
};
exports.default = AriaToggle;
exports.default = Toggle;
module.exports = exports['default'];
/***/ },
/* 9 */
/* 3 */
/***/ function(module, exports) {
module.exports = __WEBPACK_EXTERNAL_MODULE_9__;
module.exports = __WEBPACK_EXTERNAL_MODULE_3__;
/***/ },
/* 10 */
/* 4 */
/***/ function(module, exports) {
module.exports = __WEBPACK_EXTERNAL_MODULE_4__;
/***/ },
/* 5 */
/***/ function(module, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = specialAssign;
function specialAssign(a, b, reserved) {
for (var x in b) {
if (!b.hasOwnProperty(x) || reserved[x]) continue;
a[x] = b[x];
}
return a;
}
module.exports = exports["default"];
/***/ },
/* 6 */
/***/ function(module, exports, __webpack_require__) {

@@ -820,15 +304,15 @@

var _react = __webpack_require__(2);
var _react = __webpack_require__(3);
var _react2 = _interopRequireDefault(_react);
var _reactDom = __webpack_require__(9);
var _reactDom = __webpack_require__(4);
var _reactDom2 = _interopRequireDefault(_reactDom);
var _focusTrap = __webpack_require__(11);
var _focusTrap = __webpack_require__(7);
var _focusTrap2 = _interopRequireDefault(_focusTrap);
var _specialAssign = __webpack_require__(7);
var _specialAssign = __webpack_require__(5);

@@ -850,12 +334,12 @@ var _specialAssign2 = _interopRequireDefault(_specialAssign);

var AriaPopover = function (_Component) {
_inherits(AriaPopover, _Component);
var Popover = function (_Component) {
_inherits(Popover, _Component);
function AriaPopover() {
_classCallCheck(this, AriaPopover);
function Popover() {
_classCallCheck(this, Popover);
return _possibleConstructorReturn(this, (AriaPopover.__proto__ || Object.getPrototypeOf(AriaPopover)).apply(this, arguments));
return _possibleConstructorReturn(this, (Popover.__proto__ || Object.getPrototypeOf(Popover)).apply(this, arguments));
}
_createClass(AriaPopover, [{
_createClass(Popover, [{
key: 'componentDidMount',

@@ -938,23 +422,23 @@ value: function componentDidMount() {

return AriaPopover;
return Popover;
}(_react.Component);
AriaPopover.contextTypes = {
Popover.contextTypes = {
ariaManager: _react.PropTypes.object.isRequired
};
AriaPopover.propTypes = checkedProps;
AriaPopover.defaultProps = {
Popover.propTypes = checkedProps;
Popover.defaultProps = {
tag: 'div'
};
exports.default = AriaPopover;
exports.default = Popover;
module.exports = exports['default'];
/***/ },
/* 11 */
/* 7 */
/***/ function(module, exports) {
module.exports = __WEBPACK_EXTERNAL_MODULE_11__;
module.exports = __WEBPACK_EXTERNAL_MODULE_7__;
/***/ },
/* 12 */
/* 8 */
/***/ function(module, exports, __webpack_require__) {

@@ -970,11 +454,11 @@

var _react = __webpack_require__(2);
var _react = __webpack_require__(3);
var _react2 = _interopRequireDefault(_react);
var _reactDom = __webpack_require__(9);
var _reactDom = __webpack_require__(4);
var _reactDom2 = _interopRequireDefault(_reactDom);
var _specialAssign = __webpack_require__(7);
var _specialAssign = __webpack_require__(5);

@@ -996,6 +480,6 @@ var _specialAssign2 = _interopRequireDefault(_specialAssign);

var AriaItem = function (_Component) {
_inherits(AriaItem, _Component);
var Item = function (_Component) {
_inherits(Item, _Component);
function AriaItem() {
function Item() {
var _ref;

@@ -1005,3 +489,3 @@

_classCallCheck(this, AriaItem);
_classCallCheck(this, Item);

@@ -1012,3 +496,3 @@ for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {

return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = AriaItem.__proto__ || Object.getPrototypeOf(AriaItem)).call.apply(_ref, [this].concat(args))), _this), _this._handleKeyDown = function (e) {
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Item.__proto__ || Object.getPrototypeOf(Item)).call.apply(_ref, [this].concat(args))), _this), _this._handleKeyDown = function (e) {
var onKeyDown = _this.props.onKeyDown;

@@ -1026,3 +510,3 @@

_createClass(AriaItem, [{
_createClass(Item, [{
key: 'componentDidMount',

@@ -1063,17 +547,17 @@ value: function componentDidMount() {

return AriaItem;
return Item;
}(_react.Component);
AriaItem.contextTypes = {
Item.contextTypes = {
ariaManager: _react.PropTypes.object.isRequired
};
AriaItem.propTypes = checkedProps;
AriaItem.defaultProps = {
Item.propTypes = checkedProps;
Item.defaultProps = {
tag: 'div'
};
exports.default = AriaItem;
exports.default = Item;
module.exports = exports['default'];
/***/ },
/* 13 */
/* 9 */
/***/ function(module, exports, __webpack_require__) {

@@ -1086,10 +570,39 @@

});
exports.TabPanel = exports.Tab = exports.TabList = undefined;
var _TabList2 = __webpack_require__(10);
var _TabList3 = _interopRequireDefault(_TabList2);
var _Tab2 = __webpack_require__(11);
var _Tab3 = _interopRequireDefault(_Tab2);
var _TabPanel2 = __webpack_require__(12);
var _TabPanel3 = _interopRequireDefault(_TabPanel2);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.TabList = _TabList3.default;
exports.Tab = _Tab3.default;
exports.TabPanel = _TabPanel3.default;
/***/ },
/* 10 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _react = __webpack_require__(2);
var _react = __webpack_require__(3);
var _react2 = _interopRequireDefault(_react);
var _specialAssign = __webpack_require__(7);
var _specialAssign = __webpack_require__(5);

@@ -1111,12 +624,12 @@ var _specialAssign2 = _interopRequireDefault(_specialAssign);

var AriaTabList = function (_Component) {
_inherits(AriaTabList, _Component);
var TabList = function (_Component) {
_inherits(TabList, _Component);
function AriaTabList() {
_classCallCheck(this, AriaTabList);
function TabList() {
_classCallCheck(this, TabList);
return _possibleConstructorReturn(this, (AriaTabList.__proto__ || Object.getPrototypeOf(AriaTabList)).apply(this, arguments));
return _possibleConstructorReturn(this, (TabList.__proto__ || Object.getPrototypeOf(TabList)).apply(this, arguments));
}
_createClass(AriaTabList, [{
_createClass(TabList, [{
key: 'render',

@@ -1147,17 +660,17 @@ value: function render() {

return AriaTabList;
return TabList;
}(_react.Component);
AriaTabList.contextTypes = {
TabList.contextTypes = {
ariaManager: _react.PropTypes.object.isRequired
};
AriaTabList.propTypes = checkedProps;
AriaTabList.defaultProps = {
TabList.propTypes = checkedProps;
TabList.defaultProps = {
tag: 'div'
};
exports.default = AriaTabList;
exports.default = TabList;
module.exports = exports['default'];
/***/ },
/* 14 */
/* 11 */
/***/ function(module, exports, __webpack_require__) {

@@ -1173,11 +686,11 @@

var _react = __webpack_require__(2);
var _react = __webpack_require__(3);
var _react2 = _interopRequireDefault(_react);
var _reactDom = __webpack_require__(9);
var _reactDom = __webpack_require__(4);
var _reactDom2 = _interopRequireDefault(_reactDom);
var _specialAssign = __webpack_require__(7);
var _specialAssign = __webpack_require__(5);

@@ -1201,6 +714,6 @@ var _specialAssign2 = _interopRequireDefault(_specialAssign);

var AriaTab = function (_Component) {
_inherits(AriaTab, _Component);
var Tab = function (_Component) {
_inherits(Tab, _Component);
function AriaTab() {
function Tab() {
var _ref;

@@ -1210,3 +723,3 @@

_classCallCheck(this, AriaTab);
_classCallCheck(this, Tab);

@@ -1217,3 +730,3 @@ for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {

return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = AriaTab.__proto__ || Object.getPrototypeOf(AriaTab)).call.apply(_ref, [this].concat(args))), _this), _this.state = {
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Tab.__proto__ || Object.getPrototypeOf(Tab)).call.apply(_ref, [this].concat(args))), _this), _this.state = {
isActive: false

@@ -1257,3 +770,3 @@ }, _this._setActiveState = function (isActive) {

_createClass(AriaTab, [{
_createClass(Tab, [{
key: 'componentDidMount',

@@ -1312,17 +825,17 @@ value: function componentDidMount() {

return AriaTab;
return Tab;
}(_react.Component);
AriaTab.contextTypes = {
Tab.contextTypes = {
ariaManager: _react.PropTypes.object.isRequired
};
AriaTab.propTypes = checkedProps;
AriaTab.defaultProps = {
Tab.propTypes = checkedProps;
Tab.defaultProps = {
tag: 'div'
};
exports.default = AriaTab;
exports.default = Tab;
module.exports = exports['default'];
/***/ },
/* 15 */
/* 12 */
/***/ function(module, exports, __webpack_require__) {

@@ -1340,11 +853,11 @@

var _react = __webpack_require__(2);
var _react = __webpack_require__(3);
var _react2 = _interopRequireDefault(_react);
var _reactDom = __webpack_require__(9);
var _reactDom = __webpack_require__(4);
var _reactDom2 = _interopRequireDefault(_reactDom);
var _specialAssign = __webpack_require__(7);
var _specialAssign = __webpack_require__(5);

@@ -1368,6 +881,6 @@ var _specialAssign2 = _interopRequireDefault(_specialAssign);

var AriaPanel = function (_Component) {
_inherits(AriaPanel, _Component);
var TabPanel = function (_Component) {
_inherits(TabPanel, _Component);
function AriaPanel() {
function TabPanel() {
var _ref;

@@ -1377,3 +890,3 @@

_classCallCheck(this, AriaPanel);
_classCallCheck(this, TabPanel);

@@ -1384,3 +897,3 @@ for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {

return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = AriaPanel.__proto__ || Object.getPrototypeOf(AriaPanel)).call.apply(_ref, [this].concat(args))), _this), _this.state = {
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = TabPanel.__proto__ || Object.getPrototypeOf(TabPanel)).call.apply(_ref, [this].concat(args))), _this), _this.state = {
isActive: false

@@ -1401,3 +914,3 @@ }, _this._setActiveState = function (isActive) {

_createClass(AriaPanel, [{
_createClass(TabPanel, [{
key: 'componentDidMount',

@@ -1446,15 +959,542 @@ value: function componentDidMount() {

return AriaPanel;
return TabPanel;
}(_react.Component);
AriaPanel.contextTypes = {
TabPanel.contextTypes = {
ariaManager: _react.PropTypes.object.isRequired
};
AriaPanel.propTypes = checkedProps;
AriaPanel.defaultProps = {
TabPanel.propTypes = checkedProps;
TabPanel.defaultProps = {
tag: 'div'
};
exports.default = AriaPanel;
exports.default = TabPanel;
module.exports = exports['default'];
/***/ },
/* 13 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _react = __webpack_require__(3);
var _react2 = _interopRequireDefault(_react);
var _focusGroup = __webpack_require__(14);
var _focusGroup2 = _interopRequireDefault(_focusGroup);
var _noScroll = __webpack_require__(15);
var _noScroll2 = _interopRequireDefault(_noScroll);
var _eventsHandler = __webpack_require__(16);
var _eventsHandler2 = _interopRequireDefault(_eventsHandler);
var _specialAssign = __webpack_require__(5);
var _specialAssign2 = _interopRequireDefault(_specialAssign);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var isTarget = function isTarget(node, target) {
return node === target || node.contains(target);
};
var KEYS = {
tab: 9,
escape: 27,
end: 35,
home: 36,
arrowLeft: 37,
arrowUp: 38,
arrowRight: 39,
arrowDown: 40
};
var checkedProps = {
type: _react.PropTypes.oneOf(['menu', 'popover', 'modal', 'tooltip', 'alert', 'tabs', 'accordion']).isRequired,
tag: _react.PropTypes.string,
trapFocus: _react.PropTypes.bool,
freezeScroll: _react.PropTypes.bool,
activeTabId: _react.PropTypes.oneOfType([_react.PropTypes.string, _react.PropTypes.number]),
children: _react.PropTypes.oneOfType([_react.PropTypes.func, _react.PropTypes.node]).isRequired,
keybindings: _react.PropTypes.shape({
next: _react.PropTypes.oneOfType([_react.PropTypes.object, _react.PropTypes.array]),
prev: _react.PropTypes.oneOfType([_react.PropTypes.object, _react.PropTypes.array]),
first: _react.PropTypes.oneOfType([_react.PropTypes.object, _react.PropTypes.array]),
last: _react.PropTypes.oneOfType([_react.PropTypes.object, _react.PropTypes.array])
}),
wrap: _react.PropTypes.bool,
stringSearch: _react.PropTypes.bool,
stringSearchDelay: _react.PropTypes.number,
collapsible: _react.PropTypes.bool,
openPopoverOn: _react.PropTypes.oneOf(['tap', 'hover']),
closeOnOutsideClick: _react.PropTypes.bool,
closeOnItemSelection: _react.PropTypes.bool,
accordion: _react.PropTypes.bool,
onPopoverOpen: _react.PropTypes.func,
onPopoverClose: _react.PropTypes.func,
onItemSelection: _react.PropTypes.func
};
var Manager = function (_Component) {
_inherits(Manager, _Component);
function Manager(props) {
_classCallCheck(this, Manager);
var _this = _possibleConstructorReturn(this, (Manager.__proto__ || Object.getPrototypeOf(Manager)).call(this, props));
_this._onItemSelection = function (item, e) {
var value = item.value || item.node.innerHTML;
if (_this.props.closeOnItemSelection) {
_this.closePopover();
}
_this.props.onItemSelection(value, e);
};
_this._setToggleNode = function (node) {
_this._toggle = node;
};
_this._setPopoverNode = function (node) {
_this._popover = node;
};
_this._addMember = function (member) {
var activeTabId = _this.props.activeTabId;
var id = member.id;
var index = member.index;
var node = member.node;
var text = member.text;
if (index === undefined) {
_this._members.push(member);
} else {
_this._members.splice(index, 0, member);
}
_this._focusGroup.addMember({
node: node,
text: text || node.innerHTML
});
if (member.type === 'tab') {
if (activeTabId === id) {
_this._activateTab(activeTabId, true, false);
} else {
_this._handleFirstTabSelection(id);
}
}
};
_this._removeMember = function (member) {
var pos = _this._members.indexOf(member);
if (pos > -1) {
_this._members.splice(member, 1);
_this._focusGroup.removeMember(member.node);
}
};
_this._focusItem = function (index) {
_this._focusGroup.focusNodeAtIndex(index);
};
_this.openPopover = function () {
var focusFirstMember = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
var _this$props = _this.props;
var freezeScroll = _this$props.freezeScroll;
var onPopoverOpen = _this$props.onPopoverOpen;
if (_this.state.isPopoverOpen) return;
_this.setState({ isPopoverOpen: true });
if (freezeScroll) {
_noScroll2.default.on();
}
onPopoverOpen();
if (focusFirstMember) {
setTimeout(function () {
_this._focusItem(0);
}, 60);
}
};
_this.closePopover = function () {
var focusToggle = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
var _this$props2 = _this.props;
var freezeScroll = _this$props2.freezeScroll;
var onPopoverClose = _this$props2.onPopoverClose;
if (!_this.state.isPopoverOpen) return;
_this.setState({ isPopoverOpen: false });
if (freezeScroll) {
_noScroll2.default.off();
}
onPopoverClose();
if (focusToggle) {
setTimeout(function () {
_this._toggle.focus();
}, 60);
}
};
_this.togglePopover = function (focus) {
if (!_this.state.isPopoverOpen) {
_this.openPopover(focus);
} else {
_this.closePopover(focus);
}
};
_this._addPanel = function (panel) {
var activeTabId = _this.props.activeTabId;
var controlledBy = panel.controlledBy;
_this._panels.push(panel);
if (activeTabId === controlledBy) {
_this._activateTab(activeTabId, true, false);
} else {
_this._handleFirstTabSelection(panel.controlledBy);
}
};
_this._focusTab = function (id) {
var tabToFocus = _this._members.filter(function (tab) {
return tab.id === id;
});
if (tabToFocus) {
tabToFocus.node.focus();
}
};
_this._activateTab = function (id, forceActivate) {
var shouldChange = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
var _this$props3 = _this.props;
var type = _this$props3.type;
var onChange = _this$props3.onChange;
if (type === 'tabs') {
if (id === _this._activeTabId && !forceActivate) {
return;
} else {
_this._activeTabId = id;
}
}
// shouldChange makes sure we don't fire callbacks when we don't need to
if (shouldChange && typeof onChange === 'function') {
onChange(id);
// if onChange is being used we don't need to go any farther since the
// user is now controlling state
return;
}
for (var i = _this._members.length; i--;) {
var tab = _this._members[i];
if (type === 'accordion') {
if (tab.id === id) {
tab.toggleActiveState();
}
} else {
tab.setActiveState(id === tab.id);
}
}
for (var _i = _this._panels.length; _i--;) {
var panel = _this._panels[_i];
if (type === 'accordion') {
if (panel.controlledBy === id) {
panel.toggleActiveState();
}
} else {
panel.setActiveState(id === panel.controlledBy);
}
}
};
_this.state = {
isPopoverOpen: false
};
_this._focusGroup = (0, _focusGroup2.default)(props);
_this._toggle = null;
_this._popover = null;
_this._members = [];
_this._panels = [];
_this._activeTabId = props.activeTabId;
_this._uuid = 'RA' + Math.abs(~~(Math.random() * new Date()));
return _this;
}
_createClass(Manager, [{
key: 'getChildContext',
value: function getChildContext() {
return {
ariaManager: {
uuid: this._uuid,
type: this.props.type,
trapFocus: this.props.trapFocus,
initialFocus: this.props.initialFocus,
isPopoverOpen: this.state.isPopoverOpen,
onItemSelection: this._onItemSelection,
setToggleNode: this._setToggleNode,
setPopoverNode: this._setPopoverNode,
addMember: this._addMember,
addPanel: this._addPanel,
removeMember: this._removeMember,
activateTab: this._activateTab,
focusItem: this._focusItem,
openPopover: this.openPopover,
closePopover: this.closePopover,
togglePopover: this.togglePopover
}
};
}
}, {
key: 'componentWillMount',
value: function componentWillMount() {
this._focusGroup.activate();
_eventsHandler2.default.add(this);
}
}, {
key: 'componentWillUnmount',
value: function componentWillUnmount() {
this._focusGroup.deactivate();
_eventsHandler2.default.remove(this);
}
}, {
key: '_onTap',
value: function _onTap(e) {
if (this.props.openPopoverOn === 'tap') {
this._handleTapOrHover(e);
}
}
}, {
key: '_onHover',
value: function _onHover(e) {
if (this.props.openPopoverOn === 'hover') {
this._handleTapOrHover(e);
}
}
}, {
key: '_handleTapOrHover',
value: function _handleTapOrHover(e) {
var _props = this.props;
var openPopoverOn = _props.openPopoverOn;
var closeOnOutsideClick = _props.closeOnOutsideClick;
var target = e.target;
if (this._toggle) {
var toggleDisabled = this._toggle.getAttribute('disabled');
if (isTarget(this._toggle, target) && toggleDisabled === null) {
if (openPopoverOn === 'tap') {
this.togglePopover(false);
} else {
this.openPopover(false);
}
return;
} else if (closeOnOutsideClick && this._popover && !isTarget(this._popover, target)) {
this.closePopover(false);
return;
}
}
for (var i = this._members.length; i--;) {
var member = this._members[i];
if (member.node === target) {
if (member.type === 'item') {
this._onItemSelection(member, e);
} else {
this._activateTab(member.id);
}
return;
}
}
}
}, {
key: '_onKeyDown',
value: function _onKeyDown(_ref) {
var keyCode = _ref.keyCode;
if (this.state.isPopoverOpen) {
if (!this.props.trapFocus && keyCode === KEYS.tab) {
this.closePopover(false);
} else if (keyCode === KEYS.escape) {
this.closePopover();
}
}
}
}, {
key: '_handleFirstTabSelection',
value: function _handleFirstTabSelection(id) {
if (this.props.type === 'tabs' && !this._activeTabId || id === this._activeTabId) {
this._activateTab(id, true, false);
}
}
}, {
key: 'render',
value: function render() {
var _props2 = this.props;
var tag = _props2.tag;
var children = _props2.children;
var props = (0, _specialAssign2.default)({}, this.props, checkedProps);
if (typeof children === 'function') {
return children(this.state.isPopoverOpen);
}
return (0, _react.createElement)(tag, props, children);
}
}]);
return Manager;
}(_react.Component);
Manager.childContextTypes = {
ariaManager: _react.PropTypes.object.isRequired
};
Manager.propTypes = checkedProps;
Manager.defaultProps = {
tag: 'div',
trapFocus: false,
freezeScroll: false,
keybindings: {
next: [{ keyCode: KEYS.arrowDown }, { keyCode: KEYS.arrowRight }],
prev: [{ keyCode: KEYS.arrowUp }, { keyCode: KEYS.arrowLeft }],
first: { keyCode: KEYS.home },
last: { keyCode: KEYS.end }
},
wrap: true,
stringSearch: true,
stringSearchDelay: 600,
collapsible: false,
openPopoverOn: 'tap',
closeOnOutsideClick: true,
closeOnItemSelection: true,
onPopoverOpen: function onPopoverOpen() {
return null;
},
onPopoverClose: function onPopoverClose() {
return null;
},
onItemSelection: function onItemSelection() {
return null;
}
};
exports.default = Manager;
module.exports = exports['default'];
/***/ },
/* 14 */
/***/ function(module, exports) {
module.exports = __WEBPACK_EXTERNAL_MODULE_14__;
/***/ },
/* 15 */
/***/ function(module, exports) {
module.exports = __WEBPACK_EXTERNAL_MODULE_15__;
/***/ },
/* 16 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _teenyTap = __webpack_require__(17);
var _teenyTap2 = _interopRequireDefault(_teenyTap);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = {
_queue: [],
add: function add(component) {
this._queue.push(component);
// attach listeners if this was the first component added
if (this._queue.length === 1) {
this._attachListeners();
}
},
remove: function remove(component) {
var pos = this._queue.indexOf(component);
if (pos > -1) {
this._queue.splice(pos, 1);
}
// detach listeners if this was the last component removed
if (this._queue.length <= 0) {
this._detachListeners();
}
},
_attachListeners: function _attachListeners() {
this._tapListener = (0, _teenyTap2.default)(document.documentElement, this._documentEvent.bind(this, '_onTap'));
document.addEventListener('mouseover', this._documentEvent.bind(this, '_onHover'));
document.addEventListener('keydown', this._documentEvent.bind(this, '_onKeyDown'));
},
_detachListeners: function _detachListeners() {
this._tapListener.remove();
document.removeEventListener('mouseover', this._documentEvent);
document.removeEventListener('keydown', this._documentEvent);
},
_documentEvent: function _documentEvent(method, e) {
for (var i = this._queue.length; i--;) {
this._queue[i][method](e);
}
}
};
module.exports = exports['default'];
/***/ },
/* 17 */
/***/ function(module, exports) {
module.exports = __WEBPACK_EXTERNAL_MODULE_17__;
/***/ }

@@ -1461,0 +1501,0 @@ /******/ ])

/*!
* React Aria 0.4.0
* React Aria 0.5.0
* https://github.com/souporserious/react-aria
* Copyright (c) 2016 React Aria Authors
*/
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("focus-group"),require("no-scroll"),require("teeny-tap"),require("react-dom"),require("focus-trap")):"function"==typeof define&&define.amd?define(["react","focus-group","no-scroll","teeny-tap","react-dom","focus-trap"],t):"object"==typeof exports?exports.ReactARIA=t(require("react"),require("focus-group"),require("no-scroll"),require("teeny-tap"),require("react-dom"),require("focus-trap")):e.ReactARIA=t(e.React,e.createFocusGroup,e.noScroll,e.createTapListener,e.ReactDOM,e.focusTrap)}(this,function(e,t,o,r,n,i){return function(e){function t(r){if(o[r])return o[r].exports;var n=o[r]={exports:{},id:r,loaded:!1};return e[r].call(n.exports,n,n.exports,t),n.loaded=!0,n.exports}var o={};return t.m=e,t.c=o,t.p="dist/",t(0)}([function(e,t,o){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0}),t.AriaPanel=t.AriaTab=t.AriaTabList=t.AriaItem=t.AriaPopover=t.AriaToggle=t.AriaManager=void 0;var n=o(1),i=r(n),a=o(8),s=r(a),p=o(10),u=r(p),c=o(12),l=r(c),f=o(13),d=r(f),y=o(14),v=r(y),h=o(15),b=r(h);t.AriaManager=i["default"],t.AriaToggle=s["default"],t.AriaPopover=u["default"],t.AriaItem=l["default"],t.AriaTabList=d["default"],t.AriaTab=v["default"],t.AriaPanel=b["default"]},function(e,t,o){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var o=0;o<t.length;o++){var r=t[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,o,r){return o&&e(t.prototype,o),r&&e(t,r),t}}(),p=o(2),u=(r(p),o(3)),c=r(u),l=o(4),f=r(l),d=o(5),y=r(d),v=o(7),h=r(v),b=function(e,t){return e===t||e.contains(t)},_={tab:9,escape:27,end:35,home:36,arrowLeft:37,arrowUp:38,arrowRight:39,arrowDown:40},P={type:p.PropTypes.oneOf(["menu","popover","modal","tooltip","alert","tabs","accordion"]).isRequired,tag:p.PropTypes.string,trapFocus:p.PropTypes.bool,freezeScroll:p.PropTypes.bool,activeTabId:p.PropTypes.oneOfType([p.PropTypes.string,p.PropTypes.number]),children:p.PropTypes.oneOfType([p.PropTypes.func,p.PropTypes.node]).isRequired,keybindings:p.PropTypes.shape({next:p.PropTypes.oneOfType([p.PropTypes.object,p.PropTypes.array]),prev:p.PropTypes.oneOfType([p.PropTypes.object,p.PropTypes.array]),first:p.PropTypes.oneOfType([p.PropTypes.object,p.PropTypes.array]),last:p.PropTypes.oneOfType([p.PropTypes.object,p.PropTypes.array])}),wrap:p.PropTypes.bool,stringSearch:p.PropTypes.bool,stringSearchDelay:p.PropTypes.number,collapsible:p.PropTypes.bool,openPopoverOn:p.PropTypes.oneOf(["tap","hover"]),closeOnOutsideClick:p.PropTypes.bool,closeOnItemSelection:p.PropTypes.bool,accordion:p.PropTypes.bool,onPopoverOpen:p.PropTypes.func,onPopoverClose:p.PropTypes.func,onItemSelection:p.PropTypes.func},m=function(e){function t(e){n(this,t);var o=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return o._onItemSelection=function(e,t){var r=e.value||e.node.innerHTML;o.props.closeOnItemSelection&&o.closePopover(),o.props.onItemSelection(r,t)},o._setToggleNode=function(e){o._toggle=e},o._setPopoverNode=function(e){o._popover=e},o._addMember=function(e){var t=o.props.activeTabId,r=e.id,n=e.index,i=e.node,a=e.text;void 0===n?o._members.push(e):o._members.splice(n,0,e),o._focusGroup.addMember({node:i,text:a||i.innerHTML}),"tab"===e.type&&(t===r?o._activateTab(t,!0,!1):o._handleFirstTabSelection(r))},o._removeMember=function(e){var t=o._members.indexOf(e);t>-1&&(o._members.splice(e,1),o._focusGroup.removeMember(e.node))},o._focusItem=function(e){o._focusGroup.focusNodeAtIndex(e)},o.openPopover=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=o.props,r=t.freezeScroll,n=t.onPopoverOpen;o.state.isPopoverOpen||(o.setState({isPopoverOpen:!0}),r&&f["default"].on(),n(),e&&setTimeout(function(){o._focusItem(0)},60))},o.closePopover=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=o.props,r=t.freezeScroll,n=t.onPopoverClose;o.state.isPopoverOpen&&(o.setState({isPopoverOpen:!1}),r&&f["default"].off(),n(),e&&setTimeout(function(){o._toggle.focus()},60))},o.togglePopover=function(e){o.state.isPopoverOpen?o.closePopover(e):o.openPopover(e)},o._addPanel=function(e){var t=o.props.activeTabId,r=e.controlledBy;o._panels.push(e),t===r?o._activateTab(t,!0,!1):o._handleFirstTabSelection(e.controlledBy)},o._focusTab=function(e){var t=o._members.filter(function(t){return t.id===e});t&&t.node.focus()},o._activateTab=function(e,t){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=o.props,i=n.type,a=n.onChange;if("tabs"===i){if(e===o._activeTabId&&!t)return;o._activeTabId=e}if(r&&"function"==typeof a)return void a(e);for(var s=o._members.length;s--;){var p=o._members[s];"accordion"===i?p.id===e&&p.toggleActiveState():p.setActiveState(e===p.id)}for(var u=o._panels.length;u--;){var c=o._panels[u];"accordion"===i?c.controlledBy===e&&c.toggleActiveState():c.setActiveState(e===c.controlledBy)}},o.state={isPopoverOpen:!1},o._focusGroup=(0,c["default"])(e),o._toggle=null,o._popover=null,o._members=[],o._panels=[],o._activeTabId=e.activeTabId,o._uuid="RA"+Math.abs(~~(Math.random()*new Date)),o}return a(t,e),s(t,[{key:"getChildContext",value:function(){return{ariaManager:{uuid:this._uuid,type:this.props.type,trapFocus:this.props.trapFocus,initialFocus:this.props.initialFocus,isPopoverOpen:this.state.isPopoverOpen,onItemSelection:this._onItemSelection,setToggleNode:this._setToggleNode,setPopoverNode:this._setPopoverNode,addMember:this._addMember,addPanel:this._addPanel,removeMember:this._removeMember,activateTab:this._activateTab,focusItem:this._focusItem,openPopover:this.openPopover,closePopover:this.closePopover,togglePopover:this.togglePopover}}}},{key:"componentWillMount",value:function(){this._focusGroup.activate(),y["default"].add(this)}},{key:"componentWillUnmount",value:function(){this._focusGroup.deactivate(),y["default"].remove(this)}},{key:"_onTap",value:function(e){"tap"===this.props.openPopoverOn&&this._handleTapOrHover(e)}},{key:"_onHover",value:function(e){"hover"===this.props.openPopoverOn&&this._handleTapOrHover(e)}},{key:"_handleTapOrHover",value:function(e){var t=this.props,o=t.openPopoverOn,r=t.closeOnOutsideClick,n=e.target;if(this._toggle){var i=this._toggle.getAttribute("disabled");if(b(this._toggle,n)&&null===i)return void("tap"===o?this.togglePopover(!1):this.openPopover(!1));if(r&&this._popover&&!b(this._popover,n))return void this.closePopover(!1)}for(var a=this._members.length;a--;){var s=this._members[a];if(s.node===n)return void("item"===s.type?this._onItemSelection(s,e):this._activateTab(s.id))}}},{key:"_onKeyDown",value:function(e){var t=e.keyCode;this.state.isPopoverOpen&&(this.props.trapFocus||t!==_.tab?t===_.escape&&this.closePopover():this.closePopover(!1))}},{key:"_handleFirstTabSelection",value:function(e){("tabs"===this.props.type&&!this._activeTabId||e===this._activeTabId)&&this._activateTab(e,!0,!1)}},{key:"render",value:function(){var e=this.props,t=e.tag,o=e.children,r=(0,h["default"])({},this.props,P);return"function"==typeof o?o(this.state.isPopoverOpen):(0,p.createElement)(t,r,o)}}]),t}(p.Component);m.childContextTypes={ariaManager:p.PropTypes.object.isRequired},m.propTypes=P,m.defaultProps={tag:"div",trapFocus:!1,freezeScroll:!1,keybindings:{next:[{keyCode:_.arrowDown},{keyCode:_.arrowRight}],prev:[{keyCode:_.arrowUp},{keyCode:_.arrowLeft}],first:{keyCode:_.home},last:{keyCode:_.end}},wrap:!0,stringSearch:!0,stringSearchDelay:600,collapsible:!1,openPopoverOn:"tap",closeOnOutsideClick:!0,closeOnItemSelection:!0,onPopoverOpen:function(){return null},onPopoverClose:function(){return null},onItemSelection:function(){return null}},t["default"]=m,e.exports=t["default"]},function(t,o){t.exports=e},function(e,o){e.exports=t},function(e,t){e.exports=o},function(e,t,o){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var n=o(6),i=r(n);t["default"]={_queue:[],add:function(e){this._queue.push(e),1===this._queue.length&&this._attachListeners()},remove:function(e){var t=this._queue.indexOf(e);t>-1&&this._queue.splice(t,1),this._queue.length<=0&&this._detachListeners()},_attachListeners:function(){this._tapListener=(0,i["default"])(document.documentElement,this._documentEvent.bind(this,"_onTap")),document.addEventListener("mouseover",this._documentEvent.bind(this,"_onHover")),document.addEventListener("keydown",this._documentEvent.bind(this,"_onKeyDown"))},_detachListeners:function(){this._tapListener.remove(),document.removeEventListener("mouseover",this._documentEvent),document.removeEventListener("keydown",this._documentEvent)},_documentEvent:function(e,t){for(var o=this._queue.length;o--;)this._queue[o][e](t)}},e.exports=t["default"]},function(e,t){e.exports=r},function(e,t){"use strict";function o(e,t,o){for(var r in t)t.hasOwnProperty(r)&&!o[r]&&(e[r]=t[r]);return e}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=o,e.exports=t["default"]},function(e,t,o){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var o=0;o<t.length;o++){var r=t[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,o,r){return o&&e(t.prototype,o),r&&e(t,r),t}}(),p=o(2),u=(r(p),o(9)),c=(r(u),o(7)),l=r(c),f={tag:p.PropTypes.string,children:p.PropTypes.oneOfType([p.PropTypes.func,p.PropTypes.node]).isRequired},d=function(e){function t(){var e,o,r,a;n(this,t);for(var s=arguments.length,p=Array(s),u=0;u<s;u++)p[u]=arguments[u];return o=r=i(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(p))),r._handleKeyDown=function(e){(["ArrowUp","ArrowDown"," "].indexOf(e.key)>-1||"button"!==r.props.tag&&"Enter"===e.key)&&(r.context.ariaManager.isPopoverOpen?r.context.ariaManager.focusItem(0):r.context.ariaManager.openPopover()),r.props.onKeyDown&&r.props.onKeyDown(e)},a=o,i(r,a)}return a(t,e),s(t,[{key:"componentDidMount",value:function(){this.context.ariaManager.setToggleNode((0,u.findDOMNode)(this))}},{key:"render",value:function(){var e=this.context.ariaManager,t=e.type,o=e.uuid,r=e.isPopoverOpen,n=this.props,i=n.tag,a=n.disabled,s=n.children,u={role:"button",tabIndex:a?"":0,"aria-haspopup":!0,"aria-expanded":r,"aria-disabled":a,onKeyDown:this._handleKeyDown};"popover"===t&&(u.id=o),"tooltip"===t&&(u["aria-describedby"]=o);var c=(0,l["default"])(u,this.props,f);return"function"==typeof s?s(c):(0,p.createElement)(i,c,s)}}]),t}(p.Component);d.contextTypes={ariaManager:p.PropTypes.object.isRequired},d.propTypes=f,d.defaultProps={tag:"button"},t["default"]=d,e.exports=t["default"]},function(e,t){e.exports=n},function(e,t,o){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var o=0;o<t.length;o++){var r=t[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,o,r){return o&&e(t.prototype,o),r&&e(t,r),t}}(),p=o(2),u=(r(p),o(9)),c=(r(u),o(11)),l=r(c),f=o(7),d=r(f),y={tag:p.PropTypes.string,children:p.PropTypes.oneOfType([p.PropTypes.func,p.PropTypes.node]).isRequired},v=function(e){function t(){return n(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,e),s(t,[{key:"componentDidMount",value:function(){var e=this.context.ariaManager,t=e.trapFocus,o=e.initialFocus;e.onClickOutside;this._setPopoverNode(),t&&(this._focusTrap=(0,l["default"])((0,u.findDOMNode)(this),{initialFocus:o,escapeDeactivates:!1,clickOutsideDeactivates:!0}).activate())}},{key:"componentWillUnmount",value:function(){this.context.ariaManager.trapFocus&&this._focusTrap.deactivate()}},{key:"componentDidUpdate",value:function(e,t,o){this.context.ariaManager.isPopoverOpen!==o.ariaManager.isPopoverOpen&&this._setPopoverNode()}},{key:"_setPopoverNode",value:function(){this.context.ariaManager.setPopoverNode((0,u.findDOMNode)(this))}},{key:"render",value:function(){var e=this.context.ariaManager,t=e.type,o=e.uuid,r=e.isPopoverOpen,n=this.props,i=n.tag,a=n.children,s={"aria-hidden":!r};"menu"===t?s.role="menu":"modal"===t?s.role="dialog":"alert"===t?s.role="alertdialog":"tooltip"===t&&(s.id=o,s.role="tooltip"),"popover"===t&&(s["aria-labelledby"]=o);var u=(0,d["default"])(s,this.props,y);return"function"==typeof a?a(u):(0,p.createElement)(i,u,a)}}]),t}(p.Component);v.contextTypes={ariaManager:p.PropTypes.object.isRequired},v.propTypes=y,v.defaultProps={tag:"div"},t["default"]=v,e.exports=t["default"]},function(e,t){e.exports=i},function(e,t,o){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var o=0;o<t.length;o++){var r=t[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,o,r){return o&&e(t.prototype,o),r&&e(t,r),t}}(),p=o(2),u=(r(p),o(9)),c=(r(u),o(7)),l=r(c),f={tag:p.PropTypes.string,children:p.PropTypes.oneOfType([p.PropTypes.func,p.PropTypes.node]).isRequired},d=function(e){function t(){var e,o,r,a;n(this,t);for(var s=arguments.length,p=Array(s),u=0;u<s;u++)p[u]=arguments[u];return o=r=i(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(p))),r._handleKeyDown=function(e){var t=r.props.onKeyDown;[" ","Enter"].indexOf(e.key)>-1&&r.context.ariaManager.onItemSelection(r._member,e),t&&t(e)},a=o,i(r,a)}return a(t,e),s(t,[{key:"componentDidMount",value:function(){this._member={type:"item",node:(0,u.findDOMNode)(this),text:this.props.text},this.context.ariaManager.addMember(this._member)}},{key:"componentWillUnmount",value:function(){this.context.ariaManager.removeMember(this._member)}},{key:"render",value:function(){var e=this.props,t=e.tag,o=e.children,r=(0,l["default"])({role:"menuitem",tabIndex:-1,onKeyDown:this._handleKeyDown},this.props,f);return"function"==typeof o?o(r):(0,p.createElement)(t,r,o)}}]),t}(p.Component);d.contextTypes={ariaManager:p.PropTypes.object.isRequired},d.propTypes=f,d.defaultProps={tag:"div"},t["default"]=d,e.exports=t["default"]},function(e,t,o){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var o=0;o<t.length;o++){var r=t[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,o,r){return o&&e(t.prototype,o),r&&e(t,r),t}}(),p=o(2),u=(r(p),o(7)),c=r(u),l={tag:p.PropTypes.string,children:p.PropTypes.oneOfType([p.PropTypes.func,p.PropTypes.node]).isRequired},f=function(e){function t(){return n(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,e),s(t,[{key:"render",value:function(){var e=this.context.ariaManager.type,t=this.props,o=t.tag,r=t.children,n={role:"tablist"};"accordion"===e&&(n["aria-multiselectable"]=!0);var i=(0,c["default"])(n,this.props,l);return"function"==typeof r?r(i):(0,p.createElement)(o,i,r)}}]),t}(p.Component);f.contextTypes={ariaManager:p.PropTypes.object.isRequired},f.propTypes=l,f.defaultProps={tag:"div"},t["default"]=f,e.exports=t["default"]},function(e,t,o){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var o=0;o<t.length;o++){var r=t[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,o,r){return o&&e(t.prototype,o),r&&e(t,r),t}}(),p=o(2),u=(r(p),o(9)),c=(r(u),o(7)),l=r(c),f={tag:p.PropTypes.string,id:p.PropTypes.oneOfType([p.PropTypes.string,p.PropTypes.number]).isRequired,isActive:p.PropTypes.bool,children:p.PropTypes.oneOfType([p.PropTypes.func,p.PropTypes.node]).isRequired},d=function(e){function t(){var e,o,r,a;n(this,t);for(var s=arguments.length,p=Array(s),u=0;u<s;u++)p[u]=arguments[u];return o=r=i(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(p))),r.state={isActive:!1},r._setActiveState=function(e){r.setState({isActive:e})},r._toggleActiveState=function(){r.setState({isActive:!r.state.isActive})},r._handleKeyDown=function(e){var t=r.context.ariaManager,o=t.type,n=t.activateTab,i=r.props,a=i.id,s=i.onKeyDown;"accordion"===o&&[" ","Enter"].indexOf(e.key)>-1&&n(a),s&&s(e)},r._handleFocus=function(e){var t=r.context.ariaManager,o=t.type,n=t.activateTab,i=r.props,a=i.id,s=i.onFocus;"tabs"===o&&n(a),s&&s(e)},a=o,i(r,a)}return a(t,e),s(t,[{key:"componentDidMount",value:function(){this._member={type:"tab",id:this.props.id,node:(0,u.findDOMNode)(this),text:this.props.text,setActiveState:this._setActiveState,toggleActiveState:this._toggleActiveState},this.context.ariaManager.addMember(this._member)}},{key:"componentWillUnmount",value:function(){this.context.ariaManager.removeMember(this._member)}},{key:"render",value:function(){var e=this.context.ariaManager.type,t=this.props,o=t.tag,r=t.id,n=t.disabled,i=t.children,a=void 0!==this.props.isActive?this.props.isActive:this.state.isActive,s={id:r,role:"tab",tabIndex:"accordion"===e?0:a?0:-1,"aria-selected":a,"aria-controls":r+"-panel","aria-disabled":n,onKeyDown:this._handleKeyDown,onFocus:this._handleFocus};"accordion"===e&&(s["aria-expanded"]=a);var u=(0,l["default"])(s,this.props,f);return"function"==typeof i?i(u,a):(0,p.createElement)(o,u,i)}}]),t}(p.Component);d.contextTypes={ariaManager:p.PropTypes.object.isRequired},d.propTypes=f,d.defaultProps={tag:"div"},t["default"]=d,e.exports=t["default"]},function(e,t,o){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e},p=function(){function e(e,t){for(var o=0;o<t.length;o++){var r=t[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,o,r){return o&&e(t.prototype,o),r&&e(t,r),t}}(),u=o(2),c=(r(u),o(9)),l=(r(c),o(7)),f=r(l),d={tag:u.PropTypes.string,controlledBy:u.PropTypes.oneOfType([u.PropTypes.string,u.PropTypes.number]).isRequired,isActive:u.PropTypes.bool,children:u.PropTypes.oneOfType([u.PropTypes.func,u.PropTypes.node]).isRequired},y=function(e){function t(){var e,o,r,a;n(this,t);for(var s=arguments.length,p=Array(s),u=0;u<s;u++)p[u]=arguments[u];return o=r=i(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(p))),r.state={isActive:!1},r._setActiveState=function(e){r.setState({isActive:e})},r._toggleActiveState=function(){r.setState({isActive:!r.state.isActive})},r._handleKeyDown=function(e){e.ctrlKey&&"ArrowUp"===e.key&&r.context.ariaManager.focusTab(r.props.controlledBy),r.props.onKeyDown&&r.props.onKeyDown(e)},a=o,i(r,a)}return a(t,e),p(t,[{key:"componentDidMount",value:function(){this.context.ariaManager.addPanel({controlledBy:this.props.controlledBy,node:(0,c.findDOMNode)(this),setActiveState:this._setActiveState,toggleActiveState:this._toggleActiveState})}},{key:"render",value:function(){var e=this.props,t=e.tag,o=e.controlledBy,r=(e.disabled,e.children),n=void 0!==this.props.isActive?this.props.isActive:this.state.isActive,i={id:o+"-panel",role:"tabpanel","aria-hidden":!n,"aria-labelledby":o,onKeyDown:this._handleKeyDown};n||(i.style=s({display:"none"},this.props.style));var a=(0,f["default"])(i,this.props,d);return"function"==typeof r?r(a,n):(0,u.createElement)(t,a,r)}}]),t}(u.Component);y.contextTypes={ariaManager:u.PropTypes.object.isRequired},y.propTypes=d,y.defaultProps={tag:"div"},t["default"]=y,e.exports=t["default"]}])});
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom"),require("focus-trap"),require("focus-group"),require("no-scroll"),require("teeny-tap")):"function"==typeof define&&define.amd?define(["react","react-dom","focus-trap","focus-group","no-scroll","teeny-tap"],t):"object"==typeof exports?exports.ReactARIA=t(require("react"),require("react-dom"),require("focus-trap"),require("focus-group"),require("no-scroll"),require("teeny-tap")):e.ReactARIA=t(e.React,e.ReactDOM,e.focusTrap,e.createFocusGroup,e.noScroll,e.createTapListener)}(this,function(e,t,o,n,r,i){return function(e){function t(n){if(o[n])return o[n].exports;var r=o[n]={exports:{},id:n,loaded:!1};return e[n].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var o={};return t.m=e,t.c=o,t.p="dist/",t(0)}([function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0}),t.Manager=void 0;var r=o(1);Object.keys(r).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return r[e]}})});var i=o(9);Object.keys(i).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return i[e]}})});var a=o(13),s=n(a);t.Manager=s["default"]},function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0}),t.Item=t.Popover=t.Toggle=void 0;var r=o(2),i=n(r),a=o(6),s=n(a),p=o(8),u=n(p);t.Toggle=i["default"],t.Popover=s["default"],t.Item=u["default"]},function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,o,n){return o&&e(t.prototype,o),n&&e(t,n),t}}(),p=o(3),u=(n(p),o(4)),c=(n(u),o(5)),l=n(c),f={tag:p.PropTypes.string,children:p.PropTypes.oneOfType([p.PropTypes.func,p.PropTypes.node]).isRequired},d=function(e){function t(){var e,o,n,a;r(this,t);for(var s=arguments.length,p=Array(s),u=0;u<s;u++)p[u]=arguments[u];return o=n=i(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(p))),n._handleKeyDown=function(e){(["ArrowUp","ArrowDown"," "].indexOf(e.key)>-1||"button"!==n.props.tag&&"Enter"===e.key)&&(n.context.ariaManager.isPopoverOpen?n.context.ariaManager.focusItem(0):n.context.ariaManager.openPopover()),n.props.onKeyDown&&n.props.onKeyDown(e)},a=o,i(n,a)}return a(t,e),s(t,[{key:"componentDidMount",value:function(){this.context.ariaManager.setToggleNode((0,u.findDOMNode)(this))}},{key:"render",value:function(){var e=this.context.ariaManager,t=e.type,o=e.uuid,n=e.isPopoverOpen,r=this.props,i=r.tag,a=r.disabled,s=r.children,u={role:"button",tabIndex:a?"":0,"aria-haspopup":!0,"aria-expanded":n,"aria-disabled":a,onKeyDown:this._handleKeyDown};"popover"===t&&(u.id=o),"tooltip"===t&&(u["aria-describedby"]=o);var c=(0,l["default"])(u,this.props,f);return"function"==typeof s?s(c):(0,p.createElement)(i,c,s)}}]),t}(p.Component);d.contextTypes={ariaManager:p.PropTypes.object.isRequired},d.propTypes=f,d.defaultProps={tag:"button"},t["default"]=d,e.exports=t["default"]},function(t,o){t.exports=e},function(e,o){e.exports=t},function(e,t){"use strict";function o(e,t,o){for(var n in t)t.hasOwnProperty(n)&&!o[n]&&(e[n]=t[n]);return e}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=o,e.exports=t["default"]},function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,o,n){return o&&e(t.prototype,o),n&&e(t,n),t}}(),p=o(3),u=(n(p),o(4)),c=(n(u),o(7)),l=n(c),f=o(5),d=n(f),y={tag:p.PropTypes.string,children:p.PropTypes.oneOfType([p.PropTypes.func,p.PropTypes.node]).isRequired},v=function(e){function t(){return r(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,e),s(t,[{key:"componentDidMount",value:function(){var e=this.context.ariaManager,t=e.trapFocus,o=e.initialFocus;e.onClickOutside;this._setPopoverNode(),t&&(this._focusTrap=(0,l["default"])((0,u.findDOMNode)(this),{initialFocus:o,escapeDeactivates:!1,clickOutsideDeactivates:!0}).activate())}},{key:"componentWillUnmount",value:function(){this.context.ariaManager.trapFocus&&this._focusTrap.deactivate()}},{key:"componentDidUpdate",value:function(e,t,o){this.context.ariaManager.isPopoverOpen!==o.ariaManager.isPopoverOpen&&this._setPopoverNode()}},{key:"_setPopoverNode",value:function(){this.context.ariaManager.setPopoverNode((0,u.findDOMNode)(this))}},{key:"render",value:function(){var e=this.context.ariaManager,t=e.type,o=e.uuid,n=e.isPopoverOpen,r=this.props,i=r.tag,a=r.children,s={"aria-hidden":!n};"menu"===t?s.role="menu":"modal"===t?s.role="dialog":"alert"===t?s.role="alertdialog":"tooltip"===t&&(s.id=o,s.role="tooltip"),"popover"===t&&(s["aria-labelledby"]=o);var u=(0,d["default"])(s,this.props,y);return"function"==typeof a?a(u):(0,p.createElement)(i,u,a)}}]),t}(p.Component);v.contextTypes={ariaManager:p.PropTypes.object.isRequired},v.propTypes=y,v.defaultProps={tag:"div"},t["default"]=v,e.exports=t["default"]},function(e,t){e.exports=o},function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,o,n){return o&&e(t.prototype,o),n&&e(t,n),t}}(),p=o(3),u=(n(p),o(4)),c=(n(u),o(5)),l=n(c),f={tag:p.PropTypes.string,children:p.PropTypes.oneOfType([p.PropTypes.func,p.PropTypes.node]).isRequired},d=function(e){function t(){var e,o,n,a;r(this,t);for(var s=arguments.length,p=Array(s),u=0;u<s;u++)p[u]=arguments[u];return o=n=i(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(p))),n._handleKeyDown=function(e){var t=n.props.onKeyDown;[" ","Enter"].indexOf(e.key)>-1&&n.context.ariaManager.onItemSelection(n._member,e),t&&t(e)},a=o,i(n,a)}return a(t,e),s(t,[{key:"componentDidMount",value:function(){this._member={type:"item",node:(0,u.findDOMNode)(this),text:this.props.text},this.context.ariaManager.addMember(this._member)}},{key:"componentWillUnmount",value:function(){this.context.ariaManager.removeMember(this._member)}},{key:"render",value:function(){var e=this.props,t=e.tag,o=e.children,n=(0,l["default"])({role:"menuitem",tabIndex:-1,onKeyDown:this._handleKeyDown},this.props,f);return"function"==typeof o?o(n):(0,p.createElement)(t,n,o)}}]),t}(p.Component);d.contextTypes={ariaManager:p.PropTypes.object.isRequired},d.propTypes=f,d.defaultProps={tag:"div"},t["default"]=d,e.exports=t["default"]},function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0}),t.TabPanel=t.Tab=t.TabList=void 0;var r=o(10),i=n(r),a=o(11),s=n(a),p=o(12),u=n(p);t.TabList=i["default"],t.Tab=s["default"],t.TabPanel=u["default"]},function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,o,n){return o&&e(t.prototype,o),n&&e(t,n),t}}(),p=o(3),u=(n(p),o(5)),c=n(u),l={tag:p.PropTypes.string,children:p.PropTypes.oneOfType([p.PropTypes.func,p.PropTypes.node]).isRequired},f=function(e){function t(){return r(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,e),s(t,[{key:"render",value:function(){var e=this.context.ariaManager.type,t=this.props,o=t.tag,n=t.children,r={role:"tablist"};"accordion"===e&&(r["aria-multiselectable"]=!0);var i=(0,c["default"])(r,this.props,l);return"function"==typeof n?n(i):(0,p.createElement)(o,i,n)}}]),t}(p.Component);f.contextTypes={ariaManager:p.PropTypes.object.isRequired},f.propTypes=l,f.defaultProps={tag:"div"},t["default"]=f,e.exports=t["default"]},function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,o,n){return o&&e(t.prototype,o),n&&e(t,n),t}}(),p=o(3),u=(n(p),o(4)),c=(n(u),o(5)),l=n(c),f={tag:p.PropTypes.string,id:p.PropTypes.oneOfType([p.PropTypes.string,p.PropTypes.number]).isRequired,isActive:p.PropTypes.bool,children:p.PropTypes.oneOfType([p.PropTypes.func,p.PropTypes.node]).isRequired},d=function(e){function t(){var e,o,n,a;r(this,t);for(var s=arguments.length,p=Array(s),u=0;u<s;u++)p[u]=arguments[u];return o=n=i(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(p))),n.state={isActive:!1},n._setActiveState=function(e){n.setState({isActive:e})},n._toggleActiveState=function(){n.setState({isActive:!n.state.isActive})},n._handleKeyDown=function(e){var t=n.context.ariaManager,o=t.type,r=t.activateTab,i=n.props,a=i.id,s=i.onKeyDown;"accordion"===o&&[" ","Enter"].indexOf(e.key)>-1&&r(a),s&&s(e)},n._handleFocus=function(e){var t=n.context.ariaManager,o=t.type,r=t.activateTab,i=n.props,a=i.id,s=i.onFocus;"tabs"===o&&r(a),s&&s(e)},a=o,i(n,a)}return a(t,e),s(t,[{key:"componentDidMount",value:function(){this._member={type:"tab",id:this.props.id,node:(0,u.findDOMNode)(this),text:this.props.text,setActiveState:this._setActiveState,toggleActiveState:this._toggleActiveState},this.context.ariaManager.addMember(this._member)}},{key:"componentWillUnmount",value:function(){this.context.ariaManager.removeMember(this._member)}},{key:"render",value:function(){var e=this.context.ariaManager.type,t=this.props,o=t.tag,n=t.id,r=t.disabled,i=t.children,a=void 0!==this.props.isActive?this.props.isActive:this.state.isActive,s={id:n,role:"tab",tabIndex:"accordion"===e?0:a?0:-1,"aria-selected":a,"aria-controls":n+"-panel","aria-disabled":r,onKeyDown:this._handleKeyDown,onFocus:this._handleFocus};"accordion"===e&&(s["aria-expanded"]=a);var u=(0,l["default"])(s,this.props,f);return"function"==typeof i?i(u,a):(0,p.createElement)(o,u,i)}}]),t}(p.Component);d.contextTypes={ariaManager:p.PropTypes.object.isRequired},d.propTypes=f,d.defaultProps={tag:"div"},t["default"]=d,e.exports=t["default"]},function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},p=function(){function e(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,o,n){return o&&e(t.prototype,o),n&&e(t,n),t}}(),u=o(3),c=(n(u),o(4)),l=(n(c),o(5)),f=n(l),d={tag:u.PropTypes.string,controlledBy:u.PropTypes.oneOfType([u.PropTypes.string,u.PropTypes.number]).isRequired,isActive:u.PropTypes.bool,children:u.PropTypes.oneOfType([u.PropTypes.func,u.PropTypes.node]).isRequired},y=function(e){function t(){var e,o,n,a;r(this,t);for(var s=arguments.length,p=Array(s),u=0;u<s;u++)p[u]=arguments[u];return o=n=i(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(p))),n.state={isActive:!1},n._setActiveState=function(e){n.setState({isActive:e})},n._toggleActiveState=function(){n.setState({isActive:!n.state.isActive})},n._handleKeyDown=function(e){e.ctrlKey&&"ArrowUp"===e.key&&n.context.ariaManager.focusTab(n.props.controlledBy),n.props.onKeyDown&&n.props.onKeyDown(e)},a=o,i(n,a)}return a(t,e),p(t,[{key:"componentDidMount",value:function(){this.context.ariaManager.addPanel({controlledBy:this.props.controlledBy,node:(0,c.findDOMNode)(this),setActiveState:this._setActiveState,toggleActiveState:this._toggleActiveState})}},{key:"render",value:function(){var e=this.props,t=e.tag,o=e.controlledBy,n=(e.disabled,e.children),r=void 0!==this.props.isActive?this.props.isActive:this.state.isActive,i={id:o+"-panel",role:"tabpanel","aria-hidden":!r,"aria-labelledby":o,onKeyDown:this._handleKeyDown};r||(i.style=s({display:"none"},this.props.style));var a=(0,f["default"])(i,this.props,d);return"function"==typeof n?n(a,r):(0,u.createElement)(t,a,n)}}]),t}(u.Component);y.contextTypes={ariaManager:u.PropTypes.object.isRequired},y.propTypes=d,y.defaultProps={tag:"div"},t["default"]=y,e.exports=t["default"]},function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,o,n){return o&&e(t.prototype,o),n&&e(t,n),t}}(),p=o(3),u=(n(p),o(14)),c=n(u),l=o(15),f=n(l),d=o(16),y=n(d),v=o(5),h=n(v),b=function(e,t){return e===t||e.contains(t)},_={tab:9,escape:27,end:35,home:36,arrowLeft:37,arrowUp:38,arrowRight:39,arrowDown:40},P={type:p.PropTypes.oneOf(["menu","popover","modal","tooltip","alert","tabs","accordion"]).isRequired,tag:p.PropTypes.string,trapFocus:p.PropTypes.bool,freezeScroll:p.PropTypes.bool,activeTabId:p.PropTypes.oneOfType([p.PropTypes.string,p.PropTypes.number]),children:p.PropTypes.oneOfType([p.PropTypes.func,p.PropTypes.node]).isRequired,keybindings:p.PropTypes.shape({next:p.PropTypes.oneOfType([p.PropTypes.object,p.PropTypes.array]),prev:p.PropTypes.oneOfType([p.PropTypes.object,p.PropTypes.array]),first:p.PropTypes.oneOfType([p.PropTypes.object,p.PropTypes.array]),last:p.PropTypes.oneOfType([p.PropTypes.object,p.PropTypes.array])}),wrap:p.PropTypes.bool,stringSearch:p.PropTypes.bool,stringSearchDelay:p.PropTypes.number,collapsible:p.PropTypes.bool,openPopoverOn:p.PropTypes.oneOf(["tap","hover"]),closeOnOutsideClick:p.PropTypes.bool,closeOnItemSelection:p.PropTypes.bool,accordion:p.PropTypes.bool,onPopoverOpen:p.PropTypes.func,onPopoverClose:p.PropTypes.func,onItemSelection:p.PropTypes.func},m=function(e){function t(e){r(this,t);var o=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return o._onItemSelection=function(e,t){var n=e.value||e.node.innerHTML;o.props.closeOnItemSelection&&o.closePopover(),o.props.onItemSelection(n,t)},o._setToggleNode=function(e){o._toggle=e},o._setPopoverNode=function(e){o._popover=e},o._addMember=function(e){var t=o.props.activeTabId,n=e.id,r=e.index,i=e.node,a=e.text;void 0===r?o._members.push(e):o._members.splice(r,0,e),o._focusGroup.addMember({node:i,text:a||i.innerHTML}),"tab"===e.type&&(t===n?o._activateTab(t,!0,!1):o._handleFirstTabSelection(n))},o._removeMember=function(e){var t=o._members.indexOf(e);t>-1&&(o._members.splice(e,1),o._focusGroup.removeMember(e.node))},o._focusItem=function(e){o._focusGroup.focusNodeAtIndex(e)},o.openPopover=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=o.props,n=t.freezeScroll,r=t.onPopoverOpen;o.state.isPopoverOpen||(o.setState({isPopoverOpen:!0}),n&&f["default"].on(),r(),e&&setTimeout(function(){o._focusItem(0)},60))},o.closePopover=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=o.props,n=t.freezeScroll,r=t.onPopoverClose;o.state.isPopoverOpen&&(o.setState({isPopoverOpen:!1}),n&&f["default"].off(),r(),e&&setTimeout(function(){o._toggle.focus()},60))},o.togglePopover=function(e){o.state.isPopoverOpen?o.closePopover(e):o.openPopover(e)},o._addPanel=function(e){var t=o.props.activeTabId,n=e.controlledBy;o._panels.push(e),t===n?o._activateTab(t,!0,!1):o._handleFirstTabSelection(e.controlledBy)},o._focusTab=function(e){var t=o._members.filter(function(t){return t.id===e});t&&t.node.focus()},o._activateTab=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=o.props,i=r.type,a=r.onChange;if("tabs"===i){if(e===o._activeTabId&&!t)return;o._activeTabId=e}if(n&&"function"==typeof a)return void a(e);for(var s=o._members.length;s--;){var p=o._members[s];"accordion"===i?p.id===e&&p.toggleActiveState():p.setActiveState(e===p.id)}for(var u=o._panels.length;u--;){var c=o._panels[u];"accordion"===i?c.controlledBy===e&&c.toggleActiveState():c.setActiveState(e===c.controlledBy)}},o.state={isPopoverOpen:!1},o._focusGroup=(0,c["default"])(e),o._toggle=null,o._popover=null,o._members=[],o._panels=[],o._activeTabId=e.activeTabId,o._uuid="RA"+Math.abs(~~(Math.random()*new Date)),o}return a(t,e),s(t,[{key:"getChildContext",value:function(){return{ariaManager:{uuid:this._uuid,type:this.props.type,trapFocus:this.props.trapFocus,initialFocus:this.props.initialFocus,isPopoverOpen:this.state.isPopoverOpen,onItemSelection:this._onItemSelection,setToggleNode:this._setToggleNode,setPopoverNode:this._setPopoverNode,addMember:this._addMember,addPanel:this._addPanel,removeMember:this._removeMember,activateTab:this._activateTab,focusItem:this._focusItem,openPopover:this.openPopover,closePopover:this.closePopover,togglePopover:this.togglePopover}}}},{key:"componentWillMount",value:function(){this._focusGroup.activate(),y["default"].add(this)}},{key:"componentWillUnmount",value:function(){this._focusGroup.deactivate(),y["default"].remove(this)}},{key:"_onTap",value:function(e){"tap"===this.props.openPopoverOn&&this._handleTapOrHover(e)}},{key:"_onHover",value:function(e){"hover"===this.props.openPopoverOn&&this._handleTapOrHover(e)}},{key:"_handleTapOrHover",value:function(e){var t=this.props,o=t.openPopoverOn,n=t.closeOnOutsideClick,r=e.target;if(this._toggle){var i=this._toggle.getAttribute("disabled");if(b(this._toggle,r)&&null===i)return void("tap"===o?this.togglePopover(!1):this.openPopover(!1));if(n&&this._popover&&!b(this._popover,r))return void this.closePopover(!1)}for(var a=this._members.length;a--;){var s=this._members[a];if(s.node===r)return void("item"===s.type?this._onItemSelection(s,e):this._activateTab(s.id))}}},{key:"_onKeyDown",value:function(e){var t=e.keyCode;this.state.isPopoverOpen&&(this.props.trapFocus||t!==_.tab?t===_.escape&&this.closePopover():this.closePopover(!1))}},{key:"_handleFirstTabSelection",value:function(e){("tabs"===this.props.type&&!this._activeTabId||e===this._activeTabId)&&this._activateTab(e,!0,!1)}},{key:"render",value:function(){var e=this.props,t=e.tag,o=e.children,n=(0,h["default"])({},this.props,P);return"function"==typeof o?o(this.state.isPopoverOpen):(0,p.createElement)(t,n,o)}}]),t}(p.Component);m.childContextTypes={ariaManager:p.PropTypes.object.isRequired},m.propTypes=P,m.defaultProps={tag:"div",trapFocus:!1,freezeScroll:!1,keybindings:{next:[{keyCode:_.arrowDown},{keyCode:_.arrowRight}],prev:[{keyCode:_.arrowUp},{keyCode:_.arrowLeft}],first:{keyCode:_.home},last:{keyCode:_.end}},wrap:!0,stringSearch:!0,stringSearchDelay:600,collapsible:!1,openPopoverOn:"tap",closeOnOutsideClick:!0,closeOnItemSelection:!0,onPopoverOpen:function(){return null},onPopoverClose:function(){return null},onItemSelection:function(){return null}},t["default"]=m,e.exports=t["default"]},function(e,t){e.exports=n},function(e,t){e.exports=r},function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var r=o(17),i=n(r);t["default"]={_queue:[],add:function(e){this._queue.push(e),1===this._queue.length&&this._attachListeners()},remove:function(e){var t=this._queue.indexOf(e);t>-1&&this._queue.splice(t,1),this._queue.length<=0&&this._detachListeners()},_attachListeners:function(){this._tapListener=(0,i["default"])(document.documentElement,this._documentEvent.bind(this,"_onTap")),document.addEventListener("mouseover",this._documentEvent.bind(this,"_onHover")),document.addEventListener("keydown",this._documentEvent.bind(this,"_onKeyDown"))},_detachListeners:function(){this._tapListener.remove(),document.removeEventListener("mouseover",this._documentEvent),document.removeEventListener("keydown",this._documentEvent)},_documentEvent:function(e,t){for(var o=this._queue.length;o--;)this._queue[o][e](t)}},e.exports=t["default"]},function(e,t){e.exports=i}])});

@@ -6,52 +6,34 @@ 'use strict';

});
exports.AriaPanel = exports.AriaTab = exports.AriaTabList = exports.AriaItem = exports.AriaPopover = exports.AriaToggle = exports.AriaManager = undefined;
exports.Manager = undefined;
var _AriaManager2 = require('./AriaManager');
var _Menu = require('./Menu');
var _AriaManager3 = _interopRequireDefault(_AriaManager2);
Object.keys(_Menu).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function get() {
return _Menu[key];
}
});
});
var _AriaToggle2 = require('./AriaToggle');
var _Tabs = require('./Tabs');
var _AriaToggle3 = _interopRequireDefault(_AriaToggle2);
Object.keys(_Tabs).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function get() {
return _Tabs[key];
}
});
});
var _AriaPopover2 = require('./AriaPopover');
var _Manager2 = require('./Manager');
var _AriaPopover3 = _interopRequireDefault(_AriaPopover2);
var _Manager3 = _interopRequireDefault(_Manager2);
var _AriaItem2 = require('./AriaItem');
var _AriaItem3 = _interopRequireDefault(_AriaItem2);
var _AriaTabList2 = require('./AriaTabList');
var _AriaTabList3 = _interopRequireDefault(_AriaTabList2);
var _AriaTab2 = require('./AriaTab');
var _AriaTab3 = _interopRequireDefault(_AriaTab2);
var _AriaPanel2 = require('./AriaPanel');
var _AriaPanel3 = _interopRequireDefault(_AriaPanel2);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.AriaManager = _AriaManager3.default;
exports.AriaToggle = _AriaToggle3.default;
exports.AriaPopover = _AriaPopover3.default;
exports.AriaItem = _AriaItem3.default;
exports.AriaTabList = _AriaTabList3.default;
exports.AriaTab = _AriaTab3.default;
exports.AriaPanel = _AriaPanel3.default;
// rename
// export Manager from './Manager'
// export Toggle from './Toggle'
// export Popover from './Popover'
// export Item from './Item'
// export TabList from './TabList'
// export Tab from './Tab'
// export Panel from './Panel'
// usage
// <Aria.Manager/> || <Manager/>
exports.Manager = _Manager3.default;
{
"name": "react-aria",
"version": "0.4.0",
"version": "0.5.0",
"description": "Utilities to help create React ARIA components.",

@@ -5,0 +5,0 @@ "main": "lib/react-aria.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc