UNPKG

@dnb/eufemia

Version:

DNB Eufemia Design System UI Library

32 lines (31 loc) 942 B
"use client"; import React, { useContext } from 'react'; import clsx from 'clsx'; import FlexItem from "../flex/Item.js"; import Icon from "../icon/Icon.js"; import { ListContext } from "./ListContext.js"; import { createSkeletonClass } from "../skeleton/SkeletonHelper.js"; import { jsx as _jsx } from "react/jsx-runtime"; function ItemIcon({ children, className, skeleton, ...rest }) { const inheritedSkeleton = useContext(ListContext)?.skeleton; const appliedSkeleton = skeleton !== null && skeleton !== void 0 ? skeleton : inheritedSkeleton; return _jsx(FlexItem, { className: clsx('dnb-list__item__icon', className, appliedSkeleton && createSkeletonClass('font', true)), innerSpace: { left: 'small' }, ...rest, children: _jsx(Icon, { size: "medium", children: children }) }); } ItemIcon._supportsSpacingProps = true; export default ItemIcon; //# sourceMappingURL=ItemIcon.js.map