@inf-monkeys-tech/monkeys-design 2.0.5 → 2.0.7
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/data-explorer/index.js +7 -1
- package/dist/components/data-explorer/index.js.map +1 -1
- package/dist/components/data-explorer/index.mjs +7 -1
- package/dist/components/data-explorer/index.mjs.map +1 -1
- package/dist/components/navigation-sidebar/index.d.mts +2 -0
- package/dist/components/navigation-sidebar/index.d.ts +2 -0
- package/dist/components/navigation-sidebar/index.js +263 -143
- package/dist/components/navigation-sidebar/index.js.map +1 -1
- package/dist/components/navigation-sidebar/index.mjs +263 -143
- package/dist/components/navigation-sidebar/index.mjs.map +1 -1
- package/dist/components/workbench/index.js +263 -143
- package/dist/components/workbench/index.js.map +1 -1
- package/dist/components/workbench/index.mjs +263 -143
- package/dist/components/workbench/index.mjs.map +1 -1
- package/dist/index.js +263 -143
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +263 -143
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
|
@@ -2804,6 +2804,7 @@ function DataExplorerViewTree({
|
|
|
2804
2804
|
onSelectNode?.(node, context);
|
|
2805
2805
|
},
|
|
2806
2806
|
onKeyDown: (event) => {
|
|
2807
|
+
if (event.target !== event.currentTarget) return;
|
|
2807
2808
|
if (!isSelectable) return;
|
|
2808
2809
|
if (event.key !== "Enter" && event.key !== " ") return;
|
|
2809
2810
|
event.preventDefault();
|
|
@@ -2930,7 +2931,7 @@ function DataExplorerViewTree({
|
|
|
2930
2931
|
"div",
|
|
2931
2932
|
{
|
|
2932
2933
|
className: cn(theme.slots.treeRoot, classNames?.root, className),
|
|
2933
|
-
role: hasAnyNodes ? "tree" : void 0,
|
|
2934
|
+
role: hasAnyNodes || resolvedGroups.some((group) => !group.hideHeader) ? "tree" : void 0,
|
|
2934
2935
|
children: resolvedGroups.map((group) => {
|
|
2935
2936
|
const groupExpanded = group.hideHeader || group.collapsible === false || resolvedExpandedGroupIds.has(group.id);
|
|
2936
2937
|
const groupNodeCount = group.nodes?.length ?? 0;
|
|
@@ -2947,6 +2948,10 @@ function DataExplorerViewTree({
|
|
|
2947
2948
|
!group.hideHeader ? /* @__PURE__ */ jsxs(
|
|
2948
2949
|
"div",
|
|
2949
2950
|
{
|
|
2951
|
+
role: "treeitem",
|
|
2952
|
+
"aria-label": typeof group.label === "string" ? group.label : void 0,
|
|
2953
|
+
"aria-selected": group.selectable ? groupSelected : void 0,
|
|
2954
|
+
"aria-expanded": groupCollapsible ? groupExpanded : void 0,
|
|
2950
2955
|
className: cn(
|
|
2951
2956
|
theme.slots.treeGroupHeader,
|
|
2952
2957
|
theme.slots.treeGroupHeaderButton,
|
|
@@ -3031,6 +3036,7 @@ function DataExplorerViewTree({
|
|
|
3031
3036
|
groupExpanded ? /* @__PURE__ */ jsx(
|
|
3032
3037
|
"div",
|
|
3033
3038
|
{
|
|
3039
|
+
role: "group",
|
|
3034
3040
|
className: cn(
|
|
3035
3041
|
theme.slots.treeGroupContent,
|
|
3036
3042
|
classNames?.groupContent,
|
|
@@ -3059,6 +3065,72 @@ function DataExplorerViewTree({
|
|
|
3059
3065
|
}
|
|
3060
3066
|
);
|
|
3061
3067
|
}
|
|
3068
|
+
|
|
3069
|
+
// src/components/navigation-sidebar/unified-appearance.ts
|
|
3070
|
+
var unifiedRow = "gap-2 rounded-[var(--radius)] border border-transparent text-sm font-medium motion-reduce:transition-none";
|
|
3071
|
+
var unifiedIcon = "size-[var(--monkeys-component-navigation-sidebar-icon-size,1.125rem)] shrink-0 text-inherit [&_svg]:size-full";
|
|
3072
|
+
var unifiedInactive = "text-foreground hover:border-transparent hover:bg-[var(--navigation-internal-hover-background)] hover:text-[var(--navigation-internal-hover-foreground)]";
|
|
3073
|
+
var unifiedSelected = "border-[var(--navigation-internal-selected-border)] bg-[var(--navigation-internal-selected-background)] text-[var(--navigation-internal-selected-foreground)] hover:border-[var(--navigation-internal-selected-border)] hover:bg-[var(--navigation-internal-selected-background)] hover:text-[var(--navigation-internal-selected-foreground)]";
|
|
3074
|
+
var unifiedThemeDefaults = "[--navigation-internal-theme-selected-background:color-mix(in_srgb,hsl(var(--monkeys-color-primary,var(--primary)))_10%,transparent)] [--navigation-internal-theme-selected-foreground:hsl(var(--monkeys-color-primary,var(--primary)))] dark:[--navigation-internal-theme-selected-background:hsl(var(--monkeys-color-accent,var(--accent)))] dark:[--navigation-internal-theme-selected-foreground:hsl(var(--monkeys-color-foreground,var(--foreground)))]";
|
|
3075
|
+
function unifiedStyle(activeVariant) {
|
|
3076
|
+
const background = {
|
|
3077
|
+
muted: "hsl(var(--monkeys-color-accent,var(--accent)))",
|
|
3078
|
+
soft: "color-mix(in srgb,hsl(var(--monkeys-color-primary,var(--primary))) 10%,transparent)",
|
|
3079
|
+
solid: "hsl(var(--monkeys-color-primary,var(--primary)))",
|
|
3080
|
+
outline: "hsl(var(--monkeys-color-background,var(--background)))"
|
|
3081
|
+
}[activeVariant ?? "muted"];
|
|
3082
|
+
const foreground = activeVariant === "solid" ? "hsl(var(--monkeys-color-primary-foreground,var(--primary-foreground)))" : "hsl(var(--monkeys-color-foreground,var(--foreground)))";
|
|
3083
|
+
const border = activeVariant === void 0 || activeVariant === "muted" ? "transparent" : activeVariant === "soft" ? "color-mix(in srgb,hsl(var(--monkeys-color-primary,var(--primary))) 25%,transparent)" : activeVariant === "outline" ? "color-mix(in srgb,hsl(var(--monkeys-color-primary,var(--primary))) 55%,transparent)" : "hsl(var(--monkeys-color-primary,var(--primary)))";
|
|
3084
|
+
return {
|
|
3085
|
+
"--navigation-internal-default-selected-background": activeVariant === void 0 ? "var(--navigation-internal-theme-selected-background)" : background,
|
|
3086
|
+
"--navigation-internal-default-selected-foreground": activeVariant === void 0 ? "var(--navigation-internal-theme-selected-foreground)" : foreground,
|
|
3087
|
+
"--navigation-internal-selected-background": "var(--monkeys-component-navigation-sidebar-row-selected-background,var(--navigation-internal-default-selected-background))",
|
|
3088
|
+
"--navigation-internal-selected-foreground": "var(--monkeys-component-navigation-sidebar-row-selected-foreground,var(--navigation-internal-default-selected-foreground))",
|
|
3089
|
+
"--navigation-internal-selected-border": `var(--monkeys-component-navigation-sidebar-row-selected-border,${border})`,
|
|
3090
|
+
"--navigation-internal-hover-background": "var(--monkeys-component-navigation-sidebar-row-hover-background,color-mix(in srgb,hsl(var(--monkeys-color-accent,var(--accent))) 65%,transparent))",
|
|
3091
|
+
"--navigation-internal-hover-foreground": "var(--monkeys-component-navigation-sidebar-row-hover-foreground,hsl(var(--monkeys-color-foreground,var(--foreground))))"
|
|
3092
|
+
};
|
|
3093
|
+
}
|
|
3094
|
+
var treeStateVariables = "[--navigation-internal-selected-background:var(--monkeys-component-navigation-sidebar-row-selected-background,var(--monkeys-component-navigation-sidebar-tree-row-selected-background,var(--navigation-internal-default-selected-background)))] [--navigation-internal-selected-foreground:var(--monkeys-component-navigation-sidebar-row-selected-foreground,var(--monkeys-component-navigation-sidebar-tree-row-selected-foreground,var(--navigation-internal-default-selected-foreground)))] [--navigation-internal-hover-background:var(--monkeys-component-navigation-sidebar-row-hover-background,var(--monkeys-component-navigation-sidebar-tree-row-hover-background,color-mix(in_srgb,hsl(var(--monkeys-color-accent,var(--accent)))_65%,transparent)))] [--navigation-internal-hover-foreground:var(--monkeys-component-navigation-sidebar-row-hover-foreground,var(--monkeys-component-navigation-sidebar-tree-row-hover-foreground,hsl(var(--monkeys-color-foreground,var(--foreground)))))]";
|
|
3095
|
+
var selectedTreeNode = "aria-selected:border-[var(--navigation-internal-selected-border)] aria-selected:bg-[var(--navigation-internal-selected-background)] aria-selected:text-[var(--navigation-internal-selected-foreground)] aria-selected:hover:border-[var(--navigation-internal-selected-border)] aria-selected:hover:bg-[var(--navigation-internal-selected-background)] aria-selected:hover:text-[var(--navigation-internal-selected-foreground)]";
|
|
3096
|
+
var nestedControl = "text-inherit hover:bg-foreground/10 hover:text-inherit focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none";
|
|
3097
|
+
function unifiedTreeClassNames(height, padding, overrides = {}) {
|
|
3098
|
+
const row = cn(unifiedRow, height, padding, unifiedInactive);
|
|
3099
|
+
return {
|
|
3100
|
+
...overrides,
|
|
3101
|
+
root: cn(treeStateVariables, "space-y-0.5", overrides.root),
|
|
3102
|
+
group: cn(
|
|
3103
|
+
"space-y-0.5",
|
|
3104
|
+
// A visible group header adds a level; headerless groups contain root items.
|
|
3105
|
+
"[&>[role=treeitem]+[role=group]]:pl-[var(--monkeys-component-navigation-sidebar-tree-group-indent,1rem)]",
|
|
3106
|
+
overrides.group
|
|
3107
|
+
),
|
|
3108
|
+
groupHeaderButton: cn("h-auto", row, overrides.groupHeaderButton),
|
|
3109
|
+
nodeButton: cn(row, selectedTreeNode, overrides.nodeButton),
|
|
3110
|
+
itemSelected: cn(unifiedSelected, overrides.itemSelected),
|
|
3111
|
+
nodeIcon: cn(
|
|
3112
|
+
unifiedIcon,
|
|
3113
|
+
"group-hover/tree-node:text-inherit",
|
|
3114
|
+
overrides.nodeIcon
|
|
3115
|
+
),
|
|
3116
|
+
nodeLabel: cn("font-medium", overrides.nodeLabel),
|
|
3117
|
+
nodeDescription: cn("text-inherit", overrides.nodeDescription),
|
|
3118
|
+
nodeDisabled: cn("opacity-50", overrides.nodeDisabled),
|
|
3119
|
+
groupActions: cn(
|
|
3120
|
+
nestedControl,
|
|
3121
|
+
"order-2 size-5 p-0 group-focus-within/tree-group:opacity-100",
|
|
3122
|
+
overrides.groupActions
|
|
3123
|
+
),
|
|
3124
|
+
nodeActions: cn(
|
|
3125
|
+
nestedControl,
|
|
3126
|
+
"order-2 size-5 p-0 group-focus-within/tree-node:opacity-100",
|
|
3127
|
+
overrides.nodeActions
|
|
3128
|
+
),
|
|
3129
|
+
nodeToggle: cn(nestedControl, "order-1", overrides.nodeToggle),
|
|
3130
|
+
expander: cn(nestedControl, "order-1", overrides.expander),
|
|
3131
|
+
nodeDragHandle: cn(nestedControl, overrides.nodeDragHandle)
|
|
3132
|
+
};
|
|
3133
|
+
}
|
|
3062
3134
|
function CollapseIcon({ collapsed }) {
|
|
3063
3135
|
return /* @__PURE__ */ jsx("svg", { "aria-hidden": "true", viewBox: "0 0 20 20", className: "h-4 w-4", fill: "none", children: /* @__PURE__ */ jsx(
|
|
3064
3136
|
"path",
|
|
@@ -3244,22 +3316,34 @@ function activeVariantClassName(activeVariant) {
|
|
|
3244
3316
|
return "border-primary/25 bg-primary/10 text-foreground";
|
|
3245
3317
|
}
|
|
3246
3318
|
function resolveAppearance(appearance) {
|
|
3247
|
-
|
|
3319
|
+
if (appearance?.preset !== void 0 && appearance.preset !== "unified") {
|
|
3320
|
+
throw new TypeError(
|
|
3321
|
+
`Unknown NavigationSidebar preset "${appearance.preset}". Supported preset: unified.`
|
|
3322
|
+
);
|
|
3323
|
+
}
|
|
3324
|
+
const unified = appearance?.preset === "unified";
|
|
3325
|
+
const density = appearance?.density ?? (unified ? "compact" : "default");
|
|
3248
3326
|
const surface = appearance?.surface ?? "panel";
|
|
3249
|
-
const activeVariant = appearance?.activeVariant ?? "soft";
|
|
3327
|
+
const activeVariant = appearance?.activeVariant ?? (unified ? "muted" : "soft");
|
|
3250
3328
|
return {
|
|
3329
|
+
unified,
|
|
3251
3330
|
density,
|
|
3252
3331
|
surface,
|
|
3253
3332
|
activeVariant,
|
|
3333
|
+
selected: unified ? unifiedSelected : activeVariantClassName(activeVariant),
|
|
3334
|
+
inactive: unified ? unifiedInactive : "text-muted-foreground hover:border-border/70 hover:bg-muted/60 hover:text-foreground",
|
|
3254
3335
|
root: cn(
|
|
3255
3336
|
surface === "plain" && "border-transparent bg-transparent shadow-none",
|
|
3256
3337
|
surface === "panel" && "border-border/70 bg-card text-card-foreground shadow-sm",
|
|
3257
3338
|
surface === "frosted" && "border-border/55 bg-card/80 text-card-foreground shadow-sm backdrop-blur-xl",
|
|
3258
|
-
surface === "outlined" && "border-border bg-background text-foreground shadow-none"
|
|
3339
|
+
surface === "outlined" && "border-border bg-background text-foreground shadow-none",
|
|
3340
|
+
unified && "rounded-[var(--radius)] shadow-none",
|
|
3341
|
+
unified && unifiedThemeDefaults,
|
|
3342
|
+
unified && surface === "panel" && "border-[var(--monkeys-component-navigation-sidebar-border,hsl(var(--monkeys-color-border,var(--border))))] bg-[var(--monkeys-component-navigation-sidebar-background,hsl(var(--monkeys-color-card,var(--card))))] text-foreground"
|
|
3259
3343
|
),
|
|
3260
|
-
itemHeight: density === "compact" ? "min-h-9" : density === "comfortable" ? "min-h-14" : "min-h-11",
|
|
3261
|
-
itemPadding: density === "compact" ? "px-2 py-1.5" : density === "comfortable" ? "px-3 py-3" : "px-3 py-2",
|
|
3262
|
-
searchHeight: density === "compact" ? "h-8" : density === "comfortable" ? "h-10" : "h-9"
|
|
3344
|
+
itemHeight: density === "compact" ? unified ? "min-h-[var(--monkeys-component-navigation-sidebar-row-height,2.5rem)]" : "min-h-9" : density === "comfortable" ? "min-h-14" : "min-h-11",
|
|
3345
|
+
itemPadding: density === "compact" ? unified ? "px-2 py-2" : "px-2 py-1.5" : density === "comfortable" ? "px-3 py-3" : "px-3 py-2",
|
|
3346
|
+
searchHeight: density === "compact" ? unified ? "h-[var(--monkeys-component-navigation-sidebar-row-height,2.5rem)]" : "h-8" : density === "comfortable" ? "h-10" : "h-9"
|
|
3263
3347
|
};
|
|
3264
3348
|
}
|
|
3265
3349
|
var navigationTreeRowHoverClassName = "hover:bg-[var(--monkeys-component-navigation-sidebar-tree-row-hover-background,hsl(var(--muted)))] hover:text-[var(--monkeys-component-navigation-sidebar-tree-row-hover-foreground,hsl(var(--foreground)))]";
|
|
@@ -3314,7 +3398,8 @@ function entryClassName({
|
|
|
3314
3398
|
"group/navigation-item relative flex w-full min-w-0 items-center gap-3 rounded-[var(--radius)] border border-transparent text-left text-sm outline-none transition-[background-color,border-color,color,box-shadow] focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none",
|
|
3315
3399
|
appearance.itemHeight,
|
|
3316
3400
|
appearance.itemPadding,
|
|
3317
|
-
|
|
3401
|
+
appearance.unified && unifiedRow,
|
|
3402
|
+
embedded ? "min-h-0 self-stretch border-0 bg-transparent text-inherit hover:bg-transparent hover:text-inherit" : active ? appearance.selected : appearance.inactive,
|
|
3318
3403
|
collapsed && !mobile && "justify-center px-0",
|
|
3319
3404
|
item.disabled && "pointer-events-none opacity-50",
|
|
3320
3405
|
classNames?.item,
|
|
@@ -3329,7 +3414,8 @@ function EntryContent({
|
|
|
3329
3414
|
collapsed,
|
|
3330
3415
|
mobile,
|
|
3331
3416
|
classNames,
|
|
3332
|
-
endIndicator
|
|
3417
|
+
endIndicator,
|
|
3418
|
+
appearance
|
|
3333
3419
|
}) {
|
|
3334
3420
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3335
3421
|
hasRenderableNode(item.icon) ? /* @__PURE__ */ jsx(
|
|
@@ -3337,6 +3423,7 @@ function EntryContent({
|
|
|
3337
3423
|
{
|
|
3338
3424
|
className: cn(
|
|
3339
3425
|
"flex size-5 shrink-0 items-center justify-center [&_svg]:size-full",
|
|
3426
|
+
appearance.unified && unifiedIcon,
|
|
3340
3427
|
classNames?.itemIcon
|
|
3341
3428
|
),
|
|
3342
3429
|
"aria-hidden": "true",
|
|
@@ -3356,6 +3443,7 @@ function EntryContent({
|
|
|
3356
3443
|
{
|
|
3357
3444
|
className: cn(
|
|
3358
3445
|
"min-w-0 truncate font-semibold",
|
|
3446
|
+
appearance.unified && "font-medium",
|
|
3359
3447
|
classNames?.itemLabel
|
|
3360
3448
|
),
|
|
3361
3449
|
children: item.label
|
|
@@ -3366,6 +3454,7 @@ function EntryContent({
|
|
|
3366
3454
|
{
|
|
3367
3455
|
className: cn(
|
|
3368
3456
|
"mt-0.5 truncate text-xs font-normal",
|
|
3457
|
+
appearance.unified && "text-inherit",
|
|
3369
3458
|
classNames?.itemDescription
|
|
3370
3459
|
),
|
|
3371
3460
|
children: item.description
|
|
@@ -3446,6 +3535,7 @@ function EntryButton({
|
|
|
3446
3535
|
children: /* @__PURE__ */ jsx(
|
|
3447
3536
|
EntryContent,
|
|
3448
3537
|
{
|
|
3538
|
+
appearance,
|
|
3449
3539
|
item,
|
|
3450
3540
|
collapsed,
|
|
3451
3541
|
mobile,
|
|
@@ -3482,6 +3572,7 @@ function EntryPresentation({
|
|
|
3482
3572
|
children: /* @__PURE__ */ jsx(
|
|
3483
3573
|
EntryContent,
|
|
3484
3574
|
{
|
|
3575
|
+
appearance,
|
|
3485
3576
|
item,
|
|
3486
3577
|
collapsed: false,
|
|
3487
3578
|
mobile: true,
|
|
@@ -3498,7 +3589,8 @@ function routeRowClassName({
|
|
|
3498
3589
|
return cn(
|
|
3499
3590
|
"flex w-full min-w-0 items-center gap-0.5 rounded-[var(--radius)] border border-transparent pr-1 text-sm transition-[background-color,border-color,color,box-shadow] motion-reduce:transition-none",
|
|
3500
3591
|
appearance.itemHeight,
|
|
3501
|
-
|
|
3592
|
+
appearance.unified && unifiedRow,
|
|
3593
|
+
active ? appearance.selected : appearance.inactive
|
|
3502
3594
|
);
|
|
3503
3595
|
}
|
|
3504
3596
|
function filterCatalogItems(items, activeFilterId) {
|
|
@@ -3652,7 +3744,8 @@ function ChildEntry({
|
|
|
3652
3744
|
"flex w-full min-w-0 flex-1 items-center gap-3 rounded-[var(--radius)] border border-transparent text-left text-sm font-semibold outline-none transition-[background-color,border-color,color,box-shadow] focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none",
|
|
3653
3745
|
appearance.itemHeight,
|
|
3654
3746
|
appearance.itemPadding,
|
|
3655
|
-
|
|
3747
|
+
appearance.unified && unifiedRow,
|
|
3748
|
+
embedded ? "min-h-0 self-stretch border-0 bg-transparent text-inherit hover:bg-transparent hover:text-inherit" : active ? appearance.selected : appearance.inactive,
|
|
3656
3749
|
child.disabled && "pointer-events-none opacity-50",
|
|
3657
3750
|
classNames?.childItem,
|
|
3658
3751
|
active && classNames?.childItemActive,
|
|
@@ -3664,7 +3757,10 @@ function ChildEntry({
|
|
|
3664
3757
|
hasRenderableNode(child.icon) ? /* @__PURE__ */ jsx(
|
|
3665
3758
|
"span",
|
|
3666
3759
|
{
|
|
3667
|
-
className:
|
|
3760
|
+
className: cn(
|
|
3761
|
+
"flex size-5 shrink-0 items-center justify-center [&_svg]:size-full",
|
|
3762
|
+
appearance.unified && unifiedIcon
|
|
3763
|
+
),
|
|
3668
3764
|
"aria-hidden": "true",
|
|
3669
3765
|
children: child.icon
|
|
3670
3766
|
}
|
|
@@ -3813,6 +3909,7 @@ function CollapsedChildMenu({
|
|
|
3813
3909
|
children: /* @__PURE__ */ jsx(
|
|
3814
3910
|
EntryContent,
|
|
3815
3911
|
{
|
|
3912
|
+
appearance,
|
|
3816
3913
|
item,
|
|
3817
3914
|
collapsed: !mobile,
|
|
3818
3915
|
mobile,
|
|
@@ -3926,137 +4023,148 @@ function RouteContent({
|
|
|
3926
4023
|
onExpandedItemIdsChange
|
|
3927
4024
|
]
|
|
3928
4025
|
);
|
|
3929
|
-
return /* @__PURE__ */ jsx("nav", { "aria-label": ariaLabel, children: /* @__PURE__ */ jsx(
|
|
3930
|
-
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
|
|
3934
|
-
|
|
3935
|
-
|
|
3936
|
-
const compoundItemRow = collapsed && hasChildren && Boolean(onChildSelect) || !collapsed && childrenCollapsible && !disclosure || showItemActions;
|
|
3937
|
-
const childListId = `${disclosureId}-route-children-${itemIndex}`;
|
|
3938
|
-
return /* @__PURE__ */ jsxs("li", { className: "grid min-w-0 gap-1", children: [
|
|
3939
|
-
collapsed && disclosure ? /* @__PURE__ */ jsx(
|
|
3940
|
-
CollapsedChildMenu,
|
|
3941
|
-
{
|
|
3942
|
-
item,
|
|
3943
|
-
activeChildId,
|
|
3944
|
-
label: collapsedChildMenuLabel,
|
|
3945
|
-
onChildSelect,
|
|
3946
|
-
classNames,
|
|
3947
|
-
appearance,
|
|
3948
|
-
triggerVariant: "item"
|
|
3949
|
-
}
|
|
3950
|
-
) : /* @__PURE__ */ jsxs(
|
|
3951
|
-
"div",
|
|
3952
|
-
{
|
|
3953
|
-
"data-navigation-sidebar-item-row": compoundItemRow ? item.id : void 0,
|
|
3954
|
-
"data-active": compoundItemRow ? String(active) : void 0,
|
|
3955
|
-
className: compoundItemRow ? routeRowClassName({ active, appearance }) : void 0,
|
|
3956
|
-
children: [
|
|
3957
|
-
/* @__PURE__ */ jsx(
|
|
3958
|
-
EntryButton,
|
|
3959
|
-
{
|
|
3960
|
-
item,
|
|
3961
|
-
active,
|
|
3962
|
-
collapsed,
|
|
3963
|
-
embedded: compoundItemRow,
|
|
3964
|
-
itemAs: disclosure ? "button" : itemAs,
|
|
3965
|
-
appearance,
|
|
3966
|
-
classNames,
|
|
3967
|
-
onSelect: disclosure ? () => toggleItemExpanded(item) : onItemSelect ? () => onItemSelect(item) : void 0,
|
|
3968
|
-
ariaControls: !collapsed && childrenCollapsible && disclosure ? childListId : void 0,
|
|
3969
|
-
ariaExpanded: !collapsed && childrenCollapsible && disclosure ? childrenExpanded : void 0,
|
|
3970
|
-
endIndicator: !collapsed && disclosure && !showItemActions ? /* @__PURE__ */ jsx(DisclosureIcon, { expanded: childrenExpanded }) : void 0
|
|
3971
|
-
}
|
|
3972
|
-
),
|
|
3973
|
-
showItemActions ? /* @__PURE__ */ jsx(
|
|
3974
|
-
RouteActions,
|
|
3975
|
-
{
|
|
3976
|
-
itemId: item.id,
|
|
3977
|
-
actions: item.actions,
|
|
3978
|
-
kind: "item",
|
|
3979
|
-
className: classNames?.itemActions
|
|
3980
|
-
}
|
|
3981
|
-
) : null,
|
|
3982
|
-
collapsed && onChildSelect ? /* @__PURE__ */ jsx(
|
|
3983
|
-
CollapsedChildMenu,
|
|
3984
|
-
{
|
|
3985
|
-
item,
|
|
3986
|
-
activeChildId,
|
|
3987
|
-
label: collapsedChildMenuLabel,
|
|
3988
|
-
onChildSelect,
|
|
3989
|
-
classNames
|
|
3990
|
-
}
|
|
3991
|
-
) : null,
|
|
3992
|
-
!collapsed && childrenCollapsible && (!disclosure || showItemActions) ? /* @__PURE__ */ jsx(
|
|
3993
|
-
RouteChildrenToggle,
|
|
3994
|
-
{
|
|
3995
|
-
item,
|
|
3996
|
-
expanded: childrenExpanded,
|
|
3997
|
-
controls: childListId,
|
|
3998
|
-
label: disclosureLabel,
|
|
3999
|
-
onToggle: () => toggleItemExpanded(item),
|
|
4000
|
-
classNames
|
|
4001
|
-
}
|
|
4002
|
-
) : null
|
|
4003
|
-
]
|
|
4004
|
-
}
|
|
4026
|
+
return /* @__PURE__ */ jsx("nav", { "aria-label": ariaLabel, children: /* @__PURE__ */ jsx(
|
|
4027
|
+
"ul",
|
|
4028
|
+
{
|
|
4029
|
+
className: cn(
|
|
4030
|
+
"grid list-none gap-2 p-0",
|
|
4031
|
+
appearance.unified && "gap-0.5",
|
|
4032
|
+
classNames?.list
|
|
4005
4033
|
),
|
|
4006
|
-
|
|
4007
|
-
|
|
4008
|
-
|
|
4009
|
-
|
|
4010
|
-
|
|
4011
|
-
|
|
4012
|
-
|
|
4013
|
-
|
|
4014
|
-
|
|
4034
|
+
children: routeItems.map((item, itemIndex) => {
|
|
4035
|
+
const disclosure = isDisclosureRouteItem(item);
|
|
4036
|
+
const active = !disclosure && item.id === activeItemId;
|
|
4037
|
+
const hasChildren = Boolean(item.children?.length);
|
|
4038
|
+
const childrenCollapsible = collapsibleItemIds.has(item.id);
|
|
4039
|
+
const childrenExpanded = !childrenCollapsible || expandedItemIdSet.has(item.id);
|
|
4040
|
+
const showItemActions = !collapsed && hasRenderableNode(item.actions);
|
|
4041
|
+
const compoundItemRow = collapsed && hasChildren && Boolean(onChildSelect) || !collapsed && childrenCollapsible && !disclosure || showItemActions;
|
|
4042
|
+
const childListId = `${disclosureId}-route-children-${itemIndex}`;
|
|
4043
|
+
return /* @__PURE__ */ jsxs("li", { className: "grid min-w-0 gap-1", children: [
|
|
4044
|
+
collapsed && disclosure ? /* @__PURE__ */ jsx(
|
|
4045
|
+
CollapsedChildMenu,
|
|
4046
|
+
{
|
|
4047
|
+
item,
|
|
4048
|
+
activeChildId,
|
|
4049
|
+
label: collapsedChildMenuLabel,
|
|
4050
|
+
onChildSelect,
|
|
4051
|
+
classNames,
|
|
4052
|
+
appearance,
|
|
4053
|
+
triggerVariant: "item"
|
|
4054
|
+
}
|
|
4055
|
+
) : /* @__PURE__ */ jsxs(
|
|
4056
|
+
"div",
|
|
4057
|
+
{
|
|
4058
|
+
"data-navigation-sidebar-item-row": compoundItemRow ? item.id : void 0,
|
|
4059
|
+
"data-active": compoundItemRow ? String(active) : void 0,
|
|
4060
|
+
className: compoundItemRow ? routeRowClassName({ active, appearance }) : void 0,
|
|
4061
|
+
children: [
|
|
4062
|
+
/* @__PURE__ */ jsx(
|
|
4063
|
+
EntryButton,
|
|
4064
|
+
{
|
|
4065
|
+
item,
|
|
4066
|
+
active,
|
|
4067
|
+
collapsed,
|
|
4068
|
+
embedded: compoundItemRow,
|
|
4069
|
+
itemAs: disclosure ? "button" : itemAs,
|
|
4070
|
+
appearance,
|
|
4071
|
+
classNames,
|
|
4072
|
+
onSelect: disclosure ? () => toggleItemExpanded(item) : onItemSelect ? () => onItemSelect(item) : void 0,
|
|
4073
|
+
ariaControls: !collapsed && childrenCollapsible && disclosure ? childListId : void 0,
|
|
4074
|
+
ariaExpanded: !collapsed && childrenCollapsible && disclosure ? childrenExpanded : void 0,
|
|
4075
|
+
endIndicator: !collapsed && disclosure && !showItemActions ? /* @__PURE__ */ jsx(DisclosureIcon, { expanded: childrenExpanded }) : void 0
|
|
4076
|
+
}
|
|
4077
|
+
),
|
|
4078
|
+
showItemActions ? /* @__PURE__ */ jsx(
|
|
4079
|
+
RouteActions,
|
|
4080
|
+
{
|
|
4081
|
+
itemId: item.id,
|
|
4082
|
+
actions: item.actions,
|
|
4083
|
+
kind: "item",
|
|
4084
|
+
className: classNames?.itemActions
|
|
4085
|
+
}
|
|
4086
|
+
) : null,
|
|
4087
|
+
collapsed && onChildSelect ? /* @__PURE__ */ jsx(
|
|
4088
|
+
CollapsedChildMenu,
|
|
4089
|
+
{
|
|
4090
|
+
item,
|
|
4091
|
+
activeChildId,
|
|
4092
|
+
label: collapsedChildMenuLabel,
|
|
4093
|
+
onChildSelect,
|
|
4094
|
+
classNames
|
|
4095
|
+
}
|
|
4096
|
+
) : null,
|
|
4097
|
+
!collapsed && childrenCollapsible && (!disclosure || showItemActions) ? /* @__PURE__ */ jsx(
|
|
4098
|
+
RouteChildrenToggle,
|
|
4099
|
+
{
|
|
4100
|
+
item,
|
|
4101
|
+
expanded: childrenExpanded,
|
|
4102
|
+
controls: childListId,
|
|
4103
|
+
label: disclosureLabel,
|
|
4104
|
+
onToggle: () => toggleItemExpanded(item),
|
|
4105
|
+
classNames
|
|
4106
|
+
}
|
|
4107
|
+
) : null
|
|
4108
|
+
]
|
|
4109
|
+
}
|
|
4015
4110
|
),
|
|
4016
|
-
|
|
4017
|
-
|
|
4018
|
-
|
|
4019
|
-
|
|
4020
|
-
|
|
4021
|
-
{
|
|
4022
|
-
|
|
4023
|
-
|
|
4024
|
-
|
|
4025
|
-
|
|
4026
|
-
|
|
4027
|
-
|
|
4028
|
-
|
|
4029
|
-
|
|
4030
|
-
|
|
4031
|
-
|
|
4032
|
-
|
|
4033
|
-
|
|
4034
|
-
|
|
4035
|
-
|
|
4036
|
-
|
|
4037
|
-
|
|
4038
|
-
|
|
4039
|
-
|
|
4040
|
-
|
|
4041
|
-
|
|
4042
|
-
|
|
4043
|
-
|
|
4044
|
-
|
|
4045
|
-
|
|
4046
|
-
|
|
4047
|
-
|
|
4048
|
-
|
|
4049
|
-
|
|
4050
|
-
|
|
4051
|
-
|
|
4052
|
-
|
|
4053
|
-
|
|
4054
|
-
|
|
4055
|
-
|
|
4056
|
-
|
|
4057
|
-
|
|
4058
|
-
|
|
4059
|
-
|
|
4111
|
+
!collapsed && hasChildren ? /* @__PURE__ */ jsx(
|
|
4112
|
+
"ul",
|
|
4113
|
+
{
|
|
4114
|
+
id: childListId,
|
|
4115
|
+
hidden: !childrenExpanded,
|
|
4116
|
+
style: childrenExpanded ? void 0 : { display: "none" },
|
|
4117
|
+
className: cn(
|
|
4118
|
+
"ml-5 grid list-none gap-0.5 border-l border-border/70 py-1 pl-3",
|
|
4119
|
+
appearance.unified && "border-border",
|
|
4120
|
+
classNames?.childList
|
|
4121
|
+
),
|
|
4122
|
+
children: item.children?.map((child) => {
|
|
4123
|
+
const hasChildActions = hasRenderableNode(child.actions);
|
|
4124
|
+
const childActive = child.id === activeChildId;
|
|
4125
|
+
const childEntry = /* @__PURE__ */ jsx(
|
|
4126
|
+
ChildEntry,
|
|
4127
|
+
{
|
|
4128
|
+
child,
|
|
4129
|
+
parent: item,
|
|
4130
|
+
active: childActive,
|
|
4131
|
+
interactive: Boolean(onChildSelect),
|
|
4132
|
+
onSelect: onChildSelect,
|
|
4133
|
+
appearance,
|
|
4134
|
+
classNames,
|
|
4135
|
+
embedded: hasChildActions
|
|
4136
|
+
}
|
|
4137
|
+
);
|
|
4138
|
+
return /* @__PURE__ */ jsx("li", { children: hasChildActions ? /* @__PURE__ */ jsxs(
|
|
4139
|
+
"div",
|
|
4140
|
+
{
|
|
4141
|
+
"data-navigation-sidebar-child-row": child.id,
|
|
4142
|
+
"data-active": String(childActive),
|
|
4143
|
+
className: routeRowClassName({
|
|
4144
|
+
active: childActive,
|
|
4145
|
+
appearance
|
|
4146
|
+
}),
|
|
4147
|
+
children: [
|
|
4148
|
+
childEntry,
|
|
4149
|
+
/* @__PURE__ */ jsx(
|
|
4150
|
+
RouteActions,
|
|
4151
|
+
{
|
|
4152
|
+
itemId: child.id,
|
|
4153
|
+
actions: child.actions,
|
|
4154
|
+
kind: "child",
|
|
4155
|
+
className: classNames?.childActions
|
|
4156
|
+
}
|
|
4157
|
+
)
|
|
4158
|
+
]
|
|
4159
|
+
}
|
|
4160
|
+
) : childEntry }, child.id);
|
|
4161
|
+
})
|
|
4162
|
+
}
|
|
4163
|
+
) : null
|
|
4164
|
+
] }, item.id);
|
|
4165
|
+
})
|
|
4166
|
+
}
|
|
4167
|
+
) });
|
|
4060
4168
|
}
|
|
4061
4169
|
function flattenCatalogItems(items, sections, activeFilterId) {
|
|
4062
4170
|
return [
|
|
@@ -4366,7 +4474,11 @@ function NavigationSidebarInner(props, ref) {
|
|
|
4366
4474
|
DataExplorerViewTree,
|
|
4367
4475
|
{
|
|
4368
4476
|
...treeProps,
|
|
4369
|
-
classNames:
|
|
4477
|
+
classNames: appearance.unified ? unifiedTreeClassNames(
|
|
4478
|
+
appearance.itemHeight,
|
|
4479
|
+
appearance.itemPadding,
|
|
4480
|
+
treeProps.classNames
|
|
4481
|
+
) : resolveNavigationTreeClassNames(treeProps.classNames)
|
|
4370
4482
|
}
|
|
4371
4483
|
);
|
|
4372
4484
|
};
|
|
@@ -4379,6 +4491,7 @@ function NavigationSidebarInner(props, ref) {
|
|
|
4379
4491
|
"aria-label": props.ariaLabel,
|
|
4380
4492
|
"data-monkeys-component": props.dataComponent ?? "navigation-sidebar",
|
|
4381
4493
|
"data-navigation-sidebar-kind": props.kind,
|
|
4494
|
+
"data-navigation-sidebar-preset": props.appearance?.preset,
|
|
4382
4495
|
"data-collapsed": resolvedCollapsed ? "true" : "false",
|
|
4383
4496
|
className: cn(
|
|
4384
4497
|
"relative flex h-full min-h-0 shrink-0 flex-col overflow-visible rounded-[calc(var(--radius)+0.25rem)] border transition-[width,opacity] duration-300 motion-reduce:transition-none",
|
|
@@ -4389,6 +4502,7 @@ function NavigationSidebarInner(props, ref) {
|
|
|
4389
4502
|
props.className
|
|
4390
4503
|
),
|
|
4391
4504
|
style: {
|
|
4505
|
+
...appearance.unified ? unifiedStyle(props.appearance?.activeVariant) : {},
|
|
4392
4506
|
...props.style,
|
|
4393
4507
|
width: props.widthMode === "fill" ? void 0 : resolvedCollapsed ? bounds.collapsedWidth : resolvedWidth,
|
|
4394
4508
|
transition: isResizing ? "none" : props.style?.transition
|
|
@@ -4426,6 +4540,7 @@ function NavigationSidebarInner(props, ref) {
|
|
|
4426
4540
|
{
|
|
4427
4541
|
className: cn(
|
|
4428
4542
|
"flex min-h-12 min-w-0 items-center gap-2 border-b border-border/60 px-3",
|
|
4543
|
+
appearance.unified && "min-h-14 border-border px-[var(--monkeys-component-navigation-sidebar-content-inline-padding,var(--global-spacing,0.75rem))]",
|
|
4429
4544
|
resolvedCollapsed && "justify-center px-1",
|
|
4430
4545
|
props.classNames?.header
|
|
4431
4546
|
),
|
|
@@ -4469,6 +4584,7 @@ function NavigationSidebarInner(props, ref) {
|
|
|
4469
4584
|
{
|
|
4470
4585
|
className: cn(
|
|
4471
4586
|
"px-[var(--monkeys-component-navigation-sidebar-content-inline-padding,var(--global-spacing,0.75rem))] pb-2 pt-3",
|
|
4587
|
+
appearance.unified && "pb-1",
|
|
4472
4588
|
props.classNames?.search
|
|
4473
4589
|
),
|
|
4474
4590
|
children: /* @__PURE__ */ jsxs(
|
|
@@ -4476,7 +4592,8 @@ function NavigationSidebarInner(props, ref) {
|
|
|
4476
4592
|
{
|
|
4477
4593
|
className: cn(
|
|
4478
4594
|
"flex items-center gap-2 rounded-md border border-input bg-[var(--monkeys-component-navigation-sidebar-search-background,hsl(var(--monkeys-color-control-surface)))] px-3 text-muted-foreground ring-offset-control-surface focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2",
|
|
4479
|
-
appearance.searchHeight
|
|
4595
|
+
appearance.searchHeight,
|
|
4596
|
+
appearance.unified && "rounded-[var(--radius)] border-border bg-[var(--monkeys-component-navigation-sidebar-search-background,transparent)] px-2"
|
|
4480
4597
|
),
|
|
4481
4598
|
children: [
|
|
4482
4599
|
/* @__PURE__ */ jsx(
|
|
@@ -4484,6 +4601,7 @@ function NavigationSidebarInner(props, ref) {
|
|
|
4484
4601
|
{
|
|
4485
4602
|
className: cn(
|
|
4486
4603
|
"flex shrink-0",
|
|
4604
|
+
appearance.unified && unifiedIcon,
|
|
4487
4605
|
props.classNames?.searchIcon
|
|
4488
4606
|
),
|
|
4489
4607
|
"aria-hidden": "true",
|
|
@@ -4537,6 +4655,7 @@ function NavigationSidebarInner(props, ref) {
|
|
|
4537
4655
|
{
|
|
4538
4656
|
className: cn(
|
|
4539
4657
|
"min-h-0 flex-1 overflow-y-auto px-[var(--monkeys-component-navigation-sidebar-content-inline-padding,var(--global-spacing,0.75rem))] py-3",
|
|
4658
|
+
appearance.unified && props.search && "pt-1",
|
|
4540
4659
|
resolvedCollapsed && "px-1.5",
|
|
4541
4660
|
props.classNames?.content
|
|
4542
4661
|
),
|
|
@@ -4548,6 +4667,7 @@ function NavigationSidebarInner(props, ref) {
|
|
|
4548
4667
|
{
|
|
4549
4668
|
className: cn(
|
|
4550
4669
|
"flex shrink-0 items-center gap-2 border-t border-border/70 p-3",
|
|
4670
|
+
appearance.unified && "border-border",
|
|
4551
4671
|
resolvedCollapsed && "justify-center px-1",
|
|
4552
4672
|
props.classNames?.footer
|
|
4553
4673
|
),
|