@khanacademy/wonder-blocks-clickable 5.0.7 → 6.1.0
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 +221 -191
- package/LICENSE +21 -0
- package/dist/es/index.js +21 -25
- package/dist/index.js +31 -40
- package/package.json +8 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,364 +1,394 @@
|
|
|
1
1
|
# @khanacademy/wonder-blocks-clickable
|
|
2
2
|
|
|
3
|
+
## 6.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- f03298f: Tooling:
|
|
8
|
+
|
|
9
|
+
- Switching to `pnpm`.
|
|
10
|
+
- Upgrading `rollup` to v4 and `@babel/runtime` to match the current webapp version.
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- 969864b: Update internal addStyle variable name to address aphrodite-add-style-variable-name linting rule
|
|
15
|
+
- bb2a026: pnpm: Switch to workspace protocol to handle dependency versions with changesets on monorepo setup"
|
|
16
|
+
- Updated dependencies [969864b]
|
|
17
|
+
- Updated dependencies [bb2a026]
|
|
18
|
+
- Updated dependencies [f03298f]
|
|
19
|
+
- @khanacademy/wonder-blocks-core@12.1.0
|
|
20
|
+
- @khanacademy/wonder-blocks-tokens@4.2.0
|
|
21
|
+
|
|
22
|
+
## 6.0.0
|
|
23
|
+
|
|
24
|
+
### Major Changes
|
|
25
|
+
|
|
26
|
+
- 0199324d: Fixes keyboard tests in Dropdown and Clickable with specific key events. We now check `event.key` instead of `event.which` or `event.keyCode` to remove deprecated event properties and match the keys returned from Testing Library/userEvent.
|
|
27
|
+
|
|
28
|
+
### Patch Changes
|
|
29
|
+
|
|
30
|
+
- Updated dependencies [0199324d]
|
|
31
|
+
- @khanacademy/wonder-blocks-core@12.0.0
|
|
32
|
+
|
|
3
33
|
## 5.0.7
|
|
4
34
|
|
|
5
35
|
### Patch Changes
|
|
6
36
|
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
37
|
+
- Updated dependencies [8cfaeab0]
|
|
38
|
+
- Updated dependencies [c162abb4]
|
|
39
|
+
- @khanacademy/wonder-blocks-tokens@4.1.0
|
|
10
40
|
|
|
11
41
|
## 5.0.6
|
|
12
42
|
|
|
13
43
|
### Patch Changes
|
|
14
44
|
|
|
15
|
-
-
|
|
16
|
-
-
|
|
45
|
+
- Updated dependencies [0de25cd8]
|
|
46
|
+
- @khanacademy/wonder-blocks-tokens@4.0.0
|
|
17
47
|
|
|
18
48
|
## 5.0.5
|
|
19
49
|
|
|
20
50
|
### Patch Changes
|
|
21
51
|
|
|
22
|
-
-
|
|
23
|
-
-
|
|
52
|
+
- Updated dependencies [7516b239]
|
|
53
|
+
- @khanacademy/wonder-blocks-core@11.1.0
|
|
24
54
|
|
|
25
55
|
## 5.0.4
|
|
26
56
|
|
|
27
57
|
### Patch Changes
|
|
28
58
|
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
-
|
|
32
|
-
-
|
|
59
|
+
- 11a0f5c6: No functional changes. Adding prepublishOnly script.
|
|
60
|
+
- Updated dependencies [11a0f5c6]
|
|
61
|
+
- @khanacademy/wonder-blocks-tokens@3.0.1
|
|
62
|
+
- @khanacademy/wonder-blocks-core@11.0.1
|
|
33
63
|
|
|
34
64
|
## 5.0.3
|
|
35
65
|
|
|
36
66
|
### Patch Changes
|
|
37
67
|
|
|
38
|
-
-
|
|
39
|
-
-
|
|
68
|
+
- Updated dependencies [d23c9c5f]
|
|
69
|
+
- @khanacademy/wonder-blocks-core@11.0.0
|
|
40
70
|
|
|
41
71
|
## 5.0.2
|
|
42
72
|
|
|
43
73
|
### Patch Changes
|
|
44
74
|
|
|
45
|
-
-
|
|
46
|
-
-
|
|
47
|
-
-
|
|
48
|
-
-
|
|
75
|
+
- Updated dependencies [b6009b77]
|
|
76
|
+
- Updated dependencies [897686bc]
|
|
77
|
+
- Updated dependencies [56d961f1]
|
|
78
|
+
- @khanacademy/wonder-blocks-core@10.0.0
|
|
49
79
|
|
|
50
80
|
## 5.0.1
|
|
51
81
|
|
|
52
82
|
### Patch Changes
|
|
53
83
|
|
|
54
|
-
-
|
|
55
|
-
-
|
|
84
|
+
- Updated dependencies [f4abd572]
|
|
85
|
+
- @khanacademy/wonder-blocks-core@9.0.0
|
|
56
86
|
|
|
57
87
|
## 5.0.0
|
|
58
88
|
|
|
59
89
|
### Major Changes
|
|
60
90
|
|
|
61
|
-
-
|
|
91
|
+
- e6abdd17: Upgrade to React 18
|
|
62
92
|
|
|
63
93
|
### Patch Changes
|
|
64
94
|
|
|
65
|
-
-
|
|
66
|
-
-
|
|
67
|
-
-
|
|
95
|
+
- Updated dependencies [e6abdd17]
|
|
96
|
+
- @khanacademy/wonder-blocks-core@8.0.0
|
|
97
|
+
- @khanacademy/wonder-blocks-tokens@3.0.0
|
|
68
98
|
|
|
69
99
|
## 4.2.9
|
|
70
100
|
|
|
71
101
|
### Patch Changes
|
|
72
102
|
|
|
73
|
-
-
|
|
74
|
-
-
|
|
103
|
+
- Updated dependencies [6999fd39]
|
|
104
|
+
- @khanacademy/wonder-blocks-tokens@2.1.0
|
|
75
105
|
|
|
76
106
|
## 4.2.8
|
|
77
107
|
|
|
78
108
|
### Patch Changes
|
|
79
109
|
|
|
80
|
-
-
|
|
81
|
-
-
|
|
82
|
-
-
|
|
83
|
-
-
|
|
110
|
+
- 02a1b298: Make sure we don't package tsconfig and tsbuildinfo files
|
|
111
|
+
- Updated dependencies [02a1b298]
|
|
112
|
+
- @khanacademy/wonder-blocks-core@7.0.1
|
|
113
|
+
- @khanacademy/wonder-blocks-tokens@2.0.1
|
|
84
114
|
|
|
85
115
|
## 4.2.7
|
|
86
116
|
|
|
87
117
|
### Patch Changes
|
|
88
118
|
|
|
89
|
-
-
|
|
90
|
-
-
|
|
119
|
+
- Updated dependencies [07f7f407]
|
|
120
|
+
- @khanacademy/wonder-blocks-core@7.0.0
|
|
91
121
|
|
|
92
122
|
## 4.2.6
|
|
93
123
|
|
|
94
124
|
### Patch Changes
|
|
95
125
|
|
|
96
|
-
-
|
|
97
|
-
-
|
|
98
|
-
-
|
|
126
|
+
- Updated dependencies [f17dc1ee]
|
|
127
|
+
- Updated dependencies [991eb43f]
|
|
128
|
+
- @khanacademy/wonder-blocks-tokens@2.0.0
|
|
99
129
|
|
|
100
130
|
## 4.2.5
|
|
101
131
|
|
|
102
132
|
### Patch Changes
|
|
103
133
|
|
|
104
|
-
-
|
|
105
|
-
-
|
|
106
|
-
-
|
|
107
|
-
-
|
|
134
|
+
- 559e82d5: Update to build tooling, generating smaller output
|
|
135
|
+
- Updated dependencies [559e82d5]
|
|
136
|
+
- @khanacademy/wonder-blocks-core@6.4.3
|
|
137
|
+
- @khanacademy/wonder-blocks-tokens@1.3.1
|
|
108
138
|
|
|
109
139
|
## 4.2.4
|
|
110
140
|
|
|
111
141
|
### Patch Changes
|
|
112
142
|
|
|
113
|
-
-
|
|
114
|
-
-
|
|
143
|
+
- Updated dependencies [eab37b8b]
|
|
144
|
+
- @khanacademy/wonder-blocks-core@6.4.2
|
|
115
145
|
|
|
116
146
|
## 4.2.3
|
|
117
147
|
|
|
118
148
|
### Patch Changes
|
|
119
149
|
|
|
120
|
-
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
150
|
+
- f099cf87: Improves accessibility of the checked status on `OptionItem` components used
|
|
151
|
+
within the `ActionMenu` component. The checked status is communicated to
|
|
152
|
+
screenreaders by using a `menuitemcheckbox` role with the `aria-checked`
|
|
153
|
+
attribute (instead of `aria-selected`). - `CellCore` (used by `CompactCell` and `DetailCell`) has a new optional
|
|
154
|
+
prop for `aria-checked` - `ClickableRole` type now supports the `menuitemcheckbox` role - `OptionItem`'s `role` prop now also supports the `menuitemcheckbox` role
|
|
125
155
|
|
|
126
156
|
## 4.2.2
|
|
127
157
|
|
|
128
158
|
### Patch Changes
|
|
129
159
|
|
|
130
|
-
-
|
|
131
|
-
-
|
|
160
|
+
- Updated dependencies [5dfac06e]
|
|
161
|
+
- @khanacademy/wonder-blocks-core@6.4.1
|
|
132
162
|
|
|
133
163
|
## 4.2.1
|
|
134
164
|
|
|
135
165
|
### Patch Changes
|
|
136
166
|
|
|
137
|
-
-
|
|
138
|
-
-
|
|
167
|
+
- Updated dependencies [9bfeead9]
|
|
168
|
+
- @khanacademy/wonder-blocks-tokens@1.3.0
|
|
139
169
|
|
|
140
170
|
## 4.2.0
|
|
141
171
|
|
|
142
172
|
### Minor Changes
|
|
143
173
|
|
|
144
|
-
-
|
|
174
|
+
- 58075352: Change testId to render the default Testing Library HTML attribute: data-testid (was data-test-id)
|
|
145
175
|
|
|
146
176
|
### Patch Changes
|
|
147
177
|
|
|
148
|
-
-
|
|
149
|
-
-
|
|
178
|
+
- Updated dependencies [58075352]
|
|
179
|
+
- @khanacademy/wonder-blocks-core@6.4.0
|
|
150
180
|
|
|
151
181
|
## 4.1.3
|
|
152
182
|
|
|
153
183
|
### Patch Changes
|
|
154
184
|
|
|
155
|
-
-
|
|
156
|
-
-
|
|
157
|
-
-
|
|
158
|
-
-
|
|
185
|
+
- Updated dependencies [874081aa]
|
|
186
|
+
- Updated dependencies [874081aa]
|
|
187
|
+
- Updated dependencies [a9bf603a]
|
|
188
|
+
- @khanacademy/wonder-blocks-tokens@1.2.0
|
|
159
189
|
|
|
160
190
|
## 4.1.2
|
|
161
191
|
|
|
162
192
|
### Patch Changes
|
|
163
193
|
|
|
164
|
-
-
|
|
194
|
+
- e6433bee: Fix event bubbling on ClickableBehavior when submit is used.
|
|
165
195
|
|
|
166
196
|
## 4.1.1
|
|
167
197
|
|
|
168
198
|
### Patch Changes
|
|
169
199
|
|
|
170
|
-
-
|
|
171
|
-
-
|
|
200
|
+
- Updated dependencies [4cfb4977]
|
|
201
|
+
- @khanacademy/wonder-blocks-tokens@1.1.0
|
|
172
202
|
|
|
173
203
|
## 4.1.0
|
|
174
204
|
|
|
175
205
|
### Minor Changes
|
|
176
206
|
|
|
177
|
-
-
|
|
207
|
+
- 60fdac1c: Added onMouseDown and onMouseUp props to Clickable
|
|
178
208
|
|
|
179
209
|
## 4.0.14
|
|
180
210
|
|
|
181
211
|
### Patch Changes
|
|
182
212
|
|
|
183
|
-
-
|
|
184
|
-
-
|
|
213
|
+
- Updated dependencies [e83f8991]
|
|
214
|
+
- @khanacademy/wonder-blocks-tokens@1.0.0
|
|
185
215
|
|
|
186
216
|
## 4.0.13
|
|
187
217
|
|
|
188
218
|
### Patch Changes
|
|
189
219
|
|
|
190
|
-
-
|
|
191
|
-
-
|
|
192
|
-
-
|
|
193
|
-
-
|
|
220
|
+
- 7c51f377: Migrate wb-color imports to use tokens.color
|
|
221
|
+
- Updated dependencies [7cd7f6cc]
|
|
222
|
+
- Updated dependencies [7c51f377]
|
|
223
|
+
- @khanacademy/wonder-blocks-tokens@0.2.0
|
|
194
224
|
|
|
195
225
|
## 4.0.12
|
|
196
226
|
|
|
197
227
|
### Patch Changes
|
|
198
228
|
|
|
199
|
-
-
|
|
200
|
-
-
|
|
229
|
+
- Updated dependencies [6df21f71]
|
|
230
|
+
- @khanacademy/wonder-blocks-core@6.3.1
|
|
201
231
|
|
|
202
232
|
## 4.0.11
|
|
203
233
|
|
|
204
234
|
### Patch Changes
|
|
205
235
|
|
|
206
|
-
-
|
|
236
|
+
- 6b8bf8d5: Fix onFocus handler on Clickable
|
|
207
237
|
|
|
208
238
|
## 4.0.10
|
|
209
239
|
|
|
210
240
|
### Patch Changes
|
|
211
241
|
|
|
212
|
-
-
|
|
242
|
+
- 7b24db93: Get onFocus to work for buttons
|
|
213
243
|
|
|
214
244
|
## 4.0.9
|
|
215
245
|
|
|
216
246
|
### Patch Changes
|
|
217
247
|
|
|
218
|
-
-
|
|
219
|
-
-
|
|
248
|
+
- Updated dependencies [7055ca94]
|
|
249
|
+
- @khanacademy/wonder-blocks-core@6.3.0
|
|
220
250
|
|
|
221
251
|
## 4.0.8
|
|
222
252
|
|
|
223
253
|
### Patch Changes
|
|
224
254
|
|
|
225
|
-
-
|
|
226
|
-
-
|
|
255
|
+
- Updated dependencies [48d3c7e9]
|
|
256
|
+
- @khanacademy/wonder-blocks-color@3.0.0
|
|
227
257
|
|
|
228
258
|
## 4.0.7
|
|
229
259
|
|
|
230
260
|
### Patch Changes
|
|
231
261
|
|
|
232
|
-
-
|
|
262
|
+
- 80cab317: Include `aria-disabled=false` for `Links` (instead of `undefined`).
|
|
233
263
|
|
|
234
264
|
## 4.0.6
|
|
235
265
|
|
|
236
266
|
### Patch Changes
|
|
237
267
|
|
|
238
|
-
-
|
|
239
|
-
-
|
|
268
|
+
- Updated dependencies [4b97b9a2]
|
|
269
|
+
- @khanacademy/wonder-blocks-core@6.2.0
|
|
240
270
|
|
|
241
271
|
## 4.0.5
|
|
242
272
|
|
|
243
273
|
### Patch Changes
|
|
244
274
|
|
|
245
|
-
-
|
|
246
|
-
-
|
|
275
|
+
- Updated dependencies [2871f0a9]
|
|
276
|
+
- @khanacademy/wonder-blocks-core@6.1.1
|
|
247
277
|
|
|
248
278
|
## 4.0.4
|
|
249
279
|
|
|
250
280
|
### Patch Changes
|
|
251
281
|
|
|
252
|
-
-
|
|
253
|
-
-
|
|
254
|
-
-
|
|
255
|
-
-
|
|
282
|
+
- 834855e5: Allow 'title' as a prop on Clickable
|
|
283
|
+
- Updated dependencies [efb59c29]
|
|
284
|
+
- Updated dependencies [8bc40ed2]
|
|
285
|
+
- @khanacademy/wonder-blocks-core@6.1.0
|
|
256
286
|
|
|
257
287
|
## 4.0.3
|
|
258
288
|
|
|
259
289
|
### Patch Changes
|
|
260
290
|
|
|
261
|
-
-
|
|
262
|
-
-
|
|
291
|
+
- Updated dependencies [f19da46e]
|
|
292
|
+
- @khanacademy/wonder-blocks-core@6.0.2
|
|
263
293
|
|
|
264
294
|
## 4.0.2
|
|
265
295
|
|
|
266
296
|
### Patch Changes
|
|
267
297
|
|
|
268
|
-
-
|
|
269
|
-
-
|
|
270
|
-
-
|
|
298
|
+
- 8dc4a5a3: Allow 'beforeNav' and 'safeWithNav' to be used without an 'href'
|
|
299
|
+
- Updated dependencies [1920feb8]
|
|
300
|
+
- @khanacademy/wonder-blocks-core@6.0.1
|
|
271
301
|
|
|
272
302
|
## 4.0.1
|
|
273
303
|
|
|
274
304
|
### Patch Changes
|
|
275
305
|
|
|
276
|
-
-
|
|
306
|
+
- f230b267: Allow 'safeWithNav()' to be used on its own without 'beforeNav()' in prop types
|
|
277
307
|
|
|
278
308
|
## 4.0.0
|
|
279
309
|
|
|
280
310
|
### Major Changes
|
|
281
311
|
|
|
282
|
-
-
|
|
312
|
+
- 674a1e5c: Props are using discriminated union types to prevent invalid combinations of props
|
|
283
313
|
|
|
284
314
|
### Minor Changes
|
|
285
315
|
|
|
286
|
-
-
|
|
316
|
+
- 8c77f29d: Create new Switch component and add 'switch' role to ClickableRole
|
|
287
317
|
|
|
288
318
|
### Patch Changes
|
|
289
319
|
|
|
290
|
-
-
|
|
291
|
-
-
|
|
292
|
-
-
|
|
293
|
-
-
|
|
320
|
+
- 674a1e5c: We're no longer building flow types
|
|
321
|
+
- Updated dependencies [674a1e5c]
|
|
322
|
+
- Updated dependencies [674a1e5c]
|
|
323
|
+
- @khanacademy/wonder-blocks-core@6.0.0
|
|
294
324
|
|
|
295
325
|
## 3.1.3
|
|
296
326
|
|
|
297
327
|
### Patch Changes
|
|
298
328
|
|
|
299
|
-
-
|
|
300
|
-
-
|
|
329
|
+
- Updated dependencies [1344436f]
|
|
330
|
+
- @khanacademy/wonder-blocks-core@5.4.0
|
|
301
331
|
|
|
302
332
|
## 3.1.2
|
|
303
333
|
|
|
304
334
|
### Patch Changes
|
|
305
335
|
|
|
306
|
-
-
|
|
307
|
-
-
|
|
336
|
+
- Updated dependencies [9f3752d4]
|
|
337
|
+
- @khanacademy/wonder-blocks-core@5.3.1
|
|
308
338
|
|
|
309
339
|
## 3.1.1
|
|
310
340
|
|
|
311
341
|
### Patch Changes
|
|
312
342
|
|
|
313
|
-
-
|
|
314
|
-
-
|
|
315
|
-
-
|
|
343
|
+
- Updated dependencies [c37b99aa]
|
|
344
|
+
- Updated dependencies [c4cef3e6]
|
|
345
|
+
- @khanacademy/wonder-blocks-core@5.3.0
|
|
316
346
|
|
|
317
347
|
## 3.1.0
|
|
318
348
|
|
|
319
349
|
### Minor Changes
|
|
320
350
|
|
|
321
|
-
-
|
|
351
|
+
- ad8beb23: Added new tab index and ref props
|
|
322
352
|
|
|
323
353
|
## 3.0.13
|
|
324
354
|
|
|
325
355
|
### Patch Changes
|
|
326
356
|
|
|
327
|
-
-
|
|
328
|
-
-
|
|
357
|
+
- Updated dependencies [d4c412b5]
|
|
358
|
+
- @khanacademy/wonder-blocks-core@5.2.3
|
|
329
359
|
|
|
330
360
|
## 3.0.12
|
|
331
361
|
|
|
332
362
|
### Patch Changes
|
|
333
363
|
|
|
334
|
-
-
|
|
335
|
-
-
|
|
364
|
+
- Updated dependencies [64a188e3]
|
|
365
|
+
- @khanacademy/wonder-blocks-core@5.2.2
|
|
336
366
|
|
|
337
367
|
## 3.0.11
|
|
338
368
|
|
|
339
369
|
### Patch Changes
|
|
340
370
|
|
|
341
|
-
-
|
|
342
|
-
-
|
|
343
|
-
-
|
|
344
|
-
-
|
|
371
|
+
- df9a10aa: Update state and props to be readonly in components using getDerivedStateFromProps()
|
|
372
|
+
- Updated dependencies [5a1ea891]
|
|
373
|
+
- Updated dependencies [df9a10aa]
|
|
374
|
+
- @khanacademy/wonder-blocks-core@5.2.1
|
|
345
375
|
|
|
346
376
|
## 3.0.10
|
|
347
377
|
|
|
348
378
|
### Patch Changes
|
|
349
379
|
|
|
350
|
-
-
|
|
351
|
-
-
|
|
352
|
-
-
|
|
353
|
-
-
|
|
380
|
+
- Updated dependencies [fa70c895]
|
|
381
|
+
- Updated dependencies [19ab0408]
|
|
382
|
+
- Updated dependencies [fa70c895]
|
|
383
|
+
- @khanacademy/wonder-blocks-core@5.2.0
|
|
354
384
|
|
|
355
385
|
## 3.0.9
|
|
356
386
|
|
|
357
387
|
### Patch Changes
|
|
358
388
|
|
|
359
|
-
-
|
|
360
|
-
-
|
|
361
|
-
-
|
|
389
|
+
- Updated dependencies [3c400719]
|
|
390
|
+
- Updated dependencies [a6164ed0]
|
|
391
|
+
- @khanacademy/wonder-blocks-core@5.1.0
|
|
362
392
|
|
|
363
393
|
## 3.0.8
|
|
364
394
|
|
|
@@ -368,9 +398,9 @@
|
|
|
368
398
|
|
|
369
399
|
### Patch Changes
|
|
370
400
|
|
|
371
|
-
-
|
|
372
|
-
-
|
|
373
|
-
-
|
|
401
|
+
- c20f48f3: Don't transpile classes when building bundles
|
|
402
|
+
- Updated dependencies [c20f48f3]
|
|
403
|
+
- @khanacademy/wonder-blocks-core@5.0.4
|
|
374
404
|
|
|
375
405
|
## 3.0.5
|
|
376
406
|
|
|
@@ -380,186 +410,186 @@
|
|
|
380
410
|
|
|
381
411
|
### Patch Changes
|
|
382
412
|
|
|
383
|
-
-
|
|
384
|
-
-
|
|
413
|
+
- Updated dependencies [b281e2eb]
|
|
414
|
+
- @khanacademy/wonder-blocks-core@5.0.3
|
|
385
415
|
|
|
386
416
|
## 3.0.2
|
|
387
417
|
|
|
388
418
|
### Patch Changes
|
|
389
419
|
|
|
390
|
-
-
|
|
391
|
-
-
|
|
420
|
+
- Updated dependencies [21ce20c7]
|
|
421
|
+
- @khanacademy/wonder-blocks-core@5.0.2
|
|
392
422
|
|
|
393
423
|
## 3.0.1
|
|
394
424
|
|
|
395
425
|
### Patch Changes
|
|
396
426
|
|
|
397
|
-
-
|
|
398
|
-
-
|
|
399
|
-
-
|
|
400
|
-
-
|
|
401
|
-
-
|
|
402
|
-
-
|
|
427
|
+
- ccb6fe00: Miscellaneous TS type fixes
|
|
428
|
+
- d4c2b18c: Fix a variety of issues with Flow types generated by flowgen
|
|
429
|
+
- Updated dependencies [ccb6fe00]
|
|
430
|
+
- Updated dependencies [d4c2b18c]
|
|
431
|
+
- @khanacademy/wonder-blocks-core@5.0.1
|
|
432
|
+
- @khanacademy/wonder-blocks-color@2.0.1
|
|
403
433
|
|
|
404
434
|
## 3.0.0
|
|
405
435
|
|
|
406
436
|
### Major Changes
|
|
407
437
|
|
|
408
|
-
-
|
|
438
|
+
- 1ca4d7e3: Fix minor issue with generate Flow types (this is a major bump b/c I forgot to do one after doing the TS conversion)
|
|
409
439
|
|
|
410
440
|
### Patch Changes
|
|
411
441
|
|
|
412
|
-
-
|
|
413
|
-
-
|
|
414
|
-
-
|
|
442
|
+
- Updated dependencies [1ca4d7e3]
|
|
443
|
+
- @khanacademy/wonder-blocks-color@2.0.0
|
|
444
|
+
- @khanacademy/wonder-blocks-core@5.0.0
|
|
415
445
|
|
|
416
446
|
## 2.4.8
|
|
417
447
|
|
|
418
448
|
### Patch Changes
|
|
419
449
|
|
|
420
|
-
-
|
|
421
|
-
-
|
|
422
|
-
-
|
|
423
|
-
-
|
|
450
|
+
- b5ba5568: Ensure that flow lib defs use React.ElementConfig<> isntead of JSX.LibraryManagedAttributes<>
|
|
451
|
+
- Updated dependencies [b5ba5568]
|
|
452
|
+
- @khanacademy/wonder-blocks-color@1.2.3
|
|
453
|
+
- @khanacademy/wonder-blocks-core@4.9.1
|
|
424
454
|
|
|
425
455
|
## 2.4.7
|
|
426
456
|
|
|
427
457
|
### Patch Changes
|
|
428
458
|
|
|
429
|
-
-
|
|
430
|
-
-
|
|
459
|
+
- Updated dependencies [779b031d]
|
|
460
|
+
- @khanacademy/wonder-blocks-core@4.9.0
|
|
431
461
|
|
|
432
462
|
## 2.4.6
|
|
433
463
|
|
|
434
464
|
### Patch Changes
|
|
435
465
|
|
|
436
|
-
-
|
|
437
|
-
-
|
|
438
|
-
-
|
|
439
|
-
-
|
|
440
|
-
-
|
|
441
|
-
-
|
|
442
|
-
-
|
|
443
|
-
-
|
|
444
|
-
-
|
|
445
|
-
-
|
|
446
|
-
-
|
|
447
|
-
-
|
|
448
|
-
-
|
|
449
|
-
-
|
|
450
|
-
-
|
|
451
|
-
-
|
|
452
|
-
-
|
|
453
|
-
-
|
|
454
|
-
-
|
|
466
|
+
- d816af08: Update build and test configs use TypeScript
|
|
467
|
+
- 3891f544: Update babel config to include plugins that Storybook needed
|
|
468
|
+
- 0d28bb1c: Configured TypeScript
|
|
469
|
+
- 3d05f764: Fix HOCs and other type errors
|
|
470
|
+
- c2ec4902: Update eslint configuration, fix lint
|
|
471
|
+
- 2983c05b: Include 'types' field in package.json
|
|
472
|
+
- 77ff6a66: Generate Flow types from TypeScript types
|
|
473
|
+
- ec8d4b7f: Fix miscellaneous TypeScript errors
|
|
474
|
+
- Updated dependencies [d816af08]
|
|
475
|
+
- Updated dependencies [3891f544]
|
|
476
|
+
- Updated dependencies [0d28bb1c]
|
|
477
|
+
- Updated dependencies [873f4a14]
|
|
478
|
+
- Updated dependencies [3d05f764]
|
|
479
|
+
- Updated dependencies [c2ec4902]
|
|
480
|
+
- Updated dependencies [2983c05b]
|
|
481
|
+
- Updated dependencies [77ff6a66]
|
|
482
|
+
- Updated dependencies [ec8d4b7f]
|
|
483
|
+
- @khanacademy/wonder-blocks-color@1.2.2
|
|
484
|
+
- @khanacademy/wonder-blocks-core@4.8.0
|
|
455
485
|
|
|
456
486
|
## 2.4.5
|
|
457
487
|
|
|
458
488
|
### Patch Changes
|
|
459
489
|
|
|
460
|
-
-
|
|
461
|
-
-
|
|
462
|
-
-
|
|
463
|
-
-
|
|
464
|
-
-
|
|
465
|
-
-
|
|
490
|
+
- 91cb727c: Remove file extensions from imports
|
|
491
|
+
- 91cb727c: Merge disjoint prop types since the codemod doesn't handle these properly.
|
|
492
|
+
- Updated dependencies [91cb727c]
|
|
493
|
+
- Updated dependencies [91cb727c]
|
|
494
|
+
- @khanacademy/wonder-blocks-color@1.2.1
|
|
495
|
+
- @khanacademy/wonder-blocks-core@4.7.0
|
|
466
496
|
|
|
467
497
|
## 2.4.4
|
|
468
498
|
|
|
469
499
|
### Patch Changes
|
|
470
500
|
|
|
471
|
-
-
|
|
472
|
-
-
|
|
473
|
-
-
|
|
501
|
+
- 496119f2: Cleanup WB interdependencies
|
|
502
|
+
- Updated dependencies [496119f2]
|
|
503
|
+
- @khanacademy/wonder-blocks-core@4.6.2
|
|
474
504
|
|
|
475
505
|
## 2.4.3
|
|
476
506
|
|
|
477
507
|
### Patch Changes
|
|
478
508
|
|
|
479
|
-
-
|
|
509
|
+
- @khanacademy/wonder-blocks-core@4.6.1
|
|
480
510
|
|
|
481
511
|
## 2.4.2
|
|
482
512
|
|
|
483
513
|
### Patch Changes
|
|
484
514
|
|
|
485
|
-
-
|
|
486
|
-
-
|
|
487
|
-
-
|
|
488
|
-
-
|
|
515
|
+
- Updated dependencies [b561425a]
|
|
516
|
+
- Updated dependencies [a566e232]
|
|
517
|
+
- Updated dependencies [d2b21a6e]
|
|
518
|
+
- @khanacademy/wonder-blocks-core@4.6.0
|
|
489
519
|
|
|
490
520
|
## 2.4.1
|
|
491
521
|
|
|
492
522
|
### Patch Changes
|
|
493
523
|
|
|
494
|
-
-
|
|
524
|
+
- 4c682709: handleClick no longer redundantly triggers on mouseup
|
|
495
525
|
|
|
496
526
|
## 2.4.0
|
|
497
527
|
|
|
498
528
|
### Minor Changes
|
|
499
529
|
|
|
500
|
-
-
|
|
530
|
+
- ceb111df: ClickableBehavior no longer has tabIndex 0 by default. It must be passed in.
|
|
501
531
|
|
|
502
532
|
## 2.3.3
|
|
503
533
|
|
|
504
534
|
### Patch Changes
|
|
505
535
|
|
|
506
|
-
-
|
|
507
|
-
-
|
|
536
|
+
- Updated dependencies [175a2dd2]
|
|
537
|
+
- @khanacademy/wonder-blocks-core@4.5.0
|
|
508
538
|
|
|
509
539
|
## 2.3.2
|
|
510
540
|
|
|
511
541
|
### Patch Changes
|
|
512
542
|
|
|
513
|
-
-
|
|
543
|
+
- 5b8ba5da: Remove the default value of aria-label ""
|
|
514
544
|
|
|
515
545
|
## 2.3.1
|
|
516
546
|
|
|
517
547
|
### Patch Changes
|
|
518
548
|
|
|
519
|
-
-
|
|
520
|
-
-
|
|
549
|
+
- Updated dependencies [6ee20af9]
|
|
550
|
+
- @khanacademy/wonder-blocks-core@4.4.0
|
|
521
551
|
|
|
522
552
|
## 2.3.0
|
|
523
553
|
|
|
524
554
|
### Minor Changes
|
|
525
555
|
|
|
526
|
-
-
|
|
556
|
+
- ee6fc773: Added keyboard support to search items when the dropdown is focused, included "Enter" as a key to trigger actions with the "option" role
|
|
527
557
|
|
|
528
558
|
## 2.2.7
|
|
529
559
|
|
|
530
560
|
### Patch Changes
|
|
531
561
|
|
|
532
|
-
-
|
|
533
|
-
-
|
|
534
|
-
-
|
|
562
|
+
- Updated dependencies [5f4a4297]
|
|
563
|
+
- Updated dependencies [2b96fd59]
|
|
564
|
+
- @khanacademy/wonder-blocks-core@4.3.2
|
|
535
565
|
|
|
536
566
|
## 2.2.6
|
|
537
567
|
|
|
538
568
|
### Patch Changes
|
|
539
569
|
|
|
540
|
-
-
|
|
570
|
+
- @khanacademy/wonder-blocks-core@4.3.1
|
|
541
571
|
|
|
542
572
|
## 2.2.5
|
|
543
573
|
|
|
544
574
|
### Patch Changes
|
|
545
575
|
|
|
546
|
-
-
|
|
547
|
-
-
|
|
576
|
+
- Updated dependencies [246a921d]
|
|
577
|
+
- @khanacademy/wonder-blocks-core@4.3.0
|
|
548
578
|
|
|
549
579
|
## 2.2.4
|
|
550
580
|
|
|
551
581
|
### Patch Changes
|
|
552
582
|
|
|
553
|
-
-
|
|
583
|
+
- 166ecc97: Use `aria-disabled` instead of disabled, fix focused + disabled styles.
|
|
554
584
|
|
|
555
585
|
## 2.2.3
|
|
556
586
|
|
|
557
587
|
### Patch Changes
|
|
558
588
|
|
|
559
|
-
-
|
|
589
|
+
- @khanacademy/wonder-blocks-core@4.2.1
|
|
560
590
|
|
|
561
591
|
## 2.2.2
|
|
562
592
|
|
|
563
593
|
### Patch Changes
|
|
564
594
|
|
|
565
|
-
-
|
|
595
|
+
- 901bfe82: Change disabled tabindex from -1 to 0
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2018 Khan Academy
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/es/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import * as React from 'react';
|
|
|
4
4
|
import { StyleSheet } from 'aphrodite';
|
|
5
5
|
import { withRouter, Link } from 'react-router-dom';
|
|
6
6
|
import { __RouterContext } from 'react-router';
|
|
7
|
-
import { addStyle } from '@khanacademy/wonder-blocks-core';
|
|
7
|
+
import { keys, addStyle } from '@khanacademy/wonder-blocks-core';
|
|
8
8
|
import { color } from '@khanacademy/wonder-blocks-tokens';
|
|
9
9
|
|
|
10
10
|
const getAppropriateTriggersForRole = role => {
|
|
@@ -33,20 +33,16 @@ const getAppropriateTriggersForRole = role => {
|
|
|
33
33
|
}
|
|
34
34
|
};
|
|
35
35
|
const disabledHandlers = {
|
|
36
|
-
onClick: () =>
|
|
37
|
-
onMouseEnter: () =>
|
|
38
|
-
onMouseLeave: () =>
|
|
39
|
-
onMouseDown: () =>
|
|
40
|
-
onMouseUp: () =>
|
|
41
|
-
onTouchStart: () =>
|
|
42
|
-
onTouchEnd: () =>
|
|
43
|
-
onTouchCancel: () =>
|
|
44
|
-
onKeyDown: () =>
|
|
45
|
-
onKeyUp: () =>
|
|
46
|
-
};
|
|
47
|
-
const keyCodes = {
|
|
48
|
-
enter: 13,
|
|
49
|
-
space: 32
|
|
36
|
+
onClick: () => undefined,
|
|
37
|
+
onMouseEnter: () => undefined,
|
|
38
|
+
onMouseLeave: () => undefined,
|
|
39
|
+
onMouseDown: () => undefined,
|
|
40
|
+
onMouseUp: () => undefined,
|
|
41
|
+
onTouchStart: () => undefined,
|
|
42
|
+
onTouchEnd: () => undefined,
|
|
43
|
+
onTouchCancel: () => undefined,
|
|
44
|
+
onKeyDown: () => undefined,
|
|
45
|
+
onKeyUp: () => undefined
|
|
50
46
|
};
|
|
51
47
|
const startState = {
|
|
52
48
|
hovered: false,
|
|
@@ -66,8 +62,8 @@ class ClickableBehavior extends React.Component {
|
|
|
66
62
|
}
|
|
67
63
|
constructor(props) {
|
|
68
64
|
super(props);
|
|
69
|
-
this.waitingForClick =
|
|
70
|
-
this.enterClick =
|
|
65
|
+
this.waitingForClick = undefined;
|
|
66
|
+
this.enterClick = undefined;
|
|
71
67
|
this.handleClick = e => {
|
|
72
68
|
const {
|
|
73
69
|
onClick = undefined,
|
|
@@ -140,17 +136,17 @@ class ClickableBehavior extends React.Component {
|
|
|
140
136
|
if (onKeyDown) {
|
|
141
137
|
onKeyDown(e);
|
|
142
138
|
}
|
|
143
|
-
const
|
|
139
|
+
const keyName = e.key;
|
|
144
140
|
const {
|
|
145
141
|
triggerOnEnter,
|
|
146
142
|
triggerOnSpace
|
|
147
143
|
} = getAppropriateTriggersForRole(role);
|
|
148
|
-
if (triggerOnEnter &&
|
|
144
|
+
if (triggerOnEnter && keyName === keys.enter || triggerOnSpace && keyName === keys.space) {
|
|
149
145
|
e.preventDefault();
|
|
150
146
|
this.setState({
|
|
151
147
|
pressed: true
|
|
152
148
|
});
|
|
153
|
-
} else if (!triggerOnEnter &&
|
|
149
|
+
} else if (!triggerOnEnter && keyName === keys.enter) {
|
|
154
150
|
this.enterClick = true;
|
|
155
151
|
}
|
|
156
152
|
};
|
|
@@ -162,18 +158,18 @@ class ClickableBehavior extends React.Component {
|
|
|
162
158
|
if (onKeyUp) {
|
|
163
159
|
onKeyUp(e);
|
|
164
160
|
}
|
|
165
|
-
const
|
|
161
|
+
const keyName = e.key;
|
|
166
162
|
const {
|
|
167
163
|
triggerOnEnter,
|
|
168
164
|
triggerOnSpace
|
|
169
165
|
} = getAppropriateTriggersForRole(role);
|
|
170
|
-
if (triggerOnEnter &&
|
|
166
|
+
if (triggerOnEnter && keyName === keys.enter || triggerOnSpace && keyName === keys.space) {
|
|
171
167
|
this.setState({
|
|
172
168
|
pressed: false,
|
|
173
169
|
focused: true
|
|
174
170
|
});
|
|
175
171
|
this.runCallbackAndMaybeNavigate(e);
|
|
176
|
-
} else if (!triggerOnEnter &&
|
|
172
|
+
} else if (!triggerOnEnter && keyName === keys.enter) {
|
|
177
173
|
this.enterClick = false;
|
|
178
174
|
}
|
|
179
175
|
};
|
|
@@ -353,7 +349,7 @@ function getClickableBehavior(href, skipClientNav, router) {
|
|
|
353
349
|
}
|
|
354
350
|
|
|
355
351
|
const _excluded = ["href", "onClick", "skipClientNav", "beforeNav", "safeWithNav", "style", "target", "testId", "onFocus", "onKeyDown", "onKeyUp", "onMouseDown", "onMouseUp", "hideDefaultFocusRing", "light", "disabled", "tabIndex"];
|
|
356
|
-
const
|
|
352
|
+
const StyledA = addStyle("a");
|
|
357
353
|
const StyledButton = addStyle("button");
|
|
358
354
|
const StyledLink = addStyle(Link);
|
|
359
355
|
const Clickable = React.forwardRef(function Clickable(props, ref) {
|
|
@@ -369,7 +365,7 @@ const Clickable = React.forwardRef(function Clickable(props, ref) {
|
|
|
369
365
|
ref: ref
|
|
370
366
|
}), props.children(clickableState));
|
|
371
367
|
} else if (activeHref && !useClient) {
|
|
372
|
-
return React.createElement(
|
|
368
|
+
return React.createElement(StyledA, _extends({}, commonProps, {
|
|
373
369
|
href: props.href,
|
|
374
370
|
role: props.role,
|
|
375
371
|
target: props.target || undefined,
|
package/dist/index.js
CHANGED
|
@@ -11,10 +11,7 @@ var reactRouter = require('react-router');
|
|
|
11
11
|
var wonderBlocksCore = require('@khanacademy/wonder-blocks-core');
|
|
12
12
|
var wonderBlocksTokens = require('@khanacademy/wonder-blocks-tokens');
|
|
13
13
|
|
|
14
|
-
function
|
|
15
|
-
|
|
16
|
-
function _interopNamespace(e) {
|
|
17
|
-
if (e && e.__esModule) return e;
|
|
14
|
+
function _interopNamespaceDefault(e) {
|
|
18
15
|
var n = Object.create(null);
|
|
19
16
|
if (e) {
|
|
20
17
|
Object.keys(e).forEach(function (k) {
|
|
@@ -27,13 +24,11 @@ function _interopNamespace(e) {
|
|
|
27
24
|
}
|
|
28
25
|
});
|
|
29
26
|
}
|
|
30
|
-
n
|
|
27
|
+
n.default = e;
|
|
31
28
|
return Object.freeze(n);
|
|
32
29
|
}
|
|
33
30
|
|
|
34
|
-
var
|
|
35
|
-
var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);
|
|
36
|
-
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
31
|
+
var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
|
|
37
32
|
|
|
38
33
|
const getAppropriateTriggersForRole = role => {
|
|
39
34
|
switch (role) {
|
|
@@ -61,20 +56,16 @@ const getAppropriateTriggersForRole = role => {
|
|
|
61
56
|
}
|
|
62
57
|
};
|
|
63
58
|
const disabledHandlers = {
|
|
64
|
-
onClick: () =>
|
|
65
|
-
onMouseEnter: () =>
|
|
66
|
-
onMouseLeave: () =>
|
|
67
|
-
onMouseDown: () =>
|
|
68
|
-
onMouseUp: () =>
|
|
69
|
-
onTouchStart: () =>
|
|
70
|
-
onTouchEnd: () =>
|
|
71
|
-
onTouchCancel: () =>
|
|
72
|
-
onKeyDown: () =>
|
|
73
|
-
onKeyUp: () =>
|
|
74
|
-
};
|
|
75
|
-
const keyCodes = {
|
|
76
|
-
enter: 13,
|
|
77
|
-
space: 32
|
|
59
|
+
onClick: () => undefined,
|
|
60
|
+
onMouseEnter: () => undefined,
|
|
61
|
+
onMouseLeave: () => undefined,
|
|
62
|
+
onMouseDown: () => undefined,
|
|
63
|
+
onMouseUp: () => undefined,
|
|
64
|
+
onTouchStart: () => undefined,
|
|
65
|
+
onTouchEnd: () => undefined,
|
|
66
|
+
onTouchCancel: () => undefined,
|
|
67
|
+
onKeyDown: () => undefined,
|
|
68
|
+
onKeyUp: () => undefined
|
|
78
69
|
};
|
|
79
70
|
const startState = {
|
|
80
71
|
hovered: false,
|
|
@@ -85,7 +76,7 @@ const startState = {
|
|
|
85
76
|
class ClickableBehavior extends React__namespace.Component {
|
|
86
77
|
static getDerivedStateFromProps(props, state) {
|
|
87
78
|
if (props.disabled) {
|
|
88
|
-
return
|
|
79
|
+
return _extends({}, startState, {
|
|
89
80
|
focused: state.focused
|
|
90
81
|
});
|
|
91
82
|
} else {
|
|
@@ -94,8 +85,8 @@ class ClickableBehavior extends React__namespace.Component {
|
|
|
94
85
|
}
|
|
95
86
|
constructor(props) {
|
|
96
87
|
super(props);
|
|
97
|
-
this.waitingForClick =
|
|
98
|
-
this.enterClick =
|
|
88
|
+
this.waitingForClick = undefined;
|
|
89
|
+
this.enterClick = undefined;
|
|
99
90
|
this.handleClick = e => {
|
|
100
91
|
const {
|
|
101
92
|
onClick = undefined,
|
|
@@ -168,17 +159,17 @@ class ClickableBehavior extends React__namespace.Component {
|
|
|
168
159
|
if (onKeyDown) {
|
|
169
160
|
onKeyDown(e);
|
|
170
161
|
}
|
|
171
|
-
const
|
|
162
|
+
const keyName = e.key;
|
|
172
163
|
const {
|
|
173
164
|
triggerOnEnter,
|
|
174
165
|
triggerOnSpace
|
|
175
166
|
} = getAppropriateTriggersForRole(role);
|
|
176
|
-
if (triggerOnEnter &&
|
|
167
|
+
if (triggerOnEnter && keyName === wonderBlocksCore.keys.enter || triggerOnSpace && keyName === wonderBlocksCore.keys.space) {
|
|
177
168
|
e.preventDefault();
|
|
178
169
|
this.setState({
|
|
179
170
|
pressed: true
|
|
180
171
|
});
|
|
181
|
-
} else if (!triggerOnEnter &&
|
|
172
|
+
} else if (!triggerOnEnter && keyName === wonderBlocksCore.keys.enter) {
|
|
182
173
|
this.enterClick = true;
|
|
183
174
|
}
|
|
184
175
|
};
|
|
@@ -190,18 +181,18 @@ class ClickableBehavior extends React__namespace.Component {
|
|
|
190
181
|
if (onKeyUp) {
|
|
191
182
|
onKeyUp(e);
|
|
192
183
|
}
|
|
193
|
-
const
|
|
184
|
+
const keyName = e.key;
|
|
194
185
|
const {
|
|
195
186
|
triggerOnEnter,
|
|
196
187
|
triggerOnSpace
|
|
197
188
|
} = getAppropriateTriggersForRole(role);
|
|
198
|
-
if (triggerOnEnter &&
|
|
189
|
+
if (triggerOnEnter && keyName === wonderBlocksCore.keys.enter || triggerOnSpace && keyName === wonderBlocksCore.keys.space) {
|
|
199
190
|
this.setState({
|
|
200
191
|
pressed: false,
|
|
201
192
|
focused: true
|
|
202
193
|
});
|
|
203
194
|
this.runCallbackAndMaybeNavigate(e);
|
|
204
|
-
} else if (!triggerOnEnter &&
|
|
195
|
+
} else if (!triggerOnEnter && keyName === wonderBlocksCore.keys.enter) {
|
|
205
196
|
this.enterClick = false;
|
|
206
197
|
}
|
|
207
198
|
};
|
|
@@ -334,7 +325,7 @@ class ClickableBehavior extends React__namespace.Component {
|
|
|
334
325
|
}
|
|
335
326
|
render() {
|
|
336
327
|
const rel = this.props.rel || (this.props.target === "_blank" ? "noopener noreferrer" : undefined);
|
|
337
|
-
const childrenProps = this.props.disabled ?
|
|
328
|
+
const childrenProps = this.props.disabled ? _extends({}, disabledHandlers, {
|
|
338
329
|
onFocus: this.handleFocus,
|
|
339
330
|
onBlur: this.handleBlur,
|
|
340
331
|
tabIndex: this.props.tabIndex,
|
|
@@ -381,7 +372,7 @@ function getClickableBehavior(href, skipClientNav, router) {
|
|
|
381
372
|
}
|
|
382
373
|
|
|
383
374
|
const _excluded = ["href", "onClick", "skipClientNav", "beforeNav", "safeWithNav", "style", "target", "testId", "onFocus", "onKeyDown", "onKeyUp", "onMouseDown", "onMouseUp", "hideDefaultFocusRing", "light", "disabled", "tabIndex"];
|
|
384
|
-
const
|
|
375
|
+
const StyledA = wonderBlocksCore.addStyle("a");
|
|
385
376
|
const StyledButton = wonderBlocksCore.addStyle("button");
|
|
386
377
|
const StyledLink = wonderBlocksCore.addStyle(reactRouterDom.Link);
|
|
387
378
|
const Clickable = React__namespace.forwardRef(function Clickable(props, ref) {
|
|
@@ -389,7 +380,7 @@ const Clickable = React__namespace.forwardRef(function Clickable(props, ref) {
|
|
|
389
380
|
const activeHref = props.href && !props.disabled;
|
|
390
381
|
const useClient = router && !props.skipClientNav && isClientSideUrl(props.href || "");
|
|
391
382
|
if (activeHref && useClient && props.href) {
|
|
392
|
-
return React__namespace.createElement(StyledLink,
|
|
383
|
+
return React__namespace.createElement(StyledLink, _extends({}, commonProps, {
|
|
393
384
|
to: props.href,
|
|
394
385
|
role: props.role,
|
|
395
386
|
target: props.target || undefined,
|
|
@@ -397,7 +388,7 @@ const Clickable = React__namespace.forwardRef(function Clickable(props, ref) {
|
|
|
397
388
|
ref: ref
|
|
398
389
|
}), props.children(clickableState));
|
|
399
390
|
} else if (activeHref && !useClient) {
|
|
400
|
-
return React__namespace.createElement(
|
|
391
|
+
return React__namespace.createElement(StyledA, _extends({}, commonProps, {
|
|
401
392
|
href: props.href,
|
|
402
393
|
role: props.role,
|
|
403
394
|
target: props.target || undefined,
|
|
@@ -405,7 +396,7 @@ const Clickable = React__namespace.forwardRef(function Clickable(props, ref) {
|
|
|
405
396
|
ref: ref
|
|
406
397
|
}), props.children(clickableState));
|
|
407
398
|
} else {
|
|
408
|
-
return React__namespace.createElement(StyledButton,
|
|
399
|
+
return React__namespace.createElement(StyledButton, _extends({}, commonProps, {
|
|
409
400
|
type: "button",
|
|
410
401
|
"aria-disabled": props.disabled,
|
|
411
402
|
ref: ref
|
|
@@ -432,7 +423,7 @@ const Clickable = React__namespace.forwardRef(function Clickable(props, ref) {
|
|
|
432
423
|
disabled,
|
|
433
424
|
tabIndex
|
|
434
425
|
} = props,
|
|
435
|
-
restProps =
|
|
426
|
+
restProps = _objectWithoutPropertiesLoose(props, _excluded);
|
|
436
427
|
const ClickableBehavior = getClickableBehavior(href, skipClientNav, router);
|
|
437
428
|
const getStyle = state => [styles.reset, styles.link, !hideDefaultFocusRing && state.focused && (light ? styles.focusedLight : styles.focused), disabled && styles.disabled, style];
|
|
438
429
|
if (beforeNav) {
|
|
@@ -448,7 +439,7 @@ const Clickable = React__namespace.forwardRef(function Clickable(props, ref) {
|
|
|
448
439
|
onMouseUp: onMouseUp,
|
|
449
440
|
disabled: disabled,
|
|
450
441
|
tabIndex: tabIndex
|
|
451
|
-
}, (state, childrenProps) => getCorrectTag(state, router,
|
|
442
|
+
}, (state, childrenProps) => getCorrectTag(state, router, _extends({}, restProps, {
|
|
452
443
|
"data-testid": testId,
|
|
453
444
|
style: getStyle(state)
|
|
454
445
|
}, childrenProps)));
|
|
@@ -465,7 +456,7 @@ const Clickable = React__namespace.forwardRef(function Clickable(props, ref) {
|
|
|
465
456
|
target: target,
|
|
466
457
|
disabled: disabled,
|
|
467
458
|
tabIndex: tabIndex
|
|
468
|
-
}, (state, childrenProps) => getCorrectTag(state, router,
|
|
459
|
+
}, (state, childrenProps) => getCorrectTag(state, router, _extends({}, restProps, {
|
|
469
460
|
"data-testid": testId,
|
|
470
461
|
style: getStyle(state)
|
|
471
462
|
}, childrenProps)));
|
|
@@ -520,6 +511,6 @@ const styles = aphrodite.StyleSheet.create({
|
|
|
520
511
|
});
|
|
521
512
|
|
|
522
513
|
exports.ClickableBehavior = ClickableBehavior;
|
|
523
|
-
exports
|
|
514
|
+
exports.default = Clickable;
|
|
524
515
|
exports.getClickableBehavior = getClickableBehavior;
|
|
525
516
|
exports.isClientSideUrl = isClientSideUrl;
|
package/package.json
CHANGED
|
@@ -1,24 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@khanacademy/wonder-blocks-clickable",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.1.0",
|
|
4
4
|
"design": "v1",
|
|
5
5
|
"description": "Clickable component for Wonder-Blocks.",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/es/index.js",
|
|
8
8
|
"types": "dist/index.d.ts",
|
|
9
|
-
"scripts": {
|
|
10
|
-
"test": "echo \"Error: no test specified\" && exit 1",
|
|
11
|
-
"prepublishOnly": "../../utils/publish/package-pre-publish-check.sh"
|
|
12
|
-
},
|
|
13
9
|
"author": "",
|
|
14
10
|
"license": "MIT",
|
|
15
11
|
"publishConfig": {
|
|
16
12
|
"access": "public"
|
|
17
13
|
},
|
|
18
14
|
"dependencies": {
|
|
19
|
-
"@babel/runtime": "^7.
|
|
20
|
-
"@khanacademy/wonder-blocks-core": "
|
|
21
|
-
"@khanacademy/wonder-blocks-tokens": "
|
|
15
|
+
"@babel/runtime": "^7.24.5",
|
|
16
|
+
"@khanacademy/wonder-blocks-core": "12.1.0",
|
|
17
|
+
"@khanacademy/wonder-blocks-tokens": "4.2.0"
|
|
22
18
|
},
|
|
23
19
|
"peerDependencies": {
|
|
24
20
|
"aphrodite": "^1.2.5",
|
|
@@ -28,6 +24,9 @@
|
|
|
28
24
|
"react-router-dom": "5.3.4"
|
|
29
25
|
},
|
|
30
26
|
"devDependencies": {
|
|
31
|
-
"@khanacademy/wb-dev-build-settings": "
|
|
27
|
+
"@khanacademy/wb-dev-build-settings": "2.1.0"
|
|
28
|
+
},
|
|
29
|
+
"scripts": {
|
|
30
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
32
31
|
}
|
|
33
32
|
}
|