11import { FoundationsPage } from "./pages/FoundationsPage" ;
2- import { LabNavigation , LabSectionNavigation } from "./components/LabNavigation" ;
2+ import { LabNavigation , LabSectionNavigation , hasSectionNavigation } from "./components/LabNavigation" ;
3+ import { defaultComponent , libraryCategory } from "./componentNavigation" ;
34import {
45 useEffect ,
56 useLayoutEffect ,
@@ -18,7 +19,7 @@ import { Button, Dialog, DialogBody, DialogClose, DialogDescription, DialogHeade
1819 type DensityMode ,
1920 type IconName ,
2021} from "@openbitfun/ui" ;
21- import { OpenBitFunMark } from "@openbitfun/ui/brand" ;
22+ import { OpenBitFunSolidMark } from "@openbitfun/ui/brand" ;
2223import { BrandPage } from "./pages/BrandPage" ;
2324import { componentRegistry } from "@openbitfun/ui/registry" ;
2425import {
@@ -174,7 +175,6 @@ export function App() {
174175 const [ sidebarOpen , setSidebarOpen ] = useState ( false ) ;
175176 const searchInputRef = useRef < HTMLInputElement > ( null ) ;
176177 const searchResultsRef = useRef < HTMLDivElement > ( null ) ;
177- const searchShortcut = / M a c | i P h o n e | i P a d / i. test ( navigator . userAgent ) ? "⌘ K" : "Ctrl K" ;
178178
179179 const themeName = getThemeDataName ( colorScheme , contrast ) ;
180180 // Document-level portals live outside the page ThemeRoot. Give them the same
@@ -413,13 +413,16 @@ export function App() {
413413 const activeComponent = route . page === "component"
414414 ? componentRegistry . find ( ( component ) => component . name === route . componentName )
415415 : undefined ;
416+ const librarySelection = route . page === "components" || route . page === "mobile" || route . page === "flow-chat"
417+ ? defaultComponent ( libraryCategory ( route . page ) )
418+ : activeComponent ;
416419
417420 return (
418421 < DesignSystemProvider colorScheme = { colorScheme } contrast = { contrast } density = { density } locale = { locale } nativeTooltipPolicy = "application" >
419422 < ThemeRoot
420423 className = "lab-shell"
421424 data-page = { route . page }
422- data-component-library = { [ "components" , "component" , "mobile" , "flow-chat" ] . includes ( route . page ) || undefined }
425+ data-section-navigation = { hasSectionNavigation ( route . page ) || undefined }
423426 data-sidebar-open = { sidebarOpen || undefined }
424427 colorScheme = { colorScheme }
425428 contrast = { contrast }
@@ -433,23 +436,23 @@ export function App() {
433436 icon = { < CatalogIcon glyph = { Menu } /> }
434437 onClick = { ( ) => setSidebarOpen ( true ) }
435438 />
436- < a className = "design-wordmark-link" href = "#overview" onClick = { event => {
439+ < a className = "design-wordmark-link" href = "#overview" aria-label = "OpenBitFun Design" onClick = { event => {
437440 if ( event . metaKey || event . ctrlKey || event . shiftKey || event . altKey ) return ;
438441 event . preventDefault ( ) ;
439442 navigate ( { page : "overview" } ) ;
440443 } } >
441- < OpenBitFunMark size = { 28 } /> < span > OpenBitFun< span className = "design-wordmark-suffix" > Design</ span > </ span >
444+ { /* The product site's header lockup: the app mark next to the wordmark. The name is
445+ visible now, and the link's accessible label still says which site it leads to. */ }
446+ < OpenBitFunSolidMark className = "design-app-mark" size = { 28 } />
447+ < span className = "design-wordmark-name" > OpenBitFun</ span >
442448 </ a >
443449 < LabNavigation page = { route . page } componentName = { activeComponent ?. name }
444450 onNavigate = { page => page === "tokens" ? openTokenPage ( ) : navigate ( { page } ) } />
445451 < div className = "lab-topbar-actions" >
446- < Button className = "lab-search-trigger" size = "sm" variant = "fill"
447- aria-label = { t ( "search.label" ) } aria-haspopup = "dialog"
448- leadingIcon = { < CatalogIcon name = "search" /> }
449- onClick = { ( ) => setSearchOpen ( true ) } >
450- < span className = "lab-search-trigger-label" > { t ( "search.placeholder" ) } </ span >
451- < KeyHint className = "lab-search-shortcut" > { searchShortcut } </ KeyHint >
452- </ Button >
452+ { /* Icon only, like the two controls beside it: the accessible name still says what it
453+ opens, and the shortcut hint moved into the dialog it opens. */ }
454+ < IconButton className = "lab-search-trigger" aria-label = { t ( "search.label" ) } aria-haspopup = "dialog"
455+ icon = { < CatalogIcon name = "search" /> } onClick = { ( ) => setSearchOpen ( true ) } />
453456 < IconButton
454457 aria-label = { colorScheme === "light" ? t ( "theme.switchToDark" ) : t ( "theme.switchToLight" ) }
455458 icon = { < CatalogIcon glyph = { colorScheme === "light" ? Sun : Moon } /> }
@@ -469,6 +472,7 @@ export function App() {
469472 < SearchField aria-label = { t ( "search.label" ) } placeholder = { t ( "search.placeholder" ) }
470473 ref = { searchInputRef } value = { searchQuery } onChange = { event => setSearchQuery ( event . target . value ) }
471474 leadingIcon = { < CatalogIcon name = "search" /> } clearLabel = { t ( "design.clear" ) } onClear = { ( ) => setSearchQuery ( "" ) }
475+ shortcut = { < KeyHint icon = { < CatalogIcon name = "command-mac" /> } > K</ KeyHint > }
472476 onKeyDown = { event => {
473477 if ( event . nativeEvent . isComposing ) return ;
474478 if ( event . key === "ArrowDown" ) {
@@ -542,14 +546,20 @@ export function App() {
542546 </ DialogHeader >
543547 < DialogBody className = "lab-mobile-navigation" >
544548 < LabNavigation page = { route . page } onNavigate = { page => page === "tokens" ? openTokenPage ( ) : navigate ( { page } ) } />
545- < LabSectionNavigation page = { route . page } onNavigate = { page => page === "tokens" ? openTokenPage ( ) : navigate ( { page } ) } />
549+ < LabSectionNavigation componentName = { librarySelection ?. name } page = { route . page } onNavigate = { page => page === "tokens" ? openTokenPage ( ) : navigate ( { page } ) } />
546550 </ DialogBody >
547551 </ Sheet >
548552
549- < LabSectionNavigation page = { route . page } onNavigate = { page => page === "tokens" ? openTokenPage ( ) : navigate ( { page } ) } />
553+ < LabSectionNavigation componentName = { librarySelection ?. name } page = { route . page } onNavigate = { page => page === "tokens" ? openTokenPage ( ) : navigate ( { page } ) } />
550554 < div className = "lab-content" >
551555 { route . page === "overview" && (
552- < OverviewPage onNavigate = { ( target ) => navigate ( { page : target } ) } />
556+ < OverviewPage
557+ colorScheme = { colorScheme }
558+ contrast = { contrast }
559+ density = { density }
560+ onNavigate = { ( target ) => navigate ( { page : target } ) }
561+ tokenOverrides = { tokenOverrides }
562+ />
553563 ) }
554564
555565 { route . page === "foundations" && < FoundationsPage
@@ -568,7 +578,7 @@ export function App() {
568578
569579 { ( [ "components" , "component" , "mobile" , "flow-chat" ] . includes ( route . page ) ) && (
570580 < ComponentsPage
571- category = { route . page === "mobile" ? "mobile" : route . page === "flow-chat" ? "flow-chat" : undefined }
581+ category = { libraryCategory ( route . page ) }
572582 colorScheme = { colorScheme }
573583 component = { activeComponent }
574584 contrast = { contrast }
0 commit comments