@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
@@ -3,18 +3,18 @@ import { ShapeProps } from './Shape';
3
3
 
4
4
  export const ArcWindow: React.FC<ShapeProps> = () => (
5
5
  <svg
6
- className='ArcWindow'
7
- width='24'
8
- height='24'
9
- viewBox='0 0 24 24'
10
- fill='none'
11
- xmlns='http://www.w3.org/2000/svg'
6
+ className="ArcWindow"
7
+ width="24"
8
+ height="24"
9
+ viewBox="0 0 24 24"
10
+ fill="none"
11
+ xmlns="http://www.w3.org/2000/svg"
12
12
  >
13
13
  <path
14
- fillRule='evenodd'
15
- clipRule='evenodd'
16
- d='M20.1097 24V11.6273V8.8331V8.81993C20.1018 3.96884 16.4806 0 12.0536 0C7.6291 0 4.00527 3.96884 4 8.81993V8.8331V11.6273V24H20.1097Z'
17
- fill='#003728'
14
+ fillRule="evenodd"
15
+ clipRule="evenodd"
16
+ d="M20.1097 24V11.6273V8.8331V8.81993C20.1018 3.96884 16.4806 0 12.0536 0C7.6291 0 4.00527 3.96884 4 8.81993V8.8331V11.6273V24H20.1097Z"
17
+ fill="#003728"
18
18
  />
19
19
  </svg>
20
20
  );
@@ -1,13 +1,13 @@
1
1
  import React from 'react';
2
2
  import { ShapeProps } from './Shape';
3
3
 
4
- export const Bradley: React.FC<ShapeProps> = (props) => (
4
+ export const Bradley: React.FC<ShapeProps> = props => (
5
5
  <svg
6
6
  style={{ fill: 'currentcolor' }}
7
- xmlns='http://www.w3.org/2000/svg'
8
- viewBox='0 0 110 211'
7
+ xmlns="http://www.w3.org/2000/svg"
8
+ viewBox="0 0 110 211"
9
9
  {...props}
10
10
  >
11
- <path d='M110 .336H0v210h45.11v-52.595h19.78v52.595H110V105.147z' />
11
+ <path d="M110 .336H0v210h45.11v-52.595h19.78v52.595H110V105.147z" />
12
12
  </svg>
13
13
  );
@@ -1,13 +1,13 @@
1
1
  import React from 'react';
2
2
  import { ShapeProps } from './Shape';
3
3
 
4
- export const Brancusi: React.FC<ShapeProps> = (props) => (
4
+ export const Brancusi: React.FC<ShapeProps> = props => (
5
5
  <svg
6
6
  style={{ fill: 'currentcolor' }}
7
- xmlns='http://www.w3.org/2000/svg'
8
- viewBox='0 0 111 210'
7
+ xmlns="http://www.w3.org/2000/svg"
8
+ viewBox="0 0 111 210"
9
9
  {...props}
10
10
  >
11
- <path d='M110.575 210l-27.5-105 27.5-105h-110l27.501 105L.575 210z' />
11
+ <path d="M110.575 210l-27.5-105 27.5-105h-110l27.501 105L.575 210z" />
12
12
  </svg>
13
13
  );
@@ -3,18 +3,18 @@ import { ShapeProps } from './Shape';
3
3
 
4
4
  export const Circle: React.FC<ShapeProps> = () => (
5
5
  <svg
6
- className='Circle'
7
- width='24'
8
- height='24'
9
- viewBox='0 0 24 24'
10
- fill='none'
11
- xmlns='http://www.w3.org/2000/svg'
6
+ className="Circle"
7
+ width="24"
8
+ height="24"
9
+ viewBox="0 0 24 24"
10
+ fill="none"
11
+ xmlns="http://www.w3.org/2000/svg"
12
12
  >
13
13
  <path
14
- fillRule='evenodd'
15
- clipRule='evenodd'
16
- d='M24 12C24 18.6282 18.6282 24 12 24C5.37184 24 0 18.6282 0 12C0 5.37184 5.37184 0 12 0C18.6282 0 24 5.37184 24 12Z'
17
- fill='#D7B3D0'
14
+ fillRule="evenodd"
15
+ clipRule="evenodd"
16
+ d="M24 12C24 18.6282 18.6282 24 12 24C5.37184 24 0 18.6282 0 12C0 5.37184 5.37184 0 12 0C18.6282 0 24 5.37184 24 12Z"
17
+ fill="#D7B3D0"
18
18
  />
19
19
  </svg>
20
20
  );
@@ -3,18 +3,18 @@ import { ShapeProps } from './Shape';
3
3
 
4
4
  export const Diamond: React.FC<ShapeProps> = () => (
5
5
  <svg
6
- className='Diamond'
7
- width='24'
8
- height='24'
9
- viewBox='0 0 24 24'
10
- fill='none'
11
- xmlns='http://www.w3.org/2000/svg'
6
+ className="Diamond"
7
+ width="24"
8
+ height="24"
9
+ viewBox="0 0 24 24"
10
+ fill="none"
11
+ xmlns="http://www.w3.org/2000/svg"
12
12
  >
13
13
  <path
14
- fillRule='evenodd'
15
- clipRule='evenodd'
16
- d='M12 24.0026L0 12.0026L12 0L24 12.0026L12 24.0026Z'
17
- fill='#C44CB0'
14
+ fillRule="evenodd"
15
+ clipRule="evenodd"
16
+ d="M12 24.0026L0 12.0026L12 0L24 12.0026L12 24.0026Z"
17
+ fill="#C44CB0"
18
18
  />
19
19
  </svg>
20
20
  );
@@ -1,13 +1,13 @@
1
1
  import React from 'react';
2
2
  import { ShapeProps } from './Shape';
3
3
 
4
- export const Keyhole: React.FC<ShapeProps> = (props) => (
4
+ export const Keyhole: React.FC<ShapeProps> = props => (
5
5
  <svg
6
6
  style={{ fill: 'currentcolor' }}
7
- xmlns='http://www.w3.org/2000/svg'
8
- viewBox='0 0 111 210'
7
+ xmlns="http://www.w3.org/2000/svg"
8
+ viewBox="0 0 111 210"
9
9
  {...props}
10
10
  >
11
- <path d='M.8 210h110V86.403h-9.317c5.88-8.833 9.317-19.46 9.317-30.902C110.8 24.85 86.175 0 55.8 0S.8 24.85.8 55.501c0 11.441 3.436 22.069 9.315 30.902H.8V210z' />
11
+ <path d="M.8 210h110V86.403h-9.317c5.88-8.833 9.317-19.46 9.317-30.902C110.8 24.85 86.175 0 55.8 0S.8 24.85.8 55.501c0 11.441 3.436 22.069 9.315 30.902H.8V210z" />
12
12
  </svg>
13
13
  );
@@ -1,13 +1,13 @@
1
1
  import React from 'react';
2
2
  import { ShapeProps } from './Shape';
3
3
 
4
- export const Mirror: React.FC<ShapeProps> = (props) => (
4
+ export const Mirror: React.FC<ShapeProps> = props => (
5
5
  <svg
6
6
  style={{ fill: 'currentcolor' }}
7
- xmlns='http://www.w3.org/2000/svg'
8
- viewBox='0 0 111 210'
7
+ xmlns="http://www.w3.org/2000/svg"
8
+ viewBox="0 0 111 210"
9
9
  {...props}
10
10
  >
11
- <path d='M110.03 105c0-22.7-3.786-43.7-10.2-60.874V15.97H84.176C75.724 5.862 65.739 0 55.03 0 44.323 0 34.336 5.862 25.885 15.969H10.23v28.157C3.817 61.3.03 82.3.03 105c0 22.7 3.787 43.7 10.2 60.874v28.157h15.655C34.336 204.138 44.323 210 55.03 210c10.708 0 20.693-5.862 29.146-15.969h15.652v-28.157C106.244 148.7 110.03 127.7 110.03 105z' />
11
+ <path d="M110.03 105c0-22.7-3.786-43.7-10.2-60.874V15.97H84.176C75.724 5.862 65.739 0 55.03 0 44.323 0 34.336 5.862 25.885 15.969H10.23v28.157C3.817 61.3.03 82.3.03 105c0 22.7 3.787 43.7 10.2 60.874v28.157h15.655C34.336 204.138 44.323 210 55.03 210c10.708 0 20.693-5.862 29.146-15.969h15.652v-28.157C106.244 148.7 110.03 127.7 110.03 105z" />
12
12
  </svg>
13
13
  );
@@ -1,13 +1,13 @@
1
1
  import React from 'react';
2
2
  import { ShapeProps } from './Shape';
3
3
 
4
- export const Oval: React.FC<ShapeProps> = (props) => (
4
+ export const Oval: React.FC<ShapeProps> = props => (
5
5
  <svg
6
6
  style={{ fill: 'currentcolor' }}
7
- xmlns='http://www.w3.org/2000/svg'
8
- viewBox='0 0 110 210'
7
+ xmlns="http://www.w3.org/2000/svg"
8
+ viewBox="0 0 110 210"
9
9
  {...props}
10
10
  >
11
- <path d='M110 105C110 47.01 85.376 0 55 0S0 47.01 0 105s24.624 105 55 105 55-47.01 55-105z' />
11
+ <path d="M110 105C110 47.01 85.376 0 55 0S0 47.01 0 105s24.624 105 55 105 55-47.01 55-105z" />
12
12
  </svg>
13
13
  );
@@ -3,13 +3,13 @@ import { ShapeProps } from './Shape';
3
3
 
4
4
  export const Triangle: React.FC<ShapeProps> = () => (
5
5
  <svg
6
- className='Triangle'
7
- width='24'
8
- height='24'
9
- viewBox='0 0 24 24'
10
- fill='none'
11
- xmlns='http://www.w3.org/2000/svg'
6
+ className="Triangle"
7
+ width="24"
8
+ height="24"
9
+ viewBox="0 0 24 24"
10
+ fill="none"
11
+ xmlns="http://www.w3.org/2000/svg"
12
12
  >
13
- <path fillRule='evenodd' clipRule='evenodd' d='M11.9986 0L0 24H24L11.9986 0Z' fill='#D56B27' />
13
+ <path fillRule="evenodd" clipRule="evenodd" d="M11.9986 0L0 24H24L11.9986 0Z" fill="#D56B27" />
14
14
  </svg>
15
15
  );
@@ -1,13 +1,13 @@
1
1
  import React from 'react';
2
2
  import { ShapeProps } from './Shape';
3
3
 
4
- export const Window: React.FC<ShapeProps> = (props) => (
4
+ export const Window: React.FC<ShapeProps> = props => (
5
5
  <svg
6
6
  style={{ fill: 'currentcolor' }}
7
- xmlns='http://www.w3.org/2000/svg'
8
- viewBox='0 0 110 210'
7
+ xmlns="http://www.w3.org/2000/svg"
8
+ viewBox="0 0 110 210"
9
9
  {...props}
10
10
  >
11
- <path d='M110 187.673V21.948H98.87C88.873 8.64 73.08 0 55.247 0 37.412 0 21.619 8.64 11.622 21.948H0v165.725h11.34C21.32 201.198 37.245 210 55.248 210c18 0 33.924-8.802 43.904-22.327H110z' />
11
+ <path d="M110 187.673V21.948H98.87C88.873 8.64 73.08 0 55.247 0 37.412 0 21.619 8.64 11.622 21.948H0v165.725h11.34C21.32 201.198 37.245 210 55.248 210c18 0 33.924-8.802 43.904-22.327H110z" />
12
12
  </svg>
13
13
  );
@@ -6,7 +6,7 @@ import { Stack, StackProps } from './Stack';
6
6
  export default { title: 'Components/Stack' };
7
7
 
8
8
  export const Vertical = () => (
9
- <States<StackProps> states={space.scale.map((_, i) => ({ space: i }))}>
9
+ <States<StackProps> states={space.scale.map((_, index) => ({ space: index }))}>
10
10
  <Stack space={0}>
11
11
  <div style={{ backgroundColor: 'yellow' }}>One</div>
12
12
  <div style={{ backgroundColor: 'yellow' }}>Two</div>
@@ -17,8 +17,8 @@ export const Vertical = () => (
17
17
 
18
18
  export const Horizontal = () => (
19
19
  <States<StackProps>
20
- states={space.scale.map((_, i) => ({
21
- space: i,
20
+ states={space.scale.map((_, index) => ({
21
+ space: index,
22
22
  direction: 'horizontal'
23
23
  }))}
24
24
  >
@@ -1,18 +1,20 @@
1
1
  import React from 'react';
2
- import { shallow } from 'enzyme';
2
+ import { render, screen } from '@testing-library/react';
3
3
 
4
4
  import { Stack } from './Stack';
5
5
 
6
6
  describe('Stack', () => {
7
7
  it('renders correctly', () => {
8
- const component = shallow(
9
- <Stack space={6} direction='horizontal'>
8
+ render(
9
+ <Stack space={6} direction="horizontal">
10
10
  <div>Hello</div>
11
11
  <div>World</div>
12
12
  </Stack>
13
13
  );
14
14
 
15
- expect(component.html()).toContain('Stack--horizontal-6');
16
- expect(component.text()).toContain('HelloWorld');
15
+ expect(screen.getByText('Hello')).toBeVisible();
16
+ expect(screen.getByText('World')).toBeVisible();
17
+ // eslint-disable-next-line testing-library/no-node-access
18
+ expect(screen.getByText('Hello').parentNode).toHaveClass('Stack--horizontal-6');
17
19
  });
18
20
  });
@@ -10,7 +10,7 @@ export type TabListProps = {
10
10
 
11
11
  export const TabList: React.FC<TabListProps> = ({ tabs, onTabSelected, activePanel }) => {
12
12
  return (
13
- <div className='TabList'>
13
+ <div className="TabList">
14
14
  {tabs.map(tab => (
15
15
  <Tab key={tab.name} tab={tab} onTabChosen={onTabSelected} activeTab={activePanel} />
16
16
  ))}
@@ -6,5 +6,5 @@ export type TabPanelProps = {
6
6
  };
7
7
 
8
8
  export const TabPanel: React.FC<TabPanelProps> = ({ children }) => {
9
- return <div className='TabPanel'>{children}</div>;
9
+ return <div className="TabPanel">{children}</div>;
10
10
  };
@@ -9,7 +9,7 @@ export type TabPanelsProps = {
9
9
 
10
10
  export const TabPanels: React.FC<TabPanelsProps> = ({ panels, activePanel }) => {
11
11
  return (
12
- <div className='TabPanels'>
12
+ <div className="TabPanels">
13
13
  {panels
14
14
  .filter(tab => tab.name === activePanel)
15
15
  .map(tab => (
@@ -47,9 +47,9 @@ export const WithCallback = () => {
47
47
  return (
48
48
  <States<TabsProps>>
49
49
  <>
50
- <Text treatment='h5'>Selected Tab:</Text>
50
+ <Text treatment="h5">Selected Tab:</Text>
51
51
  <Text> {tabName} </Text>
52
- <Tabs tabs={TAB_LIST} onTabClicked={handleTabClick} activeTab="tab2"/>
52
+ <Tabs tabs={TAB_LIST} onTabClicked={handleTabClick} activeTab="tab2" />
53
53
  </>
54
54
  </States>
55
55
  );
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { render } from 'enzyme';
2
+ import { render, screen } from '@testing-library/react';
3
3
 
4
4
  import { Tabs } from './Tabs';
5
5
 
@@ -8,20 +8,19 @@ describe('Tabs', () => {
8
8
  {
9
9
  name: 'tab1',
10
10
  title: 'Tab 1',
11
- panel: <div className='test'>I am a panel</div>
11
+ panel: <div className="test">I am a panel</div>
12
12
  },
13
13
  {
14
14
  name: 'tab2',
15
15
  title: 'Tab 2',
16
- panel: <div className='test'>I am also a panel</div>
16
+ panel: <div className="test">I am also a panel</div>
17
17
  }
18
18
  ];
19
19
 
20
20
  it('renders correctly with first tab displayed', () => {
21
- const component = render(<Tabs tabs={testList} />);
21
+ render(<Tabs tabs={testList} />);
22
22
 
23
- expect(component.html()).toEqual(
24
- '<div class="TabList"><button class="Clickable Tab Tab--active">Tab 1</button><button class="Clickable Tab ">Tab 2</button></div><div class="TabPanels"><div class="TabPanel"><div class="test">I am a panel</div></div></div>'
25
- );
23
+ expect(screen.getByRole('button', { name: 'Tab 1' })).toBeVisible();
24
+ expect(screen.getByRole('button', { name: 'Tab 2' })).toBeVisible();
26
25
  });
27
26
  });
@@ -9,7 +9,13 @@ export type TabsProps = React.HTMLAttributes<HTMLDivElement> & {
9
9
  activeTab?: string;
10
10
  };
11
11
 
12
- export const Tabs: React.FC<TabsProps> = ({ tabs, onTabClicked, activeTab, className, ...rest }) => {
12
+ export const Tabs: React.FC<TabsProps> = ({
13
+ tabs,
14
+ onTabClicked,
15
+ activeTab,
16
+ className,
17
+ ...rest
18
+ }) => {
13
19
  const [activePanel, setActivePanel] = useState(activeTab || tabs[0].name);
14
20
  const handleTabClick = (tabName: string) => {
15
21
  setActivePanel(tabName);
@@ -8,7 +8,7 @@ describe('Tag', () => {
8
8
  const onRemove = jest.fn();
9
9
  render(<Tag onRemove={onRemove}>Hello</Tag>);
10
10
 
11
- expect(screen.getByText('Hello')).toBeTruthy();
11
+ expect(screen.getByText('Hello')).toBeInTheDocument();
12
12
 
13
13
  await userEvent.click(screen.getByRole('button'));
14
14
  expect(onRemove).toBeCalled();
@@ -1,18 +1,19 @@
1
1
  import React from 'react';
2
2
  import classNames from 'classnames';
3
- import { Clickable } from '../Clickable';
4
3
  import ExitIcon from '@moda/icons/exit-16';
4
+ import { Clickable } from '../Clickable';
5
5
  import './Tag.scss';
6
6
 
7
- export type TagProps = { disabled?: boolean; onRemove?: () => void } & React.HTMLAttributes<
8
- HTMLDivElement
9
- >;
7
+ export type TagProps = {
8
+ disabled?: boolean;
9
+ onRemove?: () => void;
10
+ } & React.HTMLAttributes<HTMLDivElement>;
10
11
 
11
12
  export const Tag: React.FC<TagProps> = ({ className, disabled, onRemove, children, ...rest }) => (
12
13
  <div className={classNames('Tag', className, { 'Tag--disabled': disabled })} {...rest}>
13
14
  <div>{children}</div>
14
15
  {onRemove && (
15
- <Clickable disabled={disabled} aria-label='Remove' onClick={onRemove}>
16
+ <Clickable disabled={disabled} aria-label="Remove" onClick={onRemove}>
16
17
  <ExitIcon />
17
18
  </Clickable>
18
19
  )}
@@ -23,24 +23,24 @@ export const Treatments = () => (
23
23
 
24
24
  export const Colors = () => (
25
25
  <States<Partial<TextProps>> states={COLORS}>
26
- <Text treatment='h5'>Moda Operandi</Text>
26
+ <Text treatment="h5">Moda Operandi</Text>
27
27
  </States>
28
28
  );
29
29
 
30
30
  export const Families = () => (
31
31
  <States<Partial<TextProps>> states={FAMILIES}>
32
- <Text treatment='h5'>Moda Operandi</Text>
32
+ <Text treatment="h5">Moda Operandi</Text>
33
33
  </States>
34
34
  );
35
35
 
36
36
  export const Complex = () => (
37
37
  <Text>
38
- <Text treatment='h6' color='fuchsia' family='serif'>
38
+ <Text treatment="h6" color="fuchsia" family="serif">
39
39
  Moda Operandi
40
40
  </Text>
41
41
  {' — '}
42
- <Text color='money-good' treatment='eyebrow'>
43
- Happy <Text color='code-red'>Holidays</Text>
42
+ <Text color="money-good" treatment="eyebrow">
43
+ Happy <Text color="code-red">Holidays</Text>
44
44
  </Text>
45
45
  </Text>
46
46
  );
@@ -1,17 +1,15 @@
1
1
  import React from 'react';
2
- import { shallow } from 'enzyme';
2
+ import { render, screen } from '@testing-library/react';
3
3
 
4
4
  import { Text } from './Text';
5
5
 
6
6
  describe('Text', () => {
7
7
  it('renders correctly', () => {
8
- const component = shallow(
9
- <Text treatment='body2' color='money-good' family='serif'>
8
+ render(
9
+ <Text treatment="body2" color="money-good" family="serif">
10
10
  Hello
11
11
  </Text>
12
12
  );
13
- expect(component.html()).toEqual(
14
- '<span class="Text Text--body2 Text--serif" style="color:rgb(4, 108, 0)">Hello</span>'
15
- );
13
+ expect(screen.getByText('Hello')).toBeVisible();
16
14
  });
17
15
  });
@@ -14,6 +14,6 @@ export const Default = () => (
14
14
  { error: 'Error', defaultValue: 'With value' }
15
15
  ]}
16
16
  >
17
- <TextInput placeholder='An input' />
17
+ <TextInput placeholder="An input" />
18
18
  </States>
19
19
  );
@@ -1,13 +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 { TextInput } from './TextInput';
5
5
 
6
6
  describe('TextInput', () => {
7
7
  it('renders correctly', () => {
8
- const component = shallow(<TextInput placeholder='Hello' />);
9
- expect(component.html()).toEqual(
10
- '<input class="TextInput" placeholder="Hello" aria-label="Hello"/>'
11
- );
8
+ render(<TextInput placeholder="Hello" />);
9
+ expect(screen.getByRole('textbox')).toHaveValue('');
10
+ expect(screen.getByRole('textbox')).toHaveAttribute('placeholder', 'Hello');
12
11
  });
13
12
  });
@@ -18,6 +18,6 @@ export const Default = () => (
18
18
  { defaultValue: MULTI_LINE_TEXT_EXAMPLE }
19
19
  ]}
20
20
  >
21
- <Textarea placeholder='A textarea' />
21
+ <Textarea placeholder="A textarea" />
22
22
  </States>
23
23
  );
@@ -1,34 +1,29 @@
1
1
  import React from 'react';
2
- import { shallow } from 'enzyme';
2
+ import { render, screen } from '@testing-library/react';
3
3
 
4
4
  import { Textarea } from './Textarea';
5
5
 
6
6
  describe('Textarea', () => {
7
7
  it('renders correctly', () => {
8
- const component = shallow(<Textarea placeholder='Placeholder' defaultValue='Hello' />);
8
+ render(<Textarea placeholder="Placeholder" defaultValue="Hello" />);
9
9
 
10
- expect(component.html()).toEqual(
11
- '<textarea class="Textarea" placeholder="Placeholder" aria-label="Placeholder">Hello</textarea>'
12
- );
10
+ expect(screen.getByRole('textbox')).toHaveValue('Hello');
11
+ expect(screen.getByRole('textbox')).toHaveAttribute('placeholder', 'Placeholder');
13
12
  });
14
13
 
15
14
  it('renders with an error', () => {
16
- const component = shallow(
17
- <Textarea placeholder='Placeholder' defaultValue='Hello' label='Label' error='Error' />
18
- );
15
+ render(<Textarea placeholder="Placeholder" defaultValue="Hello" label="Label" error="Error" />);
19
16
 
20
- expect(component.html()).toEqual(
21
- '<textarea class="Textarea Textarea--error" placeholder="Placeholder" aria-label="Label">Hello</textarea>'
22
- );
17
+ expect(screen.getByRole('textbox')).toHaveValue('Hello');
18
+ expect(screen.getByRole('textbox')).toHaveClass('Textarea--error');
23
19
  });
24
20
 
25
21
  it('renders with a className', () => {
26
- const component = shallow(
27
- <Textarea className='Custom' placeholder='Placeholder' defaultValue='Hello' label='Label' />
22
+ render(
23
+ <Textarea className="Custom" placeholder="Placeholder" defaultValue="Hello" label="Label" />
28
24
  );
29
25
 
30
- expect(component.html()).toEqual(
31
- '<textarea class="Textarea Custom" placeholder="Placeholder" aria-label="Label">Hello</textarea>'
32
- );
26
+ expect(screen.getByRole('textbox')).toHaveValue('Hello');
27
+ expect(screen.getByRole('textbox')).toHaveClass('Custom');
33
28
  });
34
29
  });
@@ -7,7 +7,7 @@ export default { title: 'Components/Toast' };
7
7
 
8
8
  export const Default = () => (
9
9
  <States<ToastProps> states={[{ theme: 'success' }, { theme: 'warning' }, { theme: 'error' }]}>
10
- <Toast theme='success' onRemove={() => action('removed')}>
10
+ <Toast theme="success" onRemove={() => action('removed')}>
11
11
  This is a toast notification.
12
12
  </Toast>
13
13
  </States>
@@ -7,12 +7,12 @@ describe('Toast', () => {
7
7
  it('works correctly', async () => {
8
8
  const onRemove = jest.fn();
9
9
  render(
10
- <Toast theme='success' onRemove={onRemove}>
10
+ <Toast theme="success" onRemove={onRemove}>
11
11
  Hello
12
12
  </Toast>
13
13
  );
14
14
 
15
- expect(screen.getByText('Hello')).toBeTruthy();
15
+ expect(screen.getByText('Hello')).toBeInTheDocument();
16
16
 
17
17
  await userEvent.click(screen.getByRole('button', { name: 'Remove' }));
18
18
  expect(onRemove).toBeCalled();
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
2
  import classNames from 'classnames';
3
+ import ExitIcon from '@moda/icons/exit-16';
3
4
  import { Clickable } from '../Clickable';
4
5
  import { Text } from '../Text';
5
6
  import { Stack, StackProps } from '../Stack';
6
- import ExitIcon from '@moda/icons/exit-16';
7
7
  import './Toast.scss';
8
8
 
9
9
  export type ToastProps = {
@@ -14,17 +14,17 @@ export type ToastProps = {
14
14
  export const Toast: React.FC<ToastProps> = ({ theme, className, onRemove, children, ...rest }) => (
15
15
  <Stack
16
16
  className={classNames('Toast', `Toast--${theme}`, className)}
17
- direction='horizontal'
17
+ direction="horizontal"
18
18
  space={2}
19
- alignItems='center'
20
- justifyContent='space-between'
19
+ alignItems="center"
20
+ justifyContent="space-between"
21
21
  {...rest}
22
22
  >
23
- <Text treatment='bold1' color='snow'>
23
+ <Text treatment="bold1" color="snow">
24
24
  {children}
25
25
  </Text>
26
26
  {onRemove && (
27
- <Clickable aria-label='Remove' onClick={onRemove}>
27
+ <Clickable aria-label="Remove" onClick={onRemove}>
28
28
  <ExitIcon />
29
29
  </Clickable>
30
30
  )}
@@ -1,14 +1,14 @@
1
1
  import React from 'react';
2
2
 
3
3
  import { States } from 'storybook-states';
4
- import { VerticalDivider } from './VerticalDivider';
5
4
  import { Stack } from '../Stack';
5
+ import { VerticalDivider } from './VerticalDivider';
6
6
 
7
7
  export default { title: 'Components/VerticalDivider' };
8
8
 
9
9
  export const Default = () => (
10
10
  <States>
11
- <Stack direction='horizontal' space={4}>
11
+ <Stack direction="horizontal" space={4}>
12
12
  <div> Lorem ipsum dolor sit amet</div>
13
13
 
14
14
  <VerticalDivider />
@@ -20,7 +20,7 @@ export const Default = () => (
20
20
 
21
21
  export const Double = () => (
22
22
  <States>
23
- <Stack direction='horizontal' space={4}>
23
+ <Stack direction="horizontal" space={4}>
24
24
  <div> Lorem ipsum dolor sit amet</div>
25
25
 
26
26
  <VerticalDivider double />