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-talend-components

v0.111.0

Published

Set of react widgets.

Downloads

390

Readme

react-talend-components

A set of stateless components which follows the Talend Guidelines

NPM

Travis CI Quality dependencies devdependencies peerdependencies Codacy Badge

Conventions

Please look at our CONTRIBUTING first.

Please read our style guidelines first.

Supported browsers

Thanks to BrowserStack for providing real browser testing infrastructure.

How to create a new component

All components are created using the yeoman talend generator using stateless option.

yo talend:react-component
> (nature) stateless
> (tests) snapshot

No {children} for leaf

We want to avoid {children} as much as possible. We believe an app should only pass arguments to stateless components.

So please don't do Pull Requests (PR) to add {children} on leaf components.

But what is a leaf component ? It's a component that is not supposed to contain another component. For example the following components are leaf components:

  • AppHeaderBar
  • SidePanel
  • List
  • Breadcrumb
  • Icon
  • Action(s)

But the following are not leaf:

  • Layout

If you feel the need to add {children} this means we have forget a use case. In this case please expose your use case and try to see how it could be done by passing some props.

onClick / onEvent

The API we have for all components is the following for an event handler

const onClick(event, payload) {
	//do what ever you want
}
return <APureComponents onClick={onClick} />

Write tests + docs

Our tests are using the react-test-renderer aka snapshot testing. This is by far the best tool to test pure components.

For the documentation and developpement environnement we are using React StoryBook.

    npm start

No anchor

If you want to create a link please use Action component which accept a link prop.

Anchor need href. We are in a single page application, so JavaScript decides the behavior, not the browser. So we don't want to see any anchor link in the markup.

If you want to use Button from react-bootstrap don't forget to add the role + bsStyle="link".

const model = {id: ...};
const onClick(event, payload) {
	//do what ever you want
	payload.action.label === 'click me';
	payload.model === model;
};
<Action
	label="click me"
	icon="svg-yeah"
	onClick={onClick}
	model={model}
	/>

Use Icon for icon

We all are used to <i className="fa fa-XX" /> but this is finished now. We are using <Icon name="fa-xx" /> because with this one we are able to support svg icons which is on the way to be our next gen icons sets.

If you want you can register an new Icon this way:

Icon.register('svg-test', (<svg viewBox="0 0 20 20"><path d="M10.219,1.688c-4.471,0-8.094,3.623-8.094,8.094s3.623,8.094,8.094,8.094s8.094-3.623,8.094-8.094S14.689,1.688,10.219,1.688 M10.219,17.022c-3.994,0-7.242-3.247-7.242-7.241c0-3.994,3.248-7.242,7.242-7.242c3.994,0,7.241,3.248,7.241,7.242C17.46,13.775,14.213,17.022,10.219,17.022 M15.099,7.03c-0.167-0.167-0.438-0.167-0.604,0.002L9.062,12.48l-2.269-2.277c-0.166-0.167-0.437-0.167-0.603,0c-0.166,0.166-0.168,0.437-0.002,0.603l2.573,2.578c0.079,0.08,0.188,0.125,0.3,0.125s0.222-0.045,0.303-0.125l5.736-5.751C15.268,7.466,15.265,7.196,15.099,7.03" /></svg>));

Add component into screenshot CI

open screenshots.config.json file.

The top of the file should stay unchanged. The stories are registred this way:

    "Action": {
      "default": [
        {
          "name": "action-default",
          "selector": ["#default", "#hidelabel"]
        }
      ]
    },
  • Action is the string name of 'storiesOf(' call
  • default is the exact string of the .add / .addWithInfo call
  • the content is an array of Object with name + selector
  • name will be the name of the screenshot(s)
  • selector is a string or an array of string which is behind used to call document.querySelect(selector) so you can try your selector.

npm scripts

  • npm start -> launch storybook on localhost:6006
  • npm run prepublish -> build the sources into the lib folder
  • npm test -> to execute unit test
  • npm run lint -> check the code style
  • npm run watch -> watch the source to trigger a build

LICENSE

Copyright (c) 2006-2016 Talend

Licensed under the Apache V2 License