@dxc-technology/halstack-react 0.0.0-4e1277a → 0.0.0-4e3dbad

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 (363) hide show
  1. package/BackgroundColorContext.js +1 -1
  2. package/HalstackContext.d.ts +42 -5
  3. package/HalstackContext.js +28 -18
  4. package/accordion/Accordion.accessibility.test.d.ts +1 -0
  5. package/accordion/Accordion.accessibility.test.js +71 -0
  6. package/accordion/Accordion.js +16 -30
  7. package/accordion/Accordion.stories.tsx +7 -49
  8. package/accordion/Accordion.test.d.ts +1 -0
  9. package/accordion/Accordion.test.js +3 -3
  10. package/accordion/types.d.ts +1 -1
  11. package/accordion-group/AccordionGroup.accessibility.test.d.ts +1 -0
  12. package/accordion-group/AccordionGroup.accessibility.test.js +82 -0
  13. package/accordion-group/AccordionGroup.js +1 -1
  14. package/accordion-group/AccordionGroup.stories.tsx +23 -23
  15. package/accordion-group/AccordionGroup.test.d.ts +1 -0
  16. package/accordion-group/AccordionGroup.test.js +5 -9
  17. package/accordion-group/AccordionGroupAccordion.js +1 -1
  18. package/accordion-group/types.d.ts +1 -1
  19. package/action-icon/ActionIcon.accessibility.test.d.ts +1 -0
  20. package/action-icon/ActionIcon.accessibility.test.js +63 -0
  21. package/action-icon/ActionIcon.js +4 -3
  22. package/action-icon/ActionIcon.stories.tsx +3 -3
  23. package/action-icon/ActionIcon.test.d.ts +1 -0
  24. package/action-icon/ActionIcon.test.js +1 -1
  25. package/action-icon/types.d.ts +1 -1
  26. package/alert/Alert.accessibility.test.d.ts +1 -0
  27. package/alert/Alert.accessibility.test.js +95 -0
  28. package/alert/Alert.js +21 -72
  29. package/alert/Alert.test.d.ts +1 -0
  30. package/alert/Alert.test.js +1 -1
  31. package/badge/Badge.accessibility.test.d.ts +1 -0
  32. package/badge/Badge.accessibility.test.js +129 -0
  33. package/badge/Badge.js +6 -4
  34. package/badge/Badge.stories.tsx +11 -11
  35. package/badge/Badge.test.d.ts +1 -0
  36. package/badge/Badge.test.js +2 -2
  37. package/badge/types.d.ts +1 -1
  38. package/bar-chart/BarChart.d.ts +4 -0
  39. package/bar-chart/BarChart.js +152 -0
  40. package/bar-chart/BarChart.stories.tsx +281 -0
  41. package/bar-chart/BarChart.test.d.ts +1 -0
  42. package/bar-chart/BarChart.test.js +194 -0
  43. package/bar-chart/theme.d.ts +3 -0
  44. package/bar-chart/theme.js +31 -0
  45. package/bar-chart/types.d.ts +118 -0
  46. package/bar-chart/types.js +5 -0
  47. package/bleed/Bleed.stories.tsx +0 -1
  48. package/box/Box.accessibility.test.d.ts +1 -0
  49. package/box/Box.accessibility.test.js +33 -0
  50. package/box/Box.js +1 -1
  51. package/box/Box.test.d.ts +1 -0
  52. package/box/Box.test.js +1 -1
  53. package/breadcrumbs/Breadcrumbs.accessibility.test.d.ts +1 -0
  54. package/breadcrumbs/Breadcrumbs.accessibility.test.js +96 -0
  55. package/breadcrumbs/Breadcrumbs.d.ts +4 -0
  56. package/breadcrumbs/Breadcrumbs.js +79 -0
  57. package/breadcrumbs/Breadcrumbs.stories.tsx +194 -0
  58. package/breadcrumbs/Breadcrumbs.test.d.ts +1 -0
  59. package/breadcrumbs/Breadcrumbs.test.js +168 -0
  60. package/breadcrumbs/Item.d.ts +4 -0
  61. package/breadcrumbs/Item.js +52 -0
  62. package/breadcrumbs/dropdownTheme.d.ts +53 -0
  63. package/breadcrumbs/dropdownTheme.js +62 -0
  64. package/breadcrumbs/types.d.ts +40 -0
  65. package/breadcrumbs/types.js +5 -0
  66. package/bulleted-list/BulletedList.accessibility.test.d.ts +1 -0
  67. package/bulleted-list/BulletedList.accessibility.test.js +119 -0
  68. package/bulleted-list/BulletedList.js +7 -4
  69. package/bulleted-list/BulletedList.stories.tsx +1 -1
  70. package/button/Button.accessibility.test.d.ts +1 -0
  71. package/button/Button.accessibility.test.js +127 -0
  72. package/button/Button.js +2 -2
  73. package/button/Button.stories.tsx +3 -4
  74. package/button/Button.test.d.ts +1 -0
  75. package/button/Button.test.js +1 -1
  76. package/card/Card.accessibility.test.d.ts +1 -0
  77. package/card/Card.accessibility.test.js +36 -0
  78. package/card/Card.js +3 -2
  79. package/card/Card.stories.tsx +1 -1
  80. package/card/Card.test.d.ts +1 -0
  81. package/card/Card.test.js +1 -1
  82. package/checkbox/Checkbox.accessibility.test.d.ts +1 -0
  83. package/checkbox/Checkbox.accessibility.test.js +87 -0
  84. package/checkbox/Checkbox.js +10 -13
  85. package/checkbox/Checkbox.test.d.ts +1 -0
  86. package/checkbox/Checkbox.test.js +1 -1
  87. package/chip/Chip.accessibility.test.d.ts +1 -0
  88. package/chip/Chip.accessibility.test.js +67 -0
  89. package/chip/Chip.js +11 -6
  90. package/chip/Chip.stories.tsx +6 -25
  91. package/chip/Chip.test.d.ts +1 -0
  92. package/chip/Chip.test.js +5 -5
  93. package/common/coreTokens.d.ts +0 -1
  94. package/common/coreTokens.js +3 -4
  95. package/common/variables.d.ts +48 -5
  96. package/common/variables.js +110 -73
  97. package/container/Container.stories.tsx +3 -3
  98. package/container/types.d.ts +113 -11
  99. package/contextual-menu/ContextualMenu.accessibility.test.d.ts +1 -0
  100. package/contextual-menu/ContextualMenu.accessibility.test.js +98 -0
  101. package/contextual-menu/ContextualMenu.d.ts +3 -5
  102. package/contextual-menu/ContextualMenu.js +118 -53
  103. package/contextual-menu/ContextualMenu.stories.tsx +124 -75
  104. package/contextual-menu/ContextualMenu.test.d.ts +1 -0
  105. package/contextual-menu/ContextualMenu.test.js +200 -24
  106. package/contextual-menu/GroupItem.d.ts +4 -0
  107. package/contextual-menu/GroupItem.js +67 -0
  108. package/contextual-menu/ItemAction.d.ts +4 -0
  109. package/contextual-menu/ItemAction.js +88 -0
  110. package/contextual-menu/MenuItem.d.ts +4 -0
  111. package/contextual-menu/MenuItem.js +29 -0
  112. package/contextual-menu/SingleItem.d.ts +4 -0
  113. package/contextual-menu/SingleItem.js +38 -0
  114. package/contextual-menu/types.d.ts +54 -11
  115. package/date-input/Calendar.js +47 -31
  116. package/date-input/DateInput.accessibility.test.d.ts +1 -0
  117. package/date-input/DateInput.accessibility.test.js +229 -0
  118. package/date-input/DateInput.js +28 -23
  119. package/date-input/DateInput.stories.tsx +18 -12
  120. package/date-input/DateInput.test.d.ts +1 -0
  121. package/date-input/DateInput.test.js +39 -39
  122. package/date-input/DatePicker.js +13 -7
  123. package/date-input/YearPicker.js +10 -5
  124. package/dialog/Dialog.accessibility.test.d.ts +1 -0
  125. package/dialog/Dialog.accessibility.test.js +69 -0
  126. package/dialog/Dialog.js +9 -20
  127. package/dialog/Dialog.stories.tsx +8 -4
  128. package/dialog/Dialog.test.d.ts +1 -0
  129. package/dialog/Dialog.test.js +112 -49
  130. package/divider/Divider.accessibility.test.d.ts +1 -0
  131. package/divider/Divider.accessibility.test.js +33 -0
  132. package/divider/Divider.stories.tsx +2 -1
  133. package/divider/Divider.test.d.ts +1 -0
  134. package/dropdown/Dropdown.accessibility.test.d.ts +1 -0
  135. package/dropdown/Dropdown.accessibility.test.js +183 -0
  136. package/dropdown/Dropdown.js +31 -66
  137. package/dropdown/Dropdown.stories.tsx +16 -27
  138. package/dropdown/Dropdown.test.d.ts +1 -0
  139. package/dropdown/Dropdown.test.js +101 -72
  140. package/dropdown/DropdownMenu.js +4 -4
  141. package/dropdown/DropdownMenuItem.js +8 -4
  142. package/dropdown/types.d.ts +2 -4
  143. package/file-input/FileInput.accessibility.test.d.ts +1 -0
  144. package/file-input/FileInput.accessibility.test.js +167 -0
  145. package/file-input/FileInput.js +6 -47
  146. package/file-input/FileInput.test.d.ts +1 -0
  147. package/file-input/FileInput.test.js +51 -106
  148. package/file-input/FileItem.js +18 -28
  149. package/file-input/types.d.ts +0 -4
  150. package/footer/Footer.accessibility.test.d.ts +1 -0
  151. package/footer/Footer.accessibility.test.js +125 -0
  152. package/footer/Footer.js +8 -6
  153. package/footer/Footer.stories.tsx +40 -3
  154. package/footer/Footer.test.d.ts +1 -0
  155. package/footer/Footer.test.js +1 -1
  156. package/footer/Icons.js +2 -30
  157. package/footer/types.d.ts +1 -1
  158. package/grid/Grid.stories.tsx +3 -1
  159. package/header/Header.accessibility.test.d.ts +1 -0
  160. package/header/Header.accessibility.test.js +94 -0
  161. package/header/Header.js +12 -22
  162. package/header/Header.stories.tsx +17 -1
  163. package/header/Header.test.d.ts +1 -0
  164. package/header/Header.test.js +1 -1
  165. package/header/Icons.js +1 -6
  166. package/heading/Heading.accessibility.test.d.ts +1 -0
  167. package/heading/Heading.accessibility.test.js +33 -0
  168. package/heading/Heading.js +1 -1
  169. package/heading/Heading.test.d.ts +1 -0
  170. package/heading/Heading.test.js +1 -14
  171. package/icon/Icon.accessibility.test.d.ts +1 -0
  172. package/icon/Icon.accessibility.test.js +30 -0
  173. package/icon/Icon.js +1 -1
  174. package/icon/Icon.stories.tsx +6 -4
  175. package/image/Image.accessibility.test.d.ts +1 -0
  176. package/image/Image.accessibility.test.js +56 -0
  177. package/image/Image.js +1 -1
  178. package/layout/ApplicationLayout.js +9 -6
  179. package/layout/Icons.d.ts +0 -1
  180. package/layout/Icons.js +1 -11
  181. package/link/Link.accessibility.test.d.ts +1 -0
  182. package/link/Link.accessibility.test.js +108 -0
  183. package/link/Link.js +8 -6
  184. package/link/Link.stories.tsx +4 -4
  185. package/link/Link.test.d.ts +1 -0
  186. package/link/Link.test.js +1 -1
  187. package/link/types.d.ts +1 -1
  188. package/main.d.ts +3 -1
  189. package/main.js +15 -1
  190. package/nav-tabs/NavTabs.accessibility.test.d.ts +1 -0
  191. package/nav-tabs/NavTabs.accessibility.test.js +44 -0
  192. package/nav-tabs/NavTabs.js +19 -4
  193. package/nav-tabs/NavTabs.stories.tsx +41 -23
  194. package/nav-tabs/NavTabs.test.d.ts +1 -0
  195. package/nav-tabs/NavTabs.test.js +10 -9
  196. package/nav-tabs/Tab.js +17 -18
  197. package/nav-tabs/types.d.ts +1 -1
  198. package/number-input/NumberInput.accessibility.test.d.ts +1 -0
  199. package/number-input/NumberInput.accessibility.test.js +227 -0
  200. package/number-input/NumberInput.js +6 -3
  201. package/number-input/NumberInput.stories.tsx +11 -16
  202. package/number-input/NumberInput.test.d.ts +1 -0
  203. package/number-input/NumberInput.test.js +6 -7
  204. package/package.json +34 -28
  205. package/paginator/Paginator.accessibility.test.d.ts +1 -0
  206. package/paginator/Paginator.accessibility.test.js +78 -0
  207. package/paginator/Paginator.js +13 -10
  208. package/paginator/Paginator.test.d.ts +1 -0
  209. package/paginator/Paginator.test.js +2 -3
  210. package/paragraph/Paragraph.accessibility.test.d.ts +1 -0
  211. package/paragraph/Paragraph.accessibility.test.js +28 -0
  212. package/password-input/PasswordInput.accessibility.test.d.ts +1 -0
  213. package/password-input/PasswordInput.accessibility.test.js +152 -0
  214. package/password-input/PasswordInput.js +11 -8
  215. package/password-input/PasswordInput.stories.tsx +10 -1
  216. package/password-input/PasswordInput.test.d.ts +1 -0
  217. package/password-input/PasswordInput.test.js +6 -7
  218. package/progress-bar/ProgressBar.accessibility.test.d.ts +1 -0
  219. package/progress-bar/ProgressBar.accessibility.test.js +35 -0
  220. package/progress-bar/ProgressBar.js +6 -4
  221. package/progress-bar/ProgressBar.test.d.ts +1 -0
  222. package/progress-bar/ProgressBar.test.js +1 -1
  223. package/quick-nav/QuickNav.accessibility.test.d.ts +1 -0
  224. package/quick-nav/QuickNav.accessibility.test.js +57 -0
  225. package/quick-nav/QuickNav.js +1 -1
  226. package/radio-group/Radio.js +6 -9
  227. package/radio-group/RadioGroup.accessibility.test.d.ts +1 -0
  228. package/radio-group/RadioGroup.accessibility.test.js +97 -0
  229. package/radio-group/RadioGroup.js +14 -16
  230. package/radio-group/RadioGroup.test.d.ts +1 -0
  231. package/radio-group/RadioGroup.test.js +3 -5
  232. package/resultset-table/ResultsetTable.accessibility.test.d.ts +1 -0
  233. package/resultset-table/ResultsetTable.accessibility.test.js +284 -0
  234. package/resultset-table/ResultsetTable.d.ts +1 -1
  235. package/resultset-table/ResultsetTable.js +47 -15
  236. package/resultset-table/ResultsetTable.stories.tsx +19 -3
  237. package/resultset-table/ResultsetTable.test.d.ts +1 -0
  238. package/resultset-table/ResultsetTable.test.js +111 -32
  239. package/resultset-table/types.d.ts +41 -13
  240. package/select/Listbox.d.ts +3 -3
  241. package/select/Listbox.js +33 -29
  242. package/select/Option.d.ts +3 -3
  243. package/select/Option.js +21 -15
  244. package/select/Select.accessibility.test.d.ts +1 -0
  245. package/select/Select.accessibility.test.js +227 -0
  246. package/select/Select.js +85 -192
  247. package/select/Select.stories.tsx +74 -117
  248. package/select/Select.test.d.ts +1 -0
  249. package/select/Select.test.js +348 -550
  250. package/select/selectUtils.d.ts +41 -0
  251. package/select/selectUtils.js +129 -0
  252. package/select/types.d.ts +1 -1
  253. package/sidenav/Sidenav.accessibility.test.d.ts +1 -0
  254. package/sidenav/Sidenav.accessibility.test.js +59 -0
  255. package/sidenav/Sidenav.js +16 -12
  256. package/sidenav/Sidenav.stories.tsx +5 -10
  257. package/sidenav/Sidenav.test.d.ts +1 -0
  258. package/sidenav/Sidenav.test.js +1 -1
  259. package/sidenav/types.d.ts +2 -2
  260. package/slider/Slider.accessibility.test.d.ts +1 -0
  261. package/slider/Slider.accessibility.test.js +103 -0
  262. package/slider/Slider.js +11 -13
  263. package/slider/Slider.stories.tsx +180 -0
  264. package/slider/Slider.test.d.ts +1 -0
  265. package/slider/Slider.test.js +13 -11
  266. package/spinner/Spinner.accessibility.test.d.ts +1 -0
  267. package/spinner/Spinner.accessibility.test.js +96 -0
  268. package/spinner/Spinner.d.ts +1 -1
  269. package/spinner/Spinner.js +32 -47
  270. package/spinner/Spinner.test.d.ts +1 -0
  271. package/spinner/Spinner.test.js +1 -1
  272. package/status-light/StatusLight.accessibility.test.d.ts +1 -0
  273. package/status-light/StatusLight.accessibility.test.js +157 -0
  274. package/status-light/StatusLight.test.d.ts +1 -0
  275. package/status-light/StatusLight.test.js +1 -1
  276. package/switch/Switch.accessibility.test.d.ts +1 -0
  277. package/switch/Switch.accessibility.test.js +98 -0
  278. package/switch/Switch.js +6 -9
  279. package/switch/Switch.stories.tsx +12 -0
  280. package/switch/Switch.test.d.ts +1 -0
  281. package/switch/Switch.test.js +1 -1
  282. package/table/Table.accessibility.test.d.ts +1 -0
  283. package/table/Table.accessibility.test.js +92 -0
  284. package/table/Table.js +2 -11
  285. package/table/Table.stories.tsx +15 -10
  286. package/table/Table.test.d.ts +1 -0
  287. package/table/Table.test.js +2 -4
  288. package/table/types.d.ts +1 -15
  289. package/tabs/Tab.js +6 -5
  290. package/tabs/Tabs.accessibility.test.d.ts +1 -0
  291. package/tabs/Tabs.accessibility.test.js +56 -0
  292. package/tabs/Tabs.js +9 -20
  293. package/tabs/Tabs.stories.tsx +7 -3
  294. package/tabs/Tabs.test.d.ts +1 -0
  295. package/tabs/Tabs.test.js +20 -38
  296. package/tabs/types.d.ts +2 -2
  297. package/tag/Tag.accessibility.test.d.ts +1 -0
  298. package/tag/Tag.accessibility.test.js +69 -0
  299. package/tag/Tag.js +7 -7
  300. package/tag/Tag.stories.tsx +5 -8
  301. package/tag/Tag.test.d.ts +1 -0
  302. package/tag/Tag.test.js +5 -13
  303. package/tag/types.d.ts +2 -2
  304. package/text-input/Suggestion.js +1 -1
  305. package/text-input/Suggestions.js +17 -7
  306. package/text-input/TextInput.accessibility.test.d.ts +1 -0
  307. package/text-input/TextInput.accessibility.test.js +320 -0
  308. package/text-input/TextInput.js +56 -73
  309. package/text-input/TextInput.stories.tsx +20 -8
  310. package/text-input/TextInput.test.d.ts +1 -0
  311. package/text-input/TextInput.test.js +2 -3
  312. package/textarea/Textarea.accessibility.test.d.ts +1 -0
  313. package/textarea/Textarea.accessibility.test.js +155 -0
  314. package/textarea/Textarea.js +14 -13
  315. package/textarea/Textarea.test.d.ts +1 -0
  316. package/textarea/Textarea.test.js +1 -1
  317. package/toggle-group/ToggleGroup.accessibility.test.d.ts +1 -0
  318. package/toggle-group/ToggleGroup.accessibility.test.js +107 -0
  319. package/toggle-group/ToggleGroup.js +10 -12
  320. package/toggle-group/ToggleGroup.stories.tsx +4 -4
  321. package/toggle-group/ToggleGroup.test.d.ts +1 -0
  322. package/toggle-group/ToggleGroup.test.js +1 -1
  323. package/toggle-group/types.d.ts +2 -2
  324. package/tooltip/Tooltip.accessibility.test.d.ts +1 -0
  325. package/tooltip/Tooltip.accessibility.test.js +144 -0
  326. package/tooltip/Tooltip.d.ts +4 -0
  327. package/tooltip/Tooltip.js +50 -0
  328. package/tooltip/Tooltip.stories.tsx +111 -0
  329. package/tooltip/Tooltip.test.d.ts +1 -0
  330. package/tooltip/Tooltip.test.js +112 -0
  331. package/tooltip/types.d.ts +16 -0
  332. package/tooltip/types.js +5 -0
  333. package/typography/Typography.accessibility.test.d.ts +1 -0
  334. package/typography/Typography.accessibility.test.js +339 -0
  335. package/typography/Typography.stories.tsx +1 -3
  336. package/typography/Typography.test.js +23 -0
  337. package/useTheme.d.ts +31 -5
  338. package/useTranslatedLabels.d.ts +11 -0
  339. package/utils/BaseTypography.js +45 -41
  340. package/utils/FocusLock.js +3 -2
  341. package/utils/useWidth.d.ts +2 -0
  342. package/utils/useWidth.js +30 -0
  343. package/wizard/Wizard.accessibility.test.d.ts +1 -0
  344. package/wizard/Wizard.accessibility.test.js +55 -0
  345. package/wizard/Wizard.js +14 -25
  346. package/wizard/Wizard.stories.tsx +20 -1
  347. package/wizard/Wizard.test.d.ts +1 -0
  348. package/wizard/Wizard.test.js +1 -1
  349. package/wizard/types.d.ts +1 -1
  350. package/contextual-menu/MenuItemAction.d.ts +0 -4
  351. package/contextual-menu/MenuItemAction.js +0 -46
  352. package/date-input/Icons.d.ts +0 -6
  353. package/date-input/Icons.js +0 -58
  354. package/paginator/Icons.d.ts +0 -5
  355. package/paginator/Icons.js +0 -40
  356. package/password-input/Icons.d.ts +0 -6
  357. package/password-input/Icons.js +0 -35
  358. package/select/Icons.d.ts +0 -10
  359. package/select/Icons.js +0 -89
  360. package/sidenav/Icons.d.ts +0 -7
  361. package/sidenav/Icons.js +0 -47
  362. package/text-input/Icons.d.ts +0 -8
  363. package/text-input/Icons.js +0 -56
@@ -0,0 +1,339 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
5
+ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
6
+ var _react = _interopRequireDefault(require("react"));
7
+ var _react2 = require("@testing-library/react");
8
+ var _axeHelper = require("../../test/accessibility/axe-helper.js");
9
+ var _Typography = _interopRequireDefault(require("./Typography"));
10
+ var _Flex = _interopRequireDefault(require("../flex/Flex"));
11
+ describe("Typography component accessibility tests", function () {
12
+ it("Should not have basic accessibility issues for different font sizes", /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
13
+ var _render, container, results;
14
+ return _regenerator["default"].wrap(function _callee$(_context) {
15
+ while (1) switch (_context.prev = _context.next) {
16
+ case 0:
17
+ _render = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Flex["default"], null, /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
18
+ display: "block",
19
+ fontSize: "3.75rem"
20
+ }, "3.75rem."), /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
21
+ display: "block",
22
+ fontSize: "3rem"
23
+ }, "3rem."), /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
24
+ display: "block",
25
+ fontSize: "2rem"
26
+ }, "2rem."), /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
27
+ display: "block",
28
+ fontSize: "1.5rem"
29
+ }, "1.5rem."), /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
30
+ display: "block",
31
+ fontSize: "1.25rem"
32
+ }, "1.25rem."), /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
33
+ display: "block",
34
+ fontSize: "1rem"
35
+ }, "1rem."), /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
36
+ display: "block",
37
+ fontSize: "0.875rem"
38
+ }, "0.875rem."), /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
39
+ display: "block",
40
+ fontSize: "0.75rem"
41
+ }, "0.75rem."))), container = _render.container;
42
+ _context.next = 3;
43
+ return (0, _axeHelper.axe)(container);
44
+ case 3:
45
+ results = _context.sent;
46
+ expect(results).toHaveNoViolations();
47
+ case 5:
48
+ case "end":
49
+ return _context.stop();
50
+ }
51
+ }, _callee);
52
+ })));
53
+ it("Should not have basic accessibility issues for different letter spacings", /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
54
+ var _render2, container, results;
55
+ return _regenerator["default"].wrap(function _callee2$(_context2) {
56
+ while (1) switch (_context2.prev = _context2.next) {
57
+ case 0:
58
+ _render2 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Flex["default"], null, /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
59
+ display: "block",
60
+ letterSpacing: "-0.025em"
61
+ }, "-0.025em."), /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
62
+ display: "block",
63
+ letterSpacing: "-0.0125em"
64
+ }, "-0.0125em."), /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
65
+ display: "block",
66
+ letterSpacing: "0em"
67
+ }, "0em."), /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
68
+ display: "block",
69
+ letterSpacing: "0.025em"
70
+ }, "0.025em."), /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
71
+ display: "block",
72
+ letterSpacing: "0.05em"
73
+ }, "0.05em."), /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
74
+ display: "block",
75
+ letterSpacing: "0.1em"
76
+ }, "0.1em."))), container = _render2.container;
77
+ _context2.next = 3;
78
+ return (0, _axeHelper.axe)(container);
79
+ case 3:
80
+ results = _context2.sent;
81
+ expect(results).toHaveNoViolations();
82
+ case 5:
83
+ case "end":
84
+ return _context2.stop();
85
+ }
86
+ }, _callee2);
87
+ })));
88
+ it("Should not have basic accessibility issues for different line heights", /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {
89
+ var _render3, container, results;
90
+ return _regenerator["default"].wrap(function _callee3$(_context3) {
91
+ while (1) switch (_context3.prev = _context3.next) {
92
+ case 0:
93
+ _render3 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Flex["default"], null, /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
94
+ display: "block",
95
+ lineHeight: "1em"
96
+ }, "1em."), /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
97
+ display: "block",
98
+ lineHeight: "1.25em"
99
+ }, "1.25em."), /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
100
+ display: "block",
101
+ lineHeight: "1.365em"
102
+ }, "1.365em."), /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
103
+ display: "block",
104
+ lineHeight: "1.5em"
105
+ }, "1.5em."), /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
106
+ display: "block",
107
+ lineHeight: "1.715em"
108
+ }, "1.715em."), /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
109
+ display: "block",
110
+ lineHeight: "2em"
111
+ }, "2em."))), container = _render3.container;
112
+ _context3.next = 3;
113
+ return (0, _axeHelper.axe)(container);
114
+ case 3:
115
+ results = _context3.sent;
116
+ expect(results).toHaveNoViolations();
117
+ case 5:
118
+ case "end":
119
+ return _context3.stop();
120
+ }
121
+ }, _callee3);
122
+ })));
123
+ it("Should not have basic accessibility issues for different font weights", /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4() {
124
+ var _render4, container, results;
125
+ return _regenerator["default"].wrap(function _callee4$(_context4) {
126
+ while (1) switch (_context4.prev = _context4.next) {
127
+ case 0:
128
+ _render4 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Flex["default"], null, /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
129
+ display: "block",
130
+ fontWeight: "300"
131
+ }, "300."), /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
132
+ display: "block",
133
+ fontWeight: "400"
134
+ }, "400."), /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
135
+ display: "block",
136
+ fontWeight: "600"
137
+ }, "600."), /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
138
+ display: "block",
139
+ fontWeight: "700"
140
+ }, "700."))), container = _render4.container;
141
+ _context4.next = 3;
142
+ return (0, _axeHelper.axe)(container);
143
+ case 3:
144
+ results = _context4.sent;
145
+ expect(results).toHaveNoViolations();
146
+ case 5:
147
+ case "end":
148
+ return _context4.stop();
149
+ }
150
+ }, _callee4);
151
+ })));
152
+ it("Should not have basic accessibility issues for different text decorations", /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5() {
153
+ var _render5, container, results;
154
+ return _regenerator["default"].wrap(function _callee5$(_context5) {
155
+ while (1) switch (_context5.prev = _context5.next) {
156
+ case 0:
157
+ _render5 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Flex["default"], null, /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
158
+ display: "block",
159
+ textDecoration: "underline"
160
+ }, "Underline."), /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
161
+ display: "block",
162
+ textDecoration: "line-through"
163
+ }, "Line-through."))), container = _render5.container;
164
+ _context5.next = 3;
165
+ return (0, _axeHelper.axe)(container);
166
+ case 3:
167
+ results = _context5.sent;
168
+ expect(results).toHaveNoViolations();
169
+ case 5:
170
+ case "end":
171
+ return _context5.stop();
172
+ }
173
+ }, _callee5);
174
+ })));
175
+ it("Should not have basic accessibility issues for different font families", /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6() {
176
+ var _render6, container, results;
177
+ return _regenerator["default"].wrap(function _callee6$(_context6) {
178
+ while (1) switch (_context6.prev = _context6.next) {
179
+ case 0:
180
+ _render6 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Flex["default"], null, /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
181
+ display: "block",
182
+ fontFamily: "Open Sans, sans-serif"
183
+ }, "Open Sans, sans-serif."), /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
184
+ display: "block",
185
+ fontFamily: "Source Code Pro, monospace"
186
+ }, "Source Code Pro, monospace."))), container = _render6.container;
187
+ _context6.next = 3;
188
+ return (0, _axeHelper.axe)(container);
189
+ case 3:
190
+ results = _context6.sent;
191
+ expect(results).toHaveNoViolations();
192
+ case 5:
193
+ case "end":
194
+ return _context6.stop();
195
+ }
196
+ }, _callee6);
197
+ })));
198
+ it("Should not have basic accessibility issues for different font styles", /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7() {
199
+ var _render7, container, results;
200
+ return _regenerator["default"].wrap(function _callee7$(_context7) {
201
+ while (1) switch (_context7.prev = _context7.next) {
202
+ case 0:
203
+ _render7 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Flex["default"], null, /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
204
+ display: "block",
205
+ fontStyle: "italic"
206
+ }, "Italic."), /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
207
+ display: "block",
208
+ fontStyle: "normal"
209
+ }, "Normal."))), container = _render7.container;
210
+ _context7.next = 3;
211
+ return (0, _axeHelper.axe)(container);
212
+ case 3:
213
+ results = _context7.sent;
214
+ expect(results).toHaveNoViolations();
215
+ case 5:
216
+ case "end":
217
+ return _context7.stop();
218
+ }
219
+ }, _callee7);
220
+ })));
221
+ it("Should not have basic accessibility issues for different text alignments", /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee8() {
222
+ var _render8, container, results;
223
+ return _regenerator["default"].wrap(function _callee8$(_context8) {
224
+ while (1) switch (_context8.prev = _context8.next) {
225
+ case 0:
226
+ _render8 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Flex["default"], null, /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
227
+ display: "block",
228
+ textAlign: "left"
229
+ }, "Left."), /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
230
+ display: "block",
231
+ textAlign: "center"
232
+ }, "Center."), /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
233
+ display: "block",
234
+ textAlign: "right"
235
+ }, "Right."))), container = _render8.container;
236
+ _context8.next = 3;
237
+ return (0, _axeHelper.axe)(container);
238
+ case 3:
239
+ results = _context8.sent;
240
+ expect(results).toHaveNoViolations();
241
+ case 5:
242
+ case "end":
243
+ return _context8.stop();
244
+ }
245
+ }, _callee8);
246
+ })));
247
+ it("Should not have basic accessibility issues for different white-spaces", /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee9() {
248
+ var _render9, container, results;
249
+ return _regenerator["default"].wrap(function _callee9$(_context9) {
250
+ while (1) switch (_context9.prev = _context9.next) {
251
+ case 0:
252
+ _render9 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Flex["default"], null, /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
253
+ fontSize: "2rem"
254
+ }, " ", " Normal: A bunch of words you see."), /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
255
+ whiteSpace: "nowrap",
256
+ fontSize: "2rem"
257
+ }, " ", "No-wrap: A bunch of words you see."), /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
258
+ whiteSpace: "pre",
259
+ fontSize: "2rem"
260
+ }, " ", " pre: A bunch of words you see."), /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
261
+ whiteSpace: "pre-line",
262
+ fontSize: "2rem"
263
+ }, " ", "pre-line: A bunch of words you see."), /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
264
+ whiteSpace: "pre-wrap",
265
+ fontSize: "2rem"
266
+ }, " ", " pre-wrap: A bunch of words you see."))), container = _render9.container;
267
+ _context9.next = 3;
268
+ return (0, _axeHelper.axe)(container);
269
+ case 3:
270
+ results = _context9.sent;
271
+ expect(results).toHaveNoViolations();
272
+ case 5:
273
+ case "end":
274
+ return _context9.stop();
275
+ }
276
+ }, _callee9);
277
+ })));
278
+ it("Should not have basic accessibility issues for different displays", /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee10() {
279
+ var _render10, container, results;
280
+ return _regenerator["default"].wrap(function _callee10$(_context10) {
281
+ while (1) switch (_context10.prev = _context10.next) {
282
+ case 0:
283
+ _render10 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Flex["default"], null, /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
284
+ display: "block",
285
+ textAlign: "left"
286
+ }, "Display Block.", /*#__PURE__*/_react["default"].createElement(_Typography["default"], null, "A different text.")), /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
287
+ display: "inline",
288
+ textAlign: "left"
289
+ }, "Display Inline.", /*#__PURE__*/_react["default"].createElement(_Typography["default"], null, "A different text.")))), container = _render10.container;
290
+ _context10.next = 3;
291
+ return (0, _axeHelper.axe)(container);
292
+ case 3:
293
+ results = _context10.sent;
294
+ expect(results).toHaveNoViolations();
295
+ case 5:
296
+ case "end":
297
+ return _context10.stop();
298
+ }
299
+ }, _callee10);
300
+ })));
301
+ it("Should not have basic accessibility issues for different text overflows", /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee11() {
302
+ var _render11, container, results;
303
+ return _regenerator["default"].wrap(function _callee11$(_context11) {
304
+ while (1) switch (_context11.prev = _context11.next) {
305
+ case 0:
306
+ _render11 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Flex["default"], null, /*#__PURE__*/_react["default"].createElement("div", {
307
+ style: {
308
+ width: "75px"
309
+ }
310
+ }, /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
311
+ display: "block",
312
+ textOverflow: "clip"
313
+ }, "Overflow clip.")), /*#__PURE__*/_react["default"].createElement("div", {
314
+ style: {
315
+ width: "75px"
316
+ }
317
+ }, /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
318
+ display: "block",
319
+ textOverflow: "ellipsis"
320
+ }, "Overflow ellipsis.")), /*#__PURE__*/_react["default"].createElement("div", {
321
+ style: {
322
+ width: "75px"
323
+ }
324
+ }, /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
325
+ display: "block",
326
+ textOverflow: "unset"
327
+ }, "Overflow unset.")))), container = _render11.container;
328
+ _context11.next = 3;
329
+ return (0, _axeHelper.axe)(container);
330
+ case 3:
331
+ results = _context11.sent;
332
+ expect(results).toHaveNoViolations();
333
+ case 5:
334
+ case "end":
335
+ return _context11.stop();
336
+ }
337
+ }, _callee11);
338
+ })));
339
+ });
@@ -140,9 +140,7 @@ export const Chromatic = () => (
140
140
  <ExampleContainer>
141
141
  <Title title="Typography whitespace" theme="light" level={4} />
142
142
  <div style={{ margin: "50px", border: "1px solid red", width: "125px" }}>
143
- <DxcTypography fontSize="2rem">
144
- {" "} Normal: A bunch of words you see.
145
- </DxcTypography>
143
+ <DxcTypography fontSize="2rem">{" "} Normal: A bunch of words you see.</DxcTypography>
146
144
  </div>
147
145
  <div style={{ margin: "50px", border: "1px solid red", width: "125px" }}>
148
146
  <DxcTypography whiteSpace="nowrap" fontSize="2rem">
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ var _react = _interopRequireDefault(require("react"));
5
+ var _react2 = require("@testing-library/react");
6
+ var _Typography = _interopRequireDefault(require("./Typography"));
7
+ describe("Typography component tests", function () {
8
+ test("Renders as the selected component", function () {
9
+ var _render = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
10
+ as: "h1"
11
+ }, "Test H1 Text")),
12
+ container = _render.container;
13
+ expect(container.querySelector('h1')).not.toBeNull();
14
+ });
15
+ test("Renders as span if it receives invalid tag", function () {
16
+ var _render2 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
17
+ as: "br"
18
+ }, "Test BR Text")),
19
+ container = _render2.container;
20
+ expect(container.querySelector('br')).toBeNull();
21
+ expect(container.querySelector('span')).not.toBeNull();
22
+ });
23
+ });
package/useTheme.d.ts CHANGED
@@ -217,6 +217,29 @@ declare const useTheme: () => {
217
217
  focusBorderThickness: string;
218
218
  focusBorderRadius: string;
219
219
  }>;
220
+ contextualMenu?: Partial<{
221
+ fontFamily: string;
222
+ backgroundColor: string;
223
+ borderColor: string;
224
+ menuItemFontColor: string;
225
+ menuItemFontSize: string;
226
+ menuItemFontStyle: string;
227
+ menuItemFontWeight: string;
228
+ menuItemLineHeight: string;
229
+ hoverMenuItemBackgroundColor: string;
230
+ activeMenuItemBackgroundColor: string;
231
+ selectedMenuItemBackgroundColor: string;
232
+ hoverSelectedMenuItemBackgroundColor: string;
233
+ activeSelectedMenuItemBackgroundColor: string;
234
+ selectedMenuItemFontWeight: string;
235
+ sectionTitleFontColor: string;
236
+ sectionTitleFontSize: string;
237
+ sectionTitleFontStyle: string;
238
+ sectionTitleFontWeight: string;
239
+ sectionTitleLineHeight: string;
240
+ iconColor: string;
241
+ iconSize: string;
242
+ }>;
220
243
  dateInput?: Partial<{
221
244
  pickerBackgroundColor: string;
222
245
  pickerFontColor: string;
@@ -251,8 +274,7 @@ declare const useTheme: () => {
251
274
  dialog?: Partial<{
252
275
  overlayColor: string;
253
276
  backgroundColor: string;
254
- closeIconWidth: string;
255
- closeIconHeight: string;
277
+ closeIconSize: string;
256
278
  closeIconTopPosition: string;
257
279
  closeIconRightPosition: string;
258
280
  closeIconBackgroundColor: string;
@@ -290,7 +312,6 @@ declare const useTheme: () => {
290
312
  disabledColor: string;
291
313
  disabledButtonBackgroundColor: string;
292
314
  disabledButtonBorderColor: string;
293
- disabledBorderColor: string;
294
315
  optionBackgroundColor: string;
295
316
  hoverOptionBackgroundColor: string;
296
317
  activeOptionBackgroundColor: string;
@@ -330,7 +351,6 @@ declare const useTheme: () => {
330
351
  focusDropBorderColor: string;
331
352
  disabledDropBorderColor: string;
332
353
  dragoverDropBackgroundColor: string;
333
- activeFileItemIconBackgrounColor: string;
334
354
  errorFileItemBorderColor: string;
335
355
  errorFileItemBackgroundColor: string;
336
356
  errorFilePreviewBackgroundColor: string;
@@ -531,8 +551,8 @@ declare const useTheme: () => {
531
551
  totalItemsContainerMarginLeft: string;
532
552
  }>;
533
553
  paragraph?: Partial<{
534
- fontColor: string;
535
554
  display: string;
555
+ fontColor: string;
536
556
  fontSize: string;
537
557
  fontWeight: string;
538
558
  }>;
@@ -1000,7 +1020,13 @@ declare const useTheme: () => {
1000
1020
  helperTextLineHeight: string;
1001
1021
  disabledHelperTextFontColor: string;
1002
1022
  prefixColor: string;
1023
+ prefixDividerBorderWidth: string;
1024
+ prefixDividerBorderStyle: string;
1025
+ prefixDividerPaddingRight: string;
1003
1026
  suffixColor: string;
1027
+ suffixDividerBorderStyle: string;
1028
+ suffixDividerBorderWidth: string;
1029
+ suffixDividerPaddingLeft: string;
1004
1030
  disabledPrefixColor: string;
1005
1031
  disabledSuffixColor: string;
1006
1032
  placeholderFontColor: string;
@@ -16,6 +16,17 @@ declare const useTranslatedLabels: () => {
16
16
  warningTitleText: string;
17
17
  errorTitleText: string;
18
18
  }>;
19
+ barChart?: Partial<{
20
+ ariaLabel: string;
21
+ filterLabel: string;
22
+ filterPlaceholder: string;
23
+ loadingDataMessage: string;
24
+ noDataMessageBody: string;
25
+ noDataMessageTitle: string;
26
+ noMatchesMessageBody: string;
27
+ noMatchesMessageTitle: string;
28
+ retryButtonLabel: string;
29
+ }>;
19
30
  dateInput?: Partial<{
20
31
  invalidDateErrorMessage: string;
21
32
  }>;
@@ -11,8 +11,12 @@ var _react = _interopRequireWildcard(require("react"));
11
11
  var _styledComponents = _interopRequireDefault(require("styled-components"));
12
12
  var _templateObject;
13
13
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
14
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
14
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
15
15
  var TypographyContext = /*#__PURE__*/_react["default"].createContext(null);
16
+ var ValidTypographyTags = ["a", "blockquote", "cite", "code", "div", "em", "figcaption", "h1", "h2", "h3", "h4", "h5", "h6", "p", "pre", "small", "span", "strong"];
17
+ var isValidTypography = function isValidTypography(tag) {
18
+ return ValidTypographyTags.includes(tag);
19
+ };
16
20
  var BaseTypography = function BaseTypography(_ref) {
17
21
  var as = _ref.as,
18
22
  display = _ref.display,
@@ -30,65 +34,65 @@ var BaseTypography = function BaseTypography(_ref) {
30
34
  children = _ref.children;
31
35
  var componentContext = (0, _react.useContext)(TypographyContext);
32
36
  var contextValue = (0, _react.useMemo)(function () {
33
- var _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9, _ref10, _ref11, _ref12, _ref13, _ref14;
37
+ var _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9, _ref10, _ref11, _ref12, _ref13;
34
38
  return {
35
- as: (_ref2 = as !== null && as !== void 0 ? as : componentContext === null || componentContext === void 0 ? void 0 : componentContext.as) !== null && _ref2 !== void 0 ? _ref2 : "span",
36
- display: (_ref3 = display !== null && display !== void 0 ? display : componentContext === null || componentContext === void 0 ? void 0 : componentContext.display) !== null && _ref3 !== void 0 ? _ref3 : "inline",
37
- fontFamily: (_ref4 = fontFamily !== null && fontFamily !== void 0 ? fontFamily : componentContext === null || componentContext === void 0 ? void 0 : componentContext.fontFamily) !== null && _ref4 !== void 0 ? _ref4 : "Open Sans, sans-serif",
38
- fontSize: (_ref5 = fontSize !== null && fontSize !== void 0 ? fontSize : componentContext === null || componentContext === void 0 ? void 0 : componentContext.fontSize) !== null && _ref5 !== void 0 ? _ref5 : "1rem",
39
- fontStyle: (_ref6 = fontStyle !== null && fontStyle !== void 0 ? fontStyle : componentContext === null || componentContext === void 0 ? void 0 : componentContext.fontStyle) !== null && _ref6 !== void 0 ? _ref6 : "normal",
40
- fontWeight: (_ref7 = fontWeight !== null && fontWeight !== void 0 ? fontWeight : componentContext === null || componentContext === void 0 ? void 0 : componentContext.fontWeight) !== null && _ref7 !== void 0 ? _ref7 : "400",
41
- letterSpacing: (_ref8 = letterSpacing !== null && letterSpacing !== void 0 ? letterSpacing : componentContext === null || componentContext === void 0 ? void 0 : componentContext.letterSpacing) !== null && _ref8 !== void 0 ? _ref8 : "0em",
42
- lineHeight: (_ref9 = lineHeight !== null && lineHeight !== void 0 ? lineHeight : componentContext === null || componentContext === void 0 ? void 0 : componentContext.lineHeight) !== null && _ref9 !== void 0 ? _ref9 : "1.5em",
43
- textAlign: (_ref10 = textAlign !== null && textAlign !== void 0 ? textAlign : componentContext === null || componentContext === void 0 ? void 0 : componentContext.textAlign) !== null && _ref10 !== void 0 ? _ref10 : "left",
44
- color: (_ref11 = color !== null && color !== void 0 ? color : componentContext === null || componentContext === void 0 ? void 0 : componentContext.color) !== null && _ref11 !== void 0 ? _ref11 : "#000000",
45
- textDecoration: (_ref12 = textDecoration !== null && textDecoration !== void 0 ? textDecoration : componentContext === null || componentContext === void 0 ? void 0 : componentContext.textDecoration) !== null && _ref12 !== void 0 ? _ref12 : "none",
46
- textOverflow: (_ref13 = textOverflow !== null && textOverflow !== void 0 ? textOverflow : componentContext === null || componentContext === void 0 ? void 0 : componentContext.textOverflow) !== null && _ref13 !== void 0 ? _ref13 : "unset",
47
- whiteSpace: (_ref14 = whiteSpace !== null && whiteSpace !== void 0 ? whiteSpace : componentContext === null || componentContext === void 0 ? void 0 : componentContext.whiteSpace) !== null && _ref14 !== void 0 ? _ref14 : "normal"
39
+ as: isValidTypography(as) ? as : isValidTypography(componentContext === null || componentContext === void 0 ? void 0 : componentContext.as) ? componentContext === null || componentContext === void 0 ? void 0 : componentContext.as : "span",
40
+ display: (_ref2 = display !== null && display !== void 0 ? display : componentContext === null || componentContext === void 0 ? void 0 : componentContext.display) !== null && _ref2 !== void 0 ? _ref2 : "inline",
41
+ fontFamily: (_ref3 = fontFamily !== null && fontFamily !== void 0 ? fontFamily : componentContext === null || componentContext === void 0 ? void 0 : componentContext.fontFamily) !== null && _ref3 !== void 0 ? _ref3 : "Open Sans, sans-serif",
42
+ fontSize: (_ref4 = fontSize !== null && fontSize !== void 0 ? fontSize : componentContext === null || componentContext === void 0 ? void 0 : componentContext.fontSize) !== null && _ref4 !== void 0 ? _ref4 : "1rem",
43
+ fontStyle: (_ref5 = fontStyle !== null && fontStyle !== void 0 ? fontStyle : componentContext === null || componentContext === void 0 ? void 0 : componentContext.fontStyle) !== null && _ref5 !== void 0 ? _ref5 : "normal",
44
+ fontWeight: (_ref6 = fontWeight !== null && fontWeight !== void 0 ? fontWeight : componentContext === null || componentContext === void 0 ? void 0 : componentContext.fontWeight) !== null && _ref6 !== void 0 ? _ref6 : "400",
45
+ letterSpacing: (_ref7 = letterSpacing !== null && letterSpacing !== void 0 ? letterSpacing : componentContext === null || componentContext === void 0 ? void 0 : componentContext.letterSpacing) !== null && _ref7 !== void 0 ? _ref7 : "0em",
46
+ lineHeight: (_ref8 = lineHeight !== null && lineHeight !== void 0 ? lineHeight : componentContext === null || componentContext === void 0 ? void 0 : componentContext.lineHeight) !== null && _ref8 !== void 0 ? _ref8 : "1.5em",
47
+ textAlign: (_ref9 = textAlign !== null && textAlign !== void 0 ? textAlign : componentContext === null || componentContext === void 0 ? void 0 : componentContext.textAlign) !== null && _ref9 !== void 0 ? _ref9 : "left",
48
+ color: (_ref10 = color !== null && color !== void 0 ? color : componentContext === null || componentContext === void 0 ? void 0 : componentContext.color) !== null && _ref10 !== void 0 ? _ref10 : "#000000",
49
+ textDecoration: (_ref11 = textDecoration !== null && textDecoration !== void 0 ? textDecoration : componentContext === null || componentContext === void 0 ? void 0 : componentContext.textDecoration) !== null && _ref11 !== void 0 ? _ref11 : "none",
50
+ textOverflow: (_ref12 = textOverflow !== null && textOverflow !== void 0 ? textOverflow : componentContext === null || componentContext === void 0 ? void 0 : componentContext.textOverflow) !== null && _ref12 !== void 0 ? _ref12 : "unset",
51
+ whiteSpace: (_ref13 = whiteSpace !== null && whiteSpace !== void 0 ? whiteSpace : componentContext === null || componentContext === void 0 ? void 0 : componentContext.whiteSpace) !== null && _ref13 !== void 0 ? _ref13 : "normal"
48
52
  };
49
53
  }, [as, display, fontFamily, fontSize, fontStyle, fontWeight, letterSpacing, lineHeight, textAlign, color, textDecoration, textOverflow, whiteSpace]);
50
54
  return /*#__PURE__*/_react["default"].createElement(TypographyContext.Provider, {
51
55
  value: contextValue
52
56
  }, /*#__PURE__*/_react["default"].createElement(StyledTypography, contextValue, children));
53
57
  };
54
- var StyledTypography = _styledComponents["default"].span(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: ", ";\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n letter-spacing: ", ";\n line-height: ", ";\n text-align: ", ";\n text-decoration: ", ";\n text-overflow: ", ";\n white-space: ", ";\n overflow: ", ";\n margin: 0;\n"])), function (_ref15) {
55
- var display = _ref15.display;
58
+ var StyledTypography = _styledComponents["default"].span(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: ", ";\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n letter-spacing: ", ";\n line-height: ", ";\n text-align: ", ";\n text-decoration: ", ";\n text-overflow: ", ";\n white-space: ", ";\n overflow: ", ";\n margin: 0;\n"])), function (_ref14) {
59
+ var display = _ref14.display;
56
60
  return display;
57
- }, function (_ref16) {
58
- var color = _ref16.color;
61
+ }, function (_ref15) {
62
+ var color = _ref15.color;
59
63
  return color;
60
- }, function (_ref17) {
61
- var fontFamily = _ref17.fontFamily;
64
+ }, function (_ref16) {
65
+ var fontFamily = _ref16.fontFamily;
62
66
  return fontFamily;
63
- }, function (_ref18) {
64
- var fontSize = _ref18.fontSize;
67
+ }, function (_ref17) {
68
+ var fontSize = _ref17.fontSize;
65
69
  return fontSize;
66
- }, function (_ref19) {
67
- var fontStyle = _ref19.fontStyle;
70
+ }, function (_ref18) {
71
+ var fontStyle = _ref18.fontStyle;
68
72
  return fontStyle;
69
- }, function (_ref20) {
70
- var fontWeight = _ref20.fontWeight;
73
+ }, function (_ref19) {
74
+ var fontWeight = _ref19.fontWeight;
71
75
  return fontWeight;
72
- }, function (_ref21) {
73
- var letterSpacing = _ref21.letterSpacing;
76
+ }, function (_ref20) {
77
+ var letterSpacing = _ref20.letterSpacing;
74
78
  return letterSpacing;
75
- }, function (_ref22) {
76
- var lineHeight = _ref22.lineHeight;
79
+ }, function (_ref21) {
80
+ var lineHeight = _ref21.lineHeight;
77
81
  return lineHeight;
78
- }, function (_ref23) {
79
- var textAlign = _ref23.textAlign;
82
+ }, function (_ref22) {
83
+ var textAlign = _ref22.textAlign;
80
84
  return textAlign;
81
- }, function (_ref24) {
82
- var textDecoration = _ref24.textDecoration;
85
+ }, function (_ref23) {
86
+ var textDecoration = _ref23.textDecoration;
83
87
  return textDecoration;
84
- }, function (_ref25) {
85
- var textOverflow = _ref25.textOverflow;
88
+ }, function (_ref24) {
89
+ var textOverflow = _ref24.textOverflow;
86
90
  return textOverflow;
87
- }, function (_ref26) {
88
- var whiteSpace = _ref26.whiteSpace;
91
+ }, function (_ref25) {
92
+ var whiteSpace = _ref25.whiteSpace;
89
93
  return whiteSpace;
90
- }, function (_ref27) {
91
- var textOverflow = _ref27.textOverflow;
94
+ }, function (_ref26) {
95
+ var textOverflow = _ref26.textOverflow;
92
96
  return textOverflow !== "unset" ? "hidden" : "visible";
93
97
  });
94
98
  var _default = exports["default"] = BaseTypography;
@@ -9,7 +9,7 @@ exports["default"] = void 0;
9
9
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
10
10
  var _react = _interopRequireWildcard(require("react"));
11
11
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
12
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
12
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
13
13
  var not = {
14
14
  negTabIndex: ':not([tabindex^="-"])',
15
15
  disabled: ":not(:disabled)"
@@ -95,7 +95,8 @@ var FocusLock = function FocusLock(_ref) {
95
95
  });
96
96
  }, [focusableElements]);
97
97
  var focusLast = function focusLast() {
98
- focusableElements.reverse().some(function (element) {
98
+ var _focusableElements$re;
99
+ focusableElements === null || focusableElements === void 0 ? void 0 : (_focusableElements$re = focusableElements.reverse()) === null || _focusableElements$re === void 0 ? void 0 : _focusableElements$re.some(function (element) {
99
100
  return attemptFocus(element);
100
101
  });
101
102
  };
@@ -0,0 +1,2 @@
1
+ declare const useWidth: <T extends Element>(target: T) => number;
2
+ export default useWidth;