@dxc-technology/halstack-react 0.0.0-b2237e2 → 0.0.0-b230d97
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 +55 -50
- package/accordion/Accordion.js +117 -104
- package/accordion/Accordion.stories.tsx +103 -15
- package/accordion/Accordion.test.js +9 -10
- package/accordion/types.d.ts +5 -4
- 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 +10 -3
- package/alert/Alert.js +1 -1
- package/box/Box.js +1 -1
- package/box/types.d.ts +1 -0
- package/bulleted-list/types.d.ts +1 -1
- package/button/Button.js +50 -70
- package/button/Button.stories.tsx +159 -8
- package/button/types.d.ts +7 -7
- 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 +131 -59
- package/checkbox/Checkbox.test.js +93 -16
- package/checkbox/types.d.ts +6 -2
- package/chip/Chip.js +16 -22
- package/chip/Chip.stories.tsx +96 -9
- package/chip/types.d.ts +1 -1
- package/common/variables.js +281 -259
- package/date-input/Calendar.d.ts +4 -0
- package/date-input/Calendar.js +258 -0
- package/date-input/DateInput.js +134 -237
- package/date-input/DateInput.stories.tsx +137 -38
- package/date-input/DateInput.test.js +494 -138
- package/date-input/DatePicker.d.ts +4 -0
- package/date-input/DatePicker.js +146 -0
- package/date-input/Icons.d.ts +6 -0
- package/date-input/Icons.js +75 -0
- package/date-input/YearPicker.d.ts +4 -0
- package/date-input/YearPicker.js +126 -0
- package/date-input/types.d.ts +51 -0
- package/dialog/Dialog.js +52 -28
- package/dialog/Dialog.stories.tsx +57 -2
- package/dialog/Dialog.test.js +34 -4
- package/dialog/types.d.ts +3 -2
- package/dropdown/Dropdown.d.ts +1 -1
- package/dropdown/Dropdown.js +246 -249
- package/dropdown/Dropdown.stories.tsx +245 -56
- package/dropdown/Dropdown.test.js +504 -108
- package/dropdown/DropdownMenu.d.ts +4 -0
- package/dropdown/DropdownMenu.js +70 -0
- package/dropdown/DropdownMenuItem.d.ts +4 -0
- package/dropdown/DropdownMenuItem.js +81 -0
- package/dropdown/types.d.ts +25 -5
- package/file-input/FileInput.d.ts +2 -2
- package/file-input/FileInput.js +177 -219
- package/file-input/FileInput.stories.tsx +122 -11
- 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 +15 -4
- package/footer/Footer.stories.tsx +99 -1
- package/footer/types.d.ts +2 -1
- package/header/Header.js +87 -87
- package/header/Header.stories.tsx +127 -6
- package/header/Icons.js +2 -2
- package/header/types.d.ts +3 -2
- package/layout/ApplicationLayout.js +3 -3
- package/layout/ApplicationLayout.stories.tsx +1 -0
- package/link/Link.js +1 -1
- package/link/types.d.ts +1 -1
- package/number-input/NumberInput.test.js +43 -7
- package/package.json +16 -21
- package/paginator/Icons.d.ts +5 -0
- package/paginator/Icons.js +16 -28
- package/paginator/Paginator.js +6 -12
- package/paginator/Paginator.stories.tsx +24 -0
- package/paginator/Paginator.test.js +18 -11
- package/password-input/PasswordInput.test.js +13 -12
- package/progress-bar/ProgressBar.d.ts +2 -2
- package/progress-bar/ProgressBar.js +56 -50
- package/progress-bar/ProgressBar.stories.jsx +36 -3
- package/progress-bar/ProgressBar.test.js +67 -22
- package/progress-bar/types.d.ts +3 -4
- package/quick-nav/QuickNav.js +11 -12
- package/quick-nav/QuickNav.stories.tsx +111 -19
- package/radio-group/Radio.d.ts +1 -1
- package/radio-group/Radio.js +43 -28
- package/radio-group/RadioGroup.js +24 -24
- package/radio-group/RadioGroup.stories.tsx +132 -18
- 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 +40 -63
- package/resultsetTable/types.d.ts +2 -2
- package/select/Listbox.js +4 -10
- package/select/Option.js +11 -24
- package/select/Select.js +54 -50
- package/select/Select.stories.tsx +494 -149
- package/select/Select.test.js +338 -272
- package/select/types.d.ts +3 -5
- package/sidenav/Sidenav.js +8 -10
- package/sidenav/Sidenav.stories.tsx +148 -46
- package/sidenav/types.d.ts +1 -1
- package/slider/Slider.d.ts +2 -2
- package/slider/Slider.js +120 -95
- package/slider/Slider.stories.tsx +64 -1
- package/slider/Slider.test.js +121 -21
- package/slider/types.d.ts +6 -2
- package/spinner/Spinner.js +2 -2
- package/spinner/Spinner.stories.jsx +27 -1
- package/switch/Switch.d.ts +2 -2
- package/switch/Switch.js +135 -68
- package/switch/Switch.stories.tsx +41 -30
- package/switch/Switch.test.js +144 -17
- package/switch/types.d.ts +6 -2
- package/table/Table.js +1 -1
- package/table/Table.stories.jsx +80 -1
- package/table/Table.test.js +1 -1
- package/tabs/Tab.d.ts +4 -0
- package/tabs/Tab.js +133 -0
- package/tabs/Tabs.js +360 -104
- package/tabs/Tabs.stories.tsx +119 -5
- package/tabs/Tabs.test.js +217 -6
- package/tabs/types.d.ts +15 -5
- package/tabs-nav/NavTabs.js +5 -5
- package/tabs-nav/NavTabs.stories.tsx +8 -6
- package/tabs-nav/Tab.js +8 -12
- package/tabs-nav/types.d.ts +1 -1
- package/tag/Tag.js +1 -1
- package/tag/types.d.ts +1 -1
- package/text-input/Icons.d.ts +8 -0
- package/text-input/Icons.js +60 -0
- package/text-input/Suggestion.js +38 -9
- package/text-input/Suggestions.d.ts +4 -0
- package/text-input/Suggestions.js +134 -0
- package/text-input/TextInput.js +195 -292
- package/text-input/TextInput.stories.tsx +280 -185
- package/text-input/TextInput.test.js +737 -725
- package/text-input/types.d.ts +22 -3
- package/toggle-group/ToggleGroup.stories.tsx +42 -0
- package/toggle-group/types.d.ts +1 -1
- package/wizard/Wizard.stories.tsx +20 -0
- package/wizard/types.d.ts +1 -1
- package/common/RequiredComponent.js +0 -32
package/dialog/Dialog.test.js
CHANGED
|
@@ -9,10 +9,13 @@ var _react2 = require("@testing-library/react");
|
|
|
9
9
|
var _Dialog = _interopRequireDefault(require("./Dialog"));
|
|
10
10
|
|
|
11
11
|
describe("Dialog component tests", function () {
|
|
12
|
-
test("Dialog renders with correct text", function () {
|
|
12
|
+
test("Dialog renders with correct text and accesibility attributes", function () {
|
|
13
13
|
var _render = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Dialog["default"], null, "dialog-text")),
|
|
14
|
-
getByText = _render.getByText
|
|
14
|
+
getByText = _render.getByText,
|
|
15
|
+
getByRole = _render.getByRole;
|
|
15
16
|
|
|
17
|
+
expect(getByRole("dialog")).toBeTruthy();
|
|
18
|
+
expect(getByRole("dialog").getAttribute("aria-modal")).toBe("true");
|
|
16
19
|
expect(getByText("dialog-text")).toBeTruthy();
|
|
17
20
|
});
|
|
18
21
|
test("Dialog renders without close button", function () {
|
|
@@ -23,18 +26,45 @@ describe("Dialog component tests", function () {
|
|
|
23
26
|
|
|
24
27
|
expect(queryByRole("button")).toBeFalsy();
|
|
25
28
|
});
|
|
29
|
+
test("Dialog renders with aria-modal false when overlay is not used", function () {
|
|
30
|
+
var _render3 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Dialog["default"], {
|
|
31
|
+
isCloseVisible: false,
|
|
32
|
+
overlay: false
|
|
33
|
+
}, "dialog-text")),
|
|
34
|
+
getByRole = _render3.getByRole;
|
|
35
|
+
|
|
36
|
+
expect(getByRole("dialog")).toBeTruthy();
|
|
37
|
+
expect(getByRole("dialog").getAttribute("aria-modal")).toBe("false");
|
|
38
|
+
});
|
|
26
39
|
test("Calls correct function onCloseClick", function () {
|
|
27
40
|
var onCloseClick = jest.fn();
|
|
28
41
|
|
|
29
|
-
var
|
|
42
|
+
var _render4 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Dialog["default"], {
|
|
30
43
|
onCloseClick: onCloseClick
|
|
31
44
|
}, "dialog-text")),
|
|
32
|
-
getByRole =
|
|
45
|
+
getByRole = _render4.getByRole;
|
|
33
46
|
|
|
34
47
|
var closeButton = getByRole("button");
|
|
35
48
|
|
|
36
49
|
_react2.fireEvent.click(closeButton);
|
|
37
50
|
|
|
51
|
+
expect(onCloseClick).toHaveBeenCalled();
|
|
52
|
+
});
|
|
53
|
+
test("Calls correct function onCloseClick when 'escape' key is pressed", function () {
|
|
54
|
+
var onCloseClick = jest.fn();
|
|
55
|
+
|
|
56
|
+
var _render5 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Dialog["default"], {
|
|
57
|
+
onCloseClick: onCloseClick
|
|
58
|
+
}, "dialog-text")),
|
|
59
|
+
getByRole = _render5.getByRole;
|
|
60
|
+
|
|
61
|
+
_react2.fireEvent.keyDown(getByRole("button"), {
|
|
62
|
+
key: "Escape",
|
|
63
|
+
code: "Escape",
|
|
64
|
+
keyCode: 27,
|
|
65
|
+
charCode: 27
|
|
66
|
+
});
|
|
67
|
+
|
|
38
68
|
expect(onCloseClick).toHaveBeenCalled();
|
|
39
69
|
});
|
|
40
70
|
});
|
package/dialog/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
declare type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
|
|
3
|
-
declare type Padding = {
|
|
2
|
+
export declare type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
|
|
3
|
+
export declare type Padding = {
|
|
4
4
|
top?: Space;
|
|
5
5
|
bottom?: Space;
|
|
6
6
|
left?: Space;
|
|
@@ -26,6 +26,7 @@ declare type Props = {
|
|
|
26
26
|
*/
|
|
27
27
|
onBackgroundClick?: () => void;
|
|
28
28
|
/**
|
|
29
|
+
* @deprecated This prop will be removed shortly, consider using the Inset component for this purpose.
|
|
29
30
|
* Size of the padding to be applied to the component ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
|
|
30
31
|
* You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different padding sizes.
|
|
31
32
|
*/
|
package/dropdown/Dropdown.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import DropdownPropsType from "./types";
|
|
3
|
-
declare const DxcDropdown: ({ options, optionsIconPosition, icon, iconPosition, label, caretHidden,
|
|
3
|
+
declare const DxcDropdown: ({ options, optionsIconPosition, icon, iconPosition, label, caretHidden, disabled, expandOnHover, onSelectOption, margin, size, tabIndex, }: DropdownPropsType) => JSX.Element;
|
|
4
4
|
export default DxcDropdown;
|