UNPKG

@atlaskit/navigation-system

Version:

The latest navigation system for Atlassian apps.

39 lines (37 loc) • 1.66 kB
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); Object.defineProperty(exports, "__esModule", { value: true }); exports.getPrimitiveSpreadProps = getPrimitiveSpreadProps; var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties")); var _excluded = ["style", "xcss", "backgroundColor", "padding", "paddingBlock", "paddingBlockStart", "paddingBlockEnd", "paddingInline", "paddingInlineStart", "paddingInlineEnd"]; /** * Props from primitives that we explicitly ignore and remove from spread props, * because they apply styles. * * `css` / `className` are not here because primitives don't support them. * * See `packages/design-system/primitives/src/components/anchor.tsx` and `packages/design-system/primitives/src/components/pressable.tsx` * for where these are defined. These shouldn't change very often as the direction is `xcss` over individual props. */ /** * Returns the spread props to pass through to underlying primitive components. * * It removes the props which apply styles. */ // eslint-disable no-unused-vars function getPrimitiveSpreadProps(_ref) { var style = _ref.style, xcss = _ref.xcss, backgroundColor = _ref.backgroundColor, padding = _ref.padding, paddingBlock = _ref.paddingBlock, paddingBlockStart = _ref.paddingBlockStart, paddingBlockEnd = _ref.paddingBlockEnd, paddingInline = _ref.paddingInline, paddingInlineStart = _ref.paddingInlineStart, paddingInlineEnd = _ref.paddingInlineEnd, props = (0, _objectWithoutProperties2.default)(_ref, _excluded); return props; }