@atlaskit/react-select 2.4.4 → 2.4.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 +16 -0
- package/dist/cjs/compiled/components/control.compiled.css +0 -1
- package/dist/cjs/compiled/components/control.js +1 -1
- package/dist/cjs/compiled/components/group.compiled.css +0 -1
- package/dist/cjs/compiled/components/group.js +1 -1
- package/dist/cjs/compiled/components/menu.compiled.css +0 -1
- package/dist/cjs/compiled/components/menu.js +1 -1
- package/dist/cjs/compiled/components/single-value.compiled.css +0 -1
- package/dist/cjs/compiled/components/single-value.js +1 -1
- package/dist/cjs/select.js +5 -1
- package/dist/cjs/utils.js +39 -1
- package/dist/es2019/compiled/components/control.compiled.css +0 -1
- package/dist/es2019/compiled/components/control.js +1 -1
- package/dist/es2019/compiled/components/group.compiled.css +0 -1
- package/dist/es2019/compiled/components/group.js +1 -1
- package/dist/es2019/compiled/components/menu.compiled.css +0 -1
- package/dist/es2019/compiled/components/menu.js +1 -1
- package/dist/es2019/compiled/components/single-value.compiled.css +0 -1
- package/dist/es2019/compiled/components/single-value.js +1 -1
- package/dist/es2019/select.js +6 -2
- package/dist/es2019/utils.js +36 -0
- package/dist/esm/compiled/components/control.compiled.css +0 -1
- package/dist/esm/compiled/components/control.js +1 -1
- package/dist/esm/compiled/components/group.compiled.css +0 -1
- package/dist/esm/compiled/components/group.js +1 -1
- package/dist/esm/compiled/components/menu.compiled.css +0 -1
- package/dist/esm/compiled/components/menu.js +1 -1
- package/dist/esm/compiled/components/single-value.compiled.css +0 -1
- package/dist/esm/compiled/components/single-value.js +1 -1
- package/dist/esm/select.js +6 -2
- package/dist/esm/utils.js +38 -0
- package/dist/types/select.d.ts +2 -2
- package/dist/types/utils.d.ts +6 -0
- package/dist/types-ts4.5/select.d.ts +2 -2
- package/dist/types-ts4.5/utils.d.ts +6 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/react-select
|
|
2
2
|
|
|
3
|
+
## 2.4.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#149640](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/149640)
|
|
8
|
+
[`0f41428da5608`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0f41428da5608) -
|
|
9
|
+
Remove label in compiled styles
|
|
10
|
+
|
|
11
|
+
## 2.4.5
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#146587](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/146587)
|
|
16
|
+
[`f296c108b483f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f296c108b483f) -
|
|
17
|
+
Filter out unsupported styles from styles props under feature flag
|
|
18
|
+
|
|
3
19
|
## 2.4.4
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -30,7 +30,6 @@
|
|
|
30
30
|
._bfhkvuon{background-color:var(--ds-surface,#fff)}
|
|
31
31
|
._ca0qidpf{padding-top:0}
|
|
32
32
|
._jaboglyw::-webkit-scrollbar-corner{display:none}
|
|
33
|
-
._jqf6y3o9{label:control}
|
|
34
33
|
._kqswh2mm{position:relative}
|
|
35
34
|
._lcxvglyw{pointer-events:none}
|
|
36
35
|
._n3tdidpf{padding-bottom:0}
|
|
@@ -17,7 +17,7 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
|
|
|
17
17
|
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; }
|
|
18
18
|
/* eslint-disable @atlaskit/ui-styling-standard/no-unsafe-selectors */
|
|
19
19
|
var styles = {
|
|
20
|
-
default: "_12ji1r31 _1qu2glyw _12y3idpf _2rkosqtm _ca0qidpf _u5f3idpf _n3tdidpf _19bvidpf _v564r5cv _1h6d1elr _1dqonqa1 _189ee4h9
|
|
20
|
+
default: "_12ji1r31 _1qu2glyw _12y3idpf _2rkosqtm _ca0qidpf _u5f3idpf _n3tdidpf _19bvidpf _v564r5cv _1h6d1elr _1dqonqa1 _189ee4h9 _4cvr1h6o _80om73ad _1e0c1txw _1n261g80 _1bah1yb4 _kqswh2mm _bfhk1j9a _1tke1ylp _15peftgi _1ke8ftgi _jaboglyw _1u6l1bml _4cvx1elr _123byq51 _d0altlke _irr31d5g _1ogl1caj",
|
|
21
21
|
compact: "_1tkezwfg",
|
|
22
22
|
invalid: "_1h6d1bqt _16qsizbr _1u6lizbr _4cvx1bqt",
|
|
23
23
|
focusedInvalid: "_16qsq049",
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
._80om73ad{cursor:default}
|
|
6
6
|
._bozgutpp{padding-inline-start:var(--ds-space-150,9pt)}
|
|
7
7
|
._ca0qu2gc{padding-top:var(--ds-space-100,8px)}
|
|
8
|
-
._jqf6dpkn{label:group}
|
|
9
8
|
._k48pmoej{font-weight:var(--ds-font-weight-bold,700)}
|
|
10
9
|
._n3tdu2gc{padding-bottom:var(--ds-space-100,8px)}
|
|
11
10
|
._syaz1gjq{color:var(--ds-text-subtle,#44546f)}
|
|
@@ -70,7 +70,7 @@ var GroupHeading = exports.GroupHeading = function GroupHeading(props) {
|
|
|
70
70
|
className = _getStyleProps2.className;
|
|
71
71
|
return /*#__PURE__*/React.createElement("div", (0, _extends2.default)({
|
|
72
72
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop, @atlaskit/ui-styling-standard/local-cx-xcss, @compiled/local-cx-xcss
|
|
73
|
-
className: (0, _runtime.ax)(["_11c81o8v _1e0c1ule _syaz1gjq _80om73ad _k48pmoej
|
|
73
|
+
className: (0, _runtime.ax)(["_11c81o8v _1e0c1ule _syaz1gjq _80om73ad _k48pmoej _6rthpd1z _y4tiutpp _bozgutpp _1p1dglyw", (0, _react2.cx)(className, xcss)])
|
|
74
74
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
75
75
|
,
|
|
76
76
|
style: css
|
|
@@ -11,7 +11,6 @@
|
|
|
11
11
|
._94n51osq{bottom:100%}
|
|
12
12
|
._bfhk1bhr{background-color:var(--ds-surface-overlay,#fff)}
|
|
13
13
|
._bozgutpp{padding-inline-start:var(--ds-space-150,9pt)}
|
|
14
|
-
._jqf689mz{label:menu}
|
|
15
14
|
._kqswh2mm{position:relative}
|
|
16
15
|
._kqswstnw{position:absolute}
|
|
17
16
|
._otyru2gc{margin-bottom:var(--ds-space-100,8px)}
|
|
@@ -200,7 +200,7 @@ var coercePlacement = function coercePlacement(p) {
|
|
|
200
200
|
return p === 'auto' ? 'bottom' : p;
|
|
201
201
|
};
|
|
202
202
|
var menuStyles = {
|
|
203
|
-
root: "_2rkoglpi
|
|
203
|
+
root: "_2rkoglpi _kqswstnw _1bsb1osq _1pbykb7n _otyru2gc _19pku2gc _bfhk1bhr _16qsd0yg",
|
|
204
204
|
bottom: "_154i1osq",
|
|
205
205
|
top: "_94n51osq"
|
|
206
206
|
};
|
|
@@ -19,7 +19,7 @@ var css = exports.css = function css() {
|
|
|
19
19
|
return {};
|
|
20
20
|
};
|
|
21
21
|
var styles = {
|
|
22
|
-
root: "_nd5l1sux _1reo15vq _18m915vq
|
|
22
|
+
root: "_nd5l1sux _1reo15vq _18m915vq _p12f1osq _1bto1l2s _o5721q9c _19pkidpf _2hwxv77o _otyridpf _18u0v77o _syaz1fxt",
|
|
23
23
|
disalbed: "_syaz1lh4"
|
|
24
24
|
};
|
|
25
25
|
var SingleValue = function SingleValue(props) {
|
package/dist/cjs/select.js
CHANGED
|
@@ -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
|
-
|
|
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
|
};
|
|
@@ -30,7 +30,6 @@
|
|
|
30
30
|
._bfhkvuon{background-color:var(--ds-surface,#fff)}
|
|
31
31
|
._ca0qidpf{padding-top:0}
|
|
32
32
|
._jaboglyw::-webkit-scrollbar-corner{display:none}
|
|
33
|
-
._jqf6y3o9{label:control}
|
|
34
33
|
._kqswh2mm{position:relative}
|
|
35
34
|
._lcxvglyw{pointer-events:none}
|
|
36
35
|
._n3tdidpf{padding-bottom:0}
|
|
@@ -8,7 +8,7 @@ import { ax, ix } from "@compiled/react/runtime";
|
|
|
8
8
|
import { cx } from '@compiled/react';
|
|
9
9
|
import { getStyleProps } from '../../utils';
|
|
10
10
|
const styles = {
|
|
11
|
-
default: "_12ji1r31 _1qu2glyw _12y3idpf _2rkosqtm _ca0qidpf _u5f3idpf _n3tdidpf _19bvidpf _v564r5cv _1h6d1elr _1dqonqa1 _189ee4h9
|
|
11
|
+
default: "_12ji1r31 _1qu2glyw _12y3idpf _2rkosqtm _ca0qidpf _u5f3idpf _n3tdidpf _19bvidpf _v564r5cv _1h6d1elr _1dqonqa1 _189ee4h9 _4cvr1h6o _80om73ad _1e0c1txw _1n261g80 _1bah1yb4 _kqswh2mm _bfhk1j9a _1tke1ylp _15peftgi _1ke8ftgi _jaboglyw _1u6l1bml _4cvx1elr _123byq51 _d0altlke _irr31d5g _1ogl1caj",
|
|
12
12
|
compact: "_1tkezwfg",
|
|
13
13
|
invalid: "_1h6d1bqt _16qsizbr _1u6lizbr _4cvx1bqt",
|
|
14
14
|
focusedInvalid: "_16qsq049",
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
._80om73ad{cursor:default}
|
|
6
6
|
._bozgutpp{padding-inline-start:var(--ds-space-150,9pt)}
|
|
7
7
|
._ca0qu2gc{padding-top:var(--ds-space-100,8px)}
|
|
8
|
-
._jqf6dpkn{label:group}
|
|
9
8
|
._k48pmoej{font-weight:var(--ds-font-weight-bold,700)}
|
|
10
9
|
._n3tdu2gc{padding-bottom:var(--ds-space-100,8px)}
|
|
11
10
|
._syaz1gjq{color:var(--ds-text-subtle,#44546f)}
|
|
@@ -61,7 +61,7 @@ export const GroupHeading = props => {
|
|
|
61
61
|
});
|
|
62
62
|
return /*#__PURE__*/React.createElement("div", _extends({
|
|
63
63
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop, @atlaskit/ui-styling-standard/local-cx-xcss, @compiled/local-cx-xcss
|
|
64
|
-
className: ax(["_11c81o8v _1e0c1ule _syaz1gjq _80om73ad _k48pmoej
|
|
64
|
+
className: ax(["_11c81o8v _1e0c1ule _syaz1gjq _80om73ad _k48pmoej _6rthpd1z _y4tiutpp _bozgutpp _1p1dglyw", cx(className, xcss)])
|
|
65
65
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
66
66
|
,
|
|
67
67
|
style: css
|
|
@@ -11,7 +11,6 @@
|
|
|
11
11
|
._94n51osq{bottom:100%}
|
|
12
12
|
._bfhk1bhr{background-color:var(--ds-surface-overlay,#fff)}
|
|
13
13
|
._bozgutpp{padding-inline-start:var(--ds-space-150,9pt)}
|
|
14
|
-
._jqf689mz{label:menu}
|
|
15
14
|
._kqswh2mm{position:relative}
|
|
16
15
|
._kqswstnw{position:absolute}
|
|
17
16
|
._otyru2gc{margin-bottom:var(--ds-space-100,8px)}
|
|
@@ -186,7 +186,7 @@ function getMenuPlacement({
|
|
|
186
186
|
|
|
187
187
|
const coercePlacement = p => p === 'auto' ? 'bottom' : p;
|
|
188
188
|
const menuStyles = {
|
|
189
|
-
root: "_2rkoglpi
|
|
189
|
+
root: "_2rkoglpi _kqswstnw _1bsb1osq _1pbykb7n _otyru2gc _19pku2gc _bfhk1bhr _16qsd0yg",
|
|
190
190
|
bottom: "_154i1osq",
|
|
191
191
|
top: "_94n51osq"
|
|
192
192
|
};
|
|
@@ -7,7 +7,7 @@ import { cx } from '@compiled/react';
|
|
|
7
7
|
import { getStyleProps } from '../../utils';
|
|
8
8
|
export const css = () => ({});
|
|
9
9
|
const styles = {
|
|
10
|
-
root: "_nd5l1sux _1reo15vq _18m915vq
|
|
10
|
+
root: "_nd5l1sux _1reo15vq _18m915vq _p12f1osq _1bto1l2s _o5721q9c _19pkidpf _2hwxv77o _otyridpf _18u0v77o _syaz1fxt",
|
|
11
11
|
disalbed: "_syaz1lh4"
|
|
12
12
|
};
|
|
13
13
|
const SingleValue = props => {
|
package/dist/es2019/select.js
CHANGED
|
@@ -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
|
-
|
|
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;
|
package/dist/es2019/utils.js
CHANGED
|
@@ -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
|
};
|
|
@@ -30,7 +30,6 @@
|
|
|
30
30
|
._bfhkvuon{background-color:var(--ds-surface,#fff)}
|
|
31
31
|
._ca0qidpf{padding-top:0}
|
|
32
32
|
._jaboglyw::-webkit-scrollbar-corner{display:none}
|
|
33
|
-
._jqf6y3o9{label:control}
|
|
34
33
|
._kqswh2mm{position:relative}
|
|
35
34
|
._lcxvglyw{pointer-events:none}
|
|
36
35
|
._n3tdidpf{padding-bottom:0}
|
|
@@ -8,7 +8,7 @@ import { ax, ix } from "@compiled/react/runtime";
|
|
|
8
8
|
import { cx } from '@compiled/react';
|
|
9
9
|
import { getStyleProps } from '../../utils';
|
|
10
10
|
var styles = {
|
|
11
|
-
default: "_12ji1r31 _1qu2glyw _12y3idpf _2rkosqtm _ca0qidpf _u5f3idpf _n3tdidpf _19bvidpf _v564r5cv _1h6d1elr _1dqonqa1 _189ee4h9
|
|
11
|
+
default: "_12ji1r31 _1qu2glyw _12y3idpf _2rkosqtm _ca0qidpf _u5f3idpf _n3tdidpf _19bvidpf _v564r5cv _1h6d1elr _1dqonqa1 _189ee4h9 _4cvr1h6o _80om73ad _1e0c1txw _1n261g80 _1bah1yb4 _kqswh2mm _bfhk1j9a _1tke1ylp _15peftgi _1ke8ftgi _jaboglyw _1u6l1bml _4cvx1elr _123byq51 _d0altlke _irr31d5g _1ogl1caj",
|
|
12
12
|
compact: "_1tkezwfg",
|
|
13
13
|
invalid: "_1h6d1bqt _16qsizbr _1u6lizbr _4cvx1bqt",
|
|
14
14
|
focusedInvalid: "_16qsq049",
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
._80om73ad{cursor:default}
|
|
6
6
|
._bozgutpp{padding-inline-start:var(--ds-space-150,9pt)}
|
|
7
7
|
._ca0qu2gc{padding-top:var(--ds-space-100,8px)}
|
|
8
|
-
._jqf6dpkn{label:group}
|
|
9
8
|
._k48pmoej{font-weight:var(--ds-font-weight-bold,700)}
|
|
10
9
|
._n3tdu2gc{padding-bottom:var(--ds-space-100,8px)}
|
|
11
10
|
._syaz1gjq{color:var(--ds-text-subtle,#44546f)}
|
|
@@ -60,7 +60,7 @@ export var GroupHeading = function GroupHeading(props) {
|
|
|
60
60
|
className = _getStyleProps2.className;
|
|
61
61
|
return /*#__PURE__*/React.createElement("div", _extends({
|
|
62
62
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop, @atlaskit/ui-styling-standard/local-cx-xcss, @compiled/local-cx-xcss
|
|
63
|
-
className: ax(["_11c81o8v _1e0c1ule _syaz1gjq _80om73ad _k48pmoej
|
|
63
|
+
className: ax(["_11c81o8v _1e0c1ule _syaz1gjq _80om73ad _k48pmoej _6rthpd1z _y4tiutpp _bozgutpp _1p1dglyw", cx(className, xcss)])
|
|
64
64
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
65
65
|
,
|
|
66
66
|
style: css
|
|
@@ -11,7 +11,6 @@
|
|
|
11
11
|
._94n51osq{bottom:100%}
|
|
12
12
|
._bfhk1bhr{background-color:var(--ds-surface-overlay,#fff)}
|
|
13
13
|
._bozgutpp{padding-inline-start:var(--ds-space-150,9pt)}
|
|
14
|
-
._jqf689mz{label:menu}
|
|
15
14
|
._kqswh2mm{position:relative}
|
|
16
15
|
._kqswstnw{position:absolute}
|
|
17
16
|
._otyru2gc{margin-bottom:var(--ds-space-100,8px)}
|
|
@@ -191,7 +191,7 @@ var coercePlacement = function coercePlacement(p) {
|
|
|
191
191
|
return p === 'auto' ? 'bottom' : p;
|
|
192
192
|
};
|
|
193
193
|
var menuStyles = {
|
|
194
|
-
root: "_2rkoglpi
|
|
194
|
+
root: "_2rkoglpi _kqswstnw _1bsb1osq _1pbykb7n _otyru2gc _19pku2gc _bfhk1bhr _16qsd0yg",
|
|
195
195
|
bottom: "_154i1osq",
|
|
196
196
|
top: "_94n51osq"
|
|
197
197
|
};
|
|
@@ -9,7 +9,7 @@ export var css = function css() {
|
|
|
9
9
|
return {};
|
|
10
10
|
};
|
|
11
11
|
var styles = {
|
|
12
|
-
root: "_nd5l1sux _1reo15vq _18m915vq
|
|
12
|
+
root: "_nd5l1sux _1reo15vq _18m915vq _p12f1osq _1bto1l2s _o5721q9c _19pkidpf _2hwxv77o _otyridpf _18u0v77o _syaz1fxt",
|
|
13
13
|
disalbed: "_syaz1lh4"
|
|
14
14
|
};
|
|
15
15
|
var SingleValue = function SingleValue(props) {
|
package/dist/esm/select.js
CHANGED
|
@@ -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
|
-
|
|
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
|
};
|
package/dist/types/select.d.ts
CHANGED
|
@@ -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]) =>
|
|
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]) =>
|
|
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: () => {
|
package/dist/types/utils.d.ts
CHANGED
|
@@ -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]) =>
|
|
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]) =>
|
|
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
|
+
"version": "2.4.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",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"@atlaskit/icon": "^25.6.0",
|
|
34
34
|
"@atlaskit/layering": "^2.1.0",
|
|
35
35
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
36
|
-
"@atlaskit/primitives": "^14.
|
|
36
|
+
"@atlaskit/primitives": "^14.7.0",
|
|
37
37
|
"@atlaskit/spinner": "^18.0.0",
|
|
38
38
|
"@atlaskit/tokens": "^4.8.0",
|
|
39
39
|
"@babel/runtime": "^7.0.0",
|