@admin-layout/tailwind-design-pro 11.0.4-alpha.4 → 11.2.1-alpha.1

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 (357) hide show
  1. package/README.md +471 -1
  2. package/lib/cdm-locales/en/menu.json +2 -1
  3. package/lib/cdm-locales/en/settings.json +40 -1
  4. package/lib/cdm-locales/es/menu.json +2 -1
  5. package/lib/cdm-locales/es/settings.json +42 -3
  6. package/lib/cdm-locales/index.d.ts +2 -0
  7. package/lib/cdm-locales/index.d.ts.map +1 -0
  8. package/lib/cdm-locales/index.ts +1 -0
  9. package/lib/components/LanguageMenu/LanguageMenu.d.ts +2 -1
  10. package/lib/components/LanguageMenu/LanguageMenu.d.ts.map +1 -1
  11. package/lib/components/LanguageMenu/LanguageMenu.js +40 -61
  12. package/lib/components/LanguageMenu/LanguageMenu.js.map +1 -1
  13. package/lib/components/Layout/BasicLayout/index.d.ts +6 -12
  14. package/lib/components/Layout/BasicLayout/index.d.ts.map +1 -1
  15. package/lib/components/Layout/BasicLayout/index.js +274 -108
  16. package/lib/components/Layout/BasicLayout/index.js.map +1 -1
  17. package/lib/components/Layout/BasicLayout/utils.d.ts +4 -2
  18. package/lib/components/Layout/BasicLayout/utils.d.ts.map +1 -1
  19. package/lib/components/Layout/BasicLayout/utils.js +80 -109
  20. package/lib/components/Layout/BasicLayout/utils.js.map +1 -1
  21. package/lib/components/Layout/GlobalFooter/BottomMenuDropdown.d.ts +1 -8
  22. package/lib/components/Layout/GlobalFooter/BottomMenuDropdown.d.ts.map +1 -1
  23. package/lib/components/Layout/GlobalFooter/BottomMenuDropdown.js +28 -38
  24. package/lib/components/Layout/GlobalFooter/BottomMenuDropdown.js.map +1 -1
  25. package/lib/components/Layout/GlobalFooter/Copyright.d.ts +2 -1
  26. package/lib/components/Layout/GlobalFooter/Copyright.d.ts.map +1 -1
  27. package/lib/components/Layout/GlobalFooter/Footer.d.ts +2 -1
  28. package/lib/components/Layout/GlobalFooter/Footer.d.ts.map +1 -1
  29. package/lib/components/Layout/GlobalHeader/Header.d.ts +1 -15
  30. package/lib/components/Layout/GlobalHeader/Header.d.ts.map +1 -1
  31. package/lib/components/Layout/GlobalHeader/Header.js +107 -65
  32. package/lib/components/Layout/GlobalHeader/Header.js.map +1 -1
  33. package/lib/components/Layout/GlobalHeader/MainHeader.d.ts +4 -0
  34. package/lib/components/Layout/GlobalHeader/MainHeader.d.ts.map +1 -0
  35. package/lib/components/Layout/GlobalHeader/MainHeader.js +187 -0
  36. package/lib/components/Layout/GlobalHeader/MainHeader.js.map +1 -0
  37. package/lib/components/Layout/GlobalHeader/OrganizationDropdown.d.ts +1 -12
  38. package/lib/components/Layout/GlobalHeader/OrganizationDropdown.d.ts.map +1 -1
  39. package/lib/components/Layout/GlobalHeader/OrganizationDropdown.js +26 -30
  40. package/lib/components/Layout/GlobalHeader/OrganizationDropdown.js.map +1 -1
  41. package/lib/components/Layout/GlobalHeader/RightContent.d.ts +3 -16
  42. package/lib/components/Layout/GlobalHeader/RightContent.d.ts.map +1 -1
  43. package/lib/components/Layout/GlobalHeader/RightContent.js +86 -0
  44. package/lib/components/Layout/GlobalHeader/RightContent.js.map +1 -0
  45. package/lib/components/Layout/GlobalHeader/RightMenu.d.ts +4 -0
  46. package/lib/components/Layout/GlobalHeader/RightMenu.d.ts.map +1 -0
  47. package/lib/components/Layout/GlobalHeader/RightMenu.js +248 -0
  48. package/lib/components/Layout/GlobalHeader/RightMenu.js.map +1 -0
  49. package/lib/components/Layout/GlobalHeader/SearchBar.d.ts +9 -0
  50. package/lib/components/Layout/GlobalHeader/SearchBar.d.ts.map +1 -0
  51. package/lib/components/Layout/GlobalHeader/SearchBar.js +109 -0
  52. package/lib/components/Layout/GlobalHeader/SearchBar.js.map +1 -0
  53. package/lib/components/Layout/GlobalHeader/index.d.ts +3 -0
  54. package/lib/components/Layout/GlobalHeader/index.d.ts.map +1 -0
  55. package/lib/components/Layout/ProTailwindLayout.d.ts +3 -1
  56. package/lib/components/Layout/ProTailwindLayout.d.ts.map +1 -1
  57. package/lib/components/Layout/ProTailwindLayout.js +77 -12
  58. package/lib/components/Layout/ProTailwindLayout.js.map +1 -1
  59. package/lib/components/Layout/Sidebar/BottomMenu.d.ts +4 -0
  60. package/lib/components/Layout/Sidebar/BottomMenu.d.ts.map +1 -0
  61. package/lib/components/Layout/Sidebar/BottomMenu.js +294 -0
  62. package/lib/components/Layout/Sidebar/BottomMenu.js.map +1 -0
  63. package/lib/components/Layout/Sidebar/Divider.d.ts +2 -31
  64. package/lib/components/Layout/Sidebar/Divider.d.ts.map +1 -1
  65. package/lib/components/Layout/Sidebar/Divider.js +26 -28
  66. package/lib/components/Layout/Sidebar/Divider.js.map +1 -1
  67. package/lib/components/Layout/Sidebar/DynamicIcon.d.ts +5 -0
  68. package/lib/components/Layout/Sidebar/DynamicIcon.d.ts.map +1 -0
  69. package/lib/components/Layout/Sidebar/DynamicIcon.js +50 -0
  70. package/lib/components/Layout/Sidebar/DynamicIcon.js.map +1 -0
  71. package/lib/components/Layout/Sidebar/MainSidebar.d.ts +5 -0
  72. package/lib/components/Layout/Sidebar/MainSidebar.d.ts.map +1 -0
  73. package/lib/components/Layout/Sidebar/MainSidebar.js +224 -0
  74. package/lib/components/Layout/Sidebar/MainSidebar.js.map +1 -0
  75. package/lib/components/Layout/Sidebar/MainSidebarMenu.d.ts +6 -0
  76. package/lib/components/Layout/Sidebar/MainSidebarMenu.d.ts.map +1 -0
  77. package/lib/components/Layout/Sidebar/MainSidebarMenu.js +451 -0
  78. package/lib/components/Layout/Sidebar/MainSidebarMenu.js.map +1 -0
  79. package/lib/components/Layout/Sidebar/PerplexSidebar.d.ts +4 -0
  80. package/lib/components/Layout/Sidebar/PerplexSidebar.d.ts.map +1 -0
  81. package/lib/components/Layout/Sidebar/PerplexSidebar.js +254 -0
  82. package/lib/components/Layout/Sidebar/PerplexSidebar.js.map +1 -0
  83. package/lib/components/Layout/Sidebar/PerplexSidebarMenu.d.ts +4 -0
  84. package/lib/components/Layout/Sidebar/PerplexSidebarMenu.d.ts.map +1 -0
  85. package/lib/components/Layout/Sidebar/PerplexSidebarMenu.js +318 -0
  86. package/lib/components/Layout/Sidebar/PerplexSidebarMenu.js.map +1 -0
  87. package/lib/components/Layout/TailwindLayout.d.ts.map +1 -1
  88. package/lib/components/Layout/TailwindLayout.js +46 -13
  89. package/lib/components/Layout/TailwindLayout.js.map +1 -1
  90. package/lib/components/Layout/getPageTitle.d.ts +1 -16
  91. package/lib/components/Layout/getPageTitle.d.ts.map +1 -1
  92. package/lib/components/Layout/getPageTitle.js +1 -1
  93. package/lib/components/Layout/getPageTitle.js.map +1 -1
  94. package/lib/components/Layout/slot-fill/AdditionalSettings.d.ts +5 -0
  95. package/lib/components/Layout/slot-fill/AdditionalSettings.d.ts.map +1 -0
  96. package/lib/components/Layout/slot-fill/AdditionalSettings.js +7 -0
  97. package/lib/components/Layout/slot-fill/AdditionalSettings.js.map +1 -0
  98. package/lib/components/Layout/slot-fill/Footer.d.ts +4 -3
  99. package/lib/components/Layout/slot-fill/Footer.d.ts.map +1 -1
  100. package/lib/components/Layout/slot-fill/Footer.js +6 -6
  101. package/lib/components/Layout/slot-fill/Footer.js.map +1 -1
  102. package/lib/components/Layout/slot-fill/HeaderNotice.d.ts +3 -2
  103. package/lib/components/Layout/slot-fill/HeaderNotice.d.ts.map +1 -1
  104. package/lib/components/Layout/slot-fill/HeaderNotice.js +7 -0
  105. package/lib/components/Layout/slot-fill/HeaderNotice.js.map +1 -0
  106. package/lib/components/Layout/slot-fill/HeaderSearchBar.d.ts +4 -0
  107. package/lib/components/Layout/slot-fill/HeaderSearchBar.d.ts.map +1 -0
  108. package/lib/components/Layout/slot-fill/HeaderSearchBar.js +6 -0
  109. package/lib/components/Layout/slot-fill/HeaderSearchBar.js.map +1 -0
  110. package/lib/components/Layout/slot-fill/HeaderSearchButton.d.ts +4 -0
  111. package/lib/components/Layout/slot-fill/HeaderSearchButton.d.ts.map +1 -0
  112. package/lib/components/Layout/slot-fill/HeaderSearchButton.js +6 -0
  113. package/lib/components/Layout/slot-fill/HeaderSearchButton.js.map +1 -0
  114. package/lib/components/Layout/slot-fill/Logo.d.ts +5 -0
  115. package/lib/components/Layout/slot-fill/Logo.d.ts.map +1 -0
  116. package/lib/components/Layout/slot-fill/Logo.js +7 -0
  117. package/lib/components/Layout/slot-fill/Logo.js.map +1 -0
  118. package/lib/components/Layout/slot-fill/RightContent.d.ts +4 -0
  119. package/lib/components/Layout/slot-fill/RightContent.d.ts.map +1 -0
  120. package/lib/components/Layout/slot-fill/RightContent.js +6 -0
  121. package/lib/components/Layout/slot-fill/RightContent.js.map +1 -0
  122. package/lib/components/Layout/slot-fill/SideMenuLogo.d.ts +5 -0
  123. package/lib/components/Layout/slot-fill/SideMenuLogo.d.ts.map +1 -0
  124. package/lib/components/Layout/slot-fill/SideMenuLogo.js +7 -0
  125. package/lib/components/Layout/slot-fill/SideMenuLogo.js.map +1 -0
  126. package/lib/components/Layout/slot-fill/index.d.ts +6 -0
  127. package/lib/components/Layout/slot-fill/index.d.ts.map +1 -1
  128. package/lib/components/Layout/util.d.ts.map +1 -1
  129. package/lib/components/Layout/util.js +12 -0
  130. package/lib/components/Layout/util.js.map +1 -0
  131. package/lib/components/SettingDrawer/SettingDrawer.d.ts +2 -25
  132. package/lib/components/SettingDrawer/SettingDrawer.d.ts.map +1 -1
  133. package/lib/components/SettingDrawer/SettingDrawer.js +203 -382
  134. package/lib/components/SettingDrawer/SettingDrawer.js.map +1 -1
  135. package/lib/components/SettingDrawer/components/ApplyToAllRoutesToggle.d.ts +8 -0
  136. package/lib/components/SettingDrawer/components/ApplyToAllRoutesToggle.d.ts.map +1 -0
  137. package/lib/components/SettingDrawer/components/ApplyToAllRoutesToggle.js +21 -0
  138. package/lib/components/SettingDrawer/components/ApplyToAllRoutesToggle.js.map +1 -0
  139. package/lib/components/SettingDrawer/components/CheckBoxTheme.d.ts +4 -0
  140. package/lib/components/SettingDrawer/components/CheckBoxTheme.d.ts.map +1 -0
  141. package/lib/components/SettingDrawer/components/CheckBoxTheme.js +119 -0
  142. package/lib/components/SettingDrawer/components/CheckBoxTheme.js.map +1 -0
  143. package/lib/components/SettingDrawer/components/DeviceTabs.d.ts +8 -0
  144. package/lib/components/SettingDrawer/components/DeviceTabs.d.ts.map +1 -0
  145. package/lib/components/SettingDrawer/components/DeviceTabs.js +74 -0
  146. package/lib/components/SettingDrawer/components/DeviceTabs.js.map +1 -0
  147. package/lib/components/SettingDrawer/components/InvitationSettings.d.ts +4 -0
  148. package/lib/components/SettingDrawer/components/InvitationSettings.d.ts.map +1 -0
  149. package/lib/components/SettingDrawer/components/InvitationSettings.js +72 -0
  150. package/lib/components/SettingDrawer/components/InvitationSettings.js.map +1 -0
  151. package/lib/components/SettingDrawer/components/LayoutChange.d.ts +4 -0
  152. package/lib/components/SettingDrawer/components/LayoutChange.d.ts.map +1 -0
  153. package/lib/components/SettingDrawer/components/LayoutChange.js +111 -0
  154. package/lib/components/SettingDrawer/components/LayoutChange.js.map +1 -0
  155. package/lib/components/SettingDrawer/components/MenuVisibilitySettings.d.ts +21 -0
  156. package/lib/components/SettingDrawer/components/MenuVisibilitySettings.d.ts.map +1 -0
  157. package/lib/components/SettingDrawer/components/MenuVisibilitySettings.js +106 -0
  158. package/lib/components/SettingDrawer/components/MenuVisibilitySettings.js.map +1 -0
  159. package/lib/components/SettingDrawer/components/NavigationsModes.d.ts +4 -0
  160. package/lib/components/SettingDrawer/components/NavigationsModes.d.ts.map +1 -0
  161. package/lib/components/SettingDrawer/components/NavigationsModes.js +322 -0
  162. package/lib/components/SettingDrawer/components/NavigationsModes.js.map +1 -0
  163. package/lib/components/SettingDrawer/components/RegionalSettings.d.ts +4 -0
  164. package/lib/components/SettingDrawer/components/RegionalSettings.d.ts.map +1 -0
  165. package/lib/components/SettingDrawer/components/RegionalSettings.js +519 -0
  166. package/lib/components/SettingDrawer/components/RegionalSettings.js.map +1 -0
  167. package/lib/components/SettingDrawer/components/SettingsActions.d.ts +13 -0
  168. package/lib/components/SettingDrawer/components/SettingsActions.d.ts.map +1 -0
  169. package/lib/components/SettingDrawer/components/SettingsActions.js +42 -0
  170. package/lib/components/SettingDrawer/components/SettingsActions.js.map +1 -0
  171. package/lib/components/SettingDrawer/components/SettingsDrawerHeader.d.ts +5 -0
  172. package/lib/components/SettingDrawer/components/SettingsDrawerHeader.d.ts.map +1 -0
  173. package/lib/components/SettingDrawer/components/SettingsDrawerHeader.js +22 -0
  174. package/lib/components/SettingDrawer/components/SettingsDrawerHeader.js.map +1 -0
  175. package/lib/components/SettingDrawer/components/Switch.d.ts +4 -0
  176. package/lib/components/SettingDrawer/components/Switch.d.ts.map +1 -0
  177. package/lib/components/SettingDrawer/components/Switch.js +20 -0
  178. package/lib/components/SettingDrawer/components/Switch.js.map +1 -0
  179. package/lib/components/SettingDrawer/components/ThemeColor.d.ts +4 -0
  180. package/lib/components/SettingDrawer/components/ThemeColor.d.ts.map +1 -0
  181. package/lib/components/SettingDrawer/components/ThemeColor.js +45 -0
  182. package/lib/components/SettingDrawer/components/ThemeColor.js.map +1 -0
  183. package/lib/components/SettingDrawer/components/ThemeSelector.d.ts +4 -0
  184. package/lib/components/SettingDrawer/components/ThemeSelector.d.ts.map +1 -0
  185. package/lib/components/SettingDrawer/components/ThemeSelector.js +16 -0
  186. package/lib/components/SettingDrawer/components/ThemeSelector.js.map +1 -0
  187. package/lib/components/SettingDrawer/components/WebFontsSelector.d.ts +4 -0
  188. package/lib/components/SettingDrawer/components/WebFontsSelector.d.ts.map +1 -0
  189. package/lib/components/SettingDrawer/components/WebFontsSelector.js +22 -0
  190. package/lib/components/SettingDrawer/components/WebFontsSelector.js.map +1 -0
  191. package/lib/components/SettingDrawer/hooks/useSettingsOperations.d.ts +18 -0
  192. package/lib/components/SettingDrawer/hooks/useSettingsOperations.d.ts.map +1 -0
  193. package/lib/components/SettingDrawer/hooks/useSettingsOperations.js +115 -0
  194. package/lib/components/SettingDrawer/hooks/useSettingsOperations.js.map +1 -0
  195. package/lib/components/SettingDrawer/utils/constants.d.ts +11 -0
  196. package/lib/components/SettingDrawer/utils/constants.d.ts.map +1 -0
  197. package/lib/components/SettingDrawer/utils/constants.js +77 -0
  198. package/lib/components/SettingDrawer/utils/constants.js.map +1 -0
  199. package/lib/components/SettingDrawer/utils/helper.d.ts +37 -0
  200. package/lib/components/SettingDrawer/utils/helper.d.ts.map +1 -0
  201. package/lib/components/SettingDrawer/utils/helper.js +154 -0
  202. package/lib/components/SettingDrawer/utils/helper.js.map +1 -0
  203. package/lib/components/SettingDrawer/utils/transformers.d.ts +15 -0
  204. package/lib/components/SettingDrawer/utils/transformers.d.ts.map +1 -0
  205. package/lib/components/SettingDrawer/utils/transformers.js +73 -0
  206. package/lib/components/SettingDrawer/utils/transformers.js.map +1 -0
  207. package/lib/components/SettingDrawer/utils/types.d.ts +105 -0
  208. package/lib/components/SettingDrawer/utils/types.d.ts.map +1 -0
  209. package/lib/components/UpdateSettingsResource/UpdateSettingsResource.server.d.ts +16 -1
  210. package/lib/components/UpdateSettingsResource/UpdateSettingsResource.server.d.ts.map +1 -1
  211. package/lib/components/UpdateSettingsResource/UpdateSettingsResource.server.js +97 -4
  212. package/lib/components/UpdateSettingsResource/UpdateSettingsResource.server.js.map +1 -1
  213. package/lib/components/index.d.ts +2 -0
  214. package/lib/components/index.d.ts.map +1 -0
  215. package/lib/components/index.js +1 -0
  216. package/lib/components/index.js.map +1 -0
  217. package/lib/components/typings.d.ts +154 -50
  218. package/lib/components/typings.d.ts.map +1 -1
  219. package/lib/compute.d.ts.map +1 -1
  220. package/lib/compute.js +16 -6
  221. package/lib/compute.js.map +1 -1
  222. package/lib/config/analytics-config.d.ts +59 -0
  223. package/lib/config/analytics-config.d.ts.map +1 -0
  224. package/lib/config/constants.d.ts +8 -0
  225. package/lib/config/constants.d.ts.map +1 -0
  226. package/lib/config/constants.js +32 -0
  227. package/lib/config/constants.js.map +1 -0
  228. package/lib/config/env-config.d.ts +21 -0
  229. package/lib/config/env-config.d.ts.map +1 -1
  230. package/lib/config/env-config.js +86 -1
  231. package/lib/config/env-config.js.map +1 -1
  232. package/lib/config/index.d.ts +3 -0
  233. package/lib/config/index.d.ts.map +1 -0
  234. package/lib/helpers/DynamicIcon.d.ts +8 -5
  235. package/lib/helpers/DynamicIcon.d.ts.map +1 -1
  236. package/lib/helpers/DynamicIcon.js +50 -0
  237. package/lib/helpers/DynamicIcon.js.map +1 -0
  238. package/lib/hooks/index.d.ts +3 -0
  239. package/lib/hooks/index.d.ts.map +1 -0
  240. package/lib/hooks/useMediaQuery.d.ts +14 -0
  241. package/lib/hooks/useMediaQuery.d.ts.map +1 -0
  242. package/lib/hooks/useMediaQuery.js +48 -0
  243. package/lib/hooks/useMediaQuery.js.map +1 -0
  244. package/lib/hooks/useScrollThreshold.d.ts +12 -0
  245. package/lib/hooks/useScrollThreshold.d.ts.map +1 -0
  246. package/lib/hooks/useScrollThreshold.js +60 -0
  247. package/lib/hooks/useScrollThreshold.js.map +1 -0
  248. package/lib/hooks/useTailwindTheme.d.ts +34 -0
  249. package/lib/hooks/useTailwindTheme.d.ts.map +1 -0
  250. package/lib/hooks/useTailwindTheme.js +82 -0
  251. package/lib/hooks/useTailwindTheme.js.map +1 -0
  252. package/lib/icons.d.ts +18 -0
  253. package/lib/icons.d.ts.map +1 -0
  254. package/lib/icons.js +14 -0
  255. package/lib/icons.js.map +1 -0
  256. package/lib/index.d.ts +3 -3
  257. package/lib/index.d.ts.map +1 -1
  258. package/lib/index.js +1 -1
  259. package/lib/index.js.map +1 -1
  260. package/lib/machines/selectors.d.ts +118 -0
  261. package/lib/machines/selectors.d.ts.map +1 -0
  262. package/lib/machines/settingsMachine.d.ts +29 -0
  263. package/lib/machines/settingsMachine.d.ts.map +1 -0
  264. package/lib/machines/settingsMachine.js +171 -0
  265. package/lib/machines/settingsMachine.js.map +1 -0
  266. package/lib/machines/types.d.ts +272 -0
  267. package/lib/machines/types.d.ts.map +1 -0
  268. package/lib/machines/types.js +5 -0
  269. package/lib/machines/types.js.map +1 -0
  270. package/lib/module.d.ts +0 -1
  271. package/lib/module.d.ts.map +1 -1
  272. package/lib/module.js +14 -15
  273. package/lib/module.js.map +1 -1
  274. package/lib/redux/index.d.ts +2 -0
  275. package/lib/redux/index.d.ts.map +1 -0
  276. package/lib/redux/searchReducer.d.ts +42 -0
  277. package/lib/redux/searchReducer.d.ts.map +1 -0
  278. package/lib/redux/searchReducer.js +64 -0
  279. package/lib/redux/searchReducer.js.map +1 -0
  280. package/lib/routes.json +10 -1
  281. package/lib/styles/index.css +667 -45
  282. package/lib/tailwindConfig.d.ts +100 -0
  283. package/lib/tailwindConfig.d.ts.map +1 -0
  284. package/lib/tailwindConfig.js +101 -0
  285. package/lib/tailwindConfig.js.map +1 -0
  286. package/lib/utils/__tests__/analytics-utils.test.d.ts +2 -0
  287. package/lib/utils/__tests__/analytics-utils.test.d.ts.map +1 -0
  288. package/lib/utils/__tests__/configOverrides.test.d.ts +2 -0
  289. package/lib/utils/__tests__/configOverrides.test.d.ts.map +1 -0
  290. package/lib/utils/__tests__/menu.test.d.ts +2 -0
  291. package/lib/utils/__tests__/menu.test.d.ts.map +1 -0
  292. package/lib/utils/__tests__/selectors.test.d.ts +2 -0
  293. package/lib/utils/__tests__/selectors.test.d.ts.map +1 -0
  294. package/lib/utils/__tests__/settingsMachine.test.d.ts +2 -0
  295. package/lib/utils/__tests__/settingsMachine.test.d.ts.map +1 -0
  296. package/lib/utils/__tests__/settingsUtils.test.d.ts +2 -0
  297. package/lib/utils/__tests__/settingsUtils.test.d.ts.map +1 -0
  298. package/lib/utils/analytics-utils.d.ts +43 -0
  299. package/lib/utils/analytics-utils.d.ts.map +1 -0
  300. package/lib/utils/analytics.d.ts +48 -0
  301. package/lib/utils/analytics.d.ts.map +1 -0
  302. package/lib/utils/configOverrides.d.ts +213 -0
  303. package/lib/utils/configOverrides.d.ts.map +1 -0
  304. package/lib/utils/configOverrides.js +91 -0
  305. package/lib/utils/configOverrides.js.map +1 -0
  306. package/lib/utils/formateCarData.d.ts +2 -0
  307. package/lib/utils/formateCarData.d.ts.map +1 -0
  308. package/lib/utils/isBrowser/index.js.map +1 -1
  309. package/lib/utils/menu.d.ts.map +1 -1
  310. package/lib/utils/settingsUtils.d.ts +20 -0
  311. package/lib/utils/settingsUtils.d.ts.map +1 -0
  312. package/lib/utils/settingsUtils.js +74 -0
  313. package/lib/utils/settingsUtils.js.map +1 -0
  314. package/lib/utils/test-utils.d.ts.map +1 -1
  315. package/lib/utils/utils/index.d.ts.map +1 -1
  316. package/lib/utils/utils/index.js.map +1 -1
  317. package/package.json +7 -15
  318. package/lib/components/Layout/GlobalFooter/Copyright.js +0 -8
  319. package/lib/components/Layout/GlobalFooter/Copyright.js.map +0 -1
  320. package/lib/components/Layout/GlobalFooter/Footer.js +0 -22
  321. package/lib/components/Layout/GlobalFooter/Footer.js.map +0 -1
  322. package/lib/components/Layout/Sidebar/Sidebar.d.ts +0 -15
  323. package/lib/components/Layout/Sidebar/Sidebar.d.ts.map +0 -1
  324. package/lib/components/Layout/Sidebar/Sidebar.js +0 -141
  325. package/lib/components/Layout/Sidebar/Sidebar.js.map +0 -1
  326. package/lib/components/Layout/Sidebar/SidebarMenu.d.ts +0 -6
  327. package/lib/components/Layout/Sidebar/SidebarMenu.d.ts.map +0 -1
  328. package/lib/components/Layout/Sidebar/SidebarMenu.js +0 -89
  329. package/lib/components/Layout/Sidebar/SidebarMenu.js.map +0 -1
  330. package/lib/components/SettingDrawer/CheckBoxTheme.d.ts +0 -8
  331. package/lib/components/SettingDrawer/CheckBoxTheme.d.ts.map +0 -1
  332. package/lib/components/SettingDrawer/CheckBoxTheme.js +0 -48
  333. package/lib/components/SettingDrawer/CheckBoxTheme.js.map +0 -1
  334. package/lib/components/SettingDrawer/LayoutChange.d.ts +0 -7
  335. package/lib/components/SettingDrawer/LayoutChange.d.ts.map +0 -1
  336. package/lib/components/SettingDrawer/LayoutChange.js +0 -69
  337. package/lib/components/SettingDrawer/LayoutChange.js.map +0 -1
  338. package/lib/components/SettingDrawer/RegionalSettings.d.ts +0 -8
  339. package/lib/components/SettingDrawer/RegionalSettings.d.ts.map +0 -1
  340. package/lib/components/SettingDrawer/RegionalSettings.js +0 -95
  341. package/lib/components/SettingDrawer/RegionalSettings.js.map +0 -1
  342. package/lib/components/SettingDrawer/Switch/index.d.ts +0 -9
  343. package/lib/components/SettingDrawer/Switch/index.d.ts.map +0 -1
  344. package/lib/components/SettingDrawer/Switch/index.js +0 -39
  345. package/lib/components/SettingDrawer/Switch/index.js.map +0 -1
  346. package/lib/components/SettingDrawer/ThemeColor.d.ts +0 -8
  347. package/lib/components/SettingDrawer/ThemeColor.d.ts.map +0 -1
  348. package/lib/components/SettingDrawer/ThemeColor.js +0 -32
  349. package/lib/components/SettingDrawer/ThemeColor.js.map +0 -1
  350. package/lib/components/defaultSettings.d.ts +0 -4
  351. package/lib/components/defaultSettings.d.ts.map +0 -1
  352. package/lib/components/defaultSettings.js +0 -14
  353. package/lib/components/defaultSettings.js.map +0 -1
  354. package/lib/utils/index.d.ts +0 -2
  355. package/lib/utils/index.d.ts.map +0 -1
  356. package/lib/utils/index.js +0 -13
  357. package/lib/utils/index.js.map +0 -1
@@ -1,16 +1,19 @@
1
- import {jsxs,jsx}from'react/jsx-runtime';import {useState,useRef,useEffect}from'react';import {useTranslation}from'react-i18next';import {useMediaQuery}from'react-responsive';import {useAppDispatch,languages,CHANGE_LANGUAGE}from'@admin-layout/client';import config from'@app/cde-webconfig.json';const LanguageMenu = () => {
2
- const isMobile = useMediaQuery({
3
- maxWidth: 767
4
- });
5
- const [locale, setLocale] = useState('en');
6
- const dispatch = useAppDispatch();
1
+ import React__default,{useState,useRef,useEffect}from'react';import {useTranslation}from'react-i18next';import {useMediaQuery}from'react-responsive';import {languages,useLayoutSettings}from'@admin-layout/client';import {Globe}from'lucide-react';import config from'@app/cde-webconfig.json';const LanguageMenu = () => {
7
2
  const {
8
3
  i18n
9
4
  } = useTranslation();
10
5
  const {
11
6
  i18n: i18nextInstance
12
7
  } = config;
13
- const [currentLang, setCurrentLang] = useState({
8
+ const filteredLanguages = languages.filter(language => i18nextInstance.supportedLngs.includes(language.key));
9
+ const isMobile = useMediaQuery({
10
+ maxWidth: 767
11
+ });
12
+ const {
13
+ settings,
14
+ setSettings
15
+ } = useLayoutSettings();
16
+ const [currentLang, setCurrentLang] = useState(filteredLanguages.find(language => language.key === settings.language) || {
14
17
  key: 'en',
15
18
  label: 'English',
16
19
  flag: '🇬🇧',
@@ -18,13 +21,9 @@ import {jsxs,jsx}from'react/jsx-runtime';import {useState,useRef,useEffect}from'
18
21
  });
19
22
  const [isOpen, setIsOpen] = useState(false);
20
23
  const dropdownRef = useRef(null);
21
- const filteredLanguages = languages.filter(language => i18nextInstance.supportedLngs.includes(language.key));
22
24
  useEffect(() => {
23
- dispatch({
24
- type: CHANGE_LANGUAGE,
25
- payload: locale
26
- });
27
- }, [locale, dispatch]);
25
+ i18n.changeLanguage(settings.language);
26
+ }, []);
28
27
  useEffect(() => {
29
28
  const handleClickOutside = event => {
30
29
  if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
@@ -37,59 +36,39 @@ import {jsxs,jsx}from'react/jsx-runtime';import {useState,useRef,useEffect}from'
37
36
  };
38
37
  }, []);
39
38
  const handleLanguageChange = language => {
40
- setCurrentLang({
41
- key: language.key,
42
- label: language.label,
43
- flag: language.flag,
44
- global: language.global
45
- });
39
+ setCurrentLang(language);
46
40
  i18n.changeLanguage(language.key);
47
- setLocale(language.key);
48
41
  setIsOpen(false);
42
+ setSettings(settings, {
43
+ language: language.key
44
+ });
49
45
  };
50
46
  const toggleDropdown = () => {
51
47
  setIsOpen(!isOpen);
52
48
  };
53
- return jsxs("div", {
49
+ return React__default.createElement("div", {
54
50
  className: "relative",
55
- ref: dropdownRef,
56
- children: [jsxs("button", {
57
- onClick: toggleDropdown,
58
- className: "flex items-center gap-1 px-3 py-1 border border-gray-500 rounded-full h-9 hover:bg-gray-100 transition-colors duration-200",
59
- children: [currentLang.global ? jsx("svg", {
60
- className: "w-5 h-5",
61
- fill: "currentColor",
62
- viewBox: "0 0 24 24",
63
- children: jsx("path", {
64
- d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 17.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2v1.93zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39z"
65
- })
66
- }) : jsx("span", {
67
- className: "text-lg",
68
- children: currentLang.flag
69
- }), jsx("span", {
70
- className: "text-sm font-medium",
71
- children: isMobile ? currentLang.key.toUpperCase() : currentLang.label
72
- })]
73
- }), isOpen && jsx("div", {
74
- className: "absolute right-0 mt-1 bg-white border border-gray-200 rounded-md shadow-lg z-10 w-40 max-h-60 overflow-y-auto",
75
- children: filteredLanguages.map(language => jsxs("div", {
76
- className: "px-4 py-2 flex items-center gap-2 hover:bg-gray-100 cursor-pointer",
77
- onClick: () => handleLanguageChange(language),
78
- children: [language.global ? jsx("svg", {
79
- className: "w-4 h-4",
80
- fill: "currentColor",
81
- viewBox: "0 0 24 24",
82
- children: jsx("path", {
83
- d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 17.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2v1.93zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39z"
84
- })
85
- }) : jsx("span", {
86
- className: "text-base",
87
- children: language.flag
88
- }), jsx("span", {
89
- className: "text-sm",
90
- children: isMobile ? language.key : language.label
91
- })]
92
- }, `lang_${language.key}`))
93
- })]
94
- });
51
+ ref: dropdownRef
52
+ }, React__default.createElement("button", {
53
+ onClick: toggleDropdown,
54
+ className: "flex items-center gap-1 px-3 py-1 border border-border rounded-full h-9 hover:bg-muted transition-colors duration-200 bg-background text-foreground"
55
+ }, currentLang.global ? React__default.createElement(Globe, {
56
+ className: "w-5 h-5"
57
+ }) : React__default.createElement("span", {
58
+ className: "text-lg"
59
+ }, currentLang.flag), React__default.createElement("span", {
60
+ className: "text-sm font-medium"
61
+ }, isMobile ? currentLang.key.toUpperCase() : currentLang.label)), isOpen && React__default.createElement("div", {
62
+ className: "absolute right-0 mt-1 themed-dropdown w-40 max-h-60 overflow-y-auto"
63
+ }, filteredLanguages.map(language => React__default.createElement("div", {
64
+ key: `lang_${language.key}`,
65
+ className: "px-4 py-2 flex items-center gap-2 hover:bg-muted cursor-pointer text-foreground",
66
+ onClick: () => handleLanguageChange(language)
67
+ }, language.global ? React__default.createElement(Globe, {
68
+ className: "w-4 h-4"
69
+ }) : React__default.createElement("span", {
70
+ className: "text-base"
71
+ }, language.flag), React__default.createElement("span", {
72
+ className: "text-sm"
73
+ }, isMobile ? language.key : language.label)))));
95
74
  };export{LanguageMenu};//# sourceMappingURL=LanguageMenu.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"LanguageMenu.js","sources":["../../../src/components/LanguageMenu/LanguageMenu.tsx"],"sourcesContent":[null],"names":[],"mappings":"uSAOO,MAAM,YAAY,GAAG,MAAK;QACvB,QAAA,GAAW,aAAA,CAAA;IACjB,QAAa,EAAA;AACb,GAAA,CAAA;AACA,EAAA,MAAA,CAAA,MAAY,EAAA,SAAK,CAAA,GAAA,QAAiB,CAAA,IAAA,CAAA;AAClC,EAAA,MAAA,QAAY,iBAAiB,EAAE;AAC/B,EAAA,MAAA;AACI,IAAA;AACA,GAAA,GAAA,cAAgB,EAAA;AAChB,EAAA,MAAA;AACA,IAAA,IAAA,EAAA;AACH,GAAA,GAAC,MAAC;QACG,CAAA,WAAkB,EAAA,cAAY,CAAA,GAAA,QAAQ,CAAA;AAC5C,IAAA,GAAA,EAAA;IAEA,KAAM,EAAA,SAAA;IAEN,IAAS,EAAA;AACL,IAAA,MAAA,EAAA;AACI,GAAA,CAAA;AACA,EAAA,MAAA,CAAA,MAAA,EAAA,SAAe,CAAA,GAAA,QAAA,CAAA,KAAA,CAAA;AAClB,EAAA,MAAA,WAAE,GAAA,MAAA,CAAA,IAAA,CAAA;AACP,EAAA,MAAI,iBAAiB,GAAE,SAAA,CAAA,MAAA,CAAA,QAAA,IAAA,eAAA,CAAA,aAAA,CAAA,QAAA,CAAA,QAAA,CAAA,GAAA,CAAA,CAAA;WAEd,CAAA,MAAM;AACX,IAAA,QAAA,CAAA;AACI,MAAA,IAAA,EAAA,eAAe;;;AAGnB,GAAA,EAAA,CAAA,MAAE,EAAA,QAAA,CAAA,CAAA;AAEF,EAAA,SAAA,CAAA,MAAyB;AACzB,IAAA,MAAA,kBAAY,GAAA,KAAA,IAAA;AACR,MAAA,IAAA,WAAS,CAAmB,OAAA,IAAA,CAAA,mBAAc,CAAA,QAAA,CAAA,KAAA,CAAA,MAAoB,CAAA,EAAA;AAClE,QAAA,SAAE,CAAA,KAAA,CAAA;;AAGN,KAAA;AACI,IAAA,QAAA,CAAA,gBAAe,CAAA,WAAA,EAAA,kBAAA,CAAA;iBACN;cACA,CAAA,mBAAgB,CAAA,WAAA,EAAA,kBAAA,CAAA;;;AAGxB,EAAA,MAAA,oBAAE,GAAA,QAAA,IAAA;AACH,IAAA,cAAmB,CAAA;AACnB,MAAA,GAAA,EAAA,QAAU,CAAA,GAAA;WACD,EAAA,QAAM,CAAA,KAAE;AACrB,MAAE,IAAA,EAAA,QAAA,CAAA,IAAA;MAEI,MAAA,EAAA,QAAA,CAAA;AACF,KAAA,CAAA;AACJ,IAAA,IAAE,CAAA,cAAA,CAAA,QAAA,CAAA,GAAA,CAAA;IAEF,uBACS;AAuCb,IAAE,SAAA,CAAA,KAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"LanguageMenu.js","sources":["../../../src/components/LanguageMenu/LanguageMenu.tsx"],"sourcesContent":[null],"names":[],"mappings":"iSAQO,MAAM,YAAY,GAAG,MAAK;AAC7B,EAAA,MAAA;AACA,IAAA;MACA,cAAM,EAAA;QACN;IACA,IAAA,EAAM;MACN,MAAO;AAEC,EAAA,MAAA,iBAAS,GAAA,SAAA,CAAA,MAAA,CAAA,QAAA,IAAA,eAAA,CAAA,aAAA,CAAA,QAAA,CAAA,QAAA,CAAA,GAAA,CAAA,CAAA;AACT,EAAA,MAAA,QAAO,GAAA,aAAS,CAAA;AAChB,IAAA,QAAI,EAAE;AACN,GAAA,CAAA;AACH,EAAA,MACH;IACF,QAAO;AACP,IAAA;MAEA,iBAAe,EAAA;AACX,EAAA,MAAA,CAAA,WAAK,EAAA,cAAuB,CAAC,GAAA,QAAU,CAAA,iBAAA,CAAA,IAAA,CAAA,QAAA,IAAA,QAAA,CAAA,GAAA,KAAA,QAAA,CAAA,QAAA,CAAA,IAAA;IAC3C,GAAG,EAAE,IAAE;IAEP,KAAA,EAAA,SAAe;AACX,IAAA,IAAA,EAAA,MAAM;AACF,IAAA,MAAA,EAAA;;eAEC,EAAA,SAAA,CAAA,GAAA,QAAA,CAAA,KAAA,CAAA;AACL,EAAA,MAAA,WAAE,GAAA,MAAA,CAAA,IAAA,CAAA;AAEF,EAAA,SAAA,CAAA,MAAS;AACT,IAAA,IAAA,CAAA,cAAY,CAAA,QAAA,CAAA,QAAA,CAAA;AACR,EAAA,CAAA,EAAA,EAAA,CAAA;AACJ,EAAA,SAAE,CAAA,MAAA;IACN,MAAM,kBAAC,GAAA,KAAA,IAAA;AAEP,MAAA,IAAM,WAAA,CAAA,OAAA,IAAuB,CAAC,WAAU,CAAE,OAAA,CAAA,QAAA,CAAA,KAAA,CAAA,MAAA,CAAA,EAAA;QACtC,SAAA,CAAA,KAAe,CAAA;AACf,MAAA;;YAEA,CAAA,gBAAoB,CAAE,WAAU,EAAE,kBAAgB,CAAA;AACtD,IAAA,OAAE,MAAA;MAEF,QAAM,CAAA,mBAAsB,CAAA,WAAA,EAAA,kBAAA,CAAA;AACxB,IAAA,CAAA;AACJ,EAAA,CAAA,EAAC,EAAC,CAAA;QAEF,mCACS;AACD,IAAA,cAAA,CAAA,QAAA,CAAA;uBAIgB,CAAC,QAAQ,CAAC,GAClB,CAAA;aAIJ,CAAA,KAAA,CAAA;AAKH,IAAA,oBACG,EAAA;cAOa,EAAA,QAAS,CAAA;;AAYtC,EAAE,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,19 +1,13 @@
1
- import React from 'react';
2
1
  import { BasicLayoutProps, GlobalHeaderProps } from '@admin-layout/client';
3
- interface ThemeContextType {
4
- isDarkMode: boolean;
5
- toggleTheme: () => void;
6
- }
7
- export declare const useTheme: () => ThemeContextType;
8
- export declare const useHorizontalScroll: ({ scrolled, setScrolled, setSearchOptionsShown, onScrollReachEnd }: {
9
- scrolled: any;
2
+ import React from 'react';
3
+ export declare function useHorizontalScroll({ setScrolled, setSearchOptionsShown, onScrollReachEnd }: {
10
4
  setScrolled: any;
11
5
  setSearchOptionsShown: any;
12
6
  onScrollReachEnd: any;
13
- }) => React.MutableRefObject<undefined>;
14
- export declare const BasicLayout: React.FC<BasicLayoutProps & GlobalHeaderProps & {
7
+ }): React.MutableRefObject<undefined>;
8
+ export declare function BasicLayout(props: BasicLayoutProps & GlobalHeaderProps & {
15
9
  routeParams?: any;
16
10
  children?: React.ReactNode;
17
- }>;
18
- export {};
11
+ routePattern?: string;
12
+ }): React.JSX.Element;
19
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Layout/BasicLayout/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiE,MAAM,OAAO,CAAC;AAOtF,OAAO,EACH,gBAAgB,EAGhB,iBAAiB,EAEpB,MAAM,sBAAsB,CAAC;AAK9B,UAAU,gBAAgB;IACtB,UAAU,EAAE,OAAO,CAAC;IACpB,WAAW,EAAE,MAAM,IAAI,CAAC;CAC3B;AAID,eAAO,MAAM,QAAQ,wBAIpB,CAAC;AACF,eAAO,MAAM,mBAAmB;;;;;uCA6B/B,CAAC;AAgCF,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAC9B,gBAAgB,GAAG,iBAAiB,GAAG;IAAE,WAAW,CAAC,EAAE,GAAG,CAAC;IAAC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,CA4I3F,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Layout/BasicLayout/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EACH,gBAAgB,EAIhB,iBAAiB,EAEpB,MAAM,sBAAsB,CAAC;AAG9B,OAAO,KAA4D,MAAM,OAAO,CAAC;AAcjF,wBAAgB,mBAAmB,CAAC,EAAE,WAAW,EAAE,qBAAqB,EAAE,gBAAgB,EAAE;;;;CAAA,qCA+B3F;AAwCD,wBAAgB,WAAW,CACvB,KAAK,EAAE,gBAAgB,GACnB,iBAAiB,GAAG;IAAE,WAAW,CAAC,EAAE,GAAG,CAAC;IAAC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,qBAkXnG"}
@@ -1,14 +1,9 @@
1
- import {jsx,jsxs}from'react/jsx-runtime';import {useState,useRef,useEffect,createContext,useContext}from'react';import {Sidebar}from'../Sidebar/Sidebar.js';import {GlobalHeader}from'../GlobalHeader/Header.js';import {useLocation,Outlet}from'@remix-run/react';import warning from'warning';import {omit}from'lodash-es';import {SettingDrawer}from'../../SettingDrawer/SettingDrawer.js';import {defaultSettings,useComponentSize,getMenuSeparation}from'@admin-layout/client';import isBrowser from'../../../utils/isBrowser/index.js';import {getPageTitleInfo}from'../getPageTitle.js';import {GlobalFooter}from'../GlobalFooter/Footer.js';const ThemeContext = createContext(undefined);
2
- const useTheme = () => {
3
- const context = useContext(ThemeContext);
4
- return context;
5
- };
6
- const useHorizontalScroll = ({
7
- scrolled,
1
+ import {getThemeColors,getMenuSeparation,useComponentSize}from'@admin-layout/client';import {Outlet}from'@remix-run/react';import {omit}from'lodash-es';import React__default,{useRef,useState,useMemo,useEffect,useCallback}from'react';import warning from'warning';import {config}from'../../../config/env-config.js';import'@react-icons/all-files/fa/FaMoon.js';import'@react-icons/all-files/fa/FaSun.js';import {useMediaQuery}from'../../../hooks/useMediaQuery.js';import {useScrollThreshold}from'../../../hooks/useScrollThreshold.js';import {SettingDrawer}from'../../SettingDrawer/SettingDrawer.js';import {getPageTitleInfo}from'../getPageTitle.js';import {MainHeader}from'../GlobalHeader/MainHeader.js';import'@remix-run/router';import'../../../helpers/DynamicIcon.js';import'@app/dialog/WrappedDialogsSwitch';import {GlobalHeader}from'../GlobalHeader/Header.js';import {MainSidebar}from'../Sidebar/MainSidebar.js';import {PerplexSidebar}from'../Sidebar/PerplexSidebar.js';import'@common-stack/components-pro';import {FooterSlot}from'../slot-fill/Footer.js';import'reflect-metadata';import'@admin-layout/client/lib/constants/layout.js';//helper func
2
+ function useHorizontalScroll({
8
3
  setScrolled,
9
4
  setSearchOptionsShown,
10
5
  onScrollReachEnd
11
- }) => {
6
+ }) {
12
7
  const elRef = useRef();
13
8
  useEffect(() => {
14
9
  const el = elRef.current || null;
@@ -16,7 +11,6 @@ const useHorizontalScroll = ({
16
11
  const onWheel = e => {
17
12
  if (e.deltaY == 0) return;
18
13
  e.preventDefault();
19
- setSearchOptionsShown(false);
20
14
  if (window.scrollY > 50) {
21
15
  setScrolled(true);
22
16
  }
@@ -34,8 +28,8 @@ const useHorizontalScroll = ({
34
28
  }
35
29
  }, []);
36
30
  return elRef;
37
- };
38
- const defaultPageTitleRender = (pageProps, props) => {
31
+ }
32
+ function defaultPageTitleRender(pageProps, props) {
39
33
  const {
40
34
  pageTitleRender
41
35
  } = props;
@@ -58,59 +52,165 @@ const defaultPageTitleRender = (pageProps, props) => {
58
52
  warning(typeof title === 'string', 'pro-layout: renderPageTitle return value should be a string');
59
53
  }
60
54
  return pageTitleInfo;
61
- };
62
- const BasicLayout = props => {
63
- const propsWithSettings = {
64
- ...defaultSettings,
65
- ...props
66
- };
67
- const [scrolled, setScrolled] = useState(false);
68
- const [collapsed, setCollapsed] = useState();
55
+ }
56
+ function getUILayoutValueFromSettings(settingsObj, routeForBracket, device, path) {
57
+ const routeDeviceKey = `[${routeForBracket}][${device}]`;
58
+ const uiOverride = settingsObj?.uiSettings?.[routeDeviceKey];
59
+ if (uiOverride) {
60
+ const value = path.split('.').reduce((obj, key) => obj?.[key], uiOverride);
61
+ if (value !== undefined) return value;
62
+ }
63
+ return path.split('.').reduce((obj, key) => obj?.[key], settingsObj);
64
+ }
65
+ function BasicLayout(props) {
66
+ // Destructure props
69
67
  const {
70
68
  children,
69
+ onCollapse: propsOnCollapse,
70
+ defaultCollapsed,
71
71
  menuData,
72
- // location,
72
+ fullMenuData,
73
+ siderWidth = 208,
74
+ menu,
75
+ menuDataRender,
76
+ loading,
77
+ location,
73
78
  routeParams,
74
79
  settings,
80
+ authorities,
75
81
  primaryColor,
76
- onSettingChange,
77
- mainHeaderProps
78
- } = propsWithSettings;
82
+ mainHeaderProps,
83
+ actor,
84
+ routePattern
85
+ } = props;
86
+ // Refs
87
+ useRef(settings);
88
+ // Hooks
89
+ const {
90
+ isMobile
91
+ } = useMediaQuery();
92
+ // State
93
+ const [scrolled, setScrolled] = useState(false);
94
+ const [collapsed, setCollapsed] = useState(false);
95
+ const [siderPinned, setSiderPinned] = useState(false);
79
96
  const [isSideMenuOpen, setIsSideMenuOpen] = useState(false);
80
- const [isDarkMode, setIsDarkMode] = useState(false);
81
- const location = useLocation();
82
97
  const [scrollEnd, setScrollEnd] = useState(false);
83
98
  const [searchOptionsShown, setSearchOptionsShown] = useState(false);
99
+ const [footerFixed, setFooterFixed] = useState(false);
100
+ // Computed values
101
+ const currentRoute = location?.pathname || '/';
102
+ const deviceType = isMobile ? 'mobile' : 'desktop';
103
+ const routeForBracket = routePattern || currentRoute;
84
104
  const {
85
105
  picture
86
106
  } = mainHeaderProps;
87
- const onScrollReachEnd = () => {
88
- setScrollEnd(prevScrollEnd => !prevScrollEnd);
89
- };
90
- useHorizontalScroll({
91
- scrolled,
92
- setScrolled,
93
- setSearchOptionsShown,
94
- onScrollReachEnd
95
- });
107
+ const {
108
+ LAYOUT_ROOT
109
+ } = config;
110
+ const deviceSettings = useMemo(() => ({
111
+ header: getUILayoutValueFromSettings(settings, routeForBracket, deviceType, 'header'),
112
+ background: getUILayoutValueFromSettings(settings, routeForBracket, deviceType, 'background'),
113
+ footer: getUILayoutValueFromSettings(settings, routeForBracket, deviceType, 'footer')
114
+ }), [settings, routeForBracket, deviceType]);
115
+ const layoutSettings = useMemo(() => ({
116
+ contentWidth: getUILayoutValueFromSettings(settings, routeForBracket, deviceType, 'contentWidth'),
117
+ navigationMode: getUILayoutValueFromSettings(settings, routeForBracket, deviceType, 'navigationMode'),
118
+ sideMenuType: getUILayoutValueFromSettings(settings, routeForBracket, deviceType, 'sideMenuType'),
119
+ fixedHeader: getUILayoutValueFromSettings(settings, routeForBracket, deviceType, 'fixedHeader'),
120
+ fixedSidebar: getUILayoutValueFromSettings(settings, routeForBracket, deviceType, 'fixedSidebar'),
121
+ splitMenus: getUILayoutValueFromSettings(settings, routeForBracket, deviceType, 'splitMenus'),
122
+ upperMenuDividerName: getUILayoutValueFromSettings(settings, routeForBracket, deviceType, 'upperMenuDividerName'),
123
+ middleMenuDividerName: getUILayoutValueFromSettings(settings, routeForBracket, deviceType, 'middleMenuDividerName'),
124
+ lowerMenuDividerName: getUILayoutValueFromSettings(settings, routeForBracket, deviceType, 'lowerMenuDividerName'),
125
+ menuHeaderRender: getUILayoutValueFromSettings(settings, routeForBracket, deviceType, 'menuHeaderRender')
126
+ }), [settings, routeForBracket, deviceType]);
127
+ const backgroundSettings = useMemo(() => {
128
+ return deviceSettings?.background || {
129
+ type: 'color',
130
+ color: 'inherit',
131
+ image: '',
132
+ video: ''
133
+ };
134
+ }, [deviceSettings]);
135
+ const themeColors = useMemo(() => getThemeColors(settings?.theme), [settings?.theme]);
136
+ const backgroundClasses = useMemo(() => {
137
+ let classes = 'flex flex-col h-screen bg-background font-sans relative';
138
+ if (backgroundSettings.type === 'image' && backgroundSettings.image) {
139
+ classes += ' bg-cover bg-center bg-fixed';
140
+ }
141
+ return classes;
142
+ }, [backgroundSettings]);
143
+ const backgroundStyle = useMemo(() => {
144
+ if (backgroundSettings.type === 'image' && backgroundSettings.image) {
145
+ return {
146
+ backgroundImage: `url(${backgroundSettings.image})`
147
+ };
148
+ }
149
+ if (backgroundSettings.type === 'color' && backgroundSettings.color !== 'inherit') {
150
+ return {
151
+ backgroundColor: backgroundSettings.color
152
+ };
153
+ }
154
+ return {};
155
+ }, [backgroundSettings]);
156
+ const headerUpperMenus = useMemo(() => getMenuSeparation(menuData).upperMenus, [menuData]);
157
+ const footerActive = useMemo(() => getOverrideValue('footer.showFooter'), [deviceSettings]);
158
+ const memoizedMenuData = useMemo(() => menuData, [menuData]);
159
+ const memoizedRouteParams = useMemo(() => routeParams, [routeParams]);
160
+ // Derived layout flags
161
+ const isSidebarLayout = layoutSettings?.navigationMode !== 'topbar';
162
+ layoutSettings?.navigationMode === 'topbar';
163
+ const isSideMenuLayout = layoutSettings?.navigationMode === 'sidebar';
164
+ layoutSettings?.navigationMode === 'mixed';
165
+ const showMenu = deviceSettings?.header?.showMenu;
166
+ const showHeader = deviceSettings?.header?.showHeader;
167
+ const menuHeaderRender = deviceSettings?.header?.menuHeaderRender;
168
+ const hasFixedSidebar = layoutSettings?.fixedSidebar;
169
+ const isPerplexLayout = settings?.sideMenuType === 'perplexLayout';
170
+ const isAppShell = LAYOUT_ROOT != '/';
171
+ const shouldApplySidebarMargin = isSidebarLayout && showMenu && hasFixedSidebar && !isMobile;
172
+ const shouldShowSidebar = isSidebarLayout && showMenu;
173
+ const sideBarMarginTop = !isAppShell && showHeader ? '5rem' : undefined;
174
+ const computedMarginLeft = useMemo(() => {
175
+ return shouldApplySidebarMargin ? !isPerplexLayout ? collapsed ? '64px' : '256px' : !siderPinned ? '92px' : '316px' : '0px';
176
+ }, [shouldApplySidebarMargin, isPerplexLayout, collapsed, siderPinned]);
96
177
  const defaultProps = omit({
97
- ...propsWithSettings
178
+ ...props
98
179
  }, ['layout']);
99
- defaultPageTitleRender({
180
+ const pageTitleInfo = defaultPageTitleRender({
100
181
  pathname: location?.pathname,
101
182
  ...defaultProps
102
- }, propsWithSettings);
103
- const settingRef = useRef(settings);
183
+ }, props);
184
+ const scrollThreshold = deviceSettings?.header?.scrollThreshold || 50;
185
+ // Effects
104
186
  useEffect(() => {
105
- // Only update if the primaryColor actually needs to change
106
- if (settingRef.current?.primaryColor === '#3FA541C' && primaryColor !== '#3FA541C') {
107
- const newState = {
108
- ...settingRef.current,
109
- primaryColor
187
+ if (searchOptionsShown && isMobile) {
188
+ const scrollY = window.scrollY;
189
+ document.body.style.position = 'fixed';
190
+ document.body.style.top = `-${scrollY}px`;
191
+ document.body.style.width = '100%';
192
+ document.body.style.overflow = 'hidden';
193
+ return () => {
194
+ document.body.style.position = '';
195
+ document.body.style.top = '';
196
+ document.body.style.width = '';
197
+ document.body.style.overflow = '';
198
+ window.scrollTo(0, scrollY);
110
199
  };
111
- onSettingChange(newState);
112
200
  }
113
- }, [primaryColor, isBrowser, settingRef]);
201
+ }, [searchOptionsShown, isMobile]);
202
+ const sendRouteChange = useCallback(() => {
203
+ if (actor && location?.pathname) {
204
+ actor.send({
205
+ type: 'UISETTING_ROUTE_CHANGE',
206
+ pathname: location?.pathname,
207
+ routePattern: props.routePattern
208
+ });
209
+ }
210
+ }, [actor, location?.pathname, props.routePattern]);
211
+ useEffect(() => {
212
+ sendRouteChange();
213
+ }, [sendRouteChange]);
114
214
  const {
115
215
  ref: refHeader,
116
216
  height: heightHeader
@@ -123,73 +223,139 @@ const BasicLayout = props => {
123
223
  ref: refFooter,
124
224
  height: heightFooter
125
225
  } = useComponentSize();
126
- const [footerFixed, setFooterFixed] = useState(false);
127
226
  useEffect(() => {
128
227
  if (heightHeader && heightBody && heightFooter) {
129
228
  if (heightBody < window.innerHeight - heightHeader - heightFooter) setFooterFixed(true);else setFooterFixed(false);
130
229
  }
131
230
  }, [heightHeader, heightBody, heightFooter]);
132
- useEffect(() => {
133
- const savedTheme = localStorage.getItem('theme');
134
- const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
135
- if (savedTheme === 'dark' || !savedTheme && prefersDark) {
136
- setIsDarkMode(true);
137
- document.documentElement.classList.add('dark');
138
- }
231
+ const {
232
+ componentVisibility
233
+ } = useScrollThreshold([{
234
+ threshold: scrollThreshold,
235
+ id: 'search-bar',
236
+ useWindowScroll: true
237
+ }]);
238
+ const onScrollReachEnd = useCallback(() => {
239
+ setScrollEnd(prevScrollEnd => !prevScrollEnd);
139
240
  }, []);
140
- const toggleTheme = () => {
141
- setIsDarkMode(!isDarkMode);
142
- if (isDarkMode) {
143
- document.documentElement.classList.remove('dark');
144
- localStorage.setItem('theme', 'light');
145
- } else {
146
- document.documentElement.classList.add('dark');
147
- localStorage.setItem('theme', 'dark');
148
- }
149
- };
150
- const toggleSideMenu = () => {
151
- setIsSideMenuOpen(!isSideMenuOpen);
152
- };
153
- const closeSideMenu = () => {
154
- setIsSideMenuOpen(false);
155
- };
156
- return jsx(ThemeContext.Provider, {
157
- value: {
158
- isDarkMode,
159
- toggleTheme
160
- },
161
- children: jsxs("div", {
162
- className: `flex h-screen bg-gray-50 dark:bg-gray-900`,
163
- children: [jsx(Sidebar, {
164
- isSideMenuOpen: isSideMenuOpen,
165
- closeSideMenu: closeSideMenu,
166
- menuData: menuData,
167
- collapsed: children,
168
- routeParams: routeParams,
169
- settings: settings
170
- }), jsxs("div", {
171
- className: "flex flex-col flex-1 w-full",
172
- children: [jsx(GlobalHeader, {
173
- toggleSideMenu: toggleSideMenu,
174
- settings: settings,
175
- upperMenus: getMenuSeparation(menuData).upperMenus,
176
- routeParams: routeParams,
177
- collapsed: collapsed
178
- }), jsx(SettingDrawer, {
179
- primaryColor: primaryColor,
180
- settings: settings,
181
- onSettingChange: onSettingChange
182
- }), jsx("main", {
183
- className: "h-full overflow-y-auto",
184
- children: jsx("div", {
185
- className: "container px-6 mx-auto grid",
186
- children: jsx(Outlet, {})
187
- })
188
- }), jsx(GlobalFooter, {
189
- settings: settings,
190
- active: settings?.showFooter
191
- })]
192
- })]
193
- })
241
+ const horizontalScrollRef = useHorizontalScroll({
242
+ setScrolled,
243
+ setSearchOptionsShown,
244
+ onScrollReachEnd
194
245
  });
195
- };export{BasicLayout,useHorizontalScroll,useTheme};//# sourceMappingURL=index.js.map
246
+ // Helper functions
247
+ function getOverrideValue(path, deviceSettingsRef = deviceSettings) {
248
+ return path.split('.').reduce((obj, key) => obj?.[key], deviceSettingsRef);
249
+ }
250
+ const toggleSideMenu = useCallback(() => {
251
+ setIsSideMenuOpen(prev => !prev);
252
+ }, []);
253
+ const closeSideMenu = useCallback(() => {
254
+ setIsSideMenuOpen(false);
255
+ }, []);
256
+ const handleSettingChange = useCallback(newSettings => {
257
+ if (actor) {
258
+ actor.send({
259
+ type: 'UISETTING_UPDATE',
260
+ value: newSettings
261
+ });
262
+ }
263
+ }, [actor]);
264
+ return React__default.createElement("div", {
265
+ className: backgroundClasses,
266
+ ref: horizontalScrollRef,
267
+ style: backgroundStyle
268
+ }, deviceSettings?.header?.showHeader && !isSideMenuLayout && LAYOUT_ROOT != '/' && React__default.createElement(GlobalHeader, {
269
+ toggleSideMenu: toggleSideMenu,
270
+ settings: settings,
271
+ upperMenus: headerUpperMenus,
272
+ routeParams: memoizedRouteParams,
273
+ collapsed: collapsed,
274
+ location: location
275
+ }), LAYOUT_ROOT === '/' && deviceSettings?.header?.showHeader && React__default.createElement(MainHeader, {
276
+ scrolled: scrolled,
277
+ location: location,
278
+ menuData: memoizedMenuData,
279
+ settings: settings,
280
+ pageTitleInfo: pageTitleInfo,
281
+ searchOptionsShown: searchOptionsShown,
282
+ setSearchOptionsShown: setSearchOptionsShown,
283
+ authorities: authorities,
284
+ picture: picture,
285
+ componentVisibility: componentVisibility,
286
+ showMenu: showMenu,
287
+ toggleSideMenu: toggleSideMenu
288
+ }), React__default.createElement("div", {
289
+ className: "bg-background"
290
+ }, shouldShowSidebar && !isPerplexLayout && React__default.createElement("div", {
291
+ style: sideBarMarginTop ? {
292
+ marginTop: sideBarMarginTop
293
+ } : undefined
294
+ }, React__default.createElement(MainSidebar, {
295
+ isSideMenuOpen: isSideMenuOpen,
296
+ closeSideMenu: closeSideMenu,
297
+ menuData: memoizedMenuData,
298
+ collapsed: collapsed,
299
+ setCollapsed: setCollapsed,
300
+ routeParams: memoizedRouteParams,
301
+ settings: settings,
302
+ siderPinned: siderPinned,
303
+ setSiderPinned: setSiderPinned,
304
+ showHeader: showHeader,
305
+ menuHeaderRender: menuHeaderRender,
306
+ deviceSettings: deviceSettings,
307
+ isSideMenuLayout: isSideMenuLayout
308
+ })), shouldShowSidebar && isPerplexLayout && React__default.createElement("div", {
309
+ style: sideBarMarginTop ? {
310
+ marginTop: sideBarMarginTop
311
+ } : undefined
312
+ }, React__default.createElement(PerplexSidebar, {
313
+ isSideMenuOpen: isSideMenuOpen,
314
+ closeSideMenu: closeSideMenu,
315
+ menuData: memoizedMenuData,
316
+ collapsed: collapsed,
317
+ setCollapsed: setCollapsed,
318
+ routeParams: memoizedRouteParams,
319
+ settings: settings,
320
+ layoutSettings: layoutSettings,
321
+ menuHeaderRender: menuHeaderRender,
322
+ deviceSettings: deviceSettings,
323
+ siderPinned: siderPinned,
324
+ setSiderPinned: setSiderPinned,
325
+ actor: actor,
326
+ sideBarMarginTop: sideBarMarginTop,
327
+ showHeader: showHeader,
328
+ isSideMenuLayout: isSideMenuLayout,
329
+ authorities: authorities,
330
+ picture: picture
331
+ })), React__default.createElement("div", {
332
+ className: "flex flex-col flex-1 bg-background",
333
+ style: {
334
+ marginLeft: computedMarginLeft,
335
+ padding: LAYOUT_ROOT != '/' ? '24px' : '0px'
336
+ }
337
+ }, config.ENABLE_SETTING_DRAWER && React__default.createElement(SettingDrawer, {
338
+ primaryColor: primaryColor,
339
+ settings: settings,
340
+ onSettingChange: handleSettingChange,
341
+ actor: actor,
342
+ colorList: themeColors,
343
+ fullMenuData: fullMenuData,
344
+ location: location,
345
+ routePattern: props.routePattern
346
+ }), React__default.createElement("main", {
347
+ className: "relative"
348
+ }, searchOptionsShown && deviceSettings?.header?.searchBarOverlay && React__default.createElement("div", {
349
+ className: "fixed inset-0 bg-black bg-opacity-50 z-30 cursor-pointer",
350
+ onClick: e => {
351
+ e.stopPropagation();
352
+ setSearchOptionsShown(false);
353
+ }
354
+ }), React__default.createElement(Outlet, null)), getOverrideValue('footer.showFooter') && React__default.createElement("div", {
355
+ ref: refFooter,
356
+ className: footerFixed ? 'fixed bottom-0 w-full' : ''
357
+ }, React__default.createElement(FooterSlot, {
358
+ settings: settings,
359
+ active: footerActive
360
+ })))));
361
+ }export{BasicLayout,useHorizontalScroll};//# sourceMappingURL=index.js.map