@dxc-technology/halstack-react 6.0.0 → 6.1.0
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/accordion/types.d.ts +1 -1
- package/accordion-group/types.d.ts +1 -1
- package/bulleted-list/types.d.ts +1 -1
- package/button/Button.js +43 -61
- package/button/Button.stories.tsx +9 -0
- package/button/types.d.ts +7 -7
- package/chip/types.d.ts +1 -1
- package/common/variables.js +15 -6
- package/date-input/DateInput.js +3 -3
- package/dialog/Dialog.js +52 -28
- package/dialog/Dialog.stories.tsx +1 -2
- package/dialog/Dialog.test.js +34 -4
- package/dialog/types.d.ts +2 -2
- package/dropdown/Dropdown.d.ts +1 -1
- package/dropdown/Dropdown.js +242 -246
- package/dropdown/Dropdown.stories.tsx +126 -63
- package/dropdown/Dropdown.test.js +510 -108
- package/dropdown/DropdownMenu.d.ts +4 -0
- package/dropdown/DropdownMenu.js +80 -0
- package/dropdown/DropdownMenuItem.d.ts +4 -0
- package/dropdown/DropdownMenuItem.js +92 -0
- package/dropdown/types.d.ts +25 -5
- package/flex/Flex.js +1 -1
- package/flex/types.d.ts +1 -1
- package/footer/types.d.ts +1 -1
- package/header/Header.js +74 -72
- package/header/Icons.js +2 -2
- package/header/types.d.ts +2 -2
- package/layout/ApplicationLayout.js +3 -3
- package/link/Link.js +1 -1
- package/link/Link.stories.tsx +12 -5
- package/link/types.d.ts +1 -1
- package/package.json +7 -7
- package/progress-bar/ProgressBar.d.ts +2 -2
- package/progress-bar/ProgressBar.js +56 -50
- package/progress-bar/ProgressBar.stories.jsx +3 -1
- package/progress-bar/ProgressBar.test.js +67 -22
- package/progress-bar/types.d.ts +3 -4
- package/radio-group/RadioGroup.js +11 -13
- package/select/Listbox.d.ts +1 -1
- package/select/Listbox.js +25 -1
- package/select/Select.js +14 -31
- package/select/Select.stories.tsx +6 -5
- package/select/Select.test.js +63 -50
- package/select/types.d.ts +2 -4
- package/sidenav/Sidenav.js +15 -3
- package/sidenav/types.d.ts +1 -1
- package/slider/Slider.js +3 -3
- package/slider/Slider.test.js +37 -0
- package/switch/Switch.d.ts +1 -1
- package/switch/Switch.js +110 -54
- package/switch/Switch.stories.tsx +8 -30
- package/switch/Switch.test.js +122 -8
- package/switch/types.d.ts +3 -4
- package/tabs/types.d.ts +1 -1
- package/tabs-nav/NavTabs.js +5 -5
- package/tabs-nav/Tab.js +3 -5
- package/tabs-nav/types.d.ts +1 -1
- package/tag/types.d.ts +1 -1
- package/text-input/TextInput.js +12 -21
- package/text-input/TextInput.stories.tsx +1 -2
- package/text-input/types.d.ts +1 -1
- package/toggle-group/types.d.ts +1 -1
- package/wizard/types.d.ts +1 -1
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { userEvent, within } from "@storybook/testing-library";
|
|
3
2
|
import DxcSwitch from "./Switch";
|
|
4
3
|
import { BackgroundColorProvider } from "../BackgroundColorContext";
|
|
5
4
|
import Title from "../../.storybook/components/Title";
|
|
@@ -21,6 +20,10 @@ export const Chromatic = () => (
|
|
|
21
20
|
<Title title="Without label" theme="light" level={4} />
|
|
22
21
|
<DxcSwitch />
|
|
23
22
|
</ExampleContainer>
|
|
23
|
+
<ExampleContainer pseudoState="pseudo-focus-visible">
|
|
24
|
+
<Title title="Focused" theme="light" level={4} />
|
|
25
|
+
<DxcSwitch label="Switch" labelPosition="after" />
|
|
26
|
+
</ExampleContainer>
|
|
24
27
|
<ExampleContainer>
|
|
25
28
|
<Title title="Checked" theme="light" level={4} />
|
|
26
29
|
<DxcSwitch label="Switch" defaultChecked />
|
|
@@ -47,6 +50,10 @@ export const Chromatic = () => (
|
|
|
47
50
|
<Title title="With label" theme="dark" level={4} />
|
|
48
51
|
<DxcSwitch label="Switch" />
|
|
49
52
|
</ExampleContainer>
|
|
53
|
+
<ExampleContainer pseudoState="pseudo-focus-visible">
|
|
54
|
+
<Title title="Focused" theme="dark" level={4} />
|
|
55
|
+
<DxcSwitch label="Switch" labelPosition="after" />
|
|
56
|
+
</ExampleContainer>
|
|
50
57
|
<ExampleContainer>
|
|
51
58
|
<Title title="Checked" theme="dark" level={4} />
|
|
52
59
|
<DxcSwitch label="Switch" defaultChecked />
|
|
@@ -129,32 +136,3 @@ export const Chromatic = () => (
|
|
|
129
136
|
</ExampleContainer>
|
|
130
137
|
</>
|
|
131
138
|
);
|
|
132
|
-
|
|
133
|
-
const Switch = () => (
|
|
134
|
-
<ExampleContainer>
|
|
135
|
-
<Title title="Focused" theme="light" level={4} />
|
|
136
|
-
<DxcSwitch label="Switch" />
|
|
137
|
-
</ExampleContainer>
|
|
138
|
-
);
|
|
139
|
-
export const FocusedSwitch = Switch.bind({});
|
|
140
|
-
FocusedSwitch.play = async ({ canvasElement }) => {
|
|
141
|
-
const canvas = within(canvasElement);
|
|
142
|
-
canvas.getByRole("switch").focus();
|
|
143
|
-
};
|
|
144
|
-
|
|
145
|
-
const DarkSwitch = () => (
|
|
146
|
-
<BackgroundColorProvider color="#333333">
|
|
147
|
-
<DarkContainer>
|
|
148
|
-
<ExampleContainer>
|
|
149
|
-
<Title title="Focused" theme="dark" level={4} />
|
|
150
|
-
<DxcSwitch label="Switch" />
|
|
151
|
-
</ExampleContainer>
|
|
152
|
-
</DarkContainer>
|
|
153
|
-
</BackgroundColorProvider>
|
|
154
|
-
);
|
|
155
|
-
|
|
156
|
-
export const FocusedSwitchOnDark = DarkSwitch.bind({});
|
|
157
|
-
FocusedSwitchOnDark.play = async ({ canvasElement }) => {
|
|
158
|
-
const canvas = within(canvasElement);
|
|
159
|
-
canvas.getByRole("switch").focus();
|
|
160
|
-
};
|
package/switch/Switch.test.js
CHANGED
|
@@ -37,7 +37,7 @@ describe("Switch component tests", function () {
|
|
|
37
37
|
|
|
38
38
|
expect(onChange).toHaveBeenCalled();
|
|
39
39
|
});
|
|
40
|
-
test("
|
|
40
|
+
test("Calls correct function on key down", function () {
|
|
41
41
|
var onChange = jest.fn();
|
|
42
42
|
|
|
43
43
|
var _render3 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Switch["default"], {
|
|
@@ -47,6 +47,30 @@ describe("Switch component tests", function () {
|
|
|
47
47
|
})),
|
|
48
48
|
getByText = _render3.getByText;
|
|
49
49
|
|
|
50
|
+
_react2.fireEvent.focus(getByText("SwitchComponent"));
|
|
51
|
+
|
|
52
|
+
_react2.fireEvent.keyDown(getByText("SwitchComponent"), {
|
|
53
|
+
key: "Enter"
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
expect(onChange).toHaveBeenCalled();
|
|
57
|
+
|
|
58
|
+
_react2.fireEvent.keyDown(getByText("SwitchComponent"), {
|
|
59
|
+
key: " "
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
expect(onChange).toHaveBeenCalled();
|
|
63
|
+
});
|
|
64
|
+
test("Everytime the user clicks the component the onchange function is called with the correct value CONTROLLED COMPONENT", function () {
|
|
65
|
+
var onChange = jest.fn();
|
|
66
|
+
|
|
67
|
+
var _render4 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Switch["default"], {
|
|
68
|
+
label: "SwitchComponent",
|
|
69
|
+
checked: false,
|
|
70
|
+
onChange: onChange
|
|
71
|
+
})),
|
|
72
|
+
getByText = _render4.getByText;
|
|
73
|
+
|
|
50
74
|
_react2.fireEvent.click(getByText("SwitchComponent"));
|
|
51
75
|
|
|
52
76
|
_react2.fireEvent.click(getByText("SwitchComponent"));
|
|
@@ -54,14 +78,60 @@ describe("Switch component tests", function () {
|
|
|
54
78
|
expect(onChange.mock.calls[0][0]).toBe(true);
|
|
55
79
|
expect(onChange.mock.calls[1][0]).toBe(true);
|
|
56
80
|
});
|
|
81
|
+
test("Everytime the user use enter in the component, the onchange function is called with the correct value CONTROLLED COMPONENT", function () {
|
|
82
|
+
var onChange = jest.fn();
|
|
83
|
+
|
|
84
|
+
var _render5 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Switch["default"], {
|
|
85
|
+
label: "SwitchComponent",
|
|
86
|
+
checked: false,
|
|
87
|
+
onChange: onChange
|
|
88
|
+
})),
|
|
89
|
+
getByText = _render5.getByText;
|
|
90
|
+
|
|
91
|
+
_react2.fireEvent.focus(getByText("SwitchComponent"));
|
|
92
|
+
|
|
93
|
+
_react2.fireEvent.keyDown(getByText("SwitchComponent"), {
|
|
94
|
+
key: "Enter"
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
_react2.fireEvent.keyDown(getByText("SwitchComponent"), {
|
|
98
|
+
key: "Enter"
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
expect(onChange.mock.calls[0][0]).toBe(true);
|
|
102
|
+
expect(onChange.mock.calls[1][0]).toBe(true);
|
|
103
|
+
});
|
|
104
|
+
test("Everytime the user use space in the component, the onchange function is called with the correct value CONTROLLED COMPONENT", function () {
|
|
105
|
+
var onChange = jest.fn();
|
|
106
|
+
|
|
107
|
+
var _render6 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Switch["default"], {
|
|
108
|
+
label: "SwitchComponent",
|
|
109
|
+
checked: false,
|
|
110
|
+
onChange: onChange
|
|
111
|
+
})),
|
|
112
|
+
getByText = _render6.getByText;
|
|
113
|
+
|
|
114
|
+
_react2.fireEvent.focus(getByText("SwitchComponent"));
|
|
115
|
+
|
|
116
|
+
_react2.fireEvent.keyDown(getByText("SwitchComponent"), {
|
|
117
|
+
key: " "
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
_react2.fireEvent.keyDown(getByText("SwitchComponent"), {
|
|
121
|
+
key: " "
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
expect(onChange.mock.calls[0][0]).toBe(true);
|
|
125
|
+
expect(onChange.mock.calls[1][0]).toBe(true);
|
|
126
|
+
});
|
|
57
127
|
test("Everytime the user clicks the component the onchange function is called with the correct value UNCONTROLLED COMPONENT", function () {
|
|
58
128
|
var onChange = jest.fn();
|
|
59
129
|
|
|
60
|
-
var
|
|
130
|
+
var _render7 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Switch["default"], {
|
|
61
131
|
label: "SwitchComponent",
|
|
62
132
|
onChange: onChange
|
|
63
133
|
})),
|
|
64
|
-
getByText =
|
|
134
|
+
getByText = _render7.getByText;
|
|
65
135
|
|
|
66
136
|
_react2.fireEvent.click(getByText("SwitchComponent"));
|
|
67
137
|
|
|
@@ -70,13 +140,57 @@ describe("Switch component tests", function () {
|
|
|
70
140
|
expect(onChange.mock.calls[0][0]).toBe(true);
|
|
71
141
|
expect(onChange.mock.calls[1][0]).toBe(false);
|
|
72
142
|
});
|
|
143
|
+
test("Everytime the user use enter in the component, the onchange function is called with the correct value UNCONTROLLED COMPONENT", function () {
|
|
144
|
+
var onChange = jest.fn();
|
|
145
|
+
|
|
146
|
+
var _render8 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Switch["default"], {
|
|
147
|
+
label: "SwitchComponent",
|
|
148
|
+
onChange: onChange
|
|
149
|
+
})),
|
|
150
|
+
getByText = _render8.getByText;
|
|
151
|
+
|
|
152
|
+
_react2.fireEvent.focus(getByText("SwitchComponent"));
|
|
153
|
+
|
|
154
|
+
_react2.fireEvent.keyDown(getByText("SwitchComponent"), {
|
|
155
|
+
key: "Enter"
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
_react2.fireEvent.keyDown(getByText("SwitchComponent"), {
|
|
159
|
+
key: "Enter"
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
expect(onChange.mock.calls[0][0]).toBe(true);
|
|
163
|
+
expect(onChange.mock.calls[1][0]).toBe(false);
|
|
164
|
+
});
|
|
165
|
+
test("Everytime the user use space in the component, the onchange function is called with the correct value UNCONTROLLED COMPONENT", function () {
|
|
166
|
+
var onChange = jest.fn();
|
|
167
|
+
|
|
168
|
+
var _render9 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Switch["default"], {
|
|
169
|
+
label: "SwitchComponent",
|
|
170
|
+
onChange: onChange
|
|
171
|
+
})),
|
|
172
|
+
getByText = _render9.getByText;
|
|
173
|
+
|
|
174
|
+
_react2.fireEvent.focus(getByText("SwitchComponent"));
|
|
175
|
+
|
|
176
|
+
_react2.fireEvent.keyDown(getByText("SwitchComponent"), {
|
|
177
|
+
key: " "
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
_react2.fireEvent.keyDown(getByText("SwitchComponent"), {
|
|
181
|
+
key: " "
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
expect(onChange.mock.calls[0][0]).toBe(true);
|
|
185
|
+
expect(onChange.mock.calls[1][0]).toBe(false);
|
|
186
|
+
});
|
|
73
187
|
test("Renders with correct initial value and initial state when it is uncontrolled", function () {
|
|
74
|
-
var
|
|
188
|
+
var _render10 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Switch["default"], {
|
|
75
189
|
label: "Default label",
|
|
76
190
|
defaultChecked: true,
|
|
77
191
|
value: "test-defaultChecked"
|
|
78
192
|
})),
|
|
79
|
-
getByRole =
|
|
193
|
+
getByRole = _render10.getByRole;
|
|
80
194
|
|
|
81
195
|
var inputEl = getByRole("switch");
|
|
82
196
|
expect(inputEl.checked).toBe(true);
|
|
@@ -84,11 +198,11 @@ describe("Switch component tests", function () {
|
|
|
84
198
|
expect(inputEl.getAttribute("aria-checked")).toBe("true");
|
|
85
199
|
});
|
|
86
200
|
test("Renders with correct aria attributes", function () {
|
|
87
|
-
var
|
|
201
|
+
var _render11 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Switch["default"], {
|
|
88
202
|
label: "Default label"
|
|
89
203
|
})),
|
|
90
|
-
getByRole =
|
|
91
|
-
getByText =
|
|
204
|
+
getByRole = _render11.getByRole,
|
|
205
|
+
getByText = _render11.getByText;
|
|
92
206
|
|
|
93
207
|
var inputEl = getByRole("switch");
|
|
94
208
|
var label = getByText("Default label");
|
package/switch/types.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
declare type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
|
|
2
|
-
declare type Margin = {
|
|
1
|
+
export declare type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
|
|
2
|
+
export declare type Margin = {
|
|
3
3
|
top?: Space;
|
|
4
4
|
bottom?: Space;
|
|
5
5
|
left?: Space;
|
|
6
6
|
right?: Space;
|
|
7
7
|
};
|
|
8
|
-
declare type
|
|
8
|
+
export declare type SwitchPropsType = {
|
|
9
9
|
/**
|
|
10
10
|
* Initial state of the switch, only when it is uncontrolled.
|
|
11
11
|
*/
|
|
@@ -59,4 +59,3 @@ declare type Props = {
|
|
|
59
59
|
*/
|
|
60
60
|
tabIndex?: number;
|
|
61
61
|
};
|
|
62
|
-
export default Props;
|
package/tabs/types.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ declare type Margin = {
|
|
|
6
6
|
left?: Space;
|
|
7
7
|
right?: Space;
|
|
8
8
|
};
|
|
9
|
-
declare type SVG = React.SVGProps<SVGSVGElement>;
|
|
9
|
+
declare type SVG = React.ReactNode & React.SVGProps<SVGSVGElement>;
|
|
10
10
|
declare type TabCommonProps = {
|
|
11
11
|
/**
|
|
12
12
|
* Whether the tab is disabled or not.
|
package/tabs-nav/NavTabs.js
CHANGED
|
@@ -91,15 +91,15 @@ var DxcNavTabs = function DxcNavTabs(_ref) {
|
|
|
91
91
|
return getPropInChild(child, "active");
|
|
92
92
|
});
|
|
93
93
|
|
|
94
|
-
switch (event.
|
|
95
|
-
case
|
|
96
|
-
|
|
94
|
+
switch (event.key) {
|
|
95
|
+
case "Left":
|
|
96
|
+
case "ArrowLeft":
|
|
97
97
|
event.preventDefault();
|
|
98
98
|
setInnerFocus(getPreviousTabIndex(children, innerFocus === null ? activeTab : innerFocus));
|
|
99
99
|
break;
|
|
100
100
|
|
|
101
|
-
case
|
|
102
|
-
|
|
101
|
+
case "Right":
|
|
102
|
+
case "ArrowRight":
|
|
103
103
|
event.preventDefault();
|
|
104
104
|
setInnerFocus(getNextTabIndex(children, innerFocus === null ? activeTab : innerFocus));
|
|
105
105
|
break;
|
package/tabs-nav/Tab.js
CHANGED
|
@@ -59,11 +59,9 @@ var DxcTab = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, _ref2) {
|
|
|
59
59
|
var handleOnKeyDown = function handleOnKeyDown(event) {
|
|
60
60
|
var _tabRef$current2;
|
|
61
61
|
|
|
62
|
-
switch (event.
|
|
63
|
-
case
|
|
64
|
-
|
|
65
|
-
case 32:
|
|
66
|
-
// space
|
|
62
|
+
switch (event.key) {
|
|
63
|
+
case "Enter":
|
|
64
|
+
case "Space":
|
|
67
65
|
tabRef === null || tabRef === void 0 ? void 0 : (_tabRef$current2 = tabRef.current) === null || _tabRef$current2 === void 0 ? void 0 : _tabRef$current2.click();
|
|
68
66
|
event.preventDefault();
|
|
69
67
|
break;
|
package/tabs-nav/types.d.ts
CHANGED
package/tag/types.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ declare type Margin = {
|
|
|
6
6
|
left?: Space;
|
|
7
7
|
right?: Space;
|
|
8
8
|
};
|
|
9
|
-
declare type SVG = React.SVGProps<SVGSVGElement>;
|
|
9
|
+
declare type SVG = React.ReactNode & React.SVGProps<SVGSVGElement>;
|
|
10
10
|
declare type TagCommonProps = {
|
|
11
11
|
/**
|
|
12
12
|
* If defined, the tag will be displayed as an anchor, using this prop as "href".
|
package/text-input/TextInput.js
CHANGED
|
@@ -110,14 +110,6 @@ var makeCancelable = function makeCancelable(promise) {
|
|
|
110
110
|
};
|
|
111
111
|
};
|
|
112
112
|
|
|
113
|
-
var getNotOptionalErrorMessage = function getNotOptionalErrorMessage() {
|
|
114
|
-
return "This field is required. Please, enter a value.";
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
var getPatternErrorMessage = function getPatternErrorMessage() {
|
|
118
|
-
return "Please match the format requested.";
|
|
119
|
-
};
|
|
120
|
-
|
|
121
113
|
var patternMatch = function patternMatch(pattern, value) {
|
|
122
114
|
return new RegExp(pattern).test(value);
|
|
123
115
|
};
|
|
@@ -307,14 +299,14 @@ var DxcTextInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref
|
|
|
307
299
|
};
|
|
308
300
|
|
|
309
301
|
var handleIOnKeyDown = function handleIOnKeyDown(event) {
|
|
310
|
-
switch (event.
|
|
311
|
-
case
|
|
312
|
-
|
|
302
|
+
switch (event.key) {
|
|
303
|
+
case "Down":
|
|
304
|
+
case "ArrowDown":
|
|
305
|
+
event.preventDefault();
|
|
306
|
+
|
|
313
307
|
if ((numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.typeNumber) === "number") {
|
|
314
308
|
decrementNumber();
|
|
315
|
-
event.preventDefault();
|
|
316
309
|
} else {
|
|
317
|
-
event.preventDefault();
|
|
318
310
|
openSuggestions();
|
|
319
311
|
|
|
320
312
|
if (!isAutosuggestError && !isSearching && filteredSuggestions.length > 0) {
|
|
@@ -326,13 +318,13 @@ var DxcTextInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref
|
|
|
326
318
|
|
|
327
319
|
break;
|
|
328
320
|
|
|
329
|
-
case
|
|
330
|
-
|
|
321
|
+
case "Up":
|
|
322
|
+
case "ArrowUp":
|
|
323
|
+
event.preventDefault();
|
|
324
|
+
|
|
331
325
|
if ((numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.typeNumber) === "number") {
|
|
332
326
|
incrementNumber();
|
|
333
|
-
event.preventDefault();
|
|
334
327
|
} else {
|
|
335
|
-
event.preventDefault();
|
|
336
328
|
openSuggestions();
|
|
337
329
|
|
|
338
330
|
if (!isAutosuggestError && !isSearching && filteredSuggestions.length > 0) {
|
|
@@ -344,8 +336,8 @@ var DxcTextInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref
|
|
|
344
336
|
|
|
345
337
|
break;
|
|
346
338
|
|
|
347
|
-
case
|
|
348
|
-
|
|
339
|
+
case "Esc":
|
|
340
|
+
case "Escape":
|
|
349
341
|
event.preventDefault();
|
|
350
342
|
|
|
351
343
|
if (hasSuggestions()) {
|
|
@@ -355,8 +347,7 @@ var DxcTextInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref
|
|
|
355
347
|
|
|
356
348
|
break;
|
|
357
349
|
|
|
358
|
-
case
|
|
359
|
-
// Enter
|
|
350
|
+
case "Enter":
|
|
360
351
|
if (hasSuggestions() && !isSearching) {
|
|
361
352
|
var validFocusedSuggestion = filteredSuggestions.length > 0 && visualFocusedSuggIndex >= 0 && visualFocusedSuggIndex < filteredSuggestions.length;
|
|
362
353
|
validFocusedSuggestion && changeValue(filteredSuggestions[visualFocusedSuggIndex]);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { userEvent, within,
|
|
3
|
-
import { fireEvent } from "@testing-library/react";
|
|
2
|
+
import { userEvent, within, fireEvent } from "@storybook/testing-library";
|
|
4
3
|
import { BackgroundColorProvider } from "../BackgroundColorContext";
|
|
5
4
|
import Title from "../../.storybook/components/Title";
|
|
6
5
|
import ExampleContainer from "../../.storybook/components/ExampleContainer";
|
package/text-input/types.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ declare type Margin = {
|
|
|
6
6
|
left?: Space;
|
|
7
7
|
right?: Space;
|
|
8
8
|
};
|
|
9
|
-
declare type SVG = React.SVGProps<SVGSVGElement>;
|
|
9
|
+
declare type SVG = React.ReactNode & React.SVGProps<SVGSVGElement>;
|
|
10
10
|
declare type Action = {
|
|
11
11
|
/**
|
|
12
12
|
* This function will be called when the user clicks the action.
|
package/toggle-group/types.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ declare type Margin = {
|
|
|
6
6
|
left?: Space;
|
|
7
7
|
right?: Space;
|
|
8
8
|
};
|
|
9
|
-
declare type SVG = React.SVGProps<SVGSVGElement>;
|
|
9
|
+
declare type SVG = React.ReactNode & React.SVGProps<SVGSVGElement>;
|
|
10
10
|
declare type OptionCommons = {
|
|
11
11
|
/**
|
|
12
12
|
* Number with the option inner value.
|
package/wizard/types.d.ts
CHANGED