@schemavaults/ui 0.98.4 → 0.99.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.
- package/dist/components/layout/dashboard-layout/dashboard-sidebar/dashboard-sidebar-content.d.ts +29 -0
- package/dist/components/layout/dashboard-layout/dashboard-sidebar/dashboard-sidebar-content.js +35 -10
- package/dist/components/layout/dashboard-layout/dashboard-sidebar/dashboard-sidebar-content.js.map +1 -1
- package/dist/components/layout/dashboard-layout/dashboard-sidebar/dashboard-sidebar-item-group-renderer.js +16 -2
- package/dist/components/layout/dashboard-layout/dashboard-sidebar/dashboard-sidebar-item-group-renderer.js.map +1 -1
- package/dist/components/layout/dashboard-layout/dashboard-sidebar/dashboard-sidebar-item-renderer.js +18 -1
- package/dist/components/layout/dashboard-layout/dashboard-sidebar/dashboard-sidebar-item-renderer.js.map +1 -1
- package/dist/components/layout/dashboard-layout/dashboard-sidebar/dashboard-sidebar-sizing.d.ts +24 -1
- package/dist/components/layout/dashboard-layout/dashboard-sidebar/dashboard-sidebar-sizing.js +3 -1
- package/dist/components/layout/dashboard-layout/dashboard-sidebar/dashboard-sidebar-sizing.js.map +1 -1
- package/package.json +1 -1
package/dist/components/layout/dashboard-layout/dashboard-sidebar/dashboard-sidebar-content.d.ts
CHANGED
|
@@ -1,7 +1,36 @@
|
|
|
1
1
|
import type { ReactElement } from "react";
|
|
2
|
+
import type { DashboardSidebarItemDefinition } from "./dashboard-sidebar-item-definition";
|
|
3
|
+
import type { DashboardSidebarItemGroupDefinition } from "./dashboard-sidebar-item-group";
|
|
2
4
|
import type { LinkComponentType } from "../../../../types/Link";
|
|
3
5
|
export interface DashboardLayoutSidebarContentProps {
|
|
4
6
|
Link: LinkComponentType;
|
|
5
7
|
}
|
|
8
|
+
type DashboardSidebarEntry = DashboardSidebarItemDefinition | DashboardSidebarItemGroupDefinition;
|
|
9
|
+
/**
|
|
10
|
+
* A consecutive run of ungrouped menu items, rendered into a single <ul>.
|
|
11
|
+
*
|
|
12
|
+
* Ungrouped items used to be emitted as bare <li> children of the menu <nav>.
|
|
13
|
+
* That is invalid markup — an <li> outside a list container — and it meant the
|
|
14
|
+
* spacing between plain links came from the <nav>'s own gap while the spacing
|
|
15
|
+
* between grouped links came from each group's <ul> gap: two independent
|
|
16
|
+
* declarations that only agreed by coincidence. Collecting ungrouped items
|
|
17
|
+
* into their own list gives both paths the same structure, so they cannot
|
|
18
|
+
* drift apart again.
|
|
19
|
+
*/
|
|
20
|
+
interface UngroupedSidebarItemRun {
|
|
21
|
+
kind: "ungrouped-item-run";
|
|
22
|
+
items: DashboardSidebarItemDefinition[];
|
|
23
|
+
}
|
|
24
|
+
interface SidebarGroupBlock {
|
|
25
|
+
kind: "group";
|
|
26
|
+
group: DashboardSidebarItemGroupDefinition;
|
|
27
|
+
}
|
|
28
|
+
type DashboardSidebarRenderBlock = UngroupedSidebarItemRun | SidebarGroupBlock;
|
|
29
|
+
/**
|
|
30
|
+
* Collapse the flat item/group list into render blocks, preserving the order
|
|
31
|
+
* the consumer supplied. Adjacent ungrouped items merge into one run; a group
|
|
32
|
+
* always starts a new block.
|
|
33
|
+
*/
|
|
34
|
+
export declare function toDashboardSidebarRenderBlocks(entries: readonly DashboardSidebarEntry[]): DashboardSidebarRenderBlock[];
|
|
6
35
|
export declare function DashboardSidebarContent({ Link, }: DashboardLayoutSidebarContentProps): ReactElement;
|
|
7
36
|
export default DashboardSidebarContent;
|
package/dist/components/layout/dashboard-layout/dashboard-sidebar/dashboard-sidebar-content.js
CHANGED
|
@@ -6,21 +6,46 @@ import useDashboardSidebarItemsAndGroups from "./useDashboardSidebarItemsAndGrou
|
|
|
6
6
|
import { m } from "../../../../framer-motion";
|
|
7
7
|
import { cn } from "../../../../lib/utils";
|
|
8
8
|
import useDashboardSidebarSizing from "./useDashboardSidebarSizing";
|
|
9
|
+
/**
|
|
10
|
+
* Collapse the flat item/group list into render blocks, preserving the order
|
|
11
|
+
* the consumer supplied. Adjacent ungrouped items merge into one run; a group
|
|
12
|
+
* always starts a new block.
|
|
13
|
+
*/
|
|
14
|
+
export function toDashboardSidebarRenderBlocks(entries) {
|
|
15
|
+
const blocks = [];
|
|
16
|
+
for (const entry of entries) {
|
|
17
|
+
if (entry.type === "dashboard-sidebar-item-definition") {
|
|
18
|
+
const previousBlock = blocks[blocks.length - 1];
|
|
19
|
+
if (previousBlock !== undefined && previousBlock.kind === "ungrouped-item-run") {
|
|
20
|
+
previousBlock.items.push(entry);
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
blocks.push({ kind: "ungrouped-item-run", items: [entry] });
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
else if (entry.type === "dashboard-sidebar-item-group") {
|
|
27
|
+
blocks.push({ kind: "group", group: entry });
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
throw new TypeError("Invalid 'type' for sidebar content item in render list!");
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return blocks;
|
|
34
|
+
}
|
|
9
35
|
export function DashboardSidebarContent({ Link, }) {
|
|
10
36
|
const sidebarItems = useDashboardSidebarItemsAndGroups();
|
|
11
37
|
const sizes = useDashboardSidebarSizing();
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
else if (itemOrGroup.type === "dashboard-sidebar-item-group") {
|
|
18
|
-
const group = itemOrGroup;
|
|
38
|
+
const blocks = toDashboardSidebarRenderBlocks(sidebarItems);
|
|
39
|
+
return (_jsx(m.nav, { className: cn("bg-background grow w-full", "flex flex-col items-center justify-start flex-nowrap", sizes.sidebar_menu_item_gap_classname, "overflow-x-hidden overflow-y-scroll", "no-scrollbar"), children: blocks.map((block) => {
|
|
40
|
+
if (block.kind === "group") {
|
|
41
|
+
const group = block.group;
|
|
19
42
|
return (_jsx(DashboardSidebarItemGroupRenderer, { group: group, Link: Link }, `sidebar-group-[${group.title}]`));
|
|
20
43
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
44
|
+
const firstItemTitle = block.items[0].title;
|
|
45
|
+
return (_jsx(m.ul, { layout: true, className: cn("w-full flex flex-col", "items-start justify-start", sizes.sidebar_menu_item_gap_classname,
|
|
46
|
+
// The <nav> is a scrolling flex column; without this the run
|
|
47
|
+
// would be squashed once the menu overflows.
|
|
48
|
+
"flex-shrink-0"), children: block.items.map((item) => (_jsx(DashboardSidebarItemRenderer, { item: item, Link: Link }, `sidebar-item-[${item.title}]`))) }, `sidebar-ungrouped-items-[${firstItemTitle}]`));
|
|
24
49
|
}) }));
|
|
25
50
|
}
|
|
26
51
|
export default DashboardSidebarContent;
|
package/dist/components/layout/dashboard-layout/dashboard-sidebar/dashboard-sidebar-content.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard-sidebar-content.js","sourceRoot":"","sources":["../../../../../src/components/layout/dashboard-layout/dashboard-sidebar/dashboard-sidebar-content.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAIb,OAAO,4BAA4B,MAAM,mCAAmC,CAAC;AAG7E,OAAO,iCAAiC,MAAM,yCAAyC,CAAC;AACxF,OAAO,iCAAiC,MAAM,qCAAqC,CAAC;AACpF,OAAO,EAAE,CAAC,EAAE,MAAM,iBAAiB,CAAC;AACpC,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AAEjC,OAAO,yBAAyB,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"dashboard-sidebar-content.js","sourceRoot":"","sources":["../../../../../src/components/layout/dashboard-layout/dashboard-sidebar/dashboard-sidebar-content.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAIb,OAAO,4BAA4B,MAAM,mCAAmC,CAAC;AAG7E,OAAO,iCAAiC,MAAM,yCAAyC,CAAC;AACxF,OAAO,iCAAiC,MAAM,qCAAqC,CAAC;AACpF,OAAO,EAAE,CAAC,EAAE,MAAM,iBAAiB,CAAC;AACpC,OAAO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B,sDAAsD,EACtD,KAAK,CAAC,+BAA+B,EACrC,qCAAqC,EACrC,cAAc,CACf,YAEA,MAAM,CAAC,GAAG,CAAC,CAAC,KAAkC,EAAa,EAAE;YAC5D,IAAI,KAAK,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;gBAC3B,MAAM,KAAK,GAAwC,KAAK,CAAC,KAAK,CAAC;gBAC/D,OAAO,CACL,KAAC,iCAAiC,IAChC,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,IAAI,IACL,kBAAkB,KAAK,CAAC,KAAK,GAAG,CACrC,CACH,CAAC;YACJ,CAAC;YAED,MAAM,cAAc,GAAW,KAAK,CAAC,KAAK,CAAC,CAAC,CAAE,CAAC,KAAK,CAAC;YACrD,OAAO,CACL,KAAC,CAAC,CAAC,EAAE,IAEH,MAAM,QACN,SAAS,EAAE,EAAE,CACX,sBAAsB,EACtB,2BAA2B,EAC3B,KAAK,CAAC,+BAA+B;gBACrC,6DAA6D;gBAC7D,6CAA6C;gBAC7C,eAAe,CAChB,YAEA,KAAK,CAAC,KAAK,CAAC,GAAG,CACd,CAAC,IAAoC,EAAgB,EAAE,CAAC,CACtD,KAAC,4BAA4B,IAC3B,IAAI,EAAE,IAAI,EACV,IAAI,EAAE,IAAI,IACL,iBAAiB,IAAI,CAAC,KAAK,GAAG,CACnC,CACH,CACF,IAnBI,4BAA4B,cAAc,GAAG,CAoB7C,CACR,CAAC;QACJ,CAAC,CAAC,GACI,CACT,CAAC;AACJ,CAAC;AAED,eAAe,uBAAuB,CAAC"}
|
|
@@ -14,7 +14,11 @@ export function DashboardSidebarItemGroupRenderer({ group, Link, }) {
|
|
|
14
14
|
const sizes = useDashboardSidebarSizing();
|
|
15
15
|
const groupItemsContainerId = `sidebar-group-items-[${group.title}]`;
|
|
16
16
|
const showGroupLabel = openState.mobile || openState.open;
|
|
17
|
-
return (_jsxs(m.div, { className: cn("w-full", "flex flex-col flex-nowrap", "items-start justify-start"
|
|
17
|
+
return (_jsxs(m.div, { className: cn("w-full", "flex flex-col flex-nowrap", "items-start justify-start",
|
|
18
|
+
// The menu <nav> is a scrolling flex column, so its children shrink
|
|
19
|
+
// by default once the menu overflows. Keep the group at its natural
|
|
20
|
+
// height and let the <nav> scroll instead.
|
|
21
|
+
"flex-shrink-0"), layout: true, children: [_jsx(AnimatePresence, { children: showGroupLabel && (_jsx(m.div, { className: "w-full text-nowrap", initial: {
|
|
18
22
|
scale: 0,
|
|
19
23
|
opacity: 0,
|
|
20
24
|
width: 0,
|
|
@@ -49,7 +53,17 @@ export function DashboardSidebarItemGroupRenderer({ group, Link, }) {
|
|
|
49
53
|
ease: toggleDashboardLayoutCollapsedTransitionEasing,
|
|
50
54
|
delay: 0,
|
|
51
55
|
},
|
|
52
|
-
}, children: _jsx(Label, { htmlFor: groupItemsContainerId, className: cn("font-bold text-nowrap",
|
|
56
|
+
}, children: _jsx(Label, { htmlFor: groupItemsContainerId, className: cn("font-bold text-nowrap", "block"),
|
|
57
|
+
// Align the group heading with the item titles underneath it:
|
|
58
|
+
// each item renders its icon inside a box exactly
|
|
59
|
+
// `desktop_collapsed_width` wide, so its title starts at that
|
|
60
|
+
// offset. Deriving the inset from the same value keeps heading
|
|
61
|
+
// and titles on one left edge instead of the old `mx-2`, which
|
|
62
|
+
// lined up with neither the icons nor the titles.
|
|
63
|
+
style: {
|
|
64
|
+
paddingLeft: sizes.desktop_collapsed_width,
|
|
65
|
+
paddingRight: "0.5rem",
|
|
66
|
+
}, children: groupTitle }) }, "sidebar-item-group-label")) }), _jsx(DashboardSidebarAdminOnlyItemsContext.Provider, { value: group.adminOnly ?? false, children: _jsx(m.ul, { id: groupItemsContainerId, layout: true, className: cn("w-full flex flex-col", "items-start justify-start", sizes.sidebar_menu_item_gap_classname), children: group.items.map((item) => {
|
|
53
67
|
return (_jsx(DashboardSidebarItemRenderer, { item: item, Link: Link }, `sidebar-item-[${groupTitle}]-[${item.title}]`));
|
|
54
68
|
}) }) })] }, `sidebar-group-[${group.title}]`));
|
|
55
69
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard-sidebar-item-group-renderer.js","sourceRoot":"","sources":["../../../../../src/components/layout/dashboard-layout/dashboard-sidebar/dashboard-sidebar-item-group-renderer.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAKb,OAAO,4BAA4B,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,4BAA4B,MAAM,gCAAgC,CAAC;AAC1E,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,CAAC,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,yBAAyB,MAAM,6BAA6B,CAAC;AACpE,OAAO,EACL,4CAA4C,EAC5C,8CAA8C,GAC/C,MAAM,sDAAsD,CAAC;AAC9D,OAAO,EAAE,qCAAqC,EAAE,MAAM,8CAA8C,CAAC;AAGrG,MAAM,UAAU,iCAAiC,CAAC,EAChD,KAAK,EACL,IAAI,GAIL;IACC,MAAM,UAAU,GAAW,KAAK,CAAC,KAAK,CAAC;IACvC,MAAM,SAAS,GAAG,4BAA4B,EAAE,CAAC;IACjD,MAAM,KAAK,GAAG,yBAAyB,EAAE,CAAC;IAE1C,MAAM,qBAAqB,GAAW,wBAAwB,KAAK,CAAC,KAAK,GAAG,CAAC;IAC7E,MAAM,cAAc,GAAG,SAAS,CAAC,MAAM,IAAI,SAAS,CAAC,IAAI,CAAC;IAE1D,OAAO,CACL,MAAC,CAAC,CAAC,GAAG,IAEJ,SAAS,EAAE,EAAE,CACX,QAAQ,EACR,2BAA2B,EAC3B,2BAA2B,
|
|
1
|
+
{"version":3,"file":"dashboard-sidebar-item-group-renderer.js","sourceRoot":"","sources":["../../../../../src/components/layout/dashboard-layout/dashboard-sidebar/dashboard-sidebar-item-group-renderer.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAKb,OAAO,4BAA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AO,CACL,KAAC,4BAA4B,IAC3B,IAAI,EAAE,IAAI,EACV,IAAI,EAAE,IAAI,IACL,iBAAiB,UAAU,MAAM,IAAI,CAAC,KAAsB,GAAG,CACpE,CACH,CAAC;oBACJ,CAAC,CACF,GACI,GACwC,KArG5C,kBAAkB,KAAK,CAAC,KAAK,GAAG,CAsG/B,CACT,CAAC;AACJ,CAAC;AAED,eAAe,iCAAiC,CAAC"}
|
package/dist/components/layout/dashboard-layout/dashboard-sidebar/dashboard-sidebar-item-renderer.js
CHANGED
|
@@ -42,7 +42,24 @@ export function DashboardSidebarItemRenderer({ item, Link, }) {
|
|
|
42
42
|
duration: toggleDashboardLayoutCollapsedTransitionTime,
|
|
43
43
|
}, children: item.title }, `sidebar-menu-item-title-container-[${item.title}]`));
|
|
44
44
|
}
|
|
45
|
-
return (_jsx(m.li, {
|
|
45
|
+
return (_jsx(m.li, {
|
|
46
|
+
// `layout` keeps a row's position/size animated while the sidebar
|
|
47
|
+
// expands and collapses, matching the group wrapper and group <ul>,
|
|
48
|
+
// which have always had it. Without it, ungrouped rows snapped into
|
|
49
|
+
// place while grouped rows glided.
|
|
50
|
+
layout: true, className: cn("w-full", sizes.sidebar_menu_item_height_classname,
|
|
51
|
+
// The menu <nav> is a flex column with a definite height (it grows
|
|
52
|
+
// inside an h-screen sidebar) and its own scrollbar. Flex children
|
|
53
|
+
// shrink by default, so once the menu overflowed, rows squashed
|
|
54
|
+
// below their configured height instead of scrolling — and because
|
|
55
|
+
// grouped rows sit one level deeper, inside their group's <ul>, only
|
|
56
|
+
// the ungrouped rows collapsed. That is the "different spacing"
|
|
57
|
+
// between plain and grouped links. Opt out of shrinking, like the
|
|
58
|
+
// sidebar header and footer already do.
|
|
59
|
+
"flex-shrink-0"), children: _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { className: cn("w-full h-full"), children: _jsxs(Link, { href: item.url, className: cn("flex flex-row flex-nowrap", "justify-start items-center", "w-full h-full",
|
|
60
|
+
// Theme token rather than a hardcoded gray: bg-gray-200 was
|
|
61
|
+
// near-invisible against a dark background.
|
|
62
|
+
"hover:bg-accent transition-colors"), onClick: () => {
|
|
46
63
|
if (debug) {
|
|
47
64
|
console.log("[DashboardSidebarItemRenderer] onClick(item), where item = ", item);
|
|
48
65
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard-sidebar-item-renderer.js","sourceRoot":"","sources":["../../../../../src/components/layout/dashboard-layout/dashboard-sidebar/dashboard-sidebar-item-renderer.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,UAAU,EAAqB,MAAM,OAAO,CAAC;AAGtD,OAAO,EAAE,eAAe,EAAE,CAAC,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,4CAA4C,MAAM,sDAAsD,CAAC;AAChH,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO,4BAA4B,MAAM,gCAAgC,CAAC;AAC1E,OAAO,yBAAyB,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,qCAAqC,EAAE,MAAM,8CAA8C,CAAC;AACrG,OAAO,EACL,OAAO,EACP,cAAc,EACd,cAAc,EACd,YAAY,GACb,MAAM,iBAAiB,CAAC;AAEzB,OAAO,oCAAoC,MAAM,wCAAwC,CAAC;AAC1F,OAAO,QAAQ,MAAM,8BAA8B,CAAC;AAGpD,MAAM,UAAU,4BAA4B,CAAC,EAC3C,IAAI,EACJ,IAAI,GAIL;IACC,MAAM,KAAK,GAAY,QAAQ,EAAE,CAAC;IAClC,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,4BAA4B,EAAE,CAAC;IACxD,MAAM,cAAc,GAAG,oCAAoC,EAAE,CAAC;IAC9D,MAAM,KAAK,GAAG,yBAAyB,EAAE,CAAC;IAC1C,MAAM,gBAAgB,GAAY,UAAU,CAC1C,qCAAqC,CACtC,CAAC;IACF,MAAM,aAAa,GAAY,MAAM,IAAI,IAAI,CAAC;IAE9C,MAAM,aAAa,GAA6B,IAAI,CAAC,IAAI,CAAC;IAC1D,MAAM,kBAAkB,GAAW,gBAAgB;QACjD,CAAC,CAAC,cAAc;QAChB,CAAC,CAAC,iBAAiB,CAAC;IAEtB,SAAS,oBAAoB;QAC3B,OAAO,CACL,KAAC,CAAC,CAAC,IAAI,IAEL,SAAS,EAAE,EAAE,CACX,kBAAkB,EAClB,aAAa,CACd,EACD,OAAO,EAAE;gBACP,OAAO,EAAE,CAAC;gBACV,KAAK,EAAE,CAAC;gBACR,aAAa,EAAE;oBACb,OAAO,EAAE,MAAM;iBAChB;aACF,EACD,OAAO,EAAE;gBACP,OAAO,EAAE,CAAC;gBACV,KAAK,EAAE,CAAC;gBACR,OAAO,EAAE,OAAO;aACjB,EACD,IAAI,EAAE;gBACJ,OAAO,EAAE,CAAC;gBACV,KAAK,EAAE,CAAC;gBACR,aAAa,EAAE;oBACb,OAAO,EAAE,MAAM;iBAChB;aACF,EACD,UAAU,EAAE;gBACV,QAAQ,EAAE,4CAA4C;aACvD,YAEA,IAAI,CAAC,KAAK,IA5BN,sCAAsC,IAAI,CAAC,KAAK,GAAG,CA6BjD,CACV,CAAC;IACJ,CAAC;IAED,OAAO,CACL,KAAC,CAAC,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"dashboard-sidebar-item-renderer.js","sourceRoot":"","sources":["../../../../../src/components/layout/dashboard-layout/dashboard-sidebar/dashboard-sidebar-item-renderer.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,UAAU,EAAqB,MAAM,OAAO,CAAC;AAGtD,OAAO,EAAE,eAAe,EAAE,CAAC,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,4CAA4C,MAAM,sDAAsD,CAAC;AAChH,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO,4BAA4B,MAAM,gCAAgC,CAAC;AAC1E,OAAO,yBAAyB,MAAM,6BAA6B,CAAC;AACpE,OAAO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AC,SAAS,EAAE,kBAAkB,CAAC,GAAI,GACzD,EAER,KAAC,eAAe,cACb,aAAa,IAAI,KAAC,oBAAoB,MAAM,IAAI,CAAC,KAAK,CAAI,GAC3C,IACb,GACQ,EACjB,MAAC,cAAc,IAAC,IAAI,EAAC,OAAO,aACzB,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,KAAK,EAC3B,KAAC,YAAY,KAAG,IACD,IACT,IA1EL,IAAI,CAAC,KAAK,CA2EV,CACR,CAAC;AACJ,CAAC;AAED,eAAe,4BAA4B,CAAC"}
|
package/dist/components/layout/dashboard-layout/dashboard-sidebar/dashboard-sidebar-sizing.d.ts
CHANGED
|
@@ -13,9 +13,32 @@ export interface DashboardLayoutSidebarSizing {
|
|
|
13
13
|
content_container_desktop_sidebar_closed_left_classname: string;
|
|
14
14
|
sidebar_menu_item_height: string;
|
|
15
15
|
sidebar_menu_item_height_classname: string;
|
|
16
|
+
/**
|
|
17
|
+
* Space, in pixels, between a group's label and the first item beneath it.
|
|
18
|
+
*
|
|
19
|
+
* This is a raw number rather than a Tailwind class because it is animated
|
|
20
|
+
* by Framer Motion as the sidebar expands and collapses (the label's height
|
|
21
|
+
* and padding animate to 0 on collapse), and Framer needs a numeric target.
|
|
22
|
+
*
|
|
23
|
+
* Keep it equal to `sidebar_menu_item_gap_classname` expressed in pixels —
|
|
24
|
+
* the default `gap-2` is 0.5rem, i.e. 8px. A mismatch is exactly what made
|
|
25
|
+
* grouped items sit on a different vertical rhythm than ungrouped ones.
|
|
26
|
+
*/
|
|
16
27
|
sidebar_expanded_menu_group_label_bottom_padding: number;
|
|
17
28
|
sidebar_and_header_z_index_classname: string;
|
|
29
|
+
/**
|
|
30
|
+
* The single vertical rhythm for the sidebar menu. Applied to every list of
|
|
31
|
+
* menu items — the ungrouped run at the top level and each group's own list
|
|
32
|
+
* — so both paths space their rows identically.
|
|
33
|
+
*/
|
|
18
34
|
sidebar_menu_item_gap_classname: string;
|
|
35
|
+
/**
|
|
36
|
+
* @deprecated No longer read by any sidebar component. Group labels are now
|
|
37
|
+
* aligned to the icon column (`desktop_collapsed_width`) so that a group
|
|
38
|
+
* heading and the item titles below it share a left edge; menu item rows
|
|
39
|
+
* themselves are full-bleed so their hover state spans the sidebar. Retained
|
|
40
|
+
* so that consumers passing a complete `sizing` object keep type-checking.
|
|
41
|
+
*/
|
|
19
42
|
sidebar_menu_item_x_margin_classname: string;
|
|
20
43
|
}
|
|
21
44
|
export declare const DEFAULT_DASHBOARD_SIDEBAR_SIZE: {
|
|
@@ -33,7 +56,7 @@ export declare const DEFAULT_DASHBOARD_SIDEBAR_SIZE: {
|
|
|
33
56
|
readonly content_container_desktop_sidebar_closed_left_classname: "md:left-[4rem]";
|
|
34
57
|
readonly sidebar_menu_item_height: "2.5rem";
|
|
35
58
|
readonly sidebar_menu_item_height_classname: "h-[2.5rem]";
|
|
36
|
-
readonly sidebar_expanded_menu_group_label_bottom_padding:
|
|
59
|
+
readonly sidebar_expanded_menu_group_label_bottom_padding: 8;
|
|
37
60
|
readonly sidebar_and_header_z_index_classname: "z-40";
|
|
38
61
|
readonly sidebar_menu_item_gap_classname: "gap-2";
|
|
39
62
|
readonly sidebar_menu_item_x_margin_classname: "mx-2";
|
package/dist/components/layout/dashboard-layout/dashboard-sidebar/dashboard-sidebar-sizing.js
CHANGED
|
@@ -14,7 +14,9 @@ export const DEFAULT_DASHBOARD_SIDEBAR_SIZE = {
|
|
|
14
14
|
content_container_desktop_sidebar_closed_left_classname: "md:left-[4rem]",
|
|
15
15
|
sidebar_menu_item_height: "2.5rem",
|
|
16
16
|
sidebar_menu_item_height_classname: "h-[2.5rem]",
|
|
17
|
-
|
|
17
|
+
// 8px === gap-2 === sidebar_menu_item_gap_classname. See the doc comment on
|
|
18
|
+
// the interface field before changing this.
|
|
19
|
+
sidebar_expanded_menu_group_label_bottom_padding: 8,
|
|
18
20
|
sidebar_and_header_z_index_classname: "z-40",
|
|
19
21
|
sidebar_menu_item_gap_classname: "gap-2",
|
|
20
22
|
sidebar_menu_item_x_margin_classname: "mx-2",
|
package/dist/components/layout/dashboard-layout/dashboard-sidebar/dashboard-sidebar-sizing.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard-sidebar-sizing.js","sourceRoot":"","sources":["../../../../../src/components/layout/dashboard-layout/dashboard-sidebar/dashboard-sidebar-sizing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"dashboard-sidebar-sizing.js","sourceRoot":"","sources":["../../../../../src/components/layout/dashboard-layout/dashboard-sidebar/dashboard-sidebar-sizing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AA8CtC,MAAM,CAAC,MAAM,8BAA8B,GAAG;IAC5C,uBAAuB,EAAE,MAAM;IAC/B,iCAAiC,EAAE,UAAU;IAC7C,sBAAsB,EAAE,OAAO;IAC/B,gCAAgC,EAAE,WAAW;IAC7C,qBAAqB,EAAE,OAAO;IAC9B,+BAA+B,EAAE,WAAW;IAC5C,aAAa,EAAE,MAAM;IACrB,uBAAuB,EAAE,UAAU;IACnC,sDAAsD,EACpD,yBAAyB;IAC3B,qDAAqD,EAAE,iBAAiB;IACxE,wDAAwD,EACtD,wBAAwB;IAC1B,uDAAuD,EAAE,gBAAgB;IACzE,wBAAwB,EAAE,QAAQ;IAClC,kCAAkC,EAAE,YAAY;IAChD,4EAA4E;IAC5E,4CAA4C;IAC5C,gDAAgD,EAAE,CAAC;IACnD,oCAAoC,EAAE,MAAM;IAC5C,+BAA+B,EAAE,OAAO;IACxC,oCAAoC,EAAE,MAAM;CACG,CAAC;AAElD,MAAM,CAAC,MAAM,iCAAiC,GAC5C,aAAa,CAA+B,8BAA8B,CAAC,CAAC"}
|