@leapwallet/ribbit-react
v0.0.2
Published
Design system for Leap Wallet
Downloads
53
Readme
ribbit-react
A react component library for ribbit design system built by Leap Wallet.
It's built on top of Shadcn UI.
Installation
To install the package, run the following command:
npm install @leapwallet/ribbit-reactUsage
To use the components in your project, import the components from the package:
import { Button } from '@leapwallet/ribbit-react';
import '@leapwallet/ribbit-react/styles.css';
function App() {
return (
<div className="leap-ui">
<Button>Click Me</Button>
</div>
);
}Full Documentation
You can view the documentation online, hosted on Chromatic.
It includes all the components, theming, and design system guidelines.
If you want to view the documentation locally, you can run the storybook server by following the instructions below.
Development
Project Setup
- Clone the repository
git clone [email protected]:leapwallet/ribbit-react.git- Install dependencies using
pnpm
pnpm installIf you don't have
pnpminstalled, you can install it usingnpmby runningnpm install -g pnpm
Development Server
The project is setup using storybook for development. To start the development server, run the following command:
pnpm storybookThis will start the storybook server on http://localhost:6006/.
If you want to test out components outside of storybook, we also have a vite dev server setup. To start the vite dev server, run the following command:
pnpm devThis will start the vite dev server on http://localhost:5173/.
Contributing
If you want to contribute to the project, please create a new branch with the following naming convention:
git checkout -b your-name/change-nameMaking Changes
The library code lives in the lib directory. Here's the project structure:
.
├── lib
│ ├── components
│ ├── hooks
│ ├── utils.ts
│ ├── index.ts- Any new components should be added to the
componentsdirectory. - Any new hooks should be added to the
hooksdirectory. - Any utility functions should be added to the
utils.tsfile. - The
index.tsfile should export all the components, hooks, and utility functions that need to be exposed.
Adding New Components
Go to the Shadcn UI documentation and see if the component you want to add is already available there.
For example, if you want to add the context-menu component to this library, you can run the following command:
pnpm dlx shadcn-ui@latest add context-menuIf it's not available, you can add the component to this library. Make sure to follow the naming convention and add the component to the components directory.
Testing
Use Storybook dev server to Vite dev server to test the components locally. Make sure to test the components in different scenarios and screen sizes.
Making Pull Requests
Once you have made your changes, push the branch to the repository and create a draft pull request on the staging branch.
git push origin your-name/change-nameOnce the pull request is ready for review, mark it as ready for review and a maintainer will review the changes.
Review Steps
- Design Review + Testing from the design team
- Code Review + API Review + Testing from the maintainer
Once approved, the changes will be merged into the staging branch and will be released in the next release cycle from the main branch.
Making Releases
When a release is to be made, the following steps should be followed:
- Create a new release branch from the
stagingbranch
git checkout -b release/vX.Y.ZCreate a Pull Request from the release branch to the
mainbranchOnce the PR is approved, merge the PR into the
mainbranchCreate a new release with tag
vX.Y.Zon GitHub and add Release Notes and Changelog.
Once the PR is merged into the main branch, the documentation and storybook will be updated via the chromatic GH action.
When the GitHub release is created, the package will be published to npm and GH package registry via the publish GH action.
