@dxc-technology/halstack-react 0.0.0-3216581 → 0.0.0-336cd81
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 +7 -6
- package/common/variables.js +5 -5
- 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/paginator/Paginator.js +2 -2
- package/paginator/Paginator.test.js +1 -1
- 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/resultsetTable/ResultsetTable.js +1 -3
- package/select/Listbox.js +0 -1
- package/select/Select.js +3 -1
- package/select/Select.test.js +267 -209
- package/slider/Slider.js +8 -5
- 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/accordion/types.d.ts
CHANGED
|
@@ -56,6 +56,7 @@ declare type Props = {
|
|
|
56
56
|
*/
|
|
57
57
|
margin?: Space | Margin;
|
|
58
58
|
/**
|
|
59
|
+
* @deprecated This prop will be removed shortly, consider using the Inset component for this purpose.
|
|
59
60
|
* Size of the padding to be applied to the custom area ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
|
|
60
61
|
* You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different padding sizes.
|
|
61
62
|
*/
|
|
@@ -31,6 +31,7 @@ export declare type AccordionPropsType = {
|
|
|
31
31
|
*/
|
|
32
32
|
disabled?: boolean;
|
|
33
33
|
/**
|
|
34
|
+
* @deprecated This prop will be removed shortly, consider using the Inset component for this purpose.
|
|
34
35
|
* Size of the padding to be applied to the custom area ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
|
|
35
36
|
* You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different padding sizes.
|
|
36
37
|
*/
|
package/alert/Alert.js
CHANGED
package/box/Box.js
CHANGED
package/box/types.d.ts
CHANGED
|
@@ -31,6 +31,7 @@ declare type Props = {
|
|
|
31
31
|
*/
|
|
32
32
|
margin?: Space | Margin;
|
|
33
33
|
/**
|
|
34
|
+
* @deprecated This prop will be removed shortly, consider using the Inset component for this purpose.
|
|
34
35
|
* Size of the padding to be applied to the custom area ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
|
|
35
36
|
* You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different padding sizes.
|
|
36
37
|
*/
|
package/card/types.d.ts
CHANGED
|
@@ -47,6 +47,7 @@ declare type Props = {
|
|
|
47
47
|
*/
|
|
48
48
|
margin?: Space | Size;
|
|
49
49
|
/**
|
|
50
|
+
* @deprecated This prop will be removed shortly, consider using the Inset component for this purpose.
|
|
50
51
|
* Size of the padding to be applied to the content area ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
|
|
51
52
|
* You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different padding sizes.
|
|
52
53
|
*/
|
package/checkbox/Checkbox.js
CHANGED
|
@@ -85,7 +85,7 @@ var DxcCheckbox = function DxcCheckbox(_ref) {
|
|
|
85
85
|
var handleCheckboxChange = function handleCheckboxChange() {
|
|
86
86
|
var _checkboxRef$current;
|
|
87
87
|
|
|
88
|
-
|
|
88
|
+
document.activeElement !== (checkboxRef === null || checkboxRef === void 0 ? void 0 : checkboxRef.current) && (checkboxRef === null || checkboxRef === void 0 ? void 0 : (_checkboxRef$current = checkboxRef.current) === null || _checkboxRef$current === void 0 ? void 0 : _checkboxRef$current.focus());
|
|
89
89
|
var newChecked = checked !== null && checked !== void 0 ? checked : innerChecked;
|
|
90
90
|
checked !== null && checked !== void 0 ? checked : setInnerChecked(function (innerChecked) {
|
|
91
91
|
return !innerChecked;
|
|
@@ -96,7 +96,6 @@ var DxcCheckbox = function DxcCheckbox(_ref) {
|
|
|
96
96
|
var handleKeyboard = function handleKeyboard(event) {
|
|
97
97
|
switch (event.key) {
|
|
98
98
|
case " ":
|
|
99
|
-
case "Space":
|
|
100
99
|
event.preventDefault();
|
|
101
100
|
handleCheckboxChange();
|
|
102
101
|
}
|
|
@@ -115,7 +114,7 @@ var DxcCheckbox = function DxcCheckbox(_ref) {
|
|
|
115
114
|
id: labelId,
|
|
116
115
|
disabled: disabled,
|
|
117
116
|
backgroundType: backgroundType
|
|
118
|
-
}, label, optional &&
|
|
117
|
+
}, label, optional && " ".concat(translatedLabels.formFields.optionalLabel)), /*#__PURE__*/_react["default"].createElement(ValueInput, {
|
|
119
118
|
type: "checkbox",
|
|
120
119
|
checked: checked !== null && checked !== void 0 ? checked : innerChecked,
|
|
121
120
|
name: name,
|
|
@@ -139,7 +138,7 @@ var DxcCheckbox = function DxcCheckbox(_ref) {
|
|
|
139
138
|
id: labelId,
|
|
140
139
|
disabled: disabled,
|
|
141
140
|
backgroundType: backgroundType
|
|
142
|
-
}, optional &&
|
|
141
|
+
}, optional && "".concat(translatedLabels.formFields.optionalLabel, " "), label)));
|
|
143
142
|
};
|
|
144
143
|
|
|
145
144
|
var sizes = {
|
|
@@ -147,7 +146,7 @@ var sizes = {
|
|
|
147
146
|
medium: "240px",
|
|
148
147
|
large: "480px",
|
|
149
148
|
fillParent: "100%",
|
|
150
|
-
fitContent: "
|
|
149
|
+
fitContent: "fit-content"
|
|
151
150
|
};
|
|
152
151
|
|
|
153
152
|
var calculateWidth = function calculateWidth(margin, size) {
|
|
@@ -210,7 +209,7 @@ var ValueInput = _styledComponents["default"].input(_templateObject2 || (_templa
|
|
|
210
209
|
|
|
211
210
|
var CheckboxContainer = _styledComponents["default"].span(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n align-items: center;\n justify-content: center;\n height: 24px;\n width: 24px;\n"])));
|
|
212
211
|
|
|
213
|
-
var Checkbox = _styledComponents["default"].span(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n box-sizing: border-box;\n display: flex;\n align-items: center;\n justify-content: center;\n height: 18px;\n width: 18px;\n border
|
|
212
|
+
var Checkbox = _styledComponents["default"].span(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n box-sizing: border-box;\n display: flex;\n align-items: center;\n justify-content: center;\n height: 18px;\n width: 18px;\n border: solid 2px\n ", ";\n border-radius: 2px;\n background-color: ", ";\n color: ", ";\n\n &:focus {\n outline: 2px solid\n ", ";\n outline-offset: 2px;\n }\n svg {\n position: absolute;\n width: 22px;\n height: 22px;\n }\n ", "\n"])), function (props) {
|
|
214
213
|
return props.disabled ? getDisabledColor(props, "border") : getNotDisabledColor(props, "border");
|
|
215
214
|
}, function (props) {
|
|
216
215
|
return props.checked ? props.disabled ? getDisabledColor(props, "check") : getNotDisabledColor(props, "check") : "transparent";
|
|
@@ -218,6 +217,8 @@ var Checkbox = _styledComponents["default"].span(_templateObject4 || (_templateO
|
|
|
218
217
|
return props.disabled ? getDisabledColor(props, "background") : getNotDisabledColor(props, "background");
|
|
219
218
|
}, function (props) {
|
|
220
219
|
return props.backgroundType === "dark" ? props.theme.focusColorOnDark : props.theme.focusColor;
|
|
220
|
+
}, function (props) {
|
|
221
|
+
return props.disabled && "pointer-events: none;";
|
|
221
222
|
});
|
|
222
223
|
|
|
223
224
|
var MainContainer = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n width: ", ";\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n\n display: inline-flex;\n align-items: center;\n cursor: ", ";\n gap: ", ";\n\n &:hover ", " {\n border: 2px solid\n ", ";\n background-color: ", ";\n color: ", ";\n }\n"])), function (props) {
|
package/common/variables.js
CHANGED
|
@@ -763,13 +763,13 @@ var componentTokens = {
|
|
|
763
763
|
fontTextTransform: "none",
|
|
764
764
|
verticalPadding: "0.75rem",
|
|
765
765
|
horizontalPadding: "2rem",
|
|
766
|
-
marginRight: "
|
|
767
|
-
marginLeft: "
|
|
766
|
+
marginRight: "40px",
|
|
767
|
+
marginLeft: "20px",
|
|
768
768
|
itemsPerPageSelectorMarginLeft: "0px",
|
|
769
|
-
itemsPerPageSelectorMarginRight: "
|
|
769
|
+
itemsPerPageSelectorMarginRight: "0.5rem",
|
|
770
770
|
pageSelectorMarginRight: "30px",
|
|
771
771
|
pageSelectorMarginLeft: "0px",
|
|
772
|
-
totalItemsContainerMarginRight: "
|
|
772
|
+
totalItemsContainerMarginRight: "2.5rem",
|
|
773
773
|
totalItemsContainerMarginLeft: "0px"
|
|
774
774
|
},
|
|
775
775
|
progressBar: {
|
|
@@ -1462,7 +1462,7 @@ var defaultTranslatedComponentLabels = {
|
|
|
1462
1462
|
incrementValueTitle: "Increment value"
|
|
1463
1463
|
},
|
|
1464
1464
|
paginator: {
|
|
1465
|
-
itemsPerPageText: "Items per page ",
|
|
1465
|
+
itemsPerPageText: "Items per page: ",
|
|
1466
1466
|
minToMaxOfText: function minToMaxOfText(minNumberOfItems, maxNumberOfItems, totalItems) {
|
|
1467
1467
|
return "".concat(minNumberOfItems, " to ").concat(maxNumberOfItems, " of ").concat(totalItems);
|
|
1468
1468
|
},
|
package/dialog/Dialog.js
CHANGED
|
@@ -108,7 +108,7 @@ var Overlay = _styledComponents["default"].div(_templateObject3 || (_templateObj
|
|
|
108
108
|
return props.theme.overlayOpacity;
|
|
109
109
|
});
|
|
110
110
|
|
|
111
|
-
var Dialog = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n justify-content: space-between;\n z-index: 1300;\n background-color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-weight: ", ";\n ", "\n box-sizing: border-box;\n box-shadow: ", ";\n border-radius: 4px;\n\n @media (min-width: ", "rem) {\n max-width: 80%;\n min-width: 800px;\n }\n\n @media (max-width: ", "rem) {\n //mobile phones\n max-width: 92%;\n min-width: 92%;\n }\n"])), function (props) {
|
|
111
|
+
var Dialog = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n justify-content: space-between;\n z-index: 1300;\n background-color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-weight: ", ";\n ", "\n box-sizing: border-box;\n box-shadow: ", ";\n border-radius: 4px;\n position: relative;\n\n @media (min-width: ", "rem) {\n max-width: 80%;\n min-width: 800px;\n }\n\n @media (max-width: ", "rem) {\n //mobile phones\n max-width: 92%;\n min-width: 92%;\n }\n"])), function (props) {
|
|
112
112
|
return props.theme.backgroundColor;
|
|
113
113
|
}, function (props) {
|
|
114
114
|
return props.theme.fontFamily;
|
|
@@ -117,12 +117,12 @@ var Dialog = _styledComponents["default"].div(_templateObject4 || (_templateObje
|
|
|
117
117
|
}, function (props) {
|
|
118
118
|
return props.theme.fontWeight;
|
|
119
119
|
}, function (props) {
|
|
120
|
-
return props.isCloseVisible && "min-height: 72px;";
|
|
120
|
+
return props.isCloseVisible && "min-height: 72px; padding-top: 24px;";
|
|
121
121
|
}, function (props) {
|
|
122
122
|
return "".concat(props.theme.boxShadowOffsetX, " ").concat(props.theme.boxShadowOffsetY, " ").concat(props.theme.boxShadowBlur, " ").concat(props.theme.boxShadowColor);
|
|
123
123
|
}, _variables.responsiveSizes.medium, _variables.responsiveSizes.medium);
|
|
124
124
|
|
|
125
|
-
var Children = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: column;\n
|
|
125
|
+
var Children = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: column;\n width: 100%;\n padding: ", ";\n padding-top: ", ";\n padding-right: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n"])), function (props) {
|
|
126
126
|
return props.padding && (0, _typeof2["default"])(props.padding) !== "object" ? _variables.spaces[props.padding] : _variables.spaces["small"];
|
|
127
127
|
}, function (props) {
|
|
128
128
|
return props.padding && (0, _typeof2["default"])(props.padding) === "object" && props.padding.top ? _variables.spaces[props.padding.top] : "";
|
|
@@ -134,7 +134,7 @@ var Children = _styledComponents["default"].div(_templateObject5 || (_templateOb
|
|
|
134
134
|
return props.padding && (0, _typeof2["default"])(props.padding) === "object" && props.padding.left ? _variables.spaces[props.padding.left] : "";
|
|
135
135
|
});
|
|
136
136
|
|
|
137
|
-
var CloseIconContainer = _styledComponents["default"].button(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n cursor: pointer;\n padding: 0;\n margin: 0;\n background: none;\n border: none;\n position:
|
|
137
|
+
var CloseIconContainer = _styledComponents["default"].button(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n cursor: pointer;\n padding: 0;\n margin: 0;\n background: none;\n border: none;\n position: absolute;\n top: 20px;\n right: 20px;\n color: ", ";\n width: ", ";\n height: ", ";\n"])), function (props) {
|
|
138
138
|
return props.theme.closeIconColor;
|
|
139
139
|
}, function (props) {
|
|
140
140
|
return props.theme.closeIconWidth;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import DxcDialog from "./Dialog";
|
|
3
|
+
import DxcTextInput from "../text-input/TextInput";
|
|
4
|
+
import DxcButton from "../button/Button";
|
|
5
|
+
import DxcFlex from "../flex/Flex";
|
|
6
|
+
import DxcInset from "../inset/Inset";
|
|
3
7
|
import Title from "../../.storybook/components/Title";
|
|
4
8
|
import ExampleContainer from "../../.storybook/components/ExampleContainer";
|
|
5
9
|
|
|
@@ -30,6 +34,50 @@ export const DefaultDialog = () => (
|
|
|
30
34
|
</>
|
|
31
35
|
);
|
|
32
36
|
|
|
37
|
+
export const DialogWithInputs = () => (
|
|
38
|
+
<>
|
|
39
|
+
<ExampleContainer expanded={true}>
|
|
40
|
+
<Title title="Dialog with inputs" theme="light" level={4} />
|
|
41
|
+
<DxcDialog>
|
|
42
|
+
<DxcInset bottom="1rem">
|
|
43
|
+
<DxcFlex gap="2rem" direction="column">
|
|
44
|
+
<DxcFlex gap="1rem" direction="column">
|
|
45
|
+
<DxcTextInput size="fillParent" label="Name"></DxcTextInput>
|
|
46
|
+
<DxcTextInput size="fillParent" label="Surname"></DxcTextInput>
|
|
47
|
+
</DxcFlex>
|
|
48
|
+
<DxcFlex justifyContent="flex-end" gap="1rem">
|
|
49
|
+
<DxcButton label="Save"></DxcButton>
|
|
50
|
+
<DxcButton label="Cancel" mode="secondary"></DxcButton>
|
|
51
|
+
</DxcFlex>
|
|
52
|
+
</DxcFlex>
|
|
53
|
+
</DxcInset>
|
|
54
|
+
</DxcDialog>
|
|
55
|
+
</ExampleContainer>
|
|
56
|
+
</>
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
const RespDialog = () => (
|
|
60
|
+
<>
|
|
61
|
+
<ExampleContainer expanded={true}>
|
|
62
|
+
<Title title="Responsive dialog" theme="light" level={4} />
|
|
63
|
+
<DxcDialog>
|
|
64
|
+
<DxcInset bottom="1rem">
|
|
65
|
+
<DxcFlex gap="2rem" direction="column">
|
|
66
|
+
<DxcFlex gap="1rem" direction="column">
|
|
67
|
+
<DxcTextInput size="fillParent" label="Name"></DxcTextInput>
|
|
68
|
+
<DxcTextInput size="fillParent" label="Surname"></DxcTextInput>
|
|
69
|
+
</DxcFlex>
|
|
70
|
+
<DxcFlex justifyContent="flex-end" gap="1rem">
|
|
71
|
+
<DxcButton label="Save"></DxcButton>
|
|
72
|
+
<DxcButton label="Cancel" mode="secondary"></DxcButton>
|
|
73
|
+
</DxcFlex>
|
|
74
|
+
</DxcFlex>
|
|
75
|
+
</DxcInset>
|
|
76
|
+
</DxcDialog>
|
|
77
|
+
</ExampleContainer>
|
|
78
|
+
</>
|
|
79
|
+
);
|
|
80
|
+
|
|
33
81
|
export const DialogWithoutOverlay = () => (
|
|
34
82
|
<ExampleContainer expanded={true}>
|
|
35
83
|
<Title title="Dialog Without Overlay" theme="light" level={4} />
|
|
@@ -209,3 +257,11 @@ export const DialogWithXxlargePadding = () => (
|
|
|
209
257
|
</DxcDialog>
|
|
210
258
|
</ExampleContainer>
|
|
211
259
|
);
|
|
260
|
+
|
|
261
|
+
export const ResponsiveDialog = RespDialog.bind({});
|
|
262
|
+
ResponsiveDialog.parameters = {
|
|
263
|
+
viewport: {
|
|
264
|
+
defaultViewport: "iphonex",
|
|
265
|
+
},
|
|
266
|
+
chromatic: { viewports: [375] },
|
|
267
|
+
};
|
package/dialog/types.d.ts
CHANGED
|
@@ -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.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-336cd81",
|
|
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",
|
package/paginator/Paginator.js
CHANGED
|
@@ -153,7 +153,7 @@ var ItemsPageContainer = _styledComponents["default"].span(_templateObject3 || (
|
|
|
153
153
|
|
|
154
154
|
var ItemsLabel = _styledComponents["default"].span(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n margin-right: 0.5rem;\n"])));
|
|
155
155
|
|
|
156
|
-
var GoToLabel = _styledComponents["default"].span(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n margin-right: 0.5rem;\n margin-left:
|
|
156
|
+
var GoToLabel = _styledComponents["default"].span(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n margin-right: 0.5rem;\n margin-left: 0.5rem;\n"])));
|
|
157
157
|
|
|
158
158
|
var TotalItemsContainer = _styledComponents["default"].span(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n margin-right: ", ";\n margin-left: ", ";\n"])), function (props) {
|
|
159
159
|
return props.theme.totalItemsContainerMarginRight;
|
|
@@ -163,7 +163,7 @@ var TotalItemsContainer = _styledComponents["default"].span(_templateObject6 ||
|
|
|
163
163
|
|
|
164
164
|
var LabelsContainer = _styledComponents["default"].div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n gap: 0.5rem;\n width: 100%;\n justify-content: flex-end;\n align-items: center;\n"])));
|
|
165
165
|
|
|
166
|
-
var PageToSelectContainer = _styledComponents["default"].span(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n align-items: center;\n\n label {\n height: 0px;\n }\n label + .MuiInput-formControl {\n margin-top: 0px;\n }\n"])));
|
|
166
|
+
var PageToSelectContainer = _styledComponents["default"].span(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n align-items: center;\n margin-right: 0.5rem;\n\n label {\n height: 0px;\n }\n label + .MuiInput-formControl {\n margin-top: 0px;\n }\n"])));
|
|
167
167
|
|
|
168
168
|
var TextContainer = _styledComponents["default"].span(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2["default"])([""])));
|
|
169
169
|
|
|
@@ -77,7 +77,7 @@ describe("Paginator component tests", function () {
|
|
|
77
77
|
})),
|
|
78
78
|
getByText = _render3.getByText;
|
|
79
79
|
|
|
80
|
-
expect(getByText("Items per page")).toBeTruthy();
|
|
80
|
+
expect(getByText("Items per page:")).toBeTruthy();
|
|
81
81
|
});
|
|
82
82
|
test("Paginator renders with itemsPerPageOptions", function () {
|
|
83
83
|
var _render4 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Paginator["default"], {
|
|
@@ -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 = {
|