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

@voyantjs/availability-react

v0.116.3

Published

The availability client tier: headless data hooks/clients plus the styled UI primitives and page-level compositions (formerly `@voyantjs/availability-ui`).

Readme

@voyantjs/availability-react

The availability client tier: headless data hooks/clients plus the styled UI primitives and page-level compositions (formerly @voyantjs/availability-ui).

Headless consumers (storefronts, portals) import from the root, ./hooks, ./client, or ./query-keys — these pull no styling peers. Styled surfaces live under ./ui, ./components/*, ./admin, ./i18n, ./utils, and ./styles.css, whose heavier peers (@voyantjs/ui, @voyantjs/admin, @tanstack/react-table, sonner, lucide-react) are optional and only needed when you import those subpaths.

Install

pnpm add @voyantjs/availability-react @voyantjs/availability @tanstack/react-query react react-dom zod

Usage

import { VoyantAvailabilityProvider, useSlots } from "@voyantjs/availability-react"

function App() {
  return (
    <VoyantAvailabilityProvider baseUrl="/api">
      <SlotsList />
    </VoyantAvailabilityProvider>
  )
}

function SlotsList() {
  const { data } = useSlots()
  return <>{data?.data.map((slot) => <div key={slot.id}>{slot.dateLocal}</div>)}</>
}

UI components

Reusable availability UI primitives and page compositions for Voyant operator/admin apps.

Exports

| Entry | Description | | --- | --- | | ./ui | Barrel re-exports | | ./i18n | Availability UI message provider, defaults, and helpers | | ./components/* | Availability UI components | | ./utils | Small formatting helpers |

Surface

The package exports reusable pieces that keep app-owned routing and the availability batch mutations injected through props:

  • AvailabilityPage
  • AvailabilityRuleDetailPage, AvailabilitySlotDetailPage, AvailabilityStartTimeDetailPage
  • AvailabilityOverview
  • AvailabilitySlotsTab, AvailabilityRulesTab, AvailabilityStartTimesTab
  • AvailabilityCloseoutsTab, AvailabilityPickupPointsTab
  • AvailabilityRuleDialog, AvailabilityStartTimeDialog, AvailabilitySlotDialog
  • AvailabilityCloseoutDialog, AvailabilityPickupPointDialog
  • AvailabilityPageSkeleton, AvailabilityBodySkeleton, detail skeletons
  • availability*Columns table column builders
  • AvailabilitySectionHeader
  • AvailabilityUiMessagesProvider and i18n helpers from ./i18n
  • formatLocalizedSelectionLabel

Usage

AvailabilityPage owns the common operator availability shell, data hooks, filters, overview metrics, table tabs, calendar tab, and rule/slot/start-time dialogs. Route navigation and batch mutations stay app-specific:

import { AvailabilityPage } from "@voyantjs/availability-react/ui"

<AvailabilityPage
  onSlotOpen={(id) => navigate({ to: "/availability/$id", params: { id } })}
  onRuleOpen={(id) => navigate({ to: "/availability/rules/$id", params: { id } })}
  onStartTimeOpen={(id) =>
    navigate({ to: "/availability/start-times/$id", params: { id } })
  }
  onProductOpen={(id) => navigate({ to: "/products/$id", params: { id } })}
  onBulkUpdate={handleAvailabilityBulkUpdate}
  onBulkDelete={handleAvailabilityBulkDelete}
/>

Closeout and pickup-point mutations are not owned by the headless tier yet. Pass onCloseoutSubmit and onPickupPointSubmit to use the package dialogs, or use the slots.dialogs escape hatch to render app-owned dialogs.

Detail pages expose query/loader helpers that accept the app's API client:

import { defaultFetcher } from "@voyantjs/availability-react"
import {
  AvailabilitySlotDetailPage,
  loadAvailabilitySlotDetailPage,
} from "@voyantjs/availability-react/ui"

const client = { baseUrl: getApiUrl(), fetcher: defaultFetcher }

export const Route = createFileRoute("/_workspace/availability/$id")({
  loader: ({ context, params }) =>
    loadAvailabilitySlotDetailPage(context.queryClient, client, params.id),
  component: () => {
    const { id } = Route.useParams()
    return (
      <AvailabilitySlotDetailPage
        id={id}
        onBack={() => navigate({ to: "/availability" })}
        onOpenProduct={(productId) =>
          navigate({ to: "/products/$id", params: { id: productId } })
        }
        onOpenStartTime={(startTimeId) =>
          navigate({ to: "/availability/start-times/$id", params: { id: startTimeId } })
        }
      />
    )
  },
})

Wrap consumers in AvailabilityUiMessagesProvider for package-level copy and locale-aware formatting. Without a provider the package falls back to English.

import { AvailabilityUiMessagesProvider } from "@voyantjs/availability-react/i18n"

<AvailabilityUiMessagesProvider locale={resolvedLocale}>
  <AvailabilityPage onBulkUpdate={handleBulkUpdate} onBulkDelete={handleBulkDelete} />
</AvailabilityUiMessagesProvider>

Leaf components remain available for custom page shells:

import { AvailabilitySectionHeader } from "@voyantjs/availability-react/ui"

function SlotsHeader() {
  return (
    <AvailabilitySectionHeader
      title="Slots"
      description="Manage generated capacity."
      actionLabel="Create slot"
      onAction={() => setOpen(true)}
    />
  )
}

Table column builders are available for apps that use @voyantjs/ui's DataTable and keep routing behavior app-owned:

import { availabilitySlotColumns } from "@voyantjs/availability-react/ui"

<DataTable
  columns={availabilitySlotColumns(products, openSlotRoute, messages.availability)}
  data={slots}
/>

Dialogs expose the reusable form UI and validation while the app decides how to persist the payload:

import { AvailabilitySlotDialog } from "@voyantjs/availability-react/ui"

<AvailabilitySlotDialog
  messages={messages.availability}
  open={open}
  onOpenChange={setOpen}
  products={products}
  rules={rules}
  startTimes={startTimes}
  onSubmit={(payload, context) =>
    context.isEditing
      ? api.patch(`/v1/availability/slots/${context.id}`, payload)
      : api.post("/v1/availability/slots", payload)
  }
  onSuccess={refresh}
/>

License

Apache-2.0