@pie-lib/text-select 1.10.1-next.0 → 1.11.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 CHANGED
@@ -3,6 +3,17 @@
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
+ # [1.11.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/text-select@1.10.0...@pie-lib/text-select@1.11.0) (2023-08-16)
7
+
8
+
9
+ ### Features
10
+
11
+ * **text-select:** PD-1163 - add legend for icons used in eval mode ([7b2bac2](https://github.com/pie-framework/pie-lib/commit/7b2bac262d29986db2ce57ff6cee6c04af08472a))
12
+
13
+
14
+
15
+
16
+
6
17
  # [1.10.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/text-select@1.9.29...@pie-lib/text-select@1.10.0) (2023-08-15)
7
18
 
8
19
 
package/lib/index.js CHANGED
@@ -7,6 +7,12 @@ var _typeof = require("@babel/runtime/helpers/typeof");
7
7
  Object.defineProperty(exports, "__esModule", {
8
8
  value: true
9
9
  });
10
+ Object.defineProperty(exports, "Legend", {
11
+ enumerable: true,
12
+ get: function get() {
13
+ return _legend.Legend;
14
+ }
15
+ });
10
16
  Object.defineProperty(exports, "TextSelect", {
11
17
  enumerable: true,
12
18
  get: function get() {
@@ -50,6 +56,8 @@ var _tokenSelect = _interopRequireWildcard(require("./token-select"));
50
56
 
51
57
  var _textSelect = _interopRequireDefault(require("./text-select"));
52
58
 
59
+ var _legend = require("./legend");
60
+
53
61
  var _token = _interopRequireDefault(require("./token-select/token"));
54
62
 
55
63
  var _utils = require("./utils");
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA","sourcesContent":["import Tokenizer from './tokenizer';\nimport TokenSelect, { TokenTypes } from './token-select';\nimport TextSelect from './text-select';\nimport Token from './token-select/token';\nimport { prepareText } from './utils';\n\nexport { TextSelect, TokenTypes, Tokenizer, TokenSelect, Token, prepareText };\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../src/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA","sourcesContent":["import Tokenizer from './tokenizer';\nimport TokenSelect, { TokenTypes } from './token-select';\nimport TextSelect from './text-select';\nimport { Legend } from './legend';\nimport Token from './token-select/token';\nimport { prepareText } from './utils';\n\nexport { TextSelect, TokenTypes, Tokenizer, TokenSelect, Token, prepareText, Legend };\n"],"file":"index.js"}
package/lib/legend.js ADDED
@@ -0,0 +1,93 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.Legend = void 0;
9
+
10
+ var _react = _interopRequireDefault(require("react"));
11
+
12
+ var _styles = require("@material-ui/core/styles");
13
+
14
+ var _Check = _interopRequireDefault(require("@material-ui/icons/Check"));
15
+
16
+ var _Close = _interopRequireDefault(require("@material-ui/icons/Close"));
17
+
18
+ var _Remove = _interopRequireDefault(require("@material-ui/icons/Remove"));
19
+
20
+ var _core = require("@material-ui/core");
21
+
22
+ var _renderUi = require("@pie-lib/render-ui");
23
+
24
+ var Legend = (0, _styles.withStyles)(function (theme) {
25
+ return {
26
+ flexContainer: {
27
+ display: 'flex',
28
+ flexDirection: 'row',
29
+ gap: "".concat(2 * theme.spacing.unit, "px"),
30
+ borderBottom: '1px solid lightgrey',
31
+ borderTop: '1px solid lightgrey',
32
+ paddingBottom: theme.spacing.unit,
33
+ paddingTop: theme.spacing.unit,
34
+ marginBottom: theme.spacing.unit
35
+ },
36
+ container: {
37
+ display: 'flex',
38
+ flexDirection: 'row',
39
+ gap: "".concat(theme.spacing.unit / 2, "px"),
40
+ alignItems: 'center'
41
+ },
42
+ correct: {
43
+ fontSize: 'larger',
44
+ color: _renderUi.color.correct(),
45
+ backgroundColor: _renderUi.color.correctSecondary(),
46
+ border: "2px solid ".concat(_renderUi.color.correct())
47
+ },
48
+ incorrect: {
49
+ fontSize: 'larger',
50
+ color: _renderUi.color.missing(),
51
+ backgroundColor: _renderUi.color.incorrectSecondary(),
52
+ border: "2px solid ".concat(_renderUi.color.missing())
53
+ },
54
+ missing: {
55
+ fontSize: 'larger',
56
+ color: _renderUi.color.missing(),
57
+ backgroundColor: _renderUi.color.incorrectSecondary(),
58
+ border: "2px dashed ".concat(_renderUi.color.missing())
59
+ }
60
+ };
61
+ })(function (_ref) {
62
+ var classes = _ref.classes;
63
+ var icons = [{
64
+ iconName: _Check["default"],
65
+ label: 'Correct answer selected',
66
+ className: classes.correct
67
+ }, {
68
+ iconName: _Remove["default"],
69
+ label: 'Correct answer not selected',
70
+ className: classes.missing
71
+ }, {
72
+ iconName: _Close["default"],
73
+ label: 'Incorrect selection',
74
+ className: classes.incorrect
75
+ }];
76
+ return /*#__PURE__*/_react["default"].createElement("div", {
77
+ className: classes.flexContainer
78
+ }, icons.map(function (icon, index) {
79
+ var Icon = icon.iconName;
80
+ return /*#__PURE__*/_react["default"].createElement("div", {
81
+ key: index,
82
+ className: classes.container
83
+ }, /*#__PURE__*/_react["default"].createElement(Icon, {
84
+ className: icon.className,
85
+ width: '19px',
86
+ height: '19px'
87
+ }), /*#__PURE__*/_react["default"].createElement(_core.Typography, {
88
+ variant: 'subtitle1'
89
+ }, icon.label));
90
+ }));
91
+ });
92
+ exports.Legend = Legend;
93
+ //# sourceMappingURL=legend.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/legend.js"],"names":["Legend","theme","flexContainer","display","flexDirection","gap","spacing","unit","borderBottom","borderTop","paddingBottom","paddingTop","marginBottom","container","alignItems","correct","fontSize","color","backgroundColor","correctSecondary","border","incorrect","missing","incorrectSecondary","classes","icons","iconName","Check","label","className","Remove","Close","map","icon","index","Icon"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEO,IAAMA,MAAM,GAAG,wBAAW,UAACC,KAAD;AAAA,SAAY;AAC3CC,IAAAA,aAAa,EAAE;AACbC,MAAAA,OAAO,EAAE,MADI;AAEbC,MAAAA,aAAa,EAAE,KAFF;AAGbC,MAAAA,GAAG,YAAK,IAAIJ,KAAK,CAACK,OAAN,CAAcC,IAAvB,OAHU;AAIbC,MAAAA,YAAY,EAAE,qBAJD;AAKbC,MAAAA,SAAS,EAAE,qBALE;AAMbC,MAAAA,aAAa,EAAET,KAAK,CAACK,OAAN,CAAcC,IANhB;AAObI,MAAAA,UAAU,EAAEV,KAAK,CAACK,OAAN,CAAcC,IAPb;AAQbK,MAAAA,YAAY,EAAEX,KAAK,CAACK,OAAN,CAAcC;AARf,KAD4B;AAW3CM,IAAAA,SAAS,EAAE;AACTV,MAAAA,OAAO,EAAE,MADA;AAETC,MAAAA,aAAa,EAAE,KAFN;AAGTC,MAAAA,GAAG,YAAKJ,KAAK,CAACK,OAAN,CAAcC,IAAd,GAAqB,CAA1B,OAHM;AAITO,MAAAA,UAAU,EAAE;AAJH,KAXgC;AAiB3CC,IAAAA,OAAO,EAAE;AACPC,MAAAA,QAAQ,EAAE,QADH;AAEPC,MAAAA,KAAK,EAAEA,gBAAMF,OAAN,EAFA;AAGPG,MAAAA,eAAe,EAAED,gBAAME,gBAAN,EAHV;AAIPC,MAAAA,MAAM,sBAAeH,gBAAMF,OAAN,EAAf;AAJC,KAjBkC;AAuB3CM,IAAAA,SAAS,EAAE;AACTL,MAAAA,QAAQ,EAAE,QADD;AAETC,MAAAA,KAAK,EAAEA,gBAAMK,OAAN,EAFE;AAGTJ,MAAAA,eAAe,EAAED,gBAAMM,kBAAN,EAHR;AAITH,MAAAA,MAAM,sBAAeH,gBAAMK,OAAN,EAAf;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H,CADF;AAaD,CAtDqB,CAAf","sourcesContent":["import React from 'react';\nimport { withStyles } from '@material-ui/core/styles';\nimport Check from '@material-ui/icons/Check';\nimport Close from '@material-ui/icons/Close';\nimport Remove from '@material-ui/icons/Remove';\nimport { Typography } from '@material-ui/core';\nimport { color } from '@pie-lib/render-ui';\n\nexport const Legend = withStyles((theme) => ({\n flexContainer: {\n display: 'flex',\n flexDirection: 'row',\n gap: `${2 * theme.spacing.unit}px`,\n borderBottom: '1px solid lightgrey',\n borderTop: '1px solid lightgrey',\n paddingBottom: theme.spacing.unit,\n paddingTop: theme.spacing.unit,\n marginBottom: theme.spacing.unit,\n },\n container: {\n display: 'flex',\n flexDirection: 'row',\n gap: `${theme.spacing.unit / 2}px`,\n alignItems: 'center',\n },\n correct: {\n fontSize: 'larger',\n color: color.correct(),\n backgroundColor: color.correctSecondary(),\n border: `2px solid ${color.correct()}`,\n },\n incorrect: {\n fontSize: 'larger',\n color: color.missing(),\n backgroundColor: color.incorrectSecondary(),\n border: `2px solid ${color.missing()}`,\n },\n missing: {\n fontSize: 'larger',\n color: color.missing(),\n backgroundColor: color.incorrectSecondary(),\n border: `2px dashed ${color.missing()}`,\n },\n}))(({ classes }) => {\n const icons = [\n { iconName: Check, label: 'Correct answer selected', className: classes.correct },\n { iconName: Remove, label: 'Correct answer not selected', className: classes.missing },\n { iconName: Close, label: 'Incorrect selection', className: classes.incorrect },\n ];\n return (\n <div className={classes.flexContainer}>\n {icons.map((icon, index) => {\n const Icon = icon.iconName;\n return (\n <div key={index} className={classes.container}>\n <Icon className={icon.className} width={'19px'} height={'19px'}></Icon>\n <Typography variant={'subtitle1'}>{icon.label}</Typography>\n </div>\n );\n })}\n </div>\n );\n});\n"],"file":"legend.js"}
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.10.1-next.0+1f4273ab",
6
+ "version": "1.11.0",
7
7
  "description": "Some react components for text selection",
8
8
  "keywords": [
9
9
  "react",
@@ -18,7 +18,7 @@
18
18
  "license": "ISC",
19
19
  "dependencies": {
20
20
  "@pie-framework/parse-english": "^1.0.0",
21
- "@pie-lib/render-ui": "^4.15.1-next.0+1f4273ab",
21
+ "@pie-lib/render-ui": "^4.15.0",
22
22
  "@pie-lib/style-utils": "^0.1.43",
23
23
  "classnames": "^2.2.6",
24
24
  "debug": "^4.1.1",
@@ -38,6 +38,6 @@
38
38
  "@material-ui/core": "^3.8.3",
39
39
  "react": "^16.8.1"
40
40
  },
41
- "gitHead": "1f4273ab1a244f1586c06526b703b2777859f481",
41
+ "gitHead": "f132e61da631843d03513f3ee7f81ffb8155bf75",
42
42
  "scripts": {}
43
43
  }
package/src/index.js CHANGED
@@ -1,7 +1,8 @@
1
1
  import Tokenizer from './tokenizer';
2
2
  import TokenSelect, { TokenTypes } from './token-select';
3
3
  import TextSelect from './text-select';
4
+ import { Legend } from './legend';
4
5
  import Token from './token-select/token';
5
6
  import { prepareText } from './utils';
6
7
 
7
- export { TextSelect, TokenTypes, Tokenizer, TokenSelect, Token, prepareText };
8
+ export { TextSelect, TokenTypes, Tokenizer, TokenSelect, Token, prepareText, Legend };
package/src/legend.js ADDED
@@ -0,0 +1,63 @@
1
+ import React from 'react';
2
+ import { withStyles } from '@material-ui/core/styles';
3
+ import Check from '@material-ui/icons/Check';
4
+ import Close from '@material-ui/icons/Close';
5
+ import Remove from '@material-ui/icons/Remove';
6
+ import { Typography } from '@material-ui/core';
7
+ import { color } from '@pie-lib/render-ui';
8
+
9
+ export const Legend = withStyles((theme) => ({
10
+ flexContainer: {
11
+ display: 'flex',
12
+ flexDirection: 'row',
13
+ gap: `${2 * theme.spacing.unit}px`,
14
+ borderBottom: '1px solid lightgrey',
15
+ borderTop: '1px solid lightgrey',
16
+ paddingBottom: theme.spacing.unit,
17
+ paddingTop: theme.spacing.unit,
18
+ marginBottom: theme.spacing.unit,
19
+ },
20
+ container: {
21
+ display: 'flex',
22
+ flexDirection: 'row',
23
+ gap: `${theme.spacing.unit / 2}px`,
24
+ alignItems: 'center',
25
+ },
26
+ correct: {
27
+ fontSize: 'larger',
28
+ color: color.correct(),
29
+ backgroundColor: color.correctSecondary(),
30
+ border: `2px solid ${color.correct()}`,
31
+ },
32
+ incorrect: {
33
+ fontSize: 'larger',
34
+ color: color.missing(),
35
+ backgroundColor: color.incorrectSecondary(),
36
+ border: `2px solid ${color.missing()}`,
37
+ },
38
+ missing: {
39
+ fontSize: 'larger',
40
+ color: color.missing(),
41
+ backgroundColor: color.incorrectSecondary(),
42
+ border: `2px dashed ${color.missing()}`,
43
+ },
44
+ }))(({ classes }) => {
45
+ const icons = [
46
+ { iconName: Check, label: 'Correct answer selected', className: classes.correct },
47
+ { iconName: Remove, label: 'Correct answer not selected', className: classes.missing },
48
+ { iconName: Close, label: 'Incorrect selection', className: classes.incorrect },
49
+ ];
50
+ return (
51
+ <div className={classes.flexContainer}>
52
+ {icons.map((icon, index) => {
53
+ const Icon = icon.iconName;
54
+ return (
55
+ <div key={index} className={classes.container}>
56
+ <Icon className={icon.className} width={'19px'} height={'19px'}></Icon>
57
+ <Typography variant={'subtitle1'}>{icon.label}</Typography>
58
+ </div>
59
+ );
60
+ })}
61
+ </div>
62
+ );
63
+ });