Skip to content

Commit 2601897

Browse files
authored
refactor(ui): apply top-navigation mappings
1 parent c6b253f commit 2601897

12 files changed

+1427
-1657
lines changed

src/framework/ui/common/mapping.json

Lines changed: 79 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -2061,17 +2061,11 @@
20612061
}
20622062
}
20632063
},
2064-
"TopNavigationBar": {
2064+
"TopNavigation": {
20652065
"meta": {
20662066
"scope": "mobile",
20672067
"parameters": {
2068-
"height": {
2069-
"type": "number"
2070-
},
2071-
"paddingTop": {
2072-
"type": "number"
2073-
},
2074-
"paddingBottom": {
2068+
"paddingVertical": {
20752069
"type": "number"
20762070
},
20772071
"paddingHorizontal": {
@@ -2080,78 +2074,111 @@
20802074
"backgroundColor": {
20812075
"type": "string"
20822076
},
2083-
"textAlign": {
2084-
"type": "string"
2085-
},
2086-
"titleColor": {
2077+
"titleTextAlign": {
20872078
"type": "string"
20882079
},
20892080
"titleFontSize": {
20902081
"type": "number"
20912082
},
2083+
"titleLineHeight": {
2084+
"type": "number"
2085+
},
20922086
"titleFontWeight": {
20932087
"type": "string"
20942088
},
2095-
"subtitleColor": {
2089+
"titleColor": {
2090+
"type": "string"
2091+
},
2092+
"subtitleTextAlign": {
20962093
"type": "string"
20972094
},
20982095
"subtitleFontSize": {
20992096
"type": "number"
21002097
},
2098+
"subtitleLineHeight": {
2099+
"type": "number"
2100+
},
21012101
"subtitleFontWeight": {
21022102
"type": "string"
2103+
},
2104+
"subtitleColor": {
2105+
"type": "string"
2106+
},
2107+
"actionWidth": {
2108+
"type": "number"
2109+
},
2110+
"actionHeight": {
2111+
"type": "number"
2112+
},
2113+
"actionMarginHorizontal": {
2114+
"type": "number"
21032115
}
21042116
},
21052117
"appearances": {
21062118
"default": {
21072119
"default": true
2108-
},
2109-
"titleCentered": {
2110-
"default": false
21112120
}
21122121
},
2113-
"variantGroups": {},
2122+
"variantGroups": {
2123+
"alignment": {
2124+
"start": {
2125+
"default": true
2126+
},
2127+
"center": {
2128+
"default": false
2129+
}
2130+
}
2131+
},
21142132
"states": {}
21152133
},
21162134
"appearances": {
21172135
"default": {
21182136
"mapping": {
2119-
"height": 46,
2120-
"paddingTop": 4,
2121-
"paddingBottom": 12,
2122-
"paddingHorizontal": 16,
2123-
"backgroundColor": "blue-primary",
2124-
"titleColor": "text-primary-inverse",
2125-
"titleFontSize": 16,
2137+
"paddingVertical": 8,
2138+
"paddingHorizontal": 8,
2139+
"backgroundColor": "color-white",
2140+
"titleFontSize": 15,
2141+
"titleLineHeight": 24,
21262142
"titleFontWeight": "600",
2127-
"subtitleColor": "text-primary-inverse",
2128-
"subtitleFontSize": 12,
2143+
"titleColor": "font-primary-color",
2144+
"subtitleFontSize": 11,
2145+
"subtitleLineHeight": 16,
21292146
"subtitleFontWeight": "400",
2130-
"textAlign": "start"
2131-
}
2132-
},
2133-
"titleCentered": {
2134-
"mapping": {
2135-
"textAlign": "center"
2147+
"subtitleColor": "color-basic-600",
2148+
"actionWidth": 24,
2149+
"actionHeight": 24,
2150+
"actionMarginHorizontal": 8
2151+
},
2152+
"variantGroups": {
2153+
"alignment": {
2154+
"start": {
2155+
"titleTextAlign": "left",
2156+
"subtitleTextAlign": "left"
2157+
},
2158+
"center": {
2159+
"titleTextAlign": "center",
2160+
"subtitleTextAlign": "center"
2161+
}
2162+
}
21362163
}
21372164
}
21382165
}
21392166
},
2140-
"TopNavigationBarAction": {
2167+
"TopNavigationAction": {
21412168
"meta": {
21422169
"scope": "mobile",
21432170
"parameters": {
2144-
"width": {
2145-
"type": "number"
2146-
},
2147-
"height": {
2171+
"iconWidth": {
21482172
"type": "number"
21492173
},
2150-
"marginRight": {
2174+
"iconHeight": {
21512175
"type": "number"
21522176
},
2153-
"tintColor": {
2177+
"iconTintColor": {
21542178
"type": "string"
2179+
},
2180+
"marginHorizontal": {
2181+
"type": "number"
21552182
}
21562183
},
21572184
"appearances": {
@@ -2160,15 +2187,23 @@
21602187
}
21612188
},
21622189
"variantGroups": {},
2163-
"states": {}
2190+
"states": {
2191+
"active": {
2192+
"default": false,
2193+
"priority": 0,
2194+
"scope": "all"
2195+
}
2196+
}
21642197
},
21652198
"appearances": {
21662199
"default": {
21672200
"mapping": {
2168-
"width": 25,
2169-
"height": 25,
2170-
"marginRight": 8,
2171-
"tintColor": "white"
2201+
"iconTintColor": "font-primary-color",
2202+
"state": {
2203+
"active": {
2204+
"iconTintColor": "color-basic-900"
2205+
}
2206+
}
21722207
}
21732208
}
21742209
}

src/framework/ui/index.ts

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,15 @@ import {
4343
Modal,
4444
Props as ModalProps,
4545
} from './modal/modal.component';
46+
import {
47+
OverflowMenu as OverflowMenuComponent,
48+
Props as OverflowMenuProps,
49+
} from './overflowMenu/overflowMenu.component';
50+
import {
51+
OverflowMenuItem as OverflowMenuItemComponent,
52+
Props as OverflowMenuItemProps,
53+
OverflowMenuItemType,
54+
} from './overflowMenu/overflowMenuItem.component';
4655
import {
4756
Popover as PopoverComponent,
4857
Props as PopoverProps,
@@ -80,13 +89,13 @@ import {
8089
Props as TooltipProps,
8190
} from './tooltip/tooltip.component';
8291
import {
83-
TopNavigationBar as TopNavigationBarComponent,
92+
TopNavigation as TopNavigationComponent,
8493
Props as TopNavigationBarProps,
85-
} from './topNavigationBar/topNavigationBar.component';
94+
} from './topNavigation/topNavigation.component';
8695
import {
87-
TopNavigationBarAction as TopNavigationBarActionComponent,
96+
TopNavigationAction as TopNavigationActionComponent,
8897
Props as TopNavigationBarActionProps,
89-
} from './topNavigationBar/topNavigationBarAction.component';
98+
} from './topNavigation/topNavigationAction.component';
9099
import {
91100
ViewPager,
92101
Props as ViewPagerProps,
@@ -100,14 +109,9 @@ import {
100109
Placements as PopoverPlacements,
101110
} from './popover/type';
102111
import {
103-
OverflowMenuItem as OverflowMenuItemComponent,
104-
Props as OverflowMenuItemProps,
105-
OverflowMenuItemType,
106-
} from './overflowMenu/overflowMenuItem.component';
107-
import {
108-
OverflowMenu as OverflowMenuComponent,
109-
Props as OverflowMenuProps,
110-
} from './overflowMenu/overflowMenu.component';
112+
TopNavigationAlignment,
113+
TopNavigationAlignments,
114+
} from './topNavigation/type';
111115

112116
const Avatar = styled<AvatarProps>(AvatarComponent);
113117
const BottomNavigationTab = styled<BottomNavigatorTabProps>(BottomNavigationTabComponent);
@@ -127,8 +131,8 @@ const TabBar = styled<TabBarProps>(TabBarComponent);
127131
const Text = styled<TextProps>(TextComponent);
128132
const Toggle = styled<ToggleProps>(ToggleComponent);
129133
const Tooltip = styled<TooltipProps>(TooltipComponent);
130-
const TopNavigationBar = styled<TopNavigationBarProps>(TopNavigationBarComponent);
131-
const TopNavigationBarAction = styled<TopNavigationBarActionProps>(TopNavigationBarActionComponent);
134+
const TopNavigation = styled<TopNavigationBarProps>(TopNavigationComponent);
135+
const TopNavigationAction = styled<TopNavigationBarActionProps>(TopNavigationActionComponent);
132136
const OverflowMenuItem = styled<OverflowMenuItemProps>(OverflowMenuItemComponent);
133137
const OverflowMenu = styled<OverflowMenuProps>(OverflowMenuComponent);
134138

@@ -153,8 +157,8 @@ export {
153157
Text,
154158
Toggle,
155159
Tooltip,
156-
TopNavigationBar,
157-
TopNavigationBarAction,
160+
TopNavigation,
161+
TopNavigationAction,
158162
ViewPager,
159163
OverflowMenu,
160164
OverflowMenuItem,
@@ -193,5 +197,7 @@ export {
193197
ButtonAlignments,
194198
PopoverPlacement,
195199
PopoverPlacements,
200+
TopNavigationAlignment,
201+
TopNavigationAlignments,
196202
OverflowMenuItemType,
197203
};

0 commit comments

Comments
 (0)