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,51 @@
|
|
|
1
|
+
import { List, ListItemButton, ListItemText, Typography } from "@mui/material";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* PageTableOfContents Component
|
|
5
|
+
* Generates a table of contents (TOC) from an array of headings.
|
|
6
|
+
*
|
|
7
|
+
* Props:
|
|
8
|
+
* - headings: Array of objects with { id, text, level }:
|
|
9
|
+
* - id: The anchor or unique identifier (used for scrolling).
|
|
10
|
+
* - text: The heading text to display.
|
|
11
|
+
* - level: Heading level (1, 2, or 3). Used to indent items.
|
|
12
|
+
* - onNavigate: Optional callback when a TOC item is clicked (receives id).
|
|
13
|
+
*/
|
|
14
|
+
export default function TableOfContents({ headings = [], onNavigate }) {
|
|
15
|
+
if (!headings || headings.length === 0) return null;
|
|
16
|
+
|
|
17
|
+
const handleClick = (id) => {
|
|
18
|
+
if (onNavigate) {
|
|
19
|
+
onNavigate(id);
|
|
20
|
+
} else {
|
|
21
|
+
const el = document.getElementById(id);
|
|
22
|
+
if (el) el.scrollIntoView({ behavior: "smooth", block: "start" });
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<div style={{ padding: "1rem" }}>
|
|
28
|
+
<Typography variant="h6" sx={{ mb: 1 }}>
|
|
29
|
+
Table of Contents
|
|
30
|
+
</Typography>
|
|
31
|
+
<List dense>
|
|
32
|
+
{headings.map((heading, index) => (
|
|
33
|
+
<ListItemButton
|
|
34
|
+
key={index}
|
|
35
|
+
sx={{
|
|
36
|
+
pl: heading.level === 1 ? 1 : heading.level === 2 ? 3 : 5,
|
|
37
|
+
}}
|
|
38
|
+
onClick={() => handleClick(heading.id)}
|
|
39
|
+
>
|
|
40
|
+
<ListItemText
|
|
41
|
+
primaryTypographyProps={{
|
|
42
|
+
variant: heading.level === 1 ? "body1" : "body2",
|
|
43
|
+
}}
|
|
44
|
+
primary={heading.text}
|
|
45
|
+
/>
|
|
46
|
+
</ListItemButton>
|
|
47
|
+
))}
|
|
48
|
+
</List>
|
|
49
|
+
</div>
|
|
50
|
+
);
|
|
51
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
import { Tabs as MuiTabs, Tab, Box, Typography } from "@mui/material";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Tabs Component
|
|
6
|
+
* A simple tab system to switch between different content sections.
|
|
7
|
+
*
|
|
8
|
+
* Props:
|
|
9
|
+
* - tabs: Array of objects { label, content } (required).
|
|
10
|
+
* - initialIndex: Index of the tab to show first (default: 0).
|
|
11
|
+
* - variant: Tabs variant ("standard" | "scrollable" | "fullWidth"). Default: "standard".
|
|
12
|
+
*/
|
|
13
|
+
export default function Tabs({ tabs = [], initialIndex = 0, variant = "standard" }) {
|
|
14
|
+
const [value, setValue] = useState(initialIndex);
|
|
15
|
+
|
|
16
|
+
const handleChange = (event, newValue) => {
|
|
17
|
+
setValue(newValue);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
if (!tabs || tabs.length === 0) {
|
|
21
|
+
return <Typography variant="body2">No tabs available.</Typography>;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<Box sx={{ width: "100%" }}>
|
|
26
|
+
<MuiTabs
|
|
27
|
+
value={value}
|
|
28
|
+
onChange={handleChange}
|
|
29
|
+
variant={variant}
|
|
30
|
+
sx={{ mb: 2 }}
|
|
31
|
+
>
|
|
32
|
+
{tabs.map((tab, index) => (
|
|
33
|
+
<Tab key={index} label={tab.label} />
|
|
34
|
+
))}
|
|
35
|
+
</MuiTabs>
|
|
36
|
+
<Box sx={{ p: 2 }}>
|
|
37
|
+
{tabs[value]?.content || (
|
|
38
|
+
<Typography variant="body2" color="text.secondary">
|
|
39
|
+
No content for this tab.
|
|
40
|
+
</Typography>
|
|
41
|
+
)}
|
|
42
|
+
</Box>
|
|
43
|
+
</Box>
|
|
44
|
+
);
|
|
45
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { List, ListItem, ListItemText } from "@mui/material";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* TextList Component
|
|
5
|
+
* Standardized list component for ordered or unordered lists.
|
|
6
|
+
*
|
|
7
|
+
* Props:
|
|
8
|
+
* - items: Array of strings or objects with { primary, secondary } (required).
|
|
9
|
+
* - type: "unordered" | "ordered" (default: "unordered").
|
|
10
|
+
* - dense: Reduces vertical spacing (default: false).
|
|
11
|
+
*/
|
|
12
|
+
export default function PageList({ items = [], type = "unordered", dense = false }) {
|
|
13
|
+
const isOrdered = type === "ordered";
|
|
14
|
+
|
|
15
|
+
if (!items || items.length === 0) return null;
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<List
|
|
19
|
+
dense={dense}
|
|
20
|
+
sx={{
|
|
21
|
+
listStyleType: isOrdered ? "decimal" : "disc",
|
|
22
|
+
pl: 3,
|
|
23
|
+
"& .MuiListItem-root": {
|
|
24
|
+
display: "list-item",
|
|
25
|
+
py: dense ? 0.25 : 0.5,
|
|
26
|
+
},
|
|
27
|
+
}}
|
|
28
|
+
>
|
|
29
|
+
{items.map((item, index) => {
|
|
30
|
+
const primary = typeof item === "string" ? item : item.primary;
|
|
31
|
+
const secondary = typeof item === "string" ? null : item.secondary;
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<ListItem key={index}>
|
|
35
|
+
<ListItemText primary={primary} secondary={secondary} />
|
|
36
|
+
</ListItem>
|
|
37
|
+
);
|
|
38
|
+
})}
|
|
39
|
+
</List>
|
|
40
|
+
);
|
|
41
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Typography } from "@mui/material";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* TextParagraph Component
|
|
5
|
+
* Standardized paragraph text for pages with consistent spacing and alignment.
|
|
6
|
+
*
|
|
7
|
+
* Props:
|
|
8
|
+
* - children: Text or elements to display as paragraph content.
|
|
9
|
+
* - align: "left" | "center" | "right" | "justify" (default: "left").
|
|
10
|
+
* - variant: MUI Typography variant, e.g., "body1" | "body2" | "caption" (default: "body1").
|
|
11
|
+
* - gutterBottom: Adds bottom spacing (default: true).
|
|
12
|
+
*/
|
|
13
|
+
export default function PageParagraph({
|
|
14
|
+
children,
|
|
15
|
+
align = "left",
|
|
16
|
+
variant = "body1",
|
|
17
|
+
gutterBottom = true,
|
|
18
|
+
}) {
|
|
19
|
+
return (
|
|
20
|
+
<Typography
|
|
21
|
+
variant={variant}
|
|
22
|
+
align={align}
|
|
23
|
+
sx={{ mb: gutterBottom ? 2 : 0 }}
|
|
24
|
+
>
|
|
25
|
+
{children}
|
|
26
|
+
</Typography>
|
|
27
|
+
);
|
|
28
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Box, Typography } from "@mui/material";
|
|
2
|
+
import { useTheme } from "@mui/material/styles";
|
|
3
|
+
|
|
4
|
+
export default function TextQuote({ children }) {
|
|
5
|
+
const theme = useTheme();
|
|
6
|
+
const isDark = theme.palette.mode === "dark";
|
|
7
|
+
|
|
8
|
+
return (
|
|
9
|
+
<Box
|
|
10
|
+
component="blockquote"
|
|
11
|
+
sx={{
|
|
12
|
+
borderLeft: `4px solid ${theme.palette.primary.main}`,
|
|
13
|
+
padding: "1rem 1.5rem",
|
|
14
|
+
margin: "1.5rem 0",
|
|
15
|
+
fontStyle: "italic",
|
|
16
|
+
color: theme.palette.text.secondary,
|
|
17
|
+
"& p": { margin: 0 },
|
|
18
|
+
}}
|
|
19
|
+
>
|
|
20
|
+
<Typography variant="body1">{children}</Typography>
|
|
21
|
+
</Box>
|
|
22
|
+
);
|
|
23
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Box, Typography, Divider } from "@mui/material";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* TextTitle Component
|
|
5
|
+
* Displays a title (h1-h3) and an optional subtitle/description at the top of the page.
|
|
6
|
+
* Meant to be used inside PageContainer for consistency across layouts.
|
|
7
|
+
*/
|
|
8
|
+
export default function TextTitle({ title, subtitle, h = 1, variant, showDivider = true }) {
|
|
9
|
+
const variants = {
|
|
10
|
+
1: "h1",
|
|
11
|
+
2: "h2",
|
|
12
|
+
3: "h3",
|
|
13
|
+
4: "h4",
|
|
14
|
+
5: "h5",
|
|
15
|
+
6: "h6",
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const level = Math.min(Math.max(h, 1), 6);
|
|
19
|
+
const typographyVariant = variant || variants[level];
|
|
20
|
+
return (
|
|
21
|
+
<Box sx={{ width: "100%", mb: 3 }}>
|
|
22
|
+
<Typography
|
|
23
|
+
variant={typographyVariant}
|
|
24
|
+
component={`h${level}`}
|
|
25
|
+
sx={{
|
|
26
|
+
fontWeight: 600,
|
|
27
|
+
mb: subtitle ? 0.5 : 2,
|
|
28
|
+
}}
|
|
29
|
+
>
|
|
30
|
+
{title}
|
|
31
|
+
</Typography>
|
|
32
|
+
{subtitle && (
|
|
33
|
+
<Typography
|
|
34
|
+
variant="subtitle1"
|
|
35
|
+
color="text.secondary"
|
|
36
|
+
sx={{ mb: 1.5 }}
|
|
37
|
+
>
|
|
38
|
+
{subtitle}
|
|
39
|
+
</Typography>
|
|
40
|
+
)}
|
|
41
|
+
{showDivider && <Divider />}
|
|
42
|
+
</Box>
|
|
43
|
+
);
|
|
44
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import Dialog from './Dialog';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Molecules/Dialog/Dialog',
|
|
5
|
+
component: Dialog,
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export const Basic = () => (
|
|
9
|
+
<Dialog>
|
|
10
|
+
This is the basic Dialog with default padding.
|
|
11
|
+
</Dialog>
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
export const WithCustomPadding = () => (
|
|
15
|
+
<Dialog sx={{ p: 4, bgcolor: 'background.default' }}>
|
|
16
|
+
This Dialog has custom padding and background color.
|
|
17
|
+
</Dialog>
|
|
18
|
+
);
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import MuiDialogContent, { DialogContentProps as MuiDialogContentProps } from '@mui/material/DialogContent';
|
|
2
|
+
export type DialogProps = MuiDialogContentProps;
|
|
3
|
+
export default function DialogContent(props: DialogProps) {
|
|
4
|
+
return <MuiDialogContent {...props} sx={{ p: 2, bgcolor: 'background.paper', ...props.sx }} />;
|
|
5
|
+
}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Hero } from './Hero';
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof Hero> = {
|
|
5
|
+
title: 'Molecules/Display/Hero',
|
|
6
|
+
component: Hero,
|
|
7
|
+
tags: ['autodocs'],
|
|
8
|
+
decorators: [
|
|
9
|
+
(Story) => (
|
|
10
|
+
<div style={{ height: '100vh', overflow: 'hidden' }}>
|
|
11
|
+
<Story />
|
|
12
|
+
</div>
|
|
13
|
+
),
|
|
14
|
+
],
|
|
15
|
+
parameters: {
|
|
16
|
+
docs: {
|
|
17
|
+
description: {
|
|
18
|
+
component: `
|
|
19
|
+
**HeroSection** is a full-screen display component that supports image, GIF, or video backgrounds with overlay and blur options.
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
## Features
|
|
23
|
+
- Background types: \`image\`, \`gif\`, \`video\`.
|
|
24
|
+
- Overlay color and opacity control.
|
|
25
|
+
- Theme-aware blur effects: \`light\`, \`medium\`, \`heavy\`, \`all\`.
|
|
26
|
+
- Fully responsive and fills viewport (100vh).
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
## Props
|
|
30
|
+
- \`backgroundSrc\`: Media URL (image, gif, or video).
|
|
31
|
+
- \`backgroundType\`: Type of background media ('image', 'gif', or 'video').
|
|
32
|
+
- \`overlayOpacity\`: Opacity of overlay (0–1).
|
|
33
|
+
- \`overlayColor\`: Color of overlay.
|
|
34
|
+
- \`blur\`: Theme-based blur intensity (\`light\`, \`medium\`, \`heavy\`, \`all\`).
|
|
35
|
+
`,
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
export default meta;
|
|
41
|
+
type Story = StoryObj<typeof Hero>;
|
|
42
|
+
|
|
43
|
+
export const ImageBackground: Story = {
|
|
44
|
+
args: {
|
|
45
|
+
backgroundSrc: 'https://images.unsplash.com/photo-1507525428034-b723cf961d3e',
|
|
46
|
+
backgroundType: 'image',
|
|
47
|
+
blur: 'none',
|
|
48
|
+
children: (
|
|
49
|
+
<div style={{ color: 'white', fontSize: '2rem', fontWeight: 600, textAlign: 'center', marginTop: '40vh' }}>
|
|
50
|
+
Example: Image Background, Blur none
|
|
51
|
+
</div>
|
|
52
|
+
),
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export const GifBackground: Story = {
|
|
57
|
+
args: {
|
|
58
|
+
backgroundSrc: 'https://media.giphy.com/media/l0MYt5jPR6QX5pnqM/giphy.gif',
|
|
59
|
+
backgroundType: 'gif',
|
|
60
|
+
blur: 'light',
|
|
61
|
+
children: (
|
|
62
|
+
<div style={{ color: 'white', fontSize: '2rem', fontWeight: 600, textAlign: 'center', marginTop: '40vh' }}>
|
|
63
|
+
Example: GIF Background, Blur light
|
|
64
|
+
</div>
|
|
65
|
+
),
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export const VideoBackground: Story = {
|
|
70
|
+
args: {
|
|
71
|
+
backgroundSrc: 'https://www.neurons.me/media/neurons.mp4',
|
|
72
|
+
backgroundType: 'video',
|
|
73
|
+
blur: 'medium',
|
|
74
|
+
children: (
|
|
75
|
+
<div style={{ color: 'white', fontSize: '2rem', fontWeight: 600, textAlign: 'center', marginTop: '40vh' }}>
|
|
76
|
+
Example: Video Background, Blur medium
|
|
77
|
+
</div>
|
|
78
|
+
),
|
|
79
|
+
},
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
export const HeavyExample: Story = {
|
|
83
|
+
args: {
|
|
84
|
+
backgroundSrc: 'https://images.unsplash.com/photo-1507525428034-b723cf961d3e',
|
|
85
|
+
backgroundType: 'image',
|
|
86
|
+
blur: 'heavy',
|
|
87
|
+
children: (
|
|
88
|
+
<div
|
|
89
|
+
style={{
|
|
90
|
+
color: 'white',
|
|
91
|
+
fontSize: '2rem',
|
|
92
|
+
fontWeight: 600,
|
|
93
|
+
textAlign: 'center',
|
|
94
|
+
marginTop: '40vh',
|
|
95
|
+
}}
|
|
96
|
+
>
|
|
97
|
+
Example: Heavy blur overlay (theme preset)
|
|
98
|
+
</div>
|
|
99
|
+
),
|
|
100
|
+
},
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
export const BlurVariants: Story = {
|
|
104
|
+
render: () => (
|
|
105
|
+
<div style={{ display: 'grid', gridTemplateColumns: 'repeat(2, 1fr)', gap: 16 }}>
|
|
106
|
+
{(['none', 'light', 'medium', 'heavy', 'all'] as const).map((b) => (
|
|
107
|
+
<Hero
|
|
108
|
+
key={b}
|
|
109
|
+
backgroundSrc="https://images.unsplash.com/photo-1507525428034-b723cf961d3e"
|
|
110
|
+
backgroundType="image"
|
|
111
|
+
blur={b}
|
|
112
|
+
children={
|
|
113
|
+
<div style={{ color: 'white', fontSize: '1.5rem', fontWeight: 600, textAlign: 'center', marginTop: '40vh' }}>
|
|
114
|
+
Blur = {b}
|
|
115
|
+
</div>
|
|
116
|
+
}
|
|
117
|
+
/>
|
|
118
|
+
))}
|
|
119
|
+
</div>
|
|
120
|
+
),
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
export const CustomColorExample: Story = {
|
|
124
|
+
args: {
|
|
125
|
+
backgroundSrc: 'https://images.unsplash.com/photo-1507525428034-b723cf961d3e',
|
|
126
|
+
backgroundType: 'image',
|
|
127
|
+
overlayColor: 'rgba(15, 21, 37, 0.89)', // Semi-transparent dark overlay
|
|
128
|
+
children: (
|
|
129
|
+
<div style={{
|
|
130
|
+
color: 'white',
|
|
131
|
+
fontSize: '2rem',
|
|
132
|
+
fontWeight: 600,
|
|
133
|
+
textAlign: 'center',
|
|
134
|
+
marginTop: '40vh',
|
|
135
|
+
}}>
|
|
136
|
+
Example: Custom Color Overlay
|
|
137
|
+
</div>
|
|
138
|
+
),
|
|
139
|
+
},
|
|
140
|
+
};
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Box, useTheme } from '@mui/material';
|
|
3
|
+
import type { HeroProps } from './Hero.types';
|
|
4
|
+
|
|
5
|
+
function resolveBlurRadius(theme: any, blur?: 'none'|'light'|'medium'|'heavy'|'all'): string {
|
|
6
|
+
if (!blur || blur === 'none') return '0px';
|
|
7
|
+
const fromTheme = theme?.custom?.blurRadius?.[blur];
|
|
8
|
+
return fromTheme ?? '0px';
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function resolveOverlayColor(
|
|
12
|
+
theme: any,
|
|
13
|
+
blur?: 'none' | 'light' | 'medium' | 'heavy' | 'all',
|
|
14
|
+
customColor?: string,
|
|
15
|
+
overlayColor?: string
|
|
16
|
+
): string {
|
|
17
|
+
const paletteBlur = blur ? theme?.palette?.blur?.[blur] : undefined;
|
|
18
|
+
|
|
19
|
+
const resolved =
|
|
20
|
+
customColor
|
|
21
|
+
? customColor
|
|
22
|
+
: paletteBlur?.$value
|
|
23
|
+
? paletteBlur.$value
|
|
24
|
+
: typeof paletteBlur === 'string'
|
|
25
|
+
? paletteBlur
|
|
26
|
+
: overlayColor || 'transparent';
|
|
27
|
+
|
|
28
|
+
console.log('resolveOverlayColor inputs:', { blur, customColor, overlayColor, paletteBlur });
|
|
29
|
+
console.log('resolveOverlayColor resolved:', resolved);
|
|
30
|
+
|
|
31
|
+
return resolved;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function resolveMediaFilter(blurRadius: string, blur?: 'none'|'light'|'medium'|'heavy'|'all'): string | undefined {
|
|
35
|
+
if (!blur || blur === 'none') return 'none';
|
|
36
|
+
return blur === 'all' ? 'saturate(1.05) brightness(0.96)' : 'none';
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export const Hero: React.FC<HeroProps> = ({
|
|
40
|
+
backgroundSrc,
|
|
41
|
+
backgroundType = 'image',
|
|
42
|
+
overlayColor,
|
|
43
|
+
children,
|
|
44
|
+
height = '100vh',
|
|
45
|
+
padding = 4,
|
|
46
|
+
blur,
|
|
47
|
+
customColor,
|
|
48
|
+
}) => {
|
|
49
|
+
const theme = useTheme();
|
|
50
|
+
|
|
51
|
+
//console.log('theme.palette.blur:', theme.palette.blur);
|
|
52
|
+
//console.log('theme.custom.blurRadius:', theme.custom.blurRadius);
|
|
53
|
+
//console.log(theme.palette.blur);
|
|
54
|
+
const blurRadius = resolveBlurRadius(theme, blur);
|
|
55
|
+
const overlayBg = resolveOverlayColor(theme, blur, customColor, overlayColor);
|
|
56
|
+
const mediaFilter = resolveMediaFilter(blurRadius, blur);
|
|
57
|
+
|
|
58
|
+
return (
|
|
59
|
+
<Box
|
|
60
|
+
component="section"
|
|
61
|
+
sx={{
|
|
62
|
+
position: 'fixed',
|
|
63
|
+
top: 0,
|
|
64
|
+
left: 0,
|
|
65
|
+
width: '100vw',
|
|
66
|
+
height,
|
|
67
|
+
margin: 0,
|
|
68
|
+
padding: 0,
|
|
69
|
+
overflow: 'hidden',
|
|
70
|
+
display: 'flex',
|
|
71
|
+
alignItems: 'center',
|
|
72
|
+
justifyContent: 'center',
|
|
73
|
+
boxSizing: 'border-box',
|
|
74
|
+
zIndex: 0,
|
|
75
|
+
backgroundColor: 'transparent',
|
|
76
|
+
}}
|
|
77
|
+
>
|
|
78
|
+
{backgroundSrc && (
|
|
79
|
+
<>
|
|
80
|
+
{backgroundType === 'video' ? (
|
|
81
|
+
<Box
|
|
82
|
+
component="video"
|
|
83
|
+
src={backgroundSrc}
|
|
84
|
+
autoPlay
|
|
85
|
+
muted
|
|
86
|
+
loop
|
|
87
|
+
playsInline
|
|
88
|
+
sx={{
|
|
89
|
+
position: 'absolute',
|
|
90
|
+
top: 0,
|
|
91
|
+
left: 0,
|
|
92
|
+
width: '100%',
|
|
93
|
+
height: '100%',
|
|
94
|
+
objectFit: 'cover',
|
|
95
|
+
zIndex: 0,
|
|
96
|
+
filter: mediaFilter,
|
|
97
|
+
willChange: 'transform, filter',
|
|
98
|
+
transform: 'translateZ(0)',
|
|
99
|
+
}}
|
|
100
|
+
/>
|
|
101
|
+
) : (
|
|
102
|
+
<Box
|
|
103
|
+
component="img"
|
|
104
|
+
src={backgroundSrc}
|
|
105
|
+
alt=""
|
|
106
|
+
sx={{
|
|
107
|
+
position: 'absolute',
|
|
108
|
+
top: 0,
|
|
109
|
+
left: 0,
|
|
110
|
+
width: '100%',
|
|
111
|
+
height: '100%',
|
|
112
|
+
objectFit: 'cover',
|
|
113
|
+
zIndex: 0,
|
|
114
|
+
filter: mediaFilter,
|
|
115
|
+
willChange: 'transform, filter',
|
|
116
|
+
transform: 'translateZ(0)',
|
|
117
|
+
}}
|
|
118
|
+
/>
|
|
119
|
+
)}
|
|
120
|
+
|
|
121
|
+
{/* Overlay Layer */}
|
|
122
|
+
<Box
|
|
123
|
+
sx={{
|
|
124
|
+
position: 'absolute',
|
|
125
|
+
top: 0,
|
|
126
|
+
left: 0,
|
|
127
|
+
width: '100%',
|
|
128
|
+
height: '100%',
|
|
129
|
+
backgroundColor: overlayBg,
|
|
130
|
+
// backdropFilter: blur ? `blur(${blurRadius})` : undefined,
|
|
131
|
+
// WebkitBackdropFilter: blur ? `blur(${blurRadius})` : undefined,
|
|
132
|
+
zIndex: 2,
|
|
133
|
+
transition: 'opacity 0.4s ease',
|
|
134
|
+
}}
|
|
135
|
+
/>
|
|
136
|
+
</>
|
|
137
|
+
)}
|
|
138
|
+
|
|
139
|
+
<Box
|
|
140
|
+
sx={{
|
|
141
|
+
position: 'relative',
|
|
142
|
+
zIndex: 3,
|
|
143
|
+
textAlign: 'center',
|
|
144
|
+
color: 'text.primary',
|
|
145
|
+
px: padding,
|
|
146
|
+
}}
|
|
147
|
+
>
|
|
148
|
+
{children}
|
|
149
|
+
</Box>
|
|
150
|
+
</Box>
|
|
151
|
+
);
|
|
152
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface HeroProps {
|
|
2
|
+
/** Imagen, video o GIF de fondo */
|
|
3
|
+
backgroundSrc?: string;
|
|
4
|
+
/** Tipo de medio: 'image' | 'video' | 'gif' */
|
|
5
|
+
backgroundType?: 'image' | 'video' | 'gif';
|
|
6
|
+
/** Color del overlay (default: theme.palette.background.default) */
|
|
7
|
+
overlayColor?: string;
|
|
8
|
+
/** Contenido principal (texto, botones, etc.) */
|
|
9
|
+
children?: React.ReactNode;
|
|
10
|
+
/** Altura opcional (por defecto: 100vh) */
|
|
11
|
+
height?: string | number;
|
|
12
|
+
/** Padding interno (por defecto: responsive según theme.spacing) */
|
|
13
|
+
padding?: number | string;
|
|
14
|
+
/** Nivel de desenfoque: 'none' | 'light' | 'medium' | 'heavy' | 'all' */
|
|
15
|
+
blur?: 'none' | 'light' | 'medium' | 'heavy' | 'all';
|
|
16
|
+
/** Color personalizado del overlay (anula overlayColor si se define) */
|
|
17
|
+
customColor?: string;
|
|
18
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { RegistryEntry } from '@/gui/registry/types';
|
|
3
|
+
import { ensureNodeId } from '@/gui/utils/nodeID';
|
|
4
|
+
import Modal from './Modal';
|
|
5
|
+
import type { ModalProps } from './Modal.types';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* ModalBoxResolver
|
|
9
|
+
* - Declaratively maps a JSON-friendly spec to <ModalBox /> props.
|
|
10
|
+
* - Supports declarative 3D position via xyz prop.
|
|
11
|
+
* - Keeps it registry-compatible for GUI schema systems.
|
|
12
|
+
*/
|
|
13
|
+
const ModalResolver: RegistryEntry = {
|
|
14
|
+
type: 'ModalBox',
|
|
15
|
+
resolve(spec: any) {
|
|
16
|
+
const p: ModalProps = spec.props ?? {};
|
|
17
|
+
const rootProps: any = {
|
|
18
|
+
open: p.open ?? false,
|
|
19
|
+
title: p.title ?? '',
|
|
20
|
+
onClose: p.onClose ?? (() => {}),
|
|
21
|
+
width: p.width ?? 'auto',
|
|
22
|
+
height: p.height ?? 'auto',
|
|
23
|
+
blurBackground: p.blurBackground ?? true,
|
|
24
|
+
xyz: p.xyz,
|
|
25
|
+
id: ensureNodeId('modalbox', p.id),
|
|
26
|
+
className: p.className,
|
|
27
|
+
'data-testid': p['data-testid'],
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<ModalBox {...rootProps}>
|
|
32
|
+
{p.children}
|
|
33
|
+
</ModalBox>
|
|
34
|
+
);
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export default ModalResolver;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import React, { useState } from "react";
|
|
3
|
+
import ModalBox from "./Modal";
|
|
4
|
+
import { Button } from "@mui/material";
|
|
5
|
+
|
|
6
|
+
const meta: Meta<typeof ModalBox> = {
|
|
7
|
+
title: "Molecules/Display/ModalBox",
|
|
8
|
+
component: ModalBox,
|
|
9
|
+
tags: ["autodocs"],
|
|
10
|
+
decorators: [
|
|
11
|
+
(Story) => (
|
|
12
|
+
<div style={{ height: "100vh", overflow: "hidden" }}>
|
|
13
|
+
<Story />
|
|
14
|
+
</div>
|
|
15
|
+
),
|
|
16
|
+
],
|
|
17
|
+
parameters: {
|
|
18
|
+
docs: {
|
|
19
|
+
description: {
|
|
20
|
+
component: `
|
|
21
|
+
**ModalBox** is a flexible, theme-aware modal container with optional background blur and 3D placement support via \`xyz\` props.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
## Features
|
|
25
|
+
- Supports background blur overlay for visual depth.
|
|
26
|
+
- Centered responsive layout with dynamic width and height.
|
|
27
|
+
- Declarative 3D placement via \`xyz: [x, y, z]\`.
|
|
28
|
+
- Works with any child components (forms, dialogs, previews, etc.).
|
|
29
|
+
- Compatible with GUI registry and schema resolvers.
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
## Props
|
|
33
|
+
- \`open\`: Boolean that controls visibility.
|
|
34
|
+
- \`title\`: Optional modal header title.
|
|
35
|
+
- \`onClose\`: Function triggered when closing.
|
|
36
|
+
- \`width\`, \`height\`: Custom modal dimensions.
|
|
37
|
+
- \`blurBackground\`: Enables or disables background blur.
|
|
38
|
+
- \`xyz\`: 3D position array for spatial positioning.
|
|
39
|
+
- \`children\`: Modal content.
|
|
40
|
+
`,
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
export default meta;
|
|
46
|
+
type Story = StoryObj<typeof ModalBox>;
|
|
47
|
+
|
|
48
|
+
export const Default: Story = {
|
|
49
|
+
render: (args) => {
|
|
50
|
+
const [open, setOpen] = useState(true); // force open for debugging
|
|
51
|
+
console.log("ModalBox render", { open, args });
|
|
52
|
+
|
|
53
|
+
return (
|
|
54
|
+
<div
|
|
55
|
+
style={{
|
|
56
|
+
position: "relative",
|
|
57
|
+
height: "100vh",
|
|
58
|
+
background: "rgba(0,0,0,0.2)",
|
|
59
|
+
display: "flex",
|
|
60
|
+
alignItems: "center",
|
|
61
|
+
justifyContent: "center",
|
|
62
|
+
}}
|
|
63
|
+
>
|
|
64
|
+
<ModalBox
|
|
65
|
+
{...args}
|
|
66
|
+
open={open}
|
|
67
|
+
onClose={() => setOpen(false)}
|
|
68
|
+
title={args.title || "Modal Title"}
|
|
69
|
+
>
|
|
70
|
+
<p style={{ color: "#fff" }}>This is an example modal content.</p>
|
|
71
|
+
<p style={{ color: "#ccc" }}>If you see this text, the modal is visible.</p>
|
|
72
|
+
</ModalBox>
|
|
73
|
+
</div>
|
|
74
|
+
);
|
|
75
|
+
},
|
|
76
|
+
args: {
|
|
77
|
+
title: "Example Modal",
|
|
78
|
+
blurBackground: true,
|
|
79
|
+
width: 400,
|
|
80
|
+
height: "auto",
|
|
81
|
+
},
|
|
82
|
+
};
|