@px-ui/core 4.0.1 → 4.2.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.ts CHANGED
@@ -30,7 +30,7 @@ export * from "input-otp";
30
30
 
31
31
  //#region src/components/dialog.d.ts
32
32
  declare namespace dialog_d_exports {
33
- export { Close$1 as Close, Content$6 as Content, Description$3 as Description, Footer$1 as Footer, Header$3 as Header, HeaderContent, HeaderIcon, Overlay, Portal, Root$11 as Root, Title$3 as Title, Trigger$8 as Trigger };
33
+ export { Close$1 as Close, Content$6 as Content, Description$3 as Description, Footer$1 as Footer, Header$3 as Header, HeaderContent, HeaderIcon, Overlay, Portal, Root$11 as Root, Title$3 as Title, Trigger$7 as Trigger };
34
34
  }
35
35
  declare function Root$11({
36
36
  ...props
@@ -38,7 +38,7 @@ declare function Root$11({
38
38
  declare function Portal({
39
39
  ...props
40
40
  }: React$2.ComponentProps<typeof Dialog.Portal>): react_jsx_runtime0.JSX.Element;
41
- declare function Trigger$8({
41
+ declare function Trigger$7({
42
42
  ...props
43
43
  }: React$2.ComponentProps<typeof Dialog.Trigger>): react_jsx_runtime0.JSX.Element;
44
44
  declare function Close$1({
@@ -80,10 +80,10 @@ declare function Description$3({
80
80
  ...props
81
81
  }: React$2.ComponentProps<typeof Dialog.Description>): react_jsx_runtime0.JSX.Element;
82
82
  declare namespace popover_d_exports {
83
- export { Close, CloseIconButton, Content$5 as Content, Description$2 as Description, Footer, Header$2 as Header, Root$10 as Root, Title$2 as Title, Trigger$7 as Trigger };
83
+ export { Close, CloseIconButton, Content$5 as Content, Description$2 as Description, Footer, Header$2 as Header, Root$10 as Root, Title$2 as Title, Trigger$6 as Trigger };
84
84
  }
85
85
  declare function Root$10(props: React.ComponentProps<typeof Popover.Root>): react_jsx_runtime0.JSX.Element;
86
- declare function Trigger$7(props: React.ComponentProps<typeof Popover.Trigger>): react_jsx_runtime0.JSX.Element;
86
+ declare function Trigger$6(props: React.ComponentProps<typeof Popover.Trigger>): react_jsx_runtime0.JSX.Element;
87
87
  declare function Close(props: React.ComponentProps<typeof Popover.Close>): react_jsx_runtime0.JSX.Element;
88
88
  declare function Positioner(props: React.ComponentProps<typeof Popover.Positioner>): react_jsx_runtime0.JSX.Element;
89
89
  declare function Header$2({
@@ -247,9 +247,9 @@ declare function defineLoadOptions<TData$1 = any>(loadOptions: LoadOptionsConfig
247
247
  type InferOption<T> = T extends LoadOptionsConfig<infer TData> ? TData : never;
248
248
  type InferOptions<T> = T extends LoadOptionsConfig<infer TData> ? TData[] : never;
249
249
  declare namespace combobox_d_exports {
250
- export { BaseCombobox, Chip, ChipsTrigger, Content$4 as Content, Item$7 as Item, List$2 as List, LoadingIndicator, MultiItem$1 as MultiItem, Root$8 as Root, Search, SearchableTrigger, SearchableTriggerDropdownAddon, Trigger$6 as Trigger, Value$2 as Value, useComboboxContext };
250
+ export { BaseCombobox, Chip, ChipsTrigger, Content$4 as Content, Item$6 as Item, List$3 as List, LoadingIndicator, MultiItem$1 as MultiItem, Root$8 as Root, Search, SearchableTrigger, SearchableTriggerDropdownAddon, Trigger$5 as Trigger, Value$2 as Value, useComboboxContext };
251
251
  }
252
- declare const List$2: React$2.ForwardRefExoticComponent<_base_ui_react0.AutocompleteListProps & React$2.RefAttributes<HTMLDivElement>>;
252
+ declare const List$3: React$2.ForwardRefExoticComponent<_base_ui_react0.AutocompleteListProps & React$2.RefAttributes<HTMLDivElement>>;
253
253
  type ComboboxContextValues = React$2.ComponentProps<typeof Combobox.Root<any, any>> & {
254
254
  chipsTriggerRef: React$2.RefObject<HTMLDivElement | null>;
255
255
  searchableTriggerRef: React$2.RefObject<HTMLDivElement | null>;
@@ -280,7 +280,7 @@ declare function Content$4({
280
280
  popupProps?: React$2.ComponentProps<typeof Combobox.Popup>;
281
281
  widthVariant?: "trigger" | "fit" | "enforced";
282
282
  }>): react_jsx_runtime0.JSX.Element;
283
- declare function Item$7({
283
+ declare function Item$6({
284
284
  className,
285
285
  ...props
286
286
  }: React$2.ComponentProps<typeof Combobox.Item>): react_jsx_runtime0.JSX.Element;
@@ -299,14 +299,14 @@ declare function SearchableTrigger(props: {
299
299
  addons?: React$2.ReactNode;
300
300
  }): react_jsx_runtime0.JSX.Element;
301
301
  declare function SearchableTriggerDropdownAddon(): react_jsx_runtime0.JSX.Element;
302
- interface TriggerProps$2 extends Combobox.Trigger.Props, VariantProps<typeof triggerVariants> {}
303
- declare function Trigger$6({
302
+ interface TriggerProps$1 extends Combobox.Trigger.Props, VariantProps<typeof triggerVariants> {}
303
+ declare function Trigger$5({
304
304
  size,
305
305
  widthVariant,
306
306
  children,
307
307
  className,
308
308
  ...props
309
- }: TriggerProps$2): react_jsx_runtime0.JSX.Element;
309
+ }: TriggerProps$1): react_jsx_runtime0.JSX.Element;
310
310
  /**
311
311
  * Renders the value, if `value` is a string or an object with `label` property in it,
312
312
  * then renders that value else you should provide a render function to render your custom value
@@ -344,7 +344,7 @@ declare function Search({
344
344
  declare function useComboboxContext(): ComboboxContextValues;
345
345
  declare const BaseCombobox: typeof Combobox;
346
346
  declare namespace select_d_exports {
347
- export { BaseSelect, Content$3 as Content, Item$6 as Item, List$1 as List, MultiItem, MultiSelectedValue, Root$7 as Root, SelectedValue, Trigger$5 as Trigger, TriggerProps$1 as TriggerProps, Value$1 as Value };
347
+ export { BaseSelect, Content$3 as Content, Item$5 as Item, List$2 as List, MultiItem, MultiSelectedValue, Root$7 as Root, SelectedValue, Trigger$4 as Trigger, TriggerProps, Value$1 as Value };
348
348
  }
349
349
  declare function Root$7<Value$3 = any, Multiple extends boolean | undefined = false>({
350
350
  children,
@@ -365,8 +365,8 @@ declare function Content$3({
365
365
  popupProps?: React$2.ComponentProps<typeof Select.Popup>;
366
366
  widthVariant?: "trigger" | "fit" | "enforced";
367
367
  }>): react_jsx_runtime0.JSX.Element;
368
- declare const List$1: React$2.ForwardRefExoticComponent<_base_ui_react0.SelectListProps & React$2.RefAttributes<HTMLDivElement>>;
369
- declare function Item$6({
368
+ declare const List$2: React$2.ForwardRefExoticComponent<_base_ui_react0.SelectListProps & React$2.RefAttributes<HTMLDivElement>>;
369
+ declare function Item$5({
370
370
  className,
371
371
  ...props
372
372
  }: React$2.ComponentProps<typeof Select.Item>): react_jsx_runtime0.JSX.Element;
@@ -374,12 +374,12 @@ declare function MultiItem({
374
374
  className,
375
375
  ...props
376
376
  }: React$2.ComponentProps<typeof Select.Item>): react_jsx_runtime0.JSX.Element;
377
- interface TriggerProps$1 extends Select.Trigger.Props, VariantProps<typeof triggerVariants> {}
378
- declare function Trigger$5({
377
+ interface TriggerProps extends Select.Trigger.Props, VariantProps<typeof triggerVariants> {}
378
+ declare function Trigger$4({
379
379
  size,
380
380
  widthVariant,
381
381
  ...props
382
- }: TriggerProps$1): react_jsx_runtime0.JSX.Element;
382
+ }: TriggerProps): react_jsx_runtime0.JSX.Element;
383
383
  declare function MultiSelectedValue({
384
384
  selectedValue,
385
385
  maxItems
@@ -402,10 +402,10 @@ declare function Value$1({
402
402
  type SelectedValue<TValue> = TValue | null | undefined;
403
403
  declare const BaseSelect: typeof Select;
404
404
  declare namespace menu_d_exports {
405
- export { BaseMenu, BaseTrigger, Content$2 as Content, DropdownIndicator, Group$3 as Group, GroupLabel, Item$5 as Item, RadioGroup$1 as RadioGroup, RadioItem, Root$6 as Root, Separator$1 as Separator, Trigger$4 as Trigger };
405
+ export { BaseMenu, BaseTrigger, Content$2 as Content, DropdownIndicator, Group$3 as Group, GroupLabel, Item$4 as Item, RadioGroup$1 as RadioGroup, RadioItem, Root$6 as Root, Separator$1 as Separator, Trigger$3 as Trigger };
406
406
  }
407
407
  declare const Root$6: typeof Menu.Root;
408
- declare function Trigger$4({
408
+ declare function Trigger$3({
409
409
  className,
410
410
  children,
411
411
  size,
@@ -425,7 +425,7 @@ declare function Content$2({
425
425
  widthVariant?: "trigger" | "fit" | "enforced";
426
426
  }>): react_jsx_runtime0.JSX.Element;
427
427
  declare function DropdownIndicator(): react_jsx_runtime0.JSX.Element;
428
- declare function Item$5({
428
+ declare function Item$4({
429
429
  className,
430
430
  children,
431
431
  ...props
@@ -473,7 +473,7 @@ declare function Value({
473
473
  }: React$2.ComponentProps<typeof Progress.Value>): react_jsx_runtime0.JSX.Element;
474
474
  declare const BaseProgress: typeof Progress;
475
475
  declare namespace segmented_control_d_exports {
476
- export { Item$4 as Item, Root$4 as Root };
476
+ export { Item$3 as Item, Root$4 as Root };
477
477
  }
478
478
  declare const segmentedControlItemVariants: (props?: ({
479
479
  variant?: "default" | null | undefined;
@@ -483,7 +483,7 @@ declare function Root$4({
483
483
  className,
484
484
  ...props
485
485
  }: React$2.ComponentProps<typeof RadioGroup>): react_jsx_runtime0.JSX.Element;
486
- declare function Item$4({
486
+ declare function Item$3({
487
487
  children,
488
488
  className,
489
489
  variant,
@@ -493,7 +493,7 @@ declare function Item$4({
493
493
  children: React$2.ReactNode;
494
494
  }): react_jsx_runtime0.JSX.Element;
495
495
  declare namespace tabs_d_exports {
496
- export { Content$1 as Content, List, Root$3 as Root, Trigger$3 as Trigger };
496
+ export { Content$1 as Content, List$1 as List, Root$3 as Root, Trigger$2 as Trigger };
497
497
  }
498
498
  type TabsVariant = "underline";
499
499
  declare function Root$3({
@@ -503,12 +503,12 @@ declare function Root$3({
503
503
  }: React$2.ComponentProps<typeof Tabs.Root> & {
504
504
  variant?: TabsVariant;
505
505
  }): react_jsx_runtime0.JSX.Element;
506
- declare function List({
506
+ declare function List$1({
507
507
  className,
508
508
  children,
509
509
  ...props
510
510
  }: React$2.ComponentProps<typeof Tabs.List>): react_jsx_runtime0.JSX.Element;
511
- declare function Trigger$3({
511
+ declare function Trigger$2({
512
512
  className,
513
513
  ...props
514
514
  }: React$2.ComponentProps<typeof Tabs.Tab>): react_jsx_runtime0.JSX.Element;
@@ -517,14 +517,14 @@ declare function Content$1({
517
517
  ...props
518
518
  }: React$2.ComponentProps<typeof Tabs.Panel>): react_jsx_runtime0.JSX.Element;
519
519
  declare namespace tooltip_d_exports {
520
- export { BaseProvider, BaseRoot, Content, Root$2 as Root, Trigger$2 as Trigger };
520
+ export { BaseProvider, BaseRoot, Content, Root$2 as Root, Trigger$1 as Trigger };
521
521
  }
522
522
  declare function Root$2({
523
523
  ...props
524
524
  }: React$2.ComponentProps<typeof Tooltip.Root>): react_jsx_runtime0.JSX.Element;
525
525
  declare const BaseRoot: typeof Tooltip.Root;
526
526
  declare const BaseProvider: React$2.FC<_base_ui_react0.TooltipProviderProps>;
527
- declare function Trigger$2({
527
+ declare function Trigger$1({
528
528
  ...props
529
529
  }: React$2.ComponentProps<typeof Tooltip.Trigger>): react_jsx_runtime0.JSX.Element;
530
530
  declare function Content({
@@ -551,13 +551,13 @@ declare function Checkbox({
551
551
  ...props
552
552
  }: CheckboxProps): react_jsx_runtime0.JSX.Element;
553
553
  declare namespace block_checkbox_group_d_exports {
554
- export { Description$1 as Description, Group$2 as Group, Header$1 as Header, Item$3 as Item, Title$1 as Title };
554
+ export { Description$1 as Description, Group$2 as Group, Header$1 as Header, Item$2 as Item, Title$1 as Title };
555
555
  }
556
556
  declare function Group$2({
557
557
  className,
558
558
  ...props
559
559
  }: React.ComponentProps<typeof CheckboxGroup>): react_jsx_runtime0.JSX.Element;
560
- declare function Item$3({
560
+ declare function Item$2({
561
561
  className,
562
562
  invalid,
563
563
  children,
@@ -576,7 +576,7 @@ declare function Description$1(props: React.PropsWithChildren<{
576
576
  className?: string;
577
577
  }>): react_jsx_runtime0.JSX.Element;
578
578
  declare namespace radio_group_d_exports {
579
- export { Group$1 as Group, Item$1 as Item };
579
+ export { Group$1 as Group, Item };
580
580
  }
581
581
  declare function Group$1({
582
582
  className,
@@ -587,25 +587,25 @@ declare const radioVariants: (props?: ({
587
587
  size?: "default" | "sm" | "lg" | null | undefined;
588
588
  } & class_variance_authority_types12.ClassProp) | undefined) => string;
589
589
  interface RadioGroupItemProps extends React$2.ComponentProps<typeof Radio.Root>, VariantProps<typeof radioVariants> {}
590
- declare function Item$1({
590
+ declare function Item({
591
591
  className,
592
592
  variant,
593
593
  size,
594
594
  ...props
595
595
  }: RadioGroupItemProps): react_jsx_runtime0.JSX.Element;
596
596
  declare namespace block_radio_group_d_exports {
597
- export { Description, Group, Header, Item$2 as Item, Title };
597
+ export { Description, Group, Header, Item$1 as Item, Title };
598
598
  }
599
599
  declare function Group({
600
600
  className,
601
601
  ...props
602
602
  }: React.ComponentProps<typeof RadioGroup>): react_jsx_runtime0.JSX.Element;
603
- declare function Item$2({
603
+ declare function Item$1({
604
604
  className,
605
605
  invalid,
606
606
  children,
607
607
  ...rest
608
- }: React.PropsWithChildren<React.ComponentProps<typeof Item$1>> & {
608
+ }: React.PropsWithChildren<React.ComponentProps<typeof Item>> & {
609
609
  className?: string;
610
610
  invalid?: boolean;
611
611
  }): react_jsx_runtime0.JSX.Element;
@@ -647,13 +647,13 @@ declare function BreadcrumbSeparator({
647
647
  ...props
648
648
  }: React$2.ComponentProps<"li">): react_jsx_runtime0.JSX.Element;
649
649
  declare namespace collapsible_d_exports {
650
- export { Panel, Root$1 as Root, ToggleIcon, Trigger$1 as Trigger };
650
+ export { Panel, Root$1 as Root, ToggleIcon, Trigger };
651
651
  }
652
652
  declare function Root$1({
653
653
  className,
654
654
  ...props
655
655
  }: React$2.ComponentProps<typeof Collapsible.Root>): react_jsx_runtime0.JSX.Element;
656
- declare function Trigger$1(props: React$2.ComponentProps<typeof Collapsible.Trigger>): react_jsx_runtime0.JSX.Element;
656
+ declare function Trigger(props: React$2.ComponentProps<typeof Collapsible.Trigger>): react_jsx_runtime0.JSX.Element;
657
657
  declare function Panel({
658
658
  className,
659
659
  ...props
@@ -813,59 +813,45 @@ type FileMetadata = {
813
813
  url: string;
814
814
  id: string;
815
815
  };
816
- type FileWithPreview = {
816
+ type UploadStatus = "idle" | "uploading" | "complete" | "error";
817
+ type FileUploadItem = {
817
818
  file: File | FileMetadata;
818
819
  id: string;
819
820
  preview?: string;
820
- };
821
- type FileUploadOptions = {
822
- maxFiles?: number;
823
- maxSize?: number;
824
- accept?: string;
825
- multiple?: boolean;
826
- initialFiles?: FileMetadata[];
827
- onFilesChange?: (files: FileWithPreview[]) => void;
828
- onFilesAdded?: (addedFiles: FileWithPreview[]) => void;
829
- };
830
- type FileUploadState = {
831
- files: FileWithPreview[];
832
- isDragging: boolean;
833
- errors: string[];
834
- };
835
- type FileUploadActions = {
836
- addFiles: (files: FileList | File[]) => void;
837
- removeFile: (id: string) => void;
838
- clearFiles: () => void;
839
- clearErrors: () => void;
840
- handleDragEnter: (e: DragEvent<HTMLElement>) => void;
841
- handleDragLeave: (e: DragEvent<HTMLElement>) => void;
842
- handleDragOver: (e: DragEvent<HTMLElement>) => void;
843
- handleDrop: (e: DragEvent<HTMLElement>) => void;
844
- handleFileChange: (e: ChangeEvent<HTMLInputElement>) => void;
845
- openFileDialog: () => void;
846
- getInputProps: (props?: InputHTMLAttributes<HTMLInputElement>) => InputHTMLAttributes<HTMLInputElement> & {
847
- ref: any;
848
- };
849
- };
850
- declare const formatBytes: (bytes: number, decimals?: number) => string;
851
- type UploadStatus = "idle" | "uploading" | "success" | "error";
852
- type FileWithUploadStatus = FileWithPreview & {
853
821
  progress: number;
854
822
  status: UploadStatus;
855
823
  error?: string;
856
824
  uploadedUrl?: string;
857
825
  };
858
826
  type PresignedUrlResponse = {
827
+ /** The S3 bucket URL to POST to */
859
828
  url: string;
860
- fullPath: string;
829
+ /** The full accessible path after upload (may include signed query params) */
830
+ full_path: string;
831
+ /** The S3 object key (e.g., "uuid/filename.pdf") */
832
+ key?: string;
833
+ /** Access control level */
834
+ acl?: string;
835
+ /** Expected response status from S3 */
836
+ success_action_status?: string;
837
+ /** Content-Type for the upload */
838
+ "Content-Type"?: string;
839
+ /** Base64-encoded policy document */
840
+ policy?: string;
841
+ /** AWS credential string */
842
+ "x-amz-credential"?: string;
843
+ /** AWS signing algorithm */
844
+ "x-amz-algorithm"?: string;
845
+ /** AWS request date */
846
+ "x-amz-date"?: string;
847
+ /** AWS request signature */
848
+ "x-amz-signature"?: string;
849
+ /** Additional fields */
861
850
  [key: string]: unknown;
862
851
  };
863
852
  type UploadConfig = {
864
853
  /**
865
854
  * Function to get a presigned URL for uploading
866
- * Called before uploading each file
867
- * @param params - Parameters including filename, contentType, size, and optional AbortSignal
868
- * @param params.signal - Optional AbortSignal to cancel the request
869
855
  */
870
856
  getPresignedUrl: (params: {
871
857
  filename: string;
@@ -878,12 +864,6 @@ type UploadConfig = {
878
864
  }>;
879
865
  /**
880
866
  * Function to upload the file to the storage
881
- * Receives the presigned URL and the file
882
- * @param url - The presigned URL to upload to
883
- * @param file - The file to upload
884
- * @param presignedData - The full presigned URL response data
885
- * @param onProgress - Optional callback for upload progress
886
- * @param signal - Optional AbortSignal to cancel the upload
887
867
  */
888
868
  uploadFile: (url: string, file: File, presignedData: PresignedUrlResponse, onProgress?: (progress: number) => void, signal?: AbortSignal) => Promise<{
889
869
  result?: {
@@ -900,74 +880,63 @@ type UploadConfig = {
900
880
  /**
901
881
  * Called when a single file upload completes
902
882
  */
903
- onUploadComplete?: (file: FileWithUploadStatus) => void;
883
+ onUploadComplete?: (file: FileUploadItem) => void;
904
884
  /**
905
885
  * Called when a single file upload fails
906
886
  */
907
- onUploadError?: (file: FileWithUploadStatus, error: unknown) => void;
887
+ onUploadError?: (file: FileUploadItem, error: unknown) => void;
908
888
  /**
909
889
  * Called when all files finish uploading
910
890
  */
911
- onAllUploadsComplete?: (files: FileWithUploadStatus[]) => void;
891
+ onAllUploadsComplete?: (files: FileUploadItem[]) => void;
912
892
  };
913
- type FileUploadWithUploaderOptions = FileUploadOptions & {
893
+ type UseFileUploadOptions = {
894
+ maxFiles?: number;
895
+ maxSize?: number;
896
+ accept?: string;
897
+ multiple?: boolean;
898
+ initialFiles?: FileMetadata[];
899
+ onFilesChange?: (files: FileUploadItem[]) => void;
900
+ onFilesAdded?: (addedFiles: FileUploadItem[]) => void;
914
901
  upload?: UploadConfig;
915
902
  };
916
- type FileUploadWithUploaderState = Omit<FileUploadState, "files"> & {
917
- files: FileWithUploadStatus[];
903
+ type UseFileUploadReturn = {
904
+ files: FileUploadItem[];
905
+ isDragging: boolean;
918
906
  isUploading: boolean;
919
- };
920
- type FileUploadWithUploaderActions = Omit<FileUploadActions, "addFiles"> & {
907
+ errors: string[];
921
908
  addFiles: (files: FileList | File[]) => void;
922
- uploadFiles: (files?: FileWithUploadStatus[]) => Promise<FileWithUploadStatus[]>;
909
+ removeFile: (id: string) => void;
910
+ clearFiles: () => void;
911
+ clearErrors: () => void;
912
+ reset: (newFiles?: FileMetadata[]) => void;
913
+ setFiles: (files: FileUploadItem[] | ((prev: FileUploadItem[]) => FileUploadItem[])) => void;
914
+ instanceKey: number;
915
+ uploadFiles: (files?: FileUploadItem[]) => Promise<FileUploadItem[]>;
923
916
  retryUpload: (id: string) => Promise<void>;
924
917
  cancelUpload: (id: string) => void;
918
+ handleDragEnter: (e: DragEvent<HTMLElement>) => void;
919
+ handleDragLeave: (e: DragEvent<HTMLElement>) => void;
920
+ handleDragOver: (e: DragEvent<HTMLElement>) => void;
921
+ handleDrop: (e: DragEvent<HTMLElement>) => void;
922
+ handleFileChange: (e: ChangeEvent<HTMLInputElement>) => void;
923
+ openFileDialog: () => void;
924
+ getInputProps: (props?: InputHTMLAttributes<HTMLInputElement>) => InputHTMLAttributes<HTMLInputElement> & {
925
+ ref: any;
926
+ };
925
927
  };
926
- declare const useFileUpload: (options?: FileUploadWithUploaderOptions) => [FileUploadWithUploaderState, FileUploadWithUploaderActions];
928
+ declare const formatBytes: (bytes: number, decimals?: number) => string;
929
+ declare const useFileUpload: (options?: UseFileUploadOptions) => UseFileUploadReturn;
930
+ type FileWithPreview = FileUploadItem;
931
+ type FileWithUploadStatus = FileUploadItem;
932
+ type FileUploadOptions = UseFileUploadOptions;
933
+ type FileUploadWithUploaderOptions = UseFileUploadOptions;
927
934
  //#endregion
928
935
  //#region src/components/file-upload.d.ts
929
- interface FileUploadFile {
930
- id: string;
931
- file: File | {
932
- name: string;
933
- size: number;
934
- type: string;
935
- url?: string;
936
- };
937
- progress?: number;
938
- status?: "idle" | "uploading" | "success" | "error";
939
- preview?: string;
940
- error?: string;
941
- uploadedUrl?: string;
942
- }
943
936
  interface RootProps {
944
937
  children: React$2.ReactNode;
945
- /** Files from the useFileUpload hook */
946
- files: FileUploadFile[] | FileWithUploadStatus[];
947
- /** Add files action from the hook */
948
- addFiles: (files: FileList | File[]) => void;
949
- /** Remove file action from the hook */
950
- removeFile: (id: string) => void;
951
- /** Clear files action from the hook */
952
- clearFiles: () => void;
953
- /** Retry upload action from the hook */
954
- retryUpload?: (id: string) => Promise<void>;
955
- /** Open file dialog action from the hook */
956
- openFileDialog: () => void;
957
- /** Get input props from the hook */
958
- getInputProps: FileUploadWithUploaderActions["getInputProps"];
959
- /** Handle drag enter from the hook */
960
- handleDragEnter: FileUploadWithUploaderActions["handleDragEnter"];
961
- /** Handle drag leave from the hook */
962
- handleDragLeave: FileUploadWithUploaderActions["handleDragLeave"];
963
- /** Handle drag over from the hook */
964
- handleDragOver: FileUploadWithUploaderActions["handleDragOver"];
965
- /** Handle drop from the hook */
966
- handleDrop: FileUploadWithUploaderActions["handleDrop"];
967
- /** Whether dragging is active (from hook state) */
968
- isDragActive?: boolean;
969
- /** Whether upload is in progress (from hook state) */
970
- isUploading?: boolean;
938
+ /** The upload hook return value */
939
+ upload: UseFileUploadReturn;
971
940
  /** Accepted file types (e.g., "image/*,.pdf") */
972
941
  accept?: string;
973
942
  /** Allow multiple file selection */
@@ -978,19 +947,7 @@ interface RootProps {
978
947
  }
979
948
  declare function Root({
980
949
  children,
981
- files,
982
- addFiles,
983
- removeFile,
984
- clearFiles,
985
- retryUpload,
986
- openFileDialog,
987
- getInputProps,
988
- handleDragEnter,
989
- handleDragLeave,
990
- handleDragOver,
991
- handleDrop,
992
- isDragActive,
993
- isUploading,
950
+ upload,
994
951
  accept,
995
952
  multiple,
996
953
  disabled,
@@ -1000,156 +957,105 @@ declare const dropzoneVariants: (props?: ({
1000
957
  size?: "default" | "sm" | "lg" | null | undefined;
1001
958
  isDragActive?: boolean | null | undefined;
1002
959
  } & class_variance_authority_types12.ClassProp) | undefined) => string;
960
+ /** State passed to the render prop */
961
+ interface DropzoneState {
962
+ /** Whether files are being dragged over the dropzone */
963
+ isDragging: boolean;
964
+ /** Whether files are currently uploading */
965
+ isUploading: boolean;
966
+ /** Whether the dropzone is disabled */
967
+ disabled: boolean;
968
+ /** Current files in the upload */
969
+ files: FileUploadItem[];
970
+ }
971
+ /** Props passed to the render prop element */
972
+ interface DropzoneRenderProps {
973
+ onDragEnter: React$2.DragEventHandler;
974
+ onDragLeave: React$2.DragEventHandler;
975
+ onDragOver: React$2.DragEventHandler;
976
+ onDrop: React$2.DragEventHandler;
977
+ onPaste: React$2.ClipboardEventHandler;
978
+ onKeyDown: React$2.KeyboardEventHandler;
979
+ onClick: React$2.MouseEventHandler;
980
+ tabIndex: number;
981
+ role: string;
982
+ "aria-disabled": boolean;
983
+ "data-dragging": boolean;
984
+ }
1003
985
  interface DropzoneProps extends Omit<React$2.ComponentProps<"div">, "children">, Omit<VariantProps<typeof dropzoneVariants>, "isDragActive"> {
1004
- children?: React$2.ReactNode;
1005
986
  /** Custom text for the dropzone */
1006
987
  dropzoneText?: string;
1007
988
  /** Custom text for the browse button */
1008
989
  browseText?: string;
1009
- /** Hide the default content */
1010
- hideDefaultContent?: boolean;
990
+ /**
991
+ * Render prop for complete customization.
992
+ * When provided, replaces the default dropzone element.
993
+ * Receives props to spread and state for conditional styling.
994
+ */
995
+ render?: (props: DropzoneRenderProps, state: DropzoneState) => React$2.ReactElement;
1011
996
  }
1012
997
  declare function Dropzone({
1013
998
  className,
1014
999
  size,
1015
- children,
1016
1000
  dropzoneText,
1017
1001
  browseText,
1018
- hideDefaultContent,
1002
+ render,
1019
1003
  ...props
1020
1004
  }: DropzoneProps): react_jsx_runtime0.JSX.Element;
1021
- interface TriggerProps extends React$2.ComponentProps<typeof Button> {
1022
- /** Text to show while uploading */
1023
- uploadingText?: string;
1024
- /** Show uploading state */
1025
- showUploadingState?: boolean;
1026
- /** Hide the default content */
1027
- hideDefaultContent?: boolean;
1028
- }
1029
- declare function Trigger({
1030
- children,
1031
- uploadingText,
1032
- showUploadingState,
1033
- hideDefaultContent,
1034
- ...props
1035
- }: TriggerProps): react_jsx_runtime0.JSX.Element;
1036
- interface ItemListProps extends Omit<React$2.ComponentProps<"div">, "children"> {
1037
- children?: React$2.ReactNode | ((files: FileUploadFile[]) => React$2.ReactNode);
1038
- }
1039
- declare function ItemList({
1040
- className,
1041
- children,
1042
- ...props
1043
- }: ItemListProps): react_jsx_runtime0.JSX.Element | null;
1044
- interface ItemProps extends React$2.ComponentProps<"div"> {
1045
- file: FileUploadFile;
1046
- /** Apply error styling based on file status */
1047
- statusStyles?: boolean;
1048
- }
1049
- declare function Item({
1050
- file,
1051
- className,
1052
- children,
1053
- statusStyles,
1054
- ...props
1055
- }: ItemProps): react_jsx_runtime0.JSX.Element;
1056
- interface ItemPreviewProps extends React$2.ComponentProps<"div"> {
1057
- /** Fallback icon when no preview is available */
1058
- fallback?: React$2.ReactNode;
1059
- }
1060
- declare function ItemPreview({
1005
+ interface HiddenInputProps extends Omit<React$2.ComponentProps<"input">, "type"> {}
1006
+ declare function HiddenInput({
1061
1007
  className,
1062
- fallback,
1063
1008
  ...props
1064
- }: ItemPreviewProps): react_jsx_runtime0.JSX.Element;
1065
- interface ItemNameProps extends React$2.ComponentProps<"span"> {}
1066
- declare function ItemName({
1067
- className,
1068
- ...props
1069
- }: ItemNameProps): react_jsx_runtime0.JSX.Element;
1070
- interface ItemSizeProps extends React$2.ComponentProps<"span"> {}
1071
- declare function ItemSize({
1072
- className,
1073
- ...props
1074
- }: ItemSizeProps): react_jsx_runtime0.JSX.Element;
1075
- interface ItemRemoveProps extends React$2.ComponentProps<typeof Button> {}
1076
- declare function ItemRemove({
1077
- className,
1078
- children,
1079
- ...props
1080
- }: ItemRemoveProps): react_jsx_runtime0.JSX.Element;
1081
- interface ItemProgressProps extends React$2.ComponentProps<"div"> {}
1082
- declare function ItemProgress({
1083
- className,
1084
- ...props
1085
- }: ItemProgressProps): react_jsx_runtime0.JSX.Element | null;
1086
- interface ItemStatusProps extends React$2.ComponentProps<"div"> {
1087
- /** Custom success icon */
1088
- successIcon?: React$2.ReactNode;
1089
- /** Custom uploading text/element */
1090
- uploadingContent?: React$2.ReactNode;
1091
- /** Custom error text/element */
1092
- errorContent?: React$2.ReactNode;
1009
+ }: HiddenInputProps): react_jsx_runtime0.JSX.Element;
1010
+ interface ListProps extends Omit<React$2.ComponentProps<"div">, "children"> {
1011
+ children?: React$2.ReactNode | ((files: FileUploadItem[]) => React$2.ReactNode);
1093
1012
  }
1094
- declare function ItemStatus({
1095
- className,
1096
- successIcon,
1097
- uploadingContent,
1098
- errorContent,
1099
- ...props
1100
- }: ItemStatusProps): react_jsx_runtime0.JSX.Element | null;
1101
- interface ItemErrorProps extends React$2.ComponentProps<"span"> {}
1102
- declare function ItemError({
1103
- className,
1104
- ...props
1105
- }: ItemErrorProps): react_jsx_runtime0.JSX.Element | null;
1106
- interface ItemRetryProps extends React$2.ComponentProps<typeof Button> {}
1107
- declare function ItemRetry({
1108
- className,
1109
- children,
1110
- ...props
1111
- }: ItemRetryProps): react_jsx_runtime0.JSX.Element | null;
1112
- interface ClearButtonProps extends React$2.ComponentProps<typeof Button> {}
1113
- declare function ClearButton({
1114
- children,
1115
- ...props
1116
- }: ClearButtonProps): react_jsx_runtime0.JSX.Element | null;
1117
- interface ImageGridProps extends Omit<React$2.ComponentProps<"div">, "children"> {
1118
- children?: React$2.ReactNode | ((files: FileUploadFile[]) => React$2.ReactNode);
1119
- }
1120
- declare function ImageGrid({
1013
+ declare function List({
1121
1014
  className,
1122
1015
  children,
1123
1016
  ...props
1124
- }: ImageGridProps): react_jsx_runtime0.JSX.Element | null;
1125
- interface ImageGridItemProps extends React$2.ComponentProps<"div"> {
1126
- file: FileUploadFile;
1127
- /** Show status overlays (uploading/error) */
1128
- showStatusOverlay?: boolean;
1017
+ }: ListProps): react_jsx_runtime0.JSX.Element | null;
1018
+ interface ListItemProps extends React$2.ComponentProps<"div"> {
1019
+ file: FileUploadItem;
1020
+ /** Show file type icon (default: true) */
1021
+ showIcon?: boolean;
1022
+ /** Show progress bar when uploading (default: true) */
1023
+ showProgress?: boolean;
1024
+ /** Show error message when error (default: true) */
1025
+ showError?: boolean;
1026
+ /** Show remove button (default: true) */
1027
+ showRemove?: boolean;
1028
+ /** Show retry button when error (default: true) */
1029
+ showRetry?: boolean;
1030
+ /** Custom icon component */
1031
+ icon?: React$2.ReactNode;
1032
+ /** Click handler for the list item */
1033
+ onItemClick?: (file: FileUploadItem) => void;
1129
1034
  }
1130
- declare function ImageGridItem({
1035
+ declare function ListItem({
1131
1036
  file,
1132
1037
  className,
1133
- showStatusOverlay,
1038
+ showIcon,
1039
+ showProgress,
1040
+ showError,
1041
+ showRemove,
1042
+ showRetry,
1043
+ icon,
1044
+ onItemClick,
1045
+ ...props
1046
+ }: ListItemProps): react_jsx_runtime0.JSX.Element;
1047
+ interface ClearAllProps extends React$2.ComponentProps<typeof Button> {}
1048
+ declare function ClearAll({
1049
+ children,
1134
1050
  ...props
1135
- }: ImageGridItemProps): react_jsx_runtime0.JSX.Element;
1051
+ }: ClearAllProps): react_jsx_runtime0.JSX.Element | null;
1136
1052
  declare const FileUpload: {
1137
1053
  Root: typeof Root;
1138
1054
  Dropzone: typeof Dropzone;
1139
- Trigger: typeof Trigger;
1140
- ItemList: typeof ItemList;
1141
- Item: typeof Item;
1142
- ItemPreview: typeof ItemPreview;
1143
- ItemName: typeof ItemName;
1144
- ItemSize: typeof ItemSize;
1145
- ItemRemove: typeof ItemRemove;
1146
- ItemProgress: typeof ItemProgress;
1147
- ItemStatus: typeof ItemStatus;
1148
- ItemError: typeof ItemError;
1149
- ItemRetry: typeof ItemRetry;
1150
- ClearButton: typeof ClearButton;
1151
- ImageGrid: typeof ImageGrid;
1152
- ImageGridItem: typeof ImageGridItem;
1055
+ HiddenInput: typeof HiddenInput;
1056
+ List: typeof List;
1057
+ ListItem: typeof ListItem;
1058
+ ClearAll: typeof ClearAll;
1153
1059
  };
1154
1060
  //#endregion
1155
1061
  //#region src/components/otp-input.d.ts
@@ -1198,6 +1104,59 @@ declare function StopIcon(props: React.ComponentProps<"svg">): react_jsx_runtime
1198
1104
  //#region src/icons/info-icon.d.ts
1199
1105
  declare function InfoIcon(props: React.ComponentProps<"svg">): react_jsx_runtime0.JSX.Element;
1200
1106
  //#endregion
1107
+ //#region src/icons/pdf-icon.d.ts
1108
+ declare function PdfIcon(props: React.ComponentProps<"svg">): react_jsx_runtime0.JSX.Element;
1109
+ //#endregion
1110
+ //#region src/icons/word-icon.d.ts
1111
+ declare function WordIcon(props: React.ComponentProps<"svg">): react_jsx_runtime0.JSX.Element;
1112
+ //#endregion
1113
+ //#region src/icons/excel-icon.d.ts
1114
+ declare function ExcelIcon(props: React.ComponentProps<"svg">): react_jsx_runtime0.JSX.Element;
1115
+ //#endregion
1116
+ //#region src/icons/image-file-icon.d.ts
1117
+ declare function ImageFileIcon(props: React.ComponentProps<"svg">): react_jsx_runtime0.JSX.Element;
1118
+ //#endregion
1119
+ //#region src/icons/video-icon.d.ts
1120
+ declare function VideoIcon(props: React.ComponentProps<"svg">): react_jsx_runtime0.JSX.Element;
1121
+ //#endregion
1122
+ //#region src/icons/audio-icon.d.ts
1123
+ declare function AudioIcon(props: React.ComponentProps<"svg">): react_jsx_runtime0.JSX.Element;
1124
+ //#endregion
1125
+ //#region src/icons/archive-icon.d.ts
1126
+ declare function ArchiveIcon(props: React.ComponentProps<"svg">): react_jsx_runtime0.JSX.Element;
1127
+ //#endregion
1128
+ //#region src/icons/code-file-icon.d.ts
1129
+ declare function CodeFileIcon(props: React.ComponentProps<"svg">): react_jsx_runtime0.JSX.Element;
1130
+ //#endregion
1131
+ //#region src/icons/text-file-icon.d.ts
1132
+ declare function TextFileIcon(props: React.ComponentProps<"svg">): react_jsx_runtime0.JSX.Element;
1133
+ //#endregion
1134
+ //#region src/icons/generic-file-icon.d.ts
1135
+ declare function GenericFileIcon(props: React.ComponentProps<"svg">): react_jsx_runtime0.JSX.Element;
1136
+ //#endregion
1137
+ //#region src/icons/get-file-type-icon.d.ts
1138
+ type FileInfo = {
1139
+ name: string;
1140
+ type?: string;
1141
+ };
1142
+ type IconComponent = React$1.ComponentType<React$1.ComponentProps<"svg">>;
1143
+ /**
1144
+ * Get the appropriate file type icon component for a file.
1145
+ * Uses MIME type first, then falls back to file extension.
1146
+ *
1147
+ * @param file - Object with name and optional type (MIME type)
1148
+ * @returns React icon component for the file type
1149
+ *
1150
+ * @example
1151
+ * ```tsx
1152
+ * import { getFileTypeIcon } from "@px-ui/core";
1153
+ *
1154
+ * const Icon = getFileTypeIcon({ name: "document.pdf", type: "application/pdf" });
1155
+ * <Icon className="size-5" />
1156
+ * ```
1157
+ */
1158
+ declare function getFileTypeIcon(file: FileInfo): IconComponent;
1159
+ //#endregion
1201
1160
  //#region src/hooks/use-intersection-observer.d.ts
1202
1161
  interface UseIntersectionObserverOptions {
1203
1162
  threshold?: number | number[];
@@ -1221,5 +1180,5 @@ declare function useIsMobile(): boolean;
1221
1180
  //#region src/utils/classnames.d.ts
1222
1181
  declare function cn(...inputs: ArgumentArray): string;
1223
1182
  //#endregion
1224
- export { Avatar, AvatarGroup, AvatarImpl, block_checkbox_group_d_exports as BlockCheckboxGroup, block_radio_group_d_exports as BlockRadioGroup, breadcrumbs_d_exports as Breadcrumbs, Button, Calendar, Checkbox, ChevronDownIcon, ClearButtonProps, collapsible_d_exports as Collapsible, combobox_d_exports as Combobox, DatePicker, dialog_d_exports as Dialog, DropzoneProps, FileIcon, FileMetadata, FileUpload, FileUploadActions, FileUploadFile, FileUploadOptions, FileUploadState, FileUploadWithUploaderActions, FileUploadWithUploaderOptions, FileUploadWithUploaderState, FileWithPreview, FileWithUploadStatus, ImageGridItemProps, ImageGridProps, InferOption, InferOptions, InfoIcon, Input, input_group_d_exports as InputGroup, ItemErrorProps, ItemListProps, ItemNameProps, ItemPreviewProps, ItemProgressProps, ItemProps, ItemRemoveProps, ItemRetryProps, ItemSizeProps, ItemStatusProps, Label, LoadOptionsConfig, menu_d_exports as Menu, OtpInput, PXUIProvider, popover_d_exports as Popover, PresignedUrlResponse, progress_d_exports as Progress, radio_group_d_exports as RadioGroup, RootProps, segmented_control_d_exports as SegmentedControl, select_d_exports as Select, SendIcon, Separator, Spinner, StopIcon, Switch, tabs_d_exports as Tabs, Textarea, TextareaProps, tooltip_d_exports as Tooltip, TriggerProps, UploadConfig, UploadIcon, UploadStatus, UseInfiniteScrollHookArgs, UseIntersectionObserverOptions, UseIntersectionObserverReturn, anchoredToast, buttonVariants, cn, defineLoadOptions, formatBytes, toast, useAsyncOptions, useFileUpload, useIntersectionObserver, useIsMobile };
1183
+ export { ArchiveIcon, AudioIcon, Avatar, AvatarGroup, AvatarImpl, block_checkbox_group_d_exports as BlockCheckboxGroup, block_radio_group_d_exports as BlockRadioGroup, breadcrumbs_d_exports as Breadcrumbs, Button, Calendar, Checkbox, ChevronDownIcon, ClearAllProps, CodeFileIcon, collapsible_d_exports as Collapsible, combobox_d_exports as Combobox, DatePicker, dialog_d_exports as Dialog, DropzoneProps, DropzoneRenderProps, DropzoneState, ExcelIcon, FileIcon, FileMetadata, FileUpload, FileUploadItem, FileUploadOptions, FileUploadWithUploaderOptions, FileWithPreview, FileWithUploadStatus, GenericFileIcon, HiddenInputProps, ImageFileIcon, InferOption, InferOptions, InfoIcon, Input, input_group_d_exports as InputGroup, Label, ListItemProps, ListProps, LoadOptionsConfig, menu_d_exports as Menu, OtpInput, PXUIProvider, PdfIcon, popover_d_exports as Popover, PresignedUrlResponse, progress_d_exports as Progress, radio_group_d_exports as RadioGroup, RootProps, segmented_control_d_exports as SegmentedControl, select_d_exports as Select, SendIcon, Separator, Spinner, StopIcon, Switch, tabs_d_exports as Tabs, TextFileIcon, Textarea, TextareaProps, tooltip_d_exports as Tooltip, UploadConfig, UploadIcon, UploadStatus, UseFileUploadOptions, UseFileUploadReturn, UseInfiniteScrollHookArgs, UseIntersectionObserverOptions, UseIntersectionObserverReturn, VideoIcon, WordIcon, anchoredToast, buttonVariants, cn, defineLoadOptions, formatBytes, getFileTypeIcon, toast, useAsyncOptions, useFileUpload, useIntersectionObserver, useIsMobile };
1225
1184
  //# sourceMappingURL=index.d.ts.map