@dxc-technology/halstack-react 0.0.0-f53e801 → 0.0.0-f54247d
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/HalstackContext.js +7 -8
- package/accordion/Accordion.js +122 -103
- package/accordion/Accordion.stories.tsx +1 -2
- package/accordion/Accordion.test.js +9 -10
- package/accordion/types.d.ts +4 -3
- package/accordion-group/AccordionGroup.js +1 -21
- package/accordion-group/AccordionGroup.stories.tsx +27 -1
- package/accordion-group/AccordionGroup.test.js +20 -45
- package/accordion-group/types.d.ts +9 -2
- package/alert/Alert.js +1 -1
- package/box/Box.js +1 -1
- package/box/types.d.ts +1 -0
- package/card/types.d.ts +1 -0
- package/checkbox/Checkbox.d.ts +2 -2
- package/checkbox/Checkbox.js +92 -99
- package/checkbox/Checkbox.stories.tsx +79 -59
- package/checkbox/Checkbox.test.js +93 -16
- package/checkbox/types.d.ts +6 -2
- package/common/variables.js +27 -19
- package/date-input/Calendar.d.ts +4 -0
- package/date-input/Calendar.js +258 -0
- package/date-input/DateInput.js +77 -222
- package/date-input/DateInput.stories.tsx +30 -17
- package/date-input/DateInput.test.js +411 -138
- package/date-input/DatePicker.d.ts +4 -0
- package/date-input/DatePicker.js +160 -0
- package/date-input/YearPicker.d.ts +4 -0
- package/date-input/YearPicker.js +115 -0
- package/date-input/types.d.ts +53 -0
- package/dialog/Dialog.js +4 -4
- package/dialog/Dialog.stories.tsx +56 -0
- package/dialog/types.d.ts +1 -0
- package/dropdown/Dropdown.js +38 -34
- package/dropdown/Dropdown.test.js +19 -25
- package/dropdown/DropdownMenuItem.js +1 -1
- package/file-input/FileInput.d.ts +2 -2
- package/file-input/FileInput.js +177 -219
- package/file-input/FileInput.stories.tsx +38 -10
- package/file-input/FileInput.test.js +53 -12
- package/file-input/FileItem.d.ts +4 -14
- package/file-input/FileItem.js +38 -63
- package/file-input/types.d.ts +17 -0
- package/flex/Flex.d.ts +1 -1
- package/flex/Flex.js +31 -19
- package/flex/types.d.ts +14 -3
- package/footer/Footer.stories.tsx +8 -1
- package/footer/types.d.ts +1 -0
- package/header/Header.stories.tsx +4 -4
- package/header/types.d.ts +1 -0
- package/layout/ApplicationLayout.stories.tsx +1 -0
- package/link/Link.js +1 -1
- package/number-input/NumberInput.test.js +43 -7
- package/package.json +14 -19
- package/paginator/Paginator.js +2 -2
- package/paginator/Paginator.test.js +1 -1
- package/password-input/PasswordInput.test.js +13 -12
- package/quick-nav/QuickNav.js +11 -12
- package/quick-nav/QuickNav.stories.tsx +97 -19
- package/radio-group/Radio.d.ts +1 -1
- package/radio-group/Radio.js +43 -28
- package/radio-group/RadioGroup.js +15 -13
- package/radio-group/RadioGroup.stories.tsx +1 -0
- package/radio-group/RadioGroup.test.js +123 -96
- package/radio-group/types.d.ts +2 -2
- package/resultsetTable/Icons.d.ts +7 -0
- package/resultsetTable/Icons.js +51 -0
- package/resultsetTable/ResultsetTable.js +48 -107
- package/resultsetTable/ResultsetTable.stories.tsx +50 -25
- package/resultsetTable/ResultsetTable.test.js +23 -41
- package/resultsetTable/types.d.ts +2 -2
- package/select/Listbox.js +0 -1
- package/select/Select.js +3 -1
- package/select/Select.stories.tsx +2 -5
- package/select/Select.test.js +267 -209
- package/slider/Slider.d.ts +2 -2
- package/slider/Slider.js +118 -93
- package/slider/Slider.stories.tsx +7 -1
- package/slider/Slider.test.js +87 -24
- package/slider/types.d.ts +6 -2
- package/switch/Switch.d.ts +3 -3
- package/switch/Switch.js +94 -83
- package/switch/Switch.test.js +26 -13
- package/switch/types.d.ts +6 -1
- package/table/Table.js +1 -1
- package/table/Table.test.js +1 -1
- package/tabs/Tab.d.ts +4 -0
- package/tabs/Tab.js +135 -0
- package/tabs/Tabs.js +360 -104
- package/tabs/Tabs.stories.tsx +74 -0
- package/tabs/Tabs.test.js +217 -6
- package/tabs/types.d.ts +14 -4
- package/tabs-nav/Tab.js +1 -1
- package/tag/Tag.js +1 -1
- package/text-input/Icons.d.ts +8 -0
- package/text-input/Icons.js +60 -0
- package/text-input/Suggestion.js +7 -5
- package/text-input/Suggestions.d.ts +4 -0
- package/text-input/Suggestions.js +134 -0
- package/text-input/TextInput.js +179 -263
- package/text-input/TextInput.stories.tsx +189 -181
- package/text-input/TextInput.test.js +639 -727
- package/text-input/types.d.ts +21 -2
- package/common/RequiredComponent.js +0 -32
|
@@ -15,42 +15,37 @@ var _Dropdown = _interopRequireDefault(require("./Dropdown"));
|
|
|
15
15
|
var _userEvent = _interopRequireDefault(require("@testing-library/user-event"));
|
|
16
16
|
|
|
17
17
|
global.globalThis = global;
|
|
18
|
+
global.DOMRect = {
|
|
19
|
+
fromRect: function fromRect() {
|
|
20
|
+
return {
|
|
21
|
+
top: 0,
|
|
22
|
+
left: 0,
|
|
23
|
+
bottom: 0,
|
|
24
|
+
right: 0,
|
|
25
|
+
width: 0,
|
|
26
|
+
height: 0
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
};
|
|
18
30
|
|
|
19
31
|
global.ResizeObserver = /*#__PURE__*/function () {
|
|
20
|
-
function ResizeObserver(
|
|
32
|
+
function ResizeObserver() {
|
|
21
33
|
(0, _classCallCheck2["default"])(this, ResizeObserver);
|
|
22
|
-
this.cb = cb;
|
|
23
34
|
}
|
|
24
35
|
|
|
25
36
|
(0, _createClass2["default"])(ResizeObserver, [{
|
|
26
37
|
key: "observe",
|
|
27
|
-
value: function observe() {
|
|
28
|
-
this.cb([{
|
|
29
|
-
borderBoxSize: {
|
|
30
|
-
inlineSize: 0,
|
|
31
|
-
blockSize: 0
|
|
32
|
-
}
|
|
33
|
-
}]);
|
|
34
|
-
}
|
|
38
|
+
value: function observe() {}
|
|
35
39
|
}, {
|
|
36
40
|
key: "unobserve",
|
|
37
41
|
value: function unobserve() {}
|
|
42
|
+
}, {
|
|
43
|
+
key: "disconnect",
|
|
44
|
+
value: function disconnect() {}
|
|
38
45
|
}]);
|
|
39
46
|
return ResizeObserver;
|
|
40
47
|
}();
|
|
41
48
|
|
|
42
|
-
global.DOMRect = {
|
|
43
|
-
fromRect: function fromRect() {
|
|
44
|
-
return {
|
|
45
|
-
top: 0,
|
|
46
|
-
left: 0,
|
|
47
|
-
bottom: 0,
|
|
48
|
-
right: 0,
|
|
49
|
-
width: 0,
|
|
50
|
-
height: 0
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
49
|
var options = [{
|
|
55
50
|
value: "1",
|
|
56
51
|
label: "Amazon"
|
|
@@ -74,7 +69,6 @@ describe("Dropdown component tests", function () {
|
|
|
74
69
|
getByRole = _render.getByRole;
|
|
75
70
|
|
|
76
71
|
var dropdown = getByRole("button");
|
|
77
|
-
expect(dropdown.getAttribute("aria-disabled")).toBe("false");
|
|
78
72
|
expect(dropdown.getAttribute("aria-haspopup")).toBe("true");
|
|
79
73
|
expect(dropdown.getAttribute("aria-expanded")).toBeNull();
|
|
80
74
|
expect(dropdown.getAttribute("aria-activedescendant")).toBeNull();
|
|
@@ -82,6 +76,7 @@ describe("Dropdown component tests", function () {
|
|
|
82
76
|
_userEvent["default"].click(dropdown);
|
|
83
77
|
|
|
84
78
|
var menu = getByRole("menu");
|
|
79
|
+
expect(dropdown.getAttribute("aria-controls")).toBe(menu.id);
|
|
85
80
|
expect(dropdown.getAttribute("aria-expanded")).toBe("true");
|
|
86
81
|
expect(menu.getAttribute("aria-activedescendant")).toBe("option-0");
|
|
87
82
|
expect(menu.getAttribute("aria-orientation")).toBe("vertical");
|
|
@@ -123,7 +118,6 @@ describe("Dropdown component tests", function () {
|
|
|
123
118
|
queryByText = _render3.queryByText;
|
|
124
119
|
|
|
125
120
|
var dropdown = getByRole("button");
|
|
126
|
-
expect(dropdown.getAttribute("aria-disabled")).toBe("true");
|
|
127
121
|
expect(queryByRole("menu")).toBeFalsy();
|
|
128
122
|
|
|
129
123
|
_userEvent["default"].click(dropdown);
|
|
@@ -267,7 +261,7 @@ describe("Dropdown component tests", function () {
|
|
|
267
261
|
var dropdown = getByRole("button");
|
|
268
262
|
|
|
269
263
|
_react2.fireEvent.keyDown(dropdown, {
|
|
270
|
-
key: "
|
|
264
|
+
key: " ",
|
|
271
265
|
code: "Space",
|
|
272
266
|
keyCode: 32,
|
|
273
267
|
charCode: 32
|
|
@@ -49,7 +49,7 @@ var DropdownMenuItem = function DropdownMenuItem(_ref) {
|
|
|
49
49
|
}) : option.icon), iconPosition === "before" && /*#__PURE__*/_react["default"].createElement(DropdownMenuItemLabel, null, option.label)));
|
|
50
50
|
};
|
|
51
51
|
|
|
52
|
-
var DropdownMenuItemContainer = _styledComponents["default"].li(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n box-sizing: border-box;\n display: flex;\n align-items: center;\n gap: ", ";\n min-height: 36px;\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n cursor: pointer;\n\n ", "\n
|
|
52
|
+
var DropdownMenuItemContainer = _styledComponents["default"].li(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n box-sizing: border-box;\n display: flex;\n align-items: center;\n gap: ", ";\n min-height: 36px;\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n cursor: pointer;\n\n ", "\n &:hover {\n background-color: ", ";\n }\n &:active {\n background-color: ", ";\n }\n"])), function (props) {
|
|
53
53
|
return props.theme.optionIconSpacing;
|
|
54
54
|
}, function (props) {
|
|
55
55
|
return props.theme.optionPaddingTop;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
2
|
import FileInputPropsType from "./types";
|
|
3
|
-
declare const DxcFileInput:
|
|
3
|
+
declare const DxcFileInput: React.ForwardRefExoticComponent<FileInputPropsType & React.RefAttributes<HTMLDivElement>>;
|
|
4
4
|
export default DxcFileInput;
|