@simplybusiness/mobius 5.25.2 → 5.26.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 (777) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/cjs/index.js +4163 -17
  3. package/dist/cjs/tsconfig.tsbuildinfo +1 -1
  4. package/dist/esm/index.js +4169 -5
  5. package/dist/types/src/components/Switch/Switch.d.ts +1 -0
  6. package/package.json +8 -7
  7. package/src/components/Combobox/Combobox.test.tsx +3 -3
  8. package/src/components/Switch/Switch.css +20 -0
  9. package/src/components/Switch/Switch.test.tsx +8 -0
  10. package/src/components/Switch/Switch.tsx +10 -1
  11. package/src/hooks/useDialogPolyfill/useDialogPolyfill.ts +4 -2
  12. package/dist/cjs/components/Accordion/Accordion.js +0 -162
  13. package/dist/cjs/components/Accordion/Accordion.js.map +0 -1
  14. package/dist/cjs/components/Accordion/index.js +0 -20
  15. package/dist/cjs/components/Accordion/index.js.map +0 -1
  16. package/dist/cjs/components/AddressLookup/AddressLookup.js +0 -76
  17. package/dist/cjs/components/AddressLookup/AddressLookup.js.map +0 -1
  18. package/dist/cjs/components/AddressLookup/LoqateAddressLookupError.js +0 -32
  19. package/dist/cjs/components/AddressLookup/LoqateAddressLookupError.js.map +0 -1
  20. package/dist/cjs/components/AddressLookup/LoqateAddressLookupService.js +0 -110
  21. package/dist/cjs/components/AddressLookup/LoqateAddressLookupService.js.map +0 -1
  22. package/dist/cjs/components/AddressLookup/index.js +0 -22
  23. package/dist/cjs/components/AddressLookup/index.js.map +0 -1
  24. package/dist/cjs/components/AddressLookup/types.js +0 -6
  25. package/dist/cjs/components/AddressLookup/types.js.map +0 -1
  26. package/dist/cjs/components/AddressLookup/utils.js +0 -15
  27. package/dist/cjs/components/AddressLookup/utils.js.map +0 -1
  28. package/dist/cjs/components/Alert/Alert.js +0 -69
  29. package/dist/cjs/components/Alert/Alert.js.map +0 -1
  30. package/dist/cjs/components/Alert/index.js +0 -20
  31. package/dist/cjs/components/Alert/index.js.map +0 -1
  32. package/dist/cjs/components/Box/Box.js +0 -48
  33. package/dist/cjs/components/Box/Box.js.map +0 -1
  34. package/dist/cjs/components/Box/index.js +0 -20
  35. package/dist/cjs/components/Box/index.js.map +0 -1
  36. package/dist/cjs/components/Box/types.js +0 -6
  37. package/dist/cjs/components/Box/types.js.map +0 -1
  38. package/dist/cjs/components/Breadcrumbs/BreadcrumbItem.js +0 -54
  39. package/dist/cjs/components/Breadcrumbs/BreadcrumbItem.js.map +0 -1
  40. package/dist/cjs/components/Breadcrumbs/Breadcrumbs.js +0 -45
  41. package/dist/cjs/components/Breadcrumbs/Breadcrumbs.js.map +0 -1
  42. package/dist/cjs/components/Breadcrumbs/index.js +0 -21
  43. package/dist/cjs/components/Breadcrumbs/index.js.map +0 -1
  44. package/dist/cjs/components/Button/Button.js +0 -64
  45. package/dist/cjs/components/Button/Button.js.map +0 -1
  46. package/dist/cjs/components/Button/Loading.js +0 -36
  47. package/dist/cjs/components/Button/Loading.js.map +0 -1
  48. package/dist/cjs/components/Button/Success.js +0 -31
  49. package/dist/cjs/components/Button/Success.js.map +0 -1
  50. package/dist/cjs/components/Button/index.js +0 -20
  51. package/dist/cjs/components/Button/index.js.map +0 -1
  52. package/dist/cjs/components/Checkbox/Checkbox.js +0 -115
  53. package/dist/cjs/components/Checkbox/Checkbox.js.map +0 -1
  54. package/dist/cjs/components/Checkbox/CheckboxGroup.js +0 -119
  55. package/dist/cjs/components/Checkbox/CheckboxGroup.js.map +0 -1
  56. package/dist/cjs/components/Checkbox/index.js +0 -22
  57. package/dist/cjs/components/Checkbox/index.js.map +0 -1
  58. package/dist/cjs/components/Checkbox/types.js +0 -6
  59. package/dist/cjs/components/Checkbox/types.js.map +0 -1
  60. package/dist/cjs/components/Combobox/Combobox.js +0 -225
  61. package/dist/cjs/components/Combobox/Combobox.js.map +0 -1
  62. package/dist/cjs/components/Combobox/Listbox.js +0 -72
  63. package/dist/cjs/components/Combobox/Listbox.js.map +0 -1
  64. package/dist/cjs/components/Combobox/Option.js +0 -47
  65. package/dist/cjs/components/Combobox/Option.js.map +0 -1
  66. package/dist/cjs/components/Combobox/fixtures.js +0 -550
  67. package/dist/cjs/components/Combobox/fixtures.js.map +0 -1
  68. package/dist/cjs/components/Combobox/index.js +0 -21
  69. package/dist/cjs/components/Combobox/index.js.map +0 -1
  70. package/dist/cjs/components/Combobox/types.js +0 -6
  71. package/dist/cjs/components/Combobox/types.js.map +0 -1
  72. package/dist/cjs/components/Combobox/useComboboxHighlight.js +0 -92
  73. package/dist/cjs/components/Combobox/useComboboxHighlight.js.map +0 -1
  74. package/dist/cjs/components/Combobox/useComboboxOptions.js +0 -81
  75. package/dist/cjs/components/Combobox/useComboboxOptions.js.map +0 -1
  76. package/dist/cjs/components/Combobox/utils.js +0 -47
  77. package/dist/cjs/components/Combobox/utils.js.map +0 -1
  78. package/dist/cjs/components/Container/Container.js +0 -31
  79. package/dist/cjs/components/Container/Container.js.map +0 -1
  80. package/dist/cjs/components/Container/index.js +0 -20
  81. package/dist/cjs/components/Container/index.js.map +0 -1
  82. package/dist/cjs/components/Divider/Divider.js +0 -32
  83. package/dist/cjs/components/Divider/Divider.js.map +0 -1
  84. package/dist/cjs/components/Divider/index.js +0 -20
  85. package/dist/cjs/components/Divider/index.js.map +0 -1
  86. package/dist/cjs/components/Drawer/Content.js +0 -21
  87. package/dist/cjs/components/Drawer/Content.js.map +0 -1
  88. package/dist/cjs/components/Drawer/Drawer.js +0 -78
  89. package/dist/cjs/components/Drawer/Drawer.js.map +0 -1
  90. package/dist/cjs/components/Drawer/DrawerContext.js +0 -17
  91. package/dist/cjs/components/Drawer/DrawerContext.js.map +0 -1
  92. package/dist/cjs/components/Drawer/Header.js +0 -44
  93. package/dist/cjs/components/Drawer/Header.js.map +0 -1
  94. package/dist/cjs/components/Drawer/index.js +0 -29
  95. package/dist/cjs/components/Drawer/index.js.map +0 -1
  96. package/dist/cjs/components/Drawer/types.js +0 -6
  97. package/dist/cjs/components/Drawer/types.js.map +0 -1
  98. package/dist/cjs/components/Drawer/useDrawer.js +0 -21
  99. package/dist/cjs/components/Drawer/useDrawer.js.map +0 -1
  100. package/dist/cjs/components/DropdownMenu/DropdownMenu.js +0 -73
  101. package/dist/cjs/components/DropdownMenu/DropdownMenu.js.map +0 -1
  102. package/dist/cjs/components/DropdownMenu/Item.js +0 -44
  103. package/dist/cjs/components/DropdownMenu/Item.js.map +0 -1
  104. package/dist/cjs/components/DropdownMenu/index.js +0 -18
  105. package/dist/cjs/components/DropdownMenu/index.js.map +0 -1
  106. package/dist/cjs/components/ErrorMessage/ErrorMessage.js +0 -44
  107. package/dist/cjs/components/ErrorMessage/ErrorMessage.js.map +0 -1
  108. package/dist/cjs/components/ErrorMessage/index.js +0 -20
  109. package/dist/cjs/components/ErrorMessage/index.js.map +0 -1
  110. package/dist/cjs/components/Fieldset/Fieldset.js +0 -65
  111. package/dist/cjs/components/Fieldset/Fieldset.js.map +0 -1
  112. package/dist/cjs/components/Fieldset/index.js +0 -20
  113. package/dist/cjs/components/Fieldset/index.js.map +0 -1
  114. package/dist/cjs/components/Flex/Flex.js +0 -37
  115. package/dist/cjs/components/Flex/Flex.js.map +0 -1
  116. package/dist/cjs/components/Flex/index.js +0 -21
  117. package/dist/cjs/components/Flex/index.js.map +0 -1
  118. package/dist/cjs/components/Flex/propUtils.js +0 -56
  119. package/dist/cjs/components/Flex/propUtils.js.map +0 -1
  120. package/dist/cjs/components/Flex/types.js +0 -6
  121. package/dist/cjs/components/Flex/types.js.map +0 -1
  122. package/dist/cjs/components/Grid/Grid.js +0 -44
  123. package/dist/cjs/components/Grid/Grid.js.map +0 -1
  124. package/dist/cjs/components/Grid/Item.js +0 -76
  125. package/dist/cjs/components/Grid/Item.js.map +0 -1
  126. package/dist/cjs/components/Grid/index.js +0 -18
  127. package/dist/cjs/components/Grid/index.js.map +0 -1
  128. package/dist/cjs/components/Icon/Icon.js +0 -57
  129. package/dist/cjs/components/Icon/Icon.js.map +0 -1
  130. package/dist/cjs/components/Icon/index.js +0 -21
  131. package/dist/cjs/components/Icon/index.js.map +0 -1
  132. package/dist/cjs/components/Icon/types.js +0 -6
  133. package/dist/cjs/components/Icon/types.js.map +0 -1
  134. package/dist/cjs/components/Image/Image.js +0 -30
  135. package/dist/cjs/components/Image/Image.js.map +0 -1
  136. package/dist/cjs/components/Image/index.js +0 -20
  137. package/dist/cjs/components/Image/index.js.map +0 -1
  138. package/dist/cjs/components/Label/Label.js +0 -32
  139. package/dist/cjs/components/Label/Label.js.map +0 -1
  140. package/dist/cjs/components/Label/index.js +0 -20
  141. package/dist/cjs/components/Label/index.js.map +0 -1
  142. package/dist/cjs/components/Link/Link.js +0 -42
  143. package/dist/cjs/components/Link/Link.js.map +0 -1
  144. package/dist/cjs/components/Link/index.js +0 -20
  145. package/dist/cjs/components/Link/index.js.map +0 -1
  146. package/dist/cjs/components/LinkButton/LinkButton.js +0 -34
  147. package/dist/cjs/components/LinkButton/LinkButton.js.map +0 -1
  148. package/dist/cjs/components/LinkButton/index.js +0 -20
  149. package/dist/cjs/components/LinkButton/index.js.map +0 -1
  150. package/dist/cjs/components/List/List.js +0 -48
  151. package/dist/cjs/components/List/List.js.map +0 -1
  152. package/dist/cjs/components/List/ListItem.js +0 -53
  153. package/dist/cjs/components/List/ListItem.js.map +0 -1
  154. package/dist/cjs/components/List/index.js +0 -21
  155. package/dist/cjs/components/List/index.js.map +0 -1
  156. package/dist/cjs/components/LoadingIndicator/LoadingIndicator.js +0 -34
  157. package/dist/cjs/components/LoadingIndicator/LoadingIndicator.js.map +0 -1
  158. package/dist/cjs/components/LoadingIndicator/index.js +0 -20
  159. package/dist/cjs/components/LoadingIndicator/index.js.map +0 -1
  160. package/dist/cjs/components/Logo/Logo.js +0 -70
  161. package/dist/cjs/components/Logo/Logo.js.map +0 -1
  162. package/dist/cjs/components/Logo/index.js +0 -20
  163. package/dist/cjs/components/Logo/index.js.map +0 -1
  164. package/dist/cjs/components/Modal/Content.js +0 -21
  165. package/dist/cjs/components/Modal/Content.js.map +0 -1
  166. package/dist/cjs/components/Modal/Header.js +0 -43
  167. package/dist/cjs/components/Modal/Header.js.map +0 -1
  168. package/dist/cjs/components/Modal/Modal.js +0 -81
  169. package/dist/cjs/components/Modal/Modal.js.map +0 -1
  170. package/dist/cjs/components/Modal/ModalContext.js +0 -17
  171. package/dist/cjs/components/Modal/ModalContext.js.map +0 -1
  172. package/dist/cjs/components/Modal/index.js +0 -29
  173. package/dist/cjs/components/Modal/index.js.map +0 -1
  174. package/dist/cjs/components/Modal/types.js +0 -6
  175. package/dist/cjs/components/Modal/types.js.map +0 -1
  176. package/dist/cjs/components/Modal/useModal.js +0 -21
  177. package/dist/cjs/components/Modal/useModal.js.map +0 -1
  178. package/dist/cjs/components/NumberField/NumberField.js +0 -47
  179. package/dist/cjs/components/NumberField/NumberField.js.map +0 -1
  180. package/dist/cjs/components/NumberField/index.js +0 -20
  181. package/dist/cjs/components/NumberField/index.js.map +0 -1
  182. package/dist/cjs/components/Option/Option.js +0 -26
  183. package/dist/cjs/components/Option/Option.js.map +0 -1
  184. package/dist/cjs/components/Option/index.js +0 -20
  185. package/dist/cjs/components/Option/index.js.map +0 -1
  186. package/dist/cjs/components/PasswordField/PasswordField.js +0 -49
  187. package/dist/cjs/components/PasswordField/PasswordField.js.map +0 -1
  188. package/dist/cjs/components/PasswordField/ShowHideButton.js +0 -24
  189. package/dist/cjs/components/PasswordField/ShowHideButton.js.map +0 -1
  190. package/dist/cjs/components/PasswordField/index.js +0 -20
  191. package/dist/cjs/components/PasswordField/index.js.map +0 -1
  192. package/dist/cjs/components/Popover/Popover.js +0 -125
  193. package/dist/cjs/components/Popover/Popover.js.map +0 -1
  194. package/dist/cjs/components/Popover/index.js +0 -20
  195. package/dist/cjs/components/Popover/index.js.map +0 -1
  196. package/dist/cjs/components/Progress/Progress.js +0 -114
  197. package/dist/cjs/components/Progress/Progress.js.map +0 -1
  198. package/dist/cjs/components/Progress/index.js +0 -20
  199. package/dist/cjs/components/Progress/index.js.map +0 -1
  200. package/dist/cjs/components/Radio/Radio.js +0 -91
  201. package/dist/cjs/components/Radio/Radio.js.map +0 -1
  202. package/dist/cjs/components/Radio/RadioGroup.js +0 -113
  203. package/dist/cjs/components/Radio/RadioGroup.js.map +0 -1
  204. package/dist/cjs/components/Radio/index.js +0 -21
  205. package/dist/cjs/components/Radio/index.js.map +0 -1
  206. package/dist/cjs/components/SVG/SVG.js +0 -36
  207. package/dist/cjs/components/SVG/SVG.js.map +0 -1
  208. package/dist/cjs/components/SVG/index.js +0 -20
  209. package/dist/cjs/components/SVG/index.js.map +0 -1
  210. package/dist/cjs/components/Segment/Segment.js +0 -37
  211. package/dist/cjs/components/Segment/Segment.js.map +0 -1
  212. package/dist/cjs/components/Segment/SegmentGroup.js +0 -32
  213. package/dist/cjs/components/Segment/SegmentGroup.js.map +0 -1
  214. package/dist/cjs/components/Segment/index.js +0 -21
  215. package/dist/cjs/components/Segment/index.js.map +0 -1
  216. package/dist/cjs/components/Select/Select.js +0 -100
  217. package/dist/cjs/components/Select/Select.js.map +0 -1
  218. package/dist/cjs/components/Select/index.js +0 -20
  219. package/dist/cjs/components/Select/index.js.map +0 -1
  220. package/dist/cjs/components/Slider/Slider.js +0 -115
  221. package/dist/cjs/components/Slider/Slider.js.map +0 -1
  222. package/dist/cjs/components/Slider/helpers.js +0 -62
  223. package/dist/cjs/components/Slider/helpers.js.map +0 -1
  224. package/dist/cjs/components/Slider/index.js +0 -20
  225. package/dist/cjs/components/Slider/index.js.map +0 -1
  226. package/dist/cjs/components/Stack/Stack.js +0 -32
  227. package/dist/cjs/components/Stack/Stack.js.map +0 -1
  228. package/dist/cjs/components/Stack/index.js +0 -20
  229. package/dist/cjs/components/Stack/index.js.map +0 -1
  230. package/dist/cjs/components/Switch/Switch.js +0 -62
  231. package/dist/cjs/components/Switch/Switch.js.map +0 -1
  232. package/dist/cjs/components/Switch/index.js +0 -20
  233. package/dist/cjs/components/Switch/index.js.map +0 -1
  234. package/dist/cjs/components/Table/Body.js +0 -29
  235. package/dist/cjs/components/Table/Body.js.map +0 -1
  236. package/dist/cjs/components/Table/Cell.js +0 -29
  237. package/dist/cjs/components/Table/Cell.js.map +0 -1
  238. package/dist/cjs/components/Table/Foot.js +0 -29
  239. package/dist/cjs/components/Table/Foot.js.map +0 -1
  240. package/dist/cjs/components/Table/Head.js +0 -29
  241. package/dist/cjs/components/Table/Head.js.map +0 -1
  242. package/dist/cjs/components/Table/HeaderCell.js +0 -29
  243. package/dist/cjs/components/Table/HeaderCell.js.map +0 -1
  244. package/dist/cjs/components/Table/Row.js +0 -29
  245. package/dist/cjs/components/Table/Row.js.map +0 -1
  246. package/dist/cjs/components/Table/Table.js +0 -29
  247. package/dist/cjs/components/Table/Table.js.map +0 -1
  248. package/dist/cjs/components/Table/index.js +0 -28
  249. package/dist/cjs/components/Table/index.js.map +0 -1
  250. package/dist/cjs/components/Text/Text.js +0 -49
  251. package/dist/cjs/components/Text/Text.js.map +0 -1
  252. package/dist/cjs/components/Text/index.js +0 -20
  253. package/dist/cjs/components/Text/index.js.map +0 -1
  254. package/dist/cjs/components/TextArea/TextArea.js +0 -64
  255. package/dist/cjs/components/TextArea/TextArea.js.map +0 -1
  256. package/dist/cjs/components/TextArea/index.js +0 -20
  257. package/dist/cjs/components/TextArea/index.js.map +0 -1
  258. package/dist/cjs/components/TextAreaInput/TextAreaInput.js +0 -37
  259. package/dist/cjs/components/TextAreaInput/TextAreaInput.js.map +0 -1
  260. package/dist/cjs/components/TextAreaInput/index.js +0 -20
  261. package/dist/cjs/components/TextAreaInput/index.js.map +0 -1
  262. package/dist/cjs/components/TextField/TextField.js +0 -93
  263. package/dist/cjs/components/TextField/TextField.js.map +0 -1
  264. package/dist/cjs/components/TextField/adornmentWithClassName.js +0 -25
  265. package/dist/cjs/components/TextField/adornmentWithClassName.js.map +0 -1
  266. package/dist/cjs/components/TextField/index.js +0 -20
  267. package/dist/cjs/components/TextField/index.js.map +0 -1
  268. package/dist/cjs/components/Title/Title.js +0 -48
  269. package/dist/cjs/components/Title/Title.js.map +0 -1
  270. package/dist/cjs/components/Title/index.js +0 -20
  271. package/dist/cjs/components/Title/index.js.map +0 -1
  272. package/dist/cjs/components/Trust/Trust.js +0 -75
  273. package/dist/cjs/components/Trust/Trust.js.map +0 -1
  274. package/dist/cjs/components/Trust/TrustpilotProvider.js +0 -31
  275. package/dist/cjs/components/Trust/TrustpilotProvider.js.map +0 -1
  276. package/dist/cjs/components/Trust/constants.js +0 -74
  277. package/dist/cjs/components/Trust/constants.js.map +0 -1
  278. package/dist/cjs/components/Trust/index.js +0 -21
  279. package/dist/cjs/components/Trust/index.js.map +0 -1
  280. package/dist/cjs/components/Trust/types.js +0 -6
  281. package/dist/cjs/components/Trust/types.js.map +0 -1
  282. package/dist/cjs/components/VisuallyHidden/VisuallyHidden.js +0 -33
  283. package/dist/cjs/components/VisuallyHidden/VisuallyHidden.js.map +0 -1
  284. package/dist/cjs/components/VisuallyHidden/index.js +0 -20
  285. package/dist/cjs/components/VisuallyHidden/index.js.map +0 -1
  286. package/dist/cjs/components/index.js +0 -64
  287. package/dist/cjs/components/index.js.map +0 -1
  288. package/dist/cjs/global.d.js +0 -3
  289. package/dist/cjs/global.d.js.map +0 -1
  290. package/dist/cjs/hooks/index.js +0 -34
  291. package/dist/cjs/hooks/index.js.map +0 -1
  292. package/dist/cjs/hooks/useBodyScrollLock/index.js +0 -20
  293. package/dist/cjs/hooks/useBodyScrollLock/index.js.map +0 -1
  294. package/dist/cjs/hooks/useBodyScrollLock/useBodyScrollLock.js +0 -38
  295. package/dist/cjs/hooks/useBodyScrollLock/useBodyScrollLock.js.map +0 -1
  296. package/dist/cjs/hooks/useBreakpoint/index.js +0 -20
  297. package/dist/cjs/hooks/useBreakpoint/index.js.map +0 -1
  298. package/dist/cjs/hooks/useBreakpoint/useBreakpoint.js +0 -133
  299. package/dist/cjs/hooks/useBreakpoint/useBreakpoint.js.map +0 -1
  300. package/dist/cjs/hooks/useButton/index.js +0 -20
  301. package/dist/cjs/hooks/useButton/index.js.map +0 -1
  302. package/dist/cjs/hooks/useButton/useButton.js +0 -54
  303. package/dist/cjs/hooks/useButton/useButton.js.map +0 -1
  304. package/dist/cjs/hooks/useDebouncedValue/index.js +0 -20
  305. package/dist/cjs/hooks/useDebouncedValue/index.js.map +0 -1
  306. package/dist/cjs/hooks/useDebouncedValue/useDebouncedValue.js +0 -36
  307. package/dist/cjs/hooks/useDebouncedValue/useDebouncedValue.js.map +0 -1
  308. package/dist/cjs/hooks/useDeprecationWarning/index.js +0 -20
  309. package/dist/cjs/hooks/useDeprecationWarning/index.js.map +0 -1
  310. package/dist/cjs/hooks/useDeprecationWarning/useDeprecationWarning.js +0 -32
  311. package/dist/cjs/hooks/useDeprecationWarning/useDeprecationWarning.js.map +0 -1
  312. package/dist/cjs/hooks/useDialog/index.js +0 -20
  313. package/dist/cjs/hooks/useDialog/index.js.map +0 -1
  314. package/dist/cjs/hooks/useDialog/useDialog.js +0 -100
  315. package/dist/cjs/hooks/useDialog/useDialog.js.map +0 -1
  316. package/dist/cjs/hooks/useDialogPolyfill/index.js +0 -20
  317. package/dist/cjs/hooks/useDialogPolyfill/index.js.map +0 -1
  318. package/dist/cjs/hooks/useDialogPolyfill/useDialogPolyfill.js +0 -76
  319. package/dist/cjs/hooks/useDialogPolyfill/useDialogPolyfill.js.map +0 -1
  320. package/dist/cjs/hooks/useLabel/index.js +0 -20
  321. package/dist/cjs/hooks/useLabel/index.js.map +0 -1
  322. package/dist/cjs/hooks/useLabel/useLabel.js +0 -40
  323. package/dist/cjs/hooks/useLabel/useLabel.js.map +0 -1
  324. package/dist/cjs/hooks/useOnClickOutside/index.js +0 -20
  325. package/dist/cjs/hooks/useOnClickOutside/index.js.map +0 -1
  326. package/dist/cjs/hooks/useOnClickOutside/useOnClickOutside.js +0 -45
  327. package/dist/cjs/hooks/useOnClickOutside/useOnClickOutside.js.map +0 -1
  328. package/dist/cjs/hooks/useOnUnmount/index.js +0 -20
  329. package/dist/cjs/hooks/useOnUnmount/index.js.map +0 -1
  330. package/dist/cjs/hooks/useOnUnmount/useOnUnmount.js +0 -27
  331. package/dist/cjs/hooks/useOnUnmount/useOnUnmount.js.map +0 -1
  332. package/dist/cjs/hooks/usePrefersReducedMotion/index.js +0 -20
  333. package/dist/cjs/hooks/usePrefersReducedMotion/index.js.map +0 -1
  334. package/dist/cjs/hooks/usePrefersReducedMotion/usePrefersReducedMotion.js +0 -28
  335. package/dist/cjs/hooks/usePrefersReducedMotion/usePrefersReducedMotion.js.map +0 -1
  336. package/dist/cjs/hooks/useRenderCount/index.js +0 -20
  337. package/dist/cjs/hooks/useRenderCount/index.js.map +0 -1
  338. package/dist/cjs/hooks/useRenderCount/useRenderCount.js +0 -20
  339. package/dist/cjs/hooks/useRenderCount/useRenderCount.js.map +0 -1
  340. package/dist/cjs/hooks/useTextField/index.js +0 -21
  341. package/dist/cjs/hooks/useTextField/index.js.map +0 -1
  342. package/dist/cjs/hooks/useTextField/types.js +0 -6
  343. package/dist/cjs/hooks/useTextField/types.js.map +0 -1
  344. package/dist/cjs/hooks/useTextField/useTextField.js +0 -75
  345. package/dist/cjs/hooks/useTextField/useTextField.js.map +0 -1
  346. package/dist/cjs/hooks/useValidationClasses/index.js +0 -20
  347. package/dist/cjs/hooks/useValidationClasses/index.js.map +0 -1
  348. package/dist/cjs/hooks/useValidationClasses/useValidationClasses.js +0 -26
  349. package/dist/cjs/hooks/useValidationClasses/useValidationClasses.js.map +0 -1
  350. package/dist/cjs/hooks/useWindowEvent/index.js +0 -20
  351. package/dist/cjs/hooks/useWindowEvent/index.js.map +0 -1
  352. package/dist/cjs/hooks/useWindowEvent/useWindowEvent.js +0 -48
  353. package/dist/cjs/hooks/useWindowEvent/useWindowEvent.js.map +0 -1
  354. package/dist/cjs/index.js.map +0 -1
  355. package/dist/cjs/styles.d.js +0 -3
  356. package/dist/cjs/styles.d.js.map +0 -1
  357. package/dist/cjs/types/components.js +0 -6
  358. package/dist/cjs/types/components.js.map +0 -1
  359. package/dist/cjs/types/dom.js +0 -6
  360. package/dist/cjs/types/dom.js.map +0 -1
  361. package/dist/cjs/types/events.js +0 -6
  362. package/dist/cjs/types/events.js.map +0 -1
  363. package/dist/cjs/types/icon.js +0 -6
  364. package/dist/cjs/types/icon.js.map +0 -1
  365. package/dist/cjs/types/index.js +0 -24
  366. package/dist/cjs/types/index.js.map +0 -1
  367. package/dist/cjs/types/size.js +0 -6
  368. package/dist/cjs/types/size.js.map +0 -1
  369. package/dist/cjs/utils/changeCSS.js +0 -28
  370. package/dist/cjs/utils/changeCSS.js.map +0 -1
  371. package/dist/cjs/utils/delay.js +0 -23
  372. package/dist/cjs/utils/delay.js.map +0 -1
  373. package/dist/cjs/utils/excludeControls.js +0 -43
  374. package/dist/cjs/utils/excludeControls.js.map +0 -1
  375. package/dist/cjs/utils/filterUndefinedProps.js +0 -21
  376. package/dist/cjs/utils/filterUndefinedProps.js.map +0 -1
  377. package/dist/cjs/utils/getSpacingValue.js +0 -21
  378. package/dist/cjs/utils/getSpacingValue.js.map +0 -1
  379. package/dist/cjs/utils/index.js +0 -30
  380. package/dist/cjs/utils/index.js.map +0 -1
  381. package/dist/cjs/utils/jestHTMLDialogPolyfill.js +0 -27
  382. package/dist/cjs/utils/jestHTMLDialogPolyfill.js.map +0 -1
  383. package/dist/cjs/utils/jestMockMatchMedia.js +0 -28
  384. package/dist/cjs/utils/jestMockMatchMedia.js.map +0 -1
  385. package/dist/cjs/utils/mergeRefs.js +0 -24
  386. package/dist/cjs/utils/mergeRefs.js.map +0 -1
  387. package/dist/cjs/utils/polyfill-tests.js +0 -14
  388. package/dist/cjs/utils/polyfill-tests.js.map +0 -1
  389. package/dist/cjs/utils/sizeClasses.js +0 -26
  390. package/dist/cjs/utils/sizeClasses.js.map +0 -1
  391. package/dist/cjs/utils/sizeOptions.js +0 -22
  392. package/dist/cjs/utils/sizeOptions.js.map +0 -1
  393. package/dist/cjs/utils/spaceDelimitedList.js +0 -15
  394. package/dist/cjs/utils/spaceDelimitedList.js.map +0 -1
  395. package/dist/esm/components/Accordion/Accordion.js +0 -147
  396. package/dist/esm/components/Accordion/Accordion.js.map +0 -1
  397. package/dist/esm/components/Accordion/index.js +0 -3
  398. package/dist/esm/components/Accordion/index.js.map +0 -1
  399. package/dist/esm/components/AddressLookup/AddressLookup.js +0 -66
  400. package/dist/esm/components/AddressLookup/AddressLookup.js.map +0 -1
  401. package/dist/esm/components/AddressLookup/LoqateAddressLookupError.js +0 -22
  402. package/dist/esm/components/AddressLookup/LoqateAddressLookupError.js.map +0 -1
  403. package/dist/esm/components/AddressLookup/LoqateAddressLookupService.js +0 -100
  404. package/dist/esm/components/AddressLookup/LoqateAddressLookupService.js.map +0 -1
  405. package/dist/esm/components/AddressLookup/index.js +0 -5
  406. package/dist/esm/components/AddressLookup/index.js.map +0 -1
  407. package/dist/esm/components/AddressLookup/types.js +0 -3
  408. package/dist/esm/components/AddressLookup/types.js.map +0 -1
  409. package/dist/esm/components/AddressLookup/utils.js +0 -5
  410. package/dist/esm/components/AddressLookup/utils.js.map +0 -1
  411. package/dist/esm/components/Alert/Alert.js +0 -55
  412. package/dist/esm/components/Alert/Alert.js.map +0 -1
  413. package/dist/esm/components/Alert/index.js +0 -3
  414. package/dist/esm/components/Alert/index.js.map +0 -1
  415. package/dist/esm/components/Box/Box.js +0 -34
  416. package/dist/esm/components/Box/Box.js.map +0 -1
  417. package/dist/esm/components/Box/index.js +0 -3
  418. package/dist/esm/components/Box/index.js.map +0 -1
  419. package/dist/esm/components/Box/types.js +0 -3
  420. package/dist/esm/components/Box/types.js.map +0 -1
  421. package/dist/esm/components/Breadcrumbs/BreadcrumbItem.js +0 -40
  422. package/dist/esm/components/Breadcrumbs/BreadcrumbItem.js.map +0 -1
  423. package/dist/esm/components/Breadcrumbs/Breadcrumbs.js +0 -31
  424. package/dist/esm/components/Breadcrumbs/Breadcrumbs.js.map +0 -1
  425. package/dist/esm/components/Breadcrumbs/index.js +0 -4
  426. package/dist/esm/components/Breadcrumbs/index.js.map +0 -1
  427. package/dist/esm/components/Button/Button.js +0 -50
  428. package/dist/esm/components/Button/Button.js.map +0 -1
  429. package/dist/esm/components/Button/Loading.js +0 -27
  430. package/dist/esm/components/Button/Loading.js.map +0 -1
  431. package/dist/esm/components/Button/Success.js +0 -22
  432. package/dist/esm/components/Button/Success.js.map +0 -1
  433. package/dist/esm/components/Button/index.js +0 -3
  434. package/dist/esm/components/Button/index.js.map +0 -1
  435. package/dist/esm/components/Checkbox/Checkbox.js +0 -100
  436. package/dist/esm/components/Checkbox/Checkbox.js.map +0 -1
  437. package/dist/esm/components/Checkbox/CheckboxGroup.js +0 -104
  438. package/dist/esm/components/Checkbox/CheckboxGroup.js.map +0 -1
  439. package/dist/esm/components/Checkbox/index.js +0 -5
  440. package/dist/esm/components/Checkbox/index.js.map +0 -1
  441. package/dist/esm/components/Checkbox/types.js +0 -3
  442. package/dist/esm/components/Checkbox/types.js.map +0 -1
  443. package/dist/esm/components/Combobox/Combobox.js +0 -210
  444. package/dist/esm/components/Combobox/Combobox.js.map +0 -1
  445. package/dist/esm/components/Combobox/Listbox.js +0 -57
  446. package/dist/esm/components/Combobox/Listbox.js.map +0 -1
  447. package/dist/esm/components/Combobox/Option.js +0 -32
  448. package/dist/esm/components/Combobox/Option.js.map +0 -1
  449. package/dist/esm/components/Combobox/fixtures.js +0 -523
  450. package/dist/esm/components/Combobox/fixtures.js.map +0 -1
  451. package/dist/esm/components/Combobox/index.js +0 -4
  452. package/dist/esm/components/Combobox/index.js.map +0 -1
  453. package/dist/esm/components/Combobox/types.js +0 -3
  454. package/dist/esm/components/Combobox/types.js.map +0 -1
  455. package/dist/esm/components/Combobox/useComboboxHighlight.js +0 -82
  456. package/dist/esm/components/Combobox/useComboboxHighlight.js.map +0 -1
  457. package/dist/esm/components/Combobox/useComboboxOptions.js +0 -71
  458. package/dist/esm/components/Combobox/useComboboxOptions.js.map +0 -1
  459. package/dist/esm/components/Combobox/utils.js +0 -21
  460. package/dist/esm/components/Combobox/utils.js.map +0 -1
  461. package/dist/esm/components/Container/Container.js +0 -17
  462. package/dist/esm/components/Container/Container.js.map +0 -1
  463. package/dist/esm/components/Container/index.js +0 -3
  464. package/dist/esm/components/Container/index.js.map +0 -1
  465. package/dist/esm/components/Divider/Divider.js +0 -18
  466. package/dist/esm/components/Divider/Divider.js.map +0 -1
  467. package/dist/esm/components/Divider/index.js +0 -3
  468. package/dist/esm/components/Divider/index.js.map +0 -1
  469. package/dist/esm/components/Drawer/Content.js +0 -12
  470. package/dist/esm/components/Drawer/Content.js.map +0 -1
  471. package/dist/esm/components/Drawer/Drawer.js +0 -64
  472. package/dist/esm/components/Drawer/Drawer.js.map +0 -1
  473. package/dist/esm/components/Drawer/DrawerContext.js +0 -7
  474. package/dist/esm/components/Drawer/DrawerContext.js.map +0 -1
  475. package/dist/esm/components/Drawer/Header.js +0 -35
  476. package/dist/esm/components/Drawer/Header.js.map +0 -1
  477. package/dist/esm/components/Drawer/index.js +0 -12
  478. package/dist/esm/components/Drawer/index.js.map +0 -1
  479. package/dist/esm/components/Drawer/types.js +0 -3
  480. package/dist/esm/components/Drawer/types.js.map +0 -1
  481. package/dist/esm/components/Drawer/useDrawer.js +0 -11
  482. package/dist/esm/components/Drawer/useDrawer.js.map +0 -1
  483. package/dist/esm/components/DropdownMenu/DropdownMenu.js +0 -59
  484. package/dist/esm/components/DropdownMenu/DropdownMenu.js.map +0 -1
  485. package/dist/esm/components/DropdownMenu/Item.js +0 -30
  486. package/dist/esm/components/DropdownMenu/Item.js.map +0 -1
  487. package/dist/esm/components/DropdownMenu/index.js +0 -9
  488. package/dist/esm/components/DropdownMenu/index.js.map +0 -1
  489. package/dist/esm/components/ErrorMessage/ErrorMessage.js +0 -29
  490. package/dist/esm/components/ErrorMessage/ErrorMessage.js.map +0 -1
  491. package/dist/esm/components/ErrorMessage/index.js +0 -3
  492. package/dist/esm/components/ErrorMessage/index.js.map +0 -1
  493. package/dist/esm/components/Fieldset/Fieldset.js +0 -51
  494. package/dist/esm/components/Fieldset/Fieldset.js.map +0 -1
  495. package/dist/esm/components/Fieldset/index.js +0 -3
  496. package/dist/esm/components/Fieldset/index.js.map +0 -1
  497. package/dist/esm/components/Flex/Flex.js +0 -23
  498. package/dist/esm/components/Flex/Flex.js.map +0 -1
  499. package/dist/esm/components/Flex/index.js +0 -4
  500. package/dist/esm/components/Flex/index.js.map +0 -1
  501. package/dist/esm/components/Flex/propUtils.js +0 -38
  502. package/dist/esm/components/Flex/propUtils.js.map +0 -1
  503. package/dist/esm/components/Flex/types.js +0 -3
  504. package/dist/esm/components/Flex/types.js.map +0 -1
  505. package/dist/esm/components/Grid/Grid.js +0 -30
  506. package/dist/esm/components/Grid/Grid.js.map +0 -1
  507. package/dist/esm/components/Grid/Item.js +0 -51
  508. package/dist/esm/components/Grid/Item.js.map +0 -1
  509. package/dist/esm/components/Grid/index.js +0 -9
  510. package/dist/esm/components/Grid/index.js.map +0 -1
  511. package/dist/esm/components/Icon/Icon.js +0 -42
  512. package/dist/esm/components/Icon/Icon.js.map +0 -1
  513. package/dist/esm/components/Icon/index.js +0 -4
  514. package/dist/esm/components/Icon/index.js.map +0 -1
  515. package/dist/esm/components/Icon/types.js +0 -3
  516. package/dist/esm/components/Icon/types.js.map +0 -1
  517. package/dist/esm/components/Image/Image.js +0 -16
  518. package/dist/esm/components/Image/Image.js.map +0 -1
  519. package/dist/esm/components/Image/index.js +0 -3
  520. package/dist/esm/components/Image/index.js.map +0 -1
  521. package/dist/esm/components/Label/Label.js +0 -18
  522. package/dist/esm/components/Label/Label.js.map +0 -1
  523. package/dist/esm/components/Label/index.js +0 -3
  524. package/dist/esm/components/Label/index.js.map +0 -1
  525. package/dist/esm/components/Link/Link.js +0 -28
  526. package/dist/esm/components/Link/Link.js.map +0 -1
  527. package/dist/esm/components/Link/index.js +0 -3
  528. package/dist/esm/components/Link/index.js.map +0 -1
  529. package/dist/esm/components/LinkButton/LinkButton.js +0 -19
  530. package/dist/esm/components/LinkButton/LinkButton.js.map +0 -1
  531. package/dist/esm/components/LinkButton/index.js +0 -3
  532. package/dist/esm/components/LinkButton/index.js.map +0 -1
  533. package/dist/esm/components/List/List.js +0 -34
  534. package/dist/esm/components/List/List.js.map +0 -1
  535. package/dist/esm/components/List/ListItem.js +0 -39
  536. package/dist/esm/components/List/ListItem.js.map +0 -1
  537. package/dist/esm/components/List/index.js +0 -4
  538. package/dist/esm/components/List/index.js.map +0 -1
  539. package/dist/esm/components/LoadingIndicator/LoadingIndicator.js +0 -20
  540. package/dist/esm/components/LoadingIndicator/LoadingIndicator.js.map +0 -1
  541. package/dist/esm/components/LoadingIndicator/index.js +0 -3
  542. package/dist/esm/components/LoadingIndicator/index.js.map +0 -1
  543. package/dist/esm/components/Logo/Logo.js +0 -55
  544. package/dist/esm/components/Logo/Logo.js.map +0 -1
  545. package/dist/esm/components/Logo/index.js +0 -3
  546. package/dist/esm/components/Logo/index.js.map +0 -1
  547. package/dist/esm/components/Modal/Content.js +0 -12
  548. package/dist/esm/components/Modal/Content.js.map +0 -1
  549. package/dist/esm/components/Modal/Header.js +0 -34
  550. package/dist/esm/components/Modal/Header.js.map +0 -1
  551. package/dist/esm/components/Modal/Modal.js +0 -67
  552. package/dist/esm/components/Modal/Modal.js.map +0 -1
  553. package/dist/esm/components/Modal/ModalContext.js +0 -7
  554. package/dist/esm/components/Modal/ModalContext.js.map +0 -1
  555. package/dist/esm/components/Modal/index.js +0 -12
  556. package/dist/esm/components/Modal/index.js.map +0 -1
  557. package/dist/esm/components/Modal/types.js +0 -3
  558. package/dist/esm/components/Modal/types.js.map +0 -1
  559. package/dist/esm/components/Modal/useModal.js +0 -11
  560. package/dist/esm/components/Modal/useModal.js.map +0 -1
  561. package/dist/esm/components/NumberField/NumberField.js +0 -32
  562. package/dist/esm/components/NumberField/NumberField.js.map +0 -1
  563. package/dist/esm/components/NumberField/index.js +0 -3
  564. package/dist/esm/components/NumberField/index.js.map +0 -1
  565. package/dist/esm/components/Option/Option.js +0 -17
  566. package/dist/esm/components/Option/Option.js.map +0 -1
  567. package/dist/esm/components/Option/index.js +0 -3
  568. package/dist/esm/components/Option/index.js.map +0 -1
  569. package/dist/esm/components/PasswordField/PasswordField.js +0 -34
  570. package/dist/esm/components/PasswordField/PasswordField.js.map +0 -1
  571. package/dist/esm/components/PasswordField/ShowHideButton.js +0 -14
  572. package/dist/esm/components/PasswordField/ShowHideButton.js.map +0 -1
  573. package/dist/esm/components/PasswordField/index.js +0 -3
  574. package/dist/esm/components/PasswordField/index.js.map +0 -1
  575. package/dist/esm/components/Popover/Popover.js +0 -110
  576. package/dist/esm/components/Popover/Popover.js.map +0 -1
  577. package/dist/esm/components/Popover/index.js +0 -3
  578. package/dist/esm/components/Popover/index.js.map +0 -1
  579. package/dist/esm/components/Progress/Progress.js +0 -100
  580. package/dist/esm/components/Progress/Progress.js.map +0 -1
  581. package/dist/esm/components/Progress/index.js +0 -3
  582. package/dist/esm/components/Progress/index.js.map +0 -1
  583. package/dist/esm/components/Radio/Radio.js +0 -77
  584. package/dist/esm/components/Radio/Radio.js.map +0 -1
  585. package/dist/esm/components/Radio/RadioGroup.js +0 -99
  586. package/dist/esm/components/Radio/RadioGroup.js.map +0 -1
  587. package/dist/esm/components/Radio/index.js +0 -4
  588. package/dist/esm/components/Radio/index.js.map +0 -1
  589. package/dist/esm/components/SVG/SVG.js +0 -22
  590. package/dist/esm/components/SVG/SVG.js.map +0 -1
  591. package/dist/esm/components/SVG/index.js +0 -3
  592. package/dist/esm/components/SVG/index.js.map +0 -1
  593. package/dist/esm/components/Segment/Segment.js +0 -23
  594. package/dist/esm/components/Segment/Segment.js.map +0 -1
  595. package/dist/esm/components/Segment/SegmentGroup.js +0 -18
  596. package/dist/esm/components/Segment/SegmentGroup.js.map +0 -1
  597. package/dist/esm/components/Segment/index.js +0 -4
  598. package/dist/esm/components/Segment/index.js.map +0 -1
  599. package/dist/esm/components/Select/Select.js +0 -86
  600. package/dist/esm/components/Select/Select.js.map +0 -1
  601. package/dist/esm/components/Select/index.js +0 -3
  602. package/dist/esm/components/Select/index.js.map +0 -1
  603. package/dist/esm/components/Slider/Slider.js +0 -100
  604. package/dist/esm/components/Slider/Slider.js.map +0 -1
  605. package/dist/esm/components/Slider/helpers.js +0 -35
  606. package/dist/esm/components/Slider/helpers.js.map +0 -1
  607. package/dist/esm/components/Slider/index.js +0 -3
  608. package/dist/esm/components/Slider/index.js.map +0 -1
  609. package/dist/esm/components/Stack/Stack.js +0 -17
  610. package/dist/esm/components/Stack/Stack.js.map +0 -1
  611. package/dist/esm/components/Stack/index.js +0 -3
  612. package/dist/esm/components/Stack/index.js.map +0 -1
  613. package/dist/esm/components/Switch/Switch.js +0 -48
  614. package/dist/esm/components/Switch/Switch.js.map +0 -1
  615. package/dist/esm/components/Switch/index.js +0 -3
  616. package/dist/esm/components/Switch/index.js.map +0 -1
  617. package/dist/esm/components/Table/Body.js +0 -15
  618. package/dist/esm/components/Table/Body.js.map +0 -1
  619. package/dist/esm/components/Table/Cell.js +0 -15
  620. package/dist/esm/components/Table/Cell.js.map +0 -1
  621. package/dist/esm/components/Table/Foot.js +0 -15
  622. package/dist/esm/components/Table/Foot.js.map +0 -1
  623. package/dist/esm/components/Table/Head.js +0 -15
  624. package/dist/esm/components/Table/Head.js.map +0 -1
  625. package/dist/esm/components/Table/HeaderCell.js +0 -15
  626. package/dist/esm/components/Table/HeaderCell.js.map +0 -1
  627. package/dist/esm/components/Table/Row.js +0 -15
  628. package/dist/esm/components/Table/Row.js.map +0 -1
  629. package/dist/esm/components/Table/Table.js +0 -15
  630. package/dist/esm/components/Table/Table.js.map +0 -1
  631. package/dist/esm/components/Table/index.js +0 -19
  632. package/dist/esm/components/Table/index.js.map +0 -1
  633. package/dist/esm/components/Text/Text.js +0 -35
  634. package/dist/esm/components/Text/Text.js.map +0 -1
  635. package/dist/esm/components/Text/index.js +0 -3
  636. package/dist/esm/components/Text/index.js.map +0 -1
  637. package/dist/esm/components/TextArea/TextArea.js +0 -50
  638. package/dist/esm/components/TextArea/TextArea.js.map +0 -1
  639. package/dist/esm/components/TextArea/index.js +0 -3
  640. package/dist/esm/components/TextArea/index.js.map +0 -1
  641. package/dist/esm/components/TextAreaInput/TextAreaInput.js +0 -23
  642. package/dist/esm/components/TextAreaInput/TextAreaInput.js.map +0 -1
  643. package/dist/esm/components/TextAreaInput/index.js +0 -3
  644. package/dist/esm/components/TextAreaInput/index.js.map +0 -1
  645. package/dist/esm/components/TextField/TextField.js +0 -79
  646. package/dist/esm/components/TextField/TextField.js.map +0 -1
  647. package/dist/esm/components/TextField/adornmentWithClassName.js +0 -10
  648. package/dist/esm/components/TextField/adornmentWithClassName.js.map +0 -1
  649. package/dist/esm/components/TextField/index.js +0 -3
  650. package/dist/esm/components/TextField/index.js.map +0 -1
  651. package/dist/esm/components/Title/Title.js +0 -34
  652. package/dist/esm/components/Title/Title.js.map +0 -1
  653. package/dist/esm/components/Title/index.js +0 -3
  654. package/dist/esm/components/Title/index.js.map +0 -1
  655. package/dist/esm/components/Trust/Trust.js +0 -60
  656. package/dist/esm/components/Trust/Trust.js.map +0 -1
  657. package/dist/esm/components/Trust/TrustpilotProvider.js +0 -21
  658. package/dist/esm/components/Trust/TrustpilotProvider.js.map +0 -1
  659. package/dist/esm/components/Trust/constants.js +0 -49
  660. package/dist/esm/components/Trust/constants.js.map +0 -1
  661. package/dist/esm/components/Trust/index.js +0 -4
  662. package/dist/esm/components/Trust/index.js.map +0 -1
  663. package/dist/esm/components/Trust/types.js +0 -3
  664. package/dist/esm/components/Trust/types.js.map +0 -1
  665. package/dist/esm/components/VisuallyHidden/VisuallyHidden.js +0 -23
  666. package/dist/esm/components/VisuallyHidden/VisuallyHidden.js.map +0 -1
  667. package/dist/esm/components/VisuallyHidden/index.js +0 -3
  668. package/dist/esm/components/VisuallyHidden/index.js.map +0 -1
  669. package/dist/esm/components/index.js +0 -47
  670. package/dist/esm/components/index.js.map +0 -1
  671. package/dist/esm/global.d.js +0 -2
  672. package/dist/esm/global.d.js.map +0 -1
  673. package/dist/esm/hooks/index.js +0 -17
  674. package/dist/esm/hooks/index.js.map +0 -1
  675. package/dist/esm/hooks/useBodyScrollLock/index.js +0 -3
  676. package/dist/esm/hooks/useBodyScrollLock/index.js.map +0 -1
  677. package/dist/esm/hooks/useBodyScrollLock/useBodyScrollLock.js +0 -28
  678. package/dist/esm/hooks/useBodyScrollLock/useBodyScrollLock.js.map +0 -1
  679. package/dist/esm/hooks/useBreakpoint/index.js +0 -3
  680. package/dist/esm/hooks/useBreakpoint/index.js.map +0 -1
  681. package/dist/esm/hooks/useBreakpoint/useBreakpoint.js +0 -112
  682. package/dist/esm/hooks/useBreakpoint/useBreakpoint.js.map +0 -1
  683. package/dist/esm/hooks/useButton/index.js +0 -3
  684. package/dist/esm/hooks/useButton/index.js.map +0 -1
  685. package/dist/esm/hooks/useButton/useButton.js +0 -44
  686. package/dist/esm/hooks/useButton/useButton.js.map +0 -1
  687. package/dist/esm/hooks/useDebouncedValue/index.js +0 -3
  688. package/dist/esm/hooks/useDebouncedValue/index.js.map +0 -1
  689. package/dist/esm/hooks/useDebouncedValue/useDebouncedValue.js +0 -26
  690. package/dist/esm/hooks/useDebouncedValue/useDebouncedValue.js.map +0 -1
  691. package/dist/esm/hooks/useDeprecationWarning/index.js +0 -3
  692. package/dist/esm/hooks/useDeprecationWarning/index.js.map +0 -1
  693. package/dist/esm/hooks/useDeprecationWarning/useDeprecationWarning.js +0 -22
  694. package/dist/esm/hooks/useDeprecationWarning/useDeprecationWarning.js.map +0 -1
  695. package/dist/esm/hooks/useDialog/index.js +0 -3
  696. package/dist/esm/hooks/useDialog/index.js.map +0 -1
  697. package/dist/esm/hooks/useDialog/useDialog.js +0 -90
  698. package/dist/esm/hooks/useDialog/useDialog.js.map +0 -1
  699. package/dist/esm/hooks/useDialogPolyfill/index.js +0 -3
  700. package/dist/esm/hooks/useDialogPolyfill/index.js.map +0 -1
  701. package/dist/esm/hooks/useDialogPolyfill/useDialogPolyfill.js +0 -26
  702. package/dist/esm/hooks/useDialogPolyfill/useDialogPolyfill.js.map +0 -1
  703. package/dist/esm/hooks/useLabel/index.js +0 -3
  704. package/dist/esm/hooks/useLabel/index.js.map +0 -1
  705. package/dist/esm/hooks/useLabel/useLabel.js +0 -30
  706. package/dist/esm/hooks/useLabel/useLabel.js.map +0 -1
  707. package/dist/esm/hooks/useOnClickOutside/index.js +0 -3
  708. package/dist/esm/hooks/useOnClickOutside/index.js.map +0 -1
  709. package/dist/esm/hooks/useOnClickOutside/useOnClickOutside.js +0 -35
  710. package/dist/esm/hooks/useOnClickOutside/useOnClickOutside.js.map +0 -1
  711. package/dist/esm/hooks/useOnUnmount/index.js +0 -3
  712. package/dist/esm/hooks/useOnUnmount/index.js.map +0 -1
  713. package/dist/esm/hooks/useOnUnmount/useOnUnmount.js +0 -17
  714. package/dist/esm/hooks/useOnUnmount/useOnUnmount.js.map +0 -1
  715. package/dist/esm/hooks/usePrefersReducedMotion/index.js +0 -3
  716. package/dist/esm/hooks/usePrefersReducedMotion/index.js.map +0 -1
  717. package/dist/esm/hooks/usePrefersReducedMotion/usePrefersReducedMotion.js +0 -18
  718. package/dist/esm/hooks/usePrefersReducedMotion/usePrefersReducedMotion.js.map +0 -1
  719. package/dist/esm/hooks/useRenderCount/index.js +0 -3
  720. package/dist/esm/hooks/useRenderCount/index.js.map +0 -1
  721. package/dist/esm/hooks/useRenderCount/useRenderCount.js +0 -10
  722. package/dist/esm/hooks/useRenderCount/useRenderCount.js.map +0 -1
  723. package/dist/esm/hooks/useTextField/index.js +0 -4
  724. package/dist/esm/hooks/useTextField/index.js.map +0 -1
  725. package/dist/esm/hooks/useTextField/types.js +0 -3
  726. package/dist/esm/hooks/useTextField/types.js.map +0 -1
  727. package/dist/esm/hooks/useTextField/useTextField.js +0 -65
  728. package/dist/esm/hooks/useTextField/useTextField.js.map +0 -1
  729. package/dist/esm/hooks/useValidationClasses/index.js +0 -3
  730. package/dist/esm/hooks/useValidationClasses/index.js.map +0 -1
  731. package/dist/esm/hooks/useValidationClasses/useValidationClasses.js +0 -16
  732. package/dist/esm/hooks/useValidationClasses/useValidationClasses.js.map +0 -1
  733. package/dist/esm/hooks/useWindowEvent/index.js +0 -3
  734. package/dist/esm/hooks/useWindowEvent/index.js.map +0 -1
  735. package/dist/esm/hooks/useWindowEvent/useWindowEvent.js +0 -38
  736. package/dist/esm/hooks/useWindowEvent/useWindowEvent.js.map +0 -1
  737. package/dist/esm/index.js.map +0 -1
  738. package/dist/esm/styles.d.js +0 -2
  739. package/dist/esm/styles.d.js.map +0 -1
  740. package/dist/esm/types/components.js +0 -3
  741. package/dist/esm/types/components.js.map +0 -1
  742. package/dist/esm/types/dom.js +0 -3
  743. package/dist/esm/types/dom.js.map +0 -1
  744. package/dist/esm/types/events.js +0 -3
  745. package/dist/esm/types/events.js.map +0 -1
  746. package/dist/esm/types/icon.js +0 -3
  747. package/dist/esm/types/icon.js.map +0 -1
  748. package/dist/esm/types/index.js +0 -7
  749. package/dist/esm/types/index.js.map +0 -1
  750. package/dist/esm/types/size.js +0 -3
  751. package/dist/esm/types/size.js.map +0 -1
  752. package/dist/esm/utils/changeCSS.js +0 -18
  753. package/dist/esm/utils/changeCSS.js.map +0 -1
  754. package/dist/esm/utils/delay.js +0 -13
  755. package/dist/esm/utils/delay.js.map +0 -1
  756. package/dist/esm/utils/excludeControls.js +0 -33
  757. package/dist/esm/utils/excludeControls.js.map +0 -1
  758. package/dist/esm/utils/filterUndefinedProps.js +0 -11
  759. package/dist/esm/utils/filterUndefinedProps.js.map +0 -1
  760. package/dist/esm/utils/getSpacingValue.js +0 -11
  761. package/dist/esm/utils/getSpacingValue.js.map +0 -1
  762. package/dist/esm/utils/index.js +0 -13
  763. package/dist/esm/utils/index.js.map +0 -1
  764. package/dist/esm/utils/jestHTMLDialogPolyfill.js +0 -17
  765. package/dist/esm/utils/jestHTMLDialogPolyfill.js.map +0 -1
  766. package/dist/esm/utils/jestMockMatchMedia.js +0 -18
  767. package/dist/esm/utils/jestMockMatchMedia.js.map +0 -1
  768. package/dist/esm/utils/mergeRefs.js +0 -14
  769. package/dist/esm/utils/mergeRefs.js.map +0 -1
  770. package/dist/esm/utils/polyfill-tests.js +0 -4
  771. package/dist/esm/utils/polyfill-tests.js.map +0 -1
  772. package/dist/esm/utils/sizeClasses.js +0 -16
  773. package/dist/esm/utils/sizeClasses.js.map +0 -1
  774. package/dist/esm/utils/sizeOptions.js +0 -12
  775. package/dist/esm/utils/sizeOptions.js.map +0 -1
  776. package/dist/esm/utils/spaceDelimitedList.js +0 -5
  777. package/dist/esm/utils/spaceDelimitedList.js.map +0 -1
package/dist/esm/index.js CHANGED
@@ -1,6 +1,4170 @@
1
- "use client";
2
- export * from "./components";
3
- export * from "./hooks";
4
- export * from "./types";
1
+ // src/components/Accordion/Accordion.tsx
2
+ import { chevronDown } from "@simplybusiness/icons";
3
+ import classNames3 from "classnames/dedupe";
4
+ import { forwardRef as forwardRef2, useEffect as useEffect2, useState as useState2 } from "react";
5
5
 
6
- //# sourceMappingURL=index.js.map
6
+ // src/hooks/usePrefersReducedMotion/usePrefersReducedMotion.tsx
7
+ import { useEffect, useState } from "react";
8
+ function usePrefersReducedMotion() {
9
+ const [prefersReducedMotion, setPrefersReducedMotion] = useState(false);
10
+ useEffect(() => {
11
+ const mediaQuery = window.matchMedia("(prefers-reduced-motion: reduce)");
12
+ setPrefersReducedMotion(mediaQuery.matches);
13
+ const listener = (event) => {
14
+ setPrefersReducedMotion(event.matches);
15
+ };
16
+ mediaQuery.addEventListener("change", listener);
17
+ return () => {
18
+ mediaQuery.removeEventListener("change", listener);
19
+ };
20
+ }, []);
21
+ return prefersReducedMotion;
22
+ }
23
+
24
+ // src/components/Flex/Flex.tsx
25
+ import { forwardRef } from "react";
26
+ import classNames from "classnames/dedupe";
27
+
28
+ // src/utils/filterUndefinedProps.ts
29
+ var filterUndefinedProps = (props) => {
30
+ const filteredProps = {};
31
+ Object.keys(props).forEach((key) => {
32
+ if (props[key] !== void 0) {
33
+ filteredProps[key] = props[key];
34
+ }
35
+ });
36
+ return filteredProps;
37
+ };
38
+
39
+ // src/utils/getSpacingValue.ts
40
+ var getSpacingValue = (padding) => {
41
+ if (typeof padding === "string") {
42
+ return `var(--size-${padding})`;
43
+ }
44
+ if (typeof padding === "number") {
45
+ return `${padding}px`;
46
+ }
47
+ return void 0;
48
+ };
49
+
50
+ // src/utils/mergeRefs.ts
51
+ function mergeRefs(refs) {
52
+ return (value) => {
53
+ refs.forEach((ref) => {
54
+ if (typeof ref === "function") {
55
+ ref(value);
56
+ } else if (ref != null) {
57
+ ref.current = value;
58
+ }
59
+ });
60
+ };
61
+ }
62
+
63
+ // src/utils/polyfill-tests.ts
64
+ var supportsDialog = () => typeof HTMLDialogElement === "function";
65
+
66
+ // src/utils/sizeClasses.ts
67
+ var sizeClasses = (size) => {
68
+ if (!size) {
69
+ return {};
70
+ }
71
+ return {
72
+ "--is-xxs": size === "xxs",
73
+ "--is-xs": size === "xs",
74
+ "--is-sm": size === "sm",
75
+ "--is-md": size === "md",
76
+ "--is-lg": size === "lg",
77
+ "--is-xl": size === "xl",
78
+ "--is-xxl": size === "xxl"
79
+ };
80
+ };
81
+
82
+ // src/utils/spaceDelimitedList.ts
83
+ function spaceDelimitedList(list) {
84
+ return list.filter(Boolean).join(" ") || void 0;
85
+ }
86
+
87
+ // src/components/Flex/propUtils.ts
88
+ var buildFlexStyles = (props) => {
89
+ const {
90
+ flexDirection,
91
+ flexWrap,
92
+ flexGrow,
93
+ flex,
94
+ justifyContent,
95
+ alignItems,
96
+ alignContent,
97
+ gap,
98
+ rowGap,
99
+ columnGap
100
+ } = props;
101
+ const styleProps = {
102
+ flexDirection,
103
+ flexWrap,
104
+ flexGrow,
105
+ flex,
106
+ justifyContent,
107
+ alignItems,
108
+ alignContent,
109
+ gap: getSpacingValue(gap),
110
+ columnGap: getSpacingValue(columnGap),
111
+ rowGap: getSpacingValue(rowGap)
112
+ };
113
+ return filterUndefinedProps(styleProps);
114
+ };
115
+ var splitProps = (props) => {
116
+ const {
117
+ flexDirection,
118
+ flexWrap,
119
+ flexGrow,
120
+ flex,
121
+ justifyContent,
122
+ alignItems,
123
+ alignContent,
124
+ gap,
125
+ rowGap,
126
+ columnGap,
127
+ ...otherProps
128
+ } = props;
129
+ return [
130
+ {
131
+ flexDirection,
132
+ flexWrap,
133
+ flexGrow,
134
+ flex,
135
+ justifyContent,
136
+ alignItems,
137
+ alignContent,
138
+ gap,
139
+ rowGap,
140
+ columnGap
141
+ },
142
+ otherProps
143
+ ];
144
+ };
145
+
146
+ // src/components/Flex/Flex.tsx
147
+ import { jsx } from "react/jsx-runtime";
148
+ var Flex = forwardRef(
149
+ (props, ref) => {
150
+ const {
151
+ elementType: Element = "div",
152
+ style,
153
+ className,
154
+ ...otherProps
155
+ } = props;
156
+ const classes = classNames("mobius", "mobius-flex", className);
157
+ const [styleProps, restProps] = splitProps(otherProps);
158
+ const flexStyles = buildFlexStyles(styleProps);
159
+ return /* @__PURE__ */ jsx(
160
+ Element,
161
+ {
162
+ ref,
163
+ style: {
164
+ ...flexStyles,
165
+ ...style
166
+ },
167
+ className: classes,
168
+ ...restProps
169
+ }
170
+ );
171
+ }
172
+ );
173
+ Flex.displayName = "Flex";
174
+
175
+ // src/components/Icon/Icon.tsx
176
+ import classNames2 from "classnames/dedupe";
177
+ import { jsx as jsx2, jsxs } from "react/jsx-runtime";
178
+ var ICON_PREFIX = "mobius-icon";
179
+ var capitaliseFirstLetter = (str) => str.charAt(0).toUpperCase() + str.slice(1);
180
+ function Icon({
181
+ icon,
182
+ className,
183
+ size = "xs",
184
+ color,
185
+ fixedWidth,
186
+ spin,
187
+ spinReverse,
188
+ title,
189
+ ...otherProps
190
+ }) {
191
+ if (!icon) {
192
+ throw new Error("Must specify icon object");
193
+ }
194
+ const classes = classNames2(
195
+ "mobius",
196
+ "mobius-icon",
197
+ `svg-inline--${ICON_PREFIX}`,
198
+ `--size-${size}`,
199
+ className,
200
+ {
201
+ [`${ICON_PREFIX}-fw`]: fixedWidth,
202
+ [`${ICON_PREFIX}-spin`]: spin || spinReverse,
203
+ [`${ICON_PREFIX}-spin-reverse`]: spinReverse
204
+ }
205
+ );
206
+ const { iconName, width, height, svgPathData } = icon;
207
+ const formattedIconName = iconName.split("-").join(" ");
208
+ const defaultTitle = `${capitaliseFirstLetter(formattedIconName)} icon`;
209
+ const titleText = title || defaultTitle;
210
+ return /* @__PURE__ */ jsxs(
211
+ "svg",
212
+ {
213
+ "aria-hidden": "true",
214
+ focusable: "false",
215
+ "data-icon": iconName,
216
+ className: classes,
217
+ role: "img",
218
+ xmlns: "http://www.w3.org/2000/svg",
219
+ viewBox: `0 0 ${width} ${height}`,
220
+ style: { color },
221
+ ...otherProps,
222
+ children: [
223
+ /* @__PURE__ */ jsx2("title", { children: titleText }),
224
+ /* @__PURE__ */ jsx2("path", { fill: "currentColor", d: svgPathData })
225
+ ]
226
+ }
227
+ );
228
+ }
229
+
230
+ // src/components/Accordion/Accordion.tsx
231
+ import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
232
+ var AccordionLink = ({
233
+ text,
234
+ elementType: LinkElement = "span",
235
+ toggle,
236
+ onClick,
237
+ headerChildren,
238
+ ariaExpanded
239
+ }) => {
240
+ const linkClasses = classNames3("mobius-accordion__link", {
241
+ "--is-open": ariaExpanded
242
+ });
243
+ const iconClasses = classNames3("mobius-accordion__link-icon", {
244
+ "--is-open": ariaExpanded
245
+ });
246
+ const handleOnClick = () => {
247
+ if (onClick) {
248
+ onClick();
249
+ }
250
+ toggle();
251
+ };
252
+ const handleKeyDown = (e) => {
253
+ if (e.key === " " || e.key === "Enter") {
254
+ toggle();
255
+ }
256
+ };
257
+ if (headerChildren) {
258
+ return /* @__PURE__ */ jsxs2(
259
+ Flex,
260
+ {
261
+ justifyContent: "space-between",
262
+ alignItems: "center",
263
+ className: "mobius-accordion__header",
264
+ children: [
265
+ /* @__PURE__ */ jsxs2(
266
+ "div",
267
+ {
268
+ className: linkClasses,
269
+ onClick: handleOnClick,
270
+ onKeyDown: handleKeyDown,
271
+ role: "button",
272
+ tabIndex: 0,
273
+ "aria-expanded": !!ariaExpanded,
274
+ children: [
275
+ /* @__PURE__ */ jsx3(LinkElement, { className: "mobius-accordion__link-text", children: text }),
276
+ /* @__PURE__ */ jsx3(Icon, { icon: chevronDown, className: iconClasses })
277
+ ]
278
+ }
279
+ ),
280
+ headerChildren
281
+ ]
282
+ }
283
+ );
284
+ }
285
+ return /* @__PURE__ */ jsxs2(
286
+ "div",
287
+ {
288
+ className: linkClasses,
289
+ onClick: handleOnClick,
290
+ onKeyDown: handleKeyDown,
291
+ role: "button",
292
+ tabIndex: 0,
293
+ "aria-expanded": !!ariaExpanded,
294
+ children: [
295
+ /* @__PURE__ */ jsx3(LinkElement, { className: "mobius-accordion__link-text", children: text }),
296
+ /* @__PURE__ */ jsx3(Icon, { icon: chevronDown, className: iconClasses })
297
+ ]
298
+ }
299
+ );
300
+ };
301
+ var Accordion = forwardRef2((props, ref) => {
302
+ const {
303
+ showText = "See more",
304
+ hideText = "See less",
305
+ headerPosition = "top",
306
+ startOpen = false,
307
+ linkElementType,
308
+ onOpen,
309
+ onClose,
310
+ onChange = () => {
311
+ },
312
+ headerChildren,
313
+ ...rest
314
+ } = props;
315
+ const [accordionState, setAccordionState] = useState2({
316
+ open: true,
317
+ withAnimation: false
318
+ });
319
+ const prefersReducedMotion = usePrefersReducedMotion();
320
+ const containerClasses = classNames3(
321
+ "mobius",
322
+ "mobius-accordion",
323
+ props.className,
324
+ {
325
+ "--should-animate": accordionState.withAnimation && !prefersReducedMotion,
326
+ "--is-open": accordionState.open
327
+ }
328
+ );
329
+ const contentContainerClasses = classNames3(
330
+ "mobius-accordion__content-container",
331
+ {
332
+ "--is-open": accordionState.open
333
+ }
334
+ );
335
+ const contentClasses = classNames3("mobius-accordion__content", {
336
+ "--is-open": accordionState.open
337
+ });
338
+ const linkText = accordionState.open ? hideText : showText;
339
+ const handleChange = () => {
340
+ if (!accordionState.open && onOpen) {
341
+ onOpen();
342
+ }
343
+ if (accordionState.open && onClose) {
344
+ onClose();
345
+ }
346
+ if (onChange) {
347
+ onChange(!accordionState.open);
348
+ }
349
+ setAccordionState({
350
+ open: !accordionState.open,
351
+ withAnimation: true
352
+ });
353
+ };
354
+ useEffect2(() => {
355
+ setAccordionState({
356
+ open: startOpen,
357
+ withAnimation: false
358
+ });
359
+ }, [startOpen]);
360
+ return /* @__PURE__ */ jsxs2("div", { ref, ...rest, className: containerClasses, children: [
361
+ headerPosition === "top" && /* @__PURE__ */ jsx3(
362
+ AccordionLink,
363
+ {
364
+ text: linkText,
365
+ elementType: linkElementType,
366
+ toggle: handleChange,
367
+ ariaExpanded: accordionState.open,
368
+ headerChildren
369
+ }
370
+ ),
371
+ /* @__PURE__ */ jsx3(
372
+ "div",
373
+ {
374
+ className: contentContainerClasses,
375
+ "aria-hidden": !accordionState.open,
376
+ children: /* @__PURE__ */ jsx3("div", { className: contentClasses, children: props.children })
377
+ }
378
+ ),
379
+ headerPosition === "bottom" && /* @__PURE__ */ jsx3(
380
+ AccordionLink,
381
+ {
382
+ text: linkText,
383
+ toggle: handleChange,
384
+ ariaExpanded: accordionState.open,
385
+ headerChildren
386
+ }
387
+ )
388
+ ] });
389
+ });
390
+ Accordion.displayName = "Accordion";
391
+
392
+ // src/components/AddressLookup/AddressLookup.tsx
393
+ import { search } from "@simplybusiness/icons";
394
+ import { forwardRef as forwardRef8, useCallback as useCallback4, useState as useState10 } from "react";
395
+
396
+ // src/components/Combobox/Combobox.tsx
397
+ import classNames12 from "classnames/dedupe";
398
+ import { forwardRef as forwardRef7, useEffect as useEffect14, useId as useId3, useRef as useRef7, useState as useState9 } from "react";
399
+
400
+ // src/hooks/useBodyScrollLock/useBodyScrollLock.ts
401
+ import { useEffect as useEffect3 } from "react";
402
+ function useBodyScrollLock({
403
+ enabled = true
404
+ } = {}) {
405
+ function disableScrollLock() {
406
+ document.body.style.removeProperty("overflow");
407
+ document.body.style.removeProperty("scrollbar-gutter");
408
+ document.documentElement.style.removeProperty("scrollbar-gutter");
409
+ }
410
+ function enableScrollLock() {
411
+ document.body.style.overflow = "hidden";
412
+ document.body.style.scrollbarGutter = "stable";
413
+ document.documentElement.style.scrollbarGutter = "stable";
414
+ }
415
+ useEffect3(() => {
416
+ if (enabled) {
417
+ enableScrollLock();
418
+ } else {
419
+ disableScrollLock();
420
+ }
421
+ return () => {
422
+ disableScrollLock();
423
+ };
424
+ }, [enabled]);
425
+ }
426
+
427
+ // src/hooks/useBreakpoint/useBreakpoint.tsx
428
+ import debounce from "lodash.debounce";
429
+ import { useCallback, useEffect as useEffect4, useState as useState3 } from "react";
430
+ var DEFAULT_BREAKPOINTS = [
431
+ { size: "xs", value: 320 },
432
+ { size: "sm", value: 480 },
433
+ { size: "md", value: 670 },
434
+ { size: "lg", value: 960 },
435
+ { size: "xl", value: 1200 },
436
+ { size: "xxl", value: 1320 }
437
+ ];
438
+ var getBreakpoint = (breakpoints, windowWidth) => {
439
+ const closest = breakpoints.findIndex(
440
+ (breakpoint) => breakpoint.value >= windowWidth + 1
441
+ );
442
+ const smallest = breakpoints[0];
443
+ const largest = breakpoints[breakpoints.length - 1];
444
+ const match = breakpoints[closest - 1];
445
+ if (closest === 0) return smallest;
446
+ if (closest === -1) return largest;
447
+ return match;
448
+ };
449
+ var useBreakpoint = (customBreakpoints) => {
450
+ const window2 = globalThis?.window || void 0;
451
+ const isClientSide = typeof window2 !== "undefined";
452
+ const breakpoints = customBreakpoints || DEFAULT_BREAKPOINTS;
453
+ const defaultBreakpoint = breakpoints[0];
454
+ const [windowWidth, setWindowWidth] = useState3(
455
+ isClientSide ? window2.innerWidth : defaultBreakpoint.value
456
+ );
457
+ const [currentBreakpoint, setCurrentBreakpoint] = useState3(defaultBreakpoint);
458
+ const handleResize = () => {
459
+ setWindowWidth(window2.innerWidth);
460
+ };
461
+ useEffect4(() => {
462
+ if (!windowWidth || breakpoints.length === 0) {
463
+ setCurrentBreakpoint(breakpoints[0]);
464
+ return;
465
+ }
466
+ const newBreakpoint = getBreakpoint(breakpoints, windowWidth);
467
+ if (currentBreakpoint.size === newBreakpoint?.size) return;
468
+ setCurrentBreakpoint(newBreakpoint);
469
+ }, [currentBreakpoint, windowWidth, breakpoints]);
470
+ useEffect4(() => {
471
+ window2.addEventListener("resize", debounce(handleResize, 200), {
472
+ passive: true
473
+ });
474
+ return () => window2.removeEventListener("resize", handleResize);
475
+ }, [window2]);
476
+ const up = useCallback(
477
+ (size) => {
478
+ const sizeIndex = breakpoints.findIndex((item) => item.size === size);
479
+ if (sizeIndex === -1) {
480
+ return false;
481
+ }
482
+ const currentIndex = breakpoints.findIndex(
483
+ (item) => item.size === currentBreakpoint.size
484
+ );
485
+ return currentIndex >= sizeIndex;
486
+ },
487
+ [currentBreakpoint, breakpoints]
488
+ );
489
+ const down = useCallback(
490
+ (size) => {
491
+ const sizeIndex = breakpoints.findIndex((item) => item.size === size);
492
+ if (sizeIndex === -1) {
493
+ return true;
494
+ }
495
+ const currentIndex = breakpoints.findIndex(
496
+ (item) => item.size === currentBreakpoint.size
497
+ );
498
+ return currentIndex <= sizeIndex;
499
+ },
500
+ [currentBreakpoint, breakpoints]
501
+ );
502
+ return {
503
+ breakpoint: isClientSide ? currentBreakpoint : defaultBreakpoint,
504
+ up,
505
+ down
506
+ };
507
+ };
508
+
509
+ // src/hooks/useButton/useButton.tsx
510
+ import { useCallback as useCallback2 } from "react";
511
+ function useButton({
512
+ elementType = "button",
513
+ type = "button",
514
+ isDisabled = false,
515
+ href,
516
+ target,
517
+ rel,
518
+ role,
519
+ name,
520
+ value,
521
+ onClick,
522
+ onPress
523
+ }) {
524
+ const realOnClick = useCallback2(
525
+ (event) => {
526
+ if (isDisabled) {
527
+ return;
528
+ }
529
+ onClick?.(event);
530
+ onPress?.(event);
531
+ },
532
+ [isDisabled, onClick, onPress]
533
+ );
534
+ function getRole() {
535
+ if (role) {
536
+ return role;
537
+ }
538
+ if (elementType === "a") {
539
+ return void 0;
540
+ }
541
+ return "button";
542
+ }
543
+ const extraProps = elementType === "button" ? { type } : {
544
+ role: getRole()
545
+ };
546
+ return {
547
+ buttonProps: {
548
+ href: elementType === "a" ? href : void 0,
549
+ target: elementType === "a" ? target : void 0,
550
+ rel: elementType === "a" ? rel : void 0,
551
+ tabIndex: isDisabled ? -1 : 0,
552
+ disabled: isDisabled || void 0,
553
+ "aria-disabled": isDisabled || void 0,
554
+ name: elementType === "input" || elementType === "button" ? name : void 0,
555
+ value: elementType === "input" || elementType === "button" ? value : void 0,
556
+ ...extraProps,
557
+ onClick: realOnClick
558
+ }
559
+ };
560
+ }
561
+
562
+ // src/hooks/useDebouncedValue/useDebouncedValue.tsx
563
+ import { useEffect as useEffect5, useState as useState4 } from "react";
564
+ function useDebouncedValue(value, delay = 0) {
565
+ const [debouncedValue, setDebouncedValue] = useState4(value);
566
+ useEffect5(() => {
567
+ let timeout = null;
568
+ if (delay === 0) {
569
+ setDebouncedValue(value);
570
+ } else {
571
+ timeout = setTimeout(() => {
572
+ setDebouncedValue(value);
573
+ }, delay);
574
+ }
575
+ return () => {
576
+ if (timeout) {
577
+ clearTimeout(timeout);
578
+ timeout = null;
579
+ }
580
+ };
581
+ }, [value, delay]);
582
+ return debouncedValue;
583
+ }
584
+
585
+ // src/hooks/useDeprecationWarning/useDeprecationWarning.ts
586
+ import { useRef } from "react";
587
+ var useDeprecationWarning = (props) => {
588
+ const hasWarned = useRef(false);
589
+ const deprecatedProps = Object.entries(props).reduce(
590
+ (acc, [key, value]) => {
591
+ if (value) {
592
+ acc.push(key);
593
+ }
594
+ return acc;
595
+ },
596
+ []
597
+ );
598
+ const noDeprecatedProps = deprecatedProps.length === 0;
599
+ if (noDeprecatedProps) {
600
+ return;
601
+ }
602
+ if (!hasWarned.current) {
603
+ deprecatedProps.forEach((prop) => {
604
+ console.warn(
605
+ `Deprecation warning: Mobius no longer supports the prop '${prop}'. Please refer to the documentation for more information.`
606
+ );
607
+ });
608
+ hasWarned.current = true;
609
+ }
610
+ };
611
+
612
+ // src/hooks/useDialog/useDialog.ts
613
+ import { useCallback as useCallback3, useEffect as useEffect7, useState as useState6 } from "react";
614
+
615
+ // src/hooks/useDialogPolyfill/useDialogPolyfill.ts
616
+ import { useEffect as useEffect6, useRef as useRef2, useState as useState5 } from "react";
617
+ var useDialogPolyfill = () => {
618
+ const [hasDialogSupport, setHasDialogSupport] = useState5(false);
619
+ const hasAlreadyLoaded = useRef2(false);
620
+ useEffect6(() => {
621
+ setHasDialogSupport(supportsDialog());
622
+ }, []);
623
+ const polyfillDialog = async (ref) => {
624
+ if (!hasAlreadyLoaded.current && !hasDialogSupport && typeof window !== "undefined" && ref.current !== null) {
625
+ const { default: dialogPolyfill } = await import("dialog-polyfill");
626
+ hasAlreadyLoaded.current = true;
627
+ try {
628
+ if (ref.current) {
629
+ dialogPolyfill.registerDialog(ref.current);
630
+ }
631
+ } catch (error3) {
632
+ console.error("Failed to load dialog-polyfill", error3);
633
+ }
634
+ }
635
+ };
636
+ return {
637
+ polyfillDialog
638
+ };
639
+ };
640
+
641
+ // src/hooks/useDialog/useDialog.ts
642
+ var TRANSITION_CLASS_NAME = "--transition";
643
+ var FALLBACK_TRANSITION_DURATION = 0;
644
+ var useDialog = (props) => {
645
+ const { ref, isOpen, transition, onOpen, onClose } = props;
646
+ const [hasDialogSupport, setHasDialogSupport] = useState6(false);
647
+ const shouldTransition = hasDialogSupport && transition.isEnabled;
648
+ const { polyfillDialog } = useDialogPolyfill();
649
+ useEffect7(() => {
650
+ setHasDialogSupport(supportsDialog());
651
+ }, []);
652
+ const TRANSITION_DURATION_IN_MS = ref.current && Number(
653
+ getComputedStyle(ref.current).getPropertyValue(transition.CSSVariable).replace("ms", "")
654
+ ) || FALLBACK_TRANSITION_DURATION;
655
+ useBodyScrollLock({ enabled: isOpen });
656
+ const open = useCallback3(() => {
657
+ ref.current?.showModal();
658
+ onOpen?.();
659
+ }, [onOpen, ref]);
660
+ const close = useCallback3(() => {
661
+ ref.current?.close();
662
+ onClose?.();
663
+ }, [onClose, ref]);
664
+ const handleClose = useCallback3(
665
+ (event) => {
666
+ if (event) {
667
+ event.preventDefault();
668
+ event.stopPropagation();
669
+ }
670
+ if (shouldTransition) {
671
+ ref.current?.classList.remove(TRANSITION_CLASS_NAME);
672
+ setTimeout(() => close(), TRANSITION_DURATION_IN_MS);
673
+ } else {
674
+ close();
675
+ }
676
+ },
677
+ [TRANSITION_DURATION_IN_MS, close, ref, shouldTransition]
678
+ );
679
+ useEffect7(() => {
680
+ async function toggleDialog() {
681
+ if (isOpen && !ref.current?.open) {
682
+ await polyfillDialog(ref);
683
+ open();
684
+ setTimeout(() => {
685
+ ref.current?.classList.add(TRANSITION_CLASS_NAME);
686
+ }, 0);
687
+ } else if (!isOpen && ref.current?.open) {
688
+ handleClose();
689
+ }
690
+ }
691
+ void toggleDialog();
692
+ }, [handleClose, isOpen, open, ref, polyfillDialog]);
693
+ return {
694
+ open,
695
+ close: handleClose
696
+ };
697
+ };
698
+
699
+ // src/hooks/useLabel/useLabel.tsx
700
+ import { useId, useRef as useRef3 } from "react";
701
+ function useLabel({
702
+ id: providedId,
703
+ label,
704
+ "aria-label": ariaLabel,
705
+ "aria-labelledby": ariaLabelledby,
706
+ labelElementType = "label"
707
+ }) {
708
+ let labelProps = {};
709
+ let fieldProps = {};
710
+ const hasWarnedAboutMissingLabels = useRef3(false);
711
+ const fallbackId = useId();
712
+ const id = providedId || fallbackId;
713
+ const labelId = useId();
714
+ if (label) {
715
+ ariaLabelledby = ariaLabelledby ? `${labelId} ${ariaLabelledby}` : labelId;
716
+ labelProps = {
717
+ id: labelId,
718
+ htmlFor: labelElementType === "label" ? id : void 0
719
+ };
720
+ } else if (!ariaLabelledby && !ariaLabel && !hasWarnedAboutMissingLabels.current) {
721
+ hasWarnedAboutMissingLabels.current = true;
722
+ console.warn(
723
+ "If you do not provide a visible label, you must specify an aria-label or aria-labelledby attribute for accessibility"
724
+ );
725
+ }
726
+ fieldProps = {
727
+ id,
728
+ "aria-label": ariaLabel,
729
+ "aria-labelledby": ariaLabelledby
730
+ };
731
+ return {
732
+ labelProps,
733
+ fieldProps
734
+ };
735
+ }
736
+
737
+ // src/hooks/useOnClickOutside/useOnClickOutside.tsx
738
+ import { useEffect as useEffect8 } from "react";
739
+ var useOnClickOutside = (ref, handler) => {
740
+ useEffect8(() => {
741
+ const listener = (event) => {
742
+ if (!ref.current || ref.current.contains(event.target)) {
743
+ return;
744
+ }
745
+ event.preventDefault();
746
+ event.stopPropagation();
747
+ handler(event);
748
+ };
749
+ const handleEscapeKeyPress = (event) => {
750
+ if (event.key === "Escape") {
751
+ event.preventDefault();
752
+ event.stopPropagation();
753
+ handler(event);
754
+ }
755
+ };
756
+ document.addEventListener("mousedown", listener);
757
+ document.addEventListener("touchstart", listener);
758
+ document.addEventListener("keydown", handleEscapeKeyPress);
759
+ return () => {
760
+ document.removeEventListener("mousedown", listener);
761
+ document.removeEventListener("touchstart", listener);
762
+ document.addEventListener("keydown", handleEscapeKeyPress);
763
+ };
764
+ }, [ref, handler]);
765
+ };
766
+
767
+ // src/hooks/useOnUnmount/useOnUnmount.tsx
768
+ import { useEffect as useEffect9, useRef as useRef4 } from "react";
769
+ function useOnUnmount(callback) {
770
+ const callbackRef = useRef4(callback);
771
+ useEffect9(() => {
772
+ callbackRef.current = callback;
773
+ }, [callback]);
774
+ useEffect9(
775
+ () => () => {
776
+ callbackRef.current();
777
+ },
778
+ []
779
+ );
780
+ }
781
+
782
+ // src/hooks/useRenderCount/useRenderCount.ts
783
+ import { useEffect as useEffect10, useRef as useRef5 } from "react";
784
+ function useRenderCount() {
785
+ const count = useRef5(1);
786
+ useEffect10(() => {
787
+ count.current += 1;
788
+ });
789
+ return count.current;
790
+ }
791
+
792
+ // src/hooks/useTextField/useTextField.tsx
793
+ import { useId as useId2 } from "react";
794
+ function useTextField(props) {
795
+ const {
796
+ isDisabled = false,
797
+ isReadOnly = false,
798
+ isRequired = false,
799
+ inputElementType = "input"
800
+ } = props;
801
+ const { labelProps, fieldProps } = useLabel(props);
802
+ const descriptionId = useId2();
803
+ const descriptionProps = { id: descriptionId };
804
+ const errorMessageId = useId2();
805
+ const errorMessageProps = { id: errorMessageId };
806
+ const ariaDescribedBy = spaceDelimitedList([
807
+ props.description && descriptionId,
808
+ props.errorMessage && errorMessageId,
809
+ props["aria-describedby"]
810
+ ]);
811
+ return {
812
+ descriptionProps,
813
+ errorMessageProps,
814
+ labelProps,
815
+ inputProps: {
816
+ defaultValue: props.defaultValue,
817
+ value: props.value,
818
+ onChange: props.onChange,
819
+ disabled: isDisabled,
820
+ readOnly: isReadOnly,
821
+ required: isRequired,
822
+ "aria-required": isRequired === true ? true : void 0,
823
+ "aria-invalid": props.isInvalid,
824
+ "aria-describedby": ariaDescribedBy,
825
+ "aria-errormessage": props["aria-errormessage"],
826
+ role: props.role,
827
+ type: inputElementType === "input" ? props.type : void 0,
828
+ pattern: inputElementType === "input" ? props.pattern : void 0,
829
+ autoComplete: props.autoComplete,
830
+ maxLength: props.maxLength,
831
+ minLength: props.minLength,
832
+ name: props.name,
833
+ placeholder: props.placeholder,
834
+ inputMode: props.inputMode,
835
+ // Clipboard events
836
+ onCopy: props.onCopy,
837
+ onCut: props.onCut,
838
+ onPaste: props.onPaste,
839
+ // Composition events
840
+ onCompositionEnd: props.onCompositionEnd,
841
+ onCompositionStart: props.onCompositionStart,
842
+ onCompositionUpdate: props.onCompositionUpdate,
843
+ // Selection events
844
+ onSelect: props.onSelect,
845
+ // Input events
846
+ onBeforeInput: props.onBeforeInput,
847
+ onInput: props.onInput,
848
+ // Focus events
849
+ onFocus: props.onFocus,
850
+ onBlur: props.onBlur,
851
+ ...fieldProps
852
+ }
853
+ };
854
+ }
855
+
856
+ // src/hooks/useValidationClasses/useValidationClasses.ts
857
+ var useValidationClasses = (props) => {
858
+ const { validationState, isInvalid } = props;
859
+ useDeprecationWarning({ validationState });
860
+ if (isInvalid || validationState === "invalid") {
861
+ return "--is-invalid";
862
+ }
863
+ if (isInvalid === false || validationState === "valid") {
864
+ return "--is-valid";
865
+ }
866
+ return "";
867
+ };
868
+
869
+ // src/hooks/useWindowEvent/useWindowEvent.tsx
870
+ import { useEffect as useEffect11 } from "react";
871
+ function normaliseOptions(options, otherOptions = {}) {
872
+ if (typeof options === "undefined") {
873
+ return otherOptions;
874
+ }
875
+ if (typeof options === "boolean") {
876
+ return { capture: options, ...otherOptions };
877
+ }
878
+ return { ...options, ...otherOptions };
879
+ }
880
+ function useWindowEvent(type, listener, options) {
881
+ useEffect11(() => {
882
+ const controller = new AbortController();
883
+ const { signal } = controller;
884
+ const normalisedOptions = normaliseOptions(options, { signal });
885
+ window.addEventListener(type, listener, normalisedOptions);
886
+ return () => {
887
+ controller.abort();
888
+ window.removeEventListener(type, listener, normalisedOptions);
889
+ };
890
+ }, [type, listener, options]);
891
+ }
892
+
893
+ // src/components/TextField/TextField.tsx
894
+ import classNames9 from "classnames/dedupe";
895
+ import { forwardRef as forwardRef6 } from "react";
896
+
897
+ // src/components/ErrorMessage/ErrorMessage.tsx
898
+ import { error } from "@simplybusiness/icons";
899
+ import classNames5 from "classnames/dedupe";
900
+
901
+ // src/components/Text/Text.tsx
902
+ import { forwardRef as forwardRef3 } from "react";
903
+ import classNames4 from "classnames/dedupe";
904
+ import { jsx as jsx4 } from "react/jsx-runtime";
905
+ var getElementType = (variant, elementType) => {
906
+ if (variant) {
907
+ return ["h1", "h2", "h3", "h4"].includes(variant) ? variant : "p";
908
+ }
909
+ return elementType || "p";
910
+ };
911
+ var Text = forwardRef3(
912
+ ({ elementType: Component = "p", ...props }, ref) => {
913
+ const { variant, className, spacing, ...otherProps } = props;
914
+ const elementType = getElementType(variant, Component);
915
+ const variantType = variant || elementType;
916
+ const classes = classNames4(
917
+ "mobius",
918
+ "mobius-text",
919
+ { [`--is-${variantType}`]: variantType },
920
+ { [`--has-line-height-${spacing}`]: spacing },
921
+ className
922
+ );
923
+ return /* @__PURE__ */ jsx4(Component, { ref, ...otherProps, className: classes });
924
+ }
925
+ );
926
+ Text.displayName = "Text";
927
+
928
+ // src/components/ErrorMessage/ErrorMessage.tsx
929
+ import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
930
+ var ErrorMessage = ({
931
+ id,
932
+ errorMessage,
933
+ className
934
+ }) => {
935
+ const classes = classNames5("mobius", "mobius-error-message", className);
936
+ if (!errorMessage) return null;
937
+ return /* @__PURE__ */ jsxs3("div", { id, className: classes, "data-testid": "ErrorMessage", role: "alert", children: [
938
+ /* @__PURE__ */ jsx5(Icon, { icon: error, className: "mobius-error-message__icon" }),
939
+ /* @__PURE__ */ jsx5(Text, { elementType: "span", className: "mobius-error-message__text", children: errorMessage })
940
+ ] });
941
+ };
942
+ ErrorMessage.displayName = "ErrorMessage";
943
+
944
+ // src/components/Label/Label.tsx
945
+ import { forwardRef as forwardRef4 } from "react";
946
+ import classNames6 from "classnames/dedupe";
947
+ import { jsx as jsx6 } from "react/jsx-runtime";
948
+ var Label = forwardRef4(
949
+ (props, ref) => {
950
+ const { elementType: Element = "label", children, ...otherProps } = props;
951
+ const classes = classNames6("mobius", "mobius-label", props.className);
952
+ otherProps.className = classes;
953
+ return /* @__PURE__ */ jsx6(Element, { ref, ...otherProps, className: classes, children });
954
+ }
955
+ );
956
+ Label.displayName = "Label";
957
+
958
+ // src/components/Stack/Stack.tsx
959
+ import { forwardRef as forwardRef5 } from "react";
960
+ import classNames7 from "classnames/dedupe";
961
+ import { jsx as jsx7 } from "react/jsx-runtime";
962
+ var Stack = forwardRef5((props, ref) => {
963
+ const { elementType: Element = "div", gap, ...otherProps } = props;
964
+ const classes = classNames7(
965
+ "mobius",
966
+ "mobius-stack",
967
+ {
968
+ [`--gap-${gap}`]: gap
969
+ },
970
+ otherProps.className
971
+ );
972
+ return /* @__PURE__ */ jsx7(Element, { ref, ...otherProps, className: classes });
973
+ });
974
+ Stack.displayName = "Stack";
975
+
976
+ // src/components/TextField/adornmentWithClassName.ts
977
+ import classNames8 from "classnames";
978
+ import { cloneElement } from "react";
979
+ var adornmentWithClassName = (component, validationClasses, className) => {
980
+ if (!component) return null;
981
+ return cloneElement(component, {
982
+ className: classNames8(
983
+ component.props.className,
984
+ validationClasses,
985
+ className
986
+ )
987
+ });
988
+ };
989
+
990
+ // src/components/TextField/TextField.tsx
991
+ import { jsx as jsx8, jsxs as jsxs4 } from "react/jsx-runtime";
992
+ var TextField = forwardRef6((props, ref) => {
993
+ const {
994
+ isDisabled,
995
+ type = "text",
996
+ validationState,
997
+ isInvalid,
998
+ className,
999
+ label,
1000
+ errorMessage,
1001
+ children,
1002
+ isRequired,
1003
+ prefixInside,
1004
+ prefixOutside,
1005
+ suffixInside,
1006
+ suffixOutside,
1007
+ isReadOnly,
1008
+ ...otherProps
1009
+ } = props;
1010
+ const { inputProps, labelProps, errorMessageProps } = useTextField({
1011
+ ...props,
1012
+ "aria-errormessage": errorMessage
1013
+ });
1014
+ const hidden = type === "hidden";
1015
+ const validationClasses = useValidationClasses({
1016
+ validationState,
1017
+ isInvalid
1018
+ });
1019
+ const textfieldClasses = {
1020
+ "--is-disabled": isDisabled,
1021
+ "--is-required": typeof isRequired === "boolean" && isRequired,
1022
+ "--is-optional": typeof isRequired === "boolean" && !isRequired,
1023
+ "--is-hidden": hidden,
1024
+ [className || ""]: true
1025
+ };
1026
+ const sharedClasses = classNames9(validationClasses, textfieldClasses);
1027
+ const labelClasses = classNames9(
1028
+ {
1029
+ "--is-disabled": isDisabled
1030
+ },
1031
+ validationClasses
1032
+ );
1033
+ const containerClasses = classNames9(
1034
+ "mobius",
1035
+ "mobius-text-field",
1036
+ sharedClasses
1037
+ );
1038
+ const inputClasses = classNames9(
1039
+ "mobius",
1040
+ "mobius-text-field__input",
1041
+ sharedClasses
1042
+ );
1043
+ const inputWrapperClasses = classNames9(
1044
+ "mobius-text-field__input-wrapper",
1045
+ sharedClasses
1046
+ );
1047
+ return /* @__PURE__ */ jsxs4(Stack, { gap: "xs", className: containerClasses, children: [
1048
+ label && !hidden && /* @__PURE__ */ jsx8(Label, { ...labelProps, className: labelClasses, children: label }),
1049
+ /* @__PURE__ */ jsxs4("div", { className: "mobius-text-field__inner-container", children: [
1050
+ adornmentWithClassName(
1051
+ prefixOutside,
1052
+ labelClasses,
1053
+ "mobius-text-field__prefix-outside"
1054
+ ),
1055
+ /* @__PURE__ */ jsxs4("div", { className: inputWrapperClasses, children: [
1056
+ adornmentWithClassName(
1057
+ prefixInside,
1058
+ labelClasses,
1059
+ "mobius-text-field__prefix-inside"
1060
+ ),
1061
+ /* @__PURE__ */ jsx8(
1062
+ "input",
1063
+ {
1064
+ ...otherProps,
1065
+ ...inputProps,
1066
+ ref,
1067
+ type,
1068
+ className: inputClasses
1069
+ }
1070
+ ),
1071
+ adornmentWithClassName(
1072
+ suffixInside,
1073
+ labelClasses,
1074
+ "mobius-text-field__suffix-inside"
1075
+ )
1076
+ ] }),
1077
+ adornmentWithClassName(
1078
+ suffixOutside,
1079
+ labelClasses,
1080
+ "mobius-text-field__suffix-outside"
1081
+ )
1082
+ ] }),
1083
+ children && /* @__PURE__ */ jsx8("div", { className: "mobius-text-field__children", children }),
1084
+ /* @__PURE__ */ jsx8(ErrorMessage, { ...errorMessageProps, errorMessage })
1085
+ ] });
1086
+ });
1087
+ TextField.displayName = "TextField";
1088
+
1089
+ // src/components/VisuallyHidden/VisuallyHidden.tsx
1090
+ import { jsx as jsx9 } from "react/jsx-runtime";
1091
+ function VisuallyHidden(props) {
1092
+ const {
1093
+ className,
1094
+ children,
1095
+ elementType: Component = "div",
1096
+ ...otherProps
1097
+ } = props;
1098
+ return /* @__PURE__ */ jsx9(
1099
+ Component,
1100
+ {
1101
+ className,
1102
+ style: {
1103
+ border: 0,
1104
+ clip: "rect(0 0 0 0)",
1105
+ clipPath: "inset(50%)",
1106
+ height: "1px",
1107
+ margin: "-1px",
1108
+ overflow: "hidden",
1109
+ padding: 0,
1110
+ position: "absolute",
1111
+ width: "1px",
1112
+ whiteSpace: "nowrap"
1113
+ },
1114
+ ...otherProps,
1115
+ children
1116
+ }
1117
+ );
1118
+ }
1119
+
1120
+ // src/components/Combobox/Listbox.tsx
1121
+ import classNames11 from "classnames";
1122
+
1123
+ // src/components/Combobox/Option.tsx
1124
+ import { useEffect as useEffect12, useRef as useRef6 } from "react";
1125
+ import classNames10 from "classnames/dedupe";
1126
+
1127
+ // src/components/Combobox/utils.tsx
1128
+ function isOptionGroup(options) {
1129
+ if (!options) return false;
1130
+ return typeof options[0] === "object" && "options" in options[0] && options[0].options !== void 0 && "heading" in options[0] && options[0].heading !== void 0;
1131
+ }
1132
+ var getOptionValue = (option) => typeof option === "string" ? option : option?.value;
1133
+ var getOptionLabel = (option) => typeof option === "string" ? option : option?.label;
1134
+ function filterOptions(options, inputValue) {
1135
+ if (isOptionGroup(options)) {
1136
+ return options.map((optionGroup) => ({
1137
+ ...optionGroup,
1138
+ options: optionGroup.options.filter(
1139
+ (option) => getOptionLabel(option).toLowerCase().includes(inputValue.toLowerCase())
1140
+ )
1141
+ })).filter((optionGroup) => optionGroup.options.length > 0);
1142
+ }
1143
+ return options.filter(
1144
+ (option) => getOptionLabel(option).toLowerCase().includes(inputValue.toLowerCase())
1145
+ );
1146
+ }
1147
+
1148
+ // src/components/Combobox/Option.tsx
1149
+ import { jsx as jsx10 } from "react/jsx-runtime";
1150
+ var Option = ({
1151
+ option,
1152
+ isHighlighted,
1153
+ onOptionSelect,
1154
+ optionComponent: OptionComponent,
1155
+ id
1156
+ }) => {
1157
+ const optionRef = useRef6(null);
1158
+ useEffect12(() => {
1159
+ if (isHighlighted && optionRef.current && optionRef.current.scrollIntoView) {
1160
+ optionRef.current.scrollIntoView({ block: "nearest" });
1161
+ }
1162
+ }, [isHighlighted]);
1163
+ return /* @__PURE__ */ jsx10(
1164
+ "li",
1165
+ {
1166
+ ref: optionRef,
1167
+ role: "option",
1168
+ id,
1169
+ "aria-selected": isHighlighted,
1170
+ onMouseDown: () => onOptionSelect(option),
1171
+ className: classNames10("mobius-combobox__option", "has-pii", {
1172
+ "mobius-combobox__option--is-highlighted": isHighlighted
1173
+ }),
1174
+ children: OptionComponent ? /* @__PURE__ */ jsx10(OptionComponent, { option, isHighlighted }) : getOptionLabel(option)
1175
+ },
1176
+ getOptionValue(option)
1177
+ );
1178
+ };
1179
+
1180
+ // src/components/Combobox/Listbox.tsx
1181
+ import { jsx as jsx11, jsxs as jsxs5 } from "react/jsx-runtime";
1182
+ var Listbox = ({
1183
+ id,
1184
+ options,
1185
+ highlightedIndex,
1186
+ highlightedGroupIndex,
1187
+ onOptionSelect,
1188
+ optionComponent
1189
+ }) => {
1190
+ const classes = classNames11("mobius-combobox__list");
1191
+ function getOptionId(option, groupIndex, index) {
1192
+ if (typeof option === "object" && "id" in option && typeof option.id === "string") {
1193
+ return option.id;
1194
+ }
1195
+ return isOptionGroup(options) ? `${id}-option-${groupIndex}-${index}` : `${id}-option-${index}`;
1196
+ }
1197
+ if (options && options.length === 0) {
1198
+ return /* @__PURE__ */ jsx11("div", { role: "listbox", id, className: classes, children: /* @__PURE__ */ jsx11("div", { className: "mobius-combobox__no-options", children: "No options" }) });
1199
+ }
1200
+ return /* @__PURE__ */ jsx11("div", { role: "listbox", id, className: classes, children: isOptionGroup(options) ? options.map((option, groupIndex) => /* @__PURE__ */ jsxs5(
1201
+ "ul",
1202
+ {
1203
+ role: "group",
1204
+ "aria-labelledby": `${id}-group-${groupIndex}`,
1205
+ className: "mobius-combobox__group",
1206
+ children: [
1207
+ /* @__PURE__ */ jsx11(
1208
+ "li",
1209
+ {
1210
+ role: "presentation",
1211
+ id: `${id}-group-${groupIndex}`,
1212
+ className: "mobius-combobox__group-label",
1213
+ children: option.heading
1214
+ }
1215
+ ),
1216
+ option.options.map((groupOption, index) => /* @__PURE__ */ jsx11(
1217
+ Option,
1218
+ {
1219
+ option: groupOption,
1220
+ isHighlighted: highlightedIndex === index && highlightedGroupIndex === groupIndex,
1221
+ onOptionSelect,
1222
+ optionComponent,
1223
+ id: getOptionId(groupOption, groupIndex, index)
1224
+ },
1225
+ `${id}-option-${groupIndex}-${index}`
1226
+ ))
1227
+ ]
1228
+ },
1229
+ option.heading
1230
+ )) : typeof options !== "undefined" ? options.map((option, index) => /* @__PURE__ */ jsx11(
1231
+ Option,
1232
+ {
1233
+ option,
1234
+ isHighlighted: highlightedIndex === index,
1235
+ onOptionSelect,
1236
+ optionComponent,
1237
+ id: getOptionId(option, 0, index)
1238
+ },
1239
+ index
1240
+ )) : null });
1241
+ };
1242
+
1243
+ // src/components/Combobox/useComboboxHighlight.tsx
1244
+ import { useState as useState7 } from "react";
1245
+ function useComboboxHighlight(options) {
1246
+ const [highlightedIndex, setHighlightedIndex] = useState7(
1247
+ options && options.length ? 0 : -1
1248
+ );
1249
+ const [highlightedGroupIndex, setHighlightedGroupIndex] = useState7(0);
1250
+ function highlightNextOption() {
1251
+ const isGroup = isOptionGroup(options);
1252
+ if (!options) {
1253
+ return;
1254
+ }
1255
+ if (isGroup) {
1256
+ const group = options[highlightedGroupIndex];
1257
+ if (highlightedIndex === group.options.length - 1) {
1258
+ if (highlightedGroupIndex === options.length - 1) {
1259
+ return;
1260
+ }
1261
+ setHighlightedIndex(0);
1262
+ setHighlightedGroupIndex(highlightedGroupIndex + 1);
1263
+ } else {
1264
+ setHighlightedIndex(highlightedIndex + 1);
1265
+ }
1266
+ } else {
1267
+ if (highlightedIndex === options.length - 1) {
1268
+ return;
1269
+ }
1270
+ setHighlightedIndex(highlightedIndex + 1);
1271
+ }
1272
+ }
1273
+ function highlightPreviousOption() {
1274
+ const isGroup = isOptionGroup(options);
1275
+ if (highlightedIndex === 0 && highlightedGroupIndex === 0) {
1276
+ return;
1277
+ }
1278
+ if (isGroup) {
1279
+ if (highlightedIndex === 0) {
1280
+ const prevGroupIndex = highlightedGroupIndex - 1;
1281
+ const prevGroup = options[prevGroupIndex];
1282
+ setHighlightedGroupIndex(prevGroupIndex);
1283
+ setHighlightedIndex(prevGroup.options.length - 1);
1284
+ } else {
1285
+ setHighlightedIndex(highlightedIndex - 1);
1286
+ }
1287
+ } else {
1288
+ setHighlightedIndex(highlightedIndex - 1);
1289
+ }
1290
+ }
1291
+ function highlightFirstOption() {
1292
+ setHighlightedIndex(0);
1293
+ setHighlightedGroupIndex(0);
1294
+ }
1295
+ function highlightLastOption() {
1296
+ const isGroup = isOptionGroup(options);
1297
+ if (!options) {
1298
+ return;
1299
+ }
1300
+ if (isGroup) {
1301
+ const lastGroupIndex = options.length - 1;
1302
+ const lastGroup = options[lastGroupIndex];
1303
+ setHighlightedGroupIndex(lastGroupIndex);
1304
+ setHighlightedIndex(lastGroup.options.length - 1);
1305
+ } else {
1306
+ setHighlightedIndex(options.length - 1);
1307
+ }
1308
+ }
1309
+ const clearHighlight = () => {
1310
+ setHighlightedIndex(
1311
+ typeof options === "undefined" || options.length ? 0 : -1
1312
+ );
1313
+ setHighlightedGroupIndex(0);
1314
+ };
1315
+ return {
1316
+ highlightedIndex,
1317
+ highlightedGroupIndex,
1318
+ highlightPreviousOption,
1319
+ highlightNextOption,
1320
+ highlightFirstOption,
1321
+ highlightLastOption,
1322
+ clearHighlight
1323
+ };
1324
+ }
1325
+
1326
+ // src/components/Combobox/useComboboxOptions.ts
1327
+ import { useEffect as useEffect13, useState as useState8 } from "react";
1328
+ function useComboboxOptions({
1329
+ options,
1330
+ asyncOptions,
1331
+ delay = 300,
1332
+ minSearchLength = 3,
1333
+ inputValue = "",
1334
+ skipNextDebounceRef,
1335
+ onSearched
1336
+ }) {
1337
+ const [filteredOptions, setFilteredOptions] = useState8(void 0);
1338
+ const debouncedInputValue = useDebouncedValue(
1339
+ inputValue,
1340
+ // Don't debounce synchronous options
1341
+ options ? 0 : delay
1342
+ );
1343
+ const [isLoading, setIsLoading] = useState8(false);
1344
+ const [error3, setError] = useState8(null);
1345
+ useEffect13(() => {
1346
+ const controller = new AbortController();
1347
+ const { signal } = controller;
1348
+ const fetchOptions = async () => {
1349
+ setIsLoading(true);
1350
+ setError(null);
1351
+ try {
1352
+ if (asyncOptions) {
1353
+ if (debouncedInputValue.length < minSearchLength) {
1354
+ setFilteredOptions(void 0);
1355
+ return;
1356
+ }
1357
+ const result = await asyncOptions(debouncedInputValue, { signal });
1358
+ setFilteredOptions(result);
1359
+ onSearched?.(debouncedInputValue);
1360
+ } else {
1361
+ setFilteredOptions(filterOptions(options, debouncedInputValue));
1362
+ }
1363
+ } catch (e) {
1364
+ if (e instanceof DOMException && e.name === "AbortError") {
1365
+ return;
1366
+ }
1367
+ setError(e);
1368
+ } finally {
1369
+ setIsLoading(false);
1370
+ }
1371
+ };
1372
+ if (!skipNextDebounceRef?.current) {
1373
+ void fetchOptions();
1374
+ } else {
1375
+ skipNextDebounceRef.current = false;
1376
+ }
1377
+ return () => {
1378
+ controller.abort();
1379
+ };
1380
+ }, [
1381
+ debouncedInputValue,
1382
+ options,
1383
+ asyncOptions,
1384
+ delay,
1385
+ minSearchLength,
1386
+ skipNextDebounceRef,
1387
+ onSearched
1388
+ ]);
1389
+ function updateFilteredOptions(newOptions) {
1390
+ setIsLoading(true);
1391
+ return newOptions.then(setFilteredOptions).catch(setError).finally(() => setIsLoading(false));
1392
+ }
1393
+ return {
1394
+ filteredOptions,
1395
+ updateFilteredOptions,
1396
+ isLoading,
1397
+ error: error3,
1398
+ isError: error3 != null
1399
+ };
1400
+ }
1401
+
1402
+ // src/components/Combobox/Combobox.tsx
1403
+ import { jsx as jsx12, jsxs as jsxs6 } from "react/jsx-runtime";
1404
+ var ComboboxInner = forwardRef7(
1405
+ (props, ref) => {
1406
+ const {
1407
+ id,
1408
+ defaultValue,
1409
+ value,
1410
+ options,
1411
+ asyncOptions,
1412
+ delay,
1413
+ minSearchLength,
1414
+ onSelected,
1415
+ className,
1416
+ placeholder,
1417
+ icon,
1418
+ onBlur,
1419
+ onFocus,
1420
+ onChange,
1421
+ onSearched,
1422
+ optionComponent,
1423
+ errorMessage,
1424
+ ...otherProps
1425
+ } = props;
1426
+ const skipNextDebounceRef = useRef7(false);
1427
+ const fallbackRef = useRef7(null);
1428
+ const [inputValue, setInputValue] = useState9(defaultValue || "");
1429
+ const [isOpen, setIsOpen] = useState9(false);
1430
+ const { filteredOptions, updateFilteredOptions, isLoading, error: error3 } = useComboboxOptions({
1431
+ options,
1432
+ asyncOptions,
1433
+ inputValue,
1434
+ delay,
1435
+ minSearchLength,
1436
+ skipNextDebounceRef
1437
+ });
1438
+ const {
1439
+ highlightedIndex,
1440
+ highlightedGroupIndex,
1441
+ highlightNextOption,
1442
+ highlightPreviousOption,
1443
+ highlightFirstOption,
1444
+ highlightLastOption,
1445
+ clearHighlight
1446
+ } = useComboboxHighlight(filteredOptions);
1447
+ const showListbox = isOpen && filteredOptions && filteredOptions.length > 0;
1448
+ const inputRef = ref || fallbackRef;
1449
+ const listboxId = useId3();
1450
+ const statusId = useId3();
1451
+ const blurTimeoutRef = useRef7(null);
1452
+ const { down } = useBreakpoint();
1453
+ const isMobile = down("md");
1454
+ const handleFocus = (e) => {
1455
+ if (!filteredOptions || filteredOptions.length === 0) return;
1456
+ if (blurTimeoutRef.current) {
1457
+ clearTimeout(blurTimeoutRef.current);
1458
+ blurTimeoutRef.current = null;
1459
+ } else {
1460
+ onFocus?.(e);
1461
+ }
1462
+ setIsOpen(true);
1463
+ };
1464
+ useOnUnmount(() => {
1465
+ if (blurTimeoutRef.current) {
1466
+ clearTimeout(blurTimeoutRef.current);
1467
+ }
1468
+ });
1469
+ const handleInputChange = (e) => {
1470
+ const newValue = e.target.value;
1471
+ setInputValue(newValue);
1472
+ setIsOpen(true);
1473
+ clearHighlight();
1474
+ onChange?.(e);
1475
+ };
1476
+ const handleOptionSelect = (option) => {
1477
+ const val = getOptionValue(option);
1478
+ if (!val) return;
1479
+ if (typeof option === "object" && "callback" in option && option.callback && typeof option.callback === "function") {
1480
+ setTimeout(() => inputRef.current.focus(), 0);
1481
+ updateFilteredOptions(option.callback());
1482
+ return;
1483
+ }
1484
+ skipNextDebounceRef.current = true;
1485
+ setIsOpen(false);
1486
+ setInputValue(val);
1487
+ onSelected?.(option);
1488
+ };
1489
+ const getFirstOption = () => {
1490
+ if (!filteredOptions) return void 0;
1491
+ if (isOptionGroup(filteredOptions)) {
1492
+ return filteredOptions[0]?.options[0];
1493
+ }
1494
+ return filteredOptions[0];
1495
+ };
1496
+ const getHighlightedOption = () => {
1497
+ if (!filteredOptions) return void 0;
1498
+ if (highlightedIndex === -1) return void 0;
1499
+ if (isOptionGroup(filteredOptions)) {
1500
+ const group = filteredOptions[highlightedGroupIndex];
1501
+ return group?.options[highlightedIndex];
1502
+ }
1503
+ return filteredOptions[highlightedIndex];
1504
+ };
1505
+ const getHighlightedOptionId = () => {
1506
+ const option = getHighlightedOption();
1507
+ if (!option) return void 0;
1508
+ if (isOptionGroup(filteredOptions)) {
1509
+ return `${listboxId}-option-${highlightedGroupIndex}-${highlightedIndex}`;
1510
+ }
1511
+ return `${listboxId}-option-${highlightedIndex}`;
1512
+ };
1513
+ const handleBlur = (e) => {
1514
+ const typedText = inputValue.trim().toLowerCase();
1515
+ const highlightedOption = getHighlightedOption();
1516
+ const label = getOptionLabel(highlightedOption);
1517
+ if (typedText === label?.toLowerCase()) {
1518
+ handleOptionSelect(highlightedOption);
1519
+ }
1520
+ blurTimeoutRef.current = setTimeout(() => {
1521
+ onBlur?.(e);
1522
+ setIsOpen(false);
1523
+ }, 150);
1524
+ };
1525
+ const handleKeyDown = (e) => {
1526
+ switch (e.key) {
1527
+ case "ArrowDown":
1528
+ e.preventDefault();
1529
+ setIsOpen(true);
1530
+ highlightNextOption();
1531
+ break;
1532
+ case "ArrowUp":
1533
+ e.preventDefault();
1534
+ setIsOpen(true);
1535
+ highlightPreviousOption();
1536
+ break;
1537
+ case "Home":
1538
+ e.preventDefault();
1539
+ setIsOpen(true);
1540
+ highlightFirstOption();
1541
+ break;
1542
+ case "End":
1543
+ e.preventDefault();
1544
+ setIsOpen(true);
1545
+ highlightLastOption();
1546
+ break;
1547
+ case "Enter":
1548
+ e.preventDefault();
1549
+ if (isOpen) {
1550
+ const selectedOption = getHighlightedOption() || getFirstOption();
1551
+ if (selectedOption) {
1552
+ handleOptionSelect(selectedOption);
1553
+ }
1554
+ }
1555
+ break;
1556
+ case "Escape":
1557
+ e.preventDefault();
1558
+ setInputValue("");
1559
+ setIsOpen(false);
1560
+ clearHighlight();
1561
+ break;
1562
+ default:
1563
+ }
1564
+ };
1565
+ useEffect14(() => {
1566
+ if (value) {
1567
+ setInputValue(value);
1568
+ }
1569
+ }, [value]);
1570
+ const classes = classNames12(
1571
+ "mobius mobius-combobox",
1572
+ {
1573
+ "mobius-combobox--is-expanded": isOpen,
1574
+ "mobius-combobox--is-loading": isLoading,
1575
+ "mobius-combobox--is-mobile": isMobile
1576
+ },
1577
+ className
1578
+ );
1579
+ return /* @__PURE__ */ jsxs6("div", { id, "data-testid": "mobius-combobox__wrapper", className: classes, children: [
1580
+ isLoading && /* @__PURE__ */ jsx12(
1581
+ VisuallyHidden,
1582
+ {
1583
+ role: "status",
1584
+ "aria-live": "polite",
1585
+ id: statusId,
1586
+ elementType: "div",
1587
+ className: "mobius-combobox__status",
1588
+ children: "Loading options"
1589
+ }
1590
+ ),
1591
+ /* @__PURE__ */ jsx12(
1592
+ TextField,
1593
+ {
1594
+ ...otherProps,
1595
+ className: "mobius-combobox__input",
1596
+ role: "combobox",
1597
+ value: inputValue,
1598
+ placeholder,
1599
+ onFocus: handleFocus,
1600
+ onBlur: handleBlur,
1601
+ onKeyDown: handleKeyDown,
1602
+ onChange: handleInputChange,
1603
+ autoComplete: "off",
1604
+ "aria-describedby": isLoading ? statusId : void 0,
1605
+ "aria-autocomplete": "list",
1606
+ "aria-haspopup": "listbox",
1607
+ "aria-controls": showListbox ? listboxId : void 0,
1608
+ "aria-expanded": showListbox ? true : void 0,
1609
+ "aria-activedescendant": highlightedIndex === -1 ? void 0 : getHighlightedOptionId(),
1610
+ prefixInside: icon,
1611
+ ref: inputRef,
1612
+ errorMessage: errorMessage || error3?.message || void 0
1613
+ }
1614
+ ),
1615
+ showListbox && /* @__PURE__ */ jsx12(
1616
+ Listbox,
1617
+ {
1618
+ id: listboxId,
1619
+ isLoading,
1620
+ options: filteredOptions,
1621
+ highlightedIndex,
1622
+ highlightedGroupIndex,
1623
+ onOptionSelect: handleOptionSelect,
1624
+ optionComponent
1625
+ }
1626
+ )
1627
+ ] });
1628
+ }
1629
+ );
1630
+ var Combobox = ComboboxInner;
1631
+
1632
+ // src/components/AddressLookup/utils.ts
1633
+ function isLoqateErrorResponse(response) {
1634
+ return Array.isArray(response) && response.some((item) => "Error" in item);
1635
+ }
1636
+
1637
+ // src/components/AddressLookup/AddressLookup.tsx
1638
+ import { jsx as jsx13 } from "react/jsx-runtime";
1639
+ function optionsFromResponse({ Items }, addressLookupService) {
1640
+ if (!Items || !Array.isArray(Items)) {
1641
+ throw Error("No address found");
1642
+ }
1643
+ if (isLoqateErrorResponse(Items)) {
1644
+ throw Error(Items[0].Description);
1645
+ }
1646
+ return Items.map((item) => ({
1647
+ id: item.Id,
1648
+ label: `${item.Text}, ${item.Description}`,
1649
+ value: item.Text,
1650
+ // Add a callback to trigger secondary search
1651
+ // if the address type is not "Address"
1652
+ callback: item.Type === "Address" ? void 0 : async () => {
1653
+ const result = await addressLookupService.findById(item.Id);
1654
+ return optionsFromResponse(result, addressLookupService);
1655
+ }
1656
+ }));
1657
+ }
1658
+ var AddressLookup = forwardRef8(
1659
+ ({
1660
+ addressLookupService,
1661
+ onAddressSelected,
1662
+ onError,
1663
+ errorMessage,
1664
+ ...otherProps
1665
+ }, ref) => {
1666
+ const [error3, _setError] = useState10(null);
1667
+ const setError = useCallback4(
1668
+ (newError) => {
1669
+ if (newError != null) onError?.(newError);
1670
+ _setError(newError);
1671
+ },
1672
+ [onError]
1673
+ );
1674
+ const asyncOptions = useCallback4(
1675
+ async (searchTerm) => {
1676
+ try {
1677
+ const response = await addressLookupService.search(searchTerm);
1678
+ setError(null);
1679
+ return optionsFromResponse(response, addressLookupService);
1680
+ } catch (e) {
1681
+ setError(e);
1682
+ return [];
1683
+ }
1684
+ },
1685
+ [addressLookupService, setError]
1686
+ );
1687
+ const handleSelected = (selected) => {
1688
+ setError(null);
1689
+ return addressLookupService.get(selected.id).then(onAddressSelected).catch(setError);
1690
+ };
1691
+ const realErrorMessage = error3 && "An error occurred" || errorMessage;
1692
+ return /* @__PURE__ */ jsx13(
1693
+ Combobox,
1694
+ {
1695
+ ...otherProps,
1696
+ ref,
1697
+ onSelected: handleSelected,
1698
+ asyncOptions,
1699
+ errorMessage: realErrorMessage,
1700
+ icon: /* @__PURE__ */ jsx13(Icon, { icon: search })
1701
+ }
1702
+ );
1703
+ }
1704
+ );
1705
+ AddressLookup.displayName = "AddressLookup";
1706
+
1707
+ // src/components/AddressLookup/LoqateAddressLookupError.tsx
1708
+ var LoqateAddressLookupError = class extends Error {
1709
+ constructor(response) {
1710
+ super(response.Description);
1711
+ this.name = "LoqateAddressLookupError";
1712
+ this.response = response;
1713
+ }
1714
+ };
1715
+
1716
+ // src/components/AddressLookup/LoqateAddressLookupService.tsx
1717
+ var LOQATE_BASE_URL = "https://api.addressy.com/Capture/Interactive";
1718
+ var LOQATE_FIND_URL = "/Find/v1.00/json3.ws";
1719
+ var LOQATE_RETRIEVE_URL = "/Retrieve/v1.2/json3.ws";
1720
+ var DEFAULT_COUNTRIES = ["GB"];
1721
+ var LoqateAddressLookupService = class {
1722
+ /**
1723
+ * Base URL for the Loqate API
1724
+ */
1725
+ #baseUrl;
1726
+ /**
1727
+ * API key for the Loqate API
1728
+ */
1729
+ #apiKey;
1730
+ /**
1731
+ * List of allowed country codes for the Loqate API
1732
+ * 2 or 3 character ISO country codes
1733
+ */
1734
+ #countries;
1735
+ constructor({
1736
+ baseUrl,
1737
+ apiKey,
1738
+ countries
1739
+ }) {
1740
+ this.#apiKey = apiKey;
1741
+ this.#baseUrl = baseUrl || LOQATE_BASE_URL;
1742
+ this.#countries = countries || DEFAULT_COUNTRIES;
1743
+ }
1744
+ fetchFromApi(url) {
1745
+ return fetch(`${this.#baseUrl}${url}`).then((response) => response.json()).then((json) => {
1746
+ if (json.Items?.some((item) => item.Error)) {
1747
+ throw new LoqateAddressLookupError(json);
1748
+ }
1749
+ return json;
1750
+ });
1751
+ }
1752
+ search(searchTerm) {
1753
+ const url = `${LOQATE_FIND_URL}?Key=${this.#apiKey}&Text=${searchTerm}&Countries=${this.#countries?.join(",")}`;
1754
+ return this.fetchFromApi(url);
1755
+ }
1756
+ findById(id) {
1757
+ const url = `${LOQATE_FIND_URL}?Key=${this.#apiKey}&Container=${id}&Countries=${this.#countries?.join(",")}`;
1758
+ return this.fetchFromApi(url);
1759
+ }
1760
+ async get(id) {
1761
+ const url = `${LOQATE_RETRIEVE_URL}?Key=${this.#apiKey}&Id=${id}`;
1762
+ const response = await this.fetchFromApi(url);
1763
+ return response.Items[0];
1764
+ }
1765
+ };
1766
+
1767
+ // src/components/Alert/Alert.tsx
1768
+ import { circleInfo, circleTick, error as error2, warning } from "@simplybusiness/icons";
1769
+ import classNames13 from "classnames/dedupe";
1770
+ import { forwardRef as forwardRef9 } from "react";
1771
+ import { jsx as jsx14, jsxs as jsxs7 } from "react/jsx-runtime";
1772
+ var Alert = forwardRef9(
1773
+ (props, ref) => {
1774
+ const {
1775
+ elementType: Element = "div",
1776
+ variant = "info",
1777
+ show = true,
1778
+ header,
1779
+ children,
1780
+ ...otherProps
1781
+ } = props;
1782
+ if (!show) return null;
1783
+ const classes = classNames13(
1784
+ "mobius",
1785
+ "mobius-alert",
1786
+ {
1787
+ "--info": variant === "info",
1788
+ "--success": variant === "success",
1789
+ "--warning": variant === "warning",
1790
+ "--error": variant === "error",
1791
+ "--has-header": header
1792
+ },
1793
+ otherProps.className
1794
+ );
1795
+ const icon = {
1796
+ info: circleInfo,
1797
+ success: circleTick,
1798
+ warning,
1799
+ error: error2
1800
+ };
1801
+ const headerClasses = classNames13("mobius", "mobius-alert__header");
1802
+ const iconClasses = classNames13("mobius", "mobius-alert__icon");
1803
+ const contentClasses = classNames13("mobius", "mobius-alert__content");
1804
+ return /* @__PURE__ */ jsxs7(Element, { ref, role: "alert", ...otherProps, className: classes, children: [
1805
+ /* @__PURE__ */ jsx14("span", { className: iconClasses, children: /* @__PURE__ */ jsx14(Icon, { icon: icon[variant] }) }),
1806
+ /* @__PURE__ */ jsxs7("div", { children: [
1807
+ header && /* @__PURE__ */ jsx14("p", { className: headerClasses, children: header }),
1808
+ /* @__PURE__ */ jsx14("div", { className: contentClasses, children })
1809
+ ] })
1810
+ ] });
1811
+ }
1812
+ );
1813
+ Alert.displayName = "Alert";
1814
+
1815
+ // src/components/Box/Box.tsx
1816
+ import { forwardRef as forwardRef10 } from "react";
1817
+ import classNames14 from "classnames/dedupe";
1818
+ import { jsx as jsx15 } from "react/jsx-runtime";
1819
+ var Box = forwardRef10(
1820
+ (props, ref) => {
1821
+ const {
1822
+ elementType: Element = "div",
1823
+ padding,
1824
+ paddingX,
1825
+ paddingInline,
1826
+ paddingInlineStart,
1827
+ paddingInlineEnd,
1828
+ paddingY,
1829
+ paddingBlock,
1830
+ paddingBlockStart,
1831
+ paddingBlockEnd,
1832
+ paddingTop,
1833
+ paddingRight,
1834
+ paddingBottom,
1835
+ paddingLeft,
1836
+ minWidth,
1837
+ minHeight,
1838
+ maxWidth,
1839
+ maxHeight,
1840
+ width,
1841
+ height,
1842
+ style,
1843
+ ...otherProps
1844
+ } = props;
1845
+ const classes = classNames14("mobius", "mobius-box", otherProps.className);
1846
+ const styleProps = filterUndefinedProps({
1847
+ padding: getSpacingValue(padding),
1848
+ paddingInline: getSpacingValue(paddingInline || paddingX),
1849
+ paddingBlock: getSpacingValue(paddingBlock || paddingY),
1850
+ paddingTop: getSpacingValue(paddingTop || paddingBlockStart),
1851
+ paddingRight: getSpacingValue(paddingRight || paddingInlineEnd),
1852
+ paddingBottom: getSpacingValue(paddingBottom || paddingBlockEnd),
1853
+ paddingLeft: getSpacingValue(paddingLeft || paddingInlineStart),
1854
+ minWidth,
1855
+ minHeight,
1856
+ maxWidth,
1857
+ maxHeight,
1858
+ width,
1859
+ height,
1860
+ ...style
1861
+ });
1862
+ return /* @__PURE__ */ jsx15(
1863
+ Element,
1864
+ {
1865
+ ref,
1866
+ style: styleProps,
1867
+ ...otherProps,
1868
+ className: classes
1869
+ }
1870
+ );
1871
+ }
1872
+ );
1873
+ Box.displayName = "Box";
1874
+
1875
+ // src/components/Breadcrumbs/Breadcrumbs.tsx
1876
+ import { forwardRef as forwardRef11, Children, cloneElement as cloneElement2 } from "react";
1877
+ import classNames15 from "classnames/dedupe";
1878
+ import { jsx as jsx16 } from "react/jsx-runtime";
1879
+ var Breadcrumbs = forwardRef11((props, ref) => {
1880
+ const { "aria-label": ariaLabel = "Breadcrumbs" } = props;
1881
+ const { navProps } = { navProps: { "aria-label": ariaLabel } };
1882
+ const { children, ...otherProps } = props;
1883
+ const childArray = Children.toArray(children);
1884
+ const classes = classNames15(
1885
+ "mobius",
1886
+ "mobius-breadcrumb",
1887
+ otherProps.className
1888
+ );
1889
+ return /* @__PURE__ */ jsx16("nav", { ref, ...otherProps, ...navProps, className: classes, children: /* @__PURE__ */ jsx16("ul", { children: childArray.map(
1890
+ (child, i) => cloneElement2(child, {
1891
+ isCurrent: i === childArray.length - 1
1892
+ })
1893
+ ) }) });
1894
+ });
1895
+ Breadcrumbs.displayName = "Breadcrumbs";
1896
+
1897
+ // src/components/Breadcrumbs/BreadcrumbItem.tsx
1898
+ import { forwardRef as forwardRef12, cloneElement as cloneElement3, Children as Children2 } from "react";
1899
+ import classNames16 from "classnames/dedupe";
1900
+ import { jsx as jsx17, jsxs as jsxs8 } from "react/jsx-runtime";
1901
+ var BreadcrumbItem = forwardRef12((props, ref) => {
1902
+ const {
1903
+ isDisabled = false,
1904
+ isCurrent = false,
1905
+ "aria-current": ariaCurrent = "page",
1906
+ children,
1907
+ separator = /* @__PURE__ */ jsx17(Box, { className: "mobius-breadcrumb__separator", "aria-hidden": "true", children: ">" }),
1908
+ ...otherProps
1909
+ } = props;
1910
+ const { itemProps } = {
1911
+ itemProps: {
1912
+ "aria-current": isCurrent ? ariaCurrent : void 0,
1913
+ "aria-disabled": isDisabled || isCurrent,
1914
+ ...otherProps
1915
+ }
1916
+ };
1917
+ const classes = classNames16(
1918
+ "mobius",
1919
+ "mobius-breadcrumb__item",
1920
+ props.className
1921
+ );
1922
+ const child = typeof children === "string" ? /* @__PURE__ */ jsx17("span", { ...itemProps, children }) : Children2.only(children);
1923
+ return /* @__PURE__ */ jsxs8("li", { className: classes, children: [
1924
+ cloneElement3(child, { ...child.props, ...itemProps, ref }),
1925
+ !props.isCurrent && separator
1926
+ ] });
1927
+ });
1928
+ BreadcrumbItem.displayName = "BreadcrumbItem";
1929
+
1930
+ // src/components/Button/Button.tsx
1931
+ import { forwardRef as forwardRef13 } from "react";
1932
+ import classNames17 from "classnames/dedupe";
1933
+
1934
+ // src/components/Button/Loading.tsx
1935
+ import { loading } from "@simplybusiness/icons";
1936
+ import { Fragment, jsx as jsx18, jsxs as jsxs9 } from "react/jsx-runtime";
1937
+ var Loading = (props) => {
1938
+ const { children } = props;
1939
+ return /* @__PURE__ */ jsxs9(Fragment, { children: [
1940
+ /* @__PURE__ */ jsx18("div", { className: "mobius-button__icon-wrapper", children: /* @__PURE__ */ jsx18(Icon, { icon: loading, spin: true, size: "md" }) }),
1941
+ /* @__PURE__ */ jsx18(VisuallyHidden, { className: "mobius-button__loading-text", children: "Loading" }),
1942
+ children
1943
+ ] });
1944
+ };
1945
+
1946
+ // src/components/Button/Success.tsx
1947
+ import { tick } from "@simplybusiness/icons";
1948
+ import { Fragment as Fragment2, jsx as jsx19, jsxs as jsxs10 } from "react/jsx-runtime";
1949
+ var Success = () => /* @__PURE__ */ jsxs10(Fragment2, { children: [
1950
+ /* @__PURE__ */ jsx19("div", { className: "mobius-button__icon-wrapper", children: /* @__PURE__ */ jsx19(Icon, { icon: tick, size: "md" }) }),
1951
+ /* @__PURE__ */ jsx19(VisuallyHidden, { className: "mobius-button__success-text", children: "Success" })
1952
+ ] });
1953
+
1954
+ // src/components/Button/Button.tsx
1955
+ import { jsx as jsx20, jsxs as jsxs11 } from "react/jsx-runtime";
1956
+ var Button = forwardRef13((props, ref) => {
1957
+ const {
1958
+ children,
1959
+ elementType: Component = "button",
1960
+ isDisabled,
1961
+ isLoading,
1962
+ isSuccess,
1963
+ variant = "primary",
1964
+ size = "md",
1965
+ onPress,
1966
+ onClick,
1967
+ ...otherProps
1968
+ } = props;
1969
+ const { buttonProps } = useButton(props);
1970
+ useDeprecationWarning({
1971
+ "variant 'inverse'": variant === "inverse",
1972
+ "variant 'inverse-ghost'": variant === "inverse-ghost"
1973
+ });
1974
+ const getVariant = (type) => {
1975
+ if (type === "inverse") {
1976
+ return "basic";
1977
+ }
1978
+ if (type === "inverse-ghost") {
1979
+ return "secondary";
1980
+ }
1981
+ return variant;
1982
+ };
1983
+ const buttonVariant = getVariant(variant);
1984
+ const classes = classNames17(
1985
+ "mobius",
1986
+ "mobius-button",
1987
+ `--variant-${buttonVariant}`,
1988
+ `--size-${size}`,
1989
+ {
1990
+ "--is-disabled": isDisabled,
1991
+ "--is-loading": isLoading,
1992
+ "--is-success": isSuccess && !isLoading
1993
+ },
1994
+ otherProps.className
1995
+ );
1996
+ otherProps.className = classes;
1997
+ return (
1998
+ // @ts-expect-error - ref type is not correct
1999
+ /* @__PURE__ */ jsxs11(Component, { ref, ...buttonProps, ...otherProps, children: [
2000
+ isLoading ? /* @__PURE__ */ jsx20(Loading, { children }) : children,
2001
+ isSuccess && !isLoading && /* @__PURE__ */ jsx20(Success, {})
2002
+ ] })
2003
+ );
2004
+ });
2005
+ Button.displayName = "Button";
2006
+
2007
+ // src/components/Checkbox/Checkbox.tsx
2008
+ import { forwardRef as forwardRef14, useRef as useRef8, useId as useId4, useState as useState11, useEffect as useEffect15 } from "react";
2009
+ import classNames18 from "classnames/dedupe";
2010
+ import { squareTick, square } from "@simplybusiness/icons";
2011
+ import { jsx as jsx21, jsxs as jsxs12 } from "react/jsx-runtime";
2012
+ var Checkbox = forwardRef14((props, ref) => {
2013
+ const {
2014
+ id,
2015
+ label,
2016
+ isDisabled,
2017
+ isRequired,
2018
+ validationState,
2019
+ isInvalid,
2020
+ onChange,
2021
+ className,
2022
+ errorMessage,
2023
+ selected,
2024
+ defaultSelected = false,
2025
+ isReadOnly,
2026
+ isLastItem,
2027
+ name,
2028
+ value,
2029
+ ["aria-describedby"]: ariaDescribedBy,
2030
+ ...rest
2031
+ } = props;
2032
+ const [checked, setChecked] = useState11(defaultSelected);
2033
+ const fallbackRef = useRef8(null);
2034
+ const refObj = ref || fallbackRef;
2035
+ const inputId = useId4();
2036
+ const isControlled = typeof selected === "boolean";
2037
+ useEffect15(() => {
2038
+ if (isControlled) {
2039
+ setChecked(selected);
2040
+ }
2041
+ }, [selected, isControlled]);
2042
+ const validationClasses = useValidationClasses({
2043
+ validationState,
2044
+ isInvalid
2045
+ });
2046
+ const sharedClasses = classNames18(
2047
+ {
2048
+ "--is-disabled": isDisabled,
2049
+ "--is-selected": checked,
2050
+ "--is-required": typeof isRequired === "boolean" && isRequired,
2051
+ "--is-optional": typeof isRequired === "boolean" && !isRequired
2052
+ },
2053
+ validationClasses
2054
+ );
2055
+ const wrapperClasses = classNames18(
2056
+ "mobius",
2057
+ "mobius-checkbox",
2058
+ sharedClasses,
2059
+ className
2060
+ );
2061
+ const labelClasses = classNames18("mobius-checkbox__label", sharedClasses);
2062
+ const inputClasses = classNames18("mobius-checkbox__input", sharedClasses);
2063
+ const iconClasses = classNames18("mobius-checkbox__icon", sharedClasses);
2064
+ const errorMessageId = useId4();
2065
+ const shouldErrorMessageShow = errorMessage ? errorMessageId : void 0;
2066
+ const describedBy = spaceDelimitedList([
2067
+ shouldErrorMessageShow,
2068
+ ariaDescribedBy
2069
+ ]);
2070
+ const labelId = useId4();
2071
+ const handleChange = (event) => {
2072
+ setChecked(!checked);
2073
+ if (onChange) {
2074
+ onChange(event, isLastItem);
2075
+ }
2076
+ };
2077
+ return /* @__PURE__ */ jsxs12(Stack, { gap: "xs", className: wrapperClasses, children: [
2078
+ /* @__PURE__ */ jsxs12("label", { className: labelClasses, children: [
2079
+ /* @__PURE__ */ jsx21(
2080
+ "input",
2081
+ {
2082
+ "aria-describedby": describedBy,
2083
+ "aria-errormessage": shouldErrorMessageShow,
2084
+ "aria-invalid": isInvalid,
2085
+ "aria-labelledby": labelId,
2086
+ readOnly: isReadOnly,
2087
+ disabled: isDisabled,
2088
+ ref: refObj,
2089
+ className: inputClasses,
2090
+ onChange: handleChange,
2091
+ type: "checkbox",
2092
+ checked,
2093
+ required: isRequired,
2094
+ id: id || inputId,
2095
+ name,
2096
+ value,
2097
+ ...rest
2098
+ }
2099
+ ),
2100
+ /* @__PURE__ */ jsx21(
2101
+ Icon,
2102
+ {
2103
+ icon: checked ? squareTick : square,
2104
+ size: "md",
2105
+ className: iconClasses
2106
+ }
2107
+ ),
2108
+ /* @__PURE__ */ jsx21("span", { id: labelId, className: "mobius-checkbox__visible-label", children: label })
2109
+ ] }),
2110
+ /* @__PURE__ */ jsx21(ErrorMessage, { id: errorMessageId, errorMessage })
2111
+ ] });
2112
+ });
2113
+ Checkbox.displayName = "Checkbox";
2114
+
2115
+ // src/components/Checkbox/CheckboxGroup.tsx
2116
+ import classNames19 from "classnames/dedupe";
2117
+ import {
2118
+ Children as Children3,
2119
+ cloneElement as cloneElement4,
2120
+ forwardRef as forwardRef15,
2121
+ isValidElement,
2122
+ useId as useId5,
2123
+ useState as useState12
2124
+ } from "react";
2125
+ import { jsx as jsx22, jsxs as jsxs13 } from "react/jsx-runtime";
2126
+ var CheckboxGroup = forwardRef15((props, ref) => {
2127
+ const {
2128
+ label,
2129
+ isDisabled = false,
2130
+ isRequired,
2131
+ validationState,
2132
+ isInvalid,
2133
+ orientation = "vertical",
2134
+ onChange,
2135
+ className,
2136
+ errorMessage,
2137
+ children,
2138
+ defaultValue = [],
2139
+ isReadOnly,
2140
+ itemsPerRow,
2141
+ lastItemDisables = false,
2142
+ ...rest
2143
+ } = props;
2144
+ const [selected, setSelected] = useState12(defaultValue);
2145
+ const checkboxGroupClasses = classNames19(
2146
+ "mobius",
2147
+ "mobius-checkbox-group",
2148
+ className,
2149
+ {
2150
+ "--is-horizontal": orientation === "horizontal",
2151
+ "--is-vertical": orientation === "vertical",
2152
+ "--is-required": typeof isRequired === "boolean" && isRequired,
2153
+ "--is-optional": typeof isRequired === "boolean" && !isRequired
2154
+ }
2155
+ );
2156
+ const validationClasses = useValidationClasses({
2157
+ validationState,
2158
+ isInvalid
2159
+ });
2160
+ const labelClasses = classNames19(
2161
+ {
2162
+ "--is-disabled": isDisabled
2163
+ },
2164
+ validationClasses
2165
+ );
2166
+ const errorMessageId = useId5();
2167
+ const shouldErrorMessageShow = errorMessage ? errorMessageId : void 0;
2168
+ const describedBy = spaceDelimitedList([
2169
+ shouldErrorMessageShow,
2170
+ props["aria-describedby"]
2171
+ ]);
2172
+ const labelId = useId5();
2173
+ const handleChange = (event, isLastItem = false) => {
2174
+ const {
2175
+ target: { value, checked }
2176
+ } = event;
2177
+ let newValue = [...selected];
2178
+ if (!checked) {
2179
+ newValue = selected.filter((item) => item !== value);
2180
+ }
2181
+ if (checked) {
2182
+ newValue = [...selected, value];
2183
+ }
2184
+ if (checked && lastItemDisables && isLastItem) {
2185
+ newValue = [value];
2186
+ }
2187
+ setSelected(newValue);
2188
+ onChange?.(newValue);
2189
+ };
2190
+ const childrenArray = Children3.toArray(children);
2191
+ const lastCheckbox = childrenArray.filter(
2192
+ (child) => isValidElement(child) && child.type === Checkbox
2193
+ ).pop();
2194
+ const lastCheckboxIsChecked = lastCheckbox && selected.includes(lastCheckbox.props.value);
2195
+ return /* @__PURE__ */ jsxs13(
2196
+ "div",
2197
+ {
2198
+ ...rest,
2199
+ "aria-labelledby": props["aria-labelledby"] || labelId,
2200
+ ref,
2201
+ className: checkboxGroupClasses,
2202
+ role: "group",
2203
+ style: {
2204
+ "--checkbox-items-per-row": itemsPerRow || Children3.count(children)
2205
+ },
2206
+ children: [
2207
+ label && /* @__PURE__ */ jsx22(Label, { elementType: "span", id: labelId, className: labelClasses, children: label }),
2208
+ /* @__PURE__ */ jsx22("div", { className: "mobius-checkbox-group__wrapper", children: childrenArray.map((child) => {
2209
+ if (isValidElement(child)) {
2210
+ const isLastItem = child === lastCheckbox;
2211
+ const isChildDisabled = isDisabled || lastItemDisables && lastCheckboxIsChecked && !isLastItem;
2212
+ return cloneElement4(child, {
2213
+ isDisabled: isChildDisabled,
2214
+ isRequired,
2215
+ isReadOnly,
2216
+ isInvalid,
2217
+ isLastItem,
2218
+ selected: selected.includes(child.props.value),
2219
+ onChange: handleChange,
2220
+ "aria-describedby": describedBy
2221
+ });
2222
+ }
2223
+ return child;
2224
+ }) }),
2225
+ errorMessage && /* @__PURE__ */ jsx22(ErrorMessage, { id: errorMessageId, errorMessage })
2226
+ ]
2227
+ }
2228
+ );
2229
+ });
2230
+ CheckboxGroup.displayName = "CheckboxGroup";
2231
+
2232
+ // src/components/Container/Container.tsx
2233
+ import { forwardRef as forwardRef16 } from "react";
2234
+ import classNames20 from "classnames/dedupe";
2235
+ import { jsx as jsx23 } from "react/jsx-runtime";
2236
+ var Container = forwardRef16((props, ref) => {
2237
+ const { elementType: Element = "div", size = "md", ...otherProps } = props;
2238
+ const classes = classNames20(
2239
+ "mobius",
2240
+ "mobius-container",
2241
+ sizeClasses(size),
2242
+ otherProps.className
2243
+ );
2244
+ return /* @__PURE__ */ jsx23(Element, { ref, ...otherProps, className: classes });
2245
+ });
2246
+ Container.displayName = "Container";
2247
+
2248
+ // src/components/Divider/Divider.tsx
2249
+ import classNames21 from "classnames/dedupe";
2250
+ import { jsx as jsx24 } from "react/jsx-runtime";
2251
+ var Divider = ({
2252
+ "aria-orientation": ariaOrientation = "horizontal",
2253
+ className,
2254
+ ...rest
2255
+ }) => {
2256
+ const classes = classNames21("mobius", "mobius-divider", className);
2257
+ return /* @__PURE__ */ jsx24(
2258
+ "div",
2259
+ {
2260
+ className: classes,
2261
+ role: "separator",
2262
+ "aria-orientation": ariaOrientation,
2263
+ ...rest,
2264
+ children: /* @__PURE__ */ jsx24("div", { className: "mobius-divider__inner" })
2265
+ }
2266
+ );
2267
+ };
2268
+ Divider.displayName = "Divider";
2269
+
2270
+ // src/components/Drawer/Content.tsx
2271
+ import { forwardRef as forwardRef17 } from "react";
2272
+ import { jsx as jsx25 } from "react/jsx-runtime";
2273
+ var Content = forwardRef17(
2274
+ ({ children, ...otherProps }, ref) => /* @__PURE__ */ jsx25("div", { ref, ...otherProps, className: "mobius-drawer__content", children })
2275
+ );
2276
+ Content.displayName = "Content";
2277
+
2278
+ // src/components/Drawer/Drawer.tsx
2279
+ import classNames22 from "classnames/dedupe";
2280
+ import { forwardRef as forwardRef18, useEffect as useEffect16, useId as useId6, useMemo, useRef as useRef9, useState as useState13 } from "react";
2281
+
2282
+ // src/components/Drawer/DrawerContext.tsx
2283
+ import { createContext } from "react";
2284
+ var DrawerContext = createContext({
2285
+ onClose: () => {
2286
+ },
2287
+ closeLabel: void 0
2288
+ });
2289
+
2290
+ // src/components/Drawer/Drawer.tsx
2291
+ import { jsx as jsx26, jsxs as jsxs14 } from "react/jsx-runtime";
2292
+ var TRANSITION_CSS_VARIABLE = "--drawer-transition-duration";
2293
+ var Drawer = forwardRef18((props, ref) => {
2294
+ const {
2295
+ isOpen,
2296
+ className,
2297
+ closeLabel,
2298
+ direction,
2299
+ announce = "Drawer opened on screen",
2300
+ onOpen,
2301
+ onClose,
2302
+ children
2303
+ } = props;
2304
+ const dialogRef = useRef9(null);
2305
+ const [shouldTransition, setShouldTransition] = useState13(false);
2306
+ const { close } = useDialog({
2307
+ ref: dialogRef,
2308
+ isOpen,
2309
+ onOpen,
2310
+ onClose,
2311
+ transition: {
2312
+ isEnabled: true,
2313
+ CSSVariable: TRANSITION_CSS_VARIABLE
2314
+ }
2315
+ });
2316
+ const hiddenId = `screen-reader-announce-${useId6()}`;
2317
+ const dialogClasses = classNames22(
2318
+ "mobius",
2319
+ "mobius-drawer",
2320
+ `--${direction}`,
2321
+ className,
2322
+ {
2323
+ "--should-transition": shouldTransition
2324
+ }
2325
+ );
2326
+ useEffect16(() => {
2327
+ setShouldTransition(supportsDialog());
2328
+ }, []);
2329
+ const contextValue = useMemo(
2330
+ () => ({
2331
+ onClose: close,
2332
+ closeLabel
2333
+ }),
2334
+ [close, closeLabel]
2335
+ );
2336
+ return /* @__PURE__ */ jsxs14(
2337
+ "dialog",
2338
+ {
2339
+ id: useId6(),
2340
+ ref: mergeRefs([dialogRef, ref]),
2341
+ onCancel: close,
2342
+ className: dialogClasses,
2343
+ "aria-describedby": hiddenId,
2344
+ children: [
2345
+ /* @__PURE__ */ jsx26(VisuallyHidden, { children: /* @__PURE__ */ jsx26("div", { id: hiddenId, children: announce }) }),
2346
+ /* @__PURE__ */ jsx26(DrawerContext.Provider, { value: contextValue, children })
2347
+ ]
2348
+ }
2349
+ );
2350
+ });
2351
+ Drawer.displayName = "Drawer";
2352
+
2353
+ // src/components/Drawer/useDrawer.ts
2354
+ import { useContext } from "react";
2355
+ var useDrawer = () => {
2356
+ const { onClose, closeLabel } = useContext(DrawerContext);
2357
+ return { onClose, closeLabel };
2358
+ };
2359
+
2360
+ // src/components/Drawer/Header.tsx
2361
+ import { forwardRef as forwardRef19 } from "react";
2362
+ import { cross } from "@simplybusiness/icons";
2363
+ import { jsx as jsx27, jsxs as jsxs15 } from "react/jsx-runtime";
2364
+ var Header = forwardRef19(
2365
+ ({ children, ...otherProps }, ref) => {
2366
+ const { onClose, closeLabel } = useDrawer();
2367
+ return /* @__PURE__ */ jsxs15("header", { ref, ...otherProps, className: "mobius-drawer__header", children: [
2368
+ children,
2369
+ /* @__PURE__ */ jsxs15(
2370
+ Button,
2371
+ {
2372
+ "aria-label": "Close",
2373
+ variant: "basic",
2374
+ onPress: onClose,
2375
+ className: "mobius-drawer__close",
2376
+ size: "sm",
2377
+ children: [
2378
+ /* @__PURE__ */ jsx27(Icon, { icon: cross }),
2379
+ " ",
2380
+ closeLabel
2381
+ ]
2382
+ }
2383
+ )
2384
+ ] });
2385
+ }
2386
+ );
2387
+ Header.displayName = "Header";
2388
+
2389
+ // src/components/Drawer/index.tsx
2390
+ var Drawer2 = Object.assign(Drawer, {
2391
+ Header,
2392
+ Content
2393
+ });
2394
+ Drawer2.displayName = "Drawer";
2395
+
2396
+ // src/components/DropdownMenu/DropdownMenu.tsx
2397
+ import {
2398
+ forwardRef as forwardRef20,
2399
+ Children as Children4,
2400
+ isValidElement as isValidElement2,
2401
+ cloneElement as cloneElement5,
2402
+ useState as useState14
2403
+ } from "react";
2404
+ import useDropdownMenu from "react-accessible-dropdown-menu-hook";
2405
+ import classNames23 from "classnames/dedupe";
2406
+ import { jsx as jsx28, jsxs as jsxs16 } from "react/jsx-runtime";
2407
+ var DropdownMenu = forwardRef20((props, ref) => {
2408
+ const {
2409
+ elementType: Element = "nav",
2410
+ trigger,
2411
+ label = "Menu",
2412
+ children,
2413
+ ...otherProps
2414
+ } = props;
2415
+ const [activeId, setActiveId] = useState14(null);
2416
+ const numberOfItems = Children4.count(children);
2417
+ const {
2418
+ buttonProps,
2419
+ itemProps,
2420
+ isOpen: open,
2421
+ setIsOpen
2422
+ } = useDropdownMenu(numberOfItems);
2423
+ const classes = classNames23(
2424
+ "mobius",
2425
+ "mobius-dropdown-menu",
2426
+ otherProps.className
2427
+ );
2428
+ const triggerClasses = classNames23("mobius", "mobius-dropdown-menu__trigger");
2429
+ const listClasses = classNames23("mobius", "mobius-dropdown-menu__list", {
2430
+ "--is-open": open
2431
+ });
2432
+ const handleChildClick = ({ onClick }, index) => {
2433
+ setActiveId(index);
2434
+ setIsOpen(false);
2435
+ if (onClick) {
2436
+ onClick();
2437
+ }
2438
+ };
2439
+ return /* @__PURE__ */ jsxs16(Element, { ref, ...otherProps, className: classes, children: [
2440
+ trigger ? cloneElement5(trigger, {
2441
+ className: triggerClasses,
2442
+ open,
2443
+ label,
2444
+ ...buttonProps
2445
+ }) : /* @__PURE__ */ jsx28(Button, { className: triggerClasses, ...buttonProps, children: label }),
2446
+ /* @__PURE__ */ jsx28("ul", { className: listClasses, role: "menu", children: Children4.map(children, (child, index) => {
2447
+ if (isValidElement2(child)) {
2448
+ return cloneElement5(child, {
2449
+ onClick: () => handleChildClick(child.props, index),
2450
+ active: index === activeId,
2451
+ ...itemProps[index]
2452
+ });
2453
+ }
2454
+ return child;
2455
+ }) })
2456
+ ] });
2457
+ });
2458
+ DropdownMenu.displayName = "DropdownMenu";
2459
+
2460
+ // src/components/DropdownMenu/Item.tsx
2461
+ import { forwardRef as forwardRef21, cloneElement as cloneElement6, isValidElement as isValidElement3, Children as Children5 } from "react";
2462
+ import classNames24 from "classnames/dedupe";
2463
+ import { jsx as jsx29 } from "react/jsx-runtime";
2464
+ var Item = forwardRef21(
2465
+ (props, ref) => {
2466
+ const {
2467
+ elementType: Element = "li",
2468
+ active,
2469
+ onClick,
2470
+ children,
2471
+ ...otherProps
2472
+ } = props;
2473
+ const classes = classNames24(
2474
+ "mobius",
2475
+ "mobius-dropdown-menu__item",
2476
+ { "--is-active": active },
2477
+ otherProps.className
2478
+ );
2479
+ return /* @__PURE__ */ jsx29(Element, { ref, onClick, ...otherProps, children: Children5.map(children, (child) => {
2480
+ if (isValidElement3(child)) {
2481
+ const childClasses = classNames24(child.props.className, classes);
2482
+ return cloneElement6(child, {
2483
+ className: childClasses
2484
+ });
2485
+ }
2486
+ return /* @__PURE__ */ jsx29("span", { className: classes, children: child });
2487
+ }) });
2488
+ }
2489
+ );
2490
+ Item.displayName = "DropdownMenu.Item";
2491
+
2492
+ // src/components/DropdownMenu/index.tsx
2493
+ var DropdownMenu2 = Object.assign(
2494
+ DropdownMenu,
2495
+ {
2496
+ Item
2497
+ }
2498
+ );
2499
+ DropdownMenu2.displayName = "DropdownMenu";
2500
+
2501
+ // src/components/Fieldset/Fieldset.tsx
2502
+ import classNames25 from "classnames/dedupe";
2503
+ import { cloneElement as cloneElement7, forwardRef as forwardRef22, useId as useId7 } from "react";
2504
+ import { jsx as jsx30, jsxs as jsxs17 } from "react/jsx-runtime";
2505
+ var useFieldset = (props) => {
2506
+ const { legend } = props;
2507
+ let legendProps = {};
2508
+ let containerProps = {
2509
+ role: "group"
2510
+ };
2511
+ const legendId = useId7();
2512
+ if (legend) {
2513
+ legendProps = {
2514
+ ...legendProps,
2515
+ id: legendId
2516
+ };
2517
+ containerProps = {
2518
+ ...containerProps,
2519
+ "aria-labelledby": legendId
2520
+ };
2521
+ }
2522
+ return {
2523
+ legendProps,
2524
+ containerProps
2525
+ };
2526
+ };
2527
+ var Fieldset = forwardRef22((props, _ref) => {
2528
+ const {
2529
+ children,
2530
+ legend,
2531
+ legendComponent = /* @__PURE__ */ jsx30("legend", {}),
2532
+ ...otherProps
2533
+ } = props;
2534
+ const { legendProps, containerProps } = useFieldset(props);
2535
+ const classes = classNames25("mobius", "mobius-fieldset", props.className);
2536
+ legendProps.className = "mobius-fieldset__legend";
2537
+ return /* @__PURE__ */ jsxs17(Flex, { ...containerProps, ...otherProps, className: classes, children: [
2538
+ legend && cloneElement7(legendComponent, { ...legendProps }, [legend]),
2539
+ children
2540
+ ] });
2541
+ });
2542
+ Fieldset.displayName = "Fieldset";
2543
+
2544
+ // src/components/Grid/Grid.tsx
2545
+ import { forwardRef as forwardRef23 } from "react";
2546
+ import classNames26 from "classnames/dedupe";
2547
+ import { jsx as jsx31 } from "react/jsx-runtime";
2548
+ var Grid = forwardRef23(
2549
+ (props, _ref) => {
2550
+ const {
2551
+ columns = 12,
2552
+ gap,
2553
+ columnGap,
2554
+ rowGap,
2555
+ alignContent,
2556
+ alignItems,
2557
+ justifyContent,
2558
+ justifyItems,
2559
+ className,
2560
+ style,
2561
+ ...rest
2562
+ } = props;
2563
+ const classes = classNames26("mobius", "mobius-grid", className);
2564
+ const styles = filterUndefinedProps({
2565
+ boxSizing: "border-box",
2566
+ display: "grid",
2567
+ gridTemplateColumns: `repeat(${columns}, 1fr)`,
2568
+ gap: getSpacingValue(gap),
2569
+ columnGap: getSpacingValue(columnGap),
2570
+ rowGap: getSpacingValue(rowGap),
2571
+ alignContent,
2572
+ alignItems,
2573
+ justifyContent,
2574
+ justifyItems,
2575
+ ...style
2576
+ });
2577
+ return /* @__PURE__ */ jsx31("div", { style: styles, className: classes, ...rest });
2578
+ }
2579
+ );
2580
+ Grid.displayName = "Grid";
2581
+
2582
+ // src/components/Grid/Item.tsx
2583
+ import { forwardRef as forwardRef24, useEffect as useEffect17, useState as useState15 } from "react";
2584
+ import classNames27 from "classnames/dedupe";
2585
+ import { jsx as jsx32 } from "react/jsx-runtime";
2586
+ var getBreakpointMap = (config) => Object.entries(config).reduce((prev, [key, value]) => {
2587
+ const previous = Object.values(prev);
2588
+ const lastDefined = previous[previous.length - 1];
2589
+ return { ...prev, [key]: value || lastDefined };
2590
+ }, {});
2591
+ var DEFAULT_SPAN = 12;
2592
+ var GridItem = forwardRef24((props, _ref) => {
2593
+ const {
2594
+ breakpoint: { size: breakpointSize }
2595
+ } = useBreakpoint();
2596
+ const {
2597
+ span,
2598
+ xs = Array.isArray(span) ? DEFAULT_SPAN : span,
2599
+ sm,
2600
+ md,
2601
+ lg,
2602
+ xl,
2603
+ xxl,
2604
+ alignSelf,
2605
+ justifySelf,
2606
+ className,
2607
+ ...rest
2608
+ } = props;
2609
+ const breakpointMap = getBreakpointMap({
2610
+ xs,
2611
+ sm,
2612
+ md,
2613
+ lg,
2614
+ xl,
2615
+ xxl
2616
+ });
2617
+ const [responsiveSpan, setResponsiveSpan] = useState15();
2618
+ const classes = classNames27("mobius-grid__item", className);
2619
+ useEffect17(() => {
2620
+ setResponsiveSpan(breakpointMap[breakpointSize]);
2621
+ }, [breakpointSize, breakpointMap]);
2622
+ const styles = {
2623
+ gridColumn: responsiveSpan ? `span ${responsiveSpan}` : void 0,
2624
+ alignSelf,
2625
+ justifySelf
2626
+ };
2627
+ return /* @__PURE__ */ jsx32("div", { style: { ...styles }, className: classes, ...rest });
2628
+ });
2629
+ GridItem.displayName = "GridItem";
2630
+
2631
+ // src/components/Grid/index.tsx
2632
+ var Grid2 = Object.assign(Grid, {
2633
+ Item: GridItem
2634
+ });
2635
+ Grid2.displayName = "Grid";
2636
+
2637
+ // src/components/Image/Image.tsx
2638
+ import { forwardRef as forwardRef25 } from "react";
2639
+ import classNames28 from "classnames/dedupe";
2640
+ import { jsx as jsx33 } from "react/jsx-runtime";
2641
+ var Image = forwardRef25(
2642
+ ({ alt, elementType: Component = "img", ...otherProps }, ref) => {
2643
+ const classes = classNames28("mobius", "mobius-image", otherProps.className);
2644
+ return /* @__PURE__ */ jsx33(Component, { alt, ref, ...otherProps, className: classes });
2645
+ }
2646
+ );
2647
+ Image.displayName = "Image";
2648
+
2649
+ // src/components/Link/Link.tsx
2650
+ import { forwardRef as forwardRef26 } from "react";
2651
+ import classNames29 from "classnames/dedupe";
2652
+ import { jsx as jsx34 } from "react/jsx-runtime";
2653
+ var Link = forwardRef26(
2654
+ (props, ref) => {
2655
+ const {
2656
+ isDisabled = false,
2657
+ elementType: Component = "a",
2658
+ style,
2659
+ className,
2660
+ ...otherProps
2661
+ } = props;
2662
+ const disabledStyles = {
2663
+ pointerEvents: "none"
2664
+ };
2665
+ const styles = { ...style, ...isDisabled && disabledStyles };
2666
+ const classes = classNames29("mobius", "mobius-link", className, {
2667
+ "--is-disabled": isDisabled
2668
+ });
2669
+ return /* @__PURE__ */ jsx34(
2670
+ Component,
2671
+ {
2672
+ ref,
2673
+ style: styles,
2674
+ className: classes,
2675
+ "aria-disabled": isDisabled,
2676
+ ...otherProps,
2677
+ children: props.children
2678
+ }
2679
+ );
2680
+ }
2681
+ );
2682
+ Link.displayName = "Link";
2683
+
2684
+ // src/components/LinkButton/LinkButton.tsx
2685
+ import classNames30 from "classnames/dedupe";
2686
+ import { jsx as jsx35 } from "react/jsx-runtime";
2687
+ function LinkButton({
2688
+ href,
2689
+ children,
2690
+ className,
2691
+ elementType = "a",
2692
+ ...rest
2693
+ }) {
2694
+ if (!href) {
2695
+ throw new Error("LinkButton requires a href prop");
2696
+ }
2697
+ const classes = classNames30("mobius", "mobius-link-button", className);
2698
+ return (
2699
+ // @ts-expect-error Button only allows elementType of string, not React component
2700
+ /* @__PURE__ */ jsx35(Button, { elementType, href, className: classes, ...rest, children })
2701
+ );
2702
+ }
2703
+
2704
+ // src/components/List/List.tsx
2705
+ import { Children as Children6, cloneElement as cloneElement8, forwardRef as forwardRef27, isValidElement as isValidElement4 } from "react";
2706
+ import classNames31 from "classnames/dedupe";
2707
+ import { jsx as jsx36 } from "react/jsx-runtime";
2708
+ var List = forwardRef27(
2709
+ (props, ref) => {
2710
+ const Component = props.isOrdered ? "ol" : "ul";
2711
+ const { children, icon, ...otherProps } = props;
2712
+ const { isOrdered, liststyletype, isReversed, ...restProps } = otherProps;
2713
+ const mappedProps = {
2714
+ ...restProps,
2715
+ reversed: isReversed
2716
+ };
2717
+ const classes = classNames31(
2718
+ "mobius",
2719
+ "mobius-list",
2720
+ {
2721
+ "--has-icon": icon,
2722
+ [`--is-${liststyletype}`]: liststyletype
2723
+ },
2724
+ otherProps.className
2725
+ );
2726
+ return /* @__PURE__ */ jsx36(Component, { ref, ...mappedProps, className: classes, children: Children6.map(children, (child) => {
2727
+ if (isValidElement4(child)) {
2728
+ return cloneElement8(child, {
2729
+ parentIcon: icon
2730
+ });
2731
+ }
2732
+ return child;
2733
+ }) });
2734
+ }
2735
+ );
2736
+ List.displayName = "List";
2737
+
2738
+ // src/components/List/ListItem.tsx
2739
+ import { forwardRef as forwardRef28 } from "react";
2740
+ import classNames32 from "classnames/dedupe";
2741
+ import { jsx as jsx37, jsxs as jsxs18 } from "react/jsx-runtime";
2742
+ var ListItem = forwardRef28((props, ref) => {
2743
+ const { parentIcon, icon, children, ...otherProps } = props;
2744
+ const iconContent = icon || parentIcon;
2745
+ const classes = classNames32(
2746
+ "mobius",
2747
+ "mobius-list__item",
2748
+ {
2749
+ "--has-icon": iconContent
2750
+ },
2751
+ props.className
2752
+ );
2753
+ const contentClasses = classNames32("mobius", "mobius-list__item-content");
2754
+ const iconClasses = classNames32("mobius", "mobius-list__icon");
2755
+ if (iconContent) {
2756
+ return /* @__PURE__ */ jsx37("li", { ref, ...otherProps, className: classes, children: /* @__PURE__ */ jsxs18("span", { className: contentClasses, children: [
2757
+ /* @__PURE__ */ jsx37("span", { className: iconClasses, children: iconContent }),
2758
+ children
2759
+ ] }) });
2760
+ }
2761
+ return /* @__PURE__ */ jsx37("li", { ref, ...otherProps, className: classes, children });
2762
+ });
2763
+ ListItem.displayName = "ListItem";
2764
+
2765
+ // src/components/LoadingIndicator/LoadingIndicator.tsx
2766
+ import { forwardRef as forwardRef29 } from "react";
2767
+ import classNames33 from "classnames/dedupe";
2768
+ import { loading as loading2 } from "@simplybusiness/icons";
2769
+ import { jsx as jsx38 } from "react/jsx-runtime";
2770
+ var LoadingIndicator = forwardRef29((props, ref) => {
2771
+ const { icon = loading2, ...otherProps } = props;
2772
+ const classes = classNames33(
2773
+ "mobius",
2774
+ "mobius-loading-indicator",
2775
+ otherProps.className
2776
+ );
2777
+ return /* @__PURE__ */ jsx38(Icon, { icon, spin: true, ref, ...otherProps, className: classes });
2778
+ });
2779
+ LoadingIndicator.displayName = "LoadingIndicator";
2780
+
2781
+ // src/components/Logo/Logo.tsx
2782
+ import { forwardRef as forwardRef30 } from "react";
2783
+ import classNames34 from "classnames/dedupe";
2784
+ import { jsx as jsx39, jsxs as jsxs19 } from "react/jsx-runtime";
2785
+ var Logo = forwardRef30((props, ref) => {
2786
+ const { className, width, height, ...otherProps } = props;
2787
+ const classes = classNames34("mobius", "mobius-logo", className);
2788
+ return /* @__PURE__ */ jsxs19(
2789
+ "svg",
2790
+ {
2791
+ width,
2792
+ height,
2793
+ ref,
2794
+ className: classes,
2795
+ viewBox: "0 0 144 37",
2796
+ ...otherProps,
2797
+ children: [
2798
+ /* @__PURE__ */ jsx39("defs", { children: /* @__PURE__ */ jsxs19(
2799
+ "linearGradient",
2800
+ {
2801
+ id: "logo-gradient",
2802
+ x1: "83.508%",
2803
+ x2: "11.891%",
2804
+ y1: "76.042%",
2805
+ y2: "26.973%",
2806
+ children: [
2807
+ /* @__PURE__ */ jsx39("stop", { stopColor: "#4632D8", offset: "0%" }),
2808
+ /* @__PURE__ */ jsx39("stop", { stopColor: "#9084E8", offset: "100%" })
2809
+ ]
2810
+ }
2811
+ ) }),
2812
+ /* @__PURE__ */ jsxs19("g", { children: [
2813
+ /* @__PURE__ */ jsx39(
2814
+ "path",
2815
+ {
2816
+ fill: "#0E0A2B",
2817
+ d: "M68.788 11.307c0-2.486-2.027-3.345-3.833-4.1-1.332-.562-2.471-1.036-2.471-2.072 0-.873.77-1.42 1.968-1.42 1.051 0 1.806.444 2.294.725.193.103.474.222.755.133.192-.06.34-.207.459-.444l.34-.621c.266-.474.163-.888-.281-1.2-.533-.384-1.88-1.05-3.537-1.05-2.738 0-4.647 1.643-4.647 4.01 0 2.413 2.012 3.301 3.788 4.07 1.347.593 2.516 1.096 2.516 2.161 0 .873-.754 1.45-1.924 1.45-1.287 0-2.22-.65-2.678-.961l-.03-.015c-.533-.296-.903-.237-1.228.192l-.415.607c-.444.607-.148.992.134 1.228.828.637 2.427 1.392 4.203 1.392 2.708 0 4.587-1.673 4.587-4.085zm4.44 2.975V6.186c0-.577-.31-.888-.873-.888h-.843c-.563 0-.874.311-.874.888v8.096c0 .577.296.888.874.888h.843c.563 0 .873-.311.873-.888zM71.482 4.203h.755c.518 0 .814-.281.814-.8v-.517c0-.518-.296-.814-.814-.814h-.755c-.518 0-.8.281-.8.814v.518c.016.518.297.8.8.8zM92.645 24.48h.755c.518 0 .814-.282.814-.8v-.518c0-.518-.296-.814-.814-.814h-.755c-.518 0-.799.282-.799.814v.518c0 .518.281.8.8.8zm-6.26-19.42c-1.539 0-2.397.962-2.945 1.895-.444-1.243-1.435-1.895-2.871-1.895-1.362 0-2.146.888-2.723 1.806v-.68c0-.578-.311-.889-.873-.889h-.74c-.563 0-.873.311-.873.888v8.096c0 .577.295.888.873.888h.843c.577 0 .873-.311.873-.888V10.73c0-2.25.888-3.271 2.058-3.271 1.006 0 1.198.71 1.198 1.85v4.987c0 .578.311.888.888.888h.844c.577 0 .873-.31.873-.888v-3.551c0-2.25.873-3.271 2.013-3.271 1.036 0 1.243.74 1.243 1.85v4.987c0 .577.31.888.888.888h.814c.577 0 .888-.31.888-.888V8.835c0-2.5-1.095-3.774-3.27-3.774zm10.804 10.33c2.679 0 4.558-2.13 4.558-5.164 0-3.094-1.776-5.166-4.425-5.166-1.761 0-2.708 1.036-3.049 1.51v-.533c0-.459-.34-.755-.873-.755h-.607c-.562 0-.888.326-.888.888v11.9c0 .576.311.887.888.887h.814c.578 0 .888-.31.888-.888v-3.404c0-.207-.014-.4-.014-.532.325.429 1.184 1.258 2.708 1.258zm-2.768-5.105c0-1.362.622-2.975 2.368-2.975 1.377 0 2.309 1.184 2.309 2.945 0 1.746-.947 2.916-2.338 2.916-1.54 0-2.339-1.45-2.339-2.886zm12.965 4.07v-.652c0-.444-.252-.725-.681-.784-.34-.03-.68-.192-.68-1.066v-9.47c0-.563-.326-.888-.874-.888h-.843c-.563 0-.874.31-.874.888v9.679c0 1.258.34 2.16 1.021 2.678.637.489 1.466.533 2.013.533.607 0 .918-.325.918-.917zm9.457-9.073h-.962c-.518 0-.844.237-.977.726l-1.717 4.972c-.089.311-.192.71-.251.977-.074-.281-.193-.71-.296-1.021l-1.835-4.943c-.163-.489-.489-.71-.977-.71h-1.036c-.415 0-.622.162-.71.295-.09.134-.163.385.014.755l3.685 8.57-.34.813c-.252.592-.77 1.229-1.45 1.229-.267 0-.474-.09-.652-.163h-.014c-.43-.104-.755.074-.962.488l-.163.415c-.119.251-.148.517-.06.725.075.192.237.34.474.429.326.118.814.296 1.391.296 1.628 0 2.975-.977 3.597-2.605l3.996-10.226c.103-.296.088-.563-.045-.755-.163-.163-.4-.267-.71-.267zM67.634 28.297c.977-.592 1.54-1.658 1.54-2.886 0-2.176-1.688-3.567-4.293-3.567h-4.04c-.562 0-.873.311-.873.888v11.899c0 .577.296.888.873.888h4.1c1.346 0 2.5-.34 3.33-.962.932-.71 1.42-1.761 1.42-3.049.03-1.524-.784-2.767-2.057-3.211zm-5.017-.962v-3.212h2.25c1.02 0 1.628.592 1.628 1.584 0 .991-.607 1.643-1.57 1.643h-2.308v-.015zm4.396 4.01c0 1.155-.71 1.865-1.865 1.865h-2.53v-3.714h2.53c1.14.014 1.865.74 1.865 1.85zm12.638-5.712h-.814c-.577 0-.888.31-.888.888v3.655c0 2.176-1.361 3.182-2.634 3.182-1.006 0-1.406-.547-1.406-1.88v-4.942c0-.578-.31-.888-.888-.888h-.814c-.562 0-.888.325-.888.888v5.431c0 2.516 1.17 3.774 3.463 3.774a3.937 3.937 0 003.286-1.761v.651c0 .577.296.888.873.888h.74c.577 0 .888-.31.888-.888v-8.095c-.03-.578-.355-.903-.918-.903zm6.956 3.937c-.917-.311-1.702-.592-1.702-1.184 0-.74.77-.859 1.229-.859.784 0 1.406.281 1.805.474.548.237.947.118 1.184-.34l.193-.341c.251-.518.133-.947-.326-1.184-.326-.178-1.288-.71-2.753-.71-2.279 0-3.803 1.213-3.803 3.004 0 2.042 1.731 2.65 3.137 3.138.903.325 1.687.592 1.687 1.169 0 .547-.488.902-1.258.902-.917 0-1.613-.37-2.057-.621l-.059-.03c-.533-.28-.903-.207-1.213.222l-.222.34c-.178.252-.237.504-.178.726.044.207.192.37.4.488a5.774 5.774 0 003.285 1.007c2.235 0 3.789-1.273 3.789-3.079-.03-2.042-1.761-2.649-3.138-3.122zm6.897-3.937h-.844c-.562 0-.873.31-.873.888v8.095c0 .577.296.888.873.888h.844c.577 0 .873-.31.873-.888v-8.095c0-.563-.31-.888-.873-.888zm9.324-.237c-1.924 0-2.93 1.154-3.36 1.806v-.681c0-.577-.31-.888-.873-.888h-.74c-.563 0-.873.31-.873.888v8.095c0 .577.296.888.873.888h.843c.578 0 .874-.31.874-.888v-3.744c0-1.79 1.14-3.078 2.708-3.078 1.021 0 1.436.547 1.436 1.88v4.942c0 .577.31.888.887.888h.814c.578 0 .888-.31.888-.888v-5.431c0-2.516-1.169-3.789-3.477-3.789zm10.448 0c-2.96 0-5.032 2.131-5.032 5.165 0 2.99 2.235 5.165 5.313 5.165 1.48 0 2.635-.533 3.345-.977.444-.266.562-.695.296-1.198l-.222-.385c-.266-.459-.651-.563-1.184-.31h-.015a3.885 3.885 0 01-2.042.606c-1.54 0-2.634-.962-2.812-2.472h5.816a.935.935 0 00.933-.917c.014-2.827-1.717-4.677-4.396-4.677zm-.044 2.013c1.065 0 1.79.77 1.864 1.968h-4.1c.253-1.213 1.096-1.968 2.236-1.968zm10.152 2.16c-.917-.31-1.702-.591-1.702-1.183 0-.74.77-.859 1.229-.859.784 0 1.406.281 1.805.474.548.237.947.118 1.184-.34l.192-.341c.252-.518.134-.947-.325-1.184-.326-.178-1.288-.71-2.753-.71-2.279 0-3.803 1.213-3.803 3.004 0 2.042 1.731 2.65 3.137 3.138.903.325 1.687.592 1.687 1.169 0 .547-.488.902-1.258.902-.917 0-1.613-.37-2.057-.621l-.059-.03c-.533-.28-.903-.207-1.214.222l-.222.34c-.177.252-.236.504-.177.726.044.207.192.37.4.488a5.774 5.774 0 003.285 1.007c2.235 0 3.789-1.273 3.789-3.079-.015-2.042-1.747-2.649-3.138-3.122zm8.791 0c-.917-.31-1.702-.591-1.702-1.183 0-.74.77-.859 1.229-.859.784 0 1.406.281 1.805.474.548.237.947.118 1.184-.34l.192-.341c.252-.518.134-.947-.325-1.184-.326-.178-1.288-.71-2.753-.71-2.279 0-3.803 1.213-3.803 3.004 0 2.042 1.731 2.65 3.137 3.138.903.325 1.687.592 1.687 1.169 0 .547-.488.902-1.258.902-.917 0-1.613-.37-2.057-.621l-.059-.03c-.533-.28-.903-.207-1.214.222l-.222.34c-.177.252-.236.504-.177.726.044.207.192.37.4.488a5.774 5.774 0 003.285 1.007c2.235 0 3.789-1.273 3.789-3.079-.015-2.042-1.747-2.649-3.138-3.122z"
2818
+ }
2819
+ ),
2820
+ /* @__PURE__ */ jsx39(
2821
+ "path",
2822
+ {
2823
+ fill: "url(#logo-gradient)",
2824
+ d: "M22.747 22.288c.607 1.214.918 2.59.918 4.144 0 1.45-.267 2.827-.8 4.1a10.018 10.018 0 01-2.279 3.36c-.991.961-2.235 1.73-3.744 2.278-1.51.563-3.167.829-4.988.829-2.264 0-4.35-.385-6.29-1.14-1.938-.77-3.492-1.598-4.676-2.5-.31-.252-.548-.504-.696-.77a1.332 1.332 0 01-.177-.71.718.718 0 010-.252c.03-.37.207-.785.547-1.199l1.14-1.598c.4-.548.829-.844 1.288-.918a.896.896 0 01.222-.03c.4 0 .873.163 1.39.474 2.487 1.776 4.914 2.679 7.252 2.679 1.643 0 2.96-.385 3.922-1.14.962-.755 1.45-1.746 1.45-2.96 0-.725-.192-1.39-.562-1.983a5.347 5.347 0 00-1.539-1.569 18.207 18.207 0 00-2.235-1.287 56.102 56.102 0 00-2.649-1.214c-.917-.4-1.835-.814-2.752-1.258a19.282 19.282 0 01-2.62-1.539 14.014 14.014 0 01-2.22-1.924c-.666-.695-1.169-1.539-1.554-2.545-.37-.992-.562-2.087-.562-3.271 0-2.042.533-3.863 1.598-5.446 1.066-1.584 2.516-2.797 4.336-3.641C8.303.414 10.345 0 12.624 0c1.91 0 3.685.281 5.358.844 1.657.562 2.96 1.198 3.892 1.88.68.473 1.006 1.035 1.006 1.671 0 .385-.118.785-.37 1.2l-.917 1.657c-.385.74-.903 1.11-1.554 1.11-.4 0-.83-.133-1.318-.4a42.421 42.421 0 00-1.687-.947c-.473-.237-1.14-.488-1.998-.71a9.458 9.458 0 00-2.56-.356c-1.672 0-3.004.37-3.981 1.11-.992.74-1.48 1.717-1.48 2.946 0 .902.31 1.701.932 2.412.622.695 1.421 1.302 2.398 1.79.977.489 2.057.977 3.256 1.466a54.048 54.048 0 013.552 1.628 20.795 20.795 0 013.24 2.042c.948.755 1.732 1.732 2.354 2.945zm31.257 2.945c0 3.197-1.155 6.083-3.256 8.14-2.265 2.205-5.506 3.36-9.368 3.36H30.71c-2.443 0-4.278-1.836-4.278-4.278V4.53c0-1.2.43-2.28 1.214-3.064C28.43.681 29.51.252 30.709.252h9.013c3.419 0 6.32 1.095 8.377 3.182 1.909 1.923 2.945 4.558 2.945 7.429 0 2.294-.622 4.203-1.91 5.816 1.377.77 2.487 1.776 3.286 2.99 1.066 1.583 1.584 3.448 1.584 5.564zm-12.106-7.68c.044-.03 4.913-3.02 4.913-6.675 0-1.761-.607-3.345-1.717-4.455-1.568-1.584-3.788-1.924-5.372-1.924H30.68v28h10.7c2.738 0 4.958-.754 6.408-2.16 1.273-1.243 1.983-3.049 1.983-5.106 0-1.272-.296-2.353-.858-3.196v-.03c-1.362-2.353-6.838-3.774-6.897-3.789l-.844-.222.726-.444z"
2825
+ }
2826
+ ),
2827
+ /* @__PURE__ */ jsx39(
2828
+ "path",
2829
+ {
2830
+ fill: "#0E0A2B",
2831
+ d: "M138.199 25.455c0-.4.074-.784.222-1.14.148-.354.355-.665.606-.932.267-.266.563-.473.903-.621.34-.148.725-.222 1.11-.222.4 0 .784.074 1.125.222.355.148.666.355.917.621.267.267.474.578.622.933.148.355.222.74.222 1.14 0 .399-.074.784-.222 1.139a2.86 2.86 0 01-.622.932 3.087 3.087 0 01-.917.637 2.646 2.646 0 01-1.125.236c-.4 0-.77-.074-1.11-.236a2.777 2.777 0 01-.903-.637 2.821 2.821 0 01-.606-.932 2.898 2.898 0 01-.222-1.14zm.71 0c0 .326.06.622.163.903.103.281.266.518.459.725a2.051 2.051 0 001.524.666c.31 0 .592-.059.858-.177a2.175 2.175 0 001.155-1.214c.118-.281.162-.577.162-.903 0-.325-.059-.621-.162-.902a2.422 2.422 0 00-.46-.726 2.112 2.112 0 00-.695-.488 2.073 2.073 0 00-.858-.178c-.31 0-.592.06-.844.178a2.051 2.051 0 00-.68.488 2.45 2.45 0 00-.46.726 2.636 2.636 0 00-.162.902zm1.154-1.14c0-.221.119-.34.34-.34h.889c.296 0 .532.09.695.252.178.163.267.4.267.68a.623.623 0 01-.06.297.557.557 0 01-.133.222.512.512 0 01-.163.148c-.059.044-.118.059-.162.074v.014l.03.03c.014.015.014.03.029.06l.044.088.34.666c.06.118.075.207.045.281-.03.074-.104.104-.207.104h-.104c-.192 0-.31-.089-.385-.252l-.384-.829h-.4v.74c0 .222-.104.34-.31.34h-.06c-.207 0-.31-.118-.31-.34v-2.234zm1.051 1.037c.133 0 .252-.045.31-.119.075-.074.104-.192.104-.325s-.03-.252-.103-.326a.413.413 0 00-.296-.118h-.385v.873h.37v.015z"
2832
+ }
2833
+ )
2834
+ ] })
2835
+ ]
2836
+ }
2837
+ );
2838
+ });
2839
+ Logo.displayName = "Logo";
2840
+
2841
+ // src/components/Modal/Content.tsx
2842
+ import { forwardRef as forwardRef31 } from "react";
2843
+ import { jsx as jsx40 } from "react/jsx-runtime";
2844
+ var Content2 = forwardRef31(
2845
+ ({ children, ...otherProps }, ref) => /* @__PURE__ */ jsx40("div", { ref, ...otherProps, className: "mobius-modal__content", children })
2846
+ );
2847
+ Content2.displayName = "Content";
2848
+
2849
+ // src/components/Modal/Header.tsx
2850
+ import { forwardRef as forwardRef32 } from "react";
2851
+ import { cross as cross2 } from "@simplybusiness/icons";
2852
+
2853
+ // src/components/Modal/useModal.ts
2854
+ import { useContext as useContext2 } from "react";
2855
+
2856
+ // src/components/Modal/ModalContext.tsx
2857
+ import { createContext as createContext2 } from "react";
2858
+ var ModalContext = createContext2({
2859
+ onClose: () => {
2860
+ },
2861
+ closeLabel: void 0
2862
+ });
2863
+
2864
+ // src/components/Modal/useModal.ts
2865
+ var useModal = () => {
2866
+ const { onClose, closeLabel } = useContext2(ModalContext);
2867
+ return { onClose, closeLabel };
2868
+ };
2869
+
2870
+ // src/components/Modal/Header.tsx
2871
+ import { jsx as jsx41, jsxs as jsxs20 } from "react/jsx-runtime";
2872
+ var Header2 = forwardRef32(
2873
+ ({ children, ...otherProps }, ref) => {
2874
+ const { onClose, closeLabel } = useModal();
2875
+ return /* @__PURE__ */ jsxs20("header", { ref, ...otherProps, className: "mobius-modal__header", children: [
2876
+ children,
2877
+ /* @__PURE__ */ jsxs20(
2878
+ Button,
2879
+ {
2880
+ "aria-label": "Close",
2881
+ variant: "basic",
2882
+ onPress: onClose,
2883
+ className: "mobius-modal__close",
2884
+ children: [
2885
+ /* @__PURE__ */ jsx41(Icon, { icon: cross2 }),
2886
+ " ",
2887
+ closeLabel
2888
+ ]
2889
+ }
2890
+ )
2891
+ ] });
2892
+ }
2893
+ );
2894
+ Header2.displayName = "Header";
2895
+
2896
+ // src/components/Modal/Modal.tsx
2897
+ import classNames35 from "classnames/dedupe";
2898
+ import { forwardRef as forwardRef33, useEffect as useEffect18, useMemo as useMemo2, useRef as useRef10, useState as useState16 } from "react";
2899
+ import { jsx as jsx42 } from "react/jsx-runtime";
2900
+ var TRANSITION_CSS_VARIABLE2 = "--modal-transition-duration";
2901
+ var Modal = forwardRef33((props, ref) => {
2902
+ const {
2903
+ isOpen,
2904
+ onClose,
2905
+ onOpen,
2906
+ children,
2907
+ className,
2908
+ closeLabel,
2909
+ isFullScreen,
2910
+ animation,
2911
+ // Deprecated props below
2912
+ size,
2913
+ appElement,
2914
+ preventCloseOnEsc,
2915
+ shouldFocusAfterRender,
2916
+ parentSelector,
2917
+ ...rest
2918
+ } = props;
2919
+ const [shouldTransition, setShouldTransition] = useState16(false);
2920
+ useDeprecationWarning({
2921
+ size,
2922
+ appElement,
2923
+ preventCloseOnEsc,
2924
+ shouldFocusAfterRender,
2925
+ parentSelector
2926
+ });
2927
+ useEffect18(() => {
2928
+ setShouldTransition(supportsDialog());
2929
+ }, []);
2930
+ const dialogRef = useRef10(null);
2931
+ const { close } = useDialog({
2932
+ ref: dialogRef,
2933
+ isOpen,
2934
+ onOpen,
2935
+ onClose,
2936
+ transition: {
2937
+ isEnabled: !!animation,
2938
+ CSSVariable: TRANSITION_CSS_VARIABLE2
2939
+ }
2940
+ });
2941
+ const modalClasses = classNames35(
2942
+ "mobius",
2943
+ "mobius-modal",
2944
+ {
2945
+ "--no-dialog-support": !shouldTransition,
2946
+ // This class is used to correctly position modal in x/y middle on iOS <= 15.2
2947
+ "--should-transition": shouldTransition && animation,
2948
+ "--slide-up": animation === "slideUp",
2949
+ "--fade": animation === "fade",
2950
+ "--is-fullscreen": isFullScreen
2951
+ },
2952
+ className
2953
+ );
2954
+ const contextValue = useMemo2(
2955
+ () => ({
2956
+ onClose: close,
2957
+ closeLabel
2958
+ }),
2959
+ [close, closeLabel]
2960
+ );
2961
+ return /* @__PURE__ */ jsx42(
2962
+ "dialog",
2963
+ {
2964
+ ref: mergeRefs([dialogRef, ref]),
2965
+ onCancel: close,
2966
+ className: modalClasses,
2967
+ ...rest,
2968
+ children: /* @__PURE__ */ jsx42(ModalContext.Provider, { value: contextValue, children })
2969
+ }
2970
+ );
2971
+ });
2972
+ Modal.displayName = "Modal";
2973
+
2974
+ // src/components/Modal/index.tsx
2975
+ var Modal2 = Object.assign(Modal, {
2976
+ Header: Header2,
2977
+ Content: Content2
2978
+ });
2979
+ Modal2.displayName = "Modal";
2980
+
2981
+ // src/components/NumberField/NumberField.tsx
2982
+ import classNames36 from "classnames/dedupe";
2983
+ import { forwardRef as forwardRef34 } from "react";
2984
+ import { jsx as jsx43 } from "react/jsx-runtime";
2985
+ var NumberField = forwardRef34((props, ref) => {
2986
+ const { minValue, maxValue, step, defaultValue, className, ...otherProps } = props;
2987
+ const containerClasses = classNames36("mobius-number-field", className);
2988
+ const handleBeforeInput = (event) => {
2989
+ const { data } = event.nativeEvent;
2990
+ if (step != null && Number.isInteger(step) && data === ".") {
2991
+ event.preventDefault();
2992
+ }
2993
+ if (minValue != null && minValue >= 0 && data === "-") {
2994
+ event.preventDefault();
2995
+ }
2996
+ };
2997
+ return /* @__PURE__ */ jsx43(
2998
+ TextField,
2999
+ {
3000
+ ...otherProps,
3001
+ className: containerClasses,
3002
+ onBeforeInput: handleBeforeInput,
3003
+ type: "number",
3004
+ min: minValue ?? void 0,
3005
+ max: maxValue ?? void 0,
3006
+ step,
3007
+ ref,
3008
+ defaultValue: defaultValue != null ? defaultValue.toString() : defaultValue
3009
+ }
3010
+ );
3011
+ });
3012
+ NumberField.displayName = "NumberField";
3013
+
3014
+ // src/components/Option/Option.tsx
3015
+ import { forwardRef as forwardRef35 } from "react";
3016
+ import { jsx as jsx44 } from "react/jsx-runtime";
3017
+ var Option2 = forwardRef35((props, ref) => {
3018
+ const { isDisabled, ...rest } = props;
3019
+ const mappedProps = {
3020
+ ...rest,
3021
+ disabled: isDisabled
3022
+ };
3023
+ return /* @__PURE__ */ jsx44("option", { ...mappedProps, ref });
3024
+ });
3025
+ Option2.displayName = "Option";
3026
+
3027
+ // src/components/PasswordField/PasswordField.tsx
3028
+ import classNames37 from "classnames/dedupe";
3029
+ import { forwardRef as forwardRef36, useState as useState17, useRef as useRef11 } from "react";
3030
+
3031
+ // src/components/PasswordField/ShowHideButton.tsx
3032
+ import { jsx as jsx45 } from "react/jsx-runtime";
3033
+ var ShowHideButton = ({
3034
+ show = false,
3035
+ onClick
3036
+ }) => /* @__PURE__ */ jsx45(
3037
+ "button",
3038
+ {
3039
+ className: "mobius-password-field__show-button",
3040
+ type: "button",
3041
+ onClick: (e) => {
3042
+ e.preventDefault();
3043
+ onClick();
3044
+ },
3045
+ "aria-label": `${show ? "Hide" : "Show"} password`,
3046
+ "data-testid": "show-hide-button",
3047
+ children: show ? "hide" : "show"
3048
+ }
3049
+ );
3050
+
3051
+ // src/components/PasswordField/PasswordField.tsx
3052
+ import { jsx as jsx46 } from "react/jsx-runtime";
3053
+ var PasswordField = forwardRef36(
3054
+ ({ className, ...props }, ref) => {
3055
+ const [show, setShow] = useState17(false);
3056
+ const type = show ? "text" : "password";
3057
+ const classes = classNames37("mobius-password-field", className);
3058
+ const localRef = useRef11(null);
3059
+ const handleShowHideButtonClick = () => {
3060
+ setShow((oldShow) => !oldShow);
3061
+ localRef.current?.focus();
3062
+ };
3063
+ return /* @__PURE__ */ jsx46(
3064
+ TextField,
3065
+ {
3066
+ ref: mergeRefs([localRef, ref]),
3067
+ className: classes,
3068
+ ...props,
3069
+ type,
3070
+ suffixInside: /* @__PURE__ */ jsx46(ShowHideButton, { onClick: handleShowHideButtonClick, show })
3071
+ }
3072
+ );
3073
+ }
3074
+ );
3075
+ PasswordField.displayName = "PasswordField";
3076
+
3077
+ // src/components/Popover/Popover.tsx
3078
+ import {
3079
+ FloatingArrow,
3080
+ arrow,
3081
+ autoUpdate,
3082
+ flip,
3083
+ offset,
3084
+ shift,
3085
+ useDismiss,
3086
+ useFloating,
3087
+ useInteractions
3088
+ } from "@floating-ui/react";
3089
+ import { cross as cross3 } from "@simplybusiness/icons";
3090
+ import classNames38 from "classnames";
3091
+ import { cloneElement as cloneElement9, useRef as useRef12, useState as useState18 } from "react";
3092
+ import { Fragment as Fragment3, jsx as jsx47, jsxs as jsxs21 } from "react/jsx-runtime";
3093
+ var OFFSET_FROM_CONTENT_DEFAULT = 10;
3094
+ var Popover = (props) => {
3095
+ const { trigger, children, onOpen, onClose, className } = props;
3096
+ const arrowRef = useRef12(null);
3097
+ const [isOpen, setIsOpen] = useState18(false);
3098
+ const { refs, floatingStyles, context } = useFloating({
3099
+ open: isOpen,
3100
+ onOpenChange: setIsOpen,
3101
+ whileElementsMounted: autoUpdate,
3102
+ middleware: [
3103
+ arrow({
3104
+ element: arrowRef
3105
+ }),
3106
+ offset(OFFSET_FROM_CONTENT_DEFAULT),
3107
+ shift(),
3108
+ flip()
3109
+ ]
3110
+ });
3111
+ const dismiss = useDismiss(context, {
3112
+ bubbles: true,
3113
+ outsidePress: (event) => {
3114
+ const toggle = refs.reference.current;
3115
+ const isToggleClick = !toggle?.contains(event.target);
3116
+ if (isToggleClick) {
3117
+ onClose?.();
3118
+ }
3119
+ return true;
3120
+ }
3121
+ });
3122
+ const { getReferenceProps, getFloatingProps } = useInteractions([dismiss]);
3123
+ const containerClasses = classNames38(
3124
+ "mobius",
3125
+ "mobius-popover__container",
3126
+ className
3127
+ );
3128
+ const toggleVisibility = () => {
3129
+ if (isOpen) {
3130
+ setIsOpen(false);
3131
+ onClose?.();
3132
+ return;
3133
+ }
3134
+ setIsOpen(true);
3135
+ onOpen?.();
3136
+ };
3137
+ const triggerComponent = cloneElement9(trigger, {
3138
+ ref: refs.setReference,
3139
+ className: classNames38(trigger.props.className, "mobius-popover__toggle"),
3140
+ onClick: toggleVisibility,
3141
+ ...getReferenceProps()
3142
+ });
3143
+ useWindowEvent("keydown", (e) => {
3144
+ if (e.key === "Escape") {
3145
+ onClose?.();
3146
+ e.preventDefault();
3147
+ e.stopPropagation();
3148
+ }
3149
+ });
3150
+ return /* @__PURE__ */ jsxs21(Fragment3, { children: [
3151
+ triggerComponent,
3152
+ isOpen && /* @__PURE__ */ jsxs21(
3153
+ "div",
3154
+ {
3155
+ className: containerClasses,
3156
+ ref: refs.setFloating,
3157
+ style: floatingStyles,
3158
+ ...getFloatingProps(),
3159
+ children: [
3160
+ /* @__PURE__ */ jsxs21("div", { className: "mobius-popover", children: [
3161
+ /* @__PURE__ */ jsx47("header", { className: "mobius-popover__header", children: /* @__PURE__ */ jsx47(
3162
+ Button,
3163
+ {
3164
+ type: "button",
3165
+ className: "mobius-popover__close-button",
3166
+ onClick: toggleVisibility,
3167
+ "aria-label": "Close",
3168
+ variant: "ghost",
3169
+ children: /* @__PURE__ */ jsx47(
3170
+ Icon,
3171
+ {
3172
+ icon: cross3,
3173
+ size: "md",
3174
+ className: "mobius-popover__close-icon"
3175
+ }
3176
+ )
3177
+ }
3178
+ ) }),
3179
+ /* @__PURE__ */ jsx47("div", { className: "mobius-popover__body", children })
3180
+ ] }),
3181
+ /* @__PURE__ */ jsx47(
3182
+ FloatingArrow,
3183
+ {
3184
+ ref: arrowRef,
3185
+ context,
3186
+ width: 20,
3187
+ className: "mobius-popover__arrow-icon"
3188
+ }
3189
+ )
3190
+ ]
3191
+ }
3192
+ )
3193
+ ] });
3194
+ };
3195
+
3196
+ // src/components/Progress/Progress.tsx
3197
+ import classNames39 from "classnames/dedupe";
3198
+ import { forwardRef as forwardRef37, useId as useId8 } from "react";
3199
+ import { jsx as jsx48, jsxs as jsxs22 } from "react/jsx-runtime";
3200
+ function warnAboutInvalidValues(value, minValue, maxValue) {
3201
+ if (minValue > maxValue) {
3202
+ console.warn("minValue is greater than maxValue");
3203
+ }
3204
+ if (value < minValue) {
3205
+ console.warn("Progress value is less than minValue");
3206
+ }
3207
+ if (value > maxValue) {
3208
+ console.warn("Progress value is greater than maxValue");
3209
+ }
3210
+ }
3211
+ var sanitizedValue = (value, defaultValue) => {
3212
+ const numberValue = parseFloat(value);
3213
+ return Number.isNaN(numberValue) ? defaultValue : numberValue;
3214
+ };
3215
+ var getLabelComponent = (label, progressLabelId, showLabel) => {
3216
+ if (showLabel) {
3217
+ return /* @__PURE__ */ jsx48(
3218
+ Label,
3219
+ {
3220
+ id: progressLabelId,
3221
+ className: "mobius-progress__label",
3222
+ elementType: "span",
3223
+ children: label
3224
+ }
3225
+ );
3226
+ }
3227
+ return /* @__PURE__ */ jsx48(VisuallyHidden, { children: /* @__PURE__ */ jsx48(
3228
+ Label,
3229
+ {
3230
+ id: progressLabelId,
3231
+ className: "mobius-progress__label",
3232
+ elementType: "span",
3233
+ children: label
3234
+ }
3235
+ ) });
3236
+ };
3237
+ var DEFAULT_VALUE = 0;
3238
+ var DEFAULT_MIN_VALUE = 0;
3239
+ var DEFAULT_MAX_VALUE = 100;
3240
+ var Progress = forwardRef37((props, ref) => {
3241
+ const progressId = useId8();
3242
+ const progressLabelId = useId8();
3243
+ const {
3244
+ id,
3245
+ label,
3246
+ showLabel = true,
3247
+ showValueLabel = !!label,
3248
+ valueFormatter,
3249
+ variant = "primary",
3250
+ className
3251
+ } = props;
3252
+ let { value, minValue, maxValue } = props;
3253
+ value = sanitizedValue(value, DEFAULT_VALUE);
3254
+ minValue = sanitizedValue(minValue, DEFAULT_MIN_VALUE);
3255
+ maxValue = sanitizedValue(maxValue, DEFAULT_MAX_VALUE);
3256
+ if (value === void 0 || minValue === void 0 || maxValue === void 0) {
3257
+ return null;
3258
+ }
3259
+ warnAboutInvalidValues(value, minValue, maxValue);
3260
+ const clamp = (num, min, max) => Math.min(Math.max(num, min), max);
3261
+ const percentage = clamp(
3262
+ Math.round((value - minValue) / (maxValue - minValue) * 100),
3263
+ 0,
3264
+ 100
3265
+ );
3266
+ const barWidth = `${percentage}%`;
3267
+ const classes = classNames39("mobius", "mobius-progress", className, {
3268
+ "--is-primary": variant === "primary",
3269
+ "--is-secondary": variant === "secondary"
3270
+ });
3271
+ const progressBarProps = {};
3272
+ progressBarProps["aria-valuemin"] = minValue.toString();
3273
+ progressBarProps["aria-valuemax"] = maxValue.toString();
3274
+ progressBarProps["aria-valuenow"] = value.toString();
3275
+ progressBarProps["aria-valuetext"] = valueFormatter instanceof Function ? valueFormatter(value, minValue, maxValue) : barWidth;
3276
+ const labelComponent = getLabelComponent(label, progressLabelId, showLabel);
3277
+ return /* @__PURE__ */ jsxs22(
3278
+ "div",
3279
+ {
3280
+ id: id || progressId,
3281
+ ...progressBarProps,
3282
+ ref,
3283
+ className: classes,
3284
+ role: "progressbar",
3285
+ "aria-labelledby": progressLabelId,
3286
+ children: [
3287
+ labelComponent,
3288
+ /* @__PURE__ */ jsx48("div", { className: "mobius-progress__track", children: /* @__PURE__ */ jsx48("div", { className: "mobius-progress__bar", style: { width: barWidth } }) }),
3289
+ showValueLabel && /* @__PURE__ */ jsx48(Label, { "data-testid": "value-label", elementType: "span", children: progressBarProps["aria-valuetext"] })
3290
+ ]
3291
+ }
3292
+ );
3293
+ });
3294
+ Progress.displayName = "Progress";
3295
+
3296
+ // src/components/Radio/Radio.tsx
3297
+ import classNames40 from "classnames/dedupe";
3298
+ import { forwardRef as forwardRef38 } from "react";
3299
+ import { Fragment as Fragment4, jsx as jsx49, jsxs as jsxs23 } from "react/jsx-runtime";
3300
+ var Radio = forwardRef38(
3301
+ (props, ref) => {
3302
+ const {
3303
+ children,
3304
+ value,
3305
+ label,
3306
+ className,
3307
+ isDisabled,
3308
+ errorMessage,
3309
+ onChange,
3310
+ defaultChecked,
3311
+ groupDisabled,
3312
+ name,
3313
+ selected,
3314
+ setSelected,
3315
+ isRequired,
3316
+ ...otherProps
3317
+ } = props;
3318
+ const realDisabled = groupDisabled || isDisabled;
3319
+ const isMultiline = label && children;
3320
+ const isDefaultSelected = selected === value || defaultChecked;
3321
+ const radioClasses = {
3322
+ "--is-disabled": realDisabled,
3323
+ "--is-selected": selected === value,
3324
+ "--is-multiline": !!isMultiline,
3325
+ "--is-required": isRequired
3326
+ };
3327
+ const containerClasses = classNames40(
3328
+ "mobius-radio__label",
3329
+ radioClasses,
3330
+ className
3331
+ );
3332
+ const inputClasses = classNames40("mobius-radio__input", radioClasses);
3333
+ const handleClick = (event) => {
3334
+ if (onChange) {
3335
+ onChange(event);
3336
+ }
3337
+ if (setSelected) {
3338
+ setSelected(event.currentTarget.value);
3339
+ }
3340
+ };
3341
+ const {
3342
+ // @ts-expect-error - TS doesn't like the orientation prop
3343
+ orientation,
3344
+ "aria-describedby": _ariaDescribedBy,
3345
+ ...rest
3346
+ } = otherProps;
3347
+ return /* @__PURE__ */ jsxs23(Fragment4, { children: [
3348
+ /* @__PURE__ */ jsxs23(Label, { className: containerClasses, children: [
3349
+ /* @__PURE__ */ jsx49(
3350
+ "input",
3351
+ {
3352
+ "aria-describedby": otherProps["aria-describedby"],
3353
+ disabled: realDisabled,
3354
+ ref,
3355
+ className: inputClasses,
3356
+ onClick: handleClick,
3357
+ value,
3358
+ tabIndex: 0,
3359
+ type: "radio",
3360
+ defaultChecked: isDefaultSelected,
3361
+ name,
3362
+ required: isRequired,
3363
+ ...rest
3364
+ }
3365
+ ),
3366
+ isMultiline ? /* @__PURE__ */ jsxs23("div", { className: "mobius-radio__content--multiline", children: [
3367
+ /* @__PURE__ */ jsx49("div", { className: "mobius-radio__content-first-line", children: label }),
3368
+ /* @__PURE__ */ jsx49("div", { className: "mobius-radio__extra-content", children })
3369
+ ] }) : /* @__PURE__ */ jsx49("div", { className: "mobius-radio__content", children: label || children })
3370
+ ] }),
3371
+ errorMessage && /* @__PURE__ */ jsx49(ErrorMessage, { errorMessage })
3372
+ ] });
3373
+ }
3374
+ );
3375
+ Radio.displayName = "Radio";
3376
+
3377
+ // src/components/Radio/RadioGroup.tsx
3378
+ import {
3379
+ Children as Children7,
3380
+ cloneElement as cloneElement10,
3381
+ forwardRef as forwardRef39,
3382
+ isValidElement as isValidElement5,
3383
+ useId as useId9,
3384
+ useState as useState19
3385
+ } from "react";
3386
+ import classNames41 from "classnames/dedupe";
3387
+ import { jsx as jsx50, jsxs as jsxs24 } from "react/jsx-runtime";
3388
+ var getDefaultVal = (children, defaultValue) => {
3389
+ if (Array.isArray(children) && defaultValue) {
3390
+ const option = children?.find((item) => item.props.value === defaultValue);
3391
+ if (!option) return "";
3392
+ return option.props.value;
3393
+ }
3394
+ return "";
3395
+ };
3396
+ var RadioGroup = forwardRef39((props, ref) => {
3397
+ const {
3398
+ label,
3399
+ isDisabled = false,
3400
+ isRequired,
3401
+ validationState,
3402
+ isInvalid,
3403
+ orientation = "vertical",
3404
+ className,
3405
+ errorMessage,
3406
+ children,
3407
+ defaultValue,
3408
+ isReadOnly,
3409
+ name,
3410
+ onChange,
3411
+ ...rest
3412
+ } = props;
3413
+ const defaultSelected = getDefaultVal(children, defaultValue);
3414
+ const [selected, setSelected] = useState19(defaultSelected);
3415
+ const validationClasses = useValidationClasses({
3416
+ validationState,
3417
+ isInvalid
3418
+ });
3419
+ const radioClasses = {
3420
+ "--is-disabled": isDisabled,
3421
+ "--is-required": typeof isRequired === "boolean" && isRequired,
3422
+ "--is-optional": typeof isRequired === "boolean" && !isRequired,
3423
+ [`--is-${orientation}`]: true,
3424
+ [className || ""]: true
3425
+ };
3426
+ const radioGroupClasses = classNames41(
3427
+ "mobius",
3428
+ "mobius-radio-group",
3429
+ radioClasses,
3430
+ validationClasses
3431
+ );
3432
+ const radioWrapperClasses = classNames41("mobius-radio__wrapper", {
3433
+ [`--is-${orientation}`]: true
3434
+ });
3435
+ const labelClasses = classNames41(radioClasses, validationClasses);
3436
+ const errorMessageId = useId9();
3437
+ const defaultNameAttrId = useId9();
3438
+ const nameAttribute = name || defaultNameAttrId;
3439
+ const shouldErrorMessageShow = errorMessage ? errorMessageId : void 0;
3440
+ const describedBy = spaceDelimitedList([
3441
+ shouldErrorMessageShow,
3442
+ props["aria-describedby"]
3443
+ ]);
3444
+ const labelId = useId9();
3445
+ return /* @__PURE__ */ jsx50(
3446
+ "div",
3447
+ {
3448
+ ...rest,
3449
+ "aria-describedby": describedBy,
3450
+ "aria-disabled": isDisabled,
3451
+ "aria-errormessage": shouldErrorMessageShow,
3452
+ "aria-invalid": isInvalid,
3453
+ "aria-label": props["aria-label"],
3454
+ "aria-labelledby": props["aria-labelledby"] || labelId,
3455
+ "aria-orientation": orientation,
3456
+ "aria-readonly": isReadOnly,
3457
+ "aria-required": isRequired,
3458
+ ref,
3459
+ className: radioGroupClasses,
3460
+ role: "radiogroup",
3461
+ children: /* @__PURE__ */ jsxs24(Stack, { gap: "xs", children: [
3462
+ label && /* @__PURE__ */ jsx50(Label, { htmlFor: name, id: labelId, className: labelClasses, children: label }),
3463
+ /* @__PURE__ */ jsx50("div", { className: radioWrapperClasses, children: Children7.map(children, (child) => {
3464
+ if (isValidElement5(child)) {
3465
+ return cloneElement10(child, {
3466
+ orientation,
3467
+ groupDisabled: isDisabled,
3468
+ name: nameAttribute,
3469
+ selected,
3470
+ setSelected,
3471
+ isRequired,
3472
+ "aria-describedby": describedBy,
3473
+ onChange
3474
+ });
3475
+ }
3476
+ return child;
3477
+ }) }),
3478
+ /* @__PURE__ */ jsx50(ErrorMessage, { id: errorMessageId, errorMessage })
3479
+ ] })
3480
+ }
3481
+ );
3482
+ });
3483
+ RadioGroup.displayName = "RadioGroup";
3484
+
3485
+ // src/components/Segment/SegmentGroup.tsx
3486
+ import classNames42 from "classnames/dedupe";
3487
+ import { jsx as jsx51 } from "react/jsx-runtime";
3488
+ var SegmentGroup = (props) => {
3489
+ const { children, horizontal, gap, className, ...rest } = props;
3490
+ const gapClass = gap ? `gap-${gap}` : "";
3491
+ const classes = classNames42(
3492
+ "mobius",
3493
+ "mobius-segment-group",
3494
+ className,
3495
+ { "--is-horizontal": horizontal },
3496
+ gapClass
3497
+ );
3498
+ return /* @__PURE__ */ jsx51("div", { className: classes, ...rest, children });
3499
+ };
3500
+ SegmentGroup.displayName = "SegmentGroup";
3501
+
3502
+ // src/components/Segment/Segment.tsx
3503
+ import classNames43 from "classnames/dedupe";
3504
+ import { jsx as jsx52, jsxs as jsxs25 } from "react/jsx-runtime";
3505
+ var Segment = (props) => {
3506
+ const { heading, children, colour, inverted, className, ...rest } = props;
3507
+ const classes = classNames43(
3508
+ "mobius",
3509
+ "mobius-segment",
3510
+ colour,
3511
+ { inverted },
3512
+ className
3513
+ );
3514
+ return /* @__PURE__ */ jsxs25("div", { className: classes, ...rest, children: [
3515
+ heading && /* @__PURE__ */ jsx52("div", { className: "mobius-segment__heading", children: heading }),
3516
+ children
3517
+ ] });
3518
+ };
3519
+ Segment.displayName = "Segment";
3520
+
3521
+ // src/components/Select/Select.tsx
3522
+ import classNames44 from "classnames/dedupe";
3523
+ import { forwardRef as forwardRef40, useId as useId10 } from "react";
3524
+ import { chevronDown as chevronDown2 } from "@simplybusiness/icons";
3525
+ import { jsx as jsx53, jsxs as jsxs26 } from "react/jsx-runtime";
3526
+ var Select = forwardRef40((props, ref) => {
3527
+ const {
3528
+ label,
3529
+ onChange,
3530
+ validationState,
3531
+ isInvalid,
3532
+ errorMessage,
3533
+ isDisabled = false,
3534
+ isRequired,
3535
+ ...otherProps
3536
+ } = props;
3537
+ const { labelProps, fieldProps } = useLabel({
3538
+ label,
3539
+ ...otherProps
3540
+ });
3541
+ const validationClasses = useValidationClasses({
3542
+ validationState,
3543
+ isInvalid
3544
+ });
3545
+ const stateClasses = {
3546
+ "--is-disabled": isDisabled,
3547
+ "--is-required": typeof isRequired === "boolean" && isRequired,
3548
+ "--is-optional": typeof isRequired === "boolean" && !isRequired
3549
+ };
3550
+ const sharedClasses = classNames44(validationClasses, stateClasses);
3551
+ const wrapperClasses = classNames44(
3552
+ "mobius-select__wrapper",
3553
+ sharedClasses,
3554
+ otherProps.className
3555
+ );
3556
+ const selectClasses = classNames44(
3557
+ "mobius-select",
3558
+ sharedClasses,
3559
+ otherProps.className
3560
+ );
3561
+ const labelClasses = classNames44(
3562
+ "mobius-label",
3563
+ sharedClasses,
3564
+ otherProps.className
3565
+ );
3566
+ const iconClasses = classNames44("mobius-select__icon", sharedClasses);
3567
+ const errorMessageId = useId10();
3568
+ const shouldErrorMessageShow = errorMessage ? errorMessageId : void 0;
3569
+ const describedBy = spaceDelimitedList([
3570
+ shouldErrorMessageShow,
3571
+ props["aria-describedby"]
3572
+ ]);
3573
+ const handleChange = (e) => {
3574
+ if (onChange) {
3575
+ onChange(e);
3576
+ }
3577
+ };
3578
+ return /* @__PURE__ */ jsxs26(Stack, { className: "mobius mobius-select__outer", gap: "xs", children: [
3579
+ label && /* @__PURE__ */ jsx53(Label, { ...labelProps, className: labelClasses, children: label }),
3580
+ /* @__PURE__ */ jsxs26("div", { className: wrapperClasses, children: [
3581
+ /* @__PURE__ */ jsx53(
3582
+ "select",
3583
+ {
3584
+ ...otherProps,
3585
+ ...fieldProps,
3586
+ ref,
3587
+ multiple: false,
3588
+ className: selectClasses,
3589
+ disabled: isDisabled,
3590
+ "aria-invalid": !!errorMessage,
3591
+ "aria-describedby": describedBy,
3592
+ "aria-required": isRequired,
3593
+ onChange: handleChange
3594
+ }
3595
+ ),
3596
+ /* @__PURE__ */ jsx53("span", { className: iconClasses, children: /* @__PURE__ */ jsx53(Icon, { icon: chevronDown2 }) })
3597
+ ] }),
3598
+ errorMessage && /* @__PURE__ */ jsx53(ErrorMessage, { id: errorMessageId, errorMessage })
3599
+ ] });
3600
+ });
3601
+ Select.displayName = "Select";
3602
+
3603
+ // src/components/Slider/Slider.tsx
3604
+ import classNames45 from "classnames/dedupe";
3605
+ import { useRef as useRef13, useState as useState20 } from "react";
3606
+
3607
+ // src/components/Slider/helpers.ts
3608
+ import { useCallback as useCallback5, useMemo as useMemo3 } from "react";
3609
+ function numberFormatter(value, formatOptions, locale = navigator.languages?.[0] || "en-GB") {
3610
+ if (!formatOptions) {
3611
+ return value?.toString() || "";
3612
+ }
3613
+ return new Intl.NumberFormat(locale, formatOptions).format(+(value || 0));
3614
+ }
3615
+
3616
+ // src/components/Slider/Slider.tsx
3617
+ import { jsx as jsx54, jsxs as jsxs27 } from "react/jsx-runtime";
3618
+ var Slider = (props) => {
3619
+ const {
3620
+ id,
3621
+ className,
3622
+ label,
3623
+ "aria-label": ariaLabel,
3624
+ "aria-labelledby": ariaLabelledBy,
3625
+ minValue,
3626
+ maxValue,
3627
+ step = 1,
3628
+ defaultValue = 0,
3629
+ value,
3630
+ onChange,
3631
+ onChangeEnd,
3632
+ variant = "primary",
3633
+ minLabel,
3634
+ maxLabel,
3635
+ formatOptions,
3636
+ isDisabled = false
3637
+ } = props;
3638
+ const trackRef = useRef13(null);
3639
+ const [currentValue, setCurrentValue] = useState20(
3640
+ value || defaultValue || 0
3641
+ );
3642
+ const [isDragging, setIsDraggging] = useState20(false);
3643
+ const { labelProps, fieldProps } = useLabel({
3644
+ id,
3645
+ label,
3646
+ "aria-label": ariaLabel,
3647
+ "aria-labelledby": ariaLabelledBy
3648
+ });
3649
+ const formattedValue = numberFormatter(currentValue, formatOptions);
3650
+ const classes = classNames45("mobius", "mobius-slider", className, {
3651
+ "--is-disabled": isDisabled,
3652
+ "--is-primary": variant === "primary",
3653
+ "--is-secondary": variant === "secondary",
3654
+ "--is-dragging": isDragging
3655
+ });
3656
+ const handleChange = (e) => {
3657
+ const val = +e.target.value;
3658
+ setCurrentValue(val);
3659
+ if (onChange) {
3660
+ onChange(val);
3661
+ }
3662
+ };
3663
+ const handleChangeStart = () => {
3664
+ setIsDraggging(true);
3665
+ };
3666
+ const handleChangeEnd = () => {
3667
+ setIsDraggging(false);
3668
+ if (onChangeEnd) {
3669
+ onChangeEnd(currentValue);
3670
+ }
3671
+ };
3672
+ return /* @__PURE__ */ jsxs27("div", { className: classes, children: [
3673
+ /* @__PURE__ */ jsxs27("div", { className: "mobius-slider__label-wrapper", children: [
3674
+ label && /* @__PURE__ */ jsx54(Label, { ...labelProps, children: label }),
3675
+ label && /* @__PURE__ */ jsx54("output", { style: { flex: "1 0 auto", textAlign: "end" }, children: formattedValue })
3676
+ ] }),
3677
+ /* @__PURE__ */ jsx54("div", { ref: trackRef, className: "mobius-slider__track-wrapper", children: /* @__PURE__ */ jsx54(
3678
+ "input",
3679
+ {
3680
+ className: "mobius-slider__track",
3681
+ type: "range",
3682
+ min: minValue,
3683
+ max: maxValue,
3684
+ value: currentValue,
3685
+ step,
3686
+ onChange: handleChange,
3687
+ autoComplete: "off",
3688
+ disabled: isDisabled,
3689
+ onMouseDown: handleChangeStart,
3690
+ onMouseUp: handleChangeEnd,
3691
+ onKeyDown: handleChangeStart,
3692
+ onKeyUp: handleChangeEnd,
3693
+ ...fieldProps
3694
+ }
3695
+ ) }),
3696
+ /* @__PURE__ */ jsxs27("div", { className: "mobius-slider__labels", children: [
3697
+ /* @__PURE__ */ jsx54("div", { className: "mobius-slider__min-label", "data-testid": "min-label", children: minLabel }),
3698
+ /* @__PURE__ */ jsx54("div", { className: "mobius-slider__max-label", "data-testid": "max-label", children: maxLabel })
3699
+ ] })
3700
+ ] });
3701
+ };
3702
+
3703
+ // src/components/SVG/SVG.tsx
3704
+ import { forwardRef as forwardRef41, Children as Children8 } from "react";
3705
+ import classNames46 from "classnames/dedupe";
3706
+ import { jsx as jsx55 } from "react/jsx-runtime";
3707
+ var SVG = forwardRef41(
3708
+ (props, ref) => {
3709
+ const { children, className, ...otherProps } = props;
3710
+ const classes = classNames46("mobius", "mobius-svg", className);
3711
+ const svgNode = Children8.only(children);
3712
+ const { children: svgChildren, viewBox, xmlns } = svgNode.props;
3713
+ return /* @__PURE__ */ jsx55(
3714
+ "svg",
3715
+ {
3716
+ viewBox,
3717
+ xmlns,
3718
+ ref,
3719
+ ...otherProps,
3720
+ className: classes,
3721
+ children: svgChildren
3722
+ }
3723
+ );
3724
+ }
3725
+ );
3726
+ SVG.displayName = "SVG";
3727
+
3728
+ // src/components/Switch/Switch.tsx
3729
+ import {
3730
+ forwardRef as forwardRef42,
3731
+ useState as useState21,
3732
+ useEffect as useEffect19
3733
+ } from "react";
3734
+ import classNames47 from "classnames/dedupe";
3735
+ import { jsx as jsx56, jsxs as jsxs28 } from "react/jsx-runtime";
3736
+ var Switch = forwardRef42((props, ref) => {
3737
+ const {
3738
+ checked = false,
3739
+ className,
3740
+ onChange,
3741
+ isDisabled = false,
3742
+ ...otherProps
3743
+ } = props;
3744
+ const [enabled, setEnabled] = useState21(checked);
3745
+ useEffect19(() => {
3746
+ setEnabled(checked);
3747
+ }, [checked]);
3748
+ const classes = classNames47(
3749
+ "mobius",
3750
+ "mobius-switch",
3751
+ {
3752
+ "mobius-switch--checked": enabled,
3753
+ "mobius-switch--disabled": isDisabled
3754
+ },
3755
+ className
3756
+ );
3757
+ const handleChange = (event) => {
3758
+ setEnabled(!enabled);
3759
+ if (onChange) {
3760
+ onChange(event);
3761
+ }
3762
+ };
3763
+ return /* @__PURE__ */ jsxs28("label", { ref, className: classes, children: [
3764
+ /* @__PURE__ */ jsx56(VisuallyHidden, { children: /* @__PURE__ */ jsx56("span", { children: enabled ? "On" : "Off" }) }),
3765
+ /* @__PURE__ */ jsx56(
3766
+ "input",
3767
+ {
3768
+ type: "checkbox",
3769
+ role: "switch",
3770
+ checked: enabled,
3771
+ onChange: handleChange,
3772
+ disabled: isDisabled,
3773
+ ...otherProps
3774
+ }
3775
+ ),
3776
+ /* @__PURE__ */ jsx56("span", { className: "mobius-switch__slider" })
3777
+ ] });
3778
+ });
3779
+ Switch.displayName = "Switch";
3780
+
3781
+ // src/components/Table/Table.tsx
3782
+ import { forwardRef as forwardRef43 } from "react";
3783
+ import classNames48 from "classnames/dedupe";
3784
+ import { jsx as jsx57 } from "react/jsx-runtime";
3785
+ var Table = forwardRef43(
3786
+ (props, ref) => {
3787
+ const classes = classNames48("mobius", "mobius-table", props.className);
3788
+ return /* @__PURE__ */ jsx57("table", { ref, ...props, className: classes });
3789
+ }
3790
+ );
3791
+ Table.displayName = "Table";
3792
+
3793
+ // src/components/Table/Head.tsx
3794
+ import { forwardRef as forwardRef44 } from "react";
3795
+ import classNames49 from "classnames/dedupe";
3796
+ import { jsx as jsx58 } from "react/jsx-runtime";
3797
+ var Head = forwardRef44((props, ref) => {
3798
+ const classes = classNames49("mobius", "mobius-table__head", props.className);
3799
+ return /* @__PURE__ */ jsx58("thead", { ref, ...props, className: classes });
3800
+ });
3801
+ Head.displayName = "Table.Head";
3802
+
3803
+ // src/components/Table/Body.tsx
3804
+ import { forwardRef as forwardRef45 } from "react";
3805
+ import classNames50 from "classnames/dedupe";
3806
+ import { jsx as jsx59 } from "react/jsx-runtime";
3807
+ var Body = forwardRef45((props, ref) => {
3808
+ const classes = classNames50("mobius", "mobius-table__body", props.className);
3809
+ return /* @__PURE__ */ jsx59("tbody", { ref, ...props, className: classes });
3810
+ });
3811
+ Body.displayName = "Table.Body";
3812
+
3813
+ // src/components/Table/Foot.tsx
3814
+ import { forwardRef as forwardRef46 } from "react";
3815
+ import classNames51 from "classnames/dedupe";
3816
+ import { jsx as jsx60 } from "react/jsx-runtime";
3817
+ var Foot = forwardRef46((props, ref) => {
3818
+ const classes = classNames51("mobius", "mobius-table__foot", props.className);
3819
+ return /* @__PURE__ */ jsx60("tfoot", { ref, ...props, className: classes });
3820
+ });
3821
+ Foot.displayName = "Table.Foot";
3822
+
3823
+ // src/components/Table/Row.tsx
3824
+ import { forwardRef as forwardRef47 } from "react";
3825
+ import classNames52 from "classnames/dedupe";
3826
+ import { jsx as jsx61 } from "react/jsx-runtime";
3827
+ var Row = forwardRef47(
3828
+ (props, ref) => {
3829
+ const classes = classNames52("mobius", "mobius-table__row", props.className);
3830
+ return /* @__PURE__ */ jsx61("tr", { ref, ...props, className: classes });
3831
+ }
3832
+ );
3833
+ Row.displayName = "Table.Row";
3834
+
3835
+ // src/components/Table/HeaderCell.tsx
3836
+ import { forwardRef as forwardRef48 } from "react";
3837
+ import classNames53 from "classnames/dedupe";
3838
+ import { jsx as jsx62 } from "react/jsx-runtime";
3839
+ var HeaderCell = forwardRef48((props, ref) => {
3840
+ const classes = classNames53(
3841
+ "mobius",
3842
+ "mobius-table__head-cell",
3843
+ props.className
3844
+ );
3845
+ return /* @__PURE__ */ jsx62("th", { ...props, ref, className: classes });
3846
+ });
3847
+ HeaderCell.displayName = "Table.HeaderCell";
3848
+
3849
+ // src/components/Table/Cell.tsx
3850
+ import { forwardRef as forwardRef49 } from "react";
3851
+ import classNames54 from "classnames/dedupe";
3852
+ import { jsx as jsx63 } from "react/jsx-runtime";
3853
+ var Cell = forwardRef49(
3854
+ (props, ref) => {
3855
+ const classes = classNames54(
3856
+ "mobius",
3857
+ "mobius-table__body-cell",
3858
+ props.className
3859
+ );
3860
+ return /* @__PURE__ */ jsx63("td", { ref, ...props, className: classes });
3861
+ }
3862
+ );
3863
+ Cell.displayName = "Table.Cell";
3864
+
3865
+ // src/components/Table/index.tsx
3866
+ var Table2 = Object.assign(Table, {
3867
+ Head,
3868
+ Body,
3869
+ Foot,
3870
+ Row,
3871
+ HeaderCell,
3872
+ Cell
3873
+ });
3874
+ Table2.displayName = "Table";
3875
+
3876
+ // src/components/TextArea/TextArea.tsx
3877
+ import classNames56 from "classnames/dedupe";
3878
+ import { forwardRef as forwardRef51 } from "react";
3879
+
3880
+ // src/components/TextAreaInput/TextAreaInput.tsx
3881
+ import classNames55 from "classnames/dedupe";
3882
+ import { forwardRef as forwardRef50 } from "react";
3883
+ import { jsx as jsx64 } from "react/jsx-runtime";
3884
+ var TextAreaInput = forwardRef50((props, ref) => {
3885
+ const { isSelected, isDisabled, isReadOnly, isRequired, ...otherProps } = props;
3886
+ const classes = classNames55(
3887
+ "mobius",
3888
+ "mobius-text-area__input",
3889
+ {
3890
+ "--is-disabled": isDisabled,
3891
+ "--is-selected": isSelected,
3892
+ "--is-required": isRequired
3893
+ },
3894
+ otherProps.className
3895
+ );
3896
+ return /* @__PURE__ */ jsx64(
3897
+ "textarea",
3898
+ {
3899
+ ref,
3900
+ ...otherProps,
3901
+ required: isRequired,
3902
+ readOnly: isReadOnly,
3903
+ className: classes
3904
+ }
3905
+ );
3906
+ });
3907
+ TextAreaInput.displayName = "TextAreaInput";
3908
+
3909
+ // src/components/TextArea/TextArea.tsx
3910
+ import { jsx as jsx65, jsxs as jsxs29 } from "react/jsx-runtime";
3911
+ var TextArea = forwardRef51((props, ref) => {
3912
+ const {
3913
+ isDisabled,
3914
+ className,
3915
+ errorMessage,
3916
+ label,
3917
+ validationState,
3918
+ isInvalid,
3919
+ ...otherProps
3920
+ } = props;
3921
+ const { inputProps, labelProps, errorMessageProps } = useTextField(props);
3922
+ const classes = classNames56("mobius", "mobius-text-area", className);
3923
+ const validationClasses = useValidationClasses({
3924
+ validationState,
3925
+ isInvalid
3926
+ });
3927
+ const inputClasses = classNames56(
3928
+ "mobius-text-area__input",
3929
+ validationClasses
3930
+ );
3931
+ const labelClasses = classNames56(
3932
+ {
3933
+ "--is-disabled": isDisabled
3934
+ },
3935
+ validationClasses
3936
+ );
3937
+ return /* @__PURE__ */ jsxs29(Stack, { className: classes, gap: "xs", children: [
3938
+ label && /* @__PURE__ */ jsx65(Label, { ...labelProps, className: labelClasses, children: props.label }),
3939
+ /* @__PURE__ */ jsx65(
3940
+ TextAreaInput,
3941
+ {
3942
+ ...otherProps,
3943
+ ...inputProps,
3944
+ ref,
3945
+ className: inputClasses,
3946
+ isDisabled,
3947
+ "aria-invalid": errorMessage != null
3948
+ }
3949
+ ),
3950
+ /* @__PURE__ */ jsx65(ErrorMessage, { ...errorMessageProps, errorMessage })
3951
+ ] });
3952
+ });
3953
+ TextArea.displayName = "TextArea";
3954
+
3955
+ // src/components/Title/Title.tsx
3956
+ import { forwardRef as forwardRef52 } from "react";
3957
+ import classNames57 from "classnames/dedupe";
3958
+ import { jsx as jsx66, jsxs as jsxs30 } from "react/jsx-runtime";
3959
+ var Title = forwardRef52(
3960
+ (props, ref) => {
3961
+ const {
3962
+ elementType: Element = "div",
3963
+ title,
3964
+ description,
3965
+ ...otherProps
3966
+ } = props;
3967
+ const classes = classNames57("mobius", "mobius-title", otherProps.className);
3968
+ const headerClasses = classNames57("mobius", "mobius-title__header");
3969
+ const contentClasses = classNames57("mobius", "mobius-title__description");
3970
+ const containerClasses = classNames57("mobius", "mobius-title__container");
3971
+ return /* @__PURE__ */ jsx66(Element, { ref, ...otherProps, className: classes, children: /* @__PURE__ */ jsxs30(Flex, { flexDirection: "column", className: containerClasses, children: [
3972
+ /* @__PURE__ */ jsx66("p", { className: headerClasses, children: title }),
3973
+ /* @__PURE__ */ jsx66("p", { className: contentClasses, children: description })
3974
+ ] }) });
3975
+ }
3976
+ );
3977
+ Title.displayName = "Title";
3978
+
3979
+ // src/components/Trust/Trust.tsx
3980
+ import classNames58 from "classnames/dedupe";
3981
+ import { forwardRef as forwardRef53, useEffect as useEffect20, useRef as useRef14, useState as useState22 } from "react";
3982
+
3983
+ // src/components/Trust/constants.ts
3984
+ var REQUIRED_TRUSTPILOT_CLASS_NAME = "trustpilot-widget";
3985
+ var SIMPLYBUSINESS_UNIT_ID = "5ca35a3da72b330001954cef";
3986
+ var TRUSTPILOT_LINKS = {
3987
+ "en-US": "https://www.trustpilot.com/review/simplybusiness.com",
3988
+ "en-GB": "https://www.trustpilot.com/review/simplybusiness.co.uk"
3989
+ };
3990
+ var TRUSTPILOT_TEMPLATE_IDS = {
3991
+ "micro-combo": "5419b6ffb0d04a076446a9af",
3992
+ mini: "53aa8807dec7e10d38f59f32",
3993
+ carousel: "53aa8912dec7e10d38f59f36",
3994
+ horizontal: "5406e65db0d04a09e042d5fc"
3995
+ };
3996
+ var TRUSTPILOT_WIDGET = {
3997
+ // Keys based on actual widget names
3998
+ // https://support.trustpilot.com/hc/en-us/articles/360019826379-TrustBox-widget-overview
3999
+ "micro-combo": {
4000
+ templateId: TRUSTPILOT_TEMPLATE_IDS["micro-combo"],
4001
+ className: "--is-variant-micro-combo",
4002
+ styles: {
4003
+ height: "25px"
4004
+ }
4005
+ },
4006
+ mini: {
4007
+ templateId: TRUSTPILOT_TEMPLATE_IDS["mini"],
4008
+ className: "--is-variant-mini",
4009
+ styles: {
4010
+ width: "300px",
4011
+ height: "150px"
4012
+ }
4013
+ },
4014
+ carousel: {
4015
+ templateId: TRUSTPILOT_TEMPLATE_IDS["carousel"],
4016
+ className: "--is-variant-carousel",
4017
+ styles: {
4018
+ height: "150px"
4019
+ }
4020
+ },
4021
+ horizontal: {
4022
+ templateId: TRUSTPILOT_TEMPLATE_IDS["horizontal"],
4023
+ className: "--is-variant-horizontal",
4024
+ styles: {
4025
+ height: "28px"
4026
+ }
4027
+ }
4028
+ };
4029
+
4030
+ // src/components/Trust/Trust.tsx
4031
+ import { jsx as jsx67 } from "react/jsx-runtime";
4032
+ var Trust = forwardRef53((props, ref) => {
4033
+ const {
4034
+ elementType: Element = "div",
4035
+ variant,
4036
+ theme,
4037
+ locale,
4038
+ height,
4039
+ width,
4040
+ stars,
4041
+ className
4042
+ } = props;
4043
+ const [isMounted, setIsMounted] = useState22(false);
4044
+ const trustRef = useRef14(null);
4045
+ const {
4046
+ templateId,
4047
+ className: variantClassName,
4048
+ styles
4049
+ } = TRUSTPILOT_WIDGET[variant];
4050
+ const link = TRUSTPILOT_LINKS[locale];
4051
+ const dataProps = {
4052
+ "data-businessunit-id": SIMPLYBUSINESS_UNIT_ID,
4053
+ "data-locale": locale,
4054
+ "data-template-id": templateId,
4055
+ "data-theme": theme,
4056
+ "data-style-width": width || "100%",
4057
+ "data-style-height": height,
4058
+ "data-stars": stars
4059
+ };
4060
+ const classes = classNames58(
4061
+ "mobius",
4062
+ "mobius-trust",
4063
+ REQUIRED_TRUSTPILOT_CLASS_NAME,
4064
+ {
4065
+ [`--is-${theme}`]: theme,
4066
+ [variantClassName]: variant
4067
+ },
4068
+ className
4069
+ );
4070
+ useEffect20(() => {
4071
+ const hasTrustpilotLoaded = trustRef.current && window?.Trustpilot && window?.Trustpilot.loadFromElement;
4072
+ if (isMounted && hasTrustpilotLoaded) {
4073
+ window.Trustpilot.loadFromElement(trustRef.current, true);
4074
+ }
4075
+ }, [isMounted]);
4076
+ useEffect20(() => {
4077
+ setIsMounted(true);
4078
+ }, []);
4079
+ if (!isMounted) return /* @__PURE__ */ jsx67("div", { style: styles });
4080
+ return /* @__PURE__ */ jsx67(
4081
+ Element,
4082
+ {
4083
+ ref: mergeRefs([trustRef, ref]),
4084
+ className: classes,
4085
+ style: styles,
4086
+ ...dataProps,
4087
+ children: /* @__PURE__ */ jsx67(
4088
+ "a",
4089
+ {
4090
+ href: link,
4091
+ target: "_blank",
4092
+ rel: "noopener noreferrer",
4093
+ className: "mobius-trust__link",
4094
+ children: "Trustpilot"
4095
+ }
4096
+ )
4097
+ }
4098
+ );
4099
+ });
4100
+ export {
4101
+ Accordion,
4102
+ AddressLookup,
4103
+ Alert,
4104
+ Box,
4105
+ BreadcrumbItem,
4106
+ Breadcrumbs,
4107
+ Button,
4108
+ Checkbox,
4109
+ CheckboxGroup,
4110
+ Combobox,
4111
+ Container,
4112
+ DEFAULT_BREAKPOINTS,
4113
+ Divider,
4114
+ Drawer2 as Drawer,
4115
+ DropdownMenu2 as DropdownMenu,
4116
+ ErrorMessage,
4117
+ Fieldset,
4118
+ Flex,
4119
+ Grid2 as Grid,
4120
+ Icon,
4121
+ Image,
4122
+ Label,
4123
+ Link,
4124
+ LinkButton,
4125
+ List,
4126
+ ListItem,
4127
+ LoadingIndicator,
4128
+ Logo,
4129
+ LoqateAddressLookupService,
4130
+ Modal2 as Modal,
4131
+ NumberField,
4132
+ Option2 as Option,
4133
+ PasswordField,
4134
+ Popover,
4135
+ Progress,
4136
+ Radio,
4137
+ RadioGroup,
4138
+ SVG,
4139
+ Segment,
4140
+ SegmentGroup,
4141
+ Select,
4142
+ Slider,
4143
+ Stack,
4144
+ Switch,
4145
+ Table2 as Table,
4146
+ Text,
4147
+ TextArea,
4148
+ TextAreaInput,
4149
+ TextField,
4150
+ Title,
4151
+ Trust,
4152
+ VisuallyHidden,
4153
+ useBodyScrollLock,
4154
+ useBreakpoint,
4155
+ useButton,
4156
+ useDebouncedValue,
4157
+ useDeprecationWarning,
4158
+ useDialog,
4159
+ useDialogPolyfill,
4160
+ useDrawer,
4161
+ useLabel,
4162
+ useModal,
4163
+ useOnClickOutside,
4164
+ useOnUnmount,
4165
+ usePrefersReducedMotion,
4166
+ useRenderCount,
4167
+ useTextField,
4168
+ useValidationClasses,
4169
+ useWindowEvent
4170
+ };