@bitrise/bitkit 9.36.0-alpha-avatar.1 → 9.36.2

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/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # @bitrise/bitkit
2
2
 
3
3
  Library for React UI components and design patterns.
4
+
5
+ Based on [Chakra UI](https://chakra-ui.com/).
4
6
  ___
5
7
 
6
8
 
@@ -14,46 +16,29 @@ yarn install
14
16
 
15
17
  ### Technology
16
18
 
19
+ - [Chakra UI](https://chakra-ui.com/)
17
20
  - [Typescript](https://www.typescriptlang.org/)
18
- - [Parcel](https://parceljs.org/) (bundler and dev servers)
19
- - [React](https://reactjs.org/) (with [React Router](https://reacttraining.com/react-router/) for routing links)
20
- - [PostCSS](https://postcss.org/) (with [postcss-preset-env](https://preset-env.cssdb.org/) for a little power)
21
+ - [React](https://reactjs.org/)
21
22
  - [Jest](https://jestjs.io/) (for unit testing)
22
23
 
23
- ### Managing icons
24
-
25
- If you would like to add a new or edit an existing icon:
26
- 1. Export the icon from [Figma](https://www.figma.com/file/grik9mTaJ5DfhydhWhXdP5/Bitkit-Foundations?node-id=213%3A82) as an SVG. Make sure that the exported file has the following viewBox: `0 0 24 24`, otherwise the icon can make smaller or bigger compared to the existing ones.
27
- 2. Rename the file using this convention: `icons-{iconName}.svg` (eg.: `icons-crown.svg`)
28
- 3. Add the file under the `./src/components/Icon/svg` folder.
29
- 4. If you are not running `yarn start`, run the `yarn build:icons` script to generate the React component from the SVG. You should commit both the `.svg` and the generated `.tsx` files.
30
- 5. Make sure to check the new/update icon on the Icons page.
31
24
  ### Scripts
32
25
 
33
- #### `$ yarn build`
34
-
35
- Builds the library and styleguide assets
26
+ #### `$ yarn storybook`
36
27
 
37
- #### `$ yarn build:icons`
28
+ Runs Storybook server
38
29
 
39
- Uses **[@svgr/cli](https://github.com/smooth-code/svgr)** to generate React components and Typescript definitions inside `./src/components/Icon/tsx` from the SVG files inside `./src/components/Icon/svg`.
40
-
41
- #### `$ yarn clean`
30
+ #### `$ yarn start`
42
31
 
43
- Cleans up the build directories
32
+ Runs `yarn storybook`
44
33
 
45
34
  #### `$ yarn lint`
46
35
 
47
36
  Runs Javascript linting
48
37
 
49
- #### `$ yarn serve`
50
-
51
- Serves up the static files built for the style guide
52
-
53
- #### `$ yarn start`
54
-
55
- Runs the developlement server for the style guide
56
-
57
38
  #### `$ yarn test`
58
39
 
59
40
  Runs the unit tests for the library components
41
+
42
+ ### Contributing
43
+
44
+ Check [CONTRIBUTING.md](CONTRIBUTING.md)
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.36.0-alpha-avatar.1",
4
+ "version": "9.36.2",
5
5
  "repository": "git@github.com:bitrise-io/bitkit.git",
6
6
  "main": "src/index.ts",
7
7
  "license": "UNLICENSED",
@@ -49,13 +49,13 @@ const getSize = (size: AvatarSizes) => {
49
49
  };
50
50
 
51
51
  const AvatarTheme: ComponentStyleConfig = {
52
- baseStyle: ({ name, size }) => {
52
+ baseStyle: ({ name, size, src }) => {
53
53
  const str = name.toUpperCase();
54
54
  const seed = str.charCodeAt(0) + str.charCodeAt(str.length - 1);
55
55
 
56
56
  return {
57
57
  container: {
58
- backgroundColor: BACKGROUND_COLORS[seed % BACKGROUND_COLORS.length],
58
+ backgroundColor: src ? 'transparent' : BACKGROUND_COLORS[seed % BACKGROUND_COLORS.length],
59
59
  color: 'neutral.100',
60
60
  ...getSize(size),
61
61
  },
@@ -42,6 +42,7 @@ const Dialog = ({ children, dataTestid, scrollBehavior, state, size, title, ...r
42
42
  onClose={state.onClose}
43
43
  scrollBehavior={scrollBehavior}
44
44
  size={dialogSize}
45
+ trapFocus={!process.env.IS_STORYBOOK}
45
46
  >
46
47
  <ModalOverlay />
47
48
  <ModalContent data-testid={dataTestid} {...rest}>
@@ -2,12 +2,13 @@ import type { SystemStyleObject } from '@chakra-ui/theme-tools';
2
2
 
3
3
  const PopoverTheme: SystemStyleObject = {
4
4
  baseStyle: {
5
+ popper: {
6
+ zIndex: 'popover',
7
+ },
5
8
  content: {
6
9
  backgroundColor: 'neutral.100',
7
10
  borderRadius: 8,
8
11
  boxShadow: 'large',
9
- py: 24,
10
- px: 32,
11
12
  },
12
13
  },
13
14
  };
@@ -1,6 +1,6 @@
1
1
  import { FC } from 'react';
2
2
  import { PopoverTrigger as ChakraPopoverTrigger } from '@chakra-ui/react';
3
3
 
4
- const PopoverTigger: FC = (props) => <ChakraPopoverTrigger {...props} />;
4
+ const PopoverTrigger: FC = (props) => <ChakraPopoverTrigger {...props} />;
5
5
 
6
- export default PopoverTigger;
6
+ export default PopoverTrigger;
@@ -7,6 +7,7 @@ const zIndices = {
7
7
  fullDialog: 1200,
8
8
  dialogOverlay: 1299,
9
9
  dialog: 1300,
10
+ popover: 1400,
10
11
  };
11
12
 
12
13
  export default zIndices;