@carbon/react
Version:
React components for the Carbon Design System
55 lines (49 loc) • 1.61 kB
JavaScript
/**
* Copyright IBM Corp. 2016, 2023
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/
;
Object.defineProperty(exports, '__esModule', { value: true });
var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelpers.js');
var PropTypes = require('prop-types');
var React = require('react');
var cx = require('classnames');
require('../ListBox/index.js');
var usePrefix = require('../../internal/usePrefix.js');
var ListBoxPropTypes = require('../ListBox/ListBoxPropTypes.js');
const DropdownSkeleton = ({
className,
size,
hideLabel,
...rest
}) => {
const prefix = usePrefix.usePrefix();
const wrapperClasses = cx(className, `${prefix}--skeleton`, `${prefix}--form-item`);
return /*#__PURE__*/React.createElement("div", _rollupPluginBabelHelpers.extends({
className: wrapperClasses
}, rest), !hideLabel && /*#__PURE__*/React.createElement("span", {
className: `${prefix}--label ${prefix}--skeleton`
}), /*#__PURE__*/React.createElement("div", {
className: cx(`${prefix}--skeleton ${prefix}--dropdown`, {
[`${prefix}--list-box--${size}`]: size
})
}));
};
DropdownSkeleton.propTypes = {
/**
* Specify an optional className to add.
*/
className: PropTypes.string,
/**
* Specify whether the label should be hidden, or not
*/
hideLabel: PropTypes.bool,
/**
* Specify the size of the ListBox.
*/
size: ListBoxPropTypes.ListBoxSizePropType
};
exports.DropdownSkeleton = DropdownSkeleton;
exports.default = DropdownSkeleton;