@cere/cere-design-system 0.0.31 → 0.0.33

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.
@@ -513,6 +513,44 @@ const items: BreadcrumbItem[] = [
513
513
 
514
514
  ## LAYOUT
515
515
 
516
+ ### EntityHeader
517
+ Composite header for entities (workspaces, accounts, etc.) with title, metadata, and action slots.
518
+
519
+ ```typescript
520
+ import { EntityHeader } from '@cere/cere-design-system';
521
+ import type { EntityHeaderProps, PrimaryAction } from '@cere/cere-design-system';
522
+
523
+ <EntityHeader
524
+ title="Game Co. WF 1769936170928"
525
+ subtitle="Gaming Demo Account"
526
+ role="Manager"
527
+ id="W1234567890"
528
+ startActions={<Button variant="secondary">Export</Button>}
529
+ primaryAction={{
530
+ label: 'Members',
531
+ count: 5,
532
+ icon: <AddCircleIcon />,
533
+ onClick: () => console.log('Open members')
534
+ }}
535
+ endActions={<Button variant="tertiary">Settings</Button>}
536
+ onCopyId={() => console.log('ID copied')}
537
+ onMoreOptions={(e) => setAnchorEl(e.currentTarget)}
538
+ />
539
+ ```
540
+
541
+ **Props:**
542
+ - `title: string` - Primary title text (required)
543
+ - `subtitle?: string` - Secondary descriptive text
544
+ - `role?: string` - Role/status label displayed as RoleBadge pill
545
+ - `id?: string` - Entity identifier displayed as IDBlock with copy action
546
+ - `primaryAction?: PrimaryAction` - Main action button config (`{ label, count?, icon?, onClick? }`)
547
+ - `startActions?: ReactNode` - Custom content rendered before the primary action button
548
+ - `endActions?: ReactNode` - Custom content rendered after the primary action button (before more-options)
549
+ - `onCopyId?: () => void` - Callback when ID is copied
550
+ - `onMoreOptions?: (event) => void` - Callback when more options button clicked
551
+ - `headingLevel?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'` - HTML heading level (default: 'h2')
552
+ - `divider?: boolean` - Show bottom divider line (default: true)
553
+
516
554
  ### Card
517
555
  Container card with header, content, and actions.
518
556
 
package/dist/index.d.mts CHANGED
@@ -1230,6 +1230,17 @@ interface EntityHeaderProps {
1230
1230
  * Main action button configuration
1231
1231
  */
1232
1232
  primaryAction?: PrimaryAction;
1233
+ /**
1234
+ * Additional content rendered before the primary action button.
1235
+ * Accepts any ReactNode (buttons, dropdowns, etc.).
1236
+ */
1237
+ startActions?: React__default.ReactNode;
1238
+ /**
1239
+ * Additional content rendered after the primary action button
1240
+ * but before the more-options icon button.
1241
+ * Accepts any ReactNode (buttons, dropdowns, etc.).
1242
+ */
1243
+ endActions?: React__default.ReactNode;
1233
1244
  /**
1234
1245
  * Callback when ID is copied (internal copy + this callback)
1235
1246
  */
@@ -2688,6 +2699,8 @@ interface CodeEditorStatusBarProps {
2688
2699
  * When provided, default rendering is skipped entirely.
2689
2700
  */
2690
2701
  renderStatusBar?: (props: CodeEditorStatusBarRenderProps) => React__default.ReactNode;
2702
+ /** Called when the user clicks the branch name in the status bar */
2703
+ onBranchClick?: () => void;
2691
2704
  /** Props for the outer container */
2692
2705
  containerProps?: BoxProps;
2693
2706
  }
@@ -2749,6 +2762,8 @@ interface CodeEditorWorkspaceProps extends Pick<UseCodeEditorWorkspaceOptions, '
2749
2762
  onWorkspaceReady?: (workspace: UseCodeEditorWorkspaceReturn) => void;
2750
2763
  /** Called when the user presses Ctrl+S / Cmd+S. Receives all dirty files. */
2751
2764
  onSave?: (dirtyFiles: CodeEditorFile[]) => void;
2765
+ /** Called when the user clicks the branch name in the status bar */
2766
+ onBranchClick?: () => void;
2752
2767
  }
2753
2768
  /**
2754
2769
  * Convenience composed workspace that combines `CodeEditorFileTree`,
package/dist/index.d.ts CHANGED
@@ -1230,6 +1230,17 @@ interface EntityHeaderProps {
1230
1230
  * Main action button configuration
1231
1231
  */
1232
1232
  primaryAction?: PrimaryAction;
1233
+ /**
1234
+ * Additional content rendered before the primary action button.
1235
+ * Accepts any ReactNode (buttons, dropdowns, etc.).
1236
+ */
1237
+ startActions?: React__default.ReactNode;
1238
+ /**
1239
+ * Additional content rendered after the primary action button
1240
+ * but before the more-options icon button.
1241
+ * Accepts any ReactNode (buttons, dropdowns, etc.).
1242
+ */
1243
+ endActions?: React__default.ReactNode;
1233
1244
  /**
1234
1245
  * Callback when ID is copied (internal copy + this callback)
1235
1246
  */
@@ -2688,6 +2699,8 @@ interface CodeEditorStatusBarProps {
2688
2699
  * When provided, default rendering is skipped entirely.
2689
2700
  */
2690
2701
  renderStatusBar?: (props: CodeEditorStatusBarRenderProps) => React__default.ReactNode;
2702
+ /** Called when the user clicks the branch name in the status bar */
2703
+ onBranchClick?: () => void;
2691
2704
  /** Props for the outer container */
2692
2705
  containerProps?: BoxProps;
2693
2706
  }
@@ -2749,6 +2762,8 @@ interface CodeEditorWorkspaceProps extends Pick<UseCodeEditorWorkspaceOptions, '
2749
2762
  onWorkspaceReady?: (workspace: UseCodeEditorWorkspaceReturn) => void;
2750
2763
  /** Called when the user presses Ctrl+S / Cmd+S. Receives all dirty files. */
2751
2764
  onSave?: (dirtyFiles: CodeEditorFile[]) => void;
2765
+ /** Called when the user clicks the branch name in the status bar */
2766
+ onBranchClick?: () => void;
2752
2767
  }
2753
2768
  /**
2754
2769
  * Convenience composed workspace that combines `CodeEditorFileTree`,
package/dist/index.js CHANGED
@@ -4991,6 +4991,8 @@ var EntityHeader = ({
4991
4991
  role,
4992
4992
  id,
4993
4993
  primaryAction,
4994
+ startActions,
4995
+ endActions,
4994
4996
  onCopyId,
4995
4997
  onMoreOptions,
4996
4998
  headingLevel = "h2",
@@ -5079,6 +5081,7 @@ var EntityHeader = ({
5079
5081
  flexShrink: 0
5080
5082
  },
5081
5083
  children: [
5084
+ startActions,
5082
5085
  primaryAction && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
5083
5086
  Button,
5084
5087
  {
@@ -5091,6 +5094,7 @@ var EntityHeader = ({
5091
5094
  children: getPrimaryActionLabel()
5092
5095
  }
5093
5096
  ),
5097
+ endActions,
5094
5098
  onMoreOptions && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
5095
5099
  import_IconButton4.default,
5096
5100
  {
@@ -8707,14 +8711,18 @@ var configureTypeScript = (monaco) => {
8707
8711
  target: monaco.languages.typescript.ScriptTarget.ES2020,
8708
8712
  allowNonTsExtensions: true,
8709
8713
  moduleResolution: monaco.languages.typescript.ModuleResolutionKind.NodeJs,
8710
- module: monaco.languages.typescript.ModuleKind.CommonJS,
8714
+ module: monaco.languages.typescript.ModuleKind.ESNext,
8711
8715
  noEmit: false,
8712
8716
  lib: ["es2020", "dom"],
8713
8717
  noUnusedLocals: false,
8714
8718
  noUnusedParameters: false,
8715
8719
  noImplicitAny: false,
8716
8720
  noImplicitReturns: false,
8717
- noFallthroughCasesInSwitch: false
8721
+ noFallthroughCasesInSwitch: false,
8722
+ // Treat every file as a module so top-level declarations don't clash
8723
+ // across files in the workspace (prevents false "Cannot redeclare" errors).
8724
+ moduleDetection: 3
8725
+ // ts.ModuleDetectionKind.Force
8718
8726
  });
8719
8727
  monaco.languages.typescript.typescriptDefaults.setDiagnosticsOptions({
8720
8728
  noSemanticValidation: false,
@@ -9672,6 +9680,7 @@ var CodeEditorStatusBar = ({
9672
9680
  cursorPosition,
9673
9681
  items,
9674
9682
  renderStatusBar,
9683
+ onBranchClick,
9675
9684
  containerProps
9676
9685
  }) => {
9677
9686
  if (renderStatusBar) {
@@ -9714,12 +9723,14 @@ var CodeEditorStatusBar = ({
9714
9723
  children: /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(
9715
9724
  import_material76.Box,
9716
9725
  {
9726
+ onClick: onBranchClick,
9717
9727
  sx: {
9718
9728
  display: "flex",
9719
9729
  alignItems: "center",
9720
9730
  gap: 0.5,
9721
- cursor: "default",
9722
- overflow: "hidden"
9731
+ cursor: onBranchClick ? "pointer" : "default",
9732
+ overflow: "hidden",
9733
+ "&:hover": onBranchClick ? { opacity: 0.8 } : void 0
9723
9734
  },
9724
9735
  children: [
9725
9736
  /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
@@ -9866,7 +9877,8 @@ var CodeEditorWorkspace = ({
9866
9877
  showStatusBar = true,
9867
9878
  statusBarItems,
9868
9879
  onWorkspaceReady,
9869
- onSave
9880
+ onSave,
9881
+ onBranchClick
9870
9882
  }) => {
9871
9883
  const workspace = useCodeEditorWorkspace({
9872
9884
  files,
@@ -9918,7 +9930,8 @@ var CodeEditorWorkspace = ({
9918
9930
  gitInfo,
9919
9931
  language: workspace.activeFile?.language,
9920
9932
  cursorPosition: workspace.cursorPosition ?? void 0,
9921
- items: statusBarItems
9933
+ items: statusBarItems,
9934
+ onBranchClick
9922
9935
  };
9923
9936
  const statusBarElement = showStatusBar ? renderStatusBar ? renderStatusBar({ ...statusBarProps, workspace }) : /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(CodeEditorStatusBar, { ...statusBarProps }) : null;
9924
9937
  const editorElement = renderEditor ? renderEditor(workspace) : workspace.activeFile ? /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(