@boomerang-io/carbon-addons-boomerang-react
Version:
Carbon Addons for Boomerang apps
26 lines (23 loc) • 880 B
JavaScript
import React from 'react';
import { prefix } from '../settings.js';
/*
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.createElement("div", { className: `${prefix}--list-box__field`, tabIndex: (!disabled && numTabIndex) || -1, ...rest }, children));
}
export { ListBoxField as default };