@dxc-technology/halstack-react 12.0.1 → 12.1.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 +3 -0
- package/HalstackContext.js +5 -1
- package/breadcrumbs/Breadcrumbs.stories.tsx +1 -1
- package/breadcrumbs/Breadcrumbs.test.js +1 -2
- package/card/Card.stories.tsx +1 -1
- package/chip/Chip.accessibility.test.js +0 -2
- package/chip/Chip.js +21 -10
- package/chip/Chip.stories.tsx +43 -79
- package/chip/types.d.ts +12 -35
- package/common/variables.d.ts +3 -0
- package/common/variables.js +4 -1
- package/contextual-menu/ContextualMenu.js +24 -4
- package/contextual-menu/ContextualMenu.stories.tsx +5 -14
- package/contextual-menu/ContextualMenu.test.js +108 -66
- package/contextual-menu/GroupItem.js +9 -9
- package/contextual-menu/ItemAction.d.ts +1 -1
- package/contextual-menu/ItemAction.js +8 -9
- package/contextual-menu/SingleItem.d.ts +1 -1
- package/contextual-menu/SingleItem.js +14 -14
- package/contextual-menu/types.d.ts +9 -6
- package/date-input/Calendar.js +46 -30
- package/date-input/DateInput.accessibility.test.js +12 -13
- package/date-input/DateInput.js +9 -3
- package/date-input/DateInput.stories.tsx +5 -6
- package/date-input/DateInput.test.js +30 -31
- package/date-input/YearPicker.js +9 -4
- package/dialog/Dialog.stories.tsx +2 -3
- package/dialog/Dialog.test.js +1 -2
- package/dropdown/Dropdown.accessibility.test.js +1 -2
- package/dropdown/Dropdown.stories.tsx +1 -1
- package/dropdown/Dropdown.test.js +1 -2
- package/file-input/FileInput.js +1 -3
- package/file-input/types.d.ts +0 -4
- package/grid/Grid.stories.tsx +3 -1
- package/header/Header.stories.tsx +1 -1
- package/icon/Icon.js +1 -1
- package/main.d.ts +0 -1
- package/main.js +0 -1
- package/number-input/NumberInput.accessibility.test.js +1 -2
- package/number-input/NumberInput.stories.tsx +2 -16
- package/number-input/NumberInput.test.js +1 -2
- package/package.json +17 -15
- package/paginator/Paginator.accessibility.test.js +1 -2
- package/paginator/Paginator.test.js +1 -2
- package/password-input/PasswordInput.accessibility.test.js +1 -2
- package/password-input/PasswordInput.stories.tsx +1 -1
- package/password-input/PasswordInput.test.js +1 -2
- package/resultset-table/ResultsetTable.accessibility.test.js +1 -2
- package/resultset-table/ResultsetTable.stories.tsx +1 -1
- package/resultset-table/ResultsetTable.test.js +1 -2
- package/select/Select.accessibility.test.js +1 -2
- package/select/Select.stories.tsx +1 -1
- package/select/Select.test.js +1 -2
- package/sidenav/Sidenav.stories.tsx +1 -1
- package/slider/Slider.accessibility.test.js +1 -2
- package/slider/Slider.test.js +1 -2
- package/table/Table.accessibility.test.js +1 -2
- package/table/Table.stories.tsx +1 -1
- package/table/Table.test.js +1 -2
- package/tabs/Tabs.stories.tsx +2 -2
- package/tag/Tag.stories.tsx +1 -1
- package/text-input/TextInput.accessibility.test.js +1 -2
- package/text-input/TextInput.stories.tsx +2 -8
- package/text-input/TextInput.test.js +1 -2
- package/textarea/Textarea.js +11 -8
- package/toggle-group/ToggleGroup.stories.tsx +1 -1
- package/typography/Typography.stories.tsx +1 -3
- package/useTheme.d.ts +3 -0
- package/utils/FocusLock.js +2 -1
- package/wizard/Wizard.stories.tsx +1 -1
- package/common/fonts.css +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { userEvent, within } from "@storybook/
|
|
2
|
+
import { userEvent, within } from "@storybook/test";
|
|
3
3
|
import DxcPasswordInput from "./PasswordInput";
|
|
4
4
|
import Title from "../../.storybook/components/Title";
|
|
5
5
|
import ExampleContainer from "../../.storybook/components/ExampleContainer";
|
|
@@ -27,7 +27,7 @@ global.ResizeObserver = /*#__PURE__*/function () {
|
|
|
27
27
|
function ResizeObserver() {
|
|
28
28
|
(0, _classCallCheck2["default"])(this, ResizeObserver);
|
|
29
29
|
}
|
|
30
|
-
(0, _createClass2["default"])(ResizeObserver, [{
|
|
30
|
+
return (0, _createClass2["default"])(ResizeObserver, [{
|
|
31
31
|
key: "observe",
|
|
32
32
|
value: function observe() {}
|
|
33
33
|
}, {
|
|
@@ -37,7 +37,6 @@ global.ResizeObserver = /*#__PURE__*/function () {
|
|
|
37
37
|
key: "disconnect",
|
|
38
38
|
value: function disconnect() {}
|
|
39
39
|
}]);
|
|
40
|
-
return ResizeObserver;
|
|
41
40
|
}();
|
|
42
41
|
describe("Password input component tests", function () {
|
|
43
42
|
test("Password input renders with label and helper text", function () {
|
|
@@ -51,7 +51,7 @@ global.ResizeObserver = /*#__PURE__*/function () {
|
|
|
51
51
|
function ResizeObserver() {
|
|
52
52
|
(0, _classCallCheck2["default"])(this, ResizeObserver);
|
|
53
53
|
}
|
|
54
|
-
(0, _createClass2["default"])(ResizeObserver, [{
|
|
54
|
+
return (0, _createClass2["default"])(ResizeObserver, [{
|
|
55
55
|
key: "observe",
|
|
56
56
|
value: function observe() {}
|
|
57
57
|
}, {
|
|
@@ -61,7 +61,6 @@ global.ResizeObserver = /*#__PURE__*/function () {
|
|
|
61
61
|
key: "disconnect",
|
|
62
62
|
value: function disconnect() {}
|
|
63
63
|
}]);
|
|
64
|
-
return ResizeObserver;
|
|
65
64
|
}();
|
|
66
65
|
var actions = [{
|
|
67
66
|
title: "icon",
|
|
@@ -2,7 +2,7 @@ import React from "react";
|
|
|
2
2
|
import DxcResultsetTable from "./ResultsetTable";
|
|
3
3
|
import Title from "../../.storybook/components/Title";
|
|
4
4
|
import ExampleContainer from "../../.storybook/components/ExampleContainer";
|
|
5
|
-
import { userEvent, within } from "@storybook/
|
|
5
|
+
import { userEvent, within } from "@storybook/test";
|
|
6
6
|
import styled from "styled-components";
|
|
7
7
|
import { HalstackProvider } from "../HalstackContext";
|
|
8
8
|
import { disabledRules } from "../../test/accessibility/rules/specific/resultset-table/disabledRules";
|
|
@@ -27,7 +27,7 @@ global.ResizeObserver = /*#__PURE__*/function () {
|
|
|
27
27
|
function ResizeObserver() {
|
|
28
28
|
(0, _classCallCheck2["default"])(this, ResizeObserver);
|
|
29
29
|
}
|
|
30
|
-
(0, _createClass2["default"])(ResizeObserver, [{
|
|
30
|
+
return (0, _createClass2["default"])(ResizeObserver, [{
|
|
31
31
|
key: "observe",
|
|
32
32
|
value: function observe() {}
|
|
33
33
|
}, {
|
|
@@ -37,7 +37,6 @@ global.ResizeObserver = /*#__PURE__*/function () {
|
|
|
37
37
|
key: "disconnect",
|
|
38
38
|
value: function disconnect() {}
|
|
39
39
|
}]);
|
|
40
|
-
return ResizeObserver;
|
|
41
40
|
}();
|
|
42
41
|
var icon = /*#__PURE__*/_react["default"].createElement("svg", {
|
|
43
42
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -130,7 +130,7 @@ global.ResizeObserver = /*#__PURE__*/function () {
|
|
|
130
130
|
function ResizeObserver() {
|
|
131
131
|
(0, _classCallCheck2["default"])(this, ResizeObserver);
|
|
132
132
|
}
|
|
133
|
-
(0, _createClass2["default"])(ResizeObserver, [{
|
|
133
|
+
return (0, _createClass2["default"])(ResizeObserver, [{
|
|
134
134
|
key: "observe",
|
|
135
135
|
value: function observe() {}
|
|
136
136
|
}, {
|
|
@@ -140,7 +140,6 @@ global.ResizeObserver = /*#__PURE__*/function () {
|
|
|
140
140
|
key: "disconnect",
|
|
141
141
|
value: function disconnect() {}
|
|
142
142
|
}]);
|
|
143
|
-
return ResizeObserver;
|
|
144
143
|
}();
|
|
145
144
|
describe("Select component accessibility tests", function () {
|
|
146
145
|
it("Should not have basic accessibility issues", /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { userEvent, within } from "@storybook/
|
|
2
|
+
import { userEvent, within } from "@storybook/test";
|
|
3
3
|
import Title from "../../.storybook/components/Title";
|
|
4
4
|
import ExampleContainer from "../../.storybook/components/ExampleContainer";
|
|
5
5
|
import DxcSelect from "./Select";
|
package/select/Select.test.js
CHANGED
|
@@ -27,7 +27,7 @@ global.ResizeObserver = /*#__PURE__*/function () {
|
|
|
27
27
|
function ResizeObserver() {
|
|
28
28
|
(0, _classCallCheck2["default"])(this, ResizeObserver);
|
|
29
29
|
}
|
|
30
|
-
(0, _createClass2["default"])(ResizeObserver, [{
|
|
30
|
+
return (0, _createClass2["default"])(ResizeObserver, [{
|
|
31
31
|
key: "observe",
|
|
32
32
|
value: function observe() {}
|
|
33
33
|
}, {
|
|
@@ -37,7 +37,6 @@ global.ResizeObserver = /*#__PURE__*/function () {
|
|
|
37
37
|
key: "disconnect",
|
|
38
38
|
value: function disconnect() {}
|
|
39
39
|
}]);
|
|
40
|
-
return ResizeObserver;
|
|
41
40
|
}();
|
|
42
41
|
var singleOptions = [{
|
|
43
42
|
label: "Option 01",
|
|
@@ -4,7 +4,7 @@ import DxcSelect from "../select/Select";
|
|
|
4
4
|
import DxcInset from "../inset/Inset";
|
|
5
5
|
import Title from "../../.storybook/components/Title";
|
|
6
6
|
import ExampleContainer from "../../.storybook/components/ExampleContainer";
|
|
7
|
-
import { userEvent, within } from "@storybook/
|
|
7
|
+
import { userEvent, within } from "@storybook/test";
|
|
8
8
|
import { HalstackProvider } from "../HalstackContext";
|
|
9
9
|
|
|
10
10
|
export default {
|
|
@@ -27,7 +27,7 @@ global.ResizeObserver = /*#__PURE__*/function () {
|
|
|
27
27
|
function ResizeObserver() {
|
|
28
28
|
(0, _classCallCheck2["default"])(this, ResizeObserver);
|
|
29
29
|
}
|
|
30
|
-
(0, _createClass2["default"])(ResizeObserver, [{
|
|
30
|
+
return (0, _createClass2["default"])(ResizeObserver, [{
|
|
31
31
|
key: "observe",
|
|
32
32
|
value: function observe() {}
|
|
33
33
|
}, {
|
|
@@ -37,7 +37,6 @@ global.ResizeObserver = /*#__PURE__*/function () {
|
|
|
37
37
|
key: "disconnect",
|
|
38
38
|
value: function disconnect() {}
|
|
39
39
|
}]);
|
|
40
|
-
return ResizeObserver;
|
|
41
40
|
}();
|
|
42
41
|
describe("Slider component accessibility tests", function () {
|
|
43
42
|
it("Should not have basic accessibility issues", /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
package/slider/Slider.test.js
CHANGED
|
@@ -25,7 +25,7 @@ global.ResizeObserver = /*#__PURE__*/function () {
|
|
|
25
25
|
function ResizeObserver() {
|
|
26
26
|
(0, _classCallCheck2["default"])(this, ResizeObserver);
|
|
27
27
|
}
|
|
28
|
-
(0, _createClass2["default"])(ResizeObserver, [{
|
|
28
|
+
return (0, _createClass2["default"])(ResizeObserver, [{
|
|
29
29
|
key: "observe",
|
|
30
30
|
value: function observe() {}
|
|
31
31
|
}, {
|
|
@@ -35,7 +35,6 @@ global.ResizeObserver = /*#__PURE__*/function () {
|
|
|
35
35
|
key: "disconnect",
|
|
36
36
|
value: function disconnect() {}
|
|
37
37
|
}]);
|
|
38
|
-
return ResizeObserver;
|
|
39
38
|
}();
|
|
40
39
|
describe("Slider component tests", function () {
|
|
41
40
|
test("Slider renders with correct text and label id", function () {
|
|
@@ -37,7 +37,7 @@ global.ResizeObserver = /*#__PURE__*/function () {
|
|
|
37
37
|
function ResizeObserver() {
|
|
38
38
|
(0, _classCallCheck2["default"])(this, ResizeObserver);
|
|
39
39
|
}
|
|
40
|
-
(0, _createClass2["default"])(ResizeObserver, [{
|
|
40
|
+
return (0, _createClass2["default"])(ResizeObserver, [{
|
|
41
41
|
key: "observe",
|
|
42
42
|
value: function observe() {}
|
|
43
43
|
}, {
|
|
@@ -47,7 +47,6 @@ global.ResizeObserver = /*#__PURE__*/function () {
|
|
|
47
47
|
key: "disconnect",
|
|
48
48
|
value: function disconnect() {}
|
|
49
49
|
}]);
|
|
50
|
-
return ResizeObserver;
|
|
51
50
|
}();
|
|
52
51
|
describe("Table component accessibility tests", function () {
|
|
53
52
|
it("Should not have basic accessibility issues", /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
package/table/Table.stories.tsx
CHANGED
|
@@ -3,7 +3,7 @@ import DxcTable from "./Table";
|
|
|
3
3
|
import Title from "../../.storybook/components/Title";
|
|
4
4
|
import ExampleContainer from "../../.storybook/components/ExampleContainer";
|
|
5
5
|
import { HalstackProvider } from "../HalstackContext";
|
|
6
|
-
import { userEvent, within } from "@storybook/
|
|
6
|
+
import { userEvent, within } from "@storybook/test";
|
|
7
7
|
import { disabledRules } from "../../test/accessibility/rules/specific/table/disabledRules";
|
|
8
8
|
import preview from "../../.storybook/preview";
|
|
9
9
|
|
package/table/Table.test.js
CHANGED
|
@@ -26,7 +26,7 @@ global.ResizeObserver = /*#__PURE__*/function () {
|
|
|
26
26
|
function ResizeObserver() {
|
|
27
27
|
(0, _classCallCheck2["default"])(this, ResizeObserver);
|
|
28
28
|
}
|
|
29
|
-
(0, _createClass2["default"])(ResizeObserver, [{
|
|
29
|
+
return (0, _createClass2["default"])(ResizeObserver, [{
|
|
30
30
|
key: "observe",
|
|
31
31
|
value: function observe() {}
|
|
32
32
|
}, {
|
|
@@ -36,7 +36,6 @@ global.ResizeObserver = /*#__PURE__*/function () {
|
|
|
36
36
|
key: "disconnect",
|
|
37
37
|
value: function disconnect() {}
|
|
38
38
|
}]);
|
|
39
|
-
return ResizeObserver;
|
|
40
39
|
}();
|
|
41
40
|
var icon = /*#__PURE__*/_react["default"].createElement("svg", {
|
|
42
41
|
xmlns: "http://www.w3.org/2000/svg",
|
package/tabs/Tabs.stories.tsx
CHANGED
|
@@ -3,7 +3,7 @@ import DxcTabs from "./Tabs";
|
|
|
3
3
|
import Title from "../../.storybook/components/Title";
|
|
4
4
|
import ExampleContainer from "../../.storybook/components/ExampleContainer";
|
|
5
5
|
import { HalstackProvider } from "../HalstackContext";
|
|
6
|
-
import { INITIAL_VIEWPORTS } from
|
|
6
|
+
import { INITIAL_VIEWPORTS } from "@storybook/addon-viewport";
|
|
7
7
|
|
|
8
8
|
export default {
|
|
9
9
|
title: "Tabs",
|
|
@@ -81,7 +81,7 @@ const tabsNotification = tabs.map((tab, index) => ({
|
|
|
81
81
|
}));
|
|
82
82
|
|
|
83
83
|
const tabsIcon = tabs.map((tab, index) =>
|
|
84
|
-
index <= tabs.length / 2 ? { ...tab, icon: "mail" } : { ...tab, icon: iconSVG }
|
|
84
|
+
index <= tabs.length / 2 ? { ...tab, icon: "mail" } : { ...tab, icon: iconSVG },
|
|
85
85
|
);
|
|
86
86
|
|
|
87
87
|
const tabsNotificationIcon = tabsNotification.map((tab) => ({ ...tab, icon: iconSVG }));
|
package/tag/Tag.stories.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { userEvent, within } from "@storybook/
|
|
2
|
+
import { userEvent, within } from "@storybook/test";
|
|
3
3
|
import Title from "../../.storybook/components/Title";
|
|
4
4
|
import ExampleContainer from "../../.storybook/components/ExampleContainer";
|
|
5
5
|
import DxcTag from "./Tag";
|
|
@@ -45,7 +45,7 @@ global.ResizeObserver = /*#__PURE__*/function () {
|
|
|
45
45
|
function ResizeObserver() {
|
|
46
46
|
(0, _classCallCheck2["default"])(this, ResizeObserver);
|
|
47
47
|
}
|
|
48
|
-
(0, _createClass2["default"])(ResizeObserver, [{
|
|
48
|
+
return (0, _createClass2["default"])(ResizeObserver, [{
|
|
49
49
|
key: "observe",
|
|
50
50
|
value: function observe() {}
|
|
51
51
|
}, {
|
|
@@ -55,7 +55,6 @@ global.ResizeObserver = /*#__PURE__*/function () {
|
|
|
55
55
|
key: "disconnect",
|
|
56
56
|
value: function disconnect() {}
|
|
57
57
|
}]);
|
|
58
|
-
return ResizeObserver;
|
|
59
58
|
}();
|
|
60
59
|
describe("TextInput component accessibility tests", function () {
|
|
61
60
|
it("Should not have basic accessibility issues", /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { userEvent, within } from "@storybook/
|
|
2
|
+
import { userEvent, within } from "@storybook/test";
|
|
3
3
|
import Title from "../../.storybook/components/Title";
|
|
4
4
|
import ExampleContainer from "../../.storybook/components/ExampleContainer";
|
|
5
5
|
import DxcTextInput from "./TextInput";
|
|
@@ -27,13 +27,7 @@ const action = {
|
|
|
27
27
|
const actionLargeIconSVG = {
|
|
28
28
|
onClick: () => {},
|
|
29
29
|
icon: (
|
|
30
|
-
<svg
|
|
31
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
32
|
-
height="48px"
|
|
33
|
-
viewBox="0 0 24 24"
|
|
34
|
-
width="48px"
|
|
35
|
-
fill="currentColor"
|
|
36
|
-
>
|
|
30
|
+
<svg xmlns="http://www.w3.org/2000/svg" height="48px" viewBox="0 0 24 24" width="48px" fill="currentColor">
|
|
37
31
|
<path d="M0 0h24v24H0V0z" fill="none" />
|
|
38
32
|
<path d="M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm.5-13H11v6l5.25 3.15.75-1.23-4.5-2.67z" />
|
|
39
33
|
</svg>
|
|
@@ -27,7 +27,7 @@ global.ResizeObserver = /*#__PURE__*/function () {
|
|
|
27
27
|
function ResizeObserver() {
|
|
28
28
|
(0, _classCallCheck2["default"])(this, ResizeObserver);
|
|
29
29
|
}
|
|
30
|
-
(0, _createClass2["default"])(ResizeObserver, [{
|
|
30
|
+
return (0, _createClass2["default"])(ResizeObserver, [{
|
|
31
31
|
key: "observe",
|
|
32
32
|
value: function observe() {}
|
|
33
33
|
}, {
|
|
@@ -37,7 +37,6 @@ global.ResizeObserver = /*#__PURE__*/function () {
|
|
|
37
37
|
key: "disconnect",
|
|
38
38
|
value: function disconnect() {}
|
|
39
39
|
}]);
|
|
40
|
-
return ResizeObserver;
|
|
41
40
|
}();
|
|
42
41
|
var countries = ["Afghanistan", "Albania", "Algeria", "Andorra", "Angola", "Antigua and Barbuda", "Bahamas", "Bahrain", "Bangladesh", "Barbados", "Cabo Verde", "Cambodia", "Cameroon", "Canada", "Cayman Islands, The", "Central African Republic", "Chad", "Democratic Republic of the Congo", "Dominican Republic", "Dominica", "Denmark", "Djibouti"];
|
|
43
42
|
var specialCharacters = ["/", "\\", "*", "(", ")", "[", "]", "+", "?", "*{[]}|"];
|
package/textarea/Textarea.js
CHANGED
|
@@ -62,6 +62,7 @@ var DxcTextarea = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref)
|
|
|
62
62
|
var colorsTheme = (0, _useTheme["default"])();
|
|
63
63
|
var translatedLabels = (0, _useTranslatedLabels["default"])();
|
|
64
64
|
var textareaRef = (0, _react.useRef)(null);
|
|
65
|
+
var prevValueRef = (0, _react.useRef)(null);
|
|
65
66
|
var errorId = "error-".concat(textareaId);
|
|
66
67
|
var isNotOptional = function isNotOptional(value) {
|
|
67
68
|
return value === "" && !optional;
|
|
@@ -84,13 +85,6 @@ var DxcTextarea = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref)
|
|
|
84
85
|
value: newValue
|
|
85
86
|
});
|
|
86
87
|
};
|
|
87
|
-
var autoVerticalGrow = function autoVerticalGrow() {
|
|
88
|
-
var textareaLineHeight = parseInt(window.getComputedStyle(textareaRef.current)["line-height"]);
|
|
89
|
-
var textareaPaddingTopBottom = parseInt(window.getComputedStyle(textareaRef.current)["padding-top"]) * 2;
|
|
90
|
-
textareaRef.current.style.height = "".concat(textareaLineHeight * rows, "px");
|
|
91
|
-
var newHeight = textareaRef.current.scrollHeight - textareaPaddingTopBottom;
|
|
92
|
-
textareaRef.current.style.height = "".concat(newHeight, "px");
|
|
93
|
-
};
|
|
94
88
|
var handleOnBlur = function handleOnBlur(event) {
|
|
95
89
|
if (isNotOptional(event.target.value)) onBlur === null || onBlur === void 0 ? void 0 : onBlur({
|
|
96
90
|
value: event.target.value,
|
|
@@ -107,8 +101,17 @@ var DxcTextarea = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref)
|
|
|
107
101
|
};
|
|
108
102
|
var handleOnChange = function handleOnChange(event) {
|
|
109
103
|
changeValue(event.target.value);
|
|
110
|
-
verticalGrow === "auto" && autoVerticalGrow();
|
|
111
104
|
};
|
|
105
|
+
(0, _react.useEffect)(function () {
|
|
106
|
+
if (verticalGrow === "auto" && prevValueRef.current !== (value !== null && value !== void 0 ? value : innerValue)) {
|
|
107
|
+
var textareaLineHeight = parseInt(window.getComputedStyle(textareaRef.current)["line-height"]);
|
|
108
|
+
var textareaPaddingTopBottom = parseInt(window.getComputedStyle(textareaRef.current)["padding-top"]) * 2;
|
|
109
|
+
textareaRef.current.style.height = "".concat(textareaLineHeight * rows, "px");
|
|
110
|
+
var newHeight = textareaRef.current.scrollHeight - textareaPaddingTopBottom;
|
|
111
|
+
textareaRef.current.style.height = "".concat(newHeight, "px");
|
|
112
|
+
prevValueRef.current = value !== null && value !== void 0 ? value : innerValue;
|
|
113
|
+
}
|
|
114
|
+
}, [verticalGrow, value, innerValue, rows]);
|
|
112
115
|
return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
113
116
|
theme: colorsTheme.textarea
|
|
114
117
|
}, /*#__PURE__*/_react["default"].createElement(TextareaContainer, {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { userEvent, within } from "@storybook/
|
|
2
|
+
import { userEvent, within } from "@storybook/test";
|
|
3
3
|
import DxcToggleGroup from "./ToggleGroup";
|
|
4
4
|
import Title from "../../.storybook/components/Title";
|
|
5
5
|
import ExampleContainer from "../../.storybook/components/ExampleContainer";
|
|
@@ -140,9 +140,7 @@ export const Chromatic = () => (
|
|
|
140
140
|
<ExampleContainer>
|
|
141
141
|
<Title title="Typography whitespace" theme="light" level={4} />
|
|
142
142
|
<div style={{ margin: "50px", border: "1px solid red", width: "125px" }}>
|
|
143
|
-
<DxcTypography fontSize="2rem">
|
|
144
|
-
{" "} Normal: A bunch of words you see.
|
|
145
|
-
</DxcTypography>
|
|
143
|
+
<DxcTypography fontSize="2rem">{" "} Normal: A bunch of words you see.</DxcTypography>
|
|
146
144
|
</div>
|
|
147
145
|
<div style={{ margin: "50px", border: "1px solid red", width: "125px" }}>
|
|
148
146
|
<DxcTypography whiteSpace="nowrap" fontSize="2rem">
|
package/useTheme.d.ts
CHANGED
|
@@ -191,11 +191,13 @@ declare const useTheme: () => {
|
|
|
191
191
|
}>;
|
|
192
192
|
chip?: Partial<{
|
|
193
193
|
backgroundColor: string;
|
|
194
|
+
disabledBackgroundColor: string;
|
|
194
195
|
fontFamily: string;
|
|
195
196
|
fontSize: string;
|
|
196
197
|
fontStyle: string;
|
|
197
198
|
fontWeight: string;
|
|
198
199
|
fontColor: string;
|
|
200
|
+
disabledFontColor: string;
|
|
199
201
|
borderColor: string;
|
|
200
202
|
borderRadius: string;
|
|
201
203
|
borderThickness: string;
|
|
@@ -213,6 +215,7 @@ declare const useTheme: () => {
|
|
|
213
215
|
focusColor: string;
|
|
214
216
|
focusBorderStyle: string;
|
|
215
217
|
focusBorderThickness: string;
|
|
218
|
+
focusBorderRadius: string;
|
|
216
219
|
}>;
|
|
217
220
|
dateInput?: Partial<{
|
|
218
221
|
pickerBackgroundColor: string;
|
package/utils/FocusLock.js
CHANGED
|
@@ -95,7 +95,8 @@ var FocusLock = function FocusLock(_ref) {
|
|
|
95
95
|
});
|
|
96
96
|
}, [focusableElements]);
|
|
97
97
|
var focusLast = function focusLast() {
|
|
98
|
-
|
|
98
|
+
var _focusableElements$re;
|
|
99
|
+
focusableElements === null || focusableElements === void 0 ? void 0 : (_focusableElements$re = focusableElements.reverse()) === null || _focusableElements$re === void 0 ? void 0 : _focusableElements$re.some(function (element) {
|
|
99
100
|
return attemptFocus(element);
|
|
100
101
|
});
|
|
101
102
|
};
|
|
@@ -2,7 +2,7 @@ import React from "react";
|
|
|
2
2
|
import DxcWizard from "./Wizard";
|
|
3
3
|
import Title from "../../.storybook/components/Title";
|
|
4
4
|
import ExampleContainer from "../../.storybook/components/ExampleContainer";
|
|
5
|
-
import { userEvent, within } from "@storybook/
|
|
5
|
+
import { userEvent, within } from "@storybook/test";
|
|
6
6
|
import { HalstackProvider } from "../HalstackContext";
|
|
7
7
|
|
|
8
8
|
export default {
|
package/common/fonts.css
DELETED