@admin-layout/tailwind-design-pro 12.0.16-alpha.7 → 12.0.16-alpha.71

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 (182) hide show
  1. package/README.md +20 -0
  2. package/lib/cdm-locales/en/menu.json +2 -1
  3. package/lib/cdm-locales/es/menu.json +2 -1
  4. package/lib/cdm-locales/index.d.ts +2 -0
  5. package/lib/cdm-locales/index.d.ts.map +1 -0
  6. package/lib/cdm-locales/index.ts +1 -0
  7. package/lib/components/LanguageMenu/LanguageMenu.js.map +1 -1
  8. package/lib/components/Layout/BasicLayout/index.d.ts +2 -1
  9. package/lib/components/Layout/BasicLayout/index.d.ts.map +1 -1
  10. package/lib/components/Layout/BasicLayout/index.js +134 -44
  11. package/lib/components/Layout/BasicLayout/index.js.map +1 -1
  12. package/lib/components/Layout/BasicLayout/utils.d.ts +2 -0
  13. package/lib/components/Layout/BasicLayout/utils.d.ts.map +1 -1
  14. package/lib/components/Layout/BasicLayout/utils.js +16 -13
  15. package/lib/components/Layout/BasicLayout/utils.js.map +1 -1
  16. package/lib/components/Layout/GlobalFooter/Account.d.ts +4 -0
  17. package/lib/components/Layout/GlobalFooter/Account.d.ts.map +1 -0
  18. package/lib/components/Layout/GlobalFooter/BottomMenuDropdown.d.ts.map +1 -1
  19. package/lib/components/Layout/GlobalFooter/BottomMenuDropdown.js +7 -12
  20. package/lib/components/Layout/GlobalFooter/BottomMenuDropdown.js.map +1 -1
  21. package/lib/components/Layout/GlobalHeader/Header.d.ts.map +1 -1
  22. package/lib/components/Layout/GlobalHeader/Header.js +31 -8
  23. package/lib/components/Layout/GlobalHeader/Header.js.map +1 -1
  24. package/lib/components/Layout/GlobalHeader/MainHeader.d.ts +0 -2
  25. package/lib/components/Layout/GlobalHeader/MainHeader.d.ts.map +1 -1
  26. package/lib/components/Layout/GlobalHeader/MainHeader.js +54 -85
  27. package/lib/components/Layout/GlobalHeader/MainHeader.js.map +1 -1
  28. package/lib/components/Layout/GlobalHeader/OrganizationDropdown.js +1 -1
  29. package/lib/components/Layout/GlobalHeader/OrganizationDropdown.js.map +1 -1
  30. package/lib/components/Layout/GlobalHeader/RightContent.d.ts +1 -0
  31. package/lib/components/Layout/GlobalHeader/RightContent.d.ts.map +1 -1
  32. package/lib/components/Layout/GlobalHeader/RightContent.js +73 -6
  33. package/lib/components/Layout/GlobalHeader/RightContent.js.map +1 -1
  34. package/lib/components/Layout/GlobalHeader/RightMenu.d.ts.map +1 -1
  35. package/lib/components/Layout/GlobalHeader/RightMenu.js +2 -4
  36. package/lib/components/Layout/GlobalHeader/RightMenu.js.map +1 -1
  37. package/lib/components/Layout/GlobalHeader/SearchBar.js.map +1 -1
  38. package/lib/components/Layout/GlobalHeader/index.d.ts +0 -1
  39. package/lib/components/Layout/GlobalHeader/index.d.ts.map +1 -1
  40. package/lib/components/Layout/ProTailwindLayout.d.ts +2 -2
  41. package/lib/components/Layout/ProTailwindLayout.d.ts.map +1 -1
  42. package/lib/components/Layout/ProTailwindLayout.js +69 -7
  43. package/lib/components/Layout/ProTailwindLayout.js.map +1 -1
  44. package/lib/components/Layout/Sidebar/BottomMenu.d.ts +4 -0
  45. package/lib/components/Layout/Sidebar/BottomMenu.d.ts.map +1 -0
  46. package/lib/components/Layout/Sidebar/BottomMenu.js +330 -0
  47. package/lib/components/Layout/Sidebar/BottomMenu.js.map +1 -0
  48. package/lib/components/Layout/Sidebar/Divider.js.map +1 -1
  49. package/lib/components/Layout/Sidebar/DynamicIcon.js.map +1 -1
  50. package/lib/components/Layout/Sidebar/MainSidebar.d.ts +5 -0
  51. package/lib/components/Layout/Sidebar/MainSidebar.d.ts.map +1 -0
  52. package/lib/components/Layout/Sidebar/{Sidebar.js → MainSidebar.js} +94 -34
  53. package/lib/components/Layout/Sidebar/MainSidebar.js.map +1 -0
  54. package/lib/components/Layout/Sidebar/MainSidebarMenu.d.ts +4 -0
  55. package/lib/components/Layout/Sidebar/MainSidebarMenu.d.ts.map +1 -0
  56. package/lib/components/Layout/Sidebar/MainSidebarMenu.js +291 -0
  57. package/lib/components/Layout/Sidebar/MainSidebarMenu.js.map +1 -0
  58. package/lib/components/Layout/Sidebar/PerplexSidebar.d.ts +5 -0
  59. package/lib/components/Layout/Sidebar/PerplexSidebar.d.ts.map +1 -0
  60. package/lib/components/Layout/Sidebar/PerplexSidebar.js +277 -0
  61. package/lib/components/Layout/Sidebar/PerplexSidebar.js.map +1 -0
  62. package/lib/components/Layout/Sidebar/PerplexSidebarMenu.d.ts +4 -0
  63. package/lib/components/Layout/Sidebar/PerplexSidebarMenu.d.ts.map +1 -0
  64. package/lib/components/Layout/Sidebar/PerplexSidebarMenu.js +330 -0
  65. package/lib/components/Layout/Sidebar/PerplexSidebarMenu.js.map +1 -0
  66. package/lib/components/Layout/TailwindLayout.d.ts.map +1 -1
  67. package/lib/components/Layout/TailwindLayout.js +37 -10
  68. package/lib/components/Layout/TailwindLayout.js.map +1 -1
  69. package/lib/components/Layout/getPageTitle.js.map +1 -1
  70. package/lib/components/Layout/slot-fill/AdditionalSettings.js.map +1 -1
  71. package/lib/components/Layout/slot-fill/Footer.js.map +1 -1
  72. package/lib/components/Layout/slot-fill/HeaderSearchBar.js.map +1 -1
  73. package/lib/components/Layout/slot-fill/HeaderSearchButton.js.map +1 -1
  74. package/lib/components/Layout/slot-fill/Logo.d.ts +4 -0
  75. package/lib/components/Layout/slot-fill/Logo.d.ts.map +1 -0
  76. package/lib/components/Layout/slot-fill/Logo.js +7 -0
  77. package/lib/components/Layout/slot-fill/Logo.js.map +1 -0
  78. package/lib/components/Layout/slot-fill/RightContent.js.map +1 -1
  79. package/lib/components/Layout/slot-fill/SideMenuLogo.d.ts +4 -0
  80. package/lib/components/Layout/slot-fill/SideMenuLogo.d.ts.map +1 -0
  81. package/lib/components/Layout/slot-fill/SideMenuLogo.js +7 -0
  82. package/lib/components/Layout/slot-fill/SideMenuLogo.js.map +1 -0
  83. package/lib/components/Layout/slot-fill/index.d.ts +2 -0
  84. package/lib/components/Layout/slot-fill/index.d.ts.map +1 -1
  85. package/lib/components/Layout/util.js +1 -1
  86. package/lib/components/Layout/util.js.map +1 -1
  87. package/lib/components/SettingDrawer/CheckBoxTheme.d.ts.map +1 -1
  88. package/lib/components/SettingDrawer/CheckBoxTheme.js +13 -3
  89. package/lib/components/SettingDrawer/CheckBoxTheme.js.map +1 -1
  90. package/lib/components/SettingDrawer/InvitationSettings.d.ts.map +1 -1
  91. package/lib/components/SettingDrawer/InvitationSettings.js +10 -6
  92. package/lib/components/SettingDrawer/InvitationSettings.js.map +1 -1
  93. package/lib/components/SettingDrawer/LayoutChange.d.ts.map +1 -1
  94. package/lib/components/SettingDrawer/LayoutChange.js +23 -16
  95. package/lib/components/SettingDrawer/LayoutChange.js.map +1 -1
  96. package/lib/components/SettingDrawer/MenuVisibilitySettings.d.ts +20 -0
  97. package/lib/components/SettingDrawer/MenuVisibilitySettings.d.ts.map +1 -0
  98. package/lib/components/SettingDrawer/MenuVisibilitySettings.js +120 -0
  99. package/lib/components/SettingDrawer/MenuVisibilitySettings.js.map +1 -0
  100. package/lib/components/SettingDrawer/NavigationsModes.d.ts +1 -1
  101. package/lib/components/SettingDrawer/NavigationsModes.d.ts.map +1 -1
  102. package/lib/components/SettingDrawer/NavigationsModes.js +90 -39
  103. package/lib/components/SettingDrawer/NavigationsModes.js.map +1 -1
  104. package/lib/components/SettingDrawer/RegionalSettings.d.ts.map +1 -1
  105. package/lib/components/SettingDrawer/RegionalSettings.js +54 -177
  106. package/lib/components/SettingDrawer/RegionalSettings.js.map +1 -1
  107. package/lib/components/SettingDrawer/SettingDrawer.d.ts.map +1 -1
  108. package/lib/components/SettingDrawer/SettingDrawer.js +404 -66
  109. package/lib/components/SettingDrawer/SettingDrawer.js.map +1 -1
  110. package/lib/components/SettingDrawer/Switch/index.js.map +1 -1
  111. package/lib/components/SettingDrawer/ThemeColor.d.ts.map +1 -1
  112. package/lib/components/SettingDrawer/ThemeColor.js +15 -3
  113. package/lib/components/SettingDrawer/ThemeColor.js.map +1 -1
  114. package/lib/components/SettingDrawer/types.d.ts +12 -0
  115. package/lib/components/SettingDrawer/types.d.ts.map +1 -1
  116. package/lib/components/UpdateSettingsResource/UpdateSettingsResource.server.d.ts +10 -5
  117. package/lib/components/UpdateSettingsResource/UpdateSettingsResource.server.d.ts.map +1 -1
  118. package/lib/components/UpdateSettingsResource/UpdateSettingsResource.server.js +97 -4
  119. package/lib/components/UpdateSettingsResource/UpdateSettingsResource.server.js.map +1 -1
  120. package/lib/components/index.js +1 -1
  121. package/lib/components/typings.d.ts +20 -1
  122. package/lib/components/typings.d.ts.map +1 -1
  123. package/lib/compute.d.ts.map +1 -1
  124. package/lib/compute.js +10 -2
  125. package/lib/compute.js.map +1 -1
  126. package/lib/config/constants.js.map +1 -1
  127. package/lib/config/env-config.d.ts +3 -0
  128. package/lib/config/env-config.d.ts.map +1 -1
  129. package/lib/config/env-config.js +10 -0
  130. package/lib/config/env-config.js.map +1 -1
  131. package/lib/helpers/DynamicIcon.js.map +1 -1
  132. package/lib/hooks/useMediaQuery.js.map +1 -1
  133. package/lib/hooks/useScrollThreshold.js.map +1 -1
  134. package/lib/hooks/useTailwindTheme.js +82 -0
  135. package/lib/hooks/useTailwindTheme.js.map +1 -0
  136. package/lib/icons.d.ts +2 -0
  137. package/lib/icons.d.ts.map +1 -1
  138. package/lib/icons.js +4 -2
  139. package/lib/icons.js.map +1 -1
  140. package/lib/index.d.ts +1 -0
  141. package/lib/index.d.ts.map +1 -1
  142. package/lib/index.js +1 -1
  143. package/lib/index.js.map +1 -1
  144. package/lib/machines/selectors.d.ts +118 -0
  145. package/lib/machines/selectors.d.ts.map +1 -0
  146. package/lib/machines/settingsMachine.d.ts +25 -2
  147. package/lib/machines/settingsMachine.d.ts.map +1 -1
  148. package/lib/machines/settingsMachine.js +174 -163
  149. package/lib/machines/settingsMachine.js.map +1 -1
  150. package/lib/machines/settingsMachine.test.d.ts +2 -0
  151. package/lib/machines/settingsMachine.test.d.ts.map +1 -0
  152. package/lib/machines/types.d.ts +106 -9
  153. package/lib/machines/types.d.ts.map +1 -1
  154. package/lib/machines/types.js.map +1 -1
  155. package/lib/module.js.map +1 -1
  156. package/lib/redux/searchReducer.js.map +1 -1
  157. package/lib/routes.json +9 -1
  158. package/lib/tailwindConfig.js.map +1 -1
  159. package/lib/utils/__tests__/configOverrides.test.d.ts +2 -0
  160. package/lib/utils/__tests__/configOverrides.test.d.ts.map +1 -0
  161. package/lib/utils/configOverrides.d.ts +213 -0
  162. package/lib/utils/configOverrides.d.ts.map +1 -0
  163. package/lib/utils/configOverrides.js +91 -0
  164. package/lib/utils/configOverrides.js.map +1 -0
  165. package/lib/utils/isBrowser/index.js.map +1 -1
  166. package/lib/utils/settingsUtils.d.ts +20 -0
  167. package/lib/utils/settingsUtils.d.ts.map +1 -0
  168. package/lib/utils/settingsUtils.js +74 -0
  169. package/lib/utils/settingsUtils.js.map +1 -0
  170. package/lib/utils/utils/index.js.map +1 -1
  171. package/package.json +6 -6
  172. package/lib/components/Layout/GlobalHeader/Logo.d.ts +0 -4
  173. package/lib/components/Layout/GlobalHeader/Logo.d.ts.map +0 -1
  174. package/lib/components/Layout/GlobalHeader/Logo.js +0 -141
  175. package/lib/components/Layout/GlobalHeader/Logo.js.map +0 -1
  176. package/lib/components/Layout/Sidebar/Sidebar.d.ts +0 -5
  177. package/lib/components/Layout/Sidebar/Sidebar.d.ts.map +0 -1
  178. package/lib/components/Layout/Sidebar/Sidebar.js.map +0 -1
  179. package/lib/components/Layout/Sidebar/SidebarMenu.d.ts +0 -4
  180. package/lib/components/Layout/Sidebar/SidebarMenu.d.ts.map +0 -1
  181. package/lib/components/Layout/Sidebar/SidebarMenu.js +0 -176
  182. package/lib/components/Layout/Sidebar/SidebarMenu.js.map +0 -1
@@ -0,0 +1,330 @@
1
+ import {jsxs,jsx}from'react/jsx-runtime';import React__default,{useState,useRef}from'react';import {useSelector}from'@xstate/react';import {useLocation,Link}from'@remix-run/react';import {generateMenuPath}from'@admin-layout/client';import {icons}from'../../../icons.js';const PerplexSidebarMenu = ({
2
+ menuData,
3
+ routeParams,
4
+ settings,
5
+ collapsed,
6
+ siderPinned,
7
+ setSiderPinned,
8
+ actor,
9
+ deviceSettings = {} // Provide empty object as default
10
+ }) => {
11
+ const [openMenus, setOpenMenus] = useState([]);
12
+ const [hoveredMenu, setHoveredMenu] = useState(null);
13
+ const [activeMenuItem, setActiveMenuItem] = useState(null);
14
+ const [popupPosition, setPopupPosition] = useState({
15
+ top: 0,
16
+ height: 0
17
+ });
18
+ const [menuTransition, setMenuTransition] = useState('opening');
19
+ const [flyoutVisible, setFlyoutVisible] = useState(false);
20
+ const hoverCloseTimeout = React__default.useRef(null);
21
+ const hoverOpenTimeout = React__default.useRef(null);
22
+ const currentHoveredMenu = useRef(null);
23
+ const {
24
+ PushpinLineIcon,
25
+ PushpinFillIcon
26
+ } = icons;
27
+ const location = useLocation();
28
+ const machineState = useSelector(actor, state => state);
29
+ const pinnedPath = machineState?.context?.sidebar?.pinnedPath || null;
30
+ // Extract showHeader with fallback to true if not defined
31
+ const showHeader = deviceSettings && deviceSettings.header && deviceSettings.header.showHeader !== undefined ? deviceSettings.header.showHeader : true;
32
+ const isMenuItemActive = itemPath => {
33
+ const currentPath = location.pathname;
34
+ const menuPath = generateMenuPath(itemPath, routeParams);
35
+ // Exact match
36
+ if (currentPath === menuPath) {
37
+ return true;
38
+ }
39
+ // Check if current path is a child of the menu item path
40
+ if (menuPath && currentPath.startsWith(menuPath + '/')) {
41
+ return true;
42
+ }
43
+ return false;
44
+ };
45
+ const toggleMenu = (path, depth, e) => {
46
+ e.preventDefault();
47
+ if (collapsed) return;
48
+ setOpenMenus(prev => {
49
+ if (prev.includes(path)) {
50
+ return prev.filter(item => item !== path);
51
+ } else {
52
+ return [...prev, path];
53
+ }
54
+ });
55
+ };
56
+ const handleMenuClick = (path, hasChildren, depth, e) => {
57
+ if (hasChildren && !collapsed) {
58
+ toggleMenu(path, depth, e);
59
+ }
60
+ };
61
+ const getFirstLetter = name => {
62
+ return name.charAt(0).toUpperCase();
63
+ };
64
+ const getFirstWord = name => {
65
+ if (!name) return '';
66
+ const parts = name.trim().split(/\s+/);
67
+ return parts[0] || name;
68
+ };
69
+ const handleMenuHover = (e, item, isHoverMenu, depth = 0) => {
70
+ // Only set hover state if the menu has children
71
+ const canShowHoverPopup = collapsed && !isHoverMenu || !collapsed && depth === 0 && !isHoverMenu;
72
+ if (item.children && item.children.length > 0 && canShowHoverPopup) {
73
+ const element = e.currentTarget;
74
+ const rect = element.getBoundingClientRect();
75
+ // Calculate position ensuring it stays within viewport roughly
76
+ const viewportHeight = window.innerHeight;
77
+ let top = rect.top;
78
+ const maxTop = Math.max(8, viewportHeight - 300); // crude lower bound to avoid going off screen
79
+ if (top > maxTop) top = maxTop;
80
+ setPopupPosition({
81
+ top: top,
82
+ height: rect.height
83
+ });
84
+ // Clear any existing timeouts
85
+ if (hoverCloseTimeout.current) {
86
+ window.clearTimeout(hoverCloseTimeout.current);
87
+ hoverCloseTimeout.current = null;
88
+ }
89
+ if (hoverOpenTimeout.current) {
90
+ window.clearTimeout(hoverOpenTimeout.current);
91
+ hoverOpenTimeout.current = null;
92
+ }
93
+ currentHoveredMenu.current = item.path;
94
+ // Update which item is being hovered and its children data
95
+ if (hoveredMenu !== item.path) {
96
+ // Update the active menu item data first
97
+ setActiveMenuItem(item);
98
+ // If we're already showing a menu, just update content without closing/reopening
99
+ if (flyoutVisible) {
100
+ // Just update the hovered menu path without animation
101
+ setHoveredMenu(item.path);
102
+ } else {
103
+ // No flyout visible yet, show it with animation
104
+ setMenuTransition('opening');
105
+ setFlyoutVisible(true);
106
+ setHoveredMenu(item.path);
107
+ }
108
+ }
109
+ // If a different top-level item is hovered while pinned, update pinnedPath
110
+ if (depth === 0 && pinnedPath) {
111
+ actor?.send({
112
+ type: 'UISETTING_UPDATE',
113
+ value: {
114
+ 'sidebar.pinnedPath': item.path
115
+ }
116
+ });
117
+ }
118
+ }
119
+ };
120
+ const handleMenuLeave = (item, isHoverMenu) => {
121
+ if (!isHoverMenu) {
122
+ // Clear any existing timeouts
123
+ if (hoverCloseTimeout.current) {
124
+ window.clearTimeout(hoverCloseTimeout.current);
125
+ }
126
+ if (hoverOpenTimeout.current) {
127
+ window.clearTimeout(hoverOpenTimeout.current);
128
+ hoverOpenTimeout.current = null;
129
+ }
130
+ currentHoveredMenu.current = null;
131
+ // Add a longer delay before closing the menu
132
+ hoverCloseTimeout.current = window.setTimeout(() => {
133
+ if (!currentHoveredMenu.current) {
134
+ // Only close if we're not currently hovering any menu
135
+ setMenuTransition('closing');
136
+ // Additional delay to complete closing animation
137
+ setTimeout(() => {
138
+ if (!currentHoveredMenu.current) {
139
+ setFlyoutVisible(false);
140
+ setHoveredMenu(null);
141
+ }
142
+ }, 150);
143
+ }
144
+ }, 300); // Extended delay to give more time to move between items
145
+ }
146
+ };
147
+ const toggleSiderPinned = (e, path) => {
148
+ e.preventDefault();
149
+ e.stopPropagation();
150
+ const nextPinned = pinnedPath === path ? null : path;
151
+ actor?.send({
152
+ type: 'UISETTING_UPDATE',
153
+ value: {
154
+ 'sidebar.pinnedPath': nextPinned
155
+ }
156
+ });
157
+ // Find the menu item by path and set it as active
158
+ if (nextPinned) {
159
+ const findItemByPath = (items, targetPath) => {
160
+ for (const item of items) {
161
+ if (item.path === targetPath) return item;
162
+ if (item.children) {
163
+ const found = findItemByPath(item.children, targetPath);
164
+ if (found) return found;
165
+ }
166
+ }
167
+ return null;
168
+ };
169
+ const menuItem = findItemByPath(menuData, path);
170
+ if (menuItem) {
171
+ setActiveMenuItem(menuItem);
172
+ setHoveredMenu(path);
173
+ setFlyoutVisible(true);
174
+ }
175
+ } else {
176
+ setFlyoutVisible(false);
177
+ setHoveredMenu(null);
178
+ }
179
+ setSiderPinned(!siderPinned);
180
+ };
181
+ // Single persistent flyout component for all menus
182
+ const renderSingleFlyout = () => {
183
+ if (!flyoutVisible || !activeMenuItem) return null;
184
+ const sidebarWidth = 92; // Updated fixed sidebar rail width
185
+ const item = activeMenuItem; // Use the currently active menu item
186
+ return jsxs("div", {
187
+ className: `fixed border border-border z-[999] overflow-hidden bg-background menu-${menuTransition}`,
188
+ style: {
189
+ left: `${sidebarWidth}px`,
190
+ top: !showHeader ? '0px' : '5rem',
191
+ height: !showHeader ? '100vh' : 'calc(100vh - 5rem)',
192
+ width: '228px',
193
+ maxWidth: 'calc(100vw - 100px)',
194
+ pointerEvents: menuTransition === 'closing' ? 'none' : 'auto'
195
+ },
196
+ onMouseEnter: () => {
197
+ if (hoverCloseTimeout.current) {
198
+ window.clearTimeout(hoverCloseTimeout.current);
199
+ hoverCloseTimeout.current = null;
200
+ }
201
+ // Keep the flyout open while hovering it
202
+ },
203
+ onMouseLeave: () => {
204
+ if (pinnedPath === item.path) return; // don't close if pinned
205
+ if (hoverCloseTimeout.current) {
206
+ window.clearTimeout(hoverCloseTimeout.current);
207
+ }
208
+ currentHoveredMenu.current = null;
209
+ setMenuTransition('closing');
210
+ hoverCloseTimeout.current = window.setTimeout(() => {
211
+ if (!currentHoveredMenu.current) {
212
+ setFlyoutVisible(false);
213
+ setHoveredMenu(null);
214
+ }
215
+ }, 150);
216
+ },
217
+ children: [jsx("style", {
218
+ dangerouslySetInnerHTML: {
219
+ __html: `
220
+ @keyframes fadeIn {
221
+ from { opacity: 0; transform: translateX(-10px); }
222
+ to { opacity: 1; transform: translateX(0); }
223
+ }
224
+ @keyframes fadeOut {
225
+ from { opacity: 1; transform: translateX(0); }
226
+ to { opacity: 0; transform: translateX(-10px); }
227
+ }
228
+ .menu-opening {
229
+ animation: fadeIn 0.15s ease-out forwards;
230
+ }
231
+ .menu-closing {
232
+ animation: fadeOut 0.15s ease-in forwards;
233
+ }
234
+ `
235
+ }
236
+ }), jsxs("div", {
237
+ className: "font-medium text-sm px-3 py-2 border-b border-border bg-muted sticky top-0 flex items-center justify-between",
238
+ children: [jsx("span", {
239
+ className: "text-primary whitespace-nowrap overflow-hidden text-ellipsis pr-2",
240
+ children: item.name
241
+ }), jsx("button", {
242
+ className: "text-muted-foreground hover:text-primary transition-colors",
243
+ "aria-label": pinnedPath === item.path ? 'Unpin' : 'Pin',
244
+ onClick: e => toggleSiderPinned(e, item.path),
245
+ children: pinnedPath === item.path ? jsx(PushpinFillIcon, {
246
+ className: "h-4 w-4"
247
+ }) : jsx(PushpinLineIcon, {
248
+ className: "h-4 w-4"
249
+ })
250
+ })]
251
+ }), jsx("div", {
252
+ className: "overflow-y-auto overflow-x-hidden py-1",
253
+ style: {
254
+ height: !showHeader ? 'calc(100vh - 44px)' : 'calc(100vh - 5rem - 44px)'
255
+ },
256
+ children: item.children?.map(child => jsx("div", {
257
+ className: "w-full min-w-max",
258
+ children: renderMenuItem(child, 1, true)
259
+ }, child.path))
260
+ })]
261
+ });
262
+ };
263
+ const renderMenuItem = (item, depth = 0, isHoverMenu = false) => {
264
+ const hasChildren = item.children && item.children.length > 0;
265
+ const isOpen = openMenus.includes(item.path);
266
+ const isActive = isMenuItemActive(item.path);
267
+ const isHovered = hoveredMenu === item.path;
268
+ const paddingLeft = `${depth * 1}rem`;
269
+ // Determine styling based on whether it's a parent or child item
270
+ const isParentWithChildren = hasChildren && depth === 0;
271
+ const shouldApplyBackground = isHovered || !isParentWithChildren && isActive;
272
+ return jsxs("div", {
273
+ className: `w-full relative group ${isHovered && collapsed && !isHoverMenu ? `rounded-themed` : ''}`,
274
+ style: {
275
+ backgroundColor: isHovered && !isHoverMenu ? 'hsl(var(--muted))' : ''
276
+ },
277
+ onMouseEnter: e => handleMenuHover(e, item, isHoverMenu, depth),
278
+ onMouseLeave: () => handleMenuLeave(item, isHoverMenu),
279
+ children: [depth === 0 && (isActive || isParentWithChildren && isHovered) && jsx("span", {
280
+ className: "absolute left-0 top-1 bottom-1 w-0.5 bg-primary rounded-sm"
281
+ }), jsx(Link, {
282
+ to: hasChildren && (collapsed || !collapsed && depth === 0) && !isHoverMenu ? '#' : generateMenuPath(item?.path, routeParams),
283
+ className: `flex items-center justify-between w-full px-1 py-2 hover:bg-muted text-xs cursor-pointer transition-colors rounded-themed mx-1 my-1 whitespace-nowrap overflow-hidden text-ellipsis ${shouldApplyBackground ? 'bg-muted' : ''}`,
284
+ style: {
285
+ paddingLeft: depth === 0 && !isHoverMenu ? '0.25rem' : `calc(1rem + ${paddingLeft})`
286
+ },
287
+ onClick: e => handleMenuClick(item.path, hasChildren && depth > 0, depth, e),
288
+ children: jsxs("div", {
289
+ className: `flex ${depth === 0 && !isHoverMenu ? 'flex-col items-center justify-center w-full gap-1' : 'items-center gap-3'}`,
290
+ children: [item.icon ? jsx("span", {
291
+ className: `flex-shrink-0 ${isActive ? 'text-primary' : 'text-muted-foreground'} ${depth === 0 && !isHoverMenu ? 'text-[20px]' : ''}`,
292
+ style: {
293
+ color: !isActive && settings?.navTheme === 'realDark' ? '#fff' : undefined
294
+ },
295
+ children: item.icon
296
+ }) : jsx("span", {
297
+ className: `flex items-center justify-center flex-shrink-0 ${isActive ? 'text-primary' : 'text-muted-foreground'} ${depth === 0 && !isHoverMenu ? 'text-[16px] h-6 w-6 rounded-md bg-muted select-none text-center' : ''}`,
298
+ style: {
299
+ color: !isActive && settings?.navTheme === 'realDark' ? '#fff' : undefined
300
+ },
301
+ children: getFirstLetter(item.name)
302
+ }), depth === 0 && !isHoverMenu ? jsx("span", {
303
+ className: `font-medium text-[11px] leading-4 text-center whitespace-nowrap overflow-hidden text-ellipsis w-full px-1 ${isActive ? 'text-primary' : 'text-foreground'}`,
304
+ style: {
305
+ color: !isActive && settings?.navTheme === 'realDark' ? '#fff' : undefined
306
+ },
307
+ title: item.name,
308
+ children: getFirstWord(item.name)
309
+ }) : (!collapsed || isHoverMenu) && jsx("span", {
310
+ className: `font-medium whitespace-nowrap overflow-hidden text-ellipsis ${isActive ? 'text-primary' : 'text-foreground'}`,
311
+ style: {
312
+ color: !isActive && settings?.navTheme === 'realDark' ? '#fff' : undefined
313
+ },
314
+ children: item.name
315
+ })]
316
+ })
317
+ }), hasChildren && isOpen && !collapsed && depth > 0 && jsx("div", {
318
+ className: "transition-all duration-200 ease-in-out bg-background",
319
+ children: item.children.map(child => renderMenuItem(child, depth + 1))
320
+ })]
321
+ }, item.path);
322
+ };
323
+ return jsxs("div", {
324
+ className: "overflow-hidden",
325
+ children: [jsx("nav", {
326
+ className: `mt-2 ${collapsed ? 'px-1' : 'px-2'} overflow-x-hidden`,
327
+ children: menuData.map(item => renderMenuItem(item))
328
+ }), renderSingleFlyout()]
329
+ });
330
+ };export{PerplexSidebarMenu};//# sourceMappingURL=PerplexSidebarMenu.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PerplexSidebarMenu.js","sources":["../../../../src/components/Layout/Sidebar/PerplexSidebarMenu.tsx"],"sourcesContent":[null],"names":["React","_jsxs","_jsx"],"mappings":"8QAQO,MAAM,kBAAkB,GAA+B,CAAC;AAS9D,EAAA,QAAI;aACM;UACD;WACC;AACP,EAAA,WAAO;gBACA;OACP;gBACM,GAAA,EAAA;MACN;AACA,EAAA,MAAA,CAAA,uBAA2B,CAAA,GAAA,QAA4B,CAAA,EAAA,CAAA;QACvD,CAAA,WAAQ,EAAA,cAAiB,CAAA,GAAA,QAAe,CAAA,IAAA,CAAA;AACxC,EAAA,MAAA,CAAA,cAAiB,EAAA,iBAAc,CAAA,GAAA,QAAA,CAAA,IAAA,CAAA;AAC/B,EAAA,MAAA,CAAA,aAAkB,EAAA,gBAAe,CAAA,GAAO,QAAQ,CAAA;IAChD,GAAA,EAAA,CAAM;IACN,MAAA,EAAA;AACA,GAAA,CAAA;AAEQ,EAAA,MAAA,CAAC,cAAC,EAAe,iBAAiB,CAAA,GAAA,QAAA,CAAA,SAAA,CAAA;QAClC,CAAC,aAAM,EAAA,gBAAA,CAAA,GAAA,QAAA,CAAA,KAAA,CAAA;AAEf,EAAA,MAAA,iBAAM,GAAgBA,cAAI,CAAA,MAAkB,CAAA,IAAE,CAAA;AAC1C,EAAA,MAAA,gBAAM,GA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AAE,CAAA,EAAAA,GAAA,CAAA,KAAA,EAAA;AAEF,QAAA,SACI,EAAA,wCAAgC;AAQxC,QAAE,KAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"TailwindLayout.d.ts","sourceRoot":"","sources":["../../../src/components/Layout/TailwindLayout.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAqB,MAAM,sBAAsB,CAAC;AAG3E,OAAO,KAA+B,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAwB,MAAM,aAAa,CAAC;AAsEvF,KAAK,cAAc,GAAG,cAAc,CAAC,OAAO,SAAS,CAAC,CAAC;AAEvD,QAAA,MAAM,SAAS;;;0EAAoB,CAAC;AAEpC,KAAK,+BAA+B,GAAG,gBAAgB,GAAG,cAAc,CAAC;AAEzE,QAAA,MAAM,mBAAmB,EAAE,kBAAkB,CACzC,KAAK,CAAC,mBAAmB,CAAC,CAAC,KAAK,EAAE,+BAA+B,KAAK,GAAG,CAAC,OAAO,CAAC,EAClF,GAAG,CAC8C,CAAC;AAEtD,eAAe,mBAAmB,CAAC"}
1
+ {"version":3,"file":"TailwindLayout.d.ts","sourceRoot":"","sources":["../../../src/components/Layout/TailwindLayout.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAqB,MAAM,sBAAsB,CAAC;AAK3E,OAAO,KAA+B,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAwB,MAAM,aAAa,CAAC;AA8FvF,KAAK,cAAc,GAAG,cAAc,CAAC,OAAO,SAAS,CAAC,CAAC;AAEvD,QAAA,MAAM,SAAS;;;0EAAoB,CAAC;AAEpC,KAAK,+BAA+B,GAAG,gBAAgB,GAAG,cAAc,CAAC;AAEzE,QAAA,MAAM,mBAAmB,EAAE,kBAAkB,CACzC,KAAK,CAAC,mBAAmB,CAAC,CAAC,KAAK,EAAE,+BAA+B,KAAK,GAAG,CAAC,OAAO,CAAC,EAClF,GAAG,CAC8C,CAAC;AAEtD,eAAe,mBAAmB,CAAC"}
@@ -1,32 +1,56 @@
1
- import {jsx}from'react/jsx-runtime';import {useLayoutSettings}from'@admin-layout/client';import {userSelector}from'@adminide-stack/user-auth0-client';import {useMachine}from'@xstate/react';import React__default,{useMemo,useCallback}from'react';import {connect,useSelector}from'react-redux';import {settingsMachine}from'../../machines/settingsMachine.js';import {TailwindThemeProvider}from'@admin-layout/tailwind-ui';import {BasicLayout}from'./BasicLayout/index.js';import {useRouteLoaderData}from'@remix-run/react';function BasicLayoutWithAuthorities(props) {
1
+ import {jsx}from'react/jsx-runtime';import {useLayoutSettings}from'@admin-layout/client';import {TailwindThemeProvider}from'@admin-layout/tailwind-ui';import {userSelector}from'@adminide-stack/user-auth0-client';import {useLocation,useRouteLoaderData,useMatches}from'@remix-run/react';import {useMachine}from'@xstate/react';import React__default,{useMemo,useCallback}from'react';import {connect,useSelector}from'react-redux';import {settingsMachine}from'../../machines/settingsMachine.js';import {BasicLayout}from'./BasicLayout/index.js';function BasicLayoutWithAuthorities(props) {
2
2
  const userData = useSelector(userSelector);
3
+ const location = useLocation();
3
4
  const {
4
5
  settings: settingsFromLoader
5
6
  } = useRouteLoaderData('root');
6
7
  const {
7
- settings,
8
+ settings: reduxSettings,
8
9
  setSettings
9
10
  } = useLayoutSettings();
11
+ const matches = useMatches();
12
+ const current = matches[matches.length - 1];
13
+ // Use settingsFromLoader if available, fallback to Redux settings
14
+ // This ensures the machine always has valid settings input
15
+ const initialSettings = settingsFromLoader || reduxSettings;
10
16
  const [state, send, settingsActor] = useMachine(settingsMachine.provide({
11
17
  actions: {
12
18
  updateReduxSettings: ({
13
- context
19
+ context,
20
+ event
14
21
  }) => {
15
- setSettings(context);
22
+ console.log('🔥 updateReduxSettings called', {
23
+ context,
24
+ event
25
+ });
26
+ // REVOLUTIONARY APPROACH: No filtering needed!
27
+ // The context is already separated into public and internal namespaces.
28
+ // We simply sync context.public to Redux - that's it!
29
+ //
30
+ // WHY THIS ELIMINATES LOOPS:
31
+ // - context.public contains ONLY user-facing settings
32
+ // - context.internal.configModel changes don't affect context.public
33
+ // - No manual filtering means no chance of mistakes
34
+ // - Type system enforces the separation at compile time
35
+ const publicSettings = context.public;
36
+ setSettings(publicSettings);
16
37
  }
17
38
  }
18
39
  }), {
19
40
  input: {
20
- settings: settingsFromLoader
41
+ settings: initialSettings,
42
+ currentRoute: location.pathname,
43
+ routePattern: current?.id
21
44
  }
22
45
  });
23
- const settingXstate = state?.context;
46
+ // Access public settings only - internal state is never exposed
47
+ const settingXstate = state?.context?.public;
24
48
  const {
25
49
  permissions
26
50
  } = props;
27
51
  const mainHeaderProps = useMemo(() => ({
28
- picture: userData ? userData?.profile?.picture : null
29
- }), [userData]);
52
+ picture: userData?.profile?.picture || null
53
+ }), [userData?.profile?.picture]);
30
54
  const onSettingChange = useCallback(config => {
31
55
  // Update Redux first
32
56
  setSettings(config);
@@ -37,8 +61,10 @@ import {jsx}from'react/jsx-runtime';import {useLayoutSettings}from'@admin-layout
37
61
  orgName
38
62
  } = {}
39
63
  } = props;
64
+ // Use base settings directly (overrides are already applied to the context)
65
+ const mergedSettings = settingXstate;
40
66
  return jsx(TailwindThemeProvider, {
41
- settings: settingXstate,
67
+ settings: mergedSettings,
42
68
  actor: settingsActor,
43
69
  children: jsx(BasicLayout, {
44
70
  routeParams: orgName,
@@ -47,7 +73,8 @@ import {jsx}from'react/jsx-runtime';import {useLayoutSettings}from'@admin-layout
47
73
  mainHeaderProps: mainHeaderProps,
48
74
  actor: settingsActor,
49
75
  ...props,
50
- settings: settingXstate
76
+ settings: mergedSettings,
77
+ routePattern: current?.id
51
78
  })
52
79
  });
53
80
  }
@@ -1 +1 @@
1
- {"version":3,"file":"TailwindLayout.js","sources":["../../../src/components/Layout/TailwindLayout.tsx"],"sourcesContent":[null],"names":[],"mappings":"mgBAUA,SAAS,0BAA0B,CAAC,KAAgF,EAAA;AAChH,EAAA,MAAA,WAAiB,WAAA,CAAA,YAAY,CAAA;QACvB;IACN,QAAQ;AAER,GAAA,GAAA,kBAAoB,CAAA,MAAA,CAAA;AAEZ,EAAA,MAAA;AACI,IAAA,QAAA;;uBAEC,EAAA;AACJ,EAAA,MAAA,CAAA,KAAA,EAAA,IAAA,EAAA,aAAA,CAAA,GAAA,UAAA,CAAA,eAAA,CAAA,OAAA,CAAA;AACJ,IAAA,OACD,EAAA;AACI,MAAA,mBAAO,EAAA,CAAA;AACH,QAAA;AACH,OAAA,KAAA;AACJ,QACH,WAAA,CAAA,OAAA,CAAA;AAEF;AAEA;AAEA,GAAA,CAAA,EAAA;AAEQ,IAAA,KAAA,EAAA;AACH,MAAC,QACO,EAAA;AAGb;;QAGQ,aAAkB,GAAA,KAAE,EAAA,OAAA;AACxB,EAAA,MACC;IAGL;MACM,KAAA;QAEC,eACmB,GAAA,OAAA,CAAA,OAAA;AAY9B,IAAC,OAAA,EAAA,QAAA,GAAA,QAAA,EAAA,OAAA,EAAA,OAAA,GAAA;AAED,GAAM,CAAA,EAAA,CAAA,QAAW,CAAA,CAAA;QACL,eAAA,GAAA,WAAA,CAAA,MAAA,IAAA;;AAEX,IAAE,WAAA,CAAA,MAAA,CAAA;AAMH,GAAA,EAAA,CAAM,WAAY,CAAA,CAAA;AAIlB;AAKA,EAAA,MAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"TailwindLayout.js","sources":["../../../src/components/Layout/TailwindLayout.tsx"],"sourcesContent":[null],"names":[],"mappings":"0hBAYA,SAAS,0BAA0B,CAAC,KAAqC,EAAA;AACrE,EAAA,MAAA,WAAc,WAAG,CAAA,YAAY,CAAA;AAC7B,EAAA,MAAA,QAAM,GAAQ,WAAG,EAAW;QAC5B;IACA,QAAQ,EAAA;AACR,GAAA,GAAA,kBAAgB,CAAA,MAAU,C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,MAAA,KAAE,EAAE,QAAA;QACJ,EAAA,cAAQ,CAAA,MAAA,IAAA,EAAA;MACV;AACN,KAAE;AAEF,EAAA;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"AdditionalSettings.js","sources":["../../../../src/components/Layout/slot-fill/AdditionalSettings.tsx"],"sourcesContent":[null],"names":["_jsx"],"mappings":"oFAIO,MAAM,kCAAkC,GAAG;AAErC,MAAA,sBAAsB,GAAG,KAAC,IAAS;SACrCA,GAAA,CAAA,IAAK,EAAA;AAChB,IAAE,IAAA,EAAA,kCAAA;AAEF,IAAA,SAAa,EAAA;IACT;AACJ"}
1
+ {"version":3,"file":"AdditionalSettings.js","sources":["../../../../src/components/Layout/slot-fill/AdditionalSettings.tsx"],"sourcesContent":[null],"names":["_jsx"],"mappings":"oFAIO,MAAM,kCAAkC,GAAG;AAE3C,MAAM,sBAAsB,GAAG,KAAC,IAAO;SAC1CA,GAAO,CAAA,IAAC,EAAI;AAChB,IAAE,IAAA,EAAA,kCAAA;AAEF,IAAA,SAAa,EAAA;IACT;AACJ"}
@@ -1 +1 @@
1
- {"version":3,"file":"Footer.js","sources":["../../../../src/components/Layout/slot-fill/Footer.tsx"],"sourcesContent":[null],"names":["_jsx"],"mappings":"oFAEO,MAAM,qBAAqB,GAAG;AAExB,MAAA,UAAU,GAAG,KAAC,IAAS;SACzBA,GAAA,CAAA,IAAK,EAAA;AAChB,IAAE,IAAA,EAAA,qBAAA;AAEF,IAAA,SAAa,EAAA;IACT;AACJ"}
1
+ {"version":3,"file":"Footer.js","sources":["../../../../src/components/Layout/slot-fill/Footer.tsx"],"sourcesContent":[null],"names":["_jsx"],"mappings":"oFAEO,MAAM,qBAAqB,GAAG;AAE9B,MAAM,UAAU,GAAG,KAAC,IAAO;SAC9BA,GAAO,CAAA,IAAC,EAAI;AAChB,IAAE,IAAA,EAAA,qBAAA;AAEF,IAAA,SAAa,EAAA;IACT;AACJ"}
@@ -1 +1 @@
1
- {"version":3,"file":"HeaderSearchBar.js","sources":["../../../../src/components/Layout/slot-fill/HeaderSearchBar.tsx"],"sourcesContent":[null],"names":["_jsx"],"mappings":"8LAKa,MAAA,mBAAmB,GAAG,KAAC,IAAS;SAClCA,GAAA,CAAA,IAAK,EAAA;AAChB,IAAE,IAAA,EAAA,qBAAA;;;"}
1
+ {"version":3,"file":"HeaderSearchBar.js","sources":["../../../../src/components/Layout/slot-fill/HeaderSearchBar.tsx"],"sourcesContent":[null],"names":["_jsx"],"mappings":"8LAKO,MAAM,mBAAmB,GAAG,KAAC,IAAO;SACvCA,GAAO,CAAA,IAAC,EAAI;AAChB,IAAE,IAAA,EAAA,qBAAA;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"HeaderSearchButton.js","sources":["../../../../src/components/Layout/slot-fill/HeaderSearchButton.tsx"],"sourcesContent":[null],"names":["_jsx"],"mappings":"kMAKa,MAAA,sBAAsB,GAAG,KAAC,IAAS;SACrCA,GAAA,CAAA,IAAK,EAAA;AAChB,IAAE,IAAA,EAAA,yBAAA;;;"}
1
+ {"version":3,"file":"HeaderSearchButton.js","sources":["../../../../src/components/Layout/slot-fill/HeaderSearchButton.tsx"],"sourcesContent":[null],"names":["_jsx"],"mappings":"kMAKO,MAAM,sBAAsB,GAAG,KAAC,IAAO;SAC1CA,GAAO,CAAA,IAAC,EAAI;AAChB,IAAE,IAAA,EAAA,yBAAA;;;"}
@@ -0,0 +1,4 @@
1
+ export declare const LOGO_SLOT_FILL_NAME = "logo-fill";
2
+ export declare const LogoSlot: (props: any) => import("react/jsx-runtime").JSX.Element;
3
+ export declare const LogoCard: (props: any) => import("react/jsx-runtime").JSX.Element;
4
+ //# sourceMappingURL=Logo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Logo.d.ts","sourceRoot":"","sources":["../../../../src/components/Layout/slot-fill/Logo.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,mBAAmB,cAAc,CAAC;AAE/C,eAAO,MAAM,QAAQ,GAAI,UAAK,4CAE7B,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,UAAK,4CAE7B,CAAC"}
@@ -0,0 +1,7 @@
1
+ import {jsx}from'react/jsx-runtime';import {Slot}from'@common-stack/components-pro';const LOGO_SLOT_FILL_NAME = 'logo-fill';
2
+ const LogoSlot = props => {
3
+ return jsx(Slot, {
4
+ name: LOGO_SLOT_FILL_NAME,
5
+ fillProps: props
6
+ });
7
+ };export{LOGO_SLOT_FILL_NAME,LogoSlot};//# sourceMappingURL=Logo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Logo.js","sources":["../../../../src/components/Layout/slot-fill/Logo.tsx"],"sourcesContent":[null],"names":["_jsx"],"mappings":"oFAEO,MAAM,mBAAmB,GAAG;AAE5B,MAAM,QAAQ,GAAG,KAAC,IAAO;SAC5BA,GAAO,CAAA,IAAC,EAAI;AAChB,IAAE,IAAA,EAAA,mBAAA;AAEF,IAAA,SAAa,EAAA;IACT;AACJ"}
@@ -1 +1 @@
1
- {"version":3,"file":"RightContent.js","sources":["../../../../src/components/Layout/slot-fill/RightContent.tsx"],"sourcesContent":[null],"names":["_jsx"],"mappings":"2LAKa,MAAA,gBAAgB,GAAG,KAAC,IAAS;SAC/BA,GAAA,CAAA,IAAK,EAAA;AAChB,IAAE,IAAA,EAAA,kBAAA;;;"}
1
+ {"version":3,"file":"RightContent.js","sources":["../../../../src/components/Layout/slot-fill/RightContent.tsx"],"sourcesContent":[null],"names":["_jsx"],"mappings":"2LAKO,MAAM,gBAAgB,GAAG,KAAC,IAAO;SACpCA,GAAO,CAAA,IAAC,EAAI;AAChB,IAAE,IAAA,EAAA,kBAAA;;;"}
@@ -0,0 +1,4 @@
1
+ export declare const SIDE_MENU_LOGO_SLOT_FILL_NAME = "side-menu-logo-fill";
2
+ export declare const SideMenuLogoSlot: (props: any) => import("react/jsx-runtime").JSX.Element;
3
+ export declare const SideMenuLogoCard: (props: any) => import("react/jsx-runtime").JSX.Element;
4
+ //# sourceMappingURL=SideMenuLogo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SideMenuLogo.d.ts","sourceRoot":"","sources":["../../../../src/components/Layout/slot-fill/SideMenuLogo.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,6BAA6B,wBAAwB,CAAC;AAEnE,eAAO,MAAM,gBAAgB,GAAI,UAAK,4CAErC,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,UAAK,4CAErC,CAAC"}
@@ -0,0 +1,7 @@
1
+ import {jsx}from'react/jsx-runtime';import {Slot}from'@common-stack/components-pro';const SIDE_MENU_LOGO_SLOT_FILL_NAME = 'side-menu-logo-fill';
2
+ const SideMenuLogoSlot = props => {
3
+ return jsx(Slot, {
4
+ name: SIDE_MENU_LOGO_SLOT_FILL_NAME,
5
+ fillProps: props
6
+ });
7
+ };export{SIDE_MENU_LOGO_SLOT_FILL_NAME,SideMenuLogoSlot};//# sourceMappingURL=SideMenuLogo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SideMenuLogo.js","sources":["../../../../src/components/Layout/slot-fill/SideMenuLogo.tsx"],"sourcesContent":[null],"names":["_jsx"],"mappings":"oFAEO,MAAM,6BAA6B,GAAG;AAEtC,MAAM,gBAAgB,GAAG,KAAC,IAAO;SACpCA,GAAO,CAAA,IAAC,EAAI;AAChB,IAAE,IAAA,EAAA,6BAAA;AAEF,IAAA,SAAa,EAAA;IACT;AACJ"}
@@ -4,4 +4,6 @@ export * from './AdditionalSettings';
4
4
  export * from './HeaderSearchBar';
5
5
  export * from './HeaderSearchButton';
6
6
  export * from './RightContent';
7
+ export * from './SideMenuLogo';
8
+ export * from './Logo';
7
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Layout/slot-fill/index.tsx"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Layout/slot-fill/index.tsx"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,QAAQ,CAAC"}
@@ -1,4 +1,4 @@
1
- import {generatePath}from'react-router';/* eslint-disable import/no-extraneous-dependencies */
1
+ import {generatePath}from'@remix-run/router';/* eslint-disable import/no-extraneous-dependencies */
2
2
  const generateMenuPath = (path, params) => {
3
3
  try {
4
4
  const generatedPath = generatePath(path, params);
@@ -1 +1 @@
1
- {"version":3,"file":"util.js","sources":["../../../src/components/Layout/util.ts"],"sourcesContent":[null],"names":[],"mappings":"wCAAA;MAGa,gBAAgB,GAAG,CAAC,IAAI,EAAE,MAAM,KAAI;AAC7C,EAAA,IAAA;UACU,aAAA,GAAA,YAA4B,CAAA,IAAC,QAAM,CAAA;AACzC,IAAA,OAAA;IACJ,OAAC,GAAA,EAAA;;;;;SAIA,IAAA;AACD"}
1
+ {"version":3,"file":"util.js","sources":["../../../src/components/Layout/util.ts"],"sourcesContent":[null],"names":[],"mappings":"6CAAA;MAGa,gBAAgB,GAAG,CAAC,IAAI,EAAE,MAAM,KAAI;AAC7C,EAAA,IAAA;UACI,aAAM,GAAA,YAAgB,CAAA,IAAa,QAAM,CAAA;AACzC,IAAA,OAAA;IACJ,OAAC,GAAA,EAAA;;;;;SAIA,IAAA;AACD"}
@@ -1 +1 @@
1
- {"version":3,"file":"CheckBoxTheme.d.ts","sourceRoot":"","sources":["../../../src/components/SettingDrawer/CheckBoxTheme.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAsD9C,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,KAAK,EAAE,mBAAmB,2CAiC/D"}
1
+ {"version":3,"file":"CheckBoxTheme.d.ts","sourceRoot":"","sources":["../../../src/components/SettingDrawer/CheckBoxTheme.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAwD9C,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,KAAK,EAAE,mBAAmB,2CAuC/D"}
@@ -1,4 +1,4 @@
1
- import {jsx,jsxs}from'react/jsx-runtime';const themelist = [{
1
+ import {jsx,jsxs}from'react/jsx-runtime';import'react';import'@react-icons/all-files/fa/FaMoon.js';import'@react-icons/all-files/fa/FaSun.js';import {useMediaQuery}from'../../hooks/useMediaQuery.js';import {getSettingValue}from'../../utils/settingsUtils.js';const themelist = [{
2
2
  key: 'light',
3
3
  title: 'Light',
4
4
  svg: jsxs("svg", {
@@ -93,8 +93,18 @@ function CheckBoxTheme(props) {
93
93
  const {
94
94
  list,
95
95
  changeSetting,
96
- settings
96
+ settings,
97
+ location,
98
+ routePattern,
99
+ applyToAllRoutes = false
97
100
  } = props;
101
+ const {
102
+ isMobile
103
+ } = useMediaQuery();
104
+ const currentRoute = routePattern || location?.pathname || '/';
105
+ const deviceType = isMobile ? 'mobile' : 'desktop';
106
+ // Use getSettingValue to get the correct navTheme based on applyToAllRoutes
107
+ const navThemeValue = getSettingValue(settings, 'navTheme', applyToAllRoutes, currentRoute, deviceType, 'light');
98
108
  return jsx("div", {
99
109
  className: "flex flex-row gap-4",
100
110
  children: themelist.map((themeItems, index) => {
@@ -108,7 +118,7 @@ function CheckBoxTheme(props) {
108
118
  changeSetting('primaryColor', settings?.primaryColor);
109
119
  },
110
120
  children: jsxs("div", {
111
- children: [themeItems.svg, settings?.navTheme === themeItems.key && jsx("svg", {
121
+ children: [themeItems.svg, navThemeValue === themeItems.key && jsx("svg", {
112
122
  className: "absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 w-6 h-6 text-blue-500",
113
123
  viewBox: "0 0 24 24",
114
124
  fill: "currentColor",
@@ -1 +1 @@
1
- {"version":3,"file":"CheckBoxTheme.js","sources":["../../../src/components/SettingDrawer/CheckBoxTheme.tsx"],"sourcesContent":[null],"names":["_jsxs","_jsx"],"mappings":"yCAGA,MAAM,SAAS,GAAG,CAAA;AACd,EAAA,GAAA,EAAA,OAAA;AACI,EAAA,KAAA,EAAA,OAAY;AACZ,EAAA,GAAA,EAAAA,IAAA,CAAK,KAAS,EAAA;SACX,EAAA,IACM;AASZ,IAAA,MAAA,EAAA,IAAA;AACD,IAAA,OAAA,EAAA,WAAA;AACI,IAAA,KAAA,EAAG,4BAAY;AACf,IAAA,QAAA,GAAOC,GAAU,CAAA,MAAA,EAAA;cAEb,EAAAA,GAAA,CAAA,QAAK,EAAK;AAcjB,QAAA,EAAA,EAAA,YAAA;AACD,QAAA,CAAA,EAAA,MAAA;AACI,QAAA,CAAA,EAAG,MAAQ;AACX,QAAA,KAAK,EAAE,MAAM;QACb,MACI,EAAK,MAAA;AAWZ,QAAA,QAAA,EAAAA,GAAA,CAAA,cAAA,EAAA;UACH,EAAA,EAAA,GAAA;AAEF,UAAO,EAAA,EAAO,GAAU;UACd,YAAQ,EAAA,GAAA;AACd,UAAA,UACI,EAAA,SAAc;AAEN,UAAA,YAGQ,EAAA;AAGI,SAAA;AACA,OAAA;AACJ,KAAA,CAAA,EAAAA,GAAA,CAAA;SAiBX,GACC;AAEd,MAAC,CAAA,EAAA,GAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"CheckBoxTheme.js","sources":["../../../src/components/SettingDrawer/CheckBoxTheme.tsx"],"sourcesContent":[null],"names":["_jsxs","_jsx"],"mappings":"kQAKA,MAAM,SAAS,GAAG,CAAA;AACd,EAAA,GAAA,EAAA,OAAA;AACI,EAAA,KAAA,EAAA,OAAK;AACL,EAAA,GAAA,EAAAA,IAAA,CAAK,KAAE,EAAA;SACP,EAAG,IACC;AASP,IAAA,MAAA,EAAA,IAAA;AACD,IAAA,OAAA,EAAA,WAAA;AACI,IAAA,KAAA,EAAG,4BAAY;AACf,IAAA,QAAA,GAAOC,GAAA,CAAA,MAAU,EAAA;cAEb,EAAAA,GAAA,CAAA,QAAK,EAAA;AAcZ,QAAA,EAAA,EAAA,YAAA;AACD,QAAA,CAAA,EAAA,MAAA;AACI,QAAA,CAAA,EAAG,MAAE;AACL,QAAA,KAAK,EAAE,MAAM;QACb,MACI,EAAA,MAAA;AAWP,QAAA,QAAA,EAAAA,GAAA,CAAA,cAAA,EAAA;UACH,EAAA,EAAA,GAAA;AAEF,UAAO,EAAA,EAAO,GAAA;AACV,UAAM,YAAQ,EAAA,GAAA;AACd,UAAM,UAAU,EAAE,SAAG;UACf,YAAY;SAClB;OAEA;AACA,KAAA,CAAA,EAAAA;AACA,MAAA,CAAA,EAAA,GACI;AAEQ,MAAA,CAAA,EAAA,GAAA;AAMY,MAAA,KAAA,EAAA,IAAA;AACA,MAAA,MAAA,EAAA,IAAA;AACJ,MAAA,EAAA,EAAA,GAAA;UAiBV,EAAA,SAER;AACN,MAAC,MAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"InvitationSettings.d.ts","sourceRoot":"","sources":["../../../src/components/SettingDrawer/InvitationSettings.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAG/C,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,KAAK,EAAE,oBAAoB,GAAG,GAAG,2CA6D3E"}
1
+ {"version":3,"file":"InvitationSettings.d.ts","sourceRoot":"","sources":["../../../src/components/SettingDrawer/InvitationSettings.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAI/C,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,KAAK,EAAE,oBAAoB,GAAG,GAAG,2CAsE3E"}