@khanacademy/wonder-blocks-clickable 3.0.5 → 3.0.6

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,13 @@
1
1
  # @khanacademy/wonder-blocks-clickable
2
2
 
3
+ ## 3.0.6
4
+
5
+ ### Patch Changes
6
+
7
+ - c20f48f3: Don't transpile classes when building bundles
8
+ - Updated dependencies [c20f48f3]
9
+ - @khanacademy/wonder-blocks-core@5.0.4
10
+
3
11
  ## 3.0.5
4
12
 
5
13
  ## 3.0.4
package/dist/es/index.js CHANGED
@@ -33,20 +33,6 @@ function _extends() {
33
33
  return _extends.apply(this, arguments);
34
34
  }
35
35
 
36
- function _setPrototypeOf(o, p) {
37
- _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
38
- o.__proto__ = p;
39
- return o;
40
- };
41
- return _setPrototypeOf(o, p);
42
- }
43
-
44
- function _inheritsLoose(subClass, superClass) {
45
- subClass.prototype = Object.create(superClass.prototype);
46
- subClass.prototype.constructor = subClass;
47
- _setPrototypeOf(subClass, superClass);
48
- }
49
-
50
36
  const getAppropriateTriggersForRole = role => {
51
37
  switch (role) {
52
38
  case "link":
@@ -94,9 +80,8 @@ const startState = {
94
80
  pressed: false,
95
81
  waiting: false
96
82
  };
97
- let ClickableBehavior = function (_React$Component) {
98
- _inheritsLoose(ClickableBehavior, _React$Component);
99
- ClickableBehavior.getDerivedStateFromProps = function getDerivedStateFromProps(props, state) {
83
+ class ClickableBehavior extends React.Component {
84
+ static getDerivedStateFromProps(props, state) {
100
85
  if (props.disabled) {
101
86
  return _extends({}, startState, {
102
87
  focused: state.focused
@@ -104,75 +89,74 @@ let ClickableBehavior = function (_React$Component) {
104
89
  } else {
105
90
  return null;
106
91
  }
107
- };
108
- function ClickableBehavior(props) {
109
- var _this;
110
- _this = _React$Component.call(this, props) || this;
111
- _this.waitingForClick = void 0;
112
- _this.enterClick = void 0;
113
- _this.handleClick = e => {
92
+ }
93
+ constructor(props) {
94
+ super(props);
95
+ this.waitingForClick = void 0;
96
+ this.enterClick = void 0;
97
+ this.handleClick = e => {
114
98
  const {
115
99
  onClick = undefined,
116
100
  beforeNav = undefined,
117
101
  safeWithNav = undefined
118
- } = _this.props;
119
- if (_this.enterClick) {
102
+ } = this.props;
103
+ if (this.enterClick) {
120
104
  return;
121
105
  }
122
106
  if (onClick || beforeNav || safeWithNav) {
123
- _this.waitingForClick = false;
107
+ this.waitingForClick = false;
124
108
  }
125
- _this.runCallbackAndMaybeNavigate(e);
109
+ this.runCallbackAndMaybeNavigate(e);
126
110
  };
127
- _this.handleMouseEnter = e => {
128
- if (!_this.waitingForClick) {
129
- _this.setState({
111
+ this.handleMouseEnter = e => {
112
+ if (!this.waitingForClick) {
113
+ this.setState({
130
114
  hovered: true
131
115
  });
132
116
  }
133
117
  };
134
- _this.handleMouseLeave = () => {
135
- if (!_this.waitingForClick) {
136
- _this.setState({
118
+ this.handleMouseLeave = () => {
119
+ if (!this.waitingForClick) {
120
+ this.setState({
137
121
  hovered: false,
138
122
  pressed: false,
139
123
  focused: false
140
124
  });
141
125
  }
142
126
  };
143
- _this.handleMouseDown = () => {
144
- _this.setState({
127
+ this.handleMouseDown = () => {
128
+ this.setState({
145
129
  pressed: true
146
130
  });
147
131
  };
148
- _this.handleMouseUp = e => {
149
- _this.setState({
132
+ this.handleMouseUp = e => {
133
+ this.setState({
150
134
  pressed: false,
151
135
  focused: false
152
136
  });
153
137
  };
154
- _this.handleTouchStart = () => {
155
- _this.setState({
138
+ this.handleTouchStart = () => {
139
+ this.setState({
156
140
  pressed: true
157
141
  });
158
142
  };
159
- _this.handleTouchEnd = () => {
160
- _this.setState({
143
+ this.handleTouchEnd = () => {
144
+ this.setState({
161
145
  pressed: false
162
146
  });
163
- _this.waitingForClick = true;
147
+ this.waitingForClick = true;
164
148
  };
165
- _this.handleTouchCancel = () => {
166
- _this.setState({
149
+ this.handleTouchCancel = () => {
150
+ this.setState({
167
151
  pressed: false
168
152
  });
169
- _this.waitingForClick = true;
153
+ this.waitingForClick = true;
170
154
  };
171
- _this.handleKeyDown = e => {
155
+ this.handleKeyDown = e => {
172
156
  const {
173
157
  onKeyDown,
174
158
  role
175
- } = _this.props;
159
+ } = this.props;
176
160
  if (onKeyDown) {
177
161
  onKeyDown(e);
178
162
  }
@@ -183,18 +167,18 @@ let ClickableBehavior = function (_React$Component) {
183
167
  } = getAppropriateTriggersForRole(role);
184
168
  if (triggerOnEnter && keyCode === keyCodes.enter || triggerOnSpace && keyCode === keyCodes.space) {
185
169
  e.preventDefault();
186
- _this.setState({
170
+ this.setState({
187
171
  pressed: true
188
172
  });
189
173
  } else if (!triggerOnEnter && keyCode === keyCodes.enter) {
190
- _this.enterClick = true;
174
+ this.enterClick = true;
191
175
  }
192
176
  };
193
- _this.handleKeyUp = e => {
177
+ this.handleKeyUp = e => {
194
178
  const {
195
179
  onKeyUp,
196
180
  role
197
- } = _this.props;
181
+ } = this.props;
198
182
  if (onKeyUp) {
199
183
  onKeyUp(e);
200
184
  }
@@ -204,33 +188,31 @@ let ClickableBehavior = function (_React$Component) {
204
188
  triggerOnSpace
205
189
  } = getAppropriateTriggersForRole(role);
206
190
  if (triggerOnEnter && keyCode === keyCodes.enter || triggerOnSpace && keyCode === keyCodes.space) {
207
- _this.setState({
191
+ this.setState({
208
192
  pressed: false,
209
193
  focused: true
210
194
  });
211
- _this.runCallbackAndMaybeNavigate(e);
195
+ this.runCallbackAndMaybeNavigate(e);
212
196
  } else if (!triggerOnEnter && keyCode === keyCodes.enter) {
213
- _this.enterClick = false;
197
+ this.enterClick = false;
214
198
  }
215
199
  };
216
- _this.handleFocus = e => {
217
- _this.setState({
200
+ this.handleFocus = e => {
201
+ this.setState({
218
202
  focused: true
219
203
  });
220
204
  };
221
- _this.handleBlur = e => {
222
- _this.setState({
205
+ this.handleBlur = e => {
206
+ this.setState({
223
207
  focused: false,
224
208
  pressed: false
225
209
  });
226
210
  };
227
- _this.state = startState;
228
- _this.waitingForClick = false;
229
- _this.enterClick = false;
230
- return _this;
211
+ this.state = startState;
212
+ this.waitingForClick = false;
213
+ this.enterClick = false;
231
214
  }
232
- var _proto = ClickableBehavior.prototype;
233
- _proto.navigateOrReset = function navigateOrReset(shouldNavigate) {
215
+ navigateOrReset(shouldNavigate) {
234
216
  if (shouldNavigate) {
235
217
  const {
236
218
  history,
@@ -258,8 +240,8 @@ let ClickableBehavior = function (_React$Component) {
258
240
  waiting: false
259
241
  });
260
242
  }
261
- };
262
- _proto.handleSafeWithNav = function handleSafeWithNav(safeWithNav, shouldNavigate) {
243
+ }
244
+ handleSafeWithNav(safeWithNav, shouldNavigate) {
263
245
  const {
264
246
  skipClientNav,
265
247
  history
@@ -285,8 +267,8 @@ let ClickableBehavior = function (_React$Component) {
285
267
  this.navigateOrReset(shouldNavigate);
286
268
  });
287
269
  }
288
- };
289
- _proto.runCallbackAndMaybeNavigate = function runCallbackAndMaybeNavigate(e) {
270
+ }
271
+ runCallbackAndMaybeNavigate(e) {
290
272
  const {
291
273
  onClick = undefined,
292
274
  beforeNav = undefined,
@@ -333,8 +315,8 @@ let ClickableBehavior = function (_React$Component) {
333
315
  } else {
334
316
  this.navigateOrReset(shouldNavigate);
335
317
  }
336
- };
337
- _proto.render = function render() {
318
+ }
319
+ render() {
338
320
  const childrenProps = this.props.disabled ? _extends({}, disabledHandlers, {
339
321
  onFocus: this.handleFocus,
340
322
  onBlur: this.handleBlur,
@@ -359,9 +341,8 @@ let ClickableBehavior = function (_React$Component) {
359
341
  children
360
342
  } = this.props;
361
343
  return children && children(this.state, childrenProps);
362
- };
363
- return ClickableBehavior;
364
- }(React.Component);
344
+ }
345
+ }
365
346
  ClickableBehavior.defaultProps = {
366
347
  disabled: false
367
348
  };
@@ -385,39 +366,35 @@ const _excluded = ["href", "onClick", "skipClientNav", "beforeNav", "safeWithNav
385
366
  const StyledAnchor = addStyle("a");
386
367
  const StyledButton = addStyle("button");
387
368
  const StyledLink = addStyle(Link);
388
- let Clickable = function (_React$Component) {
389
- _inheritsLoose(Clickable, _React$Component);
390
- function Clickable(...args) {
391
- var _this;
392
- _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
393
- _this.getCorrectTag = (clickableState, router, commonProps) => {
394
- const activeHref = _this.props.href && !_this.props.disabled;
395
- const useClient = router && !_this.props.skipClientNav && isClientSideUrl(_this.props.href || "");
396
- if (activeHref && useClient && _this.props.href) {
369
+ class Clickable extends React.Component {
370
+ constructor(...args) {
371
+ super(...args);
372
+ this.getCorrectTag = (clickableState, router, commonProps) => {
373
+ const activeHref = this.props.href && !this.props.disabled;
374
+ const useClient = router && !this.props.skipClientNav && isClientSideUrl(this.props.href || "");
375
+ if (activeHref && useClient && this.props.href) {
397
376
  return React.createElement(StyledLink, _extends({}, commonProps, {
398
- to: _this.props.href,
399
- role: _this.props.role,
400
- target: _this.props.target || undefined,
401
- "aria-disabled": _this.props.disabled ? "true" : undefined
402
- }), _this.props.children(clickableState));
377
+ to: this.props.href,
378
+ role: this.props.role,
379
+ target: this.props.target || undefined,
380
+ "aria-disabled": this.props.disabled ? "true" : undefined
381
+ }), this.props.children(clickableState));
403
382
  } else if (activeHref && !useClient) {
404
383
  return React.createElement(StyledAnchor, _extends({}, commonProps, {
405
- href: _this.props.href,
406
- role: _this.props.role,
407
- target: _this.props.target || undefined,
408
- "aria-disabled": _this.props.disabled ? "true" : undefined
409
- }), _this.props.children(clickableState));
384
+ href: this.props.href,
385
+ role: this.props.role,
386
+ target: this.props.target || undefined,
387
+ "aria-disabled": this.props.disabled ? "true" : undefined
388
+ }), this.props.children(clickableState));
410
389
  } else {
411
390
  return React.createElement(StyledButton, _extends({}, commonProps, {
412
391
  type: "button",
413
- "aria-disabled": _this.props.disabled
414
- }), _this.props.children(clickableState));
392
+ "aria-disabled": this.props.disabled
393
+ }), this.props.children(clickableState));
415
394
  }
416
395
  };
417
- return _this;
418
396
  }
419
- var _proto = Clickable.prototype;
420
- _proto.renderClickableBehavior = function renderClickableBehavior(router) {
397
+ renderClickableBehavior(router) {
421
398
  const _this$props = this.props,
422
399
  {
423
400
  href,
@@ -464,12 +441,11 @@ let Clickable = function (_React$Component) {
464
441
  style: getStyle(state)
465
442
  }, childrenProps)));
466
443
  }
467
- };
468
- _proto.render = function render() {
444
+ }
445
+ render() {
469
446
  return React.createElement(__RouterContext.Consumer, null, router => this.renderClickableBehavior(router));
470
- };
471
- return Clickable;
472
- }(React.Component);
447
+ }
448
+ }
473
449
  Clickable.defaultProps = {
474
450
  light: false,
475
451
  disabled: false
package/dist/index.js CHANGED
@@ -60,20 +60,6 @@ function _extends() {
60
60
  return _extends.apply(this, arguments);
61
61
  }
62
62
 
63
- function _setPrototypeOf(o, p) {
64
- _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
65
- o.__proto__ = p;
66
- return o;
67
- };
68
- return _setPrototypeOf(o, p);
69
- }
70
-
71
- function _inheritsLoose(subClass, superClass) {
72
- subClass.prototype = Object.create(superClass.prototype);
73
- subClass.prototype.constructor = subClass;
74
- _setPrototypeOf(subClass, superClass);
75
- }
76
-
77
63
  const getAppropriateTriggersForRole = role => {
78
64
  switch (role) {
79
65
  case "link":
@@ -121,9 +107,8 @@ const startState = {
121
107
  pressed: false,
122
108
  waiting: false
123
109
  };
124
- let ClickableBehavior = function (_React$Component) {
125
- _inheritsLoose(ClickableBehavior, _React$Component);
126
- ClickableBehavior.getDerivedStateFromProps = function getDerivedStateFromProps(props, state) {
110
+ class ClickableBehavior extends React__namespace.Component {
111
+ static getDerivedStateFromProps(props, state) {
127
112
  if (props.disabled) {
128
113
  return _extends({}, startState, {
129
114
  focused: state.focused
@@ -131,75 +116,74 @@ let ClickableBehavior = function (_React$Component) {
131
116
  } else {
132
117
  return null;
133
118
  }
134
- };
135
- function ClickableBehavior(props) {
136
- var _this;
137
- _this = _React$Component.call(this, props) || this;
138
- _this.waitingForClick = void 0;
139
- _this.enterClick = void 0;
140
- _this.handleClick = e => {
119
+ }
120
+ constructor(props) {
121
+ super(props);
122
+ this.waitingForClick = void 0;
123
+ this.enterClick = void 0;
124
+ this.handleClick = e => {
141
125
  const {
142
126
  onClick = undefined,
143
127
  beforeNav = undefined,
144
128
  safeWithNav = undefined
145
- } = _this.props;
146
- if (_this.enterClick) {
129
+ } = this.props;
130
+ if (this.enterClick) {
147
131
  return;
148
132
  }
149
133
  if (onClick || beforeNav || safeWithNav) {
150
- _this.waitingForClick = false;
134
+ this.waitingForClick = false;
151
135
  }
152
- _this.runCallbackAndMaybeNavigate(e);
136
+ this.runCallbackAndMaybeNavigate(e);
153
137
  };
154
- _this.handleMouseEnter = e => {
155
- if (!_this.waitingForClick) {
156
- _this.setState({
138
+ this.handleMouseEnter = e => {
139
+ if (!this.waitingForClick) {
140
+ this.setState({
157
141
  hovered: true
158
142
  });
159
143
  }
160
144
  };
161
- _this.handleMouseLeave = () => {
162
- if (!_this.waitingForClick) {
163
- _this.setState({
145
+ this.handleMouseLeave = () => {
146
+ if (!this.waitingForClick) {
147
+ this.setState({
164
148
  hovered: false,
165
149
  pressed: false,
166
150
  focused: false
167
151
  });
168
152
  }
169
153
  };
170
- _this.handleMouseDown = () => {
171
- _this.setState({
154
+ this.handleMouseDown = () => {
155
+ this.setState({
172
156
  pressed: true
173
157
  });
174
158
  };
175
- _this.handleMouseUp = e => {
176
- _this.setState({
159
+ this.handleMouseUp = e => {
160
+ this.setState({
177
161
  pressed: false,
178
162
  focused: false
179
163
  });
180
164
  };
181
- _this.handleTouchStart = () => {
182
- _this.setState({
165
+ this.handleTouchStart = () => {
166
+ this.setState({
183
167
  pressed: true
184
168
  });
185
169
  };
186
- _this.handleTouchEnd = () => {
187
- _this.setState({
170
+ this.handleTouchEnd = () => {
171
+ this.setState({
188
172
  pressed: false
189
173
  });
190
- _this.waitingForClick = true;
174
+ this.waitingForClick = true;
191
175
  };
192
- _this.handleTouchCancel = () => {
193
- _this.setState({
176
+ this.handleTouchCancel = () => {
177
+ this.setState({
194
178
  pressed: false
195
179
  });
196
- _this.waitingForClick = true;
180
+ this.waitingForClick = true;
197
181
  };
198
- _this.handleKeyDown = e => {
182
+ this.handleKeyDown = e => {
199
183
  const {
200
184
  onKeyDown,
201
185
  role
202
- } = _this.props;
186
+ } = this.props;
203
187
  if (onKeyDown) {
204
188
  onKeyDown(e);
205
189
  }
@@ -210,18 +194,18 @@ let ClickableBehavior = function (_React$Component) {
210
194
  } = getAppropriateTriggersForRole(role);
211
195
  if (triggerOnEnter && keyCode === keyCodes.enter || triggerOnSpace && keyCode === keyCodes.space) {
212
196
  e.preventDefault();
213
- _this.setState({
197
+ this.setState({
214
198
  pressed: true
215
199
  });
216
200
  } else if (!triggerOnEnter && keyCode === keyCodes.enter) {
217
- _this.enterClick = true;
201
+ this.enterClick = true;
218
202
  }
219
203
  };
220
- _this.handleKeyUp = e => {
204
+ this.handleKeyUp = e => {
221
205
  const {
222
206
  onKeyUp,
223
207
  role
224
- } = _this.props;
208
+ } = this.props;
225
209
  if (onKeyUp) {
226
210
  onKeyUp(e);
227
211
  }
@@ -231,33 +215,31 @@ let ClickableBehavior = function (_React$Component) {
231
215
  triggerOnSpace
232
216
  } = getAppropriateTriggersForRole(role);
233
217
  if (triggerOnEnter && keyCode === keyCodes.enter || triggerOnSpace && keyCode === keyCodes.space) {
234
- _this.setState({
218
+ this.setState({
235
219
  pressed: false,
236
220
  focused: true
237
221
  });
238
- _this.runCallbackAndMaybeNavigate(e);
222
+ this.runCallbackAndMaybeNavigate(e);
239
223
  } else if (!triggerOnEnter && keyCode === keyCodes.enter) {
240
- _this.enterClick = false;
224
+ this.enterClick = false;
241
225
  }
242
226
  };
243
- _this.handleFocus = e => {
244
- _this.setState({
227
+ this.handleFocus = e => {
228
+ this.setState({
245
229
  focused: true
246
230
  });
247
231
  };
248
- _this.handleBlur = e => {
249
- _this.setState({
232
+ this.handleBlur = e => {
233
+ this.setState({
250
234
  focused: false,
251
235
  pressed: false
252
236
  });
253
237
  };
254
- _this.state = startState;
255
- _this.waitingForClick = false;
256
- _this.enterClick = false;
257
- return _this;
238
+ this.state = startState;
239
+ this.waitingForClick = false;
240
+ this.enterClick = false;
258
241
  }
259
- var _proto = ClickableBehavior.prototype;
260
- _proto.navigateOrReset = function navigateOrReset(shouldNavigate) {
242
+ navigateOrReset(shouldNavigate) {
261
243
  if (shouldNavigate) {
262
244
  const {
263
245
  history,
@@ -285,8 +267,8 @@ let ClickableBehavior = function (_React$Component) {
285
267
  waiting: false
286
268
  });
287
269
  }
288
- };
289
- _proto.handleSafeWithNav = function handleSafeWithNav(safeWithNav, shouldNavigate) {
270
+ }
271
+ handleSafeWithNav(safeWithNav, shouldNavigate) {
290
272
  const {
291
273
  skipClientNav,
292
274
  history
@@ -312,8 +294,8 @@ let ClickableBehavior = function (_React$Component) {
312
294
  this.navigateOrReset(shouldNavigate);
313
295
  });
314
296
  }
315
- };
316
- _proto.runCallbackAndMaybeNavigate = function runCallbackAndMaybeNavigate(e) {
297
+ }
298
+ runCallbackAndMaybeNavigate(e) {
317
299
  const {
318
300
  onClick = undefined,
319
301
  beforeNav = undefined,
@@ -360,8 +342,8 @@ let ClickableBehavior = function (_React$Component) {
360
342
  } else {
361
343
  this.navigateOrReset(shouldNavigate);
362
344
  }
363
- };
364
- _proto.render = function render() {
345
+ }
346
+ render() {
365
347
  const childrenProps = this.props.disabled ? _extends({}, disabledHandlers, {
366
348
  onFocus: this.handleFocus,
367
349
  onBlur: this.handleBlur,
@@ -386,9 +368,8 @@ let ClickableBehavior = function (_React$Component) {
386
368
  children
387
369
  } = this.props;
388
370
  return children && children(this.state, childrenProps);
389
- };
390
- return ClickableBehavior;
391
- }(React__namespace.Component);
371
+ }
372
+ }
392
373
  ClickableBehavior.defaultProps = {
393
374
  disabled: false
394
375
  };
@@ -412,39 +393,35 @@ const _excluded = ["href", "onClick", "skipClientNav", "beforeNav", "safeWithNav
412
393
  const StyledAnchor = wonderBlocksCore.addStyle("a");
413
394
  const StyledButton = wonderBlocksCore.addStyle("button");
414
395
  const StyledLink = wonderBlocksCore.addStyle(reactRouterDom.Link);
415
- let Clickable = function (_React$Component) {
416
- _inheritsLoose(Clickable, _React$Component);
417
- function Clickable(...args) {
418
- var _this;
419
- _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
420
- _this.getCorrectTag = (clickableState, router, commonProps) => {
421
- const activeHref = _this.props.href && !_this.props.disabled;
422
- const useClient = router && !_this.props.skipClientNav && isClientSideUrl(_this.props.href || "");
423
- if (activeHref && useClient && _this.props.href) {
396
+ class Clickable extends React__namespace.Component {
397
+ constructor(...args) {
398
+ super(...args);
399
+ this.getCorrectTag = (clickableState, router, commonProps) => {
400
+ const activeHref = this.props.href && !this.props.disabled;
401
+ const useClient = router && !this.props.skipClientNav && isClientSideUrl(this.props.href || "");
402
+ if (activeHref && useClient && this.props.href) {
424
403
  return React__namespace.createElement(StyledLink, _extends({}, commonProps, {
425
- to: _this.props.href,
426
- role: _this.props.role,
427
- target: _this.props.target || undefined,
428
- "aria-disabled": _this.props.disabled ? "true" : undefined
429
- }), _this.props.children(clickableState));
404
+ to: this.props.href,
405
+ role: this.props.role,
406
+ target: this.props.target || undefined,
407
+ "aria-disabled": this.props.disabled ? "true" : undefined
408
+ }), this.props.children(clickableState));
430
409
  } else if (activeHref && !useClient) {
431
410
  return React__namespace.createElement(StyledAnchor, _extends({}, commonProps, {
432
- href: _this.props.href,
433
- role: _this.props.role,
434
- target: _this.props.target || undefined,
435
- "aria-disabled": _this.props.disabled ? "true" : undefined
436
- }), _this.props.children(clickableState));
411
+ href: this.props.href,
412
+ role: this.props.role,
413
+ target: this.props.target || undefined,
414
+ "aria-disabled": this.props.disabled ? "true" : undefined
415
+ }), this.props.children(clickableState));
437
416
  } else {
438
417
  return React__namespace.createElement(StyledButton, _extends({}, commonProps, {
439
418
  type: "button",
440
- "aria-disabled": _this.props.disabled
441
- }), _this.props.children(clickableState));
419
+ "aria-disabled": this.props.disabled
420
+ }), this.props.children(clickableState));
442
421
  }
443
422
  };
444
- return _this;
445
423
  }
446
- var _proto = Clickable.prototype;
447
- _proto.renderClickableBehavior = function renderClickableBehavior(router) {
424
+ renderClickableBehavior(router) {
448
425
  const _this$props = this.props,
449
426
  {
450
427
  href,
@@ -491,12 +468,11 @@ let Clickable = function (_React$Component) {
491
468
  style: getStyle(state)
492
469
  }, childrenProps)));
493
470
  }
494
- };
495
- _proto.render = function render() {
471
+ }
472
+ render() {
496
473
  return React__namespace.createElement(reactRouter.__RouterContext.Consumer, null, router => this.renderClickableBehavior(router));
497
- };
498
- return Clickable;
499
- }(React__namespace.Component);
474
+ }
475
+ }
500
476
  Clickable.defaultProps = {
501
477
  light: false,
502
478
  disabled: false
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@khanacademy/wonder-blocks-clickable",
3
- "version": "3.0.5",
3
+ "version": "3.0.6",
4
4
  "design": "v1",
5
5
  "description": "Clickable component for Wonder-Blocks.",
6
6
  "main": "dist/index.js",
@@ -17,7 +17,7 @@
17
17
  "dependencies": {
18
18
  "@babel/runtime": "^7.18.6",
19
19
  "@khanacademy/wonder-blocks-color": "^2.0.1",
20
- "@khanacademy/wonder-blocks-core": "^5.0.3"
20
+ "@khanacademy/wonder-blocks-core": "^5.0.4"
21
21
  },
22
22
  "peerDependencies": {
23
23
  "aphrodite": "^1.2.5",
@@ -27,6 +27,6 @@
27
27
  "react-router-dom": "5.3.0"
28
28
  },
29
29
  "devDependencies": {
30
- "wb-dev-build-settings": "^0.9.4"
30
+ "wb-dev-build-settings": "^0.9.5"
31
31
  }
32
32
  }