Coder Social home page Coder Social logo

buerokratt / cvi Goto Github PK

View Code? Open in Web Editor NEW

This project forked from e-gov/cvi

0.0 0.0 8.0 4.31 MB

Common Visual Identity components built on intial Veera design system for Open Source usage. Uses Government controlled Veera Design as base

License: MIT License

Shell 0.17% JavaScript 2.01% TypeScript 74.92% HTML 4.74% Dockerfile 0.33% SCSS 13.94% MDX 3.90%

cvi's Introduction

πŸ“š e-Gov Common Visual Identity (CVI)

This repository includes a shared CSS library, preprocessed with Sass, along with HTML examples based on it. It also houses a user interface (UI) kit in Angular and a typed, tree-shakable icon library.

The CSS has been architectured to be independent of any specific Javascript framework. This makes it possible for contributors to easily integrate component libraries from other frameworks such as React or Vue.js. The Angular UI library has also been constructed free of any dependencies on design systems/frameworks like Bootstrap or Google's Material. This ensures a reduction in dependence on third-party vendors πŸ› οΈ.

πŸš€ Quick Start & Documentation

The CSS framework and Angular component library utilize Storybook for comprehensive documentation and seamless usage.

To get started, you can access the installation instructions and documentation on e-Gov CVI's Storybook:

πŸ“Œ https://e-gov.github.io/cvi/

The styles in this repository take inspiration from the initial Veera Design System, which you can find here:

πŸ”— https://www.figma.com/file/nNCV5kRqdRkS8MOCK1ZbqU/Veera-Design-System

Please note, e-Gov CVI is not Veera. We've taken inspiration from their work, but our approach and implementation are unique πŸ’‘.

To discuss any issues, suggestions or questions, join our public CVI Signal group.

πŸ› οΈ Installation Instructions

Follow these steps to install and integrate our library:

  1. πŸ“₯ Add the public Koodivaramu registry to your project by following the instructions provided here.

  2. πŸ“¦ Install the necessary package to your project:

  • CSS framework: Use the command npm i --save @egov/cvi-styles
  • Angular components: Use the command npm i --save @egov/cvi-ng
  • React components: Use the command npm i --save @egov/cvi-react
  • Icons: Use the command npm i --save @egov/cvi-icons
  1. 🏁 After installation, import the dependencies into your project. You'll find dedicated instructions for this in the documentation for the CSS framework, Angular components, and icons.

πŸ“¦ Packages and Artifacts Repository

The built packages are published to the public Koodivaramu repository, from where you can download and add them to your application. You can access it via the following link:

πŸ”— Koodivaramu Repository

In addition, the Storybook Docker image is also published to the Koodivaramu repository:

πŸ”— Storybook Docker Image


🀝 Contributing

If you want to contribute to the Common Visual Identity Component Library, follow these steps:

  1. Create a fork of the repository.
  2. Make changes in your own fork.
  3. Create a pull-request back to this repository.

For more detailed instructions, follow the link below:

πŸ”— GitHub Contribution Guide


πŸ”„ Adding/Updating Packages

When adding/upgrading peer dependencies, ensure that they are also updated in the following files:

  • libs/LIB-NAME/package.json for peerDependencies.
  • libs/LIB-NAME/ng-package.json for dependencies to be packaged with the library.

πŸ“ Commit Message Format

The project follows the conventional commit format convention and uses the semver nx plugin for versioning. Ensure to use the appropriate commit messages.


πŸ§‘β€πŸ’» Code Style

Angular

Selectors

Use [cvi-component-selector=local-selector-name] naming convention for content projection selectors.

For example, to introduce a content selector that inserts custom content before a title in a panel (eg. fictional PanelComponent/<cvi-ng-panel> component), an appropriate code would be <ng-content select="[cvi-ng-panel=before-title]"></ng-content>.


πŸš€ Running the Storybook

Run the following command to build documentation and start the Storybook locally:

npm run storybook

🐳 Running Storybook locally in Docker

To run Storybook locally using Docker, follow these steps:

  1. Build the Docker image with the following command:

docker build -f ./libs/storybook/Dockerfile -t cvi-storybook .

  1. Start the Storybook container with the following command:

docker-compose up storybook

  1. Stop the container with the following command:

docker-compose down

  1. the Storybook interface at http://localhost:3005/ in your web browser.

πŸ”Ž Understand your workspace

To see a diagram of the dependencies of your projects, run the following command:

nx graph

This will provide you with an overview of your workspace and how the different projects and libraries are interconnected.

πŸ”¨ Using the Nx build system

To learn more about the Nx build system, check out the following resources:

πŸš€ Running Cypress tests against Storybook

To run Cypress tests against Storybook, make sure that Storybook is up and running (see the previous section). Then, run the following command: npm run cypress:ui

This will open up the Cypress visual testing tool. Select E2E Testing to view all component tests. Note that Cypress tests use Angular components in iFrame windows, which is why Storybook needs to be up and running.

πŸš€ Running Chromatic tests

The project uses automatic screenshot testing via Chromatic.

  1. To run the tests, use the following command in your terminal: npm run chromatic
  2. Open the resulting URL and review the visual changes, accepting or denying them in the Chromatic UI.

πŸ’‘ Chromatic CI also runs on every push. The action always passes (even when visual changes are detected) except for cases when a story is broken. Contributors and reviewers should check the results of the action (and accept or decline them in the Chromatic UI) by following a link in the build log. πŸ’‘

Publishing to Chromatic also gives a possibility to share a Storybook link for a specific branch (even non-pushed, if the local npm command is used) in this format:

https://<branch>--6373995e3f280e239470296d.chromatic.com

πŸ™ Thanks

Chromatic

Thanks to Chromatic for providing the visual testing platform that helps us review UI changes and catch visual regressions. πŸŽ‰

cvi's People

Contributors

sa-r-ah avatar siimveskilt avatar ceisipeik-nortal avatar certainlyakey avatar 1ahmedyasser avatar mluik avatar hannesatnrt avatar markokull avatar henrymae avatar theonlymarksam avatar baha-a avatar minwasko avatar ceisipeik avatar trevorling avatar ivomattus avatar turnerrainer avatar dependabot[bot] avatar ekateriinal avatar helemand avatar varmoh avatar riagit avatar

cvi's Issues

Split CVI Header and Navigation

AS An Admin User

I WANT TO BE Able to have access to header and navigation across all modules

SO THAT any change to one of them will reflect in all modules

Acceptance Criteria

  • Split Header and navigation into 3 standalone packages
  • Header package will be named header
  • Navigation package will be named navigation
  • Styles package will be named styles

Main Navigation menu

AS AN Administrator
I WANT TO add a side menu to apps
SO THAT I can navigate between different apps and do the actions I want

  • The structure of the menu is loaded from a static resource (URL from environment variable).
  • The user see only items on the menu that are in accordance with their rights.
  • Menu captions must be translatable

BΓΌrokratt Admin Header

AS AN Administrator
I WANT TO add a top header panel to the apps
SO THAT I can display the same user status information in different apps

AS A Developer
I WANT TO use the BΓΌrokratt Admin Header as a standard component
SO THAT I wouldn't have to develop it but still be able to use all of its functionalities the same way as all the other modules do

Acceptance Criteria

Required functionalities

  • Show the user name of the authenticated user
  • Show the user status of the authenticated user
  • Link to log out the authenticated user
  • Link to the settings of the authenticated user
  • Show the amount of currently active chats
  • Show the amount of closed chats

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.