@bitrise/bitkit 13.149.0 → 13.150.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
|
@@ -6,9 +6,9 @@ import Label from '../Label/Label';
|
|
|
6
6
|
import Skeleton from '../Skeleton/Skeleton';
|
|
7
7
|
import SkeletonBox from '../Skeleton/SkeletonBox';
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
type DataOrPlaceholder = { placeholder: string; data?: never } | { data: string; placeholder?: never };
|
|
10
|
+
export type LabeledDataProps = BoxProps & {
|
|
10
11
|
as?: 'div' | 'dl';
|
|
11
|
-
data: string;
|
|
12
12
|
isLoading?: boolean;
|
|
13
13
|
label: string;
|
|
14
14
|
secondaryLabel?: string;
|
|
@@ -18,11 +18,12 @@ export interface LabeledDataProps extends BoxProps {
|
|
|
18
18
|
trend?: 'positive' | 'negative' | 'neutral';
|
|
19
19
|
trendColorScheme?: 'red' | 'green' | 'grey';
|
|
20
20
|
trendValue?: string;
|
|
21
|
-
}
|
|
21
|
+
} & DataOrPlaceholder;
|
|
22
22
|
|
|
23
23
|
const LabeledData = ({
|
|
24
24
|
as = 'div',
|
|
25
25
|
data,
|
|
26
|
+
placeholder,
|
|
26
27
|
isLoading = false,
|
|
27
28
|
label,
|
|
28
29
|
secondaryLabel,
|
|
@@ -100,10 +101,24 @@ const LabeledData = ({
|
|
|
100
101
|
</Skeleton>
|
|
101
102
|
) : (
|
|
102
103
|
<>
|
|
103
|
-
|
|
104
|
-
{data}
|
|
105
|
-
|
|
106
|
-
|
|
104
|
+
{data && (
|
|
105
|
+
<Box as="dd" display="flex" alignItems="center" gap="4" color="text/body" textStyle={`comp/data/${size}`}>
|
|
106
|
+
{data}
|
|
107
|
+
{trendIconName && trendValue && <Icon color={trendIconColor} name={trendIconName} size={trendIconSize} />}
|
|
108
|
+
</Box>
|
|
109
|
+
)}
|
|
110
|
+
{placeholder && (
|
|
111
|
+
<Box
|
|
112
|
+
as="dd"
|
|
113
|
+
display="flex"
|
|
114
|
+
alignItems="center"
|
|
115
|
+
gap="4"
|
|
116
|
+
color="text/tertiary"
|
|
117
|
+
textStyle={`comp/data/${size}`}
|
|
118
|
+
>
|
|
119
|
+
{placeholder}
|
|
120
|
+
</Box>
|
|
121
|
+
)}
|
|
107
122
|
{((trendSign && trendValue) || !!secondaryLabel) && (
|
|
108
123
|
<Box as="dd" display="flex" gap="4" color={trendColor} textStyle="body/md/regular">
|
|
109
124
|
{trendSign && trendValue && (
|