npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@hollis-labs/kit-account

v0.3.0

Published

Controlled local-first profile, identity, API-token and connected-account surfaces; host-owned data and transport.

Readme

@hollis-labs/kit-account

Controlled account surfaces for a single-user, local-first app. Published on npm as @hollis-labs/kit-account; see CHANGELOG. This package owns presentation and user intent. The host owns identity, drafts, validation, loading, errors, transport and per-app persistence. It supplies no login, auth service, browser storage or manifest protocol.

CW-20261001-0511 / Tesseract kit_account_scope chose local-first, per-app profile/preferences and deferred login until OAuth 2.1. Current 0515 direction builds controlled components while PR14's manifest contract awaits approval. The future adapter belongs outside these components.

Styling and development

Use a workspace build or local packed candidate, paired with design-components 0.1.1 or later (its token-aware cn is required). Publishing is the owner's step. Tailwind CSS v4 is a required peer; a peer install does not configure its build.

@import "tailwindcss";
@import "@hollis-labs/design-tokens/design-tokens.css";
@import "@hollis-labs/design-components/source.css";
@import "@hollis-labs/kit-account/source.css";

The last two lines register shipped class strings for Tailwind's consumer build. Without source registration, an import can resolve while the surface is unstyled. Build sibling packages from the repo root first. Declarations reference package names, while typecheck maps siblings to source. All dependencies/peers stay external in the library bundle.

Profile, preferences and identity

import { AccountProfile, AccountPreferences, WhoamiBadge } from '@hollis-labs/kit-account'

<WhoamiBadge identity={{ state: 'identified', displayName: 'Local user',
  assurance: 'local', source: 'This app' }} />
<AccountProfile value={draft} onValueChange={setDraft} onSave={saveProfile}
  saving={saving} error={safeError} notice={saveNotice} />
<AccountPreferences onSave={savePreferences} saving={savingPreferences}>
  {hostRenderedControlledFields}
</AccountPreferences>

AccountProfileValue is { displayName, email }, both strings; email is optional in the UI and represented by an empty string. Edits report the new value without owning a draft. Save emits the current value without trimming or inventing success. Blank names, busy/read-only state and canSave={false} block save; native browser validation also applies. The host handles rejected async work, sets sanitized errors, and asserts success only after its operation completes.

AccountPreferences accepts host-rendered controlled fields, with no schema renderer duplicated here. A future kit-settings renderer can occupy this slot. Do not nest another form. Busy/read-only fieldsets disable native controls; custom widgets must also honor the host's disabled/read-only state. The host's onSave reads its own controlled preference values. Editable preferences belong in Settings; runtime diagnostics do not go into these forms.

WhoamiBadge takes a discriminated identity state: loading, unknown, error, or identified with local/verified assurance. Profile names do not verify identity. Only a host with a verified identity source supplies assurance: 'verified'. The badge makes no authentication, authorization or session-management decision. Use it in an app-shell slot; it has no login action.

Tokens and connected accounts

ApiTokenManager takes metadata-only tokens, host-advertised scopeOptions, a controlled { name, scopes } draft and create/revoke intent callbacks. Creation requires a nonblank name, at least one currently available scope and canCreate. Missing scopes remain blocked until the user explicitly clears unavailable ones; the kit never silently broadens or substitutes a scope. The host/backend enforces per-caller permissions; UI availability is not authorization.

Each record carries createdAt, optional expiresAt / lastUsedAt (ISO 8601) and a status from the closed set active | expiring | revoked | expired; the row's second line shows scopes, created and last-used (or "Never used"). Any other status renders as "Unknown" with no action, and its raw value is never shown. Only active and expiring records with canRevoke offer revocation; when canRevoke is false the Revoke button stays, disabled, with the record's revokeDeniedReason (or default text) beside it. revokeTargetId / onRevokeTargetChange control the confirmation dialog; onRevoke(id) fires only after confirmation. revoking and revokeError come from the host. A failed operation stays open and does not mark the token revoked. The list does not accept or render token values, prefixes or hashes.

Creation lives in a dialog controlled with createOpen / onCreateOpenChange. The draft is { name, scopes, expiry }; start from EMPTY_API_TOKEN_DRAFT (90 days). expiry is 30d | 90d | 1y | never; never is allowed but labelled discouraged. When canCreate is false the Create button is disabled and createDeniedReason explains why. The host turns expiry into an expiresAt; the kit sends no dates.

NewTokenDisclosure is a dialog separate from the list. Its value: string | null is only the transient create response, rendered as text, with no internal secret state, uncontrolled input, storage, URL, analytics or logging. It emits parameterless copy/dismiss intents. Copy is optional and explicit; the host owns clipboard errors and supplies copied only after success, which is announced politely (never the value). No token is automatically copied.

The host MUST clear value on dismissal, context changes and teardown, invalidate pending create responses from an old context, and never persist/re-query/replay the secret. Do not send it to browser storage, query caches, URLs, logs, audit values, errors or ordinary token records. A controlled view cannot stop a host from resupplying an old value; one-time delivery and disposal are host/provider duties. The backend owns approved secret storage. Errors/metadata shown in this kit must be sanitized. These rules follow PR14's secret guidance, without using its pending manifest wire model. The browser fixture uses synthetic credentials only.

ConnectedAccounts receives provider metadata and explicit canConnect / canDisconnect capabilities. It displays host status/account labels and emits provider IDs. Connecting/disconnecting states show pending feedback and no action; unknown statuses stay read-only. Errors do not imply a provider is connected. onDisconnect is an intent: the host confirms any grant revocation, owns provider transport/OAuth, refresh/cancellation and resulting status. No access/refresh token belongs in ConnectedAccount props. The fixture demonstrates host confirmation.

<NewTokenDisclosure value={issuedValue} onDismiss={() => setIssuedValue(null)}
  onCopy={copyIssuedValue} copied={copied} />
<ApiTokenManager tokens={tokenMetadata} scopeOptions={availableScopes}
  draft={tokenDraft} onDraftChange={setTokenDraft} onCreate={createToken}
  createOpen={createOpen} onCreateOpenChange={setCreateOpen}
  canCreate={canCreate} createDeniedReason={whyNot} creating={creating} error={safeCreateError}
  revokeTargetId={revokeTarget} onRevokeTargetChange={setRevokeTarget}
  onRevoke={revokeToken} revoking={revoking} revokeError={safeRevokeError} />
<ConnectedAccounts accounts={providerMetadata} onConnect={connectProvider}
  onDisconnect={requestHostConfirmation} loading={loading} error={safeProviderError} />

Callbacks report intent and do not await or infer outcomes. The host handles async rejections, serializes rapid mutations, sets busy state and reconciles results. Nothing here implements endpoints, a manifest schema, StaticProvider or OAuth.

Session states and step-up

SignInRequired (reason: signed-out | expired | denied) and SessionExpired say what happened and render the host's instruction; they assume no form, so a one-time link works as well as a login page. onRetry is optional. StepUpDialog takes the gateway's needs_confirmation fields (what, scope, ttlMs, who?) and reports onConfirm / onCancel (button, Esc, close); status is idle | granting | failed. The host maps the gateway snapshot to it, calls resolveConfirmation(id, 'confirm' | 'cancel'), and keeps the grant, which the kit never sees.

<SignInRequired reason="signed-out" instruction={<p>Open the link we emailed you.</p>} onRetry={recheck} />
<StepUpDialog open={confirmation !== null} {...confirmation?.confirm} status={granting ? 'granting' : 'idle'}
  onConfirm={() => gateway.resolveConfirmation(id, 'confirm')} onCancel={() => gateway.resolveConfirmation(id, 'cancel')} />

Verification

The behavior tests (see src/__tests__) cover controlled edits/save intents, busy/read-only/invalid gates, host errors/success and identity assurance states. Packed Vite/Tailwind browser checks at 1280/390px cover draft preservation after failure, successful host save, preferences, disabled busy fields, unchanged whoami after profile edits, zero horizontal overflow and the emitted 13px Input token at both widths. The profile fixture is demo/profile.tsx, with browser harness and committed receipts/screenshots.

The access fixture is demo/access.tsx, with browser harness (stale since 0.2.0, see audit). It checks controlled scopes, failure without disclosure, one-time create/copy/dismiss, metadata-only lists, zero browser storage entries, confirmation/cancel/failed revoke/retry, provider connect failure and retry, host-confirmed disconnect, context teardown and unknown-state safety. Long token/name values wrap at 390px; receipts omit credential values, and the committed screenshot contains no disclosed token. Unit checkbox tests shim jsdom's missing PointerEvent; browser checks exercise the actual Base UI/native path.

To reproduce, copy the fixture into an isolated React/Vite/Tailwind v4 consumer, mount AccountProfileFixture, install the candidate kit/base tarballs and import the four stylesheets above. Build outside scanned sources and serve on loopback. Run the browser harness with PLAYWRIGHT_MODULE pointing to that consumer's Playwright module, CHROMIUM_PATH to Chromium, and FIXTURE_URL to its server. Its optional first argument is an output receipt path; SCREENSHOT_PATH records the narrow screenshot. Use disk-backed TMPDIR/GOTMPDIR for all build/test work.

Local landing checks: build, typecheck, lint, test:run, node .github/scripts/design-rules-gate.mjs. CI's separate lint gate also enrolls kit-account. Both gate enrollments are maintainer-authorized one-line additions.

Boundaries

The two CW-20261001-0515 component groups cover profile/preferences/whoami and tokens/connected accounts. Manifest bindings, a shared profile service, authentication/login, OAuth connector backend, multi-user/grants and publishing remain outside this controlled UI package.