@northslopetech/altitude-ui 2.6.4 → 2.8.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 +171 -87
- package/dist/index.d.ts +171 -87
- package/dist/index.js +1473 -572
- package/dist/index.mjs +1404 -497
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
2
2
|
import * as React$1 from 'react';
|
|
3
3
|
import { ReactNode } from 'react';
|
|
4
|
+
import { Button as Button$1 } from '@base-ui/react/button';
|
|
4
5
|
import { VariantProps } from 'class-variance-authority';
|
|
5
6
|
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
6
7
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
@@ -11,27 +12,22 @@ import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
|
11
12
|
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
12
13
|
import { Table as Table$1 } from '@tanstack/react-table';
|
|
13
14
|
|
|
14
|
-
/**
|
|
15
|
-
* Button variant styles.
|
|
16
|
-
*/
|
|
17
15
|
declare const buttonVariants: (props?: ({
|
|
18
16
|
variant?: "default" | "outline" | "destructive" | "destructive-subtle" | "ghost" | "link" | null | undefined;
|
|
19
17
|
size?: "default" | "sm" | "lg" | "icon" | null | undefined;
|
|
20
18
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
21
|
-
interface ButtonProps extends
|
|
22
|
-
asChild?: boolean;
|
|
19
|
+
interface ButtonProps extends Button$1.Props, VariantProps<typeof buttonVariants> {
|
|
23
20
|
icon?: React$1.ReactNode;
|
|
24
21
|
iconPosition?: "left" | "right";
|
|
25
22
|
}
|
|
26
23
|
/**
|
|
27
24
|
* Button component with multiple variants and sizes.
|
|
28
|
-
* @param {boolean} [props.asChild] - Render as child element (using Radix Slot)
|
|
29
25
|
* @param {React.ReactNode} [props.icon] - Icon element to display
|
|
30
26
|
* @param {"left" | "right"} [props.iconPosition] - Position of icon relative to text
|
|
31
27
|
* @param {string} [props.variant] - Visual style variant
|
|
32
28
|
* @param {string} [props.size] - Button size
|
|
33
29
|
*/
|
|
34
|
-
declare const Button: React$1.ForwardRefExoticComponent<ButtonProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
30
|
+
declare const Button: React$1.ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
|
|
35
31
|
|
|
36
32
|
/**
|
|
37
33
|
* Typography variant styles using design system tokens.
|
|
@@ -346,10 +342,38 @@ declare const Badge: React$1.ForwardRefExoticComponent<BadgeProps & React$1.RefA
|
|
|
346
342
|
* PDF file input type - can be a URL string or File object.
|
|
347
343
|
*/
|
|
348
344
|
type PdfFile = string | File;
|
|
345
|
+
/**
|
|
346
|
+
* Dimensions of a single PDF page at scale 1.0.
|
|
347
|
+
*/
|
|
348
|
+
type PdfPageDimensions = {
|
|
349
|
+
/** Page number (1-indexed) */
|
|
350
|
+
pageNumber: number;
|
|
351
|
+
/** Width in PDF units at scale 1.0 */
|
|
352
|
+
width: number;
|
|
353
|
+
/** Height in PDF units at scale 1.0 */
|
|
354
|
+
height: number;
|
|
355
|
+
};
|
|
356
|
+
/**
|
|
357
|
+
* Map of page numbers to their dimensions.
|
|
358
|
+
* Key is 1-indexed page number.
|
|
359
|
+
*/
|
|
360
|
+
type PdfPageDimensionsMap = Map<number, PdfPageDimensions>;
|
|
361
|
+
/**
|
|
362
|
+
* Scroll behavior when navigating to a page.
|
|
363
|
+
* - 'smooth': Animate scrolling to the target page
|
|
364
|
+
* - 'instant': Jump immediately to the target page
|
|
365
|
+
*/
|
|
366
|
+
type ScrollBehavior = "smooth" | "instant";
|
|
367
|
+
/**
|
|
368
|
+
* View mode for PDF display.
|
|
369
|
+
* - 'continuous': All pages rendered in a scrollable container with virtualization
|
|
370
|
+
* - 'single': One page at a time with navigation controls
|
|
371
|
+
*/
|
|
372
|
+
type PdfViewMode = "continuous" | "single";
|
|
349
373
|
/**
|
|
350
374
|
* Props for PDF viewer components.
|
|
351
375
|
*/
|
|
352
|
-
|
|
376
|
+
type PdfViewerProps = Omit<React.HTMLAttributes<HTMLDivElement>, "onError"> & {
|
|
353
377
|
/**
|
|
354
378
|
* The PDF file to display. Can be a URL string or a File object.
|
|
355
379
|
*/
|
|
@@ -382,7 +406,52 @@ interface PdfViewerProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onE
|
|
|
382
406
|
* Enable text layer for text selection. Defaults to false for performance.
|
|
383
407
|
*/
|
|
384
408
|
enableTextLayer?: boolean;
|
|
385
|
-
|
|
409
|
+
/**
|
|
410
|
+
* Whether to show the built-in controls bar (navigation buttons, page indicator).
|
|
411
|
+
*/
|
|
412
|
+
showControls?: boolean;
|
|
413
|
+
/**
|
|
414
|
+
* Number of pages to render above and below the viewport for virtualization.
|
|
415
|
+
* Higher values reduce blank pages during fast scrolling but use more memory.
|
|
416
|
+
*/
|
|
417
|
+
viewportBuffer?: number;
|
|
418
|
+
/**
|
|
419
|
+
* Current page number (1-indexed). Use for controlled mode.
|
|
420
|
+
* When set, the component expects the parent to manage page state via onPageChange.
|
|
421
|
+
*/
|
|
422
|
+
page?: number;
|
|
423
|
+
/**
|
|
424
|
+
* Callback fired when the current page changes.
|
|
425
|
+
* Fires when a new page scrolls into the primary viewport or on navigation.
|
|
426
|
+
*/
|
|
427
|
+
onPageChange?: (page: number) => void;
|
|
428
|
+
/**
|
|
429
|
+
* Scroll behavior when navigating to a page via controls or programmatic navigation.
|
|
430
|
+
*/
|
|
431
|
+
scrollBehavior?: ScrollBehavior;
|
|
432
|
+
/**
|
|
433
|
+
* View mode for displaying the PDF.
|
|
434
|
+
* - 'continuous': Scrollable view with all pages (virtualized)
|
|
435
|
+
* - 'single': One page at a time with navigation
|
|
436
|
+
*/
|
|
437
|
+
viewMode?: PdfViewMode;
|
|
438
|
+
/**
|
|
439
|
+
* Callback fired when page dimensions have been fetched.
|
|
440
|
+
* Useful for bounding box implementations that need accurate page coordinates.
|
|
441
|
+
*
|
|
442
|
+
* @example
|
|
443
|
+
* ```tsx
|
|
444
|
+
* <PdfViewer
|
|
445
|
+
* file={pdfFile}
|
|
446
|
+
* onDimensionsReady={(dimensions) => {
|
|
447
|
+
* const page1 = dimensions.get(1);
|
|
448
|
+
* console.log(`Page 1: ${page1.width}x${page1.height}`);
|
|
449
|
+
* }}
|
|
450
|
+
* />
|
|
451
|
+
* ```
|
|
452
|
+
*/
|
|
453
|
+
onDimensionsReady?: (dimensions: PdfPageDimensionsMap) => void;
|
|
454
|
+
};
|
|
386
455
|
|
|
387
456
|
/**
|
|
388
457
|
* @fileoverview PDF.js worker configuration.
|
|
@@ -413,18 +482,26 @@ interface PdfViewerProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onE
|
|
|
413
482
|
*/
|
|
414
483
|
declare function initializePdfWorker(workerUrl: string): void;
|
|
415
484
|
|
|
416
|
-
/**
|
|
417
|
-
* @fileoverview PDF viewer component for Altitude UI.
|
|
418
|
-
*/
|
|
419
|
-
|
|
420
485
|
/**
|
|
421
486
|
* PDF document viewer component with multi-page support.
|
|
422
487
|
*
|
|
488
|
+
* Supports both controlled and uncontrolled modes for page state:
|
|
489
|
+
* - Uncontrolled (default): Component manages page state internally
|
|
490
|
+
* - Controlled: Parent manages page state via `page` and `onPageChange` props
|
|
491
|
+
*
|
|
423
492
|
* @example
|
|
424
493
|
* ```tsx
|
|
425
|
-
* // Simple usage
|
|
494
|
+
* // Simple usage (uncontrolled)
|
|
426
495
|
* <PdfViewer file="/document.pdf" />
|
|
427
496
|
*
|
|
497
|
+
* // Controlled mode
|
|
498
|
+
* const [page, setPage] = useState(1);
|
|
499
|
+
* <PdfViewer
|
|
500
|
+
* file="/document.pdf"
|
|
501
|
+
* page={page}
|
|
502
|
+
* onPageChange={setPage}
|
|
503
|
+
* />
|
|
504
|
+
*
|
|
428
505
|
* // With title and callbacks
|
|
429
506
|
* <PdfViewer
|
|
430
507
|
* file={pdfFile}
|
|
@@ -443,7 +520,23 @@ declare function initializePdfWorker(workerUrl: string): void;
|
|
|
443
520
|
* />
|
|
444
521
|
* ```
|
|
445
522
|
*/
|
|
446
|
-
declare const PdfViewer: React$1.ForwardRefExoticComponent<
|
|
523
|
+
declare const PdfViewer: React$1.ForwardRefExoticComponent<Omit<React$1.HTMLAttributes<HTMLDivElement>, "onError"> & {
|
|
524
|
+
file?: PdfFile;
|
|
525
|
+
title?: string;
|
|
526
|
+
pageWidth?: number;
|
|
527
|
+
onDownload?: () => void;
|
|
528
|
+
onPrint?: () => void;
|
|
529
|
+
onLoadSuccess?: (numPages: number) => void;
|
|
530
|
+
onError?: (error: Error) => void;
|
|
531
|
+
enableTextLayer?: boolean;
|
|
532
|
+
showControls?: boolean;
|
|
533
|
+
viewportBuffer?: number;
|
|
534
|
+
page?: number;
|
|
535
|
+
onPageChange?: (page: number) => void;
|
|
536
|
+
scrollBehavior?: ScrollBehavior;
|
|
537
|
+
viewMode?: PdfViewMode;
|
|
538
|
+
onDimensionsReady?: (dimensions: PdfPageDimensionsMap) => void;
|
|
539
|
+
} & React$1.RefAttributes<HTMLDivElement>>;
|
|
447
540
|
|
|
448
541
|
/**
|
|
449
542
|
* Tabs trigger variant styles.
|
|
@@ -524,91 +617,82 @@ interface IconProps extends React$1.SVGProps<SVGSVGElement> {
|
|
|
524
617
|
variant?: IconVariant;
|
|
525
618
|
}
|
|
526
619
|
/**
|
|
527
|
-
*
|
|
528
|
-
*/
|
|
529
|
-
declare const X: React$1.FC<IconProps>;
|
|
530
|
-
/**
|
|
531
|
-
* Lock icon component.
|
|
532
|
-
*/
|
|
533
|
-
declare const Lock: React$1.FC<IconProps>;
|
|
534
|
-
/**
|
|
535
|
-
* Check icon component (circle with checkmark).
|
|
536
|
-
*/
|
|
537
|
-
declare const Check: React$1.FC<IconProps>;
|
|
538
|
-
/**
|
|
539
|
-
* ChevronDown icon component (downward pointing chevron).
|
|
620
|
+
* LockIcon component.
|
|
540
621
|
*/
|
|
541
|
-
declare const
|
|
622
|
+
declare const LockIcon: React$1.FC<IconProps>;
|
|
542
623
|
/**
|
|
543
|
-
*
|
|
624
|
+
* CheckIcon component (circle with checkmark).
|
|
544
625
|
*/
|
|
545
|
-
declare const ChevronUp: React$1.FC<IconProps>;
|
|
546
|
-
declare const Calendar: React$1.FC<IconProps>;
|
|
547
|
-
declare const ChevronLeft: React$1.FC<IconProps>;
|
|
548
|
-
declare const ChevronRight: React$1.FC<IconProps>;
|
|
549
626
|
declare const CheckIcon: React$1.FC<IconProps>;
|
|
550
|
-
declare const
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
declare const
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
declare const
|
|
559
|
-
declare const
|
|
560
|
-
declare const
|
|
561
|
-
declare const
|
|
562
|
-
declare const
|
|
563
|
-
declare const
|
|
564
|
-
declare const
|
|
565
|
-
declare const
|
|
566
|
-
declare const
|
|
567
|
-
declare const
|
|
568
|
-
declare const
|
|
569
|
-
declare const
|
|
570
|
-
declare const
|
|
571
|
-
declare const
|
|
572
|
-
declare const
|
|
573
|
-
declare const
|
|
574
|
-
declare const
|
|
575
|
-
declare const
|
|
576
|
-
declare const
|
|
577
|
-
declare const
|
|
578
|
-
declare const
|
|
579
|
-
declare const
|
|
580
|
-
declare const
|
|
581
|
-
declare const
|
|
582
|
-
declare const
|
|
583
|
-
declare const
|
|
584
|
-
declare const
|
|
585
|
-
declare const
|
|
586
|
-
declare const
|
|
587
|
-
declare const
|
|
588
|
-
declare const
|
|
589
|
-
declare const
|
|
590
|
-
declare const
|
|
591
|
-
declare const
|
|
592
|
-
declare const
|
|
627
|
+
declare const CalendarIcon: React$1.FC<IconProps>;
|
|
628
|
+
/**
|
|
629
|
+
* CheckmarkIcon (just the checkmark) component.
|
|
630
|
+
*/
|
|
631
|
+
declare const CheckmarkIcon: React$1.FC<IconProps>;
|
|
632
|
+
/**
|
|
633
|
+
* ArrowDownIcon component.
|
|
634
|
+
*/
|
|
635
|
+
declare const ArrowDownIcon: React$1.FC<IconProps>;
|
|
636
|
+
declare const ArrowUpIcon: React$1.FC<IconProps>;
|
|
637
|
+
declare const ArrowLeftIcon: React$1.FC<IconProps>;
|
|
638
|
+
declare const ArrowRightIcon: React$1.FC<IconProps>;
|
|
639
|
+
declare const BellIcon: React$1.FC<IconProps>;
|
|
640
|
+
declare const BookmarkIcon: React$1.FC<IconProps>;
|
|
641
|
+
declare const CaretDownIcon: React$1.FC<IconProps>;
|
|
642
|
+
declare const CaretLeftIcon: React$1.FC<IconProps>;
|
|
643
|
+
declare const CaretRightIcon: React$1.FC<IconProps>;
|
|
644
|
+
declare const CaretUpIcon: React$1.FC<IconProps>;
|
|
645
|
+
declare const ChatIcon: React$1.FC<IconProps>;
|
|
646
|
+
declare const CheckmarkSquareIcon: React$1.FC<IconProps>;
|
|
647
|
+
declare const CloseIcon: React$1.FC<IconProps>;
|
|
648
|
+
declare const CloseSmallIcon: React$1.FC<IconProps>;
|
|
649
|
+
declare const CogIcon: React$1.FC<IconProps>;
|
|
650
|
+
declare const CredentialsIcon: React$1.FC<IconProps>;
|
|
651
|
+
declare const DocumentIcon: React$1.FC<IconProps>;
|
|
652
|
+
declare const DollarIcon: React$1.FC<IconProps>;
|
|
653
|
+
declare const EditIcon: React$1.FC<IconProps>;
|
|
654
|
+
declare const EnvelopeIcon: React$1.FC<IconProps>;
|
|
655
|
+
declare const ExclamationIcon: React$1.FC<IconProps>;
|
|
656
|
+
declare const EyeClosedIcon: React$1.FC<IconProps>;
|
|
657
|
+
declare const EyeOpenIcon: React$1.FC<IconProps>;
|
|
658
|
+
declare const FilterIcon: React$1.FC<IconProps>;
|
|
659
|
+
declare const FilterDescendingIcon: React$1.FC<IconProps>;
|
|
660
|
+
declare const GraphBarIcon: React$1.FC<IconProps>;
|
|
661
|
+
declare const GraphDonutIcon: React$1.FC<IconProps>;
|
|
662
|
+
declare const GraphLineIcon: React$1.FC<IconProps>;
|
|
663
|
+
declare const GraphPieIcon: React$1.FC<IconProps>;
|
|
664
|
+
declare const HamburgerMenuIcon: React$1.FC<IconProps>;
|
|
665
|
+
declare const HomeIcon: React$1.FC<IconProps>;
|
|
666
|
+
declare const InformationIcon: React$1.FC<IconProps>;
|
|
667
|
+
declare const LocationIcon: React$1.FC<IconProps>;
|
|
668
|
+
declare const MagnifyingGlassIcon: React$1.FC<IconProps>;
|
|
669
|
+
declare const MinusIcon: React$1.FC<IconProps>;
|
|
670
|
+
declare const PlusIcon: React$1.FC<IconProps>;
|
|
671
|
+
declare const MoreMenuIcon: React$1.FC<IconProps>;
|
|
672
|
+
declare const PhoneIcon: React$1.FC<IconProps>;
|
|
673
|
+
declare const QuestionCircleIcon: React$1.FC<IconProps>;
|
|
674
|
+
declare const ShareIcon: React$1.FC<IconProps>;
|
|
675
|
+
declare const StarIcon: React$1.FC<IconProps>;
|
|
676
|
+
declare const StatementIcon: React$1.FC<IconProps>;
|
|
593
677
|
declare const TableIcon: React$1.FC<IconProps>;
|
|
594
|
-
declare const
|
|
595
|
-
declare const
|
|
596
|
-
declare const
|
|
597
|
-
declare const
|
|
598
|
-
declare const
|
|
599
|
-
declare const
|
|
678
|
+
declare const TrashIcon: React$1.FC<IconProps>;
|
|
679
|
+
declare const UserIcon: React$1.FC<IconProps>;
|
|
680
|
+
declare const UserMultiIcon: React$1.FC<IconProps>;
|
|
681
|
+
declare const WarningIcon: React$1.FC<IconProps>;
|
|
682
|
+
declare const WrenchIcon: React$1.FC<IconProps>;
|
|
683
|
+
declare const LogoutIcon: React$1.FC<IconProps>;
|
|
600
684
|
/**
|
|
601
685
|
* Print icon component.
|
|
602
686
|
*/
|
|
603
|
-
declare const
|
|
687
|
+
declare const PrintIcon: React$1.FC<IconProps>;
|
|
604
688
|
/**
|
|
605
689
|
* Download icon component.
|
|
606
690
|
*/
|
|
607
|
-
declare const
|
|
691
|
+
declare const DownloadIcon: React$1.FC<IconProps>;
|
|
608
692
|
/**
|
|
609
693
|
* Panel icon component.
|
|
610
694
|
*/
|
|
611
|
-
declare const
|
|
695
|
+
declare const PanelIcon: React$1.FC<IconProps>;
|
|
612
696
|
|
|
613
697
|
/**
|
|
614
698
|
* @fileoverview Chart utilities for Altitude UI chart components.
|
|
@@ -1119,4 +1203,4 @@ interface TableProps<T> {
|
|
|
1119
1203
|
*/
|
|
1120
1204
|
declare function Table<T>({ table, className, showPagination, paginationClassName, }: TableProps<T>): react_jsx_runtime.JSX.Element;
|
|
1121
1205
|
|
|
1122
|
-
export {
|
|
1206
|
+
export { ArrowDownIcon, ArrowLeftIcon, ArrowRightIcon, ArrowUpIcon, Badge, type BadgeProps, BarChart, type BarChartData, type BarChartProps, BellIcon, BookmarkIcon, Button, type ButtonProps, CHART_COLORS, CHART_CONSTANTS, COLOR_SCHEMES, CalendarIcon, CaretDownIcon, CaretLeftIcon, CaretRightIcon, CaretUpIcon, type ChartColorScheme, ChartLegend, type ChartLegendProps, ChatIcon, CheckIcon, Checkbox, type CheckboxProps, CheckmarkIcon, CheckmarkSquareIcon, CloseIcon, CloseSmallIcon, CogIcon, CredentialsIcon, DatePicker, type DatePickerProps, DocumentIcon, DollarIcon, DownloadIcon, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, type DropdownMenuTriggerProps, EditIcon, EnvelopeIcon, ExclamationIcon, EyeClosedIcon, EyeOpenIcon, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, FilterDescendingIcon, FilterIcon, GenericTooltip, type GenericTooltipProps, GraphBarIcon, GraphDonutIcon, GraphLineIcon, GraphPieIcon, HamburgerMenuIcon, HomeIcon, type IconProps, type IconVariant, InformationIcon, Input, type InputProps, Label, type LabelProps, type LegendItem, LineChart, type LineChartData, type LineChartProps, type LineSeries, LocationIcon, LockIcon, LogoutIcon, MagnifyingGlassIcon, MinusIcon, MoreMenuIcon, PanelIcon, type PdfFile, PdfViewer, type PdfViewerProps, PhoneIcon, PieChart, type PieChartData, type PieChartProps, type PieLabelProps, PlusIcon, PrintIcon, QuestionCircleIcon, Select, SelectContent, type SelectContentProps, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, type SelectTriggerProps, SelectValue, Separator, ShareIcon, Sidebar, SidebarContent, type SidebarContentProps, SidebarFooter, type SidebarFooterProps, SidebarGroup, SidebarGroupContent, type SidebarGroupContentProps, type SidebarGroupProps, SidebarHeader, type SidebarHeaderProps, SidebarInset, type SidebarInsetProps, SidebarMenu, SidebarMenuButton, type SidebarMenuButtonProps, SidebarMenuItem, type SidebarMenuItemProps, type SidebarMenuProps, type SidebarProps, SidebarProvider, type SidebarProviderProps, StarIcon, StatementIcon, Table, TableIcon, type TableProps, Tabs, TabsContent, type TabsContentProps, TabsList, type TabsListProps, type TabsProps, TabsTrigger, type TabsTriggerProps, Textarea, type TextareaProps, type TickProps, Tooltip, TooltipContainer, type TooltipContainerProps, TooltipContent, type TooltipContentProps, TooltipItem, type TooltipItemProps, type TooltipProps, TooltipProvider, type TooltipProviderProps, TooltipTrigger, type TooltipTriggerProps, TrashIcon, Typography, type TypographyProps, Upload, type UploadProps, UserIcon, UserMultiIcon, WarningIcon, WrenchIcon, badgeVariants, buttonVariants, calculateYAxisWidth, checkboxVariants, createCustomXAxisLabel, createCustomYAxisLabel, createCustomYAxisRightLabel, createLegendItems, customXAxisTick, customXAxisTickRotated, customYAxisTick, formatLargeNumber, formatPercentage, getHeatmapColor, getPerformanceColor, getSeriesColor, initializePdfWorker, selectTriggerVariants, tabsVariants, typographyVariants, uploadVariants, useSidebar };
|