@dxc-technology/halstack-react 0.0.0-a799608 → 0.0.0-a7fec42
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 -0
- package/accordion-group/types.d.ts +1 -0
- 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.js +87 -95
- package/checkbox/Checkbox.test.js +93 -16
- package/checkbox/types.d.ts +2 -2
- package/common/variables.js +1 -1
- package/dialog/Dialog.js +4 -4
- package/dialog/Dialog.stories.tsx +56 -0
- package/dialog/types.d.ts +1 -0
- package/dropdown/Dropdown.js +6 -5
- package/dropdown/Dropdown.test.js +2 -3
- package/dropdown/DropdownMenuItem.js +1 -1
- package/flex/Flex.d.ts +1 -1
- package/flex/Flex.js +31 -19
- package/flex/types.d.ts +14 -3
- package/footer/types.d.ts +1 -0
- package/header/types.d.ts +1 -0
- package/number-input/NumberInput.test.js +1 -1
- package/package.json +6 -6
- package/password-input/PasswordInput.js +4 -2
- 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/select/Listbox.js +0 -1
- package/select/Select.js +3 -1
- package/select/Select.test.js +267 -209
- package/slider/Slider.js +15 -6
- package/switch/Switch.js +91 -81
- package/switch/Switch.test.js +26 -13
- package/table/Table.js +1 -1
- 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 +171 -259
- package/text-input/TextInput.stories.tsx +189 -181
- package/text-input/TextInput.test.js +165 -163
- package/text-input/types.d.ts +23 -4
package/dropdown/Dropdown.js
CHANGED
|
@@ -146,7 +146,7 @@ var DxcDropdown = function DxcDropdown(_ref) {
|
|
|
146
146
|
handleOnOpenMenu();
|
|
147
147
|
break;
|
|
148
148
|
|
|
149
|
-
case "
|
|
149
|
+
case " ":
|
|
150
150
|
case "Down":
|
|
151
151
|
case "ArrowDown":
|
|
152
152
|
case "Enter":
|
|
@@ -186,7 +186,7 @@ var DxcDropdown = function DxcDropdown(_ref) {
|
|
|
186
186
|
setNextIndexFocus();
|
|
187
187
|
break;
|
|
188
188
|
|
|
189
|
-
case "
|
|
189
|
+
case " ":
|
|
190
190
|
case "Enter":
|
|
191
191
|
event.preventDefault();
|
|
192
192
|
handleMenuItemOnClick(options[visualFocusIndex].value);
|
|
@@ -254,7 +254,8 @@ var DxcDropdown = function DxcDropdown(_ref) {
|
|
|
254
254
|
}, /*#__PURE__*/_react["default"].createElement(Popover.Root, {
|
|
255
255
|
open: isOpen
|
|
256
256
|
}, /*#__PURE__*/_react["default"].createElement(Popover.Trigger, {
|
|
257
|
-
asChild: true
|
|
257
|
+
asChild: true,
|
|
258
|
+
type: undefined
|
|
258
259
|
}, /*#__PURE__*/_react["default"].createElement(DropdownTrigger, {
|
|
259
260
|
opened: isOpen,
|
|
260
261
|
onClick: handleTriggerOnClick,
|
|
@@ -267,8 +268,8 @@ var DxcDropdown = function DxcDropdown(_ref) {
|
|
|
267
268
|
margin: margin,
|
|
268
269
|
size: size,
|
|
269
270
|
id: triggerId,
|
|
270
|
-
"aria-disabled": disabled,
|
|
271
271
|
"aria-haspopup": "true",
|
|
272
|
+
"aria-controls": menuId,
|
|
272
273
|
"aria-expanded": isOpen ? true : undefined,
|
|
273
274
|
tabIndex: tabIndex,
|
|
274
275
|
ref: triggerRef
|
|
@@ -302,7 +303,7 @@ var sizes = {
|
|
|
302
303
|
medium: "240px",
|
|
303
304
|
large: "480px",
|
|
304
305
|
fillParent: "100%",
|
|
305
|
-
fitContent: "
|
|
306
|
+
fitContent: "fit-content"
|
|
306
307
|
};
|
|
307
308
|
|
|
308
309
|
var calculateWidth = function calculateWidth(margin, size) {
|
|
@@ -74,7 +74,6 @@ describe("Dropdown component tests", function () {
|
|
|
74
74
|
getByRole = _render.getByRole;
|
|
75
75
|
|
|
76
76
|
var dropdown = getByRole("button");
|
|
77
|
-
expect(dropdown.getAttribute("aria-disabled")).toBe("false");
|
|
78
77
|
expect(dropdown.getAttribute("aria-haspopup")).toBe("true");
|
|
79
78
|
expect(dropdown.getAttribute("aria-expanded")).toBeNull();
|
|
80
79
|
expect(dropdown.getAttribute("aria-activedescendant")).toBeNull();
|
|
@@ -82,6 +81,7 @@ describe("Dropdown component tests", function () {
|
|
|
82
81
|
_userEvent["default"].click(dropdown);
|
|
83
82
|
|
|
84
83
|
var menu = getByRole("menu");
|
|
84
|
+
expect(dropdown.getAttribute("aria-controls")).toBe(menu.id);
|
|
85
85
|
expect(dropdown.getAttribute("aria-expanded")).toBe("true");
|
|
86
86
|
expect(menu.getAttribute("aria-activedescendant")).toBe("option-0");
|
|
87
87
|
expect(menu.getAttribute("aria-orientation")).toBe("vertical");
|
|
@@ -123,7 +123,6 @@ describe("Dropdown component tests", function () {
|
|
|
123
123
|
queryByText = _render3.queryByText;
|
|
124
124
|
|
|
125
125
|
var dropdown = getByRole("button");
|
|
126
|
-
expect(dropdown.getAttribute("aria-disabled")).toBe("true");
|
|
127
126
|
expect(queryByRole("menu")).toBeFalsy();
|
|
128
127
|
|
|
129
128
|
_userEvent["default"].click(dropdown);
|
|
@@ -267,7 +266,7 @@ describe("Dropdown component tests", function () {
|
|
|
267
266
|
var dropdown = getByRole("button");
|
|
268
267
|
|
|
269
268
|
_react2.fireEvent.keyDown(dropdown, {
|
|
270
|
-
key: "
|
|
269
|
+
key: " ",
|
|
271
270
|
code: "Space",
|
|
272
271
|
keyCode: 32,
|
|
273
272
|
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;
|
package/flex/Flex.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import FlexPropsType from "./types";
|
|
3
|
-
declare const DxcFlex: ({ children, ...props }: FlexPropsType) => JSX.Element;
|
|
3
|
+
declare const DxcFlex: ({ direction, wrap, gap, order, grow, shrink, basis, children, ...props }: FlexPropsType) => JSX.Element;
|
|
4
4
|
export default DxcFlex;
|
package/flex/Flex.js
CHANGED
|
@@ -11,6 +11,8 @@ var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
|
11
11
|
|
|
12
12
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
13
13
|
|
|
14
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
15
|
+
|
|
14
16
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
15
17
|
|
|
16
18
|
var _react = _interopRequireDefault(require("react"));
|
|
@@ -19,20 +21,39 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
|
19
21
|
|
|
20
22
|
var _templateObject;
|
|
21
23
|
|
|
22
|
-
var _excluded = ["children"]
|
|
24
|
+
var _excluded = ["direction", "wrap", "gap", "order", "grow", "shrink", "basis", "children"],
|
|
25
|
+
_excluded2 = ["justifyContent", "alignItems", "alignContent", "alignSelf"];
|
|
23
26
|
|
|
24
27
|
var DxcFlex = function DxcFlex(_ref) {
|
|
25
|
-
var
|
|
28
|
+
var _ref$direction = _ref.direction,
|
|
29
|
+
direction = _ref$direction === void 0 ? "row" : _ref$direction,
|
|
30
|
+
_ref$wrap = _ref.wrap,
|
|
31
|
+
wrap = _ref$wrap === void 0 ? "nowrap" : _ref$wrap,
|
|
32
|
+
_ref$gap = _ref.gap,
|
|
33
|
+
gap = _ref$gap === void 0 ? "0" : _ref$gap,
|
|
34
|
+
_ref$order = _ref.order,
|
|
35
|
+
order = _ref$order === void 0 ? 0 : _ref$order,
|
|
36
|
+
_ref$grow = _ref.grow,
|
|
37
|
+
grow = _ref$grow === void 0 ? 0 : _ref$grow,
|
|
38
|
+
_ref$shrink = _ref.shrink,
|
|
39
|
+
shrink = _ref$shrink === void 0 ? 1 : _ref$shrink,
|
|
40
|
+
_ref$basis = _ref.basis,
|
|
41
|
+
basis = _ref$basis === void 0 ? "auto" : _ref$basis,
|
|
42
|
+
children = _ref.children,
|
|
26
43
|
props = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
|
|
27
|
-
return /*#__PURE__*/_react["default"].createElement(Flex,
|
|
44
|
+
return /*#__PURE__*/_react["default"].createElement(Flex, (0, _extends2["default"])({
|
|
45
|
+
$direction: direction,
|
|
46
|
+
$wrap: wrap,
|
|
47
|
+
$order: order,
|
|
48
|
+
$grow: grow,
|
|
49
|
+
$shrink: shrink,
|
|
50
|
+
$basis: basis,
|
|
51
|
+
$gap: gap
|
|
52
|
+
}, props), children);
|
|
28
53
|
};
|
|
29
54
|
|
|
30
55
|
var Flex = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n ", "\n"])), function (_ref2) {
|
|
31
|
-
var _ref2$
|
|
32
|
-
direction = _ref2$direction === void 0 ? "row" : _ref2$direction,
|
|
33
|
-
_ref2$wrap = _ref2.wrap,
|
|
34
|
-
wrap = _ref2$wrap === void 0 ? "nowrap" : _ref2$wrap,
|
|
35
|
-
_ref2$justifyContent = _ref2.justifyContent,
|
|
56
|
+
var _ref2$justifyContent = _ref2.justifyContent,
|
|
36
57
|
justifyContent = _ref2$justifyContent === void 0 ? "flex-start" : _ref2$justifyContent,
|
|
37
58
|
_ref2$alignItems = _ref2.alignItems,
|
|
38
59
|
alignItems = _ref2$alignItems === void 0 ? "stretch" : _ref2$alignItems,
|
|
@@ -40,17 +61,8 @@ var Flex = _styledComponents["default"].div(_templateObject || (_templateObject
|
|
|
40
61
|
alignContent = _ref2$alignContent === void 0 ? "normal" : _ref2$alignContent,
|
|
41
62
|
_ref2$alignSelf = _ref2.alignSelf,
|
|
42
63
|
alignSelf = _ref2$alignSelf === void 0 ? "auto" : _ref2$alignSelf,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
_ref2$order = _ref2.order,
|
|
46
|
-
order = _ref2$order === void 0 ? 0 : _ref2$order,
|
|
47
|
-
_ref2$grow = _ref2.grow,
|
|
48
|
-
grow = _ref2$grow === void 0 ? 0 : _ref2$grow,
|
|
49
|
-
_ref2$shrink = _ref2.shrink,
|
|
50
|
-
shrink = _ref2$shrink === void 0 ? 1 : _ref2$shrink,
|
|
51
|
-
_ref2$basis = _ref2.basis,
|
|
52
|
-
basis = _ref2$basis === void 0 ? "auto" : _ref2$basis;
|
|
53
|
-
return "\n flex-direction: ".concat(direction, "; \n flex-wrap: ").concat(wrap, "; \n justify-content: ").concat(justifyContent, "; \n align-items: ").concat(alignItems, ";\n align-content: ").concat(alignContent, ";\n align-self: ").concat(alignSelf, ";\n gap: ").concat((0, _typeof2["default"])(gap) === "object" ? "".concat(gap.rowGap, " ").concat(gap.columnGap) : gap, ";\n order: ").concat(order, ";\n flex-grow: ").concat(grow, ";\n flex-shrink: ").concat(shrink, ";\n flex-basis: ").concat(basis, ";\n ");
|
|
64
|
+
props = (0, _objectWithoutProperties2["default"])(_ref2, _excluded2);
|
|
65
|
+
return "\n flex-direction: ".concat(props.$direction, "; \n flex-wrap: ").concat(props.$wrap, "; \n justify-content: ").concat(justifyContent, "; \n align-items: ").concat(alignItems, ";\n align-content: ").concat(alignContent, ";\n align-self: ").concat(alignSelf, ";\n gap: ").concat((0, _typeof2["default"])(props.$gap) === "object" ? "".concat(props.$gap.rowGap, " ").concat(props.$gap.columnGap) : props.$gap, ";\n order: ").concat(props.$order, ";\n flex-grow: ").concat(props.$grow, ";\n flex-shrink: ").concat(props.$shrink, ";\n flex-basis: ").concat(props.$basis, ";\n ");
|
|
54
66
|
});
|
|
55
67
|
|
|
56
68
|
var _default = DxcFlex;
|
package/flex/types.d.ts
CHANGED
|
@@ -3,13 +3,15 @@ declare type Gap = {
|
|
|
3
3
|
rowGap: string;
|
|
4
4
|
columnGap: string;
|
|
5
5
|
};
|
|
6
|
-
declare type
|
|
7
|
-
direction?: "row" | "row-reverse" | "column" | "column-reverse";
|
|
8
|
-
wrap?: "nowrap" | "wrap" | "wrap-reverse";
|
|
6
|
+
declare type CommonProps = {
|
|
9
7
|
justifyContent?: "flex-start" | "flex-end" | "start" | "end" | "left" | "right" | "center" | "space-between" | "space-around" | "space-evenly";
|
|
10
8
|
alignItems?: "stretch" | "flex-start" | "flex-end" | "start" | "end" | "self-start" | "self-end" | "center" | "baseline";
|
|
11
9
|
alignContent?: "normal" | "flex-start" | "flex-end" | "start" | "end" | "center" | "space-between" | "space-around" | "space-evenly" | "stretch";
|
|
12
10
|
alignSelf?: "auto" | "flex-start" | "flex-end" | "center" | "baseline" | "stretch";
|
|
11
|
+
};
|
|
12
|
+
declare type Props = CommonProps & {
|
|
13
|
+
direction?: "row" | "row-reverse" | "column" | "column-reverse";
|
|
14
|
+
wrap?: "nowrap" | "wrap" | "wrap-reverse";
|
|
13
15
|
gap?: string | Gap;
|
|
14
16
|
order?: number;
|
|
15
17
|
grow?: number;
|
|
@@ -18,4 +20,13 @@ declare type Props = {
|
|
|
18
20
|
as?: keyof HTMLElementTagNameMap;
|
|
19
21
|
children: React.ReactNode;
|
|
20
22
|
};
|
|
23
|
+
export declare type StyledProps = CommonProps & {
|
|
24
|
+
$direction?: "row" | "row-reverse" | "column" | "column-reverse";
|
|
25
|
+
$wrap?: "nowrap" | "wrap" | "wrap-reverse";
|
|
26
|
+
$gap?: string | Gap;
|
|
27
|
+
$order?: number;
|
|
28
|
+
$grow?: number;
|
|
29
|
+
$shrink?: number;
|
|
30
|
+
$basis?: string;
|
|
31
|
+
};
|
|
21
32
|
export default Props;
|
package/footer/types.d.ts
CHANGED
|
@@ -57,6 +57,7 @@ declare type FooterPropsType = {
|
|
|
57
57
|
*/
|
|
58
58
|
margin?: Space | Size;
|
|
59
59
|
/**
|
|
60
|
+
* @deprecated This prop will be removed shortly, consider using the Inset component for this purpose.
|
|
60
61
|
* Size of the padding to be applied to the custom area of the component.
|
|
61
62
|
* You can pass an object with properties in order to specify different padding sizes.
|
|
62
63
|
*/
|
package/header/types.d.ts
CHANGED
|
@@ -32,6 +32,7 @@ declare type Props = {
|
|
|
32
32
|
*/
|
|
33
33
|
margin?: Space;
|
|
34
34
|
/**
|
|
35
|
+
* @deprecated This prop will be removed shortly, consider using the Inset component for this purpose.
|
|
35
36
|
* Size of the padding to be applied to the custom area of the component
|
|
36
37
|
* ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
|
|
37
38
|
* You can pass an object with 'top', 'bottom', 'left' and 'right' properties in
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxc-technology/halstack-react",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-a7fec42",
|
|
4
4
|
"description": "DXC Halstack React components library",
|
|
5
5
|
"repository": "dxc-technology/halstack-react",
|
|
6
6
|
"homepage": "https://developer.dxc.com/halstack",
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
"main": "./main.js",
|
|
14
14
|
"types": "./main.d.ts",
|
|
15
15
|
"peerDependencies": {
|
|
16
|
-
"react": "^18.
|
|
17
|
-
"react-dom": "^18.
|
|
16
|
+
"react": "^18.x",
|
|
17
|
+
"react-dom": "^18.x",
|
|
18
18
|
"styled-components": "^5.0.1"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"@material-ui/lab": "4.0.0-alpha.17",
|
|
25
25
|
"@material-ui/pickers": "3.2.2",
|
|
26
26
|
"@material-ui/styles": "4.0.2",
|
|
27
|
-
"@radix-ui/react-popover": "
|
|
27
|
+
"@radix-ui/react-popover": "0.1.6",
|
|
28
28
|
"@types/styled-components": "^5.1.24",
|
|
29
29
|
"@types/uuid": "^8.3.4",
|
|
30
30
|
"color": "^3.1.3",
|
|
@@ -73,8 +73,8 @@
|
|
|
73
73
|
"eslint-plugin-storybook": "^0.5.5",
|
|
74
74
|
"identity-obj-proxy": "^3.0.0",
|
|
75
75
|
"jest": "^25.5.4",
|
|
76
|
-
"react": "^18.
|
|
77
|
-
"react-dom": "^18.
|
|
76
|
+
"react": "^18.x",
|
|
77
|
+
"react-dom": "^18.x",
|
|
78
78
|
"react-test-renderer": "^16.8.6",
|
|
79
79
|
"storybook-addon-pseudo-states": "^1.0.0",
|
|
80
80
|
"styled-components": "^5.0.1",
|
|
@@ -100,14 +100,16 @@ var DxcPasswordInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref,
|
|
|
100
100
|
}
|
|
101
101
|
}, [isPasswordVisible]);
|
|
102
102
|
|
|
103
|
-
var viewPassword = function viewPassword() {
|
|
103
|
+
var viewPassword = function viewPassword(event) {
|
|
104
104
|
setInputType("text");
|
|
105
105
|
setIsPasswordVisible(true);
|
|
106
|
+
event.preventDefault();
|
|
106
107
|
};
|
|
107
108
|
|
|
108
|
-
var hidePassword = function hidePassword() {
|
|
109
|
+
var hidePassword = function hidePassword(event) {
|
|
109
110
|
setInputType("password");
|
|
110
111
|
setIsPasswordVisible(false);
|
|
112
|
+
event.preventDefault();
|
|
111
113
|
};
|
|
112
114
|
|
|
113
115
|
var action = {
|
|
@@ -46,9 +46,9 @@ describe("Password input component tests", function () {
|
|
|
46
46
|
label: "Password input",
|
|
47
47
|
onChange: onChange
|
|
48
48
|
})),
|
|
49
|
-
|
|
49
|
+
getByLabelText = _render4.getByLabelText;
|
|
50
50
|
|
|
51
|
-
var passwordInput =
|
|
51
|
+
var passwordInput = getByLabelText("Password input");
|
|
52
52
|
|
|
53
53
|
_userEvent["default"].type(passwordInput, "Pa$$w0rd");
|
|
54
54
|
|
|
@@ -64,9 +64,9 @@ describe("Password input component tests", function () {
|
|
|
64
64
|
label: "Password input",
|
|
65
65
|
onBlur: onBlur
|
|
66
66
|
})),
|
|
67
|
-
|
|
67
|
+
getByLabelText = _render5.getByLabelText;
|
|
68
68
|
|
|
69
|
-
var passwordInput =
|
|
69
|
+
var passwordInput = getByLabelText("Password input");
|
|
70
70
|
|
|
71
71
|
_userEvent["default"].type(passwordInput, "Pa$$w0rd");
|
|
72
72
|
|
|
@@ -83,9 +83,9 @@ describe("Password input component tests", function () {
|
|
|
83
83
|
clearable: true
|
|
84
84
|
})),
|
|
85
85
|
getAllByRole = _render6.getAllByRole,
|
|
86
|
-
|
|
86
|
+
getByLabelText = _render6.getByLabelText;
|
|
87
87
|
|
|
88
|
-
var passwordInput =
|
|
88
|
+
var passwordInput = getByLabelText("Password input");
|
|
89
89
|
|
|
90
90
|
_userEvent["default"].type(passwordInput, "Pa$$w0rd");
|
|
91
91
|
|
|
@@ -101,9 +101,9 @@ describe("Password input component tests", function () {
|
|
|
101
101
|
label: "Password input"
|
|
102
102
|
})),
|
|
103
103
|
getAllByRole = _render7.getAllByRole,
|
|
104
|
-
|
|
104
|
+
getByLabelText = _render7.getByLabelText;
|
|
105
105
|
|
|
106
|
-
var passwordInput =
|
|
106
|
+
var passwordInput = getByLabelText("Password input");
|
|
107
107
|
|
|
108
108
|
_userEvent["default"].type(passwordInput, "Pa$$w0rd");
|
|
109
109
|
|
|
@@ -117,9 +117,9 @@ describe("Password input component tests", function () {
|
|
|
117
117
|
clearable: true
|
|
118
118
|
})),
|
|
119
119
|
getAllByRole = _render8.getAllByRole,
|
|
120
|
-
|
|
120
|
+
getByLabelText = _render8.getByLabelText;
|
|
121
121
|
|
|
122
|
-
var passwordInput =
|
|
122
|
+
var passwordInput = getByLabelText("Password input");
|
|
123
123
|
|
|
124
124
|
_userEvent["default"].type(passwordInput, "Pa$$w0rd");
|
|
125
125
|
|
|
@@ -164,9 +164,10 @@ describe("Password input component tests", function () {
|
|
|
164
164
|
var _render10 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_PasswordInput["default"], {
|
|
165
165
|
label: "Password input"
|
|
166
166
|
})),
|
|
167
|
-
getByRole = _render10.getByRole
|
|
167
|
+
getByRole = _render10.getByRole,
|
|
168
|
+
getByLabelText = _render10.getByLabelText;
|
|
168
169
|
|
|
169
|
-
var passwordInput =
|
|
170
|
+
var passwordInput = getByLabelText("Password input");
|
|
170
171
|
expect(passwordInput.getAttribute("aria-autocomplete")).toBeNull();
|
|
171
172
|
expect(passwordInput.getAttribute("aria-controls")).toBeNull();
|
|
172
173
|
expect(passwordInput.getAttribute("aria-expanded")).toBeNull();
|
package/quick-nav/QuickNav.js
CHANGED
|
@@ -48,13 +48,10 @@ var DxcQuickNav = function DxcQuickNav(_ref) {
|
|
|
48
48
|
}, /*#__PURE__*/_react["default"].createElement(_Heading["default"], {
|
|
49
49
|
level: 4,
|
|
50
50
|
text: title || translatedLabels.quickNav.contentTitle
|
|
51
|
-
}), /*#__PURE__*/_react["default"].createElement(ListColumn, null,
|
|
52
|
-
direction: "column",
|
|
53
|
-
gap: "0.5rem"
|
|
54
|
-
}, links.map(function (link) {
|
|
51
|
+
}), /*#__PURE__*/_react["default"].createElement(ListColumn, null, links.map(function (link) {
|
|
55
52
|
var _link$links;
|
|
56
53
|
|
|
57
|
-
return /*#__PURE__*/_react["default"].createElement(
|
|
54
|
+
return /*#__PURE__*/_react["default"].createElement("li", {
|
|
58
55
|
key: link.label
|
|
59
56
|
}, /*#__PURE__*/_react["default"].createElement(_Inset["default"], {
|
|
60
57
|
space: "0.25rem"
|
|
@@ -62,18 +59,20 @@ var DxcQuickNav = function DxcQuickNav(_ref) {
|
|
|
62
59
|
href: "#".concat((0, _slugify["default"])(link === null || link === void 0 ? void 0 : link.label, {
|
|
63
60
|
lower: true
|
|
64
61
|
}))
|
|
65
|
-
}, link === null || link === void 0 ? void 0 : link.label), (_link$links = link.links) === null || _link$links === void 0 ? void 0 : _link$links.map(function (sublink) {
|
|
66
|
-
return /*#__PURE__*/_react["default"].createElement(
|
|
62
|
+
}, link === null || link === void 0 ? void 0 : link.label), /*#__PURE__*/_react["default"].createElement(ListSecondColumn, null, (_link$links = link.links) === null || _link$links === void 0 ? void 0 : _link$links.map(function (sublink) {
|
|
63
|
+
return /*#__PURE__*/_react["default"].createElement("li", {
|
|
67
64
|
key: sublink.label
|
|
68
65
|
}, /*#__PURE__*/_react["default"].createElement(_Inset["default"], {
|
|
69
66
|
horizontal: "0.5rem"
|
|
70
67
|
}, /*#__PURE__*/_react["default"].createElement(_Typography["default"], null, /*#__PURE__*/_react["default"].createElement(Link, {
|
|
71
|
-
href: "#".concat((0, _slugify["default"])(
|
|
68
|
+
href: "#".concat((0, _slugify["default"])(link === null || link === void 0 ? void 0 : link.label, {
|
|
69
|
+
lower: true
|
|
70
|
+
}), "-").concat((0, _slugify["default"])(sublink === null || sublink === void 0 ? void 0 : sublink.label, {
|
|
72
71
|
lower: true
|
|
73
72
|
}))
|
|
74
73
|
}, sublink === null || sublink === void 0 ? void 0 : sublink.label))));
|
|
75
|
-
}))));
|
|
76
|
-
})))))
|
|
74
|
+
})))));
|
|
75
|
+
})))));
|
|
77
76
|
};
|
|
78
77
|
|
|
79
78
|
var QuickNavContainer = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n border-left: 2px solid ", ";\n"])), function (props) {
|
|
@@ -88,9 +87,9 @@ var QuickNavContainer = _styledComponents["default"].div(_templateObject || (_te
|
|
|
88
87
|
return props.theme.dividerBorderColor;
|
|
89
88
|
});
|
|
90
89
|
|
|
91
|
-
var ListColumn = _styledComponents["default"].ul(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n
|
|
90
|
+
var ListColumn = _styledComponents["default"].ul(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n margin: 0;\n padding: 0;\n list-style-type: none;\n"])));
|
|
92
91
|
|
|
93
|
-
var
|
|
92
|
+
var ListSecondColumn = _styledComponents["default"].ul(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: column;\n margin: 0;\n padding: 0;\n list-style-type: none;\n"])));
|
|
94
93
|
|
|
95
94
|
var Link = _styledComponents["default"].a(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n text-decoration: none;\n font-size: ", ";\n font-family: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n display: block;\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n width: fit-content;\n max-width: 100%;\n\n &:hover {\n color: ", ";\n }\n &:focus {\n outline-color: ", ";\n outline-style: ", ";\n outline-width: ", ";\n border-radius: ", ";\n }\n"])), function (props) {
|
|
96
95
|
return props.theme.fontSize;
|
|
@@ -11,33 +11,60 @@ export default {
|
|
|
11
11
|
component: DxcQuickNav,
|
|
12
12
|
};
|
|
13
13
|
|
|
14
|
+
const defaultLinks = [
|
|
15
|
+
{
|
|
16
|
+
label: "Overview",
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
label: "Principles",
|
|
20
|
+
links: [{ label: "Color" }, { label: "Spacing" }, { label: "Typography" }],
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
label: "Components",
|
|
24
|
+
links: [
|
|
25
|
+
{
|
|
26
|
+
label: "Accordion",
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
label: "Button",
|
|
30
|
+
},
|
|
31
|
+
],
|
|
32
|
+
},
|
|
33
|
+
];
|
|
34
|
+
|
|
14
35
|
const links = [
|
|
15
36
|
{
|
|
16
37
|
label: "Overview",
|
|
17
|
-
id: "overview",
|
|
18
38
|
links: [
|
|
19
39
|
{
|
|
20
40
|
label: "Introduction",
|
|
21
|
-
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
label: "Components",
|
|
46
|
+
links: [
|
|
47
|
+
{
|
|
48
|
+
label: "Introduction",
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
label: "Accordion",
|
|
22
52
|
},
|
|
23
53
|
],
|
|
24
54
|
},
|
|
25
55
|
{
|
|
26
56
|
label: "Principles very very very very very very very very long",
|
|
27
|
-
id: "principles",
|
|
28
57
|
links: [
|
|
29
|
-
{ label: "Color very very very very very very very very long"
|
|
30
|
-
{ label: "Spacingveryveryveryveryveryveryveryverylong"
|
|
31
|
-
{ label: "Typography"
|
|
58
|
+
{ label: "Color very very very very very very very very long" },
|
|
59
|
+
{ label: "Spacingveryveryveryveryveryveryveryverylong" },
|
|
60
|
+
{ label: "Typography" },
|
|
32
61
|
],
|
|
33
62
|
},
|
|
34
63
|
{
|
|
35
64
|
label: "Componentsveryveryveryveryveryveryveryverylong",
|
|
36
|
-
id: "components",
|
|
37
65
|
links: [
|
|
38
66
|
{
|
|
39
67
|
label: "Accordion",
|
|
40
|
-
id: "accordion",
|
|
41
68
|
},
|
|
42
69
|
],
|
|
43
70
|
},
|
|
@@ -48,19 +75,25 @@ export const Chromatic = () => (
|
|
|
48
75
|
<ExampleContainer>
|
|
49
76
|
<Title title="Default" level={4} />
|
|
50
77
|
<QuickNavContainer>
|
|
51
|
-
<DxcQuickNav links={
|
|
78
|
+
<DxcQuickNav links={defaultLinks} />
|
|
79
|
+
</QuickNavContainer>
|
|
80
|
+
</ExampleContainer>
|
|
81
|
+
<ExampleContainer>
|
|
82
|
+
<Title title="Text overflow" level={4} />
|
|
83
|
+
<QuickNavContainer>
|
|
84
|
+
<DxcQuickNav links={links} />
|
|
52
85
|
</QuickNavContainer>
|
|
53
86
|
</ExampleContainer>
|
|
54
87
|
<ExampleContainer pseudoState="pseudo-hover">
|
|
55
88
|
<Title title="Link hovered" level={4} />
|
|
56
89
|
<QuickNavContainer>
|
|
57
|
-
<DxcQuickNav links={links}
|
|
90
|
+
<DxcQuickNav links={links} />
|
|
58
91
|
</QuickNavContainer>
|
|
59
92
|
</ExampleContainer>
|
|
60
93
|
<ExampleContainer pseudoState="pseudo-focus">
|
|
61
94
|
<Title title="Link focus" level={4} />
|
|
62
95
|
<QuickNavContainer>
|
|
63
|
-
<DxcQuickNav links={links}
|
|
96
|
+
<DxcQuickNav links={links} />
|
|
64
97
|
</QuickNavContainer>
|
|
65
98
|
</ExampleContainer>
|
|
66
99
|
<ExampleContainer>
|
|
@@ -87,7 +120,44 @@ export const Chromatic = () => (
|
|
|
87
120
|
open source design system for insurance products and digital experiences. Our system provides all the
|
|
88
121
|
tools and resources needed to create superior, beautiful but above all, functional user experiences.
|
|
89
122
|
</DxcParagraph>
|
|
90
|
-
<Content id="introduction">
|
|
123
|
+
<Content id="overview-introduction">
|
|
124
|
+
<DxcHeading level={2} text="Introduction" margin={{ top: "xsmall", bottom: "xsmall" }} />
|
|
125
|
+
<DxcParagraph>
|
|
126
|
+
Design principles Halstack design principles are the fundamental part of DXC Technology's approach to
|
|
127
|
+
provide guidance for development teams in order to deliver delightful and consistent user experiences to
|
|
128
|
+
our customers: Balance Consistency Visual hierarchy All our components, design tokens, accessibility
|
|
129
|
+
guidelines, responsive design techniques, and layout proposals have been carefully curated by DXC design
|
|
130
|
+
and engineering teams with the objective of creating a unique visual language and ecosystem for our
|
|
131
|
+
applications. This is the DXC way of creating User Experiences. Open Source Halstack is an open source
|
|
132
|
+
design system, this means that we work towards DXC Technology bussines needs, but it is open for anyone
|
|
133
|
+
to use and contribute back to. We are charmed to receive external contributions to help us find bugs,
|
|
134
|
+
design new features, or help us improve the project documentation. If you're interested, definitely
|
|
135
|
+
check out our contribution guidelines.Design principles Halstack design principles are the fundamental
|
|
136
|
+
part of DXC Technology's approach to provide guidance for development teams in order to deliver
|
|
137
|
+
delightful and consistent user experiences to our customers: Balance Consistency Visual hierarchy All
|
|
138
|
+
our components, design tokens, accessibility guidelines, responsive design techniques, and layout
|
|
139
|
+
proposals have been carefully curated by DXC design and engineering teams with the objective of creating
|
|
140
|
+
a unique visual language and ecosystem for our applications. This is the DXC way of creating User
|
|
141
|
+
Experiences. Open Source Halstack is an open source design system, this means that we work towards DXC
|
|
142
|
+
Technology bussines needs, but it is open for anyone to use and contribute back to. We are charmed to
|
|
143
|
+
receive external contributions to help us find bugs, design new features, or help us improve the project
|
|
144
|
+
documentation. If you're interested, definitely check out our contribution guidelines.Design principles
|
|
145
|
+
Halstack design principles are the fundamental part of DXC Technology's approach to provide guidance for
|
|
146
|
+
development teams in order to deliver delightful and consistent user experiences to our customers:
|
|
147
|
+
Balance Consistency Visual hierarchy All our components, design tokens, accessibility guidelines,
|
|
148
|
+
responsive design techniques, and layout proposals have been carefully curated by DXC design and
|
|
149
|
+
engineering teams with the objective of creating a unique visual language and ecosystem for our
|
|
150
|
+
applications. This is the DXC way of creating User Experiences. Open Source Halstack is an open source
|
|
151
|
+
design system, this means that we work towards DXC Technology bussines needs, but it is open for anyone
|
|
152
|
+
to use and contribute back to. We are charmed to receive external contributions to help us find bugs,
|
|
153
|
+
design new features, or help us improve the project documentation. If you're interested, definitely
|
|
154
|
+
check out our contribution guidelines.
|
|
155
|
+
</DxcParagraph>
|
|
156
|
+
</Content>
|
|
157
|
+
</Content>
|
|
158
|
+
<Content id="components">
|
|
159
|
+
<DxcHeading level={1} text="Components" margin={{ top: "small", bottom: "xsmall" }} />
|
|
160
|
+
<Content id="components-introduction">
|
|
91
161
|
<DxcHeading level={2} text="Introduction" margin={{ top: "xsmall", bottom: "xsmall" }} />
|
|
92
162
|
<DxcParagraph>
|
|
93
163
|
Design principles Halstack design principles are the fundamental part of DXC Technology's approach to
|
|
@@ -121,10 +191,18 @@ export const Chromatic = () => (
|
|
|
121
191
|
check out our contribution guidelines.
|
|
122
192
|
</DxcParagraph>
|
|
123
193
|
</Content>
|
|
194
|
+
<Content id="components-accordion">
|
|
195
|
+
<DxcHeading level={2} text="Accordion" margin={{ top: "xsmall", bottom: "xsmall" }} />
|
|
196
|
+
<DxcParagraph>
|
|
197
|
+
Accordions are used to group similar content and hide or show it depending on user needs or preferences.
|
|
198
|
+
Accordions give users more granular control over the interface and help digest content in stages, rather
|
|
199
|
+
than all at once.
|
|
200
|
+
</DxcParagraph>
|
|
201
|
+
</Content>
|
|
124
202
|
</Content>
|
|
125
|
-
<Content id="principles">
|
|
203
|
+
<Content id="principles-very-very-very-very-very-very-very-very-long">
|
|
126
204
|
<DxcHeading level={1} text="Principles" margin={{ top: "small", bottom: "xsmall" }} />
|
|
127
|
-
<Content id="color">
|
|
205
|
+
<Content id="principles-very-very-very-very-very-very-very-very-long-color-very-very-very-very-very-very-very-very-long">
|
|
128
206
|
<DxcHeading level={2} text="Color" margin={{ top: "xsmall", bottom: "xsmall" }} />
|
|
129
207
|
<DxcParagraph>
|
|
130
208
|
The color palette is an essential asset as a communication resource of our design system. Halstack color
|
|
@@ -161,7 +239,7 @@ export const Chromatic = () => (
|
|
|
161
239
|
role-based color palettes and must not be used outside this context.
|
|
162
240
|
</DxcParagraph>
|
|
163
241
|
</Content>
|
|
164
|
-
<Content id="
|
|
242
|
+
<Content id="principles-very-very-very-very-very-very-very-very-long-spacingveryveryveryveryveryveryveryverylong">
|
|
165
243
|
<DxcHeading level={2} text="Spacing" margin={{ top: "xsmall", bottom: "xsmall" }} />
|
|
166
244
|
<DxcParagraph>
|
|
167
245
|
In the search of consistent alignment between the elements we provide a spacing scale based on a root
|
|
@@ -183,7 +261,7 @@ export const Chromatic = () => (
|
|
|
183
261
|
easily multiplied, they provide flexible and consistent, yet distinct enough, steps between them.
|
|
184
262
|
</DxcParagraph>
|
|
185
263
|
</Content>
|
|
186
|
-
<Content id="typography">
|
|
264
|
+
<Content id="principles-very-very-very-very-very-very-very-very-long-typography">
|
|
187
265
|
<DxcHeading level={2} text="Typography" margin={{ top: "xsmall", bottom: "xsmall" }} />
|
|
188
266
|
<DxcParagraph>
|
|
189
267
|
Our selected typography helps in structuring our user's experience based on the visual impact that it
|
|
@@ -220,9 +298,9 @@ export const Chromatic = () => (
|
|
|
220
298
|
</DxcParagraph>
|
|
221
299
|
</Content>
|
|
222
300
|
</Content>
|
|
223
|
-
<Content id="
|
|
301
|
+
<Content id="componentsveryveryveryveryveryveryveryverylong">
|
|
224
302
|
<DxcHeading level={1} text="Components" margin={{ top: "small", bottom: "xsmall" }} />
|
|
225
|
-
<Content id="accordion">
|
|
303
|
+
<Content id="componentsveryveryveryveryveryveryveryverylong-accordion">
|
|
226
304
|
<DxcHeading level={2} text="Accordion" margin={{ top: "xsmall", bottom: "xsmall" }} />
|
|
227
305
|
<DxcParagraph>
|
|
228
306
|
Accordions are used to group similar content and hide or show it depending on user needs or preferences.
|
|
@@ -233,7 +311,7 @@ export const Chromatic = () => (
|
|
|
233
311
|
</Content>
|
|
234
312
|
</ContentContainer>
|
|
235
313
|
<QuickNavContainer>
|
|
236
|
-
<DxcQuickNav title="Sections" links={links}
|
|
314
|
+
<DxcQuickNav title="Sections" links={links} />
|
|
237
315
|
</QuickNavContainer>
|
|
238
316
|
</Container>
|
|
239
317
|
</ExampleContainer>
|
package/radio-group/Radio.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { RadioProps } from "./types";
|
|
3
|
-
declare const _default: React.MemoExoticComponent<({
|
|
3
|
+
declare const _default: React.MemoExoticComponent<({ label, checked, onClick, error, disabled, focused, readonly, tabIndex, }: RadioProps) => JSX.Element>;
|
|
4
4
|
export default _default;
|