@pagopa/pagopa-editorial-components
v4.0.0
Published
[![semantic-release: angular](https://img.shields.io/badge/semantic--release-angular-e10079?logo=semantic-release)](https://github.com/semantic-release/semantic-release)
Downloads
26
Keywords
Readme
pagoPA Editorial Components
A react component library to be used to compose pagoPa product pages based on MUI italia
Installation
To add this package to your package.json
run in your terminal:
// with npm
$ npm install @pagopa/pagopa-editorial-components
// with yarn
$ yarn add @pagopa/pagopa-editorial-components
Usage
import { Hero } from "@pagopa/pagopa-editorial-components";
....
<Hero ... />
....
Storybook
A storybook is available at this address.
CLI Commands
Here's an explanation of the commands you can find in the package.json
:
build
: It compiles the entire library project using the relativetsconfig.json
file. We use it to release new versionsstorybook
: It launches a local Storybook application using 6006 port. We use it when new developments are requiredbuild-storybook
: It outputs a static Storybook in thestorybook-static
folder. We use it to deploy and upadate the online storybooktest
: It runs unit tests for the library components
How to Contribute
Any critiques and suggestions are welcome. All components in this package should be generic enough to be used in different applications and use cases. In this sense, if you have any doubts or aren't sure, please ask your fellow designer. With that said, you basically have two options starting from the design project:
Build the generic component (easy abstraction)
- Take the time to make a proper analysis of the component's possible props.
- Ask your fellow developers/designers for comments or criticism
- Build it, according to the provided guidelines (see below)
- Test all its possible combinations, using Storybook or similar playground
Provide a sample of how to compose the component (hard abstraction)
- Compose the component using the available components provided by the library
- Add a specific story to the Storybook, under the Composition section
Either way, you must follow these guidelines:
- Visual consistency
- If possible, avoid magic numbers.
- Use the provided visual attributes (color, spacing, etc…), using the corresponding theme file
- If you have to use some values not provided by the theme object:
- Ask your fellow designer for clarification
- If necessary, extend it.
- The components must be responsive by default
Accessibility
- Ensure that the new components are accessible to all users. To avoid reinventing the wheel, take advantage of the MUI base components.
- Try to perform the actions using only the keyboard.
If you feel pretty confident, you can open a Pull Request