@dxc-technology/halstack-react 0.0.0-64fdce7 → 0.0.0-6501724
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/BackgroundColorContext.d.ts +2 -2
- package/BackgroundColorContext.js +1 -1
- package/HalstackContext.d.ts +1329 -5
- package/HalstackContext.js +113 -72
- package/accordion/Accordion.js +6 -11
- package/accordion/Accordion.stories.tsx +52 -3
- package/accordion/Accordion.test.js +1 -1
- package/accordion/types.d.ts +3 -3
- package/accordion-group/AccordionGroup.d.ts +4 -3
- package/accordion-group/AccordionGroup.js +23 -44
- package/accordion-group/AccordionGroup.test.js +1 -1
- package/accordion-group/AccordionGroupAccordion.d.ts +4 -0
- package/accordion-group/AccordionGroupAccordion.js +43 -0
- package/accordion-group/types.d.ts +2 -2
- package/alert/Alert.js +4 -8
- package/alert/Alert.stories.tsx +28 -0
- package/alert/Alert.test.js +1 -1
- package/bleed/Bleed.stories.tsx +1 -0
- package/box/Box.js +3 -5
- package/box/Box.stories.tsx +15 -0
- package/box/Box.test.js +1 -1
- package/bulleted-list/BulletedList.js +4 -2
- package/bulleted-list/BulletedList.stories.tsx +7 -1
- package/bulleted-list/types.d.ts +31 -4
- package/button/Button.js +2 -3
- package/button/Button.stories.tsx +95 -10
- package/button/Button.test.js +1 -1
- package/button/types.d.ts +3 -3
- package/card/Card.js +12 -13
- package/card/Card.stories.tsx +12 -13
- package/card/Card.test.js +1 -1
- package/checkbox/Checkbox.js +3 -3
- package/checkbox/Checkbox.stories.tsx +52 -0
- package/checkbox/Checkbox.test.js +1 -1
- package/checkbox/types.d.ts +2 -2
- package/chip/Chip.js +25 -34
- package/chip/Chip.stories.tsx +80 -17
- package/chip/Chip.test.js +3 -5
- package/common/OpenSans.css +68 -80
- package/common/coreTokens.d.ts +146 -0
- package/common/coreTokens.js +167 -0
- package/common/utils.d.ts +1 -0
- package/common/utils.js +4 -4
- package/common/variables.d.ts +1482 -0
- package/common/variables.js +962 -1123
- package/date-input/DateInput.stories.tsx +67 -0
- package/dialog/Dialog.d.ts +1 -1
- package/dialog/Dialog.js +55 -86
- package/dialog/Dialog.stories.tsx +145 -217
- package/dialog/Dialog.test.js +302 -3
- package/dialog/types.d.ts +0 -13
- package/dropdown/Dropdown.js +2 -2
- package/dropdown/Dropdown.stories.tsx +46 -1
- package/dropdown/Dropdown.test.js +3 -2
- package/dropdown/DropdownMenu.js +5 -1
- package/dropdown/DropdownMenuItem.js +0 -2
- package/dropdown/types.d.ts +3 -3
- package/file-input/FileInput.js +4 -8
- package/file-input/FileInput.stories.tsx +85 -2
- package/file-input/FileInput.test.js +1 -42
- package/file-input/FileItem.js +1 -0
- package/flex/Flex.js +4 -2
- package/flex/Flex.stories.tsx +35 -26
- package/flex/types.d.ts +70 -5
- package/footer/Footer.js +6 -8
- package/footer/Footer.stories.tsx +91 -0
- package/footer/Footer.test.js +14 -26
- package/grid/Grid.d.ts +7 -0
- package/grid/Grid.js +91 -0
- package/grid/Grid.stories.tsx +219 -0
- package/grid/types.d.ts +115 -0
- package/header/Header.d.ts +3 -2
- package/header/Header.js +3 -3
- package/header/Header.stories.tsx +115 -5
- package/header/Header.test.js +2 -2
- package/header/types.d.ts +2 -2
- package/heading/Heading.js +1 -1
- package/heading/Heading.test.js +1 -1
- package/inset/Inset.stories.tsx +2 -1
- package/layout/ApplicationLayout.d.ts +3 -3
- package/layout/ApplicationLayout.js +1 -1
- package/layout/types.d.ts +2 -3
- package/link/Link.js +3 -3
- package/link/Link.stories.tsx +60 -0
- package/link/Link.test.js +2 -4
- package/link/types.d.ts +2 -2
- package/main.d.ts +3 -2
- package/main.js +9 -1
- package/{tabs-nav → nav-tabs}/NavTabs.d.ts +2 -2
- package/{tabs-nav → nav-tabs}/NavTabs.js +8 -11
- package/{tabs-nav → nav-tabs}/NavTabs.stories.tsx +103 -1
- package/{tabs-nav → nav-tabs}/NavTabs.test.js +1 -1
- package/{tabs-nav → nav-tabs}/Tab.js +47 -29
- package/{tabs-nav → nav-tabs}/types.d.ts +8 -9
- package/nav-tabs/types.js +5 -0
- package/number-input/NumberInput.test.js +1 -1
- package/package.json +2 -2
- package/paginator/Paginator.js +2 -4
- package/paginator/Paginator.stories.tsx +24 -0
- package/paginator/Paginator.test.js +40 -37
- package/paragraph/Paragraph.d.ts +3 -4
- package/paragraph/Paragraph.js +5 -5
- package/password-input/PasswordInput.test.js +1 -1
- package/progress-bar/ProgressBar.d.ts +2 -2
- package/progress-bar/ProgressBar.js +5 -5
- package/progress-bar/ProgressBar.stories.jsx +35 -2
- package/progress-bar/ProgressBar.test.js +1 -1
- package/progress-bar/types.d.ts +4 -3
- package/quick-nav/QuickNav.stories.tsx +14 -0
- package/radio-group/Radio.js +10 -10
- package/radio-group/RadioGroup.js +8 -10
- package/radio-group/RadioGroup.stories.tsx +131 -18
- package/radio-group/RadioGroup.test.js +1 -1
- package/resultsetTable/ResultsetTable.js +2 -2
- package/resultsetTable/ResultsetTable.test.js +1 -1
- package/resultsetTable/types.d.ts +3 -3
- package/select/Select.js +13 -11
- package/select/Select.stories.tsx +477 -175
- package/select/Select.test.js +59 -59
- package/sidenav/Icons.d.ts +7 -0
- package/sidenav/Icons.js +51 -0
- package/sidenav/Sidenav.d.ts +2 -2
- package/sidenav/Sidenav.js +66 -94
- package/sidenav/Sidenav.stories.tsx +110 -17
- package/sidenav/types.d.ts +21 -18
- package/slider/Slider.js +2 -3
- package/slider/Slider.stories.tsx +57 -0
- package/slider/Slider.test.js +1 -1
- package/slider/types.d.ts +2 -2
- package/spinner/Spinner.js +15 -21
- package/spinner/Spinner.stories.jsx +53 -27
- package/spinner/Spinner.test.js +1 -1
- package/switch/Switch.js +2 -2
- package/switch/Switch.stories.tsx +33 -0
- package/switch/Switch.test.js +1 -1
- package/switch/types.d.ts +2 -2
- package/table/Table.js +2 -2
- package/table/Table.stories.jsx +80 -1
- package/table/Table.test.js +1 -1
- package/tabs/Tab.js +9 -10
- package/tabs/Tabs.js +11 -17
- package/tabs/Tabs.stories.tsx +38 -0
- package/tabs/Tabs.test.js +4 -5
- package/tabs/types.d.ts +2 -2
- package/tag/Tag.js +7 -9
- package/tag/Tag.stories.tsx +14 -1
- package/tag/Tag.test.js +1 -1
- package/text-input/Suggestion.js +2 -2
- package/text-input/TextInput.js +4 -4
- package/text-input/TextInput.stories.tsx +69 -1
- package/text-input/TextInput.test.js +1 -2
- package/textarea/Textarea.js +3 -4
- package/textarea/Textarea.stories.jsx +60 -1
- package/textarea/Textarea.test.js +2 -4
- package/toggle-group/ToggleGroup.d.ts +2 -2
- package/toggle-group/ToggleGroup.js +7 -4
- package/toggle-group/ToggleGroup.stories.tsx +42 -0
- package/toggle-group/ToggleGroup.test.js +1 -1
- package/toggle-group/types.d.ts +1 -1
- package/typography/Typography.d.ts +2 -2
- package/typography/Typography.js +14 -113
- package/typography/Typography.stories.tsx +1 -1
- package/useTheme.d.ts +1234 -1
- package/useTheme.js +1 -1
- package/useTranslatedLabels.d.ts +84 -1
- package/utils/BaseTypography.d.ts +21 -0
- package/utils/BaseTypography.js +108 -0
- package/utils/FocusLock.d.ts +13 -0
- package/utils/FocusLock.js +138 -0
- package/wizard/Wizard.js +2 -2
- package/wizard/Wizard.stories.tsx +20 -0
- package/wizard/Wizard.test.js +1 -1
- package/wizard/types.d.ts +5 -6
- /package/{tabs-nav → grid}/types.js +0 -0
- /package/{tabs-nav → nav-tabs}/Tab.d.ts +0 -0
package/tabs/Tab.js
CHANGED
|
@@ -17,7 +17,7 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
|
17
17
|
|
|
18
18
|
var _Badge = _interopRequireDefault(require("../badge/Badge"));
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _BaseTypography = _interopRequireDefault(require("../utils/BaseTypography"));
|
|
21
21
|
|
|
22
22
|
var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
23
23
|
|
|
@@ -42,7 +42,6 @@ var Tab = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
42
42
|
type: "button",
|
|
43
43
|
tabIndex: tabIndex,
|
|
44
44
|
disabled: tab.isDisabled,
|
|
45
|
-
"aria-disabled": tab.isDisabled,
|
|
46
45
|
"aria-selected": active,
|
|
47
46
|
hasLabelAndIcon: hasLabelAndIcon,
|
|
48
47
|
iconPosition: iconPosition,
|
|
@@ -57,7 +56,7 @@ var Tab = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
57
56
|
_onMouseLeave();
|
|
58
57
|
}
|
|
59
58
|
}, /*#__PURE__*/_react["default"].createElement(MainLabelContainer, {
|
|
60
|
-
|
|
59
|
+
notificationNumber: tab.notificationNumber,
|
|
61
60
|
hasLabelAndIcon: hasLabelAndIcon,
|
|
62
61
|
iconPosition: iconPosition
|
|
63
62
|
}, tab.icon && /*#__PURE__*/_react["default"].createElement(TabIconContainer, {
|
|
@@ -65,7 +64,7 @@ var Tab = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
65
64
|
iconPosition: iconPosition
|
|
66
65
|
}, typeof tab.icon === "string" ? /*#__PURE__*/_react["default"].createElement("img", {
|
|
67
66
|
src: tab.icon
|
|
68
|
-
}) : tab.icon), /*#__PURE__*/_react["default"].createElement(
|
|
67
|
+
}) : tab.icon), /*#__PURE__*/_react["default"].createElement(_BaseTypography["default"], {
|
|
69
68
|
color: tab.isDisabled ? colorsTheme.tabs.disabledFontColor : active ? colorsTheme.tabs.selectedFontColor : colorsTheme.tabs.unselectedFontColor,
|
|
70
69
|
fontFamily: colorsTheme.tabs.fontFamily,
|
|
71
70
|
fontSize: colorsTheme.tabs.fontSize,
|
|
@@ -74,15 +73,15 @@ var Tab = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
74
73
|
textAlign: "center",
|
|
75
74
|
letterSpacing: "0.025em",
|
|
76
75
|
lineHeight: "1.715em"
|
|
77
|
-
}, tab.label)), tab.notificationNumber &&
|
|
76
|
+
}, tab.label)), tab.notificationNumber && /*#__PURE__*/_react["default"].createElement(BadgeContainer, {
|
|
78
77
|
hasLabelAndIcon: hasLabelAndIcon,
|
|
79
78
|
iconPosition: iconPosition
|
|
80
79
|
}, /*#__PURE__*/_react["default"].createElement(_Badge["default"], {
|
|
81
|
-
notificationText: tab.notificationNumber > 99 ? "+99" : tab.notificationNumber
|
|
80
|
+
notificationText: typeof tab.notificationNumber === "number" && tab.notificationNumber > 99 ? "+99" : tab.notificationNumber
|
|
82
81
|
})));
|
|
83
82
|
});
|
|
84
83
|
|
|
85
|
-
var TabContainer = _styledComponents["default"].button(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n text-transform: ", ";\n overflow: hidden;\n flex-shrink: 0;\n border: 0;\n cursor: pointer;\n display: inline-flex;\n align-items: center;\n user-select: none;\n vertical-align: middle;\n justify-content: center;\n min-width: 90px;\n max-width: 360px;\n padding: ", ";\n height: ", ";\n min-height: ", ";\n background-color: ", ";\n
|
|
84
|
+
var TabContainer = _styledComponents["default"].button(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n text-transform: ", ";\n overflow: hidden;\n flex-shrink: 0;\n border: 0;\n cursor: pointer;\n display: inline-flex;\n align-items: center;\n user-select: none;\n vertical-align: middle;\n justify-content: center;\n min-width: 90px;\n max-width: 360px;\n padding: ", ";\n height: ", ";\n min-height: ", ";\n background-color: ", ";\n\n &:hover {\n background-color: ", ";\n }\n &:active {\n background-color: ", ";\n }\n &:focus {\n outline: ", " solid 1px;\n outline-offset: -1px;\n }\n svg {\n color: ", ";\n }\n\n &[aria-selected=\"true\"] {\n background-color: ", ";\n svg {\n color: ", ";\n }\n opacity: 1;\n }\n\n &:disabled {\n background-color: ", " !important;\n cursor: not-allowed !important;\n pointer-events: all;\n font-style: ", ";\n outline: none !important;\n\n svg {\n color: ", ";\n }\n > div {\n opacity: 0.5;\n }\n }\n"])), function (props) {
|
|
86
85
|
return props.theme.fontTextTransform;
|
|
87
86
|
}, function (props) {
|
|
88
87
|
return (!props.hasLabelAndIcon || props.hasLabelAndIcon && props.iconPosition !== "top") && "12px 16px" || "8px 16px";
|
|
@@ -92,14 +91,14 @@ var TabContainer = _styledComponents["default"].button(_templateObject || (_temp
|
|
|
92
91
|
return (!props.hasLabelAndIcon || props.hasLabelAndIcon && props.iconPosition !== "top") && "47px" || "71px";
|
|
93
92
|
}, function (props) {
|
|
94
93
|
return props.theme.unselectedBackgroundColor;
|
|
95
|
-
}, function (props) {
|
|
96
|
-
return props.theme.unselectedIconColor;
|
|
97
94
|
}, function (props) {
|
|
98
95
|
return "".concat(props.theme.hoverBackgroundColor, " !important");
|
|
99
96
|
}, function (props) {
|
|
100
97
|
return "".concat(props.theme.pressedBackgroundColor, " !important");
|
|
101
98
|
}, function (props) {
|
|
102
99
|
return props.theme.focusOutline;
|
|
100
|
+
}, function (props) {
|
|
101
|
+
return props.theme.unselectedIconColor;
|
|
103
102
|
}, function (props) {
|
|
104
103
|
return props.theme.selectedBackgroundColor;
|
|
105
104
|
}, function (props) {
|
|
@@ -119,7 +118,7 @@ var BadgeContainer = _styledComponents["default"].div(_templateObject2 || (_temp
|
|
|
119
118
|
var MainLabelContainer = _styledComponents["default"].div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: ", ";\n align-items: center;\n margin-left: ", ";\n"])), function (props) {
|
|
120
119
|
return props.hasLabelAndIcon && props.iconPosition === "top" && "column" || "row";
|
|
121
120
|
}, function (props) {
|
|
122
|
-
return props.
|
|
121
|
+
return props.notificationNumber ? typeof props.notificationNumber === "number" ? "calc(".concat(props.theme.badgeWidthWithNotificationNumber, " + 12px)") : "calc(".concat(props.theme.badgeWidth, " + 12px)") : "unset";
|
|
123
122
|
});
|
|
124
123
|
|
|
125
124
|
var TabIconContainer = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n margin-bottom: ", ";\n margin-right: ", ";\n\n img,\n svg {\n height: 22px;\n width: 22px;\n }\n"])), function (props) {
|
package/tabs/Tabs.js
CHANGED
|
@@ -19,7 +19,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
19
19
|
|
|
20
20
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
21
21
|
|
|
22
|
-
var _variables = require("../common/variables
|
|
22
|
+
var _variables = require("../common/variables");
|
|
23
23
|
|
|
24
24
|
var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
25
25
|
|
|
@@ -193,7 +193,7 @@ var DxcTabs = function DxcTabs(_ref) {
|
|
|
193
193
|
var _refTabList$current3;
|
|
194
194
|
|
|
195
195
|
var scrollWidth = (refTabList === null || refTabList === void 0 ? void 0 : (_refTabList$current3 = refTabList.current) === null || _refTabList$current3 === void 0 ? void 0 : _refTabList$current3.offsetWidth) * 0.75;
|
|
196
|
-
var moveX;
|
|
196
|
+
var moveX = 0;
|
|
197
197
|
|
|
198
198
|
if (countClick <= scrollWidth) {
|
|
199
199
|
moveX = 0;
|
|
@@ -213,7 +213,7 @@ var DxcTabs = function DxcTabs(_ref) {
|
|
|
213
213
|
var _refTabList$current4, _refTabList$current5;
|
|
214
214
|
|
|
215
215
|
var scrollWidth = (refTabList === null || refTabList === void 0 ? void 0 : (_refTabList$current4 = refTabList.current) === null || _refTabList$current4 === void 0 ? void 0 : _refTabList$current4.offsetWidth) * 0.75;
|
|
216
|
-
var moveX;
|
|
216
|
+
var moveX = 0;
|
|
217
217
|
|
|
218
218
|
if (countClick + scrollWidth + (refTabList === null || refTabList === void 0 ? void 0 : (_refTabList$current5 = refTabList.current) === null || _refTabList$current5 === void 0 ? void 0 : _refTabList$current5.offsetWidth) >= totalTabsWidth) {
|
|
219
219
|
var _refTabList$current6;
|
|
@@ -343,9 +343,8 @@ var DxcTabs = function DxcTabs(_ref) {
|
|
|
343
343
|
iconPosition: iconPosition
|
|
344
344
|
}, /*#__PURE__*/_react["default"].createElement(ScrollIndicator, {
|
|
345
345
|
onClick: scrollLeft,
|
|
346
|
-
scrollLeftEnabled: scrollLeftEnabled,
|
|
347
346
|
enabled: enabledIndicator,
|
|
348
|
-
|
|
347
|
+
disabled: !scrollLeftEnabled,
|
|
349
348
|
"aria-label": translatedLabels.tabs.scrollLeft,
|
|
350
349
|
tabIndex: scrollLeftEnabled ? tabIndex : -1,
|
|
351
350
|
minHeightTabs: minHeightTabs
|
|
@@ -386,16 +385,15 @@ var DxcTabs = function DxcTabs(_ref) {
|
|
|
386
385
|
"aria-disabled": isActiveIndicatorDisabled
|
|
387
386
|
}))), /*#__PURE__*/_react["default"].createElement(ScrollIndicator, {
|
|
388
387
|
onClick: scrollRight,
|
|
389
|
-
scrollRightEnabled: scrollRightEnabled,
|
|
390
388
|
enabled: enabledIndicator,
|
|
391
|
-
|
|
389
|
+
disabled: !scrollRightEnabled,
|
|
392
390
|
"aria-label": translatedLabels.tabs.scrollRight,
|
|
393
391
|
tabIndex: scrollRightEnabled ? tabIndex : -1,
|
|
394
392
|
minHeightTabs: minHeightTabs
|
|
395
393
|
}, arrowIcons.right))));
|
|
396
394
|
};
|
|
397
395
|
|
|
398
|
-
var Underline = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n left: 0;\n bottom: 0;\n width: 100%;\n
|
|
396
|
+
var Underline = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n position: absolute;\n left: 0;\n bottom: 0;\n width: 100%;\n height: ", ";\n background-color: ", ";\n"])), function (props) {
|
|
399
397
|
return props.theme.dividerThickness;
|
|
400
398
|
}, function (props) {
|
|
401
399
|
return props.theme.dividerColor;
|
|
@@ -421,16 +419,12 @@ var Tabs = _styledComponents["default"].div(_templateObject3 || (_templateObject
|
|
|
421
419
|
return props.theme.unselectedBackgroundColor;
|
|
422
420
|
});
|
|
423
421
|
|
|
424
|
-
var ScrollIndicator = _styledComponents["default"].button(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n display: ", ";\n
|
|
422
|
+
var ScrollIndicator = _styledComponents["default"].button(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n box-sizing: border-box;\n display: ", ";\n justify-content: center;\n min-width: ", ";\n height: ", "px;\n padding: 0;\n border: none;\n background-color: #ffffff;\n font-size: 1.25rem;\n cursor: pointer;\n\n &:hover {\n background-color: ", ";\n }\n &:focus {\n outline: ", " solid 1px;\n outline-offset: -1px;\n }\n &:active {\n background-color: ", ";\n }\n &:disabled {\n cursor: default;\n svg {\n visibility: hidden;\n }\n &:focus {\n outline: none;\n }\n &:hover,\n &:active {\n background-color: transparent !important;\n }\n }\n\n svg {\n align-self: center;\n height: 20px;\n width: 20px;\n fill: ", ";\n }\n"])), function (props) {
|
|
425
423
|
return props.enabled ? "flex" : "none";
|
|
426
424
|
}, function (props) {
|
|
427
425
|
return props.theme.scrollButtonsWidth;
|
|
428
426
|
}, function (props) {
|
|
429
427
|
return props.minHeightTabs - 1;
|
|
430
|
-
}, function (props) {
|
|
431
|
-
return props.theme.dividerThickness;
|
|
432
|
-
}, function (props) {
|
|
433
|
-
return props.theme.dividerColor;
|
|
434
428
|
}, function (props) {
|
|
435
429
|
return "".concat(props.theme.hoverBackgroundColor, " !important");
|
|
436
430
|
}, function (props) {
|
|
@@ -441,19 +435,19 @@ var ScrollIndicator = _styledComponents["default"].button(_templateObject4 || (_
|
|
|
441
435
|
return props.theme.unselectedFontColor;
|
|
442
436
|
});
|
|
443
437
|
|
|
444
|
-
var ActiveIndicator = _styledComponents["default"].span(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n
|
|
438
|
+
var ActiveIndicator = _styledComponents["default"].span(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n position: absolute;\n bottom: 0;\n left: ", ";\n width: ", ";\n height: ", ";\n background-color: ", ";\n &[aria-disabled=\"true\"] {\n background-color: ", ";\n display: none;\n }\n"])), function (props) {
|
|
445
439
|
return "".concat(props.tabLeft, "px");
|
|
446
440
|
}, function (props) {
|
|
447
441
|
return "".concat(props.tabWidth, "px");
|
|
448
|
-
}, function (props) {
|
|
449
|
-
return props.theme.selectedUnderlineColor;
|
|
450
442
|
}, function (props) {
|
|
451
443
|
return props.theme.selectedUnderlineThickness;
|
|
444
|
+
}, function (props) {
|
|
445
|
+
return props.theme.selectedUnderlineColor;
|
|
452
446
|
}, function (props) {
|
|
453
447
|
return props.theme.disabledFontColor;
|
|
454
448
|
});
|
|
455
449
|
|
|
456
|
-
var TabsContent = _styledComponents["default"].div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n
|
|
450
|
+
var TabsContent = _styledComponents["default"].div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n flex: 1 1 auto;\n display: inline-block;\n position: relative;\n white-space: nowrap;\n overflow-x: scroll;\n ::-webkit-scrollbar {\n display: none;\n }\n"])));
|
|
457
451
|
|
|
458
452
|
var TabList = _styledComponents["default"].div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n min-height: ", "px;\n"])), function (props) {
|
|
459
453
|
return props.minHeightTabs;
|
package/tabs/Tabs.stories.tsx
CHANGED
|
@@ -2,6 +2,7 @@ import React from "react";
|
|
|
2
2
|
import DxcTabs from "./Tabs";
|
|
3
3
|
import Title from "../../.storybook/components/Title";
|
|
4
4
|
import ExampleContainer from "../../.storybook/components/ExampleContainer";
|
|
5
|
+
import { HalstackProvider } from "../HalstackContext";
|
|
5
6
|
|
|
6
7
|
export default {
|
|
7
8
|
title: "Tabs",
|
|
@@ -81,6 +82,12 @@ const tabsIcon = tabs.map((tab, index) =>
|
|
|
81
82
|
|
|
82
83
|
const tabsNotificationIcon = tabsNotification.map((tab) => ({ ...tab, icon: iconSVG }));
|
|
83
84
|
|
|
85
|
+
const opinionatedTheme = {
|
|
86
|
+
tabs: {
|
|
87
|
+
baseColor: "#5f249f",
|
|
88
|
+
},
|
|
89
|
+
};
|
|
90
|
+
|
|
84
91
|
export const Chromatic = () => (
|
|
85
92
|
<>
|
|
86
93
|
<ExampleContainer>
|
|
@@ -156,6 +163,37 @@ export const Chromatic = () => (
|
|
|
156
163
|
<Title title="Xxlarge margin" theme="light" level={4} />
|
|
157
164
|
<DxcTabs tabs={tabs} margin="xxlarge" />
|
|
158
165
|
</ExampleContainer>
|
|
166
|
+
<Title title="Opinionated theme" theme="light" level={2} />
|
|
167
|
+
<ExampleContainer>
|
|
168
|
+
<Title title="With icon and notification" theme="light" level={4} />
|
|
169
|
+
<HalstackProvider theme={opinionatedTheme}>
|
|
170
|
+
<DxcTabs tabs={tabsNotificationIcon} />
|
|
171
|
+
</HalstackProvider>
|
|
172
|
+
</ExampleContainer>
|
|
173
|
+
<ExampleContainer>
|
|
174
|
+
<Title title="Disabled" theme="light" level={4} />
|
|
175
|
+
<HalstackProvider theme={opinionatedTheme}>
|
|
176
|
+
<DxcTabs activeTabIndex={0} tabs={disabledTabs} />
|
|
177
|
+
</HalstackProvider>
|
|
178
|
+
</ExampleContainer>
|
|
179
|
+
<ExampleContainer pseudoState="pseudo-hover">
|
|
180
|
+
<Title title="Hovered" theme="light" level={4} />
|
|
181
|
+
<HalstackProvider theme={opinionatedTheme}>
|
|
182
|
+
<DxcTabs tabs={tabs} />
|
|
183
|
+
</HalstackProvider>
|
|
184
|
+
</ExampleContainer>
|
|
185
|
+
<ExampleContainer pseudoState="pseudo-focus">
|
|
186
|
+
<Title title="Focused" theme="light" level={4} />
|
|
187
|
+
<HalstackProvider theme={opinionatedTheme}>
|
|
188
|
+
<DxcTabs tabs={tabs} />
|
|
189
|
+
</HalstackProvider>
|
|
190
|
+
</ExampleContainer>
|
|
191
|
+
<ExampleContainer pseudoState="pseudo-active">
|
|
192
|
+
<Title title="Actived" theme="light" level={4} />
|
|
193
|
+
<HalstackProvider theme={opinionatedTheme}>
|
|
194
|
+
<DxcTabs tabs={tabs} />
|
|
195
|
+
</HalstackProvider>
|
|
196
|
+
</ExampleContainer>
|
|
159
197
|
</>
|
|
160
198
|
);
|
|
161
199
|
|
package/tabs/Tabs.test.js
CHANGED
|
@@ -6,7 +6,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
6
6
|
|
|
7
7
|
var _react2 = require("@testing-library/react");
|
|
8
8
|
|
|
9
|
-
var _Tabs = _interopRequireDefault(require("./Tabs"));
|
|
9
|
+
var _Tabs = _interopRequireDefault(require("./Tabs.tsx"));
|
|
10
10
|
|
|
11
11
|
var sampleTabs = [{
|
|
12
12
|
label: "Tab-1"
|
|
@@ -17,13 +17,13 @@ var sampleTabs = [{
|
|
|
17
17
|
}];
|
|
18
18
|
var sampleTabsWithBadge = [{
|
|
19
19
|
label: "Tab-1",
|
|
20
|
-
notificationNumber:
|
|
20
|
+
notificationNumber: 10
|
|
21
21
|
}, {
|
|
22
22
|
label: "Tab-2",
|
|
23
|
-
notificationNumber:
|
|
23
|
+
notificationNumber: 20
|
|
24
24
|
}, {
|
|
25
25
|
label: "Tab-3",
|
|
26
|
-
notificationNumber:
|
|
26
|
+
notificationNumber: 101
|
|
27
27
|
}];
|
|
28
28
|
var sampleTabsMiddleDisabled = [{
|
|
29
29
|
label: "Tab-1"
|
|
@@ -149,7 +149,6 @@ describe("Tabs component tests", function () {
|
|
|
149
149
|
onTabClick: onTabClick,
|
|
150
150
|
activeTabIndex: 0
|
|
151
151
|
})),
|
|
152
|
-
getByText = _render7.getByText,
|
|
153
152
|
getAllByRole = _render7.getAllByRole;
|
|
154
153
|
|
|
155
154
|
var tabs = getAllByRole("tab");
|
package/tabs/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
declare type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
|
|
3
|
+
declare type Margin = {
|
|
4
4
|
top?: Space;
|
|
5
5
|
bottom?: Space;
|
|
6
6
|
left?: Space;
|
package/tag/Tag.js
CHANGED
|
@@ -19,11 +19,11 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
19
19
|
|
|
20
20
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
21
21
|
|
|
22
|
-
var _variables = require("../common/variables
|
|
22
|
+
var _variables = require("../common/variables");
|
|
23
23
|
|
|
24
24
|
var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
25
25
|
|
|
26
|
-
var _utils = require("../common/utils
|
|
26
|
+
var _utils = require("../common/utils");
|
|
27
27
|
|
|
28
28
|
var _Box = _interopRequireDefault(require("../box/Box"));
|
|
29
29
|
|
|
@@ -64,9 +64,7 @@ var DxcTag = function DxcTag(_ref) {
|
|
|
64
64
|
var tagContent = /*#__PURE__*/_react["default"].createElement(_Box["default"], {
|
|
65
65
|
size: size,
|
|
66
66
|
shadowDepth: isHovered && (onClick || linkHref) && 2 || 1
|
|
67
|
-
}, /*#__PURE__*/_react["default"].createElement(TagContent, {
|
|
68
|
-
labelPosition: labelPosition
|
|
69
|
-
}, labelPosition === "before" && size !== "small" && label && /*#__PURE__*/_react["default"].createElement(TagLabel, null, label), icon && /*#__PURE__*/_react["default"].createElement(IconContainer, {
|
|
67
|
+
}, /*#__PURE__*/_react["default"].createElement(TagContent, null, labelPosition === "before" && size !== "small" && label && /*#__PURE__*/_react["default"].createElement(TagLabel, null, label), icon && /*#__PURE__*/_react["default"].createElement(IconContainer, {
|
|
70
68
|
iconBgColor: iconBgColor
|
|
71
69
|
}, typeof icon === "string" ? /*#__PURE__*/_react["default"].createElement(TagIcon, {
|
|
72
70
|
src: icon
|
|
@@ -114,16 +112,16 @@ var StyledDxcTag = _styledComponents["default"].div(_templateObject || (_templat
|
|
|
114
112
|
return margin && (0, _typeof2["default"])(margin) !== "object" ? _variables.spaces[margin] : "0px";
|
|
115
113
|
}, function (_ref4) {
|
|
116
114
|
var margin = _ref4.margin;
|
|
117
|
-
return margin && margin.top ? _variables.spaces[margin.top] : "";
|
|
115
|
+
return margin && (0, _typeof2["default"])(margin) === "object" && margin.top ? _variables.spaces[margin.top] : "";
|
|
118
116
|
}, function (_ref5) {
|
|
119
117
|
var margin = _ref5.margin;
|
|
120
|
-
return margin && margin.right ? _variables.spaces[margin.right] : "";
|
|
118
|
+
return margin && (0, _typeof2["default"])(margin) === "object" && margin.right ? _variables.spaces[margin.right] : "";
|
|
121
119
|
}, function (_ref6) {
|
|
122
120
|
var margin = _ref6.margin;
|
|
123
|
-
return margin && margin.bottom ? _variables.spaces[margin.bottom] : "";
|
|
121
|
+
return margin && (0, _typeof2["default"])(margin) === "object" && margin.bottom ? _variables.spaces[margin.bottom] : "";
|
|
124
122
|
}, function (_ref7) {
|
|
125
123
|
var margin = _ref7.margin;
|
|
126
|
-
return margin && margin.left ? _variables.spaces[margin.left] : "";
|
|
124
|
+
return margin && (0, _typeof2["default"])(margin) === "object" && margin.left ? _variables.spaces[margin.left] : "";
|
|
127
125
|
}, function (props) {
|
|
128
126
|
return calculateWidth(props.margin, props.size);
|
|
129
127
|
}, function (props) {
|
package/tag/Tag.stories.tsx
CHANGED
|
@@ -3,6 +3,7 @@ import { userEvent, within } from "@storybook/testing-library";
|
|
|
3
3
|
import Title from "../../.storybook/components/Title";
|
|
4
4
|
import ExampleContainer from "../../.storybook/components/ExampleContainer";
|
|
5
5
|
import DxcTag from "./Tag";
|
|
6
|
+
import { HalstackProvider } from "../HalstackContext";
|
|
6
7
|
|
|
7
8
|
export default {
|
|
8
9
|
title: "Tag",
|
|
@@ -23,6 +24,13 @@ const largeIcon = (
|
|
|
23
24
|
</svg>
|
|
24
25
|
);
|
|
25
26
|
|
|
27
|
+
const opinionatedTheme = {
|
|
28
|
+
tag: {
|
|
29
|
+
fontColor: "#000000",
|
|
30
|
+
iconColor: "#ffffff",
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
|
|
26
34
|
export const Chromatic = () => (
|
|
27
35
|
<>
|
|
28
36
|
<ExampleContainer>
|
|
@@ -124,7 +132,12 @@ export const Chromatic = () => (
|
|
|
124
132
|
<Title title="FitContent size" theme="light" level={4} />
|
|
125
133
|
<DxcTag label="FitContent" size="fitContent" icon={icon} />
|
|
126
134
|
</ExampleContainer>
|
|
127
|
-
<
|
|
135
|
+
<Title title="Opinionated theme" theme="light" level={2} />
|
|
136
|
+
<ExampleContainer>
|
|
137
|
+
<HalstackProvider theme={opinionatedTheme}>
|
|
138
|
+
<DxcTag label="Tag" icon={icon} />
|
|
139
|
+
</HalstackProvider>
|
|
140
|
+
</ExampleContainer>
|
|
128
141
|
</>
|
|
129
142
|
);
|
|
130
143
|
|
package/tag/Tag.test.js
CHANGED
|
@@ -6,7 +6,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
6
6
|
|
|
7
7
|
var _react2 = require("@testing-library/react");
|
|
8
8
|
|
|
9
|
-
var _Tag = _interopRequireDefault(require("./Tag"));
|
|
9
|
+
var _Tag = _interopRequireDefault(require("./Tag.tsx"));
|
|
10
10
|
|
|
11
11
|
describe("Tag component tests", function () {
|
|
12
12
|
test("Tag renders with correct label", function () {
|
package/text-input/Suggestion.js
CHANGED
|
@@ -62,7 +62,7 @@ var Suggestion = function Suggestion(_ref) {
|
|
|
62
62
|
role: "option",
|
|
63
63
|
"aria-selected": visuallyFocused ? true : undefined
|
|
64
64
|
}, /*#__PURE__*/_react["default"].createElement(StyledSuggestion, {
|
|
65
|
-
|
|
65
|
+
isLast: isLast,
|
|
66
66
|
visuallyFocused: visuallyFocused
|
|
67
67
|
}, highlighted ? /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("strong", null, matchedSuggestion.matchedWords), matchedSuggestion.noMatchedWords) : suggestion));
|
|
68
68
|
};
|
|
@@ -76,7 +76,7 @@ var SuggestionContainer = _styledComponents["default"].li(_templateObject || (_t
|
|
|
76
76
|
});
|
|
77
77
|
|
|
78
78
|
var StyledSuggestion = _styledComponents["default"].span(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n width: 100%;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n padding: 0.25rem 0.5rem 0.188rem 0.5rem;\n ", ";\n"])), function (props) {
|
|
79
|
-
return props.
|
|
79
|
+
return props.isLast || props.visuallyFocused ? "border-bottom: 1px solid transparent" : "border-bottom: 1px solid ".concat(props.theme.listOptionDividerColor);
|
|
80
80
|
});
|
|
81
81
|
|
|
82
82
|
var _default = /*#__PURE__*/_react["default"].memo(Suggestion);
|
package/text-input/TextInput.js
CHANGED
|
@@ -23,9 +23,9 @@ var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
|
23
23
|
|
|
24
24
|
var _useTranslatedLabels = _interopRequireDefault(require("../useTranslatedLabels"));
|
|
25
25
|
|
|
26
|
-
var _variables = require("../common/variables
|
|
26
|
+
var _variables = require("../common/variables");
|
|
27
27
|
|
|
28
|
-
var _utils = require("../common/utils
|
|
28
|
+
var _utils = require("../common/utils");
|
|
29
29
|
|
|
30
30
|
var _BackgroundColorContext = _interopRequireDefault(require("../BackgroundColorContext"));
|
|
31
31
|
|
|
@@ -559,7 +559,7 @@ var DxcTextInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref2, re
|
|
|
559
559
|
}, error)));
|
|
560
560
|
});
|
|
561
561
|
|
|
562
|
-
var TextInputContainer = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n
|
|
562
|
+
var TextInputContainer = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n width: ", ";\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n"])), function (props) {
|
|
563
563
|
return calculateWidth(props.margin, props.size);
|
|
564
564
|
}, function (props) {
|
|
565
565
|
return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
|
|
@@ -642,7 +642,7 @@ var Action = _styledComponents["default"].button(_templateObject7 || (_templateO
|
|
|
642
642
|
}, function (props) {
|
|
643
643
|
return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledActionIconColorOnDark : props.theme.disabledActionIconColor : props.backgroundType === "dark" ? props.theme.actionIconColorOnDark : props.theme.actionIconColor;
|
|
644
644
|
}, function (props) {
|
|
645
|
-
return !props.disabled && "\n &:focus
|
|
645
|
+
return !props.disabled && "\n &:focus, \n &:focus-visible {\n outline: none;\n box-shadow: 0 0 0 2px ".concat(props.backgroundType === "dark" ? props.theme.focusActionBorderColorOnDark : props.theme.focusActionBorderColor, ";\n color: ").concat(props.backgroundType === "dark" ? props.theme.focusActionIconColorOnDark : props.theme.focusActionIconColor, ";\n }\n &:hover {\n background-color: ").concat(props.backgroundType === "dark" ? props.theme.hoverActionBackgroundColorOnDark : props.theme.hoverActionBackgroundColor, ";\n color: ").concat(props.backgroundType === "dark" ? props.theme.hoverActionIconColorOnDark : props.theme.hoverActionIconColor, ";\n }\n &:active {\n background-color: ").concat(props.backgroundType === "dark" ? props.theme.activeActionBackgroundColorOnDark : props.theme.activeActionBackgroundColor, ";\n color: ").concat(props.backgroundType === "dark" ? props.theme.activeActionIconColorOnDark : props.theme.activeActionIconColor, ";\n }\n ");
|
|
646
646
|
});
|
|
647
647
|
|
|
648
648
|
var Prefix = _styledComponents["default"].span(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["\n height: 1.5rem;\n line-height: 1.5rem;\n margin-left: 0.25rem;\n padding: 0 0.5rem 0 0;\n ", ";\n font-family: ", ";\n font-size: 1rem;\n pointer-events: none;\n"])), function (props) {
|
|
@@ -11,6 +11,7 @@ import DxcFlex from "../flex/Flex";
|
|
|
11
11
|
import Suggestions from "./Suggestions";
|
|
12
12
|
import { ThemeProvider } from "styled-components";
|
|
13
13
|
import useTheme from "../useTheme";
|
|
14
|
+
import { HalstackProvider } from "../HalstackContext";
|
|
14
15
|
|
|
15
16
|
export default {
|
|
16
17
|
title: "Text input",
|
|
@@ -69,6 +70,13 @@ const countries = [
|
|
|
69
70
|
"*",
|
|
70
71
|
];
|
|
71
72
|
|
|
73
|
+
const opinionatedTheme = {
|
|
74
|
+
textInput: {
|
|
75
|
+
fontColor: "#000000",
|
|
76
|
+
hoverBorderColor: "#a46ede",
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
|
|
72
80
|
export const Chromatic = () => (
|
|
73
81
|
<>
|
|
74
82
|
<ExampleContainer pseudoState="pseudo-hover">
|
|
@@ -312,6 +320,66 @@ export const Chromatic = () => (
|
|
|
312
320
|
<Title title="FillParent size" theme="light" level={4} />
|
|
313
321
|
<DxcTextInput label="FillParent" size="fillParent" />
|
|
314
322
|
</ExampleContainer>
|
|
323
|
+
<Title title="Opinionated theme" theme="light" level={2} />
|
|
324
|
+
<ExampleContainer>
|
|
325
|
+
<HalstackProvider theme={opinionatedTheme}>
|
|
326
|
+
<ExampleContainer pseudoState="pseudo-hover">
|
|
327
|
+
<Title title="Hovered input" theme="light" level={4} />
|
|
328
|
+
<DxcTextInput label="Text input" helperText="Help message" />
|
|
329
|
+
</ExampleContainer>
|
|
330
|
+
<ExampleContainer pseudoState="pseudo-focus-within">
|
|
331
|
+
<Title title="Focused input" theme="light" level={4} />
|
|
332
|
+
<DxcTextInput label="Text input" helperText="Help message" />
|
|
333
|
+
</ExampleContainer>
|
|
334
|
+
<ExampleContainer pseudoState="pseudo-hover">
|
|
335
|
+
<Title title="Hovered action" theme="light" level={4} />
|
|
336
|
+
<DxcTextInput label="Text input" helperText="Help message" defaultValue="Text" clearable />
|
|
337
|
+
</ExampleContainer>
|
|
338
|
+
<ExampleContainer pseudoState="pseudo-active">
|
|
339
|
+
<Title title="Actived action" theme="light" level={4} />
|
|
340
|
+
<DxcTextInput label="Text input" helperText="Help message" action={action} clearable />
|
|
341
|
+
</ExampleContainer>
|
|
342
|
+
<ExampleContainer pseudoState="pseudo-focus">
|
|
343
|
+
<Title title="Focused action" theme="light" level={4} />
|
|
344
|
+
<DxcTextInput label="Text input" helperText="Help message" action={action} clearable />
|
|
345
|
+
</ExampleContainer>
|
|
346
|
+
<ExampleContainer>
|
|
347
|
+
<Title title="Prefix" theme="light" level={4} />
|
|
348
|
+
<DxcTextInput label="With prefix" prefix="+34" helperText="Help message" />
|
|
349
|
+
</ExampleContainer>
|
|
350
|
+
<ExampleContainer>
|
|
351
|
+
<Title title="Suffix and action" theme="light" level={4} />
|
|
352
|
+
<DxcTextInput label="With suffix" helperText="Help message" suffix="USD" action={action} />
|
|
353
|
+
</ExampleContainer>
|
|
354
|
+
<ExampleContainer>
|
|
355
|
+
<Title title="Invalid" theme="light" level={4} />
|
|
356
|
+
<DxcTextInput
|
|
357
|
+
label="Error text input"
|
|
358
|
+
helperText="Help message"
|
|
359
|
+
error="Error message."
|
|
360
|
+
defaultValue="Text"
|
|
361
|
+
clearable
|
|
362
|
+
optional
|
|
363
|
+
action={action}
|
|
364
|
+
/>
|
|
365
|
+
</ExampleContainer>
|
|
366
|
+
<ExampleContainer>
|
|
367
|
+
<Title title="Disabled and placeholder" theme="light" level={4} />
|
|
368
|
+
<DxcTextInput label="Disabled text input" disabled placeholder="Placeholder" prefix="+34" suffix="USD" />
|
|
369
|
+
</ExampleContainer>
|
|
370
|
+
<ExampleContainer>
|
|
371
|
+
<Title title="Disabled, helper text, optional, value and action" theme="light" level={4} />
|
|
372
|
+
<DxcTextInput
|
|
373
|
+
label="Disabled text input"
|
|
374
|
+
helperText="Help message"
|
|
375
|
+
disabled
|
|
376
|
+
optional
|
|
377
|
+
defaultValue="Text"
|
|
378
|
+
action={action}
|
|
379
|
+
/>
|
|
380
|
+
</ExampleContainer>
|
|
381
|
+
</HalstackProvider>
|
|
382
|
+
</ExampleContainer>
|
|
315
383
|
</>
|
|
316
384
|
);
|
|
317
385
|
|
|
@@ -454,7 +522,7 @@ const DarkAutosuggestListbox = () => {
|
|
|
454
522
|
<Title title="Dark theme" theme="dark" level={2} />
|
|
455
523
|
<ExampleContainer>
|
|
456
524
|
<Title title="Default with opened suggestions" theme="dark" level={3} />
|
|
457
|
-
<DxcFlex direction="column" gap="
|
|
525
|
+
<DxcFlex direction="column" gap="5rem">
|
|
458
526
|
<DxcTextInput label="Label" suggestions={countries} optional placeholder="Choose an option" />
|
|
459
527
|
<DxcCheckbox
|
|
460
528
|
label="You understand the selection and give your consent"
|
|
@@ -16,7 +16,7 @@ var _react2 = require("@testing-library/react");
|
|
|
16
16
|
|
|
17
17
|
var _userEvent = _interopRequireDefault(require("@testing-library/user-event"));
|
|
18
18
|
|
|
19
|
-
var _TextInput = _interopRequireDefault(require("./TextInput"));
|
|
19
|
+
var _TextInput = _interopRequireDefault(require("./TextInput.tsx"));
|
|
20
20
|
|
|
21
21
|
// Mocking DOMRect for Radix Primitive Popover
|
|
22
22
|
global.globalThis = global;
|
|
@@ -1193,7 +1193,6 @@ describe("TextInput component synchronous autosuggest tests", function () {
|
|
|
1193
1193
|
onChange: onChange
|
|
1194
1194
|
})),
|
|
1195
1195
|
getAllByText = _render37.getAllByText,
|
|
1196
|
-
getByText = _render37.getByText,
|
|
1197
1196
|
getByRole = _render37.getByRole;
|
|
1198
1197
|
|
|
1199
1198
|
var input = getByRole("combobox");
|
package/textarea/Textarea.js
CHANGED
|
@@ -19,13 +19,13 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
19
19
|
|
|
20
20
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
21
21
|
|
|
22
|
-
var _utils = require("../common/utils
|
|
22
|
+
var _utils = require("../common/utils");
|
|
23
23
|
|
|
24
24
|
var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
25
25
|
|
|
26
26
|
var _useTranslatedLabels = _interopRequireDefault(require("../useTranslatedLabels"));
|
|
27
27
|
|
|
28
|
-
var _variables = require("../common/variables
|
|
28
|
+
var _variables = require("../common/variables");
|
|
29
29
|
|
|
30
30
|
var _uuid = require("uuid");
|
|
31
31
|
|
|
@@ -171,7 +171,6 @@ var DxcTextarea = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref)
|
|
|
171
171
|
backgroundType: backgroundType,
|
|
172
172
|
ref: textareaRef,
|
|
173
173
|
tabIndex: tabIndex,
|
|
174
|
-
"aria-disabled": disabled,
|
|
175
174
|
"aria-invalid": error ? "true" : "false",
|
|
176
175
|
"aria-errormessage": error ? errorId : undefined,
|
|
177
176
|
"aria-required": optional ? "false" : "true"
|
|
@@ -193,7 +192,7 @@ var calculateWidth = function calculateWidth(margin, size) {
|
|
|
193
192
|
return size === "fillParent" ? "calc(".concat(sizes[size], " - ").concat((0, _utils.getMargin)(margin, "left"), " - ").concat((0, _utils.getMargin)(margin, "right"), ")") : sizes[size];
|
|
194
193
|
};
|
|
195
194
|
|
|
196
|
-
var TextareaContainer = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: column;\n
|
|
195
|
+
var TextareaContainer = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: column;\n width: ", ";\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n"])), function (props) {
|
|
197
196
|
return calculateWidth(props.margin, props.size);
|
|
198
197
|
}, function (props) {
|
|
199
198
|
return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
|