@pie-lib/icons 4.0.2-next.1 → 4.0.3-next.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.
Files changed (65) hide show
  1. package/dist/correct-icon.d.ts +78 -0
  2. package/dist/correct-icon.js +59 -0
  3. package/dist/correct-response-icon.d.ts +24 -0
  4. package/dist/correct-response-icon.js +96 -0
  5. package/dist/icon-base.d.ts +78 -0
  6. package/dist/icon-base.js +40 -0
  7. package/dist/icon-root.d.ts +71 -0
  8. package/dist/icon-root.js +57 -0
  9. package/dist/incorrect-icon.d.ts +78 -0
  10. package/dist/incorrect-icon.js +71 -0
  11. package/dist/index.d.ts +17 -0
  12. package/dist/index.js +9 -0
  13. package/dist/instructions-icon.d.ts +13 -0
  14. package/dist/instructions-icon.js +179 -0
  15. package/dist/learn-more-icon.d.ts +18 -0
  16. package/dist/learn-more-icon.js +82 -0
  17. package/dist/nothing-submitted-icon.d.ts +14 -0
  18. package/dist/nothing-submitted-icon.js +92 -0
  19. package/dist/partially-correct-icon.d.ts +78 -0
  20. package/dist/partially-correct-icon.js +64 -0
  21. package/dist/show-rationale-icon.d.ts +13 -0
  22. package/dist/show-rationale-icon.js +136 -0
  23. package/dist/sized.d.ts +22 -0
  24. package/dist/sized.js +19 -0
  25. package/package.json +25 -21
  26. package/CHANGELOG.json +0 -1
  27. package/CHANGELOG.md +0 -569
  28. package/LICENSE.md +0 -5
  29. package/lib/correct-icon.js +0 -79
  30. package/lib/correct-icon.js.map +0 -1
  31. package/lib/correct-response-icon.js +0 -125
  32. package/lib/correct-response-icon.js.map +0 -1
  33. package/lib/icon-base.js +0 -93
  34. package/lib/icon-base.js.map +0 -1
  35. package/lib/icon-root.js +0 -106
  36. package/lib/icon-root.js.map +0 -1
  37. package/lib/incorrect-icon.js +0 -88
  38. package/lib/incorrect-icon.js.map +0 -1
  39. package/lib/index.js +0 -63
  40. package/lib/index.js.map +0 -1
  41. package/lib/instructions-icon.js +0 -205
  42. package/lib/instructions-icon.js.map +0 -1
  43. package/lib/learn-more-icon.js +0 -104
  44. package/lib/learn-more-icon.js.map +0 -1
  45. package/lib/nothing-submitted-icon.js +0 -175
  46. package/lib/nothing-submitted-icon.js.map +0 -1
  47. package/lib/partially-correct-icon.js +0 -81
  48. package/lib/partially-correct-icon.js.map +0 -1
  49. package/lib/show-rationale-icon.js +0 -187
  50. package/lib/show-rationale-icon.js.map +0 -1
  51. package/lib/sized.js +0 -32
  52. package/lib/sized.js.map +0 -1
  53. package/src/__tests__/index.test.js +0 -305
  54. package/src/correct-icon.jsx +0 -54
  55. package/src/correct-response-icon.jsx +0 -106
  56. package/src/icon-base.jsx +0 -55
  57. package/src/icon-root.jsx +0 -53
  58. package/src/incorrect-icon.jsx +0 -67
  59. package/src/index.js +0 -19
  60. package/src/instructions-icon.jsx +0 -189
  61. package/src/learn-more-icon.jsx +0 -94
  62. package/src/nothing-submitted-icon.jsx +0 -136
  63. package/src/partially-correct-icon.jsx +0 -56
  64. package/src/show-rationale-icon.jsx +0 -145
  65. package/src/sized.jsx +0 -25
@@ -1,136 +0,0 @@
1
- import PropTypes from 'prop-types';
2
- import React from 'react';
3
- import { IconRoot } from './icon-root';
4
-
5
- // Exclamation mark
6
- const Exclamation = ({ fill }) => (
7
- <g>
8
- <rect x="19.3" y="10.3" width="4.5" height="12.7" fill={fill} />
9
- <rect x="19.3" y="26.2" width="4.5" height="4.5" fill={fill} />
10
- </g>
11
- );
12
-
13
- Exclamation.propTypes = { fill: PropTypes.string.isRequired };
14
-
15
- // Octagon background
16
- const Octagon = ({ fill }) => (
17
- <polygon points="14.8,4.5 5.6,13.8 5.6,27 14.8,36.5 28.1,36.5 37.6,27 37.6,13.8 28.1,4.5" fill={fill} />
18
- );
19
-
20
- Octagon.propTypes = { fill: PropTypes.string.isRequired };
21
-
22
- // Emoji variant
23
- const Emoji = ({ fill }) => (
24
- <g>
25
- <rect x="23.8" y="15" width="3.5" height="4.4" fill={fill} />
26
- <rect x="16" y="15" width="3.5" height="4.4" fill={fill} />
27
- <path
28
- d="M24.2,27.1h-5.1c-0.8,0-1.5-0.7-1.5-1.5v0c0-0.8,0.7-1.5,1.5-1.5h5.1c0.8,0,1.5,0.7,1.5,1.5v0
29
- C25.7,26.4,25,27.1,24.2,27.1z"
30
- fill={fill}
31
- />
32
- </g>
33
- );
34
-
35
- Emoji.propTypes = { fill: PropTypes.string.isRequired };
36
-
37
- // Exported NothingSubmitted icon
38
- export class NothingSubmitted extends React.Component {
39
- constructor(props) {
40
- super(props);
41
- const { fg = '#464146', bg = 'white' } = this.props;
42
-
43
- this.icons = {
44
- check: (
45
- <IconRoot>
46
- <Octagon fill={bg} />
47
- <Exclamation fill={fg} />
48
- </IconRoot>
49
- ),
50
- emoji: (
51
- <IconRoot>
52
- <Octagon fill={bg} />
53
- <Emoji fill={fg} />
54
- </IconRoot>
55
- ),
56
- feedback: {
57
- check: (
58
- <IconRoot>
59
- <Octagon fill={bg} />
60
- <Emoji fill={fg} />
61
- </IconRoot>
62
- ),
63
- emoji: (
64
- <IconRoot>
65
- <Octagon fill={bg} />
66
- <Emoji fill={fg} />
67
- </IconRoot>
68
- ),
69
- square: {
70
- check: (
71
- <IconRoot>
72
- <Octagon fill={bg} />
73
- <Exclamation fill={fg} />
74
- </IconRoot>
75
- ),
76
- emoji: (
77
- <IconRoot>
78
- <Octagon fill={bg} />
79
- <Emoji fill={fg} />
80
- </IconRoot>
81
- ),
82
- open: {
83
- check: (
84
- <IconRoot>
85
- <Exclamation fill={bg} />
86
- </IconRoot>
87
- ),
88
- emoji: (
89
- <IconRoot>
90
- <Emoji fill={bg} />
91
- </IconRoot>
92
- ),
93
- },
94
- },
95
- },
96
- };
97
- }
98
-
99
- render() {
100
- const { iconSet, category, shape, open } = this.props;
101
-
102
- if (category === undefined) {
103
- return this.icons[iconSet];
104
- } else {
105
- if (shape === undefined) {
106
- return this.icons.feedback[iconSet];
107
- } else {
108
- if (open === true) {
109
- return this.icons.feedback.square.open[iconSet];
110
- } else {
111
- return this.icons.feedback.square[iconSet];
112
- }
113
- }
114
- }
115
- }
116
- }
117
-
118
- NothingSubmitted.propTypes = {
119
- iconSet: PropTypes.oneOf(['emoji', 'check', undefined]),
120
- shape: PropTypes.oneOf(['square', undefined]),
121
- category: PropTypes.oneOf(['feedback', undefined]),
122
- open: PropTypes.bool,
123
- fg: PropTypes.string,
124
- bg: PropTypes.string,
125
- };
126
-
127
- NothingSubmitted.defaultProps = {
128
- iconSet: 'check',
129
- shape: undefined,
130
- category: undefined,
131
- open: false,
132
- fg: '#464146', // foreground color
133
- bg: 'white', // background color
134
- };
135
-
136
- export default NothingSubmitted;
@@ -1,56 +0,0 @@
1
- import IconBase from './icon-base';
2
- import PropTypes from 'prop-types';
3
- import React from 'react';
4
-
5
- // Check mark SVG
6
- const Check = ({ fill }) => (
7
- <g transform="translate(0, 0)">
8
- <polygon points="27.5,13.4 23.9,11.4 15.9,25.8 19.1,28.6" fill={fill} />
9
- <polygon points="16.2,20.6 14.4,19.2 11.8,22.3 14.1,24.3" fill={fill} />
10
- </g>
11
- );
12
-
13
- Check.propTypes = { fill: PropTypes.string.isRequired };
14
-
15
- // Emoji variant
16
- const Emoji = ({ fill }) => (
17
- <g transform="translate(2, 0)">
18
- <rect x="20.6" y="11.8" width="4" height="5" fill={fill} />
19
- <rect x="11.5" y="11.8" width="4" height="5" fill={fill} />
20
- <rect
21
- x="10.9"
22
- y="22.9"
23
- transform="matrix(0.9794 -0.2019 0.2019 0.9794 -4.6237 4.1559)"
24
- width="14.3"
25
- height="3.7"
26
- fill={fill}
27
- />
28
- </g>
29
- );
30
-
31
- Emoji.propTypes = { fill: PropTypes.string.isRequired };
32
-
33
- // Exported PartiallyCorrect icon
34
- export const PartiallyCorrect = IconBase(Check, Emoji);
35
-
36
- PartiallyCorrect.propTypes = {
37
- iconSet: PropTypes.oneOf(['emoji', 'check']),
38
- shape: PropTypes.oneOf(['round', 'square']),
39
- category: PropTypes.oneOf(['feedback', undefined]),
40
- open: PropTypes.bool,
41
- fg: PropTypes.string,
42
- bg: PropTypes.string,
43
- size: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
44
- };
45
-
46
- PartiallyCorrect.defaultProps = {
47
- iconSet: 'check',
48
- shape: 'round',
49
- category: undefined,
50
- open: false,
51
- fg: '#4aaf46', // foreground color
52
- bg: '#c1e1ac', // background color
53
- size: 30,
54
- };
55
-
56
- export default PartiallyCorrect;
@@ -1,145 +0,0 @@
1
- import PropTypes from 'prop-types';
2
- import React from 'react';
3
- import { normalizeSize } from './sized';
4
-
5
- // Info icon
6
- const Info = ({ fill }) => (
7
- <g>
8
- <rect x="-115" y="136.7" width="3" height="3" fill={fill} />
9
- <polygon
10
- points="-112,147.7 -112,141.7 -115.8,141.7 -115.8,143.7 -114,143.7 -114,147.7 -116.2,147.7 -116.2,149.7 -109.8,149.7 -109.8,147.7"
11
- fill={fill}
12
- />
13
- </g>
14
- );
15
-
16
- Info.propTypes = { fill: PropTypes.string.isRequired };
17
-
18
- // Border path
19
- const Border = ({ fill }) => (
20
- <path
21
- d="M-113,158.5c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-105,158.5-113,158.5z
22
- M-113,130.5c-7.4,0-13.5,6.1-13.5,13.5s6.1,13.5,13.5,13.5s13.5-6.1,13.5-13.5S-105.6,130.5-113,130.5z"
23
- fill={fill}
24
- />
25
- );
26
-
27
- Border.propTypes = { fill: PropTypes.string.isRequired };
28
-
29
- // Circle background
30
- const Circle = ({ fill = '#FFFFFF' }) => (
31
- <g>
32
- <path
33
- style={{
34
- fill: '#D0CAC5',
35
- stroke: '#E6E3E0',
36
- strokeWidth: 0.75,
37
- strokeMiterlimit: 10,
38
- }}
39
- d="M-111.7,160.9c-8.5,0-15.5-6.9-15.5-15.5c0-8.5,6.9-15.5,15.5-15.5s15.5,6.9,15.5,15.5C-96.2,154-103.1,160.9-111.7,160.9z"
40
- />
41
- <path
42
- style={{
43
- fill: '#B3ABA4',
44
- stroke: '#CDC7C2',
45
- strokeWidth: 0.5,
46
- strokeMiterlimit: 10,
47
- }}
48
- d="M-112,159.5c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-104,159.5-112,159.5z"
49
- />
50
- <circle cx="-113" cy="144" r="14" fill={fill} />
51
- </g>
52
- );
53
-
54
- Circle.propTypes = { fill: PropTypes.string };
55
-
56
- // Root wrapper for sizing
57
- const Root = ({ children, size }) => {
58
- const normalizedSize = normalizeSize(size);
59
- const style = {
60
- height: normalizedSize,
61
- width: normalizedSize,
62
- display: 'inline-block',
63
- position: 'relative',
64
- };
65
- return (
66
- <div style={style}>
67
- <svg preserveAspectRatio="xMinYMin meet" viewBox="-129 128 34 34">
68
- {children}
69
- </svg>
70
- </div>
71
- );
72
- };
73
-
74
- Root.propTypes = {
75
- children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]).isRequired,
76
- size: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
77
- };
78
-
79
- // Main ShowRationale component
80
- export class ShowRationale extends React.Component {
81
- render() {
82
- const { iconSet, open, fg = '#1a9cff', bg = '#bce2ff', border = '#bbe3fd' } = this.props;
83
-
84
- const info = <Info fill={fg} />;
85
-
86
- const icons = {
87
- check: (
88
- <Root size={this.props.size}>
89
- <Circle />
90
- {info}
91
- <Border fill={border} />
92
- </Root>
93
- ),
94
- emoji: (
95
- <Root size={this.props.size}>
96
- <Circle />
97
- {info}
98
- <Border fill={border} />
99
- </Root>
100
- ),
101
- open: {
102
- check: (
103
- <Root size={this.props.size}>
104
- <circle cx="-113" cy="144" r="14" fill="#FFFFFF" />
105
- <Info fill={bg} />
106
- <Border fill="#FFFFFF" />
107
- </Root>
108
- ),
109
- emoji: (
110
- <Root size={this.props.size}>
111
- <circle cx="-113" cy="144" r="14" fill="#FFFFFF" />
112
- <Info fill={bg} />
113
- <Border fill={border} />
114
- </Root>
115
- ),
116
- },
117
- };
118
-
119
- if (open === true) {
120
- return icons.open[iconSet];
121
- } else {
122
- return icons[iconSet];
123
- }
124
- }
125
- }
126
-
127
- ShowRationale.propTypes = {
128
- iconSet: PropTypes.oneOf(['emoji', 'check']),
129
- open: PropTypes.bool,
130
- fg: PropTypes.string,
131
- bg: PropTypes.string,
132
- border: PropTypes.string,
133
- size: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
134
- };
135
-
136
- ShowRationale.defaultProps = {
137
- iconSet: 'check',
138
- open: false,
139
- fg: '#1a9cff',
140
- bg: '#bce2ff',
141
- border: '#bbe3fd',
142
- size: 30,
143
- };
144
-
145
- export default ShowRationale;
package/src/sized.jsx DELETED
@@ -1,25 +0,0 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
-
4
- export const normalizeSize = (size) => {
5
- return typeof size === 'string' ? size : typeof size === 'number' ? `${size}px` : '30px';
6
- };
7
-
8
- const Sized = ({ size, children }) => {
9
- size = normalizeSize(size);
10
-
11
- const style = {
12
- height: size,
13
- width: size,
14
- display: 'inline-block',
15
- position: 'relative',
16
- };
17
-
18
- return <div style={style}>{children}</div>;
19
- };
20
-
21
- Sized.propTypes = {
22
- size: PropTypes.number,
23
- children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]).isRequired,
24
- };
25
- export default Sized;