@flipdish/ui-library 0.62.0 → 0.64.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 (428) hide show
  1. package/README.md +22 -21
  2. package/dist/components/__internal__/listOption/listOption.styles.cjs +20 -0
  3. package/dist/components/__internal__/listOption/listOption.styles.cjs.map +1 -0
  4. package/dist/components/__internal__/listOption/listOption.styles.d.ts +16 -0
  5. package/dist/components/__internal__/listOption/listOption.styles.d.ts.map +1 -0
  6. package/dist/components/__internal__/listOption/listOption.styles.js +18 -0
  7. package/dist/components/__internal__/listOption/listOption.styles.js.map +1 -0
  8. package/dist/components/atoms/BackgroundPattern/components/Circle.cjs +17 -12
  9. package/dist/components/atoms/BackgroundPattern/components/Circle.cjs.map +1 -1
  10. package/dist/components/atoms/BackgroundPattern/components/Circle.d.ts +3 -3
  11. package/dist/components/atoms/BackgroundPattern/components/Circle.d.ts.map +1 -1
  12. package/dist/components/atoms/BackgroundPattern/components/Circle.js +17 -12
  13. package/dist/components/atoms/BackgroundPattern/components/Circle.js.map +1 -1
  14. package/dist/components/atoms/BackgroundPattern/components/Grid.cjs +17 -12
  15. package/dist/components/atoms/BackgroundPattern/components/Grid.cjs.map +1 -1
  16. package/dist/components/atoms/BackgroundPattern/components/Grid.d.ts +3 -3
  17. package/dist/components/atoms/BackgroundPattern/components/Grid.d.ts.map +1 -1
  18. package/dist/components/atoms/BackgroundPattern/components/Grid.js +17 -12
  19. package/dist/components/atoms/BackgroundPattern/components/Grid.js.map +1 -1
  20. package/dist/components/atoms/BackgroundPattern/components/GridCheck.cjs +13 -8
  21. package/dist/components/atoms/BackgroundPattern/components/GridCheck.cjs.map +1 -1
  22. package/dist/components/atoms/BackgroundPattern/components/GridCheck.d.ts +3 -3
  23. package/dist/components/atoms/BackgroundPattern/components/GridCheck.d.ts.map +1 -1
  24. package/dist/components/atoms/BackgroundPattern/components/GridCheck.js +13 -8
  25. package/dist/components/atoms/BackgroundPattern/components/GridCheck.js.map +1 -1
  26. package/dist/components/atoms/BackgroundPattern/components/Square.cjs +17 -12
  27. package/dist/components/atoms/BackgroundPattern/components/Square.cjs.map +1 -1
  28. package/dist/components/atoms/BackgroundPattern/components/Square.d.ts +3 -3
  29. package/dist/components/atoms/BackgroundPattern/components/Square.d.ts.map +1 -1
  30. package/dist/components/atoms/BackgroundPattern/components/Square.js +17 -12
  31. package/dist/components/atoms/BackgroundPattern/components/Square.js.map +1 -1
  32. package/dist/components/atoms/BackgroundPattern/index.cjs +5 -3
  33. package/dist/components/atoms/BackgroundPattern/index.cjs.map +1 -1
  34. package/dist/components/atoms/BackgroundPattern/index.d.ts +11 -11
  35. package/dist/components/atoms/BackgroundPattern/index.d.ts.map +1 -1
  36. package/dist/components/atoms/BackgroundPattern/index.js +5 -3
  37. package/dist/components/atoms/BackgroundPattern/index.js.map +1 -1
  38. package/dist/components/atoms/BrandButtons/SocialButton/SocialButton.cjs +7 -3
  39. package/dist/components/atoms/BrandButtons/SocialButton/SocialButton.cjs.map +1 -1
  40. package/dist/components/atoms/BrandButtons/SocialButton/SocialButton.d.ts +4 -4
  41. package/dist/components/atoms/BrandButtons/SocialButton/SocialButton.d.ts.map +1 -1
  42. package/dist/components/atoms/BrandButtons/SocialButton/SocialButton.js +7 -3
  43. package/dist/components/atoms/BrandButtons/SocialButton/SocialButton.js.map +1 -1
  44. package/dist/components/atoms/Buttons/IconButton/IconButton.cjs +6 -3
  45. package/dist/components/atoms/Buttons/IconButton/IconButton.cjs.map +1 -1
  46. package/dist/components/atoms/Buttons/IconButton/IconButton.d.ts +4 -4
  47. package/dist/components/atoms/Buttons/IconButton/IconButton.d.ts.map +1 -1
  48. package/dist/components/atoms/Buttons/IconButton/IconButton.js +7 -4
  49. package/dist/components/atoms/Buttons/IconButton/IconButton.js.map +1 -1
  50. package/dist/components/atoms/Card/index.cjs +5 -3
  51. package/dist/components/atoms/Card/index.cjs.map +1 -1
  52. package/dist/components/atoms/Card/index.d.ts +3 -3
  53. package/dist/components/atoms/Card/index.d.ts.map +1 -1
  54. package/dist/components/atoms/Card/index.js +5 -3
  55. package/dist/components/atoms/Card/index.js.map +1 -1
  56. package/dist/components/atoms/Checkbox/index.d.ts +1 -4
  57. package/dist/components/atoms/Checkbox/index.d.ts.map +1 -1
  58. package/dist/components/atoms/Checkboxes/Checkbox/Checkbox.cjs +3 -3
  59. package/dist/components/atoms/Checkboxes/Checkbox/Checkbox.cjs.map +1 -1
  60. package/dist/components/atoms/Checkboxes/Checkbox/Checkbox.d.ts +2 -7
  61. package/dist/components/atoms/Checkboxes/Checkbox/Checkbox.d.ts.map +1 -1
  62. package/dist/components/atoms/Checkboxes/Checkbox/Checkbox.js +4 -4
  63. package/dist/components/atoms/Checkboxes/Checkbox/Checkbox.js.map +1 -1
  64. package/dist/components/atoms/Dot/index.cjs +5 -3
  65. package/dist/components/atoms/Dot/index.cjs.map +1 -1
  66. package/dist/components/atoms/Dot/index.d.ts +3 -3
  67. package/dist/components/atoms/Dot/index.d.ts.map +1 -1
  68. package/dist/components/atoms/Dot/index.js +5 -3
  69. package/dist/components/atoms/Dot/index.js.map +1 -1
  70. package/dist/components/atoms/FeaturedIcon/index.cjs +4 -3
  71. package/dist/components/atoms/FeaturedIcon/index.cjs.map +1 -1
  72. package/dist/components/atoms/FeaturedIcon/index.d.ts +2 -4
  73. package/dist/components/atoms/FeaturedIcon/index.d.ts.map +1 -1
  74. package/dist/components/atoms/FeaturedIcon/index.js +5 -4
  75. package/dist/components/atoms/FeaturedIcon/index.js.map +1 -1
  76. package/dist/components/atoms/Flag/index.cjs +10 -6
  77. package/dist/components/atoms/Flag/index.cjs.map +1 -1
  78. package/dist/components/atoms/Flag/index.d.ts +3 -3
  79. package/dist/components/atoms/Flag/index.d.ts.map +1 -1
  80. package/dist/components/atoms/Flag/index.js +12 -8
  81. package/dist/components/atoms/Flag/index.js.map +1 -1
  82. package/dist/components/atoms/FlipdishLogo/index.cjs +5 -3
  83. package/dist/components/atoms/FlipdishLogo/index.cjs.map +1 -1
  84. package/dist/components/atoms/FlipdishLogo/index.d.ts +3 -3
  85. package/dist/components/atoms/FlipdishLogo/index.d.ts.map +1 -1
  86. package/dist/components/atoms/FlipdishLogo/index.js +5 -3
  87. package/dist/components/atoms/FlipdishLogo/index.js.map +1 -1
  88. package/dist/components/atoms/Illustration/components/TextIllustration.cjs +7 -4
  89. package/dist/components/atoms/Illustration/components/TextIllustration.cjs.map +1 -1
  90. package/dist/components/atoms/Illustration/components/TextIllustration.d.ts +2 -3
  91. package/dist/components/atoms/Illustration/components/TextIllustration.d.ts.map +1 -1
  92. package/dist/components/atoms/Illustration/components/TextIllustration.js +7 -4
  93. package/dist/components/atoms/Illustration/components/TextIllustration.js.map +1 -1
  94. package/dist/components/atoms/Input/index.d.ts +2 -8
  95. package/dist/components/atoms/Input/index.d.ts.map +1 -1
  96. package/dist/components/atoms/Inputs/Input/Input.cjs +4 -4
  97. package/dist/components/atoms/Inputs/Input/Input.cjs.map +1 -1
  98. package/dist/components/atoms/Inputs/Input/Input.d.ts +3 -11
  99. package/dist/components/atoms/Inputs/Input/Input.d.ts.map +1 -1
  100. package/dist/components/atoms/Inputs/Input/Input.js +6 -6
  101. package/dist/components/atoms/Inputs/Input/Input.js.map +1 -1
  102. package/dist/components/atoms/Inputs/SearchInput/SearchInput.cjs +3 -2
  103. package/dist/components/atoms/Inputs/SearchInput/SearchInput.cjs.map +1 -1
  104. package/dist/components/atoms/Inputs/SearchInput/SearchInput.d.ts +2 -7
  105. package/dist/components/atoms/Inputs/SearchInput/SearchInput.d.ts.map +1 -1
  106. package/dist/components/atoms/Inputs/SearchInput/SearchInput.js +3 -2
  107. package/dist/components/atoms/Inputs/SearchInput/SearchInput.js.map +1 -1
  108. package/dist/components/atoms/Inputs/TextArea/TextArea.cjs +7 -6
  109. package/dist/components/atoms/Inputs/TextArea/TextArea.cjs.map +1 -1
  110. package/dist/components/atoms/Inputs/TextArea/TextArea.d.ts +4 -13
  111. package/dist/components/atoms/Inputs/TextArea/TextArea.d.ts.map +1 -1
  112. package/dist/components/atoms/Inputs/TextArea/TextArea.js +8 -7
  113. package/dist/components/atoms/Inputs/TextArea/TextArea.js.map +1 -1
  114. package/dist/components/atoms/Inputs/TimeInput/TimeInput.cjs +5 -5
  115. package/dist/components/atoms/Inputs/TimeInput/TimeInput.cjs.map +1 -1
  116. package/dist/components/atoms/Inputs/TimeInput/TimeInput.d.ts +2 -7
  117. package/dist/components/atoms/Inputs/TimeInput/TimeInput.d.ts.map +1 -1
  118. package/dist/components/atoms/Inputs/TimeInput/TimeInput.js +6 -6
  119. package/dist/components/atoms/Inputs/TimeInput/TimeInput.js.map +1 -1
  120. package/dist/components/atoms/Inputs/components/HintText.cjs +4 -3
  121. package/dist/components/atoms/Inputs/components/HintText.cjs.map +1 -1
  122. package/dist/components/atoms/Inputs/components/HintText.d.ts +3 -8
  123. package/dist/components/atoms/Inputs/components/HintText.d.ts.map +1 -1
  124. package/dist/components/atoms/Inputs/components/HintText.js +4 -3
  125. package/dist/components/atoms/Inputs/components/HintText.js.map +1 -1
  126. package/dist/components/atoms/Inputs/components/Label.cjs +4 -3
  127. package/dist/components/atoms/Inputs/components/Label.cjs.map +1 -1
  128. package/dist/components/atoms/Inputs/components/Label.d.ts +3 -8
  129. package/dist/components/atoms/Inputs/components/Label.d.ts.map +1 -1
  130. package/dist/components/atoms/Inputs/components/Label.js +4 -3
  131. package/dist/components/atoms/Inputs/components/Label.js.map +1 -1
  132. package/dist/components/atoms/PhoneInput/components/PhoneInputCountrySelect.cjs +35 -0
  133. package/dist/components/atoms/PhoneInput/components/PhoneInputCountrySelect.cjs.map +1 -0
  134. package/dist/components/atoms/PhoneInput/components/PhoneInputCountrySelect.d.ts +24 -0
  135. package/dist/components/atoms/PhoneInput/components/PhoneInputCountrySelect.d.ts.map +1 -0
  136. package/dist/components/atoms/PhoneInput/components/PhoneInputCountrySelect.js +33 -0
  137. package/dist/components/atoms/PhoneInput/components/PhoneInputCountrySelect.js.map +1 -0
  138. package/dist/components/atoms/PhoneInput/hooks/usePhoneEntry.cjs +100 -0
  139. package/dist/components/atoms/PhoneInput/hooks/usePhoneEntry.cjs.map +1 -0
  140. package/dist/components/atoms/PhoneInput/hooks/usePhoneEntry.d.ts +35 -0
  141. package/dist/components/atoms/PhoneInput/hooks/usePhoneEntry.d.ts.map +1 -0
  142. package/dist/components/atoms/PhoneInput/hooks/usePhoneEntry.js +98 -0
  143. package/dist/components/atoms/PhoneInput/hooks/usePhoneEntry.js.map +1 -0
  144. package/dist/components/atoms/PhoneInput/index.cjs +79 -0
  145. package/dist/components/atoms/PhoneInput/index.cjs.map +1 -0
  146. package/dist/components/atoms/PhoneInput/index.d.ts +48 -0
  147. package/dist/components/atoms/PhoneInput/index.d.ts.map +1 -0
  148. package/dist/components/atoms/PhoneInput/index.js +77 -0
  149. package/dist/components/atoms/PhoneInput/index.js.map +1 -0
  150. package/dist/components/atoms/PhoneInput/phoneInput.types.d.ts +17 -0
  151. package/dist/components/atoms/PhoneInput/phoneInput.types.d.ts.map +1 -0
  152. package/dist/components/atoms/PhoneInput/utilities/phoneInput.utils.cjs +304 -0
  153. package/dist/components/atoms/PhoneInput/utilities/phoneInput.utils.cjs.map +1 -0
  154. package/dist/components/atoms/PhoneInput/utilities/phoneInput.utils.d.ts +147 -0
  155. package/dist/components/atoms/PhoneInput/utilities/phoneInput.utils.d.ts.map +1 -0
  156. package/dist/components/atoms/PhoneInput/utilities/phoneInput.utils.js +288 -0
  157. package/dist/components/atoms/PhoneInput/utilities/phoneInput.utils.js.map +1 -0
  158. package/dist/components/atoms/RadioButton/index.d.ts +1 -4
  159. package/dist/components/atoms/RadioButton/index.d.ts.map +1 -1
  160. package/dist/components/atoms/Radios/RadioButton/RadioButton.cjs +6 -4
  161. package/dist/components/atoms/Radios/RadioButton/RadioButton.cjs.map +1 -1
  162. package/dist/components/atoms/Radios/RadioButton/RadioButton.d.ts +2 -7
  163. package/dist/components/atoms/Radios/RadioButton/RadioButton.d.ts.map +1 -1
  164. package/dist/components/atoms/Radios/RadioButton/RadioButton.js +7 -5
  165. package/dist/components/atoms/Radios/RadioButton/RadioButton.js.map +1 -1
  166. package/dist/components/atoms/RatingStars/index.cjs +4 -3
  167. package/dist/components/atoms/RatingStars/index.cjs.map +1 -1
  168. package/dist/components/atoms/RatingStars/index.d.ts +3 -3
  169. package/dist/components/atoms/RatingStars/index.d.ts.map +1 -1
  170. package/dist/components/atoms/RatingStars/index.js +6 -5
  171. package/dist/components/atoms/RatingStars/index.js.map +1 -1
  172. package/dist/components/atoms/SearchInput/index.d.ts +1 -4
  173. package/dist/components/atoms/SearchInput/index.d.ts.map +1 -1
  174. package/dist/components/atoms/SocialButton/index.d.ts +1 -1
  175. package/dist/components/atoms/SocialButton/index.d.ts.map +1 -1
  176. package/dist/components/atoms/UtilityButton/index.cjs.map +1 -1
  177. package/dist/components/atoms/UtilityButton/index.d.ts +2 -2
  178. package/dist/components/atoms/UtilityButton/index.d.ts.map +1 -1
  179. package/dist/components/atoms/UtilityButton/index.js.map +1 -1
  180. package/dist/components/atoms/VerificationCodeInput/index.cjs +18 -18
  181. package/dist/components/atoms/VerificationCodeInput/index.cjs.map +1 -1
  182. package/dist/components/atoms/VerificationCodeInput/index.d.ts +10 -29
  183. package/dist/components/atoms/VerificationCodeInput/index.d.ts.map +1 -1
  184. package/dist/components/atoms/VerificationCodeInput/index.js +19 -19
  185. package/dist/components/atoms/VerificationCodeInput/index.js.map +1 -1
  186. package/dist/components/forms/Form/index.cjs +14 -11
  187. package/dist/components/forms/Form/index.cjs.map +1 -1
  188. package/dist/components/forms/Form/index.d.ts +9 -8
  189. package/dist/components/forms/Form/index.d.ts.map +1 -1
  190. package/dist/components/forms/Form/index.js +16 -13
  191. package/dist/components/forms/Form/index.js.map +1 -1
  192. package/dist/components/forms/__internal__/formField/hooks/useFocusThroughSubmit.cjs +10 -1
  193. package/dist/components/forms/__internal__/formField/hooks/useFocusThroughSubmit.cjs.map +1 -1
  194. package/dist/components/forms/__internal__/formField/hooks/useFocusThroughSubmit.d.ts.map +1 -1
  195. package/dist/components/forms/__internal__/formField/hooks/useFocusThroughSubmit.js +10 -1
  196. package/dist/components/forms/__internal__/formField/hooks/useFocusThroughSubmit.js.map +1 -1
  197. package/dist/components/forms/fields/FormPhoneInput/index.cjs +36 -0
  198. package/dist/components/forms/fields/FormPhoneInput/index.cjs.map +1 -0
  199. package/dist/components/forms/fields/FormPhoneInput/index.d.ts +19 -0
  200. package/dist/components/forms/fields/FormPhoneInput/index.d.ts.map +1 -0
  201. package/dist/components/forms/fields/FormPhoneInput/index.js +34 -0
  202. package/dist/components/forms/fields/FormPhoneInput/index.js.map +1 -0
  203. package/dist/components/forms/validation/index.cjs +25 -56
  204. package/dist/components/forms/validation/index.cjs.map +1 -1
  205. package/dist/components/forms/validation/index.d.ts +2 -12
  206. package/dist/components/forms/validation/index.d.ts.map +1 -1
  207. package/dist/components/forms/validation/index.js +1 -32
  208. package/dist/components/forms/validation/index.js.map +1 -1
  209. package/dist/components/forms/validation/phoneNumber/index.cjs +20 -0
  210. package/dist/components/forms/validation/phoneNumber/index.cjs.map +1 -0
  211. package/dist/components/forms/validation/phoneNumber/index.d.ts +14 -0
  212. package/dist/components/forms/validation/phoneNumber/index.d.ts.map +1 -0
  213. package/dist/components/forms/validation/phoneNumber/index.js +18 -0
  214. package/dist/components/forms/validation/phoneNumber/index.js.map +1 -0
  215. package/dist/components/forms/validation/utilities/validation.utils.cjs +34 -0
  216. package/dist/components/forms/validation/utilities/validation.utils.cjs.map +1 -1
  217. package/dist/components/forms/validation/utilities/validation.utils.d.ts +29 -1
  218. package/dist/components/forms/validation/utilities/validation.utils.d.ts.map +1 -1
  219. package/dist/components/forms/validation/utilities/validation.utils.js +33 -2
  220. package/dist/components/forms/validation/utilities/validation.utils.js.map +1 -1
  221. package/dist/components/forms/validation/validation.types.d.ts +10 -0
  222. package/dist/components/forms/validation/validation.types.d.ts.map +1 -1
  223. package/dist/components/molecules/ButtonGroup/index.cjs +8 -6
  224. package/dist/components/molecules/ButtonGroup/index.cjs.map +1 -1
  225. package/dist/components/molecules/ButtonGroup/index.d.ts +7 -5
  226. package/dist/components/molecules/ButtonGroup/index.d.ts.map +1 -1
  227. package/dist/components/molecules/ButtonGroup/index.js +12 -10
  228. package/dist/components/molecules/ButtonGroup/index.js.map +1 -1
  229. package/dist/components/molecules/EmptyState/index.cjs +33 -33
  230. package/dist/components/molecules/EmptyState/index.cjs.map +1 -1
  231. package/dist/components/molecules/EmptyState/index.d.ts +23 -24
  232. package/dist/components/molecules/EmptyState/index.d.ts.map +1 -1
  233. package/dist/components/molecules/EmptyState/index.js +36 -36
  234. package/dist/components/molecules/EmptyState/index.js.map +1 -1
  235. package/dist/components/molecules/Messaging/index.cjs +5 -3
  236. package/dist/components/molecules/Messaging/index.cjs.map +1 -1
  237. package/dist/components/molecules/Messaging/index.d.ts +3 -3
  238. package/dist/components/molecules/Messaging/index.d.ts.map +1 -1
  239. package/dist/components/molecules/Messaging/index.js +5 -3
  240. package/dist/components/molecules/Messaging/index.js.map +1 -1
  241. package/dist/components/molecules/SectionFooter/index.cjs +9 -6
  242. package/dist/components/molecules/SectionFooter/index.cjs.map +1 -1
  243. package/dist/components/molecules/SectionFooter/index.d.ts +5 -5
  244. package/dist/components/molecules/SectionFooter/index.d.ts.map +1 -1
  245. package/dist/components/molecules/SectionFooter/index.js +10 -7
  246. package/dist/components/molecules/SectionFooter/index.js.map +1 -1
  247. package/dist/components/molecules/SectionHeader/index.cjs +21 -15
  248. package/dist/components/molecules/SectionHeader/index.cjs.map +1 -1
  249. package/dist/components/molecules/SectionHeader/index.d.ts +11 -11
  250. package/dist/components/molecules/SectionHeader/index.d.ts.map +1 -1
  251. package/dist/components/molecules/SectionHeader/index.js +22 -16
  252. package/dist/components/molecules/SectionHeader/index.js.map +1 -1
  253. package/dist/components/molecules/Select/index.d.ts +2 -5
  254. package/dist/components/molecules/Select/index.d.ts.map +1 -1
  255. package/dist/components/molecules/Selects/MultiSelect/MultiSelect.cjs +3 -2
  256. package/dist/components/molecules/Selects/MultiSelect/MultiSelect.cjs.map +1 -1
  257. package/dist/components/molecules/Selects/MultiSelect/MultiSelect.d.ts +3 -3
  258. package/dist/components/molecules/Selects/MultiSelect/MultiSelect.d.ts.map +1 -1
  259. package/dist/components/molecules/Selects/MultiSelect/MultiSelect.js +4 -3
  260. package/dist/components/molecules/Selects/MultiSelect/MultiSelect.js.map +1 -1
  261. package/dist/components/molecules/Selects/Select/Select.cjs +5 -5
  262. package/dist/components/molecules/Selects/Select/Select.cjs.map +1 -1
  263. package/dist/components/molecules/Selects/Select/Select.d.ts +3 -6
  264. package/dist/components/molecules/Selects/Select/Select.d.ts.map +1 -1
  265. package/dist/components/molecules/Selects/Select/Select.js +6 -6
  266. package/dist/components/molecules/Selects/Select/Select.js.map +1 -1
  267. package/dist/components/molecules/Selects/Select/components/Combobox.cjs +7 -5
  268. package/dist/components/molecules/Selects/Select/components/Combobox.cjs.map +1 -1
  269. package/dist/components/molecules/Selects/Select/components/Combobox.d.ts +3 -3
  270. package/dist/components/molecules/Selects/Select/components/Combobox.d.ts.map +1 -1
  271. package/dist/components/molecules/Selects/Select/components/Combobox.js +10 -8
  272. package/dist/components/molecules/Selects/Select/components/Combobox.js.map +1 -1
  273. package/dist/components/molecules/Selects/Select/components/Popover.cjs +2 -3
  274. package/dist/components/molecules/Selects/Select/components/Popover.cjs.map +1 -1
  275. package/dist/components/molecules/Selects/Select/components/Popover.d.ts.map +1 -1
  276. package/dist/components/molecules/Selects/Select/components/Popover.js +2 -3
  277. package/dist/components/molecules/Selects/Select/components/Popover.js.map +1 -1
  278. package/dist/components/molecules/Selects/components/SelectItem.cjs +2 -1
  279. package/dist/components/molecules/Selects/components/SelectItem.cjs.map +1 -1
  280. package/dist/components/molecules/Selects/components/SelectItem.d.ts.map +1 -1
  281. package/dist/components/molecules/Selects/components/SelectItem.js +2 -1
  282. package/dist/components/molecules/Selects/components/SelectItem.js.map +1 -1
  283. package/dist/components/molecules/Tabs/index.cjs +10 -7
  284. package/dist/components/molecules/Tabs/index.cjs.map +1 -1
  285. package/dist/components/molecules/Tabs/index.d.ts +12 -15
  286. package/dist/components/molecules/Tabs/index.d.ts.map +1 -1
  287. package/dist/components/molecules/Tabs/index.js +13 -10
  288. package/dist/components/molecules/Tabs/index.js.map +1 -1
  289. package/dist/components/molecules/Tags/Tag/Tag.cjs +4 -3
  290. package/dist/components/molecules/Tags/Tag/Tag.cjs.map +1 -1
  291. package/dist/components/molecules/Tags/Tag/Tag.d.ts +4 -3
  292. package/dist/components/molecules/Tags/Tag/Tag.d.ts.map +1 -1
  293. package/dist/components/molecules/Tags/Tag/Tag.js +5 -4
  294. package/dist/components/molecules/Tags/Tag/Tag.js.map +1 -1
  295. package/dist/components/molecules/Tags/TagGroup/TagGroup.cjs +5 -3
  296. package/dist/components/molecules/Tags/TagGroup/TagGroup.cjs.map +1 -1
  297. package/dist/components/molecules/Tags/TagGroup/TagGroup.d.ts +2 -3
  298. package/dist/components/molecules/Tags/TagGroup/TagGroup.d.ts.map +1 -1
  299. package/dist/components/molecules/Tags/TagGroup/TagGroup.js +6 -4
  300. package/dist/components/molecules/Tags/TagGroup/TagGroup.js.map +1 -1
  301. package/dist/components/molecules/TextArea/index.d.ts +1 -4
  302. package/dist/components/molecules/TextArea/index.d.ts.map +1 -1
  303. package/dist/components/organisms/Carousel/index.cjs +26 -14
  304. package/dist/components/organisms/Carousel/index.cjs.map +1 -1
  305. package/dist/components/organisms/Carousel/index.d.ts +8 -10
  306. package/dist/components/organisms/Carousel/index.d.ts.map +1 -1
  307. package/dist/components/organisms/Carousel/index.js +28 -16
  308. package/dist/components/organisms/Carousel/index.js.map +1 -1
  309. package/dist/components/organisms/ColorPicker/components/ColorPickerField.cjs +3 -2
  310. package/dist/components/organisms/ColorPicker/components/ColorPickerField.cjs.map +1 -1
  311. package/dist/components/organisms/ColorPicker/components/ColorPickerField.d.ts +2 -4
  312. package/dist/components/organisms/ColorPicker/components/ColorPickerField.d.ts.map +1 -1
  313. package/dist/components/organisms/ColorPicker/components/ColorPickerField.js +4 -3
  314. package/dist/components/organisms/ColorPicker/components/ColorPickerField.js.map +1 -1
  315. package/dist/components/organisms/ColorPicker/index.cjs +3 -1
  316. package/dist/components/organisms/ColorPicker/index.cjs.map +1 -1
  317. package/dist/components/organisms/ColorPicker/index.d.ts +1 -1
  318. package/dist/components/organisms/ColorPicker/index.d.ts.map +1 -1
  319. package/dist/components/organisms/ColorPicker/index.js +7 -5
  320. package/dist/components/organisms/ColorPicker/index.js.map +1 -1
  321. package/dist/components/organisms/ColorPicker/providers/ColorPicker.provider.js +1 -1
  322. package/dist/components/organisms/CommandMenu/components/CommandInput.cjs +5 -3
  323. package/dist/components/organisms/CommandMenu/components/CommandInput.cjs.map +1 -1
  324. package/dist/components/organisms/CommandMenu/components/CommandInput.d.ts +3 -5
  325. package/dist/components/organisms/CommandMenu/components/CommandInput.d.ts.map +1 -1
  326. package/dist/components/organisms/CommandMenu/components/CommandInput.js +5 -3
  327. package/dist/components/organisms/CommandMenu/components/CommandInput.js.map +1 -1
  328. package/dist/components/organisms/CommandMenu/index.cjs +8 -6
  329. package/dist/components/organisms/CommandMenu/index.cjs.map +1 -1
  330. package/dist/components/organisms/CommandMenu/index.d.ts +4 -4
  331. package/dist/components/organisms/CommandMenu/index.d.ts.map +1 -1
  332. package/dist/components/organisms/CommandMenu/index.js +9 -7
  333. package/dist/components/organisms/CommandMenu/index.js.map +1 -1
  334. package/dist/components/organisms/DatePickers/DatePicker/DatePicker.cjs +4 -2
  335. package/dist/components/organisms/DatePickers/DatePicker/DatePicker.cjs.map +1 -1
  336. package/dist/components/organisms/DatePickers/DatePicker/DatePicker.d.ts +2 -4
  337. package/dist/components/organisms/DatePickers/DatePicker/DatePicker.d.ts.map +1 -1
  338. package/dist/components/organisms/DatePickers/DatePicker/DatePicker.js +4 -2
  339. package/dist/components/organisms/DatePickers/DatePicker/DatePicker.js.map +1 -1
  340. package/dist/components/organisms/DatePickers/DateRangePicker/DateRangePicker.cjs +3 -2
  341. package/dist/components/organisms/DatePickers/DateRangePicker/DateRangePicker.cjs.map +1 -1
  342. package/dist/components/organisms/DatePickers/DateRangePicker/DateRangePicker.d.ts +2 -4
  343. package/dist/components/organisms/DatePickers/DateRangePicker/DateRangePicker.d.ts.map +1 -1
  344. package/dist/components/organisms/DatePickers/DateRangePicker/DateRangePicker.js +4 -3
  345. package/dist/components/organisms/DatePickers/DateRangePicker/DateRangePicker.js.map +1 -1
  346. package/dist/components/organisms/DatePickers/RangeCalendar/RangeCalendar.js +2 -2
  347. package/dist/components/organisms/FileUpload/index.cjs +8 -6
  348. package/dist/components/organisms/FileUpload/index.cjs.map +1 -1
  349. package/dist/components/organisms/FileUpload/index.d.ts +7 -7
  350. package/dist/components/organisms/FileUpload/index.d.ts.map +1 -1
  351. package/dist/components/organisms/FileUpload/index.js +12 -10
  352. package/dist/components/organisms/FileUpload/index.js.map +1 -1
  353. package/dist/components/organisms/FilterBar/index.cjs +13 -9
  354. package/dist/components/organisms/FilterBar/index.cjs.map +1 -1
  355. package/dist/components/organisms/FilterBar/index.d.ts +7 -7
  356. package/dist/components/organisms/FilterBar/index.d.ts.map +1 -1
  357. package/dist/components/organisms/FilterBar/index.js +14 -10
  358. package/dist/components/organisms/FilterBar/index.js.map +1 -1
  359. package/dist/components/organisms/SidePanel/components/SidePanelContent.cjs +4 -3
  360. package/dist/components/organisms/SidePanel/components/SidePanelContent.cjs.map +1 -1
  361. package/dist/components/organisms/SidePanel/components/SidePanelContent.d.ts +12 -6
  362. package/dist/components/organisms/SidePanel/components/SidePanelContent.d.ts.map +1 -1
  363. package/dist/components/organisms/SidePanel/components/SidePanelContent.js +4 -3
  364. package/dist/components/organisms/SidePanel/components/SidePanelContent.js.map +1 -1
  365. package/dist/components/organisms/SidePanel/components/SidePanelFooter.cjs +4 -3
  366. package/dist/components/organisms/SidePanel/components/SidePanelFooter.cjs.map +1 -1
  367. package/dist/components/organisms/SidePanel/components/SidePanelFooter.d.ts +11 -6
  368. package/dist/components/organisms/SidePanel/components/SidePanelFooter.d.ts.map +1 -1
  369. package/dist/components/organisms/SidePanel/components/SidePanelFooter.js +4 -3
  370. package/dist/components/organisms/SidePanel/components/SidePanelFooter.js.map +1 -1
  371. package/dist/components/organisms/SidePanel/components/SidePanelHeader.cjs +12 -10
  372. package/dist/components/organisms/SidePanel/components/SidePanelHeader.cjs.map +1 -1
  373. package/dist/components/organisms/SidePanel/components/SidePanelHeader.d.ts +8 -7
  374. package/dist/components/organisms/SidePanel/components/SidePanelHeader.d.ts.map +1 -1
  375. package/dist/components/organisms/SidePanel/components/SidePanelHeader.js +15 -13
  376. package/dist/components/organisms/SidePanel/components/SidePanelHeader.js.map +1 -1
  377. package/dist/components/organisms/SidebarNavigation/index.cjs +2 -1
  378. package/dist/components/organisms/SidebarNavigation/index.cjs.map +1 -1
  379. package/dist/components/organisms/SidebarNavigation/index.d.ts.map +1 -1
  380. package/dist/components/organisms/SidebarNavigation/index.js +2 -1
  381. package/dist/components/organisms/SidebarNavigation/index.js.map +1 -1
  382. package/dist/components/organisms/SlideoutMenu/index.cjs +8 -8
  383. package/dist/components/organisms/SlideoutMenu/index.cjs.map +1 -1
  384. package/dist/components/organisms/SlideoutMenu/index.d.ts +9 -18
  385. package/dist/components/organisms/SlideoutMenu/index.d.ts.map +1 -1
  386. package/dist/components/organisms/SlideoutMenu/index.js +9 -9
  387. package/dist/components/organisms/SlideoutMenu/index.js.map +1 -1
  388. package/dist/components/organisms/Table/index.cjs +15 -10
  389. package/dist/components/organisms/Table/index.cjs.map +1 -1
  390. package/dist/components/organisms/Table/index.d.ts +10 -19
  391. package/dist/components/organisms/Table/index.d.ts.map +1 -1
  392. package/dist/components/organisms/Table/index.js +18 -13
  393. package/dist/components/organisms/Table/index.js.map +1 -1
  394. package/dist/components/organisms/TextEditor/components/TextEditorExtensions.js +1 -1
  395. package/dist/components/organisms/TextEditor/components/TextEditorToolbar.cjs +5 -3
  396. package/dist/components/organisms/TextEditor/components/TextEditorToolbar.cjs.map +1 -1
  397. package/dist/components/organisms/TextEditor/components/TextEditorToolbar.d.ts +2 -3
  398. package/dist/components/organisms/TextEditor/components/TextEditorToolbar.d.ts.map +1 -1
  399. package/dist/components/organisms/TextEditor/components/TextEditorToolbar.js +5 -3
  400. package/dist/components/organisms/TextEditor/components/TextEditorToolbar.js.map +1 -1
  401. package/dist/components/organisms/TextEditor/index.cjs +16 -9
  402. package/dist/components/organisms/TextEditor/index.cjs.map +1 -1
  403. package/dist/components/organisms/TextEditor/index.d.ts +7 -9
  404. package/dist/components/organisms/TextEditor/index.d.ts.map +1 -1
  405. package/dist/components/organisms/TextEditor/index.js +21 -14
  406. package/dist/components/organisms/TextEditor/index.js.map +1 -1
  407. package/dist/components/organisms/VideoPlayer/index.cjs +3 -2
  408. package/dist/components/organisms/VideoPlayer/index.cjs.map +1 -1
  409. package/dist/components/organisms/VideoPlayer/index.d.ts +1 -6
  410. package/dist/components/organisms/VideoPlayer/index.d.ts.map +1 -1
  411. package/dist/components/organisms/VideoPlayer/index.js +4 -3
  412. package/dist/components/organisms/VideoPlayer/index.js.map +1 -1
  413. package/dist/native/components/atoms/PhoneInput/index.d.ts +12 -0
  414. package/dist/native/components/forms/fields/FormPhoneInput/index.d.ts +12 -0
  415. package/dist/native/components/forms/validation/phoneNumber/index.d.ts +12 -0
  416. package/dist/utilities/__internal__/inertUtils/inert.utils.cjs +17 -0
  417. package/dist/utilities/__internal__/inertUtils/inert.utils.cjs.map +1 -1
  418. package/dist/utilities/__internal__/inertUtils/inert.utils.d.ts +11 -0
  419. package/dist/utilities/__internal__/inertUtils/inert.utils.d.ts.map +1 -1
  420. package/dist/utilities/__internal__/inertUtils/inert.utils.js +17 -1
  421. package/dist/utilities/__internal__/inertUtils/inert.utils.js.map +1 -1
  422. package/dist/utilities/__internal__/refUtils/ref.utils.cjs +20 -0
  423. package/dist/utilities/__internal__/refUtils/ref.utils.cjs.map +1 -1
  424. package/dist/utilities/__internal__/refUtils/ref.utils.d.ts +10 -1
  425. package/dist/utilities/__internal__/refUtils/ref.utils.d.ts.map +1 -1
  426. package/dist/utilities/__internal__/refUtils/ref.utils.js +20 -1
  427. package/dist/utilities/__internal__/refUtils/ref.utils.js.map +1 -1
  428. package/package.json +13 -5
@@ -0,0 +1,288 @@
1
+ import { isSupportedCountry, getCountries, getCountryCallingCode, getExampleNumber, AsYouType, parseDigits } from 'libphonenumber-js/min';
2
+ import metadata from 'libphonenumber-js/min/metadata';
3
+ import examples from 'libphonenumber-js/mobile/examples';
4
+ import { getCountryName } from '../../Flag/flag.utils.js';
5
+
6
+ // Where an empty field starts when neither the app nor the user's locale names a country.
7
+ const FALLBACK_COUNTRY = 'IE';
8
+ /**
9
+ * Reads the characters of a phone number that count: its digits, in any script, and a plus only where it leads.
10
+ *
11
+ * @param text The number as typed or pasted, with any spaces, brackets and dashes.
12
+ * @returns The digits as ASCII, after a leading plus when the text has one before any digit.
13
+ */
14
+ const significantChars = (text) => {
15
+ let significant = '';
16
+ for (const char of text) {
17
+ if (char === '+') {
18
+ if (significant === '')
19
+ significant = '+';
20
+ }
21
+ else {
22
+ significant += parseDigits(char);
23
+ }
24
+ }
25
+ return significant;
26
+ };
27
+ /**
28
+ * Finds where the cursor belongs in a formatted number, so it stays beside the digit the user was at when the spacing changes.
29
+ *
30
+ * @param text The formatted number.
31
+ * @param position How many significant characters sit before the cursor.
32
+ * @returns The index in `text` just after that many significant characters: before the first one for none, and the end once every one is passed.
33
+ */
34
+ const caretAfter = (text, position) => {
35
+ let seen = 0;
36
+ for (let index = 0; index < text.length; index++) {
37
+ const isSignificant = /\d/.test(text[index]) || (text[index] === '+' && seen === 0);
38
+ if (!isSignificant)
39
+ continue;
40
+ if (position <= 0)
41
+ return index;
42
+ seen++;
43
+ if (seen === position)
44
+ return /\d/.test(text.slice(index + 1)) ? index + 1 : text.length;
45
+ }
46
+ return text.length;
47
+ };
48
+ /**
49
+ * Reads an edit to the formatted number as an edit to its digits. A delete that took only a space or a bracket would
50
+ * format back to the same text, so it takes the digit beside it instead.
51
+ *
52
+ * @param edit The text before and after the edit, the cursor and the kind of edit.
53
+ * @returns The significant characters after the edit, and how many of them sit before the cursor.
54
+ */
55
+ const editedDigits = ({ previous, next, caret, inputType }) => {
56
+ const significant = significantChars(next);
57
+ const position = significantChars(next.slice(0, caret)).length;
58
+ const isDelete = inputType ? inputType.startsWith('delete') : next.length < previous.length;
59
+ if (!isDelete || significant !== significantChars(previous))
60
+ return { significant, position };
61
+ const isForward = inputType === 'deleteContentForward';
62
+ const index = isForward ? position : position - 1;
63
+ if (index < 0 || index >= significant.length)
64
+ return { significant, position };
65
+ return { significant: significant.slice(0, index) + significant.slice(index + 1), position: index };
66
+ };
67
+ /**
68
+ * Formats a number as it is typed, in a country's national style, or internationally when it starts with a plus.
69
+ *
70
+ * @param country The country whose style applies.
71
+ * @param significant The digits typed so far, after a plus for an international number.
72
+ * @returns The number spaced as that country writes it, as far as it has been typed. Digits typed without the country's
73
+ * trunk prefix, as after a calling code, are spaced as the international form spaces them.
74
+ */
75
+ const formatTyped = (country, significant) => {
76
+ const national = new AsYouType(country).input(significant);
77
+ if (significant.startsWith('+') || national !== significant)
78
+ return national;
79
+ // The national format of many countries needs the trunk prefix, so a number typed without it would get no spacing at all.
80
+ const callingCode = getCountryCallingCode(country);
81
+ return new AsYouType().input(`+${callingCode}${significant}`).replace(`+${callingCode}`, '').trim();
82
+ };
83
+ /**
84
+ * Writes what the field shows as one international number, the form an API stores.
85
+ *
86
+ * @param entry The chosen country and the number as typed.
87
+ * @returns The number in E.164 form, such as `+353861234567`, as far as it has been typed, or `''` before any digit that counts.
88
+ */
89
+ const toInternational = ({ country, text }) => {
90
+ const typed = new AsYouType(country);
91
+ typed.input(text);
92
+ return typed.getNumber()?.number ?? '';
93
+ };
94
+ /**
95
+ * Finds the calling code a run of digits starts with. No calling code starts with another, so the first match is the code.
96
+ *
97
+ * @param digits The digits after a plus.
98
+ * @returns The calling code, or `undefined` while the digits are not yet one.
99
+ */
100
+ const leadingCallingCode = (digits) => {
101
+ for (let length = 1; length <= Math.min(3, digits.length); length++) {
102
+ const code = digits.slice(0, length);
103
+ if (code in metadata.country_calling_codes)
104
+ return code;
105
+ }
106
+ return undefined;
107
+ };
108
+ /**
109
+ * Picks the country an international number belongs to. The library tells most numbers apart by their digits, such as
110
+ * a Canadian or a Jamaican number on +1; where it cannot, as for a number not yet whole, the country the field is on
111
+ * stays when it uses the calling code, and otherwise the code's main country.
112
+ *
113
+ * @param international The number, after a plus.
114
+ * @param current The country the field is on.
115
+ * @param allowed The countries the field offers, when the app restricts them.
116
+ * @returns The country, or `undefined` for a number with no calling code yet or one only countries the field does not offer use.
117
+ */
118
+ const countryForNumber = (international, current, allowed) => {
119
+ const typed = new AsYouType();
120
+ typed.input(international);
121
+ const callingCode = typed.getCallingCode();
122
+ if (!callingCode)
123
+ return undefined;
124
+ const possible = typed.getNumber()?.getPossibleCountries() ?? [];
125
+ // The library lists a code's main country first.
126
+ const sharing = (metadata.country_calling_codes[callingCode] ?? []).filter((code) => isSupportedCountry(code));
127
+ const candidates = (possible.length > 0 ? possible : sharing).filter((code) => !allowed || allowed.includes(code));
128
+ return candidates.includes(current) ? current : candidates[0];
129
+ };
130
+ /**
131
+ * Reads an international number as the country and national number the field shows, for a saved value or one pasted whole.
132
+ *
133
+ * @param value The number, with its plus and calling code.
134
+ * @param current The country the field is on, kept where the number could belong to it.
135
+ * @param allowed The countries the field offers, when the app restricts them.
136
+ * @returns The country and the number in its national format, or `undefined` for a value that is not an international
137
+ * number or belongs to a country the field does not offer.
138
+ */
139
+ const fromInternational = (value, current, allowed) => {
140
+ const significant = significantChars(value);
141
+ const country = significant.startsWith('+') ? countryForNumber(significant, current, allowed) : undefined;
142
+ if (!country)
143
+ return undefined;
144
+ const typed = new AsYouType();
145
+ typed.input(significant);
146
+ const number = typed.getNumber();
147
+ // A whole number is written the way the country writes it, with its trunk prefix; a partial one has no such form yet.
148
+ const text = number?.isPossible() ? number.formatNational() : formatTyped(country, number?.nationalNumber ?? '');
149
+ return { country, text };
150
+ };
151
+ /**
152
+ * Gives the national digits of an international number, as a country switch keeps them.
153
+ *
154
+ * @param international The number, after a plus.
155
+ * @returns The digits after the calling code, or `''` before the code is whole.
156
+ */
157
+ const nationalDigits = (international) => {
158
+ const typed = new AsYouType();
159
+ typed.input(international);
160
+ return typed.getNumber()?.nationalNumber ?? '';
161
+ };
162
+ /**
163
+ * Rewrites a number typed with a country's international dialling prefix, such as `00` in Ireland or `011` in the
164
+ * United States, with a plus in its place.
165
+ *
166
+ * @param country The country whose dialling prefix applies.
167
+ * @param significant The digits typed.
168
+ * @param position How many of them sit before the cursor.
169
+ * @returns The number after a plus with the cursor moved to match, `pending` while only the prefix or part of a calling
170
+ * code is typed, or `undefined` for digits that do not start with the prefix.
171
+ */
172
+ const fromDiallingPrefix = (country, significant, position) => {
173
+ const typed = new AsYouType(country);
174
+ typed.input(significant);
175
+ if (!typed.isInternational())
176
+ return undefined;
177
+ const callingCode = typed.getCallingCode();
178
+ if (!callingCode)
179
+ return 'pending';
180
+ const international = `+${callingCode}${typed.getNumber()?.nationalNumber ?? ''}`;
181
+ // The prefix gives way to a single plus, so the cursor moves back by the rest of it.
182
+ const prefixLength = significant.length - (international.length - 1);
183
+ return { significant: international, position: Math.max(1, position - prefixLength + 1) };
184
+ };
185
+ /**
186
+ * Works out what the field shows after an edit. National digits are formatted for the country the field is on. A plus,
187
+ * or the country's own dialling prefix such as `00`, starts an international number: once the digits before the cursor
188
+ * hold a whole calling code, the field moves to that code's country and keeps the rest as the national number.
189
+ *
190
+ * @param country The country the field is on.
191
+ * @param significant The significant characters in the field after the edit.
192
+ * @param position How many of them sit before the cursor.
193
+ * @param allowed The countries the field offers, when the app restricts them.
194
+ * @returns The country, text and cursor position to show, or `undefined` while a calling code is still being typed, when
195
+ * the text should stay as the user wrote it. A number from a country the field does not offer stays international.
196
+ */
197
+ const entryFor = (country, significant, position, allowed) => {
198
+ let digits = significant;
199
+ let cursor = position;
200
+ if (!digits.startsWith('+')) {
201
+ const dialled = fromDiallingPrefix(country, digits, cursor);
202
+ if (dialled === 'pending')
203
+ return undefined;
204
+ if (!dialled)
205
+ return { country, text: formatTyped(country, digits), position: cursor };
206
+ ({ significant: digits, position: cursor } = dialled);
207
+ }
208
+ // Only the digits between the plus and the cursor name the country, so a plus typed before a number does not read its digits as a code.
209
+ const before = digits.slice(1, Math.max(1, cursor));
210
+ const callingCode = leadingCallingCode(before);
211
+ if (!callingCode)
212
+ return undefined;
213
+ const entry = fromInternational(digits, country, allowed);
214
+ if (!entry)
215
+ return { country, text: formatTyped(country, digits), position: cursor };
216
+ // The national digits before the cursor, shifted by any trunk prefix the national format adds in front of them.
217
+ const nationalLength = digits.length - 1 - callingCode.length;
218
+ const trunkLength = significantChars(entry.text).length - nationalLength;
219
+ return { ...entry, position: before.length - callingCode.length + Math.max(0, trunkLength) };
220
+ };
221
+ /**
222
+ * Lists the countries the field offers, named and sorted for the user's language.
223
+ *
224
+ * @param locale The user's locale, which names and orders the countries.
225
+ * @param allowed The countries to offer; every country the library knows without it. A code the library does not know is left out.
226
+ * @returns Each country with its name and calling code, in the locale's alphabetical order.
227
+ */
228
+ const countryOptions = (locale, allowed) => {
229
+ // Called with the code alone: `filter` would hand the library its index as a second argument.
230
+ const codes = allowed ? allowed.filter((code) => isSupportedCountry(code)) : getCountries();
231
+ const { compare } = new Intl.Collator(locale);
232
+ return codes
233
+ .map((code) => ({ code, name: getCountryName(code, locale), callingCode: getCountryCallingCode(code) }))
234
+ .sort((first, second) => compare(first.name, second.name));
235
+ };
236
+ /**
237
+ * Gives a number that shows a country's format, for the field's placeholder.
238
+ *
239
+ * @param country The country to show.
240
+ * @returns A mobile number in that country's national format, or `''` when the library has none.
241
+ */
242
+ const exampleNumber = (country) => getExampleNumber(country, examples)?.formatNational() ?? '';
243
+ // Reads the tag's region alone, so neither an extension key (`en-u-ca-gregory`) nor a POSIX codeset (`en_US.UTF-8`) is taken for one.
244
+ const localeRegion = (locale) => {
245
+ try {
246
+ return new Intl.Locale(locale.replace(/[.@].*$/, '').replace(/_/g, '-')).region;
247
+ }
248
+ catch {
249
+ return undefined;
250
+ }
251
+ };
252
+ /**
253
+ * Picks the country an empty field starts on.
254
+ *
255
+ * @param requested The country the app asked for, if any.
256
+ * @param locale The user's locale, such as `en-IE`.
257
+ * @param allowed The countries the field offers, in the order the app passed them, when it restricts them.
258
+ * @returns The requested country when the field offers it, else the region the locale names when the field offers it,
259
+ * else the first country offered, else Ireland.
260
+ */
261
+ const startingCountry = (requested, locale, allowed) => {
262
+ const isOffered = (code) => Boolean(code) && isSupportedCountry(code) && (!allowed || allowed.includes(code));
263
+ if (isOffered(requested))
264
+ return requested;
265
+ const region = localeRegion(locale);
266
+ if (isOffered(region))
267
+ return region;
268
+ return allowed?.[0] ?? FALLBACK_COUNTRY;
269
+ };
270
+ /**
271
+ * Tells whether focus moving to an element stays inside the field, so leaving one of its parts for another is not a blur.
272
+ *
273
+ * @param next The element taking focus; `null` when focus leaves the page or lands on nothing focusable.
274
+ * @param parts The field's parts: the group that holds the country trigger and the number, and the country list, which
275
+ * renders in a portal outside it; `null` for one not on the page, such as the list while it is closed.
276
+ * @returns `true` when `next` sits inside one of the parts.
277
+ */
278
+ const isFocusInside = (next, parts) => next !== null && parts.some((part) => part?.contains(next));
279
+ /**
280
+ * Reads the countries an app passes as the ones the field offers.
281
+ *
282
+ * @param countries The two-letter codes, in the order the app passed them, joined with commas so a new array each render reads the same.
283
+ * @returns The codes the library knows, in that order, or `undefined` when the app offers every country.
284
+ */
285
+ const offeredCountries = (countries) => countries === undefined ? undefined : countries.split(',').filter((code) => isSupportedCountry(code));
286
+
287
+ export { caretAfter, countryForNumber, countryOptions, editedDigits, entryFor, exampleNumber, formatTyped, fromInternational, isFocusInside, leadingCallingCode, nationalDigits, offeredCountries, significantChars, startingCountry, toInternational };
288
+ //# sourceMappingURL=phoneInput.utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"phoneInput.utils.js","sources":["../../../../../src/components/atoms/PhoneInput/utilities/phoneInput.utils.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;AAMA;AACA,MAAM,gBAAgB,GAAqB,IAAI;AAE/C;;;;;AAKG;AACI,MAAM,gBAAgB,GAAG,CAAC,IAAY,KAAY;IACvD,IAAI,WAAW,GAAG,EAAE;AACpB,IAAA,KAAK,MAAM,IAAI,IAAI,IAAI,EAAE;AACvB,QAAA,IAAI,IAAI,KAAK,GAAG,EAAE;YAChB,IAAI,WAAW,KAAK,EAAE;gBAAE,WAAW,GAAG,GAAG;QAC3C;aAAO;AACL,YAAA,WAAW,IAAI,WAAW,CAAC,IAAI,CAAC;QAClC;IACF;AACA,IAAA,OAAO,WAAW;AACpB;AAEA;;;;;;AAMG;MACU,UAAU,GAAG,CAAC,IAAY,EAAE,QAAgB,KAAY;IACnE,IAAI,IAAI,GAAG,CAAC;AACZ,IAAA,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;QAChD,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,IAAI,IAAI,KAAK,CAAC,CAAC;AACnF,QAAA,IAAI,CAAC,aAAa;YAAE;QACpB,IAAI,QAAQ,IAAI,CAAC;AAAE,YAAA,OAAO,KAAK;AAC/B,QAAA,IAAI,EAAE;QACN,IAAI,IAAI,KAAK,QAAQ;YAAE,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,GAAG,IAAI,CAAC,MAAM;IAC1F;IACA,OAAO,IAAI,CAAC,MAAM;AACpB;AAaA;;;;;;AAMG;AACI,MAAM,YAAY,GAAG,CAAC,EAAE,QA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;AAEA;;;;;;;AAOG;AACI,MAAM,aAAa,GAAG,CAAC,IAAwB,EAAE,KAA+B,KACrF,IAAI,KAAK,IAAI,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK,IAAI,EAAE,QAAQ,CAAC,IAAY,CAAC;AAEpE;;;;;AAKG;AACI,MAAM,gBAAgB,GAAG,CAAC,SAA6B,KAC5D,SAAS,KAAK,SAAS,GAAG,SAAS,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,KAA+B,kBAAkB,CAAC,IAAI,CAAC;;"}
@@ -1,10 +1,7 @@
1
1
  import { type RadioButtonBaseProps as RadioButtonBasePropsNext, type RadioButtonProps as RadioButtonPropsNext } from '@flipdish/ui-library/components/atoms/Radios';
2
2
  import type { RadioGroupContextType as RadioGroupContextTypeNext } from '../Radios/providers/RadioGroup.context';
3
3
  /** @deprecated Import from `@flipdish/ui-library/components/atoms/Radios`. Removed in the next major. */
4
- export declare const RadioButton: {
5
- ({ label, hint, className, size, "data-testid": dataTestId, ...ariaRadioProps }: RadioButtonPropsNext): import("react").JSX.Element;
6
- displayName: string;
7
- };
4
+ export declare const RadioButton: import("react").ForwardRefExoticComponent<RadioButtonPropsNext & import("react").RefAttributes<HTMLLabelElement>>;
8
5
  /** @deprecated Import from `@flipdish/ui-library/components/atoms/Radios`. Removed in the next major. */
9
6
  export declare const RadioButtonBase: {
10
7
  ({ className, isFocusVisible, isSelected, isDisabled, size }: RadioButtonBasePropsNext): import("react").JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/RadioButton/index.tsx"],"names":[],"mappings":"AAIA,OAAO,EAEL,KAAK,oBAAoB,IAAI,wBAAwB,EAErD,KAAK,gBAAgB,IAAI,oBAAoB,EAE9C,MAAM,8CAA8C,CAAC;AAEtD,OAAO,KAAK,EAAE,qBAAqB,IAAI,yBAAyB,EAAE,MAAM,wCAAwC,CAAC;AAEjH,yGAAyG;AACzG,eAAO,MAAM,WAAW;;;CAAkB,CAAC;AAC3C,yGAAyG;AACzG,eAAO,MAAM,eAAe;;;CAAsB,CAAC;AACnD,yGAAyG;AACzG,eAAO,MAAM,UAAU,6KAAiB,CAAC;AACzC,yGAAyG;AACzG,MAAM,MAAM,gBAAgB,GAAG,oBAAoB,CAAC;AACpD,yGAAyG;AACzG,MAAM,MAAM,oBAAoB,GAAG,wBAAwB,CAAC;AAC5D,0GAA0G;AAC1G,MAAM,MAAM,qBAAqB,GAAG,yBAAyB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/RadioButton/index.tsx"],"names":[],"mappings":"AAIA,OAAO,EAEL,KAAK,oBAAoB,IAAI,wBAAwB,EAErD,KAAK,gBAAgB,IAAI,oBAAoB,EAE9C,MAAM,8CAA8C,CAAC;AAEtD,OAAO,KAAK,EAAE,qBAAqB,IAAI,yBAAyB,EAAE,MAAM,wCAAwC,CAAC;AAEjH,yGAAyG;AACzG,eAAO,MAAM,WAAW,mHAAkB,CAAC;AAC3C,yGAAyG;AACzG,eAAO,MAAM,eAAe;;;CAAsB,CAAC;AACnD,yGAAyG;AACzG,eAAO,MAAM,UAAU,6KAAiB,CAAC;AACzC,yGAAyG;AACzG,MAAM,MAAM,gBAAgB,GAAG,oBAAoB,CAAC;AACpD,yGAAyG;AACzG,MAAM,MAAM,oBAAoB,GAAG,wBAAwB,CAAC;AAC5D,0GAA0G;AAC1G,MAAM,MAAM,qBAAqB,GAAG,yBAAyB,CAAC"}
@@ -15,16 +15,18 @@ var RadioButtonBase = require('./components/RadioButtonBase.cjs');
15
15
  *
16
16
  * @summary single-select option used within a mutually exclusive group
17
17
  */
18
- const RadioButton = ({ label, hint, className, size = 'sm', 'data-testid': dataTestId, ...ariaRadioProps }) => {
18
+ const RadioButton = React.forwardRef(({ label, hint, className, size = 'sm', 'data-testid': dataTestId, ...ariaRadioProps }, ref) => {
19
19
  const context = React.useContext(RadioGroup_context.RadioGroupContext);
20
20
  size = context?.size ?? size;
21
21
  const fallbackTestId = testIdUtils.useResolvedTestId({ testId: dataTestId, segment: 'radio-button', rootName: 'radio-button' });
22
- const radioTestId = !dataTestId && context?.testIdPrefix ? testIdUtils.joinTestId(context.testIdPrefix, `option-${testIdUtils.slugifyTestId(String(ariaRadioProps.value))}`) : fallbackTestId;
23
- return (jsxRuntime.jsx(reactAriaComponents.Radio, { ...ariaRadioProps, "data-testid": radioTestId, className: (state) => cx.cx('relative flex items-start', state.isDisabled && 'cursor-not-allowed', selectionControl_styles.selectionControlSizes[size].root, typeof className === 'function' ? className(state) : className), children: ({ isSelected, isDisabled, isFocusVisible }) => (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(RadioButtonBase.RadioButtonBase, { size: size, isSelected: isSelected, isDisabled: isDisabled, isFocusVisible: isFocusVisible, className: label || hint ? 'mt-0.5' : '' }), (label || hint) && (jsxRuntime.jsxs("div", { className: cx.cx('inline-flex flex-col', selectionControl_styles.selectionControlSizes[size].textWrapper), children: [label && jsxRuntime.jsx("p", { className: cx.cx('text-secondary select-none', selectionControl_styles.selectionControlSizes[size].label), children: label }), hint && (
22
+ const radioTestId = !dataTestId && context?.testIdPrefix
23
+ ? testIdUtils.joinTestId(context.testIdPrefix, `option-${testIdUtils.slugifyTestId(String(ariaRadioProps.value))}`)
24
+ : fallbackTestId;
25
+ return (jsxRuntime.jsx(reactAriaComponents.Radio, { ...ariaRadioProps, ref: ref, "data-testid": radioTestId, className: (state) => cx.cx('relative flex items-start', state.isDisabled && 'cursor-not-allowed', selectionControl_styles.selectionControlSizes[size].root, typeof className === 'function' ? className(state) : className), children: ({ isSelected, isDisabled, isFocusVisible }) => (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(RadioButtonBase.RadioButtonBase, { size: size, isSelected: isSelected, isDisabled: isDisabled, isFocusVisible: isFocusVisible, className: label || hint ? 'mt-0.5' : '' }), (label || hint) && (jsxRuntime.jsxs("div", { className: cx.cx('inline-flex flex-col', selectionControl_styles.selectionControlSizes[size].textWrapper), children: [label && jsxRuntime.jsx("p", { className: cx.cx('text-secondary select-none', selectionControl_styles.selectionControlSizes[size].label), children: label }), hint && (
24
26
  // biome-ignore lint/a11y/noStaticElementInteractions: This is a hint that is not interactive
25
27
  // biome-ignore lint/a11y/useKeyWithClickEvents: This is a hint that is not interactive
26
28
  jsxRuntime.jsx("span", { className: cx.cx('text-tertiary', selectionControl_styles.selectionControlSizes[size].hint), onClick: (event) => event.stopPropagation(), children: hint }))] }))] })) }));
27
- };
29
+ });
28
30
  RadioButton.displayName = 'RadioButton';
29
31
 
30
32
  exports.RadioButton = RadioButton;
@@ -1 +1 @@
1
- {"version":3,"file":"RadioButton.cjs","sources":["../../../../../src/components/atoms/Radios/RadioButton/RadioButton.tsx"],"sourcesContent":[null],"names":["useContext","RadioGroupContext","useResolvedTestId","joinTestId","slugifyTestId","_jsx","AriaRadio","cx","selectionControlSizes","_jsxs","_Fragment","RadioButtonBase"],"mappings":";;;;;;;;;;;AAuBA;;;;;AAKG;AACI,MAAM,WAAW,GAAG,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,GAAG,IAAI,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,cAAc,EAAoB,KAAI;AACrI,IAAA,MAAM,OAAO,GAAGA,gBAAU,CAACC,oCAAiB,CAAC;AAE7C,IAAA,IAAI,GAAG,OAAO,EAAE,IAAI,IAAI,IAAI;AAE5B,IAAA,MAAM,cAAc,GAAGC,6BAAiB,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,cAAc,EAAE,CAAC;AACnH,IAAA,MAAM,WAAW,GACf,CAAC,UAAU,IAAI,OAAO,EAAE,YAAY,GAAGC,sBAAU,CAAC,OAAO,CAAC,YAAY,EAAE,CAAA,OAAA,EAAUC,yBAAa,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A,CACA,CACR,IACG,CACP,CAAA,EAAA,CACA,CACJ,EAAA,CACS;AAEhB;AACA,WAAW,CAAC,WAAW,GAAG,aAAa;;"}
1
+ {"version":3,"file":"RadioButton.cjs","sources":["../../../../../src/components/atoms/Radios/RadioButton/RadioButton.tsx"],"sourcesContent":[null],"names":["forwardRef","useContext","RadioGroupContext","useResolvedTestId","joinTestId","slugifyTestId","_jsx","AriaRadio","cx","selectionControlSizes","_jsxs","_Fragment","RadioButtonBase"],"mappings":";;;;;;;;;;;AAqBA;;;;;AAKG;AACI,MAAM,WAAW,GAAGA,gBAAU,CACnC,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,GAAG,IAAI,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,cAAc,EAAE,EAAE,GAAG,KAAI;AAC7F,IAAA,MAAM,OAAO,GAAGC,gBAAU,CAACC,oCAAiB,CAAC;AAE7C,IAAA,IAAI,GAAG,OAAO,EAAE,IAAI,IAAI,IAAI;AAE5B,IAAA,MAAM,cAAc,GAAGC,6BAAiB,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,cAAc,EAAE,CAAC;AACnH,IAAA,MAAM,WAAW,GACf,CAAC,UAAU,IAAI,OAAO,EAAE;AACtB,UAAEC,sBAAU,CAAC,OAAO,CAAC,YAAY,EAAE,CAAA,OAAA,EAAUC,yBAAa,CAAC,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,EAAE;UACxF,cAAc;AAEpB,IAAA,QACEC,cAAA,CAACC,yBAAS,EAAA,EAAA,GACJ,cAAc,EAClB,GAAG,EAAE,GAAG,EAAA,aAAA,EACK,WAAW,EACxB,SAAS,EAAE,CAAC,KAAK,KACfC,KAAE,CACA,2BAA2B,EAC3B,KAAK,CAAC,UAAU,IAAI,oBAAoB,EACxCC,6CAAqB,CAAC,IAAI,CAAC,CAAC,IAAI,EAChC,OAAO,SAAS,KAAK,UAAU,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,SAAS,CAC/D,EAAA,QAAA,EAGF,CAAC,EAAE,UAAU,EAAE,UAAU,EAAE,cAAc,EAAE,MAC1CC,eAAA,CAAAC,mBAAA,EAAA,EAAA,QAAA,EAAA,CACEL,cAAA,CAACM,+BAAe,IACd,IAAI,EAAE,IAAI,EACV,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,UAAU,EACtB,cAAc,EAAE,cAAc,EAC9B,SAAS,EAAE,KAAK,IAAI,IAAI,GAAG,QAAQ,GAAG,EAAE,EAAA,CACxC,EACD,CAAC,KAAK,IAAI,IAAI,MACbF,eAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAEF,KAAE,CAAC,sBAAsB,EAAEC,6CAAqB,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC,EAAA,QAAA,EAAA,CAChF,KAAK,IAAIH,cAAA,CAAA,GAAA,EAAA,EAAG,SAAS,EAAEE,KAAE,CAAC,4BAA4B,EAAEC,6CAAqB,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,EAAA,QAAA,EAAG,KAAK,EAAA,CAAK,EACvG,IAAI;;;AAGH,wBAAAH,cAAA,CAAA,MAAA,EAAA,EAAM,SAAS,EAAEE,KAAE,CAAC,eAAe,EAAEC,6CAAqB,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,CAAC,KAAK,KAAK,KAAK,CAAC,eAAe,EAAE,EAAA,QAAA,EAChH,IAAI,EAAA,CACA,CACR,IACG,CACP,CAAA,EAAA,CACA,CACJ,EAAA,CACS;AAEhB,CAAC;AAEH,WAAW,CAAC,WAAW,GAAG,aAAa;;"}
@@ -1,4 +1,4 @@
1
- import { type ReactNode, type Ref } from 'react';
1
+ import { type ReactNode } from 'react';
2
2
  import { type RadioProps as AriaRadioProps } from 'react-aria-components';
3
3
  export interface RadioButtonProps extends AriaRadioProps {
4
4
  /** Sets the circle size and the label and hint text size; a parent `RadioGroup`'s `size` overrides it. */
@@ -7,8 +7,6 @@ export interface RadioButtonProps extends AriaRadioProps {
7
7
  label?: ReactNode;
8
8
  /** Supporting text shown below the label. */
9
9
  hint?: ReactNode;
10
- /** Ref forwarded to the underlying `<label>`. */
11
- ref?: Ref<HTMLLabelElement>;
12
10
  /** Overrides the derived `data-testid` (defaults to `<group>--option-<value>`, from the `RadioGroup` it sits in). */
13
11
  'data-testid'?: string;
14
12
  }
@@ -18,8 +16,5 @@ export interface RadioButtonProps extends AriaRadioProps {
18
16
  *
19
17
  * @summary single-select option used within a mutually exclusive group
20
18
  */
21
- export declare const RadioButton: {
22
- ({ label, hint, className, size, "data-testid": dataTestId, ...ariaRadioProps }: RadioButtonProps): import("react").JSX.Element;
23
- displayName: string;
24
- };
19
+ export declare const RadioButton: import("react").ForwardRefExoticComponent<RadioButtonProps & import("react").RefAttributes<HTMLLabelElement>>;
25
20
  //# sourceMappingURL=RadioButton.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"RadioButton.d.ts","sourceRoot":"","sources":["../../../../../src/components/atoms/Radios/RadioButton/RadioButton.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,GAAG,EAAc,MAAM,OAAO,CAAC;AAC7D,OAAO,EAAsB,KAAK,UAAU,IAAI,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAK9F,MAAM,WAAW,gBAAiB,SAAQ,cAAc;IACtD,0GAA0G;IAC1G,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB,oEAAoE;IACpE,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,6CAA6C;IAC7C,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,iDAAiD;IACjD,GAAG,CAAC,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAC;IAC5B,qHAAqH;IACrH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;GAKG;AACH,eAAO,MAAM,WAAW;qFAA2F,gBAAgB;;CA+ClI,CAAC"}
1
+ {"version":3,"file":"RadioButton.d.ts","sourceRoot":"","sources":["../../../../../src/components/atoms/Radios/RadioButton/RadioButton.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAc,KAAK,SAAS,EAAc,MAAM,OAAO,CAAC;AAC/D,OAAO,EAAsB,KAAK,UAAU,IAAI,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAK9F,MAAM,WAAW,gBAAiB,SAAQ,cAAc;IACtD,0GAA0G;IAC1G,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB,oEAAoE;IACpE,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,6CAA6C;IAC7C,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,qHAAqH;IACrH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;GAKG;AACH,eAAO,MAAM,WAAW,+GAoDvB,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
2
  import { cx } from '@flipdish/ui-library/utilities/cx';
3
3
  import { useResolvedTestId, joinTestId, slugifyTestId } from '@flipdish/ui-library/utilities/testIdUtils';
4
- import { useContext } from 'react';
4
+ import { forwardRef, useContext } from 'react';
5
5
  import { Radio } from 'react-aria-components';
6
6
  import { selectionControlSizes } from '../../../__internal__/selectionControl/selectionControl.styles.js';
7
7
  import { RadioGroupContext } from '../providers/RadioGroup.context.js';
@@ -13,16 +13,18 @@ import { RadioButtonBase } from './components/RadioButtonBase.js';
13
13
  *
14
14
  * @summary single-select option used within a mutually exclusive group
15
15
  */
16
- const RadioButton = ({ label, hint, className, size = 'sm', 'data-testid': dataTestId, ...ariaRadioProps }) => {
16
+ const RadioButton = forwardRef(({ label, hint, className, size = 'sm', 'data-testid': dataTestId, ...ariaRadioProps }, ref) => {
17
17
  const context = useContext(RadioGroupContext);
18
18
  size = context?.size ?? size;
19
19
  const fallbackTestId = useResolvedTestId({ testId: dataTestId, segment: 'radio-button', rootName: 'radio-button' });
20
- const radioTestId = !dataTestId && context?.testIdPrefix ? joinTestId(context.testIdPrefix, `option-${slugifyTestId(String(ariaRadioProps.value))}`) : fallbackTestId;
21
- return (jsx(Radio, { ...ariaRadioProps, "data-testid": radioTestId, className: (state) => cx('relative flex items-start', state.isDisabled && 'cursor-not-allowed', selectionControlSizes[size].root, typeof className === 'function' ? className(state) : className), children: ({ isSelected, isDisabled, isFocusVisible }) => (jsxs(Fragment, { children: [jsx(RadioButtonBase, { size: size, isSelected: isSelected, isDisabled: isDisabled, isFocusVisible: isFocusVisible, className: label || hint ? 'mt-0.5' : '' }), (label || hint) && (jsxs("div", { className: cx('inline-flex flex-col', selectionControlSizes[size].textWrapper), children: [label && jsx("p", { className: cx('text-secondary select-none', selectionControlSizes[size].label), children: label }), hint && (
20
+ const radioTestId = !dataTestId && context?.testIdPrefix
21
+ ? joinTestId(context.testIdPrefix, `option-${slugifyTestId(String(ariaRadioProps.value))}`)
22
+ : fallbackTestId;
23
+ return (jsx(Radio, { ...ariaRadioProps, ref: ref, "data-testid": radioTestId, className: (state) => cx('relative flex items-start', state.isDisabled && 'cursor-not-allowed', selectionControlSizes[size].root, typeof className === 'function' ? className(state) : className), children: ({ isSelected, isDisabled, isFocusVisible }) => (jsxs(Fragment, { children: [jsx(RadioButtonBase, { size: size, isSelected: isSelected, isDisabled: isDisabled, isFocusVisible: isFocusVisible, className: label || hint ? 'mt-0.5' : '' }), (label || hint) && (jsxs("div", { className: cx('inline-flex flex-col', selectionControlSizes[size].textWrapper), children: [label && jsx("p", { className: cx('text-secondary select-none', selectionControlSizes[size].label), children: label }), hint && (
22
24
  // biome-ignore lint/a11y/noStaticElementInteractions: This is a hint that is not interactive
23
25
  // biome-ignore lint/a11y/useKeyWithClickEvents: This is a hint that is not interactive
24
26
  jsx("span", { className: cx('text-tertiary', selectionControlSizes[size].hint), onClick: (event) => event.stopPropagation(), children: hint }))] }))] })) }));
25
- };
27
+ });
26
28
  RadioButton.displayName = 'RadioButton';
27
29
 
28
30
  export { RadioButton };
@@ -1 +1 @@
1
- {"version":3,"file":"RadioButton.js","sources":["../../../../../src/components/atoms/Radios/RadioButton/RadioButton.tsx"],"sourcesContent":[null],"names":["_jsx","AriaRadio","_jsxs","_Fragment"],"mappings":";;;;;;;;;AAuBA;;;;;AAKG;AACI,MAAM,WAAW,GAAG,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,GAAG,IAAI,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,cAAc,EAAoB,KAAI;AACrI,IAAA,MAAM,OAAO,GAAG,UAAU,CAAC,iBAAiB,CAAC;AAE7C,IAAA,IAAI,GAAG,OAAO,EAAE,IAAI,IAAI,IAAI;AAE5B,IAAA,MAAM,cAAc,GAAG,iBAAiB,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,cAAc,EAAE,CAAC;AACnH,IAAA,MAAM,WAAW,GACf,CAAC,UAAU,IAAI,OAAO,EAAE,YAAY,GAAG,UAAU,CAAC,OAAO,CAAC,YAAY,EAAE,CAAA,OAAA,EAAU,aAAa,CAAC,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,cAAc;AAEnJ,IAAA,QACEA,GAAA,CAACC,KAAS,EAAA,EAAA,GACJ,cAAc,EAAA,aAAA,EACL,WAAW,EACxB,SAAS,EAAE,CAAC,KAAK,KACf,EAAE,CACA,2BAA2B,EAC3B,KAAK,CAAC,UAAU,IAAI,oBAAoB,EACxC,qBAAqB,CAAC,IAAI,CAAC,CAAC,IAAI,EAChC,OAAO,SAAS,KAAK,UAAU,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,SAAS,CAC/D,YAGF,CAAC,EAAE,UAAU,EAAE,UAAU,EAAE,cAAc,EAAE,MAC1CC,IAAA,CAAAC,QAAA,EAAA,EAAA,QAAA,EAAA,CACEH,GAAA,CAAC,eAAe,EAAA,EACd,IAAI,EAAE,IAAI,EACV,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,UAAU,EACtB,cAAc,EAAE,cAAc,EAC9B,SAAS,EAAE,KAAK,IAAI,IAAI,GAAG,QAAQ,GAAG,EAAE,EAAA,CACxC,EACD,CAAC,KAAK,IAAI,IAAI,MACbE,IAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,EAAE,CAAC,sBAAsB,EAAE,qBAAqB,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC,EAAA,QAAA,EAAA,CAChF,KAAK,IAAIF,WAAG,SAAS,EAAE,EAAE,CAAC,4BAA4B,EAAE,qBAAqB,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,EAAA,QAAA,EAAG,KAAK,EAAA,CAAK,EACvG,IAAI;;;AAGH,wBAAAA,GAAA,CAAA,MAAA,EAAA,EAAM,SAAS,EAAE,EAAE,CAAC,eAAe,EAAE,qBAAqB,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,CAAC,KAAK,KAAK,KAAK,CAAC,eAAe,EAAE,EAAA,QAAA,EAChH,IAAI,EAAA,CACA,CACR,IACG,CACP,CAAA,EAAA,CACA,CACJ,EAAA,CACS;AAEhB;AACA,WAAW,CAAC,WAAW,GAAG,aAAa;;"}
1
+ {"version":3,"file":"RadioButton.js","sources":["../../../../../src/components/atoms/Radios/RadioButton/RadioButton.tsx"],"sourcesContent":[null],"names":["_jsx","AriaRadio","_jsxs","_Fragment"],"mappings":";;;;;;;;;AAqBA;;;;;AAKG;AACI,MAAM,WAAW,GAAG,UAAU,CACnC,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,GAAG,IAAI,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,cAAc,EAAE,EAAE,GAAG,KAAI;AAC7F,IAAA,MAAM,OAAO,GAAG,UAAU,CAAC,iBAAiB,CAAC;AAE7C,IAAA,IAAI,GAAG,OAAO,EAAE,IAAI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qBAAqB,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,EAAA,QAAA,EAAG,KAAK,EAAA,CAAK,EACvG,IAAI;;;AAGH,wBAAAA,GAAA,CAAA,MAAA,EAAA,EAAM,SAAS,EAAE,EAAE,CAAC,eAAe,EAAE,qBAAqB,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,CAAC,KAAK,KAAK,KAAK,CAAC,eAAe,EAAE,EAAA,QAAA,EAChH,IAAI,EAAA,CACA,CACR,IACG,CACP,CAAA,EAAA,CACA,CACJ,EAAA,CACS;AAEhB,CAAC;AAEH,WAAW,CAAC,WAAW,GAAG,aAAa;;"}
@@ -16,12 +16,13 @@ const getStarProgress = (starPosition, rating, maxRating = 5) => {
16
16
  return Math.round(diff * 100);
17
17
  };
18
18
  /** Single star SVG filled to `progress` percent, the building block `RatingStars` repeats. */
19
- const StarIcon = ({ progress = 100, ...props }) => {
19
+ const StarIcon = React.forwardRef(({ progress = 100, ...props }, ref) => {
20
20
  const id = React.useId();
21
21
  return (
22
22
  // biome-ignore lint/a11y/noSvgWithoutTitle: SVG does not need a title
23
- jsxRuntime.jsxs("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", ...props, className: cx.cx('size-5 text-yellow-400', props.className), children: [jsxRuntime.jsx("path", { d: "M9.53834 1.60996C9.70914 1.19932 10.2909 1.19932 10.4617 1.60996L12.5278 6.57744C12.5998 6.75056 12.7626 6.86885 12.9495 6.88383L18.3123 7.31376C18.7556 7.3493 18.9354 7.90256 18.5976 8.19189L14.5117 11.6919C14.3693 11.8139 14.3071 12.0053 14.3506 12.1876L15.5989 17.4208C15.7021 17.8534 15.2315 18.1954 14.8519 17.9635L10.2606 15.1592C10.1006 15.0615 9.89938 15.0615 9.73937 15.1592L5.14806 17.9635C4.76851 18.1954 4.29788 17.8534 4.40108 17.4208L5.64939 12.1876C5.69289 12.0053 5.6307 11.8139 5.48831 11.6919L1.40241 8.19189C1.06464 7.90256 1.24441 7.3493 1.68773 7.31376L7.05054 6.88383C7.23744 6.86885 7.40024 6.75056 7.47225 6.57744L9.53834 1.60996Z", className: "fill-bg-tertiary" }), jsxRuntime.jsx("g", { clipPath: `url(#clip-${id})`, children: jsxRuntime.jsx("path", { d: "M9.53834 1.60996C9.70914 1.19932 10.2909 1.19932 10.4617 1.60996L12.5278 6.57744C12.5998 6.75056 12.7626 6.86885 12.9495 6.88383L18.3123 7.31376C18.7556 7.3493 18.9354 7.90256 18.5976 8.19189L14.5117 11.6919C14.3693 11.8139 14.3071 12.0053 14.3506 12.1876L15.5989 17.4208C15.7021 17.8534 15.2315 18.1954 14.8519 17.9635L10.2606 15.1592C10.1006 15.0615 9.89938 15.0615 9.73937 15.1592L5.14806 17.9635C4.76851 18.1954 4.29788 17.8534 4.40108 17.4208L5.64939 12.1876C5.69289 12.0053 5.6307 11.8139 5.48831 11.6919L1.40241 8.19189C1.06464 7.90256 1.24441 7.3493 1.68773 7.31376L7.05054 6.88383C7.23744 6.86885 7.40024 6.75056 7.47225 6.57744L9.53834 1.60996Z", fill: "currentColor" }) }), jsxRuntime.jsx("defs", { children: jsxRuntime.jsx("clipPath", { id: `clip-${id}`, children: jsxRuntime.jsx("rect", { width: `${progress}%`, height: "20", fill: "white" }) }) })] }));
24
- };
23
+ jsxRuntime.jsxs("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", ...props, ref: ref, className: cx.cx('size-5 text-yellow-400', props.className), children: [jsxRuntime.jsx("path", { d: "M9.53834 1.60996C9.70914 1.19932 10.2909 1.19932 10.4617 1.60996L12.5278 6.57744C12.5998 6.75056 12.7626 6.86885 12.9495 6.88383L18.3123 7.31376C18.7556 7.3493 18.9354 7.90256 18.5976 8.19189L14.5117 11.6919C14.3693 11.8139 14.3071 12.0053 14.3506 12.1876L15.5989 17.4208C15.7021 17.8534 15.2315 18.1954 14.8519 17.9635L10.2606 15.1592C10.1006 15.0615 9.89938 15.0615 9.73937 15.1592L5.14806 17.9635C4.76851 18.1954 4.29788 17.8534 4.40108 17.4208L5.64939 12.1876C5.69289 12.0053 5.6307 11.8139 5.48831 11.6919L1.40241 8.19189C1.06464 7.90256 1.24441 7.3493 1.68773 7.31376L7.05054 6.88383C7.23744 6.86885 7.40024 6.75056 7.47225 6.57744L9.53834 1.60996Z", className: "fill-bg-tertiary" }), jsxRuntime.jsx("g", { clipPath: `url(#clip-${id})`, children: jsxRuntime.jsx("path", { d: "M9.53834 1.60996C9.70914 1.19932 10.2909 1.19932 10.4617 1.60996L12.5278 6.57744C12.5998 6.75056 12.7626 6.86885 12.9495 6.88383L18.3123 7.31376C18.7556 7.3493 18.9354 7.90256 18.5976 8.19189L14.5117 11.6919C14.3693 11.8139 14.3071 12.0053 14.3506 12.1876L15.5989 17.4208C15.7021 17.8534 15.2315 18.1954 14.8519 17.9635L10.2606 15.1592C10.1006 15.0615 9.89938 15.0615 9.73937 15.1592L5.14806 17.9635C4.76851 18.1954 4.29788 17.8534 4.40108 17.4208L5.64939 12.1876C5.69289 12.0053 5.6307 11.8139 5.48831 11.6919L1.40241 8.19189C1.06464 7.90256 1.24441 7.3493 1.68773 7.31376L7.05054 6.88383C7.23744 6.86885 7.40024 6.75056 7.47225 6.57744L9.53834 1.60996Z", fill: "currentColor" }) }), jsxRuntime.jsx("defs", { children: jsxRuntime.jsx("clipPath", { id: `clip-${id}`, children: jsxRuntime.jsx("rect", { width: `${progress}%`, height: "20", fill: "white" }) }) })] }));
24
+ });
25
+ StarIcon.displayName = 'StarIcon';
25
26
  /**
26
27
  * Renders a row of stars filled proportionally to a numeric rating. Fractional values such as
27
28
  * 3.7 partially fill a star, for averaged scores.
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../../../../src/components/atoms/RatingStars/index.tsx"],"sourcesContent":[null],"names":["useId","_jsxs","cx","_jsx","useResolvedTestId","joinTestId"],"mappings":";;;;;;;AAOO,MAAM,eAAe,GAAG,CAAC,YAAoB,EAAE,MAAc,EAAE,SAAA,GAAoB,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OAAO,EAAA,CAAG,GAC/C,EAAA,CACN,CAAA,EAAA,CACH;AAEV;AAqBA;;;;;AAKG;AACI,MAAM,WAAW,GAAG,CAAC,EAAE,MAAM,GAAG,CAAC,EAAE,KAAK,GAAG,CAAC,EAAE,aAAa,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,KAAK,EAAoB,KAAI;AAC7H,IAAA,MAAM,iBAAiB,GAAGC,6BAAiB,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,cAAc,EAAE,CAAC;AAEtH,IAAA,QACED,cAAA,CAAA,KAAA,EAAA,EAAA,GAAS,KAAK,EAAA,aAAA,EAAe,iBAAiB,EAAE,SAAS,EAAED,KAAE,CAAC,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC,YACnF,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,MAC1CC,eAAC;;AAGC,UAAA,EAAA,QAAQ,EAAE,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,EAC/C,SAAS,EAAE,aAAa,EAAA,aAAA,EACXE,sBAAU,CAAC,iBAAiB,EAAE,CAAA,KAAA,EAAQ,KAAK,CAAA,CAAE,CAAC,EAAA,EAHtD,KAAK,CAIV,CACH,CAAC,EAAA,CACE;AAEV;;;;"}
1
+ {"version":3,"file":"index.cjs","sources":["../../../../src/components/atoms/RatingStars/index.tsx"],"sourcesContent":[null],"names":["forwardRef","useId","_jsxs","cx","_jsx","useResolvedTestId","joinTestId"],"mappings":";;;;;;;AAMO,MAAM,eAAe,GAAG,CAAC,YAAoB,EAAE,MAAc,EAAE,SAAA,GAAoB,CAAC,KAAI;;AAE7F,IAAA,MAAM,aAAa,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,SAAS,CAAC;AAE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;AACI,MAAM,WAAW,GAAG,CAAC,EAAE,MAAM,GAAG,CAAC,EAAE,KAAK,GAAG,CAAC,EAAE,aAAa,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,KAAK,EAAoB,KAAI;AAC7H,IAAA,MAAM,iBAAiB,GAAGC,6BAAiB,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,cAAc,EAAE,CAAC;AAEtH,IAAA,QACED,cAAA,CAAA,KAAA,EAAA,EAAA,GAAS,KAAK,EAAA,aAAA,EAAe,iBAAiB,EAAE,SAAS,EAAED,KAAE,CAAC,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC,YACnF,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,MAC1CC,eAAC;;AAGC,UAAA,EAAA,QAAQ,EAAE,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,EAC/C,SAAS,EAAE,aAAa,EAAA,aAAA,EACXE,sBAAU,CAAC,iBAAiB,EAAE,CAAA,KAAA,EAAQ,KAAK,CAAA,CAAE,CAAC,EAAA,EAHtD,KAAK,CAIV,CACH,CAAC,EAAA,CACE;AAEV;;;;"}
@@ -1,6 +1,6 @@
1
- import type { HTMLAttributes, SVGProps } from 'react';
1
+ import { type ComponentPropsWithoutRef, type HTMLAttributes } from 'react';
2
2
  export declare const getStarProgress: (starPosition: number, rating: number, maxRating?: number) => number;
3
- interface StarIconProps extends SVGProps<SVGSVGElement> {
3
+ interface StarIconProps extends ComponentPropsWithoutRef<'svg'> {
4
4
  /**
5
5
  * The progress of the star icon. It should be a number between 0 and 100.
6
6
  *
@@ -11,7 +11,7 @@ interface StarIconProps extends SVGProps<SVGSVGElement> {
11
11
  'data-testid'?: string;
12
12
  }
13
13
  /** Single star SVG filled to `progress` percent, the building block `RatingStars` repeats. */
14
- export declare const StarIcon: ({ progress, ...props }: StarIconProps) => import("react").JSX.Element;
14
+ export declare const StarIcon: import("react").ForwardRefExoticComponent<StarIconProps & import("react").RefAttributes<SVGSVGElement>>;
15
15
  export interface RatingStarsProps extends HTMLAttributes<HTMLDivElement> {
16
16
  /**
17
17
  * The rating to display.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/RatingStars/index.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGtD,eAAO,MAAM,eAAe,GAAI,cAAc,MAAM,EAAE,QAAQ,MAAM,EAAE,YAAW,MAAU,WAU1F,CAAC;AAEF,UAAU,aAAc,SAAQ,QAAQ,CAAC,aAAa,CAAC;IACrD;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gDAAgD;IAChD,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,8FAA8F;AAC9F,eAAO,MAAM,QAAQ,GAAI,wBAA8B,aAAa,gCAuBnE,CAAC;AAEF,MAAM,WAAW,gBAAiB,SAAQ,cAAc,CAAC,cAAc,CAAC;IACtE;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,+GAA+G;IAC/G,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;GAKG;AACH,eAAO,MAAM,WAAW,GAAI,uEAA+E,gBAAgB,gCAgB1H,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/RatingStars/index.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,wBAAwB,EAAc,KAAK,cAAc,EAAS,MAAM,OAAO,CAAC;AAE9F,eAAO,MAAM,eAAe,GAAI,cAAc,MAAM,EAAE,QAAQ,MAAM,EAAE,YAAW,MAAU,WAU1F,CAAC;AAEF,UAAU,aAAc,SAAQ,wBAAwB,CAAC,KAAK,CAAC;IAC7D;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gDAAgD;IAChD,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,8FAA8F;AAC9F,eAAO,MAAM,QAAQ,yGAuBnB,CAAC;AAGH,MAAM,WAAW,gBAAiB,SAAQ,cAAc,CAAC,cAAc,CAAC;IACtE;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,+GAA+G;IAC/G,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;GAKG;AACH,eAAO,MAAM,WAAW,GAAI,uEAA+E,gBAAgB,gCAgB1H,CAAC"}
@@ -1,7 +1,7 @@
1
- import { jsx, jsxs } from 'react/jsx-runtime';
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
2
  import { cx } from '@flipdish/ui-library/utilities/cx';
3
3
  import { useResolvedTestId, joinTestId } from '@flipdish/ui-library/utilities/testIdUtils';
4
- import { useId } from 'react';
4
+ import { forwardRef, useId } from 'react';
5
5
 
6
6
  const getStarProgress = (starPosition, rating, maxRating = 5) => {
7
7
  // Ensure rating is between 0 and 5
@@ -14,12 +14,13 @@ const getStarProgress = (starPosition, rating, maxRating = 5) => {
14
14
  return Math.round(diff * 100);
15
15
  };
16
16
  /** Single star SVG filled to `progress` percent, the building block `RatingStars` repeats. */
17
- const StarIcon = ({ progress = 100, ...props }) => {
17
+ const StarIcon = forwardRef(({ progress = 100, ...props }, ref) => {
18
18
  const id = useId();
19
19
  return (
20
20
  // biome-ignore lint/a11y/noSvgWithoutTitle: SVG does not need a title
21
- jsxs("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", ...props, className: cx('size-5 text-yellow-400', props.className), children: [jsx("path", { d: "M9.53834 1.60996C9.70914 1.19932 10.2909 1.19932 10.4617 1.60996L12.5278 6.57744C12.5998 6.75056 12.7626 6.86885 12.9495 6.88383L18.3123 7.31376C18.7556 7.3493 18.9354 7.90256 18.5976 8.19189L14.5117 11.6919C14.3693 11.8139 14.3071 12.0053 14.3506 12.1876L15.5989 17.4208C15.7021 17.8534 15.2315 18.1954 14.8519 17.9635L10.2606 15.1592C10.1006 15.0615 9.89938 15.0615 9.73937 15.1592L5.14806 17.9635C4.76851 18.1954 4.29788 17.8534 4.40108 17.4208L5.64939 12.1876C5.69289 12.0053 5.6307 11.8139 5.48831 11.6919L1.40241 8.19189C1.06464 7.90256 1.24441 7.3493 1.68773 7.31376L7.05054 6.88383C7.23744 6.86885 7.40024 6.75056 7.47225 6.57744L9.53834 1.60996Z", className: "fill-bg-tertiary" }), jsx("g", { clipPath: `url(#clip-${id})`, children: jsx("path", { d: "M9.53834 1.60996C9.70914 1.19932 10.2909 1.19932 10.4617 1.60996L12.5278 6.57744C12.5998 6.75056 12.7626 6.86885 12.9495 6.88383L18.3123 7.31376C18.7556 7.3493 18.9354 7.90256 18.5976 8.19189L14.5117 11.6919C14.3693 11.8139 14.3071 12.0053 14.3506 12.1876L15.5989 17.4208C15.7021 17.8534 15.2315 18.1954 14.8519 17.9635L10.2606 15.1592C10.1006 15.0615 9.89938 15.0615 9.73937 15.1592L5.14806 17.9635C4.76851 18.1954 4.29788 17.8534 4.40108 17.4208L5.64939 12.1876C5.69289 12.0053 5.6307 11.8139 5.48831 11.6919L1.40241 8.19189C1.06464 7.90256 1.24441 7.3493 1.68773 7.31376L7.05054 6.88383C7.23744 6.86885 7.40024 6.75056 7.47225 6.57744L9.53834 1.60996Z", fill: "currentColor" }) }), jsx("defs", { children: jsx("clipPath", { id: `clip-${id}`, children: jsx("rect", { width: `${progress}%`, height: "20", fill: "white" }) }) })] }));
22
- };
21
+ jsxs("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", ...props, ref: ref, className: cx('size-5 text-yellow-400', props.className), children: [jsx("path", { d: "M9.53834 1.60996C9.70914 1.19932 10.2909 1.19932 10.4617 1.60996L12.5278 6.57744C12.5998 6.75056 12.7626 6.86885 12.9495 6.88383L18.3123 7.31376C18.7556 7.3493 18.9354 7.90256 18.5976 8.19189L14.5117 11.6919C14.3693 11.8139 14.3071 12.0053 14.3506 12.1876L15.5989 17.4208C15.7021 17.8534 15.2315 18.1954 14.8519 17.9635L10.2606 15.1592C10.1006 15.0615 9.89938 15.0615 9.73937 15.1592L5.14806 17.9635C4.76851 18.1954 4.29788 17.8534 4.40108 17.4208L5.64939 12.1876C5.69289 12.0053 5.6307 11.8139 5.48831 11.6919L1.40241 8.19189C1.06464 7.90256 1.24441 7.3493 1.68773 7.31376L7.05054 6.88383C7.23744 6.86885 7.40024 6.75056 7.47225 6.57744L9.53834 1.60996Z", className: "fill-bg-tertiary" }), jsx("g", { clipPath: `url(#clip-${id})`, children: jsx("path", { d: "M9.53834 1.60996C9.70914 1.19932 10.2909 1.19932 10.4617 1.60996L12.5278 6.57744C12.5998 6.75056 12.7626 6.86885 12.9495 6.88383L18.3123 7.31376C18.7556 7.3493 18.9354 7.90256 18.5976 8.19189L14.5117 11.6919C14.3693 11.8139 14.3071 12.0053 14.3506 12.1876L15.5989 17.4208C15.7021 17.8534 15.2315 18.1954 14.8519 17.9635L10.2606 15.1592C10.1006 15.0615 9.89938 15.0615 9.73937 15.1592L5.14806 17.9635C4.76851 18.1954 4.29788 17.8534 4.40108 17.4208L5.64939 12.1876C5.69289 12.0053 5.6307 11.8139 5.48831 11.6919L1.40241 8.19189C1.06464 7.90256 1.24441 7.3493 1.68773 7.31376L7.05054 6.88383C7.23744 6.86885 7.40024 6.75056 7.47225 6.57744L9.53834 1.60996Z", fill: "currentColor" }) }), jsx("defs", { children: jsx("clipPath", { id: `clip-${id}`, children: jsx("rect", { width: `${progress}%`, height: "20", fill: "white" }) }) })] }));
22
+ });
23
+ StarIcon.displayName = 'StarIcon';
23
24
  /**
24
25
  * Renders a row of stars filled proportionally to a numeric rating. Fractional values such as
25
26
  * 3.7 partially fill a star, for averaged scores.
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/components/atoms/RatingStars/index.tsx"],"sourcesContent":[null],"names":["_jsxs","_jsx"],"mappings":";;;;;AAOO,MAAM,eAAe,GAAG,CAAC,YAAoB,EAAE,MAAc,EAAE,SAAA,GAAoB,CAAC,KAAI;;AAE7F,IAAA,MAAM,aAAa,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,SAAS,CAAC;AAE9D,IAAA,MAAM,IAAI,GAAG,aAAa,GAAG,YAAY;IAEzC,IAAI,IAAI,IAAI,CAAC;AAAE,QAAA,OAAO,GAAG;IACzB,IAAI,IAAI,IAAI,CAAC;AAAE,QAAA,OAAO,CAAC;IAEvB,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,GAAG,CAAC;AAC/B;AAaA;AACO,MAAM,QAAQ,GAAG,CAAC,EAAE,QAAQ,GAAG,GAAG,EAAE,GAAG,KAAK,EAAiB,KAAI;AACtE,IAAA,MAAM,EAAE,GAAG,KAAK,EAAE;IAElB;;AAEE,IAAAA,IAAA,CAAA,KAAA,EAAA,EAAK,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,MAAM,EAAA,GAAK,KAAK,EAAE,SAAS,EAAE,EAAE,CAAC,wBAAwB,EAAE,KAAK,CAAC,SAAS,CAAC,aAC7HC,GAAA,CAAA,MAAA,EAAA,EACE,CAAC,EAAC,gpBAAgpB,EAClpB,SAAS,EAAC,kBAAkB,EAAA,CAC5B,EACFA,WAAG,QAAQ,EAAE,CAAA,UAAA,EAAa,EAAE,GAAG,EAAA,QAAA,EAC7BA,GAAA,CAAA,MAAA,EAAA,EACE,CAAC,EAA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AAA,CAAE,EAAA,QAAA,EACxBA,cAAM,KAAK,EAAE,GAAG,QAAQ,CAAA,CAAA,CAAG,EAAE,MAAM,EAAC,IAAI,EAAC,IAAI,EAAC,OAAO,EAAA,CAAG,GAC/C,EAAA,CACN,CAAA,EAAA,CACH;AAEV,CAAC;AACD,QAAQ,CAAC,WAAW,GAAG,UAAU;AAqBjC;;;;;AAKG;AACI,MAAM,WAAW,GAAG,CAAC,EAAE,MAAM,GAAG,CAAC,EAAE,KAAK,GAAG,CAAC,EAAE,aAAa,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,KAAK,EAAoB,KAAI;AAC7H,IAAA,MAAM,iBAAiB,GAAG,iBAAiB,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,cAAc,EAAE,CAAC;AAEtH,IAAA,QACEA,GAAA,CAAA,KAAA,EAAA,EAAA,GAAS,KAAK,EAAA,aAAA,EAAe,iBAAiB,EAAE,SAAS,EAAE,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC,YACnF,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,MAC1CA,IAAC;;AAGC,UAAA,EAAA,QAAQ,EAAE,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,EAC/C,SAAS,EAAE,aAAa,EAAA,aAAA,EACX,UAAU,CAAC,iBAAiB,EAAE,CAAA,KAAA,EAAQ,KAAK,CAAA,CAAE,CAAC,EAAA,EAHtD,KAAK,CAIV,CACH,CAAC,EAAA,CACE;AAEV;;"}
@@ -1,9 +1,6 @@
1
1
  import { type SearchInputProps as SearchInputPropsNext } from '@flipdish/ui-library/components/atoms/Inputs';
2
2
  /** @deprecated Import from `@flipdish/ui-library/components/atoms/Inputs`. Removed in the next major. */
3
- export declare const SearchInput: {
4
- ({ label, hint, placeholder, size, clearLabel, isLoading, debounce, shortcut, className, wrapperClassName, inputClassName, ref, "data-testid": dataTestId, ...props }: SearchInputPropsNext): import("react").JSX.Element;
5
- displayName: string;
6
- };
3
+ export declare const SearchInput: import("react").ForwardRefExoticComponent<SearchInputPropsNext & import("react").RefAttributes<HTMLInputElement>>;
7
4
  /** @deprecated Import from `@flipdish/ui-library/components/atoms/Inputs`. Removed in the next major. */
8
5
  export type SearchInputProps = SearchInputPropsNext;
9
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/SearchInput/index.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAkC,KAAK,gBAAgB,IAAI,oBAAoB,EAAE,MAAM,8CAA8C,CAAC;AAE7I,yGAAyG;AACzG,eAAO,MAAM,WAAW;;;CAAkB,CAAC;AAC3C,yGAAyG;AACzG,MAAM,MAAM,gBAAgB,GAAG,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/SearchInput/index.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAkC,KAAK,gBAAgB,IAAI,oBAAoB,EAAE,MAAM,8CAA8C,CAAC;AAE7I,yGAAyG;AACzG,eAAO,MAAM,WAAW,mHAAkB,CAAC;AAC3C,yGAAyG;AACzG,MAAM,MAAM,gBAAgB,GAAG,oBAAoB,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { type SocialButtonProps as SocialButtonPropsNext } from '@flipdish/ui-library/components/atoms/BrandButtons';
2
2
  /** @deprecated Import from `@flipdish/ui-library/components/atoms/BrandButtons`. Removed in the next major. */
3
- export declare const SocialButton: ({ size, theme, social, className, children, disabled, "data-testid": dataTestId, ...otherProps }: SocialButtonPropsNext) => import("react").JSX.Element;
3
+ export declare const SocialButton: import("react").ForwardRefExoticComponent<SocialButtonPropsNext & import("react").RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
4
4
  /** @deprecated Import from `@flipdish/ui-library/components/atoms/BrandButtons`. Removed in the next major. */
5
5
  export type SocialButtonProps = SocialButtonPropsNext;
6
6
  /** @deprecated Internal to `SocialButton` and not exported from `atoms/BrandButtons`. Removed in the next major. */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/SocialButton/index.tsx"],"names":[],"mappings":"AAIA,OAAO,EAEL,KAAK,iBAAiB,IAAI,qBAAqB,EAChD,MAAM,oDAAoD,CAAC;AAI5D,+GAA+G;AAC/G,eAAO,MAAM,YAAY,0JAAmB,CAAC;AAC7C,+GAA+G;AAC/G,MAAM,MAAM,iBAAiB,GAAG,qBAAqB,CAAC;AACtD,oHAAoH;AACpH,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/SocialButton/index.tsx"],"names":[],"mappings":"AAIA,OAAO,EAEL,KAAK,iBAAiB,IAAI,qBAAqB,EAChD,MAAM,oDAAoD,CAAC;AAI5D,+GAA+G;AAC/G,eAAO,MAAM,YAAY,yIAAmB,CAAC;AAC7C,+GAA+G;AAC/G,MAAM,MAAM,iBAAiB,GAAG,qBAAqB,CAAC;AACtD,oHAAoH;AACpH,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAa,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../../../../src/components/atoms/UtilityButton/index.tsx"],"sourcesContent":[null],"names":["IconButtonNext","stylesNext"],"mappings":";;;;;AAcA;AACO,MAAM,aAAa,GAAGA;AAO7B;AACO,MAAM,MAAM,GAAsBC;;;"}
1
+ {"version":3,"file":"index.cjs","sources":["../../../../src/components/atoms/UtilityButton/index.tsx"],"sourcesContent":[null],"names":["IconButtonNext","stylesNext"],"mappings":";;;;;AAeA;AACO,MAAM,aAAa,GAAGA;AAS7B;AACO,MAAM,MAAM,GAAsBC;;;"}