Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
@originprotocol/origin-storybook
Advanced tools
Component library for Origin Protocol, using Storybook
An Origin Protocol shared component library, using React, Storybook.js, and rollup.js.
The latest Storybook version from the main
branch is live here.
These components are meant to be used by originprotocol.com, ousd.com, oeth.com, and story.xyz React frontend apps.
yarn add @originprotocol/origin-storybook
In a React component, import components:
import { Card, Header, Footer } from '@originprotocol/origin-storybook'
...
<Header webProperty='originprotocol' />
<Card
body="7,777 Lucky Duckies have left the pond and are getting into mischief!"
img={<value alt="keanu banner" height="200" src="https://placekeanu.com/381/192" width="400"/>}
linkHref="https://google.com"
linkText="Visit luckyducky.xyz/market"
thumbnail={<value alt="keanu face" layout="fill" src="https://placekeanu.com/128/128"/>}
title="Lucky Ducky NFTs"
webProperty="originprotocol"
/>
<Footer />
...
To run storybook locally to develop or look at component docs, install and run Storybook:
yarn
yarn storybook
This will stand up a Storybook server at localhost:6006.
src/components
, add a folder with your component name and an index.tsx
file.export const YourComponent = () => {
...
}
YourComponent.stories.tsx
file in your folder.import { ComponentStory, ComponentMeta } from '@storybook/react';
import { YourComponent } from '.';
// More on default export: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
export default {
title: 'Origin/YourComponent',
component: Footer,
// More on argTypes: https://storybook.js.org/docs/react/api/argtypes
argTypes: {
backgroundColor: { control: 'color' },
},
} as ComponentMeta<typeof Footer>;
// More on component templates: https://storybook.js.org/docs/react/writing-stories/introduction#using-args
const Template: ComponentStory<typeof YourComponent> = (args) => (
<YourComponent />
)
export const YourComponentStoryTitle = Template.bind({});
Your folder should look like:
.
└── src/
└── components/
└── YourComponent/
├── index.tsx
└── YourComponent.stories.tsx
src/index.ts
, import your component:import './index.css'
export * from './components/Button'
export * from './components/Card'
export * from './components/Dropdown'
export * from './components/Footer'
export * from './components/Header'
export * from './components/Typography'
export * from './components/YourComponent' // add your component here
Once the preview of the components with changes look good, you'll want to build the components using Rollup.
yarn build
After commiting changes:
yarn build
npm version [major|minor|patch] -m "New version message"
npm publish
Make sure to also add the tags to Github as well!
git push origin main --tags
FAQs
Component library for Origin Protocol, using Storybook
The npm package @originprotocol/origin-storybook receives a total of 4 weekly downloads. As such, @originprotocol/origin-storybook popularity was classified as not popular.
We found that @originprotocol/origin-storybook demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 8 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.