UNPKG

@carbon/react

Version:

React components for the Carbon Design System

45 lines (39 loc) 1.32 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 TextInputSkeleton = ({ hideLabel, className, ...rest }) => { const prefix = usePrefix.usePrefix(); return /*#__PURE__*/React.createElement("div", _rollupPluginBabelHelpers.extends({ className: cx(`${prefix}--form-item`, className) }, rest), !hideLabel && /*#__PURE__*/React.createElement("span", { className: `${prefix}--label ${prefix}--skeleton` }), /*#__PURE__*/React.createElement("div", { className: `${prefix}--skeleton ${prefix}--text-input` })); }; TextInputSkeleton.propTypes = { /** * Specify an optional className to add to the form item wrapper. */ className: PropTypes.string, /** * Specify whether the label should be hidden, or not */ hideLabel: PropTypes.bool }; exports.TextInputSkeleton = TextInputSkeleton; exports.default = TextInputSkeleton;