@bitrise/bitkit 9.4.1-alpha.2 → 9.4.1-beta.3

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 (255) hide show
  1. package/.eslintrc.js +1 -1
  2. package/.husky/commit-msg +4 -0
  3. package/.nvmrc +1 -1
  4. package/.stylelintignore +0 -1
  5. package/.tool-versions +1 -1
  6. package/CHANGELOG.md +9 -2
  7. package/bitrise.yml +41 -27
  8. package/jest.setup.js +1 -0
  9. package/lib/cjs/ButtonWithDropdown/ButtonWithDropdown.d.ts +6 -3
  10. package/lib/cjs/ButtonWithDropdown/ButtonWithDropdown.d.ts.map +1 -1
  11. package/lib/cjs/ButtonWithDropdown/ButtonWithDropdown.js +9 -6
  12. package/lib/cjs/ButtonWithDropdown/ButtonWithDropdown.js.map +1 -1
  13. package/lib/cjs/Dropdown/Dropdown.d.ts.map +1 -1
  14. package/lib/cjs/Dropdown/Dropdown.js +6 -8
  15. package/lib/cjs/Dropdown/Dropdown.js.map +1 -1
  16. package/lib/cjs/Placement/Placement.css +17 -35
  17. package/lib/cjs/Placement/Placement.d.ts +5 -8
  18. package/lib/cjs/Placement/Placement.d.ts.map +1 -1
  19. package/lib/cjs/Placement/Placement.js.map +1 -1
  20. package/lib/cjs/Placement/PlacementPopper.d.ts +3 -4
  21. package/lib/cjs/Placement/PlacementPopper.d.ts.map +1 -1
  22. package/lib/cjs/Placement/PlacementPopper.js +52 -19
  23. package/lib/cjs/Placement/PlacementPopper.js.map +1 -1
  24. package/lib/cjs/Tooltip/Tooltip.d.ts +1 -1
  25. package/lib/cjs/Tooltip/Tooltip.d.ts.map +1 -1
  26. package/lib/cjs/hooks/useEventListener.d.ts.map +1 -1
  27. package/lib/cjs/hooks/useEventListener.js +0 -1
  28. package/lib/cjs/hooks/useEventListener.js.map +1 -1
  29. package/lib/cjs/index.d.ts +0 -9
  30. package/lib/cjs/index.d.ts.map +1 -1
  31. package/lib/cjs/index.js +1 -20
  32. package/lib/cjs/index.js.map +1 -1
  33. package/lib/cjs/tsconfig.tsbuildinfo +1 -1
  34. package/lib/esn/ButtonWithDropdown/ButtonWithDropdown.d.ts +6 -3
  35. package/lib/esn/ButtonWithDropdown/ButtonWithDropdown.d.ts.map +1 -1
  36. package/lib/esn/ButtonWithDropdown/ButtonWithDropdown.js +6 -3
  37. package/lib/esn/ButtonWithDropdown/ButtonWithDropdown.js.map +1 -1
  38. package/lib/esn/Dropdown/Dropdown.d.ts.map +1 -1
  39. package/lib/esn/Dropdown/Dropdown.js +6 -5
  40. package/lib/esn/Dropdown/Dropdown.js.map +1 -1
  41. package/lib/esn/Placement/Placement.css +17 -35
  42. package/lib/esn/Placement/Placement.d.ts +5 -8
  43. package/lib/esn/Placement/Placement.d.ts.map +1 -1
  44. package/lib/esn/Placement/Placement.js.map +1 -1
  45. package/lib/esn/Placement/PlacementPopper.d.ts +3 -4
  46. package/lib/esn/Placement/PlacementPopper.d.ts.map +1 -1
  47. package/lib/esn/Placement/PlacementPopper.js +53 -30
  48. package/lib/esn/Placement/PlacementPopper.js.map +1 -1
  49. package/lib/esn/Tooltip/Tooltip.d.ts +1 -1
  50. package/lib/esn/Tooltip/Tooltip.d.ts.map +1 -1
  51. package/lib/esn/hooks/useEventListener.d.ts.map +1 -1
  52. package/lib/esn/hooks/useEventListener.js +0 -1
  53. package/lib/esn/hooks/useEventListener.js.map +1 -1
  54. package/lib/esn/index.d.ts +0 -9
  55. package/lib/esn/index.d.ts.map +1 -1
  56. package/lib/esn/index.js +0 -9
  57. package/lib/esn/index.js.map +1 -1
  58. package/lib/esn/tsconfig.tsbuildinfo +1 -1
  59. package/package.json +18 -42
  60. package/postcss.config.js +9 -5
  61. package/release.config.js +2 -1
  62. package/site/components/Documentation/Components/SectionButtons.tsx +37 -4
  63. package/site/components/Documentation/Components/SectionDropdowns.tsx +1 -1
  64. package/site/components/Documentation/Components/SectionPlacement.tsx +4 -1
  65. package/src/ButtonWithDropdown/ButtonWithDropdown.tsx +18 -21
  66. package/src/Dropdown/Dropdown.tsx +13 -8
  67. package/src/Placement/Placement.css +17 -35
  68. package/src/Placement/Placement.tsx +5 -8
  69. package/src/Placement/PlacementPopper.tsx +78 -50
  70. package/src/Tooltip/Tooltip.tsx +1 -1
  71. package/src/hooks/useEventListener.ts +25 -5
  72. package/src/index.ts +0 -10
  73. package/tsconfig.json +2 -5
  74. package/.storybook/main.js +0 -35
  75. package/.storybook/preview.js +0 -20
  76. package/lib/cjs/chakra/BitkitProvider.d.ts +0 -5
  77. package/lib/cjs/chakra/BitkitProvider.d.ts.map +0 -1
  78. package/lib/cjs/chakra/BitkitProvider.js +0 -14
  79. package/lib/cjs/chakra/BitkitProvider.js.map +0 -1
  80. package/lib/cjs/chakra/components/Button/Button.d.ts +0 -22
  81. package/lib/cjs/chakra/components/Button/Button.d.ts.map +0 -1
  82. package/lib/cjs/chakra/components/Button/Button.js +0 -61
  83. package/lib/cjs/chakra/components/Button/Button.js.map +0 -1
  84. package/lib/cjs/chakra/components/Button/Button.stories.d.ts +0 -6
  85. package/lib/cjs/chakra/components/Button/Button.stories.d.ts.map +0 -1
  86. package/lib/cjs/chakra/components/Button/Button.stories.js +0 -37
  87. package/lib/cjs/chakra/components/Button/Button.stories.js.map +0 -1
  88. package/lib/cjs/chakra/components/Button/Button.theme.d.ts +0 -117
  89. package/lib/cjs/chakra/components/Button/Button.theme.d.ts.map +0 -1
  90. package/lib/cjs/chakra/components/Button/Button.theme.js +0 -119
  91. package/lib/cjs/chakra/components/Button/Button.theme.js.map +0 -1
  92. package/lib/cjs/chakra/components/IconButton/IconButton.d.ts +0 -14
  93. package/lib/cjs/chakra/components/IconButton/IconButton.d.ts.map +0 -1
  94. package/lib/cjs/chakra/components/IconButton/IconButton.js +0 -41
  95. package/lib/cjs/chakra/components/IconButton/IconButton.js.map +0 -1
  96. package/lib/cjs/chakra/components/IconButton/IconButton.stories.d.ts +0 -6
  97. package/lib/cjs/chakra/components/IconButton/IconButton.stories.d.ts.map +0 -1
  98. package/lib/cjs/chakra/components/IconButton/IconButton.stories.js +0 -48
  99. package/lib/cjs/chakra/components/IconButton/IconButton.stories.js.map +0 -1
  100. package/lib/cjs/chakra/components/Link/Link.d.ts +0 -16
  101. package/lib/cjs/chakra/components/Link/Link.d.ts.map +0 -1
  102. package/lib/cjs/chakra/components/Link/Link.js +0 -44
  103. package/lib/cjs/chakra/components/Link/Link.js.map +0 -1
  104. package/lib/cjs/chakra/components/Link/Link.stories.d.ts +0 -12
  105. package/lib/cjs/chakra/components/Link/Link.stories.d.ts.map +0 -1
  106. package/lib/cjs/chakra/components/Link/Link.stories.js +0 -42
  107. package/lib/cjs/chakra/components/Link/Link.stories.js.map +0 -1
  108. package/lib/cjs/chakra/components/Menu/Menu.d.ts +0 -6
  109. package/lib/cjs/chakra/components/Menu/Menu.d.ts.map +0 -1
  110. package/lib/cjs/chakra/components/Menu/Menu.js +0 -21
  111. package/lib/cjs/chakra/components/Menu/Menu.js.map +0 -1
  112. package/lib/cjs/chakra/components/Menu/Menu.stories.d.ts +0 -9
  113. package/lib/cjs/chakra/components/Menu/Menu.stories.d.ts.map +0 -1
  114. package/lib/cjs/chakra/components/Menu/Menu.stories.js +0 -48
  115. package/lib/cjs/chakra/components/Menu/Menu.stories.js.map +0 -1
  116. package/lib/cjs/chakra/components/Menu/Menu.theme.d.ts +0 -4
  117. package/lib/cjs/chakra/components/Menu/Menu.theme.d.ts.map +0 -1
  118. package/lib/cjs/chakra/components/Menu/Menu.theme.js +0 -23
  119. package/lib/cjs/chakra/components/Menu/Menu.theme.js.map +0 -1
  120. package/lib/cjs/chakra/components/Menu/MenuItem.d.ts +0 -12
  121. package/lib/cjs/chakra/components/Menu/MenuItem.d.ts.map +0 -1
  122. package/lib/cjs/chakra/components/Menu/MenuItem.js +0 -39
  123. package/lib/cjs/chakra/components/Menu/MenuItem.js.map +0 -1
  124. package/lib/cjs/chakra/components/StatusTag/StatusTag.d.ts +0 -16
  125. package/lib/cjs/chakra/components/StatusTag/StatusTag.d.ts.map +0 -1
  126. package/lib/cjs/chakra/components/StatusTag/StatusTag.js +0 -36
  127. package/lib/cjs/chakra/components/StatusTag/StatusTag.js.map +0 -1
  128. package/lib/cjs/chakra/components/StatusTag/StatusTag.stories.d.ts +0 -13
  129. package/lib/cjs/chakra/components/StatusTag/StatusTag.stories.d.ts.map +0 -1
  130. package/lib/cjs/chakra/components/StatusTag/StatusTag.stories.js +0 -44
  131. package/lib/cjs/chakra/components/StatusTag/StatusTag.stories.js.map +0 -1
  132. package/lib/cjs/chakra/components/StatusTag/StatusTag.theme.d.ts +0 -45
  133. package/lib/cjs/chakra/components/StatusTag/StatusTag.theme.d.ts.map +0 -1
  134. package/lib/cjs/chakra/components/StatusTag/StatusTag.theme.js +0 -47
  135. package/lib/cjs/chakra/components/StatusTag/StatusTag.theme.js.map +0 -1
  136. package/lib/cjs/chakra/components/Text/Text.d.ts +0 -32
  137. package/lib/cjs/chakra/components/Text/Text.d.ts.map +0 -1
  138. package/lib/cjs/chakra/components/Text/Text.js +0 -38
  139. package/lib/cjs/chakra/components/Text/Text.js.map +0 -1
  140. package/lib/cjs/chakra/components/Text/Text.stories.d.ts +0 -12
  141. package/lib/cjs/chakra/components/Text/Text.stories.d.ts.map +0 -1
  142. package/lib/cjs/chakra/components/Text/Text.stories.js +0 -42
  143. package/lib/cjs/chakra/components/Text/Text.stories.js.map +0 -1
  144. package/lib/cjs/chakra/shared.d.ts +0 -2
  145. package/lib/cjs/chakra/shared.d.ts.map +0 -1
  146. package/lib/cjs/chakra/shared.js +0 -15
  147. package/lib/cjs/chakra/shared.js.map +0 -1
  148. package/lib/cjs/chakra/theme/theme.d.ts +0 -3
  149. package/lib/cjs/chakra/theme/theme.d.ts.map +0 -1
  150. package/lib/cjs/chakra/theme/theme.js +0 -54
  151. package/lib/cjs/chakra/theme/theme.js.map +0 -1
  152. package/lib/cjs/chakra/theme/typographyConfig.d.ts +0 -4
  153. package/lib/cjs/chakra/theme/typographyConfig.d.ts.map +0 -1
  154. package/lib/cjs/chakra/theme/typographyConfig.js +0 -38
  155. package/lib/cjs/chakra/theme/typographyConfig.js.map +0 -1
  156. package/lib/esn/chakra/BitkitProvider.d.ts +0 -5
  157. package/lib/esn/chakra/BitkitProvider.d.ts.map +0 -1
  158. package/lib/esn/chakra/BitkitProvider.js +0 -8
  159. package/lib/esn/chakra/BitkitProvider.js.map +0 -1
  160. package/lib/esn/chakra/components/Button/Button.d.ts +0 -22
  161. package/lib/esn/chakra/components/Button/Button.d.ts.map +0 -1
  162. package/lib/esn/chakra/components/Button/Button.js +0 -34
  163. package/lib/esn/chakra/components/Button/Button.js.map +0 -1
  164. package/lib/esn/chakra/components/Button/Button.stories.d.ts +0 -6
  165. package/lib/esn/chakra/components/Button/Button.stories.d.ts.map +0 -1
  166. package/lib/esn/chakra/components/Button/Button.stories.js +0 -29
  167. package/lib/esn/chakra/components/Button/Button.stories.js.map +0 -1
  168. package/lib/esn/chakra/components/Button/Button.theme.d.ts +0 -117
  169. package/lib/esn/chakra/components/Button/Button.theme.d.ts.map +0 -1
  170. package/lib/esn/chakra/components/Button/Button.theme.js +0 -117
  171. package/lib/esn/chakra/components/Button/Button.theme.js.map +0 -1
  172. package/lib/esn/chakra/components/IconButton/IconButton.d.ts +0 -14
  173. package/lib/esn/chakra/components/IconButton/IconButton.d.ts.map +0 -1
  174. package/lib/esn/chakra/components/IconButton/IconButton.js +0 -18
  175. package/lib/esn/chakra/components/IconButton/IconButton.js.map +0 -1
  176. package/lib/esn/chakra/components/IconButton/IconButton.stories.d.ts +0 -6
  177. package/lib/esn/chakra/components/IconButton/IconButton.stories.d.ts.map +0 -1
  178. package/lib/esn/chakra/components/IconButton/IconButton.stories.js +0 -21
  179. package/lib/esn/chakra/components/IconButton/IconButton.stories.js.map +0 -1
  180. package/lib/esn/chakra/components/Link/Link.d.ts +0 -16
  181. package/lib/esn/chakra/components/Link/Link.d.ts.map +0 -1
  182. package/lib/esn/chakra/components/Link/Link.js +0 -17
  183. package/lib/esn/chakra/components/Link/Link.js.map +0 -1
  184. package/lib/esn/chakra/components/Link/Link.stories.d.ts +0 -12
  185. package/lib/esn/chakra/components/Link/Link.stories.d.ts.map +0 -1
  186. package/lib/esn/chakra/components/Link/Link.stories.js +0 -16
  187. package/lib/esn/chakra/components/Link/Link.stories.js.map +0 -1
  188. package/lib/esn/chakra/components/Menu/Menu.d.ts +0 -6
  189. package/lib/esn/chakra/components/Menu/Menu.d.ts.map +0 -1
  190. package/lib/esn/chakra/components/Menu/Menu.js +0 -5
  191. package/lib/esn/chakra/components/Menu/Menu.js.map +0 -1
  192. package/lib/esn/chakra/components/Menu/Menu.stories.d.ts +0 -9
  193. package/lib/esn/chakra/components/Menu/Menu.stories.d.ts.map +0 -1
  194. package/lib/esn/chakra/components/Menu/Menu.stories.js +0 -39
  195. package/lib/esn/chakra/components/Menu/Menu.stories.js.map +0 -1
  196. package/lib/esn/chakra/components/Menu/Menu.theme.d.ts +0 -4
  197. package/lib/esn/chakra/components/Menu/Menu.theme.d.ts.map +0 -1
  198. package/lib/esn/chakra/components/Menu/Menu.theme.js +0 -21
  199. package/lib/esn/chakra/components/Menu/Menu.theme.js.map +0 -1
  200. package/lib/esn/chakra/components/Menu/MenuItem.d.ts +0 -12
  201. package/lib/esn/chakra/components/Menu/MenuItem.d.ts.map +0 -1
  202. package/lib/esn/chakra/components/Menu/MenuItem.js +0 -12
  203. package/lib/esn/chakra/components/Menu/MenuItem.js.map +0 -1
  204. package/lib/esn/chakra/components/StatusTag/StatusTag.d.ts +0 -16
  205. package/lib/esn/chakra/components/StatusTag/StatusTag.d.ts.map +0 -1
  206. package/lib/esn/chakra/components/StatusTag/StatusTag.js +0 -30
  207. package/lib/esn/chakra/components/StatusTag/StatusTag.js.map +0 -1
  208. package/lib/esn/chakra/components/StatusTag/StatusTag.stories.d.ts +0 -13
  209. package/lib/esn/chakra/components/StatusTag/StatusTag.stories.d.ts.map +0 -1
  210. package/lib/esn/chakra/components/StatusTag/StatusTag.stories.js +0 -16
  211. package/lib/esn/chakra/components/StatusTag/StatusTag.stories.js.map +0 -1
  212. package/lib/esn/chakra/components/StatusTag/StatusTag.theme.d.ts +0 -45
  213. package/lib/esn/chakra/components/StatusTag/StatusTag.theme.d.ts.map +0 -1
  214. package/lib/esn/chakra/components/StatusTag/StatusTag.theme.js +0 -45
  215. package/lib/esn/chakra/components/StatusTag/StatusTag.theme.js.map +0 -1
  216. package/lib/esn/chakra/components/Text/Text.d.ts +0 -32
  217. package/lib/esn/chakra/components/Text/Text.d.ts.map +0 -1
  218. package/lib/esn/chakra/components/Text/Text.js +0 -22
  219. package/lib/esn/chakra/components/Text/Text.js.map +0 -1
  220. package/lib/esn/chakra/components/Text/Text.stories.d.ts +0 -12
  221. package/lib/esn/chakra/components/Text/Text.stories.d.ts.map +0 -1
  222. package/lib/esn/chakra/components/Text/Text.stories.js +0 -19
  223. package/lib/esn/chakra/components/Text/Text.stories.js.map +0 -1
  224. package/lib/esn/chakra/shared.d.ts +0 -2
  225. package/lib/esn/chakra/shared.d.ts.map +0 -1
  226. package/lib/esn/chakra/shared.js +0 -11
  227. package/lib/esn/chakra/shared.js.map +0 -1
  228. package/lib/esn/chakra/theme/theme.d.ts +0 -3
  229. package/lib/esn/chakra/theme/theme.d.ts.map +0 -1
  230. package/lib/esn/chakra/theme/theme.js +0 -49
  231. package/lib/esn/chakra/theme/theme.js.map +0 -1
  232. package/lib/esn/chakra/theme/typographyConfig.d.ts +0 -4
  233. package/lib/esn/chakra/theme/typographyConfig.d.ts.map +0 -1
  234. package/lib/esn/chakra/theme/typographyConfig.js +0 -36
  235. package/lib/esn/chakra/theme/typographyConfig.js.map +0 -1
  236. package/src/chakra/BitkitProvider.tsx +0 -9
  237. package/src/chakra/components/Button/Button.stories.tsx +0 -32
  238. package/src/chakra/components/Button/Button.theme.ts +0 -117
  239. package/src/chakra/components/Button/Button.tsx +0 -52
  240. package/src/chakra/components/IconButton/IconButton.stories.tsx +0 -24
  241. package/src/chakra/components/IconButton/IconButton.tsx +0 -29
  242. package/src/chakra/components/Link/Link.stories.tsx +0 -19
  243. package/src/chakra/components/Link/Link.tsx +0 -30
  244. package/src/chakra/components/Menu/Menu.stories.tsx +0 -57
  245. package/src/chakra/components/Menu/Menu.theme.ts +0 -23
  246. package/src/chakra/components/Menu/Menu.tsx +0 -8
  247. package/src/chakra/components/Menu/MenuItem.tsx +0 -20
  248. package/src/chakra/components/StatusTag/StatusTag.stories.tsx +0 -19
  249. package/src/chakra/components/StatusTag/StatusTag.theme.ts +0 -45
  250. package/src/chakra/components/StatusTag/StatusTag.tsx +0 -55
  251. package/src/chakra/components/Text/Text.stories.tsx +0 -22
  252. package/src/chakra/components/Text/Text.tsx +0 -73
  253. package/src/chakra/shared.ts +0 -11
  254. package/src/chakra/theme/theme.ts +0 -50
  255. 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;