1
1
import { getTheme , setTheme } from '@ui5/webcomponents-base/dist/config/Theme.js' ;
2
+ import { FlexBox , FlexBoxDirection , Label , Option , Panel , Select , Text , ThemeProvider } from '@ui5/webcomponents-react' ;
3
+ import { ThemingParameters } from '@ui5/webcomponents-react-base' ;
2
4
import { useEffect , useReducer , useState } from 'react' ;
3
5
import type { CSSProperties } from 'react' ;
4
6
import { MAPPED_THEMES } from '../../.storybook/utils' ;
5
- import { FlexBox , FlexBoxDirection , Label , Option , Panel , Select , Text , ThemeProvider } from '@ui5/webcomponents-react' ;
6
- import { ThemingParameters } from '@ui5/webcomponents-react-base' ;
7
7
8
8
const containerStyles = {
9
9
display : 'grid' ,
@@ -14,6 +14,7 @@ const containerStyles = {
14
14
15
15
const FONTS = [ ] ;
16
16
const COLORS = [ ] ;
17
+ const SPACING = [ ] ;
17
18
const OTHERS = Object . entries ( ThemingParameters ) . filter ( ( [ key , value ] ) => {
18
19
if ( key . includes ( 'Font' ) ) {
19
20
if ( key . includes ( 'FontUrl' ) ) {
@@ -27,6 +28,16 @@ const OTHERS = Object.entries(ThemingParameters).filter(([key, value]) => {
27
28
COLORS . push ( [ key , value ] ) ;
28
29
return false ;
29
30
}
31
+ if (
32
+ key . includes ( 'Space' ) ||
33
+ key . includes ( 'Margin' ) ||
34
+ key . includes ( 'Padding' ) ||
35
+ key . includes ( 'Gap' ) ||
36
+ key . includes ( 'Breakpoint' )
37
+ ) {
38
+ SPACING . push ( [ key , value ] ) ;
39
+ return false ;
40
+ }
30
41
return true ;
31
42
} ) ;
32
43
@@ -37,7 +48,7 @@ const getStyleFonts = (val) => {
37
48
} else if ( val . includes ( 'Size' ) ) {
38
49
style . fontSize = val ;
39
50
} else if ( val . includes ( 'Weight' ) ) {
40
- style . fontWeight ;
51
+ style . fontWeight = val ;
41
52
}
42
53
return style ;
43
54
} ;
@@ -161,6 +172,13 @@ export const ThemeableCSSVars = () => {
161
172
} ) }
162
173
</ div >
163
174
</ Panel >
175
+ < Panel headerText = "Spacing" collapsed >
176
+ < div style = { containerStyles } >
177
+ { SPACING . map ( ( [ key , value ] ) => {
178
+ return < Variables key = { key } varKey = { key } value = { value } theme = { currentTheme } /> ;
179
+ } ) }
180
+ </ div >
181
+ </ Panel >
164
182
< Panel headerText = "Others" collapsed >
165
183
< div style = { containerStyles } >
166
184
{ OTHERS . map ( ( [ key , value ] ) => {
0 commit comments