@simplybusiness/mobius 3.9.2 → 3.9.4

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 (285) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/cjs/components/Button/Button.stories.d.ts +4 -0
  3. package/dist/cjs/components/Button/Button.stories.js +18 -1
  4. package/dist/cjs/components/Button/Button.stories.js.map +1 -1
  5. package/dist/cjs/components/Segment/Segment.stories.d.ts +10 -0
  6. package/dist/cjs/components/Segment/Segment.stories.js +47 -1
  7. package/dist/cjs/components/Segment/Segment.stories.js.map +1 -1
  8. package/dist/cjs/components/Text/Text.stories.d.ts +5 -0
  9. package/dist/cjs/components/Text/Text.stories.js +9 -1
  10. package/dist/cjs/components/Text/Text.stories.js.map +1 -1
  11. package/dist/cjs/components/TextField/TextField.stories.d.ts +3 -0
  12. package/dist/cjs/components/TextField/TextField.stories.js +5 -1
  13. package/dist/cjs/components/TextField/TextField.stories.js.map +1 -1
  14. package/dist/cjs/tsconfig.tsbuildinfo +1 -1
  15. package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
  16. package/package.json +2 -1
  17. package/src/components/Accordion/Accordion.mdx +3 -4
  18. package/src/components/Alert/Alert.mdx +4 -8
  19. package/src/components/Box/Box.mdx +4 -8
  20. package/src/components/Breadcrumbs/Breadcrumbs.mdx +2 -2
  21. package/src/components/Button/Button.mdx +17 -79
  22. package/src/components/Button/Button.stories.tsx +27 -0
  23. package/src/components/Checkbox/Checkbox.mdx +9 -23
  24. package/src/components/Checkbox/CheckboxGroup.mdx +7 -17
  25. package/src/components/Chopin/Actions/Actions.mdx +3 -5
  26. package/src/components/Chopin/Footer/Footer.mdx +2 -2
  27. package/src/components/Chopin/Header/Header.mdx +2 -2
  28. package/src/components/Chopin/PercentageTotalsQuestion/PercentageTotalsQuestion.mdx +3 -5
  29. package/src/components/Chopin/Question/Question.mdx +2 -2
  30. package/src/components/Chopin/QuestionGroup/QuestionGroup.mdx +2 -2
  31. package/src/components/Chopin/Section/Section.mdx +2 -2
  32. package/src/components/Chopin/Steps/Steps.mdx +2 -2
  33. package/src/components/Chopin/Testimonial/Testimonial.mdx +3 -5
  34. package/src/components/Chopin/TradeSelector/TradeSelector.mdx +2 -2
  35. package/src/components/Container/Container.mdx +3 -5
  36. package/src/components/DataTable/DataTable.mdx +7 -17
  37. package/src/components/DatePicker/DatePicker.mdx +2 -2
  38. package/src/components/Divider/Divider.mdx +3 -5
  39. package/src/components/DropdownMenu/DropdownMenu.mdx +4 -8
  40. package/src/components/ErrorMessage/ErrorMessage.mdx +3 -7
  41. package/src/components/Fieldset/Fieldset.mdx +4 -8
  42. package/src/components/Flex/Flex.mdx +2 -2
  43. package/src/components/Grid/Grid.mdx +35 -69
  44. package/src/components/Icon/Icon.mdx +2 -2
  45. package/src/components/Image/Image.mdx +3 -5
  46. package/src/components/Label/Label.mdx +3 -5
  47. package/src/components/Link/Link.mdx +4 -8
  48. package/src/components/LinkButton/LinkButton.mdx +3 -5
  49. package/src/components/List/List.mdx +2 -2
  50. package/src/components/LoadingIndicator/LoadingIndicator.mdx +2 -2
  51. package/src/components/MaskedField/MaskedField.mdx +3 -5
  52. package/src/components/Modal/Modal.mdx +2 -2
  53. package/src/components/NumberField/NumberField.mdx +25 -20
  54. package/src/components/PasswordField/PasswordField.mdx +3 -5
  55. package/src/components/Progress/Progress.mdx +6 -14
  56. package/src/components/Radio/Radio.mdx +9 -23
  57. package/src/components/Radio/RadioButton.mdx +10 -26
  58. package/src/components/SVG/SVG.mdx +2 -2
  59. package/src/components/Segment/Segment.mdx +31 -240
  60. package/src/components/Segment/Segment.stories.tsx +205 -2
  61. package/src/components/Select/Select.mdx +2 -2
  62. package/src/components/Slider/Slider.mdx +5 -13
  63. package/src/components/Table/Table.mdx +4 -8
  64. package/src/components/Text/Text.mdx +6 -114
  65. package/src/components/Text/Text.stories.tsx +102 -0
  66. package/src/components/TextArea/TextArea.mdx +8 -20
  67. package/src/components/TextField/TextField.mdx +10 -35
  68. package/src/components/TextField/TextField.stories.tsx +13 -0
  69. package/src/components/Title/Title.mdx +3 -5
  70. package/src/components/VisuallyHidden/VisuallyHidden.mdx +2 -4
  71. package/src/hooks/useBreakpoint/useBreakpoint.mdx +3 -7
  72. package/dist/esm/components/Accordion/Accordion.stories.js +0 -45
  73. package/dist/esm/components/Accordion/Accordion.stories.js.map +0 -1
  74. package/dist/esm/components/Accordion/Accordion.test.js +0 -65
  75. package/dist/esm/components/Accordion/Accordion.test.js.map +0 -1
  76. package/dist/esm/components/Alert/Alert.stories.js +0 -32
  77. package/dist/esm/components/Alert/Alert.stories.js.map +0 -1
  78. package/dist/esm/components/Alert/Alert.test.js +0 -48
  79. package/dist/esm/components/Alert/Alert.test.js.map +0 -1
  80. package/dist/esm/components/Box/Box.stories.js +0 -20
  81. package/dist/esm/components/Box/Box.stories.js.map +0 -1
  82. package/dist/esm/components/Box/Box.test.js +0 -31
  83. package/dist/esm/components/Box/Box.test.js.map +0 -1
  84. package/dist/esm/components/Breadcrumbs/Breadcrumbs.stories.js +0 -17
  85. package/dist/esm/components/Breadcrumbs/Breadcrumbs.stories.js.map +0 -1
  86. package/dist/esm/components/Breadcrumbs/Breadcrumbs.test.js +0 -33
  87. package/dist/esm/components/Breadcrumbs/Breadcrumbs.test.js.map +0 -1
  88. package/dist/esm/components/Button/Button.stories.js +0 -198
  89. package/dist/esm/components/Button/Button.stories.js.map +0 -1
  90. package/dist/esm/components/Button/Button.test.js +0 -81
  91. package/dist/esm/components/Button/Button.test.js.map +0 -1
  92. package/dist/esm/components/Checkbox/Checkbox.stories.js +0 -98
  93. package/dist/esm/components/Checkbox/Checkbox.stories.js.map +0 -1
  94. package/dist/esm/components/Checkbox/Checkbox.test.js +0 -108
  95. package/dist/esm/components/Checkbox/Checkbox.test.js.map +0 -1
  96. package/dist/esm/components/Checkbox/CheckboxGroup.stories.js +0 -71
  97. package/dist/esm/components/Checkbox/CheckboxGroup.stories.js.map +0 -1
  98. package/dist/esm/components/Checkbox/CheckboxGroup.test.js +0 -44
  99. package/dist/esm/components/Checkbox/CheckboxGroup.test.js.map +0 -1
  100. package/dist/esm/components/Chopin/Actions/Actions.stories.js +0 -56
  101. package/dist/esm/components/Chopin/Actions/Actions.stories.js.map +0 -1
  102. package/dist/esm/components/Chopin/Actions/Actions.test.js +0 -95
  103. package/dist/esm/components/Chopin/Actions/Actions.test.js.map +0 -1
  104. package/dist/esm/components/Chopin/Actions/LinkOrButton.test.js +0 -33
  105. package/dist/esm/components/Chopin/Actions/LinkOrButton.test.js.map +0 -1
  106. package/dist/esm/components/Chopin/Footer/Footer.stories.js +0 -166
  107. package/dist/esm/components/Chopin/Footer/Footer.stories.js.map +0 -1
  108. package/dist/esm/components/Chopin/Footer/Footer.test.js +0 -90
  109. package/dist/esm/components/Chopin/Footer/Footer.test.js.map +0 -1
  110. package/dist/esm/components/Chopin/Header/Header.stories.js +0 -38
  111. package/dist/esm/components/Chopin/Header/Header.stories.js.map +0 -1
  112. package/dist/esm/components/Chopin/Header/Header.test.js +0 -86
  113. package/dist/esm/components/Chopin/Header/Header.test.js.map +0 -1
  114. package/dist/esm/components/Chopin/PercentageTotalsQuestion/PercentageTotalsQuestion.stories.js +0 -43
  115. package/dist/esm/components/Chopin/PercentageTotalsQuestion/PercentageTotalsQuestion.stories.js.map +0 -1
  116. package/dist/esm/components/Chopin/PercentageTotalsQuestion/PercentageTotalsQuestion.test.js +0 -108
  117. package/dist/esm/components/Chopin/PercentageTotalsQuestion/PercentageTotalsQuestion.test.js.map +0 -1
  118. package/dist/esm/components/Chopin/Question/Question.stories.js +0 -136
  119. package/dist/esm/components/Chopin/Question/Question.stories.js.map +0 -1
  120. package/dist/esm/components/Chopin/Question/Question.test.js +0 -116
  121. package/dist/esm/components/Chopin/Question/Question.test.js.map +0 -1
  122. package/dist/esm/components/Chopin/QuestionGroup/QuestionGroup.stories.js +0 -40
  123. package/dist/esm/components/Chopin/QuestionGroup/QuestionGroup.stories.js.map +0 -1
  124. package/dist/esm/components/Chopin/QuestionGroup/QuestionGroup.test.js +0 -62
  125. package/dist/esm/components/Chopin/QuestionGroup/QuestionGroup.test.js.map +0 -1
  126. package/dist/esm/components/Chopin/QuestionHelp/QuestionHelp.test.js +0 -41
  127. package/dist/esm/components/Chopin/QuestionHelp/QuestionHelp.test.js.map +0 -1
  128. package/dist/esm/components/Chopin/Section/Section.stories.js +0 -16
  129. package/dist/esm/components/Chopin/Section/Section.stories.js.map +0 -1
  130. package/dist/esm/components/Chopin/Section/Section.test.js +0 -35
  131. package/dist/esm/components/Chopin/Section/Section.test.js.map +0 -1
  132. package/dist/esm/components/Chopin/Steps/Steps.stories.js +0 -12
  133. package/dist/esm/components/Chopin/Steps/Steps.stories.js.map +0 -1
  134. package/dist/esm/components/Chopin/Steps/Steps.test.js +0 -93
  135. package/dist/esm/components/Chopin/Steps/Steps.test.js.map +0 -1
  136. package/dist/esm/components/Chopin/Testimonial/Testimonial.stories.js +0 -15
  137. package/dist/esm/components/Chopin/Testimonial/Testimonial.stories.js.map +0 -1
  138. package/dist/esm/components/Chopin/Testimonial/Testimonial.test.js +0 -35
  139. package/dist/esm/components/Chopin/Testimonial/Testimonial.test.js.map +0 -1
  140. package/dist/esm/components/Chopin/TradeSelector/Listing/Listing.test.js +0 -26
  141. package/dist/esm/components/Chopin/TradeSelector/Listing/Listing.test.js.map +0 -1
  142. package/dist/esm/components/Chopin/TradeSelector/Listing/ListingItem.test.js +0 -37
  143. package/dist/esm/components/Chopin/TradeSelector/Listing/ListingItem.test.js.map +0 -1
  144. package/dist/esm/components/Chopin/TradeSelector/SearchResults/SearchResults.test.js +0 -86
  145. package/dist/esm/components/Chopin/TradeSelector/SearchResults/SearchResults.test.js.map +0 -1
  146. package/dist/esm/components/Chopin/TradeSelector/TradeInput/TradeInput.test.js +0 -52
  147. package/dist/esm/components/Chopin/TradeSelector/TradeInput/TradeInput.test.js.map +0 -1
  148. package/dist/esm/components/Chopin/TradeSelector/TradeSelector.stories.js +0 -52
  149. package/dist/esm/components/Chopin/TradeSelector/TradeSelector.stories.js.map +0 -1
  150. package/dist/esm/components/Chopin/TradeSelector/TradeSelector.test.js +0 -226
  151. package/dist/esm/components/Chopin/TradeSelector/TradeSelector.test.js.map +0 -1
  152. package/dist/esm/components/Container/Container.stories.js +0 -12
  153. package/dist/esm/components/Container/Container.stories.js.map +0 -1
  154. package/dist/esm/components/Container/Container.test.js +0 -37
  155. package/dist/esm/components/Container/Container.test.js.map +0 -1
  156. package/dist/esm/components/DataTable/DataTable.stories.js +0 -174
  157. package/dist/esm/components/DataTable/DataTable.stories.js.map +0 -1
  158. package/dist/esm/components/DataTable/DataTable.test.js +0 -119
  159. package/dist/esm/components/DataTable/DataTable.test.js.map +0 -1
  160. package/dist/esm/components/DatePicker/DatePicker.stories.js +0 -25
  161. package/dist/esm/components/DatePicker/DatePicker.stories.js.map +0 -1
  162. package/dist/esm/components/Divider/Divider.stories.js +0 -12
  163. package/dist/esm/components/Divider/Divider.stories.js.map +0 -1
  164. package/dist/esm/components/DropdownMenu/DropdownMenu.stories.js +0 -58
  165. package/dist/esm/components/DropdownMenu/DropdownMenu.stories.js.map +0 -1
  166. package/dist/esm/components/DropdownMenu/DropdownMenu.test.js +0 -95
  167. package/dist/esm/components/DropdownMenu/DropdownMenu.test.js.map +0 -1
  168. package/dist/esm/components/ErrorMessage/ErrorMessage.stories.js +0 -21
  169. package/dist/esm/components/ErrorMessage/ErrorMessage.stories.js.map +0 -1
  170. package/dist/esm/components/ErrorMessage/ErrorMessage.test.js +0 -30
  171. package/dist/esm/components/ErrorMessage/ErrorMessage.test.js.map +0 -1
  172. package/dist/esm/components/Fieldset/Fieldset.stories.js +0 -22
  173. package/dist/esm/components/Fieldset/Fieldset.stories.js.map +0 -1
  174. package/dist/esm/components/Fieldset/Fieldset.test.js +0 -10
  175. package/dist/esm/components/Fieldset/Fieldset.test.js.map +0 -1
  176. package/dist/esm/components/Flex/Flex.stories.js +0 -148
  177. package/dist/esm/components/Flex/Flex.stories.js.map +0 -1
  178. package/dist/esm/components/Flex/Flex.test.js +0 -31
  179. package/dist/esm/components/Flex/Flex.test.js.map +0 -1
  180. package/dist/esm/components/Grid/Grid.stories.js +0 -227
  181. package/dist/esm/components/Grid/Grid.stories.js.map +0 -1
  182. package/dist/esm/components/Grid/Grid.test.js +0 -95
  183. package/dist/esm/components/Grid/Grid.test.js.map +0 -1
  184. package/dist/esm/components/Icon/Icon.stories.js +0 -43
  185. package/dist/esm/components/Icon/Icon.stories.js.map +0 -1
  186. package/dist/esm/components/Icon/Icon.test.js +0 -52
  187. package/dist/esm/components/Icon/Icon.test.js.map +0 -1
  188. package/dist/esm/components/Image/Image.stories.js +0 -17
  189. package/dist/esm/components/Image/Image.stories.js.map +0 -1
  190. package/dist/esm/components/Image/Image.test.js +0 -37
  191. package/dist/esm/components/Image/Image.test.js.map +0 -1
  192. package/dist/esm/components/Label/Label.stories.js +0 -15
  193. package/dist/esm/components/Label/Label.stories.js.map +0 -1
  194. package/dist/esm/components/Label/Label.test.js +0 -35
  195. package/dist/esm/components/Label/Label.test.js.map +0 -1
  196. package/dist/esm/components/Link/Link.stories.js +0 -41
  197. package/dist/esm/components/Link/Link.stories.js.map +0 -1
  198. package/dist/esm/components/Link/Link.test.js +0 -65
  199. package/dist/esm/components/Link/Link.test.js.map +0 -1
  200. package/dist/esm/components/LinkButton/LinkButton.stories.js +0 -42
  201. package/dist/esm/components/LinkButton/LinkButton.stories.js.map +0 -1
  202. package/dist/esm/components/LinkButton/LinkButton.test.js +0 -62
  203. package/dist/esm/components/LinkButton/LinkButton.test.js.map +0 -1
  204. package/dist/esm/components/List/List.stories.js +0 -77
  205. package/dist/esm/components/List/List.stories.js.map +0 -1
  206. package/dist/esm/components/List/List.test.js +0 -93
  207. package/dist/esm/components/List/List.test.js.map +0 -1
  208. package/dist/esm/components/LoadingIndicator/LoadingIndicator.stories.js +0 -50
  209. package/dist/esm/components/LoadingIndicator/LoadingIndicator.stories.js.map +0 -1
  210. package/dist/esm/components/LoadingIndicator/LoadingIndicator.test.js +0 -27
  211. package/dist/esm/components/LoadingIndicator/LoadingIndicator.test.js.map +0 -1
  212. package/dist/esm/components/MaskedField/MaskedField.stories.js +0 -22
  213. package/dist/esm/components/MaskedField/MaskedField.stories.js.map +0 -1
  214. package/dist/esm/components/MaskedField/MaskedField.test.js +0 -64
  215. package/dist/esm/components/MaskedField/MaskedField.test.js.map +0 -1
  216. package/dist/esm/components/Modal/Modal.stories.js +0 -79
  217. package/dist/esm/components/Modal/Modal.stories.js.map +0 -1
  218. package/dist/esm/components/Modal/Modal.test.js +0 -135
  219. package/dist/esm/components/Modal/Modal.test.js.map +0 -1
  220. package/dist/esm/components/NumberField/NumberField.stories.js +0 -103
  221. package/dist/esm/components/NumberField/NumberField.stories.js.map +0 -1
  222. package/dist/esm/components/NumberField/NumberField.test.js +0 -81
  223. package/dist/esm/components/NumberField/NumberField.test.js.map +0 -1
  224. package/dist/esm/components/PasswordField/PasswordField.stories.js +0 -31
  225. package/dist/esm/components/PasswordField/PasswordField.stories.js.map +0 -1
  226. package/dist/esm/components/PasswordField/PasswordField.test.js +0 -29
  227. package/dist/esm/components/PasswordField/PasswordField.test.js.map +0 -1
  228. package/dist/esm/components/Progress/Progress.stories.js +0 -89
  229. package/dist/esm/components/Progress/Progress.stories.js.map +0 -1
  230. package/dist/esm/components/Progress/Progress.test.js +0 -32
  231. package/dist/esm/components/Progress/Progress.test.js.map +0 -1
  232. package/dist/esm/components/Radio/Radio.stories.js +0 -118
  233. package/dist/esm/components/Radio/Radio.stories.js.map +0 -1
  234. package/dist/esm/components/Radio/Radio.test.js +0 -139
  235. package/dist/esm/components/Radio/Radio.test.js.map +0 -1
  236. package/dist/esm/components/Radio/RadioButton.stories.js +0 -88
  237. package/dist/esm/components/Radio/RadioButton.stories.js.map +0 -1
  238. package/dist/esm/components/Radio/RadioButton.test.js +0 -118
  239. package/dist/esm/components/Radio/RadioButton.test.js.map +0 -1
  240. package/dist/esm/components/SVG/SVG.stories.js +0 -19
  241. package/dist/esm/components/SVG/SVG.stories.js.map +0 -1
  242. package/dist/esm/components/SVG/SVG.test.js +0 -26
  243. package/dist/esm/components/SVG/SVG.test.js.map +0 -1
  244. package/dist/esm/components/Segment/Segment.stories.js +0 -75
  245. package/dist/esm/components/Segment/Segment.stories.js.map +0 -1
  246. package/dist/esm/components/Select/Select.stories.js +0 -79
  247. package/dist/esm/components/Select/Select.stories.js.map +0 -1
  248. package/dist/esm/components/Select/Select.test.js +0 -94
  249. package/dist/esm/components/Select/Select.test.js.map +0 -1
  250. package/dist/esm/components/Slider/Slider.stories.js +0 -63
  251. package/dist/esm/components/Slider/Slider.stories.js.map +0 -1
  252. package/dist/esm/components/Slider/Slider.test.js +0 -58
  253. package/dist/esm/components/Slider/Slider.test.js.map +0 -1
  254. package/dist/esm/components/Table/Table.stories.js +0 -15
  255. package/dist/esm/components/Table/Table.stories.js.map +0 -1
  256. package/dist/esm/components/Table/Table.test.js +0 -73
  257. package/dist/esm/components/Table/Table.test.js.map +0 -1
  258. package/dist/esm/components/Text/Text.stories.js +0 -26
  259. package/dist/esm/components/Text/Text.stories.js.map +0 -1
  260. package/dist/esm/components/Text/Text.test.js +0 -31
  261. package/dist/esm/components/Text/Text.test.js.map +0 -1
  262. package/dist/esm/components/TextArea/TextArea.stories.js +0 -80
  263. package/dist/esm/components/TextArea/TextArea.stories.js.map +0 -1
  264. package/dist/esm/components/TextArea/TextArea.test.js +0 -84
  265. package/dist/esm/components/TextArea/TextArea.test.js.map +0 -1
  266. package/dist/esm/components/TextAreaInput/TextAreaInput.test.js +0 -42
  267. package/dist/esm/components/TextAreaInput/TextAreaInput.test.js.map +0 -1
  268. package/dist/esm/components/TextField/TextField.stories.js +0 -100
  269. package/dist/esm/components/TextField/TextField.stories.js.map +0 -1
  270. package/dist/esm/components/TextField/TextField.test.js +0 -123
  271. package/dist/esm/components/TextField/TextField.test.js.map +0 -1
  272. package/dist/esm/components/Title/Title.stories.js +0 -16
  273. package/dist/esm/components/Title/Title.stories.js.map +0 -1
  274. package/dist/esm/components/Title/Title.test.js +0 -20
  275. package/dist/esm/components/Title/Title.test.js.map +0 -1
  276. package/dist/esm/components/VisuallyHidden/VisuallyHidden.stories.js +0 -12
  277. package/dist/esm/components/VisuallyHidden/VisuallyHidden.stories.js.map +0 -1
  278. package/dist/esm/contexts/ThemeContext/ThemeContext.test.js +0 -10
  279. package/dist/esm/contexts/ThemeContext/ThemeContext.test.js.map +0 -1
  280. package/dist/esm/hooks/useBreakpoint/useBreakpoint.stories.js +0 -40
  281. package/dist/esm/hooks/useBreakpoint/useBreakpoint.stories.js.map +0 -1
  282. package/dist/esm/hooks/useBreakpoint/useBreakpoint.test.js +0 -242
  283. package/dist/esm/hooks/useBreakpoint/useBreakpoint.test.js.map +0 -1
  284. package/dist/esm/hooks/useButton/useButton.test.js +0 -141
  285. package/dist/esm/hooks/useButton/useButton.test.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"Progress.test.js","sourceRoot":"","sources":["../../../../src/components/Progress/Progress.test.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,CAAC;AAE7B,QAAQ,CAAC,UAAU,EAAE,GAAG,EAAE;IACxB,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE;QAC1B,IAAI,MAAW,CAAC;QAEhB,UAAU,CAAC,GAAG,EAAE;YACd,MAAM,GAAG,MAAM,CACb,KAAC,QAAQ,IACP,KAAK,EAAC,UAAU,EAChB,SAAS,EAAC,MAAM,EAChB,QAAQ,EAAE,CAAC,EACX,QAAQ,EAAE,EAAE,GACZ,CACH,CAAC;QACJ,CAAC,CAAC,CAAC;QAEH,MAAM,UAAU,GAAG,CAAC,QAAQ,EAAE,iBAAiB,EAAE,MAAM,CAAC,CAAC;QACzD,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC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as _jsxs } from "react/jsx-runtime";
2
- import { Radio } from "./Radio";
3
- import { RadioGroup } from "./RadioGroup";
4
- import { Flex } from "../Flex";
5
- import { Divider } from "../Divider";
6
- import { excludeControls } from "../../utils/excludeControls";
7
- export default {
8
- title: "Forms/Radio",
9
- component: Radio,
10
- argTypes: Object.assign({ validationState: {
11
- options: ["valid", "invalid", "neither"],
12
- control: { type: "radio" },
13
- mapping: {
14
- valid: "valid",
15
- invalid: "invalid",
16
- neither: "",
17
- },
18
- }, orientation: {
19
- control: { type: "radio" },
20
- options: ["horizontal", "vertical"],
21
- }, label: {
22
- control: { type: "text" },
23
- } }, excludeControls("children", "className", "elementType")),
24
- };
25
- export const Normal = {
26
- render: (args) => (_jsxs(RadioGroup, Object.assign({}, args, { children: [_jsx(Radio, { value: "red", label: "Red" }), _jsx(Radio, { value: "blue", label: "Blue" })] }))),
27
- args: {
28
- label: "Color",
29
- isDisabled: false,
30
- errorMessage: "",
31
- orientation: "vertical",
32
- defaultValue: "blue",
33
- },
34
- };
35
- export const ControlledValue = {
36
- render: (args) => (_jsxs(RadioGroup, Object.assign({}, args, { children: [_jsx(Radio, { value: "red", label: "Red" }), _jsx(Radio, { value: "blue", label: "Blue" })] }))),
37
- args: {
38
- label: "Color",
39
- isDisabled: false,
40
- errorMessage: "",
41
- orientation: "vertical",
42
- value: "blue",
43
- },
44
- };
45
- export const Disabled = {
46
- render: (args) => (_jsxs(RadioGroup, Object.assign({}, args, { children: [_jsx(Radio, { value: "red", label: "Red", isDisabled: true }), _jsx(Radio, { value: "blue", label: "Blue" })] }))),
47
- args: {
48
- label: "Color",
49
- isDisabled: true,
50
- errorMessage: "",
51
- orientation: "vertical",
52
- },
53
- };
54
- export const DisabledIndividualRadios = {
55
- render: (args) => (_jsxs(RadioGroup, Object.assign({}, args, { children: [_jsx(Radio, { value: "red", label: "Red", isDisabled: true }), _jsx(Radio, { value: "blue", label: "Blue" })] }))),
56
- args: {
57
- label: "Color",
58
- isDisabled: false,
59
- errorMessage: "",
60
- orientation: "vertical",
61
- },
62
- };
63
- export const Valid = {
64
- render: (args) => (_jsxs(RadioGroup, Object.assign({}, args, { children: [_jsx(Radio, { value: "red", label: "Red" }), _jsx(Radio, { value: "blue", label: "Blue" })] }))),
65
- args: {
66
- label: "Color",
67
- isDisabled: false,
68
- errorMessage: "",
69
- validationState: "valid",
70
- orientation: "vertical",
71
- },
72
- };
73
- export const Invalid = {
74
- render: (args) => (_jsxs(RadioGroup, Object.assign({}, args, { children: [_jsx(Radio, { value: "red", label: "Red" }), _jsx(Radio, { value: "blue", label: "Blue" })] }))),
75
- args: {
76
- label: "Color",
77
- isDisabled: false,
78
- errorMessage: "Please select a color",
79
- validationState: "invalid",
80
- orientation: "vertical",
81
- },
82
- };
83
- export const ComplexLabel = {
84
- render: (args) => (_jsxs(RadioGroup, Object.assign({}, args, { children: [_jsx(Radio, Object.assign({ value: "annual", label: "Pay annually" }, { children: _jsxs(Flex, Object.assign({ style: {
85
- width: "100%",
86
- flexDirection: "row",
87
- justifyContent: "space-between",
88
- } }, { children: [_jsx("div", { children: "To pay today" }), _jsx("div", { children: "$1265.00" })] })) })), _jsxs(Radio, Object.assign({ value: "monthly", label: "Pay monthly" }, { children: [_jsxs(Flex, Object.assign({ style: {
89
- width: "100%",
90
- flexDirection: "row",
91
- justifyContent: "space-between",
92
- marginBottom: "var(--size-20)",
93
- } }, { children: [_jsx("div", { children: "To pay today" }), _jsx("div", { children: "$316.25" })] })), _jsxs(Flex, Object.assign({ style: {
94
- width: "100%",
95
- flexDirection: "row",
96
- justifyContent: "space-between",
97
- } }, { children: [_jsx("div", { children: "10 monthly payments of" }), _jsx("div", { children: "$94.88" })] })), _jsx(Divider, {}), _jsxs(Flex, Object.assign({ style: {
98
- width: "100%",
99
- flexDirection: "row",
100
- justifyContent: "space-between",
101
- } }, { children: [_jsx("div", { children: _jsx("strong", { children: "Total" }) }), _jsx("div", { children: _jsx("strong", { children: "$1265.00" }) })] }))] }))] }))),
102
- args: {
103
- label: "Payment Options",
104
- isDisabled: false,
105
- errorMessage: "",
106
- orientation: "vertical",
107
- },
108
- };
109
- export const HorizontalLayout = {
110
- render: (args) => (_jsxs(RadioGroup, Object.assign({}, args, { children: [_jsx(Radio, { value: "red", label: "Red" }), _jsx(Radio, { value: "blue", label: "Blue" })] }))),
111
- args: {
112
- label: "Color",
113
- isDisabled: false,
114
- errorMessage: "",
115
- orientation: "horizontal",
116
- },
117
- };
118
- //# sourceMappingURL=Radio.stories.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Radio.stories.js","sourceRoot":"","sources":["../../../../src/components/Radio/Radio.stories.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,UAAU,EAAmB,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE9D,eAAe;IACb,KAAK,EAAE,aAAa;IACpB,SAAS,EAAE,KAAK;IAChB,QAAQ,kBACN,eAAe,EAAE;YACf,OAAO,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,SAAS,CAAC;YACxC,OAAO,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE;YAC1B,OAAO,EAAE;gBACP,KAAK,EAAE,OAAO;gBACd,OAAO,EAAE,SAAS;gBAClB,OAAO,EAAE,EAAE;aACZ;SACF,EACD,WAAW,EAAE;YACX,OAAO,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE;YAC1B,OAAO,EAAE,CAAC,YAAY,EAAE,UAAU,CAAC;SACpC,EACD,KAAK,EAAE;YACL,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;SAC1B,IACE,eAAe,CAAC,UAAU,EAAE,WAAW,EAAE,aAAa,CAAC,CAC3D;CACF,CAAC;AAEF,MAAM,CAA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CAAC,CACjC,MAAC,UAAU,oBAAK,IAAI,eAClB,KAAC,KAAK,IAAC,KAAK,EAAC,KAAK,EAAC,KAAK,EAAC,KAAK,GAAG,EACjC,KAAC,KAAK,IAAC,KAAK,EAAC,MAAM,EAAC,KAAK,EAAC,MAAM,GAAG,KACxB,CACd;IACD,IAAI,EAAE;QACJ,KAAK,EAAE,OAAO;QACd,UAAU,EAAE,KAAK;QACjB,YAAY,EAAE,EAAE;QAChB,WAAW,EAAE,YAAY;KAC1B;CACF,CAAC"}
@@ -1,139 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { render, fireEvent, screen } from "@testing-library/react";
3
- import userEvent from "@testing-library/user-event";
4
- import { RadioGroup, Radio } from ".";
5
- describe("Radio", () => {
6
- it("should render without error", () => {
7
- const component = render(_jsxs(RadioGroup, Object.assign({ label: "Color" }, { children: [_jsx(Radio, Object.assign({ value: "red" }, { children: "Red" })), _jsx(Radio, Object.assign({ value: "blue" }, { children: "Blue" }))] })));
8
- expect(component).toBeTruthy();
9
- });
10
- it("should set aria-describedby for all radios when errorMessage is set", () => {
11
- render(_jsxs(RadioGroup, Object.assign({ label: "Radio Group", errorMessage: "Error message" }, { children: [_jsx(Radio, { label: "Radio 1", value: "value1" }), _jsx(Radio, { label: "Radio 2", value: "value2" }), _jsx(Radio, { label: "Radio 3", value: "value3" })] })));
12
- const radios = screen.getAllByRole("radio");
13
- radios.forEach(radio => {
14
- expect(radio).toHaveAccessibleDescription("Error message");
15
- });
16
- });
17
- it("should call onChange with the selected value when clicked", async () => {
18
- const callback = jest.fn();
19
- const { getByLabelText } = render(_jsxs(RadioGroup, Object.assign({ label: "Color", onChange: callback }, { children: [_jsx(Radio, Object.assign({ value: "red" }, { children: "Red" })), _jsx(Radio, Object.assign({ value: "blue" }, { children: "Blue" }))] })));
20
- await userEvent.click(getByLabelText("Red"));
21
- expect(callback).toHaveBeenCalledWith("red");
22
- await userEvent.click(getByLabelText("Blue"));
23
- expect(callback).toHaveBeenCalledWith("blue");
24
- });
25
- it("should be selectable via keyboard", async () => {
26
- const callback = jest.fn();
27
- render(_jsxs(RadioGroup, Object.assign({ label: "Color", onChange: callback }, { children: [_jsx(Radio, Object.assign({ value: "red" }, { children: "Red" })), _jsx(Radio, Object.assign({ value: "blue" }, { children: "Blue" }))] })));
28
- await userEvent.tab();
29
- await userEvent.type(document.activeElement, "[Space]");
30
- expect(callback).toHaveBeenCalledWith("red");
31
- fireEvent.keyDown(document.activeElement, {
32
- key: "ArrowDown",
33
- code: "ArrowDown",
34
- });
35
- expect(callback).toHaveBeenCalledWith("blue");
36
- });
37
- describe("when child component is null", () => {
38
- it("renders without errors", () => {
39
- expect(() => render(_jsxs(RadioGroup, Object.assign({ label: "Color" }, { children: [_jsx(Radio, Object.assign({ value: "red" }, { children: "Red" })), null] })))).not.toThrow();
40
- });
41
- });
42
- describe("isRequired", () => {
43
- it("should set aria-required to true", () => {
44
- render(_jsxs(RadioGroup, Object.assign({ label: "Color", isRequired: true }, { children: [_jsx(Radio, Object.assign({ value: "red" }, { children: "Red" })), null] })));
45
- expect(screen.getByLabelText("Color")).toHaveAttribute("aria-required", "true");
46
- });
47
- it("should have className of --is-required when true", () => {
48
- render(_jsxs(RadioGroup, Object.assign({ label: "Color", isRequired: true }, { children: [_jsx(Radio, Object.assign({ value: "red" }, { children: "Red" })), null] })));
49
- expect(screen.getByLabelText("Color")).toHaveClass("--is-required");
50
- });
51
- it("should have className of --is-optional when false", () => {
52
- render(_jsxs(RadioGroup, Object.assign({ label: "Color", isRequired: false }, { children: [_jsx(Radio, Object.assign({ value: "red" }, { children: "Red" })), null] })));
53
- expect(screen.getByLabelText("Color")).toHaveClass("--is-optional");
54
- });
55
- it("should have neither --is-required nor --is-optional when unset", () => {
56
- render(_jsxs(RadioGroup, Object.assign({ label: "Color" }, { children: [_jsx(Radio, Object.assign({ value: "red" }, { children: "Red" })), null] })));
57
- expect(screen.getByLabelText("Color")).not.toHaveClass("--is-required");
58
- expect(screen.getByLabelText("Color")).not.toHaveClass("--is-optional");
59
- });
60
- });
61
- describe("uses correct class names for atoms", () => {
62
- it("uses Mobius class", () => {
63
- const { container } = render(_jsxs(RadioGroup, Object.assign({ label: "Color", "data-testid": "test" }, { children: [_jsx(Radio, Object.assign({ value: "red" }, { children: "Red" })), _jsx(Radio, Object.assign({ value: "blue" }, { children: "Blue" }))] })));
64
- expect(container.firstChild).toHaveClass("mobius");
65
- });
66
- it("uses base Mobius class", () => {
67
- const { container } = render(_jsxs(RadioGroup, Object.assign({ label: "Color", "data-testid": "test" }, { children: [_jsx(Radio, Object.assign({ value: "red" }, { children: "Red" })), _jsx(Radio, Object.assign({ value: "blue" }, { children: "Blue" }))] })));
68
- expect(screen.getByTestId("test")).toHaveClass("mobius/RadioGroup");
69
- expect(screen.getByTestId("test").firstChild).toHaveClass("mobius/Label");
70
- const wrapper = screen.getByTestId("test").childNodes[1];
71
- expect(wrapper).toHaveClass("mobius/RadioWrapper");
72
- expect(container.querySelector(".mobius\\/RadioLabel")).toBeInTheDocument();
73
- expect(container.querySelector(".mobius\\/RadioBullet")).toBeInTheDocument();
74
- expect(container.querySelector(".mobius\\/RadioInput")).toBeInTheDocument();
75
- });
76
- it("includes custom class names", () => {
77
- const { container } = render(_jsxs(RadioGroup, Object.assign({ label: "Color", className: "my-class", "data-testid": "test" }, { children: [_jsx(Radio, Object.assign({ value: "red", className: "red" }, { children: "Red" })), _jsx(Radio, Object.assign({ value: "blue", className: "blue" }, { children: "Blue" }))] })));
78
- expect(screen.getByTestId("test")).toHaveClass("mobius/RadioGroup");
79
- expect(screen.getByTestId("test")).toHaveClass("my-class");
80
- const wrapper = screen.getByTestId("test").childNodes[1];
81
- const label = container.querySelector(".mobius\\/RadioLabel");
82
- const redLabel = container.querySelector(".mobius\\/RadioLabel.red");
83
- const blueLabel = container.querySelector(".mobius\\/RadioLabel.blue");
84
- expect(wrapper).toHaveClass("mobius/RadioWrapper");
85
- expect(label).toBeInTheDocument();
86
- expect(redLabel).toBeInTheDocument();
87
- expect(blueLabel).toBeInTheDocument();
88
- });
89
- it("sets classes for interaction states", async () => {
90
- var _a;
91
- const callback = jest.fn();
92
- const { container } = render(_jsxs(RadioGroup, Object.assign({ "data-testid": "test", label: "Color", onChange: callback }, { children: [_jsx(Radio, Object.assign({ value: "red" }, { children: "Red" })), _jsx(Radio, Object.assign({ value: "blue" }, { children: "Blue" }))] })));
93
- // Hover over radio
94
- fireEvent.mouseEnter(container.querySelector("input"));
95
- const radio = (_a = screen.getByTestId("test").childNodes[1]) === null || _a === void 0 ? void 0 : _a.firstChild;
96
- const radioIcon = radio === null || radio === void 0 ? void 0 : radio.firstChild;
97
- expect(radio).toHaveClass("--is-hovered");
98
- expect(radioIcon).toHaveClass("--is-hovered");
99
- await userEvent.tab();
100
- await userEvent.type(document.activeElement, "[Space]");
101
- expect(radio).toHaveClass("--is-selected");
102
- expect(radioIcon).toHaveClass("--is-selected");
103
- fireEvent.keyDown(document.activeElement, {
104
- key: "ArrowDown",
105
- code: "ArrowDown",
106
- });
107
- const selectedLabel = container.querySelector(".mobius\\/RadioLabel.--is-selected");
108
- expect(selectedLabel).toBeInTheDocument();
109
- });
110
- it("sets classes for disabled state", () => {
111
- const { container } = render(_jsxs(RadioGroup, Object.assign({ "data-testid": "test", label: "Color", isDisabled: true }, { children: [_jsx(Radio, Object.assign({ value: "red" }, { children: "Red" })), _jsx(Radio, Object.assign({ value: "blue" }, { children: "Blue" }))] })));
112
- const radio = screen.getByTestId("test");
113
- const radioIcon = radio === null || radio === void 0 ? void 0 : radio.firstChild;
114
- const disabledLabels = container.querySelectorAll(".mobius\\/RadioLabel.--is-disabled");
115
- expect(radio).toHaveClass("--is-disabled");
116
- expect(radioIcon).toHaveClass("--is-disabled");
117
- expect(disabledLabels.length).toEqual(2);
118
- });
119
- it("sets classes for valid state", () => {
120
- const { container } = render(_jsxs(RadioGroup, Object.assign({ "data-testid": "test", label: "Color", validationState: "valid" }, { children: [_jsx(Radio, Object.assign({ value: "red" }, { children: "Red" })), _jsx(Radio, Object.assign({ value: "blue" }, { children: "Blue" }))] })));
121
- const radio = screen.getByTestId("test");
122
- const radioIcon = radio === null || radio === void 0 ? void 0 : radio.firstChild;
123
- const validLabels = container.querySelectorAll(".mobius\\/RadioLabel.--is-valid");
124
- expect(radio).toHaveClass("--is-valid");
125
- expect(radioIcon).toHaveClass("--is-valid");
126
- expect(validLabels.length).toEqual(2);
127
- });
128
- it("sets classes for invalid state", () => {
129
- const { container } = render(_jsxs(RadioGroup, Object.assign({ "data-testid": "test", label: "Color", validationState: "invalid" }, { children: [_jsx(Radio, Object.assign({ value: "red" }, { children: "Red" })), _jsx(Radio, Object.assign({ value: "blue" }, { children: "Blue" }))] })));
130
- const radio = screen.getByTestId("test");
131
- const radioIcon = radio.firstChild;
132
- const invalidLabels = container.querySelectorAll(".mobius\\/RadioLabel.--is-invalid");
133
- expect(radio).toHaveClass("--is-invalid");
134
- expect(radioIcon).toHaveClass("--is-invalid");
135
- expect(invalidLabels.length).toEqual(2);
136
- });
137
- });
138
- });
139
- //# sourceMappingURL=Radio.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Radio.test.js","sourceRoot":"","sources":["../../../../src/components/Radio/Radio.test.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,SAAS,MAAM,6BAA6B,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,GAAG,CAAC;AAEtC,QAAQ,CAAC,OAAO,EAAE,GAAG,EAAE;IACrB,EAAE,CAAC,6BAA6B,EAAE,GAAG,EAAE;QACrC,MAAM,SAAS,GAAG,MAAM,CACtB,MAAC,UAAU,kBAAC,KAAK,EAAC,OAAO,iBACvB,KAAC,KAAK,kBAAC,KAAK,EAAC,KAAK,yBAAY,EAC9B,KAAC,KAAK,kBAAC,KAAK,EAAC,MAAM,0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sxs } from "react/jsx-runtime";
2
- import { RadioButton } from "./RadioButton";
3
- import { RadioGroup } from "./RadioGroup";
4
- import { Icon } from "../Icon";
5
- import { excludeControls } from "../../utils/excludeControls";
6
- export default {
7
- title: "Forms/RadioButton",
8
- component: RadioButton,
9
- argTypes: Object.assign({ orientation: {
10
- control: { type: "radio" },
11
- options: ["horizontal", "vertical"],
12
- } }, excludeControls("className", "children")),
13
- };
14
- export const Normal = {
15
- render: (args) => (_jsxs(RadioGroup, Object.assign({}, args, { children: [_jsx(RadioButton, Object.assign({ value: "red" }, { children: "Red" })), _jsx(RadioButton, Object.assign({ value: "blue" }, { children: "Blue" }))] }))),
16
- args: {
17
- label: "Color",
18
- orientation: "horizontal",
19
- isDisabled: false,
20
- defaultValue: "blue",
21
- },
22
- };
23
- export const ControlledValue = {
24
- render: (args) => (_jsxs(RadioGroup, Object.assign({}, args, { children: [_jsx(RadioButton, Object.assign({ value: "red" }, { children: "Red" })), _jsx(RadioButton, Object.assign({ value: "blue" }, { children: "Blue" }))] }))),
25
- args: {
26
- label: "Color",
27
- orientation: "horizontal",
28
- isDisabled: false,
29
- value: "blue",
30
- },
31
- };
32
- export const LabelProp = {
33
- render: (args) => (_jsxs(RadioGroup, Object.assign({}, args, { children: [_jsx(RadioButton, { value: "red", label: "Red" }), _jsx(RadioButton, { value: "blue", label: "Blue" })] }))),
34
- args: {
35
- label: "Color",
36
- orientation: "horizontal",
37
- isDisabled: false,
38
- },
39
- };
40
- export const Selected = {
41
- render: (args) => (_jsxs(RadioGroup, Object.assign({}, args, { children: [_jsx(RadioButton, { value: "red", label: "Red" }), _jsx(RadioButton, { value: "blue", label: "Blue" })] }))),
42
- args: {
43
- label: "Color",
44
- defaultValue: "red",
45
- orientation: "horizontal",
46
- isDisabled: false,
47
- },
48
- argTypes: {
49
- value: {
50
- control: { type: "radio" },
51
- options: ["red", "blue"],
52
- },
53
- },
54
- };
55
- export const Disabled = {
56
- render: (args) => (_jsxs(RadioGroup, Object.assign({}, args, { children: [_jsx(RadioButton, { value: "red", label: "Red" }), _jsx(RadioButton, { value: "blue", label: "Blue" })] }))),
57
- args: {
58
- label: "Color",
59
- orientation: "horizontal",
60
- isDisabled: true,
61
- },
62
- };
63
- export const VerticalOrientation = {
64
- render: (args) => (_jsxs(RadioGroup, Object.assign({}, args, { children: [_jsx(RadioButton, { value: "red", label: "Red" }), _jsx(RadioButton, { value: "blue", label: "Blue" })] }))),
65
- args: {
66
- label: "Color",
67
- orientation: "vertical",
68
- isDisabled: false,
69
- },
70
- };
71
- export const IconButtons = {
72
- render: (args) => (_jsxs(RadioGroup, Object.assign({}, args, { children: [_jsx(RadioButton, Object.assign({ value: "sole_trader", label: "Sole Trader" }, { children: _jsx(Icon, { name: "user", fontSize: "28px" }) })), _jsx(RadioButton, Object.assign({ value: "partnership", label: "Partnership" }, { children: _jsx(Icon, { name: "star", fontSize: "28px" }) })), _jsx(RadioButton, Object.assign({ value: "company", label: "Ltd Company" }, { children: _jsx(Icon, { name: "menu", fontSize: "28px" }) }))] }))),
73
- args: {
74
- label: "Business Type",
75
- orientation: "horizontal",
76
- isDisabled: false,
77
- },
78
- };
79
- export const CircularButtons = {
80
- render: (args) => (_jsxs(RadioGroup, Object.assign({}, args, { children: [_jsx(RadioButton, Object.assign({ value: "sole_trader", label: "Sole Trader" }, { children: _jsx(Icon, { name: "user", fontSize: "28px" }) })), _jsx(RadioButton, Object.assign({ value: "partnership", label: "Partnership" }, { children: _jsx(Icon, { name: "star", fontSize: "28px" }) })), _jsx(RadioButton, Object.assign({ value: "company", label: "Ltd Company" }, { children: _jsx(Icon, { name: "menu", fontSize: "28px" }) }))] }))),
81
- args: {
82
- label: "Business Type",
83
- orientation: "horizontal",
84
- circular: true,
85
- isDisabled: false,
86
- },
87
- };
88
- //# sourceMappingURL=RadioButton.stories.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RadioButton.stories.js","sourceRoot":"","sources":["../../../../src/components/Radio/RadioButton.stories.tsx"],"names":[],"mapp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K,EAAC,aAAa,EAAC,KAAK,EAAC,aAAa,gBAClD,KAAC,IAAI,IAAC,IAAI,EAAC,MAAM,EAAC,QAAQ,EAAC,MAAM,GAAG,IACxB,EACd,KAAC,WAAW,kBAAC,KAAK,EAAC,aAAa,EAAC,KAAK,EAAC,aAAa,gBAClD,KAAC,IAAI,IAAC,IAAI,EAAC,MAAM,EAAC,QAAQ,EAAC,MAAM,GAAG,IACxB,EACd,KAAC,WAAW,kBAAC,KAAK,EAAC,SAAS,EAAC,KAAK,EAAC,aAAa,gBAC9C,KAAC,IAAI,IAAC,IAAI,EAAC,MAAM,EAAC,QAAQ,EAAC,MAAM,GAAG,IACxB,KACH,CACd;IACD,IAAI,EAAE;QACJ,KAAK,EAAE,eAAe;QACtB,WAAW,EAAE,YAAY;QACzB,QAAQ,EAAE,IAAI;QACd,UAAU,EAAE,KAAK;KAClB;CACF,CAAC"}
@@ -1,118 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { render, fireEvent, screen } from "@testing-library/react";
3
- import userEvent from "@testing-library/user-event";
4
- import { RadioGroup, RadioButton } from ".";
5
- import { Icon } from "..";
6
- describe("RadioButton", () => {
7
- it("should render without error", () => {
8
- const component = render(_jsxs(RadioGroup, Object.assign({ label: "Color" }, { children: [_jsx(RadioButton, Object.assign({ value: "red" }, { children: "Red" })), _jsx(RadioButton, Object.assign({ value: "blue" }, { children: "Blue" }))] })));
9
- expect(component).toBeTruthy();
10
- });
11
- it("should call onChange with the selected value when clicked", async () => {
12
- const callback = jest.fn();
13
- const { getByLabelText } = render(_jsxs(RadioGroup, Object.assign({ label: "Color", onChange: callback }, { children: [_jsx(RadioButton, Object.assign({ value: "red" }, { children: "Red" })), _jsx(RadioButton, Object.assign({ value: "blue" }, { children: "Blue" }))] })));
14
- await userEvent.click(getByLabelText("Red"));
15
- expect(callback).toHaveBeenCalledWith("red");
16
- await userEvent.click(getByLabelText("Blue"));
17
- expect(callback).toHaveBeenCalledWith("blue");
18
- });
19
- it("should be selectable via keyboard", async () => {
20
- const callback = jest.fn();
21
- render(_jsxs(RadioGroup, Object.assign({ label: "Color", onChange: callback }, { children: [_jsx(RadioButton, Object.assign({ value: "red" }, { children: "Red" })), _jsx(RadioButton, Object.assign({ value: "blue" }, { children: "Blue" }))] })));
22
- await userEvent.tab();
23
- await userEvent.type(document.activeElement, "[Space]");
24
- expect(callback).toHaveBeenCalledWith("red");
25
- fireEvent.keyDown(document.activeElement, {
26
- key: "ArrowDown",
27
- code: "ArrowDown",
28
- });
29
- expect(callback).toHaveBeenCalledWith("blue");
30
- });
31
- describe("correctly assigns icon and label props or children", () => {
32
- it("renders a simple label prop", () => {
33
- render(_jsxs(RadioGroup, Object.assign({ label: "Color", "data-testid": "test" }, { children: [_jsx(RadioButton, { value: "red", label: "Red" }), _jsx(RadioButton, { value: "blue", label: "Blue" })] })));
34
- expect(screen.getByText("Red")).toHaveClass("mobius/RadioButtonContent");
35
- });
36
- it("renders a text child as simple label", () => {
37
- render(_jsxs(RadioGroup, Object.assign({ label: "Color", "data-testid": "test" }, { children: [_jsx(RadioButton, Object.assign({ value: "red" }, { children: "Red" })), _jsx(RadioButton, Object.assign({ value: "blue" }, { children: "Blue" }))] })));
38
- expect(screen.getByText("Red")).toHaveClass("mobius/RadioButtonContent");
39
- });
40
- it("renders children in <span> tags when there is an icon", () => {
41
- var _a;
42
- render(_jsxs(RadioGroup, Object.assign({ label: "Color", "data-testid": "test" }, { children: [_jsx(RadioButton, Object.assign({ value: "sole_trader", label: "Sole Trader" }, { children: _jsx(Icon, { name: "user" }) })), _jsx(RadioButton, Object.assign({ value: "partnership", label: "Partnership" }, { children: _jsx(Icon, { name: "star" }) })), _jsx(RadioButton, Object.assign({ value: "company", label: "Ltd Company" }, { children: _jsx(Icon, { name: "menu" }) }))] })));
43
- expect(screen.getByText("Sole Trader")).toHaveClass("mobius/RadioButtonText");
44
- expect((_a = screen.getByText("Sole Trader").parentElement) === null || _a === void 0 ? void 0 : _a.firstChild).toHaveClass("mobius/RadioButtonIcon");
45
- });
46
- });
47
- describe("isRequired", () => {
48
- it("should set aria-required to true", () => {
49
- render(_jsxs(RadioGroup, Object.assign({ label: "Color", isRequired: true }, { children: [_jsx(RadioButton, Object.assign({ value: "red" }, { children: "Red" })), null] })));
50
- expect(screen.getByLabelText("Color")).toHaveAttribute("aria-required", "true");
51
- });
52
- it("should have className of --is-required when true", () => {
53
- render(_jsxs(RadioGroup, Object.assign({ label: "Color", isRequired: true }, { children: [_jsx(RadioButton, Object.assign({ value: "red" }, { children: "Red" })), null] })));
54
- expect(screen.getByLabelText("Color")).toHaveClass("--is-required");
55
- });
56
- it("should have className of --is-optional when false", () => {
57
- render(_jsxs(RadioGroup, Object.assign({ label: "Color", isRequired: false }, { children: [_jsx(RadioButton, Object.assign({ value: "red" }, { children: "Red" })), null] })));
58
- expect(screen.getByLabelText("Color")).toHaveClass("--is-optional");
59
- });
60
- it("should have neither --is-required nor --is-optional when unset", () => {
61
- render(_jsxs(RadioGroup, Object.assign({ label: "Color" }, { children: [_jsx(RadioButton, Object.assign({ value: "red" }, { children: "Red" })), null] })));
62
- expect(screen.getByLabelText("Color")).not.toHaveClass("--is-required");
63
- expect(screen.getByLabelText("Color")).not.toHaveClass("--is-optional");
64
- });
65
- });
66
- describe("uses correct class names for atoms", () => {
67
- it("uses base Mobius class", () => {
68
- var _a;
69
- render(_jsxs(RadioGroup, Object.assign({ label: "Color", "data-testid": "test" }, { children: [_jsx(RadioButton, Object.assign({ value: "red" }, { children: "Red" })), _jsx(RadioButton, Object.assign({ value: "blue" }, { children: "Blue" }))] })));
70
- expect(screen.getByTestId("test")).toHaveClass("mobius/RadioGroup");
71
- expect(screen.getByTestId("test").firstChild).toHaveClass("mobius/Label");
72
- const wrapper = screen.getByTestId("test").childNodes[1];
73
- expect(wrapper).toHaveClass("mobius/RadioWrapper");
74
- expect(wrapper.firstChild).toHaveClass("mobius/RadioButtonLabel");
75
- expect((_a = wrapper.firstChild) === null || _a === void 0 ? void 0 : _a.firstChild).toHaveClass("mobius/RadioInput");
76
- });
77
- it("includes custom class names", () => {
78
- render(_jsxs(RadioGroup, Object.assign({ label: "Color", className: "my-class", "data-testid": "test" }, { children: [_jsx(RadioButton, Object.assign({ value: "red", className: "red" }, { children: "Red" })), _jsx(RadioButton, Object.assign({ value: "blue", className: "blue" }, { children: "Blue" }))] })));
79
- expect(screen.getByTestId("test")).toHaveClass("mobius/RadioGroup");
80
- expect(screen.getByTestId("test")).toHaveClass("my-class");
81
- const wrapper = screen.getByTestId("test").childNodes[1];
82
- expect(wrapper).toHaveClass("mobius/RadioWrapper");
83
- expect(wrapper.firstChild).toHaveClass("mobius/RadioButtonLabel");
84
- expect(wrapper.firstChild).toHaveClass("red");
85
- expect(wrapper.childNodes[1]).toHaveClass("blue");
86
- });
87
- it("sets classes for interaction states", async () => {
88
- var _a, _b;
89
- const callback = jest.fn();
90
- const { container } = render(_jsxs(RadioGroup, Object.assign({ "data-testid": "test", label: "Color", onChange: callback }, { children: [_jsx(RadioButton, Object.assign({ value: "red" }, { children: "Red" })), _jsx(RadioButton, Object.assign({ value: "blue" }, { children: "Blue" }))] })));
91
- // Hover over radio
92
- fireEvent.mouseEnter(container.querySelector("input"));
93
- const radio = (_a = screen.getByTestId("test").childNodes[1]) === null || _a === void 0 ? void 0 : _a.firstChild;
94
- expect(radio).toHaveClass("--is-hovered");
95
- await userEvent.tab();
96
- await userEvent.type(document.activeElement, "[Space]");
97
- expect(radio).toHaveClass("--is-selected");
98
- fireEvent.keyDown(document.activeElement, {
99
- key: "ArrowDown",
100
- code: "ArrowDown",
101
- });
102
- expect((_b = screen.getByTestId("test").childNodes[1]) === null || _b === void 0 ? void 0 : _b.childNodes[1]).toHaveClass("--is-selected");
103
- });
104
- it("sets classes for disabled state", () => {
105
- var _a, _b;
106
- render(_jsxs(RadioGroup, Object.assign({ "data-testid": "test", label: "Color", isDisabled: true }, { children: [_jsx(RadioButton, Object.assign({ value: "red" }, { children: "Red" })), _jsx(RadioButton, Object.assign({ value: "blue" }, { children: "Blue" }))] })));
107
- expect(screen.getByTestId("test")).toHaveClass("--is-disabled");
108
- expect((_a = screen.getByTestId("test").childNodes[1]) === null || _a === void 0 ? void 0 : _a.firstChild).toHaveClass("--is-disabled");
109
- expect((_b = screen.getByTestId("test").childNodes[1]) === null || _b === void 0 ? void 0 : _b.childNodes[1]).toHaveClass("--is-disabled");
110
- });
111
- it("sets class for circular state", () => {
112
- var _a;
113
- render(_jsxs(RadioGroup, Object.assign({ "data-testid": "test", label: "Color", circular: true }, { children: [_jsx(RadioButton, Object.assign({ value: "red" }, { children: "Red" })), _jsx(RadioButton, Object.assign({ value: "blue" }, { children: "Blue" }))] })));
114
- expect((_a = screen.getByTestId("test").childNodes[1]) === null || _a === void 0 ? void 0 : _a.firstChild).toHaveClass("circular");
115
- });
116
- });
117
- });
118
- //# sourceMappingURL=RadioButton.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RadioButton.test.js","sourceRoot":"","sources":["../../../../src/components/Radio/RadioButton.test.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,SAAS,MAAM,6BAA6B,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,GAAG,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;AAE1B,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;IAC3B,EAAE,CAAC,6BAA6B,EAAE,GAAG,EAAE;QACrC,MAAM,SAAS,GAAG,MAAM,CACtB,MAAC,UAAU,kBAAC,KAAK,EAAC,OAAO,iBACvB,KAAC,WAAW,kBAAC,KAAK,EAAC,KAAK,yBAAkB,EAC1C,KAAC,WAAW,kBAAC,KAAK,EAAC,MAAM,0BAAmB,KACjC,CACd,CAAC;QACF,MAAM,CAAC,SAAS,CAAC,CAAC,UAAU,EAA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iCAAiC,EAAE,GAAG,EAAE;;YACzC,MAAM,CACJ,MAAC,UAAU,iCAAa,MAAM,EAAC,KAAK,EAAC,OAAO,EAAC,UAAU,uBACrD,KAAC,WAAW,kBAAC,KAAK,EAAC,KAAK,yBAAkB,EAC1C,KAAC,WAAW,kBAAC,KAAK,EAAC,MAAM,0BAAmB,KACjC,CACd,CAAC;YACF,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC;YAChE,MAAM,CAAC,MAAA,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,0CAAE,UAAU,CAAC,CAAC,WAAW,CACtE,eAAe,CAChB,CAAC;YACF,MAAM,CACJ,MAAA,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,0CAAE,UAAU,CAAC,CAAC,CAAC,CACxD,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC;QACjC,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,+BAA+B,EAAE,GAAG,EAAE;;YACvC,MAAM,CACJ,MAAC,UAAU,iCAAa,MAAM,EAAC,KAAK,EAAC,OAAO,EAAC,QAAQ,uBACnD,KAAC,WAAW,kBAAC,KAAK,EAAC,KAAK,yBAAkB,EAC1C,KAAC,WAAW,kBAAC,KAAK,EAAC,MAAM,0BAAmB,KACjC,CACd,CAAC;YACF,MAAM,CAAC,MAAA,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,0CAAE,UAAU,CAAC,CAAC,WAAW,CACtE,UAAU,CACX,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,19 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { SVG } from "./SVG";
3
- import { excludeControls } from "../../utils/excludeControls";
4
- const Star = (_jsx("svg", Object.assign({ viewBox: "0 0 51 48" }, { children: _jsx("path", { fill: "none", stroke: "#000", d: "m25,1 6,17h18l-14,11 5,17-15-10-15,10 5-17-14-11h18z" }) })));
5
- export default {
6
- title: "Components/SVG",
7
- component: SVG,
8
- argTypes: excludeControls("className"),
9
- };
10
- export const Normal = {
11
- render: (args) => _jsx(SVG, Object.assign({}, args, { children: Star })),
12
- args: {
13
- style: {
14
- width: 75,
15
- height: 75,
16
- },
17
- },
18
- };
19
- //# sourceMappingURL=SVG.stories.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SVG.stories.js","sourceRoot":"","sources":["../../../../src/components/SVG/SVG.stories.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAY,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE9D,MAAM,IAAI,GAAG,CACX,4BAAK,OAAO,EAAC,WAAW,gBACtB,eACE,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,MAAM,EACb,CAAC,EAAC,sDAAsD,GACxD,IACE,CACP,CAAC;AAEF,eAAe;IACb,KAAK,EAAE,gBAAgB;IACvB,SAAS,EAAE,GAAG;IACd,QAAQ,EAAE,eAAe,CAAC,WAAW,CAAC;CACvC,CAAC;AAEF,MAAM,CAAC,MAAM,MAAM,GAAqB;IACtC,MAAM,EAAE,CAAC,IAAc,EAAE,EAAE,CAAC,KAAC,GAAG,oBAAK,IAAI,cAAG,IAAI,IAAO;IACvD,IAAI,EAAE;QACJ,KAAK,EAAE;YACL,KAAK,EAAE,EAAE;YACT,MAAM,EAAE,EAAE;SACX;KACF;CACF,CAAC"}
@@ -1,26 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { render, screen } from "@testing-library/react";
3
- import { SVG } from ".";
4
- const CLASS_NAME = "mobius/SVG";
5
- const SvgImage = (_jsx("svg", Object.assign({ xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 299.8 85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1-1.3 1.2-2.4.7-1-.4-2.4-1.1-4.2-1.1-1.9 0-3 .8-3 2.2 0 3.6 10.9 2.2 10.9 9.7 0 3.9-3.3 6.8-8.4 6.8-3.5 0-6-1.3-7.4-2.2-.8-.7-.9-1.6-.3-2.6z" }) })));
6
- describe("Test for SVG", () => {
7
- it("should render without errors", () => {
8
- render(_jsx(SVG, { children: SvgImage }));
9
- });
10
- describe("uses correct class names", () => {
11
- it("uses Mobius class", () => {
12
- render(_jsx(SVG, Object.assign({ "data-testid": "test" }, { children: SvgImage })));
13
- expect(screen.getByTestId("test")).toHaveClass("mobius");
14
- });
15
- it("uses base Mobius class", () => {
16
- render(_jsx(SVG, Object.assign({ "data-testid": "test" }, { children: SvgImage })));
17
- expect(screen.getByTestId("test")).toHaveClass(CLASS_NAME);
18
- });
19
- it("includes custom class name", () => {
20
- render(_jsx(SVG, Object.assign({ "data-testid": "test", className: "my-class" }, { children: SvgImage })));
21
- expect(screen.getByTestId("test")).toHaveClass("my-class");
22
- expect(screen.getByTestId("test")).toHaveClass(CLASS_NAME);
23
- });
24
- });
25
- });
26
- //# sourceMappingURL=SVG.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SVG.test.js","sourceRoot":"","sources":["../../../../src/components/SVG/SVG.test.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,GAAG,EAAE,MAAM,GAAG,CAAC;AAExB,MAAM,UAAU,GAAG,YAAY,CAAC;AAEhC,MAAM,QAAQ,GAAG,CACf,4BAAK,KAAK,EAAC,4BAA4B,EAAC,OAAO,EAAC,cAAc,gBAC5D,eAAM,CAAC,EAAC,kwKAAkwK,GAAG,IACzwK,CACP,CAAC;AAEF,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE;IAC5B,EAAE,CAAC,8BAA8B,EAAE,GAAG,EAAE;QACtC,MAAM,CAAC,KAAC,GAAG,cAAE,QAAQ,G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