@primer/styled-octicons 16.1.1 → 16.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,87 @@
1
+ import React from 'react';
2
+ import { compose, space, color } from 'styled-system';
3
+ import css from '@styled-system/css';
4
+ import styled from 'styled-components';
5
+
6
+ var sizeMap = {
7
+ small: 16,
8
+ medium: 32,
9
+ large: 64
10
+ };
11
+
12
+ function getSvgProps(_ref) {
13
+ var ariaLabel = _ref['aria-label'],
14
+ className = _ref.className,
15
+ _ref$fill = _ref.fill,
16
+ fill = _ref$fill === undefined ? 'currentColor' : _ref$fill,
17
+ size = _ref.size,
18
+ verticalAlign = _ref.verticalAlign,
19
+ svgDataByHeight = _ref.svgDataByHeight;
20
+
21
+ var height = sizeMap[size] || size;
22
+ var naturalHeight = closestNaturalHeight(Object.keys(svgDataByHeight), height);
23
+ var naturalWidth = svgDataByHeight[naturalHeight].width;
24
+ var width = height * (naturalWidth / naturalHeight);
25
+ var path = svgDataByHeight[naturalHeight].path;
26
+
27
+ return {
28
+ 'aria-hidden': ariaLabel ? 'false' : 'true',
29
+ 'aria-label': ariaLabel,
30
+ role: 'img',
31
+ className: className,
32
+ viewBox: '0 0 ' + naturalWidth + ' ' + naturalHeight,
33
+ width: width,
34
+ height: height,
35
+ fill: fill,
36
+ style: {
37
+ display: 'inline-block',
38
+ userSelect: 'none',
39
+ verticalAlign: verticalAlign,
40
+ overflow: 'visible'
41
+ },
42
+ dangerouslySetInnerHTML: { __html: path }
43
+ };
44
+ }
45
+
46
+ function closestNaturalHeight(naturalHeights, height) {
47
+ return naturalHeights.map(function (naturalHeight) {
48
+ return parseInt(naturalHeight, 10);
49
+ }).reduce(function (acc, naturalHeight) {
50
+ return naturalHeight <= height ? naturalHeight : acc;
51
+ }, naturalHeights[0]);
52
+ }
53
+
54
+ var _extends = Object.assign || function (target) {
55
+ for (var i = 1; i < arguments.length; i++) {
56
+ var source = arguments[i];for (var key in source) {
57
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
58
+ target[key] = source[key];
59
+ }
60
+ }
61
+ }return target;
62
+ };
63
+
64
+ function CodeOfConductIcon(props) {
65
+ var svgDataByHeight = { "16": { "width": 16, "path": "<path fill-rule=\"evenodd\" d=\"M8.048 2.241c.964-.709 2.079-1.238 3.325-1.241a4.613 4.613 0 013.282 1.355c.41.408.757.86.996 1.428.238.568.348 1.206.347 1.968 0 2.193-1.505 4.254-3.081 5.862-1.496 1.526-3.213 2.796-4.249 3.563l-.22.163a.75.75 0 01-.895 0l-.221-.163c-1.036-.767-2.753-2.037-4.249-3.563C1.51 10.008.007 7.952.002 5.762a4.614 4.614 0 011.353-3.407C3.123.585 6.223.537 8.048 2.24zm-1.153.983c-.81.78-1.546 1.669-2.166 2.417-.184.222-.358.432-.52.623a.75.75 0 00.04 1.016c.35.35.697.697 1.043 1.047.866.875 2.292.914 3.185.032.264-.26.534-.528.802-.797.694-.694 1.8-.701 2.474-.03L12.92 8.7l.283.284c-.244.334-.515.666-.81.995l-1.384-1.28A.75.75 0 109.99 9.802l1.357 1.252c-.325.31-.656.606-.984.887l-1.48-1.366a.75.75 0 10-1.018 1.102L9.191 12.9c-.433.34-.838.643-1.191.905-1.04-.773-2.537-1.907-3.846-3.242C2.611 8.99 1.502 7.306 1.502 5.75a3.114 3.114 0 01.913-2.335c1.159-1.158 3.23-1.224 4.48-.191zm7.112 4.442c.313-.65.491-1.293.491-1.916v-.001c0-.614-.088-1.045-.23-1.385-.143-.339-.357-.633-.673-.949a3.113 3.113 0 00-2.218-.915c-1.092.003-2.165.627-3.226 1.602-.823.755-1.554 1.637-2.228 2.45l-.127.154.562.566a.756.756 0 001.066.02l.794-.79c1.258-1.258 3.312-1.31 4.594-.032.396.394.792.791 1.173 1.173l.022.023z\"></path>" }, "24": { "width": 24, "path": "<path fill-rule=\"evenodd\" d=\"M2.828 4.328C5.26 1.896 9.5 1.881 11.935 4.317c.024.024.046.05.067.076 1.391-1.078 2.993-1.886 4.777-1.89a6.216 6.216 0 014.424 1.825c.559.56 1.023 1.165 1.34 1.922.318.756.47 1.617.468 2.663 0 2.972-2.047 5.808-4.269 8.074-2.098 2.14-4.507 3.924-5.974 5.009l-.311.23a.752.752 0 01-.897 0l-.312-.23c-1.466-1.085-3.875-2.869-5.973-5.009-2.22-2.263-4.264-5.095-4.27-8.063v.012-.024.012a6.217 6.217 0 011.823-4.596zm8.033 1.042c-1.846-1.834-5.124-1.823-6.969.022a4.713 4.713 0 00-1.382 3.52c0 2.332 1.65 4.79 3.839 7.022 1.947 1.986 4.184 3.66 5.66 4.752a79.983 79.983 0 002.159-1.645l-2.14-1.974a.752.752 0 011.02-1.106l2.295 2.118c.616-.52 1.242-1.08 1.85-1.672l-2.16-1.992a.752.752 0 011.021-1.106l2.188 2.02a18.992 18.992 0 001.528-1.877l-.585-.586-1.651-1.652c-1.078-1.074-2.837-1.055-3.935.043-.379.38-.76.758-1.132 1.126-1.14 1.124-2.96 1.077-4.07-.043-.489-.495-.98-.988-1.475-1.482a.752.752 0 01-.04-1.019c.234-.276.483-.576.745-.893.928-1.12 2.023-2.442 3.234-3.576zm9.725 6.77c.579-1.08.92-2.167.92-3.228.002-.899-.128-1.552-.35-2.08-.22-.526-.551-.974-1.017-1.44a4.71 4.71 0 00-3.356-1.384c-1.66.004-3.25.951-4.77 2.346-1.18 1.084-2.233 2.353-3.188 3.506l-.351.423c.331.332.663.664.993.998a1.375 1.375 0 001.943.03c.37-.365.748-.74 1.125-1.118 1.662-1.663 4.373-1.726 6.06-.045.56.558 1.12 1.12 1.658 1.658l.333.334z\"></path>" } };
66
+ return React.createElement('svg', getSvgProps(_extends({}, props, { svgDataByHeight: svgDataByHeight })));
67
+ }
68
+
69
+ CodeOfConductIcon.defaultProps = {
70
+ className: 'octicon octicon-code-of-conduct',
71
+ size: 16,
72
+ verticalAlign: 'text-bottom'
73
+ };
74
+
75
+ // eslint-disable-next-line import/no-namespace
76
+
77
+ var COMMON = compose(space, color);
78
+
79
+ var sx = function sx(props) {
80
+ return css(props.sx);
81
+ };
82
+
83
+ /* THIS FILE IS GENERATED. DO NOT EDIT IT. */
84
+
85
+ var StyledCodeOfConductIcon = styled(CodeOfConductIcon)(COMMON, sx);
86
+
87
+ export default StyledCodeOfConductIcon;
package/dist/index.d.ts CHANGED
@@ -55,6 +55,7 @@ export const CircleIcon: Icon;
55
55
  export const CircleSlashIcon: Icon;
56
56
  export const ClockIcon: Icon;
57
57
  export const CodeIcon: Icon;
58
+ export const CodeOfConductIcon: Icon;
58
59
  export const CodeReviewIcon: Icon;
59
60
  export const CodeSquareIcon: Icon;
60
61
  export const CodescanIcon: Icon;
package/dist/index.esm.js CHANGED
@@ -39,6 +39,7 @@ export { default as CircleIcon } from './icons/CircleIcon';
39
39
  export { default as CircleSlashIcon } from './icons/CircleSlashIcon';
40
40
  export { default as ClockIcon } from './icons/ClockIcon';
41
41
  export { default as CodeIcon } from './icons/CodeIcon';
42
+ export { default as CodeOfConductIcon } from './icons/CodeOfConductIcon';
42
43
  export { default as CodeReviewIcon } from './icons/CodeReviewIcon';
43
44
  export { default as CodeSquareIcon } from './icons/CodeSquareIcon';
44
45
  export { default as CodescanIcon } from './icons/CodescanIcon';
package/dist/index.umd.js CHANGED
@@ -517,6 +517,17 @@
517
517
  verticalAlign: 'text-bottom'
518
518
  };
519
519
 
520
+ function CodeOfConductIcon(props) {
521
+ var svgDataByHeight = { "16": { "width": 16, "path": "<path fill-rule=\"evenodd\" d=\"M8.048 2.241c.964-.709 2.079-1.238 3.325-1.241a4.613 4.613 0 013.282 1.355c.41.408.757.86.996 1.428.238.568.348 1.206.347 1.968 0 2.193-1.505 4.254-3.081 5.862-1.496 1.526-3.213 2.796-4.249 3.563l-.22.163a.75.75 0 01-.895 0l-.221-.163c-1.036-.767-2.753-2.037-4.249-3.563C1.51 10.008.007 7.952.002 5.762a4.614 4.614 0 011.353-3.407C3.123.585 6.223.537 8.048 2.24zm-1.153.983c-.81.78-1.546 1.669-2.166 2.417-.184.222-.358.432-.52.623a.75.75 0 00.04 1.016c.35.35.697.697 1.043 1.047.866.875 2.292.914 3.185.032.264-.26.534-.528.802-.797.694-.694 1.8-.701 2.474-.03L12.92 8.7l.283.284c-.244.334-.515.666-.81.995l-1.384-1.28A.75.75 0 109.99 9.802l1.357 1.252c-.325.31-.656.606-.984.887l-1.48-1.366a.75.75 0 10-1.018 1.102L9.191 12.9c-.433.34-.838.643-1.191.905-1.04-.773-2.537-1.907-3.846-3.242C2.611 8.99 1.502 7.306 1.502 5.75a3.114 3.114 0 01.913-2.335c1.159-1.158 3.23-1.224 4.48-.191zm7.112 4.442c.313-.65.491-1.293.491-1.916v-.001c0-.614-.088-1.045-.23-1.385-.143-.339-.357-.633-.673-.949a3.113 3.113 0 00-2.218-.915c-1.092.003-2.165.627-3.226 1.602-.823.755-1.554 1.637-2.228 2.45l-.127.154.562.566a.756.756 0 001.066.02l.794-.79c1.258-1.258 3.312-1.31 4.594-.032.396.394.792.791 1.173 1.173l.022.023z\"></path>" }, "24": { "width": 24, "path": "<path fill-rule=\"evenodd\" d=\"M2.828 4.328C5.26 1.896 9.5 1.881 11.935 4.317c.024.024.046.05.067.076 1.391-1.078 2.993-1.886 4.777-1.89a6.216 6.216 0 014.424 1.825c.559.56 1.023 1.165 1.34 1.922.318.756.47 1.617.468 2.663 0 2.972-2.047 5.808-4.269 8.074-2.098 2.14-4.507 3.924-5.974 5.009l-.311.23a.752.752 0 01-.897 0l-.312-.23c-1.466-1.085-3.875-2.869-5.973-5.009-2.22-2.263-4.264-5.095-4.27-8.063v.012-.024.012a6.217 6.217 0 011.823-4.596zm8.033 1.042c-1.846-1.834-5.124-1.823-6.969.022a4.713 4.713 0 00-1.382 3.52c0 2.332 1.65 4.79 3.839 7.022 1.947 1.986 4.184 3.66 5.66 4.752a79.983 79.983 0 002.159-1.645l-2.14-1.974a.752.752 0 011.02-1.106l2.295 2.118c.616-.52 1.242-1.08 1.85-1.672l-2.16-1.992a.752.752 0 011.021-1.106l2.188 2.02a18.992 18.992 0 001.528-1.877l-.585-.586-1.651-1.652c-1.078-1.074-2.837-1.055-3.935.043-.379.38-.76.758-1.132 1.126-1.14 1.124-2.96 1.077-4.07-.043-.489-.495-.98-.988-1.475-1.482a.752.752 0 01-.04-1.019c.234-.276.483-.576.745-.893.928-1.12 2.023-2.442 3.234-3.576zm9.725 6.77c.579-1.08.92-2.167.92-3.228.002-.899-.128-1.552-.35-2.08-.22-.526-.551-.974-1.017-1.44a4.71 4.71 0 00-3.356-1.384c-1.66.004-3.25.951-4.77 2.346-1.18 1.084-2.233 2.353-3.188 3.506l-.351.423c.331.332.663.664.993.998a1.375 1.375 0 001.943.03c.37-.365.748-.74 1.125-1.118 1.662-1.663 4.373-1.726 6.06-.045.56.558 1.12 1.12 1.658 1.658l.333.334z\"></path>" } };
522
+ return React.createElement('svg', getSvgProps(_extends({}, props, { svgDataByHeight: svgDataByHeight })));
523
+ }
524
+
525
+ CodeOfConductIcon.defaultProps = {
526
+ className: 'octicon octicon-code-of-conduct',
527
+ size: 16,
528
+ verticalAlign: 'text-bottom'
529
+ };
530
+
520
531
  function CodeReviewIcon(props) {
521
532
  var svgDataByHeight = { "16": { "width": 16, "path": "<path fill-rule=\"evenodd\" d=\"M1.5 2.75a.25.25 0 01.25-.25h12.5a.25.25 0 01.25.25v8.5a.25.25 0 01-.25.25h-6.5a.75.75 0 00-.53.22L4.5 14.44v-2.19a.75.75 0 00-.75-.75h-2a.25.25 0 01-.25-.25v-8.5zM1.75 1A1.75 1.75 0 000 2.75v8.5C0 12.216.784 13 1.75 13H3v1.543a1.457 1.457 0 002.487 1.03L8.061 13h6.189A1.75 1.75 0 0016 11.25v-8.5A1.75 1.75 0 0014.25 1H1.75zm5.03 3.47a.75.75 0 010 1.06L5.31 7l1.47 1.47a.75.75 0 01-1.06 1.06l-2-2a.75.75 0 010-1.06l2-2a.75.75 0 011.06 0zm2.44 0a.75.75 0 000 1.06L10.69 7 9.22 8.47a.75.75 0 001.06 1.06l2-2a.75.75 0 000-1.06l-2-2a.75.75 0 00-1.06 0z\"></path>" }, "24": { "width": 24, "path": "<path d=\"M10.3 6.74a.75.75 0 01-.04 1.06l-2.908 2.7 2.908 2.7a.75.75 0 11-1.02 1.1l-3.5-3.25a.75.75 0 010-1.1l3.5-3.25a.75.75 0 011.06.04zm3.44 1.06a.75.75 0 111.02-1.1l3.5 3.25a.75.75 0 010 1.1l-3.5 3.25a.75.75 0 11-1.02-1.1l2.908-2.7-2.908-2.7z\"></path><path fill-rule=\"evenodd\" d=\"M1.5 4.25c0-.966.784-1.75 1.75-1.75h17.5c.966 0 1.75.784 1.75 1.75v12.5a1.75 1.75 0 01-1.75 1.75h-9.69l-3.573 3.573A1.457 1.457 0 015 21.043V18.5H3.25a1.75 1.75 0 01-1.75-1.75V4.25zM3.25 4a.25.25 0 00-.25.25v12.5c0 .138.112.25.25.25h2.5a.75.75 0 01.75.75v3.19l3.72-3.72a.75.75 0 01.53-.22h10a.25.25 0 00.25-.25V4.25a.25.25 0 00-.25-.25H3.25z\"></path>" } };
522
533
  return React.createElement('svg', getSvgProps(_extends({}, props, { svgDataByHeight: svgDataByHeight })));
@@ -2968,6 +2979,10 @@
2968
2979
 
2969
2980
  /* THIS FILE IS GENERATED. DO NOT EDIT IT. */
2970
2981
 
2982
+ var StyledCodeOfConductIcon = styled(CodeOfConductIcon)(COMMON, sx);
2983
+
2984
+ /* THIS FILE IS GENERATED. DO NOT EDIT IT. */
2985
+
2971
2986
  var StyledCodeReviewIcon = styled(CodeReviewIcon)(COMMON, sx);
2972
2987
 
2973
2988
  /* THIS FILE IS GENERATED. DO NOT EDIT IT. */
@@ -3835,6 +3850,7 @@
3835
3850
  exports.CircleSlashIcon = StyledCircleSlashIcon;
3836
3851
  exports.ClockIcon = StyledClockIcon;
3837
3852
  exports.CodeIcon = StyledCodeIcon;
3853
+ exports.CodeOfConductIcon = StyledCodeOfConductIcon;
3838
3854
  exports.CodeReviewIcon = StyledCodeReviewIcon;
3839
3855
  exports.CodeSquareIcon = StyledCodeSquareIcon;
3840
3856
  exports.CodescanIcon = StyledCodescanIcon;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primer/styled-octicons",
3
- "version": "16.1.1",
3
+ "version": "16.2.0",
4
4
  "description": "A scalable set of icons handcrafted with <3 by GitHub.",
5
5
  "homepage": "https://primer.style/octicons",
6
6
  "author": "GitHub, Inc.",