@fattureincloud/fic-design-system 0.4.15 → 0.4.18

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.
@@ -0,0 +1,13 @@
1
+ import { Dispatch, SetStateAction } from 'react';
2
+ declare type Callback = (index: number) => void;
3
+ declare type ReturnType = [number, Dispatch<SetStateAction<number>>, boolean];
4
+ /**
5
+ * Manage the Up and Down key to scroll through lists/table rows/dropdown options
6
+ *
7
+ * @param selector A pattern used to select a single element and put the focus on it, must contain ":id"
8
+ * @param onClick Called when the user press enter and an index is selected
9
+ * @param maxIndex Max number of selectable items
10
+ * @param initialIndex Starting index, default -1 meaning that nothing is selected (can be 0 to preselected the first item)
11
+ */
12
+ declare const useUpDownKeyNavigation: (containerSelector: string, rowSelector: string, isDisabled: boolean, onClick: Callback, maxIndex: number, initialIndex?: number) => ReturnType;
13
+ export default useUpDownKeyNavigation;
@@ -0,0 +1,3 @@
1
+ export declare const isNumber: (n: number | string | undefined) => boolean;
2
+ export declare const parseDimension: (d: number | string) => string;
3
+ export declare const generateRandomId: () => string;
@@ -19,6 +19,8 @@ export declare type DropdownProps = {
19
19
  placement?: Placement;
20
20
  minWidthAsTrigger?: boolean;
21
21
  forceOpen?: boolean;
22
+ isSmall?: boolean;
23
+ maxHeight?: number;
22
24
  };
23
25
  export declare type DropdownItemType = 'default' | 'danger' | 'success' | 'warning' | 'link';
24
26
  export interface DropdownItemProps {
@@ -10,6 +10,7 @@ export interface FileUploaderProps {
10
10
  size?: FileUploaderSize;
11
11
  status?: FileUploaderStatus;
12
12
  customPalette?: CustomPalette;
13
+ fixedHeight?: boolean;
13
14
  }
14
- declare const FileUploader: ({ allowedTypes, customPalette, className, maxFileSize, multiple, onDrop, size, status, }: FileUploaderProps) => JSX.Element;
15
+ declare const FileUploader: ({ allowedTypes, customPalette, className, maxFileSize, multiple, onDrop, size, status, fixedHeight, }: FileUploaderProps) => JSX.Element;
15
16
  export default FileUploader;
@@ -4,6 +4,7 @@ interface ContainerProps {
4
4
  status: statuses;
5
5
  size: FileUploaderSize;
6
6
  backgroundColor: paletteColor;
7
+ fixedHeight: boolean;
7
8
  }
8
9
  export declare const Container: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, ContainerProps, never>;
9
10
  export declare const OnDraggingOverlay: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, ContainerProps, never>;
@@ -2,10 +2,12 @@
2
2
  interface Props {
3
3
  title: string;
4
4
  type: 'success' | 'error' | 'warning' | 'info';
5
- description: string;
6
- question: string;
5
+ description: string | JSX.Element;
6
+ question?: string;
7
7
  actionText: string;
8
+ cancelText?: string;
8
9
  onAction: () => void;
10
+ onCancel?: () => void;
9
11
  isOpen: boolean;
10
12
  setIsOpen: (state: boolean) => void;
11
13
  isSmall?: boolean;
@@ -1,10 +1,11 @@
1
- import { HeaderGroup } from 'react-table';
1
+ import { HeaderGroup, SortingRule } from 'react-table';
2
2
  import { TableData } from '../../types';
3
3
  interface Props<T extends TableData> {
4
4
  scrollBar: number;
5
5
  headerGroups: HeaderGroup<T>[];
6
6
  headerHeight?: number | string;
7
7
  selectedRowsIds?: string[];
8
+ sortBy: SortingRule<T>[];
8
9
  }
9
10
  declare const TableHeader: <T extends TableData>({ headerHeight, headerGroups, scrollBar }: Props<T>) => JSX.Element;
10
11
  export default TableHeader;
@@ -0,0 +1,2 @@
1
+ export declare const DEFAULT_BODY_HEIGHT = 300;
2
+ export declare const DEFAULT_ROW_HEIGHT = 40;
@@ -0,0 +1,4 @@
1
+ import { Row } from 'react-table';
2
+ import { OnSelectionChange, TableData } from '../types';
3
+ declare const useRowsSelection: <T extends TableData>(selectedFlatRows: Row<T>[], preSelectAllRows: boolean, onSelectionChange: OnSelectionChange<T> | undefined, allRows: Row<T>[]) => string[];
4
+ export default useRowsSelection;