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

@deojeff/datepicker

v0.0.6

Published

`yarn add @deojeff/datepicker`

Downloads

10

Readme

Installation

yarn add @deojeff/datepicker

or

npm install @deojeff/datepicker

Preview

Preview

Usage

import { DatePicker } from '@deojeff/datepicker';
import '@deojeff/datepicker/dist/style.css';

const Component = () => {
  const [value, setValue] = useState(dayjs());

  return (
    <DatePicker
      date={value}
      onDateChange={(date) => {
        if (date) {
          setValue(date);
        }
      }}
    />
  )
}

Props

date | Dayjs

The current date value

options.disablePastDates | Boolean

Flag to disable past dates

options.disableFutureDates | Boolean

Flag to disable future dates

onDateChange | (date: Dayjs) => void

Callback that returns a function with the selected date as the param.

classess

Optional classes based on the given option structure

classes={{
  picker: {
    classes: {
      container: 'bg-red-500',
      year: {
        classes: {
          container: 'bg-red-600',
          buttons: {
            previous: 'bg-purple-500',
            label: 'border-[2px] bg-green-500',
            next: 'bg-blue-500',
          },
        },
        picker: {
          classes: {
            current: 'font-semibold text-green-500',
            selected: 'bg-green-500 font-light',
            label: 'py-[20px] h-[60px]'
          }
        }
      },
      divider: {
        classes: 'border-[2px] h-[20px] bg-purple-500 border-blue-500',
      },
      month: {
        classes: {
          container: 'bg-black p-[10px]',
          buttons: {
            previous: 'bg-yellow-500 text-blue-500',
            label: 'bg-gradient-to-r from-black to-white hover:bg-red-500',
            next: 'bg-yellow-700 disabled:bg-orange-900',
          },
        },
        picker: {
          classes: {
            disabled: 'disabled:bg-red-500',
            label: 'font-semibold hover:bg-red-500 text-green-500',
            selected: 'bg-blue-500'
          }
        }
      },
      day: {
        classes: {
          container: 'bg-green-900',
          days: {
            labels: {
              days: 'bg-gray-100 text-[14px] font-semibold',
              weekend: 'text-orange-500',
            },
            label: 'h-[40px] bg-green-200 hover:bg-red-500',
            weekend: 'bg-black disabled:bg-blue-100',
            disabled: 'bg-yellow-100',
            selected: 'bg-yellow-300',
            today: 'text-red-500 !bg-red-200',
            past: {
              label: 'bg-red-500',
              disabled: 'bg-red-100',
            },
            future: {
              label: 'bg-red-900',
              disabled: 'disabled:bg-blue-100',
            },
          },
        },
      },
    },
  },
}}