@bitrise/bitkit 9.4.1-alpha.2 → 9.4.1-beta.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.
- package/.eslintrc.js +1 -1
- package/.husky/commit-msg +4 -0
- package/.nvmrc +1 -1
- package/.stylelintignore +0 -1
- package/.tool-versions +1 -1
- package/CHANGELOG.md +1 -3
- package/bitrise.yml +41 -27
- package/jest.setup.js +1 -0
- package/lib/cjs/ButtonWithDropdown/ButtonWithDropdown.d.ts +6 -3
- package/lib/cjs/ButtonWithDropdown/ButtonWithDropdown.d.ts.map +1 -1
- package/lib/cjs/ButtonWithDropdown/ButtonWithDropdown.js +13 -6
- package/lib/cjs/ButtonWithDropdown/ButtonWithDropdown.js.map +1 -1
- package/lib/cjs/Dropdown/Dropdown.d.ts.map +1 -1
- package/lib/cjs/Dropdown/Dropdown.js +9 -8
- package/lib/cjs/Dropdown/Dropdown.js.map +1 -1
- package/lib/cjs/Placement/Placement.css +17 -35
- package/lib/cjs/Placement/Placement.d.ts +5 -8
- package/lib/cjs/Placement/Placement.d.ts.map +1 -1
- package/lib/cjs/Placement/Placement.js.map +1 -1
- package/lib/cjs/Placement/PlacementPopper.d.ts +3 -4
- package/lib/cjs/Placement/PlacementPopper.d.ts.map +1 -1
- package/lib/cjs/Placement/PlacementPopper.js +32 -17
- package/lib/cjs/Placement/PlacementPopper.js.map +1 -1
- package/lib/cjs/Tooltip/Tooltip.d.ts +1 -1
- package/lib/cjs/Tooltip/Tooltip.d.ts.map +1 -1
- package/lib/cjs/hooks/useEventListener.d.ts.map +1 -1
- package/lib/cjs/hooks/useEventListener.js +0 -1
- package/lib/cjs/hooks/useEventListener.js.map +1 -1
- package/lib/cjs/index.d.ts +0 -9
- package/lib/cjs/index.d.ts.map +1 -1
- package/lib/cjs/index.js +1 -20
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/tsconfig.tsbuildinfo +1 -1
- package/lib/esn/ButtonWithDropdown/ButtonWithDropdown.d.ts +6 -3
- package/lib/esn/ButtonWithDropdown/ButtonWithDropdown.d.ts.map +1 -1
- package/lib/esn/ButtonWithDropdown/ButtonWithDropdown.js +10 -3
- package/lib/esn/ButtonWithDropdown/ButtonWithDropdown.js.map +1 -1
- package/lib/esn/Dropdown/Dropdown.d.ts.map +1 -1
- package/lib/esn/Dropdown/Dropdown.js +9 -5
- package/lib/esn/Dropdown/Dropdown.js.map +1 -1
- package/lib/esn/Placement/Placement.css +17 -35
- package/lib/esn/Placement/Placement.d.ts +5 -8
- package/lib/esn/Placement/Placement.d.ts.map +1 -1
- package/lib/esn/Placement/Placement.js.map +1 -1
- package/lib/esn/Placement/PlacementPopper.d.ts +3 -4
- package/lib/esn/Placement/PlacementPopper.d.ts.map +1 -1
- package/lib/esn/Placement/PlacementPopper.js +44 -29
- package/lib/esn/Placement/PlacementPopper.js.map +1 -1
- package/lib/esn/Tooltip/Tooltip.d.ts +1 -1
- package/lib/esn/Tooltip/Tooltip.d.ts.map +1 -1
- package/lib/esn/hooks/useEventListener.d.ts.map +1 -1
- package/lib/esn/hooks/useEventListener.js +0 -1
- package/lib/esn/hooks/useEventListener.js.map +1 -1
- package/lib/esn/index.d.ts +0 -9
- package/lib/esn/index.d.ts.map +1 -1
- package/lib/esn/index.js +0 -9
- package/lib/esn/index.js.map +1 -1
- package/lib/esn/tsconfig.tsbuildinfo +1 -1
- package/package.json +18 -42
- package/postcss.config.js +9 -5
- package/release.config.js +2 -1
- package/site/components/Documentation/Components/SectionButtons.tsx +8 -4
- package/site/components/Documentation/Components/SectionDropdowns.tsx +1 -1
- package/site/components/Documentation/Components/SectionPlacement.tsx +7 -1
- package/src/ButtonWithDropdown/ButtonWithDropdown.tsx +22 -21
- package/src/Dropdown/Dropdown.tsx +16 -8
- package/src/Placement/Placement.css +17 -35
- package/src/Placement/Placement.tsx +5 -8
- package/src/Placement/PlacementPopper.tsx +64 -48
- package/src/Tooltip/Tooltip.tsx +1 -1
- package/src/hooks/useEventListener.ts +25 -5
- package/src/index.ts +0 -10
- package/tsconfig.json +2 -5
- package/.storybook/main.js +0 -35
- package/.storybook/preview.js +0 -20
- package/lib/cjs/chakra/BitkitProvider.d.ts +0 -5
- package/lib/cjs/chakra/BitkitProvider.d.ts.map +0 -1
- package/lib/cjs/chakra/BitkitProvider.js +0 -14
- package/lib/cjs/chakra/BitkitProvider.js.map +0 -1
- package/lib/cjs/chakra/components/Button/Button.d.ts +0 -22
- package/lib/cjs/chakra/components/Button/Button.d.ts.map +0 -1
- package/lib/cjs/chakra/components/Button/Button.js +0 -61
- package/lib/cjs/chakra/components/Button/Button.js.map +0 -1
- package/lib/cjs/chakra/components/Button/Button.stories.d.ts +0 -6
- package/lib/cjs/chakra/components/Button/Button.stories.d.ts.map +0 -1
- package/lib/cjs/chakra/components/Button/Button.stories.js +0 -37
- package/lib/cjs/chakra/components/Button/Button.stories.js.map +0 -1
- package/lib/cjs/chakra/components/Button/Button.theme.d.ts +0 -117
- package/lib/cjs/chakra/components/Button/Button.theme.d.ts.map +0 -1
- package/lib/cjs/chakra/components/Button/Button.theme.js +0 -119
- package/lib/cjs/chakra/components/Button/Button.theme.js.map +0 -1
- package/lib/cjs/chakra/components/IconButton/IconButton.d.ts +0 -14
- package/lib/cjs/chakra/components/IconButton/IconButton.d.ts.map +0 -1
- package/lib/cjs/chakra/components/IconButton/IconButton.js +0 -41
- package/lib/cjs/chakra/components/IconButton/IconButton.js.map +0 -1
- package/lib/cjs/chakra/components/IconButton/IconButton.stories.d.ts +0 -6
- package/lib/cjs/chakra/components/IconButton/IconButton.stories.d.ts.map +0 -1
- package/lib/cjs/chakra/components/IconButton/IconButton.stories.js +0 -48
- package/lib/cjs/chakra/components/IconButton/IconButton.stories.js.map +0 -1
- package/lib/cjs/chakra/components/Link/Link.d.ts +0 -16
- package/lib/cjs/chakra/components/Link/Link.d.ts.map +0 -1
- package/lib/cjs/chakra/components/Link/Link.js +0 -44
- package/lib/cjs/chakra/components/Link/Link.js.map +0 -1
- package/lib/cjs/chakra/components/Link/Link.stories.d.ts +0 -12
- package/lib/cjs/chakra/components/Link/Link.stories.d.ts.map +0 -1
- package/lib/cjs/chakra/components/Link/Link.stories.js +0 -42
- package/lib/cjs/chakra/components/Link/Link.stories.js.map +0 -1
- package/lib/cjs/chakra/components/Menu/Menu.d.ts +0 -6
- package/lib/cjs/chakra/components/Menu/Menu.d.ts.map +0 -1
- package/lib/cjs/chakra/components/Menu/Menu.js +0 -21
- package/lib/cjs/chakra/components/Menu/Menu.js.map +0 -1
- package/lib/cjs/chakra/components/Menu/Menu.stories.d.ts +0 -9
- package/lib/cjs/chakra/components/Menu/Menu.stories.d.ts.map +0 -1
- package/lib/cjs/chakra/components/Menu/Menu.stories.js +0 -48
- package/lib/cjs/chakra/components/Menu/Menu.stories.js.map +0 -1
- package/lib/cjs/chakra/components/Menu/Menu.theme.d.ts +0 -4
- package/lib/cjs/chakra/components/Menu/Menu.theme.d.ts.map +0 -1
- package/lib/cjs/chakra/components/Menu/Menu.theme.js +0 -23
- package/lib/cjs/chakra/components/Menu/Menu.theme.js.map +0 -1
- package/lib/cjs/chakra/components/Menu/MenuItem.d.ts +0 -12
- package/lib/cjs/chakra/components/Menu/MenuItem.d.ts.map +0 -1
- package/lib/cjs/chakra/components/Menu/MenuItem.js +0 -39
- package/lib/cjs/chakra/components/Menu/MenuItem.js.map +0 -1
- package/lib/cjs/chakra/components/StatusTag/StatusTag.d.ts +0 -16
- package/lib/cjs/chakra/components/StatusTag/StatusTag.d.ts.map +0 -1
- package/lib/cjs/chakra/components/StatusTag/StatusTag.js +0 -36
- package/lib/cjs/chakra/components/StatusTag/StatusTag.js.map +0 -1
- package/lib/cjs/chakra/components/StatusTag/StatusTag.stories.d.ts +0 -13
- package/lib/cjs/chakra/components/StatusTag/StatusTag.stories.d.ts.map +0 -1
- package/lib/cjs/chakra/components/StatusTag/StatusTag.stories.js +0 -44
- package/lib/cjs/chakra/components/StatusTag/StatusTag.stories.js.map +0 -1
- package/lib/cjs/chakra/components/StatusTag/StatusTag.theme.d.ts +0 -45
- package/lib/cjs/chakra/components/StatusTag/StatusTag.theme.d.ts.map +0 -1
- package/lib/cjs/chakra/components/StatusTag/StatusTag.theme.js +0 -47
- package/lib/cjs/chakra/components/StatusTag/StatusTag.theme.js.map +0 -1
- package/lib/cjs/chakra/components/Text/Text.d.ts +0 -32
- package/lib/cjs/chakra/components/Text/Text.d.ts.map +0 -1
- package/lib/cjs/chakra/components/Text/Text.js +0 -38
- package/lib/cjs/chakra/components/Text/Text.js.map +0 -1
- package/lib/cjs/chakra/components/Text/Text.stories.d.ts +0 -12
- package/lib/cjs/chakra/components/Text/Text.stories.d.ts.map +0 -1
- package/lib/cjs/chakra/components/Text/Text.stories.js +0 -42
- package/lib/cjs/chakra/components/Text/Text.stories.js.map +0 -1
- package/lib/cjs/chakra/shared.d.ts +0 -2
- package/lib/cjs/chakra/shared.d.ts.map +0 -1
- package/lib/cjs/chakra/shared.js +0 -15
- package/lib/cjs/chakra/shared.js.map +0 -1
- package/lib/cjs/chakra/theme/theme.d.ts +0 -3
- package/lib/cjs/chakra/theme/theme.d.ts.map +0 -1
- package/lib/cjs/chakra/theme/theme.js +0 -54
- package/lib/cjs/chakra/theme/theme.js.map +0 -1
- package/lib/cjs/chakra/theme/typographyConfig.d.ts +0 -4
- package/lib/cjs/chakra/theme/typographyConfig.d.ts.map +0 -1
- package/lib/cjs/chakra/theme/typographyConfig.js +0 -38
- package/lib/cjs/chakra/theme/typographyConfig.js.map +0 -1
- package/lib/esn/chakra/BitkitProvider.d.ts +0 -5
- package/lib/esn/chakra/BitkitProvider.d.ts.map +0 -1
- package/lib/esn/chakra/BitkitProvider.js +0 -8
- package/lib/esn/chakra/BitkitProvider.js.map +0 -1
- package/lib/esn/chakra/components/Button/Button.d.ts +0 -22
- package/lib/esn/chakra/components/Button/Button.d.ts.map +0 -1
- package/lib/esn/chakra/components/Button/Button.js +0 -34
- package/lib/esn/chakra/components/Button/Button.js.map +0 -1
- package/lib/esn/chakra/components/Button/Button.stories.d.ts +0 -6
- package/lib/esn/chakra/components/Button/Button.stories.d.ts.map +0 -1
- package/lib/esn/chakra/components/Button/Button.stories.js +0 -29
- package/lib/esn/chakra/components/Button/Button.stories.js.map +0 -1
- package/lib/esn/chakra/components/Button/Button.theme.d.ts +0 -117
- package/lib/esn/chakra/components/Button/Button.theme.d.ts.map +0 -1
- package/lib/esn/chakra/components/Button/Button.theme.js +0 -117
- package/lib/esn/chakra/components/Button/Button.theme.js.map +0 -1
- package/lib/esn/chakra/components/IconButton/IconButton.d.ts +0 -14
- package/lib/esn/chakra/components/IconButton/IconButton.d.ts.map +0 -1
- package/lib/esn/chakra/components/IconButton/IconButton.js +0 -18
- package/lib/esn/chakra/components/IconButton/IconButton.js.map +0 -1
- package/lib/esn/chakra/components/IconButton/IconButton.stories.d.ts +0 -6
- package/lib/esn/chakra/components/IconButton/IconButton.stories.d.ts.map +0 -1
- package/lib/esn/chakra/components/IconButton/IconButton.stories.js +0 -21
- package/lib/esn/chakra/components/IconButton/IconButton.stories.js.map +0 -1
- package/lib/esn/chakra/components/Link/Link.d.ts +0 -16
- package/lib/esn/chakra/components/Link/Link.d.ts.map +0 -1
- package/lib/esn/chakra/components/Link/Link.js +0 -17
- package/lib/esn/chakra/components/Link/Link.js.map +0 -1
- package/lib/esn/chakra/components/Link/Link.stories.d.ts +0 -12
- package/lib/esn/chakra/components/Link/Link.stories.d.ts.map +0 -1
- package/lib/esn/chakra/components/Link/Link.stories.js +0 -16
- package/lib/esn/chakra/components/Link/Link.stories.js.map +0 -1
- package/lib/esn/chakra/components/Menu/Menu.d.ts +0 -6
- package/lib/esn/chakra/components/Menu/Menu.d.ts.map +0 -1
- package/lib/esn/chakra/components/Menu/Menu.js +0 -5
- package/lib/esn/chakra/components/Menu/Menu.js.map +0 -1
- package/lib/esn/chakra/components/Menu/Menu.stories.d.ts +0 -9
- package/lib/esn/chakra/components/Menu/Menu.stories.d.ts.map +0 -1
- package/lib/esn/chakra/components/Menu/Menu.stories.js +0 -39
- package/lib/esn/chakra/components/Menu/Menu.stories.js.map +0 -1
- package/lib/esn/chakra/components/Menu/Menu.theme.d.ts +0 -4
- package/lib/esn/chakra/components/Menu/Menu.theme.d.ts.map +0 -1
- package/lib/esn/chakra/components/Menu/Menu.theme.js +0 -21
- package/lib/esn/chakra/components/Menu/Menu.theme.js.map +0 -1
- package/lib/esn/chakra/components/Menu/MenuItem.d.ts +0 -12
- package/lib/esn/chakra/components/Menu/MenuItem.d.ts.map +0 -1
- package/lib/esn/chakra/components/Menu/MenuItem.js +0 -12
- package/lib/esn/chakra/components/Menu/MenuItem.js.map +0 -1
- package/lib/esn/chakra/components/StatusTag/StatusTag.d.ts +0 -16
- package/lib/esn/chakra/components/StatusTag/StatusTag.d.ts.map +0 -1
- package/lib/esn/chakra/components/StatusTag/StatusTag.js +0 -30
- package/lib/esn/chakra/components/StatusTag/StatusTag.js.map +0 -1
- package/lib/esn/chakra/components/StatusTag/StatusTag.stories.d.ts +0 -13
- package/lib/esn/chakra/components/StatusTag/StatusTag.stories.d.ts.map +0 -1
- package/lib/esn/chakra/components/StatusTag/StatusTag.stories.js +0 -16
- package/lib/esn/chakra/components/StatusTag/StatusTag.stories.js.map +0 -1
- package/lib/esn/chakra/components/StatusTag/StatusTag.theme.d.ts +0 -45
- package/lib/esn/chakra/components/StatusTag/StatusTag.theme.d.ts.map +0 -1
- package/lib/esn/chakra/components/StatusTag/StatusTag.theme.js +0 -45
- package/lib/esn/chakra/components/StatusTag/StatusTag.theme.js.map +0 -1
- package/lib/esn/chakra/components/Text/Text.d.ts +0 -32
- package/lib/esn/chakra/components/Text/Text.d.ts.map +0 -1
- package/lib/esn/chakra/components/Text/Text.js +0 -22
- package/lib/esn/chakra/components/Text/Text.js.map +0 -1
- package/lib/esn/chakra/components/Text/Text.stories.d.ts +0 -12
- package/lib/esn/chakra/components/Text/Text.stories.d.ts.map +0 -1
- package/lib/esn/chakra/components/Text/Text.stories.js +0 -19
- package/lib/esn/chakra/components/Text/Text.stories.js.map +0 -1
- package/lib/esn/chakra/shared.d.ts +0 -2
- package/lib/esn/chakra/shared.d.ts.map +0 -1
- package/lib/esn/chakra/shared.js +0 -11
- package/lib/esn/chakra/shared.js.map +0 -1
- package/lib/esn/chakra/theme/theme.d.ts +0 -3
- package/lib/esn/chakra/theme/theme.d.ts.map +0 -1
- package/lib/esn/chakra/theme/theme.js +0 -49
- package/lib/esn/chakra/theme/theme.js.map +0 -1
- package/lib/esn/chakra/theme/typographyConfig.d.ts +0 -4
- package/lib/esn/chakra/theme/typographyConfig.d.ts.map +0 -1
- package/lib/esn/chakra/theme/typographyConfig.js +0 -36
- package/lib/esn/chakra/theme/typographyConfig.js.map +0 -1
- package/src/chakra/BitkitProvider.tsx +0 -9
- package/src/chakra/components/Button/Button.stories.tsx +0 -32
- package/src/chakra/components/Button/Button.theme.ts +0 -117
- package/src/chakra/components/Button/Button.tsx +0 -52
- package/src/chakra/components/IconButton/IconButton.stories.tsx +0 -24
- package/src/chakra/components/IconButton/IconButton.tsx +0 -29
- package/src/chakra/components/Link/Link.stories.tsx +0 -19
- package/src/chakra/components/Link/Link.tsx +0 -30
- package/src/chakra/components/Menu/Menu.stories.tsx +0 -57
- package/src/chakra/components/Menu/Menu.theme.ts +0 -23
- package/src/chakra/components/Menu/Menu.tsx +0 -8
- package/src/chakra/components/Menu/MenuItem.tsx +0 -20
- package/src/chakra/components/StatusTag/StatusTag.stories.tsx +0 -19
- package/src/chakra/components/StatusTag/StatusTag.theme.ts +0 -45
- package/src/chakra/components/StatusTag/StatusTag.tsx +0 -55
- package/src/chakra/components/Text/Text.stories.tsx +0 -22
- package/src/chakra/components/Text/Text.tsx +0 -73
- package/src/chakra/shared.ts +0 -11
- package/src/chakra/theme/theme.ts +0 -50
- package/src/chakra/theme/typographyConfig.ts +0 -38
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
|
3
|
-
import { sortObjectByKey } from '../../shared';
|
|
4
|
-
import { IconList } from '../../../Icon/tsx';
|
|
5
|
-
import IconButton from './IconButton';
|
|
6
|
-
|
|
7
|
-
export default {
|
|
8
|
-
title: 'Components/IconButton',
|
|
9
|
-
component: IconButton,
|
|
10
|
-
argTypes: {
|
|
11
|
-
iconName: {
|
|
12
|
-
options: IconList,
|
|
13
|
-
},
|
|
14
|
-
},
|
|
15
|
-
} as ComponentMeta<typeof IconButton>;
|
|
16
|
-
|
|
17
|
-
const Template: ComponentStory<typeof IconButton> = ({ ...props }) => <IconButton {...props} />;
|
|
18
|
-
|
|
19
|
-
export const WithProps = Template.bind({});
|
|
20
|
-
WithProps.args = sortObjectByKey({
|
|
21
|
-
...IconButton.defaultProps,
|
|
22
|
-
iconName: 'AddOns',
|
|
23
|
-
label: 'This is the label',
|
|
24
|
-
});
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { IconButton as ChakraIconButton, IconButtonProps } from '@chakra-ui/react';
|
|
3
|
-
import { Icon, TypeIconName } from '@bitrise/bitkit';
|
|
4
|
-
|
|
5
|
-
export interface Props {
|
|
6
|
-
iconName: TypeIconName;
|
|
7
|
-
label: IconButtonProps['aria-label'];
|
|
8
|
-
onClick?: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
9
|
-
size?: 'small' | 'medium';
|
|
10
|
-
sx?: IconButtonProps['sx'];
|
|
11
|
-
variant?: 'primary' | 'secondary' | 'tertiary' | 'dangerPrimary' | 'dangerSecondary';
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
const IconButton = React.forwardRef<HTMLButtonElement, Props>((props: Props, ref) => {
|
|
15
|
-
const { iconName, label, ...rest } = props;
|
|
16
|
-
const properties: IconButtonProps = {
|
|
17
|
-
'aria-label': label,
|
|
18
|
-
icon: <Icon name={iconName} />,
|
|
19
|
-
...rest,
|
|
20
|
-
};
|
|
21
|
-
return <ChakraIconButton ref={ref} {...properties} />;
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
IconButton.defaultProps = {
|
|
25
|
-
size: 'medium',
|
|
26
|
-
variant: 'primary',
|
|
27
|
-
} as Props;
|
|
28
|
-
|
|
29
|
-
export default IconButton;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
|
3
|
-
import { sortObjectByKey } from '../../shared';
|
|
4
|
-
import Link from './Link';
|
|
5
|
-
|
|
6
|
-
export default {
|
|
7
|
-
title: 'Components/Link',
|
|
8
|
-
component: Link,
|
|
9
|
-
} as ComponentMeta<typeof Link>;
|
|
10
|
-
|
|
11
|
-
const Template: ComponentStory<typeof Link> = ({ ...props }) => <Link {...props} />;
|
|
12
|
-
|
|
13
|
-
export const WithProps = Template.bind({});
|
|
14
|
-
WithProps.args = sortObjectByKey({
|
|
15
|
-
...Link.defaultProps,
|
|
16
|
-
children: 'The quick brown fox jumps over the lazy dog.',
|
|
17
|
-
href: '#',
|
|
18
|
-
target: '_self',
|
|
19
|
-
});
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Link as ChakraLink, LinkProps } from '@chakra-ui/react';
|
|
3
|
-
|
|
4
|
-
export type TypeLinkColor = 'grape-3' | 'grape-5' | 'gray-1' | 'gray-5' | 'white' | 'inherit';
|
|
5
|
-
|
|
6
|
-
export interface Props {
|
|
7
|
-
children: LinkProps['children'];
|
|
8
|
-
color?: TypeLinkColor;
|
|
9
|
-
href: string;
|
|
10
|
-
isUnderlined?: boolean;
|
|
11
|
-
target?: '_blank' | '_parent' | '_self' | '_top';
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
const Link = (props: Props) => {
|
|
15
|
-
const { isUnderlined, ...rest } = props;
|
|
16
|
-
const properties: LinkProps = { ...rest };
|
|
17
|
-
properties.as = 'a';
|
|
18
|
-
if (isUnderlined) {
|
|
19
|
-
properties.textDecoration = 'underline';
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
return <ChakraLink {...properties} />;
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
Link.defaultProps = {
|
|
26
|
-
color: 'grape-3',
|
|
27
|
-
isUnderlined: true,
|
|
28
|
-
} as Props;
|
|
29
|
-
|
|
30
|
-
export default Link;
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
|
3
|
-
import { ButtonGroup, HStack, MenuButton, MenuList } from '@chakra-ui/react';
|
|
4
|
-
import Button from '../Button/Button';
|
|
5
|
-
import IconButton from '../IconButton/IconButton';
|
|
6
|
-
import Menu from './Menu';
|
|
7
|
-
import MenuItem from './MenuItem';
|
|
8
|
-
|
|
9
|
-
export default {
|
|
10
|
-
title: 'Components/Menu',
|
|
11
|
-
component: Menu,
|
|
12
|
-
subcomponents: { MenuButton, MenuList, MenuItem },
|
|
13
|
-
} as ComponentMeta<typeof Menu>;
|
|
14
|
-
|
|
15
|
-
export const WithButton: ComponentStory<typeof Menu> = () => (
|
|
16
|
-
<Menu>
|
|
17
|
-
<MenuButton as={Button}>Actions</MenuButton>
|
|
18
|
-
<MenuList>
|
|
19
|
-
<MenuItem iconName="AddOnsColorTuorqouise">Download</MenuItem>
|
|
20
|
-
<MenuItem iconName="AddOnsColorTuorqouise">Create a Copy</MenuItem>
|
|
21
|
-
<MenuItem iconName="AddOnsColorTuorqouise">Mark as Draft</MenuItem>
|
|
22
|
-
<MenuItem iconName="AddOnsColorTuorqouise">Delete</MenuItem>
|
|
23
|
-
<MenuItem iconName="AddOnsColorTuorqouise">Attend a Workshop</MenuItem>
|
|
24
|
-
</MenuList>
|
|
25
|
-
</Menu>
|
|
26
|
-
);
|
|
27
|
-
|
|
28
|
-
export const WithIconButton: ComponentStory<typeof Menu> = () => (
|
|
29
|
-
<Menu>
|
|
30
|
-
<MenuButton as={IconButton} iconName="AddOnsColorTuorqouise" label="Open menu" />
|
|
31
|
-
<MenuList>
|
|
32
|
-
<MenuItem iconName="AddOnsColorTuorqouise">Download</MenuItem>
|
|
33
|
-
<MenuItem iconName="AddOnsColorTuorqouise">Create a Copy</MenuItem>
|
|
34
|
-
<MenuItem iconName="AddOnsColorTuorqouise">Mark as Draft</MenuItem>
|
|
35
|
-
<MenuItem iconName="AddOnsColorTuorqouise">Delete</MenuItem>
|
|
36
|
-
<MenuItem iconName="AddOnsColorTuorqouise">Attend a Workshop</MenuItem>
|
|
37
|
-
</MenuList>
|
|
38
|
-
</Menu>
|
|
39
|
-
);
|
|
40
|
-
|
|
41
|
-
export const WithButtonGroup: ComponentStory<typeof Menu> = () => (
|
|
42
|
-
<HStack justifyContent="end">
|
|
43
|
-
<ButtonGroup isAttached>
|
|
44
|
-
<Button>Button</Button>
|
|
45
|
-
<Menu>
|
|
46
|
-
<MenuButton as={IconButton} iconName="AddOnsColorTuorqouise" label="Open menu" />
|
|
47
|
-
<MenuList>
|
|
48
|
-
<MenuItem iconName="AddOnsColorTuorqouise">Download</MenuItem>
|
|
49
|
-
<MenuItem iconName="AddOnsColorTuorqouise">Create a Copy</MenuItem>
|
|
50
|
-
<MenuItem iconName="AddOnsColorTuorqouise">Mark as Draft</MenuItem>
|
|
51
|
-
<MenuItem iconName="AddOnsColorTuorqouise">Delete</MenuItem>
|
|
52
|
-
<MenuItem iconName="AddOnsColorTuorqouise">Attend a Workshop</MenuItem>
|
|
53
|
-
</MenuList>
|
|
54
|
-
</Menu>
|
|
55
|
-
</ButtonGroup>
|
|
56
|
-
</HStack>
|
|
57
|
-
);
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { SystemStyleObject } from '@chakra-ui/theme-tools';
|
|
2
|
-
|
|
3
|
-
const MenuTheme: SystemStyleObject = {
|
|
4
|
-
baseStyle: {
|
|
5
|
-
list: {
|
|
6
|
-
backgroundColor: '#fff',
|
|
7
|
-
borderRadius: '8px',
|
|
8
|
-
filter: 'drop-shadow(0 0.125rem 0.3125rem rgba(199, 205, 207, 0.7))',
|
|
9
|
-
paddingY: '16px',
|
|
10
|
-
},
|
|
11
|
-
item: {
|
|
12
|
-
padding: '12px 32px',
|
|
13
|
-
_focus: {
|
|
14
|
-
backgroundColor: '#F8F0FF',
|
|
15
|
-
},
|
|
16
|
-
_hover: {
|
|
17
|
-
backgroundColor: '#F8F0FF',
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export default MenuTheme;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { MenuItem as ChakraMenuItem, MenuItemProps } from '@chakra-ui/react';
|
|
3
|
-
import { Icon, TypeIconName } from '@bitrise/bitkit';
|
|
4
|
-
|
|
5
|
-
export type Props = {
|
|
6
|
-
children: string;
|
|
7
|
-
iconName: TypeIconName;
|
|
8
|
-
onClick?: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
9
|
-
sx?: MenuItemProps['sx'];
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
const MenuItem = (props: Props) => {
|
|
13
|
-
const { iconName, ...rest } = props;
|
|
14
|
-
const properties: MenuItemProps = { ...rest };
|
|
15
|
-
properties.icon = <Icon name={iconName} />;
|
|
16
|
-
properties.iconSpacing = '16px';
|
|
17
|
-
return <ChakraMenuItem {...properties} />;
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export default MenuItem;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
|
3
|
-
import { sortObjectByKey } from '../../shared';
|
|
4
|
-
import StatusTag, { Props } from './StatusTag';
|
|
5
|
-
|
|
6
|
-
export default {
|
|
7
|
-
title: 'Components/StatusTag',
|
|
8
|
-
component: StatusTag,
|
|
9
|
-
} as ComponentMeta<typeof StatusTag>;
|
|
10
|
-
|
|
11
|
-
const Template: ComponentStory<typeof StatusTag> = ({ ...props }) => <StatusTag {...props} />;
|
|
12
|
-
|
|
13
|
-
export const WithProps = Template.bind({});
|
|
14
|
-
WithProps.args = sortObjectByKey({
|
|
15
|
-
...StatusTag.defaultProps,
|
|
16
|
-
children: 'Running',
|
|
17
|
-
// iconName: 'BuildstatusLoadingAnimated',
|
|
18
|
-
variant: 'running',
|
|
19
|
-
} as Props);
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
const StatusTagTheme = {
|
|
2
|
-
baseStyle: {
|
|
3
|
-
borderRadius: '4px',
|
|
4
|
-
paddingX: '8px',
|
|
5
|
-
},
|
|
6
|
-
sizes: {
|
|
7
|
-
small: {
|
|
8
|
-
paddingY: '4px',
|
|
9
|
-
},
|
|
10
|
-
normal: {
|
|
11
|
-
paddingY: '8px',
|
|
12
|
-
},
|
|
13
|
-
big: {
|
|
14
|
-
paddingY: '20px',
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
variants: {
|
|
18
|
-
aborted: {
|
|
19
|
-
backgroundColor: '#FFF6D1',
|
|
20
|
-
color: '#875B00',
|
|
21
|
-
},
|
|
22
|
-
failed: {
|
|
23
|
-
backgroundColor: '#FFF0F3',
|
|
24
|
-
color: '#A91E2E',
|
|
25
|
-
},
|
|
26
|
-
onHold: {
|
|
27
|
-
backgroundColor: '#F6F4F6',
|
|
28
|
-
color: '#6B6071',
|
|
29
|
-
},
|
|
30
|
-
running: {
|
|
31
|
-
backgroundColor: '#F9F2FD',
|
|
32
|
-
color: '#492F5C',
|
|
33
|
-
},
|
|
34
|
-
starting: {
|
|
35
|
-
backgroundColor: '#ECF8FD',
|
|
36
|
-
color: '#1066AC',
|
|
37
|
-
},
|
|
38
|
-
success: {
|
|
39
|
-
backgroundColor: '#EEF9F1',
|
|
40
|
-
color: '#167231',
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
export default StatusTagTheme;
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { HStack, useStyleConfig } from '@chakra-ui/react';
|
|
3
|
-
import { Icon } from '@bitrise/bitkit';
|
|
4
|
-
import Text from '../Text/Text';
|
|
5
|
-
|
|
6
|
-
type IconName =
|
|
7
|
-
| 'BuildstatusAborted'
|
|
8
|
-
| 'BuildstatusFailed'
|
|
9
|
-
| 'BuildstatusLoadingAnimated'
|
|
10
|
-
| 'BuildstatusNeverbuilt'
|
|
11
|
-
| 'BuildstatusSuccessful';
|
|
12
|
-
|
|
13
|
-
type Variant = 'aborted' | 'failed' | 'onHold' | 'running' | 'starting' | 'success';
|
|
14
|
-
|
|
15
|
-
export interface Props {
|
|
16
|
-
children?: string;
|
|
17
|
-
iconName?: IconName;
|
|
18
|
-
size?: 'big' | 'normal' | 'small';
|
|
19
|
-
variant: Variant;
|
|
20
|
-
width?: '8.5rem' | 'auto';
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
const getIcon = (variant: Variant, iconName?: IconName): IconName => {
|
|
24
|
-
const iconMap = {
|
|
25
|
-
aborted: 'BuildstatusAborted',
|
|
26
|
-
failed: 'BuildstatusFailed',
|
|
27
|
-
onHold: 'BuildstatusAborted',
|
|
28
|
-
running: 'BuildstatusLoadingAnimated',
|
|
29
|
-
starting: 'BuildstatusLoadingAnimated',
|
|
30
|
-
success: 'BuildstatusSuccessful',
|
|
31
|
-
};
|
|
32
|
-
if (!iconName) {
|
|
33
|
-
return iconMap[variant] as IconName;
|
|
34
|
-
}
|
|
35
|
-
return iconName;
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
const StatusTag = ({ children, iconName, size, variant, width }: Props) => {
|
|
39
|
-
const styles = useStyleConfig('StatusTag', { size, variant });
|
|
40
|
-
return (
|
|
41
|
-
<HStack alignItems="center" sx={styles} width={width}>
|
|
42
|
-
<Icon name={getIcon(variant, iconName)} />
|
|
43
|
-
<Text fontWeight="bold" size="2" textTransform="uppercase">
|
|
44
|
-
{children}
|
|
45
|
-
</Text>
|
|
46
|
-
</HStack>
|
|
47
|
-
);
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
StatusTag.defaultProps = {
|
|
51
|
-
size: 'normal',
|
|
52
|
-
width: '8.5rem',
|
|
53
|
-
} as Props;
|
|
54
|
-
|
|
55
|
-
export default StatusTag;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
|
3
|
-
import { sortObjectByKey } from '../../shared';
|
|
4
|
-
import Text from './Text';
|
|
5
|
-
|
|
6
|
-
export default {
|
|
7
|
-
title: 'Components/Text',
|
|
8
|
-
component: Text,
|
|
9
|
-
} as ComponentMeta<typeof Text>;
|
|
10
|
-
|
|
11
|
-
const Template: ComponentStory<typeof Text> = ({ ...props }) => <Text {...props} />;
|
|
12
|
-
|
|
13
|
-
export const WithProps = Template.bind({});
|
|
14
|
-
WithProps.args = sortObjectByKey({
|
|
15
|
-
align: 'left',
|
|
16
|
-
className: '',
|
|
17
|
-
children: 'The quick brown fox jumps over the lazy dog.',
|
|
18
|
-
fontWeight: 'normal',
|
|
19
|
-
letterSpacing: 'normal',
|
|
20
|
-
textTransform: 'none',
|
|
21
|
-
...Text.defaultProps,
|
|
22
|
-
});
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Text as ChakraText, TextProps } from '@chakra-ui/react';
|
|
3
|
-
|
|
4
|
-
type TextTags =
|
|
5
|
-
| 'a'
|
|
6
|
-
| 'abbr'
|
|
7
|
-
| 'bdi'
|
|
8
|
-
| 'bdo'
|
|
9
|
-
| 'blockquote'
|
|
10
|
-
| 'cite'
|
|
11
|
-
| 'data'
|
|
12
|
-
| 'dd'
|
|
13
|
-
| 'dfn'
|
|
14
|
-
| 'dt'
|
|
15
|
-
| 'em'
|
|
16
|
-
| 'figcaption'
|
|
17
|
-
| 'kbd'
|
|
18
|
-
| 'li'
|
|
19
|
-
| 'mark'
|
|
20
|
-
| 'p'
|
|
21
|
-
| 'pre'
|
|
22
|
-
| 'q'
|
|
23
|
-
| 'samp'
|
|
24
|
-
| 'small'
|
|
25
|
-
| 'span'
|
|
26
|
-
| 'strong'
|
|
27
|
-
| 'sub'
|
|
28
|
-
| 'sup'
|
|
29
|
-
| 'time'
|
|
30
|
-
| 'var';
|
|
31
|
-
|
|
32
|
-
export interface Props {
|
|
33
|
-
align?: 'center' | 'justify' | 'left' | 'right';
|
|
34
|
-
/**
|
|
35
|
-
* Any valid HTML text tag
|
|
36
|
-
*/
|
|
37
|
-
as?: TextTags;
|
|
38
|
-
children?: TextProps['children'];
|
|
39
|
-
className?: string;
|
|
40
|
-
/**
|
|
41
|
-
* Font weight
|
|
42
|
-
*/
|
|
43
|
-
fontWeight?: 'bold' | 'normal';
|
|
44
|
-
letterSpacing?: string;
|
|
45
|
-
/**
|
|
46
|
-
* Size config (https://www.figma.com/file/grik9mTaJ5DfhydhWhXdP5/Bitkit-Foundations?node-id=211%3A12)
|
|
47
|
-
*/
|
|
48
|
-
size?: '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8';
|
|
49
|
-
sx?: TextProps['sx'];
|
|
50
|
-
textTransform?: 'capitalize' | 'lowercase' | 'none' | 'uppercase';
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Basic `Text` component
|
|
55
|
-
*/
|
|
56
|
-
const Text = (props: Props) => {
|
|
57
|
-
const { size, textTransform } = props;
|
|
58
|
-
const properties: TextProps = { ...props };
|
|
59
|
-
if (size === '1' && (!textTransform || textTransform === 'none')) {
|
|
60
|
-
properties.textTransform = 'uppercase';
|
|
61
|
-
}
|
|
62
|
-
if (size === '5' || size === '6' || size === '7' || size === '8') {
|
|
63
|
-
properties.fontWeight = 'bold';
|
|
64
|
-
}
|
|
65
|
-
return <ChakraText {...properties} />;
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
Text.defaultProps = {
|
|
69
|
-
as: 'span',
|
|
70
|
-
size: '4',
|
|
71
|
-
} as Props;
|
|
72
|
-
|
|
73
|
-
export default Text;
|
package/src/chakra/shared.ts
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { extendTheme } from '@chakra-ui/react';
|
|
2
|
-
import { variables } from '@bitrise/bitkit';
|
|
3
|
-
import ButtonTheme from '../components/Button/Button.theme';
|
|
4
|
-
import StatusTagTheme from '../components/StatusTag/StatusTag.theme';
|
|
5
|
-
import MenuTheme from '../components/Menu/Menu.theme';
|
|
6
|
-
import typographyConfig from './typographyConfig';
|
|
7
|
-
|
|
8
|
-
const theme = extendTheme({
|
|
9
|
-
config: {
|
|
10
|
-
cssVarPrefix: 'bitkit',
|
|
11
|
-
},
|
|
12
|
-
colors: variables.colorMap,
|
|
13
|
-
fonts: {
|
|
14
|
-
body: `"TT Norms Pro", sans-serif`,
|
|
15
|
-
heading: `"TT Norms Pro", sans-serif`,
|
|
16
|
-
},
|
|
17
|
-
fontSizes: {
|
|
18
|
-
1: '11px',
|
|
19
|
-
2: '14px',
|
|
20
|
-
3: '16px',
|
|
21
|
-
4: '19px',
|
|
22
|
-
5: '24px',
|
|
23
|
-
6: '30px',
|
|
24
|
-
7: '36px',
|
|
25
|
-
8: '48px',
|
|
26
|
-
},
|
|
27
|
-
lineHeights: {
|
|
28
|
-
1: '16px',
|
|
29
|
-
2: '20px',
|
|
30
|
-
3: '24px',
|
|
31
|
-
4: '28px',
|
|
32
|
-
5: '36px',
|
|
33
|
-
6: '40px',
|
|
34
|
-
7: '48px',
|
|
35
|
-
8: '60px',
|
|
36
|
-
},
|
|
37
|
-
components: {
|
|
38
|
-
Button: ButtonTheme,
|
|
39
|
-
Heading: {
|
|
40
|
-
sizes: typographyConfig,
|
|
41
|
-
},
|
|
42
|
-
Menu: MenuTheme,
|
|
43
|
-
StatusTag: StatusTagTheme,
|
|
44
|
-
Text: {
|
|
45
|
-
sizes: typographyConfig,
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
export default theme;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { SystemStyleObject } from '@chakra-ui/react';
|
|
2
|
-
|
|
3
|
-
const config: Record<string, SystemStyleObject> = {
|
|
4
|
-
1: {
|
|
5
|
-
fontSize: '11px',
|
|
6
|
-
lineHeight: '16px',
|
|
7
|
-
},
|
|
8
|
-
2: {
|
|
9
|
-
fontSize: '14px',
|
|
10
|
-
lineHeight: '20px',
|
|
11
|
-
},
|
|
12
|
-
3: {
|
|
13
|
-
fontSize: '16px',
|
|
14
|
-
lineHeight: '24px',
|
|
15
|
-
},
|
|
16
|
-
4: {
|
|
17
|
-
fontSize: '19px',
|
|
18
|
-
lineHeight: '28px',
|
|
19
|
-
},
|
|
20
|
-
5: {
|
|
21
|
-
fontSize: '24px',
|
|
22
|
-
lineHeight: '36px',
|
|
23
|
-
},
|
|
24
|
-
6: {
|
|
25
|
-
fontSize: '30px',
|
|
26
|
-
lineHeight: '40px',
|
|
27
|
-
},
|
|
28
|
-
7: {
|
|
29
|
-
fontSize: '36px',
|
|
30
|
-
lineHeight: '48px',
|
|
31
|
-
},
|
|
32
|
-
8: {
|
|
33
|
-
fontSize: '48px',
|
|
34
|
-
lineHeight: '60px',
|
|
35
|
-
},
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
export default config;
|