@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.91 kB
JavaScript
/* breadcrumbs-item-base.tsx generated by @compiled/babel-plugin v3.0.2 */
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
var _excluded = ["ref", "testId"];
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';
var itemWrapperStyles = null;
var BreadcrumbsItemBase = /*#__PURE__*/forwardRef(function (_ref, ref) {
var analyticsContext = _ref.analyticsContext,
elemBefore = _ref.elemBefore,
href = _ref.href,
iconAfter = _ref.iconAfter,
iconBefore = _ref.iconBefore,
onClick = _ref.onClick,
onTooltipShown = _ref.onTooltipShown,
target = _ref.target,
testId = _ref.testId,
text = _ref.text,
title = _ref.title,
truncationWidth = _ref.truncationWidth,
shouldShowTooltip = _ref.shouldShowTooltip,
stepRef = _ref.stepRef,
xcss = _ref.xcss,
ariaLabel = _ref['aria-label'],
ariaLabelledBy = _ref['aria-labelledby'],
ariaCurrent = _ref['aria-current'];
var resolvedElemBefore = elemBefore !== null && elemBefore !== void 0 ? elemBefore : iconBefore;
var renderStep = function renderStep(triggerProps) {
var _ref2 = triggerProps !== null && triggerProps !== void 0 ? triggerProps : {},
tooltipRef = _ref2.ref,
_testId = _ref2.testId,
tooltipTriggerProps = _objectWithoutProperties(_ref2, _excluded);
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);
};
var 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;