A react component library to be used to compose pagoPa product pages based on MUI italia
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
import { Hero } from "@pagopa/pagopa-editorial-components";
....
<Hero ... />
....
A storybook is available at this address.
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
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:
- 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
- Compose the component using the available components provided by the library
- Add a specific story to the Storybook, under the Composition section
- 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
- 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