@dxc-technology/halstack-react 0.0.0-c67081d → 0.0.0-c6888e7

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 (349) hide show
  1. package/README.md +3 -4
  2. package/dist/index.d.mts +4364 -0
  3. package/dist/index.d.ts +4364 -0
  4. package/dist/index.js +19603 -0
  5. package/dist/index.mjs +19512 -0
  6. package/package.json +89 -68
  7. package/BackgroundColorContext.d.ts +0 -10
  8. package/BackgroundColorContext.js +0 -47
  9. package/HalstackContext.d.ts +0 -1356
  10. package/HalstackContext.js +0 -335
  11. package/accordion/Accordion.d.ts +0 -4
  12. package/accordion/Accordion.js +0 -222
  13. package/accordion/Accordion.stories.tsx +0 -297
  14. package/accordion/Accordion.test.js +0 -71
  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 -128
  19. package/accordion-group/AccordionGroup.stories.tsx +0 -252
  20. package/accordion-group/AccordionGroup.test.js +0 -116
  21. package/accordion-group/AccordionGroupAccordion.d.ts +0 -4
  22. package/accordion-group/AccordionGroupAccordion.js +0 -43
  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 -289
  27. package/alert/Alert.stories.tsx +0 -198
  28. package/alert/Alert.test.js +0 -92
  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 -61
  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 -51
  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 -97
  42. package/box/Box.stories.tsx +0 -119
  43. package/box/Box.test.js +0 -18
  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 -125
  48. package/bulleted-list/BulletedList.stories.tsx +0 -206
  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 -144
  53. package/button/Button.stories.tsx +0 -425
  54. package/button/Button.test.js +0 -46
  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 -143
  59. package/card/Card.stories.tsx +0 -171
  60. package/card/Card.test.js +0 -50
  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 -269
  65. package/checkbox/Checkbox.stories.tsx +0 -276
  66. package/checkbox/Checkbox.test.js +0 -228
  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 -140
  71. package/chip/Chip.stories.tsx +0 -214
  72. package/chip/Chip.test.js +0 -54
  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 -146
  77. package/common/coreTokens.js +0 -167
  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 -22
  90. package/common/variables.d.ts +0 -1499
  91. package/common/variables.js +0 -1378
  92. package/date-input/Calendar.d.ts +0 -4
  93. package/date-input/Calendar.js +0 -258
  94. package/date-input/DateInput.d.ts +0 -4
  95. package/date-input/DateInput.js +0 -271
  96. package/date-input/DateInput.stories.tsx +0 -314
  97. package/date-input/DateInput.test.js +0 -849
  98. package/date-input/DatePicker.d.ts +0 -4
  99. package/date-input/DatePicker.js +0 -146
  100. package/date-input/Icons.d.ts +0 -6
  101. package/date-input/Icons.js +0 -75
  102. package/date-input/YearPicker.d.ts +0 -4
  103. package/date-input/YearPicker.js +0 -126
  104. package/date-input/types.d.ts +0 -164
  105. package/date-input/types.js +0 -5
  106. package/dialog/Dialog.d.ts +0 -4
  107. package/dialog/Dialog.js +0 -131
  108. package/dialog/Dialog.stories.tsx +0 -195
  109. package/dialog/Dialog.test.js +0 -369
  110. package/dialog/types.d.ts +0 -31
  111. package/dialog/types.js +0 -5
  112. package/dropdown/Dropdown.d.ts +0 -4
  113. package/dropdown/Dropdown.js +0 -388
  114. package/dropdown/Dropdown.stories.tsx +0 -438
  115. package/dropdown/Dropdown.test.js +0 -586
  116. package/dropdown/DropdownMenu.d.ts +0 -4
  117. package/dropdown/DropdownMenu.js +0 -74
  118. package/dropdown/DropdownMenuItem.d.ts +0 -4
  119. package/dropdown/DropdownMenuItem.js +0 -79
  120. package/dropdown/types.d.ts +0 -100
  121. package/dropdown/types.js +0 -5
  122. package/file-input/FileInput.d.ts +0 -4
  123. package/file-input/FileInput.js +0 -547
  124. package/file-input/FileInput.stories.tsx +0 -618
  125. package/file-input/FileInput.test.js +0 -457
  126. package/file-input/FileItem.d.ts +0 -4
  127. package/file-input/FileItem.js +0 -162
  128. package/file-input/types.d.ts +0 -129
  129. package/file-input/types.js +0 -5
  130. package/flex/Flex.d.ts +0 -4
  131. package/flex/Flex.js +0 -71
  132. package/flex/Flex.stories.tsx +0 -112
  133. package/flex/types.d.ts +0 -97
  134. package/flex/types.js +0 -5
  135. package/footer/Footer.d.ts +0 -4
  136. package/footer/Footer.js +0 -165
  137. package/footer/Footer.stories.tsx +0 -152
  138. package/footer/Footer.test.js +0 -99
  139. package/footer/Icons.d.ts +0 -2
  140. package/footer/Icons.js +0 -77
  141. package/footer/types.d.ts +0 -64
  142. package/footer/types.js +0 -5
  143. package/grid/Grid.d.ts +0 -7
  144. package/grid/Grid.js +0 -91
  145. package/grid/Grid.stories.tsx +0 -219
  146. package/grid/types.d.ts +0 -115
  147. package/grid/types.js +0 -5
  148. package/header/Header.d.ts +0 -8
  149. package/header/Header.js +0 -276
  150. package/header/Header.stories.tsx +0 -251
  151. package/header/Header.test.js +0 -79
  152. package/header/Icons.d.ts +0 -2
  153. package/header/Icons.js +0 -34
  154. package/header/types.d.ts +0 -34
  155. package/header/types.js +0 -5
  156. package/heading/Heading.d.ts +0 -4
  157. package/heading/Heading.js +0 -159
  158. package/heading/Heading.stories.tsx +0 -54
  159. package/heading/Heading.test.js +0 -186
  160. package/heading/types.d.ts +0 -33
  161. package/heading/types.js +0 -5
  162. package/image/Image.d.ts +0 -4
  163. package/image/Image.js +0 -85
  164. package/image/Image.stories.tsx +0 -127
  165. package/image/types.d.ts +0 -72
  166. package/image/types.js +0 -5
  167. package/inset/Inset.d.ts +0 -3
  168. package/inset/Inset.js +0 -51
  169. package/inset/Inset.stories.tsx +0 -230
  170. package/inset/types.d.ts +0 -37
  171. package/inset/types.js +0 -5
  172. package/layout/ApplicationLayout.d.ts +0 -20
  173. package/layout/ApplicationLayout.js +0 -174
  174. package/layout/ApplicationLayout.stories.tsx +0 -162
  175. package/layout/Icons.d.ts +0 -8
  176. package/layout/Icons.js +0 -62
  177. package/layout/SidenavContext.d.ts +0 -5
  178. package/layout/SidenavContext.js +0 -19
  179. package/layout/types.d.ts +0 -41
  180. package/layout/types.js +0 -5
  181. package/link/Link.d.ts +0 -4
  182. package/link/Link.js +0 -136
  183. package/link/Link.stories.tsx +0 -253
  184. package/link/Link.test.js +0 -81
  185. package/link/types.d.ts +0 -54
  186. package/link/types.js +0 -5
  187. package/main.d.ts +0 -46
  188. package/main.js +0 -385
  189. package/nav-tabs/NavTabs.d.ts +0 -8
  190. package/nav-tabs/NavTabs.js +0 -122
  191. package/nav-tabs/NavTabs.stories.tsx +0 -274
  192. package/nav-tabs/NavTabs.test.js +0 -82
  193. package/nav-tabs/Tab.d.ts +0 -4
  194. package/nav-tabs/Tab.js +0 -146
  195. package/nav-tabs/types.d.ts +0 -52
  196. package/nav-tabs/types.js +0 -5
  197. package/number-input/NumberInput.d.ts +0 -11
  198. package/number-input/NumberInput.js +0 -80
  199. package/number-input/NumberInput.stories.tsx +0 -160
  200. package/number-input/NumberInput.test.js +0 -768
  201. package/number-input/types.d.ts +0 -130
  202. package/number-input/types.js +0 -5
  203. package/paginator/Icons.d.ts +0 -5
  204. package/paginator/Icons.js +0 -54
  205. package/paginator/Paginator.d.ts +0 -4
  206. package/paginator/Paginator.js +0 -163
  207. package/paginator/Paginator.stories.tsx +0 -87
  208. package/paginator/Paginator.test.js +0 -318
  209. package/paginator/types.d.ts +0 -38
  210. package/paginator/types.js +0 -5
  211. package/paragraph/Paragraph.d.ts +0 -5
  212. package/paragraph/Paragraph.js +0 -38
  213. package/paragraph/Paragraph.stories.tsx +0 -44
  214. package/password-input/Icons.d.ts +0 -6
  215. package/password-input/Icons.js +0 -39
  216. package/password-input/PasswordInput.d.ts +0 -4
  217. package/password-input/PasswordInput.js +0 -119
  218. package/password-input/PasswordInput.stories.tsx +0 -132
  219. package/password-input/PasswordInput.test.js +0 -174
  220. package/password-input/types.d.ts +0 -110
  221. package/password-input/types.js +0 -5
  222. package/progress-bar/ProgressBar.d.ts +0 -4
  223. package/progress-bar/ProgressBar.js +0 -176
  224. package/progress-bar/ProgressBar.stories.jsx +0 -93
  225. package/progress-bar/ProgressBar.test.js +0 -110
  226. package/progress-bar/types.d.ts +0 -37
  227. package/progress-bar/types.js +0 -5
  228. package/quick-nav/QuickNav.d.ts +0 -4
  229. package/quick-nav/QuickNav.js +0 -117
  230. package/quick-nav/QuickNav.stories.tsx +0 -356
  231. package/quick-nav/types.d.ts +0 -21
  232. package/quick-nav/types.js +0 -5
  233. package/radio-group/Radio.d.ts +0 -4
  234. package/radio-group/Radio.js +0 -156
  235. package/radio-group/RadioGroup.d.ts +0 -4
  236. package/radio-group/RadioGroup.js +0 -281
  237. package/radio-group/RadioGroup.stories.tsx +0 -214
  238. package/radio-group/RadioGroup.test.js +0 -749
  239. package/radio-group/types.d.ts +0 -114
  240. package/radio-group/types.js +0 -5
  241. package/resultsetTable/Icons.d.ts +0 -7
  242. package/resultsetTable/Icons.js +0 -51
  243. package/resultsetTable/ResultsetTable.d.ts +0 -4
  244. package/resultsetTable/ResultsetTable.js +0 -195
  245. package/resultsetTable/ResultsetTable.stories.tsx +0 -300
  246. package/resultsetTable/ResultsetTable.test.js +0 -325
  247. package/resultsetTable/types.d.ts +0 -67
  248. package/resultsetTable/types.js +0 -5
  249. package/select/Icons.d.ts +0 -10
  250. package/select/Icons.js +0 -93
  251. package/select/Listbox.d.ts +0 -4
  252. package/select/Listbox.js +0 -169
  253. package/select/Option.d.ts +0 -4
  254. package/select/Option.js +0 -97
  255. package/select/Select.d.ts +0 -4
  256. package/select/Select.js +0 -666
  257. package/select/Select.stories.tsx +0 -971
  258. package/select/Select.test.js +0 -2228
  259. package/select/types.d.ts +0 -210
  260. package/select/types.js +0 -5
  261. package/sidenav/Icons.d.ts +0 -7
  262. package/sidenav/Icons.js +0 -51
  263. package/sidenav/Sidenav.d.ts +0 -10
  264. package/sidenav/Sidenav.js +0 -238
  265. package/sidenav/Sidenav.stories.tsx +0 -282
  266. package/sidenav/Sidenav.test.js +0 -44
  267. package/sidenav/types.d.ts +0 -76
  268. package/sidenav/types.js +0 -5
  269. package/slider/Slider.d.ts +0 -4
  270. package/slider/Slider.js +0 -342
  271. package/slider/Slider.stories.tsx +0 -240
  272. package/slider/Slider.test.js +0 -250
  273. package/slider/types.d.ts +0 -86
  274. package/slider/types.js +0 -5
  275. package/spinner/Spinner.d.ts +0 -4
  276. package/spinner/Spinner.js +0 -244
  277. package/spinner/Spinner.stories.jsx +0 -129
  278. package/spinner/Spinner.test.js +0 -64
  279. package/spinner/types.d.ts +0 -32
  280. package/spinner/types.js +0 -5
  281. package/switch/Switch.d.ts +0 -4
  282. package/switch/Switch.js +0 -262
  283. package/switch/Switch.stories.tsx +0 -171
  284. package/switch/Switch.test.js +0 -225
  285. package/switch/types.d.ts +0 -66
  286. package/switch/types.js +0 -5
  287. package/table/Table.d.ts +0 -4
  288. package/table/Table.js +0 -118
  289. package/table/Table.stories.jsx +0 -356
  290. package/table/Table.test.js +0 -26
  291. package/table/types.d.ts +0 -21
  292. package/table/types.js +0 -5
  293. package/tabs/Tab.d.ts +0 -4
  294. package/tabs/Tab.js +0 -132
  295. package/tabs/Tabs.d.ts +0 -4
  296. package/tabs/Tabs.js +0 -461
  297. package/tabs/Tabs.stories.tsx +0 -226
  298. package/tabs/Tabs.test.js +0 -350
  299. package/tabs/types.d.ts +0 -92
  300. package/tabs/types.js +0 -5
  301. package/tag/Tag.d.ts +0 -4
  302. package/tag/Tag.js +0 -181
  303. package/tag/Tag.stories.tsx +0 -155
  304. package/tag/Tag.test.js +0 -60
  305. package/tag/types.d.ts +0 -69
  306. package/tag/types.js +0 -5
  307. package/text-input/Icons.d.ts +0 -8
  308. package/text-input/Icons.js +0 -60
  309. package/text-input/Suggestion.d.ts +0 -4
  310. package/text-input/Suggestion.js +0 -84
  311. package/text-input/Suggestions.d.ts +0 -4
  312. package/text-input/Suggestions.js +0 -134
  313. package/text-input/TextInput.d.ts +0 -4
  314. package/text-input/TextInput.js +0 -651
  315. package/text-input/TextInput.stories.tsx +0 -608
  316. package/text-input/TextInput.test.js +0 -1834
  317. package/text-input/types.d.ts +0 -203
  318. package/text-input/types.js +0 -5
  319. package/textarea/Textarea.d.ts +0 -4
  320. package/textarea/Textarea.js +0 -278
  321. package/textarea/Textarea.stories.jsx +0 -224
  322. package/textarea/Textarea.test.js +0 -479
  323. package/textarea/types.d.ts +0 -141
  324. package/textarea/types.js +0 -5
  325. package/toggle-group/ToggleGroup.d.ts +0 -4
  326. package/toggle-group/ToggleGroup.js +0 -241
  327. package/toggle-group/ToggleGroup.stories.tsx +0 -218
  328. package/toggle-group/ToggleGroup.test.js +0 -170
  329. package/toggle-group/types.d.ts +0 -114
  330. package/toggle-group/types.js +0 -5
  331. package/typography/Typography.d.ts +0 -4
  332. package/typography/Typography.js +0 -32
  333. package/typography/Typography.stories.tsx +0 -198
  334. package/typography/types.d.ts +0 -18
  335. package/typography/types.js +0 -5
  336. package/useTheme.d.ts +0 -1252
  337. package/useTheme.js +0 -22
  338. package/useTranslatedLabels.d.ts +0 -85
  339. package/useTranslatedLabels.js +0 -20
  340. package/utils/BaseTypography.d.ts +0 -21
  341. package/utils/BaseTypography.js +0 -108
  342. package/utils/FocusLock.d.ts +0 -13
  343. package/utils/FocusLock.js +0 -138
  344. package/wizard/Wizard.d.ts +0 -4
  345. package/wizard/Wizard.js +0 -285
  346. package/wizard/Wizard.stories.tsx +0 -253
  347. package/wizard/Wizard.test.js +0 -141
  348. package/wizard/types.d.ts +0 -64
  349. package/wizard/types.js +0 -5
@@ -1,608 +0,0 @@
1
- import React from "react";
2
- import { userEvent, within } from "@storybook/testing-library";
3
- import { BackgroundColorProvider } from "../BackgroundColorContext";
4
- import Title from "../../.storybook/components/Title";
5
- import ExampleContainer from "../../.storybook/components/ExampleContainer";
6
- import DarkContainer from "../../.storybook/components/DarkSection";
7
- import DxcTextInput from "./TextInput";
8
- import DxcButton from "../button/Button";
9
- import DxcCheckbox from "../checkbox/Checkbox";
10
- import DxcFlex from "../flex/Flex";
11
- import Suggestions from "./Suggestions";
12
- import { ThemeProvider } from "styled-components";
13
- import useTheme from "../useTheme";
14
- import { HalstackProvider } from "../HalstackContext";
15
-
16
- export default {
17
- title: "Text input",
18
- component: DxcTextInput,
19
- };
20
-
21
- const action = {
22
- onClick: () => {},
23
- icon: (
24
- <svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
25
- <path d="M0 0h24v24H0V0z" fill="none" />
26
- <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" />
27
- </svg>
28
- ),
29
- };
30
-
31
- const actionLargeIconSVG = {
32
- onClick: () => {},
33
- icon: (
34
- <svg xmlns="http://www.w3.org/2000/svg" height="48px" viewBox="0 0 24 24" width="48px" fill="currentColor">
35
- <path d="M0 0h24v24H0V0z" fill="none" />
36
- <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" />
37
- </svg>
38
- ),
39
- };
40
-
41
- const actionLargeIconURL = {
42
- onClick: () => {},
43
- icon: "https://iconape.com/wp-content/files/yd/367773/svg/logo-linkedin-logo-icon-png-svg.png",
44
- };
45
-
46
- const country = ["Afghanistan"];
47
- const countries = [
48
- "Afghanistan",
49
- "Albania",
50
- "Algeria",
51
- "Andorra Andorra Andorra Andorra Andorra Andorra Andorra Andorra",
52
- "Angola",
53
- "Antigua and Barbuda Antigua and Barbuda Antigua and Barbuda",
54
- "Bahamas",
55
- "Bahrain",
56
- "Bangladesh",
57
- "Barbados",
58
- "Cabo Verde",
59
- "Cambodia",
60
- "Cameroon",
61
- "Canada",
62
- "Cayman Islands, The",
63
- "Central African Republic",
64
- "Chad",
65
- "Democratic Republic of the Congo",
66
- "Dominican Republic",
67
- "Dominica",
68
- "Denmark",
69
- "Djibouti",
70
- "*",
71
- ];
72
-
73
- const opinionatedTheme = {
74
- textInput: {
75
- fontColor: "#000000",
76
- hoverBorderColor: "#a46ede",
77
- },
78
- };
79
-
80
- export const Chromatic = () => (
81
- <>
82
- <ExampleContainer pseudoState="pseudo-hover">
83
- <Title title="Hovered input" theme="light" level={4} />
84
- <DxcTextInput label="Text input" />
85
- </ExampleContainer>
86
- <ExampleContainer pseudoState="pseudo-focus-within">
87
- <Title title="Focused input" theme="light" level={4} />
88
- <DxcTextInput label="Text input" />
89
- </ExampleContainer>
90
- <ExampleContainer pseudoState="pseudo-hover">
91
- <Title title="Hovered action" theme="light" level={4} />
92
- <DxcTextInput label="Text input" defaultValue="Text" clearable />
93
- </ExampleContainer>
94
- <ExampleContainer pseudoState="pseudo-active">
95
- <Title title="Actived action" theme="light" level={4} />
96
- <DxcTextInput label="Text input" action={action} clearable />
97
- </ExampleContainer>
98
- <ExampleContainer pseudoState="pseudo-focus">
99
- <Title title="Focused action" theme="light" level={4} />
100
- <DxcTextInput label="Text input" action={action} clearable />
101
- </ExampleContainer>
102
- <ExampleContainer>
103
- <Title title="Without label" theme="light" level={4} />
104
- <DxcTextInput />
105
- </ExampleContainer>
106
- <ExampleContainer>
107
- <Title title="With label and placeholder" theme="light" level={4} />
108
- <DxcTextInput label="Text input" placeholder="Placeholder" />
109
- </ExampleContainer>
110
- <ExampleContainer>
111
- <Title title="Helper text, optional, and clearable" theme="light" level={4} />
112
- <DxcTextInput label="Text input" clearable defaultValue="Text" helperText="Help message" optional />
113
- </ExampleContainer>
114
- <ExampleContainer>
115
- <Title title="Clearable and large icon action (SVG)" theme="light" level={4} />
116
- <DxcTextInput
117
- label="Text input"
118
- defaultValue="Text text text text text text text text text text"
119
- clearable
120
- action={actionLargeIconSVG}
121
- />
122
- </ExampleContainer>
123
- <ExampleContainer>
124
- <Title title="Clearable and large icon action (URL)" theme="light" level={4} />
125
- <DxcTextInput
126
- label="Text input"
127
- defaultValue="Text text text text text text text text text text"
128
- clearable
129
- action={actionLargeIconURL}
130
- />
131
- </ExampleContainer>
132
- <ExampleContainer>
133
- <Title title="Prefix" theme="light" level={4} />
134
- <DxcTextInput label="With prefix" prefix="+34" />
135
- </ExampleContainer>
136
- <ExampleContainer>
137
- <Title title="Suffix and action" theme="light" level={4} />
138
- <DxcTextInput label="With suffix" suffix="USD" action={action} />
139
- </ExampleContainer>
140
- <ExampleContainer>
141
- <Title title="Invalid" theme="light" level={4} />
142
- <DxcTextInput
143
- label="Error text input"
144
- helperText="Help message"
145
- error="Error message."
146
- defaultValue="Text"
147
- clearable
148
- optional
149
- action={action}
150
- />
151
- </ExampleContainer>
152
- <ExampleContainer pseudoState="pseudo-hover">
153
- <Title title="Invalid and hovered" theme="light" level={4} />
154
- <DxcTextInput
155
- label="Error text input"
156
- helperText="Help message"
157
- placeholder="Placeholder"
158
- error="Error message."
159
- />
160
- </ExampleContainer>
161
- <ExampleContainer>
162
- <Title title="Disabled and placeholder" theme="light" level={4} />
163
- <DxcTextInput label="Disabled text input" disabled placeholder="Placeholder" />
164
- </ExampleContainer>
165
- <ExampleContainer>
166
- <Title title="Disabled, helper text, optional, value and action" theme="light" level={4} />
167
- <DxcTextInput
168
- label="Disabled text input"
169
- helperText="Help message"
170
- disabled
171
- optional
172
- defaultValue="Text"
173
- action={action}
174
- />
175
- </ExampleContainer>
176
- <ExampleContainer>
177
- <Title title="Disabled with prefix and suffix" theme="light" level={4} />
178
- <DxcTextInput
179
- label="Disabled text input"
180
- helperText="Help message"
181
- disabled
182
- optional
183
- prefix="+34"
184
- suffix="USD"
185
- defaultValue="Text"
186
- action={action}
187
- />
188
- </ExampleContainer>
189
- <ExampleContainer>
190
- <Title title="Read only" theme="light" level={4} />
191
- <DxcTextInput
192
- label="Example label"
193
- helperText="Help message"
194
- clearable
195
- readOnly
196
- optional
197
- prefix="+34"
198
- defaultValue="Text"
199
- action={action}
200
- />
201
- </ExampleContainer>
202
- <ExampleContainer pseudoState="pseudo-hover">
203
- <Title title="Hovered read only" theme="light" level={4} />
204
- <DxcTextInput
205
- label="Example label"
206
- helperText="Help message"
207
- clearable
208
- readOnly
209
- optional
210
- prefix="+34"
211
- defaultValue="Text"
212
- action={action}
213
- />
214
- </ExampleContainer>
215
- <ExampleContainer pseudoState="pseudo-active">
216
- <Title title="Active read only" theme="light" level={4} />
217
- <DxcTextInput
218
- label="Example label"
219
- helperText="Help message"
220
- clearable
221
- readOnly
222
- optional
223
- prefix="+34"
224
- defaultValue="Text"
225
- action={action}
226
- />
227
- </ExampleContainer>
228
- <BackgroundColorProvider color="#333333">
229
- <DarkContainer>
230
- <Title title="Dark theme" theme="dark" level={2} />
231
- <ExampleContainer pseudoState="pseudo-hover">
232
- <Title title="Hovered" theme="dark" level={4} />
233
- <DxcTextInput label="Text input" />
234
- </ExampleContainer>
235
- <ExampleContainer pseudoState="pseudo-focus-within">
236
- <Title title="Focused" theme="dark" level={4} />
237
- <DxcTextInput label="Text input" />
238
- </ExampleContainer>
239
- <ExampleContainer pseudoState="pseudo-hover">
240
- <Title title="Hovered action" theme="dark" level={4} />
241
- <DxcTextInput label="Text input" defaultValue="Text" clearable />
242
- </ExampleContainer>
243
- <ExampleContainer pseudoState="pseudo-active">
244
- <Title title="Actived action" theme="dark" level={4} />
245
- <DxcTextInput label="Text input" action={action} clearable />
246
- </ExampleContainer>
247
- <ExampleContainer pseudoState="pseudo-focus">
248
- <Title title="Focused action" theme="dark" level={4} />
249
- <DxcTextInput label="Text input" action={action} clearable />
250
- </ExampleContainer>
251
- <ExampleContainer>
252
- <Title title="Helper text, placeholder, optional and action" theme="dark" level={4} />
253
- <DxcTextInput
254
- label="Text input"
255
- helperText="Help message"
256
- placeholder="Placeholder"
257
- clearable
258
- optional
259
- action={action}
260
- />
261
- </ExampleContainer>
262
- <ExampleContainer>
263
- <Title title="Invalid" theme="dark" level={4} />
264
- <DxcTextInput
265
- label="Error text input"
266
- helperText="Help message"
267
- error="Error message."
268
- defaultValue="Text"
269
- clearable
270
- action={action}
271
- />
272
- </ExampleContainer>
273
- <ExampleContainer pseudoState="pseudo-hover">
274
- <Title title="Invalid and hovered" theme="dark" level={4} />
275
- <DxcTextInput
276
- label="Error text input"
277
- helperText="Help message"
278
- placeholder="Placeholder"
279
- error="Error message."
280
- />
281
- </ExampleContainer>
282
- <ExampleContainer>
283
- <Title title="Prefix and suffix" theme="dark" level={4} />
284
- <DxcTextInput label="With prefix and suffix" prefix="+34" suffix="USD" />
285
- </ExampleContainer>
286
- <ExampleContainer>
287
- <Title title="Disabled and placeholder" theme="dark" level={4} />
288
- <DxcTextInput label="Disabled text input" disabled placeholder="Placeholder" />
289
- </ExampleContainer>
290
- <ExampleContainer>
291
- <Title title="Disabled, helper text, optional, value and action" theme="dark" level={4} />
292
- <DxcTextInput
293
- label="Disabled text input"
294
- helperText="Help message"
295
- disabled
296
- optional
297
- defaultValue="Text"
298
- action={action}
299
- />
300
- </ExampleContainer>
301
- <ExampleContainer>
302
- <Title title="Disabled with prefix and suffix" theme="dark" level={4} />
303
- <DxcTextInput
304
- label="Disabled text input"
305
- helperText="Help message"
306
- disabled
307
- optional
308
- prefix="+34"
309
- suffix="USD"
310
- defaultValue="Text"
311
- action={action}
312
- />
313
- </ExampleContainer>
314
- </DarkContainer>
315
- </BackgroundColorProvider>
316
- <Title title="Margins" theme="light" level={2} />
317
- <ExampleContainer>
318
- <Title title="Xxsmall margin" theme="light" level={4} />
319
- <DxcTextInput label="Xxsmall" margin="xxsmall" />
320
- </ExampleContainer>
321
- <ExampleContainer>
322
- <Title title="Xsmall margin" theme="light" level={4} />
323
- <DxcTextInput label="Xsmall" margin="xsmall" />
324
- </ExampleContainer>
325
- <ExampleContainer>
326
- <Title title="Small margin" theme="light" level={4} />
327
- <DxcTextInput label="Small" margin="small" />
328
- </ExampleContainer>
329
- <ExampleContainer>
330
- <Title title="Medium margin" theme="light" level={4} />
331
- <DxcTextInput label="Medium" margin="medium" />
332
- </ExampleContainer>
333
- <ExampleContainer>
334
- <Title title="Large margin" theme="light" level={4} />
335
- <DxcTextInput label="Large" margin="large" />
336
- </ExampleContainer>
337
- <ExampleContainer>
338
- <Title title="Xlarge margin" theme="light" level={4} />
339
- <DxcTextInput label="Xlarge" margin="xlarge" />
340
- </ExampleContainer>
341
- <ExampleContainer>
342
- <Title title="Xxlarge margin" theme="light" level={4} />
343
- <DxcTextInput label="Xxlarge" margin="xxlarge" />
344
- </ExampleContainer>
345
- <Title title="Sizes" theme="light" level={2} />
346
- <ExampleContainer>
347
- <Title title="Small size" theme="light" level={4} />
348
- <DxcTextInput label="Small" size="small" />
349
- </ExampleContainer>
350
- <ExampleContainer>
351
- <Title title="Medium size" theme="light" level={4} />
352
- <DxcTextInput label="Medium" size="medium" />
353
- </ExampleContainer>
354
- <ExampleContainer>
355
- <Title title="Large size" theme="light" level={4} />
356
- <DxcTextInput label="Large" size="large" />
357
- </ExampleContainer>
358
- <ExampleContainer>
359
- <Title title="FillParent size" theme="light" level={4} />
360
- <DxcTextInput label="FillParent" size="fillParent" />
361
- </ExampleContainer>
362
- <Title title="Opinionated theme" theme="light" level={2} />
363
- <ExampleContainer>
364
- <HalstackProvider theme={opinionatedTheme}>
365
- <ExampleContainer pseudoState="pseudo-hover">
366
- <Title title="Hovered input" theme="light" level={4} />
367
- <DxcTextInput label="Text input" helperText="Help message" />
368
- </ExampleContainer>
369
- <ExampleContainer pseudoState="pseudo-focus-within">
370
- <Title title="Focused input" theme="light" level={4} />
371
- <DxcTextInput label="Text input" helperText="Help message" />
372
- </ExampleContainer>
373
- <ExampleContainer pseudoState="pseudo-hover">
374
- <Title title="Hovered action" theme="light" level={4} />
375
- <DxcTextInput label="Text input" helperText="Help message" defaultValue="Text" clearable />
376
- </ExampleContainer>
377
- <ExampleContainer pseudoState="pseudo-active">
378
- <Title title="Actived action" theme="light" level={4} />
379
- <DxcTextInput label="Text input" helperText="Help message" action={action} clearable />
380
- </ExampleContainer>
381
- <ExampleContainer pseudoState="pseudo-focus">
382
- <Title title="Focused action" theme="light" level={4} />
383
- <DxcTextInput label="Text input" helperText="Help message" action={action} clearable />
384
- </ExampleContainer>
385
- <ExampleContainer>
386
- <Title title="Prefix" theme="light" level={4} />
387
- <DxcTextInput label="With prefix" prefix="+34" helperText="Help message" />
388
- </ExampleContainer>
389
- <ExampleContainer>
390
- <Title title="Suffix and action" theme="light" level={4} />
391
- <DxcTextInput label="With suffix" helperText="Help message" suffix="USD" action={action} />
392
- </ExampleContainer>
393
- <ExampleContainer>
394
- <Title title="Invalid" theme="light" level={4} />
395
- <DxcTextInput
396
- label="Error text input"
397
- helperText="Help message"
398
- error="Error message."
399
- defaultValue="Text"
400
- clearable
401
- optional
402
- action={action}
403
- />
404
- </ExampleContainer>
405
- <ExampleContainer>
406
- <Title title="Disabled and placeholder" theme="light" level={4} />
407
- <DxcTextInput label="Disabled text input" disabled placeholder="Placeholder" prefix="+34" suffix="USD" />
408
- </ExampleContainer>
409
- <ExampleContainer>
410
- <Title title="Disabled, helper text, optional, value and action" theme="light" level={4} />
411
- <DxcTextInput
412
- label="Disabled text input"
413
- helperText="Help message"
414
- disabled
415
- optional
416
- defaultValue="Text"
417
- action={action}
418
- />
419
- </ExampleContainer>
420
- </HalstackProvider>
421
- </ExampleContainer>
422
- </>
423
- );
424
-
425
- const AutosuggestListbox = () => {
426
- const colorsTheme: any = useTheme();
427
-
428
- return (
429
- <ThemeProvider theme={colorsTheme.textInput}>
430
- <ExampleContainer>
431
- <Title title="Autosuggest listbox" theme="light" level={2} />
432
- <ExampleContainer>
433
- <Title
434
- title="List dialog uses a Radix Popover to appear over elements with a certain z-index"
435
- theme="light"
436
- level={3}
437
- />
438
- <div
439
- style={{
440
- display: "flex",
441
- flexDirection: "column",
442
- gap: "20px",
443
- height: "150px",
444
- width: "500px",
445
- marginBottom: "250px",
446
- padding: "20px",
447
- border: "1px solid black",
448
- borderRadius: "4px",
449
- overflow: "auto",
450
- zIndex: "1300",
451
- position: "relative",
452
- }}
453
- >
454
- <DxcTextInput
455
- label="Label"
456
- suggestions={countries}
457
- optional
458
- placeholder="Choose an option"
459
- size="fillParent"
460
- />
461
- <button style={{ zIndex: "1", width: "100px" }}>Submit</button>
462
- </div>
463
- </ExampleContainer>
464
- <Title title="Listbox suggestion states" theme="light" level={3} />
465
- <ExampleContainer pseudoState="pseudo-hover">
466
- <Title title="Hovered suggestion" theme="light" level={4} />
467
- <Suggestions
468
- id="x"
469
- value=""
470
- suggestions={country}
471
- visualFocusIndex={-1}
472
- highlightedSuggestions={false}
473
- searchHasErrors={false}
474
- isSearching={false}
475
- suggestionOnClick={() => {}}
476
- getTextInputWidth={() => 350}
477
- />
478
- </ExampleContainer>
479
- <ExampleContainer pseudoState="pseudo-active">
480
- <Title title="Active suggestion" theme="light" level={4} />
481
- <Suggestions
482
- id="x"
483
- value=""
484
- suggestions={country}
485
- visualFocusIndex={-1}
486
- highlightedSuggestions={false}
487
- searchHasErrors={false}
488
- isSearching={false}
489
- suggestionOnClick={(suggestion) => {}}
490
- getTextInputWidth={() => 350}
491
- />
492
- </ExampleContainer>
493
- <ExampleContainer>
494
- <Title title="Focused suggestion" theme="light" level={4} />
495
- <Suggestions
496
- id="x"
497
- value=""
498
- suggestions={country}
499
- visualFocusIndex={0}
500
- highlightedSuggestions={false}
501
- searchHasErrors={false}
502
- isSearching={false}
503
- suggestionOnClick={(suggestion) => {}}
504
- getTextInputWidth={() => 350}
505
- />
506
- </ExampleContainer>
507
- <ExampleContainer>
508
- <Title title="Highlighted suggestion" theme="light" level={4} />
509
- <Suggestions
510
- id="x"
511
- value="Afgh"
512
- suggestions={country}
513
- visualFocusIndex={-1}
514
- highlightedSuggestions={true}
515
- searchHasErrors={false}
516
- isSearching={false}
517
- suggestionOnClick={(suggestion) => {}}
518
- getTextInputWidth={() => 350}
519
- />
520
- </ExampleContainer>
521
- </ExampleContainer>
522
- <ExampleContainer>
523
- <Title title="Autosuggest Error" theme="light" level={3} />
524
- <Suggestions
525
- id="x"
526
- value=""
527
- suggestions={country}
528
- visualFocusIndex={-1}
529
- highlightedSuggestions={false}
530
- searchHasErrors={true}
531
- isSearching={false}
532
- suggestionOnClick={(suggestion) => {}}
533
- getTextInputWidth={() => 350}
534
- />
535
- </ExampleContainer>
536
- <ExampleContainer>
537
- <Title title="Autosuggest Searching message" theme="light" level={3} />
538
- <Suggestions
539
- id="x"
540
- value=""
541
- suggestions={country}
542
- visualFocusIndex={-1}
543
- highlightedSuggestions={false}
544
- searchHasErrors={false}
545
- isSearching={true}
546
- suggestionOnClick={(suggestion) => {}}
547
- getTextInputWidth={() => 350}
548
- />
549
- </ExampleContainer>
550
- </ThemeProvider>
551
- );
552
- };
553
-
554
- const DarkAutosuggestListbox = () => {
555
- const colorsTheme: any = useTheme();
556
-
557
- return (
558
- <ThemeProvider theme={colorsTheme.textInput}>
559
- <BackgroundColorProvider color="#333333">
560
- <DarkContainer>
561
- <Title title="Dark theme" theme="dark" level={2} />
562
- <ExampleContainer>
563
- <Title title="Default with opened suggestions" theme="dark" level={3} />
564
- <DxcFlex direction="column" gap="5rem">
565
- <DxcTextInput label="Label" suggestions={countries} optional placeholder="Choose an option" />
566
- <DxcCheckbox
567
- label="You understand the selection and give your consent"
568
- onChange={() => {}}
569
- labelPosition="after"
570
- />
571
- <DxcButton label="Submit" onClick={() => {}} size="medium" margin={{ bottom: "xxlarge" }} />
572
- </DxcFlex>
573
- </ExampleContainer>
574
- <ExampleContainer>
575
- <Title title="Autosuggest Error" theme="dark" level={3} />
576
- <div style={{ height: "100px" }}>
577
- <Suggestions
578
- id="x"
579
- value=""
580
- suggestions={country}
581
- visualFocusIndex={-1}
582
- highlightedSuggestions={false}
583
- searchHasErrors={true}
584
- isSearching={false}
585
- suggestionOnClick={(suggestion) => {}}
586
- getTextInputWidth={() => 350}
587
- />
588
- </div>
589
- </ExampleContainer>
590
- </DarkContainer>
591
- </BackgroundColorProvider>
592
- </ThemeProvider>
593
- );
594
- };
595
-
596
- export const AutosuggestListboxStates = AutosuggestListbox.bind({});
597
- AutosuggestListboxStates.play = async ({ canvasElement }) => {
598
- const canvas = within(canvasElement);
599
- const select = canvas.getByRole("combobox");
600
- await userEvent.click(select);
601
- };
602
-
603
- export const AutosuggestListboxOnDark = DarkAutosuggestListbox.bind({});
604
- AutosuggestListboxOnDark.play = async ({ canvasElement }) => {
605
- const canvas = within(canvasElement);
606
- const select = canvas.getByRole("combobox");
607
- await userEvent.click(select);
608
- };