@atlaskit/react-select 2.4.8 → 2.4.10

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.10
4
+
5
+ ### Patch Changes
6
+
7
+ - [#157159](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/157159)
8
+ [`8da004db78761`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8da004db78761) -
9
+ Migrate menuPortal inline styles to compiled styles
10
+
11
+ ## 2.4.9
12
+
13
+ ### Patch Changes
14
+
15
+ - [#156309](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/156309)
16
+ [`684b2b1960644`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/684b2b1960644) -
17
+ Remove all possible CSS selector patterns that would be invalid in inline styles
18
+
3
19
  ## 2.4.8
4
20
 
5
21
  ### Patch Changes
@@ -1,9 +1,13 @@
1
1
 
2
- ._2rkoglpi{border-radius:var(--ds-border-radius,4px)}._154i1osq{top:100%}
2
+ ._2rkoglpi{border-radius:var(--ds-border-radius,4px)}._154i1nmo{top:var(--menu-top)}
3
+ ._154i1osq{top:100%}
3
4
  ._16qsd0yg{box-shadow:var(--ds-shadow-overlay,0 0 0 1px rgba(0,0,0,.1),0 4px 11px rgba(0,0,0,.1))}
4
5
  ._18m91wug{overflow-y:auto}
5
6
  ._19pku2gc{margin-top:var(--ds-space-100,8px)}
6
7
  ._1bsb1osq{width:100%}
8
+ ._1bsb1qxj{width:var(--menu-width)}
9
+ ._1ltva1vk{left:var(--menu-left)}
10
+ ._1pbydx66{z-index:9999}
7
11
  ._1pbykb7n{z-index:1}
8
12
  ._1q51u2gc{padding-block-start:var(--ds-space-100,8px)}
9
13
  ._85i5u2gc{padding-block-end:var(--ds-space-100,8px)}
@@ -11,6 +15,7 @@
11
15
  ._94n51osq{bottom:100%}
12
16
  ._bfhk1bhr{background-color:var(--ds-surface-overlay,#fff)}
13
17
  ._bozgutpp{padding-inline-start:var(--ds-space-150,9pt)}
18
+ ._kqswcp1v{position:var(--menu-position)}
14
19
  ._kqswh2mm{position:relative}
15
20
  ._kqswstnw{position:absolute}
16
21
  ._otyru2gc{margin-bottom:var(--ds-space-100,8px)}
@@ -397,6 +397,9 @@ var LoadingMessage = exports.LoadingMessage = function LoadingMessage(_ref4) {
397
397
  var menuPortalCSS = exports.menuPortalCSS = function menuPortalCSS() {
398
398
  return {};
399
399
  };
400
+ var menuPortalStyles = {
401
+ root: "_1pbydx66 _1ltva1vk _kqswcp1v _154i1nmo _1bsb1qxj"
402
+ };
400
403
  // eslint-disable-next-line @repo/internal/react/require-jsdoc
401
404
  var MenuPortal = exports.MenuPortal = function MenuPortal(props) {
402
405
  var appendTo = props.appendTo,
@@ -474,15 +477,14 @@ var MenuPortal = exports.MenuPortal = function MenuPortal(props) {
474
477
  // same wrapper element whether fixed or portalled
475
478
  var menuWrapper = /*#__PURE__*/React.createElement("div", (0, _extends2.default)({
476
479
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop, @atlaskit/ui-styling-standard/local-cx-xcss, @compiled/local-cx-xcss
477
- className: (0, _react2.cx)(className, xcss, '-MenuPortal'),
480
+ className: (0, _runtime.ax)([menuPortalStyles.root, (0, _react2.cx)(className, xcss, '-MenuPortal')]),
478
481
  ref: setMenuPortalElement,
479
482
  style: _objectSpread({
480
483
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
481
- zIndex: 9999,
482
- left: computedPosition.rect.left,
483
- position: menuPosition,
484
- top: computedPosition.offset,
485
- width: computedPosition.rect.width
484
+ '--menu-left': "".concat(computedPosition.rect.left, "px"),
485
+ '--menu-position': menuPosition,
486
+ '--menu-top': "".concat(computedPosition.offset, "px"),
487
+ '--menu-width': "".concat(computedPosition.rect.width, "px")
486
488
  }, css)
487
489
  }, innerProps), children);
488
490
  return /*#__PURE__*/React.createElement(PortalPlacementContext.Provider, {
package/dist/cjs/utils.js CHANGED
@@ -350,27 +350,35 @@ var removeProps = exports.removeProps = function removeProps(propsObj) {
350
350
  * @returns A new object containing only supported styles.
351
351
  */
352
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
353
+ var unsupportedSelectors = [':',
354
+ // pseudo-classes/elements
355
+ '[',
356
+ // attribute selectors
367
357
  '>',
368
- // Child combinator
358
+ // child combinator
369
359
  '+',
370
- // Adjacent sibling combinator
360
+ // adjacent sibling combinator
371
361
  '~',
372
- // General sibling combinator
373
- ' ' // Descendant combinator
362
+ // general sibling combinator
363
+ ' ',
364
+ // descendant combinator
365
+ '*',
366
+ // universal selector
367
+ '#',
368
+ // ID selector
369
+ '.',
370
+ // class selector
371
+ '@',
372
+ // at-rules
373
+ '&',
374
+ // parent selector
375
+ '|',
376
+ // namespace separator
377
+ '^',
378
+ // starts with
379
+ '$',
380
+ // ends with
381
+ '=' // equals
374
382
  ];
375
383
  return Object.keys(styles).reduce(function (filteredStyles, key) {
376
384
  if (!unsupportedSelectors.some(function (selector) {
@@ -1,9 +1,13 @@
1
1
 
2
- ._2rkoglpi{border-radius:var(--ds-border-radius,4px)}._154i1osq{top:100%}
2
+ ._2rkoglpi{border-radius:var(--ds-border-radius,4px)}._154i1nmo{top:var(--menu-top)}
3
+ ._154i1osq{top:100%}
3
4
  ._16qsd0yg{box-shadow:var(--ds-shadow-overlay,0 0 0 1px rgba(0,0,0,.1),0 4px 11px rgba(0,0,0,.1))}
4
5
  ._18m91wug{overflow-y:auto}
5
6
  ._19pku2gc{margin-top:var(--ds-space-100,8px)}
6
7
  ._1bsb1osq{width:100%}
8
+ ._1bsb1qxj{width:var(--menu-width)}
9
+ ._1ltva1vk{left:var(--menu-left)}
10
+ ._1pbydx66{z-index:9999}
7
11
  ._1pbykb7n{z-index:1}
8
12
  ._1q51u2gc{padding-block-start:var(--ds-space-100,8px)}
9
13
  ._85i5u2gc{padding-block-end:var(--ds-space-100,8px)}
@@ -11,6 +15,7 @@
11
15
  ._94n51osq{bottom:100%}
12
16
  ._bfhk1bhr{background-color:var(--ds-surface-overlay,#fff)}
13
17
  ._bozgutpp{padding-inline-start:var(--ds-space-150,9pt)}
18
+ ._kqswcp1v{position:var(--menu-position)}
14
19
  ._kqswh2mm{position:relative}
15
20
  ._kqswstnw{position:absolute}
16
21
  ._otyru2gc{margin-bottom:var(--ds-space-100,8px)}
@@ -386,6 +386,9 @@ export const LoadingMessage = ({
386
386
  // ==============================
387
387
 
388
388
  export const menuPortalCSS = () => ({});
389
+ const menuPortalStyles = {
390
+ root: "_1pbydx66 _1ltva1vk _kqswcp1v _154i1nmo _1bsb1qxj"
391
+ };
389
392
  // eslint-disable-next-line @repo/internal/react/require-jsdoc
390
393
  export const MenuPortal = props => {
391
394
  const {
@@ -459,15 +462,14 @@ export const MenuPortal = props => {
459
462
  // same wrapper element whether fixed or portalled
460
463
  const menuWrapper = /*#__PURE__*/React.createElement("div", _extends({
461
464
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop, @atlaskit/ui-styling-standard/local-cx-xcss, @compiled/local-cx-xcss
462
- className: cx(className, xcss, '-MenuPortal'),
465
+ className: ax([menuPortalStyles.root, cx(className, xcss, '-MenuPortal')]),
463
466
  ref: setMenuPortalElement,
464
467
  style: {
465
468
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
466
- zIndex: 9999,
467
- left: computedPosition.rect.left,
468
- position: menuPosition,
469
- top: computedPosition.offset,
470
- width: computedPosition.rect.width,
469
+ '--menu-left': `${computedPosition.rect.left}px`,
470
+ '--menu-position': menuPosition,
471
+ '--menu-top': `${computedPosition.offset}px`,
472
+ '--menu-width': `${computedPosition.rect.width}px`,
471
473
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
472
474
  ...css
473
475
  }
@@ -305,27 +305,35 @@ export const removeProps = (propsObj, ...properties) => {
305
305
  * @returns A new object containing only supported styles.
306
306
  */
307
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
308
+ const unsupportedSelectors = [':',
309
+ // pseudo-classes/elements
310
+ '[',
311
+ // attribute selectors
322
312
  '>',
323
- // Child combinator
313
+ // child combinator
324
314
  '+',
325
- // Adjacent sibling combinator
315
+ // adjacent sibling combinator
326
316
  '~',
327
- // General sibling combinator
328
- ' ' // Descendant combinator
317
+ // general sibling combinator
318
+ ' ',
319
+ // descendant combinator
320
+ '*',
321
+ // universal selector
322
+ '#',
323
+ // ID selector
324
+ '.',
325
+ // class selector
326
+ '@',
327
+ // at-rules
328
+ '&',
329
+ // parent selector
330
+ '|',
331
+ // namespace separator
332
+ '^',
333
+ // starts with
334
+ '$',
335
+ // ends with
336
+ '=' // equals
329
337
  ];
330
338
  return Object.keys(styles).reduce((filteredStyles, key) => {
331
339
  if (!unsupportedSelectors.some(selector => key.includes(selector))) {
@@ -1,9 +1,13 @@
1
1
 
2
- ._2rkoglpi{border-radius:var(--ds-border-radius,4px)}._154i1osq{top:100%}
2
+ ._2rkoglpi{border-radius:var(--ds-border-radius,4px)}._154i1nmo{top:var(--menu-top)}
3
+ ._154i1osq{top:100%}
3
4
  ._16qsd0yg{box-shadow:var(--ds-shadow-overlay,0 0 0 1px rgba(0,0,0,.1),0 4px 11px rgba(0,0,0,.1))}
4
5
  ._18m91wug{overflow-y:auto}
5
6
  ._19pku2gc{margin-top:var(--ds-space-100,8px)}
6
7
  ._1bsb1osq{width:100%}
8
+ ._1bsb1qxj{width:var(--menu-width)}
9
+ ._1ltva1vk{left:var(--menu-left)}
10
+ ._1pbydx66{z-index:9999}
7
11
  ._1pbykb7n{z-index:1}
8
12
  ._1q51u2gc{padding-block-start:var(--ds-space-100,8px)}
9
13
  ._85i5u2gc{padding-block-end:var(--ds-space-100,8px)}
@@ -11,6 +15,7 @@
11
15
  ._94n51osq{bottom:100%}
12
16
  ._bfhk1bhr{background-color:var(--ds-surface-overlay,#fff)}
13
17
  ._bozgutpp{padding-inline-start:var(--ds-space-150,9pt)}
18
+ ._kqswcp1v{position:var(--menu-position)}
14
19
  ._kqswh2mm{position:relative}
15
20
  ._kqswstnw{position:absolute}
16
21
  ._otyru2gc{margin-bottom:var(--ds-space-100,8px)}
@@ -391,6 +391,9 @@ export var LoadingMessage = function LoadingMessage(_ref4) {
391
391
  export var menuPortalCSS = function menuPortalCSS() {
392
392
  return {};
393
393
  };
394
+ var menuPortalStyles = {
395
+ root: "_1pbydx66 _1ltva1vk _kqswcp1v _154i1nmo _1bsb1qxj"
396
+ };
394
397
  // eslint-disable-next-line @repo/internal/react/require-jsdoc
395
398
  export var MenuPortal = function MenuPortal(props) {
396
399
  var appendTo = props.appendTo,
@@ -468,15 +471,14 @@ export var MenuPortal = function MenuPortal(props) {
468
471
  // same wrapper element whether fixed or portalled
469
472
  var menuWrapper = /*#__PURE__*/React.createElement("div", _extends({
470
473
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop, @atlaskit/ui-styling-standard/local-cx-xcss, @compiled/local-cx-xcss
471
- className: cx(className, xcss, '-MenuPortal'),
474
+ className: ax([menuPortalStyles.root, cx(className, xcss, '-MenuPortal')]),
472
475
  ref: setMenuPortalElement,
473
476
  style: _objectSpread({
474
477
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
475
- zIndex: 9999,
476
- left: computedPosition.rect.left,
477
- position: menuPosition,
478
- top: computedPosition.offset,
479
- width: computedPosition.rect.width
478
+ '--menu-left': "".concat(computedPosition.rect.left, "px"),
479
+ '--menu-position': menuPosition,
480
+ '--menu-top': "".concat(computedPosition.offset, "px"),
481
+ '--menu-width': "".concat(computedPosition.rect.width, "px")
480
482
  }, css)
481
483
  }, innerProps), children);
482
484
  return /*#__PURE__*/React.createElement(PortalPlacementContext.Provider, {
package/dist/esm/utils.js CHANGED
@@ -323,27 +323,35 @@ export var removeProps = function removeProps(propsObj) {
323
323
  * @returns A new object containing only supported styles.
324
324
  */
325
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
326
+ var unsupportedSelectors = [':',
327
+ // pseudo-classes/elements
328
+ '[',
329
+ // attribute selectors
340
330
  '>',
341
- // Child combinator
331
+ // child combinator
342
332
  '+',
343
- // Adjacent sibling combinator
333
+ // adjacent sibling combinator
344
334
  '~',
345
- // General sibling combinator
346
- ' ' // Descendant combinator
335
+ // general sibling combinator
336
+ ' ',
337
+ // descendant combinator
338
+ '*',
339
+ // universal selector
340
+ '#',
341
+ // ID selector
342
+ '.',
343
+ // class selector
344
+ '@',
345
+ // at-rules
346
+ '&',
347
+ // parent selector
348
+ '|',
349
+ // namespace separator
350
+ '^',
351
+ // starts with
352
+ '$',
353
+ // ends with
354
+ '=' // equals
347
355
  ];
348
356
  return Object.keys(styles).reduce(function (filteredStyles, key) {
349
357
  if (!unsupportedSelectors.some(function (selector) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/react-select",
3
- "version": "2.4.8",
3
+ "version": "2.4.10",
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",