@fattureincloud/fic-design-system 0.4.27 → 0.4.29-new-table
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/badge/Badge.d.ts +11 -1
- package/dist/components/badge/badge.stories.d.ts +3 -2
- package/dist/components/badge/badgePalette.d.ts +3 -0
- package/dist/components/badge/index.d.ts +3 -3
- package/dist/components/badge/types.d.ts +17 -1
- package/dist/components/banner/Banner.d.ts +10 -9
- package/dist/components/banner/banner.stories.d.ts +3 -4
- package/dist/components/banner/bannerPalette.d.ts +3 -0
- package/dist/components/banner/index.d.ts +3 -2
- package/dist/components/banner/styled.d.ts +5 -0
- package/dist/components/banner/types.d.ts +23 -0
- package/dist/components/chip/Chip.d.ts +13 -0
- package/dist/components/chip/chip.stories.d.ts +6 -0
- package/dist/components/chip/chipPalette.d.ts +3 -0
- package/dist/components/chip/index.d.ts +3 -0
- package/dist/components/chip/styled.d.ts +6 -0
- package/dist/components/chip/types.d.ts +25 -0
- package/dist/components/dropdown/DropdownImpl.d.ts +1 -1
- package/dist/components/dropdown/types.d.ts +1 -0
- package/dist/components/floatingBadge/NotificationBadge.d.ts +9 -0
- package/dist/components/floatingBadge/floatingBadge.d.ts +7 -1
- package/dist/components/floatingBadge/floatingBadge.stories.d.ts +2 -1
- package/dist/components/floatingBadge/floatingBadgePalette.d.ts +3 -0
- package/dist/components/floatingBadge/index.d.ts +4 -2
- package/dist/components/floatingBadge/types.d.ts +24 -3
- package/dist/components/floatingBadge/withBadge.d.ts +5 -0
- package/dist/components/form/datepicker/StyledDatePicker.d.ts +1 -0
- package/dist/components/form/datepicker/hooks/useDatePickerValues.d.ts +13 -0
- package/dist/components/form/label/Label.d.ts +9 -8
- package/dist/components/form/label/index.d.ts +3 -2
- package/dist/components/form/label/labelPalette.d.ts +3 -0
- package/dist/components/form/label/styled.d.ts +2 -0
- package/dist/components/form/label/types.d.ts +21 -0
- package/dist/components/form/label/utils.d.ts +9 -0
- package/dist/components/form/radioGroup/index.d.ts +1 -1
- package/dist/components/form/radioGroup/types.d.ts +3 -2
- package/dist/components/form/select/components/Placeholder.d.ts +4 -0
- package/dist/components/form/textArea/TextArea.d.ts +3 -3
- package/dist/components/form/textArea/components/TextAreaElement.d.ts +2 -2
- package/dist/components/layout/index.d.ts +1 -2
- package/dist/components/layout/sidebarItem/SidebarItem.d.ts +19 -26
- package/dist/components/layout/sidebarItem/components/SidebarItemDropdown.d.ts +2 -7
- package/dist/components/layout/sidebarItem/index.d.ts +5 -5
- package/dist/components/layout/sidebarItem/sidebarItem.stories.d.ts +2 -1
- package/dist/components/layout/sidebarItem/sidebarItemPalette.d.ts +1 -12
- package/dist/components/layout/sidebarItem/styled.d.ts +13 -0
- package/dist/components/layout/sidebarItem/types.d.ts +58 -2
- package/dist/components/layout/sidebarItem/utils.d.ts +2 -2
- package/dist/components/newTable/Table.d.ts +32 -0
- package/dist/components/newTable/components/action/favorite/Favorite.d.ts +14 -0
- package/dist/components/newTable/components/action/favorite/index.d.ts +1 -0
- package/dist/components/newTable/components/action/favorite/styled.d.ts +4 -0
- package/dist/components/newTable/components/action/settings/ColumnsSettings/ColumnItem/ColumnItem.d.ts +8 -0
- package/dist/components/newTable/components/action/settings/ColumnsSettings/ColumnItem/styled.d.ts +4 -0
- package/dist/components/newTable/components/action/settings/ColumnsSettings/ColumnsSettings.d.ts +8 -0
- package/dist/components/newTable/components/action/settings/ColumnsSettings/DraggableContent/DraggableContent.d.ts +7 -0
- package/dist/components/newTable/components/action/settings/ColumnsSettings/index.d.ts +2 -0
- package/dist/components/newTable/components/action/settings/ColumnsSettings/styled.d.ts +4 -0
- package/dist/components/newTable/components/action/settings/DropdownSettings/DropdownSettings.d.ts +7 -0
- package/dist/components/newTable/components/action/settings/DropdownSettings/index.d.ts +1 -0
- package/dist/components/newTable/components/action/settings/DropdownSettings/styled.d.ts +4 -0
- package/dist/components/newTable/components/action/settings/RowHeightSettings/RowHeightSettings.d.ts +10 -0
- package/dist/components/newTable/components/action/settings/RowHeightSettings/index.d.ts +1 -0
- package/dist/components/newTable/components/action/settings/RowHeightSettings/styled.d.ts +2 -0
- package/dist/components/newTable/components/action/settings/Settings.d.ts +8 -0
- package/dist/components/newTable/components/action/settings/hooks/index.d.ts +2 -0
- package/dist/components/newTable/components/action/settings/hooks/useColumnValues.d.ts +8 -0
- package/dist/components/newTable/components/action/settings/hooks/useDropdownSettingsValues.d.ts +13 -0
- package/dist/components/newTable/components/action/settings/index.d.ts +1 -0
- package/dist/components/newTable/components/action/settings/styled.d.ts +2 -0
- package/dist/components/newTable/components/action/toggle/Toggle.d.ts +14 -0
- package/dist/components/newTable/components/action/toggle/constants.d.ts +3 -0
- package/dist/components/newTable/components/action/toggle/index.d.ts +1 -0
- package/dist/components/newTable/components/action/toggle/styled.d.ts +5 -0
- package/dist/components/newTable/components/body/Body.d.ts +9 -0
- package/dist/components/newTable/components/bulkBar/BulkBar.d.ts +9 -0
- package/dist/components/newTable/components/bulkBar/styled.d.ts +10 -0
- package/dist/components/newTable/components/cell/Cell.d.ts +12 -0
- package/dist/components/newTable/components/cell/customActionCell/CustomActionCell.d.ts +12 -0
- package/dist/components/newTable/components/cell/customActionCell/DropdownActionCell.d.ts +10 -0
- package/dist/components/newTable/components/cell/customActionCell/PrimaryActionCell.d.ts +9 -0
- package/dist/components/newTable/components/cell/customActionCell/index.d.ts +3 -0
- package/dist/components/newTable/components/cell/customActionCell/styled.d.ts +4 -0
- package/dist/components/newTable/components/cell/customCell/CustomCell.d.ts +11 -0
- package/dist/components/newTable/components/cell/customCell/CustomInput.d.ts +9 -0
- package/dist/components/newTable/components/cell/customCell/TextAreaPopup.d.ts +9 -0
- package/dist/components/newTable/components/cell/customCell/constants.d.ts +1 -0
- package/dist/components/newTable/components/cell/customCell/index.d.ts +1 -0
- package/dist/components/newTable/components/cell/customCell/styled.d.ts +7 -0
- package/dist/components/newTable/components/cell/hooks/index.d.ts +1 -0
- package/dist/components/newTable/components/cell/hooks/useCellValues.d.ts +16 -0
- package/dist/components/newTable/components/cell/loadingCell/LoadingCell.d.ts +7 -0
- package/dist/components/newTable/components/cell/loadingCell/index.d.ts +1 -0
- package/dist/components/newTable/components/cell/styled.d.ts +20 -0
- package/dist/components/newTable/components/footer/Footer.d.ts +7 -0
- package/dist/components/newTable/components/header/Header.d.ts +10 -0
- package/dist/components/newTable/components/header/headerCell/ActionHeaderCell.d.ts +8 -0
- package/dist/components/newTable/components/header/headerCell/HeaderCell.d.ts +12 -0
- package/dist/components/newTable/components/header/headerCell/styled.d.ts +9 -0
- package/dist/components/newTable/components/header/hooks/index.d.ts +2 -0
- package/dist/components/newTable/components/header/hooks/useActionHeaderValues.d.ts +16 -0
- package/dist/components/newTable/components/header/hooks/useHeaderValues.d.ts +14 -0
- package/dist/components/newTable/components/row/Row.d.ts +10 -0
- package/dist/components/newTable/components/row/styled.d.ts +6 -0
- package/dist/components/newTable/components/utils.d.ts +10 -0
- package/dist/components/newTable/constants.d.ts +2 -0
- package/dist/components/newTable/hooks/useColumnPinning.d.ts +8 -0
- package/dist/components/newTable/hooks/usePagination.d.ts +9 -0
- package/dist/components/newTable/index.d.ts +2 -0
- package/dist/components/newTable/providers/TableProvider/TableProvider.d.ts +5 -0
- package/dist/components/newTable/providers/TableProvider/index.d.ts +3 -0
- package/dist/components/newTable/providers/TableProvider/types.d.ts +10 -0
- package/dist/components/newTable/stories/actions.d.ts +4 -0
- package/dist/components/newTable/stories/columns.d.ts +3 -0
- package/dist/components/newTable/stories/data.d.ts +2 -0
- package/dist/components/newTable/stories/styled.d.ts +1 -0
- package/dist/components/newTable/stories/types.d.ts +9 -0
- package/dist/components/newTable/styled.d.ts +9 -0
- package/dist/components/newTable/table.stories.d.ts +6 -0
- package/dist/components/newTable/types.d.ts +170 -0
- package/dist/components/newTable/utils.d.ts +8 -0
- package/dist/components/pagination/Pagination.d.ts +15 -0
- package/dist/components/pagination/index.d.ts +3 -3
- package/dist/components/pagination/pagination.stories.d.ts +3 -3
- package/dist/components/pagination/paginationPalette.d.ts +3 -0
- package/dist/components/pagination/styled.d.ts +4 -0
- package/dist/components/pagination/types.d.ts +18 -0
- package/dist/components/progressbar/index.d.ts +3 -2
- package/dist/components/progressbar/progressBarPalette.d.ts +3 -0
- package/dist/components/progressbar/progressbar.d.ts +9 -8
- package/dist/components/progressbar/progressbar.stories.d.ts +6 -4
- package/dist/components/progressbar/styled.d.ts +3 -0
- package/dist/components/progressbar/types.d.ts +15 -9
- package/dist/components/table/components/ActionsCell.d.ts +10 -0
- package/dist/components/table/components/SortIndicator.d.ts +6 -0
- package/dist/components/table/components/TableBody.d.ts +14 -0
- package/dist/components/table/components/TableFoot.d.ts +2 -0
- package/dist/components/table/components/TableHeader.d.ts +7 -0
- package/dist/components/table/components/tableBody/TableBodyLoader.d.ts +7 -0
- package/dist/components/table/components/tableBody/styled.d.ts +3 -0
- package/dist/components/tip/index.d.ts +4 -3
- package/dist/components/tip/shortcutTip.d.ts +12 -1
- package/dist/components/tip/styled.d.ts +5 -0
- package/dist/components/tip/tip.d.ts +11 -1
- package/dist/components/tip/tip.stories.d.ts +4 -5
- package/dist/components/tip/tipPalette.d.ts +3 -0
- package/dist/components/tip/types.d.ts +24 -6
- package/dist/components/toast/components/{ToastContent.d.ts → toastContent.d.ts} +0 -0
- package/dist/components/toast/{Toast.d.ts → toast.d.ts} +0 -0
- package/dist/components/tooltip/Tooltip.d.ts +3 -1
- package/dist/index.d.ts +12 -11
- package/dist/index.esm.js +26 -5
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +25 -4
- package/dist/index.js.map +1 -1
- package/dist/styles/theme.d.ts +16 -0
- package/package.json +2 -1
- package/CHANGELOG.md +0 -508
@@ -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,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,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,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 @@
|
|
1
|
+
export declare const TableWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
@@ -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,170 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { DisplayColumnDef, GroupColumnDef, IdentifiedColumnDef, PaginationState, Row, SortDirection } from '@tanstack/react-table';
|
3
|
+
import { AvatarProps } from '../avatar/types';
|
4
|
+
import { ButtonProps } from '../buttons';
|
5
|
+
import { DropdownItemType } from '../dropdown/types';
|
6
|
+
import { IconProps } from '../icon/Icon';
|
7
|
+
import { MicroTagProps } from '../microTag/MicroTag';
|
8
|
+
import { TagProps } from '../tag/types';
|
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
|
+
}
|
40
|
+
interface SettingsDropdownConfig {
|
41
|
+
settingsTooltip?: TooltipProps;
|
42
|
+
displaySettingsLabel?: string;
|
43
|
+
visibleColumnsLabel?: string;
|
44
|
+
rowHeightLabel?: string;
|
45
|
+
unspecifiedRowsLabel?: string;
|
46
|
+
smallRowsLabel?: string;
|
47
|
+
largeRowsLabel?: string;
|
48
|
+
}
|
49
|
+
export declare enum RowSize {
|
50
|
+
UNSPECIFIED = 0,
|
51
|
+
SMALL,
|
52
|
+
LARGE
|
53
|
+
}
|
54
|
+
export declare enum ColumnDefType {
|
55
|
+
ACCESSOR = "accessor",
|
56
|
+
DISPLAY = "display",
|
57
|
+
GROUP = "group",
|
58
|
+
ACTION = "action"
|
59
|
+
}
|
60
|
+
interface ExtraColumnDef<T> extends IdentifiedColumnDef<T, CellProps> {
|
61
|
+
isEditable: boolean;
|
62
|
+
onChange: (text: string, row: Row<T>) => void;
|
63
|
+
}
|
64
|
+
interface InitalColumnDef<T> extends IdentifiedColumnDef<T, CellProps> {
|
65
|
+
isEditable?: false;
|
66
|
+
onChange?: never;
|
67
|
+
}
|
68
|
+
export declare type AccessorColumnDef<T> = InitalColumnDef<T> | ExtraColumnDef<T>;
|
69
|
+
export declare enum ActionType {
|
70
|
+
CHECKBOX = "checkbox",
|
71
|
+
TOGGLE = "toggle",
|
72
|
+
FAVORITE = "favorite",
|
73
|
+
ROW_ACTIONS = "row_actions",
|
74
|
+
SETTINGS = "settings"
|
75
|
+
}
|
76
|
+
export declare type ActionColumnDef<T> = {
|
77
|
+
onActionChange?: (id: string) => void;
|
78
|
+
actionType: ActionType;
|
79
|
+
favorites?: string[];
|
80
|
+
toggles?: string[];
|
81
|
+
enableSorting?: boolean;
|
82
|
+
enableSettings?: boolean;
|
83
|
+
rowActions?: RowActions<T>;
|
84
|
+
settingsDropdownConfig?: SettingsDropdownConfig;
|
85
|
+
} & IdentifiedColumnDef<T, CellProps>;
|
86
|
+
export declare type AdditionalColumnDef = {
|
87
|
+
unitSymbol?: string;
|
88
|
+
minWidth?: number;
|
89
|
+
headerTooltip?: TooltipProps;
|
90
|
+
};
|
91
|
+
export declare type ColumnsType<T> = ({
|
92
|
+
columnDefType: ColumnDefType.ACCESSOR;
|
93
|
+
columnDef: AccessorColumnDef<T> & AdditionalColumnDef;
|
94
|
+
} & BaseColumnsType<T>) | ({
|
95
|
+
columnDefType: ColumnDefType.DISPLAY;
|
96
|
+
columnDef: DisplayColumnDef<T, unknown> & AdditionalColumnDef;
|
97
|
+
} & BaseColumnsType<T>) | ({
|
98
|
+
columnDefType: ColumnDefType.ACTION;
|
99
|
+
columnDef: ActionColumnDef<T> & AdditionalColumnDef;
|
100
|
+
} & BaseColumnsType<T>) | ({
|
101
|
+
columnDefType: ColumnDefType.GROUP;
|
102
|
+
columnDef: GroupColumnDef<T, unknown>;
|
103
|
+
} & BaseColumnsType<T>);
|
104
|
+
interface BaseColumnsType<T> {
|
105
|
+
key: keyof T | Lowercase<keyof typeof ActionType>;
|
106
|
+
}
|
107
|
+
interface CustomCellWithAvatar extends BasicCustomCell {
|
108
|
+
avatar?: AvatarProps;
|
109
|
+
leadingIcon?: never;
|
110
|
+
}
|
111
|
+
interface CustomCellWithIcon extends BasicCustomCell {
|
112
|
+
avatar?: never;
|
113
|
+
leadingIcon?: IconProps;
|
114
|
+
}
|
115
|
+
export interface BasicCustomCell {
|
116
|
+
unitSymbol?: string;
|
117
|
+
trailingMicroTag?: MicroTagProps;
|
118
|
+
headline?: boolean;
|
119
|
+
content?: string | number;
|
120
|
+
tag?: TagProps;
|
121
|
+
isFavorite?: boolean;
|
122
|
+
isToggled?: boolean;
|
123
|
+
}
|
124
|
+
export declare type CustomCellProps = CustomCellWithIcon | CustomCellWithAvatar;
|
125
|
+
export declare type CellProps = CustomCellProps | string | number;
|
126
|
+
export interface RowActions<T> {
|
127
|
+
headerTitle?: string | number;
|
128
|
+
primary?: PrimaryAction<T>;
|
129
|
+
dropdown?: DropdownAction<T>;
|
130
|
+
}
|
131
|
+
export interface RowAction<T> {
|
132
|
+
text: string;
|
133
|
+
icon?: IconProps;
|
134
|
+
type?: DropdownItemType;
|
135
|
+
onClick: (row: Row<T>) => void;
|
136
|
+
}
|
137
|
+
declare type BasicPrimaryAction<T> = {
|
138
|
+
tooltip?: TooltipProps;
|
139
|
+
onClick: (row: Row<T>) => void;
|
140
|
+
};
|
141
|
+
interface PrimaryTextAction<T> extends BasicPrimaryAction<T> {
|
142
|
+
text?: string | number;
|
143
|
+
icon?: never;
|
144
|
+
}
|
145
|
+
interface PrimaryIconAction<T> extends BasicPrimaryAction<T> {
|
146
|
+
text?: never;
|
147
|
+
icon?: IconProps;
|
148
|
+
}
|
149
|
+
export declare type PrimaryAction<T> = PrimaryTextAction<T> | PrimaryIconAction<T>;
|
150
|
+
export declare type DropdownAction<T> = {
|
151
|
+
items: RowAction<T>[];
|
152
|
+
tooltip?: TooltipProps;
|
153
|
+
};
|
154
|
+
export interface BulkAction<T> extends Omit<ButtonProps, 'onClick' | 'text'> {
|
155
|
+
onClick: (rows: T[]) => void;
|
156
|
+
text: string | JSX.Element;
|
157
|
+
}
|
158
|
+
export interface AllSelectedCTA {
|
159
|
+
description?: string;
|
160
|
+
onClick: () => void;
|
161
|
+
text: string;
|
162
|
+
}
|
163
|
+
export declare type OnSort<T> = (sortParams: {
|
164
|
+
sortBy: keyof T;
|
165
|
+
direction: false | SortDirection;
|
166
|
+
}) => void;
|
167
|
+
export declare type CustomSorted<T> = {
|
168
|
+
[key in keyof T]: false | SortDirection;
|
169
|
+
};
|
170
|
+
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,15 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { PaginationProps } from './types';
|
3
|
+
/**
|
4
|
+
* Component Props:
|
5
|
+
* @param {number} pageSize Define the page size to use in every page
|
6
|
+
* @param {number} listSize Define the total size of the list
|
7
|
+
* @param {function} changePageAction Callback called when the user changes the page
|
8
|
+
* @param {function} nextPageAction Callback called on next page button clicked
|
9
|
+
* @param {function} prevPageAction Callback called on previous page button clicked
|
10
|
+
* @param {number} currentPage Used to set the current page number
|
11
|
+
* @param {string} prevText Define previous label text
|
12
|
+
* @param {string} nextText Define next label text
|
13
|
+
*/
|
14
|
+
declare const Pagination: (props: PaginationProps) => JSX.Element;
|
15
|
+
export default Pagination;
|
@@ -1,3 +1,3 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
export
|
1
|
+
export { default as Pagination } from './Pagination';
|
2
|
+
export { default as paginationPalette } from './paginationPalette';
|
3
|
+
export { PaginationPalette } from './types';
|
@@ -1,6 +1,6 @@
|
|
1
|
-
|
2
|
-
import { Meta } from '@storybook/react';
|
1
|
+
import { Meta, Story } from '@storybook/react';
|
3
2
|
import { PaginationProps } from './types';
|
4
|
-
export declare const
|
3
|
+
export declare const Template: Story<PaginationProps>;
|
4
|
+
export declare const Normal: Story<PaginationProps>;
|
5
5
|
declare const PaginationStories: Meta<PaginationProps>;
|
6
6
|
export default PaginationStories;
|
@@ -0,0 +1,4 @@
|
|
1
|
+
export declare const PaginationContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, 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>;
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { paletteColor } from '../../styles/types';
|
1
2
|
export declare type PaginationProps = {
|
2
3
|
pageSize: number;
|
3
4
|
listSize: number;
|
@@ -8,3 +9,20 @@ export declare type PaginationProps = {
|
|
8
9
|
prevText: string;
|
9
10
|
nextText: string;
|
10
11
|
};
|
12
|
+
declare type PaginationNumbersStatus = 'normal' | 'hover' | 'active';
|
13
|
+
declare type PaginationButtonsStatus = 'normal' | 'disabled';
|
14
|
+
export declare type PaginationPalette = {
|
15
|
+
numbers: {
|
16
|
+
[k in PaginationNumbersStatus]: {
|
17
|
+
backgroundColor: paletteColor;
|
18
|
+
color: paletteColor;
|
19
|
+
};
|
20
|
+
};
|
21
|
+
buttons: {
|
22
|
+
[k in PaginationButtonsStatus]: {
|
23
|
+
backgroundColor: paletteColor;
|
24
|
+
color: paletteColor;
|
25
|
+
};
|
26
|
+
};
|
27
|
+
};
|
28
|
+
export {};
|
@@ -1,2 +1,3 @@
|
|
1
|
-
|
2
|
-
export {
|
1
|
+
export { default as ProgressBar } from './ProgressBar';
|
2
|
+
export { ProgressBarProps, ProgressBarPalette, ProgressBarType } from './types';
|
3
|
+
export { default as progressBarPalette } from './progressBarPalette';
|
@@ -1,8 +1,9 @@
|
|
1
|
-
|
2
|
-
import {
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
}
|
7
|
-
|
8
|
-
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { ProgressBarProps } from './types';
|
3
|
+
/**
|
4
|
+
* Component Props:
|
5
|
+
* @param {ProgressBarType} color Used to set the colors of the component
|
6
|
+
* @param {number} percentage Numeric value used to set the progress bar percentage value
|
7
|
+
*/
|
8
|
+
declare const ProgressBar: (props: ProgressBarProps) => JSX.Element;
|
9
|
+
export default ProgressBar;
|
@@ -1,8 +1,10 @@
|
|
1
|
-
import { Meta } from '@storybook/react';
|
1
|
+
import { Meta, Story } from '@storybook/react';
|
2
2
|
import { ComponentProps } from 'react';
|
3
|
-
import {
|
3
|
+
import { ProgressBar } from '.';
|
4
|
+
import { ProgressBarProps } from './';
|
5
|
+
export declare const Template: Story<ProgressBarProps>;
|
4
6
|
export declare const Editable: () => JSX.Element;
|
5
7
|
export declare const Autocomplete: () => JSX.Element;
|
6
8
|
export declare const AllColors: () => JSX.Element;
|
7
|
-
declare const
|
8
|
-
export default
|
9
|
+
declare const ProgressBarStories: Meta<ComponentProps<typeof ProgressBar>>;
|
10
|
+
export default ProgressBarStories;
|
@@ -0,0 +1,3 @@
|
|
1
|
+
import { ProgressBarProps } from './types';
|
2
|
+
export declare const ProgressContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
3
|
+
export declare const ProgressionBar: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, ProgressBarProps, never>;
|
@@ -1,11 +1,17 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
1
|
+
import { paletteColor } from '../../styles/types';
|
2
|
+
export declare enum ProgressBarType {
|
3
|
+
GREY = "grey",
|
4
|
+
RED = "red",
|
5
|
+
BLUE = "blue",
|
6
|
+
YELLOW = "yellow",
|
7
|
+
GREEN = "green"
|
8
8
|
}
|
9
|
-
export interface
|
9
|
+
export interface ProgressBarProps {
|
10
|
+
color?: ProgressBarType;
|
11
|
+
percentage: number;
|
10
12
|
}
|
11
|
-
export {
|
13
|
+
export declare type ProgressBarPalette = {
|
14
|
+
[key in ProgressBarType]: {
|
15
|
+
backgroundColor: paletteColor;
|
16
|
+
};
|
17
|
+
};
|
@@ -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,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,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>;
|
@@ -1,3 +1,4 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
export {
|
1
|
+
export { default as ShortcutTip } from './ShortcutTip';
|
2
|
+
export { default as Tip } from './Tip';
|
3
|
+
export { ShortcutTipProps, TipProps, TipPalette, TipType } from './types';
|
4
|
+
export { default as tipPalette } from './tipPalette';
|
@@ -1,4 +1,15 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
import { ShortcutTipProps } from './types';
|
3
|
-
|
3
|
+
/**
|
4
|
+
* Component Props:
|
5
|
+
* @param {string} className To support styled-components customization
|
6
|
+
* @param {IconProps} closeIcon Configuration of the right icon, not rendered if onClose is not set
|
7
|
+
* @param {IconProps} leftIcon Configuration of the left icon
|
8
|
+
* @param {function} onClose Callback called on right icon click
|
9
|
+
* @param {function} renderCloseIcon Used to render a custom component instead of the right icon, not called if onClose is not set
|
10
|
+
* @param {string} shortcut Render a bold text beside the main text
|
11
|
+
* @param {string} text Component main text
|
12
|
+
* @param {TipType} type Used to set style and colors of the component among those present in the palette
|
13
|
+
*/
|
14
|
+
declare const ShortcutTip: ({ shortcut, text, ...rest }: ShortcutTipProps) => JSX.Element;
|
4
15
|
export default ShortcutTip;
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import { TipWrapperProps } from './types';
|
2
|
+
export declare const TipWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, TipWrapperProps, never>;
|
3
|
+
export declare const TipLeftIcon: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {}, never>;
|
4
|
+
export declare const TipText: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {}, never>;
|
5
|
+
export declare const TipCloseIcon: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
@@ -1,4 +1,14 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
import { TipProps } from './types';
|
3
|
-
|
3
|
+
/**
|
4
|
+
* Component Props:
|
5
|
+
* @param {string} className To support styled-components customization
|
6
|
+
* @param {IconProps} closeIcon Configuration of the right icon, not rendered if onClose is not set
|
7
|
+
* @param {IconProps} leftIcon Configuration of the left icon
|
8
|
+
* @param {function} onClose Callback called on right icon click
|
9
|
+
* @param {function} renderCloseIcon Used to render a custom component instead of the right icon, not called if onClose is not set
|
10
|
+
* @param {string|ReactNode} text Component main content
|
11
|
+
* @param {TipType} type Used to set style and colors of the component among those present in the palette
|
12
|
+
*/
|
13
|
+
declare const Tip: ({ className, closeIcon, leftIcon, onClose, renderCloseIcon, text, type }: TipProps) => JSX.Element;
|
4
14
|
export default Tip;
|
@@ -1,7 +1,6 @@
|
|
1
|
-
|
2
|
-
import {
|
3
|
-
|
4
|
-
export declare const
|
5
|
-
export declare const Premade: () => JSX.Element;
|
1
|
+
import { Meta, Story } from '@storybook/react';
|
2
|
+
import { ShortcutTipProps, TipProps } from './types';
|
3
|
+
export declare const Normal: Story<TipProps>;
|
4
|
+
export declare const Shortcut: Story<ShortcutTipProps>;
|
6
5
|
declare const TipStories: Meta<TipProps>;
|
7
6
|
export default TipStories;
|
@@ -1,15 +1,33 @@
|
|
1
|
-
import {
|
1
|
+
import { ReactChild } from 'react';
|
2
|
+
import { paletteColor } from '../..';
|
2
3
|
import { IconProps } from '../icon';
|
4
|
+
export declare enum TipType {
|
5
|
+
STANDARD = "standard",
|
6
|
+
ERROR = "error",
|
7
|
+
INFO = "info",
|
8
|
+
WARNING = "warning",
|
9
|
+
SUCCESS = "success"
|
10
|
+
}
|
11
|
+
export interface TipWrapperProps {
|
12
|
+
className?: string;
|
13
|
+
type: TipType;
|
14
|
+
}
|
3
15
|
export interface TipProps {
|
4
|
-
|
16
|
+
className?: string;
|
17
|
+
closeIcon?: IconProps;
|
5
18
|
leftIcon?: IconProps;
|
6
19
|
onClose?: () => void;
|
7
|
-
closeIcon?: IconProps;
|
8
20
|
renderCloseIcon?: () => JSX.Element;
|
9
|
-
|
10
|
-
|
21
|
+
text: ReactChild;
|
22
|
+
type?: TipType;
|
11
23
|
}
|
24
|
+
export declare type TipPalette = {
|
25
|
+
[key in TipType]: {
|
26
|
+
color: paletteColor;
|
27
|
+
backgroundColor: paletteColor;
|
28
|
+
};
|
29
|
+
};
|
12
30
|
export interface ShortcutTipProps extends Omit<TipProps, 'text'> {
|
13
|
-
text: string;
|
14
31
|
shortcut: string;
|
32
|
+
text: string;
|
15
33
|
}
|
File without changes
|
File without changes
|