@shopgate/pwa-common 7.30.3 → 7.31.0-alpha.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.
Files changed (112) hide show
  1. package/App.js +0 -2
  2. package/actions/app/handleLink.js +1 -0
  3. package/collections/AuthRoutes.js +1 -0
  4. package/collections/PersistedReducers.js +1 -0
  5. package/collections/media-providers/Vimeo.js +1 -1
  6. package/collections/media-providers/style.js +1 -1
  7. package/components/Backdrop/index.js +18 -3
  8. package/components/Button/index.js +40 -52
  9. package/components/Checkbox/index.js +1 -1
  10. package/components/Drawer/index.js +118 -132
  11. package/components/Drawer/spec.js +4 -2
  12. package/components/Dropdown/index.js +52 -68
  13. package/components/Grid/components/Item/index.js +37 -40
  14. package/components/Grid/index.js +36 -34
  15. package/components/HtmlSanitizer/index.js +60 -7
  16. package/components/I18n/components/FormatNumber/spec.js +1 -0
  17. package/components/Icon/index.d.ts +36 -0
  18. package/components/Icon/index.d.ts.map +1 -0
  19. package/components/Icon/index.js +39 -28
  20. package/components/Image/Image.js +27 -6
  21. package/components/Image/ImageInner.js +32 -25
  22. package/components/InfiniteContainer/index.js +5 -7
  23. package/components/InfiniteContainer/spec.js +13 -17
  24. package/components/Link/index.js +75 -84
  25. package/components/List/components/Item/index.js +19 -10
  26. package/components/List/spec.js +1 -3
  27. package/components/Loading/index.d.ts +6 -0
  28. package/components/Loading/index.d.ts.map +1 -0
  29. package/components/Modal/index.js +41 -7
  30. package/components/Picker/index.js +18 -194
  31. package/components/Portal/index.d.ts +50 -0
  32. package/components/Portal/index.d.ts.map +1 -0
  33. package/components/ProductCharacteristics/index.js +14 -276
  34. package/components/RangeSlider/index.js +15 -258
  35. package/components/Select/components/Item/index.js +18 -7
  36. package/components/Select/index.js +108 -144
  37. package/components/Select/spec.js +49 -16
  38. package/components/SelectBox/components/Item/index.js +49 -51
  39. package/components/SelectBox/index.js +140 -160
  40. package/components/SurroundPortals/index.d.ts +24 -0
  41. package/components/SurroundPortals/index.d.ts.map +1 -0
  42. package/components/SurroundPortals/index.js +3 -13
  43. package/components/Swiper/components/SwiperItem/index.js +13 -4
  44. package/components/Swiper/components/SwiperItem/spec.js +3 -2
  45. package/components/Swiper/index.js +80 -12
  46. package/components/Widgets/components/Widget/index.js +54 -56
  47. package/components/Widgets/components/Widget/spec.js +12 -8
  48. package/components/Widgets/components/WidgetGrid/index.js +39 -53
  49. package/components/Widgets/components/WidgetGrid/spec.js +12 -8
  50. package/constants/Configuration.js +2 -1
  51. package/constants/Portals.d.ts +101 -0
  52. package/constants/Portals.d.ts.map +1 -0
  53. package/helpers/config/index.d.ts +94 -0
  54. package/helpers/config/index.d.ts.map +1 -0
  55. package/helpers/config/mock.d.ts +23 -0
  56. package/helpers/config/mock.d.ts.map +1 -0
  57. package/helpers/config/theme.d.ts +7 -0
  58. package/helpers/config/theme.d.ts.map +1 -0
  59. package/helpers/data/index.d.ts +35 -0
  60. package/helpers/data/index.d.ts.map +1 -0
  61. package/helpers/data/index.js +1 -0
  62. package/helpers/html/handleDOM.js +1 -0
  63. package/helpers/portals/portalCollection.d.ts +30 -0
  64. package/helpers/portals/portalCollection.d.ts.map +1 -0
  65. package/helpers/style/index.js +1 -0
  66. package/helpers/validation/index.d.ts +10 -0
  67. package/helpers/validation/index.d.ts.map +1 -0
  68. package/package.json +4 -3
  69. package/selectors/client.js +1 -0
  70. package/styles/reset/form.js +46 -51
  71. package/styles/reset/media.js +21 -19
  72. package/styles/reset/root.js +28 -26
  73. package/styles/reset/table.js +9 -7
  74. package/styles/reset/typography.js +24 -22
  75. package/subscriptions/error.js +1 -0
  76. package/subscriptions/helpers/handleLinks.js +1 -0
  77. package/subscriptions/router.js +1 -0
  78. package/tsconfig.build.json +16 -0
  79. package/tsconfig.json +3 -0
  80. package/components/Backdrop/style.js +0 -11
  81. package/components/Button/style.js +0 -6
  82. package/components/Drawer/style.js +0 -37
  83. package/components/Dropdown/style.js +0 -4
  84. package/components/Grid/components/Item/style.js +0 -23
  85. package/components/Grid/style.js +0 -14
  86. package/components/Icon/style.js +0 -6
  87. package/components/Image/style.js +0 -32
  88. package/components/Link/style.js +0 -10
  89. package/components/List/components/Item/style.js +0 -16
  90. package/components/Modal/style.js +0 -36
  91. package/components/Picker/components/Button/index.js +0 -42
  92. package/components/Picker/components/Button/style.js +0 -19
  93. package/components/Picker/components/List/index.js +0 -38
  94. package/components/Picker/components/List/style.js +0 -17
  95. package/components/Picker/components/Modal/index.js +0 -76
  96. package/components/Picker/components/Modal/style.js +0 -78
  97. package/components/Picker/spec.js +0 -88
  98. package/components/ProductCharacteristics/connector.js +0 -41
  99. package/components/ProductCharacteristics/context.js +0 -2
  100. package/components/ProductCharacteristics/helpers/index.js +0 -162
  101. package/components/RangeSlider/components/Handle/index.js +0 -34
  102. package/components/RangeSlider/components/Handle/style.js +0 -14
  103. package/components/RangeSlider/helper.js +0 -85
  104. package/components/RangeSlider/style.js +0 -14
  105. package/components/Select/components/Item/style.js +0 -4
  106. package/components/Select/style.js +0 -17
  107. package/components/SelectBox/components/Item/style.js +0 -7
  108. package/components/SelectBox/style.js +0 -18
  109. package/components/Swiper/components/SwiperItem/styles.js +0 -5
  110. package/components/Swiper/styles.js +0 -76
  111. package/components/Widgets/components/Widget/style.js +0 -27
  112. package/components/Widgets/components/WidgetGrid/style.js +0 -8
@@ -1,15 +1,27 @@
1
- import _inheritsLoose from "@babel/runtime/helpers/inheritsLoose";
2
- import React, { Component } from 'react';
1
+ import React, { useState, useEffect, useRef, useCallback, memo } from 'react';
3
2
  import PropTypes from 'prop-types';
4
- import styles from "./style";
3
+ import { makeStyles } from '@shopgate/engage/styles';
5
4
  import SelectItem from "./components/Item";
6
5
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
7
6
  const DEFAULT_PLACEHOLDER_TEXT = 'Select ...';
7
+ const useStyles = makeStyles()(() => ({
8
+ container: {
9
+ margin: 0,
10
+ padding: 0
11
+ },
12
+ selectHandle: {
13
+ float: 'right'
14
+ },
15
+ items: {
16
+ position: 'absolute',
17
+ width: '100%'
18
+ }
19
+ }));
8
20
 
9
21
  /**
10
22
  * Finds an item in a list of items by value.
11
- * @param {Array} items - The list of items.
12
- * @param {*} value - The value to look for.
23
+ * @param {Array} items The list of items.
24
+ * @param {*} value The value to look for.
13
25
  * @returns {*} The found item or undefined.
14
26
  */
15
27
  const findItemByValue = (items, value) => items.filter(item => item.value === value).shift();
@@ -17,7 +29,7 @@ const findItemByValue = (items, value) => items.filter(item => item.value === va
17
29
  /**
18
30
  * Converts an item of any type (e.g. string or number)
19
31
  * to an object representation containing value and label properties.
20
- * @param {*} item - An item of any type.
32
+ * @param {*} item An item of any type.
21
33
  * @returns {Object} An object representation of the item.
22
34
  */
23
35
  const normalizeItem = item => ({
@@ -27,149 +39,101 @@ const normalizeItem = item => ({
27
39
 
28
40
  /**
29
41
  * The select component.
30
- * @param {Object} props - The component props.
31
- * @param {React.Children} props.children - Some content to display inside.
42
+ * @param {Object} props Props.
43
+ * @returns {JSX.Element}
32
44
  */
33
- let Select = /*#__PURE__*/function (_Component) {
34
- /**
35
- * The constructor.
36
- * @param {Object} props - The component props.
37
- */
38
- function Select(props) {
39
- var _this;
40
- _this = _Component.call(this, props) || this;
41
- /**
42
- * Triggers the onChange callback if the selected value has changed.
43
- * @param {Object} nextState - The next state.
44
- */
45
- _this.triggerChangeCallback = nextState => {
46
- if (_this.state.selected && _this.state.selected.value === nextState.selected.value) {
47
- return;
48
- }
49
- if (_this.props.onChange instanceof Function) {
50
- _this.props.onChange(nextState.selected.value);
45
+ const Select = ({
46
+ className,
47
+ items,
48
+ onChange,
49
+ placeholder,
50
+ value
51
+ }) => {
52
+ const {
53
+ classes,
54
+ cx
55
+ } = useStyles();
56
+ const domElement = useRef(null);
57
+ const [selected, setSelected] = useState(() => {
58
+ if (!value) {
59
+ return null;
60
+ }
61
+ return normalizeItem(findItemByValue(items, value));
62
+ });
63
+ const [isOpen, setIsOpen] = useState(false);
64
+ useEffect(() => {
65
+ if (!value) {
66
+ setSelected(null);
67
+ return;
68
+ }
69
+ const next = normalizeItem(findItemByValue(items, value));
70
+ setSelected(prev => {
71
+ if (!prev || prev.value !== next?.value) {
72
+ return next;
51
73
  }
52
- };
53
- /**
54
- * Handles any interaction the user does outside of the component.
55
- * In this case the select gets closed.
56
- * @param {Event} event - The event of the user interaction (e.g. TouchEvent).
57
- */
58
- _this.handleInteractionOutside = event => {
59
- if (!_this.domElement.contains(event.target)) {
60
- _this.setState({
61
- isOpen: false
62
- });
74
+ return prev;
75
+ });
76
+ }, [value, items]);
77
+ useEffect(() => {
78
+ // eslint-disable-next-line require-jsdoc
79
+ const handleInteractionOutside = event => {
80
+ if (domElement.current && !domElement.current.contains(event.target)) {
81
+ setIsOpen(false);
63
82
  }
64
83
  };
65
- /**
66
- * Gets called when a new item is selected
67
- * @param {*} value - The selected value.
68
- * @param {string} label - The selected label.
69
- */
70
- _this.handleItemSelect = (value, label) => {
71
- const stateUpdate = {
72
- selected: {
73
- label,
74
- value
75
- },
76
- isOpen: false
77
- };
78
- _this.triggerChangeCallback(stateUpdate);
79
- _this.setState(stateUpdate);
80
- };
81
- /**
82
- * Toggles the open state of the component.
83
- */
84
- _this.toggleOpenState = () => {
85
- _this.setState(({
86
- isOpen
87
- }) => ({
88
- isOpen: !isOpen
89
- }));
90
- };
91
- _this.state = {
92
- selected: null,
93
- isOpen: false
94
- };
95
- _this.domElement = null;
96
- if (props.value) {
97
- _this.state.selected = normalizeItem(findItemByValue(props.items, props.value));
84
+ document.addEventListener('touchstart', handleInteractionOutside);
85
+ return () => document.removeEventListener('touchstart', handleInteractionOutside);
86
+ }, []);
87
+ const triggerChangeCallback = useCallback(nextSelected => {
88
+ if (selected && selected.value === nextSelected.value) {
89
+ return;
98
90
  }
99
- return _this;
100
- }
101
-
102
- /**
103
- * Adds event listener when the component is mounted.
104
- */
105
- _inheritsLoose(Select, _Component);
106
- var _proto = Select.prototype;
107
- _proto.componentDidMount = function componentDidMount() {
108
- document.addEventListener('touchstart', this.handleInteractionOutside);
109
- }
110
-
111
- /**
112
- * Updates the selected item when the value prop changes.
113
- * @param {Object} nextProps - The next props.
114
- */;
115
- _proto.UNSAFE_componentWillReceiveProps = function UNSAFE_componentWillReceiveProps(nextProps) {
116
- if (!this.state.selected || nextProps.value !== this.state.selected.value) {
117
- this.state.selected = normalizeItem(findItemByValue(nextProps.items, nextProps.value));
91
+ if (onChange instanceof Function) {
92
+ onChange(nextSelected.value);
118
93
  }
119
- }
120
-
121
- /**
122
- * Removes event listener when the component will unmount.
123
- */;
124
- _proto.componentWillUnmount = function componentWillUnmount() {
125
- document.removeEventListener('touchstart', this.handleInteractionOutside);
126
- };
127
- /**
128
- * Renders the component.
129
- * @returns {JSX}
130
- */
131
- _proto.render = function render() {
132
- const hasSelection = this.state.selected && this.state.selected.value !== undefined;
133
- const selectedLabel = hasSelection ? this.state.selected.label : this.props.placeholder;
134
- const items = this.state.isOpen ? /*#__PURE__*/_jsx("div", {
135
- className: styles.items,
136
- children: this.props.items.map(item => {
137
- const normalizedItem = normalizeItem(item);
138
- const selected = hasSelection && this.state.selected.value === normalizedItem.value;
139
- return /*#__PURE__*/_jsx(SelectItem, {
140
- value: normalizedItem.value,
141
- label: normalizedItem.label,
142
- selected: selected,
143
- onSelect: this.handleItemSelect
144
- }, normalizedItem.value);
145
- })
146
- }) : null;
147
- return /*#__PURE__*/_jsxs("div", {
148
- className: `${styles.container} ${this.props.className} common_select`,
149
- ref: ref => {
150
- this.domElement = ref;
151
- },
152
- children: [/*#__PURE__*/_jsxs("div", {
153
- onTouchStart: this.toggleOpenState,
154
- children: [/*#__PURE__*/_jsx("span", {
155
- children: selectedLabel
156
- }), /*#__PURE__*/_jsx("span", {
157
- className: styles.selectHandle,
158
- children: "\u25BE"
159
- })]
160
- }), items]
161
- });
162
- };
163
- return Select;
164
- }(Component);
165
- /**
166
- * The component prop types.
167
- * @type {Object}
168
- */
169
- /**
170
- * The component default props.
171
- * @type {Object}
172
- */
94
+ }, [onChange, selected]);
95
+ const handleItemSelect = useCallback((itemValue, label) => {
96
+ const stateUpdate = {
97
+ label,
98
+ value: itemValue
99
+ };
100
+ triggerChangeCallback(stateUpdate);
101
+ setSelected(stateUpdate);
102
+ setIsOpen(false);
103
+ }, [triggerChangeCallback]);
104
+ const toggleOpenState = useCallback(() => {
105
+ setIsOpen(open => !open);
106
+ }, []);
107
+ const hasSelection = selected && selected.value !== undefined;
108
+ const selectedLabel = hasSelection ? selected.label : placeholder;
109
+ const itemsMarkup = isOpen ? /*#__PURE__*/_jsx("div", {
110
+ className: classes.items,
111
+ children: items.map(item => {
112
+ const normalizedItem = normalizeItem(item);
113
+ const itemSelected = hasSelection && selected.value === normalizedItem.value;
114
+ return /*#__PURE__*/_jsx(SelectItem, {
115
+ value: normalizedItem.value,
116
+ label: normalizedItem.label,
117
+ selected: itemSelected,
118
+ onSelect: handleItemSelect
119
+ }, normalizedItem.value);
120
+ })
121
+ }) : null;
122
+ return /*#__PURE__*/_jsxs("div", {
123
+ className: cx(classes.container, className, 'common_select'),
124
+ ref: domElement,
125
+ children: [/*#__PURE__*/_jsxs("div", {
126
+ onTouchStart: toggleOpenState,
127
+ role: "presentation",
128
+ children: [/*#__PURE__*/_jsx("span", {
129
+ children: selectedLabel
130
+ }), /*#__PURE__*/_jsx("span", {
131
+ className: classes.selectHandle,
132
+ children: "\u25BE"
133
+ })]
134
+ }), itemsMarkup]
135
+ });
136
+ };
173
137
  Select.defaultProps = {
174
138
  className: '',
175
139
  items: [],
@@ -177,4 +141,4 @@ Select.defaultProps = {
177
141
  placeholder: DEFAULT_PLACEHOLDER_TEXT,
178
142
  value: null
179
143
  };
180
- export default Select;
144
+ export default /*#__PURE__*/memo(Select);
@@ -1,22 +1,56 @@
1
1
  import React from 'react';
2
- import { shallow, mount } from 'enzyme';
2
+ import { mount } from 'enzyme';
3
+ import { act } from 'react-dom/test-utils';
3
4
  import Select from "./index";
4
5
  import SelectItem from "./components/Item";
6
+
7
+ /**
8
+ * Returns whether the given Enzyme wrapper contains at least one node
9
+ * with a class name that ends with the provided suffix.
10
+ *
11
+ * This checks individual class tokens, so it works with elements that
12
+ * have multiple classes.
13
+ *
14
+ * @param {Object} wrapper Enzyme wrapper (mount or shallow result).
15
+ * @param {string} suffix Class name suffix to match, e.g. "-innerShadow".
16
+ * @returns {boolean} True if a matching node exists.
17
+ */
5
18
  import { jsx as _jsx } from "react/jsx-runtime";
19
+ export function containsClassWithEnding(wrapper, suffix) {
20
+ if (!wrapper || typeof wrapper.findWhere !== 'function' || !suffix) {
21
+ return false;
22
+ }
23
+ return wrapper.findWhere(node => {
24
+ const className = node.prop('className');
25
+ if (typeof className !== 'string') {
26
+ return false;
27
+ }
28
+ return className.split(/\s+/).some(cls => cls.endsWith(suffix));
29
+ }).length > 0;
30
+ }
31
+
32
+ /**
33
+ * Helper to simulate toggling the open state by touching the handle area.
34
+ * @param {Object} wrapper Enzyme wrapper.
35
+ */
36
+ const toggleOpen = wrapper => {
37
+ wrapper.find('[role="presentation"]').simulate('touchstart');
38
+ wrapper.update();
39
+ };
6
40
  describe('<Select />', () => {
7
41
  jest.useFakeTimers();
8
42
  it('opens and closes the item list', () => {
9
- const wrapper = shallow(/*#__PURE__*/_jsx(Select, {}));
10
- let previousOpenState = wrapper.state('isOpen');
11
- wrapper.instance().toggleOpenState();
12
- expect(wrapper.state('isOpen')).toBe(!previousOpenState);
13
- previousOpenState = wrapper.state('isOpen');
14
- wrapper.instance().toggleOpenState();
15
- expect(wrapper.state('isOpen')).toBe(!previousOpenState);
43
+ const wrapper = mount(/*#__PURE__*/_jsx(Select, {}));
44
+ expect(wrapper.find(SelectItem).length).toBe(0);
45
+ toggleOpen(wrapper);
46
+ // opened – still 0 items because no items prop
47
+ expect(containsClassWithEnding(wrapper, '-items')).toBe(true);
48
+ toggleOpen(wrapper);
49
+ expect(containsClassWithEnding(wrapper, '-items')).toBe(false);
16
50
  });
17
51
  it('renders without items', () => {
18
52
  const wrapper = mount(/*#__PURE__*/_jsx(Select, {}));
19
- wrapper.instance().toggleOpenState();
53
+ toggleOpen(wrapper);
20
54
  expect(wrapper).toMatchSnapshot();
21
55
  expect(wrapper.find(SelectItem).length).toBe(0);
22
56
  });
@@ -33,8 +67,7 @@ describe('<Select />', () => {
33
67
  const wrapper = mount(/*#__PURE__*/_jsx(Select, {
34
68
  items: items
35
69
  }));
36
- wrapper.instance().toggleOpenState();
37
- wrapper.update();
70
+ toggleOpen(wrapper);
38
71
  expect(wrapper).toMatchSnapshot();
39
72
  expect(wrapper.find(SelectItem).length).toBe(items.length);
40
73
  });
@@ -48,8 +81,7 @@ describe('<Select />', () => {
48
81
  const wrapper = mount(/*#__PURE__*/_jsx(Select, {
49
82
  items: items
50
83
  }));
51
- wrapper.instance().toggleOpenState();
52
- wrapper.update();
84
+ toggleOpen(wrapper);
53
85
  expect(wrapper).toMatchSnapshot();
54
86
  expect(wrapper.find(SelectItem).length).toBe(items.length);
55
87
  let i = 0;
@@ -80,10 +112,11 @@ describe('<Select />', () => {
80
112
  items: items,
81
113
  onChange: callback
82
114
  }));
83
- wrapper.instance().toggleOpenState();
84
- wrapper.update();
115
+ toggleOpen(wrapper);
85
116
  expect(wrapper).toMatchSnapshot();
86
117
  const node = wrapper.find(SelectItem).at(selectionIndex);
87
- node.prop('onSelect')(node.prop('value'), node.prop('label'));
118
+ act(() => {
119
+ node.prop('onSelect')(node.prop('value'), node.prop('label'));
120
+ });
88
121
  });
89
122
  });
@@ -1,62 +1,60 @@
1
- import _inheritsLoose from "@babel/runtime/helpers/inheritsLoose";
2
- import React, { Component } from 'react';
3
- import classNames from 'classnames';
1
+ import React, { useCallback, memo } from 'react';
4
2
  import PropTypes from 'prop-types';
3
+ import { makeStyles } from '@shopgate/engage/styles';
5
4
  import I18n from "../../../I18n";
6
- import { item } from "./style";
5
+ import { jsx as _jsx } from "react/jsx-runtime";
6
+ const useStyles = makeStyles()(() => ({
7
+ item: {
8
+ cursor: 'pointer'
9
+ }
10
+ }));
7
11
 
8
12
  /**
9
13
  * The SelectBoxItem component.
10
- * @param {Object} props The components props.
11
- * @returns {JSX}
14
+ * @param {Object} props Props.
15
+ * @returns {JSX.Element}
12
16
  */
13
- import { jsx as _jsx } from "react/jsx-runtime";
14
- let SelectBoxItem = /*#__PURE__*/function (_Component) {
15
- function SelectBoxItem(...args) {
16
- var _this;
17
- _this = _Component.call.apply(_Component, [this].concat(args)) || this;
18
- /**
19
- * Calls the handleSelectionUpdate prop and prevents further events.
20
- */
21
- _this.handleSelectionUpdate = () => {
22
- _this.props.handleSelectionUpdate(_this.props.value);
23
- };
24
- return _this;
25
- }
26
- _inheritsLoose(SelectBoxItem, _Component);
27
- var _proto = SelectBoxItem.prototype;
28
- /**
29
- * Renders the component
30
- * @returns {JSX}
31
- */
32
- _proto.render = function render() {
33
- const Wrapper = this.props.wrapper;
34
- const {
35
- selectItem,
36
- selectItemSelected
37
- } = this.props.classNames;
38
- return /*#__PURE__*/_jsx("li", {
39
- className: classNames(selectItem, item, {
40
- [selectItemSelected]: this.props.isSelected
41
- }),
42
- onKeyUp: () => {},
43
- onClick: this.handleSelectionUpdate,
44
- "data-test-id": this.props.label,
45
- role: "menuitem",
46
- ref: this.props.forwardedRef,
47
- tabIndex: this.props.isSelected ? '0' : '-1',
48
- "aria-current": this.props.isSelected,
49
- children: /*#__PURE__*/_jsx(Wrapper, {
50
- children: /*#__PURE__*/_jsx(I18n.Text, {
51
- string: this.props.label
52
- })
17
+ const SelectBoxItem = ({
18
+ handleSelectionUpdate,
19
+ isSelected,
20
+ label,
21
+ value,
22
+ wrapper: Wrapper,
23
+ classNames: classNamesProp,
24
+ forwardedRef
25
+ }) => {
26
+ const {
27
+ classes,
28
+ cx
29
+ } = useStyles();
30
+ const {
31
+ selectItem,
32
+ selectItemSelected
33
+ } = classNamesProp;
34
+ const onSelect = useCallback(() => {
35
+ handleSelectionUpdate(value);
36
+ }, [handleSelectionUpdate, value]);
37
+ return /*#__PURE__*/_jsx("li", {
38
+ className: cx(classes.item, {
39
+ [selectItemSelected]: isSelected,
40
+ selectItem
41
+ }),
42
+ onKeyUp: () => {},
43
+ onClick: onSelect,
44
+ "data-test-id": label,
45
+ role: "menuitem",
46
+ ref: forwardedRef,
47
+ tabIndex: isSelected ? '0' : '-1',
48
+ "aria-current": isSelected,
49
+ children: /*#__PURE__*/_jsx(Wrapper, {
50
+ children: /*#__PURE__*/_jsx(I18n.Text, {
51
+ string: label
53
52
  })
54
- });
55
- };
56
- return SelectBoxItem;
57
- }(Component);
53
+ })
54
+ });
55
+ };
58
56
  SelectBoxItem.defaultProps = {
59
57
  forwardedRef: null,
60
58
  classNames: {}
61
59
  };
62
- export default SelectBoxItem;
60
+ export default /*#__PURE__*/memo(SelectBoxItem);