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

brandai-storybook

v1.0.2

Published

Brand.ai React Storybook addon

Downloads

33

Readme

Storybook Brand.ai viewer

The Brand.ai viewer displays UI Components from a Brand.ai Design Library in Storybook.

brandai-react-storybook

Getting Started

Install:

Storybook 2.x

npm install --save-dev brandai-storybook@"<1.0.0"

Storybook 3.x

npm install --save-dev brandai-storybook

Create a file called addons.js in your storybook config (default: .storybook) and add the following to addon.js :

Storybook 2.x

import '@kadira/storybook/addons'
import register from 'brandai-storybook';
register({ dataUrl:'<brandai-data-export-url>' });

Storybook 3.x

import '@storybook/react/addons';
import register from 'brandai-storybook';
register({ dataUrl:'<brandai-data-export-url>' });

Connecting to Brand.ai

In order to obtain the url required to connect to brand.ai, you first need to navigate to Brand.ai and log in. Once you're logged in, select the design library that you want to connect to React Storybook and click the Tools and Integrations in the header.

Tools and Integrations

From the tools and Integrations page select the Style Data Export application.

Data export app

In the Style Data Export application click on JSON in the left navigation menu and copy the Styles url

Data export app

Connecting the Brand.ai components to the Storybook.

Note that you will need edit permissions to the design library to connect components.

  1. To connect a component, the design library must be in edit mode Edit mode

  2. Click UI Components in the navigation menu and click on a component to see additional information.

  3. Copy the story URL from your storybook and paste it into the story URL field

Story url

You're done. Refresh your Storybook and you should see a Design Library tab in the Storybook panel. brandai-react-storybook

In Brand.ai's view mode, you'll see a link from the component to the component in Storybook. This allows you to easily switch to the code view of the component directly from your design library.

Note that if you change the story kind or story name in Storybook, you'd need to enter the updated story URL in Brand.ai.

Mapping a single component to multiple stories

If you want the same Brand.ai component to be displayed for multiple stories of the same kind, you can paste a partial URL containing only the selectedKind

http://localhost:9001/?selectedKind=Button