diff --git a/frontends/nextjs/src/app/level1-client.tsx b/frontends/nextjs/src/app/level1-client.tsx deleted file mode 100644 index 2fa560e6c..000000000 --- a/frontends/nextjs/src/app/level1-client.tsx +++ /dev/null @@ -1,18 +0,0 @@ -'use client' - -import { useRouter } from 'next/navigation' - -import { Level1 } from '@/components/Level1' -import type { AppLevel } from '@/lib/level-types' -import { getLevelPath } from '@/lib/navigation/get-level-path' - -export function Level1Client() { - const router = useRouter() - - const handleNavigate = (level: number) => { - const normalizedLevel = Math.min(6, Math.max(1, level)) as AppLevel - router.push(getLevelPath(normalizedLevel)) - } - - return -} diff --git a/frontends/nextjs/src/app/levels/LevelsClient.test.tsx b/frontends/nextjs/src/app/levels/LevelsClient.test.tsx deleted file mode 100644 index db3e0ffca..000000000 --- a/frontends/nextjs/src/app/levels/LevelsClient.test.tsx +++ /dev/null @@ -1,15 +0,0 @@ -import { fireEvent, render, screen } from '@testing-library/react' - -import LevelsClient from './LevelsClient' - -describe('LevelsClient', () => { - it('renders permission levels and promotes to the next tier', () => { - render() - expect(screen.getByText(/Level 1 ยท Public/)).toBeTruthy() - - const promoteButton = screen.getByRole('button', { name: /Promote to/ }) - fireEvent.click(promoteButton) - - expect(screen.getByText(/Upgraded to User/)).toBeTruthy() - }) -}) diff --git a/frontends/nextjs/src/app/levels/LevelsClient.tsx b/frontends/nextjs/src/app/levels/LevelsClient.tsx deleted file mode 100644 index eb6351352..000000000 --- a/frontends/nextjs/src/app/levels/LevelsClient.tsx +++ /dev/null @@ -1,75 +0,0 @@ -'use client' - -import { useMemo, useState } from 'react' - -import { Container, Stack, Typography } from '@/fakemui' - -import { LevelDetails } from './components/LevelDetails' -import { LevelsGrid } from './components/LevelsGrid' -import { PERMISSION_LEVELS } from './levels-data' - -export default function LevelsClient() { - const [selectedLevelId, setSelectedLevelId] = useState(PERMISSION_LEVELS[0].id) - const [note, setNote] = useState('') - - const selectedLevel = useMemo( - () => PERMISSION_LEVELS.find(level => level.id === selectedLevelId) ?? PERMISSION_LEVELS[0], - [selectedLevelId] - ) - - const nextLevel = useMemo( - () => PERMISSION_LEVELS.find(level => level.id === selectedLevelId + 1) ?? null, - [selectedLevelId] - ) - - const maxCapabilityCount = useMemo( - () => Math.max(...PERMISSION_LEVELS.map(level => level.capabilities.length)), - [] - ) - - const handleSelect = (levelId: number) => { - setSelectedLevelId(levelId) - setNote( - `Selected ${PERMISSION_LEVELS.find(l => l.id === levelId)?.title ?? 'unknown'} privileges.` - ) - } - - const handlePromote = () => { - if (!nextLevel) { - setNote('You already command the cosmos. No further promotions available.') - return - } - setSelectedLevelId(nextLevel.id) - setNote(`Upgraded to ${nextLevel.title}.`) - } - - return ( - - - - - The Six Permission Levels - - - Level up through Public, User, Moderator, Admin, God, and Super God to unlock the right - controls for your role. - - - - - - - - - ) -} diff --git a/frontends/nextjs/src/app/levels/components/LevelDetails.tsx b/frontends/nextjs/src/app/levels/components/LevelDetails.tsx deleted file mode 100644 index e1eb8f56b..000000000 --- a/frontends/nextjs/src/app/levels/components/LevelDetails.tsx +++ /dev/null @@ -1,90 +0,0 @@ -import { - Alert, - Box, - Button, - Chip, - Divider, - LinearProgress, - Paper, - Stack, - Typography, -} from '@/fakemui' - -import type { PermissionLevel } from '../levels-data' -import { highlightColor } from '../utils/highlightColor' - -type LevelDetailsProps = { - selectedLevel: PermissionLevel - nextLevel: PermissionLevel | null - maxCapabilityCount: number - note: string - onPromote: () => void -} - -export const LevelDetails = ({ - selectedLevel, - nextLevel, - maxCapabilityCount, - note, - onPromote, -}: LevelDetailsProps) => ( - `1px dashed ${theme.palette.divider}`, - bgcolor: 'background.paper', - }} - > - - - Selected level details - - - - {selectedLevel.description} - - - {selectedLevel.capabilities.map(capability => ( - - ))} - - - - - {selectedLevel.capabilities.length} of {maxCapabilityCount} capability tiers unlocked - - - - - - Next move - - {nextLevel ? ( - - Promote into {nextLevel.title} to unlock{' '} - {nextLevel.capabilities.length} controls. - - ) : ( - - Super God reigns supreme. You already own every privilege. - - )} - - - - - {note && {note}} - - -) diff --git a/frontends/nextjs/src/app/levels/components/LevelsGrid.tsx b/frontends/nextjs/src/app/levels/components/LevelsGrid.tsx deleted file mode 100644 index 4fc5b9ac7..000000000 --- a/frontends/nextjs/src/app/levels/components/LevelsGrid.tsx +++ /dev/null @@ -1,50 +0,0 @@ -import { Box, Chip, Grid, Paper, Stack, Typography } from '@/fakemui' - -import type { PermissionLevel } from '../levels-data' - -type LevelsGridProps = { - levels: PermissionLevel[] - selectedLevelId: number - onSelect: (levelId: number) => void -} - -export const LevelsGrid = ({ levels, selectedLevelId, onSelect }: LevelsGridProps) => ( - - {levels.map(level => ( - - onSelect(level.id)} - sx={{ - border: theme => - `2px solid ${selectedLevelId === level.id ? theme.palette.primary.main : theme.palette.divider}`, - p: 3, - cursor: 'pointer', - position: 'relative', - '&:hover': { - borderColor: 'primary.main', - }, - }} - elevation={selectedLevelId === level.id ? 6 : 1} - > - - - - - Level {level.id} ยท {level.title} - - - {level.tagline} - - - {level.description} - - - {level.capabilities.slice(0, 3).map(capability => ( - - ))} - - - - ))} - -) diff --git a/frontends/nextjs/src/app/levels/levels-data.ts b/frontends/nextjs/src/app/levels/levels-data.ts deleted file mode 100644 index 37412ef3c..000000000 --- a/frontends/nextjs/src/app/levels/levels-data.ts +++ /dev/null @@ -1,100 +0,0 @@ -export type PermissionLevel = { - id: number - key: string - title: string - description: string - badge: string - capabilities: string[] - tagline: string -} - -export const PERMISSION_LEVELS: PermissionLevel[] = [ - { - id: 1, - key: 'public', - title: 'Public', - badge: '๐ŸŒ', - description: 'Read-only access to marketing, help, and showcase pages without signing in.', - tagline: 'Open browsing with zero authentication.', - capabilities: [ - 'Access the landing experience', - 'Follow feature stories', - 'Preview public dashboards', - ], - }, - { - id: 2, - key: 'user', - title: 'User', - badge: '๐Ÿง‘โ€๐Ÿ’ป', - description: - 'Personalized workspace for building content, saving dashboards, and collaborating.', - tagline: 'Everyday contributors and team members.', - capabilities: [ - 'Edit personal settings', - 'Manage own content', - 'Launch saved dashboards', - 'Join shared workflows', - ], - }, - { - id: 3, - key: 'moderator', - title: 'Moderator', - badge: '๐Ÿ›ก๏ธ', - description: - 'Protect the community by triaging flags, reviewing reports, and shaping shared spaces.', - tagline: 'Guardians of behavior and tone.', - capabilities: [ - 'Moderate discussions', - 'Resolve user flags', - 'Review incident reports', - 'Hide or restore content', - ], - }, - { - id: 4, - key: 'admin', - title: 'Admin', - badge: '๐Ÿงฐ', - description: - 'Tenant administrators who manage users, billing, policies, and broader content sets.', - tagline: 'Operational control for the tenant layer.', - capabilities: [ - 'Manage user accounts', - 'Adjust tenant settings', - 'Approve packages', - 'Oversee moderation queue', - ], - }, - { - id: 5, - key: 'god', - title: 'God', - badge: '๐Ÿง™โ€โ™‚๏ธ', - description: - 'Blueprint builders who orchestrate workflows, seed packages, and shape the system architecture.', - tagline: 'Power users with advanced scripting rights.', - capabilities: [ - 'Author workflows', - 'Compose the builder UI', - 'Define multi-tenant templates', - 'Seed packages', - ], - }, - { - id: 6, - key: 'supergod', - title: 'Super God', - badge: '๐Ÿ‘‘', - description: - 'Full sovereignty over every tenant, infrastructure, and override path in the universe.', - tagline: 'Ultimate authority for platform-level change.', - capabilities: [ - 'Assign god roles', - 'Transfer ownership', - 'Burn and restore tenants', - 'Run system-wide audits', - ], - }, -] diff --git a/frontends/nextjs/src/app/levels/page.tsx b/frontends/nextjs/src/app/levels/page.tsx deleted file mode 100644 index 1c4df2e51..000000000 --- a/frontends/nextjs/src/app/levels/page.tsx +++ /dev/null @@ -1,12 +0,0 @@ -import type { Metadata } from 'next' - -import LevelsClient from './LevelsClient' - -export const metadata: Metadata = { - title: 'Permission Levels', - description: 'Explore the five permission tiers that govern MetaBuilder.', -} - -export default function LevelsPage() { - return -} diff --git a/frontends/nextjs/src/app/levels/utils/highlightColor.ts b/frontends/nextjs/src/app/levels/utils/highlightColor.ts deleted file mode 100644 index 7606ea4d5..000000000 --- a/frontends/nextjs/src/app/levels/utils/highlightColor.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { PermissionLevel } from '../levels-data' - -export const highlightColor = (level: PermissionLevel) => { - if (level.id === 6) return 'warning.main' - if (level.id === 5) return 'primary.main' - return 'divider' -} diff --git a/frontends/nextjs/src/components/atoms/README.md b/frontends/nextjs/src/components/atoms/README.md deleted file mode 100644 index e327e1764..000000000 --- a/frontends/nextjs/src/components/atoms/README.md +++ /dev/null @@ -1,115 +0,0 @@ -# Atoms - -Atoms are the smallest, indivisible UI elements in the MetaBuilder component library. Built on Material UI. - -## Components - -### Controls -| Component | Description | MUI Base | -|-----------|-------------|----------| -| `Button` | Primary action button with variants | `MuiButton` | -| `Checkbox` | Boolean toggle with optional label | `MuiCheckbox` | -| `Switch` | Toggle switch with optional label | `MuiSwitch` | -| `Radio` | Radio button with optional label | `MuiRadio` | - -### Inputs -| Component | Description | MUI Base | -|-----------|-------------|----------| -| `Input` | Text input field | `InputBase` | -| `TextArea` | Multi-line text input | `TextareaAutosize` | -| `Select` | Dropdown selection | `MuiSelect` | - -### Display -| Component | Description | MUI Base | -|-----------|-------------|----------| -| `Label` | Form field label | `Typography` | -| `Badge` | Status indicator chip | `Chip` | -| `Avatar` | User/entity image with fallback | `MuiAvatar` | -| `IconButton` | Icon-only button | `MuiIconButton` | -| `Icon` | Icon wrapper for fakemui icons | `@/fakemui/icons` | -| `Link` | Navigation link with Next.js integration | `MuiLink` + `NextLink` | -| `Text` | Typography with weight/alignment options | `Typography` | - -### Feedback -| Component | Description | MUI Base | -|-----------|-------------|----------| -| `Skeleton` | Loading placeholder | `MuiSkeleton` | -| `Separator` | Visual divider | `Divider` | -| `Progress` | Progress indicator | `LinearProgress` | -| `Tooltip` | Hover information | `MuiTooltip` | -| `Spinner` | Loading spinner | `CircularProgress` | - -## Usage - -```typescript -import { - Button, Input, TextArea, Select, Radio, - Label, Badge, Icon, Link, Text -} from '@/components/atoms' - -function MyComponent() { - return ( - - - - - -