@bitrise/bitkit 10.33.0-alpha-chakra.2 → 10.33.0-alpha-chakra.3

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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bitrise/bitkit",
3
3
  "description": "Bitrise React component library",
4
- "version": "10.33.0-alpha-chakra.2",
4
+ "version": "10.33.0-alpha-chakra.3",
5
5
  "repository": "git@github.com:bitrise-io/bitkit.git",
6
6
  "main": "src/index.ts",
7
7
  "license": "UNLICENSED",
@@ -0,0 +1,12 @@
1
+ import ProgressBitbot from './ProgressBitbot';
2
+
3
+ export default {
4
+ component: ProgressBitbot,
5
+ };
6
+
7
+ export const WithProps = {
8
+ args: {
9
+ content: 'Loading...',
10
+ size: 64,
11
+ },
12
+ };
@@ -1,8 +1,8 @@
1
- import * as React from 'react';
2
- import { Props as BaseProps } from '../Base/Base';
3
- import Text from '../../Components/Text/Text';
1
+ import { forwardRef } from '@chakra-ui/react';
2
+ import Box, { BoxProps } from '../Box/Box';
3
+ import Text from '../Text/Text';
4
4
 
5
- export interface Props extends BaseProps {
5
+ export interface ProgressBitbotProps extends BoxProps {
6
6
  /**
7
7
  * Message that appears underneath Bitbot to help
8
8
  * indicate what is progressing.
@@ -11,7 +11,7 @@ export interface Props extends BaseProps {
11
11
  /**
12
12
  * The size of the Bitbot progress indicator.
13
13
  */
14
- size?: string;
14
+ size?: BoxProps['width'];
15
15
  }
16
16
 
17
17
  const alternate = (a: string, b: string, length: number) =>
@@ -58,12 +58,12 @@ const mouth = alternate(mouth0, mouth1, 7);
58
58
  /**
59
59
  * A playful indeterminate progress indicator.
60
60
  */
61
- const ProgressBitbot: React.FunctionComponent<Props> = (props: Props) => {
61
+ const ProgressBitbot = forwardRef<ProgressBitbotProps, 'div'>((props, ref) => {
62
62
  const { content, size, ...rest } = props;
63
63
 
64
64
  return (
65
- <Text {...rest} textAlign="center">
66
- <svg fill="currentColor" height={size} viewBox="0 0 24 24" width={size}>
65
+ <Box {...rest} ref={ref}>
66
+ <Box as="svg" fill="currentColor" height={size} viewBox="0 0 24 24" width={size} marginX="auto">
67
67
  <g fill="currentColor" fillRule="evenodd" stroke="none" strokeWidth="1">
68
68
  <path d={dot0}>
69
69
  <animate
@@ -156,19 +156,19 @@ const ProgressBitbot: React.FunctionComponent<Props> = (props: Props) => {
156
156
  />
157
157
  </path>
158
158
  </g>
159
- </svg>
159
+ </Box>
160
160
 
161
161
  {content && (
162
162
  <Text textAlign="center" size="1" textTransform="uppercase">
163
163
  {content}
164
164
  </Text>
165
165
  )}
166
- </Text>
166
+ </Box>
167
167
  );
168
- };
168
+ });
169
169
 
170
170
  ProgressBitbot.defaultProps = {
171
- size: '64px',
171
+ size: 64,
172
172
  };
173
173
 
174
174
  export default ProgressBitbot;
package/src/index.ts CHANGED
@@ -216,3 +216,6 @@ export { default as SkeletonBox } from './Components/Skeleton/SkeletonBox';
216
216
 
217
217
  export type { ProgressBarProps } from './Components/ProgressBar/ProgressBar';
218
218
  export { default as ProgressBar } from './Components/ProgressBar/ProgressBar';
219
+
220
+ export type { ProgressBitbotProps } from './Components/ProgressBitbot/ProgressBitbot';
221
+ export { default as ProgressBitbot } from './Components/ProgressBitbot/ProgressBitbot';
package/src/old.ts CHANGED
@@ -18,8 +18,5 @@ export { default as DatePicker } from './Old/DatePicker/DatePicker';
18
18
  export type { Props as FlexProps } from './Old/Flex/Flex';
19
19
  export { default as Flex } from './Old/Flex/Flex';
20
20
 
21
- export type { Props as ProgressBitbotProps } from './Old/Progress/ProgressBitbot';
22
- export { default as ProgressBitbot } from './Old/Progress/ProgressBitbot';
23
-
24
21
  export type { Props as ProgressSpinnerProps } from './Old/Progress/ProgressSpinner';
25
22
  export { default as ProgressSpinner } from './Old/Progress/ProgressSpinner';