@northslopetech/altitude-ui 2.3.0 → 2.4.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
@@ -225,6 +225,112 @@ interface BadgeProps extends React$1.HTMLAttributes<HTMLSpanElement>, VariantPro
225
225
  */
226
226
  declare const Badge: React$1.ForwardRefExoticComponent<BadgeProps & React$1.RefAttributes<HTMLSpanElement>>;
227
227
 
228
+ /**
229
+ * @fileoverview Shared TypeScript types for PDF viewer components.
230
+ */
231
+ /**
232
+ * PDF file input type - can be a URL string or File object.
233
+ */
234
+ type PdfFile = string | File;
235
+ /**
236
+ * Props for PDF viewer components.
237
+ */
238
+ interface PdfViewerProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onError"> {
239
+ /**
240
+ * The PDF file to display. Can be a URL string or a File object.
241
+ */
242
+ file?: PdfFile;
243
+ /**
244
+ * Document title to display in the header.
245
+ */
246
+ title?: string;
247
+ /**
248
+ * Optional custom page width in pixels. If not provided, pages will auto-fit to container width.
249
+ */
250
+ pageWidth?: number;
251
+ /**
252
+ * Callback when download button is clicked.
253
+ */
254
+ onDownload?: () => void;
255
+ /**
256
+ * Callback when print button is clicked.
257
+ */
258
+ onPrint?: () => void;
259
+ /**
260
+ * Callback when the PDF document loads successfully.
261
+ */
262
+ onLoadSuccess?: (numPages: number) => void;
263
+ /**
264
+ * Callback when there's an error loading or rendering the PDF.
265
+ */
266
+ onError?: (error: Error) => void;
267
+ /**
268
+ * Enable text layer for text selection. Defaults to false for performance.
269
+ */
270
+ enableTextLayer?: boolean;
271
+ }
272
+
273
+ /**
274
+ * @fileoverview PDF.js worker configuration.
275
+ */
276
+ /**
277
+ * Initialize PDF.js worker with a custom URL.
278
+ *
279
+ * The worker file is bundled with @northslopetech/altitude-ui at:
280
+ * @northslopetech/altitude-ui/pdf.worker.min.mjs
281
+ *
282
+ * **IMPORTANT**: You must call this function once at application startup before
283
+ * using the PdfViewer component.
284
+ *
285
+ * @param workerUrl - The URL where the PDF.js worker can be accessed
286
+ *
287
+ * @example
288
+ * ```tsx
289
+ * // For Vite/Webpack - import directly from the package (recommended):
290
+ * import workerUrl from '@northslopetech/altitude-ui/pdf.worker.min.mjs?url';
291
+ * import { initializePdfWorker } from '@northslopetech/altitude-ui';
292
+ *
293
+ * // Call once at app startup (e.g., in main.tsx, _app.tsx, or layout.tsx)
294
+ * initializePdfWorker(workerUrl);
295
+ *
296
+ * // Or if you've copied the worker to your public folder:
297
+ * initializePdfWorker('/pdf.worker.min.mjs');
298
+ * ```
299
+ */
300
+ declare function initializePdfWorker(workerUrl: string): void;
301
+
302
+ /**
303
+ * @fileoverview PDF viewer component for Altitude UI.
304
+ */
305
+
306
+ /**
307
+ * PDF document viewer component with multi-page support.
308
+ *
309
+ * @example
310
+ * ```tsx
311
+ * // Simple usage
312
+ * <PdfViewer file="/document.pdf" />
313
+ *
314
+ * // With title and callbacks
315
+ * <PdfViewer
316
+ * file={pdfFile}
317
+ * title="Invoice_2024.pdf"
318
+ * onDownload={() => console.log('Download clicked')}
319
+ * onPrint={() => console.log('Print clicked')}
320
+ * onLoadSuccess={(pages) => console.log(`Loaded ${pages} pages`)}
321
+ * onError={(error) => console.error(error)}
322
+ * />
323
+ *
324
+ * // With custom width and text layer
325
+ * <PdfViewer
326
+ * file="/document.pdf"
327
+ * pageWidth={800}
328
+ * enableTextLayer
329
+ * />
330
+ * ```
331
+ */
332
+ declare const PdfViewer: React$1.ForwardRefExoticComponent<PdfViewerProps & React$1.RefAttributes<HTMLDivElement>>;
333
+
228
334
  /**
229
335
  * Tabs trigger variant styles.
230
336
  */
@@ -377,6 +483,14 @@ declare const UserMulti: React$1.FC<IconProps>;
377
483
  declare const Warning: React$1.FC<IconProps>;
378
484
  declare const Wrench: React$1.FC<IconProps>;
379
485
  declare const Logout: React$1.FC<IconProps>;
486
+ /**
487
+ * Print icon component.
488
+ */
489
+ declare const Print: React$1.FC<IconProps>;
490
+ /**
491
+ * Download icon component.
492
+ */
493
+ declare const Download: React$1.FC<IconProps>;
380
494
 
381
495
  /**
382
496
  * @fileoverview Chart utilities for Altitude UI chart components.
@@ -887,4 +1001,4 @@ interface TableProps<T> {
887
1001
  */
888
1002
  declare function Table<T>({ table, className, showPagination, paginationClassName, }: TableProps<T>): react_jsx_runtime.JSX.Element;
889
1003
 
890
- export { ArrowDown, ArrowLeft, ArrowRight, ArrowUp, Badge, type BadgeProps, BarChart, type BarChartData, type BarChartProps, Bell, Bookmark, Button, type ButtonProps, CHART_COLORS, CHART_CONSTANTS, COLOR_SCHEMES, Calendar, CaretDown, CaretLeft, CaretRight, CaretUp, type ChartColorScheme, ChartLegend, type ChartLegendProps, Chat, Check, CheckIcon, Checkbox, type CheckboxProps, CheckmarkCircle, CheckmarkSquare, ChevronDown, ChevronLeft, ChevronRight, ChevronUp, Close, CloseSmall, Cog, Credentials, DatePicker, type DatePickerProps, Doc, Dollar, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, type DropdownMenuTriggerProps, Edit, Envelope, Exclamation, EyeClosed, EyeOpen, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, Filter, FilterDescending, GenericTooltip, type GenericTooltipProps, GraphBar, GraphDonut, GraphLine, GraphPie, HamburgerMenu, Home, type IconProps, type IconVariant, Information, Input, type InputProps, Label, type LabelProps, type LegendItem, LineChart, type LineChartData, type LineChartProps, type LineSeries, Location, Lock, Logout, MagnifyingGlass, Minus, MoreMenu, Phone, PieChart, type PieChartData, type PieChartProps, type PieLabelProps, Plus, QuestionCircle, Select, SelectContent, type SelectContentProps, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, type SelectTriggerProps, SelectValue, Separator, Share, Star, Statement, Table, TableIcon, type TableProps, Tabs, TabsContent, type TabsContentProps, TabsList, type TabsListProps, type TabsProps, TabsTrigger, type TabsTriggerProps, Textarea, type TextareaProps, type TickProps, TooltipContainer, type TooltipContainerProps, TooltipItem, type TooltipItemProps, Trash, Typography, type TypographyProps, Upload, type UploadProps, User, UserMulti, Warning, Wrench, X, badgeVariants, buttonVariants, calculateYAxisWidth, checkboxVariants, createCustomXAxisLabel, createCustomYAxisLabel, createCustomYAxisRightLabel, createLegendItems, customXAxisTick, customXAxisTickRotated, customYAxisTick, formatLargeNumber, formatPercentage, getHeatmapColor, getPerformanceColor, getSeriesColor, selectTriggerVariants, tabsVariants, typographyVariants, uploadVariants };
1004
+ export { ArrowDown, ArrowLeft, ArrowRight, ArrowUp, Badge, type BadgeProps, BarChart, type BarChartData, type BarChartProps, Bell, Bookmark, Button, type ButtonProps, CHART_COLORS, CHART_CONSTANTS, COLOR_SCHEMES, Calendar, CaretDown, CaretLeft, CaretRight, CaretUp, type ChartColorScheme, ChartLegend, type ChartLegendProps, Chat, Check, CheckIcon, Checkbox, type CheckboxProps, CheckmarkCircle, CheckmarkSquare, ChevronDown, ChevronLeft, ChevronRight, ChevronUp, Close, CloseSmall, Cog, Credentials, DatePicker, type DatePickerProps, Doc, Dollar, Download, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, type DropdownMenuTriggerProps, Edit, Envelope, Exclamation, EyeClosed, EyeOpen, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, Filter, FilterDescending, GenericTooltip, type GenericTooltipProps, GraphBar, GraphDonut, GraphLine, GraphPie, HamburgerMenu, Home, type IconProps, type IconVariant, Information, Input, type InputProps, Label, type LabelProps, type LegendItem, LineChart, type LineChartData, type LineChartProps, type LineSeries, Location, Lock, Logout, MagnifyingGlass, Minus, MoreMenu, type PdfFile, PdfViewer, type PdfViewerProps, Phone, PieChart, type PieChartData, type PieChartProps, type PieLabelProps, Plus, Print, QuestionCircle, Select, SelectContent, type SelectContentProps, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, type SelectTriggerProps, SelectValue, Separator, Share, Star, Statement, Table, TableIcon, type TableProps, Tabs, TabsContent, type TabsContentProps, TabsList, type TabsListProps, type TabsProps, TabsTrigger, type TabsTriggerProps, Textarea, type TextareaProps, type TickProps, TooltipContainer, type TooltipContainerProps, TooltipItem, type TooltipItemProps, Trash, Typography, type TypographyProps, Upload, type UploadProps, User, UserMulti, Warning, Wrench, X, badgeVariants, buttonVariants, calculateYAxisWidth, checkboxVariants, createCustomXAxisLabel, createCustomYAxisLabel, createCustomYAxisRightLabel, createLegendItems, customXAxisTick, customXAxisTickRotated, customYAxisTick, formatLargeNumber, formatPercentage, getHeatmapColor, getPerformanceColor, getSeriesColor, initializePdfWorker, selectTriggerVariants, tabsVariants, typographyVariants, uploadVariants };
package/dist/index.d.ts CHANGED
@@ -225,6 +225,112 @@ interface BadgeProps extends React$1.HTMLAttributes<HTMLSpanElement>, VariantPro
225
225
  */
226
226
  declare const Badge: React$1.ForwardRefExoticComponent<BadgeProps & React$1.RefAttributes<HTMLSpanElement>>;
227
227
 
228
+ /**
229
+ * @fileoverview Shared TypeScript types for PDF viewer components.
230
+ */
231
+ /**
232
+ * PDF file input type - can be a URL string or File object.
233
+ */
234
+ type PdfFile = string | File;
235
+ /**
236
+ * Props for PDF viewer components.
237
+ */
238
+ interface PdfViewerProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onError"> {
239
+ /**
240
+ * The PDF file to display. Can be a URL string or a File object.
241
+ */
242
+ file?: PdfFile;
243
+ /**
244
+ * Document title to display in the header.
245
+ */
246
+ title?: string;
247
+ /**
248
+ * Optional custom page width in pixels. If not provided, pages will auto-fit to container width.
249
+ */
250
+ pageWidth?: number;
251
+ /**
252
+ * Callback when download button is clicked.
253
+ */
254
+ onDownload?: () => void;
255
+ /**
256
+ * Callback when print button is clicked.
257
+ */
258
+ onPrint?: () => void;
259
+ /**
260
+ * Callback when the PDF document loads successfully.
261
+ */
262
+ onLoadSuccess?: (numPages: number) => void;
263
+ /**
264
+ * Callback when there's an error loading or rendering the PDF.
265
+ */
266
+ onError?: (error: Error) => void;
267
+ /**
268
+ * Enable text layer for text selection. Defaults to false for performance.
269
+ */
270
+ enableTextLayer?: boolean;
271
+ }
272
+
273
+ /**
274
+ * @fileoverview PDF.js worker configuration.
275
+ */
276
+ /**
277
+ * Initialize PDF.js worker with a custom URL.
278
+ *
279
+ * The worker file is bundled with @northslopetech/altitude-ui at:
280
+ * @northslopetech/altitude-ui/pdf.worker.min.mjs
281
+ *
282
+ * **IMPORTANT**: You must call this function once at application startup before
283
+ * using the PdfViewer component.
284
+ *
285
+ * @param workerUrl - The URL where the PDF.js worker can be accessed
286
+ *
287
+ * @example
288
+ * ```tsx
289
+ * // For Vite/Webpack - import directly from the package (recommended):
290
+ * import workerUrl from '@northslopetech/altitude-ui/pdf.worker.min.mjs?url';
291
+ * import { initializePdfWorker } from '@northslopetech/altitude-ui';
292
+ *
293
+ * // Call once at app startup (e.g., in main.tsx, _app.tsx, or layout.tsx)
294
+ * initializePdfWorker(workerUrl);
295
+ *
296
+ * // Or if you've copied the worker to your public folder:
297
+ * initializePdfWorker('/pdf.worker.min.mjs');
298
+ * ```
299
+ */
300
+ declare function initializePdfWorker(workerUrl: string): void;
301
+
302
+ /**
303
+ * @fileoverview PDF viewer component for Altitude UI.
304
+ */
305
+
306
+ /**
307
+ * PDF document viewer component with multi-page support.
308
+ *
309
+ * @example
310
+ * ```tsx
311
+ * // Simple usage
312
+ * <PdfViewer file="/document.pdf" />
313
+ *
314
+ * // With title and callbacks
315
+ * <PdfViewer
316
+ * file={pdfFile}
317
+ * title="Invoice_2024.pdf"
318
+ * onDownload={() => console.log('Download clicked')}
319
+ * onPrint={() => console.log('Print clicked')}
320
+ * onLoadSuccess={(pages) => console.log(`Loaded ${pages} pages`)}
321
+ * onError={(error) => console.error(error)}
322
+ * />
323
+ *
324
+ * // With custom width and text layer
325
+ * <PdfViewer
326
+ * file="/document.pdf"
327
+ * pageWidth={800}
328
+ * enableTextLayer
329
+ * />
330
+ * ```
331
+ */
332
+ declare const PdfViewer: React$1.ForwardRefExoticComponent<PdfViewerProps & React$1.RefAttributes<HTMLDivElement>>;
333
+
228
334
  /**
229
335
  * Tabs trigger variant styles.
230
336
  */
@@ -377,6 +483,14 @@ declare const UserMulti: React$1.FC<IconProps>;
377
483
  declare const Warning: React$1.FC<IconProps>;
378
484
  declare const Wrench: React$1.FC<IconProps>;
379
485
  declare const Logout: React$1.FC<IconProps>;
486
+ /**
487
+ * Print icon component.
488
+ */
489
+ declare const Print: React$1.FC<IconProps>;
490
+ /**
491
+ * Download icon component.
492
+ */
493
+ declare const Download: React$1.FC<IconProps>;
380
494
 
381
495
  /**
382
496
  * @fileoverview Chart utilities for Altitude UI chart components.
@@ -887,4 +1001,4 @@ interface TableProps<T> {
887
1001
  */
888
1002
  declare function Table<T>({ table, className, showPagination, paginationClassName, }: TableProps<T>): react_jsx_runtime.JSX.Element;
889
1003
 
890
- export { ArrowDown, ArrowLeft, ArrowRight, ArrowUp, Badge, type BadgeProps, BarChart, type BarChartData, type BarChartProps, Bell, Bookmark, Button, type ButtonProps, CHART_COLORS, CHART_CONSTANTS, COLOR_SCHEMES, Calendar, CaretDown, CaretLeft, CaretRight, CaretUp, type ChartColorScheme, ChartLegend, type ChartLegendProps, Chat, Check, CheckIcon, Checkbox, type CheckboxProps, CheckmarkCircle, CheckmarkSquare, ChevronDown, ChevronLeft, ChevronRight, ChevronUp, Close, CloseSmall, Cog, Credentials, DatePicker, type DatePickerProps, Doc, Dollar, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, type DropdownMenuTriggerProps, Edit, Envelope, Exclamation, EyeClosed, EyeOpen, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, Filter, FilterDescending, GenericTooltip, type GenericTooltipProps, GraphBar, GraphDonut, GraphLine, GraphPie, HamburgerMenu, Home, type IconProps, type IconVariant, Information, Input, type InputProps, Label, type LabelProps, type LegendItem, LineChart, type LineChartData, type LineChartProps, type LineSeries, Location, Lock, Logout, MagnifyingGlass, Minus, MoreMenu, Phone, PieChart, type PieChartData, type PieChartProps, type PieLabelProps, Plus, QuestionCircle, Select, SelectContent, type SelectContentProps, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, type SelectTriggerProps, SelectValue, Separator, Share, Star, Statement, Table, TableIcon, type TableProps, Tabs, TabsContent, type TabsContentProps, TabsList, type TabsListProps, type TabsProps, TabsTrigger, type TabsTriggerProps, Textarea, type TextareaProps, type TickProps, TooltipContainer, type TooltipContainerProps, TooltipItem, type TooltipItemProps, Trash, Typography, type TypographyProps, Upload, type UploadProps, User, UserMulti, Warning, Wrench, X, badgeVariants, buttonVariants, calculateYAxisWidth, checkboxVariants, createCustomXAxisLabel, createCustomYAxisLabel, createCustomYAxisRightLabel, createLegendItems, customXAxisTick, customXAxisTickRotated, customYAxisTick, formatLargeNumber, formatPercentage, getHeatmapColor, getPerformanceColor, getSeriesColor, selectTriggerVariants, tabsVariants, typographyVariants, uploadVariants };
1004
+ export { ArrowDown, ArrowLeft, ArrowRight, ArrowUp, Badge, type BadgeProps, BarChart, type BarChartData, type BarChartProps, Bell, Bookmark, Button, type ButtonProps, CHART_COLORS, CHART_CONSTANTS, COLOR_SCHEMES, Calendar, CaretDown, CaretLeft, CaretRight, CaretUp, type ChartColorScheme, ChartLegend, type ChartLegendProps, Chat, Check, CheckIcon, Checkbox, type CheckboxProps, CheckmarkCircle, CheckmarkSquare, ChevronDown, ChevronLeft, ChevronRight, ChevronUp, Close, CloseSmall, Cog, Credentials, DatePicker, type DatePickerProps, Doc, Dollar, Download, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, type DropdownMenuTriggerProps, Edit, Envelope, Exclamation, EyeClosed, EyeOpen, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, Filter, FilterDescending, GenericTooltip, type GenericTooltipProps, GraphBar, GraphDonut, GraphLine, GraphPie, HamburgerMenu, Home, type IconProps, type IconVariant, Information, Input, type InputProps, Label, type LabelProps, type LegendItem, LineChart, type LineChartData, type LineChartProps, type LineSeries, Location, Lock, Logout, MagnifyingGlass, Minus, MoreMenu, type PdfFile, PdfViewer, type PdfViewerProps, Phone, PieChart, type PieChartData, type PieChartProps, type PieLabelProps, Plus, Print, QuestionCircle, Select, SelectContent, type SelectContentProps, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, type SelectTriggerProps, SelectValue, Separator, Share, Star, Statement, Table, TableIcon, type TableProps, Tabs, TabsContent, type TabsContentProps, TabsList, type TabsListProps, type TabsProps, TabsTrigger, type TabsTriggerProps, Textarea, type TextareaProps, type TickProps, TooltipContainer, type TooltipContainerProps, TooltipItem, type TooltipItemProps, Trash, Typography, type TypographyProps, Upload, type UploadProps, User, UserMulti, Warning, Wrench, X, badgeVariants, buttonVariants, calculateYAxisWidth, checkboxVariants, createCustomXAxisLabel, createCustomYAxisLabel, createCustomYAxisRightLabel, createLegendItems, customXAxisTick, customXAxisTickRotated, customYAxisTick, formatLargeNumber, formatPercentage, getHeatmapColor, getPerformanceColor, getSeriesColor, initializePdfWorker, selectTriggerVariants, tabsVariants, typographyVariants, uploadVariants };