@jetbrains/ring-ui 7.0.62 → 7.0.63

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 (386) hide show
  1. package/components/alert/alert.css +1 -1
  2. package/components/alert/alert.d.ts +1 -1
  3. package/components/alert/alert.js +3 -3
  4. package/components/alert/container.css +2 -2
  5. package/components/alert/container.d.ts +1 -1
  6. package/components/alert/container.js +1 -1
  7. package/components/alert-service/alert-service.d.ts +2 -2
  8. package/components/analytics/{analytics__custom-plugin.d.ts → analytics-custom-plugin.d.ts} +1 -1
  9. package/components/analytics/{analytics__custom-plugin.js → analytics-custom-plugin.js} +2 -2
  10. package/components/auth/{auth__core.d.ts → auth-core.d.ts} +9 -8
  11. package/components/auth/{auth__core.js → auth-core.js} +14 -18
  12. package/components/auth/auth.d.ts +2 -2
  13. package/components/auth/auth.js +2 -2
  14. package/components/auth/background-flow.d.ts +2 -2
  15. package/components/auth/background-flow.js +0 -1
  16. package/components/auth/down-notification.css +1 -1
  17. package/components/auth/down-notification.js +1 -1
  18. package/components/auth/iframe-flow.d.ts +3 -3
  19. package/components/auth/iframe-flow.js +3 -5
  20. package/components/auth/request-builder.d.ts +2 -1
  21. package/components/auth/request-builder.js +1 -2
  22. package/components/auth/storage.d.ts +3 -3
  23. package/components/auth/storage.js +4 -8
  24. package/components/auth/token-validator.d.ts +2 -1
  25. package/components/auth/token-validator.js +6 -1
  26. package/components/auth/window-flow.d.ts +3 -3
  27. package/components/auth/window-flow.js +7 -7
  28. package/components/auth-dialog/auth-dialog.css +2 -2
  29. package/components/auth-dialog/auth-dialog.js +1 -1
  30. package/components/auth-dialog-service/auth-dialog-service.d.ts +1 -1
  31. package/components/avatar/avatar-info.d.ts +1 -1
  32. package/components/avatar/avatar.css +1 -1
  33. package/components/avatar/avatar.d.ts +1 -1
  34. package/components/avatar/avatar.figma.js +1 -1
  35. package/components/avatar/avatar.js +5 -7
  36. package/components/avatar/fallback-avatar.js +4 -8
  37. package/components/avatar-stack/avatar-stack.css +1 -1
  38. package/components/avatar-stack/avatar-stack.d.ts +3 -3
  39. package/components/avatar-stack/avatar-stack.figma.js +1 -1
  40. package/components/avatar-stack/avatar-stack.js +1 -1
  41. package/components/banner/banner.css +2 -2
  42. package/components/banner/banner.js +1 -1
  43. package/components/breadcrumbs/breadcrumbs.d.ts +1 -1
  44. package/components/breadcrumbs/breadcrumbs.figma.js +1 -1
  45. package/components/button/{button__classes.d.ts → button.classes.d.ts} +1 -1
  46. package/components/button/button.css +19 -16
  47. package/components/button/button.d.ts +4 -4
  48. package/components/button/button.figma.js +1 -1
  49. package/components/button/button.js +6 -6
  50. package/components/button-group/button-group.css +6 -6
  51. package/components/button-group/button-group.d.ts +1 -1
  52. package/components/button-group/button-group.js +1 -1
  53. package/components/button-group/caption.d.ts +1 -1
  54. package/components/button-set/button-set.css +2 -2
  55. package/components/button-set/button-set.d.ts +1 -1
  56. package/components/button-toolbar/button-toolbar.css +2 -2
  57. package/components/button-toolbar/button-toolbar.d.ts +1 -1
  58. package/components/caret/caret.js +23 -18
  59. package/components/checkbox/checkbox-group.figma.js +1 -1
  60. package/components/checkbox/checkbox.css +1 -1
  61. package/components/checkbox/checkbox.d.ts +1 -1
  62. package/components/checkbox/checkbox.figma.js +1 -1
  63. package/components/checkbox/checkbox.js +5 -5
  64. package/components/clipboard/clipboard.js +2 -2
  65. package/components/code/code.css +1 -1
  66. package/components/code/code.d.ts +1 -1
  67. package/components/code/code.js +5 -3
  68. package/components/collapse/collapse-content.d.ts +3 -3
  69. package/components/collapse/collapse-control.d.ts +2 -2
  70. package/components/collapse/collapse.css +1 -1
  71. package/components/collapse/collapse.d.ts +3 -3
  72. package/components/confirm/confirm.d.ts +1 -1
  73. package/components/confirm/confirm.js +1 -1
  74. package/components/confirm-service/confirm-service.d.ts +3 -3
  75. package/components/content-layout/content-layout.css +2 -2
  76. package/components/content-layout/content-layout.d.ts +1 -1
  77. package/components/content-layout/content-layout.js +2 -2
  78. package/components/content-layout/sidebar.d.ts +1 -1
  79. package/components/contenteditable/contenteditable.d.ts +1 -1
  80. package/components/contenteditable/contenteditable.js +2 -1
  81. package/components/control-help/control-help.css +1 -1
  82. package/components/control-help/control-help.d.ts +1 -1
  83. package/components/control-label/control-label.d.ts +1 -1
  84. package/components/data-list/data-list.css +1 -1
  85. package/components/data-list/data-list.d.ts +5 -5
  86. package/components/data-list/data-list.js +2 -2
  87. package/components/data-list/data-list.mock.d.ts +2 -2
  88. package/components/data-list/data-list.mock.js +20 -20
  89. package/components/data-list/item.d.ts +3 -3
  90. package/components/data-list/item.js +2 -2
  91. package/components/data-list/selection.d.ts +1 -1
  92. package/components/data-list/selection.js +8 -1
  93. package/components/data-list/title.d.ts +2 -2
  94. package/components/date-picker/consts.d.ts +1 -1
  95. package/components/date-picker/date-input.d.ts +1 -1
  96. package/components/date-picker/date-input.js +2 -2
  97. package/components/date-picker/date-picker.css +15 -15
  98. package/components/date-picker/date-picker.d.ts +5 -5
  99. package/components/date-picker/date-picker.js +17 -19
  100. package/components/date-picker/date-popup.d.ts +1 -1
  101. package/components/date-picker/date-popup.js +5 -3
  102. package/components/date-picker/day.d.ts +2 -2
  103. package/components/date-picker/day.js +4 -5
  104. package/components/date-picker/formats.js +1 -0
  105. package/components/date-picker/month-names.d.ts +1 -1
  106. package/components/date-picker/month-names.js +1 -1
  107. package/components/date-picker/month-slider.d.ts +2 -2
  108. package/components/date-picker/month-slider.js +1 -1
  109. package/components/date-picker/month.d.ts +1 -1
  110. package/components/date-picker/months.d.ts +1 -1
  111. package/components/date-picker/months.js +2 -2
  112. package/components/date-picker/years.d.ts +1 -1
  113. package/components/date-picker/years.js +2 -2
  114. package/components/dialog/{dialog__body-scroll-preventer.js → dialog-body-scroll-preventer.js} +6 -2
  115. package/components/dialog/dialog.css +5 -5
  116. package/components/dialog/dialog.d.ts +1 -1
  117. package/components/dialog/dialog.js +7 -7
  118. package/components/dropdown/anchor.d.ts +1 -1
  119. package/components/dropdown/dropdown.css +1 -1
  120. package/components/dropdown/dropdown.d.ts +2 -2
  121. package/components/dropdown/dropdown.js +2 -2
  122. package/components/dropdown-menu/dropdown-menu.d.ts +5 -5
  123. package/components/dropdown-menu/dropdown-menu.js +1 -1
  124. package/components/editable-heading/editable-heading.css +6 -8
  125. package/components/editable-heading/editable-heading.d.ts +1 -1
  126. package/components/editable-heading/editable-heading.js +3 -2
  127. package/components/error-bubble/error-bubble-legacy.css +3 -3
  128. package/components/error-bubble/error-bubble.css +5 -5
  129. package/components/error-bubble/error-bubble.d.ts +1 -1
  130. package/components/error-bubble/error-bubble.figma.js +1 -1
  131. package/components/error-bubble/error-bubble.js +2 -2
  132. package/components/error-message/error-message.css +1 -1
  133. package/components/error-message/error-message.d.ts +2 -2
  134. package/components/error-message/error-message.js +2 -2
  135. package/components/error-page/error-page.css +3 -3
  136. package/components/footer/footer.css +2 -2
  137. package/components/footer/footer.d.ts +1 -1
  138. package/components/footer/footer.js +1 -1
  139. package/components/form/form.css +3 -3
  140. package/components/global/compose-refs.d.ts +2 -0
  141. package/components/global/compose-refs.js +14 -0
  142. package/components/global/composeRefs.d.ts +6 -2
  143. package/components/global/composeRefs.js +7 -14
  144. package/components/global/create-stateful-context.d.ts +1 -1
  145. package/components/global/dom.d.ts +1 -1
  146. package/components/global/dom.js +2 -4
  147. package/components/global/focus-sensor-hoc.d.ts +1 -1
  148. package/components/global/focus-sensor-hoc.js +2 -2
  149. package/components/global/fuzzy-highlight.d.ts +2 -2
  150. package/components/global/get-event-key.d.ts +1 -1
  151. package/components/global/global.css +2 -2
  152. package/components/global/memoize.js +1 -1
  153. package/components/global/rerender-hoc.d.ts +1 -1
  154. package/components/global/rerender-hoc.js +2 -2
  155. package/components/global/theme.d.ts +1 -1
  156. package/components/global/theme.js +2 -2
  157. package/components/global/url.js +3 -3
  158. package/components/global/use-event-callback.js +1 -1
  159. package/components/global/variables.css +1 -1
  160. package/components/grid/col.d.ts +1 -1
  161. package/components/grid/col.js +1 -1
  162. package/components/grid/grid.css +4 -4
  163. package/components/grid/grid.d.ts +1 -1
  164. package/components/grid/grid.js +1 -1
  165. package/components/grid/row.d.ts +1 -1
  166. package/components/grid/row.js +1 -1
  167. package/components/group/group.css +1 -1
  168. package/components/group/group.d.ts +1 -1
  169. package/components/group/group.js +1 -1
  170. package/components/header/header-icon.d.ts +2 -2
  171. package/components/header/header.css +4 -4
  172. package/components/header/header.d.ts +1 -1
  173. package/components/header/links.d.ts +1 -1
  174. package/components/header/logo.d.ts +1 -1
  175. package/components/header/profile.d.ts +5 -5
  176. package/components/header/profile.js +3 -3
  177. package/components/header/services-link.d.ts +1 -1
  178. package/components/header/services-link.js +3 -3
  179. package/components/header/services.css +1 -1
  180. package/components/header/services.d.ts +2 -2
  181. package/components/header/services.js +3 -3
  182. package/components/header/smart-profile.d.ts +3 -3
  183. package/components/header/smart-profile.js +2 -1
  184. package/components/header/smart-services.d.ts +3 -3
  185. package/components/header/tray.d.ts +1 -1
  186. package/components/heading/heading.css +2 -2
  187. package/components/heading/heading.d.ts +1 -1
  188. package/components/http/http.mock.d.ts +1 -1
  189. package/components/hub-source/{hub-source__user.d.ts → hub-source-user.d.ts} +3 -2
  190. package/components/hub-source/{hub-source__users-groups.d.ts → hub-source-users-groups.d.ts} +3 -2
  191. package/components/hub-source/hub-source.d.ts +2 -2
  192. package/components/icon/{icon__svg.d.ts → icon-svg.d.ts} +1 -1
  193. package/components/icon/icon.css +5 -5
  194. package/components/icon/icon.d.ts +2 -2
  195. package/components/icon/icon.js +3 -3
  196. package/components/input/input-legacy.css +2 -2
  197. package/components/input/input.css +5 -5
  198. package/components/input/input.d.ts +3 -3
  199. package/components/input/input.figma.js +1 -1
  200. package/components/input/input.js +8 -8
  201. package/components/input-size/input-size.css +1 -1
  202. package/components/island/adaptive-island-hoc.d.ts +1 -1
  203. package/components/island/content.d.ts +1 -1
  204. package/components/island/content.js +2 -2
  205. package/components/island/header.d.ts +1 -1
  206. package/components/island/header.js +4 -4
  207. package/components/island/island.css +3 -3
  208. package/components/island/island.d.ts +1 -1
  209. package/components/line/line.css +1 -1
  210. package/components/link/clickable-link.d.ts +12 -0
  211. package/components/link/clickable-link.js +25 -0
  212. package/components/link/clickableLink.d.ts +11 -12
  213. package/components/link/clickableLink.js +4 -25
  214. package/components/link/link.css +1 -1
  215. package/components/link/link.d.ts +2 -2
  216. package/components/link/link.js +4 -4
  217. package/components/list/consts.d.ts +4 -5
  218. package/components/list/{list__custom.d.ts → list-custom.d.ts} +1 -1
  219. package/components/list/{list__custom.js → list-custom.js} +1 -1
  220. package/components/list/{list__hint.d.ts → list-hint.d.ts} +1 -1
  221. package/components/list/{list__hint.js → list-hint.js} +1 -1
  222. package/components/list/{list__item.d.ts → list-item.d.ts} +2 -2
  223. package/components/list/{list__item.js → list-item.js} +6 -5
  224. package/components/list/{list__separator.d.ts → list-separator.d.ts} +1 -1
  225. package/components/list/{list__separator.js → list-separator.js} +1 -1
  226. package/components/list/{list__title.d.ts → list-title.d.ts} +1 -1
  227. package/components/list/{list__title.js → list-title.js} +1 -1
  228. package/components/list/{list__users-groups-source.d.ts → list-users-groups-source.d.ts} +3 -2
  229. package/components/list/{list__users-groups-source.js → list-users-groups-source.js} +1 -1
  230. package/components/list/{list__classes.d.ts → list.classes.d.ts} +1 -1
  231. package/components/list/list.css +5 -5
  232. package/components/list/list.d.ts +7 -7
  233. package/components/list/list.js +34 -28
  234. package/components/loader/{loader__core.js → loader-core.js} +2 -2
  235. package/components/loader/loader.css +1 -1
  236. package/components/loader/loader.d.ts +2 -2
  237. package/components/loader/loader.js +1 -1
  238. package/components/loader-inline/loader-inline.css +2 -2
  239. package/components/loader-inline/loader-inline.d.ts +1 -1
  240. package/components/loader-screen/loader-screen.css +2 -2
  241. package/components/loader-screen/loader-screen.d.ts +1 -1
  242. package/components/login-dialog/login-dialog.css +2 -2
  243. package/components/login-dialog/login-dialog.d.ts +1 -1
  244. package/components/login-dialog/login-dialog.js +1 -1
  245. package/components/login-dialog/service.d.ts +1 -1
  246. package/components/markdown/markdown.css +3 -3
  247. package/components/markdown/markdown.d.ts +1 -1
  248. package/components/markdown/markdown.js +1 -1
  249. package/components/message/message.css +3 -3
  250. package/components/message/message.d.ts +4 -4
  251. package/components/message/message.js +3 -3
  252. package/components/old-browsers-message/old-browsers-message.css +2 -2
  253. package/components/old-browsers-message/old-browsers-message.js +1 -1
  254. package/components/pager/pager.css +1 -1
  255. package/components/pager/pager.d.ts +2 -2
  256. package/components/pager/pager.js +11 -12
  257. package/components/panel/panel.css +1 -1
  258. package/components/panel/panel.d.ts +1 -1
  259. package/components/panel/panel.js +1 -1
  260. package/components/permissions/{permissions__cache.js → permissions-cache.js} +4 -5
  261. package/components/permissions/permissions.d.ts +2 -2
  262. package/components/permissions/permissions.js +2 -4
  263. package/components/popup/popup.css +3 -3
  264. package/components/popup/popup.d.ts +2 -2
  265. package/components/popup/popup.js +6 -5
  266. package/components/popup/popup.target.d.ts +1 -1
  267. package/components/popup/position-css.js +6 -10
  268. package/components/popup/position.js +10 -10
  269. package/components/popup-menu/popup-menu.d.ts +4 -4
  270. package/components/progress-bar/progress-bar.css +6 -8
  271. package/components/progress-bar/progress-bar.d.ts +1 -1
  272. package/components/progress-bar/progress-bar.js +1 -1
  273. package/components/query-assist/{query-assist__suggestions.d.ts → query-assist-suggestions.d.ts} +1 -1
  274. package/components/query-assist/query-assist.css +11 -11
  275. package/components/query-assist/query-assist.d.ts +4 -4
  276. package/components/query-assist/query-assist.js +11 -11
  277. package/components/radio/{radio__item.d.ts → radio-item.d.ts} +1 -1
  278. package/components/radio/{radio__item.js → radio-item.js} +2 -2
  279. package/components/radio/radio.css +2 -2
  280. package/components/radio/radio.d.ts +2 -2
  281. package/components/radio/radio.js +1 -1
  282. package/components/scrollable-section/scrollable-section.d.ts +1 -1
  283. package/components/scrollable-section/scrollable-section.js +1 -1
  284. package/components/select/{select__filter.d.ts → select-filter.d.ts} +2 -2
  285. package/components/select/{select__filter.js → select-filter.js} +1 -1
  286. package/components/select/select-popup.css +5 -5
  287. package/components/select/{select__popup.d.ts → select-popup.d.ts} +8 -8
  288. package/components/select/{select__popup.js → select-popup.js} +11 -7
  289. package/components/select/select.css +10 -9
  290. package/components/select/select.d.ts +6 -6
  291. package/components/select/select.js +27 -25
  292. package/components/shortcuts/core.js +7 -7
  293. package/components/shortcuts/shortcuts-hoc.d.ts +2 -2
  294. package/components/shortcuts/shortcuts.d.ts +1 -1
  295. package/components/sidebar/sidebar.css +1 -1
  296. package/components/slider/slider.css +2 -2
  297. package/components/slider/slider.d.ts +5 -5
  298. package/components/slider/slider.js +5 -5
  299. package/components/slider/slider.utils.d.ts +1 -1
  300. package/components/slider/slider.utils.js +2 -4
  301. package/components/storage/{storage__local.d.ts → storage-local.d.ts} +1 -1
  302. package/components/storage/{storage__local.js → storage-local.js} +7 -7
  303. package/components/storage/storage.d.ts +1 -1
  304. package/components/storage/storage.js +1 -1
  305. package/components/tab-trap/tab-trap.css +1 -1
  306. package/components/tab-trap/tab-trap.d.ts +1 -1
  307. package/components/tab-trap/tab-trap.js +2 -5
  308. package/components/table/cell.d.ts +1 -1
  309. package/components/table/disable-hover-hoc.d.ts +1 -1
  310. package/components/table/header-cell.d.ts +1 -1
  311. package/components/table/header-cell.js +1 -1
  312. package/components/table/header.d.ts +2 -2
  313. package/components/table/header.js +2 -2
  314. package/components/table/multitable.d.ts +3 -3
  315. package/components/table/multitable.js +1 -1
  316. package/components/table/row-with-focus-sensor.d.ts +3 -3
  317. package/components/table/row.d.ts +4 -4
  318. package/components/table/row.js +1 -1
  319. package/components/table/selection-adapter.d.ts +2 -1
  320. package/components/table/selection-shortcuts-hoc.d.ts +4 -3
  321. package/components/table/selection-shortcuts-hoc.js +1 -3
  322. package/components/table/selection.js +4 -8
  323. package/components/table/simple-table.d.ts +2 -2
  324. package/components/table/smart-table.d.ts +2 -2
  325. package/components/table/table.css +6 -6
  326. package/components/table/table.d.ts +7 -7
  327. package/components/table/table.js +3 -3
  328. package/components/tabs/collapsible-more.d.ts +3 -3
  329. package/components/tabs/collapsible-more.js +2 -2
  330. package/components/tabs/collapsible-tab.d.ts +2 -2
  331. package/components/tabs/collapsible-tab.js +1 -1
  332. package/components/tabs/collapsible-tabs.d.ts +2 -2
  333. package/components/tabs/collapsible-tabs.js +6 -8
  334. package/components/tabs/custom-item.d.ts +2 -2
  335. package/components/tabs/dumb-tabs.d.ts +3 -3
  336. package/components/tabs/dumb-tabs.js +3 -3
  337. package/components/tabs/smart-tabs.d.ts +1 -1
  338. package/components/tabs/tab-link.d.ts +2 -2
  339. package/components/tabs/tab.d.ts +2 -2
  340. package/components/tabs/tabs.css +6 -6
  341. package/components/tag/tag.css +5 -5
  342. package/components/tag/tag.d.ts +2 -2
  343. package/components/tag/tag.js +2 -2
  344. package/components/tags-input/tags-input.css +3 -3
  345. package/components/tags-input/tags-input.d.ts +8 -8
  346. package/components/tags-input/tags-input.js +13 -7
  347. package/components/tags-list/tags-list.d.ts +2 -2
  348. package/components/tags-list/tags-list.js +1 -1
  349. package/components/text/text.css +1 -1
  350. package/components/text/text.d.ts +1 -1
  351. package/components/toggle/toggle.css +2 -2
  352. package/components/toggle/toggle.d.ts +1 -1
  353. package/components/toggle/toggle.js +1 -1
  354. package/components/tooltip/tooltip.css +1 -1
  355. package/components/tooltip/tooltip.d.ts +2 -2
  356. package/components/tooltip/tooltip.js +1 -1
  357. package/components/upload/upload.css +1 -1
  358. package/components/upload/upload.d.ts +3 -3
  359. package/components/upload/upload.js +2 -2
  360. package/components/user-agreement/service.d.ts +2 -2
  361. package/components/user-agreement/service.js +3 -5
  362. package/components/user-agreement/user-agreement.css +2 -2
  363. package/components/user-agreement/user-agreement.d.ts +1 -1
  364. package/components/user-agreement/user-agreement.js +1 -1
  365. package/components/user-card/card.d.ts +1 -1
  366. package/components/user-card/card.js +3 -2
  367. package/components/user-card/smart-user-card-tooltip.d.ts +2 -2
  368. package/components/user-card/smart-user-card-tooltip.js +1 -1
  369. package/components/user-card/tooltip.d.ts +3 -3
  370. package/components/user-card/user-card.css +1 -1
  371. package/package.json +4 -1
  372. /package/components/button/{button__classes.js → button.classes.js} +0 -0
  373. /package/components/dialog/{dialog__body-scroll-preventer.d.ts → dialog-body-scroll-preventer.d.ts} +0 -0
  374. /package/components/global/{variables.d.ts → variables.interface.d.ts} +0 -0
  375. /package/components/global/{variables.js → variables.interface.js} +0 -0
  376. /package/components/hub-source/{hub-source__user.js → hub-source-user.js} +0 -0
  377. /package/components/hub-source/{hub-source__users-groups.js → hub-source-users-groups.js} +0 -0
  378. /package/components/icon/{icon__svg.js → icon-svg.js} +0 -0
  379. /package/components/icon/{icon__constants.d.ts → icon.constants.d.ts} +0 -0
  380. /package/components/icon/{icon__constants.js → icon.constants.js} +0 -0
  381. /package/components/list/{list__classes.js → list.classes.js} +0 -0
  382. /package/components/loader/{loader__core.d.ts → loader-core.d.ts} +0 -0
  383. /package/components/old-browsers-message/{old-browsers-message__stop.d.ts → old-browsers-message-stop.d.ts} +0 -0
  384. /package/components/old-browsers-message/{old-browsers-message__stop.js → old-browsers-message-stop.js} +0 -0
  385. /package/components/permissions/{permissions__cache.d.ts → permissions-cache.d.ts} +0 -0
  386. /package/components/query-assist/{query-assist__suggestions.js → query-assist-suggestions.js} +0 -0
@@ -1,4 +1,4 @@
1
- @import "../global/variables.css";
1
+ @import '../global/variables.css';
2
2
 
3
3
  .alert {
4
4
  --ring-alert-animation-duration: 300ms;
@@ -1,4 +1,4 @@
1
- import { PureComponent, ReactNode } from 'react';
1
+ import { PureComponent, type ReactNode } from 'react';
2
2
  import * as React from 'react';
3
3
  import Theme from '../global/theme';
4
4
  export declare const ANIMATION_TIME = 500;
@@ -118,7 +118,7 @@ export default class Alert extends PureComponent {
118
118
  [styles.withCloseButton]: this.props.closeable,
119
119
  }), onClick: this._handleCaptionsLinksClick,
120
120
  // We only process clicks on `a` elements, see above
121
- role: "presentation", children: this.props.children }));
121
+ role: 'presentation', children: this.props.children }));
122
122
  }
123
123
  /**
124
124
  * @private
@@ -129,7 +129,7 @@ export default class Alert extends PureComponent {
129
129
  if (glyph) {
130
130
  return _jsx(Icon, { glyph: glyph, className: styles.icon, color: TypeToIconColor[this.props.type] || Color.DEFAULT });
131
131
  }
132
- else if (this.props.type === AlertType.LOADING) {
132
+ if (this.props.type === AlertType.LOADING) {
133
133
  return _jsx(Loader, { className: styles.loader });
134
134
  }
135
135
  return '';
@@ -149,7 +149,7 @@ export default class Alert extends PureComponent {
149
149
  });
150
150
  const height = this.state.height;
151
151
  const style = height ? { marginBottom: -height } : undefined;
152
- return (_jsxs(ThemeProvider, { theme: theme, className: classes, "data-test": dataTests('alert', dataTest), "data-test-type": type, style: style, ref: this.storeAlertRef, children: [this._getIcon(), this._getCaption(), this.props.closeable ? (_jsx(Button, { icon: closeIcon, className: classNames(styles.close, closeButtonClassName), "data-test": "alert-close", "aria-label": "close alert", onClick: this.closeRequest })) : ('')] }));
152
+ return (_jsxs(ThemeProvider, { theme: theme, className: classes, "data-test": dataTests('alert', dataTest), "data-test-type": type, style: style, ref: this.storeAlertRef, children: [this._getIcon(), this._getCaption(), this.props.closeable ? (_jsx(Button, { icon: closeIcon, className: classNames(styles.close, closeButtonClassName), "data-test": 'alert-close', "aria-label": 'close alert', onClick: this.closeRequest })) : ('')] }));
153
153
  }
154
154
  }
155
155
  export { default as Container } from './container';
@@ -1,4 +1,4 @@
1
- @import "../global/variables.css";
1
+ @import '../global/variables.css';
2
2
 
3
3
  .alertContainer {
4
4
  position: fixed;
@@ -20,7 +20,7 @@
20
20
  }
21
21
 
22
22
  .alertInContainer {
23
- composes: alert from "./alert.css";
23
+ composes: alert from './alert.css';
24
24
 
25
25
  overflow-y: auto;
26
26
 
@@ -1,4 +1,4 @@
1
- import { PureComponent, HTMLAttributes, ReactElement } from 'react';
1
+ import { PureComponent, type HTMLAttributes, type ReactElement } from 'react';
2
2
  import type { AlertProps } from './alert';
3
3
  /**
4
4
  * @name Alert Container
@@ -11,7 +11,7 @@ export default class Alerts extends PureComponent {
11
11
  if (!show) {
12
12
  return null;
13
13
  }
14
- return createPortal(_jsx("div", { "data-test": "alert-container", className: classes, "aria-live": "polite", ...restProps, children: Children.map(children, child => {
14
+ return createPortal(_jsx("div", { "data-test": 'alert-container', className: classes, "aria-live": 'polite', ...restProps, children: Children.map(children, child => {
15
15
  if (!isValidElement(child)) {
16
16
  return child;
17
17
  }
@@ -1,5 +1,5 @@
1
- import { ReactNode, Ref } from 'react';
2
- import Alert, { AlertProps, AlertType } from '../alert/alert';
1
+ import { type ReactNode, type Ref } from 'react';
2
+ import Alert, { type AlertProps, type AlertType } from '../alert/alert';
3
3
  export interface AlertItem extends Partial<Omit<AlertProps, 'children'>> {
4
4
  key: string | number;
5
5
  message: ReactNode;
@@ -1,4 +1,4 @@
1
- import { AnalyticsPlugin, Serializable } from './analytics';
1
+ import { type AnalyticsPlugin, type Serializable } from './analytics';
2
2
  export interface AnalyticsCustomPluginData {
3
3
  category: string;
4
4
  action: string;
@@ -34,7 +34,7 @@ export default class AnalyticsCustomPlugin {
34
34
  }
35
35
  _initSendSchedule() {
36
36
  window.addEventListener('beforeunload', () => this._flush?.());
37
- if (this._flush != null) {
37
+ if (this._flush) {
38
38
  setInterval(this._flush, this._flushInterval);
39
39
  }
40
40
  this._hasSendSchedule = true;
@@ -51,7 +51,7 @@ export default class AnalyticsCustomPlugin {
51
51
  }
52
52
  _addDataToFlushingPack(sendingData) {
53
53
  this._data.push(sendingData);
54
- if (this._flushMaxPackSize != null && this._data.length >= this._flushMaxPackSize) {
54
+ if (this._flushMaxPackSize && this._data.length >= this._flushMaxPackSize) {
55
55
  this._flush?.();
56
56
  }
57
57
  }
@@ -1,11 +1,11 @@
1
- import Listeners, { Handler } from '../global/listeners';
2
- import HTTP, { HTTPAuth, RequestParams } from '../http/http';
3
- import type AuthDialogService from '../auth-dialog-service/auth-dialog-service';
4
- import AuthStorage, { AuthState } from './storage';
5
- import { AuthError, AuthResponse } from './response-parser';
1
+ import Listeners, { type Handler } from '../global/listeners';
2
+ import HTTP, { type HTTPAuth, type RequestParams } from '../http/http';
3
+ import AuthStorage, { type AuthState } from './storage';
4
+ import { type AuthError, type AuthResponse } from './response-parser';
6
5
  import AuthRequestBuilder from './request-builder';
7
6
  import BackgroundFlow from './background-flow';
8
- import TokenValidator, { TokenValidationError, TokenValidatorConfig } from './token-validator';
7
+ import TokenValidator, { type TokenValidationError, type TokenValidatorConfig } from './token-validator';
8
+ import type AuthDialogService from '../auth-dialog-service/auth-dialog-service';
9
9
  export declare const DEFAULT_EXPIRES_TIMEOUT: number;
10
10
  export declare const DEFAULT_BACKGROUND_TIMEOUT: number;
11
11
  export declare const USER_CHANGED_EVENT = "userChange";
@@ -116,7 +116,7 @@ declare global {
116
116
  pr?: string;
117
117
  }
118
118
  }
119
- export default class Auth implements HTTPAuth {
119
+ declare class Auth implements HTTPAuth {
120
120
  static DEFAULT_CONFIG: Omit<AuthConfig, "serverUri">;
121
121
  static API_PATH: string;
122
122
  static API_AUTH_PATH: string;
@@ -233,4 +233,5 @@ export default class Auth implements HTTPAuth {
233
233
  */
234
234
  setHash(hash: string): void;
235
235
  }
236
- export {};
236
+ export default Auth;
237
+ export { Auth };
@@ -1,3 +1,4 @@
1
+ /* eslint-disable no-underscore-dangle,max-lines */
1
2
  import { fixUrl, getAbsoluteBaseURL } from '../global/url';
2
3
  import Listeners from '../global/listeners';
3
4
  import HTTP from '../http/http';
@@ -45,7 +46,7 @@ const DEFAULT_CONFIG = {
45
46
  waitForRedirectTimeout: DEFAULT_WAIT_FOR_REDIRECT_TIMEOUT,
46
47
  translations: null,
47
48
  };
48
- export default class Auth {
49
+ class Auth {
49
50
  static DEFAULT_CONFIG = DEFAULT_CONFIG;
50
51
  static API_PATH = 'api/rest/';
51
52
  static API_AUTH_PATH = 'oauth2/auth';
@@ -75,10 +76,10 @@ export default class Auth {
75
76
  if (!config) {
76
77
  throw new Error('Config is required');
77
78
  }
78
- if (config.serverUri == null) {
79
+ if (config.serverUri === null || config.serverUri === undefined) {
79
80
  throw new Error('"serverUri" property is required');
80
81
  }
81
- const unsupportedParams = ['redirect_uri', 'request_credentials', 'client_id'].filter(param => config.hasOwnProperty(param));
82
+ const unsupportedParams = ['redirect_uri', 'request_credentials', 'client_id'].filter(param => Object.prototype.hasOwnProperty.call(config, param));
82
83
  if (unsupportedParams.length !== 0) {
83
84
  throw new Error(`The following parameters are no longer supported: ${unsupportedParams.join(', ')}. Please change them from snake_case to camelCase.`);
84
85
  }
@@ -186,6 +187,7 @@ export default class Auth {
186
187
  * @return {Promise.<string>} absolute URL promise that is resolved to a URL
187
188
  * that should be restored after returning back from auth server.
188
189
  */
190
+ // eslint-disable-next-line complexity
189
191
  async init() {
190
192
  this._storage?.onTokenChange(async (token) => {
191
193
  const isGuest = this.user ? this.user.guest : false;
@@ -262,7 +264,7 @@ export default class Auth {
262
264
  }
263
265
  async sendRedirect(error) {
264
266
  const authRequest = await this._requestBuilder?.prepareAuthRequest();
265
- if (authRequest != null) {
267
+ if (authRequest) {
266
268
  this._redirectCurrentPage(authRequest.url);
267
269
  }
268
270
  // HUB-10867 Since we already redirecting the page, there is no actual need to throw an error
@@ -384,11 +386,9 @@ export default class Auth {
384
386
  });
385
387
  });
386
388
  }
387
- else {
388
- const authRequest = await this._requestBuilder?.prepareAuthRequest();
389
- if (authRequest != null) {
390
- this._redirectCurrentPage(authRequest.url);
391
- }
389
+ const authRequest = await this._requestBuilder?.prepareAuthRequest();
390
+ if (authRequest) {
391
+ this._redirectCurrentPage(authRequest.url);
392
392
  }
393
393
  throw new TokenValidator.TokenValidationError(error.message);
394
394
  }
@@ -415,9 +415,7 @@ export default class Auth {
415
415
  if (this.config.cacheCurrentUser) {
416
416
  return this._storage?.getCachedUser(() => this.http.authorizedFetch(Auth.API_PROFILE_PATH, accessToken, this.config.userParams));
417
417
  }
418
- else {
419
- return this.http.authorizedFetch(Auth.API_PROFILE_PATH, accessToken, this.config.userParams);
420
- }
418
+ return this.http.authorizedFetch(Auth.API_PROFILE_PATH, accessToken, this.config.userParams);
421
419
  }
422
420
  /**
423
421
  * @return {Promise.<object>}
@@ -640,7 +638,6 @@ export default class Auth {
640
638
  */
641
639
  async logout(extraParams) {
642
640
  const requestParams = {
643
- // eslint-disable-next-line camelcase
644
641
  request_credentials: 'required',
645
642
  ...extraParams,
646
643
  };
@@ -649,7 +646,7 @@ export default class Auth {
649
646
  this._updateDomainUser(null);
650
647
  await this._storage?.wipeToken();
651
648
  const authRequest = await this._requestBuilder?.prepareAuthRequest(requestParams);
652
- if (authRequest != null) {
649
+ if (authRequest) {
653
650
  this._redirectCurrentPage(authRequest.url);
654
651
  }
655
652
  }
@@ -659,9 +656,6 @@ export default class Auth {
659
656
  this._isLoginWindowOpen = true;
660
657
  return await this._embeddedFlow?.authorize();
661
658
  }
662
- catch (e) {
663
- throw e;
664
- }
665
659
  finally {
666
660
  this._isLoginWindowOpen = false;
667
661
  }
@@ -751,7 +745,7 @@ export default class Auth {
751
745
  const scopes = scope ? scope.split(' ') : newState.scopes || defaultScope || [];
752
746
  const effectiveExpiresIn = expiresIn ? parseInt(expiresIn, 10) : defaultExpiresIn;
753
747
  const expires = TokenValidator._epoch() + effectiveExpiresIn;
754
- if (accessToken != null) {
748
+ if (accessToken) {
755
749
  await this._storage?.saveToken({ accessToken, scopes, expires, lifeTime: effectiveExpiresIn });
756
750
  }
757
751
  return newState;
@@ -844,3 +838,5 @@ export default class Auth {
844
838
  }
845
839
  }
846
840
  }
841
+ export default Auth;
842
+ export { Auth };
@@ -1,3 +1,3 @@
1
- import Auth from './auth__core';
2
- export * from './auth__core';
1
+ import Auth from './auth-core';
2
+ export * from './auth-core';
3
3
  export default Auth;
@@ -1,6 +1,6 @@
1
1
  import WindowFlow from './window-flow';
2
2
  import defaultOnBackendDown from './down-notification';
3
- import Auth from './auth__core';
3
+ import Auth from './auth-core';
4
4
  /**
5
5
  * @name Auth
6
6
  *
@@ -38,5 +38,5 @@ Auth.DEFAULT_CONFIG = {
38
38
  EmbeddedLoginFlow: WindowFlow,
39
39
  onBackendDown: defaultOnBackendDown,
40
40
  };
41
- export * from './auth__core';
41
+ export * from './auth-core';
42
42
  export default Auth;
@@ -1,5 +1,5 @@
1
- import AuthRequestBuilder from './request-builder';
2
- import AuthStorage from './storage';
1
+ import type AuthRequestBuilder from './request-builder';
2
+ import type AuthStorage from './storage';
3
3
  export declare const HUB_AUTH_PAGE_OPENED = "HUB_AUTH_PAGE_OPENED";
4
4
  export default class BackgroundFlow {
5
5
  _requestBuilder: AuthRequestBuilder;
@@ -41,7 +41,6 @@ export default class BackgroundFlow {
41
41
  */
42
42
  async _load() {
43
43
  const authRequest = await this._requestBuilder
44
- // eslint-disable-next-line camelcase
45
44
  .prepareAuthRequest({ request_credentials: 'silent' }, { nonRedirect: true });
46
45
  return new Promise((resolve, reject) => {
47
46
  function onMessage(e) {
@@ -1,4 +1,4 @@
1
- @import "../global/variables.css";
1
+ @import '../global/variables.css';
2
2
 
3
3
  .title {
4
4
  font-weight: var(--ring-font-weight-bold);
@@ -18,7 +18,7 @@ function renderAlert(message, type = Alert.Type.WARNING) {
18
18
  }
19
19
  function Message({ translations, onCheckAgain }) {
20
20
  const { backendIsNotAvailable, checkAgain, errorMessage } = translations;
21
- return (_jsxs("div", { "data-test": "ring-backend-down-notification", children: [_jsx(Group, { children: _jsx("div", { className: styles.title, children: backendIsNotAvailable }) }), _jsxs("span", { className: styles.error, children: [errorMessage, " "] }), _jsx(Link, { onClick: onCheckAgain, "data-test": "check-again", children: checkAgain })] }));
21
+ return (_jsxs("div", { "data-test": 'ring-backend-down-notification', children: [_jsx(Group, { children: _jsx("div", { className: styles.title, children: backendIsNotAvailable }) }), _jsxs("span", { className: styles.error, children: [errorMessage, " "] }), _jsx(Link, { onClick: onCheckAgain, "data-test": 'check-again', children: checkAgain })] }));
22
22
  }
23
23
  export default function onBackendDown({ onCheckAgain, translations }) {
24
24
  async function checkAgainWithoutClosing(e) {
@@ -1,6 +1,6 @@
1
- import { AuthTranslations, LoginFlow } from './auth__core';
2
- import AuthRequestBuilder from './request-builder';
3
- import AuthStorage from './storage';
1
+ import { type AuthTranslations, type LoginFlow } from './auth-core';
2
+ import type AuthRequestBuilder from './request-builder';
3
+ import type AuthStorage from './storage';
4
4
  export default class IFrameFlow implements LoginFlow {
5
5
  hideDialog: (() => void) | null;
6
6
  private _requestBuilder;
@@ -20,10 +20,8 @@ export default class IFrameFlow {
20
20
  * Initiates authorization in window
21
21
  */
22
22
  async _load() {
23
- const authRequest = await this._requestBuilder.prepareAuthRequest(
24
- // eslint-disable-next-line camelcase
25
- { request_credentials: 'required', auth_mode: 'bypass_to_login' }, { nonRedirect: false });
26
- const renderFallbackLink = () => (_jsx(Link, { href: authRequest.url, target: "_self", children: this._translations.nothingHappensLink }));
23
+ const authRequest = await this._requestBuilder.prepareAuthRequest({ request_credentials: 'required', auth_mode: 'bypass_to_login' }, { nonRedirect: false });
24
+ const renderFallbackLink = () => (_jsx(Link, { href: authRequest.url, target: '_self', children: this._translations.nothingHappensLink }));
27
25
  return new Promise((resolve, reject) => {
28
26
  this.hideDialog = loginDialogService({
29
27
  url: authRequest.url,
@@ -71,7 +69,7 @@ export default class IFrameFlow {
71
69
  this._reset();
72
70
  }
73
71
  authorize() {
74
- if (this._promise != null && this._loginWindow != null && !this._loginWindow.closed) {
72
+ if (this._promise && this._loginWindow && !this._loginWindow.closed) {
75
73
  return this._promise;
76
74
  }
77
75
  this._promise = this._load();
@@ -1,5 +1,6 @@
1
1
  import uuid from 'simply-uuid';
2
- import AuthStorage, { AuthState } from './storage';
2
+ import type { AuthState } from './storage';
3
+ import type AuthStorage from './storage';
3
4
  export interface AuthRequestBuilderConfig {
4
5
  authorization: string;
5
6
  redirectUri?: string | null | undefined;
@@ -29,9 +29,9 @@ export default class AuthRequestBuilder {
29
29
  * @return {Promise.<string>} promise that is resolved to authURL
30
30
  */
31
31
  async prepareAuthRequest(extraParams, extraState) {
32
+ // eslint-disable-next-line no-underscore-dangle
32
33
  const stateId = AuthRequestBuilder._uuid();
33
34
  const scopes = this.config.scopes.map(scope => encodeURIComponent(scope));
34
- /* eslint-disable camelcase */
35
35
  const request = Object.assign({
36
36
  response_type: 'token',
37
37
  state: stateId,
@@ -40,7 +40,6 @@ export default class AuthRequestBuilder {
40
40
  client_id: this.config.clientId,
41
41
  scope: scopes.join(' '),
42
42
  }, extraParams || {});
43
- /* eslint-enable camelcase */
44
43
  const authURL = encodeURL(this.config.authorization, request);
45
44
  const state = Object.assign({
46
45
  restoreLocation: window.location.href,
@@ -1,6 +1,6 @@
1
- import { StorageClass, StorageInterface } from '../storage/storage';
2
- import { AuthUser } from './auth__core';
3
- import { AuthResponse } from './response-parser';
1
+ import { type StorageClass, type StorageInterface } from '../storage/storage';
2
+ import { type AuthUser } from './auth-core';
3
+ import { type AuthResponse } from './response-parser';
4
4
  export interface StoredToken {
5
5
  accessToken: string;
6
6
  scopes?: string[];
@@ -100,9 +100,7 @@ export default class AuthStorage {
100
100
  await this.cleanStates();
101
101
  return this.saveState(id, state, true);
102
102
  }
103
- else {
104
- throw e;
105
- }
103
+ throw e;
106
104
  }
107
105
  return undefined;
108
106
  }
@@ -114,7 +112,7 @@ export default class AuthStorage {
114
112
  async cleanStates(removeStateId) {
115
113
  const now = Date.now();
116
114
  const removalResult = await this._stateStorage.each((key, value) => {
117
- if (value == null) {
115
+ if (value === null || value === undefined) {
118
116
  return undefined;
119
117
  }
120
118
  // Remove requested state
@@ -137,7 +135,7 @@ export default class AuthStorage {
137
135
  }
138
136
  return undefined;
139
137
  });
140
- const currentStates = removalResult.filter((state) => state != null);
138
+ const currentStates = removalResult.filter((state) => state !== null && state !== undefined);
141
139
  let stateStorageSize = currentStates.reduce((overallSize, state) => state.size + overallSize, 0);
142
140
  if (stateStorageSize > this.stateQuota) {
143
141
  currentStates.sort((a, b) => a.created - b.created);
@@ -205,9 +203,7 @@ export default class AuthStorage {
205
203
  setTimeout(loadAndCache, UPDATE_USER_TIMEOUT);
206
204
  return user;
207
205
  }
208
- else {
209
- return loadAndCache();
210
- }
206
+ return loadAndCache();
211
207
  }
212
208
  /**
213
209
  * Remove cached user if any
@@ -1,4 +1,5 @@
1
- import AuthStorage, { StoredToken } from './storage';
1
+ import type AuthStorage from './storage';
2
+ import type { StoredToken } from './storage';
2
3
  export interface TokenValidatorConfig {
3
4
  scope: string[];
4
5
  optionalScopes?: readonly string[] | null | undefined;
@@ -45,7 +45,9 @@ export default class TokenValidator {
45
45
  */
46
46
  validateTokenLocally() {
47
47
  return this._getValidatedToken([
48
+ // eslint-disable-next-line no-underscore-dangle
48
49
  TokenValidator._validateExistence,
50
+ // eslint-disable-next-line no-underscore-dangle
49
51
  TokenValidator._validateExpiration,
50
52
  this._validateScopes.bind(this),
51
53
  ]);
@@ -56,7 +58,9 @@ export default class TokenValidator {
56
58
  */
57
59
  validateToken() {
58
60
  return this._getValidatedToken([
61
+ // eslint-disable-next-line no-underscore-dangle
59
62
  TokenValidator._validateExistence,
63
+ // eslint-disable-next-line no-underscore-dangle
60
64
  TokenValidator._validateExpiration,
61
65
  this._validateScopes.bind(this),
62
66
  this._validateAgainstUser.bind(this),
@@ -82,6 +86,7 @@ export default class TokenValidator {
82
86
  static _validateExpiration({ expires, lifeTime }) {
83
87
  const REFRESH_BEFORE_RATIO = 6;
84
88
  const refreshBefore = lifeTime ? Math.ceil(lifeTime / REFRESH_BEFORE_RATIO) : TokenValidator.DEFAULT_REFRESH_BEFORE;
89
+ // eslint-disable-next-line no-underscore-dangle
85
90
  if (expires && expires < TokenValidator._epoch() + refreshBefore) {
86
91
  throw new TokenValidator.TokenValidationError('Token expired');
87
92
  }
@@ -150,7 +155,7 @@ export default class TokenValidator {
150
155
  */
151
156
  async _getValidatedToken(validators) {
152
157
  const storedToken = await this._storage.getToken();
153
- if (storedToken == null) {
158
+ if (storedToken === null || storedToken === undefined) {
154
159
  throw new TokenValidator.TokenValidationError('Token not found');
155
160
  }
156
161
  for (let i = 0; i < validators.length; i++) {
@@ -1,6 +1,6 @@
1
- import { LoginFlow } from './auth__core';
2
- import AuthRequestBuilder from './request-builder';
3
- import AuthStorage from './storage';
1
+ import { type LoginFlow } from './auth-core';
2
+ import type AuthRequestBuilder from './request-builder';
3
+ import type AuthStorage from './storage';
4
4
  export default class WindowFlow implements LoginFlow {
5
5
  private _timeoutId;
6
6
  private _requestBuilder;
@@ -30,9 +30,7 @@ export default class WindowFlow {
30
30
  * Initiates authorization in window
31
31
  */
32
32
  async _load() {
33
- const authRequest = await this._requestBuilder.prepareAuthRequest(
34
- // eslint-disable-next-line camelcase
35
- { request_credentials: 'required', auth_mode: 'bypass_to_login' }, { nonRedirect: true });
33
+ const authRequest = await this._requestBuilder.prepareAuthRequest({ request_credentials: 'required', auth_mode: 'bypass_to_login' }, { nonRedirect: true });
36
34
  return new Promise((resolve, reject) => {
37
35
  this.reject = reject;
38
36
  let cleanRun;
@@ -60,10 +58,12 @@ export default class WindowFlow {
60
58
  reject(new AuthResponseParser.AuthError(state));
61
59
  }
62
60
  });
63
- if (this._loginWindow == null || this._loginWindow.closed) {
61
+ if (this._loginWindow === null ||
62
+ this._loginWindow === undefined ||
63
+ (this._loginWindow && this._loginWindow.closed)) {
64
64
  this._loginWindow = this._openWindow(authRequest.url);
65
65
  }
66
- else {
66
+ else if (this._loginWindow) {
67
67
  this._loginWindow.location.href = authRequest.url;
68
68
  }
69
69
  this.checkIsClosed();
@@ -82,7 +82,7 @@ export default class WindowFlow {
82
82
  clearTimeout(this._timeoutId);
83
83
  };
84
84
  stop() {
85
- if (this._loginWindow != null) {
85
+ if (this._loginWindow !== null && this._loginWindow !== undefined) {
86
86
  this._loginWindow.close();
87
87
  }
88
88
  if (this.reject) {
@@ -91,7 +91,7 @@ export default class WindowFlow {
91
91
  this._reset();
92
92
  }
93
93
  authorize() {
94
- if (this._promise != null && this._loginWindow != null && !this._loginWindow.closed) {
94
+ if (this._promise && this._loginWindow && !this._loginWindow.closed) {
95
95
  this._loginWindow.focus();
96
96
  return this._promise;
97
97
  }
@@ -1,4 +1,4 @@
1
- @import "../global/variables.css";
1
+ @import '../global/variables.css';
2
2
 
3
3
  .dialog.dialog {
4
4
  width: auto;
@@ -6,7 +6,7 @@
6
6
  }
7
7
 
8
8
  .content {
9
- composes: font from "../global/global.css";
9
+ composes: font from '../global/global.css';
10
10
 
11
11
  display: flex;
12
12
  align-items: center;
@@ -54,6 +54,6 @@ export default class AuthDialog extends Component {
54
54
  const title = (this.props.title || defaultTitle)
55
55
  .replace('%serviceName%', serviceName ?? '')
56
56
  .replace('{{serviceName}}', serviceName ?? '');
57
- return (_jsx(Dialog, { label: title, "data-test": "ring-auth-dialog", className: className, contentClassName: classNames(className, styles.dialog), onEscPress: this.onEscPress, show: show, trapFocus: true, children: _jsx(Content, { children: _jsxs("div", { className: styles.content, children: [serviceImage && _jsx("img", { alt: `${serviceName} logo`, className: styles.logo, src: serviceImage }), _jsx(H2, { className: styles.title, children: title }), errorMessage && _jsx("div", { className: styles.error, children: errorMessage }), _jsx(Button, { primary: true, className: styles.firstButton, "data-test": "auth-dialog-confirm-button", onClick: onConfirm, children: confirmLabel }), onTryAgain && (_jsx(Button, { className: styles.button, "data-test": "auth-dialog-retry-button", onClick: () => this.onRetryPress(), loader: retrying, disabled: retrying, children: tryAgainLabel })), _jsx(Button, { className: styles.button, "data-test": "auth-dialog-cancel-button", onClick: onCancel, children: cancelLabel })] }) }) }));
57
+ return (_jsx(Dialog, { label: title, "data-test": 'ring-auth-dialog', className: className, contentClassName: classNames(className, styles.dialog), onEscPress: this.onEscPress, show: show, trapFocus: true, children: _jsx(Content, { children: _jsxs("div", { className: styles.content, children: [serviceImage && _jsx("img", { alt: `${serviceName} logo`, className: styles.logo, src: serviceImage }), _jsx(H2, { className: styles.title, children: title }), errorMessage && _jsx("div", { className: styles.error, children: errorMessage }), _jsx(Button, { primary: true, className: styles.firstButton, "data-test": 'auth-dialog-confirm-button', onClick: onConfirm, children: confirmLabel }), onTryAgain && (_jsx(Button, { className: styles.button, "data-test": 'auth-dialog-retry-button', onClick: () => this.onRetryPress(), loader: retrying, disabled: retrying, children: tryAgainLabel })), _jsx(Button, { className: styles.button, "data-test": 'auth-dialog-cancel-button', onClick: onCancel, children: cancelLabel })] }) }) }));
58
58
  }
59
59
  }
@@ -1,4 +1,4 @@
1
- import AuthDialog, { AuthDialogProps } from '../auth-dialog/auth-dialog';
1
+ import AuthDialog, { type AuthDialogProps } from '../auth-dialog/auth-dialog';
2
2
  export declare const reactRoot: import("react-dom/client").Root;
3
3
  type AuthDialogAttributes = React.JSX.LibraryManagedAttributes<typeof AuthDialog, AuthDialogProps>;
4
4
  export default function showAuthDialog(props?: AuthDialogAttributes): () => void;
@@ -1,4 +1,4 @@
1
- import { ReactNode } from 'react';
1
+ import { type ReactNode } from 'react';
2
2
  import { Size } from './avatar-size';
3
3
  interface InfoAvatarProps {
4
4
  size: Size;
@@ -1,4 +1,4 @@
1
- @import "../global/variables.css";
1
+ @import '../global/variables.css';
2
2
 
3
3
  .avatar {
4
4
  display: inline-block;
@@ -1,4 +1,4 @@
1
- import { PureComponent, ImgHTMLAttributes, ReactNode } from 'react';
1
+ import { PureComponent, type ImgHTMLAttributes, type ReactNode } from 'react';
2
2
  import { Size } from './avatar-size';
3
3
  export { Size };
4
4
  export interface AvatarProps extends ImgHTMLAttributes<HTMLImageElement> {
@@ -1,5 +1,5 @@
1
1
  // url=https://www.figma.com/design/HY6d4uE1xxaQXCMG9fe6Y2/RingUI?node-id=5990-522
2
- const figma = require('figma');
2
+ import figma from '@figma/code-connect';
3
3
 
4
4
  const instance = figma.selectedInstance;
5
5
 
@@ -49,9 +49,9 @@ export default class Avatar extends PureComponent {
49
49
  [styles.round]: round,
50
50
  });
51
51
  if (!url || this.state.errorUrl === url) {
52
- return (_jsxs("span", { ...restProps, "data-test": "avatar", className: classNames(classes, {
53
- [styles.empty]: username == null && info == null,
54
- }), style: styleObj, children: [username != null && _jsx(FallbackAvatar, { size: size, round: round, username: username }), info != null && _jsx(AvatarInfo, { size: size, children: info })] }));
52
+ return (_jsxs("span", { ...restProps, "data-test": 'avatar', className: classNames(classes, {
53
+ [styles.empty]: (username === null || username === undefined) && (info === null || info === undefined),
54
+ }), style: styleObj, children: [username && _jsx(FallbackAvatar, { size: size, round: round, username: username }), info && _jsx(AvatarInfo, { size: size, children: info })] }));
55
55
  }
56
56
  let src = url;
57
57
  if (!skipParams && !isDataURI(url)) {
@@ -72,10 +72,8 @@ export default class Avatar extends PureComponent {
72
72
  subavatarSizeString,
73
73
  };
74
74
  subavatarSrc = skipParams ? subavatar : encodeURL(urlStart, queryParams);
75
- return (_jsxs("div", { children: [_jsx("img", { ...restProps, onError: this.handleError, onLoad: this.handleSuccess, className: classNames(classes, styles.avatarShadow), style: styleObj, src: src, alt: "User avatar" }), _jsx("img", { ...restProps, "data-test": "avatar", onError: this.handleError, onLoad: this.handleSuccess, className: classNames(styles.subavatar), style: styleObjGroup, src: subavatarSrc, alt: "Subavatar" })] }));
76
- }
77
- else {
78
- return (_jsx("img", { ...restProps, "data-test": "avatar", onError: this.handleError, onLoad: this.handleSuccess, className: classNames(classes, styles.avatarShadow), style: styleObj, src: src, alt: "User avatar" }));
75
+ return (_jsxs("div", { children: [_jsx("img", { ...restProps, onError: this.handleError, onLoad: this.handleSuccess, className: classNames(classes, styles.avatarShadow), style: styleObj, src: src, alt: 'User avatar' }), _jsx("img", { ...restProps, "data-test": 'avatar', onError: this.handleError, onLoad: this.handleSuccess, className: classNames(styles.subavatar), style: styleObjGroup, src: subavatarSrc, alt: 'Subavatar' })] }));
79
76
  }
77
+ return (_jsx("img", { ...restProps, "data-test": 'avatar', onError: this.handleError, onLoad: this.handleSuccess, className: classNames(classes, styles.avatarShadow), style: styleObj, src: src, alt: 'User avatar' }));
80
78
  }
81
79
  }