@getsynapse/design-system
TypeScript icon, indicating that this package has built-in type declarations

5.16.1-0 • Public • Published

Design System

Welcome to the repo for Synapse's Design System 🎉

Before you jump into creating components, make sure you've read this.

Typescript

This project uses Typescript to build the library, as oposed to plain Javascript; if you're new to Typescript (and TSX), these links should help get started with Typescript's type checking:

Atomic Design

The Design System is built using the Atomic Design methodology; this means we're thinking of components in hierarchical way, where we have Atoms, Molecules, Organisms, Templates, and Pages, and each level in the hierarchy is composed of elements from the levels below. Here are a couple of links with more information:

Libraries

Instead of relying on CSS files and preprocessors, like Sass, we're opting for a CSS utility framework. Colors and breakpoints are already configured for the project.

Colors

The colors in the Design System specifications are aleady configured here, but keep in mind that more semantic names were used, where the main color in each section is the default one, so something like SYN2_DARK_BLUE will be primary-dark.

Note that the tertiary and system colors were renamed. Tertiary colors are implemented as their color names (teal and purple). System colors use names related to their roles (success, error, and warning).

This is with the intentions to make theming easier to implement.

Accessibilty is a requirement for the Design System, and not all common web patterns are straighforward, so we're leveraging a library that provides some React components with accessibility features already in place. It's also good practice to get familiarized with WAI-ARIA practices.

This library isn't installed already, since each component can be installed individually, we'll add it as needed. If you do need to install a component, make sure the stylesheet attached to it is imported at the top of src/index.ts and .storybook/preview.js.

Along with any component created, be sure to include it's stories. This helps us see how the components behave as we're developing, it helps other devs know how the components work without having to implement them, and it can also provide designers a way to see the implementation of their work.

Whenever you create (or modify) a component, try to also think of potential ways the component can fail and include tests to make sure the component works as expected. This can help catch errors before a component is published, and it also helps prevent new erros being introduced.

Creating Components

Every component created needs to be placed inside a folder named after the component, along with it's stories and tests file

.
└── src
    ├── Atoms
    │   └── Foo
    │       ├── Foo.stories.tsx
    │       ├── Foo.test.tsx
    │       └── Foo.tsx
    └── index.ts

Where index.ts would contain mostly lines like export { Foo } from './Atoms/Foo/Foo';

Scripts

  • storybook - Run the Storybook server
  • build - Generate a new bundle
  • test - Run Jest tests
  • release - Bundle files, bump version, and publish to NPM. It takes a --level argument that corresponds to npm version's parameter (major | minor | patch | premajor | preminor | prepatch | prerelease | from-git)

Extras

P.S. This repo uses npm and node v14 (Fermium)

Readme

Keywords

none

Package Sidebar

Install

npm i @getsynapse/design-system

Weekly Downloads

354

Version

5.16.1-0

License

none

Unpacked Size

2.7 MB

Total Files

436

Last publish

Collaborators

  • tmason-cognota
  • harlan_zhao
  • alex.ariz
  • daniel.campos
  • abirhalwa