@schemavaults/ui 0.98.4 → 0.99.2
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/dist/components/ui/select/select.js +26 -5
- package/dist/components/ui/select/select.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,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,CAAC,GAAG,IACJ,SAAS,EAAE,EAAE,CACX,2BAA2B,EAC3B,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.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K,CAAC,GAAG,CACd,CAAC,IAAoC,EAAgB,EAAE;wBACrD,OAAO,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,CAA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AAkC,CACnC,YACC,KAAC,aAAa,IAAC,SAAS,EAAE,EAAE,CAAC,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"}
|
|
@@ -13,18 +13,39 @@ function SelectValue({ ...props }) {
|
|
|
13
13
|
return _jsx(SelectPrimitive.Value, { "data-slot": "select-value", ...props });
|
|
14
14
|
}
|
|
15
15
|
function SelectTrigger({ className, size = "default", children, ...props }) {
|
|
16
|
-
return (_jsxs(SelectPrimitive.Trigger, { "data-slot": "select-trigger", "data-size": size, className: cn("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-
|
|
16
|
+
return (_jsxs(SelectPrimitive.Trigger, { "data-slot": "select-trigger", "data-size": size, className: cn("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit min-w-0 max-w-full items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-sm transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8",
|
|
17
|
+
// The value is rendered by Radix as a direct child `span`. It has to be
|
|
18
|
+
// allowed to shrink below its intrinsic width (`min-w-0`), otherwise a
|
|
19
|
+
// long selected label pushes the trigger past its container.
|
|
20
|
+
"[&>[data-slot=select-value]]:min-w-0 [&>[data-slot=select-value]]:flex-1 [&>[data-slot=select-value]]:truncate [&>[data-slot=select-value]]:text-left",
|
|
21
|
+
// `truncate` needs a block container, so the value span can no longer be
|
|
22
|
+
// a flex row. Icons carried over from the selected item are laid out
|
|
23
|
+
// inline instead, which keeps them inside the ellipsis.
|
|
24
|
+
"[&>[data-slot=select-value]_svg]:inline-block [&>[data-slot=select-value]_svg]:mr-2 [&>[data-slot=select-value]_svg]:align-[-0.2em]", "[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className), ...props, children: [children, _jsx(SelectPrimitive.Icon, { asChild: true, children: _jsx(ChevronDownIcon, { className: "size-4 shrink-0 opacity-50" }) })] }));
|
|
17
25
|
}
|
|
18
26
|
function SelectContent({ className, children, position = "popper", ...props }) {
|
|
19
|
-
return (_jsx(SelectPrimitive.Portal, { children: _jsxs(SelectPrimitive.Content, { "data-slot": "select-content", className: cn("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50
|
|
20
|
-
|
|
21
|
-
|
|
27
|
+
return (_jsx(SelectPrimitive.Portal, { children: _jsxs(SelectPrimitive.Content, { "data-slot": "select-content", className: cn("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 min-w-[8rem] overflow-x-hidden overflow-y-auto rounded-md border shadow-md",
|
|
28
|
+
// Radix re-namespaces the popper measurements onto the content, so the
|
|
29
|
+
// dropdown can be bounded by the space actually left on screen.
|
|
30
|
+
"max-h-[var(--radix-select-content-available-height)] origin-[var(--radix-select-content-transform-origin)]", position === "popper" &&
|
|
31
|
+
// Without a width cap a long option label grows the popover until it
|
|
32
|
+
// runs off the edge of the window. `min-width` beats `max-width` in
|
|
33
|
+
// CSS, so a trigger wider than the cap still gets a matching
|
|
34
|
+
// dropdown; anything else wraps at a readable measure.
|
|
35
|
+
"min-w-[var(--radix-select-trigger-width)] max-w-[min(28rem,var(--radix-select-content-available-width))]", position === "popper" &&
|
|
36
|
+
"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1", className), position: position, ...props, children: [_jsx(SelectScrollUpButton, {}), _jsx(SelectPrimitive.Viewport, { className: cn("p-1", position === "popper" && "w-full max-w-full scroll-my-1"), children: children }), _jsx(SelectScrollDownButton, {})] }) }));
|
|
22
37
|
}
|
|
23
38
|
function SelectLabel({ className, ...props }) {
|
|
24
39
|
return (_jsx(SelectPrimitive.Label, { "data-slot": "select-label", className: cn("text-muted-foreground px-2 py-1.5 text-xs", className), ...props }));
|
|
25
40
|
}
|
|
26
41
|
function SelectItem({ className, children, ...props }) {
|
|
27
|
-
return (_jsxs(SelectPrimitive.Item, { "data-slot": "select-item", className: cn("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-
|
|
42
|
+
return (_jsxs(SelectPrimitive.Item, { "data-slot": "select-item", className: cn("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
43
|
+
// Long labels wrap instead of being clipped by the content's
|
|
44
|
+
// `overflow-x-hidden`; `break-words` covers unbroken strings such as
|
|
45
|
+
// identifiers or URLs.
|
|
46
|
+
"min-w-0 whitespace-normal break-words",
|
|
47
|
+
// Radix renders the item text as the last child `span`.
|
|
48
|
+
"[&>span:last-child]:flex [&>span:last-child]:min-w-0 [&>span:last-child]:items-center [&>span:last-child]:gap-2", className), ...props, children: [_jsx("span", { className: "absolute right-2 flex size-3.5 items-center justify-center", children: _jsx(SelectPrimitive.ItemIndicator, { children: _jsx(CheckIcon, { className: "size-4" }) }) }), _jsx(SelectPrimitive.ItemText, { children: children })] }));
|
|
28
49
|
}
|
|
29
50
|
function SelectSeparator({ className, ...props }) {
|
|
30
51
|
return (_jsx(SelectPrimitive.Separator, { "data-slot": "select-separator", className: cn("bg-border pointer-events-none -mx-1 my-1 h-px", className), ...props }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.js","sourceRoot":"","sources":["../../../../src/components/ui/select/select.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAEzE,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AAEjC,SAAS,MAAM,CAAC,EAAE,GAAG,KAAK,EAA+C;IACvE,OAAO,KAAC,eAAe,CAAC,IAAI,iBAAW,QAAQ,KAAK,KAAK,GAAI,CAAC;AAChE,CAAC;AAED,SAAS,WAAW,CAAC,EACnB,GAAG,KAAK,EACqC;IAC7C,OAAO,KAAC,eAAe,CAAC,KAAK,iBAAW,cAAc,KAAK,KAAK,GAAI,CAAC;AACvE,CAAC;AAED,SAAS,WAAW,CAAC,EACnB,GAAG,KAAK,EACqC;IAC7C,OAAO,KAAC,eAAe,CAAC,KAAK,iBAAW,cAAc,KAAK,KAAK,GAAI,CAAC;AACvE,CAAC;AAED,SAAS,aAAa,CAAC,EACrB,SAAS,EACT,IAAI,GAAG,SAAS,EAChB,QAAQ,EACR,GAAG,KAAK,EAGT;IACC,OAAO,CACL,MAAC,eAAe,CAAC,OAAO,iBACZ,gBAAgB,eACf,IAAI,EACf,SAAS,EAAE,EAAE,CACX,
|
|
1
|
+
{"version":3,"file":"select.js","sourceRoot":"","sources":["../../../../src/components/ui/select/select.tsx"],"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