@ntbjs/react-components 1.1.0-beta.9 → 1.1.0-beta.91
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/{ActionButton-90485300.js → ActionButton-c3f5ed94.js} +1 -1
- package/Alert-3e4f8be1.js +62 -0
- package/{AssetGallery-28fd6d5c.js → AssetGallery-d38688e4.js} +24 -36
- package/{AssetPreviewTopBar-020a6f96.js → AssetPreviewTopBar-449e6019.js} +4 -2
- package/{Badge-34ad2850.js → Badge-9bcebe96.js} +1 -1
- package/{Button-e6a6139c.js → Button-432f87c6.js} +3 -3
- package/{Checkbox-50f1f3c7.js → Checkbox-85394137.js} +5 -5
- package/{AutocompleteSelect-e82bd937.js → CompactAutocompleteSelect-45b12179.js} +137 -77
- package/CompactStarRating-de1bcfe9.js +300 -0
- package/CompactTextInput-480f59cc.js +314 -0
- package/{ContextMenu-a68d4f28.js → ContextMenu-d088833b.js} +2 -2
- package/{InputGroup-66dd343c.js → InputGroup-09ce9572.js} +1 -1
- package/Instructions-34b22002.js +246 -0
- package/{MultiSelect-3eca3c3e.js → MultiSelect-01a257b8.js} +62 -46
- package/{Popover-63d38274.js → Popover-d3a4b72e.js} +9 -16
- package/{Radio-0b46b2a8.js → Radio-c811ce4a.js} +3 -3
- package/{SectionSeparator-12aff748.js → SectionSeparator-225719cd.js} +1 -1
- package/{Switch-aa384260.js → Switch-3ac11c97.js} +3 -3
- package/{Tab-51124003.js → Tab-bd0f3345.js} +11 -6
- package/{Tabs-452079b5.js → Tabs-bf42275e.js} +66 -13
- package/TextArea-dba4fd6c.js +321 -0
- package/{TextInput-e4c6d536.js → TextInput-8ea31a7b.js} +43 -43
- package/{Tooltip-556138de.js → Tooltip-1b7b0052.js} +15 -13
- package/check-555d831b.js +213 -0
- package/data/Alert/index.js +10 -0
- package/data/Badge/index.js +2 -2
- package/data/Popover/index.js +4 -3
- package/data/Tab/index.js +2 -2
- package/data/Tabs/index.js +3 -3
- package/data/Tooltip/index.js +12 -0
- package/data/index.js +11 -8
- package/{defaultTheme-870f7df1.js → defaultTheme-50f2b88f.js} +17 -0
- package/inputs/ActionButton/index.js +2 -2
- package/inputs/Button/index.js +5 -4
- package/inputs/Checkbox/index.js +2 -2
- package/inputs/CompactAutocompleteSelect/index.js +19 -0
- package/inputs/CompactStarRating/index.js +4 -3
- package/inputs/CompactTextInput/index.js +12 -9
- package/inputs/MultiSelect/index.js +4 -3
- package/inputs/Radio/index.js +2 -2
- package/inputs/Switch/index.js +2 -2
- package/inputs/TextArea/index.js +3 -3
- package/inputs/TextInput/index.js +2 -2
- package/inputs/index.js +28 -25
- package/layout/InputGroup/index.js +2 -2
- package/layout/SectionSeparator/index.js +2 -2
- package/layout/index.js +3 -3
- package/package.json +3 -2
- package/{react-select-creatable.esm-eb462367.js → react-select-creatable.esm-7231b55e.js} +132 -41
- package/shift-away-subtle-cfdf1dbe.js +9 -0
- package/warning-circle-24522402.js +41 -0
- package/widgets/AssetGallery/index.js +28 -24
- package/widgets/AssetPreview/AssetPreviewTopBar/index.js +2 -2
- package/widgets/ContextMenu/ContextMenuItem/index.js +3 -5
- package/widgets/ContextMenu/ContextMenuItemsGroup/index.js +1 -1
- package/widgets/ContextMenu/index.js +2 -2
- package/widgets/Instructions/index.js +23 -0
- package/widgets/index.js +31 -25
- package/CompactStarRating-f7a58649.js +0 -246
- package/CompactTextInput-a5bc6ec3.js +0 -265
- package/TextArea-efe4fa88.js +0 -213
- package/inputs/AutocompleteSelect/index.js +0 -18
package/inputs/index.js
CHANGED
|
@@ -2,44 +2,47 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var ActionButton = require('../ActionButton-
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var CompactStarRating = require('../CompactStarRating-
|
|
10
|
-
var CompactTextInput = require('../CompactTextInput-
|
|
11
|
-
var MultiSelect = require('../MultiSelect-
|
|
12
|
-
var Radio = require('../Radio-
|
|
13
|
-
var TextArea = require('../TextArea-
|
|
14
|
-
var TextInput = require('../TextInput-
|
|
15
|
-
var Switch = require('../Switch-
|
|
16
|
-
require('../defaultTheme-
|
|
5
|
+
var ActionButton = require('../ActionButton-c3f5ed94.js');
|
|
6
|
+
var Button = require('../Button-432f87c6.js');
|
|
7
|
+
var Checkbox = require('../Checkbox-85394137.js');
|
|
8
|
+
var CompactAutocompleteSelect = require('../CompactAutocompleteSelect-45b12179.js');
|
|
9
|
+
var CompactStarRating = require('../CompactStarRating-de1bcfe9.js');
|
|
10
|
+
var CompactTextInput = require('../CompactTextInput-480f59cc.js');
|
|
11
|
+
var MultiSelect = require('../MultiSelect-01a257b8.js');
|
|
12
|
+
var Radio = require('../Radio-c811ce4a.js');
|
|
13
|
+
var TextArea = require('../TextArea-dba4fd6c.js');
|
|
14
|
+
var TextInput = require('../TextInput-8ea31a7b.js');
|
|
15
|
+
var Switch = require('../Switch-3ac11c97.js');
|
|
16
|
+
require('../defaultTheme-50f2b88f.js');
|
|
17
17
|
require('styled-components');
|
|
18
18
|
require('react');
|
|
19
|
-
require('
|
|
19
|
+
require('../Popover-d3a4b72e.js');
|
|
20
20
|
require('lodash');
|
|
21
|
+
require('polished');
|
|
22
|
+
require('@tippyjs/react');
|
|
23
|
+
require('../shift-away-subtle-cfdf1dbe.js');
|
|
24
|
+
require('../ContextMenu-d088833b.js');
|
|
25
|
+
require('../expand-more-94585605.js');
|
|
26
|
+
require('nanoid');
|
|
27
|
+
require('../check-555d831b.js');
|
|
21
28
|
require('react-select');
|
|
22
|
-
require('../react-select-creatable.esm-eb462367.js');
|
|
23
|
-
require('react-dom');
|
|
24
29
|
require('react-select-async-paginate');
|
|
30
|
+
require('../react-select-creatable.esm-7231b55e.js');
|
|
31
|
+
require('react-dom');
|
|
25
32
|
require('../close-ebf2f3cf.js');
|
|
26
|
-
require('../expand-more-94585605.js');
|
|
27
|
-
require('../Popover-63d38274.js');
|
|
28
|
-
require('polished');
|
|
29
|
-
require('@tippyjs/react');
|
|
30
|
-
require('../ContextMenu-a68d4f28.js');
|
|
31
33
|
require('../edit-note-c47d292e.js');
|
|
32
|
-
require('../
|
|
33
|
-
require('../
|
|
34
|
-
require('../
|
|
35
|
-
require('../
|
|
34
|
+
require('../Alert-3e4f8be1.js');
|
|
35
|
+
require('../Badge-9bcebe96.js');
|
|
36
|
+
require('../Tab-bd0f3345.js');
|
|
37
|
+
require('../Tabs-bf42275e.js');
|
|
38
|
+
require('../Tooltip-1b7b0052.js');
|
|
36
39
|
|
|
37
40
|
|
|
38
41
|
|
|
39
42
|
exports.ActionButton = ActionButton.ActionButton;
|
|
40
|
-
exports.AutocompleteSelect = AutocompleteSelect.AutocompleteSelect;
|
|
41
43
|
exports.Button = Button.Button;
|
|
42
44
|
exports.Checkbox = Checkbox.Checkbox;
|
|
45
|
+
exports.CompactAutocompleteSelect = CompactAutocompleteSelect.CompactAutocompleteSelect;
|
|
43
46
|
exports.CompactStarRating = CompactStarRating.CompactStarRating;
|
|
44
47
|
exports.CompactTextInput = CompactTextInput.CompactTextInput;
|
|
45
48
|
exports.MultiSelect = MultiSelect.MultiSelect;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var InputGroup = require('../../InputGroup-
|
|
4
|
-
require('../../defaultTheme-
|
|
3
|
+
var InputGroup = require('../../InputGroup-09ce9572.js');
|
|
4
|
+
require('../../defaultTheme-50f2b88f.js');
|
|
5
5
|
require('styled-components');
|
|
6
6
|
require('react');
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var SectionSeparator = require('../../SectionSeparator-
|
|
4
|
-
require('../../defaultTheme-
|
|
3
|
+
var SectionSeparator = require('../../SectionSeparator-225719cd.js');
|
|
4
|
+
require('../../defaultTheme-50f2b88f.js');
|
|
5
5
|
require('styled-components');
|
|
6
6
|
require('react');
|
|
7
7
|
|
package/layout/index.js
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var InputGroup = require('../InputGroup-
|
|
6
|
-
var SectionSeparator = require('../SectionSeparator-
|
|
7
|
-
require('../defaultTheme-
|
|
5
|
+
var InputGroup = require('../InputGroup-09ce9572.js');
|
|
6
|
+
var SectionSeparator = require('../SectionSeparator-225719cd.js');
|
|
7
|
+
require('../defaultTheme-50f2b88f.js');
|
|
8
8
|
require('styled-components');
|
|
9
9
|
require('react');
|
|
10
10
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ntbjs/react-components",
|
|
3
|
-
"version": "1.1.0-beta.
|
|
3
|
+
"version": "1.1.0-beta.91",
|
|
4
4
|
"description": "NTBs common front-end design utilities and React components.",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "cross-env NODE_ENV=production rollup -c",
|
|
@@ -79,8 +79,9 @@
|
|
|
79
79
|
"nanoid": "^3.1.25",
|
|
80
80
|
"polished": "^4.1.3",
|
|
81
81
|
"react-lazy-load-image-component": "^1.5.1",
|
|
82
|
-
"react-select": "^5.7.
|
|
82
|
+
"react-select": "^5.7.7",
|
|
83
83
|
"react-select-async-paginate": "^0.7.3",
|
|
84
|
+
"react-spinners": "^0.13.8",
|
|
84
85
|
"resize-observer-polyfill": "^1.5.1",
|
|
85
86
|
"styled-components": "^5.3.5"
|
|
86
87
|
}
|
|
@@ -2572,7 +2572,7 @@ var Emotion$1 = Emotion;
|
|
|
2572
2572
|
|
|
2573
2573
|
var pkg = {
|
|
2574
2574
|
name: "@emotion/react",
|
|
2575
|
-
version: "11.11.
|
|
2575
|
+
version: "11.11.3",
|
|
2576
2576
|
main: "dist/emotion-react.cjs.js",
|
|
2577
2577
|
module: "dist/emotion-react.esm.js",
|
|
2578
2578
|
browser: {
|
|
@@ -2645,7 +2645,7 @@ var pkg = {
|
|
|
2645
2645
|
"@babel/runtime": "^7.18.3",
|
|
2646
2646
|
"@emotion/babel-plugin": "^11.11.0",
|
|
2647
2647
|
"@emotion/cache": "^11.11.0",
|
|
2648
|
-
"@emotion/serialize": "^1.1.
|
|
2648
|
+
"@emotion/serialize": "^1.1.3",
|
|
2649
2649
|
"@emotion/use-insertion-effect-with-fallbacks": "^1.0.1",
|
|
2650
2650
|
"@emotion/utils": "^1.2.1",
|
|
2651
2651
|
"@emotion/weak-memoize": "^0.3.1",
|
|
@@ -2661,7 +2661,7 @@ var pkg = {
|
|
|
2661
2661
|
},
|
|
2662
2662
|
devDependencies: {
|
|
2663
2663
|
"@definitelytyped/dtslint": "0.0.112",
|
|
2664
|
-
"@emotion/css": "11.11.
|
|
2664
|
+
"@emotion/css": "11.11.2",
|
|
2665
2665
|
"@emotion/css-prettifier": "1.1.3",
|
|
2666
2666
|
"@emotion/server": "11.11.0",
|
|
2667
2667
|
"@emotion/styled": "11.11.0",
|
|
@@ -3106,6 +3106,10 @@ function _taggedTemplateLiteral(strings, raw) {
|
|
|
3106
3106
|
}));
|
|
3107
3107
|
}
|
|
3108
3108
|
|
|
3109
|
+
/**
|
|
3110
|
+
* Custom positioning reference element.
|
|
3111
|
+
* @see https://floating-ui.com/docs/virtual-elements
|
|
3112
|
+
*/
|
|
3109
3113
|
const min = Math.min;
|
|
3110
3114
|
const max = Math.max;
|
|
3111
3115
|
const round = Math.round;
|
|
@@ -3135,7 +3139,7 @@ function getNodeName(node) {
|
|
|
3135
3139
|
}
|
|
3136
3140
|
function getWindow(node) {
|
|
3137
3141
|
var _node$ownerDocument;
|
|
3138
|
-
return (node == null
|
|
3142
|
+
return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
|
|
3139
3143
|
}
|
|
3140
3144
|
function getDocumentElement(node) {
|
|
3141
3145
|
var _ref;
|
|
@@ -4938,14 +4942,14 @@ var defaultAriaLiveMessages = {
|
|
|
4938
4942
|
guidance: function guidance(props) {
|
|
4939
4943
|
var isSearchable = props.isSearchable,
|
|
4940
4944
|
isMulti = props.isMulti,
|
|
4941
|
-
isDisabled = props.isDisabled,
|
|
4942
4945
|
tabSelectsValue = props.tabSelectsValue,
|
|
4943
|
-
context = props.context
|
|
4946
|
+
context = props.context,
|
|
4947
|
+
isInitialFocus = props.isInitialFocus;
|
|
4944
4948
|
switch (context) {
|
|
4945
4949
|
case 'menu':
|
|
4946
|
-
return "Use Up and Down to choose options
|
|
4950
|
+
return "Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu".concat(tabSelectsValue ? ', press Tab to select the option and exit the menu' : '', ".");
|
|
4947
4951
|
case 'input':
|
|
4948
|
-
return "".concat(props['aria-label'] || 'Select', " is focused ").concat(isSearchable ? ',type to refine list' : '', ", press Down to open the menu, ").concat(isMulti ? ' press left to focus selected values' : '');
|
|
4952
|
+
return isInitialFocus ? "".concat(props['aria-label'] || 'Select', " is focused ").concat(isSearchable ? ',type to refine list' : '', ", press Down to open the menu, ").concat(isMulti ? ' press left to focus selected values' : '') : '';
|
|
4949
4953
|
case 'value':
|
|
4950
4954
|
return 'Use left and right to toggle between focused values, press Backspace to remove the currently focused value';
|
|
4951
4955
|
default:
|
|
@@ -4981,17 +4985,18 @@ var defaultAriaLiveMessages = {
|
|
|
4981
4985
|
label = _props$label2 === void 0 ? '' : _props$label2,
|
|
4982
4986
|
selectValue = props.selectValue,
|
|
4983
4987
|
isDisabled = props.isDisabled,
|
|
4984
|
-
isSelected = props.isSelected
|
|
4988
|
+
isSelected = props.isSelected,
|
|
4989
|
+
isAppleDevice = props.isAppleDevice;
|
|
4985
4990
|
var getArrayIndex = function getArrayIndex(arr, item) {
|
|
4986
4991
|
return arr && arr.length ? "".concat(arr.indexOf(item) + 1, " of ").concat(arr.length) : '';
|
|
4987
4992
|
};
|
|
4988
4993
|
if (context === 'value' && selectValue) {
|
|
4989
4994
|
return "value ".concat(label, " focused, ").concat(getArrayIndex(selectValue, focused), ".");
|
|
4990
4995
|
}
|
|
4991
|
-
if (context === 'menu') {
|
|
4996
|
+
if (context === 'menu' && isAppleDevice) {
|
|
4992
4997
|
var disabled = isDisabled ? ' disabled' : '';
|
|
4993
|
-
var status = "".concat(isSelected ? 'selected' : '
|
|
4994
|
-
return "
|
|
4998
|
+
var status = "".concat(isSelected ? ' selected' : '').concat(disabled);
|
|
4999
|
+
return "".concat(label).concat(status, ", ").concat(getArrayIndex(options, focused), ".");
|
|
4995
5000
|
}
|
|
4996
5001
|
return '';
|
|
4997
5002
|
},
|
|
@@ -5010,7 +5015,8 @@ var LiveRegion = function LiveRegion(props) {
|
|
|
5010
5015
|
isFocused = props.isFocused,
|
|
5011
5016
|
selectValue = props.selectValue,
|
|
5012
5017
|
selectProps = props.selectProps,
|
|
5013
|
-
id = props.id
|
|
5018
|
+
id = props.id,
|
|
5019
|
+
isAppleDevice = props.isAppleDevice;
|
|
5014
5020
|
var ariaLiveMessages = selectProps.ariaLiveMessages,
|
|
5015
5021
|
getOptionLabel = selectProps.getOptionLabel,
|
|
5016
5022
|
inputValue = selectProps.inputValue,
|
|
@@ -5020,7 +5026,8 @@ var LiveRegion = function LiveRegion(props) {
|
|
|
5020
5026
|
menuIsOpen = selectProps.menuIsOpen,
|
|
5021
5027
|
options = selectProps.options,
|
|
5022
5028
|
screenReaderStatus = selectProps.screenReaderStatus,
|
|
5023
|
-
tabSelectsValue = selectProps.tabSelectsValue
|
|
5029
|
+
tabSelectsValue = selectProps.tabSelectsValue,
|
|
5030
|
+
isLoading = selectProps.isLoading;
|
|
5024
5031
|
var ariaLabel = selectProps['aria-label'];
|
|
5025
5032
|
var ariaLive = selectProps['aria-live'];
|
|
5026
5033
|
|
|
@@ -5073,15 +5080,16 @@ var LiveRegion = function LiveRegion(props) {
|
|
|
5073
5080
|
isSelected: isSelected,
|
|
5074
5081
|
options: focusableOptions,
|
|
5075
5082
|
context: focused === focusedOption ? 'menu' : 'value',
|
|
5076
|
-
selectValue: selectValue
|
|
5083
|
+
selectValue: selectValue,
|
|
5084
|
+
isAppleDevice: isAppleDevice
|
|
5077
5085
|
};
|
|
5078
5086
|
focusMsg = messages.onFocus(onFocusProps);
|
|
5079
5087
|
}
|
|
5080
5088
|
return focusMsg;
|
|
5081
|
-
}, [focusedOption, focusedValue, getOptionLabel, isOptionDisabled, messages, focusableOptions, selectValue]);
|
|
5089
|
+
}, [focusedOption, focusedValue, getOptionLabel, isOptionDisabled, messages, focusableOptions, selectValue, isAppleDevice]);
|
|
5082
5090
|
var ariaResults = React.useMemo(function () {
|
|
5083
5091
|
var resultsMsg = '';
|
|
5084
|
-
if (menuIsOpen && options.length && messages.onFilter) {
|
|
5092
|
+
if (menuIsOpen && options.length && !isLoading && messages.onFilter) {
|
|
5085
5093
|
var resultsMessage = screenReaderStatus({
|
|
5086
5094
|
count: focusableOptions.length
|
|
5087
5095
|
});
|
|
@@ -5091,7 +5099,8 @@ var LiveRegion = function LiveRegion(props) {
|
|
|
5091
5099
|
});
|
|
5092
5100
|
}
|
|
5093
5101
|
return resultsMsg;
|
|
5094
|
-
}, [focusableOptions, inputValue, menuIsOpen, messages, options, screenReaderStatus]);
|
|
5102
|
+
}, [focusableOptions, inputValue, menuIsOpen, messages, options, screenReaderStatus, isLoading]);
|
|
5103
|
+
var isInitialFocus = (ariaSelection === null || ariaSelection === void 0 ? void 0 : ariaSelection.action) === 'initial-input-focus';
|
|
5095
5104
|
var ariaGuidance = React.useMemo(function () {
|
|
5096
5105
|
var guidanceMsg = '';
|
|
5097
5106
|
if (messages.guidance) {
|
|
@@ -5102,24 +5111,28 @@ var LiveRegion = function LiveRegion(props) {
|
|
|
5102
5111
|
isDisabled: focusedOption && isOptionDisabled(focusedOption, selectValue),
|
|
5103
5112
|
isMulti: isMulti,
|
|
5104
5113
|
isSearchable: isSearchable,
|
|
5105
|
-
tabSelectsValue: tabSelectsValue
|
|
5114
|
+
tabSelectsValue: tabSelectsValue,
|
|
5115
|
+
isInitialFocus: isInitialFocus
|
|
5106
5116
|
});
|
|
5107
5117
|
}
|
|
5108
5118
|
return guidanceMsg;
|
|
5109
|
-
}, [ariaLabel, focusedOption, focusedValue, isMulti, isOptionDisabled, isSearchable, menuIsOpen, messages, selectValue, tabSelectsValue]);
|
|
5110
|
-
var ariaContext = "".concat(ariaFocused, " ").concat(ariaResults, " ").concat(ariaGuidance);
|
|
5119
|
+
}, [ariaLabel, focusedOption, focusedValue, isMulti, isOptionDisabled, isSearchable, menuIsOpen, messages, selectValue, tabSelectsValue, isInitialFocus]);
|
|
5111
5120
|
var ScreenReaderText = jsx(React.Fragment, null, jsx("span", {
|
|
5112
5121
|
id: "aria-selection"
|
|
5113
5122
|
}, ariaSelected), jsx("span", {
|
|
5114
|
-
id: "aria-
|
|
5115
|
-
},
|
|
5116
|
-
|
|
5123
|
+
id: "aria-focused"
|
|
5124
|
+
}, ariaFocused), jsx("span", {
|
|
5125
|
+
id: "aria-results"
|
|
5126
|
+
}, ariaResults), jsx("span", {
|
|
5127
|
+
id: "aria-guidance"
|
|
5128
|
+
}, ariaGuidance));
|
|
5117
5129
|
return jsx(React.Fragment, null, jsx(A11yText$1, {
|
|
5118
5130
|
id: id
|
|
5119
5131
|
}, isInitialFocus && ScreenReaderText), jsx(A11yText$1, {
|
|
5120
5132
|
"aria-live": ariaLive,
|
|
5121
5133
|
"aria-atomic": "false",
|
|
5122
|
-
"aria-relevant": "additions text"
|
|
5134
|
+
"aria-relevant": "additions text",
|
|
5135
|
+
role: "log"
|
|
5123
5136
|
}, isFocused && !isInitialFocus && ScreenReaderText));
|
|
5124
5137
|
};
|
|
5125
5138
|
var LiveRegion$1 = LiveRegion;
|
|
@@ -5759,6 +5772,30 @@ var RequiredInput = function RequiredInput(_ref) {
|
|
|
5759
5772
|
};
|
|
5760
5773
|
var RequiredInput$1 = RequiredInput;
|
|
5761
5774
|
|
|
5775
|
+
/// <reference types="user-agent-data-types" />
|
|
5776
|
+
|
|
5777
|
+
function testPlatform(re) {
|
|
5778
|
+
var _window$navigator$use;
|
|
5779
|
+
return typeof window !== 'undefined' && window.navigator != null ? re.test(((_window$navigator$use = window.navigator['userAgentData']) === null || _window$navigator$use === void 0 ? void 0 : _window$navigator$use.platform) || window.navigator.platform) : false;
|
|
5780
|
+
}
|
|
5781
|
+
function isIPhone() {
|
|
5782
|
+
return testPlatform(/^iPhone/i);
|
|
5783
|
+
}
|
|
5784
|
+
function isMac() {
|
|
5785
|
+
return testPlatform(/^Mac/i);
|
|
5786
|
+
}
|
|
5787
|
+
function isIPad() {
|
|
5788
|
+
return testPlatform(/^iPad/i) ||
|
|
5789
|
+
// iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.
|
|
5790
|
+
isMac() && navigator.maxTouchPoints > 1;
|
|
5791
|
+
}
|
|
5792
|
+
function isIOS() {
|
|
5793
|
+
return isIPhone() || isIPad();
|
|
5794
|
+
}
|
|
5795
|
+
function isAppleDevice() {
|
|
5796
|
+
return isMac() || isIOS();
|
|
5797
|
+
}
|
|
5798
|
+
|
|
5762
5799
|
var formatGroupLabel = function formatGroupLabel(group) {
|
|
5763
5800
|
return group.label;
|
|
5764
5801
|
};
|
|
@@ -5928,6 +5965,24 @@ function buildFocusableOptionsFromCategorizedOptions(categorizedOptions) {
|
|
|
5928
5965
|
return optionsAccumulator;
|
|
5929
5966
|
}, []);
|
|
5930
5967
|
}
|
|
5968
|
+
function buildFocusableOptionsWithIds(categorizedOptions, optionId) {
|
|
5969
|
+
return categorizedOptions.reduce(function (optionsAccumulator, categorizedOption) {
|
|
5970
|
+
if (categorizedOption.type === 'group') {
|
|
5971
|
+
optionsAccumulator.push.apply(optionsAccumulator, _toConsumableArray(categorizedOption.options.map(function (option) {
|
|
5972
|
+
return {
|
|
5973
|
+
data: option.data,
|
|
5974
|
+
id: "".concat(optionId, "-").concat(categorizedOption.index, "-").concat(option.index)
|
|
5975
|
+
};
|
|
5976
|
+
})));
|
|
5977
|
+
} else {
|
|
5978
|
+
optionsAccumulator.push({
|
|
5979
|
+
data: categorizedOption.data,
|
|
5980
|
+
id: "".concat(optionId, "-").concat(categorizedOption.index)
|
|
5981
|
+
});
|
|
5982
|
+
}
|
|
5983
|
+
return optionsAccumulator;
|
|
5984
|
+
}, []);
|
|
5985
|
+
}
|
|
5931
5986
|
function buildFocusableOptions(props, selectValue) {
|
|
5932
5987
|
return buildFocusableOptionsFromCategorizedOptions(buildCategorizedOptions(props, selectValue));
|
|
5933
5988
|
}
|
|
@@ -5965,6 +6020,13 @@ function getNextFocusedOption(state, options) {
|
|
|
5965
6020
|
var lastFocusedOption = state.focusedOption;
|
|
5966
6021
|
return lastFocusedOption && options.indexOf(lastFocusedOption) > -1 ? lastFocusedOption : options[0];
|
|
5967
6022
|
}
|
|
6023
|
+
var getFocusedOptionId = function getFocusedOptionId(focusableOptionsWithIds, focusedOption) {
|
|
6024
|
+
var _focusableOptionsWith;
|
|
6025
|
+
var focusedOptionId = (_focusableOptionsWith = focusableOptionsWithIds.find(function (option) {
|
|
6026
|
+
return option.data === focusedOption;
|
|
6027
|
+
})) === null || _focusableOptionsWith === void 0 ? void 0 : _focusableOptionsWith.id;
|
|
6028
|
+
return focusedOptionId || null;
|
|
6029
|
+
};
|
|
5968
6030
|
var getOptionLabel = function getOptionLabel(props, data) {
|
|
5969
6031
|
return props.getOptionLabel(data);
|
|
5970
6032
|
};
|
|
@@ -6015,6 +6077,8 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
6015
6077
|
_this.state = {
|
|
6016
6078
|
ariaSelection: null,
|
|
6017
6079
|
focusedOption: null,
|
|
6080
|
+
focusedOptionId: null,
|
|
6081
|
+
focusableOptionsWithIds: [],
|
|
6018
6082
|
focusedValue: null,
|
|
6019
6083
|
inputIsHidden: false,
|
|
6020
6084
|
isFocused: false,
|
|
@@ -6022,17 +6086,18 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
6022
6086
|
clearFocusValueOnUpdate: false,
|
|
6023
6087
|
prevWasFocused: false,
|
|
6024
6088
|
inputIsHiddenAfterUpdate: undefined,
|
|
6025
|
-
prevProps: undefined
|
|
6089
|
+
prevProps: undefined,
|
|
6090
|
+
instancePrefix: ''
|
|
6026
6091
|
};
|
|
6027
6092
|
_this.blockOptionHover = false;
|
|
6028
6093
|
_this.isComposing = false;
|
|
6029
6094
|
_this.commonProps = void 0;
|
|
6030
6095
|
_this.initialTouchX = 0;
|
|
6031
6096
|
_this.initialTouchY = 0;
|
|
6032
|
-
_this.instancePrefix = '';
|
|
6033
6097
|
_this.openAfterFocus = false;
|
|
6034
6098
|
_this.scrollToFocusedOptionOnUpdate = false;
|
|
6035
6099
|
_this.userIsDragging = void 0;
|
|
6100
|
+
_this.isAppleDevice = isAppleDevice();
|
|
6036
6101
|
_this.controlRef = null;
|
|
6037
6102
|
_this.getControlRef = function (ref) {
|
|
6038
6103
|
_this.controlRef = ref;
|
|
@@ -6147,6 +6212,12 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
6147
6212
|
removedValue: lastSelectedValue
|
|
6148
6213
|
});
|
|
6149
6214
|
};
|
|
6215
|
+
_this.getFocusedOptionId = function (focusedOption) {
|
|
6216
|
+
return getFocusedOptionId(_this.state.focusableOptionsWithIds, focusedOption);
|
|
6217
|
+
};
|
|
6218
|
+
_this.getFocusableOptionsWithIds = function () {
|
|
6219
|
+
return buildFocusableOptionsWithIds(buildCategorizedOptions(_this.props, _this.state.selectValue), _this.getElementId('option'));
|
|
6220
|
+
};
|
|
6150
6221
|
_this.getValue = function () {
|
|
6151
6222
|
return _this.state.selectValue;
|
|
6152
6223
|
};
|
|
@@ -6174,7 +6245,7 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
6174
6245
|
return (_this$props$className = (_this$props$className2 = _this.props.classNames)[key]) === null || _this$props$className === void 0 ? void 0 : _this$props$className.call(_this$props$className2, props);
|
|
6175
6246
|
};
|
|
6176
6247
|
_this.getElementId = function (element) {
|
|
6177
|
-
return "".concat(_this.instancePrefix, "-").concat(element);
|
|
6248
|
+
return "".concat(_this.state.instancePrefix, "-").concat(element);
|
|
6178
6249
|
};
|
|
6179
6250
|
_this.getComponents = function () {
|
|
6180
6251
|
return defaultComponents(_this.props);
|
|
@@ -6383,8 +6454,11 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
6383
6454
|
if (_this.blockOptionHover || _this.state.focusedOption === focusedOption) {
|
|
6384
6455
|
return;
|
|
6385
6456
|
}
|
|
6457
|
+
var options = _this.getFocusableOptions();
|
|
6458
|
+
var focusedOptionIndex = options.indexOf(focusedOption);
|
|
6386
6459
|
_this.setState({
|
|
6387
|
-
focusedOption: focusedOption
|
|
6460
|
+
focusedOption: focusedOption,
|
|
6461
|
+
focusedOptionId: focusedOptionIndex > -1 ? _this.getFocusedOptionId(focusedOption) : null
|
|
6388
6462
|
});
|
|
6389
6463
|
};
|
|
6390
6464
|
_this.shouldHideSelectedOptions = function () {
|
|
@@ -6528,14 +6602,16 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
6528
6602
|
}
|
|
6529
6603
|
event.preventDefault();
|
|
6530
6604
|
};
|
|
6531
|
-
_this.instancePrefix = 'react-select-' + (_this.props.instanceId || ++instanceId);
|
|
6605
|
+
_this.state.instancePrefix = 'react-select-' + (_this.props.instanceId || ++instanceId);
|
|
6532
6606
|
_this.state.selectValue = cleanValue(_props.value);
|
|
6533
|
-
|
|
6534
6607
|
// Set focusedOption if menuIsOpen is set on init (e.g. defaultMenuIsOpen)
|
|
6535
6608
|
if (_props.menuIsOpen && _this.state.selectValue.length) {
|
|
6609
|
+
var focusableOptionsWithIds = _this.getFocusableOptionsWithIds();
|
|
6536
6610
|
var focusableOptions = _this.buildFocusableOptions();
|
|
6537
6611
|
var optionIndex = focusableOptions.indexOf(_this.state.selectValue[0]);
|
|
6612
|
+
_this.state.focusableOptionsWithIds = focusableOptionsWithIds;
|
|
6538
6613
|
_this.state.focusedOption = focusableOptions[optionIndex];
|
|
6614
|
+
_this.state.focusedOptionId = getFocusedOptionId(focusableOptionsWithIds, focusableOptions[optionIndex]);
|
|
6539
6615
|
}
|
|
6540
6616
|
return _this;
|
|
6541
6617
|
}
|
|
@@ -6660,7 +6736,8 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
6660
6736
|
this.setState({
|
|
6661
6737
|
inputIsHiddenAfterUpdate: false,
|
|
6662
6738
|
focusedValue: null,
|
|
6663
|
-
focusedOption: focusableOptions[openAtIndex]
|
|
6739
|
+
focusedOption: focusableOptions[openAtIndex],
|
|
6740
|
+
focusedOptionId: this.getFocusedOptionId(focusableOptions[openAtIndex])
|
|
6664
6741
|
}, function () {
|
|
6665
6742
|
return _this2.onMenuOpen();
|
|
6666
6743
|
});
|
|
@@ -6736,7 +6813,8 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
6736
6813
|
this.scrollToFocusedOptionOnUpdate = true;
|
|
6737
6814
|
this.setState({
|
|
6738
6815
|
focusedOption: options[nextFocus],
|
|
6739
|
-
focusedValue: null
|
|
6816
|
+
focusedValue: null,
|
|
6817
|
+
focusedOptionId: this.getFocusedOptionId(options[nextFocus])
|
|
6740
6818
|
});
|
|
6741
6819
|
}
|
|
6742
6820
|
}, {
|
|
@@ -6932,10 +7010,10 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
6932
7010
|
'aria-label': this.props['aria-label'],
|
|
6933
7011
|
'aria-labelledby': this.props['aria-labelledby'],
|
|
6934
7012
|
'aria-required': required,
|
|
6935
|
-
role: 'combobox'
|
|
7013
|
+
role: 'combobox',
|
|
7014
|
+
'aria-activedescendant': this.isAppleDevice ? undefined : this.state.focusedOptionId || ''
|
|
6936
7015
|
}, menuIsOpen && {
|
|
6937
|
-
'aria-controls': this.getElementId('listbox')
|
|
6938
|
-
'aria-owns': this.getElementId('listbox')
|
|
7016
|
+
'aria-controls': this.getElementId('listbox')
|
|
6939
7017
|
}), !isSearchable && {
|
|
6940
7018
|
'aria-readonly': true
|
|
6941
7019
|
}), this.hasValue() ? (ariaSelection === null || ariaSelection === void 0 ? void 0 : ariaSelection.action) === 'initial-input-focus' && {
|
|
@@ -7180,8 +7258,11 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
7180
7258
|
onClick: onSelect,
|
|
7181
7259
|
onMouseMove: onHover,
|
|
7182
7260
|
onMouseOver: onHover,
|
|
7183
|
-
tabIndex: -1
|
|
7261
|
+
tabIndex: -1,
|
|
7262
|
+
role: 'option',
|
|
7263
|
+
'aria-selected': _this4.isAppleDevice ? undefined : isSelected // is not supported on Apple devices
|
|
7184
7264
|
};
|
|
7265
|
+
|
|
7185
7266
|
return /*#__PURE__*/React__namespace.createElement(Option, _extends({}, commonProps, {
|
|
7186
7267
|
innerProps: innerProps,
|
|
7187
7268
|
data: data,
|
|
@@ -7250,8 +7331,7 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
7250
7331
|
innerRef: ref,
|
|
7251
7332
|
innerProps: {
|
|
7252
7333
|
onMouseDown: _this4.onMenuMouseDown,
|
|
7253
|
-
onMouseMove: _this4.onMenuMouseMove
|
|
7254
|
-
id: _this4.getElementId('listbox')
|
|
7334
|
+
onMouseMove: _this4.onMenuMouseMove
|
|
7255
7335
|
},
|
|
7256
7336
|
isLoading: isLoading,
|
|
7257
7337
|
placement: placement
|
|
@@ -7266,6 +7346,11 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
7266
7346
|
_this4.getMenuListRef(instance);
|
|
7267
7347
|
scrollTargetRef(instance);
|
|
7268
7348
|
},
|
|
7349
|
+
innerProps: {
|
|
7350
|
+
role: 'listbox',
|
|
7351
|
+
'aria-multiselectable': commonProps.isMulti,
|
|
7352
|
+
id: _this4.getElementId('listbox')
|
|
7353
|
+
},
|
|
7269
7354
|
isLoading: isLoading,
|
|
7270
7355
|
maxHeight: maxHeight,
|
|
7271
7356
|
focusedOption: focusedOption
|
|
@@ -7353,7 +7438,8 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
7353
7438
|
focusedValue: focusedValue,
|
|
7354
7439
|
isFocused: isFocused,
|
|
7355
7440
|
selectValue: selectValue,
|
|
7356
|
-
focusableOptions: focusableOptions
|
|
7441
|
+
focusableOptions: focusableOptions,
|
|
7442
|
+
isAppleDevice: this.isAppleDevice
|
|
7357
7443
|
}));
|
|
7358
7444
|
}
|
|
7359
7445
|
}, {
|
|
@@ -7402,7 +7488,8 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
7402
7488
|
inputIsHiddenAfterUpdate = state.inputIsHiddenAfterUpdate,
|
|
7403
7489
|
ariaSelection = state.ariaSelection,
|
|
7404
7490
|
isFocused = state.isFocused,
|
|
7405
|
-
prevWasFocused = state.prevWasFocused
|
|
7491
|
+
prevWasFocused = state.prevWasFocused,
|
|
7492
|
+
instancePrefix = state.instancePrefix;
|
|
7406
7493
|
var options = props.options,
|
|
7407
7494
|
value = props.value,
|
|
7408
7495
|
menuIsOpen = props.menuIsOpen,
|
|
@@ -7412,11 +7499,15 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
7412
7499
|
var newMenuOptionsState = {};
|
|
7413
7500
|
if (prevProps && (value !== prevProps.value || options !== prevProps.options || menuIsOpen !== prevProps.menuIsOpen || inputValue !== prevProps.inputValue)) {
|
|
7414
7501
|
var focusableOptions = menuIsOpen ? buildFocusableOptions(props, selectValue) : [];
|
|
7502
|
+
var focusableOptionsWithIds = menuIsOpen ? buildFocusableOptionsWithIds(buildCategorizedOptions(props, selectValue), "".concat(instancePrefix, "-option")) : [];
|
|
7415
7503
|
var focusedValue = clearFocusValueOnUpdate ? getNextFocusedValue(state, selectValue) : null;
|
|
7416
7504
|
var focusedOption = getNextFocusedOption(state, focusableOptions);
|
|
7505
|
+
var focusedOptionId = getFocusedOptionId(focusableOptionsWithIds, focusedOption);
|
|
7417
7506
|
newMenuOptionsState = {
|
|
7418
7507
|
selectValue: selectValue,
|
|
7419
7508
|
focusedOption: focusedOption,
|
|
7509
|
+
focusedOptionId: focusedOptionId,
|
|
7510
|
+
focusableOptionsWithIds: focusableOptionsWithIds,
|
|
7420
7511
|
focusedValue: focusedValue,
|
|
7421
7512
|
clearFocusValueOnUpdate: false
|
|
7422
7513
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var defaultTheme = require('./defaultTheme-50f2b88f.js');
|
|
4
|
+
|
|
5
|
+
var css_248z$1 = ".tippy-box[data-animation=fade][data-state=hidden]{opacity:0}[data-tippy-root]{max-width:calc(100vw - 10px)}.tippy-box{position:relative;background-color:#333;color:#fff;border-radius:4px;font-size:14px;line-height:1.4;white-space:normal;outline:0;transition-property:transform,visibility,opacity}.tippy-box[data-placement^=top]>.tippy-arrow{bottom:0}.tippy-box[data-placement^=top]>.tippy-arrow:before{bottom:-7px;left:0;border-width:8px 8px 0;border-top-color:initial;transform-origin:center top}.tippy-box[data-placement^=bottom]>.tippy-arrow{top:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:before{top:-7px;left:0;border-width:0 8px 8px;border-bottom-color:initial;transform-origin:center bottom}.tippy-box[data-placement^=left]>.tippy-arrow{right:0}.tippy-box[data-placement^=left]>.tippy-arrow:before{border-width:8px 0 8px 8px;border-left-color:initial;right:-7px;transform-origin:center left}.tippy-box[data-placement^=right]>.tippy-arrow{left:0}.tippy-box[data-placement^=right]>.tippy-arrow:before{left:-7px;border-width:8px 8px 8px 0;border-right-color:initial;transform-origin:center right}.tippy-box[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-arrow{width:16px;height:16px;color:#333}.tippy-arrow:before{content:\"\";position:absolute;border-color:transparent;border-style:solid}.tippy-content{position:relative;padding:5px 9px;z-index:1}";
|
|
6
|
+
defaultTheme.styleInject(css_248z$1);
|
|
7
|
+
|
|
8
|
+
var css_248z = ".tippy-box[data-animation=shift-away-subtle][data-state=hidden]{opacity:0}.tippy-box[data-animation=shift-away-subtle][data-state=hidden][data-placement^=top]{transform:translateY(5px)}.tippy-box[data-animation=shift-away-subtle][data-state=hidden][data-placement^=bottom]{transform:translateY(-5px)}.tippy-box[data-animation=shift-away-subtle][data-state=hidden][data-placement^=left]{transform:translateX(5px)}.tippy-box[data-animation=shift-away-subtle][data-state=hidden][data-placement^=right]{transform:translateX(-5px)}";
|
|
9
|
+
defaultTheme.styleInject(css_248z);
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
|
|
5
|
+
function _interopNamespace(e) {
|
|
6
|
+
if (e && e.__esModule) return e;
|
|
7
|
+
var n = Object.create(null);
|
|
8
|
+
if (e) {
|
|
9
|
+
Object.keys(e).forEach(function (k) {
|
|
10
|
+
if (k !== 'default') {
|
|
11
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
12
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return e[k];
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
n['default'] = e;
|
|
22
|
+
return Object.freeze(n);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
26
|
+
|
|
27
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
28
|
+
|
|
29
|
+
var _ref = /*#__PURE__*/React__namespace.createElement("path", {
|
|
30
|
+
fill: "currentColor",
|
|
31
|
+
d: "M10.8 15.6h2.4V18h-2.4zm0-9.6h2.4v7.2h-2.4zm1.188-6A12 12 0 1024 12 11.994 11.994 0 0011.988 0zM12 21.6a9.6 9.6 0 119.6-9.6 9.597 9.597 0 01-9.6 9.6z"
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
function SvgWarningCircle(props) {
|
|
35
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
36
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
37
|
+
viewBox: "0 0 24 24"
|
|
38
|
+
}, props), _ref);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
exports.SvgWarningCircle = SvgWarningCircle;
|