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,394 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* This.GUI — Noise
|
|
3
|
+
*
|
|
4
|
+
* A declarative "ME-aware" input that can write values into the ME tree using an operator.
|
|
5
|
+
*
|
|
6
|
+
* Primary goals
|
|
7
|
+
* - Be UI-engine agnostic by importing from This.GUI atoms/molecules (not @mui/material).
|
|
8
|
+
* - Support different input "kinds" (text, switch, slider). Expand later.
|
|
9
|
+
* - Provide a consistent way to:
|
|
10
|
+
* - display an input
|
|
11
|
+
* - show state (dirty / committed / error)
|
|
12
|
+
* - optionally commit via a check button
|
|
13
|
+
*
|
|
14
|
+
* Notes
|
|
15
|
+
* - We keep this component deliberately small and composable.
|
|
16
|
+
* - It does NOT assume a global ME; you pass `me` in.
|
|
17
|
+
* - Operator is applied by selecting an operator function from `me`.
|
|
18
|
+
* Example: operator="@" => me["@"](value)
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
import * as React from 'react';
|
|
22
|
+
import { Box, Button, IconButton, Switch, Typography } from '@/gui/components/atoms';
|
|
23
|
+
import Modal from '@/gui/components/molecules/Modal/Modal';
|
|
24
|
+
import Icon from '@/gui/Theme/Icon/Icon';
|
|
25
|
+
|
|
26
|
+
type NoiseKind = 'text' | 'switch' | 'slider';
|
|
27
|
+
|
|
28
|
+
type CommitOn = 'change' | 'blur' | 'check' | 'enter';
|
|
29
|
+
|
|
30
|
+
export type NoiseProps = {
|
|
31
|
+
/** ME runtime (proxy) */
|
|
32
|
+
me: any;
|
|
33
|
+
|
|
34
|
+
/** Semantic path inside ME, e.g. "profile.name" or "wallet.netget.keys" */
|
|
35
|
+
path: string;
|
|
36
|
+
|
|
37
|
+
/** Operator to call at the target path. Common: "=" for assign, "@" identity, "~" noise, "_" secret */
|
|
38
|
+
operator?: string;
|
|
39
|
+
|
|
40
|
+
/** Label shown above/alongside the input */
|
|
41
|
+
label?: string;
|
|
42
|
+
|
|
43
|
+
/** Placeholder (text kind) */
|
|
44
|
+
placeholder?: string;
|
|
45
|
+
|
|
46
|
+
/** Input kind */
|
|
47
|
+
kind?: NoiseKind;
|
|
48
|
+
|
|
49
|
+
/** Initial value to seed draft (if ME read is undefined) */
|
|
50
|
+
defaultValue?: any;
|
|
51
|
+
|
|
52
|
+
/** Commit policy */
|
|
53
|
+
commitOn?: CommitOn;
|
|
54
|
+
|
|
55
|
+
/** Whether to show the explicit check commit button */
|
|
56
|
+
showCheck?: boolean;
|
|
57
|
+
|
|
58
|
+
/** If true, reads from ME on mount and whenever `path` changes */
|
|
59
|
+
syncFromMe?: boolean;
|
|
60
|
+
|
|
61
|
+
/** Optional: width control (e.g. '25%') */
|
|
62
|
+
width?: number | string;
|
|
63
|
+
|
|
64
|
+
/** Optional: sx overrides */
|
|
65
|
+
sx?: any;
|
|
66
|
+
|
|
67
|
+
/** Helpers */
|
|
68
|
+
disabled?: boolean;
|
|
69
|
+
readOnly?: boolean;
|
|
70
|
+
|
|
71
|
+
/** Optional: help modal content */
|
|
72
|
+
infoTitle?: string;
|
|
73
|
+
info?: React.ReactNode;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
function safeGetPath(me: any, path: string): any {
|
|
77
|
+
if (!me) return undefined;
|
|
78
|
+
const p = String(path || '').trim();
|
|
79
|
+
if (!p) return undefined;
|
|
80
|
+
|
|
81
|
+
// Prefer root-get style if available: me("a.b.c")
|
|
82
|
+
try {
|
|
83
|
+
if (typeof me === 'function') return me(p);
|
|
84
|
+
} catch {
|
|
85
|
+
// ignore
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// Fallback: traverse properties.
|
|
89
|
+
try {
|
|
90
|
+
return p.split('.').filter(Boolean).reduce((acc: any, k: string) => (acc ? acc[k] : undefined), me);
|
|
91
|
+
} catch {
|
|
92
|
+
return undefined;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function getTargetProxy(me: any, path: string): any {
|
|
97
|
+
const p = String(path || '').trim();
|
|
98
|
+
if (!p) return me;
|
|
99
|
+
return p.split('.').filter(Boolean).reduce((acc: any, k: string) => (acc ? acc[k] : undefined), me);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export default function Noise({
|
|
103
|
+
me,
|
|
104
|
+
path,
|
|
105
|
+
operator = '=',
|
|
106
|
+
label = 'Noise',
|
|
107
|
+
placeholder,
|
|
108
|
+
kind = 'text',
|
|
109
|
+
defaultValue,
|
|
110
|
+
commitOn = 'check',
|
|
111
|
+
showCheck = true,
|
|
112
|
+
syncFromMe = true,
|
|
113
|
+
width = '100%',
|
|
114
|
+
sx,
|
|
115
|
+
disabled,
|
|
116
|
+
readOnly,
|
|
117
|
+
infoTitle = 'About this field',
|
|
118
|
+
info,
|
|
119
|
+
}: NoiseProps) {
|
|
120
|
+
const [draft, setDraft] = React.useState<any>(defaultValue ?? '');
|
|
121
|
+
const [committed, setCommitted] = React.useState<any>(undefined);
|
|
122
|
+
const [dirty, setDirty] = React.useState(false);
|
|
123
|
+
const [status, setStatus] = React.useState<'idle' | 'ok' | 'error'>('idle');
|
|
124
|
+
const [error, setError] = React.useState<string | null>(null);
|
|
125
|
+
const [infoOpen, setInfoOpen] = React.useState(false);
|
|
126
|
+
|
|
127
|
+
// Seed from ME
|
|
128
|
+
React.useEffect(() => {
|
|
129
|
+
if (!syncFromMe) return;
|
|
130
|
+
const v = safeGetPath(me, path);
|
|
131
|
+
if (v !== undefined) {
|
|
132
|
+
setDraft(v);
|
|
133
|
+
setCommitted(v);
|
|
134
|
+
setDirty(false);
|
|
135
|
+
setStatus('idle');
|
|
136
|
+
setError(null);
|
|
137
|
+
} else if (defaultValue !== undefined) {
|
|
138
|
+
setDraft(defaultValue);
|
|
139
|
+
setCommitted(undefined);
|
|
140
|
+
setDirty(false);
|
|
141
|
+
setStatus('idle');
|
|
142
|
+
setError(null);
|
|
143
|
+
}
|
|
144
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
145
|
+
}, [me, path]);
|
|
146
|
+
|
|
147
|
+
const commit = React.useCallback(
|
|
148
|
+
(nextValue?: any) => {
|
|
149
|
+
const valueToCommit = nextValue !== undefined ? nextValue : draft;
|
|
150
|
+
try {
|
|
151
|
+
const target = getTargetProxy(me, path);
|
|
152
|
+
if (!target) throw new Error(`Invalid ME path: ${path}`);
|
|
153
|
+
|
|
154
|
+
const opFn = target?.[operator];
|
|
155
|
+
if (typeof opFn !== 'function') {
|
|
156
|
+
throw new Error(`Operator '${operator}' not found at path '${path}'.`);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
// Execute operator call
|
|
160
|
+
opFn(valueToCommit);
|
|
161
|
+
|
|
162
|
+
setCommitted(valueToCommit);
|
|
163
|
+
setDirty(false);
|
|
164
|
+
setStatus('ok');
|
|
165
|
+
setError(null);
|
|
166
|
+
|
|
167
|
+
// Return focus status back to idle after a moment (non-blocking UI)
|
|
168
|
+
window.setTimeout(() => setStatus('idle'), 900);
|
|
169
|
+
} catch (e: any) {
|
|
170
|
+
setStatus('error');
|
|
171
|
+
setError(e?.message ?? 'Commit failed');
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
[draft, me, operator, path]
|
|
175
|
+
);
|
|
176
|
+
|
|
177
|
+
const onChangeText = (e: React.ChangeEvent<HTMLInputElement>) => {
|
|
178
|
+
const v = e.target.value;
|
|
179
|
+
setDraft(v);
|
|
180
|
+
setDirty(true);
|
|
181
|
+
setStatus('idle');
|
|
182
|
+
setError(null);
|
|
183
|
+
if (commitOn === 'change') commit(v);
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
const onBlur = () => {
|
|
187
|
+
if (commitOn === 'blur' && dirty) commit();
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
const onKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {
|
|
191
|
+
if (commitOn === 'enter' && e.key === 'Enter') {
|
|
192
|
+
e.preventDefault();
|
|
193
|
+
commit();
|
|
194
|
+
}
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
const onToggle = (_: any, checked?: boolean) => {
|
|
198
|
+
// Switch from MUI passes (event, checked)
|
|
199
|
+
const v = typeof checked === 'boolean' ? checked : !!(_?.target?.checked);
|
|
200
|
+
setDraft(v);
|
|
201
|
+
setDirty(true);
|
|
202
|
+
setStatus('idle');
|
|
203
|
+
setError(null);
|
|
204
|
+
if (commitOn === 'change') commit(v);
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
const borderColor =
|
|
208
|
+
status === 'error' ? 'error.main' : status === 'ok' ? 'success.main' : 'divider';
|
|
209
|
+
|
|
210
|
+
const bgColor = status === 'ok' ? 'success.muted' : 'background.paper';
|
|
211
|
+
|
|
212
|
+
return (
|
|
213
|
+
<Box
|
|
214
|
+
sx={{
|
|
215
|
+
width,
|
|
216
|
+
display: 'flex',
|
|
217
|
+
flexDirection: 'column',
|
|
218
|
+
gap: 1,
|
|
219
|
+
...sx,
|
|
220
|
+
}}
|
|
221
|
+
>
|
|
222
|
+
<Box sx={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: 1 }}>
|
|
223
|
+
<Typography variant="subtitle2" sx={{ color: 'text.secondary' }}>
|
|
224
|
+
{label}
|
|
225
|
+
</Typography>
|
|
226
|
+
|
|
227
|
+
{info ? (
|
|
228
|
+
<IconButton
|
|
229
|
+
size="small"
|
|
230
|
+
aria-label="Info"
|
|
231
|
+
onClick={() => setInfoOpen(true)}
|
|
232
|
+
sx={{
|
|
233
|
+
border: '1px solid',
|
|
234
|
+
borderColor: 'divider',
|
|
235
|
+
borderRadius: 999,
|
|
236
|
+
bgcolor: 'background.paper',
|
|
237
|
+
}}
|
|
238
|
+
>
|
|
239
|
+
<Icon name="info" />
|
|
240
|
+
</IconButton>
|
|
241
|
+
) : null}
|
|
242
|
+
</Box>
|
|
243
|
+
|
|
244
|
+
<Box
|
|
245
|
+
sx={{
|
|
246
|
+
position: 'relative',
|
|
247
|
+
display: 'flex',
|
|
248
|
+
alignItems: 'center',
|
|
249
|
+
gap: 1,
|
|
250
|
+
border: '1px solid',
|
|
251
|
+
borderColor,
|
|
252
|
+
borderRadius: 2,
|
|
253
|
+
px: 1.25,
|
|
254
|
+
py: 0.75,
|
|
255
|
+
bgcolor: bgColor,
|
|
256
|
+
transition: 'border-color 160ms ease, background-color 160ms ease',
|
|
257
|
+
minHeight: 44,
|
|
258
|
+
}}
|
|
259
|
+
>
|
|
260
|
+
{/* Border placeholder (path) */}
|
|
261
|
+
{path ? (
|
|
262
|
+
<Box
|
|
263
|
+
component="span"
|
|
264
|
+
sx={{
|
|
265
|
+
position: 'absolute',
|
|
266
|
+
top: 0,
|
|
267
|
+
left: 52, // after operator badge area
|
|
268
|
+
transform: 'translateY(-50%)',
|
|
269
|
+
px: 0.75,
|
|
270
|
+
py: 0.15,
|
|
271
|
+
borderRadius: 999,
|
|
272
|
+
bgcolor: bgColor,
|
|
273
|
+
color: 'text.disabled',
|
|
274
|
+
fontSize: 11,
|
|
275
|
+
lineHeight: 1.1,
|
|
276
|
+
fontFamily: 'monospace',
|
|
277
|
+
letterSpacing: 0.2,
|
|
278
|
+
userSelect: 'none',
|
|
279
|
+
pointerEvents: 'none',
|
|
280
|
+
maxWidth: 'calc(100% - 120px)',
|
|
281
|
+
overflow: 'hidden',
|
|
282
|
+
textOverflow: 'ellipsis',
|
|
283
|
+
whiteSpace: 'nowrap',
|
|
284
|
+
}}
|
|
285
|
+
title={path}
|
|
286
|
+
>
|
|
287
|
+
{path}
|
|
288
|
+
</Box>
|
|
289
|
+
) : null}
|
|
290
|
+
|
|
291
|
+
{/* Left operator badge */}
|
|
292
|
+
<Box
|
|
293
|
+
sx={{
|
|
294
|
+
px: 1,
|
|
295
|
+
py: 0.25,
|
|
296
|
+
borderRadius: 999,
|
|
297
|
+
border: '1px solid',
|
|
298
|
+
borderColor: 'divider',
|
|
299
|
+
bgcolor: 'background.default',
|
|
300
|
+
color: 'text.secondary',
|
|
301
|
+
fontFamily: 'monospace',
|
|
302
|
+
fontSize: 12,
|
|
303
|
+
lineHeight: 1.2,
|
|
304
|
+
userSelect: 'none',
|
|
305
|
+
}}
|
|
306
|
+
title={`operator: ${operator}`}
|
|
307
|
+
>
|
|
308
|
+
{operator}
|
|
309
|
+
</Box>
|
|
310
|
+
|
|
311
|
+
{/* The input */}
|
|
312
|
+
{kind === 'switch' ? (
|
|
313
|
+
<Box sx={{ display: 'flex', alignItems: 'center', gap: 1, flex: 1 }}>
|
|
314
|
+
<Switch
|
|
315
|
+
checked={!!draft}
|
|
316
|
+
onChange={onToggle as any}
|
|
317
|
+
disabled={disabled}
|
|
318
|
+
inputProps={{ 'aria-label': label }}
|
|
319
|
+
/>
|
|
320
|
+
<Typography variant="body2" sx={{ color: 'text.secondary' }}>
|
|
321
|
+
{String(!!draft)}
|
|
322
|
+
</Typography>
|
|
323
|
+
</Box>
|
|
324
|
+
) : (
|
|
325
|
+
<Box sx={{ flex: 1, display: 'flex', alignItems: 'center' }}>
|
|
326
|
+
{/* We intentionally use a plain input for now to avoid requiring TextField atom here.
|
|
327
|
+
If you already have TextField in atoms, swap this input for <TextField ... />.
|
|
328
|
+
*/}
|
|
329
|
+
<Box
|
|
330
|
+
component="input"
|
|
331
|
+
value={draft ?? ''}
|
|
332
|
+
placeholder={placeholder}
|
|
333
|
+
disabled={disabled}
|
|
334
|
+
readOnly={readOnly}
|
|
335
|
+
onChange={onChangeText}
|
|
336
|
+
onBlur={onBlur}
|
|
337
|
+
onKeyDown={onKeyDown}
|
|
338
|
+
sx={{
|
|
339
|
+
width: '100%',
|
|
340
|
+
border: 0,
|
|
341
|
+
outline: 'none',
|
|
342
|
+
bgcolor: 'transparent',
|
|
343
|
+
color: 'text.primary',
|
|
344
|
+
fontSize: 14,
|
|
345
|
+
lineHeight: 1.4,
|
|
346
|
+
}}
|
|
347
|
+
/>
|
|
348
|
+
</Box>
|
|
349
|
+
)}
|
|
350
|
+
|
|
351
|
+
{/* Commit controls */}
|
|
352
|
+
{showCheck ? (
|
|
353
|
+
<Button
|
|
354
|
+
variant="outlined"
|
|
355
|
+
size="small"
|
|
356
|
+
disabled={disabled || readOnly || (!dirty && committed !== undefined)}
|
|
357
|
+
onClick={() => commit()}
|
|
358
|
+
sx={{
|
|
359
|
+
minWidth: 36,
|
|
360
|
+
px: 1,
|
|
361
|
+
py: 0.5,
|
|
362
|
+
borderRadius: 2,
|
|
363
|
+
textTransform: 'none',
|
|
364
|
+
}}
|
|
365
|
+
aria-label="Commit"
|
|
366
|
+
>
|
|
367
|
+
<Icon name="check" />
|
|
368
|
+
</Button>
|
|
369
|
+
) : null}
|
|
370
|
+
</Box>
|
|
371
|
+
|
|
372
|
+
{/* Status / error line */}
|
|
373
|
+
{error ? (
|
|
374
|
+
<Typography variant="caption" sx={{ color: 'error.main' }}>
|
|
375
|
+
{error}
|
|
376
|
+
</Typography>
|
|
377
|
+
) : null}
|
|
378
|
+
|
|
379
|
+
{info ? (
|
|
380
|
+
<Modal open={infoOpen} onClose={() => setInfoOpen(false)} title={infoTitle} width={520}>
|
|
381
|
+
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 1 }}>
|
|
382
|
+
{typeof info === 'string' ? (
|
|
383
|
+
<Typography variant="body2" sx={{ color: 'text.secondary' }}>
|
|
384
|
+
{info}
|
|
385
|
+
</Typography>
|
|
386
|
+
) : (
|
|
387
|
+
info
|
|
388
|
+
)}
|
|
389
|
+
</Box>
|
|
390
|
+
</Modal>
|
|
391
|
+
) : null}
|
|
392
|
+
</Box>
|
|
393
|
+
);
|
|
394
|
+
}
|