UNPKG

@carbon/react

Version:

React components for the Carbon Design System

51 lines (49 loc) 1.54 kB
/** * Copyright IBM Corp. 2016, 2026 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ import { usePrefix } from "../../internal/usePrefix.js"; import classNames from "classnames"; import "react"; import PropTypes from "prop-types"; import { jsx } from "react/jsx-runtime"; //#region src/components/Breadcrumb/Breadcrumb.Skeleton.tsx /** * Copyright IBM Corp. 2016, 2025 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ function Item() { const prefix = usePrefix(); return /* @__PURE__ */ jsx("div", { className: `${prefix}--breadcrumb-item`, children: /* @__PURE__ */ jsx("span", { className: `${prefix}--link`, children: "\xA0" }) }); } function BreadcrumbSkeleton({ className, items = 3, noTrailingSlash, size, ...rest }) { const prefix = usePrefix(); return /* @__PURE__ */ jsx("div", { className: classNames({ [`${prefix}--breadcrumb`]: true, [`${prefix}--skeleton`]: true, [`${prefix}--breadcrumb--no-trailing-slash`]: noTrailingSlash, [`${prefix}--breadcrumb--sm`]: size === "sm" }, className), ...rest, children: Array.from({ length: items }, (_, i) => /* @__PURE__ */ jsx(Item, {}, i)) }); } BreadcrumbSkeleton.propTypes = { className: PropTypes.string, items: PropTypes.number, noTrailingSlash: PropTypes.bool, size: PropTypes.oneOf(["sm", "md"]) }; //#endregion export { BreadcrumbSkeleton as default };