@bitrise/bitkit 10.31.2 → 10.32.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 +1 -1
- package/src/Components/Skeleton/Skeleton.stories.tsx +18 -0
- package/src/Components/Skeleton/Skeleton.theme.ts +34 -0
- package/src/Components/Skeleton/Skeleton.tsx +18 -0
- package/src/Components/Skeleton/SkeletonBox.tsx +12 -0
- package/src/index.ts +6 -0
- package/src/old.ts +0 -6
- package/src/theme.ts +2 -0
- package/src/tsconfig.tsbuildinfo +1 -1
- package/src/Old/Skeleton/Skeleton.css +0 -35
- package/src/Old/Skeleton/Skeleton.tsx +0 -25
- package/src/Old/Skeleton/SkeletonBox.tsx +0 -26
package/package.json
CHANGED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import Skeleton, { SkeletonProps } from './Skeleton';
|
|
2
|
+
import SkeletonBox from './SkeletonBox';
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
component: Skeleton,
|
|
6
|
+
subComponents: [SkeletonBox],
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export const WithProps = {
|
|
10
|
+
args: {
|
|
11
|
+
isActive: false,
|
|
12
|
+
},
|
|
13
|
+
render: (args: SkeletonProps) => (
|
|
14
|
+
<Skeleton display="flex" flexDirection="column" gap="8" padding="8" {...args}>
|
|
15
|
+
<SkeletonBox height="32" /> <SkeletonBox height="32" /> <SkeletonBox height="32" />
|
|
16
|
+
</Skeleton>
|
|
17
|
+
),
|
|
18
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { keyframes } from '@chakra-ui/react';
|
|
2
|
+
import { defineStyle, defineStyleConfig } from '@chakra-ui/styled-system';
|
|
3
|
+
|
|
4
|
+
const animation = keyframes`
|
|
5
|
+
from { transform: translate3d(-100%, 0, 0); }
|
|
6
|
+
to { transform: translate3d(100%, 0, 0); }
|
|
7
|
+
`;
|
|
8
|
+
|
|
9
|
+
const afterStyle = {
|
|
10
|
+
content: '""',
|
|
11
|
+
position: 'absolute',
|
|
12
|
+
top: 0,
|
|
13
|
+
right: 0,
|
|
14
|
+
bottom: 0,
|
|
15
|
+
left: 0,
|
|
16
|
+
pointerEvents: 'none',
|
|
17
|
+
bgGradient:
|
|
18
|
+
'linear(to-l, rgba(255,255, 255, 0), rgba(255,255, 255, 0.63) 35%, rgba(255,255, 255, 1) 48%, rgba(255,255, 255, 0.57) 55%, rgba(255,255, 255, 0))',
|
|
19
|
+
animation: `${animation} infinite 1.5s`,
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const baseStyle = defineStyle(({ isActive }) => {
|
|
23
|
+
return {
|
|
24
|
+
position: 'relative',
|
|
25
|
+
overflow: 'hidden',
|
|
26
|
+
_after: isActive ? afterStyle : {},
|
|
27
|
+
};
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
const SkeletonTheme = defineStyleConfig({
|
|
31
|
+
baseStyle,
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
export default SkeletonTheme;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Box, BoxProps, forwardRef, useStyleConfig } from '@chakra-ui/react';
|
|
2
|
+
|
|
3
|
+
export interface SkeletonProps extends BoxProps {
|
|
4
|
+
isActive?: boolean;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Skeleton is used to display the loading state of some component.
|
|
9
|
+
*
|
|
10
|
+
* We don't extend Chakra's Skeleton
|
|
11
|
+
*/
|
|
12
|
+
const Skeleton = forwardRef<SkeletonProps, 'div'>((props, ref) => {
|
|
13
|
+
const { isActive, ...rest } = props;
|
|
14
|
+
const css = useStyleConfig('Skeleton', { isActive });
|
|
15
|
+
return <Box __css={css} {...rest} ref={ref} />;
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export default Skeleton;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Box, BoxProps, forwardRef } from '@chakra-ui/react';
|
|
2
|
+
|
|
3
|
+
export type { BoxProps as SkeletonBoxProps };
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* SkeletonBox is just a Box with default background color.
|
|
7
|
+
*/
|
|
8
|
+
const SkeletonBox = forwardRef<BoxProps, 'div'>((props, ref) => {
|
|
9
|
+
return <Box backgroundColor="neutral.93" {...props} ref={ref} />;
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
export default SkeletonBox;
|
package/src/index.ts
CHANGED
|
@@ -207,3 +207,9 @@ export { default as Fade } from './Components/Fade/Fade';
|
|
|
207
207
|
|
|
208
208
|
export type { InputProps } from './Components/Form/Input/Input';
|
|
209
209
|
export { default as Input } from './Components/Form/Input/Input';
|
|
210
|
+
|
|
211
|
+
export type { SkeletonProps } from './Components/Skeleton/Skeleton';
|
|
212
|
+
export { default as Skeleton } from './Components/Skeleton/Skeleton';
|
|
213
|
+
|
|
214
|
+
export type { SkeletonBoxProps } from './Components/Skeleton/SkeletonBox';
|
|
215
|
+
export { default as SkeletonBox } from './Components/Skeleton/SkeletonBox';
|
package/src/old.ts
CHANGED
|
@@ -26,9 +26,3 @@ export { default as ProgressBitbot } from './Old/Progress/ProgressBitbot';
|
|
|
26
26
|
|
|
27
27
|
export type { Props as ProgressSpinnerProps } from './Old/Progress/ProgressSpinner';
|
|
28
28
|
export { default as ProgressSpinner } from './Old/Progress/ProgressSpinner';
|
|
29
|
-
|
|
30
|
-
export type { Props as SkeletonProps } from './Old/Skeleton/Skeleton';
|
|
31
|
-
export { default as Skeleton } from './Old/Skeleton/Skeleton';
|
|
32
|
-
|
|
33
|
-
export type { Props as SkeletonBoxProps } from './Old/Skeleton/SkeletonBox';
|
|
34
|
-
export { default as SkeletonBox } from './Old/Skeleton/SkeletonBox';
|
package/src/theme.ts
CHANGED
|
@@ -26,6 +26,7 @@ import Popover from './Components/Popover/Popover.theme';
|
|
|
26
26
|
import Toggle from './Components/Toggle/Toggle.theme';
|
|
27
27
|
import Textarea from './Components/Form/Textarea/Textarea.theme';
|
|
28
28
|
import Form from './Components/Form/Form.theme';
|
|
29
|
+
import Skeleton from './Components/Skeleton/Skeleton.theme';
|
|
29
30
|
|
|
30
31
|
import breakpoints from './Foundations/Breakpoints/Breakpoints';
|
|
31
32
|
import colors from './Foundations/Colors/Colors';
|
|
@@ -99,6 +100,7 @@ const theme = {
|
|
|
99
100
|
Popover,
|
|
100
101
|
Switch: Toggle,
|
|
101
102
|
Textarea,
|
|
103
|
+
Skeleton,
|
|
102
104
|
},
|
|
103
105
|
};
|
|
104
106
|
|