@ikatec/nebula-react 1.0.24 → 1.0.26
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 +32 -2
- package/dist/index.d.ts +32 -2
- package/dist/index.js +335 -184
- package/dist/index.mjs +333 -186
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as class_variance_authority_dist_types from 'class-variance-authority/dist/types';
|
|
2
2
|
import * as React$1 from 'react';
|
|
3
|
-
import React__default, { ComponentProps, PropsWithChildren, HTMLAttributes, ReactNode } from 'react';
|
|
3
|
+
import React__default, { ComponentProps, PropsWithChildren, HTMLAttributes, ReactNode, DragEvent, ChangeEvent, InputHTMLAttributes, MutableRefObject } from 'react';
|
|
4
4
|
import { VariantProps } from 'class-variance-authority';
|
|
5
5
|
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
6
6
|
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
@@ -593,6 +593,7 @@ interface InputDatePickerSingleProps extends Omit<InputTextProps, 'onChange' | '
|
|
|
593
593
|
className?: string;
|
|
594
594
|
disabledDates?: CalendarProps['disabled'];
|
|
595
595
|
onClean?: VoidFunction;
|
|
596
|
+
popoverContainer?: HTMLElement | null;
|
|
596
597
|
}
|
|
597
598
|
declare const dateIsAvailable: (inputDate?: Date | null, disabledDates?: InputDatePickerSingleProps["disabledDates"]) => boolean;
|
|
598
599
|
declare const InputDatePickerSingle: ({ placeholder, className, value, onChange, numberOfMonths, onClean, disabledDates, ...rest }: InputDatePickerSingleProps) => react_jsx_runtime.JSX.Element;
|
|
@@ -639,6 +640,30 @@ declare enum FileUploadError {
|
|
|
639
640
|
MAXIMUM_FILE_SIZE_EXCEEDED = "MAXIMUM_FILE_SIZE_EXCEEDED",
|
|
640
641
|
INVALID_FORMAT = "INVALID_FORMAT"
|
|
641
642
|
}
|
|
643
|
+
type FileUploadState = {
|
|
644
|
+
files: FileWithPreview[];
|
|
645
|
+
isDragging: boolean;
|
|
646
|
+
errors: {
|
|
647
|
+
file?: File | FileMetadata;
|
|
648
|
+
error: FileUploadError;
|
|
649
|
+
}[];
|
|
650
|
+
};
|
|
651
|
+
type FileUploadActions = {
|
|
652
|
+
addFiles: (files: FileList | File[]) => void;
|
|
653
|
+
removeFile: (id: string) => void;
|
|
654
|
+
clearFiles: () => void;
|
|
655
|
+
clearErrors: () => void;
|
|
656
|
+
handleDragEnter: (e: DragEvent<HTMLElement>) => void;
|
|
657
|
+
handleDragLeave: (e: DragEvent<HTMLElement>) => void;
|
|
658
|
+
handleDragOver: (e: DragEvent<HTMLElement>) => void;
|
|
659
|
+
handleDrop: (e: DragEvent<HTMLElement>) => void;
|
|
660
|
+
handleFileChange: (e: ChangeEvent<HTMLInputElement>) => void;
|
|
661
|
+
openFileDialog: () => void;
|
|
662
|
+
getInputProps: (props?: InputHTMLAttributes<HTMLInputElement>) => InputHTMLAttributes<HTMLInputElement> & {
|
|
663
|
+
ref: React__default.Ref<HTMLInputElement>;
|
|
664
|
+
};
|
|
665
|
+
};
|
|
666
|
+
declare const useFileUpload: (options?: FileUploadOptions) => [FileUploadState, FileUploadActions];
|
|
642
667
|
declare const formatBytes: (bytes: number, decimals?: number) => string;
|
|
643
668
|
|
|
644
669
|
interface FileUploadProps extends Omit<FileUploadOptions, 'maxSize'> {
|
|
@@ -742,4 +767,9 @@ declare const NebulaI18nProvider: ({ children, customI18nStorageKey, }: NebulaI1
|
|
|
742
767
|
*/
|
|
743
768
|
declare const useNebulaI18n: () => NebulaI18nContextType;
|
|
744
769
|
|
|
745
|
-
|
|
770
|
+
type PossibleRefs<T extends HTMLElement> = MutableRefObject<T | undefined | null> | MutableRefObject<T | undefined | null>[];
|
|
771
|
+
declare function useClickOutside<T extends HTMLElement>(refs: PossibleRefs<T>, onClickOutside: VoidFunction): void;
|
|
772
|
+
|
|
773
|
+
declare function useKeyPress(key: string, callback: VoidFunction): void;
|
|
774
|
+
|
|
775
|
+
export { Accordion, AccordionContent, AccordionDescription, AccordionItem, type AccordionProps, AccordionTitle, AccordionTrigger, ActionBar, ActionBarButton, ActionBarClose, ActionBarContent, ActionBarDivider, ActionBarPortal, ActionBarTrigger, Alert, AlertButton, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger, type AlertProps, AlertTitle, StyledAsync as Async, StyledAsyncCreatable as AsyncCreatable, Badge, type BadgeProps, Box, type BoxProps, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, type ButtonProps, Calendar, type CalendarProps, Caption, type CaptionProps, Checkbox, type CheckboxProps, StyledCreatable as Creatable, Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, Drawer, DrawerBody, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, type FileMetadata, FileUpload, type FileUploadActions, FileUploadError, type FileUploadOptions, type FileUploadState, type FileWithPreview, Heading, type HeadingProps, InputDatePickerSingle, type InputDatePickerSingleProps, InputDateTimePickerSingle, type InputDateTimePickerSingleProps, InputPhone, InputText, type InputTextProps, InputTime, type InputTimeProps, Label, Link, type LinkProps, NebulaI18nProvider, type NebulaI18nProviderProps, Pagination, type PaginationProps, Paragraph, type ParagraphProps, Popover, PopoverContent, type PopoverContentProps, PopoverTrigger, StyledSelect as Select, type CreateStyledSelectProps as SelectProps, Separator, type SeparatorProps, Skeleton, type SkeletonProps, Space, SpaceDirectionEnum, type SpaceProps, SpaceSizeEnum, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Tag, type TagProps, TextArea, type TextAreaProps, Toaster, Tooltip, type TooltipProps, alertVariants, badgeSizeEnum, badgeVariantEnum, buttonSizeEnum, buttonVariantEnum, buttonVariantsConfig, dateIsAvailable, formatBytes, getNebulaLanguage, localeByi18nKey, messages, separatorVariants, setNebulaLanguage, tagVariantsEnum, tailwind, toast, useClickOutside, useFileUpload, useKeyPress, useNebulaI18n };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as class_variance_authority_dist_types from 'class-variance-authority/dist/types';
|
|
2
2
|
import * as React$1 from 'react';
|
|
3
|
-
import React__default, { ComponentProps, PropsWithChildren, HTMLAttributes, ReactNode } from 'react';
|
|
3
|
+
import React__default, { ComponentProps, PropsWithChildren, HTMLAttributes, ReactNode, DragEvent, ChangeEvent, InputHTMLAttributes, MutableRefObject } from 'react';
|
|
4
4
|
import { VariantProps } from 'class-variance-authority';
|
|
5
5
|
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
6
6
|
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
@@ -593,6 +593,7 @@ interface InputDatePickerSingleProps extends Omit<InputTextProps, 'onChange' | '
|
|
|
593
593
|
className?: string;
|
|
594
594
|
disabledDates?: CalendarProps['disabled'];
|
|
595
595
|
onClean?: VoidFunction;
|
|
596
|
+
popoverContainer?: HTMLElement | null;
|
|
596
597
|
}
|
|
597
598
|
declare const dateIsAvailable: (inputDate?: Date | null, disabledDates?: InputDatePickerSingleProps["disabledDates"]) => boolean;
|
|
598
599
|
declare const InputDatePickerSingle: ({ placeholder, className, value, onChange, numberOfMonths, onClean, disabledDates, ...rest }: InputDatePickerSingleProps) => react_jsx_runtime.JSX.Element;
|
|
@@ -639,6 +640,30 @@ declare enum FileUploadError {
|
|
|
639
640
|
MAXIMUM_FILE_SIZE_EXCEEDED = "MAXIMUM_FILE_SIZE_EXCEEDED",
|
|
640
641
|
INVALID_FORMAT = "INVALID_FORMAT"
|
|
641
642
|
}
|
|
643
|
+
type FileUploadState = {
|
|
644
|
+
files: FileWithPreview[];
|
|
645
|
+
isDragging: boolean;
|
|
646
|
+
errors: {
|
|
647
|
+
file?: File | FileMetadata;
|
|
648
|
+
error: FileUploadError;
|
|
649
|
+
}[];
|
|
650
|
+
};
|
|
651
|
+
type FileUploadActions = {
|
|
652
|
+
addFiles: (files: FileList | File[]) => void;
|
|
653
|
+
removeFile: (id: string) => void;
|
|
654
|
+
clearFiles: () => void;
|
|
655
|
+
clearErrors: () => void;
|
|
656
|
+
handleDragEnter: (e: DragEvent<HTMLElement>) => void;
|
|
657
|
+
handleDragLeave: (e: DragEvent<HTMLElement>) => void;
|
|
658
|
+
handleDragOver: (e: DragEvent<HTMLElement>) => void;
|
|
659
|
+
handleDrop: (e: DragEvent<HTMLElement>) => void;
|
|
660
|
+
handleFileChange: (e: ChangeEvent<HTMLInputElement>) => void;
|
|
661
|
+
openFileDialog: () => void;
|
|
662
|
+
getInputProps: (props?: InputHTMLAttributes<HTMLInputElement>) => InputHTMLAttributes<HTMLInputElement> & {
|
|
663
|
+
ref: React__default.Ref<HTMLInputElement>;
|
|
664
|
+
};
|
|
665
|
+
};
|
|
666
|
+
declare const useFileUpload: (options?: FileUploadOptions) => [FileUploadState, FileUploadActions];
|
|
642
667
|
declare const formatBytes: (bytes: number, decimals?: number) => string;
|
|
643
668
|
|
|
644
669
|
interface FileUploadProps extends Omit<FileUploadOptions, 'maxSize'> {
|
|
@@ -742,4 +767,9 @@ declare const NebulaI18nProvider: ({ children, customI18nStorageKey, }: NebulaI1
|
|
|
742
767
|
*/
|
|
743
768
|
declare const useNebulaI18n: () => NebulaI18nContextType;
|
|
744
769
|
|
|
745
|
-
|
|
770
|
+
type PossibleRefs<T extends HTMLElement> = MutableRefObject<T | undefined | null> | MutableRefObject<T | undefined | null>[];
|
|
771
|
+
declare function useClickOutside<T extends HTMLElement>(refs: PossibleRefs<T>, onClickOutside: VoidFunction): void;
|
|
772
|
+
|
|
773
|
+
declare function useKeyPress(key: string, callback: VoidFunction): void;
|
|
774
|
+
|
|
775
|
+
export { Accordion, AccordionContent, AccordionDescription, AccordionItem, type AccordionProps, AccordionTitle, AccordionTrigger, ActionBar, ActionBarButton, ActionBarClose, ActionBarContent, ActionBarDivider, ActionBarPortal, ActionBarTrigger, Alert, AlertButton, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger, type AlertProps, AlertTitle, StyledAsync as Async, StyledAsyncCreatable as AsyncCreatable, Badge, type BadgeProps, Box, type BoxProps, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, type ButtonProps, Calendar, type CalendarProps, Caption, type CaptionProps, Checkbox, type CheckboxProps, StyledCreatable as Creatable, Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, Drawer, DrawerBody, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, type FileMetadata, FileUpload, type FileUploadActions, FileUploadError, type FileUploadOptions, type FileUploadState, type FileWithPreview, Heading, type HeadingProps, InputDatePickerSingle, type InputDatePickerSingleProps, InputDateTimePickerSingle, type InputDateTimePickerSingleProps, InputPhone, InputText, type InputTextProps, InputTime, type InputTimeProps, Label, Link, type LinkProps, NebulaI18nProvider, type NebulaI18nProviderProps, Pagination, type PaginationProps, Paragraph, type ParagraphProps, Popover, PopoverContent, type PopoverContentProps, PopoverTrigger, StyledSelect as Select, type CreateStyledSelectProps as SelectProps, Separator, type SeparatorProps, Skeleton, type SkeletonProps, Space, SpaceDirectionEnum, type SpaceProps, SpaceSizeEnum, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Tag, type TagProps, TextArea, type TextAreaProps, Toaster, Tooltip, type TooltipProps, alertVariants, badgeSizeEnum, badgeVariantEnum, buttonSizeEnum, buttonVariantEnum, buttonVariantsConfig, dateIsAvailable, formatBytes, getNebulaLanguage, localeByi18nKey, messages, separatorVariants, setNebulaLanguage, tagVariantsEnum, tailwind, toast, useClickOutside, useFileUpload, useKeyPress, useNebulaI18n };
|