@fastnd/components 1.0.11 → 1.0.12
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.
- package/dist/components/EmptyState/EmptyState.d.ts +8 -0
- package/dist/components/ExpandButton/ExpandButton.d.ts +10 -0
- package/dist/components/ProgressCircle/ProgressCircle.d.ts +6 -0
- package/dist/components/ScoreBar/ScoreBar.d.ts +6 -0
- package/dist/components/SearchInput/SearchInput.d.ts +10 -0
- package/dist/components/SegmentedControl/SegmentedControl.d.ts +15 -0
- package/dist/components/index.d.ts +12 -0
- package/dist/components.js +734 -526
- package/dist/features/data-visualization/CardView/CardView.d.ts +24 -0
- package/dist/features/data-visualization/ConfigPopover/ConfigPopover.d.ts +12 -0
- package/dist/features/data-visualization/DataGrid/DataGrid.d.ts +34 -0
- package/dist/features/data-visualization/DataGrid/ResultCount.d.ts +8 -0
- package/dist/features/data-visualization/DataTable/DataTable.d.ts +17 -0
- package/dist/features/data-visualization/DataVisualizationPage/DataVisualizationPage.d.ts +8 -0
- package/dist/features/data-visualization/DomainSwitcher/DomainSwitcher.d.ts +9 -0
- package/dist/features/data-visualization/ListView/ListView.d.ts +19 -0
- package/dist/features/data-visualization/MoreFiltersPopover/MoreFiltersPopover.d.ts +12 -0
- package/dist/features/data-visualization/Toolbar/Toolbar.d.ts +22 -0
- package/dist/features/data-visualization/cells/CellDouble.d.ts +7 -0
- package/dist/features/data-visualization/cells/CellLink.d.ts +7 -0
- package/dist/features/data-visualization/cells/CellPrice.d.ts +7 -0
- package/dist/features/data-visualization/cells/InventoryBadge.d.ts +8 -0
- package/dist/features/data-visualization/cells/LifecycleStatusBadge.d.ts +8 -0
- package/dist/features/data-visualization/cells/index.d.ts +10 -0
- package/dist/features/data-visualization/index.d.ts +19 -0
- package/dist/features/data-visualization/types.d.ts +79 -0
- package/package.json +1 -1
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ColumnConfig, DataRow } from '../types';
|
|
3
|
+
export interface CardViewProps {
|
|
4
|
+
rows: DataRow[];
|
|
5
|
+
columns: Array<[string, ColumnConfig]>;
|
|
6
|
+
visibleColumns: Set<string>;
|
|
7
|
+
titleField: string;
|
|
8
|
+
subtitleField?: string;
|
|
9
|
+
badgeFields?: string[];
|
|
10
|
+
cardRows?: Array<{
|
|
11
|
+
label: string;
|
|
12
|
+
field: string;
|
|
13
|
+
rendererOverride?: string;
|
|
14
|
+
}>;
|
|
15
|
+
footerField?: string;
|
|
16
|
+
expandField?: string;
|
|
17
|
+
favorites: Set<string>;
|
|
18
|
+
onToggleFavorite?: (id: string) => void;
|
|
19
|
+
expandedRows: Set<string>;
|
|
20
|
+
onToggleExpand?: (compositeKey: string) => void;
|
|
21
|
+
renderCell?: (colKey: string, colConfig: ColumnConfig, row: DataRow) => React.ReactNode;
|
|
22
|
+
className?: string;
|
|
23
|
+
}
|
|
24
|
+
export declare const CardView: React.ForwardRefExoticComponent<CardViewProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ColumnConfig } from '../types';
|
|
3
|
+
export interface ConfigPopoverProps {
|
|
4
|
+
open: boolean;
|
|
5
|
+
columns: Record<string, ColumnConfig>;
|
|
6
|
+
columnOrder: string[];
|
|
7
|
+
visibleColumns: Set<string>;
|
|
8
|
+
onToggleColumn?: (key: string) => void;
|
|
9
|
+
onReorder?: (newOrder: string[]) => void;
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare const ConfigPopover: React.ForwardRefExoticComponent<ConfigPopoverProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ColumnConfig, DataRow, ViewMode, SortDirection, ViewLayout } from '../types';
|
|
3
|
+
export interface DataGridProps {
|
|
4
|
+
rows: DataRow[];
|
|
5
|
+
totalRows: number;
|
|
6
|
+
columns: Record<string, ColumnConfig>;
|
|
7
|
+
columnOrder: string[];
|
|
8
|
+
visibleColumns: Set<string>;
|
|
9
|
+
layout: ViewLayout;
|
|
10
|
+
resultLabel?: string;
|
|
11
|
+
currentView: ViewMode;
|
|
12
|
+
onViewChange?: (view: ViewMode) => void;
|
|
13
|
+
searchQuery: string;
|
|
14
|
+
onSearchChange?: (query: string) => void;
|
|
15
|
+
filters: Record<string, string | null>;
|
|
16
|
+
filterOptions: Record<string, string[]>;
|
|
17
|
+
onFilterChange?: (key: string, value: string | null) => void;
|
|
18
|
+
sortColumn: string | null;
|
|
19
|
+
sortDirection: SortDirection;
|
|
20
|
+
onSort?: (column: string) => void;
|
|
21
|
+
expandedRows: Set<string>;
|
|
22
|
+
onToggleExpand?: (compositeKey: string) => void;
|
|
23
|
+
favorites: Set<string>;
|
|
24
|
+
onToggleFavorite?: (id: string) => void;
|
|
25
|
+
columnWidths: Record<string, number>;
|
|
26
|
+
onColumnResize?: (colKey: string, width: number) => void;
|
|
27
|
+
onToggleColumn?: (key: string) => void;
|
|
28
|
+
onReorderColumns?: (newOrder: string[]) => void;
|
|
29
|
+
onClearSecondaryFilters?: () => void;
|
|
30
|
+
renderListCell?: (colKey: string, colConfig: ColumnConfig, row: DataRow) => React.ReactNode;
|
|
31
|
+
renderCardCell?: (colKey: string, colConfig: ColumnConfig, row: DataRow) => React.ReactNode;
|
|
32
|
+
className?: string;
|
|
33
|
+
}
|
|
34
|
+
export declare const DataGrid: React.ForwardRefExoticComponent<DataGridProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface ResultCountProps {
|
|
3
|
+
count: number;
|
|
4
|
+
total: number;
|
|
5
|
+
label?: string;
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const ResultCount: React.ForwardRefExoticComponent<ResultCountProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ColumnConfig, DataRow, SortDirection } from '../types';
|
|
3
|
+
export interface DataTableProps {
|
|
4
|
+
rows: DataRow[];
|
|
5
|
+
columns: Array<[string, ColumnConfig]>;
|
|
6
|
+
sortColumn: string | null;
|
|
7
|
+
sortDirection: SortDirection;
|
|
8
|
+
onSort?: (column: string) => void;
|
|
9
|
+
expandedRows: Set<string>;
|
|
10
|
+
onToggleExpand?: (compositeKey: string) => void;
|
|
11
|
+
favorites: Set<string>;
|
|
12
|
+
onToggleFavorite?: (id: string) => void;
|
|
13
|
+
columnWidths?: Record<string, number>;
|
|
14
|
+
onColumnResize?: (colKey: string, width: number) => void;
|
|
15
|
+
className?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare const DataTable: React.ForwardRefExoticComponent<DataTableProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { DataSource } from '../types';
|
|
3
|
+
export interface DataVisualizationPageProps {
|
|
4
|
+
sources: DataSource[];
|
|
5
|
+
initialSourceKey?: string;
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const DataVisualizationPage: React.ForwardRefExoticComponent<DataVisualizationPageProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { DataSource } from '../types';
|
|
3
|
+
export interface DomainSwitcherProps {
|
|
4
|
+
sources: DataSource[];
|
|
5
|
+
activeSourceKey: string;
|
|
6
|
+
onSourceChange?: (key: string) => void;
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const DomainSwitcher: React.ForwardRefExoticComponent<DomainSwitcherProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ColumnConfig, DataRow } from '../types';
|
|
3
|
+
export interface ListViewProps {
|
|
4
|
+
rows: DataRow[];
|
|
5
|
+
columns: Array<[string, ColumnConfig]>;
|
|
6
|
+
visibleColumns: Set<string>;
|
|
7
|
+
titleField: string;
|
|
8
|
+
metaFields?: string[];
|
|
9
|
+
badgeFields?: string[];
|
|
10
|
+
valueField?: string | null;
|
|
11
|
+
expandField?: string;
|
|
12
|
+
favorites: Set<string>;
|
|
13
|
+
onToggleFavorite?: (id: string) => void;
|
|
14
|
+
expandedRows: Set<string>;
|
|
15
|
+
onToggleExpand?: (compositeKey: string) => void;
|
|
16
|
+
renderCell?: (colKey: string, colConfig: ColumnConfig, row: DataRow) => React.ReactNode;
|
|
17
|
+
className?: string;
|
|
18
|
+
}
|
|
19
|
+
export declare const ListView: React.ForwardRefExoticComponent<ListViewProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ColumnConfig } from '../types';
|
|
3
|
+
export interface MoreFiltersPopoverProps {
|
|
4
|
+
open: boolean;
|
|
5
|
+
columns: Array<[string, ColumnConfig]>;
|
|
6
|
+
filters: Record<string, string | null>;
|
|
7
|
+
filterOptions: Record<string, string[]>;
|
|
8
|
+
onFilterChange?: (key: string, value: string | null) => void;
|
|
9
|
+
onClearAll?: () => void;
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare const MoreFiltersPopover: React.ForwardRefExoticComponent<MoreFiltersPopoverProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ColumnConfig, ViewMode } from '../types';
|
|
3
|
+
export interface FilterState {
|
|
4
|
+
[key: string]: string | null;
|
|
5
|
+
}
|
|
6
|
+
export interface ToolbarProps {
|
|
7
|
+
currentView: ViewMode;
|
|
8
|
+
onViewChange?: (view: ViewMode) => void;
|
|
9
|
+
searchQuery: string;
|
|
10
|
+
onSearchChange?: (query: string) => void;
|
|
11
|
+
columns: Array<[string, ColumnConfig]>;
|
|
12
|
+
filters: FilterState;
|
|
13
|
+
filterOptions: Record<string, string[]>;
|
|
14
|
+
onFilterChange?: (key: string, value: string | null) => void;
|
|
15
|
+
onSettingsClick?: () => void;
|
|
16
|
+
settingsExpanded?: boolean;
|
|
17
|
+
onMoreFiltersClick?: () => void;
|
|
18
|
+
moreFiltersExpanded?: boolean;
|
|
19
|
+
activeSecondaryFilterCount?: number;
|
|
20
|
+
className?: string;
|
|
21
|
+
}
|
|
22
|
+
export declare const Toolbar: React.ForwardRefExoticComponent<ToolbarProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type InventoryLevel = 'high' | 'medium' | 'low';
|
|
3
|
+
export interface InventoryBadgeProps {
|
|
4
|
+
level: InventoryLevel;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const InventoryBadge: React.ForwardRefExoticComponent<InventoryBadgeProps & React.RefAttributes<HTMLSpanElement>>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type LifecycleStatus = string;
|
|
3
|
+
export interface LifecycleStatusBadgeProps {
|
|
4
|
+
status: string;
|
|
5
|
+
statusClass?: string;
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const LifecycleStatusBadge: React.ForwardRefExoticComponent<LifecycleStatusBadgeProps & React.RefAttributes<HTMLSpanElement>>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { CellDouble } from './CellDouble';
|
|
2
|
+
export type { CellDoubleProps } from './CellDouble';
|
|
3
|
+
export { CellLink } from './CellLink';
|
|
4
|
+
export type { CellLinkProps } from './CellLink';
|
|
5
|
+
export { CellPrice } from './CellPrice';
|
|
6
|
+
export type { CellPriceProps } from './CellPrice';
|
|
7
|
+
export { InventoryBadge } from './InventoryBadge';
|
|
8
|
+
export type { InventoryBadgeProps, InventoryLevel } from './InventoryBadge';
|
|
9
|
+
export { LifecycleStatusBadge } from './LifecycleStatusBadge';
|
|
10
|
+
export type { LifecycleStatusBadgeProps } from './LifecycleStatusBadge';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export { DataVisualizationPage } from './DataVisualizationPage/DataVisualizationPage';
|
|
2
|
+
export type { DataVisualizationPageProps } from './DataVisualizationPage/DataVisualizationPage';
|
|
3
|
+
export { DataGrid } from './DataGrid/DataGrid';
|
|
4
|
+
export type { DataGridProps } from './DataGrid/DataGrid';
|
|
5
|
+
export { DataTable } from './DataTable/DataTable';
|
|
6
|
+
export type { DataTableProps } from './DataTable/DataTable';
|
|
7
|
+
export { Toolbar } from './Toolbar/Toolbar';
|
|
8
|
+
export type { ToolbarProps } from './Toolbar/Toolbar';
|
|
9
|
+
export { DomainSwitcher } from './DomainSwitcher/DomainSwitcher';
|
|
10
|
+
export type { DomainSwitcherProps } from './DomainSwitcher/DomainSwitcher';
|
|
11
|
+
export { ListView } from './ListView/ListView';
|
|
12
|
+
export type { ListViewProps } from './ListView/ListView';
|
|
13
|
+
export { CardView } from './CardView/CardView';
|
|
14
|
+
export type { CardViewProps } from './CardView/CardView';
|
|
15
|
+
export { ConfigPopover } from './ConfigPopover/ConfigPopover';
|
|
16
|
+
export type { ConfigPopoverProps } from './ConfigPopover/ConfigPopover';
|
|
17
|
+
export { MoreFiltersPopover } from './MoreFiltersPopover/MoreFiltersPopover';
|
|
18
|
+
export type { MoreFiltersPopoverProps } from './MoreFiltersPopover/MoreFiltersPopover';
|
|
19
|
+
export type { CellType, ColumnConfig, ColumnConfigMap, DataRow, DataSource, ViewMode, SortDirection, DataGridState, ViewLayout, ExpandColumnDef, } from './types';
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
export type CellType = 'text' | 'double-text' | 'link' | 'status-badge' | 'currency' | 'inventory' | 'inventory-label' | 'progress' | 'favorite' | 'expand';
|
|
2
|
+
export interface ExpandColumnDef {
|
|
3
|
+
key: string;
|
|
4
|
+
label: string;
|
|
5
|
+
type?: 'score-bar';
|
|
6
|
+
bold?: boolean;
|
|
7
|
+
muted?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface ColumnConfig {
|
|
10
|
+
label: string;
|
|
11
|
+
type: CellType;
|
|
12
|
+
sortable?: boolean;
|
|
13
|
+
filterable?: boolean;
|
|
14
|
+
primaryFilter?: boolean;
|
|
15
|
+
visible?: boolean;
|
|
16
|
+
searchable?: boolean;
|
|
17
|
+
hideTablet?: boolean;
|
|
18
|
+
hideMobile?: boolean;
|
|
19
|
+
secondary?: string;
|
|
20
|
+
statusMap?: Record<string, string>;
|
|
21
|
+
currencyField?: string;
|
|
22
|
+
levelFn?: (value: number) => 'high' | 'medium' | 'low';
|
|
23
|
+
formatFn?: (value: number) => string;
|
|
24
|
+
labelMap?: Record<string, string>;
|
|
25
|
+
filterOptions?: string[];
|
|
26
|
+
filterFn?: (row: DataRow, selectedValue: string) => boolean;
|
|
27
|
+
expandLabel?: string;
|
|
28
|
+
expandColumns?: ExpandColumnDef[];
|
|
29
|
+
expandTitleFn?: (row: DataRow) => string;
|
|
30
|
+
}
|
|
31
|
+
export type ColumnConfigMap = Record<string, ColumnConfig>;
|
|
32
|
+
export interface ViewLayout {
|
|
33
|
+
list: {
|
|
34
|
+
titleField: string;
|
|
35
|
+
metaFields?: string[];
|
|
36
|
+
badgeFields?: string[];
|
|
37
|
+
valueField?: string | null;
|
|
38
|
+
expandField?: string;
|
|
39
|
+
};
|
|
40
|
+
card: {
|
|
41
|
+
titleField: string;
|
|
42
|
+
subtitleField?: string;
|
|
43
|
+
badgeFields?: string[];
|
|
44
|
+
rows?: Array<{
|
|
45
|
+
label: string;
|
|
46
|
+
field: string;
|
|
47
|
+
rendererOverride?: CellType;
|
|
48
|
+
}>;
|
|
49
|
+
footerField?: string;
|
|
50
|
+
expandField?: string;
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
export interface DataRow {
|
|
54
|
+
id: string;
|
|
55
|
+
favorite?: boolean;
|
|
56
|
+
[key: string]: unknown;
|
|
57
|
+
}
|
|
58
|
+
export interface DataSource {
|
|
59
|
+
key: string;
|
|
60
|
+
label: string;
|
|
61
|
+
resultLabel: string;
|
|
62
|
+
data: DataRow[];
|
|
63
|
+
columns: ColumnConfigMap;
|
|
64
|
+
layout: ViewLayout;
|
|
65
|
+
}
|
|
66
|
+
export type ViewMode = 'table' | 'list' | 'cards';
|
|
67
|
+
export type SortDirection = 'asc' | 'desc';
|
|
68
|
+
export interface DataGridState {
|
|
69
|
+
currentView: ViewMode;
|
|
70
|
+
searchQuery: string;
|
|
71
|
+
filters: Record<string, string | null>;
|
|
72
|
+
sortColumn: string | null;
|
|
73
|
+
sortDirection: SortDirection;
|
|
74
|
+
expandedRows: Set<string>;
|
|
75
|
+
favorites: Set<string>;
|
|
76
|
+
visibleColumns: Set<string>;
|
|
77
|
+
columnOrder: string[];
|
|
78
|
+
columnWidths: Record<string, number>;
|
|
79
|
+
}
|