@dxc-technology/halstack-react 0.0.0-9bd9511 → 0.0.0-9c20370
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 +3 -3
- package/BackgroundColorContext.js +12 -2
- package/HalstackContext.d.ts +1330 -7
- package/HalstackContext.js +84 -67
- package/accordion/Accordion.d.ts +1 -1
- package/accordion/Accordion.js +74 -55
- package/accordion/Accordion.stories.tsx +3 -101
- package/accordion/Accordion.test.js +34 -19
- package/accordion/types.d.ts +4 -16
- package/accordion-group/AccordionGroup.d.ts +4 -3
- package/accordion-group/AccordionGroup.js +49 -42
- package/accordion-group/AccordionGroup.stories.tsx +77 -76
- package/accordion-group/AccordionGroup.test.js +62 -54
- package/accordion-group/AccordionGroupAccordion.d.ts +4 -0
- package/accordion-group/AccordionGroupAccordion.js +43 -0
- package/accordion-group/types.d.ts +6 -18
- package/alert/Alert.js +47 -20
- package/alert/Alert.test.js +46 -29
- package/alert/types.d.ts +3 -3
- package/badge/Badge.js +14 -2
- package/badge/types.d.ts +1 -1
- package/bleed/Bleed.js +21 -13
- package/bleed/Bleed.stories.tsx +1 -0
- package/bleed/types.d.ts +2 -2
- package/box/Box.d.ts +1 -1
- package/box/Box.js +33 -33
- package/box/Box.stories.tsx +25 -53
- package/box/Box.test.js +7 -2
- package/box/types.d.ts +3 -15
- package/bulleted-list/BulletedList.js +36 -9
- package/bulleted-list/BulletedList.stories.tsx +7 -1
- package/bulleted-list/types.d.ts +32 -5
- package/button/Button.d.ts +1 -1
- package/button/Button.js +83 -71
- package/button/Button.stories.tsx +4 -4
- package/button/Button.test.js +28 -8
- package/button/types.d.ts +8 -4
- package/card/Card.d.ts +1 -1
- package/card/Card.js +67 -62
- package/card/Card.stories.tsx +12 -42
- package/card/Card.test.js +22 -11
- package/card/types.d.ts +4 -10
- package/checkbox/Checkbox.js +71 -27
- package/checkbox/Checkbox.test.js +60 -33
- package/checkbox/types.d.ts +4 -4
- package/chip/Chip.js +51 -48
- package/chip/Chip.stories.tsx +25 -17
- package/chip/Chip.test.js +29 -17
- package/chip/types.d.ts +4 -4
- 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 +8 -3
- package/common/variables.d.ts +226 -175
- package/common/variables.js +956 -1133
- package/date-input/Calendar.js +55 -12
- package/date-input/DateInput.js +82 -35
- package/date-input/DateInput.test.js +351 -164
- package/date-input/DatePicker.js +38 -8
- package/date-input/Icons.js +12 -0
- package/date-input/YearPicker.js +30 -5
- package/date-input/types.d.ts +7 -7
- package/dialog/Dialog.d.ts +1 -1
- package/dialog/Dialog.js +83 -86
- package/dialog/Dialog.stories.tsx +127 -221
- package/dialog/Dialog.test.js +331 -18
- package/dialog/types.d.ts +1 -14
- package/dropdown/Dropdown.js +86 -32
- package/dropdown/Dropdown.test.js +211 -104
- package/dropdown/DropdownMenu.js +22 -8
- package/dropdown/DropdownMenuItem.js +15 -6
- package/dropdown/types.d.ts +8 -8
- package/file-input/FileInput.js +218 -134
- package/file-input/FileInput.test.js +343 -331
- package/file-input/FileItem.js +39 -12
- package/file-input/types.d.ts +10 -10
- package/flex/Flex.js +39 -25
- package/flex/Flex.stories.tsx +35 -26
- package/flex/types.d.ts +74 -9
- package/footer/Footer.d.ts +1 -1
- package/footer/Footer.js +80 -68
- package/footer/Footer.stories.tsx +12 -89
- package/footer/Footer.test.js +47 -40
- package/footer/Icons.js +4 -0
- package/footer/types.d.ts +15 -17
- 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 +4 -3
- package/header/Header.js +72 -55
- package/header/Header.stories.tsx +7 -71
- package/header/Header.test.js +26 -13
- package/header/Icons.js +4 -0
- package/header/types.d.ts +2 -16
- package/heading/Heading.js +28 -7
- package/heading/Heading.test.js +88 -71
- package/heading/types.d.ts +3 -3
- package/inset/Inset.js +21 -13
- package/inset/Inset.stories.tsx +2 -1
- package/inset/types.d.ts +2 -2
- package/layout/ApplicationLayout.d.ts +5 -5
- package/layout/ApplicationLayout.js +57 -15
- package/layout/Icons.js +10 -0
- package/layout/SidenavContext.d.ts +1 -1
- package/layout/SidenavContext.js +4 -0
- package/layout/types.d.ts +5 -6
- package/link/Link.js +41 -21
- package/link/Link.test.js +42 -26
- package/link/types.d.ts +4 -4
- package/main.d.ts +2 -1
- package/main.js +55 -0
- package/nav-tabs/NavTabs.d.ts +2 -2
- package/nav-tabs/NavTabs.js +43 -16
- package/nav-tabs/NavTabs.stories.tsx +14 -0
- package/nav-tabs/NavTabs.test.js +44 -37
- package/nav-tabs/Tab.js +71 -45
- package/nav-tabs/types.d.ts +10 -11
- package/number-input/NumberInput.js +30 -20
- package/number-input/NumberInput.test.js +249 -113
- package/number-input/NumberInputContext.js +5 -0
- package/number-input/numberInputContextTypes.d.ts +1 -1
- package/number-input/types.d.ts +4 -4
- package/package.json +7 -7
- package/paginator/Icons.js +10 -0
- package/paginator/Paginator.js +39 -17
- package/paginator/Paginator.test.js +156 -104
- package/paginator/types.d.ts +1 -1
- package/paragraph/Paragraph.d.ts +3 -4
- package/paragraph/Paragraph.js +18 -8
- package/password-input/PasswordInput.js +51 -22
- package/password-input/PasswordInput.test.js +94 -51
- package/password-input/types.d.ts +4 -4
- package/progress-bar/ProgressBar.d.ts +2 -2
- package/progress-bar/ProgressBar.js +39 -14
- package/progress-bar/ProgressBar.test.js +53 -36
- package/progress-bar/types.d.ts +4 -3
- package/quick-nav/QuickNav.js +24 -2
- package/quick-nav/types.d.ts +2 -2
- package/radio-group/Radio.js +53 -22
- package/radio-group/RadioGroup.js +84 -41
- package/radio-group/RadioGroup.test.js +288 -186
- package/radio-group/types.d.ts +4 -4
- package/resultsetTable/Icons.js +3 -0
- package/resultsetTable/ResultsetTable.js +56 -21
- package/resultsetTable/ResultsetTable.test.js +75 -42
- package/resultsetTable/types.d.ts +5 -5
- package/select/Icons.js +3 -0
- package/select/Listbox.js +35 -10
- package/select/Option.js +24 -8
- package/select/Select.js +143 -56
- package/select/Select.test.js +839 -456
- package/select/types.d.ts +12 -12
- package/sidenav/Icons.d.ts +7 -0
- package/sidenav/Icons.js +51 -0
- package/sidenav/Sidenav.d.ts +2 -2
- package/sidenav/Sidenav.js +116 -104
- package/sidenav/Sidenav.stories.tsx +60 -60
- package/sidenav/Sidenav.test.js +10 -3
- package/sidenav/types.d.ts +26 -23
- package/slider/Slider.js +84 -38
- package/slider/Slider.test.js +104 -76
- package/slider/types.d.ts +4 -4
- package/spinner/Spinner.js +51 -28
- package/spinner/Spinner.stories.jsx +28 -28
- package/spinner/Spinner.test.js +35 -26
- package/spinner/types.d.ts +3 -3
- package/switch/Switch.js +66 -24
- package/switch/Switch.test.js +97 -52
- package/switch/types.d.ts +4 -4
- package/table/Table.js +22 -4
- package/table/Table.test.js +7 -2
- package/table/types.d.ts +3 -3
- package/tabs/Tab.js +39 -22
- package/tabs/Tabs.js +131 -62
- package/tabs/Tabs.test.js +122 -67
- package/tabs/types.d.ts +8 -8
- package/tag/Tag.js +54 -27
- package/tag/Tag.test.js +31 -20
- package/tag/types.d.ts +7 -7
- package/text-input/Icons.js +3 -0
- package/text-input/Suggestion.js +24 -8
- package/text-input/Suggestions.js +36 -11
- package/text-input/TextInput.js +144 -59
- package/text-input/TextInput.stories.tsx +1 -1
- package/text-input/TextInput.test.js +858 -539
- package/text-input/types.d.ts +9 -9
- package/textarea/Textarea.js +73 -38
- package/textarea/Textarea.test.js +173 -98
- package/textarea/types.d.ts +4 -4
- package/toggle-group/ToggleGroup.d.ts +2 -2
- package/toggle-group/ToggleGroup.js +59 -21
- package/toggle-group/ToggleGroup.test.js +72 -40
- package/toggle-group/types.d.ts +11 -11
- package/typography/Typography.d.ts +2 -2
- package/typography/Typography.js +23 -110
- package/typography/Typography.stories.tsx +1 -1
- package/typography/types.d.ts +1 -1
- package/useTheme.d.ts +1234 -1
- package/useTheme.js +6 -0
- package/useTranslatedLabels.d.ts +84 -2
- package/useTranslatedLabels.js +5 -0
- 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 +47 -13
- package/wizard/Wizard.test.js +81 -54
- package/wizard/types.d.ts +7 -8
- package/card/ice-cream.jpg +0 -0
- package/translatedLabelsType.d.ts +0 -82
- /package/{translatedLabelsType.js → grid/types.js} +0 -0
package/text-input/types.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
|
|
3
|
-
type Margin = {
|
|
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;
|
|
7
7
|
right?: Space;
|
|
8
8
|
};
|
|
9
|
-
type SVG = React.ReactNode & React.SVGProps<SVGSVGElement>;
|
|
10
|
-
type Action = {
|
|
9
|
+
declare type SVG = React.ReactNode & React.SVGProps<SVGSVGElement>;
|
|
10
|
+
declare type Action = {
|
|
11
11
|
/**
|
|
12
12
|
* This function will be called when the user clicks the action.
|
|
13
13
|
*/
|
|
@@ -21,7 +21,7 @@ type Action = {
|
|
|
21
21
|
*/
|
|
22
22
|
title?: string;
|
|
23
23
|
};
|
|
24
|
-
type Props = {
|
|
24
|
+
declare type Props = {
|
|
25
25
|
/**
|
|
26
26
|
* Text to be placed above the input. This label will be used as the aria-label attribute of the list of suggestions.
|
|
27
27
|
*/
|
|
@@ -162,7 +162,7 @@ type Props = {
|
|
|
162
162
|
/**
|
|
163
163
|
* List of suggestions of an Text Input component.
|
|
164
164
|
*/
|
|
165
|
-
export type SuggestionsProps = {
|
|
165
|
+
export declare type SuggestionsProps = {
|
|
166
166
|
id: string;
|
|
167
167
|
value: string;
|
|
168
168
|
suggestions: string[];
|
|
@@ -176,11 +176,11 @@ export type SuggestionsProps = {
|
|
|
176
176
|
/**
|
|
177
177
|
* Reference to the component.
|
|
178
178
|
*/
|
|
179
|
-
export type RefType = HTMLDivElement;
|
|
179
|
+
export declare type RefType = HTMLDivElement;
|
|
180
180
|
/**
|
|
181
181
|
* Single suggestion of an Text Input component.
|
|
182
182
|
*/
|
|
183
|
-
export type SuggestionProps = {
|
|
183
|
+
export declare type SuggestionProps = {
|
|
184
184
|
id: string;
|
|
185
185
|
value: string;
|
|
186
186
|
onClick: (suggestion: string) => void;
|
|
@@ -189,7 +189,7 @@ export type SuggestionProps = {
|
|
|
189
189
|
visuallyFocused: boolean;
|
|
190
190
|
highlighted: boolean;
|
|
191
191
|
};
|
|
192
|
-
export type AutosuggestWrapperProps = {
|
|
192
|
+
export declare type AutosuggestWrapperProps = {
|
|
193
193
|
condition: boolean;
|
|
194
194
|
wrapper: (children: React.ReactNode) => JSX.Element;
|
|
195
195
|
children: React.ReactNode;
|
package/textarea/Textarea.js
CHANGED
|
@@ -1,77 +1,101 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
4
5
|
var _typeof3 = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
5
7
|
Object.defineProperty(exports, "__esModule", {
|
|
6
8
|
value: true
|
|
7
9
|
});
|
|
8
10
|
exports["default"] = void 0;
|
|
11
|
+
|
|
9
12
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
13
|
+
|
|
10
14
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
15
|
+
|
|
11
16
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
17
|
+
|
|
12
18
|
var _react = _interopRequireWildcard(require("react"));
|
|
19
|
+
|
|
13
20
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
14
|
-
|
|
21
|
+
|
|
22
|
+
var _utils = require("../common/utils");
|
|
23
|
+
|
|
15
24
|
var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
25
|
+
|
|
16
26
|
var _useTranslatedLabels = _interopRequireDefault(require("../useTranslatedLabels"));
|
|
27
|
+
|
|
17
28
|
var _variables = require("../common/variables");
|
|
29
|
+
|
|
18
30
|
var _uuid = require("uuid");
|
|
31
|
+
|
|
19
32
|
var _BackgroundColorContext = _interopRequireDefault(require("../BackgroundColorContext"));
|
|
33
|
+
|
|
20
34
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
|
|
35
|
+
|
|
21
36
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
37
|
+
|
|
22
38
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof3(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; }
|
|
39
|
+
|
|
23
40
|
var patternMatch = function patternMatch(pattern, value) {
|
|
24
41
|
return new RegExp(pattern).test(value);
|
|
25
42
|
};
|
|
43
|
+
|
|
26
44
|
var DxcTextarea = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
|
|
27
45
|
var label = _ref.label,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
46
|
+
_ref$name = _ref.name,
|
|
47
|
+
name = _ref$name === void 0 ? "" : _ref$name,
|
|
48
|
+
_ref$defaultValue = _ref.defaultValue,
|
|
49
|
+
defaultValue = _ref$defaultValue === void 0 ? "" : _ref$defaultValue,
|
|
50
|
+
value = _ref.value,
|
|
51
|
+
helperText = _ref.helperText,
|
|
52
|
+
_ref$placeholder = _ref.placeholder,
|
|
53
|
+
placeholder = _ref$placeholder === void 0 ? "" : _ref$placeholder,
|
|
54
|
+
_ref$disabled = _ref.disabled,
|
|
55
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
56
|
+
_ref$optional = _ref.optional,
|
|
57
|
+
optional = _ref$optional === void 0 ? false : _ref$optional,
|
|
58
|
+
_ref$verticalGrow = _ref.verticalGrow,
|
|
59
|
+
verticalGrow = _ref$verticalGrow === void 0 ? "auto" : _ref$verticalGrow,
|
|
60
|
+
_ref$rows = _ref.rows,
|
|
61
|
+
rows = _ref$rows === void 0 ? 4 : _ref$rows,
|
|
62
|
+
onChange = _ref.onChange,
|
|
63
|
+
onBlur = _ref.onBlur,
|
|
64
|
+
error = _ref.error,
|
|
65
|
+
pattern = _ref.pattern,
|
|
66
|
+
minLength = _ref.minLength,
|
|
67
|
+
maxLength = _ref.maxLength,
|
|
68
|
+
_ref$autocomplete = _ref.autocomplete,
|
|
69
|
+
autocomplete = _ref$autocomplete === void 0 ? "off" : _ref$autocomplete,
|
|
70
|
+
margin = _ref.margin,
|
|
71
|
+
_ref$size = _ref.size,
|
|
72
|
+
size = _ref$size === void 0 ? "medium" : _ref$size,
|
|
73
|
+
_ref$tabIndex = _ref.tabIndex,
|
|
74
|
+
tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex;
|
|
75
|
+
|
|
57
76
|
var _useState = (0, _react.useState)(defaultValue),
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
77
|
+
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
78
|
+
innerValue = _useState2[0],
|
|
79
|
+
setInnerValue = _useState2[1];
|
|
80
|
+
|
|
61
81
|
var _useState3 = (0, _react.useState)("textarea-".concat((0, _uuid.v4)())),
|
|
62
|
-
|
|
63
|
-
|
|
82
|
+
_useState4 = (0, _slicedToArray2["default"])(_useState3, 1),
|
|
83
|
+
textareaId = _useState4[0];
|
|
84
|
+
|
|
64
85
|
var colorsTheme = (0, _useTheme["default"])();
|
|
65
86
|
var backgroundType = (0, _react.useContext)(_BackgroundColorContext["default"]);
|
|
66
87
|
var translatedLabels = (0, _useTranslatedLabels["default"])();
|
|
67
88
|
var textareaRef = (0, _react.useRef)(null);
|
|
68
89
|
var errorId = "error-".concat(textareaId);
|
|
90
|
+
|
|
69
91
|
var isNotOptional = function isNotOptional(value) {
|
|
70
92
|
return value === "" && !optional;
|
|
71
93
|
};
|
|
94
|
+
|
|
72
95
|
var isLengthIncorrect = function isLengthIncorrect(value) {
|
|
73
96
|
return value !== "" && minLength && maxLength && (value.length < minLength || value.length > maxLength);
|
|
74
97
|
};
|
|
98
|
+
|
|
75
99
|
var changeValue = function changeValue(newValue) {
|
|
76
100
|
value !== null && value !== void 0 ? value : setInnerValue(newValue);
|
|
77
101
|
if (isNotOptional(newValue)) onChange === null || onChange === void 0 ? void 0 : onChange({
|
|
@@ -87,6 +111,7 @@ var DxcTextarea = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref)
|
|
|
87
111
|
value: newValue
|
|
88
112
|
});
|
|
89
113
|
};
|
|
114
|
+
|
|
90
115
|
var handleTOnBlur = function handleTOnBlur(event) {
|
|
91
116
|
if (isNotOptional(event.target.value)) onBlur === null || onBlur === void 0 ? void 0 : onBlur({
|
|
92
117
|
value: event.target.value,
|
|
@@ -101,9 +126,11 @@ var DxcTextarea = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref)
|
|
|
101
126
|
value: event.target.value
|
|
102
127
|
});
|
|
103
128
|
};
|
|
129
|
+
|
|
104
130
|
var handleTOnChange = function handleTOnChange(event) {
|
|
105
131
|
changeValue(event.target.value);
|
|
106
132
|
};
|
|
133
|
+
|
|
107
134
|
(0, _react.useLayoutEffect)(function () {
|
|
108
135
|
if (verticalGrow === "auto") {
|
|
109
136
|
var textareaLineHeight = parseInt(window.getComputedStyle(textareaRef.current)["line-height"]);
|
|
@@ -114,7 +141,7 @@ var DxcTextarea = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref)
|
|
|
114
141
|
}
|
|
115
142
|
}, [value, verticalGrow, rows, innerValue]);
|
|
116
143
|
return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
117
|
-
theme: colorsTheme
|
|
144
|
+
theme: colorsTheme.textarea
|
|
118
145
|
}, /*#__PURE__*/_react["default"].createElement(TextareaContainer, {
|
|
119
146
|
margin: margin,
|
|
120
147
|
size: size,
|
|
@@ -144,7 +171,6 @@ var DxcTextarea = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref)
|
|
|
144
171
|
backgroundType: backgroundType,
|
|
145
172
|
ref: textareaRef,
|
|
146
173
|
tabIndex: tabIndex,
|
|
147
|
-
"aria-disabled": disabled,
|
|
148
174
|
"aria-invalid": error ? "true" : "false",
|
|
149
175
|
"aria-errormessage": error ? errorId : undefined,
|
|
150
176
|
"aria-required": optional ? "false" : "true"
|
|
@@ -154,16 +180,19 @@ var DxcTextarea = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref)
|
|
|
154
180
|
"aria-live": error ? "assertive" : "off"
|
|
155
181
|
}, error)));
|
|
156
182
|
});
|
|
183
|
+
|
|
157
184
|
var sizes = {
|
|
158
185
|
small: "240px",
|
|
159
186
|
medium: "360px",
|
|
160
187
|
large: "480px",
|
|
161
188
|
fillParent: "100%"
|
|
162
189
|
};
|
|
190
|
+
|
|
163
191
|
var calculateWidth = function calculateWidth(margin, size) {
|
|
164
192
|
return size === "fillParent" ? "calc(".concat(sizes[size], " - ").concat((0, _utils.getMargin)(margin, "left"), " - ").concat((0, _utils.getMargin)(margin, "right"), ")") : sizes[size];
|
|
165
193
|
};
|
|
166
|
-
|
|
194
|
+
|
|
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) {
|
|
167
196
|
return calculateWidth(props.margin, props.size);
|
|
168
197
|
}, function (props) {
|
|
169
198
|
return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
|
|
@@ -176,6 +205,7 @@ var TextareaContainer = _styledComponents["default"].div(_templateObject || (_te
|
|
|
176
205
|
}, function (props) {
|
|
177
206
|
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
|
|
178
207
|
});
|
|
208
|
+
|
|
179
209
|
var Label = _styledComponents["default"].label(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height: ", ";\n ", "\n"])), function (props) {
|
|
180
210
|
return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledLabelFontColorOnDark : props.theme.disabledLabelFontColor : props.backgroundType === "dark" ? props.theme.labelFontColorOnDark : props.theme.labelFontColor;
|
|
181
211
|
}, function (props) {
|
|
@@ -191,9 +221,11 @@ var Label = _styledComponents["default"].label(_templateObject2 || (_templateObj
|
|
|
191
221
|
}, function (props) {
|
|
192
222
|
return !props.helperText && "margin-bottom: 0.25rem";
|
|
193
223
|
});
|
|
224
|
+
|
|
194
225
|
var OptionalLabel = _styledComponents["default"].span(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n font-weight: ", ";\n"])), function (props) {
|
|
195
226
|
return props.theme.optionalLabelFontWeight;
|
|
196
227
|
});
|
|
228
|
+
|
|
197
229
|
var HelperText = _styledComponents["default"].span(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height: ", ";\n margin-bottom: 0.25rem;\n"])), function (props) {
|
|
198
230
|
return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledHelperTextFontColorOnDark : props.theme.disabledHelperTextFontColor : props.backgroundType === "dark" ? props.theme.helperTextFontColorOnDark : props.theme.helperTextFontColor;
|
|
199
231
|
}, function (props) {
|
|
@@ -207,6 +239,7 @@ var HelperText = _styledComponents["default"].span(_templateObject4 || (_templat
|
|
|
207
239
|
}, function (props) {
|
|
208
240
|
return props.theme.helperTextLineHeight;
|
|
209
241
|
});
|
|
242
|
+
|
|
210
243
|
var Textarea = _styledComponents["default"].textarea(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n ", ";\n ", "\n\n padding: 0.5rem 1rem;\n box-shadow: 0 0 0 2px transparent;\n border-radius: 0.25rem;\n border: 1px solid\n ", ";\n ", "\n\n ", ";\n ", ";\n\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height: 1.5em;\n\n ::placeholder {\n color: ", ";\n }\n"])), function (props) {
|
|
211
244
|
if (props.verticalGrow === "none") return "resize: none;";else if (props.verticalGrow === "auto") return "resize: none; overflow: hidden;";else if (props.verticalGrow === "manual") return "resize: vertical;";else return "resize: none;";
|
|
212
245
|
}, function (props) {
|
|
@@ -232,10 +265,12 @@ var Textarea = _styledComponents["default"].textarea(_templateObject5 || (_templ
|
|
|
232
265
|
}, function (props) {
|
|
233
266
|
return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledPlaceholderFontColorOnDark : props.theme.disabledPlaceholderFontColor : props.backgroundType === "dark" ? props.theme.placeholderFontColorOnDark : props.theme.placeholderFontColor;
|
|
234
267
|
});
|
|
268
|
+
|
|
235
269
|
var Error = _styledComponents["default"].span(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n font-family: ", ";\n font-size: 0.75rem;\n font-weight: 400;\n min-height: 1.5em;\n line-height: 1.5em;\n margin-top: 0.25rem;\n"])), function (props) {
|
|
236
270
|
return props.backgroundType === "dark" ? props.theme.errorMessageColorOnDark : props.theme.errorMessageColor;
|
|
237
271
|
}, function (props) {
|
|
238
272
|
return props.theme.fontFamily;
|
|
239
273
|
});
|
|
274
|
+
|
|
240
275
|
var _default = DxcTextarea;
|
|
241
276
|
exports["default"] = _default;
|