this.gui 1.3.41 → 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/package.json +3 -2
- 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,239 @@
|
|
|
1
|
+
import { StoryFn } from "@storybook/react";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import Layout from "@/gui/Theme/Layout/Layout/Layout";
|
|
4
|
+
import ThemeModeToggle from "@/gui/components/molecules/Theme/ThemeModeToggle/ThemeModeToggle";
|
|
5
|
+
export default {
|
|
6
|
+
title: "Layout/Sidebars/RightSidebar",
|
|
7
|
+
component: Layout,
|
|
8
|
+
tags: ['autodocs'],
|
|
9
|
+
parameters: {
|
|
10
|
+
docs: {
|
|
11
|
+
description: {
|
|
12
|
+
component:
|
|
13
|
+
`The **RightSidebar** component mirrors the LeftSidebar experience on the opposite edge of the screen. Use it for complementary tools, contextual insights, and secondary actions without losing alignment with the primary content area.
|
|
14
|
+
---
|
|
15
|
+
## Features
|
|
16
|
+
- **Rail-first orientation:** Defaults to a compact 72px rail so charts or documents remain visible.
|
|
17
|
+
- **Expandable workspace:** Switch to a wide panel (264px) for verbose content, filters, or inspectors.
|
|
18
|
+
- **Mobile-friendly drawer:** On small screens it becomes a temporary drawer that slides over content from the right.
|
|
19
|
+
- **Footer actions:** Accepts \`footerElements\` so pinned tools (settings, help) stay reachable.
|
|
20
|
+
- **Inset synchronization:** Updates \`theme.layout.insets.right\` so TopBar and other surfaces adapt automatically.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
## Layout Modes
|
|
24
|
+
- \`rail\`: icon-only column hugging the right edge.
|
|
25
|
+
- \`expanded\`: full-width tools panel with labels and nested menus.
|
|
26
|
+
- \`mobile\`: overlay drawer controlled by a floating button.
|
|
27
|
+
Modes can be toggled programmatically via \`useRightSidebar()\` or automatically through built-in breakpoints.
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
## Props
|
|
31
|
+
- \`elements?: RightSidebarElement[]\` — Declarative items (\`link\`, \`menu\`, \`action\`) rendered in order.
|
|
32
|
+
- \`footerElements?: RightSidebarElement[]\` — Optional sticky footer actions.
|
|
33
|
+
- \`initialView?: 'rail' | 'expanded' | 'mobile'\` — Starting mode (defaults to \`rail\`).
|
|
34
|
+
- \`className?\` and other DOM props are forwarded to the root \`aside\`.
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
## Declarative usage
|
|
38
|
+
~~~tsx
|
|
39
|
+
import RightSidebar from '@/gui/Layouts/ResponsiveUI/Sidebars/RightSidebar/RightSidebar';
|
|
40
|
+
|
|
41
|
+
<RightSidebar
|
|
42
|
+
elements={[
|
|
43
|
+
{ type: 'link', props: { label: 'Notifications', icon: 'notifications' } },
|
|
44
|
+
{ type: 'link', props: { label: 'Activity', icon: 'history' } },
|
|
45
|
+
{
|
|
46
|
+
type: 'menu',
|
|
47
|
+
props: {
|
|
48
|
+
label: 'Views',
|
|
49
|
+
icon: 'view_cozy',
|
|
50
|
+
items: [
|
|
51
|
+
{ label: 'Timeline', icon: 'timeline' },
|
|
52
|
+
{ label: 'JSON', icon: 'code' },
|
|
53
|
+
],
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
]}
|
|
57
|
+
footerElements={[
|
|
58
|
+
{ type: 'link', props: { label: 'Settings', icon: 'settings' } },
|
|
59
|
+
{ type: 'action', props: { label: 'Support', icon: 'help' } },
|
|
60
|
+
]}
|
|
61
|
+
/>;
|
|
62
|
+
~~~
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
## React usage
|
|
66
|
+
Combine the context provider and hook to manage the view explicitly:
|
|
67
|
+
~~~tsx
|
|
68
|
+
import { RightSidebarProvider } from '@/gui/contexts';
|
|
69
|
+
import { useRightSidebar } from '@/gui/hooks';
|
|
70
|
+
import RightSidebar from '@/gui/Layouts/ResponsiveUI/Sidebars/RightSidebar/RightSidebar';
|
|
71
|
+
|
|
72
|
+
const items = [{ type: 'link', props: { label: 'History', icon: 'history' } }];
|
|
73
|
+
|
|
74
|
+
function Inspector() {
|
|
75
|
+
const { view, setView } = useRightSidebar();
|
|
76
|
+
return (
|
|
77
|
+
<>
|
|
78
|
+
<button onClick={() => setView(view === 'expanded' ? 'rail' : 'expanded')}>
|
|
79
|
+
Toggle inspector
|
|
80
|
+
</button>
|
|
81
|
+
<RightSidebar elements={items} />
|
|
82
|
+
</>
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export function InspectorShell() {
|
|
87
|
+
return (
|
|
88
|
+
<RightSidebarProvider>
|
|
89
|
+
<Inspector />
|
|
90
|
+
</RightSidebarProvider>
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
~~~
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
## Notes
|
|
97
|
+
- The floating toggle only appears in mobile mode; closing the drawer restores the underlying layout insets.
|
|
98
|
+
- Footer elements share the same declarative shape as main items, so you can reuse links or action buttons.
|
|
99
|
+
- Works seamlessly alongside \`LeftSidebar\` and \`TopBar\` when using the responsive Layout shell.
|
|
100
|
+
`,
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
const Template: StoryFn<React.ComponentProps<typeof Layout>> = (args) => (
|
|
107
|
+
<Layout {...args} />
|
|
108
|
+
);
|
|
109
|
+
|
|
110
|
+
export const Default = Template.bind({});
|
|
111
|
+
Default.args = {
|
|
112
|
+
topBarConfig: {
|
|
113
|
+
title: "Analytics",
|
|
114
|
+
elementsRight: [
|
|
115
|
+
{
|
|
116
|
+
type: "action",
|
|
117
|
+
props: {
|
|
118
|
+
element: <ThemeModeToggle variant="minimal" show="icons" iconSize="small" />,
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
{ type: "action", props: { label: "Share", icon: "ios_share", iconColor: "var(--gui-primary)" } },
|
|
122
|
+
],
|
|
123
|
+
},
|
|
124
|
+
rightSidebarConfig: {
|
|
125
|
+
elements: [
|
|
126
|
+
{ type: "link", props: { label: "Notifications", icon: "notifications", iconColor: "var(--gui-warning)" } },
|
|
127
|
+
{ type: "link", props: { label: "Activity", icon: "history", iconColor: "var(--gui-secondary)" } },
|
|
128
|
+
{
|
|
129
|
+
type: "menu",
|
|
130
|
+
props: {
|
|
131
|
+
label: "Views",
|
|
132
|
+
icon: "view_cozy",
|
|
133
|
+
iconColor: "var(--gui-primary)",
|
|
134
|
+
items: [
|
|
135
|
+
{ label: "Timeline", icon: "timeline", iconColor: "var(--gui-success)" },
|
|
136
|
+
{ label: "JSON", icon: "code", iconColor: "var(--gui-info)" },
|
|
137
|
+
],
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
{ type: "action", props: { label: "Download", icon: "download", iconColor: "var(--gui-primary)" } },
|
|
141
|
+
],
|
|
142
|
+
},
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
export const WithFooter = Template.bind({});
|
|
146
|
+
WithFooter.args = {
|
|
147
|
+
topBarConfig: {
|
|
148
|
+
title: "Analytics",
|
|
149
|
+
elementsRight: [
|
|
150
|
+
{
|
|
151
|
+
type: "action",
|
|
152
|
+
props: {
|
|
153
|
+
element: <ThemeModeToggle variant="minimal" show="icons" iconSize="small" />,
|
|
154
|
+
},
|
|
155
|
+
},
|
|
156
|
+
{ type: "action", props: { label: "Share", icon: "ios_share", iconColor: "var(--gui-primary)" } },
|
|
157
|
+
],
|
|
158
|
+
},
|
|
159
|
+
rightSidebarConfig: {
|
|
160
|
+
elements: [
|
|
161
|
+
{ type: "link", props: { label: "Notifications", icon: "notifications", iconColor: "var(--gui-warning)" } },
|
|
162
|
+
{ type: "link", props: { label: "Activity", icon: "history", iconColor: "var(--gui-secondary)" } },
|
|
163
|
+
{
|
|
164
|
+
type: "menu",
|
|
165
|
+
props: {
|
|
166
|
+
label: "Views",
|
|
167
|
+
icon: "view_cozy",
|
|
168
|
+
iconColor: "var(--gui-primary)",
|
|
169
|
+
items: [
|
|
170
|
+
{ label: "Timeline", icon: "timeline", iconColor: "var(--gui-success)" },
|
|
171
|
+
{ label: "JSON", icon: "code", iconColor: "var(--gui-info)" },
|
|
172
|
+
],
|
|
173
|
+
},
|
|
174
|
+
},
|
|
175
|
+
{ type: "action", props: { label: "Download", icon: "download", iconColor: "var(--gui-primary)" } },
|
|
176
|
+
],
|
|
177
|
+
footerElements: [
|
|
178
|
+
{ type: "link", props: { label: "Settings", icon: "settings", iconColor: "var(--gui-secondary)" } },
|
|
179
|
+
{ type: "action", props: { label: "Support", icon: "help", iconColor: "var(--gui-success)" } },
|
|
180
|
+
],
|
|
181
|
+
},
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
export const WithBothSidebars = Template.bind({});
|
|
185
|
+
WithBothSidebars.args = {
|
|
186
|
+
topBarConfig: {
|
|
187
|
+
title: "Analytics",
|
|
188
|
+
elementsRight: [
|
|
189
|
+
{
|
|
190
|
+
type: "action",
|
|
191
|
+
props: {
|
|
192
|
+
element: <ThemeModeToggle variant="minimal" show="icons" iconSize="small" />,
|
|
193
|
+
},
|
|
194
|
+
},
|
|
195
|
+
{ type: "action", props: { label: "Share", icon: "ios_share", iconColor: "var(--gui-primary)" } },
|
|
196
|
+
],
|
|
197
|
+
},
|
|
198
|
+
leftSidebarConfig: {
|
|
199
|
+
elements: [
|
|
200
|
+
{ type: "link", props: { label: "Dashboard", icon: "dashboard", iconColor: "var(--gui-primary)" } },
|
|
201
|
+
{
|
|
202
|
+
type: "menu",
|
|
203
|
+
props: {
|
|
204
|
+
label: "Projects",
|
|
205
|
+
icon: "folder",
|
|
206
|
+
iconColor: "var(--gui-secondary)",
|
|
207
|
+
items: [
|
|
208
|
+
{ label: "Project A", icon: "folder_open" },
|
|
209
|
+
{ label: "Project B", icon: "folder_open" },
|
|
210
|
+
],
|
|
211
|
+
},
|
|
212
|
+
},
|
|
213
|
+
{ type: "action", props: { label: "Create", icon: "add_circle", iconColor: "var(--gui-success)" } },
|
|
214
|
+
],
|
|
215
|
+
footerElements: [
|
|
216
|
+
{ type: "link", props: { label: "Settings", icon: "settings", iconColor: "var(--gui-secondary)" } },
|
|
217
|
+
{ type: "action", props: { label: "Help", icon: "help_outline", iconColor: "var(--gui-info)" } },
|
|
218
|
+
],
|
|
219
|
+
},
|
|
220
|
+
rightSidebarConfig: {
|
|
221
|
+
elements: [
|
|
222
|
+
{ type: "link", props: { label: "Notifications", icon: "notifications", iconColor: "var(--gui-warning)" } },
|
|
223
|
+
{ type: "link", props: { label: "Activity", icon: "history", iconColor: "var(--gui-secondary)" } },
|
|
224
|
+
{
|
|
225
|
+
type: "menu",
|
|
226
|
+
props: {
|
|
227
|
+
label: "Views",
|
|
228
|
+
icon: "view_cozy",
|
|
229
|
+
iconColor: "var(--gui-primary)",
|
|
230
|
+
items: [
|
|
231
|
+
{ label: "Timeline", icon: "timeline", iconColor: "var(--gui-success)" },
|
|
232
|
+
{ label: "JSON", icon: "code", iconColor: "var(--gui-info)" },
|
|
233
|
+
],
|
|
234
|
+
},
|
|
235
|
+
},
|
|
236
|
+
{ type: "action", props: { label: "Download", icon: "download", iconColor: "var(--gui-primary)" } },
|
|
237
|
+
],
|
|
238
|
+
},
|
|
239
|
+
};
|
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
import clsx from 'clsx';
|
|
2
|
+
import { useEffect, useState, useRef } from 'react';
|
|
3
|
+
import IconButton from '@mui/material/IconButton';
|
|
4
|
+
import Icon from '@/gui/Theme/Icon/Icon';
|
|
5
|
+
import { Box, Drawer } from '@/gui/components/atoms';
|
|
6
|
+
import { useRightSidebar, useGuiTheme, useGuiMediaQuery, useUpdateInsets, useInsets } from '@/gui/hooks';
|
|
7
|
+
import type { RightSidebarView } from '@/gui/contexts';
|
|
8
|
+
import type { RightSidebarElement, RightSidebarProps } from './RightSidebar.types';
|
|
9
|
+
import RightSidebarLink from './components/RightSidebarLink/RightSidebarLink';
|
|
10
|
+
import RightSidebarMenu from './components/RightSidebarMenu/RightSidebarMenu';
|
|
11
|
+
import RightSidebarAction from './components/RightSidebarAction/RightSidebarAction';
|
|
12
|
+
import RightSidebarToggleButton from './components/RightSidebarToggleButton/RightSidebarToggleButton';
|
|
13
|
+
|
|
14
|
+
const RAIL_WIDTH = 72;
|
|
15
|
+
const EXPANDED_WIDTH = 264;
|
|
16
|
+
|
|
17
|
+
const RightSidebar = ({
|
|
18
|
+
elements = [],
|
|
19
|
+
footerElements = [],
|
|
20
|
+
className,
|
|
21
|
+
initialView = 'rail',
|
|
22
|
+
id,
|
|
23
|
+
style,
|
|
24
|
+
'data-testid': dataTestId,
|
|
25
|
+
}: RightSidebarProps) => {
|
|
26
|
+
const { view, setView } = useRightSidebar();
|
|
27
|
+
const theme = useGuiTheme();
|
|
28
|
+
const isMobile = useGuiMediaQuery(theme.breakpoints.down('sm'));
|
|
29
|
+
const [mobileOpen, setMobileOpen] = useState(false);
|
|
30
|
+
const [lastNonMobileView, setLastNonMobileView] = useState<RightSidebarView>(
|
|
31
|
+
view === 'mobile' ? 'expanded' : view
|
|
32
|
+
);
|
|
33
|
+
const setInsets = useUpdateInsets();
|
|
34
|
+
const insets = useInsets();
|
|
35
|
+
const navInset = Math.max(0, Number(insets?.nav ?? insets?.top ?? 0));
|
|
36
|
+
const headerHeight = navInset > 0 ? navInset : 48;
|
|
37
|
+
const toggleOffset = (navInset > 0 ? navInset : 0) + 12;
|
|
38
|
+
const hasFooterElements = Array.isArray(footerElements) && footerElements.length > 0;
|
|
39
|
+
const initialViewApplied = useRef(false);
|
|
40
|
+
|
|
41
|
+
useEffect(() => {
|
|
42
|
+
if (typeof setInsets !== 'function') return;
|
|
43
|
+
const desired =
|
|
44
|
+
isMobile || view === 'mobile' ? 0 : view === 'expanded' ? EXPANDED_WIDTH : RAIL_WIDTH;
|
|
45
|
+
setInsets({ right: desired });
|
|
46
|
+
return () => setInsets({ right: 0 });
|
|
47
|
+
}, [isMobile, setInsets, view]);
|
|
48
|
+
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
initialViewApplied.current = false;
|
|
51
|
+
}, [initialView]);
|
|
52
|
+
|
|
53
|
+
useEffect(() => {
|
|
54
|
+
if (initialViewApplied.current) return;
|
|
55
|
+
if (initialView !== 'mobile') {
|
|
56
|
+
if (lastNonMobileView !== initialView) setLastNonMobileView(initialView);
|
|
57
|
+
if (!isMobile && view !== initialView) {
|
|
58
|
+
setView(initialView);
|
|
59
|
+
}
|
|
60
|
+
} else if (view !== 'mobile') {
|
|
61
|
+
setView('mobile');
|
|
62
|
+
}
|
|
63
|
+
initialViewApplied.current = true;
|
|
64
|
+
}, [initialView, isMobile, lastNonMobileView, setView, view]);
|
|
65
|
+
|
|
66
|
+
useEffect(() => {
|
|
67
|
+
if (view === 'expanded' || view === 'rail') {
|
|
68
|
+
setLastNonMobileView(view);
|
|
69
|
+
}
|
|
70
|
+
}, [view]);
|
|
71
|
+
|
|
72
|
+
useEffect(() => {
|
|
73
|
+
if (isMobile && view !== 'mobile') {
|
|
74
|
+
setView('mobile');
|
|
75
|
+
} else if (!isMobile && view === 'mobile') {
|
|
76
|
+
setView(lastNonMobileView);
|
|
77
|
+
}
|
|
78
|
+
}, [isMobile, lastNonMobileView, setView, view]);
|
|
79
|
+
|
|
80
|
+
useEffect(() => {
|
|
81
|
+
if (view !== 'mobile' && mobileOpen) {
|
|
82
|
+
setMobileOpen(false);
|
|
83
|
+
}
|
|
84
|
+
}, [mobileOpen, view]);
|
|
85
|
+
|
|
86
|
+
const renderElements = (items: RightSidebarElement[]) =>
|
|
87
|
+
items.map((el, idx) => {
|
|
88
|
+
if (el.type === 'link') return <RightSidebarLink key={idx} {...el.props} />;
|
|
89
|
+
if (el.type === 'menu') return <RightSidebarMenu key={idx} view={view} {...el.props} />;
|
|
90
|
+
if (el.type === 'action') return <RightSidebarAction key={idx} view={view} {...el.props} />;
|
|
91
|
+
return null;
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
const renderFooterItems = (items: RightSidebarElement[]) =>
|
|
95
|
+
items.map((el, idx) => {
|
|
96
|
+
if (el.type === 'link') return <RightSidebarLink key={`footer-link-${idx}`} {...el.props} />;
|
|
97
|
+
if (el.type === 'menu')
|
|
98
|
+
return <RightSidebarMenu key={`footer-menu-${idx}`} view={view} {...el.props} />;
|
|
99
|
+
if (el.type === 'action')
|
|
100
|
+
return <RightSidebarAction key={`footer-action-${idx}`} view={view} {...el.props} />;
|
|
101
|
+
return null;
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
if (view === 'rail') {
|
|
105
|
+
return (
|
|
106
|
+
<Box
|
|
107
|
+
component="aside"
|
|
108
|
+
className={clsx('RightSidebar', className)}
|
|
109
|
+
id={id}
|
|
110
|
+
data-testid={dataTestId}
|
|
111
|
+
style={style}
|
|
112
|
+
sx={{
|
|
113
|
+
position: 'fixed',
|
|
114
|
+
top: 0,
|
|
115
|
+
right: 0,
|
|
116
|
+
bottom: 0,
|
|
117
|
+
height: '100vh',
|
|
118
|
+
display: 'flex',
|
|
119
|
+
flexDirection: 'column',
|
|
120
|
+
width: `${RAIL_WIDTH}px`,
|
|
121
|
+
overflow: 'hidden',
|
|
122
|
+
borderLeft: '1px solid',
|
|
123
|
+
borderColor: 'divider',
|
|
124
|
+
backgroundColor: 'background.paper',
|
|
125
|
+
}}
|
|
126
|
+
>
|
|
127
|
+
<Box
|
|
128
|
+
component="header"
|
|
129
|
+
sx={{
|
|
130
|
+
flexShrink: 0,
|
|
131
|
+
borderBottom: '1px solid',
|
|
132
|
+
borderColor: 'divider',
|
|
133
|
+
height: `${headerHeight}px`,
|
|
134
|
+
display: 'flex',
|
|
135
|
+
alignItems: 'center',
|
|
136
|
+
justifyContent: 'flex-start',
|
|
137
|
+
px: 1.5,
|
|
138
|
+
py: 0,
|
|
139
|
+
gap: 1.25,
|
|
140
|
+
}}
|
|
141
|
+
>
|
|
142
|
+
<RightSidebarToggleButton
|
|
143
|
+
expanded={view === ('expanded' as any)}
|
|
144
|
+
onToggle={() => setView(view === 'rail' ? 'expanded' : 'rail')}
|
|
145
|
+
/>
|
|
146
|
+
</Box>
|
|
147
|
+
<Box sx={{ flexGrow: 1, overflowY: 'auto' }}>{renderElements(elements)}</Box>
|
|
148
|
+
{hasFooterElements && (
|
|
149
|
+
<Box
|
|
150
|
+
component="footer"
|
|
151
|
+
sx={{
|
|
152
|
+
flexShrink: 0,
|
|
153
|
+
px: 1,
|
|
154
|
+
py: 1.5,
|
|
155
|
+
borderColor: 'divider',
|
|
156
|
+
display: 'flex',
|
|
157
|
+
flexDirection: 'column',
|
|
158
|
+
gap: 0.5,
|
|
159
|
+
}}
|
|
160
|
+
>
|
|
161
|
+
{renderFooterItems(footerElements)}
|
|
162
|
+
</Box>
|
|
163
|
+
)}
|
|
164
|
+
</Box>
|
|
165
|
+
);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
if (view === 'mobile') {
|
|
169
|
+
return (
|
|
170
|
+
<>
|
|
171
|
+
<Box
|
|
172
|
+
sx={{
|
|
173
|
+
position: 'fixed',
|
|
174
|
+
top: `${toggleOffset}px`,
|
|
175
|
+
right: 0,
|
|
176
|
+
zIndex: ((theme as any)?.zIndex?.drawer ?? 1200) + 1,
|
|
177
|
+
display: mobileOpen ? 'none' : 'flex',
|
|
178
|
+
}}
|
|
179
|
+
>
|
|
180
|
+
<IconButton
|
|
181
|
+
aria-label="Open right sidebar"
|
|
182
|
+
onClick={() => setMobileOpen(true)}
|
|
183
|
+
sx={{
|
|
184
|
+
borderRadius: '16px 0 0 16px',
|
|
185
|
+
border: '1px solid',
|
|
186
|
+
borderColor: 'divider',
|
|
187
|
+
bgcolor: 'background.paper',
|
|
188
|
+
color: 'text.secondary',
|
|
189
|
+
boxShadow: 3,
|
|
190
|
+
'&:hover': {
|
|
191
|
+
bgcolor: 'background.nav',
|
|
192
|
+
color: 'text.primary',
|
|
193
|
+
},
|
|
194
|
+
}}
|
|
195
|
+
>
|
|
196
|
+
<Icon name="menu" />
|
|
197
|
+
</IconButton>
|
|
198
|
+
</Box>
|
|
199
|
+
<Drawer
|
|
200
|
+
anchor="right"
|
|
201
|
+
open={mobileOpen}
|
|
202
|
+
onClose={() => setMobileOpen(false)}
|
|
203
|
+
variant="temporary"
|
|
204
|
+
ModalProps={{ keepMounted: true }}
|
|
205
|
+
sx={{
|
|
206
|
+
'& .MuiDrawer-paper': {
|
|
207
|
+
width: EXPANDED_WIDTH,
|
|
208
|
+
top: `${navInset}px`,
|
|
209
|
+
height: `calc(100vh - ${navInset}px)`,
|
|
210
|
+
display: 'flex',
|
|
211
|
+
flexDirection: 'column',
|
|
212
|
+
borderLeft: '1px solid',
|
|
213
|
+
borderColor: 'divider',
|
|
214
|
+
},
|
|
215
|
+
}}
|
|
216
|
+
PaperProps={{ id, 'data-testid': dataTestId, style, className }}
|
|
217
|
+
>
|
|
218
|
+
<Box
|
|
219
|
+
component="header"
|
|
220
|
+
sx={{
|
|
221
|
+
flexShrink: 0,
|
|
222
|
+
borderBottom: '1px solid',
|
|
223
|
+
borderColor: 'divider',
|
|
224
|
+
height: `${headerHeight}px`,
|
|
225
|
+
display: 'flex',
|
|
226
|
+
alignItems: 'center',
|
|
227
|
+
justifyContent: 'flex-start',
|
|
228
|
+
px: 1.5,
|
|
229
|
+
gap: 1.25,
|
|
230
|
+
}}
|
|
231
|
+
>
|
|
232
|
+
<RightSidebarToggleButton expanded onToggle={() => setMobileOpen(false)} />
|
|
233
|
+
</Box>
|
|
234
|
+
<Box sx={{ flexGrow: 1, overflowY: 'auto' }}>{renderElements(elements)}</Box>
|
|
235
|
+
{hasFooterElements && (
|
|
236
|
+
<Box
|
|
237
|
+
component="footer"
|
|
238
|
+
sx={{
|
|
239
|
+
flexShrink: 0,
|
|
240
|
+
px: 1.5,
|
|
241
|
+
py: 1.5,
|
|
242
|
+
borderColor: 'divider',
|
|
243
|
+
display: 'flex',
|
|
244
|
+
flexDirection: 'column',
|
|
245
|
+
gap: 0.75,
|
|
246
|
+
}}
|
|
247
|
+
>
|
|
248
|
+
{renderFooterItems(footerElements)}
|
|
249
|
+
</Box>
|
|
250
|
+
)}
|
|
251
|
+
</Drawer>
|
|
252
|
+
</>
|
|
253
|
+
);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
return (
|
|
257
|
+
<Box
|
|
258
|
+
component="aside"
|
|
259
|
+
className={clsx('RightSidebar', className)}
|
|
260
|
+
id={id}
|
|
261
|
+
data-testid={dataTestId}
|
|
262
|
+
style={style}
|
|
263
|
+
sx={{
|
|
264
|
+
position: 'fixed',
|
|
265
|
+
top: 0,
|
|
266
|
+
right: 0,
|
|
267
|
+
bottom: 0,
|
|
268
|
+
height: '100vh',
|
|
269
|
+
display: 'flex',
|
|
270
|
+
flexDirection: 'column',
|
|
271
|
+
width: `${EXPANDED_WIDTH}px`,
|
|
272
|
+
overflow: 'hidden',
|
|
273
|
+
borderLeft: '1px solid',
|
|
274
|
+
borderColor: 'divider',
|
|
275
|
+
backgroundColor: 'background.paper',
|
|
276
|
+
}}
|
|
277
|
+
>
|
|
278
|
+
<Box
|
|
279
|
+
component="header"
|
|
280
|
+
sx={{
|
|
281
|
+
flexShrink: 0,
|
|
282
|
+
borderBottom: '1px solid',
|
|
283
|
+
borderColor: 'divider',
|
|
284
|
+
height: `${headerHeight}px`,
|
|
285
|
+
display: 'flex',
|
|
286
|
+
alignItems: 'center',
|
|
287
|
+
justifyContent: 'flex-start',
|
|
288
|
+
px: 1.5,
|
|
289
|
+
py: 0,
|
|
290
|
+
gap: 1.25,
|
|
291
|
+
}}
|
|
292
|
+
>
|
|
293
|
+
<RightSidebarToggleButton
|
|
294
|
+
expanded={view === ('expanded' as any)}
|
|
295
|
+
onToggle={() => setView(view === 'expanded' ? 'rail' : 'expanded')}
|
|
296
|
+
/>
|
|
297
|
+
</Box>
|
|
298
|
+
<Box sx={{ flexGrow: 1, overflowY: 'auto' }}>{renderElements(elements)}</Box>
|
|
299
|
+
{hasFooterElements && (
|
|
300
|
+
<Box
|
|
301
|
+
component="footer"
|
|
302
|
+
sx={{
|
|
303
|
+
flexShrink: 0,
|
|
304
|
+
px: 1.5,
|
|
305
|
+
py: 1.5,
|
|
306
|
+
borderColor: 'divider',
|
|
307
|
+
display: 'flex',
|
|
308
|
+
flexDirection: 'column',
|
|
309
|
+
gap: 0.75,
|
|
310
|
+
}}
|
|
311
|
+
>
|
|
312
|
+
{renderFooterItems(footerElements)}
|
|
313
|
+
</Box>
|
|
314
|
+
)}
|
|
315
|
+
</Box>
|
|
316
|
+
);
|
|
317
|
+
};
|
|
318
|
+
|
|
319
|
+
export default RightSidebar;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import { RightSidebarView } from '@/gui/contexts';
|
|
3
|
+
|
|
4
|
+
export type RightSidebarElement =
|
|
5
|
+
| { type: 'link'; props: Record<string, any> }
|
|
6
|
+
| { type: 'menu'; props: Record<string, any> }
|
|
7
|
+
| { type: 'action'; props: Record<string, any> };
|
|
8
|
+
|
|
9
|
+
export type RightSidebarProps = {
|
|
10
|
+
elements?: RightSidebarElement[];
|
|
11
|
+
footerElements?: RightSidebarElement[];
|
|
12
|
+
className?: string;
|
|
13
|
+
initialView?: RightSidebarView;
|
|
14
|
+
id?: string;
|
|
15
|
+
style?: React.CSSProperties;
|
|
16
|
+
'data-testid'?: string;
|
|
17
|
+
};
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import { Box, Typography, Tooltip } from '@/gui/components/atoms';
|
|
4
|
+
import Icon from '@/gui/Theme/Icon/Icon';
|
|
5
|
+
import type { RightSidebarView } from '../../RightSidebar.types';
|
|
6
|
+
|
|
7
|
+
export type RightSidebarActionProps = {
|
|
8
|
+
label?: string;
|
|
9
|
+
icon?: string;
|
|
10
|
+
iconColor?: string;
|
|
11
|
+
onClick?: () => void;
|
|
12
|
+
active?: boolean;
|
|
13
|
+
className?: string;
|
|
14
|
+
style?: React.CSSProperties;
|
|
15
|
+
view: RightSidebarView;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const RightSidebarAction: React.FC<RightSidebarActionProps> = ({
|
|
19
|
+
label,
|
|
20
|
+
icon,
|
|
21
|
+
iconColor,
|
|
22
|
+
onClick,
|
|
23
|
+
active = false,
|
|
24
|
+
className,
|
|
25
|
+
style,
|
|
26
|
+
view,
|
|
27
|
+
}) => {
|
|
28
|
+
const content = (
|
|
29
|
+
<Box
|
|
30
|
+
sx={{
|
|
31
|
+
display: 'flex',
|
|
32
|
+
gap: 1.123,
|
|
33
|
+
justifyContent: view === 'rail' ? 'center' : 'flex-start',
|
|
34
|
+
alignItems: 'center',
|
|
35
|
+
width: '100%',
|
|
36
|
+
textAlign: view === 'rail' ? 'center' : 'left',
|
|
37
|
+
px: view === 'rail' ? 0 : 1.23,
|
|
38
|
+
}}
|
|
39
|
+
>
|
|
40
|
+
<Icon name={icon ?? ''} iconColor={iconColor || (active ? 'primary.main' : undefined)} />
|
|
41
|
+
{view !== 'rail' && (
|
|
42
|
+
<Typography
|
|
43
|
+
variant="body2"
|
|
44
|
+
sx={{
|
|
45
|
+
whiteSpace: 'nowrap',
|
|
46
|
+
overflow: 'hidden',
|
|
47
|
+
textOverflow: 'ellipsis',
|
|
48
|
+
color: active ? 'primary.main' : 'text.primary',
|
|
49
|
+
}}
|
|
50
|
+
>
|
|
51
|
+
{label}
|
|
52
|
+
</Typography>
|
|
53
|
+
)}
|
|
54
|
+
</Box>
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
return (
|
|
58
|
+
<Box
|
|
59
|
+
component="button"
|
|
60
|
+
onClick={onClick}
|
|
61
|
+
className={clsx('RightSidebarAction', className)}
|
|
62
|
+
style={style}
|
|
63
|
+
sx={{
|
|
64
|
+
p: 1.123,
|
|
65
|
+
display: 'flex',
|
|
66
|
+
flexDirection: 'column',
|
|
67
|
+
alignItems: view === 'rail' ? 'center' : 'flex-start',
|
|
68
|
+
borderRight: 2,
|
|
69
|
+
borderRightColor: active ? 'primary.main' : 'transparent',
|
|
70
|
+
borderRightStyle: 'solid',
|
|
71
|
+
cursor: 'pointer',
|
|
72
|
+
backgroundColor: active ? 'action.selected' : 'transparent',
|
|
73
|
+
'&:hover': {
|
|
74
|
+
backgroundColor: 'action.hover',
|
|
75
|
+
borderRightColor: 'primary.main',
|
|
76
|
+
},
|
|
77
|
+
color: active ? 'primary.main' : 'text.primary',
|
|
78
|
+
width: '100%',
|
|
79
|
+
textAlign: view === 'rail' ? 'center' : 'left',
|
|
80
|
+
outline: 'none',
|
|
81
|
+
border: 'none',
|
|
82
|
+
}}
|
|
83
|
+
aria-pressed={active}
|
|
84
|
+
type="button"
|
|
85
|
+
>
|
|
86
|
+
{view === 'rail' ? (
|
|
87
|
+
<Tooltip
|
|
88
|
+
title={label}
|
|
89
|
+
placement="left"
|
|
90
|
+
arrow
|
|
91
|
+
slotProps={{ tooltip: { sx: { fontSize: '0.9rem', py: 0.5, px: 1 } } }}
|
|
92
|
+
>
|
|
93
|
+
{content}
|
|
94
|
+
</Tooltip>
|
|
95
|
+
) : (
|
|
96
|
+
content
|
|
97
|
+
)}
|
|
98
|
+
</Box>
|
|
99
|
+
);
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
export default RightSidebarAction;
|