@khanacademy/perseus 0.4.2 → 1.0.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 (50) hide show
  1. package/.eslintrc.js +11 -0
  2. package/CHANGELOG.md +47 -0
  3. package/dist/es/index.js +1078 -1299
  4. package/dist/es/index.js.map +1 -1
  5. package/dist/index.js +1077 -1304
  6. package/dist/index.js.map +1 -1
  7. package/dist/strings.js +0 -4
  8. package/package.json +9 -8
  9. package/src/multi-items/__tests__/__snapshots__/multi-renderer_test.js.snap +110 -110
  10. package/src/perseus-api.jsx +10 -36
  11. package/src/perseus-types.js +0 -138
  12. package/src/styles/constants.js +0 -2
  13. package/src/styles/variables.less +0 -2
  14. package/src/types.js +18 -35
  15. package/src/util.js +0 -6
  16. package/src/version.js +1 -1
  17. package/src/widgets/__testdata__/base-radio_testdata.js +22 -0
  18. package/src/widgets/__tests__/__snapshots__/group_test.jsx.snap +110 -110
  19. package/src/widgets/__tests__/__snapshots__/radio_test.jsx.snap +1136 -1160
  20. package/src/widgets/__tests__/radio/base-radio_test.jsx +243 -41
  21. package/src/widgets/__tests__/radio/choice-icon_test.jsx +67 -0
  22. package/src/widgets/__tests__/radio/choice_test.jsx +201 -0
  23. package/src/widgets/__tests__/radio/focus-ring_test.jsx +23 -0
  24. package/src/widgets/__tests__/radio/option-status_test.jsx +65 -0
  25. package/src/widgets/passage/__tests__/passage-markdown_test.jsx +0 -9
  26. package/src/widgets/passage/get-line-height-for-node.js +4 -5
  27. package/src/widgets/passage/passage-markdown.jsx +176 -120
  28. package/src/widgets/passage.jsx +48 -46
  29. package/src/widgets/radio/__stories__/base-radio.stories.jsx +164 -17
  30. package/src/widgets/radio/__stories__/choice-icon.stories.jsx +202 -111
  31. package/src/widgets/radio/__stories__/choice-none-above.stories.jsx +21 -6
  32. package/src/widgets/radio/__stories__/choice.stories.jsx +138 -0
  33. package/src/widgets/radio/__stories__/focus-ring.stories.jsx +29 -23
  34. package/src/widgets/radio/__stories__/option-status.stories.jsx +93 -99
  35. package/src/widgets/radio/base-radio.jsx +483 -556
  36. package/src/widgets/radio/choice-icon/choice-icon.jsx +155 -0
  37. package/src/widgets/radio/choice-icon/cross-out-line.jsx +55 -0
  38. package/src/widgets/radio/choice-icon/library-choice-icon.jsx +219 -0
  39. package/src/widgets/radio/choice-icon/sat-choice-icon.jsx +129 -0
  40. package/src/widgets/radio/choice-icon/shared-styles.js +17 -0
  41. package/src/widgets/radio/choice-none-above.jsx +49 -40
  42. package/src/widgets/radio/choice.jsx +282 -353
  43. package/src/widgets/radio/choice.jsx.fixture.js +0 -18
  44. package/src/widgets/radio/focus-ring.jsx +29 -22
  45. package/src/widgets/radio/option-status.jsx +58 -36
  46. package/src/widgets/radio/widget.jsx +181 -136
  47. package/src/widgets/radio.jsx +16 -17
  48. package/src/widgets/radio/__stories__/cross-out-button.stories.jsx +0 -64
  49. package/src/widgets/radio/choice-icon.jsx +0 -469
  50. package/src/widgets/radio/cross-out-button.jsx +0 -134
package/.eslintrc.js ADDED
@@ -0,0 +1,11 @@
1
+ /* eslint-disable import/no-commonjs */
2
+ const path = require("path");
3
+
4
+ module.exports = {
5
+ rules: {
6
+ "import/no-extraneous-dependencies": [
7
+ "error",
8
+ {packageDir: [__dirname, path.join(__dirname, "../../")]},
9
+ ],
10
+ },
11
+ };
package/CHANGELOG.md CHANGED
@@ -1,5 +1,52 @@
1
1
  # @khanacademy/perseus
2
2
 
3
+ ## 1.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - f9e0cda6: Change API shape: remove radioStyleVersion, add primaryProductColor to styling
8
+
9
+ ### Minor Changes
10
+
11
+ - 61a7084e: make multi-select options look more like checkboxes
12
+
13
+ ### Patch Changes
14
+
15
+ - 2a3ac714: adds better flow coverage to base-radio.jsx
16
+ - 28170809: refactors base-radio to be a functional component
17
+ - ea104d1c: Delete original choice icon now that it's been refactored and moved
18
+ - 8c6c60f5: Converts OptionStatus component to a functional component
19
+ - 80e2cafc: refactor focus-ring to functional component
20
+ - f567f660: Update the eslint config to look at both the package.json for the package and the one from the root
21
+ - e8a60745: increase story/test coverage of base-radio
22
+ - 61a7084e: code cleanup for the choice-icon radio sub-component
23
+ - 16eccaea: convert Radio's Choice component into a functional component
24
+ - eeaa9010: Add more Flow typing to passage and passage-markdown widgets
25
+ - d4d2b3a6: removes unused crossOutButton component
26
+ - 46859806: Increases flow coverage for Radio's Widget component to 100%
27
+ - f5682ad6: fixes a bug in the multiselect radio widget to allow selected choices to be unselected
28
+ - Updated dependencies [f567f660]
29
+ - Updated dependencies [eeaa9010]
30
+ - @khanacademy/kas@0.2.7
31
+ - @khanacademy/kmath@0.0.8
32
+ - @khanacademy/math-input@0.6.3
33
+ - @khanacademy/perseus-linter@0.2.3
34
+ - @khanacademy/pure-markdown@0.1.3
35
+ - @khanacademy/simple-markdown@0.8.6
36
+
37
+ ## 0.4.3
38
+
39
+ ### Patch Changes
40
+
41
+ - bf180fe1: Fix our use of import/no-extraneous-dependencies
42
+ - Updated dependencies [bf180fe1]
43
+ - @khanacademy/kas@0.2.6
44
+ - @khanacademy/kmath@0.0.7
45
+ - @khanacademy/math-input@0.6.2
46
+ - @khanacademy/perseus-linter@0.2.2
47
+ - @khanacademy/pure-markdown@0.1.2
48
+ - @khanacademy/simple-markdown@0.8.5
49
+
3
50
  ## 0.4.2
4
51
 
5
52
  ### Patch Changes