UNPKG

@atlaskit/breadcrumbs

Version:

Breadcrumbs are a navigation system used to show a user's location in a site or app.

69 lines (68 loc) • 2.4 kB
/* breadcrumbs-item-base.tsx generated by @compiled/babel-plugin v3.0.2 */ import "./breadcrumbs-item-base.compiled.css"; import * as React from 'react'; import { ax, ix } from "@compiled/react/runtime"; import { forwardRef } from 'react'; import mergeRefs from '@atlaskit/ds-lib/merge-refs'; import Tooltip from '@atlaskit/tooltip/Tooltip'; import Step from './step'; const itemWrapperStyles = null; const BreadcrumbsItemBase = /*#__PURE__*/forwardRef(({ analyticsContext, elemBefore, href, iconAfter, iconBefore, onClick, onTooltipShown, target, testId, text, title, truncationWidth, shouldShowTooltip, stepRef, xcss, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, 'aria-current': ariaCurrent }, ref) => { const resolvedElemBefore = elemBefore !== null && elemBefore !== void 0 ? elemBefore : iconBefore; const renderStep = triggerProps => { const { ref: tooltipRef, testId: _testId, ...tooltipTriggerProps } = triggerProps !== null && triggerProps !== void 0 ? triggerProps : {}; return /*#__PURE__*/React.createElement(Step, { ref: tooltipRef ? mergeRefs([stepRef, tooltipRef]) : stepRef, analyticsContext: analyticsContext, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-current": ariaCurrent, elemBefore: resolvedElemBefore, href: href, iconAfter: iconAfter, iconBefore: iconBefore, onClick: onClick, target: target, testId: testId, title: title, triggerProps: triggerProps ? tooltipTriggerProps : undefined, truncationWidth: truncationWidth }, text); }; const step = renderStep(); return /*#__PURE__*/React.createElement("li", { ref: ref // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- required for public xcss passthrough , className: ax(["_1e0c1txw _vchhusvi _p12f1osq _4cvr1h6o _2lx2vrvc _1wpz1h6o _ect4ttxp _6rthze3t _1pfhze3t _12l2ze3t _ahbqze3t _85i5ze3t _1q51ze3t _y4tize3t _bozgze3t _1mnxv77o _1nh4u2gc _z0aiftgi _tua5idpf _1plw1q9y _14rn1rpy _aetr1n76 _8yoa1h6o", xcss]) }, shouldShowTooltip ? /*#__PURE__*/React.createElement(Tooltip, { content: text, position: "bottom", onShow: onTooltipShown }, renderStep) : step); }); // eslint-disable-next-line @repo/internal/react/require-jsdoc export default BreadcrumbsItemBase;