this.gui 1.3.40 → 1.3.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/init/index.html +27 -0
- package/dist/init/package-lock.json +5779 -0
- package/dist/init/package.json +24 -0
- package/dist/init/src/App.tsx +40 -0
- package/dist/init/src/index.css +16 -0
- package/dist/init/src/main.tsx +13 -0
- package/dist/init/src/router/DerivableRouter.tsx +36 -0
- package/dist/init/tsconfig.json +17 -0
- package/dist/init/vite.config.ts +11 -0
- package/package.json +5 -3
- package/src/GUI.tsx +46 -0
- package/src/QRouter/QRegistry.tsx +53 -0
- package/src/QRouter/QRouter.stories.tsx +31 -0
- package/src/QRouter/QRouter.tsx +57 -0
- package/src/gui/Theme/GuiProvider.tsx +111 -0
- package/src/gui/Theme/Icon/Icon.resolver.tsx +29 -0
- package/src/gui/Theme/Icon/Icon.tsx +43 -0
- package/src/gui/Theme/Layout/Content/Content.resolver.tsx +0 -0
- package/src/gui/Theme/Layout/Content/Content.stories.tsx +88 -0
- package/src/gui/Theme/Layout/Content/Content.tsx +53 -0
- package/src/gui/Theme/Layout/Content/Content.types.tsx +40 -0
- package/src/gui/Theme/Layout/Footer/Footer.resolver.tsx +45 -0
- package/src/gui/Theme/Layout/Footer/Footer.stories.tsx +205 -0
- package/src/gui/Theme/Layout/Footer/Footer.tsx +337 -0
- package/src/gui/Theme/Layout/Footer/Footer.types.ts +40 -0
- package/src/gui/Theme/Layout/Layout/Layout.resolver.tsx +37 -0
- package/src/gui/Theme/Layout/Layout/Layout.stories.tsx +289 -0
- package/src/gui/Theme/Layout/Layout/Layout.tsx +117 -0
- package/src/gui/Theme/Layout/Layout/Layout.types.ts +57 -0
- package/src/gui/Theme/Layout/Layout/useLayoutBreakpoints.ts +9 -0
- package/src/gui/Theme/Layout/Namespace/Namespace.stories.tsx +105 -0
- package/src/gui/Theme/Layout/Namespace/Namespace.tsx +26 -0
- package/src/gui/Theme/Layout/Sidebars/LeftSidebar/LeftSidebar.resolver.tsx +87 -0
- package/src/gui/Theme/Layout/Sidebars/LeftSidebar/LeftSidebar.stories.tsx +199 -0
- package/src/gui/Theme/Layout/Sidebars/LeftSidebar/LeftSidebar.tsx +311 -0
- package/src/gui/Theme/Layout/Sidebars/LeftSidebar/LeftSidebar.types.ts +41 -0
- package/src/gui/Theme/Layout/Sidebars/LeftSidebar/SidebarToggleButton.tsx +53 -0
- package/src/gui/Theme/Layout/Sidebars/LeftSidebar/components/LeftSidebarAction/LeftSidebarAction.resolver.tsx +19 -0
- package/src/gui/Theme/Layout/Sidebars/LeftSidebar/components/LeftSidebarAction/LeftSidebarAction.tsx +107 -0
- package/src/gui/Theme/Layout/Sidebars/LeftSidebar/components/LeftSidebarLink/LeftSidebarLink.resolver.tsx +0 -0
- package/src/gui/Theme/Layout/Sidebars/LeftSidebar/components/LeftSidebarLink/LeftSidebarLink.tsx +134 -0
- package/src/gui/Theme/Layout/Sidebars/LeftSidebar/components/LeftSidebarLink/LeftSidebarLink.types.ts +15 -0
- package/src/gui/Theme/Layout/Sidebars/LeftSidebar/components/LeftSidebarMenu/LeftSidebarMenu.tsx +142 -0
- package/src/gui/Theme/Layout/Sidebars/LeftSidebar/components/LeftSidebarToggleButton/LeftSidebarToggleButton.tsx +23 -0
- package/src/gui/Theme/Layout/Sidebars/RightSidebar/RightSidebar.resolver.tsx +35 -0
- package/src/gui/Theme/Layout/Sidebars/RightSidebar/RightSidebar.stories.tsx +239 -0
- package/src/gui/Theme/Layout/Sidebars/RightSidebar/RightSidebar.tsx +319 -0
- package/src/gui/Theme/Layout/Sidebars/RightSidebar/RightSidebar.types.ts +17 -0
- package/src/gui/Theme/Layout/Sidebars/RightSidebar/components/RightSidebarAction/RightSidebarAction.tsx +102 -0
- package/src/gui/Theme/Layout/Sidebars/RightSidebar/components/RightSidebarLink/RightSidebarLink.tsx +132 -0
- package/src/gui/Theme/Layout/Sidebars/RightSidebar/components/RightSidebarMenu/RightSidebarMenu.tsx +140 -0
- package/src/gui/Theme/Layout/Sidebars/RightSidebar/components/RightSidebarToggleButton/RightSidebarToggleButton.tsx +22 -0
- package/src/gui/Theme/Layout/StickyOptions/StickyOptionsTop.stories.tsx +469 -0
- package/src/gui/Theme/Layout/StickyOptions/StickyOptionsTop.tsx +489 -0
- package/src/gui/Theme/Layout/TopBar/TopBar.resolver.tsx +86 -0
- package/src/gui/Theme/Layout/TopBar/TopBar.stories.tsx +350 -0
- package/src/gui/Theme/Layout/TopBar/TopBar.tsx +292 -0
- package/src/gui/Theme/Layout/TopBar/TopBar.types.ts +39 -0
- package/src/gui/Theme/Layout/TopBar/components/TopBarAction/TopBarAction.stories.tsx +83 -0
- package/src/gui/Theme/Layout/TopBar/components/TopBarAction/TopBarAction.tsx +18 -0
- package/src/gui/Theme/Layout/TopBar/components/TopBarAction/TopBarAction.types.ts +4 -0
- package/src/gui/Theme/Layout/TopBar/components/TopBarLink/TopBarLink.stories.tsx +189 -0
- package/src/gui/Theme/Layout/TopBar/components/TopBarLink/TopBarLink.tsx +30 -0
- package/src/gui/Theme/Layout/TopBar/components/TopBarLink/TopBarLink.types.ts +9 -0
- package/src/gui/Theme/Layout/TopBar/components/TopBarMenu/TopBarMenu.resolver.tsx +14 -0
- package/src/gui/Theme/Layout/TopBar/components/TopBarMenu/TopBarMenu.stories.tsx +56 -0
- package/src/gui/Theme/Layout/TopBar/components/TopBarMenu/TopBarMenu.tsx +123 -0
- package/src/gui/Theme/Layout/TopBar/components/TopBarMenu/TopBarMenu.types.ts +44 -0
- package/src/gui/Theme/catalog/CherryByte/CherryByte.png +0 -0
- package/src/gui/Theme/catalog/CherryByte/dark.tokens.ts +47 -0
- package/src/gui/Theme/catalog/CherryByte/light.tokens.ts +47 -0
- package/src/gui/Theme/catalog/CherryByte/manifest.ts +24 -0
- package/src/gui/Theme/catalog/GhostShell/dark.tokens.ts +43 -0
- package/src/gui/Theme/catalog/GhostShell/ghost.png +0 -0
- package/src/gui/Theme/catalog/GhostShell/light.tokens.ts +39 -0
- package/src/gui/Theme/catalog/GhostShell/manifest.ts +24 -0
- package/src/gui/Theme/catalog/LunaHex/LunaHex.png +0 -0
- package/src/gui/Theme/catalog/LunaHex/dark.tokens.ts +34 -0
- package/src/gui/Theme/catalog/LunaHex/light.tokens.ts +74 -0
- package/src/gui/Theme/catalog/LunaHex/manifest.ts +24 -0
- package/src/gui/Theme/catalog/MUI/MUI.png +0 -0
- package/src/gui/Theme/catalog/MUI/dark.tokens.ts +58 -0
- package/src/gui/Theme/catalog/MUI/light.tokens.ts +74 -0
- package/src/gui/Theme/catalog/MUI/manifest.ts +24 -0
- package/src/gui/Theme/catalog/PrinceOfDarkness/dark.tokens.ts +48 -0
- package/src/gui/Theme/catalog/PrinceOfDarkness/light.tokens.ts +47 -0
- package/src/gui/Theme/catalog/PrinceOfDarkness/manifest.ts +24 -0
- package/src/gui/Theme/catalog/PrinceOfDarkness/prince.png +0 -0
- package/src/gui/Theme/catalog/PrinceOfDarkness/princeOfDarkness.png +0 -0
- package/src/gui/Theme/catalog/Seafoam/dark.tokens.ts +49 -0
- package/src/gui/Theme/catalog/Seafoam/light.tokens.ts +47 -0
- package/src/gui/Theme/catalog/Seafoam/manifest.ts +24 -0
- package/src/gui/Theme/catalog/Seafoam/seaFoam.png +0 -0
- package/src/gui/Theme/catalog/neurons/dark.tokens.ts +58 -0
- package/src/gui/Theme/catalog/neurons/light.tokens.ts +74 -0
- package/src/gui/Theme/catalog/neurons/manifest.ts +24 -0
- package/src/gui/Theme/catalog/neurons/neurons.me.png +0 -0
- package/src/gui/Theme/fromTokens.ts +272 -0
- package/src/gui/Theme/gui.css +31 -0
- package/src/gui/Theme/index.ts +17 -0
- package/src/gui/Theme/styles/buildShadows.ts +83 -0
- package/src/gui/Theme/styles/theme.tokens.ts +108 -0
- package/src/gui/Theme/utils/catalog.ts +61 -0
- package/src/gui/Theme/utils/persistence.ts +66 -0
- package/src/gui/Theme/utils/themeUtils.ts +34 -0
- package/src/gui/components/atoms/AppBar/AppBar.resolver.tsx +46 -0
- package/src/gui/components/atoms/AppBar/AppBar.stories.tsx +251 -0
- package/src/gui/components/atoms/AppBar/AppBar.tsx +107 -0
- package/src/gui/components/atoms/AppBar/AppBar.types.ts +28 -0
- package/src/gui/components/atoms/Avatar/Avatar.resolver.tsx +61 -0
- package/src/gui/components/atoms/Avatar/Avatar.stories.tsx +36 -0
- package/src/gui/components/atoms/Avatar/Avatar.tsx +14 -0
- package/src/gui/components/atoms/Box/Box.resolver.tsx +171 -0
- package/src/gui/components/atoms/Box/Box.stories.tsx +263 -0
- package/src/gui/components/atoms/Box/Box.tsx +15 -0
- package/src/gui/components/atoms/Button/Button.resolver.tsx +103 -0
- package/src/gui/components/atoms/Button/Button.stories.tsx +219 -0
- package/src/gui/components/atoms/Button/Button.tsx +40 -0
- package/src/gui/components/atoms/Card/Card.resolver.tsx +63 -0
- package/src/gui/components/atoms/Card/Card.stories.tsx +54 -0
- package/src/gui/components/atoms/Card/Card.tsx +13 -0
- package/src/gui/components/atoms/CardActions/CardActions.resolver.tsx +59 -0
- package/src/gui/components/atoms/CardActions/CardActions.stories.tsx +32 -0
- package/src/gui/components/atoms/CardActions/CardActions.tsx +14 -0
- package/src/gui/components/atoms/CardContent/CardContent.resolver.tsx +60 -0
- package/src/gui/components/atoms/CardContent/CardContent.stories.tsx +34 -0
- package/src/gui/components/atoms/CardContent/CardContent.tsx +13 -0
- package/src/gui/components/atoms/CardHeader/CardHeader.resolver.tsx +68 -0
- package/src/gui/components/atoms/CardHeader/CardHeader.stories.tsx +40 -0
- package/src/gui/components/atoms/CardHeader/CardHeader.tsx +12 -0
- package/src/gui/components/atoms/Collapse/Collapse.resolver.tsx +85 -0
- package/src/gui/components/atoms/Collapse/Collapse.stories.tsx +130 -0
- package/src/gui/components/atoms/Collapse/Collapse.tsx +17 -0
- package/src/gui/components/atoms/Divider/Divider.resolver.tsx +95 -0
- package/src/gui/components/atoms/Divider/Divider.stories.tsx +108 -0
- package/src/gui/components/atoms/Divider/Divider.tsx +14 -0
- package/src/gui/components/atoms/Drawer/Drawer.resolver.tsx +116 -0
- package/src/gui/components/atoms/Drawer/Drawer.stories.tsx +223 -0
- package/src/gui/components/atoms/Drawer/Drawer.tsx +25 -0
- package/src/gui/components/atoms/Grid/Grid.resolver.tsx +33 -0
- package/src/gui/components/atoms/Grid/Grid.stories.tsx +136 -0
- package/src/gui/components/atoms/Grid/Grid.tsx +15 -0
- package/src/gui/components/atoms/Grid/Grid.types.ts +9 -0
- package/src/gui/components/atoms/IconButton/IconButton.resolver.tsx +137 -0
- package/src/gui/components/atoms/IconButton/IconButton.stories.tsx +134 -0
- package/src/gui/components/atoms/IconButton/IconButton.tsx +22 -0
- package/src/gui/components/atoms/Link/Link.resolver.tsx +74 -0
- package/src/gui/components/atoms/Link/Link.stories.tsx +157 -0
- package/src/gui/components/atoms/Link/Link.tsx +36 -0
- package/src/gui/components/atoms/List/List.resolver.tsx +94 -0
- package/src/gui/components/atoms/List/List.stories.tsx +137 -0
- package/src/gui/components/atoms/List/List.tsx +20 -0
- package/src/gui/components/atoms/ListItem/ListItem.resolver.tsx +88 -0
- package/src/gui/components/atoms/ListItem/ListItem.stories.tsx +151 -0
- package/src/gui/components/atoms/ListItem/ListItem.tsx +19 -0
- package/src/gui/components/atoms/ListItemButton/ListItemButton.resolver.tsx +214 -0
- package/src/gui/components/atoms/ListItemButton/ListItemButton.stories.tsx +155 -0
- package/src/gui/components/atoms/ListItemButton/ListItemButton.tsx +15 -0
- package/src/gui/components/atoms/ListItemIcon/ListItemIcon.resolver.tsx +102 -0
- package/src/gui/components/atoms/ListItemIcon/ListItemIcon.stories.tsx +132 -0
- package/src/gui/components/atoms/ListItemIcon/ListItemIcon.tsx +11 -0
- package/src/gui/components/atoms/ListItemText/ListItemText.resolver.tsx +112 -0
- package/src/gui/components/atoms/ListItemText/ListItemText.stories.tsx +156 -0
- package/src/gui/components/atoms/ListItemText/ListItemText.tsx +15 -0
- package/src/gui/components/atoms/Menu/Menu.resolver.tsx +112 -0
- package/src/gui/components/atoms/Menu/Menu.stories.tsx +162 -0
- package/src/gui/components/atoms/Menu/Menu.tsx +17 -0
- package/src/gui/components/atoms/MenuItem/MenuItem.resolver.tsx +183 -0
- package/src/gui/components/atoms/MenuItem/MenuItem.stories.tsx +134 -0
- package/src/gui/components/atoms/MenuItem/MenuItem.tsx +14 -0
- package/src/gui/components/atoms/Paper/Paper.resolver.tsx +98 -0
- package/src/gui/components/atoms/Paper/Paper.stories.tsx +184 -0
- package/src/gui/components/atoms/Paper/Paper.tsx +15 -0
- package/src/gui/components/atoms/Section/Section.resolver.tsx +10 -0
- package/src/gui/components/atoms/Section/Section.stories.tsx +189 -0
- package/src/gui/components/atoms/Section/Section.tsx +76 -0
- package/src/gui/components/atoms/Section/Section.types.tsx +24 -0
- package/src/gui/components/atoms/Stack/Stack.resolver.tsx +94 -0
- package/src/gui/components/atoms/Stack/Stack.stories.tsx +160 -0
- package/src/gui/components/atoms/Stack/Stack.tsx +15 -0
- package/src/gui/components/atoms/Surface/Surface.resolver.tsx +37 -0
- package/src/gui/components/atoms/Surface/Surface.tsx +49 -0
- package/src/gui/components/atoms/Surface/Surface.types.ts +20 -0
- package/src/gui/components/atoms/Switch/Switch.resolver.tsx +53 -0
- package/src/gui/components/atoms/Switch/Switch.stories.tsx +236 -0
- package/src/gui/components/atoms/Switch/Switch.tsx +22 -0
- package/src/gui/components/atoms/Table/Body/TableBody.tsx +7 -0
- package/src/gui/components/atoms/Table/Cell/TableCell.tsx +18 -0
- package/src/gui/components/atoms/Table/Head/TableHead.tsx +9 -0
- package/src/gui/components/atoms/Table/Row/TableRow.tsx +20 -0
- package/src/gui/components/atoms/Table/Table.resolver.tsx +77 -0
- package/src/gui/components/atoms/Table/Table.stories.tsx +173 -0
- package/src/gui/components/atoms/Table/Table.tsx +20 -0
- package/src/gui/components/atoms/TextField/TextField.stories.tsx +25 -0
- package/src/gui/components/atoms/TextField/TextField.tsx +15 -0
- package/src/gui/components/atoms/Toolbar/Toolbar.resolver.tsx +60 -0
- package/src/gui/components/atoms/Toolbar/Toolbar.stories.tsx +155 -0
- package/src/gui/components/atoms/Toolbar/Toolbar.tsx +16 -0
- package/src/gui/components/atoms/Tooltip/Tooltip.resolver.tsx +142 -0
- package/src/gui/components/atoms/Tooltip/Tooltip.stories.tsx +117 -0
- package/src/gui/components/atoms/Tooltip/Tooltip.tsx +70 -0
- package/src/gui/components/atoms/Typography/Typography.resolver.tsx +158 -0
- package/src/gui/components/atoms/Typography/Typography.stories.tsx +222 -0
- package/src/gui/components/atoms/Typography/Typography.tsx +27 -0
- package/src/gui/components/atoms/Window/Nodes/node.ts +0 -0
- package/src/gui/components/atoms/Window/code/block/node.tsx +0 -0
- package/src/gui/components/atoms/Window/code/hugging.face.api.ts +11 -0
- package/src/gui/components/atoms/Window/connectors/index.ts +19 -0
- package/src/gui/components/atoms/Window/window.stories.tsx +20 -0
- package/src/gui/components/atoms/Window/window.tsx +636 -0
- package/src/gui/components/atoms/atoms.tsx +151 -0
- package/src/gui/components/atoms/index.ts +2 -0
- package/src/gui/components/generics/Cards/Gridme.jsx +52 -0
- package/src/gui/components/generics/Cards/LilBox.jsx +65 -0
- package/src/gui/components/generics/Cards/ModuleCard.jsx +106 -0
- package/src/gui/components/generics/Chats/FullChatBot.jsx +223 -0
- package/src/gui/components/generics/Code/CodeBlock.jsx +33 -0
- package/src/gui/components/generics/EmojiCursor/EmojiCursor.stories.tsx +153 -0
- package/src/gui/components/generics/EmojiCursor/EmojiCursor.tsx +23 -0
- package/src/gui/components/generics/Feedback/Callout.jsx +92 -0
- package/src/gui/components/generics/Layout/GridX.jsx +29 -0
- package/src/gui/components/generics/Layout/Hero2.jsx +132 -0
- package/src/gui/components/generics/Layout/PageContainer.jsx +29 -0
- package/src/gui/components/generics/Layout/PageDivider.jsx +20 -0
- package/src/gui/components/generics/Layout/Section.jsx +43 -0
- package/src/gui/components/generics/Layout/SectionHeader.jsx +21 -0
- package/src/gui/components/generics/Media/Img.jsx +58 -0
- package/src/gui/components/generics/Media/VideoEmbed.jsx +51 -0
- package/src/gui/components/generics/Organization/TableOfContents.jsx +51 -0
- package/src/gui/components/generics/Organization/Tabs.jsx +45 -0
- package/src/gui/components/generics/Text/TextList.jsx +41 -0
- package/src/gui/components/generics/Text/TextParagraph.jsx +28 -0
- package/src/gui/components/generics/Text/TextQuote.jsx +23 -0
- package/src/gui/components/generics/Text/TextTitle.jsx +44 -0
- package/src/gui/components/molecules/Dialog/Dialog.stories.tsx +18 -0
- package/src/gui/components/molecules/Dialog/Dialog.tsx +5 -0
- package/src/gui/components/molecules/Hero/Hero.stories.tsx +140 -0
- package/src/gui/components/molecules/Hero/Hero.tsx +152 -0
- package/src/gui/components/molecules/Hero/Hero.types.tsx +18 -0
- package/src/gui/components/molecules/Modal/Modal.resolver.tsx +38 -0
- package/src/gui/components/molecules/Modal/Modal.stories.tsx +82 -0
- package/src/gui/components/molecules/Modal/Modal.tsx +110 -0
- package/src/gui/components/molecules/Modal/Modal.types.ts +29 -0
- package/src/gui/components/molecules/Page/Page.stories.tsx +135 -0
- package/src/gui/components/molecules/Page/Page.tsx +94 -0
- package/src/gui/components/molecules/Theme/ThemeModeToggle/ThemeModeToggle.resolver.tsx +58 -0
- package/src/gui/components/molecules/Theme/ThemeModeToggle/ThemeModeToggle.stories.tsx +133 -0
- package/src/gui/components/molecules/Theme/ThemeModeToggle/ThemeModeToggle.tsx +101 -0
- package/src/gui/components/molecules/Theme/ThemeModeToggle/ThemeModeToggle.types.ts +29 -0
- package/src/gui/components/molecules/Theme/ThemesCatalog/ThemesCatalog.resolver.tsx +15 -0
- package/src/gui/components/molecules/Theme/ThemesCatalog/ThemesCatalog.stories.tsx +88 -0
- package/src/gui/components/molecules/Theme/ThemesCatalog/ThemesCatalog.tsx +167 -0
- package/src/gui/components/molecules/Theme/ThemesCatalog/ThemesCatalog.types.ts +34 -0
- package/src/gui/components/molecules/molecules.ts +49 -0
- package/src/gui/components/organisms/Blockchain/Blocks/BlocksTable.tsx +119 -0
- package/src/gui/components/organisms/Blockchain/Usernames/Identities.stories.tsx +20 -0
- package/src/gui/components/organisms/Blockchain/Usernames/QR.tsx +566 -0
- package/src/gui/components/organisms/Blockchain/Usernames/Usernames.tsx +448 -0
- package/src/gui/components/organisms/Blockchain/Usernames/identities.tsx +710 -0
- package/src/gui/components/organisms/Blockchain/blockchain.stories.tsx +17 -0
- package/src/gui/components/organisms/Blockchain/blockchain.tsx +368 -0
- package/src/gui/components/organisms/Blockchain/scripts/connection.ts +82 -0
- package/src/gui/components/organisms/Blockchain/scripts/match_face.ts +143 -0
- package/src/gui/components/organisms/HighLighter/HighLighter.stories.tsx +168 -0
- package/src/gui/components/organisms/HighLighter/HighLighter.tsx +420 -0
- package/src/gui/components/organisms/HighLighter/HighLightsDrawer.tsx +197 -0
- package/src/gui/components/organisms/IdentityNoise/FaceRecognition/FaceRecognition.stories.tsx +312 -0
- package/src/gui/components/organisms/IdentityNoise/FaceRecognition/FaceRecognition.tsx +765 -0
- package/src/gui/components/organisms/IdentityNoise/FaceRecognition/modules/useFaceCameraPermission.ts +70 -0
- package/src/gui/components/organisms/IdentityNoise/FaceRecognition/modules/useFaceLandmarker.ts +106 -0
- package/src/gui/components/organisms/IdentityNoise/FaceRecognition/modules/useFaceOverlay.ts +489 -0
- package/src/gui/components/organisms/IdentityNoise/FaceRecognition/modules/useFaceTemplate.ts +32 -0
- package/src/gui/components/organisms/IdentityNoise/FaceRecognition/modules/useFaceTemplateBurst.ts +178 -0
- package/src/gui/components/organisms/IdentityNoise/FaceRecognition/modules/verifyTemplate.ts +136 -0
- package/src/gui/components/organisms/IdentityNoise/IdentityNoise.tsx +403 -0
- package/src/gui/components/organisms/IdentityNoise/IndentityNoise.stories.tsx +15 -0
- package/src/gui/components/organisms/IdentityNoise/Noise/Noise.stories.tsx +206 -0
- package/src/gui/components/organisms/IdentityNoise/Noise/Noise.tsx +394 -0
- package/src/gui/components/organisms/IdentityNoise/Triad/QR.tsx +566 -0
- package/src/gui/components/organisms/IdentityNoise/Triad/Tiad.stories.tsx +6 -0
- package/src/gui/components/organisms/IdentityNoise/Triad/Triad.tsx +917 -0
- package/src/gui/components/organisms/IdentityNoise/Triad/handleCleak.ts +0 -0
- package/src/gui/components/organisms/IdentityNoise/Triad/identity.ts +31 -0
- package/src/gui/components/organisms/IdentityNoise/Triad/me/fundamentals/vectors/vectors.tsx +252 -0
- package/src/gui/components/organisms/IdentityNoise/Triad/me/me.stories.tsx +314 -0
- package/src/gui/components/organisms/IdentityNoise/Triad/me/me.tsx +0 -0
- package/src/gui/components/organisms/organisms.ts +15 -0
- package/src/gui/contexts/InsetsContext.tsx +40 -0
- package/src/gui/contexts/LeftSidebarContext.tsx +20 -0
- package/src/gui/contexts/RightSidebarContext.tsx +25 -0
- package/src/gui/contexts/ThemeContext.ts +34 -0
- package/src/gui/contexts/index.ts +4 -0
- package/src/gui/hooks/index.ts +11 -0
- package/src/gui/hooks/resolveColorToken.ts +39 -0
- package/src/gui/hooks/useCodeGen.ts +12 -0
- package/src/gui/hooks/useGuiMediaQuery.ts +18 -0
- package/src/gui/hooks/useGuiTheme.ts +18 -0
- package/src/gui/hooks/useInsets.ts +26 -0
- package/src/gui/hooks/useIsMobile.ts +13 -0
- package/src/gui/hooks/useIsTouchDevice.ts +25 -0
- package/src/gui/hooks/useLeftSidebar.ts +10 -0
- package/src/gui/hooks/useRightSidebar.ts +12 -0
- package/src/gui/hooks/useViewportKey.ts +19 -0
- package/src/gui/hooks/useViewportProp.ts +17 -0
- package/src/gui/registry/GuiRegistry.ts +19 -0
- package/src/gui/registry/factory.ts +12 -0
- package/src/gui/registry/index.ts +3 -0
- package/src/gui/registry/types.ts +6 -0
- package/src/gui/utils/nodeID.ts +11 -0
- package/src/registry/GuiRegistry.ts +19 -0
- package/src/stories/01.Home.mdx +22 -0
- package/src/stories/02.Understanding.This.GUI.mdx +149 -0
- package/src/stories/Theme/Palette.stories.tsx +86 -0
- package/src/stories/Theme/ThemeViewer.stories.tsx +91 -0
- package/src/stories/Theme/Typography.stories.jsx +211 -0
- package/src/stories/assets/this.GUI.png +0 -0
- package/src/types/gui.d.ts +67 -0
- package/src/types/theme.d.ts +191 -0
- package/src/types/viewport.ts +132 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
|
|
3
|
+
export type FooterLinkProps = {
|
|
4
|
+
label?: string;
|
|
5
|
+
href?: string;
|
|
6
|
+
icon?: string;
|
|
7
|
+
iconColor?: string;
|
|
8
|
+
external?: boolean;
|
|
9
|
+
onClick?: () => void;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export type FooterActionProps = {
|
|
13
|
+
label?: string;
|
|
14
|
+
icon?: string;
|
|
15
|
+
iconColor?: string;
|
|
16
|
+
onClick?: () => void;
|
|
17
|
+
element?: React.ReactNode;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export type FooterElement =
|
|
21
|
+
| { type: 'link'; props: FooterLinkProps }
|
|
22
|
+
| { type: 'action'; props: FooterActionProps };
|
|
23
|
+
|
|
24
|
+
export type FooterProps = {
|
|
25
|
+
brandLabel?: string;
|
|
26
|
+
brandLogo?: string;
|
|
27
|
+
brandHref?: string;
|
|
28
|
+
brandAvatarFallback?: string;
|
|
29
|
+
leftElements?: FooterElement[];
|
|
30
|
+
centerElements?: FooterElement[];
|
|
31
|
+
rightElements?: FooterElement[];
|
|
32
|
+
position?: 'static' | 'fixed' | 'sticky';
|
|
33
|
+
elevation?: number;
|
|
34
|
+
className?: string;
|
|
35
|
+
id?: string;
|
|
36
|
+
'data-testid'?: string;
|
|
37
|
+
sx?: any;
|
|
38
|
+
appBarSx?: any;
|
|
39
|
+
sectionSx?: any;
|
|
40
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Layout from './Layout';
|
|
3
|
+
import type { RegistryEntry } from '@/gui/registry/types';
|
|
4
|
+
import type { LayoutSpec } from './Layout.types';
|
|
5
|
+
/**
|
|
6
|
+
* The LayoutResolver dynamically constructs a responsive layout
|
|
7
|
+
* using declarative JSON configuration.
|
|
8
|
+
*
|
|
9
|
+
* It resolves topBar, sidebars, footer, and content sections
|
|
10
|
+
* by passing their configs into the Layout component.
|
|
11
|
+
*/
|
|
12
|
+
const LayoutResolver: RegistryEntry = {
|
|
13
|
+
type: 'Layout',
|
|
14
|
+
resolve(spec: LayoutSpec) {
|
|
15
|
+
const props = spec.props ?? {};
|
|
16
|
+
const contentSections = spec.Content ?? [];
|
|
17
|
+
return (
|
|
18
|
+
<Layout
|
|
19
|
+
{...props}
|
|
20
|
+
>
|
|
21
|
+
{contentSections.map((section, index) => (
|
|
22
|
+
<React.Fragment key={index}>
|
|
23
|
+
{Array.isArray(section.children)
|
|
24
|
+
? section.children.map((child, i) => (
|
|
25
|
+
<div key={`${index}-${i}`} {...(child.props ?? {})}>
|
|
26
|
+
{child.type}
|
|
27
|
+
</div>
|
|
28
|
+
))
|
|
29
|
+
: null}
|
|
30
|
+
</React.Fragment>
|
|
31
|
+
))}
|
|
32
|
+
</Layout>
|
|
33
|
+
);
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export default LayoutResolver;
|
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { Meta, StoryFn, StoryObj } from "@storybook/react";
|
|
3
|
+
import Layout from "./Layout";
|
|
4
|
+
import Page from '@/gui/components/molecules/Page/Page';
|
|
5
|
+
import ThemeModeToggle from "@/gui/components/molecules/Theme/ThemeModeToggle/ThemeModeToggle";
|
|
6
|
+
const meta: Meta<typeof Layout> = {
|
|
7
|
+
title: "Layout/Layout",
|
|
8
|
+
component: Layout,
|
|
9
|
+
tags: ["autodocs"],
|
|
10
|
+
parameters: {
|
|
11
|
+
docs: {
|
|
12
|
+
description: {
|
|
13
|
+
component: `
|
|
14
|
+
The **Layout** component wires the responsive shell used across This.GUI demos. It coordinates the TopBar, left/right sidebars, and Footer so their insets remain in sync while your application content renders inside.
|
|
15
|
+
---
|
|
16
|
+
## Features
|
|
17
|
+
- **Context wiring** – wraps children with the required providers (LeftSidebar, RightSidebar) so hooks and insets work automatically.
|
|
18
|
+
- **Composable regions** – optional \`topBarConfig\`, \`leftSidebarConfig\`, \`rightSidebarConfig\`, and \`footerConfig\` let you enable only what you need.
|
|
19
|
+
- **Inset aware** – whenever a sidebar expands or collapses, the layout updates theme insets so the TopBar/Footer and main content stay aligned.
|
|
20
|
+
- **Story-friendly** – serves as an orchestration helper in Storybook; in production you can lift the same pattern to your app shell.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
## Declarative usage
|
|
24
|
+
~~~json
|
|
25
|
+
{
|
|
26
|
+
"type": "Layout",
|
|
27
|
+
"props": {
|
|
28
|
+
"topBarConfig": {
|
|
29
|
+
"title": "Workspace",
|
|
30
|
+
"elementsRight": [
|
|
31
|
+
{
|
|
32
|
+
"type": "action",
|
|
33
|
+
"props": {
|
|
34
|
+
"element": "ThemeModeToggle"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
},
|
|
39
|
+
"leftSidebarConfig": {
|
|
40
|
+
"elements": [
|
|
41
|
+
{
|
|
42
|
+
"type": "link",
|
|
43
|
+
"props": {
|
|
44
|
+
"label": "Dashboard",
|
|
45
|
+
"icon": "dashboard"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"type": "menu",
|
|
50
|
+
"props": {
|
|
51
|
+
"label": "Projects",
|
|
52
|
+
"icon": "folder",
|
|
53
|
+
"items": [
|
|
54
|
+
{
|
|
55
|
+
"label": "Project A",
|
|
56
|
+
"icon": "work"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"label": "Project B",
|
|
60
|
+
"icon": "assignment"
|
|
61
|
+
}
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
]
|
|
66
|
+
},
|
|
67
|
+
"footerConfig": {
|
|
68
|
+
"brandLabel": "Neuroverse",
|
|
69
|
+
"centerElements": [
|
|
70
|
+
{
|
|
71
|
+
"type": "link",
|
|
72
|
+
"props": {
|
|
73
|
+
"label": "Docs",
|
|
74
|
+
"href": "/docs",
|
|
75
|
+
"icon": "menu_book"
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
"Content": [
|
|
82
|
+
{
|
|
83
|
+
"children": [
|
|
84
|
+
{
|
|
85
|
+
"type": "Section",
|
|
86
|
+
"props": {
|
|
87
|
+
"title": "Overview"
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"type": "Card",
|
|
92
|
+
"props": {
|
|
93
|
+
"title": "AI Metrics"
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
]
|
|
97
|
+
}
|
|
98
|
+
]
|
|
99
|
+
}
|
|
100
|
+
~~~
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
## React usage
|
|
104
|
+
Use the layout as a shell around your routes or dashboard pages. Pass config objects when you need a region; use \`false\` to omit it.
|
|
105
|
+
~~~tsx
|
|
106
|
+
function DashboardPage() {
|
|
107
|
+
return (
|
|
108
|
+
<Layout
|
|
109
|
+
topBarConfig={{
|
|
110
|
+
title: "Analytics",
|
|
111
|
+
elementsRight: [
|
|
112
|
+
{ type: "action", props: { element: <ThemeModeToggle variant="minimal" /> } },
|
|
113
|
+
],
|
|
114
|
+
}}
|
|
115
|
+
leftSidebarConfig={{
|
|
116
|
+
elements: [
|
|
117
|
+
{ type: "link", props: { label: "Overview", icon: "home" } },
|
|
118
|
+
{ type: "link", props: { label: "Reports", icon: "insights" } },
|
|
119
|
+
],
|
|
120
|
+
}}
|
|
121
|
+
rightSidebarConfig={{
|
|
122
|
+
elements: [
|
|
123
|
+
{ type: "link", props: { label: "Alerts", icon: "notifications" } },
|
|
124
|
+
],
|
|
125
|
+
}}
|
|
126
|
+
>
|
|
127
|
+
<Outlet />
|
|
128
|
+
</Layout>
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
~~~
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
## Notes
|
|
135
|
+
- Config objects mirror the props of the individual components (TopBar, LeftSidebar, RightSidebar, Footer). Anything you can pass there can be forwarded through the layout.
|
|
136
|
+
- Set a config to \`false\` (or omit it) to exclude that region entirely.
|
|
137
|
+
- Children render in document order beneath any enabled sidebars/top bar – for sticky layouts remember to add padding or section containers as shown below.
|
|
138
|
+
`,
|
|
139
|
+
},
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
export default meta;
|
|
145
|
+
|
|
146
|
+
const Template: StoryFn<React.ComponentProps<typeof Layout>> = (args) => (
|
|
147
|
+
<Layout {...args}>
|
|
148
|
+
<div
|
|
149
|
+
style={{
|
|
150
|
+
minHeight: "120vh",
|
|
151
|
+
padding: "72px 24px 120px",
|
|
152
|
+
display: "flex",
|
|
153
|
+
flexDirection: "column",
|
|
154
|
+
gap: 16,
|
|
155
|
+
}}
|
|
156
|
+
>
|
|
157
|
+
<h2>Responsive Layout Demo</h2>
|
|
158
|
+
<p>
|
|
159
|
+
Resize the viewport or toggle sidebars to observe how insets are coordinated.
|
|
160
|
+
The content block is intentionally tall to show how fixed bars interact with scrolling.
|
|
161
|
+
</p>
|
|
162
|
+
</div>
|
|
163
|
+
</Layout>
|
|
164
|
+
);
|
|
165
|
+
|
|
166
|
+
type Story = StoryObj<typeof Layout>;
|
|
167
|
+
|
|
168
|
+
export const TopOnly: Story = {
|
|
169
|
+
render: Template,
|
|
170
|
+
args: {
|
|
171
|
+
topBarConfig: {
|
|
172
|
+
title: "Neuroverse",
|
|
173
|
+
elementsRight: [
|
|
174
|
+
{
|
|
175
|
+
type: "action",
|
|
176
|
+
props: {
|
|
177
|
+
element: <ThemeModeToggle variant="minimal" show="icons" iconSize="small" />,
|
|
178
|
+
},
|
|
179
|
+
},
|
|
180
|
+
],
|
|
181
|
+
},
|
|
182
|
+
leftSidebarConfig: false,
|
|
183
|
+
rightSidebarConfig: false,
|
|
184
|
+
footerConfig: false,
|
|
185
|
+
},
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
export const TopWithLeftSidebar: Story = {
|
|
189
|
+
render: Template,
|
|
190
|
+
args: {
|
|
191
|
+
...TopOnly.args,
|
|
192
|
+
leftSidebarConfig: {
|
|
193
|
+
elements: [
|
|
194
|
+
{ type: "link", props: { label: "Overview", icon: "dashboard" } },
|
|
195
|
+
{
|
|
196
|
+
type: "menu",
|
|
197
|
+
props: {
|
|
198
|
+
label: "Projects",
|
|
199
|
+
icon: "folder",
|
|
200
|
+
items: [
|
|
201
|
+
{ label: "Project Alpha", icon: "work" },
|
|
202
|
+
{ label: "Project Beta", icon: "assignment" },
|
|
203
|
+
],
|
|
204
|
+
},
|
|
205
|
+
},
|
|
206
|
+
],
|
|
207
|
+
footerElements: [
|
|
208
|
+
{ type: "link", props: { label: "Settings", icon: "settings" } },
|
|
209
|
+
],
|
|
210
|
+
},
|
|
211
|
+
},
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
export const TopWithLeftAndRight: Story = {
|
|
215
|
+
render: Template,
|
|
216
|
+
args: {
|
|
217
|
+
...TopWithLeftSidebar.args,
|
|
218
|
+
rightSidebarConfig: {
|
|
219
|
+
elements: [
|
|
220
|
+
{ type: "link", props: { label: "Activity", icon: "history" } },
|
|
221
|
+
{ type: "action", props: { label: "Export", icon: "download" } },
|
|
222
|
+
],
|
|
223
|
+
},
|
|
224
|
+
},
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
export const FullShellWithFooter: Story = {
|
|
228
|
+
render: Template,
|
|
229
|
+
args: {
|
|
230
|
+
...TopWithLeftAndRight.args,
|
|
231
|
+
footerConfig: {
|
|
232
|
+
brandLabel: "Neuroverse",
|
|
233
|
+
brandLogo: "https://neurons.me/neurons.me.png",
|
|
234
|
+
centerElements: [
|
|
235
|
+
{ type: "link", props: { label: "Docs", href: "/docs", icon: "menu_book", iconColor: "var(--gui-primary)" } },
|
|
236
|
+
{ type: "link", props: { label: "API", href: "/api", icon: "code", iconColor: "var(--gui-secondary)" } },
|
|
237
|
+
],
|
|
238
|
+
rightElements: [
|
|
239
|
+
{ type: "link", props: { label: "Community", href: "https://community.neuroverse.ai", icon: "forum", iconColor: "var(--gui-info)", external: true } },
|
|
240
|
+
{ type: "link", props: { label: "GitHub", href: "https://github.com", icon: "code", iconColor: "var(--gui-warning)", external: true } },
|
|
241
|
+
],
|
|
242
|
+
position: "fixed",
|
|
243
|
+
},
|
|
244
|
+
},
|
|
245
|
+
};
|
|
246
|
+
|
|
247
|
+
export const ContentOnly: Story = {
|
|
248
|
+
render: Template,
|
|
249
|
+
args: {
|
|
250
|
+
topBarConfig: false,
|
|
251
|
+
leftSidebarConfig: false,
|
|
252
|
+
rightSidebarConfig: false,
|
|
253
|
+
footerConfig: false,
|
|
254
|
+
},
|
|
255
|
+
};
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
export const LayoutWithPage: Story = {
|
|
259
|
+
render: () => (
|
|
260
|
+
<Layout
|
|
261
|
+
topBarConfig={{ title: 'Neuroverse Workspace' }}
|
|
262
|
+
leftSidebarConfig={{
|
|
263
|
+
elements: [
|
|
264
|
+
{ type: 'link', props: { label: 'Home', icon: 'home' } },
|
|
265
|
+
{ type: 'link', props: { label: 'Analytics', icon: 'insights' } },
|
|
266
|
+
],
|
|
267
|
+
}}
|
|
268
|
+
rightSidebarConfig={{
|
|
269
|
+
elements: [
|
|
270
|
+
{ type: 'link', props: { label: 'Chat', icon: 'chat' } },
|
|
271
|
+
],
|
|
272
|
+
}}
|
|
273
|
+
footerConfig={{
|
|
274
|
+
brandLabel: 'Neuroverse',
|
|
275
|
+
centerElements: [
|
|
276
|
+
{ type: 'link', props: { label: 'Docs', icon: 'menu_book' } },
|
|
277
|
+
],
|
|
278
|
+
}}
|
|
279
|
+
>
|
|
280
|
+
<Page background="linear-gradient(135deg, #0a192f, #172a45)" padding={4}>
|
|
281
|
+
<h2 style={{ color: 'white', marginBottom: 16 }}>Page inside Layout</h2>
|
|
282
|
+
<p style={{ color: 'white', maxWidth: 600 }}>
|
|
283
|
+
This example shows how a Page component can be used inside the responsive Layout,
|
|
284
|
+
automatically adapting to inset updates from the TopBar, sidebars, and Footer.
|
|
285
|
+
</p>
|
|
286
|
+
</Page>
|
|
287
|
+
</Layout>
|
|
288
|
+
),
|
|
289
|
+
};
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
// Layout/Layout/Layout.tsx
|
|
2
|
+
import { LeftSidebarProvider } from '@/gui/contexts/LeftSidebarContext';
|
|
3
|
+
import { RightSidebarProvider } from '@/gui/contexts/RightSidebarContext';
|
|
4
|
+
import Box from '@/gui/atoms/Box/Box';
|
|
5
|
+
import TopBar from '@/gui/Theme/Layout/TopBar/TopBar';
|
|
6
|
+
import LeftSidebar from '@/gui/Theme/Layout/Sidebars/LeftSidebar/LeftSidebar';
|
|
7
|
+
import RightSidebar from '@/gui/Theme/Layout/Sidebars/RightSidebar/RightSidebar';
|
|
8
|
+
import Footer from '@/gui/Theme/Layout/Footer/Footer';
|
|
9
|
+
import Namespace from '@/gui/Theme/Layout/Namespace/Namespace';
|
|
10
|
+
import Content from '@/gui/Theme/Layout/Content/Content';
|
|
11
|
+
import type { LayoutProps } from './Layout.types';
|
|
12
|
+
function Layout({
|
|
13
|
+
topBarConfig = false,
|
|
14
|
+
leftSidebarConfig = false,
|
|
15
|
+
rightSidebarConfig = false,
|
|
16
|
+
footerConfig = false,
|
|
17
|
+
children,
|
|
18
|
+
}: LayoutProps) {
|
|
19
|
+
const hasTopBar = Boolean(topBarConfig);
|
|
20
|
+
const hasLeftSidebar = Boolean(leftSidebarConfig);
|
|
21
|
+
const hasRightSidebar = Boolean(rightSidebarConfig);
|
|
22
|
+
const leftInitialView =
|
|
23
|
+
typeof leftSidebarConfig === 'object' && 'initialView' in leftSidebarConfig
|
|
24
|
+
? leftSidebarConfig.initialView
|
|
25
|
+
: undefined;
|
|
26
|
+
const rightInitialView =
|
|
27
|
+
typeof rightSidebarConfig === 'object' && 'initialView' in rightSidebarConfig
|
|
28
|
+
? rightSidebarConfig.initialView
|
|
29
|
+
: undefined;
|
|
30
|
+
return (
|
|
31
|
+
<LeftSidebarProvider initialView={leftInitialView}>
|
|
32
|
+
<RightSidebarProvider initialView={rightInitialView}>
|
|
33
|
+
<Box
|
|
34
|
+
id="layout-root"
|
|
35
|
+
sx={{ display: 'flex', flexDirection: 'column', minHeight: '100vh' }}
|
|
36
|
+
>
|
|
37
|
+
{hasTopBar && (
|
|
38
|
+
<TopBar
|
|
39
|
+
{...(typeof topBarConfig === 'object'
|
|
40
|
+
? (() => {
|
|
41
|
+
const { showMenuButton, brandLogo, ...rest } = topBarConfig as any;
|
|
42
|
+
return {
|
|
43
|
+
...rest,
|
|
44
|
+
// Convention: use `brandLogo` as the config field, but TopBar expects `logo`.
|
|
45
|
+
...(brandLogo ? { logo: brandLogo } : {}),
|
|
46
|
+
};
|
|
47
|
+
})()
|
|
48
|
+
: {})}
|
|
49
|
+
/>
|
|
50
|
+
)}
|
|
51
|
+
<Box sx={{ display: 'flex', flex: 1 }}>
|
|
52
|
+
{hasLeftSidebar && (
|
|
53
|
+
<LeftSidebar
|
|
54
|
+
elements={[]}
|
|
55
|
+
{...(typeof leftSidebarConfig === 'object' ? leftSidebarConfig : {})}
|
|
56
|
+
/>
|
|
57
|
+
)}
|
|
58
|
+
<Content>
|
|
59
|
+
{children ?? <Namespace />}
|
|
60
|
+
</Content>
|
|
61
|
+
{hasRightSidebar && (
|
|
62
|
+
<RightSidebar
|
|
63
|
+
elements={[]}
|
|
64
|
+
{...(typeof rightSidebarConfig === 'object' ? rightSidebarConfig : {})}
|
|
65
|
+
/>
|
|
66
|
+
)}
|
|
67
|
+
</Box>
|
|
68
|
+
{footerConfig && (
|
|
69
|
+
<Footer
|
|
70
|
+
{...(typeof footerConfig === 'object'
|
|
71
|
+
? (() => {
|
|
72
|
+
const {
|
|
73
|
+
title,
|
|
74
|
+
brandLabel,
|
|
75
|
+
brandLogo,
|
|
76
|
+
brandHref,
|
|
77
|
+
brandAvatarFallback,
|
|
78
|
+
leftElements,
|
|
79
|
+
centerElements,
|
|
80
|
+
rightElements,
|
|
81
|
+
position,
|
|
82
|
+
elevation,
|
|
83
|
+
className,
|
|
84
|
+
id,
|
|
85
|
+
sx,
|
|
86
|
+
appBarSx,
|
|
87
|
+
sectionSx,
|
|
88
|
+
'data-testid': dataTestId,
|
|
89
|
+
} = footerConfig;
|
|
90
|
+
return {
|
|
91
|
+
brandLabel: brandLabel ?? title,
|
|
92
|
+
brandLogo,
|
|
93
|
+
brandHref,
|
|
94
|
+
brandAvatarFallback,
|
|
95
|
+
leftElements,
|
|
96
|
+
centerElements,
|
|
97
|
+
rightElements,
|
|
98
|
+
position,
|
|
99
|
+
elevation,
|
|
100
|
+
className,
|
|
101
|
+
id,
|
|
102
|
+
sx,
|
|
103
|
+
appBarSx,
|
|
104
|
+
sectionSx,
|
|
105
|
+
'data-testid': dataTestId,
|
|
106
|
+
};
|
|
107
|
+
})()
|
|
108
|
+
: {})}
|
|
109
|
+
/>
|
|
110
|
+
)}
|
|
111
|
+
</Box>
|
|
112
|
+
</RightSidebarProvider>
|
|
113
|
+
</LeftSidebarProvider>
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export default Layout;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
//@/gui/layouts/ResponsiveUI/Layout/Layout.types.ts
|
|
2
|
+
import type { FooterElement } from '@/gui/Layouts/ResponsiveUI/Footer/Footer.types';
|
|
3
|
+
|
|
4
|
+
export interface TopBarConfig {
|
|
5
|
+
showMenuButton?: boolean;
|
|
6
|
+
[key: string]: any;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface LeftSidebarConfig {
|
|
10
|
+
[key: string]: any;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface RightSidebarConfig {
|
|
14
|
+
[key: string]: any;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface FooterConfig {
|
|
18
|
+
title?: string;
|
|
19
|
+
brandLabel?: string;
|
|
20
|
+
brandLogo?: string;
|
|
21
|
+
brandHref?: string;
|
|
22
|
+
brandAvatarFallback?: string;
|
|
23
|
+
leftElements?: FooterElement[];
|
|
24
|
+
centerElements?: FooterElement[];
|
|
25
|
+
rightElements?: FooterElement[];
|
|
26
|
+
position?: 'static' | 'fixed' | 'sticky';
|
|
27
|
+
elevation?: number;
|
|
28
|
+
className?: string;
|
|
29
|
+
id?: string;
|
|
30
|
+
'data-testid'?: string;
|
|
31
|
+
sx?: any;
|
|
32
|
+
appBarSx?: any;
|
|
33
|
+
sectionSx?: any;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface LayoutProps {
|
|
37
|
+
topBarConfig?: TopBarConfig | boolean;
|
|
38
|
+
leftSidebarConfig?: LeftSidebarConfig | boolean;
|
|
39
|
+
rightSidebarConfig?: RightSidebarConfig | boolean;
|
|
40
|
+
footerConfig?: FooterConfig | boolean;
|
|
41
|
+
children?: React.ReactNode;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface ContentChild {
|
|
45
|
+
type: string;
|
|
46
|
+
props?: Record<string, any>;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface ContentProps {
|
|
50
|
+
children?: ContentChild[];
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface LayoutSpec {
|
|
54
|
+
type: 'Layout';
|
|
55
|
+
props?: LayoutProps;
|
|
56
|
+
Content?: ContentProps[];
|
|
57
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { useGuiMediaQuery, useGuiTheme } from '@/gui/hooks';
|
|
2
|
+
|
|
3
|
+
export function useLayoutBreakpoints() {
|
|
4
|
+
const theme = useGuiTheme();
|
|
5
|
+
const isMobile = useGuiMediaQuery(theme.breakpoints.down('md'));
|
|
6
|
+
const isTablet = useGuiMediaQuery(theme.breakpoints.between('md', 'lg'));
|
|
7
|
+
const isDesktop = useGuiMediaQuery(theme.breakpoints.up('lg'));
|
|
8
|
+
return { isMobile, isTablet, isDesktop };
|
|
9
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
3
|
+
|
|
4
|
+
import Namespace from "./Namespace";
|
|
5
|
+
import { GuiProvider } from "@/gui/Theme/GuiProvider";
|
|
6
|
+
|
|
7
|
+
function withPath(path: string) {
|
|
8
|
+
return (Story: any) => {
|
|
9
|
+
// If Storybook (or your preview) already wraps stories in a Router,
|
|
10
|
+
// we must NOT render another Router here.
|
|
11
|
+
// Pushing a new history state is enough for BrowserRouter to pick up the path.
|
|
12
|
+
if (typeof window !== "undefined") {
|
|
13
|
+
window.history.pushState({}, "", path);
|
|
14
|
+
}
|
|
15
|
+
return <Story />;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const meta: Meta<typeof Namespace> = {
|
|
20
|
+
title: "Layout/Namespace",
|
|
21
|
+
component: Namespace,
|
|
22
|
+
tags: ["autodocs"],
|
|
23
|
+
parameters: {
|
|
24
|
+
docs: {
|
|
25
|
+
description: {
|
|
26
|
+
component: `
|
|
27
|
+
The **Namespace** component is a tiny route resolver used inside the This.GUI layout shell.
|
|
28
|
+
It reads the current URL **pathname** and decides which **namespace view** to render.
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
## What it does
|
|
32
|
+
- Uses React Router (\`useLocation()\`) to read the current path.
|
|
33
|
+
- Displays a simple **Unknown namespace** fallback that reflects the current pathname.
|
|
34
|
+
- Useful as a placeholder outlet while namespace routing is being designed.
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
## When to use
|
|
38
|
+
- As an internal “outlet” for layout shells that want to map namespaces/paths to organism-level views.
|
|
39
|
+
- In Storybook to quickly test how new namespaces resolve without wiring a full app router.
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
## Notes
|
|
43
|
+
- These stories assume Storybook (or your app shell) already provides a Router. The story uses \`window.history.pushState\` to simulate navigation.
|
|
44
|
+
`,
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export default meta;
|
|
51
|
+
|
|
52
|
+
type Story = StoryObj<typeof Namespace>;
|
|
53
|
+
|
|
54
|
+
function Shell({ children }: { children: React.ReactNode }) {
|
|
55
|
+
return (
|
|
56
|
+
<GuiProvider>
|
|
57
|
+
<div
|
|
58
|
+
style={{
|
|
59
|
+
minHeight: "100vh",
|
|
60
|
+
display: "flex",
|
|
61
|
+
flexDirection: "column",
|
|
62
|
+
}}
|
|
63
|
+
>
|
|
64
|
+
{children}
|
|
65
|
+
</div>
|
|
66
|
+
</GuiProvider>
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export const RootNamespace: Story = {
|
|
71
|
+
decorators: [withPath("/")],
|
|
72
|
+
render: () => (
|
|
73
|
+
<Shell>
|
|
74
|
+
<Namespace />
|
|
75
|
+
</Shell>
|
|
76
|
+
),
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
export const VisorNamespace: Story = {
|
|
80
|
+
decorators: [withPath("/visor")],
|
|
81
|
+
render: () => (
|
|
82
|
+
<Shell>
|
|
83
|
+
<Namespace />
|
|
84
|
+
</Shell>
|
|
85
|
+
),
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
export const VisorNamespaceDeepPath: Story = {
|
|
89
|
+
name: "Visor (deep path)",
|
|
90
|
+
decorators: [withPath("/visor/room/AB12CD")],
|
|
91
|
+
render: () => (
|
|
92
|
+
<Shell>
|
|
93
|
+
<Namespace />
|
|
94
|
+
</Shell>
|
|
95
|
+
),
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
export const UnknownNamespace: Story = {
|
|
99
|
+
decorators: [withPath("/something/else")],
|
|
100
|
+
render: () => (
|
|
101
|
+
<Shell>
|
|
102
|
+
<Namespace />
|
|
103
|
+
</Shell>
|
|
104
|
+
),
|
|
105
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// Layout/Namespace/Namespace.tsx
|
|
2
|
+
import React, { useMemo } from 'react';
|
|
3
|
+
import { useLocation } from 'react-router-dom';
|
|
4
|
+
import { Box, Typography } from '@/gui/components/atoms/atoms';
|
|
5
|
+
// Import concrete blocks/views you want to render
|
|
6
|
+
type Resolved =
|
|
7
|
+
| { kind: 'unknown'; path: string };
|
|
8
|
+
function resolve(pathname: string): Resolved {
|
|
9
|
+
return { kind: 'unknown', path: pathname };
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export default function Namespace() {
|
|
13
|
+
const { pathname } = useLocation();
|
|
14
|
+
const resolved = useMemo(() => resolve(pathname), [pathname]);
|
|
15
|
+
return (
|
|
16
|
+
<Box sx={{ p: 2 }}>
|
|
17
|
+
<Typography sx={{ fontWeight: 800 }}>Namespace</Typography>
|
|
18
|
+
<Typography sx={{ opacity: 0.75, fontFamily: 'monospace' }}>
|
|
19
|
+
{resolved.path}
|
|
20
|
+
</Typography>
|
|
21
|
+
<Typography sx={{ mt: 1, opacity: 0.7 }}>
|
|
22
|
+
View not wired yet.
|
|
23
|
+
</Typography>
|
|
24
|
+
</Box>
|
|
25
|
+
);
|
|
26
|
+
}
|