@geomak/ui 7.16.0 → 7.17.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.cts CHANGED
@@ -5307,6 +5307,19 @@ interface JwtResult<T> {
5307
5307
  */
5308
5308
  declare function useJwt<T = Record<string, unknown>>(token: string | null | undefined): JwtResult<T>;
5309
5309
 
5310
+ interface UseDownloadReturn {
5311
+ /** Trigger a browser download of a Blob. */
5312
+ saveBlob: (blob: Blob, fileName: string) => void;
5313
+ /**
5314
+ * Decode a base64 string and download it as a file.
5315
+ * Accepts a raw base64 payload OR a full `data:<mime>;base64,<payload>` URI.
5316
+ * @param mimeType MIME for the Blob. Inferred from a data-URI prefix when
5317
+ * present, else 'application/octet-stream'.
5318
+ */
5319
+ saveFromBase64: (base64: string, fileName: string, mimeType?: string) => void;
5320
+ }
5321
+ declare function useDownload(): UseDownloadReturn;
5322
+
5310
5323
  interface ExportSaveOptions {
5311
5324
  /** File name WITHOUT extension. Default: 'export' (Excel) / 'report' (PDF). */
5312
5325
  fileName?: string;
@@ -5794,4 +5807,4 @@ declare function expiryError(value: string, now?: Date): string | undefined;
5794
5807
  /** Validate the CVV against the detected brand's expected length. */
5795
5808
  declare function cvvError(value: string, cardNumber: string): string | undefined;
5796
5809
 
5797
- export { Accordion, type AccordionItemProps, type AccordionProps, AppShell, type AppShellProps, AutoComplete, type AutoCompleteProps, Avatar, type AvatarProps, type AvatarShape, type AvatarSize, type AvatarStatus, Badge, type BadgeProps, type BadgeSize, type BadgeTone, type BadgeVariant, Banner, type BannerProps, type BannerTone, Blog, type BlogPost, type BlogProps, Box, type BoxBackground, type BoxBorder, type BoxProps, type BoxRadius, type BoxShadow, type BreadcrumbItem, Breadcrumbs, type BreadcrumbsProps, type Breakpoint, type BreakpointState, Button, type ButtonProps, CARD_BRANDS, Card, type CardBodyProps, type CardBrand, CardCarousel, type CardCarouselProps, type CardFooterProps, type CardHeaderProps, type CardMediaProps, type CardProps, Cart, CartButton, type CartButtonProps, type CartContextValue, type CartItemInput, type CartLineItem, type CartProps, CartProvider, type CartProviderProps, type CartSummaryRow, Catalog, CatalogCarousel, type CatalogCarouselProps, CatalogGrid, type CatalogGridProps, type CatalogProps, type Cell, type CellEditInfo, type CellValue, Chat, type ChatMessage, type ChatProps, Checkbox, type CheckboxProps, Checkout, type CheckoutProps, type ClassValue, ColorPicker, type ColorPickerProps, type ConsentChoice, ContextMenu, type ContextMenuActionItem, type ContextMenuPosition, type ContextMenuProps, CookieConsent, type CookieConsentProps, CreditCardForm, type CreditCardFormProps, type CreditCardValue, DataGrid, type DataGridProps, type DatePickerProps, type DateRange, DateRangePicker, type DateRangePickerProps, type DateRangePreset, type DeltaDirection, Drawer, type DrawerProps, type DrawerSize, Dropdown, type DropdownItem, type DropdownProps, type EditorArgs, EmptyCart, type EmptyCartProps, type ErrorMap, type ExcelSheetInput, type ExpandRowOptions, type ExportSaveOptions, FAB, type FABAction, type FABPosition, type FABProps, type FABSize, type FABTone, FadingBase, type FadingBaseProps, type Feature, FeatureGrid, type FeatureGridProps, Field, type FieldArrayItem, type FieldBindings, FieldHelpIcon, type FieldKind, FieldLabel, type FieldLabelProps, type FieldProps, type FieldRule, type FieldRules, type FieldShellOptions, type FieldSize, type FieldSnapshot, FileInput, type FileInputProps, type FileSource, Flex, type FlexAlign, type FlexDirection, type FlexJustify, type FlexProps, type FlexWrap, Form, FormContext, FormField, type FormFieldProps, type FormProps, FormStore, type FormStoreOptions, type FormValues, Grid, GridCard, type GridCardItem, type GridCardProps, type GridColumn, type GridProps, type GridSortDirection, type GridSortState, type GridSource, IconButton, type IconButtonProps, Jumbotron, type JumbotronBackground, type JumbotronLayout, type JumbotronProps, type JwtResult, Kbd, type KbdProps, type KbdSize, LeadCapture, type LeadCaptureProps, List, type ListItem, type ListProps, LoadingSpinner, type LoadingSpinnerProps, LogoutTimer, type LogoutTimerProps, MegaMenu, type MegaMenuFeaturedProps, type MegaMenuItemProps, type MegaMenuLinkProps, type MegaMenuPanelProps, type MegaMenuProps, type MegaMenuSectionProps, MenuButton, type MenuButtonItem, type MenuButtonProps, Modal, type ModalProps, type ModalSize, type NotificationPayload, NotificationProvider, NumberInput, type NumberInputProps, OpaqueGridCard, type OpaqueGridCardProps, OtpInput, type OtpInputProps, type PaginationOptions, Parallax, type ParallaxProps, type ParsedSheet, Password, type PasswordProps, type PasswordRule, type PasswordScore, PasswordStrength, type PasswordStrengthProps, type PasswordStrengthResult, type PdfExportOptions, type PdfPage, PdfViewer, type PdfViewerProps, PopConfirm, type PopConfirmProps, type PopConfirmTone, Portal, type PortalProps, type PricingPlan, PricingPlans, type PricingPlansProps, RadioGroup, type RadioGroupProps, type RadioOption, RadioTile, type RadioTileOption, type RadioTileProps, Rating, type RatingProps, type RemoteSourceOptions, type RulesMap, ScalableContainer, type ScalableContainerProps, Scheduler, type SchedulerEvent, type SchedulerProps, type SchedulerRange, type SchedulerView, SearchInput, type SearchInputProps, type SearchOptions, SecureLayout, type SecureLayoutProps, SegmentedControl, type SegmentedControlProps, type SegmentedOption, type SheetData, Sidebar, type SidebarItem, type SidebarProps, type SidebarSection, SkeletonBox, type SkeletonBoxProps, SkeletonCard, type SkeletonCardProps, SkeletonCircle, type SkeletonCircleProps, SkeletonText, type SkeletonTextProps, type Slide, SlideShow, type SlideShowProps, Slider, type SliderMark, type SliderProps, type SliderValue, type SocialLink, type SocialPlatform, Socials, type SocialsProps, type SortDirection, type SortState, type Spacing, Spreadsheet, type SpreadsheetProps, Statistic, type StatisticDelta, type StatisticProps, type StatisticSize, Stepper, type StepperActiveStatus, type StepperProps, type StepperStep, Switch, type SwitchInputProps, Table, type TableColumn, type TableProps, Tabs, type TabsAddProps, type TabsListProps, type TabsOrientation, type TabsPanelProps, type TabsProps, type TabsSize, type TabsTriggerProps, type TabsVariant, TagsInput, type TagsInputProps, DatePicker as Temporal, type TemporalPickerProps, type Testimonial, Testimonials, type TestimonialsProps, TextArea, type TextAreaProps, TextInput, type TextInputProps, type ThemeColors, type ThemeConfig, type ThemeDensity, type ThemeMotion, ThemeProvider, type ThemeProviderProps, type ThemeRadius, type ThemeShadows, ThemeSwitch, type ThemeSwitchProps, type ThemeTypography, TimePicker, type TimePickerProps, Timeline, type TimelineEvent, type TimelineProps, type TimelineStatus, Tooltip, type TooltipProps, TooltipProvider, TopBar, type TopBarProps, Tree, type TreeItemClickPayload, type TreeNode, type TreeProps, TreeSelect, type TreeSelectProps, Typography, type TypographyAlign, type TypographyColor, type TypographyProps, type TypographyVariant, type TypographyWeight, type UseExcelReturn, type UseFieldArrayReturn, type UseFormFieldOptions, type UseFormReturn, type UsePdfReturn, type ValidateTrigger, Video, type VideoProps, VirtualList, type VirtualListProps, Wizard, type WizardProps, type WizardStep, cardNumberError, cvvError, cx, defaultPasswordRules, detectBrand, expiryError, fieldShell, formatCardNumber, formatExpiry, isRequired, luhnValid, onlyDigits, patterns, runFieldRules, scorePassword, useBreakpoint, useCart, useExcel, useFieldArray, useForm, useFormField, useFormStore, useJwt, useLocalStorage, useMediaQuery, useNotification, usePdf };
5810
+ export { Accordion, type AccordionItemProps, type AccordionProps, AppShell, type AppShellProps, AutoComplete, type AutoCompleteProps, Avatar, type AvatarProps, type AvatarShape, type AvatarSize, type AvatarStatus, Badge, type BadgeProps, type BadgeSize, type BadgeTone, type BadgeVariant, Banner, type BannerProps, type BannerTone, Blog, type BlogPost, type BlogProps, Box, type BoxBackground, type BoxBorder, type BoxProps, type BoxRadius, type BoxShadow, type BreadcrumbItem, Breadcrumbs, type BreadcrumbsProps, type Breakpoint, type BreakpointState, Button, type ButtonProps, CARD_BRANDS, Card, type CardBodyProps, type CardBrand, CardCarousel, type CardCarouselProps, type CardFooterProps, type CardHeaderProps, type CardMediaProps, type CardProps, Cart, CartButton, type CartButtonProps, type CartContextValue, type CartItemInput, type CartLineItem, type CartProps, CartProvider, type CartProviderProps, type CartSummaryRow, Catalog, CatalogCarousel, type CatalogCarouselProps, CatalogGrid, type CatalogGridProps, type CatalogProps, type Cell, type CellEditInfo, type CellValue, Chat, type ChatMessage, type ChatProps, Checkbox, type CheckboxProps, Checkout, type CheckoutProps, type ClassValue, ColorPicker, type ColorPickerProps, type ConsentChoice, ContextMenu, type ContextMenuActionItem, type ContextMenuPosition, type ContextMenuProps, CookieConsent, type CookieConsentProps, CreditCardForm, type CreditCardFormProps, type CreditCardValue, DataGrid, type DataGridProps, type DatePickerProps, type DateRange, DateRangePicker, type DateRangePickerProps, type DateRangePreset, type DeltaDirection, Drawer, type DrawerProps, type DrawerSize, Dropdown, type DropdownItem, type DropdownProps, type EditorArgs, EmptyCart, type EmptyCartProps, type ErrorMap, type ExcelSheetInput, type ExpandRowOptions, type ExportSaveOptions, FAB, type FABAction, type FABPosition, type FABProps, type FABSize, type FABTone, FadingBase, type FadingBaseProps, type Feature, FeatureGrid, type FeatureGridProps, Field, type FieldArrayItem, type FieldBindings, FieldHelpIcon, type FieldKind, FieldLabel, type FieldLabelProps, type FieldProps, type FieldRule, type FieldRules, type FieldShellOptions, type FieldSize, type FieldSnapshot, FileInput, type FileInputProps, type FileSource, Flex, type FlexAlign, type FlexDirection, type FlexJustify, type FlexProps, type FlexWrap, Form, FormContext, FormField, type FormFieldProps, type FormProps, FormStore, type FormStoreOptions, type FormValues, Grid, GridCard, type GridCardItem, type GridCardProps, type GridColumn, type GridProps, type GridSortDirection, type GridSortState, type GridSource, IconButton, type IconButtonProps, Jumbotron, type JumbotronBackground, type JumbotronLayout, type JumbotronProps, type JwtResult, Kbd, type KbdProps, type KbdSize, LeadCapture, type LeadCaptureProps, List, type ListItem, type ListProps, LoadingSpinner, type LoadingSpinnerProps, LogoutTimer, type LogoutTimerProps, MegaMenu, type MegaMenuFeaturedProps, type MegaMenuItemProps, type MegaMenuLinkProps, type MegaMenuPanelProps, type MegaMenuProps, type MegaMenuSectionProps, MenuButton, type MenuButtonItem, type MenuButtonProps, Modal, type ModalProps, type ModalSize, type NotificationPayload, NotificationProvider, NumberInput, type NumberInputProps, OpaqueGridCard, type OpaqueGridCardProps, OtpInput, type OtpInputProps, type PaginationOptions, Parallax, type ParallaxProps, type ParsedSheet, Password, type PasswordProps, type PasswordRule, type PasswordScore, PasswordStrength, type PasswordStrengthProps, type PasswordStrengthResult, type PdfExportOptions, type PdfPage, PdfViewer, type PdfViewerProps, PopConfirm, type PopConfirmProps, type PopConfirmTone, Portal, type PortalProps, type PricingPlan, PricingPlans, type PricingPlansProps, RadioGroup, type RadioGroupProps, type RadioOption, RadioTile, type RadioTileOption, type RadioTileProps, Rating, type RatingProps, type RemoteSourceOptions, type RulesMap, ScalableContainer, type ScalableContainerProps, Scheduler, type SchedulerEvent, type SchedulerProps, type SchedulerRange, type SchedulerView, SearchInput, type SearchInputProps, type SearchOptions, SecureLayout, type SecureLayoutProps, SegmentedControl, type SegmentedControlProps, type SegmentedOption, type SheetData, Sidebar, type SidebarItem, type SidebarProps, type SidebarSection, SkeletonBox, type SkeletonBoxProps, SkeletonCard, type SkeletonCardProps, SkeletonCircle, type SkeletonCircleProps, SkeletonText, type SkeletonTextProps, type Slide, SlideShow, type SlideShowProps, Slider, type SliderMark, type SliderProps, type SliderValue, type SocialLink, type SocialPlatform, Socials, type SocialsProps, type SortDirection, type SortState, type Spacing, Spreadsheet, type SpreadsheetProps, Statistic, type StatisticDelta, type StatisticProps, type StatisticSize, Stepper, type StepperActiveStatus, type StepperProps, type StepperStep, Switch, type SwitchInputProps, Table, type TableColumn, type TableProps, Tabs, type TabsAddProps, type TabsListProps, type TabsOrientation, type TabsPanelProps, type TabsProps, type TabsSize, type TabsTriggerProps, type TabsVariant, TagsInput, type TagsInputProps, DatePicker as Temporal, type TemporalPickerProps, type Testimonial, Testimonials, type TestimonialsProps, TextArea, type TextAreaProps, TextInput, type TextInputProps, type ThemeColors, type ThemeConfig, type ThemeDensity, type ThemeMotion, ThemeProvider, type ThemeProviderProps, type ThemeRadius, type ThemeShadows, ThemeSwitch, type ThemeSwitchProps, type ThemeTypography, TimePicker, type TimePickerProps, Timeline, type TimelineEvent, type TimelineProps, type TimelineStatus, Tooltip, type TooltipProps, TooltipProvider, TopBar, type TopBarProps, Tree, type TreeItemClickPayload, type TreeNode, type TreeProps, TreeSelect, type TreeSelectProps, Typography, type TypographyAlign, type TypographyColor, type TypographyProps, type TypographyVariant, type TypographyWeight, type UseDownloadReturn, type UseExcelReturn, type UseFieldArrayReturn, type UseFormFieldOptions, type UseFormReturn, type UsePdfReturn, type ValidateTrigger, Video, type VideoProps, VirtualList, type VirtualListProps, Wizard, type WizardProps, type WizardStep, cardNumberError, cvvError, cx, defaultPasswordRules, detectBrand, expiryError, fieldShell, formatCardNumber, formatExpiry, isRequired, luhnValid, onlyDigits, patterns, runFieldRules, scorePassword, useBreakpoint, useCart, useDownload, useExcel, useFieldArray, useForm, useFormField, useFormStore, useJwt, useLocalStorage, useMediaQuery, useNotification, usePdf };
package/dist/index.d.ts CHANGED
@@ -5307,6 +5307,19 @@ interface JwtResult<T> {
5307
5307
  */
5308
5308
  declare function useJwt<T = Record<string, unknown>>(token: string | null | undefined): JwtResult<T>;
5309
5309
 
5310
+ interface UseDownloadReturn {
5311
+ /** Trigger a browser download of a Blob. */
5312
+ saveBlob: (blob: Blob, fileName: string) => void;
5313
+ /**
5314
+ * Decode a base64 string and download it as a file.
5315
+ * Accepts a raw base64 payload OR a full `data:<mime>;base64,<payload>` URI.
5316
+ * @param mimeType MIME for the Blob. Inferred from a data-URI prefix when
5317
+ * present, else 'application/octet-stream'.
5318
+ */
5319
+ saveFromBase64: (base64: string, fileName: string, mimeType?: string) => void;
5320
+ }
5321
+ declare function useDownload(): UseDownloadReturn;
5322
+
5310
5323
  interface ExportSaveOptions {
5311
5324
  /** File name WITHOUT extension. Default: 'export' (Excel) / 'report' (PDF). */
5312
5325
  fileName?: string;
@@ -5794,4 +5807,4 @@ declare function expiryError(value: string, now?: Date): string | undefined;
5794
5807
  /** Validate the CVV against the detected brand's expected length. */
5795
5808
  declare function cvvError(value: string, cardNumber: string): string | undefined;
5796
5809
 
5797
- export { Accordion, type AccordionItemProps, type AccordionProps, AppShell, type AppShellProps, AutoComplete, type AutoCompleteProps, Avatar, type AvatarProps, type AvatarShape, type AvatarSize, type AvatarStatus, Badge, type BadgeProps, type BadgeSize, type BadgeTone, type BadgeVariant, Banner, type BannerProps, type BannerTone, Blog, type BlogPost, type BlogProps, Box, type BoxBackground, type BoxBorder, type BoxProps, type BoxRadius, type BoxShadow, type BreadcrumbItem, Breadcrumbs, type BreadcrumbsProps, type Breakpoint, type BreakpointState, Button, type ButtonProps, CARD_BRANDS, Card, type CardBodyProps, type CardBrand, CardCarousel, type CardCarouselProps, type CardFooterProps, type CardHeaderProps, type CardMediaProps, type CardProps, Cart, CartButton, type CartButtonProps, type CartContextValue, type CartItemInput, type CartLineItem, type CartProps, CartProvider, type CartProviderProps, type CartSummaryRow, Catalog, CatalogCarousel, type CatalogCarouselProps, CatalogGrid, type CatalogGridProps, type CatalogProps, type Cell, type CellEditInfo, type CellValue, Chat, type ChatMessage, type ChatProps, Checkbox, type CheckboxProps, Checkout, type CheckoutProps, type ClassValue, ColorPicker, type ColorPickerProps, type ConsentChoice, ContextMenu, type ContextMenuActionItem, type ContextMenuPosition, type ContextMenuProps, CookieConsent, type CookieConsentProps, CreditCardForm, type CreditCardFormProps, type CreditCardValue, DataGrid, type DataGridProps, type DatePickerProps, type DateRange, DateRangePicker, type DateRangePickerProps, type DateRangePreset, type DeltaDirection, Drawer, type DrawerProps, type DrawerSize, Dropdown, type DropdownItem, type DropdownProps, type EditorArgs, EmptyCart, type EmptyCartProps, type ErrorMap, type ExcelSheetInput, type ExpandRowOptions, type ExportSaveOptions, FAB, type FABAction, type FABPosition, type FABProps, type FABSize, type FABTone, FadingBase, type FadingBaseProps, type Feature, FeatureGrid, type FeatureGridProps, Field, type FieldArrayItem, type FieldBindings, FieldHelpIcon, type FieldKind, FieldLabel, type FieldLabelProps, type FieldProps, type FieldRule, type FieldRules, type FieldShellOptions, type FieldSize, type FieldSnapshot, FileInput, type FileInputProps, type FileSource, Flex, type FlexAlign, type FlexDirection, type FlexJustify, type FlexProps, type FlexWrap, Form, FormContext, FormField, type FormFieldProps, type FormProps, FormStore, type FormStoreOptions, type FormValues, Grid, GridCard, type GridCardItem, type GridCardProps, type GridColumn, type GridProps, type GridSortDirection, type GridSortState, type GridSource, IconButton, type IconButtonProps, Jumbotron, type JumbotronBackground, type JumbotronLayout, type JumbotronProps, type JwtResult, Kbd, type KbdProps, type KbdSize, LeadCapture, type LeadCaptureProps, List, type ListItem, type ListProps, LoadingSpinner, type LoadingSpinnerProps, LogoutTimer, type LogoutTimerProps, MegaMenu, type MegaMenuFeaturedProps, type MegaMenuItemProps, type MegaMenuLinkProps, type MegaMenuPanelProps, type MegaMenuProps, type MegaMenuSectionProps, MenuButton, type MenuButtonItem, type MenuButtonProps, Modal, type ModalProps, type ModalSize, type NotificationPayload, NotificationProvider, NumberInput, type NumberInputProps, OpaqueGridCard, type OpaqueGridCardProps, OtpInput, type OtpInputProps, type PaginationOptions, Parallax, type ParallaxProps, type ParsedSheet, Password, type PasswordProps, type PasswordRule, type PasswordScore, PasswordStrength, type PasswordStrengthProps, type PasswordStrengthResult, type PdfExportOptions, type PdfPage, PdfViewer, type PdfViewerProps, PopConfirm, type PopConfirmProps, type PopConfirmTone, Portal, type PortalProps, type PricingPlan, PricingPlans, type PricingPlansProps, RadioGroup, type RadioGroupProps, type RadioOption, RadioTile, type RadioTileOption, type RadioTileProps, Rating, type RatingProps, type RemoteSourceOptions, type RulesMap, ScalableContainer, type ScalableContainerProps, Scheduler, type SchedulerEvent, type SchedulerProps, type SchedulerRange, type SchedulerView, SearchInput, type SearchInputProps, type SearchOptions, SecureLayout, type SecureLayoutProps, SegmentedControl, type SegmentedControlProps, type SegmentedOption, type SheetData, Sidebar, type SidebarItem, type SidebarProps, type SidebarSection, SkeletonBox, type SkeletonBoxProps, SkeletonCard, type SkeletonCardProps, SkeletonCircle, type SkeletonCircleProps, SkeletonText, type SkeletonTextProps, type Slide, SlideShow, type SlideShowProps, Slider, type SliderMark, type SliderProps, type SliderValue, type SocialLink, type SocialPlatform, Socials, type SocialsProps, type SortDirection, type SortState, type Spacing, Spreadsheet, type SpreadsheetProps, Statistic, type StatisticDelta, type StatisticProps, type StatisticSize, Stepper, type StepperActiveStatus, type StepperProps, type StepperStep, Switch, type SwitchInputProps, Table, type TableColumn, type TableProps, Tabs, type TabsAddProps, type TabsListProps, type TabsOrientation, type TabsPanelProps, type TabsProps, type TabsSize, type TabsTriggerProps, type TabsVariant, TagsInput, type TagsInputProps, DatePicker as Temporal, type TemporalPickerProps, type Testimonial, Testimonials, type TestimonialsProps, TextArea, type TextAreaProps, TextInput, type TextInputProps, type ThemeColors, type ThemeConfig, type ThemeDensity, type ThemeMotion, ThemeProvider, type ThemeProviderProps, type ThemeRadius, type ThemeShadows, ThemeSwitch, type ThemeSwitchProps, type ThemeTypography, TimePicker, type TimePickerProps, Timeline, type TimelineEvent, type TimelineProps, type TimelineStatus, Tooltip, type TooltipProps, TooltipProvider, TopBar, type TopBarProps, Tree, type TreeItemClickPayload, type TreeNode, type TreeProps, TreeSelect, type TreeSelectProps, Typography, type TypographyAlign, type TypographyColor, type TypographyProps, type TypographyVariant, type TypographyWeight, type UseExcelReturn, type UseFieldArrayReturn, type UseFormFieldOptions, type UseFormReturn, type UsePdfReturn, type ValidateTrigger, Video, type VideoProps, VirtualList, type VirtualListProps, Wizard, type WizardProps, type WizardStep, cardNumberError, cvvError, cx, defaultPasswordRules, detectBrand, expiryError, fieldShell, formatCardNumber, formatExpiry, isRequired, luhnValid, onlyDigits, patterns, runFieldRules, scorePassword, useBreakpoint, useCart, useExcel, useFieldArray, useForm, useFormField, useFormStore, useJwt, useLocalStorage, useMediaQuery, useNotification, usePdf };
5810
+ export { Accordion, type AccordionItemProps, type AccordionProps, AppShell, type AppShellProps, AutoComplete, type AutoCompleteProps, Avatar, type AvatarProps, type AvatarShape, type AvatarSize, type AvatarStatus, Badge, type BadgeProps, type BadgeSize, type BadgeTone, type BadgeVariant, Banner, type BannerProps, type BannerTone, Blog, type BlogPost, type BlogProps, Box, type BoxBackground, type BoxBorder, type BoxProps, type BoxRadius, type BoxShadow, type BreadcrumbItem, Breadcrumbs, type BreadcrumbsProps, type Breakpoint, type BreakpointState, Button, type ButtonProps, CARD_BRANDS, Card, type CardBodyProps, type CardBrand, CardCarousel, type CardCarouselProps, type CardFooterProps, type CardHeaderProps, type CardMediaProps, type CardProps, Cart, CartButton, type CartButtonProps, type CartContextValue, type CartItemInput, type CartLineItem, type CartProps, CartProvider, type CartProviderProps, type CartSummaryRow, Catalog, CatalogCarousel, type CatalogCarouselProps, CatalogGrid, type CatalogGridProps, type CatalogProps, type Cell, type CellEditInfo, type CellValue, Chat, type ChatMessage, type ChatProps, Checkbox, type CheckboxProps, Checkout, type CheckoutProps, type ClassValue, ColorPicker, type ColorPickerProps, type ConsentChoice, ContextMenu, type ContextMenuActionItem, type ContextMenuPosition, type ContextMenuProps, CookieConsent, type CookieConsentProps, CreditCardForm, type CreditCardFormProps, type CreditCardValue, DataGrid, type DataGridProps, type DatePickerProps, type DateRange, DateRangePicker, type DateRangePickerProps, type DateRangePreset, type DeltaDirection, Drawer, type DrawerProps, type DrawerSize, Dropdown, type DropdownItem, type DropdownProps, type EditorArgs, EmptyCart, type EmptyCartProps, type ErrorMap, type ExcelSheetInput, type ExpandRowOptions, type ExportSaveOptions, FAB, type FABAction, type FABPosition, type FABProps, type FABSize, type FABTone, FadingBase, type FadingBaseProps, type Feature, FeatureGrid, type FeatureGridProps, Field, type FieldArrayItem, type FieldBindings, FieldHelpIcon, type FieldKind, FieldLabel, type FieldLabelProps, type FieldProps, type FieldRule, type FieldRules, type FieldShellOptions, type FieldSize, type FieldSnapshot, FileInput, type FileInputProps, type FileSource, Flex, type FlexAlign, type FlexDirection, type FlexJustify, type FlexProps, type FlexWrap, Form, FormContext, FormField, type FormFieldProps, type FormProps, FormStore, type FormStoreOptions, type FormValues, Grid, GridCard, type GridCardItem, type GridCardProps, type GridColumn, type GridProps, type GridSortDirection, type GridSortState, type GridSource, IconButton, type IconButtonProps, Jumbotron, type JumbotronBackground, type JumbotronLayout, type JumbotronProps, type JwtResult, Kbd, type KbdProps, type KbdSize, LeadCapture, type LeadCaptureProps, List, type ListItem, type ListProps, LoadingSpinner, type LoadingSpinnerProps, LogoutTimer, type LogoutTimerProps, MegaMenu, type MegaMenuFeaturedProps, type MegaMenuItemProps, type MegaMenuLinkProps, type MegaMenuPanelProps, type MegaMenuProps, type MegaMenuSectionProps, MenuButton, type MenuButtonItem, type MenuButtonProps, Modal, type ModalProps, type ModalSize, type NotificationPayload, NotificationProvider, NumberInput, type NumberInputProps, OpaqueGridCard, type OpaqueGridCardProps, OtpInput, type OtpInputProps, type PaginationOptions, Parallax, type ParallaxProps, type ParsedSheet, Password, type PasswordProps, type PasswordRule, type PasswordScore, PasswordStrength, type PasswordStrengthProps, type PasswordStrengthResult, type PdfExportOptions, type PdfPage, PdfViewer, type PdfViewerProps, PopConfirm, type PopConfirmProps, type PopConfirmTone, Portal, type PortalProps, type PricingPlan, PricingPlans, type PricingPlansProps, RadioGroup, type RadioGroupProps, type RadioOption, RadioTile, type RadioTileOption, type RadioTileProps, Rating, type RatingProps, type RemoteSourceOptions, type RulesMap, ScalableContainer, type ScalableContainerProps, Scheduler, type SchedulerEvent, type SchedulerProps, type SchedulerRange, type SchedulerView, SearchInput, type SearchInputProps, type SearchOptions, SecureLayout, type SecureLayoutProps, SegmentedControl, type SegmentedControlProps, type SegmentedOption, type SheetData, Sidebar, type SidebarItem, type SidebarProps, type SidebarSection, SkeletonBox, type SkeletonBoxProps, SkeletonCard, type SkeletonCardProps, SkeletonCircle, type SkeletonCircleProps, SkeletonText, type SkeletonTextProps, type Slide, SlideShow, type SlideShowProps, Slider, type SliderMark, type SliderProps, type SliderValue, type SocialLink, type SocialPlatform, Socials, type SocialsProps, type SortDirection, type SortState, type Spacing, Spreadsheet, type SpreadsheetProps, Statistic, type StatisticDelta, type StatisticProps, type StatisticSize, Stepper, type StepperActiveStatus, type StepperProps, type StepperStep, Switch, type SwitchInputProps, Table, type TableColumn, type TableProps, Tabs, type TabsAddProps, type TabsListProps, type TabsOrientation, type TabsPanelProps, type TabsProps, type TabsSize, type TabsTriggerProps, type TabsVariant, TagsInput, type TagsInputProps, DatePicker as Temporal, type TemporalPickerProps, type Testimonial, Testimonials, type TestimonialsProps, TextArea, type TextAreaProps, TextInput, type TextInputProps, type ThemeColors, type ThemeConfig, type ThemeDensity, type ThemeMotion, ThemeProvider, type ThemeProviderProps, type ThemeRadius, type ThemeShadows, ThemeSwitch, type ThemeSwitchProps, type ThemeTypography, TimePicker, type TimePickerProps, Timeline, type TimelineEvent, type TimelineProps, type TimelineStatus, Tooltip, type TooltipProps, TooltipProvider, TopBar, type TopBarProps, Tree, type TreeItemClickPayload, type TreeNode, type TreeProps, TreeSelect, type TreeSelectProps, Typography, type TypographyAlign, type TypographyColor, type TypographyProps, type TypographyVariant, type TypographyWeight, type UseDownloadReturn, type UseExcelReturn, type UseFieldArrayReturn, type UseFormFieldOptions, type UseFormReturn, type UsePdfReturn, type ValidateTrigger, Video, type VideoProps, VirtualList, type VirtualListProps, Wizard, type WizardProps, type WizardStep, cardNumberError, cvvError, cx, defaultPasswordRules, detectBrand, expiryError, fieldShell, formatCardNumber, formatExpiry, isRequired, luhnValid, onlyDigits, patterns, runFieldRules, scorePassword, useBreakpoint, useCart, useDownload, useExcel, useFieldArray, useForm, useFormField, useFormStore, useJwt, useLocalStorage, useMediaQuery, useNotification, usePdf };
package/dist/index.js CHANGED
@@ -11145,6 +11145,36 @@ function useJwt(token) {
11145
11145
  const isValid = decoded.payload != null && !isExpired;
11146
11146
  return { payload: decoded.payload, header: decoded.header, expiresAt, isExpired, isValid, raw: token ?? null };
11147
11147
  }
11148
+ function useDownload() {
11149
+ const saveBlob = useCallback((blob, fileName) => {
11150
+ if (typeof window === "undefined") return;
11151
+ const url = URL.createObjectURL(blob);
11152
+ const a = document.createElement("a");
11153
+ a.href = url;
11154
+ a.download = fileName;
11155
+ a.click();
11156
+ setTimeout(() => URL.revokeObjectURL(url), 0);
11157
+ }, []);
11158
+ const saveFromBase64 = useCallback((base64, fileName, mimeType) => {
11159
+ let payload = base64;
11160
+ let inferredMime;
11161
+ if (base64.startsWith("data:")) {
11162
+ const commaIdx = base64.indexOf(",");
11163
+ if (commaIdx !== -1) {
11164
+ const header = base64.slice(5, commaIdx);
11165
+ const semiIdx = header.indexOf(";");
11166
+ if (semiIdx !== -1) inferredMime = header.slice(0, semiIdx);
11167
+ payload = base64.slice(commaIdx + 1);
11168
+ }
11169
+ }
11170
+ const binary = atob(payload);
11171
+ const bytes = new Uint8Array(binary.length);
11172
+ for (let i = 0; i < binary.length; i++) bytes[i] = binary.charCodeAt(i);
11173
+ const blob = new Blob([bytes], { type: mimeType ?? inferredMime ?? "application/octet-stream" });
11174
+ saveBlob(blob, fileName);
11175
+ }, [saveBlob]);
11176
+ return { saveBlob, saveFromBase64 };
11177
+ }
11148
11178
  var INVALID_WS_CHARS = /[:\\/?\*[\]]/g;
11149
11179
  function sanitizeName(name) {
11150
11180
  return name.replace(INVALID_WS_CHARS, "_").slice(0, 31) || "Sheet";
@@ -11153,6 +11183,7 @@ var xlsxPromise2 = null;
11153
11183
  var loadXlsx2 = () => xlsxPromise2 ??= import('xlsx');
11154
11184
  function useExcel() {
11155
11185
  const [isExporting, setIsExporting] = useState(false);
11186
+ const { saveBlob } = useDownload();
11156
11187
  const exportSheets = useCallback(async (sheets, options = {}) => {
11157
11188
  const { fileName = "export", onSave } = options;
11158
11189
  setIsExporting(true);
@@ -11204,12 +11235,12 @@ function useExcel() {
11204
11235
  if (onSave) {
11205
11236
  await onSave(blob, name);
11206
11237
  } else {
11207
- downloadBlob(blob, name);
11238
+ saveBlob(blob, name);
11208
11239
  }
11209
11240
  } finally {
11210
11241
  setIsExporting(false);
11211
11242
  }
11212
- }, []);
11243
+ }, [saveBlob]);
11213
11244
  const readWorkbook = useCallback(async (source) => {
11214
11245
  const XLSX = await loadXlsx2();
11215
11246
  let bytes;
@@ -11245,6 +11276,7 @@ var jspdfPromise2 = null;
11245
11276
  var loadJspdf2 = () => jspdfPromise2 ??= import('jspdf');
11246
11277
  function usePdf() {
11247
11278
  const [isExporting, setIsExporting] = useState(false);
11279
+ const { saveBlob } = useDownload();
11248
11280
  const exportCanvases = useCallback(async (pages, options = {}) => {
11249
11281
  const { fileName = "report", onSave, orientation = "landscape" } = options;
11250
11282
  const validPages = pages.filter((p) => p.canvas.width !== 0 && p.canvas.height !== 0);
@@ -11279,17 +11311,12 @@ function usePdf() {
11279
11311
  if (onSave) {
11280
11312
  await onSave(blob, name);
11281
11313
  } else {
11282
- const url = URL.createObjectURL(blob);
11283
- const a = document.createElement("a");
11284
- a.href = url;
11285
- a.download = name;
11286
- a.click();
11287
- URL.revokeObjectURL(url);
11314
+ saveBlob(blob, name);
11288
11315
  }
11289
11316
  } finally {
11290
11317
  setIsExporting(false);
11291
11318
  }
11292
- }, []);
11319
+ }, [saveBlob]);
11293
11320
  return { exportCanvases, isExporting };
11294
11321
  }
11295
11322
  var GRADIENT = "radial-gradient(ellipse 80% 60% at 50% 0%, color-mix(in oklab, var(--color-accent) 12%, transparent), transparent 70%)";
@@ -11832,6 +11859,6 @@ function LeadCapture({
11832
11859
  );
11833
11860
  }
11834
11861
 
11835
- export { Accordion_default as Accordion, AppShell, AutoComplete, Avatar, Badge, Banner, Blog, Box, Breadcrumbs, Button_default as Button, CARD_BRANDS, Card_default as Card, CardCarousel, Cart, CartButton, CartProvider, Catalog, CatalogCarousel, CatalogGrid, Chat, Checkbox, Checkout, ColorPicker, ContextMenu, CookieConsent, CreditCardForm, DataGrid, DateRangePicker, Drawer, Dropdown, EmptyCart, FAB, FadingBase, FeatureGrid, Field, FieldHelpIcon, FieldLabel, FileInput, Flex, Form, FormContext, FormField, FormStore, Grid, GridCard, IconButton_default as IconButton, Jumbotron, Kbd, LeadCapture, List2 as List, LoadingSpinner, LogoutTimer, MegaMenu_default as MegaMenu, MenuButton, Modal, NotificationProvider, NumberInput, OpaqueGridCard, OtpInput, Parallax, Password, PasswordStrength, PdfViewer, PopConfirm, Portal, PricingPlans, RadioGroup, RadioTile, Rating, ScalableContainer, Scheduler, SearchInput_default as SearchInput, SecureLayout, SegmentedControl, Sidebar, SkeletonBox, SkeletonCard, SkeletonCircle, SkeletonText, SlideShow, Slider, Socials, Spreadsheet, Statistic, Stepper, Switch, Table, Tabs_default as Tabs, TagsInput, DatePicker as Temporal, Testimonials, TextArea, TextInput, ThemeProvider, ThemeSwitch, TimePicker, Timeline, Tooltip, TooltipProvider, TopBar, Tree, TreeSelect, Typography, Video, VirtualList, Wizard, cardNumberError, cvvError, cx, defaultPasswordRules, detectBrand, expiryError, fieldShell, formatCardNumber, formatExpiry, isRequired, luhnValid, onlyDigits, patterns, runFieldRules, scorePassword, useBreakpoint, useCart, useExcel, useFieldArray, useForm, useFormField, useFormStore, useJwt, useLocalStorage, useMediaQuery, useNotification, usePdf };
11862
+ export { Accordion_default as Accordion, AppShell, AutoComplete, Avatar, Badge, Banner, Blog, Box, Breadcrumbs, Button_default as Button, CARD_BRANDS, Card_default as Card, CardCarousel, Cart, CartButton, CartProvider, Catalog, CatalogCarousel, CatalogGrid, Chat, Checkbox, Checkout, ColorPicker, ContextMenu, CookieConsent, CreditCardForm, DataGrid, DateRangePicker, Drawer, Dropdown, EmptyCart, FAB, FadingBase, FeatureGrid, Field, FieldHelpIcon, FieldLabel, FileInput, Flex, Form, FormContext, FormField, FormStore, Grid, GridCard, IconButton_default as IconButton, Jumbotron, Kbd, LeadCapture, List2 as List, LoadingSpinner, LogoutTimer, MegaMenu_default as MegaMenu, MenuButton, Modal, NotificationProvider, NumberInput, OpaqueGridCard, OtpInput, Parallax, Password, PasswordStrength, PdfViewer, PopConfirm, Portal, PricingPlans, RadioGroup, RadioTile, Rating, ScalableContainer, Scheduler, SearchInput_default as SearchInput, SecureLayout, SegmentedControl, Sidebar, SkeletonBox, SkeletonCard, SkeletonCircle, SkeletonText, SlideShow, Slider, Socials, Spreadsheet, Statistic, Stepper, Switch, Table, Tabs_default as Tabs, TagsInput, DatePicker as Temporal, Testimonials, TextArea, TextInput, ThemeProvider, ThemeSwitch, TimePicker, Timeline, Tooltip, TooltipProvider, TopBar, Tree, TreeSelect, Typography, Video, VirtualList, Wizard, cardNumberError, cvvError, cx, defaultPasswordRules, detectBrand, expiryError, fieldShell, formatCardNumber, formatExpiry, isRequired, luhnValid, onlyDigits, patterns, runFieldRules, scorePassword, useBreakpoint, useCart, useDownload, useExcel, useFieldArray, useForm, useFormField, useFormStore, useJwt, useLocalStorage, useMediaQuery, useNotification, usePdf };
11836
11863
  //# sourceMappingURL=index.js.map
11837
11864
  //# sourceMappingURL=index.js.map