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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@osvalda/smart-time-input

v1.0.4

Published

React 24h time input component

Downloads

28

Readme

NPM Version GitHub package.json dev/peer/optional dependency version GitHub package.json dev/peer/optional dependency version Node.js CI Endpoint Badge Endpoint Badge

Smart Time Input React Component

demo_gif

This React input component is designed specifically to manage time in a 24-hour format, enhancing the user experience through automated features that simplify time entry.

  • Auto Extension and Recognition: The component automatically extends partial time entries by appending or prefixing zeroes where necessary.
  • Colon Placement: It intelligently inserts the colon (:) in the correct position.
  • Validation: The component ensures that only valid time values are accepted, maintaining data integrity.

Try out the demo app

Install

npm install @osvalda/smart-time-input --save

Usage

Use in jsx

import { SmartTimeInput } from '@osvalda/smart-time-input';

//...

return (
    <SmartTimeInput
        initTime={props.init}
        placeholder={props.helpText}
        className='input-fields m2'
        id='time-input'
    />
);

Smart Time Input Props

|Name |Type |Requires|Description | |------------------|----------|--------|------------------------------------------| |initTime |string |no |The initial time value the input will hold| |className |string |no |Input fields class names | |divClassName |string |no |The wrapper div's class names | |onFocusHandler |FocusEvent|no |Custom focus handler for the input field | |onTimeChange |FocusEvent|no |Custom handler when the time has changed | |onBlurHandlerSuper|FocusEvent|no |Custom handler for blur |

Styling and children

The input and optional children components are wrapped aroound a div with own styleing options via classNames. The input filed can hold icons or interactive elements to enhance its visual appearing.

Radix ui example:

radix_example

import { SmartTimeInput } from '@osvalda/smart-time-input';

import { CalendarIcon } from '@heroicons/react/24/outline';
import { TextField } from "@radix-ui/themes";

//...

return (
     <SmartTimeInput
        className='rt-reset rt-TextFieldInput'
        divClassName='rt-TextFieldRoot rt-r-size-2 rt-variant-surface'>
        <TextField.Slot>
            <CalendarIcon height="16" width="16" />
        </TextField.Slot>
    </SmartTimeInput>
);

Test

The project uses Jest as test framework with coverage measurement. Currently unit and component level tests are available.

To run all automated test use the following command:

npm test