@automattic/vip-design-system 1.2.0 → 1.2.2

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 (455) hide show
  1. package/.storybook/decorators/withBoundingBox.tsx +11 -0
  2. package/.storybook/decorators/{withThemeProvider.jsx → withThemeProvider.tsx} +1 -5
  3. package/.storybook/{preview.js → preview.tsx} +12 -3
  4. package/build/declaration.d.js +1 -0
  5. package/build/system/Accordion/Accordion.d.ts +41 -0
  6. package/build/system/Accordion/Accordion.js +10 -35
  7. package/build/system/Accordion/Accordion.stories.d.ts +13 -0
  8. package/build/system/Accordion/Accordion.stories.js +4 -7
  9. package/build/system/Accordion/Accordion.test.d.ts +2 -0
  10. package/build/system/Accordion/Accordion.test.js +5 -7
  11. package/build/system/Accordion/index.d.ts +5 -0
  12. package/build/system/Avatar/Avatar.d.ts +13 -0
  13. package/build/system/Avatar/Avatar.js +7 -20
  14. package/build/system/Avatar/Avatar.stories.d.ts +16 -0
  15. package/build/system/Avatar/Avatar.stories.js +5 -7
  16. package/build/system/Avatar/Avatar.test.d.ts +1 -0
  17. package/build/system/Avatar/Avatar.test.js +5 -7
  18. package/build/system/Avatar/index.d.ts +4 -0
  19. package/build/system/Avatar/index.js +1 -0
  20. package/build/system/Badge/Badge.d.ts +6 -0
  21. package/build/system/Badge/Badge.js +6 -15
  22. package/build/system/Badge/Badge.stories.d.ts +18 -0
  23. package/build/system/Badge/Badge.stories.js +70 -71
  24. package/build/system/Badge/Badge.test.d.ts +1 -0
  25. package/build/system/Badge/Badge.test.js +6 -8
  26. package/build/system/Badge/index.d.ts +4 -0
  27. package/build/system/Badge/index.js +1 -0
  28. package/build/system/Box/Box.d.ts +3 -0
  29. package/build/system/{Form/Label.stories.js → Box/Box.js} +15 -31
  30. package/build/system/Box/Box.stories.d.ts +16 -0
  31. package/build/system/Box/Box.stories.js +21 -0
  32. package/build/system/Box/index.d.ts +2 -0
  33. package/build/system/Box/index.js +5 -4
  34. package/build/system/Button/Button.d.ts +12 -0
  35. package/build/system/Button/Button.js +10 -18
  36. package/build/system/Button/Button.stories.d.ts +30 -0
  37. package/build/system/Button/Button.stories.js +10 -20
  38. package/build/system/Button/Button.test.d.ts +1 -0
  39. package/build/system/Button/Button.test.js +45 -74
  40. package/build/system/Button/ButtonSubmit.d.ts +2 -0
  41. package/build/system/Button/ButtonSubmit.js +60 -70
  42. package/build/system/Button/ButtonSubmit.stories.d.ts +38 -0
  43. package/build/system/Button/ButtonSubmit.stories.jsx +40 -0
  44. package/build/system/Button/ButtonSubmit.test.d.ts +1 -0
  45. package/build/system/Button/ButtonSubmit.test.js +32 -60
  46. package/build/system/Button/index.d.ts +3 -0
  47. package/build/system/Button/index.js +7 -6
  48. package/build/system/Button/variants.d.ts +2 -0
  49. package/build/system/Button/variants.js +1 -6
  50. package/build/system/Card/Card.d.ts +9 -0
  51. package/build/system/Card/Card.js +2 -10
  52. package/build/system/Card/Card.stories.d.ts +7 -0
  53. package/build/system/Card/Card.stories.js +4 -6
  54. package/build/system/Card/Card.test.d.ts +1 -0
  55. package/build/system/Card/Card.test.js +5 -7
  56. package/build/system/Card/index.d.ts +4 -0
  57. package/build/system/Card/index.js +1 -0
  58. package/build/system/Code/Code.d.ts +15 -0
  59. package/build/system/Code/Code.js +14 -21
  60. package/build/system/Code/Code.stories.d.ts +18 -0
  61. package/build/system/Code/Code.stories.js +31 -23
  62. package/build/system/Code/Code.test.d.ts +1 -0
  63. package/build/system/Code/Code.test.js +10 -11
  64. package/build/system/Code/index.d.ts +4 -0
  65. package/build/system/Code/index.js +1 -0
  66. package/build/system/ConfirmationDialog/ConfirmationDialog.d.ts +35 -0
  67. package/build/system/ConfirmationDialog/ConfirmationDialog.js +68 -94
  68. package/build/system/ConfirmationDialog/ConfirmationDialog.stories.d.ts +7 -0
  69. package/build/system/ConfirmationDialog/ConfirmationDialog.stories.jsx +29 -0
  70. package/build/system/ConfirmationDialog/index.d.ts +3 -0
  71. package/build/system/ConfirmationDialog/index.js +5 -5
  72. package/build/system/Dialog/Dialog.d.ts +18 -0
  73. package/build/system/Dialog/Dialog.js +81 -94
  74. package/build/system/Dialog/Dialog.stories.d.ts +7 -0
  75. package/build/system/Dialog/Dialog.stories.jsx +60 -0
  76. package/build/system/Dialog/DialogButton.d.ts +16 -0
  77. package/build/system/Dialog/DialogButton.js +51 -66
  78. package/build/system/Dialog/DialogContent.d.ts +18 -0
  79. package/build/system/Dialog/DialogContent.js +142 -137
  80. package/build/system/Dialog/DialogDivider.d.ts +5 -0
  81. package/build/system/Dialog/DialogDivider.js +5 -16
  82. package/build/system/Dialog/DialogMenu.d.ts +5 -0
  83. package/build/system/Dialog/DialogMenu.js +5 -18
  84. package/build/system/Dialog/DialogMenuItem.d.ts +13 -0
  85. package/build/system/Dialog/DialogMenuItem.js +64 -71
  86. package/build/system/Dialog/DialogTrigger.d.ts +1 -0
  87. package/build/system/Dialog/DialogTrigger.js +10 -16
  88. package/build/system/Dialog/index.d.ts +8 -0
  89. package/build/system/Dialog/index.js +19 -16
  90. package/build/system/Dropdown/Dropdown.d.ts +37 -0
  91. package/build/system/Dropdown/Dropdown.js +96 -93
  92. package/build/system/Dropdown/Dropdown.stories.d.ts +34 -0
  93. package/build/system/Dropdown/Dropdown.stories.jsx +170 -0
  94. package/build/system/Dropdown/Dropdown.test.d.ts +1 -0
  95. package/build/system/Dropdown/Dropdown.test.js +30 -52
  96. package/build/system/Dropdown/DropdownContent.d.ts +11 -0
  97. package/build/system/Dropdown/DropdownContent.js +40 -49
  98. package/build/system/Dropdown/DropdownItem.d.ts +32 -0
  99. package/build/system/Dropdown/DropdownItem.js +91 -95
  100. package/build/system/Dropdown/DropdownLabel.d.ts +8 -0
  101. package/build/system/Dropdown/DropdownLabel.js +24 -33
  102. package/build/system/Dropdown/DropdownSeparator.d.ts +7 -0
  103. package/build/system/Dropdown/DropdownSeparator.js +23 -32
  104. package/build/system/Dropdown/index.d.ts +40 -0
  105. package/build/system/Dropdown/index.js +49 -37
  106. package/build/system/Flex/Flex.d.ts +2 -0
  107. package/build/system/Flex/Flex.js +6 -8
  108. package/build/system/Flex/Flex.stories.d.ts +7 -0
  109. package/build/system/Flex/Flex.stories.js +3 -5
  110. package/build/system/Flex/index.d.ts +4 -0
  111. package/build/system/Flex/index.js +1 -0
  112. package/build/system/Form/Checkbox.d.ts +10 -0
  113. package/build/system/Form/Checkbox.js +61 -62
  114. package/build/system/Form/Checkbox.stories.d.ts +7 -0
  115. package/build/system/Form/Checkbox.stories.jsx +54 -0
  116. package/build/system/Form/Input.d.ts +2 -0
  117. package/build/system/Form/Input.js +70 -69
  118. package/build/system/Form/Input.stories.d.ts +5 -0
  119. package/build/system/Form/Input.stories.jsx +38 -0
  120. package/build/system/Form/Input.styles.d.ts +32 -0
  121. package/build/system/Form/Input.styles.js +29 -40
  122. package/build/system/Form/InputWithCopyButton.d.ts +2 -0
  123. package/build/system/Form/InputWithCopyButton.js +109 -105
  124. package/build/system/Form/InputWithCopyButton.stories.d.ts +5 -0
  125. package/build/system/Form/InputWithCopyButton.stories.jsx +30 -0
  126. package/build/system/Form/Label.d.ts +9 -0
  127. package/build/system/Form/Label.js +41 -47
  128. package/build/system/Form/Label.stories.d.ts +6 -0
  129. package/build/system/Form/Label.stories.jsx +36 -0
  130. package/build/system/Form/Radio.d.ts +2 -0
  131. package/build/system/Form/Radio.js +185 -169
  132. package/build/system/Form/Radio.stories.d.ts +7 -0
  133. package/build/system/Form/Radio.stories.jsx +100 -0
  134. package/build/system/Form/RadioBoxGroup.d.ts +2 -0
  135. package/build/system/Form/RadioBoxGroup.js +193 -187
  136. package/build/system/Form/RadioBoxGroup.stories.d.ts +8 -0
  137. package/build/system/Form/RadioBoxGroup.stories.jsx +60 -0
  138. package/build/system/Form/RequiredLabel.d.ts +5 -0
  139. package/build/system/Form/RequiredLabel.js +7 -17
  140. package/build/system/Form/Textarea.d.ts +2 -0
  141. package/build/system/Form/Textarea.js +18 -20
  142. package/build/system/Form/Textarea.stories.d.ts +34 -0
  143. package/build/system/Form/Textarea.stories.jsx +40 -0
  144. package/build/system/Form/Toggle.d.ts +2 -0
  145. package/build/system/Form/Toggle.js +67 -81
  146. package/build/system/Form/Toggle.stories.d.ts +19 -0
  147. package/build/system/Form/Toggle.stories.jsx +96 -0
  148. package/build/system/Form/Toggle.test.d.ts +1 -0
  149. package/build/system/Form/Toggle.test.js +21 -39
  150. package/build/system/Form/ToggleRow.d.ts +22 -0
  151. package/build/system/Form/ToggleRow.js +66 -95
  152. package/build/system/Form/Validation.d.ts +14 -0
  153. package/build/system/Form/Validation.js +33 -42
  154. package/build/system/Form/index.d.ts +11 -0
  155. package/build/system/Form/index.js +25 -22
  156. package/build/system/Grid/Grid.d.ts +6 -0
  157. package/build/system/Grid/Grid.js +4 -5
  158. package/build/system/Grid/Grid.stories.d.ts +7 -0
  159. package/build/system/Grid/Grid.stories.js +3 -5
  160. package/build/system/Grid/index.d.ts +4 -0
  161. package/build/system/Grid/index.js +1 -0
  162. package/build/system/Heading/Heading.d.ts +6 -0
  163. package/build/system/Heading/Heading.js +33 -0
  164. package/build/system/Heading/Heading.stories.d.ts +7 -0
  165. package/build/system/Heading/Heading.stories.js +33 -0
  166. package/build/system/Heading/index.d.ts +2 -0
  167. package/build/system/Heading/index.js +5 -4
  168. package/build/system/Link/Link.d.ts +6 -0
  169. package/build/system/Link/Link.js +5 -12
  170. package/build/system/Link/Link.stories.d.ts +16 -0
  171. package/build/system/Link/Link.stories.js +12 -13
  172. package/build/system/Link/index.d.ts +4 -0
  173. package/build/system/Link/index.js +1 -0
  174. package/build/system/NewConfirmationDialog/NewConfirmationDialog.d.ts +23 -0
  175. package/build/system/NewConfirmationDialog/NewConfirmationDialog.js +86 -99
  176. package/build/system/NewConfirmationDialog/NewConfirmationDialog.stories.d.ts +8 -0
  177. package/build/system/NewConfirmationDialog/NewConfirmationDialog.stories.jsx +34 -0
  178. package/build/system/NewConfirmationDialog/NewConfirmationDialog.test.d.ts +1 -0
  179. package/build/system/NewConfirmationDialog/NewConfirmationDialog.test.js +43 -66
  180. package/build/system/NewConfirmationDialog/index.d.ts +2 -0
  181. package/build/system/NewConfirmationDialog/index.js +5 -4
  182. package/build/system/NewDialog/DialogClose.d.ts +6 -0
  183. package/build/system/NewDialog/DialogClose.js +50 -69
  184. package/build/system/NewDialog/DialogClose.test.d.ts +1 -0
  185. package/build/system/NewDialog/DialogClose.test.js +29 -46
  186. package/build/system/NewDialog/DialogContent.d.ts +18 -0
  187. package/build/system/NewDialog/DialogContent.js +14 -21
  188. package/build/system/NewDialog/DialogDescription.d.ts +5 -0
  189. package/build/system/NewDialog/DialogDescription.js +31 -38
  190. package/build/system/NewDialog/DialogDescription.test.d.ts +1 -0
  191. package/build/system/NewDialog/DialogDescription.test.js +44 -67
  192. package/build/system/NewDialog/DialogOverlay.d.ts +2 -0
  193. package/build/system/NewDialog/DialogOverlay.js +28 -32
  194. package/build/system/NewDialog/DialogOverlay.test.d.ts +1 -0
  195. package/build/system/NewDialog/DialogOverlay.test.js +26 -42
  196. package/build/system/NewDialog/DialogTitle.d.ts +11 -0
  197. package/build/system/NewDialog/DialogTitle.js +19 -34
  198. package/build/system/NewDialog/DialogTitle.test.d.ts +1 -0
  199. package/build/system/NewDialog/DialogTitle.test.js +44 -67
  200. package/build/system/NewDialog/NewDialog.d.ts +29 -0
  201. package/build/system/NewDialog/NewDialog.js +74 -89
  202. package/build/system/NewDialog/NewDialog.stories.d.ts +38 -0
  203. package/build/system/NewDialog/NewDialog.stories.jsx +192 -0
  204. package/build/system/NewDialog/index.d.ts +31 -0
  205. package/build/system/NewDialog/index.js +9 -13
  206. package/build/system/NewForm/Fieldset.d.ts +2 -0
  207. package/build/system/NewForm/Fieldset.js +38 -43
  208. package/build/system/NewForm/Form.d.ts +2 -0
  209. package/build/system/NewForm/Form.js +21 -28
  210. package/build/system/NewForm/FormAutocomplete.d.ts +2 -0
  211. package/build/system/NewForm/FormAutocomplete.js +386 -381
  212. package/build/system/NewForm/FormAutocomplete.stories.d.ts +156 -0
  213. package/build/system/NewForm/FormAutocomplete.stories.jsx +159 -0
  214. package/build/system/NewForm/FormAutocomplete.test.d.ts +1 -0
  215. package/build/system/NewForm/FormAutocomplete.test.js +40 -73
  216. package/build/system/NewForm/FormAutocompleteMultiselect.d.ts +2 -0
  217. package/build/system/NewForm/FormAutocompleteMultiselect.js +456 -468
  218. package/build/system/NewForm/FormAutocompleteMultiselect.stories.d.ts +45 -0
  219. package/build/system/NewForm/FormAutocompleteMultiselect.stories.jsx +162 -0
  220. package/build/system/NewForm/FormAutocompleteMultiselect.test.d.ts +1 -0
  221. package/build/system/NewForm/FormAutocompleteMultiselect.test.js +37 -73
  222. package/build/system/NewForm/FormSelect.d.ts +2 -0
  223. package/build/system/NewForm/FormSelect.js +159 -140
  224. package/build/system/NewForm/FormSelect.stories.d.ts +137 -0
  225. package/build/system/NewForm/FormSelect.stories.jsx +138 -0
  226. package/build/system/NewForm/FormSelect.test.d.ts +1 -0
  227. package/build/system/NewForm/FormSelect.test.js +131 -227
  228. package/build/system/NewForm/FormSelectArrow.d.ts +2 -0
  229. package/build/system/NewForm/FormSelectArrow.js +35 -35
  230. package/build/system/NewForm/FormSelectContent.d.ts +2 -0
  231. package/build/system/NewForm/FormSelectContent.js +27 -34
  232. package/build/system/NewForm/FormSelectInline.d.ts +30 -0
  233. package/build/system/NewForm/FormSelectInline.js +41 -38
  234. package/build/system/NewForm/FormSelectLoading.d.ts +2 -0
  235. package/build/system/NewForm/FormSelectLoading.js +36 -45
  236. package/build/system/NewForm/FormSelectSearch.d.ts +2 -0
  237. package/build/system/NewForm/FormSelectSearch.js +23 -25
  238. package/build/system/NewForm/Legend.d.ts +2 -0
  239. package/build/system/NewForm/Legend.js +32 -37
  240. package/build/system/NewForm/index.d.ts +12 -0
  241. package/build/system/NewForm/index.js +30 -30
  242. package/build/system/Notice/Notice.d.ts +18 -0
  243. package/build/system/Notice/Notice.js +41 -55
  244. package/build/system/Notice/Notice.stories.d.ts +13 -0
  245. package/build/system/Notice/Notice.stories.js +3 -5
  246. package/build/system/Notice/index.d.ts +5 -0
  247. package/build/system/OptionRow/OptionRow.d.ts +2 -0
  248. package/build/system/OptionRow/OptionRow.js +146 -159
  249. package/build/system/OptionRow/OptionRow.stories.d.ts +8 -0
  250. package/build/system/OptionRow/OptionRow.stories.jsx +53 -0
  251. package/build/system/OptionRow/OptionRow.test.d.ts +1 -0
  252. package/build/system/OptionRow/OptionRow.test.js +38 -67
  253. package/build/system/OptionRow/index.d.ts +2 -0
  254. package/build/system/OptionRow/index.js +5 -4
  255. package/build/system/Progress/Progress.d.ts +2 -0
  256. package/build/system/Progress/Progress.js +69 -84
  257. package/build/system/Progress/Progress.stories.d.ts +8 -0
  258. package/build/system/Progress/Progress.stories.jsx +25 -0
  259. package/build/system/Progress/index.d.ts +2 -0
  260. package/build/system/Progress/index.js +5 -4
  261. package/build/system/ScreenReaderText/ScreenReader.test.d.ts +1 -0
  262. package/build/system/ScreenReaderText/ScreenReader.test.js +21 -25
  263. package/build/system/ScreenReaderText/ScreenReaderText.d.ts +14 -0
  264. package/build/system/ScreenReaderText/ScreenReaderText.js +13 -21
  265. package/build/system/ScreenReaderText/index.d.ts +3 -0
  266. package/build/system/ScreenReaderText/index.js +6 -8
  267. package/build/system/Spinner/Spinner.d.ts +9 -0
  268. package/build/system/Spinner/Spinner.js +12 -19
  269. package/build/system/Spinner/Spinner.stories.d.ts +7 -0
  270. package/build/system/Spinner/Spinner.stories.js +3 -5
  271. package/build/system/Spinner/Spinner.test.d.ts +1 -0
  272. package/build/system/Spinner/Spinner.test.js +59 -0
  273. package/build/system/Spinner/index.d.ts +1 -0
  274. package/build/system/Spinner/index.js +1 -0
  275. package/build/system/Table/Table.d.ts +14 -0
  276. package/build/system/Table/Table.js +7 -21
  277. package/build/system/Table/Table.stories.d.ts +9 -0
  278. package/build/system/Table/Table.stories.js +5 -12
  279. package/build/system/Table/TableCell.d.ts +15 -0
  280. package/build/system/Table/TableCell.js +13 -18
  281. package/build/system/Table/TableRow.d.ts +14 -0
  282. package/build/system/Table/TableRow.js +19 -24
  283. package/build/system/Table/index.d.ts +6 -0
  284. package/build/system/Table/index.js +1 -0
  285. package/build/system/Tabs/Tabs.d.ts +5 -0
  286. package/build/system/Tabs/Tabs.js +40 -38
  287. package/build/system/Tabs/Tabs.stories.d.ts +9 -0
  288. package/build/system/Tabs/Tabs.stories.jsx +69 -0
  289. package/build/system/Tabs/TabsContent.d.ts +16 -0
  290. package/build/system/Tabs/TabsContent.js +23 -30
  291. package/build/system/Tabs/TabsList.d.ts +15 -0
  292. package/build/system/Tabs/TabsList.js +24 -32
  293. package/build/system/Tabs/TabsTrigger.d.ts +2 -0
  294. package/build/system/Tabs/TabsTrigger.js +58 -66
  295. package/build/system/Tabs/index.d.ts +5 -0
  296. package/build/system/Tabs/index.js +8 -10
  297. package/build/system/Text/Text.d.ts +2 -0
  298. package/build/system/Text/Text.js +5 -13
  299. package/build/system/Text/Text.stories.d.ts +8 -0
  300. package/build/system/Text/Text.stories.js +4 -5
  301. package/build/system/Text/index.d.ts +4 -0
  302. package/build/system/Text/index.js +1 -0
  303. package/build/system/Tooltip/Tooltip.css +96 -0
  304. package/build/system/Tooltip/Tooltip.d.ts +15 -0
  305. package/build/system/Tooltip/Tooltip.js +23 -93
  306. package/build/system/Tooltip/Tooltip.stories.d.ts +15 -0
  307. package/build/system/Tooltip/Tooltip.stories.js +83 -21
  308. package/build/system/Tooltip/index.d.ts +5 -0
  309. package/build/system/Wizard/Wizard.d.ts +2 -0
  310. package/build/system/Wizard/Wizard.js +94 -103
  311. package/build/system/Wizard/Wizard.stories.d.ts +9 -0
  312. package/build/system/Wizard/Wizard.stories.jsx +145 -0
  313. package/build/system/Wizard/WizardStep.d.ts +2 -0
  314. package/build/system/Wizard/WizardStep.js +188 -198
  315. package/build/system/Wizard/WizardStepHorizontal.d.ts +2 -0
  316. package/build/system/Wizard/WizardStepHorizontal.js +43 -55
  317. package/build/system/Wizard/index.d.ts +4 -0
  318. package/build/system/Wizard/index.js +7 -8
  319. package/build/system/index.d.ts +51 -0
  320. package/build/system/index.js +104 -86
  321. package/build/system/theme/colors.d.ts +2 -0
  322. package/build/system/theme/colors.js +7 -12
  323. package/build/system/theme/getColor.d.ts +8 -0
  324. package/build/system/theme/getColor.js +47 -46
  325. package/build/system/theme/index.d.ts +322 -0
  326. package/build/system/theme/index.js +494 -396
  327. package/build/system/theme/textStyles.d.ts +71 -0
  328. package/build/system/theme/textStyles.js +45 -50
  329. package/build/system/utils/random.d.ts +1 -0
  330. package/build/system/utils/random.js +3 -7
  331. package/package.json +31 -37
  332. package/src/declaration.d.ts +1 -0
  333. package/src/system/Accordion/{Accordion.test.js → Accordion.test.tsx} +2 -2
  334. package/src/system/Accordion/{Accordion.js → Accordion.tsx} +87 -80
  335. package/src/system/Avatar/Avatar.stories.tsx +18 -0
  336. package/src/system/Avatar/{Avatar.test.js → Avatar.test.tsx} +2 -2
  337. package/src/system/Avatar/{Avatar.js → Avatar.tsx} +17 -19
  338. package/src/system/Avatar/index.ts +4 -0
  339. package/src/system/Badge/Badge.stories.tsx +57 -0
  340. package/src/system/Badge/{Badge.test.js → Badge.test.tsx} +3 -3
  341. package/src/system/Badge/{Badge.js → Badge.tsx} +10 -15
  342. package/src/system/Badge/index.ts +4 -0
  343. package/src/system/Box/Box.stories.tsx +13 -1
  344. package/src/system/Box/Box.tsx +4 -8
  345. package/src/system/Button/Button.stories.tsx +110 -0
  346. package/src/system/Button/Button.tsx +67 -0
  347. package/src/system/Card/{Card.stories.jsx → Card.stories.tsx} +1 -1
  348. package/src/system/Card/{Card.test.js → Card.test.tsx} +2 -2
  349. package/src/system/Card/Card.tsx +40 -0
  350. package/src/system/Card/index.ts +4 -0
  351. package/src/system/Code/Code.stories.tsx +44 -0
  352. package/src/system/Code/{Code.test.js → Code.test.tsx} +6 -4
  353. package/src/system/Code/{Code.js → Code.tsx} +27 -22
  354. package/src/system/Code/index.ts +4 -0
  355. package/src/system/Flex/Flex.tsx +11 -0
  356. package/src/system/Flex/index.ts +4 -0
  357. package/src/system/Grid/Grid.tsx +11 -0
  358. package/src/system/Grid/index.ts +4 -0
  359. package/src/system/Heading/Heading.tsx +8 -17
  360. package/src/system/Link/Link.stories.tsx +23 -0
  361. package/src/system/Link/Link.tsx +43 -0
  362. package/src/system/Link/index.ts +4 -0
  363. package/src/system/NewForm/FormAutocomplete.js +2 -2
  364. package/src/system/Notice/Notice.tsx +129 -0
  365. package/src/system/OptionRow/OptionRow.test.js +1 -1
  366. package/src/system/ScreenReaderText/ScreenReaderText.tsx +40 -0
  367. package/src/system/Spinner/Spinner.test.tsx +30 -0
  368. package/src/system/Spinner/Spinner.tsx +34 -0
  369. package/src/system/Spinner/index.ts +1 -0
  370. package/src/system/Table/{Table.stories.jsx → Table.stories.tsx} +6 -6
  371. package/src/system/Table/{Table.js → Table.tsx} +14 -18
  372. package/src/system/Table/{TableCell.js → TableCell.tsx} +14 -12
  373. package/src/system/Table/TableRow.tsx +63 -0
  374. package/src/system/Table/index.ts +6 -0
  375. package/src/system/Text/{Text.stories.jsx → Text.stories.tsx} +1 -0
  376. package/src/system/Text/Text.tsx +25 -0
  377. package/src/system/Text/index.ts +4 -0
  378. package/src/system/Tooltip/Tooltip.css +96 -0
  379. package/src/system/Tooltip/Tooltip.stories.tsx +133 -0
  380. package/src/system/Tooltip/Tooltip.tsx +39 -0
  381. package/src/system/index.js +1 -2
  382. package/src/system/theme/index.js +21 -1
  383. package/test/fileMock.ts +1 -0
  384. package/test/setupAfterEnv.ts +5 -0
  385. package/tsconfig.definition.json +12 -0
  386. package/.storybook/decorators/withBoundingBox.jsx +0 -22
  387. package/build/system/Box/Box.stories.tsx +0 -11
  388. package/build/system/Box/Box.tsx +0 -22
  389. package/build/system/Button/ButtonSubmit.stories.js +0 -58
  390. package/build/system/ConfirmationDialog/ConfirmationDialog.stories.js +0 -42
  391. package/build/system/Dialog/Dialog.stories.js +0 -70
  392. package/build/system/Dropdown/Dropdown.stories.js +0 -197
  393. package/build/system/Form/Checkbox.stories.js +0 -73
  394. package/build/system/Form/Input.stories.js +0 -51
  395. package/build/system/Form/InputWithCopyButton.stories.js +0 -39
  396. package/build/system/Form/Radio.stories.js +0 -115
  397. package/build/system/Form/RadioBoxGroup.stories.js +0 -62
  398. package/build/system/Form/Textarea.stories.js +0 -59
  399. package/build/system/Form/Toggle.stories.js +0 -104
  400. package/build/system/Heading/Heading.stories.tsx +0 -19
  401. package/build/system/Heading/Heading.tsx +0 -38
  402. package/build/system/NewConfirmationDialog/NewConfirmationDialog.stories.js +0 -46
  403. package/build/system/NewDialog/NewDialog.stories.js +0 -247
  404. package/build/system/NewForm/FormAutocomplete.stories.js +0 -220
  405. package/build/system/NewForm/FormAutocompleteMultiselect.stories.js +0 -231
  406. package/build/system/NewForm/FormSelect.stories.js +0 -171
  407. package/build/system/Notification/Notification.js +0 -97
  408. package/build/system/Notification/Notification.stories.js +0 -29
  409. package/build/system/Notification/index.js +0 -5
  410. package/build/system/OptionRow/OptionRow.stories.js +0 -64
  411. package/build/system/Progress/Progress.stories.js +0 -36
  412. package/build/system/Tabs/Tabs.stories.js +0 -113
  413. package/build/system/Wizard/Wizard.stories.js +0 -182
  414. package/src/system/Avatar/Avatar.stories.jsx +0 -11
  415. package/src/system/Avatar/index.js +0 -6
  416. package/src/system/Badge/Badge.stories.jsx +0 -43
  417. package/src/system/Badge/index.js +0 -6
  418. package/src/system/Button/Button.js +0 -63
  419. package/src/system/Button/Button.stories.jsx +0 -87
  420. package/src/system/Card/Card.js +0 -39
  421. package/src/system/Card/index.js +0 -6
  422. package/src/system/Code/Code.stories.jsx +0 -37
  423. package/src/system/Code/index.js +0 -6
  424. package/src/system/Flex/Flex.js +0 -15
  425. package/src/system/Flex/index.js +0 -6
  426. package/src/system/Grid/Grid.js +0 -16
  427. package/src/system/Grid/index.js +0 -6
  428. package/src/system/Link/Link.js +0 -42
  429. package/src/system/Link/Link.stories.jsx +0 -15
  430. package/src/system/Link/index.js +0 -6
  431. package/src/system/Notice/Notice.js +0 -136
  432. package/src/system/Notification/Notification.js +0 -66
  433. package/src/system/Notification/Notification.stories.jsx +0 -16
  434. package/src/system/Notification/index.js +0 -6
  435. package/src/system/ScreenReaderText/ScreenReaderText.js +0 -39
  436. package/src/system/Spinner/Spinner.js +0 -34
  437. package/src/system/Spinner/index.js +0 -6
  438. package/src/system/Table/TableRow.js +0 -50
  439. package/src/system/Table/index.js +0 -8
  440. package/src/system/Text/Text.js +0 -33
  441. package/src/system/Text/index.js +0 -6
  442. package/src/system/Tooltip/Tooltip.js +0 -79
  443. package/src/system/Tooltip/Tooltip.stories.jsx +0 -22
  444. package/test/fileMock.js +0 -1
  445. package/test/setupAfterEnv.js +0 -13
  446. package/test/setupTests.js +0 -4
  447. /package/.storybook/decorators/{withColorMode.jsx → withColorMode.tsx} +0 -0
  448. /package/src/system/Accordion/{Accordion.stories.jsx → Accordion.stories.tsx} +0 -0
  449. /package/src/system/Accordion/{index.js → index.ts} +0 -0
  450. /package/src/system/Flex/{Flex.stories.jsx → Flex.stories.tsx} +0 -0
  451. /package/src/system/Grid/{Grid.stories.jsx → Grid.stories.tsx} +0 -0
  452. /package/src/system/Notice/{Notice.stories.jsx → Notice.stories.tsx} +0 -0
  453. /package/src/system/Notice/{index.js → index.ts} +0 -0
  454. /package/src/system/Spinner/{Spinner.stories.jsx → Spinner.stories.tsx} +0 -0
  455. /package/src/system/Tooltip/{index.js → index.ts} +0 -0
@@ -1,170 +1,157 @@
1
- "use strict";
2
-
3
- exports.__esModule = true;
4
- exports.OptionRow = void 0;
5
- var _react = _interopRequireDefault(require("react"));
6
- var _md = require("react-icons/md");
7
- var _propTypes = _interopRequireDefault(require("prop-types"));
8
- var _ = require("..");
9
- var _classnames = _interopRequireDefault(require("classnames"));
10
- var _jsxRuntime = require("theme-ui/jsx-runtime");
11
- var _excluded = ["image", "badge", "label", "inline", "subTitle", "body", "meta", "small", "disabled", "order", "className", "titleVariant", "variant"];
12
1
  /** @jsxImportSource theme-ui */
2
+
13
3
  /**
14
4
  * External dependencies
15
5
  */
6
+ import React from 'react';
7
+ import { MdArrowForward } from 'react-icons/md';
8
+ import PropTypes from 'prop-types';
9
+
16
10
  /**
17
11
  * Internal dependencies
18
12
  */
19
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
20
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
21
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
22
- var disabledStyles = {
23
- border: '1px solid',
24
- borderColor: 'optionRow.border',
25
- background: 'none',
26
- boxShadow: 'none',
27
- color: 'optionRow.text'
28
- };
29
- var gridInlineStyle = {
30
- py: 2,
31
- px: 2
13
+ import { Badge, Box, Grid, Heading, Text, Link } from '..';
14
+ import classNames from 'classnames';
15
+
16
+ const disabledStyles = {
17
+ border: '1px solid',
18
+ borderColor: 'optionRow.border',
19
+ background: 'none',
20
+ boxShadow: 'none',
21
+ color: 'optionRow.text',
32
22
  };
33
- var regularGridStyle = function regularGridStyle() {
34
- return {
35
- py: 3,
36
- px: 3,
37
- borderBottom: '1px solid',
38
- borderColor: 'optionRow.border'
39
- };
23
+
24
+ const gridInlineStyle = {
25
+ py: 2,
26
+ px: 2,
40
27
  };
41
- var OptionRow = /*#__PURE__*/_react["default"].forwardRef(function (_ref, forwardRef) {
42
- var image = _ref.image,
43
- badge = _ref.badge,
44
- label = _ref.label,
45
- _ref$inline = _ref.inline,
46
- inline = _ref$inline === void 0 ? false : _ref$inline,
47
- subTitle = _ref.subTitle,
48
- body = _ref.body,
49
- meta = _ref.meta,
50
- _ref$small = _ref.small,
51
- small = _ref$small === void 0 ? false : _ref$small,
52
- _ref$disabled = _ref.disabled,
53
- disabled = _ref$disabled === void 0 ? false : _ref$disabled,
54
- _ref$order = _ref.order,
55
- order = _ref$order === void 0 ? null : _ref$order,
56
- _ref$className = _ref.className,
57
- className = _ref$className === void 0 ? null : _ref$className,
58
- _ref$titleVariant = _ref.titleVariant,
59
- titleVariant = _ref$titleVariant === void 0 ? 'h3' : _ref$titleVariant,
60
- _ref$variant = _ref.variant,
61
- variant = _ref$variant === void 0 ? 'default' : _ref$variant,
62
- rest = _objectWithoutPropertiesLoose(_ref, _excluded);
63
- var mergedCard = disabled ? disabledStyles : {};
64
- var inlineStyles = inline ? gridInlineStyle : regularGridStyle(small);
65
- return (0, _jsxRuntime.jsxs)(_.Grid, {
66
- columns: [1, 1, 'auto 1fr auto'],
67
- gap: [3, 3, "" + (small ? 3 : 4)],
68
- "data-order": order || undefined,
69
- className: (0, _classnames["default"])('vip-option-row-component', className),
70
- ref: forwardRef,
71
- sx: _extends({
72
- position: 'relative',
73
- alignItems: 'center',
74
- '&:hover': !disabled && {
75
- backgroundColor: 'optionRow.hover'
76
- }
77
- }, inlineStyles),
78
- children: [(0, _jsxRuntime.jsx)(_.Box, {
79
- children: !!image && (0, _jsxRuntime.jsx)(_.Box, {
80
- sx: _extends({
81
- display: ['inline-block', 'inline-block', 'block'],
82
- p: small ? 12 : 20,
83
- flex: '0 0 auto',
84
- bg: "optionRow." + variant + ".background",
85
- color: "optionRow." + variant + ".icon",
86
- borderRadius: 1
87
- }, mergedCard),
88
- children: /*#__PURE__*/_react["default"].isValidElement(image) ? image : (0, _jsxRuntime.jsx)("img", {
89
- src: image,
90
- width: small ? 32 : 48,
91
- sx: {
92
- display: 'block'
93
- },
94
- alt: ""
95
- })
96
- })
97
- }), (0, _jsxRuntime.jsxs)(_.Box, {
98
- sx: {
99
- flex: '1 1 auto'
100
- },
101
- children: [(0, _jsxRuntime.jsx)(_.Heading, {
102
- variant: titleVariant,
103
- sx: {
104
- mb: subTitle || body ? 1 : 0,
105
- fontSize: 2,
106
- fontWeight: 'bold'
107
- },
108
- children: (0, _jsxRuntime.jsxs)(_.Link, _extends({
109
- as: 'a',
110
- sx: {
111
- cursor: disabled ? 'auto' : 'pointer',
112
- color: disabled ? 'optionRow.text' : 'optionRow.textAccent',
113
- '&:after': {
114
- content: '""',
115
- position: 'absolute',
116
- top: 0,
117
- right: 0,
118
- bottom: 0,
119
- left: 0
120
- }
121
- }
122
- }, rest, {
123
- children: [label, badge && (0, _jsxRuntime.jsx)(_.Badge, {
124
- sx: {
125
- marginLeft: 2
126
- },
127
- children: badge
128
- })]
129
- }))
130
- }), subTitle && (0, _jsxRuntime.jsx)(_.Text, {
131
- sx: {
132
- mb: 1,
133
- color: 'optionRow.text'
134
- },
135
- children: subTitle
136
- }), body && (0, _jsxRuntime.jsx)(_.Text, {
137
- sx: {
138
- mb: 0
139
- },
140
- children: body
141
- })]
142
- }), false !== meta && '' !== meta && (0, _jsxRuntime.jsx)(_.Box, {
143
- "data-testid": "meta",
144
- children: meta ? meta : (0, _jsxRuntime.jsx)(_md.MdArrowForward, {
145
- size: 24,
146
- sx: {
147
- color: 'optionRow.text'
148
- },
149
- "aria-hidden": "true"
150
- })
151
- })]
152
- });
153
- });
154
- exports.OptionRow = OptionRow;
28
+
29
+ const regularGridStyle = () => ( {
30
+ py: 3,
31
+ px: 3,
32
+ borderBottom: '1px solid',
33
+ borderColor: 'optionRow.border',
34
+ } );
35
+
36
+ const OptionRow = React.forwardRef(
37
+ (
38
+ {
39
+ image,
40
+ badge,
41
+ label,
42
+ inline = false,
43
+ subTitle,
44
+ body,
45
+ meta,
46
+ small = false,
47
+ disabled = false,
48
+ order = null,
49
+ className = null,
50
+ titleVariant = 'h3',
51
+ variant = 'default',
52
+ ...rest
53
+ },
54
+ forwardRef
55
+ ) => {
56
+ const mergedCard = disabled ? disabledStyles : {};
57
+ const inlineStyles = inline ? gridInlineStyle : regularGridStyle( small );
58
+
59
+ return (
60
+ <Grid
61
+ columns={ [ 1, 1, 'auto 1fr auto' ] }
62
+ gap={ [ 3, 3, `${ small ? 3 : 4 }` ] }
63
+ data-order={ order || undefined }
64
+ className={ classNames( 'vip-option-row-component', className ) }
65
+ ref={ forwardRef }
66
+ sx={ {
67
+ position: 'relative',
68
+ alignItems: 'center',
69
+ '&:hover': ! disabled && {
70
+ backgroundColor: 'optionRow.hover',
71
+ },
72
+ ...inlineStyles,
73
+ } }
74
+ >
75
+ <Box>
76
+ { !! image && (
77
+ <Box
78
+ sx={ {
79
+ display: [ 'inline-block', 'inline-block', 'block' ],
80
+ p: small ? 12 : 20,
81
+ flex: '0 0 auto',
82
+ bg: `optionRow.${ variant }.background`,
83
+ color: `optionRow.${ variant }.icon`,
84
+ borderRadius: 1,
85
+ ...mergedCard,
86
+ } }
87
+ >
88
+ { React.isValidElement( image ) ? (
89
+ image
90
+ ) : (
91
+ <img src={ image } width={ small ? 32 : 48 } sx={ { display: 'block' } } alt="" />
92
+ ) }
93
+ </Box>
94
+ ) }
95
+ </Box>
96
+
97
+ <Box sx={ { flex: '1 1 auto' } }>
98
+ <Heading
99
+ variant={ titleVariant }
100
+ sx={ { mb: subTitle || body ? 1 : 0, fontSize: 2, fontWeight: 'bold' } }
101
+ >
102
+ <Link
103
+ as={ 'a' }
104
+ sx={ {
105
+ cursor: disabled ? 'auto' : 'pointer',
106
+ color: disabled ? 'optionRow.text' : 'optionRow.textAccent',
107
+ '&:after': {
108
+ content: '""',
109
+ position: 'absolute',
110
+ top: 0,
111
+ right: 0,
112
+ bottom: 0,
113
+ left: 0,
114
+ },
115
+ } }
116
+ { ...rest }
117
+ >
118
+ { label }
119
+ { badge && <Badge sx={ { marginLeft: 2 } }>{ badge }</Badge> }
120
+ </Link>
121
+ </Heading>
122
+ { subTitle && <Text sx={ { mb: 1, color: 'optionRow.text' } }>{ subTitle }</Text> }
123
+ { body && <Text sx={ { mb: 0 } }>{ body }</Text> }
124
+ </Box>
125
+ { false !== meta && '' !== meta && (
126
+ <Box data-testid="meta">
127
+ { meta ? (
128
+ meta
129
+ ) : (
130
+ <MdArrowForward size={ 24 } sx={ { color: 'optionRow.text' } } aria-hidden="true" />
131
+ ) }
132
+ </Box>
133
+ ) }
134
+ </Grid>
135
+ );
136
+ }
137
+ );
138
+
155
139
  OptionRow.displayName = 'OptionRow';
140
+
156
141
  OptionRow.propTypes = {
157
- image: _propTypes["default"].oneOfType([_propTypes["default"].object, _propTypes["default"].string]),
158
- badge: _propTypes["default"].string,
159
- label: _propTypes["default"].node,
160
- inline: _propTypes["default"].bool,
161
- subTitle: _propTypes["default"].node,
162
- body: _propTypes["default"].node,
163
- meta: _propTypes["default"].node,
164
- small: _propTypes["default"].bool,
165
- disabled: _propTypes["default"].bool,
166
- order: _propTypes["default"].number,
167
- className: _propTypes["default"].any,
168
- titleVariant: _propTypes["default"].string,
169
- variant: _propTypes["default"].oneOf(['default', 'alt'])
170
- };
142
+ image: PropTypes.oneOfType( [ PropTypes.object, PropTypes.string ] ),
143
+ badge: PropTypes.string,
144
+ label: PropTypes.node,
145
+ inline: PropTypes.bool,
146
+ subTitle: PropTypes.node,
147
+ body: PropTypes.node,
148
+ meta: PropTypes.node,
149
+ small: PropTypes.bool,
150
+ disabled: PropTypes.bool,
151
+ order: PropTypes.number,
152
+ className: PropTypes.any,
153
+ titleVariant: PropTypes.string,
154
+ variant: PropTypes.oneOf( [ 'default', 'alt' ] ),
155
+ };
156
+
157
+ export { OptionRow };
@@ -0,0 +1,8 @@
1
+ declare namespace _default {
2
+ export let title: string;
3
+ export { OptionRow as component };
4
+ }
5
+ export default _default;
6
+ export function Default(): import("react").JSX.Element;
7
+ export function Alternative(): import("react").JSX.Element;
8
+ import { OptionRow } from '..';
@@ -0,0 +1,53 @@
1
+ /**
2
+ * External dependencies
3
+ */
4
+
5
+ import { BiAddToQueue, BiCalendarHeart, BiBellMinus } from 'react-icons/bi';
6
+
7
+ /**
8
+ * Internal dependencies
9
+ */
10
+ import { Box, OptionRow } from '..';
11
+
12
+ export default {
13
+ title: 'OptionRow',
14
+ component: OptionRow,
15
+ };
16
+
17
+ // eslint-disable-next-line react/prop-types
18
+ const Base = ( { variant } ) => (
19
+ <Box>
20
+ <OptionRow
21
+ image={ <BiAddToQueue size={ 24 } /> }
22
+ label="Option Row 1"
23
+ subTitle="Mostly used to link off to other pages."
24
+ as="a"
25
+ href="http://google.com/"
26
+ variant={ variant }
27
+ />
28
+ <OptionRow
29
+ image={ <BiCalendarHeart size={ 24 } /> }
30
+ label="Option Row 2"
31
+ subTitle="Mostly used to link off to other pages."
32
+ as="a"
33
+ href="http://google.com/"
34
+ order={ 2 }
35
+ variant={ variant }
36
+ />
37
+
38
+ <OptionRow
39
+ image={ <BiBellMinus size={ 24 } /> }
40
+ label="Custom heading HTML h2"
41
+ subTitle="Use the variant prop to adjust the heading structure"
42
+ as="a"
43
+ href="http://google.com/"
44
+ titleVariant="h2"
45
+ meta=""
46
+ variant={ variant }
47
+ />
48
+ </Box>
49
+ );
50
+
51
+ export const Default = () => <Base />;
52
+
53
+ export const Alternative = () => <Base variant="alt" />;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,70 +1,41 @@
1
- "use strict";
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import { render, screen } from '@testing-library/react';
5
+ import { axe } from 'jest-axe';
2
6
 
3
- var _react = require("@testing-library/react");
4
- var _jestAxe = require("jest-axe");
5
- var _OptionRow = require("./OptionRow");
6
- var _jsxRuntime = require("theme-ui/jsx-runtime");
7
- function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
8
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
9
- function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } /**
10
- * External dependencies
11
- */ /**
12
- * Internal dependencies
13
- */
14
- describe('<OptionRow />', function () {
15
- it('renders the OptionRow', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
16
- var _render, container;
17
- return _regeneratorRuntime().wrap(function _callee$(_context) {
18
- while (1) switch (_context.prev = _context.next) {
19
- case 0:
20
- _render = (0, _react.render)((0, _jsxRuntime.jsx)(_OptionRow.OptionRow, {
21
- label: "Option Row",
22
- subTitle: "Mostly used to link off to other pages.",
23
- as: "a"
24
- })), container = _render.container;
25
- expect(_react.screen.getByText('Mostly used to link off to other pages.')).toBeInTheDocument();
7
+ /**
8
+ * Internal dependencies
9
+ */
10
+ import { OptionRow } from './OptionRow';
26
11
 
27
- // Check for accessibility issues
28
- _context.t0 = expect;
29
- _context.next = 5;
30
- return (0, _jestAxe.axe)(container);
31
- case 5:
32
- _context.t1 = _context.sent;
33
- _context.next = 8;
34
- return (0, _context.t0)(_context.t1).toHaveNoViolations();
35
- case 8:
36
- case "end":
37
- return _context.stop();
38
- }
39
- }, _callee);
40
- })));
41
- it('renders a disabled OptionRow', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
42
- var _render2, container;
43
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
44
- while (1) switch (_context2.prev = _context2.next) {
45
- case 0:
46
- _render2 = (0, _react.render)((0, _jsxRuntime.jsx)(_OptionRow.OptionRow, {
47
- label: "Option Row",
48
- subTitle: "Mostly used to link off to other pages.",
49
- as: "a",
50
- disabled: true,
51
- variant: "h3",
52
- meta: ""
53
- })), container = _render2.container;
54
- expect(_react.screen.queryByTestId('meta')).not.toBeInTheDocument();
12
+ describe( '<OptionRow />', () => {
13
+ it( 'renders the OptionRow', async () => {
14
+ const { container } = render(
15
+ <OptionRow label="Option Row" subTitle="Mostly used to link off to other pages." as="a" />
16
+ );
55
17
 
56
- // Check for accessibility issues
57
- _context2.t0 = expect;
58
- _context2.next = 5;
59
- return (0, _jestAxe.axe)(container);
60
- case 5:
61
- _context2.t1 = _context2.sent;
62
- _context2.next = 8;
63
- return (0, _context2.t0)(_context2.t1).toHaveNoViolations();
64
- case 8:
65
- case "end":
66
- return _context2.stop();
67
- }
68
- }, _callee2);
69
- })));
70
- });
18
+ expect( screen.getByText( 'Mostly used to link off to other pages.' ) ).toBeInTheDocument();
19
+
20
+ // Check for accessibility issues
21
+ await expect( await axe( container ) ).toHaveNoViolations();
22
+ } );
23
+
24
+ it( 'renders a disabled OptionRow', async () => {
25
+ const { container } = render(
26
+ <OptionRow
27
+ label="Option Row"
28
+ subTitle="Mostly used to link off to other pages."
29
+ as="a"
30
+ disabled
31
+ variant="default"
32
+ meta=""
33
+ />
34
+ );
35
+
36
+ expect( screen.queryByTestId( 'meta' ) ).not.toBeInTheDocument();
37
+
38
+ // Check for accessibility issues
39
+ await expect( await axe( container ) ).toHaveNoViolations();
40
+ } );
41
+ } );
@@ -0,0 +1,2 @@
1
+ export { OptionRow };
2
+ import { OptionRow } from './OptionRow';
@@ -1,5 +1,6 @@
1
- "use strict";
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import { OptionRow } from './OptionRow';
2
5
 
3
- exports.__esModule = true;
4
- var _OptionRow = require("./OptionRow");
5
- exports.OptionRow = _OptionRow.OptionRow;
6
+ export { OptionRow };
@@ -0,0 +1,2 @@
1
+ export const Progress: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
2
+ import React from 'react';