@dxc-technology/halstack-react 0.0.0-375a8b0 → 0.0.0-38267fd

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 (298) hide show
  1. package/BackgroundColorContext.d.ts +10 -0
  2. package/BackgroundColorContext.js +1 -4
  3. package/HalstackContext.d.ts +12 -0
  4. package/HalstackContext.js +343 -0
  5. package/accordion/Accordion.d.ts +1 -1
  6. package/accordion/Accordion.js +119 -138
  7. package/accordion/Accordion.stories.tsx +395 -0
  8. package/accordion/Accordion.test.js +71 -0
  9. package/accordion/types.d.ts +12 -11
  10. package/accordion-group/AccordionGroup.d.ts +1 -1
  11. package/accordion-group/AccordionGroup.js +16 -37
  12. package/accordion-group/AccordionGroup.stories.tsx +251 -0
  13. package/accordion-group/AccordionGroup.test.js +126 -0
  14. package/accordion-group/types.d.ts +17 -10
  15. package/alert/Alert.js +7 -4
  16. package/alert/Alert.stories.tsx +28 -0
  17. package/alert/Alert.test.js +92 -0
  18. package/badge/Badge.d.ts +4 -0
  19. package/badge/Badge.js +6 -4
  20. package/badge/types.d.ts +5 -0
  21. package/bleed/Bleed.d.ts +3 -0
  22. package/bleed/Bleed.js +51 -0
  23. package/bleed/Bleed.stories.tsx +341 -0
  24. package/bleed/types.d.ts +37 -0
  25. package/bleed/types.js +5 -0
  26. package/box/Box.js +25 -37
  27. package/box/Box.stories.tsx +15 -0
  28. package/box/Box.test.js +18 -0
  29. package/box/types.d.ts +1 -0
  30. package/bulleted-list/BulletedList.d.ts +7 -0
  31. package/bulleted-list/BulletedList.js +123 -0
  32. package/bulleted-list/BulletedList.stories.tsx +200 -0
  33. package/bulleted-list/types.d.ts +11 -0
  34. package/bulleted-list/types.js +5 -0
  35. package/button/Button.d.ts +1 -1
  36. package/button/Button.js +59 -82
  37. package/button/Button.stories.tsx +163 -14
  38. package/button/Button.test.js +35 -0
  39. package/button/types.d.ts +10 -14
  40. package/card/Card.js +25 -28
  41. package/card/Card.stories.tsx +1 -1
  42. package/card/Card.test.js +50 -0
  43. package/card/types.d.ts +1 -0
  44. package/checkbox/Checkbox.d.ts +2 -2
  45. package/checkbox/Checkbox.js +108 -111
  46. package/checkbox/Checkbox.stories.tsx +198 -130
  47. package/checkbox/Checkbox.test.js +155 -0
  48. package/checkbox/types.d.ts +14 -6
  49. package/chip/Chip.d.ts +4 -0
  50. package/chip/Chip.js +22 -88
  51. package/chip/Chip.stories.tsx +98 -13
  52. package/chip/Chip.test.js +56 -0
  53. package/chip/types.d.ts +45 -0
  54. package/chip/types.js +5 -0
  55. package/common/variables.js +529 -602
  56. package/date-input/Calendar.d.ts +4 -0
  57. package/date-input/Calendar.js +258 -0
  58. package/date-input/DateInput.js +174 -266
  59. package/date-input/DateInput.stories.tsx +199 -33
  60. package/date-input/DateInput.test.js +835 -0
  61. package/date-input/DatePicker.d.ts +4 -0
  62. package/date-input/DatePicker.js +146 -0
  63. package/date-input/Icons.d.ts +6 -0
  64. package/date-input/Icons.js +75 -0
  65. package/date-input/YearPicker.d.ts +4 -0
  66. package/date-input/YearPicker.js +126 -0
  67. package/date-input/types.d.ts +67 -9
  68. package/dialog/Dialog.js +79 -95
  69. package/dialog/Dialog.stories.tsx +230 -123
  70. package/dialog/Dialog.test.js +369 -0
  71. package/dialog/types.d.ts +3 -2
  72. package/dropdown/Dropdown.d.ts +1 -1
  73. package/dropdown/Dropdown.js +248 -277
  74. package/dropdown/Dropdown.stories.tsx +438 -0
  75. package/dropdown/Dropdown.test.js +585 -0
  76. package/dropdown/DropdownMenu.d.ts +4 -0
  77. package/dropdown/DropdownMenu.js +70 -0
  78. package/dropdown/DropdownMenuItem.d.ts +4 -0
  79. package/dropdown/DropdownMenuItem.js +81 -0
  80. package/dropdown/types.d.ts +30 -19
  81. package/file-input/FileInput.d.ts +2 -2
  82. package/file-input/FileInput.js +179 -142
  83. package/file-input/FileInput.stories.tsx +618 -0
  84. package/file-input/FileInput.test.js +457 -0
  85. package/file-input/FileItem.d.ts +4 -14
  86. package/file-input/FileItem.js +47 -67
  87. package/file-input/types.d.ts +49 -7
  88. package/flex/Flex.d.ts +4 -0
  89. package/flex/Flex.js +69 -0
  90. package/flex/Flex.stories.tsx +103 -0
  91. package/flex/types.d.ts +32 -0
  92. package/flex/types.js +5 -0
  93. package/footer/Footer.d.ts +1 -1
  94. package/footer/Footer.js +32 -113
  95. package/footer/Footer.stories.tsx +228 -0
  96. package/footer/Footer.test.js +109 -0
  97. package/footer/Icons.d.ts +2 -0
  98. package/footer/Icons.js +4 -4
  99. package/footer/types.d.ts +22 -17
  100. package/header/Header.js +109 -130
  101. package/header/Header.stories.tsx +189 -36
  102. package/header/Header.test.js +79 -0
  103. package/header/Icons.d.ts +2 -0
  104. package/header/Icons.js +2 -2
  105. package/header/types.d.ts +3 -2
  106. package/heading/Heading.js +1 -1
  107. package/heading/Heading.stories.tsx +3 -2
  108. package/heading/Heading.test.js +186 -0
  109. package/inset/Inset.d.ts +3 -0
  110. package/inset/Inset.js +51 -0
  111. package/inset/Inset.stories.tsx +229 -0
  112. package/inset/types.d.ts +37 -0
  113. package/inset/types.js +5 -0
  114. package/layout/ApplicationLayout.d.ts +20 -0
  115. package/layout/ApplicationLayout.js +71 -135
  116. package/layout/ApplicationLayout.stories.tsx +162 -0
  117. package/layout/Icons.d.ts +5 -0
  118. package/layout/Icons.js +13 -2
  119. package/layout/SidenavContext.d.ts +5 -0
  120. package/layout/SidenavContext.js +19 -0
  121. package/layout/types.d.ts +42 -0
  122. package/layout/types.js +5 -0
  123. package/link/Link.d.ts +3 -2
  124. package/link/Link.js +62 -87
  125. package/link/Link.stories.tsx +159 -52
  126. package/link/Link.test.js +83 -0
  127. package/link/types.d.ts +9 -29
  128. package/main.d.ts +12 -12
  129. package/main.js +64 -58
  130. package/nav-tabs/NavTabs.d.ts +8 -0
  131. package/nav-tabs/NavTabs.js +125 -0
  132. package/nav-tabs/NavTabs.stories.tsx +260 -0
  133. package/nav-tabs/NavTabs.test.js +82 -0
  134. package/nav-tabs/Tab.d.ts +4 -0
  135. package/nav-tabs/Tab.js +150 -0
  136. package/nav-tabs/types.d.ts +53 -0
  137. package/nav-tabs/types.js +5 -0
  138. package/number-input/NumberInput.js +14 -24
  139. package/number-input/NumberInput.stories.tsx +5 -5
  140. package/number-input/NumberInput.test.js +542 -0
  141. package/number-input/types.d.ts +17 -10
  142. package/package.json +21 -22
  143. package/paginator/Icons.d.ts +5 -0
  144. package/paginator/Icons.js +16 -28
  145. package/paginator/Paginator.js +21 -54
  146. package/paginator/Paginator.stories.tsx +24 -0
  147. package/paginator/Paginator.test.js +315 -0
  148. package/paragraph/Paragraph.d.ts +6 -0
  149. package/paragraph/Paragraph.js +38 -0
  150. package/paragraph/Paragraph.stories.tsx +44 -0
  151. package/password-input/PasswordInput.js +23 -19
  152. package/password-input/PasswordInput.stories.tsx +3 -3
  153. package/password-input/PasswordInput.test.js +181 -0
  154. package/password-input/types.d.ts +26 -21
  155. package/progress-bar/ProgressBar.d.ts +2 -2
  156. package/progress-bar/ProgressBar.js +62 -56
  157. package/progress-bar/ProgressBar.stories.jsx +47 -12
  158. package/progress-bar/ProgressBar.test.js +110 -0
  159. package/progress-bar/types.d.ts +3 -4
  160. package/quick-nav/QuickNav.d.ts +4 -0
  161. package/quick-nav/QuickNav.js +117 -0
  162. package/quick-nav/QuickNav.stories.tsx +356 -0
  163. package/quick-nav/types.d.ts +21 -0
  164. package/quick-nav/types.js +5 -0
  165. package/radio-group/Radio.d.ts +4 -0
  166. package/radio-group/Radio.js +156 -0
  167. package/radio-group/RadioGroup.d.ts +4 -0
  168. package/radio-group/RadioGroup.js +283 -0
  169. package/radio-group/RadioGroup.stories.tsx +214 -0
  170. package/radio-group/RadioGroup.test.js +722 -0
  171. package/radio-group/types.d.ts +114 -0
  172. package/radio-group/types.js +5 -0
  173. package/resultsetTable/Icons.d.ts +7 -0
  174. package/resultsetTable/Icons.js +51 -0
  175. package/resultsetTable/ResultsetTable.d.ts +1 -1
  176. package/resultsetTable/ResultsetTable.js +53 -107
  177. package/resultsetTable/ResultsetTable.stories.tsx +300 -0
  178. package/resultsetTable/ResultsetTable.test.js +325 -0
  179. package/resultsetTable/types.d.ts +8 -4
  180. package/select/Icons.d.ts +10 -0
  181. package/select/Icons.js +93 -0
  182. package/select/Listbox.d.ts +4 -0
  183. package/select/Listbox.js +169 -0
  184. package/select/Option.d.ts +4 -0
  185. package/select/Option.js +97 -0
  186. package/select/Select.d.ts +4 -0
  187. package/select/Select.js +196 -397
  188. package/select/Select.stories.tsx +600 -201
  189. package/select/Select.test.js +2228 -0
  190. package/select/types.d.ts +210 -0
  191. package/select/types.js +5 -0
  192. package/sidenav/Sidenav.d.ts +6 -5
  193. package/sidenav/Sidenav.js +184 -54
  194. package/sidenav/Sidenav.stories.tsx +249 -132
  195. package/sidenav/Sidenav.test.js +44 -0
  196. package/sidenav/types.d.ts +50 -27
  197. package/slider/Slider.d.ts +2 -2
  198. package/slider/Slider.js +124 -98
  199. package/slider/Slider.stories.tsx +72 -9
  200. package/slider/Slider.test.js +250 -0
  201. package/slider/types.d.ts +10 -2
  202. package/spinner/Spinner.js +5 -5
  203. package/spinner/Spinner.stories.jsx +27 -0
  204. package/spinner/Spinner.test.js +64 -0
  205. package/switch/Switch.d.ts +2 -2
  206. package/switch/Switch.js +152 -69
  207. package/switch/Switch.stories.tsx +54 -43
  208. package/switch/Switch.test.js +225 -0
  209. package/switch/types.d.ts +12 -4
  210. package/table/Table.js +4 -4
  211. package/table/Table.stories.jsx +81 -1
  212. package/table/Table.test.js +26 -0
  213. package/tabs/Tab.d.ts +4 -0
  214. package/tabs/Tab.js +133 -0
  215. package/tabs/Tabs.d.ts +1 -1
  216. package/tabs/Tabs.js +364 -110
  217. package/tabs/Tabs.stories.tsx +226 -0
  218. package/tabs/Tabs.test.js +351 -0
  219. package/tabs/types.d.ts +39 -17
  220. package/tag/Tag.d.ts +1 -1
  221. package/tag/Tag.js +19 -29
  222. package/tag/Tag.stories.tsx +38 -28
  223. package/tag/Tag.test.js +60 -0
  224. package/tag/types.d.ts +23 -14
  225. package/text-input/Icons.d.ts +8 -0
  226. package/text-input/Icons.js +60 -0
  227. package/text-input/Suggestion.d.ts +4 -0
  228. package/text-input/Suggestion.js +84 -0
  229. package/text-input/Suggestions.d.ts +4 -0
  230. package/text-input/Suggestions.js +134 -0
  231. package/text-input/TextInput.js +231 -343
  232. package/text-input/TextInput.stories.tsx +569 -0
  233. package/text-input/TextInput.test.js +1724 -0
  234. package/text-input/types.d.ts +63 -23
  235. package/textarea/Textarea.d.ts +4 -0
  236. package/textarea/Textarea.js +39 -79
  237. package/textarea/Textarea.stories.jsx +96 -15
  238. package/textarea/Textarea.test.js +437 -0
  239. package/textarea/types.d.ts +137 -0
  240. package/textarea/types.js +5 -0
  241. package/toggle-group/ToggleGroup.d.ts +4 -0
  242. package/toggle-group/ToggleGroup.js +18 -46
  243. package/toggle-group/ToggleGroup.stories.tsx +69 -32
  244. package/toggle-group/ToggleGroup.test.js +156 -0
  245. package/toggle-group/types.d.ts +105 -0
  246. package/toggle-group/types.js +5 -0
  247. package/typography/Typography.d.ts +4 -0
  248. package/typography/Typography.js +131 -0
  249. package/typography/Typography.stories.tsx +198 -0
  250. package/typography/types.d.ts +18 -0
  251. package/typography/types.js +5 -0
  252. package/useTheme.d.ts +2 -0
  253. package/useTheme.js +2 -2
  254. package/useTranslatedLabels.d.ts +2 -0
  255. package/useTranslatedLabels.js +20 -0
  256. package/utils/FocusLock.d.ts +13 -0
  257. package/utils/FocusLock.js +139 -0
  258. package/wizard/Wizard.d.ts +1 -1
  259. package/wizard/Wizard.js +112 -58
  260. package/wizard/{Wizard.stories.jsx → Wizard.stories.tsx} +48 -19
  261. package/wizard/Wizard.test.js +141 -0
  262. package/wizard/types.d.ts +13 -12
  263. package/ThemeContext.js +0 -246
  264. package/V3Select/V3Select.js +0 -455
  265. package/V3Select/index.d.ts +0 -27
  266. package/V3Textarea/V3Textarea.js +0 -260
  267. package/V3Textarea/index.d.ts +0 -27
  268. package/chip/index.d.ts +0 -22
  269. package/common/RequiredComponent.js +0 -32
  270. package/date/Date.js +0 -373
  271. package/date/index.d.ts +0 -27
  272. package/footer/Footer.stories.jsx +0 -151
  273. package/input-text/Icons.js +0 -22
  274. package/input-text/InputText.js +0 -611
  275. package/input-text/index.d.ts +0 -36
  276. package/radio/Radio.d.ts +0 -4
  277. package/radio/Radio.js +0 -174
  278. package/radio/Radio.stories.tsx +0 -192
  279. package/radio/types.d.ts +0 -54
  280. package/select/index.d.ts +0 -131
  281. package/textarea/index.d.ts +0 -117
  282. package/toggle/Toggle.js +0 -186
  283. package/toggle/index.d.ts +0 -21
  284. package/toggle-group/index.d.ts +0 -21
  285. package/upload/Upload.js +0 -201
  286. package/upload/buttons-upload/ButtonsUpload.js +0 -111
  287. package/upload/buttons-upload/Icons.js +0 -40
  288. package/upload/dragAndDropArea/DragAndDropArea.js +0 -225
  289. package/upload/dragAndDropArea/Icons.js +0 -39
  290. package/upload/file-upload/FileToUpload.js +0 -115
  291. package/upload/file-upload/Icons.js +0 -66
  292. package/upload/files-upload/FilesToUpload.js +0 -109
  293. package/upload/index.d.ts +0 -15
  294. package/upload/transaction/Icons.js +0 -160
  295. package/upload/transaction/Transaction.js +0 -104
  296. package/upload/transactions/Transactions.js +0 -94
  297. package/wizard/Icons.js +0 -65
  298. /package/{radio → badge}/types.js +0 -0
@@ -6,12 +6,12 @@ declare type Margin = {
6
6
  left?: Space;
7
7
  right?: Space;
8
8
  };
9
- declare type SVG = React.SVGProps<SVGSVGElement> | React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
9
+ declare type SVG = React.ReactNode & React.SVGProps<SVGSVGElement>;
10
10
  declare type Action = {
11
11
  /**
12
12
  * This function will be called when the user clicks the action.
13
13
  */
14
- onClick: (event: React.MouseEvent<HTMLButtonElement>) => void;
14
+ onClick: () => void;
15
15
  /**
16
16
  * Icon to be shown in the action.
17
17
  */
@@ -21,14 +21,6 @@ declare type Action = {
21
21
  */
22
22
  title?: string;
23
23
  };
24
- declare type RequiredMinLength = {
25
- min: number;
26
- max?: number;
27
- };
28
- declare type RequiredMaxLength = {
29
- min?: number;
30
- max: number;
31
- };
32
24
  declare type Props = {
33
25
  /**
34
26
  * Text to be placed above the input. This label will be used as the aria-label attribute of the list of suggestions.
@@ -38,6 +30,10 @@ declare type Props = {
38
30
  * Name attribute of the input element.
39
31
  */
40
32
  name?: string;
33
+ /**
34
+ * Initial value of the input, only when it is uncontrolled.
35
+ */
36
+ defaultValue?: string;
41
37
  /**
42
38
  * Value of the input. If undefined, the component will be uncontrolled and the value will be managed internally by the component.
43
39
  */
@@ -82,26 +78,29 @@ declare type Props = {
82
78
  * This function will be called when the user types within the input
83
79
  * element of the component. An object including the current value and
84
80
  * the error (if the value entered is not valid) will be passed to this
85
- * function. If there is no error, error will be null.
81
+ * function. If there is no error, error will not be defined.
86
82
  */
87
83
  onChange?: (val: {
88
84
  value: string;
89
- error: string | null;
85
+ error?: string;
90
86
  }) => void;
91
87
  /**
92
88
  * This function will be called when the input element loses the focus.
93
89
  * An object including the input value and the error (if the value
94
90
  * entered is not valid) will be passed to this function. If there is no error,
95
- * error will be null.
91
+ * error will not be defined.
96
92
  */
97
93
  onBlur?: (val: {
98
94
  value: string;
99
- error: string | null;
95
+ error?: string;
100
96
  }) => void;
101
97
  /**
102
- * If it is defined, the component will change its appearance, showing
103
- * the error below the input component. If it is not defined, the error
104
- * messages will be managed internally, but never displayed on its own.
98
+ * If it is a defined value and also a truthy string, the component will
99
+ * change its appearance, showing the error below the input component. If
100
+ * the defined value is an empty string, it will reserve a space below
101
+ * the component for a future error, but it would not change its look. In
102
+ * case of being undefined or null, both the appearance and the space for
103
+ * the error message would not be modified.
105
104
  */
106
105
  error?: string;
107
106
  /**
@@ -118,19 +117,29 @@ declare type Props = {
118
117
  * pattern, the onBlur and onChange functions will be called with the
119
118
  * current value and an internal error informing that this value does not
120
119
  * match the pattern. If the pattern is met, the error parameter of both
121
- * events will be null.
120
+ * events will not be defined.
122
121
  */
123
122
  pattern?: string;
124
123
  /**
125
- * Specifies the minimun and maximum length allowed by the input.
124
+ * Specifies the minimun length allowed by the input.
126
125
  * This will be checked both when the input element loses the
127
126
  * focus and while typing within it. If the string entered does not
128
- * comply the length, the onBlur and onChange functions will be called
127
+ * comply the minimum length, the onBlur and onChange functions will be called
129
128
  * with the current value and an internal error informing that the value
130
129
  * length does not comply the specified range. If a valid length is
131
- * reached, the error parameter of both events will be null.
130
+ * reached, the error parameter of both events will not be defined.
132
131
  */
133
- length?: RequiredMinLength | RequiredMaxLength;
132
+ minLength?: number;
133
+ /**
134
+ * Specifies the maximum length allowed by the input.
135
+ * This will be checked both when the input element loses the
136
+ * focus and while typing within it. If the string entered does not
137
+ * comply the maximum length, the onBlur and onChange functions will be called
138
+ * with the current value and an internal error informing that the value
139
+ * length does not comply the specified range. If a valid length is
140
+ * reached, the error parameter of both events will not be defined.
141
+ */
142
+ maxLength?: number;
134
143
  /**
135
144
  * HTML autocomplete attribute. Lets the user specify if any permission the user agent has to provide automated assistance in filling out the input value.
136
145
  * Its value must be one of all the possible values of the HTML autocomplete attribute: 'on', 'off', 'email', 'username', 'new-password', ...
@@ -142,7 +151,7 @@ declare type Props = {
142
151
  */
143
152
  margin?: Space | Margin;
144
153
  /**
145
- * Size of the component ('small' | 'medium' | 'large' | 'fillParent').
154
+ * Size of the component.
146
155
  */
147
156
  size?: "small" | "medium" | "large" | "fillParent";
148
157
  /**
@@ -150,8 +159,39 @@ declare type Props = {
150
159
  */
151
160
  tabIndex?: number;
152
161
  };
162
+ /**
163
+ * List of suggestions of an Text Input component.
164
+ */
165
+ export declare type SuggestionsProps = {
166
+ id: string;
167
+ value: string;
168
+ suggestions: string[];
169
+ visualFocusIndex: number;
170
+ highlightedSuggestions: boolean;
171
+ searchHasErrors: boolean;
172
+ isSearching: boolean;
173
+ suggestionOnClick: (suggestion: string) => void;
174
+ getTextInputWidth: () => number;
175
+ };
153
176
  /**
154
177
  * Reference to the component.
155
178
  */
156
179
  export declare type RefType = HTMLDivElement;
180
+ /**
181
+ * Single suggestion of an Text Input component.
182
+ */
183
+ export declare type SuggestionProps = {
184
+ id: string;
185
+ value: string;
186
+ onClick: (suggestion: string) => void;
187
+ suggestion: string;
188
+ isLast: boolean;
189
+ visuallyFocused: boolean;
190
+ highlighted: boolean;
191
+ };
192
+ export declare type AutosuggestWrapperProps = {
193
+ condition: boolean;
194
+ wrapper: (children: React.ReactNode) => JSX.Element;
195
+ children: React.ReactNode;
196
+ };
157
197
  export default Props;
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import TextareaPropsType from "./types";
3
+ declare const DxcTextarea: React.ForwardRefExoticComponent<TextareaPropsType & React.RefAttributes<HTMLDivElement>>;
4
+ export default DxcTextarea;
@@ -9,8 +9,6 @@ Object.defineProperty(exports, "__esModule", {
9
9
  });
10
10
  exports["default"] = void 0;
11
11
 
12
- var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
13
-
14
12
  var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
15
13
 
16
14
  var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
@@ -23,15 +21,15 @@ var _styledComponents = _interopRequireWildcard(require("styled-components"));
23
21
 
24
22
  var _utils = require("../common/utils.js");
25
23
 
26
- var _useTheme = _interopRequireDefault(require("../useTheme.js"));
24
+ var _useTheme = _interopRequireDefault(require("../useTheme"));
27
25
 
28
- var _propTypes = _interopRequireDefault(require("prop-types"));
26
+ var _useTranslatedLabels = _interopRequireDefault(require("../useTranslatedLabels"));
29
27
 
30
28
  var _variables = require("../common/variables.js");
31
29
 
32
30
  var _uuid = require("uuid");
33
31
 
34
- var _BackgroundColorContext = _interopRequireDefault(require("../BackgroundColorContext.js"));
32
+ var _BackgroundColorContext = _interopRequireDefault(require("../BackgroundColorContext"));
35
33
 
36
34
  var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
37
35
 
@@ -39,30 +37,18 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
39
37
 
40
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; }
41
39
 
42
- var getNotOptionalErrorMessage = function getNotOptionalErrorMessage() {
43
- return "This field is required. Please, enter a value.";
44
- };
45
-
46
- var getLengthErrorMessage = function getLengthErrorMessage(length) {
47
- return "Min length ".concat(length.min, ", max length ").concat(length.max, ".");
48
- };
49
-
50
- var getPatternErrorMessage = function getPatternErrorMessage() {
51
- return "Please match the format requested.";
52
- };
53
-
54
40
  var patternMatch = function patternMatch(pattern, value) {
55
41
  return new RegExp(pattern).test(value);
56
42
  };
57
43
 
58
44
  var DxcTextarea = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
59
- var _ref$label = _ref.label,
60
- label = _ref$label === void 0 ? "" : _ref$label,
45
+ var label = _ref.label,
61
46
  _ref$name = _ref.name,
62
47
  name = _ref$name === void 0 ? "" : _ref$name,
48
+ _ref$defaultValue = _ref.defaultValue,
49
+ defaultValue = _ref$defaultValue === void 0 ? "" : _ref$defaultValue,
63
50
  value = _ref.value,
64
- _ref$helperText = _ref.helperText,
65
- helperText = _ref$helperText === void 0 ? "" : _ref$helperText,
51
+ helperText = _ref.helperText,
66
52
  _ref$placeholder = _ref.placeholder,
67
53
  placeholder = _ref$placeholder === void 0 ? "" : _ref$placeholder,
68
54
  _ref$disabled = _ref.disabled,
@@ -75,10 +61,10 @@ var DxcTextarea = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref)
75
61
  rows = _ref$rows === void 0 ? 4 : _ref$rows,
76
62
  onChange = _ref.onChange,
77
63
  onBlur = _ref.onBlur,
78
- _ref$error = _ref.error,
79
- error = _ref$error === void 0 ? "" : _ref$error,
64
+ error = _ref.error,
80
65
  pattern = _ref.pattern,
81
- length = _ref.length,
66
+ minLength = _ref.minLength,
67
+ maxLength = _ref.maxLength,
82
68
  _ref$autocomplete = _ref.autocomplete,
83
69
  autocomplete = _ref$autocomplete === void 0 ? "off" : _ref$autocomplete,
84
70
  margin = _ref.margin,
@@ -87,7 +73,7 @@ var DxcTextarea = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref)
87
73
  _ref$tabIndex = _ref.tabIndex,
88
74
  tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex;
89
75
 
90
- var _useState = (0, _react.useState)(""),
76
+ var _useState = (0, _react.useState)(defaultValue),
91
77
  _useState2 = (0, _slicedToArray2["default"])(_useState, 2),
92
78
  innerValue = _useState2[0],
93
79
  setInnerValue = _useState2[1];
@@ -98,47 +84,46 @@ var DxcTextarea = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref)
98
84
 
99
85
  var colorsTheme = (0, _useTheme["default"])();
100
86
  var backgroundType = (0, _react.useContext)(_BackgroundColorContext["default"]);
87
+ var translatedLabels = (0, _useTranslatedLabels["default"])();
101
88
  var textareaRef = (0, _react.useRef)(null);
102
- var errorId = "error-message-".concat(textareaId);
89
+ var errorId = "error-".concat(textareaId);
103
90
 
104
91
  var isNotOptional = function isNotOptional(value) {
105
92
  return value === "" && !optional;
106
93
  };
107
94
 
108
95
  var isLengthIncorrect = function isLengthIncorrect(value) {
109
- return value !== "" && length && length.min && length.max && (value.length < length.min || value.length > length.max);
96
+ return value !== "" && minLength && maxLength && (value.length < minLength || value.length > maxLength);
110
97
  };
111
98
 
112
99
  var changeValue = function changeValue(newValue) {
113
100
  value !== null && value !== void 0 ? value : setInnerValue(newValue);
114
101
  if (isNotOptional(newValue)) onChange === null || onChange === void 0 ? void 0 : onChange({
115
102
  value: newValue,
116
- error: getNotOptionalErrorMessage()
103
+ error: translatedLabels.formFields.requiredValueErrorMessage
117
104
  });else if (isLengthIncorrect(newValue)) onChange === null || onChange === void 0 ? void 0 : onChange({
118
105
  value: newValue,
119
- error: getLengthErrorMessage(length)
106
+ error: translatedLabels.formFields.lengthErrorMessage(minLength, maxLength)
120
107
  });else if (newValue && pattern && !patternMatch(pattern, newValue)) onChange === null || onChange === void 0 ? void 0 : onChange({
121
108
  value: newValue,
122
- error: getPatternErrorMessage()
109
+ error: translatedLabels.formFields.formatRequestedErrorMessage
123
110
  });else onChange === null || onChange === void 0 ? void 0 : onChange({
124
- value: newValue,
125
- error: null
111
+ value: newValue
126
112
  });
127
113
  };
128
114
 
129
115
  var handleTOnBlur = function handleTOnBlur(event) {
130
116
  if (isNotOptional(event.target.value)) onBlur === null || onBlur === void 0 ? void 0 : onBlur({
131
117
  value: event.target.value,
132
- error: getNotOptionalErrorMessage()
118
+ error: translatedLabels.formFields.requiredValueErrorMessage
133
119
  });else if (isLengthIncorrect(event.target.value)) onBlur === null || onBlur === void 0 ? void 0 : onBlur({
134
120
  value: event.target.value,
135
- error: getLengthErrorMessage(length)
121
+ error: translatedLabels.formFields.lengthErrorMessage(minLength, maxLength)
136
122
  });else if (event.target.value && pattern && !patternMatch(pattern, event.target.value)) onBlur === null || onBlur === void 0 ? void 0 : onBlur({
137
123
  value: event.target.value,
138
- error: getPatternErrorMessage()
124
+ error: translatedLabels.formFields.formatRequestedErrorMessage
139
125
  });else onBlur === null || onBlur === void 0 ? void 0 : onBlur({
140
- value: event.target.value,
141
- error: null
126
+ value: event.target.value
142
127
  });
143
128
  };
144
129
 
@@ -161,11 +146,12 @@ var DxcTextarea = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref)
161
146
  margin: margin,
162
147
  size: size,
163
148
  ref: ref
164
- }, /*#__PURE__*/_react["default"].createElement(Label, {
149
+ }, label && /*#__PURE__*/_react["default"].createElement(Label, {
165
150
  htmlFor: textareaId,
166
151
  disabled: disabled,
167
- backgroundType: backgroundType
168
- }, label, " ", optional && /*#__PURE__*/_react["default"].createElement(OptionalLabel, null, "(Optional)")), /*#__PURE__*/_react["default"].createElement(HelperText, {
152
+ backgroundType: backgroundType,
153
+ helperText: helperText
154
+ }, label, " ", optional && /*#__PURE__*/_react["default"].createElement(OptionalLabel, null, translatedLabels.formFields.optionalLabel)), helperText && /*#__PURE__*/_react["default"].createElement(HelperText, {
169
155
  disabled: disabled,
170
156
  backgroundType: backgroundType
171
157
  }, helperText), /*#__PURE__*/_react["default"].createElement(Textarea, {
@@ -179,18 +165,20 @@ var DxcTextarea = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref)
179
165
  onBlur: handleTOnBlur,
180
166
  disabled: disabled,
181
167
  error: error,
182
- minLength: length === null || length === void 0 ? void 0 : length.min,
183
- maxLength: length === null || length === void 0 ? void 0 : length.max,
168
+ minLength: minLength,
169
+ maxLength: maxLength,
184
170
  autoComplete: autocomplete,
185
171
  backgroundType: backgroundType,
186
172
  ref: textareaRef,
187
173
  tabIndex: tabIndex,
174
+ "aria-disabled": disabled,
188
175
  "aria-invalid": error ? "true" : "false",
189
- "aria-describedby": error ? errorId : undefined,
176
+ "aria-errormessage": error ? errorId : undefined,
190
177
  "aria-required": optional ? "false" : "true"
191
- }), !disabled && /*#__PURE__*/_react["default"].createElement(Error, {
178
+ }), !disabled && typeof error === "string" && /*#__PURE__*/_react["default"].createElement(Error, {
192
179
  id: errorId,
193
- backgroundType: backgroundType
180
+ backgroundType: backgroundType,
181
+ "aria-live": error ? "assertive" : "off"
194
182
  }, error)));
195
183
  });
196
184
 
@@ -219,7 +207,7 @@ var TextareaContainer = _styledComponents["default"].div(_templateObject || (_te
219
207
  return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
220
208
  });
221
209
 
222
- 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"])), function (props) {
210
+ 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) {
223
211
  return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledLabelFontColorOnDark : props.theme.disabledLabelFontColor : props.backgroundType === "dark" ? props.theme.labelFontColorOnDark : props.theme.labelFontColor;
224
212
  }, function (props) {
225
213
  return props.theme.fontFamily;
@@ -231,13 +219,15 @@ var Label = _styledComponents["default"].label(_templateObject2 || (_templateObj
231
219
  return props.theme.labelFontWeight;
232
220
  }, function (props) {
233
221
  return props.theme.labelLineHeight;
222
+ }, function (props) {
223
+ return !props.helperText && "margin-bottom: 0.25rem";
234
224
  });
235
225
 
236
226
  var OptionalLabel = _styledComponents["default"].span(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n font-weight: ", ";\n"])), function (props) {
237
227
  return props.theme.optionalLabelFontWeight;
238
228
  });
239
229
 
240
- 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"])), function (props) {
230
+ 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) {
241
231
  return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledHelperTextFontColorOnDark : props.theme.disabledHelperTextFontColor : props.backgroundType === "dark" ? props.theme.helperTextFontColorOnDark : props.theme.helperTextFontColor;
242
232
  }, function (props) {
243
233
  return props.theme.fontFamily;
@@ -251,12 +241,10 @@ var HelperText = _styledComponents["default"].span(_templateObject4 || (_templat
251
241
  return props.theme.helperTextLineHeight;
252
242
  });
253
243
 
254
- var Textarea = _styledComponents["default"].textarea(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n ", ";\n ", "\n\n margin: ", ";\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) {
244
+ 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) {
255
245
  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;";
256
246
  }, function (props) {
257
247
  if (props.disabled) return props.backgroundType === "dark" ? "background-color: ".concat(props.theme.disabledContainerFillColorOnDark, ";") : "background-color: ".concat(props.theme.disabledContainerFillColor, ";");else return "background-color: transparent;";
258
- }, function (props) {
259
- return "".concat(props.theme.inputMarginTop, " 0 ").concat(props.theme.inputMarginBottom, " 0");
260
248
  }, function (props) {
261
249
  if (props.disabled) return props.backgroundType === "dark" ? props.theme.disabledBorderColorOnDark : props.theme.disabledBorderColor;else return props.backgroundType === "dark" ? props.theme.enabledBorderColorOnDark : props.theme.enabledBorderColor;
262
250
  }, function (props) {
@@ -279,39 +267,11 @@ var Textarea = _styledComponents["default"].textarea(_templateObject5 || (_templ
279
267
  return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledPlaceholderFontColorOnDark : props.theme.disabledPlaceholderFontColor : props.backgroundType === "dark" ? props.theme.placeholderFontColorOnDark : props.theme.placeholderFontColor;
280
268
  });
281
269
 
282
- 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"])), function (props) {
270
+ 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) {
283
271
  return props.backgroundType === "dark" ? props.theme.errorMessageColorOnDark : props.theme.errorMessageColor;
284
272
  }, function (props) {
285
273
  return props.theme.fontFamily;
286
274
  });
287
275
 
288
- DxcTextarea.propTypes = {
289
- label: _propTypes["default"].string,
290
- name: _propTypes["default"].string,
291
- value: _propTypes["default"].string,
292
- helperText: _propTypes["default"].string,
293
- placeholder: _propTypes["default"].string,
294
- verticalGrow: _propTypes["default"].oneOf(["auto", "none", "manual"]),
295
- rows: _propTypes["default"].number,
296
- length: _propTypes["default"].shape({
297
- min: _propTypes["default"].number,
298
- max: _propTypes["default"].number
299
- }),
300
- pattern: _propTypes["default"].string,
301
- disabled: _propTypes["default"].bool,
302
- optional: _propTypes["default"].bool,
303
- onChange: _propTypes["default"].func,
304
- onBlur: _propTypes["default"].func,
305
- error: _propTypes["default"].string,
306
- autocomplete: _propTypes["default"].string,
307
- margin: _propTypes["default"].oneOfType([_propTypes["default"].shape({
308
- top: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
309
- bottom: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
310
- left: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
311
- right: _propTypes["default"].oneOf(Object.keys(_variables.spaces))
312
- }), _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(_variables.spaces)))]),
313
- size: _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(sizes))),
314
- tabIndex: _propTypes["default"].number
315
- };
316
276
  var _default = DxcTextarea;
317
277
  exports["default"] = _default;
@@ -4,12 +4,20 @@ import Title from "../../.storybook/components/Title";
4
4
  import ExampleContainer from "../../.storybook/components/ExampleContainer";
5
5
  import { BackgroundColorProvider } from "../BackgroundColorContext";
6
6
  import DarkContainer from "../../.storybook/components/DarkSection";
7
+ import { HalstackProvider } from "../HalstackContext";
7
8
 
8
9
  export default {
9
10
  title: "Textarea",
10
11
  component: DxcTextarea,
11
12
  };
12
13
 
14
+ const opinionatedTheme = {
15
+ textarea: {
16
+ fontColor: "#000000",
17
+ hoverBorderColor: "#a46ede",
18
+ },
19
+ };
20
+
13
21
  export const Chromatic = () => (
14
22
  <>
15
23
  <>
@@ -33,7 +41,7 @@ export const Chromatic = () => (
33
41
  </ExampleContainer>
34
42
  <ExampleContainer>
35
43
  <Title title="Disabled with value" theme="light" level={4} />
36
- <DxcTextarea label="Disabled" value="Example text" disabled />
44
+ <DxcTextarea label="Disabled" defaultValue="Example text" disabled />
37
45
  </ExampleContainer>
38
46
  <ExampleContainer>
39
47
  <Title title="With error" theme="light" level={4} />
@@ -41,12 +49,21 @@ export const Chromatic = () => (
41
49
  label="Textarea with error"
42
50
  helperText="Helper text"
43
51
  placeholder="Enter your text here..."
44
- error="Error message"
52
+ error="Error message."
53
+ />
54
+ </ExampleContainer>
55
+ <ExampleContainer pseudoState="pseudo-hover">
56
+ <Title title="Hovered with error" theme="light" level={4} />
57
+ <DxcTextarea
58
+ label="Hovered textarea with error"
59
+ helperText="Helper text"
60
+ placeholder="Enter your text here..."
61
+ error="Error message."
45
62
  />
46
63
  </ExampleContainer>
47
64
  <ExampleContainer>
48
65
  <Title title="Helper text and optional with value" theme="light" level={4} />
49
- <DxcTextarea label="Helper & optional" value="Some text" helperText="Sample text" optional />
66
+ <DxcTextarea label="Helper & optional" defaultValue="Some text" helperText="Sample text" optional />
50
67
  </ExampleContainer>
51
68
  <ExampleContainer>
52
69
  <Title title="Resizable" theme="light" level={4} />
@@ -57,36 +74,48 @@ export const Chromatic = () => (
57
74
  <DxcTextarea
58
75
  label="Manual vertical grow"
59
76
  verticalGrow="manual"
60
- value="Long textttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt"
77
+ defaultValue="Long textttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt"
61
78
  />
62
79
  </ExampleContainer>
63
80
  </>
64
81
  <BackgroundColorProvider color="#333333">
65
82
  <DarkContainer>
66
- <>
83
+ <ExampleContainer>
67
84
  <Title title="Helper text and optional with value" theme="dark" level={4} />
68
- <DxcTextarea label="Helper & optional" value="Some text" margin="medium" helperText="Sample text" optional />
69
-
85
+ <DxcTextarea label="Helper & optional" defaultValue="Some text" helperText="Sample text" optional />
86
+ </ExampleContainer>
87
+ <ExampleContainer>
70
88
  <Title title="Disabled" theme="dark" level={4} />
71
89
  <DxcTextarea
72
90
  label="Disabled"
73
- margin="medium"
74
91
  optional
75
92
  helperText="Sample text"
76
93
  placeholder="Enter your text here..."
77
94
  disabled
78
95
  />
96
+ </ExampleContainer>
97
+ <ExampleContainer>
79
98
  <Title title="Disabled with value" theme="dark" level={4} />
80
- <DxcTextarea label="Disabled" margin="medium" value="Example text" disabled />
99
+ <DxcTextarea label="Disabled" defaultValue="Example text" disabled />
100
+ </ExampleContainer>
101
+ <ExampleContainer>
81
102
  <Title title="With error" theme="dark" level={4} />
82
103
  <DxcTextarea
83
104
  label="Textarea with error"
84
- margin="medium"
85
105
  helperText="Helper text"
86
106
  placeholder="Enter your text here..."
87
- error="Error message"
107
+ error="Error message."
108
+ />
109
+ </ExampleContainer>
110
+ <ExampleContainer pseudoState="pseudo-hover">
111
+ <Title title="Hovered with error" theme="dark" level={4} />
112
+ <DxcTextarea
113
+ label="Hovered textarea with error"
114
+ helperText="Helper text"
115
+ placeholder="Enter your text here..."
116
+ error="Error message."
88
117
  />
89
- </>
118
+ </ExampleContainer>
90
119
  </DarkContainer>
91
120
  </BackgroundColorProvider>
92
121
  <Title title="Sizes" theme="light" level={2} />
@@ -105,15 +134,15 @@ export const Chromatic = () => (
105
134
  <Title title="Margins" theme="light" level={2} />
106
135
  <ExampleContainer>
107
136
  <Title title="Xxsmall margin" theme="light" level={4} />
108
- <DxcTextarea label="Xxsmmall" margin="xxsmall" />
137
+ <DxcTextarea label="Xxsmall" margin="xxsmall" />
109
138
  </ExampleContainer>
110
139
  <ExampleContainer>
111
140
  <Title title="Xsmall margin" theme="light" level={4} />
112
- <DxcTextarea label="xsmmall" margin="xsmall" />
141
+ <DxcTextarea label="xsmall" margin="xsmall" />
113
142
  </ExampleContainer>
114
143
  <ExampleContainer>
115
144
  <Title title="Small margin" theme="light" level={4} />
116
- <DxcTextarea label="smmall" margin="small" />
145
+ <DxcTextarea label="small" margin="small" />
117
146
  </ExampleContainer>
118
147
  <ExampleContainer>
119
148
  <Title title="Medium margin" theme="light" level={4} />
@@ -131,5 +160,57 @@ export const Chromatic = () => (
131
160
  <Title title="Xxlarge margin" theme="light" level={4} />
132
161
  <DxcTextarea label="Xxlarge" margin="xxlarge" />
133
162
  </ExampleContainer>
163
+ <Title title="Opinionated theme" theme="light" level={2} />
164
+ <ExampleContainer pseudoState="pseudo-hover">
165
+ <Title title="Hovered" theme="light" level={4} />
166
+ <HalstackProvider theme={opinionatedTheme}>
167
+ <DxcTextarea label="Hovered" helperText="Sample text" placeholder="Placeholder" />
168
+ </HalstackProvider>
169
+ </ExampleContainer>
170
+ <ExampleContainer pseudoState="pseudo-focus">
171
+ <Title title="Focused" theme="light" level={4} />
172
+ <HalstackProvider theme={opinionatedTheme}>
173
+ <DxcTextarea label="Focused" helperText="Sample text" />
174
+ </HalstackProvider>
175
+ </ExampleContainer>
176
+ <ExampleContainer>
177
+ <Title title="Disabled" theme="light" level={4} />
178
+ <HalstackProvider theme={opinionatedTheme}>
179
+ <DxcTextarea
180
+ label="Disabled"
181
+ optional
182
+ helperText="Sample text"
183
+ placeholder="Enter your text here..."
184
+ disabled
185
+ />
186
+ </HalstackProvider>
187
+ </ExampleContainer>
188
+ <ExampleContainer>
189
+ <Title title="Disabled with value" theme="light" level={4} />
190
+ <HalstackProvider theme={opinionatedTheme}>
191
+ <DxcTextarea label="Disabled" helperText="Sample text" defaultValue="Example text" disabled />
192
+ </HalstackProvider>
193
+ </ExampleContainer>
194
+ <ExampleContainer>
195
+ <Title title="With error" theme="light" level={4} />
196
+ <HalstackProvider theme={opinionatedTheme}>
197
+ <DxcTextarea
198
+ label="Textarea with error"
199
+ helperText="Helper text"
200
+ placeholder="Enter your text here..."
201
+ error="Error message."
202
+ />
203
+ </HalstackProvider>
204
+ </ExampleContainer>
205
+ <ExampleContainer>
206
+ <Title title="Grow manual" theme="light" level={4} />{" "}
207
+ <HalstackProvider theme={opinionatedTheme}>
208
+ <DxcTextarea
209
+ label="Manual vertical grow"
210
+ verticalGrow="manual"
211
+ defaultValue="Long textttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt"
212
+ />
213
+ </HalstackProvider>
214
+ </ExampleContainer>
134
215
  </>
135
216
  );