@atlaskit/select 17.0.2 → 17.0.4

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,17 @@
1
1
  # @atlaskit/select
2
2
 
3
+ ## 17.0.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [#58732](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/58732) [`a3a08f8f4a03`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/a3a08f8f4a03) - update aria-describedby attribute to not be undefined
8
+
9
+ ## 17.0.3
10
+
11
+ ### Patch Changes
12
+
13
+ - [#59147](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/59147) [`f12e489f23b0`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/f12e489f23b0) - Re-build and deploy packages to NPM to resolve React/Compiled not found error (HOT-106483).
14
+
3
15
  ## 17.0.2
4
16
 
5
17
  ### Patch Changes
@@ -9,6 +9,8 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
9
9
  var _react = require("@emotion/react");
10
10
  var _countries = require("./data/countries");
11
11
  var _Select = _interopRequireDefault(require("./Select"));
12
+ /** @jsx jsx */
13
+
12
14
  // custom option renderer
13
15
  var labelStyles = (0, _react.css)({
14
16
  alignItems: 'center',
@@ -22,9 +24,9 @@ var flagStyles = (0, _react.css)({
22
24
  var Opt = function Opt(_ref) {
23
25
  var children = _ref.children,
24
26
  icon = _ref.icon;
25
- return /*#__PURE__*/React.createElement("div", {
27
+ return (0, _react.jsx)("div", {
26
28
  css: labelStyles
27
- }, /*#__PURE__*/React.createElement("span", {
29
+ }, (0, _react.jsx)("span", {
28
30
  css: flagStyles
29
31
  }, icon), children);
30
32
  };
@@ -44,7 +46,7 @@ var getOptionValue = function getOptionValue(opt) {
44
46
 
45
47
  // the text node of the control
46
48
  var controlLabel = function controlLabel(opt) {
47
- return /*#__PURE__*/React.createElement(Opt, {
49
+ return (0, _react.jsx)(Opt, {
48
50
  icon: opt.icon
49
51
  }, opt.abbr.toUpperCase());
50
52
  };
@@ -54,7 +56,7 @@ var optionLabel = function optionLabel(_ref3) {
54
56
  code = _ref3.code,
55
57
  icon = _ref3.icon,
56
58
  name = _ref3.name;
57
- return /*#__PURE__*/React.createElement(Opt, {
59
+ return (0, _react.jsx)(Opt, {
58
60
  icon: icon
59
61
  }, getOptionLabel({
60
62
  abbr: abbr,
@@ -71,7 +73,7 @@ var formatOptionLabel = function formatOptionLabel(opt, _ref4) {
71
73
 
72
74
  // put it all together
73
75
  var CountrySelect = function CountrySelect(props) {
74
- return /*#__PURE__*/React.createElement(_Select.default, (0, _extends2.default)({
76
+ return (0, _react.jsx)(_Select.default, (0, _extends2.default)({
75
77
  isClearable: false,
76
78
  formatOptionLabel: formatOptionLabel,
77
79
  getOptionLabel: getOptionLabel,
@@ -14,6 +14,7 @@ var _search = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/search
14
14
  var _constants = require("@atlaskit/theme/constants");
15
15
  var _colors = require("@atlaskit/theme/colors");
16
16
  var _excluded = ["innerRef", "innerProps"];
17
+ /** @jsx jsx */
17
18
  // ==============================
18
19
  // Styled Components
19
20
  // ==============================
@@ -30,7 +31,7 @@ var MenuDialog = exports.MenuDialog = function MenuDialog(_ref) {
30
31
  id = _ref.id,
31
32
  style = _ref.style,
32
33
  testId = _ref.testId;
33
- return /*#__PURE__*/React.createElement("div", {
34
+ return (0, _react.jsx)("div", {
34
35
  css: [menuDialogStyles,
35
36
  // There is not a limited amount of values for the widths, so they need
36
37
  // to remain dynamic.
@@ -55,9 +56,9 @@ var dropdownStyles = (0, _react.css)({
55
56
  width: 32
56
57
  });
57
58
  var DropdownIndicator = function DropdownIndicator() {
58
- return /*#__PURE__*/React.createElement("div", {
59
+ return (0, _react.jsx)("div", {
59
60
  css: dropdownStyles
60
- }, /*#__PURE__*/React.createElement(_search.default, {
61
+ }, (0, _react.jsx)(_search.default, {
61
62
  label: "open"
62
63
  }));
63
64
  };
@@ -68,22 +69,22 @@ var Control = function Control(_ref2) {
68
69
  var innerRef = _ref2.innerRef,
69
70
  innerProps = _ref2.innerProps,
70
71
  props = (0, _objectWithoutProperties2.default)(_ref2, _excluded);
71
- return /*#__PURE__*/React.createElement("div", {
72
+ return (0, _react.jsx)("div", {
72
73
  ref: innerRef,
73
74
  css: controlStyles
74
- }, /*#__PURE__*/React.createElement(_reactSelect.components.Control, (0, _extends2.default)({}, props, {
75
+ }, (0, _react.jsx)(_reactSelect.components.Control, (0, _extends2.default)({}, props, {
75
76
  innerProps: innerProps
76
77
  })));
77
78
  };
78
79
  var DummyControl = exports.DummyControl = function DummyControl(props) {
79
- return /*#__PURE__*/React.createElement(_visuallyHidden.default, null, /*#__PURE__*/React.createElement(_reactSelect.components.Control, props));
80
+ return (0, _react.jsx)(_visuallyHidden.default, null, (0, _react.jsx)(_reactSelect.components.Control, props));
80
81
  };
81
82
 
82
83
  // NOTE `props` intentionally omitted from `Fragment`
83
84
  var Menu = function Menu(_ref3) {
84
85
  var children = _ref3.children,
85
86
  innerProps = _ref3.innerProps;
86
- return /*#__PURE__*/React.createElement("div", innerProps, children);
87
+ return (0, _react.jsx)("div", innerProps, children);
87
88
  };
88
89
  var defaultComponents = exports.defaultComponents = {
89
90
  Control: Control,
@@ -9,7 +9,7 @@ var _reactSelect = _interopRequireDefault(require("react-select"));
9
9
  var _analyticsNext = require("@atlaskit/analytics-next");
10
10
  var _createSelect = _interopRequireDefault(require("./createSelect"));
11
11
  var packageName = "@atlaskit/select";
12
- var packageVersion = "17.0.2";
12
+ var packageVersion = "17.0.4";
13
13
  var SelectWithoutAnalytics = exports.SelectWithoutAnalytics = (0, _createSelect.default)(_reactSelect.default);
14
14
  var createAndFireEventOnAtlaskit = (0, _analyticsNext.createAndFireEvent)('atlaskit');
15
15
  var _default = exports.default = (0, _analyticsNext.withAnalyticsContext)({
@@ -28,6 +28,8 @@ var _react = require("@emotion/react");
28
28
  var _selectClear = _interopRequireDefault(require("@atlaskit/icon/glyph/select-clear"));
29
29
  var _reactSelect = require("react-select");
30
30
  var _indicators = require("./indicators");
31
+ /** @jsx jsx */
32
+
31
33
  var disabledStyles = (0, _react.css)({
32
34
  display: 'none'
33
35
  });
@@ -36,10 +38,10 @@ var enabledStyles = (0, _react.css)({
36
38
  });
37
39
  var MultiValueRemove = exports.MultiValueRemove = function MultiValueRemove(props) {
38
40
  var isDisabled = props.selectProps.isDisabled;
39
- return /*#__PURE__*/React.createElement(_reactSelect.components.MultiValueRemove, props, /*#__PURE__*/React.createElement("div", {
41
+ return (0, _react.jsx)(_reactSelect.components.MultiValueRemove, props, (0, _react.jsx)("div", {
40
42
  css: isDisabled ? disabledStyles : enabledStyles,
41
43
  "data-testid": isDisabled ? 'hide-clear-icon' : 'show-clear-icon'
42
- }, /*#__PURE__*/React.createElement(_selectClear.default, {
44
+ }, (0, _react.jsx)(_selectClear.default, {
43
45
  label: "Clear",
44
46
  size: "small",
45
47
  primaryColor: "transparent",
@@ -13,7 +13,7 @@ var _spinner = _interopRequireDefault(require("@atlaskit/spinner"));
13
13
  var _selectClear = _interopRequireDefault(require("@atlaskit/icon/glyph/select-clear"));
14
14
  var _chevronDown = _interopRequireDefault(require("@atlaskit/icon/glyph/chevron-down"));
15
15
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
16
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
16
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } /** @jsx jsx */
17
17
  var iconContainerStyles = (0, _react.css)({
18
18
  all: 'unset',
19
19
  outline: 'revert',
@@ -21,34 +21,33 @@ var iconContainerStyles = (0, _react.css)({
21
21
  alignItems: 'center'
22
22
  });
23
23
  var ClearIndicator = exports.ClearIndicator = function ClearIndicator(props) {
24
- return /*#__PURE__*/React.createElement(_reactSelect.components.ClearIndicator, _objectSpread(_objectSpread({}, props), {}, {
24
+ return (0, _react.jsx)(_reactSelect.components.ClearIndicator, _objectSpread(_objectSpread({}, props), {}, {
25
25
  innerProps: _objectSpread(_objectSpread({}, props.innerProps), {}, {
26
26
  'aria-hidden': 'false'
27
27
  })
28
- }), /*#__PURE__*/React.createElement("button", {
28
+ }), (0, _react.jsx)("button", {
29
29
  css: iconContainerStyles,
30
30
  type: "button",
31
31
  tabIndex: -1
32
- }, /*#__PURE__*/React.createElement(_selectClear.default, {
32
+ }, (0, _react.jsx)(_selectClear.default, {
33
33
  size: "small",
34
34
  label: "clear"
35
35
  })));
36
36
  };
37
37
  var DropdownIndicator = exports.DropdownIndicator = function DropdownIndicator(props) {
38
- return /*#__PURE__*/React.createElement(_reactSelect.components.DropdownIndicator, props, /*#__PURE__*/React.createElement(_chevronDown.default, {
38
+ return (0, _react.jsx)(_reactSelect.components.DropdownIndicator, props, (0, _react.jsx)(_chevronDown.default, {
39
39
  label: "open"
40
40
  }));
41
41
  };
42
42
  var LoadingIndicator = exports.LoadingIndicator = function LoadingIndicator(props) {
43
43
  var loadingStyles = (0, _react.css)(props.getStyles('loadingIndicator', props));
44
44
  return (
45
- /*#__PURE__*/
46
45
  // This *must* be constructed this way because this is being consumed by
47
46
  // `react-select` and we don't control what it wants.
48
47
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
49
- React.createElement("div", (0, _extends2.default)({
48
+ (0, _react.jsx)("div", (0, _extends2.default)({
50
49
  css: loadingStyles
51
- }, props.innerProps), /*#__PURE__*/React.createElement(_spinner.default, {
50
+ }, props.innerProps), (0, _react.jsx)(_spinner.default, {
52
51
  size: "small"
53
52
  }))
54
53
  );
@@ -9,9 +9,14 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
9
9
  var _react = _interopRequireDefault(require("react"));
10
10
  var _reactSelect = require("react-select");
11
11
  var Input = exports.Input = function Input(props) {
12
+ var ariaDescribedByAttribute;
12
13
  var passed_describedby = props.selectProps['aria-describedby'];
13
- var describedby = props['aria-describedby'] + (passed_describedby ? ' ' + passed_describedby : '');
14
+ if (props['aria-describedby'] && passed_describedby) {
15
+ ariaDescribedByAttribute = props['aria-describedby'] + ' ' + passed_describedby;
16
+ } else {
17
+ ariaDescribedByAttribute = props['aria-describedby'] || passed_describedby;
18
+ }
14
19
  return /*#__PURE__*/_react.default.createElement(_reactSelect.components.Input, (0, _extends2.default)({}, props, {
15
- "aria-describedby": describedby
20
+ "aria-describedby": ariaDescribedByAttribute
16
21
  }));
17
22
  };
@@ -25,7 +25,7 @@ var _excluded = ["getStyles", "Icon", "children", "innerProps", "innerRef"];
25
25
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
26
26
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
27
27
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
28
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
28
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } /** @jsx jsx */
29
29
  var getPrimitiveStyles = function getPrimitiveStyles(props) {
30
30
  var cx = props.cx,
31
31
  className = props.className,
@@ -201,15 +201,14 @@ var ControlOption = /*#__PURE__*/function (_Component) {
201
201
  styles = _getPrimitiveStyles2[0],
202
202
  classes = _getPrimitiveStyles2[1];
203
203
  return (
204
- /*#__PURE__*/
205
204
  // These need to remain this way because `react-select` passes props with
206
205
  // styles inside, and that must be done dynamically.
207
206
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
208
- React.createElement("div", (0, _extends2.default)({
207
+ (0, _react.jsx)("div", (0, _extends2.default)({
209
208
  css: styles,
210
209
  className: classes,
211
210
  ref: innerRef
212
- }, props), /*#__PURE__*/React.createElement("div", {
211
+ }, props), (0, _react.jsx)("div", {
213
212
  css: [baseIconStyles,
214
213
  // Here we are adding a border to the Checkbox and Radio SVG icons
215
214
  // This is an a11y fix for Select only for now but it may be rolled
@@ -226,11 +225,11 @@ var ControlOption = /*#__PURE__*/function (_Component) {
226
225
  stroke: getBorderColor(_objectSpread(_objectSpread({}, this.props), this.state))
227
226
  }
228
227
  }]
229
- }, !!Icon ? /*#__PURE__*/React.createElement(Icon, {
228
+ }, !!Icon ? (0, _react.jsx)(Icon, {
230
229
  label: "",
231
230
  primaryColor: getPrimaryColor(_objectSpread(_objectSpread({}, this.props), this.state)),
232
231
  secondaryColor: getSecondaryColor(_objectSpread(_objectSpread({}, this.props), this.state))
233
- }) : null), /*#__PURE__*/React.createElement("div", {
232
+ }) : null), (0, _react.jsx)("div", {
234
233
  css: baseOptionStyles
235
234
  }, children))
236
235
  );
@@ -239,12 +238,12 @@ var ControlOption = /*#__PURE__*/function (_Component) {
239
238
  return ControlOption;
240
239
  }(_react2.Component);
241
240
  var CheckboxOption = exports.CheckboxOption = function CheckboxOption(props) {
242
- return /*#__PURE__*/React.createElement(ControlOption, (0, _extends2.default)({
241
+ return (0, _react.jsx)(ControlOption, (0, _extends2.default)({
243
242
  Icon: _checkbox.default
244
243
  }, props));
245
244
  };
246
245
  var RadioOption = exports.RadioOption = function RadioOption(props) {
247
- return /*#__PURE__*/React.createElement(ControlOption, (0, _extends2.default)({
246
+ return (0, _react.jsx)(ControlOption, (0, _extends2.default)({
248
247
  Icon: _radio.default
249
248
  }, props));
250
249
  };
@@ -1,5 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
- import { css } from '@emotion/react';
2
+ /** @jsx jsx */
3
+
4
+ import { jsx, css } from '@emotion/react';
3
5
  import { groupedCountries } from './data/countries';
4
6
  import Select from './Select';
5
7
  // custom option renderer
@@ -15,9 +17,9 @@ const flagStyles = css({
15
17
  const Opt = ({
16
18
  children,
17
19
  icon
18
- }) => /*#__PURE__*/React.createElement("div", {
20
+ }) => jsx("div", {
19
21
  css: labelStyles
20
- }, /*#__PURE__*/React.createElement("span", {
22
+ }, jsx("span", {
21
23
  css: flagStyles
22
24
  }, icon), children);
23
25
 
@@ -32,7 +34,7 @@ const getOptionLabel = ({
32
34
  const getOptionValue = opt => opt.abbr;
33
35
 
34
36
  // the text node of the control
35
- const controlLabel = opt => /*#__PURE__*/React.createElement(Opt, {
37
+ const controlLabel = opt => jsx(Opt, {
36
38
  icon: opt.icon
37
39
  }, opt.abbr.toUpperCase());
38
40
  // the text node for an option
@@ -41,7 +43,7 @@ const optionLabel = ({
41
43
  code,
42
44
  icon,
43
45
  name
44
- }) => /*#__PURE__*/React.createElement(Opt, {
46
+ }) => jsx(Opt, {
45
47
  icon: icon
46
48
  }, getOptionLabel({
47
49
  abbr,
@@ -55,7 +57,7 @@ const formatOptionLabel = (opt, {
55
57
  }) => context === 'value' ? controlLabel(opt) : optionLabel(opt);
56
58
 
57
59
  // put it all together
58
- const CountrySelect = props => /*#__PURE__*/React.createElement(Select, _extends({
60
+ const CountrySelect = props => jsx(Select, _extends({
59
61
  isClearable: false,
60
62
  formatOptionLabel: formatOptionLabel,
61
63
  getOptionLabel: getOptionLabel,
@@ -1,6 +1,8 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
+ /** @jsx jsx */
3
+
2
4
  import { components } from 'react-select';
3
- import { css } from '@emotion/react';
5
+ import { css, jsx } from '@emotion/react';
4
6
  import VisuallyHidden from '@atlaskit/visually-hidden';
5
7
  import SearchIcon from '@atlaskit/icon/glyph/editor/search';
6
8
  import { layers } from '@atlaskit/theme/constants';
@@ -22,7 +24,7 @@ export const MenuDialog = ({
22
24
  id,
23
25
  style,
24
26
  testId
25
- }) => /*#__PURE__*/React.createElement("div", {
27
+ }) => jsx("div", {
26
28
  css: [menuDialogStyles,
27
29
  // There is not a limited amount of values for the widths, so they need
28
30
  // to remain dynamic.
@@ -45,9 +47,9 @@ const dropdownStyles = css({
45
47
  textAlign: 'center',
46
48
  width: 32
47
49
  });
48
- const DropdownIndicator = () => /*#__PURE__*/React.createElement("div", {
50
+ const DropdownIndicator = () => jsx("div", {
49
51
  css: dropdownStyles
50
- }, /*#__PURE__*/React.createElement(SearchIcon, {
52
+ }, jsx(SearchIcon, {
51
53
  label: "open"
52
54
  }));
53
55
  const controlStyles = css({
@@ -57,19 +59,19 @@ const Control = ({
57
59
  innerRef,
58
60
  innerProps,
59
61
  ...props
60
- }) => /*#__PURE__*/React.createElement("div", {
62
+ }) => jsx("div", {
61
63
  ref: innerRef,
62
64
  css: controlStyles
63
- }, /*#__PURE__*/React.createElement(components.Control, _extends({}, props, {
65
+ }, jsx(components.Control, _extends({}, props, {
64
66
  innerProps: innerProps
65
67
  })));
66
- export const DummyControl = props => /*#__PURE__*/React.createElement(VisuallyHidden, null, /*#__PURE__*/React.createElement(components.Control, props));
68
+ export const DummyControl = props => jsx(VisuallyHidden, null, jsx(components.Control, props));
67
69
 
68
70
  // NOTE `props` intentionally omitted from `Fragment`
69
71
  const Menu = ({
70
72
  children,
71
73
  innerProps
72
- }) => /*#__PURE__*/React.createElement("div", innerProps, children);
74
+ }) => jsx("div", innerProps, children);
73
75
  export const defaultComponents = {
74
76
  Control,
75
77
  DropdownIndicator,
@@ -2,7 +2,7 @@ import Select from 'react-select';
2
2
  import { withAnalyticsEvents, withAnalyticsContext, createAndFireEvent } from '@atlaskit/analytics-next';
3
3
  import createSelect from './createSelect';
4
4
  const packageName = "@atlaskit/select";
5
- const packageVersion = "17.0.2";
5
+ const packageVersion = "17.0.4";
6
6
  export const SelectWithoutAnalytics = createSelect(Select);
7
7
  const createAndFireEventOnAtlaskit = createAndFireEvent('atlaskit');
8
8
  export default withAnalyticsContext({
@@ -1,4 +1,5 @@
1
- import { css } from '@emotion/react';
1
+ /** @jsx jsx */
2
+ import { jsx, css } from '@emotion/react';
2
3
  import SelectClearIcon from '@atlaskit/icon/glyph/select-clear';
3
4
  import { components } from 'react-select';
4
5
  export { ClearIndicator, DropdownIndicator, LoadingIndicator } from './indicators';
@@ -12,10 +13,10 @@ export const MultiValueRemove = props => {
12
13
  const {
13
14
  isDisabled
14
15
  } = props.selectProps;
15
- return /*#__PURE__*/React.createElement(components.MultiValueRemove, props, /*#__PURE__*/React.createElement("div", {
16
+ return jsx(components.MultiValueRemove, props, jsx("div", {
16
17
  css: isDisabled ? disabledStyles : enabledStyles,
17
18
  "data-testid": isDisabled ? 'hide-clear-icon' : 'show-clear-icon'
18
- }, /*#__PURE__*/React.createElement(SelectClearIcon, {
19
+ }, jsx(SelectClearIcon, {
19
20
  label: "Clear",
20
21
  size: "small",
21
22
  primaryColor: "transparent",
@@ -1,5 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
- import { css } from '@emotion/react';
2
+ /** @jsx jsx */
3
+ import { jsx, css } from '@emotion/react';
3
4
  import { components } from 'react-select';
4
5
  import Spinner from '@atlaskit/spinner';
5
6
  import SelectClearIcon from '@atlaskit/icon/glyph/select-clear';
@@ -10,32 +11,31 @@ const iconContainerStyles = css({
10
11
  display: 'flex',
11
12
  alignItems: 'center'
12
13
  });
13
- export const ClearIndicator = props => /*#__PURE__*/React.createElement(components.ClearIndicator, _extends({}, props, {
14
+ export const ClearIndicator = props => jsx(components.ClearIndicator, _extends({}, props, {
14
15
  innerProps: {
15
16
  ...props.innerProps,
16
17
  'aria-hidden': 'false'
17
18
  }
18
- }), /*#__PURE__*/React.createElement("button", {
19
+ }), jsx("button", {
19
20
  css: iconContainerStyles,
20
21
  type: "button",
21
22
  tabIndex: -1
22
- }, /*#__PURE__*/React.createElement(SelectClearIcon, {
23
+ }, jsx(SelectClearIcon, {
23
24
  size: "small",
24
25
  label: "clear"
25
26
  })));
26
- export const DropdownIndicator = props => /*#__PURE__*/React.createElement(components.DropdownIndicator, props, /*#__PURE__*/React.createElement(DownIcon, {
27
+ export const DropdownIndicator = props => jsx(components.DropdownIndicator, props, jsx(DownIcon, {
27
28
  label: "open"
28
29
  }));
29
30
  export const LoadingIndicator = props => {
30
31
  const loadingStyles = css(props.getStyles('loadingIndicator', props));
31
32
  return (
32
- /*#__PURE__*/
33
33
  // This *must* be constructed this way because this is being consumed by
34
34
  // `react-select` and we don't control what it wants.
35
35
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
36
- React.createElement("div", _extends({
36
+ jsx("div", _extends({
37
37
  css: loadingStyles
38
- }, props.innerProps), /*#__PURE__*/React.createElement(Spinner, {
38
+ }, props.innerProps), jsx(Spinner, {
39
39
  size: "small"
40
40
  }))
41
41
  );
@@ -2,9 +2,14 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
  import React from 'react';
3
3
  import { components } from 'react-select';
4
4
  export const Input = props => {
5
+ let ariaDescribedByAttribute;
5
6
  const passed_describedby = props.selectProps['aria-describedby'];
6
- const describedby = props['aria-describedby'] + (passed_describedby ? ' ' + passed_describedby : '');
7
+ if (props['aria-describedby'] && passed_describedby) {
8
+ ariaDescribedByAttribute = props['aria-describedby'] + ' ' + passed_describedby;
9
+ } else {
10
+ ariaDescribedByAttribute = props['aria-describedby'] || passed_describedby;
11
+ }
7
12
  return /*#__PURE__*/React.createElement(components.Input, _extends({}, props, {
8
- "aria-describedby": describedby
13
+ "aria-describedby": ariaDescribedByAttribute
9
14
  }));
10
15
  };
@@ -1,6 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
- import { css } from '@emotion/react';
3
+ /** @jsx jsx */
4
+ import { css, jsx } from '@emotion/react';
4
5
  import { Component } from 'react';
5
6
  import { getBooleanFF } from '@atlaskit/platform-feature-flags';
6
7
  import RadioIcon from '@atlaskit/icon/glyph/radio';
@@ -173,15 +174,14 @@ class ControlOption extends Component {
173
174
  ...rest
174
175
  });
175
176
  return (
176
- /*#__PURE__*/
177
177
  // These need to remain this way because `react-select` passes props with
178
178
  // styles inside, and that must be done dynamically.
179
179
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
180
- React.createElement("div", _extends({
180
+ jsx("div", _extends({
181
181
  css: styles,
182
182
  className: classes,
183
183
  ref: innerRef
184
- }, props), /*#__PURE__*/React.createElement("div", {
184
+ }, props), jsx("div", {
185
185
  css: [baseIconStyles,
186
186
  // Here we are adding a border to the Checkbox and Radio SVG icons
187
187
  // This is an a11y fix for Select only for now but it may be rolled
@@ -201,7 +201,7 @@ class ControlOption extends Component {
201
201
  })
202
202
  }
203
203
  }]
204
- }, !!Icon ? /*#__PURE__*/React.createElement(Icon, {
204
+ }, !!Icon ? jsx(Icon, {
205
205
  label: "",
206
206
  primaryColor: getPrimaryColor({
207
207
  ...this.props,
@@ -211,15 +211,15 @@ class ControlOption extends Component {
211
211
  ...this.props,
212
212
  ...this.state
213
213
  })
214
- }) : null), /*#__PURE__*/React.createElement("div", {
214
+ }) : null), jsx("div", {
215
215
  css: baseOptionStyles
216
216
  }, children))
217
217
  );
218
218
  }
219
219
  }
220
- export const CheckboxOption = props => /*#__PURE__*/React.createElement(ControlOption, _extends({
220
+ export const CheckboxOption = props => jsx(ControlOption, _extends({
221
221
  Icon: CheckboxIcon
222
222
  }, props));
223
- export const RadioOption = props => /*#__PURE__*/React.createElement(ControlOption, _extends({
223
+ export const RadioOption = props => jsx(ControlOption, _extends({
224
224
  Icon: RadioIcon
225
225
  }, props));
@@ -1,5 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
- import { css } from '@emotion/react';
2
+ /** @jsx jsx */
3
+
4
+ import { jsx, css } from '@emotion/react';
3
5
  import { groupedCountries } from './data/countries';
4
6
  import Select from './Select';
5
7
  // custom option renderer
@@ -15,9 +17,9 @@ var flagStyles = css({
15
17
  var Opt = function Opt(_ref) {
16
18
  var children = _ref.children,
17
19
  icon = _ref.icon;
18
- return /*#__PURE__*/React.createElement("div", {
20
+ return jsx("div", {
19
21
  css: labelStyles
20
- }, /*#__PURE__*/React.createElement("span", {
22
+ }, jsx("span", {
21
23
  css: flagStyles
22
24
  }, icon), children);
23
25
  };
@@ -37,7 +39,7 @@ var getOptionValue = function getOptionValue(opt) {
37
39
 
38
40
  // the text node of the control
39
41
  var controlLabel = function controlLabel(opt) {
40
- return /*#__PURE__*/React.createElement(Opt, {
42
+ return jsx(Opt, {
41
43
  icon: opt.icon
42
44
  }, opt.abbr.toUpperCase());
43
45
  };
@@ -47,7 +49,7 @@ var optionLabel = function optionLabel(_ref3) {
47
49
  code = _ref3.code,
48
50
  icon = _ref3.icon,
49
51
  name = _ref3.name;
50
- return /*#__PURE__*/React.createElement(Opt, {
52
+ return jsx(Opt, {
51
53
  icon: icon
52
54
  }, getOptionLabel({
53
55
  abbr: abbr,
@@ -64,7 +66,7 @@ var formatOptionLabel = function formatOptionLabel(opt, _ref4) {
64
66
 
65
67
  // put it all together
66
68
  var CountrySelect = function CountrySelect(props) {
67
- return /*#__PURE__*/React.createElement(Select, _extends({
69
+ return jsx(Select, _extends({
68
70
  isClearable: false,
69
71
  formatOptionLabel: formatOptionLabel,
70
72
  getOptionLabel: getOptionLabel,
@@ -1,8 +1,10 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
3
  var _excluded = ["innerRef", "innerProps"];
4
+ /** @jsx jsx */
5
+
4
6
  import { components } from 'react-select';
5
- import { css } from '@emotion/react';
7
+ import { css, jsx } from '@emotion/react';
6
8
  import VisuallyHidden from '@atlaskit/visually-hidden';
7
9
  import SearchIcon from '@atlaskit/icon/glyph/editor/search';
8
10
  import { layers } from '@atlaskit/theme/constants';
@@ -24,7 +26,7 @@ export var MenuDialog = function MenuDialog(_ref) {
24
26
  id = _ref.id,
25
27
  style = _ref.style,
26
28
  testId = _ref.testId;
27
- return /*#__PURE__*/React.createElement("div", {
29
+ return jsx("div", {
28
30
  css: [menuDialogStyles,
29
31
  // There is not a limited amount of values for the widths, so they need
30
32
  // to remain dynamic.
@@ -49,9 +51,9 @@ var dropdownStyles = css({
49
51
  width: 32
50
52
  });
51
53
  var DropdownIndicator = function DropdownIndicator() {
52
- return /*#__PURE__*/React.createElement("div", {
54
+ return jsx("div", {
53
55
  css: dropdownStyles
54
- }, /*#__PURE__*/React.createElement(SearchIcon, {
56
+ }, jsx(SearchIcon, {
55
57
  label: "open"
56
58
  }));
57
59
  };
@@ -62,22 +64,22 @@ var Control = function Control(_ref2) {
62
64
  var innerRef = _ref2.innerRef,
63
65
  innerProps = _ref2.innerProps,
64
66
  props = _objectWithoutProperties(_ref2, _excluded);
65
- return /*#__PURE__*/React.createElement("div", {
67
+ return jsx("div", {
66
68
  ref: innerRef,
67
69
  css: controlStyles
68
- }, /*#__PURE__*/React.createElement(components.Control, _extends({}, props, {
70
+ }, jsx(components.Control, _extends({}, props, {
69
71
  innerProps: innerProps
70
72
  })));
71
73
  };
72
74
  export var DummyControl = function DummyControl(props) {
73
- return /*#__PURE__*/React.createElement(VisuallyHidden, null, /*#__PURE__*/React.createElement(components.Control, props));
75
+ return jsx(VisuallyHidden, null, jsx(components.Control, props));
74
76
  };
75
77
 
76
78
  // NOTE `props` intentionally omitted from `Fragment`
77
79
  var Menu = function Menu(_ref3) {
78
80
  var children = _ref3.children,
79
81
  innerProps = _ref3.innerProps;
80
- return /*#__PURE__*/React.createElement("div", innerProps, children);
82
+ return jsx("div", innerProps, children);
81
83
  };
82
84
  export var defaultComponents = {
83
85
  Control: Control,
@@ -2,7 +2,7 @@ import Select from 'react-select';
2
2
  import { withAnalyticsEvents, withAnalyticsContext, createAndFireEvent } from '@atlaskit/analytics-next';
3
3
  import createSelect from './createSelect';
4
4
  var packageName = "@atlaskit/select";
5
- var packageVersion = "17.0.2";
5
+ var packageVersion = "17.0.4";
6
6
  export var SelectWithoutAnalytics = createSelect(Select);
7
7
  var createAndFireEventOnAtlaskit = createAndFireEvent('atlaskit');
8
8
  export default withAnalyticsContext({
@@ -1,4 +1,5 @@
1
- import { css } from '@emotion/react';
1
+ /** @jsx jsx */
2
+ import { jsx, css } from '@emotion/react';
2
3
  import SelectClearIcon from '@atlaskit/icon/glyph/select-clear';
3
4
  import { components } from 'react-select';
4
5
  export { ClearIndicator, DropdownIndicator, LoadingIndicator } from './indicators';
@@ -10,10 +11,10 @@ var enabledStyles = css({
10
11
  });
11
12
  export var MultiValueRemove = function MultiValueRemove(props) {
12
13
  var isDisabled = props.selectProps.isDisabled;
13
- return /*#__PURE__*/React.createElement(components.MultiValueRemove, props, /*#__PURE__*/React.createElement("div", {
14
+ return jsx(components.MultiValueRemove, props, jsx("div", {
14
15
  css: isDisabled ? disabledStyles : enabledStyles,
15
16
  "data-testid": isDisabled ? 'hide-clear-icon' : 'show-clear-icon'
16
- }, /*#__PURE__*/React.createElement(SelectClearIcon, {
17
+ }, jsx(SelectClearIcon, {
17
18
  label: "Clear",
18
19
  size: "small",
19
20
  primaryColor: "transparent",
@@ -2,7 +2,8 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
3
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
4
4
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
5
- import { css } from '@emotion/react';
5
+ /** @jsx jsx */
6
+ import { jsx, css } from '@emotion/react';
6
7
  import { components } from 'react-select';
7
8
  import Spinner from '@atlaskit/spinner';
8
9
  import SelectClearIcon from '@atlaskit/icon/glyph/select-clear';
@@ -14,34 +15,33 @@ var iconContainerStyles = css({
14
15
  alignItems: 'center'
15
16
  });
16
17
  export var ClearIndicator = function ClearIndicator(props) {
17
- return /*#__PURE__*/React.createElement(components.ClearIndicator, _objectSpread(_objectSpread({}, props), {}, {
18
+ return jsx(components.ClearIndicator, _objectSpread(_objectSpread({}, props), {}, {
18
19
  innerProps: _objectSpread(_objectSpread({}, props.innerProps), {}, {
19
20
  'aria-hidden': 'false'
20
21
  })
21
- }), /*#__PURE__*/React.createElement("button", {
22
+ }), jsx("button", {
22
23
  css: iconContainerStyles,
23
24
  type: "button",
24
25
  tabIndex: -1
25
- }, /*#__PURE__*/React.createElement(SelectClearIcon, {
26
+ }, jsx(SelectClearIcon, {
26
27
  size: "small",
27
28
  label: "clear"
28
29
  })));
29
30
  };
30
31
  export var DropdownIndicator = function DropdownIndicator(props) {
31
- return /*#__PURE__*/React.createElement(components.DropdownIndicator, props, /*#__PURE__*/React.createElement(DownIcon, {
32
+ return jsx(components.DropdownIndicator, props, jsx(DownIcon, {
32
33
  label: "open"
33
34
  }));
34
35
  };
35
36
  export var LoadingIndicator = function LoadingIndicator(props) {
36
37
  var loadingStyles = css(props.getStyles('loadingIndicator', props));
37
38
  return (
38
- /*#__PURE__*/
39
39
  // This *must* be constructed this way because this is being consumed by
40
40
  // `react-select` and we don't control what it wants.
41
41
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
42
- React.createElement("div", _extends({
42
+ jsx("div", _extends({
43
43
  css: loadingStyles
44
- }, props.innerProps), /*#__PURE__*/React.createElement(Spinner, {
44
+ }, props.innerProps), jsx(Spinner, {
45
45
  size: "small"
46
46
  }))
47
47
  );
@@ -2,9 +2,14 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
  import React from 'react';
3
3
  import { components } from 'react-select';
4
4
  export var Input = function Input(props) {
5
+ var ariaDescribedByAttribute;
5
6
  var passed_describedby = props.selectProps['aria-describedby'];
6
- var describedby = props['aria-describedby'] + (passed_describedby ? ' ' + passed_describedby : '');
7
+ if (props['aria-describedby'] && passed_describedby) {
8
+ ariaDescribedByAttribute = props['aria-describedby'] + ' ' + passed_describedby;
9
+ } else {
10
+ ariaDescribedByAttribute = props['aria-describedby'] || passed_describedby;
11
+ }
7
12
  return /*#__PURE__*/React.createElement(components.Input, _extends({}, props, {
8
- "aria-describedby": describedby
13
+ "aria-describedby": ariaDescribedByAttribute
9
14
  }));
10
15
  };
@@ -13,7 +13,8 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
13
13
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
14
14
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
15
15
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
16
- import { css } from '@emotion/react';
16
+ /** @jsx jsx */
17
+ import { css, jsx } from '@emotion/react';
17
18
  import { Component } from 'react';
18
19
  import { getBooleanFF } from '@atlaskit/platform-feature-flags';
19
20
  import RadioIcon from '@atlaskit/icon/glyph/radio';
@@ -194,15 +195,14 @@ var ControlOption = /*#__PURE__*/function (_Component) {
194
195
  styles = _getPrimitiveStyles2[0],
195
196
  classes = _getPrimitiveStyles2[1];
196
197
  return (
197
- /*#__PURE__*/
198
198
  // These need to remain this way because `react-select` passes props with
199
199
  // styles inside, and that must be done dynamically.
200
200
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
201
- React.createElement("div", _extends({
201
+ jsx("div", _extends({
202
202
  css: styles,
203
203
  className: classes,
204
204
  ref: innerRef
205
- }, props), /*#__PURE__*/React.createElement("div", {
205
+ }, props), jsx("div", {
206
206
  css: [baseIconStyles,
207
207
  // Here we are adding a border to the Checkbox and Radio SVG icons
208
208
  // This is an a11y fix for Select only for now but it may be rolled
@@ -219,11 +219,11 @@ var ControlOption = /*#__PURE__*/function (_Component) {
219
219
  stroke: getBorderColor(_objectSpread(_objectSpread({}, this.props), this.state))
220
220
  }
221
221
  }]
222
- }, !!Icon ? /*#__PURE__*/React.createElement(Icon, {
222
+ }, !!Icon ? jsx(Icon, {
223
223
  label: "",
224
224
  primaryColor: getPrimaryColor(_objectSpread(_objectSpread({}, this.props), this.state)),
225
225
  secondaryColor: getSecondaryColor(_objectSpread(_objectSpread({}, this.props), this.state))
226
- }) : null), /*#__PURE__*/React.createElement("div", {
226
+ }) : null), jsx("div", {
227
227
  css: baseOptionStyles
228
228
  }, children))
229
229
  );
@@ -232,12 +232,12 @@ var ControlOption = /*#__PURE__*/function (_Component) {
232
232
  return ControlOption;
233
233
  }(Component);
234
234
  export var CheckboxOption = function CheckboxOption(props) {
235
- return /*#__PURE__*/React.createElement(ControlOption, _extends({
235
+ return jsx(ControlOption, _extends({
236
236
  Icon: CheckboxIcon
237
237
  }, props));
238
238
  };
239
239
  export var RadioOption = function RadioOption(props) {
240
- return /*#__PURE__*/React.createElement(ControlOption, _extends({
240
+ return jsx(ControlOption, _extends({
241
241
  Icon: RadioIcon
242
242
  }, props));
243
243
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/select",
3
- "version": "17.0.2",
3
+ "version": "17.0.4",
4
4
  "description": "Select allows users to make a single selection or multiple selections from a list of options.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -43,7 +43,7 @@
43
43
  "@atlaskit/platform-feature-flags": "^0.2.0",
44
44
  "@atlaskit/spinner": "^16.0.0",
45
45
  "@atlaskit/theme": "^12.6.0",
46
- "@atlaskit/tokens": "^1.29.0",
46
+ "@atlaskit/tokens": "^1.30.0",
47
47
  "@atlaskit/visually-hidden": "^1.2.0",
48
48
  "@babel/runtime": "^7.0.0",
49
49
  "@emotion/react": "^11.7.1",