UNPKG

@atlaskit/side-navigation

Version:

A highly composable side navigation component that supports nested views.

42 lines (39 loc) • 1.8 kB
/* heading-item.tsx generated by @compiled/babel-plugin v3.0.2 */ import _extends from "@babel/runtime/helpers/extends"; import "./heading-item.compiled.css"; import * as React from 'react'; import { ax, ix } from "@compiled/react/runtime"; import MenuHeadingItem from '@atlaskit/menu/heading-item'; import { useShouldNestedElementRender } from '../NestableNavigationContent/use-should-nested-element-render'; const styles = { headingItem: "_18zru2gc" }; /** * @deprecated `@atlaskit/side-navigation` is deprecated. Use `@atlaskit/navigation-system` instead. */ /** * __Heading item__ * * Available for advanced use cases, for most situations providing a `title` to `section` should be enough. * * @deprecated `@atlaskit/side-navigation` is deprecated. Use `@atlaskit/navigation-system` instead. */ export const HeadingItem = props => { const { shouldRender } = useShouldNestedElementRender(); if (!shouldRender) { return null; } // @ts-expect-error - Although this isn't defined on props it is available because we've used // spread props below and on the jsx element in MenuHeadingItem. const UNSAFE_className = props.className; return /*#__PURE__*/React.createElement(MenuHeadingItem // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props, @repo/internal/react/no-unsafe-overrides , _extends({}, props, { // @ts-expect-error // eslint-disable-next-line @repo/internal/react/no-unsafe-overrides, @atlaskit/ui-styling-standard/no-classname-prop, @atlaskit/design-system/no-unsafe-style-overrides className: ax([styles.headingItem, UNSAFE_className]) // eslint-disable-next-line @repo/internal/react/no-unsafe-overrides, @atlaskit/ui-styling-standard/no-classname-prop, @atlaskit/design-system/no-unsafe-style-overrides })); };