@fattureincloud/fic-design-system 0.6.5 → 0.7.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 (223) 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/modals/stepModal/components/StepModalBody.d.ts +1 -1
  16. package/dist/components/modals/stepModal/types.d.ts +2 -0
  17. package/dist/components/newTable/Table.d.ts +33 -0
  18. package/dist/components/newTable/components/action/favorite/Favorite.d.ts +14 -0
  19. package/dist/components/newTable/components/action/favorite/index.d.ts +1 -0
  20. package/dist/components/newTable/components/action/favorite/styled.d.ts +4 -0
  21. package/dist/components/newTable/components/action/settings/ColumnsSettings/ColumnItem/ColumnItem.d.ts +8 -0
  22. package/dist/components/newTable/components/action/settings/ColumnsSettings/ColumnItem/styled.d.ts +4 -0
  23. package/dist/components/newTable/components/action/settings/ColumnsSettings/ColumnsSettings.d.ts +8 -0
  24. package/dist/components/newTable/components/action/settings/ColumnsSettings/DraggableContent/DraggableContent.d.ts +7 -0
  25. package/dist/components/newTable/components/action/settings/ColumnsSettings/index.d.ts +2 -0
  26. package/dist/components/newTable/components/action/settings/ColumnsSettings/styled.d.ts +4 -0
  27. package/dist/components/newTable/components/action/settings/DropdownSettings/DropdownSettings.d.ts +7 -0
  28. package/dist/components/newTable/components/action/settings/DropdownSettings/index.d.ts +1 -0
  29. package/dist/components/newTable/components/action/settings/DropdownSettings/styled.d.ts +4 -0
  30. package/dist/components/newTable/components/action/settings/RowHeightSettings/RowHeightSettings.d.ts +10 -0
  31. package/dist/components/newTable/components/action/settings/RowHeightSettings/index.d.ts +1 -0
  32. package/dist/components/newTable/components/action/settings/RowHeightSettings/styled.d.ts +2 -0
  33. package/dist/components/newTable/components/action/settings/Settings.d.ts +8 -0
  34. package/dist/components/newTable/components/action/settings/hooks/index.d.ts +2 -0
  35. package/dist/components/newTable/components/action/settings/hooks/useColumnValues.d.ts +8 -0
  36. package/dist/components/newTable/components/action/settings/hooks/useDropdownSettingsValues.d.ts +13 -0
  37. package/dist/components/newTable/components/action/settings/index.d.ts +1 -0
  38. package/dist/components/newTable/components/action/settings/styled.d.ts +2 -0
  39. package/dist/components/newTable/components/action/toggle/Toggle.d.ts +14 -0
  40. package/dist/components/newTable/components/action/toggle/constants.d.ts +3 -0
  41. package/dist/components/newTable/components/action/toggle/index.d.ts +1 -0
  42. package/dist/components/newTable/components/action/toggle/styled.d.ts +5 -0
  43. package/dist/components/newTable/components/body/Body.d.ts +9 -0
  44. package/dist/components/newTable/components/bulkBar/BulkBar.d.ts +9 -0
  45. package/dist/components/newTable/components/bulkBar/styled.d.ts +10 -0
  46. package/dist/components/newTable/components/cell/Cell.d.ts +12 -0
  47. package/dist/components/newTable/components/cell/customActionCell/CustomActionCell.d.ts +12 -0
  48. package/dist/components/newTable/components/cell/customActionCell/DropdownActionCell.d.ts +10 -0
  49. package/dist/components/newTable/components/cell/customActionCell/PrimaryActionCell.d.ts +9 -0
  50. package/dist/components/newTable/components/cell/customActionCell/index.d.ts +3 -0
  51. package/dist/components/newTable/components/cell/customActionCell/styled.d.ts +4 -0
  52. package/dist/components/newTable/components/cell/customCell/CustomCell.d.ts +11 -0
  53. package/dist/components/newTable/components/cell/customCell/CustomInput.d.ts +9 -0
  54. package/dist/components/newTable/components/cell/customCell/TextAreaPopup.d.ts +9 -0
  55. package/dist/components/newTable/components/cell/customCell/constants.d.ts +1 -0
  56. package/dist/components/newTable/components/cell/customCell/index.d.ts +1 -0
  57. package/dist/components/newTable/components/cell/customCell/styled.d.ts +7 -0
  58. package/dist/components/newTable/components/cell/hooks/index.d.ts +1 -0
  59. package/dist/components/newTable/components/cell/hooks/useCellValues.d.ts +16 -0
  60. package/dist/components/newTable/components/cell/loadingCell/LoadingCell.d.ts +7 -0
  61. package/dist/components/newTable/components/cell/loadingCell/index.d.ts +1 -0
  62. package/dist/components/newTable/components/cell/styled.d.ts +20 -0
  63. package/dist/components/newTable/components/footer/Footer.d.ts +7 -0
  64. package/dist/components/newTable/components/header/Header.d.ts +10 -0
  65. package/dist/components/newTable/components/header/headerCell/ActionHeaderCell.d.ts +8 -0
  66. package/dist/components/newTable/components/header/headerCell/HeaderCell.d.ts +12 -0
  67. package/dist/components/newTable/components/header/headerCell/styled.d.ts +9 -0
  68. package/dist/components/newTable/components/header/hooks/index.d.ts +2 -0
  69. package/dist/components/newTable/components/header/hooks/useActionHeaderValues.d.ts +16 -0
  70. package/dist/components/newTable/components/header/hooks/useHeaderValues.d.ts +14 -0
  71. package/dist/components/newTable/components/row/Row.d.ts +10 -0
  72. package/dist/components/newTable/components/row/styled.d.ts +6 -0
  73. package/dist/components/newTable/components/utils.d.ts +10 -0
  74. package/dist/components/newTable/constants.d.ts +2 -0
  75. package/dist/components/newTable/hooks/useColumnPinning.d.ts +8 -0
  76. package/dist/components/newTable/hooks/usePagination.d.ts +9 -0
  77. package/dist/components/newTable/index.d.ts +2 -0
  78. package/dist/components/newTable/providers/TableProvider/TableProvider.d.ts +5 -0
  79. package/dist/components/newTable/providers/TableProvider/index.d.ts +3 -0
  80. package/dist/components/newTable/providers/TableProvider/types.d.ts +10 -0
  81. package/dist/components/newTable/stories/actions.d.ts +4 -0
  82. package/dist/components/newTable/stories/columns.d.ts +3 -0
  83. package/dist/components/newTable/stories/data.d.ts +2 -0
  84. package/dist/components/newTable/stories/styled.d.ts +1 -0
  85. package/dist/components/newTable/stories/types.d.ts +9 -0
  86. package/dist/components/newTable/styled.d.ts +9 -0
  87. package/dist/components/newTable/table.stories.d.ts +6 -0
  88. package/dist/components/newTable/types.d.ts +171 -0
  89. package/dist/components/newTable/utils.d.ts +8 -0
  90. package/dist/components/oldTable/components/EmptyState.d.ts +7 -0
  91. package/dist/components/oldTable/components/SelectedRowsCount.d.ts +7 -0
  92. package/dist/components/oldTable/components/actions/ActionsCell.d.ts +10 -0
  93. package/dist/components/oldTable/components/actions/DropdownActions.d.ts +10 -0
  94. package/dist/components/oldTable/components/actions/PrimaryAction.d.ts +12 -0
  95. package/dist/components/oldTable/components/checkboxes/Cell.d.ts +5 -0
  96. package/dist/components/oldTable/components/checkboxes/Header.d.ts +5 -0
  97. package/dist/components/oldTable/components/checkboxes/useHeaderCheckboxProps.d.ts +12 -0
  98. package/dist/components/oldTable/components/loadingCell/LoadingCell.d.ts +8 -0
  99. package/dist/components/oldTable/components/pagination/PageButton.d.ts +10 -0
  100. package/dist/components/oldTable/components/pagination/PaginationButtons.d.ts +10 -0
  101. package/dist/components/oldTable/components/pagination/utils.d.ts +14 -0
  102. package/dist/components/oldTable/components/tableBody/TableBody.d.ts +17 -0
  103. package/dist/components/oldTable/components/tableBody/TableBodyTr.d.ts +8 -0
  104. package/dist/components/oldTable/components/tableHeader/SortIndicator.d.ts +7 -0
  105. package/dist/components/oldTable/components/tableHeader/TableHeader.d.ts +12 -0
  106. package/dist/components/oldTable/components/tableParts/TableTd.d.ts +8 -0
  107. package/dist/components/oldTable/components/tableParts/TableTh.d.ts +4 -0
  108. package/dist/components/oldTable/components/tableParts/styled.d.ts +17 -0
  109. package/dist/components/oldTable/constants.d.ts +2 -0
  110. package/dist/components/oldTable/hooks/useCheckboxesComponents.d.ts +4 -0
  111. package/dist/components/oldTable/hooks/useRowsSelection.d.ts +4 -0
  112. package/dist/components/oldTable/hooks/useTableHooks.d.ts +6 -0
  113. package/dist/components/oldTable/hooks/useTableValues.d.ts +14 -0
  114. package/dist/components/oldTable/index.d.ts +7 -0
  115. package/dist/components/oldTable/stories/columns.d.ts +3 -0
  116. package/dist/components/oldTable/stories/components/CustomPerson.d.ts +7 -0
  117. package/dist/components/oldTable/stories/components/Role.d.ts +8 -0
  118. package/dist/components/oldTable/stories/components/types.d.ts +14 -0
  119. package/dist/components/oldTable/stories/data.d.ts +2 -0
  120. package/dist/components/oldTable/table.stories.d.ts +6 -0
  121. package/dist/components/oldTable/tablePalette.d.ts +33 -0
  122. package/dist/components/oldTable/types.d.ts +28 -0
  123. package/dist/components/oldTable/utils.d.ts +16 -0
  124. package/dist/components/pagination/Pagination.d.ts +0 -1
  125. package/dist/components/pagination/pagination.stories.d.ts +1 -2
  126. package/dist/components/pagination/styled.d.ts +3 -4
  127. package/dist/components/pagination/types.d.ts +14 -4
  128. package/dist/components/table/Table.d.ts +57 -0
  129. package/dist/components/table/components/ActionsCell.d.ts +10 -0
  130. package/dist/components/table/components/Pagination.d.ts +8 -0
  131. package/dist/components/table/components/SortIndicator.d.ts +6 -0
  132. package/dist/components/table/components/TableBody.d.ts +14 -0
  133. package/dist/components/table/components/TableFoot.d.ts +2 -0
  134. package/dist/components/table/components/TableHeader.d.ts +7 -0
  135. package/dist/components/table/components/tableBody/TableBodyLoader.d.ts +7 -0
  136. package/dist/components/table/components/tableBody/styled.d.ts +3 -0
  137. package/dist/components/toast/typings/toast.d.ts +2 -0
  138. package/dist/components/tooltip/Tooltip.d.ts +3 -1
  139. package/dist/index.d.ts +3 -2
  140. package/dist/index.esm.js +26 -5
  141. package/dist/index.esm.js.map +1 -1
  142. package/dist/index.js +25 -4
  143. package/dist/index.js.map +1 -1
  144. package/dist/styles/theme.d.ts +1 -1
  145. package/package.json +2 -1
  146. package/dist/components/accordion-new/Accordion.d.ts +0 -12
  147. package/dist/components/accordion-new/accordion-new.stories.d.ts +0 -4
  148. package/dist/components/accordion-new/components/AccordionIcon.d.ts +0 -3
  149. package/dist/components/accordion-new/components/AccordionItem.d.ts +0 -3
  150. package/dist/components/accordion-new/components/styled.d.ts +0 -8
  151. package/dist/components/accordion-new/index.d.ts +0 -3
  152. package/dist/components/accordion-new/types.d.ts +0 -58
  153. package/dist/components/accordion-new/utils.d.ts +0 -10
  154. package/dist/components/checkbox/Checkbox.d.ts +0 -15
  155. package/dist/components/checkbox/checkbox.stories.d.ts +0 -1
  156. package/dist/components/checkbox/checkboxPalette.d.ts +0 -16
  157. package/dist/components/checkbox/components/Input.d.ts +0 -9
  158. package/dist/components/checkbox/components/Label.d.ts +0 -8
  159. package/dist/components/checkbox/hooks/useCheckboxValue.d.ts +0 -11
  160. package/dist/components/checkbox/index.d.ts +0 -4
  161. package/dist/components/checkbox/types.d.ts +0 -19
  162. package/dist/components/checkbox/utils.d.ts +0 -24
  163. package/dist/components/form/fileUploader/fileTypes.d.ts +0 -3
  164. package/dist/components/form/fileUploader/hooks/useIcon.d.ts +0 -4
  165. package/dist/components/form/fileUploader/hooks/useTexts.d.ts +0 -3
  166. package/dist/components/form/select/components/types.d.ts +0 -10
  167. package/dist/components/inputText/components/icons.d.ts +0 -8
  168. package/dist/components/inputText/components/inputContainer.d.ts +0 -1
  169. package/dist/components/inputText/components/messages.d.ts +0 -2
  170. package/dist/components/inputText/components/wrapperTextArea.d.ts +0 -1
  171. package/dist/components/inputText/icons.d.ts +0 -9
  172. package/dist/components/inputText/index.d.ts +0 -3
  173. package/dist/components/inputText/inputText.stories.d.ts +0 -1
  174. package/dist/components/inputText/inputTextStyledWrapper.d.ts +0 -2
  175. package/dist/components/inputText/sideText.d.ts +0 -6
  176. package/dist/components/inputText/typings/enums.d.ts +0 -17
  177. package/dist/components/inputText/typings/inputText.d.ts +0 -43
  178. package/dist/components/inputText/utils.d.ts +0 -8
  179. package/dist/components/select/hooks/constants.d.ts +0 -4613
  180. package/dist/components/select/hooks/useCustomSelectStyle.d.ts +0 -4
  181. package/dist/components/select/index.d.ts +0 -4
  182. package/dist/components/select/select.stories.d.ts +0 -1
  183. package/dist/components/select/typings/select.d.ts +0 -22
  184. package/dist/components/stepBar/components/singleStep.d.ts +0 -3
  185. package/dist/components/stepBar/components/styledStepBarWrapper.d.ts +0 -2
  186. package/dist/components/stepBar/index.d.ts +0 -2
  187. package/dist/components/stepBar/stepBar.d.ts +0 -7
  188. package/dist/components/stepBar/stepBar.stories.d.ts +0 -1
  189. package/dist/components/stepBar/types.d.ts +0 -15
  190. package/dist/components/table/components/actionLink.d.ts +0 -3
  191. package/dist/components/table/components/actions/actionsContainer.d.ts +0 -1
  192. package/dist/components/table/components/actions/actionsPopUp.d.ts +0 -12
  193. package/dist/components/table/components/actions/actionsPopUpButton.d.ts +0 -8
  194. package/dist/components/table/components/actions/actionsPopUpUnderlay.d.ts +0 -3
  195. package/dist/components/table/components/components/headDesktop.d.ts +0 -15
  196. package/dist/components/table/components/components/listMobile.d.ts +0 -15
  197. package/dist/components/table/components/components/rowDesktop.d.ts +0 -18
  198. package/dist/components/table/components/customizationModal/customizationsModal.d.ts +0 -10
  199. package/dist/components/table/components/customizationModal/index.d.ts +0 -2
  200. package/dist/components/table/components/customizationModal/styledWrapper.d.ts +0 -3
  201. package/dist/components/table/components/customizationModal/useDnd.d.ts +0 -8
  202. package/dist/components/table/components/customizationModal/utils.d.ts +0 -6
  203. package/dist/components/table/components/emptySet.d.ts +0 -10
  204. package/dist/components/table/components/linearBackground.d.ts +0 -1
  205. package/dist/components/table/components/loadingContent.d.ts +0 -7
  206. package/dist/components/table/components/sortIcon.d.ts +0 -2
  207. package/dist/components/table/components/styledWrapper.d.ts +0 -3
  208. package/dist/components/table/components/unstyledTable.d.ts +0 -11
  209. package/dist/components/table/typings/main.d.ts +0 -92
  210. package/dist/components/table/utils/configPersistency.d.ts +0 -14
  211. package/dist/components/textButton/TextButton.d.ts +0 -12
  212. package/dist/components/textButton/index.d.ts +0 -2
  213. package/dist/components/textButton/textButton.stories.d.ts +0 -1
  214. package/dist/components/tooltips/components/message.d.ts +0 -12
  215. package/dist/components/tooltips/components/styledTooltipWrapper.d.ts +0 -1
  216. package/dist/components/tooltips/index.d.ts +0 -2
  217. package/dist/components/tooltips/tooltips.d.ts +0 -15
  218. package/dist/components/tooltips/tooltips.stories.d.ts +0 -1
  219. package/dist/components/tooltips/types.d.ts +0 -25
  220. package/dist/styles/elevations.d.ts +0 -7
  221. package/dist/utils/FICNumbers.d.ts +0 -11
  222. /package/dist/components/{table/table.d.ts → oldTable/Table.d.ts} +0 -0
  223. /package/dist/components/{table/components/pagination.d.ts → oldTable/components/Pagination.d.ts} +0 -0
@@ -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;
@@ -0,0 +1,14 @@
1
+ import { Dispatch, SetStateAction } from 'react';
2
+ import { Row } from 'react-table';
3
+ import { TableData } from '../types';
4
+ interface Props {
5
+ initialFilter?: string;
6
+ }
7
+ interface ReturnType<DataType extends TableData> {
8
+ filter: string;
9
+ setFilter: Dispatch<SetStateAction<string>>;
10
+ selection: Row<DataType>[];
11
+ setSelection: Dispatch<SetStateAction<Row<DataType>[]>>;
12
+ }
13
+ declare const useTableValues: <DataType extends TableData>({ initialFilter }?: Props) => ReturnType<DataType>;
14
+ export default useTableValues;
@@ -0,0 +1,7 @@
1
+ import { Column, Row } from 'react-table';
2
+ import useTableValues from './hooks/useTableValues';
3
+ import Table from './Table';
4
+ import { TableProps } from './Table';
5
+ import tablePalette, { TablePalette } from './tablePalette';
6
+ import { ManualPagination, OnSelectionChange, OnSort, RowActions, TableData } from './types';
7
+ export { Table, TableProps, TableData, tablePalette, useTableValues, TablePalette, RowActions, ManualPagination, OnSelectionChange, OnSort, Row, Column, };
@@ -0,0 +1,3 @@
1
+ import { Column } from 'react-table';
2
+ import { DataType } from './components/types';
3
+ export declare const columns: Column<DataType>[];
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ import { CustomPersonData } from './types';
3
+ interface Props {
4
+ value: CustomPersonData;
5
+ }
6
+ declare const CustomPerson: ({ value: { img, name, role } }: Props) => JSX.Element;
7
+ export default CustomPerson;
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ export declare const rolesArray: readonly ["master", "admin", undefined];
3
+ export declare type roleType = typeof rolesArray[number];
4
+ interface Props {
5
+ role: roleType;
6
+ }
7
+ declare const Role: ({ role }: Props) => JSX.Element | null;
8
+ export default Role;
@@ -0,0 +1,14 @@
1
+ import { roleType } from './Role';
2
+ export interface CustomPersonData {
3
+ img: string;
4
+ name: string;
5
+ role?: roleType;
6
+ }
7
+ export interface DataType {
8
+ person: CustomPersonData;
9
+ name: string;
10
+ address: string;
11
+ date: string;
12
+ order: number;
13
+ isDisabled?: boolean;
14
+ }
@@ -0,0 +1,2 @@
1
+ import { DataType } from './components/types';
2
+ export declare const getRandomUsers: (n: number) => DataType[];
@@ -0,0 +1,6 @@
1
+ import { Meta, Story } from '@storybook/react';
2
+ import { DataType } from './stories/components/types';
3
+ import { TableProps } from './Table';
4
+ export declare const Template: Story<TableProps<DataType>>;
5
+ declare const TableStories: Meta<TableProps<DataType>>;
6
+ export default TableStories;
@@ -0,0 +1,33 @@
1
+ import { colorsPalette } from '../../common/types/colorsPalette';
2
+ import { ButtonProps, IconButtonProps } from '../buttons';
3
+ import { DropdownItemType } from '../dropdown';
4
+ declare type TableHeaderPalette = colorsPalette;
5
+ declare type rowStatus = 'normal' | 'hover' | 'selected' | 'disabled';
6
+ declare type TableRowsPalette = {
7
+ [k in rowStatus]: colorsPalette;
8
+ };
9
+ interface SelectedRowsCountPalette extends colorsPalette {
10
+ resetButtonColor: ButtonProps['color'];
11
+ }
12
+ declare type paginationItemStatus = 'normal' | 'hover' | 'active';
13
+ declare type PaginationPalette = {
14
+ numbers: {
15
+ [k in paginationItemStatus]: colorsPalette;
16
+ };
17
+ buttons: ButtonProps['color'];
18
+ };
19
+ declare type ActionsPalette = {
20
+ colors: {
21
+ [k in DropdownItemType]: ButtonProps['color'];
22
+ };
23
+ dropdownTriggerColor: IconButtonProps['color'];
24
+ };
25
+ export interface TablePalette {
26
+ header: TableHeaderPalette;
27
+ rows: TableRowsPalette;
28
+ selectedRowsCount: SelectedRowsCountPalette;
29
+ actions: ActionsPalette;
30
+ pagination: PaginationPalette;
31
+ }
32
+ declare const tablePalette: TablePalette;
33
+ export default tablePalette;
@@ -0,0 +1,28 @@
1
+ import { Row, SortingRule } from 'react-table';
2
+ import { DropdownItemType } from '../dropdown';
3
+ import { IconProps } from '../icon';
4
+ export interface TableData {
5
+ isDisabled?: boolean;
6
+ }
7
+ export interface CustomColumn {
8
+ align?: 'left' | 'center' | 'right';
9
+ }
10
+ export interface RowActions<T extends TableData> {
11
+ primary?: RowAction<T>;
12
+ dropdown?: RowAction<T>[];
13
+ }
14
+ export interface RowAction<T extends TableData> {
15
+ icon?: IconProps;
16
+ type?: DropdownItemType;
17
+ text: string;
18
+ onClick: (row: Row<T>) => void;
19
+ isDisabled?: boolean;
20
+ }
21
+ interface ManualPaginationConfig {
22
+ pageCount: number;
23
+ setCurrentPage: (page: number) => void;
24
+ }
25
+ export declare type ManualPagination = ManualPaginationConfig | undefined;
26
+ export declare type OnSort<T extends TableData> = (sortBy: Array<SortingRule<T>>) => void;
27
+ export declare type OnSelectionChange<T extends TableData> = (rows: Row<T>[], addedRows: Row<T>[], removedRows: Row<T>[]) => void;
28
+ export {};
@@ -0,0 +1,16 @@
1
+ import { Row, TableData } from 'index';
2
+ import { DefaultTheme } from 'styled-components';
3
+ import { paletteColor } from '../../styles/types';
4
+ import { TableBodyTrProps } from './components/tableBody/TableBodyTr';
5
+ interface GetTableBodyTrStylesParams extends TableBodyTrProps {
6
+ theme: DefaultTheme;
7
+ }
8
+ export interface TableBodyTrStyles {
9
+ background: paletteColor;
10
+ color: paletteColor;
11
+ hoverColor: paletteColor;
12
+ hoverBackground: paletteColor;
13
+ }
14
+ export declare const getTableBodyTrStyles: ({ theme, isDisabled, isSelected, }: GetTableBodyTrStylesParams) => TableBodyTrStyles;
15
+ export declare const getIdsFromRows: <T extends TableData>(rows: Row<T>[] | undefined) => string[];
16
+ export {};
@@ -10,7 +10,6 @@ import { PaginationProps } from './types';
10
10
  * @param {number} currentPage Used to set the current page number
11
11
  * @param {string} prevText Define previous label text
12
12
  * @param {string} nextText Define next label text
13
- * @param {PaginationType} color Used to set the theme of the component
14
13
  */
15
14
  declare const Pagination: (props: PaginationProps) => JSX.Element;
16
15
  export default Pagination;
@@ -1,7 +1,6 @@
1
- /// <reference types="react" />
2
1
  import { Meta, Story } from '@storybook/react';
3
2
  import { PaginationProps } from './types';
4
3
  export declare const Template: Story<PaginationProps>;
5
- export declare const Normal: () => JSX.Element;
4
+ export declare const Normal: Story<PaginationProps>;
6
5
  declare const PaginationStories: Meta<PaginationProps>;
7
6
  export default PaginationStories;
@@ -1,5 +1,4 @@
1
- import { PaginationType } from './';
2
1
  export declare const PaginationContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
3
- export declare const PaginationElement: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
4
- color: PaginationType;
5
- }, never>;
2
+ export declare const PaginationElement: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
3
+ export declare const PaginationNumberElement: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
4
+ export declare const PaginationButtonElement: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
@@ -15,11 +15,21 @@ export declare type PaginationProps = {
15
15
  currentPage: number;
16
16
  prevText: string;
17
17
  nextText: string;
18
- color?: PaginationType;
19
18
  };
19
+ declare type PaginationNumbersStatus = 'normal' | 'hover' | 'active';
20
+ declare type PaginationButtonsStatus = 'normal' | 'disabled';
20
21
  export declare type PaginationPalette = {
21
- [key in PaginationType]: {
22
- backgroundColor: paletteColor;
23
- color: paletteColor;
22
+ numbers: {
23
+ [k in PaginationNumbersStatus]: {
24
+ backgroundColor: paletteColor;
25
+ color: paletteColor;
26
+ };
27
+ };
28
+ buttons: {
29
+ [k in PaginationButtonsStatus]: {
30
+ backgroundColor: paletteColor;
31
+ color: paletteColor;
32
+ };
24
33
  };
25
34
  };
35
+ export {};
@@ -0,0 +1,57 @@
1
+ /// <reference types="react" />
2
+ import { Row, UseTableOptions } from 'react-table';
3
+ import { EmptyTablePageProps } from './components/EmptyState';
4
+ import { ManualPagination, OnSelectionChange, OnSort, RowActions, TableData } from './types';
5
+ export interface TableProps<T extends TableData> extends UseTableOptions<T> {
6
+ sortable?: boolean;
7
+ onSort?: OnSort<T>;
8
+ noPagination?: boolean;
9
+ manualPagination?: ManualPagination;
10
+ onScroll?: () => void;
11
+ pageSize?: number;
12
+ selectableRows?: boolean;
13
+ preSelectAllRows?: boolean;
14
+ onSelectionChange?: OnSelectionChange<T>;
15
+ onRowClick?: (row: Row<T>) => void;
16
+ globalFilter?: string;
17
+ hideHeader?: boolean;
18
+ EmptyPage?: EmptyTablePageProps['EmptyPage'];
19
+ Footer?: JSX.Element;
20
+ withCheckbox?: boolean;
21
+ isLoading?: boolean;
22
+ actions?: RowActions<T>;
23
+ renderActions?: () => JSX.Element;
24
+ actionsHeader?: string | JSX.Element;
25
+ bodyHeight?: number | string;
26
+ headerHeight?: number | string;
27
+ rowHeight?: number | string;
28
+ disableArrowNavigation?: boolean;
29
+ }
30
+ /**
31
+ * Component Props:
32
+ * @param {boolean} sortable Makes all columns sortable, sort can be disabled for a single column inside columns definition
33
+ * @param {function} onSort Callback called on column sort change
34
+ * @param {boolean} noPagination Hide table paginator and disabled pagination
35
+ * @param {number} pageSize Define the page size to use in every page
36
+ * @param {object} manualPagination If you want to manage the pagination by yourself
37
+ * @param {function} onScroll If pagination is disabled, this callback is called when user scroll to the bottom of the table
38
+ * @param {boolean} selectableRows Allow to select rows
39
+ * @param {boolean} preSelectAllRows Pre-select all rows
40
+ * @param {function} onSelectionChange Callback called when rows selection changes
41
+ * @param {function} onRowClick Callback called on row click
42
+ * @param {string} globalFilter Filter all columns by value
43
+ * @param {boolean} hideHeader Hide the table header
44
+ * @param {object} EmptyPage Configuration to show a custom component when table has no rows
45
+ * @param {JSX.Element} Footer Custom footer component
46
+ * @param {boolean} withCheckbox Show a column with checkboxes on left side of the table
47
+ * @param {boolean} isLoading Apply loading style to all cells
48
+ * @param {object} actions Configuration to render actions column
49
+ * @param {function} renderActions Used to customize actions column
50
+ * @param {string | JSX.Element} actionsHeader Used to customize actions header
51
+ * @param {number|string} bodyHeight Set tbody height, default 300px
52
+ * @param {number|string} headerHeight Set thead and th height, default 40px
53
+ * @param {number|string} rowHeight Set row height, default 40px
54
+ * @param {boolean} disableArrowNavigation Used to turn off Up/Down row selection and Enter click
55
+ */
56
+ declare const Table: <T extends TableData>({ actions, bodyHeight, columns, data, EmptyPage, Footer, globalFilter: externalGlobalFilter, headerHeight, hideHeader, isLoading, manualPagination, noPagination, onRowClick, onScroll, onSelectionChange, onSort, preSelectAllRows, renderActions, actionsHeader, rowHeight, selectableRows, sortable, withCheckbox, pageSize, disableArrowNavigation, }: TableProps<T>) => JSX.Element;
57
+ export default Table;
@@ -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,8 @@
1
+ /// <reference types="react" />
2
+ import { UsePaginationInstanceProps } from 'react-table';
3
+ import { TableData } from '../types';
4
+ interface Props<T extends TableData> extends Omit<UsePaginationInstanceProps<T>, 'page' | 'pageOptions' | 'setPageSize'> {
5
+ pageIndex: number;
6
+ }
7
+ declare const Pagination: <T extends TableData>({ canPreviousPage, nextPage, previousPage, canNextPage, gotoPage, pageCount, pageIndex, }: Props<T>) => JSX.Element;
8
+ export default Pagination;
@@ -0,0 +1,6 @@
1
+ interface Props {
2
+ isSorted: boolean;
3
+ isSortedDesc?: boolean;
4
+ }
5
+ declare const SortIndicator: ({ isSorted, isSortedDesc }: Props) => JSX.Element;
6
+ export default SortIndicator;
@@ -0,0 +1,14 @@
1
+ import { Row, UseTableInstanceProps } from 'react-table';
2
+ import { TableData } from '../types';
3
+ interface Props<T extends TableData> {
4
+ rows: Row<T>[];
5
+ prepareRow: UseTableInstanceProps<T>['prepareRow'];
6
+ selectedRowsIds: string[];
7
+ isLoading: boolean;
8
+ }
9
+ declare const TableBody: <T extends TableData>({ isLoading, rows, prepareRow, selectedRowsIds }: Props<T>) => JSX.Element;
10
+ export interface TableBodyTrProps {
11
+ isSelected?: boolean;
12
+ isDisabled?: boolean;
13
+ }
14
+ export default TableBody;
@@ -0,0 +1,2 @@
1
+ declare const TableFoot: import("styled-components").StyledComponent<"tfoot", import("styled-components").DefaultTheme, {}, never>;
2
+ export default TableFoot;
@@ -0,0 +1,7 @@
1
+ import { HeaderGroup } from 'react-table';
2
+ import { TableData } from '../types';
3
+ interface Props<T extends TableData> {
4
+ headerGroups: HeaderGroup<T>[];
5
+ }
6
+ declare const TableHeader: <T extends TableData>({ headerGroups }: Props<T>) => JSX.Element;
7
+ export default TableHeader;
@@ -0,0 +1,7 @@
1
+ import { ColumnInstance } from 'react-table';
2
+ import { TableData } from '../../types';
3
+ interface Props<T extends TableData> {
4
+ allColumns: ColumnInstance<T>[];
5
+ }
6
+ declare const TableBodyLoader: <T extends TableData>({ allColumns }: Props<T>) => JSX.Element;
7
+ export default TableBodyLoader;
@@ -0,0 +1,3 @@
1
+ import { TableBodyTrStyles } from '../../utils';
2
+ import { TableBodyTrProps } from '../TableBody';
3
+ export declare const TableBodyTr: import("styled-components").StyledComponent<"tr", import("styled-components").DefaultTheme, import("../tableParts/styled").TrProps & TableBodyTrStyles & TableBodyTrProps, keyof TableBodyTrStyles>;
@@ -2,6 +2,8 @@ import React, { ReactNode } from 'react';
2
2
  import { ToastPosition } from 'react-toastify/dist/types';
3
3
  import { IconProps } from '../../icon';
4
4
  export declare type toastType = 'standard' | 'error' | 'info' | 'warning' | 'success';
5
+ export declare type toastLibraryType = 'dark' | 'error' | 'info' | 'warning' | 'success';
6
+ export declare const typeMap: Record<toastType, toastLibraryType>;
5
7
  export interface ToastProps {
6
8
  type?: toastType;
7
9
  content?: ReactNode;
@@ -11,7 +11,9 @@ export interface TooltipProps extends MessageProps {
11
11
  onMouseLeave?: MouseEventHandler;
12
12
  showAlways?: boolean;
13
13
  hideAfterSeconds?: number;
14
+ showAfterSeconds?: number;
14
15
  callbackAfterTimeout?: () => void;
16
+ onOpen?: (isOpen: boolean) => void;
15
17
  }
16
- declare const Tooltip: ({ message, placement, className, children, type, onMouseEnter, onMouseLeave, showAlways, hideAfterSeconds, callbackAfterTimeout, }: TooltipProps) => JSX.Element;
18
+ declare const Tooltip: ({ message, placement, className, children, type, onMouseEnter, onMouseLeave, showAlways, showAfterSeconds, hideAfterSeconds, callbackAfterTimeout, onOpen, }: TooltipProps) => JSX.Element;
17
19
  export default Tooltip;
package/dist/index.d.ts CHANGED
@@ -22,9 +22,10 @@ import { MicroTag, MicroTagPalette, MicroTagProps } from './components/microTag'
22
22
  import { Modal, ModalSearchable, StepModal, StepModalBody, StepModalCommonProps, StepModalFooter, StepModalFooterProps, StepModalHeader, StepModalHeaderProps, StepModalProps } from './components/modals';
23
23
  import { ConfirmationModal } from './components/modals/confirmationModal';
24
24
  import { ModalBody } from './components/modals/modalStyled';
25
+ import { BulkAction, CellProps, ColumnDefType, ColumnsType, NewTable, RowAction, RowActions as NewRowActions } from './components/newTable';
26
+ import { Column, ManualPagination, OnSelectionChange, OnSort, Row, RowActions, Table, TableData, TablePalette, TableProps, useTableValues } from './components/oldTable';
25
27
  import { PageEmptySet } from './components/pageEmptySet';
26
28
  import { Stepper, StepperPalette, StepperProps } from './components/stepper';
27
- import { Column, ManualPagination, OnSelectionChange, OnSort, Row, RowActions, Table, TableData, TablePalette, TableProps, useTableValues } from './components/table';
28
29
  import { DropdownTabs, ScrollableTabs, TabsItem } from './components/tabs';
29
30
  import { Tag, TagPalette, TagProps, tagTypes } from './components/tag';
30
31
  import { ThemeProvider } from './components/themeProvider';
@@ -45,4 +46,4 @@ export { Segment, SegmentButton, SegmentButtonPalette, SegmentButtonProps } from
45
46
  export { ShortcutTip, ShortcutTipProps, Tip, TipPalette, TipProps, TipType } from './components/tip';
46
47
  export { bwColor } from './styles/types';
47
48
  export { Card, CardColor, CardPalette, CardProps, CardElevation, CardType } from './components/card';
48
- export { autocompleteYellow, paletteColor, Avatar, Button, ButtonProps, ButtonPalette, IconButton, IconButtonProps, IconButtonPalette, Icon, IconProps, IconPalette, iconColors, IconBackground, IconBackgroundPalette, Table, TableProps, TableData, useTableValues, Row, Column, TablePalette, RowActions, ManualPagination, OnSelectionChange, OnSort, Checkbox, useCheckboxValue, CheckboxProps, CheckboxPalette, CheckboxStatus, Select, CreatableSelect, AsyncSelect, AsyncCreatableSelect, SelectProps, AsyncSelectProps, AsyncCreatableSelectProps, useSelectSimpleValue, isSimpleValue, simpleValue, CreatableSelectProps, useSelectValue, useSelectMultiValues, SelectPalette, SelectComponentsType, OptionType, PageEmptySet, Modal, ModalBody, ModalSearchable, StepModal, StepModalBody, StepModalCommonProps, StepModalFooter, StepModalFooterProps, StepModalHeader, StepModalHeaderProps, StepModalProps, Tooltip, TooltipProps, TooltipPalette, Accordion, Drawer, Radio, useRadioValue, RadioProps, RadioPalette, RadioStatus, RadioGroup, RadioGroupProps, RadioGroupOptions, InlineMessage, InlineMessageProps, InlineMessagePalette, InlineMessageType, Dropdown, DropdownItemProps, DropdownPalette, DropdownItemType, closeDropdownType, renderContentType, DropdownTabs, ScrollableTabs, TabsItem, Stepper, StepperProps, StepperPalette, ThemeProvider, Theme, Palette, GroupedList, ItemType, GroupType, Toast, ToastProps, toastPalette, ToastPalette, ToastType, ConfirmationModal, MicroTag, MicroTagProps, MicroTagPalette, Tag, TagProps, TagPalette, tagTypes, InputText, InputCode, InputTelephone, InputTextProps, InputCodeProps, InputTelephoneProps, InputTextPalette, UnitDropdownProps, DatePickerProps, DatePickerPalette, DatePicker, useFormattedDate, timeConversionOptions, InputHelper, InputHelperProps, InputHelperPalette, TextArea, TextAreaProps, TextAreaPalette, FileUploader, FileUploaderProps, FileUploaderPalette, FileRejection, fileUploaderOnDrop, Spinner, };
49
+ export { NewTable, Table, ColumnsType, ColumnDefType, CellProps, BulkAction, NewRowActions, RowAction, autocompleteYellow, paletteColor, Avatar, Button, ButtonProps, ButtonPalette, IconButton, IconButtonProps, IconButtonPalette, Icon, IconProps, IconPalette, iconColors, IconBackground, IconBackgroundPalette, TableProps, TableData, useTableValues, Row, Column, TablePalette, RowActions, ManualPagination, OnSelectionChange, OnSort, Checkbox, useCheckboxValue, CheckboxProps, CheckboxPalette, CheckboxStatus, Select, CreatableSelect, AsyncSelect, AsyncCreatableSelect, SelectProps, AsyncSelectProps, AsyncCreatableSelectProps, useSelectSimpleValue, isSimpleValue, simpleValue, CreatableSelectProps, useSelectValue, useSelectMultiValues, SelectPalette, SelectComponentsType, OptionType, PageEmptySet, Modal, ModalBody, ModalSearchable, StepModal, StepModalBody, StepModalCommonProps, StepModalFooter, StepModalFooterProps, StepModalHeader, StepModalHeaderProps, StepModalProps, Tooltip, TooltipProps, TooltipPalette, Accordion, Drawer, Radio, useRadioValue, RadioProps, RadioPalette, RadioStatus, RadioGroup, RadioGroupProps, RadioGroupOptions, InlineMessage, InlineMessageProps, InlineMessagePalette, InlineMessageType, Dropdown, DropdownItemProps, DropdownPalette, DropdownItemType, closeDropdownType, renderContentType, DropdownTabs, ScrollableTabs, TabsItem, Stepper, StepperProps, StepperPalette, ThemeProvider, Theme, Palette, GroupedList, ItemType, GroupType, Toast, ToastProps, toastPalette, ToastPalette, ToastType, ConfirmationModal, MicroTag, MicroTagProps, MicroTagPalette, Tag, TagProps, TagPalette, tagTypes, InputText, InputCode, InputTelephone, InputTextProps, InputCodeProps, InputTelephoneProps, InputTextPalette, UnitDropdownProps, DatePickerProps, DatePickerPalette, DatePicker, useFormattedDate, timeConversionOptions, InputHelper, InputHelperProps, InputHelperPalette, TextArea, TextAreaProps, TextAreaPalette, FileUploader, FileUploaderProps, FileUploaderPalette, FileRejection, fileUploaderOnDrop, Spinner, };