@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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bitrise/bitkit",
3
3
  "description": "Bitrise React component library",
4
- "version": "13.149.0",
4
+ "version": "13.150.0",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+ssh://git@github.com/bitrise-io/bitkit.git"
@@ -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
- export interface LabeledDataProps extends BoxProps {
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
- <Box as="dd" display="flex" alignItems="center" gap="4" color="text/body" textStyle={`comp/data/${size}`}>
104
- {data}
105
- {trendIconName && trendValue && <Icon color={trendIconColor} name={trendIconName} size={trendIconSize} />}
106
- </Box>
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 && (