@@ -14,12 +14,51 @@ import { ColorSelector } from "./ColorSelector";
14
14
import { useTranslation } from "react-i18next" ;
15
15
import { Playground } from "./Playground" ;
16
16
import { ThemeConfig } from "../ConfiguratorStatusContext" ;
17
+ import { useState } from "react" ;
17
18
18
19
type Props = {
19
20
tokens : ThemeConfig [ "tokens" ] [ "brandColor" ] ;
20
21
onChange : ( value : ThemeConfig [ "tokens" ] [ "brandColor" ] ) => void ;
21
22
} ;
22
23
24
+ function BrandTokensPlayground ( ) {
25
+ const [ slider , setSlider ] = useState ( 50 ) ;
26
+ const { t } = useTranslation ( ) ;
27
+ return (
28
+ < Playground >
29
+ < Stack space = { 40 } >
30
+ < Stack space = { 12 } >
31
+ < Body size = "medium" color = "secondary" >
32
+ { t ( "Component.decorativeDivider" ) }
33
+ </ Body >
34
+ < DecorativeDivider />
35
+ </ Stack >
36
+ < Stack space = { 12 } >
37
+ < Body size = "medium" color = "secondary" >
38
+ { t ( "Component.areaLoader" ) }
39
+ </ Body >
40
+ < Box position = "relative" style = { { height : 240 } } >
41
+ < AreaLoader />
42
+ </ Box >
43
+ </ Stack >
44
+ < Stack space = { 12 } >
45
+ < Body size = "medium" color = "secondary" >
46
+ { t ( "Component.sliderField" ) }
47
+ </ Body >
48
+ < SliderField
49
+ type = "single"
50
+ label = { unsafeLocalizedString ( "" ) }
51
+ value = { slider }
52
+ minValue = { 0 }
53
+ maxValue = { 100 }
54
+ onChange = { setSlider }
55
+ />
56
+ </ Stack >
57
+ </ Stack >
58
+ </ Playground >
59
+ ) ;
60
+ }
61
+
23
62
export function BrandTokens ( props : Props ) {
24
63
const { t } = useTranslation ( ) ;
25
64
@@ -56,37 +95,7 @@ export function BrandTokens(props: Props) {
56
95
/>
57
96
</ Stack >
58
97
</ Column >
59
- < Playground >
60
- < Stack space = { 40 } >
61
- < Stack space = { 12 } >
62
- < Body size = "medium" color = "secondary" >
63
- { t ( "Component.decorativeDivider" ) }
64
- </ Body >
65
- < DecorativeDivider />
66
- </ Stack >
67
- < Stack space = { 12 } >
68
- < Body size = "medium" color = "secondary" >
69
- { t ( "Component.areaLoader" ) }
70
- </ Body >
71
- < Box position = "relative" style = { { height : 240 } } >
72
- < AreaLoader />
73
- </ Box >
74
- </ Stack >
75
- < Stack space = { 12 } >
76
- < Body size = "medium" color = "secondary" >
77
- { t ( "Component.sliderField" ) }
78
- </ Body >
79
- < SliderField
80
- type = "single"
81
- label = { unsafeLocalizedString ( "" ) }
82
- value = { 50 }
83
- minValue = { 0 }
84
- maxValue = { 100 }
85
- onChange = { ( ) => { } }
86
- />
87
- </ Stack >
88
- </ Stack >
89
- </ Playground >
98
+ < BrandTokensPlayground />
90
99
</ Columns >
91
100
</ Stack >
92
101
) ;
0 commit comments