Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@bulb/patterns

Package Overview
Dependencies
Maintainers
40
Versions
371
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bulb/patterns

Welcome to the Bulb Design repository!

  • 20.3.0
  • npm
  • Socket score

Version published
Weekly downloads
103
increased by21.18%
Maintainers
40
Weekly downloads
 
Created
Source

Bulb Design

Welcome to the Bulb Design repository!

This repo contains;

  • 📚 our pattern library
  • 📸 our visual regression tool
  • 📦 our patterns package which is used by our other frontend codebases.

Viewing the pattern library

The latest version of the library is published at http://design.bulb.co.uk where you can browse the library and try new pattern arrangements in the playgrounds.

Consuming the patterns package

To use the patterns in your project, first, add the @bulb/design package.

Note: this is a private package, and you will need to login to npm and be added to the Bulb npm organisation.

yarn add @bulb/design

You can then simply import the components you wish to use, if you're using the full project.

Typescript components

import { AppLinks } from '@bulb/design/modules/AppLinks';

<AppLinks {...props} />;

Importing old components

import { Button } from '@bulb/design';

<Button {...props} />;

Local Development

Running the library locally

To run the library locally run the following command.

yarn run start

This will run it in a hot mode and will update any browser windows (on modern browsers) with any changes you make locally. For older browsers such as ie10 you will need to manually refresh the browser window following local changes.

Note: currently for the non typescript components, static assets such as images and icons are included in the compiled file, but this may change in the future so it doesn't make the file so large.

Creating Patterns

See the Solar techincal styleguide for details about how to structure and write new patterns.

Updating components | CHANGELOGS

We use changelogs for patterns to help document the changes to components over time.

This helps us when consuming components that have been changed by one another to see why and how components have changed.

When updating components, we update the adjacent CHANGELOG.md file with an entry describing the change where appropriate.

New changes should be added under the vNext section at the top of the changelog file.

  • For breaking component changes prefix the entry with [major] to communicate the new behaviour.
  • For new feature prefix the entry with [minor] to communicate the new behaviour.
  • For bug fixes prefix the entry with [patch] to communicate the new behaviour.

example changelog structure

# CHANGELOG

## vNext

- [major] short description of breaking change
- [minor] short description of new feature
- [patch] short description of bug fix
- short description of non breaking change

## v17.0.1

// ...previous changes

Pattern Documentation

We utilise an internal library tool to create a visual reference to all the patterns we've built in here.

When you add a new pattern to this repo, the README.md should be filled with details of this pattern.

It is generally the same Markdown as with Github, with the addition of Specimens - read about those over here to make your documentation amazing.

While we don't use catalog anymore, the api for our tool is based on it.

Static Variables and Values

Static values and CSS variables are in the src/styles directory.

In your components, you can import these,

import { palette } from '../../styles/tokens';

Testing

The test command is simply

yarn test

You can add any of the Jest CLI options to test specific files.

Your tests should cover any interactions your component may have.

Visual regression tests

The test command is simply

yarn vr-test

Visual regression tests require machine setup to run, see the Visual Regression Testing Document for details about how to set these up and use them to test your components.

FAQs

Package last updated on 21 Dec 2018

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc