@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.
Files changed (103) hide show
  1. package/HalstackContext.js +7 -8
  2. package/accordion/Accordion.js +122 -103
  3. package/accordion/Accordion.stories.tsx +1 -2
  4. package/accordion/Accordion.test.js +9 -10
  5. package/accordion/types.d.ts +4 -3
  6. package/accordion-group/AccordionGroup.js +1 -21
  7. package/accordion-group/AccordionGroup.stories.tsx +27 -1
  8. package/accordion-group/AccordionGroup.test.js +20 -45
  9. package/accordion-group/types.d.ts +9 -2
  10. package/alert/Alert.js +1 -1
  11. package/box/Box.js +1 -1
  12. package/box/types.d.ts +1 -0
  13. package/card/types.d.ts +1 -0
  14. package/checkbox/Checkbox.d.ts +2 -2
  15. package/checkbox/Checkbox.js +92 -99
  16. package/checkbox/Checkbox.stories.tsx +79 -59
  17. package/checkbox/Checkbox.test.js +93 -16
  18. package/checkbox/types.d.ts +6 -2
  19. package/common/variables.js +27 -19
  20. package/date-input/Calendar.d.ts +4 -0
  21. package/date-input/Calendar.js +258 -0
  22. package/date-input/DateInput.js +77 -222
  23. package/date-input/DateInput.stories.tsx +30 -17
  24. package/date-input/DateInput.test.js +411 -138
  25. package/date-input/DatePicker.d.ts +4 -0
  26. package/date-input/DatePicker.js +160 -0
  27. package/date-input/YearPicker.d.ts +4 -0
  28. package/date-input/YearPicker.js +115 -0
  29. package/date-input/types.d.ts +53 -0
  30. package/dialog/Dialog.js +4 -4
  31. package/dialog/Dialog.stories.tsx +56 -0
  32. package/dialog/types.d.ts +1 -0
  33. package/dropdown/Dropdown.js +38 -34
  34. package/dropdown/Dropdown.test.js +19 -25
  35. package/dropdown/DropdownMenuItem.js +1 -1
  36. package/file-input/FileInput.d.ts +2 -2
  37. package/file-input/FileInput.js +177 -219
  38. package/file-input/FileInput.stories.tsx +38 -10
  39. package/file-input/FileInput.test.js +53 -12
  40. package/file-input/FileItem.d.ts +4 -14
  41. package/file-input/FileItem.js +38 -63
  42. package/file-input/types.d.ts +17 -0
  43. package/flex/Flex.d.ts +1 -1
  44. package/flex/Flex.js +31 -19
  45. package/flex/types.d.ts +14 -3
  46. package/footer/Footer.stories.tsx +8 -1
  47. package/footer/types.d.ts +1 -0
  48. package/header/Header.stories.tsx +4 -4
  49. package/header/types.d.ts +1 -0
  50. package/layout/ApplicationLayout.stories.tsx +1 -0
  51. package/link/Link.js +1 -1
  52. package/number-input/NumberInput.test.js +43 -7
  53. package/package.json +14 -19
  54. package/paginator/Paginator.js +2 -2
  55. package/paginator/Paginator.test.js +1 -1
  56. package/password-input/PasswordInput.test.js +13 -12
  57. package/quick-nav/QuickNav.js +11 -12
  58. package/quick-nav/QuickNav.stories.tsx +97 -19
  59. package/radio-group/Radio.d.ts +1 -1
  60. package/radio-group/Radio.js +43 -28
  61. package/radio-group/RadioGroup.js +15 -13
  62. package/radio-group/RadioGroup.stories.tsx +1 -0
  63. package/radio-group/RadioGroup.test.js +123 -96
  64. package/radio-group/types.d.ts +2 -2
  65. package/resultsetTable/Icons.d.ts +7 -0
  66. package/resultsetTable/Icons.js +51 -0
  67. package/resultsetTable/ResultsetTable.js +48 -107
  68. package/resultsetTable/ResultsetTable.stories.tsx +50 -25
  69. package/resultsetTable/ResultsetTable.test.js +23 -41
  70. package/resultsetTable/types.d.ts +2 -2
  71. package/select/Listbox.js +0 -1
  72. package/select/Select.js +3 -1
  73. package/select/Select.stories.tsx +2 -5
  74. package/select/Select.test.js +267 -209
  75. package/slider/Slider.d.ts +2 -2
  76. package/slider/Slider.js +118 -93
  77. package/slider/Slider.stories.tsx +7 -1
  78. package/slider/Slider.test.js +87 -24
  79. package/slider/types.d.ts +6 -2
  80. package/switch/Switch.d.ts +3 -3
  81. package/switch/Switch.js +94 -83
  82. package/switch/Switch.test.js +26 -13
  83. package/switch/types.d.ts +6 -1
  84. package/table/Table.js +1 -1
  85. package/table/Table.test.js +1 -1
  86. package/tabs/Tab.d.ts +4 -0
  87. package/tabs/Tab.js +135 -0
  88. package/tabs/Tabs.js +360 -104
  89. package/tabs/Tabs.stories.tsx +74 -0
  90. package/tabs/Tabs.test.js +217 -6
  91. package/tabs/types.d.ts +14 -4
  92. package/tabs-nav/Tab.js +1 -1
  93. package/tag/Tag.js +1 -1
  94. package/text-input/Icons.d.ts +8 -0
  95. package/text-input/Icons.js +60 -0
  96. package/text-input/Suggestion.js +7 -5
  97. package/text-input/Suggestions.d.ts +4 -0
  98. package/text-input/Suggestions.js +134 -0
  99. package/text-input/TextInput.js +179 -263
  100. package/text-input/TextInput.stories.tsx +189 -181
  101. package/text-input/TextInput.test.js +639 -727
  102. package/text-input/types.d.ts +21 -2
  103. 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(cb) {
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: "Space",
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 :hover {\n background-color: ", ";\n }\n :active {\n background-color: ", ";\n }\n"])), function (props) {
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
- /// <reference types="react" />
1
+ import React from "react";
2
2
  import FileInputPropsType from "./types";
3
- declare const DxcFileInput: ({ name, mode, label, buttonLabel, dropAreaLabel, helperText, accept, minSize, maxSize, showPreview, multiple, disabled, callbackFile, value, margin, tabIndex, }: FileInputPropsType) => JSX.Element;
3
+ declare const DxcFileInput: React.ForwardRefExoticComponent<FileInputPropsType & React.RefAttributes<HTMLDivElement>>;
4
4
  export default DxcFileInput;