UNPKG

@atlaskit/side-navigation

Version:

A highly composable side navigation component that supports nested views.

121 lines (115 loc) • 4.42 kB
/* index.tsx generated by @compiled/babel-plugin v3.0.2 */ import _extends from "@babel/runtime/helpers/extends"; import "./index.compiled.css"; import * as React from 'react'; import { ax, ix } from "@compiled/react/runtime"; /* eslint-disable @repo/internal/react/consistent-props-definitions */ import warnOnce from '@atlaskit/ds-lib/warn-once'; import { Box, Stack, Text } from '@atlaskit/primitives/compiled'; import HeaderContainer from '../Header/header-container'; import { CustomItem } from '../Item/custom-item'; var styles = { iconContainer: "_1e0c1o8l _1bsb1k8s _4t3i1k8s", oldFooter: "_uizt1wug _1e0c1ule _y3gn1h6o _1tke1tcg _4cvr1h6o _1bsb1osq _vrjtwadc _16vx1h6o _bek6ze3t _rh04u2gc _76zj1o8l _13e21h6o _14bw1o8l _xosk12x7 _wte412x7 _ou5312x7 _1jo512x7 _11kjsm61 _jl2n73ad _1et6sm61 _1v6jazsu" }; /** * @deprecated `@atlaskit/side-navigation` is deprecated. Use `@atlaskit/navigation-system` instead. */ /** * __Footer__ * * - [Examples](https://atlassian.design/components/side-navigation/examples#header-and-footer) * - [Code](https://atlassian.design/components/side-navigation/code) * * @deprecated `@atlaskit/side-navigation` is deprecated. Use `@atlaskit/navigation-system` instead. */ var OldFooter = function OldFooter(props) { // https://stackoverflow.com/a/39333479 var safeProps = function (_ref) { var iconBefore = _ref.iconBefore, onClick = _ref.onClick, description = _ref.description, children = _ref.children, testId = _ref.testId; return { iconBefore: iconBefore, onClick: onClick, description: description, children: children, testId: testId }; }(props); return /*#__PURE__*/React.createElement(CustomItem, _extends({}, safeProps, { component: props.component || HeaderContainer, className: ax([styles.oldFooter]) })); }; /** * __Footer__ * * - [Examples](https://atlassian.design/components/side-navigation/examples#header-and-footer) * - [Code](https://atlassian.design/components/side-navigation/code) */ var Footer = function Footer(_ref2) { var description = _ref2.description, children = _ref2.children, iconBefore = _ref2.iconBefore, testId = _ref2.testId; return /*#__PURE__*/React.createElement(Box, { padding: "space.100", testId: testId }, /*#__PURE__*/React.createElement(Stack, { space: "space.100", alignInline: "center" }, /*#__PURE__*/React.createElement(Box, { xcss: styles.iconContainer }, iconBefore), /*#__PURE__*/React.createElement(Stack, { space: "space.075" }, /*#__PURE__*/React.createElement(Text, { size: "small", align: "center", color: "inherit" }, children), description && /*#__PURE__*/React.createElement(Text, { size: "small", as: "p", align: "center", color: "color.text.subtlest" }, description)))); }; /** * __Footer__ * * - [Examples](https://atlassian.design/components/side-navigation/examples#header-and-footer) * - [Code](https://atlassian.design/components/side-navigation/code) * * @deprecated `@atlaskit/side-navigation` is deprecated. Use `@atlaskit/navigation-system` instead. */ export var FooterFacade = function FooterFacade(_ref3) { var _ref3$useDeprecatedAp = _ref3.useDeprecatedApi, useDeprecatedApi = _ref3$useDeprecatedAp === void 0 ? true : _ref3$useDeprecatedAp, description = _ref3.description, iconBefore = _ref3.iconBefore, testId = _ref3.testId, children = _ref3.children, component = _ref3.component, onClick = _ref3.onClick; if (!useDeprecatedApi) { return /*#__PURE__*/React.createElement(Footer, { iconBefore: iconBefore, description: description, testId: testId }, children); } if (typeof process !== 'undefined' && process.env.NODE_ENV !== 'production' && process.env.NODE_ENV !== 'CI') { warnOnce('The `@atlaskit/side-navigation` Footer has simplified its API, removing support for the `component` and `onClick` props.\n\nThese props will stop working in a future major release. Reach out to #help-design-system on slack for help.'); } return /*#__PURE__*/React.createElement(OldFooter, { onClick: onClick, component: component, iconBefore: iconBefore, description: description, testId: testId }, children); }; // Public API aliases preserved from an eliminated entry-point (volt-migrate-package). export { FooterFacade as Footer };