@bitrise/bitkit 10.33.0-alpha-chakra.3 → 10.33.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/Notification/Notification.tsx +3 -2
- package/src/Components/ProgressBitbot/ProgressBitbot.tsx +1 -5
- package/src/Components/ProgressSpinner/ProgressSpinner.stories.tsx +12 -0
- package/src/Components/ProgressSpinner/ProgressSpinner.tsx +15 -0
- package/src/Components/Select/Select.tsx +2 -2
- package/src/Components/Toggle/Toggle.tsx +2 -2
- package/src/index.ts +3 -0
- package/src/old.ts +0 -3
- package/src/tsconfig.tsbuildinfo +1 -1
- package/src/Old/Progress/ProgressSpinner.css +0 -5
- package/src/Old/Progress/ProgressSpinner.tsx +0 -69
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { cloneElement, createContext, ReactElement, useContext, useMemo } from 'react';
|
|
2
|
-
import { Alert as ChakraAlert, AlertProps, forwardRef
|
|
2
|
+
import { Alert as ChakraAlert, AlertProps, forwardRef } from '@chakra-ui/react';
|
|
3
3
|
|
|
4
4
|
import { ColorScheme } from '../../Foundations/Colors/Colors';
|
|
5
5
|
import Box from '../Box/Box';
|
|
6
6
|
import CloseButton from '../CloseButton/CloseButton';
|
|
7
7
|
import ColorButton, { ColorButtonProps } from '../ColorButton/ColorButton';
|
|
8
8
|
import Icon, { TypeIconName } from '../Icon/Icon';
|
|
9
|
+
import ProgressSpinner from '../ProgressSpinner/ProgressSpinner';
|
|
9
10
|
|
|
10
11
|
type NotificationStatus = 'info' | 'error' | 'success' | 'warning' | 'progress';
|
|
11
12
|
|
|
@@ -18,7 +19,7 @@ const STATUSES: Record<NotificationStatus, { colorScheme: ColorScheme; defaultIc
|
|
|
18
19
|
colorScheme: 'purple',
|
|
19
20
|
defaultIcon: (
|
|
20
21
|
<Box width={24} height={24} padding={2}>
|
|
21
|
-
<
|
|
22
|
+
<ProgressSpinner size={20} />
|
|
22
23
|
</Box>
|
|
23
24
|
),
|
|
24
25
|
},
|
|
@@ -59,7 +59,7 @@ const mouth = alternate(mouth0, mouth1, 7);
|
|
|
59
59
|
* A playful indeterminate progress indicator.
|
|
60
60
|
*/
|
|
61
61
|
const ProgressBitbot = forwardRef<ProgressBitbotProps, 'div'>((props, ref) => {
|
|
62
|
-
const { content, size, ...rest } = props;
|
|
62
|
+
const { content, size = '64', ...rest } = props;
|
|
63
63
|
|
|
64
64
|
return (
|
|
65
65
|
<Box {...rest} ref={ref}>
|
|
@@ -167,8 +167,4 @@ const ProgressBitbot = forwardRef<ProgressBitbotProps, 'div'>((props, ref) => {
|
|
|
167
167
|
);
|
|
168
168
|
});
|
|
169
169
|
|
|
170
|
-
ProgressBitbot.defaultProps = {
|
|
171
|
-
size: 64,
|
|
172
|
-
};
|
|
173
|
-
|
|
174
170
|
export default ProgressBitbot;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Spinner as ChakraSpinner, SpinnerProps, forwardRef } from '@chakra-ui/react';
|
|
2
|
+
|
|
3
|
+
export interface ProgressSpinnerProps extends Omit<SpinnerProps, 'size'> {
|
|
4
|
+
size?: SpinnerProps['width'];
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Progresspinner
|
|
9
|
+
*/
|
|
10
|
+
const Progresspinner = forwardRef<ProgressSpinnerProps, 'div'>((props, ref) => {
|
|
11
|
+
const { size = '24', ...rest } = props;
|
|
12
|
+
return <ChakraSpinner width={size} height={size} {...rest} ref={ref} />;
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export default Progresspinner;
|
|
@@ -8,9 +8,9 @@ import {
|
|
|
8
8
|
forwardRef,
|
|
9
9
|
Select as ChakraSelect,
|
|
10
10
|
SelectProps as ChakraSelectProps,
|
|
11
|
-
Spinner,
|
|
12
11
|
} from '@chakra-ui/react';
|
|
13
12
|
import Icon from '../Icon/Icon';
|
|
13
|
+
import ProgressSpinner from '../ProgressSpinner/ProgressSpinner';
|
|
14
14
|
|
|
15
15
|
export interface SelectProps extends Omit<FormControlProps, 'label' | 'onBlur' | 'onChange'> {
|
|
16
16
|
'data-testid'?: string;
|
|
@@ -52,7 +52,7 @@ const Select = forwardRef<SelectProps, 'div'>((props, ref) => {
|
|
|
52
52
|
};
|
|
53
53
|
const selectProperties: ChakraSelectProps = {
|
|
54
54
|
icon: isLoading ? (
|
|
55
|
-
<
|
|
55
|
+
<ProgressSpinner size={iconSize} marginEnd="4" />
|
|
56
56
|
) : (
|
|
57
57
|
<Icon name="DropdownArrows" fontSize={iconSize} size={iconSize} />
|
|
58
58
|
),
|
|
@@ -5,13 +5,13 @@ import {
|
|
|
5
5
|
FormErrorMessage,
|
|
6
6
|
FormHelperText,
|
|
7
7
|
FormLabel,
|
|
8
|
-
Spinner,
|
|
9
8
|
Switch,
|
|
10
9
|
SwitchProps,
|
|
11
10
|
forwardRef,
|
|
12
11
|
useMultiStyleConfig,
|
|
13
12
|
} from '@chakra-ui/react';
|
|
14
13
|
import Box from '../Box/Box';
|
|
14
|
+
import ProgressSpinner from '../ProgressSpinner/ProgressSpinner';
|
|
15
15
|
|
|
16
16
|
export interface ToggleProps extends Omit<FormControlProps, 'label' | 'onBlur' | 'onChange'> {
|
|
17
17
|
'data-testid'?: string;
|
|
@@ -77,7 +77,7 @@ const Toggle = forwardRef<ToggleProps, 'div'>((props, ref) => {
|
|
|
77
77
|
{label}
|
|
78
78
|
</FormLabel>
|
|
79
79
|
)}
|
|
80
|
-
{isLoading && <
|
|
80
|
+
{isLoading && <ProgressSpinner sx={css.spinner} />}
|
|
81
81
|
</Box>
|
|
82
82
|
{errorText && <FormErrorMessage as="p">{errorText}</FormErrorMessage>}
|
|
83
83
|
{helperText && <FormHelperText as="p">{helperText}</FormHelperText>}
|
package/src/index.ts
CHANGED
|
@@ -219,3 +219,6 @@ export { default as ProgressBar } from './Components/ProgressBar/ProgressBar';
|
|
|
219
219
|
|
|
220
220
|
export type { ProgressBitbotProps } from './Components/ProgressBitbot/ProgressBitbot';
|
|
221
221
|
export { default as ProgressBitbot } from './Components/ProgressBitbot/ProgressBitbot';
|
|
222
|
+
|
|
223
|
+
export type { ProgressSpinnerProps } from './Components/ProgressSpinner/ProgressSpinner';
|
|
224
|
+
export { default as ProgressSpinner } from './Components/ProgressSpinner/ProgressSpinner';
|
package/src/old.ts
CHANGED
|
@@ -17,6 +17,3 @@ export { default as DatePicker } from './Old/DatePicker/DatePicker';
|
|
|
17
17
|
|
|
18
18
|
export type { Props as FlexProps } from './Old/Flex/Flex';
|
|
19
19
|
export { default as Flex } from './Old/Flex/Flex';
|
|
20
|
-
|
|
21
|
-
export type { Props as ProgressSpinnerProps } from './Old/Progress/ProgressSpinner';
|
|
22
|
-
export { default as ProgressSpinner } from './Old/Progress/ProgressSpinner';
|