@atlaskit/select 18.5.3 → 18.6.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 +20 -0
- package/dist/cjs/PopupSelect/PopupSelect.js +2 -3
- package/dist/cjs/Select.js +1 -1
- package/dist/cjs/components/input-options.js +55 -4
- package/dist/cjs/createSelect.js +3 -18
- package/dist/es2019/PopupSelect/PopupSelect.js +2 -3
- package/dist/es2019/Select.js +1 -1
- package/dist/es2019/components/input-options.js +48 -4
- package/dist/es2019/createSelect.js +1 -14
- package/dist/esm/PopupSelect/PopupSelect.js +2 -3
- package/dist/esm/Select.js +1 -1
- package/dist/esm/components/input-options.js +55 -4
- package/dist/esm/createSelect.js +3 -18
- package/package.json +11 -5
- package/dist/cjs/styles.js +0 -311
- package/dist/es2019/styles.js +0 -303
- package/dist/esm/styles.js +0 -304
- package/dist/types/styles.d.ts +0 -2
- package/dist/types-ts4.5/styles.d.ts +0 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @atlaskit/select
|
|
2
2
|
|
|
3
|
+
## 18.6.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#167336](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/167336)
|
|
8
|
+
[`ddb0846c39a88`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/ddb0846c39a88) -
|
|
9
|
+
Integrate styles of select and react-select in a single place
|
|
10
|
+
|
|
11
|
+
## 18.6.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- [#167480](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/167480)
|
|
16
|
+
[`e78013c5d716b`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/e78013c5d716b) -
|
|
17
|
+
Update checkbox and radio select to match new icon styles behind feature flag.
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- Updated dependencies
|
|
22
|
+
|
|
3
23
|
## 18.5.3
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
|
@@ -25,7 +25,6 @@ var _useId = require("@atlaskit/ds-lib/use-id");
|
|
|
25
25
|
var _reactSelect = require("@atlaskit/react-select");
|
|
26
26
|
var _colors = require("@atlaskit/theme/colors");
|
|
27
27
|
var _Select = _interopRequireDefault(require("../Select"));
|
|
28
|
-
var _styles = _interopRequireDefault(require("../styles"));
|
|
29
28
|
var _groupedOptionsAnnouncement = require("../utils/grouped-options-announcement");
|
|
30
29
|
var _components = require("./components");
|
|
31
30
|
var _excluded = ["footer", "label", "maxMenuWidth", "minMenuWidth", "placeholder", "target", "testId", "onMenuOpen", "onMenuClose"];
|
|
@@ -90,13 +89,13 @@ var PopupSelect = exports.default = /*#__PURE__*/function (_PureComponent) {
|
|
|
90
89
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "targetRef", null);
|
|
91
90
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "unbindWindowClick", null);
|
|
92
91
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "unbindWindowKeydown", null);
|
|
93
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "defaultStyles",
|
|
92
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "defaultStyles", {
|
|
94
93
|
groupHeading: function groupHeading(provided) {
|
|
95
94
|
return _objectSpread(_objectSpread({}, provided), {}, {
|
|
96
95
|
color: "var(--ds-text-subtlest, ".concat(_colors.N80, ")")
|
|
97
96
|
});
|
|
98
97
|
}
|
|
99
|
-
})
|
|
98
|
+
});
|
|
100
99
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "isOpenControlled", _this.props.isOpen !== undefined);
|
|
101
100
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "defaultOpenState", _this.isOpenControlled ? _this.props.isOpen : _this.props.defaultIsOpen);
|
|
102
101
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "state", {
|
package/dist/cjs/Select.js
CHANGED
|
@@ -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.
|
|
14
|
+
var packageVersion = "18.6.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)({
|
|
@@ -19,6 +19,8 @@ var _react = require("react");
|
|
|
19
19
|
var _react2 = require("@emotion/react");
|
|
20
20
|
var _checkbox = _interopRequireDefault(require("@atlaskit/icon/glyph/checkbox"));
|
|
21
21
|
var _radio = _interopRequireDefault(require("@atlaskit/icon/glyph/radio"));
|
|
22
|
+
var _svg = _interopRequireDefault(require("@atlaskit/icon/svg"));
|
|
23
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
22
24
|
var _colors = require("@atlaskit/theme/colors");
|
|
23
25
|
var _excluded = ["getStyles", "Icon", "children", "innerProps", "innerRef"];
|
|
24
26
|
function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = (0, _getPrototypeOf2.default)(t); if (r) { var s = (0, _getPrototypeOf2.default)(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return (0, _possibleConstructorReturn2.default)(this, e); }; }
|
|
@@ -238,15 +240,59 @@ var ControlOption = /*#__PURE__*/function (_Component) {
|
|
|
238
240
|
}]);
|
|
239
241
|
return ControlOption;
|
|
240
242
|
}(_react.Component);
|
|
243
|
+
var NewCheckboxIcon = function NewCheckboxIcon(props) {
|
|
244
|
+
return (
|
|
245
|
+
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
246
|
+
(0, _react2.jsx)(_svg.default, props, (0, _react2.jsx)("g", {
|
|
247
|
+
fillRule: "evenodd"
|
|
248
|
+
}, (0, _react2.jsx)("rect", {
|
|
249
|
+
x: "5.5",
|
|
250
|
+
y: "5.5",
|
|
251
|
+
width: "13",
|
|
252
|
+
height: "13",
|
|
253
|
+
rx: "1.5",
|
|
254
|
+
fill: "currentColor"
|
|
255
|
+
}), (0, _react2.jsx)("path", {
|
|
256
|
+
fillRule: "evenodd",
|
|
257
|
+
clipRule: "evenodd",
|
|
258
|
+
d: "M16.3262 9.48011L15.1738 8.51984L10.75 13.8284L8.82616 11.5198L7.67383 12.4801L10.1738 15.4801C10.3163 15.6511 10.5274 15.75 10.75 15.75C10.9726 15.75 11.1837 15.6511 11.3262 15.4801L16.3262 9.48011Z",
|
|
259
|
+
fill: "inherit"
|
|
260
|
+
})))
|
|
261
|
+
);
|
|
262
|
+
};
|
|
263
|
+
var NewRadioIcon = function NewRadioIcon(props) {
|
|
264
|
+
return (
|
|
265
|
+
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
266
|
+
(0, _react2.jsx)(_svg.default, props, (0, _react2.jsx)("g", {
|
|
267
|
+
fillRule: "evenodd"
|
|
268
|
+
}, (0, _react2.jsx)("circle", {
|
|
269
|
+
cx: "12",
|
|
270
|
+
cy: "12",
|
|
271
|
+
r: "6.75",
|
|
272
|
+
fill: "currentColor",
|
|
273
|
+
strokeWidth: "1.5"
|
|
274
|
+
}), (0, _react2.jsx)("circle", {
|
|
275
|
+
cx: "12",
|
|
276
|
+
cy: "12",
|
|
277
|
+
r: "3",
|
|
278
|
+
fill: "inherit"
|
|
279
|
+
})))
|
|
280
|
+
);
|
|
281
|
+
};
|
|
282
|
+
|
|
241
283
|
/**
|
|
242
284
|
* __Checkbox option__
|
|
243
285
|
*/
|
|
244
286
|
var CheckboxOption = exports.CheckboxOption = function CheckboxOption(props
|
|
245
|
-
//
|
|
246
|
-
// eslint-disable-next-line @atlaskit/design-system/no-legacy-icons, @repo/internal/react/no-unsafe-spread-props
|
|
287
|
+
// ): JSX.Element => <ControlOption<OptionT, true> Icon={CheckboxIcon} {...props} />;
|
|
247
288
|
) {
|
|
248
289
|
return (0, _react2.jsx)(ControlOption, (0, _extends2.default)({
|
|
249
|
-
Icon:
|
|
290
|
+
Icon:
|
|
291
|
+
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix, @atlaskit/platform/no-preconditioning
|
|
292
|
+
(0, _platformFeatureFlags.fg)('platform-visual-refresh-icons') && (0, _platformFeatureFlags.fg)('platform-icon-control-migration') ? NewCheckboxIcon :
|
|
293
|
+
// eslint-disable-next-line @atlaskit/design-system/no-legacy-icons
|
|
294
|
+
_checkbox.default
|
|
295
|
+
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
250
296
|
}, props));
|
|
251
297
|
};
|
|
252
298
|
|
|
@@ -258,7 +304,12 @@ var RadioOption = exports.RadioOption = function RadioOption(props) {
|
|
|
258
304
|
// TODO https://product-fabric.atlassian.net/browse/DSP-20769
|
|
259
305
|
// eslint-disable-next-line @atlaskit/design-system/no-legacy-icons, @repo/internal/react/no-unsafe-spread-props
|
|
260
306
|
(0, _react2.jsx)(ControlOption, (0, _extends2.default)({
|
|
261
|
-
Icon:
|
|
307
|
+
Icon:
|
|
308
|
+
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix, @atlaskit/platform/no-preconditioning
|
|
309
|
+
(0, _platformFeatureFlags.fg)('platform-visual-refresh-icons') && (0, _platformFeatureFlags.fg)('platform-icon-control-migration') ? NewRadioIcon :
|
|
310
|
+
// eslint-disable-next-line @atlaskit/design-system/no-legacy-icons
|
|
311
|
+
_radio.default
|
|
312
|
+
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
262
313
|
}, props))
|
|
263
314
|
);
|
|
264
315
|
};
|
package/dist/cjs/createSelect.js
CHANGED
|
@@ -10,29 +10,22 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
10
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
11
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
12
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
|
-
var _reactSelect = require("@atlaskit/react-select");
|
|
14
13
|
var _components = require("./components");
|
|
15
14
|
var _inputAriaDescribedby = require("./components/input-aria-describedby");
|
|
16
15
|
var _noOptions = require("./components/no-options");
|
|
17
|
-
var _styles = _interopRequireDefault(require("./styles"));
|
|
18
16
|
var _groupedOptionsAnnouncement = require("./utils/grouped-options-announcement");
|
|
19
|
-
var _excluded = ["
|
|
17
|
+
var _excluded = ["ariaLiveMessages", "components", "isInvalid", "onClickPreventDefault", "tabSelectsValue", "validationState"]; // eslint-disable-next-line @repo/internal/fs/filename-pattern-match
|
|
20
18
|
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); }
|
|
21
19
|
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; }
|
|
22
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; }
|
|
23
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; }
|
|
24
22
|
function createSelect(WrappedComponent) {
|
|
25
23
|
var AtlaskitSelect = /*#__PURE__*/(0, _react.forwardRef)(function AtlaskitSelect(props, forwardedRef) {
|
|
26
|
-
var
|
|
27
|
-
ariaLiveMessages = props.ariaLiveMessages,
|
|
24
|
+
var ariaLiveMessages = props.ariaLiveMessages,
|
|
28
25
|
componentsProp = props.components,
|
|
29
26
|
isInvalid = props.isInvalid,
|
|
30
27
|
_props$onClickPrevent = props.onClickPreventDefault,
|
|
31
28
|
onClickPreventDefault = _props$onClickPrevent === void 0 ? true : _props$onClickPrevent,
|
|
32
|
-
_props$spacing = props.spacing,
|
|
33
|
-
spacing = _props$spacing === void 0 ? 'default' : _props$spacing,
|
|
34
|
-
_props$styles = props.styles,
|
|
35
|
-
styles = _props$styles === void 0 ? {} : _props$styles,
|
|
36
29
|
_props$tabSelectsValu = props.tabSelectsValue,
|
|
37
30
|
tabSelectsValue = _props$tabSelectsValu === void 0 ? false : _props$tabSelectsValu,
|
|
38
31
|
_props$validationStat = props.validationState,
|
|
@@ -64,7 +57,6 @@ function createSelect(WrappedComponent) {
|
|
|
64
57
|
}
|
|
65
58
|
}
|
|
66
59
|
}, [descriptionId, isSearchable]);
|
|
67
|
-
var isCompact = spacing === 'compact';
|
|
68
60
|
|
|
69
61
|
/**
|
|
70
62
|
* The following `useImperativeHandle` hook exists for the sake of backwards compatibility.
|
|
@@ -96,16 +88,9 @@ function createSelect(WrappedComponent) {
|
|
|
96
88
|
}, ariaLiveMessages) : _objectSpread({}, ariaLiveMessages),
|
|
97
89
|
tabSelectsValue: tabSelectsValue,
|
|
98
90
|
onClickPreventDefault: onClickPreventDefault,
|
|
99
|
-
isInvalid: isInvalid
|
|
91
|
+
isInvalid: isInvalid || validationState === 'error'
|
|
100
92
|
}, restProps, {
|
|
101
93
|
components: components
|
|
102
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
103
|
-
,
|
|
104
|
-
styles: (0, _reactSelect.mergeStyles)(
|
|
105
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
106
|
-
(0, _styles.default)(
|
|
107
|
-
// This will cover both props for invalid state while giving priority to isInvalid. When cleaning up validationState, we can just keep the inner condition.
|
|
108
|
-
typeof isInvalid !== 'undefined' ? isInvalid ? 'error' : 'default' : validationState, isCompact, appearance || 'default'), styles)
|
|
109
94
|
// indicates react-select to be async by default using the base Select component
|
|
110
95
|
// so that makers can pass all async props on the base select to async load options.
|
|
111
96
|
,
|
|
@@ -11,7 +11,6 @@ import { IdProvider } from '@atlaskit/ds-lib/use-id';
|
|
|
11
11
|
import { mergeStyles } from '@atlaskit/react-select';
|
|
12
12
|
import { N80 } from '@atlaskit/theme/colors';
|
|
13
13
|
import Select from '../Select';
|
|
14
|
-
import baseStyles from '../styles';
|
|
15
14
|
import { countAllOptions, isOptionsGrouped, onFocus } from '../utils/grouped-options-announcement';
|
|
16
15
|
import { defaultComponents, DummyControl, MenuDialog } from './components';
|
|
17
16
|
/**
|
|
@@ -58,12 +57,12 @@ export default class PopupSelect extends PureComponent {
|
|
|
58
57
|
_defineProperty(this, "targetRef", null);
|
|
59
58
|
_defineProperty(this, "unbindWindowClick", null);
|
|
60
59
|
_defineProperty(this, "unbindWindowKeydown", null);
|
|
61
|
-
_defineProperty(this, "defaultStyles",
|
|
60
|
+
_defineProperty(this, "defaultStyles", {
|
|
62
61
|
groupHeading: provided => ({
|
|
63
62
|
...provided,
|
|
64
63
|
color: `var(--ds-text-subtlest, ${N80})`
|
|
65
64
|
})
|
|
66
|
-
})
|
|
65
|
+
});
|
|
67
66
|
_defineProperty(this, "isOpenControlled", this.props.isOpen !== undefined);
|
|
68
67
|
_defineProperty(this, "defaultOpenState", this.isOpenControlled ? this.props.isOpen : this.props.defaultIsOpen);
|
|
69
68
|
_defineProperty(this, "state", {
|
package/dist/es2019/Select.js
CHANGED
|
@@ -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.
|
|
6
|
+
const packageVersion = "18.6.1";
|
|
7
7
|
export const SelectWithoutAnalytics = createSelect(AsyncSelect);
|
|
8
8
|
const createAndFireEventOnAtlaskit = createAndFireEvent('atlaskit');
|
|
9
9
|
const Select = withAnalyticsContext({
|
|
@@ -9,6 +9,8 @@ import { Component } from 'react';
|
|
|
9
9
|
import { css, jsx } from '@emotion/react';
|
|
10
10
|
import CheckboxIcon from '@atlaskit/icon/glyph/checkbox';
|
|
11
11
|
import RadioIcon from '@atlaskit/icon/glyph/radio';
|
|
12
|
+
import PrimitiveSVGIcon from '@atlaskit/icon/svg';
|
|
13
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
12
14
|
import { B300, B400, B75, N0, N100, N20, N20A, N30, N70 } from '@atlaskit/theme/colors';
|
|
13
15
|
const getPrimitiveStyles = props => {
|
|
14
16
|
const {
|
|
@@ -221,15 +223,52 @@ class ControlOption extends Component {
|
|
|
221
223
|
);
|
|
222
224
|
}
|
|
223
225
|
}
|
|
226
|
+
const NewCheckboxIcon = props =>
|
|
227
|
+
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
228
|
+
jsx(PrimitiveSVGIcon, props, jsx("g", {
|
|
229
|
+
fillRule: "evenodd"
|
|
230
|
+
}, jsx("rect", {
|
|
231
|
+
x: "5.5",
|
|
232
|
+
y: "5.5",
|
|
233
|
+
width: "13",
|
|
234
|
+
height: "13",
|
|
235
|
+
rx: "1.5",
|
|
236
|
+
fill: "currentColor"
|
|
237
|
+
}), jsx("path", {
|
|
238
|
+
fillRule: "evenodd",
|
|
239
|
+
clipRule: "evenodd",
|
|
240
|
+
d: "M16.3262 9.48011L15.1738 8.51984L10.75 13.8284L8.82616 11.5198L7.67383 12.4801L10.1738 15.4801C10.3163 15.6511 10.5274 15.75 10.75 15.75C10.9726 15.75 11.1837 15.6511 11.3262 15.4801L16.3262 9.48011Z",
|
|
241
|
+
fill: "inherit"
|
|
242
|
+
})));
|
|
243
|
+
const NewRadioIcon = props =>
|
|
244
|
+
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
245
|
+
jsx(PrimitiveSVGIcon, props, jsx("g", {
|
|
246
|
+
fillRule: "evenodd"
|
|
247
|
+
}, jsx("circle", {
|
|
248
|
+
cx: "12",
|
|
249
|
+
cy: "12",
|
|
250
|
+
r: "6.75",
|
|
251
|
+
fill: "currentColor",
|
|
252
|
+
strokeWidth: "1.5"
|
|
253
|
+
}), jsx("circle", {
|
|
254
|
+
cx: "12",
|
|
255
|
+
cy: "12",
|
|
256
|
+
r: "3",
|
|
257
|
+
fill: "inherit"
|
|
258
|
+
})));
|
|
224
259
|
|
|
225
260
|
/**
|
|
226
261
|
* __Checkbox option__
|
|
227
262
|
*/
|
|
228
263
|
export const CheckboxOption = (props
|
|
229
|
-
//
|
|
230
|
-
// eslint-disable-next-line @atlaskit/design-system/no-legacy-icons, @repo/internal/react/no-unsafe-spread-props
|
|
264
|
+
// ): JSX.Element => <ControlOption<OptionT, true> Icon={CheckboxIcon} {...props} />;
|
|
231
265
|
) => jsx(ControlOption, _extends({
|
|
232
|
-
Icon:
|
|
266
|
+
Icon:
|
|
267
|
+
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix, @atlaskit/platform/no-preconditioning
|
|
268
|
+
fg('platform-visual-refresh-icons') && fg('platform-icon-control-migration') ? NewCheckboxIcon :
|
|
269
|
+
// eslint-disable-next-line @atlaskit/design-system/no-legacy-icons
|
|
270
|
+
CheckboxIcon
|
|
271
|
+
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
233
272
|
}, props));
|
|
234
273
|
|
|
235
274
|
/**
|
|
@@ -239,5 +278,10 @@ export const RadioOption = props =>
|
|
|
239
278
|
// TODO https://product-fabric.atlassian.net/browse/DSP-20769
|
|
240
279
|
// eslint-disable-next-line @atlaskit/design-system/no-legacy-icons, @repo/internal/react/no-unsafe-spread-props
|
|
241
280
|
jsx(ControlOption, _extends({
|
|
242
|
-
Icon:
|
|
281
|
+
Icon:
|
|
282
|
+
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix, @atlaskit/platform/no-preconditioning
|
|
283
|
+
fg('platform-visual-refresh-icons') && fg('platform-icon-control-migration') ? NewRadioIcon :
|
|
284
|
+
// eslint-disable-next-line @atlaskit/design-system/no-legacy-icons
|
|
285
|
+
RadioIcon
|
|
286
|
+
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
243
287
|
}, props));
|
|
@@ -1,23 +1,18 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
// eslint-disable-next-line @repo/internal/fs/filename-pattern-match
|
|
3
3
|
import React, { forwardRef, useEffect, useImperativeHandle, useMemo, useRef } from 'react';
|
|
4
|
-
import { mergeStyles } from '@atlaskit/react-select';
|
|
5
4
|
import { ClearIndicator, DropdownIndicator, IndicatorSeparator, LoadingIndicator, MultiValueRemove } from './components';
|
|
6
5
|
import { Input } from './components/input-aria-describedby';
|
|
7
6
|
import { NoOptionsMessage } from './components/no-options';
|
|
8
|
-
import baseStyles from './styles';
|
|
9
7
|
import { isOptionsGrouped, onFocus } from './utils/grouped-options-announcement';
|
|
10
8
|
export default function createSelect(WrappedComponent) {
|
|
11
9
|
const AtlaskitSelect = /*#__PURE__*/forwardRef(function AtlaskitSelect(props, forwardedRef) {
|
|
12
10
|
const {
|
|
13
|
-
appearance,
|
|
14
11
|
ariaLiveMessages,
|
|
15
12
|
components: componentsProp,
|
|
16
13
|
isInvalid,
|
|
17
14
|
// TODO: set to true when cleaning up validationState prop so it has a default value
|
|
18
15
|
onClickPreventDefault = true,
|
|
19
|
-
spacing = 'default',
|
|
20
|
-
styles = {},
|
|
21
16
|
tabSelectsValue = false,
|
|
22
17
|
validationState = 'default',
|
|
23
18
|
...restProps
|
|
@@ -47,7 +42,6 @@ export default function createSelect(WrappedComponent) {
|
|
|
47
42
|
}
|
|
48
43
|
}
|
|
49
44
|
}, [descriptionId, isSearchable]);
|
|
50
|
-
const isCompact = spacing === 'compact';
|
|
51
45
|
|
|
52
46
|
/**
|
|
53
47
|
* The following `useImperativeHandle` hook exists for the sake of backwards compatibility.
|
|
@@ -78,16 +72,9 @@ export default function createSelect(WrappedComponent) {
|
|
|
78
72
|
},
|
|
79
73
|
tabSelectsValue: tabSelectsValue,
|
|
80
74
|
onClickPreventDefault: onClickPreventDefault,
|
|
81
|
-
isInvalid: isInvalid
|
|
75
|
+
isInvalid: isInvalid || validationState === 'error'
|
|
82
76
|
}, restProps, {
|
|
83
77
|
components: components
|
|
84
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
85
|
-
,
|
|
86
|
-
styles: mergeStyles(
|
|
87
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
88
|
-
baseStyles(
|
|
89
|
-
// This will cover both props for invalid state while giving priority to isInvalid. When cleaning up validationState, we can just keep the inner condition.
|
|
90
|
-
typeof isInvalid !== 'undefined' ? isInvalid ? 'error' : 'default' : validationState, isCompact, appearance || 'default'), styles)
|
|
91
78
|
// indicates react-select to be async by default using the base Select component
|
|
92
79
|
// so that makers can pass all async props on the base select to async load options.
|
|
93
80
|
,
|
|
@@ -23,7 +23,6 @@ import { IdProvider } from '@atlaskit/ds-lib/use-id';
|
|
|
23
23
|
import { mergeStyles } from '@atlaskit/react-select';
|
|
24
24
|
import { N80 } from '@atlaskit/theme/colors';
|
|
25
25
|
import Select from '../Select';
|
|
26
|
-
import baseStyles from '../styles';
|
|
27
26
|
import { countAllOptions, isOptionsGrouped, onFocus } from '../utils/grouped-options-announcement';
|
|
28
27
|
import { defaultComponents, DummyControl, MenuDialog } from './components';
|
|
29
28
|
/**
|
|
@@ -81,13 +80,13 @@ var PopupSelect = /*#__PURE__*/function (_PureComponent) {
|
|
|
81
80
|
_defineProperty(_assertThisInitialized(_this), "targetRef", null);
|
|
82
81
|
_defineProperty(_assertThisInitialized(_this), "unbindWindowClick", null);
|
|
83
82
|
_defineProperty(_assertThisInitialized(_this), "unbindWindowKeydown", null);
|
|
84
|
-
_defineProperty(_assertThisInitialized(_this), "defaultStyles",
|
|
83
|
+
_defineProperty(_assertThisInitialized(_this), "defaultStyles", {
|
|
85
84
|
groupHeading: function groupHeading(provided) {
|
|
86
85
|
return _objectSpread(_objectSpread({}, provided), {}, {
|
|
87
86
|
color: "var(--ds-text-subtlest, ".concat(N80, ")")
|
|
88
87
|
});
|
|
89
88
|
}
|
|
90
|
-
})
|
|
89
|
+
});
|
|
91
90
|
_defineProperty(_assertThisInitialized(_this), "isOpenControlled", _this.props.isOpen !== undefined);
|
|
92
91
|
_defineProperty(_assertThisInitialized(_this), "defaultOpenState", _this.isOpenControlled ? _this.props.isOpen : _this.props.defaultIsOpen);
|
|
93
92
|
_defineProperty(_assertThisInitialized(_this), "state", {
|
package/dist/esm/Select.js
CHANGED
|
@@ -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.
|
|
6
|
+
var packageVersion = "18.6.1";
|
|
7
7
|
export var SelectWithoutAnalytics = createSelect(AsyncSelect);
|
|
8
8
|
var createAndFireEventOnAtlaskit = createAndFireEvent('atlaskit');
|
|
9
9
|
var Select = withAnalyticsContext({
|
|
@@ -22,6 +22,8 @@ import { Component } from 'react';
|
|
|
22
22
|
import { css, jsx } from '@emotion/react';
|
|
23
23
|
import CheckboxIcon from '@atlaskit/icon/glyph/checkbox';
|
|
24
24
|
import RadioIcon from '@atlaskit/icon/glyph/radio';
|
|
25
|
+
import PrimitiveSVGIcon from '@atlaskit/icon/svg';
|
|
26
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
25
27
|
import { B300, B400, B75, N0, N100, N20, N20A, N30, N70 } from '@atlaskit/theme/colors';
|
|
26
28
|
var getPrimitiveStyles = function getPrimitiveStyles(props) {
|
|
27
29
|
var cx = props.cx,
|
|
@@ -233,15 +235,59 @@ var ControlOption = /*#__PURE__*/function (_Component) {
|
|
|
233
235
|
}]);
|
|
234
236
|
return ControlOption;
|
|
235
237
|
}(Component);
|
|
238
|
+
var NewCheckboxIcon = function NewCheckboxIcon(props) {
|
|
239
|
+
return (
|
|
240
|
+
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
241
|
+
jsx(PrimitiveSVGIcon, props, jsx("g", {
|
|
242
|
+
fillRule: "evenodd"
|
|
243
|
+
}, jsx("rect", {
|
|
244
|
+
x: "5.5",
|
|
245
|
+
y: "5.5",
|
|
246
|
+
width: "13",
|
|
247
|
+
height: "13",
|
|
248
|
+
rx: "1.5",
|
|
249
|
+
fill: "currentColor"
|
|
250
|
+
}), jsx("path", {
|
|
251
|
+
fillRule: "evenodd",
|
|
252
|
+
clipRule: "evenodd",
|
|
253
|
+
d: "M16.3262 9.48011L15.1738 8.51984L10.75 13.8284L8.82616 11.5198L7.67383 12.4801L10.1738 15.4801C10.3163 15.6511 10.5274 15.75 10.75 15.75C10.9726 15.75 11.1837 15.6511 11.3262 15.4801L16.3262 9.48011Z",
|
|
254
|
+
fill: "inherit"
|
|
255
|
+
})))
|
|
256
|
+
);
|
|
257
|
+
};
|
|
258
|
+
var NewRadioIcon = function NewRadioIcon(props) {
|
|
259
|
+
return (
|
|
260
|
+
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
261
|
+
jsx(PrimitiveSVGIcon, props, jsx("g", {
|
|
262
|
+
fillRule: "evenodd"
|
|
263
|
+
}, jsx("circle", {
|
|
264
|
+
cx: "12",
|
|
265
|
+
cy: "12",
|
|
266
|
+
r: "6.75",
|
|
267
|
+
fill: "currentColor",
|
|
268
|
+
strokeWidth: "1.5"
|
|
269
|
+
}), jsx("circle", {
|
|
270
|
+
cx: "12",
|
|
271
|
+
cy: "12",
|
|
272
|
+
r: "3",
|
|
273
|
+
fill: "inherit"
|
|
274
|
+
})))
|
|
275
|
+
);
|
|
276
|
+
};
|
|
277
|
+
|
|
236
278
|
/**
|
|
237
279
|
* __Checkbox option__
|
|
238
280
|
*/
|
|
239
281
|
export var CheckboxOption = function CheckboxOption(props
|
|
240
|
-
//
|
|
241
|
-
// eslint-disable-next-line @atlaskit/design-system/no-legacy-icons, @repo/internal/react/no-unsafe-spread-props
|
|
282
|
+
// ): JSX.Element => <ControlOption<OptionT, true> Icon={CheckboxIcon} {...props} />;
|
|
242
283
|
) {
|
|
243
284
|
return jsx(ControlOption, _extends({
|
|
244
|
-
Icon:
|
|
285
|
+
Icon:
|
|
286
|
+
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix, @atlaskit/platform/no-preconditioning
|
|
287
|
+
fg('platform-visual-refresh-icons') && fg('platform-icon-control-migration') ? NewCheckboxIcon :
|
|
288
|
+
// eslint-disable-next-line @atlaskit/design-system/no-legacy-icons
|
|
289
|
+
CheckboxIcon
|
|
290
|
+
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
245
291
|
}, props));
|
|
246
292
|
};
|
|
247
293
|
|
|
@@ -253,7 +299,12 @@ export var RadioOption = function RadioOption(props) {
|
|
|
253
299
|
// TODO https://product-fabric.atlassian.net/browse/DSP-20769
|
|
254
300
|
// eslint-disable-next-line @atlaskit/design-system/no-legacy-icons, @repo/internal/react/no-unsafe-spread-props
|
|
255
301
|
jsx(ControlOption, _extends({
|
|
256
|
-
Icon:
|
|
302
|
+
Icon:
|
|
303
|
+
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix, @atlaskit/platform/no-preconditioning
|
|
304
|
+
fg('platform-visual-refresh-icons') && fg('platform-icon-control-migration') ? NewRadioIcon :
|
|
305
|
+
// eslint-disable-next-line @atlaskit/design-system/no-legacy-icons
|
|
306
|
+
RadioIcon
|
|
307
|
+
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
257
308
|
}, props))
|
|
258
309
|
);
|
|
259
310
|
};
|
package/dist/esm/createSelect.js
CHANGED
|
@@ -1,29 +1,22 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["
|
|
4
|
+
var _excluded = ["ariaLiveMessages", "components", "isInvalid", "onClickPreventDefault", "tabSelectsValue", "validationState"];
|
|
5
5
|
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; }
|
|
6
6
|
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; }
|
|
7
7
|
// eslint-disable-next-line @repo/internal/fs/filename-pattern-match
|
|
8
8
|
import React, { forwardRef, useEffect, useImperativeHandle, useMemo, useRef } from 'react';
|
|
9
|
-
import { mergeStyles } from '@atlaskit/react-select';
|
|
10
9
|
import { ClearIndicator, DropdownIndicator, IndicatorSeparator, LoadingIndicator, MultiValueRemove } from './components';
|
|
11
10
|
import { Input } from './components/input-aria-describedby';
|
|
12
11
|
import { NoOptionsMessage } from './components/no-options';
|
|
13
|
-
import baseStyles from './styles';
|
|
14
12
|
import { isOptionsGrouped, onFocus as _onFocus } from './utils/grouped-options-announcement';
|
|
15
13
|
export default function createSelect(WrappedComponent) {
|
|
16
14
|
var AtlaskitSelect = /*#__PURE__*/forwardRef(function AtlaskitSelect(props, forwardedRef) {
|
|
17
|
-
var
|
|
18
|
-
ariaLiveMessages = props.ariaLiveMessages,
|
|
15
|
+
var ariaLiveMessages = props.ariaLiveMessages,
|
|
19
16
|
componentsProp = props.components,
|
|
20
17
|
isInvalid = props.isInvalid,
|
|
21
18
|
_props$onClickPrevent = props.onClickPreventDefault,
|
|
22
19
|
onClickPreventDefault = _props$onClickPrevent === void 0 ? true : _props$onClickPrevent,
|
|
23
|
-
_props$spacing = props.spacing,
|
|
24
|
-
spacing = _props$spacing === void 0 ? 'default' : _props$spacing,
|
|
25
|
-
_props$styles = props.styles,
|
|
26
|
-
styles = _props$styles === void 0 ? {} : _props$styles,
|
|
27
20
|
_props$tabSelectsValu = props.tabSelectsValue,
|
|
28
21
|
tabSelectsValue = _props$tabSelectsValu === void 0 ? false : _props$tabSelectsValu,
|
|
29
22
|
_props$validationStat = props.validationState,
|
|
@@ -55,7 +48,6 @@ export default function createSelect(WrappedComponent) {
|
|
|
55
48
|
}
|
|
56
49
|
}
|
|
57
50
|
}, [descriptionId, isSearchable]);
|
|
58
|
-
var isCompact = spacing === 'compact';
|
|
59
51
|
|
|
60
52
|
/**
|
|
61
53
|
* The following `useImperativeHandle` hook exists for the sake of backwards compatibility.
|
|
@@ -87,16 +79,9 @@ export default function createSelect(WrappedComponent) {
|
|
|
87
79
|
}, ariaLiveMessages) : _objectSpread({}, ariaLiveMessages),
|
|
88
80
|
tabSelectsValue: tabSelectsValue,
|
|
89
81
|
onClickPreventDefault: onClickPreventDefault,
|
|
90
|
-
isInvalid: isInvalid
|
|
82
|
+
isInvalid: isInvalid || validationState === 'error'
|
|
91
83
|
}, restProps, {
|
|
92
84
|
components: components
|
|
93
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
94
|
-
,
|
|
95
|
-
styles: mergeStyles(
|
|
96
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
97
|
-
baseStyles(
|
|
98
|
-
// This will cover both props for invalid state while giving priority to isInvalid. When cleaning up validationState, we can just keep the inner condition.
|
|
99
|
-
typeof isInvalid !== 'undefined' ? isInvalid ? 'error' : 'default' : validationState, isCompact, appearance || 'default'), styles)
|
|
100
85
|
// indicates react-select to be async by default using the base Select component
|
|
101
86
|
// so that makers can pass all async props on the base select to async load options.
|
|
102
87
|
,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/select",
|
|
3
|
-
"version": "18.
|
|
3
|
+
"version": "18.6.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/"
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"team": "Design System Team",
|
|
29
29
|
"website": {
|
|
30
30
|
"name": "Select",
|
|
31
|
-
"category": "
|
|
31
|
+
"category": "Forms and input"
|
|
32
32
|
},
|
|
33
33
|
"runReact18": true
|
|
34
34
|
},
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@atlaskit/analytics-next": "^10.1.0",
|
|
44
44
|
"@atlaskit/ds-lib": "^3.2.0",
|
|
45
|
-
"@atlaskit/icon": "^22.
|
|
45
|
+
"@atlaskit/icon": "^22.26.0",
|
|
46
46
|
"@atlaskit/platform-feature-flags": "^0.3.0",
|
|
47
47
|
"@atlaskit/primitives": "^13.2.0",
|
|
48
48
|
"@atlaskit/react-select": "^1.4.0",
|
|
@@ -67,9 +67,9 @@
|
|
|
67
67
|
"@af/accessibility-testing": "*",
|
|
68
68
|
"@af/integration-testing": "*",
|
|
69
69
|
"@af/visual-regression": "*",
|
|
70
|
-
"@atlaskit/checkbox": "^15.
|
|
70
|
+
"@atlaskit/checkbox": "^15.2.0",
|
|
71
71
|
"@atlaskit/modal-dialog": "^12.17.0",
|
|
72
|
-
"@atlaskit/radio": "^6.
|
|
72
|
+
"@atlaskit/radio": "^6.6.0",
|
|
73
73
|
"@atlaskit/ssr": "*",
|
|
74
74
|
"@atlaskit/visual-regression": "*",
|
|
75
75
|
"@atlassian/feature-flags-test-utils": "*",
|
|
@@ -108,6 +108,12 @@
|
|
|
108
108
|
"design_system_select-a11y-improvement": {
|
|
109
109
|
"type": "boolean",
|
|
110
110
|
"referenceOnly": true
|
|
111
|
+
},
|
|
112
|
+
"platform-visual-refresh-icons": {
|
|
113
|
+
"type": "boolean"
|
|
114
|
+
},
|
|
115
|
+
"platform-icon-control-migration": {
|
|
116
|
+
"type": "boolean"
|
|
111
117
|
}
|
|
112
118
|
},
|
|
113
119
|
"homepage": "https://atlassian.design/components/select/"
|