@stack-spot/portal-layout 0.0.65 → 1.0.0-dev.1768482785050

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 (363) hide show
  1. package/CHANGELOG.md +779 -0
  2. package/dist/Layout.d.ts +60 -8
  3. package/dist/Layout.d.ts.map +1 -1
  4. package/dist/Layout.js +59 -24
  5. package/dist/Layout.js.map +1 -1
  6. package/dist/LayoutOverlayManager.d.ts +274 -19
  7. package/dist/LayoutOverlayManager.d.ts.map +1 -1
  8. package/dist/LayoutOverlayManager.js +373 -82
  9. package/dist/LayoutOverlayManager.js.map +1 -1
  10. package/dist/WelcomeTour.d.ts +2 -0
  11. package/dist/WelcomeTour.d.ts.map +1 -0
  12. package/dist/WelcomeTour.js +8 -0
  13. package/dist/WelcomeTour.js.map +1 -0
  14. package/dist/components/Backdrop.d.ts +75 -0
  15. package/dist/components/Backdrop.d.ts.map +1 -0
  16. package/dist/components/Backdrop.js +69 -0
  17. package/dist/components/Backdrop.js.map +1 -0
  18. package/dist/components/Contact/show-contact-modal.d.ts +5 -0
  19. package/dist/components/Contact/show-contact-modal.d.ts.map +1 -0
  20. package/dist/components/Contact/show-contact-modal.js +37 -0
  21. package/dist/components/Contact/show-contact-modal.js.map +1 -0
  22. package/dist/components/ContactModal.d.ts +1 -0
  23. package/dist/components/ContactModal.d.ts.map +1 -0
  24. package/dist/components/ContactModal.js +2 -0
  25. package/dist/components/ContactModal.js.map +1 -0
  26. package/dist/components/Dialog.d.ts +54 -7
  27. package/dist/components/Dialog.d.ts.map +1 -1
  28. package/dist/components/Dialog.js +8 -2
  29. package/dist/components/Dialog.js.map +1 -1
  30. package/dist/components/Header.d.ts +38 -2
  31. package/dist/components/Header.d.ts.map +1 -1
  32. package/dist/components/Header.js +9 -4
  33. package/dist/components/Header.js.map +1 -1
  34. package/dist/components/NotificationCenter/NotificationPanel.d.ts +3 -0
  35. package/dist/components/NotificationCenter/NotificationPanel.d.ts.map +1 -0
  36. package/dist/components/NotificationCenter/NotificationPanel.js +19 -0
  37. package/dist/components/NotificationCenter/NotificationPanel.js.map +1 -0
  38. package/dist/components/NotificationCenter/NotificationPanelHeader.d.ts +3 -0
  39. package/dist/components/NotificationCenter/NotificationPanelHeader.d.ts.map +1 -0
  40. package/dist/components/NotificationCenter/NotificationPanelHeader.js +16 -0
  41. package/dist/components/NotificationCenter/NotificationPanelHeader.js.map +1 -0
  42. package/dist/components/NotificationCenter/NotificationsPanelFooter.d.ts +4 -0
  43. package/dist/components/NotificationCenter/NotificationsPanelFooter.d.ts.map +1 -0
  44. package/dist/components/NotificationCenter/NotificationsPanelFooter.js +12 -0
  45. package/dist/components/NotificationCenter/NotificationsPanelFooter.js.map +1 -0
  46. package/dist/components/NotificationCenter/dictionary.d.ts +2 -0
  47. package/dist/components/NotificationCenter/dictionary.d.ts.map +1 -0
  48. package/dist/components/NotificationCenter/dictionary.js +43 -0
  49. package/dist/components/NotificationCenter/dictionary.js.map +1 -0
  50. package/dist/components/NotificationCenter/index.d.ts +2 -0
  51. package/dist/components/NotificationCenter/index.d.ts.map +1 -0
  52. package/dist/components/NotificationCenter/index.js +34 -0
  53. package/dist/components/NotificationCenter/index.js.map +1 -0
  54. package/dist/components/NotificationCenter/styled.d.ts +3 -0
  55. package/dist/components/NotificationCenter/styled.d.ts.map +1 -0
  56. package/dist/components/NotificationCenter/styled.js +74 -0
  57. package/dist/components/NotificationCenter/styled.js.map +1 -0
  58. package/dist/components/NotificationCenter/types.d.ts +21 -0
  59. package/dist/components/NotificationCenter/types.d.ts.map +1 -0
  60. package/dist/components/NotificationCenter/types.js.map +1 -0
  61. package/dist/components/NotificationCenter/utils.d.ts +5 -0
  62. package/dist/components/NotificationCenter/utils.d.ts.map +1 -0
  63. package/dist/components/NotificationCenter/utils.js +18 -0
  64. package/dist/components/NotificationCenter/utils.js.map +1 -0
  65. package/dist/components/OverlayContent.d.ts +27 -1
  66. package/dist/components/OverlayContent.d.ts.map +1 -1
  67. package/dist/components/OverlayContent.js +8 -4
  68. package/dist/components/OverlayContent.js.map +1 -1
  69. package/dist/components/PortalSwitcher.d.ts +19 -1
  70. package/dist/components/PortalSwitcher.d.ts.map +1 -1
  71. package/dist/components/PortalSwitcher.js +16 -31
  72. package/dist/components/PortalSwitcher.js.map +1 -1
  73. package/dist/components/PrivacyPolicyMessage/hooks.d.ts +10 -0
  74. package/dist/components/PrivacyPolicyMessage/hooks.d.ts.map +1 -0
  75. package/dist/components/PrivacyPolicyMessage/hooks.js +33 -0
  76. package/dist/components/PrivacyPolicyMessage/hooks.js.map +1 -0
  77. package/dist/components/PrivacyPolicyMessage/index.d.ts +7 -0
  78. package/dist/components/PrivacyPolicyMessage/index.d.ts.map +1 -0
  79. package/dist/components/PrivacyPolicyMessage/index.js +5 -0
  80. package/dist/components/PrivacyPolicyMessage/index.js.map +1 -0
  81. package/dist/components/Rate/FeedbackModal.d.ts +8 -0
  82. package/dist/components/Rate/FeedbackModal.d.ts.map +1 -0
  83. package/dist/components/Rate/FeedbackModal.js +52 -0
  84. package/dist/components/Rate/FeedbackModal.js.map +1 -0
  85. package/dist/components/Rate/hook.d.ts +3 -0
  86. package/dist/components/Rate/hook.d.ts.map +1 -0
  87. package/dist/components/Rate/hook.js +48 -0
  88. package/dist/components/Rate/hook.js.map +1 -0
  89. package/dist/components/Rate/index.d.ts +10 -0
  90. package/dist/components/Rate/index.d.ts.map +1 -0
  91. package/dist/components/Rate/index.js +16 -0
  92. package/dist/components/Rate/index.js.map +1 -0
  93. package/dist/components/Rate/on-nps-submit.d.ts +7 -0
  94. package/dist/components/Rate/on-nps-submit.d.ts.map +1 -0
  95. package/dist/components/Rate/on-nps-submit.js +8 -0
  96. package/dist/components/Rate/on-nps-submit.js.map +1 -0
  97. package/dist/components/Rate/show-rate-us-modals.d.ts +17 -0
  98. package/dist/components/Rate/show-rate-us-modals.d.ts.map +1 -0
  99. package/dist/components/Rate/show-rate-us-modals.js +14 -0
  100. package/dist/components/Rate/show-rate-us-modals.js.map +1 -0
  101. package/dist/components/Rate/utils.d.ts +2 -0
  102. package/dist/components/Rate/utils.d.ts.map +1 -0
  103. package/dist/components/Rate/utils.js +10 -0
  104. package/dist/components/Rate/utils.js.map +1 -0
  105. package/dist/components/Toaster.d.ts +35 -0
  106. package/dist/components/Toaster.d.ts.map +1 -1
  107. package/dist/components/Toaster.js +32 -4
  108. package/dist/components/Toaster.js.map +1 -1
  109. package/dist/components/TypeForm/hook.d.ts +2 -0
  110. package/dist/components/TypeForm/hook.d.ts.map +1 -0
  111. package/dist/components/TypeForm/hook.js +11 -0
  112. package/dist/components/TypeForm/hook.js.map +1 -0
  113. package/dist/components/TypeForm/index.d.ts +6 -0
  114. package/dist/components/TypeForm/index.d.ts.map +1 -0
  115. package/dist/components/TypeForm/index.js +23 -0
  116. package/dist/components/TypeForm/index.js.map +1 -0
  117. package/dist/components/TypeForm/show-typeform-modal.d.ts +5 -0
  118. package/dist/components/TypeForm/show-typeform-modal.d.ts.map +1 -0
  119. package/dist/components/TypeForm/show-typeform-modal.js +11 -0
  120. package/dist/components/TypeForm/show-typeform-modal.js.map +1 -0
  121. package/dist/components/TypeForm/utils.d.ts +2 -0
  122. package/dist/components/TypeForm/utils.d.ts.map +1 -0
  123. package/dist/components/TypeForm/utils.js +9 -0
  124. package/dist/components/TypeForm/utils.js.map +1 -0
  125. package/dist/components/UserMenu.d.ts +19 -2
  126. package/dist/components/UserMenu.d.ts.map +1 -1
  127. package/dist/components/UserMenu.js +12 -6
  128. package/dist/components/UserMenu.js.map +1 -1
  129. package/dist/components/error/ErrorBoundary.d.ts +25 -4
  130. package/dist/components/error/ErrorBoundary.d.ts.map +1 -1
  131. package/dist/components/error/ErrorBoundary.js +10 -1
  132. package/dist/components/error/ErrorBoundary.js.map +1 -1
  133. package/dist/components/error/ErrorManager.d.ts +22 -6
  134. package/dist/components/error/ErrorManager.d.ts.map +1 -1
  135. package/dist/components/error/ErrorManager.js +21 -1
  136. package/dist/components/error/ErrorManager.js.map +1 -1
  137. package/dist/components/error/SilentErrorBoundary.d.ts +26 -5
  138. package/dist/components/error/SilentErrorBoundary.d.ts.map +1 -1
  139. package/dist/components/error/SilentErrorBoundary.js +10 -0
  140. package/dist/components/error/SilentErrorBoundary.js.map +1 -1
  141. package/dist/components/menu/MenuContent.d.ts +20 -4
  142. package/dist/components/menu/MenuContent.d.ts.map +1 -1
  143. package/dist/components/menu/MenuContent.js +89 -88
  144. package/dist/components/menu/MenuContent.js.map +1 -1
  145. package/dist/components/menu/MenuSectionGroup.d.ts +2 -0
  146. package/dist/components/menu/MenuSectionGroup.d.ts.map +1 -0
  147. package/dist/components/menu/MenuSectionGroup.js +121 -0
  148. package/dist/components/menu/MenuSectionGroup.js.map +1 -0
  149. package/dist/components/menu/MenuSections.d.ts +17 -0
  150. package/dist/components/menu/MenuSections.d.ts.map +1 -1
  151. package/dist/components/menu/MenuSections.js +159 -39
  152. package/dist/components/menu/MenuSections.js.map +1 -1
  153. package/dist/components/menu/PageSelector.d.ts +5 -0
  154. package/dist/components/menu/PageSelector.d.ts.map +1 -1
  155. package/dist/components/menu/PageSelector.js +9 -4
  156. package/dist/components/menu/PageSelector.js.map +1 -1
  157. package/dist/components/menu/types.d.ts +219 -8
  158. package/dist/components/menu/types.d.ts.map +1 -1
  159. package/dist/components/tour/StepContainer.d.ts +37 -0
  160. package/dist/components/tour/StepContainer.d.ts.map +1 -0
  161. package/dist/components/tour/StepContainer.js +51 -0
  162. package/dist/components/tour/StepContainer.js.map +1 -0
  163. package/dist/components/tour/StepNavigation.d.ts +29 -0
  164. package/dist/components/tour/StepNavigation.d.ts.map +1 -0
  165. package/dist/components/tour/StepNavigation.js +37 -0
  166. package/dist/components/tour/StepNavigation.js.map +1 -0
  167. package/dist/components/tour/StepTitle.d.ts +17 -0
  168. package/dist/components/tour/StepTitle.d.ts.map +1 -0
  169. package/dist/components/tour/StepTitle.js +10 -0
  170. package/dist/components/tour/StepTitle.js.map +1 -0
  171. package/dist/components/tour/hook.d.ts +3 -0
  172. package/dist/components/tour/hook.d.ts.map +1 -0
  173. package/dist/components/tour/hook.js +10 -0
  174. package/dist/components/tour/hook.js.map +1 -0
  175. package/dist/components/tour/index.d.ts +5 -0
  176. package/dist/components/tour/index.d.ts.map +1 -0
  177. package/dist/components/tour/index.js +5 -0
  178. package/dist/components/tour/index.js.map +1 -0
  179. package/dist/components/tour/manager.d.ts +34 -0
  180. package/dist/components/tour/manager.d.ts.map +1 -0
  181. package/dist/components/tour/manager.js +104 -0
  182. package/dist/components/tour/manager.js.map +1 -0
  183. package/dist/components/tour/utils.d.ts +67 -0
  184. package/dist/components/tour/utils.d.ts.map +1 -0
  185. package/dist/components/tour/utils.js +60 -0
  186. package/dist/components/tour/utils.js.map +1 -0
  187. package/dist/components/user-menu-manager.d.ts +13 -0
  188. package/dist/components/user-menu-manager.d.ts.map +1 -0
  189. package/dist/components/user-menu-manager.js +36 -0
  190. package/dist/components/user-menu-manager.js.map +1 -0
  191. package/dist/dictionary.d.ts +6 -1
  192. package/dist/dictionary.d.ts.map +1 -1
  193. package/dist/dictionary.js +7 -2
  194. package/dist/dictionary.js.map +1 -1
  195. package/dist/elements.d.ts +7 -0
  196. package/dist/elements.d.ts.map +1 -1
  197. package/dist/elements.js +7 -0
  198. package/dist/elements.js.map +1 -1
  199. package/dist/index.d.ts +15 -8
  200. package/dist/index.d.ts.map +1 -1
  201. package/dist/index.js +15 -8
  202. package/dist/index.js.map +1 -1
  203. package/dist/layout.css +190 -35
  204. package/dist/svg/StarFillWithGradient.d.ts +6 -0
  205. package/dist/svg/StarFillWithGradient.d.ts.map +1 -0
  206. package/dist/svg/StarFillWithGradient.js +4 -0
  207. package/dist/svg/StarFillWithGradient.js.map +1 -0
  208. package/dist/toaster.d.ts +55 -9
  209. package/dist/toaster.d.ts.map +1 -1
  210. package/dist/toaster.js +34 -6
  211. package/dist/toaster.js.map +1 -1
  212. package/dist/types.d.ts +5 -0
  213. package/dist/types.d.ts.map +1 -0
  214. package/dist/types.js +2 -0
  215. package/dist/types.js.map +1 -0
  216. package/dist/utils.d.ts +6 -69
  217. package/dist/utils.d.ts.map +1 -1
  218. package/dist/utils.js +9 -130
  219. package/dist/utils.js.map +1 -1
  220. package/package.dev.json +3 -0
  221. package/package.json +24 -13
  222. package/package.stg.json +3 -0
  223. package/readme.md +147 -0
  224. package/src/Layout.tsx +166 -58
  225. package/src/LayoutOverlayManager.tsx +499 -85
  226. package/src/WelcomeTour.tsx +8 -0
  227. package/src/components/Backdrop.tsx +116 -0
  228. package/src/components/Contact/show-contact-modal.tsx +71 -0
  229. package/src/components/Dialog.tsx +58 -9
  230. package/src/components/Header.tsx +53 -5
  231. package/src/components/NotificationCenter/NotificationPanel.tsx +40 -0
  232. package/src/components/NotificationCenter/NotificationPanelHeader.tsx +53 -0
  233. package/src/components/NotificationCenter/NotificationsPanelFooter.tsx +25 -0
  234. package/src/components/NotificationCenter/dictionary.ts +44 -0
  235. package/src/components/NotificationCenter/index.tsx +58 -0
  236. package/src/components/NotificationCenter/styled.ts +75 -0
  237. package/src/components/NotificationCenter/types.ts +24 -0
  238. package/src/components/NotificationCenter/utils.ts +20 -0
  239. package/src/components/OverlayContent.tsx +40 -5
  240. package/src/components/PortalSwitcher.tsx +33 -39
  241. package/src/components/PrivacyPolicyMessage/hooks.tsx +49 -0
  242. package/src/components/PrivacyPolicyMessage/index.tsx +21 -0
  243. package/src/components/Rate/FeedbackModal.tsx +86 -0
  244. package/src/components/Rate/hook.tsx +61 -0
  245. package/src/components/Rate/index.tsx +36 -0
  246. package/src/components/Rate/on-nps-submit.ts +18 -0
  247. package/src/components/Rate/show-rate-us-modals.tsx +29 -0
  248. package/src/components/Rate/utils.ts +11 -0
  249. package/src/components/Toaster.tsx +82 -3
  250. package/src/components/TypeForm/hook.tsx +13 -0
  251. package/src/components/TypeForm/index.tsx +50 -0
  252. package/src/components/TypeForm/show-typeform-modal.tsx +10 -0
  253. package/src/components/TypeForm/utils.ts +8 -0
  254. package/src/components/UserMenu.tsx +32 -8
  255. package/src/components/error/ErrorBoundary.tsx +11 -2
  256. package/src/components/error/ErrorManager.ts +22 -6
  257. package/src/components/error/SilentErrorBoundary.tsx +12 -2
  258. package/src/components/menu/MenuContent.tsx +102 -110
  259. package/src/components/menu/MenuSectionGroup.tsx +121 -0
  260. package/src/components/menu/MenuSections.tsx +342 -93
  261. package/src/components/menu/PageSelector.tsx +16 -4
  262. package/src/components/menu/types.ts +221 -9
  263. package/src/components/tour/StepContainer.tsx +92 -0
  264. package/src/components/tour/StepNavigation.tsx +72 -0
  265. package/src/components/tour/StepTitle.tsx +28 -0
  266. package/src/components/tour/hook.ts +12 -0
  267. package/src/components/tour/index.ts +6 -0
  268. package/src/components/tour/manager.tsx +119 -0
  269. package/src/components/tour/utils.tsx +119 -0
  270. package/src/components/user-menu-manager.ts +31 -0
  271. package/src/dictionary.ts +7 -2
  272. package/src/elements.ts +7 -0
  273. package/src/index.ts +15 -8
  274. package/src/layout.css +190 -35
  275. package/src/svg/StarFillWithGradient.tsx +14 -0
  276. package/src/toaster.tsx +90 -13
  277. package/src/types.ts +4 -0
  278. package/src/utils.ts +9 -142
  279. package/dist/components/BottomNotification.d.ts +0 -1
  280. package/dist/components/BottomNotification.d.ts.map +0 -1
  281. package/dist/components/BottomNotification.js +0 -2
  282. package/dist/components/BottomNotification.js.map +0 -1
  283. package/dist/components/BottomPanel.d.ts +0 -1
  284. package/dist/components/BottomPanel.d.ts.map +0 -1
  285. package/dist/components/BottomPanel.js +0 -2
  286. package/dist/components/BottomPanel.js.map +0 -1
  287. package/dist/components/SelectionList.d.ts +0 -36
  288. package/dist/components/SelectionList.d.ts.map +0 -1
  289. package/dist/components/SelectionList.js +0 -140
  290. package/dist/components/SelectionList.js.map +0 -1
  291. package/dist/components/error/ErrorFeedback.d.ts +0 -3
  292. package/dist/components/error/ErrorFeedback.d.ts.map +0 -1
  293. package/dist/components/error/ErrorFeedback.js +0 -66
  294. package/dist/components/error/ErrorFeedback.js.map +0 -1
  295. package/dist/components/menu/use-check-text-overflow.d.ts +0 -6
  296. package/dist/components/menu/use-check-text-overflow.d.ts.map +0 -1
  297. package/dist/components/menu/use-check-text-overflow.js +0 -20
  298. package/dist/components/menu/use-check-text-overflow.js.map +0 -1
  299. package/dist/components/menu/use-keyboard-controls.d.ts +0 -23
  300. package/dist/components/menu/use-keyboard-controls.d.ts.map +0 -1
  301. package/dist/components/menu/use-keyboard-controls.js +0 -49
  302. package/dist/components/menu/use-keyboard-controls.js.map +0 -1
  303. package/dist/components/tour/PortalSwitcherStep.d.ts +0 -3
  304. package/dist/components/tour/PortalSwitcherStep.d.ts.map +0 -1
  305. package/dist/components/tour/PortalSwitcherStep.js +0 -29
  306. package/dist/components/tour/PortalSwitcherStep.js.map +0 -1
  307. package/dist/components/types.d.ts +0 -15
  308. package/dist/components/types.d.ts.map +0 -1
  309. package/dist/components/types.js.map +0 -1
  310. package/dist/layout-context.d.ts +0 -10
  311. package/dist/layout-context.d.ts.map +0 -1
  312. package/dist/layout-context.js +0 -11
  313. package/dist/layout-context.js.map +0 -1
  314. package/dist/svg/AI.d.ts +0 -6
  315. package/dist/svg/AI.d.ts.map +0 -1
  316. package/dist/svg/AI.js +0 -9
  317. package/dist/svg/AI.js.map +0 -1
  318. package/dist/svg/EDP.d.ts +0 -6
  319. package/dist/svg/EDP.d.ts.map +0 -1
  320. package/dist/svg/EDP.js +0 -5
  321. package/dist/svg/EDP.js.map +0 -1
  322. package/dist/svg/Forbidden.d.ts +0 -6
  323. package/dist/svg/Forbidden.d.ts.map +0 -1
  324. package/dist/svg/Forbidden.js +0 -4
  325. package/dist/svg/Forbidden.js.map +0 -1
  326. package/dist/svg/HUB.d.ts +0 -6
  327. package/dist/svg/HUB.d.ts.map +0 -1
  328. package/dist/svg/HUB.js +0 -5
  329. package/dist/svg/HUB.js.map +0 -1
  330. package/dist/svg/Logo.d.ts +0 -2
  331. package/dist/svg/Logo.d.ts.map +0 -1
  332. package/dist/svg/Logo.js +0 -4
  333. package/dist/svg/Logo.js.map +0 -1
  334. package/dist/svg/NotFound.d.ts +0 -6
  335. package/dist/svg/NotFound.d.ts.map +0 -1
  336. package/dist/svg/NotFound.js +0 -4
  337. package/dist/svg/NotFound.js.map +0 -1
  338. package/dist/svg/ServerError.d.ts +0 -6
  339. package/dist/svg/ServerError.d.ts.map +0 -1
  340. package/dist/svg/ServerError.js +0 -4
  341. package/dist/svg/ServerError.js.map +0 -1
  342. package/dist/svg/Unauthenticated.d.ts +0 -6
  343. package/dist/svg/Unauthenticated.d.ts.map +0 -1
  344. package/dist/svg/Unauthenticated.js +0 -4
  345. package/dist/svg/Unauthenticated.js.map +0 -1
  346. package/src/components/BottomPanel.tsx +0 -0
  347. package/src/components/SelectionList.tsx +0 -272
  348. package/src/components/error/ErrorFeedback.tsx +0 -114
  349. package/src/components/menu/use-check-text-overflow.tsx +0 -26
  350. package/src/components/menu/use-keyboard-controls.tsx +0 -70
  351. package/src/components/tour/PortalSwitcherStep.tsx +0 -36
  352. package/src/components/types.ts +0 -15
  353. package/src/layout-context.tsx +0 -22
  354. package/src/svg/AI.tsx +0 -37
  355. package/src/svg/EDP.tsx +0 -35
  356. package/src/svg/Forbidden.tsx +0 -22
  357. package/src/svg/HUB.tsx +0 -35
  358. package/src/svg/Logo.tsx +0 -35
  359. package/src/svg/NotFound.tsx +0 -16
  360. package/src/svg/ServerError.tsx +0 -33
  361. package/src/svg/Unauthenticated.tsx +0 -16
  362. /package/dist/components/{types.js → NotificationCenter/types.js} +0 -0
  363. /package/src/components/{BottomNotification.tsx → ContactModal.tsx} +0 -0
package/dist/layout.css CHANGED
@@ -27,7 +27,7 @@ body {
27
27
  display: flex;
28
28
  flex-direction: column;
29
29
  flex: 1;
30
- background: var(--light-400);
30
+ background: var(--light-300);
31
31
  font: var(--font);
32
32
  color: var(--light-contrastText);
33
33
  }
@@ -98,7 +98,12 @@ body {
98
98
  left: calc(var(--menu-sections-width) + var(--menu-content-width));
99
99
  }
100
100
 
101
- #layout.no-menu-sections:not(.menu-content-visible) #page {
101
+ #layout.menu-inner-content-visible #page {
102
+ left: calc(var(--menu-sections-width) + calc(var(--menu-content-width) * 2));
103
+ }
104
+
105
+ #layout.no-menu-sections:not(.menu-content-visible) #page,
106
+ #layout.no-menu-sections:not(.menu-inner-content-visible) #page {
102
107
  border-top-left-radius: 0;
103
108
  }
104
109
 
@@ -119,16 +124,12 @@ body {
119
124
  bottom: 0;
120
125
  }
121
126
 
122
- #menu svg {
123
- fill: var(--light-contrastText);
124
- }
125
-
126
127
  #menu .item-row-group svg {
127
128
  fill: var(--light-700);
128
129
  }
129
130
 
130
- #menu .toggle .expand {
131
- fill: var(--primary-500);
131
+ #menu .hidden-scroll-bars {
132
+ height: 100%;
132
133
  }
133
134
 
134
135
  #menu .toggle .expand,
@@ -155,42 +156,132 @@ body {
155
156
  display: none;
156
157
  }
157
158
 
159
+ #layout.menu-compact .section-badge {
160
+ display: none;
161
+ }
162
+
163
+ #layout.menu-compact .section-icon-with-badge {
164
+ display: block;
165
+ }
166
+
167
+ #layout.menu-compact .custom-element {
168
+ display: none;
169
+ }
170
+
171
+ #layout.menu-compact .custom-element-icon {
172
+ display: block;
173
+ }
174
+
175
+ #layout:not(.menu-compact) > .react-tooltip {
176
+ display: none;
177
+ }
178
+
158
179
  #layout:not(.menu-compact) .section-label {
159
180
  display: block;
160
181
  }
161
182
 
183
+ #layout:not(.menu-compact) .section-badge {
184
+ display: block;
185
+ }
186
+
187
+ #layout:not(.menu-compact) .section-icon-with-badge {
188
+ display: none;
189
+ }
190
+
191
+ #layout:not(.menu-compact) .custom-element-icon {
192
+ display: block;
193
+ }
194
+
195
+ #layout:not(.menu-compact) .custom-element-icon {
196
+ display: none;
197
+ }
198
+
199
+
162
200
  #menuSections {
163
201
  width: var(--menu-sections-width);
164
202
  display: flex;
165
203
  flex-direction: column;
166
- padding: 0 0 10px;
204
+ padding: 0;
167
205
  justify-content: space-between;
168
206
  background-color: var(--light-400);
169
207
  position: relative;
170
208
  border-right: 1px solid var(--light-300);
171
209
  border-top: 1px solid var(--light-300);
210
+ min-height: 100%;
211
+ box-sizing: border-box;
172
212
  }
173
213
 
174
214
  #menuSections .sections-footer {
175
215
  padding: 16px;
216
+ padding-left: 8px;
176
217
  }
177
218
 
178
219
  #menuSections .toggle,
179
220
  #menuSections > ul li a {
180
221
  background: transparent;
181
222
  border: none;
182
- outline: none;
183
223
  width: var(--menu-sections-width);
184
- height: var(--menu-item-height);
185
224
  display: flex;
186
225
  flex-direction: column;
187
226
  gap: 10px;
188
227
  align-items: flex-start;
189
228
  justify-content: center;
190
- transition: background-color 0.2s;
191
229
  cursor: pointer;
192
230
  position: relative;
193
231
  z-index: 2;
232
+ border-right: 1px solid var(--light-300);
233
+ }
234
+
235
+ #menuSections .toggle.sections-footer {
236
+ height: auto;
237
+ }
238
+
239
+ .gradient-svg {
240
+ width: 100px;
241
+ height: 100px;
242
+ }
243
+
244
+ .gradient-svg path {
245
+ fill: url(#gradient);
246
+ }
247
+
248
+ #menuSections .toggle .gradient {
249
+ background: linear-gradient(to right, #FF9900, #FF6633);
250
+ -webkit-background-clip: text;
251
+ background-clip: text;
252
+ -webkit-text-fill-color: transparent;
253
+ font-weight: 500;
254
+ line-height: 16px;
255
+ }
256
+
257
+ @keyframes rotate {
258
+ from {
259
+ transform: rotate(0deg);
260
+ }
261
+ to {
262
+ transform: rotate(360deg);
263
+ }
264
+ }
265
+
266
+ .rotate-icon {
267
+ animation: rotate 2s linear forwards;
268
+ animation-delay: 2s;
269
+ }
270
+
271
+ @keyframes growShrink {
272
+ 0% {
273
+ transform: scale(1);
274
+ }
275
+ 50% {
276
+ transform: scale(1.2);
277
+ }
278
+ 100% {
279
+ transform: scale(1);
280
+ }
281
+ }
282
+
283
+ .grow-shrink {
284
+ animation: growShrink 2s ease-in-out forwards;
194
285
  }
195
286
 
196
287
  #menuSections > ul li a:before {
@@ -205,7 +296,6 @@ body {
205
296
 
206
297
  #menuSections > ul li.active a {
207
298
  background-color: var(--light-500);
208
- border-right: 1px solid var(--light-300);
209
299
  }
210
300
 
211
301
  #menuSections > ul li.active a:before {
@@ -214,11 +304,9 @@ body {
214
304
  }
215
305
 
216
306
  #menuSections .toggle:hover,
217
- #menuSections > ul li a:hover,
218
- #menuSections .toggle:focus,
219
- #menuSections > ul li a:focus {
307
+ #menuSections > ul li a:hover
308
+ {
220
309
  background: var(--light-500);
221
- border-right: 1px solid var(--light-300);
222
310
  }
223
311
 
224
312
  #menuSections > ul li:not(.active) a:hover:before {
@@ -230,6 +318,33 @@ body {
230
318
  position: relative;
231
319
  }
232
320
 
321
+ #layout.menu-compact #menuSections {
322
+ .section-icon {
323
+ display: flex;
324
+ justify-content: center;
325
+ flex: 1;
326
+ }
327
+ .section-text {
328
+ display: none;
329
+ }
330
+ .chevron-icon-box {
331
+ display: none;
332
+ }
333
+ .item-row.hidden-when-collapsed {
334
+ display: none;
335
+ & + ul {
336
+ visibility: visible;
337
+ li a {
338
+ height: 56px;
339
+ }
340
+ }
341
+ }
342
+ .sections-footer {
343
+ padding: 16px 0;
344
+ align-items: center;
345
+ }
346
+ }
347
+
233
348
  #menuContentOverlay {
234
349
  width: var(--menu-overlay-width);
235
350
  position: fixed;
@@ -245,6 +360,7 @@ body {
245
360
  pointer-events: none;
246
361
  z-index: 1;
247
362
  transition: opacity 0.3s;
363
+ overflow-y: auto;
248
364
  }
249
365
 
250
366
  #menuContentOverlay.visible {
@@ -252,12 +368,8 @@ body {
252
368
  pointer-events: auto;
253
369
  }
254
370
 
255
- #menuContentOverlay > div {
256
- flex: 1;
257
- overflow: auto;
258
- }
259
-
260
- #menuContent {
371
+ #menuContent,
372
+ #menuInnerContent {
261
373
  width: var(--menu-content-width);
262
374
  transition: left ease-out var(--menu-animation-duration);
263
375
  background-color: var(--light-400);
@@ -269,6 +381,21 @@ body {
269
381
  border-top: 1px solid var(--light-300);
270
382
  }
271
383
 
384
+ #menuInnerContent {
385
+ left: var(--menu-content-width);
386
+ border-left: 1px solid var(--light-300);
387
+ }
388
+
389
+ #menuContent .goBackLink,
390
+ #menuInnerContent .goBackLink {
391
+ display: flex;
392
+ flex-direction: row;
393
+ align-items: center;
394
+ margin: 20px;
395
+ margin-bottom: 16px;
396
+ gap: 6px;
397
+ }
398
+
272
399
  #layout.menu-content-visible #menuContent {
273
400
  left: var(--menu-sections-width);
274
401
  }
@@ -297,7 +424,7 @@ body {
297
424
  pointer-events: auto;
298
425
  }
299
426
 
300
- #modal {
427
+ #modal, #backdrop .modal-box {
301
428
  transform: scale(0);
302
429
  display: flex;
303
430
  flex-direction: column;
@@ -305,27 +432,32 @@ body {
305
432
  width: calc(100% - 60px);
306
433
  }
307
434
 
308
- #modal.fit-content {
435
+ #modal.fit-content, #backdrop .modal-box.fit-content {
309
436
  width: auto;
310
437
  }
311
438
 
312
- #modal.large {
439
+ #modal.full, #backdrop .modal-box.full {
440
+ width: 100%;
441
+ height: 100%;
442
+ }
443
+
444
+ #modal.large, #backdrop .modal-box.large {
313
445
  max-width: 1000px;
314
446
  }
315
447
 
316
- #modal.medium {
448
+ #modal.medium, #backdrop .modal-box.medium {
317
449
  max-width: 800px;
318
450
  }
319
451
 
320
- #modal.small {
452
+ #modal.small, #backdrop .modal-box.small {
321
453
  max-width: 600px;
322
454
  }
323
455
 
324
- #modal.visible {
456
+ #modal.visible, #backdrop.visible .modal-box {
325
457
  transform: scale(1);
326
458
  }
327
459
 
328
- #rightPanel {
460
+ #rightPanel, #backdrop .right-panel-box {
329
461
  position: fixed;
330
462
  display: flex;
331
463
  flex-direction: column;
@@ -338,25 +470,45 @@ body {
338
470
  border-bottom-left-radius: 1rem;
339
471
  }
340
472
 
341
- #rightPanel.small {
473
+ #rightPanel.small, #backdrop .right-panel-box.small {
342
474
  right: -400px;
343
475
  width: 400px;
344
476
  }
345
477
 
346
- #rightPanel.medium {
478
+ #rightPanel.medium, #backdrop .right-panel-box.medium {
347
479
  right: -600px;
348
480
  width: 600px;
349
481
  }
350
482
 
351
- #rightPanel.large {
483
+ #rightPanel.large, #backdrop .right-panel-box.large {
352
484
  right: -800px;
353
485
  width: 800px;
354
486
  }
355
487
 
356
- #rightPanel.visible {
488
+ #rightPanel.extra-large, #backdrop .right-panel-box.extra-large {
489
+ right: -800px;
490
+ width: 70%;
491
+ }
492
+
493
+ #rightPanel.visible, #backdrop.visible .right-panel-box {
357
494
  right: 0;
358
495
  }
359
496
 
497
+ #modal .modal-instance,
498
+ #rightPanel .right-panel-instance {
499
+ flex-direction: column;
500
+ flex: 1;
501
+ overflow: hidden;
502
+ display: none;
503
+ &.active {
504
+ display: flex;
505
+ }
506
+ &.disabled {
507
+ pointer-events: none;
508
+ opacity: 0.7;
509
+ }
510
+ }
511
+
360
512
  #bottomPanel {
361
513
  position: fixed;
362
514
  display: flex;
@@ -398,8 +550,11 @@ body {
398
550
  }
399
551
 
400
552
  /* Overlay: toaster */
553
+ .container-toaster {
554
+ margin-top: var(--header-height);
555
+ }
401
556
 
402
- .main-toaster h1 {
557
+ .main-toaster h2 {
403
558
  font-size: 14px;
404
559
  font-weight: 500;
405
560
  margin: 0 0 8px 0;
@@ -0,0 +1,6 @@
1
+ export declare const StarFillWithGradient: ({ className, id, style }: {
2
+ className?: string;
3
+ id?: string;
4
+ style?: React.CSSProperties;
5
+ }) => import("react/jsx-runtime").JSX.Element;
6
+ //# sourceMappingURL=StarFillWithGradient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StarFillWithGradient.d.ts","sourceRoot":"","sources":["../../src/svg/StarFillWithGradient.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,oBAAoB,GAAI,0BAA0B;IAAE,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;CAAE,4CAU9H,CAAA"}
@@ -0,0 +1,4 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /* eslint-disable max-len */
3
+ export const StarFillWithGradient = ({ className, id, style }) => (_jsxs("svg", { viewBox: "0 0 512 512", className: className, id: id, style: style, width: "16", height: "16", xmlns: "http://www.w3.org/2000/svg", children: [_jsx("defs", { children: _jsxs("linearGradient", { id: "gradient", x1: "0%", y1: "0%", x2: "100%", y2: "100%", children: [_jsx("stop", { offset: "0%", style: { 'stopColor': '#FF9900', 'stopOpacity': 1 } }), _jsx("stop", { offset: "100%", style: { 'stopColor': '#FF6633', 'stopOpacity': 1 } })] }) }), _jsx("path", { d: "M226.885 21.9523C231.432 9.88404 242.98 1.91992 255.85 1.91992C268.719 1.91992 280.268 9.88408 284.814 21.9523C284.863 22.0812 284.91 22.2105 284.956 22.3403L335.667 165.876L478.048 165.876H478.049C490.986 165.876 502.581 173.922 507.079 186.08C511.579 198.245 508.006 211.912 498.152 220.324C498.075 220.39 497.997 220.456 497.918 220.521L377.676 320.039L428.087 471.216L428.091 471.226C432.349 484.019 427.824 498.078 416.935 505.998C406.055 513.912 391.305 513.892 380.445 505.949L380.435 505.941L255.825 414.67L131.151 505.944L131.075 506C131.045 506.021 131.016 506.042 130.987 506.063C120.124 513.848 105.488 513.783 94.6943 505.902C83.8927 498.015 79.374 484.073 83.5272 471.34C83.5408 471.299 83.5545 471.257 83.5683 471.216L133.979 320.041L13.7166 220.522C13.6378 220.457 13.5595 220.391 13.4817 220.324C3.62771 211.912 0.054518 198.245 4.55486 186.08C9.05287 173.922 20.6475 165.876 33.5842 165.876H33.5857L175.992 165.876L226.745 22.3356C226.791 22.2074 226.837 22.0796 226.885 21.9523Z" })] }));
4
+ //# sourceMappingURL=StarFillWithGradient.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StarFillWithGradient.js","sourceRoot":"","sources":["../../src/svg/StarFillWithGradient.tsx"],"names":[],"mappings":";AAAA,4BAA4B;AAE5B,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE,KAAK,EAAoE,EAAE,EAAE,CAAC,CAClI,eAAK,OAAO,EAAC,aAAa,EAAE,SAAS,EAAE,SAAS,EAAE,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAG,KAAK,EAAC,4BAA4B,aACjI,yBACE,0BAAgB,EAAE,EAAC,UAAU,EAAC,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,MAAM,EAAC,EAAE,EAAC,MAAM,aAC/D,eAAM,MAAM,EAAC,IAAI,EAAC,KAAK,EAAE,EAAE,WAAW,EAAC,SAAS,EAAE,aAAa,EAAE,CAAC,EAAE,GAAG,EACvE,eAAM,MAAM,EAAC,MAAM,EAAC,KAAK,EAAE,EAAE,WAAW,EAAC,SAAS,EAAE,aAAa,EAAE,CAAC,EAAE,GAAG,IAC1D,GACZ,EACP,eAAM,CAAC,EAAC,u+BAAu+B,GAAG,IAC9+B,CACP,CAAA"}
package/dist/toaster.d.ts CHANGED
@@ -1,23 +1,69 @@
1
- /// <reference types="react" />
2
1
  import 'react-toastify/dist/ReactToastify.css';
2
+ import { ToasterAction } from './components/Toaster.js';
3
3
  type ToastType = 'error' | 'success' | 'warning' | 'info';
4
- interface BaseProps {
4
+ interface BaseOptions {
5
+ /**
6
+ * An identifier for the toaster, if not provided, `Math.random()` will be used.
7
+ *
8
+ * The id can be used to programmatically control the toaster.
9
+ */
10
+ id?: number | string;
11
+ /**
12
+ * The message to show.
13
+ * Can be either a string or a React element.
14
+ */
15
+ message: React.ReactNode;
16
+ /**
17
+ * Level/severity of this message.
18
+ * @default 'info'
19
+ */
5
20
  type?: ToastType;
6
21
  /**
7
22
  * Seconds until auto-close or false to not auto-close.
8
- * @default 3 for success toast and 10 for the others
23
+ * @default 3s for success toast and 10s for the others
9
24
  */
10
25
  autoClose?: number | false;
26
+ /**
27
+ * If true, `message` must be a React Element and none of the default toaster UI is rendered (title, icon and close button).
28
+ * @default false
29
+ */
30
+ custom?: boolean;
31
+ /**
32
+ * Whether or not to close the toaster when the user clicks it.
33
+ * @default false
34
+ */
35
+ closeOnClick?: boolean;
11
36
  }
12
- interface BasicMessageProps extends BaseProps {
13
- message: string;
37
+ export interface DefaultToasterOptions extends BaseOptions {
38
+ /**
39
+ * The title of the toaster.
40
+ */
14
41
  title?: string;
42
+ /**
43
+ * A function to call when the user clicks the toaster. By default, it closes the toaster.
44
+ */
15
45
  onClick?: () => void;
46
+ /**
47
+ * A set of buttons (or links/anchors) to show after the message.
48
+ */
49
+ actions?: ToasterAction[];
50
+ custom?: false;
16
51
  }
17
- interface RichMessageProps extends BaseProps {
18
- content: React.ReactElement;
52
+ export interface CustomToasterOptions extends BaseOptions {
53
+ /**
54
+ * The whole content to render inside the toaster.
55
+ */
56
+ message: React.ReactElement;
57
+ custom: true;
58
+ /**
59
+ * A close button to render on the top right corner of the toaster. If not provided, a close button won't be rendered.
60
+ */
61
+ closeButton?: React.ReactElement;
19
62
  }
20
- type Props = BasicMessageProps | RichMessageProps;
21
- export declare function showToaster({ type, autoClose, ...props }: Props): void;
63
+ export type ToasterOptions = DefaultToasterOptions | CustomToasterOptions | React.ReactNode;
64
+ export declare function showToaster(defaultToasterConfig: DefaultToasterOptions): number | string;
65
+ export declare function showToaster(customToasterConfig: CustomToasterOptions): number | string;
66
+ export declare function showToaster(message: React.ReactNode): number | string;
67
+ export declare function closeReactToaster(id: number | string): void;
22
68
  export {};
23
69
  //# sourceMappingURL=toaster.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"toaster.d.ts","sourceRoot":"","sources":["../src/toaster.tsx"],"names":[],"mappings":";AAGA,OAAO,uCAAuC,CAAA;AAE9C,KAAK,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,CAAA;AAEzD,UAAU,SAAS;IACjB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;CAC5B;A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;IACvD;;OAEG;IACH,OAAO,EAAE,KAAK,CAAC,YAAY,CAAC;IAC5B,MAAM,EAAE,IAAI,CAAC;IACb;;OAEG;IACH,WAAW,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;CAClC;AAED,MAAM,MAAM,cAAc,GAAG,qBAAqB,GAAG,oBAAoB,GAAG,KAAK,CAAC,SAAS,CAAA;AAyB3F,wBAAgB,WAAW,CAAC,oBAAoB,EAAE,qBAAqB,GAAG,MAAM,GAAG,MAAM,CAAA;AACzF,wBAAgB,WAAW,CAAC,mBAAmB,EAAE,oBAAoB,GAAG,MAAM,GAAG,MAAM,CAAA;AACvF,wBAAgB,WAAW,CAAC,OAAO,EAAE,KAAK,CAAC,SAAS,GAAG,MAAM,GAAG,MAAM,CAAA;AAqCtE,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,QAEpD"}
package/dist/toaster.js CHANGED
@@ -1,8 +1,10 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { IconBox } from '@citric/core';
3
3
  import { CheckCircleFill, ExclamationCircleFill, ExclamationTriangleFill, InfoCircleFill } from '@citric/icons';
4
+ import { translate } from '@stack-spot/portal-translate';
4
5
  import { toast } from 'react-toastify';
5
6
  import 'react-toastify/dist/ReactToastify.css';
7
+ import { ToasterContent } from './components/Toaster.js';
6
8
  const toasterConfig = {
7
9
  error: {
8
10
  element: _jsx(ExclamationCircleFill, {}),
@@ -25,22 +27,48 @@ const toasterConfig = {
25
27
  duration: 10,
26
28
  },
27
29
  };
28
- export function showToaster({ type = 'info', autoClose, ...props }) {
30
+ export function showToaster(options) {
31
+ const isToasterConfig = options && typeof options === 'object' && 'message' in options;
32
+ const { type = 'info', autoClose, ...opts } = isToasterConfig
33
+ ? options
34
+ : { message: options };
29
35
  const config = toasterConfig[type];
36
+ const id = opts.id ?? Math.random();
30
37
  const closeTime = autoClose ? autoClose : config.duration;
31
38
  const bg = `var(--${config.color}-500)`;
32
39
  const bgDark = `var(--${config.color}-600)`;
33
40
  const fg = `var(--${config.color}-contrastText)`;
34
- toast('message' in props
35
- ? _jsxs("div", { onClick: props.onClick, children: [_jsx("h1", { style: { textTransform: 'capitalize' }, children: props.title ?? type }), _jsx("p", { children: props.message })] })
36
- : props.content, {
41
+ toast(opts.custom
42
+ ? opts.message
43
+ : _jsx(ToasterContent, { ...opts, id: id, title: opts.title ?? translate(dictionary)[type] }), {
44
+ toastId: id,
37
45
  type,
38
46
  autoClose: autoClose === false ? false : closeTime * 1000,
39
47
  className: 'main-toaster',
40
48
  style: { backgroundColor: bg, color: fg },
41
49
  progressStyle: { background: bgDark },
42
50
  bodyClassName: 'toast-body',
43
- icon: 'message' in props ? () => (_jsx(IconBox, { colorIcon: `${config.color}.contrastText`, size: "xs", children: config.element })) : undefined,
51
+ icon: opts.custom ? false : () => (_jsx(IconBox, { colorIcon: `${config.color}.contrastText`, size: "xs", children: config.element })),
52
+ closeOnClick: opts.closeOnClick ?? false,
53
+ closeButton: opts.custom ? (opts.closeButton ?? false) : undefined,
44
54
  });
55
+ return id;
45
56
  }
57
+ export function closeReactToaster(id) {
58
+ toast.dismiss(id);
59
+ }
60
+ const dictionary = {
61
+ en: {
62
+ success: 'Success',
63
+ error: 'Error',
64
+ info: 'Info',
65
+ warning: 'Warning',
66
+ },
67
+ pt: {
68
+ success: 'Sucesso',
69
+ error: 'Erro',
70
+ info: 'Info',
71
+ warning: 'Atenção',
72
+ },
73
+ };
46
74
  //# sourceMappingURL=toaster.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"toaster.js","sourceRoot":"","sources":["../src/toaster.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAiC,MAAM,cAAc,CAAA;AACrE,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAC/G,OAAO,EAAE,KAAK,EAAE,M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QACzB,KAAK,EAAE,EAAE,eAAe,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE;QACzC,aAAa,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE;QACrC,aAAa,EAAE,YAAY;QAC3B,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAChC,KAAC,OAAO,IAAC,SAAS,EAAE,GAAG,MAAM,CAAC,KAAK,eAAgD,EAAE,IAAI,EAAC,IAAI,YAC3F,MAAM,CAAC,OAAO,GACP,CACX;QACD,YAAY,EAAE,IAAI,CAAC,YAAY,IAAI,KAAK;QACxC,WAAW,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS;KACnE,CACF,CAAA;IACD,OAAO,EAAE,CAAA;AACX,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,EAAmB;IACnD,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;AACnB,CAAC;AAED,MAAM,UAAU,GAAG;IACjB,EAAE,EAAE;QACF,OAAO,EAAE,SAAS;QAClB,KAAK,EAAE,OAAO;QACd,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,SAAS;KACnB;IACD,EAAE,EAAE;QACF,OAAO,EAAE,SAAS;QAClB,KAAK,EAAE,MAAM;QACb,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,SAAS;KACnB;CACmB,CAAA"}
@@ -0,0 +1,5 @@
1
+ export type PortalAcronym = 'EDP' | 'AI' | 'HUB' | 'CS' | 'ACCOUNT';
2
+ export type RightPanelSize = 'small' | 'medium' | 'large' | 'extra-large';
3
+ export type ModalSize = RightPanelSize | 'fit-content';
4
+ export type CustomModalSize = ModalSize | 'full';
5
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,IAAI,GAAG,KAAK,GAAG,IAAI,GAAG,SAAS,CAAA;AACnE,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,aAAa,CAAA;AACzE,MAAM,MAAM,SAAS,GAAG,cAAc,GAAG,aAAa,CAAA;AACtD,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,MAAM,CAAA"}
package/dist/types.js ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
package/dist/utils.d.ts CHANGED
@@ -1,80 +1,17 @@
1
- export declare function valueOfLayoutVar(varname: string): string;
2
- /**
3
- * Important for accessibility.
4
- *
5
- * Makes it so we focus the next focusable element in the DOM hierarchy, disregarding the element passed as parameter and its children.
6
- *
7
- * If there's no next focusable element, the first focusable of the page will be focused. If the page doesn't contain any focusable
8
- * element, nothing happens.
9
- *
10
- * @param current the reference element to focus the next. If not provided, will be the currently active element.
11
- */
12
- export declare function focusNextIgnoringChildren(current?: HTMLElement | null): void;
13
- type TagPriority = 'a' | 'button' | 'input' | 'textarea' | 'select' | 'other';
14
- type TagPriorityElement = TagPriority | TagPriority[];
15
- interface FocusOptions {
16
- /**
17
- * Instead of focusing the first element overall, focus the first according to this list of priorities.
18
- */
19
- priority?: TagPriorityElement[];
20
- /**
21
- * Ignores any element that matches this query selector.
22
- */
23
- ignore?: string;
24
- }
25
- /**
26
- * Checks if an element can receive focus.
27
- *
28
- * Elements can receive focus only if:
29
- * - they exist;
30
- * - they're visible;
31
- * - they're not disabled;
32
- * - they are a focusable tag name or have a positive tab index;
33
- * - they don't have a negative tab index.
34
- * @param element the element to check.
35
- * @returns true if the element is focusable, false otherwise.
36
- */
37
- export declare function isFocusable(element?: Element | null): boolean;
38
- /**
39
- * Focus the element passed as parameter if it can receive focus. Otherwise, decides on another element to focus based on the HTML tree
40
- * and accessibility attributes.
41
- *
42
- * Decision making:
43
- * - If the element is focusable, focus it.
44
- * - If the element is not focusable, check if it has an id and if another element controls it (aria-controls).
45
- * - If the element is controlled by another, try to focus the controller, based in this same algorithm.
46
- * - Otherwise, try to focus its parent.
47
- *
48
- * If no focusable element is found. Nothing happens.
49
- * @param element the element to focus.
50
- */
51
- export declare function focusAccessibleElement(element?: Element | null): void;
52
1
  /**
53
- * Focus the first focusable child of the element provided. If the element has no focusable child, nothing happens.
54
- *
55
- * A priority list can be passed in the second parameter, as an option. If it's provided, it will focus the first element according to the
56
- * list.
2
+ * Gets the value for a css variable of the layout.
57
3
  *
58
- * An ignore query selector can also be passed in the options parameter. If the first focusable element matches the query selector, the
59
- * next element is focused instead.
4
+ * Supposing the actual name of the variable is name-of-variable, the value passed to the first parameter (varname) may be: name-of-variable
5
+ * or --name-of-variable or var(--name-of-variable). All these formats work.
60
6
  *
61
- * @example
62
- * Suppose the children of element are: h1, button, p, input, select.
63
- * 1. We don't pass a priority list. The focused element will be the button.
64
- * 2. Our priority list is ['button']. The focused element will be the button.
65
- * 3. Our priority list is ['input', 'button']. The focused element will be the input.
66
- * 4. Our priority list is ['select', 'input']. The focused element will be the select.
67
- * 5. Our priority list is [['select', 'input'], 'button']. The focused element will be the input.
68
- *
69
- * @param element the element to search a child to focus.
70
- * @param options optional.
7
+ * @param varname the name of css variable.
8
+ * @returns the value of `varname`.
71
9
  */
72
- export declare function focusFirstChild(element: HTMLElement | Document | null | undefined, { priority, ignore }?: FocusOptions): void;
10
+ export declare function valueOfLayoutVar(varname: string): string;
73
11
  /**
74
12
  * Accessibility: makes the screen reader announce some text out loud.
75
13
  *
76
14
  * @param text the message for the screen reader to read.
77
15
  */
78
16
  export declare function announce(text: string): void;
79
- export {};
80
17
  //# sourceMappingURL=utils.d.ts.map