Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@polymathnetwork/polymesh-ui

Package Overview
Dependencies
Maintainers
8
Versions
468
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@polymathnetwork/polymesh-ui

A library for Polymath's custom UI components. Check out [the docs here](https://polymath-ui-develop.netlify.com/) and [visit the Storybook](https://polymathnetwork.github.io/Polymesh-UI) for examples how to use it.

latest
Source
npmnpm
Version
0.3.386
Version published
Weekly downloads
1.2K
663.19%
Maintainers
8
Weekly downloads
 
Created
Source

Polymath UI

A library for Polymath's custom UI components. Check out the docs here and visit the Storybook for examples how to use it.

Install

Clone the repo and run yarn to install all dependencies.

Build

yarn build

Development

For the development we recommend to work with Storybook playground which allows to easily preview component changes.

Start it with the following command:

yarn start

Testing

yarn test

Deployment

The CI automatically deploys the latest Storybook from the main branch after each commit to gh-pages branch, which is then hosted here: https://polymathnetwork.github.io/Polymesh-UI/.

Add a new component

New component should follow the following patterns

  • Styling of components should not impact other components: no external margins on the parent container (with the exception of the Heading and Paragraph primitives that have default, overridables, margins). The component styles should not take into consideration its position in the app. It should be displayable anywhere. You will use the primitives to "layout" your components in the final page (where they are being used).

Don't

<Component style={{ marginTop: '30px' }} />

Do

<Box mr={30}>
  <Component />
</Box>

Don't

  <Page centered />

Do

  <Page />
  <PageCentered />
  • Nested components should follow the Parent.Child pattern.
  • Component should be tested (snapshot + unit tests if applicable).
  • Component should have a specific page in the UI website usign an .mdx file.

Add new SVG icons

  • Export your SVG in black #000 (or replace the hex value in the following command by the color of your SVG)
  • Add the SVG files to images/{folder}
  • npx @svgr/cli --icon --replace-attr-values "#000=currentColor" --ext tsx -d images/{folder}/generated images/{folder}
  • Add an entry to images/icons/index.ts to export the icon component

Examples:

npx @svgr/cli --icon --replace-attr-values "#000000=currentColor" --ext tsx -d ./src/images/icons/generated ./src/images/icons`
npx @svgr/cli --icon --ext tsx -d src/assets/images/icons/generated src/assets/images/icons

FAQs

Package last updated on 08 Aug 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts