Skip to content

About OnlyJah

OnlyJah UI

@onlyjah/ui

The components, blocks and layouts OnlyJah sites are built from. Base UI → shadcn components → oj-blocks → oj-layouts → oj-features → oj-sites.

It is React source (TypeScript), compiled by each site’s own Vite build. React is a peer, so a site runs one React. Nothing in it imports a site, a provider or the SDK: blocks take what they show as props, so any site feeds them from its own calls.

What’s in it

Components @onlyjah/ui/ui/*

  • alert
  • avatar
  • badge
  • breadcrumb
  • button
  • card
  • checkbox
  • dialog
  • empty
  • input
  • label
  • menu
  • native-select
  • separator
  • sheet
  • skeleton
  • table
  • tabs
  • textarea

Blocks @onlyjah/ui/blocks/*

  • account-menu
  • ark-overview
  • attachment-tray
  • chat-thread
  • empty-state
  • entry-list
  • hero
  • icon-tile
  • image-card
  • image-strip
  • item-editor
  • link-card
  • link-footer
  • link
  • markdown-editor
  • module-section
  • navigation-bar
  • onlyjah-sign-in
  • page-header
  • poster-card
  • prose
  • quote-card
  • relative-time
  • section-heading
  • site-footer
  • site-header
  • status-light
  • theme-toggle

Layouts @onlyjah/ui/layouts/*

  • page-layout
  • site-layout
  • editorial-layout
  • workspace-layout

Styles at @onlyjah/ui/styles/base.css; themes for OnlyJah and JahKnows at @onlyjah/ui/themes/*.

Using it on a member’s site

A site takes a hash-checked snapshot into vendor/oj-ui (jahnoah.com does). It isn’t on a package registry yet.

From onlyjah-com/packages/ui
node scripts/export.mjs /absolute/path/to/your-site
# writes vendor/oj-ui with a SHA-256 for every file
Your site
"dependencies": { "@onlyjah/ui": "file:vendor/oj-ui" }

/* Tailwind: scan the package source too */
@source "../../node_modules/@onlyjah/ui/src";

Filled by your own calls

The blocks show; the SDK and the API say what. The person’s session (or their token) decides what each call may see.

A market conversation (on test) in the chat-thread block
import { MessageList } from '@onlyjah/ui/blocks/chat-thread'

const { messages, thread } = await fetch(`/api/auth/market/thread?id=${id}`,
  { credentials: 'include' }).then((r) => r.json())
const other = thread.role === 'selling' ? thread.buyer : thread.seller

<MessageList tall messages={messages.map((m) => ({
  id: m.id,
  at: m.at,
  author: { name: m.mine ? 'You' : other.name, image: m.mine ? null : other.image },
  body: m.text,
}))} />

Without a session, the call answers 401; show sign-in (the onlyjah-sign-in block) and try again.