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

@open-kingdom/crm-frontend-feature-crm

v0.0.2-17

Published

The CRM frontend — a React Router route table plus six page components and a lead-conversion modal, all wired against the auto-generated RTK Query hooks in `shared-frontend-data-access-api-client`. A host application splices `crmRoutes` into its router an

Readme

@open-kingdom/crm-frontend-feature-crm

The CRM frontend — a React Router route table plus six page components and a lead-conversion modal, all wired against the auto-generated RTK Query hooks in shared-frontend-data-access-api-client. A host application splices crmRoutes into its router and renders crmNavEntries wherever it puts navigation; everything else (data fetching, state, theming) wires itself up.

This library is composed of presentational pages built on the shared ui-primitives, ui-datagrid, ui-stage-board, ui-record-detail, and ui-activity-timeline libraries — it owns no UI primitives of its own.


Exports

Routing

| Export | Type | Description | | --------------- | ------------------------ | ---------------------------------------------------------------------------------------------------------------------------- | | crmRoutes | RouteObject[] | React Router route tree rooted at /crm. Splice this into your application router as a child route. | | crmNavEntries | readonly CrmNavEntry[] | Declarative nav entries the host can render however it wants. Five entries: Dashboard, Contacts, Companies, Leads, Pipeline. | | CrmNavEntry | interface | { path: string; label: string }. |

Pages

| Export | Type | Mounted at | | --------------------------- | --------- | -------------------- | | CrmDashboardPage | component | /crm (index) | | ContactsListPage | component | /crm/contacts | | CompaniesListPage | component | /crm/companies | | LeadsListPage | component | /crm/leads | | LeadDetailPage | component | /crm/leads/:id | | OpportunitiesPipelinePage | component | /crm/opportunities |

Pages are exported individually so they can be reused outside the bundled route table (e.g. embedded in a custom layout).

Components

| Export | Type | Description | | ------------------ | --------- | ----------------------------------------------------------------------------------------------------------- | | ConvertLeadModal | component | Modal dialog for converting a lead. Wraps useLeadConversionControllerConvertMutation from the API client. |

ConvertLeadModalProps:

| Property | Type | Required | Description | | -------------- | ------------------------- | -------- | -------------------------------------------------------------- | | leadId | number | Yes | Lead to convert. | | defaultTitle | string | No | Initial value for the opportunity title input. | | open | boolean | Yes | Controlled-open state. | | onOpenChange | (open: boolean) => void | Yes | Controlled-open setter. | | onConverted | () => void | No | Fired after a successful conversion. Use to refetch list data. |


Route Tree

/crm                    CrmLayout (renders <Outlet/> + nav strip)
├── /                   CrmDashboardPage
├── /contacts           ContactsListPage
├── /companies          CompaniesListPage
├── /leads              LeadsListPage
├── /leads/:id          LeadDetailPage
└── /opportunities      OpportunitiesPipelinePage

CrmLayout is internal — it renders a thin nav strip across the top using crmNavEntries plus a React Router <Outlet />. Host apps that want their own chrome should consume the page components directly.


Wiring into a Host Application

Splice the routes into the app router

// apps/your-app/app/routes.tsx
import { crmRoutes } from '@open-kingdom/crm-frontend-feature-crm';

export const routes = [
  {
    path: '/',
    element: <RootLayout />,
    children: [{ index: true, element: <Dashboard /> }, { path: 'admin', element: <AdminPage /> }, ...crmRoutes],
  },
];

Render the nav entries

import { crmNavEntries } from '@open-kingdom/crm-frontend-feature-crm';
import { NavLink } from 'react-router';

export function AppNav() {
  return (
    <nav>
      {crmNavEntries.map((entry) => (
        <NavLink key={entry.path} to={entry.path}>
          {entry.label}
        </NavLink>
      ))}
    </nav>
  );
}

Required peer dependencies

The host application is expected to provide all of:

  • react, react-dom (^19.0.0)
  • react-router (^7.2.0)
  • react-redux (^9.2.0) — for the API client store middleware
  • @open-kingdom/shared-frontend-ui-theme — provides Tailwind palette and cn()
  • @open-kingdom/shared-frontend-ui-primitivesButton, Dialog, Tabs, etc.
  • @open-kingdom/shared-frontend-ui-datagrid — list pages render <DataGrid />
  • @open-kingdom/shared-frontend-ui-stage-board — pipeline page renders <StageBoard />
  • @open-kingdom/shared-frontend-ui-record-detail — lead-detail page renders <RecordDetail />
  • @open-kingdom/shared-frontend-ui-activity-timeline — lead-detail page renders <ActivityTimeline />
  • @open-kingdom/shared-frontend-data-access-api-client — supplies the RTK Query hooks
  • @open-kingdom/crm-poly-util-domain — domain types used in props

These are declared as peerDependencies in package.json. The host's Tailwind config must include this library's source files in its content glob so the palette classes used here are emitted.


API Client Hooks

This library calls the auto-generated RTK Query hooks from shared-frontend-data-access-api-client (regenerated from the backend OpenAPI spec via npm run client:generate-all). The relevant endpoint groups:

  • useContactsControllerFindAllQuery, useContactsControllerCreateMutation, …
  • useCompaniesControllerFindAllQuery, …
  • useLeadsControllerFindAllQuery, useLeadsControllerFindOneQuery, …
  • useOpportunitiesControllerFindAllQuery, useOpportunitiesControllerPipelineSummaryQuery, useOpportunitiesControllerCloseMutation, …
  • useActivityLogControllerFindAllQuery, useActivityLogControllerCreateMutation, …
  • useDashboardControllerSnapshotQuery
  • useLeadConversionControllerConvertMutation

If you regenerate the API client and the names drift, the pages will fail to compile — re-run npm run client:generate-all after every backend controller change.


Testing

nx test crm-frontend-feature-crm

The test suite currently covers the route table shape (routes.spec.ts).