UNPKG

@elastic/eui

Version:

Elastic UI Component Library

45 lines (44 loc) 2.15 kB
import _extends from "@babel/runtime/helpers/extends"; import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties"; var _excluded = ["isLoading", "size", "className", "contentAriaLabel", "announceLoadingStatus", "announceLoadedStatus", "ariaLiveProps", "ariaWrapperProps", "children"]; /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License * 2.0 and the Server Side Public License, v 1; you may not use this file except * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ import React from 'react'; import classNames from 'classnames'; import { useEuiMemoizedStyles } from '../../services'; import { EuiSkeletonLoading } from './skeleton_loading'; import { euiSkeletonTitleStyles } from './skeleton_title.styles'; import { jsx as ___EmotionJSX } from "@emotion/react"; export var EuiSkeletonTitle = function EuiSkeletonTitle(_ref) { var _ref$isLoading = _ref.isLoading, isLoading = _ref$isLoading === void 0 ? true : _ref$isLoading, _ref$size = _ref.size, size = _ref$size === void 0 ? 'm' : _ref$size, className = _ref.className, contentAriaLabel = _ref.contentAriaLabel, announceLoadingStatus = _ref.announceLoadingStatus, announceLoadedStatus = _ref.announceLoadedStatus, ariaLiveProps = _ref.ariaLiveProps, ariaWrapperProps = _ref.ariaWrapperProps, children = _ref.children, rest = _objectWithoutProperties(_ref, _excluded); var styles = useEuiMemoizedStyles(euiSkeletonTitleStyles); var cssStyles = [styles.euiSkeletonTitle, styles[size]]; return ___EmotionJSX(EuiSkeletonLoading, _extends({ isLoading: isLoading, loadingContent: ___EmotionJSX("span", _extends({ className: classNames('euiSkeletonTitle', className), css: cssStyles }, rest)), loadedContent: children || '', contentAriaLabel: contentAriaLabel, announceLoadingStatus: announceLoadingStatus, announceLoadedStatus: announceLoadedStatus, ariaLiveProps: ariaLiveProps }, ariaWrapperProps)); };