11import { 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' ;
24import { useEffect , useReducer , useState } from 'react' ;
35import type { CSSProperties } from 'react' ;
46import { 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' ;
77
88const containerStyles = {
99 display : 'grid' ,
@@ -14,6 +14,7 @@ const containerStyles = {
1414
1515const FONTS = [ ] ;
1616const COLORS = [ ] ;
17+ const SPACING = [ ] ;
1718const OTHERS = Object . entries ( ThemingParameters ) . filter ( ( [ key , value ] ) => {
1819 if ( key . includes ( 'Font' ) ) {
1920 if ( key . includes ( 'FontUrl' ) ) {
@@ -27,6 +28,16 @@ const OTHERS = Object.entries(ThemingParameters).filter(([key, value]) => {
2728 COLORS . push ( [ key , value ] ) ;
2829 return false ;
2930 }
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+ }
3041 return true ;
3142} ) ;
3243
@@ -37,7 +48,7 @@ const getStyleFonts = (val) => {
3748 } else if ( val . includes ( 'Size' ) ) {
3849 style . fontSize = val ;
3950 } else if ( val . includes ( 'Weight' ) ) {
40- style . fontWeight ;
51+ style . fontWeight = val ;
4152 }
4253 return style ;
4354} ;
@@ -161,6 +172,13 @@ export const ThemeableCSSVars = () => {
161172 } ) }
162173 </ div >
163174 </ 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 >
164182 < Panel headerText = "Others" collapsed >
165183 < div style = { containerStyles } >
166184 { OTHERS . map ( ( [ key , value ] ) => {
0 commit comments