npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@radargovernamental/orbit-style

v1.5.0

Published

Radar Governamental's Design System

Downloads

9

Readme

orbit-style

Orbit Style is Radar Governamental's Design System, made with Sass and React

NPM JavaScript Style Guide

Install

yarn add @radargovernamental/orbit-style

Usage

  1. Import global styles in your index.css (created with create-react-app):
@import '~@radargovernamental/orbit-style/styles/settings/_global.scss';
  1. Use components
import React, { Component } from 'react'

import { Button } from '@radargovernamental/orbit-style'

class Example extends Component {
  render () {
    return (
      <Button>Hello</Button>
    )
  }
}
  1. Check components in storybook
cd example
yarn install
yarn storybook

Concept

We had a few premise regarding our own design system:

  1. We want to use it as pure scss (to reuse in non SPAs, such as landing pages, for example)
  2. We want to use it with React
  3. Must be able to use with as many frameworks as we need
  4. Let's use well known packages for complex stuff - we don't need to reinvent the wheel
  5. Must be tree shaking ready and use CSS Modules for SPAs.
  6. Must be easy to use

Considering our premise, we mixed three main concepts: Atomic Design, ITCSS and BEM. How?

ITCSS

ITCSS is already quite known for its robustness and scalability regarding css. To adapt to our premise, here is what we did:

  • Settings: stores variables, colors and sizes
  • Tools: a series of mixins
  • Generic: reset, shared global styles
  • Elements: default body style
  • Objects: grid and wrappers
  • Components: all of ours components designed with Atomic Design (below)
  • Themes: not used yet
  • Trumps: few helpers

All of these styles are located in /src/styles. This allow us to accomplish premises 1, 2, 3 and 5.

Atomic Design

Following http://bradfrost.com/blog/post/atomic-web-design/ idea and considering we already have our "components" directory for styles, we now have create a components directory in /src/js/components. This directory is structured as: atom, molecule and organism, where:

  • Atom: all unit styles
  • Molecule: two or more atoms together, or something that might hold two atoms (an element container, for example)
  • Organism: more complex elements that mixes many molecules

Atomic Design gives us a series of new approaches to work as we want with our components in a high scalable way. Also, we first created all of our components using React, allowing us to use it with CSS Modules and import in our React projects

This allow us to accomplish premises 2, 5. To approach premise 6, it would be too complex for users to know what's an atom/molecule/organism, so we export them as their own name. Therefore, instead of using import Button from '@radargovernamental/orbit-style/atom', we just use import { Button } from '@radargovernamental/orbit-style'.

Also, to be sure 6 is achieved, we created all components using StoryBooks, which can be accessed in /example running yarn storybook.

BEM

BEM was a plus in terms of premises. We chose it to make it easier to control our components hierarchy in terms of CSS Modules and to better control states. For example: a Timeline component with alternate rows will have .c-timeline--alternate-rows class added. A Timeline with alternate rows AND with dates will have both .c-timeline--alternate-rows and .c-timeline--with-date classes added.

Complex components

The only remaining premise is 4. In order to follow it, complex components such as custom dropdown, grid, etc, were choosen from well known packages. For now, we are using:

All credits for them, they did an awesome work :)


Contributors


License

Apache License 2.0 © radargovernamental