@khanacademy/wonder-blocks-progress-spinner 1.1.37 → 1.1.39

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
@@ -1,5 +1,19 @@
1
1
  # @khanacademy/wonder-blocks-progress-spinner
2
2
 
3
+ ## 1.1.39
4
+
5
+ ### Patch Changes
6
+
7
+ - 496119f2: Cleanup WB interdependencies
8
+ - Updated dependencies [496119f2]
9
+ - @khanacademy/wonder-blocks-core@4.6.2
10
+
11
+ ## 1.1.38
12
+
13
+ ### Patch Changes
14
+
15
+ - @khanacademy/wonder-blocks-core@4.6.1
16
+
3
17
  ## 1.1.37
4
18
 
5
19
  ### Patch Changes
package/dist/index.js ADDED
@@ -0,0 +1,108 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var React = require('react');
6
+ var aphrodite = require('aphrodite');
7
+ var wonderBlocksCore = require('@khanacademy/wonder-blocks-core');
8
+ var Color = require('@khanacademy/wonder-blocks-color');
9
+
10
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
11
+
12
+ function _interopNamespace(e) {
13
+ if (e && e.__esModule) return e;
14
+ var n = Object.create(null);
15
+ if (e) {
16
+ Object.keys(e).forEach(function (k) {
17
+ if (k !== 'default') {
18
+ var d = Object.getOwnPropertyDescriptor(e, k);
19
+ Object.defineProperty(n, k, d.get ? d : {
20
+ enumerable: true,
21
+ get: function () { return e[k]; }
22
+ });
23
+ }
24
+ });
25
+ }
26
+ n["default"] = e;
27
+ return Object.freeze(n);
28
+ }
29
+
30
+ var React__namespace = /*#__PURE__*/_interopNamespace(React);
31
+ var Color__default = /*#__PURE__*/_interopDefaultLegacy(Color);
32
+
33
+ const heights = {
34
+ xsmall: 16,
35
+ small: 24,
36
+ medium: 48,
37
+ large: 96
38
+ };
39
+ const paths = {
40
+ xsmall: "M7.237.741C7.165.393 6.95.154 6.656.053A1.01 1.01 0 0 0 6.18.01c-.053.009-.053.009-.087.017C2.553.949 0 4.214 0 7.91 0 12.36 3.598 16 8 16c4.4 0 8-3.647 8-8.112a1.02 1.02 0 0 0-.118-.423.877.877 0 0 0-.808-.48.909.909 0 0 0-.81.46c-.09.151-.13.296-.146.455-.08 3.493-2.737 6.207-6.118 6.207-3.41 0-6.118-2.74-6.118-6.196 0-2.843 1.936-5.291 4.644-6.022.1-.028.224-.082.352-.177a.928.928 0 0 0 .36-.97z",
41
+ small: "M10.598.943c-.093-.449-.362-.748-.732-.875a1.314 1.314 0 0 0-.723-.033C3.83 1.417 0 6.317 0 11.864 0 18.538 5.398 24 12 24c6.598 0 12-5.471 12-12.16a1.333 1.333 0 0 0-.154-.548c-.193-.368-.544-.606-1.023-.606-.472 0-.825.229-1.035.585-.117.2-.169.39-.189.582-.124 5.472-4.294 9.73-9.599 9.73-5.349 0-9.599-4.3-9.599-9.72 0-4.46 3.036-8.299 7.28-9.444.127-.036.291-.107.458-.232.373-.28.57-.711.46-1.244z",
42
+ medium: "M44.19 23.455a1.91 1.91 0 1 1 3.801 0h.003c.004.18.006.363.006.545 0 13.255-10.745 24-24 24S0 37.255 0 24 10.745 0 24 0c.182 0 .364.002.545.006V.01a1.91 1.91 0 1 1 0 3.801v.015A20.564 20.564 0 0 0 24 3.818C12.854 3.818 3.818 12.854 3.818 24c0 11.146 9.036 20.182 20.182 20.182 11.146 0 20.182-9.036 20.182-20.182 0-.182-.003-.364-.007-.545h.015z",
43
+ large: "M88.38 46.91a3.818 3.818 0 1 1 7.602 0h.006c.008.362.012.725.012 1.09 0 26.51-21.49 48-48 48S0 74.51 0 48 21.49 0 48 0c.365 0 .728.004 1.09.012v.005a3.818 3.818 0 1 1 0 7.602v.032c-.362-.01-.725-.015-1.09-.015C25.708 7.636 7.636 25.708 7.636 48c0 22.292 18.072 40.364 40.364 40.364 22.292 0 40.364-18.072 40.364-40.364 0-.365-.005-.728-.015-1.09h.032z"
44
+ };
45
+ const colors = {
46
+ light: Color__default["default"].white,
47
+ dark: Color__default["default"].offBlack16
48
+ };
49
+ const StyledPath = wonderBlocksCore.addStyle("path");
50
+ class CircularSpinner extends React__namespace.Component {
51
+ render() {
52
+ const {
53
+ size,
54
+ light,
55
+ style,
56
+ testId
57
+ } = this.props;
58
+ const height = heights[size];
59
+ const path = paths[size];
60
+ const color = light ? colors.light : colors.dark;
61
+ const svg = React__namespace.createElement("svg", {
62
+ xmlns: "http://www.w3.org/2000/svg",
63
+ width: height,
64
+ height: height,
65
+ viewBox: `0 0 ${height} ${height}`,
66
+ "data-test-id": testId
67
+ }, React__namespace.createElement(StyledPath, {
68
+ style: [styles.loadingSpinner, {
69
+ fill: color
70
+ }],
71
+ fillRule: "nonzero",
72
+ d: path
73
+ }));
74
+ return React__namespace.createElement(wonderBlocksCore.View, {
75
+ style: [styles.spinnerContainer, style]
76
+ }, svg);
77
+ }
78
+
79
+ }
80
+ CircularSpinner.defaultProps = {
81
+ size: "large",
82
+ light: false
83
+ };
84
+ const rotateKeyFrames = {
85
+ "0%": {
86
+ transform: "rotate(0deg)"
87
+ },
88
+ "50%": {
89
+ transform: "rotate(180deg)"
90
+ },
91
+ "100%": {
92
+ transform: "rotate(360deg)"
93
+ }
94
+ };
95
+ const styles = aphrodite.StyleSheet.create({
96
+ spinnerContainer: {
97
+ justifyContent: "center"
98
+ },
99
+ loadingSpinner: {
100
+ transformOrigin: "50% 50%",
101
+ animationName: rotateKeyFrames,
102
+ animationDuration: "1.1s",
103
+ animationIterationCount: "infinite",
104
+ animationTimingFunction: "linear"
105
+ }
106
+ });
107
+
108
+ exports.CircularSpinner = CircularSpinner;
@@ -0,0 +1,2 @@
1
+ // @flow
2
+ export * from "../src/index.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@khanacademy/wonder-blocks-progress-spinner",
3
- "version": "1.1.37",
3
+ "version": "1.1.39",
4
4
  "design": "v1",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -17,14 +17,13 @@
17
17
  "dependencies": {
18
18
  "@babel/runtime": "^7.18.6",
19
19
  "@khanacademy/wonder-blocks-color": "^1.2.0",
20
- "@khanacademy/wonder-blocks-core": "^4.6.0",
21
- "@khanacademy/wonder-blocks-spacing": "^3.0.5"
20
+ "@khanacademy/wonder-blocks-core": "^4.6.2"
22
21
  },
23
22
  "peerDependencies": {
24
23
  "aphrodite": "^1.2.5",
25
24
  "react": "16.14.0"
26
25
  },
27
26
  "devDependencies": {
28
- "wb-dev-build-settings": "^0.5.0"
27
+ "wb-dev-build-settings": "^0.7.0"
29
28
  }
30
- }
29
+ }
@@ -1,74 +0,0 @@
1
- ```js
2
- import {StyleSheet} from "aphrodite";
3
- import {Text, View} from "@khanacademy/wonder-blocks-core";
4
- import Color from "@khanacademy/wonder-blocks-color";
5
-
6
- const styles = StyleSheet.create({
7
- contents: {
8
- flexDirection: "row",
9
- },
10
- dark: {
11
- background: Color.darkBlue,
12
- color: Color.white,
13
- },
14
- block: {
15
- width: 154,
16
- height: 154,
17
- marginRight: 16,
18
- alignItems: "center",
19
- justifyContent: "center",
20
- textAlign: "center",
21
- },
22
- inline: {
23
- display: "inline",
24
- }
25
- });
26
-
27
- <View>
28
- <View style={styles.contents}>
29
- <View style={styles.block}>
30
- <CircularSpinner size="large" />
31
- <Text>size: large (96px)</Text>
32
- </View>
33
- <View style={styles.block}>
34
- <CircularSpinner size="medium" />
35
- <Text>size: medium (48px)</Text>
36
- </View>
37
- <View style={styles.block}>
38
- <CircularSpinner size="small" />
39
- <Text>size: small (24px)</Text>
40
- </View>
41
- <View style={styles.block}>
42
- <CircularSpinner size="xsmall" />
43
- <Text>size: xsmall (16px)</Text>
44
- </View>
45
- </View>
46
-
47
- <View style={[styles.contents, styles.dark]}>
48
- <View style={styles.block}>
49
- <CircularSpinner size="large" light />
50
- <Text>light, size: large (96px)</Text>
51
- </View>
52
- <View style={styles.block}>
53
- <CircularSpinner size="medium" light />
54
- <Text>light, size: medium (48px)</Text>
55
- </View>
56
- <View style={styles.block}>
57
- <CircularSpinner size="small" light />
58
- <Text>light, size: small (24px)</Text>
59
- </View>
60
- <View style={styles.block}>
61
- <CircularSpinner size="xsmall" light />
62
- <Text>light, size: xsmall (16px)</Text>
63
- </View>
64
- </View>
65
-
66
- <View>
67
- <Text>
68
- Inline inside
69
- <CircularSpinner size="xsmall" style={styles.inline} />
70
- {" "}some text.
71
- </Text>
72
- </View>
73
- </View>
74
- ```