Skip to content

Commit dd81fad

Browse files
feat: Add style changes for filter
1 parent db3c384 commit dd81fad

File tree

4 files changed

+46
-33
lines changed

4 files changed

+46
-33
lines changed

src/components/TableHeader.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,9 @@ export const TableHeader: React.FC<TableHeaderProps> = ({
100100
onChange={(e) => column.setFilter?.(e.target.value)}
101101
placeholder={`Filter ${column.title || column.id}...`}
102102
style={{
103-
color: theme.table?.header?.textColor,
104-
borderColor: theme.table?.header?.textColor,
103+
color: theme.table?.filter?.textColor,
104+
borderColor: theme.table?.filter?.borderColor,
105+
backgroundColor: theme.table?.filter?.background,
105106
}}
106107
/>
107108
</div>

src/defaultThemeProps.ts

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,30 @@ import type { ThemeProps } from './types/theme';
22

33
export const defaultThemeProps: ThemeProps = {
44
colors: {
5-
primaryColor: '#007bff',
6-
textColor: '#212529',
7-
borderColor: '#dee2e6',
85
background: '#ffffff',
6+
primaryColor: '#3498db',
7+
borderColor: '#e0e0e0',
98
},
109
table: {
1110
header: {
12-
background: '#e9ecef',
13-
textColor: '#495057',
14-
borderColor: '#dee2e6',
11+
background: '#2c3e50',
12+
textColor: '#ffffff',
1513
},
1614
row: {
1715
mainBackground: '#ffffff',
1816
nestedBackground: '#f8f9fa',
19-
expandedBackground: '#e9ecef',
20-
hoverBackground: '#f8f9fa',
17+
expandedBackground: '#f1f3f5',
2118
},
2219
cell: {
23-
textColor: '#212529',
24-
borderColor: '#dee2e6',
25-
nestedPadding: '1rem',
20+
textColor: '#333333',
21+
borderColor: '#e0e0e0',
22+
},
23+
filter: {
24+
background: 'transparent',
25+
textColor: '#ffffff',
26+
borderColor: '#ffffff',
27+
focusBorderColor: '#3498db',
28+
placeholderColor: 'rgba(255, 255, 255, 0.7)',
2629
},
2730
},
2831
pagination: {

src/themes.ts

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,30 @@ import type { ThemeProps } from './types/theme';
22

33
export const lightTheme: ThemeProps = {
44
colors: {
5+
background: '#ffffff',
56
primaryColor: '#007bff',
6-
textColor: '#212529',
77
borderColor: '#dee2e6',
8-
background: '#ffffff',
98
},
109
table: {
1110
header: {
1211
background: '#e9ecef',
1312
textColor: '#495057',
13+
},
14+
cell: {
15+
textColor: '#212529',
1416
borderColor: '#dee2e6',
1517
},
1618
row: {
1719
mainBackground: '#ffffff',
1820
nestedBackground: '#f8f9fa',
1921
expandedBackground: '#e9ecef',
20-
hoverBackground: '#f8f9fa',
2122
},
22-
cell: {
23-
textColor: '#212529',
24-
borderColor: '#dee2e6',
25-
nestedPadding: '1rem',
23+
filter: {
24+
background: 'transparent',
25+
textColor: '#495057',
26+
borderColor: '#495057',
27+
focusBorderColor: '#007bff',
28+
placeholderColor: 'rgba(73, 80, 87, 0.7)',
2629
},
2730
},
2831
pagination: {
@@ -47,27 +50,30 @@ export const lightTheme: ThemeProps = {
4750

4851
export const darkTheme: ThemeProps = {
4952
colors: {
53+
background: '#212529',
5054
primaryColor: '#0d6efd',
51-
textColor: '#ffffff',
5255
borderColor: '#495057',
53-
background: '#212529',
5456
},
5557
table: {
5658
header: {
5759
background: '#2b3035',
5860
textColor: '#e9ecef',
61+
},
62+
cell: {
63+
textColor: '#e9ecef',
5964
borderColor: '#495057',
6065
},
6166
row: {
6267
mainBackground: '#343a40',
6368
nestedBackground: '#2b3035',
6469
expandedBackground: '#212529',
65-
hoverBackground: '#2b3035',
6670
},
67-
cell: {
71+
filter: {
72+
background: 'transparent',
6873
textColor: '#e9ecef',
69-
borderColor: '#495057',
70-
nestedPadding: '1rem',
74+
borderColor: '#e9ecef',
75+
focusBorderColor: '#0d6efd',
76+
placeholderColor: 'rgba(233, 236, 239, 0.7)',
7177
},
7278
},
7379
pagination: {

src/types/theme.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,32 @@ export type Theme = {
33
light: ThemeProps;
44
};
55

6-
export type ThemeProps = {
6+
export interface ThemeProps {
77
colors?: {
8+
background?: string;
89
primaryColor?: string;
9-
textColor?: string;
1010
borderColor?: string;
11-
background?: string;
1211
};
1312
table?: {
1413
header?: {
1514
background?: string;
1615
textColor?: string;
16+
};
17+
cell?: {
18+
textColor?: string;
1719
borderColor?: string;
1820
};
1921
row?: {
2022
mainBackground?: string;
2123
nestedBackground?: string;
2224
expandedBackground?: string;
23-
hoverBackground?: string;
2425
};
25-
cell?: {
26+
filter?: {
27+
background?: string;
2628
textColor?: string;
2729
borderColor?: string;
28-
nestedPadding?: string;
30+
focusBorderColor?: string;
31+
placeholderColor?: string;
2932
};
3033
};
3134
pagination?: {
@@ -46,4 +49,4 @@ export type ThemeProps = {
4649
expandIcon?: {
4750
color?: string;
4851
};
49-
};
52+
}

0 commit comments

Comments
 (0)