@atlaskit/react-select 2.7.4 → 2.7.6

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,22 @@
1
1
  # @atlaskit/react-select
2
2
 
3
+ ## 2.7.6
4
+
5
+ ### Patch Changes
6
+
7
+ - [#175058](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/175058)
8
+ [`cfb3a1596d972`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/cfb3a1596d972) -
9
+ Add same class names in emotion compoent as compiled select for GA
10
+ - Updated dependencies
11
+
12
+ ## 2.7.5
13
+
14
+ ### Patch Changes
15
+
16
+ - [#173706](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/173706)
17
+ [`a37d69dbb048b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a37d69dbb048b) -
18
+ Remove onMenuClose call when input is blur
19
+
3
20
  ## 2.7.4
4
21
 
5
22
  ### Patch Changes
@@ -43,10 +43,14 @@ var SelectContainer = exports.SelectContainer = function SelectContainer(props)
43
43
  innerProps = props.innerProps,
44
44
  isDisabled = props.isDisabled,
45
45
  isRtl = props.isRtl;
46
- return (0, _react.jsx)("div", (0, _extends2.default)({}, (0, _utils.getStyleProps)(props, 'container', {
46
+ var styles = (0, _utils.getStyleProps)(props, 'container', {
47
47
  '--is-disabled': isDisabled,
48
48
  '--is-rtl': isRtl
49
- }), innerProps), children);
49
+ });
50
+ return (0, _react.jsx)("div", (0, _extends2.default)({}, styles, {
51
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
52
+ className: styles.className || '-container'
53
+ }, innerProps), children);
50
54
  };
51
55
 
52
56
  // ==============================
@@ -85,7 +89,7 @@ var ValueContainer = exports.ValueContainer = function ValueContainer(props) {
85
89
  css: styles.css
86
90
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
87
91
  ,
88
- className: styles.className || 'value-container'
92
+ className: styles.className || '-ValueContainer'
89
93
  }, innerProps), children);
90
94
  };
91
95
 
@@ -264,9 +264,12 @@ var Menu = function Menu(props) {
264
264
  var children = props.children,
265
265
  innerRef = props.innerRef,
266
266
  innerProps = props.innerProps;
267
- return (0, _react2.jsx)("div", (0, _extends2.default)({}, (0, _utils.getStyleProps)(props, 'menu', {
267
+ var styles = (0, _utils.getStyleProps)(props, 'menu', {
268
268
  menu: true
269
- }), {
269
+ });
270
+ return (0, _react2.jsx)("div", (0, _extends2.default)({}, styles, {
271
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
272
+ className: styles.className || '-menu',
270
273
  ref: innerRef
271
274
  }, innerProps), children);
272
275
  };
@@ -636,7 +636,12 @@ var Select = exports.default = /*#__PURE__*/function (_Component) {
636
636
  action: 'input-blur',
637
637
  prevInputValue: prevInputValue
638
638
  });
639
- _this.onMenuClose();
639
+ if ((0, _platformFeatureFlags.fg)('platform_dst_select_menu_close_on_blur')) {
640
+ // when fg is enabled, we only call onMenuClose when this.props.menuIsOpen is true.
641
+ _this.props.menuIsOpen && _this.onMenuClose();
642
+ } else {
643
+ _this.onMenuClose();
644
+ }
640
645
  _this.setState({
641
646
  focusedValue: null,
642
647
  isFocused: false
@@ -37,10 +37,14 @@ export const SelectContainer = props => {
37
37
  isDisabled,
38
38
  isRtl
39
39
  } = props;
40
- return jsx("div", _extends({}, getStyleProps(props, 'container', {
40
+ const styles = getStyleProps(props, 'container', {
41
41
  '--is-disabled': isDisabled,
42
42
  '--is-rtl': isRtl
43
- }), innerProps), children);
43
+ });
44
+ return jsx("div", _extends({}, styles, {
45
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
46
+ className: styles.className || '-container'
47
+ }, innerProps), children);
44
48
  };
45
49
 
46
50
  // ==============================
@@ -82,7 +86,7 @@ export const ValueContainer = props => {
82
86
  css: styles.css
83
87
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
84
88
  ,
85
- className: styles.className || 'value-container'
89
+ className: styles.className || '-ValueContainer'
86
90
  }, innerProps), children);
87
91
  };
88
92
 
@@ -263,9 +263,12 @@ const Menu = props => {
263
263
  innerRef,
264
264
  innerProps
265
265
  } = props;
266
- return jsx("div", _extends({}, getStyleProps(props, 'menu', {
266
+ const styles = getStyleProps(props, 'menu', {
267
267
  menu: true
268
- }), {
268
+ });
269
+ return jsx("div", _extends({}, styles, {
270
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
271
+ className: styles.className || '-menu',
269
272
  ref: innerRef
270
273
  }, innerProps), children);
271
274
  };
@@ -609,7 +609,12 @@ export default class Select extends Component {
609
609
  action: 'input-blur',
610
610
  prevInputValue
611
611
  });
612
- this.onMenuClose();
612
+ if (fg('platform_dst_select_menu_close_on_blur')) {
613
+ // when fg is enabled, we only call onMenuClose when this.props.menuIsOpen is true.
614
+ this.props.menuIsOpen && this.onMenuClose();
615
+ } else {
616
+ this.onMenuClose();
617
+ }
613
618
  this.setState({
614
619
  focusedValue: null,
615
620
  isFocused: false
@@ -36,10 +36,14 @@ export var SelectContainer = function SelectContainer(props) {
36
36
  innerProps = props.innerProps,
37
37
  isDisabled = props.isDisabled,
38
38
  isRtl = props.isRtl;
39
- return jsx("div", _extends({}, getStyleProps(props, 'container', {
39
+ var styles = getStyleProps(props, 'container', {
40
40
  '--is-disabled': isDisabled,
41
41
  '--is-rtl': isRtl
42
- }), innerProps), children);
42
+ });
43
+ return jsx("div", _extends({}, styles, {
44
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
45
+ className: styles.className || '-container'
46
+ }, innerProps), children);
43
47
  };
44
48
 
45
49
  // ==============================
@@ -78,7 +82,7 @@ export var ValueContainer = function ValueContainer(props) {
78
82
  css: styles.css
79
83
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
80
84
  ,
81
- className: styles.className || 'value-container'
85
+ className: styles.className || '-ValueContainer'
82
86
  }, innerProps), children);
83
87
  };
84
88
 
@@ -261,9 +261,12 @@ var Menu = function Menu(props) {
261
261
  var children = props.children,
262
262
  innerRef = props.innerRef,
263
263
  innerProps = props.innerProps;
264
- return jsx("div", _extends({}, getStyleProps(props, 'menu', {
264
+ var styles = getStyleProps(props, 'menu', {
265
265
  menu: true
266
- }), {
266
+ });
267
+ return jsx("div", _extends({}, styles, {
268
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
269
+ className: styles.className || '-menu',
267
270
  ref: innerRef
268
271
  }, innerProps), children);
269
272
  };
@@ -627,7 +627,12 @@ var Select = /*#__PURE__*/function (_Component) {
627
627
  action: 'input-blur',
628
628
  prevInputValue: prevInputValue
629
629
  });
630
- _this.onMenuClose();
630
+ if (fg('platform_dst_select_menu_close_on_blur')) {
631
+ // when fg is enabled, we only call onMenuClose when this.props.menuIsOpen is true.
632
+ _this.props.menuIsOpen && _this.onMenuClose();
633
+ } else {
634
+ _this.onMenuClose();
635
+ }
631
636
  _this.setState({
632
637
  focusedValue: null,
633
638
  isFocused: false
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/react-select",
3
- "version": "2.7.4",
3
+ "version": "2.7.6",
4
4
  "description": "A forked version of react-select to only be used in atlaskit/select",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -30,12 +30,12 @@
30
30
  },
31
31
  "dependencies": {
32
32
  "@atlaskit/ds-lib": "^4.0.0",
33
- "@atlaskit/icon": "^27.0.0",
33
+ "@atlaskit/icon": "^27.1.0",
34
34
  "@atlaskit/layering": "^3.0.0",
35
35
  "@atlaskit/platform-feature-flags": "^1.1.0",
36
- "@atlaskit/primitives": "^14.8.0",
36
+ "@atlaskit/primitives": "^14.9.0",
37
37
  "@atlaskit/spinner": "^18.0.0",
38
- "@atlaskit/tokens": "^5.2.0",
38
+ "@atlaskit/tokens": "^5.4.0",
39
39
  "@babel/runtime": "^7.0.0",
40
40
  "@compiled/react": "^0.18.3",
41
41
  "@emotion/react": "^11.7.1",
@@ -68,6 +68,9 @@
68
68
  },
69
69
  "compiled-react-select": {
70
70
  "type": "boolean"
71
+ },
72
+ "platform_dst_select_menu_close_on_blur": {
73
+ "type": "boolean"
71
74
  }
72
75
  },
73
76
  "techstack": {