10.3.1 • Published 2 months ago

@nordcloud/gnui v10.3.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

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.

10.3.1

2 months ago

10.3.0

2 months ago

10.2.0

2 months ago

10.1.1

3 months ago

10.1.0

5 months ago

8.11.1

10 months ago

8.11.0

10 months ago

10.0.0

7 months ago

8.15.0

8 months ago

8.19.0

8 months ago

8.12.0

10 months ago

8.16.0

8 months ago

8.16.1

8 months ago

9.0.1

7 months ago

9.0.0

7 months ago

8.13.1

10 months ago

8.13.0

10 months ago

8.13.3

9 months ago

8.13.2

9 months ago

8.17.0

8 months ago

8.13.4

9 months ago

8.20.0

8 months ago

9.1.1

7 months ago

9.1.0

7 months ago

8.10.0

10 months ago

8.14.0

9 months ago

8.18.0

8 months ago

8.21.0

7 months ago

9.2.0

7 months ago

8.9.1

11 months ago

8.8.0

11 months ago

8.4.0

12 months ago

8.6.1

12 months ago

8.6.0

12 months ago

8.3.0

1 year ago

8.9.0

11 months ago

8.5.0

12 months ago

8.7.0

11 months ago

9.0.0-alpha.1

1 year ago

8.1.0

1 year ago

8.1.1

1 year ago

8.0.1

1 year ago

8.2.0

1 year ago

7.8.4

1 year ago

7.8.3

1 year ago

7.9.0

1 year ago

8.0.0

1 year ago

7.8.0

1 year ago

7.6.2

1 year ago

7.6.1

1 year ago

7.8.2

1 year ago

7.8.1

1 year ago

7.7.1

1 year ago

7.7.0

1 year ago

7.5.0

1 year ago

7.3.0

2 years ago

7.2.0

2 years ago

7.1.0

2 years ago

5.8.1

2 years ago

5.8.0

2 years ago

6.0.0

2 years ago

7.0.0

2 years ago

5.9.6

2 years ago

5.9.5

2 years ago

5.9.4

2 years ago

5.9.3

2 years ago

5.9.2

2 years ago

5.9.1

2 years ago

5.9.0

2 years ago

5.5.0

2 years ago

5.6.0

2 years ago

5.7.0

2 years ago

5.3.3

2 years ago

5.3.2

2 years ago

5.3.1

2 years ago

5.3.0

2 years ago

5.4.0

2 years ago

5.2.0

2 years ago

5.1.0

2 years ago

5.0.0

2 years ago

4.15.0

2 years ago

4.14.1

2 years ago

4.16.0

2 years ago

4.14.2

2 years ago

4.8.0

2 years ago

4.5.0

2 years ago

4.6.0

2 years ago

4.11.0

2 years ago

4.12.0

2 years ago

4.13.0

2 years ago

4.12.1

2 years ago

4.14.0

2 years ago

4.12.2

2 years ago

4.10.0

2 years ago

3.4.0

2 years ago

3.3.0

2 years ago

3.2.1

2 years ago

3.2.0

3 years ago

4.4.0

2 years ago

4.1.0

2 years ago

4.0.0

2 years ago

4.3.0

2 years ago

4.2.0

2 years ago

3.1.5

3 years ago

3.1.4

3 years ago

3.1.3

3 years ago

3.1.2

3 years ago

3.1.1

3 years ago

3.0.2

3 years ago

3.1.0

3 years ago

3.0.1

3 years ago

3.0.0

3 years ago

2.7.3

3 years ago

2.7.0

3 years ago

2.7.1

3 years ago

2.5.0

3 years ago

2.6.0

3 years ago

2.3.0

3 years ago

2.4.0

3 years ago

2.2.1

3 years ago

2.2.0

3 years ago

2.1.0

3 years ago

2.0.1

3 years ago