@atlaskit/menu
Version:
A list of options to help users navigate, or perform actions.
56 lines (53 loc) • 2.08 kB
JavaScript
/* skeleton-item.tsx generated by @compiled/babel-plugin v0.39.1 */
import "./skeleton-item.compiled.css";
import * as React from 'react';
import { ax, ix } from "@compiled/react/runtime";
const skeletonItemElemSize = 20;
const styles = {
root: "_1rjcze3t _18zrv47k _1e0c1txw _1tke1ylp _4cvr1h6o _lcxvglyw _14mj53f4 _1qdgrdoj _1hfkizff _aetrb3bt _3mxot94y",
defaultWidth: "_sf1e1n8h _4rfy1ssb _baud1nrf _mr7o1vuk _69tq19wn _kt4d1n05",
customWidth: "_11w8rzut",
beforeElement: "_1mp4gktf _kfgtgktf _7bjqidpf _1rusizff _1kt9b3bt _1mbqdlk8 _1rhxv77o",
avatar: "_rfx31rr0",
icon: "_rfx3fajl",
sideNavSkeleton: "_18zru2gc _kfgt1k8s _1mbqpxbi _1mp41k8s"
};
/**
* These styles are mirrored in:
* packages/design-system/theme/src/constants.tsx
* packages/design-system/menu/src/menu-item/skeleton-heading-item.tsx
*
* Please update both.
*/
const shimmerKeyframes = null;
/**
* These styles are defined using `css` rather than `cssMap` as there is a bug when using
* `cssMap` that causes a build failure due to the use of keyframes within this pseudo-element.
*/
const shimmerStyles = null;
/**
* __Skeleton item__
*
* A skeleton item is used in place of an item when its contents it not ready.
*
* - [Examples](https://atlaskit.atlassian.com/packages/design-system/menu/docs/skeleton-item)
* - [Code](https://atlaskit.atlassian.com/packages/design-system/menu)
*/
const SkeletonItem = ({
hasAvatar,
hasIcon,
isShimmering = false,
isSideNavSkeleton = false,
testId,
width,
xcss
}) => {
return /*#__PURE__*/React.createElement("div", {
className: ax([styles.root, (hasAvatar || hasIcon) && styles.beforeElement, hasAvatar && styles.avatar, hasIcon && styles.icon, width ? styles.customWidth : styles.defaultWidth, isSideNavSkeleton && styles.sideNavSkeleton, isShimmering && "", isShimmering && "_unfq1yy8 _9nev1yy8 _kwc012o8 _joxl12o8 _18f312c5 _evp612c5 _19oh1254 _10881254 _18lgp3kn _zo24p3kn _1hfkizff _1rusizff", xcss]),
style: {
'--width': width
},
"data-testid": testId
});
};
export default SkeletonItem;