diff --git a/frontends/nextjs/src/components/editors/ThemeEditor.tsx b/frontends/nextjs/src/components/editors/ThemeEditor.tsx index 12c147f85..accaab6fc 100644 --- a/frontends/nextjs/src/components/editors/ThemeEditor.tsx +++ b/frontends/nextjs/src/components/editors/ThemeEditor.tsx @@ -1,5 +1,5 @@ import { useKV } from '@github/spark/hooks' -import { ArrowCounterClockwise, FloppyDisk, Moon, Palette, Sun } from '@phosphor-icons/react' +import { ArrowCounterClockwise, FloppyDisk, Moon, Palette, Sun } from '@/fakemui/icons' import { useEffect, useState } from 'react' import { toast } from 'sonner' diff --git a/frontends/nextjs/src/components/editors/schema/SchemaEditor.tsx b/frontends/nextjs/src/components/editors/schema/SchemaEditor.tsx index 447b1e850..b9b989ac4 100644 --- a/frontends/nextjs/src/components/editors/schema/SchemaEditor.tsx +++ b/frontends/nextjs/src/components/editors/schema/SchemaEditor.tsx @@ -1,5 +1,5 @@ import Editor from '@monaco-editor/react' -import { FloppyDisk, Warning, X } from '@phosphor-icons/react' +import { FloppyDisk, Warning, X } from '@/fakemui/icons' import { useState } from 'react' import { Dialog, DialogContent, DialogFooter, DialogHeader, DialogTitle } from '@/components/ui' diff --git a/frontends/nextjs/src/components/level1/GodCredentialsBanner.tsx b/frontends/nextjs/src/components/level1/GodCredentialsBanner.tsx index 20a0bf00d..f3528b8fc 100644 --- a/frontends/nextjs/src/components/level1/GodCredentialsBanner.tsx +++ b/frontends/nextjs/src/components/level1/GodCredentialsBanner.tsx @@ -1,4 +1,4 @@ -import { Check, Copy, Eye, EyeSlash, Warning } from '@phosphor-icons/react' +import { Check, Copy, Eye, EyeSlash, Warning } from '@/fakemui/icons' import { Alert, AlertDescription } from '@/components/ui' import { Button } from '@/components/ui' diff --git a/frontends/nextjs/src/components/level2/CommentsList.tsx b/frontends/nextjs/src/components/level2/CommentsList.tsx index 30866eaef..678ada0c7 100644 --- a/frontends/nextjs/src/components/level2/CommentsList.tsx +++ b/frontends/nextjs/src/components/level2/CommentsList.tsx @@ -1,4 +1,4 @@ -import { Trash } from '@phosphor-icons/react' +import { Trash } from '@/fakemui/icons' import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui' import { Button } from '@/components/ui' diff --git a/frontends/nextjs/src/components/level2/ProfileCard.tsx b/frontends/nextjs/src/components/level2/ProfileCard.tsx index c025ded2c..f203be851 100644 --- a/frontends/nextjs/src/components/level2/ProfileCard.tsx +++ b/frontends/nextjs/src/components/level2/ProfileCard.tsx @@ -1,4 +1,4 @@ -import { Envelope } from '@phosphor-icons/react' +import { Envelope } from '@/fakemui/icons' import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui' import { Button } from '@/components/ui' diff --git a/frontends/nextjs/src/components/level4/Level4Header.tsx b/frontends/nextjs/src/components/level4/Level4Header.tsx index f3855ba8a..036714358 100644 --- a/frontends/nextjs/src/components/level4/Level4Header.tsx +++ b/frontends/nextjs/src/components/level4/Level4Header.tsx @@ -1,4 +1,4 @@ -import { Download, Eye, House, SignOut, Terminal, Upload } from '@phosphor-icons/react' +import { Download, Eye, House, SignOut, Terminal, Upload } from '@/fakemui/icons' import { Button } from '@/components/ui' import { Badge } from '@/components/ui' diff --git a/frontends/nextjs/src/components/level5/header/Level5Header.tsx b/frontends/nextjs/src/components/level5/header/Level5Header.tsx index 6439a8c3f..8f46da5f8 100644 --- a/frontends/nextjs/src/components/level5/header/Level5Header.tsx +++ b/frontends/nextjs/src/components/level5/header/Level5Header.tsx @@ -1,4 +1,4 @@ -import { Crown, SignOut, Terminal } from '@phosphor-icons/react' +import { Crown, SignOut, Terminal } from '@/fakemui/icons' import { Button } from '@/components/ui' import { Badge } from '@/components/ui' diff --git a/frontends/nextjs/src/components/managers/component/ComponentHierarchyEditor.tsx b/frontends/nextjs/src/components/managers/component/ComponentHierarchyEditor.tsx index 2efb21256..12fe2ac64 100644 --- a/frontends/nextjs/src/components/managers/component/ComponentHierarchyEditor.tsx +++ b/frontends/nextjs/src/components/managers/component/ComponentHierarchyEditor.tsx @@ -1,4 +1,4 @@ -import { ArrowsOutCardinal, Plus, Tree } from '@phosphor-icons/react' +import { ArrowsOutCardinal, Plus, Tree } from '@/fakemui/icons' import { useCallback, useId, useMemo, useState } from 'react' import { toast } from 'sonner' diff --git a/frontends/nextjs/src/components/managers/component/ComponentHierarchyEditor/Tree.tsx b/frontends/nextjs/src/components/managers/component/ComponentHierarchyEditor/Tree.tsx index d49ed8736..f0964b337 100644 --- a/frontends/nextjs/src/components/managers/component/ComponentHierarchyEditor/Tree.tsx +++ b/frontends/nextjs/src/components/managers/component/ComponentHierarchyEditor/Tree.tsx @@ -1,4 +1,4 @@ -import { Cursor } from '@phosphor-icons/react' +import { Cursor } from '@/fakemui/icons' import type React from 'react' import type { ComponentNode } from '@/lib/database' diff --git a/frontends/nextjs/src/components/managers/component/modules/TreeNode.tsx b/frontends/nextjs/src/components/managers/component/modules/TreeNode.tsx index d4fad671f..1950f9faf 100644 --- a/frontends/nextjs/src/components/managers/component/modules/TreeNode.tsx +++ b/frontends/nextjs/src/components/managers/component/modules/TreeNode.tsx @@ -1,4 +1,4 @@ -import { CaretDown, CaretRight, GearSix, Trash, Tree } from '@phosphor-icons/react' +import { CaretDown, CaretRight, GearSix, Trash, Tree } from '@/fakemui/icons' import type React from 'react' import { Badge, Button } from '@/components/ui' diff --git a/frontends/nextjs/src/components/managers/css/CssClassBuilder.tsx b/frontends/nextjs/src/components/managers/css/CssClassBuilder.tsx index 7dedf69af..9bd49b445 100644 --- a/frontends/nextjs/src/components/managers/css/CssClassBuilder.tsx +++ b/frontends/nextjs/src/components/managers/css/CssClassBuilder.tsx @@ -1,4 +1,4 @@ -import { FloppyDisk, X } from '@phosphor-icons/react' +import { FloppyDisk, X } from '@/fakemui/icons' import { Dialog, DialogContent, DialogFooter, DialogHeader, DialogTitle } from '@/components/ui' import { Badge } from '@/components/ui' diff --git a/frontends/nextjs/src/components/managers/css/CssClassManager.tsx b/frontends/nextjs/src/components/managers/css/CssClassManager.tsx index 50b9a7ddb..0d1a87271 100644 --- a/frontends/nextjs/src/components/managers/css/CssClassManager.tsx +++ b/frontends/nextjs/src/components/managers/css/CssClassManager.tsx @@ -1,4 +1,4 @@ -import { FloppyDisk, Pencil, Plus, Trash, X } from '@phosphor-icons/react' +import { FloppyDisk, Pencil, Plus, Trash, X } from '@/fakemui/icons' import { useEffect, useState } from 'react' import { toast } from 'sonner' diff --git a/frontends/nextjs/src/components/managers/css/class-builder/RuleEditor.tsx b/frontends/nextjs/src/components/managers/css/class-builder/RuleEditor.tsx index 5c3029fec..5902d70be 100644 --- a/frontends/nextjs/src/components/managers/css/class-builder/RuleEditor.tsx +++ b/frontends/nextjs/src/components/managers/css/class-builder/RuleEditor.tsx @@ -1,4 +1,4 @@ -import { Plus } from '@phosphor-icons/react' +import { Plus } from '@/fakemui/icons' import { Button, diff --git a/frontends/nextjs/src/components/managers/database/ActionToolbar.tsx b/frontends/nextjs/src/components/managers/database/ActionToolbar.tsx index 3d3698eac..e154bdb42 100644 --- a/frontends/nextjs/src/components/managers/database/ActionToolbar.tsx +++ b/frontends/nextjs/src/components/managers/database/ActionToolbar.tsx @@ -1,4 +1,4 @@ -import { ArrowsClockwise, Export, Trash, UploadSimple } from '@phosphor-icons/react' +import { ArrowsClockwise, Export, Trash, UploadSimple } from '@/fakemui/icons' import { Button } from '@/components/ui' diff --git a/frontends/nextjs/src/components/misc/auth/GodCredentialsSettings.tsx b/frontends/nextjs/src/components/misc/auth/GodCredentialsSettings.tsx index 456731b35..7262e557d 100644 --- a/frontends/nextjs/src/components/misc/auth/GodCredentialsSettings.tsx +++ b/frontends/nextjs/src/components/misc/auth/GodCredentialsSettings.tsx @@ -1,4 +1,4 @@ -import { Key } from '@phosphor-icons/react' +import { Key } from '@/fakemui/icons' import { useEffect, useState } from 'react' import { toast } from 'sonner' diff --git a/frontends/nextjs/src/components/misc/auth/Login.tsx b/frontends/nextjs/src/components/misc/auth/Login.tsx index 56a9ed39d..2c0286107 100644 --- a/frontends/nextjs/src/components/misc/auth/Login.tsx +++ b/frontends/nextjs/src/components/misc/auth/Login.tsx @@ -1,4 +1,4 @@ -import { Lock } from '@phosphor-icons/react' +import { Lock } from '@/fakemui/icons' import { useState } from 'react' import { toast } from 'sonner' diff --git a/frontends/nextjs/src/components/misc/auth/UnifiedLogin.tsx b/frontends/nextjs/src/components/misc/auth/UnifiedLogin.tsx index b33dc6fe7..ce4c61946 100644 --- a/frontends/nextjs/src/components/misc/auth/UnifiedLogin.tsx +++ b/frontends/nextjs/src/components/misc/auth/UnifiedLogin.tsx @@ -1,4 +1,4 @@ -import { ArrowLeft, Envelope, SignIn, UserPlus } from '@phosphor-icons/react' +import { ArrowLeft, Envelope, SignIn, UserPlus } from '@/fakemui/icons' import { useState } from 'react' import { toast } from 'sonner' diff --git a/frontends/nextjs/src/components/misc/data/generic-page/Preview.tsx b/frontends/nextjs/src/components/misc/data/generic-page/Preview.tsx index b25505621..3291830b6 100644 --- a/frontends/nextjs/src/components/misc/data/generic-page/Preview.tsx +++ b/frontends/nextjs/src/components/misc/data/generic-page/Preview.tsx @@ -1,4 +1,4 @@ -import { Eye, Layout, ShieldCheck } from '@phosphor-icons/react' +import { Eye, Layout, ShieldCheck } from '@/fakemui/icons' import { Badge, diff --git a/frontends/nextjs/src/components/misc/github/GitHubActionsFetcher.refactored.tsx b/frontends/nextjs/src/components/misc/github/GitHubActionsFetcher.refactored.tsx index 7a983b500..436921e70 100644 --- a/frontends/nextjs/src/components/misc/github/GitHubActionsFetcher.refactored.tsx +++ b/frontends/nextjs/src/components/misc/github/GitHubActionsFetcher.refactored.tsx @@ -1,4 +1,4 @@ -import { ArrowClockwise, Info, Warning } from '@phosphor-icons/react' +import { ArrowClockwise, Info, Warning } from '@/fakemui/icons' import { useEffect } from 'react' import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui' diff --git a/frontends/nextjs/src/components/organisms/security/SecurityMessage.tsx b/frontends/nextjs/src/components/organisms/security/SecurityMessage.tsx index 6b9901862..2591aefb3 100644 --- a/frontends/nextjs/src/components/organisms/security/SecurityMessage.tsx +++ b/frontends/nextjs/src/components/organisms/security/SecurityMessage.tsx @@ -1,4 +1,4 @@ -import { CheckCircle, Info, ShieldWarning, Warning } from '@phosphor-icons/react' +import { CheckCircle, Info, ShieldWarning, Warning } from '@/fakemui/icons' import { Alert, AlertDescription } from '@/components/ui' import { Badge } from '@/components/ui' diff --git a/packages/ui_header/seed/scripts/render.lua b/packages/ui_header/seed/scripts/render.lua index c16f8f736..6e1946e18 100644 --- a/packages/ui_header/seed/scripts/render.lua +++ b/packages/ui_header/seed/scripts/render.lua @@ -1,74 +1,3 @@ --- Header render component - ----@class HeaderProps ----@field variant? "default"|"admin" ----@field title? string ----@field showHome? boolean ----@field username? string ----@field showBadge? boolean ----@field showAvatar? boolean ----@field showLogout? boolean - ----@class UIComponent ----@field type string ----@field props? table ----@field children? UIComponent[] - -local M = {} - ----@param props HeaderProps ----@return UIComponent -function M.render(props) - local variant = props.variant or "default" - local bg = variant == "admin" and "bg-sidebar" or "bg-card" - - return { - type = "Box", - props = { className = "border-b sticky top-0 z-50 " .. bg }, - children = { - { - type = "Container", - props = { className = "flex justify-between items-center h-16 px-4" }, - children = { - M.logo_section(props), - M.user_section(props) - } - } - } - } -end - ----@param props HeaderProps ----@return UIComponent -function M.logo_section(props) - return { - type = "Flex", - props = { className = "items-center gap-6" }, - children = { - { type = "Box", props = { className = "w-8 h-8 rounded-lg bg-gradient-to-br from-primary to-accent" } }, - { type = "Typography", props = { variant = "h6", text = props.title or "MetaBuilder" } }, - props.showHome and { - type = "Button", - props = { variant = "ghost", text = "Home", onClick = "navigateHome" } - } or nil - } - } -end - ----@param props HeaderProps ----@return UIComponent -function M.user_section(props) - local children = {} - if props.username and props.showBadge then - children[#children + 1] = { type = "Badge", props = { text = props.username } } - end - if props.username and props.showAvatar then - children[#children + 1] = { type = "Avatar", props = { fallback = string.sub(props.username, 1, 1) } } - end - if props.showLogout then - children[#children + 1] = { type = "Button", props = { variant = "ghost", text = "Logout", onClick = "handleLogout" } } - end - return { type = "Flex", props = { className = "items-center gap-2" }, children = children } -end - -return M +-- Header render module redirect +-- This file now redirects to the modular implementation in render/ +return require("render.init") diff --git a/packages/ui_header/seed/scripts/render/logo_section.lua b/packages/ui_header/seed/scripts/render/logo_section.lua deleted file mode 100644 index 3b25c668b..000000000 --- a/packages/ui_header/seed/scripts/render/logo_section.lua +++ /dev/null @@ -1,35 +0,0 @@ --- Logo section component for header - ----@class HeaderProps ----@field variant? "default"|"admin" ----@field title? string ----@field showHome? boolean ----@field username? string ----@field showBadge? boolean ----@field showAvatar? boolean ----@field showLogout? boolean - ----@class UIComponent ----@field type string ----@field props? table ----@field children? UIComponent[] - ----Renders the logo and navigation section of the header ----@param props HeaderProps ----@return UIComponent -local function logo_section(props) - return { - type = "Flex", - props = { className = "items-center gap-6" }, - children = { - { type = "Box", props = { className = "w-8 h-8 rounded-lg bg-gradient-to-br from-primary to-accent" } }, - { type = "Typography", props = { variant = "h6", text = props.title or "MetaBuilder" } }, - props.showHome and { - type = "Button", - props = { variant = "ghost", text = "Home", onClick = "navigateHome" } - } or nil - } - } -end - -return logo_section diff --git a/packages/ui_header/seed/scripts/render/render.lua b/packages/ui_header/seed/scripts/render/render.lua deleted file mode 100644 index 99bbca997..000000000 --- a/packages/ui_header/seed/scripts/render/render.lua +++ /dev/null @@ -1,43 +0,0 @@ --- Main render function for header - -local logo_section = require("render.logo_section") -local user_section = require("render.user_section") - ----@class HeaderProps ----@field variant? "default"|"admin" ----@field title? string ----@field showHome? boolean ----@field username? string ----@field showBadge? boolean ----@field showAvatar? boolean ----@field showLogout? boolean - ----@class UIComponent ----@field type string ----@field props? table ----@field children? UIComponent[] - ----Renders the complete header component ----@param props HeaderProps ----@return UIComponent -local function render(props) - local variant = props.variant or "default" - local bg = variant == "admin" and "bg-sidebar" or "bg-card" - - return { - type = "Box", - props = { className = "border-b sticky top-0 z-50 " .. bg }, - children = { - { - type = "Container", - props = { className = "flex justify-between items-center h-16 px-4" }, - children = { - logo_section(props), - user_section(props) - } - } - } - } -end - -return render diff --git a/packages/ui_header/seed/scripts/render/types.lua b/packages/ui_header/seed/scripts/render/types.lua deleted file mode 100644 index 2c5591539..000000000 --- a/packages/ui_header/seed/scripts/render/types.lua +++ /dev/null @@ -1,17 +0,0 @@ --- Type definitions for header render components - ----@class HeaderProps ----@field variant? "default"|"admin" ----@field title? string ----@field showHome? boolean ----@field username? string ----@field showBadge? boolean ----@field showAvatar? boolean ----@field showLogout? boolean - ----@class UIComponent ----@field type string ----@field props? table ----@field children? UIComponent[] - -return {} diff --git a/packages/ui_header/seed/scripts/render/user_section.lua b/packages/ui_header/seed/scripts/render/user_section.lua deleted file mode 100644 index e18517665..000000000 --- a/packages/ui_header/seed/scripts/render/user_section.lua +++ /dev/null @@ -1,34 +0,0 @@ --- User section component for header - ----@class HeaderProps ----@field variant? "default"|"admin" ----@field title? string ----@field showHome? boolean ----@field username? string ----@field showBadge? boolean ----@field showAvatar? boolean ----@field showLogout? boolean - ----@class UIComponent ----@field type string ----@field props? table ----@field children? UIComponent[] - ----Renders the user info and actions section of the header ----@param props HeaderProps ----@return UIComponent -local function user_section(props) - local children = {} - if props.username and props.showBadge then - children[#children + 1] = { type = "Badge", props = { text = props.username } } - end - if props.username and props.showAvatar then - children[#children + 1] = { type = "Avatar", props = { fallback = string.sub(props.username, 1, 1) } } - end - if props.showLogout then - children[#children + 1] = { type = "Button", props = { variant = "ghost", text = "Logout", onClick = "handleLogout" } } - end - return { type = "Flex", props = { className = "items-center gap-2" }, children = children } -end - -return user_section