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

@oqton/design-system

v1.6.4

Published

Oqton's design system.

Downloads

217

Readme

Design System

What should go into the Design System?

  • Theme declaration
  • React Components
  • Helper Functions

What shouldn't go into the Design System?

  • Application specific variables
  • Application specific logic

Naming conventions

  • Whenever matching a standard html attribute, props should stay consistent with existing w3 conventions. For example a button should use disabled, not isDisabled.

Static Assets

Static assets are stored in the public folder. These include things such as static images.

Design System Structure

The design system is split into the following categories:

About

A design system is a set of interconnected patterns and shared practices.

Patterns are the repeating elements that we combine to create the product: things like user flows, interactions, buttons, text fields, icons, colors, typography, microcopy, all of it. If it’s reusable, it goes in the system.

Practices are how we choose to create, capture, share and use those patterns.

Principles provide directions that help make decisions for the system.

Foundations

This is where we define the attributes for our design-system's theme. It is broken into the following sections:

  • Breakpoints
  • Colors
  • Elevation
  • Radii
  • Spacing
  • Typography

A theme is constructed from these foundations and then consumed by our code via styled-components and styled-system. See more on themes here

In order to implement components, responsive components, and layouts, we need a tool for managing spacing. For this, we use the following foundational components There are 5 components used for managing our spacing:

  • Absolute: A div with position: absolute
  • Box: A div with position: relative
  • Fixed: A div with position: fixed
  • Flex: A div with display: flex
  • Sticky: A div with position: sticky

All design system components should inherit from these foundational components when declaring any sort of margin, padding, width, height, or flex amount.

Components

Components are used to as the building blocks to create the applications interface.

Each design system component should consist of the following files:

  • Component - <component>.js

    • Imports and utilizes all styled components from <component>Styles.js
    • In charge of managing component-level state (may also be a stateless component)
    • Should declare default props wherever possible
    • Should include jsdoc comments for every unique (non-inherited) prop
    • Should add comments where appropriate to explain if extending prop functionality from another component (for example Flex should explain that it is extending props from the Box component)
  • Style declarations - <component>Styles.js

    • Use styled-components to declare styles for every html element that will be used in the base component
    • Should use styled-system wherever possible
    • Should use our theme wherever possible
    • Should extend sibling design components wherever possible
  • Storybook - <component>.stories.js

    • Should create stories to match UX's Sketch artboard for the corresponding component
    • Should create stories with the component and a knob for every prop that should be tuneable
  • Tests - ./__tests__/<component>.test.js

    • If component has state, should test transition between states
    • Should test population of each proptype
    • Should utilize @testing-library/react to test calling all props that are functions

Theme

Full theming support by exporting a wrapper component. Also need to use utils.createTheme() to create or merge in any other themes.

import {Theme, utils} from '@oqton/design-system';

<Theme theme={utils.createTheme()} />

If you need to merge in another theme:


<Theme theme={utils.createTheme(anotherTheme)} />

This component provides a theme to all React components underneath itself via the context API. In the render tree all components will have access to the provided theme, even when they are multiple levels deep.

Workflows

Under development

Workflows try to capture the experience of a user during the interaction with the product.

Utils

Utility functions are organised here Each utility function should have a corresponding test suite to describe functionality

Scripts

"start-docz"

This will start docz on port 3001 in development mode

yarn start-docz

Your docz instance will be running on http://localhost:3001.

To view an online Docz site from the develop branch, visit: http://design-system.oqton.ai This instance is updated automatically upon merging into develop.

"test"

Run the tests

yarn test

"lint"

Run lint

yarn lint

"fix-lint"

Run lint and attempt to automatically fix issues

yarn fix-lint

"check-formatting"

Run formatting check

yarn check-formatting

"fix-formatting"

Run formatter

yarn fix-formatting