@khanacademy/wonder-blocks-button 3.0.7 → 3.0.9
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 +13 -0
- package/dist/es/index.js +14 -2
- package/dist/index.js +21 -6
- package/package.json +2 -2
- package/src/__tests__/__snapshots__/custom-snapshot.test.js.snap +152 -179
- package/src/__tests__/custom-snapshot.test.js +0 -1
- package/src/components/__docs__/button.stories.js +4 -1
- package/src/components/button-core.js +19 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @khanacademy/wonder-blocks-button
|
|
2
2
|
|
|
3
|
+
## 3.0.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [4c682709]
|
|
8
|
+
- @khanacademy/wonder-blocks-clickable@2.4.1
|
|
9
|
+
|
|
10
|
+
## 3.0.8
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- 8e3d9439: Fix tertiary button styles (pressed and disabled+focused)
|
|
15
|
+
|
|
3
16
|
## 3.0.7
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
package/dist/es/index.js
CHANGED
|
@@ -274,14 +274,26 @@ const _generateStyles = (color, kind, light, iconWidth, size) => {
|
|
|
274
274
|
height: 2,
|
|
275
275
|
width: `calc(100% - ${iconWidth}px)`,
|
|
276
276
|
right: 0,
|
|
277
|
-
bottom:
|
|
277
|
+
bottom: -1,
|
|
278
278
|
background: light ? fadedColor : activeColor,
|
|
279
279
|
borderRadius: 2
|
|
280
280
|
}
|
|
281
281
|
},
|
|
282
282
|
disabled: {
|
|
283
283
|
color: light ? fadedColor : offBlack32,
|
|
284
|
-
cursor: "default"
|
|
284
|
+
cursor: "default",
|
|
285
|
+
":focus": {
|
|
286
|
+
":after": {
|
|
287
|
+
content: "''",
|
|
288
|
+
position: "absolute",
|
|
289
|
+
height: 2,
|
|
290
|
+
width: `calc(100% - ${iconWidth}px)`,
|
|
291
|
+
right: 0,
|
|
292
|
+
bottom: `calc(50% - 11px)`,
|
|
293
|
+
background: light ? white : offBlack32,
|
|
294
|
+
borderRadius: 2
|
|
295
|
+
}
|
|
296
|
+
}
|
|
285
297
|
}
|
|
286
298
|
};
|
|
287
299
|
} else {
|
package/dist/index.js
CHANGED
|
@@ -105,19 +105,16 @@ function _extends() {
|
|
|
105
105
|
module.exports = _extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
106
106
|
for (var i = 1; i < arguments.length; i++) {
|
|
107
107
|
var source = arguments[i];
|
|
108
|
-
|
|
109
108
|
for (var key in source) {
|
|
110
109
|
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
111
110
|
target[key] = source[key];
|
|
112
111
|
}
|
|
113
112
|
}
|
|
114
113
|
}
|
|
115
|
-
|
|
116
114
|
return target;
|
|
117
115
|
}, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
118
116
|
return _extends.apply(this, arguments);
|
|
119
117
|
}
|
|
120
|
-
|
|
121
118
|
module.exports = _extends, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
122
119
|
|
|
123
120
|
/***/ }),
|
|
@@ -568,7 +565,6 @@ const _generateStyles = (color, kind, light, iconWidth, size) => {
|
|
|
568
565
|
}
|
|
569
566
|
};
|
|
570
567
|
} else if (kind === "tertiary") {
|
|
571
|
-
// TODO(FEI-4229): Make tertiary buttons focusable
|
|
572
568
|
newStyles = {
|
|
573
569
|
default: {
|
|
574
570
|
background: "none",
|
|
@@ -596,14 +592,33 @@ const _generateStyles = (color, kind, light, iconWidth, size) => {
|
|
|
596
592
|
height: 2,
|
|
597
593
|
width: `calc(100% - ${iconWidth}px)`,
|
|
598
594
|
right: 0,
|
|
599
|
-
bottom:
|
|
595
|
+
bottom: -1,
|
|
600
596
|
background: light ? fadedColor : activeColor,
|
|
601
597
|
borderRadius: 2
|
|
602
598
|
}
|
|
603
599
|
},
|
|
604
600
|
disabled: {
|
|
605
601
|
color: light ? fadedColor : offBlack32,
|
|
606
|
-
cursor: "default"
|
|
602
|
+
cursor: "default",
|
|
603
|
+
":focus": {
|
|
604
|
+
":after": {
|
|
605
|
+
content: "''",
|
|
606
|
+
position: "absolute",
|
|
607
|
+
height: 2,
|
|
608
|
+
width: `calc(100% - ${iconWidth}px)`,
|
|
609
|
+
right: 0,
|
|
610
|
+
|
|
611
|
+
/**
|
|
612
|
+
* For tertiary buttons, underline is applied to the
|
|
613
|
+
* internal `span` element, So we need to calculate the
|
|
614
|
+
* offset to center the line in the button (right after
|
|
615
|
+
* the span).
|
|
616
|
+
*/
|
|
617
|
+
bottom: `calc(50% - 11px)`,
|
|
618
|
+
background: light ? white : offBlack32,
|
|
619
|
+
borderRadius: 2
|
|
620
|
+
}
|
|
621
|
+
}
|
|
607
622
|
}
|
|
608
623
|
};
|
|
609
624
|
} else {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@khanacademy/wonder-blocks-button",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.9",
|
|
4
4
|
"design": "v1",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"license": "MIT",
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@babel/runtime": "^7.18.6",
|
|
19
|
-
"@khanacademy/wonder-blocks-clickable": "^2.4.
|
|
19
|
+
"@khanacademy/wonder-blocks-clickable": "^2.4.1",
|
|
20
20
|
"@khanacademy/wonder-blocks-color": "^1.2.0",
|
|
21
21
|
"@khanacademy/wonder-blocks-core": "^4.5.0",
|
|
22
22
|
"@khanacademy/wonder-blocks-icon": "^1.2.32",
|