@khanacademy/wonder-blocks-switch 3.1.0 → 3.1.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 +31 -0
- package/dist/es/index.js +4 -4
- package/dist/index.js +15 -11
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,36 @@
|
|
|
1
1
|
# @khanacademy/wonder-blocks-switch
|
|
2
2
|
|
|
3
|
+
## 3.1.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 5655b9f: Switch to use `focus.outer` semanticColor token
|
|
8
|
+
- 8f53293: Rename action tokens: `filled` -> `primary`, `outlined` -> `secondary`.
|
|
9
|
+
- 051f0f8: Rework action.disabled tokens to include properties per kind (border, background, foreground).
|
|
10
|
+
- Updated dependencies [ed26d66]
|
|
11
|
+
- Updated dependencies [5655b9f]
|
|
12
|
+
- Updated dependencies [5655b9f]
|
|
13
|
+
- Updated dependencies [8f53293]
|
|
14
|
+
- Updated dependencies [6d37702]
|
|
15
|
+
- Updated dependencies [051f0f8]
|
|
16
|
+
- Updated dependencies [e1b78db]
|
|
17
|
+
- Updated dependencies [051f0f8]
|
|
18
|
+
- @khanacademy/wonder-blocks-core@12.2.0
|
|
19
|
+
- @khanacademy/wonder-blocks-tokens@5.0.0
|
|
20
|
+
- @khanacademy/wonder-blocks-theming@3.2.0
|
|
21
|
+
- @khanacademy/wonder-blocks-icon@5.1.2
|
|
22
|
+
|
|
23
|
+
## 3.1.1
|
|
24
|
+
|
|
25
|
+
### Patch Changes
|
|
26
|
+
|
|
27
|
+
- ee8d95a: Rollback rollup version from v4 to v2 to prevent an issue with CJS builds in unit tests
|
|
28
|
+
- Updated dependencies [ee8d95a]
|
|
29
|
+
- @khanacademy/wonder-blocks-core@12.1.1
|
|
30
|
+
- @khanacademy/wonder-blocks-icon@5.1.1
|
|
31
|
+
- @khanacademy/wonder-blocks-theming@3.1.1
|
|
32
|
+
- @khanacademy/wonder-blocks-tokens@4.2.1
|
|
33
|
+
|
|
3
34
|
## 3.1.0
|
|
4
35
|
|
|
5
36
|
### Minor Changes
|
package/dist/es/index.js
CHANGED
|
@@ -7,13 +7,13 @@ import { mergeTheme, createThemeContext, ThemeSwitcherContext, useScopedTheme, u
|
|
|
7
7
|
import * as tokens from '@khanacademy/wonder-blocks-tokens';
|
|
8
8
|
import { semanticColor, color, spacing, border } from '@khanacademy/wonder-blocks-tokens';
|
|
9
9
|
|
|
10
|
-
const action = semanticColor.action.
|
|
10
|
+
const action = semanticColor.action.secondary.progressive;
|
|
11
11
|
const theme$1 = {
|
|
12
12
|
color: {
|
|
13
13
|
bg: {
|
|
14
14
|
switch: {
|
|
15
15
|
off: action.default.border,
|
|
16
|
-
disabledOff: semanticColor.action.disabled.
|
|
16
|
+
disabledOff: semanticColor.action.primary.disabled.background,
|
|
17
17
|
activeOff: color.fadedOffBlack64,
|
|
18
18
|
on: action.default.foreground,
|
|
19
19
|
disabledOn: action.press.background,
|
|
@@ -27,11 +27,11 @@ const theme$1 = {
|
|
|
27
27
|
on: action.default.foreground,
|
|
28
28
|
disabledOn: action.press.background,
|
|
29
29
|
off: action.default.border,
|
|
30
|
-
disabledOff: semanticColor.
|
|
30
|
+
disabledOff: semanticColor.icon.disabled
|
|
31
31
|
}
|
|
32
32
|
},
|
|
33
33
|
outline: {
|
|
34
|
-
default: semanticColor.
|
|
34
|
+
default: semanticColor.focus.outer
|
|
35
35
|
}
|
|
36
36
|
},
|
|
37
37
|
border: {
|
package/dist/index.js
CHANGED
|
@@ -7,7 +7,10 @@ var wonderBlocksCore = require('@khanacademy/wonder-blocks-core');
|
|
|
7
7
|
var wonderBlocksTheming = require('@khanacademy/wonder-blocks-theming');
|
|
8
8
|
var tokens = require('@khanacademy/wonder-blocks-tokens');
|
|
9
9
|
|
|
10
|
-
function
|
|
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;
|
|
11
14
|
var n = Object.create(null);
|
|
12
15
|
if (e) {
|
|
13
16
|
Object.keys(e).forEach(function (k) {
|
|
@@ -20,20 +23,21 @@ function _interopNamespaceDefault(e) {
|
|
|
20
23
|
}
|
|
21
24
|
});
|
|
22
25
|
}
|
|
23
|
-
n
|
|
26
|
+
n["default"] = e;
|
|
24
27
|
return Object.freeze(n);
|
|
25
28
|
}
|
|
26
29
|
|
|
27
|
-
var
|
|
28
|
-
var
|
|
30
|
+
var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);
|
|
31
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
32
|
+
var tokens__namespace = /*#__PURE__*/_interopNamespace(tokens);
|
|
29
33
|
|
|
30
|
-
const action = tokens.semanticColor.action.
|
|
34
|
+
const action = tokens.semanticColor.action.secondary.progressive;
|
|
31
35
|
const theme$1 = {
|
|
32
36
|
color: {
|
|
33
37
|
bg: {
|
|
34
38
|
switch: {
|
|
35
39
|
off: action.default.border,
|
|
36
|
-
disabledOff: tokens.semanticColor.action.disabled.
|
|
40
|
+
disabledOff: tokens.semanticColor.action.primary.disabled.background,
|
|
37
41
|
activeOff: tokens.color.fadedOffBlack64,
|
|
38
42
|
on: action.default.foreground,
|
|
39
43
|
disabledOn: action.press.background,
|
|
@@ -47,11 +51,11 @@ const theme$1 = {
|
|
|
47
51
|
on: action.default.foreground,
|
|
48
52
|
disabledOn: action.press.background,
|
|
49
53
|
off: action.default.border,
|
|
50
|
-
disabledOff: tokens.semanticColor.
|
|
54
|
+
disabledOff: tokens.semanticColor.icon.disabled
|
|
51
55
|
}
|
|
52
56
|
},
|
|
53
57
|
outline: {
|
|
54
|
-
default: tokens.semanticColor.
|
|
58
|
+
default: tokens.semanticColor.focus.outer
|
|
55
59
|
}
|
|
56
60
|
},
|
|
57
61
|
border: {
|
|
@@ -250,7 +254,7 @@ const _generateStyles = (checked, clickable, disabled, theme, themeName) => {
|
|
|
250
254
|
};
|
|
251
255
|
if (checked) {
|
|
252
256
|
newStyles = {
|
|
253
|
-
switch:
|
|
257
|
+
switch: _extends__default["default"]({
|
|
254
258
|
backgroundColor: disabled ? theme.color.bg.switch.disabledOn : theme.color.bg.switch.on,
|
|
255
259
|
":active": {
|
|
256
260
|
backgroundColor: !disabled && clickable ? theme.color.bg.switch.activeOn : undefined
|
|
@@ -266,7 +270,7 @@ const _generateStyles = (checked, clickable, disabled, theme, themeName) => {
|
|
|
266
270
|
};
|
|
267
271
|
} else {
|
|
268
272
|
newStyles = {
|
|
269
|
-
switch:
|
|
273
|
+
switch: _extends__default["default"]({
|
|
270
274
|
backgroundColor: disabled ? theme.color.bg.switch.disabledOff : theme.color.bg.switch.off,
|
|
271
275
|
":active": {
|
|
272
276
|
backgroundColor: !disabled && clickable ? theme.color.bg.switch.activeOff : undefined
|
|
@@ -284,7 +288,7 @@ const _generateStyles = (checked, clickable, disabled, theme, themeName) => {
|
|
|
284
288
|
return styles[checkedStyle];
|
|
285
289
|
};
|
|
286
290
|
const Switch = React__namespace.forwardRef(function Switch(props, ref) {
|
|
287
|
-
return React__namespace.createElement(ThemedSwitch, null, React__namespace.createElement(SwitchCore,
|
|
291
|
+
return React__namespace.createElement(ThemedSwitch, null, React__namespace.createElement(SwitchCore, _extends__default["default"]({}, props, {
|
|
288
292
|
ref: ref
|
|
289
293
|
})));
|
|
290
294
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@khanacademy/wonder-blocks-switch",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.2",
|
|
4
4
|
"design": "v1",
|
|
5
5
|
"description": "Switch components for Wonder Blocks.",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -13,17 +13,17 @@
|
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"@babel/runtime": "^7.24.5",
|
|
16
|
-
"@khanacademy/wonder-blocks-core": "12.
|
|
17
|
-
"@khanacademy/wonder-blocks-icon": "5.1.
|
|
18
|
-
"@khanacademy/wonder-blocks-theming": "3.
|
|
19
|
-
"@khanacademy/wonder-blocks-tokens": "
|
|
16
|
+
"@khanacademy/wonder-blocks-core": "12.2.0",
|
|
17
|
+
"@khanacademy/wonder-blocks-icon": "5.1.2",
|
|
18
|
+
"@khanacademy/wonder-blocks-theming": "3.2.0",
|
|
19
|
+
"@khanacademy/wonder-blocks-tokens": "5.0.0"
|
|
20
20
|
},
|
|
21
21
|
"peerDependencies": {
|
|
22
22
|
"aphrodite": "^1.2.5",
|
|
23
23
|
"react": "18.2.0"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@khanacademy/wb-dev-build-settings": "2.1.
|
|
26
|
+
"@khanacademy/wb-dev-build-settings": "2.1.1"
|
|
27
27
|
},
|
|
28
28
|
"scripts": {
|
|
29
29
|
"test": "echo \"Error: no test specified\" && exit 1"
|