{"$schema":"https:\/\/ui.particle.academy\/schema\/registry-item.json","name":"sheet-workbook","type":"registry:ui","title":"SheetWorkbook","description":"Root workbook component.","package":"fancy-sheets","dependencies":[],"registryDependencies":["spreadsheet","types","toolbar"],"files":[{"path":"components\/fancy\/sheet-workbook\/SheetWorkbook.tsx","content":"import type { ReactNode } from \"react\";\r\nimport { Spreadsheet } from \"..\/Spreadsheet\/Spreadsheet\";\r\nimport type { WorkbookData } from \"..\/..\/types\/sheet\";\r\nimport type { CellData, CellHighlightMap } from \"..\/..\/types\/cell\";\r\nimport type { SpreadsheetContextMenuItem } from \"..\/Spreadsheet\/Spreadsheet.types\";\r\nimport type { ToolbarButton } from \"..\/Toolbar\/SpreadsheetToolbar\";\r\n\r\nexport interface SheetWorkbookProps {\r\n  \/** Controlled workbook data *\/\r\n  data?: WorkbookData;\r\n  \/** Default data (uncontrolled) *\/\r\n  defaultData?: WorkbookData;\r\n  \/** Called on any data change *\/\r\n  onChange?: (data: WorkbookData) => void;\r\n  className?: string;\r\n  \/** Number of columns (default: 26) *\/\r\n  columnCount?: number;\r\n  \/** Number of rows (default: 100) *\/\r\n  rowCount?: number;\r\n  \/** Default column width in px (default: 100) *\/\r\n  defaultColumnWidth?: number;\r\n  \/** Row height in px (default: 28) *\/\r\n  rowHeight?: number;\r\n  \/** Read-only mode *\/\r\n  readOnly?: boolean;\r\n  \/** Hide the toolbar (default: false) *\/\r\n  hideToolbar?: boolean;\r\n  \/** Hide the sheet tabs (default: false) *\/\r\n  hideTabs?: boolean;\r\n  \/** Extra content appended to the default toolbar *\/\r\n  toolbarExtra?: ReactNode;\r\n  \/** Which built-in toolbar buttons to show (default: all). Pass [] for only custom extra. *\/\r\n  toolbarButtons?: ToolbarButton[];\r\n  \/** Custom context menu items *\/\r\n  contextMenuItems?: SpreadsheetContextMenuItem[] | ((address: string) => SpreadsheetContextMenuItem[]);\r\n  \/** Consumer-driven cell highlights *\/\r\n  highlights?: CellHighlightMap;\r\n  \/** Fires when the active cell changes *\/\r\n  onActiveCellChange?: (address: string, cell: CellData | undefined) => void;\r\n}\r\n\r\nexport function SheetWorkbook({\r\n  hideToolbar = false,\r\n  hideTabs = false,\r\n  toolbarExtra,\r\n  toolbarButtons,\r\n  contextMenuItems,\r\n  highlights,\r\n  onActiveCellChange,\r\n  ...props\r\n}: SheetWorkbookProps) {\r\n  return (\r\n    <Spreadsheet {...props} contextMenuItems={contextMenuItems} highlights={highlights} onActiveCellChange={onActiveCellChange}>\r\n      {!hideToolbar && <Spreadsheet.Toolbar extra={toolbarExtra} buttons={toolbarButtons} \/>}\r\n      <Spreadsheet.Grid \/>\r\n      {!hideTabs && <Spreadsheet.SheetTabs \/>}\r\n    <\/Spreadsheet>\r\n  );\r\n}\r\n\r\nSheetWorkbook.displayName = \"SheetWorkbook\";\r\n","type":"registry:ui","target":"components\/fancy\/sheet-workbook\/SheetWorkbook.tsx"}]}