UNPKG

@primer/components

Version:
66 lines (59 loc) 2.12 kB
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } import React from 'react'; import styled from 'styled-components'; import Box from './Box'; /** * @deprecated Use the Box component instead (i.e. <Position> → <Box>) */ const Position = styled(Box).withConfig({ displayName: "Position", componentId: "fla1y3-0" })([""]); /** * @deprecated Use the Box component instead (i.e. <Absolute> → <Box position="absolute">) */ export default Position; // Absolute /** * @deprecated Use the Box component instead (i.e. <Absolute> → <Box position="absolute">) */ export const Absolute = /*#__PURE__*/React.forwardRef((props, ref) => { return /*#__PURE__*/React.createElement(Position, _extends({}, props, { position: "absolute", ref: ref })); }); Absolute.displayName = 'Absolute'; // Fixed /** * @deprecated Use the Box component instead (i.e. <Fixed> → <Box position="fixed">) */ export const Fixed = /*#__PURE__*/React.forwardRef((props, ref) => { return /*#__PURE__*/React.createElement(Position, _extends({}, props, { position: "fixed", ref: ref })); }); Fixed.displayName = 'Fixed'; // Relative /** * @deprecated Use the Box component instead (i.e. <Relative> → <Box position="relative">) */ export const Relative = /*#__PURE__*/React.forwardRef((props, ref) => { return /*#__PURE__*/React.createElement(Position, _extends({}, props, { position: "relative", ref: ref })); }); Relative.displayName = 'Relative'; // Sticky /** * @deprecated Use the Box component instead (i.e. <Sticky> → <Box position="sticky">) */ export const Sticky = /*#__PURE__*/React.forwardRef((props, ref) => { return /*#__PURE__*/React.createElement(Position, _extends({}, props, { position: "sticky", ref: ref })); }); Sticky.defaultProps = { top: 0, zIndex: 1 }; Sticky.displayName = 'Sticky';