# Lens Connector

An app or MCP server the agent can connect to, with its status.

Build a Connector in this project that looks and behaves like Lens's. Measured from the running Lens app (developer.lens.xyz). Keep every value exact. Map the tokens onto the project's own theme variables instead of hard-coding them. Use the project's own component library for behaviour, or Base UI primitives if it has none.

Fidelity: Concept, not a real feature. Designed from the apps table rows, the dashboard app tiles and the green ghost badge. The dark theme is derived.

## Tokens

| Token | Light | Dark |
| --- | --- | --- |
| `--lens-blackberry-black` | `#2c2d30` | `#ececed` |
| `--lens-white` | `#fff` | `#1c1d1f` |
| `--lens-text-primary` | `#2c2d30` | `#ececed` |
| `--lens-text-secondary` | `#2c2d3099` | `#ececed9e` |
| `--lens-background-quaternary` | `#f4f4f4` | `#2a2b2e` |
| `--lens-background-quinary` | `#f2f2f2` | `#2e2f32` |
| `--lens-stroke` | `#2c2d300d` | `#ececed14` |
| `--lens-green-ghost` | `color(display-p3 0.1734 0.7612 0.338)` | `color(display-p3 0.1734 0.7612 0.338)` |
| `--lens-green-ghost-bg` | `color(display-p3 0.1725 0.7608 0.3373 / 0.1)` | `color(display-p3 0.1725 0.7608 0.3373 / 0.1)` |
| `--lens-tracking-13` | `-0.00315856em` | `-0.00315856em` |
| `--lens-tracking-14` | `-0.00622354em` | `-0.00622354em` |
| `--font-regular` | `"Lens Inter", "Lens Inter Fallback", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif` | `"Lens Inter", "Lens Inter Fallback", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif` |

## CSS

Scoped under `[data-style="lens"]`; dark rules sit under `[data-theme="dark"]`. The `ui-*` classes and data attributes match the structure below.

```css
[data-style="lens"] {
  .ui-connector-list {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--lens-stroke);
    border-radius: 10px;
    background: var(--lens-white);
    font-family: var(--font-regular);
  }

  .ui-connector {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 64px;
    padding: 12px 16px;
    color: var(--lens-text-primary);
    font-size: 14px;
    line-height: 21px;
    letter-spacing: var(--lens-tracking-14);

    &:not(:last-child) {
      box-shadow: inset 0 -1px var(--lens-background-quinary);
    }
  }

  .ui-connector-icon {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--lens-background-quaternary);
    box-shadow: inset 0 0 0 1px var(--lens-stroke);
    color: var(--lens-text-primary);
    font-size: 14px;
    font-weight: 600;
    line-height: 1;

    & svg,
    & img {
      width: 18px;
      height: 18px;
    }

    [data-connected] > & {
      background: var(--lens-blackberry-black);
      box-shadow: none;
      color: var(--lens-white);
    }
  }

  .ui-connector-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
  }

  .ui-connector-title {
    overflow: hidden;
    color: var(--lens-text-primary);
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .ui-connector-description {
    overflow: hidden;
    color: var(--lens-text-secondary);
    font-size: 13px;
    line-height: 20px;
    letter-spacing: var(--lens-tracking-13);
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .ui-connector-actions {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 8px;
  }

  .ui-connector-status {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 20px;
    padding: 0 8px;
    border-radius: 10px;
    background: var(--lens-green-ghost-bg);
    color: var(--lens-green-ghost);
    font-size: 12px;
    font-weight: 500;
    line-height: 18px;
    white-space: nowrap;

    &::before {
      content: "";
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background: currentColor;
    }
  }
}
```

## Structure

How Replicas assembles it on Base UI.

```tsx
import type { ComponentProps } from "react";
import { join } from "./utils";

function List({ className, ...props }: ComponentProps<"div">) {
  return <div className={join("ui-connector-list", className)} {...props} />;
}

type RootProps = ComponentProps<"div"> & { connected?: boolean };

function Root({ className, connected = false, ...props }: RootProps) {
  return <div className={join("ui-connector", className)} data-connected={connected || undefined} {...props} />;
}

const part = (name: string) =>
  function Part({ className, ...props }: ComponentProps<"span">) {
    return <span className={join(`ui-connector-${name}`, className)} {...props} />;
  };

function Actions({ className, ...props }: ComponentProps<"div">) {
  return <div className={join("ui-connector-actions", className)} {...props} />;
}

export const Connector = {
  List,
  Root,
  Icon: part("icon"),
  Content: part("content"),
  Title: part("title"),
  Description: part("description"),
  Status: part("status"),
  Actions,
};
```

## Example

```tsx
import { Button, Connector } from "@replicas/ui";
import { useState } from "react";

const apps = [
  { name: "GitHub", description: "Read issues, pull requests and code.", initial: "G" },
  { name: "Linear", description: "Find and update issues and projects.", initial: "L" },
  { name: "Google Drive", description: "Search docs, sheets and slides.", initial: "D" },
];

export default function ConnectorDemo() {
  const [connected, setConnected] = useState(["GitHub"]);
  return (
    <Connector.List style={{ width: "100%", maxWidth: 520 }}>
      {apps.map((app) => {
        const on = connected.includes(app.name);
        return (
          <Connector.Root key={app.name} connected={on}>
            <Connector.Icon aria-hidden>{app.initial}</Connector.Icon>
            <Connector.Content>
              <Connector.Title>{app.name}</Connector.Title>
              <Connector.Description>{app.description}</Connector.Description>
            </Connector.Content>
            <Connector.Actions>
              {on ? <Connector.Status>Connected</Connector.Status> : null}
              <Button
                variant={on ? "ghost" : "primary"}
                size="small"
                onClick={() => setConnected(on ? connected.filter((name) => name !== app.name) : [...connected, app.name])}
              >
                {on ? "Disconnect" : "Connect"}
              </Button>
            </Connector.Actions>
          </Connector.Root>
        );
      })}
    </Connector.List>
  );
}
```

## Foundations

The rest of the Lens style, as a skill: https://replicas.raphaelsalaja.com/skills/lens/SKILL.md