@fattureincloud/fic-design-system 0.6.6 → 0.7.1

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 (221) hide show
  1. package/dist/common/hooks/useOutsideClick.d.ts +3 -0
  2. package/dist/components/drawer/components/styledDrawerWrapper.d.ts +2 -2
  3. package/dist/components/drawer/drawer.d.ts +10 -6
  4. package/dist/components/dropdown/DropdownImpl.d.ts +1 -1
  5. package/dist/components/dropdown/types.d.ts +1 -0
  6. package/dist/components/form/datepicker/hooks/useDatePickerValues.d.ts +13 -0
  7. package/dist/components/form/inputText/components/codeInput/CodeInput.d.ts +4 -0
  8. package/dist/components/form/inputText/components/codeInput/styled.d.ts +29 -0
  9. package/dist/components/form/inputText/components/codeInput/useCodeInputHooks.d.ts +11 -0
  10. package/dist/components/form/inputText/components/telephoneInput/TelephoneInput.d.ts +4 -0
  11. package/dist/components/form/inputText/components/telephoneInput/countriesTelephonePrefixes.d.ts +7 -0
  12. package/dist/components/form/inputText/components/telephoneInput/styled.d.ts +2 -0
  13. package/dist/components/form/textArea/TextArea.d.ts +3 -3
  14. package/dist/components/form/textArea/components/TextAreaElement.d.ts +2 -2
  15. package/dist/components/newTable/Table.d.ts +33 -0
  16. package/dist/components/newTable/components/action/favorite/Favorite.d.ts +14 -0
  17. package/dist/components/newTable/components/action/favorite/index.d.ts +1 -0
  18. package/dist/components/newTable/components/action/favorite/styled.d.ts +4 -0
  19. package/dist/components/newTable/components/action/settings/ColumnsSettings/ColumnItem/ColumnItem.d.ts +8 -0
  20. package/dist/components/newTable/components/action/settings/ColumnsSettings/ColumnItem/styled.d.ts +4 -0
  21. package/dist/components/newTable/components/action/settings/ColumnsSettings/ColumnsSettings.d.ts +8 -0
  22. package/dist/components/newTable/components/action/settings/ColumnsSettings/DraggableContent/DraggableContent.d.ts +7 -0
  23. package/dist/components/newTable/components/action/settings/ColumnsSettings/index.d.ts +2 -0
  24. package/dist/components/newTable/components/action/settings/ColumnsSettings/styled.d.ts +4 -0
  25. package/dist/components/newTable/components/action/settings/DropdownSettings/DropdownSettings.d.ts +7 -0
  26. package/dist/components/newTable/components/action/settings/DropdownSettings/index.d.ts +1 -0
  27. package/dist/components/newTable/components/action/settings/DropdownSettings/styled.d.ts +4 -0
  28. package/dist/components/newTable/components/action/settings/RowHeightSettings/RowHeightSettings.d.ts +10 -0
  29. package/dist/components/newTable/components/action/settings/RowHeightSettings/index.d.ts +1 -0
  30. package/dist/components/newTable/components/action/settings/RowHeightSettings/styled.d.ts +2 -0
  31. package/dist/components/newTable/components/action/settings/Settings.d.ts +8 -0
  32. package/dist/components/newTable/components/action/settings/hooks/index.d.ts +2 -0
  33. package/dist/components/newTable/components/action/settings/hooks/useColumnValues.d.ts +8 -0
  34. package/dist/components/newTable/components/action/settings/hooks/useDropdownSettingsValues.d.ts +13 -0
  35. package/dist/components/newTable/components/action/settings/index.d.ts +1 -0
  36. package/dist/components/newTable/components/action/settings/styled.d.ts +2 -0
  37. package/dist/components/newTable/components/action/toggle/Toggle.d.ts +14 -0
  38. package/dist/components/newTable/components/action/toggle/constants.d.ts +3 -0
  39. package/dist/components/newTable/components/action/toggle/index.d.ts +1 -0
  40. package/dist/components/newTable/components/action/toggle/styled.d.ts +5 -0
  41. package/dist/components/newTable/components/body/Body.d.ts +9 -0
  42. package/dist/components/newTable/components/bulkBar/BulkBar.d.ts +9 -0
  43. package/dist/components/newTable/components/bulkBar/styled.d.ts +10 -0
  44. package/dist/components/newTable/components/cell/Cell.d.ts +12 -0
  45. package/dist/components/newTable/components/cell/customActionCell/CustomActionCell.d.ts +12 -0
  46. package/dist/components/newTable/components/cell/customActionCell/DropdownActionCell.d.ts +10 -0
  47. package/dist/components/newTable/components/cell/customActionCell/PrimaryActionCell.d.ts +9 -0
  48. package/dist/components/newTable/components/cell/customActionCell/index.d.ts +3 -0
  49. package/dist/components/newTable/components/cell/customActionCell/styled.d.ts +4 -0
  50. package/dist/components/newTable/components/cell/customCell/CustomCell.d.ts +11 -0
  51. package/dist/components/newTable/components/cell/customCell/CustomInput.d.ts +9 -0
  52. package/dist/components/newTable/components/cell/customCell/TextAreaPopup.d.ts +9 -0
  53. package/dist/components/newTable/components/cell/customCell/constants.d.ts +1 -0
  54. package/dist/components/newTable/components/cell/customCell/index.d.ts +1 -0
  55. package/dist/components/newTable/components/cell/customCell/styled.d.ts +7 -0
  56. package/dist/components/newTable/components/cell/hooks/index.d.ts +1 -0
  57. package/dist/components/newTable/components/cell/hooks/useCellValues.d.ts +16 -0
  58. package/dist/components/newTable/components/cell/loadingCell/LoadingCell.d.ts +7 -0
  59. package/dist/components/newTable/components/cell/loadingCell/index.d.ts +1 -0
  60. package/dist/components/newTable/components/cell/styled.d.ts +20 -0
  61. package/dist/components/newTable/components/footer/Footer.d.ts +7 -0
  62. package/dist/components/newTable/components/header/Header.d.ts +10 -0
  63. package/dist/components/newTable/components/header/headerCell/ActionHeaderCell.d.ts +8 -0
  64. package/dist/components/newTable/components/header/headerCell/HeaderCell.d.ts +12 -0
  65. package/dist/components/newTable/components/header/headerCell/styled.d.ts +9 -0
  66. package/dist/components/newTable/components/header/hooks/index.d.ts +2 -0
  67. package/dist/components/newTable/components/header/hooks/useActionHeaderValues.d.ts +16 -0
  68. package/dist/components/newTable/components/header/hooks/useHeaderValues.d.ts +14 -0
  69. package/dist/components/newTable/components/row/Row.d.ts +10 -0
  70. package/dist/components/newTable/components/row/styled.d.ts +6 -0
  71. package/dist/components/newTable/components/utils.d.ts +10 -0
  72. package/dist/components/newTable/constants.d.ts +2 -0
  73. package/dist/components/newTable/hooks/useColumnPinning.d.ts +8 -0
  74. package/dist/components/newTable/hooks/usePagination.d.ts +9 -0
  75. package/dist/components/newTable/index.d.ts +2 -0
  76. package/dist/components/newTable/providers/TableProvider/TableProvider.d.ts +5 -0
  77. package/dist/components/newTable/providers/TableProvider/index.d.ts +3 -0
  78. package/dist/components/newTable/providers/TableProvider/types.d.ts +10 -0
  79. package/dist/components/newTable/stories/actions.d.ts +4 -0
  80. package/dist/components/newTable/stories/columns.d.ts +3 -0
  81. package/dist/components/newTable/stories/data.d.ts +2 -0
  82. package/dist/components/newTable/stories/styled.d.ts +1 -0
  83. package/dist/components/newTable/stories/types.d.ts +9 -0
  84. package/dist/components/newTable/styled.d.ts +9 -0
  85. package/dist/components/newTable/table.stories.d.ts +6 -0
  86. package/dist/components/newTable/types.d.ts +171 -0
  87. package/dist/components/newTable/utils.d.ts +8 -0
  88. package/dist/components/oldTable/components/EmptyState.d.ts +7 -0
  89. package/dist/components/oldTable/components/SelectedRowsCount.d.ts +7 -0
  90. package/dist/components/oldTable/components/actions/ActionsCell.d.ts +10 -0
  91. package/dist/components/oldTable/components/actions/DropdownActions.d.ts +10 -0
  92. package/dist/components/oldTable/components/actions/PrimaryAction.d.ts +12 -0
  93. package/dist/components/oldTable/components/checkboxes/Cell.d.ts +5 -0
  94. package/dist/components/oldTable/components/checkboxes/Header.d.ts +5 -0
  95. package/dist/components/oldTable/components/checkboxes/useHeaderCheckboxProps.d.ts +12 -0
  96. package/dist/components/oldTable/components/loadingCell/LoadingCell.d.ts +8 -0
  97. package/dist/components/oldTable/components/pagination/PageButton.d.ts +10 -0
  98. package/dist/components/oldTable/components/pagination/PaginationButtons.d.ts +10 -0
  99. package/dist/components/oldTable/components/pagination/utils.d.ts +14 -0
  100. package/dist/components/oldTable/components/tableBody/TableBody.d.ts +17 -0
  101. package/dist/components/oldTable/components/tableBody/TableBodyTr.d.ts +8 -0
  102. package/dist/components/oldTable/components/tableHeader/SortIndicator.d.ts +7 -0
  103. package/dist/components/oldTable/components/tableHeader/TableHeader.d.ts +12 -0
  104. package/dist/components/oldTable/components/tableParts/TableTd.d.ts +8 -0
  105. package/dist/components/oldTable/components/tableParts/TableTh.d.ts +4 -0
  106. package/dist/components/oldTable/components/tableParts/styled.d.ts +17 -0
  107. package/dist/components/oldTable/constants.d.ts +2 -0
  108. package/dist/components/oldTable/hooks/useCheckboxesComponents.d.ts +4 -0
  109. package/dist/components/oldTable/hooks/useRowsSelection.d.ts +4 -0
  110. package/dist/components/oldTable/hooks/useTableHooks.d.ts +6 -0
  111. package/dist/components/oldTable/hooks/useTableValues.d.ts +14 -0
  112. package/dist/components/oldTable/index.d.ts +7 -0
  113. package/dist/components/oldTable/stories/columns.d.ts +3 -0
  114. package/dist/components/oldTable/stories/components/CustomPerson.d.ts +7 -0
  115. package/dist/components/oldTable/stories/components/Role.d.ts +8 -0
  116. package/dist/components/oldTable/stories/components/types.d.ts +14 -0
  117. package/dist/components/oldTable/stories/data.d.ts +2 -0
  118. package/dist/components/oldTable/table.stories.d.ts +6 -0
  119. package/dist/components/oldTable/tablePalette.d.ts +33 -0
  120. package/dist/components/oldTable/types.d.ts +28 -0
  121. package/dist/components/oldTable/utils.d.ts +16 -0
  122. package/dist/components/pagination/Pagination.d.ts +0 -1
  123. package/dist/components/pagination/pagination.stories.d.ts +1 -2
  124. package/dist/components/pagination/styled.d.ts +3 -4
  125. package/dist/components/pagination/types.d.ts +14 -4
  126. package/dist/components/table/Table.d.ts +57 -0
  127. package/dist/components/table/components/ActionsCell.d.ts +10 -0
  128. package/dist/components/table/components/Pagination.d.ts +8 -0
  129. package/dist/components/table/components/SortIndicator.d.ts +6 -0
  130. package/dist/components/table/components/TableBody.d.ts +14 -0
  131. package/dist/components/table/components/TableFoot.d.ts +2 -0
  132. package/dist/components/table/components/TableHeader.d.ts +7 -0
  133. package/dist/components/table/components/tableBody/TableBodyLoader.d.ts +7 -0
  134. package/dist/components/table/components/tableBody/styled.d.ts +3 -0
  135. package/dist/components/toast/typings/toast.d.ts +2 -0
  136. package/dist/components/tooltip/Tooltip.d.ts +3 -1
  137. package/dist/index.d.ts +3 -2
  138. package/dist/index.esm.js +26 -5
  139. package/dist/index.esm.js.map +1 -1
  140. package/dist/index.js +25 -4
  141. package/dist/index.js.map +1 -1
  142. package/dist/styles/theme.d.ts +1 -1
  143. package/package.json +2 -1
  144. package/dist/components/accordion-new/Accordion.d.ts +0 -12
  145. package/dist/components/accordion-new/accordion-new.stories.d.ts +0 -4
  146. package/dist/components/accordion-new/components/AccordionIcon.d.ts +0 -3
  147. package/dist/components/accordion-new/components/AccordionItem.d.ts +0 -3
  148. package/dist/components/accordion-new/components/styled.d.ts +0 -8
  149. package/dist/components/accordion-new/index.d.ts +0 -3
  150. package/dist/components/accordion-new/types.d.ts +0 -58
  151. package/dist/components/accordion-new/utils.d.ts +0 -10
  152. package/dist/components/checkbox/Checkbox.d.ts +0 -15
  153. package/dist/components/checkbox/checkbox.stories.d.ts +0 -1
  154. package/dist/components/checkbox/checkboxPalette.d.ts +0 -16
  155. package/dist/components/checkbox/components/Input.d.ts +0 -9
  156. package/dist/components/checkbox/components/Label.d.ts +0 -8
  157. package/dist/components/checkbox/hooks/useCheckboxValue.d.ts +0 -11
  158. package/dist/components/checkbox/index.d.ts +0 -4
  159. package/dist/components/checkbox/types.d.ts +0 -19
  160. package/dist/components/checkbox/utils.d.ts +0 -24
  161. package/dist/components/form/fileUploader/fileTypes.d.ts +0 -3
  162. package/dist/components/form/fileUploader/hooks/useIcon.d.ts +0 -4
  163. package/dist/components/form/fileUploader/hooks/useTexts.d.ts +0 -3
  164. package/dist/components/form/select/components/types.d.ts +0 -10
  165. package/dist/components/inputText/components/icons.d.ts +0 -8
  166. package/dist/components/inputText/components/inputContainer.d.ts +0 -1
  167. package/dist/components/inputText/components/messages.d.ts +0 -2
  168. package/dist/components/inputText/components/wrapperTextArea.d.ts +0 -1
  169. package/dist/components/inputText/icons.d.ts +0 -9
  170. package/dist/components/inputText/index.d.ts +0 -3
  171. package/dist/components/inputText/inputText.stories.d.ts +0 -1
  172. package/dist/components/inputText/inputTextStyledWrapper.d.ts +0 -2
  173. package/dist/components/inputText/sideText.d.ts +0 -6
  174. package/dist/components/inputText/typings/enums.d.ts +0 -17
  175. package/dist/components/inputText/typings/inputText.d.ts +0 -43
  176. package/dist/components/inputText/utils.d.ts +0 -8
  177. package/dist/components/select/hooks/constants.d.ts +0 -4613
  178. package/dist/components/select/hooks/useCustomSelectStyle.d.ts +0 -4
  179. package/dist/components/select/index.d.ts +0 -4
  180. package/dist/components/select/select.stories.d.ts +0 -1
  181. package/dist/components/select/typings/select.d.ts +0 -22
  182. package/dist/components/stepBar/components/singleStep.d.ts +0 -3
  183. package/dist/components/stepBar/components/styledStepBarWrapper.d.ts +0 -2
  184. package/dist/components/stepBar/index.d.ts +0 -2
  185. package/dist/components/stepBar/stepBar.d.ts +0 -7
  186. package/dist/components/stepBar/stepBar.stories.d.ts +0 -1
  187. package/dist/components/stepBar/types.d.ts +0 -15
  188. package/dist/components/table/components/actionLink.d.ts +0 -3
  189. package/dist/components/table/components/actions/actionsContainer.d.ts +0 -1
  190. package/dist/components/table/components/actions/actionsPopUp.d.ts +0 -12
  191. package/dist/components/table/components/actions/actionsPopUpButton.d.ts +0 -8
  192. package/dist/components/table/components/actions/actionsPopUpUnderlay.d.ts +0 -3
  193. package/dist/components/table/components/components/headDesktop.d.ts +0 -15
  194. package/dist/components/table/components/components/listMobile.d.ts +0 -15
  195. package/dist/components/table/components/components/rowDesktop.d.ts +0 -18
  196. package/dist/components/table/components/customizationModal/customizationsModal.d.ts +0 -10
  197. package/dist/components/table/components/customizationModal/index.d.ts +0 -2
  198. package/dist/components/table/components/customizationModal/styledWrapper.d.ts +0 -3
  199. package/dist/components/table/components/customizationModal/useDnd.d.ts +0 -8
  200. package/dist/components/table/components/customizationModal/utils.d.ts +0 -6
  201. package/dist/components/table/components/emptySet.d.ts +0 -10
  202. package/dist/components/table/components/linearBackground.d.ts +0 -1
  203. package/dist/components/table/components/loadingContent.d.ts +0 -7
  204. package/dist/components/table/components/sortIcon.d.ts +0 -2
  205. package/dist/components/table/components/styledWrapper.d.ts +0 -3
  206. package/dist/components/table/components/unstyledTable.d.ts +0 -11
  207. package/dist/components/table/typings/main.d.ts +0 -92
  208. package/dist/components/table/utils/configPersistency.d.ts +0 -14
  209. package/dist/components/textButton/TextButton.d.ts +0 -12
  210. package/dist/components/textButton/index.d.ts +0 -2
  211. package/dist/components/textButton/textButton.stories.d.ts +0 -1
  212. package/dist/components/tooltips/components/message.d.ts +0 -12
  213. package/dist/components/tooltips/components/styledTooltipWrapper.d.ts +0 -1
  214. package/dist/components/tooltips/index.d.ts +0 -2
  215. package/dist/components/tooltips/tooltips.d.ts +0 -15
  216. package/dist/components/tooltips/tooltips.stories.d.ts +0 -1
  217. package/dist/components/tooltips/types.d.ts +0 -25
  218. package/dist/styles/elevations.d.ts +0 -7
  219. package/dist/utils/FICNumbers.d.ts +0 -11
  220. /package/dist/components/{table/table.d.ts → oldTable/Table.d.ts} +0 -0
  221. /package/dist/components/{table/components/pagination.d.ts → oldTable/components/Pagination.d.ts} +0 -0
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ import { Header } from '@tanstack/react-table';
3
+ interface CustomHeaderCellProps<T> {
4
+ header: Header<T, unknown>;
5
+ onOpen?: (isOpen: boolean) => void;
6
+ }
7
+ declare const ActionHeaderCell: <T>({ header, onOpen }: CustomHeaderCellProps<T>) => JSX.Element;
8
+ export default ActionHeaderCell;
@@ -0,0 +1,12 @@
1
+ import { Header, SortDirection } from '@tanstack/react-table';
2
+ import { default as React } from 'react';
3
+ import { CustomSorted, OnSort, RowSize } from '../../../types';
4
+ interface HeaderCellProps<T> {
5
+ header: Header<T, unknown>;
6
+ headerSize?: RowSize;
7
+ onSort?: OnSort<T>;
8
+ customSorted?: false | SortDirection;
9
+ setCustomSorted?: React.Dispatch<React.SetStateAction<CustomSorted<T> | undefined>>;
10
+ }
11
+ declare const HeaderCell: <T>({ header, headerSize, onSort, customSorted, setCustomSorted, }: HeaderCellProps<T>) => JSX.Element;
12
+ export default HeaderCell;
@@ -0,0 +1,9 @@
1
+ import { RowSize } from '../../../types';
2
+ export declare const TextHeaderCell: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {}, never>;
3
+ export declare const Th: import("styled-components").StyledComponent<"td", import("styled-components").DefaultTheme, {
4
+ size?: RowSize | undefined;
5
+ minWidth?: number | undefined;
6
+ sortable: boolean;
7
+ }, never>;
8
+ export declare const TextHeaderCellWrapper: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {}, never>;
9
+ export declare const ActionCell: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
@@ -0,0 +1,2 @@
1
+ export { default as useHeaderValues } from './useHeaderValues';
2
+ export { default as useActionHeaderValues } from './useActionHeaderValues';
@@ -0,0 +1,16 @@
1
+ import { Column, Header, Table } from '@tanstack/react-table';
2
+ import { ActionType } from '../../../types';
3
+ interface ActionHeaderValues<T> {
4
+ actionType: ActionType;
5
+ canSort: boolean;
6
+ isSorted: boolean;
7
+ isSortedDesc: string | null;
8
+ isSettingsEnabled: boolean;
9
+ toggleSortable: boolean;
10
+ favoriteSortable: boolean;
11
+ table: Table<T>;
12
+ headerTitle?: string | number;
13
+ allColumns: Column<T, unknown>[];
14
+ }
15
+ declare const useActionHeaderValues: <T>(header: Header<T, unknown>) => ActionHeaderValues<T>;
16
+ export default useActionHeaderValues;
@@ -0,0 +1,14 @@
1
+ import { Column, Header } from '@tanstack/react-table';
2
+ import { TooltipProps } from '../../../../tooltip';
3
+ import { ActionType } from '../../../types';
4
+ interface HeaderValues<T> {
5
+ column: Column<T, unknown>;
6
+ actionType: ActionType;
7
+ canSort: boolean;
8
+ isSorted: boolean;
9
+ isSortedDesc: string | null;
10
+ minWidth?: number;
11
+ tooltip?: TooltipProps;
12
+ }
13
+ declare const useHeaderValues: <T>(header: Header<T, unknown>) => HeaderValues<T>;
14
+ export default useHeaderValues;
@@ -0,0 +1,10 @@
1
+ import { Row } from '@tanstack/react-table';
2
+ import React from 'react';
3
+ import { RowSize } from '../../types';
4
+ interface TrProps<T> extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLTableRowElement>, HTMLTableRowElement> {
5
+ row: Row<T>;
6
+ rowSize?: RowSize;
7
+ isLoading?: boolean;
8
+ }
9
+ declare const Tr: <T>({ row, isLoading }: TrProps<T>) => JSX.Element;
10
+ export default Tr;
@@ -0,0 +1,6 @@
1
+ import { RowSize } from '../../types';
2
+ export declare const TRow: import("styled-components").StyledComponent<"tr", import("styled-components").DefaultTheme, {
3
+ mouseHover?: boolean | undefined;
4
+ size?: RowSize | undefined;
5
+ selected?: boolean | undefined;
6
+ }, never>;
@@ -0,0 +1,10 @@
1
+ import { ColumnPinningPosition } from '@tanstack/react-table';
2
+ import { DefaultTheme } from 'styled-components';
3
+ interface Props {
4
+ theme: DefaultTheme;
5
+ isHeader: boolean;
6
+ isPopoverActive?: boolean;
7
+ isPinned: ColumnPinningPosition;
8
+ }
9
+ export declare const getFixedColumnsStyles: ({ theme, isHeader, isPopoverActive, isPinned }: Props) => React.CSSProperties;
10
+ export {};
@@ -0,0 +1,2 @@
1
+ export declare const HEIGHT_SMALL = 42;
2
+ export declare const HEIGHT_LARGE = 56;
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ import { ColumnPinningState } from '@tanstack/react-table';
3
+ interface ReturnType {
4
+ readonly columnPinning: ColumnPinningState;
5
+ readonly setColumnPinning: React.Dispatch<React.SetStateAction<ColumnPinningState>>;
6
+ }
7
+ export declare const useColumnPinning: (defaultValues?: ColumnPinningState | undefined) => ReturnType;
8
+ export {};
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ import { PaginationState } from '@tanstack/react-table';
3
+ interface ReturnType {
4
+ readonly pageIndex: number;
5
+ readonly pageSize: number;
6
+ readonly setPagination: React.Dispatch<React.SetStateAction<PaginationState>>;
7
+ }
8
+ export declare const usePagination: (size: number) => ReturnType;
9
+ export {};
@@ -0,0 +1,2 @@
1
+ export { default as NewTable } from './Table';
2
+ export { ColumnDefType, ColumnsType, CellProps, BulkAction, RowActions, RowAction } from './types';
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { TableContextProps, TableProviderProps } from '.';
3
+ export declare const TableContext: React.Context<TableContextProps>;
4
+ declare const TableProvider: ({ children, defaultRowSize }: TableProviderProps) => JSX.Element;
5
+ export default TableProvider;
@@ -0,0 +1,3 @@
1
+ export { default as TableProvider } from './TableProvider';
2
+ export { TableContext } from './TableProvider';
3
+ export { TableContextProps, TableProviderProps } from './types';
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ import { RowSize } from '../../types';
3
+ export interface TableContextProps {
4
+ rowSize: RowSize;
5
+ setRowSize: (rowHeight: RowSize) => void;
6
+ }
7
+ export interface TableProviderProps {
8
+ children: React.ReactNode | React.ReactNode[];
9
+ defaultRowSize?: RowSize;
10
+ }
@@ -0,0 +1,4 @@
1
+ import { BulkAction, RowActions } from '../types';
2
+ import { DataType } from './types';
3
+ export declare const rowActions: RowActions<DataType>;
4
+ export declare const bulkActions: BulkAction<DataType>[];
@@ -0,0 +1,3 @@
1
+ import { ColumnsType } from '../types';
2
+ import { DataType } from './types';
3
+ export declare const columns: ColumnsType<DataType>[];
@@ -0,0 +1,2 @@
1
+ import { DataType } from './types';
2
+ export declare const data: DataType[];
@@ -0,0 +1 @@
1
+ export declare const TableWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
@@ -0,0 +1,9 @@
1
+ import { CellProps } from '../types';
2
+ export interface DataType {
3
+ id: string;
4
+ supplier: CellProps;
5
+ description: CellProps;
6
+ payment: CellProps;
7
+ amount: CellProps;
8
+ date: CellProps;
9
+ }
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ export declare const Container: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
3
+ export declare const ScrollableContent: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
4
+ export declare const TableWrapper: import("styled-components").StyledComponent<"table", import("styled-components").DefaultTheme, {}, never>;
5
+ export declare const SortIndicator: import("styled-components").StyledComponent<({ onClick, isDisabled, ...props }: import("../icon").IconProps) => JSX.Element, import("styled-components").DefaultTheme, {
6
+ isSorted: boolean;
7
+ isSortedDesc: boolean;
8
+ }, never>;
9
+ export declare const PaginationContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
@@ -0,0 +1,6 @@
1
+ import { Meta, Story } from '@storybook/react';
2
+ import { DataType } from './stories/types';
3
+ import { TableProps } from './types';
4
+ export declare const Template: Story<TableProps<DataType>>;
5
+ declare const TableStories: Meta<TableProps<DataType>>;
6
+ export default TableStories;
@@ -0,0 +1,171 @@
1
+ /// <reference types="react" />
2
+ import { DisplayColumnDef, GroupColumnDef, IdentifiedColumnDef, PaginationState, Row, SortDirection } from '@tanstack/react-table';
3
+ import { AvatarProps } from '../avatar';
4
+ import { ButtonProps } from '../buttons';
5
+ import { DropdownItemType } from '../dropdown/types';
6
+ import { IconProps } from '../icon';
7
+ import { MicroTagProps } from '../microTag';
8
+ import { TagProps } from '../tag';
9
+ import { TooltipProps } from '../tooltip';
10
+ export interface TableProps<T> {
11
+ uniqueId: keyof T;
12
+ data: T[];
13
+ columns: ColumnsType<T>[];
14
+ isSelectable?: boolean;
15
+ onRowSelectionChange?: (data: T[]) => void;
16
+ favorites?: string[];
17
+ onFavoritesChange?: (favourites: string[]) => void;
18
+ toggles?: string[];
19
+ onTogglesChange?: (toggles: string[]) => void;
20
+ rowSize?: RowSize;
21
+ headerSize?: RowSize;
22
+ sortable?: boolean;
23
+ sortDescFirst?: boolean;
24
+ onSort?: OnSort<T>;
25
+ isFavoritesSortable?: boolean;
26
+ isTogglesSortable?: boolean;
27
+ rowActions?: RowActions<T>;
28
+ bulkActions?: BulkAction<T>[];
29
+ isLoading?: boolean;
30
+ allSelectedCTA?: AllSelectedCTA;
31
+ noPagination?: boolean;
32
+ pageSize?: number;
33
+ listSize?: number;
34
+ enableSettings?: boolean;
35
+ settingsDropdownConfig?: SettingsDropdownConfig;
36
+ paginationPreviousText?: string;
37
+ paginationNextText?: string;
38
+ onPaginationChange?: (pagination: PaginationState) => void;
39
+ renderEmptyState?: () => JSX.Element;
40
+ }
41
+ interface SettingsDropdownConfig {
42
+ settingsTooltip?: TooltipProps;
43
+ displaySettingsLabel?: string;
44
+ visibleColumnsLabel?: string;
45
+ rowHeightLabel?: string;
46
+ unspecifiedRowsLabel?: string;
47
+ smallRowsLabel?: string;
48
+ largeRowsLabel?: string;
49
+ }
50
+ export declare enum RowSize {
51
+ UNSPECIFIED = 0,
52
+ SMALL,
53
+ LARGE
54
+ }
55
+ export declare enum ColumnDefType {
56
+ ACCESSOR = "accessor",
57
+ DISPLAY = "display",
58
+ GROUP = "group",
59
+ ACTION = "action"
60
+ }
61
+ interface ExtraColumnDef<T> extends IdentifiedColumnDef<T, CellProps> {
62
+ isEditable: boolean;
63
+ onChange: (text: string, row: Row<T>) => void;
64
+ }
65
+ interface InitalColumnDef<T> extends IdentifiedColumnDef<T, CellProps> {
66
+ isEditable?: false;
67
+ onChange?: never;
68
+ }
69
+ export declare type AccessorColumnDef<T> = InitalColumnDef<T> | ExtraColumnDef<T>;
70
+ export declare enum ActionType {
71
+ CHECKBOX = "checkbox",
72
+ TOGGLE = "toggle",
73
+ FAVORITE = "favorite",
74
+ ROW_ACTIONS = "row_actions",
75
+ SETTINGS = "settings"
76
+ }
77
+ export declare type ActionColumnDef<T> = {
78
+ onActionChange?: (id: string) => void;
79
+ actionType: ActionType;
80
+ favorites?: string[];
81
+ toggles?: string[];
82
+ enableSorting?: boolean;
83
+ enableSettings?: boolean;
84
+ rowActions?: RowActions<T>;
85
+ settingsDropdownConfig?: SettingsDropdownConfig;
86
+ } & IdentifiedColumnDef<T, CellProps>;
87
+ export declare type AdditionalColumnDef = {
88
+ unitSymbol?: string;
89
+ minWidth?: number;
90
+ headerTooltip?: TooltipProps;
91
+ };
92
+ export declare type ColumnsType<T> = ({
93
+ columnDefType: ColumnDefType.ACCESSOR;
94
+ columnDef: AccessorColumnDef<T> & AdditionalColumnDef;
95
+ } & BaseColumnsType<T>) | ({
96
+ columnDefType: ColumnDefType.DISPLAY;
97
+ columnDef: DisplayColumnDef<T, unknown> & AdditionalColumnDef;
98
+ } & BaseColumnsType<T>) | ({
99
+ columnDefType: ColumnDefType.ACTION;
100
+ columnDef: ActionColumnDef<T> & AdditionalColumnDef;
101
+ } & BaseColumnsType<T>) | ({
102
+ columnDefType: ColumnDefType.GROUP;
103
+ columnDef: GroupColumnDef<T, unknown>;
104
+ } & BaseColumnsType<T>);
105
+ interface BaseColumnsType<T> {
106
+ key: keyof T | Lowercase<keyof typeof ActionType>;
107
+ }
108
+ interface CustomCellWithAvatar extends BasicCustomCell {
109
+ avatar?: AvatarProps;
110
+ leadingIcon?: never;
111
+ }
112
+ interface CustomCellWithIcon extends BasicCustomCell {
113
+ avatar?: never;
114
+ leadingIcon?: IconProps;
115
+ }
116
+ export interface BasicCustomCell {
117
+ unitSymbol?: string;
118
+ trailingMicroTag?: MicroTagProps;
119
+ headline?: boolean;
120
+ content?: string | number;
121
+ tag?: TagProps;
122
+ isFavorite?: boolean;
123
+ isToggled?: boolean;
124
+ }
125
+ export declare type CustomCellProps = CustomCellWithIcon | CustomCellWithAvatar;
126
+ export declare type CellProps = CustomCellProps | string | number;
127
+ export interface RowActions<T> {
128
+ headerTitle?: string | number;
129
+ primary?: PrimaryAction<T>;
130
+ dropdown?: DropdownAction<T>;
131
+ }
132
+ export interface RowAction<T> {
133
+ text: string;
134
+ icon?: IconProps;
135
+ type?: DropdownItemType;
136
+ onClick: (row: Row<T>) => void;
137
+ }
138
+ declare type BasicPrimaryAction<T> = {
139
+ tooltip?: TooltipProps;
140
+ onClick: (row: Row<T>) => void;
141
+ };
142
+ interface PrimaryTextAction<T> extends BasicPrimaryAction<T> {
143
+ text?: string | number;
144
+ icon?: never;
145
+ }
146
+ interface PrimaryIconAction<T> extends BasicPrimaryAction<T> {
147
+ text?: never;
148
+ icon?: IconProps;
149
+ }
150
+ export declare type PrimaryAction<T> = PrimaryTextAction<T> | PrimaryIconAction<T>;
151
+ export declare type DropdownAction<T> = {
152
+ items: RowAction<T>[];
153
+ tooltip?: TooltipProps;
154
+ };
155
+ export interface BulkAction<T> extends Omit<ButtonProps, 'onClick' | 'text'> {
156
+ onClick: (rows: T[]) => void;
157
+ text: string | JSX.Element;
158
+ }
159
+ export interface AllSelectedCTA {
160
+ description?: string;
161
+ onClick: () => void;
162
+ text: string;
163
+ }
164
+ export declare type OnSort<T> = (sortParams: {
165
+ sortBy: keyof T;
166
+ direction: false | SortDirection;
167
+ }) => void;
168
+ export declare type CustomSorted<T> = {
169
+ [key in keyof T]: false | SortDirection;
170
+ };
171
+ export {};
@@ -0,0 +1,8 @@
1
+ import { ColumnDef, SortDirection } from '@tanstack/react-table';
2
+ import { CellProps } from './types';
3
+ import { TableProps } from './types';
4
+ interface ColumnsHelperProps<T> extends Omit<TableProps<T>, 'data' | 'uniqueId'> {
5
+ }
6
+ export declare const useColumnsHelper: <T>({ columns, isSelectable, favorites, isFavoritesSortable, onFavoritesChange, toggles, isTogglesSortable, onTogglesChange, rowActions, enableSettings, settingsDropdownConfig, }: ColumnsHelperProps<T>) => ColumnDef<T, CellProps>[];
7
+ export declare const getNextSortingDirection: (direction?: false | SortDirection | undefined) => false | SortDirection;
8
+ export {};
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ export interface EmptyTablePageProps {
3
+ columnsCount: number;
4
+ EmptyPage?: JSX.Element;
5
+ }
6
+ declare const EmptyState: ({ columnsCount, EmptyPage }: EmptyTablePageProps) => JSX.Element;
7
+ export default EmptyState;
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ interface Props {
3
+ count: number;
4
+ resetSelection: () => void;
5
+ }
6
+ declare const SelectedRowsCount: ({ count, resetSelection }: Props) => JSX.Element;
7
+ export default SelectedRowsCount;
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ import { Row } from 'react-table';
3
+ import { RowActions, TableData } from '../../types';
4
+ interface Props<T extends TableData> {
5
+ row: Row<T>;
6
+ actions?: RowActions<T>;
7
+ renderActions?: () => JSX.Element;
8
+ }
9
+ declare const ActionsCell: <T extends TableData>({ row, actions, renderActions }: Props<T>) => JSX.Element;
10
+ export default ActionsCell;
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ import { Row } from 'react-table';
3
+ import { RowAction, TableData } from '../../types';
4
+ interface Props<T extends TableData> {
5
+ row: Row<T>;
6
+ actions: RowAction<T>[];
7
+ rowIsDisabled?: boolean;
8
+ }
9
+ declare const DropdownActions: <T extends TableData>({ row, actions, rowIsDisabled }: Props<T>) => JSX.Element;
10
+ export default DropdownActions;
@@ -0,0 +1,12 @@
1
+ /// <reference types="react" />
2
+ import { Row } from 'react-table';
3
+ import { DropdownItemType } from '../../../dropdown';
4
+ import { RowAction, TableData } from '../../types';
5
+ interface Props<T extends TableData> {
6
+ action: RowAction<T>;
7
+ row: Row<T>;
8
+ rowIsDisabled?: boolean;
9
+ type?: DropdownItemType;
10
+ }
11
+ declare const PrimaryAction: <T extends TableData>({ action, row, rowIsDisabled, type, }: Props<T>) => JSX.Element | null;
12
+ export default PrimaryAction;
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import { CellProps } from 'react-table';
3
+ import { TableData } from '../../types';
4
+ declare const Cell: <T extends TableData>({ row }: CellProps<T, any>) => JSX.Element;
5
+ export default Cell;
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import { HeaderProps } from 'react-table';
3
+ import { TableData } from '../../types';
4
+ declare const Header: <T extends TableData>(props: HeaderProps<T>) => JSX.Element;
5
+ export default Header;
@@ -0,0 +1,12 @@
1
+ import { PropsWithChildren } from 'react';
2
+ import { HeaderProps, TableToggleAllRowsSelectedProps } from 'react-table';
3
+ import { TableData } from '../../types';
4
+ interface Props<T extends TableData> {
5
+ headerProps: PropsWithChildren<HeaderProps<T>>;
6
+ selectSinglePage?: boolean;
7
+ }
8
+ interface ReturnType extends TableToggleAllRowsSelectedProps {
9
+ disabled: boolean;
10
+ }
11
+ declare const useHeaderCheckboxProps: <T extends TableData>({ headerProps, selectSinglePage, }: Props<T>) => ReturnType;
12
+ export default useHeaderCheckboxProps;
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ import { ColumnInstance } from 'react-table';
3
+ import { TableData } from '../../types';
4
+ interface LoadingCellProps<T extends TableData> {
5
+ column: ColumnInstance<T>;
6
+ }
7
+ declare const LoadingCell: <T extends TableData>({ column }: LoadingCellProps<T>) => JSX.Element;
8
+ export default LoadingCell;
@@ -0,0 +1,10 @@
1
+ import { ReactText } from 'react';
2
+ interface Props extends PageButtonWrapperProps {
3
+ text: ReactText;
4
+ onClick: () => void;
5
+ }
6
+ declare const PageButton: ({ text, onClick, isActive }: Props) => JSX.Element;
7
+ export interface PageButtonWrapperProps {
8
+ isActive: boolean;
9
+ }
10
+ export default PageButton;
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ import { UsePaginationInstanceProps } from 'react-table';
3
+ import { TableData } from '../../types';
4
+ interface Props<T extends TableData> {
5
+ pageCount: number;
6
+ pageIndex: number;
7
+ gotoPage: UsePaginationInstanceProps<T>['gotoPage'];
8
+ }
9
+ declare const PaginationButtons: <T extends TableData>({ pageCount, pageIndex, gotoPage }: Props<T>) => JSX.Element;
10
+ export default PaginationButtons;
@@ -0,0 +1,14 @@
1
+ import { DefaultTheme } from 'styled-components';
2
+ import { paletteColor } from '../../../../styles/types';
3
+ import { PageButtonWrapperProps } from './PageButton';
4
+ interface GetPageButtonParams extends PageButtonWrapperProps {
5
+ theme: DefaultTheme;
6
+ }
7
+ export interface PageButtonStyles {
8
+ color: paletteColor;
9
+ background: paletteColor;
10
+ hoverColor: paletteColor;
11
+ hoverBackground: paletteColor;
12
+ }
13
+ export declare const getPageButtonStyles: ({ theme, isActive }: GetPageButtonParams) => PageButtonStyles;
14
+ export {};
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import { Row, UseTableInstanceProps } from 'react-table';
3
+ import { TableData } from '../../types';
4
+ interface Props<T extends TableData> {
5
+ rows: Row<T>[];
6
+ prepareRow: UseTableInstanceProps<T>['prepareRow'];
7
+ selectedRowsIds: string[];
8
+ isLoading: boolean;
9
+ onRowClick?: (row: Row<T>) => void;
10
+ rowHasFocus: boolean;
11
+ rowHeight: number | string;
12
+ selectableRows?: boolean;
13
+ setHighlightedRow: React.Dispatch<React.SetStateAction<number>>;
14
+ tableId: string;
15
+ }
16
+ declare const TableBody: <T extends TableData>({ isLoading, onRowClick, prepareRow, rowHasFocus, rowHeight, rows, selectableRows, selectedRowsIds, setHighlightedRow, tableId, }: Props<T>) => JSX.Element;
17
+ export default TableBody;
@@ -0,0 +1,8 @@
1
+ import { TableBodyTrStyles } from '../../utils';
2
+ export interface TableBodyTrProps {
3
+ isSelected?: boolean;
4
+ isDisabled?: boolean;
5
+ rowHasFocus: boolean;
6
+ }
7
+ declare const TableBodyTr: import("styled-components").StyledComponent<"tr", import("styled-components").DefaultTheme, import("../tableParts/styled").TrProps & TableBodyTrStyles & TableBodyTrProps, keyof TableBodyTrStyles>;
8
+ export default TableBodyTr;
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ interface Props {
3
+ isSorted: boolean;
4
+ isSortedDesc?: boolean;
5
+ }
6
+ declare const SortIndicator: ({ isSorted, isSortedDesc }: Props) => JSX.Element;
7
+ export default SortIndicator;
@@ -0,0 +1,12 @@
1
+ /// <reference types="react" />
2
+ import { HeaderGroup, SortingRule } from 'react-table';
3
+ import { TableData } from '../../types';
4
+ interface Props<T extends TableData> {
5
+ scrollBar: number;
6
+ headerGroups: HeaderGroup<T>[];
7
+ headerHeight?: number | string;
8
+ selectedRowsIds?: string[];
9
+ sortBy: SortingRule<T>[];
10
+ }
11
+ declare const TableHeader: <T extends TableData>({ headerHeight, headerGroups, scrollBar }: Props<T>) => JSX.Element;
12
+ export default TableHeader;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ declare type alignType = 'left' | 'center' | 'right';
3
+ interface Props extends React.HTMLAttributes<HTMLTableDataCellElement> {
4
+ align?: alignType;
5
+ isLoading?: boolean;
6
+ }
7
+ export declare const TableTd: import("styled-components").StyledComponent<({ children, align, isLoading, ...rest }: Props) => JSX.Element, import("styled-components").DefaultTheme, Props, never>;
8
+ export default TableTd;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ declare type Props = React.HTMLAttributes<HTMLTableHeaderCellElement>;
3
+ export declare const TableTh: import("styled-components").StyledComponent<({ children, ...rest }: Props) => JSX.Element, import("styled-components").DefaultTheme, {}, never>;
4
+ export default TableTh;
@@ -0,0 +1,17 @@
1
+ export declare const TableWrapper: import("styled-components").StyledComponent<"table", import("styled-components").DefaultTheme, {}, never>;
2
+ interface THeadProps {
3
+ scrollBar: number;
4
+ }
5
+ export declare const THead: import("styled-components").StyledComponent<"thead", import("styled-components").DefaultTheme, THeadProps, never>;
6
+ interface TableBodyProps {
7
+ bodyHeight: number | string;
8
+ }
9
+ export declare const TBody: import("styled-components").StyledComponent<"tbody", import("styled-components").DefaultTheme, TableBodyProps, never>;
10
+ export interface TrProps {
11
+ isHeader?: boolean;
12
+ rowHeight?: number | string;
13
+ headerHeight?: number | string;
14
+ }
15
+ export declare const TableTr: import("styled-components").StyledComponent<"tr", import("styled-components").DefaultTheme, TrProps, never>;
16
+ export declare const TFoot: import("styled-components").StyledComponent<"tfoot", import("styled-components").DefaultTheme, {}, never>;
17
+ export {};
@@ -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 { Hooks } from 'react-table';
2
+ import { TableData } from '../types';
3
+ declare const useCheckboxesComponents: <T extends TableData>(hooks: Hooks<T>) => void;
4
+ export default useCheckboxesComponents;
@@ -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;
@@ -0,0 +1,6 @@
1
+ import { PluginHook } from 'react-table';
2
+ import { TableProps } from '../Table';
3
+ import { TableData } from '../types';
4
+ declare type Props<T extends TableData> = Pick<TableProps<T>, 'actions' | 'withCheckbox' | 'renderActions' | 'selectableRows' | 'actionsHeader'>;
5
+ declare const useTableHooks: <T extends TableData>({ actions, renderActions, withCheckbox, selectableRows, actionsHeader, }: Props<T>) => PluginHook<T>[];
6
+ export default useTableHooks;