@atlaskit/atlassian-navigation
Version:
A horizontal navigation component for Atlassian apps.
75 lines (71 loc) • 2.69 kB
JavaScript
;
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.SkeletonIconButton = void 0;
var _react = _interopRequireDefault(require("react"));
var _react2 = require("@emotion/react");
var _theme = require("../../theme");
/**
* @jsxRuntime classic
* @jsx jsx
*/
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
var skeletonIconButtonStyles = (0, _react2.css)({
margin: 0,
padding: "var(--ds-space-050, 4px)".concat(" ", "var(--ds-space-075, 6px)"),
border: 0,
borderRadius: "var(--ds-radius-full, 100%)",
pointerEvents: 'none',
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
':focus, :active, :hover': {
appearance: 'none',
border: 0,
outline: 0
},
// eslint-disable-next-line @atlaskit/design-system/no-nested-styles, @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
'& > span': {
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
lineHeight: 'normal'
},
// eslint-disable-next-line @atlaskit/design-system/no-nested-styles, @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
'& > img': {
width: 24,
height: 24,
borderRadius: "var(--ds-radius-full, 100%)",
verticalAlign: 'middle'
}
});
var buttonWrapperStyles = (0, _react2.css)({
marginInlineEnd: "var(--ds-space-050, 4px)",
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors
'&:only-of-type': {
marginInlineEnd: 0
}
});
/**
* __Skeleton icon button__
*
* Skeleton buttons are lightweight HTML button elements with CSS that represent
* their heavier interactive counterparts, for use when elements of the
* navigation are loaded dynamically. This one represents a generic icon button.
*
* - [Examples](https://atlassian.design/components/atlassian-navigation/examples#skeleton-button)
* - [Code](https://atlassian.design/components/atlassian-navigation/code)
*/
var SkeletonIconButton = exports.SkeletonIconButton = function SkeletonIconButton(_ref) {
var children = _ref.children,
testId = _ref.testId;
var theme = (0, _theme.useTheme)();
return (0, _react2.jsx)("div", {
role: "listitem",
css: buttonWrapperStyles
}, (0, _react2.jsx)("button", {
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
style: theme.mode.iconButton.default,
"data-testid": testId,
css: skeletonIconButtonStyles,
type: "button"
}, children));
};