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

@abhay-dev/shift-operations-calendar

v1.0.0

Published

A React-based operations calendar for managing site schedules and shifts.

Readme

@abhay-dev/operations-calendar

A modern, responsive React-based operations calendar for managing site schedules and shifts.

Features

  • Weekly View: Navigate through weeks to view site-specific schedules.
  • Shift Status: Color-coded visualization for published and unpublished shifts.
  • Site Filtering: Easily filter shifts by site.
  • Interactive: Click handlers for shifts and empty date cells.
  • Responsive: Horizontal scrolling for small screens.
  • Customizable: Built with Tailwind CSS and Radix UI.

Installation

npm install @abhay-dev/operations-calendar

Make sure you have the following peer dependencies installed:

npm install react react-dom lucide-react

Usage

Here is an example of how to use the OperationsCalendar component in your React application:

import {
  OperationsCalendar,
  SiteSchedule,
} from "@ctrl-room/operations-calendar";

const sampleSites: SiteSchedule[] = [
  {
    siteId: "1",
    siteName: "Main Office",
    location: "New York, NY",
    schedules: {
      "2026-01-26": [
        {
          id: "s1",
          shiftCode: "MORNING",
          startTime: "08:00",
          endTime: "16:00",
          startDate: "2026-01-26",
          endDate: "2026-01-26",
          assignedCount: 5,
          requiredCount: 8,
          status: "published",
        },
      ],
    },
  },
];

function MyCalendar() {
  return (
    <OperationsCalendar
      sites={sampleSites}
      startDate={new Date()}
      onShiftClick={(shift, date, site) => console.log("Shift clicked:", shift)}
      onDateCellClick={(date, site) =>
        console.log("Cell clicked:", date, site.siteName)
      }
    />
  );
}

Tailwind CSS Integration

Since this library uses Tailwind CSS, ensure your tailwind.config.js includes the library's components to apply the styles correctly:

module.exports = {
  content: [
    // ... your project files
    "./node_modules/@ctrl-room/operations-calendar/dist/operations-calendar.js",
  ],
  // ...
};

Props

| Prop | Type | Description | | :---------------- | :--------------------------------------- | :--------------------------------------------------------------- | | sites | SiteSchedule[] | List of sites and their respective schedules. | | startDate | Date (optional) | The date to start the calendar's weekly view. Defaults to now. | | onSiteChange | (siteId: string) => void (optional) | Callback when the site filter changes. | | onShiftClick | (shift, date, site) => void (optional) | Callback when a shift badge is clicked. | | onDateCellClick | (date, site) => void (optional) | Callback when an empty date cell is clicked. |

Handling Interactions

The OperationsCalendar provides callback props to handle user interactions. This is ideal for opening modals, sidebars, or navigating to detailed shift pages.

Example: Opening a Modal on Shift Click

To open a modal when a user clicks a shift, you can manage the modal's visibility and the "active" shift in your component's state:

import { useState } from "react";
import { OperationsCalendar } from "@ctrl-room/operations-calendar";

function App() {
  const [isModalOpen, setIsModalOpen] = useState(false);
  const [selectedShift, setSelectedShift] = useState(null);

  const handleShiftClick = (shift, date, site) => {
    setSelectedShift({ shift, date, site });
    setIsModalOpen(true);
  };

  return (
    <>
      <OperationsCalendar sites={sites} onShiftClick={handleShiftClick} />

      {isModalOpen && (
        <div className="modal">
          <h3>Shift Details</h3>
          <p>Site: {selectedShift.site.siteName}</p>
          <p>Shift: {selectedShift.shift.shiftCode}</p>
          <button onClick={() => setIsModalOpen(false)}>Close</button>
        </div>
      )}
    </>
  );
}

Handling Multiple Actions (Example)

You can use the interaction callbacks to offer multiple choices, such as viewing vs editing:

const handleShiftClick = (shift, date, site) => {
  if (shift.status === "unpublished") {
    // Show 'Publish' or 'Edit' options
    openEditModal(shift);
  } else {
    // Show read-only details
    showShiftDetails(shift);
  }
};

Example: Creating a Shift on Empty Cell Click

Use onDateCellClick to let users add new shifts to the schedule:

const handleDateCellClick = (date, site) => {
  // Open a 'New Shift' form with pre-filled date and site
  setNewShiftDefaults({ date, siteId: site.siteId });
  setIsCreateModalOpen(true);
};

return (
  <OperationsCalendar
    onDateCellClick={handleDateCellClick}
    // ... other props
  />
);

License

MIT © Ctrl Room