@atlaskit/atlassian-navigation
Version:
A horizontal navigation component for Atlassian apps.
65 lines • 1.78 kB
JavaScript
import _extends from "@babel/runtime/helpers/extends";
import React, { forwardRef } from 'react';
import { IconButton } from '../IconButton';
/**
* __Profile__
*
* A profile button which takes an icon/avatar component can be that can be
* passed into `AtlassianNavigation`'s `renderProfile` prop.
*
* - [Examples](https://atlassian.design/components/atlassian-navigation/examples#profile)
* - [Code](https://atlassian.design/components/atlassian-navigation/code)
*
* @deprecated `@atlaskit/atlassian-navigation` is deprecated. Use `@atlaskit/navigation-system` instead.
*/
export const Profile = /*#__PURE__*/forwardRef((props, ref) => {
const {
component,
href,
icon,
id,
isDisabled,
isSelected,
label: labelProp,
onBlur,
onClick,
onFocus,
onMouseDown,
onMouseEnter,
onMouseLeave,
onMouseUp,
target,
testId,
theme,
tooltip,
...rest
} = props;
const label = labelProp || (typeof tooltip === 'string' ? tooltip : 'Your profile and settings');
return /*#__PURE__*/React.createElement("div", {
role: "listitem"
}, /*#__PURE__*/React.createElement(IconButton, _extends({
component: component,
href: href,
icon: icon,
id: id,
isDisabled: isDisabled,
isSelected: isSelected,
label: label,
onBlur: onBlur,
onClick: onClick,
onFocus: onFocus,
onMouseDown: onMouseDown,
onMouseEnter: onMouseEnter,
onMouseLeave: onMouseLeave,
onMouseUp: onMouseUp,
ref: ref,
target: target,
testId: testId
// eslint-disable-next-line @repo/internal/react/no-unsafe-overrides
,
theme: theme,
tooltip: tooltip,
isTooltipAnnouncementDisabled: true
// These are mostly explicit, leaving it in just in case
}, rest)));
});