@carbon/react
Version:
React components for the Carbon Design System
53 lines (51 loc) • 1.85 kB
JavaScript
/**
* 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.
*/
const require_runtime = require("../../_virtual/_rolldown/runtime.js");
const require_usePrefix = require("../../internal/usePrefix.js");
let classnames = require("classnames");
classnames = require_runtime.__toESM(classnames);
let react = require("react");
react = require_runtime.__toESM(react);
let prop_types = require("prop-types");
prop_types = require_runtime.__toESM(prop_types);
let react_jsx_runtime = require("react/jsx-runtime");
//#region src/components/Breadcrumb/Breadcrumb.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.
*/
const Breadcrumb = (0, react.forwardRef)((props, ref) => {
const { "aria-label": ariaLabel, children, className: customClassNameNav, noTrailingSlash, size, ...rest } = props;
const prefix = require_usePrefix.usePrefix();
const className = (0, classnames.default)({
[`${prefix}--breadcrumb`]: true,
[`${prefix}--breadcrumb--no-trailing-slash`]: noTrailingSlash,
[`${prefix}--breadcrumb--sm`]: size === "sm"
});
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("nav", {
className: customClassNameNav,
"aria-label": ariaLabel ? ariaLabel : "Breadcrumb",
ref,
...rest,
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ol", {
className,
children
})
});
});
Breadcrumb.displayName = "Breadcrumb";
Breadcrumb.propTypes = {
"aria-label": prop_types.default.string,
children: prop_types.default.node,
className: prop_types.default.string,
noTrailingSlash: prop_types.default.bool,
size: prop_types.default.oneOf(["sm", "md"])
};
//#endregion
exports.default = Breadcrumb;