@northslopetech/altitude-ui 2.6.3 → 2.7.0

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
@@ -346,6 +346,18 @@ declare const Badge: React$1.ForwardRefExoticComponent<BadgeProps & React$1.RefA
346
346
  * PDF file input type - can be a URL string or File object.
347
347
  */
348
348
  type PdfFile = string | File;
349
+ /**
350
+ * Scroll behavior when navigating to a page.
351
+ * - 'smooth': Animate scrolling to the target page
352
+ * - 'instant': Jump immediately to the target page
353
+ */
354
+ type ScrollBehavior = "smooth" | "instant";
355
+ /**
356
+ * View mode for PDF display.
357
+ * - 'continuous': All pages rendered in a scrollable container with virtualization
358
+ * - 'single': One page at a time with navigation controls
359
+ */
360
+ type PdfViewMode = "continuous" | "single";
349
361
  /**
350
362
  * Props for PDF viewer components.
351
363
  */
@@ -382,6 +394,35 @@ interface PdfViewerProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onE
382
394
  * Enable text layer for text selection. Defaults to false for performance.
383
395
  */
384
396
  enableTextLayer?: boolean;
397
+ /**
398
+ * Whether to show the built-in controls bar (navigation buttons, page indicator).
399
+ */
400
+ showControls?: boolean;
401
+ /**
402
+ * Number of pages to render above and below the viewport for virtualization.
403
+ * Higher values reduce blank pages during fast scrolling but use more memory.
404
+ */
405
+ viewportBuffer?: number;
406
+ /**
407
+ * Current page number (1-indexed). Use for controlled mode.
408
+ * When set, the component expects the parent to manage page state via onPageChange.
409
+ */
410
+ page?: number;
411
+ /**
412
+ * Callback fired when the current page changes.
413
+ * Fires when a new page scrolls into the primary viewport or on navigation.
414
+ */
415
+ onPageChange?: (page: number) => void;
416
+ /**
417
+ * Scroll behavior when navigating to a page via controls or programmatic navigation.
418
+ */
419
+ scrollBehavior?: ScrollBehavior;
420
+ /**
421
+ * View mode for displaying the PDF.
422
+ * - 'continuous': Scrollable view with all pages (virtualized)
423
+ * - 'single': One page at a time with navigation
424
+ */
425
+ viewMode?: PdfViewMode;
385
426
  }
386
427
 
387
428
  /**
@@ -415,16 +456,29 @@ declare function initializePdfWorker(workerUrl: string): void;
415
456
 
416
457
  /**
417
458
  * @fileoverview PDF viewer component for Altitude UI.
459
+ * Uses virtualization for efficient rendering of large PDFs.
418
460
  */
419
461
 
420
462
  /**
421
463
  * PDF document viewer component with multi-page support.
422
464
  *
465
+ * Supports both controlled and uncontrolled modes for page state:
466
+ * - Uncontrolled (default): Component manages page state internally
467
+ * - Controlled: Parent manages page state via `page` and `onPageChange` props
468
+ *
423
469
  * @example
424
470
  * ```tsx
425
- * // Simple usage
471
+ * // Simple usage (uncontrolled)
426
472
  * <PdfViewer file="/document.pdf" />
427
473
  *
474
+ * // Controlled mode
475
+ * const [page, setPage] = useState(1);
476
+ * <PdfViewer
477
+ * file="/document.pdf"
478
+ * page={page}
479
+ * onPageChange={setPage}
480
+ * />
481
+ *
428
482
  * // With title and callbacks
429
483
  * <PdfViewer
430
484
  * file={pdfFile}
package/dist/index.d.ts CHANGED
@@ -346,6 +346,18 @@ declare const Badge: React$1.ForwardRefExoticComponent<BadgeProps & React$1.RefA
346
346
  * PDF file input type - can be a URL string or File object.
347
347
  */
348
348
  type PdfFile = string | File;
349
+ /**
350
+ * Scroll behavior when navigating to a page.
351
+ * - 'smooth': Animate scrolling to the target page
352
+ * - 'instant': Jump immediately to the target page
353
+ */
354
+ type ScrollBehavior = "smooth" | "instant";
355
+ /**
356
+ * View mode for PDF display.
357
+ * - 'continuous': All pages rendered in a scrollable container with virtualization
358
+ * - 'single': One page at a time with navigation controls
359
+ */
360
+ type PdfViewMode = "continuous" | "single";
349
361
  /**
350
362
  * Props for PDF viewer components.
351
363
  */
@@ -382,6 +394,35 @@ interface PdfViewerProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onE
382
394
  * Enable text layer for text selection. Defaults to false for performance.
383
395
  */
384
396
  enableTextLayer?: boolean;
397
+ /**
398
+ * Whether to show the built-in controls bar (navigation buttons, page indicator).
399
+ */
400
+ showControls?: boolean;
401
+ /**
402
+ * Number of pages to render above and below the viewport for virtualization.
403
+ * Higher values reduce blank pages during fast scrolling but use more memory.
404
+ */
405
+ viewportBuffer?: number;
406
+ /**
407
+ * Current page number (1-indexed). Use for controlled mode.
408
+ * When set, the component expects the parent to manage page state via onPageChange.
409
+ */
410
+ page?: number;
411
+ /**
412
+ * Callback fired when the current page changes.
413
+ * Fires when a new page scrolls into the primary viewport or on navigation.
414
+ */
415
+ onPageChange?: (page: number) => void;
416
+ /**
417
+ * Scroll behavior when navigating to a page via controls or programmatic navigation.
418
+ */
419
+ scrollBehavior?: ScrollBehavior;
420
+ /**
421
+ * View mode for displaying the PDF.
422
+ * - 'continuous': Scrollable view with all pages (virtualized)
423
+ * - 'single': One page at a time with navigation
424
+ */
425
+ viewMode?: PdfViewMode;
385
426
  }
386
427
 
387
428
  /**
@@ -415,16 +456,29 @@ declare function initializePdfWorker(workerUrl: string): void;
415
456
 
416
457
  /**
417
458
  * @fileoverview PDF viewer component for Altitude UI.
459
+ * Uses virtualization for efficient rendering of large PDFs.
418
460
  */
419
461
 
420
462
  /**
421
463
  * PDF document viewer component with multi-page support.
422
464
  *
465
+ * Supports both controlled and uncontrolled modes for page state:
466
+ * - Uncontrolled (default): Component manages page state internally
467
+ * - Controlled: Parent manages page state via `page` and `onPageChange` props
468
+ *
423
469
  * @example
424
470
  * ```tsx
425
- * // Simple usage
471
+ * // Simple usage (uncontrolled)
426
472
  * <PdfViewer file="/document.pdf" />
427
473
  *
474
+ * // Controlled mode
475
+ * const [page, setPage] = useState(1);
476
+ * <PdfViewer
477
+ * file="/document.pdf"
478
+ * page={page}
479
+ * onPageChange={setPage}
480
+ * />
481
+ *
428
482
  * // With title and callbacks
429
483
  * <PdfViewer
430
484
  * file={pdfFile}