@loadsmart/loadsmart-ui 8.0.4 → 8.0.6

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 (43) hide show
  1. package/dist/components/Accordion/Accordion.d.ts +4 -3
  2. package/dist/components/Calendar/Calendar.types.d.ts +19 -19
  3. package/dist/components/Calendar/index.d.ts +1 -1
  4. package/dist/components/DatePicker/DatePicker.types.d.ts +19 -19
  5. package/dist/components/Dialog/useDialog.d.ts +3 -3
  6. package/dist/components/DragDropFile/types.d.ts +27 -27
  7. package/dist/components/Drawer/Drawer.d.ts +13 -10
  8. package/dist/components/Dropdown/Dropdown.types.d.ts +19 -19
  9. package/dist/components/Dropdown/useDropdown.d.ts +6 -6
  10. package/dist/components/EmptyState/EmptyState.types.d.ts +18 -18
  11. package/dist/components/HighlightMatch/HighlightMatch.d.ts +2 -2
  12. package/dist/components/Modal/Modal.d.ts +12 -10
  13. package/dist/components/Pagination/Pagination.types.d.ts +20 -20
  14. package/dist/components/Popover/Popover.types.d.ts +6 -5
  15. package/dist/components/Select/Select.types.d.ts +32 -32
  16. package/dist/components/SideNavigation/Logo/Logo.d.ts +4 -3
  17. package/dist/components/SideNavigation/Menu/Menu.d.ts +3 -2
  18. package/dist/components/SideNavigation/Menu/MenuBaseItem.d.ts +2 -2
  19. package/dist/components/SideNavigation/Menu/MenuExpandable.d.ts +4 -3
  20. package/dist/components/SideNavigation/Menu/MenuLink.d.ts +2 -2
  21. package/dist/components/SideNavigation/SideNavigation.d.ts +2 -10
  22. package/dist/components/SideNavigation/useSideNavigation.d.ts +4 -4
  23. package/dist/components/Steps/ProgressSteps/ProgressStep.d.ts +2 -2
  24. package/dist/components/Steps/Steps.d.ts +3 -2
  25. package/dist/components/Steps/Steps.types.d.ts +3 -3
  26. package/dist/components/Steps/StepsStep.d.ts +3 -2
  27. package/dist/components/Steps/useSteps.d.ts +4 -4
  28. package/dist/components/Table/Selection.d.ts +9 -8
  29. package/dist/components/Table/Table.types.d.ts +33 -32
  30. package/dist/components/Table/index.d.ts +1 -0
  31. package/dist/components/TablePagination/TablePagination.types.d.ts +17 -17
  32. package/dist/components/Tabs/Tabs.types.d.ts +2 -2
  33. package/dist/components/Tooltip/Tooltip.d.ts +3 -2
  34. package/dist/components/TopNavigation/Logo/Logo.d.ts +4 -3
  35. package/dist/components/TopNavigation/Menu/Menu.d.ts +7 -5
  36. package/dist/components/TopNavigation/Menu/MenuItemDropdown.d.ts +6 -5
  37. package/dist/hooks/useFocusTrap/useFocusTrap.d.ts +3 -3
  38. package/dist/hooks/useFocusWithin/useFocusWithin.d.ts +2 -2
  39. package/dist/hooks/useSelectable/useSelectable.types.d.ts +4 -4
  40. package/dist/index.d.ts +5 -4
  41. package/dist/index.js +10 -9
  42. package/dist/index.js.map +1 -1
  43. package/package.json +9 -9
@@ -1,11 +1,12 @@
1
- import { default as React, PropsWithChildren, HTMLAttributes, ReactNode } from 'react';
1
+ import { default as React, HTMLAttributes, ReactNode } from 'react';
2
2
  export interface AccordionToggleProps {
3
3
  readonly leading?: ReactNode | ((expanded: boolean) => ReactNode);
4
4
  readonly trailing?: ReactNode | ((expanded: boolean) => ReactNode);
5
+ readonly children?: ReactNode;
5
6
  }
6
- declare function AccordionToggle({ leading, trailing: propsTrailing, children, }: PropsWithChildren<AccordionToggleProps>): React.JSX.Element;
7
+ declare function AccordionToggle({ leading, trailing: propsTrailing, children }: AccordionToggleProps): React.JSX.Element;
7
8
  export type AccordionBodyProps = HTMLAttributes<HTMLElement>;
8
- declare function AccordionBody({ children, ...props }: PropsWithChildren<AccordionBodyProps>): React.JSX.Element;
9
+ declare function AccordionBody({ children, ...props }: AccordionBodyProps): React.JSX.Element;
9
10
  export interface AccordionProps extends HTMLAttributes<HTMLElement> {
10
11
  readonly expanded?: boolean;
11
12
  readonly initialExpanded?: boolean;
@@ -7,12 +7,12 @@ export interface RenderableMonth {
7
7
  }
8
8
  export type CalendarMode = 'single' | 'range';
9
9
  export interface useCalendarProps {
10
- year?: number;
11
- month?: number;
12
- mode?: CalendarMode;
13
- selected?: null | [string | number | null, string | number | null];
14
- onSelect?: (selection: [string | null, string | null]) => void;
15
- constraints?: CalendarConstraint | CalendarConstraint[];
10
+ readonly year?: number;
11
+ readonly month?: number;
12
+ readonly mode?: CalendarMode;
13
+ readonly selected?: null | [string | number | null, string | number | null];
14
+ readonly onSelect?: (selection: [string | null, string | null]) => void;
15
+ readonly constraints?: CalendarConstraint | CalendarConstraint[];
16
16
  }
17
17
  export interface useCalendarReturn {
18
18
  mode: CalendarMode;
@@ -35,14 +35,14 @@ export type PickerModeAction = {
35
35
  payload: PickerMode;
36
36
  };
37
37
  export interface usePickerModeProps {
38
- mode: PickerMode;
38
+ readonly mode: PickerMode;
39
39
  }
40
40
  export interface CalendarPickerProps {
41
- calendar: useCalendarReturn;
42
- mode: usePickerModeReturn;
43
- onDayClick?: (timestamp: number) => void;
44
- onMonthClick?: (month: number) => void;
45
- onYearClick?: (year: number) => void;
41
+ readonly calendar: useCalendarReturn;
42
+ readonly mode: usePickerModeReturn;
43
+ readonly onDayClick?: (timestamp: number) => void;
44
+ readonly onMonthClick?: (month: number) => void;
45
+ readonly onYearClick?: (year: number) => void;
46
46
  }
47
47
  export interface usePickerModeReturn {
48
48
  get: () => PickerMode;
@@ -51,13 +51,13 @@ export interface usePickerModeReturn {
51
51
  Picker: (props: CalendarPickerProps) => JSX.Element;
52
52
  }
53
53
  export interface CalendarProps extends useCalendarProps, Omit<HTMLAttributes<HTMLDivElement>, 'onSelect'> {
54
- onDayClick?: CalendarPickerProps['onDayClick'];
55
- onMonthClick?: CalendarPickerProps['onMonthClick'];
56
- onYearClick?: CalendarPickerProps['onYearClick'];
54
+ readonly onDayClick?: CalendarPickerProps['onDayClick'];
55
+ readonly onMonthClick?: CalendarPickerProps['onMonthClick'];
56
+ readonly onYearClick?: CalendarPickerProps['onYearClick'];
57
57
  }
58
58
  export interface GenericCalendarProps extends HTMLAttributes<HTMLDivElement> {
59
- calendar: useCalendarReturn;
60
- onDayClick?: CalendarPickerProps['onDayClick'];
61
- onMonthClick?: CalendarPickerProps['onMonthClick'];
62
- onYearClick?: CalendarPickerProps['onYearClick'];
59
+ readonly calendar: useCalendarReturn;
60
+ readonly onDayClick?: CalendarPickerProps['onDayClick'];
61
+ readonly onMonthClick?: CalendarPickerProps['onMonthClick'];
62
+ readonly onYearClick?: CalendarPickerProps['onYearClick'];
63
63
  }
@@ -3,7 +3,7 @@ export { default as DateFormatHelper } from './DateFormat.helper';
3
3
  export { default as DateHelper, TODAY } from './Date.helper';
4
4
  export { default as MonthHelper } from './Month.helper';
5
5
  export { default as useCalendar } from './useCalendar';
6
- export type { CalendarDate, CalendarDateRange, CalendarConstraint } from './Date.helper';
6
+ export type { CalendarDate, CalendarDateRange, CalendarConstraint, InputDate } from './Date.helper';
7
7
  export type { DateFormat } from './DateFormat.helper';
8
8
  export type { CalendarMonth, CalendarMonthAlias } from './Month.helper';
9
9
  export type { CalendarProps, useCalendarProps, GenericCalendarProps } from './Calendar.types';
@@ -3,25 +3,25 @@ import { TextFieldProps } from '../TextField';
3
3
  import { default as EventLike } from '../../utils/types/EventLike';
4
4
  import { PopoverPlacement } from '../Popover';
5
5
  export interface DatePickerProps {
6
- id?: string;
7
- name: string;
8
- value?: null | string | number;
9
- disabled?: boolean;
10
- constraints?: CalendarProps['constraints'];
11
- onChange?: (event: EventLike<string | null>) => void;
12
- getInputProps?: () => Partial<TextFieldProps>;
13
- getCalendarProps?: () => Partial<GenericCalendarProps>;
14
- placement?: PopoverPlacement;
6
+ readonly id?: string;
7
+ readonly name: string;
8
+ readonly value?: null | string | number;
9
+ readonly disabled?: boolean;
10
+ readonly constraints?: CalendarProps['constraints'];
11
+ readonly onChange?: (event: EventLike<string | null>) => void;
12
+ readonly getInputProps?: () => Partial<TextFieldProps>;
13
+ readonly getCalendarProps?: () => Partial<GenericCalendarProps>;
14
+ readonly placement?: PopoverPlacement;
15
15
  }
16
16
  export interface DateRangePickerProps {
17
- id?: string;
18
- name: string;
19
- value?: useCalendarProps['selected'];
20
- disabled?: boolean;
21
- constraints?: CalendarProps['constraints'];
22
- onChange?: (event: EventLike<null | [string | null, string | null]>) => void;
23
- getRangeStartInputProps?: () => Partial<TextFieldProps>;
24
- getRangeEndInputProps?: () => Partial<TextFieldProps>;
25
- getCalendarProps?: () => Partial<GenericCalendarProps>;
26
- placement?: PopoverPlacement;
17
+ readonly id?: string;
18
+ readonly name: string;
19
+ readonly value?: useCalendarProps['selected'];
20
+ readonly disabled?: boolean;
21
+ readonly constraints?: CalendarProps['constraints'];
22
+ readonly onChange?: (event: EventLike<null | [string | null, string | null]>) => void;
23
+ readonly getRangeStartInputProps?: () => Partial<TextFieldProps>;
24
+ readonly getRangeEndInputProps?: () => Partial<TextFieldProps>;
25
+ readonly getCalendarProps?: () => Partial<GenericCalendarProps>;
26
+ readonly placement?: PopoverPlacement;
27
27
  }
@@ -1,7 +1,7 @@
1
1
  export interface useDialogProps {
2
- open: boolean;
3
- onOpen?: () => void;
4
- onClose?: () => void;
2
+ readonly open: boolean;
3
+ readonly onOpen?: () => void;
4
+ readonly onClose?: () => void;
5
5
  }
6
6
  declare function useDialog({ open: openProp, onOpen, onClose }: useDialogProps): {
7
7
  open: boolean;
@@ -1,71 +1,71 @@
1
1
  import { HTMLAttributes, ReactNode } from 'react';
2
2
  import { StackProps } from '../Layout/Stack';
3
3
  export type WrapperProps = Partial<StackProps>;
4
- export type DropZoneProps = Omit<HTMLAttributes<HTMLInputElement>, 'onChange'> & {
4
+ export interface DropZoneProps extends Omit<HTMLAttributes<HTMLInputElement>, 'onChange'> {
5
5
  /**
6
6
  * Optional hint to be rendered below the main call to action text.
7
7
  */
8
- hint?: string;
8
+ readonly hint?: string;
9
9
  /**
10
10
  * Whether the input should allow multiple files.
11
11
  */
12
- multiple?: boolean;
12
+ readonly multiple?: boolean;
13
13
  /**
14
14
  * List (or single string) of allowed file formats.
15
15
  */
16
- accept?: string | string[];
16
+ readonly accept?: string | string[];
17
17
  /**
18
18
  * Disables the drop zone.
19
19
  */
20
- disabled?: boolean;
20
+ readonly disabled?: boolean;
21
21
  /**
22
22
  * Applies error styles to the drop zone wrapper.
23
23
  */
24
- error?: boolean;
24
+ readonly error?: boolean;
25
25
  /**
26
26
  * Useful to render custom content inside the dropzone.
27
27
  * If provided, the icon, call to action, and hint won't be rendered.
28
28
  */
29
- renderCustomContent?: (params: {
29
+ readonly renderCustomContent?: (params: {
30
30
  isDragging: boolean;
31
31
  }) => JSX.Element;
32
- };
32
+ }
33
33
  export type FileStatus = 'loading' | 'error' | 'success';
34
34
  export interface FileWithStatus {
35
- file: File;
36
- status: FileStatus;
37
- errorMessage?: string;
35
+ readonly file: File;
36
+ readonly status: FileStatus;
37
+ readonly errorMessage?: string;
38
+ }
39
+ export interface FileItemProps extends FileWithStatus {
40
+ readonly onRemove: () => void;
41
+ readonly onRetry?: () => void;
42
+ readonly disabled?: boolean;
38
43
  }
39
- export type FileItemProps = FileWithStatus & {
40
- onRemove: () => void;
41
- onRetry?: () => void;
42
- disabled?: boolean;
43
- };
44
- export type FileListProps = Partial<StackProps> & {
44
+ export interface FileListProps extends Partial<StackProps> {
45
45
  /**
46
46
  * Disables the buttons within the file items.
47
47
  */
48
- disabled?: boolean;
49
- };
48
+ readonly disabled?: boolean;
49
+ }
50
50
  export interface DragDropFileProviderProps {
51
51
  /**
52
52
  * List of items including the file and its status.
53
53
  */
54
- fileList: FileWithStatus[];
54
+ readonly fileList: FileWithStatus[];
55
55
  /**
56
56
  * Function that will be triggered when new files are added to the input.
57
57
  */
58
- onFilesAdded: (newFiles: File[]) => void;
58
+ readonly onFilesAdded: (newFiles: File[]) => void;
59
59
  /**
60
60
  * Function that will be triggered when a file is removed from the list.
61
61
  */
62
- onFileRemoved: (newFileList: FileWithStatus[], removedItem: FileWithStatus, removedItemIndex: number) => void;
62
+ readonly onFileRemoved: (newFileList: FileWithStatus[], removedItem: FileWithStatus, removedItemIndex: number) => void;
63
63
  /**
64
64
  * Optional function to retry upload on a file item with error status.
65
65
  */
66
- onRetryUpload?: (item: FileWithStatus, removedItemIndex: number) => void;
67
- children: ReactNode;
66
+ readonly onRetryUpload?: (item: FileWithStatus, removedItemIndex: number) => void;
67
+ readonly children: ReactNode;
68
+ }
69
+ export interface DragDropFileContextValue extends Pick<DragDropFileProviderProps, 'fileList' | 'onFilesAdded' | 'onRetryUpload'> {
70
+ readonly onRemoveFile: (removedItem: FileWithStatus, removedItemIndex: number) => void;
68
71
  }
69
- export type DragDropFileContextValue = Pick<DragDropFileProviderProps, 'fileList' | 'onFilesAdded' | 'onRetryUpload'> & {
70
- onRemoveFile: (removedItem: FileWithStatus, removedItemIndex: number) => void;
71
- };
@@ -1,23 +1,26 @@
1
- import { PropsWithChildren, ReactNode, default as React } from 'react';
1
+ import { ReactNode, default as React } from 'react';
2
2
  export interface DrawerProps {
3
- children?: ReactNode;
4
- className?: string;
5
- open: boolean;
6
- onClose?: () => void;
7
- onClickOutside?: () => void;
3
+ readonly children?: ReactNode;
4
+ readonly className?: string;
5
+ readonly open: boolean;
6
+ readonly onClose?: () => void;
7
+ readonly onClickOutside?: () => void;
8
8
  }
9
9
  export interface DrawerHeaderProps {
10
10
  readonly className?: string;
11
+ readonly children?: ReactNode;
11
12
  }
12
- declare function DrawerHeader({ children, className, ...others }: PropsWithChildren<DrawerHeaderProps>): React.JSX.Element;
13
+ declare function DrawerHeader({ children, className, ...others }: DrawerHeaderProps): React.JSX.Element;
13
14
  export interface DrawerBodyProps {
14
- className?: string;
15
+ readonly className?: string;
16
+ readonly children?: ReactNode;
15
17
  }
16
- declare function DrawerBody({ children, className, ...others }: PropsWithChildren<DrawerHeaderProps>): React.JSX.Element;
18
+ declare function DrawerBody({ children, className, ...others }: DrawerBodyProps): React.JSX.Element;
17
19
  export interface DrawerFooterProps {
18
20
  readonly className?: string;
21
+ readonly children?: ReactNode;
19
22
  }
20
- declare function DrawerFooter({ children, className, ...others }: PropsWithChildren<DrawerFooterProps>): React.JSX.Element;
23
+ declare function DrawerFooter({ children, className, ...others }: DrawerFooterProps): React.JSX.Element;
21
24
  declare function Drawer({ className, children, open, onClose, onClickOutside, ...others }: DrawerProps): React.ReactPortal;
22
25
  declare namespace Drawer {
23
26
  var Header: typeof DrawerHeader;
@@ -2,8 +2,8 @@ import { PopoverPlacement } from '../Popover';
2
2
  import { ButtonProps } from '../Button';
3
3
  import { ButtonHTMLAttributes, HTMLAttributes, ReactNode } from 'react';
4
4
  export interface useDropdownProps {
5
- expanded: boolean;
6
- toggle: () => void;
5
+ readonly expanded: boolean;
6
+ readonly toggle: () => void;
7
7
  }
8
8
  export interface useDropdownReturn {
9
9
  expanded: boolean;
@@ -12,38 +12,38 @@ export interface useDropdownReturn {
12
12
  collapse: () => void;
13
13
  }
14
14
  export interface DropdownProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange' | 'onBlur'>, PopoverPlacement {
15
- disabled?: boolean;
15
+ readonly disabled?: boolean;
16
16
  /**
17
17
  * Use this prop to not allow the dropdown to be expanded.
18
18
  * While the `disabled` prop applies to the whole dropdown trigger element, this one only disables the TriggerHandle.
19
19
  */
20
- expandDisabled?: boolean;
21
- onBlur?: (event?: MouseEvent | TouchEvent | KeyboardEvent) => void;
20
+ readonly expandDisabled?: boolean;
21
+ readonly onBlur?: (event?: MouseEvent | TouchEvent | KeyboardEvent) => void;
22
22
  }
23
23
  export interface GenericDropdownProps extends DropdownProps, Omit<useDropdownReturn, 'expand' | 'collapse'> {
24
24
  }
25
- export type DropdownTriggerProps = ButtonProps & {
26
- outlined?: boolean;
27
- };
25
+ export interface DropdownTriggerProps extends ButtonProps {
26
+ readonly outlined?: boolean;
27
+ }
28
28
  export interface DropdownMenuProps extends HTMLAttributes<HTMLDivElement> {
29
- header?: ReactNode;
30
- footer?: ReactNode;
29
+ readonly header?: ReactNode;
30
+ readonly footer?: ReactNode;
31
31
  /**
32
32
  * @deprecated Use the `align` prop on <Dropdown> wrapper instead.
33
33
  */
34
- align?: 'start' | 'end';
34
+ readonly align?: 'start' | 'end';
35
35
  }
36
36
  export interface DropdownMenuItemProps extends ButtonHTMLAttributes<HTMLButtonElement> {
37
- leading?: ReactNode;
38
- trailing?: ReactNode;
39
- onClick?: (event: React.MouseEvent<HTMLButtonElement>) => boolean | undefined | void;
37
+ readonly leading?: ReactNode;
38
+ readonly trailing?: ReactNode;
39
+ readonly onClick?: (event: React.MouseEvent<HTMLButtonElement>) => boolean | undefined | void;
40
40
  }
41
41
  export interface DropdownMenuSectionProps extends HTMLAttributes<HTMLDivElement> {
42
- header: ReactNode;
42
+ readonly header: ReactNode;
43
43
  }
44
44
  export interface DropdownContextReturn {
45
- disabled: boolean;
46
- expandDisabled: boolean;
47
- expanded: boolean;
48
- toggle: () => void;
45
+ readonly disabled: boolean;
46
+ readonly expandDisabled: boolean;
47
+ readonly expanded: boolean;
48
+ readonly toggle: () => void;
49
49
  }
@@ -1,14 +1,14 @@
1
1
  import { DropdownProps } from './Dropdown.types';
2
2
  export interface useDropdownProps {
3
- expanded: boolean;
4
- toggle: () => void;
3
+ readonly expanded: boolean;
4
+ readonly toggle: () => void;
5
5
  }
6
6
  export interface GenericDropdownProps extends DropdownProps, useDropdownProps {
7
7
  }
8
8
  declare function useDropdown({ disabled, expandDisabled }: DropdownProps): {
9
- expanded: boolean;
10
- toggle: () => void;
11
- expand: () => void;
12
- collapse: () => void;
9
+ readonly expanded: boolean;
10
+ readonly toggle: () => void;
11
+ readonly expand: () => void;
12
+ readonly collapse: () => void;
13
13
  };
14
14
  export default useDropdown;
@@ -1,22 +1,22 @@
1
1
  import { HTMLAttributes, ReactNode } from 'react';
2
2
  import { ButtonProps } from '../Button';
3
- export type EmptyStateCommonProps = HTMLAttributes<HTMLDivElement> & {
4
- title?: string;
5
- action?: Omit<ButtonProps, 'children'> & {
6
- label: string;
3
+ export interface EmptyStateCommonProps extends HTMLAttributes<HTMLDivElement> {
4
+ readonly title?: string;
5
+ readonly action?: Omit<ButtonProps, 'children'> & {
6
+ readonly label: string;
7
7
  };
8
- };
9
- export type EmptyStateWithIconProps = EmptyStateCommonProps & {
10
- variant: 'card' | 'horizontal-card';
11
- icon?: ReactNode;
12
- };
13
- export type EmptyStateWithIllustrationProps = EmptyStateCommonProps & {
14
- variant: 'page' | 'panel';
15
- illustration?: string | JSX.Element;
16
- description?: string;
17
- };
8
+ }
9
+ export interface EmptyStateWithIconProps extends EmptyStateCommonProps {
10
+ readonly variant: 'card' | 'horizontal-card';
11
+ readonly icon?: ReactNode;
12
+ }
13
+ export interface EmptyStateWithIllustrationProps extends EmptyStateCommonProps {
14
+ readonly variant: 'page' | 'panel';
15
+ readonly illustration?: string | JSX.Element;
16
+ readonly description?: string;
17
+ }
18
18
  export type EmptyStateProps = EmptyStateWithIconProps | EmptyStateWithIllustrationProps;
19
- export type IllustrationProps = HTMLAttributes<HTMLDivElement> & {
20
- illustration: string | JSX.Element;
21
- scale: 'default' | 'large';
22
- };
19
+ export interface IllustrationProps extends HTMLAttributes<HTMLDivElement> {
20
+ readonly illustration: string | JSX.Element;
21
+ readonly scale: 'default' | 'large';
22
+ }
@@ -1,7 +1,7 @@
1
1
  import { HTMLAttributes, default as React } from 'react';
2
- export type HighlightMatchProps = {
2
+ export interface HighlightMatchProps extends HTMLAttributes<HTMLSpanElement> {
3
3
  readonly text: string;
4
4
  readonly match: string;
5
- } & HTMLAttributes<HTMLSpanElement>;
5
+ }
6
6
  declare const HighlightMatch: ({ text, match, ...props }: HighlightMatchProps) => React.JSX.Element;
7
7
  export default HighlightMatch;
@@ -1,19 +1,21 @@
1
- import { PropsWithChildren, default as React } from 'react';
1
+ import { default as React, ReactNode } from 'react';
2
2
  interface WithScaleProps {
3
- scale?: 'small' | 'default' | 'large';
3
+ readonly scale?: 'small' | 'default' | 'large';
4
4
  }
5
5
  export interface ModalProps extends WithScaleProps {
6
- className?: string;
7
- id?: string;
8
- open: boolean;
9
- fullscreen?: boolean;
10
- onOverlayClick?: () => void;
6
+ readonly className?: string;
7
+ readonly id?: string;
8
+ readonly open: boolean;
9
+ readonly fullscreen?: boolean;
10
+ readonly onOverlayClick?: () => void;
11
+ readonly children?: ReactNode;
11
12
  }
12
- declare function Modal({ scale, children, open, fullscreen, onOverlayClick, ...others }: PropsWithChildren<ModalProps>): React.ReactPortal;
13
+ declare function Modal({ scale, children, open, fullscreen, onOverlayClick, ...others }: ModalProps): React.ReactPortal;
13
14
  declare namespace Modal {
14
- var Header: ({ title, children }: PropsWithChildren<{
15
+ var Header: ({ title, children }: {
15
16
  readonly title: string;
16
- }>) => React.JSX.Element;
17
+ readonly children?: ReactNode;
18
+ }) => React.JSX.Element;
17
19
  var Close: import("styled-components").StyledComponent<any, any, any, any>;
18
20
  }
19
21
  export default Modal;
@@ -1,48 +1,48 @@
1
1
  import { HTMLAttributes } from 'react';
2
2
  import { ButtonProps } from '../Button';
3
- export type PaginationProps = Omit<HTMLAttributes<HTMLElement>, 'onChange'> & {
3
+ export interface PaginationProps extends Omit<HTMLAttributes<HTMLElement>, 'onChange'> {
4
4
  /**
5
5
  * Number of pages displayed before the ellipsis
6
6
  */
7
- boundaryCount?: number;
7
+ readonly boundaryCount?: number;
8
8
  /**
9
9
  * The total number of pages to be shown
10
10
  */
11
- count: number;
11
+ readonly count: number;
12
12
  /**
13
13
  * Controls if pages button should be disabled or not
14
14
  */
15
- disabled?: boolean;
15
+ readonly disabled?: boolean;
16
16
  /**
17
17
  * Handler called every page change
18
18
  */
19
- onChange: ({ page }: {
19
+ readonly onChange: ({ page }: {
20
20
  page: number;
21
21
  }) => void;
22
22
  /**
23
23
  * The current page number
24
24
  */
25
- page: number;
25
+ readonly page: number;
26
26
  /**
27
27
  * Number of pages displayed next to the current page
28
28
  */
29
- siblingCount?: number;
30
- };
29
+ readonly siblingCount?: number;
30
+ }
31
31
  export type usePaginationProps = Pick<PaginationProps, 'boundaryCount' | 'count' | 'disabled' | 'onChange' | 'page' | 'siblingCount'>;
32
32
  export interface usePaginationReturn {
33
33
  'aria-current'?: boolean | undefined;
34
- disabled: boolean;
35
- itemType: string;
36
- onClick: () => void;
37
- page: number | null;
34
+ readonly disabled: boolean;
35
+ readonly itemType: string;
36
+ readonly onClick: () => void;
37
+ readonly page: number | null;
38
+ }
39
+ export interface PaginationItemProps extends ButtonProps {
40
+ readonly itemType: string;
41
+ readonly page: number | null;
38
42
  }
39
- export type PaginationItemProps = ButtonProps & {
40
- itemType: string;
41
- page: number | null;
42
- };
43
43
  export interface PaginationHelperArgs {
44
- boundaryCount: number;
45
- count: number;
46
- page: number;
47
- siblingCount: number;
44
+ readonly boundaryCount: number;
45
+ readonly count: number;
46
+ readonly page: number;
47
+ readonly siblingCount: number;
48
48
  }
@@ -1,5 +1,5 @@
1
1
  import { UseFloatingReturn } from '@floating-ui/react-dom';
2
- import { CSSProperties, HTMLAttributes, MutableRefObject, PropsWithChildren } from 'react';
2
+ import { CSSProperties, HTMLAttributes, MutableRefObject, ReactNode } from 'react';
3
3
  export interface UsePopoverReturn {
4
4
  register: {
5
5
  setReference: UseFloatingReturn['refs']['setReference'];
@@ -23,9 +23,10 @@ export interface PopoverPlacement {
23
23
  position?: PopoverPosition;
24
24
  align?: PopoverAlign;
25
25
  }
26
- export type PopoverProps = PropsWithChildren<PopoverPlacement & {
27
- strategy?: UsePopoverReturn['strategy'];
28
- arrow?: MutableRefObject<HTMLElement | null>;
29
- }>;
26
+ export interface PopoverProps extends PopoverPlacement {
27
+ readonly strategy?: UsePopoverReturn['strategy'];
28
+ readonly arrow?: MutableRefObject<HTMLElement | null>;
29
+ readonly children?: ReactNode;
30
+ }
30
31
  export type PopoverReferenceProps = HTMLAttributes<HTMLDivElement>;
31
32
  export type PopoverFloatingProps = HTMLAttributes<HTMLDivElement>;
@@ -6,43 +6,43 @@ import { useSelectableReturn } from '../../hooks/useSelectable/useSelectable.typ
6
6
  import { ChangeEvent, ComponentType, FocusEvent, HTMLAttributes, ReactNode } from 'react';
7
7
  export type Option = Selectable;
8
8
  export interface GenericOption {
9
- label: string;
10
- value: SelectableKeyType;
9
+ readonly label: string;
10
+ readonly value: SelectableKeyType;
11
11
  }
12
12
  export interface SelectableOption extends GenericOption {
13
- checked: boolean;
13
+ readonly checked: boolean;
14
14
  }
15
15
  export interface SelectableOptionProps {
16
- role: string;
17
- 'aria-selected': boolean;
18
- id: string;
19
- onClick: () => boolean | undefined;
20
- tabIndex: number;
16
+ readonly role: string;
17
+ readonly 'aria-selected': boolean;
18
+ readonly id: string;
19
+ readonly onClick: () => boolean | undefined;
20
+ readonly tabIndex: number;
21
21
  }
22
22
  export interface CreatableProps {
23
- onClick: () => void;
24
- tabIndex: number;
23
+ readonly onClick: () => void;
24
+ readonly tabIndex: number;
25
25
  }
26
26
  export type OptionKeyType = SelectableKeyType;
27
27
  export type SelectValue = SelectableState<Option>;
28
28
  export interface SelectAdapter<T> extends SelectableAdapter<T> {
29
- getLabel: (o: T) => string;
29
+ readonly getLabel: (o: T) => string;
30
30
  }
31
31
  export type Adapters = Record<string, SelectAdapter<any>>;
32
32
  export interface SelectDatasource<T> {
33
- type: string;
34
- adapter: SelectAdapter<T>;
35
- fetch: ({ query, regex }: {
33
+ readonly type: string;
34
+ readonly adapter: SelectAdapter<T>;
35
+ readonly fetch: ({ query, regex }: {
36
36
  query: string;
37
37
  regex: RegExp;
38
38
  }) => T[] | Promise<T[]>;
39
39
  }
40
40
  export type SelectDatasourceFunction<T> = () => SelectDatasource<T>;
41
41
  export interface SelectComponentsOptionProps {
42
- value: SelectOptionProps['value'];
42
+ readonly value: SelectOptionProps['value'];
43
43
  }
44
44
  export interface SelectComponentsEmptyProps {
45
- children: SelectEmptyProps['children'];
45
+ readonly children: SelectEmptyProps['children'];
46
46
  }
47
47
  export type CreatableOptionType = () => ReactNode | null;
48
48
  export interface Components {
@@ -55,27 +55,27 @@ export type OnChange = (event: EventLike<Option | Option[] | null>) => void;
55
55
  export type OnCreate = (query: string) => Promise<void | Option> | void | Option;
56
56
  export type OnQueryChange = (e: ChangeEvent<HTMLInputElement>) => void;
57
57
  export interface SelectProps extends DropdownProps {
58
- name: string;
59
- placeholder?: string;
60
- value?: Option | Option[] | null;
61
- multiple?: boolean;
62
- autoFocus?: boolean;
63
- datasources?: SelectDatasourceFunction<any>[];
64
- options?: GenericOption[];
65
- components?: Components;
66
- onChange?: OnChange;
67
- onCreate?: OnCreate;
68
- onQueryChange?: OnQueryChange;
69
- getInputProps?: () => Partial<TextFieldProps>;
70
- isValidNewOption?: ((query: string) => boolean) | boolean;
71
- createOptionPosition?: CreateOptionPosition;
58
+ readonly name: string;
59
+ readonly placeholder?: string;
60
+ readonly value?: Option | Option[] | null;
61
+ readonly multiple?: boolean;
62
+ readonly autoFocus?: boolean;
63
+ readonly datasources?: SelectDatasourceFunction<any>[];
64
+ readonly options?: GenericOption[];
65
+ readonly components?: Components;
66
+ readonly onChange?: OnChange;
67
+ readonly onCreate?: OnCreate;
68
+ readonly onQueryChange?: OnQueryChange;
69
+ readonly getInputProps?: () => Partial<TextFieldProps>;
70
+ readonly isValidNewOption?: ((query: string) => boolean) | boolean;
71
+ readonly createOptionPosition?: CreateOptionPosition;
72
72
  /**
73
73
  * Hide the clear button on the Single Select.
74
74
  */
75
- hideClear?: boolean;
75
+ readonly hideClear?: boolean;
76
76
  }
77
77
  export type SelectOptionProps = {
78
- value: SelectableKeyType;
78
+ readonly value: SelectableKeyType;
79
79
  } & Omit<DropdownMenuItemProps, keyof SelectableOptionProps | 'value'>;
80
80
  export type SelectEmptyProps = HTMLAttributes<HTMLDivElement>;
81
81
  export type SelectCreatableOptionProps = Omit<DropdownMenuItemProps, keyof CreatableProps>;