@khanacademy/wonder-blocks-switch 1.1.18 → 1.1.19
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 +11 -0
- package/dist/es/index.js +1 -15
- package/dist/index.js +21 -32
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @khanacademy/wonder-blocks-switch
|
|
2
2
|
|
|
3
|
+
## 1.1.19
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 559e82d5: Update to build tooling, generating smaller output
|
|
8
|
+
- Updated dependencies [559e82d5]
|
|
9
|
+
- @khanacademy/wonder-blocks-core@6.4.3
|
|
10
|
+
- @khanacademy/wonder-blocks-icon@4.1.3
|
|
11
|
+
- @khanacademy/wonder-blocks-theming@2.0.3
|
|
12
|
+
- @khanacademy/wonder-blocks-tokens@1.3.1
|
|
13
|
+
|
|
3
14
|
## 1.1.18
|
|
4
15
|
|
|
5
16
|
### Patch Changes
|
package/dist/es/index.js
CHANGED
|
@@ -1,24 +1,10 @@
|
|
|
1
|
+
import _extends from '@babel/runtime/helpers/extends';
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
import { StyleSheet } from 'aphrodite';
|
|
3
4
|
import { addStyle, useUniqueIdWithMock, View } from '@khanacademy/wonder-blocks-core';
|
|
4
5
|
import { mergeTheme, createThemeContext, ThemeSwitcherContext, useScopedTheme, useStyles } from '@khanacademy/wonder-blocks-theming';
|
|
5
6
|
import * as tokens from '@khanacademy/wonder-blocks-tokens';
|
|
6
7
|
|
|
7
|
-
function _extends() {
|
|
8
|
-
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
9
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
10
|
-
var source = arguments[i];
|
|
11
|
-
for (var key in source) {
|
|
12
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
13
|
-
target[key] = source[key];
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
return target;
|
|
18
|
-
};
|
|
19
|
-
return _extends.apply(this, arguments);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
8
|
const theme$1 = {
|
|
23
9
|
color: {
|
|
24
10
|
bg: {
|
package/dist/index.js
CHANGED
|
@@ -1,47 +1,36 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var _extends = require('@babel/runtime/helpers/extends');
|
|
3
4
|
var React = require('react');
|
|
4
5
|
var aphrodite = require('aphrodite');
|
|
5
6
|
var wonderBlocksCore = require('@khanacademy/wonder-blocks-core');
|
|
6
7
|
var wonderBlocksTheming = require('@khanacademy/wonder-blocks-theming');
|
|
7
8
|
var tokens = require('@khanacademy/wonder-blocks-tokens');
|
|
8
9
|
|
|
10
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
11
|
+
|
|
9
12
|
function _interopNamespace(e) {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
|
+
}
|
|
19
24
|
});
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
n["default"] = e;
|
|
24
|
-
return Object.freeze(n);
|
|
25
|
+
}
|
|
26
|
+
n["default"] = e;
|
|
27
|
+
return Object.freeze(n);
|
|
25
28
|
}
|
|
26
29
|
|
|
30
|
+
var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);
|
|
27
31
|
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
28
32
|
var tokens__namespace = /*#__PURE__*/_interopNamespace(tokens);
|
|
29
33
|
|
|
30
|
-
function _extends() {
|
|
31
|
-
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
32
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
33
|
-
var source = arguments[i];
|
|
34
|
-
for (var key in source) {
|
|
35
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
36
|
-
target[key] = source[key];
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
return target;
|
|
41
|
-
};
|
|
42
|
-
return _extends.apply(this, arguments);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
34
|
const theme$1 = {
|
|
46
35
|
color: {
|
|
47
36
|
bg: {
|
|
@@ -260,7 +249,7 @@ const _generateStyles = (checked, clickable, disabled, theme, themeName) => {
|
|
|
260
249
|
};
|
|
261
250
|
if (checked) {
|
|
262
251
|
newStyles = {
|
|
263
|
-
switch:
|
|
252
|
+
switch: _extends__default["default"]({
|
|
264
253
|
backgroundColor: disabled ? theme.color.bg.switch.disabledOn : theme.color.bg.switch.on,
|
|
265
254
|
":active": {
|
|
266
255
|
backgroundColor: !disabled && clickable ? theme.color.bg.switch.activeOn : undefined
|
|
@@ -276,7 +265,7 @@ const _generateStyles = (checked, clickable, disabled, theme, themeName) => {
|
|
|
276
265
|
};
|
|
277
266
|
} else {
|
|
278
267
|
newStyles = {
|
|
279
|
-
switch:
|
|
268
|
+
switch: _extends__default["default"]({
|
|
280
269
|
backgroundColor: disabled ? theme.color.bg.switch.disabledOff : theme.color.bg.switch.off,
|
|
281
270
|
":active": {
|
|
282
271
|
backgroundColor: !disabled && clickable ? theme.color.bg.switch.activeOff : undefined
|
|
@@ -294,7 +283,7 @@ const _generateStyles = (checked, clickable, disabled, theme, themeName) => {
|
|
|
294
283
|
return styles[checkedStyle];
|
|
295
284
|
};
|
|
296
285
|
const Switch = React__namespace.forwardRef(function Switch(props, ref) {
|
|
297
|
-
return React__namespace.createElement(ThemedSwitch, null, React__namespace.createElement(SwitchCore,
|
|
286
|
+
return React__namespace.createElement(ThemedSwitch, null, React__namespace.createElement(SwitchCore, _extends__default["default"]({}, props, {
|
|
298
287
|
ref: ref
|
|
299
288
|
})));
|
|
300
289
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@khanacademy/wonder-blocks-switch",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.19",
|
|
4
4
|
"design": "v1",
|
|
5
5
|
"description": "Switch components for Wonder Blocks.",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -16,16 +16,16 @@
|
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@babel/runtime": "^7.18.6",
|
|
19
|
-
"@khanacademy/wonder-blocks-core": "^6.4.
|
|
20
|
-
"@khanacademy/wonder-blocks-icon": "^4.1.
|
|
21
|
-
"@khanacademy/wonder-blocks-theming": "^2.0.
|
|
22
|
-
"@khanacademy/wonder-blocks-tokens": "^1.3.
|
|
19
|
+
"@khanacademy/wonder-blocks-core": "^6.4.3",
|
|
20
|
+
"@khanacademy/wonder-blocks-icon": "^4.1.3",
|
|
21
|
+
"@khanacademy/wonder-blocks-theming": "^2.0.3",
|
|
22
|
+
"@khanacademy/wonder-blocks-tokens": "^1.3.1"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"aphrodite": "^1.2.5",
|
|
26
26
|
"react": "16.14.0"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@khanacademy/wb-dev-build-settings": "^1.0.
|
|
29
|
+
"@khanacademy/wb-dev-build-settings": "^1.0.1"
|
|
30
30
|
}
|
|
31
31
|
}
|