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

@heudia/network-referral-form

v0.2.2

Published

Network Referral Form — HIPAA & GDPR compliant Lit web component for referring clients into the AccessMeCare network. First MFA referral form with built-in i18n (English + Spanish) and l10n.

Readme

@heudia/network-referral-form

Lit web component for the AccessMeCare Network Referral flow. Replaces the SurveyJS form on Insights' /network-referral route with a HIPAA-/GDPR-aware MFA bundle that ships English + Spanish out of the box, emits a structured submit event, and provides a service factory the host can use to persist to Firestore (or swap for a mock).

Install

pnpm add @heudia/network-referral-form
# If you plan to use FirestoreNetworkReferralService:
pnpm add firebase

firebase is an optional peer dependency — hosts that only use the in-memory mock service don't need to install it.

Mounting

import '@heudia/network-referral-form';
import { createNetworkReferralService } from '@heudia/network-referral-form';

const service = createNetworkReferralService({ firebaseConfig });

document.querySelector('heudia-network-referral-form')
  ?.addEventListener('submit', async (e) => {
    const { payload, locale } = (e as CustomEvent).detail;
    const record = await service.submit(payload, {
      orgUuid: receivingOrgUuid,
      locale,
    });
    console.log('persisted', record.id);
  });
<heudia-network-referral-form
  org-name="Well Life Outreach"
  locale="es"
></heudia-network-referral-form>

Attributes / properties

| Attribute / property | Type | Notes | | --- | --- | --- | | org-name | string | Pre-fills the "Receiving Organization" field; the user can still edit it. | | locale | 'en' \| 'es' | Active locale. Changing it at runtime flips every label, validation message, and choice. | | initialPayload (property only) | Partial<NetworkReferralPayload> | Seed for prefill / drafts. Must be set via JS, not an attribute. |

Events

| Event | Detail | When | | --- | --- | --- | | submit | { payload, locale, submittedAt } | Validation passes and the user clicks Submit. Bubbles + composed. | | nrf:change | { name, value } | Any field change. Useful for analytics / autosave. Bubbles + composed. |

Form shape (37 fields)

| Section | Fields | | --- | --- | | Client | first/middle/last name, DOB, legal-rep flag, email, phone, preferred contact methods (multi), org-ID-by-name flag | | Client address | street, ext, city, state, ZIP | | Representative (conditional on legal-rep = Yes) | first/middle/last name, DOB, email, phone, relationship, address-same-as-client flag, address fields (when distinct) | | Referral details | receiving org, services (multi), reasons (multi), notes | | Consent | provided flag, full name, opt-ins (multi), method, date, verification |

Required-ness, choices, and field order mirror docs/referral/forms/network-referral-form-model.json in the MFA repo.

i18n

Translations live in content/{en,es}.json and load via i18next. The element exposes them through an internal I18nController; every primitive auto-rerenders on languageChanged.

To add a third locale at the host level without forking:

import { getOrInitNetworkReferralI18n } from '@heudia/network-referral-form/i18n';
import fr from './my-fr-bundle.json';

const i18n = getOrInitNetworkReferralI18n();
i18n.addResourceBundle('fr', 'translation', fr);
// Then set `locale="fr"` on the element.

Services

INetworkReferralService is the persistence boundary, with two ready implementations and a factory that picks between them.

import {
  createNetworkReferralService,
  MockNetworkReferralService,
  FirestoreNetworkReferralService,
  type INetworkReferralService,
} from '@heudia/network-referral-form';

const dev: INetworkReferralService = createNetworkReferralService({ mockMode: true });
const prod = createNetworkReferralService({
  firebaseConfig,                       // any existing app instance is reused
  collectionName: 'network-referrals',  // optional override
});

| Implementation | Use case | | --- | --- | | MockNetworkReferralService | example app, Storybook, unit tests — keeps records in memory | | FirestoreNetworkReferralService | production — dynamic imports of firebase/app + firebase/firestore; reuses the host's existing app if one is initialized |

createNetworkReferralService falls back to the mock + logs a warning when neither mockMode nor firebaseConfig is supplied.

Demo

A working React demo is available in the MFA monorepo:

pnpm --filter heudia-react-example dev
# open the "Network Referral" tab

The demo shows the locale toggle, the sample-data prefill, and the round-trip from submit → service → persisted record.

Reference

  • docs/referral/forms/network-referral-form-requirements.md — top-level requirements
  • docs/referral/forms/network-referral-form-model.json — field schema (SurveyJS shape)
  • docs/referral/forms/network-referral-survey-answers.md — sample completed payload
  • docs/referral/forms/network-referral-form-implementation.md — package architecture + design decisions
  • docs/referral/forms/network-referral-form-insights-integration.md — Insights replacement guide