@bitrise/bitkit 9.18.1 → 9.19.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bitrise/bitkit",
3
3
  "description": "Bitrise React component library",
4
- "version": "9.18.1",
4
+ "version": "9.19.1",
5
5
  "repository": "git@github.com:bitrise-io/bitkit.git",
6
6
  "main": "src/index.ts",
7
7
  "license": "UNLICENSED",
@@ -12,17 +12,18 @@
12
12
  "build:lib": "rm -rf ./lib && yarn build:lib:cjs && yarn build:lib:esn",
13
13
  "build:lib:esn": "tsc -p src -m esnext -t esnext --outDir lib/esn",
14
14
  "build:lib:cjs": "tsc -p src --outDir lib/cjs",
15
- "build:site": "rm -rf ./dist && rm -rf ./public && yarn build:docs && parcel build site/index.html -d dist --public-url '.'",
15
+ "build:prepare": "rm -rf ./dist && mkdir dist && cp site/index.html dist",
16
+ "build:site": "yarn build:prepare && yarn build:docs && yarn tsc:site && yarn build:site:esbuild",
17
+ "tsc:site": "tsc --noEmit -p site/tsconfig.json",
18
+ "build:site:esbuild": "esbuild --bundle site/index.tsx --outdir=dist --target=esnext --loader:.woff2=file --loader:.woff=file --minify --sourcemap",
16
19
  "commitlint": "commitlint",
17
20
  "lint": "yarn lint:js",
18
21
  "lint:js": "eslint src/**/*.tsx",
19
- "lint:fix-icons": "eslint --fix src/Old/Icon/tsx/**",
20
22
  "semantic-release": "semantic-release",
21
23
  "serve": "superstatic ./dist --port 4001 -c superstatic.json",
22
- "start": "rm -rf ./dist && concurrently \"yarn start:docs\" \"yarn start:site\" \"yarn start:icons\"",
24
+ "start": "yarn build:prepare && concurrently \"yarn start:docs\" \"yarn start:esbuild\" \"yarn serve\"",
25
+ "start:esbuild": "esbuild --bundle site/index.tsx --watch --outdir=dist --target=esnext --loader:.woff2=file --loader:.woff=file",
23
26
  "start:docs": "ts-node ./scripts/build-docs-watch",
24
- "start:site": "parcel serve site/index.html --port 4001 -d dist --no-cache",
25
- "start:icons": "chokidar src/Old/Icon/svg/** -c \"yarn svgr {path} && yarn lint:fix-icons\"",
26
27
  "test": "jest ./src",
27
28
  "storybook": "start-storybook -p 6006",
28
29
  "build-storybook": "build-storybook"
@@ -97,10 +98,10 @@
97
98
  "babel-eslint": "^10.0.1",
98
99
  "babel-loader": "^8.2.5",
99
100
  "babel-plugin-polyfill-corejs2": "^0.3.1",
100
- "chokidar-cli": "^3.0.0",
101
101
  "concurrently": "^7.2.1",
102
102
  "enzyme": "^3.11.0",
103
103
  "enzyme-to-json": "^3.6.2",
104
+ "esbuild": "^0.14.43",
104
105
  "eslint": "^8.16.0",
105
106
  "eslint-plugin-import": "^2.26.0",
106
107
  "eslint-plugin-jest": "^26.4.5",
@@ -119,7 +120,6 @@
119
120
  "lodash.sample": "^4.2.1",
120
121
  "lodash.shuffle": "^4.2.0",
121
122
  "node-watch": "^0.7.3",
122
- "parcel-bundler": "^1.12.0",
123
123
  "prettier": "^2.6.2",
124
124
  "prismjs": "^1.28.0",
125
125
  "react": "^17.0.2",
@@ -0,0 +1,13 @@
1
+ import { ComponentStory, ComponentMeta } from '@storybook/react';
2
+ import Badge from './Badge';
3
+
4
+ export default {
5
+ title: 'Components/Badge',
6
+ component: Badge,
7
+ } as ComponentMeta<typeof Badge>;
8
+
9
+ export const WithProps: ComponentStory<typeof Badge> = (props) => <Badge {...props} />;
10
+ WithProps.args = {
11
+ children: 'Coming soon',
12
+ ...Badge.defaultProps,
13
+ };
@@ -0,0 +1,15 @@
1
+ const BadgeTheme = {
2
+ baseStyle: {
3
+ display: 'inline-block',
4
+ paddingX: '8',
5
+ paddingY: '3',
6
+ fontSize: '1',
7
+ lineHeight: '1',
8
+ fontWeight: 'bold',
9
+ textTransform: 'uppercase',
10
+ borderRadius: '4',
11
+ cursor: 'default',
12
+ },
13
+ };
14
+
15
+ export default BadgeTheme;
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+ import { Badge as ChakraBadge, BadgeProps as ChakraBadgeProps } from '@chakra-ui/react';
3
+
4
+ export type BadgeProps = ChakraBadgeProps;
5
+
6
+ /**
7
+ * Badges are used to highlight an item's status for quick recognition.
8
+ */
9
+ const Badge = (props: BadgeProps) => {
10
+ return <ChakraBadge {...props} />;
11
+ };
12
+
13
+ Badge.defaultProps = {
14
+ color: 'neutral.100',
15
+ backgroundColor: 'purple.40',
16
+ } as BadgeProps;
17
+
18
+ export default Badge;
@@ -2,7 +2,6 @@ import * as React from 'react';
2
2
  import { TypeIconName } from '../Icon/tsx';
3
3
  import Flex, { Props as FlexProps } from '../Flex/Flex';
4
4
  import Hamburger from '../Hamburger/Hamburger';
5
- import Badge from '../Badge/Badge';
6
5
  import Icon from '../Icon/Icon';
7
6
  import Link from '../Link/Link';
8
7
  import Image from '../Image/Image';
@@ -83,14 +82,6 @@ const AddonBeam: React.FunctionComponent<Props> = (props: Props) => {
83
82
  by Bitrise
84
83
  </Text>
85
84
  </Flex>
86
-
87
- {isBeta && (
88
- <Flex>
89
- <Badge backgroundColor="yellow.80" textColor="purple.10">
90
- BETA
91
- </Badge>
92
- </Flex>
93
- )}
94
85
  </Flex>
95
86
 
96
87
  {!isInResponsiveView && appName && (
package/src/index.ts CHANGED
@@ -56,3 +56,6 @@ export { default as TabPanels } from './Components/Tabs/TabPanels';
56
56
 
57
57
  export type { TabPanelProps } from './Components/Tabs/TabPanel';
58
58
  export { default as TabPanel } from './Components/Tabs/TabPanel';
59
+
60
+ export type { BadgeProps } from './Components/Badge/Badge';
61
+ export { default as Badge } from './Components/Badge/Badge';
package/src/old.ts CHANGED
@@ -37,9 +37,6 @@ export { default as AppLayoutSidebar } from './Old/AppLayout/AppLayoutSidebar';
37
37
  export type { Props as AvatarProps } from './Old/Avatar/Avatar';
38
38
  export { default as Avatar } from './Old/Avatar/Avatar';
39
39
 
40
- export type { Props as BadgeProps } from './Old/Badge/Badge';
41
- export { default as Badge } from './Old/Badge/Badge';
42
-
43
40
  export type { Props as BaseProps } from './Old/Base/Base';
44
41
  export type { TypeBorderRadius } from './Old/Base/Base';
45
42
  export type { TypeColors } from './Old/Base/Base';
package/src/theme.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import Badge from './Components/Badge/Badge.theme';
1
2
  import Button from './Components/Button/Button.theme';
2
3
  import Card from './Components/Card/Card.theme';
3
4
  import ColorButton from './Components/ColorButton/ColorButton.theme';
@@ -47,6 +48,7 @@ const theme = {
47
48
  },
48
49
  },
49
50
  components: {
51
+ Badge,
50
52
  Button,
51
53
  Card,
52
54
  ColorButton,