this.gui 1.3.41 → 1.3.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -2
- package/src/GUI.tsx +46 -0
- package/src/QRouter/QRegistry.tsx +53 -0
- package/src/QRouter/QRouter.stories.tsx +31 -0
- package/src/QRouter/QRouter.tsx +57 -0
- package/src/gui/Theme/GuiProvider.tsx +111 -0
- package/src/gui/Theme/Icon/Icon.resolver.tsx +29 -0
- package/src/gui/Theme/Icon/Icon.tsx +43 -0
- package/src/gui/Theme/Layout/Content/Content.resolver.tsx +0 -0
- package/src/gui/Theme/Layout/Content/Content.stories.tsx +88 -0
- package/src/gui/Theme/Layout/Content/Content.tsx +53 -0
- package/src/gui/Theme/Layout/Content/Content.types.tsx +40 -0
- package/src/gui/Theme/Layout/Footer/Footer.resolver.tsx +45 -0
- package/src/gui/Theme/Layout/Footer/Footer.stories.tsx +205 -0
- package/src/gui/Theme/Layout/Footer/Footer.tsx +337 -0
- package/src/gui/Theme/Layout/Footer/Footer.types.ts +40 -0
- package/src/gui/Theme/Layout/Layout/Layout.resolver.tsx +37 -0
- package/src/gui/Theme/Layout/Layout/Layout.stories.tsx +289 -0
- package/src/gui/Theme/Layout/Layout/Layout.tsx +117 -0
- package/src/gui/Theme/Layout/Layout/Layout.types.ts +57 -0
- package/src/gui/Theme/Layout/Layout/useLayoutBreakpoints.ts +9 -0
- package/src/gui/Theme/Layout/Namespace/Namespace.stories.tsx +105 -0
- package/src/gui/Theme/Layout/Namespace/Namespace.tsx +26 -0
- package/src/gui/Theme/Layout/Sidebars/LeftSidebar/LeftSidebar.resolver.tsx +87 -0
- package/src/gui/Theme/Layout/Sidebars/LeftSidebar/LeftSidebar.stories.tsx +199 -0
- package/src/gui/Theme/Layout/Sidebars/LeftSidebar/LeftSidebar.tsx +311 -0
- package/src/gui/Theme/Layout/Sidebars/LeftSidebar/LeftSidebar.types.ts +41 -0
- package/src/gui/Theme/Layout/Sidebars/LeftSidebar/SidebarToggleButton.tsx +53 -0
- package/src/gui/Theme/Layout/Sidebars/LeftSidebar/components/LeftSidebarAction/LeftSidebarAction.resolver.tsx +19 -0
- package/src/gui/Theme/Layout/Sidebars/LeftSidebar/components/LeftSidebarAction/LeftSidebarAction.tsx +107 -0
- package/src/gui/Theme/Layout/Sidebars/LeftSidebar/components/LeftSidebarLink/LeftSidebarLink.resolver.tsx +0 -0
- package/src/gui/Theme/Layout/Sidebars/LeftSidebar/components/LeftSidebarLink/LeftSidebarLink.tsx +134 -0
- package/src/gui/Theme/Layout/Sidebars/LeftSidebar/components/LeftSidebarLink/LeftSidebarLink.types.ts +15 -0
- package/src/gui/Theme/Layout/Sidebars/LeftSidebar/components/LeftSidebarMenu/LeftSidebarMenu.tsx +142 -0
- package/src/gui/Theme/Layout/Sidebars/LeftSidebar/components/LeftSidebarToggleButton/LeftSidebarToggleButton.tsx +23 -0
- package/src/gui/Theme/Layout/Sidebars/RightSidebar/RightSidebar.resolver.tsx +35 -0
- package/src/gui/Theme/Layout/Sidebars/RightSidebar/RightSidebar.stories.tsx +239 -0
- package/src/gui/Theme/Layout/Sidebars/RightSidebar/RightSidebar.tsx +319 -0
- package/src/gui/Theme/Layout/Sidebars/RightSidebar/RightSidebar.types.ts +17 -0
- package/src/gui/Theme/Layout/Sidebars/RightSidebar/components/RightSidebarAction/RightSidebarAction.tsx +102 -0
- package/src/gui/Theme/Layout/Sidebars/RightSidebar/components/RightSidebarLink/RightSidebarLink.tsx +132 -0
- package/src/gui/Theme/Layout/Sidebars/RightSidebar/components/RightSidebarMenu/RightSidebarMenu.tsx +140 -0
- package/src/gui/Theme/Layout/Sidebars/RightSidebar/components/RightSidebarToggleButton/RightSidebarToggleButton.tsx +22 -0
- package/src/gui/Theme/Layout/StickyOptions/StickyOptionsTop.stories.tsx +469 -0
- package/src/gui/Theme/Layout/StickyOptions/StickyOptionsTop.tsx +489 -0
- package/src/gui/Theme/Layout/TopBar/TopBar.resolver.tsx +86 -0
- package/src/gui/Theme/Layout/TopBar/TopBar.stories.tsx +350 -0
- package/src/gui/Theme/Layout/TopBar/TopBar.tsx +292 -0
- package/src/gui/Theme/Layout/TopBar/TopBar.types.ts +39 -0
- package/src/gui/Theme/Layout/TopBar/components/TopBarAction/TopBarAction.stories.tsx +83 -0
- package/src/gui/Theme/Layout/TopBar/components/TopBarAction/TopBarAction.tsx +18 -0
- package/src/gui/Theme/Layout/TopBar/components/TopBarAction/TopBarAction.types.ts +4 -0
- package/src/gui/Theme/Layout/TopBar/components/TopBarLink/TopBarLink.stories.tsx +189 -0
- package/src/gui/Theme/Layout/TopBar/components/TopBarLink/TopBarLink.tsx +30 -0
- package/src/gui/Theme/Layout/TopBar/components/TopBarLink/TopBarLink.types.ts +9 -0
- package/src/gui/Theme/Layout/TopBar/components/TopBarMenu/TopBarMenu.resolver.tsx +14 -0
- package/src/gui/Theme/Layout/TopBar/components/TopBarMenu/TopBarMenu.stories.tsx +56 -0
- package/src/gui/Theme/Layout/TopBar/components/TopBarMenu/TopBarMenu.tsx +123 -0
- package/src/gui/Theme/Layout/TopBar/components/TopBarMenu/TopBarMenu.types.ts +44 -0
- package/src/gui/Theme/catalog/CherryByte/CherryByte.png +0 -0
- package/src/gui/Theme/catalog/CherryByte/dark.tokens.ts +47 -0
- package/src/gui/Theme/catalog/CherryByte/light.tokens.ts +47 -0
- package/src/gui/Theme/catalog/CherryByte/manifest.ts +24 -0
- package/src/gui/Theme/catalog/GhostShell/dark.tokens.ts +43 -0
- package/src/gui/Theme/catalog/GhostShell/ghost.png +0 -0
- package/src/gui/Theme/catalog/GhostShell/light.tokens.ts +39 -0
- package/src/gui/Theme/catalog/GhostShell/manifest.ts +24 -0
- package/src/gui/Theme/catalog/LunaHex/LunaHex.png +0 -0
- package/src/gui/Theme/catalog/LunaHex/dark.tokens.ts +34 -0
- package/src/gui/Theme/catalog/LunaHex/light.tokens.ts +74 -0
- package/src/gui/Theme/catalog/LunaHex/manifest.ts +24 -0
- package/src/gui/Theme/catalog/MUI/MUI.png +0 -0
- package/src/gui/Theme/catalog/MUI/dark.tokens.ts +58 -0
- package/src/gui/Theme/catalog/MUI/light.tokens.ts +74 -0
- package/src/gui/Theme/catalog/MUI/manifest.ts +24 -0
- package/src/gui/Theme/catalog/PrinceOfDarkness/dark.tokens.ts +48 -0
- package/src/gui/Theme/catalog/PrinceOfDarkness/light.tokens.ts +47 -0
- package/src/gui/Theme/catalog/PrinceOfDarkness/manifest.ts +24 -0
- package/src/gui/Theme/catalog/PrinceOfDarkness/prince.png +0 -0
- package/src/gui/Theme/catalog/PrinceOfDarkness/princeOfDarkness.png +0 -0
- package/src/gui/Theme/catalog/Seafoam/dark.tokens.ts +49 -0
- package/src/gui/Theme/catalog/Seafoam/light.tokens.ts +47 -0
- package/src/gui/Theme/catalog/Seafoam/manifest.ts +24 -0
- package/src/gui/Theme/catalog/Seafoam/seaFoam.png +0 -0
- package/src/gui/Theme/catalog/neurons/dark.tokens.ts +58 -0
- package/src/gui/Theme/catalog/neurons/light.tokens.ts +74 -0
- package/src/gui/Theme/catalog/neurons/manifest.ts +24 -0
- package/src/gui/Theme/catalog/neurons/neurons.me.png +0 -0
- package/src/gui/Theme/fromTokens.ts +272 -0
- package/src/gui/Theme/gui.css +31 -0
- package/src/gui/Theme/index.ts +17 -0
- package/src/gui/Theme/styles/buildShadows.ts +83 -0
- package/src/gui/Theme/styles/theme.tokens.ts +108 -0
- package/src/gui/Theme/utils/catalog.ts +61 -0
- package/src/gui/Theme/utils/persistence.ts +66 -0
- package/src/gui/Theme/utils/themeUtils.ts +34 -0
- package/src/gui/components/atoms/AppBar/AppBar.resolver.tsx +46 -0
- package/src/gui/components/atoms/AppBar/AppBar.stories.tsx +251 -0
- package/src/gui/components/atoms/AppBar/AppBar.tsx +107 -0
- package/src/gui/components/atoms/AppBar/AppBar.types.ts +28 -0
- package/src/gui/components/atoms/Avatar/Avatar.resolver.tsx +61 -0
- package/src/gui/components/atoms/Avatar/Avatar.stories.tsx +36 -0
- package/src/gui/components/atoms/Avatar/Avatar.tsx +14 -0
- package/src/gui/components/atoms/Box/Box.resolver.tsx +171 -0
- package/src/gui/components/atoms/Box/Box.stories.tsx +263 -0
- package/src/gui/components/atoms/Box/Box.tsx +15 -0
- package/src/gui/components/atoms/Button/Button.resolver.tsx +103 -0
- package/src/gui/components/atoms/Button/Button.stories.tsx +219 -0
- package/src/gui/components/atoms/Button/Button.tsx +40 -0
- package/src/gui/components/atoms/Card/Card.resolver.tsx +63 -0
- package/src/gui/components/atoms/Card/Card.stories.tsx +54 -0
- package/src/gui/components/atoms/Card/Card.tsx +13 -0
- package/src/gui/components/atoms/CardActions/CardActions.resolver.tsx +59 -0
- package/src/gui/components/atoms/CardActions/CardActions.stories.tsx +32 -0
- package/src/gui/components/atoms/CardActions/CardActions.tsx +14 -0
- package/src/gui/components/atoms/CardContent/CardContent.resolver.tsx +60 -0
- package/src/gui/components/atoms/CardContent/CardContent.stories.tsx +34 -0
- package/src/gui/components/atoms/CardContent/CardContent.tsx +13 -0
- package/src/gui/components/atoms/CardHeader/CardHeader.resolver.tsx +68 -0
- package/src/gui/components/atoms/CardHeader/CardHeader.stories.tsx +40 -0
- package/src/gui/components/atoms/CardHeader/CardHeader.tsx +12 -0
- package/src/gui/components/atoms/Collapse/Collapse.resolver.tsx +85 -0
- package/src/gui/components/atoms/Collapse/Collapse.stories.tsx +130 -0
- package/src/gui/components/atoms/Collapse/Collapse.tsx +17 -0
- package/src/gui/components/atoms/Divider/Divider.resolver.tsx +95 -0
- package/src/gui/components/atoms/Divider/Divider.stories.tsx +108 -0
- package/src/gui/components/atoms/Divider/Divider.tsx +14 -0
- package/src/gui/components/atoms/Drawer/Drawer.resolver.tsx +116 -0
- package/src/gui/components/atoms/Drawer/Drawer.stories.tsx +223 -0
- package/src/gui/components/atoms/Drawer/Drawer.tsx +25 -0
- package/src/gui/components/atoms/Grid/Grid.resolver.tsx +33 -0
- package/src/gui/components/atoms/Grid/Grid.stories.tsx +136 -0
- package/src/gui/components/atoms/Grid/Grid.tsx +15 -0
- package/src/gui/components/atoms/Grid/Grid.types.ts +9 -0
- package/src/gui/components/atoms/IconButton/IconButton.resolver.tsx +137 -0
- package/src/gui/components/atoms/IconButton/IconButton.stories.tsx +134 -0
- package/src/gui/components/atoms/IconButton/IconButton.tsx +22 -0
- package/src/gui/components/atoms/Link/Link.resolver.tsx +74 -0
- package/src/gui/components/atoms/Link/Link.stories.tsx +157 -0
- package/src/gui/components/atoms/Link/Link.tsx +36 -0
- package/src/gui/components/atoms/List/List.resolver.tsx +94 -0
- package/src/gui/components/atoms/List/List.stories.tsx +137 -0
- package/src/gui/components/atoms/List/List.tsx +20 -0
- package/src/gui/components/atoms/ListItem/ListItem.resolver.tsx +88 -0
- package/src/gui/components/atoms/ListItem/ListItem.stories.tsx +151 -0
- package/src/gui/components/atoms/ListItem/ListItem.tsx +19 -0
- package/src/gui/components/atoms/ListItemButton/ListItemButton.resolver.tsx +214 -0
- package/src/gui/components/atoms/ListItemButton/ListItemButton.stories.tsx +155 -0
- package/src/gui/components/atoms/ListItemButton/ListItemButton.tsx +15 -0
- package/src/gui/components/atoms/ListItemIcon/ListItemIcon.resolver.tsx +102 -0
- package/src/gui/components/atoms/ListItemIcon/ListItemIcon.stories.tsx +132 -0
- package/src/gui/components/atoms/ListItemIcon/ListItemIcon.tsx +11 -0
- package/src/gui/components/atoms/ListItemText/ListItemText.resolver.tsx +112 -0
- package/src/gui/components/atoms/ListItemText/ListItemText.stories.tsx +156 -0
- package/src/gui/components/atoms/ListItemText/ListItemText.tsx +15 -0
- package/src/gui/components/atoms/Menu/Menu.resolver.tsx +112 -0
- package/src/gui/components/atoms/Menu/Menu.stories.tsx +162 -0
- package/src/gui/components/atoms/Menu/Menu.tsx +17 -0
- package/src/gui/components/atoms/MenuItem/MenuItem.resolver.tsx +183 -0
- package/src/gui/components/atoms/MenuItem/MenuItem.stories.tsx +134 -0
- package/src/gui/components/atoms/MenuItem/MenuItem.tsx +14 -0
- package/src/gui/components/atoms/Paper/Paper.resolver.tsx +98 -0
- package/src/gui/components/atoms/Paper/Paper.stories.tsx +184 -0
- package/src/gui/components/atoms/Paper/Paper.tsx +15 -0
- package/src/gui/components/atoms/Section/Section.resolver.tsx +10 -0
- package/src/gui/components/atoms/Section/Section.stories.tsx +189 -0
- package/src/gui/components/atoms/Section/Section.tsx +76 -0
- package/src/gui/components/atoms/Section/Section.types.tsx +24 -0
- package/src/gui/components/atoms/Stack/Stack.resolver.tsx +94 -0
- package/src/gui/components/atoms/Stack/Stack.stories.tsx +160 -0
- package/src/gui/components/atoms/Stack/Stack.tsx +15 -0
- package/src/gui/components/atoms/Surface/Surface.resolver.tsx +37 -0
- package/src/gui/components/atoms/Surface/Surface.tsx +49 -0
- package/src/gui/components/atoms/Surface/Surface.types.ts +20 -0
- package/src/gui/components/atoms/Switch/Switch.resolver.tsx +53 -0
- package/src/gui/components/atoms/Switch/Switch.stories.tsx +236 -0
- package/src/gui/components/atoms/Switch/Switch.tsx +22 -0
- package/src/gui/components/atoms/Table/Body/TableBody.tsx +7 -0
- package/src/gui/components/atoms/Table/Cell/TableCell.tsx +18 -0
- package/src/gui/components/atoms/Table/Head/TableHead.tsx +9 -0
- package/src/gui/components/atoms/Table/Row/TableRow.tsx +20 -0
- package/src/gui/components/atoms/Table/Table.resolver.tsx +77 -0
- package/src/gui/components/atoms/Table/Table.stories.tsx +173 -0
- package/src/gui/components/atoms/Table/Table.tsx +20 -0
- package/src/gui/components/atoms/TextField/TextField.stories.tsx +25 -0
- package/src/gui/components/atoms/TextField/TextField.tsx +15 -0
- package/src/gui/components/atoms/Toolbar/Toolbar.resolver.tsx +60 -0
- package/src/gui/components/atoms/Toolbar/Toolbar.stories.tsx +155 -0
- package/src/gui/components/atoms/Toolbar/Toolbar.tsx +16 -0
- package/src/gui/components/atoms/Tooltip/Tooltip.resolver.tsx +142 -0
- package/src/gui/components/atoms/Tooltip/Tooltip.stories.tsx +117 -0
- package/src/gui/components/atoms/Tooltip/Tooltip.tsx +70 -0
- package/src/gui/components/atoms/Typography/Typography.resolver.tsx +158 -0
- package/src/gui/components/atoms/Typography/Typography.stories.tsx +222 -0
- package/src/gui/components/atoms/Typography/Typography.tsx +27 -0
- package/src/gui/components/atoms/Window/Nodes/node.ts +0 -0
- package/src/gui/components/atoms/Window/code/block/node.tsx +0 -0
- package/src/gui/components/atoms/Window/code/hugging.face.api.ts +11 -0
- package/src/gui/components/atoms/Window/connectors/index.ts +19 -0
- package/src/gui/components/atoms/Window/window.stories.tsx +20 -0
- package/src/gui/components/atoms/Window/window.tsx +636 -0
- package/src/gui/components/atoms/atoms.tsx +151 -0
- package/src/gui/components/atoms/index.ts +2 -0
- package/src/gui/components/generics/Cards/Gridme.jsx +52 -0
- package/src/gui/components/generics/Cards/LilBox.jsx +65 -0
- package/src/gui/components/generics/Cards/ModuleCard.jsx +106 -0
- package/src/gui/components/generics/Chats/FullChatBot.jsx +223 -0
- package/src/gui/components/generics/Code/CodeBlock.jsx +33 -0
- package/src/gui/components/generics/EmojiCursor/EmojiCursor.stories.tsx +153 -0
- package/src/gui/components/generics/EmojiCursor/EmojiCursor.tsx +23 -0
- package/src/gui/components/generics/Feedback/Callout.jsx +92 -0
- package/src/gui/components/generics/Layout/GridX.jsx +29 -0
- package/src/gui/components/generics/Layout/Hero2.jsx +132 -0
- package/src/gui/components/generics/Layout/PageContainer.jsx +29 -0
- package/src/gui/components/generics/Layout/PageDivider.jsx +20 -0
- package/src/gui/components/generics/Layout/Section.jsx +43 -0
- package/src/gui/components/generics/Layout/SectionHeader.jsx +21 -0
- package/src/gui/components/generics/Media/Img.jsx +58 -0
- package/src/gui/components/generics/Media/VideoEmbed.jsx +51 -0
- package/src/gui/components/generics/Organization/TableOfContents.jsx +51 -0
- package/src/gui/components/generics/Organization/Tabs.jsx +45 -0
- package/src/gui/components/generics/Text/TextList.jsx +41 -0
- package/src/gui/components/generics/Text/TextParagraph.jsx +28 -0
- package/src/gui/components/generics/Text/TextQuote.jsx +23 -0
- package/src/gui/components/generics/Text/TextTitle.jsx +44 -0
- package/src/gui/components/molecules/Dialog/Dialog.stories.tsx +18 -0
- package/src/gui/components/molecules/Dialog/Dialog.tsx +5 -0
- package/src/gui/components/molecules/Hero/Hero.stories.tsx +140 -0
- package/src/gui/components/molecules/Hero/Hero.tsx +152 -0
- package/src/gui/components/molecules/Hero/Hero.types.tsx +18 -0
- package/src/gui/components/molecules/Modal/Modal.resolver.tsx +38 -0
- package/src/gui/components/molecules/Modal/Modal.stories.tsx +82 -0
- package/src/gui/components/molecules/Modal/Modal.tsx +110 -0
- package/src/gui/components/molecules/Modal/Modal.types.ts +29 -0
- package/src/gui/components/molecules/Page/Page.stories.tsx +135 -0
- package/src/gui/components/molecules/Page/Page.tsx +94 -0
- package/src/gui/components/molecules/Theme/ThemeModeToggle/ThemeModeToggle.resolver.tsx +58 -0
- package/src/gui/components/molecules/Theme/ThemeModeToggle/ThemeModeToggle.stories.tsx +133 -0
- package/src/gui/components/molecules/Theme/ThemeModeToggle/ThemeModeToggle.tsx +101 -0
- package/src/gui/components/molecules/Theme/ThemeModeToggle/ThemeModeToggle.types.ts +29 -0
- package/src/gui/components/molecules/Theme/ThemesCatalog/ThemesCatalog.resolver.tsx +15 -0
- package/src/gui/components/molecules/Theme/ThemesCatalog/ThemesCatalog.stories.tsx +88 -0
- package/src/gui/components/molecules/Theme/ThemesCatalog/ThemesCatalog.tsx +167 -0
- package/src/gui/components/molecules/Theme/ThemesCatalog/ThemesCatalog.types.ts +34 -0
- package/src/gui/components/molecules/molecules.ts +49 -0
- package/src/gui/components/organisms/Blockchain/Blocks/BlocksTable.tsx +119 -0
- package/src/gui/components/organisms/Blockchain/Usernames/Identities.stories.tsx +20 -0
- package/src/gui/components/organisms/Blockchain/Usernames/QR.tsx +566 -0
- package/src/gui/components/organisms/Blockchain/Usernames/Usernames.tsx +448 -0
- package/src/gui/components/organisms/Blockchain/Usernames/identities.tsx +710 -0
- package/src/gui/components/organisms/Blockchain/blockchain.stories.tsx +17 -0
- package/src/gui/components/organisms/Blockchain/blockchain.tsx +368 -0
- package/src/gui/components/organisms/Blockchain/scripts/connection.ts +82 -0
- package/src/gui/components/organisms/Blockchain/scripts/match_face.ts +143 -0
- package/src/gui/components/organisms/HighLighter/HighLighter.stories.tsx +168 -0
- package/src/gui/components/organisms/HighLighter/HighLighter.tsx +420 -0
- package/src/gui/components/organisms/HighLighter/HighLightsDrawer.tsx +197 -0
- package/src/gui/components/organisms/IdentityNoise/FaceRecognition/FaceRecognition.stories.tsx +312 -0
- package/src/gui/components/organisms/IdentityNoise/FaceRecognition/FaceRecognition.tsx +765 -0
- package/src/gui/components/organisms/IdentityNoise/FaceRecognition/modules/useFaceCameraPermission.ts +70 -0
- package/src/gui/components/organisms/IdentityNoise/FaceRecognition/modules/useFaceLandmarker.ts +106 -0
- package/src/gui/components/organisms/IdentityNoise/FaceRecognition/modules/useFaceOverlay.ts +489 -0
- package/src/gui/components/organisms/IdentityNoise/FaceRecognition/modules/useFaceTemplate.ts +32 -0
- package/src/gui/components/organisms/IdentityNoise/FaceRecognition/modules/useFaceTemplateBurst.ts +178 -0
- package/src/gui/components/organisms/IdentityNoise/FaceRecognition/modules/verifyTemplate.ts +136 -0
- package/src/gui/components/organisms/IdentityNoise/IdentityNoise.tsx +403 -0
- package/src/gui/components/organisms/IdentityNoise/IndentityNoise.stories.tsx +15 -0
- package/src/gui/components/organisms/IdentityNoise/Noise/Noise.stories.tsx +206 -0
- package/src/gui/components/organisms/IdentityNoise/Noise/Noise.tsx +394 -0
- package/src/gui/components/organisms/IdentityNoise/Triad/QR.tsx +566 -0
- package/src/gui/components/organisms/IdentityNoise/Triad/Tiad.stories.tsx +6 -0
- package/src/gui/components/organisms/IdentityNoise/Triad/Triad.tsx +917 -0
- package/src/gui/components/organisms/IdentityNoise/Triad/handleCleak.ts +0 -0
- package/src/gui/components/organisms/IdentityNoise/Triad/identity.ts +31 -0
- package/src/gui/components/organisms/IdentityNoise/Triad/me/fundamentals/vectors/vectors.tsx +252 -0
- package/src/gui/components/organisms/IdentityNoise/Triad/me/me.stories.tsx +314 -0
- package/src/gui/components/organisms/IdentityNoise/Triad/me/me.tsx +0 -0
- package/src/gui/components/organisms/organisms.ts +15 -0
- package/src/gui/contexts/InsetsContext.tsx +40 -0
- package/src/gui/contexts/LeftSidebarContext.tsx +20 -0
- package/src/gui/contexts/RightSidebarContext.tsx +25 -0
- package/src/gui/contexts/ThemeContext.ts +34 -0
- package/src/gui/contexts/index.ts +4 -0
- package/src/gui/hooks/index.ts +11 -0
- package/src/gui/hooks/resolveColorToken.ts +39 -0
- package/src/gui/hooks/useCodeGen.ts +12 -0
- package/src/gui/hooks/useGuiMediaQuery.ts +18 -0
- package/src/gui/hooks/useGuiTheme.ts +18 -0
- package/src/gui/hooks/useInsets.ts +26 -0
- package/src/gui/hooks/useIsMobile.ts +13 -0
- package/src/gui/hooks/useIsTouchDevice.ts +25 -0
- package/src/gui/hooks/useLeftSidebar.ts +10 -0
- package/src/gui/hooks/useRightSidebar.ts +12 -0
- package/src/gui/hooks/useViewportKey.ts +19 -0
- package/src/gui/hooks/useViewportProp.ts +17 -0
- package/src/gui/registry/GuiRegistry.ts +19 -0
- package/src/gui/registry/factory.ts +12 -0
- package/src/gui/registry/index.ts +3 -0
- package/src/gui/registry/types.ts +6 -0
- package/src/gui/utils/nodeID.ts +11 -0
- package/src/registry/GuiRegistry.ts +19 -0
- package/src/stories/01.Home.mdx +22 -0
- package/src/stories/02.Understanding.This.GUI.mdx +149 -0
- package/src/stories/Theme/Palette.stories.tsx +86 -0
- package/src/stories/Theme/ThemeViewer.stories.tsx +91 -0
- package/src/stories/Theme/Typography.stories.jsx +211 -0
- package/src/stories/assets/this.GUI.png +0 -0
- package/src/types/gui.d.ts +67 -0
- package/src/types/theme.d.ts +191 -0
- package/src/types/viewport.ts +132 -0
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Button, Link } from '@/gui/components/atoms';
|
|
3
|
+
import Icon from '@/gui/Theme/Icon/Icon';
|
|
4
|
+
|
|
5
|
+
// ======================= Meta =======================
|
|
6
|
+
const meta: Meta<typeof Button> = {
|
|
7
|
+
title: 'Atoms/Forms & Inputs/Button',
|
|
8
|
+
component: Button,
|
|
9
|
+
tags: ['autodocs'],
|
|
10
|
+
decorators: [
|
|
11
|
+
(Story) => (
|
|
12
|
+
<div style={{ padding: 16, minHeight: 240 }}>
|
|
13
|
+
<Story />
|
|
14
|
+
</div>
|
|
15
|
+
),
|
|
16
|
+
],
|
|
17
|
+
parameters: {
|
|
18
|
+
docs: {
|
|
19
|
+
description: {
|
|
20
|
+
component: `
|
|
21
|
+
The **Button** primitive is a thin wrapper around MUI's \`MuiButton\` that preserves **polymorphism** and adds **declarative icons** (string tokens like
|
|
22
|
+
\`mui:Send\` or \`lucide:bolt\`). It integrates with **This.GUI** theming and respects your token-built palette.
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
## Features
|
|
26
|
+
- Variants: \`contained\`, \`outlined\`, \`text\`.
|
|
27
|
+
- Colors: \`primary\`, \`secondary\`, \`success\`, \`info\`, \`warning\`, \`error\`, \`inherit\`.
|
|
28
|
+
- Sizes: \`small\`, \`medium\`, \`large\`.
|
|
29
|
+
- **Icons** via tokens (\`startIcon\` / \`endIcon\`) or React nodes.
|
|
30
|
+
- **Polymorphic**: \`component\` can be \`'a'\` or a Link (e.g. the This.GUI wrapper \`Link\`) for routing.
|
|
31
|
+
- Respects your theme from \`GuiProvider\` (no need to wrap with \`ThemeProvider\`).
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
## Key Props
|
|
35
|
+
- \`startIcon?: string | ReactNode\` — accepts a name from the **icon registry** (\`mui:*\` / \`lucide:*\`) or a React element.
|
|
36
|
+
- \`endIcon?: string | ReactNode\`.
|
|
37
|
+
- \`component?: ElementType | string\` — for polymorphism (\`'a'\`, RouterLink, etc.).
|
|
38
|
+
- \`href?: string\` — when \`component='a'\`.
|
|
39
|
+
- \`to?: string\` — when \`component={Link}\`.
|
|
40
|
+
|
|
41
|
+
> Note: \`to\` and \`href\` are not exposed as Storybook controls because they only apply in specific modes; they are shown in dedicated stories.
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
## Basic usage
|
|
45
|
+
~~~jsx
|
|
46
|
+
import { Button } from '@/gui/primitives';
|
|
47
|
+
|
|
48
|
+
<Button variant="contained" color="primary">Save</Button>
|
|
49
|
+
<Button variant="outlined" color="secondary">Cancel</Button>
|
|
50
|
+
<Button variant="text">Learn more</Button>
|
|
51
|
+
~~~
|
|
52
|
+
|
|
53
|
+
## With declarative icons
|
|
54
|
+
~~~jsx
|
|
55
|
+
<Button variant="contained" color="secondary" startIcon="mui:Send" endIcon="lucide:bolt">
|
|
56
|
+
Send
|
|
57
|
+
</Button>
|
|
58
|
+
~~~
|
|
59
|
+
|
|
60
|
+
## As native anchor link
|
|
61
|
+
~~~jsx
|
|
62
|
+
<Button component="a" href="https://neurons.me" /* target="_blank" rel="noreferrer" */>
|
|
63
|
+
Visit neurons.me
|
|
64
|
+
</Button>
|
|
65
|
+
~~~
|
|
66
|
+
|
|
67
|
+
## With RouterLink (This.GUI Link)
|
|
68
|
+
~~~jsx
|
|
69
|
+
import { Button, Link } from '@/gui/primitives';
|
|
70
|
+
|
|
71
|
+
<Button component={Link} to="/docs">Go to docs</Button>
|
|
72
|
+
~~~
|
|
73
|
+
## Declarative JSON / Config usage
|
|
74
|
+
~~~json
|
|
75
|
+
{
|
|
76
|
+
"type": "Button",
|
|
77
|
+
"props": {
|
|
78
|
+
"variant": "text",
|
|
79
|
+
"color": "primary",
|
|
80
|
+
"component": "a",
|
|
81
|
+
"href": "https://neurons.me",
|
|
82
|
+
"target": "_blank",
|
|
83
|
+
"rel": "noreferrer",
|
|
84
|
+
"children": "Visit neurons.me"
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
~~~
|
|
88
|
+
|
|
89
|
+
Another example with a RouterLink:
|
|
90
|
+
~~~json
|
|
91
|
+
{
|
|
92
|
+
"type": "Button",
|
|
93
|
+
"props": {
|
|
94
|
+
"variant": "contained",
|
|
95
|
+
"color": "secondary",
|
|
96
|
+
"component": "Link",
|
|
97
|
+
"to": "/docs",
|
|
98
|
+
"startIcon": "mui:Send",
|
|
99
|
+
"children": "Go to docs"
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
~~~
|
|
103
|
+
`,
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
argTypes: {
|
|
108
|
+
variant: {
|
|
109
|
+
control: { type: 'radio' },
|
|
110
|
+
options: ['contained', 'outlined', 'text'],
|
|
111
|
+
},
|
|
112
|
+
color: {
|
|
113
|
+
control: { type: 'select' },
|
|
114
|
+
options: ['primary', 'secondary', 'success', 'info', 'warning', 'error', 'inherit'],
|
|
115
|
+
},
|
|
116
|
+
size: {
|
|
117
|
+
control: { type: 'radio' },
|
|
118
|
+
options: ['small', 'medium', 'large'],
|
|
119
|
+
},
|
|
120
|
+
startIcon: { control: 'text', description: 'Icon token or a React element.' },
|
|
121
|
+
endIcon: { control: 'text', description: 'Icon token or a React element.' },
|
|
122
|
+
onClick: { action: 'clicked' },
|
|
123
|
+
},
|
|
124
|
+
args: {
|
|
125
|
+
variant: 'contained',
|
|
126
|
+
color: 'primary',
|
|
127
|
+
size: 'medium',
|
|
128
|
+
children: 'Click me',
|
|
129
|
+
},
|
|
130
|
+
};
|
|
131
|
+
export default meta;
|
|
132
|
+
|
|
133
|
+
type Story = StoryObj<typeof Button>;
|
|
134
|
+
|
|
135
|
+
// ======================= Stories =======================
|
|
136
|
+
export const Playground: Story = {};
|
|
137
|
+
|
|
138
|
+
export const Variants: Story = {
|
|
139
|
+
args: { color: 'primary' },
|
|
140
|
+
render: (args) => (
|
|
141
|
+
<div style={{ display: 'flex', gap: 12, flexWrap: 'wrap' }}>
|
|
142
|
+
<Button {...args} variant="contained">Contained</Button>
|
|
143
|
+
<Button {...args} variant="outlined">Outlined</Button>
|
|
144
|
+
<Button {...args} variant="text">Text</Button>
|
|
145
|
+
</div>
|
|
146
|
+
),
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
export const Colors: Story = {
|
|
150
|
+
args: { variant: 'contained' },
|
|
151
|
+
render: (args) => {
|
|
152
|
+
const colors: Array<'primary' | 'secondary' | 'success' | 'info' | 'warning' | 'error'> =
|
|
153
|
+
['primary', 'secondary', 'success', 'info', 'warning', 'error'];
|
|
154
|
+
return (
|
|
155
|
+
<div style={{ display: 'flex', gap: 12, flexWrap: 'wrap' }}>
|
|
156
|
+
{colors.map((c) => (
|
|
157
|
+
<Button key={c} {...args} color={c}>
|
|
158
|
+
{c[0].toUpperCase() + c.slice(1)}
|
|
159
|
+
</Button>
|
|
160
|
+
))}
|
|
161
|
+
</div>
|
|
162
|
+
);
|
|
163
|
+
},
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
export const Sizes: Story = {
|
|
167
|
+
args: { color: 'primary', variant: 'contained' },
|
|
168
|
+
render: (args) => (
|
|
169
|
+
<div style={{ display: 'flex', gap: 12, alignItems: 'center', flexWrap: 'wrap' }}>
|
|
170
|
+
<Button {...args} size="small">Small</Button>
|
|
171
|
+
<Button {...args} size="medium">Medium</Button>
|
|
172
|
+
<Button {...args} size="large">Large</Button>
|
|
173
|
+
</div>
|
|
174
|
+
),
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
export const WithIcons: Story = {
|
|
178
|
+
args: {
|
|
179
|
+
variant: 'contained',
|
|
180
|
+
color: 'secondary',
|
|
181
|
+
startIcon: <Icon name="Power" />,
|
|
182
|
+
endIcon: <Icon name="bolt" />,
|
|
183
|
+
children: 'Send',
|
|
184
|
+
},
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
export const PolymorphicAnchor: Story = {
|
|
188
|
+
args: {
|
|
189
|
+
variant: 'text',
|
|
190
|
+
color: 'primary',
|
|
191
|
+
children: 'Go to neurons.me',
|
|
192
|
+
},
|
|
193
|
+
render: (args) => (
|
|
194
|
+
<Button component="a" href="https://neurons.me">
|
|
195
|
+
{args.children}
|
|
196
|
+
</Button>
|
|
197
|
+
),
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
export const PolymorphicRouterLink: Story = {
|
|
201
|
+
args: {
|
|
202
|
+
variant: 'text',
|
|
203
|
+
color: 'primary',
|
|
204
|
+
children: 'Go to /docs',
|
|
205
|
+
},
|
|
206
|
+
render: (args) => (
|
|
207
|
+
<Button component={Link} to="/docs">
|
|
208
|
+
{args.children}
|
|
209
|
+
</Button>
|
|
210
|
+
),
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
export const Disabled: Story = {
|
|
214
|
+
args: { variant: 'contained', color: 'primary', disabled: true, children: 'Disabled' },
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
export const FullWidth: Story = {
|
|
218
|
+
args: { variant: 'contained', color: 'primary', fullWidth: true, children: 'Full Width' },
|
|
219
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
import MuiButton from '@mui/material/Button';
|
|
4
|
+
import type { OverridableComponent } from '@mui/material/OverridableComponent';
|
|
5
|
+
import type { ButtonTypeMap } from '@mui/material/Button';
|
|
6
|
+
import type { ButtonProps as MuiButtonProps } from '@mui/material/Button';
|
|
7
|
+
import Icon from '@/gui/Theme/Icon/Icon';
|
|
8
|
+
/**
|
|
9
|
+
* Button (This.GUI primitive)
|
|
10
|
+
* ----------------------------------------
|
|
11
|
+
* - Polymorphic: preserves MUI's `component` API and typing via OverridableComponent.
|
|
12
|
+
* - Enhances MUI by allowing `startIcon` / `endIcon` to be a declarative string
|
|
13
|
+
* (e.g., "mui:Settings" / "lucide:camera") or a ReactNode.
|
|
14
|
+
*/
|
|
15
|
+
// Polymorphic props type that matches MUI Button while letting us tweak icon props
|
|
16
|
+
export type Iconish = ReactNode | string | undefined;
|
|
17
|
+
export type ButtonProps = Omit<MuiButtonProps, 'startIcon' | 'endIcon'> & {
|
|
18
|
+
startIcon?: Iconish;
|
|
19
|
+
endIcon?: Iconish;
|
|
20
|
+
};
|
|
21
|
+
function resolveIcon(node: Iconish): ReactNode | null {
|
|
22
|
+
if (!node) return null;
|
|
23
|
+
return typeof node === 'string' ? <Icon name={node} fontSize={18} /> : node;
|
|
24
|
+
}
|
|
25
|
+
const ButtonImpl = React.forwardRef<any, ButtonProps>(function Button(
|
|
26
|
+
{ startIcon, endIcon, ...rest },
|
|
27
|
+
ref
|
|
28
|
+
) {
|
|
29
|
+
return (
|
|
30
|
+
<MuiButton
|
|
31
|
+
ref={ref}
|
|
32
|
+
startIcon={resolveIcon(startIcon)}
|
|
33
|
+
endIcon={resolveIcon(endIcon)}
|
|
34
|
+
{...rest}
|
|
35
|
+
/>
|
|
36
|
+
);
|
|
37
|
+
}) as unknown as OverridableComponent<ButtonTypeMap<{}, 'button'>>;
|
|
38
|
+
(ButtonImpl as any).displayName = 'Button';
|
|
39
|
+
export default ButtonImpl;
|
|
40
|
+
export type GuiButtonProps = React.ComponentProps<typeof ButtonImpl>;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { SxProps, Theme } from '@mui/material/styles';
|
|
3
|
+
import type { RegistryEntry, ResolveCtx } from '@/gui/registry/types';
|
|
4
|
+
import { ensureNodeId } from '@/gui/utils/nodeID';
|
|
5
|
+
import Card from './Card';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Declarative resolver for Card
|
|
9
|
+
* -----------------------------
|
|
10
|
+
* - Faithfully wraps MUI's Card.
|
|
11
|
+
* - Supports standard props like `variant`, `elevation`, `sx`, etc.
|
|
12
|
+
* - `children` maps directly to content inside the Card.
|
|
13
|
+
* - Supports polymorphic `component` prop and alias `as`.
|
|
14
|
+
*/
|
|
15
|
+
export type CardSpec = {
|
|
16
|
+
type: 'Card';
|
|
17
|
+
props?: {
|
|
18
|
+
children?: React.ReactNode;
|
|
19
|
+
variant?: 'elevation' | 'outlined';
|
|
20
|
+
raised?: boolean;
|
|
21
|
+
elevation?: number;
|
|
22
|
+
sx?: SxProps<Theme>;
|
|
23
|
+
className?: string;
|
|
24
|
+
id?: string;
|
|
25
|
+
'data-testid'?: string;
|
|
26
|
+
component?: React.ElementType;
|
|
27
|
+
as?: React.ElementType;
|
|
28
|
+
[key: string]: any;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const CardResolver: RegistryEntry = {
|
|
33
|
+
type: 'Card',
|
|
34
|
+
resolve(spec: CardSpec, _ctx?: ResolveCtx) {
|
|
35
|
+
const p = spec.props ?? {};
|
|
36
|
+
const {
|
|
37
|
+
children,
|
|
38
|
+
id,
|
|
39
|
+
className,
|
|
40
|
+
sx,
|
|
41
|
+
component,
|
|
42
|
+
as,
|
|
43
|
+
...rest
|
|
44
|
+
} = p;
|
|
45
|
+
|
|
46
|
+
const resolvedComponent = component ?? as;
|
|
47
|
+
const cardId = ensureNodeId('card', id);
|
|
48
|
+
|
|
49
|
+
return (
|
|
50
|
+
<Card
|
|
51
|
+
{...(resolvedComponent ? { component: resolvedComponent } : {})}
|
|
52
|
+
id={cardId}
|
|
53
|
+
className={className}
|
|
54
|
+
sx={sx}
|
|
55
|
+
{...rest}
|
|
56
|
+
>
|
|
57
|
+
{children}
|
|
58
|
+
</Card>
|
|
59
|
+
);
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export default CardResolver;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import Card from './Card';
|
|
3
|
+
import Typography from '@mui/material/Typography';
|
|
4
|
+
|
|
5
|
+
const meta: Meta<typeof Card> = {
|
|
6
|
+
title: 'Atoms/Organization/Card/Card',
|
|
7
|
+
component: Card,
|
|
8
|
+
tags: ['autodocs'],
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export default meta;
|
|
12
|
+
type Story = StoryObj<typeof Card>;
|
|
13
|
+
|
|
14
|
+
export const BasicCard: Story = {
|
|
15
|
+
render: () => (
|
|
16
|
+
<Card sx={{ p: 2 }}>
|
|
17
|
+
<Typography variant="h6" gutterBottom>
|
|
18
|
+
Basic Card
|
|
19
|
+
</Typography>
|
|
20
|
+
<Typography variant="body2">
|
|
21
|
+
This is a simple card using the GUI Card atom. It supports all typical MUI props.
|
|
22
|
+
</Typography>
|
|
23
|
+
</Card>
|
|
24
|
+
),
|
|
25
|
+
name: 'Basic Card',
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export const OutlinedCard: Story = {
|
|
29
|
+
render: () => (
|
|
30
|
+
<Card variant="outlined" sx={{ p: 2 }}>
|
|
31
|
+
<Typography variant="h6" gutterBottom>
|
|
32
|
+
Outlined Card
|
|
33
|
+
</Typography>
|
|
34
|
+
<Typography variant="body2">
|
|
35
|
+
This card uses the `variant="outlined"` prop for a border style.
|
|
36
|
+
</Typography>
|
|
37
|
+
</Card>
|
|
38
|
+
),
|
|
39
|
+
name: 'Outlined Card',
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export const RaisedCard: Story = {
|
|
43
|
+
render: () => (
|
|
44
|
+
<Card raised sx={{ p: 2 }}>
|
|
45
|
+
<Typography variant="h6" gutterBottom>
|
|
46
|
+
Raised Card
|
|
47
|
+
</Typography>
|
|
48
|
+
<Typography variant="body2">
|
|
49
|
+
Raised cards use elevation to create visual depth.
|
|
50
|
+
</Typography>
|
|
51
|
+
</Card>
|
|
52
|
+
),
|
|
53
|
+
name: 'Raised Card',
|
|
54
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import MuiCard from '@mui/material/Card';
|
|
3
|
+
/**
|
|
4
|
+
* This.GUI — Card (atom)
|
|
5
|
+
* Wrapper around MUI’s Card that preserves props & typing.
|
|
6
|
+
*
|
|
7
|
+
* - Full support for MUI’s props and styling (`sx`, `elevation`, `variant`, etc.).
|
|
8
|
+
* - No behavior changes; designed to keep consistent with the This.GUI atom model.
|
|
9
|
+
*/
|
|
10
|
+
const Card = MuiCard;
|
|
11
|
+
export type CardProps = React.ComponentProps<typeof Card>;
|
|
12
|
+
(Card as any).displayName = 'Gui.Card';
|
|
13
|
+
export default Card;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { RegistryEntry, ResolveCtx } from '@/gui/registry/types';
|
|
3
|
+
import type { SxProps, Theme } from '@mui/material/styles';
|
|
4
|
+
import { ensureNodeId } from '@/gui/utils/nodeID';
|
|
5
|
+
import CardActions from './CardActions';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Declarative resolver for CardActions
|
|
9
|
+
*
|
|
10
|
+
* - Preserves MUI fidelity: `disableSpacing`, `sx`, and any pass-through props.
|
|
11
|
+
* - Supports polymorphism via `component` or `as`.
|
|
12
|
+
* - Accepts children and standard layout styling.
|
|
13
|
+
*/
|
|
14
|
+
export type CardActionsSpec = {
|
|
15
|
+
type: 'CardActions';
|
|
16
|
+
props?: {
|
|
17
|
+
children?: React.ReactNode;
|
|
18
|
+
disableSpacing?: boolean;
|
|
19
|
+
sx?: SxProps<Theme>;
|
|
20
|
+
className?: string;
|
|
21
|
+
id?: string;
|
|
22
|
+
'data-testid'?: string;
|
|
23
|
+
component?: React.ElementType;
|
|
24
|
+
as?: React.ElementType;
|
|
25
|
+
[key: string]: any;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const CardActionsResolver: RegistryEntry = {
|
|
30
|
+
type: 'CardActions',
|
|
31
|
+
resolve(spec: CardActionsSpec, _ctx?: ResolveCtx) {
|
|
32
|
+
const p = spec.props ?? {};
|
|
33
|
+
const {
|
|
34
|
+
children,
|
|
35
|
+
sx,
|
|
36
|
+
className,
|
|
37
|
+
id,
|
|
38
|
+
component,
|
|
39
|
+
as,
|
|
40
|
+
...rest
|
|
41
|
+
} = p;
|
|
42
|
+
const resolvedComponent = component ?? as;
|
|
43
|
+
const actionsId = ensureNodeId('cardActions', id);
|
|
44
|
+
return (
|
|
45
|
+
<CardActions
|
|
46
|
+
sx={sx}
|
|
47
|
+
className={className}
|
|
48
|
+
id={actionsId}
|
|
49
|
+
data-testid={p['data-testid']}
|
|
50
|
+
{...(resolvedComponent ? { component: resolvedComponent } : {})}
|
|
51
|
+
{...rest}
|
|
52
|
+
>
|
|
53
|
+
{children}
|
|
54
|
+
</CardActions>
|
|
55
|
+
);
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export default CardActionsResolver;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import CardActions from './CardActions';
|
|
3
|
+
import Button from '@/gui/atoms/Button/Button';
|
|
4
|
+
|
|
5
|
+
const meta: Meta<typeof CardActions> = {
|
|
6
|
+
title: 'Atoms/Organization/Card/CardActions',
|
|
7
|
+
component: CardActions,
|
|
8
|
+
tags: ['autodocs'],
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export default meta;
|
|
12
|
+
type Story = StoryObj<typeof CardActions>;
|
|
13
|
+
|
|
14
|
+
export const BasicActions: Story = {
|
|
15
|
+
render: () => (
|
|
16
|
+
<CardActions>
|
|
17
|
+
<Button>Cancel</Button>
|
|
18
|
+
<Button variant="contained" color="primary">Submit</Button>
|
|
19
|
+
</CardActions>
|
|
20
|
+
),
|
|
21
|
+
name: 'Basic Actions',
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export const WithSpacingDisabled: Story = {
|
|
25
|
+
render: () => (
|
|
26
|
+
<CardActions disableSpacing>
|
|
27
|
+
<Button>Back</Button>
|
|
28
|
+
<Button variant="outlined">Next</Button>
|
|
29
|
+
</CardActions>
|
|
30
|
+
),
|
|
31
|
+
name: 'Actions without spacing',
|
|
32
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import MuiCardActions from '@mui/material/CardActions';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* This.GUI — CardActions (atom)
|
|
6
|
+
* Thin wrapper around MUI’s CardActions.
|
|
7
|
+
*
|
|
8
|
+
* - Preserves all props from MUI.
|
|
9
|
+
* - Supports polymorphism, `sx`, layout spacing, and children.
|
|
10
|
+
*/
|
|
11
|
+
const CardActions = MuiCardActions;
|
|
12
|
+
export type CardActionsProps = React.ComponentProps<typeof CardActions>;
|
|
13
|
+
(CardActions as any).displayName = 'Gui.CardActions';
|
|
14
|
+
export default CardActions;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { RegistryEntry, ResolveCtx } from '@/gui/registry/types';
|
|
3
|
+
import type { SxProps, Theme } from '@mui/material/styles';
|
|
4
|
+
import { ensureNodeId } from '@/gui/utils/nodeID';
|
|
5
|
+
import CardContent from './CardContent';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Declarative resolver for CardContent
|
|
9
|
+
*
|
|
10
|
+
* Maps JSON-friendly specs into a GUI-compatible CardContent wrapper.
|
|
11
|
+
* - Passes through `children`, `sx`, `className`, `id`, and `component`/`as`.
|
|
12
|
+
* - Allows custom styling and polymorphic rendering.
|
|
13
|
+
*/
|
|
14
|
+
export type CardContentSpec = {
|
|
15
|
+
type: 'CardContent';
|
|
16
|
+
props?: {
|
|
17
|
+
children?: React.ReactNode;
|
|
18
|
+
sx?: SxProps<Theme>;
|
|
19
|
+
className?: string;
|
|
20
|
+
id?: string;
|
|
21
|
+
'data-testid'?: string;
|
|
22
|
+
component?: React.ElementType;
|
|
23
|
+
as?: React.ElementType;
|
|
24
|
+
[key: string]: any;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const CardContentResolver: RegistryEntry = {
|
|
29
|
+
type: 'CardContent',
|
|
30
|
+
resolve(spec: CardContentSpec, _ctx?: ResolveCtx) {
|
|
31
|
+
const p = spec.props ?? {};
|
|
32
|
+
const {
|
|
33
|
+
children,
|
|
34
|
+
sx,
|
|
35
|
+
className,
|
|
36
|
+
id,
|
|
37
|
+
component,
|
|
38
|
+
as,
|
|
39
|
+
...rest
|
|
40
|
+
} = p;
|
|
41
|
+
|
|
42
|
+
const contentId = ensureNodeId('cardContent', id);
|
|
43
|
+
const resolvedComponent = component ?? as;
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<CardContent
|
|
47
|
+
sx={sx}
|
|
48
|
+
className={className}
|
|
49
|
+
id={contentId}
|
|
50
|
+
data-testid={p['data-testid']}
|
|
51
|
+
{...(resolvedComponent ? { component: resolvedComponent } : {})}
|
|
52
|
+
{...rest}
|
|
53
|
+
>
|
|
54
|
+
{children}
|
|
55
|
+
</CardContent>
|
|
56
|
+
);
|
|
57
|
+
},
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export default CardContentResolver;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import CardContent from './CardContent';
|
|
3
|
+
import Typography from '@mui/material/Typography';
|
|
4
|
+
const meta: Meta<typeof CardContent> = {
|
|
5
|
+
title: 'Atoms/Organization/Card/CardContent',
|
|
6
|
+
component: CardContent,
|
|
7
|
+
tags: ['autodocs'],
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export default meta;
|
|
11
|
+
type Story = StoryObj<typeof CardContent>;
|
|
12
|
+
|
|
13
|
+
export const BasicContent: Story = {
|
|
14
|
+
render: () => (
|
|
15
|
+
<CardContent>
|
|
16
|
+
<Typography variant="body1">
|
|
17
|
+
This is the main content area inside a card. You can place any children here.
|
|
18
|
+
</Typography>
|
|
19
|
+
</CardContent>
|
|
20
|
+
),
|
|
21
|
+
name: 'Basic CardContent',
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export const WithPaddingAndText: Story = {
|
|
25
|
+
render: () => (
|
|
26
|
+
<CardContent sx={{ p: 4 }}>
|
|
27
|
+
<Typography variant="h6">Custom Padding</Typography>
|
|
28
|
+
<Typography variant="body2">
|
|
29
|
+
This CardContent component has extra padding applied via the `sx` prop.
|
|
30
|
+
</Typography>
|
|
31
|
+
</CardContent>
|
|
32
|
+
),
|
|
33
|
+
name: 'CardContent with sx',
|
|
34
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import MuiCardContent from '@mui/material/CardContent';
|
|
3
|
+
/**
|
|
4
|
+
* This.GUI — CardContent (atom)
|
|
5
|
+
* Thin wrapper around MUI’s CardContent component.
|
|
6
|
+
*
|
|
7
|
+
* - Preserves props and typing directly from MUI.
|
|
8
|
+
* - Allows styling via `sx`, polymorphism via `component`, and content via `children`.
|
|
9
|
+
*/
|
|
10
|
+
const CardContent = MuiCardContent;
|
|
11
|
+
export type CardContentProps = React.ComponentProps<typeof CardContent>;
|
|
12
|
+
(CardContent as any).displayName = 'Gui.CardContent';
|
|
13
|
+
export default CardContent;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { RegistryEntry, ResolveCtx } from '@/gui/registry/types';
|
|
3
|
+
import type { SxProps, Theme } from '@mui/material/styles';
|
|
4
|
+
import { ensureNodeId } from '@/gui/utils/nodeID';
|
|
5
|
+
import CardHeader from './CardHeader';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Declarative resolver for CardHeader
|
|
9
|
+
*
|
|
10
|
+
* Purpose:
|
|
11
|
+
* - Enables JSON-based rendering of card headers with title, subheader, and actions.
|
|
12
|
+
* - Supports polymorphism (`component` or `as`) and typical MUI props.
|
|
13
|
+
*/
|
|
14
|
+
export type CardHeaderSpec = {
|
|
15
|
+
type: 'CardHeader';
|
|
16
|
+
props?: {
|
|
17
|
+
title?: React.ReactNode;
|
|
18
|
+
subheader?: React.ReactNode;
|
|
19
|
+
action?: React.ReactNode;
|
|
20
|
+
avatar?: React.ReactNode;
|
|
21
|
+
component?: React.ElementType;
|
|
22
|
+
as?: React.ElementType;
|
|
23
|
+
sx?: SxProps<Theme>;
|
|
24
|
+
className?: string;
|
|
25
|
+
id?: string;
|
|
26
|
+
'data-testid'?: string;
|
|
27
|
+
[key: string]: any;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const CardHeaderResolver: RegistryEntry = {
|
|
32
|
+
type: 'CardHeader',
|
|
33
|
+
resolve(spec: CardHeaderSpec, _ctx?: ResolveCtx) {
|
|
34
|
+
const p = spec.props ?? {};
|
|
35
|
+
const {
|
|
36
|
+
id,
|
|
37
|
+
component,
|
|
38
|
+
as,
|
|
39
|
+
sx,
|
|
40
|
+
className,
|
|
41
|
+
title,
|
|
42
|
+
subheader,
|
|
43
|
+
action,
|
|
44
|
+
avatar,
|
|
45
|
+
...rest
|
|
46
|
+
} = p;
|
|
47
|
+
|
|
48
|
+
const headerId = ensureNodeId('cardHeader', id);
|
|
49
|
+
const resolvedComponent = component ?? as;
|
|
50
|
+
|
|
51
|
+
return (
|
|
52
|
+
<CardHeader
|
|
53
|
+
title={title}
|
|
54
|
+
subheader={subheader}
|
|
55
|
+
action={action}
|
|
56
|
+
avatar={avatar}
|
|
57
|
+
sx={sx}
|
|
58
|
+
className={className}
|
|
59
|
+
id={headerId}
|
|
60
|
+
data-testid={p['data-testid']}
|
|
61
|
+
{...(resolvedComponent ? { component: resolvedComponent } : {})}
|
|
62
|
+
{...rest}
|
|
63
|
+
/>
|
|
64
|
+
);
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export default CardHeaderResolver;
|