UNPKG

@atlaskit/atlassian-navigation

Version:

A horizontal navigation component for Atlassian apps.

78 lines (74 loc) 2.86 kB
/** * @jsxRuntime classic * @jsx jsx */ import React from 'react'; // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766 import { css, jsx } from '@emotion/react'; import AppSwitcherIcon from '@atlaskit/icon/core/app-switcher'; import { useTheme } from './theme'; /** * @deprecated `@atlaskit/atlassian-navigation` is deprecated. Use `@atlaskit/navigation-system` instead. */ const skeletonSwitcherButtonStyles = css({ margin: 0, // eslint-disable-next-line @atlaskit/design-system/no-physical-properties marginRight: "var(--ds-space-050, 4px)", padding: `${"var(--ds-space-050, 4px)"} ${"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/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766 '&:only-of-type': { // eslint-disable-next-line @atlaskit/design-system/no-physical-properties marginRight: 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' } }); /** * __Skeleton switcher 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 the AppSwitcher button. * * - [Examples](https://atlassian.design/components/atlassian-navigation/examples#skeleton-button) * - [Code](https://atlassian.design/components/atlassian-navigation/code) * * @deprecated `@atlaskit/atlassian-navigation` is deprecated. Use `@atlaskit/navigation-system` instead. */ export const SkeletonSwitcherButton = ({ label = '', testId }) => { const theme = useTheme(); return 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: skeletonSwitcherButtonStyles, type: "button" }, jsx(AppSwitcherIcon, { color: "currentColor", spacing: "spacious", label: label })); }; export { Nav4SkeletonSwitcherButton } from './nav4-skeleton-switcher-button';