@mskcc/carbon-react
Version:
Carbon react components for the MSKCC DSM
51 lines (47 loc) • 1.21 kB
JavaScript
/**
* MSKCC 2021, 2024
*/
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
import PropTypes from 'prop-types';
import React__default from 'react';
import cx from 'classnames';
import { usePrefix } from '../../internal/usePrefix.js';
const SelectItemGroup = _ref => {
let {
children,
className,
disabled,
label,
...other
} = _ref;
const prefix = usePrefix();
const classNames = cx(`${prefix}--select-optgroup`, className);
return /*#__PURE__*/React__default.createElement("optgroup", _extends({
className: classNames,
label: label,
disabled: disabled
}, other), children);
};
SelectItemGroup.propTypes = {
/**
* Provide the contents of your <SelectItemGroup>
*/
children: PropTypes.node,
/**
* Specify an optional className to be applied to the node
*/
className: PropTypes.string,
/**
* Specify whether the <SelectItemGroup> should be disabled
*/
disabled: PropTypes.bool,
/**
* Specify the label to be displayed
*/
label: PropTypes.string.isRequired
};
SelectItemGroup.defaultProps = {
disabled: false
};
var SelectItemGroup$1 = SelectItemGroup;
export { SelectItemGroup$1 as default };