@pega/cosmos-react-core 2.0.0-dev.9.4 → 2.0.0-rc.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (865) hide show
  1. package/README.md +3 -3
  2. package/lib/components/Actions/Actions.js +1 -1
  3. package/lib/components/Actions/Actions.js.map +1 -1
  4. package/lib/components/AppShell/AppHeader.d.ts.map +1 -1
  5. package/lib/components/AppShell/AppHeader.js +1 -6
  6. package/lib/components/AppShell/AppHeader.js.map +1 -1
  7. package/lib/components/AppShell/AppShell.d.ts.map +1 -1
  8. package/lib/components/AppShell/AppShell.js +88 -63
  9. package/lib/components/AppShell/AppShell.js.map +1 -1
  10. package/lib/components/AppShell/AppShell.styles.d.ts +19 -16
  11. package/lib/components/AppShell/AppShell.styles.d.ts.map +1 -1
  12. package/lib/components/AppShell/AppShell.styles.js +227 -173
  13. package/lib/components/AppShell/AppShell.styles.js.map +1 -1
  14. package/lib/components/AppShell/AppShell.types.d.ts +7 -7
  15. package/lib/components/AppShell/AppShell.types.d.ts.map +1 -1
  16. package/lib/components/AppShell/AppShell.types.js.map +1 -1
  17. package/lib/components/AppShell/AppShellContext.d.ts +3 -0
  18. package/lib/components/AppShell/AppShellContext.d.ts.map +1 -1
  19. package/lib/components/AppShell/AppShellContext.js +9 -1
  20. package/lib/components/AppShell/AppShellContext.js.map +1 -1
  21. package/lib/components/AppShell/AppShellList.d.ts +4 -3
  22. package/lib/components/AppShell/AppShellList.d.ts.map +1 -1
  23. package/lib/components/AppShell/AppShellList.js +24 -19
  24. package/lib/components/AppShell/AppShellList.js.map +1 -1
  25. package/lib/components/AppShell/Drawer.d.ts.map +1 -1
  26. package/lib/components/AppShell/Drawer.js +7 -8
  27. package/lib/components/AppShell/Drawer.js.map +1 -1
  28. package/lib/components/AppShell/Operator.js +3 -5
  29. package/lib/components/AppShell/Operator.js.map +1 -1
  30. package/lib/components/AppShell/SkipNavigation.d.ts.map +1 -1
  31. package/lib/components/AppShell/SkipNavigation.js +30 -39
  32. package/lib/components/AppShell/SkipNavigation.js.map +1 -1
  33. package/lib/components/AppShell/index.d.ts +1 -0
  34. package/lib/components/AppShell/index.d.ts.map +1 -1
  35. package/lib/components/AppShell/index.js +1 -0
  36. package/lib/components/AppShell/index.js.map +1 -1
  37. package/lib/components/Avatar/Avatar.d.ts.map +1 -1
  38. package/lib/components/Avatar/Avatar.js +5 -4
  39. package/lib/components/Avatar/Avatar.js.map +1 -1
  40. package/lib/components/Backdrop/Backdrop.d.ts +1 -1
  41. package/lib/components/Backdrop/Backdrop.d.ts.map +1 -1
  42. package/lib/components/Backdrop/Backdrop.js +7 -6
  43. package/lib/components/Backdrop/Backdrop.js.map +1 -1
  44. package/lib/components/Backdrop/index.d.ts +1 -2
  45. package/lib/components/Backdrop/index.d.ts.map +1 -1
  46. package/lib/components/Backdrop/index.js +1 -2
  47. package/lib/components/Backdrop/index.js.map +1 -1
  48. package/lib/components/Badges/Alert.d.ts +2 -2
  49. package/lib/components/Badges/Alert.d.ts.map +1 -1
  50. package/lib/components/Badges/Alert.js +1 -1
  51. package/lib/components/Badges/Alert.js.map +1 -1
  52. package/lib/components/Badges/Count.js +1 -1
  53. package/lib/components/Badges/Count.js.map +1 -1
  54. package/lib/components/Badges/Selection.d.ts.map +1 -1
  55. package/lib/components/Badges/Selection.js +10 -9
  56. package/lib/components/Badges/Selection.js.map +1 -1
  57. package/lib/components/Badges/Status.d.ts +2 -2
  58. package/lib/components/Badges/Status.d.ts.map +1 -1
  59. package/lib/components/Badges/Status.js +1 -1
  60. package/lib/components/Badges/Status.js.map +1 -1
  61. package/lib/components/Badges/Tag.js +1 -1
  62. package/lib/components/Badges/Tag.js.map +1 -1
  63. package/lib/components/Banner/Banner.d.ts +2 -2
  64. package/lib/components/Banner/Banner.d.ts.map +1 -1
  65. package/lib/components/Banner/Banner.js +6 -8
  66. package/lib/components/Banner/Banner.js.map +1 -1
  67. package/lib/components/Boolean/BooleanDisplay.d.ts +2 -2
  68. package/lib/components/Boolean/BooleanDisplay.d.ts.map +1 -1
  69. package/lib/components/Boolean/BooleanDisplay.js +1 -2
  70. package/lib/components/Boolean/BooleanDisplay.js.map +1 -1
  71. package/lib/components/Breadcrumbs/Breadcrumbs.d.ts +2 -2
  72. package/lib/components/Breadcrumbs/Breadcrumbs.d.ts.map +1 -1
  73. package/lib/components/Breadcrumbs/Breadcrumbs.js +13 -11
  74. package/lib/components/Breadcrumbs/Breadcrumbs.js.map +1 -1
  75. package/lib/components/Button/BareButton.d.ts.map +1 -1
  76. package/lib/components/Button/BareButton.js +21 -2
  77. package/lib/components/Button/BareButton.js.map +1 -1
  78. package/lib/components/Button/BareRoleButton.d.ts +12 -0
  79. package/lib/components/Button/BareRoleButton.d.ts.map +1 -0
  80. package/lib/components/Button/BareRoleButton.js +20 -0
  81. package/lib/components/Button/BareRoleButton.js.map +1 -0
  82. package/lib/components/Button/Button.d.ts +5 -0
  83. package/lib/components/Button/Button.d.ts.map +1 -1
  84. package/lib/components/Button/Button.js +34 -10
  85. package/lib/components/Button/Button.js.map +1 -1
  86. package/lib/components/Card/Card.d.ts.map +1 -1
  87. package/lib/components/Card/Card.js +3 -2
  88. package/lib/components/Card/Card.js.map +1 -1
  89. package/lib/components/Card/CardContent.d.ts.map +1 -1
  90. package/lib/components/Card/CardContent.js +5 -4
  91. package/lib/components/Card/CardContent.js.map +1 -1
  92. package/lib/components/Card/CardFooter.d.ts.map +1 -1
  93. package/lib/components/Card/CardFooter.js +5 -4
  94. package/lib/components/Card/CardFooter.js.map +1 -1
  95. package/lib/components/Card/CardHeader.d.ts +3 -1
  96. package/lib/components/Card/CardHeader.d.ts.map +1 -1
  97. package/lib/components/Card/CardHeader.js +9 -7
  98. package/lib/components/Card/CardHeader.js.map +1 -1
  99. package/lib/components/Card/CardMedia.js +1 -1
  100. package/lib/components/Card/CardMedia.js.map +1 -1
  101. package/lib/components/Card/CollapsibleCard.d.ts.map +1 -1
  102. package/lib/components/Card/CollapsibleCard.js +5 -7
  103. package/lib/components/Card/CollapsibleCard.js.map +1 -1
  104. package/lib/components/Card/SelectableCard.js +1 -1
  105. package/lib/components/Card/SelectableCard.js.map +1 -1
  106. package/lib/components/Checkbox/Checkbox.d.ts +2 -2
  107. package/lib/components/Checkbox/Checkbox.d.ts.map +1 -1
  108. package/lib/components/Checkbox/Checkbox.js +1 -1
  109. package/lib/components/Checkbox/Checkbox.js.map +1 -1
  110. package/lib/components/ColorPicker/ColorPicker.d.ts +2 -2
  111. package/lib/components/ColorPicker/ColorPicker.d.ts.map +1 -1
  112. package/lib/components/ColorPicker/ColorPicker.js +8 -11
  113. package/lib/components/ColorPicker/ColorPicker.js.map +1 -1
  114. package/lib/components/ComboBox/ComboBox.d.ts +1 -1
  115. package/lib/components/ComboBox/ComboBox.d.ts.map +1 -1
  116. package/lib/components/ComboBox/ComboBox.js +43 -63
  117. package/lib/components/ComboBox/ComboBox.js.map +1 -1
  118. package/lib/components/ComboBox/ComboBox.types.d.ts +2 -1
  119. package/lib/components/ComboBox/ComboBox.types.d.ts.map +1 -1
  120. package/lib/components/ComboBox/ComboBox.types.js.map +1 -1
  121. package/lib/components/ComboBox/ComboBoxInput.js +4 -4
  122. package/lib/components/ComboBox/ComboBoxInput.js.map +1 -1
  123. package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.d.ts.map +1 -1
  124. package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.js +23 -29
  125. package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.js.map +1 -1
  126. package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.d.ts.map +1 -1
  127. package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.js +16 -12
  128. package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.js.map +1 -1
  129. package/lib/components/Configuration/Configuration.js +11 -13
  130. package/lib/components/Configuration/Configuration.js.map +1 -1
  131. package/lib/components/Currency/CurrencyDisplay.d.ts +6 -2
  132. package/lib/components/Currency/CurrencyDisplay.d.ts.map +1 -1
  133. package/lib/components/Currency/CurrencyDisplay.js +11 -7
  134. package/lib/components/Currency/CurrencyDisplay.js.map +1 -1
  135. package/lib/components/Currency/CurrencyInput.d.ts.map +1 -1
  136. package/lib/components/Currency/CurrencyInput.js +16 -16
  137. package/lib/components/Currency/CurrencyInput.js.map +1 -1
  138. package/lib/components/Currency/CurrencyInput.types.d.ts +6 -2
  139. package/lib/components/Currency/CurrencyInput.types.d.ts.map +1 -1
  140. package/lib/components/Currency/CurrencyInput.types.js.map +1 -1
  141. package/lib/components/Currency/utils.d.ts +12 -1
  142. package/lib/components/Currency/utils.d.ts.map +1 -1
  143. package/lib/components/Currency/utils.js +30 -2
  144. package/lib/components/Currency/utils.js.map +1 -1
  145. package/lib/components/DateTime/DateTime.types.d.ts +2 -1
  146. package/lib/components/DateTime/DateTime.types.d.ts.map +1 -1
  147. package/lib/components/DateTime/DateTime.types.js.map +1 -1
  148. package/lib/components/DateTime/DateTimeDisplay.d.ts +1 -1
  149. package/lib/components/DateTime/DateTimeDisplay.d.ts.map +1 -1
  150. package/lib/components/DateTime/DateTimeDisplay.js +10 -2
  151. package/lib/components/DateTime/DateTimeDisplay.js.map +1 -1
  152. package/lib/components/DateTime/DurationDisplay.d.ts.map +1 -1
  153. package/lib/components/DateTime/DurationDisplay.js +11 -6
  154. package/lib/components/DateTime/DurationDisplay.js.map +1 -1
  155. package/lib/components/DateTime/Input/DateInput.d.ts.map +1 -1
  156. package/lib/components/DateTime/Input/DateInput.js +26 -28
  157. package/lib/components/DateTime/Input/DateInput.js.map +1 -1
  158. package/lib/components/DateTime/Input/DateRangeInput.d.ts.map +1 -1
  159. package/lib/components/DateTime/Input/DateRangeInput.js +10 -16
  160. package/lib/components/DateTime/Input/DateRangeInput.js.map +1 -1
  161. package/lib/components/DateTime/Input/DateTime.styles.d.ts.map +1 -1
  162. package/lib/components/DateTime/Input/DateTime.styles.js +14 -3
  163. package/lib/components/DateTime/Input/DateTime.styles.js.map +1 -1
  164. package/lib/components/DateTime/Input/DateTimeInput.d.ts.map +1 -1
  165. package/lib/components/DateTime/Input/DateTimeInput.js +37 -44
  166. package/lib/components/DateTime/Input/DateTimeInput.js.map +1 -1
  167. package/lib/components/DateTime/Input/DayOfWeekInput.d.ts +2 -0
  168. package/lib/components/DateTime/Input/DayOfWeekInput.d.ts.map +1 -1
  169. package/lib/components/DateTime/Input/DayOfWeekInput.js +7 -5
  170. package/lib/components/DateTime/Input/DayOfWeekInput.js.map +1 -1
  171. package/lib/components/DateTime/Input/Duration/DurationInput.d.ts.map +1 -1
  172. package/lib/components/DateTime/Input/Duration/DurationInput.js +3 -3
  173. package/lib/components/DateTime/Input/Duration/DurationInput.js.map +1 -1
  174. package/lib/components/DateTime/Input/Duration/NumberUnit.js +4 -5
  175. package/lib/components/DateTime/Input/Duration/NumberUnit.js.map +1 -1
  176. package/lib/components/DateTime/Input/Duration/Time.d.ts.map +1 -1
  177. package/lib/components/DateTime/Input/Duration/Time.js +12 -15
  178. package/lib/components/DateTime/Input/Duration/Time.js.map +1 -1
  179. package/lib/components/DateTime/Input/MonthInput.js +12 -16
  180. package/lib/components/DateTime/Input/MonthInput.js.map +1 -1
  181. package/lib/components/DateTime/Input/PartInput.js +3 -4
  182. package/lib/components/DateTime/Input/PartInput.js.map +1 -1
  183. package/lib/components/DateTime/Input/QuarterInput.d.ts +9 -0
  184. package/lib/components/DateTime/Input/QuarterInput.d.ts.map +1 -0
  185. package/lib/components/DateTime/Input/QuarterInput.js +102 -0
  186. package/lib/components/DateTime/Input/QuarterInput.js.map +1 -0
  187. package/lib/components/DateTime/Input/TimeInput.d.ts.map +1 -1
  188. package/lib/components/DateTime/Input/TimeInput.js +29 -39
  189. package/lib/components/DateTime/Input/TimeInput.js.map +1 -1
  190. package/lib/components/DateTime/Input/WeekInput.d.ts.map +1 -1
  191. package/lib/components/DateTime/Input/WeekInput.js +23 -24
  192. package/lib/components/DateTime/Input/WeekInput.js.map +1 -1
  193. package/lib/components/DateTime/Input/useAutoFocusNextInput.d.ts.map +1 -1
  194. package/lib/components/DateTime/Input/useAutoFocusNextInput.js +8 -9
  195. package/lib/components/DateTime/Input/useAutoFocusNextInput.js.map +1 -1
  196. package/lib/components/DateTime/Input/usePickerButton.js +4 -4
  197. package/lib/components/DateTime/Input/usePickerButton.js.map +1 -1
  198. package/lib/components/DateTime/Input/utils.d.ts +7 -0
  199. package/lib/components/DateTime/Input/utils.d.ts.map +1 -1
  200. package/lib/components/DateTime/Input/utils.js +52 -10
  201. package/lib/components/DateTime/Input/utils.js.map +1 -1
  202. package/lib/components/DateTime/Picker/Calendar.d.ts.map +1 -1
  203. package/lib/components/DateTime/Picker/Calendar.js +32 -34
  204. package/lib/components/DateTime/Picker/Calendar.js.map +1 -1
  205. package/lib/components/DateTime/Picker/Calendar.styles.d.ts +2 -2
  206. package/lib/components/DateTime/Picker/Calendar.styles.d.ts.map +1 -1
  207. package/lib/components/DateTime/Picker/Calendar.styles.js +16 -7
  208. package/lib/components/DateTime/Picker/Calendar.styles.js.map +1 -1
  209. package/lib/components/DateTime/Picker/DatePicker.d.ts.map +1 -1
  210. package/lib/components/DateTime/Picker/DatePicker.js +13 -17
  211. package/lib/components/DateTime/Picker/DatePicker.js.map +1 -1
  212. package/lib/components/DateTime/Picker/DateRangePicker.d.ts.map +1 -1
  213. package/lib/components/DateTime/Picker/DateRangePicker.js +13 -17
  214. package/lib/components/DateTime/Picker/DateRangePicker.js.map +1 -1
  215. package/lib/components/DateTime/Picker/TimePicker.js +9 -10
  216. package/lib/components/DateTime/Picker/TimePicker.js.map +1 -1
  217. package/lib/components/DateTime/Picker/Weeks.js +9 -11
  218. package/lib/components/DateTime/Picker/Weeks.js.map +1 -1
  219. package/lib/components/DateTime/Picker/utils.d.ts +1 -0
  220. package/lib/components/DateTime/Picker/utils.d.ts.map +1 -1
  221. package/lib/components/DateTime/Picker/utils.js +3 -0
  222. package/lib/components/DateTime/Picker/utils.js.map +1 -1
  223. package/lib/components/DateTime/index.d.ts +3 -0
  224. package/lib/components/DateTime/index.d.ts.map +1 -1
  225. package/lib/components/DateTime/index.js +2 -0
  226. package/lib/components/DateTime/index.js.map +1 -1
  227. package/lib/components/Drawer/Drawer.d.ts.map +1 -1
  228. package/lib/components/Drawer/Drawer.js +10 -7
  229. package/lib/components/Drawer/Drawer.js.map +1 -1
  230. package/lib/components/Email/EmailDisplay.d.ts +2 -2
  231. package/lib/components/Email/EmailDisplay.d.ts.map +1 -1
  232. package/lib/components/Email/EmailDisplay.js +2 -2
  233. package/lib/components/Email/EmailDisplay.js.map +1 -1
  234. package/lib/components/EmojiPicker/EmojiDisplay.d.ts.map +1 -1
  235. package/lib/components/EmojiPicker/EmojiDisplay.js +1 -1
  236. package/lib/components/EmojiPicker/EmojiDisplay.js.map +1 -1
  237. package/lib/components/EmojiPicker/EmojiPicker.js +3 -4
  238. package/lib/components/EmojiPicker/EmojiPicker.js.map +1 -1
  239. package/lib/components/EmptyState/EmptyState.d.ts +14 -0
  240. package/lib/components/EmptyState/EmptyState.d.ts.map +1 -0
  241. package/lib/components/{NoItems/NoItems.js → EmptyState/EmptyState.js} +11 -8
  242. package/lib/components/EmptyState/EmptyState.js.map +1 -0
  243. package/lib/components/EmptyState/index.d.ts +4 -0
  244. package/lib/components/EmptyState/index.d.ts.map +1 -0
  245. package/lib/components/EmptyState/index.js +3 -0
  246. package/lib/components/EmptyState/index.js.map +1 -0
  247. package/lib/components/ErrorState/ErrorState.d.ts +16 -0
  248. package/lib/components/ErrorState/ErrorState.d.ts.map +1 -0
  249. package/lib/components/ErrorState/ErrorState.js +31 -0
  250. package/lib/components/ErrorState/ErrorState.js.map +1 -0
  251. package/lib/components/ErrorState/index.d.ts +4 -0
  252. package/lib/components/ErrorState/index.d.ts.map +1 -0
  253. package/lib/components/ErrorState/index.js +3 -0
  254. package/lib/components/ErrorState/index.js.map +1 -0
  255. package/lib/components/ExpandCollapse/ExpandCollapse.js +6 -6
  256. package/lib/components/ExpandCollapse/ExpandCollapse.js.map +1 -1
  257. package/lib/components/FieldGroup/FieldGroup.d.ts.map +1 -1
  258. package/lib/components/FieldGroup/FieldGroup.js +6 -7
  259. package/lib/components/FieldGroup/FieldGroup.js.map +1 -1
  260. package/lib/components/FieldGroup/FieldGroupList.d.ts +1 -1
  261. package/lib/components/FieldGroup/FieldGroupList.d.ts.map +1 -1
  262. package/lib/components/FieldGroup/FieldGroupList.js +8 -7
  263. package/lib/components/FieldGroup/FieldGroupList.js.map +1 -1
  264. package/lib/components/FieldGroup/index.d.ts +1 -0
  265. package/lib/components/FieldGroup/index.d.ts.map +1 -1
  266. package/lib/components/FieldGroup/index.js +1 -0
  267. package/lib/components/FieldGroup/index.js.map +1 -1
  268. package/lib/components/FieldValueList/FieldValueList.d.ts +2 -2
  269. package/lib/components/FieldValueList/FieldValueList.d.ts.map +1 -1
  270. package/lib/components/FieldValueList/FieldValueList.js +5 -7
  271. package/lib/components/FieldValueList/FieldValueList.js.map +1 -1
  272. package/lib/components/File/FileDisplay.d.ts +6 -3
  273. package/lib/components/File/FileDisplay.d.ts.map +1 -1
  274. package/lib/components/File/FileDisplay.js +7 -7
  275. package/lib/components/File/FileDisplay.js.map +1 -1
  276. package/lib/components/File/FileInput.d.ts +3 -3
  277. package/lib/components/File/FileInput.d.ts.map +1 -1
  278. package/lib/components/File/FileInput.js +18 -19
  279. package/lib/components/File/FileInput.js.map +1 -1
  280. package/lib/components/File/FileItem.d.ts +0 -2
  281. package/lib/components/File/FileItem.d.ts.map +1 -1
  282. package/lib/components/File/FileItem.js +3 -4
  283. package/lib/components/File/FileItem.js.map +1 -1
  284. package/lib/components/File/FileUploadItem.d.ts +4 -2
  285. package/lib/components/File/FileUploadItem.d.ts.map +1 -1
  286. package/lib/components/File/FileUploadItem.js +58 -20
  287. package/lib/components/File/FileUploadItem.js.map +1 -1
  288. package/lib/components/File/FileVisual.d.ts +7 -16
  289. package/lib/components/File/FileVisual.d.ts.map +1 -1
  290. package/lib/components/File/FileVisual.js +44 -47
  291. package/lib/components/File/FileVisual.js.map +1 -1
  292. package/lib/components/File/index.d.ts +1 -0
  293. package/lib/components/File/index.d.ts.map +1 -1
  294. package/lib/components/File/index.js +1 -0
  295. package/lib/components/File/index.js.map +1 -1
  296. package/lib/components/File/utils.js +2 -3
  297. package/lib/components/File/utils.js.map +1 -1
  298. package/lib/components/Flex/Flex.d.ts +17 -7
  299. package/lib/components/Flex/Flex.d.ts.map +1 -1
  300. package/lib/components/Flex/Flex.js +25 -9
  301. package/lib/components/Flex/Flex.js.map +1 -1
  302. package/lib/components/Form/Form.d.ts +7 -1
  303. package/lib/components/Form/Form.d.ts.map +1 -1
  304. package/lib/components/Form/Form.js +5 -4
  305. package/lib/components/Form/Form.js.map +1 -1
  306. package/lib/components/FormControl/FormControl.d.ts +1 -1
  307. package/lib/components/FormControl/FormControl.d.ts.map +1 -1
  308. package/lib/components/FormControl/FormControl.js +1 -1
  309. package/lib/components/FormControl/FormControl.js.map +1 -1
  310. package/lib/components/FormField/FormField.d.ts +5 -7
  311. package/lib/components/FormField/FormField.d.ts.map +1 -1
  312. package/lib/components/FormField/FormField.js +9 -19
  313. package/lib/components/FormField/FormField.js.map +1 -1
  314. package/lib/components/Grid/Grid.d.ts +1 -1
  315. package/lib/components/Grid/Grid.d.ts.map +1 -1
  316. package/lib/components/Grid/Grid.js +17 -21
  317. package/lib/components/Grid/Grid.js.map +1 -1
  318. package/lib/components/Icon/Icon.js +3 -5
  319. package/lib/components/Icon/Icon.js.map +1 -1
  320. package/lib/components/Icon/iconNames.d.ts +1 -1
  321. package/lib/components/Icon/iconNames.d.ts.map +1 -1
  322. package/lib/components/Icon/iconNames.js +2 -0
  323. package/lib/components/Icon/iconNames.js.map +1 -1
  324. package/lib/components/Icon/icons/compass-solid.icon.js +1 -2
  325. package/lib/components/Icon/icons/compass-solid.icon.js.map +1 -1
  326. package/lib/components/Icon/icons/dataviz-table-with-bars.icon.js +1 -4
  327. package/lib/components/Icon/icons/dataviz-table-with-bars.icon.js.map +1 -1
  328. package/lib/components/Icon/icons/dataviz-table-with-cross.icon.js +1 -2
  329. package/lib/components/Icon/icons/dataviz-table-with-cross.icon.js.map +1 -1
  330. package/lib/components/Icon/icons/dataviz-waterfall.icon.js +1 -5
  331. package/lib/components/Icon/icons/dataviz-waterfall.icon.js.map +1 -1
  332. package/lib/components/Icon/icons/dock.icon.d.ts +4 -0
  333. package/lib/components/Icon/icons/dock.icon.d.ts.map +1 -0
  334. package/lib/components/Icon/icons/dock.icon.js +6 -0
  335. package/lib/components/Icon/icons/dock.icon.js.map +1 -0
  336. package/lib/components/Icon/icons/filetype-text.icon.js +1 -4
  337. package/lib/components/Icon/icons/filetype-text.icon.js.map +1 -1
  338. package/lib/components/Icon/icons/folder-dollar.icon.js +1 -2
  339. package/lib/components/Icon/icons/folder-dollar.icon.js.map +1 -1
  340. package/lib/components/Icon/icons/freeze-column.icon.js +1 -2
  341. package/lib/components/Icon/icons/freeze-column.icon.js.map +1 -1
  342. package/lib/components/Icon/icons/galaxy.icon.js +1 -3
  343. package/lib/components/Icon/icons/galaxy.icon.js.map +1 -1
  344. package/lib/components/Icon/icons/grad-solid.icon.js +1 -2
  345. package/lib/components/Icon/icons/grad-solid.icon.js.map +1 -1
  346. package/lib/components/Icon/icons/grad.icon.js +1 -5
  347. package/lib/components/Icon/icons/grad.icon.js.map +1 -1
  348. package/lib/components/Icon/icons/list-number.icon.js +1 -6
  349. package/lib/components/Icon/icons/list-number.icon.js.map +1 -1
  350. package/lib/components/Icon/icons/list.icon.js +1 -6
  351. package/lib/components/Icon/icons/list.icon.js.map +1 -1
  352. package/lib/components/Icon/icons/pin.icon.js +1 -2
  353. package/lib/components/Icon/icons/pin.icon.js.map +1 -1
  354. package/lib/components/Icon/icons/search-solid.icon.js +1 -2
  355. package/lib/components/Icon/icons/search-solid.icon.js.map +1 -1
  356. package/lib/components/Icon/icons/tracer.icon.js +1 -2
  357. package/lib/components/Icon/icons/tracer.icon.js.map +1 -1
  358. package/lib/components/Icon/icons/tribox-solid.icon.js +1 -3
  359. package/lib/components/Icon/icons/tribox-solid.icon.js.map +1 -1
  360. package/lib/components/Icon/icons/tribox.icon.js +1 -3
  361. package/lib/components/Icon/icons/tribox.icon.js.map +1 -1
  362. package/lib/components/Icon/icons/undock.icon.d.ts +4 -0
  363. package/lib/components/Icon/icons/undock.icon.d.ts.map +1 -0
  364. package/lib/components/Icon/icons/undock.icon.js +6 -0
  365. package/lib/components/Icon/icons/undock.icon.js.map +1 -0
  366. package/lib/components/Icon/index.d.ts +1 -0
  367. package/lib/components/Icon/index.d.ts.map +1 -1
  368. package/lib/components/Icon/index.js +1 -0
  369. package/lib/components/Icon/index.js.map +1 -1
  370. package/lib/components/Image/Image.js +1 -1
  371. package/lib/components/Image/Image.js.map +1 -1
  372. package/lib/components/Image/index.d.ts +1 -1
  373. package/lib/components/Image/index.d.ts.map +1 -1
  374. package/lib/components/Image/index.js +1 -0
  375. package/lib/components/Image/index.js.map +1 -1
  376. package/lib/components/Input/Input.d.ts +2 -2
  377. package/lib/components/Input/Input.d.ts.map +1 -1
  378. package/lib/components/Input/Input.js +13 -13
  379. package/lib/components/Input/Input.js.map +1 -1
  380. package/lib/components/Input/Input.styles.js +2 -2
  381. package/lib/components/Input/Input.styles.js.map +1 -1
  382. package/lib/components/Input/index.d.ts +1 -1
  383. package/lib/components/Input/index.d.ts.map +1 -1
  384. package/lib/components/Input/index.js.map +1 -1
  385. package/lib/components/Label/Label.d.ts +2 -2
  386. package/lib/components/Label/Label.d.ts.map +1 -1
  387. package/lib/components/Label/Label.js +1 -1
  388. package/lib/components/Label/Label.js.map +1 -1
  389. package/lib/components/Lightbox/Lightbox.d.ts +6 -0
  390. package/lib/components/Lightbox/Lightbox.d.ts.map +1 -0
  391. package/lib/components/Lightbox/Lightbox.js +129 -0
  392. package/lib/components/Lightbox/Lightbox.js.map +1 -0
  393. package/lib/components/Lightbox/Lightbox.styles.d.ts +11 -0
  394. package/lib/components/Lightbox/Lightbox.styles.d.ts.map +1 -0
  395. package/lib/components/Lightbox/Lightbox.styles.js +166 -0
  396. package/lib/components/Lightbox/Lightbox.styles.js.map +1 -0
  397. package/lib/components/Lightbox/Lightbox.types.d.ts +42 -0
  398. package/lib/components/Lightbox/Lightbox.types.d.ts.map +1 -0
  399. package/lib/components/Lightbox/Lightbox.types.js +2 -0
  400. package/lib/components/Lightbox/Lightbox.types.js.map +1 -0
  401. package/lib/components/Lightbox/index.d.ts +3 -0
  402. package/lib/components/Lightbox/index.d.ts.map +1 -0
  403. package/lib/components/Lightbox/index.js +2 -0
  404. package/lib/components/Lightbox/index.js.map +1 -0
  405. package/lib/components/Link/Link.d.ts.map +1 -1
  406. package/lib/components/Link/Link.js +19 -19
  407. package/lib/components/Link/Link.js.map +1 -1
  408. package/lib/components/List/CommaSeparatedList.d.ts +15 -0
  409. package/lib/components/List/CommaSeparatedList.d.ts.map +1 -0
  410. package/lib/components/List/CommaSeparatedList.js +61 -0
  411. package/lib/components/List/CommaSeparatedList.js.map +1 -0
  412. package/lib/components/List/List.d.ts +30 -0
  413. package/lib/components/List/List.d.ts.map +1 -0
  414. package/lib/components/List/List.js +56 -0
  415. package/lib/components/List/List.js.map +1 -0
  416. package/lib/components/List/OrderedList.d.ts +6 -0
  417. package/lib/components/List/OrderedList.d.ts.map +1 -0
  418. package/lib/components/List/OrderedList.js +6 -0
  419. package/lib/components/List/OrderedList.js.map +1 -0
  420. package/lib/components/List/UnorderedList.d.ts +6 -0
  421. package/lib/components/List/UnorderedList.d.ts.map +1 -0
  422. package/lib/components/List/UnorderedList.js +6 -0
  423. package/lib/components/List/UnorderedList.js.map +1 -0
  424. package/lib/components/List/index.d.ts +5 -0
  425. package/lib/components/List/index.d.ts.map +1 -0
  426. package/lib/components/List/index.js +4 -0
  427. package/lib/components/List/index.js.map +1 -0
  428. package/lib/components/Location/CurrentLocationButton.d.ts.map +1 -1
  429. package/lib/components/Location/CurrentLocationButton.js +7 -7
  430. package/lib/components/Location/CurrentLocationButton.js.map +1 -1
  431. package/lib/components/Location/Location.types.d.ts +2 -1
  432. package/lib/components/Location/Location.types.d.ts.map +1 -1
  433. package/lib/components/Location/Location.types.js.map +1 -1
  434. package/lib/components/Location/LocationDisplay.js +8 -9
  435. package/lib/components/Location/LocationDisplay.js.map +1 -1
  436. package/lib/components/Location/LocationInput.js +27 -28
  437. package/lib/components/Location/LocationInput.js.map +1 -1
  438. package/lib/components/Location/LocationView.js +8 -13
  439. package/lib/components/Location/LocationView.js.map +1 -1
  440. package/lib/components/Location/index.d.ts +4 -4
  441. package/lib/components/Location/index.d.ts.map +1 -1
  442. package/lib/components/Location/index.js.map +1 -1
  443. package/lib/components/Location/utils.js +11 -15
  444. package/lib/components/Location/utils.js.map +1 -1
  445. package/lib/components/Menu/FlyoutMenuList.d.ts.map +1 -1
  446. package/lib/components/Menu/FlyoutMenuList.js +12 -15
  447. package/lib/components/Menu/FlyoutMenuList.js.map +1 -1
  448. package/lib/components/Menu/Menu.context.d.ts.map +1 -1
  449. package/lib/components/Menu/Menu.context.js +2 -0
  450. package/lib/components/Menu/Menu.context.js.map +1 -1
  451. package/lib/components/Menu/Menu.d.ts.map +1 -1
  452. package/lib/components/Menu/Menu.js +92 -48
  453. package/lib/components/Menu/Menu.js.map +1 -1
  454. package/lib/components/Menu/Menu.styles.d.ts +11 -1
  455. package/lib/components/Menu/Menu.styles.d.ts.map +1 -1
  456. package/lib/components/Menu/Menu.styles.js +208 -7
  457. package/lib/components/Menu/Menu.styles.js.map +1 -1
  458. package/lib/components/Menu/Menu.types.d.ts +30 -12
  459. package/lib/components/Menu/Menu.types.d.ts.map +1 -1
  460. package/lib/components/Menu/Menu.types.js.map +1 -1
  461. package/lib/components/Menu/MenuGroup.d.ts +6 -0
  462. package/lib/components/Menu/MenuGroup.d.ts.map +1 -0
  463. package/lib/components/Menu/MenuGroup.js +17 -0
  464. package/lib/components/Menu/MenuGroup.js.map +1 -0
  465. package/lib/components/Menu/MenuItem.d.ts +0 -3
  466. package/lib/components/Menu/MenuItem.d.ts.map +1 -1
  467. package/lib/components/Menu/MenuItem.js +57 -164
  468. package/lib/components/Menu/MenuItem.js.map +1 -1
  469. package/lib/components/Menu/MenuList.d.ts +1 -1
  470. package/lib/components/Menu/MenuList.d.ts.map +1 -1
  471. package/lib/components/Menu/MenuList.js +28 -30
  472. package/lib/components/Menu/MenuList.js.map +1 -1
  473. package/lib/components/Menu/MenuListHeader.d.ts +0 -1
  474. package/lib/components/Menu/MenuListHeader.d.ts.map +1 -1
  475. package/lib/components/Menu/MenuListHeader.js +7 -55
  476. package/lib/components/Menu/MenuListHeader.js.map +1 -1
  477. package/lib/components/Menu/NavItemsList.d.ts.map +1 -1
  478. package/lib/components/Menu/NavItemsList.js +2 -3
  479. package/lib/components/Menu/NavItemsList.js.map +1 -1
  480. package/lib/components/Menu/helpers.d.ts +13 -12
  481. package/lib/components/Menu/helpers.d.ts.map +1 -1
  482. package/lib/components/Menu/helpers.js +40 -36
  483. package/lib/components/Menu/helpers.js.map +1 -1
  484. package/lib/components/Menu/index.d.ts +2 -3
  485. package/lib/components/Menu/index.d.ts.map +1 -1
  486. package/lib/components/Menu/index.js +1 -2
  487. package/lib/components/Menu/index.js.map +1 -1
  488. package/lib/components/MenuButton/MenuButton.d.ts +3 -1
  489. package/lib/components/MenuButton/MenuButton.d.ts.map +1 -1
  490. package/lib/components/MenuButton/MenuButton.js +13 -14
  491. package/lib/components/MenuButton/MenuButton.js.map +1 -1
  492. package/lib/components/MetaList/MetaList.d.ts +13 -4
  493. package/lib/components/MetaList/MetaList.d.ts.map +1 -1
  494. package/lib/components/MetaList/MetaList.js +34 -20
  495. package/lib/components/MetaList/MetaList.js.map +1 -1
  496. package/lib/components/Modal/Contexts.d.ts.map +1 -1
  497. package/lib/components/Modal/Contexts.js +6 -2
  498. package/lib/components/Modal/Contexts.js.map +1 -1
  499. package/lib/components/Modal/DockedModals.d.ts.map +1 -1
  500. package/lib/components/Modal/DockedModals.js +5 -4
  501. package/lib/components/Modal/DockedModals.js.map +1 -1
  502. package/lib/components/Modal/MinimizedModal.d.ts.map +1 -1
  503. package/lib/components/Modal/MinimizedModal.js +53 -38
  504. package/lib/components/Modal/MinimizedModal.js.map +1 -1
  505. package/lib/components/Modal/Modal.d.ts +1 -6
  506. package/lib/components/Modal/Modal.d.ts.map +1 -1
  507. package/lib/components/Modal/Modal.js +89 -136
  508. package/lib/components/Modal/Modal.js.map +1 -1
  509. package/lib/components/Modal/Modal.styles.d.ts +9 -0
  510. package/lib/components/Modal/Modal.styles.d.ts.map +1 -0
  511. package/lib/components/Modal/Modal.styles.js +134 -0
  512. package/lib/components/Modal/Modal.styles.js.map +1 -0
  513. package/lib/components/Modal/Modal.types.d.ts +60 -7
  514. package/lib/components/Modal/Modal.types.d.ts.map +1 -1
  515. package/lib/components/Modal/Modal.types.js +2 -1
  516. package/lib/components/Modal/Modal.types.js.map +1 -1
  517. package/lib/components/Modal/ModalManager.d.ts.map +1 -1
  518. package/lib/components/Modal/ModalManager.js +78 -68
  519. package/lib/components/Modal/ModalManager.js.map +1 -1
  520. package/lib/components/MultiStep/MultiStep.d.ts.map +1 -1
  521. package/lib/components/MultiStep/MultiStep.js +10 -12
  522. package/lib/components/MultiStep/MultiStep.js.map +1 -1
  523. package/lib/components/MultiStep/MultiStep.styles.d.ts.map +1 -1
  524. package/lib/components/MultiStep/MultiStep.styles.js +5 -2
  525. package/lib/components/MultiStep/MultiStep.styles.js.map +1 -1
  526. package/lib/components/MultiStep/MultiStep.types.d.ts +4 -2
  527. package/lib/components/MultiStep/MultiStep.types.d.ts.map +1 -1
  528. package/lib/components/MultiStep/MultiStep.types.js.map +1 -1
  529. package/lib/components/MultiStep/index.d.ts +1 -1
  530. package/lib/components/MultiStep/index.d.ts.map +1 -1
  531. package/lib/components/MultiStep/index.js.map +1 -1
  532. package/lib/components/Number/NumberDisplay.d.ts +2 -2
  533. package/lib/components/Number/NumberDisplay.d.ts.map +1 -1
  534. package/lib/components/Number/NumberDisplay.js +1 -1
  535. package/lib/components/Number/NumberDisplay.js.map +1 -1
  536. package/lib/components/Number/NumberInput.d.ts.map +1 -1
  537. package/lib/components/Number/NumberInput.js +18 -25
  538. package/lib/components/Number/NumberInput.js.map +1 -1
  539. package/lib/components/Number/NumberInput.styles.d.ts +2 -2
  540. package/lib/components/Number/NumberInput.styles.d.ts.map +1 -1
  541. package/lib/components/Number/NumberInput.types.d.ts +2 -2
  542. package/lib/components/Number/NumberInput.types.d.ts.map +1 -1
  543. package/lib/components/Number/NumberInput.types.js.map +1 -1
  544. package/lib/components/Number/utils.js +2 -3
  545. package/lib/components/Number/utils.js.map +1 -1
  546. package/lib/components/PageTemplates/CategorySubPage.d.ts +1 -1
  547. package/lib/components/PageTemplates/CategorySubPage.d.ts.map +1 -1
  548. package/lib/components/PageTemplates/CategorySubPage.js +8 -18
  549. package/lib/components/PageTemplates/CategorySubPage.js.map +1 -1
  550. package/lib/components/PageTemplates/CategorySubPage.styles.d.ts +1 -1
  551. package/lib/components/PageTemplates/CategorySubPage.styles.d.ts.map +1 -1
  552. package/lib/components/PageTemplates/DashboardPage.d.ts +7 -1
  553. package/lib/components/PageTemplates/DashboardPage.d.ts.map +1 -1
  554. package/lib/components/PageTemplates/DashboardPage.js +48 -28
  555. package/lib/components/PageTemplates/DashboardPage.js.map +1 -1
  556. package/lib/components/PageTemplates/PageTemplates.d.ts +15 -6
  557. package/lib/components/PageTemplates/PageTemplates.d.ts.map +1 -1
  558. package/lib/components/PageTemplates/PageTemplates.js +89 -79
  559. package/lib/components/PageTemplates/PageTemplates.js.map +1 -1
  560. package/lib/components/PageTemplates/index.d.ts +5 -3
  561. package/lib/components/PageTemplates/index.d.ts.map +1 -1
  562. package/lib/components/PageTemplates/index.js +2 -1
  563. package/lib/components/PageTemplates/index.js.map +1 -1
  564. package/lib/components/Pagination/Pagination.d.ts +2 -2
  565. package/lib/components/Pagination/Pagination.d.ts.map +1 -1
  566. package/lib/components/Pagination/Pagination.js +7 -6
  567. package/lib/components/Pagination/Pagination.js.map +1 -1
  568. package/lib/components/Paragraph/ParagraphDisplay.d.ts +11 -0
  569. package/lib/components/Paragraph/ParagraphDisplay.d.ts.map +1 -0
  570. package/lib/components/Paragraph/ParagraphDisplay.js +11 -0
  571. package/lib/components/Paragraph/ParagraphDisplay.js.map +1 -0
  572. package/lib/components/Paragraph/index.d.ts +3 -0
  573. package/lib/components/Paragraph/index.d.ts.map +1 -0
  574. package/lib/components/Paragraph/index.js +2 -0
  575. package/lib/components/Paragraph/index.js.map +1 -0
  576. package/lib/components/Phone/PhoneDisplay.d.ts +2 -2
  577. package/lib/components/Phone/PhoneDisplay.d.ts.map +1 -1
  578. package/lib/components/Phone/PhoneDisplay.js +2 -3
  579. package/lib/components/Phone/PhoneDisplay.js.map +1 -1
  580. package/lib/components/Phone/PhoneInput.d.ts +2 -2
  581. package/lib/components/Phone/PhoneInput.d.ts.map +1 -1
  582. package/lib/components/Phone/PhoneInput.js +18 -17
  583. package/lib/components/Phone/PhoneInput.js.map +1 -1
  584. package/lib/components/Phone/utils.js +2 -3
  585. package/lib/components/Phone/utils.js.map +1 -1
  586. package/lib/components/Popover/Popover.d.ts +0 -4
  587. package/lib/components/Popover/Popover.d.ts.map +1 -1
  588. package/lib/components/Popover/Popover.js +17 -122
  589. package/lib/components/Popover/Popover.js.map +1 -1
  590. package/lib/components/Popover/Popover.styles.d.ts +5 -0
  591. package/lib/components/Popover/Popover.styles.d.ts.map +1 -0
  592. package/lib/components/Popover/Popover.styles.js +131 -0
  593. package/lib/components/Popover/Popover.styles.js.map +1 -0
  594. package/lib/components/Popover/PopoverManager.js +2 -2
  595. package/lib/components/Popover/PopoverManager.js.map +1 -1
  596. package/lib/components/Popover/index.d.ts +1 -1
  597. package/lib/components/Popover/index.d.ts.map +1 -1
  598. package/lib/components/Popover/index.js +1 -1
  599. package/lib/components/Popover/index.js.map +1 -1
  600. package/lib/components/Popover/modifiers.d.ts +3 -0
  601. package/lib/components/Popover/modifiers.d.ts.map +1 -0
  602. package/lib/components/Popover/modifiers.js +11 -0
  603. package/lib/components/Popover/modifiers.js.map +1 -0
  604. package/lib/components/Progress/Bar.js +2 -2
  605. package/lib/components/Progress/Bar.js.map +1 -1
  606. package/lib/components/Progress/Ellipsis.d.ts +1 -1
  607. package/lib/components/Progress/Ellipsis.d.ts.map +1 -1
  608. package/lib/components/Progress/Ellipsis.js +48 -50
  609. package/lib/components/Progress/Ellipsis.js.map +1 -1
  610. package/lib/components/Progress/Progress.js +3 -4
  611. package/lib/components/Progress/Progress.js.map +1 -1
  612. package/lib/components/Progress/Progress.types.d.ts +2 -2
  613. package/lib/components/Progress/Progress.types.d.ts.map +1 -1
  614. package/lib/components/Progress/Progress.types.js.map +1 -1
  615. package/lib/components/Progress/Ring.d.ts +1 -1
  616. package/lib/components/Progress/Ring.d.ts.map +1 -1
  617. package/lib/components/Progress/Ring.js +40 -40
  618. package/lib/components/Progress/Ring.js.map +1 -1
  619. package/lib/components/RadioButton/RadioButton.d.ts +2 -2
  620. package/lib/components/RadioButton/RadioButton.d.ts.map +1 -1
  621. package/lib/components/RadioButton/RadioButton.js +1 -1
  622. package/lib/components/RadioButton/RadioButton.js.map +1 -1
  623. package/lib/components/RadioCheck/RadioCheck.d.ts +2 -2
  624. package/lib/components/RadioCheck/RadioCheck.d.ts.map +1 -1
  625. package/lib/components/RadioCheck/RadioCheck.js +7 -8
  626. package/lib/components/RadioCheck/RadioCheck.js.map +1 -1
  627. package/lib/components/RadioCheckGroup/RadioCheckGroup.d.ts +4 -0
  628. package/lib/components/RadioCheckGroup/RadioCheckGroup.d.ts.map +1 -1
  629. package/lib/components/RadioCheckGroup/RadioCheckGroup.js +19 -18
  630. package/lib/components/RadioCheckGroup/RadioCheckGroup.js.map +1 -1
  631. package/lib/components/Rating/Rating.d.ts +2 -2
  632. package/lib/components/Rating/Rating.d.ts.map +1 -1
  633. package/lib/components/Rating/Rating.js +6 -7
  634. package/lib/components/Rating/Rating.js.map +1 -1
  635. package/lib/components/SearchInput/SearchInput.d.ts +5 -5
  636. package/lib/components/SearchInput/SearchInput.d.ts.map +1 -1
  637. package/lib/components/SearchInput/SearchInput.js +14 -14
  638. package/lib/components/SearchInput/SearchInput.js.map +1 -1
  639. package/lib/components/Select/Option.js +1 -1
  640. package/lib/components/Select/Option.js.map +1 -1
  641. package/lib/components/Select/Select.d.ts.map +1 -1
  642. package/lib/components/Select/Select.js +15 -16
  643. package/lib/components/Select/Select.js.map +1 -1
  644. package/lib/components/Select/index.d.ts +2 -3
  645. package/lib/components/Select/index.d.ts.map +1 -1
  646. package/lib/components/Select/index.js.map +1 -1
  647. package/lib/components/Sentiment/Sentiment.d.ts +2 -2
  648. package/lib/components/Sentiment/Sentiment.d.ts.map +1 -1
  649. package/lib/components/Sentiment/Sentiment.js +1 -2
  650. package/lib/components/Sentiment/Sentiment.js.map +1 -1
  651. package/lib/components/Skeleton/LineSkeleton.js +1 -1
  652. package/lib/components/Skeleton/LineSkeleton.js.map +1 -1
  653. package/lib/components/Skeleton/ParagraphSkeleton.js +1 -1
  654. package/lib/components/Skeleton/ParagraphSkeleton.js.map +1 -1
  655. package/lib/components/Skeleton/RectangleSkeleton.js +1 -1
  656. package/lib/components/Skeleton/RectangleSkeleton.js.map +1 -1
  657. package/lib/components/Slider/Slider.d.ts.map +1 -1
  658. package/lib/components/Slider/Slider.js +12 -19
  659. package/lib/components/Slider/Slider.js.map +1 -1
  660. package/lib/components/Slider/Slider.styles.d.ts +4 -1
  661. package/lib/components/Slider/Slider.styles.d.ts.map +1 -1
  662. package/lib/components/Slider/Slider.styles.js +17 -5
  663. package/lib/components/Slider/Slider.styles.js.map +1 -1
  664. package/lib/components/Slider/Slider.types.d.ts +2 -2
  665. package/lib/components/Slider/Slider.types.d.ts.map +1 -1
  666. package/lib/components/Slider/Slider.types.js.map +1 -1
  667. package/lib/components/Slider/SliderTicks.d.ts +1 -0
  668. package/lib/components/Slider/SliderTicks.d.ts.map +1 -1
  669. package/lib/components/Slider/SliderTicks.js +19 -12
  670. package/lib/components/Slider/SliderTicks.js.map +1 -1
  671. package/lib/components/Slider/utils.d.ts +10 -11
  672. package/lib/components/Slider/utils.d.ts.map +1 -1
  673. package/lib/components/Slider/utils.js +24 -18
  674. package/lib/components/Slider/utils.js.map +1 -1
  675. package/lib/components/SummaryItem/SummaryItem.d.ts +5 -5
  676. package/lib/components/SummaryItem/SummaryItem.d.ts.map +1 -1
  677. package/lib/components/SummaryItem/SummaryItem.js +3 -5
  678. package/lib/components/SummaryItem/SummaryItem.js.map +1 -1
  679. package/lib/components/SummaryList/SummaryList.d.ts +8 -2
  680. package/lib/components/SummaryList/SummaryList.d.ts.map +1 -1
  681. package/lib/components/SummaryList/SummaryList.js +10 -11
  682. package/lib/components/SummaryList/SummaryList.js.map +1 -1
  683. package/lib/components/SummaryList/ViewAll.d.ts +1 -1
  684. package/lib/components/SummaryList/ViewAll.d.ts.map +1 -1
  685. package/lib/components/SummaryList/ViewAll.js +14 -10
  686. package/lib/components/SummaryList/ViewAll.js.map +1 -1
  687. package/lib/components/Switch/Switch.d.ts +2 -2
  688. package/lib/components/Switch/Switch.d.ts.map +1 -1
  689. package/lib/components/Switch/Switch.js +41 -30
  690. package/lib/components/Switch/Switch.js.map +1 -1
  691. package/lib/components/Table/Table.d.ts +2 -2
  692. package/lib/components/Table/Table.d.ts.map +1 -1
  693. package/lib/components/Table/Table.js +14 -13
  694. package/lib/components/Table/Table.js.map +1 -1
  695. package/lib/components/Table/index.d.ts +1 -2
  696. package/lib/components/Table/index.d.ts.map +1 -1
  697. package/lib/components/Table/index.js.map +1 -1
  698. package/lib/components/Tabs/Tab.d.ts +1 -1
  699. package/lib/components/Tabs/Tab.d.ts.map +1 -1
  700. package/lib/components/Tabs/Tab.js +9 -7
  701. package/lib/components/Tabs/Tab.js.map +1 -1
  702. package/lib/components/Tabs/TabPanel.d.ts +10 -2
  703. package/lib/components/Tabs/TabPanel.d.ts.map +1 -1
  704. package/lib/components/Tabs/TabPanel.js +24 -8
  705. package/lib/components/Tabs/TabPanel.js.map +1 -1
  706. package/lib/components/Tabs/Tabs.d.ts +1 -0
  707. package/lib/components/Tabs/Tabs.d.ts.map +1 -1
  708. package/lib/components/Tabs/Tabs.js +22 -18
  709. package/lib/components/Tabs/Tabs.js.map +1 -1
  710. package/lib/components/Tabs/Tabs.types.d.ts +2 -2
  711. package/lib/components/Tabs/Tabs.types.d.ts.map +1 -1
  712. package/lib/components/Tabs/Tabs.types.js.map +1 -1
  713. package/lib/components/Text/Text.d.ts +1 -1
  714. package/lib/components/Text/Text.d.ts.map +1 -1
  715. package/lib/components/Text/Text.js +2 -2
  716. package/lib/components/Text/Text.js.map +1 -1
  717. package/lib/components/TextArea/TextArea.d.ts +2 -2
  718. package/lib/components/TextArea/TextArea.d.ts.map +1 -1
  719. package/lib/components/TextArea/TextArea.js +31 -30
  720. package/lib/components/TextArea/TextArea.js.map +1 -1
  721. package/lib/components/TextArea/index.d.ts +1 -1
  722. package/lib/components/TextArea/index.d.ts.map +1 -1
  723. package/lib/components/TextArea/index.js.map +1 -1
  724. package/lib/components/Toaster/Toaster.d.ts +8 -36
  725. package/lib/components/Toaster/Toaster.d.ts.map +1 -1
  726. package/lib/components/Toaster/Toaster.js +97 -102
  727. package/lib/components/Toaster/Toaster.js.map +1 -1
  728. package/lib/components/Tooltip/Tooltip.d.ts +6 -1
  729. package/lib/components/Tooltip/Tooltip.d.ts.map +1 -1
  730. package/lib/components/Tooltip/Tooltip.js +6 -13
  731. package/lib/components/Tooltip/Tooltip.js.map +1 -1
  732. package/lib/components/Tree/StandardTree.d.ts +6 -0
  733. package/lib/components/Tree/StandardTree.d.ts.map +1 -0
  734. package/lib/components/Tree/StandardTree.js +175 -0
  735. package/lib/components/Tree/StandardTree.js.map +1 -0
  736. package/lib/components/Tree/StandardTree.styles.d.ts +13 -0
  737. package/lib/components/Tree/StandardTree.styles.d.ts.map +1 -0
  738. package/lib/components/Tree/StandardTree.styles.js +155 -0
  739. package/lib/components/Tree/StandardTree.styles.js.map +1 -0
  740. package/lib/components/Tree/StandardTree.types.d.ts +25 -0
  741. package/lib/components/Tree/StandardTree.types.d.ts.map +1 -0
  742. package/lib/components/Tree/StandardTree.types.js +2 -0
  743. package/lib/components/Tree/StandardTree.types.js.map +1 -0
  744. package/lib/components/Tree/Tree.d.ts +35 -49
  745. package/lib/components/Tree/Tree.d.ts.map +1 -1
  746. package/lib/components/Tree/Tree.js +18 -56
  747. package/lib/components/Tree/Tree.js.map +1 -1
  748. package/lib/components/Tree/helpers.d.ts +19 -0
  749. package/lib/components/Tree/helpers.d.ts.map +1 -0
  750. package/lib/components/Tree/helpers.js +180 -0
  751. package/lib/components/Tree/helpers.js.map +1 -0
  752. package/lib/components/Tree/index.d.ts +4 -2
  753. package/lib/components/Tree/index.d.ts.map +1 -1
  754. package/lib/components/Tree/index.js +3 -1
  755. package/lib/components/Tree/index.js.map +1 -1
  756. package/lib/components/URL/URLDisplay.d.ts +2 -2
  757. package/lib/components/URL/URLDisplay.d.ts.map +1 -1
  758. package/lib/components/URL/URLDisplay.js +2 -2
  759. package/lib/components/URL/URLDisplay.js.map +1 -1
  760. package/lib/components/VisuallyHiddenText/VisuallyHiddenText.d.ts +10 -0
  761. package/lib/components/VisuallyHiddenText/VisuallyHiddenText.d.ts.map +1 -0
  762. package/lib/components/VisuallyHiddenText/VisuallyHiddenText.js +10 -0
  763. package/lib/components/VisuallyHiddenText/VisuallyHiddenText.js.map +1 -0
  764. package/lib/components/VisuallyHiddenText/index.d.ts +2 -0
  765. package/lib/components/VisuallyHiddenText/index.d.ts.map +1 -0
  766. package/lib/components/VisuallyHiddenText/index.js +2 -0
  767. package/lib/components/VisuallyHiddenText/index.js.map +1 -0
  768. package/lib/hooks/index.d.ts +7 -4
  769. package/lib/hooks/index.d.ts.map +1 -1
  770. package/lib/hooks/index.js +7 -3
  771. package/lib/hooks/index.js.map +1 -1
  772. package/lib/hooks/useActiveDescendant.d.ts +17 -3
  773. package/lib/hooks/useActiveDescendant.d.ts.map +1 -1
  774. package/lib/hooks/useActiveDescendant.js +86 -64
  775. package/lib/hooks/useActiveDescendant.js.map +1 -1
  776. package/lib/hooks/useAutoResize.d.ts.map +1 -1
  777. package/lib/hooks/useAutoResize.js +6 -7
  778. package/lib/hooks/useAutoResize.js.map +1 -1
  779. package/lib/hooks/useBreakpoint.js +2 -4
  780. package/lib/hooks/useBreakpoint.js.map +1 -1
  781. package/lib/hooks/useDraggable.d.ts +8 -0
  782. package/lib/hooks/useDraggable.d.ts.map +1 -0
  783. package/lib/hooks/useDraggable.js +64 -0
  784. package/lib/hooks/useDraggable.js.map +1 -0
  785. package/lib/hooks/useFocusWithin.d.ts +1 -1
  786. package/lib/hooks/useFocusWithin.d.ts.map +1 -1
  787. package/lib/hooks/useFocusWithin.js +29 -24
  788. package/lib/hooks/useFocusWithin.js.map +1 -1
  789. package/lib/hooks/useI18n.d.ts +511 -170
  790. package/lib/hooks/useI18n.d.ts.map +1 -1
  791. package/lib/hooks/useI18n.js +2 -2
  792. package/lib/hooks/useI18n.js.map +1 -1
  793. package/lib/hooks/useLongPress.d.ts +16 -0
  794. package/lib/hooks/useLongPress.d.ts.map +1 -0
  795. package/lib/hooks/useLongPress.js +59 -0
  796. package/lib/hooks/useLongPress.js.map +1 -0
  797. package/lib/hooks/useOuterEvent.js +1 -1
  798. package/lib/hooks/useOuterEvent.js.map +1 -1
  799. package/lib/hooks/useOverride.js +1 -1
  800. package/lib/hooks/useOverride.js.map +1 -1
  801. package/lib/hooks/useScrollStick.js +14 -3
  802. package/lib/hooks/useScrollStick.js.map +1 -1
  803. package/lib/hooks/useScrollToggle.d.ts +6 -0
  804. package/lib/hooks/useScrollToggle.d.ts.map +1 -0
  805. package/lib/hooks/useScrollToggle.js +40 -0
  806. package/lib/hooks/useScrollToggle.js.map +1 -0
  807. package/lib/hooks/useTransitionState.d.ts +39 -0
  808. package/lib/hooks/useTransitionState.d.ts.map +1 -0
  809. package/lib/hooks/useTransitionState.js +56 -0
  810. package/lib/hooks/useTransitionState.js.map +1 -0
  811. package/lib/i18n/default.d.ts +589 -0
  812. package/lib/i18n/default.d.ts.map +1 -0
  813. package/lib/i18n/default.js +636 -0
  814. package/lib/i18n/default.js.map +1 -0
  815. package/lib/i18n/i18n.d.ts +1000 -318
  816. package/lib/i18n/i18n.d.ts.map +1 -1
  817. package/lib/i18n/i18n.js +1 -1
  818. package/lib/i18n/i18n.js.map +1 -1
  819. package/lib/i18n/index.d.ts +1 -0
  820. package/lib/i18n/index.d.ts.map +1 -1
  821. package/lib/i18n/index.js.map +1 -1
  822. package/lib/i18n/translate.d.ts +29 -4
  823. package/lib/i18n/translate.d.ts.map +1 -1
  824. package/lib/i18n/translate.js +21 -8
  825. package/lib/i18n/translate.js.map +1 -1
  826. package/lib/index.d.ts +11 -2
  827. package/lib/index.d.ts.map +1 -1
  828. package/lib/index.js +11 -2
  829. package/lib/index.js.map +1 -1
  830. package/lib/styles/GlobalStyle.d.ts.map +1 -1
  831. package/lib/styles/GlobalStyle.js +2 -26
  832. package/lib/styles/GlobalStyle.js.map +1 -1
  833. package/lib/theme/ThemeMachine.js +7 -1
  834. package/lib/theme/ThemeMachine.js.map +1 -1
  835. package/lib/theme/index.d.ts +1 -0
  836. package/lib/theme/index.d.ts.map +1 -1
  837. package/lib/theme/index.js +1 -0
  838. package/lib/theme/index.js.map +1 -1
  839. package/lib/theme/theme.d.ts +83 -53
  840. package/lib/theme/theme.d.ts.map +1 -1
  841. package/lib/theme/themeDefinition.json +50 -30
  842. package/lib/theme/themeOverrides.schema.json +24 -3
  843. package/lib/theme/themes/buildTheme.json +3 -39
  844. package/lib/theme/themes/darkTheme.json +6 -0
  845. package/lib/theme/themes/legacyBuildTheme.json +50 -0
  846. package/lib/types/types.d.ts +6 -1
  847. package/lib/types/types.d.ts.map +1 -1
  848. package/lib/types/types.js.map +1 -1
  849. package/lib/utils/utils.d.ts +41 -4
  850. package/lib/utils/utils.d.ts.map +1 -1
  851. package/lib/utils/utils.js +55 -9
  852. package/lib/utils/utils.js.map +1 -1
  853. package/package.json +11 -12
  854. package/lib/components/DateTime/Input/useButtonAriaLabel.d.ts +0 -3
  855. package/lib/components/DateTime/Input/useButtonAriaLabel.d.ts.map +0 -1
  856. package/lib/components/DateTime/Input/useButtonAriaLabel.js +0 -33
  857. package/lib/components/DateTime/Input/useButtonAriaLabel.js.map +0 -1
  858. package/lib/components/NoItems/NoItems.d.ts +0 -14
  859. package/lib/components/NoItems/NoItems.d.ts.map +0 -1
  860. package/lib/components/NoItems/NoItems.js.map +0 -1
  861. package/lib/components/NoItems/index.d.ts +0 -4
  862. package/lib/components/NoItems/index.d.ts.map +0 -1
  863. package/lib/components/NoItems/index.js +0 -3
  864. package/lib/components/NoItems/index.js.map +0 -1
  865. package/lib/i18n/default.json +0 -246
@@ -1,6 +1,7 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { forwardRef, useEffect, useMemo, useRef, useState } from 'react';
3
3
  import styled, { css } from 'styled-components';
4
+ import { useAfterInitialEffect, useDirection, useFocusWithin } from '../../hooks';
4
5
  import { defaultThemeProp } from '../../theme';
5
6
  import FormField from '../FormField';
6
7
  import { StyledFormControl } from '../FormControl';
@@ -9,7 +10,6 @@ import Select, { Option } from '../Select';
9
10
  import Input from '../Input';
10
11
  import { StyledSelect } from '../Select/Select';
11
12
  import Flex from '../Flex';
12
- import { useDirection, useFocusWithin } from '../../hooks';
13
13
  import callingCodes from './callingCodes';
14
14
  import { calculateCursorPosition, convertToCallbackParameter, formatPhoneNumber, getPhoneNumberParts } from './utils';
15
15
  const StyledPhoneInput = styled.div(() => {
@@ -19,13 +19,13 @@ const StyledPhoneInput = styled.div(() => {
19
19
  > ${StyledSelect} {
20
20
  max-width: max-content;
21
21
  border-inline-end: none;
22
- border-top-${end}-radius: 0;
23
- border-bottom-${end}-radius: 0;
22
+ ${`border-top-${end}-radius`}: 0;
23
+ ${`border-bottom-${end}-radius`}: 0;
24
24
  }
25
25
 
26
26
  > ${StyledSelect} + ${StyledInput} {
27
- border-top-${start}-radius: 0;
28
- border-bottom-${start}-radius: 0;
27
+ ${`border-top-${start}-radius`}: 0;
28
+ ${`border-bottom-${start}-radius`}: 0;
29
29
  }
30
30
  `;
31
31
  });
@@ -35,21 +35,24 @@ const PhoneInput = forwardRef((props, ref) => {
35
35
  const phoneNumberParts = useMemo(() => {
36
36
  return value ? getPhoneNumberParts(value, callingCodesList) : undefined;
37
37
  }, [callingCodesList, value]);
38
- const [countryCode, setCountryCode] = useState(phoneNumberParts === null || phoneNumberParts === void 0 ? void 0 : phoneNumberParts[0]);
38
+ const [countryCode, setCountryCode] = useState(showCountryCode ? phoneNumberParts?.[0] || callingCodesList[0] : phoneNumberParts?.[0]);
39
39
  const [phoneNumber, setPhoneNumber] = useState(phoneNumberParts ? formatPhoneNumber(phoneNumberParts[1], countryCode) : '');
40
+ useAfterInitialEffect(() => {
41
+ setCountryCode(phoneNumberParts?.[0]);
42
+ setPhoneNumber(phoneNumberParts ? formatPhoneNumber(phoneNumberParts[1], countryCode) : '');
43
+ }, [phoneNumberParts]);
40
44
  const [cursor, setCursor] = useState(undefined);
41
45
  const inputRef = useRef(null);
42
46
  useEffect(() => {
43
- var _a;
44
47
  if (cursor !== undefined)
45
- (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.setSelectionRange(cursor, cursor);
48
+ inputRef.current?.setSelectionRange(cursor, cursor);
46
49
  }, [cursor, inputRef.current]);
47
50
  const onFocusChange = (focused) => {
48
51
  const callbackParam = convertToCallbackParameter(countryCode, phoneNumber);
49
52
  if (focused)
50
- onFocus === null || onFocus === void 0 ? void 0 : onFocus(callbackParam);
53
+ onFocus?.(callbackParam);
51
54
  else
52
- onBlur === null || onBlur === void 0 ? void 0 : onBlur(callbackParam);
55
+ onBlur?.(callbackParam);
53
56
  };
54
57
  const containerRef = useRef(null);
55
58
  useFocusWithin([containerRef], onFocusChange);
@@ -61,19 +64,17 @@ const PhoneInput = forwardRef((props, ref) => {
61
64
  if (countryCode) {
62
65
  setCursor(calculateCursorPosition(formatted, phoneNumber, countryCode, selectionStart));
63
66
  }
64
- onChange === null || onChange === void 0 ? void 0 : onChange(convertToCallbackParameter(countryCode, formatted));
67
+ onChange?.(convertToCallbackParameter(countryCode, formatted));
65
68
  };
66
69
  const onSelectChange = (e) => {
67
70
  const selectValue = e.target.value;
68
71
  setCountryCode(selectValue);
69
72
  setPhoneNumber(formatPhoneNumber(phoneNumber, selectValue));
70
- onChange === null || onChange === void 0 ? void 0 : onChange(convertToCallbackParameter(selectValue, phoneNumber));
73
+ onChange?.(convertToCallbackParameter(selectValue, phoneNumber));
71
74
  };
72
- const codesOptions = (_jsxs(_Fragment, { children: [!countryCode && (_jsx(Option, Object.assign({ value: '' }, { children: ' ' }), 'none')),
73
- callingCodesList.map(code => (_jsx(Option, Object.assign({ value: code }, { children: code }), code)))] }, void 0));
74
- const Comp = (_jsxs(StyledPhoneInput, Object.assign({ as: StyledFormControl, forwardedAs: Flex, container: { alignItems: 'center', wrap: 'nowrap' }, ref: containerRef, status: status, readOnly: readOnly, disabled: disabled }, { children: [showCountryCode && (_jsx(Select, Object.assign({ value: countryCode, onChange: onSelectChange, required: required, status: status, readOnly: readOnly, disabled: disabled }, { children: codesOptions }), void 0)),
75
- _jsx(Input, Object.assign({}, restProps, { inputMode: 'tel', ref: inputRef, value: phoneNumber, onChange: onInputChange, required: required, status: status, readOnly: readOnly, disabled: disabled }), void 0)] }), void 0));
76
- return label ? (_jsx(FormField, Object.assign({ as: 'fieldset', labelAs: 'legend' }, { label, labelHidden, id, info, ref, status, required, disabled }, { children: Comp }), void 0)) : (Comp);
75
+ const codesOptions = (_jsx(_Fragment, { children: callingCodesList.map(code => (_jsx(Option, { value: code, children: code }, code))) }, void 0));
76
+ const Comp = (_jsxs(StyledPhoneInput, { as: StyledFormControl, forwardedAs: Flex, container: { alignItems: 'center', wrap: 'nowrap' }, ref: containerRef, status: status, readOnly: readOnly, disabled: disabled, children: [showCountryCode && (_jsx(Select, { value: countryCode, onChange: onSelectChange, required: required, status: status, readOnly: readOnly, disabled: disabled, children: codesOptions }, void 0)), _jsx(Input, { ...restProps, inputMode: 'tel', ref: inputRef, value: phoneNumber, onChange: onInputChange, required: required, status: status, readOnly: readOnly, disabled: disabled }, void 0)] }, void 0));
77
+ return label ? (_jsx(FormField, { as: 'fieldset', labelAs: 'legend', ...{ label, labelHidden, id, info, ref, status, required, disabled }, children: Comp }, void 0)) : (Comp);
77
78
  });
78
79
  export default PhoneInput;
79
80
  //# sourceMappingURL=PhoneInput.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PhoneInput.js","sourceRoot":"","sources":["../../../src/components/Phone/PhoneInput.tsx"],"names":[],"mappings":";AAAA,OAAO,EAEL,UAAU,EAIV,SAAS,EACT,OAAO,EACP,MAAM,EACN,QAAQ,EACT,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,EAAoB,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACrE,OAAO,WAAW,MAAM,uBAAuB,CAAC;AAChD,OAAO,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,KAAK,MAAM,UAAU,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE3D,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EACL,uBAAuB,EACvB,0BAA0B,EAC1B,iBAAiB,EACjB,mBAAmB,EACpB,MAAM,SAAS,CAAC;AAsBjB,MAAM,gBAAgB,GAAG,MAAM,CAAC,GAAG,CAA8B,GAAG,EAAE;IACpE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ACd,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,YAClB,aACe,CACpB,CAAC;IAEF,OAAO,KAAK,CAAC,CAAC,CAAC,CACb,KAAC,SAAS,kBACR,EAAE,EAAC,UAAU,EACb,OAAO,EAAC,QAAQ,IACZ,EAAE,KAAK,EAAE,WAAW,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,cAEpE,IAAI,YACK,CACb,CAAC,CAAC,CAAC,CACF,IAAI,CACL,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["import {\n ChangeEvent,\n forwardRef,\n FunctionComponent,\n PropsWithoutRef,\n Ref,\n useEffect,\n useMemo,\n useRef,\n useState\n} from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { defaultThemeProp } from '../../theme';\nimport { BaseProps, ForwardProps, PropsWithDefaults } from '../../types';\nimport FormField from '../FormField';\nimport { FormControlProps, StyledFormControl } from '../FormControl';\nimport StyledInput from '../Input/Input.styles';\nimport Select, { Option } from '../Select';\nimport Input from '../Input';\nimport { StyledSelect } from '../Select/Select';\nimport Flex from '../Flex';\nimport { useDirection, useFocusWithin } from '../../hooks';\n\nimport callingCodes from './callingCodes';\nimport {\n calculateCursorPosition,\n convertToCallbackParameter,\n formatPhoneNumber,\n getPhoneNumberParts\n} from './utils';\n\nexport interface PhoneInputProps extends FormControlProps, BaseProps {\n /**\n * Display select with countries calling codes\n * @default false\n */\n showCountryCode?: boolean;\n /** Changes lists of countries calling codes */\n callingCodesList?: string[];\n /** Callback fired on input value change */\n onChange?: (value: string) => void;\n /** Callback fired when the component loses focus */\n onBlur?: (value: string) => void;\n /** CCallback fired when the component gets focus */\n onFocus?: (value: string) => void;\n /** Ref for the wrapping element. */\n ref?: Ref<HTMLDivElement>;\n}\n\ntype PhoneInputPropsWithDefaults = PropsWithDefaults<PhoneInputProps>;\n\nconst StyledPhoneInput = styled.div<PhoneInputPropsWithDefaults>(() => {\n const { start, end } = useDirection();\n return css`\n border: 0;\n > ${StyledSelect} {\n max-width: max-content;\n border-inline-end: none;\n border-top-${end}-radius: 0;\n border-bottom-${end}-radius: 0;\n }\n\n > ${StyledSelect} + ${StyledInput} {\n border-top-${start}-radius: 0;\n border-bottom-${start}-radius: 0;\n }\n `;\n});\n\nStyledPhoneInput.defaultProps = defaultThemeProp;\n\nconst PhoneInput: FunctionComponent<PhoneInputProps & ForwardProps> = forwardRef(\n (props: PropsWithoutRef<PhoneInputProps>, ref: PhoneInputProps['ref']) => {\n const {\n defaultValue,\n value = defaultValue,\n id,\n label,\n labelHidden,\n info,\n status,\n required,\n readOnly,\n disabled,\n showCountryCode = false,\n callingCodesList = callingCodes,\n onChange,\n onBlur,\n onFocus,\n ...restProps\n } = props;\n\n const phoneNumberParts = useMemo(() => {\n return value ? getPhoneNumberParts(value, callingCodesList) : undefined;\n }, [callingCodesList, value]);\n\n const [countryCode, setCountryCode] = useState(phoneNumberParts?.[0]);\n\n const [phoneNumber, setPhoneNumber] = useState(\n phoneNumberParts ? formatPhoneNumber(phoneNumberParts[1], countryCode) : ''\n );\n\n const [cursor, setCursor] = useState<number | undefined>(undefined);\n const inputRef = useRef<HTMLInputElement>(null);\n\n useEffect(() => {\n if (cursor !== undefined) inputRef.current?.setSelectionRange(cursor, cursor);\n }, [cursor, inputRef.current]);\n\n const onFocusChange = (focused: boolean) => {\n const callbackParam = convertToCallbackParameter(countryCode, phoneNumber);\n if (focused) onFocus?.(callbackParam);\n else onBlur?.(callbackParam);\n };\n\n const containerRef = useRef<HTMLElement>(null);\n useFocusWithin([containerRef], onFocusChange);\n\n const onInputChange = (e: ChangeEvent<HTMLInputElement>) => {\n const inputValue = e.target.value;\n const selectionStart = e.target.selectionStart;\n const formatted = formatPhoneNumber(inputValue, countryCode);\n setPhoneNumber(formatted);\n if (countryCode) {\n setCursor(calculateCursorPosition(formatted, phoneNumber, countryCode, selectionStart));\n }\n onChange?.(convertToCallbackParameter(countryCode, formatted));\n };\n\n const onSelectChange = (e: ChangeEvent<HTMLSelectElement>) => {\n const selectValue = e.target.value;\n setCountryCode(selectValue);\n setPhoneNumber(formatPhoneNumber(phoneNumber, selectValue));\n onChange?.(convertToCallbackParameter(selectValue, phoneNumber));\n };\n\n const codesOptions = (\n <>\n {!countryCode && (\n <Option key='none' value=''>\n {' '}\n </Option>\n )}\n {callingCodesList.map(code => (\n <Option key={code} value={code}>\n {code}\n </Option>\n ))}\n </>\n );\n\n const Comp = (\n <StyledPhoneInput\n as={StyledFormControl}\n forwardedAs={Flex as any}\n container={{ alignItems: 'center', wrap: 'nowrap' }}\n ref={containerRef}\n status={status}\n readOnly={readOnly}\n disabled={disabled}\n >\n {showCountryCode && (\n <Select\n value={countryCode}\n onChange={onSelectChange}\n required={required}\n status={status}\n readOnly={readOnly}\n disabled={disabled}\n >\n {codesOptions}\n </Select>\n )}\n <Input\n {...restProps}\n inputMode='tel'\n ref={inputRef}\n value={phoneNumber}\n onChange={onInputChange}\n required={required}\n status={status}\n readOnly={readOnly}\n disabled={disabled}\n />\n </StyledPhoneInput>\n );\n\n return label ? (\n <FormField\n as='fieldset'\n labelAs='legend'\n {...{ label, labelHidden, id, info, ref, status, required, disabled }}\n >\n {Comp}\n </FormField>\n ) : (\n Comp\n );\n }\n);\n\nexport default PhoneInput;\n"]}
1
+ {"version":3,"file":"PhoneInput.js","sourceRoot":"","sources":["../../../src/components/Phone/PhoneInput.tsx"],"names":[],"mappings":";AAAA,OAAO,EAEL,UAAU,EAIV,SAAS,EACT,OAAO,EACP,MAAM,EACN,QAAQ,EACT,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,qBAAqB,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClF,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,OAAO,SAAS,M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styled, { css } from 'styled-components';\n\nimport { useAfterInitialEffect, useDirection, useFocusWithin } from '../../hooks';\nimport { defaultThemeProp } from '../../theme';\nimport { BaseProps, ForwardProps, NoChildrenProp, PropsWithDefaults } from '../../types';\nimport FormField from '../FormField';\nimport { FormControlProps, StyledFormControl } from '../FormControl';\nimport StyledInput from '../Input/Input.styles';\nimport Select, { Option } from '../Select';\nimport Input from '../Input';\nimport { StyledSelect } from '../Select/Select';\nimport Flex from '../Flex';\n\nimport callingCodes from './callingCodes';\nimport {\n calculateCursorPosition,\n convertToCallbackParameter,\n formatPhoneNumber,\n getPhoneNumberParts\n} from './utils';\n\nexport interface PhoneInputProps extends FormControlProps, BaseProps, NoChildrenProp {\n /**\n * Display select with countries calling codes\n * @default false\n */\n showCountryCode?: boolean;\n /** Changes lists of countries calling codes */\n callingCodesList?: string[];\n /** Callback fired on input value change */\n onChange?: (value: string) => void;\n /** Callback fired when the component loses focus */\n onBlur?: (value: string) => void;\n /** CCallback fired when the component gets focus */\n onFocus?: (value: string) => void;\n /** Ref for the wrapping element. */\n ref?: Ref<HTMLDivElement>;\n}\n\ntype PhoneInputPropsWithDefaults = PropsWithDefaults<PhoneInputProps>;\n\nconst StyledPhoneInput = styled.div<PhoneInputPropsWithDefaults>(() => {\n const { start, end } = useDirection();\n return css`\n border: 0;\n > ${StyledSelect} {\n max-width: max-content;\n border-inline-end: none;\n ${`border-top-${end}-radius`}: 0;\n ${`border-bottom-${end}-radius`}: 0;\n }\n\n > ${StyledSelect} + ${StyledInput} {\n ${`border-top-${start}-radius`}: 0;\n ${`border-bottom-${start}-radius`}: 0;\n }\n `;\n});\n\nStyledPhoneInput.defaultProps = defaultThemeProp;\n\nconst PhoneInput: FunctionComponent<PhoneInputProps & ForwardProps> = forwardRef(\n (props: PropsWithoutRef<PhoneInputProps>, ref: PhoneInputProps['ref']) => {\n const {\n defaultValue,\n value = defaultValue,\n id,\n label,\n labelHidden,\n info,\n status,\n required,\n readOnly,\n disabled,\n showCountryCode = false,\n callingCodesList = callingCodes,\n onChange,\n onBlur,\n onFocus,\n ...restProps\n } = props;\n\n const phoneNumberParts = useMemo(() => {\n return value ? getPhoneNumberParts(value, callingCodesList) : undefined;\n }, [callingCodesList, value]);\n\n const [countryCode, setCountryCode] = useState(\n showCountryCode ? phoneNumberParts?.[0] || callingCodesList[0] : phoneNumberParts?.[0]\n );\n\n const [phoneNumber, setPhoneNumber] = useState(\n phoneNumberParts ? formatPhoneNumber(phoneNumberParts[1], countryCode) : ''\n );\n\n useAfterInitialEffect(() => {\n setCountryCode(phoneNumberParts?.[0]);\n setPhoneNumber(phoneNumberParts ? formatPhoneNumber(phoneNumberParts[1], countryCode) : '');\n }, [phoneNumberParts]);\n\n const [cursor, setCursor] = useState<number | undefined>(undefined);\n const inputRef = useRef<HTMLInputElement>(null);\n\n useEffect(() => {\n if (cursor !== undefined) inputRef.current?.setSelectionRange(cursor, cursor);\n }, [cursor, inputRef.current]);\n\n const onFocusChange = (focused: boolean) => {\n const callbackParam = convertToCallbackParameter(countryCode, phoneNumber);\n if (focused) onFocus?.(callbackParam);\n else onBlur?.(callbackParam);\n };\n\n const containerRef = useRef<HTMLElement>(null);\n useFocusWithin([containerRef], onFocusChange);\n\n const onInputChange = (e: ChangeEvent<HTMLInputElement>) => {\n const inputValue = e.target.value;\n const selectionStart = e.target.selectionStart;\n const formatted = formatPhoneNumber(inputValue, countryCode);\n setPhoneNumber(formatted);\n if (countryCode) {\n setCursor(calculateCursorPosition(formatted, phoneNumber, countryCode, selectionStart));\n }\n onChange?.(convertToCallbackParameter(countryCode, formatted));\n };\n\n const onSelectChange = (e: ChangeEvent<HTMLSelectElement>) => {\n const selectValue = e.target.value;\n setCountryCode(selectValue);\n setPhoneNumber(formatPhoneNumber(phoneNumber, selectValue));\n onChange?.(convertToCallbackParameter(selectValue, phoneNumber));\n };\n\n const codesOptions = (\n <>\n {callingCodesList.map(code => (\n <Option key={code} value={code}>\n {code}\n </Option>\n ))}\n </>\n );\n\n const Comp = (\n <StyledPhoneInput\n as={StyledFormControl}\n forwardedAs={Flex as any}\n container={{ alignItems: 'center', wrap: 'nowrap' }}\n ref={containerRef}\n status={status}\n readOnly={readOnly}\n disabled={disabled}\n >\n {showCountryCode && (\n <Select\n value={countryCode}\n onChange={onSelectChange}\n required={required}\n status={status}\n readOnly={readOnly}\n disabled={disabled}\n >\n {codesOptions}\n </Select>\n )}\n <Input\n {...restProps}\n inputMode='tel'\n ref={inputRef}\n value={phoneNumber}\n onChange={onInputChange}\n required={required}\n status={status}\n readOnly={readOnly}\n disabled={disabled}\n />\n </StyledPhoneInput>\n );\n\n return label ? (\n <FormField\n as='fieldset'\n labelAs='legend'\n {...{ label, labelHidden, id, info, ref, status, required, disabled }}\n >\n {Comp}\n </FormField>\n ) : (\n Comp\n );\n }\n);\n\nexport default PhoneInput;\n"]}
@@ -3,17 +3,16 @@ export const getPhoneNumberParts = (phoneNumber, codesList) => {
3
3
  if (!phoneNumber.startsWith('+') || phoneNumber.startsWith('+0'))
4
4
  return [undefined, phoneNumber];
5
5
  const countryCode = codesList.find(code => phoneNumber.startsWith(code));
6
- const subscriberNumber = phoneNumber.substring((countryCode === null || countryCode === void 0 ? void 0 : countryCode.length) || 0);
6
+ const subscriberNumber = phoneNumber.substring(countryCode?.length || 0);
7
7
  return [countryCode, subscriberNumber];
8
8
  };
9
9
  export const cleanNumber = (phoneNumber) => {
10
10
  return phoneNumber.replace(/\D/g, '');
11
11
  };
12
12
  export const getCountry = (countryCode, number) => {
13
- var _a;
14
13
  const asYouTypeCode = new AsYouType();
15
14
  asYouTypeCode.input(countryCode + number);
16
- return countryCode === '+1' ? 'US' : (_a = asYouTypeCode.getNumber()) === null || _a === void 0 ? void 0 : _a.country;
15
+ return countryCode === '+1' ? 'US' : asYouTypeCode.getNumber()?.country;
17
16
  };
18
17
  export const formatPhoneNumber = (numberToFormat, countryCode = '') => {
19
18
  let formatted = cleanNumber(numberToFormat);
@@ -1 +1 @@
1
- {"version":3,"file":"utils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AG,YAAY,CAAC,WAAW,EAAE,CAAC,MAAM,EAAE;YAC5D,IAAI,KAAK,KAAK,YAAY,EAAE;gBAC1B,MAAM;aACP;YACD,IAAI,YAAY,CAAC,WAAW,EAAE,CAAC,iBAAiB,CAAC,KAAK,GAAG,EAAE;gBACzD,KAAK,IAAI,CAAC,CAAC;aACZ;YACD,iBAAiB,IAAI,CAAC,CAAC;SACxB;QACD,OAAO,iBAAiB,CAAC;KAC1B;AACH,CAAC,CAAC;AAEF,eAAe,mBAAmB,CAAC","sourcesContent":["import { AsYouType, formatIncompletePhoneNumber } from 'libphonenumber-js';\n\nexport const getPhoneNumberParts = (\n phoneNumber: string,\n codesList: string[]\n): [string | undefined, string] => {\n if (!phoneNumber.startsWith('+') || phoneNumber.startsWith('+0')) return [undefined, phoneNumber];\n const countryCode = codesList.find(code => phoneNumber.startsWith(code));\n const subscriberNumber = phoneNumber.substring(countryCode?.length || 0);\n return [countryCode, subscriberNumber];\n};\n\nexport const cleanNumber = (phoneNumber: string) => {\n return phoneNumber.replace(/\\D/g, '');\n};\n\nexport const getCountry = (countryCode: string, number: string) => {\n const asYouTypeCode = new AsYouType();\n asYouTypeCode.input(countryCode + number);\n return countryCode === '+1' ? 'US' : asYouTypeCode.getNumber()?.country;\n};\n\nexport const formatPhoneNumber = (numberToFormat: string, countryCode: string = '') => {\n let formatted = cleanNumber(numberToFormat);\n if (countryCode) {\n const country = getCountry(countryCode, formatted);\n formatted = formatIncompletePhoneNumber(formatted, country);\n }\n return formatted;\n};\n\nexport const convertToCallbackParameter = (codePart: string | undefined, numberPart: string) => {\n return [codePart, cleanNumber(numberPart)].join('');\n};\n\nexport const calculateCursorPosition = (\n newValue: string,\n prevValue: string,\n countryCode: string,\n prevCursorPosition: number | null\n) => {\n if (prevCursorPosition !== undefined && prevCursorPosition !== null) {\n const country = getCountry(countryCode, cleanNumber(newValue));\n let numbersCount = cleanNumber(prevValue.slice(0, prevCursorPosition - 1)).length + 1;\n\n if (cleanNumber(prevValue).length > cleanNumber(newValue).length) {\n numbersCount = cleanNumber(prevValue.slice(0, prevCursorPosition)).length;\n }\n\n let newCursorPosition = 0;\n let count = 0;\n const asYouTypeNew = new AsYouType(country);\n asYouTypeNew.input(newValue);\n while (newCursorPosition < asYouTypeNew.getTemplate().length) {\n if (count === numbersCount) {\n break;\n }\n if (asYouTypeNew.getTemplate()[newCursorPosition] === 'x') {\n count += 1;\n }\n newCursorPosition += 1;\n }\n return newCursorPosition;\n }\n};\n\nexport default getPhoneNumberParts;\n"]}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/components/Phone/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AAE3E,MAAM,CAAC,MAAM,mBAAmB,GAAG,CACjC,WAAmB,EACnB,SAAmB,EACW,EAAE;IAChC,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,WAAW,CAAC,UAAU,CAAC,IAAI,CAAC;QAAE,OAAO,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;IAClG,MAAM,WAAW,GAAG,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,WAAW,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;IACzE,MAAM,gBAAgB,GAAG,WAAW,CAAC,SAAS,CAAC,WAAW,EAAE,MAAM,IAAI,CAAC,CAAC,CAAC;IACzE,OAAO,CAAC,WAAW,EAAE,gBAAgB,CAAC,CAAC;AACzC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,WAAmB,EAAE,EAAE;IACjD,OAAO,WAAW,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AACxC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,WAAmB,EAAE,MAAc,EAAE,EAAE;IAChE,MAAM,aAAa,GAAG,IAAI,SAAS,EAAE,CA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AAG,WAAW,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,kBAAkB,CAAC,CAAC,CAAC,MAAM,CAAC;SAC3E;QAED,IAAI,iBAAiB,GAAG,CAAC,CAAC;QAC1B,IAAI,KAAK,GAAG,CAAC,CAAC;QACd,MAAM,YAAY,GAAG,IAAI,SAAS,CAAC,OAAO,CAAC,CAAC;QAC5C,YAAY,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAC7B,OAAO,iBAAiB,GAAG,YAAY,CAAC,WAAW,EAAE,CAAC,MAAM,EAAE;YAC5D,IAAI,KAAK,KAAK,YAAY,EAAE;gBAC1B,MAAM;aACP;YACD,IAAI,YAAY,CAAC,WAAW,EAAE,CAAC,iBAAiB,CAAC,KAAK,GAAG,EAAE;gBACzD,KAAK,IAAI,CAAC,CAAC;aACZ;YACD,iBAAiB,IAAI,CAAC,CAAC;SACxB;QACD,OAAO,iBAAiB,CAAC;KAC1B;AACH,CAAC,CAAC;AAEF,eAAe,mBAAmB,CAAC","sourcesContent":["import { AsYouType, formatIncompletePhoneNumber } from 'libphonenumber-js';\n\nexport const getPhoneNumberParts = (\n phoneNumber: string,\n codesList: string[]\n): [string | undefined, string] => {\n if (!phoneNumber.startsWith('+') || phoneNumber.startsWith('+0')) return [undefined, phoneNumber];\n const countryCode = codesList.find(code => phoneNumber.startsWith(code));\n const subscriberNumber = phoneNumber.substring(countryCode?.length || 0);\n return [countryCode, subscriberNumber];\n};\n\nexport const cleanNumber = (phoneNumber: string) => {\n return phoneNumber.replace(/\\D/g, '');\n};\n\nexport const getCountry = (countryCode: string, number: string) => {\n const asYouTypeCode = new AsYouType();\n asYouTypeCode.input(countryCode + number);\n return countryCode === '+1' ? 'US' : asYouTypeCode.getNumber()?.country;\n};\n\nexport const formatPhoneNumber = (numberToFormat: string, countryCode: string = '') => {\n let formatted = cleanNumber(numberToFormat);\n if (countryCode) {\n const country = getCountry(countryCode, formatted);\n formatted = formatIncompletePhoneNumber(formatted, country);\n }\n return formatted;\n};\n\nexport const convertToCallbackParameter = (codePart: string | undefined, numberPart: string) => {\n return [codePart, cleanNumber(numberPart)].join('');\n};\n\nexport const calculateCursorPosition = (\n newValue: string,\n prevValue: string,\n countryCode: string,\n prevCursorPosition: number | null\n) => {\n if (prevCursorPosition !== undefined && prevCursorPosition !== null) {\n const country = getCountry(countryCode, cleanNumber(newValue));\n let numbersCount = cleanNumber(prevValue.slice(0, prevCursorPosition - 1)).length + 1;\n\n if (cleanNumber(prevValue).length > cleanNumber(newValue).length) {\n numbersCount = cleanNumber(prevValue.slice(0, prevCursorPosition)).length;\n }\n\n let newCursorPosition = 0;\n let count = 0;\n const asYouTypeNew = new AsYouType(country);\n asYouTypeNew.input(newValue);\n while (newCursorPosition < asYouTypeNew.getTemplate().length) {\n if (count === numbersCount) {\n break;\n }\n if (asYouTypeNew.getTemplate()[newCursorPosition] === 'x') {\n count += 1;\n }\n newCursorPosition += 1;\n }\n return newCursorPosition;\n }\n};\n\nexport default getPhoneNumberParts;\n"]}
@@ -57,10 +57,6 @@ export interface PopoverProps<Modifiers extends string = string> extends BasePro
57
57
  /** The ref of the wrapping element. */
58
58
  ref?: Ref<HTMLDivElement>;
59
59
  }
60
- export declare const StyledPopoverArrow: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
61
- export declare const StyledPopover: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
62
- offset?: number | undefined;
63
- }, never>;
64
60
  declare const Popover: <Modifiers extends string = string>(props: PopoverProps<Modifiers> & ForwardProps) => ReactElement | null;
65
61
  export default Popover;
66
62
  //# sourceMappingURL=Popover.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Popover.d.ts","sourceRoot":"","sources":["../../../src/components/Popover/Popover.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,GAAG,EAEH,YAAY,EAEZ,SAAS,EAIV,MAAM,OAAO,CAAC;AAEf,OAAO,EAAa,WAAW,EAAE,MAAM,cAAc,CAA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IAClC,QAAQ,EAAE,SAAS,CAAC;IACpB,uCAAuC;IACvC,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC3B;AAQD,QAAA,MAAM,OAAO,EAAE,CAAC,SAAS,SAAS,MAAM,GAAG,MAAM,EAC/C,KAAK,EAAE,YAAY,CAAC,SAAS,CAAC,GAAG,YAAY,KAC1C,YAAY,GAAG,IAyHnB,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -2,124 +2,10 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { forwardRef, useContext, useRef, useEffect, useMemo, useState } from 'react';
3
3
  import { createPortal } from 'react-dom';
4
4
  import { usePopper } from 'react-popper';
5
- import styled, { css } from 'styled-components';
6
5
  import { useConfiguration, useConsolidatedRef, useElement, useUID } from '../../hooks';
7
- import { defaultThemeProp } from '../../theme';
8
6
  import { windowIsAvailable } from '../../utils';
9
7
  import { PopoverManagerContext } from './PopoverContext';
10
- export const StyledPopoverArrow = styled.div `
11
- background-color: inherit;
12
- height: 0;
13
- width: 0;
14
-
15
- ::after {
16
- content: '';
17
- display: block;
18
- background-color: inherit;
19
- height: 0.5rem;
20
- width: 0.5rem;
21
- transform: rotate(45deg);
22
- }
23
- `;
24
- export const StyledPopover = styled.div(({ theme: { base: { 'border-radius': borderRadius, 'z-index': { popover: zIndex }, shadow: { 'low-filter': low } }, components: { card: { background, 'border-radius': cardBorderRadius } } }, offset }) => {
25
- return css `
26
- /*
27
- Margin should never be used with Popper.
28
- https://popper.js.org/docs/v2/migration-guide/#4-remove-all-css-margins
29
- */
30
- margin: 0 !important;
31
- z-index: ${zIndex};
32
- background-color: ${background};
33
- border-radius: calc(${cardBorderRadius} / 2);
34
- filter: ${low};
35
-
36
- &[data-popper-reference-hidden='true'] {
37
- visibility: hidden;
38
- pointer-events: none;
39
- }
40
-
41
- &[data-popper-placement^='top'] {
42
- > ${StyledPopoverArrow} {
43
- top: calc(100% - 0.25rem);
44
- margin-inline-start: -0.25rem;
45
-
46
- ::after {
47
- border-bottom-right-radius: calc(${borderRadius} / 4);
48
- }
49
- }
50
-
51
- ::before {
52
- content: '';
53
- position: absolute;
54
- height: ${offset}px;
55
- bottom: -${offset}px;
56
- left: 0;
57
- right: 0;
58
- }
59
- }
60
-
61
- &[data-popper-placement^='bottom'] {
62
- > ${StyledPopoverArrow} {
63
- bottom: calc(100% + 0.25rem);
64
- margin-inline-start: -0.25rem;
65
-
66
- ::after {
67
- border-top-left-radius: calc(${borderRadius} / 4);
68
- }
69
- }
70
-
71
- ::before {
72
- content: '';
73
- position: absolute;
74
- height: ${offset}px;
75
- top: -${offset}px;
76
- left: 0;
77
- right: 0;
78
- }
79
- }
80
-
81
- &[data-popper-placement^='right'] {
82
- > ${StyledPopoverArrow} {
83
- right: calc(100% + 0.25rem);
84
- margin-block-start: -0.25rem;
85
-
86
- ::after {
87
- border-bottom-left-radius: calc(${borderRadius} / 4);
88
- }
89
- }
90
-
91
- ::before {
92
- content: '';
93
- position: absolute;
94
- width: ${offset}px;
95
- left: -${offset}px;
96
- top: 0;
97
- bottom: 0;
98
- }
99
- }
100
-
101
- &[data-popper-placement^='left'] {
102
- > ${StyledPopoverArrow} {
103
- left: calc(100% - 0.25rem);
104
- margin-block-start: -0.25rem;
105
-
106
- ::after {
107
- border-top-right-radius: calc(${borderRadius} / 4);
108
- }
109
- }
110
-
111
- ::before {
112
- content: '';
113
- position: absolute;
114
- width: ${offset}px;
115
- right: -${offset}px;
116
- top: 0;
117
- bottom: 0;
118
- }
119
- }
120
- `;
121
- });
122
- StyledPopover.defaultProps = defaultThemeProp;
8
+ import { StyledPopover, StyledPopoverArrow } from './Popover.styles';
123
9
  const delays = {
124
10
  none: 0,
125
11
  short: 500,
@@ -144,15 +30,26 @@ const Popover = forwardRef(({ show = true, portal = false, target, placement, st
144
30
  },
145
31
  { name: 'hide', enabled: hideOnTargetHidden },
146
32
  { name: 'arrow', enabled: arrow, options: { element: arrowRef.current } },
33
+ {
34
+ name: 'preventOverflow',
35
+ options: {
36
+ tether: !modifiers.find(m => m.name === 'sameWidth')
37
+ }
38
+ },
39
+ {
40
+ name: 'computeStyles',
41
+ options: {
42
+ gpuAcceleration: false
43
+ }
44
+ },
147
45
  ...modifiers
148
46
  ], [modifiers, arrow, hideOnTargetHidden]);
149
47
  const offset = useMemo(() => {
150
- var _a, _b, _c;
151
48
  const offsetModifier = [...memoedModifiers]
152
49
  .reverse()
153
50
  .find(m => m.name === 'offset' && m.enabled !== false);
154
- return Array.isArray((_a = offsetModifier === null || offsetModifier === void 0 ? void 0 : offsetModifier.options) === null || _a === void 0 ? void 0 : _a.offset)
155
- ? (_c = (_b = offsetModifier === null || offsetModifier === void 0 ? void 0 : offsetModifier.options) === null || _b === void 0 ? void 0 : _b.offset[1]) !== null && _c !== void 0 ? _c : 0
51
+ return Array.isArray(offsetModifier?.options?.offset)
52
+ ? offsetModifier?.options?.offset[1] ?? 0
156
53
  : 0;
157
54
  }, [memoedModifiers]);
158
55
  const { styles, attributes, forceUpdate } = usePopper(target, popperRef.current, {
@@ -164,8 +61,7 @@ const Popover = forwardRef(({ show = true, portal = false, target, placement, st
164
61
  forceUpdateRef.current = forceUpdate;
165
62
  useEffect(() => {
166
63
  const observer = new ResizeObserver(() => {
167
- var _a;
168
- (_a = forceUpdateRef.current) === null || _a === void 0 ? void 0 : _a.call(forceUpdateRef);
64
+ forceUpdateRef.current?.();
169
65
  });
170
66
  if (popperRef.current)
171
67
  observer.observe(popperRef.current);
@@ -192,8 +88,7 @@ const Popover = forwardRef(({ show = true, portal = false, target, placement, st
192
88
  useEffect(() => {
193
89
  return () => clearTimeout(timeout.current);
194
90
  }, []);
195
- const content = (_jsxs(StyledPopover, Object.assign({}, restProps, { offset: offset, ref: popperRef, style: { ...style, ...styles.popper } }, attributes.popper, { children: [arrow && _jsx(StyledPopoverArrow, { ref: arrowRef, style: { ...styles.arrow } }, void 0),
196
- children] }), void 0));
91
+ const content = (_jsxs(StyledPopover, { ...restProps, offset: offset, ref: popperRef, style: { ...style, ...styles.popper }, ...attributes.popper, children: [arrow && _jsx(StyledPopoverArrow, { ref: arrowRef, style: { ...styles.arrow } }, void 0), children] }, void 0));
197
92
  if (!target || !showPopover || (groupId && !checkActive(uid, groupId)))
198
93
  return null;
199
94
  return portal && portalTarget ? createPortal(content, portalTarget) : content;
@@ -1 +1 @@
1
- {"version":3,"file":"Popover.js","sourceRoot":"","sources":["../../../src/components/Popover/Popover.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,UAAU,EACV,UAAU,EAKV,MAAM,EAEN,SAAS,EACT,OAAO,EACP,QAAQ,EACT,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,SAAS,EAAe,MAAM,cAAc,CAAC;AAGtD,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAGhD,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACvF,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AA0DzD,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;CAa3C,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,GAAG,CACrC,CAAC,EACC,KAAK,EAAE,EACL,IAAI,EAAE,EACJ,eAAe,EAAE,YAAY,EAC7B,SAAS,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,EAC9B,MAAM,EAAE,EAAE,YAAY,EAAE,GAAG,EAAE,EAC9B,EACD,UAAU,EAAE,EACV,IAAI,EAAE,EAAE,UAAU,EAAE,eAAe,EAAE,gBAAgB,EAAE,EACxD,EACF,E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SACtB;IACH,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;IAEX,SAAS,CAAC,GAAG,EAAE;QACb,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAC7C,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,OAAO,GAAG,CACd,MAAC,aAAa,oBACR,SAAS,IACb,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,SAAS,EACd,KAAK,EAAE,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,IACjC,UAAU,CAAC,MAAM,eAEpB,KAAK,IAAI,KAAC,kBAAkB,IAAC,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,GAAG,MAAM,CAAC,KAAK,EAAE,WAAI;YAC1E,QAAQ,aACK,CACjB,CAAC;IAEF,IAAI,CAAC,MAAM,IAAI,CAAC,WAAW,IAAI,CAAC,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QAAE,OAAO,IAAI,CAAC;IAEpF,OAAO,MAAM,IAAI,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;AAChF,CAAC,CACF,CAAC;AAEF,eAAe,OAAO,CAAC","sourcesContent":["import {\n forwardRef,\n useContext,\n PropsWithoutRef,\n Ref,\n CSSProperties,\n ReactElement,\n useRef,\n ReactNode,\n useEffect,\n useMemo,\n useState\n} from 'react';\nimport { createPortal } from 'react-dom';\nimport { usePopper, PopperProps } from 'react-popper';\nimport { VirtualElement } from '@popperjs/core';\nimport { OffsetModifier } from '@popperjs/core/lib/modifiers/offset';\nimport styled, { css } from 'styled-components';\n\nimport { BaseProps, ForwardProps } from '../../types';\nimport { useConfiguration, useConsolidatedRef, useElement, useUID } from '../../hooks';\nimport { defaultThemeProp } from '../../theme';\nimport { windowIsAvailable } from '../../utils';\n\nimport { PopoverManagerContext } from './PopoverContext';\n\nexport type Delay = 'none' | 'short' | 'long';\nexport interface PopoverProps<Modifiers extends string = string> extends BaseProps {\n /** The DOM element or [virtual element](https://popper.js.org/docs/v2/virtual-elements) that the Popover is positioned in reference to. */\n target: Element | VirtualElement | null;\n /**\n * If true, the Popover will be visible.\n * @default true\n */\n show?: boolean;\n /**\n * If true, the Popover will render outside of the current DOM hierarchy in a [portal](https://reactjs.org/docs/portals.html).\n * @default false\n */\n portal?: boolean;\n /**\n * Delay on showing the Popover.\n * @default \"none\"\n */\n showDelay?: Delay;\n /**\n * Delay on hiding the Popover.\n * @default \"none\"\n */\n hideDelay?: Delay;\n /**\n * [React Popper Placement](https://popper.js.org/react-popper/v2/render-props/#placement)\n */\n placement?: PopperProps<Modifiers>['placement'];\n /**\n * [React Popper Strategy](https://popper.js.org/react-popper/v2/render-props/#strategy)\n * @default \"absolute\"\n */\n strategy?: PopperProps<Modifiers>['strategy'];\n /**\n * [React Popper Modifiers](https://popper.js.org/react-popper/v2/render-props/#modifiers)\n * @default []\n */\n modifiers?: PopperProps<Modifiers>['modifiers'];\n /**\n * If true, an arrow will visually identify from which element the Popover is rendered.\n * @default false\n */\n arrow?: boolean;\n /** The group that the Popover belongs to. Popovers in the same group will be closed when others open. */\n groupId?: string;\n /**\n * If true, the Popover will be visibly hidden when its target leaves the viewport.\n * @default false\n */\n hideOnTargetHidden?: boolean;\n /** The content of the Popover. */\n children: ReactNode;\n /** The ref of the wrapping element. */\n ref?: Ref<HTMLDivElement>;\n}\n\nexport const StyledPopoverArrow = styled.div`\n background-color: inherit;\n height: 0;\n width: 0;\n\n ::after {\n content: '';\n display: block;\n background-color: inherit;\n height: 0.5rem;\n width: 0.5rem;\n transform: rotate(45deg);\n }\n`;\n\nexport const StyledPopover = styled.div<{ offset?: number }>(\n ({\n theme: {\n base: {\n 'border-radius': borderRadius,\n 'z-index': { popover: zIndex },\n shadow: { 'low-filter': low }\n },\n components: {\n card: { background, 'border-radius': cardBorderRadius }\n }\n },\n offset\n }) => {\n return css`\n /*\n Margin should never be used with Popper.\n https://popper.js.org/docs/v2/migration-guide/#4-remove-all-css-margins\n */\n margin: 0 !important;\n z-index: ${zIndex};\n background-color: ${background};\n border-radius: calc(${cardBorderRadius} / 2);\n filter: ${low};\n\n &[data-popper-reference-hidden='true'] {\n visibility: hidden;\n pointer-events: none;\n }\n\n &[data-popper-placement^='top'] {\n > ${StyledPopoverArrow} {\n top: calc(100% - 0.25rem);\n margin-inline-start: -0.25rem;\n\n ::after {\n border-bottom-right-radius: calc(${borderRadius} / 4);\n }\n }\n\n ::before {\n content: '';\n position: absolute;\n height: ${offset}px;\n bottom: -${offset}px;\n left: 0;\n right: 0;\n }\n }\n\n &[data-popper-placement^='bottom'] {\n > ${StyledPopoverArrow} {\n bottom: calc(100% + 0.25rem);\n margin-inline-start: -0.25rem;\n\n ::after {\n border-top-left-radius: calc(${borderRadius} / 4);\n }\n }\n\n ::before {\n content: '';\n position: absolute;\n height: ${offset}px;\n top: -${offset}px;\n left: 0;\n right: 0;\n }\n }\n\n &[data-popper-placement^='right'] {\n > ${StyledPopoverArrow} {\n right: calc(100% + 0.25rem);\n margin-block-start: -0.25rem;\n\n ::after {\n border-bottom-left-radius: calc(${borderRadius} / 4);\n }\n }\n\n ::before {\n content: '';\n position: absolute;\n width: ${offset}px;\n left: -${offset}px;\n top: 0;\n bottom: 0;\n }\n }\n\n &[data-popper-placement^='left'] {\n > ${StyledPopoverArrow} {\n left: calc(100% - 0.25rem);\n margin-block-start: -0.25rem;\n\n ::after {\n border-top-right-radius: calc(${borderRadius} / 4);\n }\n }\n\n ::before {\n content: '';\n position: absolute;\n width: ${offset}px;\n right: -${offset}px;\n top: 0;\n bottom: 0;\n }\n }\n `;\n }\n);\n\nStyledPopover.defaultProps = defaultThemeProp;\n\nconst delays = {\n none: 0,\n short: 500,\n long: 1000\n};\n\nconst Popover: <Modifiers extends string = string>(\n props: PopoverProps<Modifiers> & ForwardProps\n) => ReactElement | null = forwardRef(\n (\n {\n show = true,\n portal = false,\n target,\n placement,\n strategy = 'fixed',\n style,\n modifiers = [],\n arrow = false,\n groupId,\n showDelay = 'none',\n hideDelay = 'none',\n hideOnTargetHidden = false,\n children,\n ...restProps\n }: PropsWithoutRef<PopoverProps> & { style?: CSSProperties },\n ref: PopoverProps['ref']\n ) => {\n const { portalTarget } = useConfiguration();\n const { checkActive, setActive } = useContext(PopoverManagerContext);\n const [, setPopperEl] = useElement<HTMLDivElement>();\n const popperRef = useConsolidatedRef<HTMLDivElement>(ref, setPopperEl);\n const arrowRef = useRef<HTMLDivElement>(null);\n const forceUpdateRef = useRef<() => void>();\n const [showPopover, setShowPopover] = useState(show);\n const timeout = useRef<number>();\n const uid = useUID();\n\n const memoedModifiers = useMemo(\n () => [\n {\n name: 'offset',\n options: {\n offset: [0, arrow ? 5.5 : 2]\n }\n },\n { name: 'hide', enabled: hideOnTargetHidden },\n { name: 'arrow', enabled: arrow, options: { element: arrowRef.current } },\n ...modifiers\n ],\n [modifiers, arrow, hideOnTargetHidden]\n );\n\n const offset = useMemo(() => {\n const offsetModifier = [...memoedModifiers]\n .reverse()\n .find(m => m.name === 'offset' && m.enabled !== false) as OffsetModifier | undefined;\n return Array.isArray(offsetModifier?.options?.offset)\n ? offsetModifier?.options?.offset[1] ?? 0\n : 0;\n }, [memoedModifiers]);\n\n const { styles, attributes, forceUpdate } = usePopper(target, popperRef.current, {\n placement,\n strategy,\n modifiers: memoedModifiers\n });\n\n if (forceUpdate) forceUpdateRef.current = forceUpdate;\n\n useEffect(() => {\n const observer = new ResizeObserver(() => {\n forceUpdateRef.current?.();\n });\n\n if (popperRef.current) observer.observe(popperRef.current);\n if (target instanceof Element) observer.observe(target);\n\n return () => {\n observer.disconnect();\n };\n }, [forceUpdate, popperRef.current, target]);\n\n useEffect(() => {\n if (groupId && show) setActive(uid, groupId);\n\n if (windowIsAvailable) {\n if (timeout.current) clearTimeout(timeout.current);\n timeout.current = window.setTimeout(() => {\n setShowPopover(show);\n }, delays[show ? showDelay : hideDelay]);\n } else {\n setShowPopover(show);\n }\n }, [show]);\n\n useEffect(() => {\n return () => clearTimeout(timeout.current);\n }, []);\n\n const content = (\n <StyledPopover\n {...restProps}\n offset={offset}\n ref={popperRef}\n style={{ ...style, ...styles.popper }}\n {...attributes.popper}\n >\n {arrow && <StyledPopoverArrow ref={arrowRef} style={{ ...styles.arrow }} />}\n {children}\n </StyledPopover>\n );\n\n if (!target || !showPopover || (groupId && !checkActive(uid, groupId))) return null;\n\n return portal && portalTarget ? createPortal(content, portalTarget) : content;\n }\n);\n\nexport default Popover;\n"]}
1
+ {"version":3,"file":"Popover.js","sourceRoot":"","sources":["../../../src/components/Popover/Popover.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,UAAU,EACV,UAAU,EAKV,MAAM,EAEN,SAAS,EACT,OAAO,EACP,QAAQ,EACT,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,SAAS,EAAe,MAAM,cAAc,CAAC;AAKtD,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACvF,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AA0DrE,MAAM,MAAM,GAAG;IACb,IAAI,EAAE,CAAC;IACP,KAAK,EAAE,GAAG;IACV,IAAI,EAAE,IAAI;CACX,CAAC;AAEF,MAAM,OAAO,GAEc,UAAU,CACnC,CACE,EACE,IAAI,GAAG,IAAI,EACX,MAAM,GAAG,KAAK,EACd,MAAM,EACN,SAAS,EACT,QAAQ,GAAG,OAAO,EAClB,KAAK,EACL,SAAS,GAAG,EAAE,EACd,KAAK,GAAG,KAAK,EACb,OAAO,EACP,S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C;QAAE,OAAO,IAAI,CAAC;IAEpF,OAAO,MAAM,IAAI,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;AAChF,CAAC,CACF,CAAC;AAEF,eAAe,OAAO,CAAC","sourcesContent":["import {\n forwardRef,\n useContext,\n PropsWithoutRef,\n Ref,\n CSSProperties,\n ReactElement,\n useRef,\n ReactNode,\n useEffect,\n useMemo,\n useState\n} from 'react';\nimport { createPortal } from 'react-dom';\nimport { usePopper, PopperProps } from 'react-popper';\nimport { VirtualElement } from '@popperjs/core';\nimport { OffsetModifier } from '@popperjs/core/lib/modifiers/offset';\n\nimport { BaseProps, ForwardProps } from '../../types';\nimport { useConfiguration, useConsolidatedRef, useElement, useUID } from '../../hooks';\nimport { windowIsAvailable } from '../../utils';\n\nimport { PopoverManagerContext } from './PopoverContext';\nimport { StyledPopover, StyledPopoverArrow } from './Popover.styles';\n\nexport type Delay = 'none' | 'short' | 'long';\nexport interface PopoverProps<Modifiers extends string = string> extends BaseProps {\n /** The DOM element or [virtual element](https://popper.js.org/docs/v2/virtual-elements) that the Popover is positioned in reference to. */\n target: Element | VirtualElement | null;\n /**\n * If true, the Popover will be visible.\n * @default true\n */\n show?: boolean;\n /**\n * If true, the Popover will render outside of the current DOM hierarchy in a [portal](https://reactjs.org/docs/portals.html).\n * @default false\n */\n portal?: boolean;\n /**\n * Delay on showing the Popover.\n * @default \"none\"\n */\n showDelay?: Delay;\n /**\n * Delay on hiding the Popover.\n * @default \"none\"\n */\n hideDelay?: Delay;\n /**\n * [React Popper Placement](https://popper.js.org/react-popper/v2/render-props/#placement)\n */\n placement?: PopperProps<Modifiers>['placement'];\n /**\n * [React Popper Strategy](https://popper.js.org/react-popper/v2/render-props/#strategy)\n * @default \"absolute\"\n */\n strategy?: PopperProps<Modifiers>['strategy'];\n /**\n * [React Popper Modifiers](https://popper.js.org/react-popper/v2/render-props/#modifiers)\n * @default []\n */\n modifiers?: PopperProps<Modifiers>['modifiers'];\n /**\n * If true, an arrow will visually identify from which element the Popover is rendered.\n * @default false\n */\n arrow?: boolean;\n /** The group that the Popover belongs to. Popovers in the same group will be closed when others open. */\n groupId?: string;\n /**\n * If true, the Popover will be visibly hidden when its target leaves the viewport.\n * @default false\n */\n hideOnTargetHidden?: boolean;\n /** The content of the Popover. */\n children: ReactNode;\n /** The ref of the wrapping element. */\n ref?: Ref<HTMLDivElement>;\n}\n\nconst delays = {\n none: 0,\n short: 500,\n long: 1000\n};\n\nconst Popover: <Modifiers extends string = string>(\n props: PopoverProps<Modifiers> & ForwardProps\n) => ReactElement | null = forwardRef(\n (\n {\n show = true,\n portal = false,\n target,\n placement,\n strategy = 'fixed',\n style,\n modifiers = [],\n arrow = false,\n groupId,\n showDelay = 'none',\n hideDelay = 'none',\n hideOnTargetHidden = false,\n children,\n ...restProps\n }: PropsWithoutRef<PopoverProps> & { style?: CSSProperties },\n ref: PopoverProps['ref']\n ) => {\n const { portalTarget } = useConfiguration();\n const { checkActive, setActive } = useContext(PopoverManagerContext);\n const [, setPopperEl] = useElement<HTMLDivElement>();\n const popperRef = useConsolidatedRef<HTMLDivElement>(ref, setPopperEl);\n const arrowRef = useRef<HTMLDivElement>(null);\n const forceUpdateRef = useRef<() => void>();\n const [showPopover, setShowPopover] = useState(show);\n const timeout = useRef<number>();\n const uid = useUID();\n\n const memoedModifiers = useMemo(\n () => [\n {\n name: 'offset',\n options: {\n offset: [0, arrow ? 5.5 : 2]\n }\n },\n { name: 'hide', enabled: hideOnTargetHidden },\n { name: 'arrow', enabled: arrow, options: { element: arrowRef.current } },\n {\n name: 'preventOverflow',\n options: {\n tether: !modifiers.find(m => m.name === 'sameWidth')\n }\n },\n {\n name: 'computeStyles',\n options: {\n gpuAcceleration: false\n }\n },\n ...modifiers\n ],\n [modifiers, arrow, hideOnTargetHidden]\n );\n\n const offset = useMemo(() => {\n const offsetModifier = [...memoedModifiers]\n .reverse()\n .find(m => m.name === 'offset' && m.enabled !== false) as OffsetModifier | undefined;\n return Array.isArray(offsetModifier?.options?.offset)\n ? offsetModifier?.options?.offset[1] ?? 0\n : 0;\n }, [memoedModifiers]);\n\n const { styles, attributes, forceUpdate } = usePopper(target, popperRef.current, {\n placement,\n strategy,\n modifiers: memoedModifiers\n });\n\n if (forceUpdate) forceUpdateRef.current = forceUpdate;\n\n useEffect(() => {\n const observer = new ResizeObserver(() => {\n forceUpdateRef.current?.();\n });\n\n if (popperRef.current) observer.observe(popperRef.current);\n if (target instanceof Element) observer.observe(target);\n\n return () => {\n observer.disconnect();\n };\n }, [forceUpdate, popperRef.current, target]);\n\n useEffect(() => {\n if (groupId && show) setActive(uid, groupId);\n\n if (windowIsAvailable) {\n if (timeout.current) clearTimeout(timeout.current);\n timeout.current = window.setTimeout(() => {\n setShowPopover(show);\n }, delays[show ? showDelay : hideDelay]);\n } else {\n setShowPopover(show);\n }\n }, [show]);\n\n useEffect(() => {\n return () => clearTimeout(timeout.current);\n }, []);\n\n const content = (\n <StyledPopover\n {...restProps}\n offset={offset}\n ref={popperRef}\n style={{ ...style, ...styles.popper }}\n {...attributes.popper}\n >\n {arrow && <StyledPopoverArrow ref={arrowRef} style={{ ...styles.arrow }} />}\n {children}\n </StyledPopover>\n );\n\n if (!target || !showPopover || (groupId && !checkActive(uid, groupId))) return null;\n\n return portal && portalTarget ? createPortal(content, portalTarget) : content;\n }\n);\n\nexport default Popover;\n"]}
@@ -0,0 +1,5 @@
1
+ export declare const StyledPopoverArrow: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
2
+ export declare const StyledPopover: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
3
+ offset?: number | undefined;
4
+ }, never>;
5
+ //# sourceMappingURL=Popover.styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Popover.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Popover/Popover.styles.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,kBAAkB,yGAuB9B,CAAC;AAIF,eAAO,MAAM,aAAa;;SA2HzB,CAAC"}
@@ -0,0 +1,131 @@
1
+ import styled, { css } from 'styled-components';
2
+ import { defaultThemeProp } from '../../theme';
3
+ export const StyledPopoverArrow = styled.div(({ theme: { base: { shadow: { 'low-filter': low } } } }) => css `
4
+ background-color: inherit;
5
+ height: 0;
6
+ width: 0;
7
+ filter: ${low};
8
+ z-index: -1; /* Make sure it's under the Popover. */
9
+
10
+ ::after {
11
+ content: '';
12
+ display: block;
13
+ background-color: inherit;
14
+ height: 0.5rem;
15
+ width: 0.5rem;
16
+ transform: rotate(45deg);
17
+ }
18
+ `);
19
+ StyledPopoverArrow.defaultProps = defaultThemeProp;
20
+ export const StyledPopover = styled.div(({ theme: { base: { 'border-radius': borderRadius, 'z-index': { popover: zIndex }, shadow: { 'low-filter': low } }, components: { card: { background, 'border-radius': cardBorderRadius } } }, offset }) => {
21
+ return css `
22
+ /*
23
+ Margin should never be used with Popper.
24
+ https://popper.js.org/docs/v2/migration-guide/#4-remove-all-css-margins
25
+ */
26
+ margin: 0 !important;
27
+ z-index: ${zIndex};
28
+ background-color: ${background};
29
+ border-radius: calc(${cardBorderRadius} / 2);
30
+
31
+ ::after {
32
+ content: '';
33
+ background-color: inherit;
34
+ border-radius: inherit;
35
+ z-index: -2; /* Make sure it's under the arrow. */
36
+ filter: ${low};
37
+ position: absolute;
38
+ top: 0;
39
+ right: 0;
40
+ bottom: 0;
41
+ left: 0;
42
+ }
43
+
44
+ &[data-popper-reference-hidden='true'] {
45
+ visibility: hidden;
46
+ pointer-events: none;
47
+ }
48
+
49
+ &[data-popper-placement^='top'] {
50
+ > ${StyledPopoverArrow} {
51
+ top: calc(100% - 0.25rem);
52
+ margin-inline-start: -0.25rem;
53
+
54
+ ::after {
55
+ border-bottom-right-radius: calc(${borderRadius} / 4);
56
+ }
57
+ }
58
+
59
+ ::before {
60
+ content: '';
61
+ position: absolute;
62
+ height: ${offset}px;
63
+ bottom: -${offset}px;
64
+ left: 0;
65
+ right: 0;
66
+ }
67
+ }
68
+
69
+ &[data-popper-placement^='bottom'] {
70
+ > ${StyledPopoverArrow} {
71
+ bottom: calc(100% + 0.25rem);
72
+ margin-inline-start: -0.25rem;
73
+
74
+ ::after {
75
+ border-top-left-radius: calc(${borderRadius} / 4);
76
+ }
77
+ }
78
+
79
+ ::before {
80
+ content: '';
81
+ position: absolute;
82
+ height: ${offset}px;
83
+ top: -${offset}px;
84
+ left: 0;
85
+ right: 0;
86
+ }
87
+ }
88
+
89
+ &[data-popper-placement^='right'] {
90
+ > ${StyledPopoverArrow} {
91
+ inset-inline-end: calc(100% + 0.25rem);
92
+ margin-block-start: -0.25rem;
93
+
94
+ ::after {
95
+ border-bottom-left-radius: calc(${borderRadius} / 4);
96
+ }
97
+ }
98
+
99
+ ::before {
100
+ content: '';
101
+ position: absolute;
102
+ width: ${offset}px;
103
+ left: -${offset}px;
104
+ top: 0;
105
+ bottom: 0;
106
+ }
107
+ }
108
+
109
+ &[data-popper-placement^='left'] {
110
+ > ${StyledPopoverArrow} {
111
+ left: calc(100% - 0.25rem);
112
+ margin-block-start: -0.25rem;
113
+
114
+ ::after {
115
+ border-top-right-radius: calc(${borderRadius} / 4);
116
+ }
117
+ }
118
+
119
+ ::before {
120
+ content: '';
121
+ position: absolute;
122
+ width: ${offset}px;
123
+ right: -${offset}px;
124
+ top: 0;
125
+ bottom: 0;
126
+ }
127
+ }
128
+ `;
129
+ });
130
+ StyledPopover.defaultProps = defaultThemeProp;
131
+ //# sourceMappingURL=Popover.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Popover.styles.js","sourceRoot":"","sources":["../../../src/components/Popover/Popover.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC,GAAG,CAC1C,CAAC,EACC,KAAK,EAAE,EACL,IAAI,EAAE,EACJ,MAAM,EAAE,EAAE,YAAY,EAAE,GAAG,EAAE,EAC9B,EACF,EACF,EAAE,EAAE,CAAC,GAAG,CAAA;;;;cAIG,GAAG;;;;;;;;;;;GAWd,CACF,CAAC;AAEF,kBAAkB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEnD,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,GAAG,CACrC,CAAC,EACC,KAAK,EAAE,EACL,IAAI,EAAE,EACJ,eAAe,EAAE,YAAY,EAC7B,SAAS,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,EAC9B,MAAM,EAAE,EAAE,YAAY,EAAE,GAAG,EAAE,EAC9B,EACD,UAAU,EAAE,EACV,IAAI,EAAE,EAAE,UAAU,EAAE,eAAe,EAAE,gBAAgB,EAAE,EACxD,EACF,EACD,MAAM,EACP,EAAE,EAAE;IACH,OAAO,GAAG,CAAA;;;;;;iBAMG,MAAM;0BACG,UAAU;4BACR,gBAAgB;;;;;;;kBAO1B,GAAG;;;;;;;;;;;;;;YAcT,kBAAkB;;;;;+CAKiB,YAAY;;;;;;;oBAOvC,MAAM;qBACL,MAAM;;;;;;;YAOf,kBAAkB;;;;;2CAKa,YAAY;;;;;;;oBAOnC,MAAM;kBACR,MAAM;;;;;;;YAOZ,kBAAkB;;;;;8CAKgB,YAAY;;;;;;;mBAOvC,MAAM;mBACN,MAAM;;;;;;;YAOb,kBAAkB;;;;;4CAKc,YAAY;;;;;;;mBAOrC,MAAM;oBACL,MAAM;;;;;KAKrB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,aAAa,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\n\nimport { defaultThemeProp } from '../../theme';\n\nexport const StyledPopoverArrow = styled.div(\n ({\n theme: {\n base: {\n shadow: { 'low-filter': low }\n }\n }\n }) => css`\n background-color: inherit;\n height: 0;\n width: 0;\n filter: ${low};\n z-index: -1; /* Make sure it's under the Popover. */\n\n ::after {\n content: '';\n display: block;\n background-color: inherit;\n height: 0.5rem;\n width: 0.5rem;\n transform: rotate(45deg);\n }\n `\n);\n\nStyledPopoverArrow.defaultProps = defaultThemeProp;\n\nexport const StyledPopover = styled.div<{ offset?: number }>(\n ({\n theme: {\n base: {\n 'border-radius': borderRadius,\n 'z-index': { popover: zIndex },\n shadow: { 'low-filter': low }\n },\n components: {\n card: { background, 'border-radius': cardBorderRadius }\n }\n },\n offset\n }) => {\n return css`\n /*\n Margin should never be used with Popper.\n https://popper.js.org/docs/v2/migration-guide/#4-remove-all-css-margins\n */\n margin: 0 !important;\n z-index: ${zIndex};\n background-color: ${background};\n border-radius: calc(${cardBorderRadius} / 2);\n\n ::after {\n content: '';\n background-color: inherit;\n border-radius: inherit;\n z-index: -2; /* Make sure it's under the arrow. */\n filter: ${low};\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n }\n\n &[data-popper-reference-hidden='true'] {\n visibility: hidden;\n pointer-events: none;\n }\n\n &[data-popper-placement^='top'] {\n > ${StyledPopoverArrow} {\n top: calc(100% - 0.25rem);\n margin-inline-start: -0.25rem;\n\n ::after {\n border-bottom-right-radius: calc(${borderRadius} / 4);\n }\n }\n\n ::before {\n content: '';\n position: absolute;\n height: ${offset}px;\n bottom: -${offset}px;\n left: 0;\n right: 0;\n }\n }\n\n &[data-popper-placement^='bottom'] {\n > ${StyledPopoverArrow} {\n bottom: calc(100% + 0.25rem);\n margin-inline-start: -0.25rem;\n\n ::after {\n border-top-left-radius: calc(${borderRadius} / 4);\n }\n }\n\n ::before {\n content: '';\n position: absolute;\n height: ${offset}px;\n top: -${offset}px;\n left: 0;\n right: 0;\n }\n }\n\n &[data-popper-placement^='right'] {\n > ${StyledPopoverArrow} {\n inset-inline-end: calc(100% + 0.25rem);\n margin-block-start: -0.25rem;\n\n ::after {\n border-bottom-left-radius: calc(${borderRadius} / 4);\n }\n }\n\n ::before {\n content: '';\n position: absolute;\n width: ${offset}px;\n left: -${offset}px;\n top: 0;\n bottom: 0;\n }\n }\n\n &[data-popper-placement^='left'] {\n > ${StyledPopoverArrow} {\n left: calc(100% - 0.25rem);\n margin-block-start: -0.25rem;\n\n ::after {\n border-top-right-radius: calc(${borderRadius} / 4);\n }\n }\n\n ::before {\n content: '';\n position: absolute;\n width: ${offset}px;\n right: -${offset}px;\n top: 0;\n bottom: 0;\n }\n }\n `;\n }\n);\n\nStyledPopover.defaultProps = defaultThemeProp;\n"]}
@@ -11,10 +11,10 @@ const PopoverManager = ({ children }) => {
11
11
  return { ...curr, [groupId]: id };
12
12
  });
13
13
  };
14
- return (_jsx(PopoverManagerContext.Provider, Object.assign({ value: {
14
+ return (_jsx(PopoverManagerContext.Provider, { value: {
15
15
  checkActive,
16
16
  setActive
17
- } }, { children: children }), void 0));
17
+ }, children: children }, void 0));
18
18
  };
19
19
  export default PopoverManager;
20
20
  //# sourceMappingURL=PopoverManager.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PopoverManager.js","sourceRoot":"","sources":["../../../src/components/Popover/PopoverManager.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAgC,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAEzD,MAAM,cAAc,GAA+C,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;IAClF,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAyB,EAAE,CAAC,CAAC;IAErE,MAAM,WAAW,GAAG,CAAC,EAAU,EAAE,OAAe,EAAW,EAAE;QAC3D,OAAO,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;IAClC,CAAC,CAAC;IAEF,MAAM,SAAS,GAAG,CAAC,EAAU,EAAE,OAAe,EAAE,EAAE;QAChD,WAAW,CAAC,IAAI,CAAC,EAAE;YACjB,OAAO,EAAE,GAAG,IAAI,EAAE,CAAC,OAAO,CAAC,EAAE,EAAE,EAAE,CAAC;QACpC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,OAAO,CACL,KAAC,qBAAqB,CAAC,QAAQ,kBAC7B,KAAK,EAAE;YACL,WAAW;YACX,SAAS;SACV,gBAEA,QAAQ,YACsB,CAClC,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["import { FunctionComponent, ReactNode, useState } from 'react';\n\nimport { PopoverManagerContext } from './PopoverContext';\n\nconst PopoverManager: FunctionComponent<{ children: ReactNode }> = ({ children }) => {\n const [popovers, setPopovers] = useState<Record<string, string>>({});\n\n const checkActive = (id: string, groupId: string): boolean => {\n return popovers[groupId] === id;\n };\n\n const setActive = (id: string, groupId: string) => {\n setPopovers(curr => {\n return { ...curr, [groupId]: id };\n });\n };\n\n return (\n <PopoverManagerContext.Provider\n value={{\n checkActive,\n setActive\n }}\n >\n {children}\n </PopoverManagerContext.Provider>\n );\n};\n\nexport default PopoverManager;\n"]}
1
+ {"version":3,"file":"PopoverManager.js","sourceRoot":"","sources":["../../../src/components/Popover/PopoverManager.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAgC,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAEzD,MAAM,cAAc,GAA+C,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;IAClF,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAyB,EAAE,CAAC,CAAC;IAErE,MAAM,WAAW,GAAG,CAAC,EAAU,EAAE,OAAe,EAAW,EAAE;QAC3D,OAAO,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;IAClC,CAAC,CAAC;IAEF,MAAM,SAAS,GAAG,CAAC,EAAU,EAAE,OAAe,EAAE,EAAE;QAChD,WAAW,CAAC,IAAI,CAAC,EAAE;YACjB,OAAO,EAAE,GAAG,IAAI,EAAE,CAAC,OAAO,CAAC,EAAE,EAAE,EAAE,CAAC;QACpC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,OAAO,CACL,KAAC,qBAAqB,CAAC,QAAQ,IAC7B,KAAK,EAAE;YACL,WAAW;YACX,SAAS;SACV,YAEA,QAAQ,WACsB,CAClC,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["import { FunctionComponent, ReactNode, useState } from 'react';\n\nimport { PopoverManagerContext } from './PopoverContext';\n\nconst PopoverManager: FunctionComponent<{ children: ReactNode }> = ({ children }) => {\n const [popovers, setPopovers] = useState<Record<string, string>>({});\n\n const checkActive = (id: string, groupId: string): boolean => {\n return popovers[groupId] === id;\n };\n\n const setActive = (id: string, groupId: string) => {\n setPopovers(curr => {\n return { ...curr, [groupId]: id };\n });\n };\n\n return (\n <PopoverManagerContext.Provider\n value={{\n checkActive,\n setActive\n }}\n >\n {children}\n </PopoverManagerContext.Provider>\n );\n};\n\nexport default PopoverManager;\n"]}
@@ -3,5 +3,5 @@ export { default as PopoverManager } from './PopoverManager';
3
3
  export { PopoverManagerContext } from './PopoverContext';
4
4
  export { Delay } from './Popover';
5
5
  export { PopoverProps } from './Popover';
6
- export { StyledPopover } from './Popover';
6
+ export { StyledPopover } from './Popover.styles';
7
7
  //# sourceMappingURL=index.d.ts.map