@khanacademy/wonder-blocks-dropdown 2.6.3 → 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 +6 -0
- package/dist/es/index.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/src/__tests__/__snapshots__/generated-snapshot.test.js.snap +3 -6
- package/src/components/multi-select.stories.js +16 -1
- package/src/components/select-opener.js +1 -1
- package/src/components/single-select.stories.js +20 -1
package/CHANGELOG.md
CHANGED
package/dist/es/index.js
CHANGED
|
@@ -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
|
@@ -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
|
@@ -1606,8 +1606,7 @@ exports[`wonder-blocks-dropdown example 10 1`] = `
|
|
|
1606
1606
|
"border": 0,
|
|
1607
1607
|
},
|
|
1608
1608
|
"alignItems": "center",
|
|
1609
|
-
"background": "#
|
|
1610
|
-
"backgroundColor": "transparent",
|
|
1609
|
+
"background": "#f7f8fa",
|
|
1611
1610
|
"borderColor": "rgba(33,36,44,0.16)",
|
|
1612
1611
|
"borderRadius": 4,
|
|
1613
1612
|
"borderStyle": "solid",
|
|
@@ -1906,8 +1905,7 @@ exports[`wonder-blocks-dropdown example 12 1`] = `
|
|
|
1906
1905
|
"border": 0,
|
|
1907
1906
|
},
|
|
1908
1907
|
"alignItems": "center",
|
|
1909
|
-
"background": "#
|
|
1910
|
-
"backgroundColor": "transparent",
|
|
1908
|
+
"background": "#f7f8fa",
|
|
1911
1909
|
"borderColor": "rgba(33,36,44,0.16)",
|
|
1912
1910
|
"borderRadius": 4,
|
|
1913
1911
|
"borderStyle": "solid",
|
|
@@ -3140,8 +3138,7 @@ exports[`wonder-blocks-dropdown example 21 1`] = `
|
|
|
3140
3138
|
"border": 0,
|
|
3141
3139
|
},
|
|
3142
3140
|
"alignItems": "center",
|
|
3143
|
-
"background": "#
|
|
3144
|
-
"backgroundColor": "transparent",
|
|
3141
|
+
"background": "#f7f8fa",
|
|
3145
3142
|
"borderColor": "rgba(33,36,44,0.16)",
|
|
3146
3143
|
"borderRadius": 4,
|
|
3147
3144
|
"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,
|
|
@@ -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
|
+
};
|