@bitrise/bitkit 9.19.1 → 9.20.0-alpha-chakra.2
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 +2 -2
- package/src/Components/Button/Button.stories.tsx +1 -0
- package/src/Components/Button/Button.tsx +14 -3
- package/src/Components/Menu/Menu.stories.tsx +6 -3
- package/src/Components/OverflowMenu/OverflowMenu.tsx +4 -2
- package/src/tsconfig.tsbuildinfo +1 -1
- package/src/Components/IconButton/IconButton.stories.tsx +0 -19
- package/src/Components/IconButton/IconButton.tsx +0 -37
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
|
2
|
-
import { sortObjectByKey } from '../../utils/storyUtils';
|
|
3
|
-
import IconButton from './IconButton';
|
|
4
|
-
|
|
5
|
-
export default {
|
|
6
|
-
title: 'Components/IconButton (WIP)',
|
|
7
|
-
component: IconButton,
|
|
8
|
-
} as ComponentMeta<typeof IconButton>;
|
|
9
|
-
|
|
10
|
-
const Template: ComponentStory<typeof IconButton> = (props) => <IconButton {...props} />;
|
|
11
|
-
|
|
12
|
-
export const WithProps = Template.bind({});
|
|
13
|
-
WithProps.args = sortObjectByKey({
|
|
14
|
-
...IconButton.defaultProps,
|
|
15
|
-
'aria-label': 'This is the label',
|
|
16
|
-
iconName: 'AddOns',
|
|
17
|
-
isDanger: false,
|
|
18
|
-
isDisabled: false,
|
|
19
|
-
});
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { IconButton as ChakraIconButton, IconButtonProps, forwardRef } from '@chakra-ui/react';
|
|
3
|
-
import Icon from '../../Old/Icon/Icon';
|
|
4
|
-
import { TypeIconName } from '../../Old/Icon/tsx';
|
|
5
|
-
|
|
6
|
-
export interface Props extends IconButtonProps {
|
|
7
|
-
className?: string;
|
|
8
|
-
iconName: TypeIconName;
|
|
9
|
-
isDanger?: boolean;
|
|
10
|
-
isDisabled?: boolean;
|
|
11
|
-
onClick?: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
12
|
-
size?: 'small' | 'medium';
|
|
13
|
-
variant?: 'primary' | 'secondary' | 'tertiary';
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* IconButton composes the `Button` component except that it renders only an icon.
|
|
18
|
-
*
|
|
19
|
-
* TODO:
|
|
20
|
-
* - Change to Chakra powered Icon component
|
|
21
|
-
*/
|
|
22
|
-
const IconButton = forwardRef<Props, 'button'>((props, ref) => {
|
|
23
|
-
const { iconName, isDanger, variant, ...rest } = props;
|
|
24
|
-
const properties: IconButtonProps = {
|
|
25
|
-
icon: <Icon name={iconName} />,
|
|
26
|
-
variant: isDanger ? `${variant}--danger` : variant,
|
|
27
|
-
...rest,
|
|
28
|
-
};
|
|
29
|
-
return <ChakraIconButton {...properties} ref={ref} />;
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
IconButton.defaultProps = {
|
|
33
|
-
size: 'medium',
|
|
34
|
-
variant: 'primary',
|
|
35
|
-
} as Props;
|
|
36
|
-
|
|
37
|
-
export default IconButton;
|