this.gui 1.3.22 → 1.3.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/this-gui.es.js +0 -1
- package/dist/this-gui.umd.js +65 -65
- package/index.ts +3 -2
- package/init/index.html +4 -5
- package/init/package-lock.json +2 -2
- package/init/package.json +1 -1
- package/init/src/App.tsx +24 -0
- package/init/src/index.css +16 -0
- package/init/src/main.tsx +14 -0
- package/init/src/router/DerivableRouter.tsx +36 -0
- package/package.json +1 -1
- package/src/GUI.tsx +15 -0
- package/src/components/generics/Cards/Gridme.jsx +52 -0
- package/src/components/generics/Cards/LilBox.jsx +65 -0
- package/src/components/generics/Cards/ModuleCard.jsx +106 -0
- package/src/components/generics/Chats/FullChatBot.jsx +223 -0
- package/src/components/generics/Code/CodeBlock.jsx +33 -0
- package/src/components/generics/Feedback/Callout.jsx +92 -0
- package/src/components/generics/Layout/GridX.jsx +29 -0
- package/src/components/generics/Layout/Hero2.jsx +132 -0
- package/src/components/generics/Layout/PageContainer.jsx +29 -0
- package/src/components/generics/Layout/PageDivider.jsx +20 -0
- package/src/components/generics/Layout/Section.jsx +43 -0
- package/src/components/generics/Layout/SectionHeader.jsx +21 -0
- package/src/components/generics/Media/Img.jsx +58 -0
- package/src/components/generics/Media/VideoEmbed.jsx +51 -0
- package/src/components/generics/Organization/TableOfContents.jsx +51 -0
- package/src/components/generics/Organization/Tabs.jsx +45 -0
- package/src/components/generics/Text/TextList.jsx +41 -0
- package/src/components/generics/Text/TextParagraph.jsx +28 -0
- package/src/components/generics/Text/TextQuote.jsx +23 -0
- package/src/components/generics/Text/TextTitle.jsx +44 -0
- package/src/gui/Layouts/ResponsiveUI/Content/Content.resolver.tsx +0 -0
- package/src/gui/Layouts/ResponsiveUI/Content/Content.stories.tsx +88 -0
- package/src/gui/Layouts/ResponsiveUI/Content/Content.tsx +53 -0
- package/src/gui/Layouts/ResponsiveUI/Content/Content.types.tsx +40 -0
- package/src/gui/Layouts/ResponsiveUI/Footer/Footer.resolver.tsx +45 -0
- package/src/gui/Layouts/ResponsiveUI/Footer/Footer.stories.tsx +209 -0
- package/src/gui/Layouts/ResponsiveUI/Footer/Footer.tsx +337 -0
- package/src/gui/Layouts/ResponsiveUI/Footer/Footer.types.ts +40 -0
- package/src/gui/Layouts/ResponsiveUI/Layout/Layout.resolver.tsx +37 -0
- package/src/gui/Layouts/ResponsiveUI/Layout/Layout.stories.tsx +290 -0
- package/src/gui/Layouts/ResponsiveUI/Layout/Layout.tsx +112 -0
- package/src/gui/Layouts/ResponsiveUI/Layout/Layout.types.ts +56 -0
- package/src/gui/Layouts/ResponsiveUI/Layout/useLayoutBreakpoints.ts +9 -0
- package/src/gui/Layouts/ResponsiveUI/Sidebars/LeftSidebar/LeftSidebar.resolver.tsx +87 -0
- package/src/gui/Layouts/ResponsiveUI/Sidebars/LeftSidebar/LeftSidebar.stories.tsx +199 -0
- package/src/gui/Layouts/ResponsiveUI/Sidebars/LeftSidebar/LeftSidebar.tsx +311 -0
- package/src/gui/Layouts/ResponsiveUI/Sidebars/LeftSidebar/LeftSidebar.types.ts +41 -0
- package/src/gui/Layouts/ResponsiveUI/Sidebars/LeftSidebar/SidebarToggleButton.tsx +53 -0
- package/src/gui/Layouts/ResponsiveUI/Sidebars/LeftSidebar/components/LeftSidebarAction/LeftSidebarAction.resolver.tsx +19 -0
- package/src/gui/Layouts/ResponsiveUI/Sidebars/LeftSidebar/components/LeftSidebarAction/LeftSidebarAction.tsx +107 -0
- package/src/gui/Layouts/ResponsiveUI/Sidebars/LeftSidebar/components/LeftSidebarLink/LeftSidebarLink.resolver.tsx +0 -0
- package/src/gui/Layouts/ResponsiveUI/Sidebars/LeftSidebar/components/LeftSidebarLink/LeftSidebarLink.tsx +122 -0
- package/src/gui/Layouts/ResponsiveUI/Sidebars/LeftSidebar/components/LeftSidebarLink/LeftSidebarLink.types.ts +13 -0
- package/src/gui/Layouts/ResponsiveUI/Sidebars/LeftSidebar/components/LeftSidebarMenu/LeftSidebarMenu.tsx +142 -0
- package/src/gui/Layouts/ResponsiveUI/Sidebars/LeftSidebar/components/LeftSidebarToggleButton/LeftSidebarToggleButton.tsx +23 -0
- package/src/gui/Layouts/ResponsiveUI/Sidebars/RightSidebar/RightSidebar.resolver.tsx +35 -0
- package/src/gui/Layouts/ResponsiveUI/Sidebars/RightSidebar/RightSidebar.stories.tsx +240 -0
- package/src/gui/Layouts/ResponsiveUI/Sidebars/RightSidebar/RightSidebar.tsx +319 -0
- package/src/gui/Layouts/ResponsiveUI/Sidebars/RightSidebar/RightSidebar.types.ts +17 -0
- package/src/gui/Layouts/ResponsiveUI/Sidebars/RightSidebar/components/RightSidebarAction/RightSidebarAction.tsx +102 -0
- package/src/gui/Layouts/ResponsiveUI/Sidebars/RightSidebar/components/RightSidebarLink/RightSidebarLink.tsx +132 -0
- package/src/gui/Layouts/ResponsiveUI/Sidebars/RightSidebar/components/RightSidebarMenu/RightSidebarMenu.tsx +140 -0
- package/src/gui/Layouts/ResponsiveUI/Sidebars/RightSidebar/components/RightSidebarToggleButton/RightSidebarToggleButton.tsx +22 -0
- package/src/gui/Layouts/ResponsiveUI/StickyOptions/StickyOptionsTop.stories.tsx +469 -0
- package/src/gui/Layouts/ResponsiveUI/StickyOptions/StickyOptionsTop.tsx +489 -0
- package/src/gui/Layouts/ResponsiveUI/TopBar/TopBar.resolver.tsx +86 -0
- package/src/gui/Layouts/ResponsiveUI/TopBar/TopBar.stories.tsx +350 -0
- package/src/gui/Layouts/ResponsiveUI/TopBar/TopBar.tsx +281 -0
- package/src/gui/Layouts/ResponsiveUI/TopBar/TopBar.types.ts +39 -0
- package/src/gui/Layouts/ResponsiveUI/TopBar/components/TopBarAction/TopBarAction.stories.tsx +83 -0
- package/src/gui/Layouts/ResponsiveUI/TopBar/components/TopBarAction/TopBarAction.tsx +18 -0
- package/src/gui/Layouts/ResponsiveUI/TopBar/components/TopBarAction/TopBarAction.types.ts +4 -0
- package/src/gui/Layouts/ResponsiveUI/TopBar/components/TopBarLink/TopBarLink.stories.tsx +189 -0
- package/src/gui/Layouts/ResponsiveUI/TopBar/components/TopBarLink/TopBarLink.tsx +30 -0
- package/src/gui/Layouts/ResponsiveUI/TopBar/components/TopBarLink/TopBarLink.types.ts +9 -0
- package/src/gui/Layouts/ResponsiveUI/TopBar/components/TopBarMenu/TopBarMenu.resolver.tsx +14 -0
- package/src/gui/Layouts/ResponsiveUI/TopBar/components/TopBarMenu/TopBarMenu.stories.tsx +56 -0
- package/src/gui/Layouts/ResponsiveUI/TopBar/components/TopBarMenu/TopBarMenu.tsx +123 -0
- package/src/gui/Layouts/ResponsiveUI/TopBar/components/TopBarMenu/TopBarMenu.types.ts +44 -0
- package/src/gui/Theme/GuiProvider.tsx +125 -0
- package/src/gui/Theme/Icon/Icon.resolver.tsx +29 -0
- package/src/gui/Theme/Icon/Icon.tsx +43 -0
- package/src/gui/Theme/catalog/CherryByte/CherryByte.png +0 -0
- package/src/gui/Theme/catalog/CherryByte/dark.tokens.ts +47 -0
- package/src/gui/Theme/catalog/CherryByte/light.tokens.ts +47 -0
- package/src/gui/Theme/catalog/CherryByte/manifest.ts +24 -0
- package/src/gui/Theme/catalog/GhostShell/dark.tokens.ts +43 -0
- package/src/gui/Theme/catalog/GhostShell/ghost.png +0 -0
- package/src/gui/Theme/catalog/GhostShell/light.tokens.ts +39 -0
- package/src/gui/Theme/catalog/GhostShell/manifest.ts +24 -0
- package/src/gui/Theme/catalog/LunaHex/LunaHex.png +0 -0
- package/src/gui/Theme/catalog/LunaHex/dark.tokens.ts +34 -0
- package/src/gui/Theme/catalog/LunaHex/light.tokens.ts +74 -0
- package/src/gui/Theme/catalog/LunaHex/manifest.ts +24 -0
- package/src/gui/Theme/catalog/MUI/MUI.png +0 -0
- package/src/gui/Theme/catalog/MUI/dark.tokens.ts +58 -0
- package/src/gui/Theme/catalog/MUI/light.tokens.ts +74 -0
- package/src/gui/Theme/catalog/MUI/manifest.ts +24 -0
- package/src/gui/Theme/catalog/PrinceOfDarkness/dark.tokens.ts +48 -0
- package/src/gui/Theme/catalog/PrinceOfDarkness/light.tokens.ts +47 -0
- package/src/gui/Theme/catalog/PrinceOfDarkness/manifest.ts +24 -0
- package/src/gui/Theme/catalog/PrinceOfDarkness/prince.png +0 -0
- package/src/gui/Theme/catalog/PrinceOfDarkness/princeOfDarkness.png +0 -0
- package/src/gui/Theme/catalog/Seafoam/dark.tokens.ts +49 -0
- package/src/gui/Theme/catalog/Seafoam/light.tokens.ts +47 -0
- package/src/gui/Theme/catalog/Seafoam/manifest.ts +24 -0
- package/src/gui/Theme/catalog/Seafoam/seaFoam.png +0 -0
- package/src/gui/Theme/catalog/neurons/dark.tokens.ts +58 -0
- package/src/gui/Theme/catalog/neurons/light.tokens.ts +74 -0
- package/src/gui/Theme/catalog/neurons/manifest.ts +24 -0
- package/src/gui/Theme/catalog/neurons/neurons.me.png +0 -0
- package/src/gui/Theme/fromTokens.ts +273 -0
- package/src/gui/Theme/gui.css +31 -0
- package/src/gui/Theme/index.ts +17 -0
- package/src/gui/Theme/styles/buildShadows.ts +83 -0
- package/src/gui/Theme/styles/theme.tokens.ts +108 -0
- package/src/gui/Theme/utils/catalog.ts +61 -0
- package/src/gui/Theme/utils/persistence.ts +66 -0
- package/src/gui/Theme/utils/themeUtils.ts +34 -0
- package/src/gui/apis/codegen.api.ts +38 -0
- package/src/gui/components/atoms/AppBar/AppBar.resolver.tsx +41 -0
- package/src/gui/components/atoms/AppBar/AppBar.stories.tsx +225 -0
- package/src/gui/components/atoms/AppBar/AppBar.tsx +8 -0
- package/src/gui/components/atoms/AppBar/AppBar.types.ts +28 -0
- package/src/gui/components/atoms/Avatar/Avatar.resolver.tsx +61 -0
- package/src/gui/components/atoms/Avatar/Avatar.stories.tsx +36 -0
- package/src/gui/components/atoms/Avatar/Avatar.tsx +14 -0
- package/src/gui/components/atoms/Box/Box.resolver.tsx +171 -0
- package/src/gui/components/atoms/Box/Box.stories.tsx +263 -0
- package/src/gui/components/atoms/Box/Box.tsx +15 -0
- package/src/gui/components/atoms/Button/Button.resolver.tsx +103 -0
- package/src/gui/components/atoms/Button/Button.stories.tsx +219 -0
- package/src/gui/components/atoms/Button/Button.tsx +40 -0
- package/src/gui/components/atoms/Card/Card.resolver.tsx +63 -0
- package/src/gui/components/atoms/Card/Card.stories.tsx +54 -0
- package/src/gui/components/atoms/Card/Card.tsx +13 -0
- package/src/gui/components/atoms/CardActions/CardActions.resolver.tsx +59 -0
- package/src/gui/components/atoms/CardActions/CardActions.stories.tsx +32 -0
- package/src/gui/components/atoms/CardActions/CardActions.tsx +14 -0
- package/src/gui/components/atoms/CardContent/CardContent.resolver.tsx +60 -0
- package/src/gui/components/atoms/CardContent/CardContent.stories.tsx +34 -0
- package/src/gui/components/atoms/CardContent/CardContent.tsx +13 -0
- package/src/gui/components/atoms/CardHeader/CardHeader.resolver.tsx +68 -0
- package/src/gui/components/atoms/CardHeader/CardHeader.stories.tsx +40 -0
- package/src/gui/components/atoms/CardHeader/CardHeader.tsx +12 -0
- package/src/gui/components/atoms/Collapse/Collapse.resolver.tsx +85 -0
- package/src/gui/components/atoms/Collapse/Collapse.stories.tsx +130 -0
- package/src/gui/components/atoms/Collapse/Collapse.tsx +17 -0
- package/src/gui/components/atoms/Divider/Divider.resolver.tsx +95 -0
- package/src/gui/components/atoms/Divider/Divider.stories.tsx +108 -0
- package/src/gui/components/atoms/Divider/Divider.tsx +14 -0
- package/src/gui/components/atoms/Drawer/Drawer.resolver.tsx +116 -0
- package/src/gui/components/atoms/Drawer/Drawer.stories.tsx +223 -0
- package/src/gui/components/atoms/Drawer/Drawer.tsx +25 -0
- package/src/gui/components/atoms/Grid/Grid.resolver.tsx +33 -0
- package/src/gui/components/atoms/Grid/Grid.stories.tsx +136 -0
- package/src/gui/components/atoms/Grid/Grid.tsx +15 -0
- package/src/gui/components/atoms/Grid/Grid.types.ts +9 -0
- package/src/gui/components/atoms/IconButton/IconButton.resolver.tsx +137 -0
- package/src/gui/components/atoms/IconButton/IconButton.stories.tsx +134 -0
- package/src/gui/components/atoms/IconButton/IconButton.tsx +22 -0
- package/src/gui/components/atoms/Link/Link.resolver.tsx +74 -0
- package/src/gui/components/atoms/Link/Link.stories.tsx +157 -0
- package/src/gui/components/atoms/Link/Link.tsx +36 -0
- package/src/gui/components/atoms/List/List.resolver.tsx +94 -0
- package/src/gui/components/atoms/List/List.stories.tsx +137 -0
- package/src/gui/components/atoms/List/List.tsx +20 -0
- package/src/gui/components/atoms/ListItem/ListItem.resolver.tsx +88 -0
- package/src/gui/components/atoms/ListItem/ListItem.stories.tsx +151 -0
- package/src/gui/components/atoms/ListItem/ListItem.tsx +19 -0
- package/src/gui/components/atoms/ListItemButton/ListItemButton.resolver.tsx +214 -0
- package/src/gui/components/atoms/ListItemButton/ListItemButton.stories.tsx +155 -0
- package/src/gui/components/atoms/ListItemButton/ListItemButton.tsx +15 -0
- package/src/gui/components/atoms/ListItemIcon/ListItemIcon.resolver.tsx +102 -0
- package/src/gui/components/atoms/ListItemIcon/ListItemIcon.stories.tsx +132 -0
- package/src/gui/components/atoms/ListItemIcon/ListItemIcon.tsx +11 -0
- package/src/gui/components/atoms/ListItemText/ListItemText.resolver.tsx +112 -0
- package/src/gui/components/atoms/ListItemText/ListItemText.stories.tsx +156 -0
- package/src/gui/components/atoms/ListItemText/ListItemText.tsx +15 -0
- package/src/gui/components/atoms/Menu/Menu.resolver.tsx +112 -0
- package/src/gui/components/atoms/Menu/Menu.stories.tsx +162 -0
- package/src/gui/components/atoms/Menu/Menu.tsx +17 -0
- package/src/gui/components/atoms/MenuItem/MenuItem.resolver.tsx +183 -0
- package/src/gui/components/atoms/MenuItem/MenuItem.stories.tsx +134 -0
- package/src/gui/components/atoms/MenuItem/MenuItem.tsx +14 -0
- package/src/gui/components/atoms/Paper/Paper.resolver.tsx +98 -0
- package/src/gui/components/atoms/Paper/Paper.stories.tsx +184 -0
- package/src/gui/components/atoms/Paper/Paper.tsx +15 -0
- package/src/gui/components/atoms/Section/Section.resolver.tsx +10 -0
- package/src/gui/components/atoms/Section/Section.stories.tsx +189 -0
- package/src/gui/components/atoms/Section/Section.tsx +76 -0
- package/src/gui/components/atoms/Section/Section.types.tsx +24 -0
- package/src/gui/components/atoms/Stack/Stack.resolver.tsx +94 -0
- package/src/gui/components/atoms/Stack/Stack.stories.tsx +160 -0
- package/src/gui/components/atoms/Stack/Stack.tsx +15 -0
- package/src/gui/components/atoms/Surface/Surface.resolver.tsx +37 -0
- package/src/gui/components/atoms/Surface/Surface.tsx +49 -0
- package/src/gui/components/atoms/Surface/Surface.types.ts +20 -0
- package/src/gui/components/atoms/Switch/Switch.resolver.tsx +53 -0
- package/src/gui/components/atoms/Switch/Switch.stories.tsx +236 -0
- package/src/gui/components/atoms/Switch/Switch.tsx +22 -0
- package/src/gui/components/atoms/TextField/TextField.stories.tsx +28 -0
- package/src/gui/components/atoms/TextField/TextField.tsx +15 -0
- package/src/gui/components/atoms/Toolbar/Toolbar.resolver.tsx +60 -0
- package/src/gui/components/atoms/Toolbar/Toolbar.stories.tsx +155 -0
- package/src/gui/components/atoms/Toolbar/Toolbar.tsx +16 -0
- package/src/gui/components/atoms/Tooltip/Tooltip.resolver.tsx +142 -0
- package/src/gui/components/atoms/Tooltip/Tooltip.stories.tsx +117 -0
- package/src/gui/components/atoms/Tooltip/Tooltip.tsx +70 -0
- package/src/gui/components/atoms/Typography/Typography.resolver.tsx +158 -0
- package/src/gui/components/atoms/Typography/Typography.stories.tsx +222 -0
- package/src/gui/components/atoms/Typography/Typography.tsx +27 -0
- package/src/gui/components/atoms.tsx +138 -0
- package/src/gui/components/molecules/Dialog/Dialog.stories.tsx +18 -0
- package/src/gui/components/molecules/Dialog/Dialog.tsx +5 -0
- package/src/gui/components/molecules/HeroSection/HeroSection.stories.tsx +141 -0
- package/src/gui/components/molecules/HeroSection/HeroSection.tsx +152 -0
- package/src/gui/components/molecules/HeroSection/HeroSection.types.tsx +18 -0
- package/src/gui/components/molecules/ModalBox/ModalBox.resolver.tsx +38 -0
- package/src/gui/components/molecules/ModalBox/ModalBox.stories.tsx +82 -0
- package/src/gui/components/molecules/ModalBox/ModalBox.tsx +106 -0
- package/src/gui/components/molecules/ModalBox/ModalBox.types.ts +29 -0
- package/src/gui/components/molecules/Page/Page.stories.tsx +135 -0
- package/src/gui/components/molecules/Page/Page.tsx +94 -0
- package/src/gui/components/molecules/Theme/ThemeModeToggle/ThemeModeToggle.resolver.tsx +58 -0
- package/src/gui/components/molecules/Theme/ThemeModeToggle/ThemeModeToggle.stories.tsx +133 -0
- package/src/gui/components/molecules/Theme/ThemeModeToggle/ThemeModeToggle.tsx +101 -0
- package/src/gui/components/molecules/Theme/ThemeModeToggle/ThemeModeToggle.types.ts +29 -0
- package/src/gui/components/molecules/Theme/ThemesCatalog/ThemesCatalog.resolver.tsx +15 -0
- package/src/gui/components/molecules/Theme/ThemesCatalog/ThemesCatalog.stories.tsx +88 -0
- package/src/gui/components/molecules/Theme/ThemesCatalog/ThemesCatalog.tsx +167 -0
- package/src/gui/components/molecules/Theme/ThemesCatalog/ThemesCatalog.types.ts +34 -0
- package/src/gui/components/organism/ChatGPTInterface/ChatGPTInterface.stories.tsx +17 -0
- package/src/gui/components/organism/ChatGPTInterface/ChatGPTInterface.tsx +71 -0
- package/src/gui/components/organism/RootDomain/RootDomain.stories.tsx +31 -0
- package/src/gui/components/organism/RootDomain/RootDomain.tsx +100 -0
- package/src/gui/components/organism/RootDomain/staticServices.ts +66 -0
- package/src/gui/components/window/Nodes/node.ts +0 -0
- package/src/gui/components/window/code/block/node.tsx +0 -0
- package/src/gui/components/window/code/hugging.face.api.ts +11 -0
- package/src/gui/components/window/connectors/index.ts +19 -0
- package/src/gui/components/window/window.stories.tsx +20 -0
- package/src/gui/components/window/window.tsx +633 -0
- package/src/gui/contexts/InsetsContext.tsx +38 -0
- package/src/gui/contexts/LeftSidebarContext.tsx +20 -0
- package/src/gui/contexts/RightSidebarContext.tsx +25 -0
- package/src/gui/contexts/ThemeContext.ts +34 -0
- package/src/gui/contexts/index.ts +4 -0
- package/src/gui/hooks/index.ts +11 -0
- package/src/gui/hooks/resolveColorToken.ts +39 -0
- package/src/gui/hooks/useCodeGen.ts +12 -0
- package/src/gui/hooks/useGuiMediaQuery.ts +18 -0
- package/src/gui/hooks/useGuiTheme.ts +18 -0
- package/src/gui/hooks/useInsets.ts +26 -0
- package/src/gui/hooks/useIsMobile.ts +13 -0
- package/src/gui/hooks/useIsTouchDevice.ts +25 -0
- package/src/gui/hooks/useLeftSidebar.ts +10 -0
- package/src/gui/hooks/useRightSidebar.ts +12 -0
- package/src/gui/hooks/useViewportKey.ts +19 -0
- package/src/gui/hooks/useViewportProp.ts +17 -0
- package/src/gui/me/Logic.tsx +31 -0
- package/src/gui/me/Me.stories.tsx +8 -0
- package/src/gui/me/Me.tsx +197 -0
- package/src/gui/me/fundamentals/verbs/verbs.tsx +94 -0
- package/src/gui/me/modificators/Adjectives.ts +0 -0
- package/src/gui/me/modificators/Adverbs.ts +0 -0
- package/src/gui/me/modificators/Complements.ts +27 -0
- package/src/gui/me/utils/Context.tsx +14 -0
- package/src/gui/me/utils/hooks/useMe.js +37 -0
- package/src/gui/utils/nodeID.ts +11 -0
- package/src/registry/GuiRegistry.ts +19 -0
- package/src/registry/factory.ts +12 -0
- package/src/registry/index.ts +3 -0
- package/src/registry/types.ts +6 -0
- package/src/stories/01.Home.mdx +22 -0
- package/src/stories/02.Understanding.This.GUI.mdx +149 -0
- package/src/stories/Theme/Palette.stories.tsx +86 -0
- package/src/stories/Theme/ThemeViewer.stories.tsx +91 -0
- package/src/stories/Theme/Typography.stories.jsx +211 -0
- package/src/types/gui.d.ts +67 -0
- package/src/types/theme.d.ts +191 -0
- package/src/types/viewport.ts +132 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
GuiProvider,
|
|
3
|
+
useThemeContext,
|
|
4
|
+
TopBar,
|
|
5
|
+
useCodeGen,
|
|
6
|
+
LeftSidebar,
|
|
7
|
+
RightSidebar,
|
|
8
|
+
Layout,
|
|
9
|
+
StickyOptionsTop,
|
|
10
|
+
RootDomain,
|
|
11
|
+
TextTitle,
|
|
12
|
+
TextParagraph,
|
|
13
|
+
TextList,
|
|
14
|
+
TextQuote,
|
|
15
|
+
Surface,
|
|
16
|
+
TextField,
|
|
17
|
+
Img,
|
|
18
|
+
VideoEmbed,
|
|
19
|
+
TableOfContents,
|
|
20
|
+
Tabs,
|
|
21
|
+
PageContainer,
|
|
22
|
+
Gridx,
|
|
23
|
+
Section,
|
|
24
|
+
SectionHeader,
|
|
25
|
+
PageDivider,
|
|
26
|
+
Hero2,
|
|
27
|
+
CodeBlock,
|
|
28
|
+
Footer,
|
|
29
|
+
Callout,
|
|
30
|
+
ModuleCard,
|
|
31
|
+
LilBox,
|
|
32
|
+
Gridme,
|
|
33
|
+
} from "../../index";
|
|
34
|
+
|
|
35
|
+
export type GUIType = {
|
|
36
|
+
GuiProvider: typeof GuiProvider;
|
|
37
|
+
useThemeContext: typeof useThemeContext;
|
|
38
|
+
TopBar: typeof TopBar;
|
|
39
|
+
useCodeGen: typeof useCodeGen;
|
|
40
|
+
LeftSidebar: typeof LeftSidebar;
|
|
41
|
+
RightSidebar: typeof RightSidebar;
|
|
42
|
+
Layout: typeof Layout;
|
|
43
|
+
StickyOptionsTop: typeof StickyOptionsTop;
|
|
44
|
+
RootDomain: typeof RootDomain;
|
|
45
|
+
TextTitle: typeof TextTitle;
|
|
46
|
+
TextParagraph: typeof TextParagraph;
|
|
47
|
+
TextList: typeof TextList;
|
|
48
|
+
TextQuote: typeof TextQuote;
|
|
49
|
+
Surface: typeof Surface;
|
|
50
|
+
TextField: typeof TextField;
|
|
51
|
+
Img: typeof Img;
|
|
52
|
+
VideoEmbed: typeof VideoEmbed;
|
|
53
|
+
TableOfContents: typeof TableOfContents;
|
|
54
|
+
Tabs: typeof Tabs;
|
|
55
|
+
PageContainer: typeof PageContainer;
|
|
56
|
+
Gridx: typeof Gridx;
|
|
57
|
+
Section: typeof Section;
|
|
58
|
+
SectionHeader: typeof SectionHeader;
|
|
59
|
+
PageDivider: typeof PageDivider;
|
|
60
|
+
Hero2: typeof Hero2;
|
|
61
|
+
CodeBlock: typeof CodeBlock;
|
|
62
|
+
Footer: typeof Footer;
|
|
63
|
+
Callout: typeof Callout;
|
|
64
|
+
ModuleCard: typeof ModuleCard;
|
|
65
|
+
LilBox: typeof LilBox;
|
|
66
|
+
Gridme: typeof Gridme;
|
|
67
|
+
};
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
// src/types/theme.d.ts
|
|
2
|
+
import '@mui/material/styles';
|
|
3
|
+
// Module augmentation so TS knows about our theme extensions injected by GuiProvider
|
|
4
|
+
declare module '@mui/material/styles' {
|
|
5
|
+
/** Insets reported at runtime by NavBar/Drawers and read by layout components */
|
|
6
|
+
interface Insets {
|
|
7
|
+
left: number;
|
|
8
|
+
right: number;
|
|
9
|
+
top: number;
|
|
10
|
+
bottom: number;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/** Runtime theme (what useTheme() returns) */
|
|
14
|
+
interface Theme {
|
|
15
|
+
layout: { insets: Insets };
|
|
16
|
+
/** Callback to update insets; injected by GuiProvider */
|
|
17
|
+
updateInsets?: (next: Partial<Insets>) => void;
|
|
18
|
+
/** Optional legacy field for back-compat (some code reads theme.insets) */
|
|
19
|
+
insets?: Partial<Insets>;
|
|
20
|
+
/** Parking spot for all design tokens not mapped natively to MUI */
|
|
21
|
+
custom: Record<string, any>;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** Accepted options when creating the theme */
|
|
25
|
+
interface ThemeOptions {
|
|
26
|
+
layout?: { insets?: Partial<Insets> };
|
|
27
|
+
updateInsets?: (next: Partial<Insets>) => void;
|
|
28
|
+
/** Optional legacy field for back-compat */
|
|
29
|
+
insets?: Partial<Insets>;
|
|
30
|
+
/** Parking spot for all design tokens not mapped natively to MUI */
|
|
31
|
+
custom?: Record<string, any>;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export type ThemeManifest = {
|
|
36
|
+
themeId?: string;
|
|
37
|
+
themeName?: string;
|
|
38
|
+
description?: string;
|
|
39
|
+
author?: string;
|
|
40
|
+
version?: string;
|
|
41
|
+
license?: string;
|
|
42
|
+
homepage?: string;
|
|
43
|
+
tags?: string[];
|
|
44
|
+
createdAt?: string;
|
|
45
|
+
updatedAt?: string;
|
|
46
|
+
badgeUrl: string;
|
|
47
|
+
mode: {
|
|
48
|
+
light?: Record<string, any> | string;
|
|
49
|
+
dark?: Record<string, any> | string;
|
|
50
|
+
};
|
|
51
|
+
defaultMode?: 'light' | 'dark';
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export type GuiTheme = {
|
|
55
|
+
themeId: string; // unique identifier (e.g. UUID)
|
|
56
|
+
themeName: string; // human-readable name
|
|
57
|
+
// top-level manifest metadata (copied from ThemeManifest)
|
|
58
|
+
description?: string;
|
|
59
|
+
author?: string;
|
|
60
|
+
version?: string;
|
|
61
|
+
license?: string;
|
|
62
|
+
homepage?: string;
|
|
63
|
+
tags?: string[];
|
|
64
|
+
createdAt?: string;
|
|
65
|
+
updatedAt?: string;
|
|
66
|
+
badgeUrl?: string;
|
|
67
|
+
// group of modes for this theme
|
|
68
|
+
mode: {
|
|
69
|
+
light?: Record<string, any>;
|
|
70
|
+
dark?: Record<string, any>;
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
export interface FlatGuiTheme {
|
|
75
|
+
themeId: string;
|
|
76
|
+
themeName: string;
|
|
77
|
+
description?: string;
|
|
78
|
+
author?: string;
|
|
79
|
+
version?: string;
|
|
80
|
+
license?: string;
|
|
81
|
+
homepage?: string;
|
|
82
|
+
tags?: string[];
|
|
83
|
+
createdAt?: string;
|
|
84
|
+
updatedAt?: string;
|
|
85
|
+
badgeUrl?: string;
|
|
86
|
+
mode: 'light' | 'dark';
|
|
87
|
+
tokens: string | Record<string, any>;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// GuiContextValue types (from GuiProvider)
|
|
91
|
+
export type GuiContextValue = {
|
|
92
|
+
themeId: string;
|
|
93
|
+
setThemeId: (id: string) => void;
|
|
94
|
+
themeName: string;
|
|
95
|
+
mode: 'light' | 'dark';
|
|
96
|
+
toggleMode: () => void;
|
|
97
|
+
setMode: (mode: 'light' | 'dark') => void;
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
// Augment MUI Theme to include custom tokens and insets
|
|
101
|
+
import '@mui/material/styles';
|
|
102
|
+
declare module '@mui/material/styles' {
|
|
103
|
+
// -----------------------------
|
|
104
|
+
// Palette extensions
|
|
105
|
+
// -----------------------------
|
|
106
|
+
interface TypeBackground {
|
|
107
|
+
/** Custom background color for navigation surfaces (e.g., AppBar). */
|
|
108
|
+
nav?: string;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
interface Palette {
|
|
112
|
+
/** Default/iconic color separate from text/action semantics. */
|
|
113
|
+
icon: Palette['primary'];
|
|
114
|
+
/** Link colors (normal + optional visited). */
|
|
115
|
+
link: { main: string; visited?: string };
|
|
116
|
+
}
|
|
117
|
+
interface PaletteOptions {
|
|
118
|
+
icon?: PaletteOptions['primary'];
|
|
119
|
+
link?: { main: string; visited?: string };
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// -----------------------------
|
|
123
|
+
// Typography extensions
|
|
124
|
+
// -----------------------------
|
|
125
|
+
interface TypographyVariants {
|
|
126
|
+
/** Optional helper scale for line-heights used by generators/utilities. */
|
|
127
|
+
lineHeights?: {
|
|
128
|
+
tight?: number;
|
|
129
|
+
normal?: number;
|
|
130
|
+
relaxed?: number;
|
|
131
|
+
[key: string]: number | undefined;
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
interface TypographyVariantsOptions {
|
|
135
|
+
lineHeights?: {
|
|
136
|
+
tight?: number;
|
|
137
|
+
normal?: number;
|
|
138
|
+
relaxed?: number;
|
|
139
|
+
[key: string]: number | undefined;
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
// -----------------------------
|
|
144
|
+
// Theme extensions
|
|
145
|
+
// -----------------------------
|
|
146
|
+
interface Theme {
|
|
147
|
+
/** Runtime layout insets coordinated by NavBar/Drawers (pixels). */
|
|
148
|
+
layout: {
|
|
149
|
+
insets: { left: number; right: number; top: number; bottom: number };
|
|
150
|
+
};
|
|
151
|
+
/** Callback exposed by GuiProvider to update insets at runtime. */
|
|
152
|
+
updateInsets?: (v: Partial<{ left: number; right: number; top: number; bottom: number }>) => void;
|
|
153
|
+
/** Bag for tokens that don't map 1:1 to MUI. */
|
|
154
|
+
custom?: {
|
|
155
|
+
border?: string;
|
|
156
|
+
gradients?: unknown;
|
|
157
|
+
overlays?: unknown;
|
|
158
|
+
iconSizes?: Record<string, unknown>;
|
|
159
|
+
lineHeights?: Record<string, unknown>;
|
|
160
|
+
[key: string]: unknown;
|
|
161
|
+
};
|
|
162
|
+
/** (Optional) legacy insets for backwards compatibility. */
|
|
163
|
+
insets?: { left?: number; right?: number; top?: number; bottom?: number };
|
|
164
|
+
GUI: {
|
|
165
|
+
// This was changed from `thisGui` to `GUI` as per instructions
|
|
166
|
+
[key: string]: unknown;
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
interface ThemeOptions {
|
|
171
|
+
layout?: {
|
|
172
|
+
insets?: Partial<{ left: number; right: number; top: number; bottom: number }>;
|
|
173
|
+
};
|
|
174
|
+
updateInsets?: (v: Partial<{ left: number; right: number; top: number; bottom: number }>) => void;
|
|
175
|
+
custom?: {
|
|
176
|
+
border?: string;
|
|
177
|
+
gradients?: unknown;
|
|
178
|
+
overlays?: unknown;
|
|
179
|
+
iconSizes?: Record<string, unknown>;
|
|
180
|
+
lineHeights?: Record<string, unknown>;
|
|
181
|
+
[key: string]: unknown;
|
|
182
|
+
};
|
|
183
|
+
insets?: Partial<{ left: number; right: number; top: number; bottom: number }>;
|
|
184
|
+
GUI?: {
|
|
185
|
+
// This was changed from `thisGui` to `GUI` as per instructions
|
|
186
|
+
[key: string]: unknown;
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
export {};
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
// src/types/viewport.ts
|
|
2
|
+
// Shared viewport types + helpers for responsive, declarative variants.
|
|
3
|
+
// These utilities do not depend on React. They accept an optional MUI Theme
|
|
4
|
+
// but also work without it (fallbacks to MUI default breakpoint values).
|
|
5
|
+
|
|
6
|
+
// ---- Types -----------------------------------------------------------------
|
|
7
|
+
|
|
8
|
+
/** MUI-aligned viewport keys. Keep in sync with your theme breakpoints. */
|
|
9
|
+
export type ViewportKey = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
10
|
+
|
|
11
|
+
/** Map viewport → variant/value. You may also include a global `default`. */
|
|
12
|
+
export type ViewportMap<TVariant extends string | number | boolean | object> = Partial<
|
|
13
|
+
Record<ViewportKey, TVariant>
|
|
14
|
+
> & { default?: TVariant };
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Prop that can be a single value (applies to all sizes) or a map by viewport.
|
|
18
|
+
* Examples:
|
|
19
|
+
* - "pill"
|
|
20
|
+
* - { xs: "icons", sm: "pill", md: "pill", lg: "pill" }
|
|
21
|
+
*/
|
|
22
|
+
export type ViewportProp<TVariant extends string | number | boolean | object> =
|
|
23
|
+
| TVariant
|
|
24
|
+
| ViewportMap<TVariant>;
|
|
25
|
+
|
|
26
|
+
/** Options for resolution helpers. */
|
|
27
|
+
export type ViewportResolveOptions = {
|
|
28
|
+
/** Force a specific width (useful in unit tests or storybook containers). */
|
|
29
|
+
widthOverride?: number;
|
|
30
|
+
/** Fallback key when no direct match is found. Defaults to last matching by min-width. */
|
|
31
|
+
fallbackKey?: ViewportKey;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
// ---- Internals --------------------------------------------------------------
|
|
35
|
+
|
|
36
|
+
/** Default MUI breakpoint mins used when no theme is provided. */
|
|
37
|
+
const DEFAULT_MINS: Record<ViewportKey, number> = {
|
|
38
|
+
xs: 0,
|
|
39
|
+
sm: 600,
|
|
40
|
+
md: 900,
|
|
41
|
+
lg: 1200,
|
|
42
|
+
xl: 1536,
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
/** Default key order (small → large). */
|
|
46
|
+
const DEFAULT_ORDER: ViewportKey[] = ['xs', 'sm', 'md', 'lg', 'xl'];
|
|
47
|
+
|
|
48
|
+
/** Narrow theme shape we care about; avoids hard dependency on @mui types. */
|
|
49
|
+
type MaybeMuiTheme = {
|
|
50
|
+
breakpoints?: {
|
|
51
|
+
values?: Partial<Record<ViewportKey, number>>;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
/** Safely read breakpoint mins from a MUI theme; otherwise use defaults. */
|
|
56
|
+
export function getBreakpointMins(theme?: MaybeMuiTheme): Record<ViewportKey, number> {
|
|
57
|
+
const v = (theme?.breakpoints?.values ?? {}) as Partial<Record<ViewportKey, number>>;
|
|
58
|
+
return {
|
|
59
|
+
xs: Number.isFinite(v.xs!) ? (v.xs as number) : DEFAULT_MINS.xs,
|
|
60
|
+
sm: Number.isFinite(v.sm!) ? (v.sm as number) : DEFAULT_MINS.sm,
|
|
61
|
+
md: Number.isFinite(v.md!) ? (v.md as number) : DEFAULT_MINS.md,
|
|
62
|
+
lg: Number.isFinite(v.lg!) ? (v.lg as number) : DEFAULT_MINS.lg,
|
|
63
|
+
xl: Number.isFinite(v.xl!) ? (v.xl as number) : DEFAULT_MINS.xl,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/** Return the active viewport key for a given width using min-width semantics. */
|
|
68
|
+
export function keyForWidth(width: number, theme?: MaybeMuiTheme): ViewportKey {
|
|
69
|
+
const mins = getBreakpointMins(theme);
|
|
70
|
+
// Pick the largest key whose min ≤ width
|
|
71
|
+
let current: ViewportKey = 'xs';
|
|
72
|
+
for (const k of DEFAULT_ORDER) {
|
|
73
|
+
if (width >= mins[k]) current = k;
|
|
74
|
+
}
|
|
75
|
+
return current;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Resolve a ViewportProp to a concrete value for the current width.
|
|
80
|
+
* - If `prop` is a single value, returns it directly.
|
|
81
|
+
* - If it's a map, returns `map[activeKey]`, falling back to:
|
|
82
|
+
* `map.default` → first defined in xs→xl order → undefined.
|
|
83
|
+
*/
|
|
84
|
+
export function resolveViewportProp<TVariant extends string | number | boolean | object>(
|
|
85
|
+
prop: ViewportProp<TVariant>,
|
|
86
|
+
theme?: MaybeMuiTheme,
|
|
87
|
+
opts: ViewportResolveOptions = {}
|
|
88
|
+
): TVariant | undefined {
|
|
89
|
+
// Simple (scalar) value → universal
|
|
90
|
+
if (prop == null || typeof prop !== 'object' || Array.isArray(prop)) {
|
|
91
|
+
return prop as TVariant;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// Map case
|
|
95
|
+
const map = prop as ViewportMap<TVariant>;
|
|
96
|
+
const width =
|
|
97
|
+
typeof opts.widthOverride === 'number'
|
|
98
|
+
? opts.widthOverride
|
|
99
|
+
: (typeof window !== 'undefined' ? window.innerWidth : DEFAULT_MINS.xs);
|
|
100
|
+
|
|
101
|
+
const activeKey = keyForWidth(width, theme);
|
|
102
|
+
const pick =
|
|
103
|
+
(map as any)[activeKey] ??
|
|
104
|
+
map.default ??
|
|
105
|
+
(DEFAULT_ORDER.find((k) => (map as any)[k] != null)
|
|
106
|
+
? (map as any)[DEFAULT_ORDER.find((k) => (map as any)[k] != null)!]
|
|
107
|
+
: undefined);
|
|
108
|
+
|
|
109
|
+
return pick as TVariant | undefined;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Shallow-merge a base object with the resolved override from a viewport map.
|
|
114
|
+
* Useful for config objects where each viewport only overrides a few keys.
|
|
115
|
+
*
|
|
116
|
+
* Example:
|
|
117
|
+
* const base = { gap: 8, size: 'pill' }
|
|
118
|
+
* const map = { xs: { size: 'icons' } }
|
|
119
|
+
* → resolveResponsiveConfig(base, map) === { gap: 8, size: 'icons' }
|
|
120
|
+
*/
|
|
121
|
+
export function resolveResponsiveConfig<T extends Record<string, any>>(
|
|
122
|
+
base: T | undefined,
|
|
123
|
+
map: ViewportMap<Partial<T>> | undefined,
|
|
124
|
+
theme?: MaybeMuiTheme,
|
|
125
|
+
opts: ViewportResolveOptions = {}
|
|
126
|
+
): T | undefined {
|
|
127
|
+
if (base == null && map == null) return undefined;
|
|
128
|
+
if (!map || typeof map !== 'object') return base as T | undefined;
|
|
129
|
+
|
|
130
|
+
const override = resolveViewportProp<Partial<T>>(map as any, theme, opts) || {};
|
|
131
|
+
return { ...(base as T), ...override };
|
|
132
|
+
}
|