this.gui 1.3.22 → 1.3.26
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/this-gui.es.js +0 -1
- package/dist/this-gui.umd.js +65 -65
- package/index.ts +3 -2
- package/init/index.html +4 -5
- package/init/package-lock.json +2 -2
- package/init/package.json +1 -1
- package/init/src/App.tsx +24 -0
- package/init/src/index.css +16 -0
- package/init/src/main.tsx +14 -0
- package/init/src/router/DerivableRouter.tsx +36 -0
- package/package.json +1 -1
- package/src/GUI.tsx +15 -0
- package/src/components/generics/Cards/Gridme.jsx +52 -0
- package/src/components/generics/Cards/LilBox.jsx +65 -0
- package/src/components/generics/Cards/ModuleCard.jsx +106 -0
- package/src/components/generics/Chats/FullChatBot.jsx +223 -0
- package/src/components/generics/Code/CodeBlock.jsx +33 -0
- package/src/components/generics/Feedback/Callout.jsx +92 -0
- package/src/components/generics/Layout/GridX.jsx +29 -0
- package/src/components/generics/Layout/Hero2.jsx +132 -0
- package/src/components/generics/Layout/PageContainer.jsx +29 -0
- package/src/components/generics/Layout/PageDivider.jsx +20 -0
- package/src/components/generics/Layout/Section.jsx +43 -0
- package/src/components/generics/Layout/SectionHeader.jsx +21 -0
- package/src/components/generics/Media/Img.jsx +58 -0
- package/src/components/generics/Media/VideoEmbed.jsx +51 -0
- package/src/components/generics/Organization/TableOfContents.jsx +51 -0
- package/src/components/generics/Organization/Tabs.jsx +45 -0
- package/src/components/generics/Text/TextList.jsx +41 -0
- package/src/components/generics/Text/TextParagraph.jsx +28 -0
- package/src/components/generics/Text/TextQuote.jsx +23 -0
- package/src/components/generics/Text/TextTitle.jsx +44 -0
- package/src/gui/Layouts/ResponsiveUI/Content/Content.resolver.tsx +0 -0
- package/src/gui/Layouts/ResponsiveUI/Content/Content.stories.tsx +88 -0
- package/src/gui/Layouts/ResponsiveUI/Content/Content.tsx +53 -0
- package/src/gui/Layouts/ResponsiveUI/Content/Content.types.tsx +40 -0
- package/src/gui/Layouts/ResponsiveUI/Footer/Footer.resolver.tsx +45 -0
- package/src/gui/Layouts/ResponsiveUI/Footer/Footer.stories.tsx +209 -0
- package/src/gui/Layouts/ResponsiveUI/Footer/Footer.tsx +337 -0
- package/src/gui/Layouts/ResponsiveUI/Footer/Footer.types.ts +40 -0
- package/src/gui/Layouts/ResponsiveUI/Layout/Layout.resolver.tsx +37 -0
- package/src/gui/Layouts/ResponsiveUI/Layout/Layout.stories.tsx +290 -0
- package/src/gui/Layouts/ResponsiveUI/Layout/Layout.tsx +112 -0
- package/src/gui/Layouts/ResponsiveUI/Layout/Layout.types.ts +56 -0
- package/src/gui/Layouts/ResponsiveUI/Layout/useLayoutBreakpoints.ts +9 -0
- package/src/gui/Layouts/ResponsiveUI/Sidebars/LeftSidebar/LeftSidebar.resolver.tsx +87 -0
- package/src/gui/Layouts/ResponsiveUI/Sidebars/LeftSidebar/LeftSidebar.stories.tsx +199 -0
- package/src/gui/Layouts/ResponsiveUI/Sidebars/LeftSidebar/LeftSidebar.tsx +311 -0
- package/src/gui/Layouts/ResponsiveUI/Sidebars/LeftSidebar/LeftSidebar.types.ts +41 -0
- package/src/gui/Layouts/ResponsiveUI/Sidebars/LeftSidebar/SidebarToggleButton.tsx +53 -0
- package/src/gui/Layouts/ResponsiveUI/Sidebars/LeftSidebar/components/LeftSidebarAction/LeftSidebarAction.resolver.tsx +19 -0
- package/src/gui/Layouts/ResponsiveUI/Sidebars/LeftSidebar/components/LeftSidebarAction/LeftSidebarAction.tsx +107 -0
- package/src/gui/Layouts/ResponsiveUI/Sidebars/LeftSidebar/components/LeftSidebarLink/LeftSidebarLink.resolver.tsx +0 -0
- package/src/gui/Layouts/ResponsiveUI/Sidebars/LeftSidebar/components/LeftSidebarLink/LeftSidebarLink.tsx +122 -0
- package/src/gui/Layouts/ResponsiveUI/Sidebars/LeftSidebar/components/LeftSidebarLink/LeftSidebarLink.types.ts +13 -0
- package/src/gui/Layouts/ResponsiveUI/Sidebars/LeftSidebar/components/LeftSidebarMenu/LeftSidebarMenu.tsx +142 -0
- package/src/gui/Layouts/ResponsiveUI/Sidebars/LeftSidebar/components/LeftSidebarToggleButton/LeftSidebarToggleButton.tsx +23 -0
- package/src/gui/Layouts/ResponsiveUI/Sidebars/RightSidebar/RightSidebar.resolver.tsx +35 -0
- package/src/gui/Layouts/ResponsiveUI/Sidebars/RightSidebar/RightSidebar.stories.tsx +240 -0
- package/src/gui/Layouts/ResponsiveUI/Sidebars/RightSidebar/RightSidebar.tsx +319 -0
- package/src/gui/Layouts/ResponsiveUI/Sidebars/RightSidebar/RightSidebar.types.ts +17 -0
- package/src/gui/Layouts/ResponsiveUI/Sidebars/RightSidebar/components/RightSidebarAction/RightSidebarAction.tsx +102 -0
- package/src/gui/Layouts/ResponsiveUI/Sidebars/RightSidebar/components/RightSidebarLink/RightSidebarLink.tsx +132 -0
- package/src/gui/Layouts/ResponsiveUI/Sidebars/RightSidebar/components/RightSidebarMenu/RightSidebarMenu.tsx +140 -0
- package/src/gui/Layouts/ResponsiveUI/Sidebars/RightSidebar/components/RightSidebarToggleButton/RightSidebarToggleButton.tsx +22 -0
- package/src/gui/Layouts/ResponsiveUI/StickyOptions/StickyOptionsTop.stories.tsx +469 -0
- package/src/gui/Layouts/ResponsiveUI/StickyOptions/StickyOptionsTop.tsx +489 -0
- package/src/gui/Layouts/ResponsiveUI/TopBar/TopBar.resolver.tsx +86 -0
- package/src/gui/Layouts/ResponsiveUI/TopBar/TopBar.stories.tsx +350 -0
- package/src/gui/Layouts/ResponsiveUI/TopBar/TopBar.tsx +281 -0
- package/src/gui/Layouts/ResponsiveUI/TopBar/TopBar.types.ts +39 -0
- package/src/gui/Layouts/ResponsiveUI/TopBar/components/TopBarAction/TopBarAction.stories.tsx +83 -0
- package/src/gui/Layouts/ResponsiveUI/TopBar/components/TopBarAction/TopBarAction.tsx +18 -0
- package/src/gui/Layouts/ResponsiveUI/TopBar/components/TopBarAction/TopBarAction.types.ts +4 -0
- package/src/gui/Layouts/ResponsiveUI/TopBar/components/TopBarLink/TopBarLink.stories.tsx +189 -0
- package/src/gui/Layouts/ResponsiveUI/TopBar/components/TopBarLink/TopBarLink.tsx +30 -0
- package/src/gui/Layouts/ResponsiveUI/TopBar/components/TopBarLink/TopBarLink.types.ts +9 -0
- package/src/gui/Layouts/ResponsiveUI/TopBar/components/TopBarMenu/TopBarMenu.resolver.tsx +14 -0
- package/src/gui/Layouts/ResponsiveUI/TopBar/components/TopBarMenu/TopBarMenu.stories.tsx +56 -0
- package/src/gui/Layouts/ResponsiveUI/TopBar/components/TopBarMenu/TopBarMenu.tsx +123 -0
- package/src/gui/Layouts/ResponsiveUI/TopBar/components/TopBarMenu/TopBarMenu.types.ts +44 -0
- package/src/gui/Theme/GuiProvider.tsx +125 -0
- package/src/gui/Theme/Icon/Icon.resolver.tsx +29 -0
- package/src/gui/Theme/Icon/Icon.tsx +43 -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 +273 -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/apis/codegen.api.ts +38 -0
- package/src/gui/components/atoms/AppBar/AppBar.resolver.tsx +41 -0
- package/src/gui/components/atoms/AppBar/AppBar.stories.tsx +225 -0
- package/src/gui/components/atoms/AppBar/AppBar.tsx +8 -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/TextField/TextField.stories.tsx +28 -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.tsx +138 -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/HeroSection/HeroSection.stories.tsx +141 -0
- package/src/gui/components/molecules/HeroSection/HeroSection.tsx +152 -0
- package/src/gui/components/molecules/HeroSection/HeroSection.types.tsx +18 -0
- package/src/gui/components/molecules/ModalBox/ModalBox.resolver.tsx +38 -0
- package/src/gui/components/molecules/ModalBox/ModalBox.stories.tsx +82 -0
- package/src/gui/components/molecules/ModalBox/ModalBox.tsx +106 -0
- package/src/gui/components/molecules/ModalBox/ModalBox.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/organism/ChatGPTInterface/ChatGPTInterface.stories.tsx +17 -0
- package/src/gui/components/organism/ChatGPTInterface/ChatGPTInterface.tsx +71 -0
- package/src/gui/components/organism/RootDomain/RootDomain.stories.tsx +31 -0
- package/src/gui/components/organism/RootDomain/RootDomain.tsx +100 -0
- package/src/gui/components/organism/RootDomain/staticServices.ts +66 -0
- package/src/gui/components/window/Nodes/node.ts +0 -0
- package/src/gui/components/window/code/block/node.tsx +0 -0
- package/src/gui/components/window/code/hugging.face.api.ts +11 -0
- package/src/gui/components/window/connectors/index.ts +19 -0
- package/src/gui/components/window/window.stories.tsx +20 -0
- package/src/gui/components/window/window.tsx +633 -0
- package/src/gui/contexts/InsetsContext.tsx +38 -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/me/Logic.tsx +31 -0
- package/src/gui/me/Me.stories.tsx +8 -0
- package/src/gui/me/Me.tsx +197 -0
- package/src/gui/me/fundamentals/verbs/verbs.tsx +94 -0
- package/src/gui/me/modificators/Adjectives.ts +0 -0
- package/src/gui/me/modificators/Adverbs.ts +0 -0
- package/src/gui/me/modificators/Complements.ts +27 -0
- package/src/gui/me/utils/Context.tsx +14 -0
- package/src/gui/me/utils/hooks/useMe.js +37 -0
- package/src/gui/utils/nodeID.ts +11 -0
- package/src/registry/GuiRegistry.ts +19 -0
- package/src/registry/factory.ts +12 -0
- package/src/registry/index.ts +3 -0
- package/src/registry/types.ts +6 -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/types/gui.d.ts +67 -0
- package/src/types/theme.d.ts +191 -0
- package/src/types/viewport.ts +132 -0
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import Box from "@/gui/components/atoms/Box/Box";
|
|
3
|
+
import Collapse from "@/gui/components/atoms/Collapse/Collapse";
|
|
4
|
+
import Typography from "@/gui/components/atoms/Typography/Typography";
|
|
5
|
+
import Icon from "@/gui/Theme/Icon/Icon";
|
|
6
|
+
type LeftSidebarMenuItem = {
|
|
7
|
+
label?: string;
|
|
8
|
+
icon?: string;
|
|
9
|
+
onClick?: () => void;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
type LeftSidebarMenuProps = {
|
|
13
|
+
label?: string;
|
|
14
|
+
icon?: string;
|
|
15
|
+
items?: LeftSidebarMenuItem[];
|
|
16
|
+
view?: 'rail' | 'expanded' | 'mobile';
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const LeftSidebarMenu: React.FC<LeftSidebarMenuProps> = ({ label, icon, items, view }) => {
|
|
20
|
+
const [open, setOpen] = useState(false);
|
|
21
|
+
const [anchorTop, setAnchorTop] = useState<number | null>(null);
|
|
22
|
+
const isRail = view === 'rail';
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<Box
|
|
26
|
+
onMouseEnter={(e) => {
|
|
27
|
+
if (isRail) {
|
|
28
|
+
const rect = (e.currentTarget as HTMLElement).getBoundingClientRect();
|
|
29
|
+
setAnchorTop(rect.top);
|
|
30
|
+
setOpen(true);
|
|
31
|
+
}
|
|
32
|
+
}}
|
|
33
|
+
onMouseLeave={() => {
|
|
34
|
+
if (isRail) {
|
|
35
|
+
setOpen(false);
|
|
36
|
+
setAnchorTop(null);
|
|
37
|
+
}
|
|
38
|
+
}}
|
|
39
|
+
sx={{
|
|
40
|
+
display: 'flex',
|
|
41
|
+
flexDirection: 'column',
|
|
42
|
+
alignItems: 'flex-start',
|
|
43
|
+
p: 1.123,
|
|
44
|
+
backgroundColor: 'transparent',
|
|
45
|
+
cursor: 'pointer',
|
|
46
|
+
borderRadius: 1,
|
|
47
|
+
color: 'text.primary',
|
|
48
|
+
'&:hover': { backgroundColor: 'action.hover' },
|
|
49
|
+
position: 'relative',
|
|
50
|
+
}}
|
|
51
|
+
onClick={() => !isRail && setOpen(!open)}
|
|
52
|
+
>
|
|
53
|
+
<Box
|
|
54
|
+
sx={{
|
|
55
|
+
display: 'flex',
|
|
56
|
+
gap: 1.5,
|
|
57
|
+
justifyContent: view === 'rail' ? 'center' : 'flex-start',
|
|
58
|
+
alignItems: 'center',
|
|
59
|
+
width: '100%',
|
|
60
|
+
textAlign: view === 'rail' ? 'center' : 'left',
|
|
61
|
+
px: view === 'rail' ? 0 : 1.23,
|
|
62
|
+
}}
|
|
63
|
+
>
|
|
64
|
+
<Icon name={icon ?? ''} />
|
|
65
|
+
{view !== 'rail' && <Typography variant="body2">{label}</Typography>}
|
|
66
|
+
{!isRail && (
|
|
67
|
+
<Icon name={open ? 'expand_less' : 'expand_more'} />
|
|
68
|
+
)}
|
|
69
|
+
</Box>
|
|
70
|
+
|
|
71
|
+
{isRail ? (
|
|
72
|
+
open && (
|
|
73
|
+
<Box
|
|
74
|
+
sx={{
|
|
75
|
+
position: 'fixed',
|
|
76
|
+
left: 'calc(var(--gui-rail-width, 60px) + 2px)',
|
|
77
|
+
marginLeft: '-2px',
|
|
78
|
+
top: anchorTop ?? 0,
|
|
79
|
+
backgroundColor: 'background.paper',
|
|
80
|
+
color: 'text.primary',
|
|
81
|
+
borderRadius: 1,
|
|
82
|
+
boxShadow: 3,
|
|
83
|
+
zIndex: 1500,
|
|
84
|
+
border: '1px solid',
|
|
85
|
+
borderColor: 'divider',
|
|
86
|
+
minWidth: 180,
|
|
87
|
+
maxHeight: '80vh',
|
|
88
|
+
overflowY: 'auto',
|
|
89
|
+
py: 1,
|
|
90
|
+
}}
|
|
91
|
+
>
|
|
92
|
+
{(items ?? []).map((item, idx) => (
|
|
93
|
+
<Box
|
|
94
|
+
key={idx}
|
|
95
|
+
onClick={item.onClick}
|
|
96
|
+
sx={{
|
|
97
|
+
display: 'flex',
|
|
98
|
+
alignItems: 'center',
|
|
99
|
+
px: 2,
|
|
100
|
+
py: 0.75,
|
|
101
|
+
gap: 1.5,
|
|
102
|
+
cursor: 'pointer',
|
|
103
|
+
borderRadius: 1,
|
|
104
|
+
color: 'text.primary',
|
|
105
|
+
'&:hover': { backgroundColor: 'action.hover' },
|
|
106
|
+
}}
|
|
107
|
+
>
|
|
108
|
+
<Icon name={item.icon ?? ''} />
|
|
109
|
+
<Typography variant="body2">{item.label}</Typography>
|
|
110
|
+
</Box>
|
|
111
|
+
))}
|
|
112
|
+
</Box>
|
|
113
|
+
)
|
|
114
|
+
) : (
|
|
115
|
+
<Collapse in={open}>
|
|
116
|
+
{(items ?? []).map((item, idx) => (
|
|
117
|
+
<Box
|
|
118
|
+
key={idx}
|
|
119
|
+
onClick={item.onClick}
|
|
120
|
+
sx={{
|
|
121
|
+
display: 'flex',
|
|
122
|
+
alignItems: 'center',
|
|
123
|
+
px: 2,
|
|
124
|
+
py: 0.75,
|
|
125
|
+
gap: 1.123,
|
|
126
|
+
cursor: 'pointer',
|
|
127
|
+
borderRadius: 1,
|
|
128
|
+
color: 'text.primary',
|
|
129
|
+
'&:hover': { backgroundColor: 'action.hover' },
|
|
130
|
+
}}
|
|
131
|
+
>
|
|
132
|
+
<Icon name={item.icon ?? ''} />
|
|
133
|
+
<Typography variant="body2">{item.label}</Typography>
|
|
134
|
+
</Box>
|
|
135
|
+
))}
|
|
136
|
+
</Collapse>
|
|
137
|
+
)}
|
|
138
|
+
</Box>
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export default LeftSidebarMenu;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//@/gui/Layouts/ResponsiveUI/Sidebars/LeftSidebar/components/LeftSidebarToggleButton/LeftSidebarToggleButton.tsx
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import IconButton from '@mui/material/IconButton';
|
|
4
|
+
import Icon from '@/gui/Theme/Icon/Icon';
|
|
5
|
+
|
|
6
|
+
type LeftSidebarToggleButtonProps = {
|
|
7
|
+
expanded: boolean;
|
|
8
|
+
onToggle: () => void;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const LeftSidebarToggleButton: React.FC<LeftSidebarToggleButtonProps> = ({ expanded, onToggle }) => {
|
|
12
|
+
return (
|
|
13
|
+
<IconButton
|
|
14
|
+
aria-label="Toggle Sidebar"
|
|
15
|
+
onClick={onToggle}
|
|
16
|
+
sx={{ margin: 1 }}
|
|
17
|
+
>
|
|
18
|
+
<Icon name={expanded ? 'chevron_left' : 'chevron_right'} />
|
|
19
|
+
</IconButton>
|
|
20
|
+
);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export default LeftSidebarToggleButton;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { RegistryEntry } from '@/registry/types';
|
|
3
|
+
import RightSidebar from './RightSidebar';
|
|
4
|
+
import type { RightSidebarElement } from './RightSidebar.types';
|
|
5
|
+
|
|
6
|
+
type RightSidebarSpec = {
|
|
7
|
+
type: 'RightSidebar';
|
|
8
|
+
props?: {
|
|
9
|
+
elements?: RightSidebarElement[];
|
|
10
|
+
footerElements?: RightSidebarElement[];
|
|
11
|
+
initialView?: 'rail' | 'expanded' | 'mobile';
|
|
12
|
+
className?: string;
|
|
13
|
+
id?: string;
|
|
14
|
+
'data-testid'?: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const RightSidebarResolver: RegistryEntry = {
|
|
19
|
+
type: 'RightSidebar',
|
|
20
|
+
resolve(spec: RightSidebarSpec) {
|
|
21
|
+
const props = spec.props ?? {};
|
|
22
|
+
return (
|
|
23
|
+
<RightSidebar
|
|
24
|
+
elements={props.elements ?? []}
|
|
25
|
+
footerElements={props.footerElements ?? []}
|
|
26
|
+
initialView={props.initialView}
|
|
27
|
+
className={props.className}
|
|
28
|
+
id={props.id}
|
|
29
|
+
data-testid={props['data-testid']}
|
|
30
|
+
/>
|
|
31
|
+
);
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export default RightSidebarResolver;
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
import { StoryFn } from "@storybook/react";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import Layout from "@/gui/Layouts/ResponsiveUI/Layout/Layout";
|
|
4
|
+
import ThemeModeToggle from "@/gui/components/molecules/Theme/ThemeModeToggle/ThemeModeToggle";
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: "Layouts/ResponsiveUI/Sidebars/RightSidebar",
|
|
8
|
+
component: Layout,
|
|
9
|
+
tags: ['autodocs'],
|
|
10
|
+
parameters: {
|
|
11
|
+
docs: {
|
|
12
|
+
description: {
|
|
13
|
+
component:
|
|
14
|
+
`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.
|
|
15
|
+
---
|
|
16
|
+
## Features
|
|
17
|
+
- **Rail-first orientation:** Defaults to a compact 72px rail so charts or documents remain visible.
|
|
18
|
+
- **Expandable workspace:** Switch to a wide panel (264px) for verbose content, filters, or inspectors.
|
|
19
|
+
- **Mobile-friendly drawer:** On small screens it becomes a temporary drawer that slides over content from the right.
|
|
20
|
+
- **Footer actions:** Accepts \`footerElements\` so pinned tools (settings, help) stay reachable.
|
|
21
|
+
- **Inset synchronization:** Updates \`theme.layout.insets.right\` so TopBar and other surfaces adapt automatically.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
## Layout Modes
|
|
25
|
+
- \`rail\`: icon-only column hugging the right edge.
|
|
26
|
+
- \`expanded\`: full-width tools panel with labels and nested menus.
|
|
27
|
+
- \`mobile\`: overlay drawer controlled by a floating button.
|
|
28
|
+
Modes can be toggled programmatically via \`useRightSidebar()\` or automatically through built-in breakpoints.
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
## Props
|
|
32
|
+
- \`elements?: RightSidebarElement[]\` — Declarative items (\`link\`, \`menu\`, \`action\`) rendered in order.
|
|
33
|
+
- \`footerElements?: RightSidebarElement[]\` — Optional sticky footer actions.
|
|
34
|
+
- \`initialView?: 'rail' | 'expanded' | 'mobile'\` — Starting mode (defaults to \`rail\`).
|
|
35
|
+
- \`className?\` and other DOM props are forwarded to the root \`aside\`.
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
## Declarative usage
|
|
39
|
+
~~~tsx
|
|
40
|
+
import RightSidebar from '@/gui/Layouts/ResponsiveUI/Sidebars/RightSidebar/RightSidebar';
|
|
41
|
+
|
|
42
|
+
<RightSidebar
|
|
43
|
+
elements={[
|
|
44
|
+
{ type: 'link', props: { label: 'Notifications', icon: 'notifications' } },
|
|
45
|
+
{ type: 'link', props: { label: 'Activity', icon: 'history' } },
|
|
46
|
+
{
|
|
47
|
+
type: 'menu',
|
|
48
|
+
props: {
|
|
49
|
+
label: 'Views',
|
|
50
|
+
icon: 'view_cozy',
|
|
51
|
+
items: [
|
|
52
|
+
{ label: 'Timeline', icon: 'timeline' },
|
|
53
|
+
{ label: 'JSON', icon: 'code' },
|
|
54
|
+
],
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
]}
|
|
58
|
+
footerElements={[
|
|
59
|
+
{ type: 'link', props: { label: 'Settings', icon: 'settings' } },
|
|
60
|
+
{ type: 'action', props: { label: 'Support', icon: 'help' } },
|
|
61
|
+
]}
|
|
62
|
+
/>;
|
|
63
|
+
~~~
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
## React usage
|
|
67
|
+
Combine the context provider and hook to manage the view explicitly:
|
|
68
|
+
~~~tsx
|
|
69
|
+
import { RightSidebarProvider } from '@/gui/contexts';
|
|
70
|
+
import { useRightSidebar } from '@/gui/hooks';
|
|
71
|
+
import RightSidebar from '@/gui/Layouts/ResponsiveUI/Sidebars/RightSidebar/RightSidebar';
|
|
72
|
+
|
|
73
|
+
const items = [{ type: 'link', props: { label: 'History', icon: 'history' } }];
|
|
74
|
+
|
|
75
|
+
function Inspector() {
|
|
76
|
+
const { view, setView } = useRightSidebar();
|
|
77
|
+
return (
|
|
78
|
+
<>
|
|
79
|
+
<button onClick={() => setView(view === 'expanded' ? 'rail' : 'expanded')}>
|
|
80
|
+
Toggle inspector
|
|
81
|
+
</button>
|
|
82
|
+
<RightSidebar elements={items} />
|
|
83
|
+
</>
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export function InspectorShell() {
|
|
88
|
+
return (
|
|
89
|
+
<RightSidebarProvider>
|
|
90
|
+
<Inspector />
|
|
91
|
+
</RightSidebarProvider>
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
~~~
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
## Notes
|
|
98
|
+
- The floating toggle only appears in mobile mode; closing the drawer restores the underlying layout insets.
|
|
99
|
+
- Footer elements share the same declarative shape as main items, so you can reuse links or action buttons.
|
|
100
|
+
- Works seamlessly alongside \`LeftSidebar\` and \`TopBar\` when using the responsive Layout shell.
|
|
101
|
+
`,
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
const Template: StoryFn<React.ComponentProps<typeof Layout>> = (args) => (
|
|
108
|
+
<Layout {...args} />
|
|
109
|
+
);
|
|
110
|
+
|
|
111
|
+
export const Default = Template.bind({});
|
|
112
|
+
Default.args = {
|
|
113
|
+
topBarConfig: {
|
|
114
|
+
title: "Analytics",
|
|
115
|
+
elementsRight: [
|
|
116
|
+
{
|
|
117
|
+
type: "action",
|
|
118
|
+
props: {
|
|
119
|
+
element: <ThemeModeToggle variant="minimal" show="icons" iconSize="small" />,
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
{ type: "action", props: { label: "Share", icon: "ios_share", iconColor: "var(--gui-primary)" } },
|
|
123
|
+
],
|
|
124
|
+
},
|
|
125
|
+
rightSidebarConfig: {
|
|
126
|
+
elements: [
|
|
127
|
+
{ type: "link", props: { label: "Notifications", icon: "notifications", iconColor: "var(--gui-warning)" } },
|
|
128
|
+
{ type: "link", props: { label: "Activity", icon: "history", iconColor: "var(--gui-secondary)" } },
|
|
129
|
+
{
|
|
130
|
+
type: "menu",
|
|
131
|
+
props: {
|
|
132
|
+
label: "Views",
|
|
133
|
+
icon: "view_cozy",
|
|
134
|
+
iconColor: "var(--gui-primary)",
|
|
135
|
+
items: [
|
|
136
|
+
{ label: "Timeline", icon: "timeline", iconColor: "var(--gui-success)" },
|
|
137
|
+
{ label: "JSON", icon: "code", iconColor: "var(--gui-info)" },
|
|
138
|
+
],
|
|
139
|
+
},
|
|
140
|
+
},
|
|
141
|
+
{ type: "action", props: { label: "Download", icon: "download", iconColor: "var(--gui-primary)" } },
|
|
142
|
+
],
|
|
143
|
+
},
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
export const WithFooter = Template.bind({});
|
|
147
|
+
WithFooter.args = {
|
|
148
|
+
topBarConfig: {
|
|
149
|
+
title: "Analytics",
|
|
150
|
+
elementsRight: [
|
|
151
|
+
{
|
|
152
|
+
type: "action",
|
|
153
|
+
props: {
|
|
154
|
+
element: <ThemeModeToggle variant="minimal" show="icons" iconSize="small" />,
|
|
155
|
+
},
|
|
156
|
+
},
|
|
157
|
+
{ type: "action", props: { label: "Share", icon: "ios_share", iconColor: "var(--gui-primary)" } },
|
|
158
|
+
],
|
|
159
|
+
},
|
|
160
|
+
rightSidebarConfig: {
|
|
161
|
+
elements: [
|
|
162
|
+
{ type: "link", props: { label: "Notifications", icon: "notifications", iconColor: "var(--gui-warning)" } },
|
|
163
|
+
{ type: "link", props: { label: "Activity", icon: "history", iconColor: "var(--gui-secondary)" } },
|
|
164
|
+
{
|
|
165
|
+
type: "menu",
|
|
166
|
+
props: {
|
|
167
|
+
label: "Views",
|
|
168
|
+
icon: "view_cozy",
|
|
169
|
+
iconColor: "var(--gui-primary)",
|
|
170
|
+
items: [
|
|
171
|
+
{ label: "Timeline", icon: "timeline", iconColor: "var(--gui-success)" },
|
|
172
|
+
{ label: "JSON", icon: "code", iconColor: "var(--gui-info)" },
|
|
173
|
+
],
|
|
174
|
+
},
|
|
175
|
+
},
|
|
176
|
+
{ type: "action", props: { label: "Download", icon: "download", iconColor: "var(--gui-primary)" } },
|
|
177
|
+
],
|
|
178
|
+
footerElements: [
|
|
179
|
+
{ type: "link", props: { label: "Settings", icon: "settings", iconColor: "var(--gui-secondary)" } },
|
|
180
|
+
{ type: "action", props: { label: "Support", icon: "help", iconColor: "var(--gui-success)" } },
|
|
181
|
+
],
|
|
182
|
+
},
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
export const WithBothSidebars = Template.bind({});
|
|
186
|
+
WithBothSidebars.args = {
|
|
187
|
+
topBarConfig: {
|
|
188
|
+
title: "Analytics",
|
|
189
|
+
elementsRight: [
|
|
190
|
+
{
|
|
191
|
+
type: "action",
|
|
192
|
+
props: {
|
|
193
|
+
element: <ThemeModeToggle variant="minimal" show="icons" iconSize="small" />,
|
|
194
|
+
},
|
|
195
|
+
},
|
|
196
|
+
{ type: "action", props: { label: "Share", icon: "ios_share", iconColor: "var(--gui-primary)" } },
|
|
197
|
+
],
|
|
198
|
+
},
|
|
199
|
+
leftSidebarConfig: {
|
|
200
|
+
elements: [
|
|
201
|
+
{ type: "link", props: { label: "Dashboard", icon: "dashboard", iconColor: "var(--gui-primary)" } },
|
|
202
|
+
{
|
|
203
|
+
type: "menu",
|
|
204
|
+
props: {
|
|
205
|
+
label: "Projects",
|
|
206
|
+
icon: "folder",
|
|
207
|
+
iconColor: "var(--gui-secondary)",
|
|
208
|
+
items: [
|
|
209
|
+
{ label: "Project A", icon: "folder_open" },
|
|
210
|
+
{ label: "Project B", icon: "folder_open" },
|
|
211
|
+
],
|
|
212
|
+
},
|
|
213
|
+
},
|
|
214
|
+
{ type: "action", props: { label: "Create", icon: "add_circle", iconColor: "var(--gui-success)" } },
|
|
215
|
+
],
|
|
216
|
+
footerElements: [
|
|
217
|
+
{ type: "link", props: { label: "Settings", icon: "settings", iconColor: "var(--gui-secondary)" } },
|
|
218
|
+
{ type: "action", props: { label: "Help", icon: "help_outline", iconColor: "var(--gui-info)" } },
|
|
219
|
+
],
|
|
220
|
+
},
|
|
221
|
+
rightSidebarConfig: {
|
|
222
|
+
elements: [
|
|
223
|
+
{ type: "link", props: { label: "Notifications", icon: "notifications", iconColor: "var(--gui-warning)" } },
|
|
224
|
+
{ type: "link", props: { label: "Activity", icon: "history", iconColor: "var(--gui-secondary)" } },
|
|
225
|
+
{
|
|
226
|
+
type: "menu",
|
|
227
|
+
props: {
|
|
228
|
+
label: "Views",
|
|
229
|
+
icon: "view_cozy",
|
|
230
|
+
iconColor: "var(--gui-primary)",
|
|
231
|
+
items: [
|
|
232
|
+
{ label: "Timeline", icon: "timeline", iconColor: "var(--gui-success)" },
|
|
233
|
+
{ label: "JSON", icon: "code", iconColor: "var(--gui-info)" },
|
|
234
|
+
],
|
|
235
|
+
},
|
|
236
|
+
},
|
|
237
|
+
{ type: "action", props: { label: "Download", icon: "download", iconColor: "var(--gui-primary)" } },
|
|
238
|
+
],
|
|
239
|
+
},
|
|
240
|
+
};
|