@khanacademy/wonder-blocks-dropdown 2.10.0 → 2.10.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @khanacademy/wonder-blocks-dropdown
|
|
2
2
|
|
|
3
|
+
## 2.10.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [4c682709]
|
|
8
|
+
- @khanacademy/wonder-blocks-clickable@2.4.1
|
|
9
|
+
- @khanacademy/wonder-blocks-modal@3.0.2
|
|
10
|
+
- @khanacademy/wonder-blocks-search-field@1.0.14
|
|
11
|
+
|
|
12
|
+
## 2.10.1
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- 29d57cdc: Fixes bug where going from empty to filled shifts the dropdown box’s position when inline with text
|
|
17
|
+
|
|
3
18
|
## 2.10.0
|
|
4
19
|
|
|
5
20
|
### Minor Changes
|
package/dist/es/index.js
CHANGED
|
@@ -1694,7 +1694,7 @@ class SelectOpener extends React.Component {
|
|
|
1694
1694
|
type: "button"
|
|
1695
1695
|
}, childrenProps), React.createElement(LabelMedium, {
|
|
1696
1696
|
style: styles.text
|
|
1697
|
-
}, children), React.createElement(Icon, {
|
|
1697
|
+
}, children || "\u00A0"), React.createElement(Icon, {
|
|
1698
1698
|
icon: icons.caretDown,
|
|
1699
1699
|
color: iconColor,
|
|
1700
1700
|
size: "small",
|
package/dist/index.js
CHANGED
|
@@ -177,19 +177,16 @@ function _extends() {
|
|
|
177
177
|
module.exports = _extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
178
178
|
for (var i = 1; i < arguments.length; i++) {
|
|
179
179
|
var source = arguments[i];
|
|
180
|
-
|
|
181
180
|
for (var key in source) {
|
|
182
181
|
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
183
182
|
target[key] = source[key];
|
|
184
183
|
}
|
|
185
184
|
}
|
|
186
185
|
}
|
|
187
|
-
|
|
188
186
|
return target;
|
|
189
187
|
}, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
190
188
|
return _extends.apply(this, arguments);
|
|
191
189
|
}
|
|
192
|
-
|
|
193
190
|
module.exports = _extends, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
194
191
|
|
|
195
192
|
/***/ }),
|
|
@@ -1690,7 +1687,7 @@ class SelectOpener extends react__WEBPACK_IMPORTED_MODULE_1__["Component"] {
|
|
|
1690
1687
|
type: "button"
|
|
1691
1688
|
}, childrenProps), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_khanacademy_wonder_blocks_typography__WEBPACK_IMPORTED_MODULE_9__["LabelMedium"], {
|
|
1692
1689
|
style: styles.text
|
|
1693
|
-
}, children), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_khanacademy_wonder_blocks_icon__WEBPACK_IMPORTED_MODULE_7___default.a, {
|
|
1690
|
+
}, children || "\u00A0"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_khanacademy_wonder_blocks_icon__WEBPACK_IMPORTED_MODULE_7___default.a, {
|
|
1694
1691
|
icon: _khanacademy_wonder_blocks_icon__WEBPACK_IMPORTED_MODULE_7__["icons"].caretDown,
|
|
1695
1692
|
color: iconColor,
|
|
1696
1693
|
size: "small",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@khanacademy/wonder-blocks-dropdown",
|
|
3
|
-
"version": "2.10.
|
|
3
|
+
"version": "2.10.2",
|
|
4
4
|
"design": "v1",
|
|
5
5
|
"description": "Dropdown variants for Wonder Blocks.",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -16,13 +16,13 @@
|
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@babel/runtime": "^7.18.6",
|
|
19
|
-
"@khanacademy/wonder-blocks-clickable": "^2.4.
|
|
19
|
+
"@khanacademy/wonder-blocks-clickable": "^2.4.1",
|
|
20
20
|
"@khanacademy/wonder-blocks-color": "^1.2.0",
|
|
21
21
|
"@khanacademy/wonder-blocks-core": "^4.5.0",
|
|
22
22
|
"@khanacademy/wonder-blocks-icon": "^1.2.32",
|
|
23
23
|
"@khanacademy/wonder-blocks-layout": "^1.4.12",
|
|
24
|
-
"@khanacademy/wonder-blocks-modal": "^3.0.
|
|
25
|
-
"@khanacademy/wonder-blocks-search-field": "^1.0.
|
|
24
|
+
"@khanacademy/wonder-blocks-modal": "^3.0.2",
|
|
25
|
+
"@khanacademy/wonder-blocks-search-field": "^1.0.14",
|
|
26
26
|
"@khanacademy/wonder-blocks-spacing": "^3.0.5",
|
|
27
27
|
"@khanacademy/wonder-blocks-timing": "^2.1.0",
|
|
28
28
|
"@khanacademy/wonder-blocks-typography": "^1.1.34"
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"react-window": "^1.8.5"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@khanacademy/wonder-blocks-button": "^3.0.
|
|
41
|
+
"@khanacademy/wonder-blocks-button": "^3.0.9",
|
|
42
42
|
"wb-dev-build-settings": "^0.4.0"
|
|
43
43
|
}
|
|
44
44
|
}
|
|
@@ -245,6 +245,60 @@ Disabled.parameters = {
|
|
|
245
245
|
},
|
|
246
246
|
};
|
|
247
247
|
|
|
248
|
+
/**
|
|
249
|
+
* TwoWithText
|
|
250
|
+
*/
|
|
251
|
+
export const TwoWithText: StoryComponentType = (args) => {
|
|
252
|
+
const [selectedValue, setSelectedValue] = React.useState(
|
|
253
|
+
args.selectedValue,
|
|
254
|
+
);
|
|
255
|
+
const [secondSelectedValue, setSecondSelectedValue] = React.useState(
|
|
256
|
+
args.selectedValue,
|
|
257
|
+
);
|
|
258
|
+
const [opened, setOpened] = React.useState(args.opened);
|
|
259
|
+
const [secondOpened, setSecondOpened] = React.useState(args.opened);
|
|
260
|
+
React.useEffect(() => {
|
|
261
|
+
// Only update opened if the args.opened prop changes (using the
|
|
262
|
+
// controls panel).
|
|
263
|
+
setOpened(args.opened);
|
|
264
|
+
}, [args.opened]);
|
|
265
|
+
|
|
266
|
+
return (
|
|
267
|
+
<div>
|
|
268
|
+
Here is some text to nest the dropdown
|
|
269
|
+
<SingleSelect
|
|
270
|
+
{...args}
|
|
271
|
+
onChange={setSelectedValue}
|
|
272
|
+
selectedValue={selectedValue}
|
|
273
|
+
opened={opened}
|
|
274
|
+
onToggle={setOpened}
|
|
275
|
+
style={{display: "inline-block"}}
|
|
276
|
+
>
|
|
277
|
+
{[...items, <OptionItem label="" value="" key={9} />]}
|
|
278
|
+
</SingleSelect>
|
|
279
|
+
. And here is more text to compare!
|
|
280
|
+
<SingleSelect
|
|
281
|
+
{...args}
|
|
282
|
+
onChange={setSecondSelectedValue}
|
|
283
|
+
selectedValue={secondSelectedValue}
|
|
284
|
+
opened={secondOpened}
|
|
285
|
+
onToggle={setSecondOpened}
|
|
286
|
+
style={{display: "inline-block"}}
|
|
287
|
+
>
|
|
288
|
+
{[...items, <OptionItem label="" value="" key={9} />]}
|
|
289
|
+
</SingleSelect>
|
|
290
|
+
</div>
|
|
291
|
+
);
|
|
292
|
+
};
|
|
293
|
+
|
|
294
|
+
TwoWithText.parameters = {
|
|
295
|
+
docs: {
|
|
296
|
+
description: {
|
|
297
|
+
story: "This story has two selects nested inline within text.",
|
|
298
|
+
},
|
|
299
|
+
},
|
|
300
|
+
};
|
|
301
|
+
|
|
248
302
|
/**
|
|
249
303
|
* On dark background, right-aligned
|
|
250
304
|
*/
|
|
@@ -146,7 +146,9 @@ export default class SelectOpener extends React.Component<SelectOpenerProps> {
|
|
|
146
146
|
{...childrenProps}
|
|
147
147
|
>
|
|
148
148
|
<LabelMedium style={styles.text}>
|
|
149
|
-
{
|
|
149
|
+
{/* Note(tamarab): Prevents unwanted vertical
|
|
150
|
+
shift for empty selection */}
|
|
151
|
+
{children || "\u00A0"}
|
|
150
152
|
</LabelMedium>
|
|
151
153
|
<Icon
|
|
152
154
|
icon={icons.caretDown}
|