@dxc-technology/halstack-react 0.0.0-0d64afc → 0.0.0-0d951d2

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.
Files changed (233) hide show
  1. package/{dist/BackgroundColorContext.js → BackgroundColorContext.js} +0 -0
  2. package/{dist/ThemeContext.js → ThemeContext.js} +42 -40
  3. package/{dist/select/Select.js → V3Select/V3Select.js} +5 -5
  4. package/V3Select/index.d.ts +27 -0
  5. package/{dist/textarea/Textarea.js → V3Textarea/V3Textarea.js} +4 -4
  6. package/V3Textarea/index.d.ts +27 -0
  7. package/{dist/accordion → accordion}/Accordion.js +0 -0
  8. package/accordion/index.d.ts +28 -0
  9. package/{dist/accordion-group → accordion-group}/AccordionGroup.js +0 -0
  10. package/accordion-group/index.d.ts +16 -0
  11. package/{dist/alert → alert}/Alert.js +1 -1
  12. package/{dist/alert → alert}/index.d.ts +0 -0
  13. package/{dist/badge → badge}/Badge.js +0 -0
  14. package/{dist/box → box}/Box.js +0 -0
  15. package/box/index.d.ts +25 -0
  16. package/{dist/button → button}/Button.js +3 -3
  17. package/button/Button.stories.js +27 -0
  18. package/button/index.d.ts +24 -0
  19. package/{dist/card → card}/Card.js +0 -0
  20. package/card/index.d.ts +22 -0
  21. package/{dist/checkbox → checkbox}/Checkbox.js +4 -5
  22. package/checkbox/index.d.ts +24 -0
  23. package/{dist/chip → chip}/Chip.js +0 -0
  24. package/chip/index.d.ts +22 -0
  25. package/{dist/common → common}/OpenSans.css +0 -0
  26. package/{dist/common → common}/RequiredComponent.js +0 -0
  27. package/{dist/common → common}/fonts/OpenSans-Bold.ttf +0 -0
  28. package/{dist/common → common}/fonts/OpenSans-BoldItalic.ttf +0 -0
  29. package/{dist/common → common}/fonts/OpenSans-ExtraBold.ttf +0 -0
  30. package/{dist/common → common}/fonts/OpenSans-ExtraBoldItalic.ttf +0 -0
  31. package/{dist/common → common}/fonts/OpenSans-Italic.ttf +0 -0
  32. package/{dist/common → common}/fonts/OpenSans-Light.ttf +0 -0
  33. package/{dist/common → common}/fonts/OpenSans-LightItalic.ttf +0 -0
  34. package/{dist/common → common}/fonts/OpenSans-Regular.ttf +0 -0
  35. package/{dist/common → common}/fonts/OpenSans-SemiBold.ttf +0 -0
  36. package/{dist/common → common}/fonts/OpenSans-SemiBoldItalic.ttf +0 -0
  37. package/{dist/common → common}/utils.js +0 -0
  38. package/{dist/common → common}/variables.js +135 -130
  39. package/{dist/date → date}/Date.js +0 -0
  40. package/date/index.d.ts +27 -0
  41. package/{dist/new-date/NewDate.js → date-input/DateInput.js} +34 -34
  42. package/{dist/new-date → date-input}/index.d.ts +3 -3
  43. package/{dist/dialog → dialog}/Dialog.js +0 -0
  44. package/dialog/index.d.ts +18 -0
  45. package/{dist/dropdown → dropdown}/Dropdown.js +0 -0
  46. package/dropdown/index.d.ts +26 -0
  47. package/{dist/file-input → file-input}/FileInput.js +2 -2
  48. package/{dist/file-input → file-input}/FileItem.js +8 -1
  49. package/{dist/file-input → file-input}/index.d.ts +1 -1
  50. package/{dist/footer → footer}/Footer.js +44 -18
  51. package/footer/Icons.js +77 -0
  52. package/footer/index.d.ts +25 -0
  53. package/{dist/header → header}/Header.js +122 -55
  54. package/header/Icons.js +59 -0
  55. package/header/index.d.ts +25 -0
  56. package/{dist/heading → heading}/Heading.js +12 -0
  57. package/heading/index.d.ts +17 -0
  58. package/input-text/Icons.js +22 -0
  59. package/{dist/input-text → input-text}/InputText.js +4 -6
  60. package/input-text/index.d.ts +36 -0
  61. package/{dist/layout → layout}/ApplicationLayout.js +4 -8
  62. package/layout/Icons.js +55 -0
  63. package/{dist/link → link}/Link.js +0 -0
  64. package/link/index.d.ts +23 -0
  65. package/main.d.ts +40 -0
  66. package/{dist/main.js → main.js} +22 -30
  67. package/{dist/number/Number.js → number-input/NumberInput.js} +7 -7
  68. package/{dist/number/NumberContext.js → number-input/NumberInputContext.js} +2 -2
  69. package/{dist/number → number-input}/index.d.ts +3 -3
  70. package/package.json +21 -17
  71. package/paginator/Icons.js +66 -0
  72. package/{dist/paginator → paginator}/Paginator.js +53 -37
  73. package/paginator/index.d.ts +20 -0
  74. package/{dist/password/Password.js → password-input/PasswordInput.js} +12 -9
  75. package/{dist/password → password-input}/index.d.ts +5 -5
  76. package/{dist/progress-bar → progress-bar}/ProgressBar.js +0 -0
  77. package/progress-bar/index.d.ts +18 -0
  78. package/{dist/radio → radio}/Radio.js +0 -0
  79. package/radio/index.d.ts +23 -0
  80. package/{dist/resultsetTable → resultsetTable}/ResultsetTable.js +0 -0
  81. package/resultsetTable/index.d.ts +19 -0
  82. package/select/Select.js +1137 -0
  83. package/select/index.d.ts +131 -0
  84. package/{dist/sidenav → sidenav}/Sidenav.js +0 -0
  85. package/sidenav/index.d.ts +13 -0
  86. package/{dist/slider → slider}/Slider.js +16 -6
  87. package/slider/index.d.ts +29 -0
  88. package/{dist/spinner → spinner}/Spinner.js +0 -0
  89. package/spinner/index.d.ts +17 -0
  90. package/{dist/switch → switch}/Switch.js +0 -0
  91. package/switch/index.d.ts +24 -0
  92. package/{dist/table → table}/Table.js +0 -0
  93. package/table/index.d.ts +13 -0
  94. package/{dist/tabs → tabs}/Tabs.js +0 -0
  95. package/tabs/index.d.ts +19 -0
  96. package/{dist/tag → tag}/Tag.js +0 -0
  97. package/tag/index.d.ts +24 -0
  98. package/{dist/text-input → text-input}/TextInput.js +36 -33
  99. package/{dist/text-input → text-input}/index.d.ts +0 -0
  100. package/{dist/new-textarea/NewTextarea.js → textarea/Textarea.js} +6 -6
  101. package/{dist/new-textarea → textarea}/index.d.ts +1 -1
  102. package/{dist/toggle → toggle}/Toggle.js +0 -0
  103. package/toggle/index.d.ts +21 -0
  104. package/{dist/toggle-group → toggle-group}/ToggleGroup.js +0 -0
  105. package/toggle-group/index.d.ts +21 -0
  106. package/{dist/upload → upload}/Upload.js +0 -0
  107. package/{dist/upload → upload}/buttons-upload/ButtonsUpload.js +7 -11
  108. package/upload/buttons-upload/Icons.js +40 -0
  109. package/{dist/upload → upload}/dragAndDropArea/DragAndDropArea.js +14 -14
  110. package/upload/dragAndDropArea/Icons.js +39 -0
  111. package/{dist/upload → upload}/file-upload/FileToUpload.js +26 -21
  112. package/upload/file-upload/Icons.js +66 -0
  113. package/{dist/upload → upload}/files-upload/FilesToUpload.js +0 -0
  114. package/upload/index.d.ts +15 -0
  115. package/upload/transaction/Icons.js +160 -0
  116. package/{dist/upload → upload}/transaction/Transaction.js +11 -38
  117. package/{dist/upload → upload}/transactions/Transactions.js +0 -0
  118. package/{dist/useTheme.js → useTheme.js} +0 -0
  119. package/wizard/Icons.js +65 -0
  120. package/{dist/wizard → wizard}/Wizard.js +3 -9
  121. package/wizard/index.d.ts +18 -0
  122. package/README.md +0 -66
  123. package/babel.config.js +0 -8
  124. package/dist/checkbox/Checkbox.stories.js +0 -144
  125. package/dist/checkbox/readme.md +0 -116
  126. package/dist/date/Date.stories.js +0 -205
  127. package/dist/date/readme.md +0 -73
  128. package/dist/footer/dxc_logo.svg +0 -15
  129. package/dist/footer/readme.md +0 -41
  130. package/dist/header/Header.stories.js +0 -176
  131. package/dist/header/close_icon.svg +0 -1
  132. package/dist/header/dxc_logo_black.svg +0 -8
  133. package/dist/header/hamb_menu_black.svg +0 -1
  134. package/dist/header/hamb_menu_white.svg +0 -1
  135. package/dist/header/readme.md +0 -33
  136. package/dist/input-text/error.svg +0 -1
  137. package/dist/input-text/readme.md +0 -91
  138. package/dist/layout/facebook.svg +0 -45
  139. package/dist/layout/linkedin.svg +0 -50
  140. package/dist/layout/twitter.svg +0 -53
  141. package/dist/link/readme.md +0 -51
  142. package/dist/main.d.ts +0 -8
  143. package/dist/new-select/NewSelect.js +0 -836
  144. package/dist/new-select/index.d.ts +0 -53
  145. package/dist/paginator/images/next.svg +0 -3
  146. package/dist/paginator/images/nextPage.svg +0 -3
  147. package/dist/paginator/images/previous.svg +0 -3
  148. package/dist/paginator/images/previousPage.svg +0 -3
  149. package/dist/paginator/readme.md +0 -50
  150. package/dist/password/styles.css +0 -3
  151. package/dist/progress-bar/ProgressBar.stories.js +0 -280
  152. package/dist/progress-bar/readme.md +0 -63
  153. package/dist/radio/Radio.stories.js +0 -166
  154. package/dist/radio/readme.md +0 -70
  155. package/dist/resultsetTable/arrow_downward-24px_wht.svg +0 -1
  156. package/dist/resultsetTable/arrow_upward-24px_wht.svg +0 -1
  157. package/dist/resultsetTable/unfold_more-24px_wht.svg +0 -1
  158. package/dist/slider/Slider.stories.js +0 -241
  159. package/dist/slider/readme.md +0 -64
  160. package/dist/spinner/Spinner.stories.js +0 -183
  161. package/dist/spinner/readme.md +0 -65
  162. package/dist/switch/Switch.stories.js +0 -134
  163. package/dist/switch/readme.md +0 -133
  164. package/dist/tabs/Tabs.stories.js +0 -130
  165. package/dist/tabs/readme.md +0 -78
  166. package/dist/tabs-for-sections/TabsForSections.js +0 -92
  167. package/dist/tabs-for-sections/readme.md +0 -78
  168. package/dist/toggle/Toggle.stories.js +0 -297
  169. package/dist/toggle/readme.md +0 -80
  170. package/dist/upload/Upload.stories.js +0 -72
  171. package/dist/upload/buttons-upload/drag-drop-icon.svg +0 -4
  172. package/dist/upload/buttons-upload/upload-button.svg +0 -1
  173. package/dist/upload/dragAndDropArea/upload_drop.svg +0 -4
  174. package/dist/upload/dragAndDropArea/upload_file.svg +0 -4
  175. package/dist/upload/file-upload/audio-icon.svg +0 -4
  176. package/dist/upload/file-upload/close.svg +0 -4
  177. package/dist/upload/file-upload/file-icon.svg +0 -4
  178. package/dist/upload/file-upload/video-icon.svg +0 -4
  179. package/dist/upload/readme.md +0 -37
  180. package/dist/upload/transaction/audio-icon-err.svg +0 -4
  181. package/dist/upload/transaction/audio-icon.svg +0 -4
  182. package/dist/upload/transaction/error-icon.svg +0 -4
  183. package/dist/upload/transaction/file-icon-err.svg +0 -4
  184. package/dist/upload/transaction/file-icon.svg +0 -4
  185. package/dist/upload/transaction/image-icon-err.svg +0 -4
  186. package/dist/upload/transaction/image-icon.svg +0 -4
  187. package/dist/upload/transaction/success-icon.svg +0 -4
  188. package/dist/upload/transaction/video-icon-err.svg +0 -4
  189. package/dist/upload/transaction/video-icon.svg +0 -4
  190. package/dist/wizard/invalid_icon.svg +0 -5
  191. package/dist/wizard/valid_icon.svg +0 -5
  192. package/dist/wizard/validation-wrong.svg +0 -6
  193. package/test/Accordion.test.js +0 -33
  194. package/test/AccordionGroup.test.js +0 -125
  195. package/test/Alert.test.js +0 -53
  196. package/test/Box.test.js +0 -10
  197. package/test/Button.test.js +0 -18
  198. package/test/Card.test.js +0 -30
  199. package/test/Checkbox.test.js +0 -45
  200. package/test/Chip.test.js +0 -25
  201. package/test/Date.test.js +0 -393
  202. package/test/Dialog.test.js +0 -23
  203. package/test/Dropdown.test.js +0 -145
  204. package/test/FileInput.test.js +0 -201
  205. package/test/Footer.test.js +0 -99
  206. package/test/Header.test.js +0 -39
  207. package/test/Heading.test.js +0 -35
  208. package/test/InputText.test.js +0 -240
  209. package/test/Link.test.js +0 -43
  210. package/test/NewDate.test.js +0 -232
  211. package/test/NewTextarea.test.js +0 -195
  212. package/test/Number.test.js +0 -257
  213. package/test/Paginator.test.js +0 -177
  214. package/test/Password.test.js +0 -83
  215. package/test/ProgressBar.test.js +0 -35
  216. package/test/Radio.test.js +0 -37
  217. package/test/ResultsetTable.test.js +0 -329
  218. package/test/Select.test.js +0 -212
  219. package/test/Sidenav.test.js +0 -45
  220. package/test/Slider.test.js +0 -82
  221. package/test/Spinner.test.js +0 -32
  222. package/test/Switch.test.js +0 -45
  223. package/test/Table.test.js +0 -36
  224. package/test/Tabs.test.js +0 -109
  225. package/test/TabsForSections.test.js +0 -34
  226. package/test/Tag.test.js +0 -32
  227. package/test/TextArea.test.js +0 -52
  228. package/test/TextInput.test.js +0 -732
  229. package/test/ToggleGroup.test.js +0 -85
  230. package/test/Upload.test.js +0 -60
  231. package/test/Wizard.test.js +0 -130
  232. package/test/mocks/pngMock.js +0 -1
  233. package/test/mocks/svgMock.js +0 -1
@@ -0,0 +1,131 @@
1
+ type SVG = string | (HTMLElement & SVGElement);
2
+ type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
3
+ type Margin = {
4
+ top?: Space;
5
+ bottom?: Space;
6
+ left?: Space;
7
+ right?: Space;
8
+ };
9
+
10
+ type OptionGroup = {
11
+ /**
12
+ * Label of the group to be shown in the select's listbox.
13
+ */
14
+ label: string;
15
+ /**
16
+ * List of the grouped options.
17
+ */
18
+ options: Option[];
19
+ };
20
+ type Option = {
21
+ /**
22
+ * Element used as the icon that will be placed before the option label.
23
+ * It can be a url of an image or an inline SVG. If the url option
24
+ * is the chosen one, take into account that the component's
25
+ * color styling tokens will not be applied to the image.
26
+ */
27
+ icon?: SVG;
28
+ /**
29
+ * Label of the option to be shown in the select's listbox.
30
+ */
31
+ label: string;
32
+ /**
33
+ * Value of the option. It should be unique and
34
+ * not an empty string, which is reserved to the empty option added
35
+ * by optional prop.
36
+ */
37
+ value: string;
38
+ };
39
+
40
+ type Props = {
41
+ /**
42
+ * Text to be placed above the select.
43
+ */
44
+ label?: string;
45
+ /**
46
+ * Name attribute of the input element. This attribute will allow users
47
+ * to find the component's value during the submit event. In this event,
48
+ * the component's value will always be a regular string, for both single
49
+ * and multiple selection modes, been in the first one a single option
50
+ * value and in the multiple variant more than one option value,
51
+ * separated by commas.
52
+ */
53
+ name?: string;
54
+ /**
55
+ * Value of the select. If undefined, the component will be uncontrolled
56
+ * and the value will be managed internally by the component.
57
+ */
58
+ value?: string | string[];
59
+ /**
60
+ * An array of objects representing the selectable options.
61
+ */
62
+ options?: Option[] | OptionGroup[];
63
+ /**
64
+ * Helper text to be placed above the select.
65
+ */
66
+ helperText?: string;
67
+ /**
68
+ * Text to be put as placeholder of the select.
69
+ */
70
+ placeholder?: string;
71
+ /**
72
+ * If true, the component will be disabled.
73
+ */
74
+ disabled?: boolean;
75
+ /**
76
+ * If true, the select will be optional, showing '(Optional)'
77
+ * next to the label and adding a default first option with empty value, been
78
+ * the placeholder (if defined) its label. Otherwise, the field will be
79
+ * considered required and an error will be passed as a parameter to the
80
+ * OnBlur and onChange functions if an option wasn't selected.
81
+ */
82
+ optional?: boolean;
83
+ /**
84
+ * If true, enables search functionality.
85
+ */
86
+ searchable?: boolean;
87
+ /**
88
+ * If true, the select component will support multiple selected options.
89
+ * In that case, value will be an array of strings with each selected
90
+ * option value.
91
+ */
92
+ multiple?: boolean;
93
+ /**
94
+ * This function will be called when the user selects an option.
95
+ * An object including the current value and the error (if the value entered is not valid)
96
+ * will be passed to this function. If there is no error, error will be null.
97
+ */
98
+ onChange?: (value: string | string[]) => void;
99
+ /**
100
+ * This function will be called when the select loses the focus. An
101
+ * object including the value (or values) and the error (if the value
102
+ * selected is not valid) will be passed to this function. If there is no error,
103
+ * error will be null.
104
+ */
105
+ onBlur?: (val: { value: string | string[]; error: string }) => void;
106
+ /**
107
+ * If it is defined, the component will change its appearance, showing
108
+ * the error below the select component. If it is not defined, the error
109
+ * messages will be managed internally, but never displayed on its own.
110
+ */
111
+ error?: string;
112
+ /**
113
+ * Size of the margin to be applied to the component ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
114
+ * You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different margin sizes.
115
+ */
116
+ margin?: Space | Margin;
117
+ /**
118
+ * Size of the component ('small' | 'medium' | 'large' | 'fillParent').
119
+ */
120
+ size?: "small" | "medium" | "large" | "fillParent";
121
+ /**
122
+ * Value of the tabindex attribute.
123
+ */
124
+ tabIndex?: number;
125
+ /**
126
+ * Reference to the component.
127
+ */
128
+ ref?: React.RefObject<HTMLDivElement>;
129
+ };
130
+
131
+ export default function DxcSelect(props: Props): JSX.Element;
File without changes
@@ -0,0 +1,13 @@
1
+ type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
2
+ type Padding = {
3
+ top?: Space;
4
+ bottom?: Space;
5
+ left?: Space;
6
+ right?: Space;
7
+ };
8
+
9
+ type Props = {
10
+ padding?: Space | Padding;
11
+ };
12
+
13
+ export default function DxcSidenav(props: Props): JSX.Element;
@@ -25,7 +25,7 @@ var _styledComponents = _interopRequireWildcard(require("styled-components"));
25
25
 
26
26
  var _propTypes = _interopRequireDefault(require("prop-types"));
27
27
 
28
- var _InputText = _interopRequireDefault(require("../input-text/InputText"));
28
+ var _TextInput = _interopRequireDefault(require("../text-input/TextInput"));
29
29
 
30
30
  var _variables = require("../common/variables.js");
31
31
 
@@ -36,7 +36,7 @@ var _useTheme = _interopRequireDefault(require("../useTheme.js"));
36
36
  var _BackgroundColorContext = _interopRequireDefault(require("../BackgroundColorContext.js"));
37
37
 
38
38
  function _templateObject7() {
39
- var data = (0, _taggedTemplateLiteral2["default"])(["\n margin-left: ", ";\n label + .MuiInput-formControl {\n margin-top: 2px;\n }\n"]);
39
+ var data = (0, _taggedTemplateLiteral2["default"])(["\n margin-left: ", ";\n label + .MuiInput-formControl {\n margin-top: 2px;\n }\n max-width: 70px;\n"]);
40
40
 
41
41
  _templateObject7 = function _templateObject7() {
42
42
  return data;
@@ -160,12 +160,22 @@ var DxcSlider = function DxcSlider(_ref) {
160
160
  };
161
161
 
162
162
  var handlerInputChange = function handlerInputChange(event) {
163
+ var intValue = parseInt(event.value, 10);
164
+
163
165
  if (value == null) {
164
- setInnerValue(event > maxValue ? maxValue : event);
166
+ if (!Number.isNaN(intValue)) {
167
+ setInnerValue(intValue > maxValue ? maxValue : intValue);
168
+ } else {
169
+ setInnerValue("");
170
+ }
165
171
  }
166
172
 
167
173
  if (typeof onChange === "function") {
168
- onChange(event > maxValue ? maxValue : event);
174
+ if (!Number.isNaN(intValue)) {
175
+ onChange(intValue > maxValue ? maxValue : intValue);
176
+ } else {
177
+ onChange("");
178
+ }
169
179
  }
170
180
  };
171
181
 
@@ -194,12 +204,12 @@ var DxcSlider = function DxcSlider(_ref) {
194
204
  backgroundType: backgroundType,
195
205
  disabled: disabled,
196
206
  step: step
197
- }, maxLabel), showInput && _react["default"].createElement(StyledTextInput, null, _react["default"].createElement(_InputText["default"], {
207
+ }, maxLabel), showInput && _react["default"].createElement(StyledTextInput, null, _react["default"].createElement(_TextInput["default"], {
198
208
  name: name,
199
209
  value: value != null && value >= 0 && value || innerValue,
200
210
  disabled: disabled,
201
211
  onChange: handlerInputChange,
202
- size: "small"
212
+ size: "fillParent"
203
213
  })))));
204
214
  };
205
215
 
@@ -0,0 +1,29 @@
1
+ type Size = "small" | "medium" | "large" | "fillParent";
2
+ type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
3
+ type Margin = {
4
+ top?: Space;
5
+ bottom?: Space;
6
+ left?: Space;
7
+ right?: Space;
8
+ };
9
+
10
+ type Props = {
11
+ label?: string;
12
+ helperText?: string;
13
+ minValue?: number;
14
+ maxValue?: number;
15
+ step?: number;
16
+ value?: number;
17
+ showLimitsValues?: boolean;
18
+ showInput?: boolean;
19
+ name?: string;
20
+ onChange?: void;
21
+ onDragEnd?: void;
22
+ disabled?: boolean;
23
+ marks?: boolean;
24
+ labelFormatCallback?: void;
25
+ margin?: Space | Margin;
26
+ size?: Size;
27
+ };
28
+
29
+ export default function DxcSlider(props: Props): JSX.Element;
File without changes
@@ -0,0 +1,17 @@
1
+ type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
2
+ type Margin = {
3
+ top?: Space;
4
+ bottom?: Space;
5
+ left?: Space;
6
+ right?: Space;
7
+ };
8
+
9
+ type Props = {
10
+ label?: string;
11
+ value?: number;
12
+ showValue?: boolean;
13
+ mode?: "large" | "small" | "overlay";
14
+ margin?: Space | Margin;
15
+ };
16
+
17
+ export default function DxcSpinner(props: Props): JSX.Element;
File without changes
@@ -0,0 +1,24 @@
1
+ type Size = "small" | "medium" | "large" | "fillParent" | "fitContent";
2
+ type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
3
+ type Margin = {
4
+ top?: Space;
5
+ bottom?: Space;
6
+ left?: Space;
7
+ right?: Space;
8
+ };
9
+
10
+ type Props = {
11
+ checked?: boolean;
12
+ value?: any;
13
+ label?: string;
14
+ labelPosition?: "before" | "after";
15
+ name?: string,
16
+ disabled?: boolean;
17
+ onChange?: void;
18
+ required?: boolean;
19
+ margin?: Space | Margin;
20
+ size?: Size;
21
+ tabIndex?: number;
22
+ };
23
+
24
+ export default function DxcSwitch(props: Props): JSX.Element;
File without changes
@@ -0,0 +1,13 @@
1
+ type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
2
+ type Margin = {
3
+ top?: Space;
4
+ bottom?: Space;
5
+ left?: Space;
6
+ right?: Space;
7
+ };
8
+
9
+ type Props = {
10
+ margin?: Space | Margin;
11
+ };
12
+
13
+ export default function DxcTable(props: Props): JSX.Element;
File without changes
@@ -0,0 +1,19 @@
1
+ type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
2
+ type Margin = {
3
+ top?: Space;
4
+ bottom?: Space;
5
+ left?: Space;
6
+ right?: Space;
7
+ };
8
+
9
+ type Props = {
10
+ activeTabIndex?: number;
11
+ tabs?: any;
12
+ onTabClick?: void;
13
+ onTabHover?: void;
14
+ iconPosition?: "top" | "left";
15
+ margin?: Space | Margin;
16
+ tabIndex?: number;
17
+ };
18
+
19
+ export default function DxcTabs(props: Props): JSX.Element;
File without changes
package/tag/index.d.ts ADDED
@@ -0,0 +1,24 @@
1
+ type Size = "small" | "medium" | "large" | "fillParent" | "fitContent";
2
+ type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
3
+ type Margin = {
4
+ top?: Space;
5
+ bottom?: Space;
6
+ left?: Space;
7
+ right?: Space;
8
+ };
9
+
10
+ type Props = {
11
+ icon?: any;
12
+ iconSrc?: string;
13
+ label?: string;
14
+ linkHref?: string;
15
+ onClick?: void,
16
+ iconBgColor?: string;
17
+ labelPosition?: "before" | "after";
18
+ newWindow?: boolean;
19
+ margin?: Space | Margin;
20
+ size?: Size;
21
+ tabIndex?: number;
22
+ };
23
+
24
+ export default function DxcTag(props: Props): JSX.Element;
@@ -33,7 +33,7 @@ var _uuid = require("uuid");
33
33
 
34
34
  var _BackgroundColorContext = _interopRequireDefault(require("../BackgroundColorContext.js"));
35
35
 
36
- var _NumberContext = _interopRequireDefault(require("../number/NumberContext.js"));
36
+ var _NumberInputContext = _interopRequireDefault(require("../number-input/NumberInputContext.js"));
37
37
 
38
38
  function _templateObject17() {
39
39
  var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n padding: calc((39px - 1.75em) / 2) 0 calc((39px - 1.75em) / 2) 1em;\n align-items: center;\n font-size: 0.875rem;\n line-height: 1.75em;\n"]);
@@ -126,7 +126,7 @@ function _templateObject9() {
126
126
  }
127
127
 
128
128
  function _templateObject8() {
129
- var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-wrap: wrap;\n align-content: center;\n height: 24px;\n width: 24px;\n font-size: 1rem;\n font-family: ", ";\n border: 1px solid transparent;\n border-radius: 4px;\n padding: 3px;\n margin-left: calc(1rem * 0.25);\n ", "\n\n box-shadow: 0 0 0 2px transparent;\n background-color: ", ";\n\n color: ", ";\n\n ", "\n\n svg {\n line-height: 18px;\n }\n"]);
129
+ var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-wrap: wrap;\n align-content: center;\n height: 24px;\n width: 24px;\n font-size: 1rem;\n font-family: ", ";\n border: 1px solid transparent;\n border-radius: 2px;\n padding: 3px;\n margin-left: calc(1rem * 0.25);\n ", "\n\n box-shadow: 0 0 0 2px transparent;\n background-color: ", ";\n\n color: ", ";\n\n ", "\n\n svg {\n line-height: 18px;\n }\n"]);
130
130
 
131
131
  _templateObject8 = function _templateObject8() {
132
132
  return data;
@@ -243,6 +243,8 @@ var patternMatch = function patternMatch(pattern, value) {
243
243
  };
244
244
 
245
245
  var DxcTextInput = _react["default"].forwardRef(function (_ref, ref) {
246
+ var _action$title;
247
+
246
248
  var _ref$label = _ref.label,
247
249
  label = _ref$label === void 0 ? "" : _ref$label,
248
250
  _ref$name = _ref.name,
@@ -329,7 +331,7 @@ var DxcTextInput = _react["default"].forwardRef(function (_ref, ref) {
329
331
  var backgroundType = (0, _react.useContext)(_BackgroundColorContext["default"]);
330
332
  var autosuggestId = "".concat(inputId, "-listBox");
331
333
  var errorId = "error-message-".concat(inputId);
332
- var numberContext = (0, _react.useContext)(_NumberContext["default"]);
334
+ var numberInputContext = (0, _react.useContext)(_NumberInputContext["default"]);
333
335
 
334
336
  var isNotOptional = function isNotOptional(value) {
335
337
  return value === "" && !optional;
@@ -340,7 +342,7 @@ var DxcTextInput = _react["default"].forwardRef(function (_ref, ref) {
340
342
  };
341
343
 
342
344
  var isNumberIncorrect = function isNumberIncorrect(value) {
343
- return (numberContext === null || numberContext === void 0 ? void 0 : numberContext.minNumber) && parseInt(value) < (numberContext === null || numberContext === void 0 ? void 0 : numberContext.minNumber) || (numberContext === null || numberContext === void 0 ? void 0 : numberContext.maxNumber) && parseInt(value) > (numberContext === null || numberContext === void 0 ? void 0 : numberContext.maxNumber);
345
+ return (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber) && parseInt(value) < (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber) || (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber) && parseInt(value) > (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber);
344
346
  };
345
347
 
346
348
  var isTextInputType = function isTextInputType() {
@@ -350,7 +352,7 @@ var DxcTextInput = _react["default"].forwardRef(function (_ref, ref) {
350
352
  };
351
353
 
352
354
  var getNumberErrorMessage = function getNumberErrorMessage(value) {
353
- if (numberContext !== null && numberContext !== void 0 && numberContext.minNumber && parseInt(value) < (numberContext === null || numberContext === void 0 ? void 0 : numberContext.minNumber)) return "Value must be greater than or equal to ".concat(numberContext === null || numberContext === void 0 ? void 0 : numberContext.minNumber, ".");else if (numberContext !== null && numberContext !== void 0 && numberContext.maxNumber && parseInt(value) > (numberContext === null || numberContext === void 0 ? void 0 : numberContext.maxNumber)) return "Value must be less than or equal to ".concat(numberContext === null || numberContext === void 0 ? void 0 : numberContext.maxNumber, ".");
355
+ if (numberInputContext !== null && numberInputContext !== void 0 && numberInputContext.minNumber && parseInt(value) < (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber)) return "Value must be greater than or equal to ".concat(numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber, ".");else if (numberInputContext !== null && numberInputContext !== void 0 && numberInputContext.maxNumber && parseInt(value) > (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber)) return "Value must be less than or equal to ".concat(numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber, ".");
354
356
  };
355
357
 
356
358
  var hasInputSuggestions = function hasInputSuggestions() {
@@ -428,7 +430,7 @@ var DxcTextInput = _react["default"].forwardRef(function (_ref, ref) {
428
430
  switch (event.keyCode) {
429
431
  case 40:
430
432
  // Arrow Down
431
- if (numberContext) {
433
+ if (numberInputContext) {
432
434
  decrementNumber();
433
435
  event.preventDefault();
434
436
  } else {
@@ -448,7 +450,7 @@ var DxcTextInput = _react["default"].forwardRef(function (_ref, ref) {
448
450
 
449
451
  case 38:
450
452
  // Arrow Up
451
- if (numberContext) {
453
+ if (numberInputContext) {
452
454
  incrementNumber();
453
455
  event.preventDefault();
454
456
  } else {
@@ -532,7 +534,7 @@ var DxcTextInput = _react["default"].forwardRef(function (_ref, ref) {
532
534
  changeVisualFocusedSuggIndex(-1);
533
535
  }
534
536
 
535
- numberContext && setNumberProps(numberContext.typeNumber, numberContext.minNumber, numberContext.maxNumber, numberContext.stepNumber);
537
+ numberInputContext && setNumberProps(numberInputContext.typeNumber, numberInputContext.minNumber, numberInputContext.maxNumber, numberInputContext.stepNumber);
536
538
  }, [value, innerValue, suggestions]);
537
539
  var defaultClearAction = {
538
540
  onClick: function onClick() {
@@ -567,16 +569,16 @@ var DxcTextInput = _react["default"].forwardRef(function (_ref, ref) {
567
569
  var decrementNumber = function decrementNumber() {
568
570
  var numberValue = value !== null && value !== void 0 ? value : innerValue;
569
571
 
570
- if (numberContext !== null && numberContext !== void 0 && numberContext.minNumber && parseInt(numberValue) < (numberContext === null || numberContext === void 0 ? void 0 : numberContext.minNumber)) {
572
+ if (numberInputContext !== null && numberInputContext !== void 0 && numberInputContext.minNumber && parseInt(numberValue) < (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber)) {
571
573
  changeValue(parseInt(numberValue));
572
- } else if (numberContext !== null && numberContext !== void 0 && numberContext.maxNumber && parseInt(numberValue) > (numberContext === null || numberContext === void 0 ? void 0 : numberContext.maxNumber)) {
573
- changeValue(numberContext === null || numberContext === void 0 ? void 0 : numberContext.maxNumber);
574
- } else if (numberContext !== null && numberContext !== void 0 && numberContext.minNumber && (parseInt(numberValue) === (numberContext === null || numberContext === void 0 ? void 0 : numberContext.minNumber) || numberValue === "" || numberContext !== null && numberContext !== void 0 && numberContext.stepNumber && parseInt(numberValue) - (numberContext === null || numberContext === void 0 ? void 0 : numberContext.stepNumber) < (numberContext === null || numberContext === void 0 ? void 0 : numberContext.minNumber))) {
575
- changeValue(numberContext === null || numberContext === void 0 ? void 0 : numberContext.minNumber);
576
- } else if (numberContext !== null && numberContext !== void 0 && numberContext.stepNumber && numberContext !== null && numberContext !== void 0 && numberContext.minNumber && parseInt(numberValue) - (numberContext === null || numberContext === void 0 ? void 0 : numberContext.stepNumber) >= (numberContext === null || numberContext === void 0 ? void 0 : numberContext.minNumber) || numberContext !== null && numberContext !== void 0 && numberContext.stepNumber && numberValue !== "") {
577
- changeValue(parseInt(numberValue) - (numberContext === null || numberContext === void 0 ? void 0 : numberContext.stepNumber));
578
- } else if (numberContext !== null && numberContext !== void 0 && numberContext.stepNumber && numberValue == "") {
579
- changeValue(-(numberContext === null || numberContext === void 0 ? void 0 : numberContext.stepNumber));
574
+ } else if (numberInputContext !== null && numberInputContext !== void 0 && numberInputContext.maxNumber && parseInt(numberValue) > (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber)) {
575
+ changeValue(numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber);
576
+ } else if (numberInputContext !== null && numberInputContext !== void 0 && numberInputContext.minNumber && (parseInt(numberValue) === (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber) || numberValue === "" || numberInputContext !== null && numberInputContext !== void 0 && numberInputContext.stepNumber && parseInt(numberValue) - (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.stepNumber) < (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber))) {
577
+ changeValue(numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber);
578
+ } else if (numberInputContext !== null && numberInputContext !== void 0 && numberInputContext.stepNumber && numberInputContext !== null && numberInputContext !== void 0 && numberInputContext.minNumber && parseInt(numberValue) - (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.stepNumber) >= (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber) || numberInputContext !== null && numberInputContext !== void 0 && numberInputContext.stepNumber && numberValue !== "") {
579
+ changeValue(parseInt(numberValue) - (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.stepNumber));
580
+ } else if (numberInputContext !== null && numberInputContext !== void 0 && numberInputContext.stepNumber && numberValue == "") {
581
+ changeValue(-(numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.stepNumber));
580
582
  } else if (numberValue === "") {
581
583
  changeValue(-1);
582
584
  } else {
@@ -587,16 +589,16 @@ var DxcTextInput = _react["default"].forwardRef(function (_ref, ref) {
587
589
  var incrementNumber = function incrementNumber() {
588
590
  var numberValue = value !== null && value !== void 0 ? value : innerValue;
589
591
 
590
- if (numberContext !== null && numberContext !== void 0 && numberContext.maxNumber && parseInt(numberValue) > (numberContext === null || numberContext === void 0 ? void 0 : numberContext.maxNumber)) {
592
+ if (numberInputContext !== null && numberInputContext !== void 0 && numberInputContext.maxNumber && parseInt(numberValue) > (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber)) {
591
593
  changeValue(parseInt(numberValue));
592
- } else if (numberContext !== null && numberContext !== void 0 && numberContext.minNumber && (parseInt(numberValue) < (numberContext === null || numberContext === void 0 ? void 0 : numberContext.minNumber) || numberValue === "")) {
593
- changeValue(numberContext === null || numberContext === void 0 ? void 0 : numberContext.minNumber);
594
- } else if (numberContext !== null && numberContext !== void 0 && numberContext.maxNumber && (parseInt(numberValue) === (numberContext === null || numberContext === void 0 ? void 0 : numberContext.maxNumber) || numberContext !== null && numberContext !== void 0 && numberContext.stepNumber && parseInt(numberValue) + (numberContext === null || numberContext === void 0 ? void 0 : numberContext.stepNumber) > (numberContext === null || numberContext === void 0 ? void 0 : numberContext.maxNumber))) {
595
- changeValue(numberContext === null || numberContext === void 0 ? void 0 : numberContext.maxNumber);
596
- } else if (numberContext !== null && numberContext !== void 0 && numberContext.stepNumber && numberContext !== null && numberContext !== void 0 && numberContext.maxNumber && parseInt(numberValue) + (numberContext === null || numberContext === void 0 ? void 0 : numberContext.stepNumber) <= (numberContext === null || numberContext === void 0 ? void 0 : numberContext.maxNumber) || numberContext !== null && numberContext !== void 0 && numberContext.stepNumber && numberValue !== "") {
597
- changeValue(parseInt(numberValue) + (numberContext === null || numberContext === void 0 ? void 0 : numberContext.stepNumber));
598
- } else if (numberContext !== null && numberContext !== void 0 && numberContext.stepNumber && numberValue == "") {
599
- changeValue(numberContext === null || numberContext === void 0 ? void 0 : numberContext.stepNumber);
594
+ } else if (numberInputContext !== null && numberInputContext !== void 0 && numberInputContext.minNumber && (parseInt(numberValue) < (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber) || numberValue === "")) {
595
+ changeValue(numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber);
596
+ } else if (numberInputContext !== null && numberInputContext !== void 0 && numberInputContext.maxNumber && (parseInt(numberValue) === (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber) || numberInputContext !== null && numberInputContext !== void 0 && numberInputContext.stepNumber && parseInt(numberValue) + (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.stepNumber) > (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber))) {
597
+ changeValue(numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber);
598
+ } else if (numberInputContext !== null && numberInputContext !== void 0 && numberInputContext.stepNumber && numberInputContext !== null && numberInputContext !== void 0 && numberInputContext.maxNumber && parseInt(numberValue) + (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.stepNumber) <= (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber) || numberInputContext !== null && numberInputContext !== void 0 && numberInputContext.stepNumber && numberValue !== "") {
599
+ changeValue(parseInt(numberValue) + (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.stepNumber));
600
+ } else if (numberInputContext !== null && numberInputContext !== void 0 && numberInputContext.stepNumber && numberValue == "") {
601
+ changeValue(numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.stepNumber);
600
602
  } else if (numberValue === "") {
601
603
  changeValue(1);
602
604
  } else {
@@ -649,11 +651,11 @@ var DxcTextInput = _react["default"].forwardRef(function (_ref, ref) {
649
651
  var noMatchedWords = suggestion.replace(regEx, "");
650
652
  return _react["default"].createElement(Suggestion, {
651
653
  id: "suggestion-".concat(index),
652
- onMouseDown: function onMouseDown() {
653
- changeIsActiveSuggestion(true);
654
+ onMouseDown: function onMouseDown(event) {
655
+ event.button === 0 && changeIsActiveSuggestion(true);
654
656
  },
655
- onMouseUp: function onMouseUp() {
656
- if (isActiveSuggestion) {
657
+ onMouseUp: function onMouseUp(event) {
658
+ if (event.button === 0 && isActiveSuggestion) {
657
659
  changeValue(suggestion);
658
660
  changeIsActiveSuggestion(false);
659
661
  closeSuggestions();
@@ -713,7 +715,7 @@ var DxcTextInput = _react["default"].forwardRef(function (_ref, ref) {
713
715
  tabIndex: tabIndex,
714
716
  role: isTextInputType() && hasInputSuggestions() ? "combobox" : "textbox",
715
717
  "aria-autocomplete": isTextInputType() && hasInputSuggestions() ? "list" : undefined,
716
- "aria-controls": isTextInputType() && hasInputSuggestions() ? inputId : undefined,
718
+ "aria-controls": isTextInputType() && hasInputSuggestions() ? autosuggestId : undefined,
717
719
  "aria-expanded": isTextInputType() && hasInputSuggestions() ? isOpen ? "true" : "false" : undefined,
718
720
  "aria-activedescendant": isTextInputType() && hasInputSuggestions() && isOpen && visualFocusedSuggIndex !== -1 ? "suggestion-".concat(visualFocusedSuggIndex) : undefined,
719
721
  "aria-invalid": error ? "true" : "false",
@@ -727,7 +729,7 @@ var DxcTextInput = _react["default"].forwardRef(function (_ref, ref) {
727
729
  backgroundType: backgroundType,
728
730
  tabIndex: tabIndex,
729
731
  "aria-label": "Clear"
730
- }, defaultClearAction.icon), (numberContext === null || numberContext === void 0 ? void 0 : numberContext.typeNumber) === "number" ? _react["default"].createElement(_react["default"].Fragment, null, _react["default"].createElement(Action, {
732
+ }, defaultClearAction.icon), (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.typeNumber) === "number" ? _react["default"].createElement(_react["default"].Fragment, null, _react["default"].createElement(Action, {
731
733
  ref: actionRef,
732
734
  disabled: disabled,
733
735
  onClick: decrementAction.onClick,
@@ -745,6 +747,7 @@ var DxcTextInput = _react["default"].forwardRef(function (_ref, ref) {
745
747
  ref: actionRef,
746
748
  disabled: disabled,
747
749
  onClick: action.onClick,
750
+ title: (_action$title = action.title) !== null && _action$title !== void 0 ? _action$title : action.title,
748
751
  backgroundType: backgroundType,
749
752
  tabIndex: tabIndex
750
753
  }, typeof action.icon === "string" ? _react["default"].createElement(ActionIcon, {
@@ -874,7 +877,7 @@ var Action = _styledComponents["default"].button(_templateObject8(), function (p
874
877
  }, function (props) {
875
878
  return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledActionIconColorOnDark : props.theme.disabledActionIconColor : props.backgroundType === "dark" ? props.theme.actionIconColorOnDark : props.theme.actionIconColor;
876
879
  }, function (props) {
877
- return !props.disabled && "\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 &:focus {\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 &: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 &: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 ");
880
+ return !props.disabled && "\n &:focus {\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 &: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 ");
878
881
  });
879
882
 
880
883
  var Prefix = _styledComponents["default"].span(_templateObject9(), function (props) {
File without changes
@@ -109,7 +109,7 @@ var patternMatch = function patternMatch(pattern, value) {
109
109
  return new RegExp(pattern).test(value);
110
110
  };
111
111
 
112
- var DxcNewTextarea = _react["default"].forwardRef(function (_ref, ref) {
112
+ var DxcTextarea = _react["default"].forwardRef(function (_ref, ref) {
113
113
  var _ref$label = _ref.label,
114
114
  label = _ref$label === void 0 ? "" : _ref$label,
115
115
  _ref$name = _ref.name,
@@ -210,8 +210,8 @@ var DxcNewTextarea = _react["default"].forwardRef(function (_ref, ref) {
210
210
  }
211
211
  }, [value, verticalGrow, rows, innerValue]);
212
212
  return _react["default"].createElement(_styledComponents.ThemeProvider, {
213
- theme: colorsTheme.newTextarea
214
- }, _react["default"].createElement(DxcTextarea, {
213
+ theme: colorsTheme.textarea
214
+ }, _react["default"].createElement(TextareaContainer, {
215
215
  margin: margin,
216
216
  size: size,
217
217
  ref: ref
@@ -259,7 +259,7 @@ var calculateWidth = function calculateWidth(margin, size) {
259
259
  return size === "fillParent" ? "calc(".concat(sizes[size], " - ").concat((0, _utils.getMargin)(margin, "left"), " - ").concat((0, _utils.getMargin)(margin, "right"), ")") : sizes[size];
260
260
  };
261
261
 
262
- var DxcTextarea = _styledComponents["default"].div(_templateObject(), function (props) {
262
+ var TextareaContainer = _styledComponents["default"].div(_templateObject(), function (props) {
263
263
  return calculateWidth(props.margin, props.size);
264
264
  }, function (props) {
265
265
  return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
@@ -337,7 +337,7 @@ var Error = _styledComponents["default"].span(_templateObject6(), function (prop
337
337
  return props.theme.fontFamily;
338
338
  });
339
339
 
340
- DxcNewTextarea.propTypes = {
340
+ DxcTextarea.propTypes = {
341
341
  label: _propTypes["default"].string,
342
342
  name: _propTypes["default"].string,
343
343
  value: _propTypes["default"].string,
@@ -365,5 +365,5 @@ DxcNewTextarea.propTypes = {
365
365
  size: _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(sizes))),
366
366
  tabIndex: _propTypes["default"].number
367
367
  };
368
- var _default = DxcNewTextarea;
368
+ var _default = DxcTextarea;
369
369
  exports["default"] = _default;
@@ -114,4 +114,4 @@ type Props = {
114
114
  ref?: React.RefObject<HTMLDivElement>;
115
115
  };
116
116
 
117
- export default function DxcNewTextarea(props: Props): JSX.Element;
117
+ export default function DxcTextarea(props: Props): JSX.Element;
File without changes
@@ -0,0 +1,21 @@
1
+ type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
2
+ type Margin = {
3
+ top?: Space;
4
+ bottom?: Space;
5
+ left?: Space;
6
+ right?: Space;
7
+ };
8
+
9
+ type Props = {
10
+ label?: string;
11
+ helperText?: string;
12
+ value?: any;
13
+ onChange?: void;
14
+ disabled?: boolean,
15
+ options?: any;
16
+ multiple?: boolean;
17
+ margin?: Space | Margin;
18
+ tabIndex?: number;
19
+ };
20
+
21
+ export default function DxcToggle(props: Props): JSX.Element;