@bitrise/bitkit 9.18.1 → 9.20.0-alpha-chakra.1

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.
@@ -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;
@@ -1,6 +0,0 @@
1
- .Badge {
2
- display: inline-block;
3
- padding: 0.1875rem var(--size--x2);
4
- border-radius: var(--size--x1);
5
- line-height: 1.125rem;
6
- }
@@ -1,18 +0,0 @@
1
- import * as React from 'react';
2
- import classnames from 'classnames';
3
- import Text, { Props as TextProps } from '../Text/Text';
4
- import './Badge.css';
5
-
6
- export interface Props extends TextProps {
7
- uppercase?: boolean;
8
- }
9
-
10
- /**
11
- * A badge component, useful to provide context and highlight something
12
- * important to a user.
13
- */
14
- const Badge: React.FunctionComponent<Props> = ({ uppercase = true, className, ...rest }: Props) => {
15
- return <Text {...rest} className={classnames('Badge', className)} size="1" uppercase={uppercase} />;
16
- };
17
-
18
- export default Badge;