@atlaskit/react-select 2.4.3 → 2.4.5

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,21 @@
1
1
  # @atlaskit/react-select
2
2
 
3
+ ## 2.4.5
4
+
5
+ ### Patch Changes
6
+
7
+ - [#146587](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/146587)
8
+ [`f296c108b483f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f296c108b483f) -
9
+ Filter out unsupported styles from styles props under feature flag
10
+
11
+ ## 2.4.4
12
+
13
+ ### Patch Changes
14
+
15
+ - [#142181](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/142181)
16
+ [`d6934885b334e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d6934885b334e) -
17
+ Fixed some new icons that were enabled with the incorrect feature flag.
18
+
3
19
  ## 2.4.3
4
20
 
5
21
  ### Patch Changes
@@ -18,7 +18,6 @@ var _react2 = require("@compiled/react");
18
18
  var _selectClear = _interopRequireDefault(require("@atlaskit/icon/glyph/select-clear"));
19
19
  var _cross = _interopRequireDefault(require("@atlaskit/icon/utility/cross"));
20
20
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
21
- var _compiled = require("@atlaskit/primitives/compiled");
22
21
  var _utils = require("../../utils");
23
22
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
24
23
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
@@ -79,34 +78,6 @@ var MultiValueLabel = exports.MultiValueLabel = function MultiValueLabel(_ref2)
79
78
  };
80
79
  var disabledStyles = null;
81
80
  var enabledStyles = null;
82
- var iconWrapperStyles = {
83
- root: "_ca0qv77o _u5f3v77o _n3tdv77o _19bvv77o"
84
- };
85
- var renderIcon = function renderIcon() {
86
- // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
87
- if ((0, _platformFeatureFlags.fg)('platform-component-visual-refresh')) {
88
- return /*#__PURE__*/React.createElement(_cross.default, {
89
- label: "",
90
- color: "currentColor"
91
- });
92
- }
93
-
94
- // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
95
- if ((0, _platformFeatureFlags.fg)('platform-visual-refresh-icons-legacy-facade')) {
96
- return /*#__PURE__*/React.createElement(_compiled.Inline, {
97
- xcss: iconWrapperStyles.root
98
- }, /*#__PURE__*/React.createElement(_cross.default, {
99
- label: "",
100
- color: "currentColor"
101
- }));
102
- }
103
- return /*#__PURE__*/React.createElement(_selectClear.default, {
104
- label: "",
105
- primaryColor: "transparent",
106
- size: "small",
107
- secondaryColor: "inherit"
108
- });
109
- };
110
81
  function MultiValueRemove(_ref3) {
111
82
  var isDisabled = _ref3.isDisabled,
112
83
  isFocused = _ref3.isFocused,
@@ -119,7 +90,14 @@ function MultiValueRemove(_ref3) {
119
90
  }), /*#__PURE__*/React.createElement("div", {
120
91
  "data-testid": isDisabled ? 'hide-clear-icon' : 'show-clear-icon',
121
92
  className: (0, _runtime.ax)([isDisabled && "_1e0cglyw", !isDisabled && "_1e0c1kw7"])
122
- }, renderIcon()));
93
+ }, /*#__PURE__*/React.createElement(_cross.default, {
94
+ label: "",
95
+ color: "currentColor",
96
+ LEGACY_fallbackIcon: _selectClear.default,
97
+ LEGACY_primaryColor: "transparent",
98
+ LEGACY_secondaryColor: "inherit",
99
+ LEGACY_size: "small"
100
+ })));
123
101
  }
124
102
  var MultiValue = function MultiValue(props) {
125
103
  var children = props.children,
@@ -40,7 +40,7 @@ function ScrollManager(_ref) {
40
40
  };
41
41
  return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, lockEnabled &&
42
42
  /*#__PURE__*/
43
- // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
43
+ // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions, @atlassian/a11y/interactive-element-not-keyboard-focusable
44
44
  _react.default.createElement("div", {
45
45
  onClick: blurSelectInput,
46
46
  style: {
@@ -51,7 +51,7 @@ function ScrollManager(_ref) {
51
51
  setScrollLockTarget(element);
52
52
  };
53
53
  return (0, _react2.jsx)(_react.Fragment, null, lockEnabled &&
54
- // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
54
+ // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions, @atlassian/a11y/interactive-element-not-keyboard-focusable
55
55
  (0, _react2.jsx)("div", {
56
56
  onClick: blurSelectInput,
57
57
  css: styles
@@ -12,7 +12,6 @@ var _react = require("@emotion/react");
12
12
  var _selectClear = _interopRequireDefault(require("@atlaskit/icon/glyph/select-clear"));
13
13
  var _cross = _interopRequireDefault(require("@atlaskit/icon/utility/cross"));
14
14
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
15
- var _primitives = require("@atlaskit/primitives");
16
15
  var _utils = require("../../utils");
17
16
  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; }
18
17
  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; } /**
@@ -138,34 +137,6 @@ var disabledStyles = (0, _react.css)({
138
137
  var enabledStyles = (0, _react.css)({
139
138
  display: 'inherit'
140
139
  });
141
- var iconWrapperStyles = (0, _primitives.xcss)({
142
- padding: 'space.025'
143
- });
144
- var renderIcon = function renderIcon() {
145
- // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
146
- if ((0, _platformFeatureFlags.fg)('platform-component-visual-refresh')) {
147
- return (0, _react.jsx)(_cross.default, {
148
- label: "",
149
- color: "currentColor"
150
- });
151
- }
152
-
153
- // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
154
- if ((0, _platformFeatureFlags.fg)('platform-visual-refresh-icons-legacy-facade')) {
155
- return (0, _react.jsx)(_primitives.Inline, {
156
- xcss: iconWrapperStyles
157
- }, (0, _react.jsx)(_cross.default, {
158
- label: "",
159
- color: "currentColor"
160
- }));
161
- }
162
- return (0, _react.jsx)(_selectClear.default, {
163
- label: "",
164
- primaryColor: "transparent",
165
- size: "small",
166
- secondaryColor: "inherit"
167
- });
168
- };
169
140
  function MultiValueRemove(_ref5) {
170
141
  var isDisabled = _ref5.isDisabled,
171
142
  innerProps = _ref5.innerProps;
@@ -174,7 +145,14 @@ function MultiValueRemove(_ref5) {
174
145
  (0, _react.jsx)("div", innerProps, (0, _react.jsx)("div", {
175
146
  css: isDisabled ? disabledStyles : enabledStyles,
176
147
  "data-testid": isDisabled ? 'hide-clear-icon' : 'show-clear-icon'
177
- }, renderIcon()))
148
+ }, (0, _react.jsx)(_cross.default, {
149
+ label: "",
150
+ color: "currentColor",
151
+ LEGACY_fallbackIcon: _selectClear.default,
152
+ LEGACY_primaryColor: "transparent",
153
+ LEGACY_secondaryColor: "inherit",
154
+ LEGACY_size: "small"
155
+ })))
178
156
  );
179
157
  }
180
158
  var MultiValue = function MultiValue(props) {
@@ -406,7 +406,11 @@ var Select = exports.default = /*#__PURE__*/function (_Component) {
406
406
  var base = _styles.defaultStyles[key](props);
407
407
  base.boxSizing = 'border-box';
408
408
  var custom = _this.props.styles[key];
409
- return custom ? custom(base, props) : base;
409
+ if (!custom) {
410
+ return base;
411
+ }
412
+ var customStyles = (0, _platformFeatureFlags.fg)('compiled-react-select') ? (0, _utils.filterUnsupportedSelectors)(custom(base, props)) : custom(base, props);
413
+ return customStyles;
410
414
  });
411
415
  (0, _defineProperty2.default)(_this, "getClassNames", function (key, props) {
412
416
  var _this$props$className, _this$props$className2;
package/dist/cjs/utils.js CHANGED
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.animatedScrollTo = animatedScrollTo;
8
8
  exports.classNames = classNames;
9
- exports.cleanValue = exports.cleanCommonProps = void 0;
9
+ exports.filterUnsupportedSelectors = exports.cleanValue = exports.cleanCommonProps = void 0;
10
10
  exports.getBoundingClientObj = getBoundingClientObj;
11
11
  exports.getScrollParent = getScrollParent;
12
12
  exports.getScrollTop = getScrollTop;
@@ -342,4 +342,42 @@ var removeProps = exports.removeProps = function removeProps(propsObj) {
342
342
  newProps[key] = val;
343
343
  return newProps;
344
344
  }, {});
345
+ };
346
+
347
+ /**
348
+ * Filters out unsupported selectors (e.g., pseudo-classes, complex selectors) from a styles object.
349
+ * @param styles - The styles object to filter.
350
+ * @returns A new object containing only supported styles.
351
+ */
352
+ var filterUnsupportedSelectors = exports.filterUnsupportedSelectors = function filterUnsupportedSelectors(styles) {
353
+ var unsupportedSelectors = [':hover', ':focus', ':active', ':visited', ':link', ':checked', ':disabled', ':enabled', ':first-child', ':last-child', ':nth-child', ':nth-last-child', ':only-child', ':first-of-type', ':last-of-type', ':nth-of-type', ':nth-last-of-type', ':only-of-type', ':empty', ':not', ':root', ':target', ':before', ':after', '::before', '::after', '::placeholder', '::selection', '::backdrop', '::marker', '::first-line', '::first-letter', '::spelling-error', '::grammar-error', '[attr]',
354
+ // Attribute selectors
355
+ '[attr=value]',
356
+ // Attribute value selectors
357
+ '[attr^=value]',
358
+ // Attribute starts with
359
+ '[attr$=value]',
360
+ // Attribute ends with
361
+ '[attr*=value]',
362
+ // Attribute contains
363
+ '[attr|=value]',
364
+ // Attribute value with hyphen
365
+ '[attr~=value]',
366
+ // Attribute value in space-separated list
367
+ '>',
368
+ // Child combinator
369
+ '+',
370
+ // Adjacent sibling combinator
371
+ '~',
372
+ // General sibling combinator
373
+ ' ' // Descendant combinator
374
+ ];
375
+ return Object.keys(styles).reduce(function (filteredStyles, key) {
376
+ if (!unsupportedSelectors.some(function (selector) {
377
+ return key.includes(selector);
378
+ })) {
379
+ filteredStyles[key] = styles[key];
380
+ }
381
+ return filteredStyles;
382
+ }, {});
345
383
  };
@@ -7,7 +7,6 @@ import { cx } from '@compiled/react';
7
7
  import LegacySelectClearIcon from '@atlaskit/icon/glyph/select-clear';
8
8
  import CrossIcon from '@atlaskit/icon/utility/cross';
9
9
  import { fg } from '@atlaskit/platform-feature-flags';
10
- import { Inline } from '@atlaskit/primitives/compiled';
11
10
  import { getStyleProps } from '../../utils';
12
11
  const multiValueStyles = {
13
12
  root: "_2rkogqwt _1e0c1txw _1ul9ze3t _19pkv77o _2hwxv77o _otyrv77o _18u0v77o _bfhkm7j4 _p12f1osq _syazjpor _3yq3glyw",
@@ -60,34 +59,6 @@ export const MultiValueLabel = ({
60
59
  };
61
60
  const disabledStyles = null;
62
61
  const enabledStyles = null;
63
- const iconWrapperStyles = {
64
- root: "_ca0qv77o _u5f3v77o _n3tdv77o _19bvv77o"
65
- };
66
- const renderIcon = () => {
67
- // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
68
- if (fg('platform-component-visual-refresh')) {
69
- return /*#__PURE__*/React.createElement(CrossIcon, {
70
- label: "",
71
- color: "currentColor"
72
- });
73
- }
74
-
75
- // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
76
- if (fg('platform-visual-refresh-icons-legacy-facade')) {
77
- return /*#__PURE__*/React.createElement(Inline, {
78
- xcss: iconWrapperStyles.root
79
- }, /*#__PURE__*/React.createElement(CrossIcon, {
80
- label: "",
81
- color: "currentColor"
82
- }));
83
- }
84
- return /*#__PURE__*/React.createElement(LegacySelectClearIcon, {
85
- label: "",
86
- primaryColor: "transparent",
87
- size: "small",
88
- secondaryColor: "inherit"
89
- });
90
- };
91
62
  export function MultiValueRemove({
92
63
  isDisabled,
93
64
  isFocused,
@@ -101,7 +72,14 @@ export function MultiValueRemove({
101
72
  }), /*#__PURE__*/React.createElement("div", {
102
73
  "data-testid": isDisabled ? 'hide-clear-icon' : 'show-clear-icon',
103
74
  className: ax([isDisabled && "_1e0cglyw", !isDisabled && "_1e0c1kw7"])
104
- }, renderIcon()));
75
+ }, /*#__PURE__*/React.createElement(CrossIcon, {
76
+ label: "",
77
+ color: "currentColor",
78
+ LEGACY_fallbackIcon: LegacySelectClearIcon,
79
+ LEGACY_primaryColor: "transparent",
80
+ LEGACY_secondaryColor: "inherit",
81
+ LEGACY_size: "small"
82
+ })));
105
83
  }
106
84
  const MultiValue = props => {
107
85
  const {
@@ -30,7 +30,7 @@ export default function ScrollManager({
30
30
  };
31
31
  return /*#__PURE__*/React.createElement(Fragment, null, lockEnabled &&
32
32
  /*#__PURE__*/
33
- // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
33
+ // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions, @atlassian/a11y/interactive-element-not-keyboard-focusable
34
34
  React.createElement("div", {
35
35
  onClick: blurSelectInput,
36
36
  style: {
@@ -43,7 +43,7 @@ export default function ScrollManager({
43
43
  setScrollLockTarget(element);
44
44
  };
45
45
  return jsx(Fragment, null, lockEnabled &&
46
- // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
46
+ // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions, @atlassian/a11y/interactive-element-not-keyboard-focusable
47
47
  jsx("div", {
48
48
  onClick: blurSelectInput,
49
49
  css: styles
@@ -8,7 +8,6 @@ import { css, jsx } from '@emotion/react';
8
8
  import LegacySelectClearIcon from '@atlaskit/icon/glyph/select-clear';
9
9
  import CrossIcon from '@atlaskit/icon/utility/cross';
10
10
  import { fg } from '@atlaskit/platform-feature-flags';
11
- import { Inline, xcss } from '@atlaskit/primitives';
12
11
  import { getStyleProps } from '../../utils';
13
12
  export const multiValueCSS = ({
14
13
  isDisabled,
@@ -130,34 +129,6 @@ const disabledStyles = css({
130
129
  const enabledStyles = css({
131
130
  display: 'inherit'
132
131
  });
133
- const iconWrapperStyles = xcss({
134
- padding: 'space.025'
135
- });
136
- const renderIcon = () => {
137
- // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
138
- if (fg('platform-component-visual-refresh')) {
139
- return jsx(CrossIcon, {
140
- label: "",
141
- color: "currentColor"
142
- });
143
- }
144
-
145
- // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
146
- if (fg('platform-visual-refresh-icons-legacy-facade')) {
147
- return jsx(Inline, {
148
- xcss: iconWrapperStyles
149
- }, jsx(CrossIcon, {
150
- label: "",
151
- color: "currentColor"
152
- }));
153
- }
154
- return jsx(LegacySelectClearIcon, {
155
- label: "",
156
- primaryColor: "transparent",
157
- size: "small",
158
- secondaryColor: "inherit"
159
- });
160
- };
161
132
  export function MultiValueRemove({
162
133
  isDisabled,
163
134
  innerProps
@@ -167,7 +138,14 @@ export function MultiValueRemove({
167
138
  jsx("div", innerProps, jsx("div", {
168
139
  css: isDisabled ? disabledStyles : enabledStyles,
169
140
  "data-testid": isDisabled ? 'hide-clear-icon' : 'show-clear-icon'
170
- }, renderIcon()))
141
+ }, jsx(CrossIcon, {
142
+ label: "",
143
+ color: "currentColor",
144
+ LEGACY_fallbackIcon: LegacySelectClearIcon,
145
+ LEGACY_primaryColor: "transparent",
146
+ LEGACY_secondaryColor: "inherit",
147
+ LEGACY_size: "small"
148
+ })))
171
149
  );
172
150
  }
173
151
  const MultiValue = props => {
@@ -12,7 +12,7 @@ import LiveRegion from './components/live-region';
12
12
  import { MenuPlacer } from './components/menu';
13
13
  import { createFilter } from './filters';
14
14
  import { defaultStyles } from './styles';
15
- import { classNames, cleanValue, isDocumentElement, isMobileDevice, isTouchCapable, multiValueAsValue, noop, notNullish, scrollIntoView, singleValueAsValue, valueTernary } from './utils';
15
+ import { classNames, cleanValue, filterUnsupportedSelectors, isDocumentElement, isMobileDevice, isTouchCapable, multiValueAsValue, noop, notNullish, scrollIntoView, singleValueAsValue, valueTernary } from './utils';
16
16
  export const defaultProps = {
17
17
  // aria-live is by default with the live region so we don't need it
18
18
  // eslint-disable-next-line @atlaskit/platform/no-module-level-eval
@@ -380,7 +380,11 @@ export default class Select extends Component {
380
380
  const base = defaultStyles[key](props);
381
381
  base.boxSizing = 'border-box';
382
382
  const custom = this.props.styles[key];
383
- return custom ? custom(base, props) : base;
383
+ if (!custom) {
384
+ return base;
385
+ }
386
+ const customStyles = fg('compiled-react-select') ? filterUnsupportedSelectors(custom(base, props)) : custom(base, props);
387
+ return customStyles;
384
388
  });
385
389
  _defineProperty(this, "getClassNames", (key, props) => {
386
390
  var _this$props$className, _this$props$className2;
@@ -297,4 +297,40 @@ export const removeProps = (propsObj, ...properties) => {
297
297
  newProps[key] = val;
298
298
  return newProps;
299
299
  }, {});
300
+ };
301
+
302
+ /**
303
+ * Filters out unsupported selectors (e.g., pseudo-classes, complex selectors) from a styles object.
304
+ * @param styles - The styles object to filter.
305
+ * @returns A new object containing only supported styles.
306
+ */
307
+ export const filterUnsupportedSelectors = styles => {
308
+ const unsupportedSelectors = [':hover', ':focus', ':active', ':visited', ':link', ':checked', ':disabled', ':enabled', ':first-child', ':last-child', ':nth-child', ':nth-last-child', ':only-child', ':first-of-type', ':last-of-type', ':nth-of-type', ':nth-last-of-type', ':only-of-type', ':empty', ':not', ':root', ':target', ':before', ':after', '::before', '::after', '::placeholder', '::selection', '::backdrop', '::marker', '::first-line', '::first-letter', '::spelling-error', '::grammar-error', '[attr]',
309
+ // Attribute selectors
310
+ '[attr=value]',
311
+ // Attribute value selectors
312
+ '[attr^=value]',
313
+ // Attribute starts with
314
+ '[attr$=value]',
315
+ // Attribute ends with
316
+ '[attr*=value]',
317
+ // Attribute contains
318
+ '[attr|=value]',
319
+ // Attribute value with hyphen
320
+ '[attr~=value]',
321
+ // Attribute value in space-separated list
322
+ '>',
323
+ // Child combinator
324
+ '+',
325
+ // Adjacent sibling combinator
326
+ '~',
327
+ // General sibling combinator
328
+ ' ' // Descendant combinator
329
+ ];
330
+ return Object.keys(styles).reduce((filteredStyles, key) => {
331
+ if (!unsupportedSelectors.some(selector => key.includes(selector))) {
332
+ filteredStyles[key] = styles[key];
333
+ }
334
+ return filteredStyles;
335
+ }, {});
300
336
  };
@@ -10,7 +10,6 @@ import { cx } from '@compiled/react';
10
10
  import LegacySelectClearIcon from '@atlaskit/icon/glyph/select-clear';
11
11
  import CrossIcon from '@atlaskit/icon/utility/cross';
12
12
  import { fg } from '@atlaskit/platform-feature-flags';
13
- import { Inline } from '@atlaskit/primitives/compiled';
14
13
  import { getStyleProps } from '../../utils';
15
14
  var multiValueStyles = {
16
15
  root: "_2rkogqwt _1e0c1txw _1ul9ze3t _19pkv77o _2hwxv77o _otyrv77o _18u0v77o _bfhkm7j4 _p12f1osq _syazjpor _3yq3glyw",
@@ -67,34 +66,6 @@ export var MultiValueLabel = function MultiValueLabel(_ref2) {
67
66
  };
68
67
  var disabledStyles = null;
69
68
  var enabledStyles = null;
70
- var iconWrapperStyles = {
71
- root: "_ca0qv77o _u5f3v77o _n3tdv77o _19bvv77o"
72
- };
73
- var renderIcon = function renderIcon() {
74
- // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
75
- if (fg('platform-component-visual-refresh')) {
76
- return /*#__PURE__*/React.createElement(CrossIcon, {
77
- label: "",
78
- color: "currentColor"
79
- });
80
- }
81
-
82
- // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
83
- if (fg('platform-visual-refresh-icons-legacy-facade')) {
84
- return /*#__PURE__*/React.createElement(Inline, {
85
- xcss: iconWrapperStyles.root
86
- }, /*#__PURE__*/React.createElement(CrossIcon, {
87
- label: "",
88
- color: "currentColor"
89
- }));
90
- }
91
- return /*#__PURE__*/React.createElement(LegacySelectClearIcon, {
92
- label: "",
93
- primaryColor: "transparent",
94
- size: "small",
95
- secondaryColor: "inherit"
96
- });
97
- };
98
69
  export function MultiValueRemove(_ref3) {
99
70
  var isDisabled = _ref3.isDisabled,
100
71
  isFocused = _ref3.isFocused,
@@ -107,7 +78,14 @@ export function MultiValueRemove(_ref3) {
107
78
  }), /*#__PURE__*/React.createElement("div", {
108
79
  "data-testid": isDisabled ? 'hide-clear-icon' : 'show-clear-icon',
109
80
  className: ax([isDisabled && "_1e0cglyw", !isDisabled && "_1e0c1kw7"])
110
- }, renderIcon()));
81
+ }, /*#__PURE__*/React.createElement(CrossIcon, {
82
+ label: "",
83
+ color: "currentColor",
84
+ LEGACY_fallbackIcon: LegacySelectClearIcon,
85
+ LEGACY_primaryColor: "transparent",
86
+ LEGACY_secondaryColor: "inherit",
87
+ LEGACY_size: "small"
88
+ })));
111
89
  }
112
90
  var MultiValue = function MultiValue(props) {
113
91
  var children = props.children,
@@ -30,7 +30,7 @@ export default function ScrollManager(_ref) {
30
30
  };
31
31
  return /*#__PURE__*/React.createElement(Fragment, null, lockEnabled &&
32
32
  /*#__PURE__*/
33
- // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
33
+ // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions, @atlassian/a11y/interactive-element-not-keyboard-focusable
34
34
  React.createElement("div", {
35
35
  onClick: blurSelectInput,
36
36
  style: {
@@ -43,7 +43,7 @@ export default function ScrollManager(_ref) {
43
43
  setScrollLockTarget(element);
44
44
  };
45
45
  return jsx(Fragment, null, lockEnabled &&
46
- // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
46
+ // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions, @atlassian/a11y/interactive-element-not-keyboard-focusable
47
47
  jsx("div", {
48
48
  onClick: blurSelectInput,
49
49
  css: styles
@@ -11,7 +11,6 @@ import { css, jsx } from '@emotion/react';
11
11
  import LegacySelectClearIcon from '@atlaskit/icon/glyph/select-clear';
12
12
  import CrossIcon from '@atlaskit/icon/utility/cross';
13
13
  import { fg } from '@atlaskit/platform-feature-flags';
14
- import { Inline, xcss } from '@atlaskit/primitives';
15
14
  import { getStyleProps } from '../../utils';
16
15
  export var multiValueCSS = function multiValueCSS(_ref) {
17
16
  var isDisabled = _ref.isDisabled,
@@ -132,34 +131,6 @@ var disabledStyles = css({
132
131
  var enabledStyles = css({
133
132
  display: 'inherit'
134
133
  });
135
- var iconWrapperStyles = xcss({
136
- padding: 'space.025'
137
- });
138
- var renderIcon = function renderIcon() {
139
- // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
140
- if (fg('platform-component-visual-refresh')) {
141
- return jsx(CrossIcon, {
142
- label: "",
143
- color: "currentColor"
144
- });
145
- }
146
-
147
- // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
148
- if (fg('platform-visual-refresh-icons-legacy-facade')) {
149
- return jsx(Inline, {
150
- xcss: iconWrapperStyles
151
- }, jsx(CrossIcon, {
152
- label: "",
153
- color: "currentColor"
154
- }));
155
- }
156
- return jsx(LegacySelectClearIcon, {
157
- label: "",
158
- primaryColor: "transparent",
159
- size: "small",
160
- secondaryColor: "inherit"
161
- });
162
- };
163
134
  export function MultiValueRemove(_ref5) {
164
135
  var isDisabled = _ref5.isDisabled,
165
136
  innerProps = _ref5.innerProps;
@@ -168,7 +139,14 @@ export function MultiValueRemove(_ref5) {
168
139
  jsx("div", innerProps, jsx("div", {
169
140
  css: isDisabled ? disabledStyles : enabledStyles,
170
141
  "data-testid": isDisabled ? 'hide-clear-icon' : 'show-clear-icon'
171
- }, renderIcon()))
142
+ }, jsx(CrossIcon, {
143
+ label: "",
144
+ color: "currentColor",
145
+ LEGACY_fallbackIcon: LegacySelectClearIcon,
146
+ LEGACY_primaryColor: "transparent",
147
+ LEGACY_secondaryColor: "inherit",
148
+ LEGACY_size: "small"
149
+ })))
172
150
  );
173
151
  }
174
152
  var MultiValue = function MultiValue(props) {
@@ -23,7 +23,7 @@ import LiveRegion from './components/live-region';
23
23
  import { MenuPlacer } from './components/menu';
24
24
  import { createFilter } from './filters';
25
25
  import { defaultStyles } from './styles';
26
- import { classNames, cleanValue, isDocumentElement, isMobileDevice, isTouchCapable, multiValueAsValue, noop, notNullish, scrollIntoView, singleValueAsValue, valueTernary } from './utils';
26
+ import { classNames, cleanValue, filterUnsupportedSelectors, isDocumentElement, isMobileDevice, isTouchCapable, multiValueAsValue, noop, notNullish, scrollIntoView, singleValueAsValue, valueTernary } from './utils';
27
27
  export var defaultProps = {
28
28
  // aria-live is by default with the live region so we don't need it
29
29
  // eslint-disable-next-line @atlaskit/platform/no-module-level-eval
@@ -397,7 +397,11 @@ var Select = /*#__PURE__*/function (_Component) {
397
397
  var base = defaultStyles[key](props);
398
398
  base.boxSizing = 'border-box';
399
399
  var custom = _this.props.styles[key];
400
- return custom ? custom(base, props) : base;
400
+ if (!custom) {
401
+ return base;
402
+ }
403
+ var customStyles = fg('compiled-react-select') ? filterUnsupportedSelectors(custom(base, props)) : custom(base, props);
404
+ return customStyles;
401
405
  });
402
406
  _defineProperty(_this, "getClassNames", function (key, props) {
403
407
  var _this$props$className, _this$props$className2;
package/dist/esm/utils.js CHANGED
@@ -315,4 +315,42 @@ export var removeProps = function removeProps(propsObj) {
315
315
  newProps[key] = val;
316
316
  return newProps;
317
317
  }, {});
318
+ };
319
+
320
+ /**
321
+ * Filters out unsupported selectors (e.g., pseudo-classes, complex selectors) from a styles object.
322
+ * @param styles - The styles object to filter.
323
+ * @returns A new object containing only supported styles.
324
+ */
325
+ export var filterUnsupportedSelectors = function filterUnsupportedSelectors(styles) {
326
+ var unsupportedSelectors = [':hover', ':focus', ':active', ':visited', ':link', ':checked', ':disabled', ':enabled', ':first-child', ':last-child', ':nth-child', ':nth-last-child', ':only-child', ':first-of-type', ':last-of-type', ':nth-of-type', ':nth-last-of-type', ':only-of-type', ':empty', ':not', ':root', ':target', ':before', ':after', '::before', '::after', '::placeholder', '::selection', '::backdrop', '::marker', '::first-line', '::first-letter', '::spelling-error', '::grammar-error', '[attr]',
327
+ // Attribute selectors
328
+ '[attr=value]',
329
+ // Attribute value selectors
330
+ '[attr^=value]',
331
+ // Attribute starts with
332
+ '[attr$=value]',
333
+ // Attribute ends with
334
+ '[attr*=value]',
335
+ // Attribute contains
336
+ '[attr|=value]',
337
+ // Attribute value with hyphen
338
+ '[attr~=value]',
339
+ // Attribute value in space-separated list
340
+ '>',
341
+ // Child combinator
342
+ '+',
343
+ // Adjacent sibling combinator
344
+ '~',
345
+ // General sibling combinator
346
+ ' ' // Descendant combinator
347
+ ];
348
+ return Object.keys(styles).reduce(function (filteredStyles, key) {
349
+ if (!unsupportedSelectors.some(function (selector) {
350
+ return key.includes(selector);
351
+ })) {
352
+ filteredStyles[key] = styles[key];
353
+ }
354
+ return filteredStyles;
355
+ }, {});
318
356
  };
@@ -607,7 +607,7 @@ export default class Select<Option = unknown, IsMulti extends boolean = false, G
607
607
  getCommonProps(): {
608
608
  clearValue: () => void;
609
609
  cx: (...args: any) => string;
610
- getStyles: <Key extends keyof StylesProps<Option, IsMulti, Group>>(key: Key, props: StylesProps<Option, IsMulti, Group>[Key]) => import("./types").CSSObjectWithLabel;
610
+ getStyles: <Key extends keyof StylesProps<Option, IsMulti, Group>>(key: Key, props: StylesProps<Option, IsMulti, Group>[Key]) => Record<string, any>;
611
611
  getClassNames: <Key_1 extends keyof StylesProps<Option, IsMulti, Group>>(key: Key_1, props: StylesProps<Option, IsMulti, Group>[Key_1]) => string | undefined;
612
612
  getValue: () => Options<Option>;
613
613
  hasValue: boolean;
@@ -620,7 +620,7 @@ export default class Select<Option = unknown, IsMulti extends boolean = false, G
620
620
  };
621
621
  getOptionLabel: (data: Option) => string;
622
622
  getOptionValue: (data: Option) => string;
623
- getStyles: <Key extends keyof StylesProps<Option, IsMulti, Group>>(key: Key, props: StylesProps<Option, IsMulti, Group>[Key]) => import("./types").CSSObjectWithLabel;
623
+ getStyles: <Key extends keyof StylesProps<Option, IsMulti, Group>>(key: Key, props: StylesProps<Option, IsMulti, Group>[Key]) => Record<string, any>;
624
624
  getClassNames: <Key extends keyof StylesProps<Option, IsMulti, Group>>(key: Key, props: StylesProps<Option, IsMulti, Group>[Key]) => string | undefined;
625
625
  getElementId: (element: 'group' | 'input' | 'listbox' | 'option' | 'placeholder' | 'live-region' | 'multi-message' | 'selected-value') => string;
626
626
  getComponents: () => {
@@ -32,3 +32,9 @@ export declare function valueTernary<Option, IsMulti extends boolean>(isMulti: I
32
32
  export declare function singleValueAsValue<Option, IsMulti extends boolean>(singleValue: SingleValue<Option>): OnChangeValue<Option, IsMulti>;
33
33
  export declare function multiValueAsValue<Option, IsMulti extends boolean>(multiValue: MultiValue<Option>): OnChangeValue<Option, IsMulti>;
34
34
  export declare const removeProps: <Props extends object, K extends string[]>(propsObj: Props, ...properties: K) => Omit<Props, K[number]>;
35
+ /**
36
+ * Filters out unsupported selectors (e.g., pseudo-classes, complex selectors) from a styles object.
37
+ * @param styles - The styles object to filter.
38
+ * @returns A new object containing only supported styles.
39
+ */
40
+ export declare const filterUnsupportedSelectors: (styles: Record<string, any>) => Record<string, any>;
@@ -607,7 +607,7 @@ export default class Select<Option = unknown, IsMulti extends boolean = false, G
607
607
  getCommonProps(): {
608
608
  clearValue: () => void;
609
609
  cx: (...args: any) => string;
610
- getStyles: <Key extends keyof StylesProps<Option, IsMulti, Group>>(key: Key, props: StylesProps<Option, IsMulti, Group>[Key]) => import("./types").CSSObjectWithLabel;
610
+ getStyles: <Key extends keyof StylesProps<Option, IsMulti, Group>>(key: Key, props: StylesProps<Option, IsMulti, Group>[Key]) => Record<string, any>;
611
611
  getClassNames: <Key_1 extends keyof StylesProps<Option, IsMulti, Group>>(key: Key_1, props: StylesProps<Option, IsMulti, Group>[Key_1]) => string | undefined;
612
612
  getValue: () => Options<Option>;
613
613
  hasValue: boolean;
@@ -620,7 +620,7 @@ export default class Select<Option = unknown, IsMulti extends boolean = false, G
620
620
  };
621
621
  getOptionLabel: (data: Option) => string;
622
622
  getOptionValue: (data: Option) => string;
623
- getStyles: <Key extends keyof StylesProps<Option, IsMulti, Group>>(key: Key, props: StylesProps<Option, IsMulti, Group>[Key]) => import("./types").CSSObjectWithLabel;
623
+ getStyles: <Key extends keyof StylesProps<Option, IsMulti, Group>>(key: Key, props: StylesProps<Option, IsMulti, Group>[Key]) => Record<string, any>;
624
624
  getClassNames: <Key extends keyof StylesProps<Option, IsMulti, Group>>(key: Key, props: StylesProps<Option, IsMulti, Group>[Key]) => string | undefined;
625
625
  getElementId: (element: 'group' | 'input' | 'listbox' | 'option' | 'placeholder' | 'live-region' | 'multi-message' | 'selected-value') => string;
626
626
  getComponents: () => {
@@ -32,3 +32,9 @@ export declare function valueTernary<Option, IsMulti extends boolean>(isMulti: I
32
32
  export declare function singleValueAsValue<Option, IsMulti extends boolean>(singleValue: SingleValue<Option>): OnChangeValue<Option, IsMulti>;
33
33
  export declare function multiValueAsValue<Option, IsMulti extends boolean>(multiValue: MultiValue<Option>): OnChangeValue<Option, IsMulti>;
34
34
  export declare const removeProps: <Props extends object, K extends string[]>(propsObj: Props, ...properties: K) => Omit<Props, K[number]>;
35
+ /**
36
+ * Filters out unsupported selectors (e.g., pseudo-classes, complex selectors) from a styles object.
37
+ * @param styles - The styles object to filter.
38
+ * @returns A new object containing only supported styles.
39
+ */
40
+ export declare const filterUnsupportedSelectors: (styles: Record<string, any>) => Record<string, any>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/react-select",
3
- "version": "2.4.3",
3
+ "version": "2.4.5",
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",
@@ -48,7 +48,7 @@
48
48
  "react-dom": "^18.2.0"
49
49
  },
50
50
  "devDependencies": {
51
- "@atlaskit/checkbox": "^17.0.0",
51
+ "@atlaskit/checkbox": "^17.1.0",
52
52
  "@atlaskit/form": "^12.0.0",
53
53
  "@atlassian/feature-flags-test-utils": "^0.3.0",
54
54
  "@testing-library/react": "^13.4.0",
@@ -72,9 +72,6 @@
72
72
  "design-system-select-fix-placement": {
73
73
  "type": "boolean"
74
74
  },
75
- "platform-visual-refresh-icons-legacy-facade": {
76
- "type": "boolean"
77
- },
78
75
  "platform_dst_layer_observer_select": {
79
76
  "type": "boolean"
80
77
  },