@ai-matrx/design-system 0.86.328 → 0.86.330

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/item.cjs CHANGED
@@ -42,7 +42,6 @@ __export(item_exports, {
42
42
  isCommand: () => isCommand,
43
43
  isLink: () => isLink,
44
44
  isSubmenu: () => isSubmenu,
45
- matchSidebarPlaces: () => matchSidebarPlaces,
46
45
  resolveItemMenuConfig: () => resolveItemMenuConfig,
47
46
  runCommand: () => runCommand,
48
47
  runToggle: () => runToggle,
@@ -3507,21 +3506,6 @@ function splitSidebarPlaces(places, chosen) {
3507
3506
  const aboveIds = new Set(above.map((p) => p.id));
3508
3507
  return { above, more: places.filter((p) => !aboveIds.has(p.id)) };
3509
3508
  }
3510
- function matchSidebarPlaces(pool, query) {
3511
- const q = query.trim().toLowerCase();
3512
- if (!q) return [];
3513
- const seen = /* @__PURE__ */ new Set();
3514
- const out = [];
3515
- const visit = (p) => {
3516
- if (!seen.has(p.id) && p.label.toLowerCase().includes(q)) {
3517
- seen.add(p.id);
3518
- out.push({ ...p, children: void 0 });
3519
- }
3520
- p.children?.forEach(visit);
3521
- };
3522
- pool.forEach(visit);
3523
- return out;
3524
- }
3525
3509
  function ProductSidebarTop({
3526
3510
  status,
3527
3511
  search,
@@ -3537,19 +3521,11 @@ function ProductSidebarTop({
3537
3521
  }) {
3538
3522
  const { above, more } = splitSidebarPlaces(places, chosen);
3539
3523
  const groups = (moreGroups ?? []).filter((g) => g.places.length > 0);
3540
- const searching = !!search?.pool && search.value.trim().length > 0;
3541
- const matches = searching ? matchSidebarPlaces([...places, ...groups.flatMap((g) => g.places), ...search?.pool ?? []], search.value) : [];
3542
3524
  const open = (place) => onOpenPlace?.(place);
3543
3525
  const onSearchKeyDown = (e) => {
3544
- if (!search) return;
3545
- if (e.key === "Escape" && search.value) {
3526
+ if (search && e.key === "Escape" && search.value) {
3546
3527
  e.preventDefault();
3547
3528
  search.onChange("");
3548
- } else if (e.key === "Enter" && searching && matches[0]) {
3549
- e.preventDefault();
3550
- const first = matches[0];
3551
- if (onOpenPlace) open(first);
3552
- else if (first.href && typeof window !== "undefined") window.location.assign(first.href);
3553
3529
  }
3554
3530
  };
3555
3531
  return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { "data-product-sidebar-top": "", className: cn("flex shrink-0 flex-col gap-1 px-2 pb-1 pt-2", className), children: [
@@ -3567,7 +3543,7 @@ function ProductSidebarTop({
3567
3543
  className: "h-8"
3568
3544
  }
3569
3545
  ) : null,
3570
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "flex flex-col pt-1", children: searching ? matches.length > 0 ? matches.map((p) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(PlaceRow, { place: p, onOpen: onOpenPlace ? open : void 0, sourceFeature }, p.id)) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "flex h-7 items-center px-2 type-secondary text-muted-foreground", "data-sidebar-places-empty": "", children: "No matches" }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
3546
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: cn("flex flex-col", search && "pt-1"), children: [
3571
3547
  newItem ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3572
3548
  ItemRow,
3573
3549
  {
@@ -3606,7 +3582,7 @@ function ProductSidebarTop({
3606
3582
  ] }) : null
3607
3583
  ] })
3608
3584
  ] }) : null
3609
- ] }) }),
3585
+ ] }),
3610
3586
  children
3611
3587
  ] });
3612
3588
  }