@inf-monkeys-tech/monkeys-design 1.0.111 → 1.0.112

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.
@@ -495,7 +495,13 @@ function mergeStyles(...sources) {
495
495
  );
496
496
  }
497
497
  function getPresetDefaults(preset) {
498
- return presetDefaults[preset] ?? presetDefaults.default;
498
+ const defaults = presetDefaults[preset];
499
+ if (!defaults) {
500
+ throw new TypeError(
501
+ `Unknown Data Explorer theme preset "${String(preset)}". Expected one of: ${Object.keys(presetDefaults).join(", ")}.`
502
+ );
503
+ }
504
+ return defaults;
499
505
  }
500
506
  function resolveDataExplorerAppearance(appearance) {
501
507
  const preset = appearance?.preset ?? "default";
@@ -1721,7 +1727,46 @@ function resolveAppearance(appearance) {
1721
1727
  surface === "outlined" && "border-border bg-background text-foreground shadow-none"
1722
1728
  ),
1723
1729
  itemHeight: density === "compact" ? "min-h-9" : density === "comfortable" ? "min-h-14" : "min-h-11",
1724
- itemPadding: density === "compact" ? "px-2 py-1.5" : density === "comfortable" ? "px-3 py-3" : "px-3 py-2"
1730
+ itemPadding: density === "compact" ? "px-2 py-1.5" : density === "comfortable" ? "px-3 py-3" : "px-3 py-2",
1731
+ searchHeight: density === "compact" ? "h-8" : density === "comfortable" ? "h-10" : "h-9"
1732
+ };
1733
+ }
1734
+ 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)))]";
1735
+ var navigationTreeRowSelectedClassName = "bg-[var(--monkeys-component-navigation-sidebar-tree-row-selected-background,hsl(var(--accent)))] text-[var(--monkeys-component-navigation-sidebar-tree-row-selected-foreground,hsl(var(--accent-foreground)))] hover:bg-[var(--monkeys-component-navigation-sidebar-tree-row-selected-background,hsl(var(--accent)))] hover:text-[var(--monkeys-component-navigation-sidebar-tree-row-selected-foreground,hsl(var(--accent-foreground)))]";
1736
+ var navigationTreeNestedControlClassName = "hover:!bg-transparent hover:!text-inherit focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring";
1737
+ function resolveNavigationTreeClassNames(classNames) {
1738
+ return {
1739
+ ...classNames,
1740
+ groupHeader: cn(navigationTreeRowHoverClassName, classNames?.groupHeader),
1741
+ itemSelected: cn(
1742
+ navigationTreeRowSelectedClassName,
1743
+ classNames?.itemSelected
1744
+ ),
1745
+ nodeButton: cn(
1746
+ navigationTreeRowHoverClassName,
1747
+ "aria-selected:bg-[var(--monkeys-component-navigation-sidebar-tree-row-selected-background,hsl(var(--accent)))] aria-selected:text-[var(--monkeys-component-navigation-sidebar-tree-row-selected-foreground,hsl(var(--accent-foreground)))] aria-selected:hover:bg-[var(--monkeys-component-navigation-sidebar-tree-row-selected-background,hsl(var(--accent)))] aria-selected:hover:text-[var(--monkeys-component-navigation-sidebar-tree-row-selected-foreground,hsl(var(--accent-foreground)))]",
1748
+ classNames?.nodeButton
1749
+ ),
1750
+ expander: cn(
1751
+ navigationTreeNestedControlClassName,
1752
+ classNames?.expander
1753
+ ),
1754
+ nodeToggle: cn(
1755
+ navigationTreeNestedControlClassName,
1756
+ classNames?.nodeToggle
1757
+ ),
1758
+ groupActions: cn(
1759
+ navigationTreeNestedControlClassName,
1760
+ classNames?.groupActions
1761
+ ),
1762
+ nodeActions: cn(
1763
+ navigationTreeNestedControlClassName,
1764
+ classNames?.nodeActions
1765
+ ),
1766
+ nodeDragHandle: cn(
1767
+ navigationTreeNestedControlClassName,
1768
+ classNames?.nodeDragHandle
1769
+ )
1725
1770
  };
1726
1771
  }
1727
1772
  function EntryButton({
@@ -2344,7 +2389,13 @@ function NavigationSidebarInner(props, ref) {
2344
2389
  );
2345
2390
  }
2346
2391
  const treeProps = props.tree;
2347
- return /* @__PURE__ */ jsx(DataExplorerViewTree, { ...treeProps });
2392
+ return /* @__PURE__ */ jsx(
2393
+ DataExplorerViewTree,
2394
+ {
2395
+ ...treeProps,
2396
+ classNames: resolveNavigationTreeClassNames(treeProps.classNames)
2397
+ }
2398
+ );
2348
2399
  };
2349
2400
  return /* @__PURE__ */ jsxs(Fragment, { children: [
2350
2401
  /* @__PURE__ */ jsxs(
@@ -2440,61 +2491,79 @@ function NavigationSidebarInner(props, ref) {
2440
2491
  ]
2441
2492
  }
2442
2493
  ) : null,
2443
- !resolvedCollapsed && props.search ? /* @__PURE__ */ jsx("div", { className: cn("p-3 pb-2", props.classNames?.search), children: /* @__PURE__ */ jsxs("div", { className: "flex h-9 items-center gap-2 rounded-md border border-border bg-background px-3 text-muted-foreground focus-within:ring-2 focus-within:ring-ring", children: [
2444
- /* @__PURE__ */ jsx(
2445
- "span",
2446
- {
2447
- className: cn(
2448
- "flex shrink-0",
2449
- props.classNames?.searchIcon
2450
- ),
2451
- "aria-hidden": "true",
2452
- children: props.search.icon ?? /* @__PURE__ */ jsx(SearchIcon, {})
2453
- }
2454
- ),
2455
- /* @__PURE__ */ jsx(
2456
- "input",
2457
- {
2458
- type: "search",
2459
- value: resolvedSearchValue,
2460
- placeholder: props.search.placeholder,
2461
- "aria-label": props.search.ariaLabel,
2462
- className: cn(
2463
- "min-w-0 flex-1 bg-transparent text-sm text-foreground outline-none placeholder:text-muted-foreground",
2464
- props.classNames?.searchInput
2465
- ),
2466
- onChange: (event) => {
2467
- const nextValue = event.currentTarget.value;
2468
- if (props.search?.value === void 0)
2469
- setInternalSearchValue(nextValue);
2470
- props.search?.onValueChange?.(nextValue);
2494
+ !resolvedCollapsed && props.search ? /* @__PURE__ */ jsx(
2495
+ "div",
2496
+ {
2497
+ className: cn(
2498
+ "px-[var(--monkeys-component-navigation-sidebar-content-inline-padding,var(--global-spacing,0.75rem))] pb-2 pt-3",
2499
+ props.classNames?.search
2500
+ ),
2501
+ children: /* @__PURE__ */ jsxs(
2502
+ "div",
2503
+ {
2504
+ className: cn(
2505
+ "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",
2506
+ appearance.searchHeight
2507
+ ),
2508
+ children: [
2509
+ /* @__PURE__ */ jsx(
2510
+ "span",
2511
+ {
2512
+ className: cn(
2513
+ "flex shrink-0",
2514
+ props.classNames?.searchIcon
2515
+ ),
2516
+ "aria-hidden": "true",
2517
+ children: props.search.icon ?? /* @__PURE__ */ jsx(SearchIcon, {})
2518
+ }
2519
+ ),
2520
+ /* @__PURE__ */ jsx(
2521
+ "input",
2522
+ {
2523
+ type: "search",
2524
+ value: resolvedSearchValue,
2525
+ placeholder: props.search.placeholder,
2526
+ "aria-label": props.search.ariaLabel,
2527
+ className: cn(
2528
+ "min-w-0 flex-1 bg-transparent text-sm text-foreground outline-none placeholder:text-muted-foreground",
2529
+ props.classNames?.searchInput
2530
+ ),
2531
+ onChange: (event) => {
2532
+ const nextValue = event.currentTarget.value;
2533
+ if (props.search?.value === void 0)
2534
+ setInternalSearchValue(nextValue);
2535
+ props.search?.onValueChange?.(nextValue);
2536
+ }
2537
+ }
2538
+ ),
2539
+ resolvedSearchValue && props.search.clearLabel ? /* @__PURE__ */ jsx(
2540
+ "button",
2541
+ {
2542
+ type: "button",
2543
+ className: cn(
2544
+ "inline-flex h-6 w-6 items-center justify-center rounded text-muted-foreground hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
2545
+ props.classNames?.searchClear
2546
+ ),
2547
+ "aria-label": props.search.clearLabel,
2548
+ title: props.search.clearLabel,
2549
+ onClick: () => {
2550
+ if (props.search?.value === void 0)
2551
+ setInternalSearchValue("");
2552
+ props.search?.onValueChange?.("");
2553
+ },
2554
+ children: /* @__PURE__ */ jsx(ClearIcon, {})
2555
+ }
2556
+ ) : null
2557
+ ]
2471
2558
  }
2472
- }
2473
- ),
2474
- resolvedSearchValue && props.search.clearLabel ? /* @__PURE__ */ jsx(
2475
- "button",
2476
- {
2477
- type: "button",
2478
- className: cn(
2479
- "inline-flex h-6 w-6 items-center justify-center rounded text-muted-foreground hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
2480
- props.classNames?.searchClear
2481
- ),
2482
- "aria-label": props.search.clearLabel,
2483
- title: props.search.clearLabel,
2484
- onClick: () => {
2485
- if (props.search?.value === void 0)
2486
- setInternalSearchValue("");
2487
- props.search?.onValueChange?.("");
2488
- },
2489
- children: /* @__PURE__ */ jsx(ClearIcon, {})
2490
- }
2491
- ) : null
2492
- ] }) }) : null,
2559
+ )
2560
+ }
2561
+ ) : null,
2493
2562
  /* @__PURE__ */ jsx(
2494
2563
  "div",
2495
2564
  {
2496
2565
  className: cn(
2497
- "min-h-0 flex-1 overflow-y-auto p-3",
2566
+ "min-h-0 flex-1 overflow-y-auto px-[var(--monkeys-component-navigation-sidebar-content-inline-padding,var(--global-spacing,0.75rem))] py-3",
2498
2567
  resolvedCollapsed && "px-1.5",
2499
2568
  props.classNames?.content
2500
2569
  ),