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

author-design-system-react

v1.0.68

Published

React Design System library for use with the [Author v2](https://github.com/ONSdigital/eq-author-frontend) project.

Downloads

537

Readme

Author React Design System

React Design System library for use with the Author v2 project.

The Blaise Design System React Component Library has been phased out of the Author Design System React Component Library and will no longer be available.

Setup

To use this library as a dependency within a project, run:

yarn add https://github.com/ONSdigital/eq-author-design-system-react#main

Specifying #main installs the most recently released version of the Author React Design System's main branch.

To install a specific release version of the Author React Design System in a project, replace #main with #<RELEASE_VERSION_NUMBER> in the above command.


Before using components from this library, add the following code within the <head> tags of your React project's public/index.html file:

<link
    href="https://cdn.ons.gov.uk/sdc/design-system/69.0.0/css/main.css"
    rel="stylesheet"
    type="text/css"
/>

The above code implements the ONS Design System's global CSS style rules into your project - if this code is not included, style rules will not be applied to this library's components within your project.

Testing changes

Several new scripts are available to use when running tests:

yarn test: jest --watchAll

This is a standard command to run your test suites.

yarn test:watch

"jest --watch" Watch mode continuously monitors for changes in your project files and re-runs the tests whenever a change is detected.

yarn test:coverage

"jest --collectCoverage --coverageDirectory="./coverage"" - When you run this script (yarn test:coverage), it executes Jest and collects code coverage information.test:coverage), it executes Jest and collects code coverage information.

yarn test:verbose

"jest --verbose" - The --verbose flag makes Jest output more detailed information during the test run, providing additional insights into the test execution process.

Usage of new scripts:

  • All tests: yarn test
  • Specific test: yarn test <path>, eg yarn test src/Utils/StringUtils.test.tsx

Add a component

To add a component to the Author Design System React library from the Blaise Design System React Components library:

  • Open src/index.tsx
  • Within the index file's import block, add the name of the component
  • Within the index file's export block, add the name of the component
  • Update this README file's available components to list the component

The component can only be added if it is available in the Blaise Design System React Components library.

  • [ ] Select Node version 20: Use nvm use 20 to ensure Node version 20 is selected.
  • [ ] Install node_modules: Run yarn to install the required dependencies.
  • [ ] Start Storybook: Run yarn storybook to start the Storybook development environment.

To import a component from this library in a React project, use the following example:

import { Header, Button } from "author-design-system-react";

Replace Header, Button with the required component(s) to import.


To use a component once imported, use the following example:

<>
    <Header title="Page header" />
    <Button
      text="Submit"
      onClick={function noRefCheck(){}}
    />
</>

Replace these components with the component(s) required for your use case.

Available Author components

Components from the ONS Design System are implemented as React components.

Note these links below are to the design system documentation. For this repository documentation refer to Here.

| Component | Link to Design System Component | | ---------------- | ------------------------------------------------------------------------------------- | | Collapsible | Details | | Footer | Footer | | Header | Header | | ONSButton | Button | | ONSPanel | Panel | | ONSPasswordInput | Password | | ONSTextInput | Input |