@orfium/ictinus 5.7.1 → 5.8.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 (171) hide show
  1. package/dist/index.js +7493 -6862
  2. package/dist/index.umd.cjs +85 -56
  3. package/dist/src/components/Avatar/Avatar.stories.d.ts +0 -1
  4. package/dist/src/components/Avatar/Avatar.style.d.ts +1 -1
  5. package/dist/src/components/Avatar/AvatarStack.stories.d.ts +0 -1
  6. package/dist/src/components/Box/Box.stories.d.ts +0 -1
  7. package/dist/src/components/Box/Box.style.d.ts +1 -2
  8. package/dist/src/components/Breadcrumb/BreadcrumbItem/BreadcrumbItem.style.d.ts +1 -1
  9. package/dist/src/components/Button/Button.d.ts +3 -3
  10. package/dist/src/components/Button/Button.stories.d.ts +2 -3
  11. package/dist/src/components/ButtonBase/ButtonBase.d.ts +1 -1
  12. package/dist/src/components/ButtonBase/ButtonBase.style.d.ts +2 -2
  13. package/dist/src/components/ButtonBase/constants.d.ts +1 -1
  14. package/dist/src/components/Card/Card.stories.d.ts +0 -1
  15. package/dist/src/components/Controls/CheckBox/CheckBox.stories.d.ts +0 -1
  16. package/dist/src/components/Controls/CheckBox/CheckBox.style.d.ts +1 -1
  17. package/dist/src/components/Controls/ControlLabel/ControlLabel.style.d.ts +1 -1
  18. package/dist/src/components/Controls/Radio/Radio.style.d.ts +1 -1
  19. package/dist/src/components/Controls/Switch/Switch.style.d.ts +1 -1
  20. package/dist/src/components/DatePicker/DatePickInput/DatePickInput.d.ts +1 -1
  21. package/dist/src/components/DatePicker/DatePicker.stories.d.ts +0 -1
  22. package/dist/src/components/DatePicker/DatePicker.types.d.ts +2 -0
  23. package/dist/src/components/DatePicker/Month/Month.utils.d.ts +1 -1
  24. package/dist/src/components/DatePicker/OverlayComponent/components/MonthWrapper/MonthWrapper.style.d.ts +1 -1
  25. package/dist/src/components/Drawer/Drawer.d.ts +2 -2
  26. package/dist/src/components/Drawer/Drawer.stories.d.ts +2 -3
  27. package/dist/src/components/Drawer/Drawer.style.d.ts +3 -3
  28. package/dist/src/components/Drawer/components/DrawerContent/hooks/useDrawerContentObserver.d.ts +0 -1
  29. package/dist/src/components/DropdownButton/DropdownButton.stories.d.ts +1 -2
  30. package/dist/src/components/Filter/components/FilterButton/FilterButton.style.d.ts +2 -2
  31. package/dist/src/components/Filter/hooks/useFilterWithSelectionUtils.d.ts +1 -1
  32. package/dist/src/components/Icon/Icon.stories.d.ts +0 -1
  33. package/dist/src/components/Icon/Icon.style.d.ts +2 -2
  34. package/dist/src/components/IconButton/IconButton.stories.d.ts +0 -1
  35. package/dist/src/components/Label/Label.d.ts +1 -1
  36. package/dist/src/components/Label/Label.style.d.ts +1 -1
  37. package/dist/src/components/Link/Link.d.ts +1 -1
  38. package/dist/src/components/Link/Link.stories.d.ts +1 -2
  39. package/dist/src/components/Link/Link.style.d.ts +1 -1
  40. package/dist/src/components/List/components/ListItemWrapper/ListItemWrapper.style.d.ts +2 -2
  41. package/dist/src/components/List/stories/List.stories.d.ts +0 -1
  42. package/dist/src/components/List/stories/ListItemText.stories.d.ts +0 -1
  43. package/dist/src/components/List/types.d.ts +1 -1
  44. package/dist/src/components/List/utils.d.ts +1 -1
  45. package/dist/src/components/Menu/Menu.d.ts +4 -1
  46. package/dist/src/components/Menu/Menu.stories.d.ts +8 -0
  47. package/dist/src/components/Modal/Modal.style.d.ts +1 -1
  48. package/dist/src/components/Navigation/Navigation.stories.d.ts +0 -1
  49. package/dist/src/components/Notification/Notification.stories.d.ts +0 -1
  50. package/dist/src/components/NumberField/NumberField.stories.d.ts +0 -1
  51. package/dist/src/components/ProgressIndicator/ProgressIndicator.d.ts +1 -1
  52. package/dist/src/components/ProgressIndicator/ProgressIndicator.stories.d.ts +1 -2
  53. package/dist/src/components/ProgressIndicator/components/ProgressBar/ProgressBar.style.d.ts +3 -3
  54. package/dist/src/components/Search/Search.stories.d.ts +0 -1
  55. package/dist/src/components/Search/Search.style.d.ts +9 -9
  56. package/dist/src/components/Select/Select.stories.d.ts +0 -1
  57. package/dist/src/components/Select/components/SelectMenu/SelectMenu.d.ts +1 -1
  58. package/dist/src/components/Select/components/SelectMenu/SelectMenu.style.d.ts +2 -2
  59. package/dist/src/components/Slider/Slider.stories.d.ts +0 -1
  60. package/dist/src/components/Slider/Slider.style.d.ts +3 -4
  61. package/dist/src/components/Slider/components/SliderMark/SliderMark.style.d.ts +2 -2
  62. package/dist/src/components/Slider/components/SliderThumb/SliderThumb.style.d.ts +1 -1
  63. package/dist/src/components/Slider/components/SliderTrack/SliderTrack.style.d.ts +1 -1
  64. package/dist/src/components/Table/Table.d.ts +3 -68
  65. package/dist/src/components/Table/Table.style.d.ts +6 -5
  66. package/dist/src/components/Table/components/TBody/TBody.d.ts +15 -0
  67. package/dist/src/components/Table/components/TBody/TBody.stories.d.ts +16 -0
  68. package/dist/src/components/Table/components/TBody/TBody.style.d.ts +6 -0
  69. package/dist/src/components/Table/components/TBody/index.d.ts +1 -0
  70. package/dist/src/components/Table/components/TD/TD.d.ts +24 -0
  71. package/dist/src/components/Table/components/TD/TD.stories.d.ts +22 -0
  72. package/dist/src/components/Table/components/TD/TD.style.d.ts +14 -0
  73. package/dist/src/components/Table/components/TD/index.d.ts +1 -0
  74. package/dist/src/components/Table/components/TH/TH.d.ts +29 -0
  75. package/dist/src/components/Table/components/TH/TH.stories.d.ts +25 -0
  76. package/dist/src/components/Table/components/TH/TH.style.d.ts +15 -0
  77. package/dist/src/components/Table/components/TH/components/SortingButton/SortingButton.d.ts +15 -0
  78. package/dist/src/components/Table/components/TH/components/SortingButton/SortingButton.style.d.ts +4 -0
  79. package/dist/src/components/Table/components/TH/components/SortingButton/index.d.ts +1 -0
  80. package/dist/src/components/Table/components/TH/components/THOptions/THOptions.d.ts +13 -0
  81. package/dist/src/components/Table/components/TH/components/THOptions/THOptions.style.d.ts +3 -0
  82. package/dist/src/components/Table/components/TH/components/THOptions/components/SortingOption.d.ts +8 -0
  83. package/dist/src/components/Table/components/TH/components/THOptions/components/index.d.ts +1 -0
  84. package/dist/src/components/Table/components/TH/components/THOptions/index.d.ts +1 -0
  85. package/dist/src/components/Table/components/TH/components/index.d.ts +1 -0
  86. package/dist/src/components/Table/components/TH/index.d.ts +1 -0
  87. package/dist/src/components/Table/components/THead/THead.d.ts +12 -0
  88. package/dist/src/components/Table/components/THead/THead.stories.d.ts +13 -0
  89. package/dist/src/components/Table/components/THead/THead.style.d.ts +7 -0
  90. package/dist/src/components/Table/components/THead/index.d.ts +1 -0
  91. package/dist/src/components/Table/components/TPagination/TPagination.d.ts +9 -0
  92. package/dist/src/components/Table/components/TPagination/TPagination.style.d.ts +8 -0
  93. package/dist/src/components/Table/components/TPagination/index.d.ts +1 -0
  94. package/dist/src/components/Table/components/TR/TR.d.ts +17 -0
  95. package/dist/src/components/Table/components/TR/TR.stories.d.ts +13 -0
  96. package/dist/src/components/Table/components/TR/TR.style.d.ts +5 -0
  97. package/dist/src/components/Table/components/TR/index.d.ts +1 -0
  98. package/dist/src/components/Table/components/TTitle/TTitle.d.ts +12 -0
  99. package/dist/src/components/Table/components/TTitle/TTitle.stories.d.ts +16 -0
  100. package/dist/src/components/Table/components/TTitle/TTitle.style.d.ts +5 -0
  101. package/dist/src/components/Table/components/TTitle/components/ColumnChooser/ColumnChooser.d.ts +11 -0
  102. package/dist/src/components/Table/components/TTitle/components/ColumnChooser/ColumnChooser.style.d.ts +3 -0
  103. package/dist/src/components/Table/components/TTitle/components/ColumnChooser/index.d.ts +1 -0
  104. package/dist/src/components/Table/components/TTitle/components/utils.d.ts +1 -0
  105. package/dist/src/components/Table/components/TTitle/index.d.ts +1 -0
  106. package/dist/src/components/Table/components/index.d.ts +7 -0
  107. package/dist/src/components/Table/constants.d.ts +35 -0
  108. package/dist/src/components/Table/docs/Basics/Basics.stories.d.ts +14 -0
  109. package/dist/src/components/Table/docs/Columns/Columns.stories.d.ts +63 -0
  110. package/dist/src/components/Table/docs/Header/Header.stories.d.ts +22 -0
  111. package/dist/src/components/Table/docs/Pagination/Pagination.stories.d.ts +29 -0
  112. package/dist/src/components/Table/docs/RowsAndCells/RowsAndCells.stories.d.ts +73 -0
  113. package/dist/src/components/Table/docs/Showcase/Showcase.stories.d.ts +86 -0
  114. package/dist/src/components/Table/hooks/index.d.ts +1 -0
  115. package/dist/src/components/Table/hooks/useTable.d.ts +23 -0
  116. package/dist/src/components/Table/hooks/useTable.stories.d.ts +13 -0
  117. package/dist/src/components/Table/index.d.ts +4 -1
  118. package/dist/src/components/Table/types.d.ts +109 -13
  119. package/dist/src/components/Table/utils/TableStoryComponents.d.ts +12 -8
  120. package/dist/src/components/{Table → TableV4}/TableRowContext.d.ts +1 -1
  121. package/dist/src/components/TableV4/TableV4.d.ts +70 -0
  122. package/dist/src/components/{Table/Table.stories.d.ts → TableV4/TableV4.stories.d.ts} +1 -2
  123. package/dist/src/components/TableV4/TableV4.style.d.ts +6 -0
  124. package/dist/src/components/{Table → TableV4}/components/RenderRowOrNestedRow/RenderRowOrNestedRow.d.ts +3 -2
  125. package/dist/src/components/{Table → TableV4}/components/RenderRowOrNestedRow/components/ContentCell/ContentCell.d.ts +1 -1
  126. package/dist/src/components/{Table → TableV4}/components/TableCell/utils.d.ts +1 -1
  127. package/dist/src/components/{Table → TableV4}/components/TableRowWrapper/TableRowWrapper.d.ts +3 -2
  128. package/dist/src/components/TableV4/index.d.ts +3 -0
  129. package/dist/src/components/TableV4/types.d.ts +18 -0
  130. package/dist/src/components/TableV4/utils/TableStoryComponents.d.ts +10 -0
  131. package/dist/src/components/Tag/Tag.stories.d.ts +0 -1
  132. package/dist/src/components/Tag/Tag.style.d.ts +1 -1
  133. package/dist/src/components/Tag/hooks/useGetTagUtils.d.ts +1 -1
  134. package/dist/src/components/TextArea/TextArea.stories.d.ts +0 -1
  135. package/dist/src/components/TextArea/TextArea.style.d.ts +1 -1
  136. package/dist/src/components/TextField/TextField.stories.d.ts +0 -1
  137. package/dist/src/components/TextField/TextField.style.d.ts +5 -2
  138. package/dist/src/components/TextInputBase/TextInputBase.d.ts +1 -2
  139. package/dist/src/components/ThemeProvider/ThemeProvider.d.ts +1 -1
  140. package/dist/src/components/Tooltip/Tooltip.stories.d.ts +0 -1
  141. package/dist/src/components/Tooltip/Tooltip.style.d.ts +1 -1
  142. package/dist/src/components/Tooltip/Tooltip.types.d.ts +2 -1
  143. package/dist/src/components/TopAppBar/TopAppBar.stories.d.ts +0 -1
  144. package/dist/src/components/TruncatedContent/TruncatedContent.style.d.ts +1 -2
  145. package/dist/src/components/Typography/Typography.stories.d.ts +0 -1
  146. package/dist/src/components/storyUtils/TooltipShowcase/TooltipShowcase.d.ts +1 -1
  147. package/dist/src/components/utils/PositionInScreen/PositionInScreen.d.ts +1 -0
  148. package/dist/src/components/utils/PositionInScreen/hooks.d.ts +1 -1
  149. package/dist/src/index.d.ts +4 -0
  150. package/dist/src/storybook/Tip/Tip.style.d.ts +1 -2
  151. package/dist/src/utils/date.d.ts +2 -2
  152. package/package.json +10 -8
  153. package/dist/style.css +0 -1
  154. /package/dist/src/components/{Table/Table.test.d.ts → TableV4/TableV4.test.d.ts} +0 -0
  155. /package/dist/src/components/{Table → TableV4}/components/ExtendedColumnItem/ExtendedColumnItem.d.ts +0 -0
  156. /package/dist/src/components/{Table → TableV4}/components/ExtendedColumnItem/ExtendedColumnItem.style.d.ts +0 -0
  157. /package/dist/src/components/{Table → TableV4}/components/ExtendedColumnItem/index.d.ts +0 -0
  158. /package/dist/src/components/{Table → TableV4}/components/RenderRowOrNestedRow/RenderRowOrNestedRow.style.d.ts +0 -0
  159. /package/dist/src/components/{Table → TableV4}/components/RenderRowOrNestedRow/components/ContentCell/ContentCell.style.d.ts +0 -0
  160. /package/dist/src/components/{Table → TableV4}/components/RenderRowOrNestedRow/components/ContentCell/index.d.ts +0 -0
  161. /package/dist/src/components/{Table → TableV4}/components/RenderRowOrNestedRow/components/ExpandedButtonCell/ExpandedButtonCell.d.ts +0 -0
  162. /package/dist/src/components/{Table → TableV4}/components/RenderRowOrNestedRow/components/ExpandedButtonCell/index.d.ts +0 -0
  163. /package/dist/src/components/{Table → TableV4}/components/RenderRowOrNestedRow/index.d.ts +0 -0
  164. /package/dist/src/components/{Table → TableV4}/components/TableCell/TableCell.d.ts +0 -0
  165. /package/dist/src/components/{Table → TableV4}/components/TableCell/TableCell.style.d.ts +0 -0
  166. /package/dist/src/components/{Table → TableV4}/components/TableCell/index.d.ts +0 -0
  167. /package/dist/src/components/{Table → TableV4}/components/TableRow/TableRow.d.ts +0 -0
  168. /package/dist/src/components/{Table → TableV4}/components/TableRow/index.d.ts +0 -0
  169. /package/dist/src/components/{Table → TableV4}/components/TableRowWrapper/index.d.ts +0 -0
  170. /package/dist/src/components/{Table → TableV4}/utils/index.d.ts +0 -0
  171. /package/dist/src/components/{Table → TableV4}/utils/utils.d.ts +0 -0
@@ -0,0 +1,17 @@
1
+ import { CSSObject } from '@emotion/react';
2
+ import { default as React } from 'react';
3
+
4
+ export type TRProps = {
5
+ /** Whether the row is expandable */
6
+ isExpandable?: boolean;
7
+ /** Whether the row is expanded */
8
+ isExpanded?: boolean;
9
+ /** Whether the row is selected */
10
+ isSelected?: boolean;
11
+ /** Whether the row is selectable */
12
+ isSelectable?: boolean;
13
+ /** Style overrides */
14
+ sx?: CSSObject;
15
+ };
16
+ declare const _default: React.NamedExoticComponent<React.PropsWithChildren<TRProps & Pick<Partial<Omit<React.HTMLProps<HTMLDivElement>, "color" | "css" | "size">>, "onClick">>>;
17
+ export default _default;
@@ -0,0 +1,13 @@
1
+ declare const _default: {
2
+ title: string;
3
+ component: import('react').NamedExoticComponent<import('react').PropsWithChildren<import('./TR').TRProps & Pick<Partial<Omit<import('react').HTMLProps<HTMLDivElement>, "color" | "css" | "size">>, "onClick">>>;
4
+ parameters: {
5
+ storyshots: {
6
+ disable: boolean;
7
+ };
8
+ controls: {
9
+ disable: boolean;
10
+ };
11
+ };
12
+ };
13
+ export default _default;
@@ -0,0 +1,5 @@
1
+ import { SerializedStyles } from '@emotion/react';
2
+ import { Theme } from 'theme';
3
+ import { TRProps } from './TR';
4
+
5
+ export declare const trContainer: ({ isExpandable, isSelected, isExpanded, isSelectable, sx, }: Pick<TRProps, "sx" | "isSelectable" | "isSelected" | "isExpandable" | "isExpanded">) => (theme: Theme) => SerializedStyles;
@@ -0,0 +1 @@
1
+ export { default } from './TR';
@@ -0,0 +1,12 @@
1
+ import { default as React } from 'react';
2
+ import { TableProps } from '../../types';
3
+ import { TestProps } from '../../../../utils/types';
4
+
5
+ type Props = Pick<TableProps<any>, 'columnsConfig' | 'columns' | 'rowsConfig' | 'type'> & {
6
+ /** Element that that serves as the positioning boundary of the ColumnChooser Menu */
7
+ containerRef: React.MutableRefObject<any>;
8
+ /** Number of rows */
9
+ rowsCount?: number;
10
+ } & TestProps;
11
+ declare const _default: React.NamedExoticComponent<React.PropsWithChildren<Props>>;
12
+ export default _default;
@@ -0,0 +1,16 @@
1
+ declare const _default: {
2
+ title: string;
3
+ component: import('react').NamedExoticComponent<import('react').PropsWithChildren<Pick<import('../..').TableProps<any>, "type" | "columns" | "rowsConfig" | "columnsConfig"> & {
4
+ containerRef: import('react').MutableRefObject<any>;
5
+ rowsCount?: number;
6
+ } & import('../../../..').TestProps>>;
7
+ parameters: {
8
+ storyshots: {
9
+ disable: boolean;
10
+ };
11
+ controls: {
12
+ disable: boolean;
13
+ };
14
+ };
15
+ };
16
+ export default _default;
@@ -0,0 +1,5 @@
1
+ import { SerializedStyles, Theme } from '@emotion/react';
2
+
3
+ export declare const tTitleContainer: () => (theme: Theme) => SerializedStyles;
4
+ export declare const titleContent: () => (theme: Theme) => SerializedStyles;
5
+ export declare const actionsContent: () => (theme: Theme) => SerializedStyles;
@@ -0,0 +1,11 @@
1
+ import { default as React } from 'react';
2
+ import { TableProps } from '../../../../types';
3
+ import { TestProps } from '../../../../../../utils/types';
4
+
5
+ type Props = Pick<TableProps<any>, 'columns' | 'columnsConfig'> & {
6
+ /** Element that that serves as the positioning boundary of the ColumnChooser Menu */
7
+ containerRef: React.MutableRefObject<any>;
8
+ } & TestProps;
9
+ /** @TODO create a generic Popover component */
10
+ declare const ColumnChooser: React.FC<Props>;
11
+ export default ColumnChooser;
@@ -0,0 +1,3 @@
1
+ import { Theme } from '@emotion/react';
2
+
3
+ export declare const menuStyle: () => (theme: Theme) => import('@emotion/react').SerializedStyles;
@@ -0,0 +1 @@
1
+ export { default } from './ColumnChooser';
@@ -0,0 +1 @@
1
+ export declare const flattenColumns: (columns: any) => any;
@@ -0,0 +1 @@
1
+ export { default } from './TTitle';
@@ -0,0 +1,7 @@
1
+ export { default as TBody } from './TBody';
2
+ export { default as THead } from './THead';
3
+ export { default as TH } from './TH';
4
+ export { default as TR } from './TR';
5
+ export { default as TD } from './TD';
6
+ export { default as TTitle } from './TTitle';
7
+ export { default as TPagination } from './TPagination';
@@ -0,0 +1,35 @@
1
+ import { SortingState } from '@tanstack/react-table';
2
+ import { TableColumn, TableRow } from './types';
3
+
4
+ export declare const ACTIONS_CELL_WIDTH = 52;
5
+ export declare const ACTIONS_BAR_HEIGHT = 44;
6
+ export type SimpleData = {
7
+ firstName: string;
8
+ lastName: string | undefined;
9
+ age: number | undefined;
10
+ job: string | undefined | JSX.Element;
11
+ };
12
+ export declare const contentAlignOptions: string[];
13
+ export declare const simpleColumns: TableColumn<SimpleData>[];
14
+ export declare const groupedColumns: ({
15
+ id: string;
16
+ header: string;
17
+ columns: {
18
+ id: string;
19
+ header: string;
20
+ }[];
21
+ } | {
22
+ id: string;
23
+ header: string;
24
+ columns?: undefined;
25
+ })[];
26
+ export declare const sortDataByKey: (data: any, key: any, order?: string) => any[];
27
+ export declare const sortedData: (data: any, sorting: SortingState) => any;
28
+ export declare const multiSortDataByKey: (data: any, keys: any) => any;
29
+ export declare const simpleData: (isDetailed?: boolean) => TableRow<SimpleData>[];
30
+ export declare const moreData: (isDetailed?: boolean) => TableRow<SimpleData>[];
31
+ export declare const contentAlignToFlex: {
32
+ left: string;
33
+ center: string;
34
+ right: string;
35
+ };
@@ -0,0 +1,14 @@
1
+ declare const _default: {
2
+ title: string;
3
+ component: <TData extends import('../..').NoUndefined<TData>>({ type, rowsConfig, data, columns, rowSize, columnsConfig, sorting, hasStickyHeader, pagination, sx, dataTestPrefixId, }: import('../..').TableProps<TData>) => import("@emotion/react/jsx-runtime").JSX.Element;
4
+ };
5
+ export default _default;
6
+ export declare const BasicExample: {
7
+ render: () => import("@emotion/react/jsx-runtime").JSX.Element;
8
+ name: string;
9
+ parameters: {
10
+ controls: {
11
+ disable: boolean;
12
+ };
13
+ };
14
+ };
@@ -0,0 +1,63 @@
1
+ import { SimpleData } from '../../constants';
2
+
3
+ declare const _default: {
4
+ title: string;
5
+ component: <TData extends import('../..').NoUndefined<TData>>({ type, rowsConfig, data, columns, rowSize, columnsConfig, sorting, hasStickyHeader, pagination, sx, dataTestPrefixId, }: import('../..').TableProps<TData>) => import("@emotion/react/jsx-runtime").JSX.Element;
6
+ args: {
7
+ isMultiSortable: boolean;
8
+ firstNameWidth: number;
9
+ lastNameWidth: number;
10
+ ageWidth: number;
11
+ jobWidth: number;
12
+ };
13
+ argTypes: {
14
+ isAlwaysVisible: {
15
+ control: string;
16
+ options: (keyof SimpleData)[];
17
+ };
18
+ firstNameWidth: {
19
+ name: string;
20
+ type: string;
21
+ };
22
+ lastNameWidth: {
23
+ name: string;
24
+ type: string;
25
+ };
26
+ ageWidth: {
27
+ name: string;
28
+ type: string;
29
+ };
30
+ jobWidth: {
31
+ name: string;
32
+ type: string;
33
+ };
34
+ };
35
+ };
36
+ export default _default;
37
+ export declare const ColumnWidth: {
38
+ render: (args: any) => import("@emotion/react/jsx-runtime").JSX.Element;
39
+ name: string;
40
+ parameters: {
41
+ controls: {
42
+ include: string[];
43
+ };
44
+ };
45
+ };
46
+ export declare const ColumnChooser: {
47
+ render: (args: any) => import("@emotion/react/jsx-runtime").JSX.Element;
48
+ name: string;
49
+ parameters: {
50
+ controls: {
51
+ include: string[];
52
+ };
53
+ };
54
+ };
55
+ export declare const Sorting: {
56
+ render: (args: any) => import("@emotion/react/jsx-runtime").JSX.Element;
57
+ name: string;
58
+ parameters: {
59
+ controls: {
60
+ include: string[];
61
+ };
62
+ };
63
+ };
@@ -0,0 +1,22 @@
1
+ declare const _default: {
2
+ title: string;
3
+ component: <TData extends import('../../types').NoUndefined<TData>>({ type, rowsConfig, data, columns, rowSize, columnsConfig, sorting, hasStickyHeader, pagination, sx, dataTestPrefixId, }: import('../../types').TableProps<TData>) => import("@emotion/react/jsx-runtime").JSX.Element;
4
+ args: {
5
+ maxHeight: number;
6
+ };
7
+ argTypes: {
8
+ maxHeight: {
9
+ name: string;
10
+ };
11
+ };
12
+ };
13
+ export default _default;
14
+ export declare const StickyHeader: {
15
+ render: (args: any) => import("@emotion/react/jsx-runtime").JSX.Element;
16
+ name: string;
17
+ parameters: {
18
+ controls: {
19
+ include: string[];
20
+ };
21
+ };
22
+ };
@@ -0,0 +1,29 @@
1
+ declare const _default: {
2
+ title: string;
3
+ component: <TData extends import('../../types').NoUndefined<TData>>({ type, rowsConfig, data, columns, rowSize, columnsConfig, sorting, hasStickyHeader, pagination, sx, dataTestPrefixId, }: import('../../types').TableProps<TData>) => import("@emotion/react/jsx-runtime").JSX.Element;
4
+ args: {
5
+ isNextPageDisabled: boolean;
6
+ isPrevPageDisabled: boolean;
7
+ isEnhancedPaginationVisible: boolean;
8
+ showItemsPerPageCount: boolean;
9
+ maxHeight: number;
10
+ };
11
+ argTypes: {
12
+ showItemsPerPageCount: {
13
+ name: string;
14
+ };
15
+ maxHeight: {
16
+ name: string;
17
+ };
18
+ };
19
+ };
20
+ export default _default;
21
+ export declare const Pagination: {
22
+ render: (args: any) => import("@emotion/react/jsx-runtime").JSX.Element;
23
+ name: string;
24
+ parameters: {
25
+ controls: {
26
+ include: string[];
27
+ };
28
+ };
29
+ };
@@ -0,0 +1,73 @@
1
+ declare const _default: {
2
+ title: string;
3
+ component: <TData extends import('../..').NoUndefined<TData>>({ type, rowsConfig, data, columns, rowSize, columnsConfig, sorting, hasStickyHeader, pagination, sx, dataTestPrefixId, }: import('../..').TableProps<TData>) => import("@emotion/react/jsx-runtime").JSX.Element;
4
+ args: {
5
+ rowSize: string;
6
+ firstNameAlign: string;
7
+ lastNameAlign: string;
8
+ ageAlign: string;
9
+ jobAlign: string;
10
+ };
11
+ argTypes: {
12
+ rowSize: {
13
+ name: string;
14
+ };
15
+ firstNameAlign: {
16
+ name: string;
17
+ control: string;
18
+ options: string[];
19
+ };
20
+ lastNameAlign: {
21
+ name: string;
22
+ control: string;
23
+ options: string[];
24
+ };
25
+ ageAlign: {
26
+ name: string;
27
+ control: string;
28
+ options: string[];
29
+ };
30
+ jobAlign: {
31
+ name: string;
32
+ control: string;
33
+ options: string[];
34
+ };
35
+ };
36
+ };
37
+ export default _default;
38
+ export declare const RowSizes: {
39
+ render: (args: any) => import("@emotion/react/jsx-runtime").JSX.Element;
40
+ name: string;
41
+ parameters: {
42
+ controls: {
43
+ include: string[];
44
+ };
45
+ };
46
+ };
47
+ export declare const CellContentAlignment: {
48
+ render: (args: any) => import("@emotion/react/jsx-runtime").JSX.Element;
49
+ name: string;
50
+ parameters: {
51
+ controls: {
52
+ include: string[];
53
+ };
54
+ };
55
+ };
56
+ export declare const RowSelection: {
57
+ render: () => import("@emotion/react/jsx-runtime").JSX.Element;
58
+ name: string;
59
+ parameters: {
60
+ controls: {
61
+ disable: boolean;
62
+ };
63
+ };
64
+ };
65
+ export declare const RowDetails: {
66
+ render: () => import("@emotion/react/jsx-runtime").JSX.Element;
67
+ name: string;
68
+ parameters: {
69
+ controls: {
70
+ disable: boolean;
71
+ };
72
+ };
73
+ };
@@ -0,0 +1,86 @@
1
+ declare const _default: {
2
+ title: string;
3
+ component: <TData extends import('../..').NoUndefined<TData>>({ type, rowsConfig, data, columns, rowSize, columnsConfig, sorting, hasStickyHeader, pagination, sx, dataTestPrefixId, }: import('../..').TableProps<TData>) => import("@emotion/react/jsx-runtime").JSX.Element;
4
+ args: {
5
+ firstNameAlign: string;
6
+ lastNameAlign: string;
7
+ ageAlign: string;
8
+ jobAlign: string;
9
+ rowSize: string;
10
+ maxHeight: number;
11
+ };
12
+ argTypes: {
13
+ firstNameAlign: {
14
+ name: string;
15
+ control: string;
16
+ options: string[];
17
+ };
18
+ lastNameAlign: {
19
+ name: string;
20
+ control: string;
21
+ options: string[];
22
+ };
23
+ ageAlign: {
24
+ name: string;
25
+ control: string;
26
+ options: string[];
27
+ };
28
+ jobAlign: {
29
+ name: string;
30
+ control: string;
31
+ options: string[];
32
+ };
33
+ rowSize: {
34
+ name: string;
35
+ };
36
+ hasRowSelection: {
37
+ name: string;
38
+ type: string;
39
+ };
40
+ hasPagination: {
41
+ name: string;
42
+ type: string;
43
+ };
44
+ hasExpandableRows: {
45
+ name: string;
46
+ type: string;
47
+ };
48
+ hasColumnChooser: {
49
+ name: string;
50
+ type: string;
51
+ };
52
+ hasSorting: {
53
+ name: string;
54
+ type: string;
55
+ };
56
+ maxHeight: {
57
+ name: string;
58
+ };
59
+ firstNameWidth: {
60
+ name: string;
61
+ type: string;
62
+ };
63
+ lastNameWidth: {
64
+ name: string;
65
+ type: string;
66
+ };
67
+ ageWidth: {
68
+ name: string;
69
+ type: string;
70
+ };
71
+ jobWidth: {
72
+ name: string;
73
+ type: string;
74
+ };
75
+ };
76
+ };
77
+ export default _default;
78
+ export declare const Playground: {
79
+ render: (args: any) => import("@emotion/react/jsx-runtime").JSX.Element;
80
+ name: string;
81
+ parameters: {
82
+ controls: {
83
+ include: string[];
84
+ };
85
+ };
86
+ };
@@ -0,0 +1 @@
1
+ export { default as useTable } from './useTable';
@@ -0,0 +1,23 @@
1
+ import { Column, HeaderGroup, RowModel } from '@tanstack/react-table';
2
+
3
+ type ReturnValue<TData> = {
4
+ getHeaderGroups: () => HeaderGroup<TData>[];
5
+ getRowModel: () => RowModel<TData>;
6
+ getIsAllRowsSelected: () => boolean;
7
+ getIsSomeRowsSelected: () => boolean;
8
+ getToggleAllRowsSelectedHandler: () => (event: unknown) => void;
9
+ toggleAllRowsSelected: (value: boolean) => void;
10
+ getAllLeafColumns: () => Column<TData, unknown>[];
11
+ };
12
+ declare const useTable: <TData>({ type, data, columns, sorting, rowsConfig, columnsConfig, pagination, dataTestPrefixId, ...rest }: {
13
+ [x: string]: any;
14
+ type?: string;
15
+ data: any;
16
+ columns: any;
17
+ sorting: any;
18
+ rowsConfig: any;
19
+ columnsConfig: any;
20
+ pagination: any;
21
+ dataTestPrefixId: any;
22
+ }) => ReturnValue<TData>;
23
+ export default useTable;
@@ -0,0 +1,13 @@
1
+ declare const _default: {
2
+ title: string;
3
+ component: () => boolean;
4
+ parameters: {
5
+ storyshots: {
6
+ disable: boolean;
7
+ };
8
+ controls: {
9
+ disable: boolean;
10
+ };
11
+ };
12
+ };
13
+ export default _default;
@@ -1,3 +1,6 @@
1
1
  export { default } from './Table';
2
- export * from './Table';
2
+ export * from './components';
3
+ export * from './hooks';
3
4
  export * from './types';
5
+ /** This util is necessary to get the new state when using state callbacks. Check documentation for more info */
6
+ export { functionalUpdate as tableFunctionalUpdate } from '@tanstack/react-table';
@@ -1,18 +1,114 @@
1
- import { TooltipPlacement } from '../Tooltip/Tooltip.types';
1
+ import { CSSObject } from '@emotion/react';
2
+ import { SortingState, OnChangeFn, RowSelectionState, ExpandedState } from '@tanstack/react-table';
3
+ import { SelectOptionValues } from '../Select';
4
+ import { TestProps } from '../../utils/types';
2
5
 
3
- export type SortingOrder = 'asc' | 'desc';
4
- export type ExtendedColumn = {
5
- content: {
6
- label: string;
7
- sortingKey: string;
8
- };
9
- tooltip?: {
10
- content: string;
11
- placement?: TooltipPlacement;
6
+ export type NoUndefined<T> = {
7
+ [K in keyof T]-?: Exclude<T[K], undefined>;
8
+ };
9
+ export { SortingState, ExpandedState };
10
+ export type TableProps<TData extends NoUndefined<TData>> = {
11
+ /** If table is interactive, rows are selectable with actions */
12
+ type?: 'interactive' | 'read-only';
13
+ /** The Columns configuration of the Table */
14
+ columns: TableColumn<TData>[];
15
+ /** The Data of the Table */
16
+ data: TableRow<TData>[];
17
+ /** Size of Row */
18
+ rowSize?: RowSize;
19
+ /** Columns Configuration */
20
+ columnsConfig?: ColumnsConfig<TData>;
21
+ /** Rows Configuration */
22
+ rowsConfig?: RowsConfig;
23
+ /** Sorting Configuration */
24
+ sorting?: SortingConfig;
25
+ /** Whether the table has a sticky header and scrollable tbody */
26
+ hasStickyHeader?: boolean;
27
+ /** Pagination config */
28
+ pagination?: PaginationConfig;
29
+ /** Style overrides for Table component and subcomponents */
30
+ sx?: {
31
+ table?: CSSObject;
32
+ thead?: CSSObject;
33
+ tbody?: CSSObject;
34
+ th?: CSSObject;
35
+ tr?: CSSObject;
36
+ td?: CSSObject;
12
37
  };
38
+ } & TestProps;
39
+ export type UseTableProps<TData extends NoUndefined<TData>> = Pick<TableProps<TData>, 'columns' | 'data' | 'sorting' | 'rowsConfig' | 'columnsConfig'> & Partial<Omit<TableProps<TData>, 'columns' | 'data'>>;
40
+ /** Columns */
41
+ export type SortingConfig = {
42
+ /** The Sorting Column State */
43
+ sortingColumn: SortingState;
44
+ /** Callback to change the Sorting Column State */
45
+ handleSorting: OnChangeFn<SortingState>;
46
+ /** Whether multi-sorting is enabled */
47
+ isMultiSortable?: boolean;
48
+ };
49
+ export type ColumnsConfig<TData> = {
50
+ /** State that indicates which columns are visible: an object where every key is a column id and the value is a boolean indicating whether it is visible or not */
51
+ columnVisibility?: Record<keyof TData, boolean>;
52
+ /** Callback for visibility state change */
53
+ setColumnVisibility?: (state: Record<keyof TData, boolean>) => void;
54
+ };
55
+ export type ContentAlign = 'left' | 'center' | 'right';
56
+ export type TableColumn<TData> = {
57
+ /** The id of the column; must be the same as the column key in the Data type */
58
+ id: keyof TData;
59
+ /** The label of the column on the table */
60
+ header: string;
61
+ /** Whether the toggle visibility functionality is disabled for this column */
62
+ isAlwaysVisible?: boolean;
63
+ /** Whether the column is sortable */
13
64
  isSortable?: boolean;
65
+ /** The width of the column (value is percentage number e.g. 25) */
66
+ width?: number;
67
+ /** Content align inside the td */
68
+ contentAlign?: ContentAlign;
69
+ };
70
+ /** Rows & Cells */
71
+ export type RowsConfig = {
72
+ /** Whether a rows counter should be displayed, regardless of row selection functionality */
73
+ hasRowsCount?: boolean;
74
+ /** State which indicated which rows are selected */
75
+ rowSelection?: RowSelectionState;
76
+ /** Callback for row selection state change */
77
+ setRowSelection?: (state: RowSelectionState) => void;
78
+ /** Default action for rows */
79
+ defaultAction?: JSX.Element;
80
+ /** Bulk actions for rows */
81
+ bulkActions?: JSX.Element;
82
+ /** Expanded State */
83
+ expanded?: ExpandedState;
84
+ /** Callback for expanded state change */
85
+ setExpanded?: OnChangeFn<ExpandedState>;
86
+ };
87
+ export type TableRow<TData extends NoUndefined<TData>> = {
88
+ /** The visible cells of the row */
89
+ cells: TData;
90
+ /** Details component which is displayed when clicking the arrow button */
91
+ details?: JSX.Element;
14
92
  };
15
- export type Sort = {
16
- column: string;
17
- order: SortingOrder;
93
+ export type RowSize = 'sm' | 'md' | 'lg';
94
+ /** Pagination */
95
+ export type PaginationConfig = {
96
+ /** The current page displayed */
97
+ page: number;
98
+ /** Total pages count */
99
+ totalPages: number;
100
+ /** OnChange callback for next/prev buttons */
101
+ onChange: (page: number) => void;
102
+ /** Whether go-to-first-page and go-to-last-page buttons are visible */
103
+ isEnhancedPaginationVisible?: boolean;
104
+ /** Manually disable next page */
105
+ isNextPageDisabled?: boolean;
106
+ /** Manually disable previous page */
107
+ isPrevPageDisabled?: boolean;
108
+ /** Show items per page list options */
109
+ showItemsOptions?: Omit<SelectOptionValues, 'iconProps'>[];
110
+ /** Show items per page list selected option */
111
+ showItems?: Omit<SelectOptionValues, 'iconProps'>;
112
+ /** Show items per page list change callback */
113
+ onShowItemsChange?: (option: Omit<SelectOptionValues, 'iconProps'>) => void;
18
114
  };
@@ -1,10 +1,14 @@
1
1
  import { default as React } from 'react';
2
- import { Cell, Row } from '../Table';
3
- import { ExtendedColumn } from '../types';
2
+ import { TableRow, ColumnsConfig, TableColumn, RowsConfig, PaginationConfig } from '../types';
4
3
 
5
- /** This is just a dummy component to be used in Storybook for showing the Row type on props */
6
- export declare const RowStory: React.FC<Row<unknown>>;
7
- /** This is just a dummy component to be used in Storybook for showing the Cell type on props */
8
- export declare const CellStory: React.FC<Cell<unknown>>;
9
- /** This is just a dummy component to be used in Storybook for showing the ExtendedColumn type on props */
10
- export declare const ExtendedColumnStory: React.FC<ExtendedColumn>;
4
+ /** This is just a dummy component to be used in Storybook for showing the ColumnsConfig type on props */
5
+ export declare const ColumnsConfigStory: React.FC<ColumnsConfig<unknown>>;
6
+ /** This is just a dummy component to be used in Storybook for showing the GroupColumn type on props */
7
+ /** This is just a dummy component to be used in Storybook for showing the DisplayColumn type on props */
8
+ export declare const TableColumnStory: React.FC<TableColumn<unknown>>;
9
+ /** This is just a dummy component to be used in Storybook for showing the RowsConfig type on props */
10
+ export declare const RowsConfigStory: React.FC<RowsConfig>;
11
+ /** This is just a dummy component to be used in Storybook for showing the TableRow type on props */
12
+ export declare const TableRowStory: React.FC<TableRow<unknown>>;
13
+ /** This is just a dummy component to be used in Storybook for showing the PaginationConfig type on props */
14
+ export declare const PaginationConfigStory: React.FC<PaginationConfig>;
@@ -1,4 +1,4 @@
1
- import { Row, TableType } from './Table';
1
+ import { Row, TableType } from './TableV4';
2
2
  import * as React from 'react';
3
3
  export type TableRowContextProps<T extends {
4
4
  [key: string]: unknown;