From 70da3a9399d3385b53f7831beb08f716b972860d Mon Sep 17 00:00:00 2001 From: Frank Date: Wed, 1 Oct 2025 19:34:37 -0400 Subject: wip: zen --- packages/console/mail/emails/components.tsx | 108 ++++++++++++++++++++ packages/console/mail/emails/styles.ts | 110 ++++++++++++++++++++ .../console/mail/emails/templates/InviteEmail.tsx | 113 +++++++++++++++++++++ .../templates/static/ibm-plex-mono-latin-400.woff2 | Bin 0 -> 10088 bytes .../templates/static/ibm-plex-mono-latin-500.woff2 | Bin 0 -> 10132 bytes .../templates/static/ibm-plex-mono-latin-600.woff2 | Bin 0 -> 10148 bytes .../templates/static/ibm-plex-mono-latin-700.woff2 | Bin 0 -> 10140 bytes .../mail/emails/templates/static/rubik-latin.woff2 | Bin 0 -> 35320 bytes .../mail/emails/templates/static/zen-logo.png | Bin 0 -> 8336 bytes packages/console/mail/package.json | 19 ++++ packages/console/mail/sst-env.d.ts | 9 ++ 11 files changed, 359 insertions(+) create mode 100644 packages/console/mail/emails/components.tsx create mode 100644 packages/console/mail/emails/styles.ts create mode 100644 packages/console/mail/emails/templates/InviteEmail.tsx create mode 100644 packages/console/mail/emails/templates/static/ibm-plex-mono-latin-400.woff2 create mode 100644 packages/console/mail/emails/templates/static/ibm-plex-mono-latin-500.woff2 create mode 100644 packages/console/mail/emails/templates/static/ibm-plex-mono-latin-600.woff2 create mode 100644 packages/console/mail/emails/templates/static/ibm-plex-mono-latin-700.woff2 create mode 100644 packages/console/mail/emails/templates/static/rubik-latin.woff2 create mode 100644 packages/console/mail/emails/templates/static/zen-logo.png create mode 100644 packages/console/mail/package.json create mode 100644 packages/console/mail/sst-env.d.ts (limited to 'packages/console/mail') diff --git a/packages/console/mail/emails/components.tsx b/packages/console/mail/emails/components.tsx new file mode 100644 index 000000000..d030b6cbf --- /dev/null +++ b/packages/console/mail/emails/components.tsx @@ -0,0 +1,108 @@ +// @ts-nocheck +import React from "react" +import { Font, Hr as JEHr, Text as JEText, type HrProps, type TextProps } from "@jsx-email/all" +import { DIVIDER_COLOR, SURFACE_DIVIDER_COLOR, textColor } from "./styles" + +export function Text(props: TextProps) { + return +} + +export function Hr(props: HrProps) { + return +} + +export function SurfaceHr(props: HrProps) { + return ( + + ) +} + +export function Title({ children }: TitleProps) { + return React.createElement("title", null, children) +} + +export function A({ children, ...props }: AProps) { + return React.createElement("a", props, children) +} + +export function Span({ children, ...props }: SpanProps) { + return React.createElement("span", props, children) +} + +export function Wbr({ children, ...props }: WbrProps) { + return React.createElement("wbr", props, children) +} + +export function Fonts({ assetsUrl }: { assetsUrl: string }) { + return ( + <> + + + + + + + ) +} + +export function SplitString({ text, split }: { text: string; split: number }) { + const segments: JSX.Element[] = [] + for (let i = 0; i < text.length; i += split) { + segments.push(<>{text.slice(i, i + split)}) + if (i + split < text.length) { + segments.push() + } + } + return <>{segments} +} diff --git a/packages/console/mail/emails/styles.ts b/packages/console/mail/emails/styles.ts new file mode 100644 index 000000000..f9b62a7cd --- /dev/null +++ b/packages/console/mail/emails/styles.ts @@ -0,0 +1,110 @@ +export const unit = 16; + +export const GREY_COLOR = [ + "#1A1A2E", //0 + "#2F2F41", //1 + "#444454", //2 + "#585867", //3 + "#6D6D7A", //4 + "#82828D", //5 + "#9797A0", //6 + "#ACACB3", //7 + "#C1C1C6", //8 + "#D5D5D9", //9 + "#EAEAEC", //10 + "#FFFFFF", //11 +]; + +export const BLUE_COLOR = "#395C6B"; +export const DANGER_COLOR = "#ED322C"; +export const TEXT_COLOR = GREY_COLOR[0]; +export const SECONDARY_COLOR = GREY_COLOR[5]; +export const DIMMED_COLOR = GREY_COLOR[7]; +export const DIVIDER_COLOR = GREY_COLOR[10]; +export const BACKGROUND_COLOR = "#F0F0F1"; +export const SURFACE_COLOR = DIVIDER_COLOR; +export const SURFACE_DIVIDER_COLOR = GREY_COLOR[9]; + +export const body = { + background: BACKGROUND_COLOR, +}; + +export const container = { + minWidth: "600px", +}; + +export const medium = { + fontWeight: 500, +}; + +export const danger = { + color: DANGER_COLOR, +}; + +export const frame = { + padding: `${unit * 1.5}px`, + border: `1px solid ${SURFACE_DIVIDER_COLOR}`, + background: "#FFF", + borderRadius: "6px", + boxShadow: `0 1px 2px rgba(0,0,0,0.03), + 0 2px 4px rgba(0,0,0,0.03), + 0 2px 6px rgba(0,0,0,0.03)`, +}; + +export const textColor = { + color: TEXT_COLOR, +}; + +export const code = { + fontFamily: "IBM Plex Mono, monospace", +}; + +export const headingHr = { + margin: `${unit}px 0`, +}; + +export const buttonPrimary = { + ...code, + padding: "12px 18px", + color: "#FFF", + borderRadius: "4px", + background: BLUE_COLOR, + fontSize: "12px", + fontWeight: 500, +}; + +export const compactText = { + margin: "0 0 2px", +}; + +export const breadcrumb = { + fontSize: "14px", + color: SECONDARY_COLOR, +}; + +export const breadcrumbColonSeparator = { + padding: " 0 4px", + color: DIMMED_COLOR, +}; + +export const breadcrumbSeparator = { + color: DIVIDER_COLOR, +}; + +export const heading = { + fontSize: "22px", + fontWeight: 500, +}; + +export const sectionLabel = { + ...code, + ...compactText, + letterSpacing: "0.5px", + fontSize: "13px", + fontWeight: 500, + color: DIMMED_COLOR, +}; + +export const footerLink = { + fontSize: "14px", +}; diff --git a/packages/console/mail/emails/templates/InviteEmail.tsx b/packages/console/mail/emails/templates/InviteEmail.tsx new file mode 100644 index 000000000..978080a9c --- /dev/null +++ b/packages/console/mail/emails/templates/InviteEmail.tsx @@ -0,0 +1,113 @@ +// @ts-nocheck +import React from "react" +import { Img, Row, Html, Link, Body, Head, Button, Column, Preview, Section, Container } from "@jsx-email/all" +import { Hr, Text, Fonts, SplitString, Title, A, Span } from "../components" +import { + unit, + body, + code, + frame, + medium, + heading, + container, + headingHr, + footerLink, + breadcrumb, + compactText, + buttonPrimary, + breadcrumbColonSeparator, +} from "../styles" + +const LOCAL_ASSETS_URL = "/static" +const CONSOLE_URL = "https://opencode.ai/" +const DOC_URL = "https://opencode.ai/docs/zen" + +interface InviteEmailProps { + workspace: string + assetsUrl: string +} +export const InviteEmail = ({ workspace, assetsUrl = LOCAL_ASSETS_URL }: InviteEmailProps) => { + const subject = `Join the ${workspace} workspace` + const messagePlain = `You've been invited to join the ${workspace} workspace in the OpenCode Zen Console.` + const url = `${CONSOLE_URL}workspace/${workspace}` + return ( + + + {`OpenCode Zen — ${messagePlain}`} + + + {messagePlain} + + +
+ + + + OpenCode Zen Logo + + + + + + + + + +
+
+
+ +
+ + OpenCode Zen + : + {workspace} + + + + + + +
+
+ + You've been invited to join the{" "} + + {workspace} + {" "} + workspace in the{" "} + + OpenCode Zen Console + + . + +
+ + + +
+
+
+ + + + + Console + + + + + About + + + +
+
+ + + ) +} + +export default InviteEmail diff --git a/packages/console/mail/emails/templates/static/ibm-plex-mono-latin-400.woff2 b/packages/console/mail/emails/templates/static/ibm-plex-mono-latin-400.woff2 new file mode 100644 index 000000000..89713fa9a Binary files /dev/null and b/packages/console/mail/emails/templates/static/ibm-plex-mono-latin-400.woff2 differ diff --git a/packages/console/mail/emails/templates/static/ibm-plex-mono-latin-500.woff2 b/packages/console/mail/emails/templates/static/ibm-plex-mono-latin-500.woff2 new file mode 100644 index 000000000..21413e73f Binary files /dev/null and b/packages/console/mail/emails/templates/static/ibm-plex-mono-latin-500.woff2 differ diff --git a/packages/console/mail/emails/templates/static/ibm-plex-mono-latin-600.woff2 b/packages/console/mail/emails/templates/static/ibm-plex-mono-latin-600.woff2 new file mode 100644 index 000000000..4a2ebd962 Binary files /dev/null and b/packages/console/mail/emails/templates/static/ibm-plex-mono-latin-600.woff2 differ diff --git a/packages/console/mail/emails/templates/static/ibm-plex-mono-latin-700.woff2 b/packages/console/mail/emails/templates/static/ibm-plex-mono-latin-700.woff2 new file mode 100644 index 000000000..624783be5 Binary files /dev/null and b/packages/console/mail/emails/templates/static/ibm-plex-mono-latin-700.woff2 differ diff --git a/packages/console/mail/emails/templates/static/rubik-latin.woff2 b/packages/console/mail/emails/templates/static/rubik-latin.woff2 new file mode 100644 index 000000000..c533eec64 Binary files /dev/null and b/packages/console/mail/emails/templates/static/rubik-latin.woff2 differ diff --git a/packages/console/mail/emails/templates/static/zen-logo.png b/packages/console/mail/emails/templates/static/zen-logo.png new file mode 100644 index 000000000..382223627 Binary files /dev/null and b/packages/console/mail/emails/templates/static/zen-logo.png differ diff --git a/packages/console/mail/package.json b/packages/console/mail/package.json new file mode 100644 index 000000000..8ceb170e6 --- /dev/null +++ b/packages/console/mail/package.json @@ -0,0 +1,19 @@ +{ + "$schema": "https://json.schemastore.org/package.json", + "name": "@opencode/console-mail", + "version": "0.13.5", + "private": true, + "type": "module", + "dependencies": { + "@jsx-email/all": "2.2.3", + "@jsx-email/cli": "1.4.3", + "@types/react": "18.0.25", + "react": "18.2.0" + }, + "exports": { + "./*": "./emails/templates/*" + }, + "scripts": { + "dev": "email preview emails/templates" + } +} diff --git a/packages/console/mail/sst-env.d.ts b/packages/console/mail/sst-env.d.ts new file mode 100644 index 000000000..9b9de7327 --- /dev/null +++ b/packages/console/mail/sst-env.d.ts @@ -0,0 +1,9 @@ +/* This file is auto-generated by SST. Do not edit. */ +/* tslint:disable */ +/* eslint-disable */ +/* deno-fmt-ignore-file */ + +/// + +import "sst" +export {} \ No newline at end of file -- cgit v1.2.3