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

@mfp-design-system/date-picker

v1.0.0

Published

Custom date picker web component for the mfp-design-system, built with Lit. Native form-association, popover calendar, full keyboard nav.

Readme

@mfp-design-system/date-picker

A custom date picker. Trigger button + calendar popover, no third-party library, full keyboard navigation, and form-association so it submits in <form> like any other input.

Install

npm install @mfp-design-system/date-picker @mfp-design-system/tokens

Usage

import '@mfp-design-system/date-picker';
import '@mfp-design-system/tokens/css';
<mfp-date-picker
    name="dob"
    label="Date of birth"
    value="1990-01-15"
    min="1900-01-01"
    max="2025-12-31"
    required
></mfp-date-picker>

The selected date submits with the form as a YYYY-MM-DD string under the name attribute. Listen for change events to react to selection:

document.querySelector('mfp-date-picker').addEventListener('change', (e) => {
    console.log(e.detail.value); // "2024-03-15"
});

API

| Attribute | Type | Default | Description | | ------------- | ------- | ----------------- | ---------------------------------------------------------------------- | | value | string | '' | Selected date as YYYY-MM-DD. Empty = no selection. | | name | string | '' | Submitted form name | | label | string | '' | Field label | | placeholder | string | 'Select a date' | Shown when value is empty | | hint | string | '' | Helper text below the trigger | | error | string | '' | Error message (red border, sets customError validity) | | min | string | '' | Earliest selectable date (YYYY-MM-DD). Earlier days render disabled. | | max | string | '' | Latest selectable date (YYYY-MM-DD). Later days render disabled. | | required | boolean | false | Sets valueMissing validity when empty | | disabled | boolean | false | Disables the trigger | | locale | string | browser default | BCP-47 locale for month / weekday / display formatting |

Methods

  • show() / hide() — open / close the calendar popover
  • checkValidity() / reportValidity() — native HTML validation forwarders

Events

  • change — fires on date selection. event.detail.value is the new ISO string.

Shadow parts

  • label, trigger, popup, hint, error

Keyboard navigation

When the popover is open:

| Key | Effect | | --------------------- | --------------------------------------------- | | / | Move focus one day (crosses month boundaries) | | / | Move focus one week | | PageUp / PageDown | Previous / next month | | Shift+PageUp/Down | Previous / next year | | Home / End | Start / end of the focused week | | Enter / Space | Select the focused date | | Escape | Close popover (focus returns to the trigger) |

A11y

  • Trigger has aria-haspopup="dialog" and aria-expanded that tracks open/close state.
  • Popover uses role="dialog" with a label of "Choose date".
  • Grid uses role="grid", cells use role="gridcell" with aria-selected.
  • Each day cell has an aria-label of the full localized date ("March 15, 2024") for screen readers.
  • A single day cell is in the tab order at a time (the focused one) — arrow keys move focus within the grid.
  • error becomes a custom validity message; consuming <form> validates correctly.

Theming

Reads from the standard semantic tokens — no date-picker-specific tokens. Override these to retheme:

  • --color-brand-primary / --color-brand-primary-fg — selected day background / text, today's outline
  • --color-background-default — popover background
  • --color-border-default — trigger and popover borders
  • --radius-control / --radius-surface — trigger / popover corners
  • --size-control-md — trigger height
  • --elevation-overlay — popover shadow
  • --focus-ring-* — focus state on month nav buttons

Framework notes

Same as the rest of the suite — Vue/Nuxt need isCustomElement, Angular needs CUSTOM_ELEMENTS_SCHEMA, React 19+ works natively.

Notes & caveats (v0.1)

  • Single-date only. Range selection is a future addition.
  • No time input — date only.
  • Week starts on Sunday regardless of locale. Intl doesn't expose week-start info; consistent Sun→Sat layout for now.
  • Popover anchors below-left of the trigger with no collision detection. If the trigger sits near the bottom of the viewport, the popover may clip. (A real positioning library — Floating UI — is a future addition.)