@bitrise/bitkit 13.196.0 → 13.198.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
|
@@ -16,6 +16,7 @@ export type LabeledDataProps = BoxProps & {
|
|
|
16
16
|
secondaryLabel?: ReactNode;
|
|
17
17
|
size?: 'sm' | 'md' | 'lg';
|
|
18
18
|
skeleton?: ReactNode;
|
|
19
|
+
shouldShowTrendSign?: boolean;
|
|
19
20
|
tooltip?: Omit<TooltipProps, 'children'>;
|
|
20
21
|
trend?: 'positive' | 'negative' | 'neutral';
|
|
21
22
|
trendColorScheme?: 'red' | 'green' | 'grey';
|
|
@@ -32,6 +33,7 @@ const LabeledData = ({
|
|
|
32
33
|
secondaryLabel,
|
|
33
34
|
size = 'sm',
|
|
34
35
|
skeleton,
|
|
36
|
+
shouldShowTrendSign = true,
|
|
35
37
|
tooltip,
|
|
36
38
|
trend,
|
|
37
39
|
trendValue,
|
|
@@ -39,8 +41,11 @@ const LabeledData = ({
|
|
|
39
41
|
...rest
|
|
40
42
|
}: LabeledDataProps): JSX.Element => {
|
|
41
43
|
const trendIconSize = size === 'sm' ? '16' : '24';
|
|
42
|
-
const trendSign = trend === 'negative' ? '-' : '+';
|
|
43
44
|
const labelColor = size === 'sm' ? 'text/primary' : 'text/secondary';
|
|
45
|
+
let trendSign;
|
|
46
|
+
if (shouldShowTrendSign) {
|
|
47
|
+
trendSign = trend === 'negative' ? '-' : '+';
|
|
48
|
+
}
|
|
44
49
|
|
|
45
50
|
let dataSkeletonHeight;
|
|
46
51
|
let dataSkeletonPaddingY;
|
|
@@ -122,9 +127,9 @@ const LabeledData = ({
|
|
|
122
127
|
{placeholder}
|
|
123
128
|
</Box>
|
|
124
129
|
)}
|
|
125
|
-
{(
|
|
130
|
+
{(trendValue || !!secondaryLabel) && (
|
|
126
131
|
<Box as="dd" display="flex" gap="4" color={trendColor} textStyle="body/md/regular">
|
|
127
|
-
{
|
|
132
|
+
{trendValue && (
|
|
128
133
|
<>
|
|
129
134
|
{trendSign}
|
|
130
135
|
{trendValue}
|
|
@@ -8,7 +8,7 @@ const schemeColors = {
|
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
const LinkTheme = {
|
|
11
|
-
baseStyle: ({ colorScheme: c }: { colorScheme?: 'purple' | 'white' | 'gray' }) => {
|
|
11
|
+
baseStyle: ({ colorScheme: c, textStyle }: { colorScheme?: 'purple' | 'white' | 'gray'; textStyle?: string }) => {
|
|
12
12
|
const { color, hover } = schemeColors[c || 'default'];
|
|
13
13
|
return {
|
|
14
14
|
_focus: {
|
|
@@ -18,7 +18,7 @@ const LinkTheme = {
|
|
|
18
18
|
color: hover,
|
|
19
19
|
},
|
|
20
20
|
color,
|
|
21
|
-
fontSize: 'inherit',
|
|
21
|
+
fontSize: textStyle ? undefined : 'inherit',
|
|
22
22
|
};
|
|
23
23
|
},
|
|
24
24
|
...TextTheme,
|