@cere/cere-design-system 0.0.34 → 0.0.35

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/index.d.mts CHANGED
@@ -2449,7 +2449,11 @@ interface CodeEditorTab {
2449
2449
  label?: string;
2450
2450
  /** Whether the file has unsaved changes */
2451
2451
  isDirty?: boolean;
2452
+ /** Git sync status — distinct from isDirty (editor changes) */
2453
+ syncStatus?: 'new' | 'modified';
2452
2454
  }
2455
+ /** Git sync status for a file tree node. */
2456
+ type FileTreeNodeStatus = 'new' | 'modified' | 'deleted';
2453
2457
  /**
2454
2458
  * A node in the file tree.
2455
2459
  */
@@ -2464,6 +2468,8 @@ interface FileTreeNode {
2464
2468
  children?: FileTreeNode[];
2465
2469
  /** Optional custom icon */
2466
2470
  icon?: ReactNode;
2471
+ /** Git sync status indicator (new / modified / deleted) */
2472
+ status?: FileTreeNodeStatus;
2467
2473
  }
2468
2474
  /**
2469
2475
  * Git repository information passed into the workspace.
package/dist/index.d.ts CHANGED
@@ -2449,7 +2449,11 @@ interface CodeEditorTab {
2449
2449
  label?: string;
2450
2450
  /** Whether the file has unsaved changes */
2451
2451
  isDirty?: boolean;
2452
+ /** Git sync status — distinct from isDirty (editor changes) */
2453
+ syncStatus?: 'new' | 'modified';
2452
2454
  }
2455
+ /** Git sync status for a file tree node. */
2456
+ type FileTreeNodeStatus = 'new' | 'modified' | 'deleted';
2453
2457
  /**
2454
2458
  * A node in the file tree.
2455
2459
  */
@@ -2464,6 +2468,8 @@ interface FileTreeNode {
2464
2468
  children?: FileTreeNode[];
2465
2469
  /** Optional custom icon */
2466
2470
  icon?: ReactNode;
2471
+ /** Git sync status indicator (new / modified / deleted) */
2472
+ status?: FileTreeNodeStatus;
2467
2473
  }
2468
2474
  /**
2469
2475
  * Git repository information passed into the workspace.
package/dist/index.js CHANGED
@@ -9491,6 +9491,20 @@ var CodeEditorTabs = ({
9491
9491
  }
9492
9492
  }
9493
9493
  ),
9494
+ tab.syncStatus && /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
9495
+ import_material74.Box,
9496
+ {
9497
+ component: "span",
9498
+ sx: {
9499
+ fontSize: "0.6rem",
9500
+ fontWeight: 700,
9501
+ lineHeight: 1,
9502
+ color: tab.syncStatus === "new" ? "success.main" : "warning.main",
9503
+ flexShrink: 0
9504
+ },
9505
+ children: tab.syncStatus === "new" ? "N" : "M"
9506
+ }
9507
+ ),
9494
9508
  /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(import_material74.Tooltip, { title: tab.path, enterDelay: 600, children: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
9495
9509
  import_material74.Typography,
9496
9510
  {
@@ -9542,6 +9556,20 @@ var import_InsertDriveFileOutlined = __toESM(require("@mui/icons-material/Insert
9542
9556
  var import_ExpandMore4 = __toESM(require("@mui/icons-material/ExpandMore"));
9543
9557
  var import_ChevronRight4 = __toESM(require("@mui/icons-material/ChevronRight"));
9544
9558
  var import_jsx_runtime99 = require("react/jsx-runtime");
9559
+ var STATUS_CONFIG = {
9560
+ new: { label: "N", color: "success.main" },
9561
+ modified: { label: "M", color: "warning.main" },
9562
+ deleted: { label: "D", color: "error.main" }
9563
+ };
9564
+ function computeFolderStatus(node) {
9565
+ if (node.status) return node.status;
9566
+ if (node.type !== "folder" || !node.children) return void 0;
9567
+ const childStatuses = node.children.map((c) => c.type === "folder" ? computeFolderStatus(c) : c.status).filter((s) => !!s);
9568
+ if (childStatuses.length === 0) return void 0;
9569
+ if (childStatuses.includes("new")) return "new";
9570
+ if (childStatuses.includes("modified")) return "modified";
9571
+ return "deleted";
9572
+ }
9545
9573
  var CodeEditorFileTree = ({
9546
9574
  tree,
9547
9575
  selectedPath,
@@ -9634,7 +9662,28 @@ var CodeEditorFileTree = ({
9634
9662
  }
9635
9663
  }
9636
9664
  }
9637
- )
9665
+ ),
9666
+ (() => {
9667
+ const effectiveStatus = isFolder ? computeFolderStatus(node) : node.status;
9668
+ if (!effectiveStatus) return null;
9669
+ const cfg = STATUS_CONFIG[effectiveStatus];
9670
+ return /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(
9671
+ import_material75.Box,
9672
+ {
9673
+ component: "span",
9674
+ sx: {
9675
+ ml: "auto",
9676
+ pl: 0.5,
9677
+ fontSize: "0.65rem",
9678
+ fontWeight: 700,
9679
+ lineHeight: 1,
9680
+ color: cfg.color,
9681
+ flexShrink: 0
9682
+ },
9683
+ children: cfg.label
9684
+ }
9685
+ );
9686
+ })()
9638
9687
  ]
9639
9688
  }
9640
9689
  ),