@pie-lib/correct-answer-toggle 2.3.29 → 2.3.30-next.234

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
@@ -23,141 +23,72 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
23
23
 
24
24
  **Note:** Version bump only for package @pie-lib/correct-answer-toggle
25
25
 
26
-
27
-
28
-
29
-
30
26
  ## [2.3.26](https://github.com/pie-framework/pie-lib/compare/@pie-lib/correct-answer-toggle@2.3.24...@pie-lib/correct-answer-toggle@2.3.26) (2021-06-25)
31
27
 
32
28
  **Note:** Version bump only for package @pie-lib/correct-answer-toggle
33
29
 
34
-
35
-
36
-
37
-
38
30
  ## [2.3.24](https://github.com/pie-framework/pie-lib/compare/@pie-lib/correct-answer-toggle@2.3.23...@pie-lib/correct-answer-toggle@2.3.24) (2021-06-25)
39
31
 
40
32
  **Note:** Version bump only for package @pie-lib/correct-answer-toggle
41
33
 
42
-
43
-
44
-
45
-
46
34
  ## [2.3.23](https://github.com/pie-framework/pie-lib/compare/@pie-lib/correct-answer-toggle@2.3.22...@pie-lib/correct-answer-toggle@2.3.23) (2021-04-06)
47
35
 
48
36
  **Note:** Version bump only for package @pie-lib/correct-answer-toggle
49
37
 
50
-
51
-
52
-
53
-
54
38
  ## [2.3.22](https://github.com/pie-framework/pie-lib/compare/@pie-lib/correct-answer-toggle@2.3.21...@pie-lib/correct-answer-toggle@2.3.22) (2021-04-02)
55
39
 
56
-
57
40
  ### Bug Fixes
58
41
 
59
- * **correct-answer-toggle:** denote label as non-readable ([79676a9](https://github.com/pie-framework/pie-lib/commit/79676a9))
60
-
61
-
62
-
63
-
42
+ - **correct-answer-toggle:** denote label as non-readable ([79676a9](https://github.com/pie-framework/pie-lib/commit/79676a9))
64
43
 
65
44
  ## [2.3.21](https://github.com/pie-framework/pie-lib/compare/@pie-lib/correct-answer-toggle@2.3.20...@pie-lib/correct-answer-toggle@2.3.21) (2021-03-01)
66
45
 
67
46
  **Note:** Version bump only for package @pie-lib/correct-answer-toggle
68
47
 
69
-
70
-
71
-
72
-
73
48
  ## [2.3.20](https://github.com/pie-framework/pie-lib/compare/@pie-lib/correct-answer-toggle@2.3.19...@pie-lib/correct-answer-toggle@2.3.20) (2021-03-01)
74
49
 
75
50
  **Note:** Version bump only for package @pie-lib/correct-answer-toggle
76
51
 
77
-
78
-
79
-
80
-
81
52
  ## [2.3.19](https://github.com/pie-framework/pie-lib/compare/@pie-lib/correct-answer-toggle@2.3.18...@pie-lib/correct-answer-toggle@2.3.19) (2021-02-15)
82
53
 
83
54
  **Note:** Version bump only for package @pie-lib/correct-answer-toggle
84
55
 
85
-
86
-
87
-
88
-
89
56
  ## [2.3.18](https://github.com/pie-framework/pie-lib/compare/@pie-lib/correct-answer-toggle@2.3.16...@pie-lib/correct-answer-toggle@2.3.18) (2021-02-15)
90
57
 
91
58
  **Note:** Version bump only for package @pie-lib/correct-answer-toggle
92
59
 
93
-
94
-
95
-
96
-
97
60
  ## [2.3.16](https://github.com/pie-framework/pie-lib/compare/@pie-lib/correct-answer-toggle@2.3.15...@pie-lib/correct-answer-toggle@2.3.16) (2021-02-15)
98
61
 
99
62
  **Note:** Version bump only for package @pie-lib/correct-answer-toggle
100
63
 
101
-
102
-
103
-
104
-
105
64
  ## [2.3.15](https://github.com/pie-framework/pie-lib/compare/@pie-lib/correct-answer-toggle@2.3.14...@pie-lib/correct-answer-toggle@2.3.15) (2021-02-01)
106
65
 
107
66
  **Note:** Version bump only for package @pie-lib/correct-answer-toggle
108
67
 
109
-
110
-
111
-
112
-
113
68
  ## [2.3.14](https://github.com/pie-framework/pie-lib/compare/@pie-lib/correct-answer-toggle@2.3.13...@pie-lib/correct-answer-toggle@2.3.14) (2021-01-28)
114
69
 
115
70
  **Note:** Version bump only for package @pie-lib/correct-answer-toggle
116
71
 
117
-
118
-
119
-
120
-
121
72
  ## [2.3.13](https://github.com/pie-framework/pie-lib/compare/@pie-lib/correct-answer-toggle@2.3.12...@pie-lib/correct-answer-toggle@2.3.13) (2021-01-28)
122
73
 
123
74
  **Note:** Version bump only for package @pie-lib/correct-answer-toggle
124
75
 
125
-
126
-
127
-
128
-
129
76
  ## [2.3.12](https://github.com/pie-framework/pie-lib/compare/@pie-lib/correct-answer-toggle@2.3.11...@pie-lib/correct-answer-toggle@2.3.12) (2021-01-25)
130
77
 
131
78
  **Note:** Version bump only for package @pie-lib/correct-answer-toggle
132
79
 
133
-
134
-
135
-
136
-
137
80
  ## [2.3.11](https://github.com/pie-framework/pie-lib/compare/@pie-lib/correct-answer-toggle@2.3.10...@pie-lib/correct-answer-toggle@2.3.11) (2021-01-11)
138
81
 
139
82
  **Note:** Version bump only for package @pie-lib/correct-answer-toggle
140
83
 
141
-
142
-
143
-
144
-
145
84
  ## [2.3.10](https://github.com/pie-framework/pie-lib/compare/@pie-lib/correct-answer-toggle@2.3.9...@pie-lib/correct-answer-toggle@2.3.10) (2020-10-29)
146
85
 
147
86
  **Note:** Version bump only for package @pie-lib/correct-answer-toggle
148
87
 
149
-
150
-
151
-
152
-
153
88
  ## [2.3.9](https://github.com/pie-framework/pie-lib/compare/@pie-lib/correct-answer-toggle@2.3.8...@pie-lib/correct-answer-toggle@2.3.9) (2020-10-26)
154
89
 
155
90
  **Note:** Version bump only for package @pie-lib/correct-answer-toggle
156
91
 
157
-
158
-
159
-
160
-
161
92
  ## [2.3.8](https://github.com/pie-framework/pie-lib/compare/@pie-lib/correct-answer-toggle@2.3.7...@pie-lib/correct-answer-toggle@2.3.8) (2020-10-26)
162
93
 
163
94
  **Note:** Version bump only for package @pie-lib/correct-answer-toggle
package/lib/expander.js CHANGED
@@ -15,9 +15,9 @@ var _reactTransitionGroup = require("react-transition-group");
15
15
 
16
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
17
17
 
18
- 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; }
18
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
19
19
 
20
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
20
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
21
21
 
22
22
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
23
23
 
@@ -25,13 +25,13 @@ var Expander = function Expander(props) {
25
25
  var classes = props.classes,
26
26
  show = props.show,
27
27
  children = props.children;
28
- return _react["default"].createElement(_reactTransitionGroup.CSSTransition, {
28
+ return /*#__PURE__*/_react["default"].createElement(_reactTransitionGroup.CSSTransition, {
29
29
  "in": show,
30
30
  appear: true,
31
31
  mountOnEnter: false,
32
32
  timeout: 300,
33
33
  classNames: _objectSpread({}, classes)
34
- }, _react["default"].createElement("div", {
34
+ }, /*#__PURE__*/_react["default"].createElement("div", {
35
35
  className: classes.expander
36
36
  }, children));
37
37
  };
@@ -51,28 +51,33 @@ var _default = (0, _styles.withStyles)(function () {
51
51
  height: 0,
52
52
  overflow: 'hidden',
53
53
  display: 'flex',
54
- visibility: 'hidden'
54
+ visibility: 'hidden',
55
+ width: 0
55
56
  },
56
57
  enter: {
57
58
  transition: transition,
58
59
  opacity: 1,
59
60
  height: '25px',
61
+ width: 'auto',
60
62
  visibility: 'visible'
61
63
  },
62
64
  enterDone: {
63
65
  height: '25px',
64
- visibility: 'visible'
66
+ visibility: 'visible',
67
+ width: 'auto'
65
68
  },
66
69
  exit: {
67
70
  transition: transition,
68
71
  opacity: 0,
69
- height: '0px',
70
- visibility: 'visible'
72
+ height: 0,
73
+ visibility: 'visible',
74
+ width: 0
71
75
  },
72
76
  exitDone: {
73
77
  opacity: 0,
74
78
  visibility: 'hidden',
75
- height: '0px'
79
+ height: 0,
80
+ width: 0
76
81
  }
77
82
  };
78
83
  })(Expander);
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/expander.jsx"],"names":["Expander","props","classes","show","children","expander","propTypes","PropTypes","bool","isRequired","className","string","object","oneOfType","arrayOf","node","transition","position","height","overflow","display","visibility","enter","opacity","enterDone","exit","exitDone"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,IAAMA,QAAQ,GAAG,SAAXA,QAAW,CAAAC,KAAK,EAAI;AAAA,MAChBC,OADgB,GACYD,KADZ,CAChBC,OADgB;AAAA,MACPC,IADO,GACYF,KADZ,CACPE,IADO;AAAA,MACDC,QADC,GACYH,KADZ,CACDG,QADC;AAGxB,SACE,gCAAC,mCAAD;AACE,UAAID,IADN;AAEE,IAAA,MAAM,EAAE,IAFV;AAGE,IAAA,YAAY,EAAE,KAHhB;AAIE,IAAA,OAAO,EAAE,GAJX;AAKE,IAAA,UAAU,oBAAOD,OAAP;AALZ,KAOE;AAAK,IAAA,SAAS,EAAEA,O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QA7BW,C","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@material-ui/core/styles';\nimport { CSSTransition } from 'react-transition-group';\n\nconst Expander = props => {\n const { classes, show, children } = props;\n\n return (\n <CSSTransition\n in={show}\n appear={true}\n mountOnEnter={false}\n timeout={300}\n classNames={{ ...classes }}\n >\n <div className={classes.expander}>{children}</div>\n </CSSTransition>\n );\n};\n\nExpander.propTypes = {\n show: PropTypes.bool.isRequired,\n className: PropTypes.string,\n classes: PropTypes.object,\n children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]).isRequired\n};\n\nconst transition = 'height ease-in 300ms, opacity ease-in 300ms';\n\nexport default withStyles(() => ({\n expander: {\n position: 'relative',\n height: 0,\n overflow: 'hidden',\n display: 'flex',\n visibility: 'hidden'\n },\n enter: {\n transition,\n opacity: 1,\n height: '25px',\n visibility: 'visible'\n },\n enterDone: {\n height: '25px',\n visibility: 'visible'\n },\n exit: {\n transition,\n opacity: 0,\n height: '0px',\n visibility: 'visible'\n },\n exitDone: {\n opacity: 0,\n visibility: 'hidden',\n height: '0px'\n }\n}))(Expander);\n"],"file":"expander.js"}
1
+ {"version":3,"sources":["../src/expander.jsx"],"names":["Expander","props","classes","show","children","expander","propTypes","PropTypes","bool","isRequired","className","string","object","oneOfType","arrayOf","node","transition","position","height","overflow","display","visibility","width","enter","opacity","enterDone","exit","exitDone"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,IAAMA,QAAQ,GAAG,SAAXA,QAAW,CAAAC,KAAK,EAAI;AACxB,MAAQC,OAAR,GAAoCD,KAApC,CAAQC,OAAR;AAAA,MAAiBC,IAAjB,GAAoCF,KAApC,CAAiBE,IAAjB;AAAA,MAAuBC,QAAvB,GAAoCH,KAApC,CAAuBG,QAAvB;AAEA,sBACE,gCAAC,mCAAD;AACE,UAAID,IADN;AAEE,IAAA,MAAM,EAAE,IAFV;AAGE,IAAA,YAAY,EAA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E,CAHJ;AAIJG,MAAAA,UAAU,EAAE,SAJR;AAKJC,MAAAA,KAAK,EAAE;AALH,KArByB;AA4B/BK,IAAAA,QAAQ,EAAE;AACRH,MAAAA,OAAO,EAAE,CADD;AAERH,MAAAA,UAAU,EAAE,QAFJ;AAGRH,MAAAA,MAAM,EAAE,CAHA;AAIRI,MAAAA,KAAK,EAAE;AAJC;AA5BqB,GAAP;AAAA,CAAX,EAkCXtB,QAlCW,C","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@material-ui/core/styles';\nimport { CSSTransition } from 'react-transition-group';\n\nconst Expander = props => {\n const { classes, show, children } = props;\n\n return (\n <CSSTransition\n in={show}\n appear={true}\n mountOnEnter={false}\n timeout={300}\n classNames={{ ...classes }}\n >\n <div className={classes.expander}>{children}</div>\n </CSSTransition>\n );\n};\n\nExpander.propTypes = {\n show: PropTypes.bool.isRequired,\n className: PropTypes.string,\n classes: PropTypes.object,\n children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]).isRequired\n};\n\nconst transition = 'height ease-in 300ms, opacity ease-in 300ms';\n\nexport default withStyles(() => ({\n expander: {\n position: 'relative',\n height: 0,\n overflow: 'hidden',\n display: 'flex',\n visibility: 'hidden',\n width: 0\n },\n enter: {\n transition,\n opacity: 1,\n height: '25px',\n width: 'auto',\n visibility: 'visible'\n },\n enterDone: {\n height: '25px',\n visibility: 'visible',\n width: 'auto'\n },\n exit: {\n transition,\n opacity: 0,\n height: 0,\n visibility: 'visible',\n width: 0\n },\n exitDone: {\n opacity: 0,\n visibility: 'hidden',\n height: 0,\n width: 0\n }\n}))(Expander);\n"],"file":"expander.js"}
package/lib/index.js CHANGED
@@ -1,5 +1,7 @@
1
1
  "use strict";
2
2
 
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
+
3
5
  Object.defineProperty(exports, "__esModule", {
4
6
  value: true
5
7
  });
@@ -25,40 +27,42 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
25
27
 
26
28
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
27
29
 
28
- function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
29
-
30
30
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
31
31
 
32
32
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
33
33
 
34
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
34
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
35
35
 
36
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
36
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
37
37
 
38
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
38
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
39
39
 
40
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
40
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
41
41
 
42
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
42
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
43
43
 
44
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
44
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
45
+
46
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
47
+
48
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
45
49
 
46
50
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
47
51
 
48
52
  /**
49
53
  * We export the raw unstyled class for testability. For public use please use the default export.
50
54
  */
51
- var CorrectAnswerToggle =
52
- /*#__PURE__*/
53
- function (_React$Component) {
55
+ var CorrectAnswerToggle = /*#__PURE__*/function (_React$Component) {
54
56
  _inherits(CorrectAnswerToggle, _React$Component);
55
57
 
58
+ var _super = _createSuper(CorrectAnswerToggle);
59
+
56
60
  function CorrectAnswerToggle(props) {
57
61
  var _this;
58
62
 
59
63
  _classCallCheck(this, CorrectAnswerToggle);
60
64
 
61
- _this = _possibleConstructorReturn(this, _getPrototypeOf(CorrectAnswerToggle).call(this, props));
65
+ _this = _super.call(this, props);
62
66
  _this.state = {
63
67
  show: props.show
64
68
  };
@@ -86,38 +90,39 @@ function (_React$Component) {
86
90
  toggled = _this$props.toggled,
87
91
  hideMessage = _this$props.hideMessage,
88
92
  showMessage = _this$props.showMessage;
89
- return _react["default"].createElement("div", {
93
+ return /*#__PURE__*/_react["default"].createElement("div", {
90
94
  className: (0, _classnames["default"])(classes.root, className)
91
- }, _react["default"].createElement(_expander["default"], {
95
+ }, /*#__PURE__*/_react["default"].createElement(_expander["default"], {
92
96
  show: this.state.show,
93
97
  className: classes.expander
94
- }, _react["default"].createElement("div", {
98
+ }, /*#__PURE__*/_react["default"].createElement("div", {
95
99
  className: classes.content,
96
100
  onClick: this.onClick.bind(this)
97
- }, _react["default"].createElement("div", {
101
+ }, /*#__PURE__*/_react["default"].createElement("div", {
98
102
  className: classes.iconHolder
99
- }, _react["default"].createElement(_CSSTransition["default"], {
103
+ }, /*#__PURE__*/_react["default"].createElement(_CSSTransition["default"], {
100
104
  timeout: 400,
101
105
  "in": toggled,
102
106
  exit: !toggled,
103
107
  classNames: classes
104
- }, _react["default"].createElement(_icons.CorrectResponse, {
108
+ }, /*#__PURE__*/_react["default"].createElement(_icons.CorrectResponse, {
105
109
  open: toggled,
106
110
  key: "correct-open",
107
111
  className: classes.icon
108
- })), _react["default"].createElement(_CSSTransition["default"], {
112
+ })), /*#__PURE__*/_react["default"].createElement(_CSSTransition["default"], {
109
113
  timeout: 5000,
110
114
  "in": !toggled,
111
115
  exit: toggled,
112
116
  classNames: classes
113
- }, _react["default"].createElement(_icons.CorrectResponse, {
117
+ }, /*#__PURE__*/_react["default"].createElement(_icons.CorrectResponse, {
114
118
  open: toggled,
115
119
  key: "correct-closed",
116
120
  className: classes.icon
117
- }))), _react["default"].createElement(_renderUi.Readable, {
121
+ }))), /*#__PURE__*/_react["default"].createElement(_renderUi.Readable, {
118
122
  "false": true
119
- }, _react["default"].createElement("div", {
120
- className: classes.label
123
+ }, /*#__PURE__*/_react["default"].createElement("div", {
124
+ className: classes.label,
125
+ "aria-hidden": !this.state.show
121
126
  }, toggled ? hideMessage : showMessage)))));
122
127
  }
123
128
  }]);
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.jsx"],"names":["CorrectAnswerToggle","props","state","show","onToggle","toggled","nextProps","setState","classes","className","hideMessage","showMessage","root","expander","content","onClick","bind","iconHolder","icon","label","React","Component","PropTypes","func","bool","string","object","isRequired","styles"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;;;;;;;;;;;AACA;;;IAGaA,mB;;;;;AAkBX,+BAAYC,KAAZ,EAAmB;AAAA;;AAAA;;AACjB,6FAAMA,KAAN;AACA,UAAKC,KAAL,GAAa;AACXC,MAAAA,IAAI,EAAEF,KAAK,CAACE;AADD,KAAb;AAFiB;AAKlB;;;;8BAES;AACR,WAAKF,KAAL,CAAWG,QAAX,CAAoB,CAAC,KAAKH,KAAL,CAAWI,OAAhC;AACD;;;8CAEyBC,S,EAAW;AACnC,WAAKC,QAAL,CA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AAAU;AAAV,SACE;AAAK,QAAA,SAAS,EAAEV,OAAO,CAACW;AAAxB,SAAgCd,OAAO,GAAGK,WAAH,GAAiBC,WAAxD,CADF,CATF,CADF,CADF,CADF;AAmBD;;;;EAzDsCS,kBAAMC,S;;;;gBAAlCrB,mB,eACQ;AACjBI,EAAAA,QAAQ,EAAEkB,sBAAUC,IADH;AAEjBlB,EAAAA,OAAO,EAAEiB,sBAAUE,IAFF;AAGjBrB,EAAAA,IAAI,EAAEmB,sBAAUE,IAHC;AAIjBd,EAAAA,WAAW,EAAEY,sBAAUG,MAJN;AAKjBd,EAAAA,WAAW,EAAEW,sBAAUG,MALN;AAMjBjB,EAAAA,OAAO,EAAEc,sBAAUI,MAAV,CAAiBC,UANT;AAOjBlB,EAAAA,SAAS,EAAEa,sBAAUG;AAPJ,C;;gBADRzB,mB,kBAWW;AACpBW,EAAAA,WAAW,EAAE,qBADO;AAEpBD,EAAAA,WAAW,EAAE,qBAFO;AAGpBP,EAAAA,IAAI,EAAE,KAHc;AAIpBE,EAAAA,OAAO,EAAE;AAJW,C;;eAiDT,yBAAWuB,kBAAX,EAAmB5B,mBAAnB,C","sourcesContent":["import styles from './styles';\nimport { withStyles } from '@material-ui/core/styles';\nimport CSSTransition from 'react-transition-group/CSSTransition';\nimport { CorrectResponse } from '@pie-lib/icons';\nimport { Readable } from '@pie-lib/render-ui';\nimport Expander from './expander';\nimport React from 'react';\nimport classNames from 'classnames';\nimport PropTypes from 'prop-types';\n/**\n * We export the raw unstyled class for testability. For public use please use the default export.\n */\nexport class CorrectAnswerToggle extends React.Component {\n static propTypes = {\n onToggle: PropTypes.func,\n toggled: PropTypes.bool,\n show: PropTypes.bool,\n hideMessage: PropTypes.string,\n showMessage: PropTypes.string,\n classes: PropTypes.object.isRequired,\n className: PropTypes.string\n };\n\n static defaultProps = {\n showMessage: 'Show correct answer',\n hideMessage: 'Hide correct answer',\n show: false,\n toggled: false\n };\n\n constructor(props) {\n super(props);\n this.state = {\n show: props.show\n };\n }\n\n onClick() {\n this.props.onToggle(!this.props.toggled);\n }\n\n componentWillReceiveProps(nextProps) {\n this.setState({\n show: nextProps.show\n });\n }\n\n render() {\n const { classes, className, toggled, hideMessage, showMessage } = this.props;\n\n return (\n <div className={classNames(classes.root, className)}>\n <Expander show={this.state.show} className={classes.expander}>\n <div className={classes.content} onClick={this.onClick.bind(this)}>\n <div className={classes.iconHolder}>\n <CSSTransition timeout={400} in={toggled} exit={!toggled} classNames={classes}>\n <CorrectResponse open={toggled} key=\"correct-open\" className={classes.icon} />\n </CSSTransition>\n <CSSTransition timeout={5000} in={!toggled} exit={toggled} classNames={classes}>\n <CorrectResponse open={toggled} key=\"correct-closed\" className={classes.icon} />\n </CSSTransition>\n </div>\n <Readable false>\n <div className={classes.label}>{toggled ? hideMessage : showMessage}</div>\n </Readable>\n </div>\n </Expander>\n </div>\n );\n }\n}\n\nexport default withStyles(styles)(CorrectAnswerToggle);\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../src/index.jsx"],"names":["CorrectAnswerToggle","props","state","show","onToggle","toggled","nextProps","setState","classes","className","hideMessage","showMessage","root","expander","content","onClick","bind","iconHolder","icon","label","React","Component","PropTypes","func","bool","string","object","isRequired","styles"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;AACA;AACA;AACA;IACaA,mB;;;;;AAkBX,+BAAYC,KAAZ,EAAmB;AAAA;;AAAA;;AACjB,8BAAMA,KAAN;AACA,UAAKC,KAAL,GAAa;AACXC,MAAAA,IAAI,EAAEF,KAAK,CAACE;AADD,KAAb;AAFiB;AAKlB;;;;WAED,mBAAU;AACR,WAAKF,KAAL,CAAWG,QAAX,CAAoB,CAAC,KAAKH,KAAL,CAAWI,OAAhC;AACD;;;WAED,mCAA0BC,SAA1B,EAAqC;AACnC,WAAKC,QAAL,CAAc;AACZJ,QAAAA,IAAI,EAAEG,SAAS,CAACH;AAD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;AAAK,QAAA,SAAS,EAAEV,OAAO,CAACW,KAAxB;AAA+B,uBAAa,CAAC,KAAKjB,KAAL,CAAWC;AAAxD,SACGE,OAAO,GAAGK,WAAH,GAAiBC,WAD3B,CADF,CATF,CADF,CADF,CADF;AAqBD;;;;EA3DsCS,kBAAMC,S;;;;gBAAlCrB,mB,eACQ;AACjBI,EAAAA,QAAQ,EAAEkB,sBAAUC,IADH;AAEjBlB,EAAAA,OAAO,EAAEiB,sBAAUE,IAFF;AAGjBrB,EAAAA,IAAI,EAAEmB,sBAAUE,IAHC;AAIjBd,EAAAA,WAAW,EAAEY,sBAAUG,MAJN;AAKjBd,EAAAA,WAAW,EAAEW,sBAAUG,MALN;AAMjBjB,EAAAA,OAAO,EAAEc,sBAAUI,MAAV,CAAiBC,UANT;AAOjBlB,EAAAA,SAAS,EAAEa,sBAAUG;AAPJ,C;;gBADRzB,mB,kBAWW;AACpBW,EAAAA,WAAW,EAAE,qBADO;AAEpBD,EAAAA,WAAW,EAAE,qBAFO;AAGpBP,EAAAA,IAAI,EAAE,KAHc;AAIpBE,EAAAA,OAAO,EAAE;AAJW,C;;eAmDT,yBAAWuB,kBAAX,EAAmB5B,mBAAnB,C","sourcesContent":["import styles from './styles';\nimport { withStyles } from '@material-ui/core/styles';\nimport CSSTransition from 'react-transition-group/CSSTransition';\nimport { CorrectResponse } from '@pie-lib/icons';\nimport { Readable } from '@pie-lib/render-ui';\nimport Expander from './expander';\nimport React from 'react';\nimport classNames from 'classnames';\nimport PropTypes from 'prop-types';\n/**\n * We export the raw unstyled class for testability. For public use please use the default export.\n */\nexport class CorrectAnswerToggle extends React.Component {\n static propTypes = {\n onToggle: PropTypes.func,\n toggled: PropTypes.bool,\n show: PropTypes.bool,\n hideMessage: PropTypes.string,\n showMessage: PropTypes.string,\n classes: PropTypes.object.isRequired,\n className: PropTypes.string\n };\n\n static defaultProps = {\n showMessage: 'Show correct answer',\n hideMessage: 'Hide correct answer',\n show: false,\n toggled: false\n };\n\n constructor(props) {\n super(props);\n this.state = {\n show: props.show\n };\n }\n\n onClick() {\n this.props.onToggle(!this.props.toggled);\n }\n\n componentWillReceiveProps(nextProps) {\n this.setState({\n show: nextProps.show\n });\n }\n\n render() {\n const { classes, className, toggled, hideMessage, showMessage } = this.props;\n\n return (\n <div className={classNames(classes.root, className)}>\n <Expander show={this.state.show} className={classes.expander}>\n <div className={classes.content} onClick={this.onClick.bind(this)}>\n <div className={classes.iconHolder}>\n <CSSTransition timeout={400} in={toggled} exit={!toggled} classNames={classes}>\n <CorrectResponse open={toggled} key=\"correct-open\" className={classes.icon} />\n </CSSTransition>\n <CSSTransition timeout={5000} in={!toggled} exit={toggled} classNames={classes}>\n <CorrectResponse open={toggled} key=\"correct-closed\" className={classes.icon} />\n </CSSTransition>\n </div>\n <Readable false>\n <div className={classes.label} aria-hidden={!this.state.show}>\n {toggled ? hideMessage : showMessage}\n </div>\n </Readable>\n </div>\n </Expander>\n </div>\n );\n }\n}\n\nexport default withStyles(styles)(CorrectAnswerToggle);\n"],"file":"index.js"}
package/lib/styles.js CHANGED
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.animationStyles = exports["default"] = void 0;
6
+ exports["default"] = exports.animationStyles = void 0;
7
7
 
8
8
  var _renderUi = require("@pie-lib/render-ui");
9
9
 
package/package.json CHANGED
@@ -11,14 +11,14 @@
11
11
  "publishConfig": {
12
12
  "access": "public"
13
13
  },
14
- "version": "2.3.29",
14
+ "version": "2.3.30-next.234+3bb6d0e9",
15
15
  "main": "lib/index.js",
16
16
  "module": "src/index.jsx",
17
17
  "scripts": {},
18
18
  "dependencies": {
19
19
  "@material-ui/core": "^3.8.3",
20
20
  "@pie-lib/icons": "^2.4.25",
21
- "@pie-lib/render-ui": "^4.12.0",
21
+ "@pie-lib/render-ui": "^4.12.1-next.234+3bb6d0e9",
22
22
  "classnames": "^2.2.6",
23
23
  "lodash": "^4.17.11",
24
24
  "prop-types": "^15.6.2",
@@ -32,5 +32,5 @@
32
32
  "react": "^16.8.1",
33
33
  "react-dom": "^16.8.1"
34
34
  },
35
- "gitHead": "de37d3ba44d3e7934e2f804381fe50d2da16a29a"
35
+ "gitHead": "3bb6d0e9216e3292f4fcd4ff5c557397d62fb82f"
36
36
  }
package/src/expander.jsx CHANGED
@@ -34,27 +34,32 @@ export default withStyles(() => ({
34
34
  height: 0,
35
35
  overflow: 'hidden',
36
36
  display: 'flex',
37
- visibility: 'hidden'
37
+ visibility: 'hidden',
38
+ width: 0
38
39
  },
39
40
  enter: {
40
41
  transition,
41
42
  opacity: 1,
42
43
  height: '25px',
44
+ width: 'auto',
43
45
  visibility: 'visible'
44
46
  },
45
47
  enterDone: {
46
48
  height: '25px',
47
- visibility: 'visible'
49
+ visibility: 'visible',
50
+ width: 'auto'
48
51
  },
49
52
  exit: {
50
53
  transition,
51
54
  opacity: 0,
52
- height: '0px',
53
- visibility: 'visible'
55
+ height: 0,
56
+ visibility: 'visible',
57
+ width: 0
54
58
  },
55
59
  exitDone: {
56
60
  opacity: 0,
57
61
  visibility: 'hidden',
58
- height: '0px'
62
+ height: 0,
63
+ width: 0
59
64
  }
60
65
  }))(Expander);
package/src/index.jsx CHANGED
@@ -61,7 +61,9 @@ export class CorrectAnswerToggle extends React.Component {
61
61
  </CSSTransition>
62
62
  </div>
63
63
  <Readable false>
64
- <div className={classes.label}>{toggled ? hideMessage : showMessage}</div>
64
+ <div className={classes.label} aria-hidden={!this.state.show}>
65
+ {toggled ? hideMessage : showMessage}
66
+ </div>
65
67
  </Readable>
66
68
  </div>
67
69
  </Expander>