@dxc-technology/halstack-react 0.0.0-d238e47 → 0.0.0-d30020b

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 (161) hide show
  1. package/BackgroundColorContext.d.ts +10 -0
  2. package/BackgroundColorContext.js +1 -4
  3. package/ThemeContext.d.ts +15 -0
  4. package/ThemeContext.js +5 -8
  5. package/V3Select/V3Select.js +2 -2
  6. package/V3Textarea/V3Textarea.js +2 -2
  7. package/accordion/Accordion.d.ts +1 -1
  8. package/accordion/Accordion.js +11 -22
  9. package/accordion/Accordion.stories.tsx +307 -0
  10. package/accordion/types.d.ts +4 -8
  11. package/accordion-group/AccordionGroup.js +2 -2
  12. package/accordion-group/AccordionGroup.stories.tsx +225 -0
  13. package/accordion-group/types.d.ts +4 -8
  14. package/alert/Alert.js +2 -2
  15. package/badge/Badge.js +1 -1
  16. package/bleed/Bleed.d.ts +3 -0
  17. package/bleed/Bleed.js +84 -0
  18. package/bleed/Bleed.stories.tsx +342 -0
  19. package/bleed/types.d.ts +13 -0
  20. package/bleed/types.js +5 -0
  21. package/box/Box.js +2 -2
  22. package/button/Button.d.ts +1 -1
  23. package/button/Button.js +9 -17
  24. package/button/Button.stories.tsx +6 -8
  25. package/button/types.d.ts +3 -7
  26. package/card/Card.js +1 -1
  27. package/card/Card.stories.tsx +1 -1
  28. package/checkbox/Checkbox.js +2 -2
  29. package/checkbox/types.d.ts +1 -1
  30. package/chip/Chip.d.ts +4 -0
  31. package/chip/Chip.js +16 -76
  32. package/chip/Chip.stories.tsx +6 -8
  33. package/chip/types.d.ts +45 -0
  34. package/chip/types.js +5 -0
  35. package/common/variables.js +57 -23
  36. package/date/Date.js +1 -1
  37. package/date-input/DateInput.js +10 -13
  38. package/dialog/Dialog.js +4 -3
  39. package/dropdown/Dropdown.d.ts +1 -1
  40. package/dropdown/Dropdown.js +13 -35
  41. package/dropdown/Dropdown.stories.tsx +249 -0
  42. package/dropdown/types.d.ts +6 -15
  43. package/file-input/FileInput.d.ts +1 -1
  44. package/file-input/FileInput.js +160 -81
  45. package/file-input/FileInput.stories.tsx +507 -0
  46. package/file-input/FileItem.js +8 -6
  47. package/file-input/types.d.ts +32 -7
  48. package/footer/Footer.d.ts +1 -1
  49. package/footer/Footer.js +28 -36
  50. package/footer/{Footer.stories.jsx → Footer.stories.tsx} +1 -22
  51. package/footer/Icons.d.ts +2 -0
  52. package/footer/Icons.js +3 -3
  53. package/footer/types.d.ts +21 -17
  54. package/header/Header.js +2 -2
  55. package/header/Icons.d.ts +2 -0
  56. package/heading/Heading.js +1 -1
  57. package/heading/Heading.stories.tsx +3 -2
  58. package/input-text/InputText.js +2 -2
  59. package/inset/Inset.d.ts +3 -0
  60. package/inset/Inset.js +84 -0
  61. package/inset/Inset.stories.tsx +229 -0
  62. package/inset/types.d.ts +13 -0
  63. package/inset/types.js +5 -0
  64. package/layout/ApplicationLayout.d.ts +10 -0
  65. package/layout/ApplicationLayout.js +17 -21
  66. package/layout/ApplicationLayout.stories.tsx +171 -0
  67. package/layout/types.d.ts +57 -0
  68. package/layout/types.js +5 -0
  69. package/link/Link.js +8 -16
  70. package/link/Link.stories.tsx +6 -1
  71. package/link/types.d.ts +5 -9
  72. package/list/List.d.ts +4 -0
  73. package/list/List.js +47 -0
  74. package/list/List.stories.tsx +95 -0
  75. package/list/types.d.ts +7 -0
  76. package/list/types.js +5 -0
  77. package/main.d.ts +8 -3
  78. package/main.js +42 -2
  79. package/number-input/NumberInput.js +3 -6
  80. package/package.json +4 -2
  81. package/paginator/Paginator.js +2 -8
  82. package/password-input/PasswordInput.js +19 -18
  83. package/password-input/PasswordInput.stories.tsx +3 -3
  84. package/password-input/types.d.ts +13 -11
  85. package/progress-bar/ProgressBar.js +4 -4
  86. package/radio/Radio.js +2 -2
  87. package/radio-group/Radio.d.ts +4 -0
  88. package/radio-group/Radio.js +140 -0
  89. package/radio-group/RadioGroup.d.ts +4 -0
  90. package/radio-group/RadioGroup.js +273 -0
  91. package/radio-group/RadioGroup.stories.tsx +79 -0
  92. package/radio-group/RadioGroup.test.js +248 -0
  93. package/radio-group/types.d.ts +36 -0
  94. package/radio-group/types.js +5 -0
  95. package/resultsetTable/ResultsetTable.d.ts +1 -1
  96. package/resultsetTable/ResultsetTable.js +9 -4
  97. package/resultsetTable/ResultsetTable.stories.tsx +275 -0
  98. package/resultsetTable/types.d.ts +6 -2
  99. package/row/Row.d.ts +3 -0
  100. package/row/Row.js +127 -0
  101. package/row/Row.stories.tsx +237 -0
  102. package/row/types.d.ts +10 -0
  103. package/row/types.js +5 -0
  104. package/select/Select.d.ts +4 -0
  105. package/select/Select.js +20 -22
  106. package/select/types.d.ts +170 -0
  107. package/select/types.js +5 -0
  108. package/sidenav/Sidenav.js +2 -2
  109. package/sidenav/Sidenav.stories.tsx +18 -1
  110. package/slider/Slider.js +2 -2
  111. package/spinner/Spinner.js +2 -2
  112. package/spinner/Spinner.stories.jsx +1 -0
  113. package/stack/Stack.d.ts +3 -0
  114. package/stack/Stack.js +97 -0
  115. package/stack/Stack.stories.tsx +164 -0
  116. package/stack/types.d.ts +9 -0
  117. package/stack/types.js +5 -0
  118. package/switch/Switch.js +2 -2
  119. package/switch/Switch.stories.tsx +1 -1
  120. package/table/Table.js +2 -2
  121. package/table/Table.stories.jsx +2 -1
  122. package/tabs/Tabs.js +8 -8
  123. package/tabs/Tabs.stories.tsx +120 -0
  124. package/tabs/types.d.ts +23 -15
  125. package/tag/Tag.d.ts +1 -1
  126. package/tag/Tag.js +7 -12
  127. package/tag/Tag.stories.tsx +15 -22
  128. package/tag/types.d.ts +23 -14
  129. package/text/Text.d.ts +7 -0
  130. package/text/Text.js +30 -0
  131. package/text/Text.stories.tsx +19 -0
  132. package/text-input/TextInput.js +50 -41
  133. package/text-input/TextInput.stories.tsx +456 -0
  134. package/text-input/types.d.ts +14 -12
  135. package/textarea/Textarea.d.ts +4 -0
  136. package/textarea/Textarea.js +27 -60
  137. package/textarea/Textarea.stories.jsx +4 -3
  138. package/textarea/types.d.ts +130 -0
  139. package/textarea/types.js +5 -0
  140. package/toggle/Toggle.js +1 -1
  141. package/toggle-group/ToggleGroup.d.ts +4 -0
  142. package/toggle-group/ToggleGroup.js +16 -45
  143. package/toggle-group/ToggleGroup.stories.tsx +23 -28
  144. package/toggle-group/types.d.ts +97 -0
  145. package/toggle-group/types.js +5 -0
  146. package/upload/buttons-upload/ButtonsUpload.js +2 -2
  147. package/upload/dragAndDropArea/DragAndDropArea.js +2 -2
  148. package/upload/file-upload/FileToUpload.js +1 -1
  149. package/upload/files-upload/FilesToUpload.js +1 -1
  150. package/upload/transaction/Transaction.js +2 -2
  151. package/upload/transactions/Transactions.js +1 -1
  152. package/useTheme.d.ts +2 -0
  153. package/useTheme.js +1 -1
  154. package/wizard/Wizard.js +59 -9
  155. package/wizard/{Wizard.stories.jsx → Wizard.stories.tsx} +0 -0
  156. package/wizard/types.d.ts +3 -7
  157. package/chip/index.d.ts +0 -22
  158. package/select/index.d.ts +0 -131
  159. package/textarea/index.d.ts +0 -117
  160. package/toggle-group/index.d.ts +0 -21
  161. package/wizard/Icons.js +0 -65
@@ -0,0 +1,456 @@
1
+ import React from "react";
2
+ import { userEvent, within, waitFor } from "@storybook/testing-library";
3
+ import { fireEvent } from "@testing-library/react";
4
+ import { BackgroundColorProvider } from "../BackgroundColorContext";
5
+ import Title from "../../.storybook/components/Title";
6
+ import ExampleContainer from "../../.storybook/components/ExampleContainer";
7
+ import DarkContainer from "../../.storybook/components/DarkSection";
8
+ import DxcTextInput from "./TextInput";
9
+
10
+ export default {
11
+ title: "Text input",
12
+ component: DxcTextInput,
13
+ };
14
+
15
+ const action = {
16
+ onClick: () => {},
17
+ icon: (
18
+ <svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
19
+ <path d="M0 0h24v24H0V0z" fill="none" />
20
+ <path d="M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z" />
21
+ </svg>
22
+ ),
23
+ };
24
+
25
+ const actionLargeIcon = {
26
+ onClick: () => {},
27
+ icon: (
28
+ <svg xmlns="http://www.w3.org/2000/svg" height="48px" viewBox="0 0 24 24" width="48px" fill="currentColor">
29
+ <path d="M0 0h24v24H0V0z" fill="none" />
30
+ <path d="M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm.5-13H11v6l5.25 3.15.75-1.23-4.5-2.67z" />
31
+ </svg>
32
+ ),
33
+ };
34
+
35
+ const country = ["Afghanistan"];
36
+ const countries = [
37
+ "Afghanistan",
38
+ "Albania",
39
+ "Algeria",
40
+ "Andorra Andorra Andorra Andorra Andorra Andorra Andorra Andorra",
41
+ "Angola",
42
+ "Antigua and Barbuda Antigua and Barbuda Antigua and Barbuda",
43
+ "Bahamas",
44
+ "Bahrain",
45
+ "Bangladesh",
46
+ "Barbados",
47
+ "Cabo Verde",
48
+ "Cambodia",
49
+ "Cameroon",
50
+ "Canada",
51
+ "Cayman Islands, The",
52
+ "Central African Republic",
53
+ "Chad",
54
+ "Democratic Republic of the Congo",
55
+ "Dominican Republic",
56
+ "Dominica",
57
+ "Denmark",
58
+ "Djibouti",
59
+ ];
60
+
61
+ export const Chromatic = () => (
62
+ <>
63
+ <ExampleContainer pseudoState="pseudo-hover">
64
+ <Title title="Hovered input" theme="light" level={4} />
65
+ <DxcTextInput label="Text input" />
66
+ </ExampleContainer>
67
+ <ExampleContainer pseudoState="pseudo-focus-within">
68
+ <Title title="Focused input" theme="light" level={4} />
69
+ <DxcTextInput label="Text input" />
70
+ </ExampleContainer>
71
+ <ExampleContainer pseudoState="pseudo-hover">
72
+ <Title title="Hovered action" theme="light" level={4} />
73
+ <DxcTextInput label="Text input" value="Text" clearable />
74
+ </ExampleContainer>
75
+ <ExampleContainer>
76
+ <Title title="Without label" theme="light" level={4} />
77
+ <DxcTextInput />
78
+ </ExampleContainer>
79
+ <ExampleContainer>
80
+ <Title title="With label and placeholder" theme="light" level={4} />
81
+ <DxcTextInput label="Text input" placeholder="Placeholder" />
82
+ </ExampleContainer>
83
+ <ExampleContainer>
84
+ <Title title="Helper text, optional, and clearable" theme="light" level={4} />
85
+ <DxcTextInput label="Text input" clearable value="Text" helperText="Help message" optional />
86
+ </ExampleContainer>
87
+ <ExampleContainer>
88
+ <Title title="Clearable and large icon action" theme="light" level={4} />
89
+ <DxcTextInput
90
+ label="Text input"
91
+ value="Text text text text text text text text text text"
92
+ clearable
93
+ action={actionLargeIcon}
94
+ />
95
+ </ExampleContainer>
96
+ <ExampleContainer>
97
+ <Title title="Prefix" theme="light" level={4} />
98
+ <DxcTextInput label="With prefix" prefix="+34" />
99
+ </ExampleContainer>
100
+ <ExampleContainer>
101
+ <Title title="Suffix and action" theme="light" level={4} />
102
+ <DxcTextInput label="With suffix" suffix="USD" action={action} />
103
+ </ExampleContainer>
104
+ <ExampleContainer>
105
+ <Title title="Invalid" theme="light" level={4} />
106
+ <DxcTextInput
107
+ label="Error text input"
108
+ helperText="Help message"
109
+ error="Error message."
110
+ value="Text"
111
+ clearable
112
+ optional
113
+ action={action}
114
+ />
115
+ </ExampleContainer>
116
+ <ExampleContainer>
117
+ <Title title="Disabled and placeholder" theme="light" level={4} />
118
+ <DxcTextInput label="Disabled text input" disabled placeholder="Placeholder" />
119
+ </ExampleContainer>
120
+ <ExampleContainer>
121
+ <Title title="Disabled, helper text, optional, value and action" theme="light" level={4} />
122
+ <DxcTextInput
123
+ label="Disabled text input"
124
+ helperText="Help message"
125
+ disabled
126
+ optional
127
+ value="Text"
128
+ action={action}
129
+ />
130
+ </ExampleContainer>
131
+ <ExampleContainer>
132
+ <Title title="Disabled with prefix and suffix" theme="light" level={4} />
133
+ <DxcTextInput
134
+ label="Disabled text input"
135
+ helperText="Help message"
136
+ disabled
137
+ optional
138
+ prefix="+34"
139
+ suffix="USD"
140
+ value="Text"
141
+ action={action}
142
+ />
143
+ </ExampleContainer>
144
+ <BackgroundColorProvider color="#333333">
145
+ <DarkContainer>
146
+ <Title title="Dark" theme="dark" level={2} />
147
+ <ExampleContainer pseudoState="pseudo-hover">
148
+ <Title title="Hovered" theme="dark" level={4} />
149
+ <DxcTextInput label="Text input" />
150
+ </ExampleContainer>
151
+ <ExampleContainer pseudoState="pseudo-focus-within">
152
+ <Title title="Focused" theme="dark" level={4} />
153
+ <DxcTextInput label="Text input" />
154
+ </ExampleContainer>
155
+ <ExampleContainer pseudoState="pseudo-hover">
156
+ <Title title="Hovered action" theme="dark" level={4} />
157
+ <DxcTextInput label="Text input" value="Text" clearable />
158
+ </ExampleContainer>
159
+ <ExampleContainer>
160
+ <Title title="Helper text, placeholder, optional and action" theme="dark" level={4} />
161
+ <DxcTextInput
162
+ label="Text input"
163
+ helperText="Help message"
164
+ placeholder="Placeholder"
165
+ clearable
166
+ optional
167
+ action={action}
168
+ />
169
+ </ExampleContainer>
170
+ <ExampleContainer>
171
+ <Title title="Helper text, clearable value, error and action" theme="dark" level={4} />
172
+ <DxcTextInput
173
+ label="Text input"
174
+ helperText="Help message"
175
+ error="Error message."
176
+ value="Text"
177
+ clearable
178
+ action={action}
179
+ />
180
+ </ExampleContainer>
181
+ <ExampleContainer>
182
+ <Title title="Prefix and suffix" theme="dark" level={4} />
183
+ <DxcTextInput label="With prefix and suffix" prefix="+34" suffix="USD" />
184
+ </ExampleContainer>
185
+ <ExampleContainer>
186
+ <Title title="Disabled and placeholder" theme="dark" level={4} />
187
+ <DxcTextInput label="Disabled text input" disabled placeholder="Placeholder" />
188
+ </ExampleContainer>
189
+ <ExampleContainer>
190
+ <Title title="Disabled, helper text, optional, value and action" theme="dark" level={4} />
191
+ <DxcTextInput
192
+ label="Disabled text input"
193
+ helperText="Help message"
194
+ disabled
195
+ optional
196
+ value="Text"
197
+ action={action}
198
+ />
199
+ </ExampleContainer>
200
+ <ExampleContainer>
201
+ <Title title="Disabled with prefix and suffix" theme="dark" level={4} />
202
+ <DxcTextInput
203
+ label="Disabled text input"
204
+ helperText="Help message"
205
+ disabled
206
+ optional
207
+ prefix="+34"
208
+ suffix="USD"
209
+ value="Text"
210
+ action={action}
211
+ />
212
+ </ExampleContainer>
213
+ </DarkContainer>
214
+ </BackgroundColorProvider>
215
+ <Title title="Margins" theme="light" level={2} />
216
+ <ExampleContainer>
217
+ <Title title="Xxsmall margin" theme="light" level={4} />
218
+ <DxcTextInput label="Xxsmall" margin="xxsmall" />
219
+ </ExampleContainer>
220
+ <ExampleContainer>
221
+ <Title title="Xsmall margin" theme="light" level={4} />
222
+ <DxcTextInput label="Xsmall" margin="xsmall" />
223
+ </ExampleContainer>
224
+ <ExampleContainer>
225
+ <Title title="Small margin" theme="light" level={4} />
226
+ <DxcTextInput label="Small" margin="small" />
227
+ </ExampleContainer>
228
+ <ExampleContainer>
229
+ <Title title="Medium margin" theme="light" level={4} />
230
+ <DxcTextInput label="Medium" margin="medium" />
231
+ </ExampleContainer>
232
+ <ExampleContainer>
233
+ <Title title="Large margin" theme="light" level={4} />
234
+ <DxcTextInput label="Large" margin="large" />
235
+ </ExampleContainer>
236
+ <ExampleContainer>
237
+ <Title title="Xlarge margin" theme="light" level={4} />
238
+ <DxcTextInput label="Xlarge" margin="xlarge" />
239
+ </ExampleContainer>
240
+ <ExampleContainer>
241
+ <Title title="Xxlarge margin" theme="light" level={4} />
242
+ <DxcTextInput label="Xxlarge" margin="xxlarge" />
243
+ </ExampleContainer>
244
+ <Title title="Sizes" theme="light" level={2} />
245
+ <ExampleContainer>
246
+ <Title title="Small size" theme="light" level={4} />
247
+ <DxcTextInput label="Small" size="small" />
248
+ </ExampleContainer>
249
+ <ExampleContainer>
250
+ <Title title="Medium size" theme="light" level={4} />
251
+ <DxcTextInput label="Medium" size="medium" />
252
+ </ExampleContainer>
253
+ <ExampleContainer>
254
+ <Title title="Large size" theme="light" level={4} />
255
+ <DxcTextInput label="Large" size="large" />
256
+ </ExampleContainer>
257
+ <ExampleContainer>
258
+ <Title title="FillParent size" theme="light" level={4} />
259
+ <DxcTextInput label="FillParent" size="fillParent" />
260
+ </ExampleContainer>
261
+ </>
262
+ );
263
+
264
+ const FocusedActionTextInput = () => (
265
+ <ExampleContainer expanded>
266
+ <Title title="Focused action" theme="light" level={4} />
267
+ <DxcTextInput label="Text input" action={action} clearable />
268
+ </ExampleContainer>
269
+ );
270
+
271
+ const ActivedActionTextInput = () => (
272
+ <ExampleContainer pseudoState="pseudo-active" expanded>
273
+ <Title title="Actived action" theme="light" level={4} />
274
+ <DxcTextInput label="Text input" action={action} clearable />
275
+ </ExampleContainer>
276
+ );
277
+
278
+ const ShowOptionsAutosuggest = () => (
279
+ <ExampleContainer expanded>
280
+ <Title title="Show options" theme="light" level={4} />
281
+ <DxcTextInput label="Text input" suggestions={countries} clearable />
282
+ </ExampleContainer>
283
+ );
284
+
285
+ const HoveredOptionAutosuggest = () => (
286
+ <ExampleContainer expanded pseudoState="pseudo-hover">
287
+ <Title title="Hovered option" theme="light" level={4} />
288
+ <DxcTextInput label="Text input" suggestions={country} clearable />
289
+ </ExampleContainer>
290
+ );
291
+
292
+ const FocusedOptionAutosuggest = () => (
293
+ <ExampleContainer expanded>
294
+ <Title title="Focused option" theme="light" level={4} />
295
+ <DxcTextInput label="Text input" suggestions={country} clearable />
296
+ </ExampleContainer>
297
+ );
298
+
299
+ const ActivedOptionAutosuggest = () => (
300
+ <ExampleContainer expanded pseudoState="pseudo-active">
301
+ <Title title="Actived option" theme="light" level={4} />
302
+ <DxcTextInput label="Text input" suggestions={country} clearable />
303
+ </ExampleContainer>
304
+ );
305
+
306
+ const FocusedActionTextInputOnDark = () => (
307
+ <BackgroundColorProvider color="#333333">
308
+ <DarkContainer>
309
+ <ExampleContainer expanded>
310
+ <Title title="Focused action" theme="dark" level={4} />
311
+ <DxcTextInput label="Text input" action={action} clearable />
312
+ </ExampleContainer>
313
+ </DarkContainer>
314
+ </BackgroundColorProvider>
315
+ );
316
+
317
+ const ActivedActionTextInputOnDark = () => (
318
+ <BackgroundColorProvider color="#333333">
319
+ <DarkContainer>
320
+ <ExampleContainer pseudoState="pseudo-active" expanded>
321
+ <Title title="Actived action" theme="dark" level={4} />
322
+ <DxcTextInput label="Text input" action={action} clearable />
323
+ </ExampleContainer>
324
+ </DarkContainer>
325
+ </BackgroundColorProvider>
326
+ );
327
+
328
+ const ShowOptionsAutosuggestOnDark = () => (
329
+ <BackgroundColorProvider color="#333333">
330
+ <DarkContainer>
331
+ <ExampleContainer expanded>
332
+ <Title title="Show options" theme="dark" level={4} />
333
+ <DxcTextInput label="Text input" suggestions={countries} clearable />
334
+ </ExampleContainer>
335
+ </DarkContainer>
336
+ </BackgroundColorProvider>
337
+ );
338
+
339
+ const HoveredActionAutosuggestOnDark = () => (
340
+ <BackgroundColorProvider color="#333333">
341
+ <DarkContainer>
342
+ <ExampleContainer expanded pseudoState="pseudo-hover">
343
+ <Title title="Hovered option" theme="dark" level={4} />
344
+ <DxcTextInput label="Text input" suggestions={country} clearable />
345
+ </ExampleContainer>
346
+ </DarkContainer>
347
+ </BackgroundColorProvider>
348
+ );
349
+
350
+ const FocusedOptionAutosuggestOnDark = () => (
351
+ <BackgroundColorProvider color="#333333">
352
+ <DarkContainer>
353
+ <ExampleContainer expanded>
354
+ <Title title="Focused option" theme="dark" level={4} />
355
+ <DxcTextInput label="Text input" suggestions={country} clearable />
356
+ </ExampleContainer>
357
+ </DarkContainer>
358
+ </BackgroundColorProvider>
359
+ );
360
+
361
+ const ActivedOptionAutosuggestOnDark = () => (
362
+ <BackgroundColorProvider color="#333333">
363
+ <DarkContainer>
364
+ <ExampleContainer expanded pseudoState="pseudo-active">
365
+ <Title title="Actived option" theme="dark" level={4} />
366
+ <DxcTextInput label="Text input" suggestions={country} clearable />
367
+ </ExampleContainer>
368
+ </DarkContainer>
369
+ </BackgroundColorProvider>
370
+ );
371
+
372
+ export const FocusedAction = FocusedActionTextInput.bind({});
373
+ FocusedAction.play = async ({ canvasElement }) => {
374
+ const canvas = within(canvasElement);
375
+ const action = canvas.getByRole("button");
376
+ await action.focus();
377
+ };
378
+
379
+ export const ActivedAction = ActivedActionTextInput.bind({});
380
+ ActivedAction.play = async ({ canvasElement }) => {
381
+ const canvas = within(canvasElement);
382
+ const action = canvas.getByRole("button");
383
+ await userEvent.click(action);
384
+ };
385
+
386
+ export const ShowOptions = ShowOptionsAutosuggest.bind({});
387
+ ShowOptions.play = async ({ canvasElement }) => {
388
+ const canvas = within(canvasElement);
389
+ const autosuggest = canvas.getByRole("combobox");
390
+ await userEvent.click(autosuggest);
391
+ };
392
+
393
+ export const HoveredOption = HoveredOptionAutosuggest.bind({});
394
+ HoveredOption.play = async ({ canvasElement }) => {
395
+ const canvas = within(canvasElement);
396
+ const autosuggest = canvas.getByRole("combobox");
397
+ await userEvent.click(autosuggest);
398
+ };
399
+
400
+ export const FocusedOption = FocusedOptionAutosuggest.bind({});
401
+ FocusedOption.play = async ({ canvasElement }) => {
402
+ const canvas = within(canvasElement);
403
+ const autosuggest = canvas.getByRole("combobox");
404
+ await userEvent.click(autosuggest);
405
+ fireEvent.keyDown(autosuggest, { key: "ArrowDown", code: "ArrowDown", keyCode: 40, charCode: 40 });
406
+ };
407
+
408
+ export const ActivedOption = ActivedOptionAutosuggest.bind({});
409
+ ActivedOption.play = async ({ canvasElement }) => {
410
+ const canvas = within(canvasElement);
411
+ const autosuggest = canvas.getByRole("combobox");
412
+ await userEvent.click(autosuggest);
413
+ };
414
+
415
+ export const FocusedActionOnDark = FocusedActionTextInputOnDark.bind({});
416
+ FocusedActionOnDark.play = async ({ canvasElement }) => {
417
+ const canvas = within(canvasElement);
418
+ const action = canvas.getByRole("button");
419
+ await action.focus();
420
+ };
421
+
422
+ export const ActivedActionOnDark = ActivedActionTextInputOnDark.bind({});
423
+ ActivedActionOnDark.play = async ({ canvasElement }) => {
424
+ const canvas = within(canvasElement);
425
+ const action = canvas.getByRole("button");
426
+ await userEvent.click(action);
427
+ };
428
+
429
+ export const ShowOptionsOnDark = ShowOptionsAutosuggestOnDark.bind({});
430
+ ShowOptionsOnDark.play = async ({ canvasElement }) => {
431
+ const canvas = within(canvasElement);
432
+ const autosuggest = canvas.getByRole("combobox");
433
+ await userEvent.click(autosuggest);
434
+ };
435
+
436
+ export const HoveredActionOnDark = HoveredActionAutosuggestOnDark.bind({});
437
+ HoveredActionOnDark.play = async ({ canvasElement }) => {
438
+ const canvas = within(canvasElement);
439
+ const autosuggest = canvas.getByRole("combobox");
440
+ await userEvent.click(autosuggest);
441
+ };
442
+
443
+ export const FocusedOptionOnDark = FocusedOptionAutosuggestOnDark.bind({});
444
+ FocusedOptionOnDark.play = async ({ canvasElement }) => {
445
+ const canvas = within(canvasElement);
446
+ const autosuggest = canvas.getByRole("combobox");
447
+ await userEvent.click(autosuggest);
448
+ fireEvent.keyDown(autosuggest, { key: "ArrowDown", code: "ArrowDown", keyCode: 40, charCode: 40 });
449
+ };
450
+
451
+ export const ActivedOptionOnDark = ActivedOptionAutosuggestOnDark.bind({});
452
+ ActivedOptionOnDark.play = async ({ canvasElement }) => {
453
+ const canvas = within(canvasElement);
454
+ const autosuggest = canvas.getByRole("combobox");
455
+ await userEvent.click(autosuggest);
456
+ };
@@ -11,7 +11,7 @@ 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.
@@ -122,15 +114,25 @@ declare type Props = {
122
114
  */
123
115
  pattern?: string;
124
116
  /**
125
- * Specifies the minimun and maximum length allowed by the input.
117
+ * Specifies the minimun length allowed by the input.
118
+ * This will be checked both when the input element loses the
119
+ * focus and while typing within it. If the string entered does not
120
+ * comply the minimum length, the onBlur and onChange functions will be called
121
+ * with the current value and an internal error informing that the value
122
+ * length does not comply the specified range. If a valid length is
123
+ * reached, the error parameter of both events will be null.
124
+ */
125
+ minLength?: number;
126
+ /**
127
+ * Specifies the maximum length allowed by the input.
126
128
  * This will be checked both when the input element loses the
127
129
  * focus and while typing within it. If the string entered does not
128
- * comply the length, the onBlur and onChange functions will be called
130
+ * comply the maximum length, the onBlur and onChange functions will be called
129
131
  * with the current value and an internal error informing that the value
130
132
  * length does not comply the specified range. If a valid length is
131
133
  * reached, the error parameter of both events will be null.
132
134
  */
133
- length?: RequiredMinLength | RequiredMaxLength;
135
+ maxLength?: number;
134
136
  /**
135
137
  * 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
138
  * Its value must be one of all the possible values of the HTML autocomplete attribute: 'on', 'off', 'email', 'username', 'new-password', ...
@@ -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;