From 9c86e83bc33554f9b6d7a05165b37cffea317cdf Mon Sep 17 00:00:00 2001 From: Olivia Kane Date: Mon, 21 Oct 2024 15:16:41 -0400 Subject: [PATCH] update primitive code --- .../sections/home/MooseValuePropSection.tsx | 81 +++---- .../app/sections/home/PrimitivesCode.tsx | 214 +++++++++--------- .../app/sections/home/WhatIsMooseForV2.tsx | 76 +++---- apps/framework-landing/app/shiki.tsx | 15 +- .../components/icon-cards.tsx | 45 ++-- 5 files changed, 213 insertions(+), 218 deletions(-) diff --git a/apps/framework-landing/app/sections/home/MooseValuePropSection.tsx b/apps/framework-landing/app/sections/home/MooseValuePropSection.tsx index 5007c0ddf..b6285007e 100644 --- a/apps/framework-landing/app/sections/home/MooseValuePropSection.tsx +++ b/apps/framework-landing/app/sections/home/MooseValuePropSection.tsx @@ -1,7 +1,6 @@ import { Section, Grid, - FullWidthContentContainer, ThirdWidthContentContainer, } from "@514labs/design-system-components/components/containers"; import { @@ -9,52 +8,44 @@ import { HeadingLevel, } from "@514labs/design-system-components/typography"; import { IconCard } from "@514labs/design-system-components/components"; -import { ServerIcon } from "lucide-react"; +import { Bot, Cloud, Wand2 } from "lucide-react"; export default function MooseValuePropSection() { return ( - <> -
- - - - Designed with the future of software development in mind. - - {" "} - All in pure TypeScript or Python. - - - - -
-
- - - - - - - - - - - -
- +
+ + Tools you love, context you need. + + {" "} + Built for modern, AI-centric development workflows + + + + + + + + + + + + + +
); } diff --git a/apps/framework-landing/app/sections/home/PrimitivesCode.tsx b/apps/framework-landing/app/sections/home/PrimitivesCode.tsx index 950f9ebaa..a4a112536 100644 --- a/apps/framework-landing/app/sections/home/PrimitivesCode.tsx +++ b/apps/framework-landing/app/sections/home/PrimitivesCode.tsx @@ -9,11 +9,11 @@ import { SelectValue, SelectContent, SelectItem, - IconCard, + BackgroundIcon, } from "@514labs/design-system-components/components"; import { TrackableTabsTrigger } from "@514labs/design-system-components/trackable-components"; import { CopyButton } from "../../copy-button"; - +import { cn } from "@514labs/design-system-components/utils"; import { Heading, Text, @@ -35,7 +35,7 @@ import { HardDriveUpload, CopyIcon, } from "lucide-react"; -import { useState, Fragment } from "react"; +import { useState } from "react"; import CodeBlock from "../../shiki"; const content = { @@ -45,22 +45,25 @@ const content = { "Codify the shape and structure of the data that is used in your application", filename: "/datamodels/models", ts: ` +import { Key } from "@514labs/moose-lib" + export interface UserActivity { - id: string; + id: Key; userId: string; activity: string; timestamp: Date; } export interface ParsedActivity { - id: string; + id: Key; userId: string; activity: string; utcTimestamp: Date; }`, py: ` -from moose_lib import Key +from moose_lib import Key, moose_data_model +@moose_data_model @dataclass class UserActivity: eventId: Key[str] @@ -68,6 +71,7 @@ class UserActivity: userId: str activity: str +@moose_data_model @dataclass class ParsedActivity: eventId: Key[str] @@ -95,7 +99,7 @@ export default function run(source: UserActivity): ParsedActivity { } `, py: ` from app.datamodels.models import UserActivity, ParsedActivity -from moose_lib import Flow +from moose_lib import StreamingFunction def parse_activity(activity: UserActivity) -> ParsedActivity: return ParsedActivity( @@ -105,7 +109,7 @@ def parse_activity(activity: UserActivity) -> ParsedActivity: activity=activity.activity, ) -my_flow = Flow( +my_flow = StreamingFunction( run=parse_activity ) `, @@ -295,107 +299,105 @@ const infrastructure = [ ]; export const PrimitivesCode = () => { - const [activeTab, setActiveTab] = useState("models"); const [language, setLanguage] = useState("ts"); return ( - -
- - - - - Develop application logic - - - Define data workflows locally in your TypeScript or Python - project code. - - - setActiveTab(tab as keyof typeof content) - } +
+ + + + {Object.keys(content).map((tab) => ( + - - {Object.keys(content).map((tab) => ( - - - {content[tab as keyof typeof content]?.title} - - - ))} - - {Object.keys(content).map((tab) => ( - - - {content[tab as keyof typeof content]?.description} - - - ))} - - - -
- - - - -
- -
-
- - - Moose automatically derives the infrastructure - - - Moose automatically creates and manages the APIs, topics, tables, - and processes needed to support the data workflows defined in your - project code. - -
- {infrastructure.map((infra) => ( - - ))} -
-
- -
- + + {content[tab as keyof typeof content]?.title} + + + ))} + + {Object.keys(content).map((tab) => ( + + {/* + {content[tab as keyof typeof content]?.description} + */} + + +
+ + Develop application logic + +
+
+
+ + + + +
+ +
+
+ + Moose derives infra +
+ {infrastructure.map((infra) => ( +
+ +
+ {infra.title} + + {infra.infra} + +
+
+ ))} +
+
+
+
+ ))} +
+
+
); }; diff --git a/apps/framework-landing/app/sections/home/WhatIsMooseForV2.tsx b/apps/framework-landing/app/sections/home/WhatIsMooseForV2.tsx index 383f82915..fa34830a9 100644 --- a/apps/framework-landing/app/sections/home/WhatIsMooseForV2.tsx +++ b/apps/framework-landing/app/sections/home/WhatIsMooseForV2.tsx @@ -11,48 +11,44 @@ import { import React from "react"; import { IconCard } from "@514labs/design-system-components/components"; -import { - FileBarChart, - GitBranch, - LayoutDashboard, - PieChart, -} from "lucide-react"; +import { Code, GitCompare, LayoutDashboard, PieChart } from "lucide-react"; export const WhatIsMooseFor = () => { return ( - <> -
- - - Use Cases - - - - - - - - -
- +
+ + + Use Cases.{" "} + + What Moose is really great for. + + + + + + + + + +
); }; diff --git a/apps/framework-landing/app/shiki.tsx b/apps/framework-landing/app/shiki.tsx index 728b5255e..b4282e171 100644 --- a/apps/framework-landing/app/shiki.tsx +++ b/apps/framework-landing/app/shiki.tsx @@ -7,7 +7,7 @@ const mooseTheme = { name: "moose-theme", type: "dark", fg: "#E0E0E0", - bg: "#1C1C1C", + bg: "#000000", settings: [ { scope: ["comment", "punctuation.definition.comment"], @@ -119,7 +119,7 @@ export default function CodeBlock({ { name: "moose-theme", fg: "#E0E0E0", - bg: "#1c1c1c", + bg: "#000000", settings: mooseTheme.settings, }, ], @@ -137,17 +137,12 @@ export default function CodeBlock({ }, [code, language]); return ( -
-
+
+
{filename}
diff --git a/packages/design-system-components/components/icon-cards.tsx b/packages/design-system-components/components/icon-cards.tsx index 0e381938e..efa0fdf56 100644 --- a/packages/design-system-components/components/icon-cards.tsx +++ b/packages/design-system-components/components/icon-cards.tsx @@ -25,6 +25,11 @@ interface IconCardProps { variant?: "default" | "gradient"; } +interface IconPops { + Icon: React.ElementType; + variant: "default" | "gradient"; +} + interface CTACardProps extends IconCardProps { ctaLink: string; ctaLabel: string; @@ -45,23 +50,7 @@ function BaseCard({ return ( -
-
- -
-
+
{title} @@ -72,6 +61,28 @@ function BaseCard({ ); } +export function BackgroundIcon({ Icon, variant = "default" }: IconPops) { + return ( +
+
+ +
+
+ ); +} + export function IconCard({ title, description,