@bitrise/bitkit 13.214.0 → 13.216.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.
package/package.json
CHANGED
|
@@ -6,6 +6,7 @@ import '@fontsource/figtree/600.css';
|
|
|
6
6
|
import '@fontsource/figtree/700.css';
|
|
7
7
|
import '@fontsource/source-code-pro/400.css';
|
|
8
8
|
|
|
9
|
+
import { ResponsiveProvider } from '../../hooks/useResponsive';
|
|
9
10
|
import theme from '../../theme';
|
|
10
11
|
|
|
11
12
|
type ProviderProps = {
|
|
@@ -33,7 +34,7 @@ const Provider = ({ children, toastOptions }: ProviderProps) => {
|
|
|
33
34
|
},
|
|
34
35
|
}}
|
|
35
36
|
>
|
|
36
|
-
{children}
|
|
37
|
+
<ResponsiveProvider>{children}</ResponsiveProvider>
|
|
37
38
|
</ChakraProvider>
|
|
38
39
|
);
|
|
39
40
|
};
|
|
@@ -58,7 +58,7 @@ const Tabletheme = {
|
|
|
58
58
|
},
|
|
59
59
|
},
|
|
60
60
|
borderCollapse: 'separate',
|
|
61
|
-
borderColor: '
|
|
61
|
+
borderColor: 'border/minimal',
|
|
62
62
|
borderRadius: '4',
|
|
63
63
|
borderSpacing: 0,
|
|
64
64
|
borderStyle: 'solid',
|
|
@@ -103,10 +103,46 @@ const Tabletheme = {
|
|
|
103
103
|
border: 'none',
|
|
104
104
|
},
|
|
105
105
|
td: {
|
|
106
|
-
|
|
106
|
+
_first: {
|
|
107
|
+
paddingLeft: '12',
|
|
108
|
+
},
|
|
109
|
+
_last: {
|
|
110
|
+
paddingRight: '12',
|
|
111
|
+
},
|
|
112
|
+
borderColor: 'border/regular',
|
|
107
113
|
},
|
|
108
114
|
th: {
|
|
109
|
-
|
|
115
|
+
_first: {
|
|
116
|
+
paddingLeft: '12',
|
|
117
|
+
},
|
|
118
|
+
_last: {
|
|
119
|
+
paddingRight: '12',
|
|
120
|
+
},
|
|
121
|
+
borderColor: 'border/regular',
|
|
122
|
+
},
|
|
123
|
+
thead: {
|
|
124
|
+
backgroundColor: 'transparent',
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
card: {
|
|
128
|
+
table: {
|
|
129
|
+
border: 'none',
|
|
130
|
+
},
|
|
131
|
+
td: {
|
|
132
|
+
_first: {
|
|
133
|
+
paddingLeft: '24',
|
|
134
|
+
},
|
|
135
|
+
_last: {
|
|
136
|
+
paddingRight: '24',
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
th: {
|
|
140
|
+
_first: {
|
|
141
|
+
paddingLeft: '24',
|
|
142
|
+
},
|
|
143
|
+
_last: {
|
|
144
|
+
paddingRight: '24',
|
|
145
|
+
},
|
|
110
146
|
},
|
|
111
147
|
thead: {
|
|
112
148
|
backgroundColor: 'transparent',
|
|
@@ -3,7 +3,7 @@ import { forwardRef, Table as ChakraTable, TableProps as ChakraTableProps } from
|
|
|
3
3
|
export interface TableProps extends ChakraTableProps {
|
|
4
4
|
disableRowHover?: boolean;
|
|
5
5
|
isFixed?: boolean;
|
|
6
|
-
variant?: 'borderless' | 'default';
|
|
6
|
+
variant?: 'borderless' | 'default' | 'card';
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { createContext, ReactNode, useContext, useMemo } from 'react';
|
|
1
2
|
import { useMediaQuery } from '@chakra-ui/react';
|
|
2
3
|
import { breakpoints } from '../theme';
|
|
3
4
|
import { BREAKPOINTS } from '../types/bitkit';
|
|
@@ -16,9 +17,19 @@ const mediaQueries = [
|
|
|
16
17
|
`(min-width: ${breakpoints[BREAKPOINTS.WIDEDESKTOP]})`,
|
|
17
18
|
];
|
|
18
19
|
|
|
19
|
-
const
|
|
20
|
+
const ResponsiveContext = createContext({ isDesktop: false, isMobile: false, isTablet: false, isWideDesktop: false });
|
|
21
|
+
export const ResponsiveProvider = ({ children }: { children: ReactNode }) => {
|
|
20
22
|
const [isMobile, isTablet, isDesktop, isWideDesktop] = useMediaQuery(mediaQueries);
|
|
21
|
-
|
|
23
|
+
const context = useMemo(
|
|
24
|
+
() => ({ isDesktop, isMobile, isTablet, isWideDesktop }),
|
|
25
|
+
[isMobile, isTablet, isDesktop, isWideDesktop],
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
return <ResponsiveContext.Provider value={context}>{children}</ResponsiveContext.Provider>;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const useResponsive = () => {
|
|
32
|
+
return useContext(ResponsiveContext);
|
|
22
33
|
};
|
|
23
34
|
|
|
24
35
|
export default useResponsive;
|