@atlaskit/select 18.9.6 → 18.10.1

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,25 @@
1
1
  # @atlaskit/select
2
2
 
3
+ ## 18.10.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#108810](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/108810)
8
+ [`213d393f5b7da`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/213d393f5b7da) -
9
+ Convert input-option from class component to functional component
10
+
11
+ ## 18.10.0
12
+
13
+ ### Minor Changes
14
+
15
+ - [#109060](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/109060)
16
+ [`4660ec858a305`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/4660ec858a305) -
17
+ Update `React` from v16 to v18
18
+
19
+ ### Patch Changes
20
+
21
+ - Updated dependencies
22
+
3
23
  ## 18.9.6
4
24
 
5
25
  ### Patch Changes
@@ -25,6 +25,7 @@ var labelStyles = (0, _react.css)({
25
25
  lineHeight: 1.2
26
26
  });
27
27
  var flagStyles = (0, _react.css)({
28
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
28
29
  fontSize: '1.125rem',
29
30
  // emoji size
30
31
  marginInlineEnd: "var(--ds-space-100, 8px)"
@@ -11,7 +11,7 @@ var _createSelect = _interopRequireDefault(require("./createSelect"));
11
11
  /* eslint-disable @repo/internal/react/require-jsdoc */
12
12
 
13
13
  var packageName = "@atlaskit/select";
14
- var packageVersion = "18.9.6";
14
+ var packageVersion = "18.10.1";
15
15
  var SelectWithoutAnalytics = exports.SelectWithoutAnalytics = (0, _createSelect.default)(_async.default);
16
16
  var createAndFireEventOnAtlaskit = (0, _analyticsNext.createAndFireEvent)('atlaskit');
17
17
  var Select = (0, _analyticsNext.withAnalyticsContext)({
@@ -6,13 +6,8 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.RadioOption = exports.CheckboxOption = void 0;
8
8
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
10
9
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
11
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
12
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
13
- var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
14
- var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
15
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
10
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
16
11
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
17
12
  var _react = require("react");
18
13
  var _react2 = require("@emotion/react");
@@ -22,8 +17,6 @@ var _svg = _interopRequireDefault(require("@atlaskit/icon/svg"));
22
17
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
23
18
  var _visuallyHidden = _interopRequireDefault(require("@atlaskit/visually-hidden"));
24
19
  var _excluded = ["getStyles", "Icon", "children", "innerProps", "innerRef"];
25
- function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
26
- function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
27
20
  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
21
  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; } /**
29
22
  * @jsxRuntime classic
@@ -63,7 +56,10 @@ var getPrimitiveStyles = function getPrimitiveStyles(props) {
63
56
  };
64
57
 
65
58
  // maintain react-select API
66
- return [augmentedStyles, cx(bemClasses, className)];
59
+ return {
60
+ styles: augmentedStyles,
61
+ classes: cx(bemClasses, className)
62
+ };
67
63
  };
68
64
 
69
65
  // state of the parent option
@@ -132,103 +128,92 @@ var baseOptionStyles = (0, _react2.css)({
132
128
  textOverflow: 'ellipsis',
133
129
  whiteSpace: 'nowrap'
134
130
  });
131
+
135
132
  // eslint-disable-next-line @repo/internal/react/no-class-components
136
- var ControlOption = /*#__PURE__*/function (_Component) {
137
- function ControlOption() {
138
- var _this;
139
- (0, _classCallCheck2.default)(this, ControlOption);
140
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
141
- args[_key] = arguments[_key];
142
- }
143
- _this = _callSuper(this, ControlOption, [].concat(args));
144
- (0, _defineProperty2.default)(_this, "state", {
145
- isActive: false
146
- });
147
- (0, _defineProperty2.default)(_this, "onMouseDown", function () {
148
- return _this.setState({
149
- isActive: true
150
- });
151
- });
152
- (0, _defineProperty2.default)(_this, "onMouseUp", function () {
153
- return _this.setState({
154
- isActive: false
155
- });
156
- });
157
- (0, _defineProperty2.default)(_this, "onMouseLeave", function () {
158
- return _this.setState({
159
- isActive: false
160
- });
161
- });
162
- return _this;
163
- }
164
- (0, _inherits2.default)(ControlOption, _Component);
165
- return (0, _createClass2.default)(ControlOption, [{
166
- key: "render",
167
- value: function render() {
168
- var _this$props = this.props,
169
- getStyles = _this$props.getStyles,
170
- Icon = _this$props.Icon,
171
- children = _this$props.children,
172
- innerProps = _this$props.innerProps,
173
- innerRef = _this$props.innerRef,
174
- rest = (0, _objectWithoutProperties2.default)(_this$props, _excluded);
175
- var _this$props2 = this.props,
176
- isDisabled = _this$props2.isDisabled,
177
- isSelected = _this$props2.isSelected;
133
+ var ControlOption = function ControlOption(props) {
134
+ var _useState = (0, _react.useState)(false),
135
+ _useState2 = (0, _slicedToArray2.default)(_useState, 2),
136
+ isActive = _useState2[0],
137
+ setIsActive = _useState2[1];
138
+ var onMouseDown = (0, _react.useCallback)(function () {
139
+ return setIsActive(true);
140
+ }, []);
141
+ var onMouseUp = (0, _react.useCallback)(function () {
142
+ return setIsActive(false);
143
+ }, []);
144
+ var getStyles = props.getStyles,
145
+ Icon = props.Icon,
146
+ children = props.children,
147
+ innerProps = props.innerProps,
148
+ innerRef = props.innerRef,
149
+ rest = (0, _objectWithoutProperties2.default)(props, _excluded);
150
+ var isDisabled = props.isDisabled,
151
+ isSelected = props.isSelected,
152
+ isFocused = props.isFocused;
178
153
 
179
- // prop assignment
180
- var props = _objectSpread(_objectSpread({}, innerProps), {}, {
181
- onMouseDown: this.onMouseDown,
182
- onMouseUp: this.onMouseUp,
183
- onMouseLeave: this.onMouseLeave
184
- });
185
- var _getPrimitiveStyles = getPrimitiveStyles(_objectSpread({
186
- getStyles: getStyles
187
- }, rest)),
188
- _getPrimitiveStyles2 = (0, _slicedToArray2.default)(_getPrimitiveStyles, 2),
189
- styles = _getPrimitiveStyles2[0],
190
- classes = _getPrimitiveStyles2[1];
191
- var isVoiceOver = (/iPad|iPhone|iPod/.test(navigator.userAgent) || navigator.platform === 'MacIntel') &&
192
- // temporary check for now
193
- // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
194
- (0, _platformFeatureFlags.fg)('design_system_select-a11y-improvement');
195
- return (
196
- // These need to remain this way because `react-select` passes props with
197
- // styles inside, and that must be done dynamically.
198
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
199
- (0, _react2.jsx)("div", (0, _extends2.default)({
200
- css: styles,
201
- className: classes,
202
- ref: innerRef
203
- }, props), (0, _react2.jsx)("div", {
204
- css: [baseIconStyles,
205
- // Here we are adding a border to the Checkbox and Radio SVG icons
206
- // This is an a11y fix for Select only for now but it may be rolled
207
- // into the `@atlaskit/icon` package's Checkbox and Radio SVGs later
208
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
209
- {
210
- // This can eventually be changed to static styles that are
211
- // applied conditionally (e.g. `isActive && activeBorderStyles`),
212
- // but considering there are multiple instances of `react-select`
213
- // requiring styles to be generated dynamically, it seemed like a
214
- // low priority.
215
- // eslint-disable-next-line @atlaskit/design-system/no-nested-styles
216
- '& svg rect, & svg circle:first-of-type': {
217
- stroke: getBorderColor(_objectSpread(_objectSpread({}, this.props), this.state))
218
- }
219
- }]
220
- }, !!Icon ? (0, _react2.jsx)(Icon, {
221
- label: "",
222
- primaryColor: getPrimaryColor(_objectSpread(_objectSpread({}, this.props), this.state)),
223
- secondaryColor: getSecondaryColor(_objectSpread(_objectSpread({}, this.props), this.state)),
224
- isFacadeDisabled: true
225
- }) : null), (0, _react2.jsx)("div", {
226
- css: baseOptionStyles
227
- }, children, isVoiceOver && (isSelected || isDisabled) && (0, _react2.jsx)(_visuallyHidden.default, null, "".concat(isSelected ? ',selected' : '').concat(isDisabled ? ',dimmed' : ''))))
228
- );
229
- }
230
- }]);
231
- }(_react.Component);
154
+ // prop assignment
155
+ var newProps = _objectSpread(_objectSpread({}, innerProps), {}, {
156
+ onMouseDown: onMouseDown,
157
+ onMouseUp: onMouseUp,
158
+ onMouseLeave: onMouseUp
159
+ });
160
+ var _getPrimitiveStyles = getPrimitiveStyles(_objectSpread({
161
+ getStyles: getStyles
162
+ }, rest)),
163
+ styles = _getPrimitiveStyles.styles,
164
+ classes = _getPrimitiveStyles.classes;
165
+ var isVoiceOver = (/iPad|iPhone|iPod/.test(navigator.userAgent) || navigator.platform === 'MacIntel') &&
166
+ // temporary check for now
167
+ // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
168
+ (0, _platformFeatureFlags.fg)('design_system_select-a11y-improvement');
169
+ return (
170
+ // These need to remain this way because `react-select` passes props with
171
+ // styles inside, and that must be done dynamically.
172
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
173
+ (0, _react2.jsx)("div", (0, _extends2.default)({
174
+ css: styles,
175
+ className: classes,
176
+ ref: innerRef
177
+ }, newProps), (0, _react2.jsx)("div", {
178
+ css: [baseIconStyles,
179
+ // Here we are adding a border to the Checkbox and Radio SVG icons
180
+ // This is an a11y fix for Select only for now but it may be rolled
181
+ // into the `@atlaskit/icon` package's Checkbox and Radio SVGs later
182
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
183
+ {
184
+ // This can eventually be changed to static styles that are
185
+ // applied conditionally (e.g. `isActive && activeBorderStyles`),
186
+ // but considering there are multiple instances of `react-select`
187
+ // requiring styles to be generated dynamically, it seemed like a
188
+ // low priority.
189
+ // eslint-disable-next-line @atlaskit/design-system/no-nested-styles
190
+ '& svg rect, & svg circle:first-of-type': {
191
+ stroke: getBorderColor({
192
+ isActive: isActive,
193
+ isDisabled: isDisabled,
194
+ isSelected: isSelected
195
+ })
196
+ }
197
+ }]
198
+ }, !!Icon ? (0, _react2.jsx)(Icon, {
199
+ label: "",
200
+ primaryColor: getPrimaryColor({
201
+ isDisabled: isDisabled,
202
+ isSelected: isSelected,
203
+ isFocused: isFocused,
204
+ isActive: isActive
205
+ }),
206
+ secondaryColor: getSecondaryColor({
207
+ isDisabled: isDisabled,
208
+ isSelected: isSelected,
209
+ isActive: isActive
210
+ }),
211
+ isFacadeDisabled: true
212
+ }) : null), (0, _react2.jsx)("div", {
213
+ css: baseOptionStyles
214
+ }, children, isVoiceOver && (isSelected || isDisabled) && (0, _react2.jsx)(_visuallyHidden.default, null, "".concat(isSelected ? ',selected' : '').concat(isDisabled ? ',dimmed' : ''))))
215
+ );
216
+ };
232
217
  var NewCheckboxIcon = function NewCheckboxIcon(props) {
233
218
  return (
234
219
  // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
@@ -19,6 +19,7 @@ const labelStyles = css({
19
19
  lineHeight: 1.2
20
20
  });
21
21
  const flagStyles = css({
22
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
22
23
  fontSize: '1.125rem',
23
24
  // emoji size
24
25
  marginInlineEnd: "var(--ds-space-100, 8px)"
@@ -3,7 +3,7 @@ import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@
3
3
  import AsyncSelect from '@atlaskit/react-select/async';
4
4
  import createSelect from './createSelect';
5
5
  const packageName = "@atlaskit/select";
6
- const packageVersion = "18.9.6";
6
+ const packageVersion = "18.10.1";
7
7
  export const SelectWithoutAnalytics = createSelect(AsyncSelect);
8
8
  const createAndFireEventOnAtlaskit = createAndFireEvent('atlaskit');
9
9
  const Select = withAnalyticsContext({
@@ -1,11 +1,10 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
2
  /**
4
3
  * @jsxRuntime classic
5
4
  * @jsx jsx
6
5
  */
7
6
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
8
- import { Component } from 'react';
7
+ import { useCallback, useState } from 'react';
9
8
  import { css, jsx } from '@emotion/react';
10
9
  import CheckboxIcon from '@atlaskit/icon/glyph/checkbox';
11
10
  import RadioIcon from '@atlaskit/icon/glyph/radio';
@@ -53,7 +52,10 @@ const getPrimitiveStyles = props => {
53
52
  };
54
53
 
55
54
  // maintain react-select API
56
- return [augmentedStyles, cx(bemClasses, className)];
55
+ return {
56
+ styles: augmentedStyles,
57
+ classes: cx(bemClasses, className)
58
+ };
57
59
  };
58
60
 
59
61
  // state of the parent option
@@ -125,97 +127,92 @@ const baseOptionStyles = css({
125
127
  textOverflow: 'ellipsis',
126
128
  whiteSpace: 'nowrap'
127
129
  });
130
+
128
131
  // eslint-disable-next-line @repo/internal/react/no-class-components
129
- class ControlOption extends Component {
130
- constructor(...args) {
131
- super(...args);
132
- _defineProperty(this, "state", {
133
- isActive: false
134
- });
135
- _defineProperty(this, "onMouseDown", () => this.setState({
136
- isActive: true
137
- }));
138
- _defineProperty(this, "onMouseUp", () => this.setState({
139
- isActive: false
140
- }));
141
- _defineProperty(this, "onMouseLeave", () => this.setState({
142
- isActive: false
143
- }));
144
- }
145
- render() {
146
- const {
147
- getStyles,
148
- Icon,
149
- children,
150
- innerProps,
151
- innerRef,
152
- ...rest
153
- } = this.props;
154
- const {
155
- isDisabled,
156
- isSelected
157
- } = this.props;
132
+ const ControlOption = props => {
133
+ const [isActive, setIsActive] = useState(false);
134
+ const onMouseDown = useCallback(() => setIsActive(true), []);
135
+ const onMouseUp = useCallback(() => setIsActive(false), []);
136
+ const {
137
+ getStyles,
138
+ Icon,
139
+ children,
140
+ innerProps,
141
+ innerRef,
142
+ ...rest
143
+ } = props;
144
+ const {
145
+ isDisabled,
146
+ isSelected,
147
+ isFocused
148
+ } = props;
158
149
 
159
- // prop assignment
160
- const props = {
161
- ...innerProps,
162
- onMouseDown: this.onMouseDown,
163
- onMouseUp: this.onMouseUp,
164
- onMouseLeave: this.onMouseLeave
165
- };
166
- const [styles, classes] = getPrimitiveStyles({
167
- getStyles,
168
- ...rest
169
- });
170
- const isVoiceOver = (/iPad|iPhone|iPod/.test(navigator.userAgent) || navigator.platform === 'MacIntel') &&
171
- // temporary check for now
172
- // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
173
- fg('design_system_select-a11y-improvement');
174
- return (
175
- // These need to remain this way because `react-select` passes props with
176
- // styles inside, and that must be done dynamically.
177
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
178
- jsx("div", _extends({
179
- css: styles,
180
- className: classes,
181
- ref: innerRef
182
- }, props), jsx("div", {
183
- css: [baseIconStyles,
184
- // Here we are adding a border to the Checkbox and Radio SVG icons
185
- // This is an a11y fix for Select only for now but it may be rolled
186
- // into the `@atlaskit/icon` package's Checkbox and Radio SVGs later
187
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
188
- {
189
- // This can eventually be changed to static styles that are
190
- // applied conditionally (e.g. `isActive && activeBorderStyles`),
191
- // but considering there are multiple instances of `react-select`
192
- // requiring styles to be generated dynamically, it seemed like a
193
- // low priority.
194
- // eslint-disable-next-line @atlaskit/design-system/no-nested-styles
195
- '& svg rect, & svg circle:first-of-type': {
196
- stroke: getBorderColor({
197
- ...this.props,
198
- ...this.state
199
- })
200
- }
201
- }]
202
- }, !!Icon ? jsx(Icon, {
203
- label: "",
204
- primaryColor: getPrimaryColor({
205
- ...this.props,
206
- ...this.state
207
- }),
208
- secondaryColor: getSecondaryColor({
209
- ...this.props,
210
- ...this.state
211
- }),
212
- isFacadeDisabled: true
213
- }) : null), jsx("div", {
214
- css: baseOptionStyles
215
- }, children, isVoiceOver && (isSelected || isDisabled) && jsx(VisuallyHidden, null, `${isSelected ? ',selected' : ''}${isDisabled ? ',dimmed' : ''}`)))
216
- );
217
- }
218
- }
150
+ // prop assignment
151
+ const newProps = {
152
+ ...innerProps,
153
+ onMouseDown: onMouseDown,
154
+ onMouseUp: onMouseUp,
155
+ onMouseLeave: onMouseUp
156
+ };
157
+ const {
158
+ styles,
159
+ classes
160
+ } = getPrimitiveStyles({
161
+ getStyles,
162
+ ...rest
163
+ });
164
+ const isVoiceOver = (/iPad|iPhone|iPod/.test(navigator.userAgent) || navigator.platform === 'MacIntel') &&
165
+ // temporary check for now
166
+ // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
167
+ fg('design_system_select-a11y-improvement');
168
+ return (
169
+ // These need to remain this way because `react-select` passes props with
170
+ // styles inside, and that must be done dynamically.
171
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
172
+ jsx("div", _extends({
173
+ css: styles,
174
+ className: classes,
175
+ ref: innerRef
176
+ }, newProps), jsx("div", {
177
+ css: [baseIconStyles,
178
+ // Here we are adding a border to the Checkbox and Radio SVG icons
179
+ // This is an a11y fix for Select only for now but it may be rolled
180
+ // into the `@atlaskit/icon` package's Checkbox and Radio SVGs later
181
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
182
+ {
183
+ // This can eventually be changed to static styles that are
184
+ // applied conditionally (e.g. `isActive && activeBorderStyles`),
185
+ // but considering there are multiple instances of `react-select`
186
+ // requiring styles to be generated dynamically, it seemed like a
187
+ // low priority.
188
+ // eslint-disable-next-line @atlaskit/design-system/no-nested-styles
189
+ '& svg rect, & svg circle:first-of-type': {
190
+ stroke: getBorderColor({
191
+ isActive,
192
+ isDisabled,
193
+ isSelected
194
+ })
195
+ }
196
+ }]
197
+ }, !!Icon ? jsx(Icon, {
198
+ label: "",
199
+ primaryColor: getPrimaryColor({
200
+ isDisabled,
201
+ isSelected,
202
+ isFocused,
203
+ isActive
204
+ }),
205
+ secondaryColor: getSecondaryColor({
206
+ isDisabled,
207
+ isSelected,
208
+ isActive
209
+ }),
210
+ isFacadeDisabled: true
211
+ }) : null), jsx("div", {
212
+ css: baseOptionStyles
213
+ }, children, isVoiceOver && (isSelected || isDisabled) && jsx(VisuallyHidden, null, `${isSelected ? ',selected' : ''}${isDisabled ? ',dimmed' : ''}`)))
214
+ );
215
+ };
219
216
  const NewCheckboxIcon = props =>
220
217
  // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
221
218
  jsx(PrimitiveSVGIcon, props, jsx("g", {
@@ -22,6 +22,7 @@ var labelStyles = css({
22
22
  lineHeight: 1.2
23
23
  });
24
24
  var flagStyles = css({
25
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
25
26
  fontSize: '1.125rem',
26
27
  // emoji size
27
28
  marginInlineEnd: "var(--ds-space-100, 8px)"
@@ -3,7 +3,7 @@ import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@
3
3
  import AsyncSelect from '@atlaskit/react-select/async';
4
4
  import createSelect from './createSelect';
5
5
  var packageName = "@atlaskit/select";
6
- var packageVersion = "18.9.6";
6
+ var packageVersion = "18.10.1";
7
7
  export var SelectWithoutAnalytics = createSelect(AsyncSelect);
8
8
  var createAndFireEventOnAtlaskit = createAndFireEvent('atlaskit');
9
9
  var Select = withAnalyticsContext({
@@ -1,15 +1,8 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
- import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
4
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
5
- import _createClass from "@babel/runtime/helpers/createClass";
6
- import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
7
- import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
8
- import _inherits from "@babel/runtime/helpers/inherits";
3
+ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
9
4
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
10
5
  var _excluded = ["getStyles", "Icon", "children", "innerProps", "innerRef"];
11
- function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
12
- function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
13
6
  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; }
14
7
  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; }
15
8
  /**
@@ -17,7 +10,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
17
10
  * @jsx jsx
18
11
  */
19
12
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
20
- import { Component } from 'react';
13
+ import { useCallback, useState } from 'react';
21
14
  import { css, jsx } from '@emotion/react';
22
15
  import CheckboxIcon from '@atlaskit/icon/glyph/checkbox';
23
16
  import RadioIcon from '@atlaskit/icon/glyph/radio';
@@ -58,7 +51,10 @@ var getPrimitiveStyles = function getPrimitiveStyles(props) {
58
51
  };
59
52
 
60
53
  // maintain react-select API
61
- return [augmentedStyles, cx(bemClasses, className)];
54
+ return {
55
+ styles: augmentedStyles,
56
+ classes: cx(bemClasses, className)
57
+ };
62
58
  };
63
59
 
64
60
  // state of the parent option
@@ -127,103 +123,92 @@ var baseOptionStyles = css({
127
123
  textOverflow: 'ellipsis',
128
124
  whiteSpace: 'nowrap'
129
125
  });
126
+
130
127
  // eslint-disable-next-line @repo/internal/react/no-class-components
131
- var ControlOption = /*#__PURE__*/function (_Component) {
132
- function ControlOption() {
133
- var _this;
134
- _classCallCheck(this, ControlOption);
135
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
136
- args[_key] = arguments[_key];
137
- }
138
- _this = _callSuper(this, ControlOption, [].concat(args));
139
- _defineProperty(_this, "state", {
140
- isActive: false
141
- });
142
- _defineProperty(_this, "onMouseDown", function () {
143
- return _this.setState({
144
- isActive: true
145
- });
146
- });
147
- _defineProperty(_this, "onMouseUp", function () {
148
- return _this.setState({
149
- isActive: false
150
- });
151
- });
152
- _defineProperty(_this, "onMouseLeave", function () {
153
- return _this.setState({
154
- isActive: false
155
- });
156
- });
157
- return _this;
158
- }
159
- _inherits(ControlOption, _Component);
160
- return _createClass(ControlOption, [{
161
- key: "render",
162
- value: function render() {
163
- var _this$props = this.props,
164
- getStyles = _this$props.getStyles,
165
- Icon = _this$props.Icon,
166
- children = _this$props.children,
167
- innerProps = _this$props.innerProps,
168
- innerRef = _this$props.innerRef,
169
- rest = _objectWithoutProperties(_this$props, _excluded);
170
- var _this$props2 = this.props,
171
- isDisabled = _this$props2.isDisabled,
172
- isSelected = _this$props2.isSelected;
128
+ var ControlOption = function ControlOption(props) {
129
+ var _useState = useState(false),
130
+ _useState2 = _slicedToArray(_useState, 2),
131
+ isActive = _useState2[0],
132
+ setIsActive = _useState2[1];
133
+ var onMouseDown = useCallback(function () {
134
+ return setIsActive(true);
135
+ }, []);
136
+ var onMouseUp = useCallback(function () {
137
+ return setIsActive(false);
138
+ }, []);
139
+ var getStyles = props.getStyles,
140
+ Icon = props.Icon,
141
+ children = props.children,
142
+ innerProps = props.innerProps,
143
+ innerRef = props.innerRef,
144
+ rest = _objectWithoutProperties(props, _excluded);
145
+ var isDisabled = props.isDisabled,
146
+ isSelected = props.isSelected,
147
+ isFocused = props.isFocused;
173
148
 
174
- // prop assignment
175
- var props = _objectSpread(_objectSpread({}, innerProps), {}, {
176
- onMouseDown: this.onMouseDown,
177
- onMouseUp: this.onMouseUp,
178
- onMouseLeave: this.onMouseLeave
179
- });
180
- var _getPrimitiveStyles = getPrimitiveStyles(_objectSpread({
181
- getStyles: getStyles
182
- }, rest)),
183
- _getPrimitiveStyles2 = _slicedToArray(_getPrimitiveStyles, 2),
184
- styles = _getPrimitiveStyles2[0],
185
- classes = _getPrimitiveStyles2[1];
186
- var isVoiceOver = (/iPad|iPhone|iPod/.test(navigator.userAgent) || navigator.platform === 'MacIntel') &&
187
- // temporary check for now
188
- // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
189
- fg('design_system_select-a11y-improvement');
190
- return (
191
- // These need to remain this way because `react-select` passes props with
192
- // styles inside, and that must be done dynamically.
193
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
194
- jsx("div", _extends({
195
- css: styles,
196
- className: classes,
197
- ref: innerRef
198
- }, props), jsx("div", {
199
- css: [baseIconStyles,
200
- // Here we are adding a border to the Checkbox and Radio SVG icons
201
- // This is an a11y fix for Select only for now but it may be rolled
202
- // into the `@atlaskit/icon` package's Checkbox and Radio SVGs later
203
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
204
- {
205
- // This can eventually be changed to static styles that are
206
- // applied conditionally (e.g. `isActive && activeBorderStyles`),
207
- // but considering there are multiple instances of `react-select`
208
- // requiring styles to be generated dynamically, it seemed like a
209
- // low priority.
210
- // eslint-disable-next-line @atlaskit/design-system/no-nested-styles
211
- '& svg rect, & svg circle:first-of-type': {
212
- stroke: getBorderColor(_objectSpread(_objectSpread({}, this.props), this.state))
213
- }
214
- }]
215
- }, !!Icon ? jsx(Icon, {
216
- label: "",
217
- primaryColor: getPrimaryColor(_objectSpread(_objectSpread({}, this.props), this.state)),
218
- secondaryColor: getSecondaryColor(_objectSpread(_objectSpread({}, this.props), this.state)),
219
- isFacadeDisabled: true
220
- }) : null), jsx("div", {
221
- css: baseOptionStyles
222
- }, children, isVoiceOver && (isSelected || isDisabled) && jsx(VisuallyHidden, null, "".concat(isSelected ? ',selected' : '').concat(isDisabled ? ',dimmed' : ''))))
223
- );
224
- }
225
- }]);
226
- }(Component);
149
+ // prop assignment
150
+ var newProps = _objectSpread(_objectSpread({}, innerProps), {}, {
151
+ onMouseDown: onMouseDown,
152
+ onMouseUp: onMouseUp,
153
+ onMouseLeave: onMouseUp
154
+ });
155
+ var _getPrimitiveStyles = getPrimitiveStyles(_objectSpread({
156
+ getStyles: getStyles
157
+ }, rest)),
158
+ styles = _getPrimitiveStyles.styles,
159
+ classes = _getPrimitiveStyles.classes;
160
+ var isVoiceOver = (/iPad|iPhone|iPod/.test(navigator.userAgent) || navigator.platform === 'MacIntel') &&
161
+ // temporary check for now
162
+ // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
163
+ fg('design_system_select-a11y-improvement');
164
+ return (
165
+ // These need to remain this way because `react-select` passes props with
166
+ // styles inside, and that must be done dynamically.
167
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
168
+ jsx("div", _extends({
169
+ css: styles,
170
+ className: classes,
171
+ ref: innerRef
172
+ }, newProps), jsx("div", {
173
+ css: [baseIconStyles,
174
+ // Here we are adding a border to the Checkbox and Radio SVG icons
175
+ // This is an a11y fix for Select only for now but it may be rolled
176
+ // into the `@atlaskit/icon` package's Checkbox and Radio SVGs later
177
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
178
+ {
179
+ // This can eventually be changed to static styles that are
180
+ // applied conditionally (e.g. `isActive && activeBorderStyles`),
181
+ // but considering there are multiple instances of `react-select`
182
+ // requiring styles to be generated dynamically, it seemed like a
183
+ // low priority.
184
+ // eslint-disable-next-line @atlaskit/design-system/no-nested-styles
185
+ '& svg rect, & svg circle:first-of-type': {
186
+ stroke: getBorderColor({
187
+ isActive: isActive,
188
+ isDisabled: isDisabled,
189
+ isSelected: isSelected
190
+ })
191
+ }
192
+ }]
193
+ }, !!Icon ? jsx(Icon, {
194
+ label: "",
195
+ primaryColor: getPrimaryColor({
196
+ isDisabled: isDisabled,
197
+ isSelected: isSelected,
198
+ isFocused: isFocused,
199
+ isActive: isActive
200
+ }),
201
+ secondaryColor: getSecondaryColor({
202
+ isDisabled: isDisabled,
203
+ isSelected: isSelected,
204
+ isActive: isActive
205
+ }),
206
+ isFacadeDisabled: true
207
+ }) : null), jsx("div", {
208
+ css: baseOptionStyles
209
+ }, children, isVoiceOver && (isSelected || isDisabled) && jsx(VisuallyHidden, null, "".concat(isSelected ? ',selected' : '').concat(isDisabled ? ',dimmed' : ''))))
210
+ );
211
+ };
227
212
  var NewCheckboxIcon = function NewCheckboxIcon(props) {
228
213
  return (
229
214
  // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/select",
3
- "version": "18.9.6",
3
+ "version": "18.10.1",
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/"
@@ -41,16 +41,16 @@
41
41
  ".": "./src/index.tsx"
42
42
  },
43
43
  "dependencies": {
44
- "@atlaskit/analytics-next": "^10.2.0",
45
- "@atlaskit/ds-lib": "^3.3.0",
46
- "@atlaskit/icon": "^23.4.0",
44
+ "@atlaskit/analytics-next": "^10.3.0",
45
+ "@atlaskit/ds-lib": "^3.5.0",
46
+ "@atlaskit/icon": "^23.5.0",
47
47
  "@atlaskit/platform-feature-flags": "^0.3.0",
48
- "@atlaskit/primitives": "^13.3.0",
49
- "@atlaskit/react-select": "^1.6.0",
50
- "@atlaskit/spinner": "^17.0.0",
51
- "@atlaskit/theme": "^14.0.0",
52
- "@atlaskit/tokens": "^3.2.0",
53
- "@atlaskit/visually-hidden": "^1.5.0",
48
+ "@atlaskit/primitives": "^13.4.0",
49
+ "@atlaskit/react-select": "^1.7.0",
50
+ "@atlaskit/spinner": "^17.1.0",
51
+ "@atlaskit/theme": "^14.1.0",
52
+ "@atlaskit/tokens": "^3.3.0",
53
+ "@atlaskit/visually-hidden": "^1.6.0",
54
54
  "@babel/runtime": "^7.0.0",
55
55
  "@emotion/react": "^11.7.1",
56
56
  "@popperjs/core": "^2.11.8",
@@ -68,18 +68,18 @@
68
68
  "@af/accessibility-testing": "*",
69
69
  "@af/integration-testing": "*",
70
70
  "@af/visual-regression": "*",
71
- "@atlaskit/checkbox": "^15.2.0",
72
- "@atlaskit/modal-dialog": "^12.19.0",
73
- "@atlaskit/radio": "^7.1.0",
71
+ "@atlaskit/checkbox": "^15.3.0",
72
+ "@atlaskit/modal-dialog": "^12.20.0",
73
+ "@atlaskit/radio": "^7.2.0",
74
74
  "@atlaskit/ssr": "*",
75
75
  "@atlaskit/visual-regression": "*",
76
76
  "@atlassian/feature-flags-test-utils": "*",
77
77
  "@emotion/styled": "^11.0.0",
78
- "@testing-library/react": "^12.1.5",
78
+ "@testing-library/react": "^13.4.0",
79
79
  "@testing-library/user-event": "^14.4.3",
80
80
  "ast-types": "^0.13.3",
81
81
  "jscodeshift": "^0.13.0",
82
- "react-dom": "^16.8.0",
82
+ "react-dom": "^18.2.0",
83
83
  "react-select-event": "^5.5.0",
84
84
  "react-value": "^0.2.0",
85
85
  "typescript": "~5.4.2"