@khanacademy/perseus 1.3.0 → 1.3.2
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 +14 -0
- package/dist/es/index.js +18 -14
- package/dist/es/index.js.map +1 -1
- package/dist/index.js +18 -14
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/index.js +1 -0
- package/src/multi-items/__tests__/__snapshots__/multi-renderer_test.js.snap +26 -16
- package/src/widgets/__tests__/__snapshots__/group_test.jsx.snap +26 -16
- package/src/widgets/__tests__/__snapshots__/radio_test.jsx.snap +273 -169
- package/src/widgets/radio/__stories__/sat-styles.stories.jsx +191 -0
- package/src/widgets/radio/base-radio.jsx +1 -2
- package/src/widgets/radio/choice.jsx +13 -10
package/dist/index.js
CHANGED
|
@@ -27244,7 +27244,7 @@ function Choice(props) {
|
|
|
27244
27244
|
|
|
27245
27245
|
const satCorrectChoice = apiOptions.satStyling && reviewMode && correct;
|
|
27246
27246
|
const satIncorrectChecked = apiOptions.satStyling && reviewMode && !correct && checked;
|
|
27247
|
-
const descriptionClassName = classNames__default["default"]("description", satCorrectChoice && "sat-correct", satIncorrectChecked && "sat-incorrect", aphrodite.css(!apiOptions.satStyling && styles$o.description, apiOptions.satStyling && styles$o.satDescription, satCorrectChoice &&
|
|
27247
|
+
const descriptionClassName = classNames__default["default"]("description", satCorrectChoice && "sat-correct", satIncorrectChecked && "sat-incorrect", aphrodite.css(!apiOptions.satStyling && styles$o.description, apiOptions.satStyling && styles$o.satDescription, satCorrectChoice && checked && styles$o.satDescriptionCorrectChecked, satIncorrectChecked && styles$o.satDescriptionIncorrectChecked));
|
|
27248
27248
|
const rationaleClassName = classNames__default["default"]("perseus-radio-rationale-content", aphrodite.css(styles$o.rationale, !apiOptions.satStyling && styles$o.nonSatRationale, apiOptions.satStyling && styles$o.satReviewRationale)); // We want to show the choices as dimmed out when the choices are
|
|
27249
27249
|
// disabled. However, we don't want to do this in the SAT product and
|
|
27250
27250
|
// we also don't want to do this when we're in review mode in the
|
|
@@ -27257,13 +27257,14 @@ function Choice(props) {
|
|
|
27257
27257
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
27258
27258
|
style: {
|
|
27259
27259
|
dispay: "flex",
|
|
27260
|
-
flexDirection: "column"
|
|
27261
|
-
|
|
27260
|
+
flexDirection: "column",
|
|
27261
|
+
color: Color__default["default"].offBlack
|
|
27262
|
+
},
|
|
27263
|
+
className: descriptionClassName
|
|
27262
27264
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
27263
27265
|
style: {
|
|
27264
27266
|
display: "flex",
|
|
27265
27267
|
flexDirection: "row",
|
|
27266
|
-
width: "100%",
|
|
27267
27268
|
opacity: showDimmed ? 0.5 : 1.0
|
|
27268
27269
|
}
|
|
27269
27270
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
@@ -27282,7 +27283,8 @@ function Choice(props) {
|
|
|
27282
27283
|
},
|
|
27283
27284
|
onChange: () => {},
|
|
27284
27285
|
disabled: disabled || apiOptions.staticRender || apiOptions.readOnly,
|
|
27285
|
-
tabIndex: -1
|
|
27286
|
+
tabIndex: -1,
|
|
27287
|
+
className: ClassNames.RADIO.OPTION_CONTENT
|
|
27286
27288
|
}), /*#__PURE__*/React__namespace.createElement("label", {
|
|
27287
27289
|
htmlFor: choiceId
|
|
27288
27290
|
}, a11yText, " \xA0 ", content)), /*#__PURE__*/React__namespace.createElement(Clickable__default["default"], {
|
|
@@ -27294,7 +27296,6 @@ function Choice(props) {
|
|
|
27294
27296
|
crossedOut: false
|
|
27295
27297
|
});
|
|
27296
27298
|
},
|
|
27297
|
-
className: descriptionClassName,
|
|
27298
27299
|
disabled: disabled || apiOptions.staticRender || apiOptions.readOnly,
|
|
27299
27300
|
style: {
|
|
27300
27301
|
flex: 1
|
|
@@ -27392,7 +27393,15 @@ function Choice(props) {
|
|
|
27392
27393
|
return /*#__PURE__*/React__namespace.createElement(Clickable__default["default"], {
|
|
27393
27394
|
onClick: open,
|
|
27394
27395
|
"aria-label": "Open menu for Choice ".concat(getChoiceLetter(pos)),
|
|
27395
|
-
disabled: apiOptions.staticRender
|
|
27396
|
+
disabled: apiOptions.staticRender,
|
|
27397
|
+
style: {
|
|
27398
|
+
alignSelf: "center",
|
|
27399
|
+
padding: "5px",
|
|
27400
|
+
display: "flex",
|
|
27401
|
+
justifyContent: "center",
|
|
27402
|
+
alignItems: "center",
|
|
27403
|
+
marginLeft: "10px"
|
|
27404
|
+
}
|
|
27396
27405
|
}, _ref4 => {
|
|
27397
27406
|
return /*#__PURE__*/React__namespace.createElement(Icon, {
|
|
27398
27407
|
icon: ellipsisHorizontalIcon,
|
|
@@ -27427,16 +27436,12 @@ const styles$o = aphrodite.StyleSheet.create({
|
|
|
27427
27436
|
boxSizing: "border-box",
|
|
27428
27437
|
cursor: "pointer",
|
|
27429
27438
|
marginLeft: 0,
|
|
27430
|
-
padding: "17px 14px"
|
|
27431
|
-
},
|
|
27432
|
-
satDescriptionCorrect: {
|
|
27433
|
-
color: satCorrectColor
|
|
27439
|
+
padding: "17px 14px 17px 0"
|
|
27434
27440
|
},
|
|
27435
27441
|
satDescriptionCorrectChecked: {
|
|
27436
27442
|
backgroundColor: satCorrectBackgroundColor
|
|
27437
27443
|
},
|
|
27438
27444
|
satDescriptionIncorrectChecked: {
|
|
27439
|
-
color: satIncorrectColor,
|
|
27440
27445
|
backgroundColor: satIncorrectBackgroundColor
|
|
27441
27446
|
},
|
|
27442
27447
|
rationale: {
|
|
@@ -27786,8 +27791,7 @@ const styles$n = aphrodite.StyleSheet.create({
|
|
|
27786
27791
|
}
|
|
27787
27792
|
},
|
|
27788
27793
|
radio: {
|
|
27789
|
-
|
|
27790
|
-
width: "100%"
|
|
27794
|
+
padding: 0
|
|
27791
27795
|
},
|
|
27792
27796
|
responsiveRadioContainer: {
|
|
27793
27797
|
borderBottom: "1px solid ".concat(radioBorderColor$1),
|