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

@sesionario/blocks

v1.33.0

Published

Shared UI components for Sesionario applications

Readme

@sesionario/blocks

Shared UI components for Sesionario applications.

This package is the Sesionario-specific successor to @algenium/blocks. It ships only the components, hooks, and data the five Sesionario apps (admin, app, auth, backoffice, pharma) actually use, plus shadcn Empty primitives under the hood of EmptyState.

Shared feedback patterns include ConfirmDestructiveDialog (confirm before delete/mute and similar irreversible actions).

Read-first editable sections (EditableSection, DataList, FieldMessage)

Settings and profile data should be readable by default, then turn into a real <form> when the person chooses Edit. The primitives are chrome-free — no Card, border, or title — so you place actions in your own layout (CardAction, page header, dialog, or a bare section).

import {
	EditableSection,
	DataList,
	DataListItem,
	FieldMessage,
} from "@sesionario/blocks";

<EditableSection
	labelledBy="fiscal-title"
	isDirty={dirty}
	onDiscard={() => reset()}
	onSave={async () => {
		/* throw on validation/API failure so edit mode stays open */
		await save();
	}}
	labels={{
		edit: t("edit"),
		save: t("save"),
		saving: t("saving"),
		cancel: t("cancel"),
		saved: t("saved"),
	}}
	readView={() => (
		<DataList>
			<DataListItem label="RFC">{rfc}</DataListItem>
		</DataList>
	)}
	editView={() => (
		<div className="flex flex-col gap-1.5">
			<label htmlFor="rfc">RFC</label>
			<input id="rfc" value={rfc} onChange={...} aria-invalid={!!error} aria-describedby="rfc-err" />
			<FieldMessage id="rfc-err">{error}</FieldMessage>
		</div>
	)}
>
	{({ actions, content, status }) => (
		<Card>
			<CardHeader>
				<CardTitle id="fiscal-title">Datos fiscales</CardTitle>
				<CardAction>{actions}</CardAction>
			</CardHeader>
			<CardContent>
				{content}
				{status}
			</CardContent>
		</Card>
	)}
</EditableSection>

Headless alternative: useEditableSection for card-less surfaces (dialogs, table rows, page headers).

Optional progressive-enhancement CSS for a smoother height change (Chromium 129+; no-op elsewhere). Honor reduced motion:

@supports (interpolate-size: allow-keywords) {
	.sesionario-editable-section-content {
		interpolate-size: allow-keywords;
		transition: min-height 200ms ease;
	}
}
@media (prefers-reduced-motion: reduce) {
	.sesionario-editable-section-content {
		transition: none;
	}
}

Pass stableHeight for small (1–2 field) sections if you want later toggles to keep a cached min-height.

Install

pnpm add @sesionario/blocks

The main entry is a Client Component boundary. Pure helpers that must run in React Server Components (e.g. avatar initials/colors) should be imported from the server-safe subpath:

import { avatarFallbackStyle, getInitials } from "@sesionario/blocks/avatar";

Peer dependencies (install in the consuming app as needed):

  • react, react-dom
  • lucide-react
  • next-themes (ThemeSwitcher)
  • framer-motion (Theme/Language switchers, AvatarEditorDialog)
  • react-phone-number-input (PhoneInput — also import its CSS in your app layout)
  • hls.js (optional — VideoPlayer)

Payment icons (PaymentIcon)

Vendored flat-rounded brand marks (Aaron Fagan’s svg-credit-card-payment-icons, Apache-2.0). Pass a Stripe card.brand code:

import { PaymentIcon, formatPaymentCardBrand } from "@sesionario/blocks";

<PaymentIcon brand="amex" />
<span>{formatPaymentCardBrand("amex")}</span> {/* American Express */}

Unknown or null brands render the Generic mark. Regenerate icons after updating the upstream SVGs:

pnpm payment-icons:generate

See NOTICE for artwork attribution.

Chat UI (MessageScroller, ChatMessageList, …)

Apps that render chat scrollers should define this utility in global CSS (used by MessageScrollerViewport):

.scroll-fade-b {
	mask-image: linear-gradient(
		to bottom,
		#000 0%,
		#000 calc(100% - 1.5rem),
		transparent 100%
	);
}

Development

pnpm install
pnpm build
pnpm typecheck
pnpm lint
pnpm test

Release

Pushes to main / dev / features/* run semantic-release and publish to npm via OIDC trusted publishing (see .github/workflows/release.yml). Configure the npm package for trusted publishing against the Docufacil/blocks GitHub repository before the first release.