@@ -8,23 +8,23 @@ console.log("COUCOU from preview.tsx");
88const preview : Preview = {
99 tags : [ "autodocs" ] ,
1010 parameters : {
11- " actions" : { " argTypesRegex" : "^on[A-Z].*" } ,
12- " controls" : {
13- " matchers" : {
14- " color" : / ( b a c k g r o u n d | c o l o r ) $ / i,
15- " date" : / D a t e $ /
11+ actions : { argTypesRegex : "^on[A-Z].*" } ,
12+ controls : {
13+ matchers : {
14+ color : / ( b a c k g r o u n d | c o l o r ) $ / i,
15+ date : / D a t e $ /
1616 }
1717 } ,
18- " backgrounds" : { disabled : true } ,
19- " darkMode" : {
20- " stylePreview" : true ,
21- " light" : lightTheme ,
22- " dark" : darkTheme
18+ backgrounds : { disabled : true } ,
19+ darkMode : {
20+ stylePreview : true ,
21+ light : lightTheme ,
22+ dark : darkTheme
2323 } ,
24- " docs" : {
25- " container" : DocsContainer
24+ docs : {
25+ container : DocsContainer
2626 } ,
27- " viewport" : {
27+ viewport : {
2828 options : {
2929 "1440p" : {
3030 "name" : "1440p" ,
@@ -98,39 +98,28 @@ const preview: Preview = {
9898 }
9999 }
100100 } ,
101- "options" : {
102- "storySort" : ( a : IndexEntry , b : IndexEntry ) =>
103- getHardCodedWeight ( b . title ) - getHardCodedWeight ( a . title )
101+ options : {
102+ storySort : {
103+ method : "alphabetical" ,
104+ order : [
105+ "🇫🇷 Introduction" ,
106+ "components" ,
107+ [
108+ "Header" ,
109+ "Footer" ,
110+ "consentManagement" ,
111+ "Alert" ,
112+ "Tabs" ,
113+ "Stepper" ,
114+ "Button" ,
115+ "FranceConnectButton" ,
116+ "ProConnectButton" ,
117+ "*"
118+ ]
119+ ]
120+ }
104121 }
105122 }
106123} ;
107124
108125export default preview ;
109-
110- const { getHardCodedWeight } = ( ( ) => {
111- const orderedPagesPrefix = [
112- "🇫🇷 Introduction" ,
113- //"components",
114- "components/Header" ,
115- "components/Footer" ,
116- "components/consentManagement" ,
117- "components/Alert" ,
118- "components/Tabs" ,
119- "components/Stepper" ,
120- "components/Button" ,
121- "components/FranceConnectButton" ,
122- "components/ProConnectButton"
123- ] ;
124-
125- function getHardCodedWeight ( kind : string ) {
126- for ( let i = 0 ; i < orderedPagesPrefix . length ; i ++ ) {
127- if ( kind . toLowerCase ( ) . startsWith ( orderedPagesPrefix [ i ] . toLowerCase ( ) ) ) {
128- return orderedPagesPrefix . length - i ;
129- }
130- }
131-
132- return 0 ;
133- }
134-
135- return { getHardCodedWeight } ;
136- } ) ( ) ;
0 commit comments