@moda/om 16.1.0 → 16.2.1

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 (331) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/index.cjs.js +316 -284
  3. package/dist/index.cjs.js.map +1 -1
  4. package/dist/index.esm.js +315 -283
  5. package/dist/index.esm.js.map +1 -1
  6. package/dist/{__mocks__ → src/__mocks__}/Icon.d.ts +0 -0
  7. package/dist/{components → src/components}/AspectRatioBox/AspectRatioBox.d.ts +0 -0
  8. package/dist/{components → src/components}/AspectRatioBox/AspectRatioBox.stories.d.ts +0 -0
  9. package/dist/{components → src/components}/AspectRatioBox/AspectRatioBox.test.d.ts +0 -0
  10. package/dist/{components → src/components}/AspectRatioBox/index.d.ts +0 -0
  11. package/dist/{components → src/components}/Badge/Badge.d.ts +0 -0
  12. package/dist/{components → src/components}/Badge/Badge.stories.d.ts +0 -0
  13. package/dist/{components → src/components}/Badge/Badge.test.d.ts +0 -0
  14. package/dist/{components → src/components}/Badge/index.d.ts +0 -0
  15. package/dist/{components → src/components}/Breadcrumbs/Breadcrumb/Breadcrumb.d.ts +0 -0
  16. package/dist/{components → src/components}/Breadcrumbs/Breadcrumb/index.d.ts +0 -0
  17. package/dist/{components → src/components}/Breadcrumbs/Breadcrumbs.d.ts +0 -0
  18. package/dist/{components → src/components}/Breadcrumbs/Breadcrumbs.stories.d.ts +0 -0
  19. package/dist/{components → src/components}/Breadcrumbs/Breadcrumbs.test.d.ts +0 -0
  20. package/dist/{components → src/components}/Breadcrumbs/index.d.ts +0 -0
  21. package/dist/{components → src/components}/Breakpoint/Breakpoint.d.ts +0 -0
  22. package/dist/{components → src/components}/Breakpoint/Breakpoint.stories.d.ts +0 -0
  23. package/dist/{components → src/components}/Breakpoint/Breakpoint.test.d.ts +0 -0
  24. package/dist/{components → src/components}/Breakpoint/BreakpointProvider.d.ts +0 -0
  25. package/dist/{components → src/components}/Breakpoint/generateMediaQuery.d.ts +0 -0
  26. package/dist/{components → src/components}/Breakpoint/generateMediaQuery.test.d.ts +0 -0
  27. package/dist/{components → src/components}/Breakpoint/index.d.ts +0 -0
  28. package/dist/{components → src/components}/Button/Button.d.ts +0 -0
  29. package/dist/{components → src/components}/Button/Button.stories.d.ts +0 -0
  30. package/dist/{components → src/components}/Button/Button.test.d.ts +0 -0
  31. package/dist/{components → src/components}/Button/index.d.ts +0 -0
  32. package/dist/{components → src/components}/Checkbox/Checkbox.d.ts +1 -1
  33. package/dist/{components → src/components}/Checkbox/Checkbox.stories.d.ts +0 -0
  34. package/dist/{components → src/components}/Checkbox/Checkbox.test.d.ts +0 -0
  35. package/dist/{components → src/components}/Checkbox/index.d.ts +0 -0
  36. package/dist/{components → src/components}/Clickable/Clickable.d.ts +0 -0
  37. package/dist/{components → src/components}/Clickable/Clickable.stories.d.ts +0 -0
  38. package/dist/{components → src/components}/Clickable/Clickable.test.d.ts +0 -0
  39. package/dist/{components → src/components}/Clickable/index.d.ts +0 -0
  40. package/dist/{components → src/components}/ColorSwatch/ColorSwatch.d.ts +0 -0
  41. package/dist/{components → src/components}/ColorSwatch/ColorSwatch.stories.d.ts +0 -0
  42. package/dist/{components → src/components}/ColorSwatch/ColorSwatch.test.d.ts +0 -0
  43. package/dist/{components → src/components}/ColorSwatch/index.d.ts +0 -0
  44. package/dist/{components → src/components}/ColorSwatch/skuColors.d.ts +0 -0
  45. package/dist/{components → src/components}/Constrain/Constrain.d.ts +0 -0
  46. package/dist/{components → src/components}/Constrain/Constrain.stories.d.ts +0 -0
  47. package/dist/{components → src/components}/Constrain/Constrain.test.d.ts +0 -0
  48. package/dist/{components → src/components}/Constrain/ExceedConstrain.d.ts +0 -0
  49. package/dist/{components → src/components}/Constrain/ExceedConstrain.stories.d.ts +0 -0
  50. package/dist/{components → src/components}/Constrain/index.d.ts +0 -0
  51. package/dist/{components → src/components}/ControlLink/ControlLink.d.ts +0 -0
  52. package/dist/{components → src/components}/ControlLink/ControlLink.stories.d.ts +0 -0
  53. package/dist/{components → src/components}/ControlLink/ControlLink.test.d.ts +0 -0
  54. package/dist/{components → src/components}/ControlLink/index.d.ts +0 -0
  55. package/dist/{components → src/components}/CreditCardNumberInput/CreditCardNumberInput.d.ts +0 -0
  56. package/dist/{components → src/components}/CreditCardNumberInput/CreditCardNumberInput.stories.d.ts +0 -0
  57. package/dist/{components → src/components}/CreditCardNumberInput/CreditCardNumberInput.test.d.ts +0 -0
  58. package/dist/{components → src/components}/CreditCardNumberInput/CreditCardNumberInputField.d.ts +0 -0
  59. package/dist/{components → src/components}/CreditCardNumberInput/index.d.ts +0 -0
  60. package/dist/{components → src/components}/DefinitionList/DefinitionList.d.ts +0 -0
  61. package/dist/{components → src/components}/DefinitionList/DefinitionList.stories.d.ts +0 -0
  62. package/dist/{components → src/components}/DefinitionList/DefinitionList.test.d.ts +0 -0
  63. package/dist/{components → src/components}/DefinitionList/index.d.ts +0 -0
  64. package/dist/{components → src/components}/Divider/Divider.d.ts +0 -0
  65. package/dist/{components → src/components}/Divider/Divider.stories.d.ts +0 -0
  66. package/dist/{components → src/components}/Divider/Divider.test.d.ts +0 -0
  67. package/dist/{components → src/components}/Divider/NoLineDivider.d.ts +0 -0
  68. package/dist/{components → src/components}/Divider/TwoLineDivider.d.ts +0 -0
  69. package/dist/{components → src/components}/Divider/index.d.ts +0 -0
  70. package/dist/{components → src/components}/Expandable/Expandable.d.ts +0 -0
  71. package/dist/{components → src/components}/Expandable/Expandable.stories.d.ts +0 -0
  72. package/dist/{components → src/components}/Expandable/Expandable.test.d.ts +0 -0
  73. package/dist/{components → src/components}/Expandable/index.d.ts +0 -0
  74. package/dist/{components → src/components}/Field/Field.d.ts +0 -0
  75. package/dist/{components → src/components}/Field/Field.stories.d.ts +0 -0
  76. package/dist/{components → src/components}/Field/Field.test.d.ts +0 -0
  77. package/dist/{components → src/components}/Field/index.d.ts +0 -0
  78. package/dist/{components → src/components}/Label/Label.d.ts +0 -0
  79. package/dist/{components → src/components}/Label/Label.stories.d.ts +0 -0
  80. package/dist/{components → src/components}/Label/Label.test.d.ts +0 -0
  81. package/dist/{components → src/components}/Label/index.d.ts +0 -0
  82. package/dist/{components → src/components}/Loading/Loading.d.ts +0 -0
  83. package/dist/{components → src/components}/Loading/Loading.stories.d.ts +0 -0
  84. package/dist/{components → src/components}/Loading/Loading.test.d.ts +0 -0
  85. package/dist/{components → src/components}/Loading/index.d.ts +0 -0
  86. package/dist/{components → src/components}/LoadingBalls/LoadingBalls.d.ts +0 -0
  87. package/dist/{components → src/components}/LoadingBalls/LoadingBalls.stories.d.ts +0 -0
  88. package/dist/{components → src/components}/LoadingBalls/index.d.ts +0 -0
  89. package/dist/{components → src/components}/Modal/Modal.d.ts +0 -0
  90. package/dist/{components → src/components}/Modal/Modal.stories.d.ts +0 -0
  91. package/dist/{components → src/components}/Modal/Modal.test.d.ts +0 -0
  92. package/dist/{components → src/components}/Modal/index.d.ts +0 -0
  93. package/dist/{components → src/components}/ModalOverlay/ModalOverlay.d.ts +0 -0
  94. package/dist/{components → src/components}/ModalOverlay/ModalOverlay.stories.d.ts +0 -0
  95. package/dist/{components → src/components}/ModalOverlay/ModalOverlay.test.d.ts +0 -0
  96. package/dist/{components → src/components}/ModalOverlay/index.d.ts +0 -0
  97. package/dist/{components → src/components}/Overlay/Overlay.d.ts +0 -0
  98. package/dist/{components → src/components}/Overlay/Overlay.stories.d.ts +0 -0
  99. package/dist/{components → src/components}/Overlay/Overlay.test.d.ts +0 -0
  100. package/dist/{components → src/components}/Overlay/index.d.ts +0 -0
  101. package/dist/{components → src/components}/Paginator/Paginator.d.ts +0 -0
  102. package/dist/{components → src/components}/Paginator/Paginator.stories.d.ts +0 -0
  103. package/dist/{components → src/components}/Paginator/index.d.ts +0 -0
  104. package/dist/{components → src/components}/PasswordInput/PasswordInput.d.ts +0 -0
  105. package/dist/{components → src/components}/PasswordInput/PasswordInput.stories.d.ts +0 -0
  106. package/dist/{components → src/components}/PasswordInput/index.d.ts +0 -0
  107. package/dist/{components → src/components}/Popover/Popover.d.ts +0 -0
  108. package/dist/{components → src/components}/Popover/Popover.stories.d.ts +0 -0
  109. package/dist/{components → src/components}/Popover/Popover.test.d.ts +0 -0
  110. package/dist/{components → src/components}/Popover/index.d.ts +0 -0
  111. package/dist/{components → src/components}/PromoBanner/PromoBanner.d.ts +0 -0
  112. package/dist/{components → src/components}/PromoBanner/PromoBanner.stories.d.ts +0 -0
  113. package/dist/{components → src/components}/PromoBanner/PromoBanner.test.d.ts +0 -0
  114. package/dist/{components → src/components}/PromoBanner/index.d.ts +0 -0
  115. package/dist/{components → src/components}/RadioButton/RadioButton.d.ts +0 -0
  116. package/dist/{components → src/components}/RadioButton/RadioButton.stories.d.ts +0 -0
  117. package/dist/{components → src/components}/RadioButton/RadioButton.test.d.ts +0 -0
  118. package/dist/{components → src/components}/RadioButton/index.d.ts +0 -0
  119. package/dist/{components → src/components}/SearchInput/SearchInput.d.ts +0 -0
  120. package/dist/{components → src/components}/SearchInput/SearchInput.stories.d.ts +0 -0
  121. package/dist/{components → src/components}/SearchInput/SearchInput.test.d.ts +0 -0
  122. package/dist/{components → src/components}/SearchInput/index.d.ts +0 -0
  123. package/dist/{components → src/components}/Select/MultiSelect.d.ts +0 -0
  124. package/dist/{components → src/components}/Select/Select.d.ts +0 -0
  125. package/dist/{components → src/components}/Select/Select.stories.d.ts +0 -0
  126. package/dist/{components → src/components}/Select/Select.test.d.ts +0 -0
  127. package/dist/{components → src/components}/Select/SelectLabel.d.ts +0 -0
  128. package/dist/{components → src/components}/Select/SelectOption.d.ts +0 -0
  129. package/dist/{components → src/components}/Select/SelectOptions.d.ts +0 -0
  130. package/dist/{components → src/components}/Select/index.d.ts +0 -0
  131. package/dist/{components → src/components}/Select/useSelect.d.ts +0 -0
  132. package/dist/{components → src/components}/SelectableButton/SelectableButton.d.ts +0 -0
  133. package/dist/{components → src/components}/SelectableButton/SelectableButton.stories.d.ts +0 -0
  134. package/dist/{components → src/components}/SelectableButton/SelectableButton.test.d.ts +0 -0
  135. package/dist/{components → src/components}/SelectableButton/index.d.ts +0 -0
  136. package/dist/{components → src/components}/Shape/ArcWindow.d.ts +0 -0
  137. package/dist/{components → src/components}/Shape/Bradley.d.ts +0 -0
  138. package/dist/{components → src/components}/Shape/Brancusi.d.ts +0 -0
  139. package/dist/{components → src/components}/Shape/Circle.d.ts +0 -0
  140. package/dist/{components → src/components}/Shape/Diamond.d.ts +0 -0
  141. package/dist/{components → src/components}/Shape/Keyhole.d.ts +0 -0
  142. package/dist/{components → src/components}/Shape/Mirror.d.ts +0 -0
  143. package/dist/{components → src/components}/Shape/Oval.d.ts +0 -0
  144. package/dist/{components → src/components}/Shape/Shape.d.ts +0 -0
  145. package/dist/{components → src/components}/Shape/Shape.stories.d.ts +0 -0
  146. package/dist/{components → src/components}/Shape/Triangle.d.ts +0 -0
  147. package/dist/{components → src/components}/Shape/Window.d.ts +0 -0
  148. package/dist/{components → src/components}/Shape/index.d.ts +0 -0
  149. package/dist/{components → src/components}/Stack/Stack.d.ts +0 -0
  150. package/dist/{components → src/components}/Stack/Stack.stories.d.ts +0 -0
  151. package/dist/{components → src/components}/Stack/Stack.test.d.ts +0 -0
  152. package/dist/{components → src/components}/Stack/index.d.ts +0 -0
  153. package/dist/{components → src/components}/Tabs/Tab.d.ts +0 -0
  154. package/dist/{components → src/components}/Tabs/TabList.d.ts +0 -0
  155. package/dist/{components → src/components}/Tabs/TabPanel.d.ts +0 -0
  156. package/dist/{components → src/components}/Tabs/TabPanels.d.ts +0 -0
  157. package/dist/{components → src/components}/Tabs/Tabs.d.ts +0 -0
  158. package/dist/{components → src/components}/Tabs/Tabs.stories.d.ts +0 -0
  159. package/dist/{components → src/components}/Tabs/Tabs.test.d.ts +0 -0
  160. package/dist/{components → src/components}/Tabs/index.d.ts +0 -0
  161. package/dist/{components → src/components}/Tag/Tag.d.ts +0 -0
  162. package/dist/{components → src/components}/Tag/Tag.stories.d.ts +0 -0
  163. package/dist/{components → src/components}/Tag/Tag.test.d.ts +0 -0
  164. package/dist/{components → src/components}/Tag/index.d.ts +0 -0
  165. package/dist/{components → src/components}/Text/Text.d.ts +0 -0
  166. package/dist/{components → src/components}/Text/Text.stories.d.ts +0 -0
  167. package/dist/{components → src/components}/Text/Text.test.d.ts +0 -0
  168. package/dist/{components → src/components}/Text/index.d.ts +0 -0
  169. package/dist/{components → src/components}/TextInput/TextInput.d.ts +0 -0
  170. package/dist/{components → src/components}/TextInput/TextInput.stories.d.ts +0 -0
  171. package/dist/{components → src/components}/TextInput/TextInput.test.d.ts +0 -0
  172. package/dist/{components → src/components}/TextInput/index.d.ts +0 -0
  173. package/dist/{components → src/components}/Textarea/Textarea.d.ts +0 -0
  174. package/dist/{components → src/components}/Textarea/Textarea.stories.d.ts +0 -0
  175. package/dist/{components → src/components}/Textarea/Textarea.test.d.ts +0 -0
  176. package/dist/{components → src/components}/Textarea/index.d.ts +0 -0
  177. package/dist/{components → src/components}/Toast/Toast.d.ts +0 -0
  178. package/dist/{components → src/components}/Toast/Toast.stories.d.ts +0 -0
  179. package/dist/{components → src/components}/Toast/Toast.test.d.ts +0 -0
  180. package/dist/{components → src/components}/Toast/index.d.ts +0 -0
  181. package/dist/{components → src/components}/VerticalDivider/VerticalDivider.d.ts +0 -0
  182. package/dist/{components → src/components}/VerticalDivider/VerticalDivider.stories.d.ts +0 -0
  183. package/dist/{components → src/components}/VerticalDivider/VerticalDivider.test.d.ts +0 -0
  184. package/dist/{components → src/components}/VerticalDivider/index.d.ts +0 -0
  185. package/dist/{components → src/components}/index.d.ts +0 -0
  186. package/dist/{hooks → src/hooks}/index.d.ts +0 -0
  187. package/dist/{hooks → src/hooks}/useBreakpoint.d.ts +0 -0
  188. package/dist/{hooks → src/hooks}/useClickOutside.d.ts +0 -0
  189. package/dist/{hooks → src/hooks}/useKeyboardListNavigation.d.ts +0 -0
  190. package/dist/{hooks → src/hooks}/useKeyboardListNavigation.spec.d.ts +0 -0
  191. package/dist/{hooks → src/hooks}/useUpdateEffect.d.ts +0 -0
  192. package/dist/{index.d.ts → src/index.d.ts} +0 -0
  193. package/dist/{mixins → src/mixins}/font-smoothing/font-smoothing.stories.d.ts +0 -0
  194. package/dist/{mixins → src/mixins}/overflow-scroll/overflow-scroll.stories.d.ts +0 -0
  195. package/dist/{mixins → src/mixins}/stack/stack.stories.d.ts +0 -0
  196. package/dist/{mixins → src/mixins}/thin-underline/thin-underline.stories.d.ts +0 -0
  197. package/dist/{mixins → src/mixins}/visually-hidden/visually-hidden.stories.d.ts +0 -0
  198. package/dist/{utilities → src/utilities}/States/State.d.ts +0 -0
  199. package/dist/{utilities → src/utilities}/States/States.d.ts +0 -0
  200. package/dist/{utilities → src/utilities}/States/StatesProps.d.ts +0 -0
  201. package/dist/{utilities → src/utilities}/States/index.d.ts +0 -0
  202. package/dist/{utilities → src/utilities}/States/isRenderProps.d.ts +0 -0
  203. package/dist/{utilities → src/utilities}/States/stringifyProps.d.ts +0 -0
  204. package/dist/{utilities → src/utilities}/index.d.ts +0 -0
  205. package/dist/{utilities → src/utilities}/omit.d.ts +0 -0
  206. package/dist/{utilities → src/utilities}/sample.d.ts +0 -0
  207. package/dist/styles.css +1 -1
  208. package/dist/test/mocks/matchMedia.d.ts +1 -0
  209. package/dist/test/setupTests.d.ts +3 -0
  210. package/package.json +30 -19
  211. package/src/components/AspectRatioBox/AspectRatioBox.test.tsx +3 -3
  212. package/src/components/AspectRatioBox/AspectRatioBox.tsx +4 -4
  213. package/src/components/AspectRatioBox/index.ts +1 -1
  214. package/src/components/Badge/Badge.stories.tsx +5 -5
  215. package/src/components/Badge/Badge.test.tsx +5 -12
  216. package/src/components/Breadcrumbs/Breadcrumb/Breadcrumb.tsx +6 -6
  217. package/src/components/Breadcrumbs/Breadcrumbs.stories.tsx +6 -6
  218. package/src/components/Breadcrumbs/Breadcrumbs.test.tsx +7 -7
  219. package/src/components/Breadcrumbs/Breadcrumbs.tsx +1 -1
  220. package/src/components/Breakpoint/Breakpoint.stories.tsx +10 -9
  221. package/src/components/Breakpoint/Breakpoint.test.tsx +7 -8
  222. package/src/components/Breakpoint/generateMediaQuery.ts +5 -4
  223. package/src/components/Button/Button.stories.tsx +4 -4
  224. package/src/components/Button/Button.test.tsx +14 -3
  225. package/src/components/Checkbox/Checkbox.stories.tsx +7 -7
  226. package/src/components/Checkbox/Checkbox.test.tsx +12 -14
  227. package/src/components/Checkbox/Checkbox.tsx +8 -8
  228. package/src/components/Clickable/Clickable.stories.tsx +3 -3
  229. package/src/components/Clickable/Clickable.test.tsx +3 -3
  230. package/src/components/ColorSwatch/ColorSwatch.stories.tsx +11 -11
  231. package/src/components/ColorSwatch/ColorSwatch.test.tsx +3 -5
  232. package/src/components/ColorSwatch/ColorSwatch.tsx +1 -1
  233. package/src/components/Constrain/Constrain.stories.tsx +1 -1
  234. package/src/components/Constrain/Constrain.test.tsx +4 -4
  235. package/src/components/Constrain/ExceedConstrain.stories.tsx +2 -2
  236. package/src/components/ControlLink/ControlLink.stories.tsx +1 -1
  237. package/src/components/ControlLink/ControlLink.test.tsx +10 -12
  238. package/src/components/ControlLink/index.ts +1 -1
  239. package/src/components/CreditCardNumberInput/CreditCardNumberInput.stories.tsx +1 -1
  240. package/src/components/CreditCardNumberInput/CreditCardNumberInput.test.tsx +16 -16
  241. package/src/components/CreditCardNumberInput/CreditCardNumberInput.tsx +1 -0
  242. package/src/components/DefinitionList/DefinitionList.stories.tsx +3 -3
  243. package/src/components/DefinitionList/DefinitionList.test.tsx +4 -3
  244. package/src/components/Divider/Divider.stories.tsx +4 -4
  245. package/src/components/Divider/Divider.test.tsx +5 -4
  246. package/src/components/Divider/Divider.tsx +1 -1
  247. package/src/components/Divider/NoLineDivider.tsx +1 -1
  248. package/src/components/Divider/TwoLineDivider.tsx +1 -1
  249. package/src/components/Expandable/Expandable.stories.tsx +8 -8
  250. package/src/components/Expandable/Expandable.test.tsx +17 -6
  251. package/src/components/Expandable/Expandable.tsx +3 -2
  252. package/src/components/Field/Field.stories.tsx +4 -4
  253. package/src/components/Field/Field.test.tsx +25 -34
  254. package/src/components/Field/Field.tsx +5 -5
  255. package/src/components/Field/index.ts +1 -0
  256. package/src/components/Label/Label.test.tsx +3 -3
  257. package/src/components/Loading/Loading.test.tsx +3 -5
  258. package/src/components/Loading/Loading.tsx +2 -1
  259. package/src/components/Modal/Modal.test.tsx +8 -9
  260. package/src/components/ModalOverlay/ModalOverlay.test.tsx +11 -11
  261. package/src/components/ModalOverlay/ModalOverlay.tsx +2 -2
  262. package/src/components/Overlay/Overlay.stories.tsx +1 -1
  263. package/src/components/Overlay/Overlay.test.tsx +3 -3
  264. package/src/components/Paginator/Paginator.tsx +3 -3
  265. package/src/components/PasswordInput/PasswordInput.stories.tsx +1 -1
  266. package/src/components/PasswordInput/PasswordInput.tsx +6 -6
  267. package/src/components/Popover/Popover.stories.tsx +1 -1
  268. package/src/components/Popover/Popover.test.tsx +9 -6
  269. package/src/components/Popover/Popover.tsx +10 -7
  270. package/src/components/PromoBanner/PromoBanner.stories.tsx +9 -9
  271. package/src/components/PromoBanner/PromoBanner.test.tsx +3 -3
  272. package/src/components/PromoBanner/PromoBanner.tsx +1 -1
  273. package/src/components/RadioButton/RadioButton.stories.tsx +2 -2
  274. package/src/components/RadioButton/RadioButton.test.tsx +6 -10
  275. package/src/components/RadioButton/RadioButton.tsx +4 -4
  276. package/src/components/SearchInput/SearchInput.stories.tsx +2 -2
  277. package/src/components/SearchInput/SearchInput.test.tsx +10 -6
  278. package/src/components/SearchInput/SearchInput.tsx +3 -3
  279. package/src/components/Select/MultiSelect.tsx +7 -7
  280. package/src/components/Select/Select.stories.tsx +17 -15
  281. package/src/components/Select/Select.test.tsx +21 -21
  282. package/src/components/Select/Select.tsx +13 -8
  283. package/src/components/Select/SelectOption.tsx +1 -1
  284. package/src/components/Select/SelectOptions.tsx +5 -5
  285. package/src/components/SelectableButton/SelectableButton.stories.tsx +1 -1
  286. package/src/components/SelectableButton/SelectableButton.test.tsx +3 -3
  287. package/src/components/Shape/ArcWindow.tsx +10 -10
  288. package/src/components/Shape/Bradley.tsx +4 -4
  289. package/src/components/Shape/Brancusi.tsx +4 -4
  290. package/src/components/Shape/Circle.tsx +10 -10
  291. package/src/components/Shape/Diamond.tsx +10 -10
  292. package/src/components/Shape/Keyhole.tsx +4 -4
  293. package/src/components/Shape/Mirror.tsx +4 -4
  294. package/src/components/Shape/Oval.tsx +4 -4
  295. package/src/components/Shape/Triangle.tsx +7 -7
  296. package/src/components/Shape/Window.tsx +4 -4
  297. package/src/components/Stack/Stack.stories.tsx +3 -3
  298. package/src/components/Stack/Stack.test.tsx +7 -5
  299. package/src/components/Tabs/TabList.tsx +1 -1
  300. package/src/components/Tabs/TabPanel.tsx +1 -1
  301. package/src/components/Tabs/TabPanels.tsx +1 -1
  302. package/src/components/Tabs/Tabs.stories.tsx +2 -2
  303. package/src/components/Tabs/Tabs.test.tsx +6 -7
  304. package/src/components/Tabs/Tabs.tsx +7 -1
  305. package/src/components/Tag/Tag.test.tsx +1 -1
  306. package/src/components/Tag/Tag.tsx +6 -5
  307. package/src/components/Text/Text.stories.tsx +5 -5
  308. package/src/components/Text/Text.test.tsx +4 -6
  309. package/src/components/TextInput/TextInput.stories.tsx +1 -1
  310. package/src/components/TextInput/TextInput.test.tsx +4 -5
  311. package/src/components/Textarea/Textarea.stories.tsx +1 -1
  312. package/src/components/Textarea/Textarea.test.tsx +11 -16
  313. package/src/components/Toast/Toast.stories.tsx +1 -1
  314. package/src/components/Toast/Toast.test.tsx +2 -2
  315. package/src/components/Toast/Toast.tsx +6 -6
  316. package/src/components/VerticalDivider/VerticalDivider.stories.tsx +3 -3
  317. package/src/components/VerticalDivider/VerticalDivider.test.tsx +6 -7
  318. package/src/hooks/useKeyboardListNavigation.spec.ts +26 -64
  319. package/src/hooks/useKeyboardListNavigation.ts +2 -0
  320. package/src/hooks/useUpdateEffect.ts +1 -0
  321. package/src/index.ts +2 -2
  322. package/src/mixins/font-smoothing/font-smoothing.stories.tsx +8 -8
  323. package/src/mixins/overflow-scroll/overflow-scroll.stories.tsx +2 -2
  324. package/src/mixins/stack/stack.stories.tsx +5 -6
  325. package/src/mixins/thin-underline/thin-underline.stories.tsx +1 -1
  326. package/src/mixins/visually-hidden/visually-hidden.stories.tsx +1 -1
  327. package/src/utilities/States/State.tsx +3 -2
  328. package/src/utilities/States/States.tsx +4 -3
  329. package/src/utilities/States/StatesProps.tsx +5 -2
  330. package/src/utilities/States/isRenderProps.ts +1 -0
  331. package/src/utilities/States/stringifyProps.tsx +1 -0
@@ -7,7 +7,7 @@ export default { title: 'Components/Expandable' };
7
7
 
8
8
  export const Default = () => (
9
9
  <States<Partial<ExpandableProps>> states={[{}, { expanded: true }]}>
10
- <Expandable name='Editor’s Note'>
10
+ <Expandable name="Editor’s Note">
11
11
  Mark Cross’ ‘Cole’ duffle bag is crafted from textured grain leather with ample space for your
12
12
  long-haul travels. It opens to reveal red twill lining and ample compartments for your
13
13
  essentials. It has polished silver-tone palladium hardware and is stamped with the label’s
@@ -20,7 +20,7 @@ export const Default = () => (
20
20
  // Push content into the DOM only after epanding component
21
21
  export const VirtualizeContent = () => (
22
22
  <States<Partial<ExpandableProps>> states={[{}, { expanded: false, virtual: true }]}>
23
- <Expandable name='Editor’s Note'>
23
+ <Expandable name="Editor’s Note">
24
24
  Mark Cross’ ‘Cole’ duffle bag is crafted from textured grain leather with ample space for your
25
25
  long-haul travels. It opens to reveal red twill lining and ample compartments for your
26
26
  essentials. It has polished silver-tone palladium hardware and is stamped with the label’s
@@ -32,7 +32,7 @@ export const VirtualizeContent = () => (
32
32
 
33
33
  export const ChevronIcon = () => (
34
34
  <States<Partial<ExpandableProps>> states={[{}, { expanded: true }]}>
35
- <Expandable icon='chevron' name='Editor’s Note'>
35
+ <Expandable icon="chevron" name="Editor’s Note">
36
36
  Mark Cross’ ‘Cole’ duffle bag is crafted from textured grain leather with ample space for your
37
37
  long-haul travels. It opens to reveal red twill lining and ample compartments for your
38
38
  essentials. It has polished silver-tone palladium hardware and is stamped with the label’s
@@ -45,14 +45,14 @@ export const ChevronIcon = () => (
45
45
  export const Stacked = () => (
46
46
  <States>
47
47
  <Stack space={0}>
48
- <Expandable name='Editor’s Note' expanded>
48
+ <Expandable name="Editor’s Note" expanded>
49
49
  <p>
50
50
  Acne Studios’ ‘1996’ jeans are fitted with a high-rise waist and straight-leg silhouette.
51
51
  Designed in a dark-blue wash, this five-pocket style is detailed with contrast
52
52
  top-stitching to mirror vintage pairs.
53
53
  </p>
54
54
  </Expandable>
55
- <Expandable name='Product Details'>
55
+ <Expandable name="Product Details">
56
56
  <ul>
57
57
  <li>Belt loops, five-pocket style</li>
58
58
  <li>Button and concealed zip fastening at front</li>
@@ -61,7 +61,7 @@ export const Stacked = () => (
61
61
  </ul>
62
62
  <p>Made in Italy Product Code 684196</p>
63
63
  </Expandable>
64
- <Expandable name='Size &amp; Fit'>
64
+ <Expandable name="Size &amp; Fit">
65
65
  <ul>
66
66
  <li>
67
67
  Model measurements: height 6&apos;2&quot;/188cm - neck 15.5&quot;/39cm - waist
@@ -72,11 +72,11 @@ export const Stacked = () => (
72
72
  <li>We suggest taking your normal size</li>
73
73
  </ul>
74
74
  <p>
75
- Questions? Please contact <a href='mailto:care@modaoperandi.com'>care@modaoperandi.com</a>
75
+ Questions? Please contact <a href="mailto:care@modaoperandi.com">care@modaoperandi.com</a>
76
76
  .
77
77
  </p>
78
78
  </Expandable>
79
- <Expandable name='Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit...'>
79
+ <Expandable name="Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit...">
80
80
  Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed condimentum laoreet urna nec
81
81
  consequat. Morbi et volutpat nulla, a vehicula nisl. Nullam tincidunt ac neque ornare
82
82
  mattis. Donec eget dapibus enim. Aliquam ut tortor pretium dui pretium tincidunt. Donec quis
@@ -1,13 +1,24 @@
1
1
  import React from 'react';
2
- import { mount } from 'enzyme';
2
+ import { render, screen } from '@testing-library/react';
3
+ import userEvent from '@testing-library/user-event';
3
4
 
4
5
  import { Expandable } from './Expandable';
5
6
 
6
7
  describe('Expandable', () => {
7
- it('expands when clicked', () => {
8
- const component = mount(<Expandable name='Hello'>Goodbye</Expandable>);
9
- expect(component.html()).not.toContain('expanded');
10
- component.find('button').simulate('click');
11
- expect(component.html()).toContain('expanded');
8
+ it('expands when clicked', async () => {
9
+ const user = userEvent.setup();
10
+
11
+ render(
12
+ <Expandable virtual name="Hello">
13
+ Goodbye
14
+ </Expandable>
15
+ );
16
+
17
+ expect(screen.getByText('Hello')).toBeVisible();
18
+ expect(screen.queryByText('Goodbye')).not.toBeInTheDocument();
19
+
20
+ await user.click(screen.getByRole('button'));
21
+
22
+ expect(screen.getByText('Goodbye')).toBeVisible();
12
23
  });
13
24
  });
@@ -21,6 +21,7 @@ export const Expandable: React.FC<ExpandableProps> = ({
21
21
  virtual = false,
22
22
  icon = 'plus-minus',
23
23
  'data-testid': dataTestId,
24
+ // eslint-disable-next-line @typescript-eslint/naming-convention
24
25
  expanded: __expanded__ = false,
25
26
  ...rest
26
27
  }) => {
@@ -43,14 +44,14 @@ export const Expandable: React.FC<ExpandableProps> = ({
43
44
  {name}
44
45
 
45
46
  {icon !== 'plus-minus' && (
46
- <div className='Expandable__icon'>
47
+ <div className="Expandable__icon">
47
48
  {icon === 'chevron' && expanded && <ChevronUpIcon />}
48
49
  {icon === 'chevron' && !expanded && <ChevronDownIcon />}
49
50
  </div>
50
51
  )}
51
52
  </Clickable>
52
53
 
53
- <div className='Expandable__contents'>{expanded || !virtual ? children : null}</div>
54
+ <div className="Expandable__contents">{expanded || !virtual ? children : null}</div>
54
55
  </div>
55
56
  );
56
57
  };
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
2
  import { States } from 'storybook-states';
3
- import { Field, FieldProps } from './Field';
3
+ import { action } from '@storybook/addon-actions';
4
4
  import { Textarea } from '../Textarea';
5
5
  import { Select } from '../Select';
6
- import { action } from '@storybook/addon-actions';
6
+ import { Field, FieldProps } from './Field';
7
7
 
8
8
  export default { title: 'Components/Field' };
9
9
 
@@ -19,7 +19,7 @@ export const Default = () => (
19
19
  { label: 'Name of input', error: 'Something went wrong' }
20
20
  ]}
21
21
  >
22
- <Field placeholder='An input' />
22
+ <Field placeholder="An input" />
23
23
  </States>
24
24
  );
25
25
 
@@ -36,7 +36,7 @@ export const AribitraryChildren = () => (
36
36
  ]}
37
37
  >
38
38
  <Field>
39
- <Textarea placeholder='A textarea' />
39
+ <Textarea placeholder="A textarea" />
40
40
  </Field>
41
41
  </States>
42
42
  );
@@ -1,75 +1,66 @@
1
1
  import React from 'react';
2
- import { shallow } from 'enzyme';
2
+ import { render, screen } from '@testing-library/react';
3
3
 
4
- import { Field } from './Field';
5
4
  import { Select } from '../Select';
5
+ import { Field } from './Field';
6
6
 
7
7
  describe('Field', () => {
8
8
  it('renders correctly', () => {
9
- const component = shallow(<Field placeholder='Placeholder' defaultValue='Hello' />);
9
+ render(<Field placeholder="Placeholder" defaultValue="Hello" />);
10
10
 
11
- expect(component.html()).toEqual(
12
- '<label class="Field"><span class="Field__context"><input class="TextInput" placeholder="Placeholder" aria-label="Placeholder" value="Hello"/></span></label>'
13
- );
11
+ expect(screen.getByRole('textbox')).toBeVisible();
12
+ expect(screen.getByRole('textbox')).toHaveAttribute('placeholder', 'Placeholder');
14
13
  });
15
14
 
16
15
  it('renders with a label', () => {
17
- const component = shallow(
18
- <Field placeholder='Placeholder' defaultValue='Hello' label='Label' />
19
- );
16
+ render(<Field placeholder="Placeholder" defaultValue="Hello" label="Label" />);
20
17
 
21
- expect(component.html()).toEqual(
22
- '<label class="Field"><span class="Field__label">Label</span><span class="Field__context"><input class="TextInput" placeholder="Placeholder" aria-label="Label" value="Hello"/></span></label>'
23
- );
18
+ expect(screen.getByRole('textbox')).toBeVisible();
19
+ expect(screen.getByRole('textbox')).toHaveAttribute('placeholder', 'Placeholder');
20
+ expect(screen.getByText('Label')).toBeVisible();
24
21
  });
25
22
 
26
23
  it('renders with an error', () => {
27
- const component = shallow(
28
- <Field placeholder='Placeholder' defaultValue='Hello' label='Label' error='Error' />
29
- );
24
+ render(<Field placeholder="Placeholder" defaultValue="Hello" label="Label" error="Error" />);
30
25
 
31
- expect(component.html()).toEqual(
32
- '<label class="Field"><span class="Field__label">Label</span><span class="Field__context"><input class="TextInput TextInput--error" placeholder="Placeholder" aria-label="Label" value="Hello"/><span class="Field__icon"></span></span><span class="Field__error">Error</span></label>'
33
- );
26
+ expect(screen.getByRole('textbox')).toBeVisible();
27
+ expect(screen.getByRole('textbox')).toHaveClass('TextInput--error');
28
+ expect(screen.getByText('Error')).toBeVisible();
34
29
  });
35
30
 
36
- it('renders with an error when children is <Select/>', () => {
31
+ it('renders with <Select/> child', () => {
37
32
  const options = [
38
33
  { value: 'foo', label: 'Foo' },
39
34
  { value: 'bar', label: 'Bar' },
40
35
  { value: 'baz', label: 'Baz', disabled: true }
41
36
  ];
42
37
 
43
- const component = shallow(
38
+ render(
44
39
  <Field>
45
- <Select idRef='1' name='name-1' label='Sort by' options={options} />
40
+ <Select idRef="1" name="name-1" label="Sort by" options={options} />
46
41
  </Field>
47
42
  );
48
43
 
49
- expect(component.html()).toEqual(
50
- '<label class="Field"><span class="Field__context"><div id="Select--1" class="Select"><input id="1" name="name-1" type="hidden"/><button id="Select__value--1" aria-haspopup="listbox" aria-expanded="false" aria-labelledby="Select__label--1 Select__value--1" type="button" title="Select" class="Clickable Select__value"><label id="Select__label--1">Sort by</label><span class="Select__icon"></span></button></div></span></label>'
51
- );
44
+ expect(screen.getByRole('button', { name: /Sort by/ })).toBeVisible();
52
45
  });
53
46
 
54
47
  it('renders with a className', () => {
55
- const component = shallow(
56
- <Field className='Custom' placeholder='Placeholder' defaultValue='Hello' label='Label' />
48
+ render(
49
+ <Field className="Custom" placeholder="Placeholder" defaultValue="Hello" label="Label" />
57
50
  );
58
51
 
59
- expect(component.html()).toEqual(
60
- '<label class="Field Custom"><span class="Field__label">Label</span><span class="Field__context"><input class="TextInput" placeholder="Placeholder" aria-label="Label" value="Hello"/></span></label>'
61
- );
52
+ expect(screen.getByRole('textbox')).toBeVisible();
53
+ // eslint-disable-next-line testing-library/no-node-access
54
+ expect(screen.getByRole('textbox').parentNode?.parentNode).toHaveClass('Custom');
62
55
  });
63
56
 
64
57
  it('supports custom children', () => {
65
- const component = shallow(
66
- <Field placeholder='Placeholder' defaultValue='Hello' label='Label'>
58
+ render(
59
+ <Field placeholder="Placeholder" defaultValue="Hello" label="Label">
67
60
  <textarea />
68
61
  </Field>
69
62
  );
70
63
 
71
- expect(component.html()).toEqual(
72
- '<label class="Field"><span class="Field__label">Label</span><span class="Field__context"><textarea placeholder="Placeholder" label="Label">Hello</textarea></span></label>'
73
- );
64
+ expect(screen.getByRole('textbox')).toBeVisible();
74
65
  });
75
66
  });
@@ -17,10 +17,10 @@ export const Field = React.forwardRef(
17
17
  ) => {
18
18
  return (
19
19
  <label className={classNames('Field', className)}>
20
- {label && <span className='Field__label'>{label}</span>}
20
+ {label && <span className="Field__label">{label}</span>}
21
21
 
22
22
  {/* TODO: Codify some kind of IconWrapper component */}
23
- <span className='Field__context'>
23
+ <span className="Field__context">
24
24
  {children ? (
25
25
  <>
26
26
  {React.cloneElement(children, {
@@ -34,7 +34,7 @@ export const Field = React.forwardRef(
34
34
  })}
35
35
 
36
36
  {error && (
37
- <span className='Field__icon'>
37
+ <span className="Field__icon">
38
38
  <WarningIcon />
39
39
  </span>
40
40
  )}
@@ -49,7 +49,7 @@ export const Field = React.forwardRef(
49
49
  {...rest}
50
50
  />
51
51
  {error && (
52
- <span className='Field__icon'>
52
+ <span className="Field__icon">
53
53
  <WarningIcon />
54
54
  </span>
55
55
  )}
@@ -57,7 +57,7 @@ export const Field = React.forwardRef(
57
57
  )}
58
58
  </span>
59
59
 
60
- {error && <span className='Field__error'>{error}</span>}
60
+ {error && <span className="Field__error">{error}</span>}
61
61
  </label>
62
62
  );
63
63
  }
@@ -1,3 +1,4 @@
1
1
  import { Field } from './Field';
2
+
2
3
  export { Field as Input };
3
4
  export * from './Field';
@@ -1,11 +1,11 @@
1
1
  import React from 'react';
2
- import { shallow } from 'enzyme';
2
+ import { render, screen } from '@testing-library/react';
3
3
 
4
4
  import { Label } from './Label';
5
5
 
6
6
  describe('Label', () => {
7
7
  it('renders correctly', () => {
8
- const component = shallow(<Label>Hello</Label>);
9
- expect(component.text()).toEqual('Hello');
8
+ render(<Label>Hello</Label>);
9
+ expect(screen.getByText('Hello')).toBeVisible();
10
10
  });
11
11
  });
@@ -1,13 +1,11 @@
1
1
  import React from 'react';
2
- import { shallow } from 'enzyme';
2
+ import { render, screen } from '@testing-library/react';
3
3
 
4
4
  import { Loading } from './Loading';
5
5
 
6
6
  describe('Loading', () => {
7
7
  it('renders correctly', () => {
8
- const component = shallow(<Loading />);
9
- expect(component.html()).toEqual(
10
- '<div class="Loading"><svg class="Triangle" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M11.9986 0L0 24H24L11.9986 0Z" fill="#D56B27"></path></svg></div>'
11
- );
8
+ render(<Loading aria-label="Loading" />);
9
+ expect(screen.getByLabelText('Loading')).toBeVisible();
12
10
  });
13
11
  });
@@ -11,9 +11,10 @@ const FRAMES = [Triangle, Diamond, ArcWindow, Circle];
11
11
 
12
12
  export const Loading: React.FC<LoadingProps> = ({ className, ...rest }) => {
13
13
  const { index, handleNext } = useCursor({ max: FRAMES.length });
14
+ const ONE_SECOND_INTERVAL = 1000;
14
15
 
15
16
  useEffect(() => {
16
- const interval = setInterval(handleNext, 1000);
17
+ const interval = setInterval(handleNext, ONE_SECOND_INTERVAL);
17
18
  return () => clearInterval(interval);
18
19
  }, [handleNext]);
19
20
 
@@ -1,28 +1,27 @@
1
1
  import React from 'react';
2
- import { render } from '@testing-library/react';
2
+ import { render, screen } from '@testing-library/react';
3
3
  import userEvent from '@testing-library/user-event';
4
- import { shallow } from 'enzyme';
5
4
 
6
5
  import { Modal } from './Modal';
7
6
 
8
7
  describe('Modal', () => {
9
8
  it('renders correctly', () => {
10
- const component = shallow(<Modal onClose={() => {}}>Hello</Modal>);
11
- expect(component.text()).toEqual('Hello');
9
+ render(<Modal onClose={() => {}}>Hello</Modal>);
10
+ expect(screen.getByText('Hello')).toBeVisible();
12
11
  });
13
12
 
14
13
  it('should only close when the modal wrapper is clicked', async () => {
15
14
  const onClose = jest.fn();
16
15
  const onClickButton = jest.fn();
17
- const { getByTestId } = render(
18
- <Modal data-testid='modal' onClose={onClose}>
19
- <button data-testid='button' onClick={onClickButton}>
16
+ render(
17
+ <Modal data-testid="modal" onClose={onClose}>
18
+ <button data-testid="button" onClick={onClickButton}>
20
19
  Click Me
21
20
  </button>
22
21
  </Modal>
23
22
  );
24
- const modal = getByTestId('modal');
25
- const button = getByTestId('button');
23
+ const modal = screen.getByTestId('modal');
24
+ const button = screen.getByTestId('button');
26
25
 
27
26
  await userEvent.click(button);
28
27
  expect(onClose).toBeCalledTimes(0);
@@ -1,5 +1,5 @@
1
1
  import React, { useState } from 'react';
2
- import { render, waitFor } from '@testing-library/react';
2
+ import { render, screen, waitFor } from '@testing-library/react';
3
3
  import userEvent from '@testing-library/user-event';
4
4
 
5
5
  import { ModalOverlay } from './ModalOverlay';
@@ -8,11 +8,11 @@ const ModalComponent: React.FC = () => {
8
8
  const [showModal, setShowModal] = useState(false);
9
9
 
10
10
  return showModal ? (
11
- <ModalOverlay data-testid='modal' onClose={() => setShowModal(false)}>
11
+ <ModalOverlay data-testid="modal" onClose={() => setShowModal(false)}>
12
12
  Modal Content
13
13
  </ModalOverlay>
14
14
  ) : (
15
- <button data-testid='button' onClick={() => setShowModal(true)}>
15
+ <button data-testid="button" onClick={() => setShowModal(true)}>
16
16
  Click Me
17
17
  </button>
18
18
  );
@@ -20,23 +20,23 @@ const ModalComponent: React.FC = () => {
20
20
 
21
21
  describe('ModalOverlay', () => {
22
22
  it('renders correctly', () => {
23
- const { queryByText } = render(<ModalOverlay onClose={() => {}}>Hello</ModalOverlay>);
23
+ render(<ModalOverlay onClose={() => {}}>Hello</ModalOverlay>);
24
24
 
25
- expect(queryByText('Hello')).not.toBeNull();
25
+ expect(screen.getByText('Hello')).toBeInTheDocument();
26
26
  });
27
27
 
28
28
  it('should open and close the modal', async () => {
29
- const { getByTestId, queryByText } = render(<ModalComponent />);
29
+ render(<ModalComponent />);
30
30
 
31
31
  // Should not show by default
32
- expect(queryByText('Modal Content')).toBeNull();
32
+ expect(screen.queryByText('Modal Content')).not.toBeInTheDocument();
33
33
 
34
34
  // Should show after clicking button
35
- userEvent.click(getByTestId('button'));
36
- await waitFor(() => expect(queryByText('Modal Content')).not.toBeNull());
35
+ userEvent.click(screen.getByTestId('button'));
36
+ await screen.findByText('Modal Content');
37
37
 
38
38
  // Should hide after clicking wrapper
39
- userEvent.click(getByTestId('modal'));
40
- await waitFor(() => expect(queryByText('Modal Content')).toBeNull());
39
+ userEvent.click(screen.getByTestId('modal'));
40
+ await waitFor(() => expect(screen.queryByText('Modal Content')).not.toBeInTheDocument());
41
41
  });
42
42
  });
@@ -1,8 +1,8 @@
1
1
  import React, { useEffect, useMemo } from 'react';
2
- import { Modal, ModalProps } from '../Modal';
3
- import { OverlayProps, Overlay } from '../Overlay';
4
2
  import classNames from 'classnames';
5
3
  import { createPortal } from 'react-dom';
4
+ import { Modal, ModalProps } from '../Modal';
5
+ import { OverlayProps, Overlay } from '../Overlay';
6
6
 
7
7
  import './ModalOverlay.scss';
8
8
 
@@ -1,8 +1,8 @@
1
1
  import React, { useState } from 'react';
2
2
 
3
3
  import { States } from 'storybook-states';
4
- import { Overlay } from './Overlay';
5
4
  import { Button } from '../Button';
5
+ import { Overlay } from './Overlay';
6
6
 
7
7
  export default { title: 'Components/Overlay' };
8
8
 
@@ -1,12 +1,12 @@
1
1
  import React from 'react';
2
- import { shallow } from 'enzyme';
2
+ import { render, screen } from '@testing-library/react';
3
3
 
4
4
  import { Overlay } from './Overlay';
5
5
 
6
6
  describe('Overlay', () => {
7
7
  it('renders correctly', () => {
8
8
  const text = 'test-Text';
9
- const component = shallow(<Overlay>{text}</Overlay>);
10
- expect(component.text()).toEqual(text);
9
+ render(<Overlay>{text}</Overlay>);
10
+ expect(screen.getByText(text)).toBeVisible();
11
11
  });
12
12
  });
@@ -66,7 +66,7 @@ export const Paginator: React.FC<Props> = ({
66
66
  const prevPage = (page: number) => onGoToPage(page - 1);
67
67
 
68
68
  return (
69
- <section className={classNames('Paginator', className)} aria-label='Pagination'>
69
+ <section className={classNames('Paginator', className)} aria-label="Pagination">
70
70
  <button
71
71
  disabled={!canDoPrev(selectedPage)}
72
72
  onClick={() => {
@@ -75,7 +75,7 @@ export const Paginator: React.FC<Props> = ({
75
75
  }}
76
76
  className={classNames('Paginator__button', 'Paginator__button--previous')}
77
77
  >
78
- <ChevronLeftIcon className='Paginator__previous-chevron' /> Previous
78
+ <ChevronLeftIcon className="Paginator__previous-chevron" /> Previous
79
79
  </button>
80
80
 
81
81
  {pages.map((page, index) => (
@@ -108,7 +108,7 @@ export const Paginator: React.FC<Props> = ({
108
108
  }}
109
109
  className={classNames('Paginator__button', 'Paginator__button--next')}
110
110
  >
111
- Next <ChevronRightIcon className='Paginator__next-chevron' />
111
+ Next <ChevronRightIcon className="Paginator__next-chevron" />
112
112
  </button>
113
113
  </section>
114
114
  );
@@ -6,6 +6,6 @@ export default { title: 'Components/PasswordInput' };
6
6
 
7
7
  export const Default = () => (
8
8
  <States<Partial<PasswordInputProps>> states={[{}, { error: 'Password cannot be empty.' }]}>
9
- <PasswordInput id='signInPassword' placeholder='Password' />
9
+ <PasswordInput id="signInPassword" placeholder="Password" />
10
10
  </States>
11
11
  );
@@ -15,23 +15,23 @@ export const PasswordInput = forwardRef(
15
15
  };
16
16
 
17
17
  return (
18
- <div className='PasswordInput'>
18
+ <div className="PasswordInput">
19
19
  <Input
20
- className='PasswordInput__editor'
20
+ className="PasswordInput__editor"
21
21
  ref={ref}
22
22
  type={passwordShown ? 'text' : 'password'}
23
23
  {...rest}
24
24
  />
25
25
 
26
26
  <Clickable
27
- className='PasswordInput__password-action'
27
+ className="PasswordInput__password-action"
28
28
  onClick={togglePasswordVisiblity}
29
- type='button'
29
+ type="button"
30
30
  >
31
31
  {passwordShown ? (
32
- <Text treatment='eyebrow'>HIDE</Text>
32
+ <Text treatment="eyebrow">HIDE</Text>
33
33
  ) : (
34
- <Text treatment='eyebrow'>SHOW</Text>
34
+ <Text treatment="eyebrow">SHOW</Text>
35
35
  )}
36
36
  </Clickable>
37
37
  </div>
@@ -33,7 +33,7 @@ export const Default = () => (
33
33
  >
34
34
  <Popover content={Content} style={{ display: 'inline-block' }}>
35
35
  <Text>
36
- <ControlLink href='https://www.modaoperandi.com/women'>Hover on Link</ControlLink>
36
+ <ControlLink href="https://www.modaoperandi.com/women">Hover on Link</ControlLink>
37
37
  </Text>
38
38
  </Popover>
39
39
  </States>
@@ -1,18 +1,21 @@
1
1
  import React from 'react';
2
- import { mount } from 'enzyme';
2
+ import { render, screen } from '@testing-library/react';
3
+ import userEvent from '@testing-library/user-event';
3
4
 
4
5
  import { Popover } from './Popover';
5
6
 
6
7
  describe('Popover', () => {
7
- it('renders correctly', () => {
8
- const component = mount(
8
+ it('renders correctly', async () => {
9
+ render(
9
10
  <Popover content={<div>Secret</div>}>
10
11
  <span>Hover</span>
11
12
  </Popover>
12
13
  );
13
14
 
14
- expect(component.html()).not.toContain('Secret');
15
- component.simulate('mouseenter');
16
- expect(component.html()).toContain('Secret');
15
+ expect(screen.queryByText('Secret')).not.toBeInTheDocument();
16
+
17
+ await userEvent.hover(screen.getByText('Hover'));
18
+
19
+ expect(screen.getByText('Secret')).toBeVisible();
17
20
  });
18
21
  });