Layout scaffolding for Web apps.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

62 lines
1.4 KiB

  1. import * as React from 'react';
  2. import {layouts} from '@tesseract-design/viewfinder-base';
  3. export type RootProps = React.HTMLProps<HTMLDivElement> & {
  4. sidebarBaseWidget?: React.ReactNode;
  5. topBarWidget?: React.ReactNode;
  6. };
  7. export const Root = React.forwardRef<HTMLDivElement, RootProps>(({
  8. children,
  9. topBarWidget,
  10. sidebarBaseWidget,
  11. ...etcProps
  12. }, ref) => {
  13. return (
  14. <>
  15. {topBarWidget}
  16. <main
  17. {...etcProps}
  18. ref={ref}
  19. className={layouts.RightSidebarStatic.ContentBase()}
  20. >
  21. {children}
  22. </main>
  23. {sidebarBaseWidget}
  24. </>
  25. )
  26. })
  27. export type ContentContainerProps = React.HTMLProps<HTMLDivElement> & {}
  28. export const MainContentContainer = React.forwardRef<HTMLDivElement, ContentContainerProps>(({
  29. children,
  30. }, ref) => (
  31. <div
  32. className={layouts.RightSidebarStatic.ContentContainer()}
  33. ref={ref}
  34. >
  35. {children}
  36. </div>
  37. ));
  38. MainContentContainer.displayName = 'MainContentContainer'
  39. export type SidebarMainContainerProps = React.HTMLProps<HTMLDivElement> & {}
  40. export const SidebarContentContainer = React.forwardRef<HTMLDivElement, SidebarMainContainerProps>(({
  41. children,
  42. ...etcProps
  43. }, ref) => (
  44. <div
  45. {...etcProps}
  46. className={layouts.RightSidebarStatic.SidebarMainContainer()}
  47. ref={ref}
  48. >
  49. {children}
  50. </div>
  51. ));
  52. SidebarContentContainer.displayName = 'SidebarMainContainer';