UNPKG

@primer/react

Version:

An implementation of GitHub's Primer Design System using React

67 lines (60 loc) 1.48 kB
'use strict'; var reactCompilerRuntime = require('react-compiler-runtime'); var React = require('react'); var styled = require('styled-components'); var sx = require('../sx.js'); var jsxRuntime = require('react/jsx-runtime'); function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; } var React__default = /*#__PURE__*/_interopDefault(React); var styled__default = /*#__PURE__*/_interopDefault(styled); const Icon = /*#__PURE__*/React__default.default.forwardRef((props, ref) => { const $ = reactCompilerRuntime.c(7); let IconComponent; let rest; if ($[0] !== props) { ({ icon: IconComponent, ...rest } = props); $[0] = props; $[1] = IconComponent; $[2] = rest; } else { IconComponent = $[1]; rest = $[2]; } let t0; if ($[3] !== IconComponent || $[4] !== ref || $[5] !== rest) { t0 = /*#__PURE__*/jsxRuntime.jsx(IconComponent, { ...rest, ref: ref }); $[3] = IconComponent; $[4] = ref; $[5] = rest; $[6] = t0; } else { t0 = $[6]; } return t0; }); /** * @deprecated Use the icon component directly from `@primer/octicons-react` instead */ const Octicon = styled__default.default(Icon).withConfig({ shouldForwardProp(prop) { return prop !== 'sx'; } }).withConfig({ displayName: "Octicon", componentId: "sc-9kayk9-0" })(["", ""], ({ color, sx: sxProp }) => sx.default({ sx: { color, ...sxProp } })); module.exports = Octicon;