@khanacademy/wonder-blocks-icon-button 3.4.15 → 3.4.17
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 +18 -0
- package/package.json +5 -5
- package/src/__tests__/__snapshots__/custom-snapshot.test.js.snap +0 -64
- package/src/__tests__/custom-snapshot.test.js +0 -1
- package/src/components/__tests__/icon-button.test.js +26 -30
- package/dist/index.js +0 -449
- package/dist/index.js.flow +0 -2
- package/docs.md +0 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @khanacademy/wonder-blocks-icon-button
|
|
2
2
|
|
|
3
|
+
## 3.4.17
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [b561425a]
|
|
8
|
+
- Updated dependencies [a566e232]
|
|
9
|
+
- Updated dependencies [d2b21a6e]
|
|
10
|
+
- @khanacademy/wonder-blocks-core@4.6.0
|
|
11
|
+
- @khanacademy/wonder-blocks-clickable@2.4.2
|
|
12
|
+
- @khanacademy/wonder-blocks-icon@1.2.33
|
|
13
|
+
|
|
14
|
+
## 3.4.16
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- Updated dependencies [4c682709]
|
|
19
|
+
- @khanacademy/wonder-blocks-clickable@2.4.1
|
|
20
|
+
|
|
3
21
|
## 3.4.15
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@khanacademy/wonder-blocks-icon-button",
|
|
3
|
-
"version": "3.4.
|
|
3
|
+
"version": "3.4.17",
|
|
4
4
|
"design": "v1",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -16,10 +16,10 @@
|
|
|
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.2",
|
|
20
20
|
"@khanacademy/wonder-blocks-color": "^1.2.0",
|
|
21
|
-
"@khanacademy/wonder-blocks-core": "^4.
|
|
22
|
-
"@khanacademy/wonder-blocks-icon": "^1.2.
|
|
21
|
+
"@khanacademy/wonder-blocks-core": "^4.6.0",
|
|
22
|
+
"@khanacademy/wonder-blocks-icon": "^1.2.33"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"aphrodite": "^1.2.5",
|
|
@@ -28,6 +28,6 @@
|
|
|
28
28
|
"react-router-dom": "5.3.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"wb-dev-build-settings": "^0.
|
|
31
|
+
"wb-dev-build-settings": "^0.5.0"
|
|
32
32
|
}
|
|
33
33
|
}
|
|
@@ -7,7 +7,6 @@ exports[`IconButtonCore kind:primary color:default size:default light:false disa
|
|
|
7
7
|
disabled={true}
|
|
8
8
|
onBlur={[Function]}
|
|
9
9
|
onClick={[Function]}
|
|
10
|
-
onDragStart={[Function]}
|
|
11
10
|
onFocus={[Function]}
|
|
12
11
|
onKeyDown={[Function]}
|
|
13
12
|
onKeyUp={[Function]}
|
|
@@ -76,7 +75,6 @@ exports[`IconButtonCore kind:primary color:default size:default light:false focu
|
|
|
76
75
|
disabled={false}
|
|
77
76
|
onBlur={[Function]}
|
|
78
77
|
onClick={[Function]}
|
|
79
|
-
onDragStart={[Function]}
|
|
80
78
|
onFocus={[Function]}
|
|
81
79
|
onKeyDown={[Function]}
|
|
82
80
|
onKeyUp={[Function]}
|
|
@@ -149,7 +147,6 @@ exports[`IconButtonCore kind:primary color:default size:default light:false hove
|
|
|
149
147
|
disabled={false}
|
|
150
148
|
onBlur={[Function]}
|
|
151
149
|
onClick={[Function]}
|
|
152
|
-
onDragStart={[Function]}
|
|
153
150
|
onFocus={[Function]}
|
|
154
151
|
onKeyDown={[Function]}
|
|
155
152
|
onKeyUp={[Function]}
|
|
@@ -222,7 +219,6 @@ exports[`IconButtonCore kind:primary color:default size:default light:false pres
|
|
|
222
219
|
disabled={false}
|
|
223
220
|
onBlur={[Function]}
|
|
224
221
|
onClick={[Function]}
|
|
225
|
-
onDragStart={[Function]}
|
|
226
222
|
onFocus={[Function]}
|
|
227
223
|
onKeyDown={[Function]}
|
|
228
224
|
onKeyUp={[Function]}
|
|
@@ -295,7 +291,6 @@ exports[`IconButtonCore kind:primary color:default size:default light:true disab
|
|
|
295
291
|
disabled={true}
|
|
296
292
|
onBlur={[Function]}
|
|
297
293
|
onClick={[Function]}
|
|
298
|
-
onDragStart={[Function]}
|
|
299
294
|
onFocus={[Function]}
|
|
300
295
|
onKeyDown={[Function]}
|
|
301
296
|
onKeyUp={[Function]}
|
|
@@ -364,7 +359,6 @@ exports[`IconButtonCore kind:primary color:default size:default light:true focus
|
|
|
364
359
|
disabled={false}
|
|
365
360
|
onBlur={[Function]}
|
|
366
361
|
onClick={[Function]}
|
|
367
|
-
onDragStart={[Function]}
|
|
368
362
|
onFocus={[Function]}
|
|
369
363
|
onKeyDown={[Function]}
|
|
370
364
|
onKeyUp={[Function]}
|
|
@@ -437,7 +431,6 @@ exports[`IconButtonCore kind:primary color:default size:default light:true hover
|
|
|
437
431
|
disabled={false}
|
|
438
432
|
onBlur={[Function]}
|
|
439
433
|
onClick={[Function]}
|
|
440
|
-
onDragStart={[Function]}
|
|
441
434
|
onFocus={[Function]}
|
|
442
435
|
onKeyDown={[Function]}
|
|
443
436
|
onKeyUp={[Function]}
|
|
@@ -510,7 +503,6 @@ exports[`IconButtonCore kind:primary color:default size:default light:true press
|
|
|
510
503
|
disabled={false}
|
|
511
504
|
onBlur={[Function]}
|
|
512
505
|
onClick={[Function]}
|
|
513
|
-
onDragStart={[Function]}
|
|
514
506
|
onFocus={[Function]}
|
|
515
507
|
onKeyDown={[Function]}
|
|
516
508
|
onKeyUp={[Function]}
|
|
@@ -583,7 +575,6 @@ exports[`IconButtonCore kind:primary color:default size:small light:false disabl
|
|
|
583
575
|
disabled={true}
|
|
584
576
|
onBlur={[Function]}
|
|
585
577
|
onClick={[Function]}
|
|
586
|
-
onDragStart={[Function]}
|
|
587
578
|
onFocus={[Function]}
|
|
588
579
|
onKeyDown={[Function]}
|
|
589
580
|
onKeyUp={[Function]}
|
|
@@ -652,7 +643,6 @@ exports[`IconButtonCore kind:primary color:default size:small light:false focuse
|
|
|
652
643
|
disabled={false}
|
|
653
644
|
onBlur={[Function]}
|
|
654
645
|
onClick={[Function]}
|
|
655
|
-
onDragStart={[Function]}
|
|
656
646
|
onFocus={[Function]}
|
|
657
647
|
onKeyDown={[Function]}
|
|
658
648
|
onKeyUp={[Function]}
|
|
@@ -725,7 +715,6 @@ exports[`IconButtonCore kind:primary color:default size:small light:false hovere
|
|
|
725
715
|
disabled={false}
|
|
726
716
|
onBlur={[Function]}
|
|
727
717
|
onClick={[Function]}
|
|
728
|
-
onDragStart={[Function]}
|
|
729
718
|
onFocus={[Function]}
|
|
730
719
|
onKeyDown={[Function]}
|
|
731
720
|
onKeyUp={[Function]}
|
|
@@ -798,7 +787,6 @@ exports[`IconButtonCore kind:primary color:default size:small light:false presse
|
|
|
798
787
|
disabled={false}
|
|
799
788
|
onBlur={[Function]}
|
|
800
789
|
onClick={[Function]}
|
|
801
|
-
onDragStart={[Function]}
|
|
802
790
|
onFocus={[Function]}
|
|
803
791
|
onKeyDown={[Function]}
|
|
804
792
|
onKeyUp={[Function]}
|
|
@@ -871,7 +859,6 @@ exports[`IconButtonCore kind:primary color:default size:small light:true disable
|
|
|
871
859
|
disabled={true}
|
|
872
860
|
onBlur={[Function]}
|
|
873
861
|
onClick={[Function]}
|
|
874
|
-
onDragStart={[Function]}
|
|
875
862
|
onFocus={[Function]}
|
|
876
863
|
onKeyDown={[Function]}
|
|
877
864
|
onKeyUp={[Function]}
|
|
@@ -940,7 +927,6 @@ exports[`IconButtonCore kind:primary color:default size:small light:true focused
|
|
|
940
927
|
disabled={false}
|
|
941
928
|
onBlur={[Function]}
|
|
942
929
|
onClick={[Function]}
|
|
943
|
-
onDragStart={[Function]}
|
|
944
930
|
onFocus={[Function]}
|
|
945
931
|
onKeyDown={[Function]}
|
|
946
932
|
onKeyUp={[Function]}
|
|
@@ -1013,7 +999,6 @@ exports[`IconButtonCore kind:primary color:default size:small light:true hovered
|
|
|
1013
999
|
disabled={false}
|
|
1014
1000
|
onBlur={[Function]}
|
|
1015
1001
|
onClick={[Function]}
|
|
1016
|
-
onDragStart={[Function]}
|
|
1017
1002
|
onFocus={[Function]}
|
|
1018
1003
|
onKeyDown={[Function]}
|
|
1019
1004
|
onKeyUp={[Function]}
|
|
@@ -1086,7 +1071,6 @@ exports[`IconButtonCore kind:primary color:default size:small light:true pressed
|
|
|
1086
1071
|
disabled={false}
|
|
1087
1072
|
onBlur={[Function]}
|
|
1088
1073
|
onClick={[Function]}
|
|
1089
|
-
onDragStart={[Function]}
|
|
1090
1074
|
onFocus={[Function]}
|
|
1091
1075
|
onKeyDown={[Function]}
|
|
1092
1076
|
onKeyUp={[Function]}
|
|
@@ -1159,7 +1143,6 @@ exports[`IconButtonCore kind:primary color:destructive size:default light:false
|
|
|
1159
1143
|
disabled={true}
|
|
1160
1144
|
onBlur={[Function]}
|
|
1161
1145
|
onClick={[Function]}
|
|
1162
|
-
onDragStart={[Function]}
|
|
1163
1146
|
onFocus={[Function]}
|
|
1164
1147
|
onKeyDown={[Function]}
|
|
1165
1148
|
onKeyUp={[Function]}
|
|
@@ -1228,7 +1211,6 @@ exports[`IconButtonCore kind:primary color:destructive size:default light:false
|
|
|
1228
1211
|
disabled={false}
|
|
1229
1212
|
onBlur={[Function]}
|
|
1230
1213
|
onClick={[Function]}
|
|
1231
|
-
onDragStart={[Function]}
|
|
1232
1214
|
onFocus={[Function]}
|
|
1233
1215
|
onKeyDown={[Function]}
|
|
1234
1216
|
onKeyUp={[Function]}
|
|
@@ -1301,7 +1283,6 @@ exports[`IconButtonCore kind:primary color:destructive size:default light:false
|
|
|
1301
1283
|
disabled={false}
|
|
1302
1284
|
onBlur={[Function]}
|
|
1303
1285
|
onClick={[Function]}
|
|
1304
|
-
onDragStart={[Function]}
|
|
1305
1286
|
onFocus={[Function]}
|
|
1306
1287
|
onKeyDown={[Function]}
|
|
1307
1288
|
onKeyUp={[Function]}
|
|
@@ -1374,7 +1355,6 @@ exports[`IconButtonCore kind:primary color:destructive size:default light:false
|
|
|
1374
1355
|
disabled={false}
|
|
1375
1356
|
onBlur={[Function]}
|
|
1376
1357
|
onClick={[Function]}
|
|
1377
|
-
onDragStart={[Function]}
|
|
1378
1358
|
onFocus={[Function]}
|
|
1379
1359
|
onKeyDown={[Function]}
|
|
1380
1360
|
onKeyUp={[Function]}
|
|
@@ -1447,7 +1427,6 @@ exports[`IconButtonCore kind:primary color:destructive size:default light:true d
|
|
|
1447
1427
|
disabled={true}
|
|
1448
1428
|
onBlur={[Function]}
|
|
1449
1429
|
onClick={[Function]}
|
|
1450
|
-
onDragStart={[Function]}
|
|
1451
1430
|
onFocus={[Function]}
|
|
1452
1431
|
onKeyDown={[Function]}
|
|
1453
1432
|
onKeyUp={[Function]}
|
|
@@ -1516,7 +1495,6 @@ exports[`IconButtonCore kind:primary color:destructive size:default light:true f
|
|
|
1516
1495
|
disabled={false}
|
|
1517
1496
|
onBlur={[Function]}
|
|
1518
1497
|
onClick={[Function]}
|
|
1519
|
-
onDragStart={[Function]}
|
|
1520
1498
|
onFocus={[Function]}
|
|
1521
1499
|
onKeyDown={[Function]}
|
|
1522
1500
|
onKeyUp={[Function]}
|
|
@@ -1589,7 +1567,6 @@ exports[`IconButtonCore kind:primary color:destructive size:default light:true h
|
|
|
1589
1567
|
disabled={false}
|
|
1590
1568
|
onBlur={[Function]}
|
|
1591
1569
|
onClick={[Function]}
|
|
1592
|
-
onDragStart={[Function]}
|
|
1593
1570
|
onFocus={[Function]}
|
|
1594
1571
|
onKeyDown={[Function]}
|
|
1595
1572
|
onKeyUp={[Function]}
|
|
@@ -1662,7 +1639,6 @@ exports[`IconButtonCore kind:primary color:destructive size:default light:true p
|
|
|
1662
1639
|
disabled={false}
|
|
1663
1640
|
onBlur={[Function]}
|
|
1664
1641
|
onClick={[Function]}
|
|
1665
|
-
onDragStart={[Function]}
|
|
1666
1642
|
onFocus={[Function]}
|
|
1667
1643
|
onKeyDown={[Function]}
|
|
1668
1644
|
onKeyUp={[Function]}
|
|
@@ -1735,7 +1711,6 @@ exports[`IconButtonCore kind:primary color:destructive size:small light:false di
|
|
|
1735
1711
|
disabled={true}
|
|
1736
1712
|
onBlur={[Function]}
|
|
1737
1713
|
onClick={[Function]}
|
|
1738
|
-
onDragStart={[Function]}
|
|
1739
1714
|
onFocus={[Function]}
|
|
1740
1715
|
onKeyDown={[Function]}
|
|
1741
1716
|
onKeyUp={[Function]}
|
|
@@ -1804,7 +1779,6 @@ exports[`IconButtonCore kind:primary color:destructive size:small light:false fo
|
|
|
1804
1779
|
disabled={false}
|
|
1805
1780
|
onBlur={[Function]}
|
|
1806
1781
|
onClick={[Function]}
|
|
1807
|
-
onDragStart={[Function]}
|
|
1808
1782
|
onFocus={[Function]}
|
|
1809
1783
|
onKeyDown={[Function]}
|
|
1810
1784
|
onKeyUp={[Function]}
|
|
@@ -1877,7 +1851,6 @@ exports[`IconButtonCore kind:primary color:destructive size:small light:false ho
|
|
|
1877
1851
|
disabled={false}
|
|
1878
1852
|
onBlur={[Function]}
|
|
1879
1853
|
onClick={[Function]}
|
|
1880
|
-
onDragStart={[Function]}
|
|
1881
1854
|
onFocus={[Function]}
|
|
1882
1855
|
onKeyDown={[Function]}
|
|
1883
1856
|
onKeyUp={[Function]}
|
|
@@ -1950,7 +1923,6 @@ exports[`IconButtonCore kind:primary color:destructive size:small light:false pr
|
|
|
1950
1923
|
disabled={false}
|
|
1951
1924
|
onBlur={[Function]}
|
|
1952
1925
|
onClick={[Function]}
|
|
1953
|
-
onDragStart={[Function]}
|
|
1954
1926
|
onFocus={[Function]}
|
|
1955
1927
|
onKeyDown={[Function]}
|
|
1956
1928
|
onKeyUp={[Function]}
|
|
@@ -2023,7 +1995,6 @@ exports[`IconButtonCore kind:primary color:destructive size:small light:true dis
|
|
|
2023
1995
|
disabled={true}
|
|
2024
1996
|
onBlur={[Function]}
|
|
2025
1997
|
onClick={[Function]}
|
|
2026
|
-
onDragStart={[Function]}
|
|
2027
1998
|
onFocus={[Function]}
|
|
2028
1999
|
onKeyDown={[Function]}
|
|
2029
2000
|
onKeyUp={[Function]}
|
|
@@ -2092,7 +2063,6 @@ exports[`IconButtonCore kind:primary color:destructive size:small light:true foc
|
|
|
2092
2063
|
disabled={false}
|
|
2093
2064
|
onBlur={[Function]}
|
|
2094
2065
|
onClick={[Function]}
|
|
2095
|
-
onDragStart={[Function]}
|
|
2096
2066
|
onFocus={[Function]}
|
|
2097
2067
|
onKeyDown={[Function]}
|
|
2098
2068
|
onKeyUp={[Function]}
|
|
@@ -2165,7 +2135,6 @@ exports[`IconButtonCore kind:primary color:destructive size:small light:true hov
|
|
|
2165
2135
|
disabled={false}
|
|
2166
2136
|
onBlur={[Function]}
|
|
2167
2137
|
onClick={[Function]}
|
|
2168
|
-
onDragStart={[Function]}
|
|
2169
2138
|
onFocus={[Function]}
|
|
2170
2139
|
onKeyDown={[Function]}
|
|
2171
2140
|
onKeyUp={[Function]}
|
|
@@ -2238,7 +2207,6 @@ exports[`IconButtonCore kind:primary color:destructive size:small light:true pre
|
|
|
2238
2207
|
disabled={false}
|
|
2239
2208
|
onBlur={[Function]}
|
|
2240
2209
|
onClick={[Function]}
|
|
2241
|
-
onDragStart={[Function]}
|
|
2242
2210
|
onFocus={[Function]}
|
|
2243
2211
|
onKeyDown={[Function]}
|
|
2244
2212
|
onKeyUp={[Function]}
|
|
@@ -2311,7 +2279,6 @@ exports[`IconButtonCore kind:secondary color:default size:default light:false di
|
|
|
2311
2279
|
disabled={true}
|
|
2312
2280
|
onBlur={[Function]}
|
|
2313
2281
|
onClick={[Function]}
|
|
2314
|
-
onDragStart={[Function]}
|
|
2315
2282
|
onFocus={[Function]}
|
|
2316
2283
|
onKeyDown={[Function]}
|
|
2317
2284
|
onKeyUp={[Function]}
|
|
@@ -2380,7 +2347,6 @@ exports[`IconButtonCore kind:secondary color:default size:default light:false fo
|
|
|
2380
2347
|
disabled={false}
|
|
2381
2348
|
onBlur={[Function]}
|
|
2382
2349
|
onClick={[Function]}
|
|
2383
|
-
onDragStart={[Function]}
|
|
2384
2350
|
onFocus={[Function]}
|
|
2385
2351
|
onKeyDown={[Function]}
|
|
2386
2352
|
onKeyUp={[Function]}
|
|
@@ -2453,7 +2419,6 @@ exports[`IconButtonCore kind:secondary color:default size:default light:false ho
|
|
|
2453
2419
|
disabled={false}
|
|
2454
2420
|
onBlur={[Function]}
|
|
2455
2421
|
onClick={[Function]}
|
|
2456
|
-
onDragStart={[Function]}
|
|
2457
2422
|
onFocus={[Function]}
|
|
2458
2423
|
onKeyDown={[Function]}
|
|
2459
2424
|
onKeyUp={[Function]}
|
|
@@ -2526,7 +2491,6 @@ exports[`IconButtonCore kind:secondary color:default size:default light:false pr
|
|
|
2526
2491
|
disabled={false}
|
|
2527
2492
|
onBlur={[Function]}
|
|
2528
2493
|
onClick={[Function]}
|
|
2529
|
-
onDragStart={[Function]}
|
|
2530
2494
|
onFocus={[Function]}
|
|
2531
2495
|
onKeyDown={[Function]}
|
|
2532
2496
|
onKeyUp={[Function]}
|
|
@@ -2599,7 +2563,6 @@ exports[`IconButtonCore kind:secondary color:default size:small light:false disa
|
|
|
2599
2563
|
disabled={true}
|
|
2600
2564
|
onBlur={[Function]}
|
|
2601
2565
|
onClick={[Function]}
|
|
2602
|
-
onDragStart={[Function]}
|
|
2603
2566
|
onFocus={[Function]}
|
|
2604
2567
|
onKeyDown={[Function]}
|
|
2605
2568
|
onKeyUp={[Function]}
|
|
@@ -2668,7 +2631,6 @@ exports[`IconButtonCore kind:secondary color:default size:small light:false focu
|
|
|
2668
2631
|
disabled={false}
|
|
2669
2632
|
onBlur={[Function]}
|
|
2670
2633
|
onClick={[Function]}
|
|
2671
|
-
onDragStart={[Function]}
|
|
2672
2634
|
onFocus={[Function]}
|
|
2673
2635
|
onKeyDown={[Function]}
|
|
2674
2636
|
onKeyUp={[Function]}
|
|
@@ -2741,7 +2703,6 @@ exports[`IconButtonCore kind:secondary color:default size:small light:false hove
|
|
|
2741
2703
|
disabled={false}
|
|
2742
2704
|
onBlur={[Function]}
|
|
2743
2705
|
onClick={[Function]}
|
|
2744
|
-
onDragStart={[Function]}
|
|
2745
2706
|
onFocus={[Function]}
|
|
2746
2707
|
onKeyDown={[Function]}
|
|
2747
2708
|
onKeyUp={[Function]}
|
|
@@ -2814,7 +2775,6 @@ exports[`IconButtonCore kind:secondary color:default size:small light:false pres
|
|
|
2814
2775
|
disabled={false}
|
|
2815
2776
|
onBlur={[Function]}
|
|
2816
2777
|
onClick={[Function]}
|
|
2817
|
-
onDragStart={[Function]}
|
|
2818
2778
|
onFocus={[Function]}
|
|
2819
2779
|
onKeyDown={[Function]}
|
|
2820
2780
|
onKeyUp={[Function]}
|
|
@@ -2887,7 +2847,6 @@ exports[`IconButtonCore kind:secondary color:destructive size:default light:fals
|
|
|
2887
2847
|
disabled={true}
|
|
2888
2848
|
onBlur={[Function]}
|
|
2889
2849
|
onClick={[Function]}
|
|
2890
|
-
onDragStart={[Function]}
|
|
2891
2850
|
onFocus={[Function]}
|
|
2892
2851
|
onKeyDown={[Function]}
|
|
2893
2852
|
onKeyUp={[Function]}
|
|
@@ -2956,7 +2915,6 @@ exports[`IconButtonCore kind:secondary color:destructive size:default light:fals
|
|
|
2956
2915
|
disabled={false}
|
|
2957
2916
|
onBlur={[Function]}
|
|
2958
2917
|
onClick={[Function]}
|
|
2959
|
-
onDragStart={[Function]}
|
|
2960
2918
|
onFocus={[Function]}
|
|
2961
2919
|
onKeyDown={[Function]}
|
|
2962
2920
|
onKeyUp={[Function]}
|
|
@@ -3029,7 +2987,6 @@ exports[`IconButtonCore kind:secondary color:destructive size:default light:fals
|
|
|
3029
2987
|
disabled={false}
|
|
3030
2988
|
onBlur={[Function]}
|
|
3031
2989
|
onClick={[Function]}
|
|
3032
|
-
onDragStart={[Function]}
|
|
3033
2990
|
onFocus={[Function]}
|
|
3034
2991
|
onKeyDown={[Function]}
|
|
3035
2992
|
onKeyUp={[Function]}
|
|
@@ -3102,7 +3059,6 @@ exports[`IconButtonCore kind:secondary color:destructive size:default light:fals
|
|
|
3102
3059
|
disabled={false}
|
|
3103
3060
|
onBlur={[Function]}
|
|
3104
3061
|
onClick={[Function]}
|
|
3105
|
-
onDragStart={[Function]}
|
|
3106
3062
|
onFocus={[Function]}
|
|
3107
3063
|
onKeyDown={[Function]}
|
|
3108
3064
|
onKeyUp={[Function]}
|
|
@@ -3175,7 +3131,6 @@ exports[`IconButtonCore kind:secondary color:destructive size:small light:false
|
|
|
3175
3131
|
disabled={true}
|
|
3176
3132
|
onBlur={[Function]}
|
|
3177
3133
|
onClick={[Function]}
|
|
3178
|
-
onDragStart={[Function]}
|
|
3179
3134
|
onFocus={[Function]}
|
|
3180
3135
|
onKeyDown={[Function]}
|
|
3181
3136
|
onKeyUp={[Function]}
|
|
@@ -3244,7 +3199,6 @@ exports[`IconButtonCore kind:secondary color:destructive size:small light:false
|
|
|
3244
3199
|
disabled={false}
|
|
3245
3200
|
onBlur={[Function]}
|
|
3246
3201
|
onClick={[Function]}
|
|
3247
|
-
onDragStart={[Function]}
|
|
3248
3202
|
onFocus={[Function]}
|
|
3249
3203
|
onKeyDown={[Function]}
|
|
3250
3204
|
onKeyUp={[Function]}
|
|
@@ -3317,7 +3271,6 @@ exports[`IconButtonCore kind:secondary color:destructive size:small light:false
|
|
|
3317
3271
|
disabled={false}
|
|
3318
3272
|
onBlur={[Function]}
|
|
3319
3273
|
onClick={[Function]}
|
|
3320
|
-
onDragStart={[Function]}
|
|
3321
3274
|
onFocus={[Function]}
|
|
3322
3275
|
onKeyDown={[Function]}
|
|
3323
3276
|
onKeyUp={[Function]}
|
|
@@ -3390,7 +3343,6 @@ exports[`IconButtonCore kind:secondary color:destructive size:small light:false
|
|
|
3390
3343
|
disabled={false}
|
|
3391
3344
|
onBlur={[Function]}
|
|
3392
3345
|
onClick={[Function]}
|
|
3393
|
-
onDragStart={[Function]}
|
|
3394
3346
|
onFocus={[Function]}
|
|
3395
3347
|
onKeyDown={[Function]}
|
|
3396
3348
|
onKeyUp={[Function]}
|
|
@@ -3463,7 +3415,6 @@ exports[`IconButtonCore kind:tertiary color:default size:default light:false dis
|
|
|
3463
3415
|
disabled={true}
|
|
3464
3416
|
onBlur={[Function]}
|
|
3465
3417
|
onClick={[Function]}
|
|
3466
|
-
onDragStart={[Function]}
|
|
3467
3418
|
onFocus={[Function]}
|
|
3468
3419
|
onKeyDown={[Function]}
|
|
3469
3420
|
onKeyUp={[Function]}
|
|
@@ -3532,7 +3483,6 @@ exports[`IconButtonCore kind:tertiary color:default size:default light:false foc
|
|
|
3532
3483
|
disabled={false}
|
|
3533
3484
|
onBlur={[Function]}
|
|
3534
3485
|
onClick={[Function]}
|
|
3535
|
-
onDragStart={[Function]}
|
|
3536
3486
|
onFocus={[Function]}
|
|
3537
3487
|
onKeyDown={[Function]}
|
|
3538
3488
|
onKeyUp={[Function]}
|
|
@@ -3605,7 +3555,6 @@ exports[`IconButtonCore kind:tertiary color:default size:default light:false hov
|
|
|
3605
3555
|
disabled={false}
|
|
3606
3556
|
onBlur={[Function]}
|
|
3607
3557
|
onClick={[Function]}
|
|
3608
|
-
onDragStart={[Function]}
|
|
3609
3558
|
onFocus={[Function]}
|
|
3610
3559
|
onKeyDown={[Function]}
|
|
3611
3560
|
onKeyUp={[Function]}
|
|
@@ -3678,7 +3627,6 @@ exports[`IconButtonCore kind:tertiary color:default size:default light:false pre
|
|
|
3678
3627
|
disabled={false}
|
|
3679
3628
|
onBlur={[Function]}
|
|
3680
3629
|
onClick={[Function]}
|
|
3681
|
-
onDragStart={[Function]}
|
|
3682
3630
|
onFocus={[Function]}
|
|
3683
3631
|
onKeyDown={[Function]}
|
|
3684
3632
|
onKeyUp={[Function]}
|
|
@@ -3751,7 +3699,6 @@ exports[`IconButtonCore kind:tertiary color:default size:small light:false disab
|
|
|
3751
3699
|
disabled={true}
|
|
3752
3700
|
onBlur={[Function]}
|
|
3753
3701
|
onClick={[Function]}
|
|
3754
|
-
onDragStart={[Function]}
|
|
3755
3702
|
onFocus={[Function]}
|
|
3756
3703
|
onKeyDown={[Function]}
|
|
3757
3704
|
onKeyUp={[Function]}
|
|
@@ -3820,7 +3767,6 @@ exports[`IconButtonCore kind:tertiary color:default size:small light:false focus
|
|
|
3820
3767
|
disabled={false}
|
|
3821
3768
|
onBlur={[Function]}
|
|
3822
3769
|
onClick={[Function]}
|
|
3823
|
-
onDragStart={[Function]}
|
|
3824
3770
|
onFocus={[Function]}
|
|
3825
3771
|
onKeyDown={[Function]}
|
|
3826
3772
|
onKeyUp={[Function]}
|
|
@@ -3893,7 +3839,6 @@ exports[`IconButtonCore kind:tertiary color:default size:small light:false hover
|
|
|
3893
3839
|
disabled={false}
|
|
3894
3840
|
onBlur={[Function]}
|
|
3895
3841
|
onClick={[Function]}
|
|
3896
|
-
onDragStart={[Function]}
|
|
3897
3842
|
onFocus={[Function]}
|
|
3898
3843
|
onKeyDown={[Function]}
|
|
3899
3844
|
onKeyUp={[Function]}
|
|
@@ -3966,7 +3911,6 @@ exports[`IconButtonCore kind:tertiary color:default size:small light:false press
|
|
|
3966
3911
|
disabled={false}
|
|
3967
3912
|
onBlur={[Function]}
|
|
3968
3913
|
onClick={[Function]}
|
|
3969
|
-
onDragStart={[Function]}
|
|
3970
3914
|
onFocus={[Function]}
|
|
3971
3915
|
onKeyDown={[Function]}
|
|
3972
3916
|
onKeyUp={[Function]}
|
|
@@ -4039,7 +3983,6 @@ exports[`IconButtonCore kind:tertiary color:destructive size:default light:false
|
|
|
4039
3983
|
disabled={true}
|
|
4040
3984
|
onBlur={[Function]}
|
|
4041
3985
|
onClick={[Function]}
|
|
4042
|
-
onDragStart={[Function]}
|
|
4043
3986
|
onFocus={[Function]}
|
|
4044
3987
|
onKeyDown={[Function]}
|
|
4045
3988
|
onKeyUp={[Function]}
|
|
@@ -4108,7 +4051,6 @@ exports[`IconButtonCore kind:tertiary color:destructive size:default light:false
|
|
|
4108
4051
|
disabled={false}
|
|
4109
4052
|
onBlur={[Function]}
|
|
4110
4053
|
onClick={[Function]}
|
|
4111
|
-
onDragStart={[Function]}
|
|
4112
4054
|
onFocus={[Function]}
|
|
4113
4055
|
onKeyDown={[Function]}
|
|
4114
4056
|
onKeyUp={[Function]}
|
|
@@ -4181,7 +4123,6 @@ exports[`IconButtonCore kind:tertiary color:destructive size:default light:false
|
|
|
4181
4123
|
disabled={false}
|
|
4182
4124
|
onBlur={[Function]}
|
|
4183
4125
|
onClick={[Function]}
|
|
4184
|
-
onDragStart={[Function]}
|
|
4185
4126
|
onFocus={[Function]}
|
|
4186
4127
|
onKeyDown={[Function]}
|
|
4187
4128
|
onKeyUp={[Function]}
|
|
@@ -4254,7 +4195,6 @@ exports[`IconButtonCore kind:tertiary color:destructive size:default light:false
|
|
|
4254
4195
|
disabled={false}
|
|
4255
4196
|
onBlur={[Function]}
|
|
4256
4197
|
onClick={[Function]}
|
|
4257
|
-
onDragStart={[Function]}
|
|
4258
4198
|
onFocus={[Function]}
|
|
4259
4199
|
onKeyDown={[Function]}
|
|
4260
4200
|
onKeyUp={[Function]}
|
|
@@ -4327,7 +4267,6 @@ exports[`IconButtonCore kind:tertiary color:destructive size:small light:false d
|
|
|
4327
4267
|
disabled={true}
|
|
4328
4268
|
onBlur={[Function]}
|
|
4329
4269
|
onClick={[Function]}
|
|
4330
|
-
onDragStart={[Function]}
|
|
4331
4270
|
onFocus={[Function]}
|
|
4332
4271
|
onKeyDown={[Function]}
|
|
4333
4272
|
onKeyUp={[Function]}
|
|
@@ -4396,7 +4335,6 @@ exports[`IconButtonCore kind:tertiary color:destructive size:small light:false f
|
|
|
4396
4335
|
disabled={false}
|
|
4397
4336
|
onBlur={[Function]}
|
|
4398
4337
|
onClick={[Function]}
|
|
4399
|
-
onDragStart={[Function]}
|
|
4400
4338
|
onFocus={[Function]}
|
|
4401
4339
|
onKeyDown={[Function]}
|
|
4402
4340
|
onKeyUp={[Function]}
|
|
@@ -4469,7 +4407,6 @@ exports[`IconButtonCore kind:tertiary color:destructive size:small light:false h
|
|
|
4469
4407
|
disabled={false}
|
|
4470
4408
|
onBlur={[Function]}
|
|
4471
4409
|
onClick={[Function]}
|
|
4472
|
-
onDragStart={[Function]}
|
|
4473
4410
|
onFocus={[Function]}
|
|
4474
4411
|
onKeyDown={[Function]}
|
|
4475
4412
|
onKeyUp={[Function]}
|
|
@@ -4542,7 +4479,6 @@ exports[`IconButtonCore kind:tertiary color:destructive size:small light:false p
|
|
|
4542
4479
|
disabled={false}
|
|
4543
4480
|
onBlur={[Function]}
|
|
4544
4481
|
onClick={[Function]}
|
|
4545
|
-
onDragStart={[Function]}
|
|
4546
4482
|
onFocus={[Function]}
|
|
4547
4483
|
onKeyDown={[Function]}
|
|
4548
4484
|
onKeyUp={[Function]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @flow
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
import {
|
|
4
|
-
import "
|
|
3
|
+
import {render, screen} from "@testing-library/react";
|
|
4
|
+
import userEvent from "@testing-library/user-event";
|
|
5
5
|
|
|
6
6
|
import {MemoryRouter, Route, Switch} from "react-router-dom";
|
|
7
7
|
import {icons} from "@khanacademy/wonder-blocks-icon";
|
|
@@ -21,15 +21,23 @@ describe("IconButton", () => {
|
|
|
21
21
|
window.location = location;
|
|
22
22
|
});
|
|
23
23
|
|
|
24
|
-
test("render an icon", (
|
|
25
|
-
|
|
24
|
+
test("render an icon", () => {
|
|
25
|
+
// Arrange
|
|
26
|
+
|
|
27
|
+
// Act
|
|
28
|
+
render(
|
|
26
29
|
<IconButton
|
|
27
30
|
icon={icons.search}
|
|
28
31
|
aria-label="search"
|
|
29
|
-
onClick={() =>
|
|
32
|
+
onClick={() => {}}
|
|
33
|
+
testId="icon-button"
|
|
30
34
|
/>,
|
|
31
35
|
);
|
|
32
|
-
|
|
36
|
+
|
|
37
|
+
const icon = screen.getByLabelText("search");
|
|
38
|
+
|
|
39
|
+
// Assert
|
|
40
|
+
expect(icon.innerHTML).toEqual(expect.stringContaining("<svg"));
|
|
33
41
|
});
|
|
34
42
|
|
|
35
43
|
test("throw an error for if light and not primary", () => {
|
|
@@ -47,7 +55,7 @@ describe("IconButton", () => {
|
|
|
47
55
|
|
|
48
56
|
test("client-side navigation", () => {
|
|
49
57
|
// Arrange
|
|
50
|
-
|
|
58
|
+
render(
|
|
51
59
|
<MemoryRouter>
|
|
52
60
|
<div>
|
|
53
61
|
<IconButton
|
|
@@ -66,18 +74,15 @@ describe("IconButton", () => {
|
|
|
66
74
|
);
|
|
67
75
|
|
|
68
76
|
// Act
|
|
69
|
-
|
|
70
|
-
.find(`[data-test-id="icon-button"]`)
|
|
71
|
-
.first();
|
|
72
|
-
buttonWrapper.simulate("click", {button: 0});
|
|
77
|
+
userEvent.click(screen.getByRole("link"));
|
|
73
78
|
|
|
74
79
|
// Assert
|
|
75
|
-
expect(
|
|
80
|
+
expect(screen.getByText("Hello, world!")).toBeInTheDocument();
|
|
76
81
|
});
|
|
77
82
|
|
|
78
83
|
test("client-side navigation with unknown URL fails", () => {
|
|
79
84
|
// Arrange
|
|
80
|
-
|
|
85
|
+
render(
|
|
81
86
|
<MemoryRouter>
|
|
82
87
|
<div>
|
|
83
88
|
<IconButton
|
|
@@ -96,18 +101,15 @@ describe("IconButton", () => {
|
|
|
96
101
|
);
|
|
97
102
|
|
|
98
103
|
// Act
|
|
99
|
-
|
|
100
|
-
.find(`[data-test-id="icon-button"]`)
|
|
101
|
-
.first();
|
|
102
|
-
buttonWrapper.simulate("click", {button: 0});
|
|
104
|
+
userEvent.click(screen.getByRole("link"));
|
|
103
105
|
|
|
104
106
|
// Assert
|
|
105
|
-
expect(
|
|
107
|
+
expect(screen.queryByText("Hello, world!")).not.toBeInTheDocument();
|
|
106
108
|
});
|
|
107
109
|
|
|
108
110
|
test("client-side navigation with `skipClientNav` set to `true` fails", () => {
|
|
109
111
|
// Arrange
|
|
110
|
-
|
|
112
|
+
render(
|
|
111
113
|
<MemoryRouter>
|
|
112
114
|
<div>
|
|
113
115
|
<IconButton
|
|
@@ -127,17 +129,14 @@ describe("IconButton", () => {
|
|
|
127
129
|
);
|
|
128
130
|
|
|
129
131
|
// Act
|
|
130
|
-
|
|
131
|
-
.find(`[data-test-id="icon-button"]`)
|
|
132
|
-
.first();
|
|
133
|
-
buttonWrapper.simulate("click", {button: 0});
|
|
132
|
+
userEvent.click(screen.getByRole("link"));
|
|
134
133
|
|
|
135
134
|
// Assert
|
|
136
|
-
expect(
|
|
135
|
+
expect(screen.queryByText("Hello, world!")).not.toBeInTheDocument();
|
|
137
136
|
});
|
|
138
137
|
|
|
139
138
|
test("disallow navigation when href and disabled are both set", () => {
|
|
140
|
-
|
|
139
|
+
render(
|
|
141
140
|
<MemoryRouter>
|
|
142
141
|
<div>
|
|
143
142
|
<IconButton
|
|
@@ -157,12 +156,9 @@ describe("IconButton", () => {
|
|
|
157
156
|
);
|
|
158
157
|
|
|
159
158
|
// Act
|
|
160
|
-
|
|
161
|
-
.find(`[data-test-id="icon-button"]`)
|
|
162
|
-
.first();
|
|
163
|
-
buttonWrapper.simulate("click", {button: 0});
|
|
159
|
+
userEvent.click(screen.getByRole("button"));
|
|
164
160
|
|
|
165
161
|
// Assert
|
|
166
|
-
expect(
|
|
162
|
+
expect(screen.queryByText("Hello, world!")).not.toBeInTheDocument();
|
|
167
163
|
});
|
|
168
164
|
});
|
package/dist/index.js
DELETED
|
@@ -1,449 +0,0 @@
|
|
|
1
|
-
module.exports =
|
|
2
|
-
/******/ (function(modules) { // webpackBootstrap
|
|
3
|
-
/******/ // The module cache
|
|
4
|
-
/******/ var installedModules = {};
|
|
5
|
-
/******/
|
|
6
|
-
/******/ // The require function
|
|
7
|
-
/******/ function __webpack_require__(moduleId) {
|
|
8
|
-
/******/
|
|
9
|
-
/******/ // Check if module is in cache
|
|
10
|
-
/******/ if(installedModules[moduleId]) {
|
|
11
|
-
/******/ return installedModules[moduleId].exports;
|
|
12
|
-
/******/ }
|
|
13
|
-
/******/ // Create a new module (and put it into the cache)
|
|
14
|
-
/******/ var module = installedModules[moduleId] = {
|
|
15
|
-
/******/ i: moduleId,
|
|
16
|
-
/******/ l: false,
|
|
17
|
-
/******/ exports: {}
|
|
18
|
-
/******/ };
|
|
19
|
-
/******/
|
|
20
|
-
/******/ // Execute the module function
|
|
21
|
-
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
|
22
|
-
/******/
|
|
23
|
-
/******/ // Flag the module as loaded
|
|
24
|
-
/******/ module.l = true;
|
|
25
|
-
/******/
|
|
26
|
-
/******/ // Return the exports of the module
|
|
27
|
-
/******/ return module.exports;
|
|
28
|
-
/******/ }
|
|
29
|
-
/******/
|
|
30
|
-
/******/
|
|
31
|
-
/******/ // expose the modules object (__webpack_modules__)
|
|
32
|
-
/******/ __webpack_require__.m = modules;
|
|
33
|
-
/******/
|
|
34
|
-
/******/ // expose the module cache
|
|
35
|
-
/******/ __webpack_require__.c = installedModules;
|
|
36
|
-
/******/
|
|
37
|
-
/******/ // define getter function for harmony exports
|
|
38
|
-
/******/ __webpack_require__.d = function(exports, name, getter) {
|
|
39
|
-
/******/ if(!__webpack_require__.o(exports, name)) {
|
|
40
|
-
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
|
41
|
-
/******/ }
|
|
42
|
-
/******/ };
|
|
43
|
-
/******/
|
|
44
|
-
/******/ // define __esModule on exports
|
|
45
|
-
/******/ __webpack_require__.r = function(exports) {
|
|
46
|
-
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
47
|
-
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
48
|
-
/******/ }
|
|
49
|
-
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
50
|
-
/******/ };
|
|
51
|
-
/******/
|
|
52
|
-
/******/ // create a fake namespace object
|
|
53
|
-
/******/ // mode & 1: value is a module id, require it
|
|
54
|
-
/******/ // mode & 2: merge all properties of value into the ns
|
|
55
|
-
/******/ // mode & 4: return value when already ns object
|
|
56
|
-
/******/ // mode & 8|1: behave like require
|
|
57
|
-
/******/ __webpack_require__.t = function(value, mode) {
|
|
58
|
-
/******/ if(mode & 1) value = __webpack_require__(value);
|
|
59
|
-
/******/ if(mode & 8) return value;
|
|
60
|
-
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
|
61
|
-
/******/ var ns = Object.create(null);
|
|
62
|
-
/******/ __webpack_require__.r(ns);
|
|
63
|
-
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
|
64
|
-
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
|
65
|
-
/******/ return ns;
|
|
66
|
-
/******/ };
|
|
67
|
-
/******/
|
|
68
|
-
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
69
|
-
/******/ __webpack_require__.n = function(module) {
|
|
70
|
-
/******/ var getter = module && module.__esModule ?
|
|
71
|
-
/******/ function getDefault() { return module['default']; } :
|
|
72
|
-
/******/ function getModuleExports() { return module; };
|
|
73
|
-
/******/ __webpack_require__.d(getter, 'a', getter);
|
|
74
|
-
/******/ return getter;
|
|
75
|
-
/******/ };
|
|
76
|
-
/******/
|
|
77
|
-
/******/ // Object.prototype.hasOwnProperty.call
|
|
78
|
-
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
|
79
|
-
/******/
|
|
80
|
-
/******/ // __webpack_public_path__
|
|
81
|
-
/******/ __webpack_require__.p = "";
|
|
82
|
-
/******/
|
|
83
|
-
/******/
|
|
84
|
-
/******/ // Load entry module and return exports
|
|
85
|
-
/******/ return __webpack_require__(__webpack_require__.s = 11);
|
|
86
|
-
/******/ })
|
|
87
|
-
/************************************************************************/
|
|
88
|
-
/******/ ([
|
|
89
|
-
/* 0 */
|
|
90
|
-
/***/ (function(module, exports) {
|
|
91
|
-
|
|
92
|
-
module.exports = require("react");
|
|
93
|
-
|
|
94
|
-
/***/ }),
|
|
95
|
-
/* 1 */
|
|
96
|
-
/***/ (function(module, exports) {
|
|
97
|
-
|
|
98
|
-
module.exports = require("@khanacademy/wonder-blocks-color");
|
|
99
|
-
|
|
100
|
-
/***/ }),
|
|
101
|
-
/* 2 */
|
|
102
|
-
/***/ (function(module, exports) {
|
|
103
|
-
|
|
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;
|
|
122
|
-
|
|
123
|
-
/***/ }),
|
|
124
|
-
/* 3 */
|
|
125
|
-
/***/ (function(module, exports) {
|
|
126
|
-
|
|
127
|
-
module.exports = require("react-router");
|
|
128
|
-
|
|
129
|
-
/***/ }),
|
|
130
|
-
/* 4 */
|
|
131
|
-
/***/ (function(module, exports) {
|
|
132
|
-
|
|
133
|
-
module.exports = require("@khanacademy/wonder-blocks-clickable");
|
|
134
|
-
|
|
135
|
-
/***/ }),
|
|
136
|
-
/* 5 */
|
|
137
|
-
/***/ (function(module, exports) {
|
|
138
|
-
|
|
139
|
-
module.exports = require("@khanacademy/wonder-blocks-core");
|
|
140
|
-
|
|
141
|
-
/***/ }),
|
|
142
|
-
/* 6 */
|
|
143
|
-
/***/ (function(module, exports) {
|
|
144
|
-
|
|
145
|
-
module.exports = require("aphrodite");
|
|
146
|
-
|
|
147
|
-
/***/ }),
|
|
148
|
-
/* 7 */
|
|
149
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
150
|
-
|
|
151
|
-
"use strict";
|
|
152
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return IconButton; });
|
|
153
|
-
/* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
|
|
154
|
-
/* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__);
|
|
155
|
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(0);
|
|
156
|
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
|
|
157
|
-
/* harmony import */ var react_router__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3);
|
|
158
|
-
/* harmony import */ var react_router__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_router__WEBPACK_IMPORTED_MODULE_2__);
|
|
159
|
-
/* harmony import */ var _khanacademy_wonder_blocks_clickable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4);
|
|
160
|
-
/* harmony import */ var _khanacademy_wonder_blocks_clickable__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_khanacademy_wonder_blocks_clickable__WEBPACK_IMPORTED_MODULE_3__);
|
|
161
|
-
/* harmony import */ var _icon_button_core_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(8);
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
/**
|
|
169
|
-
* An IconButton is a button whose contents are an SVG image.
|
|
170
|
-
*
|
|
171
|
-
* To use, supply an onClick function, a wonder-blocks icon asset (see
|
|
172
|
-
* the Icon section) and an aria-label to describe the button functionality.
|
|
173
|
-
* Optionally specify href (URL), clientSideNav, color
|
|
174
|
-
* (Wonder Blocks Blue or Red), kind ("primary", "secondary", or "tertiary"),
|
|
175
|
-
* light (whether the IconButton will be rendered on a dark background),
|
|
176
|
-
* disabled , test ID, and custom styling.
|
|
177
|
-
*
|
|
178
|
-
* The size of an IconButton matches the size of icon it wraps which is 24x24
|
|
179
|
-
* pixels. The focus ring which is displayed on hover and focus is much
|
|
180
|
-
* larger but does not affect its size. This matches the behavior of Button.
|
|
181
|
-
*
|
|
182
|
-
* IconButtons require a certain amount of space between them to ensure the
|
|
183
|
-
* focus rings don't overlap. The minimum amount of spacing is 16px, but
|
|
184
|
-
* you should refer to the mocks provided by design. Using a Strut in between
|
|
185
|
-
* IconButtons is the preferred way to for adding this spacing.
|
|
186
|
-
*
|
|
187
|
-
* Many layouts require alignment of visual left (or right) side of an
|
|
188
|
-
* IconButton. This requires a little bit of pixel nudging since each icon
|
|
189
|
-
* as a different amount of internal padding.
|
|
190
|
-
*
|
|
191
|
-
* See the Toolbar documentation for examples of IconButton use that follow
|
|
192
|
-
* the best practices described above.
|
|
193
|
-
*
|
|
194
|
-
* ```js
|
|
195
|
-
* import {icons} from "@khanacademy/wonder-blocks-icon";
|
|
196
|
-
* import IconButton from "@khanacademy/wonder-blocks-icon-button";
|
|
197
|
-
*
|
|
198
|
-
* <IconButton
|
|
199
|
-
* icon={icons.anIcon}
|
|
200
|
-
* aria-label="An Icon"
|
|
201
|
-
* onClick={(e) => console.log("Hello, world!")}
|
|
202
|
-
* />
|
|
203
|
-
* ```
|
|
204
|
-
*/
|
|
205
|
-
class IconButton extends react__WEBPACK_IMPORTED_MODULE_1__["Component"] {
|
|
206
|
-
renderClickableBehavior(router) {
|
|
207
|
-
const {
|
|
208
|
-
onClick,
|
|
209
|
-
href,
|
|
210
|
-
skipClientNav,
|
|
211
|
-
tabIndex,
|
|
212
|
-
target,
|
|
213
|
-
...sharedProps
|
|
214
|
-
} = this.props;
|
|
215
|
-
const ClickableBehavior = Object(_khanacademy_wonder_blocks_clickable__WEBPACK_IMPORTED_MODULE_3__["getClickableBehavior"])(href, skipClientNav, router);
|
|
216
|
-
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__["createElement"](ClickableBehavior, {
|
|
217
|
-
disabled: sharedProps.disabled,
|
|
218
|
-
href: href,
|
|
219
|
-
onClick: onClick,
|
|
220
|
-
role: "button",
|
|
221
|
-
target: target
|
|
222
|
-
}, (state, { ...childrenProps
|
|
223
|
-
}) => {
|
|
224
|
-
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_icon_button_core_js__WEBPACK_IMPORTED_MODULE_4__[/* default */ "a"], _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, sharedProps, state, childrenProps, {
|
|
225
|
-
skipClientNav: skipClientNav,
|
|
226
|
-
href: href,
|
|
227
|
-
target: target,
|
|
228
|
-
tabIndex: tabIndex
|
|
229
|
-
}));
|
|
230
|
-
});
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
render() {
|
|
234
|
-
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__["createElement"](react_router__WEBPACK_IMPORTED_MODULE_2__["__RouterContext"].Consumer, null, router => this.renderClickableBehavior(router));
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
}
|
|
238
|
-
IconButton.defaultProps = {
|
|
239
|
-
color: "default",
|
|
240
|
-
kind: "primary",
|
|
241
|
-
light: false,
|
|
242
|
-
disabled: false
|
|
243
|
-
};
|
|
244
|
-
|
|
245
|
-
/***/ }),
|
|
246
|
-
/* 8 */
|
|
247
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
248
|
-
|
|
249
|
-
"use strict";
|
|
250
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return IconButtonCore; });
|
|
251
|
-
/* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
|
|
252
|
-
/* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__);
|
|
253
|
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(0);
|
|
254
|
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
|
|
255
|
-
/* harmony import */ var aphrodite__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6);
|
|
256
|
-
/* harmony import */ var aphrodite__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(aphrodite__WEBPACK_IMPORTED_MODULE_2__);
|
|
257
|
-
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9);
|
|
258
|
-
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_router_dom__WEBPACK_IMPORTED_MODULE_3__);
|
|
259
|
-
/* harmony import */ var react_router__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(3);
|
|
260
|
-
/* harmony import */ var react_router__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_router__WEBPACK_IMPORTED_MODULE_4__);
|
|
261
|
-
/* harmony import */ var _khanacademy_wonder_blocks_color__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1);
|
|
262
|
-
/* harmony import */ var _khanacademy_wonder_blocks_color__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_khanacademy_wonder_blocks_color__WEBPACK_IMPORTED_MODULE_5__);
|
|
263
|
-
/* harmony import */ var _khanacademy_wonder_blocks_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(5);
|
|
264
|
-
/* harmony import */ var _khanacademy_wonder_blocks_core__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_khanacademy_wonder_blocks_core__WEBPACK_IMPORTED_MODULE_6__);
|
|
265
|
-
/* harmony import */ var _khanacademy_wonder_blocks_clickable__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(4);
|
|
266
|
-
/* harmony import */ var _khanacademy_wonder_blocks_clickable__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_khanacademy_wonder_blocks_clickable__WEBPACK_IMPORTED_MODULE_7__);
|
|
267
|
-
/* harmony import */ var _khanacademy_wonder_blocks_icon__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(10);
|
|
268
|
-
/* harmony import */ var _khanacademy_wonder_blocks_icon__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_khanacademy_wonder_blocks_icon__WEBPACK_IMPORTED_MODULE_8__);
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
const StyledAnchor = Object(_khanacademy_wonder_blocks_core__WEBPACK_IMPORTED_MODULE_6__["addStyle"])("a");
|
|
279
|
-
const StyledButton = Object(_khanacademy_wonder_blocks_core__WEBPACK_IMPORTED_MODULE_6__["addStyle"])("button");
|
|
280
|
-
const StyledLink = Object(_khanacademy_wonder_blocks_core__WEBPACK_IMPORTED_MODULE_6__["addStyle"])(react_router_dom__WEBPACK_IMPORTED_MODULE_3__["Link"]);
|
|
281
|
-
class IconButtonCore extends react__WEBPACK_IMPORTED_MODULE_1__["Component"] {
|
|
282
|
-
renderInner(router) {
|
|
283
|
-
const {
|
|
284
|
-
skipClientNav,
|
|
285
|
-
color,
|
|
286
|
-
disabled,
|
|
287
|
-
focused,
|
|
288
|
-
hovered,
|
|
289
|
-
href,
|
|
290
|
-
icon,
|
|
291
|
-
kind,
|
|
292
|
-
light,
|
|
293
|
-
pressed,
|
|
294
|
-
style,
|
|
295
|
-
testId,
|
|
296
|
-
waiting: _,
|
|
297
|
-
...restProps
|
|
298
|
-
} = this.props;
|
|
299
|
-
const buttonColor = color === "destructive" ? _khanacademy_wonder_blocks_color__WEBPACK_IMPORTED_MODULE_5__["SemanticColor"].controlDestructive : _khanacademy_wonder_blocks_color__WEBPACK_IMPORTED_MODULE_5__["SemanticColor"].controlDefault;
|
|
300
|
-
|
|
301
|
-
const buttonStyles = _generateStyles(buttonColor, kind, light);
|
|
302
|
-
|
|
303
|
-
const defaultStyle = [sharedStyles.shared, disabled && sharedStyles.disabled, buttonStyles.default, disabled && buttonStyles.disabled, !disabled && (pressed ? buttonStyles.active : (hovered || focused) && buttonStyles.focus)];
|
|
304
|
-
const child = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_khanacademy_wonder_blocks_icon__WEBPACK_IMPORTED_MODULE_8___default.a, {
|
|
305
|
-
size: "medium",
|
|
306
|
-
color: "currentColor",
|
|
307
|
-
icon: icon
|
|
308
|
-
});
|
|
309
|
-
const commonProps = {
|
|
310
|
-
"data-test-id": testId,
|
|
311
|
-
style: [defaultStyle, style],
|
|
312
|
-
...restProps
|
|
313
|
-
};
|
|
314
|
-
|
|
315
|
-
if (href && !disabled) {
|
|
316
|
-
return router && !skipClientNav && Object(_khanacademy_wonder_blocks_clickable__WEBPACK_IMPORTED_MODULE_7__["isClientSideUrl"])(href) ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__["createElement"](StyledLink, _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, commonProps, {
|
|
317
|
-
to: href
|
|
318
|
-
}), child) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__["createElement"](StyledAnchor, _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, commonProps, {
|
|
319
|
-
href: href
|
|
320
|
-
}), child);
|
|
321
|
-
} else {
|
|
322
|
-
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__["createElement"](StyledButton, _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({
|
|
323
|
-
type: "button"
|
|
324
|
-
}, commonProps, {
|
|
325
|
-
disabled: disabled
|
|
326
|
-
}), child);
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
render() {
|
|
331
|
-
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__["createElement"](react_router__WEBPACK_IMPORTED_MODULE_4__["__RouterContext"].Consumer, null, router => this.renderInner(router));
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
}
|
|
335
|
-
const sharedStyles = aphrodite__WEBPACK_IMPORTED_MODULE_2__["StyleSheet"].create({
|
|
336
|
-
shared: {
|
|
337
|
-
position: "relative",
|
|
338
|
-
display: "inline-flex",
|
|
339
|
-
alignItems: "center",
|
|
340
|
-
justifyContent: "center",
|
|
341
|
-
boxSizing: "border-box",
|
|
342
|
-
height: 40,
|
|
343
|
-
width: 40,
|
|
344
|
-
padding: 0,
|
|
345
|
-
cursor: "pointer",
|
|
346
|
-
border: "none",
|
|
347
|
-
outline: "none",
|
|
348
|
-
textDecoration: "none",
|
|
349
|
-
background: "none",
|
|
350
|
-
margin: -8,
|
|
351
|
-
// This removes the 300ms click delay on mobile browsers by indicating that
|
|
352
|
-
// "double-tap to zoom" shouldn't be used on this element.
|
|
353
|
-
touchAction: "manipulation",
|
|
354
|
-
":focus": {
|
|
355
|
-
// Mobile: Removes a blue highlight style shown when the user clicks a button
|
|
356
|
-
WebkitTapHighlightColor: "rgba(0,0,0,0)"
|
|
357
|
-
}
|
|
358
|
-
},
|
|
359
|
-
disabled: {
|
|
360
|
-
cursor: "default"
|
|
361
|
-
}
|
|
362
|
-
});
|
|
363
|
-
const styles = {};
|
|
364
|
-
|
|
365
|
-
const _generateStyles = (color, kind, light) => {
|
|
366
|
-
const buttonType = color + kind + light.toString();
|
|
367
|
-
|
|
368
|
-
if (styles[buttonType]) {
|
|
369
|
-
return styles[buttonType];
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
if (light && kind !== "primary") {
|
|
373
|
-
throw new Error("Light is only supported for primary IconButtons");
|
|
374
|
-
}
|
|
375
|
-
|
|
376
|
-
const {
|
|
377
|
-
white,
|
|
378
|
-
offBlack32,
|
|
379
|
-
offBlack64,
|
|
380
|
-
offBlack
|
|
381
|
-
} = _khanacademy_wonder_blocks_color__WEBPACK_IMPORTED_MODULE_5___default.a;
|
|
382
|
-
const newStyles = {
|
|
383
|
-
default: {},
|
|
384
|
-
focus: {
|
|
385
|
-
color: light ? white : color,
|
|
386
|
-
borderWidth: 2,
|
|
387
|
-
borderColor: light ? white : color,
|
|
388
|
-
borderStyle: "solid",
|
|
389
|
-
borderRadius: 4
|
|
390
|
-
},
|
|
391
|
-
active: {
|
|
392
|
-
color: light ? Object(_khanacademy_wonder_blocks_color__WEBPACK_IMPORTED_MODULE_5__["mix"])(Object(_khanacademy_wonder_blocks_color__WEBPACK_IMPORTED_MODULE_5__["fade"])(color, 0.32), white) : Object(_khanacademy_wonder_blocks_color__WEBPACK_IMPORTED_MODULE_5__["mix"])(offBlack32, color),
|
|
393
|
-
borderWidth: 2,
|
|
394
|
-
borderColor: light ? Object(_khanacademy_wonder_blocks_color__WEBPACK_IMPORTED_MODULE_5__["mix"])(Object(_khanacademy_wonder_blocks_color__WEBPACK_IMPORTED_MODULE_5__["fade"])(color, 0.32), white) : Object(_khanacademy_wonder_blocks_color__WEBPACK_IMPORTED_MODULE_5__["mix"])(offBlack32, color),
|
|
395
|
-
borderStyle: "solid",
|
|
396
|
-
borderRadius: 4
|
|
397
|
-
},
|
|
398
|
-
disabled: {
|
|
399
|
-
color: light ? Object(_khanacademy_wonder_blocks_color__WEBPACK_IMPORTED_MODULE_5__["mix"])(Object(_khanacademy_wonder_blocks_color__WEBPACK_IMPORTED_MODULE_5__["fade"])(white, 0.32), color) : offBlack32,
|
|
400
|
-
cursor: "default"
|
|
401
|
-
}
|
|
402
|
-
};
|
|
403
|
-
|
|
404
|
-
if (kind === "primary") {
|
|
405
|
-
newStyles["default"] = {
|
|
406
|
-
color: light ? white : color
|
|
407
|
-
};
|
|
408
|
-
} else if (kind === "secondary") {
|
|
409
|
-
newStyles["default"] = {
|
|
410
|
-
color: offBlack
|
|
411
|
-
};
|
|
412
|
-
} else if (kind === "tertiary") {
|
|
413
|
-
newStyles["default"] = {
|
|
414
|
-
color: offBlack64
|
|
415
|
-
};
|
|
416
|
-
} else {
|
|
417
|
-
throw new Error("IconButton kind not recognized");
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
styles[buttonType] = aphrodite__WEBPACK_IMPORTED_MODULE_2__["StyleSheet"].create(newStyles);
|
|
421
|
-
return styles[buttonType];
|
|
422
|
-
};
|
|
423
|
-
|
|
424
|
-
/***/ }),
|
|
425
|
-
/* 9 */
|
|
426
|
-
/***/ (function(module, exports) {
|
|
427
|
-
|
|
428
|
-
module.exports = require("react-router-dom");
|
|
429
|
-
|
|
430
|
-
/***/ }),
|
|
431
|
-
/* 10 */
|
|
432
|
-
/***/ (function(module, exports) {
|
|
433
|
-
|
|
434
|
-
module.exports = require("@khanacademy/wonder-blocks-icon");
|
|
435
|
-
|
|
436
|
-
/***/ }),
|
|
437
|
-
/* 11 */
|
|
438
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
439
|
-
|
|
440
|
-
"use strict";
|
|
441
|
-
__webpack_require__.r(__webpack_exports__);
|
|
442
|
-
/* harmony import */ var _components_icon_button_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7);
|
|
443
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _components_icon_button_js__WEBPACK_IMPORTED_MODULE_0__["a"]; });
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
/***/ })
|
|
449
|
-
/******/ ]);
|
package/dist/index.js.flow
DELETED