@admin-layout/tailwind-design-pro 12.2.4-alpha.7 → 12.2.4-alpha.70
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.
- package/lib/components/Layout/BasicLayout/index.d.ts.map +1 -1
- package/lib/components/Layout/BasicLayout/index.js +16 -2
- package/lib/components/Layout/BasicLayout/index.js.map +1 -1
- package/lib/components/Layout/GlobalHeader/NavbarSlotStrip.d.ts +12 -0
- package/lib/components/Layout/GlobalHeader/NavbarSlotStrip.d.ts.map +1 -0
- package/lib/components/Layout/GlobalHeader/NavbarSlotStrip.js +18 -0
- package/lib/components/Layout/GlobalHeader/NavbarSlotStrip.js.map +1 -0
- package/lib/components/Layout/GlobalHeader/RightContent.d.ts +1 -2
- package/lib/components/Layout/GlobalHeader/RightContent.d.ts.map +1 -1
- package/lib/components/Layout/GlobalHeader/RightContent.js +10 -72
- package/lib/components/Layout/GlobalHeader/RightContent.js.map +1 -1
- package/lib/components/Layout/GlobalHeader/RightMenu.d.ts.map +1 -1
- package/lib/components/Layout/GlobalHeader/RightMenu.js +16 -80
- package/lib/components/Layout/GlobalHeader/RightMenu.js.map +1 -1
- package/lib/components/Layout/GlobalHeader/SearchBar.js +1 -1
- package/lib/components/Layout/GlobalHeader/index.d.ts +1 -0
- package/lib/components/Layout/GlobalHeader/index.d.ts.map +1 -1
- package/lib/components/Layout/ProTailwindLayout.d.ts +0 -1
- package/lib/components/Layout/ProTailwindLayout.d.ts.map +1 -1
- package/lib/components/Layout/ProTailwindLayout.js +22 -18
- package/lib/components/Layout/ProTailwindLayout.js.map +1 -1
- package/lib/components/Layout/Sidebar/BottomMenu.d.ts.map +1 -1
- package/lib/components/Layout/Sidebar/BottomMenu.js +44 -71
- package/lib/components/Layout/Sidebar/BottomMenu.js.map +1 -1
- package/lib/components/Layout/Sidebar/DynamicIcon.js +7 -1
- package/lib/components/Layout/Sidebar/DynamicIcon.js.map +1 -1
- package/lib/components/Layout/Sidebar/MainSidebar.d.ts.map +1 -1
- package/lib/components/Layout/Sidebar/MainSidebar.js +20 -17
- package/lib/components/Layout/Sidebar/MainSidebar.js.map +1 -1
- package/lib/components/Layout/Sidebar/MainSidebarMenu.d.ts.map +1 -1
- package/lib/components/Layout/Sidebar/MainSidebarMenu.js +187 -16
- package/lib/components/Layout/Sidebar/MainSidebarMenu.js.map +1 -1
- package/lib/components/Layout/Sidebar/MenuDynamicDialog.d.ts +12 -0
- package/lib/components/Layout/Sidebar/MenuDynamicDialog.d.ts.map +1 -0
- package/lib/components/Layout/Sidebar/MenuDynamicDialog.js +79 -0
- package/lib/components/Layout/Sidebar/MenuDynamicDialog.js.map +1 -0
- package/lib/components/Layout/Sidebar/PerplexSidebar.d.ts.map +1 -1
- package/lib/components/Layout/Sidebar/PerplexSidebar.js +8 -12
- package/lib/components/Layout/Sidebar/PerplexSidebar.js.map +1 -1
- package/lib/components/Layout/Sidebar/PerplexSidebarMenu.d.ts.map +1 -1
- package/lib/components/Layout/Sidebar/PerplexSidebarMenu.js +268 -33
- package/lib/components/Layout/Sidebar/PerplexSidebarMenu.js.map +1 -1
- package/lib/components/Layout/Sidebar/SidebarRailFX.d.ts +23 -0
- package/lib/components/Layout/Sidebar/SidebarRailFX.d.ts.map +1 -0
- package/lib/components/Layout/Sidebar/SidebarRailFX.js +229 -0
- package/lib/components/Layout/Sidebar/SidebarRailFX.js.map +1 -0
- package/lib/components/Layout/TailwindLayout.js +3 -1
- package/lib/components/Layout/TailwindLayout.js.map +1 -1
- package/lib/components/Layout/getPageTitle.js +2 -2
- package/lib/components/Layout/getPageTitle.js.map +1 -1
- package/lib/components/Layout/slot-fill/RightContent.d.ts +3 -1
- package/lib/components/Layout/slot-fill/RightContent.d.ts.map +1 -1
- package/lib/components/Layout/slot-fill/RightContent.js +4 -6
- package/lib/components/Layout/slot-fill/RightContent.js.map +1 -1
- package/lib/components/SettingDrawer/hooks/useSettingsOperations.d.ts.map +1 -1
- package/lib/components/SettingDrawer/hooks/useSettingsOperations.js +2 -1
- package/lib/components/SettingDrawer/hooks/useSettingsOperations.js.map +1 -1
- package/lib/components/SettingDrawer/utils/constants.d.ts.map +1 -1
- package/lib/components/SettingDrawer/utils/constants.js +3 -0
- package/lib/components/SettingDrawer/utils/constants.js.map +1 -1
- package/lib/components/SettingsThemeApplier/SettingsThemeApplier.d.ts +10 -0
- package/lib/components/SettingsThemeApplier/SettingsThemeApplier.d.ts.map +1 -0
- package/lib/components/SettingsThemeApplier/SettingsThemeApplier.js +23 -0
- package/lib/components/SettingsThemeApplier/SettingsThemeApplier.js.map +1 -0
- package/lib/components/SettingsThemeApplier/index.d.ts +2 -0
- package/lib/components/SettingsThemeApplier/index.d.ts.map +1 -0
- package/lib/components/index.js +1 -1
- package/lib/components/typings.d.ts +2 -0
- package/lib/components/typings.d.ts.map +1 -1
- package/lib/compute.d.ts.map +1 -1
- package/lib/compute.js +0 -1
- package/lib/compute.js.map +1 -1
- package/lib/helpers/DynamicIcon.js +7 -1
- package/lib/helpers/DynamicIcon.js.map +1 -1
- package/lib/index.d.ts +2 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/routes.json +0 -1
- package/lib/styles/index.css +282 -0
- package/lib/utils/settingsTheme.d.ts +40 -0
- package/lib/utils/settingsTheme.d.ts.map +1 -0
- package/lib/utils/settingsTheme.js +106 -0
- package/lib/utils/settingsTheme.js.map +1 -0
- package/package.json +8 -7
|
@@ -1,19 +1,27 @@
|
|
|
1
|
-
import React__default,{useState,useRef,useEffect}from'react';import {Link}from'@remix-run/react';import {useAppSelector}from'@admin-layout/client';import {generateMenuPath}from'../util.js';import {renderDynamicIcon}from'../../../helpers/DynamicIcon.js';import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import React__default,{useState,useRef,useEffect}from'react';import {Link}from'@remix-run/react';import {useAppSelector}from'@admin-layout/client';import {generateMenuPath}from'../util.js';import {renderDynamicIcon}from'../../../helpers/DynamicIcon.js';import {MenuDynamicDialog}from'./MenuDynamicDialog.js';// Smooth entrance for the account/user dropdown — matches the rail's motion language.
|
|
2
|
+
// transform/opacity/filter only; honors prefers-reduced-motion.
|
|
3
|
+
const BOTTOM_MENU_MOTION_CSS = `
|
|
4
|
+
@keyframes qlBottomDropdownIn {
|
|
5
|
+
from { opacity: 0; transform: translateY(8px) scale(0.96); filter: blur(4px); }
|
|
6
|
+
to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
|
|
7
|
+
}
|
|
8
|
+
.ql-bottom-dropdown {
|
|
9
|
+
animation: qlBottomDropdownIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) both;
|
|
10
|
+
will-change: transform, opacity;
|
|
11
|
+
}
|
|
12
|
+
@keyframes qlBmItemIn {
|
|
13
|
+
from { opacity: 0; transform: translateX(-6px); }
|
|
14
|
+
to { opacity: 1; transform: translateX(0); }
|
|
15
|
+
}
|
|
16
|
+
.ql-bm-item {
|
|
17
|
+
animation: qlBmItemIn 0.26s cubic-bezier(0.22, 1, 0.36, 1) both;
|
|
18
|
+
animation-delay: calc(40ms + var(--i, 0) * 26ms);
|
|
11
19
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
20
|
+
@media (prefers-reduced-motion: reduce) {
|
|
21
|
+
.ql-bottom-dropdown { animation-duration: 0.01ms; filter: none; }
|
|
22
|
+
.ql-bm-item { animation: none; opacity: 1; }
|
|
23
|
+
}
|
|
24
|
+
`;
|
|
17
25
|
const BottomMenu = ({
|
|
18
26
|
menuData,
|
|
19
27
|
routeParams,
|
|
@@ -159,62 +167,17 @@ const BottomMenu = ({
|
|
|
159
167
|
key,
|
|
160
168
|
name
|
|
161
169
|
} = item;
|
|
162
|
-
|
|
170
|
+
if (key !== openedModalKey) {
|
|
171
|
+
return null;
|
|
172
|
+
}
|
|
173
|
+
return React__default.createElement(MenuDynamicDialog, {
|
|
163
174
|
key: k,
|
|
164
|
-
|
|
165
|
-
}, React__default.createElement("div", {
|
|
166
|
-
className: "flex items-center justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0"
|
|
167
|
-
}, React__default.createElement("div", {
|
|
168
|
-
className: "fixed inset-0 transition-opacity",
|
|
169
|
-
"aria-hidden": "true"
|
|
170
|
-
}, React__default.createElement("div", {
|
|
171
|
-
className: "absolute inset-0 bg-black bg-opacity-50",
|
|
172
|
-
onClick: () => {
|
|
173
|
-
onClose();
|
|
174
|
-
setOpenedModalKey(null);
|
|
175
|
-
}
|
|
176
|
-
})), React__default.createElement("span", {
|
|
177
|
-
className: "hidden sm:inline-block sm:align-middle sm:h-screen",
|
|
178
|
-
"aria-hidden": "true"
|
|
179
|
-
}, "\u200B"), React__default.createElement("div", {
|
|
180
|
-
className: "inline-block align-bottom rounded-themed-lg text-left overflow-hidden shadow-themed-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-lg sm:w-full themed-modal",
|
|
181
|
-
role: "dialog",
|
|
182
|
-
"aria-modal": "true",
|
|
183
|
-
"aria-labelledby": "modal-headline"
|
|
184
|
-
}, React__default.createElement("div", {
|
|
185
|
-
className: "px-4 pt-5 pb-4 sm:p-6 sm:pb-4"
|
|
186
|
-
}, React__default.createElement("div", {
|
|
187
|
-
className: "flex justify-end"
|
|
188
|
-
}, React__default.createElement("button", {
|
|
189
|
-
type: "button",
|
|
190
|
-
className: "rounded-themed text-muted-foreground hover:text-foreground focus-themed",
|
|
191
|
-
onClick: () => {
|
|
192
|
-
onClose();
|
|
193
|
-
setOpenedModalKey(null);
|
|
194
|
-
}
|
|
195
|
-
}, React__default.createElement("span", {
|
|
196
|
-
className: "sr-only"
|
|
197
|
-
}, "Close"), React__default.createElement("svg", {
|
|
198
|
-
className: "h-6 w-6",
|
|
199
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
200
|
-
fill: "none",
|
|
201
|
-
viewBox: "0 0 24 24",
|
|
202
|
-
stroke: "currentColor",
|
|
203
|
-
"aria-hidden": "true"
|
|
204
|
-
}, React__default.createElement("path", {
|
|
205
|
-
strokeLinecap: "round",
|
|
206
|
-
strokeLinejoin: "round",
|
|
207
|
-
strokeWidth: "2",
|
|
208
|
-
d: "M6 18L18 6M6 6l12 12"
|
|
209
|
-
})))), React__default.createElement("div", {
|
|
210
|
-
className: "mt-2"
|
|
211
|
-
}, React__default.createElement(DialogComponent, {
|
|
212
|
-
path: dialogPath,
|
|
175
|
+
dialogPath: dialogPath,
|
|
213
176
|
onClose: () => {
|
|
214
177
|
onClose();
|
|
215
178
|
setOpenedModalKey(null);
|
|
216
179
|
}
|
|
217
|
-
})
|
|
180
|
+
});
|
|
218
181
|
});
|
|
219
182
|
};
|
|
220
183
|
return React__default.createElement(React__default.Fragment, null, React__default.createElement("div", {
|
|
@@ -247,11 +210,18 @@ const BottomMenu = ({
|
|
|
247
210
|
}))), isMobile && React__default.createElement("span", {
|
|
248
211
|
className: "text-lg font-medium"
|
|
249
212
|
}, t(nickname))), isOpen && React__default.createElement("div", {
|
|
250
|
-
className: "bg-background absolute bottom-full mb-2 w-72 rounded-themed shadow-themed-lg py-1 themed-dropdown ring-1 ring-border focus:outline-none z-40",
|
|
213
|
+
className: "ql-bottom-dropdown bg-background absolute bottom-full mb-2 w-72 rounded-themed shadow-themed-lg py-1 themed-dropdown ring-1 ring-border focus:outline-none z-40",
|
|
251
214
|
role: "menu",
|
|
252
215
|
"aria-orientation": "vertical",
|
|
253
|
-
"aria-labelledby": "user-menu"
|
|
254
|
-
|
|
216
|
+
"aria-labelledby": "user-menu",
|
|
217
|
+
style: {
|
|
218
|
+
transformOrigin: 'bottom left'
|
|
219
|
+
}
|
|
220
|
+
}, React__default.createElement("style", {
|
|
221
|
+
dangerouslySetInnerHTML: {
|
|
222
|
+
__html: BOTTOM_MENU_MOTION_CSS
|
|
223
|
+
}
|
|
224
|
+
}), MenusList?.upperMenus?.map((item, k) => React__default.createElement("div", {
|
|
255
225
|
key: k,
|
|
256
226
|
className: "px-1 py-1"
|
|
257
227
|
}, item.modal ? getMenuItemModal(item) : getMenuItemPath(item))), MenusList?.upperMenus?.length > 0 && MenusList?.middleMenus?.length > 0 && React__default.createElement("hr", {
|
|
@@ -261,9 +231,12 @@ const BottomMenu = ({
|
|
|
261
231
|
className: "px-1 py-1"
|
|
262
232
|
}, item.modal ? getMenuItemModal(item) : getMenuItemPath(item))), profile && accountMenuItems?.children && React__default.createElement("div", {
|
|
263
233
|
className: "py-2"
|
|
264
|
-
}, accountMenuItems.children.map(item => React__default.createElement(Link, {
|
|
234
|
+
}, accountMenuItems.children.map((item, idx) => React__default.createElement(Link, {
|
|
265
235
|
key: item.key,
|
|
266
|
-
className: "flex items-center justify-between px-4 py-2 text-sm text-
|
|
236
|
+
className: "ql-bm-item flex items-center justify-between px-4 py-2 text-sm text-foreground hover:bg-muted cursor-pointer transition-colors",
|
|
237
|
+
style: {
|
|
238
|
+
['--i']: idx
|
|
239
|
+
},
|
|
267
240
|
to: generateMenuPath(item.path, routeParams)
|
|
268
241
|
}, React__default.createElement("div", {
|
|
269
242
|
className: "flex items-center"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BottomMenu.js","sources":["../../../../src/components/Layout/Sidebar/BottomMenu.tsx"],"sourcesContent":[null],"names":["React","RouterLink"],"mappings":"
|
|
1
|
+
{"version":3,"file":"BottomMenu.js","sources":["../../../../src/components/Layout/Sidebar/BottomMenu.tsx"],"sourcesContent":[null],"names":["React","RouterLink"],"mappings":"oTAQA;AACA;AACA,MAAM,sBAAsB,GAAG;;;;;;;;;;;;;;;;;;;;;CAqB9B;MAEY,UAAU,GAA8B,CAAC;UAU5C;aACC;AACP,EAAA,iBAAO;AACP,EAAA,QAAM;AACN,EAAA,QAAM;aACN;UAEA;AACA,EAAA;AACA,CAAA,KAAA;QACA,CAAA,WAAgB,YAAW,CAAA,GAAA,QAA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;qBACX,GAAA,SAAA,EAAA,WAAA,EAAA,MAAK,CAAA,CAAA,IAAU,CAAA,CAAA,KAAA,KAAA,IAAA,CAAA;oBAaf,MAAA,GAAA,CAAA,EAAA,WAAA,GAAA,WAAM,CAAA,MAAU,CAAA,GAAA,UAAA,CAAA;mBAMvB,EAAA,MAAA,GAAA,CAAe,EAAE,cAAc,WAAA,CAAA,MAAA,CAAA,GAAA,WAAI,CAAA;AACnC,IAAA,IAAA,UAAA,EAAA,MAAA,GAAA,CAAA,aAA0B,GAAG,WAC1B,CAAA,MAAA,CAAA,GAAA,UAAA,CAAA;QAOf,WAAA,EAAa,MAEpB,GAAA,CAAA,EAAA,WAAA,GAAA,WAAA,CAAA,MAAA,CAAA,GAAA,WAAA,CAAA;AACN,IAAE,OAAA,WAAA,CAAA,GAAA,CAAA,CAAA,IAAA,EAAA,CAAA,KAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -35,7 +35,13 @@ const DynamicIcon = React__default.memo(({
|
|
|
35
35
|
};
|
|
36
36
|
loadIcon();
|
|
37
37
|
}, []);
|
|
38
|
-
if (!IconComponent) return
|
|
38
|
+
if (!IconComponent) return React__default.createElement("div", {
|
|
39
|
+
style: {
|
|
40
|
+
width: '16px',
|
|
41
|
+
height: '16px',
|
|
42
|
+
display: 'flex'
|
|
43
|
+
}
|
|
44
|
+
});
|
|
39
45
|
return React__default.createElement("div", {
|
|
40
46
|
style: {
|
|
41
47
|
margin: '0px',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DynamicIcon.js","sources":["../../../../src/components/Layout/Sidebar/DynamicIcon.tsx"],"sourcesContent":[null],"names":["React"],"mappings":"sGAKO,MAAM,iBAAiB,GAAG,IAAC,IAAM;AACpC,EAAA,IAAA,OAAI,IAAO,KAAI,QAAK,EAAQ;AACxB,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,IAAA;AAAM,MAAA,SAAI,EAAA,IAAO,CAAA;AACd,KAAA,CAAA;SACH,IAAA,OAAA,IAAA,KAAA,QAAA,EAAA;WAAOA,cAAA,CAAA,aAAA,CAAA,WAAA,EAAA;AACJ,MAAA,IAAA,EAAA;KACH,CAAA;AACL,EAAE,CAAA,MAAA;AAEF,IAAA,OAAO,IAAM;;;AAID,MAAA,WAAc,GAAGA,cAAK,CAAA,IAAA,CAAA,CAAA;;AAEd,EAAA,SAAA;;AAEK,CAAA,KAAA;AACG,EAAA,MAAA,CAAA,aAAA,EAAI,4BAA0B,CAAA,IAAA,CAAQ;;qBAErC,MAAA;0BAAO;0BACJ,GAAA,eAAoB;oBACxB,CAAC,IAAA,CAAA,MAAA,IAAA;AACL,UAAA,IAAA,OAAE,MAAA,CAAA,OAAA,KAAA,QAAA,EAAA;AACD,YAAA,gBAAO,CAAA,MAAO,MAAA,CAAA,OAAA,CAAA,IAAA,CAAA,CAAA;;AAEf,YAAA,gBAAG,CAAA,MAAA,MAAA,CAAA,OAAA,CAAA;;AAEf,QAAA,CAAC,CAAC,CAAA,KAAA,CAAA,GAAA,IAAA;AACF,UAAA,gBAAW,CAAA,IAAA,CAAA;QACZ,CAAE,CAAC;AAEN,MAAA;AAAoB,IAAA,CAAA;IAEpB,QACI;AAIgB,EAAA,CAAA,EAAA,EAAA,CAAA;AACH,EAAA,IAAA,CAAA,aACQ,EACX,OAGZA,cAAA,CAAA,aAAA,CAAA,KAAA,EAAA;AACN,IACC,KAAA,EAAA;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MainSidebar.d.ts","sourceRoot":"","sources":["../../../../src/components/Layout/Sidebar/MainSidebar.tsx"],"names":[],"mappings":"AACA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAIzC,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"MainSidebar.d.ts","sourceRoot":"","sources":["../../../../src/components/Layout/Sidebar/MainSidebar.tsx"],"names":[],"mappings":"AACA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAIzC,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAS7C,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CA8R9C,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {getMenuSeparation}from'@admin-layout/client';import React__default,{useEffect}from'react';import {useTranslation}from'react-i18next';import'@react-icons/all-files/fa/FaMoon.js';import'@react-icons/all-files/fa/FaSun.js';import {useMediaQuery}from'../../../hooks/useMediaQuery.js';import {icons}from'../../../icons.js';import BottomMenuDropDown from'../GlobalFooter/BottomMenuDropdown.js';import {RightContent}from'../GlobalHeader/RightContent.js';import {Divider}from'./Divider.js';import {MainSidebarMenu}from'./MainSidebarMenu.js';import'@common-stack/components-pro';import'reflect-metadata';import'@admin-layout/client/lib/constants/layout.js';import {SideMenuLogoSlot}from'../slot-fill/SideMenuLogo.js';const MainSidebar = props => {
|
|
1
|
+
import {getMenuSeparation}from'@admin-layout/client';import React__default,{useEffect}from'react';import {useTranslation}from'react-i18next';import'@react-icons/all-files/fa/FaMoon.js';import'@react-icons/all-files/fa/FaSun.js';import {useMediaQuery}from'../../../hooks/useMediaQuery.js';import {icons}from'../../../icons.js';import BottomMenuDropDown from'../GlobalFooter/BottomMenuDropdown.js';import {RightContent}from'../GlobalHeader/RightContent.js';import {Divider}from'./Divider.js';import {renderDynamicIcon}from'./DynamicIcon.js';import {MainSidebarMenu}from'./MainSidebarMenu.js';import {SidebarRailFX}from'./SidebarRailFX.js';import'@common-stack/components-pro';import'reflect-metadata';import'@admin-layout/client/lib/constants/layout.js';import {SideMenuLogoSlot}from'../slot-fill/SideMenuLogo.js';const MainSidebar = props => {
|
|
2
2
|
const {
|
|
3
3
|
isSideMenuOpen,
|
|
4
4
|
closeSideMenu,
|
|
@@ -11,9 +11,9 @@ import {getMenuSeparation}from'@admin-layout/client';import React__default,{useE
|
|
|
11
11
|
showHeader,
|
|
12
12
|
menuHeaderRender,
|
|
13
13
|
deviceSettings,
|
|
14
|
-
isSideMenuLayout
|
|
14
|
+
isSideMenuLayout,
|
|
15
|
+
navbarSlotStripHeight = 0
|
|
15
16
|
} = props;
|
|
16
|
-
const [iconModule, setIconModule] = React__default.useState(null);
|
|
17
17
|
const {
|
|
18
18
|
t,
|
|
19
19
|
i18n
|
|
@@ -49,15 +49,10 @@ import {getMenuSeparation}from'@admin-layout/client';import React__default,{useE
|
|
|
49
49
|
splitMenus: getUILayoutValue('splitMenus'),
|
|
50
50
|
upperMenuDividerName: getUILayoutValue('upperMenuDividerName'),
|
|
51
51
|
middleMenuDividerName: getUILayoutValue('middleMenuDividerName'),
|
|
52
|
-
lowerMenuDividerName: getUILayoutValue('lowerMenuDividerName')
|
|
52
|
+
lowerMenuDividerName: getUILayoutValue('lowerMenuDividerName'),
|
|
53
|
+
// Opt-in ambient rail backdrop: 'off' (default) | 'aurora' | 'webgpu'.
|
|
54
|
+
railFx: getUILayoutValue('railFx') || 'off'
|
|
53
55
|
};
|
|
54
|
-
useEffect(() => {
|
|
55
|
-
if (!iconModule) {
|
|
56
|
-
import('./DynamicIcon.js').then(module => {
|
|
57
|
-
setIconModule(module);
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
}, []);
|
|
61
56
|
const toggleCollapsed = () => {
|
|
62
57
|
if (isMobile) {
|
|
63
58
|
closeSideMenu();
|
|
@@ -102,14 +97,14 @@ import {getMenuSeparation}from'@admin-layout/client';import React__default,{useE
|
|
|
102
97
|
const updatedItem = {
|
|
103
98
|
...item,
|
|
104
99
|
name: t(item.name),
|
|
105
|
-
icon:
|
|
100
|
+
icon: item.icon ? renderDynamicIcon(item.icon) : null
|
|
106
101
|
};
|
|
107
102
|
if (updatedItem.children) {
|
|
108
103
|
updatedItem.children = updateMenuIcons(updatedItem.children);
|
|
109
104
|
}
|
|
110
105
|
return updatedItem;
|
|
111
106
|
});
|
|
112
|
-
}, [t
|
|
107
|
+
}, [t]);
|
|
113
108
|
const processedMiddleMenus = React__default.useMemo(() => updateMenuIcons(middleMenus), [middleMenus, updateMenuIcons]);
|
|
114
109
|
const processedLowerMenus = React__default.useMemo(() => updateMenuIcons(lowerMenus), [lowerMenus, updateMenuIcons]);
|
|
115
110
|
const processedBottomMenus = React__default.useMemo(() => updateMenuIcons(bottomMenus), [bottomMenus, updateMenuIcons]);
|
|
@@ -188,9 +183,17 @@ import {getMenuSeparation}from'@admin-layout/client';import React__default,{useE
|
|
|
188
183
|
}))));
|
|
189
184
|
};
|
|
190
185
|
return React__default.createElement("div", null, !isMobile && React__default.createElement("aside", {
|
|
191
|
-
className: `${deviceLayout?.fixedSidebar ? 'fixed' : 'relative'} border-r border-border z-20 bg-card text-card-foreground md:block flex-shrink-0 transition-all duration-300 ease-in-out ${collapsed ? 'w-16' : 'w-64'} ${showHeader && deviceLayout?.fixedHeader ? deviceLayout?.fixedSidebar ? 'h-[calc(100vh-5rem)] top-20' : 'h-[calc(100vh-5rem)]' : 'h-screen'}`,
|
|
192
|
-
style:
|
|
193
|
-
|
|
186
|
+
className: `${deviceLayout?.fixedSidebar ? 'fixed' : 'relative'} border-r border-border z-20 bg-card text-card-foreground md:block flex-shrink-0 transition-all duration-300 ease-in-out ${collapsed ? 'w-16' : 'w-64'} ${navbarSlotStripHeight > 0 ? '' : showHeader && deviceLayout?.fixedHeader ? deviceLayout?.fixedSidebar ? 'h-[calc(100vh-5rem)] top-20' : 'h-[calc(100vh-5rem)]' : 'h-screen'}`,
|
|
187
|
+
style: {
|
|
188
|
+
...SidebarStyles,
|
|
189
|
+
...(navbarSlotStripHeight > 0 && {
|
|
190
|
+
top: deviceLayout?.fixedSidebar ? navbarSlotStripHeight : undefined,
|
|
191
|
+
height: `calc(100vh - ${navbarSlotStripHeight}px)`
|
|
192
|
+
})
|
|
193
|
+
}
|
|
194
|
+
}, React__default.createElement(SidebarRailFX, {
|
|
195
|
+
mode: deviceLayout?.railFx
|
|
196
|
+
}), menuHeaderRender && isSideMenuLayout && React__default.createElement("div", {
|
|
194
197
|
className: "border-b border-border py-1 flex items-center justify-center"
|
|
195
198
|
}, React__default.createElement(SideMenuLogoSlot, {
|
|
196
199
|
settings: settings,
|
|
@@ -223,4 +226,4 @@ import {getMenuSeparation}from'@admin-layout/client';import React__default,{useE
|
|
|
223
226
|
collapsed: collapsed,
|
|
224
227
|
routeParams: routeParams
|
|
225
228
|
}))));
|
|
226
|
-
};export{MainSidebar
|
|
229
|
+
};export{MainSidebar};//# sourceMappingURL=MainSidebar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MainSidebar.js","sources":["../../../../src/components/Layout/Sidebar/MainSidebar.tsx"],"sourcesContent":[null],"names":["React"],"mappings":"
|
|
1
|
+
{"version":3,"file":"MainSidebar.js","sources":["../../../../src/components/Layout/Sidebar/MainSidebar.tsx"],"sourcesContent":[null],"names":["React"],"mappings":"4yBAcO,MAAM,WAAW,GAA2B,KAAC,IAAO;AACvD,EAAA,MAAA;IAeA,cAAW;AACX,IAAA,aAAQ;AACR,IAAA,QAAQ;AACR,IAAA;IACA,WAAM;IAEN,QAAA;AACA,IAAA,YAAM;YACF;AACA,IAAA,UAAM;oBACA;kBAEF;oBACM;4BACQ;AAAW,GAAA,GAAA,KAAA;QAC7B;;;AAIJ,GAAA,GAAE,cAAA,CAAA,MAAA,CAAA;QAEF;AACA,IAAA;AACI,GAAA,GAAA,aAAA,EAAA;AACA,EAAA,MAAA;AACA,IAAA,eAAA;AACA,IAAA;AACA,GAAA,GAAA,KAAA;AACA,EAAA,MAAA,YAAY,GAAA,QAAA,EAAA,QAAiB,IAAA,GAAA;AAC7B,EAAA,MAAA,UAAA,GAAA,QAAoB,GAAE,QAAA,GAAA,SAAiB;AACvC;AACA,EAAA,MAAA,gBAAA,GAAA,IAAsB,IAAA;;AAEtB,IAAA,MAAA,cAAS,GAA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YAAG,EAAA,UAAa,EAAA,OAAA,IAAA;AAChB,IAAA,OAAA,SAAI,GAAAA,cAAA,CAAA,aAAqB,CAAA,IAAI,EAAI;;qCAErB,CAAA,OAAA,EAAA;iBACX,8CAAC;AACL,MAAA,KAAA,EAAA;AAED,KAAA,EAAA,IAAA,CAAA;AACC,EAAA,CAAA;4BAEO,GAAA,MAAC;yBAIT,CAAA,aAAA,CAAA,KAAA,EAAA;AAEA,MAAA,SAAA,EAAA,iBAAA,EAAA;AACI,MAAA,KAAA,EAAA;AAMX,KAAA,EAAAA,cAAA,CAAA,aAAkB,CAAA,KAAA,EAAQ;eAQ1B,EAAA;AAQQ,KAAA,EAAAA,cAAA,CAAA,aAAA,CAAA,QAAoB,EAAA;8BAEb;AAGR,MAAA,SAAA,EAAA,+NAA8E;kBAE9E,EAAA,SAAA,GAAA,gBAAK;AACD,KAAA,EAAA,SAAA,GAAAA,cAAA,CAAA,8BAAmB,EAAA;AAM3C,MAAE,QAAA,EAAA;AAEF,KAAA,CAAA,GAAAA,cAAA,CAAe,aAAY,CAAA,eAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MainSidebarMenu.d.ts","sourceRoot":"","sources":["../../../../src/components/Layout/Sidebar/MainSidebarMenu.tsx"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"MainSidebarMenu.d.ts","sourceRoot":"","sources":["../../../../src/components/Layout/Sidebar/MainSidebarMenu.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAExE,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAwiBjD,iBAAS,wBAAwB,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,gBAAgB,qBAiTjG;AAGD,eAAO,MAAM,eAAe,4DAAuC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {generateMenuPath}from'@admin-layout/client';import {useLocation,useNavigate}from'@remix-run/react';import React__default,{useState,
|
|
1
|
+
import {generateMenuPath}from'@admin-layout/client';import {useLocation,useNavigate}from'@remix-run/react';import React__default,{useState,useRef,useCallback,useEffect}from'react';import {icons}from'../../../icons.js';// Constants moved outside component
|
|
2
2
|
const SIDEBAR_WIDTHS = {
|
|
3
3
|
COLLAPSED: 64,
|
|
4
4
|
EXPANDED: 256
|
|
@@ -24,11 +24,84 @@ const isMenuItemActive = (itemPath, currentPath, routeParams, exact) => {
|
|
|
24
24
|
}
|
|
25
25
|
return false;
|
|
26
26
|
};
|
|
27
|
-
//
|
|
27
|
+
// Motion system — sliding active indicator + icon micro-interactions when collapsed.
|
|
28
|
+
// All transforms/opacity/filter only; layout untouched. Honors prefers-reduced-motion.
|
|
29
|
+
const SIDEBAR_MOTION_CSS = `
|
|
30
|
+
.ql-rail-indicator {
|
|
31
|
+
position: absolute;
|
|
32
|
+
left: 2px;
|
|
33
|
+
top: 0;
|
|
34
|
+
width: 3px;
|
|
35
|
+
border-radius: 9999px;
|
|
36
|
+
background: hsl(var(--primary));
|
|
37
|
+
box-shadow: 0 0 0 0.5px hsl(var(--primary) / 0.25), 0 0 12px hsl(var(--primary) / 0.55);
|
|
38
|
+
pointer-events: none;
|
|
39
|
+
will-change: transform, height, opacity;
|
|
40
|
+
z-index: 1;
|
|
41
|
+
}
|
|
42
|
+
.ql-rail-indicator--animated {
|
|
43
|
+
transition:
|
|
44
|
+
transform 0.42s cubic-bezier(0.22, 1, 0.36, 1),
|
|
45
|
+
height 0.42s cubic-bezier(0.22, 1, 0.36, 1),
|
|
46
|
+
opacity 0.2s ease-out;
|
|
47
|
+
}
|
|
48
|
+
.ql-rail-icon {
|
|
49
|
+
transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1), filter 0.24s ease-out;
|
|
50
|
+
will-change: transform;
|
|
51
|
+
}
|
|
52
|
+
.ql-rail-item:hover .ql-rail-icon {
|
|
53
|
+
transform: translateY(-1px) scale(1.12);
|
|
54
|
+
}
|
|
55
|
+
.ql-rail-item:active .ql-rail-icon {
|
|
56
|
+
transform: scale(0.94);
|
|
57
|
+
transition-duration: 0.1s;
|
|
58
|
+
}
|
|
59
|
+
.ql-rail-icon-active {
|
|
60
|
+
transform: scale(1.08);
|
|
61
|
+
filter: drop-shadow(0 1px 6px hsl(var(--primary) / 0.45));
|
|
62
|
+
}
|
|
63
|
+
.ql-rail-item:hover .ql-rail-icon-active {
|
|
64
|
+
transform: translateY(-1px) scale(1.14);
|
|
65
|
+
}
|
|
66
|
+
.ql-hover-accent {
|
|
67
|
+
background: hsl(var(--primary) / 0.35);
|
|
68
|
+
animation: qlHoverAccentIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
|
|
69
|
+
}
|
|
70
|
+
@keyframes qlHoverAccentIn {
|
|
71
|
+
from { opacity: 0; transform: scaleY(0.4); }
|
|
72
|
+
to { opacity: 1; transform: scaleY(1); }
|
|
73
|
+
}
|
|
74
|
+
@media (prefers-reduced-motion: reduce) {
|
|
75
|
+
.ql-rail-indicator--animated { transition: opacity 0.12s ease-out; }
|
|
76
|
+
.ql-rail-icon,
|
|
77
|
+
.ql-rail-item:hover .ql-rail-icon,
|
|
78
|
+
.ql-rail-item:active .ql-rail-icon,
|
|
79
|
+
.ql-rail-item:hover .ql-rail-icon-active { transition: none; transform: none; }
|
|
80
|
+
.ql-rail-icon-active { transform: none; }
|
|
81
|
+
.ql-hover-accent { animation: none; }
|
|
82
|
+
}
|
|
83
|
+
`;
|
|
84
|
+
// CSS keyframes for collapsed popup flyout
|
|
28
85
|
const POPUP_ANIMATION_CSS = `
|
|
29
|
-
@keyframes
|
|
30
|
-
from { opacity: 0; transform: translateX(-
|
|
31
|
-
to
|
|
86
|
+
@keyframes flyoutIn {
|
|
87
|
+
from { opacity: 0; transform: translateX(-14px) scale(0.98); filter: blur(6px); }
|
|
88
|
+
to { opacity: 1; transform: translateX(0) scale(1); filter: blur(0); }
|
|
89
|
+
}
|
|
90
|
+
@keyframes flyoutItemIn {
|
|
91
|
+
from { opacity: 0; transform: translateX(10px); }
|
|
92
|
+
to { opacity: 1; transform: translateX(0); }
|
|
93
|
+
}
|
|
94
|
+
.ql-popup-flyout {
|
|
95
|
+
animation: flyoutIn 0.26s cubic-bezier(0.16, 1, 0.3, 1) forwards;
|
|
96
|
+
}
|
|
97
|
+
.ql-popup-item {
|
|
98
|
+
opacity: 0;
|
|
99
|
+
animation: flyoutItemIn 0.34s cubic-bezier(0.22, 1, 0.36, 1) forwards;
|
|
100
|
+
animation-delay: calc(60ms + var(--i, 0) * 38ms);
|
|
101
|
+
}
|
|
102
|
+
@media (prefers-reduced-motion: reduce) {
|
|
103
|
+
.ql-popup-flyout { animation-duration: 0.01ms; filter: none; }
|
|
104
|
+
.ql-popup-item { animation: none; opacity: 1; }
|
|
32
105
|
}
|
|
33
106
|
`;
|
|
34
107
|
const getTextColor = (active, navTheme) => {
|
|
@@ -98,6 +171,7 @@ const MenuItem = React__default.memo(({
|
|
|
98
171
|
onMenuHover,
|
|
99
172
|
onMenuLeave,
|
|
100
173
|
onNavigate,
|
|
174
|
+
registerItemRef,
|
|
101
175
|
ChevronUpIcon,
|
|
102
176
|
ChevronDownIcon
|
|
103
177
|
}) => {
|
|
@@ -110,7 +184,8 @@ const MenuItem = React__default.memo(({
|
|
|
110
184
|
const subMenuItemPaddingLeft = `${depth * 2}rem`;
|
|
111
185
|
// Determine styling based on whether it's a parent or child item
|
|
112
186
|
const isParentWithChildren = hasChildren && depth === 0;
|
|
113
|
-
const
|
|
187
|
+
const isTopLevel = depth === 0 && !isHoverMenu;
|
|
188
|
+
const shouldApplyBackground = !isTopLevel && isActive || isTopLevel && !collapsed && isActive && !isParentWithChildren || isHovered;
|
|
114
189
|
const handleMenuClick = useCallback(e => {
|
|
115
190
|
// Prevent event from bubbling to parent menu items
|
|
116
191
|
e.stopPropagation();
|
|
@@ -144,13 +219,16 @@ const MenuItem = React__default.memo(({
|
|
|
144
219
|
};
|
|
145
220
|
// Create a recursive function to render menu items and their children
|
|
146
221
|
const renderNestedItems = (items, currentDepth) => {
|
|
147
|
-
return items.map(childItem => {
|
|
222
|
+
return items.map((childItem, idx) => {
|
|
148
223
|
const isChildOpen = openMenus.includes(childItem.path);
|
|
149
224
|
const isChildActive = isMenuItemActive(childItem.path, locationPathname, routeParams, childItem.exact);
|
|
150
225
|
const hasGrandchildren = childItem.children && childItem.children.length > 0;
|
|
151
226
|
return React__default.createElement("div", {
|
|
152
227
|
key: childItem.path,
|
|
153
|
-
className: "popup-menu-item"
|
|
228
|
+
className: "ql-popup-item popup-menu-item",
|
|
229
|
+
style: {
|
|
230
|
+
['--i']: idx
|
|
231
|
+
}
|
|
154
232
|
}, React__default.createElement("div", {
|
|
155
233
|
className: `flex items-center justify-between w-full px-4 py-2.5 hover:bg-accent/20 text-sm cursor-pointer rounded-sm ${isChildActive ? 'bg-accent/10 text-primary font-medium' : 'text-foreground'} ${hasGrandchildren ? 'font-medium' : ''}`,
|
|
156
234
|
onClick: e => {
|
|
@@ -184,13 +262,17 @@ const MenuItem = React__default.memo(({
|
|
|
184
262
|
});
|
|
185
263
|
};
|
|
186
264
|
return React__default.createElement("div", {
|
|
187
|
-
className: "fixed shadow-themed-xl rounded-themed-lg border border-border z-[999] themed-dropdown bg-card",
|
|
265
|
+
className: "ql-popup-flyout fixed shadow-themed-xl rounded-themed-lg border border-border z-[999] themed-dropdown bg-card",
|
|
188
266
|
onClick: e => e.stopPropagation(),
|
|
189
267
|
style: {
|
|
190
268
|
left: `${SIDEBAR_WIDTHS[collapsed ? 'COLLAPSED' : 'EXPANDED']}px`,
|
|
191
269
|
top: `${Math.max(popupPosition.top - 20, 10)}px`,
|
|
192
270
|
// Adjust top position to be higher
|
|
193
|
-
|
|
271
|
+
transformOrigin: 'left center',
|
|
272
|
+
backdropFilter: 'blur(20px) saturate(1.4)',
|
|
273
|
+
WebkitBackdropFilter: 'blur(20px) saturate(1.4)',
|
|
274
|
+
background: 'hsl(var(--card) / 0.92)',
|
|
275
|
+
boxShadow: '0 24px 70px -24px rgba(0,0,0,0.45)',
|
|
194
276
|
maxWidth: 'calc(100vw - 120px)',
|
|
195
277
|
width: 'max-content',
|
|
196
278
|
minWidth: POPUP_CONFIG.MIN_WIDTH,
|
|
@@ -214,10 +296,13 @@ const MenuItem = React__default.memo(({
|
|
|
214
296
|
}, renderNestedItems(item.children)));
|
|
215
297
|
}, [item, depth, collapsed, popupPosition.top, openMenus, navTheme, locationPathname, routeParams, onToggleMenu, onNavigate, ChevronUpIcon, ChevronDownIcon]);
|
|
216
298
|
return React__default.createElement("div", {
|
|
217
|
-
|
|
299
|
+
ref: isTopLevel ? el => registerItemRef?.(item.path, el) : undefined,
|
|
300
|
+
className: `w-full relative group ${isTopLevel ? 'ql-rail-item' : ''} ${isHovered && collapsed && !isHoverMenu ? 'rounded-themed' : ''} ${isHovered && !isHoverMenu && !isTopLevel ? 'bg-muted' : ''}`,
|
|
218
301
|
onMouseEnter: e => onMenuHover(e, item, isHoverMenu),
|
|
219
302
|
onMouseLeave: () => onMenuLeave(item, isHoverMenu)
|
|
220
|
-
}, React__default.createElement("
|
|
303
|
+
}, isTopLevel && isParentWithChildren && isHovered && !isActive && React__default.createElement("span", {
|
|
304
|
+
className: "absolute left-0 top-1.5 bottom-1.5 w-0.5 rounded-full ql-hover-accent"
|
|
305
|
+
}), React__default.createElement("div", {
|
|
221
306
|
className: `flex items-center justify-between w-full px-1 py-2 hover:bg-muted text-sm cursor-pointer transition-colors rounded-themed mx-1 my-0.5 whitespace-nowrap overflow-hidden text-ellipsis ${shouldApplyBackground ? 'bg-muted' : ''}`,
|
|
222
307
|
style: {
|
|
223
308
|
paddingLeft: `calc(1rem + ${depth > 0 ? subMenuItemPaddingLeft : menuItemPaddingLeft})`
|
|
@@ -226,9 +311,9 @@ const MenuItem = React__default.memo(({
|
|
|
226
311
|
}, React__default.createElement("div", {
|
|
227
312
|
className: `flex items-center ${collapsed && !isHoverMenu ? 'justify-center w-full' : 'gap-3'}`
|
|
228
313
|
}, item.icon ? React__default.createElement("span", {
|
|
229
|
-
className: `flex-shrink-0 ${getIconColor(isActive, navTheme)}`
|
|
314
|
+
className: `flex-shrink-0 ${getIconColor(isActive, navTheme)} ${isTopLevel && collapsed ? `ql-rail-icon ${isActive ? 'ql-rail-icon-active' : ''}` : ''}`
|
|
230
315
|
}, item.icon) : collapsed && !isHoverMenu ? React__default.createElement("span", {
|
|
231
|
-
className: `flex items-center justify-center flex-shrink-0 ${getIconColor(isActive, navTheme)}`
|
|
316
|
+
className: `flex items-center justify-center flex-shrink-0 ${getIconColor(isActive, navTheme)} ${isTopLevel ? `text-[16px] h-6 w-6 select-none text-center ql-rail-icon ${isActive ? 'ql-rail-icon-active' : ''}` : ''}`
|
|
232
317
|
}, getFirstLetter(item.name)) : null, (!collapsed || isHoverMenu) && React__default.createElement("span", {
|
|
233
318
|
className: `font-medium whitespace-nowrap overflow-hidden text-ellipsis ${getTextColor(isActive, navTheme)} ${depth > 0 ? `text-xs` : ''}`
|
|
234
319
|
}, item.name)), hasChildren && (!collapsed || isHoverMenu) && React__default.createElement("span", {
|
|
@@ -255,6 +340,7 @@ const MenuItem = React__default.memo(({
|
|
|
255
340
|
onMenuHover: onMenuHover,
|
|
256
341
|
onMenuLeave: onMenuLeave,
|
|
257
342
|
onNavigate: onNavigate,
|
|
343
|
+
registerItemRef: registerItemRef,
|
|
258
344
|
ChevronUpIcon: ChevronUpIcon,
|
|
259
345
|
ChevronDownIcon: ChevronDownIcon
|
|
260
346
|
}))));
|
|
@@ -290,11 +376,79 @@ function MainSidebarMenuComponent({
|
|
|
290
376
|
top: 0,
|
|
291
377
|
height: 0
|
|
292
378
|
});
|
|
379
|
+
const navRef = useRef(null);
|
|
380
|
+
const itemRefs = useRef({});
|
|
381
|
+
const [indicator, setIndicator] = useState({
|
|
382
|
+
y: 0,
|
|
383
|
+
h: 0,
|
|
384
|
+
visible: false
|
|
385
|
+
});
|
|
386
|
+
const indicatorPrimed = useRef(false);
|
|
387
|
+
const [indicatorAnimated, setIndicatorAnimated] = useState(false);
|
|
293
388
|
const {
|
|
294
389
|
ChevronDownIcon,
|
|
295
390
|
ChevronUpIcon
|
|
296
391
|
} = icons;
|
|
297
392
|
const navTheme = settings?.navTheme;
|
|
393
|
+
const registerItemRef = useCallback((path, el) => {
|
|
394
|
+
itemRefs.current[path] = el;
|
|
395
|
+
}, []);
|
|
396
|
+
// Tear down hover popup state on route change — mouse-leave never fires after in-popup navigation.
|
|
397
|
+
useEffect(() => {
|
|
398
|
+
setHoveredMenu(null);
|
|
399
|
+
}, [location.pathname]);
|
|
400
|
+
const isMenuItemActiveAtRoot = useCallback(itemPath => isMenuItemActive(itemPath, location.pathname, routeParams), [location.pathname, routeParams]);
|
|
401
|
+
const measureIndicator = useCallback(() => {
|
|
402
|
+
if (typeof window === 'undefined') return false;
|
|
403
|
+
const nav = navRef.current;
|
|
404
|
+
if (!nav) return false;
|
|
405
|
+
const activeItem = menuData.find(item => isMenuItemActiveAtRoot(item.path));
|
|
406
|
+
const el = activeItem ? itemRefs.current[activeItem.path] : null;
|
|
407
|
+
if (el) {
|
|
408
|
+
setIndicator({
|
|
409
|
+
y: el.offsetTop,
|
|
410
|
+
h: el.offsetHeight,
|
|
411
|
+
visible: true
|
|
412
|
+
});
|
|
413
|
+
return true;
|
|
414
|
+
}
|
|
415
|
+
setIndicator(prev => ({
|
|
416
|
+
...prev,
|
|
417
|
+
visible: false
|
|
418
|
+
}));
|
|
419
|
+
return !activeItem;
|
|
420
|
+
}, [menuData, isMenuItemActiveAtRoot]);
|
|
421
|
+
const measureRef = useRef(measureIndicator);
|
|
422
|
+
measureRef.current = measureIndicator;
|
|
423
|
+
useEffect(() => {
|
|
424
|
+
if (typeof window === 'undefined') return;
|
|
425
|
+
const nav = navRef.current;
|
|
426
|
+
if (!nav) return;
|
|
427
|
+
const run = () => measureRef.current();
|
|
428
|
+
const ro = typeof ResizeObserver !== 'undefined' ? new ResizeObserver(run) : null;
|
|
429
|
+
ro?.observe(nav);
|
|
430
|
+
window.addEventListener('resize', run);
|
|
431
|
+
return () => {
|
|
432
|
+
ro?.disconnect();
|
|
433
|
+
window.removeEventListener('resize', run);
|
|
434
|
+
};
|
|
435
|
+
}, []);
|
|
436
|
+
useEffect(() => {
|
|
437
|
+
if (typeof window === 'undefined') return;
|
|
438
|
+
const rafs = [];
|
|
439
|
+
if (!measureRef.current()) {
|
|
440
|
+
rafs.push(requestAnimationFrame(() => {
|
|
441
|
+
if (!measureRef.current()) rafs.push(requestAnimationFrame(() => measureRef.current()));
|
|
442
|
+
}));
|
|
443
|
+
}
|
|
444
|
+
if (!indicatorPrimed.current) {
|
|
445
|
+
indicatorPrimed.current = true;
|
|
446
|
+
rafs.push(requestAnimationFrame(() => setIndicatorAnimated(true)));
|
|
447
|
+
} else {
|
|
448
|
+
setIndicatorAnimated(true);
|
|
449
|
+
}
|
|
450
|
+
return () => rafs.forEach(r => cancelAnimationFrame(r));
|
|
451
|
+
}, [location.pathname, menuData, routeParams, collapsed]);
|
|
298
452
|
// Initialize openMenus based on the current path
|
|
299
453
|
const [openMenus, setOpenMenus] = useState(() => {
|
|
300
454
|
return findParentPaths(menuData, location.pathname, routeParams);
|
|
@@ -429,9 +583,25 @@ function MainSidebarMenuComponent({
|
|
|
429
583
|
}, [navigate]);
|
|
430
584
|
return React__default.createElement("div", {
|
|
431
585
|
className: "overflow-hidden"
|
|
432
|
-
}, React__default.createElement("
|
|
586
|
+
}, React__default.createElement("style", {
|
|
587
|
+
dangerouslySetInnerHTML: {
|
|
588
|
+
__html: SIDEBAR_MOTION_CSS
|
|
589
|
+
}
|
|
590
|
+
}), React__default.createElement("nav", {
|
|
591
|
+
ref: navRef,
|
|
592
|
+
style: {
|
|
593
|
+
position: 'relative'
|
|
594
|
+
},
|
|
433
595
|
className: `mt-2 ${collapsed ? 'px-1' : 'px-2'} overflow-x-hidden`
|
|
434
|
-
},
|
|
596
|
+
}, React__default.createElement("span", {
|
|
597
|
+
"aria-hidden": "true",
|
|
598
|
+
className: `ql-rail-indicator ${indicatorAnimated ? 'ql-rail-indicator--animated' : ''}`,
|
|
599
|
+
style: {
|
|
600
|
+
transform: `translateY(${indicator.y + 6}px)`,
|
|
601
|
+
height: `${Math.max(indicator.h - 12, 0)}px`,
|
|
602
|
+
opacity: indicator.visible ? 1 : 0
|
|
603
|
+
}
|
|
604
|
+
}), menuData.map(item => React__default.createElement(MenuItem, {
|
|
435
605
|
key: item.path,
|
|
436
606
|
item: item,
|
|
437
607
|
depth: 0,
|
|
@@ -447,6 +617,7 @@ function MainSidebarMenuComponent({
|
|
|
447
617
|
onMenuHover: handleMenuHover,
|
|
448
618
|
onMenuLeave: handleMenuLeave,
|
|
449
619
|
onNavigate: handleNavigate,
|
|
620
|
+
registerItemRef: registerItemRef,
|
|
450
621
|
ChevronUpIcon: ChevronUpIcon,
|
|
451
622
|
ChevronDownIcon: ChevronDownIcon
|
|
452
623
|
}))));
|