Giter Site home page Giter Site logo

usethetics / denhaag Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nl-design-system/denhaag

0.0 0.0 0.0 14.94 MB

Work in Progress: Den Haag Design System based on the NL Design System architecture

Home Page: https://nl-design-system.github.io/denhaag

License: Other

Shell 0.09% JavaScript 5.81% TypeScript 74.35% CSS 19.75%

denhaag's Introduction

denhaag-component-library

A library of React components for the municipality of The Hague

npm GitHub Workflow Status (branch)

🥅 Goals of this codebase

The Municipality of The Hague React UI-components library is constructed, so that re-use by other government organisations is possible with minimal effort. The UI-components are available in a basic styling and through the use of Design Tokens it is possible to give the components your own (corporate) identity. Within the Municipality of The Hague the components are used for:

  • Corporate website (Wordpress - Open Web Concept)
  • Satelite websites (Wordpress)
  • OpenSource eForms (OpenFormulieren - Dimpact)
  • Portal (MijnDenHaag - collaboration with Amsterdam and Dimpact)

🚀 Getting started

Install component library

yarn add @gemeente-denhaag/denhaag-component-library

Usage

import React, { Component } from "react";

import { MyComponent } from "@gemeente-denhaag/denhaag-component-library";

class Example extends Component {
  render() {
    return <MyComponent />;
  }
}

Develop

Setting up the development environment

  1. Clone this repository
  2. Install npm go here for instructions. Make sure to install version 14 or higher.
  3. Install yarn go here for instructions. Make sure to install version 1.22 or higher.
  4. Run the following command to install all development dependencies:
yarn install --frozen-lockfile

Code style

Be sure to install IDE plugins for ESlint, Prettier, JSONLint and Stylelint if available.

Folder structure

The project folders are structured in the following way: The src folder houses both our components and our storybook stories, these are both in their own folders. Our components are sorted into several categories, where each category has its own parent folder. All of our components are their own package and managed with lerna, docs are available here. Similarly, each category is its own package managed with lerna.

Adding components

Storybook

In order to test components we use storybook.
To run storybook locally we start it with the following command:

yarn storybook

We don't need to re-run the command over-and-over because storybook should detect changed files ✨automagically✨ and refresh the displayed components.

Creating a new package for a new component

In order to create a new lerna package we need to create a package.json file for it inside it's folder. Start by filling it with the following information:

{
  "name": "@gemeente-denhaag/{component_name}",
  "version": "0.1.0",
  "description": "A short description of the component",
  "author": "Municipality of The Hague",
  "license": "EUPL-1.2",
  "repository": {
    "type": "git",
    "url": "https://github.com/nl-design-system/denhaag.git",
    "directory": "{path/to/component}"
  },
  "bugs": "https://github.com/nl-design-system/denhaag/issues",
  "dependencies": {
    "@material-ui/core": "^4.11.0"
  }
}

Don't forget to add all needed dependencies for your component to the dependencies section of the component's package.json.

We will also need to add our component to the meta-package which installs all of the Den Haag react components in the same category. We can do this by adding it to the list of dependencies. The file we need is located here: src/components/[CATEGORY]/package.json
An entry should be structured like this:

"@gemeente-denhaag/{component_name}": "^0.1.0"

Similarly, if you create a new category we need to add the category package to the list of dependencies in the meta-package which installs all of the Den Haag react components. This file is located here: src/components/package.json

An entry should be structured in the same way as above.

Cooperation with NL Design System

Certain Components available in this repository may become part of the NL Design System component library. When you contribute to this project you allow your contributions to be made a part of the NL Design System component library. The NL Design System project maintainers decide which components will be included in their component library.

❗ Reporting issues

Our public issue tracker is located here. Before reporting an issue make sure to check if a similar issue already exists. When reporting an issue give detailed information about the issue and how to reproduce it if applicable.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.