@schemavaults/ui 0.46.1 → 0.46.6
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/dist/components/layout/dashboard-layout/dashboard-sidebar/dashboard-sidebar.js +1 -1
- package/dist/components/layout/dashboard-layout/dashboard-sidebar/dashboard-sidebar.js.map +1 -1
- package/dist/components/layout/dashboard-layout/dashboard-sidebar/useCloseDashboardSidebarOnRouteChange.js +12 -8
- package/dist/components/layout/dashboard-layout/dashboard-sidebar/useCloseDashboardSidebarOnRouteChange.js.map +1 -1
- package/package.json +1 -1
|
@@ -15,7 +15,7 @@ export function DashboardSidebar(props) {
|
|
|
15
15
|
if (openState.mobile) {
|
|
16
16
|
return (_jsx(Sheet, { open: openState.open, onOpenChange: (newOpenState) => {
|
|
17
17
|
setOpen(newOpenState);
|
|
18
|
-
},
|
|
18
|
+
}, children: _jsxs(SheetContent, { side: "left", className: cn(size.mobile_expanded_width_classname), style: {
|
|
19
19
|
zIndex: 1000,
|
|
20
20
|
}, children: [_jsx(VisuallyHidden, { children: _jsxs(SheetHeader, { children: [_jsx(SheetTitle, { children: "Sidebar Mobile Navigation Menu" }), _jsx(SheetDescription, { children: "This sidebar contains links for navigating to other pages within this application." })] }) }), _jsx(DashboardLayoutSidebarLayout, { logo: props.logo, wordmark: props.wordmark, Link: props.Link, brandHref: props.brandHref, sidebarFooterContent: props.sidebarFooterContent })] }) }));
|
|
21
21
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard-sidebar.js","sourceRoot":"","sources":["../../../../../src/components/layout/dashboard-layout/dashboard-sidebar/dashboard-sidebar.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAqB,UAAU,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,4BAA4B,MAAM,gCAAgC,CAAC;AAC1E,OAAO,EAAE,wCAAwC,EAAE,MAAM,gCAAgC,CAAC;AAC1F,OAAO,EACL,KAAK,EACL,YAAY,EACZ,gBAAgB,EAChB,WAAW,EACX,UAAU,GACX,MAAM,uBAAuB,CAAC;AAC/B,OAAO,4BAEN,MAAM,4BAA4B,CAAC;AACpC,OAAO,yBAAyB,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO,cAAc,MAAM,iCAAiC,CAAC;AAE7D,MAAM,UAAU,gBAAgB,CAC9B,KAAwC;IAExC,MAAM,IAAI,GAAG,yBAAyB,EAAE,CAAC;IACzC,MAAM,SAAS,GAAG,4BAA4B,EAAE,CAAC;IACjD,MAAM,OAAO,GAAG,UAAU,CAAC,wCAAwC,CAAC,CAAC;IACrE,IAAI,SAAS,CAAC,MAAM,EAAE,CAAC;QACrB,OAAO,CACL,KAAC,KAAK,IACJ,IAAI,EAAE,SAAS,CAAC,IAAI,EACpB,YAAY,EAAE,CAAC,YAAqB,EAAQ,EAAE;gBAC5C,OAAO,CAAC,YAAY,CAAC,CAAC;YACxB,CAAC,
|
|
1
|
+
{"version":3,"file":"dashboard-sidebar.js","sourceRoot":"","sources":["../../../../../src/components/layout/dashboard-layout/dashboard-sidebar/dashboard-sidebar.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAqB,UAAU,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,4BAA4B,MAAM,gCAAgC,CAAC;AAC1E,OAAO,EAAE,wCAAwC,EAAE,MAAM,gCAAgC,CAAC;AAC1F,OAAO,EACL,KAAK,EACL,YAAY,EACZ,gBAAgB,EAChB,WAAW,EACX,UAAU,GACX,MAAM,uBAAuB,CAAC;AAC/B,OAAO,4BAEN,MAAM,4BAA4B,CAAC;AACpC,OAAO,yBAAyB,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO,cAAc,MAAM,iCAAiC,CAAC;AAE7D,MAAM,UAAU,gBAAgB,CAC9B,KAAwC;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Event } from "react";
|
|
3
3
|
import useDashboardSidebarOpenState from "./useDashboardSidebarOpenState";
|
|
4
4
|
import useDashboardSidebarOpenStateDispatch from "./useDashboardSidebarOpenStateDispatch";
|
|
5
5
|
import useDebug from "../../../hooks/use-debug";
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
//
|
|
6
|
+
// Close the mobile sidebar when the pathname changes. The pre-0.46.6 version
|
|
7
|
+
// listed `open` and `mobile` in the deps array alongside `pathname`, which
|
|
8
|
+
// meant the effect re-fired the moment the user tapped the mobile trigger
|
|
9
|
+
// (open: false -> true) and immediately closed the Sheet they just opened.
|
|
10
|
+
// Reading `mobile`/`open`/`setOpen`/`debug` via `useEffectEvent` keeps them
|
|
11
|
+
// out of the deps so the effect only runs on actual pathname transitions.
|
|
11
12
|
export function useCloseDashboardSidebarOnRouteChange(usePathname) {
|
|
12
13
|
const debug = useDebug();
|
|
13
14
|
const pathname = usePathname();
|
|
@@ -15,14 +16,17 @@ export function useCloseDashboardSidebarOnRouteChange(usePathname) {
|
|
|
15
16
|
const open = state.open;
|
|
16
17
|
const mobile = state.mobile ?? false;
|
|
17
18
|
const setOpen = useDashboardSidebarOpenStateDispatch();
|
|
18
|
-
|
|
19
|
+
const closeIfOpenOnMobile = useEffectEvent(() => {
|
|
19
20
|
if (mobile && open) {
|
|
20
21
|
if (debug) {
|
|
21
22
|
console.log("[useCloseDashboardSidebarOnRouteChange] Closing sidebar...");
|
|
22
23
|
}
|
|
23
24
|
setOpen(false);
|
|
24
25
|
}
|
|
25
|
-
}
|
|
26
|
+
});
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
closeIfOpenOnMobile();
|
|
29
|
+
}, [pathname]);
|
|
26
30
|
}
|
|
27
31
|
export default useCloseDashboardSidebarOnRouteChange;
|
|
28
32
|
//# sourceMappingURL=useCloseDashboardSidebarOnRouteChange.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCloseDashboardSidebarOnRouteChange.js","sourceRoot":"","sources":["../../../../../src/components/layout/dashboard-layout/dashboard-sidebar/useCloseDashboardSidebarOnRouteChange.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"useCloseDashboardSidebarOnRouteChange.js","sourceRoot":"","sources":["../../../../../src/components/layout/dashboard-layout/dashboard-sidebar/useCloseDashboardSidebarOnRouteChange.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,4BAA4B,MAAM,gCAAgC,CAAC;AAC1E,OAAO,oCAAoC,MAAM,wCAAwC,CAAC;AAC1F,OAAO,QAAQ,MAAM,8BAA8B,CAAC;AAEpD,6EAA6E;AAC7E,2EAA2E;AAC3E,0EAA0E;AAC1E,2EAA2E;AAC3E,4EAA4E;AAC5E,0EAA0E;AAC1E,MAAM,UAAU,qCAAqC,CACnD,WAAyB;IAEzB,MAAM,KAAK,GAAY,QAAQ,EAAE,CAAC;IAClC,MAAM,QAAQ,GAAW,WAAW,EAAE,CAAC;IACvC,MAAM,KAAK,GAAG,4BAA4B,EAAE,CAAC;IAC7C,MAAM,IAAI,GAAY,KAAK,CAAC,IAAI,CAAC;IACjC,MAAM,MAAM,GAAY,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC;IAC9C,MAAM,OAAO,GAAG,oCAAoC,EAAE,CAAC;IAEvD,MAAM,mBAAmB,GAAG,cAAc,CAAC,GAAS,EAAE;QACpD,IAAI,MAAM,IAAI,IAAI,EAAE,CAAC;YACnB,IAAI,KAAK,EAAE,CAAC;gBACV,OAAO,CAAC,GAAG,CACT,4DAA4D,CAC7D,CAAC;YACJ,CAAC;YACD,OAAO,CAAC,KAAK,CAAC,CAAC;QACjB,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,SAAS,CAAC,GAAS,EAAE;QACnB,mBAAmB,EAAE,CAAC;IACxB,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;AACjB,CAAC;AAED,eAAe,qCAAqC,CAAC"}
|