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

@office365rackspace/helix-ui-react

v1.0.2-alpha.0

Published

Helix UI React is an implementation of the Helix UI webcomponents library for React.

Downloads

68

Readme

forthebadge

Helix UI React

Helix UI React is an implementation of the Helix UI Webcomponents Library for React.

Who Uses Helix UI React

How It Works

  1. Helix UI React wraps Helix UI webcomponents and aims to keep an API that follows closely to the Helix UI documentation.
  2. Internally, Helix UI React uses TypeScript which allows us to get the benefits of IntelliSense, as well as the ability to further reason about our code.

Usage

  1. Configure Helix UI Webcomponents: There is a guide for Getting Started. However, there's some level of work that is ambigious.

After installing helix-ui and @webcomponents/webcomponentsjs, you will need to manually add the appropriate css file and scripts to the HTML file where your React component is hosted.

Since this is not yet avaible to be done using Webpack, the files must be copied out of node_modules and moved to a public folder (where your HTML lives).

To do this, you can use vendor-copy.

You can add the configuration in the package.json file, specifying the files you want to move out of node_modules and into a public folder. Here's what our configuration looks like:

"vendorCopy": [
  {
    "from": "node_modules/@webcomponents/webcomponentsjs/custom-elements-es5-adapter.js",
    "to": "vendor/custom-elements-es5-adapter.js"
  },
  {
    "from": "node_modules/@webcomponents/webcomponentsjs/webcomponents-loader.js",
    "to": "vendor/webcomponents-loader.js"
  },
  {
    "from": "node_modules/helix-ui/dist/styles/helix-ui.min.css",
    "to": "vendor/helix-ui.min.css"
  },
  {
    "from": "node_modules/helix-ui/dist/scripts/helix-ui.browser.min.js",
    "to": "vendor/helix-ui.browser.min.js"
  }
]

You will likely just have to change the tos of this configuration to fit your needs. For example, if the folder serving your application (again, where the folder where your HTML file that hosts the React application is living) is called public, it would look vendor/ would become public/vendor/... for every to.

The actually copying of these files can occur in the postinstall npm script also in your package.json:

"postinstall": "vendor-copy"

In theory, these files need to be copied only when the @webcomponents/webcomponentsjs and helix-ui packages are updated (respectively). However, this script will always copy the files over after a fresh npm install (don't worry it doesn't take long).

Then, you would update the head of the HTML with the following (we included comments for clarification):

<!-- DO NOT BUNDLE: HelixUI Styles -->
<link rel="stylesheet" href="/vendor/helix-ui.min.css" />
<!-- DO NOT COMPILE: Converts ES5 custom element constructor functions to ES6 classes -->
<script src="/vendor/custom-elements-es5-adapter.js"></script>
<!-- DO NOT COMPILE: Appends polyfills to <head> if needed by user's browser. -->
<script src="/vendor/webcomponents-loader.js"></script>

Finally, you have to add the helix-ui.min.js script to the body:

<!--
    DO NOT BUNDLE: ES5-compiled assets specifically for use in the browser.
    Provides additional polyfills and automatically initializes HelixUI.
-->
<script src="/vendor/helix-ui.browser.min.js"></script>

You should now be set to use webcomponents and the Helix UI webcomponents in your application directly. If you are using TypeScript (as we are internally), you need to declare each webcomponent as we have done here.

  1. Install this package:
npm i @office365rackspace/helix-ui-react
  1. Use any of our components:
import { Alert } from '@office365rackspace/helix-ui-react';

<Alert cta="call to action" onSubmit={() => alert('submitted')} type={type}>
  Some Alert Message
</Alert>

We do not have documentation for the API of our components at the moment, but you can see the interfaces in our source code:

export interface IAlertProps {
  children: React.ReactNode;
  cta: string;
  onSubmit: () => void;
  type: 'info' | 'warning' | 'error' | 'success';
}

See all components

Contributing

  1. Install yarn
npm i -g yarn
  1. Install packages
yarn install
  1. Run Storybook

Storybook is an open source tool for developing UI components in isolation for React, Vue, and Angular. In a word, it allows us to easily have a running site to demo all of our components in all other there various states.

To run story, execute the following:

npm run story

The script should automatically open Storybook in your browser, but you can always navigate to http://localhost:9001/?path=/story

  1. Enable TSLint plugin for your editor of choice

  2. Develop a component

  3. Create a story (demo) for that component in a index.story.jsx file adjacent to the index.tsx under the directory of your component (i.e. alert)

  4. Put together a PR for that component and request one of the contributers below to review

Contributers

Mike Mangialardi ~ [email protected]

Elena Jdanova ~ [email protected]

Somit Kumar ~ [email protected]