@atlaskit/user-picker 10.2.2 → 10.2.3

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,11 @@
1
1
  # @atlaskit/user-picker
2
2
 
3
+ ## 10.2.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [`e8dbb0a281b`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e8dbb0a281b) - add a11y support for alert messages
8
+
3
9
  ## 10.2.2
4
10
 
5
11
  ### Patch Changes
@@ -24,6 +24,8 @@ var _batch = require("./batch");
24
24
  var _i18n = require("./i18n");
25
25
  var _utils = require("./utils");
26
26
  var _ufoExperiences = require("../util/ufoExperiences");
27
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
28
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
27
29
  function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
28
30
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
29
31
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
@@ -412,6 +414,17 @@ var BaseUserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Component) {
412
414
  this.optionsShownUfoExperienceInstance.success();
413
415
  }
414
416
  }
417
+ }, {
418
+ key: "ariaProps",
419
+ get: function get() {
420
+ var ariaLabels = Object.keys(this.props).filter(function (key) {
421
+ return key.startsWith('aria-');
422
+ });
423
+ var props = _objectSpread({}, this.props);
424
+ return ariaLabels.reduce(function (obj, key) {
425
+ return _objectSpread(_objectSpread({}, obj), {}, (0, _defineProperty2.default)({}, key, props[key]));
426
+ }, {});
427
+ }
415
428
  }, {
416
429
  key: "render",
417
430
  value: function render() {
@@ -499,7 +512,7 @@ var BaseUserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Component) {
499
512
  onKeyDown: this.handleKeyDown,
500
513
  maxPickerHeight: maxPickerHeight,
501
514
  textFieldBackgroundColor: textFieldBackgroundColor
502
- }, pickerProps));
515
+ }, this.ariaProps, pickerProps));
503
516
  }
504
517
  }], [{
505
518
  key: "getDerivedStateFromProps",
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/user-picker",
3
- "version": "10.2.2",
3
+ "version": "10.2.3",
4
4
  "sideEffects": false
5
5
  }
@@ -397,6 +397,16 @@ export class BaseUserPickerWithoutAnalytics extends React.Component {
397
397
  this.optionsShownUfoExperienceInstance.success();
398
398
  }
399
399
  }
400
+ get ariaProps() {
401
+ const ariaLabels = Object.keys(this.props).filter(key => key.startsWith('aria-'));
402
+ const props = {
403
+ ...this.props
404
+ };
405
+ return ariaLabels.reduce((obj, key) => ({
406
+ ...obj,
407
+ [key]: props[key]
408
+ }), {});
409
+ }
400
410
  render() {
401
411
  const {
402
412
  isMulti,
@@ -484,7 +494,7 @@ export class BaseUserPickerWithoutAnalytics extends React.Component {
484
494
  onKeyDown: this.handleKeyDown,
485
495
  maxPickerHeight: maxPickerHeight,
486
496
  textFieldBackgroundColor: textFieldBackgroundColor
487
- }, pickerProps));
497
+ }, this.ariaProps, pickerProps));
488
498
  }
489
499
  }
490
500
  _defineProperty(BaseUserPickerWithoutAnalytics, "defaultProps", {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/user-picker",
3
- "version": "10.2.2",
3
+ "version": "10.2.3",
4
4
  "sideEffects": false
5
5
  }
@@ -6,6 +6,8 @@ import _inherits from "@babel/runtime/helpers/inherits";
6
6
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
7
7
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
8
8
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
9
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
10
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
9
11
  function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
10
12
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
11
13
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
@@ -405,6 +407,17 @@ export var BaseUserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Compon
405
407
  this.optionsShownUfoExperienceInstance.success();
406
408
  }
407
409
  }
410
+ }, {
411
+ key: "ariaProps",
412
+ get: function get() {
413
+ var ariaLabels = Object.keys(this.props).filter(function (key) {
414
+ return key.startsWith('aria-');
415
+ });
416
+ var props = _objectSpread({}, this.props);
417
+ return ariaLabels.reduce(function (obj, key) {
418
+ return _objectSpread(_objectSpread({}, obj), {}, _defineProperty({}, key, props[key]));
419
+ }, {});
420
+ }
408
421
  }, {
409
422
  key: "render",
410
423
  value: function render() {
@@ -492,7 +505,7 @@ export var BaseUserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Compon
492
505
  onKeyDown: this.handleKeyDown,
493
506
  maxPickerHeight: maxPickerHeight,
494
507
  textFieldBackgroundColor: textFieldBackgroundColor
495
- }, pickerProps));
508
+ }, this.ariaProps, pickerProps));
496
509
  }
497
510
  }], [{
498
511
  key: "getDerivedStateFromProps",
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/user-picker",
3
- "version": "10.2.2",
3
+ "version": "10.2.3",
4
4
  "sideEffects": false
5
5
  }
@@ -51,6 +51,7 @@ export declare class BaseUserPickerWithoutAnalytics extends React.Component<Base
51
51
  handleClearIndicatorHover: (hoveringClearIndicator: boolean) => void;
52
52
  private getOptions;
53
53
  private getAppearance;
54
+ get ariaProps(): {};
54
55
  render(): JSX.Element;
55
56
  }
56
57
  export declare const BaseUserPicker: React.ForwardRefExoticComponent<Pick<Omit<BaseUserPickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "options" | "search" | "noOptionsMessage" | "placeholder" | "isDisabled" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "components" | "inputId" | "isLoading" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "styles" | "value" | "defaultValue" | "fieldId" | "width" | "menuMinWidth" | "maxPickerHeight" | "loadOptions" | "loadUserSource" | "anchor" | "open" | "onSelection" | "onClear" | "onClose" | "appearance" | "addMoreMessage" | "clearValueLabel" | "allowEmail" | "suggestEmailsForDomain" | "emailLabel" | "disableInput" | "isValidEmail" | "maxOptions" | "ariaLabelledBy" | "ariaLive" | "SelectComponent" | "pickerProps"> & Partial<Pick<Omit<BaseUserPickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "isClearable" | "isMulti" | "textFieldBackgroundColor" | "loadOptionsErrorMessage" | "subtle" | "noBorder">> & Partial<Pick<{
@@ -51,6 +51,7 @@ export declare class BaseUserPickerWithoutAnalytics extends React.Component<Base
51
51
  handleClearIndicatorHover: (hoveringClearIndicator: boolean) => void;
52
52
  private getOptions;
53
53
  private getAppearance;
54
+ get ariaProps(): {};
54
55
  render(): JSX.Element;
55
56
  }
56
57
  export declare const BaseUserPicker: React.ForwardRefExoticComponent<Pick<Omit<BaseUserPickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "options" | "search" | "noOptionsMessage" | "placeholder" | "isDisabled" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "components" | "inputId" | "isLoading" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "styles" | "value" | "defaultValue" | "fieldId" | "width" | "menuMinWidth" | "maxPickerHeight" | "loadOptions" | "loadUserSource" | "anchor" | "open" | "onSelection" | "onClear" | "onClose" | "appearance" | "addMoreMessage" | "clearValueLabel" | "allowEmail" | "suggestEmailsForDomain" | "emailLabel" | "disableInput" | "isValidEmail" | "maxOptions" | "ariaLabelledBy" | "ariaLive" | "SelectComponent" | "pickerProps"> & Partial<Pick<Omit<BaseUserPickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "isClearable" | "isMulti" | "textFieldBackgroundColor" | "loadOptionsErrorMessage" | "subtle" | "noBorder">> & Partial<Pick<{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/user-picker",
3
- "version": "10.2.2",
3
+ "version": "10.2.3",
4
4
  "description": "Fabric component for display a dropdown to select a user from",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"