@simplybusiness/mobius 4.16.0 → 5.0.0

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 (439) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/dist/cjs/components/Accordion/Accordion.js +8 -8
  3. package/dist/cjs/components/Accordion/Accordion.js.map +1 -1
  4. package/dist/cjs/components/Alert/Alert.js +4 -4
  5. package/dist/cjs/components/Alert/Alert.js.map +1 -1
  6. package/dist/cjs/components/Box/Box.js +1 -1
  7. package/dist/cjs/components/Box/Box.js.map +1 -1
  8. package/dist/cjs/components/Breadcrumbs/BreadcrumbItem.js +2 -2
  9. package/dist/cjs/components/Breadcrumbs/BreadcrumbItem.js.map +1 -1
  10. package/dist/cjs/components/Breadcrumbs/Breadcrumbs.js +1 -1
  11. package/dist/cjs/components/Breadcrumbs/Breadcrumbs.js.map +1 -1
  12. package/dist/cjs/components/Button/Button.js +4 -2
  13. package/dist/cjs/components/Button/Button.js.map +1 -1
  14. package/dist/cjs/components/Button/Loading.js +12 -6
  15. package/dist/cjs/components/Button/Loading.js.map +1 -1
  16. package/dist/cjs/components/Button/Success.js +4 -3
  17. package/dist/cjs/components/Button/Success.js.map +1 -1
  18. package/dist/cjs/components/Checkbox/Checkbox.js +10 -6
  19. package/dist/cjs/components/Checkbox/Checkbox.js.map +1 -1
  20. package/dist/cjs/components/Checkbox/CheckboxGroup.js +2 -2
  21. package/dist/cjs/components/Checkbox/CheckboxGroup.js.map +1 -1
  22. package/dist/cjs/components/Container/Container.js +1 -1
  23. package/dist/cjs/components/Container/Container.js.map +1 -1
  24. package/dist/cjs/components/Divider/Divider.js +2 -2
  25. package/dist/cjs/components/Divider/Divider.js.map +1 -1
  26. package/dist/cjs/components/Drawer/Content.js +1 -1
  27. package/dist/cjs/components/Drawer/Content.js.map +1 -1
  28. package/dist/cjs/components/Drawer/Drawer.js +1 -1
  29. package/dist/cjs/components/Drawer/Drawer.js.map +1 -1
  30. package/dist/cjs/components/Drawer/Header.js +2 -2
  31. package/dist/cjs/components/Drawer/Header.js.map +1 -1
  32. package/dist/cjs/components/DropdownMenu/DropdownMenu.js +3 -3
  33. package/dist/cjs/components/DropdownMenu/DropdownMenu.js.map +1 -1
  34. package/dist/cjs/components/DropdownMenu/Item.js +1 -1
  35. package/dist/cjs/components/DropdownMenu/Item.js.map +1 -1
  36. package/dist/cjs/components/ErrorMessage/ErrorMessage.js +7 -4
  37. package/dist/cjs/components/ErrorMessage/ErrorMessage.js.map +1 -1
  38. package/dist/cjs/components/Fieldset/Fieldset.js +2 -2
  39. package/dist/cjs/components/Fieldset/Fieldset.js.map +1 -1
  40. package/dist/cjs/components/Flex/Flex.js +1 -1
  41. package/dist/cjs/components/Flex/Flex.js.map +1 -1
  42. package/dist/cjs/components/Grid/Grid.js +1 -1
  43. package/dist/cjs/components/Grid/Grid.js.map +1 -1
  44. package/dist/cjs/components/Grid/Item.js +1 -1
  45. package/dist/cjs/components/Grid/Item.js.map +1 -1
  46. package/dist/cjs/components/Icon/Icon.js +1 -1
  47. package/dist/cjs/components/Icon/Icon.js.map +1 -1
  48. package/dist/cjs/components/Image/Image.js +1 -1
  49. package/dist/cjs/components/Image/Image.js.map +1 -1
  50. package/dist/cjs/components/Label/Label.js +1 -1
  51. package/dist/cjs/components/Label/Label.js.map +1 -1
  52. package/dist/cjs/components/Link/Link.js +1 -1
  53. package/dist/cjs/components/Link/Link.js.map +1 -1
  54. package/dist/cjs/components/LinkButton/LinkButton.js +1 -1
  55. package/dist/cjs/components/LinkButton/LinkButton.js.map +1 -1
  56. package/dist/cjs/components/List/List.js +1 -1
  57. package/dist/cjs/components/List/List.js.map +1 -1
  58. package/dist/cjs/components/List/ListItem.js +3 -3
  59. package/dist/cjs/components/List/ListItem.js.map +1 -1
  60. package/dist/cjs/components/LoadingIndicator/LoadingIndicator.js +1 -1
  61. package/dist/cjs/components/LoadingIndicator/LoadingIndicator.js.map +1 -1
  62. package/dist/cjs/components/Logo/Logo.js +1 -1
  63. package/dist/cjs/components/Logo/Logo.js.map +1 -1
  64. package/dist/cjs/components/Modal/Content.js +1 -1
  65. package/dist/cjs/components/Modal/Content.js.map +1 -1
  66. package/dist/cjs/components/Modal/Header.js +2 -2
  67. package/dist/cjs/components/Modal/Header.js.map +1 -1
  68. package/dist/cjs/components/Modal/Modal.js +1 -1
  69. package/dist/cjs/components/Modal/Modal.js.map +1 -1
  70. package/dist/cjs/components/NumberField/NumberField.js +7 -5
  71. package/dist/cjs/components/NumberField/NumberField.js.map +1 -1
  72. package/dist/cjs/components/PasswordField/PasswordField.js +1 -1
  73. package/dist/cjs/components/PasswordField/PasswordField.js.map +1 -1
  74. package/dist/cjs/components/PasswordField/ShowHideButton.js +1 -1
  75. package/dist/cjs/components/PasswordField/ShowHideButton.js.map +1 -1
  76. package/dist/cjs/components/Popover/Popover.js +8 -8
  77. package/dist/cjs/components/Popover/Popover.js.map +1 -1
  78. package/dist/cjs/components/Progress/Progress.js +5 -5
  79. package/dist/cjs/components/Progress/Progress.js.map +1 -1
  80. package/dist/cjs/components/Radio/Radio.js +6 -6
  81. package/dist/cjs/components/Radio/Radio.js.map +1 -1
  82. package/dist/cjs/components/Radio/RadioGroup.js +36 -32
  83. package/dist/cjs/components/Radio/RadioGroup.js.map +1 -1
  84. package/dist/cjs/components/SVG/SVG.js +1 -1
  85. package/dist/cjs/components/SVG/SVG.js.map +1 -1
  86. package/dist/cjs/components/Segment/Segment.js +2 -2
  87. package/dist/cjs/components/Segment/Segment.js.map +1 -1
  88. package/dist/cjs/components/Segment/SegmentGroup.js +5 -5
  89. package/dist/cjs/components/Segment/SegmentGroup.js.map +1 -1
  90. package/dist/cjs/components/Select/Select.js +8 -8
  91. package/dist/cjs/components/Select/Select.js.map +1 -1
  92. package/dist/cjs/components/Slider/Slider.js +7 -7
  93. package/dist/cjs/components/Slider/Slider.js.map +1 -1
  94. package/dist/cjs/components/Stack/Stack.js +72 -0
  95. package/dist/cjs/components/Stack/Stack.js.map +1 -0
  96. package/dist/cjs/components/Stack/index.js +20 -0
  97. package/dist/cjs/components/Stack/index.js.map +1 -0
  98. package/dist/cjs/components/Table/Body.js +1 -1
  99. package/dist/cjs/components/Table/Body.js.map +1 -1
  100. package/dist/cjs/components/Table/Cell.js +1 -1
  101. package/dist/cjs/components/Table/Cell.js.map +1 -1
  102. package/dist/cjs/components/Table/Foot.js +1 -1
  103. package/dist/cjs/components/Table/Foot.js.map +1 -1
  104. package/dist/cjs/components/Table/Head.js +1 -1
  105. package/dist/cjs/components/Table/Head.js.map +1 -1
  106. package/dist/cjs/components/Table/HeaderCell.js +1 -1
  107. package/dist/cjs/components/Table/HeaderCell.js.map +1 -1
  108. package/dist/cjs/components/Table/Row.js +1 -1
  109. package/dist/cjs/components/Table/Row.js.map +1 -1
  110. package/dist/cjs/components/Table/Table.js +1 -1
  111. package/dist/cjs/components/Table/Table.js.map +1 -1
  112. package/dist/cjs/components/Text/Text.js +5 -2
  113. package/dist/cjs/components/Text/Text.js.map +1 -1
  114. package/dist/cjs/components/TextArea/TextArea.js +5 -5
  115. package/dist/cjs/components/TextArea/TextArea.js.map +1 -1
  116. package/dist/cjs/components/TextAreaInput/TextAreaInput.js +1 -1
  117. package/dist/cjs/components/TextAreaInput/TextAreaInput.js.map +1 -1
  118. package/dist/cjs/components/TextField/TextField.js +12 -10
  119. package/dist/cjs/components/TextField/TextField.js.map +1 -1
  120. package/dist/cjs/components/Title/Title.js +4 -4
  121. package/dist/cjs/components/Title/Title.js.map +1 -1
  122. package/dist/cjs/components/Trust/Trust.js +4 -5
  123. package/dist/cjs/components/Trust/Trust.js.map +1 -1
  124. package/dist/cjs/components/Trust/constants.js +3 -3
  125. package/dist/cjs/components/Trust/constants.js.map +1 -1
  126. package/dist/cjs/components/index.js +1 -0
  127. package/dist/cjs/components/index.js.map +1 -1
  128. package/dist/cjs/tsconfig.tsbuildinfo +1 -0
  129. package/dist/esm/components/Accordion/Accordion.js +8 -8
  130. package/dist/esm/components/Accordion/Accordion.js.map +1 -1
  131. package/dist/esm/components/Alert/Alert.js +4 -4
  132. package/dist/esm/components/Alert/Alert.js.map +1 -1
  133. package/dist/esm/components/Box/Box.js +1 -1
  134. package/dist/esm/components/Box/Box.js.map +1 -1
  135. package/dist/esm/components/Breadcrumbs/BreadcrumbItem.js +2 -2
  136. package/dist/esm/components/Breadcrumbs/BreadcrumbItem.js.map +1 -1
  137. package/dist/esm/components/Breadcrumbs/Breadcrumbs.js +1 -1
  138. package/dist/esm/components/Breadcrumbs/Breadcrumbs.js.map +1 -1
  139. package/dist/esm/components/Button/Button.js +4 -2
  140. package/dist/esm/components/Button/Button.js.map +1 -1
  141. package/dist/esm/components/Button/Loading.js +12 -6
  142. package/dist/esm/components/Button/Loading.js.map +1 -1
  143. package/dist/esm/components/Button/Success.js +4 -3
  144. package/dist/esm/components/Button/Success.js.map +1 -1
  145. package/dist/esm/components/Checkbox/Checkbox.js +11 -7
  146. package/dist/esm/components/Checkbox/Checkbox.js.map +1 -1
  147. package/dist/esm/components/Checkbox/CheckboxGroup.js +2 -2
  148. package/dist/esm/components/Checkbox/CheckboxGroup.js.map +1 -1
  149. package/dist/esm/components/Container/Container.js +1 -1
  150. package/dist/esm/components/Container/Container.js.map +1 -1
  151. package/dist/esm/components/Divider/Divider.js +2 -2
  152. package/dist/esm/components/Divider/Divider.js.map +1 -1
  153. package/dist/esm/components/Drawer/Content.js +1 -1
  154. package/dist/esm/components/Drawer/Content.js.map +1 -1
  155. package/dist/esm/components/Drawer/Drawer.js +1 -1
  156. package/dist/esm/components/Drawer/Drawer.js.map +1 -1
  157. package/dist/esm/components/Drawer/Header.js +2 -2
  158. package/dist/esm/components/Drawer/Header.js.map +1 -1
  159. package/dist/esm/components/DropdownMenu/DropdownMenu.js +3 -3
  160. package/dist/esm/components/DropdownMenu/DropdownMenu.js.map +1 -1
  161. package/dist/esm/components/DropdownMenu/Item.js +1 -1
  162. package/dist/esm/components/DropdownMenu/Item.js.map +1 -1
  163. package/dist/esm/components/ErrorMessage/ErrorMessage.js +7 -4
  164. package/dist/esm/components/ErrorMessage/ErrorMessage.js.map +1 -1
  165. package/dist/esm/components/Fieldset/Fieldset.js +2 -2
  166. package/dist/esm/components/Fieldset/Fieldset.js.map +1 -1
  167. package/dist/esm/components/Flex/Flex.js +1 -1
  168. package/dist/esm/components/Flex/Flex.js.map +1 -1
  169. package/dist/esm/components/Grid/Grid.js +1 -1
  170. package/dist/esm/components/Grid/Grid.js.map +1 -1
  171. package/dist/esm/components/Grid/Item.js +1 -1
  172. package/dist/esm/components/Grid/Item.js.map +1 -1
  173. package/dist/esm/components/Icon/Icon.js +1 -1
  174. package/dist/esm/components/Icon/Icon.js.map +1 -1
  175. package/dist/esm/components/Image/Image.js +1 -1
  176. package/dist/esm/components/Image/Image.js.map +1 -1
  177. package/dist/esm/components/Label/Label.js +1 -1
  178. package/dist/esm/components/Label/Label.js.map +1 -1
  179. package/dist/esm/components/Link/Link.js +1 -1
  180. package/dist/esm/components/Link/Link.js.map +1 -1
  181. package/dist/esm/components/LinkButton/LinkButton.js +1 -1
  182. package/dist/esm/components/LinkButton/LinkButton.js.map +1 -1
  183. package/dist/esm/components/List/List.js +1 -1
  184. package/dist/esm/components/List/List.js.map +1 -1
  185. package/dist/esm/components/List/ListItem.js +3 -3
  186. package/dist/esm/components/List/ListItem.js.map +1 -1
  187. package/dist/esm/components/LoadingIndicator/LoadingIndicator.js +1 -1
  188. package/dist/esm/components/LoadingIndicator/LoadingIndicator.js.map +1 -1
  189. package/dist/esm/components/Logo/Logo.js +1 -1
  190. package/dist/esm/components/Logo/Logo.js.map +1 -1
  191. package/dist/esm/components/Modal/Content.js +1 -1
  192. package/dist/esm/components/Modal/Content.js.map +1 -1
  193. package/dist/esm/components/Modal/Header.js +2 -2
  194. package/dist/esm/components/Modal/Header.js.map +1 -1
  195. package/dist/esm/components/Modal/Modal.js +1 -1
  196. package/dist/esm/components/Modal/Modal.js.map +1 -1
  197. package/dist/esm/components/NumberField/NumberField.js +7 -5
  198. package/dist/esm/components/NumberField/NumberField.js.map +1 -1
  199. package/dist/esm/components/PasswordField/PasswordField.js +1 -1
  200. package/dist/esm/components/PasswordField/PasswordField.js.map +1 -1
  201. package/dist/esm/components/PasswordField/ShowHideButton.js +1 -1
  202. package/dist/esm/components/PasswordField/ShowHideButton.js.map +1 -1
  203. package/dist/esm/components/Popover/Popover.js +8 -8
  204. package/dist/esm/components/Popover/Popover.js.map +1 -1
  205. package/dist/esm/components/Progress/Progress.js +5 -5
  206. package/dist/esm/components/Progress/Progress.js.map +1 -1
  207. package/dist/esm/components/Radio/Radio.js +6 -6
  208. package/dist/esm/components/Radio/Radio.js.map +1 -1
  209. package/dist/esm/components/Radio/RadioGroup.js +36 -32
  210. package/dist/esm/components/Radio/RadioGroup.js.map +1 -1
  211. package/dist/esm/components/SVG/SVG.js +1 -1
  212. package/dist/esm/components/SVG/SVG.js.map +1 -1
  213. package/dist/esm/components/Segment/Segment.js +2 -2
  214. package/dist/esm/components/Segment/Segment.js.map +1 -1
  215. package/dist/esm/components/Segment/SegmentGroup.js +5 -5
  216. package/dist/esm/components/Segment/SegmentGroup.js.map +1 -1
  217. package/dist/esm/components/Select/Select.js +8 -8
  218. package/dist/esm/components/Select/Select.js.map +1 -1
  219. package/dist/esm/components/Slider/Slider.js +7 -7
  220. package/dist/esm/components/Slider/Slider.js.map +1 -1
  221. package/dist/esm/components/Stack/Stack.js +16 -0
  222. package/dist/esm/components/Stack/Stack.js.map +1 -0
  223. package/dist/esm/components/Stack/index.js +3 -0
  224. package/dist/esm/components/Stack/index.js.map +1 -0
  225. package/dist/esm/components/Table/Body.js +1 -1
  226. package/dist/esm/components/Table/Body.js.map +1 -1
  227. package/dist/esm/components/Table/Cell.js +1 -1
  228. package/dist/esm/components/Table/Cell.js.map +1 -1
  229. package/dist/esm/components/Table/Foot.js +1 -1
  230. package/dist/esm/components/Table/Foot.js.map +1 -1
  231. package/dist/esm/components/Table/Head.js +1 -1
  232. package/dist/esm/components/Table/Head.js.map +1 -1
  233. package/dist/esm/components/Table/HeaderCell.js +1 -1
  234. package/dist/esm/components/Table/HeaderCell.js.map +1 -1
  235. package/dist/esm/components/Table/Row.js +1 -1
  236. package/dist/esm/components/Table/Row.js.map +1 -1
  237. package/dist/esm/components/Table/Table.js +1 -1
  238. package/dist/esm/components/Table/Table.js.map +1 -1
  239. package/dist/esm/components/Text/Text.js +5 -2
  240. package/dist/esm/components/Text/Text.js.map +1 -1
  241. package/dist/esm/components/TextArea/TextArea.js +5 -5
  242. package/dist/esm/components/TextArea/TextArea.js.map +1 -1
  243. package/dist/esm/components/TextAreaInput/TextAreaInput.js +1 -1
  244. package/dist/esm/components/TextAreaInput/TextAreaInput.js.map +1 -1
  245. package/dist/esm/components/TextField/TextField.js +12 -10
  246. package/dist/esm/components/TextField/TextField.js.map +1 -1
  247. package/dist/esm/components/Title/Title.js +4 -4
  248. package/dist/esm/components/Title/Title.js.map +1 -1
  249. package/dist/esm/components/Trust/Trust.js +4 -5
  250. package/dist/esm/components/Trust/Trust.js.map +1 -1
  251. package/dist/esm/components/Trust/constants.js +3 -3
  252. package/dist/esm/components/Trust/constants.js.map +1 -1
  253. package/dist/esm/components/index.js +1 -0
  254. package/dist/esm/components/index.js.map +1 -1
  255. package/dist/types/components/Button/Button.d.ts +2 -2
  256. package/dist/types/components/Button/Loading.d.ts +5 -1
  257. package/dist/types/components/Segment/Segment.stories.d.ts +2 -2
  258. package/dist/types/components/Segment/SegmentGroup.d.ts +1 -1
  259. package/dist/types/components/Stack/Stack.d.ts +15 -0
  260. package/dist/types/components/Stack/Stack.stories.d.ts +7 -0
  261. package/dist/types/components/Stack/Stack.test.d.ts +1 -0
  262. package/dist/types/components/Stack/index.d.ts +1 -0
  263. package/dist/types/components/index.d.ts +1 -0
  264. package/package.json +3 -2
  265. package/src/components/Accordion/Accordion.css +72 -0
  266. package/src/components/Accordion/Accordion.mdx +9 -10
  267. package/src/components/Accordion/Accordion.test.tsx +4 -4
  268. package/src/components/Accordion/Accordion.tsx +8 -8
  269. package/src/components/Alert/Alert.css +53 -0
  270. package/src/components/Alert/Alert.mdx +1 -5
  271. package/src/components/Alert/Alert.tsx +4 -4
  272. package/src/components/Box/Box.css +3 -0
  273. package/src/components/Box/Box.mdx +1 -5
  274. package/src/components/Box/Box.test.tsx +1 -1
  275. package/src/components/Box/Box.tsx +1 -1
  276. package/src/components/Breadcrumbs/BreadcrumbItem.tsx +2 -2
  277. package/src/components/Breadcrumbs/Breadcrumbs.css +34 -0
  278. package/src/components/Breadcrumbs/Breadcrumbs.mdx +4 -8
  279. package/src/components/Breadcrumbs/Breadcrumbs.test.tsx +2 -2
  280. package/src/components/Breadcrumbs/Breadcrumbs.tsx +1 -1
  281. package/src/components/Button/Button.css +253 -0
  282. package/src/components/Button/Button.mdx +3 -11
  283. package/src/components/Button/Button.story.styles.css +2 -2
  284. package/src/components/Button/Button.test.tsx +4 -6
  285. package/src/components/Button/Button.tsx +4 -4
  286. package/src/components/Button/Loading.tsx +21 -8
  287. package/src/components/Button/Success.tsx +5 -3
  288. package/src/components/Checkbox/Checkbox.css +112 -0
  289. package/src/components/Checkbox/Checkbox.mdx +6 -12
  290. package/src/components/Checkbox/Checkbox.test.tsx +1 -7
  291. package/src/components/Checkbox/Checkbox.tsx +9 -7
  292. package/src/components/Checkbox/CheckboxGroup.css +26 -0
  293. package/src/components/Checkbox/CheckboxGroup.mdx +12 -22
  294. package/src/components/Checkbox/CheckboxGroup.test.tsx +2 -7
  295. package/src/components/Checkbox/CheckboxGroup.tsx +2 -2
  296. package/src/components/Container/Container.css +13 -0
  297. package/src/components/Container/Container.mdx +1 -5
  298. package/src/components/Container/Container.test.tsx +1 -2
  299. package/src/components/Container/Container.tsx +1 -1
  300. package/src/components/Divider/Divider.css +14 -0
  301. package/src/components/Divider/Divider.mdx +2 -6
  302. package/src/components/Divider/Divider.test.tsx +1 -1
  303. package/src/components/Divider/Divider.tsx +2 -2
  304. package/src/components/Drawer/Content.tsx +1 -1
  305. package/src/components/Drawer/Drawer.css +189 -0
  306. package/src/components/Drawer/Drawer.mdx +5 -12
  307. package/src/components/Drawer/Drawer.test.tsx +2 -2
  308. package/src/components/Drawer/Drawer.tsx +1 -1
  309. package/src/components/Drawer/Header.tsx +2 -2
  310. package/src/components/DropdownMenu/DropdownMenu.css +70 -0
  311. package/src/components/DropdownMenu/DropdownMenu.mdx +4 -8
  312. package/src/components/DropdownMenu/DropdownMenu.story.styles.css +3 -3
  313. package/src/components/DropdownMenu/DropdownMenu.test.tsx +4 -4
  314. package/src/components/DropdownMenu/DropdownMenu.tsx +3 -3
  315. package/src/components/DropdownMenu/Item.tsx +1 -1
  316. package/src/components/ErrorMessage/ErrorMessage.css +11 -0
  317. package/src/components/ErrorMessage/ErrorMessage.test.tsx +1 -1
  318. package/src/components/ErrorMessage/ErrorMessage.tsx +5 -3
  319. package/src/components/Fieldset/Fieldset.css +15 -0
  320. package/src/components/Fieldset/Fieldset.mdx +2 -6
  321. package/src/components/Fieldset/Fieldset.tsx +2 -2
  322. package/src/components/Flex/Flex.css +4 -0
  323. package/src/components/Flex/Flex.mdx +1 -5
  324. package/src/components/Flex/Flex.test.tsx +1 -1
  325. package/src/components/Flex/Flex.tsx +1 -1
  326. package/src/components/Grid/Grid.mdx +0 -4
  327. package/src/components/Grid/Grid.tsx +1 -1
  328. package/src/components/Grid/Item.tsx +1 -1
  329. package/src/components/Icon/Icon.css +44 -0
  330. package/src/components/Icon/Icon.mdx +1 -5
  331. package/src/components/Icon/Icon.test.tsx +1 -1
  332. package/src/components/Icon/Icon.tsx +1 -1
  333. package/src/components/Image/Image.mdx +1 -5
  334. package/src/components/Image/Image.test.tsx +1 -1
  335. package/src/components/Image/Image.tsx +1 -1
  336. package/src/components/Label/Label.css +21 -0
  337. package/src/components/Label/Label.mdx +1 -5
  338. package/src/components/Label/Label.test.tsx +1 -1
  339. package/src/components/Label/Label.tsx +1 -1
  340. package/src/components/Link/Link.css +26 -0
  341. package/src/components/Link/Link.mdx +1 -5
  342. package/src/components/Link/Link.test.tsx +1 -1
  343. package/src/components/Link/Link.tsx +1 -1
  344. package/src/components/LinkButton/LinkButton.mdx +1 -5
  345. package/src/components/LinkButton/LinkButton.tsx +1 -1
  346. package/src/components/List/List.css +60 -0
  347. package/src/components/List/List.mdx +4 -8
  348. package/src/components/List/List.test.tsx +4 -4
  349. package/src/components/List/List.tsx +1 -1
  350. package/src/components/List/ListItem.tsx +3 -3
  351. package/src/components/LoadingIndicator/LoadingIndicator.css +3 -0
  352. package/src/components/LoadingIndicator/LoadingIndicator.mdx +1 -5
  353. package/src/components/LoadingIndicator/LoadingIndicator.test.tsx +1 -1
  354. package/src/components/LoadingIndicator/LoadingIndicator.tsx +1 -1
  355. package/src/components/Logo/Logo.mdx +1 -5
  356. package/src/components/Logo/Logo.test.tsx +1 -1
  357. package/src/components/Logo/Logo.tsx +1 -1
  358. package/src/components/Modal/Content.tsx +1 -1
  359. package/src/components/Modal/Header.tsx +2 -2
  360. package/src/components/Modal/Modal.css +145 -0
  361. package/src/components/Modal/Modal.mdx +5 -12
  362. package/src/components/Modal/Modal.test.tsx +2 -2
  363. package/src/components/Modal/Modal.tsx +1 -1
  364. package/src/components/NumberField/NumberField.css +64 -0
  365. package/src/components/NumberField/NumberField.mdx +4 -8
  366. package/src/components/NumberField/NumberField.tsx +7 -6
  367. package/src/components/PasswordField/PasswordField.css +31 -0
  368. package/src/components/PasswordField/PasswordField.mdx +4 -8
  369. package/src/components/PasswordField/PasswordField.tsx +1 -1
  370. package/src/components/PasswordField/ShowHideButton.tsx +1 -1
  371. package/src/components/Popover/Popover.css +43 -0
  372. package/src/components/Popover/Popover.mdx +7 -11
  373. package/src/components/Popover/Popover.story.styles.css +3 -3
  374. package/src/components/Popover/Popover.test.tsx +7 -7
  375. package/src/components/Popover/Popover.tsx +8 -8
  376. package/src/components/Progress/Progress.css +30 -0
  377. package/src/components/Progress/Progress.mdx +5 -11
  378. package/src/components/Progress/Progress.test.tsx +7 -3
  379. package/src/components/Progress/Progress.tsx +5 -5
  380. package/src/components/Radio/Radio.css +185 -0
  381. package/src/components/Radio/Radio.mdx +9 -13
  382. package/src/components/Radio/Radio.test.tsx +10 -5
  383. package/src/components/Radio/Radio.tsx +6 -6
  384. package/src/components/Radio/RadioGroup.tsx +28 -25
  385. package/src/components/SVG/SVG.mdx +1 -5
  386. package/src/components/SVG/SVG.test.tsx +1 -1
  387. package/src/components/SVG/SVG.tsx +1 -1
  388. package/src/components/Segment/Segment.css +204 -0
  389. package/src/components/Segment/Segment.mdx +9 -13
  390. package/src/components/Segment/Segment.stories.tsx +7 -7
  391. package/src/components/Segment/Segment.tsx +2 -2
  392. package/src/components/Segment/SegmentGroup.tsx +6 -6
  393. package/src/components/Select/Select.css +85 -0
  394. package/src/components/Select/Select.mdx +4 -8
  395. package/src/components/Select/Select.test.tsx +2 -2
  396. package/src/components/Select/Select.tsx +7 -7
  397. package/src/components/Slider/Slider.css +138 -0
  398. package/src/components/Slider/Slider.mdx +8 -14
  399. package/src/components/Slider/Slider.test.tsx +4 -1
  400. package/src/components/Slider/Slider.tsx +7 -7
  401. package/src/components/Stack/Stack.css +30 -0
  402. package/src/components/Stack/Stack.mdx +41 -0
  403. package/src/components/Stack/Stack.stories.tsx +56 -0
  404. package/src/components/Stack/Stack.test.tsx +8 -0
  405. package/src/components/Stack/Stack.tsx +34 -0
  406. package/src/components/Stack/index.tsx +1 -0
  407. package/src/components/Table/Body.tsx +1 -1
  408. package/src/components/Table/Cell.tsx +1 -1
  409. package/src/components/Table/Foot.tsx +1 -1
  410. package/src/components/Table/Head.tsx +1 -1
  411. package/src/components/Table/HeaderCell.tsx +1 -1
  412. package/src/components/Table/Row.tsx +1 -1
  413. package/src/components/Table/Table.css +62 -0
  414. package/src/components/Table/Table.mdx +10 -14
  415. package/src/components/Table/Table.test.tsx +28 -15
  416. package/src/components/Table/Table.tsx +1 -1
  417. package/src/components/Text/Text.css +94 -0
  418. package/src/components/Text/Text.mdx +1 -5
  419. package/src/components/Text/Text.test.tsx +1 -1
  420. package/src/components/Text/Text.tsx +3 -4
  421. package/src/components/TextArea/TextArea.css +46 -0
  422. package/src/components/TextArea/TextArea.mdx +4 -8
  423. package/src/components/TextArea/TextArea.test.tsx +1 -1
  424. package/src/components/TextArea/TextArea.tsx +8 -5
  425. package/src/components/TextAreaInput/TextAreaInput.test.tsx +1 -1
  426. package/src/components/TextAreaInput/TextAreaInput.tsx +1 -1
  427. package/src/components/TextField/TextField.css +166 -0
  428. package/src/components/TextField/TextField.mdx +4 -8
  429. package/src/components/TextField/TextField.test.tsx +10 -10
  430. package/src/components/TextField/TextField.tsx +14 -11
  431. package/src/components/Title/Title.css +41 -0
  432. package/src/components/Title/Title.mdx +4 -8
  433. package/src/components/Title/Title.tsx +4 -4
  434. package/src/components/Trust/Trust.mdx +1 -7
  435. package/src/components/Trust/Trust.test.tsx +1 -1
  436. package/src/components/Trust/Trust.tsx +4 -5
  437. package/src/components/Trust/constants.ts +3 -3
  438. package/src/components/VisuallyHidden/VisuallyHidden.mdx +0 -4
  439. package/src/components/index.tsx +1 -0
@@ -5,7 +5,7 @@ import classNames from "classnames/dedupe";
5
5
  import { Box } from "../Box";
6
6
  const BreadcrumbItem = /*#__PURE__*/ forwardRef((props, ref)=>{
7
7
  const { isDisabled = false, isCurrent = false, "aria-current": ariaCurrent = "page", children, separator = /*#__PURE__*/ _jsx(Box, {
8
- className: "mobius/BreadcrumbSeparator",
8
+ className: "mobius-breadcrumb__separator",
9
9
  "aria-hidden": "true",
10
10
  children: ">"
11
11
  }), ...otherProps } = props;
@@ -17,7 +17,7 @@ const BreadcrumbItem = /*#__PURE__*/ forwardRef((props, ref)=>{
17
17
  }
18
18
  };
19
19
  // Reshape class name and apply to outer element
20
- const classes = classNames("mobius", "mobius/BreadcrumbItem", props.className);
20
+ const classes = classNames("mobius", "mobius-breadcrumb__item", props.className);
21
21
  const child = typeof children === "string" ? /*#__PURE__*/ _jsx("span", {
22
22
  ...itemProps,
23
23
  children: children
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/Breadcrumbs/BreadcrumbItem.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n Ref,\n forwardRef,\n ReactNode,\n ReactElement,\n cloneElement,\n Children,\n} from \"react\";\nimport classNames from \"classnames/dedupe\";\nimport { DOMProps } from \"../../types/dom\";\nimport { ForwardedRefComponent } from \"../../types/components\";\nimport { Box } from \"../Box\";\n\nexport type BreadcrumbItemElementType = HTMLLIElement;\n\nexport interface BreadcrumbItemProps extends DOMProps {\n \"aria-current\"?:\n | \"page\"\n | \"step\"\n | \"location\"\n | \"date\"\n | \"time\"\n | boolean\n | \"true\"\n | \"false\";\n isDisabled?: boolean;\n isCurrent?: boolean;\n separator?: ReactNode;\n className?: string;\n children: ReactNode;\n}\n\nexport type BreadcrumbItemRef = Ref<BreadcrumbItemElementType>;\n\nconst BreadcrumbItem: ForwardedRefComponent<\n BreadcrumbItemProps,\n BreadcrumbItemElementType\n> = forwardRef((props: BreadcrumbItemProps, ref: BreadcrumbItemRef) => {\n const {\n isDisabled = false,\n isCurrent = false,\n \"aria-current\": ariaCurrent = \"page\",\n children,\n separator = (\n <Box className=\"mobius/BreadcrumbSeparator\" aria-hidden=\"true\">\n {\">\"}\n </Box>\n ),\n ...otherProps\n } = props;\n const { itemProps } = {\n itemProps: {\n \"aria-current\": isCurrent ? ariaCurrent : undefined,\n \"aria-disabled\": isDisabled || isCurrent,\n ...otherProps,\n },\n };\n\n // Reshape class name and apply to outer element\n const classes = classNames(\n \"mobius\",\n \"mobius/BreadcrumbItem\",\n props.className,\n );\n\n const child =\n typeof children === \"string\" ? (\n <span {...itemProps}>{children}</span>\n ) : (\n (Children.only(children) as ReactElement)\n );\n\n return (\n <li className={classes}>\n {cloneElement(child, { ...child.props, ...itemProps, ref })}\n {!props.isCurrent && separator}\n </li>\n );\n});\n\nBreadcrumbItem.displayName = \"BreadcrumbItem\";\nexport { BreadcrumbItem };\n"],"names":["forwardRef","cloneElement","Children","classNames","Box","BreadcrumbItem","props","ref","isDisabled","isCurrent","ariaCurrent","children","separator","className","aria-hidden","otherProps","itemProps","undefined","classes","child","span","only","li","displayName"],"mappings":"AAAA;;AAEA,SAEEA,UAAU,EAGVC,YAAY,EACZC,QAAQ,QACH,QAAQ;AACf,OAAOC,gBAAgB,oBAAoB;AAG3C,SAASC,GAAG,QAAQ,SAAS;AAuB7B,MAAMC,+BAGFL,WAAW,CAACM,OAA4BC;IAC1C,MAAM,EACJC,aAAa,KAAK,EAClBC,YAAY,KAAK,EACjB,gBAAgBC,cAAc,MAAM,EACpCC,QAAQ,EACRC,0BACE,KAACR;QAAIS,WAAU;QAA6BC,eAAY;kBACrD;MAEJ,EACD,GAAGC,YACJ,GAAGT;IACJ,MAAM,EAAEU,SAAS,EAAE,GAAG;QACpBA,WAAW;YACT,gBAAgBP,YAAYC,cAAcO;YAC1C,iBAAiBT,cAAcC;YAC/B,GAAGM,UAAU;QACf;IACF;IAEA,gDAAgD;IAChD,MAAMG,UAAUf,WACd,UACA,yBACAG,MAAMO,SAAS;IAGjB,MAAMM,QACJ,OAAOR,aAAa,yBAClB,KAACS;QAAM,GAAGJ,SAAS;kBAAGL;SAErBT,SAASmB,IAAI,CAACV;IAGnB,qBACE,MAACW;QAAGT,WAAWK;;0BACZjB,aAAakB,OAAO;gBAAE,GAAGA,MAAMb,KAAK;gBAAE,GAAGU,SAAS;gBAAET;YAAI;YACxD,CAACD,MAAMG,SAAS,IAAIG;;;AAG3B;AAEAP,eAAekB,WAAW,GAAG;AAC7B,SAASlB,cAAc,GAAG"}
1
+ {"version":3,"sources":["../../../../src/components/Breadcrumbs/BreadcrumbItem.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n Ref,\n forwardRef,\n ReactNode,\n ReactElement,\n cloneElement,\n Children,\n} from \"react\";\nimport classNames from \"classnames/dedupe\";\nimport { DOMProps } from \"../../types/dom\";\nimport { ForwardedRefComponent } from \"../../types/components\";\nimport { Box } from \"../Box\";\n\nexport type BreadcrumbItemElementType = HTMLLIElement;\n\nexport interface BreadcrumbItemProps extends DOMProps {\n \"aria-current\"?:\n | \"page\"\n | \"step\"\n | \"location\"\n | \"date\"\n | \"time\"\n | boolean\n | \"true\"\n | \"false\";\n isDisabled?: boolean;\n isCurrent?: boolean;\n separator?: ReactNode;\n className?: string;\n children: ReactNode;\n}\n\nexport type BreadcrumbItemRef = Ref<BreadcrumbItemElementType>;\n\nconst BreadcrumbItem: ForwardedRefComponent<\n BreadcrumbItemProps,\n BreadcrumbItemElementType\n> = forwardRef((props: BreadcrumbItemProps, ref: BreadcrumbItemRef) => {\n const {\n isDisabled = false,\n isCurrent = false,\n \"aria-current\": ariaCurrent = \"page\",\n children,\n separator = (\n <Box className=\"mobius-breadcrumb__separator\" aria-hidden=\"true\">\n {\">\"}\n </Box>\n ),\n ...otherProps\n } = props;\n const { itemProps } = {\n itemProps: {\n \"aria-current\": isCurrent ? ariaCurrent : undefined,\n \"aria-disabled\": isDisabled || isCurrent,\n ...otherProps,\n },\n };\n\n // Reshape class name and apply to outer element\n const classes = classNames(\n \"mobius\",\n \"mobius-breadcrumb__item\",\n props.className,\n );\n\n const child =\n typeof children === \"string\" ? (\n <span {...itemProps}>{children}</span>\n ) : (\n (Children.only(children) as ReactElement)\n );\n\n return (\n <li className={classes}>\n {cloneElement(child, { ...child.props, ...itemProps, ref })}\n {!props.isCurrent && separator}\n </li>\n );\n});\n\nBreadcrumbItem.displayName = \"BreadcrumbItem\";\nexport { BreadcrumbItem };\n"],"names":["forwardRef","cloneElement","Children","classNames","Box","BreadcrumbItem","props","ref","isDisabled","isCurrent","ariaCurrent","children","separator","className","aria-hidden","otherProps","itemProps","undefined","classes","child","span","only","li","displayName"],"mappings":"AAAA;;AAEA,SAEEA,UAAU,EAGVC,YAAY,EACZC,QAAQ,QACH,QAAQ;AACf,OAAOC,gBAAgB,oBAAoB;AAG3C,SAASC,GAAG,QAAQ,SAAS;AAuB7B,MAAMC,+BAGFL,WAAW,CAACM,OAA4BC;IAC1C,MAAM,EACJC,aAAa,KAAK,EAClBC,YAAY,KAAK,EACjB,gBAAgBC,cAAc,MAAM,EACpCC,QAAQ,EACRC,0BACE,KAACR;QAAIS,WAAU;QAA+BC,eAAY;kBACvD;MAEJ,EACD,GAAGC,YACJ,GAAGT;IACJ,MAAM,EAAEU,SAAS,EAAE,GAAG;QACpBA,WAAW;YACT,gBAAgBP,YAAYC,cAAcO;YAC1C,iBAAiBT,cAAcC;YAC/B,GAAGM,UAAU;QACf;IACF;IAEA,gDAAgD;IAChD,MAAMG,UAAUf,WACd,UACA,2BACAG,MAAMO,SAAS;IAGjB,MAAMM,QACJ,OAAOR,aAAa,yBAClB,KAACS;QAAM,GAAGJ,SAAS;kBAAGL;SAErBT,SAASmB,IAAI,CAACV;IAGnB,qBACE,MAACW;QAAGT,WAAWK;;0BACZjB,aAAakB,OAAO;gBAAE,GAAGA,MAAMb,KAAK;gBAAE,GAAGU,SAAS;gBAAET;YAAI;YACxD,CAACD,MAAMG,SAAS,IAAIG;;;AAG3B;AAEAP,eAAekB,WAAW,GAAG;AAC7B,SAASlB,cAAc,GAAG"}
@@ -12,7 +12,7 @@ const Breadcrumbs = /*#__PURE__*/ forwardRef((props, ref)=>{
12
12
  const { children, ...otherProps } = props;
13
13
  const childArray = Children.toArray(children);
14
14
  // Reshape class name and apply to outer element
15
- const classes = classNames("mobius", "mobius/Breadcrumb", otherProps.className);
15
+ const classes = classNames("mobius", "mobius-breadcrumb", otherProps.className);
16
16
  return /*#__PURE__*/ _jsx("nav", {
17
17
  ref: ref,
18
18
  ...otherProps,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/Breadcrumbs/Breadcrumbs.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n Ref,\n forwardRef,\n Children,\n cloneElement,\n ReactElement,\n RefAttributes,\n ReactNode,\n} from \"react\";\nimport classNames from \"classnames/dedupe\";\nimport { ForwardedRefComponent } from \"../../types/components\";\n\nexport type BreadcrumbsElementType = HTMLUListElement;\n\nexport interface BreadcrumbsProps\n extends RefAttributes<BreadcrumbsElementType> {\n /** Custom class name for setting specific CSS */\n className?: string;\n children?: ReactNode;\n \"aria-label\"?: string;\n}\n\nexport type BreadcrumbsRef = Ref<BreadcrumbsElementType>;\n\nconst Breadcrumbs: ForwardedRefComponent<\n BreadcrumbsProps,\n BreadcrumbsElementType\n> = forwardRef((props: BreadcrumbsProps, ref: BreadcrumbsRef) => {\n const { \"aria-label\": ariaLabel = \"Breadcrumbs\" } = props;\n const { navProps } = { navProps: { \"aria-label\": ariaLabel } };\n const { children, ...otherProps } = props;\n const childArray = Children.toArray(children);\n\n // Reshape class name and apply to outer element\n const classes = classNames(\n \"mobius\",\n \"mobius/Breadcrumb\",\n otherProps.className,\n );\n\n return (\n <nav ref={ref} {...otherProps} {...navProps} className={classes}>\n <ul>\n {childArray.map((child, i) =>\n cloneElement(child as ReactElement, {\n isCurrent: i === childArray.length - 1,\n }),\n )}\n </ul>\n </nav>\n );\n});\n\nBreadcrumbs.displayName = \"Breadcrumbs\";\nexport { Breadcrumbs };\n"],"names":["forwardRef","Children","cloneElement","classNames","Breadcrumbs","props","ref","ariaLabel","navProps","children","otherProps","childArray","toArray","classes","className","nav","ul","map","child","i","isCurrent","length","displayName"],"mappings":"AAAA;;AAEA,SAEEA,UAAU,EACVC,QAAQ,EACRC,YAAY,QAIP,QAAQ;AACf,OAAOC,gBAAgB,oBAAoB;AAe3C,MAAMC,4BAGFJ,WAAW,CAACK,OAAyBC;IACvC,MAAM,EAAE,cAAcC,YAAY,aAAa,EAAE,GAAGF;IACpD,MAAM,EAAEG,QAAQ,EAAE,GAAG;QAAEA,UAAU;YAAE,cAAcD;QAAU;IAAE;IAC7D,MAAM,EAAEE,QAAQ,EAAE,GAAGC,YAAY,GAAGL;IACpC,MAAMM,aAAaV,SAASW,OAAO,CAACH;IAEpC,gDAAgD;IAChD,MAAMI,UAAUV,WACd,UACA,qBACAO,WAAWI,SAAS;IAGtB,qBACE,KAACC;QAAIT,KAAKA;QAAM,GAAGI,UAAU;QAAG,GAAGF,QAAQ;QAAEM,WAAWD;kBACtD,cAAA,KAACG;sBACEL,WAAWM,GAAG,CAAC,CAACC,OAAOC,kBACtBjB,aAAagB,OAAuB;oBAClCE,WAAWD,MAAMR,WAAWU,MAAM,GAAG;gBACvC;;;AAKV;AAEAjB,YAAYkB,WAAW,GAAG;AAC1B,SAASlB,WAAW,GAAG"}
1
+ {"version":3,"sources":["../../../../src/components/Breadcrumbs/Breadcrumbs.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n Ref,\n forwardRef,\n Children,\n cloneElement,\n ReactElement,\n RefAttributes,\n ReactNode,\n} from \"react\";\nimport classNames from \"classnames/dedupe\";\nimport { ForwardedRefComponent } from \"../../types/components\";\n\nexport type BreadcrumbsElementType = HTMLUListElement;\n\nexport interface BreadcrumbsProps\n extends RefAttributes<BreadcrumbsElementType> {\n /** Custom class name for setting specific CSS */\n className?: string;\n children?: ReactNode;\n \"aria-label\"?: string;\n}\n\nexport type BreadcrumbsRef = Ref<BreadcrumbsElementType>;\n\nconst Breadcrumbs: ForwardedRefComponent<\n BreadcrumbsProps,\n BreadcrumbsElementType\n> = forwardRef((props: BreadcrumbsProps, ref: BreadcrumbsRef) => {\n const { \"aria-label\": ariaLabel = \"Breadcrumbs\" } = props;\n const { navProps } = { navProps: { \"aria-label\": ariaLabel } };\n const { children, ...otherProps } = props;\n const childArray = Children.toArray(children);\n\n // Reshape class name and apply to outer element\n const classes = classNames(\n \"mobius\",\n \"mobius-breadcrumb\",\n otherProps.className,\n );\n\n return (\n <nav ref={ref} {...otherProps} {...navProps} className={classes}>\n <ul>\n {childArray.map((child, i) =>\n cloneElement(child as ReactElement, {\n isCurrent: i === childArray.length - 1,\n }),\n )}\n </ul>\n </nav>\n );\n});\n\nBreadcrumbs.displayName = \"Breadcrumbs\";\nexport { Breadcrumbs };\n"],"names":["forwardRef","Children","cloneElement","classNames","Breadcrumbs","props","ref","ariaLabel","navProps","children","otherProps","childArray","toArray","classes","className","nav","ul","map","child","i","isCurrent","length","displayName"],"mappings":"AAAA;;AAEA,SAEEA,UAAU,EACVC,QAAQ,EACRC,YAAY,QAIP,QAAQ;AACf,OAAOC,gBAAgB,oBAAoB;AAe3C,MAAMC,4BAGFJ,WAAW,CAACK,OAAyBC;IACvC,MAAM,EAAE,cAAcC,YAAY,aAAa,EAAE,GAAGF;IACpD,MAAM,EAAEG,QAAQ,EAAE,GAAG;QAAEA,UAAU;YAAE,cAAcD;QAAU;IAAE;IAC7D,MAAM,EAAEE,QAAQ,EAAE,GAAGC,YAAY,GAAGL;IACpC,MAAMM,aAAaV,SAASW,OAAO,CAACH;IAEpC,gDAAgD;IAChD,MAAMI,UAAUV,WACd,UACA,qBACAO,WAAWI,SAAS;IAGtB,qBACE,KAACC;QAAIT,KAAKA;QAAM,GAAGI,UAAU;QAAG,GAAGF,QAAQ;QAAEM,WAAWD;kBACtD,cAAA,KAACG;sBACEL,WAAWM,GAAG,CAAC,CAACC,OAAOC,kBACtBjB,aAAagB,OAAuB;oBAClCE,WAAWD,MAAMR,WAAWU,MAAM,GAAG;gBACvC;;;AAKV;AAEAjB,YAAYkB,WAAW,GAAG;AAC1B,SAASlB,WAAW,GAAG"}
@@ -27,7 +27,7 @@ const Button = /*#__PURE__*/ forwardRef((props, ref)=>{
27
27
  };
28
28
  const buttonVariant = getVariant(variant);
29
29
  // Reshape class name and apply to outer element
30
- const classes = classNames("mobius", "mobius/Button", `--variant-${buttonVariant}`, `--size-${size}`, {
30
+ const classes = classNames("mobius", "mobius-button", `--variant-${buttonVariant}`, `--size-${size}`, {
31
31
  "--is-disabled": isDisabled,
32
32
  "--is-loading": isLoading,
33
33
  "--is-success": isSuccess && !isLoading
@@ -38,7 +38,9 @@ const Button = /*#__PURE__*/ forwardRef((props, ref)=>{
38
38
  ...buttonProps,
39
39
  ...otherProps,
40
40
  children: [
41
- isLoading ? /*#__PURE__*/ _jsx(Loading, {}) : children && children,
41
+ isLoading ? /*#__PURE__*/ _jsx(Loading, {
42
+ children: children
43
+ }) : children,
42
44
  isSuccess && !isLoading && /*#__PURE__*/ _jsx(Success, {})
43
45
  ]
44
46
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/Button/Button.tsx"],"sourcesContent":["\"use client\";\n\nimport { Ref, forwardRef, RefAttributes, ReactNode } from \"react\";\nimport classNames from \"classnames/dedupe\";\nimport { DOMProps } from \"../../types/dom\";\nimport { ForwardedRefComponent } from \"../../types/components\";\nimport { Loading } from \"./Loading\";\nimport { UseButtonProps, useButton } from \"../../hooks/useButton\";\nimport { useDeprecationWarning } from \"../../hooks\";\nimport { Success } from \"./Success\";\n\nexport type ButtonElementType = HTMLButtonElement;\n\nexport type Variant =\n | \"primary\"\n | \"secondary\"\n | \"ghost\"\n | \"inverse\"\n | \"inverse-ghost\"\n | \"basic\"\n | \"link\";\n\nexport type Size = \"sm\" | \"md\" | \"lg\";\n\nexport interface ButtonProps\n extends UseButtonProps,\n DOMProps,\n RefAttributes<ButtonElementType> {\n /** Custom class name for setting specific CSS */\n className?: string;\n /** Shortlist of styles */\n variant?: Variant;\n size?: Size;\n /** Display loading spinner */\n isLoading?: boolean;\n /** Display success style */\n isSuccess?: boolean;\n onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;\n children?: ReactNode;\n}\n\nexport type ButtonRef = Ref<ButtonElementType>;\n\nconst Button: ForwardedRefComponent<ButtonProps, ButtonElementType> =\n forwardRef((props: ButtonProps, ref: ButtonRef) => {\n const {\n children,\n elementType: Component = \"button\",\n isDisabled,\n isLoading,\n isSuccess,\n variant = \"primary\",\n size = \"md\",\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n onPress,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n onClick,\n ...otherProps\n } = props;\n const { buttonProps } = useButton(props);\n\n useDeprecationWarning({\n \"variant 'inverse'\": variant === \"inverse\",\n \"variant 'inverse-ghost'\": variant === \"inverse-ghost\",\n });\n\n // Map deprecated variants to alternative ones\n const getVariant = (type: Variant) => {\n if (type === \"inverse\") {\n return \"basic\";\n }\n\n if (type === \"inverse-ghost\") {\n return \"secondary\";\n }\n\n return variant;\n };\n\n const buttonVariant = getVariant(variant);\n\n // Reshape class name and apply to outer element\n const classes = classNames(\n \"mobius\",\n \"mobius/Button\",\n `--variant-${buttonVariant}`,\n `--size-${size}`,\n {\n \"--is-disabled\": isDisabled,\n \"--is-loading\": isLoading,\n \"--is-success\": isSuccess && !isLoading,\n },\n otherProps.className,\n );\n otherProps.className = classes;\n\n return (\n <Component ref={ref} {...buttonProps} {...otherProps}>\n {isLoading ? <Loading /> : children && children}\n {isSuccess && !isLoading && <Success />}\n </Component>\n );\n });\n\nButton.displayName = \"Button\";\nexport { Button };\n"],"names":["forwardRef","classNames","Loading","useButton","useDeprecationWarning","Success","Button","props","ref","children","elementType","Component","isDisabled","isLoading","isSuccess","variant","size","onPress","onClick","otherProps","buttonProps","getVariant","type","buttonVariant","classes","className","displayName"],"mappings":"AAAA;;AAEA,SAAcA,UAAU,QAAkC,QAAQ;AAClE,OAAOC,gBAAgB,oBAAoB;AAG3C,SAASC,OAAO,QAAQ,YAAY;AACpC,SAAyBC,SAAS,QAAQ,wBAAwB;AAClE,SAASC,qBAAqB,QAAQ,cAAc;AACpD,SAASC,OAAO,QAAQ,YAAY;AAkCpC,MAAMC,uBACJN,WAAW,CAACO,OAAoBC;IAC9B,MAAM,EACJC,QAAQ,EACRC,aAAaC,YAAY,QAAQ,EACjCC,UAAU,EACVC,SAAS,EACTC,SAAS,EACTC,UAAU,SAAS,EACnBC,OAAO,IAAI,EACX,6DAA6D;IAC7DC,OAAO,EACP,6DAA6D;IAC7DC,OAAO,EACP,GAAGC,YACJ,GAAGZ;IACJ,MAAM,EAAEa,WAAW,EAAE,GAAGjB,UAAUI;IAElCH,sBAAsB;QACpB,qBAAqBW,YAAY;QACjC,2BAA2BA,YAAY;IACzC;IAEA,8CAA8C;IAC9C,MAAMM,aAAa,CAACC;QAClB,IAAIA,SAAS,WAAW;YACtB,OAAO;QACT;QAEA,IAAIA,SAAS,iBAAiB;YAC5B,OAAO;QACT;QAEA,OAAOP;IACT;IAEA,MAAMQ,gBAAgBF,WAAWN;IAEjC,gDAAgD;IAChD,MAAMS,UAAUvB,WACd,UACA,iBACA,CAAC,UAAU,EAAEsB,cAAc,CAAC,EAC5B,CAAC,OAAO,EAAEP,KAAK,CAAC,EAChB;QACE,iBAAiBJ;QACjB,gBAAgBC;QAChB,gBAAgBC,aAAa,CAACD;IAChC,GACAM,WAAWM,SAAS;IAEtBN,WAAWM,SAAS,GAAGD;IAEvB,qBACE,MAACb;QAAUH,KAAKA;QAAM,GAAGY,WAAW;QAAG,GAAGD,UAAU;;YACjDN,0BAAY,KAACX,eAAaO,YAAYA;YACtCK,aAAa,CAACD,2BAAa,KAACR;;;AAGnC;AAEFC,OAAOoB,WAAW,GAAG;AACrB,SAASpB,MAAM,GAAG"}
1
+ {"version":3,"sources":["../../../../src/components/Button/Button.tsx"],"sourcesContent":["\"use client\";\n\nimport { Ref, forwardRef, RefAttributes, ReactNode, MouseEvent } from \"react\";\nimport classNames from \"classnames/dedupe\";\nimport { DOMProps } from \"../../types/dom\";\nimport { ForwardedRefComponent } from \"../../types/components\";\nimport { Loading } from \"./Loading\";\nimport { UseButtonProps, useButton } from \"../../hooks/useButton\";\nimport { useDeprecationWarning } from \"../../hooks\";\nimport { Success } from \"./Success\";\n\nexport type ButtonElementType = HTMLButtonElement;\n\nexport type Variant =\n | \"primary\"\n | \"secondary\"\n | \"ghost\"\n | \"inverse\"\n | \"inverse-ghost\"\n | \"basic\"\n | \"link\";\n\nexport type Size = \"sm\" | \"md\" | \"lg\";\n\nexport interface ButtonProps\n extends UseButtonProps,\n DOMProps,\n RefAttributes<ButtonElementType> {\n /** Custom class name for setting specific CSS */\n className?: string;\n /** Shortlist of styles */\n variant?: Variant;\n size?: Size;\n /** Display loading spinner */\n isLoading?: boolean;\n /** Display success style */\n isSuccess?: boolean;\n onClick?: (event: MouseEvent<HTMLButtonElement>) => void;\n children?: ReactNode;\n}\n\nexport type ButtonRef = Ref<ButtonElementType>;\n\nconst Button: ForwardedRefComponent<ButtonProps, ButtonElementType> =\n forwardRef((props: ButtonProps, ref: ButtonRef) => {\n const {\n children,\n elementType: Component = \"button\",\n isDisabled,\n isLoading,\n isSuccess,\n variant = \"primary\",\n size = \"md\",\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n onPress,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n onClick,\n ...otherProps\n } = props;\n const { buttonProps } = useButton(props);\n\n useDeprecationWarning({\n \"variant 'inverse'\": variant === \"inverse\",\n \"variant 'inverse-ghost'\": variant === \"inverse-ghost\",\n });\n\n // Map deprecated variants to alternative ones\n const getVariant = (type: Variant) => {\n if (type === \"inverse\") {\n return \"basic\";\n }\n\n if (type === \"inverse-ghost\") {\n return \"secondary\";\n }\n\n return variant;\n };\n\n const buttonVariant = getVariant(variant);\n\n // Reshape class name and apply to outer element\n const classes = classNames(\n \"mobius\",\n \"mobius-button\",\n `--variant-${buttonVariant}`,\n `--size-${size}`,\n {\n \"--is-disabled\": isDisabled,\n \"--is-loading\": isLoading,\n \"--is-success\": isSuccess && !isLoading,\n },\n otherProps.className,\n );\n otherProps.className = classes;\n\n return (\n <Component ref={ref} {...buttonProps} {...otherProps}>\n {isLoading ? <Loading>{children}</Loading> : children}\n {isSuccess && !isLoading && <Success />}\n </Component>\n );\n });\n\nButton.displayName = \"Button\";\nexport { Button };\n"],"names":["forwardRef","classNames","Loading","useButton","useDeprecationWarning","Success","Button","props","ref","children","elementType","Component","isDisabled","isLoading","isSuccess","variant","size","onPress","onClick","otherProps","buttonProps","getVariant","type","buttonVariant","classes","className","displayName"],"mappings":"AAAA;;AAEA,SAAcA,UAAU,QAA8C,QAAQ;AAC9E,OAAOC,gBAAgB,oBAAoB;AAG3C,SAASC,OAAO,QAAQ,YAAY;AACpC,SAAyBC,SAAS,QAAQ,wBAAwB;AAClE,SAASC,qBAAqB,QAAQ,cAAc;AACpD,SAASC,OAAO,QAAQ,YAAY;AAkCpC,MAAMC,uBACJN,WAAW,CAACO,OAAoBC;IAC9B,MAAM,EACJC,QAAQ,EACRC,aAAaC,YAAY,QAAQ,EACjCC,UAAU,EACVC,SAAS,EACTC,SAAS,EACTC,UAAU,SAAS,EACnBC,OAAO,IAAI,EACX,6DAA6D;IAC7DC,OAAO,EACP,6DAA6D;IAC7DC,OAAO,EACP,GAAGC,YACJ,GAAGZ;IACJ,MAAM,EAAEa,WAAW,EAAE,GAAGjB,UAAUI;IAElCH,sBAAsB;QACpB,qBAAqBW,YAAY;QACjC,2BAA2BA,YAAY;IACzC;IAEA,8CAA8C;IAC9C,MAAMM,aAAa,CAACC;QAClB,IAAIA,SAAS,WAAW;YACtB,OAAO;QACT;QAEA,IAAIA,SAAS,iBAAiB;YAC5B,OAAO;QACT;QAEA,OAAOP;IACT;IAEA,MAAMQ,gBAAgBF,WAAWN;IAEjC,gDAAgD;IAChD,MAAMS,UAAUvB,WACd,UACA,iBACA,CAAC,UAAU,EAAEsB,cAAc,CAAC,EAC5B,CAAC,OAAO,EAAEP,KAAK,CAAC,EAChB;QACE,iBAAiBJ;QACjB,gBAAgBC;QAChB,gBAAgBC,aAAa,CAACD;IAChC,GACAM,WAAWM,SAAS;IAEtBN,WAAWM,SAAS,GAAGD;IAEvB,qBACE,MAACb;QAAUH,KAAKA;QAAM,GAAGY,WAAW;QAAG,GAAGD,UAAU;;YACjDN,0BAAY,KAACX;0BAASO;iBAAsBA;YAC5CK,aAAa,CAACD,2BAAa,KAACR;;;AAGnC;AAEFC,OAAOoB,WAAW,GAAG;AACrB,SAASpB,MAAM,GAAG"}
@@ -1,21 +1,27 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { loading } from "@simplybusiness/icons";
3
3
  import { Icon } from "../Icon";
4
- const Loading = ()=>/*#__PURE__*/ _jsxs(_Fragment, {
4
+ import { VisuallyHidden } from "../VisuallyHidden";
5
+ const Loading = (props)=>{
6
+ const { children } = props;
7
+ return /*#__PURE__*/ _jsxs(_Fragment, {
5
8
  children: [
6
9
  /*#__PURE__*/ _jsx("div", {
7
- className: "mobius/ButtonIconWrapper",
10
+ className: "mobius-button__icon-wrapper",
8
11
  children: /*#__PURE__*/ _jsx(Icon, {
9
12
  icon: loading,
10
- spin: true
13
+ spin: true,
14
+ size: "md"
11
15
  })
12
16
  }),
13
- /*#__PURE__*/ _jsx("span", {
14
- className: "mobius/LoadingText",
17
+ /*#__PURE__*/ _jsx(VisuallyHidden, {
18
+ className: "mobius-button__loading-text",
15
19
  children: "Loading"
16
- })
20
+ }),
21
+ children
17
22
  ]
18
23
  });
24
+ };
19
25
  export { Loading };
20
26
 
21
27
  //# sourceMappingURL=Loading.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/Button/Loading.tsx"],"sourcesContent":["import { loading } from \"@simplybusiness/icons\";\nimport { Icon } from \"../Icon\";\n\nconst Loading = () => (\n <>\n <div className=\"mobius/ButtonIconWrapper\">\n <Icon icon={loading} spin />\n </div>\n <span className=\"mobius/LoadingText\">Loading</span>\n </>\n);\n\nexport { Loading };\n"],"names":["loading","Icon","Loading","div","className","icon","spin","span"],"mappings":";AAAA,SAASA,OAAO,QAAQ,wBAAwB;AAChD,SAASC,IAAI,QAAQ,UAAU;AAE/B,MAAMC,UAAU,kBACd;;0BACE,KAACC;gBAAIC,WAAU;0BACb,cAAA,KAACH;oBAAKI,MAAML;oBAASM,IAAI;;;0BAE3B,KAACC;gBAAKH,WAAU;0BAAqB;;;;AAIzC,SAASF,OAAO,GAAG"}
1
+ {"version":3,"sources":["../../../../src/components/Button/Loading.tsx"],"sourcesContent":["import { ReactNode } from \"react\";\nimport { loading } from \"@simplybusiness/icons\";\nimport { Icon } from \"../Icon\";\nimport { VisuallyHidden } from \"../VisuallyHidden\";\n\ntype LoadingProps = {\n children: ReactNode;\n};\n\nconst Loading = (props: LoadingProps) => {\n const { children } = props;\n\n return (\n <>\n <div className=\"mobius-button__icon-wrapper\">\n <Icon icon={loading} spin size=\"md\" />\n </div>\n <VisuallyHidden className=\"mobius-button__loading-text\">\n Loading\n </VisuallyHidden>\n {children}\n </>\n );\n};\n\nexport { Loading };\n"],"names":["loading","Icon","VisuallyHidden","Loading","props","children","div","className","icon","spin","size"],"mappings":";AACA,SAASA,OAAO,QAAQ,wBAAwB;AAChD,SAASC,IAAI,QAAQ,UAAU;AAC/B,SAASC,cAAc,QAAQ,oBAAoB;AAMnD,MAAMC,UAAU,CAACC;IACf,MAAM,EAAEC,QAAQ,EAAE,GAAGD;IAErB,qBACE;;0BACE,KAACE;gBAAIC,WAAU;0BACb,cAAA,KAACN;oBAAKO,MAAMR;oBAASS,IAAI;oBAACC,MAAK;;;0BAEjC,KAACR;gBAAeK,WAAU;0BAA8B;;YAGvDF;;;AAGP;AAEA,SAASF,OAAO,GAAG"}
@@ -5,13 +5,14 @@ import { VisuallyHidden } from "../VisuallyHidden";
5
5
  const Success = ()=>/*#__PURE__*/ _jsxs(_Fragment, {
6
6
  children: [
7
7
  /*#__PURE__*/ _jsx("div", {
8
- className: "mobius/ButtonIconWrapper",
8
+ className: "mobius-button__icon-wrapper",
9
9
  children: /*#__PURE__*/ _jsx(Icon, {
10
- icon: tick
10
+ icon: tick,
11
+ size: "md"
11
12
  })
12
13
  }),
13
14
  /*#__PURE__*/ _jsx(VisuallyHidden, {
14
- className: "mobius/SuccessText",
15
+ className: "mobius-button__success-text",
15
16
  children: "Success"
16
17
  })
17
18
  ]
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/Button/Success.tsx"],"sourcesContent":["import { tick } from \"@simplybusiness/icons\";\nimport { Icon } from \"../Icon\";\nimport { VisuallyHidden } from \"../VisuallyHidden\";\n\nconst Success = () => (\n <>\n <div className=\"mobius/ButtonIconWrapper\">\n <Icon icon={tick} />\n </div>\n <VisuallyHidden className=\"mobius/SuccessText\">Success</VisuallyHidden>\n </>\n);\n\nexport { Success };\n"],"names":["tick","Icon","VisuallyHidden","Success","div","className","icon"],"mappings":";AAAA,SAASA,IAAI,QAAQ,wBAAwB;AAC7C,SAASC,IAAI,QAAQ,UAAU;AAC/B,SAASC,cAAc,QAAQ,oBAAoB;AAEnD,MAAMC,UAAU,kBACd;;0BACE,KAACC;gBAAIC,WAAU;0BACb,cAAA,KAACJ;oBAAKK,MAAMN;;;0BAEd,KAACE;gBAAeG,WAAU;0BAAqB;;;;AAInD,SAASF,OAAO,GAAG"}
1
+ {"version":3,"sources":["../../../../src/components/Button/Success.tsx"],"sourcesContent":["import { tick } from \"@simplybusiness/icons\";\nimport { Icon } from \"../Icon\";\nimport { VisuallyHidden } from \"../VisuallyHidden\";\n\nconst Success = () => (\n <>\n <div className=\"mobius-button__icon-wrapper\">\n <Icon icon={tick} size=\"md\" />\n </div>\n <VisuallyHidden className=\"mobius-button__success-text\">\n Success\n </VisuallyHidden>\n </>\n);\n\nexport { Success };\n"],"names":["tick","Icon","VisuallyHidden","Success","div","className","icon","size"],"mappings":";AAAA,SAASA,IAAI,QAAQ,wBAAwB;AAC7C,SAASC,IAAI,QAAQ,UAAU;AAC/B,SAASC,cAAc,QAAQ,oBAAoB;AAEnD,MAAMC,UAAU,kBACd;;0BACE,KAACC;gBAAIC,WAAU;0BACb,cAAA,KAACJ;oBAAKK,MAAMN;oBAAMO,MAAK;;;0BAEzB,KAACL;gBAAeG,WAAU;0BAA8B;;;;AAM5D,SAASF,OAAO,GAAG"}
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { forwardRef, useRef, useState, useId } from "react";
4
4
  import classNames from "classnames/dedupe";
5
5
  import { squareTick, square } from "@simplybusiness/icons";
@@ -7,6 +7,7 @@ import { ErrorMessage } from "../ErrorMessage";
7
7
  import { spaceDelimitedList } from "../../utils/spaceDelimitedList";
8
8
  import { useValidationClasses } from "../../hooks";
9
9
  import { Icon } from "../Icon";
10
+ import { Stack } from "../Stack";
10
11
  export const Checkbox = /*#__PURE__*/ forwardRef((props, ref)=>{
11
12
  const { id, label, isDisabled, isRequired, validationState, isInvalid, onChange, className, errorMessage, defaultSelected = false, isReadOnly, name, value, ["aria-describedby"]: ariaDescribedBy, ...rest } = props;
12
13
  const [selected, setSelected] = useState(defaultSelected);
@@ -24,9 +25,10 @@ export const Checkbox = /*#__PURE__*/ forwardRef((props, ref)=>{
24
25
  "--is-optional": typeof isRequired === "boolean" && !isRequired
25
26
  }, validationClasses);
26
27
  // Append an additional wrapper class name to differenitate from input
27
- const wrapperClasses = classNames("mobius", "mobius/Checkbox", sharedClasses, className);
28
- const inputClasses = classNames("mobius/CheckboxInput", sharedClasses);
29
- const iconClasses = classNames("mobius/CheckboxIcon", sharedClasses);
28
+ const wrapperClasses = classNames("mobius", "mobius-checkbox", sharedClasses, className);
29
+ const labelClasses = classNames("mobius-checkbox__label", sharedClasses);
30
+ const inputClasses = classNames("mobius-checkbox__input", sharedClasses);
31
+ const iconClasses = classNames("mobius-checkbox__icon", sharedClasses);
30
32
  const errorMessageId = useId();
31
33
  const shouldErrorMessageShow = errorMessage ? errorMessageId : undefined;
32
34
  const describedBy = spaceDelimitedList([
@@ -53,10 +55,12 @@ export const Checkbox = /*#__PURE__*/ forwardRef((props, ref)=>{
53
55
  toggleState();
54
56
  }
55
57
  };
56
- return /*#__PURE__*/ _jsxs(_Fragment, {
58
+ return /*#__PURE__*/ _jsxs(Stack, {
59
+ gap: "xs",
60
+ className: wrapperClasses,
57
61
  children: [
58
62
  /*#__PURE__*/ _jsxs("label", {
59
- className: wrapperClasses,
63
+ className: labelClasses,
60
64
  children: [
61
65
  /*#__PURE__*/ _jsx("input", {
62
66
  "aria-describedby": describedBy,
@@ -85,7 +89,7 @@ export const Checkbox = /*#__PURE__*/ forwardRef((props, ref)=>{
85
89
  }),
86
90
  /*#__PURE__*/ _jsx("span", {
87
91
  id: labelId,
88
- className: "mobius/CheckboxLabel",
92
+ className: "mobius-checkbox__visible-label",
89
93
  children: label
90
94
  })
91
95
  ]
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n ChangeEvent,\n forwardRef,\n useRef,\n useState,\n KeyboardEvent,\n MouseEvent,\n useId,\n} from \"react\";\nimport classNames from \"classnames/dedupe\";\nimport { squareTick, square } from \"@simplybusiness/icons\";\nimport { ErrorMessage } from \"../ErrorMessage\";\nimport { ForwardedRefComponent } from \"../../types/components\";\nimport { CheckboxElementType, CheckboxProps, CheckboxRef } from \"./types\";\nimport { spaceDelimitedList } from \"../../utils/spaceDelimitedList\";\nimport { useValidationClasses } from \"../../hooks\";\nimport { Icon } from \"../Icon\";\n\nexport const Checkbox: ForwardedRefComponent<\n CheckboxProps,\n CheckboxElementType\n> = forwardRef((props: CheckboxProps, ref: CheckboxRef) => {\n const {\n id,\n label,\n isDisabled,\n isRequired,\n validationState,\n isInvalid,\n onChange,\n className,\n errorMessage,\n defaultSelected = false,\n isReadOnly,\n name,\n value,\n [\"aria-describedby\"]: ariaDescribedBy,\n ...rest\n } = props;\n const [selected, setSelected] = useState<boolean>(defaultSelected);\n const fallbackRef = useRef<HTMLInputElement>(null);\n const refObj = ref || fallbackRef;\n const inputId = useId();\n const validationClasses = useValidationClasses({\n validationState,\n isInvalid,\n });\n const sharedClasses = classNames(\n {\n \"--is-disabled\": isDisabled,\n \"--is-selected\": selected,\n \"--is-required\": typeof isRequired === \"boolean\" && isRequired,\n \"--is-optional\": typeof isRequired === \"boolean\" && !isRequired,\n },\n validationClasses,\n );\n // Append an additional wrapper class name to differenitate from input\n const wrapperClasses = classNames(\n \"mobius\",\n \"mobius/Checkbox\",\n sharedClasses,\n className,\n );\n const inputClasses = classNames(\"mobius/CheckboxInput\", sharedClasses);\n const iconClasses = classNames(\"mobius/CheckboxIcon\", sharedClasses);\n const errorMessageId = useId();\n const shouldErrorMessageShow = errorMessage ? errorMessageId : undefined;\n const describedBy = spaceDelimitedList([\n shouldErrorMessageShow,\n ariaDescribedBy,\n ]);\n const labelId = useId();\n\n const toggleState = () => {\n setSelected(!selected);\n };\n\n const handleClick = (event: MouseEvent<CheckboxElementType>) => {\n const isMouseEvent = event.clientX;\n\n if (isMouseEvent) {\n toggleState();\n }\n };\n\n const handleChange = (event: ChangeEvent<CheckboxElementType>) => {\n if (onChange) {\n onChange(event);\n }\n };\n\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.code === \"Space\") {\n toggleState();\n }\n };\n\n return (\n <>\n <label className={wrapperClasses}>\n <input\n aria-describedby={describedBy}\n aria-errormessage={shouldErrorMessageShow}\n aria-invalid={isInvalid}\n aria-labelledby={labelId}\n readOnly={isReadOnly}\n disabled={isDisabled}\n ref={refObj}\n className={inputClasses}\n onClick={handleClick}\n onChange={handleChange}\n onKeyDown={handleKeyDown}\n type=\"checkbox\"\n defaultChecked={defaultSelected}\n required={isRequired}\n id={id || inputId}\n name={name}\n value={value}\n {...rest}\n />\n <Icon\n icon={selected ? squareTick : square}\n size=\"md\"\n className={iconClasses}\n />\n <span id={labelId} className=\"mobius/CheckboxLabel\">\n {label}\n </span>\n </label>\n <ErrorMessage id={errorMessageId} errorMessage={errorMessage} />\n </>\n );\n});\n"],"names":["forwardRef","useRef","useState","useId","classNames","squareTick","square","ErrorMessage","spaceDelimitedList","useValidationClasses","Icon","Checkbox","props","ref","id","label","isDisabled","isRequired","validationState","isInvalid","onChange","className","errorMessage","defaultSelected","isReadOnly","name","value","ariaDescribedBy","rest","selected","setSelected","fallbackRef","refObj","inputId","validationClasses","sharedClasses","wrapperClasses","inputClasses","iconClasses","errorMessageId","shouldErrorMessageShow","undefined","describedBy","labelId","toggleState","handleClick","event","isMouseEvent","clientX","handleChange","handleKeyDown","code","input","aria-describedby","aria-errormessage","aria-invalid","aria-labelledby","readOnly","disabled","onClick","onKeyDown","type","defaultChecked","required","icon","size","span"],"mappings":"AAAA;;AAEA,SAEEA,UAAU,EACVC,MAAM,EACNC,QAAQ,EAGRC,KAAK,QACA,QAAQ;AACf,OAAOC,gBAAgB,oBAAoB;AAC3C,SAASC,UAAU,EAAEC,MAAM,QAAQ,wBAAwB;AAC3D,SAASC,YAAY,QAAQ,kBAAkB;AAG/C,SAASC,kBAAkB,QAAQ,iCAAiC;AACpE,SAASC,oBAAoB,QAAQ,cAAc;AACnD,SAASC,IAAI,QAAQ,UAAU;AAE/B,OAAO,MAAMC,yBAGTX,WAAW,CAACY,OAAsBC;IACpC,MAAM,EACJC,EAAE,EACFC,KAAK,EACLC,UAAU,EACVC,UAAU,EACVC,eAAe,EACfC,SAAS,EACTC,QAAQ,EACRC,SAAS,EACTC,YAAY,EACZC,kBAAkB,KAAK,EACvBC,UAAU,EACVC,IAAI,EACJC,KAAK,EACL,CAAC,mBAAmB,EAAEC,eAAe,EACrC,GAAGC,MACJ,GAAGhB;IACJ,MAAM,CAACiB,UAAUC,YAAY,GAAG5B,SAAkBqB;IAClD,MAAMQ,cAAc9B,OAAyB;IAC7C,MAAM+B,SAASnB,OAAOkB;IACtB,MAAME,UAAU9B;IAChB,MAAM+B,oBAAoBzB,qBAAqB;QAC7CS;QACAC;IACF;IACA,MAAMgB,gBAAgB/B,WACpB;QACE,iBAAiBY;QACjB,iBAAiBa;QACjB,iBAAiB,OAAOZ,eAAe,aAAaA;QACpD,iBAAiB,OAAOA,eAAe,aAAa,CAACA;IACvD,GACAiB;IAEF,sEAAsE;IACtE,MAAME,iBAAiBhC,WACrB,UACA,mBACA+B,eACAd;IAEF,MAAMgB,eAAejC,WAAW,wBAAwB+B;IACxD,MAAMG,cAAclC,WAAW,uBAAuB+B;IACtD,MAAMI,iBAAiBpC;IACvB,MAAMqC,yBAAyBlB,eAAeiB,iBAAiBE;IAC/D,MAAMC,cAAclC,mBAAmB;QACrCgC;QACAb;KACD;IACD,MAAMgB,UAAUxC;IAEhB,MAAMyC,cAAc;QAClBd,YAAY,CAACD;IACf;IAEA,MAAMgB,cAAc,CAACC;QACnB,MAAMC,eAAeD,MAAME,OAAO;QAElC,IAAID,cAAc;YAChBH;QACF;IACF;IAEA,MAAMK,eAAe,CAACH;QACpB,IAAI1B,UAAU;YACZA,SAAS0B;QACX;IACF;IAEA,MAAMI,gBAAgB,CAACJ;QACrB,IAAIA,MAAMK,IAAI,KAAK,SAAS;YAC1BP;QACF;IACF;IAEA,qBACE;;0BACE,MAAC7B;gBAAMM,WAAWe;;kCAChB,KAACgB;wBACCC,oBAAkBX;wBAClBY,qBAAmBd;wBACnBe,gBAAcpC;wBACdqC,mBAAiBb;wBACjBc,UAAUjC;wBACVkC,UAAU1C;wBACVH,KAAKmB;wBACLX,WAAWgB;wBACXsB,SAASd;wBACTzB,UAAU6B;wBACVW,WAAWV;wBACXW,MAAK;wBACLC,gBAAgBvC;wBAChBwC,UAAU9C;wBACVH,IAAIA,MAAMmB;wBACVR,MAAMA;wBACNC,OAAOA;wBACN,GAAGE,IAAI;;kCAEV,KAAClB;wBACCsD,MAAMnC,WAAWxB,aAAaC;wBAC9B2D,MAAK;wBACL5C,WAAWiB;;kCAEb,KAAC4B;wBAAKpD,IAAI6B;wBAAStB,WAAU;kCAC1BN;;;;0BAGL,KAACR;gBAAaO,IAAIyB;gBAAgBjB,cAAcA;;;;AAGtD,GAAG"}
1
+ {"version":3,"sources":["../../../../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n ChangeEvent,\n forwardRef,\n useRef,\n useState,\n KeyboardEvent,\n MouseEvent,\n useId,\n} from \"react\";\nimport classNames from \"classnames/dedupe\";\nimport { squareTick, square } from \"@simplybusiness/icons\";\nimport { ErrorMessage } from \"../ErrorMessage\";\nimport { ForwardedRefComponent } from \"../../types/components\";\nimport { CheckboxElementType, CheckboxProps, CheckboxRef } from \"./types\";\nimport { spaceDelimitedList } from \"../../utils/spaceDelimitedList\";\nimport { useValidationClasses } from \"../../hooks\";\nimport { Icon } from \"../Icon\";\nimport { Stack } from \"../Stack\";\n\nexport const Checkbox: ForwardedRefComponent<\n CheckboxProps,\n CheckboxElementType\n> = forwardRef((props: CheckboxProps, ref: CheckboxRef) => {\n const {\n id,\n label,\n isDisabled,\n isRequired,\n validationState,\n isInvalid,\n onChange,\n className,\n errorMessage,\n defaultSelected = false,\n isReadOnly,\n name,\n value,\n [\"aria-describedby\"]: ariaDescribedBy,\n ...rest\n } = props;\n const [selected, setSelected] = useState<boolean>(defaultSelected);\n const fallbackRef = useRef<HTMLInputElement>(null);\n const refObj = ref || fallbackRef;\n const inputId = useId();\n const validationClasses = useValidationClasses({\n validationState,\n isInvalid,\n });\n const sharedClasses = classNames(\n {\n \"--is-disabled\": isDisabled,\n \"--is-selected\": selected,\n \"--is-required\": typeof isRequired === \"boolean\" && isRequired,\n \"--is-optional\": typeof isRequired === \"boolean\" && !isRequired,\n },\n validationClasses,\n );\n // Append an additional wrapper class name to differenitate from input\n const wrapperClasses = classNames(\n \"mobius\",\n \"mobius-checkbox\",\n sharedClasses,\n className,\n );\n const labelClasses = classNames(\"mobius-checkbox__label\", sharedClasses);\n const inputClasses = classNames(\"mobius-checkbox__input\", sharedClasses);\n const iconClasses = classNames(\"mobius-checkbox__icon\", sharedClasses);\n const errorMessageId = useId();\n const shouldErrorMessageShow = errorMessage ? errorMessageId : undefined;\n const describedBy = spaceDelimitedList([\n shouldErrorMessageShow,\n ariaDescribedBy,\n ]);\n const labelId = useId();\n\n const toggleState = () => {\n setSelected(!selected);\n };\n\n const handleClick = (event: MouseEvent<CheckboxElementType>) => {\n const isMouseEvent = event.clientX;\n\n if (isMouseEvent) {\n toggleState();\n }\n };\n\n const handleChange = (event: ChangeEvent<CheckboxElementType>) => {\n if (onChange) {\n onChange(event);\n }\n };\n\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.code === \"Space\") {\n toggleState();\n }\n };\n\n return (\n <Stack gap=\"xs\" className={wrapperClasses}>\n <label className={labelClasses}>\n <input\n aria-describedby={describedBy}\n aria-errormessage={shouldErrorMessageShow}\n aria-invalid={isInvalid}\n aria-labelledby={labelId}\n readOnly={isReadOnly}\n disabled={isDisabled}\n ref={refObj}\n className={inputClasses}\n onClick={handleClick}\n onChange={handleChange}\n onKeyDown={handleKeyDown}\n type=\"checkbox\"\n defaultChecked={defaultSelected}\n required={isRequired}\n id={id || inputId}\n name={name}\n value={value}\n {...rest}\n />\n <Icon\n icon={selected ? squareTick : square}\n size=\"md\"\n className={iconClasses}\n />\n <span id={labelId} className=\"mobius-checkbox__visible-label\">\n {label}\n </span>\n </label>\n <ErrorMessage id={errorMessageId} errorMessage={errorMessage} />\n </Stack>\n );\n});\n"],"names":["forwardRef","useRef","useState","useId","classNames","squareTick","square","ErrorMessage","spaceDelimitedList","useValidationClasses","Icon","Stack","Checkbox","props","ref","id","label","isDisabled","isRequired","validationState","isInvalid","onChange","className","errorMessage","defaultSelected","isReadOnly","name","value","ariaDescribedBy","rest","selected","setSelected","fallbackRef","refObj","inputId","validationClasses","sharedClasses","wrapperClasses","labelClasses","inputClasses","iconClasses","errorMessageId","shouldErrorMessageShow","undefined","describedBy","labelId","toggleState","handleClick","event","isMouseEvent","clientX","handleChange","handleKeyDown","code","gap","input","aria-describedby","aria-errormessage","aria-invalid","aria-labelledby","readOnly","disabled","onClick","onKeyDown","type","defaultChecked","required","icon","size","span"],"mappings":"AAAA;;AAEA,SAEEA,UAAU,EACVC,MAAM,EACNC,QAAQ,EAGRC,KAAK,QACA,QAAQ;AACf,OAAOC,gBAAgB,oBAAoB;AAC3C,SAASC,UAAU,EAAEC,MAAM,QAAQ,wBAAwB;AAC3D,SAASC,YAAY,QAAQ,kBAAkB;AAG/C,SAASC,kBAAkB,QAAQ,iCAAiC;AACpE,SAASC,oBAAoB,QAAQ,cAAc;AACnD,SAASC,IAAI,QAAQ,UAAU;AAC/B,SAASC,KAAK,QAAQ,WAAW;AAEjC,OAAO,MAAMC,yBAGTZ,WAAW,CAACa,OAAsBC;IACpC,MAAM,EACJC,EAAE,EACFC,KAAK,EACLC,UAAU,EACVC,UAAU,EACVC,eAAe,EACfC,SAAS,EACTC,QAAQ,EACRC,SAAS,EACTC,YAAY,EACZC,kBAAkB,KAAK,EACvBC,UAAU,EACVC,IAAI,EACJC,KAAK,EACL,CAAC,mBAAmB,EAAEC,eAAe,EACrC,GAAGC,MACJ,GAAGhB;IACJ,MAAM,CAACiB,UAAUC,YAAY,GAAG7B,SAAkBsB;IAClD,MAAMQ,cAAc/B,OAAyB;IAC7C,MAAMgC,SAASnB,OAAOkB;IACtB,MAAME,UAAU/B;IAChB,MAAMgC,oBAAoB1B,qBAAqB;QAC7CU;QACAC;IACF;IACA,MAAMgB,gBAAgBhC,WACpB;QACE,iBAAiBa;QACjB,iBAAiBa;QACjB,iBAAiB,OAAOZ,eAAe,aAAaA;QACpD,iBAAiB,OAAOA,eAAe,aAAa,CAACA;IACvD,GACAiB;IAEF,sEAAsE;IACtE,MAAME,iBAAiBjC,WACrB,UACA,mBACAgC,eACAd;IAEF,MAAMgB,eAAelC,WAAW,0BAA0BgC;IAC1D,MAAMG,eAAenC,WAAW,0BAA0BgC;IAC1D,MAAMI,cAAcpC,WAAW,yBAAyBgC;IACxD,MAAMK,iBAAiBtC;IACvB,MAAMuC,yBAAyBnB,eAAekB,iBAAiBE;IAC/D,MAAMC,cAAcpC,mBAAmB;QACrCkC;QACAd;KACD;IACD,MAAMiB,UAAU1C;IAEhB,MAAM2C,cAAc;QAClBf,YAAY,CAACD;IACf;IAEA,MAAMiB,cAAc,CAACC;QACnB,MAAMC,eAAeD,MAAME,OAAO;QAElC,IAAID,cAAc;YAChBH;QACF;IACF;IAEA,MAAMK,eAAe,CAACH;QACpB,IAAI3B,UAAU;YACZA,SAAS2B;QACX;IACF;IAEA,MAAMI,gBAAgB,CAACJ;QACrB,IAAIA,MAAMK,IAAI,KAAK,SAAS;YAC1BP;QACF;IACF;IAEA,qBACE,MAACnC;QAAM2C,KAAI;QAAKhC,WAAWe;;0BACzB,MAACrB;gBAAMM,WAAWgB;;kCAChB,KAACiB;wBACCC,oBAAkBZ;wBAClBa,qBAAmBf;wBACnBgB,gBAActC;wBACduC,mBAAiBd;wBACjBe,UAAUnC;wBACVoC,UAAU5C;wBACVH,KAAKmB;wBACLX,WAAWiB;wBACXuB,SAASf;wBACT1B,UAAU8B;wBACVY,WAAWX;wBACXY,MAAK;wBACLC,gBAAgBzC;wBAChB0C,UAAUhD;wBACVH,IAAIA,MAAMmB;wBACVR,MAAMA;wBACNC,OAAOA;wBACN,GAAGE,IAAI;;kCAEV,KAACnB;wBACCyD,MAAMrC,WAAWzB,aAAaC;wBAC9B8D,MAAK;wBACL9C,WAAWkB;;kCAEb,KAAC6B;wBAAKtD,IAAI8B;wBAASvB,WAAU;kCAC1BN;;;;0BAGL,KAACT;gBAAaQ,IAAI0B;gBAAgBlB,cAAcA;;;;AAGtD,GAAG"}
@@ -9,7 +9,7 @@ import { useValidationClasses } from "../../hooks";
9
9
  export const CheckboxGroup = /*#__PURE__*/ forwardRef((props, ref)=>{
10
10
  const { label, isDisabled = false, isRequired, validationState, isInvalid, orientation = "vertical", onChange, className, errorMessage, children, defaultValue = [], isReadOnly, itemsPerRow, ...rest } = props;
11
11
  const [selected, setSelected] = useState(defaultValue);
12
- const checkboxGroupClasses = classNames("mobius", "mobius/CheckboxGroup", className, {
12
+ const checkboxGroupClasses = classNames("mobius", "mobius-checkbox-group", className, {
13
13
  "--is-horizontal": orientation === "horizontal",
14
14
  "--is-vertical": orientation === "vertical",
15
15
  "--is-required": typeof isRequired === "boolean" && isRequired,
@@ -66,7 +66,7 @@ export const CheckboxGroup = /*#__PURE__*/ forwardRef((props, ref)=>{
66
66
  children: label
67
67
  }),
68
68
  /*#__PURE__*/ _jsx("div", {
69
- className: "mobius/CheckboxWrapper",
69
+ className: "mobius-checkbox-group__wrapper",
70
70
  children: Children.map(children, (child)=>{
71
71
  if (/*#__PURE__*/ isValidElement(child)) {
72
72
  return /*#__PURE__*/ cloneElement(child, {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/Checkbox/CheckboxGroup.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n Children,\n forwardRef,\n ReactElement,\n cloneElement,\n isValidElement,\n useId,\n ChangeEvent,\n useState,\n useEffect,\n} from \"react\";\nimport classNames from \"classnames/dedupe\";\nimport { ForwardedRefComponent } from \"../../types/components\";\nimport {\n CheckboxElementType,\n CheckboxGroupElementType,\n CheckboxGroupProps,\n CheckboxGroupRef,\n} from \"./types\";\nimport { Label } from \"../Label\";\nimport { ErrorMessage } from \"../ErrorMessage\";\nimport { spaceDelimitedList } from \"../../utils/spaceDelimitedList\";\nimport { useValidationClasses } from \"../../hooks\";\n\nexport const CheckboxGroup: ForwardedRefComponent<\n CheckboxGroupProps,\n CheckboxGroupElementType\n> = forwardRef((props: CheckboxGroupProps, ref: CheckboxGroupRef) => {\n const {\n label,\n isDisabled = false,\n isRequired,\n validationState,\n isInvalid,\n orientation = \"vertical\",\n onChange,\n className,\n errorMessage,\n children,\n defaultValue = [],\n isReadOnly,\n itemsPerRow,\n ...rest\n } = props;\n const [selected, setSelected] = useState<string[]>(defaultValue);\n const checkboxGroupClasses = classNames(\n \"mobius\",\n \"mobius/CheckboxGroup\",\n className,\n {\n \"--is-horizontal\": orientation === \"horizontal\",\n \"--is-vertical\": orientation === \"vertical\",\n \"--is-required\": typeof isRequired === \"boolean\" && isRequired,\n \"--is-optional\": typeof isRequired === \"boolean\" && !isRequired,\n },\n );\n const validationClasses = useValidationClasses({\n validationState,\n isInvalid,\n });\n const labelClasses = classNames(\n {\n \"--is-disabled\": isDisabled,\n },\n validationClasses,\n );\n const errorMessageId = useId();\n const shouldErrorMessageShow = errorMessage ? errorMessageId : undefined;\n const describedBy = spaceDelimitedList([\n shouldErrorMessageShow,\n props[\"aria-describedby\"],\n ]);\n const labelId = useId();\n\n const handleChange = (event: ChangeEvent<CheckboxElementType>) => {\n const {\n target: { value, checked },\n } = event;\n\n if (!checked) {\n setSelected(selected.filter(item => item !== value));\n }\n\n if (checked) {\n setSelected([...selected, value]);\n }\n };\n\n useEffect(() => {\n if (onChange) {\n onChange(selected);\n }\n }, [selected, onChange]);\n\n return (\n <div\n {...rest}\n aria-labelledby={props[\"aria-labelledby\"] || labelId}\n ref={ref}\n className={checkboxGroupClasses}\n role=\"group\"\n style={\n {\n \"--checkbox-items-per-row\": itemsPerRow || Children.count(children),\n } as React.CSSProperties\n }\n >\n {label && (\n <Label elementType=\"span\" id={labelId} className={labelClasses}>\n {label}\n </Label>\n )}\n <div className=\"mobius/CheckboxWrapper\">\n {Children.map(children, child => {\n if (isValidElement(child)) {\n return cloneElement(child as ReactElement, {\n isDisabled,\n isRequired,\n isReadOnly,\n isInvalid,\n defaultSelected: selected.includes(child.props.value),\n onChange: handleChange,\n \"aria-describedby\": describedBy,\n });\n }\n\n return child;\n })}\n </div>\n {errorMessage && (\n <ErrorMessage id={errorMessageId} errorMessage={errorMessage} />\n )}\n </div>\n );\n});\n"],"names":["Children","forwardRef","cloneElement","isValidElement","useId","useState","useEffect","classNames","Label","ErrorMessage","spaceDelimitedList","useValidationClasses","CheckboxGroup","props","ref","label","isDisabled","isRequired","validationState","isInvalid","orientation","onChange","className","errorMessage","children","defaultValue","isReadOnly","itemsPerRow","rest","selected","setSelected","checkboxGroupClasses","validationClasses","labelClasses","errorMessageId","shouldErrorMessageShow","undefined","describedBy","labelId","handleChange","event","target","value","checked","filter","item","div","aria-labelledby","role","style","count","elementType","id","map","child","defaultSelected","includes"],"mappings":"AAAA;;AAEA,SACEA,QAAQ,EACRC,UAAU,EAEVC,YAAY,EACZC,cAAc,EACdC,KAAK,EAELC,QAAQ,EACRC,SAAS,QACJ,QAAQ;AACf,OAAOC,gBAAgB,oBAAoB;AAQ3C,SAASC,KAAK,QAAQ,WAAW;AACjC,SAASC,YAAY,QAAQ,kBAAkB;AAC/C,SAASC,kBAAkB,QAAQ,iCAAiC;AACpE,SAASC,oBAAoB,QAAQ,cAAc;AAEnD,OAAO,MAAMC,8BAGTX,WAAW,CAACY,OAA2BC;IACzC,MAAM,EACJC,KAAK,EACLC,aAAa,KAAK,EAClBC,UAAU,EACVC,eAAe,EACfC,SAAS,EACTC,cAAc,UAAU,EACxBC,QAAQ,EACRC,SAAS,EACTC,YAAY,EACZC,QAAQ,EACRC,eAAe,EAAE,EACjBC,UAAU,EACVC,WAAW,EACX,GAAGC,MACJ,GAAGf;IACJ,MAAM,CAACgB,UAAUC,YAAY,GAAGzB,SAAmBoB;IACnD,MAAMM,uBAAuBxB,WAC3B,UACA,wBACAe,WACA;QACE,mBAAmBF,gBAAgB;QACnC,iBAAiBA,gBAAgB;QACjC,iBAAiB,OAAOH,eAAe,aAAaA;QACpD,iBAAiB,OAAOA,eAAe,aAAa,CAACA;IACvD;IAEF,MAAMe,oBAAoBrB,qBAAqB;QAC7CO;QACAC;IACF;IACA,MAAMc,eAAe1B,WACnB;QACE,iBAAiBS;IACnB,GACAgB;IAEF,MAAME,iBAAiB9B;IACvB,MAAM+B,yBAAyBZ,eAAeW,iBAAiBE;IAC/D,MAAMC,cAAc3B,mBAAmB;QACrCyB;QACAtB,KAAK,CAAC,mBAAmB;KAC1B;IACD,MAAMyB,UAAUlC;IAEhB,MAAMmC,eAAe,CAACC;QACpB,MAAM,EACJC,QAAQ,EAAEC,KAAK,EAAEC,OAAO,EAAE,EAC3B,GAAGH;QAEJ,IAAI,CAACG,SAAS;YACZb,YAAYD,SAASe,MAAM,CAACC,CAAAA,OAAQA,SAASH;QAC/C;QAEA,IAAIC,SAAS;YACXb,YAAY;mBAAID;gBAAUa;aAAM;QAClC;IACF;IAEApC,UAAU;QACR,IAAIe,UAAU;YACZA,SAASQ;QACX;IACF,GAAG;QAACA;QAAUR;KAAS;IAEvB,qBACE,MAACyB;QACE,GAAGlB,IAAI;QACRmB,mBAAiBlC,KAAK,CAAC,kBAAkB,IAAIyB;QAC7CxB,KAAKA;QACLQ,WAAWS;QACXiB,MAAK;QACLC,OACE;YACE,4BAA4BtB,eAAe3B,SAASkD,KAAK,CAAC1B;QAC5D;;YAGDT,uBACC,KAACP;gBAAM2C,aAAY;gBAAOC,IAAId;gBAAShB,WAAWW;0BAC/ClB;;0BAGL,KAAC+B;gBAAIxB,WAAU;0BACZtB,SAASqD,GAAG,CAAC7B,UAAU8B,CAAAA;oBACtB,kBAAInD,eAAemD,QAAQ;wBACzB,qBAAOpD,aAAaoD,OAAuB;4BACzCtC;4BACAC;4BACAS;4BACAP;4BACAoC,iBAAiB1B,SAAS2B,QAAQ,CAACF,MAAMzC,KAAK,CAAC6B,KAAK;4BACpDrB,UAAUkB;4BACV,oBAAoBF;wBACtB;oBACF;oBAEA,OAAOiB;gBACT;;YAED/B,8BACC,KAACd;gBAAa2C,IAAIlB;gBAAgBX,cAAcA;;;;AAIxD,GAAG"}
1
+ {"version":3,"sources":["../../../../src/components/Checkbox/CheckboxGroup.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n Children,\n forwardRef,\n ReactElement,\n cloneElement,\n isValidElement,\n useId,\n ChangeEvent,\n useState,\n useEffect,\n} from \"react\";\nimport classNames from \"classnames/dedupe\";\nimport { ForwardedRefComponent } from \"../../types/components\";\nimport {\n CheckboxElementType,\n CheckboxGroupElementType,\n CheckboxGroupProps,\n CheckboxGroupRef,\n} from \"./types\";\nimport { Label } from \"../Label\";\nimport { ErrorMessage } from \"../ErrorMessage\";\nimport { spaceDelimitedList } from \"../../utils/spaceDelimitedList\";\nimport { useValidationClasses } from \"../../hooks\";\n\nexport const CheckboxGroup: ForwardedRefComponent<\n CheckboxGroupProps,\n CheckboxGroupElementType\n> = forwardRef((props: CheckboxGroupProps, ref: CheckboxGroupRef) => {\n const {\n label,\n isDisabled = false,\n isRequired,\n validationState,\n isInvalid,\n orientation = \"vertical\",\n onChange,\n className,\n errorMessage,\n children,\n defaultValue = [],\n isReadOnly,\n itemsPerRow,\n ...rest\n } = props;\n const [selected, setSelected] = useState<string[]>(defaultValue);\n const checkboxGroupClasses = classNames(\n \"mobius\",\n \"mobius-checkbox-group\",\n className,\n {\n \"--is-horizontal\": orientation === \"horizontal\",\n \"--is-vertical\": orientation === \"vertical\",\n \"--is-required\": typeof isRequired === \"boolean\" && isRequired,\n \"--is-optional\": typeof isRequired === \"boolean\" && !isRequired,\n },\n );\n const validationClasses = useValidationClasses({\n validationState,\n isInvalid,\n });\n const labelClasses = classNames(\n {\n \"--is-disabled\": isDisabled,\n },\n validationClasses,\n );\n const errorMessageId = useId();\n const shouldErrorMessageShow = errorMessage ? errorMessageId : undefined;\n const describedBy = spaceDelimitedList([\n shouldErrorMessageShow,\n props[\"aria-describedby\"],\n ]);\n const labelId = useId();\n\n const handleChange = (event: ChangeEvent<CheckboxElementType>) => {\n const {\n target: { value, checked },\n } = event;\n\n if (!checked) {\n setSelected(selected.filter(item => item !== value));\n }\n\n if (checked) {\n setSelected([...selected, value]);\n }\n };\n\n useEffect(() => {\n if (onChange) {\n onChange(selected);\n }\n }, [selected, onChange]);\n\n return (\n <div\n {...rest}\n aria-labelledby={props[\"aria-labelledby\"] || labelId}\n ref={ref}\n className={checkboxGroupClasses}\n role=\"group\"\n style={\n {\n \"--checkbox-items-per-row\": itemsPerRow || Children.count(children),\n } as React.CSSProperties\n }\n >\n {label && (\n <Label elementType=\"span\" id={labelId} className={labelClasses}>\n {label}\n </Label>\n )}\n <div className=\"mobius-checkbox-group__wrapper\">\n {Children.map(children, child => {\n if (isValidElement(child)) {\n return cloneElement(child as ReactElement, {\n isDisabled,\n isRequired,\n isReadOnly,\n isInvalid,\n defaultSelected: selected.includes(child.props.value),\n onChange: handleChange,\n \"aria-describedby\": describedBy,\n });\n }\n\n return child;\n })}\n </div>\n {errorMessage && (\n <ErrorMessage id={errorMessageId} errorMessage={errorMessage} />\n )}\n </div>\n );\n});\n"],"names":["Children","forwardRef","cloneElement","isValidElement","useId","useState","useEffect","classNames","Label","ErrorMessage","spaceDelimitedList","useValidationClasses","CheckboxGroup","props","ref","label","isDisabled","isRequired","validationState","isInvalid","orientation","onChange","className","errorMessage","children","defaultValue","isReadOnly","itemsPerRow","rest","selected","setSelected","checkboxGroupClasses","validationClasses","labelClasses","errorMessageId","shouldErrorMessageShow","undefined","describedBy","labelId","handleChange","event","target","value","checked","filter","item","div","aria-labelledby","role","style","count","elementType","id","map","child","defaultSelected","includes"],"mappings":"AAAA;;AAEA,SACEA,QAAQ,EACRC,UAAU,EAEVC,YAAY,EACZC,cAAc,EACdC,KAAK,EAELC,QAAQ,EACRC,SAAS,QACJ,QAAQ;AACf,OAAOC,gBAAgB,oBAAoB;AAQ3C,SAASC,KAAK,QAAQ,WAAW;AACjC,SAASC,YAAY,QAAQ,kBAAkB;AAC/C,SAASC,kBAAkB,QAAQ,iCAAiC;AACpE,SAASC,oBAAoB,QAAQ,cAAc;AAEnD,OAAO,MAAMC,8BAGTX,WAAW,CAACY,OAA2BC;IACzC,MAAM,EACJC,KAAK,EACLC,aAAa,KAAK,EAClBC,UAAU,EACVC,eAAe,EACfC,SAAS,EACTC,cAAc,UAAU,EACxBC,QAAQ,EACRC,SAAS,EACTC,YAAY,EACZC,QAAQ,EACRC,eAAe,EAAE,EACjBC,UAAU,EACVC,WAAW,EACX,GAAGC,MACJ,GAAGf;IACJ,MAAM,CAACgB,UAAUC,YAAY,GAAGzB,SAAmBoB;IACnD,MAAMM,uBAAuBxB,WAC3B,UACA,yBACAe,WACA;QACE,mBAAmBF,gBAAgB;QACnC,iBAAiBA,gBAAgB;QACjC,iBAAiB,OAAOH,eAAe,aAAaA;QACpD,iBAAiB,OAAOA,eAAe,aAAa,CAACA;IACvD;IAEF,MAAMe,oBAAoBrB,qBAAqB;QAC7CO;QACAC;IACF;IACA,MAAMc,eAAe1B,WACnB;QACE,iBAAiBS;IACnB,GACAgB;IAEF,MAAME,iBAAiB9B;IACvB,MAAM+B,yBAAyBZ,eAAeW,iBAAiBE;IAC/D,MAAMC,cAAc3B,mBAAmB;QACrCyB;QACAtB,KAAK,CAAC,mBAAmB;KAC1B;IACD,MAAMyB,UAAUlC;IAEhB,MAAMmC,eAAe,CAACC;QACpB,MAAM,EACJC,QAAQ,EAAEC,KAAK,EAAEC,OAAO,EAAE,EAC3B,GAAGH;QAEJ,IAAI,CAACG,SAAS;YACZb,YAAYD,SAASe,MAAM,CAACC,CAAAA,OAAQA,SAASH;QAC/C;QAEA,IAAIC,SAAS;YACXb,YAAY;mBAAID;gBAAUa;aAAM;QAClC;IACF;IAEApC,UAAU;QACR,IAAIe,UAAU;YACZA,SAASQ;QACX;IACF,GAAG;QAACA;QAAUR;KAAS;IAEvB,qBACE,MAACyB;QACE,GAAGlB,IAAI;QACRmB,mBAAiBlC,KAAK,CAAC,kBAAkB,IAAIyB;QAC7CxB,KAAKA;QACLQ,WAAWS;QACXiB,MAAK;QACLC,OACE;YACE,4BAA4BtB,eAAe3B,SAASkD,KAAK,CAAC1B;QAC5D;;YAGDT,uBACC,KAACP;gBAAM2C,aAAY;gBAAOC,IAAId;gBAAShB,WAAWW;0BAC/ClB;;0BAGL,KAAC+B;gBAAIxB,WAAU;0BACZtB,SAASqD,GAAG,CAAC7B,UAAU8B,CAAAA;oBACtB,kBAAInD,eAAemD,QAAQ;wBACzB,qBAAOpD,aAAaoD,OAAuB;4BACzCtC;4BACAC;4BACAS;4BACAP;4BACAoC,iBAAiB1B,SAAS2B,QAAQ,CAACF,MAAMzC,KAAK,CAAC6B,KAAK;4BACpDrB,UAAUkB;4BACV,oBAAoBF;wBACtB;oBACF;oBAEA,OAAOiB;gBACT;;YAED/B,8BACC,KAACd;gBAAa2C,IAAIlB;gBAAgBX,cAAcA;;;;AAIxD,GAAG"}
@@ -4,7 +4,7 @@ import classNames from "classnames/dedupe";
4
4
  import { sizeClasses } from "../../utils";
5
5
  const Container = /*#__PURE__*/ forwardRef((props, ref)=>{
6
6
  const { elementType: Element = "div", size = "md", ...otherProps } = props;
7
- const classes = classNames("mobius", "mobius/Container", sizeClasses(size), otherProps.className);
7
+ const classes = classNames("mobius", "mobius-container", sizeClasses(size), otherProps.className);
8
8
  return /*#__PURE__*/ _jsx(Element, {
9
9
  ref: ref,
10
10
  ...otherProps,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/Container/Container.tsx"],"sourcesContent":["import {\n forwardRef,\n Ref,\n RefAttributes,\n ReactNode,\n ElementType,\n CSSProperties,\n} from \"react\";\nimport classNames from \"classnames/dedupe\";\nimport { DOMProps } from \"../../types/dom\";\nimport { ForwardedRefComponent } from \"../../types/components\";\nimport { SizeType } from \"../../types\";\nimport { sizeClasses } from \"../../utils\";\n\nexport type ContainerElementType = HTMLElement;\nexport type ContainerRef = Ref<ContainerElementType>;\n\nexport interface ContainerProps\n extends DOMProps,\n RefAttributes<ContainerElementType> {\n id?: string;\n /** Custom class name for setting specific CSS */\n className?: string;\n /** HTML element for the Box */\n elementType?: string | ElementType;\n size?: SizeType;\n children?: ReactNode;\n style?: CSSProperties;\n}\n\nconst Container: ForwardedRefComponent<ContainerProps, ContainerElementType> =\n forwardRef((props: ContainerProps, ref: ContainerRef) => {\n const { elementType: Element = \"div\", size = \"md\", ...otherProps } = props;\n\n const classes = classNames(\n \"mobius\",\n \"mobius/Container\",\n sizeClasses(size),\n otherProps.className,\n );\n\n return <Element ref={ref} {...otherProps} className={classes} />;\n });\n\nContainer.displayName = \"Container\";\nexport { Container };\n"],"names":["forwardRef","classNames","sizeClasses","Container","props","ref","elementType","Element","size","otherProps","classes","className","displayName"],"mappings":";AAAA,SACEA,UAAU,QAML,QAAQ;AACf,OAAOC,gBAAgB,oBAAoB;AAI3C,SAASC,WAAW,QAAQ,cAAc;AAkB1C,MAAMC,0BACJH,WAAW,CAACI,OAAuBC;IACjC,MAAM,EAAEC,aAAaC,UAAU,KAAK,EAAEC,OAAO,IAAI,EAAE,GAAGC,YAAY,GAAGL;IAErE,MAAMM,UAAUT,WACd,UACA,oBACAC,YAAYM,OACZC,WAAWE,SAAS;IAGtB,qBAAO,KAACJ;QAAQF,KAAKA;QAAM,GAAGI,UAAU;QAAEE,WAAWD;;AACvD;AAEFP,UAAUS,WAAW,GAAG;AACxB,SAAST,SAAS,GAAG"}
1
+ {"version":3,"sources":["../../../../src/components/Container/Container.tsx"],"sourcesContent":["import {\n forwardRef,\n Ref,\n RefAttributes,\n ReactNode,\n ElementType,\n CSSProperties,\n} from \"react\";\nimport classNames from \"classnames/dedupe\";\nimport { DOMProps } from \"../../types/dom\";\nimport { ForwardedRefComponent } from \"../../types/components\";\nimport { SizeType } from \"../../types\";\nimport { sizeClasses } from \"../../utils\";\n\nexport type ContainerElementType = HTMLElement;\nexport type ContainerRef = Ref<ContainerElementType>;\n\nexport interface ContainerProps\n extends DOMProps,\n RefAttributes<ContainerElementType> {\n id?: string;\n /** Custom class name for setting specific CSS */\n className?: string;\n /** HTML element for the Box */\n elementType?: string | ElementType;\n size?: SizeType;\n children?: ReactNode;\n style?: CSSProperties;\n}\n\nconst Container: ForwardedRefComponent<ContainerProps, ContainerElementType> =\n forwardRef((props: ContainerProps, ref: ContainerRef) => {\n const { elementType: Element = \"div\", size = \"md\", ...otherProps } = props;\n\n const classes = classNames(\n \"mobius\",\n \"mobius-container\",\n sizeClasses(size),\n otherProps.className,\n );\n\n return <Element ref={ref} {...otherProps} className={classes} />;\n });\n\nContainer.displayName = \"Container\";\nexport { Container };\n"],"names":["forwardRef","classNames","sizeClasses","Container","props","ref","elementType","Element","size","otherProps","classes","className","displayName"],"mappings":";AAAA,SACEA,UAAU,QAML,QAAQ;AACf,OAAOC,gBAAgB,oBAAoB;AAI3C,SAASC,WAAW,QAAQ,cAAc;AAkB1C,MAAMC,0BACJH,WAAW,CAACI,OAAuBC;IACjC,MAAM,EAAEC,aAAaC,UAAU,KAAK,EAAEC,OAAO,IAAI,EAAE,GAAGC,YAAY,GAAGL;IAErE,MAAMM,UAAUT,WACd,UACA,oBACAC,YAAYM,OACZC,WAAWE,SAAS;IAGtB,qBAAO,KAACJ;QAAQF,KAAKA;QAAM,GAAGI,UAAU;QAAEE,WAAWD;;AACvD;AAEFP,UAAUS,WAAW,GAAG;AACxB,SAAST,SAAS,GAAG"}
@@ -1,14 +1,14 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import classNames from "classnames/dedupe";
3
3
  const Divider = ({ "aria-orientation": ariaOrientation = "horizontal", className, ...rest })=>{
4
- const classes = classNames("mobius", "mobius/Divider", className);
4
+ const classes = classNames("mobius", "mobius-divider", className);
5
5
  return /*#__PURE__*/ _jsx("div", {
6
6
  className: classes,
7
7
  role: "separator",
8
8
  "aria-orientation": ariaOrientation,
9
9
  ...rest,
10
10
  children: /*#__PURE__*/ _jsx("div", {
11
- className: "mobius/DividerInner"
11
+ className: "mobius-divider__inner"
12
12
  })
13
13
  });
14
14
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/Divider/Divider.tsx"],"sourcesContent":["import classNames from \"classnames/dedupe\";\nimport { AriaAttributes } from \"react\";\nimport { DOMProps } from \"../../types/dom\";\n\nexport interface DividerProps extends DOMProps {\n className?: string;\n \"aria-orientation\"?: AriaAttributes[\"aria-orientation\"];\n}\n\nconst Divider = ({\n \"aria-orientation\": ariaOrientation = \"horizontal\",\n className,\n ...rest\n}: DividerProps) => {\n const classes = classNames(\"mobius\", \"mobius/Divider\", className);\n\n return (\n <div\n className={classes}\n role=\"separator\"\n aria-orientation={ariaOrientation}\n {...rest}\n >\n <div className=\"mobius/DividerInner\" />\n </div>\n );\n};\n\nDivider.displayName = \"Divider\";\nexport { Divider };\n"],"names":["classNames","Divider","ariaOrientation","className","rest","classes","div","role","aria-orientation","displayName"],"mappings":";AAAA,OAAOA,gBAAgB,oBAAoB;AAS3C,MAAMC,UAAU,CAAC,EACf,oBAAoBC,kBAAkB,YAAY,EAClDC,SAAS,EACT,GAAGC,MACU;IACb,MAAMC,UAAUL,WAAW,UAAU,kBAAkBG;IAEvD,qBACE,KAACG;QACCH,WAAWE;QACXE,MAAK;QACLC,oBAAkBN;QACjB,GAAGE,IAAI;kBAER,cAAA,KAACE;YAAIH,WAAU;;;AAGrB;AAEAF,QAAQQ,WAAW,GAAG;AACtB,SAASR,OAAO,GAAG"}
1
+ {"version":3,"sources":["../../../../src/components/Divider/Divider.tsx"],"sourcesContent":["import classNames from \"classnames/dedupe\";\nimport { AriaAttributes } from \"react\";\nimport { DOMProps } from \"../../types/dom\";\n\nexport interface DividerProps extends DOMProps {\n className?: string;\n \"aria-orientation\"?: AriaAttributes[\"aria-orientation\"];\n}\n\nconst Divider = ({\n \"aria-orientation\": ariaOrientation = \"horizontal\",\n className,\n ...rest\n}: DividerProps) => {\n const classes = classNames(\"mobius\", \"mobius-divider\", className);\n\n return (\n <div\n className={classes}\n role=\"separator\"\n aria-orientation={ariaOrientation}\n {...rest}\n >\n <div className=\"mobius-divider__inner\" />\n </div>\n );\n};\n\nDivider.displayName = \"Divider\";\nexport { Divider };\n"],"names":["classNames","Divider","ariaOrientation","className","rest","classes","div","role","aria-orientation","displayName"],"mappings":";AAAA,OAAOA,gBAAgB,oBAAoB;AAS3C,MAAMC,UAAU,CAAC,EACf,oBAAoBC,kBAAkB,YAAY,EAClDC,SAAS,EACT,GAAGC,MACU;IACb,MAAMC,UAAUL,WAAW,UAAU,kBAAkBG;IAEvD,qBACE,KAACG;QACCH,WAAWE;QACXE,MAAK;QACLC,oBAAkBN;QACjB,GAAGE,IAAI;kBAER,cAAA,KAACE;YAAIH,WAAU;;;AAGrB;AAEAF,QAAQQ,WAAW,GAAG;AACtB,SAASR,OAAO,GAAG"}
@@ -3,7 +3,7 @@ import { forwardRef } from "react";
3
3
  const Content = /*#__PURE__*/ forwardRef(({ children, ...otherProps }, ref)=>/*#__PURE__*/ _jsx("div", {
4
4
  ref: ref,
5
5
  ...otherProps,
6
- className: "mobius/DrawerContent",
6
+ className: "mobius-drawer__content",
7
7
  children: children
8
8
  }));
9
9
  Content.displayName = "Content";
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/Drawer/Content.tsx"],"sourcesContent":["import { PropsWithChildren, Ref, RefAttributes, forwardRef } from \"react\";\nimport { DOMProps } from \"../../types/dom\";\n\nexport type DivRef = Ref<HTMLDivElement>;\nexport type DivElementType = HTMLDivElement;\nexport interface ContentProps\n extends DOMProps,\n RefAttributes<DivElementType>,\n PropsWithChildren {}\n\nconst Content = forwardRef(\n ({ children, ...otherProps }: ContentProps, ref: DivRef) => (\n <div ref={ref} {...otherProps} className=\"mobius/DrawerContent\">\n {children}\n </div>\n ),\n);\n\nContent.displayName = \"Content\";\nexport { Content };\n"],"names":["forwardRef","Content","children","otherProps","ref","div","className","displayName"],"mappings":";AAAA,SAAgDA,UAAU,QAAQ,QAAQ;AAU1E,MAAMC,wBAAUD,WACd,CAAC,EAAEE,QAAQ,EAAE,GAAGC,YAA0B,EAAEC,oBAC1C,KAACC;QAAID,KAAKA;QAAM,GAAGD,UAAU;QAAEG,WAAU;kBACtCJ;;AAKPD,QAAQM,WAAW,GAAG;AACtB,SAASN,OAAO,GAAG"}
1
+ {"version":3,"sources":["../../../../src/components/Drawer/Content.tsx"],"sourcesContent":["import { PropsWithChildren, Ref, RefAttributes, forwardRef } from \"react\";\nimport { DOMProps } from \"../../types/dom\";\n\nexport type DivRef = Ref<HTMLDivElement>;\nexport type DivElementType = HTMLDivElement;\nexport interface ContentProps\n extends DOMProps,\n RefAttributes<DivElementType>,\n PropsWithChildren {}\n\nconst Content = forwardRef(\n ({ children, ...otherProps }: ContentProps, ref: DivRef) => (\n <div ref={ref} {...otherProps} className=\"mobius-drawer__content\">\n {children}\n </div>\n ),\n);\n\nContent.displayName = \"Content\";\nexport { Content };\n"],"names":["forwardRef","Content","children","otherProps","ref","div","className","displayName"],"mappings":";AAAA,SAAgDA,UAAU,QAAQ,QAAQ;AAU1E,MAAMC,wBAAUD,WACd,CAAC,EAAEE,QAAQ,EAAE,GAAGC,YAA0B,EAAEC,oBAC1C,KAACC;QAAID,KAAKA;QAAM,GAAGD,UAAU;QAAEG,WAAU;kBACtCJ;;AAKPD,QAAQM,WAAW,GAAG;AACtB,SAASN,OAAO,GAAG"}
@@ -22,7 +22,7 @@ const Drawer = /*#__PURE__*/ forwardRef((props, ref)=>{
22
22
  }
23
23
  });
24
24
  const hiddenId = `screen-reader-announce-${useId()}`;
25
- const dialogClasses = classNames("mobius", "mobius/Drawer", `--${direction}`, className, {
25
+ const dialogClasses = classNames("mobius", "mobius-drawer", `--${direction}`, className, {
26
26
  "--should-transition": shouldTransition
27
27
  });
28
28
  useEffect(()=>{
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/Drawer/Drawer.tsx"],"sourcesContent":["\"use client\";\n\nimport classNames from \"classnames/dedupe\";\nimport {\n Ref,\n forwardRef,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { useDialog } from \"../../hooks\";\nimport { mergeRefs, supportsDialog } from \"../../utils\";\nimport { VisuallyHidden } from \"../VisuallyHidden\";\nimport { DrawerContext } from \"./DrawerContext\";\nimport { DrawerProps } from \"./types\";\n\nexport type DialogElementType = HTMLDialogElement;\nexport type DialogRef = Ref<DialogElementType>;\n\nconst TRANSITION_CSS_VARIABLE = \"--drawer-transition-duration\";\n\nconst Drawer = forwardRef((props: DrawerProps, ref: DialogRef) => {\n const {\n isOpen,\n className,\n closeLabel,\n direction,\n announce = \"Drawer opened on screen\",\n onOpen,\n onClose,\n children,\n } = props;\n const dialogRef = useRef<HTMLDialogElement | null>(null);\n const [shouldTransition, setShouldTransition] = useState(false);\n const { close } = useDialog({\n ref: dialogRef,\n isOpen,\n onOpen,\n onClose,\n transition: {\n isEnabled: true,\n CSSVariable: TRANSITION_CSS_VARIABLE,\n },\n });\n const hiddenId = `screen-reader-announce-${useId()}`;\n\n const dialogClasses = classNames(\n \"mobius\",\n \"mobius/Drawer\",\n `--${direction}`,\n className,\n {\n \"--should-transition\": shouldTransition,\n },\n );\n\n useEffect(() => {\n setShouldTransition(supportsDialog());\n }, []);\n\n const contextValue = useMemo(\n () => ({\n onClose: close,\n closeLabel,\n }),\n [close, closeLabel],\n );\n\n return (\n <dialog\n id={useId()}\n ref={mergeRefs([dialogRef, ref])}\n onCancel={close}\n className={dialogClasses}\n aria-describedby={hiddenId}\n >\n <VisuallyHidden>\n <div id={hiddenId}>{announce}</div>\n </VisuallyHidden>\n <DrawerContext.Provider value={contextValue}>\n {children}\n </DrawerContext.Provider>\n </dialog>\n );\n});\n\nDrawer.displayName = \"Drawer\";\nexport { Drawer };\n"],"names":["classNames","forwardRef","useEffect","useId","useMemo","useRef","useState","useDialog","mergeRefs","supportsDialog","VisuallyHidden","DrawerContext","TRANSITION_CSS_VARIABLE","Drawer","props","ref","isOpen","className","closeLabel","direction","announce","onOpen","onClose","children","dialogRef","shouldTransition","setShouldTransition","close","transition","isEnabled","CSSVariable","hiddenId","dialogClasses","contextValue","dialog","id","onCancel","aria-describedby","div","Provider","value","displayName"],"mappings":"AAAA;;AAEA,OAAOA,gBAAgB,oBAAoB;AAC3C,SAEEC,UAAU,EACVC,SAAS,EACTC,KAAK,EACLC,OAAO,EACPC,MAAM,EACNC,QAAQ,QACH,QAAQ;AACf,SAASC,SAAS,QAAQ,cAAc;AACxC,SAASC,SAAS,EAAEC,cAAc,QAAQ,cAAc;AACxD,SAASC,cAAc,QAAQ,oBAAoB;AACnD,SAASC,aAAa,QAAQ,kBAAkB;AAMhD,MAAMC,0BAA0B;AAEhC,MAAMC,uBAASZ,WAAW,CAACa,OAAoBC;IAC7C,MAAM,EACJC,MAAM,EACNC,SAAS,EACTC,UAAU,EACVC,SAAS,EACTC,WAAW,yBAAyB,EACpCC,MAAM,EACNC,OAAO,EACPC,QAAQ,EACT,GAAGT;IACJ,MAAMU,YAAYnB,OAAiC;IACnD,MAAM,CAACoB,kBAAkBC,oBAAoB,GAAGpB,SAAS;IACzD,MAAM,EAAEqB,KAAK,EAAE,GAAGpB,UAAU;QAC1BQ,KAAKS;QACLR;QACAK;QACAC;QACAM,YAAY;YACVC,WAAW;YACXC,aAAalB;QACf;IACF;IACA,MAAMmB,WAAW,CAAC,uBAAuB,EAAE5B,QAAQ,CAAC;IAEpD,MAAM6B,gBAAgBhC,WACpB,UACA,iBACA,CAAC,EAAE,EAAEmB,UAAU,CAAC,EAChBF,WACA;QACE,uBAAuBQ;IACzB;IAGFvB,UAAU;QACRwB,oBAAoBjB;IACtB,GAAG,EAAE;IAEL,MAAMwB,eAAe7B,QACnB,IAAO,CAAA;YACLkB,SAASK;YACTT;QACF,CAAA,GACA;QAACS;QAAOT;KAAW;IAGrB,qBACE,MAACgB;QACCC,IAAIhC;QACJY,KAAKP,UAAU;YAACgB;YAAWT;SAAI;QAC/BqB,UAAUT;QACVV,WAAWe;QACXK,oBAAkBN;;0BAElB,KAACrB;0BACC,cAAA,KAAC4B;oBAAIH,IAAIJ;8BAAWX;;;0BAEtB,KAACT,cAAc4B,QAAQ;gBAACC,OAAOP;0BAC5BV;;;;AAIT;AAEAV,OAAO4B,WAAW,GAAG;AACrB,SAAS5B,MAAM,GAAG"}
1
+ {"version":3,"sources":["../../../../src/components/Drawer/Drawer.tsx"],"sourcesContent":["\"use client\";\n\nimport classNames from \"classnames/dedupe\";\nimport {\n Ref,\n forwardRef,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { useDialog } from \"../../hooks\";\nimport { mergeRefs, supportsDialog } from \"../../utils\";\nimport { VisuallyHidden } from \"../VisuallyHidden\";\nimport { DrawerContext } from \"./DrawerContext\";\nimport { DrawerProps } from \"./types\";\n\nexport type DialogElementType = HTMLDialogElement;\nexport type DialogRef = Ref<DialogElementType>;\n\nconst TRANSITION_CSS_VARIABLE = \"--drawer-transition-duration\";\n\nconst Drawer = forwardRef((props: DrawerProps, ref: DialogRef) => {\n const {\n isOpen,\n className,\n closeLabel,\n direction,\n announce = \"Drawer opened on screen\",\n onOpen,\n onClose,\n children,\n } = props;\n const dialogRef = useRef<HTMLDialogElement | null>(null);\n const [shouldTransition, setShouldTransition] = useState(false);\n const { close } = useDialog({\n ref: dialogRef,\n isOpen,\n onOpen,\n onClose,\n transition: {\n isEnabled: true,\n CSSVariable: TRANSITION_CSS_VARIABLE,\n },\n });\n const hiddenId = `screen-reader-announce-${useId()}`;\n\n const dialogClasses = classNames(\n \"mobius\",\n \"mobius-drawer\",\n `--${direction}`,\n className,\n {\n \"--should-transition\": shouldTransition,\n },\n );\n\n useEffect(() => {\n setShouldTransition(supportsDialog());\n }, []);\n\n const contextValue = useMemo(\n () => ({\n onClose: close,\n closeLabel,\n }),\n [close, closeLabel],\n );\n\n return (\n <dialog\n id={useId()}\n ref={mergeRefs([dialogRef, ref])}\n onCancel={close}\n className={dialogClasses}\n aria-describedby={hiddenId}\n >\n <VisuallyHidden>\n <div id={hiddenId}>{announce}</div>\n </VisuallyHidden>\n <DrawerContext.Provider value={contextValue}>\n {children}\n </DrawerContext.Provider>\n </dialog>\n );\n});\n\nDrawer.displayName = \"Drawer\";\nexport { Drawer };\n"],"names":["classNames","forwardRef","useEffect","useId","useMemo","useRef","useState","useDialog","mergeRefs","supportsDialog","VisuallyHidden","DrawerContext","TRANSITION_CSS_VARIABLE","Drawer","props","ref","isOpen","className","closeLabel","direction","announce","onOpen","onClose","children","dialogRef","shouldTransition","setShouldTransition","close","transition","isEnabled","CSSVariable","hiddenId","dialogClasses","contextValue","dialog","id","onCancel","aria-describedby","div","Provider","value","displayName"],"mappings":"AAAA;;AAEA,OAAOA,gBAAgB,oBAAoB;AAC3C,SAEEC,UAAU,EACVC,SAAS,EACTC,KAAK,EACLC,OAAO,EACPC,MAAM,EACNC,QAAQ,QACH,QAAQ;AACf,SAASC,SAAS,QAAQ,cAAc;AACxC,SAASC,SAAS,EAAEC,cAAc,QAAQ,cAAc;AACxD,SAASC,cAAc,QAAQ,oBAAoB;AACnD,SAASC,aAAa,QAAQ,kBAAkB;AAMhD,MAAMC,0BAA0B;AAEhC,MAAMC,uBAASZ,WAAW,CAACa,OAAoBC;IAC7C,MAAM,EACJC,MAAM,EACNC,SAAS,EACTC,UAAU,EACVC,SAAS,EACTC,WAAW,yBAAyB,EACpCC,MAAM,EACNC,OAAO,EACPC,QAAQ,EACT,GAAGT;IACJ,MAAMU,YAAYnB,OAAiC;IACnD,MAAM,CAACoB,kBAAkBC,oBAAoB,GAAGpB,SAAS;IACzD,MAAM,EAAEqB,KAAK,EAAE,GAAGpB,UAAU;QAC1BQ,KAAKS;QACLR;QACAK;QACAC;QACAM,YAAY;YACVC,WAAW;YACXC,aAAalB;QACf;IACF;IACA,MAAMmB,WAAW,CAAC,uBAAuB,EAAE5B,QAAQ,CAAC;IAEpD,MAAM6B,gBAAgBhC,WACpB,UACA,iBACA,CAAC,EAAE,EAAEmB,UAAU,CAAC,EAChBF,WACA;QACE,uBAAuBQ;IACzB;IAGFvB,UAAU;QACRwB,oBAAoBjB;IACtB,GAAG,EAAE;IAEL,MAAMwB,eAAe7B,QACnB,IAAO,CAAA;YACLkB,SAASK;YACTT;QACF,CAAA,GACA;QAACS;QAAOT;KAAW;IAGrB,qBACE,MAACgB;QACCC,IAAIhC;QACJY,KAAKP,UAAU;YAACgB;YAAWT;SAAI;QAC/BqB,UAAUT;QACVV,WAAWe;QACXK,oBAAkBN;;0BAElB,KAACrB;0BACC,cAAA,KAAC4B;oBAAIH,IAAIJ;8BAAWX;;;0BAEtB,KAACT,cAAc4B,QAAQ;gBAACC,OAAOP;0BAC5BV;;;;AAIT;AAEAV,OAAO4B,WAAW,GAAG;AACrB,SAAS5B,MAAM,GAAG"}
@@ -9,14 +9,14 @@ const Header = /*#__PURE__*/ forwardRef(({ children, ...otherProps }, ref)=>{
9
9
  return /*#__PURE__*/ _jsxs("header", {
10
10
  ref: ref,
11
11
  ...otherProps,
12
- className: "mobius/DrawerHeader",
12
+ className: "mobius-drawer__header",
13
13
  children: [
14
14
  children,
15
15
  /*#__PURE__*/ _jsxs(Button, {
16
16
  "aria-label": "Close",
17
17
  variant: "basic",
18
18
  onPress: onClose,
19
- className: "mobius/DrawerClose",
19
+ className: "mobius-drawer__close",
20
20
  size: "sm",
21
21
  children: [
22
22
  /*#__PURE__*/ _jsx(Icon, {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/Drawer/Header.tsx"],"sourcesContent":["import { PropsWithChildren, Ref, RefAttributes, forwardRef } from \"react\";\n\nimport { cross } from \"@simplybusiness/icons\";\nimport { DOMProps } from \"../../types/dom\";\nimport { Button } from \"../Button\";\nimport { Icon } from \"../Icon\";\nimport { useDrawer } from \"./useDrawer\";\n\nexport type HeaderElementType = HTMLDivElement;\nexport type HeaderRef = Ref<HTMLElement>;\n\nexport interface HeaderProps\n extends DOMProps,\n RefAttributes<HeaderElementType>,\n PropsWithChildren {}\n\nconst Header = forwardRef(\n ({ children, ...otherProps }: HeaderProps, ref: HeaderRef) => {\n const { onClose, closeLabel } = useDrawer();\n\n return (\n <header ref={ref} {...otherProps} className=\"mobius/DrawerHeader\">\n {children}\n <Button\n aria-label=\"Close\"\n variant=\"basic\"\n onPress={onClose}\n className=\"mobius/DrawerClose\"\n size=\"sm\"\n >\n <Icon icon={cross} /> {closeLabel}\n </Button>\n </header>\n );\n },\n);\n\nHeader.displayName = \"Header\";\nexport { Header };\n"],"names":["forwardRef","cross","Button","Icon","useDrawer","Header","children","otherProps","ref","onClose","closeLabel","header","className","aria-label","variant","onPress","size","icon","displayName"],"mappings":";AAAA,SAAgDA,UAAU,QAAQ,QAAQ;AAE1E,SAASC,KAAK,QAAQ,wBAAwB;AAE9C,SAASC,MAAM,QAAQ,YAAY;AACnC,SAASC,IAAI,QAAQ,UAAU;AAC/B,SAASC,SAAS,QAAQ,cAAc;AAUxC,MAAMC,uBAASL,WACb,CAAC,EAAEM,QAAQ,EAAE,GAAGC,YAAyB,EAAEC;IACzC,MAAM,EAAEC,OAAO,EAAEC,UAAU,EAAE,GAAGN;IAEhC,qBACE,MAACO;QAAOH,KAAKA;QAAM,GAAGD,UAAU;QAAEK,WAAU;;YACzCN;0BACD,MAACJ;gBACCW,cAAW;gBACXC,SAAQ;gBACRC,SAASN;gBACTG,WAAU;gBACVI,MAAK;;kCAEL,KAACb;wBAAKc,MAAMhB;;oBAAS;oBAAES;;;;;AAI/B;AAGFL,OAAOa,WAAW,GAAG;AACrB,SAASb,MAAM,GAAG"}
1
+ {"version":3,"sources":["../../../../src/components/Drawer/Header.tsx"],"sourcesContent":["import { PropsWithChildren, Ref, RefAttributes, forwardRef } from \"react\";\n\nimport { cross } from \"@simplybusiness/icons\";\nimport { DOMProps } from \"../../types/dom\";\nimport { Button } from \"../Button\";\nimport { Icon } from \"../Icon\";\nimport { useDrawer } from \"./useDrawer\";\n\nexport type HeaderElementType = HTMLDivElement;\nexport type HeaderRef = Ref<HTMLElement>;\n\nexport interface HeaderProps\n extends DOMProps,\n RefAttributes<HeaderElementType>,\n PropsWithChildren {}\n\nconst Header = forwardRef(\n ({ children, ...otherProps }: HeaderProps, ref: HeaderRef) => {\n const { onClose, closeLabel } = useDrawer();\n\n return (\n <header ref={ref} {...otherProps} className=\"mobius-drawer__header\">\n {children}\n <Button\n aria-label=\"Close\"\n variant=\"basic\"\n onPress={onClose}\n className=\"mobius-drawer__close\"\n size=\"sm\"\n >\n <Icon icon={cross} /> {closeLabel}\n </Button>\n </header>\n );\n },\n);\n\nHeader.displayName = \"Header\";\nexport { Header };\n"],"names":["forwardRef","cross","Button","Icon","useDrawer","Header","children","otherProps","ref","onClose","closeLabel","header","className","aria-label","variant","onPress","size","icon","displayName"],"mappings":";AAAA,SAAgDA,UAAU,QAAQ,QAAQ;AAE1E,SAASC,KAAK,QAAQ,wBAAwB;AAE9C,SAASC,MAAM,QAAQ,YAAY;AACnC,SAASC,IAAI,QAAQ,UAAU;AAC/B,SAASC,SAAS,QAAQ,cAAc;AAUxC,MAAMC,uBAASL,WACb,CAAC,EAAEM,QAAQ,EAAE,GAAGC,YAAyB,EAAEC;IACzC,MAAM,EAAEC,OAAO,EAAEC,UAAU,EAAE,GAAGN;IAEhC,qBACE,MAACO;QAAOH,KAAKA;QAAM,GAAGD,UAAU;QAAEK,WAAU;;YACzCN;0BACD,MAACJ;gBACCW,cAAW;gBACXC,SAAQ;gBACRC,SAASN;gBACTG,WAAU;gBACVI,MAAK;;kCAEL,KAACb;wBAAKc,MAAMhB;;oBAAS;oBAAES;;;;;AAI/B;AAGFL,OAAOa,WAAW,GAAG;AACrB,SAASb,MAAM,GAAG"}
@@ -9,9 +9,9 @@ const DropdownMenu = /*#__PURE__*/ forwardRef((props, ref)=>{
9
9
  const [activeId, setActiveId] = useState(null);
10
10
  const numberOfItems = Children.count(children);
11
11
  const { buttonProps, itemProps, isOpen: open, setIsOpen } = useDropdownMenu(numberOfItems);
12
- const classes = classNames("mobius", "mobius/DropdownMenu", otherProps.className);
13
- const triggerClasses = classNames("mobius", "mobius/DropdownMenuTrigger");
14
- const listClasses = classNames("mobius", "mobius/DropdownMenuList", {
12
+ const classes = classNames("mobius", "mobius-dropdown-menu", otherProps.className);
13
+ const triggerClasses = classNames("mobius", "mobius-dropdown-menu__trigger");
14
+ const listClasses = classNames("mobius", "mobius-dropdown-menu__list", {
15
15
  "--is-open": open
16
16
  });
17
17
  const handleChildClick = ({ onClick }, index)=>{
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/DropdownMenu/DropdownMenu.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n Ref,\n forwardRef,\n RefAttributes,\n ReactNode,\n Children,\n isValidElement,\n cloneElement,\n useState,\n ReactElement,\n} from \"react\";\nimport useDropdownMenu from \"react-accessible-dropdown-menu-hook\";\nimport classNames from \"classnames/dedupe\";\nimport { DOMProps } from \"../../types/dom\";\n\nimport { Button } from \"../Button\";\nimport { ForwardedRefComponent } from \"../../types/components\";\n\nexport type DropdownMenuElementType = HTMLElement;\n\nexport interface DropdownMenuProps\n extends DOMProps,\n RefAttributes<DropdownMenuElementType> {\n children?: ReactNode;\n /** Custom class name for setting specific CSS */\n className?: string;\n elementType?: string | React.ElementType;\n label?: string;\n trigger?: ReactElement;\n}\n\nexport type DropdownMenuRef = Ref<DropdownMenuElementType>;\n\ntype ChildClickProps = {\n onClick?: () => void;\n};\n\nconst DropdownMenu: ForwardedRefComponent<\n DropdownMenuProps,\n DropdownMenuElementType\n> = forwardRef((props: DropdownMenuProps, ref: DropdownMenuRef) => {\n const {\n elementType: Element = \"nav\",\n trigger,\n label = \"Menu\",\n children,\n ...otherProps\n } = props;\n const [activeId, setActiveId] = useState<number | null>(null);\n const numberOfItems = Children.count(children);\n const {\n buttonProps,\n itemProps,\n isOpen: open,\n setIsOpen,\n } = useDropdownMenu(numberOfItems);\n\n const classes = classNames(\n \"mobius\",\n \"mobius/DropdownMenu\",\n otherProps.className,\n );\n const triggerClasses = classNames(\"mobius\", \"mobius/DropdownMenuTrigger\");\n const listClasses = classNames(\"mobius\", \"mobius/DropdownMenuList\", {\n \"--is-open\": open,\n });\n\n const handleChildClick = ({ onClick }: ChildClickProps, index: number) => {\n setActiveId(index);\n setIsOpen(false);\n\n if (onClick) {\n onClick();\n }\n };\n\n return (\n <Element ref={ref} {...otherProps} className={classes}>\n {trigger ? (\n cloneElement(trigger, {\n className: triggerClasses,\n open,\n label,\n ...buttonProps,\n })\n ) : (\n <Button className={triggerClasses} {...buttonProps}>\n {label}\n </Button>\n )}\n <ul className={listClasses} role=\"menu\">\n {Children.map(children, (child, index) => {\n if (isValidElement(child)) {\n return cloneElement(child, {\n onClick: () => handleChildClick(child.props, index),\n active: index === activeId,\n ...itemProps[index],\n } as any);\n }\n\n return child;\n })}\n </ul>\n </Element>\n );\n});\n\nDropdownMenu.displayName = \"DropdownMenu\";\nexport { DropdownMenu };\n"],"names":["forwardRef","Children","isValidElement","cloneElement","useState","useDropdownMenu","classNames","Button","DropdownMenu","props","ref","elementType","Element","trigger","label","children","otherProps","activeId","setActiveId","numberOfItems","count","buttonProps","itemProps","isOpen","open","setIsOpen","classes","className","triggerClasses","listClasses","handleChildClick","onClick","index","ul","role","map","child","active","displayName"],"mappings":"AAAA;;AAEA,SAEEA,UAAU,EAGVC,QAAQ,EACRC,cAAc,EACdC,YAAY,EACZC,QAAQ,QAEH,QAAQ;AACf,OAAOC,qBAAqB,sCAAsC;AAClE,OAAOC,gBAAgB,oBAAoB;AAG3C,SAASC,MAAM,QAAQ,YAAY;AAsBnC,MAAMC,6BAGFR,WAAW,CAACS,OAA0BC;IACxC,MAAM,EACJC,aAAaC,UAAU,KAAK,EAC5BC,OAAO,EACPC,QAAQ,MAAM,EACdC,QAAQ,EACR,GAAGC,YACJ,GAAGP;IACJ,MAAM,CAACQ,UAAUC,YAAY,GAAGd,SAAwB;IACxD,MAAMe,gBAAgBlB,SAASmB,KAAK,CAACL;IACrC,MAAM,EACJM,WAAW,EACXC,SAAS,EACTC,QAAQC,IAAI,EACZC,SAAS,EACV,GAAGpB,gBAAgBc;IAEpB,MAAMO,UAAUpB,WACd,UACA,uBACAU,WAAWW,SAAS;IAEtB,MAAMC,iBAAiBtB,WAAW,UAAU;IAC5C,MAAMuB,cAAcvB,WAAW,UAAU,2BAA2B;QAClE,aAAakB;IACf;IAEA,MAAMM,mBAAmB,CAAC,EAAEC,OAAO,EAAmB,EAAEC;QACtDd,YAAYc;QACZP,UAAU;QAEV,IAAIM,SAAS;YACXA;QACF;IACF;IAEA,qBACE,MAACnB;QAAQF,KAAKA;QAAM,GAAGM,UAAU;QAAEW,WAAWD;;YAC3Cb,wBACCV,aAAaU,SAAS;gBACpBc,WAAWC;gBACXJ;gBACAV;gBACA,GAAGO,WAAW;YAChB,mBAEA,KAACd;gBAAOoB,WAAWC;gBAAiB,GAAGP,WAAW;0BAC/CP;;0BAGL,KAACmB;gBAAGN,WAAWE;gBAAaK,MAAK;0BAC9BjC,SAASkC,GAAG,CAACpB,UAAU,CAACqB,OAAOJ;oBAC9B,kBAAI9B,eAAekC,QAAQ;wBACzB,qBAAOjC,aAAaiC,OAAO;4BACzBL,SAAS,IAAMD,iBAAiBM,MAAM3B,KAAK,EAAEuB;4BAC7CK,QAAQL,UAAUf;4BAClB,GAAGK,SAAS,CAACU,MAAM;wBACrB;oBACF;oBAEA,OAAOI;gBACT;;;;AAIR;AAEA5B,aAAa8B,WAAW,GAAG;AAC3B,SAAS9B,YAAY,GAAG"}
1
+ {"version":3,"sources":["../../../../src/components/DropdownMenu/DropdownMenu.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n Ref,\n forwardRef,\n RefAttributes,\n ReactNode,\n Children,\n isValidElement,\n cloneElement,\n useState,\n ReactElement,\n} from \"react\";\nimport useDropdownMenu from \"react-accessible-dropdown-menu-hook\";\nimport classNames from \"classnames/dedupe\";\nimport { DOMProps } from \"../../types/dom\";\n\nimport { Button } from \"../Button\";\nimport { ForwardedRefComponent } from \"../../types/components\";\n\nexport type DropdownMenuElementType = HTMLElement;\n\nexport interface DropdownMenuProps\n extends DOMProps,\n RefAttributes<DropdownMenuElementType> {\n children?: ReactNode;\n /** Custom class name for setting specific CSS */\n className?: string;\n elementType?: string | React.ElementType;\n label?: string;\n trigger?: ReactElement;\n}\n\nexport type DropdownMenuRef = Ref<DropdownMenuElementType>;\n\ntype ChildClickProps = {\n onClick?: () => void;\n};\n\nconst DropdownMenu: ForwardedRefComponent<\n DropdownMenuProps,\n DropdownMenuElementType\n> = forwardRef((props: DropdownMenuProps, ref: DropdownMenuRef) => {\n const {\n elementType: Element = \"nav\",\n trigger,\n label = \"Menu\",\n children,\n ...otherProps\n } = props;\n const [activeId, setActiveId] = useState<number | null>(null);\n const numberOfItems = Children.count(children);\n const {\n buttonProps,\n itemProps,\n isOpen: open,\n setIsOpen,\n } = useDropdownMenu(numberOfItems);\n\n const classes = classNames(\n \"mobius\",\n \"mobius-dropdown-menu\",\n otherProps.className,\n );\n const triggerClasses = classNames(\"mobius\", \"mobius-dropdown-menu__trigger\");\n const listClasses = classNames(\"mobius\", \"mobius-dropdown-menu__list\", {\n \"--is-open\": open,\n });\n\n const handleChildClick = ({ onClick }: ChildClickProps, index: number) => {\n setActiveId(index);\n setIsOpen(false);\n\n if (onClick) {\n onClick();\n }\n };\n\n return (\n <Element ref={ref} {...otherProps} className={classes}>\n {trigger ? (\n cloneElement(trigger, {\n className: triggerClasses,\n open,\n label,\n ...buttonProps,\n })\n ) : (\n <Button className={triggerClasses} {...buttonProps}>\n {label}\n </Button>\n )}\n <ul className={listClasses} role=\"menu\">\n {Children.map(children, (child, index) => {\n if (isValidElement(child)) {\n return cloneElement(child, {\n onClick: () => handleChildClick(child.props, index),\n active: index === activeId,\n ...itemProps[index],\n } as any);\n }\n\n return child;\n })}\n </ul>\n </Element>\n );\n});\n\nDropdownMenu.displayName = \"DropdownMenu\";\nexport { DropdownMenu };\n"],"names":["forwardRef","Children","isValidElement","cloneElement","useState","useDropdownMenu","classNames","Button","DropdownMenu","props","ref","elementType","Element","trigger","label","children","otherProps","activeId","setActiveId","numberOfItems","count","buttonProps","itemProps","isOpen","open","setIsOpen","classes","className","triggerClasses","listClasses","handleChildClick","onClick","index","ul","role","map","child","active","displayName"],"mappings":"AAAA;;AAEA,SAEEA,UAAU,EAGVC,QAAQ,EACRC,cAAc,EACdC,YAAY,EACZC,QAAQ,QAEH,QAAQ;AACf,OAAOC,qBAAqB,sCAAsC;AAClE,OAAOC,gBAAgB,oBAAoB;AAG3C,SAASC,MAAM,QAAQ,YAAY;AAsBnC,MAAMC,6BAGFR,WAAW,CAACS,OAA0BC;IACxC,MAAM,EACJC,aAAaC,UAAU,KAAK,EAC5BC,OAAO,EACPC,QAAQ,MAAM,EACdC,QAAQ,EACR,GAAGC,YACJ,GAAGP;IACJ,MAAM,CAACQ,UAAUC,YAAY,GAAGd,SAAwB;IACxD,MAAMe,gBAAgBlB,SAASmB,KAAK,CAACL;IACrC,MAAM,EACJM,WAAW,EACXC,SAAS,EACTC,QAAQC,IAAI,EACZC,SAAS,EACV,GAAGpB,gBAAgBc;IAEpB,MAAMO,UAAUpB,WACd,UACA,wBACAU,WAAWW,SAAS;IAEtB,MAAMC,iBAAiBtB,WAAW,UAAU;IAC5C,MAAMuB,cAAcvB,WAAW,UAAU,8BAA8B;QACrE,aAAakB;IACf;IAEA,MAAMM,mBAAmB,CAAC,EAAEC,OAAO,EAAmB,EAAEC;QACtDd,YAAYc;QACZP,UAAU;QAEV,IAAIM,SAAS;YACXA;QACF;IACF;IAEA,qBACE,MAACnB;QAAQF,KAAKA;QAAM,GAAGM,UAAU;QAAEW,WAAWD;;YAC3Cb,wBACCV,aAAaU,SAAS;gBACpBc,WAAWC;gBACXJ;gBACAV;gBACA,GAAGO,WAAW;YAChB,mBAEA,KAACd;gBAAOoB,WAAWC;gBAAiB,GAAGP,WAAW;0BAC/CP;;0BAGL,KAACmB;gBAAGN,WAAWE;gBAAaK,MAAK;0BAC9BjC,SAASkC,GAAG,CAACpB,UAAU,CAACqB,OAAOJ;oBAC9B,kBAAI9B,eAAekC,QAAQ;wBACzB,qBAAOjC,aAAaiC,OAAO;4BACzBL,SAAS,IAAMD,iBAAiBM,MAAM3B,KAAK,EAAEuB;4BAC7CK,QAAQL,UAAUf;4BAClB,GAAGK,SAAS,CAACU,MAAM;wBACrB;oBACF;oBAEA,OAAOI;gBACT;;;;AAIR;AAEA5B,aAAa8B,WAAW,GAAG;AAC3B,SAAS9B,YAAY,GAAG"}
@@ -3,7 +3,7 @@ import { forwardRef, cloneElement, isValidElement, Children } from "react";
3
3
  import classNames from "classnames/dedupe";
4
4
  const Item = /*#__PURE__*/ forwardRef((props, ref)=>{
5
5
  const { elementType: Element = "li", active, onClick, children, ...otherProps } = props;
6
- const classes = classNames("mobius", "mobius/DropdownMenuItem", {
6
+ const classes = classNames("mobius", "mobius-dropdown-menu__item", {
7
7
  "--is-active": active
8
8
  }, otherProps.className);
9
9
  return /*#__PURE__*/ _jsx(Element, {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/DropdownMenu/Item.tsx"],"sourcesContent":["import {\n Ref,\n forwardRef,\n RefAttributes,\n ReactNode,\n cloneElement,\n ReactElement,\n isValidElement,\n Children,\n} from \"react\";\nimport classNames from \"classnames/dedupe\";\nimport { DOMProps } from \"../../types/dom\";\nimport { ForwardedRefComponent } from \"../../types/components\";\n\nexport type ItemElementType = HTMLLIElement;\n\nexport interface ItemProps extends DOMProps, RefAttributes<ItemElementType> {\n elementType?: string | React.ElementType;\n /** Custom class name for setting specific CSS */\n className?: string;\n active?: boolean;\n children?: ReactNode;\n onClick?: () => void;\n}\n\nexport type ItemRef = Ref<ItemElementType>;\n\nconst Item: ForwardedRefComponent<ItemProps, ItemElementType> = forwardRef(\n (props: ItemProps, ref: ItemRef) => {\n const {\n elementType: Element = \"li\",\n active,\n onClick,\n children,\n ...otherProps\n } = props;\n const classes = classNames(\n \"mobius\",\n \"mobius/DropdownMenuItem\",\n { \"--is-active\": active },\n otherProps.className,\n );\n\n return (\n <Element ref={ref} onClick={onClick} {...otherProps}>\n {Children.map(children, child => {\n if (isValidElement(child)) {\n const childClasses = classNames(child.props.className, classes);\n return cloneElement(child as ReactElement, {\n className: childClasses,\n });\n }\n\n return <span className={classes}>{child}</span>;\n })}\n </Element>\n );\n },\n);\n\nItem.displayName = \"DropdownMenu.Item\";\nexport { Item };\n"],"names":["forwardRef","cloneElement","isValidElement","Children","classNames","Item","props","ref","elementType","Element","active","onClick","children","otherProps","classes","className","map","child","childClasses","span","displayName"],"mappings":";AAAA,SAEEA,UAAU,EAGVC,YAAY,EAEZC,cAAc,EACdC,QAAQ,QACH,QAAQ;AACf,OAAOC,gBAAgB,oBAAoB;AAiB3C,MAAMC,qBAA0DL,WAC9D,CAACM,OAAkBC;IACjB,MAAM,EACJC,aAAaC,UAAU,IAAI,EAC3BC,MAAM,EACNC,OAAO,EACPC,QAAQ,EACR,GAAGC,YACJ,GAAGP;IACJ,MAAMQ,UAAUV,WACd,UACA,2BACA;QAAE,eAAeM;IAAO,GACxBG,WAAWE,SAAS;IAGtB,qBACE,KAACN;QAAQF,KAAKA;QAAKI,SAASA;QAAU,GAAGE,UAAU;kBAChDV,SAASa,GAAG,CAACJ,UAAUK,CAAAA;YACtB,kBAAIf,eAAee,QAAQ;gBACzB,MAAMC,eAAed,WAAWa,MAAMX,KAAK,CAACS,SAAS,EAAED;gBACvD,qBAAOb,aAAagB,OAAuB;oBACzCF,WAAWG;gBACb;YACF;YAEA,qBAAO,KAACC;gBAAKJ,WAAWD;0BAAUG;;QACpC;;AAGN;AAGFZ,KAAKe,WAAW,GAAG;AACnB,SAASf,IAAI,GAAG"}
1
+ {"version":3,"sources":["../../../../src/components/DropdownMenu/Item.tsx"],"sourcesContent":["import {\n Ref,\n forwardRef,\n RefAttributes,\n ReactNode,\n cloneElement,\n ReactElement,\n isValidElement,\n Children,\n} from \"react\";\nimport classNames from \"classnames/dedupe\";\nimport { DOMProps } from \"../../types/dom\";\nimport { ForwardedRefComponent } from \"../../types/components\";\n\nexport type ItemElementType = HTMLLIElement;\n\nexport interface ItemProps extends DOMProps, RefAttributes<ItemElementType> {\n elementType?: string | React.ElementType;\n /** Custom class name for setting specific CSS */\n className?: string;\n active?: boolean;\n children?: ReactNode;\n onClick?: () => void;\n}\n\nexport type ItemRef = Ref<ItemElementType>;\n\nconst Item: ForwardedRefComponent<ItemProps, ItemElementType> = forwardRef(\n (props: ItemProps, ref: ItemRef) => {\n const {\n elementType: Element = \"li\",\n active,\n onClick,\n children,\n ...otherProps\n } = props;\n const classes = classNames(\n \"mobius\",\n \"mobius-dropdown-menu__item\",\n { \"--is-active\": active },\n otherProps.className,\n );\n\n return (\n <Element ref={ref} onClick={onClick} {...otherProps}>\n {Children.map(children, child => {\n if (isValidElement(child)) {\n const childClasses = classNames(child.props.className, classes);\n return cloneElement(child as ReactElement, {\n className: childClasses,\n });\n }\n\n return <span className={classes}>{child}</span>;\n })}\n </Element>\n );\n },\n);\n\nItem.displayName = \"DropdownMenu.Item\";\nexport { Item };\n"],"names":["forwardRef","cloneElement","isValidElement","Children","classNames","Item","props","ref","elementType","Element","active","onClick","children","otherProps","classes","className","map","child","childClasses","span","displayName"],"mappings":";AAAA,SAEEA,UAAU,EAGVC,YAAY,EAEZC,cAAc,EACdC,QAAQ,QACH,QAAQ;AACf,OAAOC,gBAAgB,oBAAoB;AAiB3C,MAAMC,qBAA0DL,WAC9D,CAACM,OAAkBC;IACjB,MAAM,EACJC,aAAaC,UAAU,IAAI,EAC3BC,MAAM,EACNC,OAAO,EACPC,QAAQ,EACR,GAAGC,YACJ,GAAGP;IACJ,MAAMQ,UAAUV,WACd,UACA,8BACA;QAAE,eAAeM;IAAO,GACxBG,WAAWE,SAAS;IAGtB,qBACE,KAACN;QAAQF,KAAKA;QAAKI,SAASA;QAAU,GAAGE,UAAU;kBAChDV,SAASa,GAAG,CAACJ,UAAUK,CAAAA;YACtB,kBAAIf,eAAee,QAAQ;gBACzB,MAAMC,eAAed,WAAWa,MAAMX,KAAK,CAACS,SAAS,EAAED;gBACvD,qBAAOb,aAAagB,OAAuB;oBACzCF,WAAWG;gBACb;YACF;YAEA,qBAAO,KAACC;gBAAKJ,WAAWD;0BAAUG;;QACpC;;AAGN;AAGFZ,KAAKe,WAAW,GAAG;AACnB,SAASf,IAAI,GAAG"}
@@ -1,20 +1,23 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import classNames from "classnames/dedupe";
3
+ import { error } from "@simplybusiness/icons";
3
4
  import { Text } from "../Text";
5
+ import { Icon } from "../Icon";
4
6
  export const ErrorMessage = ({ id, errorMessage, className })=>{
5
- const classes = classNames("mobius", "mobius/ErrorMessage", className);
7
+ const classes = classNames("mobius", "mobius-error-message", className);
6
8
  if (!errorMessage) return null;
7
9
  return /*#__PURE__*/ _jsxs("div", {
8
10
  id: id,
9
11
  className: classes,
10
12
  "data-testid": "ErrorMessage",
11
13
  children: [
12
- /*#__PURE__*/ _jsx("span", {
13
- className: "mobius/ErrorIcon"
14
+ /*#__PURE__*/ _jsx(Icon, {
15
+ icon: error,
16
+ className: "mobius-error-message__icon"
14
17
  }),
15
18
  /*#__PURE__*/ _jsx(Text, {
16
19
  elementType: "span",
17
- className: "mobius/ErrorText",
20
+ className: "mobius-error-message__text",
18
21
  children: errorMessage
19
22
  })
20
23
  ]
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/ErrorMessage/ErrorMessage.tsx"],"sourcesContent":["import classNames from \"classnames/dedupe\";\nimport { Text } from \"../Text\";\n\nexport interface ErrorMessageProps {\n errorMessage?: string;\n id?: string;\n className?: string;\n}\n\nexport const ErrorMessage = ({\n id,\n errorMessage,\n className,\n}: ErrorMessageProps) => {\n const classes = classNames(\"mobius\", \"mobius/ErrorMessage\", className);\n\n if (!errorMessage) return null;\n\n return (\n <div id={id} className={classes} data-testid=\"ErrorMessage\">\n <span className=\"mobius/ErrorIcon\" />\n <Text elementType=\"span\" className=\"mobius/ErrorText\">\n {errorMessage}\n </Text>\n </div>\n );\n};\n\nErrorMessage.displayName = \"ErrorMessage\";\n"],"names":["classNames","Text","ErrorMessage","id","errorMessage","className","classes","div","data-testid","span","elementType","displayName"],"mappings":";AAAA,OAAOA,gBAAgB,oBAAoB;AAC3C,SAASC,IAAI,QAAQ,UAAU;AAQ/B,OAAO,MAAMC,eAAe,CAAC,EAC3BC,EAAE,EACFC,YAAY,EACZC,SAAS,EACS;IAClB,MAAMC,UAAUN,WAAW,UAAU,uBAAuBK;IAE5D,IAAI,CAACD,cAAc,OAAO;IAE1B,qBACE,MAACG;QAAIJ,IAAIA;QAAIE,WAAWC;QAASE,eAAY;;0BAC3C,KAACC;gBAAKJ,WAAU;;0BAChB,KAACJ;gBAAKS,aAAY;gBAAOL,WAAU;0BAChCD;;;;AAIT,EAAE;AAEFF,aAAaS,WAAW,GAAG"}
1
+ {"version":3,"sources":["../../../../src/components/ErrorMessage/ErrorMessage.tsx"],"sourcesContent":["import classNames from \"classnames/dedupe\";\nimport { error } from \"@simplybusiness/icons\";\nimport { Text } from \"../Text\";\nimport { Icon } from \"../Icon\";\n\nexport interface ErrorMessageProps {\n errorMessage?: string;\n id?: string;\n className?: string;\n}\n\nexport const ErrorMessage = ({\n id,\n errorMessage,\n className,\n}: ErrorMessageProps) => {\n const classes = classNames(\"mobius\", \"mobius-error-message\", className);\n\n if (!errorMessage) return null;\n\n return (\n <div id={id} className={classes} data-testid=\"ErrorMessage\">\n <Icon icon={error} className=\"mobius-error-message__icon\" />\n <Text elementType=\"span\" className=\"mobius-error-message__text\">\n {errorMessage}\n </Text>\n </div>\n );\n};\n\nErrorMessage.displayName = \"ErrorMessage\";\n"],"names":["classNames","error","Text","Icon","ErrorMessage","id","errorMessage","className","classes","div","data-testid","icon","elementType","displayName"],"mappings":";AAAA,OAAOA,gBAAgB,oBAAoB;AAC3C,SAASC,KAAK,QAAQ,wBAAwB;AAC9C,SAASC,IAAI,QAAQ,UAAU;AAC/B,SAASC,IAAI,QAAQ,UAAU;AAQ/B,OAAO,MAAMC,eAAe,CAAC,EAC3BC,EAAE,EACFC,YAAY,EACZC,SAAS,EACS;IAClB,MAAMC,UAAUR,WAAW,UAAU,wBAAwBO;IAE7D,IAAI,CAACD,cAAc,OAAO;IAE1B,qBACE,MAACG;QAAIJ,IAAIA;QAAIE,WAAWC;QAASE,eAAY;;0BAC3C,KAACP;gBAAKQ,MAAMV;gBAAOM,WAAU;;0BAC7B,KAACL;gBAAKU,aAAY;gBAAOL,WAAU;0BAChCD;;;;AAIT,EAAE;AAEFF,aAAaS,WAAW,GAAG"}