@pie-lib/icons 2.36.0-mui-update.0 → 3.0.0-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.
- package/CHANGELOG.md +8 -90
- package/lib/learn-more-icon.js +1 -3
- package/lib/learn-more-icon.js.map +1 -1
- package/lib/nothing-submitted-icon.js +0 -1
- package/lib/nothing-submitted-icon.js.map +1 -1
- package/package.json +13 -3
- package/src/__tests__/index.test.js +304 -2
- package/src/learn-more-icon.jsx +1 -1
- package/src/nothing-submitted-icon.jsx +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
# [
|
|
6
|
+
# [3.0.0-next.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/icons@2.24.2-next.0...@pie-lib/icons@3.0.0-next.0) (2026-01-19)
|
|
7
7
|
|
|
8
8
|
**Note:** Version bump only for package @pie-lib/icons
|
|
9
9
|
|
|
@@ -11,7 +11,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
## [2.24.2-next.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/icons@2.38.0-mui-update.0...@pie-lib/icons@2.24.2-next.0) (2026-01-19)
|
|
15
15
|
|
|
16
16
|
**Note:** Version bump only for package @pie-lib/icons
|
|
17
17
|
|
|
@@ -19,157 +19,75 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
|
|
22
|
-
# [2.34.0-mui-update.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/icons@2.33.0-mui-update.0...@pie-lib/icons@2.34.0-mui-update.0) (2025-12-11)
|
|
23
|
-
|
|
24
|
-
**Note:** Version bump only for package @pie-lib/icons
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
# [2.33.0-mui-update.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/icons@2.32.0-mui-update.0...@pie-lib/icons@2.33.0-mui-update.0) (2025-12-02)
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
### Bug Fixes
|
|
34
|
-
|
|
35
|
-
* **icons:** add necessary props to correct icon ([638ebf9](https://github.com/pie-framework/pie-lib/commit/638ebf9cfd4375f67233ad055cb269da6cf99454))
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
### Features
|
|
39
|
-
|
|
40
|
-
* sync latest changes from dev ([c936e9c](https://github.com/pie-framework/pie-lib/commit/c936e9c7f9e095e7d9b9805ac2bf72bd271e05f1))
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
22
|
## [2.24.1](https://github.com/pie-framework/pie-lib/compare/@pie-lib/icons@2.20.0...@pie-lib/icons@2.24.1) (2025-10-22)
|
|
47
23
|
|
|
48
24
|
**Note:** Version bump only for package @pie-lib/icons
|
|
49
25
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
26
|
# [2.24.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/icons@2.20.0...@pie-lib/icons@2.24.0) (2025-10-16)
|
|
55
27
|
|
|
56
28
|
**Note:** Version bump only for package @pie-lib/icons
|
|
57
29
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
30
|
# [2.23.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/icons@2.20.0...@pie-lib/icons@2.23.0) (2025-10-16)
|
|
63
31
|
|
|
64
32
|
**Note:** Version bump only for package @pie-lib/icons
|
|
65
33
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
34
|
# [2.22.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/icons@2.20.0...@pie-lib/icons@2.22.0) (2025-10-16)
|
|
71
35
|
|
|
72
36
|
**Note:** Version bump only for package @pie-lib/icons
|
|
73
37
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
38
|
# [2.21.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/icons@2.20.0...@pie-lib/icons@2.21.0) (2025-10-16)
|
|
79
39
|
|
|
80
40
|
**Note:** Version bump only for package @pie-lib/icons
|
|
81
41
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
42
|
# [2.20.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/icons@2.4.43...@pie-lib/icons@2.20.0) (2025-09-25)
|
|
87
43
|
|
|
88
|
-
|
|
89
44
|
### Bug Fixes
|
|
90
45
|
|
|
91
|
-
|
|
92
|
-
|
|
46
|
+
- fixed pie-lib/icons import [PD-5126](<[dcb506c](https://github.com/pie-framework/pie-lib/commit/dcb506c914a177f6d88bf73247a023bfe71dac1f)>)
|
|
93
47
|
|
|
94
48
|
### Features
|
|
95
49
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
50
|
+
- split pie-toolbox into multiple packages [PD-5126](<[7d55a25](https://github.com/pie-framework/pie-lib/commit/7d55a2552d084cd3d0d5c00dc77411b2ced2f5e2)>)
|
|
101
51
|
|
|
102
52
|
# [2.19.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/icons@2.18.0...@pie-lib/icons@2.19.0) (2025-09-18)
|
|
103
53
|
|
|
104
54
|
**Note:** Version bump only for package @pie-lib/icons
|
|
105
55
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
56
|
# [2.18.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/icons@2.17.0...@pie-lib/icons@2.18.0) (2025-09-18)
|
|
111
57
|
|
|
112
58
|
**Note:** Version bump only for package @pie-lib/icons
|
|
113
59
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
60
|
# [2.17.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/icons@2.4.43...@pie-lib/icons@2.17.0) (2025-09-18)
|
|
119
61
|
|
|
120
|
-
|
|
121
62
|
### Bug Fixes
|
|
122
63
|
|
|
123
|
-
|
|
124
|
-
|
|
64
|
+
- fixed pie-lib/icons import [PD-5126](<[dcb506c](https://github.com/pie-framework/pie-lib/commit/dcb506c914a177f6d88bf73247a023bfe71dac1f)>)
|
|
125
65
|
|
|
126
66
|
### Features
|
|
127
67
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
68
|
+
- split pie-toolbox into multiple packages [PD-5126](<[7d55a25](https://github.com/pie-framework/pie-lib/commit/7d55a2552d084cd3d0d5c00dc77411b2ced2f5e2)>)
|
|
133
69
|
|
|
134
70
|
# [2.16.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/icons@2.15.0...@pie-lib/icons@2.16.0) (2025-09-17)
|
|
135
71
|
|
|
136
72
|
**Note:** Version bump only for package @pie-lib/icons
|
|
137
73
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
74
|
# [2.15.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/icons@2.14.0...@pie-lib/icons@2.15.0) (2025-09-17)
|
|
143
75
|
|
|
144
76
|
**Note:** Version bump only for package @pie-lib/icons
|
|
145
77
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
78
|
# [2.14.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/icons@2.13.1...@pie-lib/icons@2.14.0) (2025-09-17)
|
|
151
79
|
|
|
152
80
|
**Note:** Version bump only for package @pie-lib/icons
|
|
153
81
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
82
|
## [2.13.1](https://github.com/pie-framework/pie-lib/compare/@pie-lib/icons@2.4.43...@pie-lib/icons@2.13.1) (2025-08-11)
|
|
159
83
|
|
|
160
|
-
|
|
161
84
|
### Bug Fixes
|
|
162
85
|
|
|
163
|
-
|
|
164
|
-
|
|
86
|
+
- fixed pie-lib/icons import [PD-5126](<[dcb506c](https://github.com/pie-framework/pie-lib/commit/dcb506c914a177f6d88bf73247a023bfe71dac1f)>)
|
|
165
87
|
|
|
166
88
|
### Features
|
|
167
89
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
90
|
+
- split pie-toolbox into multiple packages [PD-5126](<[7d55a25](https://github.com/pie-framework/pie-lib/commit/7d55a2552d084cd3d0d5c00dc77411b2ced2f5e2)>)
|
|
173
91
|
|
|
174
92
|
# [2.13.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/icons@2.4.43...@pie-lib/icons@2.13.0) (2025-08-07)
|
|
175
93
|
|
package/lib/learn-more-icon.js
CHANGED
|
@@ -35,9 +35,7 @@ var LearnMore = exports.LearnMore = /*#__PURE__*/function (_React$Component) {
|
|
|
35
35
|
return (0, _createClass2["default"])(LearnMore, [{
|
|
36
36
|
key: "render",
|
|
37
37
|
value: function render() {
|
|
38
|
-
var
|
|
39
|
-
classes = _this$props.classes,
|
|
40
|
-
size = _this$props.size;
|
|
38
|
+
var size = this.props.size;
|
|
41
39
|
if (this.props.open === true) {
|
|
42
40
|
return /*#__PURE__*/_react["default"].createElement(_sized["default"], {
|
|
43
41
|
size: size
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"learn-more-icon.js","names":["_propTypes","_interopRequireDefault","require","_react","_sized","_callSuper","t","o","e","_getPrototypeOf2","_possibleConstructorReturn2","_isNativeReflectConstruct","Reflect","construct","constructor","apply","Boolean","prototype","valueOf","call","Glint","_ref","fill","createElement","d","propTypes","PropTypes","string","LearnMore","exports","_React$Component","_classCallCheck2","arguments","_inherits2","_createClass2","key","value","render","
|
|
1
|
+
{"version":3,"file":"learn-more-icon.js","names":["_propTypes","_interopRequireDefault","require","_react","_sized","_callSuper","t","o","e","_getPrototypeOf2","_possibleConstructorReturn2","_isNativeReflectConstruct","Reflect","construct","constructor","apply","Boolean","prototype","valueOf","call","Glint","_ref","fill","createElement","d","propTypes","PropTypes","string","LearnMore","exports","_React$Component","_classCallCheck2","arguments","_inherits2","_createClass2","key","value","render","size","props","open","preserveAspectRatio","viewBox","stroke","className","React","Component","_defineProperty2","classes","object","isRequired","number","bool","defaultProps","_default"],"sources":["../src/learn-more-icon.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\nimport Sized from './sized';\n\nconst Glint = ({ fill }) => (\n <path\n fill={fill}\n d=\"M-130.4,142.1c0-2.1,1.7-3.9,3.9-3.9c0.3,0,0.5,0,0.8,0.1c-0.6-0.8-1.5-1.3-2.6-1.3c-1.8,0-3.3,1.5-3.3,3.3c0,1.1,0.5,2,1.3,2.6C-130.4,142.6-130.4,142.4-130.4,142.1z\"\n />\n);\n\nGlint.propTypes = {\n fill: PropTypes.string,\n};\n\nexport class LearnMore extends React.Component {\n static propTypes = {\n classes: PropTypes.object.isRequired,\n size: PropTypes.number,\n };\n\n render() {\n const { size } = this.props;\n\n if (this.props.open === true) {\n return (\n <Sized size={size}>\n <svg preserveAspectRatio=\"xMinYMin meet\" viewBox=\"-135 129 16 32\">\n <path\n fill=\"#BCE2FF\"\n d=\"M-122,141.1c0-3.7-3.3-6.6-7.1-5.8c-2.4,0.5-4.3,2.4-4.7,4.8c-0.4,2.3,0.6,4.4,2.2,5.7c0.4,0.3,0.6,0.8,0.6,1.3v1.9h6.1v-1.9c0-0.5,0.2-1,0.6-1.3C-122.8,144.7-122,143-122,141.1z\"\n />\n <path\n fill=\"#BCE2FF\"\n d=\"M-125.7,153h-4.5c-0.4,0-0.8-0.4-0.8-0.8v-1.6h6.1v1.6C-124.9,152.7-125.2,153-125.7,153z\"\n />\n <Glint fill={'#1A9CFF'} />\n </svg>\n </Sized>\n );\n } else {\n return (\n <Sized size={size}>\n <svg preserveAspectRatio=\"xMinYMin meet\" viewBox=\"-135 129 16 31\">\n <path\n fill=\"#D0CAC5\"\n stroke=\"#E6E3E0\"\n className=\"st0\"\n d=\"M-120.7,142.4c0-3.7-3.3-6.6-7.1-5.8c-2.4,0.5-4.3,2.4-4.7,4.8c-0.4,2.3,0.6,4.4,2.2,5.7c0.4,0.3,0.6,0.8,0.6,1.3v1.9h6.1v-1.9c0-0.5,0.2-1,0.6-1.3C-121.6,146-120.7,144.3-120.7,142.4z\"\n />\n <path\n fill=\"#D0CAC5\"\n stroke=\"#E6E3E0\"\n className=\"st0\"\n d=\"M-124.4,154.3h-4.5c-0.4,0-0.8-0.4-0.8-0.8v-1.6h6.1v1.6C-123.6,153.9-123.9,154.3-124.4,154.3z\"\n />\n <path\n fill=\"#B3ABA4\"\n stroke=\"#CDC7C2\"\n className=\"st1\"\n d=\"M-121.3,141.8c0-3.7-3.3-6.6-7.1-5.8c-2.4,0.5-4.3,2.4-4.7,4.8c-0.4,2.3,0.6,4.4,2.2,5.7c0.4,0.3,0.6,0.8,0.6,1.3v1.9h6.1v-1.9c0-0.5,0.2-1,0.6-1.3C-122.2,145.3-121.3,143.7-121.3,141.8z\"\n />\n ,\n <path\n fill=\"#B3ABA4\"\n stroke=\"#CDC7C2\"\n className=\"st1\"\n d=\"M-125,153.7h-4.5c-0.4,0-0.8-0.4-0.8-0.8v-1.6h6.1v1.6C-124.2,153.3-124.6,153.7-125,153.7z\"\n />\n <path\n fill='#1A9CFF'\n d=\"M-122,141.1c0-3.7-3.3-6.6-7.1-5.8c-2.4,0.5-4.3,2.4-4.7,4.8c-0.4,2.3,0.6,4.4,2.2,5.7c0.4,0.3,0.6,0.8,0.6,1.3v1.9h6.1v-1.9c0-0.5,0.2-1,0.6-1.3C-122.8,144.7-122,143-122,141.1z\"\n />\n <path\n fill='#1A9CFF'\n d=\"M-125.7,153h-4.5c-0.4,0-0.8-0.4-0.8-0.8v-1.6h6.1v1.6C-124.9,152.7-125.2,153-125.7,153z\"\n />\n <Glint fill={'1A9CFF'} />\n </svg>\n </Sized>\n );\n }\n }\n}\n\nLearnMore.propTypes = {\n open: PropTypes.bool,\n};\n\nLearnMore.defaultProps = {\n open: false,\n};\n\nexport default LearnMore;\n"],"mappings":";;;;;;;;;;;;;AAAA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,MAAA,GAAAH,sBAAA,CAAAC,OAAA;AAA4B,SAAAG,WAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,WAAAD,CAAA,OAAAE,gBAAA,aAAAF,CAAA,OAAAG,2BAAA,aAAAJ,CAAA,EAAAK,yBAAA,KAAAC,OAAA,CAAAC,SAAA,CAAAN,CAAA,EAAAC,CAAA,YAAAC,gBAAA,aAAAH,CAAA,EAAAQ,WAAA,IAAAP,CAAA,CAAAQ,KAAA,CAAAT,CAAA,EAAAE,CAAA;AAAA,SAAAG,0BAAA,cAAAL,CAAA,IAAAU,OAAA,CAAAC,SAAA,CAAAC,OAAA,CAAAC,IAAA,CAAAP,OAAA,CAAAC,SAAA,CAAAG,OAAA,iCAAAV,CAAA,aAAAK,yBAAA,YAAAA,0BAAA,aAAAL,CAAA;AAE5B,IAAMc,KAAK,GAAG,SAARA,KAAKA,CAAAC,IAAA;EAAA,IAAMC,IAAI,GAAAD,IAAA,CAAJC,IAAI;EAAA,oBACnBnB,MAAA,YAAAoB,aAAA;IACED,IAAI,EAAEA,IAAK;IACXE,CAAC,EAAC;EAAmK,CACtK,CAAC;AAAA,CACH;AAEDJ,KAAK,CAACK,SAAS,GAAG;EAChBH,IAAI,EAAEI,qBAAS,CAACC;AAClB,CAAC;AAAC,IAEWC,SAAS,GAAAC,OAAA,CAAAD,SAAA,0BAAAE,gBAAA;EAAA,SAAAF,UAAA;IAAA,IAAAG,gBAAA,mBAAAH,SAAA;IAAA,OAAAvB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I,EAAC,SAAS;UACdqB,MAAM,EAAC,SAAS;UAChBC,SAAS,EAAC,KAAK;UACfpB,CAAC,EAAC;QAAsL,CACzL,CAAC,KAEF,eAAArB,MAAA,YAAAoB,aAAA;UACED,IAAI,EAAC,SAAS;UACdqB,MAAM,EAAC,SAAS;UAChBC,SAAS,EAAC,KAAK;UACfpB,CAAC,EAAC;QAA0F,CAC7F,CAAC,eACFrB,MAAA,YAAAoB,aAAA;UACED,IAAI,EAAC,SAAS;UACdE,CAAC,EAAC;QAA8K,CACjL,CAAC,eACFrB,MAAA,YAAAoB,aAAA;UACED,IAAI,EAAC,SAAS;UACdE,CAAC,EAAC;QAAwF,CAC3F,CAAC,eACFrB,MAAA,YAAAoB,aAAA,CAACH,KAAK;UAACE,IAAI,EAAE;QAAS,CAAE,CACrB,CACA,CAAC;MAEZ;IACF;EAAC;AAAA,EAnE4BuB,iBAAK,CAACC,SAAS;AAAA,IAAAC,gBAAA,aAAjCnB,SAAS,eACD;EACjBoB,OAAO,EAAEtB,qBAAS,CAACuB,MAAM,CAACC,UAAU;EACpCZ,IAAI,EAAEZ,qBAAS,CAACyB;AAClB,CAAC;AAkEHvB,SAAS,CAACH,SAAS,GAAG;EACpBe,IAAI,EAAEd,qBAAS,CAAC0B;AAClB,CAAC;AAEDxB,SAAS,CAACyB,YAAY,GAAG;EACvBb,IAAI,EAAE;AACR,CAAC;AAAC,IAAAc,QAAA,GAAAzB,OAAA,cAEaD,SAAS","ignoreList":[]}
|
|
@@ -13,7 +13,6 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits
|
|
|
13
13
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
14
14
|
var _react = _interopRequireDefault(require("react"));
|
|
15
15
|
var _iconRoot = require("./icon-root");
|
|
16
|
-
var _iconBase = _interopRequireDefault(require("./icon-base"));
|
|
17
16
|
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
|
|
18
17
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
19
18
|
// Exclamation mark
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nothing-submitted-icon.js","names":["_propTypes","_interopRequireDefault","require","_react","_iconRoot","
|
|
1
|
+
{"version":3,"file":"nothing-submitted-icon.js","names":["_propTypes","_interopRequireDefault","require","_react","_iconRoot","_callSuper","t","o","e","_getPrototypeOf2","_possibleConstructorReturn2","_isNativeReflectConstruct","Reflect","construct","constructor","apply","Boolean","prototype","valueOf","call","Exclamation","_ref","fill","createElement","x","y","width","height","propTypes","PropTypes","string","isRequired","Octagon","_ref2","points","Emoji","_ref3","d","NothingSubmitted","exports","_React$Component","props","_this","_classCallCheck2","_this$props","_this$props$fg","fg","_this$props$bg","bg","icons","check","IconRoot","emoji","feedback","square","open","_inherits2","_createClass2","key","value","render","_this$props2","iconSet","category","shape","undefined","React","Component","oneOf","bool","defaultProps","_default"],"sources":["../src/nothing-submitted-icon.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\nimport { IconRoot } from './icon-root';\n\n// Exclamation mark\nconst Exclamation = ({ fill }) => (\n <g>\n <rect x=\"19.3\" y=\"10.3\" width=\"4.5\" height=\"12.7\" fill={fill} />\n <rect x=\"19.3\" y=\"26.2\" width=\"4.5\" height=\"4.5\" fill={fill} />\n </g>\n);\n\nExclamation.propTypes = { fill: PropTypes.string.isRequired };\n\n// Octagon background\nconst Octagon = ({ fill }) => (\n <polygon\n 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\"\n fill={fill}\n />\n);\n\nOctagon.propTypes = { fill: PropTypes.string.isRequired };\n\n// Emoji variant\nconst Emoji = ({ fill }) => (\n <g>\n <rect x=\"23.8\" y=\"15\" width=\"3.5\" height=\"4.4\" fill={fill} />\n <rect x=\"16\" y=\"15\" width=\"3.5\" height=\"4.4\" fill={fill} />\n <path\n 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\n C25.7,26.4,25,27.1,24.2,27.1z\"\n fill={fill}\n />\n </g>\n);\n\nEmoji.propTypes = { fill: PropTypes.string.isRequired };\n\n// Exported NothingSubmitted icon\nexport class NothingSubmitted extends React.Component {\n constructor(props) {\n super(props);\n const { fg = '#464146', bg = 'white' } = this.props;\n\n this.icons = {\n check: <IconRoot><Octagon fill={bg} /><Exclamation fill={fg} /></IconRoot>,\n emoji: <IconRoot><Octagon fill={bg} /><Emoji fill={fg} /></IconRoot>,\n feedback: {\n check: <IconRoot><Octagon fill={bg} /><Emoji fill={fg} /></IconRoot>,\n emoji: <IconRoot><Octagon fill={bg} /><Emoji fill={fg} /></IconRoot>,\n square: {\n check: <IconRoot><Octagon fill={bg} /><Exclamation fill={fg} /></IconRoot>,\n emoji: <IconRoot><Octagon fill={bg} /><Emoji fill={fg} /></IconRoot>,\n open: {\n check: <IconRoot><Exclamation fill={bg} /></IconRoot>,\n emoji: <IconRoot><Emoji fill={bg} /></IconRoot>,\n },\n },\n },\n };\n }\n\n render() {\n const { iconSet, category, shape, open } = this.props;\n\n if (category === undefined) {\n return this.icons[iconSet];\n } else {\n if (shape === undefined) {\n return this.icons.feedback[iconSet];\n } else {\n if (open === true) {\n return this.icons.feedback.square.open[iconSet];\n } else {\n return this.icons.feedback.square[iconSet];\n }\n }\n }\n }\n}\n\nNothingSubmitted.propTypes = {\n iconSet: PropTypes.oneOf(['emoji', 'check', undefined]),\n shape: PropTypes.oneOf(['square', undefined]),\n category: PropTypes.oneOf(['feedback', undefined]),\n open: PropTypes.bool,\n fg: PropTypes.string,\n bg: PropTypes.string,\n};\n\nNothingSubmitted.defaultProps = {\n iconSet: 'check',\n shape: undefined,\n category: undefined,\n open: false,\n fg: '#464146', // foreground color\n bg: 'white', // background color\n};\n\nexport default NothingSubmitted;\n"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AAAuC,SAAAG,WAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,WAAAD,CAAA,OAAAE,gBAAA,aAAAF,CAAA,OAAAG,2BAAA,aAAAJ,CAAA,EAAAK,yBAAA,KAAAC,OAAA,CAAAC,SAAA,CAAAN,CAAA,EAAAC,CAAA,YAAAC,gBAAA,aAAAH,CAAA,EAAAQ,WAAA,IAAAP,CAAA,CAAAQ,KAAA,CAAAT,CAAA,EAAAE,CAAA;AAAA,SAAAG,0BAAA,cAAAL,CAAA,IAAAU,OAAA,CAAAC,SAAA,CAAAC,OAAA,CAAAC,IAAA,CAAAP,OAAA,CAAAC,SAAA,CAAAG,OAAA,iCAAAV,CAAA,aAAAK,yBAAA,YAAAA,0BAAA,aAAAL,CAAA;AAEvC;AACA,IAAMc,WAAW,GAAG,SAAdA,WAAWA,CAAAC,IAAA;EAAA,IAAMC,IAAI,GAAAD,IAAA,CAAJC,IAAI;EAAA,oBACzBnB,MAAA,YAAAoB,aAAA,yBACEpB,MAAA,YAAAoB,aAAA;IAAMC,CAAC,EAAC,MAAM;IAACC,CAAC,EAAC,MAAM;IAACC,KAAK,EAAC,KAAK;IAACC,MAAM,EAAC,MAAM;IAACL,IAAI,EAAEA;EAAK,CAAE,CAAC,eAChEnB,MAAA,YAAAoB,aAAA;IAAMC,CAAC,EAAC,MAAM;IAACC,CAAC,EAAC,MAAM;IAACC,KAAK,EAAC,KAAK;IAACC,MAAM,EAAC,KAAK;IAACL,IAAI,EAAEA;EAAK,CAAE,CA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QAAA,GAAAhC,OAAA,cAEaD,gBAAgB","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-lib/icons",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0-next.0",
|
|
4
4
|
"description": "Some simple icons",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "src/index.js",
|
|
@@ -18,15 +18,25 @@
|
|
|
18
18
|
"@emotion/style": "^0.8.0",
|
|
19
19
|
"@mui/icons-material": "^7.3.4",
|
|
20
20
|
"@mui/material": "^7.3.4",
|
|
21
|
-
"classnames": "^2.2.6",
|
|
22
21
|
"prop-types": "^15.6.2"
|
|
23
22
|
},
|
|
24
23
|
"peerDependencies": {
|
|
25
24
|
"@mui/material": "^7.3.4",
|
|
26
25
|
"react": "^18.2.0"
|
|
27
26
|
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@pie-lib/test-utils": "^0.22.2-next.16"
|
|
29
|
+
},
|
|
28
30
|
"publishConfig": {
|
|
29
31
|
"access": "public"
|
|
30
32
|
},
|
|
31
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "f104bab3116a65a39c55efc48387d8701c0c1d84",
|
|
34
|
+
"exports": {
|
|
35
|
+
".": {
|
|
36
|
+
"require": "./lib/index.js",
|
|
37
|
+
"import": "./src/index.js",
|
|
38
|
+
"default": "./lib/index.js"
|
|
39
|
+
},
|
|
40
|
+
"./esm": "./esm/index.js"
|
|
41
|
+
}
|
|
32
42
|
}
|
|
@@ -1,3 +1,305 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render, screen } from '@pie-lib/test-utils';
|
|
3
|
+
import {
|
|
4
|
+
Correct,
|
|
5
|
+
CorrectResponse,
|
|
6
|
+
Incorrect,
|
|
7
|
+
Instructions,
|
|
8
|
+
LearnMore,
|
|
9
|
+
NothingSubmitted,
|
|
10
|
+
PartiallyCorrect,
|
|
11
|
+
ShowRationale,
|
|
12
|
+
} from '../index';
|
|
13
|
+
|
|
14
|
+
describe('@pie-lib/icons', () => {
|
|
15
|
+
describe('Correct Icon', () => {
|
|
16
|
+
it('renders with default props', () => {
|
|
17
|
+
const { container } = render(<Correct />);
|
|
18
|
+
const svg = container.querySelector('svg');
|
|
19
|
+
expect(svg).toBeInTheDocument();
|
|
20
|
+
expect(svg).toHaveAttribute('viewBox', '0 0 44 40');
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
it('renders with check iconSet by default', () => {
|
|
24
|
+
const { container } = render(<Correct />);
|
|
25
|
+
// Check icon should render (contains polygon for checkmark)
|
|
26
|
+
const polygon = container.querySelector('polygon');
|
|
27
|
+
expect(polygon).toBeInTheDocument();
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it('renders with emoji iconSet', () => {
|
|
31
|
+
const { container } = render(<Correct iconSet="emoji" />);
|
|
32
|
+
// Emoji icon contains paths and rects
|
|
33
|
+
const elements = container.querySelectorAll('path, rect');
|
|
34
|
+
expect(elements.length).toBeGreaterThan(0);
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it('renders with round shape by default', () => {
|
|
38
|
+
const { container } = render(<Correct />);
|
|
39
|
+
// Round shape has a circle element
|
|
40
|
+
const circle = container.querySelector('circle');
|
|
41
|
+
expect(circle).toBeInTheDocument();
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
it('renders with square shape', () => {
|
|
45
|
+
const { container } = render(<Correct shape="square" />);
|
|
46
|
+
// Square shape has a rect element
|
|
47
|
+
const rect = container.querySelector('rect');
|
|
48
|
+
expect(rect).toBeInTheDocument();
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it('renders with feedback category and round shape', () => {
|
|
52
|
+
const { container } = render(<Correct category="feedback" shape="round" />);
|
|
53
|
+
// Feedback round box has a specific path
|
|
54
|
+
const path = container.querySelector('path');
|
|
55
|
+
expect(path).toBeInTheDocument();
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
it('renders with feedback category and square shape', () => {
|
|
59
|
+
const { container } = render(<Correct category="feedback" shape="square" />);
|
|
60
|
+
// Multiple polygons for square feedback
|
|
61
|
+
const polygons = container.querySelectorAll('polygon');
|
|
62
|
+
expect(polygons.length).toBeGreaterThan(0);
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
it('renders in open state', () => {
|
|
66
|
+
const { container } = render(<Correct open={true} />);
|
|
67
|
+
// In open state, should show background only (fewer elements)
|
|
68
|
+
const svg = container.querySelector('svg');
|
|
69
|
+
expect(svg).toBeInTheDocument();
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
it('renders with custom size as number', () => {
|
|
73
|
+
const { container } = render(<Correct size={50} />);
|
|
74
|
+
const wrapper = container.firstChild;
|
|
75
|
+
expect(wrapper).toHaveStyle({ width: '50px', height: '50px' });
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
it('renders with custom size as string', () => {
|
|
79
|
+
const { container } = render(<Correct size="100px" />);
|
|
80
|
+
const wrapper = container.firstChild;
|
|
81
|
+
expect(wrapper).toHaveStyle({ width: '100px', height: '100px' });
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
describe('Incorrect Icon', () => {
|
|
86
|
+
it('renders with default props', () => {
|
|
87
|
+
const { container } = render(<Incorrect />);
|
|
88
|
+
const svg = container.querySelector('svg');
|
|
89
|
+
expect(svg).toBeInTheDocument();
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
it('renders with check iconSet (X mark)', () => {
|
|
93
|
+
const { container } = render(<Incorrect iconSet="check" />);
|
|
94
|
+
// X mark contains rect elements
|
|
95
|
+
const rects = container.querySelectorAll('rect');
|
|
96
|
+
expect(rects.length).toBeGreaterThan(0);
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
it('renders with emoji iconSet', () => {
|
|
100
|
+
const { container } = render(<Incorrect iconSet="emoji" />);
|
|
101
|
+
const rects = container.querySelectorAll('rect');
|
|
102
|
+
expect(rects.length).toBeGreaterThan(0);
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
it('renders with custom colors', () => {
|
|
106
|
+
const { container } = render(<Incorrect fg="#ff0000" bg="#00ff00" />);
|
|
107
|
+
const svg = container.querySelector('svg');
|
|
108
|
+
expect(svg).toBeInTheDocument();
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
describe('PartiallyCorrect Icon', () => {
|
|
113
|
+
it('renders with default props', () => {
|
|
114
|
+
const { container } = render(<PartiallyCorrect />);
|
|
115
|
+
const svg = container.querySelector('svg');
|
|
116
|
+
expect(svg).toBeInTheDocument();
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
it('renders with check iconSet', () => {
|
|
120
|
+
const { container } = render(<PartiallyCorrect iconSet="check" />);
|
|
121
|
+
const svg = container.querySelector('svg');
|
|
122
|
+
expect(svg).toBeInTheDocument();
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
it('renders with emoji iconSet', () => {
|
|
126
|
+
const { container } = render(<PartiallyCorrect iconSet="emoji" />);
|
|
127
|
+
const svg = container.querySelector('svg');
|
|
128
|
+
expect(svg).toBeInTheDocument();
|
|
129
|
+
});
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
describe('NothingSubmitted Icon', () => {
|
|
133
|
+
it('renders with default props', () => {
|
|
134
|
+
const { container } = render(<NothingSubmitted />);
|
|
135
|
+
const svg = container.querySelector('svg');
|
|
136
|
+
expect(svg).toBeInTheDocument();
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
it('renders with default size', () => {
|
|
140
|
+
const { container } = render(<NothingSubmitted />);
|
|
141
|
+
const wrapper = container.firstChild;
|
|
142
|
+
// NothingSubmitted uses default 30px size from IconRoot
|
|
143
|
+
expect(wrapper).toHaveStyle({ width: '30px', height: '30px' });
|
|
144
|
+
});
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
describe('CorrectResponse Icon', () => {
|
|
148
|
+
it('renders with default props', () => {
|
|
149
|
+
const { container } = render(<CorrectResponse />);
|
|
150
|
+
const svg = container.querySelector('svg');
|
|
151
|
+
expect(svg).toBeInTheDocument();
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
it('renders SVG with proper viewBox', () => {
|
|
155
|
+
const { container } = render(<CorrectResponse />);
|
|
156
|
+
const svg = container.querySelector('svg');
|
|
157
|
+
// CorrectResponse uses CloseIcon by default which has viewBox="-129.5 127 34 35"
|
|
158
|
+
expect(svg).toHaveAttribute('viewBox', '-129.5 127 34 35');
|
|
159
|
+
});
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
describe('LearnMore Icon', () => {
|
|
163
|
+
it('renders with default props', () => {
|
|
164
|
+
const { container } = render(<LearnMore />);
|
|
165
|
+
const svg = container.querySelector('svg');
|
|
166
|
+
expect(svg).toBeInTheDocument();
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
it('renders with custom colors', () => {
|
|
170
|
+
const { container } = render(<LearnMore fg="#333333" bg="#ffffff" />);
|
|
171
|
+
const svg = container.querySelector('svg');
|
|
172
|
+
expect(svg).toBeInTheDocument();
|
|
173
|
+
});
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
describe('ShowRationale Icon', () => {
|
|
177
|
+
it('renders with default props', () => {
|
|
178
|
+
const { container } = render(<ShowRationale />);
|
|
179
|
+
const svg = container.querySelector('svg');
|
|
180
|
+
expect(svg).toBeInTheDocument();
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
it('renders with custom size', () => {
|
|
184
|
+
const { container } = render(<ShowRationale size="60px" />);
|
|
185
|
+
const wrapper = container.firstChild;
|
|
186
|
+
expect(wrapper).toHaveStyle({ width: '60px', height: '60px' });
|
|
187
|
+
});
|
|
188
|
+
});
|
|
189
|
+
|
|
190
|
+
describe('Instructions Icon', () => {
|
|
191
|
+
it('renders with default props', () => {
|
|
192
|
+
const { container } = render(<Instructions />);
|
|
193
|
+
const svg = container.querySelector('svg');
|
|
194
|
+
expect(svg).toBeInTheDocument();
|
|
195
|
+
});
|
|
196
|
+
|
|
197
|
+
it('renders SVG with proper viewBox', () => {
|
|
198
|
+
const { container } = render(<Instructions />);
|
|
199
|
+
const svg = container.querySelector('svg');
|
|
200
|
+
// Instructions SVG has a specific viewBox
|
|
201
|
+
expect(svg).toHaveAttribute('viewBox', '-128 129 31 31');
|
|
202
|
+
});
|
|
203
|
+
});
|
|
204
|
+
|
|
205
|
+
describe('Icon Combinations', () => {
|
|
206
|
+
it('renders multiple icons together', () => {
|
|
207
|
+
const { container } = render(
|
|
208
|
+
<div>
|
|
209
|
+
<Correct />
|
|
210
|
+
<Incorrect />
|
|
211
|
+
<PartiallyCorrect />
|
|
212
|
+
</div>
|
|
213
|
+
);
|
|
214
|
+
|
|
215
|
+
const svgs = container.querySelectorAll('svg');
|
|
216
|
+
expect(svgs).toHaveLength(3);
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
it('handles all iconSet variations', () => {
|
|
220
|
+
const icons = [
|
|
221
|
+
<Correct key="1" iconSet="check" />,
|
|
222
|
+
<Correct key="2" iconSet="emoji" />,
|
|
223
|
+
<Incorrect key="3" iconSet="check" />,
|
|
224
|
+
<Incorrect key="4" iconSet="emoji" />,
|
|
225
|
+
];
|
|
226
|
+
|
|
227
|
+
const { container } = render(<div>{icons}</div>);
|
|
228
|
+
const svgs = container.querySelectorAll('svg');
|
|
229
|
+
expect(svgs).toHaveLength(4);
|
|
230
|
+
});
|
|
231
|
+
|
|
232
|
+
it('handles all shape variations', () => {
|
|
233
|
+
const icons = [
|
|
234
|
+
<Correct key="1" shape="round" />,
|
|
235
|
+
<Correct key="2" shape="square" />,
|
|
236
|
+
<Incorrect key="3" shape="round" />,
|
|
237
|
+
<Incorrect key="4" shape="square" />,
|
|
238
|
+
];
|
|
239
|
+
|
|
240
|
+
const { container } = render(<div>{icons}</div>);
|
|
241
|
+
const svgs = container.querySelectorAll('svg');
|
|
242
|
+
expect(svgs).toHaveLength(4);
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
it('handles feedback category with both shapes', () => {
|
|
246
|
+
const icons = [
|
|
247
|
+
<Correct key="1" category="feedback" shape="round" />,
|
|
248
|
+
<Correct key="2" category="feedback" shape="square" />,
|
|
249
|
+
<Incorrect key="3" category="feedback" shape="round" />,
|
|
250
|
+
<Incorrect key="4" category="feedback" shape="square" />,
|
|
251
|
+
];
|
|
252
|
+
|
|
253
|
+
const { container } = render(<div>{icons}</div>);
|
|
254
|
+
const svgs = container.querySelectorAll('svg');
|
|
255
|
+
expect(svgs).toHaveLength(4);
|
|
256
|
+
});
|
|
257
|
+
});
|
|
258
|
+
|
|
259
|
+
describe('Accessibility', () => {
|
|
260
|
+
it('renders SVG elements that can be styled', () => {
|
|
261
|
+
const { container } = render(<Correct />);
|
|
262
|
+
const svg = container.querySelector('svg');
|
|
263
|
+
expect(svg).toHaveAttribute('viewBox');
|
|
264
|
+
expect(svg).toHaveAttribute('preserveAspectRatio');
|
|
265
|
+
});
|
|
266
|
+
|
|
267
|
+
it('maintains aspect ratio for responsive sizing', () => {
|
|
268
|
+
const { container } = render(<Correct size={100} />);
|
|
269
|
+
const svg = container.querySelector('svg');
|
|
270
|
+
expect(svg).toHaveAttribute('preserveAspectRatio', 'xMinYMin meet');
|
|
271
|
+
});
|
|
272
|
+
});
|
|
273
|
+
|
|
274
|
+
describe('Default Values', () => {
|
|
275
|
+
it('Correct icon has correct default values', () => {
|
|
276
|
+
const { container } = render(<Correct />);
|
|
277
|
+
// Should render with default size
|
|
278
|
+
const wrapper = container.firstChild;
|
|
279
|
+
expect(wrapper).toBeInTheDocument();
|
|
280
|
+
});
|
|
281
|
+
|
|
282
|
+
it('Incorrect icon has correct default values', () => {
|
|
283
|
+
const { container } = render(<Incorrect />);
|
|
284
|
+
const wrapper = container.firstChild;
|
|
285
|
+
expect(wrapper).toBeInTheDocument();
|
|
286
|
+
});
|
|
287
|
+
|
|
288
|
+
it('all icons render without errors', () => {
|
|
289
|
+
const icons = [
|
|
290
|
+
<Correct key="correct" />,
|
|
291
|
+
<Incorrect key="incorrect" />,
|
|
292
|
+
<PartiallyCorrect key="partially" />,
|
|
293
|
+
<NothingSubmitted key="nothing" />,
|
|
294
|
+
<CorrectResponse key="correctResponse" />,
|
|
295
|
+
<LearnMore key="learnMore" />,
|
|
296
|
+
<ShowRationale key="showRationale" />,
|
|
297
|
+
<Instructions key="instructions" />,
|
|
298
|
+
];
|
|
299
|
+
|
|
300
|
+
const { container } = render(<div>{icons}</div>);
|
|
301
|
+
const svgs = container.querySelectorAll('svg');
|
|
302
|
+
expect(svgs).toHaveLength(8);
|
|
303
|
+
});
|
|
304
|
+
});
|
|
3
305
|
});
|
package/src/learn-more-icon.jsx
CHANGED