@vchasno/ui-kit 0.2.13 → 0.2.14

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.
Files changed (130) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/Datepicker/index.cjs.js +13548 -8319
  3. package/dist/Datepicker/index.cjs.js.map +1 -1
  4. package/dist/Datepicker/index.js +13552 -8323
  5. package/dist/Datepicker/index.js.map +1 -1
  6. package/dist/Datepicker/types/components/BlackTooltip/BlackTooltip.d.ts +5 -0
  7. package/dist/Datepicker/types/components/BlackTooltip/index.d.ts +2 -0
  8. package/dist/Datepicker/types/components/ProjectsPopover/ProductLink.d.ts +12 -0
  9. package/dist/Datepicker/types/components/ProjectsPopover/ProjectsPopover.d.ts +13 -0
  10. package/dist/Datepicker/types/components/ProjectsPopover/index.d.ts +2 -0
  11. package/dist/Datepicker/types/components/ProjectsPopover/mappers.d.ts +6 -0
  12. package/dist/Datepicker/types/components/ProjectsPopover/types.d.ts +7 -0
  13. package/dist/Datepicker/types/components/ProjectsPopover/utils.d.ts +9 -0
  14. package/dist/Datepicker/types/components/Select/Select.d.ts +1 -1
  15. package/dist/Datepicker/types/components/index.d.ts +2 -0
  16. package/dist/ProjectsPopover/index.cjs.js +12652 -0
  17. package/dist/ProjectsPopover/index.cjs.js.map +1 -0
  18. package/dist/ProjectsPopover/index.d.ts +27 -0
  19. package/dist/ProjectsPopover/index.js +12632 -0
  20. package/dist/ProjectsPopover/index.js.map +1 -0
  21. package/dist/ProjectsPopover/types/components/Alert/Alert.d.ts +16 -0
  22. package/dist/ProjectsPopover/types/components/Alert/index.d.ts +2 -0
  23. package/dist/ProjectsPopover/types/components/BlackTooltip/BlackTooltip.d.ts +5 -0
  24. package/dist/ProjectsPopover/types/components/BlackTooltip/index.d.ts +2 -0
  25. package/dist/ProjectsPopover/types/components/BubbleBox/BubbleBox.d.ts +17 -0
  26. package/dist/ProjectsPopover/types/components/BubbleBox/index.d.ts +3 -0
  27. package/dist/ProjectsPopover/types/components/BubbleBox/utils.d.ts +1 -0
  28. package/dist/ProjectsPopover/types/components/Button/Button.d.ts +12 -0
  29. package/dist/ProjectsPopover/types/components/Button/index.d.ts +2 -0
  30. package/dist/ProjectsPopover/types/components/Checkbox/Checkbox.d.ts +11 -0
  31. package/dist/ProjectsPopover/types/components/Checkbox/index.d.ts +2 -0
  32. package/dist/ProjectsPopover/types/components/Datepicker/DatePicker.d.ts +15 -0
  33. package/dist/ProjectsPopover/types/components/Datepicker/index.d.ts +2 -0
  34. package/dist/ProjectsPopover/types/components/FlexBox/FlexBox.d.ts +15 -0
  35. package/dist/ProjectsPopover/types/components/FlexBox/index.d.ts +2 -0
  36. package/dist/ProjectsPopover/types/components/Input/Input.d.ts +15 -0
  37. package/dist/ProjectsPopover/types/components/Input/index.d.ts +2 -0
  38. package/dist/ProjectsPopover/types/components/InputMeta/InputMeta.d.ts +8 -0
  39. package/dist/ProjectsPopover/types/components/InputMeta/index.d.ts +2 -0
  40. package/dist/ProjectsPopover/types/components/LabelText/LabelText.d.ts +8 -0
  41. package/dist/ProjectsPopover/types/components/LabelText/index.d.ts +1 -0
  42. package/dist/ProjectsPopover/types/components/MaskInput/MaskInput.d.ts +10 -0
  43. package/dist/ProjectsPopover/types/components/MaskInput/index.d.ts +2 -0
  44. package/dist/ProjectsPopover/types/components/Pagination/Pagination.d.ts +16 -0
  45. package/dist/ProjectsPopover/types/components/Pagination/index.d.ts +2 -0
  46. package/dist/ProjectsPopover/types/components/Pagination/utils.d.ts +1 -0
  47. package/dist/ProjectsPopover/types/components/Paragraph/Paragraph.d.ts +9 -0
  48. package/dist/ProjectsPopover/types/components/Paragraph/index.d.ts +2 -0
  49. package/dist/ProjectsPopover/types/components/ProjectsPopover/ProductLink.d.ts +12 -0
  50. package/dist/ProjectsPopover/types/components/ProjectsPopover/ProjectsPopover.d.ts +13 -0
  51. package/dist/ProjectsPopover/types/components/ProjectsPopover/index.d.ts +2 -0
  52. package/dist/ProjectsPopover/types/components/ProjectsPopover/mappers.d.ts +6 -0
  53. package/dist/ProjectsPopover/types/components/ProjectsPopover/types.d.ts +7 -0
  54. package/dist/ProjectsPopover/types/components/ProjectsPopover/utils.d.ts +9 -0
  55. package/dist/ProjectsPopover/types/components/PulseDot/PulseDot.d.ts +22 -0
  56. package/dist/ProjectsPopover/types/components/PulseDot/index.d.ts +2 -0
  57. package/dist/ProjectsPopover/types/components/Select/Select.d.ts +39 -0
  58. package/dist/ProjectsPopover/types/components/Select/SelectCreatable.d.ts +14 -0
  59. package/dist/ProjectsPopover/types/components/Select/customComponents.d.ts +9 -0
  60. package/dist/ProjectsPopover/types/components/Select/defaultProps.d.ts +6 -0
  61. package/dist/ProjectsPopover/types/components/Select/index.d.ts +5 -0
  62. package/dist/ProjectsPopover/types/components/Select/types.d.ts +4 -0
  63. package/dist/ProjectsPopover/types/components/Spinner/Spinner.d.ts +18 -0
  64. package/dist/ProjectsPopover/types/components/Spinner/index.d.ts +2 -0
  65. package/dist/ProjectsPopover/types/components/SplashLogo/SplashLogo.d.ts +12 -0
  66. package/dist/ProjectsPopover/types/components/SplashLogo/dataUrls.d.ts +6 -0
  67. package/dist/ProjectsPopover/types/components/SplashLogo/index.d.ts +2 -0
  68. package/dist/ProjectsPopover/types/components/SvgBorder/SvgBorder.d.ts +18 -0
  69. package/dist/ProjectsPopover/types/components/SvgBorder/index.d.ts +3 -0
  70. package/dist/ProjectsPopover/types/components/SvgBorder/utils.d.ts +1 -0
  71. package/dist/ProjectsPopover/types/components/Switch/Switch.d.ts +14 -0
  72. package/dist/ProjectsPopover/types/components/Switch/index.d.ts +2 -0
  73. package/dist/ProjectsPopover/types/components/Tabs/Tabs.d.ts +19 -0
  74. package/dist/ProjectsPopover/types/components/Tabs/index.d.ts +2 -0
  75. package/dist/ProjectsPopover/types/components/Text/Text.d.ts +14 -0
  76. package/dist/ProjectsPopover/types/components/Text/index.d.ts +2 -0
  77. package/dist/ProjectsPopover/types/components/TextAreaInput/TextAreaInput.d.ts +10 -0
  78. package/dist/ProjectsPopover/types/components/TextAreaInput/index.d.ts +2 -0
  79. package/dist/ProjectsPopover/types/components/TextInput/TextInput.d.ts +9 -0
  80. package/dist/ProjectsPopover/types/components/TextInput/index.d.ts +2 -0
  81. package/dist/ProjectsPopover/types/components/Title/Title.d.ts +9 -0
  82. package/dist/ProjectsPopover/types/components/Title/index.d.ts +2 -0
  83. package/dist/ProjectsPopover/types/components/index.d.ts +42 -0
  84. package/dist/ProjectsPopover/types/components/types.d.ts +24 -0
  85. package/dist/ProjectsPopover/types/hooks/useClientRect.d.ts +5 -0
  86. package/dist/ProjectsPopover/types/index.d.ts +2 -0
  87. package/dist/ProjectsPopover/types/utils/react.d.ts +6 -0
  88. package/dist/Select/index.cjs.js +195 -92
  89. package/dist/Select/index.cjs.js.map +1 -1
  90. package/dist/Select/index.d.ts +1 -1
  91. package/dist/Select/index.js +195 -92
  92. package/dist/Select/index.js.map +1 -1
  93. package/dist/Select/types/components/BlackTooltip/BlackTooltip.d.ts +5 -0
  94. package/dist/Select/types/components/BlackTooltip/index.d.ts +2 -0
  95. package/dist/Select/types/components/ProjectsPopover/ProductLink.d.ts +12 -0
  96. package/dist/Select/types/components/ProjectsPopover/ProjectsPopover.d.ts +13 -0
  97. package/dist/Select/types/components/ProjectsPopover/index.d.ts +2 -0
  98. package/dist/Select/types/components/ProjectsPopover/mappers.d.ts +6 -0
  99. package/dist/Select/types/components/ProjectsPopover/types.d.ts +7 -0
  100. package/dist/Select/types/components/ProjectsPopover/utils.d.ts +9 -0
  101. package/dist/Select/types/components/Select/Select.d.ts +1 -1
  102. package/dist/Select/types/components/index.d.ts +2 -0
  103. package/dist/SelectCreatable/index.cjs.js +195 -92
  104. package/dist/SelectCreatable/index.cjs.js.map +1 -1
  105. package/dist/SelectCreatable/index.js +195 -92
  106. package/dist/SelectCreatable/index.js.map +1 -1
  107. package/dist/SelectCreatable/types/components/BlackTooltip/BlackTooltip.d.ts +5 -0
  108. package/dist/SelectCreatable/types/components/BlackTooltip/index.d.ts +2 -0
  109. package/dist/SelectCreatable/types/components/ProjectsPopover/ProductLink.d.ts +12 -0
  110. package/dist/SelectCreatable/types/components/ProjectsPopover/ProjectsPopover.d.ts +13 -0
  111. package/dist/SelectCreatable/types/components/ProjectsPopover/index.d.ts +2 -0
  112. package/dist/SelectCreatable/types/components/ProjectsPopover/mappers.d.ts +6 -0
  113. package/dist/SelectCreatable/types/components/ProjectsPopover/types.d.ts +7 -0
  114. package/dist/SelectCreatable/types/components/ProjectsPopover/utils.d.ts +9 -0
  115. package/dist/SelectCreatable/types/components/Select/Select.d.ts +1 -1
  116. package/dist/SelectCreatable/types/components/index.d.ts +2 -0
  117. package/dist/index.d.ts +9 -1
  118. package/dist/index.js +12451 -365
  119. package/dist/index.js.map +1 -1
  120. package/dist/types/components/BlackTooltip/BlackTooltip.d.ts +5 -0
  121. package/dist/types/components/BlackTooltip/index.d.ts +2 -0
  122. package/dist/types/components/ProjectsPopover/ProductLink.d.ts +12 -0
  123. package/dist/types/components/ProjectsPopover/ProjectsPopover.d.ts +13 -0
  124. package/dist/types/components/ProjectsPopover/index.d.ts +2 -0
  125. package/dist/types/components/ProjectsPopover/mappers.d.ts +6 -0
  126. package/dist/types/components/ProjectsPopover/types.d.ts +7 -0
  127. package/dist/types/components/ProjectsPopover/utils.d.ts +9 -0
  128. package/dist/types/components/Select/Select.d.ts +1 -1
  129. package/dist/types/components/index.d.ts +2 -0
  130. package/package.json +45 -37
@@ -35,7 +35,7 @@ interface SelectProps extends Props, Partial<WithLabel & WithHint & LoadingFeedb
35
35
  }
36
36
  declare const Select: React.FC<SelectProps>;
37
37
  declare const SelectComponents: {
38
- ClearIndicator: <Option_1, IsMulti extends boolean, Group extends react_select.GroupBase<Option_1>>(props: react_select.ClearIndicatorProps<Option_1, IsMulti, Group>) => _emotion_react.jsx.JSX.Element;
38
+ ClearIndicator: <Option, IsMulti extends boolean, Group extends react_select.GroupBase<Option>>(props: react_select.ClearIndicatorProps<Option, IsMulti, Group>) => _emotion_react.jsx.JSX.Element;
39
39
  Control: <Option_1, IsMulti_1 extends boolean, Group_1 extends react_select.GroupBase<Option_1>>(props: react_select.ControlProps<Option_1, IsMulti_1, Group_1>) => _emotion_react.jsx.JSX.Element;
40
40
  DropdownIndicator: <Option_2, IsMulti_2 extends boolean, Group_2 extends react_select.GroupBase<Option_2>>(props: react_select.DropdownIndicatorProps<Option_2, IsMulti_2, Group_2>) => _emotion_react.jsx.JSX.Element;
41
41
  DownChevron: (props: react_select_dist_declarations_src_components_indicators.DownChevronProps) => _emotion_react.jsx.JSX.Element;
@@ -57,24 +57,24 @@ function _typeof(o) {
57
57
  }, _typeof(o);
58
58
  }
59
59
 
60
- function _toPrimitive(input, hint) {
61
- if (_typeof(input) !== "object" || input === null) return input;
62
- var prim = input[Symbol.toPrimitive];
63
- if (prim !== undefined) {
64
- var res = prim.call(input, hint || "default");
65
- if (_typeof(res) !== "object") return res;
60
+ function toPrimitive(t, r) {
61
+ if ("object" != _typeof(t) || !t) return t;
62
+ var e = t[Symbol.toPrimitive];
63
+ if (void 0 !== e) {
64
+ var i = e.call(t, r || "default");
65
+ if ("object" != _typeof(i)) return i;
66
66
  throw new TypeError("@@toPrimitive must return a primitive value.");
67
67
  }
68
- return (hint === "string" ? String : Number)(input);
68
+ return ("string" === r ? String : Number)(t);
69
69
  }
70
70
 
71
- function _toPropertyKey(arg) {
72
- var key = _toPrimitive(arg, "string");
73
- return _typeof(key) === "symbol" ? key : String(key);
71
+ function toPropertyKey(t) {
72
+ var i = toPrimitive(t, "string");
73
+ return "symbol" == _typeof(i) ? i : i + "";
74
74
  }
75
75
 
76
76
  function _defineProperty(obj, key, value) {
77
- key = _toPropertyKey(key);
77
+ key = toPropertyKey(key);
78
78
  if (key in obj) {
79
79
  Object.defineProperty(obj, key, {
80
80
  value: value,
@@ -168,12 +168,11 @@ function _slicedToArray(arr, i) {
168
168
  function _objectWithoutPropertiesLoose(source, excluded) {
169
169
  if (source == null) return {};
170
170
  var target = {};
171
- var sourceKeys = Object.keys(source);
172
- var key, i;
173
- for (i = 0; i < sourceKeys.length; i++) {
174
- key = sourceKeys[i];
175
- if (excluded.indexOf(key) >= 0) continue;
176
- target[key] = source[key];
171
+ for (var key in source) {
172
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
173
+ if (excluded.indexOf(key) >= 0) continue;
174
+ target[key] = source[key];
175
+ }
177
176
  }
178
177
  return target;
179
178
  }
@@ -288,7 +287,7 @@ function _defineProperties(target, props) {
288
287
  descriptor.enumerable = descriptor.enumerable || false;
289
288
  descriptor.configurable = true;
290
289
  if ("value" in descriptor) descriptor.writable = true;
291
- Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
290
+ Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);
292
291
  }
293
292
  }
294
293
  function _createClass(Constructor, protoProps, staticProps) {
@@ -333,15 +332,12 @@ function _getPrototypeOf(o) {
333
332
  }
334
333
 
335
334
  function _isNativeReflectConstruct() {
336
- if (typeof Reflect === "undefined" || !Reflect.construct) return false;
337
- if (Reflect.construct.sham) return false;
338
- if (typeof Proxy === "function") return true;
339
335
  try {
340
- Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
341
- return true;
342
- } catch (e) {
343
- return false;
344
- }
336
+ var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
337
+ } catch (t) {}
338
+ return (_isNativeReflectConstruct = function _isNativeReflectConstruct() {
339
+ return !!t;
340
+ })();
345
341
  }
346
342
 
347
343
  function _assertThisInitialized(self) {
@@ -4604,7 +4600,9 @@ var Control = function Control(props) {
4604
4600
  'control--is-disabled': isDisabled,
4605
4601
  'control--is-focused': isFocused,
4606
4602
  'control--menu-is-open': menuIsOpen
4607
- }), innerProps), children);
4603
+ }), innerProps, {
4604
+ "aria-disabled": isDisabled || undefined
4605
+ }), children);
4608
4606
  };
4609
4607
  var Control$1 = Control;
4610
4608
 
@@ -5040,14 +5038,14 @@ var defaultAriaLiveMessages = {
5040
5038
  guidance: function guidance(props) {
5041
5039
  var isSearchable = props.isSearchable,
5042
5040
  isMulti = props.isMulti,
5043
- isDisabled = props.isDisabled,
5044
5041
  tabSelectsValue = props.tabSelectsValue,
5045
- context = props.context;
5042
+ context = props.context,
5043
+ isInitialFocus = props.isInitialFocus;
5046
5044
  switch (context) {
5047
5045
  case 'menu':
5048
- return "Use Up and Down to choose options".concat(isDisabled ? '' : ', 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' : '', ".");
5046
+ 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' : '', ".");
5049
5047
  case 'input':
5050
- 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' : '');
5048
+ 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' : '') : '';
5051
5049
  case 'value':
5052
5050
  return 'Use left and right to toggle between focused values, press Backspace to remove the currently focused value';
5053
5051
  default:
@@ -5083,17 +5081,18 @@ var defaultAriaLiveMessages = {
5083
5081
  label = _props$label2 === void 0 ? '' : _props$label2,
5084
5082
  selectValue = props.selectValue,
5085
5083
  isDisabled = props.isDisabled,
5086
- isSelected = props.isSelected;
5084
+ isSelected = props.isSelected,
5085
+ isAppleDevice = props.isAppleDevice;
5087
5086
  var getArrayIndex = function getArrayIndex(arr, item) {
5088
5087
  return arr && arr.length ? "".concat(arr.indexOf(item) + 1, " of ").concat(arr.length) : '';
5089
5088
  };
5090
5089
  if (context === 'value' && selectValue) {
5091
5090
  return "value ".concat(label, " focused, ").concat(getArrayIndex(selectValue, focused), ".");
5092
5091
  }
5093
- if (context === 'menu') {
5092
+ if (context === 'menu' && isAppleDevice) {
5094
5093
  var disabled = isDisabled ? ' disabled' : '';
5095
- var status = "".concat(isSelected ? 'selected' : 'focused').concat(disabled);
5096
- return "option ".concat(label, " ").concat(status, ", ").concat(getArrayIndex(options, focused), ".");
5094
+ var status = "".concat(isSelected ? ' selected' : '').concat(disabled);
5095
+ return "".concat(label).concat(status, ", ").concat(getArrayIndex(options, focused), ".");
5097
5096
  }
5098
5097
  return '';
5099
5098
  },
@@ -5112,7 +5111,8 @@ var LiveRegion = function LiveRegion(props) {
5112
5111
  isFocused = props.isFocused,
5113
5112
  selectValue = props.selectValue,
5114
5113
  selectProps = props.selectProps,
5115
- id = props.id;
5114
+ id = props.id,
5115
+ isAppleDevice = props.isAppleDevice;
5116
5116
  var ariaLiveMessages = selectProps.ariaLiveMessages,
5117
5117
  getOptionLabel = selectProps.getOptionLabel,
5118
5118
  inputValue = selectProps.inputValue,
@@ -5122,7 +5122,8 @@ var LiveRegion = function LiveRegion(props) {
5122
5122
  menuIsOpen = selectProps.menuIsOpen,
5123
5123
  options = selectProps.options,
5124
5124
  screenReaderStatus = selectProps.screenReaderStatus,
5125
- tabSelectsValue = selectProps.tabSelectsValue;
5125
+ tabSelectsValue = selectProps.tabSelectsValue,
5126
+ isLoading = selectProps.isLoading;
5126
5127
  var ariaLabel = selectProps['aria-label'];
5127
5128
  var ariaLive = selectProps['aria-live'];
5128
5129
 
@@ -5175,15 +5176,16 @@ var LiveRegion = function LiveRegion(props) {
5175
5176
  isSelected: isSelected,
5176
5177
  options: focusableOptions,
5177
5178
  context: focused === focusedOption ? 'menu' : 'value',
5178
- selectValue: selectValue
5179
+ selectValue: selectValue,
5180
+ isAppleDevice: isAppleDevice
5179
5181
  };
5180
5182
  focusMsg = messages.onFocus(onFocusProps);
5181
5183
  }
5182
5184
  return focusMsg;
5183
- }, [focusedOption, focusedValue, getOptionLabel, isOptionDisabled, messages, focusableOptions, selectValue]);
5185
+ }, [focusedOption, focusedValue, getOptionLabel, isOptionDisabled, messages, focusableOptions, selectValue, isAppleDevice]);
5184
5186
  var ariaResults = useMemo(function () {
5185
5187
  var resultsMsg = '';
5186
- if (menuIsOpen && options.length && messages.onFilter) {
5188
+ if (menuIsOpen && options.length && !isLoading && messages.onFilter) {
5187
5189
  var resultsMessage = screenReaderStatus({
5188
5190
  count: focusableOptions.length
5189
5191
  });
@@ -5193,7 +5195,8 @@ var LiveRegion = function LiveRegion(props) {
5193
5195
  });
5194
5196
  }
5195
5197
  return resultsMsg;
5196
- }, [focusableOptions, inputValue, menuIsOpen, messages, options, screenReaderStatus]);
5198
+ }, [focusableOptions, inputValue, menuIsOpen, messages, options, screenReaderStatus, isLoading]);
5199
+ var isInitialFocus = (ariaSelection === null || ariaSelection === void 0 ? void 0 : ariaSelection.action) === 'initial-input-focus';
5197
5200
  var ariaGuidance = useMemo(function () {
5198
5201
  var guidanceMsg = '';
5199
5202
  if (messages.guidance) {
@@ -5204,24 +5207,28 @@ var LiveRegion = function LiveRegion(props) {
5204
5207
  isDisabled: focusedOption && isOptionDisabled(focusedOption, selectValue),
5205
5208
  isMulti: isMulti,
5206
5209
  isSearchable: isSearchable,
5207
- tabSelectsValue: tabSelectsValue
5210
+ tabSelectsValue: tabSelectsValue,
5211
+ isInitialFocus: isInitialFocus
5208
5212
  });
5209
5213
  }
5210
5214
  return guidanceMsg;
5211
- }, [ariaLabel, focusedOption, focusedValue, isMulti, isOptionDisabled, isSearchable, menuIsOpen, messages, selectValue, tabSelectsValue]);
5212
- var ariaContext = "".concat(ariaFocused, " ").concat(ariaResults, " ").concat(ariaGuidance);
5215
+ }, [ariaLabel, focusedOption, focusedValue, isMulti, isOptionDisabled, isSearchable, menuIsOpen, messages, selectValue, tabSelectsValue, isInitialFocus]);
5213
5216
  var ScreenReaderText = jsx(Fragment, null, jsx("span", {
5214
5217
  id: "aria-selection"
5215
5218
  }, ariaSelected), jsx("span", {
5216
- id: "aria-context"
5217
- }, ariaContext));
5218
- var isInitialFocus = (ariaSelection === null || ariaSelection === void 0 ? void 0 : ariaSelection.action) === 'initial-input-focus';
5219
+ id: "aria-focused"
5220
+ }, ariaFocused), jsx("span", {
5221
+ id: "aria-results"
5222
+ }, ariaResults), jsx("span", {
5223
+ id: "aria-guidance"
5224
+ }, ariaGuidance));
5219
5225
  return jsx(Fragment, null, jsx(A11yText$1, {
5220
5226
  id: id
5221
5227
  }, isInitialFocus && ScreenReaderText), jsx(A11yText$1, {
5222
5228
  "aria-live": ariaLive,
5223
5229
  "aria-atomic": "false",
5224
- "aria-relevant": "additions text"
5230
+ "aria-relevant": "additions text",
5231
+ role: "log"
5225
5232
  }, isFocused && !isInitialFocus && ScreenReaderText));
5226
5233
  };
5227
5234
  var LiveRegion$1 = LiveRegion;
@@ -5566,7 +5573,7 @@ function DummyInput(_ref) {
5566
5573
  }
5567
5574
 
5568
5575
  var cancelScroll = function cancelScroll(event) {
5569
- event.preventDefault();
5576
+ if (event.cancelable) event.preventDefault();
5570
5577
  event.stopPropagation();
5571
5578
  };
5572
5579
  function useScrollCapture(_ref) {
@@ -5861,6 +5868,30 @@ var RequiredInput = function RequiredInput(_ref) {
5861
5868
  };
5862
5869
  var RequiredInput$1 = RequiredInput;
5863
5870
 
5871
+ /// <reference types="user-agent-data-types" />
5872
+
5873
+ function testPlatform(re) {
5874
+ var _window$navigator$use;
5875
+ 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;
5876
+ }
5877
+ function isIPhone() {
5878
+ return testPlatform(/^iPhone/i);
5879
+ }
5880
+ function isMac() {
5881
+ return testPlatform(/^Mac/i);
5882
+ }
5883
+ function isIPad() {
5884
+ return testPlatform(/^iPad/i) ||
5885
+ // iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.
5886
+ isMac() && navigator.maxTouchPoints > 1;
5887
+ }
5888
+ function isIOS() {
5889
+ return isIPhone() || isIPad();
5890
+ }
5891
+ function isAppleDevice() {
5892
+ return isMac() || isIOS();
5893
+ }
5894
+
5864
5895
  var formatGroupLabel = function formatGroupLabel(group) {
5865
5896
  return group.label;
5866
5897
  };
@@ -6030,6 +6061,24 @@ function buildFocusableOptionsFromCategorizedOptions(categorizedOptions) {
6030
6061
  return optionsAccumulator;
6031
6062
  }, []);
6032
6063
  }
6064
+ function buildFocusableOptionsWithIds(categorizedOptions, optionId) {
6065
+ return categorizedOptions.reduce(function (optionsAccumulator, categorizedOption) {
6066
+ if (categorizedOption.type === 'group') {
6067
+ optionsAccumulator.push.apply(optionsAccumulator, _toConsumableArray(categorizedOption.options.map(function (option) {
6068
+ return {
6069
+ data: option.data,
6070
+ id: "".concat(optionId, "-").concat(categorizedOption.index, "-").concat(option.index)
6071
+ };
6072
+ })));
6073
+ } else {
6074
+ optionsAccumulator.push({
6075
+ data: categorizedOption.data,
6076
+ id: "".concat(optionId, "-").concat(categorizedOption.index)
6077
+ });
6078
+ }
6079
+ return optionsAccumulator;
6080
+ }, []);
6081
+ }
6033
6082
  function buildFocusableOptions(props, selectValue) {
6034
6083
  return buildFocusableOptionsFromCategorizedOptions(buildCategorizedOptions(props, selectValue));
6035
6084
  }
@@ -6067,6 +6116,13 @@ function getNextFocusedOption(state, options) {
6067
6116
  var lastFocusedOption = state.focusedOption;
6068
6117
  return lastFocusedOption && options.indexOf(lastFocusedOption) > -1 ? lastFocusedOption : options[0];
6069
6118
  }
6119
+ var getFocusedOptionId = function getFocusedOptionId(focusableOptionsWithIds, focusedOption) {
6120
+ var _focusableOptionsWith;
6121
+ var focusedOptionId = (_focusableOptionsWith = focusableOptionsWithIds.find(function (option) {
6122
+ return option.data === focusedOption;
6123
+ })) === null || _focusableOptionsWith === void 0 ? void 0 : _focusableOptionsWith.id;
6124
+ return focusedOptionId || null;
6125
+ };
6070
6126
  var getOptionLabel = function getOptionLabel(props, data) {
6071
6127
  return props.getOptionLabel(data);
6072
6128
  };
@@ -6117,6 +6173,8 @@ var Select$1 = /*#__PURE__*/function (_Component) {
6117
6173
  _this.state = {
6118
6174
  ariaSelection: null,
6119
6175
  focusedOption: null,
6176
+ focusedOptionId: null,
6177
+ focusableOptionsWithIds: [],
6120
6178
  focusedValue: null,
6121
6179
  inputIsHidden: false,
6122
6180
  isFocused: false,
@@ -6124,17 +6182,18 @@ var Select$1 = /*#__PURE__*/function (_Component) {
6124
6182
  clearFocusValueOnUpdate: false,
6125
6183
  prevWasFocused: false,
6126
6184
  inputIsHiddenAfterUpdate: undefined,
6127
- prevProps: undefined
6185
+ prevProps: undefined,
6186
+ instancePrefix: ''
6128
6187
  };
6129
6188
  _this.blockOptionHover = false;
6130
6189
  _this.isComposing = false;
6131
6190
  _this.commonProps = void 0;
6132
6191
  _this.initialTouchX = 0;
6133
6192
  _this.initialTouchY = 0;
6134
- _this.instancePrefix = '';
6135
6193
  _this.openAfterFocus = false;
6136
6194
  _this.scrollToFocusedOptionOnUpdate = false;
6137
6195
  _this.userIsDragging = void 0;
6196
+ _this.isAppleDevice = isAppleDevice();
6138
6197
  _this.controlRef = null;
6139
6198
  _this.getControlRef = function (ref) {
6140
6199
  _this.controlRef = ref;
@@ -6249,6 +6308,12 @@ var Select$1 = /*#__PURE__*/function (_Component) {
6249
6308
  removedValue: lastSelectedValue
6250
6309
  });
6251
6310
  };
6311
+ _this.getFocusedOptionId = function (focusedOption) {
6312
+ return getFocusedOptionId(_this.state.focusableOptionsWithIds, focusedOption);
6313
+ };
6314
+ _this.getFocusableOptionsWithIds = function () {
6315
+ return buildFocusableOptionsWithIds(buildCategorizedOptions(_this.props, _this.state.selectValue), _this.getElementId('option'));
6316
+ };
6252
6317
  _this.getValue = function () {
6253
6318
  return _this.state.selectValue;
6254
6319
  };
@@ -6276,7 +6341,7 @@ var Select$1 = /*#__PURE__*/function (_Component) {
6276
6341
  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);
6277
6342
  };
6278
6343
  _this.getElementId = function (element) {
6279
- return "".concat(_this.instancePrefix, "-").concat(element);
6344
+ return "".concat(_this.state.instancePrefix, "-").concat(element);
6280
6345
  };
6281
6346
  _this.getComponents = function () {
6282
6347
  return defaultComponents(_this.props);
@@ -6485,8 +6550,11 @@ var Select$1 = /*#__PURE__*/function (_Component) {
6485
6550
  if (_this.blockOptionHover || _this.state.focusedOption === focusedOption) {
6486
6551
  return;
6487
6552
  }
6553
+ var options = _this.getFocusableOptions();
6554
+ var focusedOptionIndex = options.indexOf(focusedOption);
6488
6555
  _this.setState({
6489
- focusedOption: focusedOption
6556
+ focusedOption: focusedOption,
6557
+ focusedOptionId: focusedOptionIndex > -1 ? _this.getFocusedOptionId(focusedOption) : null
6490
6558
  });
6491
6559
  };
6492
6560
  _this.shouldHideSelectedOptions = function () {
@@ -6630,14 +6698,16 @@ var Select$1 = /*#__PURE__*/function (_Component) {
6630
6698
  }
6631
6699
  event.preventDefault();
6632
6700
  };
6633
- _this.instancePrefix = 'react-select-' + (_this.props.instanceId || ++instanceId);
6701
+ _this.state.instancePrefix = 'react-select-' + (_this.props.instanceId || ++instanceId);
6634
6702
  _this.state.selectValue = cleanValue(_props.value);
6635
-
6636
6703
  // Set focusedOption if menuIsOpen is set on init (e.g. defaultMenuIsOpen)
6637
6704
  if (_props.menuIsOpen && _this.state.selectValue.length) {
6705
+ var focusableOptionsWithIds = _this.getFocusableOptionsWithIds();
6638
6706
  var focusableOptions = _this.buildFocusableOptions();
6639
6707
  var optionIndex = focusableOptions.indexOf(_this.state.selectValue[0]);
6708
+ _this.state.focusableOptionsWithIds = focusableOptionsWithIds;
6640
6709
  _this.state.focusedOption = focusableOptions[optionIndex];
6710
+ _this.state.focusedOptionId = getFocusedOptionId(focusableOptionsWithIds, focusableOptions[optionIndex]);
6641
6711
  }
6642
6712
  return _this;
6643
6713
  }
@@ -6762,7 +6832,8 @@ var Select$1 = /*#__PURE__*/function (_Component) {
6762
6832
  this.setState({
6763
6833
  inputIsHiddenAfterUpdate: false,
6764
6834
  focusedValue: null,
6765
- focusedOption: focusableOptions[openAtIndex]
6835
+ focusedOption: focusableOptions[openAtIndex],
6836
+ focusedOptionId: this.getFocusedOptionId(focusableOptions[openAtIndex])
6766
6837
  }, function () {
6767
6838
  return _this2.onMenuOpen();
6768
6839
  });
@@ -6838,7 +6909,8 @@ var Select$1 = /*#__PURE__*/function (_Component) {
6838
6909
  this.scrollToFocusedOptionOnUpdate = true;
6839
6910
  this.setState({
6840
6911
  focusedOption: options[nextFocus],
6841
- focusedValue: null
6912
+ focusedValue: null,
6913
+ focusedOptionId: this.getFocusedOptionId(options[nextFocus])
6842
6914
  });
6843
6915
  }
6844
6916
  }, {
@@ -7034,10 +7106,10 @@ var Select$1 = /*#__PURE__*/function (_Component) {
7034
7106
  'aria-label': this.props['aria-label'],
7035
7107
  'aria-labelledby': this.props['aria-labelledby'],
7036
7108
  'aria-required': required,
7037
- role: 'combobox'
7109
+ role: 'combobox',
7110
+ 'aria-activedescendant': this.isAppleDevice ? undefined : this.state.focusedOptionId || ''
7038
7111
  }, menuIsOpen && {
7039
- 'aria-controls': this.getElementId('listbox'),
7040
- 'aria-owns': this.getElementId('listbox')
7112
+ 'aria-controls': this.getElementId('listbox')
7041
7113
  }), !isSearchable && {
7042
7114
  'aria-readonly': true
7043
7115
  }), this.hasValue() ? (ariaSelection === null || ariaSelection === void 0 ? void 0 : ariaSelection.action) === 'initial-input-focus' && {
@@ -7282,8 +7354,11 @@ var Select$1 = /*#__PURE__*/function (_Component) {
7282
7354
  onClick: onSelect,
7283
7355
  onMouseMove: onHover,
7284
7356
  onMouseOver: onHover,
7285
- tabIndex: -1
7357
+ tabIndex: -1,
7358
+ role: 'option',
7359
+ 'aria-selected': _this4.isAppleDevice ? undefined : isSelected // is not supported on Apple devices
7286
7360
  };
7361
+
7287
7362
  return /*#__PURE__*/React.createElement(Option, _extends({}, commonProps, {
7288
7363
  innerProps: innerProps,
7289
7364
  data: data,
@@ -7352,8 +7427,7 @@ var Select$1 = /*#__PURE__*/function (_Component) {
7352
7427
  innerRef: ref,
7353
7428
  innerProps: {
7354
7429
  onMouseDown: _this4.onMenuMouseDown,
7355
- onMouseMove: _this4.onMenuMouseMove,
7356
- id: _this4.getElementId('listbox')
7430
+ onMouseMove: _this4.onMenuMouseMove
7357
7431
  },
7358
7432
  isLoading: isLoading,
7359
7433
  placement: placement
@@ -7368,6 +7442,11 @@ var Select$1 = /*#__PURE__*/function (_Component) {
7368
7442
  _this4.getMenuListRef(instance);
7369
7443
  scrollTargetRef(instance);
7370
7444
  },
7445
+ innerProps: {
7446
+ role: 'listbox',
7447
+ 'aria-multiselectable': commonProps.isMulti,
7448
+ id: _this4.getElementId('listbox')
7449
+ },
7371
7450
  isLoading: isLoading,
7372
7451
  maxHeight: maxHeight,
7373
7452
  focusedOption: focusedOption
@@ -7455,7 +7534,8 @@ var Select$1 = /*#__PURE__*/function (_Component) {
7455
7534
  focusedValue: focusedValue,
7456
7535
  isFocused: isFocused,
7457
7536
  selectValue: selectValue,
7458
- focusableOptions: focusableOptions
7537
+ focusableOptions: focusableOptions,
7538
+ isAppleDevice: this.isAppleDevice
7459
7539
  }));
7460
7540
  }
7461
7541
  }, {
@@ -7504,7 +7584,8 @@ var Select$1 = /*#__PURE__*/function (_Component) {
7504
7584
  inputIsHiddenAfterUpdate = state.inputIsHiddenAfterUpdate,
7505
7585
  ariaSelection = state.ariaSelection,
7506
7586
  isFocused = state.isFocused,
7507
- prevWasFocused = state.prevWasFocused;
7587
+ prevWasFocused = state.prevWasFocused,
7588
+ instancePrefix = state.instancePrefix;
7508
7589
  var options = props.options,
7509
7590
  value = props.value,
7510
7591
  menuIsOpen = props.menuIsOpen,
@@ -7514,11 +7595,15 @@ var Select$1 = /*#__PURE__*/function (_Component) {
7514
7595
  var newMenuOptionsState = {};
7515
7596
  if (prevProps && (value !== prevProps.value || options !== prevProps.options || menuIsOpen !== prevProps.menuIsOpen || inputValue !== prevProps.inputValue)) {
7516
7597
  var focusableOptions = menuIsOpen ? buildFocusableOptions(props, selectValue) : [];
7598
+ var focusableOptionsWithIds = menuIsOpen ? buildFocusableOptionsWithIds(buildCategorizedOptions(props, selectValue), "".concat(instancePrefix, "-option")) : [];
7517
7599
  var focusedValue = clearFocusValueOnUpdate ? getNextFocusedValue(state, selectValue) : null;
7518
7600
  var focusedOption = getNextFocusedOption(state, focusableOptions);
7601
+ var focusedOptionId = getFocusedOptionId(focusableOptionsWithIds, focusedOption);
7519
7602
  newMenuOptionsState = {
7520
7603
  selectValue: selectValue,
7521
7604
  focusedOption: focusedOption,
7605
+ focusedOptionId: focusedOptionId,
7606
+ focusableOptionsWithIds: focusableOptionsWithIds,
7522
7607
  focusedValue: focusedValue,
7523
7608
  clearFocusValueOnUpdate: false
7524
7609
  };
@@ -7580,39 +7665,57 @@ var classnames = {exports: {}};
7580
7665
 
7581
7666
  var hasOwn = {}.hasOwnProperty;
7582
7667
 
7583
- function classNames() {
7584
- var classes = [];
7668
+ function classNames () {
7669
+ var classes = '';
7585
7670
 
7586
7671
  for (var i = 0; i < arguments.length; i++) {
7587
7672
  var arg = arguments[i];
7588
- if (!arg) continue;
7589
-
7590
- var argType = typeof arg;
7591
-
7592
- if (argType === 'string' || argType === 'number') {
7593
- classes.push(arg);
7594
- } else if (Array.isArray(arg)) {
7595
- if (arg.length) {
7596
- var inner = classNames.apply(null, arg);
7597
- if (inner) {
7598
- classes.push(inner);
7599
- }
7600
- }
7601
- } else if (argType === 'object') {
7602
- if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
7603
- classes.push(arg.toString());
7604
- continue;
7605
- }
7606
-
7607
- for (var key in arg) {
7608
- if (hasOwn.call(arg, key) && arg[key]) {
7609
- classes.push(key);
7610
- }
7611
- }
7673
+ if (arg) {
7674
+ classes = appendClass(classes, parseValue(arg));
7612
7675
  }
7613
7676
  }
7614
7677
 
7615
- return classes.join(' ');
7678
+ return classes;
7679
+ }
7680
+
7681
+ function parseValue (arg) {
7682
+ if (typeof arg === 'string' || typeof arg === 'number') {
7683
+ return arg;
7684
+ }
7685
+
7686
+ if (typeof arg !== 'object') {
7687
+ return '';
7688
+ }
7689
+
7690
+ if (Array.isArray(arg)) {
7691
+ return classNames.apply(null, arg);
7692
+ }
7693
+
7694
+ if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
7695
+ return arg.toString();
7696
+ }
7697
+
7698
+ var classes = '';
7699
+
7700
+ for (var key in arg) {
7701
+ if (hasOwn.call(arg, key) && arg[key]) {
7702
+ classes = appendClass(classes, key);
7703
+ }
7704
+ }
7705
+
7706
+ return classes;
7707
+ }
7708
+
7709
+ function appendClass (value, newClass) {
7710
+ if (!newClass) {
7711
+ return value;
7712
+ }
7713
+
7714
+ if (value) {
7715
+ return value + ' ' + newClass;
7716
+ }
7717
+
7718
+ return value + newClass;
7616
7719
  }
7617
7720
 
7618
7721
  if (module.exports) {