@khanacademy/wonder-blocks-dropdown 2.6.0 → 2.6.4
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 +46 -8
- package/dist/es/index.js +4 -4
- package/dist/index.js +4 -4
- package/package.json +10 -10
- package/src/__tests__/__snapshots__/generated-snapshot.test.js.snap +25 -25
- package/src/components/multi-select.stories.js +16 -1
- package/src/components/option-item.js +1 -1
- package/src/components/select-opener.js +3 -3
- package/src/components/single-select.stories.js +20 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,16 +1,54 @@
|
|
|
1
1
|
# @khanacademy/wonder-blocks-dropdown
|
|
2
2
|
|
|
3
|
+
## 2.6.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 77e7523c: Update disabled state to match design specs (offWhite bg)
|
|
8
|
+
|
|
9
|
+
## 2.6.3
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 11c87db3: - Added `wonder-blocks-birthday-picker`.
|
|
14
|
+
- Dropdown: Updated some styles from `backgroundColor` to `background` to avoid some warnings on unit tests.
|
|
15
|
+
|
|
16
|
+
## 2.6.2
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- @khanacademy/wonder-blocks-button@2.11.2
|
|
21
|
+
- @khanacademy/wonder-blocks-clickable@2.2.3
|
|
22
|
+
- @khanacademy/wonder-blocks-core@4.2.1
|
|
23
|
+
- @khanacademy/wonder-blocks-icon@1.2.25
|
|
24
|
+
- @khanacademy/wonder-blocks-icon-button@3.4.3
|
|
25
|
+
- @khanacademy/wonder-blocks-layout@1.4.7
|
|
26
|
+
- @khanacademy/wonder-blocks-modal@2.2.1
|
|
27
|
+
- @khanacademy/wonder-blocks-typography@1.1.29
|
|
28
|
+
|
|
29
|
+
## 2.6.1
|
|
30
|
+
|
|
31
|
+
### Patch Changes
|
|
32
|
+
|
|
33
|
+
- Updated dependencies [901bfe82]
|
|
34
|
+
- Updated dependencies [e7bbf149]
|
|
35
|
+
- @khanacademy/wonder-blocks-clickable@2.2.2
|
|
36
|
+
- @khanacademy/wonder-blocks-modal@2.2.0
|
|
37
|
+
- @khanacademy/wonder-blocks-button@2.11.1
|
|
38
|
+
- @khanacademy/wonder-blocks-icon-button@3.4.2
|
|
39
|
+
|
|
3
40
|
## 2.6.0
|
|
41
|
+
|
|
4
42
|
### Minor Changes
|
|
5
43
|
|
|
6
|
-
-
|
|
44
|
+
- 8bccbc9d: Adds `lang` attribute to the `ActionItem` component
|
|
7
45
|
|
|
8
46
|
### Patch Changes
|
|
9
47
|
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
|
|
16
|
-
|
|
48
|
+
- Updated dependencies [029b4810]
|
|
49
|
+
- Updated dependencies [45588e5f]
|
|
50
|
+
- Updated dependencies [c57cd770]
|
|
51
|
+
- Updated dependencies [29766c8e]
|
|
52
|
+
- Updated dependencies [875b7893]
|
|
53
|
+
- @khanacademy/wonder-blocks-timing@2.1.0
|
|
54
|
+
- @khanacademy/wonder-blocks-core@4.1.0
|
package/dist/es/index.js
CHANGED
|
@@ -396,7 +396,7 @@ const {
|
|
|
396
396
|
const styles$6 = StyleSheet.create({
|
|
397
397
|
itemContainer: {
|
|
398
398
|
flexDirection: "row",
|
|
399
|
-
|
|
399
|
+
background: white$1,
|
|
400
400
|
color: offBlack$1,
|
|
401
401
|
alignItems: "center",
|
|
402
402
|
height: DROPDOWN_ITEM_HEIGHT,
|
|
@@ -1978,7 +1978,7 @@ const _generateStyles = (light, placeholder) => {
|
|
|
1978
1978
|
if (light) {
|
|
1979
1979
|
newStyles = {
|
|
1980
1980
|
default: {
|
|
1981
|
-
|
|
1981
|
+
background: "transparent",
|
|
1982
1982
|
color: placeholder ? white50 : white,
|
|
1983
1983
|
borderColor: white50,
|
|
1984
1984
|
borderWidth: 1
|
|
@@ -2006,7 +2006,7 @@ const _generateStyles = (light, placeholder) => {
|
|
|
2006
2006
|
} else {
|
|
2007
2007
|
newStyles = {
|
|
2008
2008
|
default: {
|
|
2009
|
-
|
|
2009
|
+
background: white,
|
|
2010
2010
|
borderColor: offBlack16,
|
|
2011
2011
|
borderWidth: 1,
|
|
2012
2012
|
color: placeholder ? offBlack64 : offBlack
|
|
@@ -2025,7 +2025,7 @@ const _generateStyles = (light, placeholder) => {
|
|
|
2025
2025
|
paddingRight: adjustedPaddingRight
|
|
2026
2026
|
},
|
|
2027
2027
|
disabled: {
|
|
2028
|
-
|
|
2028
|
+
background: Color.offWhite,
|
|
2029
2029
|
borderColor: offBlack16,
|
|
2030
2030
|
color: offBlack64,
|
|
2031
2031
|
cursor: "auto"
|
package/dist/index.js
CHANGED
|
@@ -747,7 +747,7 @@ const {
|
|
|
747
747
|
const styles = aphrodite__WEBPACK_IMPORTED_MODULE_1__["StyleSheet"].create({
|
|
748
748
|
itemContainer: {
|
|
749
749
|
flexDirection: "row",
|
|
750
|
-
|
|
750
|
+
background: white,
|
|
751
751
|
color: offBlack,
|
|
752
752
|
alignItems: "center",
|
|
753
753
|
height: _util_constants_js__WEBPACK_IMPORTED_MODULE_7__[/* DROPDOWN_ITEM_HEIGHT */ "a"],
|
|
@@ -1685,7 +1685,7 @@ const _generateStyles = (light, placeholder) => {
|
|
|
1685
1685
|
if (light) {
|
|
1686
1686
|
newStyles = {
|
|
1687
1687
|
default: {
|
|
1688
|
-
|
|
1688
|
+
background: "transparent",
|
|
1689
1689
|
color: placeholder ? white50 : white,
|
|
1690
1690
|
borderColor: white50,
|
|
1691
1691
|
borderWidth: 1
|
|
@@ -1713,7 +1713,7 @@ const _generateStyles = (light, placeholder) => {
|
|
|
1713
1713
|
} else {
|
|
1714
1714
|
newStyles = {
|
|
1715
1715
|
default: {
|
|
1716
|
-
|
|
1716
|
+
background: white,
|
|
1717
1717
|
borderColor: offBlack16,
|
|
1718
1718
|
borderWidth: 1,
|
|
1719
1719
|
color: placeholder ? offBlack64 : offBlack
|
|
@@ -1732,7 +1732,7 @@ const _generateStyles = (light, placeholder) => {
|
|
|
1732
1732
|
paddingRight: adjustedPaddingRight
|
|
1733
1733
|
},
|
|
1734
1734
|
disabled: {
|
|
1735
|
-
|
|
1735
|
+
background: _khanacademy_wonder_blocks_color__WEBPACK_IMPORTED_MODULE_3___default.a.offWhite,
|
|
1736
1736
|
borderColor: offBlack16,
|
|
1737
1737
|
color: offBlack64,
|
|
1738
1738
|
cursor: "auto"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@khanacademy/wonder-blocks-dropdown",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.4",
|
|
4
4
|
"design": "v1",
|
|
5
5
|
"description": "Dropdown variants for Wonder Blocks.",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -16,17 +16,17 @@
|
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@babel/runtime": "^7.16.3",
|
|
19
|
-
"@khanacademy/wonder-blocks-button": "^2.
|
|
20
|
-
"@khanacademy/wonder-blocks-clickable": "^2.2.
|
|
19
|
+
"@khanacademy/wonder-blocks-button": "^2.11.2",
|
|
20
|
+
"@khanacademy/wonder-blocks-clickable": "^2.2.3",
|
|
21
21
|
"@khanacademy/wonder-blocks-color": "^1.1.20",
|
|
22
|
-
"@khanacademy/wonder-blocks-core": "^4.1
|
|
23
|
-
"@khanacademy/wonder-blocks-icon": "^1.2.
|
|
24
|
-
"@khanacademy/wonder-blocks-icon-button": "^3.4.
|
|
25
|
-
"@khanacademy/wonder-blocks-layout": "^1.4.
|
|
26
|
-
"@khanacademy/wonder-blocks-modal": "^2.1
|
|
22
|
+
"@khanacademy/wonder-blocks-core": "^4.2.1",
|
|
23
|
+
"@khanacademy/wonder-blocks-icon": "^1.2.25",
|
|
24
|
+
"@khanacademy/wonder-blocks-icon-button": "^3.4.3",
|
|
25
|
+
"@khanacademy/wonder-blocks-layout": "^1.4.7",
|
|
26
|
+
"@khanacademy/wonder-blocks-modal": "^2.2.1",
|
|
27
27
|
"@khanacademy/wonder-blocks-spacing": "^3.0.5",
|
|
28
28
|
"@khanacademy/wonder-blocks-timing": "^2.1.0",
|
|
29
|
-
"@khanacademy/wonder-blocks-typography": "^1.1.
|
|
29
|
+
"@khanacademy/wonder-blocks-typography": "^1.1.29"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
32
|
"@popperjs/core": "^2.10.1",
|
|
@@ -39,6 +39,6 @@
|
|
|
39
39
|
"react-window": "^1.8.5"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"wb-dev-build-settings": "^0.
|
|
42
|
+
"wb-dev-build-settings": "^0.3.0"
|
|
43
43
|
}
|
|
44
44
|
}
|
|
@@ -651,7 +651,7 @@ exports[`wonder-blocks-dropdown example 4 1`] = `
|
|
|
651
651
|
"touchAction": "manipulation",
|
|
652
652
|
}
|
|
653
653
|
}
|
|
654
|
-
tabIndex={
|
|
654
|
+
tabIndex={0}
|
|
655
655
|
type="button"
|
|
656
656
|
>
|
|
657
657
|
<div
|
|
@@ -1134,8 +1134,8 @@ exports[`wonder-blocks-dropdown example 6 1`] = `
|
|
|
1134
1134
|
}
|
|
1135
1135
|
/>
|
|
1136
1136
|
<button
|
|
1137
|
+
aria-disabled={false}
|
|
1137
1138
|
className=""
|
|
1138
|
-
disabled={false}
|
|
1139
1139
|
onBlur={[Function]}
|
|
1140
1140
|
onClick={[Function]}
|
|
1141
1141
|
onDragStart={[Function]}
|
|
@@ -1334,7 +1334,7 @@ exports[`wonder-blocks-dropdown example 8 1`] = `
|
|
|
1334
1334
|
"border": 0,
|
|
1335
1335
|
},
|
|
1336
1336
|
"alignItems": "center",
|
|
1337
|
-
"
|
|
1337
|
+
"background": "#ffffff",
|
|
1338
1338
|
"borderColor": "rgba(33,36,44,0.16)",
|
|
1339
1339
|
"borderRadius": 4,
|
|
1340
1340
|
"borderStyle": "solid",
|
|
@@ -1470,7 +1470,7 @@ exports[`wonder-blocks-dropdown example 9 1`] = `
|
|
|
1470
1470
|
"border": 0,
|
|
1471
1471
|
},
|
|
1472
1472
|
"alignItems": "center",
|
|
1473
|
-
"
|
|
1473
|
+
"background": "#ffffff",
|
|
1474
1474
|
"borderColor": "rgba(33,36,44,0.16)",
|
|
1475
1475
|
"borderRadius": 4,
|
|
1476
1476
|
"borderStyle": "solid",
|
|
@@ -1606,7 +1606,7 @@ exports[`wonder-blocks-dropdown example 10 1`] = `
|
|
|
1606
1606
|
"border": 0,
|
|
1607
1607
|
},
|
|
1608
1608
|
"alignItems": "center",
|
|
1609
|
-
"
|
|
1609
|
+
"background": "#f7f8fa",
|
|
1610
1610
|
"borderColor": "rgba(33,36,44,0.16)",
|
|
1611
1611
|
"borderRadius": 4,
|
|
1612
1612
|
"borderStyle": "solid",
|
|
@@ -1627,7 +1627,7 @@ exports[`wonder-blocks-dropdown example 10 1`] = `
|
|
|
1627
1627
|
"whiteSpace": "nowrap",
|
|
1628
1628
|
}
|
|
1629
1629
|
}
|
|
1630
|
-
tabIndex={
|
|
1630
|
+
tabIndex={0}
|
|
1631
1631
|
type="button"
|
|
1632
1632
|
>
|
|
1633
1633
|
<span
|
|
@@ -1768,7 +1768,7 @@ exports[`wonder-blocks-dropdown example 11 1`] = `
|
|
|
1768
1768
|
"border": 0,
|
|
1769
1769
|
},
|
|
1770
1770
|
"alignItems": "center",
|
|
1771
|
-
"
|
|
1771
|
+
"background": "transparent",
|
|
1772
1772
|
"borderColor": "rgba(255,255,255,0.50)",
|
|
1773
1773
|
"borderRadius": 4,
|
|
1774
1774
|
"borderStyle": "solid",
|
|
@@ -1905,7 +1905,7 @@ exports[`wonder-blocks-dropdown example 12 1`] = `
|
|
|
1905
1905
|
"border": 0,
|
|
1906
1906
|
},
|
|
1907
1907
|
"alignItems": "center",
|
|
1908
|
-
"
|
|
1908
|
+
"background": "#f7f8fa",
|
|
1909
1909
|
"borderColor": "rgba(33,36,44,0.16)",
|
|
1910
1910
|
"borderRadius": 4,
|
|
1911
1911
|
"borderStyle": "solid",
|
|
@@ -1926,7 +1926,7 @@ exports[`wonder-blocks-dropdown example 12 1`] = `
|
|
|
1926
1926
|
"whiteSpace": "nowrap",
|
|
1927
1927
|
}
|
|
1928
1928
|
}
|
|
1929
|
-
tabIndex={
|
|
1929
|
+
tabIndex={0}
|
|
1930
1930
|
type="button"
|
|
1931
1931
|
>
|
|
1932
1932
|
<span
|
|
@@ -2062,7 +2062,7 @@ exports[`wonder-blocks-dropdown example 13 1`] = `
|
|
|
2062
2062
|
"border": 0,
|
|
2063
2063
|
},
|
|
2064
2064
|
"alignItems": "center",
|
|
2065
|
-
"
|
|
2065
|
+
"background": "#ffffff",
|
|
2066
2066
|
"borderColor": "rgba(33,36,44,0.16)",
|
|
2067
2067
|
"borderRadius": 4,
|
|
2068
2068
|
"borderStyle": "solid",
|
|
@@ -2198,7 +2198,7 @@ exports[`wonder-blocks-dropdown example 14 1`] = `
|
|
|
2198
2198
|
"border": 0,
|
|
2199
2199
|
},
|
|
2200
2200
|
"alignItems": "center",
|
|
2201
|
-
"
|
|
2201
|
+
"background": "#ffffff",
|
|
2202
2202
|
"borderColor": "rgba(33,36,44,0.16)",
|
|
2203
2203
|
"borderRadius": 4,
|
|
2204
2204
|
"borderStyle": "solid",
|
|
@@ -2292,8 +2292,8 @@ exports[`wonder-blocks-dropdown example 14 1`] = `
|
|
|
2292
2292
|
}
|
|
2293
2293
|
/>
|
|
2294
2294
|
<button
|
|
2295
|
+
aria-disabled={false}
|
|
2295
2296
|
className=""
|
|
2296
|
-
disabled={false}
|
|
2297
2297
|
onBlur={[Function]}
|
|
2298
2298
|
onClick={[Function]}
|
|
2299
2299
|
onDragStart={[Function]}
|
|
@@ -2498,7 +2498,7 @@ exports[`wonder-blocks-dropdown example 16 1`] = `
|
|
|
2498
2498
|
"border": 0,
|
|
2499
2499
|
},
|
|
2500
2500
|
"alignItems": "center",
|
|
2501
|
-
"
|
|
2501
|
+
"background": "#ffffff",
|
|
2502
2502
|
"borderColor": "rgba(33,36,44,0.16)",
|
|
2503
2503
|
"borderRadius": 4,
|
|
2504
2504
|
"borderStyle": "solid",
|
|
@@ -2635,7 +2635,7 @@ exports[`wonder-blocks-dropdown example 17 1`] = `
|
|
|
2635
2635
|
"border": 0,
|
|
2636
2636
|
},
|
|
2637
2637
|
"alignItems": "center",
|
|
2638
|
-
"
|
|
2638
|
+
"background": "#ffffff",
|
|
2639
2639
|
"borderColor": "rgba(33,36,44,0.16)",
|
|
2640
2640
|
"borderRadius": 4,
|
|
2641
2641
|
"borderStyle": "solid",
|
|
@@ -2771,7 +2771,7 @@ exports[`wonder-blocks-dropdown example 18 1`] = `
|
|
|
2771
2771
|
"border": 0,
|
|
2772
2772
|
},
|
|
2773
2773
|
"alignItems": "center",
|
|
2774
|
-
"
|
|
2774
|
+
"background": "#ffffff",
|
|
2775
2775
|
"borderColor": "rgba(33,36,44,0.16)",
|
|
2776
2776
|
"borderRadius": 4,
|
|
2777
2777
|
"borderStyle": "solid",
|
|
@@ -2907,7 +2907,7 @@ exports[`wonder-blocks-dropdown example 19 1`] = `
|
|
|
2907
2907
|
"border": 0,
|
|
2908
2908
|
},
|
|
2909
2909
|
"alignItems": "center",
|
|
2910
|
-
"
|
|
2910
|
+
"background": "#ffffff",
|
|
2911
2911
|
"borderColor": "rgba(33,36,44,0.16)",
|
|
2912
2912
|
"borderRadius": 4,
|
|
2913
2913
|
"borderStyle": "solid",
|
|
@@ -2998,8 +2998,8 @@ exports[`wonder-blocks-dropdown example 20 1`] = `
|
|
|
2998
2998
|
}
|
|
2999
2999
|
>
|
|
3000
3000
|
<button
|
|
3001
|
+
aria-disabled={false}
|
|
3001
3002
|
className=""
|
|
3002
|
-
disabled={false}
|
|
3003
3003
|
onBlur={[Function]}
|
|
3004
3004
|
onClick={[Function]}
|
|
3005
3005
|
onDragStart={[Function]}
|
|
@@ -3138,7 +3138,7 @@ exports[`wonder-blocks-dropdown example 21 1`] = `
|
|
|
3138
3138
|
"border": 0,
|
|
3139
3139
|
},
|
|
3140
3140
|
"alignItems": "center",
|
|
3141
|
-
"
|
|
3141
|
+
"background": "#f7f8fa",
|
|
3142
3142
|
"borderColor": "rgba(33,36,44,0.16)",
|
|
3143
3143
|
"borderRadius": 4,
|
|
3144
3144
|
"borderStyle": "solid",
|
|
@@ -3159,7 +3159,7 @@ exports[`wonder-blocks-dropdown example 21 1`] = `
|
|
|
3159
3159
|
"whiteSpace": "nowrap",
|
|
3160
3160
|
}
|
|
3161
3161
|
}
|
|
3162
|
-
tabIndex={
|
|
3162
|
+
tabIndex={0}
|
|
3163
3163
|
type="button"
|
|
3164
3164
|
>
|
|
3165
3165
|
<span
|
|
@@ -3295,7 +3295,7 @@ exports[`wonder-blocks-dropdown example 22 1`] = `
|
|
|
3295
3295
|
"border": 0,
|
|
3296
3296
|
},
|
|
3297
3297
|
"alignItems": "center",
|
|
3298
|
-
"
|
|
3298
|
+
"background": "#ffffff",
|
|
3299
3299
|
"borderColor": "rgba(33,36,44,0.16)",
|
|
3300
3300
|
"borderRadius": 4,
|
|
3301
3301
|
"borderStyle": "solid",
|
|
@@ -3431,7 +3431,7 @@ exports[`wonder-blocks-dropdown example 23 1`] = `
|
|
|
3431
3431
|
"border": 0,
|
|
3432
3432
|
},
|
|
3433
3433
|
"alignItems": "center",
|
|
3434
|
-
"
|
|
3434
|
+
"background": "#ffffff",
|
|
3435
3435
|
"borderColor": "rgba(33,36,44,0.16)",
|
|
3436
3436
|
"borderRadius": 4,
|
|
3437
3437
|
"borderStyle": "solid",
|
|
@@ -3567,7 +3567,7 @@ exports[`wonder-blocks-dropdown example 24 1`] = `
|
|
|
3567
3567
|
"border": 0,
|
|
3568
3568
|
},
|
|
3569
3569
|
"alignItems": "center",
|
|
3570
|
-
"
|
|
3570
|
+
"background": "#ffffff",
|
|
3571
3571
|
"borderColor": "rgba(33,36,44,0.16)",
|
|
3572
3572
|
"borderRadius": 4,
|
|
3573
3573
|
"borderStyle": "solid",
|
|
@@ -3661,8 +3661,8 @@ exports[`wonder-blocks-dropdown example 24 1`] = `
|
|
|
3661
3661
|
}
|
|
3662
3662
|
/>
|
|
3663
3663
|
<button
|
|
3664
|
+
aria-disabled={false}
|
|
3664
3665
|
className=""
|
|
3665
|
-
disabled={false}
|
|
3666
3666
|
onBlur={[Function]}
|
|
3667
3667
|
onClick={[Function]}
|
|
3668
3668
|
onDragStart={[Function]}
|
|
@@ -3801,7 +3801,7 @@ exports[`wonder-blocks-dropdown example 25 1`] = `
|
|
|
3801
3801
|
"border": 0,
|
|
3802
3802
|
},
|
|
3803
3803
|
"alignItems": "center",
|
|
3804
|
-
"
|
|
3804
|
+
"background": "#ffffff",
|
|
3805
3805
|
"borderColor": "rgba(33,36,44,0.16)",
|
|
3806
3806
|
"borderRadius": 4,
|
|
3807
3807
|
"borderStyle": "solid",
|
|
@@ -3984,7 +3984,7 @@ exports[`wonder-blocks-dropdown example 27 1`] = `
|
|
|
3984
3984
|
"border": 0,
|
|
3985
3985
|
},
|
|
3986
3986
|
"alignItems": "center",
|
|
3987
|
-
"
|
|
3987
|
+
"background": "#ffffff",
|
|
3988
3988
|
"borderColor": "rgba(33,36,44,0.16)",
|
|
3989
3989
|
"borderRadius": 4,
|
|
3990
3990
|
"borderStyle": "solid",
|
|
@@ -3,11 +3,12 @@ import * as React from "react";
|
|
|
3
3
|
import {StyleSheet} from "aphrodite";
|
|
4
4
|
|
|
5
5
|
import {View} from "@khanacademy/wonder-blocks-core";
|
|
6
|
-
import {MultiSelect, OptionItem} from "@khanacademy/wonder-blocks-dropdown";
|
|
7
6
|
|
|
8
7
|
import type {Labels} from "@khanacademy/wonder-blocks-dropdown";
|
|
9
8
|
import type {StoryComponentType} from "@storybook/react";
|
|
10
9
|
|
|
10
|
+
import {MultiSelect, OptionItem} from "../index.js";
|
|
11
|
+
|
|
11
12
|
export default {
|
|
12
13
|
title: "Dropdown / MultiSelect",
|
|
13
14
|
};
|
|
@@ -94,6 +95,20 @@ export const CustomStylesOpened: StoryComponentType = () => (
|
|
|
94
95
|
<MultiSelectWithCustomStyles opened={true} />
|
|
95
96
|
);
|
|
96
97
|
|
|
98
|
+
export const DisabledMultiSelect: StoryComponentType = () => (
|
|
99
|
+
<MultiSelect disabled={true} onChange={() => {}}>
|
|
100
|
+
<OptionItem label="Mercury" value="1" />
|
|
101
|
+
<OptionItem label="Venus" value="2" />
|
|
102
|
+
</MultiSelect>
|
|
103
|
+
);
|
|
104
|
+
|
|
105
|
+
DisabledMultiSelect.parameters = {
|
|
106
|
+
docs: {
|
|
107
|
+
storyDescription:
|
|
108
|
+
"`MultiSelect` can be disabled by passing `disabled={true}`. This can be useful when you want to disable a control temporarily.",
|
|
109
|
+
},
|
|
110
|
+
};
|
|
111
|
+
|
|
97
112
|
const styles = StyleSheet.create({
|
|
98
113
|
setWidth: {
|
|
99
114
|
minWidth: 170,
|
|
@@ -190,7 +190,7 @@ const {blue, white, offBlack, offBlack32} = Color;
|
|
|
190
190
|
const styles = StyleSheet.create({
|
|
191
191
|
itemContainer: {
|
|
192
192
|
flexDirection: "row",
|
|
193
|
-
|
|
193
|
+
background: white,
|
|
194
194
|
color: offBlack,
|
|
195
195
|
alignItems: "center",
|
|
196
196
|
height: DROPDOWN_ITEM_HEIGHT,
|
|
@@ -231,7 +231,7 @@ const _generateStyles = (light, placeholder) => {
|
|
|
231
231
|
if (light) {
|
|
232
232
|
newStyles = {
|
|
233
233
|
default: {
|
|
234
|
-
|
|
234
|
+
background: "transparent",
|
|
235
235
|
color: placeholder ? white50 : white,
|
|
236
236
|
borderColor: white50,
|
|
237
237
|
borderWidth: 1,
|
|
@@ -261,7 +261,7 @@ const _generateStyles = (light, placeholder) => {
|
|
|
261
261
|
} else {
|
|
262
262
|
newStyles = {
|
|
263
263
|
default: {
|
|
264
|
-
|
|
264
|
+
background: white,
|
|
265
265
|
borderColor: offBlack16,
|
|
266
266
|
borderWidth: 1,
|
|
267
267
|
color: placeholder ? offBlack64 : offBlack,
|
|
@@ -280,7 +280,7 @@ const _generateStyles = (light, placeholder) => {
|
|
|
280
280
|
paddingRight: adjustedPaddingRight,
|
|
281
281
|
},
|
|
282
282
|
disabled: {
|
|
283
|
-
|
|
283
|
+
background: Color.offWhite,
|
|
284
284
|
borderColor: offBlack16,
|
|
285
285
|
color: offBlack64,
|
|
286
286
|
cursor: "auto",
|
|
@@ -4,7 +4,6 @@ import {StyleSheet} from "aphrodite";
|
|
|
4
4
|
|
|
5
5
|
import Button from "@khanacademy/wonder-blocks-button";
|
|
6
6
|
import {View} from "@khanacademy/wonder-blocks-core";
|
|
7
|
-
import {SingleSelect, OptionItem} from "@khanacademy/wonder-blocks-dropdown";
|
|
8
7
|
import {Strut} from "@khanacademy/wonder-blocks-layout";
|
|
9
8
|
import {OnePaneDialog, ModalLauncher} from "@khanacademy/wonder-blocks-modal";
|
|
10
9
|
import Spacing from "@khanacademy/wonder-blocks-spacing";
|
|
@@ -12,6 +11,8 @@ import {Body} from "@khanacademy/wonder-blocks-typography";
|
|
|
12
11
|
|
|
13
12
|
import type {StoryComponentType} from "@storybook/react";
|
|
14
13
|
|
|
14
|
+
import {SingleSelect, OptionItem} from "../index.js";
|
|
15
|
+
|
|
15
16
|
export default {
|
|
16
17
|
title: "Dropdown / SingleSelect",
|
|
17
18
|
};
|
|
@@ -170,3 +171,21 @@ DropdownInModal.parameters = {
|
|
|
170
171
|
disableSnapshot: true,
|
|
171
172
|
},
|
|
172
173
|
};
|
|
174
|
+
|
|
175
|
+
export const DisabledSingleSelect: StoryComponentType = () => (
|
|
176
|
+
<SingleSelect
|
|
177
|
+
disabled={true}
|
|
178
|
+
placeholder="Choose a juice"
|
|
179
|
+
onChange={() => {}}
|
|
180
|
+
>
|
|
181
|
+
<OptionItem label="Banana juice" value="banana" />
|
|
182
|
+
<OptionItem label="Strawberry juice" value="strawberry" />
|
|
183
|
+
</SingleSelect>
|
|
184
|
+
);
|
|
185
|
+
|
|
186
|
+
DisabledSingleSelect.parameters = {
|
|
187
|
+
docs: {
|
|
188
|
+
storyDescription:
|
|
189
|
+
"`SingleSelect` can be disabled by passing `disabled={true}`. This can be useful when you want to disable a control temporarily.",
|
|
190
|
+
},
|
|
191
|
+
};
|