UNPKG

@boomerang-io/carbon-addons-boomerang-react

Version:
34 lines (27 loc) 1.13 kB
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var React = require('react'); var settings = require('../settings.js'); function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; } var React__default = /*#__PURE__*/_interopDefault(React); /* IBM Confidential 694970X, 69497O0 © Copyright IBM Corp. 2022, 2024 */ /** * Copyright IBM Corp. 2016, 2018 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ /** * `ListBoxField` is responsible for creating the containing node for valid * elements inside of a field. It also provides a11y-related attributes like * `role` to make sure a user can focus the given field. */ function ListBoxField({ children, disabled, tabIndex, ...rest }) { const numTabIndex = typeof tabIndex === "string" ? parseInt(tabIndex) : tabIndex; return (React__default.default.createElement("div", { className: `${settings.prefix}--list-box__field`, tabIndex: (!disabled && numTabIndex) || -1, ...rest }, children)); } exports.default = ListBoxField;