@atlaskit/select 17.0.2 → 17.0.3
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 +6 -0
- package/dist/cjs/CountrySelect.js +7 -5
- package/dist/cjs/PopupSelect/components.js +8 -7
- package/dist/cjs/Select.js +1 -1
- package/dist/cjs/components/index.js +4 -2
- package/dist/cjs/components/indicators.js +7 -8
- package/dist/cjs/components/input-options.js +7 -8
- package/dist/es2019/CountrySelect.js +8 -6
- package/dist/es2019/PopupSelect/components.js +10 -8
- package/dist/es2019/Select.js +1 -1
- package/dist/es2019/components/index.js +4 -3
- package/dist/es2019/components/indicators.js +8 -8
- package/dist/es2019/components/input-options.js +8 -8
- package/dist/esm/CountrySelect.js +8 -6
- package/dist/esm/PopupSelect/components.js +10 -8
- package/dist/esm/Select.js +1 -1
- package/dist/esm/components/index.js +4 -3
- package/dist/esm/components/indicators.js +8 -8
- package/dist/esm/components/input-options.js +8 -8
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @atlaskit/select
|
|
2
2
|
|
|
3
|
+
## 17.0.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#59147](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/59147) [`f12e489f23b0`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/f12e489f23b0) - Re-build and deploy packages to NPM to resolve React/Compiled not found error (HOT-106483).
|
|
8
|
+
|
|
3
9
|
## 17.0.2
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -9,6 +9,8 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
9
9
|
var _react = require("@emotion/react");
|
|
10
10
|
var _countries = require("./data/countries");
|
|
11
11
|
var _Select = _interopRequireDefault(require("./Select"));
|
|
12
|
+
/** @jsx jsx */
|
|
13
|
+
|
|
12
14
|
// custom option renderer
|
|
13
15
|
var labelStyles = (0, _react.css)({
|
|
14
16
|
alignItems: 'center',
|
|
@@ -22,9 +24,9 @@ var flagStyles = (0, _react.css)({
|
|
|
22
24
|
var Opt = function Opt(_ref) {
|
|
23
25
|
var children = _ref.children,
|
|
24
26
|
icon = _ref.icon;
|
|
25
|
-
return
|
|
27
|
+
return (0, _react.jsx)("div", {
|
|
26
28
|
css: labelStyles
|
|
27
|
-
},
|
|
29
|
+
}, (0, _react.jsx)("span", {
|
|
28
30
|
css: flagStyles
|
|
29
31
|
}, icon), children);
|
|
30
32
|
};
|
|
@@ -44,7 +46,7 @@ var getOptionValue = function getOptionValue(opt) {
|
|
|
44
46
|
|
|
45
47
|
// the text node of the control
|
|
46
48
|
var controlLabel = function controlLabel(opt) {
|
|
47
|
-
return
|
|
49
|
+
return (0, _react.jsx)(Opt, {
|
|
48
50
|
icon: opt.icon
|
|
49
51
|
}, opt.abbr.toUpperCase());
|
|
50
52
|
};
|
|
@@ -54,7 +56,7 @@ var optionLabel = function optionLabel(_ref3) {
|
|
|
54
56
|
code = _ref3.code,
|
|
55
57
|
icon = _ref3.icon,
|
|
56
58
|
name = _ref3.name;
|
|
57
|
-
return
|
|
59
|
+
return (0, _react.jsx)(Opt, {
|
|
58
60
|
icon: icon
|
|
59
61
|
}, getOptionLabel({
|
|
60
62
|
abbr: abbr,
|
|
@@ -71,7 +73,7 @@ var formatOptionLabel = function formatOptionLabel(opt, _ref4) {
|
|
|
71
73
|
|
|
72
74
|
// put it all together
|
|
73
75
|
var CountrySelect = function CountrySelect(props) {
|
|
74
|
-
return
|
|
76
|
+
return (0, _react.jsx)(_Select.default, (0, _extends2.default)({
|
|
75
77
|
isClearable: false,
|
|
76
78
|
formatOptionLabel: formatOptionLabel,
|
|
77
79
|
getOptionLabel: getOptionLabel,
|
|
@@ -14,6 +14,7 @@ var _search = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/search
|
|
|
14
14
|
var _constants = require("@atlaskit/theme/constants");
|
|
15
15
|
var _colors = require("@atlaskit/theme/colors");
|
|
16
16
|
var _excluded = ["innerRef", "innerProps"];
|
|
17
|
+
/** @jsx jsx */
|
|
17
18
|
// ==============================
|
|
18
19
|
// Styled Components
|
|
19
20
|
// ==============================
|
|
@@ -30,7 +31,7 @@ var MenuDialog = exports.MenuDialog = function MenuDialog(_ref) {
|
|
|
30
31
|
id = _ref.id,
|
|
31
32
|
style = _ref.style,
|
|
32
33
|
testId = _ref.testId;
|
|
33
|
-
return
|
|
34
|
+
return (0, _react.jsx)("div", {
|
|
34
35
|
css: [menuDialogStyles,
|
|
35
36
|
// There is not a limited amount of values for the widths, so they need
|
|
36
37
|
// to remain dynamic.
|
|
@@ -55,9 +56,9 @@ var dropdownStyles = (0, _react.css)({
|
|
|
55
56
|
width: 32
|
|
56
57
|
});
|
|
57
58
|
var DropdownIndicator = function DropdownIndicator() {
|
|
58
|
-
return
|
|
59
|
+
return (0, _react.jsx)("div", {
|
|
59
60
|
css: dropdownStyles
|
|
60
|
-
},
|
|
61
|
+
}, (0, _react.jsx)(_search.default, {
|
|
61
62
|
label: "open"
|
|
62
63
|
}));
|
|
63
64
|
};
|
|
@@ -68,22 +69,22 @@ var Control = function Control(_ref2) {
|
|
|
68
69
|
var innerRef = _ref2.innerRef,
|
|
69
70
|
innerProps = _ref2.innerProps,
|
|
70
71
|
props = (0, _objectWithoutProperties2.default)(_ref2, _excluded);
|
|
71
|
-
return
|
|
72
|
+
return (0, _react.jsx)("div", {
|
|
72
73
|
ref: innerRef,
|
|
73
74
|
css: controlStyles
|
|
74
|
-
},
|
|
75
|
+
}, (0, _react.jsx)(_reactSelect.components.Control, (0, _extends2.default)({}, props, {
|
|
75
76
|
innerProps: innerProps
|
|
76
77
|
})));
|
|
77
78
|
};
|
|
78
79
|
var DummyControl = exports.DummyControl = function DummyControl(props) {
|
|
79
|
-
return
|
|
80
|
+
return (0, _react.jsx)(_visuallyHidden.default, null, (0, _react.jsx)(_reactSelect.components.Control, props));
|
|
80
81
|
};
|
|
81
82
|
|
|
82
83
|
// NOTE `props` intentionally omitted from `Fragment`
|
|
83
84
|
var Menu = function Menu(_ref3) {
|
|
84
85
|
var children = _ref3.children,
|
|
85
86
|
innerProps = _ref3.innerProps;
|
|
86
|
-
return
|
|
87
|
+
return (0, _react.jsx)("div", innerProps, children);
|
|
87
88
|
};
|
|
88
89
|
var defaultComponents = exports.defaultComponents = {
|
|
89
90
|
Control: Control,
|
package/dist/cjs/Select.js
CHANGED
|
@@ -9,7 +9,7 @@ var _reactSelect = _interopRequireDefault(require("react-select"));
|
|
|
9
9
|
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
10
10
|
var _createSelect = _interopRequireDefault(require("./createSelect"));
|
|
11
11
|
var packageName = "@atlaskit/select";
|
|
12
|
-
var packageVersion = "17.0.
|
|
12
|
+
var packageVersion = "17.0.3";
|
|
13
13
|
var SelectWithoutAnalytics = exports.SelectWithoutAnalytics = (0, _createSelect.default)(_reactSelect.default);
|
|
14
14
|
var createAndFireEventOnAtlaskit = (0, _analyticsNext.createAndFireEvent)('atlaskit');
|
|
15
15
|
var _default = exports.default = (0, _analyticsNext.withAnalyticsContext)({
|
|
@@ -28,6 +28,8 @@ var _react = require("@emotion/react");
|
|
|
28
28
|
var _selectClear = _interopRequireDefault(require("@atlaskit/icon/glyph/select-clear"));
|
|
29
29
|
var _reactSelect = require("react-select");
|
|
30
30
|
var _indicators = require("./indicators");
|
|
31
|
+
/** @jsx jsx */
|
|
32
|
+
|
|
31
33
|
var disabledStyles = (0, _react.css)({
|
|
32
34
|
display: 'none'
|
|
33
35
|
});
|
|
@@ -36,10 +38,10 @@ var enabledStyles = (0, _react.css)({
|
|
|
36
38
|
});
|
|
37
39
|
var MultiValueRemove = exports.MultiValueRemove = function MultiValueRemove(props) {
|
|
38
40
|
var isDisabled = props.selectProps.isDisabled;
|
|
39
|
-
return
|
|
41
|
+
return (0, _react.jsx)(_reactSelect.components.MultiValueRemove, props, (0, _react.jsx)("div", {
|
|
40
42
|
css: isDisabled ? disabledStyles : enabledStyles,
|
|
41
43
|
"data-testid": isDisabled ? 'hide-clear-icon' : 'show-clear-icon'
|
|
42
|
-
},
|
|
44
|
+
}, (0, _react.jsx)(_selectClear.default, {
|
|
43
45
|
label: "Clear",
|
|
44
46
|
size: "small",
|
|
45
47
|
primaryColor: "transparent",
|
|
@@ -13,7 +13,7 @@ var _spinner = _interopRequireDefault(require("@atlaskit/spinner"));
|
|
|
13
13
|
var _selectClear = _interopRequireDefault(require("@atlaskit/icon/glyph/select-clear"));
|
|
14
14
|
var _chevronDown = _interopRequireDefault(require("@atlaskit/icon/glyph/chevron-down"));
|
|
15
15
|
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; }
|
|
16
|
-
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; }
|
|
16
|
+
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; } /** @jsx jsx */
|
|
17
17
|
var iconContainerStyles = (0, _react.css)({
|
|
18
18
|
all: 'unset',
|
|
19
19
|
outline: 'revert',
|
|
@@ -21,34 +21,33 @@ var iconContainerStyles = (0, _react.css)({
|
|
|
21
21
|
alignItems: 'center'
|
|
22
22
|
});
|
|
23
23
|
var ClearIndicator = exports.ClearIndicator = function ClearIndicator(props) {
|
|
24
|
-
return
|
|
24
|
+
return (0, _react.jsx)(_reactSelect.components.ClearIndicator, _objectSpread(_objectSpread({}, props), {}, {
|
|
25
25
|
innerProps: _objectSpread(_objectSpread({}, props.innerProps), {}, {
|
|
26
26
|
'aria-hidden': 'false'
|
|
27
27
|
})
|
|
28
|
-
}),
|
|
28
|
+
}), (0, _react.jsx)("button", {
|
|
29
29
|
css: iconContainerStyles,
|
|
30
30
|
type: "button",
|
|
31
31
|
tabIndex: -1
|
|
32
|
-
},
|
|
32
|
+
}, (0, _react.jsx)(_selectClear.default, {
|
|
33
33
|
size: "small",
|
|
34
34
|
label: "clear"
|
|
35
35
|
})));
|
|
36
36
|
};
|
|
37
37
|
var DropdownIndicator = exports.DropdownIndicator = function DropdownIndicator(props) {
|
|
38
|
-
return
|
|
38
|
+
return (0, _react.jsx)(_reactSelect.components.DropdownIndicator, props, (0, _react.jsx)(_chevronDown.default, {
|
|
39
39
|
label: "open"
|
|
40
40
|
}));
|
|
41
41
|
};
|
|
42
42
|
var LoadingIndicator = exports.LoadingIndicator = function LoadingIndicator(props) {
|
|
43
43
|
var loadingStyles = (0, _react.css)(props.getStyles('loadingIndicator', props));
|
|
44
44
|
return (
|
|
45
|
-
/*#__PURE__*/
|
|
46
45
|
// This *must* be constructed this way because this is being consumed by
|
|
47
46
|
// `react-select` and we don't control what it wants.
|
|
48
47
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
49
|
-
|
|
48
|
+
(0, _react.jsx)("div", (0, _extends2.default)({
|
|
50
49
|
css: loadingStyles
|
|
51
|
-
}, props.innerProps),
|
|
50
|
+
}, props.innerProps), (0, _react.jsx)(_spinner.default, {
|
|
52
51
|
size: "small"
|
|
53
52
|
}))
|
|
54
53
|
);
|
|
@@ -25,7 +25,7 @@ var _excluded = ["getStyles", "Icon", "children", "innerProps", "innerRef"];
|
|
|
25
25
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
26
26
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
27
27
|
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; }
|
|
28
|
-
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; }
|
|
28
|
+
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; } /** @jsx jsx */
|
|
29
29
|
var getPrimitiveStyles = function getPrimitiveStyles(props) {
|
|
30
30
|
var cx = props.cx,
|
|
31
31
|
className = props.className,
|
|
@@ -201,15 +201,14 @@ var ControlOption = /*#__PURE__*/function (_Component) {
|
|
|
201
201
|
styles = _getPrimitiveStyles2[0],
|
|
202
202
|
classes = _getPrimitiveStyles2[1];
|
|
203
203
|
return (
|
|
204
|
-
/*#__PURE__*/
|
|
205
204
|
// These need to remain this way because `react-select` passes props with
|
|
206
205
|
// styles inside, and that must be done dynamically.
|
|
207
206
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
208
|
-
|
|
207
|
+
(0, _react.jsx)("div", (0, _extends2.default)({
|
|
209
208
|
css: styles,
|
|
210
209
|
className: classes,
|
|
211
210
|
ref: innerRef
|
|
212
|
-
}, props),
|
|
211
|
+
}, props), (0, _react.jsx)("div", {
|
|
213
212
|
css: [baseIconStyles,
|
|
214
213
|
// Here we are adding a border to the Checkbox and Radio SVG icons
|
|
215
214
|
// This is an a11y fix for Select only for now but it may be rolled
|
|
@@ -226,11 +225,11 @@ var ControlOption = /*#__PURE__*/function (_Component) {
|
|
|
226
225
|
stroke: getBorderColor(_objectSpread(_objectSpread({}, this.props), this.state))
|
|
227
226
|
}
|
|
228
227
|
}]
|
|
229
|
-
}, !!Icon ?
|
|
228
|
+
}, !!Icon ? (0, _react.jsx)(Icon, {
|
|
230
229
|
label: "",
|
|
231
230
|
primaryColor: getPrimaryColor(_objectSpread(_objectSpread({}, this.props), this.state)),
|
|
232
231
|
secondaryColor: getSecondaryColor(_objectSpread(_objectSpread({}, this.props), this.state))
|
|
233
|
-
}) : null),
|
|
232
|
+
}) : null), (0, _react.jsx)("div", {
|
|
234
233
|
css: baseOptionStyles
|
|
235
234
|
}, children))
|
|
236
235
|
);
|
|
@@ -239,12 +238,12 @@ var ControlOption = /*#__PURE__*/function (_Component) {
|
|
|
239
238
|
return ControlOption;
|
|
240
239
|
}(_react2.Component);
|
|
241
240
|
var CheckboxOption = exports.CheckboxOption = function CheckboxOption(props) {
|
|
242
|
-
return
|
|
241
|
+
return (0, _react.jsx)(ControlOption, (0, _extends2.default)({
|
|
243
242
|
Icon: _checkbox.default
|
|
244
243
|
}, props));
|
|
245
244
|
};
|
|
246
245
|
var RadioOption = exports.RadioOption = function RadioOption(props) {
|
|
247
|
-
return
|
|
246
|
+
return (0, _react.jsx)(ControlOption, (0, _extends2.default)({
|
|
248
247
|
Icon: _radio.default
|
|
249
248
|
}, props));
|
|
250
249
|
};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
|
|
2
|
+
/** @jsx jsx */
|
|
3
|
+
|
|
4
|
+
import { jsx, css } from '@emotion/react';
|
|
3
5
|
import { groupedCountries } from './data/countries';
|
|
4
6
|
import Select from './Select';
|
|
5
7
|
// custom option renderer
|
|
@@ -15,9 +17,9 @@ const flagStyles = css({
|
|
|
15
17
|
const Opt = ({
|
|
16
18
|
children,
|
|
17
19
|
icon
|
|
18
|
-
}) =>
|
|
20
|
+
}) => jsx("div", {
|
|
19
21
|
css: labelStyles
|
|
20
|
-
},
|
|
22
|
+
}, jsx("span", {
|
|
21
23
|
css: flagStyles
|
|
22
24
|
}, icon), children);
|
|
23
25
|
|
|
@@ -32,7 +34,7 @@ const getOptionLabel = ({
|
|
|
32
34
|
const getOptionValue = opt => opt.abbr;
|
|
33
35
|
|
|
34
36
|
// the text node of the control
|
|
35
|
-
const controlLabel = opt =>
|
|
37
|
+
const controlLabel = opt => jsx(Opt, {
|
|
36
38
|
icon: opt.icon
|
|
37
39
|
}, opt.abbr.toUpperCase());
|
|
38
40
|
// the text node for an option
|
|
@@ -41,7 +43,7 @@ const optionLabel = ({
|
|
|
41
43
|
code,
|
|
42
44
|
icon,
|
|
43
45
|
name
|
|
44
|
-
}) =>
|
|
46
|
+
}) => jsx(Opt, {
|
|
45
47
|
icon: icon
|
|
46
48
|
}, getOptionLabel({
|
|
47
49
|
abbr,
|
|
@@ -55,7 +57,7 @@ const formatOptionLabel = (opt, {
|
|
|
55
57
|
}) => context === 'value' ? controlLabel(opt) : optionLabel(opt);
|
|
56
58
|
|
|
57
59
|
// put it all together
|
|
58
|
-
const CountrySelect = props =>
|
|
60
|
+
const CountrySelect = props => jsx(Select, _extends({
|
|
59
61
|
isClearable: false,
|
|
60
62
|
formatOptionLabel: formatOptionLabel,
|
|
61
63
|
getOptionLabel: getOptionLabel,
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
/** @jsx jsx */
|
|
3
|
+
|
|
2
4
|
import { components } from 'react-select';
|
|
3
|
-
import { css } from '@emotion/react';
|
|
5
|
+
import { css, jsx } from '@emotion/react';
|
|
4
6
|
import VisuallyHidden from '@atlaskit/visually-hidden';
|
|
5
7
|
import SearchIcon from '@atlaskit/icon/glyph/editor/search';
|
|
6
8
|
import { layers } from '@atlaskit/theme/constants';
|
|
@@ -22,7 +24,7 @@ export const MenuDialog = ({
|
|
|
22
24
|
id,
|
|
23
25
|
style,
|
|
24
26
|
testId
|
|
25
|
-
}) =>
|
|
27
|
+
}) => jsx("div", {
|
|
26
28
|
css: [menuDialogStyles,
|
|
27
29
|
// There is not a limited amount of values for the widths, so they need
|
|
28
30
|
// to remain dynamic.
|
|
@@ -45,9 +47,9 @@ const dropdownStyles = css({
|
|
|
45
47
|
textAlign: 'center',
|
|
46
48
|
width: 32
|
|
47
49
|
});
|
|
48
|
-
const DropdownIndicator = () =>
|
|
50
|
+
const DropdownIndicator = () => jsx("div", {
|
|
49
51
|
css: dropdownStyles
|
|
50
|
-
},
|
|
52
|
+
}, jsx(SearchIcon, {
|
|
51
53
|
label: "open"
|
|
52
54
|
}));
|
|
53
55
|
const controlStyles = css({
|
|
@@ -57,19 +59,19 @@ const Control = ({
|
|
|
57
59
|
innerRef,
|
|
58
60
|
innerProps,
|
|
59
61
|
...props
|
|
60
|
-
}) =>
|
|
62
|
+
}) => jsx("div", {
|
|
61
63
|
ref: innerRef,
|
|
62
64
|
css: controlStyles
|
|
63
|
-
},
|
|
65
|
+
}, jsx(components.Control, _extends({}, props, {
|
|
64
66
|
innerProps: innerProps
|
|
65
67
|
})));
|
|
66
|
-
export const DummyControl = props =>
|
|
68
|
+
export const DummyControl = props => jsx(VisuallyHidden, null, jsx(components.Control, props));
|
|
67
69
|
|
|
68
70
|
// NOTE `props` intentionally omitted from `Fragment`
|
|
69
71
|
const Menu = ({
|
|
70
72
|
children,
|
|
71
73
|
innerProps
|
|
72
|
-
}) =>
|
|
74
|
+
}) => jsx("div", innerProps, children);
|
|
73
75
|
export const defaultComponents = {
|
|
74
76
|
Control,
|
|
75
77
|
DropdownIndicator,
|
package/dist/es2019/Select.js
CHANGED
|
@@ -2,7 +2,7 @@ import Select from 'react-select';
|
|
|
2
2
|
import { withAnalyticsEvents, withAnalyticsContext, createAndFireEvent } from '@atlaskit/analytics-next';
|
|
3
3
|
import createSelect from './createSelect';
|
|
4
4
|
const packageName = "@atlaskit/select";
|
|
5
|
-
const packageVersion = "17.0.
|
|
5
|
+
const packageVersion = "17.0.3";
|
|
6
6
|
export const SelectWithoutAnalytics = createSelect(Select);
|
|
7
7
|
const createAndFireEventOnAtlaskit = createAndFireEvent('atlaskit');
|
|
8
8
|
export default withAnalyticsContext({
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { jsx, css } from '@emotion/react';
|
|
2
3
|
import SelectClearIcon from '@atlaskit/icon/glyph/select-clear';
|
|
3
4
|
import { components } from 'react-select';
|
|
4
5
|
export { ClearIndicator, DropdownIndicator, LoadingIndicator } from './indicators';
|
|
@@ -12,10 +13,10 @@ export const MultiValueRemove = props => {
|
|
|
12
13
|
const {
|
|
13
14
|
isDisabled
|
|
14
15
|
} = props.selectProps;
|
|
15
|
-
return
|
|
16
|
+
return jsx(components.MultiValueRemove, props, jsx("div", {
|
|
16
17
|
css: isDisabled ? disabledStyles : enabledStyles,
|
|
17
18
|
"data-testid": isDisabled ? 'hide-clear-icon' : 'show-clear-icon'
|
|
18
|
-
},
|
|
19
|
+
}, jsx(SelectClearIcon, {
|
|
19
20
|
label: "Clear",
|
|
20
21
|
size: "small",
|
|
21
22
|
primaryColor: "transparent",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
|
|
2
|
+
/** @jsx jsx */
|
|
3
|
+
import { jsx, css } from '@emotion/react';
|
|
3
4
|
import { components } from 'react-select';
|
|
4
5
|
import Spinner from '@atlaskit/spinner';
|
|
5
6
|
import SelectClearIcon from '@atlaskit/icon/glyph/select-clear';
|
|
@@ -10,32 +11,31 @@ const iconContainerStyles = css({
|
|
|
10
11
|
display: 'flex',
|
|
11
12
|
alignItems: 'center'
|
|
12
13
|
});
|
|
13
|
-
export const ClearIndicator = props =>
|
|
14
|
+
export const ClearIndicator = props => jsx(components.ClearIndicator, _extends({}, props, {
|
|
14
15
|
innerProps: {
|
|
15
16
|
...props.innerProps,
|
|
16
17
|
'aria-hidden': 'false'
|
|
17
18
|
}
|
|
18
|
-
}),
|
|
19
|
+
}), jsx("button", {
|
|
19
20
|
css: iconContainerStyles,
|
|
20
21
|
type: "button",
|
|
21
22
|
tabIndex: -1
|
|
22
|
-
},
|
|
23
|
+
}, jsx(SelectClearIcon, {
|
|
23
24
|
size: "small",
|
|
24
25
|
label: "clear"
|
|
25
26
|
})));
|
|
26
|
-
export const DropdownIndicator = props =>
|
|
27
|
+
export const DropdownIndicator = props => jsx(components.DropdownIndicator, props, jsx(DownIcon, {
|
|
27
28
|
label: "open"
|
|
28
29
|
}));
|
|
29
30
|
export const LoadingIndicator = props => {
|
|
30
31
|
const loadingStyles = css(props.getStyles('loadingIndicator', props));
|
|
31
32
|
return (
|
|
32
|
-
/*#__PURE__*/
|
|
33
33
|
// This *must* be constructed this way because this is being consumed by
|
|
34
34
|
// `react-select` and we don't control what it wants.
|
|
35
35
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
36
|
-
|
|
36
|
+
jsx("div", _extends({
|
|
37
37
|
css: loadingStyles
|
|
38
|
-
}, props.innerProps),
|
|
38
|
+
}, props.innerProps), jsx(Spinner, {
|
|
39
39
|
size: "small"
|
|
40
40
|
}))
|
|
41
41
|
);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
-
|
|
3
|
+
/** @jsx jsx */
|
|
4
|
+
import { css, jsx } from '@emotion/react';
|
|
4
5
|
import { Component } from 'react';
|
|
5
6
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
6
7
|
import RadioIcon from '@atlaskit/icon/glyph/radio';
|
|
@@ -173,15 +174,14 @@ class ControlOption extends Component {
|
|
|
173
174
|
...rest
|
|
174
175
|
});
|
|
175
176
|
return (
|
|
176
|
-
/*#__PURE__*/
|
|
177
177
|
// These need to remain this way because `react-select` passes props with
|
|
178
178
|
// styles inside, and that must be done dynamically.
|
|
179
179
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
180
|
-
|
|
180
|
+
jsx("div", _extends({
|
|
181
181
|
css: styles,
|
|
182
182
|
className: classes,
|
|
183
183
|
ref: innerRef
|
|
184
|
-
}, props),
|
|
184
|
+
}, props), jsx("div", {
|
|
185
185
|
css: [baseIconStyles,
|
|
186
186
|
// Here we are adding a border to the Checkbox and Radio SVG icons
|
|
187
187
|
// This is an a11y fix for Select only for now but it may be rolled
|
|
@@ -201,7 +201,7 @@ class ControlOption extends Component {
|
|
|
201
201
|
})
|
|
202
202
|
}
|
|
203
203
|
}]
|
|
204
|
-
}, !!Icon ?
|
|
204
|
+
}, !!Icon ? jsx(Icon, {
|
|
205
205
|
label: "",
|
|
206
206
|
primaryColor: getPrimaryColor({
|
|
207
207
|
...this.props,
|
|
@@ -211,15 +211,15 @@ class ControlOption extends Component {
|
|
|
211
211
|
...this.props,
|
|
212
212
|
...this.state
|
|
213
213
|
})
|
|
214
|
-
}) : null),
|
|
214
|
+
}) : null), jsx("div", {
|
|
215
215
|
css: baseOptionStyles
|
|
216
216
|
}, children))
|
|
217
217
|
);
|
|
218
218
|
}
|
|
219
219
|
}
|
|
220
|
-
export const CheckboxOption = props =>
|
|
220
|
+
export const CheckboxOption = props => jsx(ControlOption, _extends({
|
|
221
221
|
Icon: CheckboxIcon
|
|
222
222
|
}, props));
|
|
223
|
-
export const RadioOption = props =>
|
|
223
|
+
export const RadioOption = props => jsx(ControlOption, _extends({
|
|
224
224
|
Icon: RadioIcon
|
|
225
225
|
}, props));
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
|
|
2
|
+
/** @jsx jsx */
|
|
3
|
+
|
|
4
|
+
import { jsx, css } from '@emotion/react';
|
|
3
5
|
import { groupedCountries } from './data/countries';
|
|
4
6
|
import Select from './Select';
|
|
5
7
|
// custom option renderer
|
|
@@ -15,9 +17,9 @@ var flagStyles = css({
|
|
|
15
17
|
var Opt = function Opt(_ref) {
|
|
16
18
|
var children = _ref.children,
|
|
17
19
|
icon = _ref.icon;
|
|
18
|
-
return
|
|
20
|
+
return jsx("div", {
|
|
19
21
|
css: labelStyles
|
|
20
|
-
},
|
|
22
|
+
}, jsx("span", {
|
|
21
23
|
css: flagStyles
|
|
22
24
|
}, icon), children);
|
|
23
25
|
};
|
|
@@ -37,7 +39,7 @@ var getOptionValue = function getOptionValue(opt) {
|
|
|
37
39
|
|
|
38
40
|
// the text node of the control
|
|
39
41
|
var controlLabel = function controlLabel(opt) {
|
|
40
|
-
return
|
|
42
|
+
return jsx(Opt, {
|
|
41
43
|
icon: opt.icon
|
|
42
44
|
}, opt.abbr.toUpperCase());
|
|
43
45
|
};
|
|
@@ -47,7 +49,7 @@ var optionLabel = function optionLabel(_ref3) {
|
|
|
47
49
|
code = _ref3.code,
|
|
48
50
|
icon = _ref3.icon,
|
|
49
51
|
name = _ref3.name;
|
|
50
|
-
return
|
|
52
|
+
return jsx(Opt, {
|
|
51
53
|
icon: icon
|
|
52
54
|
}, getOptionLabel({
|
|
53
55
|
abbr: abbr,
|
|
@@ -64,7 +66,7 @@ var formatOptionLabel = function formatOptionLabel(opt, _ref4) {
|
|
|
64
66
|
|
|
65
67
|
// put it all together
|
|
66
68
|
var CountrySelect = function CountrySelect(props) {
|
|
67
|
-
return
|
|
69
|
+
return jsx(Select, _extends({
|
|
68
70
|
isClearable: false,
|
|
69
71
|
formatOptionLabel: formatOptionLabel,
|
|
70
72
|
getOptionLabel: getOptionLabel,
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
var _excluded = ["innerRef", "innerProps"];
|
|
4
|
+
/** @jsx jsx */
|
|
5
|
+
|
|
4
6
|
import { components } from 'react-select';
|
|
5
|
-
import { css } from '@emotion/react';
|
|
7
|
+
import { css, jsx } from '@emotion/react';
|
|
6
8
|
import VisuallyHidden from '@atlaskit/visually-hidden';
|
|
7
9
|
import SearchIcon from '@atlaskit/icon/glyph/editor/search';
|
|
8
10
|
import { layers } from '@atlaskit/theme/constants';
|
|
@@ -24,7 +26,7 @@ export var MenuDialog = function MenuDialog(_ref) {
|
|
|
24
26
|
id = _ref.id,
|
|
25
27
|
style = _ref.style,
|
|
26
28
|
testId = _ref.testId;
|
|
27
|
-
return
|
|
29
|
+
return jsx("div", {
|
|
28
30
|
css: [menuDialogStyles,
|
|
29
31
|
// There is not a limited amount of values for the widths, so they need
|
|
30
32
|
// to remain dynamic.
|
|
@@ -49,9 +51,9 @@ var dropdownStyles = css({
|
|
|
49
51
|
width: 32
|
|
50
52
|
});
|
|
51
53
|
var DropdownIndicator = function DropdownIndicator() {
|
|
52
|
-
return
|
|
54
|
+
return jsx("div", {
|
|
53
55
|
css: dropdownStyles
|
|
54
|
-
},
|
|
56
|
+
}, jsx(SearchIcon, {
|
|
55
57
|
label: "open"
|
|
56
58
|
}));
|
|
57
59
|
};
|
|
@@ -62,22 +64,22 @@ var Control = function Control(_ref2) {
|
|
|
62
64
|
var innerRef = _ref2.innerRef,
|
|
63
65
|
innerProps = _ref2.innerProps,
|
|
64
66
|
props = _objectWithoutProperties(_ref2, _excluded);
|
|
65
|
-
return
|
|
67
|
+
return jsx("div", {
|
|
66
68
|
ref: innerRef,
|
|
67
69
|
css: controlStyles
|
|
68
|
-
},
|
|
70
|
+
}, jsx(components.Control, _extends({}, props, {
|
|
69
71
|
innerProps: innerProps
|
|
70
72
|
})));
|
|
71
73
|
};
|
|
72
74
|
export var DummyControl = function DummyControl(props) {
|
|
73
|
-
return
|
|
75
|
+
return jsx(VisuallyHidden, null, jsx(components.Control, props));
|
|
74
76
|
};
|
|
75
77
|
|
|
76
78
|
// NOTE `props` intentionally omitted from `Fragment`
|
|
77
79
|
var Menu = function Menu(_ref3) {
|
|
78
80
|
var children = _ref3.children,
|
|
79
81
|
innerProps = _ref3.innerProps;
|
|
80
|
-
return
|
|
82
|
+
return jsx("div", innerProps, children);
|
|
81
83
|
};
|
|
82
84
|
export var defaultComponents = {
|
|
83
85
|
Control: Control,
|
package/dist/esm/Select.js
CHANGED
|
@@ -2,7 +2,7 @@ import Select from 'react-select';
|
|
|
2
2
|
import { withAnalyticsEvents, withAnalyticsContext, createAndFireEvent } from '@atlaskit/analytics-next';
|
|
3
3
|
import createSelect from './createSelect';
|
|
4
4
|
var packageName = "@atlaskit/select";
|
|
5
|
-
var packageVersion = "17.0.
|
|
5
|
+
var packageVersion = "17.0.3";
|
|
6
6
|
export var SelectWithoutAnalytics = createSelect(Select);
|
|
7
7
|
var createAndFireEventOnAtlaskit = createAndFireEvent('atlaskit');
|
|
8
8
|
export default withAnalyticsContext({
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { jsx, css } from '@emotion/react';
|
|
2
3
|
import SelectClearIcon from '@atlaskit/icon/glyph/select-clear';
|
|
3
4
|
import { components } from 'react-select';
|
|
4
5
|
export { ClearIndicator, DropdownIndicator, LoadingIndicator } from './indicators';
|
|
@@ -10,10 +11,10 @@ var enabledStyles = css({
|
|
|
10
11
|
});
|
|
11
12
|
export var MultiValueRemove = function MultiValueRemove(props) {
|
|
12
13
|
var isDisabled = props.selectProps.isDisabled;
|
|
13
|
-
return
|
|
14
|
+
return jsx(components.MultiValueRemove, props, jsx("div", {
|
|
14
15
|
css: isDisabled ? disabledStyles : enabledStyles,
|
|
15
16
|
"data-testid": isDisabled ? 'hide-clear-icon' : 'show-clear-icon'
|
|
16
|
-
},
|
|
17
|
+
}, jsx(SelectClearIcon, {
|
|
17
18
|
label: "Clear",
|
|
18
19
|
size: "small",
|
|
19
20
|
primaryColor: "transparent",
|
|
@@ -2,7 +2,8 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
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; }
|
|
4
4
|
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; }
|
|
5
|
-
|
|
5
|
+
/** @jsx jsx */
|
|
6
|
+
import { jsx, css } from '@emotion/react';
|
|
6
7
|
import { components } from 'react-select';
|
|
7
8
|
import Spinner from '@atlaskit/spinner';
|
|
8
9
|
import SelectClearIcon from '@atlaskit/icon/glyph/select-clear';
|
|
@@ -14,34 +15,33 @@ var iconContainerStyles = css({
|
|
|
14
15
|
alignItems: 'center'
|
|
15
16
|
});
|
|
16
17
|
export var ClearIndicator = function ClearIndicator(props) {
|
|
17
|
-
return
|
|
18
|
+
return jsx(components.ClearIndicator, _objectSpread(_objectSpread({}, props), {}, {
|
|
18
19
|
innerProps: _objectSpread(_objectSpread({}, props.innerProps), {}, {
|
|
19
20
|
'aria-hidden': 'false'
|
|
20
21
|
})
|
|
21
|
-
}),
|
|
22
|
+
}), jsx("button", {
|
|
22
23
|
css: iconContainerStyles,
|
|
23
24
|
type: "button",
|
|
24
25
|
tabIndex: -1
|
|
25
|
-
},
|
|
26
|
+
}, jsx(SelectClearIcon, {
|
|
26
27
|
size: "small",
|
|
27
28
|
label: "clear"
|
|
28
29
|
})));
|
|
29
30
|
};
|
|
30
31
|
export var DropdownIndicator = function DropdownIndicator(props) {
|
|
31
|
-
return
|
|
32
|
+
return jsx(components.DropdownIndicator, props, jsx(DownIcon, {
|
|
32
33
|
label: "open"
|
|
33
34
|
}));
|
|
34
35
|
};
|
|
35
36
|
export var LoadingIndicator = function LoadingIndicator(props) {
|
|
36
37
|
var loadingStyles = css(props.getStyles('loadingIndicator', props));
|
|
37
38
|
return (
|
|
38
|
-
/*#__PURE__*/
|
|
39
39
|
// This *must* be constructed this way because this is being consumed by
|
|
40
40
|
// `react-select` and we don't control what it wants.
|
|
41
41
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
42
|
-
|
|
42
|
+
jsx("div", _extends({
|
|
43
43
|
css: loadingStyles
|
|
44
|
-
}, props.innerProps),
|
|
44
|
+
}, props.innerProps), jsx(Spinner, {
|
|
45
45
|
size: "small"
|
|
46
46
|
}))
|
|
47
47
|
);
|
|
@@ -13,7 +13,8 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
13
13
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
14
14
|
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; }
|
|
15
15
|
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; }
|
|
16
|
-
|
|
16
|
+
/** @jsx jsx */
|
|
17
|
+
import { css, jsx } from '@emotion/react';
|
|
17
18
|
import { Component } from 'react';
|
|
18
19
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
19
20
|
import RadioIcon from '@atlaskit/icon/glyph/radio';
|
|
@@ -194,15 +195,14 @@ var ControlOption = /*#__PURE__*/function (_Component) {
|
|
|
194
195
|
styles = _getPrimitiveStyles2[0],
|
|
195
196
|
classes = _getPrimitiveStyles2[1];
|
|
196
197
|
return (
|
|
197
|
-
/*#__PURE__*/
|
|
198
198
|
// These need to remain this way because `react-select` passes props with
|
|
199
199
|
// styles inside, and that must be done dynamically.
|
|
200
200
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
201
|
-
|
|
201
|
+
jsx("div", _extends({
|
|
202
202
|
css: styles,
|
|
203
203
|
className: classes,
|
|
204
204
|
ref: innerRef
|
|
205
|
-
}, props),
|
|
205
|
+
}, props), jsx("div", {
|
|
206
206
|
css: [baseIconStyles,
|
|
207
207
|
// Here we are adding a border to the Checkbox and Radio SVG icons
|
|
208
208
|
// This is an a11y fix for Select only for now but it may be rolled
|
|
@@ -219,11 +219,11 @@ var ControlOption = /*#__PURE__*/function (_Component) {
|
|
|
219
219
|
stroke: getBorderColor(_objectSpread(_objectSpread({}, this.props), this.state))
|
|
220
220
|
}
|
|
221
221
|
}]
|
|
222
|
-
}, !!Icon ?
|
|
222
|
+
}, !!Icon ? jsx(Icon, {
|
|
223
223
|
label: "",
|
|
224
224
|
primaryColor: getPrimaryColor(_objectSpread(_objectSpread({}, this.props), this.state)),
|
|
225
225
|
secondaryColor: getSecondaryColor(_objectSpread(_objectSpread({}, this.props), this.state))
|
|
226
|
-
}) : null),
|
|
226
|
+
}) : null), jsx("div", {
|
|
227
227
|
css: baseOptionStyles
|
|
228
228
|
}, children))
|
|
229
229
|
);
|
|
@@ -232,12 +232,12 @@ var ControlOption = /*#__PURE__*/function (_Component) {
|
|
|
232
232
|
return ControlOption;
|
|
233
233
|
}(Component);
|
|
234
234
|
export var CheckboxOption = function CheckboxOption(props) {
|
|
235
|
-
return
|
|
235
|
+
return jsx(ControlOption, _extends({
|
|
236
236
|
Icon: CheckboxIcon
|
|
237
237
|
}, props));
|
|
238
238
|
};
|
|
239
239
|
export var RadioOption = function RadioOption(props) {
|
|
240
|
-
return
|
|
240
|
+
return jsx(ControlOption, _extends({
|
|
241
241
|
Icon: RadioIcon
|
|
242
242
|
}, props));
|
|
243
243
|
};
|
package/package.json
CHANGED