@@ -5,68 +5,56 @@ import customCssProps from '../internal/generated/custom-css-properties';
55import { TabsProps } from './interfaces' ;
66
77export function getTabStyles ( style : TabsProps [ 'style' ] ) {
8- if ( SYSTEM !== 'core' || ! style ?. tabs ) {
8+ if ( SYSTEM !== 'core' ) {
99 return undefined ;
1010 }
1111
1212 return {
13- borderRadius : style . tabs . borderRadius ,
14- borderWidth : style . tabs . borderWidth ,
15- fontSize : style . tabs . fontSize ,
16- fontWeight : style . tabs . fontWeight ,
17- paddingBlock : style . tabs . paddingBlock ,
18- paddingInline : style . tabs . paddingInline ,
19- ...( style . tabs . backgroundColor && {
20- [ customCssProps . styleBackgroundActive ] : style . tabs . backgroundColor . active ,
21- [ customCssProps . styleBackgroundDefault ] : style . tabs . backgroundColor . default ,
22- [ customCssProps . styleBackgroundDisabled ] : style . tabs . backgroundColor . disabled ,
23- [ customCssProps . styleBackgroundHover ] : style . tabs . backgroundColor . hover ,
24- } ) ,
25- ...( style . tabs . borderColor && {
26- [ customCssProps . styleBorderColorActive ] : style . tabs . borderColor . active ,
27- [ customCssProps . styleBorderColorDefault ] : style . tabs . borderColor . default ,
28- [ customCssProps . styleBorderColorDisabled ] : style . tabs . borderColor . disabled ,
29- [ customCssProps . styleBorderColorHover ] : style . tabs . borderColor . hover ,
30- } ) ,
31- ...( style . tabs . color && {
32- [ customCssProps . styleColorActive ] : style . tabs . color . active ,
33- [ customCssProps . styleColorDefault ] : style . tabs . color . default ,
34- [ customCssProps . styleColorDisabled ] : style . tabs . color . disabled ,
35- [ customCssProps . styleColorHover ] : style . tabs . color . hover ,
36- } ) ,
37- ...( style . tabs . focusRing && {
38- [ customCssProps . styleFocusRingBorderColor ] : style . tabs . focusRing . borderColor ,
39- [ customCssProps . styleFocusRingBorderRadius ] : style . tabs . focusRing . borderRadius ,
40- [ customCssProps . styleFocusRingBorderWidth ] : style . tabs . focusRing . borderWidth ,
41- } ) ,
13+ borderRadius : style ?. tabs ?. borderRadius ,
14+ borderWidth : style ?. tabs ?. borderWidth ,
15+ fontSize : style ?. tabs ?. fontSize ,
16+ fontWeight : style ?. tabs ?. fontWeight ,
17+ paddingBlock : style ?. tabs ?. paddingBlock ,
18+ paddingInline : style ?. tabs ?. paddingInline ,
19+ [ customCssProps . styleBackgroundActive ] : style ?. tabs ?. backgroundColor ?. active ,
20+ [ customCssProps . styleBackgroundDefault ] : style ?. tabs ?. backgroundColor ?. default ,
21+ [ customCssProps . styleBackgroundDisabled ] : style ?. tabs ?. backgroundColor ?. disabled ,
22+ [ customCssProps . styleBackgroundHover ] : style ?. tabs ?. backgroundColor ?. hover ,
23+ [ customCssProps . styleBorderColorActive ] : style ?. tabs ?. borderColor ?. active ,
24+ [ customCssProps . styleBorderColorDefault ] : style ?. tabs ?. borderColor ?. default ,
25+ [ customCssProps . styleBorderColorDisabled ] : style ?. tabs ?. borderColor ?. disabled ,
26+ [ customCssProps . styleBorderColorHover ] : style ?. tabs ?. borderColor ?. hover ,
27+ [ customCssProps . styleColorActive ] : style ?. tabs ?. color ?. active ,
28+ [ customCssProps . styleColorDefault ] : style ?. tabs ?. color ?. default ,
29+ [ customCssProps . styleColorDisabled ] : style ?. tabs ?. color ?. disabled ,
30+ [ customCssProps . styleColorHover ] : style ?. tabs ?. color ?. hover ,
31+ [ customCssProps . styleFocusRingBorderColor ] : style ?. tabs ?. focusRing ?. borderColor ,
32+ [ customCssProps . styleFocusRingBorderRadius ] : style ?. tabs ?. focusRing ?. borderRadius ,
33+ [ customCssProps . styleFocusRingBorderWidth ] : style ?. tabs ?. focusRing ?. borderWidth ,
4234 } ;
4335}
4436
4537export function getTabContainerStyles ( style : TabsProps [ 'style' ] ) {
46- if ( SYSTEM !== 'core' || ( ! style ?. underline && ! style ?. divider ) ) {
38+ if ( SYSTEM !== 'core' ) {
4739 return undefined ;
4840 }
4941
5042 return {
51- ...( style . underline && {
52- [ customCssProps . styleTabsUnderlineColor ] : style . underline . color ,
53- [ customCssProps . styleTabsUnderlineWidth ] : style . underline . width ,
54- [ customCssProps . styleTabsUnderlineBorderRadius ] : style . underline . borderRadius ,
55- } ) ,
56- ...( style . divider && {
57- [ customCssProps . styleTabsDividerColor ] : style . divider . color ,
58- [ customCssProps . styleTabsDividerWidth ] : style . divider . width ,
59- } ) ,
43+ [ customCssProps . styleTabsUnderlineColor ] : style ?. underline ?. color ,
44+ [ customCssProps . styleTabsUnderlineWidth ] : style ?. underline ?. width ,
45+ [ customCssProps . styleTabsUnderlineBorderRadius ] : style ?. underline ?. borderRadius ,
46+ [ customCssProps . styleTabsDividerColor ] : style ?. divider ?. color ,
47+ [ customCssProps . styleTabsDividerWidth ] : style ?. divider ?. width ,
6048 } ;
6149}
6250
6351export function getTabHeaderStyles ( style : TabsProps [ 'style' ] ) {
64- if ( SYSTEM !== 'core' || ! style ?. headerDivider ) {
52+ if ( SYSTEM !== 'core' ) {
6553 return undefined ;
6654 }
6755
6856 return {
69- [ customCssProps . styleTabsHeaderDividerColor ] : style . headerDivider . color ,
70- [ customCssProps . styleTabsHeaderDividerWidth ] : style . headerDivider . width ,
57+ [ customCssProps . styleTabsHeaderDividerColor ] : style ? .headerDivider ? .color ,
58+ [ customCssProps . styleTabsHeaderDividerWidth ] : style ? .headerDivider ? .width ,
7159 } ;
7260}
0 commit comments