@instructure/ui-simple-select 8.53.3-pr-snapshot-8 → 8.53.3-pr-snapshot-1709124298948
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 +5 -2
- package/README.md +0 -1
- package/es/SimpleSelect/__examples__/SimpleSelect.examples.js +11 -11
- package/es/SimpleSelect/__new-tests__/SimpleSelect.test.js +5 -4
- package/es/SimpleSelect/index.js +6 -4
- package/lib/SimpleSelect/__examples__/SimpleSelect.examples.js +11 -12
- package/lib/SimpleSelect/__new-tests__/SimpleSelect.test.js +5 -5
- package/lib/SimpleSelect/index.js +6 -4
- package/package.json +15 -15
- package/src/SimpleSelect/Group/props.ts +0 -1
- package/src/SimpleSelect/Option/props.ts +0 -1
- package/src/SimpleSelect/__examples__/SimpleSelect.examples.tsx +0 -2
- package/src/SimpleSelect/__new-tests__/SimpleSelect.test.tsx +1 -1
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/SimpleSelect/Group/props.d.ts +1 -1
- package/types/SimpleSelect/Group/props.d.ts.map +1 -1
- package/types/SimpleSelect/Option/props.d.ts +1 -1
- package/types/SimpleSelect/Option/props.d.ts.map +1 -1
- package/types/SimpleSelect/__examples__/SimpleSelect.examples.d.ts.map +1 -1
- package/types/SimpleSelect/index.d.ts +1 -1
package/CHANGELOG.md
CHANGED
@@ -3,9 +3,12 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
5
5
|
|
6
|
-
## [8.53.3-pr-snapshot-
|
6
|
+
## [8.53.3-pr-snapshot-1709124298948](https://github.com/instructure/instructure-ui/compare/v8.53.2...v8.53.3-pr-snapshot-1709124298948) (2024-02-28)
|
7
7
|
|
8
|
-
|
8
|
+
|
9
|
+
### Bug Fixes
|
10
|
+
|
11
|
+
* **many:** remove emotion's jsx pragma ([7435d5c](https://github.com/instructure/instructure-ui/commit/7435d5c31ca6556a1f95c4dfde156d5a76aad7de))
|
9
12
|
|
10
13
|
|
11
14
|
|
package/README.md
CHANGED
@@ -22,50 +22,50 @@
|
|
22
22
|
* SOFTWARE.
|
23
23
|
*/
|
24
24
|
|
25
|
-
import React from 'react';
|
26
25
|
import { SimpleSelect } from '../../SimpleSelect';
|
26
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
27
27
|
export default {
|
28
28
|
sectionProp: 'size',
|
29
29
|
maxExamplesPerPage: 50,
|
30
30
|
propValues: {
|
31
|
-
children: [[
|
31
|
+
children: [[___EmotionJSX(SimpleSelect.Option, {
|
32
32
|
id: "0",
|
33
33
|
value: "0",
|
34
34
|
key: "0"
|
35
|
-
}, "Option one"),
|
35
|
+
}, "Option one"), ___EmotionJSX(SimpleSelect.Option, {
|
36
36
|
id: "1",
|
37
37
|
value: "1",
|
38
38
|
key: "1"
|
39
|
-
}, "Option two"),
|
39
|
+
}, "Option two"), ___EmotionJSX(SimpleSelect.Option, {
|
40
40
|
id: "2",
|
41
41
|
value: "2",
|
42
42
|
key: "2"
|
43
|
-
}, "Option three"),
|
43
|
+
}, "Option three"), ___EmotionJSX(SimpleSelect.Option, {
|
44
44
|
id: "3",
|
45
45
|
value: "3",
|
46
46
|
key: "3",
|
47
47
|
isDisabled: true
|
48
|
-
}, "Option four")], [
|
48
|
+
}, "Option four")], [___EmotionJSX(SimpleSelect.Option, {
|
49
49
|
id: "0",
|
50
50
|
value: "0",
|
51
51
|
key: "0"
|
52
|
-
}, "Item not in a group"),
|
52
|
+
}, "Item not in a group"), ___EmotionJSX(SimpleSelect.Group, {
|
53
53
|
id: "1",
|
54
54
|
renderLabel: "Group one",
|
55
55
|
key: "1"
|
56
|
-
},
|
56
|
+
}, ___EmotionJSX(SimpleSelect.Option, {
|
57
57
|
id: "2",
|
58
58
|
value: "2",
|
59
59
|
key: "2"
|
60
|
-
}, "Grouped item one")),
|
60
|
+
}, "Grouped item one")), ___EmotionJSX(SimpleSelect.Group, {
|
61
61
|
id: "3",
|
62
62
|
renderLabel: "Group two",
|
63
63
|
key: "3"
|
64
|
-
},
|
64
|
+
}, ___EmotionJSX(SimpleSelect.Option, {
|
65
65
|
id: "4",
|
66
66
|
value: "4",
|
67
67
|
key: "4"
|
68
|
-
}, "Grouped item two")),
|
68
|
+
}, "Grouped item two")), ___EmotionJSX(SimpleSelect.Option, {
|
69
69
|
id: "5",
|
70
70
|
value: "5",
|
71
71
|
key: "5"
|
@@ -21,11 +21,12 @@
|
|
21
21
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
22
22
|
* SOFTWARE.
|
23
23
|
*/
|
24
|
-
|
24
|
+
|
25
25
|
import { render } from '@testing-library/react';
|
26
26
|
import '@testing-library/jest-dom';
|
27
27
|
import SimpleSelect from '../index';
|
28
28
|
import * as utils from '@instructure/ui-utils';
|
29
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
29
30
|
jest.mock('@instructure/ui-utils', () => {
|
30
31
|
const originalModule = jest.requireActual('@instructure/ui-utils');
|
31
32
|
return {
|
@@ -37,14 +38,14 @@ jest.mock('@instructure/ui-utils', () => {
|
|
37
38
|
const mockUtils = utils;
|
38
39
|
describe('<SimpleSelect />', () => {
|
39
40
|
const defaultOptions = ['foo', 'bar', 'baz'];
|
40
|
-
const getOptions = disabled => defaultOptions.map(opt =>
|
41
|
+
const getOptions = disabled => defaultOptions.map(opt => ___EmotionJSX(SimpleSelect.Option, {
|
41
42
|
id: opt,
|
42
43
|
key: opt,
|
43
44
|
value: opt,
|
44
45
|
isDisabled: opt === disabled
|
45
46
|
}, opt));
|
46
47
|
it('should have role button in Safari', async () => {
|
47
|
-
const _render = render(
|
48
|
+
const _render = render(___EmotionJSX(SimpleSelect, {
|
48
49
|
renderLabel: "Choose an option"
|
49
50
|
}, getOptions())),
|
50
51
|
container = _render.container;
|
@@ -53,7 +54,7 @@ describe('<SimpleSelect />', () => {
|
|
53
54
|
});
|
54
55
|
it('should have role combobox in different browsers than Safari', async () => {
|
55
56
|
mockUtils.isSafari = jest.fn(() => false);
|
56
|
-
const _render2 = render(
|
57
|
+
const _render2 = render(___EmotionJSX(SimpleSelect, {
|
57
58
|
renderLabel: "Choose an option"
|
58
59
|
}, getOptions())),
|
59
60
|
container = _render2.container;
|
package/es/SimpleSelect/index.js
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
1
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
2
3
|
const _excluded = ["id", "value", "children", "renderBeforeLabel", "renderAfterLabel"],
|
3
4
|
_excluded2 = ["id", "renderLabel", "children"],
|
@@ -34,6 +35,7 @@ import { Select } from '@instructure/ui-select';
|
|
34
35
|
import { Option } from './Option';
|
35
36
|
import { Group } from './Group';
|
36
37
|
import { allowedProps, propTypes } from './props';
|
38
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
37
39
|
/**
|
38
40
|
---
|
39
41
|
category: components
|
@@ -238,7 +240,7 @@ let SimpleSelect = (_dec = withDeterministicId(), _dec2 = testable(), _dec(_clas
|
|
238
240
|
return children;
|
239
241
|
}
|
240
242
|
renderEmptyOption() {
|
241
|
-
return
|
243
|
+
return ___EmotionJSX(Select.Option, {
|
242
244
|
id: this._emptyOptionId,
|
243
245
|
isHighlighted: false,
|
244
246
|
isSelected: false
|
@@ -265,7 +267,7 @@ let SimpleSelect = (_dec = withDeterministicId(), _dec2 = testable(), _dec(_clas
|
|
265
267
|
children
|
266
268
|
}) : renderLabel;
|
267
269
|
};
|
268
|
-
return
|
270
|
+
return ___EmotionJSX(Select.Option, _extends({
|
269
271
|
id: id,
|
270
272
|
value: value,
|
271
273
|
key: option.key || id,
|
@@ -282,7 +284,7 @@ let SimpleSelect = (_dec = withDeterministicId(), _dec2 = testable(), _dec(_clas
|
|
282
284
|
renderLabel = _group$props.renderLabel,
|
283
285
|
children = _group$props.children,
|
284
286
|
rest = _objectWithoutProperties(_group$props, _excluded2);
|
285
|
-
return
|
287
|
+
return ___EmotionJSX(Select.Group, _extends({
|
286
288
|
renderLabel: renderLabel,
|
287
289
|
key: group.key || id
|
288
290
|
}, passthroughProps(rest)), Children.map(children, child => this.renderOption(child)));
|
@@ -318,7 +320,7 @@ let SimpleSelect = (_dec = withDeterministicId(), _dec2 = testable(), _dec(_clas
|
|
318
320
|
onHideOptions = _this$props.onHideOptions,
|
319
321
|
children = _this$props.children,
|
320
322
|
rest = _objectWithoutProperties(_this$props, _excluded3);
|
321
|
-
return
|
323
|
+
return ___EmotionJSX(Select, _extends({
|
322
324
|
renderLabel: renderLabel,
|
323
325
|
inputValue: this.state.inputValue,
|
324
326
|
isShowingOptions: this.state.isShowingOptions,
|
@@ -1,12 +1,11 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
5
4
|
value: true
|
6
5
|
});
|
7
6
|
exports.default = void 0;
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
9
7
|
var _SimpleSelect = require("../../SimpleSelect");
|
8
|
+
var _react = require("@emotion/react");
|
10
9
|
/*
|
11
10
|
* The MIT License (MIT)
|
12
11
|
*
|
@@ -34,44 +33,44 @@ var _default = exports.default = {
|
|
34
33
|
sectionProp: 'size',
|
35
34
|
maxExamplesPerPage: 50,
|
36
35
|
propValues: {
|
37
|
-
children: [[
|
36
|
+
children: [[(0, _react.jsx)(_SimpleSelect.SimpleSelect.Option, {
|
38
37
|
id: "0",
|
39
38
|
value: "0",
|
40
39
|
key: "0"
|
41
|
-
}, "Option one"),
|
40
|
+
}, "Option one"), (0, _react.jsx)(_SimpleSelect.SimpleSelect.Option, {
|
42
41
|
id: "1",
|
43
42
|
value: "1",
|
44
43
|
key: "1"
|
45
|
-
}, "Option two"),
|
44
|
+
}, "Option two"), (0, _react.jsx)(_SimpleSelect.SimpleSelect.Option, {
|
46
45
|
id: "2",
|
47
46
|
value: "2",
|
48
47
|
key: "2"
|
49
|
-
}, "Option three"),
|
48
|
+
}, "Option three"), (0, _react.jsx)(_SimpleSelect.SimpleSelect.Option, {
|
50
49
|
id: "3",
|
51
50
|
value: "3",
|
52
51
|
key: "3",
|
53
52
|
isDisabled: true
|
54
|
-
}, "Option four")], [
|
53
|
+
}, "Option four")], [(0, _react.jsx)(_SimpleSelect.SimpleSelect.Option, {
|
55
54
|
id: "0",
|
56
55
|
value: "0",
|
57
56
|
key: "0"
|
58
|
-
}, "Item not in a group"),
|
57
|
+
}, "Item not in a group"), (0, _react.jsx)(_SimpleSelect.SimpleSelect.Group, {
|
59
58
|
id: "1",
|
60
59
|
renderLabel: "Group one",
|
61
60
|
key: "1"
|
62
|
-
},
|
61
|
+
}, (0, _react.jsx)(_SimpleSelect.SimpleSelect.Option, {
|
63
62
|
id: "2",
|
64
63
|
value: "2",
|
65
64
|
key: "2"
|
66
|
-
}, "Grouped item one")),
|
65
|
+
}, "Grouped item one")), (0, _react.jsx)(_SimpleSelect.SimpleSelect.Group, {
|
67
66
|
id: "3",
|
68
67
|
renderLabel: "Group two",
|
69
68
|
key: "3"
|
70
|
-
},
|
69
|
+
}, (0, _react.jsx)(_SimpleSelect.SimpleSelect.Option, {
|
71
70
|
id: "4",
|
72
71
|
value: "4",
|
73
72
|
key: "4"
|
74
|
-
}, "Grouped item two")),
|
73
|
+
}, "Grouped item two")), (0, _react.jsx)(_SimpleSelect.SimpleSelect.Option, {
|
75
74
|
id: "5",
|
76
75
|
value: "5",
|
77
76
|
key: "5"
|
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
4
4
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
5
|
-
var _react =
|
6
|
-
var _react2 = require("@testing-library/react");
|
5
|
+
var _react = require("@testing-library/react");
|
7
6
|
require("@testing-library/jest-dom");
|
8
7
|
var _index = _interopRequireDefault(require("../index"));
|
9
8
|
var utils = _interopRequireWildcard(require("@instructure/ui-utils"));
|
9
|
+
var _react2 = require("@emotion/react");
|
10
10
|
/*
|
11
11
|
* The MIT License (MIT)
|
12
12
|
*
|
@@ -42,14 +42,14 @@ jest.mock('@instructure/ui-utils', () => {
|
|
42
42
|
const mockUtils = utils;
|
43
43
|
describe('<SimpleSelect />', () => {
|
44
44
|
const defaultOptions = ['foo', 'bar', 'baz'];
|
45
|
-
const getOptions = disabled => defaultOptions.map(opt =>
|
45
|
+
const getOptions = disabled => defaultOptions.map(opt => (0, _react2.jsx)(_index.default.Option, {
|
46
46
|
id: opt,
|
47
47
|
key: opt,
|
48
48
|
value: opt,
|
49
49
|
isDisabled: opt === disabled
|
50
50
|
}, opt));
|
51
51
|
it('should have role button in Safari', async () => {
|
52
|
-
const _render = (0,
|
52
|
+
const _render = (0, _react.render)((0, _react2.jsx)(_index.default, {
|
53
53
|
renderLabel: "Choose an option"
|
54
54
|
}, getOptions())),
|
55
55
|
container = _render.container;
|
@@ -58,7 +58,7 @@ describe('<SimpleSelect />', () => {
|
|
58
58
|
});
|
59
59
|
it('should have role combobox in different browsers than Safari', async () => {
|
60
60
|
mockUtils.isSafari = jest.fn(() => false);
|
61
|
-
const _render2 = (0,
|
61
|
+
const _render2 = (0, _react.render)((0, _react2.jsx)(_index.default, {
|
62
62
|
renderLabel: "Choose an option"
|
63
63
|
}, getOptions())),
|
64
64
|
container = _render2.container;
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
7
7
|
});
|
8
8
|
exports.default = exports.SimpleSelect = void 0;
|
9
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
9
10
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
10
11
|
var _react = _interopRequireWildcard(require("react"));
|
11
12
|
var _testable = require("@instructure/ui-testable/lib/testable.js");
|
@@ -18,6 +19,7 @@ var _Select = require("@instructure/ui-select/lib/Select");
|
|
18
19
|
var _Option = require("./Option");
|
19
20
|
var _Group = require("./Group");
|
20
21
|
var _props = require("./props");
|
22
|
+
var _react2 = require("@emotion/react");
|
21
23
|
const _excluded = ["id", "value", "children", "renderBeforeLabel", "renderAfterLabel"],
|
22
24
|
_excluded2 = ["id", "renderLabel", "children"],
|
23
25
|
_excluded3 = ["renderLabel", "value", "defaultValue", "id", "size", "assistiveText", "placeholder", "interaction", "isRequired", "isInline", "width", "optionsMaxWidth", "optionsMaxHeight", "visibleOptionsCount", "messages", "placement", "constrain", "mountNode", "inputRef", "listRef", "renderEmptyOption", "renderBeforeInput", "renderAfterInput", "onFocus", "onBlur", "onShowOptions", "onHideOptions", "children"];
|
@@ -249,7 +251,7 @@ let SimpleSelect = exports.SimpleSelect = (_dec = (0, _withDeterministicId.withD
|
|
249
251
|
return children;
|
250
252
|
}
|
251
253
|
renderEmptyOption() {
|
252
|
-
return
|
254
|
+
return (0, _react2.jsx)(_Select.Select.Option, {
|
253
255
|
id: this._emptyOptionId,
|
254
256
|
isHighlighted: false,
|
255
257
|
isSelected: false
|
@@ -276,7 +278,7 @@ let SimpleSelect = exports.SimpleSelect = (_dec = (0, _withDeterministicId.withD
|
|
276
278
|
children
|
277
279
|
}) : renderLabel;
|
278
280
|
};
|
279
|
-
return
|
281
|
+
return (0, _react2.jsx)(_Select.Select.Option, (0, _extends2.default)({
|
280
282
|
id: id,
|
281
283
|
value: value,
|
282
284
|
key: option.key || id,
|
@@ -293,7 +295,7 @@ let SimpleSelect = exports.SimpleSelect = (_dec = (0, _withDeterministicId.withD
|
|
293
295
|
renderLabel = _group$props.renderLabel,
|
294
296
|
children = _group$props.children,
|
295
297
|
rest = (0, _objectWithoutProperties2.default)(_group$props, _excluded2);
|
296
|
-
return
|
298
|
+
return (0, _react2.jsx)(_Select.Select.Group, (0, _extends2.default)({
|
297
299
|
renderLabel: renderLabel,
|
298
300
|
key: group.key || id
|
299
301
|
}, (0, _passthroughProps.passthroughProps)(rest)), _react.Children.map(children, child => this.renderOption(child)));
|
@@ -329,7 +331,7 @@ let SimpleSelect = exports.SimpleSelect = (_dec = (0, _withDeterministicId.withD
|
|
329
331
|
onHideOptions = _this$props.onHideOptions,
|
330
332
|
children = _this$props.children,
|
331
333
|
rest = (0, _objectWithoutProperties2.default)(_this$props, _excluded3);
|
332
|
-
return
|
334
|
+
return (0, _react2.jsx)(_Select.Select, (0, _extends2.default)({
|
333
335
|
renderLabel: renderLabel,
|
334
336
|
inputValue: this.state.inputValue,
|
335
337
|
isShowingOptions: this.state.isShowingOptions,
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@instructure/ui-simple-select",
|
3
|
-
"version": "8.53.3-pr-snapshot-
|
3
|
+
"version": "8.53.3-pr-snapshot-1709124298948",
|
4
4
|
"description": "A component for standard select element behavior.",
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
6
6
|
"module": "./es/index.js",
|
@@ -24,23 +24,23 @@
|
|
24
24
|
"license": "MIT",
|
25
25
|
"dependencies": {
|
26
26
|
"@babel/runtime": "^7.23.2",
|
27
|
-
"@instructure/console": "8.53.3-pr-snapshot-
|
28
|
-
"@instructure/shared-types": "8.53.3-pr-snapshot-
|
29
|
-
"@instructure/ui-form-field": "8.53.3-pr-snapshot-
|
30
|
-
"@instructure/ui-position": "8.53.3-pr-snapshot-
|
31
|
-
"@instructure/ui-prop-types": "8.53.3-pr-snapshot-
|
32
|
-
"@instructure/ui-react-utils": "8.53.3-pr-snapshot-
|
33
|
-
"@instructure/ui-select": "8.53.3-pr-snapshot-
|
34
|
-
"@instructure/ui-testable": "8.53.3-pr-snapshot-
|
27
|
+
"@instructure/console": "8.53.3-pr-snapshot-1709124298948",
|
28
|
+
"@instructure/shared-types": "8.53.3-pr-snapshot-1709124298948",
|
29
|
+
"@instructure/ui-form-field": "8.53.3-pr-snapshot-1709124298948",
|
30
|
+
"@instructure/ui-position": "8.53.3-pr-snapshot-1709124298948",
|
31
|
+
"@instructure/ui-prop-types": "8.53.3-pr-snapshot-1709124298948",
|
32
|
+
"@instructure/ui-react-utils": "8.53.3-pr-snapshot-1709124298948",
|
33
|
+
"@instructure/ui-select": "8.53.3-pr-snapshot-1709124298948",
|
34
|
+
"@instructure/ui-testable": "8.53.3-pr-snapshot-1709124298948",
|
35
35
|
"prop-types": "^15.8.1"
|
36
36
|
},
|
37
37
|
"devDependencies": {
|
38
|
-
"@instructure/ui-babel-preset": "8.53.3-pr-snapshot-
|
39
|
-
"@instructure/ui-color-utils": "8.53.3-pr-snapshot-
|
40
|
-
"@instructure/ui-icons": "8.53.3-pr-snapshot-
|
41
|
-
"@instructure/ui-test-locator": "8.53.3-pr-snapshot-
|
42
|
-
"@instructure/ui-test-utils": "8.53.3-pr-snapshot-
|
43
|
-
"@instructure/ui-utils": "8.53.3-pr-snapshot-
|
38
|
+
"@instructure/ui-babel-preset": "8.53.3-pr-snapshot-1709124298948",
|
39
|
+
"@instructure/ui-color-utils": "8.53.3-pr-snapshot-1709124298948",
|
40
|
+
"@instructure/ui-icons": "8.53.3-pr-snapshot-1709124298948",
|
41
|
+
"@instructure/ui-test-locator": "8.53.3-pr-snapshot-1709124298948",
|
42
|
+
"@instructure/ui-test-utils": "8.53.3-pr-snapshot-1709124298948",
|
43
|
+
"@instructure/ui-utils": "8.53.3-pr-snapshot-1709124298948",
|
44
44
|
"@testing-library/jest-dom": "^6.1.4",
|
45
45
|
"@testing-library/react": "^14.0.0"
|
46
46
|
},
|
@@ -21,7 +21,7 @@
|
|
21
21
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
22
22
|
* SOFTWARE.
|
23
23
|
*/
|
24
|
-
|
24
|
+
|
25
25
|
import { render } from '@testing-library/react'
|
26
26
|
import '@testing-library/jest-dom'
|
27
27
|
import SimpleSelect from '../index'
|