@@ -46,11 +46,21 @@ export const loader = async ({
4646
4747 // Get all folders in components-docs/{lang}
4848 const docsFolders = getFoldersInContentDir ( join ( 'components-docs' , lang ) ) ;
49+ const reactUtilities = new Set ( [
50+ 'roving-focus' ,
51+ 'use-checkbox-group' ,
52+ 'use-pagination' ,
53+ 'use-radio-group' ,
54+ 'use-synchronized-animation' ,
55+ ] ) ;
4956
5057 // Process each folder as a category
5158 for ( const folder of docsFolders ) {
5259 const categoryKey = folder === 'get-started' ? 'getStarted' : folder ;
5360 cats [ categoryKey ] = [ ] ;
61+ if ( folder === 'utilities' ) {
62+ cats . utilitiesReact = [ ] ;
63+ }
5464
5565 // Get all files in this folder
5666 const filesInFolder = getFilesFromContentDir (
@@ -62,18 +72,26 @@ export const loader = async ({
6272 join ( 'components-docs' , lang , folder , `${ file . relativePath } ` ) ,
6373 ) ;
6474 const result = await generateFromMdx ( fileContent ) ;
75+ const slug = file . relativePath . replace ( '.mdx' , '' ) ;
76+ const utilityCategory =
77+ folder === 'utilities' && reactUtilities . has ( slug )
78+ ? 'utilitiesReact'
79+ : categoryKey ;
6580
66- cats [ categoryKey ] . push ( {
81+ cats [ utilityCategory ] . push ( {
6782 title :
6883 result . frontmatter . sidebar_title ||
6984 file . relativePath . replace ( '.mdx' , '' ) ,
70- url : `/${ lang } /components/${ folder } /${ file . relativePath . replace ( '.mdx' , '' ) } ` ,
85+ url : `/${ lang } /components/${ folder } /${ slug } ` ,
7186 order : parseInt ( result . frontmatter . order , 10 ) || 9999 ,
7287 } ) ;
7388 }
7489
7590 // Sort items within the category by order
7691 cats [ categoryKey ] . sort ( ( a , b ) => ( a . order || 9999 ) - ( b . order || 9999 ) ) ;
92+ if ( folder === 'utilities' ) {
93+ cats . utilitiesReact . sort ( ( a , b ) => ( a . order || 9999 ) - ( b . order || 9999 ) ) ;
94+ }
7795 }
7896
7997 /* read all folders in content/components */
0 commit comments