@bitrise/bitkit 12.123.0 → 12.124.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
|
@@ -50,21 +50,29 @@ const sizes = {
|
|
|
50
50
|
};
|
|
51
51
|
|
|
52
52
|
type TagColors = NonNullable<TagProps['colorScheme']>;
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
53
|
+
type MappedColor = {
|
|
54
|
+
color: 'interactive' | 'warning' | 'critical' | 'success' | 'info' | 'neutral';
|
|
55
|
+
isFilled: boolean;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
const schemeMap: Record<TagColors, MappedColor> = {
|
|
59
|
+
blue: { color: 'info', isFilled: false },
|
|
60
|
+
green: { color: 'success', isFilled: false },
|
|
61
|
+
neutral: { color: 'neutral', isFilled: false },
|
|
62
|
+
purple: { color: 'interactive', isFilled: false },
|
|
63
|
+
purpleFilled: { color: 'interactive', isFilled: true },
|
|
64
|
+
red: { color: 'critical', isFilled: false },
|
|
65
|
+
yellow: { color: 'warning', isFilled: false },
|
|
60
66
|
};
|
|
61
67
|
|
|
62
68
|
const baseStyle = definePartsStyle(({ colorScheme }) => {
|
|
63
|
-
const color = schemeMap[colorScheme as TagColors];
|
|
69
|
+
const { color, isFilled } = schemeMap[colorScheme as TagColors];
|
|
70
|
+
const normalTextColor = color === 'neutral' ? 'text.primary' : `sys.${color}.strong`;
|
|
64
71
|
const scheme = {
|
|
65
|
-
backgroundColor: `sys.${color}
|
|
66
|
-
borderColor: `sys.${color}
|
|
67
|
-
color:
|
|
72
|
+
backgroundColor: `sys.${color}.${isFilled ? 'bold' : 'subtle'}`,
|
|
73
|
+
borderColor: `sys.${color}.${isFilled ? 'bold' : 'muted'}`,
|
|
74
|
+
color: isFilled ? 'text.on-color' : normalTextColor,
|
|
75
|
+
fontWeight: isFilled ? 'semibold' : 'normal',
|
|
68
76
|
};
|
|
69
77
|
|
|
70
78
|
return {
|
|
@@ -76,7 +84,7 @@ const baseStyle = definePartsStyle(({ colorScheme }) => {
|
|
|
76
84
|
boxShadow: '0 0 0 1px var(--colors-purple-70) inset',
|
|
77
85
|
},
|
|
78
86
|
_hover: {
|
|
79
|
-
backgroundColor: `sys.${color}
|
|
87
|
+
backgroundColor: `sys.${color}.${isFilled ? 'highlight' : 'moderate'}`,
|
|
80
88
|
},
|
|
81
89
|
borderRadius: rem(2),
|
|
82
90
|
marginInlineStart: '4',
|
|
@@ -86,15 +94,15 @@ const baseStyle = definePartsStyle(({ colorScheme }) => {
|
|
|
86
94
|
borderRadius: '4',
|
|
87
95
|
...scheme,
|
|
88
96
|
_disabled: {
|
|
89
|
-
backgroundColor:
|
|
90
|
-
borderColor:
|
|
91
|
-
color: '
|
|
97
|
+
backgroundColor: `sys.neutral.${isFilled ? 'muted' : 'minimal'}`,
|
|
98
|
+
borderColor: `sys.neutral.${isFilled ? 'muted' : 'moderate'}`,
|
|
99
|
+
color: isFilled ? 'text.on-color' : 'text.disabled',
|
|
92
100
|
cursor: 'not-allowed',
|
|
93
101
|
},
|
|
94
102
|
_loading: {
|
|
95
|
-
backgroundColor:
|
|
96
|
-
borderColor:
|
|
97
|
-
color: '
|
|
103
|
+
backgroundColor: `sys.neutral.${isFilled ? 'muted' : 'subtle'}`,
|
|
104
|
+
borderColor: `sys.neutral.${isFilled ? 'muted' : 'subtle'}`,
|
|
105
|
+
color: isFilled ? 'text.on-color' : 'text.disabled',
|
|
98
106
|
cursor: 'wait',
|
|
99
107
|
},
|
|
100
108
|
},
|
|
@@ -105,7 +113,7 @@ const baseStyle = definePartsStyle(({ colorScheme }) => {
|
|
|
105
113
|
display: 'inline',
|
|
106
114
|
},
|
|
107
115
|
skeleton: {
|
|
108
|
-
backgroundColor: 'neutral.
|
|
116
|
+
backgroundColor: 'sys.neutral.muted',
|
|
109
117
|
height: '8',
|
|
110
118
|
minWidth: '32',
|
|
111
119
|
},
|
|
@@ -8,7 +8,7 @@ import { TypeColors } from '../../types/bitkit';
|
|
|
8
8
|
|
|
9
9
|
export interface TagProps extends Omit<ChakraTagProps, 'colorScheme' | 'size' | 'variant'> {
|
|
10
10
|
closeButtonTooltip?: string;
|
|
11
|
-
colorScheme?: 'neutral' | 'blue' | 'green' | 'red' | 'yellow' | 'purple';
|
|
11
|
+
colorScheme?: 'neutral' | 'blue' | 'green' | 'red' | 'yellow' | 'purple' | 'purpleFilled';
|
|
12
12
|
iconColor?: TypeColors;
|
|
13
13
|
iconName?: TypeIconName;
|
|
14
14
|
isDisabled?: boolean;
|