@dxc-technology/halstack-react 9.0.1 → 10.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/HalstackContext.d.ts +2 -2
- package/HalstackContext.js +2 -2
- package/accordion/Accordion.d.ts +1 -1
- package/accordion/Accordion.js +2 -14
- package/accordion/Accordion.stories.tsx +3 -101
- package/accordion/types.d.ts +0 -12
- package/accordion-group/AccordionGroup.d.ts +4 -3
- package/accordion-group/AccordionGroup.js +21 -42
- package/accordion-group/AccordionGroup.stories.tsx +77 -76
- package/accordion-group/AccordionGroup.test.js +6 -16
- package/accordion-group/AccordionGroupAccordion.d.ts +4 -0
- package/accordion-group/AccordionGroupAccordion.js +43 -0
- package/accordion-group/types.d.ts +0 -12
- package/alert/Alert.js +1 -3
- package/bleed/Bleed.stories.tsx +1 -0
- package/box/Box.d.ts +1 -1
- package/box/Box.js +5 -22
- package/box/Box.stories.tsx +25 -53
- package/box/types.d.ts +0 -12
- 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.d.ts +1 -1
- package/button/Button.js +45 -55
- package/button/Button.stories.tsx +4 -4
- package/button/Button.test.js +11 -0
- package/button/types.d.ts +4 -0
- package/card/Card.d.ts +1 -1
- package/card/Card.js +18 -35
- package/card/Card.stories.tsx +0 -29
- package/card/types.d.ts +1 -7
- package/chip/Chip.js +23 -36
- package/chip/Chip.stories.tsx +25 -17
- package/common/OpenSans.css +68 -80
- package/common/coreTokens.d.ts +146 -0
- package/common/coreTokens.js +167 -0
- package/common/variables.d.ts +1 -144
- package/common/variables.js +952 -1095
- package/date-input/Calendar.js +2 -2
- package/dialog/Dialog.d.ts +1 -1
- package/dialog/Dialog.js +4 -22
- package/dialog/Dialog.stories.tsx +52 -176
- package/dialog/types.d.ts +0 -13
- package/dropdown/DropdownMenu.js +5 -1
- package/file-input/FileItem.js +2 -2
- package/file-input/types.d.ts +1 -1
- package/flex/Flex.js +4 -2
- package/flex/Flex.stories.tsx +35 -26
- package/flex/types.d.ts +70 -5
- package/footer/Footer.d.ts +1 -1
- package/footer/Footer.js +43 -61
- package/footer/Footer.stories.tsx +12 -89
- package/footer/Footer.test.js +3 -1
- package/footer/types.d.ts +10 -12
- 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/grid/types.js +5 -0
- package/header/Header.d.ts +1 -1
- package/header/Header.js +3 -30
- package/header/Header.stories.tsx +7 -71
- package/header/types.d.ts +0 -14
- package/inset/Inset.stories.tsx +2 -1
- package/layout/ApplicationLayout.d.ts +4 -4
- package/layout/ApplicationLayout.js +7 -4
- package/layout/types.d.ts +2 -3
- package/link/Link.js +1 -1
- package/main.d.ts +2 -1
- package/main.js +8 -0
- package/nav-tabs/NavTabs.d.ts +2 -2
- package/nav-tabs/NavTabs.js +7 -10
- package/nav-tabs/NavTabs.stories.tsx +14 -0
- package/nav-tabs/Tab.js +22 -26
- package/nav-tabs/types.d.ts +8 -9
- package/package.json +1 -1
- package/paginator/Paginator.js +1 -1
- package/paginator/Paginator.test.js +13 -0
- package/radio-group/Radio.js +10 -10
- package/radio-group/RadioGroup.js +8 -10
- package/sidenav/Icons.d.ts +7 -0
- package/sidenav/Icons.js +51 -0
- package/sidenav/Sidenav.d.ts +2 -2
- package/sidenav/Sidenav.js +65 -93
- package/sidenav/Sidenav.stories.tsx +60 -60
- package/sidenav/types.d.ts +21 -18
- package/tabs/Tab.js +1 -2
- package/tabs/Tabs.js +10 -14
- package/text-input/TextInput.js +1 -1
- package/text-input/TextInput.stories.tsx +1 -1
- package/textarea/Textarea.js +0 -1
- package/textarea/Textarea.test.js +1 -3
- package/toggle-group/ToggleGroup.d.ts +2 -2
- package/useTheme.d.ts +1 -1
- package/utils/FocusLock.js +3 -4
- package/card/ice-cream.jpg +0 -0
package/tabs/Tabs.js
CHANGED
|
@@ -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;
|
|
@@ -344,7 +344,7 @@ var DxcTabs = function DxcTabs(_ref) {
|
|
|
344
344
|
}, /*#__PURE__*/_react["default"].createElement(ScrollIndicator, {
|
|
345
345
|
onClick: scrollLeft,
|
|
346
346
|
enabled: enabledIndicator,
|
|
347
|
-
|
|
347
|
+
disabled: !scrollLeftEnabled,
|
|
348
348
|
"aria-label": translatedLabels.tabs.scrollLeft,
|
|
349
349
|
tabIndex: scrollLeftEnabled ? tabIndex : -1,
|
|
350
350
|
minHeightTabs: minHeightTabs
|
|
@@ -386,14 +386,14 @@ var DxcTabs = function DxcTabs(_ref) {
|
|
|
386
386
|
}))), /*#__PURE__*/_react["default"].createElement(ScrollIndicator, {
|
|
387
387
|
onClick: scrollRight,
|
|
388
388
|
enabled: enabledIndicator,
|
|
389
|
-
|
|
389
|
+
disabled: !scrollRightEnabled,
|
|
390
390
|
"aria-label": translatedLabels.tabs.scrollRight,
|
|
391
391
|
tabIndex: scrollRightEnabled ? tabIndex : -1,
|
|
392
392
|
minHeightTabs: minHeightTabs
|
|
393
393
|
}, arrowIcons.right))));
|
|
394
394
|
};
|
|
395
395
|
|
|
396
|
-
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) {
|
|
397
397
|
return props.theme.dividerThickness;
|
|
398
398
|
}, function (props) {
|
|
399
399
|
return props.theme.dividerColor;
|
|
@@ -419,16 +419,12 @@ var Tabs = _styledComponents["default"].div(_templateObject3 || (_templateObject
|
|
|
419
419
|
return props.theme.unselectedBackgroundColor;
|
|
420
420
|
});
|
|
421
421
|
|
|
422
|
-
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) {
|
|
423
423
|
return props.enabled ? "flex" : "none";
|
|
424
424
|
}, function (props) {
|
|
425
425
|
return props.theme.scrollButtonsWidth;
|
|
426
426
|
}, function (props) {
|
|
427
427
|
return props.minHeightTabs - 1;
|
|
428
|
-
}, function (props) {
|
|
429
|
-
return props.theme.dividerThickness;
|
|
430
|
-
}, function (props) {
|
|
431
|
-
return props.theme.dividerColor;
|
|
432
428
|
}, function (props) {
|
|
433
429
|
return "".concat(props.theme.hoverBackgroundColor, " !important");
|
|
434
430
|
}, function (props) {
|
|
@@ -439,19 +435,19 @@ var ScrollIndicator = _styledComponents["default"].button(_templateObject4 || (_
|
|
|
439
435
|
return props.theme.unselectedFontColor;
|
|
440
436
|
});
|
|
441
437
|
|
|
442
|
-
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) {
|
|
443
439
|
return "".concat(props.tabLeft, "px");
|
|
444
440
|
}, function (props) {
|
|
445
441
|
return "".concat(props.tabWidth, "px");
|
|
446
|
-
}, function (props) {
|
|
447
|
-
return props.theme.selectedUnderlineColor;
|
|
448
442
|
}, function (props) {
|
|
449
443
|
return props.theme.selectedUnderlineThickness;
|
|
444
|
+
}, function (props) {
|
|
445
|
+
return props.theme.selectedUnderlineColor;
|
|
450
446
|
}, function (props) {
|
|
451
447
|
return props.theme.disabledFontColor;
|
|
452
448
|
});
|
|
453
449
|
|
|
454
|
-
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"])));
|
|
455
451
|
|
|
456
452
|
var TabList = _styledComponents["default"].div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n min-height: ", "px;\n"])), function (props) {
|
|
457
453
|
return props.minHeightTabs;
|
package/text-input/TextInput.js
CHANGED
|
@@ -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) {
|
|
@@ -522,7 +522,7 @@ const DarkAutosuggestListbox = () => {
|
|
|
522
522
|
<Title title="Dark theme" theme="dark" level={2} />
|
|
523
523
|
<ExampleContainer>
|
|
524
524
|
<Title title="Default with opened suggestions" theme="dark" level={3} />
|
|
525
|
-
<DxcFlex direction="column" gap="
|
|
525
|
+
<DxcFlex direction="column" gap="5rem">
|
|
526
526
|
<DxcTextInput label="Label" suggestions={countries} optional placeholder="Choose an option" />
|
|
527
527
|
<DxcCheckbox
|
|
528
528
|
label="You understand the selection and give your consent"
|
package/textarea/Textarea.js
CHANGED
|
@@ -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"
|
|
@@ -85,7 +85,6 @@ describe("Textarea component tests", function () {
|
|
|
85
85
|
getByLabelText = _render7.getByLabelText;
|
|
86
86
|
|
|
87
87
|
var textarea = getByLabelText("Example label");
|
|
88
|
-
expect(textarea.getAttribute("aria-disabled")).toBe("false");
|
|
89
88
|
expect(textarea.getAttribute("aria-invalid")).toBe("false");
|
|
90
89
|
expect(textarea.getAttribute("aria-describedBy")).toBeNull();
|
|
91
90
|
expect(textarea.getAttribute("aria-required")).toBe("true");
|
|
@@ -101,7 +100,7 @@ describe("Textarea component tests", function () {
|
|
|
101
100
|
var textarea = getByLabelText("Example label");
|
|
102
101
|
expect(textarea.value).toBe("Example text");
|
|
103
102
|
});
|
|
104
|
-
test("Disabled textarea
|
|
103
|
+
test("Disabled textarea can not be modified", function () {
|
|
105
104
|
var onChange = jest.fn();
|
|
106
105
|
|
|
107
106
|
var _render9 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Textarea["default"], {
|
|
@@ -112,7 +111,6 @@ describe("Textarea component tests", function () {
|
|
|
112
111
|
getByLabelText = _render9.getByLabelText;
|
|
113
112
|
|
|
114
113
|
var textarea = getByLabelText("Example label");
|
|
115
|
-
expect(textarea.getAttribute("aria-disabled")).toBe("true");
|
|
116
114
|
|
|
117
115
|
_userEvent["default"].type(textarea, "Test");
|
|
118
116
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import
|
|
3
|
-
declare const DxcToggleGroup: ({ label, helperText, defaultValue, value, onChange, disabled, options, margin, multiple, tabIndex, }:
|
|
2
|
+
import ToggleGroupPropsType from "./types";
|
|
3
|
+
declare const DxcToggleGroup: ({ label, helperText, defaultValue, value, onChange, disabled, options, margin, multiple, tabIndex, }: ToggleGroupPropsType) => JSX.Element;
|
|
4
4
|
export default DxcToggleGroup;
|
package/useTheme.d.ts
CHANGED
|
@@ -499,7 +499,7 @@ declare const useTheme: () => {
|
|
|
499
499
|
underlineSpacing: string;
|
|
500
500
|
underlineStyle: string;
|
|
501
501
|
underlineThickness: string;
|
|
502
|
-
|
|
502
|
+
disabledFontColor: string;
|
|
503
503
|
hoverFontColor: string;
|
|
504
504
|
hoverUnderlineColor: string;
|
|
505
505
|
visitedFontColor: string;
|
package/utils/FocusLock.js
CHANGED
|
@@ -18,11 +18,10 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
18
18
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
19
19
|
|
|
20
20
|
var not = {
|
|
21
|
-
inert: ":not([inert]):not([inert] *)",
|
|
22
21
|
negTabIndex: ':not([tabindex^="-"])',
|
|
23
|
-
disabled: ":not(:disabled)
|
|
22
|
+
disabled: ":not(:disabled)"
|
|
24
23
|
};
|
|
25
|
-
var focusableQuery = ["a[href]".concat(not.
|
|
24
|
+
var focusableQuery = ["a[href]".concat(not.negTabIndex), "area[href]".concat(not.negTabIndex), "input:not([type=\"hidden\"])".concat(not.negTabIndex).concat(not.disabled), "select".concat(not.negTabIndex).concat(not.disabled), "textarea".concat(not.negTabIndex).concat(not.disabled), "button".concat(not.negTabIndex).concat(not.disabled), "details > summary:first-of-type".concat(not.negTabIndex), "iframe".concat(not.negTabIndex), "audio[controls]".concat(not.negTabIndex), "video[controls]".concat(not.negTabIndex), "[contenteditable]".concat(not.negTabIndex), "[tabindex]".concat(not.negTabIndex).concat(not.disabled)].join(",");
|
|
26
25
|
|
|
27
26
|
var getFocusableElements = function getFocusableElements(container) {
|
|
28
27
|
return Array.prototype.slice.call(container.querySelectorAll(focusableQuery)).filter(function (element) {
|
|
@@ -44,7 +43,7 @@ var attempFocus = function attempFocus(element) {
|
|
|
44
43
|
};
|
|
45
44
|
/**
|
|
46
45
|
* @param element: HTMLElement
|
|
47
|
-
* @returns boolean: true if element is contained inside a Radix Portal, false otherwise.
|
|
46
|
+
* @returns boolean: true if element is contained inside a Radix Portal, false otherwise.
|
|
48
47
|
*/
|
|
49
48
|
|
|
50
49
|
|
package/card/ice-cream.jpg
DELETED
|
Binary file
|