@dxc-technology/halstack-react 0.0.0-ca55cbe → 0.0.0-ca89a03

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 (345) hide show
  1. package/README.md +46 -0
  2. package/dist/index.d.mts +3910 -0
  3. package/dist/index.d.ts +3910 -0
  4. package/dist/index.js +14390 -0
  5. package/dist/index.mjs +14302 -0
  6. package/package.json +85 -67
  7. package/BackgroundColorContext.d.ts +0 -10
  8. package/BackgroundColorContext.js +0 -47
  9. package/HalstackContext.d.ts +0 -1336
  10. package/HalstackContext.js +0 -335
  11. package/accordion/Accordion.d.ts +0 -4
  12. package/accordion/Accordion.js +0 -234
  13. package/accordion/Accordion.stories.tsx +0 -395
  14. package/accordion/Accordion.test.js +0 -71
  15. package/accordion/types.d.ts +0 -69
  16. package/accordion/types.js +0 -5
  17. package/accordion-group/AccordionGroup.d.ts +0 -7
  18. package/accordion-group/AccordionGroup.js +0 -149
  19. package/accordion-group/AccordionGroup.stories.tsx +0 -251
  20. package/accordion-group/AccordionGroup.test.js +0 -126
  21. package/accordion-group/types.d.ts +0 -79
  22. package/accordion-group/types.js +0 -5
  23. package/alert/Alert.d.ts +0 -4
  24. package/alert/Alert.js +0 -291
  25. package/alert/Alert.stories.tsx +0 -198
  26. package/alert/Alert.test.js +0 -92
  27. package/alert/types.d.ts +0 -49
  28. package/alert/types.js +0 -5
  29. package/badge/Badge.d.ts +0 -4
  30. package/badge/Badge.js +0 -61
  31. package/badge/types.d.ts +0 -5
  32. package/badge/types.js +0 -5
  33. package/bleed/Bleed.d.ts +0 -3
  34. package/bleed/Bleed.js +0 -51
  35. package/bleed/Bleed.stories.tsx +0 -342
  36. package/bleed/types.d.ts +0 -37
  37. package/bleed/types.js +0 -5
  38. package/box/Box.d.ts +0 -4
  39. package/box/Box.js +0 -114
  40. package/box/Box.stories.tsx +0 -147
  41. package/box/Box.test.js +0 -18
  42. package/box/types.d.ts +0 -44
  43. package/box/types.js +0 -5
  44. package/bulleted-list/BulletedList.d.ts +0 -7
  45. package/bulleted-list/BulletedList.js +0 -125
  46. package/bulleted-list/BulletedList.stories.tsx +0 -206
  47. package/bulleted-list/types.d.ts +0 -11
  48. package/bulleted-list/types.js +0 -5
  49. package/button/Button.d.ts +0 -4
  50. package/button/Button.js +0 -153
  51. package/button/Button.stories.tsx +0 -425
  52. package/button/Button.test.js +0 -35
  53. package/button/types.d.ts +0 -53
  54. package/button/types.js +0 -5
  55. package/card/Card.d.ts +0 -4
  56. package/card/Card.js +0 -160
  57. package/card/Card.stories.tsx +0 -200
  58. package/card/Card.test.js +0 -50
  59. package/card/ice-cream.jpg +0 -0
  60. package/card/types.d.ts +0 -68
  61. package/card/types.js +0 -5
  62. package/checkbox/Checkbox.d.ts +0 -4
  63. package/checkbox/Checkbox.js +0 -250
  64. package/checkbox/Checkbox.stories.tsx +0 -260
  65. package/checkbox/Checkbox.test.js +0 -155
  66. package/checkbox/types.d.ts +0 -68
  67. package/checkbox/types.js +0 -5
  68. package/chip/Chip.d.ts +0 -4
  69. package/chip/Chip.js +0 -153
  70. package/chip/Chip.stories.tsx +0 -206
  71. package/chip/Chip.test.js +0 -54
  72. package/chip/types.d.ts +0 -45
  73. package/chip/types.js +0 -5
  74. package/common/OpenSans.css +0 -69
  75. package/common/coreTokens.d.ts +0 -146
  76. package/common/coreTokens.js +0 -167
  77. package/common/fonts/OpenSans-Bold.ttf +0 -0
  78. package/common/fonts/OpenSans-BoldItalic.ttf +0 -0
  79. package/common/fonts/OpenSans-ExtraBold.ttf +0 -0
  80. package/common/fonts/OpenSans-ExtraBoldItalic.ttf +0 -0
  81. package/common/fonts/OpenSans-Italic.ttf +0 -0
  82. package/common/fonts/OpenSans-Light.ttf +0 -0
  83. package/common/fonts/OpenSans-LightItalic.ttf +0 -0
  84. package/common/fonts/OpenSans-Regular.ttf +0 -0
  85. package/common/fonts/OpenSans-SemiBold.ttf +0 -0
  86. package/common/fonts/OpenSans-SemiBoldItalic.ttf +0 -0
  87. package/common/utils.d.ts +0 -1
  88. package/common/utils.js +0 -22
  89. package/common/variables.d.ts +0 -1482
  90. package/common/variables.js +0 -1361
  91. package/date-input/Calendar.d.ts +0 -4
  92. package/date-input/Calendar.js +0 -258
  93. package/date-input/DateInput.d.ts +0 -4
  94. package/date-input/DateInput.js +0 -269
  95. package/date-input/DateInput.stories.tsx +0 -304
  96. package/date-input/DateInput.test.js +0 -835
  97. package/date-input/DatePicker.d.ts +0 -4
  98. package/date-input/DatePicker.js +0 -146
  99. package/date-input/Icons.d.ts +0 -6
  100. package/date-input/Icons.js +0 -75
  101. package/date-input/YearPicker.d.ts +0 -4
  102. package/date-input/YearPicker.js +0 -126
  103. package/date-input/types.d.ts +0 -158
  104. package/date-input/types.js +0 -5
  105. package/dialog/Dialog.d.ts +0 -4
  106. package/dialog/Dialog.js +0 -149
  107. package/dialog/Dialog.stories.tsx +0 -319
  108. package/dialog/Dialog.test.js +0 -369
  109. package/dialog/types.d.ts +0 -44
  110. package/dialog/types.js +0 -5
  111. package/dropdown/Dropdown.d.ts +0 -4
  112. package/dropdown/Dropdown.js +0 -388
  113. package/dropdown/Dropdown.stories.tsx +0 -438
  114. package/dropdown/Dropdown.test.js +0 -586
  115. package/dropdown/DropdownMenu.d.ts +0 -4
  116. package/dropdown/DropdownMenu.js +0 -74
  117. package/dropdown/DropdownMenuItem.d.ts +0 -4
  118. package/dropdown/DropdownMenuItem.js +0 -79
  119. package/dropdown/types.d.ts +0 -100
  120. package/dropdown/types.js +0 -5
  121. package/file-input/FileInput.d.ts +0 -4
  122. package/file-input/FileInput.js +0 -547
  123. package/file-input/FileInput.stories.tsx +0 -618
  124. package/file-input/FileInput.test.js +0 -457
  125. package/file-input/FileItem.d.ts +0 -4
  126. package/file-input/FileItem.js +0 -162
  127. package/file-input/types.d.ts +0 -129
  128. package/file-input/types.js +0 -5
  129. package/flex/Flex.d.ts +0 -4
  130. package/flex/Flex.js +0 -71
  131. package/flex/Flex.stories.tsx +0 -112
  132. package/flex/types.d.ts +0 -97
  133. package/flex/types.js +0 -5
  134. package/footer/Footer.d.ts +0 -4
  135. package/footer/Footer.js +0 -183
  136. package/footer/Footer.stories.tsx +0 -228
  137. package/footer/Footer.test.js +0 -97
  138. package/footer/Icons.d.ts +0 -2
  139. package/footer/Icons.js +0 -77
  140. package/footer/types.d.ts +0 -66
  141. package/footer/types.js +0 -5
  142. package/grid/Grid.d.ts +0 -7
  143. package/grid/Grid.js +0 -91
  144. package/grid/Grid.stories.tsx +0 -219
  145. package/grid/types.d.ts +0 -115
  146. package/grid/types.js +0 -5
  147. package/header/Header.d.ts +0 -8
  148. package/header/Header.js +0 -303
  149. package/header/Header.stories.tsx +0 -315
  150. package/header/Header.test.js +0 -79
  151. package/header/Icons.d.ts +0 -2
  152. package/header/Icons.js +0 -34
  153. package/header/types.d.ts +0 -48
  154. package/header/types.js +0 -5
  155. package/heading/Heading.d.ts +0 -4
  156. package/heading/Heading.js +0 -159
  157. package/heading/Heading.stories.tsx +0 -54
  158. package/heading/Heading.test.js +0 -186
  159. package/heading/types.d.ts +0 -33
  160. package/heading/types.js +0 -5
  161. package/inset/Inset.d.ts +0 -3
  162. package/inset/Inset.js +0 -51
  163. package/inset/Inset.stories.tsx +0 -230
  164. package/inset/types.d.ts +0 -37
  165. package/inset/types.js +0 -5
  166. package/layout/ApplicationLayout.d.ts +0 -20
  167. package/layout/ApplicationLayout.js +0 -171
  168. package/layout/ApplicationLayout.stories.tsx +0 -162
  169. package/layout/Icons.d.ts +0 -5
  170. package/layout/Icons.js +0 -66
  171. package/layout/SidenavContext.d.ts +0 -5
  172. package/layout/SidenavContext.js +0 -19
  173. package/layout/types.d.ts +0 -41
  174. package/layout/types.js +0 -5
  175. package/link/Link.d.ts +0 -4
  176. package/link/Link.js +0 -136
  177. package/link/Link.stories.tsx +0 -253
  178. package/link/Link.test.js +0 -81
  179. package/link/types.d.ts +0 -54
  180. package/link/types.js +0 -5
  181. package/main.d.ts +0 -45
  182. package/main.js +0 -377
  183. package/nav-tabs/NavTabs.d.ts +0 -8
  184. package/nav-tabs/NavTabs.js +0 -125
  185. package/nav-tabs/NavTabs.stories.tsx +0 -260
  186. package/nav-tabs/NavTabs.test.js +0 -82
  187. package/nav-tabs/Tab.d.ts +0 -4
  188. package/nav-tabs/Tab.js +0 -150
  189. package/nav-tabs/types.d.ts +0 -53
  190. package/nav-tabs/types.js +0 -5
  191. package/number-input/NumberInput.d.ts +0 -4
  192. package/number-input/NumberInput.js +0 -76
  193. package/number-input/NumberInput.stories.tsx +0 -115
  194. package/number-input/NumberInput.test.js +0 -542
  195. package/number-input/NumberInputContext.d.ts +0 -4
  196. package/number-input/NumberInputContext.js +0 -19
  197. package/number-input/numberInputContextTypes.d.ts +0 -19
  198. package/number-input/numberInputContextTypes.js +0 -5
  199. package/number-input/types.d.ts +0 -124
  200. package/number-input/types.js +0 -5
  201. package/paginator/Icons.d.ts +0 -5
  202. package/paginator/Icons.js +0 -54
  203. package/paginator/Paginator.d.ts +0 -4
  204. package/paginator/Paginator.js +0 -163
  205. package/paginator/Paginator.stories.tsx +0 -87
  206. package/paginator/Paginator.test.js +0 -305
  207. package/paginator/types.d.ts +0 -38
  208. package/paginator/types.js +0 -5
  209. package/paragraph/Paragraph.d.ts +0 -5
  210. package/paragraph/Paragraph.js +0 -38
  211. package/paragraph/Paragraph.stories.tsx +0 -44
  212. package/password-input/PasswordInput.d.ts +0 -4
  213. package/password-input/PasswordInput.js +0 -166
  214. package/password-input/PasswordInput.stories.tsx +0 -131
  215. package/password-input/PasswordInput.test.js +0 -181
  216. package/password-input/types.d.ts +0 -110
  217. package/password-input/types.js +0 -5
  218. package/progress-bar/ProgressBar.d.ts +0 -4
  219. package/progress-bar/ProgressBar.js +0 -176
  220. package/progress-bar/ProgressBar.stories.jsx +0 -93
  221. package/progress-bar/ProgressBar.test.js +0 -110
  222. package/progress-bar/types.d.ts +0 -37
  223. package/progress-bar/types.js +0 -5
  224. package/quick-nav/QuickNav.d.ts +0 -4
  225. package/quick-nav/QuickNav.js +0 -117
  226. package/quick-nav/QuickNav.stories.tsx +0 -356
  227. package/quick-nav/types.d.ts +0 -21
  228. package/quick-nav/types.js +0 -5
  229. package/radio-group/Radio.d.ts +0 -4
  230. package/radio-group/Radio.js +0 -156
  231. package/radio-group/RadioGroup.d.ts +0 -4
  232. package/radio-group/RadioGroup.js +0 -283
  233. package/radio-group/RadioGroup.stories.tsx +0 -214
  234. package/radio-group/RadioGroup.test.js +0 -722
  235. package/radio-group/types.d.ts +0 -114
  236. package/radio-group/types.js +0 -5
  237. package/resultsetTable/Icons.d.ts +0 -7
  238. package/resultsetTable/Icons.js +0 -51
  239. package/resultsetTable/ResultsetTable.d.ts +0 -4
  240. package/resultsetTable/ResultsetTable.js +0 -195
  241. package/resultsetTable/ResultsetTable.stories.tsx +0 -300
  242. package/resultsetTable/ResultsetTable.test.js +0 -325
  243. package/resultsetTable/types.d.ts +0 -67
  244. package/resultsetTable/types.js +0 -5
  245. package/select/Icons.d.ts +0 -10
  246. package/select/Icons.js +0 -93
  247. package/select/Listbox.d.ts +0 -4
  248. package/select/Listbox.js +0 -169
  249. package/select/Option.d.ts +0 -4
  250. package/select/Option.js +0 -97
  251. package/select/Select.d.ts +0 -4
  252. package/select/Select.js +0 -666
  253. package/select/Select.stories.tsx +0 -971
  254. package/select/Select.test.js +0 -2228
  255. package/select/types.d.ts +0 -210
  256. package/select/types.js +0 -5
  257. package/sidenav/Icons.d.ts +0 -7
  258. package/sidenav/Icons.js +0 -51
  259. package/sidenav/Sidenav.d.ts +0 -10
  260. package/sidenav/Sidenav.js +0 -238
  261. package/sidenav/Sidenav.stories.tsx +0 -282
  262. package/sidenav/Sidenav.test.js +0 -44
  263. package/sidenav/types.d.ts +0 -76
  264. package/sidenav/types.js +0 -5
  265. package/slider/Slider.d.ts +0 -4
  266. package/slider/Slider.js +0 -342
  267. package/slider/Slider.stories.tsx +0 -240
  268. package/slider/Slider.test.js +0 -250
  269. package/slider/types.d.ts +0 -86
  270. package/slider/types.js +0 -5
  271. package/spinner/Spinner.d.ts +0 -4
  272. package/spinner/Spinner.js +0 -244
  273. package/spinner/Spinner.stories.jsx +0 -129
  274. package/spinner/Spinner.test.js +0 -64
  275. package/spinner/types.d.ts +0 -32
  276. package/spinner/types.js +0 -5
  277. package/switch/Switch.d.ts +0 -4
  278. package/switch/Switch.js +0 -262
  279. package/switch/Switch.stories.tsx +0 -171
  280. package/switch/Switch.test.js +0 -225
  281. package/switch/types.d.ts +0 -66
  282. package/switch/types.js +0 -5
  283. package/table/Table.d.ts +0 -4
  284. package/table/Table.js +0 -118
  285. package/table/Table.stories.jsx +0 -356
  286. package/table/Table.test.js +0 -26
  287. package/table/types.d.ts +0 -21
  288. package/table/types.js +0 -5
  289. package/tabs/Tab.d.ts +0 -4
  290. package/tabs/Tab.js +0 -132
  291. package/tabs/Tabs.d.ts +0 -4
  292. package/tabs/Tabs.js +0 -461
  293. package/tabs/Tabs.stories.tsx +0 -226
  294. package/tabs/Tabs.test.js +0 -350
  295. package/tabs/types.d.ts +0 -92
  296. package/tabs/types.js +0 -5
  297. package/tag/Tag.d.ts +0 -4
  298. package/tag/Tag.js +0 -181
  299. package/tag/Tag.stories.tsx +0 -155
  300. package/tag/Tag.test.js +0 -60
  301. package/tag/types.d.ts +0 -69
  302. package/tag/types.js +0 -5
  303. package/text-input/Icons.d.ts +0 -8
  304. package/text-input/Icons.js +0 -60
  305. package/text-input/Suggestion.d.ts +0 -4
  306. package/text-input/Suggestion.js +0 -84
  307. package/text-input/Suggestions.d.ts +0 -4
  308. package/text-input/Suggestions.js +0 -134
  309. package/text-input/TextInput.d.ts +0 -4
  310. package/text-input/TextInput.js +0 -673
  311. package/text-input/TextInput.stories.tsx +0 -569
  312. package/text-input/TextInput.test.js +0 -1723
  313. package/text-input/types.d.ts +0 -197
  314. package/text-input/types.js +0 -5
  315. package/textarea/Textarea.d.ts +0 -4
  316. package/textarea/Textarea.js +0 -276
  317. package/textarea/Textarea.stories.jsx +0 -216
  318. package/textarea/Textarea.test.js +0 -435
  319. package/textarea/types.d.ts +0 -137
  320. package/textarea/types.js +0 -5
  321. package/toggle-group/ToggleGroup.d.ts +0 -4
  322. package/toggle-group/ToggleGroup.js +0 -218
  323. package/toggle-group/ToggleGroup.stories.tsx +0 -215
  324. package/toggle-group/ToggleGroup.test.js +0 -156
  325. package/toggle-group/types.d.ts +0 -105
  326. package/toggle-group/types.js +0 -5
  327. package/typography/Typography.d.ts +0 -4
  328. package/typography/Typography.js +0 -32
  329. package/typography/Typography.stories.tsx +0 -198
  330. package/typography/types.d.ts +0 -18
  331. package/typography/types.js +0 -5
  332. package/useTheme.d.ts +0 -1235
  333. package/useTheme.js +0 -22
  334. package/useTranslatedLabels.d.ts +0 -85
  335. package/useTranslatedLabels.js +0 -20
  336. package/utils/BaseTypography.d.ts +0 -21
  337. package/utils/BaseTypography.js +0 -108
  338. package/utils/FocusLock.d.ts +0 -13
  339. package/utils/FocusLock.js +0 -139
  340. package/wizard/Wizard.d.ts +0 -4
  341. package/wizard/Wizard.js +0 -285
  342. package/wizard/Wizard.stories.tsx +0 -253
  343. package/wizard/Wizard.test.js +0 -141
  344. package/wizard/types.d.ts +0 -64
  345. package/wizard/types.js +0 -5
@@ -1,198 +0,0 @@
1
- import React from "react";
2
- import DxcAlert from "./Alert";
3
- import Title from "../../.storybook/components/Title";
4
- import ExampleContainer from "../../.storybook/components/ExampleContainer";
5
- import { HalstackProvider } from "../HalstackContext";
6
-
7
- export default {
8
- title: "Alert",
9
- component: DxcAlert,
10
- };
11
-
12
- const opinionatedTheme = {
13
- alert: {
14
- baseColor: "#e6f4ff",
15
- accentColor: "#0067b3",
16
- overlayColor: "#000000b3",
17
- },
18
- };
19
-
20
- export const Chromatic = () => (
21
- <>
22
- <ExampleContainer>
23
- <Title title="Info" theme="light" level={4} />
24
- <DxcAlert inlineText="Info type alert with inline text." />
25
- </ExampleContainer>
26
- <ExampleContainer>
27
- <Title title="Confirm" theme="light" level={4} />
28
- <DxcAlert type="confirm" inlineText="Confirm type alert with inline text." />
29
- </ExampleContainer>
30
- <ExampleContainer>
31
- <Title title="Warning" theme="light" level={4} />
32
- <DxcAlert type="warning" inlineText="Warning type alert with inline text." />
33
- </ExampleContainer>
34
- <ExampleContainer>
35
- <Title title="Error" theme="light" level={4} />
36
- <DxcAlert type="error" inlineText="Error type alert with inline text." />
37
- </ExampleContainer>
38
- <ExampleContainer>
39
- <Title title="With close button" theme="light" level={4} />
40
- <DxcAlert inlineText="Info type alert with inline text and close button." onClose={() => {}} />
41
- </ExampleContainer>
42
- <ExampleContainer pseudoState="pseudo-hover">
43
- <Title title="With hovered close button" theme="light" level={4} />
44
- <DxcAlert inlineText="Info type alert with inline text and close button." onClose={() => {}} />
45
- </ExampleContainer>
46
- <ExampleContainer pseudoState="pseudo-focus">
47
- <Title title="With focused close button" theme="light" level={4} />
48
- <DxcAlert inlineText="Info type alert with inline text and close button." onClose={() => {}} />
49
- </ExampleContainer>
50
- <ExampleContainer pseudoState="pseudo-active">
51
- <Title title="With actived close button" theme="light" level={4} />
52
- <DxcAlert inlineText="Info type alert with inline text and close button." onClose={() => {}} />
53
- </ExampleContainer>
54
- <ExampleContainer>
55
- <Title title="With children" theme="light" level={4} />
56
- <DxcAlert>
57
- <div>
58
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo
59
- lobortis eget.
60
- </div>
61
- </DxcAlert>
62
- </ExampleContainer>
63
- <ExampleContainer>
64
- <Title title="With inline text and children" theme="light" level={4} />
65
- <DxcAlert inlineText="Info type alert with inline text.">
66
- <div>
67
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo
68
- lobortis eget.
69
- </div>
70
- </DxcAlert>
71
- </ExampleContainer>
72
- <Title title="Margins" theme="light" level={2} />
73
- <ExampleContainer>
74
- <Title title="Xxsmall" theme="light" level={4} />
75
- <DxcAlert margin="xxsmall" inlineText="Info type alert with inline text and xxsmall margin." />
76
- </ExampleContainer>
77
- <ExampleContainer>
78
- <Title title="Xsmall" theme="light" level={4} />
79
- <DxcAlert margin="xsmall" inlineText="Info type alert with inline text and xsmall margin." />
80
- </ExampleContainer>
81
- <ExampleContainer>
82
- <Title title="Small" theme="light" level={4} />
83
- <DxcAlert margin="small" inlineText="Info type alert with inline text and small margin." />
84
- </ExampleContainer>
85
- <ExampleContainer>
86
- <Title title="Medium" theme="light" level={4} />
87
- <DxcAlert margin="medium" inlineText="Info type alert with inline text and medium margin." />
88
- </ExampleContainer>
89
- <ExampleContainer>
90
- <Title title="Large" theme="light" level={4} />
91
- <DxcAlert margin="large" inlineText="Info type alert with inline text and large margin." />
92
- </ExampleContainer>
93
- <ExampleContainer>
94
- <Title title="Xlarge" theme="light" level={4} />
95
- <DxcAlert margin="xlarge" inlineText="Info type alert with inline text and xlarge margin." />
96
- </ExampleContainer>
97
- <ExampleContainer>
98
- <Title title="Xxlarge" theme="light" level={4} />
99
- <DxcAlert margin="xxlarge" inlineText="Info type alert with inline text and xxlarge margin." />
100
- </ExampleContainer>
101
- <Title title="Sizes" theme="light" level={2} />
102
- <ExampleContainer>
103
- <Title title="FitContent" theme="light" level={4} />
104
- <DxcAlert
105
- size="fitContent"
106
- inlineText="Info type alert with inline text, children, close button and fitContent size."
107
- onClose={() => {}}
108
- >
109
- <div>
110
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo
111
- lobortis eget.
112
- </div>
113
- </DxcAlert>
114
- </ExampleContainer>
115
- <ExampleContainer>
116
- <Title title="Small" theme="light" level={4} />
117
- <DxcAlert
118
- size="small"
119
- inlineText="Info type alert with inline text, children, close button and small size."
120
- onClose={() => {}}
121
- >
122
- <div>
123
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo
124
- lobortis eget.
125
- </div>
126
- </DxcAlert>
127
- </ExampleContainer>
128
- <ExampleContainer>
129
- <Title title="Medium" theme="light" level={4} />
130
- <DxcAlert
131
- size="medium"
132
- inlineText="Info type alert with inline text, children, close button and medium size."
133
- onClose={() => {}}
134
- >
135
- <div>
136
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo
137
- lobortis eget.
138
- </div>
139
- </DxcAlert>
140
- </ExampleContainer>
141
- <ExampleContainer>
142
- <Title title="Large" theme="light" level={4} />
143
- <DxcAlert
144
- size="large"
145
- inlineText="Info type alert with inline text, children, close button and large size."
146
- onClose={() => {}}
147
- >
148
- <div>
149
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo
150
- lobortis eget.
151
- </div>
152
- </DxcAlert>
153
- </ExampleContainer>
154
- <ExampleContainer>
155
- <Title title="FillParent" theme="light" level={4} />
156
- <DxcAlert
157
- size="fillParent"
158
- inlineText="Info type alert with inline text, children, close button and fillParent size."
159
- onClose={() => {}}
160
- >
161
- <div>
162
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo
163
- lobortis eget.
164
- </div>
165
- </DxcAlert>
166
- </ExampleContainer>
167
- <Title title="Opinionated theme" theme="light" level={2} />
168
- <ExampleContainer>
169
- <HalstackProvider theme={opinionatedTheme}>
170
- <DxcAlert inlineText="Info type alert with inline text." />
171
- </HalstackProvider>
172
- </ExampleContainer>
173
- </>
174
- );
175
-
176
- export const ModalAlert = () => (
177
- <ExampleContainer>
178
- <DxcAlert inlineText="Modal alert." mode="modal" onClose={() => {}}>
179
- <div>
180
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo
181
- lobortis eget.
182
- </div>
183
- </DxcAlert>
184
- </ExampleContainer>
185
- );
186
-
187
- export const ModalAlertOpinionated = () => (
188
- <ExampleContainer>
189
- <HalstackProvider theme={opinionatedTheme}>
190
- <DxcAlert inlineText="Modal alert." mode="modal" onClose={() => {}}>
191
- <div>
192
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo
193
- lobortis eget.
194
- </div>
195
- </DxcAlert>
196
- </HalstackProvider>
197
- </ExampleContainer>
198
- );
@@ -1,92 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- var _react = _interopRequireDefault(require("react"));
6
-
7
- var _react2 = require("@testing-library/react");
8
-
9
- var _Alert = _interopRequireDefault(require("./Alert.tsx"));
10
-
11
- describe("Alert component tests", function () {
12
- test("Info alert renders with correct text", function () {
13
- var _render = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Alert["default"], {
14
- type: "info",
15
- inlineText: "info-alert-text"
16
- })),
17
- getByText = _render.getByText;
18
-
19
- expect(getByText("information")).toBeTruthy();
20
- expect(getByText("info-alert-text")).toBeTruthy();
21
- });
22
- test("Confirm alert renders with correct text", function () {
23
- var _render2 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Alert["default"], {
24
- type: "confirm",
25
- inlineText: "confirm-alert-text"
26
- })),
27
- getByText = _render2.getByText;
28
-
29
- expect(getByText("success")).toBeTruthy();
30
- expect(getByText("confirm-alert-text")).toBeTruthy();
31
- });
32
- test("Warning alert renders with correct text", function () {
33
- var _render3 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Alert["default"], {
34
- type: "warning",
35
- inlineText: "warning-alert-text"
36
- })),
37
- getByText = _render3.getByText;
38
-
39
- expect(getByText("warning")).toBeTruthy();
40
- expect(getByText("warning-alert-text")).toBeTruthy();
41
- });
42
- test("Error alert renders with correct text", function () {
43
- var _render4 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Alert["default"], {
44
- type: "error",
45
- inlineText: "error-alert-text"
46
- })),
47
- getByText = _render4.getByText;
48
-
49
- expect(getByText("error")).toBeTruthy();
50
- expect(getByText("error-alert-text")).toBeTruthy();
51
- });
52
- test("Alert renders with correct children", function () {
53
- var _render5 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Alert["default"], {
54
- inlineText: "alert-text"
55
- }, /*#__PURE__*/_react["default"].createElement("p", null, "sample-children"))),
56
- getByText = _render5.getByText;
57
-
58
- expect(getByText("alert-text")).toBeTruthy();
59
- expect(getByText("sample-children")).toBeTruthy();
60
- });
61
- test("Calls correct function on close", function () {
62
- var onClose = jest.fn();
63
-
64
- var _render6 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Alert["default"], {
65
- onClose: onClose,
66
- inlineText: "info-alert-text"
67
- })),
68
- getByRole = _render6.getByRole;
69
-
70
- var closeButton = getByRole("button");
71
-
72
- _react2.fireEvent.click(closeButton);
73
-
74
- expect(onClose).toHaveBeenCalled();
75
- });
76
- test("Modal alert calls correct function on close", function () {
77
- var onClose = jest.fn();
78
-
79
- var _render7 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Alert["default"], {
80
- onClose: onClose,
81
- mode: "modal",
82
- inlineText: "info-alert-text"
83
- })),
84
- getByRole = _render7.getByRole;
85
-
86
- var closeButton = getByRole("button");
87
-
88
- _react2.fireEvent.click(closeButton);
89
-
90
- expect(onClose).toHaveBeenCalled();
91
- });
92
- });
package/alert/types.d.ts DELETED
@@ -1,49 +0,0 @@
1
- /// <reference types="react" />
2
- declare type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
3
- declare type Margin = {
4
- top?: Space;
5
- bottom?: Space;
6
- left?: Space;
7
- right?: Space;
8
- };
9
- declare type Props = {
10
- /**
11
- * Uses on of the available alert types.
12
- */
13
- type?: "info" | "confirm" | "warning" | "error";
14
- /**
15
- * Uses on of the available alert modes:
16
- * 'inline': If onClose function is received, close button will be visible and the function will be executed when it's clicked.
17
- * There is no overlay layer. Position should be decided by the user.
18
- * 'modal': The alert will be displayed in the middle of the screen with an overlay layer behind.
19
- * The onClose function will be executed when the X button or the overlay is clicked. d
20
- * The user has the responsibility of hidding the modal in the onClose function, otherwise the modal will remain visible.
21
- */
22
- mode?: "inline" | "modal";
23
- /**
24
- * Text to display after icon and alert type and before content.
25
- */
26
- inlineText?: string;
27
- /**
28
- * This function will be called when the user clicks the close button. If there is no function we should close the alert by default.
29
- */
30
- onClose?: () => void;
31
- /**
32
- * The details section of the alert. Can be used to render custom content in this area.
33
- */
34
- children?: React.ReactNode;
35
- /**
36
- * Size of the margin to be applied to the component ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
37
- * You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different margin sizes.
38
- */
39
- margin?: Space | Margin;
40
- /**
41
- * Size of the component.
42
- */
43
- size?: "small" | "medium" | "large" | "fillParent" | "fitContent";
44
- /**
45
- * Tabindex value given to the close button.
46
- */
47
- tabIndex?: number;
48
- };
49
- export default Props;
package/alert/types.js DELETED
@@ -1,5 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
package/badge/Badge.d.ts DELETED
@@ -1,4 +0,0 @@
1
- /// <reference types="react" />
2
- import BadgePropsType from "./types";
3
- declare const DxcBadge: ({ notificationText, disabled }: BadgePropsType) => JSX.Element;
4
- export default DxcBadge;
package/badge/Badge.js DELETED
@@ -1,61 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- var _typeof = require("@babel/runtime/helpers/typeof");
6
-
7
- Object.defineProperty(exports, "__esModule", {
8
- value: true
9
- });
10
- exports["default"] = void 0;
11
-
12
- var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
13
-
14
- var _react = _interopRequireDefault(require("react"));
15
-
16
- var _styledComponents = _interopRequireWildcard(require("styled-components"));
17
-
18
- var _useTheme = _interopRequireDefault(require("../useTheme"));
19
-
20
- var _templateObject;
21
-
22
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
23
-
24
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
25
-
26
- var DxcBadge = function DxcBadge(_ref) {
27
- var notificationText = _ref.notificationText,
28
- disabled = _ref.disabled;
29
- var colorsTheme = (0, _useTheme["default"])();
30
- return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
31
- theme: colorsTheme.tabs
32
- }, /*#__PURE__*/_react["default"].createElement(StyledDxcBadge, {
33
- notificationText: notificationText,
34
- disabled: disabled
35
- }, /*#__PURE__*/_react["default"].createElement("span", null, notificationText)));
36
- };
37
-
38
- var StyledDxcBadge = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n background-color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n letter-spacing: ", ";\n width: ", ";\n height: ", ";\n border-radius: ", ";\n display: flex;\n padding-bottom: 1px;\n padding-right: 1px;\n flex-wrap: wrap;\n box-sizing: border-box;\n align-items: center;\n line-height: 1;\n align-content: center;\n flex-direction: row;\n justify-content: center;\n"])), function (props) {
39
- return props.disabled ? props.theme.disabledBadgeBackgroundColor : props.theme.badgeBackgroundColor;
40
- }, function (props) {
41
- return props.theme.badgeFontFamily;
42
- }, function (props) {
43
- return props.theme.badgeFontSize;
44
- }, function (props) {
45
- return props.theme.badgeFontStyle;
46
- }, function (props) {
47
- return props.theme.badgeFontWeight;
48
- }, function (props) {
49
- return props.theme.badgeFontColor;
50
- }, function (props) {
51
- return props.theme.badgeLetterSpacing;
52
- }, function (props) {
53
- return props.notificationText === true ? props.theme.badgeWidth : props.theme.badgeWidthWithNotificationNumber;
54
- }, function (props) {
55
- return props.notificationText === true ? props.theme.badgeHeight : props.theme.badgeHeightWithNotificationNumber;
56
- }, function (props) {
57
- return props.notificationText === true ? props.theme.badgeRadius : props.theme.badgeRadiusWithNotificationNumber;
58
- });
59
-
60
- var _default = DxcBadge;
61
- exports["default"] = _default;
package/badge/types.d.ts DELETED
@@ -1,5 +0,0 @@
1
- declare type Props = {
2
- notificationText: boolean | number | string;
3
- disabled?: boolean;
4
- };
5
- export default Props;
package/badge/types.js DELETED
@@ -1,5 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
package/bleed/Bleed.d.ts DELETED
@@ -1,3 +0,0 @@
1
- /// <reference types="react" />
2
- import BleedPropsType from "./types";
3
- export default function Bleed({ space, horizontal, vertical, top, right, bottom, left, children, }: BleedPropsType): JSX.Element;
package/bleed/Bleed.js DELETED
@@ -1,51 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports["default"] = Bleed;
9
-
10
- var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
11
-
12
- var _react = _interopRequireDefault(require("react"));
13
-
14
- var _styledComponents = _interopRequireDefault(require("styled-components"));
15
-
16
- var _templateObject;
17
-
18
- function Bleed(_ref) {
19
- var space = _ref.space,
20
- horizontal = _ref.horizontal,
21
- vertical = _ref.vertical,
22
- top = _ref.top,
23
- right = _ref.right,
24
- bottom = _ref.bottom,
25
- left = _ref.left,
26
- children = _ref.children;
27
- return /*#__PURE__*/_react["default"].createElement(StyledBleed, {
28
- space: space,
29
- horizontal: horizontal,
30
- vertical: vertical,
31
- top: top,
32
- right: right,
33
- bottom: bottom,
34
- left: left
35
- }, children);
36
- }
37
-
38
- function getSpacingValue(spacingName) {
39
- return spacingName ? spacingName : "0rem";
40
- }
41
-
42
- var StyledBleed = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n ", "\n"])), function (_ref2) {
43
- var space = _ref2.space,
44
- horizontal = _ref2.horizontal,
45
- vertical = _ref2.vertical,
46
- top = _ref2.top,
47
- right = _ref2.right,
48
- bottom = _ref2.bottom,
49
- left = _ref2.left;
50
- return "\n margin: -".concat(getSpacingValue(top || vertical || space), " -").concat(getSpacingValue(right || horizontal || space), " -").concat(getSpacingValue(bottom || vertical || space), " -").concat(getSpacingValue(left || horizontal || space), ";\n");
51
- });