@dxc-technology/halstack-react 0.0.0-757bc34 → 0.0.0-75a7c98

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 (353) hide show
  1. package/README.md +1 -2
  2. package/dist/index.d.mts +6589 -0
  3. package/dist/index.d.ts +6589 -0
  4. package/dist/index.js +13854 -0
  5. package/dist/index.mjs +13796 -0
  6. package/package.json +68 -68
  7. package/BackgroundColorContext.d.ts +0 -10
  8. package/BackgroundColorContext.js +0 -35
  9. package/HalstackContext.d.ts +0 -1353
  10. package/HalstackContext.js +0 -310
  11. package/accordion/Accordion.d.ts +0 -4
  12. package/accordion/Accordion.js +0 -185
  13. package/accordion/Accordion.stories.tsx +0 -283
  14. package/accordion/Accordion.test.js +0 -56
  15. package/accordion/types.d.ts +0 -57
  16. package/accordion/types.js +0 -5
  17. package/accordion-group/AccordionGroup.d.ts +0 -8
  18. package/accordion-group/AccordionGroup.js +0 -101
  19. package/accordion-group/AccordionGroup.stories.tsx +0 -252
  20. package/accordion-group/AccordionGroup.test.js +0 -98
  21. package/accordion-group/AccordionGroupAccordion.d.ts +0 -4
  22. package/accordion-group/AccordionGroupAccordion.js +0 -31
  23. package/accordion-group/types.d.ts +0 -67
  24. package/accordion-group/types.js +0 -5
  25. package/alert/Alert.d.ts +0 -4
  26. package/alert/Alert.js +0 -257
  27. package/alert/Alert.stories.tsx +0 -198
  28. package/alert/Alert.test.js +0 -75
  29. package/alert/types.d.ts +0 -49
  30. package/alert/types.js +0 -5
  31. package/badge/Badge.d.ts +0 -4
  32. package/badge/Badge.js +0 -48
  33. package/badge/types.d.ts +0 -5
  34. package/badge/types.js +0 -5
  35. package/bleed/Bleed.d.ts +0 -3
  36. package/bleed/Bleed.js +0 -43
  37. package/bleed/Bleed.stories.tsx +0 -342
  38. package/bleed/types.d.ts +0 -37
  39. package/bleed/types.js +0 -5
  40. package/box/Box.d.ts +0 -4
  41. package/box/Box.js +0 -78
  42. package/box/Box.stories.tsx +0 -119
  43. package/box/Box.test.js +0 -13
  44. package/box/types.d.ts +0 -32
  45. package/box/types.js +0 -5
  46. package/bulleted-list/BulletedList.d.ts +0 -7
  47. package/bulleted-list/BulletedList.js +0 -99
  48. package/bulleted-list/BulletedList.stories.tsx +0 -116
  49. package/bulleted-list/types.d.ts +0 -38
  50. package/bulleted-list/types.js +0 -5
  51. package/button/Button.d.ts +0 -4
  52. package/button/Button.js +0 -121
  53. package/button/Button.stories.tsx +0 -344
  54. package/button/Button.test.js +0 -36
  55. package/button/types.d.ts +0 -57
  56. package/button/types.js +0 -5
  57. package/card/Card.d.ts +0 -4
  58. package/card/Card.js +0 -120
  59. package/card/Card.stories.tsx +0 -171
  60. package/card/Card.test.js +0 -39
  61. package/card/types.d.ts +0 -62
  62. package/card/types.js +0 -5
  63. package/checkbox/Checkbox.d.ts +0 -4
  64. package/checkbox/Checkbox.js +0 -220
  65. package/checkbox/Checkbox.stories.tsx +0 -222
  66. package/checkbox/Checkbox.test.js +0 -199
  67. package/checkbox/types.d.ts +0 -72
  68. package/checkbox/types.js +0 -5
  69. package/chip/Chip.d.ts +0 -4
  70. package/chip/Chip.js +0 -121
  71. package/chip/Chip.stories.tsx +0 -214
  72. package/chip/Chip.test.js +0 -41
  73. package/chip/types.d.ts +0 -45
  74. package/chip/types.js +0 -5
  75. package/common/OpenSans.css +0 -69
  76. package/common/coreTokens.d.ts +0 -237
  77. package/common/coreTokens.js +0 -184
  78. package/common/fonts/OpenSans-Bold.ttf +0 -0
  79. package/common/fonts/OpenSans-BoldItalic.ttf +0 -0
  80. package/common/fonts/OpenSans-ExtraBold.ttf +0 -0
  81. package/common/fonts/OpenSans-ExtraBoldItalic.ttf +0 -0
  82. package/common/fonts/OpenSans-Italic.ttf +0 -0
  83. package/common/fonts/OpenSans-Light.ttf +0 -0
  84. package/common/fonts/OpenSans-LightItalic.ttf +0 -0
  85. package/common/fonts/OpenSans-Regular.ttf +0 -0
  86. package/common/fonts/OpenSans-SemiBold.ttf +0 -0
  87. package/common/fonts/OpenSans-SemiBoldItalic.ttf +0 -0
  88. package/common/utils.d.ts +0 -1
  89. package/common/utils.js +0 -16
  90. package/common/variables.d.ts +0 -1499
  91. package/common/variables.js +0 -1371
  92. package/container/Container.d.ts +0 -4
  93. package/container/Container.js +0 -198
  94. package/container/Container.stories.tsx +0 -229
  95. package/container/types.d.ts +0 -74
  96. package/container/types.js +0 -5
  97. package/date-input/Calendar.d.ts +0 -4
  98. package/date-input/Calendar.js +0 -214
  99. package/date-input/DateInput.d.ts +0 -4
  100. package/date-input/DateInput.js +0 -223
  101. package/date-input/DateInput.stories.tsx +0 -285
  102. package/date-input/DateInput.test.js +0 -808
  103. package/date-input/DatePicker.d.ts +0 -4
  104. package/date-input/DatePicker.js +0 -115
  105. package/date-input/Icons.d.ts +0 -6
  106. package/date-input/Icons.js +0 -58
  107. package/date-input/YearPicker.d.ts +0 -4
  108. package/date-input/YearPicker.js +0 -100
  109. package/date-input/types.d.ts +0 -164
  110. package/date-input/types.js +0 -5
  111. package/dialog/Dialog.d.ts +0 -4
  112. package/dialog/Dialog.js +0 -107
  113. package/dialog/Dialog.stories.tsx +0 -365
  114. package/dialog/Dialog.test.js +0 -307
  115. package/dialog/types.d.ts +0 -36
  116. package/dialog/types.js +0 -5
  117. package/dropdown/Dropdown.d.ts +0 -4
  118. package/dropdown/Dropdown.js +0 -334
  119. package/dropdown/Dropdown.stories.tsx +0 -438
  120. package/dropdown/Dropdown.test.js +0 -599
  121. package/dropdown/DropdownMenu.d.ts +0 -4
  122. package/dropdown/DropdownMenu.js +0 -63
  123. package/dropdown/DropdownMenuItem.d.ts +0 -4
  124. package/dropdown/DropdownMenuItem.js +0 -67
  125. package/dropdown/types.d.ts +0 -98
  126. package/dropdown/types.js +0 -5
  127. package/file-input/FileInput.d.ts +0 -4
  128. package/file-input/FileInput.js +0 -479
  129. package/file-input/FileInput.stories.tsx +0 -618
  130. package/file-input/FileInput.test.js +0 -459
  131. package/file-input/FileItem.d.ts +0 -4
  132. package/file-input/FileItem.js +0 -135
  133. package/file-input/types.d.ts +0 -129
  134. package/file-input/types.js +0 -5
  135. package/flex/Flex.d.ts +0 -4
  136. package/flex/Flex.js +0 -57
  137. package/flex/Flex.stories.tsx +0 -112
  138. package/flex/types.d.ts +0 -97
  139. package/flex/types.js +0 -5
  140. package/footer/Footer.d.ts +0 -4
  141. package/footer/Footer.js +0 -134
  142. package/footer/Footer.stories.tsx +0 -152
  143. package/footer/Footer.test.js +0 -85
  144. package/footer/Icons.d.ts +0 -2
  145. package/footer/Icons.js +0 -72
  146. package/footer/types.d.ts +0 -58
  147. package/footer/types.js +0 -5
  148. package/grid/Grid.d.ts +0 -7
  149. package/grid/Grid.js +0 -76
  150. package/grid/Grid.stories.tsx +0 -219
  151. package/grid/types.d.ts +0 -115
  152. package/grid/types.js +0 -5
  153. package/header/Header.d.ts +0 -8
  154. package/header/Header.js +0 -230
  155. package/header/Header.stories.tsx +0 -251
  156. package/header/Header.test.js +0 -66
  157. package/header/Icons.d.ts +0 -2
  158. package/header/Icons.js +0 -29
  159. package/header/types.d.ts +0 -33
  160. package/header/types.js +0 -5
  161. package/heading/Heading.d.ts +0 -4
  162. package/heading/Heading.js +0 -137
  163. package/heading/Heading.stories.tsx +0 -54
  164. package/heading/Heading.test.js +0 -169
  165. package/heading/types.d.ts +0 -33
  166. package/heading/types.js +0 -5
  167. package/image/Image.d.ts +0 -4
  168. package/image/Image.js +0 -70
  169. package/image/Image.stories.tsx +0 -127
  170. package/image/types.d.ts +0 -72
  171. package/image/types.js +0 -5
  172. package/inset/Inset.d.ts +0 -3
  173. package/inset/Inset.js +0 -43
  174. package/inset/Inset.stories.tsx +0 -230
  175. package/inset/types.d.ts +0 -37
  176. package/inset/types.js +0 -5
  177. package/layout/ApplicationLayout.d.ts +0 -20
  178. package/layout/ApplicationLayout.js +0 -134
  179. package/layout/ApplicationLayout.stories.tsx +0 -162
  180. package/layout/Icons.d.ts +0 -8
  181. package/layout/Icons.js +0 -58
  182. package/layout/SidenavContext.d.ts +0 -5
  183. package/layout/SidenavContext.js +0 -13
  184. package/layout/types.d.ts +0 -41
  185. package/layout/types.js +0 -5
  186. package/link/Link.d.ts +0 -4
  187. package/link/Link.js +0 -115
  188. package/link/Link.stories.tsx +0 -253
  189. package/link/Link.test.js +0 -63
  190. package/link/types.d.ts +0 -54
  191. package/link/types.js +0 -5
  192. package/main.d.ts +0 -47
  193. package/main.js +0 -343
  194. package/nav-tabs/NavTabs.d.ts +0 -8
  195. package/nav-tabs/NavTabs.js +0 -90
  196. package/nav-tabs/NavTabs.stories.tsx +0 -274
  197. package/nav-tabs/NavTabs.test.js +0 -75
  198. package/nav-tabs/Tab.d.ts +0 -4
  199. package/nav-tabs/Tab.js +0 -117
  200. package/nav-tabs/types.d.ts +0 -52
  201. package/nav-tabs/types.js +0 -5
  202. package/number-input/NumberInput.d.ts +0 -11
  203. package/number-input/NumberInput.js +0 -67
  204. package/number-input/NumberInput.stories.tsx +0 -131
  205. package/number-input/NumberInput.test.js +0 -830
  206. package/number-input/types.d.ts +0 -130
  207. package/number-input/types.js +0 -5
  208. package/paginator/Icons.d.ts +0 -5
  209. package/paginator/Icons.js +0 -40
  210. package/paginator/Paginator.d.ts +0 -4
  211. package/paginator/Paginator.js +0 -138
  212. package/paginator/Paginator.stories.tsx +0 -87
  213. package/paginator/Paginator.test.js +0 -335
  214. package/paginator/types.d.ts +0 -38
  215. package/paginator/types.js +0 -5
  216. package/paragraph/Paragraph.d.ts +0 -5
  217. package/paragraph/Paragraph.js +0 -27
  218. package/paragraph/Paragraph.stories.tsx +0 -27
  219. package/password-input/Icons.d.ts +0 -6
  220. package/password-input/Icons.js +0 -35
  221. package/password-input/PasswordInput.d.ts +0 -4
  222. package/password-input/PasswordInput.js +0 -97
  223. package/password-input/PasswordInput.stories.tsx +0 -100
  224. package/password-input/PasswordInput.test.js +0 -198
  225. package/password-input/types.d.ts +0 -111
  226. package/password-input/types.js +0 -5
  227. package/progress-bar/ProgressBar.d.ts +0 -4
  228. package/progress-bar/ProgressBar.js +0 -150
  229. package/progress-bar/ProgressBar.stories.tsx +0 -93
  230. package/progress-bar/ProgressBar.test.js +0 -93
  231. package/progress-bar/types.d.ts +0 -37
  232. package/progress-bar/types.js +0 -5
  233. package/quick-nav/QuickNav.d.ts +0 -4
  234. package/quick-nav/QuickNav.js +0 -94
  235. package/quick-nav/QuickNav.stories.tsx +0 -356
  236. package/quick-nav/types.d.ts +0 -21
  237. package/quick-nav/types.js +0 -5
  238. package/radio-group/Radio.d.ts +0 -4
  239. package/radio-group/Radio.js +0 -124
  240. package/radio-group/RadioGroup.d.ts +0 -4
  241. package/radio-group/RadioGroup.js +0 -235
  242. package/radio-group/RadioGroup.stories.tsx +0 -214
  243. package/radio-group/RadioGroup.test.js +0 -756
  244. package/radio-group/types.d.ts +0 -114
  245. package/radio-group/types.js +0 -5
  246. package/resultset-table/Icons.d.ts +0 -7
  247. package/resultset-table/Icons.js +0 -47
  248. package/resultset-table/ResultsetTable.d.ts +0 -4
  249. package/resultset-table/ResultsetTable.js +0 -159
  250. package/resultset-table/ResultsetTable.stories.tsx +0 -300
  251. package/resultset-table/ResultsetTable.test.js +0 -305
  252. package/resultset-table/types.d.ts +0 -67
  253. package/resultset-table/types.js +0 -5
  254. package/select/Icons.d.ts +0 -10
  255. package/select/Icons.js +0 -89
  256. package/select/Listbox.d.ts +0 -4
  257. package/select/Listbox.js +0 -143
  258. package/select/Option.d.ts +0 -4
  259. package/select/Option.js +0 -80
  260. package/select/Select.d.ts +0 -4
  261. package/select/Select.js +0 -582
  262. package/select/Select.stories.tsx +0 -971
  263. package/select/Select.test.js +0 -2334
  264. package/select/types.d.ts +0 -209
  265. package/select/types.js +0 -5
  266. package/sidenav/Icons.d.ts +0 -7
  267. package/sidenav/Icons.js +0 -47
  268. package/sidenav/Sidenav.d.ts +0 -10
  269. package/sidenav/Sidenav.js +0 -199
  270. package/sidenav/Sidenav.stories.tsx +0 -282
  271. package/sidenav/Sidenav.test.js +0 -37
  272. package/sidenav/types.d.ts +0 -76
  273. package/sidenav/types.js +0 -5
  274. package/slider/Slider.d.ts +0 -4
  275. package/slider/Slider.js +0 -294
  276. package/slider/Slider.test.js +0 -254
  277. package/slider/types.d.ts +0 -86
  278. package/slider/types.js +0 -5
  279. package/spinner/Spinner.d.ts +0 -4
  280. package/spinner/Spinner.js +0 -214
  281. package/spinner/Spinner.stories.tsx +0 -129
  282. package/spinner/Spinner.test.js +0 -55
  283. package/spinner/types.d.ts +0 -32
  284. package/spinner/types.js +0 -5
  285. package/switch/Switch.d.ts +0 -4
  286. package/switch/Switch.js +0 -219
  287. package/switch/Switch.stories.tsx +0 -137
  288. package/switch/Switch.test.js +0 -180
  289. package/switch/types.d.ts +0 -66
  290. package/switch/types.js +0 -5
  291. package/table/Table.d.ts +0 -4
  292. package/table/Table.js +0 -99
  293. package/table/Table.stories.tsx +0 -356
  294. package/table/Table.test.js +0 -21
  295. package/table/types.d.ts +0 -21
  296. package/table/types.js +0 -5
  297. package/tabs/Tab.d.ts +0 -4
  298. package/tabs/Tab.js +0 -113
  299. package/tabs/Tabs.d.ts +0 -4
  300. package/tabs/Tabs.js +0 -385
  301. package/tabs/Tabs.stories.tsx +0 -226
  302. package/tabs/Tabs.test.js +0 -294
  303. package/tabs/types.d.ts +0 -92
  304. package/tabs/types.js +0 -5
  305. package/tag/Tag.d.ts +0 -4
  306. package/tag/Tag.js +0 -151
  307. package/tag/Tag.stories.tsx +0 -155
  308. package/tag/Tag.test.js +0 -49
  309. package/tag/types.d.ts +0 -69
  310. package/tag/types.js +0 -5
  311. package/text-input/Icons.d.ts +0 -8
  312. package/text-input/Icons.js +0 -56
  313. package/text-input/Suggestion.d.ts +0 -4
  314. package/text-input/Suggestion.js +0 -67
  315. package/text-input/Suggestions.d.ts +0 -4
  316. package/text-input/Suggestions.js +0 -89
  317. package/text-input/TextInput.d.ts +0 -4
  318. package/text-input/TextInput.js +0 -592
  319. package/text-input/TextInput.stories.tsx +0 -465
  320. package/text-input/TextInput.test.js +0 -1739
  321. package/text-input/types.d.ts +0 -205
  322. package/text-input/types.js +0 -5
  323. package/textarea/Textarea.d.ts +0 -4
  324. package/textarea/Textarea.js +0 -240
  325. package/textarea/Textarea.stories.tsx +0 -175
  326. package/textarea/Textarea.test.js +0 -406
  327. package/textarea/types.d.ts +0 -141
  328. package/textarea/types.js +0 -5
  329. package/toggle-group/ToggleGroup.d.ts +0 -4
  330. package/toggle-group/ToggleGroup.js +0 -204
  331. package/toggle-group/ToggleGroup.stories.tsx +0 -218
  332. package/toggle-group/ToggleGroup.test.js +0 -137
  333. package/toggle-group/types.d.ts +0 -114
  334. package/toggle-group/types.js +0 -5
  335. package/typography/Typography.d.ts +0 -4
  336. package/typography/Typography.js +0 -23
  337. package/typography/Typography.stories.tsx +0 -198
  338. package/typography/types.d.ts +0 -18
  339. package/typography/types.js +0 -5
  340. package/useTheme.d.ts +0 -1252
  341. package/useTheme.js +0 -15
  342. package/useTranslatedLabels.d.ts +0 -85
  343. package/useTranslatedLabels.js +0 -14
  344. package/utils/BaseTypography.d.ts +0 -21
  345. package/utils/BaseTypography.js +0 -94
  346. package/utils/FocusLock.d.ts +0 -13
  347. package/utils/FocusLock.js +0 -121
  348. package/wizard/Wizard.d.ts +0 -4
  349. package/wizard/Wizard.js +0 -250
  350. package/wizard/Wizard.stories.tsx +0 -253
  351. package/wizard/Wizard.test.js +0 -114
  352. package/wizard/types.d.ts +0 -64
  353. package/wizard/types.js +0 -5
@@ -1,205 +0,0 @@
1
- /// <reference types="react" />
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
- type SVG = React.ReactNode & React.SVGProps<SVGSVGElement>;
10
- type Action = {
11
- /**
12
- * This function will be called when the user clicks the action.
13
- */
14
- onClick: () => void;
15
- /**
16
- * Icon to be placed in the action..
17
- */
18
- icon: string | SVG;
19
- /**
20
- * Text representing advisory information related
21
- * to the button's action. Under the hood, this prop also serves
22
- * as an accessible label for the component.
23
- */
24
- title?: string;
25
- };
26
- type Props = {
27
- /**
28
- * Text to be placed above the input. This label will be used as the aria-label attribute of the list of suggestions.
29
- */
30
- label?: string;
31
- /**
32
- * Name attribute of the input element.
33
- */
34
- name?: string;
35
- /**
36
- * Initial value of the input, only when it is uncontrolled.
37
- */
38
- defaultValue?: string;
39
- /**
40
- * Value of the input. If undefined, the component will be uncontrolled and the value will be managed internally by the component.
41
- */
42
- value?: string;
43
- /**
44
- * Helper text to be placed above the input.
45
- */
46
- helperText?: string;
47
- /**
48
- * Text to be put as placeholder of the input.
49
- */
50
- placeholder?: string;
51
- /**
52
- * Action to be shown in the input.
53
- */
54
- action?: Action;
55
- /**
56
- * If true, the input will have an action to clear the entered value.
57
- */
58
- clearable?: boolean;
59
- /**
60
- * If true, the component will be disabled.
61
- */
62
- disabled?: boolean;
63
- /**
64
- * If true, the component will not be mutable, meaning the user can not edit the control.
65
- * In addition, the clear action will not be displayed even if the flag is set to true
66
- * and the custom action will not execute its onClick event.
67
- */
68
- readOnly?: boolean;
69
- /**
70
- * If true, the input will be optional, showing '(Optional)'
71
- * next to the label. Otherwise, the field will be considered required and an error will be
72
- * passed as a parameter to the OnBlur and onChange functions when it has
73
- * not been filled.
74
- */
75
- optional?: boolean;
76
- /**
77
- * Prefix to be placed before the input value.
78
- */
79
- prefix?: string;
80
- /**
81
- * Suffix to be placed after the input value.
82
- */
83
- suffix?: string;
84
- /**
85
- * This function will be called when the user types within the input
86
- * element of the component. An object including the current value and
87
- * the error (if the value entered is not valid) will be passed to this
88
- * function. If there is no error, error will not be defined.
89
- */
90
- onChange?: (val: {
91
- value: string;
92
- error?: string;
93
- }) => void;
94
- /**
95
- * This function will be called when the input element loses the focus.
96
- * An object including the input value and the error (if the value
97
- * entered is not valid) will be passed to this function. If there is no error,
98
- * error will not be defined.
99
- */
100
- onBlur?: (val: {
101
- value: string;
102
- error?: string;
103
- }) => void;
104
- /**
105
- * If it is a defined value and also a truthy string, the component will
106
- * change its appearance, showing the error below the input component. If
107
- * the defined value is an empty string, it will reserve a space below
108
- * the component for a future error, but it would not change its look. In
109
- * case of being undefined or null, both the appearance and the space for
110
- * the error message would not be modified.
111
- */
112
- error?: string;
113
- /**
114
- * These are the options to be displayed as suggestions. It can be either an array or a function:
115
- * - Array: Array of options that will be filtered by the component.
116
- * - Function: This function will be called when the user changes the value.
117
- * It will receive the new value as a parameter and should return a promise
118
- * that resolves to an array with the filtered options.
119
- */
120
- suggestions?: string[] | ((value: string) => Promise<string[]>);
121
- /**
122
- * Regular expression that defines the valid format allowed by the input.
123
- * This will be checked both when the input element loses the focus and
124
- * while typing within it. If the string entered does not match the
125
- * pattern, the onBlur and onChange functions will be called with the
126
- * current value and an internal error informing that this value does not
127
- * match the pattern. If the pattern is met, the error parameter of both
128
- * events will not be defined.
129
- */
130
- pattern?: string;
131
- /**
132
- * Specifies the minimum length allowed by the input.
133
- * This will be checked both when the input element loses the
134
- * focus and while typing within it. If the string entered does not
135
- * comply the minimum length, the onBlur and onChange functions will be called
136
- * with the current value and an internal error informing that the value
137
- * length does not comply the specified range. If a valid length is
138
- * reached, the error parameter of both events will not be defined.
139
- */
140
- minLength?: number;
141
- /**
142
- * Specifies the maximum length allowed by the input.
143
- * This will be checked both when the input element loses the
144
- * focus and while typing within it. If the string entered does not
145
- * comply the maximum length, the onBlur and onChange functions will be called
146
- * with the current value and an internal error informing that the value
147
- * length does not comply the specified range. If a valid length is
148
- * reached, the error parameter of both events will not be defined.
149
- */
150
- maxLength?: number;
151
- /**
152
- * HTML autocomplete attribute. Lets the user specify if any permission the user agent has to provide automated assistance in filling out the input value.
153
- * Its value must be one of all the possible values of the HTML autocomplete attribute: 'on', 'off', 'email', 'username', 'new-password', ...
154
- */
155
- autocomplete?: string;
156
- /**
157
- * Size of the margin to be applied to the component ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
158
- * You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different margin sizes.
159
- */
160
- margin?: Space | Margin;
161
- /**
162
- * Size of the component.
163
- */
164
- size?: "small" | "medium" | "large" | "fillParent";
165
- /**
166
- * Value of the tabindex attribute.
167
- */
168
- tabIndex?: number;
169
- };
170
- /**
171
- * List of suggestions of an Text Input component.
172
- */
173
- export type SuggestionsProps = {
174
- id: string;
175
- value: string;
176
- suggestions: string[];
177
- visualFocusIndex: number;
178
- highlightedSuggestions: boolean;
179
- searchHasErrors: boolean;
180
- isSearching: boolean;
181
- suggestionOnClick: (suggestion: string) => void;
182
- styles: React.CSSProperties;
183
- };
184
- /**
185
- * Reference to the component.
186
- */
187
- export type RefType = HTMLDivElement;
188
- /**
189
- * Single suggestion of an Text Input component.
190
- */
191
- export type SuggestionProps = {
192
- id: string;
193
- value: string;
194
- onClick: (suggestion: string) => void;
195
- suggestion: string;
196
- isLast: boolean;
197
- visuallyFocused: boolean;
198
- highlighted: boolean;
199
- };
200
- export type AutosuggestWrapperProps = {
201
- condition: boolean;
202
- wrapper: (children: React.ReactNode) => JSX.Element;
203
- children: React.ReactNode;
204
- };
205
- export default Props;
@@ -1,5 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
@@ -1,4 +0,0 @@
1
- import React from "react";
2
- import TextareaPropsType from "./types";
3
- declare const DxcTextarea: React.ForwardRefExoticComponent<TextareaPropsType & React.RefAttributes<HTMLDivElement>>;
4
- export default DxcTextarea;
@@ -1,240 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- var _typeof3 = require("@babel/runtime/helpers/typeof");
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports["default"] = void 0;
9
- var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
10
- var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
11
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
12
- var _react = _interopRequireWildcard(require("react"));
13
- var _styledComponents = _interopRequireWildcard(require("styled-components"));
14
- var _utils = require("../common/utils");
15
- var _useTheme = _interopRequireDefault(require("../useTheme"));
16
- var _useTranslatedLabels = _interopRequireDefault(require("../useTranslatedLabels"));
17
- var _variables = require("../common/variables");
18
- var _uuid = require("uuid");
19
- var _BackgroundColorContext = _interopRequireDefault(require("../BackgroundColorContext"));
20
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
21
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
22
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof3(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
23
- var patternMatch = function patternMatch(pattern, value) {
24
- return new RegExp(pattern).test(value);
25
- };
26
- var DxcTextarea = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
27
- var label = _ref.label,
28
- _ref$name = _ref.name,
29
- name = _ref$name === void 0 ? "" : _ref$name,
30
- _ref$defaultValue = _ref.defaultValue,
31
- defaultValue = _ref$defaultValue === void 0 ? "" : _ref$defaultValue,
32
- value = _ref.value,
33
- helperText = _ref.helperText,
34
- _ref$placeholder = _ref.placeholder,
35
- placeholder = _ref$placeholder === void 0 ? "" : _ref$placeholder,
36
- _ref$disabled = _ref.disabled,
37
- disabled = _ref$disabled === void 0 ? false : _ref$disabled,
38
- _ref$readOnly = _ref.readOnly,
39
- readOnly = _ref$readOnly === void 0 ? false : _ref$readOnly,
40
- _ref$optional = _ref.optional,
41
- optional = _ref$optional === void 0 ? false : _ref$optional,
42
- _ref$verticalGrow = _ref.verticalGrow,
43
- verticalGrow = _ref$verticalGrow === void 0 ? "auto" : _ref$verticalGrow,
44
- _ref$rows = _ref.rows,
45
- rows = _ref$rows === void 0 ? 4 : _ref$rows,
46
- onChange = _ref.onChange,
47
- onBlur = _ref.onBlur,
48
- error = _ref.error,
49
- pattern = _ref.pattern,
50
- minLength = _ref.minLength,
51
- maxLength = _ref.maxLength,
52
- _ref$autocomplete = _ref.autocomplete,
53
- autocomplete = _ref$autocomplete === void 0 ? "off" : _ref$autocomplete,
54
- margin = _ref.margin,
55
- _ref$size = _ref.size,
56
- size = _ref$size === void 0 ? "medium" : _ref$size,
57
- _ref$tabIndex = _ref.tabIndex,
58
- tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex;
59
- var _useState = (0, _react.useState)(defaultValue),
60
- _useState2 = (0, _slicedToArray2["default"])(_useState, 2),
61
- innerValue = _useState2[0],
62
- setInnerValue = _useState2[1];
63
- var _useState3 = (0, _react.useState)("textarea-".concat((0, _uuid.v4)())),
64
- _useState4 = (0, _slicedToArray2["default"])(_useState3, 1),
65
- textareaId = _useState4[0];
66
- var colorsTheme = (0, _useTheme["default"])();
67
- var backgroundType = (0, _react.useContext)(_BackgroundColorContext["default"]);
68
- var translatedLabels = (0, _useTranslatedLabels["default"])();
69
- var textareaRef = (0, _react.useRef)(null);
70
- var errorId = "error-".concat(textareaId);
71
- var isNotOptional = function isNotOptional(value) {
72
- return value === "" && !optional;
73
- };
74
- var isLengthIncorrect = function isLengthIncorrect(value) {
75
- return value !== "" && minLength && maxLength && (value.length < minLength || value.length > maxLength);
76
- };
77
- var changeValue = function changeValue(newValue) {
78
- value !== null && value !== void 0 ? value : setInnerValue(newValue);
79
- if (isNotOptional(newValue)) onChange === null || onChange === void 0 ? void 0 : onChange({
80
- value: newValue,
81
- error: translatedLabels.formFields.requiredValueErrorMessage
82
- });else if (isLengthIncorrect(newValue)) onChange === null || onChange === void 0 ? void 0 : onChange({
83
- value: newValue,
84
- error: translatedLabels.formFields.lengthErrorMessage(minLength, maxLength)
85
- });else if (newValue && pattern && !patternMatch(pattern, newValue)) onChange === null || onChange === void 0 ? void 0 : onChange({
86
- value: newValue,
87
- error: translatedLabels.formFields.formatRequestedErrorMessage
88
- });else onChange === null || onChange === void 0 ? void 0 : onChange({
89
- value: newValue
90
- });
91
- };
92
- var autoVerticalGrow = function autoVerticalGrow() {
93
- var textareaLineHeight = parseInt(window.getComputedStyle(textareaRef.current)["line-height"]);
94
- var textareaPaddingTopBottom = parseInt(window.getComputedStyle(textareaRef.current)["padding-top"]) * 2;
95
- textareaRef.current.style.height = "".concat(textareaLineHeight * rows, "px");
96
- var newHeight = textareaRef.current.scrollHeight - textareaPaddingTopBottom;
97
- textareaRef.current.style.height = "".concat(newHeight, "px");
98
- };
99
- var handleOnBlur = function handleOnBlur(event) {
100
- if (isNotOptional(event.target.value)) onBlur === null || onBlur === void 0 ? void 0 : onBlur({
101
- value: event.target.value,
102
- error: translatedLabels.formFields.requiredValueErrorMessage
103
- });else if (isLengthIncorrect(event.target.value)) onBlur === null || onBlur === void 0 ? void 0 : onBlur({
104
- value: event.target.value,
105
- error: translatedLabels.formFields.lengthErrorMessage(minLength, maxLength)
106
- });else if (event.target.value && pattern && !patternMatch(pattern, event.target.value)) onBlur === null || onBlur === void 0 ? void 0 : onBlur({
107
- value: event.target.value,
108
- error: translatedLabels.formFields.formatRequestedErrorMessage
109
- });else onBlur === null || onBlur === void 0 ? void 0 : onBlur({
110
- value: event.target.value
111
- });
112
- };
113
- var handleOnChange = function handleOnChange(event) {
114
- changeValue(event.target.value);
115
- verticalGrow === "auto" && autoVerticalGrow();
116
- };
117
- return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
118
- theme: colorsTheme.textarea
119
- }, /*#__PURE__*/_react["default"].createElement(TextareaContainer, {
120
- margin: margin,
121
- size: size,
122
- ref: ref
123
- }, label && /*#__PURE__*/_react["default"].createElement(Label, {
124
- htmlFor: textareaId,
125
- disabled: disabled,
126
- backgroundType: backgroundType,
127
- helperText: helperText
128
- }, label, " ", optional && /*#__PURE__*/_react["default"].createElement(OptionalLabel, null, translatedLabels.formFields.optionalLabel)), helperText && /*#__PURE__*/_react["default"].createElement(HelperText, {
129
- disabled: disabled,
130
- backgroundType: backgroundType
131
- }, helperText), /*#__PURE__*/_react["default"].createElement(Textarea, {
132
- id: textareaId,
133
- name: name,
134
- value: value !== null && value !== void 0 ? value : innerValue,
135
- placeholder: placeholder,
136
- verticalGrow: verticalGrow,
137
- rows: rows,
138
- onChange: handleOnChange,
139
- onBlur: handleOnBlur,
140
- disabled: disabled,
141
- readOnly: readOnly,
142
- error: error,
143
- minLength: minLength,
144
- maxLength: maxLength,
145
- autoComplete: autocomplete,
146
- backgroundType: backgroundType,
147
- ref: textareaRef,
148
- tabIndex: tabIndex,
149
- "aria-invalid": error ? true : false,
150
- "aria-errormessage": error ? errorId : undefined,
151
- "aria-required": !disabled && !optional
152
- }), !disabled && typeof error === "string" && /*#__PURE__*/_react["default"].createElement(Error, {
153
- id: errorId,
154
- backgroundType: backgroundType,
155
- "aria-live": error ? "assertive" : "off"
156
- }, error)));
157
- });
158
- var sizes = {
159
- small: "240px",
160
- medium: "360px",
161
- large: "480px",
162
- fillParent: "100%"
163
- };
164
- var calculateWidth = function calculateWidth(margin, size) {
165
- return size === "fillParent" ? "calc(".concat(sizes[size], " - ").concat((0, _utils.getMargin)(margin, "left"), " - ").concat((0, _utils.getMargin)(margin, "right"), ")") : sizes[size];
166
- };
167
- var TextareaContainer = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: column;\n width: ", ";\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n"])), function (props) {
168
- return calculateWidth(props.margin, props.size);
169
- }, function (props) {
170
- return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
171
- }, function (props) {
172
- return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.top ? _variables.spaces[props.margin.top] : "";
173
- }, function (props) {
174
- return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.right ? _variables.spaces[props.margin.right] : "";
175
- }, function (props) {
176
- return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.bottom ? _variables.spaces[props.margin.bottom] : "";
177
- }, function (props) {
178
- return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
179
- });
180
- 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) {
181
- return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledLabelFontColorOnDark : props.theme.disabledLabelFontColor : props.backgroundType === "dark" ? props.theme.labelFontColorOnDark : props.theme.labelFontColor;
182
- }, function (props) {
183
- return props.theme.fontFamily;
184
- }, function (props) {
185
- return props.theme.labelFontSize;
186
- }, function (props) {
187
- return props.theme.labelFontStyle;
188
- }, function (props) {
189
- return props.theme.labelFontWeight;
190
- }, function (props) {
191
- return props.theme.labelLineHeight;
192
- }, function (props) {
193
- return !props.helperText && "margin-bottom: 0.25rem";
194
- });
195
- var OptionalLabel = _styledComponents["default"].span(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n font-weight: ", ";\n"])), function (props) {
196
- return props.theme.optionalLabelFontWeight;
197
- });
198
- 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) {
199
- return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledHelperTextFontColorOnDark : props.theme.disabledHelperTextFontColor : props.backgroundType === "dark" ? props.theme.helperTextFontColorOnDark : props.theme.helperTextFontColor;
200
- }, function (props) {
201
- return props.theme.fontFamily;
202
- }, function (props) {
203
- return props.theme.helperTextFontSize;
204
- }, function (props) {
205
- return props.theme.helperTextFontStyle;
206
- }, function (props) {
207
- return props.theme.helperTextFontWeight;
208
- }, function (props) {
209
- return props.theme.helperTextLineHeight;
210
- });
211
- var Textarea = _styledComponents["default"].textarea(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n ", ";\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 (_ref2) {
212
- var verticalGrow = _ref2.verticalGrow;
213
- if (verticalGrow === "none") return "resize: none;";else if (verticalGrow === "auto") return "resize: none; overflow: hidden;";else if (verticalGrow === "manual") return "resize: vertical;";else return "resize: none;";
214
- }, function (props) {
215
- if (props.disabled) return props.backgroundType === "dark" ? "background-color: ".concat(props.theme.disabledContainerFillColorOnDark, ";") : "background-color: ".concat(props.theme.disabledContainerFillColor, ";");else return "background-color: transparent;";
216
- }, function (props) {
217
- if (props.disabled) return props.backgroundType === "dark" ? props.theme.disabledBorderColorOnDark : props.theme.disabledBorderColor;else if (props.error) return "transparent";else if (props.readOnly) return props.theme.readOnlyBorderColor;else return props.backgroundType === "dark" ? props.theme.enabledBorderColorOnDark : props.theme.enabledBorderColor;
218
- }, function (props) {
219
- return props.error && !props.disabled && "box-shadow: 0 0 0 2px ".concat(props.backgroundType === "dark" ? props.theme.errorBorderColorOnDark : props.theme.errorBorderColor, ";\n ");
220
- }, function (props) {
221
- return !props.disabled ? "&:hover {\n border-color: ".concat(props.error ? "transparent" : props.readOnly ? props.theme.hoverReadOnlyBorderColor : props.backgroundType === "dark" ? props.theme.hoverBorderColorOnDark : props.theme.hoverBorderColor, ";\n ").concat(props.error && "box-shadow: 0 0 0 2px ".concat(props.backgroundType === "dark" ? props.theme.hoverErrorBorderColorOnDark : props.theme.hoverErrorBorderColor, ";"), "\n }\n &:focus, &:focus-within {\n outline: none;\n border-color: transparent;\n box-shadow: 0 0 0 2px ").concat(props.backgroundType === "dark" ? props.theme.focusBorderColorOnDark : props.theme.focusBorderColor, ";\n }") : "cursor: not-allowed;";
222
- }, function (props) {
223
- return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledValueFontColorOnDark : props.theme.disabledValueFontColor : props.backgroundType === "dark" ? props.theme.valueFontColorOnDark : props.theme.valueFontColor;
224
- }, function (props) {
225
- return props.theme.fontFamily;
226
- }, function (props) {
227
- return props.theme.valueFontSize;
228
- }, function (props) {
229
- return props.theme.valueFontStyle;
230
- }, function (props) {
231
- return props.theme.valueFontWeight;
232
- }, function (props) {
233
- return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledPlaceholderFontColorOnDark : props.theme.disabledPlaceholderFontColor : props.backgroundType === "dark" ? props.theme.placeholderFontColorOnDark : props.theme.placeholderFontColor;
234
- });
235
- var Error = _styledComponents["default"].span(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n font-family: ", ";\n font-size: 0.75rem;\n font-weight: 400;\n min-height: 1.5em;\n line-height: 1.5em;\n margin-top: 0.25rem;\n"])), function (props) {
236
- return props.backgroundType === "dark" ? props.theme.errorMessageColorOnDark : props.theme.errorMessageColor;
237
- }, function (props) {
238
- return props.theme.fontFamily;
239
- });
240
- var _default = exports["default"] = DxcTextarea;
@@ -1,175 +0,0 @@
1
- import React from "react";
2
- import DxcTextarea from "./Textarea";
3
- import Title from "../../.storybook/components/Title";
4
- import ExampleContainer from "../../.storybook/components/ExampleContainer";
5
- import { BackgroundColorProvider } from "../BackgroundColorContext";
6
- import { HalstackProvider } from "../HalstackContext";
7
-
8
- export default {
9
- title: "Textarea",
10
- component: DxcTextarea,
11
- };
12
-
13
- const opinionatedTheme = {
14
- textarea: {
15
- fontColor: "#000000",
16
- hoverBorderColor: "#a46ede",
17
- },
18
- };
19
-
20
- export const Chromatic = () => (
21
- <>
22
- <ExampleContainer pseudoState="pseudo-hover">
23
- <Title title="Hovered" theme="light" level={4} />
24
- <DxcTextarea label="Hovered" />
25
- </ExampleContainer>
26
- <ExampleContainer pseudoState="pseudo-focus">
27
- <Title title="Focused" theme="light" level={4} />
28
- <DxcTextarea label="Focused" />
29
- </ExampleContainer>
30
- <ExampleContainer>
31
- <Title title="Disabled" theme="light" level={4} />
32
- <DxcTextarea label="Disabled" optional helperText="Sample text" placeholder="Enter your text here..." disabled />
33
- </ExampleContainer>
34
- <ExampleContainer>
35
- <Title title="Disabled with value" theme="light" level={4} />
36
- <DxcTextarea label="Disabled" defaultValue="Example text" disabled />
37
- </ExampleContainer>
38
- <ExampleContainer>
39
- <Title title="Read only" theme="light" level={4} />
40
- <DxcTextarea label="Label" readOnly defaultValue="Example text" verticalGrow="manual" />
41
- </ExampleContainer>
42
- <ExampleContainer pseudoState="pseudo-hover">
43
- <Title title="Hovered read only" theme="light" level={4} />
44
- <DxcTextarea label="Label" readOnly defaultValue="Example text" verticalGrow="manual" />
45
- </ExampleContainer>
46
- <ExampleContainer>
47
- <Title title="With error" theme="light" level={4} />
48
- <DxcTextarea
49
- label="Textarea with error"
50
- helperText="Helper text"
51
- placeholder="Enter your text here..."
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."
62
- />
63
- </ExampleContainer>
64
- <ExampleContainer>
65
- <Title title="Helper text and optional with value" theme="light" level={4} />
66
- <DxcTextarea label="Helper & optional" defaultValue="Some text" helperText="Sample text" optional />
67
- </ExampleContainer>
68
- <ExampleContainer>
69
- <Title title="Resizable" theme="light" level={4} />
70
- <DxcTextarea label="With resizer" helperText="Helper text" verticalGrow="manual" />
71
- </ExampleContainer>
72
- <ExampleContainer>
73
- <Title title="Grow manual" theme="light" level={4} />
74
- <DxcTextarea
75
- label="Manual vertical grow"
76
- verticalGrow="manual"
77
- defaultValue="Long textttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt"
78
- />
79
- </ExampleContainer>
80
- <Title title="Sizes" theme="light" level={2} />
81
- <ExampleContainer>
82
- <DxcTextarea label="Small" size="small" />
83
- </ExampleContainer>
84
- <ExampleContainer>
85
- <DxcTextarea label="Medium" size="medium" />
86
- </ExampleContainer>
87
- <ExampleContainer>
88
- <DxcTextarea label="Large" size="large" />
89
- </ExampleContainer>
90
- <ExampleContainer>
91
- <DxcTextarea label="Fill parent" size="fillParent" />
92
- </ExampleContainer>
93
- <Title title="Margins" theme="light" level={2} />
94
- <ExampleContainer>
95
- <Title title="Xxsmall margin" theme="light" level={4} />
96
- <DxcTextarea label="Xxsmall" margin="xxsmall" />
97
- </ExampleContainer>
98
- <ExampleContainer>
99
- <Title title="Xsmall margin" theme="light" level={4} />
100
- <DxcTextarea label="xsmall" margin="xsmall" />
101
- </ExampleContainer>
102
- <ExampleContainer>
103
- <Title title="Small margin" theme="light" level={4} />
104
- <DxcTextarea label="small" margin="small" />
105
- </ExampleContainer>
106
- <ExampleContainer>
107
- <Title title="Medium margin" theme="light" level={4} />
108
- <DxcTextarea label="medium" margin="medium" />
109
- </ExampleContainer>
110
- <ExampleContainer>
111
- <Title title="Large margin" theme="light" level={4} />
112
- <DxcTextarea label="Large" margin="large" />
113
- </ExampleContainer>
114
- <ExampleContainer>
115
- <Title title="Xlarge margin" theme="light" level={4} />
116
- <DxcTextarea label="Xlarge" margin="xlarge" />
117
- </ExampleContainer>
118
- <ExampleContainer>
119
- <Title title="Xxlarge margin" theme="light" level={4} />
120
- <DxcTextarea label="Xxlarge" margin="xxlarge" />
121
- </ExampleContainer>
122
- <Title title="Opinionated theme" theme="light" level={2} />
123
- <ExampleContainer pseudoState="pseudo-hover">
124
- <Title title="Hovered" theme="light" level={4} />
125
- <HalstackProvider theme={opinionatedTheme}>
126
- <DxcTextarea label="Hovered" helperText="Sample text" placeholder="Placeholder" />
127
- </HalstackProvider>
128
- </ExampleContainer>
129
- <ExampleContainer pseudoState="pseudo-focus">
130
- <Title title="Focused" theme="light" level={4} />
131
- <HalstackProvider theme={opinionatedTheme}>
132
- <DxcTextarea label="Focused" helperText="Sample text" />
133
- </HalstackProvider>
134
- </ExampleContainer>
135
- <ExampleContainer>
136
- <Title title="Disabled" theme="light" level={4} />
137
- <HalstackProvider theme={opinionatedTheme}>
138
- <DxcTextarea
139
- label="Disabled"
140
- optional
141
- helperText="Sample text"
142
- placeholder="Enter your text here..."
143
- disabled
144
- />
145
- </HalstackProvider>
146
- </ExampleContainer>
147
- <ExampleContainer>
148
- <Title title="Disabled with value" theme="light" level={4} />
149
- <HalstackProvider theme={opinionatedTheme}>
150
- <DxcTextarea label="Disabled" helperText="Sample text" defaultValue="Example text" disabled />
151
- </HalstackProvider>
152
- </ExampleContainer>
153
- <ExampleContainer>
154
- <Title title="With error" theme="light" level={4} />
155
- <HalstackProvider theme={opinionatedTheme}>
156
- <DxcTextarea
157
- label="Textarea with error"
158
- helperText="Helper text"
159
- placeholder="Enter your text here..."
160
- error="Error message."
161
- />
162
- </HalstackProvider>
163
- </ExampleContainer>
164
- <ExampleContainer>
165
- <Title title="Grow manual" theme="light" level={4} />{" "}
166
- <HalstackProvider theme={opinionatedTheme}>
167
- <DxcTextarea
168
- label="Manual vertical grow"
169
- verticalGrow="manual"
170
- defaultValue="Long textttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt"
171
- />
172
- </HalstackProvider>
173
- </ExampleContainer>
174
- </>
175
- );