@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
|
@@ -2827,6 +2827,7 @@ function DataExplorerViewTree({
|
|
|
2827
2827
|
onSelectNode?.(node, context);
|
|
2828
2828
|
},
|
|
2829
2829
|
onKeyDown: (event) => {
|
|
2830
|
+
if (event.target !== event.currentTarget) return;
|
|
2830
2831
|
if (!isSelectable) return;
|
|
2831
2832
|
if (event.key !== "Enter" && event.key !== " ") return;
|
|
2832
2833
|
event.preventDefault();
|
|
@@ -2953,7 +2954,7 @@ function DataExplorerViewTree({
|
|
|
2953
2954
|
"div",
|
|
2954
2955
|
{
|
|
2955
2956
|
className: cn(theme.slots.treeRoot, classNames?.root, className),
|
|
2956
|
-
role: hasAnyNodes ? "tree" : void 0,
|
|
2957
|
+
role: hasAnyNodes || resolvedGroups.some((group) => !group.hideHeader) ? "tree" : void 0,
|
|
2957
2958
|
children: resolvedGroups.map((group) => {
|
|
2958
2959
|
const groupExpanded = group.hideHeader || group.collapsible === false || resolvedExpandedGroupIds.has(group.id);
|
|
2959
2960
|
const groupNodeCount = group.nodes?.length ?? 0;
|
|
@@ -2970,6 +2971,10 @@ function DataExplorerViewTree({
|
|
|
2970
2971
|
!group.hideHeader ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2971
2972
|
"div",
|
|
2972
2973
|
{
|
|
2974
|
+
role: "treeitem",
|
|
2975
|
+
"aria-label": typeof group.label === "string" ? group.label : void 0,
|
|
2976
|
+
"aria-selected": group.selectable ? groupSelected : void 0,
|
|
2977
|
+
"aria-expanded": groupCollapsible ? groupExpanded : void 0,
|
|
2973
2978
|
className: cn(
|
|
2974
2979
|
theme.slots.treeGroupHeader,
|
|
2975
2980
|
theme.slots.treeGroupHeaderButton,
|
|
@@ -3054,6 +3059,7 @@ function DataExplorerViewTree({
|
|
|
3054
3059
|
groupExpanded ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
3055
3060
|
"div",
|
|
3056
3061
|
{
|
|
3062
|
+
role: "group",
|
|
3057
3063
|
className: cn(
|
|
3058
3064
|
theme.slots.treeGroupContent,
|
|
3059
3065
|
classNames?.groupContent,
|
|
@@ -3082,6 +3088,72 @@ function DataExplorerViewTree({
|
|
|
3082
3088
|
}
|
|
3083
3089
|
);
|
|
3084
3090
|
}
|
|
3091
|
+
|
|
3092
|
+
// src/components/navigation-sidebar/unified-appearance.ts
|
|
3093
|
+
var unifiedRow = "gap-2 rounded-[var(--radius)] border border-transparent text-sm font-medium motion-reduce:transition-none";
|
|
3094
|
+
var unifiedIcon = "size-[var(--monkeys-component-navigation-sidebar-icon-size,1.125rem)] shrink-0 text-inherit [&_svg]:size-full";
|
|
3095
|
+
var unifiedInactive = "text-foreground hover:border-transparent hover:bg-[var(--navigation-internal-hover-background)] hover:text-[var(--navigation-internal-hover-foreground)]";
|
|
3096
|
+
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)]";
|
|
3097
|
+
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)))]";
|
|
3098
|
+
function unifiedStyle(activeVariant) {
|
|
3099
|
+
const background = {
|
|
3100
|
+
muted: "hsl(var(--monkeys-color-accent,var(--accent)))",
|
|
3101
|
+
soft: "color-mix(in srgb,hsl(var(--monkeys-color-primary,var(--primary))) 10%,transparent)",
|
|
3102
|
+
solid: "hsl(var(--monkeys-color-primary,var(--primary)))",
|
|
3103
|
+
outline: "hsl(var(--monkeys-color-background,var(--background)))"
|
|
3104
|
+
}[activeVariant ?? "muted"];
|
|
3105
|
+
const foreground = activeVariant === "solid" ? "hsl(var(--monkeys-color-primary-foreground,var(--primary-foreground)))" : "hsl(var(--monkeys-color-foreground,var(--foreground)))";
|
|
3106
|
+
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)))";
|
|
3107
|
+
return {
|
|
3108
|
+
"--navigation-internal-default-selected-background": activeVariant === void 0 ? "var(--navigation-internal-theme-selected-background)" : background,
|
|
3109
|
+
"--navigation-internal-default-selected-foreground": activeVariant === void 0 ? "var(--navigation-internal-theme-selected-foreground)" : foreground,
|
|
3110
|
+
"--navigation-internal-selected-background": "var(--monkeys-component-navigation-sidebar-row-selected-background,var(--navigation-internal-default-selected-background))",
|
|
3111
|
+
"--navigation-internal-selected-foreground": "var(--monkeys-component-navigation-sidebar-row-selected-foreground,var(--navigation-internal-default-selected-foreground))",
|
|
3112
|
+
"--navigation-internal-selected-border": `var(--monkeys-component-navigation-sidebar-row-selected-border,${border})`,
|
|
3113
|
+
"--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))",
|
|
3114
|
+
"--navigation-internal-hover-foreground": "var(--monkeys-component-navigation-sidebar-row-hover-foreground,hsl(var(--monkeys-color-foreground,var(--foreground))))"
|
|
3115
|
+
};
|
|
3116
|
+
}
|
|
3117
|
+
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)))))]";
|
|
3118
|
+
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)]";
|
|
3119
|
+
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";
|
|
3120
|
+
function unifiedTreeClassNames(height, padding, overrides = {}) {
|
|
3121
|
+
const row = cn(unifiedRow, height, padding, unifiedInactive);
|
|
3122
|
+
return {
|
|
3123
|
+
...overrides,
|
|
3124
|
+
root: cn(treeStateVariables, "space-y-0.5", overrides.root),
|
|
3125
|
+
group: cn(
|
|
3126
|
+
"space-y-0.5",
|
|
3127
|
+
// A visible group header adds a level; headerless groups contain root items.
|
|
3128
|
+
"[&>[role=treeitem]+[role=group]]:pl-[var(--monkeys-component-navigation-sidebar-tree-group-indent,1rem)]",
|
|
3129
|
+
overrides.group
|
|
3130
|
+
),
|
|
3131
|
+
groupHeaderButton: cn("h-auto", row, overrides.groupHeaderButton),
|
|
3132
|
+
nodeButton: cn(row, selectedTreeNode, overrides.nodeButton),
|
|
3133
|
+
itemSelected: cn(unifiedSelected, overrides.itemSelected),
|
|
3134
|
+
nodeIcon: cn(
|
|
3135
|
+
unifiedIcon,
|
|
3136
|
+
"group-hover/tree-node:text-inherit",
|
|
3137
|
+
overrides.nodeIcon
|
|
3138
|
+
),
|
|
3139
|
+
nodeLabel: cn("font-medium", overrides.nodeLabel),
|
|
3140
|
+
nodeDescription: cn("text-inherit", overrides.nodeDescription),
|
|
3141
|
+
nodeDisabled: cn("opacity-50", overrides.nodeDisabled),
|
|
3142
|
+
groupActions: cn(
|
|
3143
|
+
nestedControl,
|
|
3144
|
+
"order-2 size-5 p-0 group-focus-within/tree-group:opacity-100",
|
|
3145
|
+
overrides.groupActions
|
|
3146
|
+
),
|
|
3147
|
+
nodeActions: cn(
|
|
3148
|
+
nestedControl,
|
|
3149
|
+
"order-2 size-5 p-0 group-focus-within/tree-node:opacity-100",
|
|
3150
|
+
overrides.nodeActions
|
|
3151
|
+
),
|
|
3152
|
+
nodeToggle: cn(nestedControl, "order-1", overrides.nodeToggle),
|
|
3153
|
+
expander: cn(nestedControl, "order-1", overrides.expander),
|
|
3154
|
+
nodeDragHandle: cn(nestedControl, overrides.nodeDragHandle)
|
|
3155
|
+
};
|
|
3156
|
+
}
|
|
3085
3157
|
function CollapseIcon({ collapsed }) {
|
|
3086
3158
|
return /* @__PURE__ */ jsxRuntime.jsx("svg", { "aria-hidden": "true", viewBox: "0 0 20 20", className: "h-4 w-4", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3087
3159
|
"path",
|
|
@@ -3267,22 +3339,34 @@ function activeVariantClassName(activeVariant) {
|
|
|
3267
3339
|
return "border-primary/25 bg-primary/10 text-foreground";
|
|
3268
3340
|
}
|
|
3269
3341
|
function resolveAppearance(appearance) {
|
|
3270
|
-
|
|
3342
|
+
if (appearance?.preset !== void 0 && appearance.preset !== "unified") {
|
|
3343
|
+
throw new TypeError(
|
|
3344
|
+
`Unknown NavigationSidebar preset "${appearance.preset}". Supported preset: unified.`
|
|
3345
|
+
);
|
|
3346
|
+
}
|
|
3347
|
+
const unified = appearance?.preset === "unified";
|
|
3348
|
+
const density = appearance?.density ?? (unified ? "compact" : "default");
|
|
3271
3349
|
const surface = appearance?.surface ?? "panel";
|
|
3272
|
-
const activeVariant = appearance?.activeVariant ?? "soft";
|
|
3350
|
+
const activeVariant = appearance?.activeVariant ?? (unified ? "muted" : "soft");
|
|
3273
3351
|
return {
|
|
3352
|
+
unified,
|
|
3274
3353
|
density,
|
|
3275
3354
|
surface,
|
|
3276
3355
|
activeVariant,
|
|
3356
|
+
selected: unified ? unifiedSelected : activeVariantClassName(activeVariant),
|
|
3357
|
+
inactive: unified ? unifiedInactive : "text-muted-foreground hover:border-border/70 hover:bg-muted/60 hover:text-foreground",
|
|
3277
3358
|
root: cn(
|
|
3278
3359
|
surface === "plain" && "border-transparent bg-transparent shadow-none",
|
|
3279
3360
|
surface === "panel" && "border-border/70 bg-card text-card-foreground shadow-sm",
|
|
3280
3361
|
surface === "frosted" && "border-border/55 bg-card/80 text-card-foreground shadow-sm backdrop-blur-xl",
|
|
3281
|
-
surface === "outlined" && "border-border bg-background text-foreground shadow-none"
|
|
3362
|
+
surface === "outlined" && "border-border bg-background text-foreground shadow-none",
|
|
3363
|
+
unified && "rounded-[var(--radius)] shadow-none",
|
|
3364
|
+
unified && unifiedThemeDefaults,
|
|
3365
|
+
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"
|
|
3282
3366
|
),
|
|
3283
|
-
itemHeight: density === "compact" ? "min-h-9" : density === "comfortable" ? "min-h-14" : "min-h-11",
|
|
3284
|
-
itemPadding: density === "compact" ? "px-2 py-1.5" : density === "comfortable" ? "px-3 py-3" : "px-3 py-2",
|
|
3285
|
-
searchHeight: density === "compact" ? "h-8" : density === "comfortable" ? "h-10" : "h-9"
|
|
3367
|
+
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",
|
|
3368
|
+
itemPadding: density === "compact" ? unified ? "px-2 py-2" : "px-2 py-1.5" : density === "comfortable" ? "px-3 py-3" : "px-3 py-2",
|
|
3369
|
+
searchHeight: density === "compact" ? unified ? "h-[var(--monkeys-component-navigation-sidebar-row-height,2.5rem)]" : "h-8" : density === "comfortable" ? "h-10" : "h-9"
|
|
3286
3370
|
};
|
|
3287
3371
|
}
|
|
3288
3372
|
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)))]";
|
|
@@ -3337,7 +3421,8 @@ function entryClassName({
|
|
|
3337
3421
|
"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",
|
|
3338
3422
|
appearance.itemHeight,
|
|
3339
3423
|
appearance.itemPadding,
|
|
3340
|
-
|
|
3424
|
+
appearance.unified && unifiedRow,
|
|
3425
|
+
embedded ? "min-h-0 self-stretch border-0 bg-transparent text-inherit hover:bg-transparent hover:text-inherit" : active ? appearance.selected : appearance.inactive,
|
|
3341
3426
|
collapsed && !mobile && "justify-center px-0",
|
|
3342
3427
|
item.disabled && "pointer-events-none opacity-50",
|
|
3343
3428
|
classNames?.item,
|
|
@@ -3352,7 +3437,8 @@ function EntryContent({
|
|
|
3352
3437
|
collapsed,
|
|
3353
3438
|
mobile,
|
|
3354
3439
|
classNames,
|
|
3355
|
-
endIndicator
|
|
3440
|
+
endIndicator,
|
|
3441
|
+
appearance
|
|
3356
3442
|
}) {
|
|
3357
3443
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3358
3444
|
hasRenderableNode(item.icon) ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -3360,6 +3446,7 @@ function EntryContent({
|
|
|
3360
3446
|
{
|
|
3361
3447
|
className: cn(
|
|
3362
3448
|
"flex size-5 shrink-0 items-center justify-center [&_svg]:size-full",
|
|
3449
|
+
appearance.unified && unifiedIcon,
|
|
3363
3450
|
classNames?.itemIcon
|
|
3364
3451
|
),
|
|
3365
3452
|
"aria-hidden": "true",
|
|
@@ -3379,6 +3466,7 @@ function EntryContent({
|
|
|
3379
3466
|
{
|
|
3380
3467
|
className: cn(
|
|
3381
3468
|
"min-w-0 truncate font-semibold",
|
|
3469
|
+
appearance.unified && "font-medium",
|
|
3382
3470
|
classNames?.itemLabel
|
|
3383
3471
|
),
|
|
3384
3472
|
children: item.label
|
|
@@ -3389,6 +3477,7 @@ function EntryContent({
|
|
|
3389
3477
|
{
|
|
3390
3478
|
className: cn(
|
|
3391
3479
|
"mt-0.5 truncate text-xs font-normal",
|
|
3480
|
+
appearance.unified && "text-inherit",
|
|
3392
3481
|
classNames?.itemDescription
|
|
3393
3482
|
),
|
|
3394
3483
|
children: item.description
|
|
@@ -3469,6 +3558,7 @@ function EntryButton({
|
|
|
3469
3558
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3470
3559
|
EntryContent,
|
|
3471
3560
|
{
|
|
3561
|
+
appearance,
|
|
3472
3562
|
item,
|
|
3473
3563
|
collapsed,
|
|
3474
3564
|
mobile,
|
|
@@ -3505,6 +3595,7 @@ function EntryPresentation({
|
|
|
3505
3595
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3506
3596
|
EntryContent,
|
|
3507
3597
|
{
|
|
3598
|
+
appearance,
|
|
3508
3599
|
item,
|
|
3509
3600
|
collapsed: false,
|
|
3510
3601
|
mobile: true,
|
|
@@ -3521,7 +3612,8 @@ function routeRowClassName({
|
|
|
3521
3612
|
return cn(
|
|
3522
3613
|
"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",
|
|
3523
3614
|
appearance.itemHeight,
|
|
3524
|
-
|
|
3615
|
+
appearance.unified && unifiedRow,
|
|
3616
|
+
active ? appearance.selected : appearance.inactive
|
|
3525
3617
|
);
|
|
3526
3618
|
}
|
|
3527
3619
|
function filterCatalogItems(items, activeFilterId) {
|
|
@@ -3675,7 +3767,8 @@ function ChildEntry({
|
|
|
3675
3767
|
"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",
|
|
3676
3768
|
appearance.itemHeight,
|
|
3677
3769
|
appearance.itemPadding,
|
|
3678
|
-
|
|
3770
|
+
appearance.unified && unifiedRow,
|
|
3771
|
+
embedded ? "min-h-0 self-stretch border-0 bg-transparent text-inherit hover:bg-transparent hover:text-inherit" : active ? appearance.selected : appearance.inactive,
|
|
3679
3772
|
child.disabled && "pointer-events-none opacity-50",
|
|
3680
3773
|
classNames?.childItem,
|
|
3681
3774
|
active && classNames?.childItemActive,
|
|
@@ -3687,7 +3780,10 @@ function ChildEntry({
|
|
|
3687
3780
|
hasRenderableNode(child.icon) ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
3688
3781
|
"span",
|
|
3689
3782
|
{
|
|
3690
|
-
className:
|
|
3783
|
+
className: cn(
|
|
3784
|
+
"flex size-5 shrink-0 items-center justify-center [&_svg]:size-full",
|
|
3785
|
+
appearance.unified && unifiedIcon
|
|
3786
|
+
),
|
|
3691
3787
|
"aria-hidden": "true",
|
|
3692
3788
|
children: child.icon
|
|
3693
3789
|
}
|
|
@@ -3836,6 +3932,7 @@ function CollapsedChildMenu({
|
|
|
3836
3932
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3837
3933
|
EntryContent,
|
|
3838
3934
|
{
|
|
3935
|
+
appearance,
|
|
3839
3936
|
item,
|
|
3840
3937
|
collapsed: !mobile,
|
|
3841
3938
|
mobile,
|
|
@@ -3949,137 +4046,148 @@ function RouteContent({
|
|
|
3949
4046
|
onExpandedItemIdsChange
|
|
3950
4047
|
]
|
|
3951
4048
|
);
|
|
3952
|
-
return /* @__PURE__ */ jsxRuntime.jsx("nav", { "aria-label": ariaLabel, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3953
|
-
|
|
3954
|
-
|
|
3955
|
-
|
|
3956
|
-
|
|
3957
|
-
|
|
3958
|
-
|
|
3959
|
-
const compoundItemRow = collapsed && hasChildren && Boolean(onChildSelect) || !collapsed && childrenCollapsible && !disclosure || showItemActions;
|
|
3960
|
-
const childListId = `${disclosureId}-route-children-${itemIndex}`;
|
|
3961
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("li", { className: "grid min-w-0 gap-1", children: [
|
|
3962
|
-
collapsed && disclosure ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
3963
|
-
CollapsedChildMenu,
|
|
3964
|
-
{
|
|
3965
|
-
item,
|
|
3966
|
-
activeChildId,
|
|
3967
|
-
label: collapsedChildMenuLabel,
|
|
3968
|
-
onChildSelect,
|
|
3969
|
-
classNames,
|
|
3970
|
-
appearance,
|
|
3971
|
-
triggerVariant: "item"
|
|
3972
|
-
}
|
|
3973
|
-
) : /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3974
|
-
"div",
|
|
3975
|
-
{
|
|
3976
|
-
"data-navigation-sidebar-item-row": compoundItemRow ? item.id : void 0,
|
|
3977
|
-
"data-active": compoundItemRow ? String(active) : void 0,
|
|
3978
|
-
className: compoundItemRow ? routeRowClassName({ active, appearance }) : void 0,
|
|
3979
|
-
children: [
|
|
3980
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3981
|
-
EntryButton,
|
|
3982
|
-
{
|
|
3983
|
-
item,
|
|
3984
|
-
active,
|
|
3985
|
-
collapsed,
|
|
3986
|
-
embedded: compoundItemRow,
|
|
3987
|
-
itemAs: disclosure ? "button" : itemAs,
|
|
3988
|
-
appearance,
|
|
3989
|
-
classNames,
|
|
3990
|
-
onSelect: disclosure ? () => toggleItemExpanded(item) : onItemSelect ? () => onItemSelect(item) : void 0,
|
|
3991
|
-
ariaControls: !collapsed && childrenCollapsible && disclosure ? childListId : void 0,
|
|
3992
|
-
ariaExpanded: !collapsed && childrenCollapsible && disclosure ? childrenExpanded : void 0,
|
|
3993
|
-
endIndicator: !collapsed && disclosure && !showItemActions ? /* @__PURE__ */ jsxRuntime.jsx(DisclosureIcon, { expanded: childrenExpanded }) : void 0
|
|
3994
|
-
}
|
|
3995
|
-
),
|
|
3996
|
-
showItemActions ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
3997
|
-
RouteActions,
|
|
3998
|
-
{
|
|
3999
|
-
itemId: item.id,
|
|
4000
|
-
actions: item.actions,
|
|
4001
|
-
kind: "item",
|
|
4002
|
-
className: classNames?.itemActions
|
|
4003
|
-
}
|
|
4004
|
-
) : null,
|
|
4005
|
-
collapsed && onChildSelect ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
4006
|
-
CollapsedChildMenu,
|
|
4007
|
-
{
|
|
4008
|
-
item,
|
|
4009
|
-
activeChildId,
|
|
4010
|
-
label: collapsedChildMenuLabel,
|
|
4011
|
-
onChildSelect,
|
|
4012
|
-
classNames
|
|
4013
|
-
}
|
|
4014
|
-
) : null,
|
|
4015
|
-
!collapsed && childrenCollapsible && (!disclosure || showItemActions) ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
4016
|
-
RouteChildrenToggle,
|
|
4017
|
-
{
|
|
4018
|
-
item,
|
|
4019
|
-
expanded: childrenExpanded,
|
|
4020
|
-
controls: childListId,
|
|
4021
|
-
label: disclosureLabel,
|
|
4022
|
-
onToggle: () => toggleItemExpanded(item),
|
|
4023
|
-
classNames
|
|
4024
|
-
}
|
|
4025
|
-
) : null
|
|
4026
|
-
]
|
|
4027
|
-
}
|
|
4049
|
+
return /* @__PURE__ */ jsxRuntime.jsx("nav", { "aria-label": ariaLabel, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4050
|
+
"ul",
|
|
4051
|
+
{
|
|
4052
|
+
className: cn(
|
|
4053
|
+
"grid list-none gap-2 p-0",
|
|
4054
|
+
appearance.unified && "gap-0.5",
|
|
4055
|
+
classNames?.list
|
|
4028
4056
|
),
|
|
4029
|
-
|
|
4030
|
-
|
|
4031
|
-
|
|
4032
|
-
|
|
4033
|
-
|
|
4034
|
-
|
|
4035
|
-
|
|
4036
|
-
|
|
4037
|
-
|
|
4057
|
+
children: routeItems.map((item, itemIndex) => {
|
|
4058
|
+
const disclosure = isDisclosureRouteItem(item);
|
|
4059
|
+
const active = !disclosure && item.id === activeItemId;
|
|
4060
|
+
const hasChildren = Boolean(item.children?.length);
|
|
4061
|
+
const childrenCollapsible = collapsibleItemIds.has(item.id);
|
|
4062
|
+
const childrenExpanded = !childrenCollapsible || expandedItemIdSet.has(item.id);
|
|
4063
|
+
const showItemActions = !collapsed && hasRenderableNode(item.actions);
|
|
4064
|
+
const compoundItemRow = collapsed && hasChildren && Boolean(onChildSelect) || !collapsed && childrenCollapsible && !disclosure || showItemActions;
|
|
4065
|
+
const childListId = `${disclosureId}-route-children-${itemIndex}`;
|
|
4066
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("li", { className: "grid min-w-0 gap-1", children: [
|
|
4067
|
+
collapsed && disclosure ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
4068
|
+
CollapsedChildMenu,
|
|
4069
|
+
{
|
|
4070
|
+
item,
|
|
4071
|
+
activeChildId,
|
|
4072
|
+
label: collapsedChildMenuLabel,
|
|
4073
|
+
onChildSelect,
|
|
4074
|
+
classNames,
|
|
4075
|
+
appearance,
|
|
4076
|
+
triggerVariant: "item"
|
|
4077
|
+
}
|
|
4078
|
+
) : /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4079
|
+
"div",
|
|
4080
|
+
{
|
|
4081
|
+
"data-navigation-sidebar-item-row": compoundItemRow ? item.id : void 0,
|
|
4082
|
+
"data-active": compoundItemRow ? String(active) : void 0,
|
|
4083
|
+
className: compoundItemRow ? routeRowClassName({ active, appearance }) : void 0,
|
|
4084
|
+
children: [
|
|
4085
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4086
|
+
EntryButton,
|
|
4087
|
+
{
|
|
4088
|
+
item,
|
|
4089
|
+
active,
|
|
4090
|
+
collapsed,
|
|
4091
|
+
embedded: compoundItemRow,
|
|
4092
|
+
itemAs: disclosure ? "button" : itemAs,
|
|
4093
|
+
appearance,
|
|
4094
|
+
classNames,
|
|
4095
|
+
onSelect: disclosure ? () => toggleItemExpanded(item) : onItemSelect ? () => onItemSelect(item) : void 0,
|
|
4096
|
+
ariaControls: !collapsed && childrenCollapsible && disclosure ? childListId : void 0,
|
|
4097
|
+
ariaExpanded: !collapsed && childrenCollapsible && disclosure ? childrenExpanded : void 0,
|
|
4098
|
+
endIndicator: !collapsed && disclosure && !showItemActions ? /* @__PURE__ */ jsxRuntime.jsx(DisclosureIcon, { expanded: childrenExpanded }) : void 0
|
|
4099
|
+
}
|
|
4100
|
+
),
|
|
4101
|
+
showItemActions ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
4102
|
+
RouteActions,
|
|
4103
|
+
{
|
|
4104
|
+
itemId: item.id,
|
|
4105
|
+
actions: item.actions,
|
|
4106
|
+
kind: "item",
|
|
4107
|
+
className: classNames?.itemActions
|
|
4108
|
+
}
|
|
4109
|
+
) : null,
|
|
4110
|
+
collapsed && onChildSelect ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
4111
|
+
CollapsedChildMenu,
|
|
4112
|
+
{
|
|
4113
|
+
item,
|
|
4114
|
+
activeChildId,
|
|
4115
|
+
label: collapsedChildMenuLabel,
|
|
4116
|
+
onChildSelect,
|
|
4117
|
+
classNames
|
|
4118
|
+
}
|
|
4119
|
+
) : null,
|
|
4120
|
+
!collapsed && childrenCollapsible && (!disclosure || showItemActions) ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
4121
|
+
RouteChildrenToggle,
|
|
4122
|
+
{
|
|
4123
|
+
item,
|
|
4124
|
+
expanded: childrenExpanded,
|
|
4125
|
+
controls: childListId,
|
|
4126
|
+
label: disclosureLabel,
|
|
4127
|
+
onToggle: () => toggleItemExpanded(item),
|
|
4128
|
+
classNames
|
|
4129
|
+
}
|
|
4130
|
+
) : null
|
|
4131
|
+
]
|
|
4132
|
+
}
|
|
4038
4133
|
),
|
|
4039
|
-
|
|
4040
|
-
|
|
4041
|
-
|
|
4042
|
-
|
|
4043
|
-
|
|
4044
|
-
{
|
|
4045
|
-
|
|
4046
|
-
|
|
4047
|
-
|
|
4048
|
-
|
|
4049
|
-
|
|
4050
|
-
|
|
4051
|
-
|
|
4052
|
-
|
|
4053
|
-
|
|
4054
|
-
|
|
4055
|
-
|
|
4056
|
-
|
|
4057
|
-
|
|
4058
|
-
|
|
4059
|
-
|
|
4060
|
-
|
|
4061
|
-
|
|
4062
|
-
|
|
4063
|
-
|
|
4064
|
-
|
|
4065
|
-
|
|
4066
|
-
|
|
4067
|
-
|
|
4068
|
-
|
|
4069
|
-
|
|
4070
|
-
|
|
4071
|
-
|
|
4072
|
-
|
|
4073
|
-
|
|
4074
|
-
|
|
4075
|
-
|
|
4076
|
-
|
|
4077
|
-
|
|
4078
|
-
|
|
4079
|
-
|
|
4080
|
-
|
|
4081
|
-
|
|
4082
|
-
|
|
4134
|
+
!collapsed && hasChildren ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
4135
|
+
"ul",
|
|
4136
|
+
{
|
|
4137
|
+
id: childListId,
|
|
4138
|
+
hidden: !childrenExpanded,
|
|
4139
|
+
style: childrenExpanded ? void 0 : { display: "none" },
|
|
4140
|
+
className: cn(
|
|
4141
|
+
"ml-5 grid list-none gap-0.5 border-l border-border/70 py-1 pl-3",
|
|
4142
|
+
appearance.unified && "border-border",
|
|
4143
|
+
classNames?.childList
|
|
4144
|
+
),
|
|
4145
|
+
children: item.children?.map((child) => {
|
|
4146
|
+
const hasChildActions = hasRenderableNode(child.actions);
|
|
4147
|
+
const childActive = child.id === activeChildId;
|
|
4148
|
+
const childEntry = /* @__PURE__ */ jsxRuntime.jsx(
|
|
4149
|
+
ChildEntry,
|
|
4150
|
+
{
|
|
4151
|
+
child,
|
|
4152
|
+
parent: item,
|
|
4153
|
+
active: childActive,
|
|
4154
|
+
interactive: Boolean(onChildSelect),
|
|
4155
|
+
onSelect: onChildSelect,
|
|
4156
|
+
appearance,
|
|
4157
|
+
classNames,
|
|
4158
|
+
embedded: hasChildActions
|
|
4159
|
+
}
|
|
4160
|
+
);
|
|
4161
|
+
return /* @__PURE__ */ jsxRuntime.jsx("li", { children: hasChildActions ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4162
|
+
"div",
|
|
4163
|
+
{
|
|
4164
|
+
"data-navigation-sidebar-child-row": child.id,
|
|
4165
|
+
"data-active": String(childActive),
|
|
4166
|
+
className: routeRowClassName({
|
|
4167
|
+
active: childActive,
|
|
4168
|
+
appearance
|
|
4169
|
+
}),
|
|
4170
|
+
children: [
|
|
4171
|
+
childEntry,
|
|
4172
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4173
|
+
RouteActions,
|
|
4174
|
+
{
|
|
4175
|
+
itemId: child.id,
|
|
4176
|
+
actions: child.actions,
|
|
4177
|
+
kind: "child",
|
|
4178
|
+
className: classNames?.childActions
|
|
4179
|
+
}
|
|
4180
|
+
)
|
|
4181
|
+
]
|
|
4182
|
+
}
|
|
4183
|
+
) : childEntry }, child.id);
|
|
4184
|
+
})
|
|
4185
|
+
}
|
|
4186
|
+
) : null
|
|
4187
|
+
] }, item.id);
|
|
4188
|
+
})
|
|
4189
|
+
}
|
|
4190
|
+
) });
|
|
4083
4191
|
}
|
|
4084
4192
|
function flattenCatalogItems(items, sections, activeFilterId) {
|
|
4085
4193
|
return [
|
|
@@ -4389,7 +4497,11 @@ function NavigationSidebarInner(props, ref) {
|
|
|
4389
4497
|
DataExplorerViewTree,
|
|
4390
4498
|
{
|
|
4391
4499
|
...treeProps,
|
|
4392
|
-
classNames:
|
|
4500
|
+
classNames: appearance.unified ? unifiedTreeClassNames(
|
|
4501
|
+
appearance.itemHeight,
|
|
4502
|
+
appearance.itemPadding,
|
|
4503
|
+
treeProps.classNames
|
|
4504
|
+
) : resolveNavigationTreeClassNames(treeProps.classNames)
|
|
4393
4505
|
}
|
|
4394
4506
|
);
|
|
4395
4507
|
};
|
|
@@ -4402,6 +4514,7 @@ function NavigationSidebarInner(props, ref) {
|
|
|
4402
4514
|
"aria-label": props.ariaLabel,
|
|
4403
4515
|
"data-monkeys-component": props.dataComponent ?? "navigation-sidebar",
|
|
4404
4516
|
"data-navigation-sidebar-kind": props.kind,
|
|
4517
|
+
"data-navigation-sidebar-preset": props.appearance?.preset,
|
|
4405
4518
|
"data-collapsed": resolvedCollapsed ? "true" : "false",
|
|
4406
4519
|
className: cn(
|
|
4407
4520
|
"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",
|
|
@@ -4412,6 +4525,7 @@ function NavigationSidebarInner(props, ref) {
|
|
|
4412
4525
|
props.className
|
|
4413
4526
|
),
|
|
4414
4527
|
style: {
|
|
4528
|
+
...appearance.unified ? unifiedStyle(props.appearance?.activeVariant) : {},
|
|
4415
4529
|
...props.style,
|
|
4416
4530
|
width: props.widthMode === "fill" ? void 0 : resolvedCollapsed ? bounds.collapsedWidth : resolvedWidth,
|
|
4417
4531
|
transition: isResizing ? "none" : props.style?.transition
|
|
@@ -4449,6 +4563,7 @@ function NavigationSidebarInner(props, ref) {
|
|
|
4449
4563
|
{
|
|
4450
4564
|
className: cn(
|
|
4451
4565
|
"flex min-h-12 min-w-0 items-center gap-2 border-b border-border/60 px-3",
|
|
4566
|
+
appearance.unified && "min-h-14 border-border px-[var(--monkeys-component-navigation-sidebar-content-inline-padding,var(--global-spacing,0.75rem))]",
|
|
4452
4567
|
resolvedCollapsed && "justify-center px-1",
|
|
4453
4568
|
props.classNames?.header
|
|
4454
4569
|
),
|
|
@@ -4492,6 +4607,7 @@ function NavigationSidebarInner(props, ref) {
|
|
|
4492
4607
|
{
|
|
4493
4608
|
className: cn(
|
|
4494
4609
|
"px-[var(--monkeys-component-navigation-sidebar-content-inline-padding,var(--global-spacing,0.75rem))] pb-2 pt-3",
|
|
4610
|
+
appearance.unified && "pb-1",
|
|
4495
4611
|
props.classNames?.search
|
|
4496
4612
|
),
|
|
4497
4613
|
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -4499,7 +4615,8 @@ function NavigationSidebarInner(props, ref) {
|
|
|
4499
4615
|
{
|
|
4500
4616
|
className: cn(
|
|
4501
4617
|
"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",
|
|
4502
|
-
appearance.searchHeight
|
|
4618
|
+
appearance.searchHeight,
|
|
4619
|
+
appearance.unified && "rounded-[var(--radius)] border-border bg-[var(--monkeys-component-navigation-sidebar-search-background,transparent)] px-2"
|
|
4503
4620
|
),
|
|
4504
4621
|
children: [
|
|
4505
4622
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -4507,6 +4624,7 @@ function NavigationSidebarInner(props, ref) {
|
|
|
4507
4624
|
{
|
|
4508
4625
|
className: cn(
|
|
4509
4626
|
"flex shrink-0",
|
|
4627
|
+
appearance.unified && unifiedIcon,
|
|
4510
4628
|
props.classNames?.searchIcon
|
|
4511
4629
|
),
|
|
4512
4630
|
"aria-hidden": "true",
|
|
@@ -4560,6 +4678,7 @@ function NavigationSidebarInner(props, ref) {
|
|
|
4560
4678
|
{
|
|
4561
4679
|
className: cn(
|
|
4562
4680
|
"min-h-0 flex-1 overflow-y-auto px-[var(--monkeys-component-navigation-sidebar-content-inline-padding,var(--global-spacing,0.75rem))] py-3",
|
|
4681
|
+
appearance.unified && props.search && "pt-1",
|
|
4563
4682
|
resolvedCollapsed && "px-1.5",
|
|
4564
4683
|
props.classNames?.content
|
|
4565
4684
|
),
|
|
@@ -4571,6 +4690,7 @@ function NavigationSidebarInner(props, ref) {
|
|
|
4571
4690
|
{
|
|
4572
4691
|
className: cn(
|
|
4573
4692
|
"flex shrink-0 items-center gap-2 border-t border-border/70 p-3",
|
|
4693
|
+
appearance.unified && "border-border",
|
|
4574
4694
|
resolvedCollapsed && "justify-center px-1",
|
|
4575
4695
|
props.classNames?.footer
|
|
4576
4696
|
),
|