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

react-wired

v1.0.1

Published

react wired

Downloads

2

Readme

react-wired

because your compnents look a little more human if they were hand drawn!

like this

react-wired reimplements wired-js in pure React. This component library is in ACTIVE DEVELOPMENT and is seeking contribution help.

NPM JavaScript Style Guide

Known bugs:

  • the slider is known to be buggy. for some reason it becomes somwhat unresponsive after the initial interaction. have to figure out what is wrong.

Conversion TodoList

this list is from https://www.webcomponents.org/author/wiredjs - we need help on finishing off the rest. does not use react-polymer because i dont really know polymer

  • [x] checkbox
  • [x] button
  • [x] slider
  • [ ] menu-bar
  • [ ] menu-item
  • [ ] icon-button (not doing this for now because iron-icon)
  • [x] textarea
  • [x] input
  • [ ] listbox
  • [x] toggle
  • [x] radio
  • [ ] radio-group
  • [ ] combo
  • [ ] card
  • [ ] item
  • [x] progress
  • [x] spinner

Example Usage in your project

npm install --save react-wired

this code below generates the screenshot you saw above

import React, { Component } from "react";

import ExampleComponent, {
  WiredButton,
  WiredInput,
  WiredRadio,
  WiredToggle,
  WiredTextArea,
  WiredProgress,
  WiredSpinner,
  WiredCheckBox
} from "react-wired";

export default class App extends Component {
  state = {
    toggle: true,
    value: "",
    counter: 0
  };
  toggleState = () => this.setState({ toggle: !this.state.toggle, counter: this.state.counter + 1 });
  handleChange = e => this.setState({ value: e.target.value });
  render() {
    const { toggle, value, counter } = this.state;
    return (
      <div className="demoAppLayout">
        <ExampleComponent text="Wired.JS components in React" />
        <WiredButton text="hello" elevation={1} onClick={() => alert("hi")} />
        <WiredButton text="this toggles the states below" elevation={2} onClick={this.toggleState} />
        <WiredButton text="alerts 'hi' " elevation={3} disabled={toggle} onClick={() => alert("hi")} />
        <WiredInput placeholder="potato" disabled={toggle} onChange={e => console.log(e.target.value)} />
        <WiredRadio checked={toggle} onClick={this.toggleState} text="radio that works" />
        <WiredRadio checked={toggle} disabled onClick={this.toggleState} text="disabled radio " />
        <WiredToggle checked={toggle} onClick={this.toggleState} /> test
        <WiredToggle checked={toggle} disabled onClick={this.toggleState} /> test
        <WiredCheckBox checked={toggle} onClick={this.toggleState} text="text" />
        <WiredCheckBox checked={toggle} disabled onClick={this.toggleState} text="text" />
        <WiredSpinner active={toggle} />
        <WiredSpinner active={toggle} thickness={2} />
        <WiredTextArea placeholder="placeholder" value={value} onChange={this.handleChange} />
        <WiredTextArea placeholder="Enter text" rows="3" value={value} onChange={this.handleChange} />
        <WiredTextArea value={value} rows="2" disabled onChange={this.handleChange} />
        <WiredProgress max={50} min={0} progressLabel="%" value={counter} percentage />
        <WiredProgress max={100} min={0} progressLabel="potato" value={counter} />
      </div>
    );
  }
}

This exact code can be seen in this repo itself inside /example where there is a create-react-app instance that uses the local build of react-wired - see dev instructions

Instructions for local development of this library

for publishing to npm, not for immediate use in other projects

# run example to start developing your new component against
npm link # the link commands are important for local development
# npm install # first time only; also, disregard any warnings about missing peer dependencies
npm start # runs rollup with watch flag

# (in another tab, run the example create-react-app)
cd example
npm link react-wired
# npm install # first time only
npm start # runs create-react-app hot-reload dev server

License

MIT © sw-yx

scaffolded with the amazing create-react-library: https://hackernoon.com/publishing-baller-react-modules-2b039d84bce7

Other resources used

https://stackoverflow.com/questions/41970342/whats-the-difference-between-this-and-this-in-polymer