@bitrise/bitkit 12.18.0-alpha-drawer.2 → 12.18.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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bitrise/bitkit",
3
3
  "description": "Bitrise React component library",
4
- "version": "12.18.0-alpha-drawer.2",
4
+ "version": "12.18.0",
5
5
  "repository": "git@github.com:bitrise-io/bitkit.git",
6
6
  "main": "src/index.ts",
7
7
  "license": "UNLICENSED",
@@ -3,6 +3,7 @@ import {
3
3
  CloseButton as ChakraCloseButton,
4
4
  CloseButtonProps as ChakraCloseButtonProps,
5
5
  } from '@chakra-ui/react';
6
+ import Icon from '../Icon/Icon';
6
7
  import CloseButtonTheme from './CloseButton.theme';
7
8
 
8
9
  type ThemeArguments = Parameters<(typeof CloseButtonTheme)['baseStyle']>[0];
@@ -12,7 +13,9 @@ export interface CloseButtonProps extends ChakraCloseButtonProps {
12
13
  }
13
14
 
14
15
  const CloseButton = forwardRef<CloseButtonProps, 'button'>((props, ref) => (
15
- <ChakraCloseButton ref={ref} {...CloseButtonTheme.defaultProps} {...props} />
16
+ <ChakraCloseButton ref={ref} {...CloseButtonTheme.defaultProps} {...props}>
17
+ <Icon name="CloseSmall" />
18
+ </ChakraCloseButton>
16
19
  ));
17
20
 
18
21
  export default CloseButton;
@@ -28,10 +28,6 @@ const DialogTheme: ComponentStyleConfig = {
28
28
  position: 'absolute',
29
29
  top: '22',
30
30
  right: '22',
31
- width: '40',
32
- height: '40',
33
- padding: '8',
34
- borderRadius: '8',
35
31
  },
36
32
  body: {
37
33
  flex: 1,
@@ -59,7 +59,7 @@ const Dialog: ComponentWithAs<'section', DialogProps> = ({
59
59
  {title}
60
60
  </Text>
61
61
  </ModalHeader>
62
- <ModalCloseButton isDisabled={!isClosable}>
62
+ <ModalCloseButton isDisabled={!isClosable} size="large">
63
63
  <Icon name="CloseSmall" />
64
64
  </ModalCloseButton>
65
65
  </>
@@ -27,7 +27,7 @@ const DrawerTheme = defineMultiStyleConfig({
27
27
  padding: '24',
28
28
  display: 'flex',
29
29
  flexDirection: 'column',
30
- gap: '9',
30
+ gap: '8',
31
31
  },
32
32
  closeButton: {
33
33
  position: 'absolute',
@@ -10,6 +10,7 @@ import {
10
10
  DrawerCloseButton,
11
11
  DrawerContentProps,
12
12
  } from '@chakra-ui/react';
13
+ import Icon from '../Icon/Icon';
13
14
 
14
15
  export interface DrawerProps
15
16
  extends Pick<ChakraDrawerProps, 'finalFocusRef' | 'initialFocusRef' | 'isOpen' | 'onClose'> {
@@ -25,7 +26,9 @@ const Drawer = (props: DrawerProps) => {
25
26
  <ChakraDrawer {...drawerProps}>
26
27
  <DrawerOverlay />
27
28
  <DrawerContent>
28
- <DrawerCloseButton />
29
+ <DrawerCloseButton size="small">
30
+ <Icon name="CloseSmall" />
31
+ </DrawerCloseButton>
29
32
  <DrawerHeader as="h3">{title}</DrawerHeader>
30
33
  <DrawerBody>{children}</DrawerBody>
31
34
  {footer && <DrawerFooter>{footer}</DrawerFooter>}
@@ -1,27 +1,13 @@
1
- import { RadioGroup as ChakraRadioGroup, RadioGroupProps as ChakraRadioGroupProps } from '@chakra-ui/react';
2
- import Box, { BoxProps } from '../../Box/Box';
1
+ import { RadioGroup as ChakraRadioGroup, RadioGroupProps } from '@chakra-ui/react';
3
2
 
4
- export type RadioGroupProps = ChakraRadioGroupProps & Omit<BoxProps, 'onChange'>;
3
+ export type { RadioGroupProps };
5
4
 
6
5
  /**
7
6
  * RadioGroup component to help manage Radio components and conveniently pass a few shared style props to each.
8
7
  * Composes Box.
9
8
  */
10
9
  const RadioGroup = (props: RadioGroupProps) => {
11
- const { children, defaultValue, isDisabled, isFocusable, isNative, onChange, value, ...boxProps } = props;
12
- const groupProps = {
13
- defaultValue,
14
- isDisabled,
15
- isFocusable,
16
- isNative,
17
- onChange,
18
- value,
19
- };
20
- return (
21
- <ChakraRadioGroup {...groupProps}>
22
- <Box {...boxProps}>{children}</Box>
23
- </ChakraRadioGroup>
24
- );
10
+ return <ChakraRadioGroup {...props} />;
25
11
  };
26
12
 
27
13
  export default RadioGroup;
@@ -87,9 +87,7 @@ const Notification = forwardRef<NotificationProps, 'div'>((props, ref) => {
87
87
  marginTop={marginTop}
88
88
  colorScheme={colorScheme}
89
89
  onClick={onClose}
90
- >
91
- <Icon name="CloseSmall" />
92
- </CloseButton>
90
+ />
93
91
  )}
94
92
  </ActionContext.Provider>
95
93
  </ChakraAlert>
@@ -4,7 +4,6 @@ import { Alert as ChakraAlert, AlertProps, forwardRef } from '@chakra-ui/react';
4
4
  import { ColorScheme } from '../../Foundations/Colors/Colors';
5
5
  import CloseButton from '../CloseButton/CloseButton';
6
6
  import ColorButton, { ColorButtonProps } from '../ColorButton/ColorButton';
7
- import Icon from '../Icon/Icon';
8
7
  import Box from '../Box/Box';
9
8
 
10
9
  export type ActionProps = {
@@ -66,11 +65,7 @@ const Ribbon = forwardRef<RibbonProps, 'div'>((props, ref) => {
66
65
  {children}
67
66
  {actionButton}
68
67
  </Box>
69
- {onClose && (
70
- <CloseButton flexShrink={0} colorScheme={colorScheme} marginStart="auto" onClick={onClose}>
71
- <Icon name="CloseSmall" />
72
- </CloseButton>
73
- )}
68
+ {onClose && <CloseButton flexShrink={0} colorScheme={colorScheme} marginStart="auto" onClick={onClose} />}
74
69
  </ActionContext.Provider>
75
70
  </ChakraAlert>
76
71
  );