UNPKG

@fluentui/react-northstar

Version:
43 lines (40 loc) 2.31 kB
"use strict"; exports.__esModule = true; exports.skeletonLineClassName = exports.SkeletonLine = void 0; var _reactBindings = require("@fluentui/react-bindings"); var PropTypes = _interopRequireWildcard(require("prop-types")); var _utils = require("../../utils"); var _Box = require("../Box/Box"); function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } var skeletonLineClassName = 'ui-skeleton__line'; /** * A SkeletonLine represents a text line that will be loaded */ exports.skeletonLineClassName = skeletonLineClassName; var SkeletonLine = (0, _reactBindings.compose)(_Box.Box, { className: skeletonLineClassName, displayName: 'SkeletonLine', overrideStyles: true, shorthandConfig: {}, handledProps: ['width', 'height'], mapPropsToStylesProps: function mapPropsToStylesProps(_ref) { var width = _ref.width, height = _ref.height; return { width: width, height: height }; } }); exports.SkeletonLine = SkeletonLine; SkeletonLine.propTypes = Object.assign({}, _utils.commonPropTypes.createCommon(), { width: PropTypes.string, height: PropTypes.string }); SkeletonLine.defaultProps = { as: 'span', width: '100%', height: '1rem' }; //# sourceMappingURL=SkeletonLine.js.map