@ultraviolet/ui 1.51.1 → 1.51.3

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 (435) hide show
  1. package/dist/components/ActionBar/index.d.ts +20 -0
  2. package/dist/components/ActionBar/index.js +30 -0
  3. package/dist/components/Alert/index.d.ts +27 -0
  4. package/dist/components/Alert/index.js +115 -0
  5. package/dist/components/Avatar/index.d.ts +43 -0
  6. package/dist/components/Avatar/index.js +57 -0
  7. package/dist/components/Badge/index.d.ts +31 -0
  8. package/dist/components/Badge/index.js +99 -0
  9. package/dist/components/Banner/assets/default-image-small.svg.js +4 -0
  10. package/dist/components/Banner/assets/default-image.svg.js +4 -0
  11. package/dist/components/Banner/index.d.ts +24 -0
  12. package/dist/components/Banner/index.js +116 -0
  13. package/dist/components/BarChart/Tooltip.d.ts +9 -0
  14. package/dist/components/BarChart/Tooltip.js +41 -0
  15. package/dist/components/BarChart/index.d.ts +27 -0
  16. package/dist/components/BarChart/index.js +69 -0
  17. package/dist/components/BarStack/index.d.ts +36 -0
  18. package/dist/components/BarStack/index.js +114 -0
  19. package/dist/components/Breadcrumbs/index.d.ts +30 -0
  20. package/dist/components/Breadcrumbs/index.js +73 -0
  21. package/dist/components/Bullet/index.d.ts +39 -0
  22. package/dist/components/Bullet/index.js +84 -0
  23. package/dist/components/Button/index.d.ts +120 -0
  24. package/dist/components/Button/index.js +249 -0
  25. package/dist/components/Card/index.d.ts +20 -0
  26. package/dist/components/Card/index.js +52 -0
  27. package/dist/components/Carousel/index.d.ts +19 -0
  28. package/dist/components/Carousel/index.js +123 -0
  29. package/dist/components/Checkbox/index.d.ts +36 -0
  30. package/dist/components/Checkbox/index.js +262 -0
  31. package/dist/components/CheckboxGroup/index.d.ts +24 -0
  32. package/dist/components/CheckboxGroup/index.js +116 -0
  33. package/dist/components/CopyButton/index.d.ts +19 -0
  34. package/dist/components/CopyButton/index.js +23 -0
  35. package/dist/components/DateInput/datepicker.css.js +4 -0
  36. package/dist/components/DateInput/index.d.ts +38 -0
  37. package/dist/components/DateInput/index.js +182 -0
  38. package/dist/components/Dialog/Context.d.ts +7 -0
  39. package/dist/components/Dialog/Context.js +13 -0
  40. package/dist/components/Dialog/constants.d.ts +2 -0
  41. package/dist/components/Dialog/index.d.ts +87 -0
  42. package/dist/components/Dialog/index.js +66 -0
  43. package/dist/components/Dialog/subComponents/Button.d.ts +7 -0
  44. package/dist/components/Dialog/subComponents/Button.js +15 -0
  45. package/dist/components/Dialog/subComponents/Buttons.d.ts +7 -0
  46. package/dist/components/Dialog/subComponents/Buttons.js +12 -0
  47. package/dist/components/Dialog/subComponents/CancelButton.d.ts +8 -0
  48. package/dist/components/Dialog/subComponents/CancelButton.js +9 -0
  49. package/dist/components/Dialog/subComponents/Stack.d.ts +6 -0
  50. package/dist/components/Dialog/subComponents/Stack.js +8 -0
  51. package/dist/components/Dialog/subComponents/Text.d.ts +6 -0
  52. package/dist/components/Dialog/subComponents/Text.js +8 -0
  53. package/dist/components/EmptyState/index.d.ts +38 -0
  54. package/dist/components/EmptyState/index.js +90 -0
  55. package/dist/components/Expandable/index.d.ts +33 -0
  56. package/dist/components/Expandable/index.js +75 -0
  57. package/dist/components/GlobalAlert/GlobalAlertLink.d.ts +3 -0
  58. package/dist/components/GlobalAlert/GlobalAlertLink.js +23 -0
  59. package/dist/components/GlobalAlert/index.d.ts +40 -0
  60. package/dist/components/GlobalAlert/index.js +59 -0
  61. package/dist/components/LineChart/CustomLegend.d.ts +13 -0
  62. package/dist/components/LineChart/CustomLegend.js +113 -0
  63. package/dist/components/LineChart/Tooltip.d.ts +6 -0
  64. package/dist/components/LineChart/Tooltip.js +35 -0
  65. package/dist/components/LineChart/helpers.d.ts +8 -0
  66. package/dist/{src/components → components}/LineChart/helpers.js +22 -10
  67. package/dist/components/LineChart/index.d.ts +25 -0
  68. package/dist/components/LineChart/index.js +101 -0
  69. package/dist/components/Link/index.d.ts +33 -0
  70. package/dist/components/Link/index.js +128 -0
  71. package/dist/components/List/Body.d.ts +6 -0
  72. package/dist/components/List/Body.js +16 -0
  73. package/dist/components/List/Cell.d.ts +12 -0
  74. package/dist/components/List/Cell.js +41 -0
  75. package/dist/components/List/HeaderCell.d.ts +11 -0
  76. package/dist/components/List/HeaderCell.js +82 -0
  77. package/dist/components/List/HeaderRow.d.ts +7 -0
  78. package/dist/components/List/HeaderRow.js +36 -0
  79. package/dist/components/List/ListContext.d.ts +34 -0
  80. package/dist/{src/components → components}/List/ListContext.js +27 -29
  81. package/dist/components/List/Row.d.ts +23 -0
  82. package/dist/components/List/Row.js +161 -0
  83. package/dist/components/List/SelectBar.d.ts +15 -0
  84. package/dist/components/List/SelectBar.js +52 -0
  85. package/dist/components/List/SkeletonRows.d.ts +7 -0
  86. package/dist/components/List/SkeletonRows.js +55 -0
  87. package/dist/components/List/constants.d.ts +2 -0
  88. package/dist/{src/components → components}/List/constants.js +4 -2
  89. package/dist/components/List/index.d.ts +68 -0
  90. package/dist/components/List/index.js +60 -0
  91. package/dist/components/Loader/index.d.ts +22 -0
  92. package/dist/components/Loader/index.js +77 -0
  93. package/dist/components/Menu/Item.d.ts +15 -0
  94. package/dist/components/Menu/Item.js +91 -0
  95. package/dist/components/Menu/index.d.ts +49 -0
  96. package/dist/components/Menu/index.js +116 -0
  97. package/dist/components/MenuV2/Group.d.ts +7 -0
  98. package/dist/components/MenuV2/Group.js +21 -0
  99. package/dist/components/MenuV2/Item.d.ts +16 -0
  100. package/dist/components/MenuV2/Item.js +113 -0
  101. package/dist/components/MenuV2/index.d.ts +90 -0
  102. package/dist/components/MenuV2/index.js +90 -0
  103. package/dist/components/Meter/index.d.ts +26 -0
  104. package/dist/components/Meter/index.js +63 -0
  105. package/dist/components/Modal/Dialog.d.ts +3 -0
  106. package/dist/components/Modal/Dialog.js +141 -0
  107. package/dist/components/Modal/Disclosure.d.ts +3 -0
  108. package/dist/{src/components → components}/Modal/Disclosure.js +12 -12
  109. package/dist/components/Modal/constants.d.ts +3 -0
  110. package/dist/{src/components → components}/Modal/constants.js +8 -6
  111. package/dist/components/Modal/index.d.ts +42 -0
  112. package/dist/components/Modal/index.js +79 -0
  113. package/dist/components/Modal/types.d.ts +48 -0
  114. package/dist/components/Notice/index.d.ts +11 -0
  115. package/dist/components/Notice/index.js +23 -0
  116. package/dist/components/Notification/index.d.ts +36 -0
  117. package/dist/components/Notification/index.js +49 -0
  118. package/dist/components/Notification/react-toastify.css.js +4 -0
  119. package/dist/components/NumberInput/helpers.d.ts +4 -0
  120. package/dist/{src/components → components}/NumberInput/helpers.js +6 -2
  121. package/dist/components/NumberInput/index.d.ts +41 -0
  122. package/dist/components/NumberInput/index.js +262 -0
  123. package/dist/components/NumberInputV2/index.d.ts +27 -0
  124. package/dist/components/NumberInputV2/index.js +221 -0
  125. package/dist/components/Pagination/getPageNumbers.d.ts +8 -0
  126. package/dist/{src/components → components}/Pagination/getPageNumbers.js +3 -9
  127. package/dist/components/Pagination/index.d.ts +30 -0
  128. package/dist/components/Pagination/index.js +88 -0
  129. package/dist/components/PasswordCheck/index.d.ts +20 -0
  130. package/dist/components/PasswordCheck/index.js +24 -0
  131. package/dist/components/PasswordStrengthMeter/index.d.ts +39 -0
  132. package/dist/components/PasswordStrengthMeter/index.js +96 -0
  133. package/dist/components/PieChart/Legends.d.ts +9 -0
  134. package/dist/components/PieChart/Legends.js +142 -0
  135. package/dist/components/PieChart/Tooltip.d.ts +12 -0
  136. package/dist/components/PieChart/Tooltip.js +49 -0
  137. package/dist/components/PieChart/index.d.ts +20 -0
  138. package/dist/components/PieChart/index.js +101 -0
  139. package/dist/components/PieChart/types.d.ts +7 -0
  140. package/dist/components/Popover/index.d.ts +55 -0
  141. package/dist/components/Popover/index.js +100 -0
  142. package/dist/components/Popup/animations.d.ts +11 -0
  143. package/dist/{src/components → components}/Popup/animations.js +7 -6
  144. package/dist/components/Popup/helpers.d.ts +31 -0
  145. package/dist/components/Popup/helpers.js +216 -0
  146. package/dist/components/Popup/index.d.ts +72 -0
  147. package/dist/components/Popup/index.js +297 -0
  148. package/dist/components/ProgressBar/index.d.ts +14 -0
  149. package/dist/components/ProgressBar/index.js +53 -0
  150. package/dist/components/Radio/index.d.ts +21 -0
  151. package/dist/components/Radio/index.js +133 -0
  152. package/dist/components/RadioGroup/index.d.ts +25 -0
  153. package/dist/components/RadioGroup/index.js +99 -0
  154. package/dist/components/Row/index.d.ts +22 -0
  155. package/dist/components/Row/index.js +34 -0
  156. package/dist/components/SelectInput/index.d.ts +75 -0
  157. package/dist/components/SelectInput/index.js +516 -0
  158. package/dist/components/SelectInputV2/Dropdown.d.ts +23 -0
  159. package/dist/components/SelectInputV2/Dropdown.js +429 -0
  160. package/dist/components/SelectInputV2/DropdownOption.d.ts +8 -0
  161. package/dist/components/SelectInputV2/DropdownOption.js +62 -0
  162. package/dist/components/SelectInputV2/SearchBarDropdown.d.ts +9 -0
  163. package/dist/components/SelectInputV2/SearchBarDropdown.js +107 -0
  164. package/dist/components/SelectInputV2/SelectBar.d.ts +14 -0
  165. package/dist/components/SelectInputV2/SelectBar.js +224 -0
  166. package/dist/components/SelectInputV2/SelectInputProvider.d.ts +41 -0
  167. package/dist/{src/components → components}/SelectInputV2/SelectInputProvider.js +38 -36
  168. package/dist/components/SelectInputV2/findOptionInOptions.d.ts +2 -0
  169. package/dist/components/SelectInputV2/findOptionInOptions.js +12 -0
  170. package/dist/components/SelectInputV2/index.d.ts +115 -0
  171. package/dist/components/SelectInputV2/index.js +87 -0
  172. package/dist/components/SelectInputV2/types.d.ts +38 -0
  173. package/dist/{src/components → components}/SelectInputV2/types.js +4 -2
  174. package/dist/components/SelectableCard/index.d.ts +25 -0
  175. package/dist/components/SelectableCard/index.js +137 -0
  176. package/dist/components/SelectableCardGroup/index.d.ts +23 -0
  177. package/dist/components/SelectableCardGroup/index.js +107 -0
  178. package/dist/components/Separator/index.d.ts +17 -0
  179. package/dist/components/Separator/index.js +56 -0
  180. package/dist/components/Skeleton/Block.d.ts +3 -0
  181. package/dist/components/Skeleton/Block.js +38 -0
  182. package/dist/components/Skeleton/Blocks.d.ts +4 -0
  183. package/dist/components/Skeleton/Blocks.js +38 -0
  184. package/dist/components/Skeleton/BoxWithIcon.d.ts +4 -0
  185. package/dist/components/Skeleton/BoxWithIcon.js +36 -0
  186. package/dist/components/Skeleton/Donut.d.ts +1 -0
  187. package/dist/components/Skeleton/Donut.js +61 -0
  188. package/dist/components/Skeleton/IconSkeleton.d.ts +5 -0
  189. package/dist/components/Skeleton/IconSkeleton.js +22 -0
  190. package/dist/components/Skeleton/Line.d.ts +5 -0
  191. package/dist/components/Skeleton/Line.js +16 -0
  192. package/dist/components/Skeleton/List.d.ts +4 -0
  193. package/dist/components/Skeleton/List.js +56 -0
  194. package/dist/components/Skeleton/Slider.d.ts +3 -0
  195. package/dist/components/Skeleton/Slider.js +40 -0
  196. package/dist/components/Skeleton/Square.d.ts +5 -0
  197. package/dist/components/Skeleton/Square.js +12 -0
  198. package/dist/components/Skeleton/index.d.ts +47 -0
  199. package/dist/components/Skeleton/index.js +79 -0
  200. package/dist/components/Snippet/index.d.ts +23 -0
  201. package/dist/components/Snippet/index.js +182 -0
  202. package/dist/components/Stack/index.d.ts +23 -0
  203. package/dist/components/Stack/index.js +29 -0
  204. package/dist/components/Status/index.d.ts +32 -0
  205. package/dist/components/Status/index.js +72 -0
  206. package/dist/components/StepList/index.d.ts +33 -0
  207. package/dist/components/StepList/index.js +58 -0
  208. package/dist/components/Stepper/index.d.ts +15 -0
  209. package/dist/components/Stepper/index.js +145 -0
  210. package/dist/components/SwitchButton/FocusOverlay.d.ts +8 -0
  211. package/dist/components/SwitchButton/FocusOverlay.js +38 -0
  212. package/dist/components/SwitchButton/index.d.ts +26 -0
  213. package/dist/components/SwitchButton/index.js +76 -0
  214. package/dist/components/Table/Body.d.ts +6 -0
  215. package/dist/components/Table/Body.js +7 -0
  216. package/dist/components/Table/Cell.d.ts +9 -0
  217. package/dist/components/Table/Cell.js +19 -0
  218. package/dist/components/Table/Header.d.ts +6 -0
  219. package/dist/components/Table/Header.js +16 -0
  220. package/dist/components/Table/HeaderCell.d.ts +14 -0
  221. package/dist/components/Table/HeaderCell.js +80 -0
  222. package/dist/components/Table/HeaderRow.d.ts +7 -0
  223. package/dist/components/Table/HeaderRow.js +23 -0
  224. package/dist/components/Table/Row.d.ts +14 -0
  225. package/dist/components/Table/Row.js +80 -0
  226. package/dist/components/Table/SelectBar.d.ts +15 -0
  227. package/dist/components/Table/SelectBar.js +52 -0
  228. package/dist/components/Table/SkeletonRows.d.ts +7 -0
  229. package/dist/components/Table/SkeletonRows.js +54 -0
  230. package/dist/components/Table/TableContext.d.ts +27 -0
  231. package/dist/{src/components → components}/Table/TableContext.js +19 -21
  232. package/dist/components/Table/index.d.ts +60 -0
  233. package/dist/components/Table/index.js +67 -0
  234. package/dist/components/Tabs/Tab.d.ts +20 -0
  235. package/dist/components/Tabs/Tab.js +120 -0
  236. package/dist/components/Tabs/TabMenu.d.ts +8 -0
  237. package/dist/components/Tabs/TabMenu.js +62 -0
  238. package/dist/components/Tabs/TabMenuItem.d.ts +20 -0
  239. package/dist/components/Tabs/TabMenuItem.js +34 -0
  240. package/dist/components/Tabs/TabsContext.d.ts +8 -0
  241. package/dist/components/Tabs/TabsContext.js +7 -0
  242. package/dist/components/Tabs/index.d.ts +50 -0
  243. package/dist/components/Tabs/index.js +102 -0
  244. package/dist/components/Tag/index.d.ts +26 -0
  245. package/dist/components/Tag/index.js +144 -0
  246. package/dist/components/TagInput/index.d.ts +55 -0
  247. package/dist/components/TagInput/index.js +253 -0
  248. package/dist/components/TagList/index.d.ts +37 -0
  249. package/dist/components/TagList/index.js +98 -0
  250. package/dist/components/Text/index.d.ts +40 -0
  251. package/dist/components/Text/index.js +82 -0
  252. package/dist/components/TextArea/index.d.ts +50 -0
  253. package/dist/components/TextArea/index.js +158 -0
  254. package/dist/components/TextInput/index.d.ts +75 -0
  255. package/dist/components/TextInput/index.js +387 -0
  256. package/dist/components/TextInputV2/index.d.ts +30 -0
  257. package/dist/components/TextInputV2/index.js +190 -0
  258. package/dist/components/TimeInput/index.d.ts +25 -0
  259. package/dist/components/TimeInput/index.js +28 -0
  260. package/dist/components/Toaster/index.d.ts +46 -0
  261. package/dist/components/Toaster/index.js +83 -0
  262. package/dist/components/Toaster/react-toastify.css.js +4 -0
  263. package/dist/components/Toggle/index.d.ts +34 -0
  264. package/dist/components/Toggle/index.js +136 -0
  265. package/dist/components/ToggleGroup/index.d.ts +24 -0
  266. package/dist/components/ToggleGroup/index.js +96 -0
  267. package/dist/components/Tooltip/index.d.ts +9 -0
  268. package/dist/components/Tooltip/index.js +40 -0
  269. package/dist/components/VerificationCode/index.d.ts +36 -0
  270. package/dist/components/VerificationCode/index.js +217 -0
  271. package/dist/components/index.d.ts +75 -0
  272. package/dist/helpers/isJSON.d.ts +2 -0
  273. package/dist/{src/helpers → helpers}/isJSON.js +4 -3
  274. package/dist/helpers/jestMockMatchMedia.d.ts +6 -0
  275. package/dist/helpers/keycode.d.ts +3 -0
  276. package/dist/helpers/legend.d.ts +2 -0
  277. package/dist/helpers/legend.js +14 -0
  278. package/dist/helpers/numbers.d.ts +2 -0
  279. package/dist/helpers/recursivelyGetChildrenString.d.ts +3 -0
  280. package/dist/helpers/recursivelyGetChildrenString.js +15 -0
  281. package/dist/hooks/useIsOverflowing.d.ts +5 -0
  282. package/dist/hooks/useIsOverflowing.js +23 -0
  283. package/dist/index.d.ts +4 -3723
  284. package/dist/index.js +187 -0
  285. package/dist/mocks/list.d.ts +12 -0
  286. package/dist/theme/index.d.ts +1573 -0
  287. package/dist/theme/index.js +27 -0
  288. package/dist/types.d.ts +6 -0
  289. package/dist/utils/animations.d.ts +27 -0
  290. package/dist/{src/utils → utils}/animations.js +30 -4
  291. package/dist/utils/capitalize.d.ts +2 -0
  292. package/dist/utils/capitalize.js +4 -0
  293. package/dist/utils/ids.d.ts +1 -0
  294. package/dist/{src/utils → utils}/ids.js +5 -4
  295. package/dist/utils/index.d.ts +6 -0
  296. package/dist/utils/normalize.d.ts +2 -0
  297. package/dist/{src/utils → utils}/normalize.js +4 -3
  298. package/dist/utils/orderBy.d.ts +2 -0
  299. package/dist/utils/responsive/Breakpoint.d.ts +9 -0
  300. package/dist/utils/responsive/Breakpoint.js +15 -0
  301. package/dist/utils/responsive/index.d.ts +2 -0
  302. package/dist/utils/responsive/utilities.d.ts +3 -0
  303. package/dist/{src/utils → utils}/responsive/utilities.js +9 -6
  304. package/package.json +18 -8
  305. package/dist/react-datepicker/dist/react-datepicker.min.css.js +0 -3
  306. package/dist/react-toastify/dist/ReactToastify.min.css.js +0 -3
  307. package/dist/src/components/ActionBar/index.js +0 -40
  308. package/dist/src/components/Alert/index.js +0 -133
  309. package/dist/src/components/Avatar/index.js +0 -74
  310. package/dist/src/components/Badge/index.js +0 -116
  311. package/dist/src/components/Banner/assets/default-image-small.svg.js +0 -5
  312. package/dist/src/components/Banner/assets/default-image.svg.js +0 -5
  313. package/dist/src/components/Banner/index.js +0 -159
  314. package/dist/src/components/BarChart/Tooltip.js +0 -48
  315. package/dist/src/components/BarChart/index.js +0 -95
  316. package/dist/src/components/BarStack/index.js +0 -136
  317. package/dist/src/components/Breadcrumbs/index.js +0 -82
  318. package/dist/src/components/Bullet/index.js +0 -98
  319. package/dist/src/components/Button/index.js +0 -311
  320. package/dist/src/components/Card/index.js +0 -67
  321. package/dist/src/components/Carousel/index.js +0 -128
  322. package/dist/src/components/Checkbox/index.js +0 -316
  323. package/dist/src/components/CheckboxGroup/index.js +0 -143
  324. package/dist/src/components/CopyButton/index.js +0 -37
  325. package/dist/src/components/DateInput/index.js +0 -242
  326. package/dist/src/components/Dialog/Context.js +0 -12
  327. package/dist/src/components/Dialog/index.js +0 -88
  328. package/dist/src/components/Dialog/subComponents/Button.js +0 -21
  329. package/dist/src/components/Dialog/subComponents/Buttons.js +0 -14
  330. package/dist/src/components/Dialog/subComponents/CancelButton.js +0 -14
  331. package/dist/src/components/Dialog/subComponents/Stack.js +0 -11
  332. package/dist/src/components/Dialog/subComponents/Text.js +0 -12
  333. package/dist/src/components/EmptyState/index.js +0 -112
  334. package/dist/src/components/Expandable/index.js +0 -96
  335. package/dist/src/components/GlobalAlert/GlobalAlertLink.js +0 -38
  336. package/dist/src/components/GlobalAlert/index.js +0 -82
  337. package/dist/src/components/LineChart/CustomLegend.js +0 -138
  338. package/dist/src/components/LineChart/Tooltip.js +0 -43
  339. package/dist/src/components/LineChart/index.js +0 -131
  340. package/dist/src/components/Link/index.js +0 -147
  341. package/dist/src/components/List/Body.js +0 -16
  342. package/dist/src/components/List/Cell.js +0 -43
  343. package/dist/src/components/List/HeaderCell.js +0 -90
  344. package/dist/src/components/List/HeaderRow.js +0 -43
  345. package/dist/src/components/List/Row.js +0 -185
  346. package/dist/src/components/List/SelectBar.js +0 -48
  347. package/dist/src/components/List/SkeletonRows.js +0 -53
  348. package/dist/src/components/List/index.js +0 -75
  349. package/dist/src/components/Loader/index.js +0 -100
  350. package/dist/src/components/Menu/Item.js +0 -112
  351. package/dist/src/components/Menu/index.js +0 -129
  352. package/dist/src/components/MenuV2/Group.js +0 -25
  353. package/dist/src/components/MenuV2/Item.js +0 -139
  354. package/dist/src/components/MenuV2/index.js +0 -118
  355. package/dist/src/components/Meter/index.js +0 -76
  356. package/dist/src/components/Modal/Dialog.js +0 -182
  357. package/dist/src/components/Modal/index.js +0 -113
  358. package/dist/src/components/Notice/index.js +0 -34
  359. package/dist/src/components/Notification/index.js +0 -77
  360. package/dist/src/components/NumberInput/index.js +0 -299
  361. package/dist/src/components/NumberInputV2/index.js +0 -284
  362. package/dist/src/components/Pagination/index.js +0 -117
  363. package/dist/src/components/PasswordCheck/index.js +0 -41
  364. package/dist/src/components/PasswordStrengthMeter/index.js +0 -102
  365. package/dist/src/components/PieChart/Legends.js +0 -138
  366. package/dist/src/components/PieChart/Tooltip.js +0 -61
  367. package/dist/src/components/PieChart/index.js +0 -125
  368. package/dist/src/components/Popover/index.js +0 -146
  369. package/dist/src/components/Popup/helpers.js +0 -252
  370. package/dist/src/components/Popup/index.js +0 -383
  371. package/dist/src/components/ProgressBar/index.js +0 -57
  372. package/dist/src/components/Radio/index.js +0 -157
  373. package/dist/src/components/RadioGroup/index.js +0 -131
  374. package/dist/src/components/Row/index.js +0 -41
  375. package/dist/src/components/SelectInput/index.js +0 -610
  376. package/dist/src/components/SelectInputV2/Dropdown.js +0 -594
  377. package/dist/src/components/SelectInputV2/DropdownOption.js +0 -130
  378. package/dist/src/components/SelectInputV2/SearchBarDropdown.js +0 -122
  379. package/dist/src/components/SelectInputV2/SelectBar.js +0 -282
  380. package/dist/src/components/SelectInputV2/findOptionInOptions.js +0 -11
  381. package/dist/src/components/SelectInputV2/index.js +0 -137
  382. package/dist/src/components/SelectableCard/index.js +0 -175
  383. package/dist/src/components/SelectableCardGroup/index.js +0 -141
  384. package/dist/src/components/Separator/index.js +0 -73
  385. package/dist/src/components/Skeleton/Block.js +0 -35
  386. package/dist/src/components/Skeleton/Blocks.js +0 -34
  387. package/dist/src/components/Skeleton/BoxWithIcon.js +0 -32
  388. package/dist/src/components/Skeleton/Donut.js +0 -55
  389. package/dist/src/components/Skeleton/IconSkeleton.js +0 -19
  390. package/dist/src/components/Skeleton/Line.js +0 -13
  391. package/dist/src/components/Skeleton/List.js +0 -51
  392. package/dist/src/components/Skeleton/Slider.js +0 -36
  393. package/dist/src/components/Skeleton/Square.js +0 -9
  394. package/dist/src/components/Skeleton/index.js +0 -82
  395. package/dist/src/components/Snippet/index.js +0 -200
  396. package/dist/src/components/Stack/index.js +0 -29
  397. package/dist/src/components/Status/index.js +0 -74
  398. package/dist/src/components/StepList/index.js +0 -69
  399. package/dist/src/components/Stepper/index.js +0 -150
  400. package/dist/src/components/SwitchButton/FocusOverlay.js +0 -37
  401. package/dist/src/components/SwitchButton/index.js +0 -108
  402. package/dist/src/components/Table/Body.js +0 -9
  403. package/dist/src/components/Table/Cell.js +0 -21
  404. package/dist/src/components/Table/Header.js +0 -15
  405. package/dist/src/components/Table/HeaderCell.js +0 -103
  406. package/dist/src/components/Table/HeaderRow.js +0 -32
  407. package/dist/src/components/Table/Row.js +0 -89
  408. package/dist/src/components/Table/SelectBar.js +0 -48
  409. package/dist/src/components/Table/SkeletonRows.js +0 -51
  410. package/dist/src/components/Table/index.js +0 -82
  411. package/dist/src/components/Tabs/Tab.js +0 -138
  412. package/dist/src/components/Tabs/TabMenu.js +0 -59
  413. package/dist/src/components/Tabs/TabMenuItem.js +0 -36
  414. package/dist/src/components/Tabs/TabsContext.js +0 -6
  415. package/dist/src/components/Tabs/index.js +0 -117
  416. package/dist/src/components/Tag/index.js +0 -169
  417. package/dist/src/components/TagInput/index.js +0 -309
  418. package/dist/src/components/TagList/index.js +0 -106
  419. package/dist/src/components/Text/index.js +0 -107
  420. package/dist/src/components/TextArea/index.js +0 -210
  421. package/dist/src/components/TextInput/index.js +0 -451
  422. package/dist/src/components/TextInputV2/index.js +0 -289
  423. package/dist/src/components/TimeInput/index.js +0 -37
  424. package/dist/src/components/Toaster/index.js +0 -131
  425. package/dist/src/components/Toggle/index.js +0 -160
  426. package/dist/src/components/ToggleGroup/index.js +0 -122
  427. package/dist/src/components/Tooltip/index.js +0 -55
  428. package/dist/src/components/VerificationCode/index.js +0 -222
  429. package/dist/src/helpers/legend.js +0 -13
  430. package/dist/src/helpers/recursivelyGetChildrenString.js +0 -11
  431. package/dist/src/hooks/useIsOverflowing.js +0 -34
  432. package/dist/src/index.js +0 -77
  433. package/dist/src/theme/index.js +0 -29
  434. package/dist/src/utils/capitalize.js +0 -3
  435. package/dist/src/utils/responsive/Breakpoint.js +0 -12
@@ -1,61 +0,0 @@
1
- import _styled from '@emotion/styled/base';
2
- import { Text } from '../Text/index.js';
3
- import { jsx, jsxs } from '@emotion/react/jsx-runtime';
4
-
5
- function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
6
- const StyledList = /*#__PURE__*/_styled("ul", {
7
- target: "e44jccr1"
8
- })(process.env.NODE_ENV === "production" ? {
9
- name: "1vatjen",
10
- styles: "padding:0 8px 8px 8px;margin:0;width:100%"
11
- } : {
12
- name: "1vatjen",
13
- styles: "padding:0 8px 8px 8px;margin:0;width:100%",
14
- toString: _EMOTION_STRINGIFIED_CSS_ERROR__
15
- });
16
- const StyledItem = /*#__PURE__*/_styled("li", {
17
- target: "e44jccr0"
18
- })(process.env.NODE_ENV === "production" ? {
19
- name: "1duinrf",
20
- styles: "display:flex;margin-top:6px;width:100%;justify-content:space-between;text-align:left;gap:8px"
21
- } : {
22
- name: "1duinrf",
23
- styles: "display:flex;margin-top:6px;width:100%;justify-content:space-between;text-align:left;gap:8px",
24
- toString: _EMOTION_STRINGIFIED_CSS_ERROR__
25
- });
26
- const Tooltip = ({
27
- data
28
- }) => jsx("div", {
29
- tabIndex: -1,
30
- role: "tooltip",
31
- children: jsxs(StyledList, {
32
- children: [jsxs(StyledItem, {
33
- children: [jsx(Text, {
34
- as: "p",
35
- variant: "body",
36
- prominence: "stronger",
37
- children: data.name
38
- }), jsx(Text, {
39
- as: "p",
40
- variant: "body",
41
- prominence: "stronger",
42
- children: data.value
43
- })]
44
- }), data.details?.map(detail => jsxs(StyledItem, {
45
- children: [jsx(Text, {
46
- as: "p",
47
- variant: "bodySmall",
48
- prominence: "stronger",
49
- children: detail.name
50
- }), jsx(Text, {
51
- as: "p",
52
- variant: "bodySmall",
53
- prominence: "stronger",
54
- children: detail.value
55
- })]
56
- }, detail.name))]
57
- })
58
- });
59
- var TooltipContainer = Tooltip;
60
-
61
- export { TooltipContainer as default };
@@ -1,125 +0,0 @@
1
- import _styled from '@emotion/styled/base';
2
- import { useTheme } from '@emotion/react';
3
- import { Pie } from '@nivo/pie';
4
- import { useState, useCallback } from 'react';
5
- import { getLegendColor } from '../../helpers/legend.js';
6
- import { Text } from '../Text/index.js';
7
- import Legends from './Legends.js';
8
- import { jsx, jsxs } from '@emotion/react/jsx-runtime';
9
-
10
- function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
11
- const Container = /*#__PURE__*/_styled("div", {
12
- target: "epjfe5p2"
13
- })("display:flex;align-items:center;height:", ({
14
- height
15
- }) => `${height}px`, ";");
16
- const EmptyLegend = /*#__PURE__*/_styled("div", {
17
- target: "epjfe5p1"
18
- })(process.env.NODE_ENV === "production" ? {
19
- name: "dwqz7h",
20
- styles: "display:flex;align-items:center;margin-left:20px"
21
- } : {
22
- name: "dwqz7h",
23
- styles: "display:flex;align-items:center;margin-left:20px",
24
- toString: _EMOTION_STRINGIFIED_CSS_ERROR__
25
- });
26
- const StyledContent = /*#__PURE__*/_styled("div", {
27
- target: "epjfe5p0"
28
- })(process.env.NODE_ENV === "production" ? {
29
- name: "qcd8cv",
30
- styles: "display:inline-block;position:absolute;bottom:0;left:0;right:0;top:0;font-size:25px;line-height:100px;height:100px;width:100px;margin:auto;text-align:center;vertical-align:middle"
31
- } : {
32
- name: "qcd8cv",
33
- styles: "display:inline-block;position:absolute;bottom:0;left:0;right:0;top:0;font-size:25px;line-height:100px;height:100px;width:100px;margin:auto;text-align:center;vertical-align:middle",
34
- toString: _EMOTION_STRINGIFIED_CSS_ERROR__
35
- });
36
- const DEFAULT_CHARTPROPS = {};
37
- const DEFAULT_MARGIN = {
38
- bottom: 10,
39
- left: 10,
40
- right: 10,
41
- top: 10
42
- };
43
-
44
- /**
45
- * PieChart component is a wrapper around the Nivo Pie component to display a pie chart.
46
- * See https://nivo.rocks/pie/ for more information.
47
- * @experimental This component is experimental and may be subject to breaking changes in the future.
48
- */
49
- const PieChart = ({
50
- height = 206,
51
- width = 206,
52
- data = undefined,
53
- emptyLegend,
54
- content,
55
- withLegend = false,
56
- margin = DEFAULT_MARGIN,
57
- chartProps = DEFAULT_CHARTPROPS
58
- }) => {
59
- const theme = useTheme();
60
- const [currentFocusIndex, setCurrentFocusIndex] = useState();
61
- const emptyTooltip = useCallback(() => jsx("span", {}), []);
62
- const isEmpty = !data || data.length === 0;
63
- const EmptyLegendDisplayed = useCallback(() => emptyLegend ? jsx(EmptyLegend, {
64
- children: jsx(Text, {
65
- variant: "body",
66
- as: "p",
67
- children: emptyLegend
68
- })
69
- }) : null, [emptyLegend]);
70
- const localColors = getLegendColor(theme);
71
- const LegendDisplayer = useCallback(() => isEmpty ? jsx(EmptyLegendDisplayed, {}) : jsx(Legends, {
72
- focused: currentFocusIndex,
73
- data: data,
74
- onFocusChange: setCurrentFocusIndex,
75
- colors: localColors
76
- }), [isEmpty, currentFocusIndex, data, EmptyLegendDisplayed, localColors]);
77
- return jsxs(Container, {
78
- height: height,
79
- children: [jsxs("div", {
80
- style: {
81
- position: 'relative'
82
- },
83
- children: [jsx(Pie, {
84
- colors: localColors,
85
- height: height,
86
- width: width,
87
- value: "percent",
88
- enableArcLabels: false,
89
- enableArcLinkLabels: false,
90
- data: !isEmpty ? data : [{
91
- id: 'empty',
92
- percent: 100
93
- }],
94
- defs: [{
95
- background: 'inherit',
96
- color: theme.colors.neutral.textStrong,
97
- id: 'lines',
98
- lineWidth: 2,
99
- rotation: 0,
100
- spacing: 5,
101
- type: 'patternLines'
102
- }],
103
- margin: margin,
104
- innerRadius: 0.8,
105
- cornerRadius: 0,
106
- padAngle: 1,
107
- activeOuterRadiusOffset: !isEmpty ? 4 : 0,
108
- tooltip: emptyTooltip,
109
- onMouseEnter: (datum, event) => {
110
- if (!isEmpty) {
111
- const pie = event.currentTarget;
112
- pie.style.cursor = 'pointer';
113
- setCurrentFocusIndex(datum.id.toString());
114
- }
115
- },
116
- onMouseLeave: () => setCurrentFocusIndex(undefined),
117
- ...chartProps
118
- }), content ? jsx(StyledContent, {
119
- children: content
120
- }) : null]
121
- }), withLegend ? jsx(LegendDisplayer, {}) : null]
122
- });
123
- };
124
-
125
- export { PieChart };
@@ -1,146 +0,0 @@
1
- import _styled from '@emotion/styled/base';
2
- import { forwardRef, useRef, useState, useEffect, useCallback } from 'react';
3
- import { Button } from '../Button/index.js';
4
- import { Popup } from '../Popup/index.js';
5
- import { Stack } from '../Stack/index.js';
6
- import { Text } from '../Text/index.js';
7
- import { jsx, jsxs } from '@emotion/react/jsx-runtime';
8
-
9
- const SIZES_WIDTH = {
10
- small: 320,
11
- medium: 420,
12
- large: 520
13
- };
14
- const StyledPopup = /*#__PURE__*/_styled(Popup, {
15
- shouldForwardProp: prop => !['sentiment', 'size'].includes(prop),
16
- target: "ejpxv5a1"
17
- })("padding:", ({
18
- theme
19
- }) => theme.space['2'], ";width:", ({
20
- size
21
- }) => SIZES_WIDTH[size], "px;max-width:", ({
22
- size
23
- }) => SIZES_WIDTH[size], "px;text-align:initial;", ({
24
- theme,
25
- sentiment
26
- }) => {
27
- if (sentiment === 'neutral') {
28
- return `
29
- background: ${theme.colors.neutral.background};
30
- box-shadow: ${theme.shadows.popover};
31
- &[data-has-arrow='true'] {
32
- &::after {
33
- border-color: ${theme.colors.neutral.background} transparent transparent transparent;
34
- }
35
- }
36
- `;
37
- }
38
- return `
39
- background: ${theme.colors.primary.backgroundStrong};
40
- box-shadow: ${theme.shadows.popover};
41
- &[data-has-arrow='true'] {
42
- &::after {
43
- border-color: ${theme.colors.primary.backgroundStrong} transparent transparent transparent;
44
- }
45
- }
46
- `;
47
- }, ";");
48
-
49
- // This is to avoid having text inherit color from popup (which is white on white background)
50
- const StyledStack = /*#__PURE__*/_styled(Stack, {
51
- target: "ejpxv5a0"
52
- })("color:", ({
53
- theme
54
- }) => theme.colors.neutral.text, ";");
55
- const ContentWrapper = ({
56
- title,
57
- onClose,
58
- children,
59
- sentiment
60
- }) => jsxs(StyledStack, {
61
- gap: 1,
62
- children: [jsxs(Stack, {
63
- direction: "row",
64
- justifyContent: "space-between",
65
- children: [jsx(Text, {
66
- variant: "bodyStrong",
67
- as: "h3",
68
- sentiment: "neutral",
69
- prominence: sentiment === 'neutral' ? 'strong' : 'stronger',
70
- children: title
71
- }), jsx(Button, {
72
- variant: sentiment === 'neutral' ? 'ghost' : 'filled',
73
- sentiment: sentiment === 'neutral' ? 'neutral' : 'primary',
74
- onClick: onClose,
75
- size: "small",
76
- icon: "close",
77
- "aria-label": "close"
78
- })]
79
- }), typeof children === 'string' ? jsx(Text, {
80
- variant: "bodySmall",
81
- as: "p",
82
- sentiment: "neutral",
83
- prominence: sentiment === 'neutral' ? 'strong' : 'stronger',
84
- children: children
85
- }) : children]
86
- });
87
- /**
88
- * Popover component is used to display additional information or actions on top of the main content of the page.
89
- * It is usually triggered by clicking on a button. It includes a title, a close button and a content area.
90
- */
91
- const Popover = /*#__PURE__*/forwardRef(({
92
- visible = false,
93
- children,
94
- placement,
95
- content,
96
- title,
97
- sentiment = 'neutral',
98
- size = 'medium',
99
- onClose,
100
- className,
101
- maxWidth,
102
- maxHeight,
103
- 'data-testid': dataTestId,
104
- portalTarget,
105
- dynamicDomRendering
106
- }, ref) => {
107
- const innerRef = useRef(null);
108
- const [localVisible, setLocalVisible] = useState(visible);
109
-
110
- // We change local value if visible prop changes
111
- useEffect(() => {
112
- setLocalVisible(visible);
113
- }, [visible]);
114
- const localOnClose = useCallback(() => {
115
- setLocalVisible(false);
116
- onClose?.();
117
- }, [onClose]);
118
- return jsx(StyledPopup, {
119
- hideOnClickOutside: true,
120
- debounceDelay: 0,
121
- visible: localVisible,
122
- placement: placement,
123
- text: jsx(ContentWrapper, {
124
- title: title,
125
- onClose: localOnClose,
126
- sentiment: sentiment,
127
- children: content
128
- }),
129
- className: className,
130
- sentiment: sentiment,
131
- "data-testid": dataTestId,
132
- size: size,
133
- role: "dialog",
134
- ref: ref,
135
- tabIndex: -1,
136
- innerRef: innerRef,
137
- onClose: localOnClose,
138
- maxWidth: maxWidth,
139
- maxHeight: maxHeight,
140
- portalTarget: portalTarget,
141
- dynamicDomRendering: dynamicDomRendering,
142
- children: children
143
- });
144
- });
145
-
146
- export { Popover };
@@ -1,252 +0,0 @@
1
- const ARROW_WIDTH = 8; // in px
2
- const SPACE = 4; // in px
3
- const TOTAL_USED_SPACE = 0; // in px
4
- const DEFAULT_POSITIONS = {
5
- arrowLeft: 0,
6
- arrowTop: 0,
7
- arrowTransform: 'translate(-50%, -50)',
8
- placement: 'top',
9
- rotate: 135,
10
- popupInitialPosition: 'translate3d(0px, 0px, 0)',
11
- popupPosition: 'translate3d(0px, 0px, 0)'
12
- };
13
- /**
14
- * This function will find the best placement in a window for popup based on children position and popup size
15
- */
16
- const computePlacement = ({
17
- childrenStructuredRef,
18
- popupStructuredRef,
19
- offsetParentRect,
20
- offsetParent,
21
- popupPortalTarget
22
- }) => {
23
- const {
24
- top: childrenTop,
25
- left: childrenLeft,
26
- right: childrenRight,
27
- width: childrenWidth
28
- } = childrenStructuredRef;
29
- const {
30
- top: parentTop,
31
- left: parentLeft
32
- } = offsetParentRect;
33
- const isPopupPortalTargetBody = popupPortalTarget === document.body || offsetParent === document.body;
34
- const overloadedChildrenLeft = isPopupPortalTargetBody ? childrenLeft : childrenLeft - parentLeft;
35
- const overloadedChildrenTop = isPopupPortalTargetBody ? childrenTop : childrenTop - parentTop;
36
- const overloadedChildrenRight = isPopupPortalTargetBody ? childrenRight : childrenLeft - parentLeft + childrenWidth;
37
- const {
38
- width: popupWidth,
39
- height: popupHeight
40
- } = popupStructuredRef;
41
- if (overloadedChildrenTop - popupHeight - TOTAL_USED_SPACE < 0) {
42
- return 'bottom';
43
- }
44
- if (overloadedChildrenLeft - popupWidth - TOTAL_USED_SPACE < 0) {
45
- return 'right';
46
- }
47
- if (overloadedChildrenRight + popupWidth + TOTAL_USED_SPACE > window.innerWidth) {
48
- return 'left';
49
- }
50
- return 'top';
51
- };
52
-
53
- /**
54
- * This function will check if the offset parent is usable for popup positioning
55
- * If not it will loop and search for a compatible parent until document.body is reached
56
- */
57
- const findOffsetParent = element => {
58
- const offsetParent = element?.current?.offsetParent;
59
-
60
- // We need to check if offsetParent is a table cell or a table because they are not suitable for positioning
61
- // https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetParent
62
- if (offsetParent && !['TH', 'TD', 'TABLE'].includes(offsetParent.tagName)) {
63
- return offsetParent;
64
- }
65
- let currentElement = element?.current;
66
- while (currentElement && currentElement.tagName !== 'BODY') {
67
- const {
68
- position
69
- } = window.getComputedStyle(currentElement);
70
-
71
- // Check if the current element is a potential offset parent
72
- if (position !== 'static') {
73
- return currentElement;
74
- }
75
- currentElement = currentElement.parentElement;
76
- }
77
-
78
- // If no suitable offset parent is found, return the body element
79
- return document.body;
80
- };
81
-
82
- /**
83
- * This function will check if there is an overflow of the popup compared to the parent it is set in.
84
- * Depending on the position, for top and bottom the overflow will be on X axis and for left and right
85
- * the overflow will be Y axis. The function return the number of pixels the popup is overflowing.
86
- * @param position the position of the popup
87
- * @param offsetParentRect the rect of the parent element where the children is located in
88
- * @param childrenRect the rect of the children element, the children element is the one that will trigger the popup
89
- * @param popupStructuredRef the rect of the popup, the popup itself
90
- */
91
- const getPopupOverflowFromParent = (position, offsetParentRect, childrenRect, popupStructuredRef) => {
92
- const {
93
- top: parentTop,
94
- left: parentLeft,
95
- right: parentRight
96
- } = offsetParentRect;
97
- const {
98
- top: childrenTop,
99
- bottom: childrenBottom,
100
- left: childrenLeft,
101
- right: childrenRight,
102
- width: childrenWidth
103
- } = childrenRect;
104
- const {
105
- width: popupWidth,
106
- height: popupHeight
107
- } = popupStructuredRef;
108
- const popupHalfWidthWithArrow = popupWidth / 2 - ARROW_WIDTH;
109
- const popupHalfHeightWithArrow = popupHeight / 2 - ARROW_WIDTH;
110
- if (position === 'top' || position === 'bottom') {
111
- const popupOverflowRight = childrenRight - childrenWidth / 2 + popupWidth / 2;
112
- const popupOverflowLeft = childrenLeft + childrenWidth / 2 - parentLeft - popupWidth / 2;
113
- if (popupOverflowRight > parentRight) {
114
- if (Math.abs(popupOverflowRight - parentRight) > popupHalfWidthWithArrow) {
115
- return -popupHalfWidthWithArrow;
116
- }
117
- return parentRight - popupOverflowRight;
118
- }
119
- if (popupOverflowLeft < 0) {
120
- if (Math.abs(popupOverflowLeft) > popupHalfWidthWithArrow) {
121
- return popupHalfWidthWithArrow;
122
- }
123
- return Math.abs(popupOverflowLeft);
124
- }
125
- }
126
- if (position === 'left' || position === 'right') {
127
- const popupOverflowTop = childrenTop - parentTop - popupHeight / 2;
128
- if (popupOverflowTop < 0) {
129
- if (Math.abs(childrenTop - parentTop - popupHalfHeightWithArrow) > popupHalfHeightWithArrow) {
130
- return popupHalfHeightWithArrow;
131
- }
132
- return Math.abs(popupOverflowTop);
133
- }
134
- if (childrenBottom + popupHeight > window.innerHeight) {
135
- return -popupHalfHeightWithArrow;
136
- }
137
- }
138
- return 0;
139
- };
140
- /**
141
- * This function will compute the positions of popup and arrow based on children position and popup size
142
- */
143
- const computePositions = ({
144
- placement,
145
- childrenRef,
146
- popupRef,
147
- popupPortalTarget
148
- }) => {
149
- const childrenRect = childrenRef.current.getBoundingClientRect();
150
- const offsetParent = findOffsetParent(childrenRef);
151
- const offsetParentRect = offsetParent?.getBoundingClientRect() ?? {
152
- top: 0,
153
- left: 0,
154
- right: 0
155
- };
156
- const popupStructuredRef = popupRef.current.getBoundingClientRect();
157
- const placementBasedOnWindowSize = placement === 'auto' ? computePlacement({
158
- childrenStructuredRef: childrenRect,
159
- popupStructuredRef,
160
- offsetParentRect,
161
- popupPortalTarget,
162
- offsetParent
163
- }) : placement;
164
- const {
165
- top: childrenTop,
166
- left: childrenLeft,
167
- right: childrenRight,
168
- width: childrenWidth,
169
- height: childrenHeight
170
- } = childrenRect;
171
- const {
172
- top: parentTop,
173
- left: parentLeft
174
- } = offsetParentRect;
175
- const {
176
- width: popupWidth,
177
- height: popupHeight
178
- } = popupStructuredRef;
179
-
180
- // offSetParent is the closest positioned ancestor. If the element is not positioned, the nearest table cell or root element is used.
181
- const isPopupPortalTargetBody = popupPortalTarget === document.body || offsetParent === document.body;
182
-
183
- // It will get how much scroll is done on the page to compute the position of the popup
184
- const scrollTopValue = isPopupPortalTargetBody ? document.documentElement.scrollTop : offsetParent.scrollTop;
185
-
186
- // We need to compute the position of the popup based on the parent element in the case the popup is not in the body
187
- const overloadedChildrenLeft = isPopupPortalTargetBody ? childrenLeft : childrenLeft - parentLeft;
188
- const overloadedChildrenTop = isPopupPortalTargetBody ? childrenTop : childrenTop - parentTop;
189
- const overloadedChildrenRight = isPopupPortalTargetBody ? childrenRight : childrenLeft - parentLeft + childrenWidth;
190
- const popupOverflow = getPopupOverflowFromParent(placementBasedOnWindowSize, offsetParentRect, childrenRect, popupStructuredRef);
191
- switch (placementBasedOnWindowSize) {
192
- case 'bottom':
193
- {
194
- const positionX = overloadedChildrenLeft + childrenWidth / 2 - popupWidth / 2;
195
- const positionY = overloadedChildrenTop + scrollTopValue + childrenHeight + ARROW_WIDTH + SPACE;
196
- return {
197
- arrowLeft: popupWidth / 2 + popupOverflow * -1,
198
- arrowTop: -ARROW_WIDTH - 5,
199
- arrowTransform: '',
200
- placement: 'bottom',
201
- rotate: 180,
202
- popupInitialPosition: `translate3d(${positionX + popupOverflow}px, ${positionY - TOTAL_USED_SPACE}px, 0)`,
203
- popupPosition: `translate3d(${positionX + popupOverflow}px, ${positionY}px, 0)`
204
- };
205
- }
206
- case 'left':
207
- {
208
- const positionX = overloadedChildrenLeft - popupWidth - ARROW_WIDTH - SPACE * 2;
209
- const positionY = overloadedChildrenTop + scrollTopValue - popupHeight / 2 + childrenHeight / 2;
210
- return {
211
- arrowLeft: popupWidth + ARROW_WIDTH + 5,
212
- arrowTop: popupHeight / 2 + popupOverflow * -1,
213
- arrowTransform: 'translate(-50%, -50%)',
214
- placement: 'left',
215
- rotate: -90,
216
- popupInitialPosition: `translate3d(${positionX + TOTAL_USED_SPACE}px, ${positionY + popupOverflow}px, 0)`,
217
- popupPosition: `translate3d(${positionX}px, ${positionY + popupOverflow}px, 0)`
218
- };
219
- }
220
- case 'right':
221
- {
222
- const positionX = overloadedChildrenRight + ARROW_WIDTH + SPACE * 2;
223
- const positionY = overloadedChildrenTop + scrollTopValue - popupHeight / 2 + childrenHeight / 2;
224
- return {
225
- arrowLeft: -ARROW_WIDTH - 5,
226
- arrowTop: popupHeight / 2 + popupOverflow * -1,
227
- arrowTransform: 'translate(50%, -50%)',
228
- placement: 'right',
229
- rotate: 90,
230
- popupInitialPosition: `translate3d(${positionX - TOTAL_USED_SPACE}px, ${positionY + popupOverflow}px, 0)`,
231
- popupPosition: `translate3d(${positionX}px, ${positionY + popupOverflow}px, 0)`
232
- };
233
- }
234
- default:
235
- {
236
- // top placement is default value
237
- const positionX = overloadedChildrenLeft + childrenWidth / 2 - popupWidth / 2;
238
- const positionY = overloadedChildrenTop + scrollTopValue - popupHeight - ARROW_WIDTH - SPACE;
239
- return {
240
- arrowLeft: popupWidth / 2 + popupOverflow * -1,
241
- arrowTop: popupHeight - 1,
242
- arrowTransform: '',
243
- placement: 'top',
244
- rotate: 0,
245
- popupInitialPosition: `translate3d(${positionX + popupOverflow}px, ${positionY + TOTAL_USED_SPACE}px, 0)`,
246
- popupPosition: `translate3d(${positionX + popupOverflow}px, ${positionY}px, 0)`
247
- };
248
- }
249
- }
250
- };
251
-
252
- export { ARROW_WIDTH, DEFAULT_POSITIONS, computePositions };