UNPKG

@atlaskit/side-navigation

Version:

A highly composable side navigation component that supports nested views.

44 lines (41 loc) • 1.83 kB
/* custom-item.tsx generated by @compiled/babel-plugin v3.0.2 */ import _extends from "@babel/runtime/helpers/extends"; import "./custom-item.compiled.css"; import * as React from 'react'; import { ax, ix } from "@compiled/react/runtime"; import { forwardRef } from 'react'; import Custom from '@atlaskit/menu/custom-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" }; // Dirty hack to get generics working with forward ref [1/2] /** * Used to support any custom items needed by products alongside the Header and Footer patterns. * Specific implementation of headers and footers are provided in the examples folder. * * @deprecated `@atlaskit/side-navigation` is deprecated. Use `@atlaskit/navigation-system` instead. */ export const CustomItem = /*#__PURE__*/forwardRef(({ className, ...props }, ref) => { const { shouldRender } = useShouldNestedElementRender(); if (!shouldRender) { return null; } return /*#__PURE__*/React.createElement(Custom, _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)); } // Dirty hack to get generics working with forward ref [2/2] );