Browse Source

wip: zen style nav bar

Frank 4 months ago
parent
commit
ad7b4b1fcd

+ 60 - 33
packages/console/app/src/component/icon.tsx

@@ -2,41 +2,68 @@ import { JSX } from "solid-js"
 
 
 export function IconLogo(props: JSX.SvgSVGAttributes<SVGSVGElement>) {
 export function IconLogo(props: JSX.SvgSVGAttributes<SVGSVGElement>) {
   return (
   return (
-    <svg {...props} width="234" height="42" viewBox="0 0 234 42" fill="none" xmlns="http://www.w3.org/2000/svg">
-      <path
-        fill-rule="evenodd"
-        clip-rule="evenodd"
-        d="M54 36H36V42H30V6H54V36ZM36 30H48V12H36V30Z"
-        fill="currentColor"
-      />
-      <path fill-rule="evenodd" clip-rule="evenodd" d="M24 36H0V6H24V36ZM6 30H18V12H6V30Z" fill="currentColor" />
-      <path
-        fill-rule="evenodd"
-        clip-rule="evenodd"
-        d="M84 24H66V30H84V36H60V6H84V24ZM66 18H78V12H66V18Z"
-        fill="currentColor"
-      />
-      <path d="M108 12H96V36H90V6H108V12Z" fill="currentColor" />
-      <path d="M114 36H108V12H114V36Z" fill="currentColor" />
-      <path d="M144 12H126V30H144V36H120V6H144V12Z" fill="currentColor" />
-      <path
-        fill-rule="evenodd"
-        clip-rule="evenodd"
-        d="M174 36H150V6H174V36ZM156 30H168V12H156V30Z"
-        fill="currentColor"
-      />
-      <path
-        fill-rule="evenodd"
-        clip-rule="evenodd"
-        d="M204 36H180V6H198V0H204V36ZM186 30H198V12H186V30Z"
-        fill="currentColor"
-      />
-      <path
-        fill-rule="evenodd"
-        clip-rule="evenodd"
-        d="M234 24H216V30H234V36H210V6H234V24ZM216 18H228V12H216V18Z"
+    <svg width="64" height="32" viewBox="0 0 64 32" fill="none" xmlns="http://www.w3.org/2000/svg">
+      <path d="M0 9.14333V4.5719H4.57143V9.14333H0Z" fill="currentColor" />
+      <path d="M4.57178 9.14333V4.5719H9.14321V9.14333H4.57178Z" fill="currentColor" />
+      <path d="M9.1438 9.14333V4.5719H13.7152V9.14333H9.1438Z" fill="currentColor" />
+      <path d="M13.7124 9.14333V4.5719H18.2838V9.14333H13.7124Z" fill="currentColor" />
+      <path d="M13.7124 13.7136V9.14221H18.2838V13.7136H13.7124Z" fill="currentColor" />
+      <path d="M0 18.2857V13.7142H4.57143V18.2857H0Z" fill="currentColor" fill-opacity="0.2" />
+      <rect width="4.57143" height="4.57143" transform="translate(4.57178 13.7141)" fill="currentColor" />
+      <path d="M4.57178 18.2855V13.7141H9.14321V18.2855H4.57178Z" fill="currentColor" fill-opacity="0.2" />
+      <path d="M9.1438 18.2855V13.7141H13.7152V18.2855H9.1438Z" fill="currentColor" />
+      <path d="M13.7156 18.2855V13.7141H18.287V18.2855H13.7156Z" fill="currentColor" fill-opacity="0.2" />
+      <rect width="4.57143" height="4.57143" transform="translate(0 18.2859)" fill="currentColor" />
+      <path d="M0 22.8572V18.2858H4.57143V22.8572H0Z" fill="currentColor" fill-opacity="0.2" />
+      <rect
+        width="4.57143"
+        height="4.57143"
+        transform="translate(4.57178 18.2859)"
         fill="currentColor"
         fill="currentColor"
+        fill-opacity="0.2"
       />
       />
+      <path d="M4.57178 22.8573V18.2859H9.14321V22.8573H4.57178Z" fill="currentColor" />
+      <path d="M9.1438 22.8573V18.2859H13.7152V22.8573H9.1438Z" fill="currentColor" fill-opacity="0.2" />
+      <path d="M13.7156 22.8573V18.2859H18.287V22.8573H13.7156Z" fill="currentColor" fill-opacity="0.2" />
+      <path d="M0 27.4292V22.8578H4.57143V27.4292H0Z" fill="currentColor" />
+      <path d="M4.57178 27.4292V22.8578H9.14321V27.4292H4.57178Z" fill="currentColor" />
+      <path d="M9.1438 27.4276V22.8562H13.7152V27.4276H9.1438Z" fill="currentColor" />
+      <path d="M13.7124 27.4292V22.8578H18.2838V27.4292H13.7124Z" fill="currentColor" />
+      <path d="M22.8572 9.14333V4.5719H27.4286V9.14333H22.8572Z" fill="currentColor" />
+      <path d="M27.426 9.14333V4.5719H31.9975V9.14333H27.426Z" fill="currentColor" />
+      <path d="M32.001 9.14333V4.5719H36.5724V9.14333H32.001Z" fill="currentColor" />
+      <path d="M36.5698 9.14333V4.5719H41.1413V9.14333H36.5698Z" fill="currentColor" />
+      <path d="M22.8572 13.7152V9.1438H27.4286V13.7152H22.8572Z" fill="currentColor" />
+      <path d="M36.5698 13.7152V9.1438H41.1413V13.7152H36.5698Z" fill="currentColor" />
+      <path d="M22.8572 18.2855V13.7141H27.4286V18.2855H22.8572Z" fill="currentColor" />
+      <path d="M27.4292 18.2855V13.7141H32.0006V18.2855H27.4292Z" fill="currentColor" />
+      <path d="M32.001 18.2855V13.7141H36.5724V18.2855H32.001Z" fill="currentColor" />
+      <path d="M36.5698 18.2855V13.7141H41.1413V18.2855H36.5698Z" fill="currentColor" />
+      <path d="M22.8572 22.8573V18.2859H27.4286V22.8573H22.8572Z" fill="currentColor" />
+      <path d="M27.4292 22.8573V18.2859H32.0006V22.8573H27.4292Z" fill="currentColor" fill-opacity="0.2" />
+      <path d="M32.001 22.8573V18.2859H36.5724V22.8573H32.001Z" fill="currentColor" fill-opacity="0.2" />
+      <path d="M36.5698 22.8573V18.2859H41.1413V22.8573H36.5698Z" fill="currentColor" fill-opacity="0.2" />
+      <path d="M22.8572 27.4292V22.8578H27.4286V27.4292H22.8572Z" fill="currentColor" />
+      <path d="M27.4292 27.4276V22.8562H32.0006V27.4276H27.4292Z" fill="currentColor" />
+      <path d="M32.001 27.4276V22.8562H36.5724V27.4276H32.001Z" fill="currentColor" />
+      <path d="M36.5698 27.4292V22.8578H41.1413V27.4292H36.5698Z" fill="currentColor" />
+      <path d="M45.7144 9.14333V4.5719H50.2858V9.14333H45.7144Z" fill="currentColor" />
+      <path d="M50.2861 9.14333V4.5719H54.8576V9.14333H50.2861Z" fill="currentColor" />
+      <path d="M54.855 9.14333V4.5719H59.4264V9.14333H54.855Z" fill="currentColor" />
+      <path d="M45.7144 13.7136V9.14221H50.2858V13.7136H45.7144Z" fill="currentColor" />
+      <path d="M59.4299 13.7152V9.1438H64.0014V13.7152H59.4299Z" fill="currentColor" />
+      <path d="M45.7144 18.2855V13.7141H50.2858V18.2855H45.7144Z" fill="currentColor" />
+      <path d="M50.2861 18.2857V13.7142H54.8576V18.2857H50.2861Z" fill="currentColor" fill-opacity="0.2" />
+      <path d="M54.8579 18.2855V13.7141H59.4293V18.2855H54.8579Z" fill="currentColor" fill-opacity="0.2" />
+      <path d="M59.4299 18.2855V13.7141H64.0014V18.2855H59.4299Z" fill="currentColor" />
+      <path d="M45.7144 22.8573V18.2859H50.2858V22.8573H45.7144Z" fill="currentColor" />
+      <path d="M50.2861 22.8572V18.2858H54.8576V22.8572H50.2861Z" fill="currentColor" fill-opacity="0.2" />
+      <path d="M54.8579 22.8573V18.2859H59.4293V22.8573H54.8579Z" fill="currentColor" fill-opacity="0.2" />
+      <path d="M59.4299 22.8573V18.2859H64.0014V22.8573H59.4299Z" fill="currentColor" />
+      <path d="M45.7144 27.4292V22.8578H50.2858V27.4292H45.7144Z" fill="currentColor" />
+      <path d="M50.2861 27.4286V22.8572H54.8576V27.4286H50.2861Z" fill="currentColor" fill-opacity="0.2" />
+      <path d="M54.8579 27.4285V22.8571H59.4293V27.4285H54.8579Z" fill="currentColor" fill-opacity="0.2" />
+      <path d="M59.4299 27.4292V22.8578H64.0014V27.4292H59.4299Z" fill="currentColor" />
     </svg>
     </svg>
   )
   )
 }
 }

+ 1 - 1
packages/console/app/src/routes/workspace.tsx

@@ -1,7 +1,7 @@
 import { Show } from "solid-js"
 import { Show } from "solid-js"
 import { query, createAsync, RouteSectionProps, useParams, A } from "@solidjs/router"
 import { query, createAsync, RouteSectionProps, useParams, A } from "@solidjs/router"
 import "./workspace.css"
 import "./workspace.css"
-import { IconLogo, IconWorkspaceLogo } from "../component/icon"
+import { IconWorkspaceLogo } from "../component/icon"
 import { WorkspacePicker } from "./workspace-picker"
 import { WorkspacePicker } from "./workspace-picker"
 import { UserMenu } from "./user-menu"
 import { UserMenu } from "./user-menu"
 import { withActor } from "~/context/auth.withActor"
 import { withActor } from "~/context/auth.withActor"

+ 35 - 19
packages/console/app/src/routes/workspace/[id].css

@@ -14,26 +14,42 @@
   border-right: 1px solid var(--color-border);
   border-right: 1px solid var(--color-border);
   padding: var(--space-6) var(--space-4);
   padding: var(--space-6) var(--space-4);
   display: flex;
   display: flex;
-  flex-direction: column;
-  gap: var(--space-2);
-
-  [data-nav-button] {
-    padding: var(--space-3) var(--space-4);
-    border-radius: var(--border-radius-sm);
-    color: var(--color-text-muted);
-    text-decoration: none;
-    font-size: var(--font-size-sm);
-    font-weight: 500;
-    transition: all 0.15s ease;
-
-    &:hover {
-      background-color: var(--color-surface-hover);
-      color: var(--color-text);
-    }
+  justify-content: flex-end;
+
+  [data-component="nav-items"] {
+    display: flex;
+    flex-direction: column;
+    gap: var(--space-2);
+
+    [data-nav-button] {
+      padding: var(--space-3) var(--space-4);
+      border-radius: var(--border-radius-sm);
+      color: var(--color-text-muted);
+      text-decoration: none;
+      font-size: var(--font-size-sm);
+      font-weight: 500;
+      transition: all 0.15s ease;
+
+      &:hover {
+        color: var(--color-text);
+      }
+
+      &.active {
+        color: var(--color-text);
+        font-weight: 700;
+        position: relative;
 
 
-    &.active {
-      background-color: var(--color-surface-hover);
-      color: var(--color-text);
+        &::before {
+          content: '';
+          position: absolute;
+          left: calc(-1 * var(--space-0-5));
+          top: 0;
+          bottom: 0;
+          width: 2px;
+          background-color: var(--color-text);
+          border-radius: 0 2px 2px 0;
+        }
+      }
     }
     }
   }
   }
 }
 }

+ 18 - 16
packages/console/app/src/routes/workspace/[id].tsx

@@ -10,23 +10,25 @@ export default function WorkspaceLayout(props: RouteSectionProps) {
     <main data-page="workspace">
     <main data-page="workspace">
       <div data-component="workspace-container">
       <div data-component="workspace-container">
         <nav data-component="workspace-nav">
         <nav data-component="workspace-nav">
-          <A href={`/workspace/${params.id}`} end activeClass="active" data-nav-button>
-            Zen
-          </A>
-          <Show when={userInfo()?.isAdmin}>
-            <A href={`/workspace/${params.id}/billing`} activeClass="active" data-nav-button>
-              Billing
+          <div data-component="nav-items">
+            <A href={`/workspace/${params.id}`} end activeClass="active" data-nav-button>
+              Zen
             </A>
             </A>
-          </Show>
-          <A href={`/workspace/${params.id}/keys`} activeClass="active" data-nav-button>
-            API Keys
-          </A>
-          <A href={`/workspace/${params.id}/members`} activeClass="active" data-nav-button>
-            Members
-          </A>
-          <A href={`/workspace/${params.id}/settings`} activeClass="active" data-nav-button>
-            Settings
-          </A>
+            <A href={`/workspace/${params.id}/keys`} activeClass="active" data-nav-button>
+              API Keys
+            </A>
+            <A href={`/workspace/${params.id}/members`} activeClass="active" data-nav-button>
+              Members
+            </A>
+            <Show when={userInfo()?.isAdmin}>
+              <A href={`/workspace/${params.id}/billing`} activeClass="active" data-nav-button>
+                Billing
+              </A>
+            </Show>
+            <A href={`/workspace/${params.id}/settings`} activeClass="active" data-nav-button>
+              Settings
+            </A>
+          </div>
         </nav>
         </nav>
         <div data-component="workspace-content">{props.children}</div>
         <div data-component="workspace-content">{props.children}</div>
       </div>
       </div>

+ 1 - 1
packages/console/app/src/routes/workspace/[id]/index.css

@@ -1,6 +1,6 @@
 [data-page="workspace-[id]"] {
 [data-page="workspace-[id]"] {
   max-width: 64rem;
   max-width: 64rem;
-  padding: var(--space-10) var(--space-4);
+  padding: var(--space-2) var(--space-4);
   margin: 0 auto;
   margin: 0 auto;
   width: 100%;
   width: 100%;
   display: flex;
   display: flex;

+ 2 - 1
packages/console/app/src/routes/workspace/[id]/index.tsx

@@ -3,12 +3,13 @@ import { NewUserSection } from "./new-user-section"
 import { UsageSection } from "./usage-section"
 import { UsageSection } from "./usage-section"
 import { ModelSection } from "./model-section"
 import { ModelSection } from "./model-section"
 import { ProviderSection } from "./provider-section"
 import { ProviderSection } from "./provider-section"
+import { IconLogo } from "~/component/icon"
 
 
 export default function () {
 export default function () {
   return (
   return (
     <div data-page="workspace-[id]">
     <div data-page="workspace-[id]">
       <section data-component="title-section">
       <section data-component="title-section">
-        <h1>Zen</h1>
+        <IconLogo />
         <p>
         <p>
           Curated list of models provided by opencode.{" "}
           Curated list of models provided by opencode.{" "}
           <a target="_blank" href="/docs/zen">
           <a target="_blank" href="/docs/zen">