@aurora-ds/components 0.23.5 → 0.24.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.
Files changed (29) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/components/forms/file-picker/FilePicker.d.ts +24 -0
  3. package/dist/cjs/components/forms/file-picker/FilePicker.props.d.ts +99 -0
  4. package/dist/cjs/components/forms/file-picker/FilePicker.styles.d.ts +18 -0
  5. package/dist/cjs/components/forms/file-picker/index.d.ts +2 -0
  6. package/dist/cjs/components/forms/image-picker/ImagePicker.d.ts +18 -0
  7. package/dist/cjs/components/forms/image-picker/ImagePicker.props.d.ts +76 -0
  8. package/dist/cjs/components/forms/image-picker/index.d.ts +2 -0
  9. package/dist/cjs/components/index.d.ts +2 -0
  10. package/dist/cjs/index.js +154 -4
  11. package/dist/cjs/index.js.map +1 -1
  12. package/dist/cjs/resources/Icons.d.ts +3 -1
  13. package/dist/cjs/resources/icons/PlusIcon.d.ts +2 -0
  14. package/dist/cjs/resources/icons/TrashIcon.d.ts +2 -0
  15. package/dist/esm/components/forms/file-picker/FilePicker.d.ts +24 -0
  16. package/dist/esm/components/forms/file-picker/FilePicker.props.d.ts +99 -0
  17. package/dist/esm/components/forms/file-picker/FilePicker.styles.d.ts +18 -0
  18. package/dist/esm/components/forms/file-picker/index.d.ts +2 -0
  19. package/dist/esm/components/forms/image-picker/ImagePicker.d.ts +18 -0
  20. package/dist/esm/components/forms/image-picker/ImagePicker.props.d.ts +76 -0
  21. package/dist/esm/components/forms/image-picker/index.d.ts +2 -0
  22. package/dist/esm/components/index.d.ts +2 -0
  23. package/dist/esm/index.js +153 -5
  24. package/dist/esm/index.js.map +1 -1
  25. package/dist/esm/resources/Icons.d.ts +3 -1
  26. package/dist/esm/resources/icons/PlusIcon.d.ts +2 -0
  27. package/dist/esm/resources/icons/TrashIcon.d.ts +2 -0
  28. package/dist/index.d.ts +216 -3
  29. package/package.json +1 -1
@@ -10,4 +10,6 @@ import { EyeIcon } from '@resources/icons/EyeIcon.tsx';
10
10
  import { EyeOffIcon } from '@resources/icons/EyeOffIcon.tsx';
11
11
  import { InfoIcon } from '@resources/icons/InfoIcon.tsx';
12
12
  import { MoreHorizontalIcon } from '@resources/icons/MoreHorizontalIcon.tsx';
13
- export { AlertCircleIcon, AlertTriangleIcon, CalendarIcon, CheckCircleIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, InfoIcon, MoreHorizontalIcon, EyeIcon, EyeOffIcon, CloseIcon };
13
+ import { PlusIcon } from '@resources/icons/PlusIcon.tsx';
14
+ import { TrashIcon } from '@resources/icons/TrashIcon.tsx';
15
+ export { AlertCircleIcon, AlertTriangleIcon, CalendarIcon, CheckCircleIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, InfoIcon, MoreHorizontalIcon, EyeIcon, EyeOffIcon, CloseIcon, PlusIcon, TrashIcon };
@@ -0,0 +1,2 @@
1
+ import { FC } from 'react';
2
+ export declare const PlusIcon: FC;
@@ -0,0 +1,2 @@
1
+ import { FC } from 'react';
2
+ export declare const TrashIcon: FC;
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as react from 'react';
2
- import { PropsWithChildren, FC, ReactNode, MouseEvent, CSSProperties, FormEvent, DragEvent, ComponentPropsWithoutRef, ReactElement, RefObject } from 'react';
2
+ import { PropsWithChildren, FC, ReactNode, MouseEvent, CSSProperties, FormEvent, ComponentType, SVGProps, DragEvent, ComponentPropsWithoutRef, ReactElement, RefObject } from 'react';
3
3
 
4
4
  /**
5
5
  * Alert variant types
@@ -818,6 +818,219 @@ type DatePickerProps = {
818
818
 
819
819
  declare const _default: react.NamedExoticComponent<DatePickerProps>;
820
820
 
821
+ /**
822
+ * SVG icon component type (compatible with Aurora-DS Icon)
823
+ */
824
+ type SvgIconComponent = ComponentType<SVGProps<SVGSVGElement>>;
825
+ type FilePickerProps = {
826
+ /**
827
+ * Label for the input
828
+ */
829
+ label?: string;
830
+ /**
831
+ * Accepted file types (MIME types)
832
+ * @example 'image/jpeg,image/png,image/webp'
833
+ * @example 'application/pdf'
834
+ * @example '.jpg,.png,.pdf'
835
+ */
836
+ accept?: string;
837
+ /**
838
+ * Preview content to display when a file is selected
839
+ * Can be a URL string for images or a ReactNode for custom preview
840
+ */
841
+ preview?: string | ReactNode | null;
842
+ /**
843
+ * Whether the preview is an image URL
844
+ * @default true when preview is a string
845
+ */
846
+ previewIsImage?: boolean;
847
+ /**
848
+ * Alt text for image preview
849
+ */
850
+ previewAlt?: string;
851
+ /**
852
+ * Error message to display
853
+ */
854
+ error?: string | null;
855
+ /**
856
+ * Callback when a file is selected
857
+ */
858
+ onSelect: (file: File | null) => void;
859
+ /**
860
+ * Callback when the file is cleared
861
+ */
862
+ onClear: () => void;
863
+ /**
864
+ * Whether the input is disabled
865
+ */
866
+ disabled?: boolean;
867
+ /**
868
+ * Placeholder text shown in the dropzone
869
+ */
870
+ placeholder?: string;
871
+ /**
872
+ * Hint text shown below the placeholder (e.g., accepted formats)
873
+ */
874
+ hint?: string;
875
+ /**
876
+ * Icon component to display in the dropzone
877
+ * Should be an SVG component (e.g., from @resources/Icons)
878
+ */
879
+ icon?: SvgIconComponent;
880
+ /**
881
+ * Icon component to display on the clear button
882
+ * Should be an SVG component (e.g., from @resources/Icons)
883
+ */
884
+ clearIcon?: SvgIconComponent;
885
+ /**
886
+ * Aria label for the clear button
887
+ */
888
+ clearAriaLabel?: string;
889
+ /**
890
+ * Width of the FilePicker container
891
+ * @example '400px'
892
+ * @example '100%'
893
+ */
894
+ width?: CSSProperties['width'];
895
+ /**
896
+ * Height of the dropzone (when no preview)
897
+ * @example '200px'
898
+ * @default '120px'
899
+ */
900
+ dropzoneHeight?: CSSProperties['height'];
901
+ /**
902
+ * Max height of the preview image
903
+ * @example '300px'
904
+ * @default '200px'
905
+ */
906
+ previewMaxHeight?: CSSProperties['maxHeight'];
907
+ /**
908
+ * Max width of the preview image
909
+ * @example '400px'
910
+ * @default '100%'
911
+ */
912
+ previewMaxWidth?: CSSProperties['maxWidth'];
913
+ /**
914
+ * Object fit for the preview image
915
+ * @default 'cover'
916
+ */
917
+ previewObjectFit?: CSSProperties['objectFit'];
918
+ };
919
+
920
+ /**
921
+ * Generic file picker component with drag-and-drop style interface.
922
+ * Supports custom preview, icons, and styling for use in external libraries.
923
+ *
924
+ * @example
925
+ * ```tsx
926
+ * // Basic usage with image
927
+ * <FilePicker
928
+ * label="Upload Image"
929
+ * accept="image/*"
930
+ * preview={imagePreview}
931
+ * placeholder="Click to upload"
932
+ * hint="JPEG, PNG or WebP"
933
+ * icon={PlusIcon}
934
+ * clearIcon={TrashIcon}
935
+ * onSelect={handleSelect}
936
+ * onClear={handleClear}
937
+ * />
938
+ * ```
939
+ */
940
+ declare const FilePicker: FC<FilePickerProps>;
941
+
942
+ type ImagePickerProps = {
943
+ /**
944
+ * Label for the input
945
+ */
946
+ label?: string;
947
+ /**
948
+ * Preview URL of the selected image
949
+ */
950
+ preview: string | null;
951
+ /**
952
+ * Error message to display
953
+ */
954
+ error?: string | null;
955
+ /**
956
+ * Callback when a file is selected
957
+ */
958
+ onSelect: (file: File | null) => void;
959
+ /**
960
+ * Callback when the image is cleared
961
+ */
962
+ onClear: () => void;
963
+ /**
964
+ * Whether the input is disabled
965
+ */
966
+ disabled?: boolean;
967
+ /**
968
+ * Placeholder text shown in the dropzone
969
+ * @default 'Click to upload an image'
970
+ */
971
+ placeholder?: string;
972
+ /**
973
+ * Hint text shown below the placeholder
974
+ * @default 'JPEG, PNG or WebP'
975
+ */
976
+ hint?: string;
977
+ /**
978
+ * Alt text for image preview
979
+ * @default 'Image preview'
980
+ */
981
+ previewAlt?: string;
982
+ /**
983
+ * Aria label for the clear button
984
+ * @default 'Remove image'
985
+ */
986
+ clearAriaLabel?: string;
987
+ /**
988
+ * Width of the ImagePicker container
989
+ * @example '400px'
990
+ * @example '100%'
991
+ */
992
+ width?: CSSProperties['width'];
993
+ /**
994
+ * Height of the dropzone (when no preview)
995
+ * @example '200px'
996
+ * @default '120px'
997
+ */
998
+ dropzoneHeight?: CSSProperties['height'];
999
+ /**
1000
+ * Max height of the preview image
1001
+ * @example '300px'
1002
+ * @default '200px'
1003
+ */
1004
+ previewMaxHeight?: CSSProperties['maxHeight'];
1005
+ /**
1006
+ * Max width of the preview image
1007
+ * @example '400px'
1008
+ * @default '100%'
1009
+ */
1010
+ previewMaxWidth?: CSSProperties['maxWidth'];
1011
+ /**
1012
+ * Object fit for the preview image
1013
+ * @default 'cover'
1014
+ */
1015
+ previewObjectFit?: CSSProperties['objectFit'];
1016
+ };
1017
+
1018
+ /**
1019
+ * Image picker component built on top of the generic FilePicker.
1020
+ * Pre-configured for image uploads with JPEG, PNG, and WebP support.
1021
+ *
1022
+ * @example
1023
+ * ```tsx
1024
+ * <ImagePicker
1025
+ * label="Profile Picture"
1026
+ * preview={imageUrl}
1027
+ * onSelect={handleImageSelect}
1028
+ * onClear={handleImageClear}
1029
+ * />
1030
+ * ```
1031
+ */
1032
+ declare const ImagePicker: FC<ImagePickerProps>;
1033
+
821
1034
  type BoxProps = {
822
1035
  /** Box children elements */
823
1036
  children?: ReactNode;
@@ -1707,5 +1920,5 @@ declare module '@aurora-ds/theme' {
1707
1920
  */
1708
1921
  declare const defaultTheme: Theme;
1709
1922
 
1710
- export { Accordion, Alert, AlertProvider, Avatar, AvatarGroup, Box, Breadcrumb, BreadcrumbEllipsis, BreadcrumbLink, BreadcrumbPage, BreadcrumbSeparator, Button, ButtonToggle, ButtonToggleGroup, Card, _default as DatePicker, DrawerItem, _default$3 as Form, Grid, Icon, IconButton, _default$2 as Input, Menu, MenuGroup, MenuItem, Modal, Page, PageSection, Pagination, Select, Separator, Skeleton, Stack, Status, TabItem, Tabs, Text, _default$1 as TextArea, defaultTheme, useAlert, useAnchorPosition, useClickOutside, useTransitionRender };
1711
- export type { AccordionProps, AlertContextValue, AlertPosition, AlertProps, AlertProviderProps, AlertVariant, AnchorOrigin, AnchorPosition, AvatarGroupProps, AvatarProps, BoxProps, BreadcrumbEllipsisProps, BreadcrumbLinkProps, BreadcrumbPageProps, BreadcrumbProps, BreadcrumbSeparatorProps, ButtonProps, ButtonToggleGroupProps, ButtonToggleProps, ButtonVariantStyle, ButtonVariants, CardProps, DateFormat, DatePickerProps, DrawerItemProps, FormProps, GridProps, IconButtonProps, IconProps, InputProps, MenuGroupProps, MenuItemProps, MenuProps, ModalProps, PageProps, PageSectionProps, PaginationProps, SelectOption, SelectProps, SeparatorProps, ShowAlertOptions, SkeletonProps, StackProps, StatusColor, StatusProps, StatusSize, StatusVariant, TabItemProps, TabsProps, TextAreaProps, TextProps, TextVariantStyle, TextVariants, Theme, ThemeBreakpointsContract, ThemeColorContract, ThemeContract, ThemeFontSizeContract, ThemeFontWeightContract, ThemeLineHeightContract, ThemeOpacityContract, ThemeRadiusContract, ThemeShadowsContract, ThemeSpacingContract, ThemeTransitionContract, ThemeZIndexContract, UseTransitionRenderReturnType };
1923
+ export { Accordion, Alert, AlertProvider, Avatar, AvatarGroup, Box, Breadcrumb, BreadcrumbEllipsis, BreadcrumbLink, BreadcrumbPage, BreadcrumbSeparator, Button, ButtonToggle, ButtonToggleGroup, Card, _default as DatePicker, DrawerItem, FilePicker, _default$3 as Form, Grid, Icon, IconButton, ImagePicker, _default$2 as Input, Menu, MenuGroup, MenuItem, Modal, Page, PageSection, Pagination, Select, Separator, Skeleton, Stack, Status, TabItem, Tabs, Text, _default$1 as TextArea, defaultTheme, useAlert, useAnchorPosition, useClickOutside, useTransitionRender };
1924
+ export type { AccordionProps, AlertContextValue, AlertPosition, AlertProps, AlertProviderProps, AlertVariant, AnchorOrigin, AnchorPosition, AvatarGroupProps, AvatarProps, BoxProps, BreadcrumbEllipsisProps, BreadcrumbLinkProps, BreadcrumbPageProps, BreadcrumbProps, BreadcrumbSeparatorProps, ButtonProps, ButtonToggleGroupProps, ButtonToggleProps, ButtonVariantStyle, ButtonVariants, CardProps, DateFormat, DatePickerProps, DrawerItemProps, FilePickerProps, FormProps, GridProps, IconButtonProps, IconProps, ImagePickerProps, InputProps, MenuGroupProps, MenuItemProps, MenuProps, ModalProps, PageProps, PageSectionProps, PaginationProps, SelectOption, SelectProps, SeparatorProps, ShowAlertOptions, SkeletonProps, StackProps, StatusColor, StatusProps, StatusSize, StatusVariant, TabItemProps, TabsProps, TextAreaProps, TextProps, TextVariantStyle, TextVariants, Theme, ThemeBreakpointsContract, ThemeColorContract, ThemeContract, ThemeFontSizeContract, ThemeFontWeightContract, ThemeLineHeightContract, ThemeOpacityContract, ThemeRadiusContract, ThemeShadowsContract, ThemeSpacingContract, ThemeTransitionContract, ThemeZIndexContract, UseTransitionRenderReturnType };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aurora-ds/components",
3
- "version": "0.23.5",
3
+ "version": "0.24.0",
4
4
  "type": "module",
5
5
  "description": "Aurora DS - React Components Library",
6
6
  "main": "dist/cjs/index.js",