@uiw/react-github-corners
Advanced tools
+9
-12
@@ -12,3 +12,3 @@ "use strict"; | ||
| var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); | ||
| var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2")); | ||
@@ -19,6 +19,2 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties")); | ||
| function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } | ||
| function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } | ||
| var _default = function _default() { | ||
@@ -45,3 +41,3 @@ var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
| }; | ||
| return _react.default.createElement("a", (0, _extends2.default)({ | ||
| return /*#__PURE__*/_react.default.createElement("a", (0, _extends2.default)({ | ||
| href: props.href, | ||
@@ -51,7 +47,7 @@ "aria-label": "View source on GitHub" | ||
| className: 'github-corner ' + (className || '') | ||
| }), _react.default.createElement("svg", { | ||
| }), /*#__PURE__*/_react.default.createElement("svg", { | ||
| width: size, | ||
| height: size, | ||
| viewBox: "0 0 250 250", | ||
| style: _objectSpread({ | ||
| style: (0, _objectSpread2.default)({ | ||
| fill: bgColor, | ||
@@ -65,5 +61,5 @@ color: color, | ||
| "aria-hidden": "true" | ||
| }, _react.default.createElement("path", { | ||
| }, /*#__PURE__*/_react.default.createElement("path", { | ||
| d: "M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z" | ||
| }), _react.default.createElement("path", { | ||
| }), /*#__PURE__*/_react.default.createElement("path", { | ||
| d: "M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2", | ||
@@ -75,3 +71,3 @@ fill: "currentColor", | ||
| className: "octo-arm" | ||
| }), _react.default.createElement("path", { | ||
| }), /*#__PURE__*/_react.default.createElement("path", { | ||
| d: "M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z", | ||
@@ -83,3 +79,4 @@ fill: "currentColor", | ||
| exports.default = _default; | ||
| exports.default = _default; | ||
| module.exports = exports.default; | ||
| //# sourceMappingURL=index.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../src/index.tsx"],"names":["props","size","fixed","zIndex","className","bgColor","color","position","otherProps","styl","left","transform","right","href","fill","border","top","transformOrigin"],"mappings":";;;;;;;;;;;;;;;AACA;;;;;;eAuCe,oBAAoC;AAAA,MAAnCA,KAAmC,uEAAP,EAAO;AAAA,oBAC+EA,KAD/E,CACzCC,IADyC;AAAA,MACz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AGE,IAAA,KAAK,EAAE;AAAEQ,MAAAA,eAAe,EAAE;AAAnB,KAHT;AAIE,IAAA,SAAS,EAAC;AAJZ,IAfF,EAqBE;AACE,IAAA,CAAC,EAAC,qhBADJ;AAEE,IAAA,IAAI,EAAC,cAFP;AAGE,IAAA,SAAS,EAAC;AAHZ,IArBF,CADF,CADF;AA+BD,C","sourcesContent":["\nimport React from 'react';\nimport './style/index.css';\n\nexport interface GitHubCornersProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {\n /**\n * The link to your project page.\n */\n href?: string;\n /**\n * The width and height of the corner. \n * Default: `80`\n */\n size?: number;\n /**\n * The background color of the corner.\n * Default: `#151513`\n */\n bgColor?: string;\n /**\n * The Github logo color of the corner.\n * Default: `#fff`\n */\n color?: string;\n /**\n * The position of corner. \n * Default: `right`\n */\n position?: 'left' | 'right';\n /**\n * It is positioned relative to the initial containing block established.\n * Default: `false`\n */\n fixed?: boolean;\n /**\n * Sets the z-order of a positioned element and its descendants or flex items.\n */\n zIndex?: number;\n}\n\nexport default (props: GitHubCornersProps = {}) => {\n const { size = 80, fixed = false, zIndex, className, bgColor = '#151513', color = '#fff', position = 'right', ...otherProps } = props;\n const styl = position === 'left' ? { left: 0, transform: 'scale(-1, 1)' } : { right: 0 };\n return (\n <a href={props.href} aria-label=\"View source on GitHub\" {...otherProps} className={'github-corner ' + (className || '')} >\n <svg\n width={size}\n height={size}\n viewBox=\"0 0 250 250\"\n style={{\n fill: bgColor,\n color: color,\n position: fixed ? 'fixed' : 'absolute',\n border: 0,\n top: 0,\n zIndex,\n ...styl,\n }}\n aria-hidden=\"true\">\n <path d=\"M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z\" />\n <path\n d=\"M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2\"\n fill=\"currentColor\"\n style={{ transformOrigin: '130px 106px' }}\n className=\"octo-arm\"\n />\n <path\n d=\"M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z\"\n fill=\"currentColor\"\n className=\"octo-body\"\n />\n </svg>\n </a>\n )\n}"]} | ||
| {"version":3,"sources":["../../src/index.tsx"],"names":["props","size","fixed","zIndex","className","bgColor","color","position","otherProps","styl","left","transform","right","href","fill","border","top","transformOrigin"],"mappings":";;;;;;;;;;;;;;;AACA;;eAuCe,oBAAoC;AAAA,MAAnCA,KAAmC,uEAAP,EAAO;AAAA,oBAC+EA,KAD/E,CACzCC,IADyC;AAAA,MACzCA,IADyC,4BAClC,EADkC;AAAA,qBAC+ED,KAD/E,CAC9BE,KAD8B;AAAA,MAC9BA,KAD8B,6BACtB,KADsB;AAAA,MACfC,MADe,GAC+EH,KAD/E,CACfG,MADe;AAAA,MACPC,SADO,GAC+EJ,KAD/E,CACPI,SADO;AAAA,uBAC+EJ,KAD/E,CACIK,OADJ;AAAA,MACIA,OADJ,+BACc,SADd;AAAA,qBAC+EL,KAD/E,CACyBM,KADzB;AAAA,MACyBA,KADzB,6BACiC,MADjC;AAAA,wBAC+EN,KAD/E,CACyCO,QADzC;AAAA,MACyCA,QADzC,gCACoD,OADpD;AAAA,MACgEC,UADhE,0CAC+ER,KAD/E;AAEjD,MAAMS,IAAI,GAAGF,QAAQ,KAAK,MAAb,GAAsB;AAAEG,IAAAA,IAAI,EAAE,CAAR;AAAWC,IAAAA,SAAS,EAAE;AAAtB,GAAtB,GAA+D;AAAEC,IAAAA,KAAK,EAAE;AAAT,GAA5E;AACA,sBACE;AAAG,IAAA,IAAI,EAAEZ,KAAK,CAACa,IAAf;AAAqB,kBAAW;AAAhC,KAA4DL,UAA5D;AAAwE,IAAA,SAAS,EAAE,oBAAoBJ,SAAS,IAAI,EAAjC;AAAnF,mBACE;AACE,IAAA,KAAK,EAAEH,IADT;AAEE,IAAA,MAAM,EAAEA,IAFV;AAGE,IAAA,OAAO,EAAC,aAHV;AAIE,IAAA,KAAK;AACHa,MAAAA,IAAI,EAAET,OADH;AAEHC,MAAAA,KAAK,EAAEA,KAFJ;AAGHC,MAAAA,QAAQ,EAAEL,KAAK,GAAG,OAAH,GAAa,UAHzB;AAIHa,MAAAA,MAAM,EAAE,CAJL;AAKHC,MAAAA,GAAG,EAAE,CALF;AAMHb,MAAAA,MAAM,EAANA;AANG,OAOAM,IAPA,CAJP;AAaE,mBAAY;AAbd,kBAcE;AAAM,IAAA,CAAC,EAAC;AAAR,IAdF,eAeE;AACE,IAAA,CAAC,EAAC,0LADJ;AAEE,IAAA,IAAI,EAAC,cAFP;AAGE,IAAA,KAAK,EAAE;AAAEQ,MAAAA,eAAe,EAAE;AAAnB,KAHT;AAIE,IAAA,SAAS,EAAC;AAJZ,IAfF,eAqBE;AACE,IAAA,CAAC,EAAC,qhBADJ;AAEE,IAAA,IAAI,EAAC,cAFP;AAGE,IAAA,SAAS,EAAC;AAHZ,IArBF,CADF,CADF;AA+BD,C","sourcesContent":["\nimport React from 'react';\nimport './style/index.css';\n\nexport interface GitHubCornersProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {\n /**\n * The link to your project page.\n */\n href?: string;\n /**\n * The width and height of the corner. \n * Default: `80`\n */\n size?: number;\n /**\n * The background color of the corner.\n * Default: `#151513`\n */\n bgColor?: string;\n /**\n * The Github logo color of the corner.\n * Default: `#fff`\n */\n color?: string;\n /**\n * The position of corner. \n * Default: `right`\n */\n position?: 'left' | 'right';\n /**\n * It is positioned relative to the initial containing block established.\n * Default: `false`\n */\n fixed?: boolean;\n /**\n * Sets the z-order of a positioned element and its descendants or flex items.\n */\n zIndex?: number;\n}\n\nexport default (props: GitHubCornersProps = {}) => {\n const { size = 80, fixed = false, zIndex, className, bgColor = '#151513', color = '#fff', position = 'right', ...otherProps } = props;\n const styl = position === 'left' ? { left: 0, transform: 'scale(-1, 1)' } : { right: 0 };\n return (\n <a href={props.href} aria-label=\"View source on GitHub\" {...otherProps} className={'github-corner ' + (className || '')} >\n <svg\n width={size}\n height={size}\n viewBox=\"0 0 250 250\"\n style={{\n fill: bgColor,\n color: color,\n position: fixed ? 'fixed' : 'absolute',\n border: 0,\n top: 0,\n zIndex,\n ...styl,\n }}\n aria-hidden=\"true\">\n <path d=\"M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z\" />\n <path\n d=\"M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2\"\n fill=\"currentColor\"\n style={{ transformOrigin: '130px 106px' }}\n className=\"octo-arm\"\n />\n <path\n d=\"M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z\"\n fill=\"currentColor\"\n className=\"octo-body\"\n />\n </svg>\n </a>\n )\n}"]} |
+6
-11
| import _extends from "@babel/runtime/helpers/esm/extends"; | ||
| import _defineProperty from "@babel/runtime/helpers/esm/defineProperty"; | ||
| import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2"; | ||
| import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties"; | ||
| function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } | ||
| function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } | ||
| import React from 'react'; | ||
@@ -34,3 +29,3 @@ import './style/index.css'; | ||
| }; | ||
| return React.createElement("a", _extends({ | ||
| return /*#__PURE__*/React.createElement("a", _extends({ | ||
| href: props.href, | ||
@@ -40,3 +35,3 @@ "aria-label": "View source on GitHub" | ||
| className: 'github-corner ' + (className || '') | ||
| }), React.createElement("svg", { | ||
| }), /*#__PURE__*/React.createElement("svg", { | ||
| width: size, | ||
@@ -54,5 +49,5 @@ height: size, | ||
| "aria-hidden": "true" | ||
| }, React.createElement("path", { | ||
| }, /*#__PURE__*/React.createElement("path", { | ||
| d: "M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z" | ||
| }), React.createElement("path", { | ||
| }), /*#__PURE__*/React.createElement("path", { | ||
| d: "M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2", | ||
@@ -64,3 +59,3 @@ fill: "currentColor", | ||
| className: "octo-arm" | ||
| }), React.createElement("path", { | ||
| }), /*#__PURE__*/React.createElement("path", { | ||
| d: "M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z", | ||
@@ -67,0 +62,0 @@ fill: "currentColor", |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../src/index.tsx"],"names":["React","props","size","fixed","zIndex","className","bgColor","color","position","otherProps","styl","left","transform","right","href","fill","border","top","transformOrigin"],"mappings":";;;;;;;;AACA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAO,mBAAP;AAsCA,gBAAe,YAAoC;AAAA,MAAnCC,KAAmC,uEAAP,EAAO;;AAAA,oBAC+EA,KAD/E,CACzCC,IADyC;AAAA,MACzCA,IADyC,4BAClC,EADkC;AAAA,qBAC+ED,KAD/E,CAC9BE,KAD8B;AAAA,MAC9BA,KAD8B,6BACtB,KADsB;AAAA,MACfC,MADe,GAC+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A,CAAC,EAAC,qhBADJ;AAEE,IAAA,IAAI,EAAC,cAFP;AAGE,IAAA,SAAS,EAAC;AAHZ,IArBF,CADF,CADF;AA+BD,CAlCD","sourcesContent":["\nimport React from 'react';\nimport './style/index.css';\n\nexport interface GitHubCornersProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {\n /**\n * The link to your project page.\n */\n href?: string;\n /**\n * The width and height of the corner. \n * Default: `80`\n */\n size?: number;\n /**\n * The background color of the corner.\n * Default: `#151513`\n */\n bgColor?: string;\n /**\n * The Github logo color of the corner.\n * Default: `#fff`\n */\n color?: string;\n /**\n * The position of corner. \n * Default: `right`\n */\n position?: 'left' | 'right';\n /**\n * It is positioned relative to the initial containing block established.\n * Default: `false`\n */\n fixed?: boolean;\n /**\n * Sets the z-order of a positioned element and its descendants or flex items.\n */\n zIndex?: number;\n}\n\nexport default (props: GitHubCornersProps = {}) => {\n const { size = 80, fixed = false, zIndex, className, bgColor = '#151513', color = '#fff', position = 'right', ...otherProps } = props;\n const styl = position === 'left' ? { left: 0, transform: 'scale(-1, 1)' } : { right: 0 };\n return (\n <a href={props.href} aria-label=\"View source on GitHub\" {...otherProps} className={'github-corner ' + (className || '')} >\n <svg\n width={size}\n height={size}\n viewBox=\"0 0 250 250\"\n style={{\n fill: bgColor,\n color: color,\n position: fixed ? 'fixed' : 'absolute',\n border: 0,\n top: 0,\n zIndex,\n ...styl,\n }}\n aria-hidden=\"true\">\n <path d=\"M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z\" />\n <path\n d=\"M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2\"\n fill=\"currentColor\"\n style={{ transformOrigin: '130px 106px' }}\n className=\"octo-arm\"\n />\n <path\n d=\"M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z\"\n fill=\"currentColor\"\n className=\"octo-body\"\n />\n </svg>\n </a>\n )\n}"]} | ||
| {"version":3,"sources":["../../src/index.tsx"],"names":["React","props","size","fixed","zIndex","className","bgColor","color","position","otherProps","styl","left","transform","right","href","fill","border","top","transformOrigin"],"mappings":";;;AACA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAO,mBAAP;AAsCA,gBAAe,YAAoC;AAAA,MAAnCC,KAAmC,uEAAP,EAAO;;AAAA,oBAC+EA,KAD/E,CACzCC,IADyC;AAAA,MACzCA,IADyC,4BAClC,EADkC;AAAA,qBAC+ED,KAD/E,CAC9BE,KAD8B;AAAA,MAC9BA,KAD8B,6BACtB,KADsB;AAAA,MACfC,MADe,GAC+EH,KAD/E,CACfG,MADe;AAAA,MACPC,SADO,GAC+EJ,KAD/E,CACPI,SADO;AAAA,uBAC+EJ,KAD/E,CACIK,OADJ;AAAA,MACIA,OADJ,+BACc,SADd;AAAA,qBAC+EL,KAD/E,CACyBM,KADzB;AAAA,MACyBA,KADzB,6BACiC,MADjC;AAAA,wBAC+EN,KAD/E,CACyCO,QADzC;AAAA,MACyCA,QADzC,gCACoD,OADpD;AAAA,MACgEC,UADhE,4BAC+ER,KAD/E;;AAEjD,MAAMS,IAAI,GAAGF,QAAQ,KAAK,MAAb,GAAsB;AAAEG,IAAAA,IAAI,EAAE,CAAR;AAAWC,IAAAA,SAAS,EAAE;AAAtB,GAAtB,GAA+D;AAAEC,IAAAA,KAAK,EAAE;AAAT,GAA5E;AACA,sBACE;AAAG,IAAA,IAAI,EAAEZ,KAAK,CAACa,IAAf;AAAqB,kBAAW;AAAhC,KAA4DL,UAA5D;AAAwE,IAAA,SAAS,EAAE,oBAAoBJ,SAAS,IAAI,EAAjC;AAAnF,mBACE;AACE,IAAA,KAAK,EAAEH,IADT;AAEE,IAAA,MAAM,EAAEA,IAFV;AAGE,IAAA,OAAO,EAAC,aAHV;AAIE,IAAA,KAAK;AACHa,MAAAA,IAAI,EAAET,OADH;AAEHC,MAAAA,KAAK,EAAEA,KAFJ;AAGHC,MAAAA,QAAQ,EAAEL,KAAK,GAAG,OAAH,GAAa,UAHzB;AAIHa,MAAAA,MAAM,EAAE,CAJL;AAKHC,MAAAA,GAAG,EAAE,CALF;AAMHb,MAAAA,MAAM,EAANA;AANG,OAOAM,IAPA,CAJP;AAaE,mBAAY;AAbd,kBAcE;AAAM,IAAA,CAAC,EAAC;AAAR,IAdF,eAeE;AACE,IAAA,CAAC,EAAC,0LADJ;AAEE,IAAA,IAAI,EAAC,cAFP;AAGE,IAAA,KAAK,EAAE;AAAEQ,MAAAA,eAAe,EAAE;AAAnB,KAHT;AAIE,IAAA,SAAS,EAAC;AAJZ,IAfF,eAqBE;AACE,IAAA,CAAC,EAAC,qhBADJ;AAEE,IAAA,IAAI,EAAC,cAFP;AAGE,IAAA,SAAS,EAAC;AAHZ,IArBF,CADF,CADF;AA+BD,CAlCD","sourcesContent":["\nimport React from 'react';\nimport './style/index.css';\n\nexport interface GitHubCornersProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {\n /**\n * The link to your project page.\n */\n href?: string;\n /**\n * The width and height of the corner. \n * Default: `80`\n */\n size?: number;\n /**\n * The background color of the corner.\n * Default: `#151513`\n */\n bgColor?: string;\n /**\n * The Github logo color of the corner.\n * Default: `#fff`\n */\n color?: string;\n /**\n * The position of corner. \n * Default: `right`\n */\n position?: 'left' | 'right';\n /**\n * It is positioned relative to the initial containing block established.\n * Default: `false`\n */\n fixed?: boolean;\n /**\n * Sets the z-order of a positioned element and its descendants or flex items.\n */\n zIndex?: number;\n}\n\nexport default (props: GitHubCornersProps = {}) => {\n const { size = 80, fixed = false, zIndex, className, bgColor = '#151513', color = '#fff', position = 'right', ...otherProps } = props;\n const styl = position === 'left' ? { left: 0, transform: 'scale(-1, 1)' } : { right: 0 };\n return (\n <a href={props.href} aria-label=\"View source on GitHub\" {...otherProps} className={'github-corner ' + (className || '')} >\n <svg\n width={size}\n height={size}\n viewBox=\"0 0 250 250\"\n style={{\n fill: bgColor,\n color: color,\n position: fixed ? 'fixed' : 'absolute',\n border: 0,\n top: 0,\n zIndex,\n ...styl,\n }}\n aria-hidden=\"true\">\n <path d=\"M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z\" />\n <path\n d=\"M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2\"\n fill=\"currentColor\"\n style={{ transformOrigin: '130px 106px' }}\n className=\"octo-arm\"\n />\n <path\n d=\"M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z\"\n fill=\"currentColor\"\n className=\"octo-body\"\n />\n </svg>\n </a>\n )\n}"]} |
+11
-8
| { | ||
| "name": "@uiw/react-github-corners", | ||
| "version": "1.1.3", | ||
| "version": "1.2.0", | ||
| "description": "Add a Github corner to your project page, This GitHub corners for react component.", | ||
@@ -38,9 +38,12 @@ "main": "lib/cjs/index.js", | ||
| "devDependencies": { | ||
| "@types/react": "^16.9.11", | ||
| "@types/react-dom": "^16.9.4", | ||
| "kkt": "^5.3.0", | ||
| "raw-loader": "^3.1.0", | ||
| "react": "^16.12.0", | ||
| "react-dom": "^16.12.0", | ||
| "tsbb": "^1.4.0" | ||
| "@types/react": "16.9.11", | ||
| "@types/react-dom": "16.9.4", | ||
| "@uiw/react-markdown-preview": "1.0.8", | ||
| "@uiw/react-shields": "1.1.0", | ||
| "@uiw/reset.css": "1.0.3", | ||
| "kkt": "5.9.0", | ||
| "raw-loader": "4.0.1", | ||
| "react": "16.13.1", | ||
| "react-dom": "16.13.1", | ||
| "tsbb": "1.7.6" | ||
| }, | ||
@@ -47,0 +50,0 @@ "eslintConfig": { |
+54
-7
| react-github-corners | ||
| === | ||
| <!--dividing--> | ||
@@ -11,3 +12,2 @@ [](https://github.com/uiwjs/react-github-corners/issues) | ||
| <!--dividing--> | ||
@@ -39,4 +39,42 @@ Add a Github corner to your project page, This [GitHub corners](https://uiwjs.github.io/react-github-corners) for [**@react**](https://github.com/facebook/react) component. Visit [https://uiwjs.github.io/react-github-corners](https://uiwjs.github.io/react-github-corners) to preview the example effects. | ||
| ## Documentation | ||
| ## Props | ||
| ```typescript | ||
| interface GitHubCornersProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> { | ||
| /** | ||
| * The link to your project page. | ||
| */ | ||
| href?: string; | ||
| /** | ||
| * The width and height of the corner. | ||
| * Default: `80` | ||
| */ | ||
| size?: number; | ||
| /** | ||
| * The background color of the corner. | ||
| * Default: `#151513` | ||
| */ | ||
| bgColor?: string; | ||
| /** | ||
| * The Github logo color of the corner. | ||
| * Default: `#fff` | ||
| */ | ||
| color?: string; | ||
| /** | ||
| * The position of corner. | ||
| * Default: `right` | ||
| */ | ||
| position?: 'left' | 'right'; | ||
| /** | ||
| * It is positioned relative to the initial containing block established. | ||
| * Default: `false` | ||
| */ | ||
| fixed?: boolean; | ||
| /** | ||
| * Sets the z-order of a positioned element and its descendants or flex items. | ||
| */ | ||
| zIndex?: number; | ||
| } | ||
| ``` | ||
| | Property Name | Type | Default Value | Description | | ||
@@ -54,15 +92,24 @@ | ---- | ---- | ---- | ---- | | ||
| Runs the project in development mode. | ||
| ```bash | ||
| # Step 1, Run first, the listener component compiles the output .js file | ||
| # Step 1, run first, listen to the component compile and output the .js file | ||
| npm run ts:watch | ||
| # Step 2, Listen for compiled output type .d.ts file | ||
| # Step 2, listen for compilation output type .d.ts file | ||
| npm run types:watch | ||
| # Step 3, Development mode, listen to compile preview site instance | ||
| # Step 3, development mode, listen to compile preview website instance | ||
| npm run doc:dev | ||
| ``` | ||
| Compile and release | ||
| Builds the app for production to the build folder. | ||
| ```bash | ||
| npm run released | ||
| ``` | ||
| ``` | ||
| The build is minified and the filenames include the hashes. | ||
| Your app is ready to be deployed! | ||
| ## License | ||
| Licensed under the MIT License. |
113
73.85%30889
-1.59%10
42.86%544
-1.27%