@@ -12,54 +12,52 @@ const metadataFile = path.join(
12
12
"packages/web-components/metadata.json" ,
13
13
) ;
14
14
15
- const getSidebarItems = ( ) : DefaultTheme . Sidebar => {
16
- const metadata = JSON . parse (
17
- fs . readFileSync ( metadataFile ) . toString ( "utf-8" ) ,
18
- ) as Metadata ;
19
-
20
- const components = Object . values ( metadata . components )
21
- . sort ( ( a , b ) => a . name . localeCompare ( b . name ) )
22
- . map ( c => ( {
23
- text : c . titleCaseName ,
24
- link : `/components/${ c . relativePath } ` ,
25
- } ) ) ;
26
-
27
- const componentsSidebar = [
28
- {
29
- text : "Introduction" ,
30
- link : "/components" ,
31
- items : components ,
32
- } ,
33
- ] ;
34
-
35
- const themeSidebar = [
36
- {
37
- text : "Introduction" ,
38
- link : "/theme" ,
39
- items : [
40
- { text : "Color" , link : "/theme/color" } ,
41
- { text : "Palette" , link : "/theme/palette" } ,
42
- { text : "Radius" , link : "/theme/radius" } ,
43
- { text : "Spacing" , link : "/theme/spacing" } ,
44
- { text : "Stroke" , link : "/theme/stroke" } ,
45
- { text : "Typography" , link : "/theme/typography" } ,
46
- ] ,
47
- } ,
48
- ] ;
49
-
50
- const iconsSidebar = [
51
- {
52
- text : "Introduction" ,
53
- link : "/icons" ,
54
- items : [ { text : "Explore Icons" , link : "/icons/explore" } ] ,
55
- } ,
56
- ] ;
57
-
58
- return {
59
- "/components" : componentsSidebar ,
60
- "/theme" : themeSidebar ,
61
- "/icons" : iconsSidebar ,
62
- } ;
15
+ const metadata = JSON . parse (
16
+ fs . readFileSync ( metadataFile ) . toString ( "utf-8" ) ,
17
+ ) as Metadata ;
18
+
19
+ const components = Object . values ( metadata . components )
20
+ . sort ( ( a , b ) => a . name . localeCompare ( b . name ) )
21
+ . map ( c => ( {
22
+ text : c . titleCaseName ,
23
+ link : `/components/${ c . relativePath } ` ,
24
+ } ) ) ;
25
+
26
+ const componentsSidebar = [
27
+ {
28
+ text : "Introduction" ,
29
+ link : "/components" ,
30
+ items : components ,
31
+ } ,
32
+ ] ;
33
+
34
+ const themeSidebar = [
35
+ {
36
+ text : "Introduction" ,
37
+ link : "/theme" ,
38
+ items : [
39
+ { text : "Color" , link : "/theme/color" } ,
40
+ { text : "Palette" , link : "/theme/palette" } ,
41
+ { text : "Radius" , link : "/theme/radius" } ,
42
+ { text : "Spacing" , link : "/theme/spacing" } ,
43
+ { text : "Stroke" , link : "/theme/stroke" } ,
44
+ { text : "Typography" , link : "/theme/typography" } ,
45
+ ] ,
46
+ } ,
47
+ ] ;
48
+
49
+ const iconsSidebar = [
50
+ {
51
+ text : "Introduction" ,
52
+ link : "/icons" ,
53
+ items : [ { text : "Explore Icons" , link : "/icons/explore" } ] ,
54
+ } ,
55
+ ] ;
56
+
57
+ const items : DefaultTheme . Sidebar = {
58
+ "/components" : componentsSidebar ,
59
+ "/theme" : themeSidebar ,
60
+ "/icons" : iconsSidebar ,
63
61
} ;
64
62
65
- export default getSidebarItems ( ) ;
63
+ export default items ;
0 commit comments