@procore/storybook-addon
TypeScript icon, indicating that this package has built-in type declarations

4.2.0 • Public • Published

STORYBOOK-ADDON

An addon to customize procore theme and adds common used configuration.

Installation

yarn add -D @procore/storybook-addon

And add the addon to you addon sets:

module.exports = {
  addons: ['@procore/storybook-addon'],
};

This simple addon adds 3 main addon used across different apps at Procore.

Usage

Procore Theme Default values are as:
  • $\textit{Prcore Logo:}$
  • a hower text ${\text{\color{green}{Core}}}$
  • the link to core design system https://design.procore.com on the logo.

In order to set the theme by default values ${\text{\color{green}{createProcoreTheme}}}$ needs to be added in manager.js. If no parameter has been passed to the createProcoreTheme the aforementioned default values will be set.

// .storybook/manager.js
import { createProcoreTheme } from '@procore/storybook-addon';
import { addons } from '@storybook/manager-api';

addons.setConfig({
  theme: createProcoreTheme(),
});

For more configuration please visit: https://storybook.js.org/docs/react/configure/theming

// .storybook/manager.js
// example below will override Procore default theming configuration
import { createProcoreTheme } from '@procore/storybook-addon';
import { addons } from '@storybook/manager-api';

addons.setConfig({
  theme: createProcoreTheme({
    base: 'light',
    brandTitle: 'My custom storybook',
    brandUrl: 'https://example.com',
    brandImage: 'https://place-hold.it/350x150',
    brandTarget: '_self',
  }),
});
Stories Configurations

There are some default configurations added to the previewHead such as adding ${\text{\color{green}{Inter}}}$ font and some default styling (box-sizing) in the Preview area in storybook iframe where the stories are rendered.

Storybook detailed window

if there is more needs to be added into preview iFrame Head section, then please refer to: https://storybook.js.org/docs/react/addons/writing-presets#previewmanager-templates.

import { request } from '@procore/core-http';

function ExampleRequest() {
  request('/some-url-here', { baseUrl: 'https://www.example.com' })
    .then((response) => console.log(response))
    .catch((err) => console.error(err));
}
Extensions and Rules

this library by default supports: ['.ts', '.tsx', '.js', '.jsx', '.css'] extensions and adds css-loader as a rule to config module.

To enable .scss support - install sass module. Addon checks if sass is present in node_modules.

This library also adds basic ${\text{\color{green}{Typescript}}}$ configs.

Please refer to Storybook Docs to override or add more configurations.

Testing

This addon should be tested by running storybook in example-apps/react-ts and example-apps/react-core-scripts apps.

Package Sidebar

Install

npm i @procore/storybook-addon

Weekly Downloads

71

Version

4.2.0

License

SEE LICENSE IN LICENSE

Unpacked Size

56.9 kB

Total Files

22

Last publish

Collaborators

  • yzhou2024
  • alyelashram_procore
  • melch-procore
  • peterknif
  • moaz-ashraf
  • attachi
  • a.elbadawei
  • hyogman
  • dmitri_wm
  • stephanie.brereton
  • procore-oss-user
  • stevenkang3
  • max.helmetag
  • codyrobertsprocore
  • miguel.garcia-procore
  • magdyyx
  • atoaima
  • mustafa-abdelrahman
  • elewando-procore
  • ahmed.ghorab
  • lnspatz914
  • richard.bunn
  • omar.wagdy
  • mona.khairbek
  • mbartlett413
  • cody_schindler_procore
  • yoasyo25
  • ritchlee
  • andersontr15
  • steven.hinkle
  • jamie-dugan-procore
  • hgouhierprocore
  • denzylbalram
  • sarah.freitas
  • alan.bresani
  • amyprocore
  • yoyis3000
  • elijah.procore
  • mike-arndt-procore
  • jnhoang1
  • pam-whisenhunt
  • shradha.khard
  • david-christensen-procore
  • javio-procore
  • chance.eakin.procore
  • gideon-procore
  • ihor.diachenko_procore
  • justinmwatts
  • tedyang
  • jyang-procore
  • pwhisenhunt-procore
  • fairchild
  • rodayna.ehab
  • neil1023
  • scottstern
  • brian.smith1
  • g2mitchell
  • dlameter-procore
  • kylepietz
  • abhijit-procore
  • lhuang325
  • jake-pitkin
  • erikthoreson
  • simona.iancu
  • decha-sanson
  • aberkowitz
  • asamay
  • mustafa-u-abdelrahman
  • rajatmenhdiratta
  • jacksonleach-procore
  • pmfrawley
  • phunguyen-pcor
  • tatsiana.clifton
  • deiab
  • srichaitanya.peddinti
  • kenny.foisy
  • matheusprocore
  • jgreene_procore
  • hectorthiele
  • etokarev
  • daniel.ferreira-contractor
  • dmccraw-procore
  • cyrille.bai
  • greg.sparks
  • fabiomelo513
  • phil.custer
  • bbreyel921
  • amir-iskander
  • neil.mckeeman
  • nickprocore
  • lzhou888
  • davidshure
  • stevenliprocore
  • ramysaid2
  • refaiepcn
  • jgentes
  • faraz.hanif
  • mostafaeltazy
  • agamaleldin
  • andrew.isaac
  • saranahal2
  • rodrigo.dejuana
  • kellen.stewart
  • bill-wagner
  • ezrasimeloff
  • jeffgiaquinto
  • gturkadze
  • sean.spearman.procore
  • kylemartinez-procore
  • roobo-romeski
  • andres-mendez-procore
  • gaurav.sharma.procore
  • tracy.otto
  • sarah.heredia
  • victorbendeck-pc
  • cbathgate
  • davidkangpro
  • kyle.liu
  • amin.jaipuri
  • grafffffff
  • mishaelowoyemi
  • evan.cerwonka.procore
  • ilya.dryha-contractor
  • varomir
  • yogevfine1
  • timofeee
  • matt.harris0223
  • winson.chu
  • andersonbispoprocore
  • scorgiat-procore
  • ladavarga
  • procore_halzy
  • enyaga
  • willpankonien
  • sateesh-kadiyala-procore
  • chris.berber
  • txin1
  • epalinprocore
  • mehrdad-panahandeh
  • tyler.wasden.procore
  • jeremy.lund
  • dineshkumar.jayak
  • ryanfuentesprocore
  • stajics
  • brocktillotsonprocore
  • kyle.williams
  • dtorres-procore
  • noor.ali
  • ari-procore
  • alanprocore
  • jl4ever
  • james.lawson
  • ajaykumar-procore
  • dennis.heckman
  • tara.chambers
  • lalovar-procore
  • james.cleary
  • chadryder
  • devin.cunningham.procore
  • abhijit.patwardhan
  • lydiahara
  • sherylnapigkit
  • changprocore
  • apcarroll_procore
  • andy.mayer
  • bob.laskowski
  • vinaya-procore
  • kahliholmes
  • andrew.wheeler
  • leandro-proc
  • yadhu.prakash
  • jason-kaye
  • jesse.olsen
  • patrick.lardin
  • brad.urani
  • allenanle.procore
  • brookyboy009
  • uddhavjoglekar
  • dancingshell
  • rysmithprocore
  • robbiegprocore
  • jadamsss
  • jeremy.bouzigard
  • timdoherty
  • b.bookout
  • jalyng
  • htael
  • dev-account-admin
  • sseanwang
  • bhargavrnd
  • farismmk
  • dannyporrello
  • danny.ou
  • messanjah
  • eyvettesou
  • jgee67
  • cagmz
  • mariah_delaney
  • lukenispel
  • kimhin267
  • juliana.hernandez
  • judy-lu-pc
  • procore-it-support
  • andrewburke-pc
  • jkleintech
  • rachel.arkebauer
  • procore-npm-bot
  • james.dabbs-procore
  • laurenbrandsteinprocore
  • scottbieser-procore
  • zach.mckenzie.procore
  • shayonj_procore
  • heplayskeys
  • mike.south
  • thomasoboyle
  • dischorde
  • derek-carter-procore
  • dlgasser
  • cfprocore
  • evan.waits
  • jeremy-marcus
  • jmejia-fsl
  • ersgonzalo
  • stephan-procore
  • aleclarsenprocore
  • yihai.zweifel
  • jay-rajan
  • jacky-lei
  • peter.jin