@@ -3,9 +3,10 @@ import { BentoSprinkles, bentoSprinkles, Box, Inline, Stack } from "../internal"
3
3
import { container , dot , text } from "./AreaLoader.css" ;
4
4
import { Body , LocalizedString } from ".." ;
5
5
import { AreaLoaderConfig } from "./Config" ;
6
+ import { BodyProps } from "../Typography/Body/Body" ;
6
7
7
- function visibilityAreaColorToBackground (
8
- color : AreaLoaderConfig [ "visibilityAreaColor " ]
8
+ function readabilityAreaColorToBackground (
9
+ color : AreaLoaderConfig [ "readabilityAreaColor " ]
9
10
) : BentoSprinkles [ "background" ] {
10
11
switch ( color ) {
11
12
case "primary" :
@@ -19,6 +20,15 @@ function visibilityAreaColorToBackground(
19
20
}
20
21
}
21
22
23
+ function messageColorToBodyColor ( color : AreaLoaderConfig [ "messageColor" ] ) : BodyProps [ "color" ] {
24
+ switch ( color ) {
25
+ case "primary" :
26
+ return "default" ;
27
+ case "primary-inverse" :
28
+ return "primaryInverse" ;
29
+ }
30
+ }
31
+
22
32
type Props = {
23
33
message ?: LocalizedString ;
24
34
} ;
@@ -46,14 +56,16 @@ export function createAreaLoader(config: AreaLoaderConfig) {
46
56
className = { clsx (
47
57
container ,
48
58
bentoSprinkles ( {
49
- background : config . overlay === "dark" ? "backgroundDarkScrim" : "backgroundLightScrim" ,
59
+ background :
60
+ config . scrimColor === "dark" ? "backgroundDarkScrim" : "backgroundLightScrim" ,
50
61
} )
51
62
) }
52
63
>
53
64
< Box
54
65
padding = { 80 }
55
66
className = { bentoSprinkles ( {
56
- background : visibilityAreaColorToBackground ( config . visibilityAreaColor ) ,
67
+ background : readabilityAreaColorToBackground ( config . readabilityAreaColor ) ,
68
+ borderRadius : config . readabilityAreaBorderRadius ,
57
69
} ) }
58
70
>
59
71
< Stack space = { 32 } >
@@ -70,7 +82,12 @@ export function createAreaLoader(config: AreaLoaderConfig) {
70
82
</ Inline >
71
83
{ message && (
72
84
< Box className = { text } >
73
- < Body size = "medium" > { message } </ Body >
85
+ < Body
86
+ size = { config . messageSize }
87
+ color = { messageColorToBodyColor ( config . messageColor ) }
88
+ >
89
+ { message }
90
+ </ Body >
74
91
</ Box >
75
92
) }
76
93
</ Stack >
0 commit comments