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

state-template

v0.4.47

Published

[![npm version](https://img.shields.io/npm/v/state-template.svg?style=flat)](https://www.npmjs.com/package/state-template)

Downloads

323

Readme

npm version

state-template

CA State Template (v5.0.10) styled react components.

Usage

Installation

Use npm install --save state-template to install this library as a npm package.

Components can then be imported using es6 syntax, such as

import { ButtonRow, Button } from 'state-template';

Project Setup

To get started using this package clone the state-template-starter:

git clone https://calenterprise.visualstudio.com/CDT.SWEIS%20%28SoftWare%20Engineer%20Innovation%20Services%29/_git/UI-React-Framework

Styling

This project does not include the state template styling by default, it can be added by adding the following lines in the projects entry file, where 'oceanside' can be the name of the colorscheme to use:

import 'state-template/dist/style/core/css/cagov.core.min.css';
import 'state-template/dist/style/core/css/colorscheme-oceanside.min.css';

This project is currently only tested and maintained for the oceanside colorscheme. There are long term plans to allow other themes, but currently not all colors are applied correctly for other themes.

Docs

The best way to try components and discover what is provided in this package is to run the documentation.

Use npm run docs and navigate to http://localhost:6060/ to view the documentation locally.

Every example provides an editable snippet of code for trying the feature out.

Testing

There are several types of tests in this project as follows:

Unit Tests

Unit tests use Jest with Enzyme.

Use npm run test for a single run of unit tests with a code coverage report generated.

Use npm run test:watch for a continuous runs of unit tests, updated upon saving a file. Snapshots can be updated by pressing u while these types of tests are being ran.

Visual Regression Tests

Visual Regression tests use backstop.js to capture screenshots and compare against previous screenshots. Configure running backstop in the backstop.json config file.

These tests require the styleguidist documentation to be running. Before any visual regression test start the docs using npm run docs.

Use npm run visual to run visual regression tests. A html page will open with the results. There can sometimes be inconsistencies, such as if you run have debugWindow turned on (to view the results as they process) the screenshot may capture different, as well as components that use animations or some other time oriented feature.

Use npm run visual:update to udpate the reference snapshots. These snapshots are stored in backstop_data/bitmaps_reference.

Caveats

This project currently contains dependencies upon several libraries for certain functionality, this is subject to change in future releases (they will most likely just get pulled out into a sperate project). These dependencies are as follows:

  • form fields require redux-form as their managment system and are not designed for use outside of it.
  • the configureStore util currently requires redux, redux-saga, and redux-form. It handles initializing them with any passed in reducers and sagas. This functionality is required for any redux connected component, such as ConnectedAsync, and form fields.

This project also is currently only tested and maintained for the oceanside colorscheme. There are long term plans to allow other themes, but currently not all colors are applied correctly for other themes.