@khanacademy/wonder-blocks-button 3.0.1 → 3.0.3
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 +19 -0
- package/dist/index.js +96 -71
- package/package.json +7 -7
- package/src/__tests__/__snapshots__/custom-snapshot.test.js.snap +855 -855
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @khanacademy/wonder-blocks-button
|
|
2
2
|
|
|
3
|
+
## 3.0.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [6ee20af9]
|
|
8
|
+
- @khanacademy/wonder-blocks-core@4.4.0
|
|
9
|
+
- @khanacademy/wonder-blocks-clickable@2.3.1
|
|
10
|
+
- @khanacademy/wonder-blocks-icon@1.2.30
|
|
11
|
+
- @khanacademy/wonder-blocks-progress-spinner@1.1.35
|
|
12
|
+
- @khanacademy/wonder-blocks-typography@1.1.33
|
|
13
|
+
|
|
14
|
+
## 3.0.2
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- Updated dependencies [34c7aacb]
|
|
19
|
+
- @khanacademy/wonder-blocks-color@1.2.0
|
|
20
|
+
- @khanacademy/wonder-blocks-progress-spinner@1.1.34
|
|
21
|
+
|
|
3
22
|
## 3.0.1
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -82,7 +82,7 @@ module.exports =
|
|
|
82
82
|
/******/
|
|
83
83
|
/******/
|
|
84
84
|
/******/ // Load entry module and return exports
|
|
85
|
-
/******/ return __webpack_require__(__webpack_require__.s =
|
|
85
|
+
/******/ return __webpack_require__(__webpack_require__.s = 14);
|
|
86
86
|
/******/ })
|
|
87
87
|
/************************************************************************/
|
|
88
88
|
/******/ ([
|
|
@@ -101,52 +101,76 @@ module.exports = require("@khanacademy/wonder-blocks-color");
|
|
|
101
101
|
/* 2 */
|
|
102
102
|
/***/ (function(module, exports) {
|
|
103
103
|
|
|
104
|
-
|
|
104
|
+
function _extends() {
|
|
105
|
+
module.exports = _extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
106
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
107
|
+
var source = arguments[i];
|
|
108
|
+
|
|
109
|
+
for (var key in source) {
|
|
110
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
111
|
+
target[key] = source[key];
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
return target;
|
|
117
|
+
}, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
118
|
+
return _extends.apply(this, arguments);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
module.exports = _extends, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
105
122
|
|
|
106
123
|
/***/ }),
|
|
107
124
|
/* 3 */
|
|
108
125
|
/***/ (function(module, exports) {
|
|
109
126
|
|
|
110
|
-
module.exports = require("
|
|
127
|
+
module.exports = require("@khanacademy/wonder-blocks-spacing");
|
|
111
128
|
|
|
112
129
|
/***/ }),
|
|
113
130
|
/* 4 */
|
|
114
131
|
/***/ (function(module, exports) {
|
|
115
132
|
|
|
116
|
-
module.exports = require("
|
|
133
|
+
module.exports = require("react-router");
|
|
117
134
|
|
|
118
135
|
/***/ }),
|
|
119
136
|
/* 5 */
|
|
120
137
|
/***/ (function(module, exports) {
|
|
121
138
|
|
|
122
|
-
module.exports = require("@khanacademy/wonder-blocks-
|
|
139
|
+
module.exports = require("@khanacademy/wonder-blocks-clickable");
|
|
123
140
|
|
|
124
141
|
/***/ }),
|
|
125
142
|
/* 6 */
|
|
126
143
|
/***/ (function(module, exports) {
|
|
127
144
|
|
|
128
|
-
module.exports = require("
|
|
145
|
+
module.exports = require("@khanacademy/wonder-blocks-core");
|
|
129
146
|
|
|
130
147
|
/***/ }),
|
|
131
148
|
/* 7 */
|
|
132
149
|
/***/ (function(module, exports) {
|
|
133
150
|
|
|
134
|
-
module.exports = require("
|
|
151
|
+
module.exports = require("aphrodite");
|
|
135
152
|
|
|
136
153
|
/***/ }),
|
|
137
154
|
/* 8 */
|
|
155
|
+
/***/ (function(module, exports) {
|
|
156
|
+
|
|
157
|
+
module.exports = require("@khanacademy/wonder-blocks-typography");
|
|
158
|
+
|
|
159
|
+
/***/ }),
|
|
160
|
+
/* 9 */
|
|
138
161
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
139
162
|
|
|
140
163
|
"use strict";
|
|
141
164
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Button; });
|
|
142
|
-
/* harmony import */ var
|
|
143
|
-
/* harmony import */ var
|
|
144
|
-
/* harmony import */ var
|
|
145
|
-
/* harmony import */ var
|
|
146
|
-
/* harmony import */ var
|
|
147
|
-
/* harmony import */ var
|
|
148
|
-
/* harmony import */ var
|
|
149
|
-
|
|
165
|
+
/* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
|
|
166
|
+
/* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__);
|
|
167
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(0);
|
|
168
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
|
|
169
|
+
/* harmony import */ var react_router__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4);
|
|
170
|
+
/* harmony import */ var react_router__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_router__WEBPACK_IMPORTED_MODULE_2__);
|
|
171
|
+
/* harmony import */ var _khanacademy_wonder_blocks_clickable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(5);
|
|
172
|
+
/* harmony import */ var _khanacademy_wonder_blocks_clickable__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_khanacademy_wonder_blocks_clickable__WEBPACK_IMPORTED_MODULE_3__);
|
|
173
|
+
/* harmony import */ var _button_core_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(10);
|
|
150
174
|
|
|
151
175
|
|
|
152
176
|
|
|
@@ -173,7 +197,7 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
|
173
197
|
* </Button>
|
|
174
198
|
* ```
|
|
175
199
|
*/
|
|
176
|
-
class Button extends
|
|
200
|
+
class Button extends react__WEBPACK_IMPORTED_MODULE_1__["Component"] {
|
|
177
201
|
renderClickableBehavior(router) {
|
|
178
202
|
const {
|
|
179
203
|
href = undefined,
|
|
@@ -190,13 +214,13 @@ class Button extends react__WEBPACK_IMPORTED_MODULE_0__["Component"] {
|
|
|
190
214
|
rel,
|
|
191
215
|
...sharedButtonCoreProps
|
|
192
216
|
} = this.props;
|
|
193
|
-
const ClickableBehavior = Object(
|
|
217
|
+
const ClickableBehavior = Object(_khanacademy_wonder_blocks_clickable__WEBPACK_IMPORTED_MODULE_3__["getClickableBehavior"])(href, skipClientNav, router);
|
|
194
218
|
|
|
195
219
|
const renderProp = (state, {
|
|
196
220
|
tabIndex: clickableTabIndex,
|
|
197
221
|
...restChildProps
|
|
198
222
|
}) => {
|
|
199
|
-
return /*#__PURE__*/
|
|
223
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_button_core_js__WEBPACK_IMPORTED_MODULE_4__[/* default */ "a"], _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, sharedButtonCoreProps, state, restChildProps, {
|
|
200
224
|
disabled: disabled,
|
|
201
225
|
spinner: spinner || state.waiting,
|
|
202
226
|
skipClientNav: skipClientNav,
|
|
@@ -211,7 +235,7 @@ class Button extends react__WEBPACK_IMPORTED_MODULE_0__["Component"] {
|
|
|
211
235
|
};
|
|
212
236
|
|
|
213
237
|
if (beforeNav) {
|
|
214
|
-
return /*#__PURE__*/
|
|
238
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__["createElement"](ClickableBehavior, {
|
|
215
239
|
disabled: spinner || disabled,
|
|
216
240
|
href: href,
|
|
217
241
|
role: "button",
|
|
@@ -222,7 +246,7 @@ class Button extends react__WEBPACK_IMPORTED_MODULE_0__["Component"] {
|
|
|
222
246
|
rel: rel
|
|
223
247
|
}, renderProp);
|
|
224
248
|
} else {
|
|
225
|
-
return /*#__PURE__*/
|
|
249
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__["createElement"](ClickableBehavior, {
|
|
226
250
|
disabled: spinner || disabled,
|
|
227
251
|
href: href,
|
|
228
252
|
role: "button",
|
|
@@ -236,7 +260,7 @@ class Button extends react__WEBPACK_IMPORTED_MODULE_0__["Component"] {
|
|
|
236
260
|
}
|
|
237
261
|
|
|
238
262
|
render() {
|
|
239
|
-
return /*#__PURE__*/
|
|
263
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__["createElement"](react_router__WEBPACK_IMPORTED_MODULE_2__["__RouterContext"].Consumer, null, router => this.renderClickableBehavior(router));
|
|
240
264
|
}
|
|
241
265
|
|
|
242
266
|
}
|
|
@@ -250,34 +274,35 @@ Button.defaultProps = {
|
|
|
250
274
|
};
|
|
251
275
|
|
|
252
276
|
/***/ }),
|
|
253
|
-
/*
|
|
277
|
+
/* 10 */
|
|
254
278
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
255
279
|
|
|
256
280
|
"use strict";
|
|
257
281
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ButtonCore; });
|
|
258
|
-
/* harmony import */ var
|
|
259
|
-
/* harmony import */ var
|
|
260
|
-
/* harmony import */ var
|
|
261
|
-
/* harmony import */ var
|
|
262
|
-
/* harmony import */ var
|
|
263
|
-
/* harmony import */ var
|
|
264
|
-
/* harmony import */ var
|
|
265
|
-
/* harmony import */ var
|
|
266
|
-
/* harmony import */ var
|
|
267
|
-
/* harmony import */ var
|
|
268
|
-
/* harmony import */ var
|
|
269
|
-
/* harmony import */ var
|
|
270
|
-
/* harmony import */ var
|
|
271
|
-
/* harmony import */ var
|
|
272
|
-
/* harmony import */ var
|
|
273
|
-
/* harmony import */ var
|
|
274
|
-
/* harmony import */ var
|
|
275
|
-
/* harmony import */ var
|
|
276
|
-
/* harmony import */ var
|
|
277
|
-
/* harmony import */ var
|
|
278
|
-
/* harmony import */ var
|
|
279
|
-
/* harmony import */ var
|
|
280
|
-
|
|
282
|
+
/* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
|
|
283
|
+
/* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__);
|
|
284
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(0);
|
|
285
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
|
|
286
|
+
/* harmony import */ var aphrodite__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7);
|
|
287
|
+
/* harmony import */ var aphrodite__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(aphrodite__WEBPACK_IMPORTED_MODULE_2__);
|
|
288
|
+
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(11);
|
|
289
|
+
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_router_dom__WEBPACK_IMPORTED_MODULE_3__);
|
|
290
|
+
/* harmony import */ var react_router__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(4);
|
|
291
|
+
/* harmony import */ var react_router__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_router__WEBPACK_IMPORTED_MODULE_4__);
|
|
292
|
+
/* harmony import */ var _khanacademy_wonder_blocks_typography__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(8);
|
|
293
|
+
/* harmony import */ var _khanacademy_wonder_blocks_typography__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_khanacademy_wonder_blocks_typography__WEBPACK_IMPORTED_MODULE_5__);
|
|
294
|
+
/* harmony import */ var _khanacademy_wonder_blocks_color__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(1);
|
|
295
|
+
/* harmony import */ var _khanacademy_wonder_blocks_color__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_khanacademy_wonder_blocks_color__WEBPACK_IMPORTED_MODULE_6__);
|
|
296
|
+
/* harmony import */ var _khanacademy_wonder_blocks_core__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(6);
|
|
297
|
+
/* harmony import */ var _khanacademy_wonder_blocks_core__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_khanacademy_wonder_blocks_core__WEBPACK_IMPORTED_MODULE_7__);
|
|
298
|
+
/* harmony import */ var _khanacademy_wonder_blocks_progress_spinner__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(12);
|
|
299
|
+
/* harmony import */ var _khanacademy_wonder_blocks_progress_spinner__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_khanacademy_wonder_blocks_progress_spinner__WEBPACK_IMPORTED_MODULE_8__);
|
|
300
|
+
/* harmony import */ var _khanacademy_wonder_blocks_icon__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(13);
|
|
301
|
+
/* harmony import */ var _khanacademy_wonder_blocks_icon__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_khanacademy_wonder_blocks_icon__WEBPACK_IMPORTED_MODULE_9__);
|
|
302
|
+
/* harmony import */ var _khanacademy_wonder_blocks_spacing__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(3);
|
|
303
|
+
/* harmony import */ var _khanacademy_wonder_blocks_spacing__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_khanacademy_wonder_blocks_spacing__WEBPACK_IMPORTED_MODULE_10__);
|
|
304
|
+
/* harmony import */ var _khanacademy_wonder_blocks_clickable__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(5);
|
|
305
|
+
/* harmony import */ var _khanacademy_wonder_blocks_clickable__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_khanacademy_wonder_blocks_clickable__WEBPACK_IMPORTED_MODULE_11__);
|
|
281
306
|
|
|
282
307
|
|
|
283
308
|
|
|
@@ -290,10 +315,10 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
|
290
315
|
|
|
291
316
|
|
|
292
317
|
|
|
293
|
-
const StyledAnchor = Object(
|
|
294
|
-
const StyledButton = Object(
|
|
295
|
-
const StyledLink = Object(
|
|
296
|
-
class ButtonCore extends
|
|
318
|
+
const StyledAnchor = Object(_khanacademy_wonder_blocks_core__WEBPACK_IMPORTED_MODULE_7__["addStyle"])("a");
|
|
319
|
+
const StyledButton = Object(_khanacademy_wonder_blocks_core__WEBPACK_IMPORTED_MODULE_7__["addStyle"])("button");
|
|
320
|
+
const StyledLink = Object(_khanacademy_wonder_blocks_core__WEBPACK_IMPORTED_MODULE_7__["addStyle"])(react_router_dom__WEBPACK_IMPORTED_MODULE_3__["Link"]);
|
|
321
|
+
class ButtonCore extends react__WEBPACK_IMPORTED_MODULE_1__["Component"] {
|
|
297
322
|
renderInner(router) {
|
|
298
323
|
const {
|
|
299
324
|
children,
|
|
@@ -316,7 +341,7 @@ class ButtonCore extends react__WEBPACK_IMPORTED_MODULE_0__["Component"] {
|
|
|
316
341
|
waiting: _,
|
|
317
342
|
...restProps
|
|
318
343
|
} = this.props;
|
|
319
|
-
const buttonColor = color === "destructive" ?
|
|
344
|
+
const buttonColor = color === "destructive" ? _khanacademy_wonder_blocks_color__WEBPACK_IMPORTED_MODULE_6__["SemanticColor"].controlDestructive : _khanacademy_wonder_blocks_color__WEBPACK_IMPORTED_MODULE_6__["SemanticColor"].controlDefault;
|
|
320
345
|
const iconWidth = icon ? (size === "small" ? 16 : 24) + 8 : 0;
|
|
321
346
|
|
|
322
347
|
const buttonStyles = _generateStyles(buttonColor, kind, light, iconWidth, size);
|
|
@@ -331,20 +356,20 @@ class ButtonCore extends react__WEBPACK_IMPORTED_MODULE_0__["Component"] {
|
|
|
331
356
|
style: [defaultStyle, style],
|
|
332
357
|
...restProps
|
|
333
358
|
};
|
|
334
|
-
const Label = size === "small" ?
|
|
359
|
+
const Label = size === "small" ? _khanacademy_wonder_blocks_typography__WEBPACK_IMPORTED_MODULE_5__["LabelSmall"] : _khanacademy_wonder_blocks_typography__WEBPACK_IMPORTED_MODULE_5__["LabelLarge"]; // We have to use `medium` for both md and lg buttons so we can fit the
|
|
335
360
|
// icons in large buttons.
|
|
336
361
|
|
|
337
362
|
const iconSize = size === "small" ? "small" : "medium";
|
|
338
|
-
const label = /*#__PURE__*/
|
|
363
|
+
const label = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__["createElement"](Label, {
|
|
339
364
|
style: [sharedStyles.text, size === "large" && sharedStyles.largeText, icon && sharedStyles.textWithIcon, spinner && sharedStyles.hiddenText, kind === "tertiary" && sharedStyles.textWithFocus, // apply focus effect on the label instead
|
|
340
365
|
kind === "tertiary" && !disabled && (pressed ? buttonStyles.active : (hovered || focused) && buttonStyles.focus)]
|
|
341
|
-
}, icon && /*#__PURE__*/
|
|
366
|
+
}, icon && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_khanacademy_wonder_blocks_icon__WEBPACK_IMPORTED_MODULE_9___default.a, {
|
|
342
367
|
size: iconSize,
|
|
343
368
|
color: "currentColor",
|
|
344
369
|
icon: icon,
|
|
345
370
|
style: sharedStyles.icon
|
|
346
371
|
}), children);
|
|
347
|
-
const contents = /*#__PURE__*/
|
|
372
|
+
const contents = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__["createElement"](react__WEBPACK_IMPORTED_MODULE_1__["Fragment"], null, label, spinner && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_khanacademy_wonder_blocks_progress_spinner__WEBPACK_IMPORTED_MODULE_8__["CircularSpinner"], {
|
|
348
373
|
style: sharedStyles.spinner,
|
|
349
374
|
size: {
|
|
350
375
|
medium: "small",
|
|
@@ -356,13 +381,13 @@ class ButtonCore extends react__WEBPACK_IMPORTED_MODULE_0__["Component"] {
|
|
|
356
381
|
}));
|
|
357
382
|
|
|
358
383
|
if (href && !disabled) {
|
|
359
|
-
return router && !skipClientNav && Object(
|
|
384
|
+
return router && !skipClientNav && Object(_khanacademy_wonder_blocks_clickable__WEBPACK_IMPORTED_MODULE_11__["isClientSideUrl"])(href) ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__["createElement"](StyledLink, _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, commonProps, {
|
|
360
385
|
to: href
|
|
361
|
-
}), contents) : /*#__PURE__*/
|
|
386
|
+
}), contents) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__["createElement"](StyledAnchor, _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, commonProps, {
|
|
362
387
|
href: href
|
|
363
388
|
}), contents);
|
|
364
389
|
} else {
|
|
365
|
-
return /*#__PURE__*/
|
|
390
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__["createElement"](StyledButton, _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({
|
|
366
391
|
type: type || "button"
|
|
367
392
|
}, commonProps, {
|
|
368
393
|
"aria-disabled": disabled
|
|
@@ -371,11 +396,11 @@ class ButtonCore extends react__WEBPACK_IMPORTED_MODULE_0__["Component"] {
|
|
|
371
396
|
}
|
|
372
397
|
|
|
373
398
|
render() {
|
|
374
|
-
return /*#__PURE__*/
|
|
399
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__["createElement"](react_router__WEBPACK_IMPORTED_MODULE_4__["__RouterContext"].Consumer, null, router => this.renderInner(router));
|
|
375
400
|
}
|
|
376
401
|
|
|
377
402
|
}
|
|
378
|
-
const sharedStyles =
|
|
403
|
+
const sharedStyles = aphrodite__WEBPACK_IMPORTED_MODULE_2__["StyleSheet"].create({
|
|
379
404
|
shared: {
|
|
380
405
|
position: "relative",
|
|
381
406
|
display: "inline-flex",
|
|
@@ -412,7 +437,7 @@ const sharedStyles = aphrodite__WEBPACK_IMPORTED_MODULE_1__["StyleSheet"].create
|
|
|
412
437
|
height: 32
|
|
413
438
|
},
|
|
414
439
|
large: {
|
|
415
|
-
borderRadius:
|
|
440
|
+
borderRadius: _khanacademy_wonder_blocks_spacing__WEBPACK_IMPORTED_MODULE_10___default.a.xxSmall_6,
|
|
416
441
|
height: 56
|
|
417
442
|
},
|
|
418
443
|
text: {
|
|
@@ -445,7 +470,7 @@ const sharedStyles = aphrodite__WEBPACK_IMPORTED_MODULE_1__["StyleSheet"].create
|
|
|
445
470
|
position: "absolute"
|
|
446
471
|
},
|
|
447
472
|
icon: {
|
|
448
|
-
paddingRight:
|
|
473
|
+
paddingRight: _khanacademy_wonder_blocks_spacing__WEBPACK_IMPORTED_MODULE_10___default.a.xSmall_8
|
|
449
474
|
}
|
|
450
475
|
});
|
|
451
476
|
const styles = {};
|
|
@@ -464,10 +489,10 @@ const _generateStyles = (color, kind, light, iconWidth, size) => {
|
|
|
464
489
|
offBlack32,
|
|
465
490
|
offBlack50,
|
|
466
491
|
darkBlue
|
|
467
|
-
} =
|
|
468
|
-
const fadedColor = Object(
|
|
469
|
-
const activeColor = Object(
|
|
470
|
-
const padding = size === "large" ?
|
|
492
|
+
} = _khanacademy_wonder_blocks_color__WEBPACK_IMPORTED_MODULE_6___default.a;
|
|
493
|
+
const fadedColor = Object(_khanacademy_wonder_blocks_color__WEBPACK_IMPORTED_MODULE_6__["mix"])(Object(_khanacademy_wonder_blocks_color__WEBPACK_IMPORTED_MODULE_6__["fade"])(color, 0.32), white);
|
|
494
|
+
const activeColor = Object(_khanacademy_wonder_blocks_color__WEBPACK_IMPORTED_MODULE_6__["mix"])(offBlack32, color);
|
|
495
|
+
const padding = size === "large" ? _khanacademy_wonder_blocks_spacing__WEBPACK_IMPORTED_MODULE_10___default.a.xLarge_32 : _khanacademy_wonder_blocks_spacing__WEBPACK_IMPORTED_MODULE_10___default.a.medium_16;
|
|
471
496
|
let newStyles = {};
|
|
472
497
|
|
|
473
498
|
if (kind === "primary") {
|
|
@@ -590,35 +615,35 @@ const _generateStyles = (color, kind, light, iconWidth, size) => {
|
|
|
590
615
|
throw new Error("Button kind not recognized");
|
|
591
616
|
}
|
|
592
617
|
|
|
593
|
-
styles[buttonType] =
|
|
618
|
+
styles[buttonType] = aphrodite__WEBPACK_IMPORTED_MODULE_2__["StyleSheet"].create(newStyles);
|
|
594
619
|
return styles[buttonType];
|
|
595
620
|
};
|
|
596
621
|
|
|
597
622
|
/***/ }),
|
|
598
|
-
/*
|
|
623
|
+
/* 11 */
|
|
599
624
|
/***/ (function(module, exports) {
|
|
600
625
|
|
|
601
626
|
module.exports = require("react-router-dom");
|
|
602
627
|
|
|
603
628
|
/***/ }),
|
|
604
|
-
/*
|
|
629
|
+
/* 12 */
|
|
605
630
|
/***/ (function(module, exports) {
|
|
606
631
|
|
|
607
632
|
module.exports = require("@khanacademy/wonder-blocks-progress-spinner");
|
|
608
633
|
|
|
609
634
|
/***/ }),
|
|
610
|
-
/*
|
|
635
|
+
/* 13 */
|
|
611
636
|
/***/ (function(module, exports) {
|
|
612
637
|
|
|
613
638
|
module.exports = require("@khanacademy/wonder-blocks-icon");
|
|
614
639
|
|
|
615
640
|
/***/ }),
|
|
616
|
-
/*
|
|
641
|
+
/* 14 */
|
|
617
642
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
618
643
|
|
|
619
644
|
"use strict";
|
|
620
645
|
__webpack_require__.r(__webpack_exports__);
|
|
621
|
-
/* harmony import */ var _components_button_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(
|
|
646
|
+
/* harmony import */ var _components_button_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9);
|
|
622
647
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _components_button_js__WEBPACK_IMPORTED_MODULE_0__["a"]; });
|
|
623
648
|
|
|
624
649
|
|
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.3",
|
|
4
4
|
"design": "v1",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -16,13 +16,13 @@
|
|
|
16
16
|
"license": "MIT",
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@babel/runtime": "^7.18.6",
|
|
19
|
-
"@khanacademy/wonder-blocks-clickable": "^2.3.
|
|
20
|
-
"@khanacademy/wonder-blocks-color": "^1.
|
|
21
|
-
"@khanacademy/wonder-blocks-core": "^4.
|
|
22
|
-
"@khanacademy/wonder-blocks-icon": "^1.2.
|
|
23
|
-
"@khanacademy/wonder-blocks-progress-spinner": "^1.1.
|
|
19
|
+
"@khanacademy/wonder-blocks-clickable": "^2.3.1",
|
|
20
|
+
"@khanacademy/wonder-blocks-color": "^1.2.0",
|
|
21
|
+
"@khanacademy/wonder-blocks-core": "^4.4.0",
|
|
22
|
+
"@khanacademy/wonder-blocks-icon": "^1.2.30",
|
|
23
|
+
"@khanacademy/wonder-blocks-progress-spinner": "^1.1.35",
|
|
24
24
|
"@khanacademy/wonder-blocks-spacing": "^3.0.5",
|
|
25
|
-
"@khanacademy/wonder-blocks-typography": "^1.1.
|
|
25
|
+
"@khanacademy/wonder-blocks-typography": "^1.1.33"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"aphrodite": "^1.2.5",
|