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

@nordcloud/gnui

v10.4.2

Published

Nordcloud Design System - a collection of reusable React components used in Nordcloud's SaaS products

Downloads

1,532

Readme

PRs Welcome

All Contributors

General Nordcloud UI

This repo contains the Nordcloud Design System - a collection of reusable React components used in Nordcloud's SaaS products.

Components

  1. Design System (/src/components)
  2. Storybook (/src/stories)

Install

npm install @nordcloud/gnui

or

yarn add @nordcloud/gnui

Make sure you have a proper versions of required packages installed, they are specified in peerDependencies field inside package.json.

Version 7 or greater of npm should install them automatically, if not, run:

npm install react react-dom styled-components

Don't forget to install types if you are using TypeScript:

npm install -D @types/react @types/react-dom @types/styled-components

Usage

Apply global GNUI styles at the top level of your app:

import { SetGlobalStyle } from "@nordcloud/gnui";

ReactDOM.render(
  <React.StrictMode>
    <SetGlobalStyle customScrollbars />
    <App />
  </React.StrictMode>,
  document.getElementById("root")
);

Switch themes:

import {
  Button,
  SVGIcon,
  useThemeSwitcher,
  THEME_OPTIONS,
} from "@nordcloud/gnui";

function UserSettings() {
  const { currentTheme, setTheme } = useThemeSwitcher();

  return (
    <Button onClick={() => setTheme(nextTheme)}>
      <IconWrap>
        <SVGIcon name="dashboard" />
      </IconWrap>
      Switch to {THEME_OPTIONS[nextTheme].toLowerCase()} theme
    </Button>
  );
}

Storybook deployment

Storybook allows you to preview components. It deploys the code automatically with Amplify Console triggered by changes on branch master. Pipeline steps are found in amplify.yml.

When you create a PR against the master branch, Amplify creates a new deployment automatically - the environment will be attached to the PR at Github. Reviewers can preview changes using this deployment - after the PR gets merged or rejected, the environment is destroyed automatically by Amplify Console.

Contributing to this repo

  • Please create your components in src/components and update stories in stores.
  • Code should be formatted using Prettier.
  • We are using styled-components for styling.
  • All code should be written using TS.
  • Every component props should be described using "type" instead of "interface".
  • Name types with Pascal Case naming convention and Props or Data prefix.

Local setup

1. Clone the repo

2. Setup Node

Below versions of Node & npm are required:

  "node": ">=18.12.0",
  "npm": ">=8.19.2"

Run nvm use to use supported version.

3. Install packages

npm install

4. Run Storybook to verify everything works

npm run storybook

Development

Local testing

There is a possibility to build & test the package locally in the project it's currently used in.

npm run build
npm pack

You will get a tarball with the freshly built package, you can copy it inside your project's folder and install with

npm install nordcloud-gnui-${VERSION}.tgz

After the successful installation it's ready to be tested (remember to restart the dev server)

Contributors

This project follows the all-contributors specification. Contributions of any kind are welcome!

License

Licensed under the MIT License, Copyright © 2020 Nordcloud Engineering

See LICENSE for more information.