@bitrise/bitkit 10.33.0-alpha-chakra.4 → 10.34.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,24 +6,23 @@ const animation = keyframes`
|
|
|
6
6
|
to { transform: translate3d(100%, 0, 0); }
|
|
7
7
|
`;
|
|
8
8
|
|
|
9
|
-
const afterStyle = {
|
|
9
|
+
const afterStyle = (foregroundColor: string) => ({
|
|
10
10
|
content: '""',
|
|
11
11
|
position: 'absolute',
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
bottom: 0,
|
|
15
|
-
left: 0,
|
|
12
|
+
width: '100%',
|
|
13
|
+
height: '100%',
|
|
16
14
|
pointerEvents: 'none',
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
backgroundColor: foregroundColor,
|
|
16
|
+
maskImage:
|
|
17
|
+
'linear-gradient(to left, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.63) 35%, rgb(0, 0, 0) 48%, rgba(0, 0, 0, 0.57) 55%, rgba(0, 0, 0, 0) 100%)',
|
|
19
18
|
animation: `${animation} infinite 1.5s`,
|
|
20
|
-
};
|
|
19
|
+
});
|
|
21
20
|
|
|
22
|
-
const baseStyle = defineStyle(({ isActive }) => {
|
|
21
|
+
const baseStyle = defineStyle(({ isActive, foregroundColor }) => {
|
|
23
22
|
return {
|
|
24
23
|
position: 'relative',
|
|
25
24
|
overflow: 'hidden',
|
|
26
|
-
_after: isActive ? afterStyle : {},
|
|
25
|
+
_after: isActive ? afterStyle(foregroundColor) : {},
|
|
27
26
|
};
|
|
28
27
|
});
|
|
29
28
|
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { Box, BoxProps, forwardRef, useStyleConfig } from '@chakra-ui/react';
|
|
1
|
+
import { Box, BoxProps, forwardRef, useStyleConfig, useTheme, getToken } from '@chakra-ui/react';
|
|
2
2
|
|
|
3
3
|
export interface SkeletonProps extends BoxProps {
|
|
4
4
|
isActive?: boolean;
|
|
5
|
+
foregroundColor?: string;
|
|
5
6
|
}
|
|
6
7
|
|
|
7
8
|
/**
|
|
@@ -10,8 +11,16 @@ export interface SkeletonProps extends BoxProps {
|
|
|
10
11
|
* We don't extend Chakra's Skeleton
|
|
11
12
|
*/
|
|
12
13
|
const Skeleton = forwardRef<SkeletonProps, 'div'>((props, ref) => {
|
|
13
|
-
const { isActive, ...rest } = props;
|
|
14
|
-
const
|
|
14
|
+
const { isActive, foregroundColor: foregroundColorToken, ...rest } = props;
|
|
15
|
+
const theme = useTheme();
|
|
16
|
+
const foregroundColor = foregroundColorToken
|
|
17
|
+
? getToken('colors', foregroundColorToken, foregroundColorToken)(theme)
|
|
18
|
+
: '#ffffff';
|
|
19
|
+
const css = useStyleConfig('Skeleton', {
|
|
20
|
+
isActive,
|
|
21
|
+
foregroundColor,
|
|
22
|
+
});
|
|
23
|
+
|
|
15
24
|
return <Box __css={css} {...rest} ref={ref} />;
|
|
16
25
|
});
|
|
17
26
|
|