# Palermo Suggestion

Short prompts the person can send in one click.

Build a Suggestion in this project that looks and behaves like Palermo's. Measured from the running Palermo app (palermo.tryprofound.com). 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: Partly measured from Palermo docs /docs/composer bottom surface suggestions, light and dark. Chips are label-only like Palermo's, so the leading icon is hidden. Hover and the wrapping wash are derived. No reference has been captured yet.

## Tokens

| Token | Light | Dark |
| --- | --- | --- |
| `--color-bg-primary` | `#fff` | `#171615` |
| `--color-bg-secondary` | `#fafafa` | `#1e1d1c` |
| `--text-primary` | `#18181a` | `#ecebe9` |
| `--text-secondary` | `#787878` | `#aaa8a5` |
| `--text-quaternary` | `#b4b4b4` | `#676563` |
| `--shadow-low` | `var(--surface-shadow-low), var(--shadow-border)` | `var(--surface-shadow-low), var(--shadow-border)` |
| `--shadow-low-focus` | `var(--surface-shadow-low), var(--shadow-border), var(--shadow-solid-border), var(--shadow-focus)` | `var(--surface-shadow-low), var(--shadow-border), var(--shadow-solid-border), var(--shadow-focus)` |
| `--font-regular` | `"Profound Inter", "Inter Variable", "Inter", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif` | `"Profound Inter", "Inter Variable", "Inter", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif` |
| `--font-size-mini` | `0.75rem` | `0.75rem` |
| `--line-height-mini` | `16px` | `16px` |
| `--font-weight-normal` | `400` | `400` |
| `--radius-8` | `8px` | `8px` |
| `--radius-composer` | `20px` | `20px` |
| `--ease-out` | `cubic-bezier(0, 0, 0.2, 1)` | `cubic-bezier(0, 0, 0.2, 1)` |
| `--default-transition-duration` | `150ms` | `150ms` |
| `--duration-press` | `300ms` | `300ms` |

## CSS

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

```css
[data-style="palermo"] {
  .ui-suggestion-list {
    box-sizing: border-box;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
    border-radius: var(--radius-composer);
    background-color: var(--color-bg-secondary);
  }

  .ui-suggestion {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    margin: 0;
    padding: 6px 10px;
    border: none;
    border-radius: var(--radius-8);
    background-color: var(--color-bg-primary);
    color: var(--text-secondary);
    font-family: var(--font-regular);
    font-size: var(--font-size-mini);
    font-weight: var(--font-weight-normal);
    line-height: var(--line-height-mini);
    white-space: nowrap;
    -webkit-font-smoothing: antialiased;
    cursor: pointer;
    outline: none;
    transition:
      color var(--default-transition-duration) var(--ease-out),
      box-shadow var(--default-transition-duration) var(--ease-out),
      scale var(--duration-press) var(--ease-out);

    @media (hover: hover) {
      &:hover {
        box-shadow: var(--shadow-low);
        color: var(--text-primary);
      }
    }

    &:active {
      scale: 0.97;
    }

    &:focus-visible {
      box-shadow: var(--shadow-low-focus);
      color: var(--text-primary);
    }

    &[data-disabled] {
      color: var(--text-quaternary);
      box-shadow: none;
      cursor: not-allowed;
    }
  }

  .ui-suggestion-icon {
    display: none;
  }
}
```

## Structure

How Replicas assembles it on Base UI.

```tsx
import { Button as BaseButton } from "@base-ui/react/button";
import type { ComponentProps, ReactNode } from "react";
import { join } from "./utils";

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

type ItemProps = Omit<BaseButton.Props, "className"> & { className?: string; icon?: ReactNode };

function Item({ className, icon, children, ...props }: ItemProps) {
  return (
    <BaseButton className={join("ui-suggestion", className)} {...props}>
      {icon ? (
        <span className="ui-suggestion-icon" aria-hidden>
          {icon}
        </span>
      ) : null}
      {children}
    </BaseButton>
  );
}

export const Suggestion = {
  List,
  Item,
};
```

## Example

```tsx
import { Suggestion } from "@replicas/ui";

const icon = (path: string) => (
  <svg viewBox="0 0 16 16" fill="none">
    <path d={path} stroke="currentColor" strokeWidth="1.25" strokeLinecap="round" strokeLinejoin="round" />
  </svg>
);

const suggestions = [
  { label: "Summarise this week's changes", icon: icon("M3 4h10M3 8h10M3 12h6") },
  { label: "Find slow queries", icon: icon("M7 12a5 5 0 1 0 0-10 5 5 0 0 0 0 10zM10.5 10.5L14 14") },
  { label: "Write release notes", icon: icon("M10.5 2.5l3 3L6 13H3v-3z") },
  { label: "Explain the auth flow", icon: icon("M4.5 7V5a3.5 3.5 0 0 1 7 0v2M3.5 7h9v6.5h-9z") },
  { label: "Draft a migration plan", icon: icon("M3 3.5h4v4H3zM9 8.5h4v4H9zM7 5.5h3.5V8.5") },
];

export default function SuggestionDemo() {
  return (
    <Suggestion.List style={{ width: "100%", maxWidth: 520 }}>
      {suggestions.map((suggestion) => (
        <Suggestion.Item key={suggestion.label} icon={suggestion.icon}>
          {suggestion.label}
        </Suggestion.Item>
      ))}
    </Suggestion.List>
  );
}
```

## Foundations

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