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 🙏

© 2024 – Pkg Stats / Ryan Hefner

upn-calendar

v1.0.4

Published

A simple calendar component for React

Downloads

9

Readme

Calendar Component Library - upn-calendar

This document provides a style guide for the Calendar component, including its usage, props, and styling conventions.

Component Usage

Props

  • events: IEvent[] - An array of event objects to be displayed in the calendar.

Event Object

  • name (string) - The name of the event.
  • title (string) - The title of the event.
  • startTime (string) - The start time of the event in "hh:mm a" format.
  • endTime (string) - The end time of the event in "hh:mm a" format.
  • date (string) - The date of the event in "yyyy-MM-dd" format.
  • bgColor (string) - (Optional) The background color of the event card.
  • borderColor (string) - (Optional) The border color of the event card.
  • iconClick (function) - (Optional) Function to handle icon click event.

Styles

CSS Modules

  • Styles are applied using CSS modules, ensuring scoped and conflict-free styling.

Main Classes

  • .upn-calendar - Main container for the calendar.
  • .upn-calendar--filters-btns - Container for the filter buttons.
  • .upn-calendar--date-filter - Container for the date navigation and filter button.
  • .upn-calendar--dateNavigation - Container for the date navigation buttons and display.
  • .upn-calendar--currentView - Container for the current view (list, week, day).

Conditional Rendering

The component conditionally renders different views based on the currentView state:

  • ListView
  • WeekView
  • DayView

Example Usage

import React from 'react';
import Calendar from './components/Calendar/Calendar';
import { IEvent } from './types/CalendarTypes';

const events: IEvent[] = [
 {
   name: 'Client 1',
   title: 'Meeting with Bob',
   startTime: '12:00 AM',
   endTime: '1:00 AM',
   date: '2024-07-07',
   bgColor: '#FFF9E9',
   borderColor: '#FFA900',
   iconClick: () => {
     console.log('Clicked');
   },
 },
 {
   name: 'Client 2',
   title: 'Project Presentation',
   startTime: '1:00 AM',
   endTime: '2:00 AM',
   date: '2024-07-08',
   bgColor: '#F2F1FF',
   borderColor: '#796EFF',
   iconClick: () => {
     console.log('Clicked');
   },
 },
 {
   name: 'Client 3',
   title: 'Lunch Break',
   startTime: '01:00 AM',
   endTime: '01:30 AM',
   date: '2024-07-11',
   bgColor: '#FFEEEF',
   borderColor: '#FF5263',
   iconClick: () => {
     console.log('Clicked');
   },
 },
 {
   name: 'Client 4',
   title: 'Team Standup',
   startTime: '02:00 AM',
   endTime: '02:30 AM',
   date: '2024-07-12',
   bgColor: '#E9F6FE',
   borderColor: '#23A9F9',
   iconClick: () => {
     console.log('Clicked');
   },
 },
];

const App = () => {
  return <Calendar events={events} />;
};

export default App;