@bitrise/bitkit 9.4.1-alpha.2 → 9.4.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.
Files changed (208) hide show
  1. package/.eslintrc.js +2 -9
  2. package/.stylelintignore +0 -1
  3. package/.stylelintrc +3 -2
  4. package/CHANGELOG.md +5 -2
  5. package/jest.setup.js +1 -1
  6. package/lib/cjs/DatePicker/DatePickerDay.js +1 -1
  7. package/lib/cjs/DatePicker/DatePickerDay.js.map +1 -1
  8. package/lib/cjs/Dropdown/DropdownMenu.css +1 -1
  9. package/lib/cjs/index.d.ts +0 -9
  10. package/lib/cjs/index.d.ts.map +1 -1
  11. package/lib/cjs/index.js +1 -20
  12. package/lib/cjs/index.js.map +1 -1
  13. package/lib/cjs/tsconfig.tsbuildinfo +1 -1
  14. package/lib/esn/DatePicker/DatePickerDay.js +1 -1
  15. package/lib/esn/DatePicker/DatePickerDay.js.map +1 -1
  16. package/lib/esn/Dropdown/DropdownMenu.css +1 -1
  17. package/lib/esn/index.d.ts +0 -9
  18. package/lib/esn/index.d.ts.map +1 -1
  19. package/lib/esn/index.js +0 -9
  20. package/lib/esn/index.js.map +1 -1
  21. package/lib/esn/tsconfig.tsbuildinfo +1 -1
  22. package/package.json +21 -44
  23. package/src/DatePicker/DatePickerDay.tsx +1 -1
  24. package/src/Dropdown/DropdownMenu.css +1 -1
  25. package/src/index.ts +0 -10
  26. package/tsconfig.json +2 -5
  27. package/.storybook/main.js +0 -35
  28. package/.storybook/preview.js +0 -20
  29. package/lib/cjs/chakra/BitkitProvider.d.ts +0 -5
  30. package/lib/cjs/chakra/BitkitProvider.d.ts.map +0 -1
  31. package/lib/cjs/chakra/BitkitProvider.js +0 -14
  32. package/lib/cjs/chakra/BitkitProvider.js.map +0 -1
  33. package/lib/cjs/chakra/components/Button/Button.d.ts +0 -22
  34. package/lib/cjs/chakra/components/Button/Button.d.ts.map +0 -1
  35. package/lib/cjs/chakra/components/Button/Button.js +0 -61
  36. package/lib/cjs/chakra/components/Button/Button.js.map +0 -1
  37. package/lib/cjs/chakra/components/Button/Button.stories.d.ts +0 -6
  38. package/lib/cjs/chakra/components/Button/Button.stories.d.ts.map +0 -1
  39. package/lib/cjs/chakra/components/Button/Button.stories.js +0 -37
  40. package/lib/cjs/chakra/components/Button/Button.stories.js.map +0 -1
  41. package/lib/cjs/chakra/components/Button/Button.theme.d.ts +0 -117
  42. package/lib/cjs/chakra/components/Button/Button.theme.d.ts.map +0 -1
  43. package/lib/cjs/chakra/components/Button/Button.theme.js +0 -119
  44. package/lib/cjs/chakra/components/Button/Button.theme.js.map +0 -1
  45. package/lib/cjs/chakra/components/IconButton/IconButton.d.ts +0 -14
  46. package/lib/cjs/chakra/components/IconButton/IconButton.d.ts.map +0 -1
  47. package/lib/cjs/chakra/components/IconButton/IconButton.js +0 -41
  48. package/lib/cjs/chakra/components/IconButton/IconButton.js.map +0 -1
  49. package/lib/cjs/chakra/components/IconButton/IconButton.stories.d.ts +0 -6
  50. package/lib/cjs/chakra/components/IconButton/IconButton.stories.d.ts.map +0 -1
  51. package/lib/cjs/chakra/components/IconButton/IconButton.stories.js +0 -48
  52. package/lib/cjs/chakra/components/IconButton/IconButton.stories.js.map +0 -1
  53. package/lib/cjs/chakra/components/Link/Link.d.ts +0 -16
  54. package/lib/cjs/chakra/components/Link/Link.d.ts.map +0 -1
  55. package/lib/cjs/chakra/components/Link/Link.js +0 -44
  56. package/lib/cjs/chakra/components/Link/Link.js.map +0 -1
  57. package/lib/cjs/chakra/components/Link/Link.stories.d.ts +0 -12
  58. package/lib/cjs/chakra/components/Link/Link.stories.d.ts.map +0 -1
  59. package/lib/cjs/chakra/components/Link/Link.stories.js +0 -42
  60. package/lib/cjs/chakra/components/Link/Link.stories.js.map +0 -1
  61. package/lib/cjs/chakra/components/Menu/Menu.d.ts +0 -6
  62. package/lib/cjs/chakra/components/Menu/Menu.d.ts.map +0 -1
  63. package/lib/cjs/chakra/components/Menu/Menu.js +0 -21
  64. package/lib/cjs/chakra/components/Menu/Menu.js.map +0 -1
  65. package/lib/cjs/chakra/components/Menu/Menu.stories.d.ts +0 -9
  66. package/lib/cjs/chakra/components/Menu/Menu.stories.d.ts.map +0 -1
  67. package/lib/cjs/chakra/components/Menu/Menu.stories.js +0 -48
  68. package/lib/cjs/chakra/components/Menu/Menu.stories.js.map +0 -1
  69. package/lib/cjs/chakra/components/Menu/Menu.theme.d.ts +0 -4
  70. package/lib/cjs/chakra/components/Menu/Menu.theme.d.ts.map +0 -1
  71. package/lib/cjs/chakra/components/Menu/Menu.theme.js +0 -23
  72. package/lib/cjs/chakra/components/Menu/Menu.theme.js.map +0 -1
  73. package/lib/cjs/chakra/components/Menu/MenuItem.d.ts +0 -12
  74. package/lib/cjs/chakra/components/Menu/MenuItem.d.ts.map +0 -1
  75. package/lib/cjs/chakra/components/Menu/MenuItem.js +0 -39
  76. package/lib/cjs/chakra/components/Menu/MenuItem.js.map +0 -1
  77. package/lib/cjs/chakra/components/StatusTag/StatusTag.d.ts +0 -16
  78. package/lib/cjs/chakra/components/StatusTag/StatusTag.d.ts.map +0 -1
  79. package/lib/cjs/chakra/components/StatusTag/StatusTag.js +0 -36
  80. package/lib/cjs/chakra/components/StatusTag/StatusTag.js.map +0 -1
  81. package/lib/cjs/chakra/components/StatusTag/StatusTag.stories.d.ts +0 -13
  82. package/lib/cjs/chakra/components/StatusTag/StatusTag.stories.d.ts.map +0 -1
  83. package/lib/cjs/chakra/components/StatusTag/StatusTag.stories.js +0 -44
  84. package/lib/cjs/chakra/components/StatusTag/StatusTag.stories.js.map +0 -1
  85. package/lib/cjs/chakra/components/StatusTag/StatusTag.theme.d.ts +0 -45
  86. package/lib/cjs/chakra/components/StatusTag/StatusTag.theme.d.ts.map +0 -1
  87. package/lib/cjs/chakra/components/StatusTag/StatusTag.theme.js +0 -47
  88. package/lib/cjs/chakra/components/StatusTag/StatusTag.theme.js.map +0 -1
  89. package/lib/cjs/chakra/components/Text/Text.d.ts +0 -32
  90. package/lib/cjs/chakra/components/Text/Text.d.ts.map +0 -1
  91. package/lib/cjs/chakra/components/Text/Text.js +0 -38
  92. package/lib/cjs/chakra/components/Text/Text.js.map +0 -1
  93. package/lib/cjs/chakra/components/Text/Text.stories.d.ts +0 -12
  94. package/lib/cjs/chakra/components/Text/Text.stories.d.ts.map +0 -1
  95. package/lib/cjs/chakra/components/Text/Text.stories.js +0 -42
  96. package/lib/cjs/chakra/components/Text/Text.stories.js.map +0 -1
  97. package/lib/cjs/chakra/shared.d.ts +0 -2
  98. package/lib/cjs/chakra/shared.d.ts.map +0 -1
  99. package/lib/cjs/chakra/shared.js +0 -15
  100. package/lib/cjs/chakra/shared.js.map +0 -1
  101. package/lib/cjs/chakra/theme/theme.d.ts +0 -3
  102. package/lib/cjs/chakra/theme/theme.d.ts.map +0 -1
  103. package/lib/cjs/chakra/theme/theme.js +0 -54
  104. package/lib/cjs/chakra/theme/theme.js.map +0 -1
  105. package/lib/cjs/chakra/theme/typographyConfig.d.ts +0 -4
  106. package/lib/cjs/chakra/theme/typographyConfig.d.ts.map +0 -1
  107. package/lib/cjs/chakra/theme/typographyConfig.js +0 -38
  108. package/lib/cjs/chakra/theme/typographyConfig.js.map +0 -1
  109. package/lib/esn/chakra/BitkitProvider.d.ts +0 -5
  110. package/lib/esn/chakra/BitkitProvider.d.ts.map +0 -1
  111. package/lib/esn/chakra/BitkitProvider.js +0 -8
  112. package/lib/esn/chakra/BitkitProvider.js.map +0 -1
  113. package/lib/esn/chakra/components/Button/Button.d.ts +0 -22
  114. package/lib/esn/chakra/components/Button/Button.d.ts.map +0 -1
  115. package/lib/esn/chakra/components/Button/Button.js +0 -34
  116. package/lib/esn/chakra/components/Button/Button.js.map +0 -1
  117. package/lib/esn/chakra/components/Button/Button.stories.d.ts +0 -6
  118. package/lib/esn/chakra/components/Button/Button.stories.d.ts.map +0 -1
  119. package/lib/esn/chakra/components/Button/Button.stories.js +0 -29
  120. package/lib/esn/chakra/components/Button/Button.stories.js.map +0 -1
  121. package/lib/esn/chakra/components/Button/Button.theme.d.ts +0 -117
  122. package/lib/esn/chakra/components/Button/Button.theme.d.ts.map +0 -1
  123. package/lib/esn/chakra/components/Button/Button.theme.js +0 -117
  124. package/lib/esn/chakra/components/Button/Button.theme.js.map +0 -1
  125. package/lib/esn/chakra/components/IconButton/IconButton.d.ts +0 -14
  126. package/lib/esn/chakra/components/IconButton/IconButton.d.ts.map +0 -1
  127. package/lib/esn/chakra/components/IconButton/IconButton.js +0 -18
  128. package/lib/esn/chakra/components/IconButton/IconButton.js.map +0 -1
  129. package/lib/esn/chakra/components/IconButton/IconButton.stories.d.ts +0 -6
  130. package/lib/esn/chakra/components/IconButton/IconButton.stories.d.ts.map +0 -1
  131. package/lib/esn/chakra/components/IconButton/IconButton.stories.js +0 -21
  132. package/lib/esn/chakra/components/IconButton/IconButton.stories.js.map +0 -1
  133. package/lib/esn/chakra/components/Link/Link.d.ts +0 -16
  134. package/lib/esn/chakra/components/Link/Link.d.ts.map +0 -1
  135. package/lib/esn/chakra/components/Link/Link.js +0 -17
  136. package/lib/esn/chakra/components/Link/Link.js.map +0 -1
  137. package/lib/esn/chakra/components/Link/Link.stories.d.ts +0 -12
  138. package/lib/esn/chakra/components/Link/Link.stories.d.ts.map +0 -1
  139. package/lib/esn/chakra/components/Link/Link.stories.js +0 -16
  140. package/lib/esn/chakra/components/Link/Link.stories.js.map +0 -1
  141. package/lib/esn/chakra/components/Menu/Menu.d.ts +0 -6
  142. package/lib/esn/chakra/components/Menu/Menu.d.ts.map +0 -1
  143. package/lib/esn/chakra/components/Menu/Menu.js +0 -5
  144. package/lib/esn/chakra/components/Menu/Menu.js.map +0 -1
  145. package/lib/esn/chakra/components/Menu/Menu.stories.d.ts +0 -9
  146. package/lib/esn/chakra/components/Menu/Menu.stories.d.ts.map +0 -1
  147. package/lib/esn/chakra/components/Menu/Menu.stories.js +0 -39
  148. package/lib/esn/chakra/components/Menu/Menu.stories.js.map +0 -1
  149. package/lib/esn/chakra/components/Menu/Menu.theme.d.ts +0 -4
  150. package/lib/esn/chakra/components/Menu/Menu.theme.d.ts.map +0 -1
  151. package/lib/esn/chakra/components/Menu/Menu.theme.js +0 -21
  152. package/lib/esn/chakra/components/Menu/Menu.theme.js.map +0 -1
  153. package/lib/esn/chakra/components/Menu/MenuItem.d.ts +0 -12
  154. package/lib/esn/chakra/components/Menu/MenuItem.d.ts.map +0 -1
  155. package/lib/esn/chakra/components/Menu/MenuItem.js +0 -12
  156. package/lib/esn/chakra/components/Menu/MenuItem.js.map +0 -1
  157. package/lib/esn/chakra/components/StatusTag/StatusTag.d.ts +0 -16
  158. package/lib/esn/chakra/components/StatusTag/StatusTag.d.ts.map +0 -1
  159. package/lib/esn/chakra/components/StatusTag/StatusTag.js +0 -30
  160. package/lib/esn/chakra/components/StatusTag/StatusTag.js.map +0 -1
  161. package/lib/esn/chakra/components/StatusTag/StatusTag.stories.d.ts +0 -13
  162. package/lib/esn/chakra/components/StatusTag/StatusTag.stories.d.ts.map +0 -1
  163. package/lib/esn/chakra/components/StatusTag/StatusTag.stories.js +0 -16
  164. package/lib/esn/chakra/components/StatusTag/StatusTag.stories.js.map +0 -1
  165. package/lib/esn/chakra/components/StatusTag/StatusTag.theme.d.ts +0 -45
  166. package/lib/esn/chakra/components/StatusTag/StatusTag.theme.d.ts.map +0 -1
  167. package/lib/esn/chakra/components/StatusTag/StatusTag.theme.js +0 -45
  168. package/lib/esn/chakra/components/StatusTag/StatusTag.theme.js.map +0 -1
  169. package/lib/esn/chakra/components/Text/Text.d.ts +0 -32
  170. package/lib/esn/chakra/components/Text/Text.d.ts.map +0 -1
  171. package/lib/esn/chakra/components/Text/Text.js +0 -22
  172. package/lib/esn/chakra/components/Text/Text.js.map +0 -1
  173. package/lib/esn/chakra/components/Text/Text.stories.d.ts +0 -12
  174. package/lib/esn/chakra/components/Text/Text.stories.d.ts.map +0 -1
  175. package/lib/esn/chakra/components/Text/Text.stories.js +0 -19
  176. package/lib/esn/chakra/components/Text/Text.stories.js.map +0 -1
  177. package/lib/esn/chakra/shared.d.ts +0 -2
  178. package/lib/esn/chakra/shared.d.ts.map +0 -1
  179. package/lib/esn/chakra/shared.js +0 -11
  180. package/lib/esn/chakra/shared.js.map +0 -1
  181. package/lib/esn/chakra/theme/theme.d.ts +0 -3
  182. package/lib/esn/chakra/theme/theme.d.ts.map +0 -1
  183. package/lib/esn/chakra/theme/theme.js +0 -49
  184. package/lib/esn/chakra/theme/theme.js.map +0 -1
  185. package/lib/esn/chakra/theme/typographyConfig.d.ts +0 -4
  186. package/lib/esn/chakra/theme/typographyConfig.d.ts.map +0 -1
  187. package/lib/esn/chakra/theme/typographyConfig.js +0 -36
  188. package/lib/esn/chakra/theme/typographyConfig.js.map +0 -1
  189. package/src/chakra/BitkitProvider.tsx +0 -9
  190. package/src/chakra/components/Button/Button.stories.tsx +0 -32
  191. package/src/chakra/components/Button/Button.theme.ts +0 -117
  192. package/src/chakra/components/Button/Button.tsx +0 -52
  193. package/src/chakra/components/IconButton/IconButton.stories.tsx +0 -24
  194. package/src/chakra/components/IconButton/IconButton.tsx +0 -29
  195. package/src/chakra/components/Link/Link.stories.tsx +0 -19
  196. package/src/chakra/components/Link/Link.tsx +0 -30
  197. package/src/chakra/components/Menu/Menu.stories.tsx +0 -57
  198. package/src/chakra/components/Menu/Menu.theme.ts +0 -23
  199. package/src/chakra/components/Menu/Menu.tsx +0 -8
  200. package/src/chakra/components/Menu/MenuItem.tsx +0 -20
  201. package/src/chakra/components/StatusTag/StatusTag.stories.tsx +0 -19
  202. package/src/chakra/components/StatusTag/StatusTag.theme.ts +0 -45
  203. package/src/chakra/components/StatusTag/StatusTag.tsx +0 -55
  204. package/src/chakra/components/Text/Text.stories.tsx +0 -22
  205. package/src/chakra/components/Text/Text.tsx +0 -73
  206. package/src/chakra/shared.ts +0 -11
  207. package/src/chakra/theme/theme.ts +0 -50
  208. 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,8 +0,0 @@
1
- import React from 'react';
2
- import { Menu as ChakraMenu, MenuProps } from '@chakra-ui/react';
3
-
4
- export type Props = MenuProps;
5
-
6
- const Menu = (props: Props) => <ChakraMenu {...props} />;
7
-
8
- export default Menu;
@@ -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;
@@ -1,11 +0,0 @@
1
- /* eslint-disable */
2
-
3
- export const sortObjectByKey = (unordered: any) => {
4
- return Object.keys(unordered)
5
- .sort()
6
- .reduce((obj, key) => {
7
- /* @ts-ignore */
8
- obj[key] = unordered[key];
9
- return obj;
10
- }, {});
11
- };
@@ -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;