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

lune-ui-lib

v1.3.265

Published

Lune UI Components Library

Downloads

713

Readme

Lune UI Components Library

Library of UI components for React client-side applications. Use within your Lune projects to keep the style system consistent. If you can't find a component you need - add it here first and import it in your project. All reusable components should live here.

The lib also exports the Lune MUI Theme object and is its Single Source of Truth. Import it and use it if using MUI Theming in your project.

The components can be viewed on our Storybook instance (Lune SSO login required).

Develop The Library

The Lune UI Lib is partially based on MUI. MUI components should be used internally where appropriate even if your new component is just a wrapper that injects styling into an MUI Component. Styling values like spacing, colors, typography etc. should generally reference existing values from the Lune Theme object.

Working locally in Storybook

The easiest way to see your component in action is to run Storybook locally.

  • Add you comp
  • Add a story for your comp (see examples in src/stories)
  • Make sure you have modules "react" and "react-dom" installed locally (but do NOT add them to devDependencies)
  • Run yarn storybook

Storybook can act like your local dev server complete with hot reloading.

Working on lune-ui-lib within your webapp

You can symlink the lune-ui-lib folder to your webapp's node_modules folder to immediately see your component in the intended context without merging or publishing:

In lib project:

$ yarn link
$ yarn watch

On your webapp:

linking:

$ yarn link lune-ui-lib
$ yarn install
$ yarn start

unlinking:

$ yarn unlink lune-ui-lib
$ yarn install --force

aaand you're good to go!

If you get Invalid Hook Call Warning error, you should make sure react and react-dom are NOT present in the node-modules of lune-ui-lib.

Publish your component

To add a new component to the library, follow these steps:

  • Add new components to the src/components directory.
  • Add a story in src/stories/ for each component.
  • Open a PR and (eventually) merge it to master

This will kick off a Github action that will automatically bump the minor version of the library and publish to npm.

Run tests

To run tests you must first install react and react-dom as

yarn add -D react react-dom

Then yarn test.

Please do not include react(-dom) in your commit.

Use The Library

The Lune Theme

If your project uses MUI Theming, you should inject the Lune Theme object into the MUI Theme Provider

import { ThemeProvider } from '@material-ui/styles';
import { LuneTheme } from 'lune-ui-lib';

<ThemeProvider theme={LuneTheme}>
  <MyApp />
</ThemeProvider>

Add lune-ui-lib library to your project

This works like any other npm module. In your project:

$ yarn add lune-ui-lib

Then import the stuff you need eg:

import { Button } from 'lune-ui-lib';