@atlaskit/atlassian-navigation
Version:
A horizontal navigation component for Atlassian apps.
65 lines • 2.4 kB
JavaScript
import _extends from "@babel/runtime/helpers/extends";
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
var _excluded = ["component", "href", "icon", "id", "isDisabled", "isSelected", "label", "onBlur", "onClick", "onFocus", "onMouseDown", "onMouseEnter", "onMouseLeave", "onMouseUp", "target", "testId", "theme", "tooltip"];
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 var Profile = /*#__PURE__*/forwardRef(function (props, ref) {
var component = props.component,
href = props.href,
icon = props.icon,
id = props.id,
isDisabled = props.isDisabled,
isSelected = props.isSelected,
labelProp = props.label,
onBlur = props.onBlur,
onClick = props.onClick,
onFocus = props.onFocus,
onMouseDown = props.onMouseDown,
onMouseEnter = props.onMouseEnter,
onMouseLeave = props.onMouseLeave,
onMouseUp = props.onMouseUp,
target = props.target,
testId = props.testId,
theme = props.theme,
tooltip = props.tooltip,
rest = _objectWithoutProperties(props, _excluded);
var 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)));
});