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

pk-pattern-library

v1.1.5

Published

A pattern library generator for ApostropheCMS.

Downloads

34

Readme

wip : pk-pattern-library

Getting Started

app.js

const apos = require('apostrophe')({
...
  modules: {
    'my-pattern-library': { extend: 'pk-pattern-library' }
  }

By default, visiting /styleguide will load the pattern library. This is configurable (see below).

Global Options

Key | Default | Description ---|---|--- slug | '/styleguide' | Slug for visiting the pattern library.

Global data.json options for configuration

Key | Default | Description ---|---|--- project_name | null | string: Name of the project project_logo | null | string: Optional logo for the navigation hide_project_name | null | boolean: Hides the project name, if you prefer a logo. overview | array | array: contains an object configuration with introductory information. groups | null | array: contains a single group object, and your array of components. components | null | array: a collection of components that you wish to include in your group.

Example of data.json for configuring component groups

  {
    "project_name": "Test Project",
    "project_logo": "/image.png",
    "overview": [
      {
        "name": "introduction",
        "title": "Introduction",
        "description": "This is a description"
      }
    ],
    "groups": [
      {
        "name": "typography",
        "title": "Typography",
        "description": "This is my description",
        "components": [
          {
            "name": "typography/title-primary",
            "title": "Title Primary",
            "description": "This is another description",
            "options": {
                "size": "half"
            }
          }
        ]
      }
    ]
  }

Special Component Types

  • Colors is a special component that takes an array of hex values, or objects that contain information about the color. Available properties are

Key | Default | Description ---|---|--- label | null | string: Variable name hex | null | string: Hex value cmyk | null | string or boolean: CMYK value, or if true, will automatically convert based on hex value. gradient | null | string: Gradient css values

  "components": [
    {
      "name": "colors",
      "title": "Colors",
      "colors": [
        "#2F2D41",
        "#472B8A",
        {
          "label": "Primary",
          "hex": "#000",
          "cmyk": true
        },
        {
          "label": "Secondary",
          "gradient": "linear-gradient(to bottom right, #472B8A, #834192)"
        }
      ],
      "options": {
        "size": "full"
      }
    }
  ]

Other component options

Key | Default | Description ---|---|--- size | null | string: 'full' or 'half', displaying the components at either 50% or 100% hide_code_block | null | boolean: hide the code block for the component externals | null | array of objects: provide a label and url pointing to any external file. background_color | null | hex value: make the area around the component something besides white #ffffff

CLI Command

Scaffold a component using this command, where group is the group name, and component is the component name. This will create a component.html and markdown.html file/folder structure, and append the data to data.json. The bare minimum required to render.

$ node app MODULE_NAME:create group component

Examples

LawCoin Styleguide