@bitrise/bitkit 10.5.3 → 10.6.0

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": "10.5.3",
4
+ "version": "10.6.0",
5
5
  "repository": "git@github.com:bitrise-io/bitkit.git",
6
6
  "main": "src/index.ts",
7
7
  "license": "UNLICENSED",
@@ -1,5 +1,6 @@
1
1
  import { ComponentStory, ComponentMeta } from '@storybook/react';
2
2
  import { sortObjectByKey } from '../../utils/storyUtils';
3
+ import Box from '../Box/Box';
3
4
  import ColorButton from './ColorButton';
4
5
 
5
6
  export default {
@@ -13,7 +14,11 @@ export default {
13
14
  },
14
15
  } as ComponentMeta<typeof ColorButton>;
15
16
 
16
- const Template: ComponentStory<typeof ColorButton> = (props) => <ColorButton {...props} />;
17
+ const Template: ComponentStory<typeof ColorButton> = ({ colorScheme, ...props }) => (
18
+ <Box padding={16} backgroundColor={colorScheme === 'neutral' ? 'black' : undefined}>
19
+ <ColorButton colorScheme={colorScheme} {...props} />
20
+ </Box>
21
+ );
17
22
 
18
23
  export const WithProps = Template.bind({});
19
24
  WithProps.args = sortObjectByKey({
@@ -1,4 +1,6 @@
1
- const schemeColors = {
1
+ import { ColorScheme } from '../../Foundations/Colors/Colors';
2
+
3
+ const schemeColors: Record<ColorScheme, any> = {
2
4
  blue: {
3
5
  color: 'blue.40',
4
6
  _active: {
@@ -44,16 +46,25 @@ const schemeColors = {
44
46
  backgroundColor: 'purple.93',
45
47
  },
46
48
  },
49
+ neutral: {
50
+ color: 'neutral.100',
51
+ _active: {
52
+ backgroundColor: 'rgba(255, 255, 255, 0.3)',
53
+ },
54
+ _hover: {
55
+ backgroundColor: 'rgba(255, 255, 255, 0.15)',
56
+ },
57
+ },
47
58
  };
48
59
 
49
60
  const ColorButtonTheme = {
50
- baseStyle: ({ colorScheme: c }: { colorScheme?: 'blue' | 'red' | 'green' | 'yellow' | 'purple' }) => {
61
+ baseStyle: ({ colorScheme }: { colorScheme?: ColorScheme }) => {
51
62
  return {
52
63
  display: 'inline-flex',
53
64
  alignItems: 'center',
54
65
  justifyContent: 'center',
55
66
  backgroundColor: 'transparent',
56
- ...schemeColors[c || 'blue'],
67
+ ...schemeColors[colorScheme || 'blue'],
57
68
  };
58
69
  },
59
70
  };
@@ -36,7 +36,7 @@ const DialogTheme: ComponentStyleConfig = {
36
36
  body: {
37
37
  flex: 1,
38
38
  paddingX: '32',
39
- overflow: 'auto',
39
+ overflow: scrollBehavior === 'inside' ? 'auto' : undefined,
40
40
  },
41
41
  footer: {
42
42
  display: 'flex',
@@ -127,6 +127,6 @@ const colors = {
127
127
 
128
128
  export type Colors = typeof colors;
129
129
 
130
- export type ColorScheme = 'blue' | 'red' | 'green' | 'yellow' | 'purple';
130
+ export type ColorScheme = 'blue' | 'red' | 'green' | 'yellow' | 'purple' | 'neutral';
131
131
 
132
132
  export default colors;