UNPKG

@carbon/react

Version:

React components for the Carbon Design System

50 lines (44 loc) 1.36 kB
/** * 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. */ 'use strict'; 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'); var usePrefix = require('../../internal/usePrefix.js'); const SearchSkeleton = ({ small = false, className, ...rest }) => { const prefix = usePrefix.usePrefix(); const searchClasses = cx(className, { [`${prefix}--skeleton`]: true, [`${prefix}--search--xl`]: !small, [`${prefix}--search--sm`]: small }); return /*#__PURE__*/React.createElement("div", _rollupPluginBabelHelpers.extends({ className: searchClasses }, rest), /*#__PURE__*/React.createElement("span", { className: `${prefix}--label` }), /*#__PURE__*/React.createElement("div", { className: `${prefix}--search-input` })); }; SearchSkeleton.propTypes = { /** * Specify an optional className to add. */ className: PropTypes.string, /** * Specify whether the Search should be a small variant */ small: PropTypes.bool }; exports.SearchSkeleton = SearchSkeleton; exports.default = SearchSkeleton;