UNPKG

@atlaskit/side-navigation

Version:

A highly composable side navigation component that supports nested views.

45 lines (43 loc) • 1.84 kB
/* button-item.tsx generated by @compiled/babel-plugin v3.0.2 */ import _extends from "@babel/runtime/helpers/extends"; import "./button-item.compiled.css"; import * as React from 'react'; import { ax, ix } from "@compiled/react/runtime"; import { forwardRef } from 'react'; import Button from '@atlaskit/menu/button-item'; import { useShouldNestedElementRender } from '../NestableNavigationContent/use-should-nested-element-render'; const styles = { root: "_2rkofajl _1rjcu2gc _18zru2gc _bfhksm61 _1a391k8s _racp1k8s _30l3azsu _irr31dpa _ppn2azsu _183jfcek", selectedStyles: "_bfhk15s3 _syaz6x5g _10536x5g _irr3ufnl _30l36x5g _1di6nozp _9h8h6x5g", rootMotion: "_v564hxmd _o7kshxmd _1ggl87vo", selectedMotion: "_v5641rrn _o7kshxmd _1ggl87vo" }; /** * __Button item__ * * A button item renders an item wrapped in a button tag, used primarily when an * action does something other than changing routes. * * - [Examples](https://atlassian.design/components/side-navigation/examples#button-item) * - [Code](https://atlassian.design/components/side-navigation/code) * * @deprecated `@atlaskit/side-navigation` is deprecated. Use `@atlaskit/navigation-system` instead. */ export const ButtonItem = /*#__PURE__*/forwardRef(({ className, ...props }, ref) => { const { shouldRender } = useShouldNestedElementRender(); if (!shouldRender) { return null; } return /*#__PURE__*/React.createElement(Button, _extends({ ref: ref // eslint-disable-next-line @atlaskit/design-system/no-unsafe-style-overrides , // eslint-disable-next-line @atlaskit/design-system/no-unsafe-style-overrides, @atlaskit/ui-styling-standard/no-classname-prop className: ax([styles.root, styles.rootMotion, props.isSelected && styles.selectedStyles, props.isSelected && styles.selectedMotion, className]) }, props)); });