12
12
v-if =" title || $slots.title"
13
13
class =" entity-empty-state-title"
14
14
>
15
- <h1 >
15
+ <h1 :class = " emptyStateAppearance " >
16
16
<slot name =" title" >
17
17
{{ title }}
18
18
</slot >
78
78
</slot >
79
79
</div >
80
80
81
- <div class =" entity-empty-state-card-container" >
81
+ <div
82
+ v-if =" features.length"
83
+ class =" entity-empty-state-card-container"
84
+ >
82
85
<template
83
86
v-for =" (feature , idx ) in features "
84
87
:key =" feature "
@@ -118,9 +121,17 @@ import { type PropType, computed, ref, onBeforeMount } from 'vue'
118
121
import { KButton } from ' @kong/kongponents'
119
122
import { BookIcon , AddIcon } from ' @kong/icons'
120
123
import composables from ' ../../composables'
121
- import type { EmptyStateFeature } from ' src/types/entity-empty-state'
124
+ import type { EmptyStateFeature , AppearanceTypes } from ' ../../types/entity-empty-state'
125
+ import { Appearances } from ' ../../types/entity-empty-state'
122
126
123
127
const props = defineProps ({
128
+ appearance: {
129
+ type: String as PropType <AppearanceTypes >,
130
+ default : () => ' primary' ,
131
+ validator : (value : AppearanceTypes ): boolean => {
132
+ return Appearances .includes (value )
133
+ },
134
+ },
124
135
title: {
125
136
type: String ,
126
137
default: ' ' ,
@@ -163,6 +174,16 @@ const { i18n: { t } } = composables.useI18n()
163
174
const useCanCreate = ref (false )
164
175
const showCreateButton = computed ((): boolean => useCanCreate .value && !! props .actionButtonText )
165
176
177
+ const emptyStateAppearance = computed ((): AppearanceTypes | [AppearanceTypes , string ] => {
178
+ // If the appearance is invalid, output both to keep backwards compatibility
179
+ // in case some of the tests rely on the invalid appearance output
180
+ if (! Appearances .includes (props .appearance )) {
181
+ return [' primary' , props .appearance ]
182
+ }
183
+
184
+ return props .appearance
185
+ })
186
+
166
187
onBeforeMount (async () => {
167
188
// Evaluate if the user has create permissions
168
189
useCanCreate .value = await props .canCreate ()
@@ -180,7 +201,7 @@ $entity-empty-state-max-width: calc(2 * #{$entity-empty-state-feature-card-width
180
201
display : flex ;
181
202
flex-direction : column ;
182
203
font-family : $kui-font-family-text ;
183
- gap : $kui-space-110 ;
204
+ gap : $kui-space-80 ;
184
205
padding : $kui-space-130 $kui-space-0 ;
185
206
width : 100% ;
186
207
@@ -209,6 +230,10 @@ $entity-empty-state-max-width: calc(2 * #{$entity-empty-state-feature-card-width
209
230
gap : $kui-space-40 ;
210
231
line-height : $kui-line-height-60 ;
211
232
margin : $kui-space-0 ;
233
+
234
+ & .secondary {
235
+ font-size : $kui-font-size-50 ;
236
+ }
212
237
}
213
238
}
214
239
@@ -220,10 +245,14 @@ $entity-empty-state-max-width: calc(2 * #{$entity-empty-state-feature-card-width
220
245
max-width : 640px ; // limit width so the description stays readable if it is too long
221
246
222
247
p {
223
- margin : $kui-space-30 ;
248
+ margin : $kui-space-0 ;
224
249
}
225
250
}
226
251
252
+ .entity-empty-state-pricing {
253
+ margin-top : $kui-space-60 ;
254
+ }
255
+
227
256
.entity-empty-state-action {
228
257
align-items : center ;
229
258
display : flex ;
@@ -235,6 +264,7 @@ $entity-empty-state-max-width: calc(2 * #{$entity-empty-state-feature-card-width
235
264
flex-wrap : wrap ;
236
265
gap : $kui-space-60 ;
237
266
justify-content : space-around ;
267
+ margin-top : $kui-space-40 ;
238
268
/* * single column on mobile */
239
269
width : $entity-empty-state-feature-card-width ;
240
270
0 commit comments