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

leno-shared-components

v1.2.9

Published

Shared components for Leno projects

Downloads

243

Readme

Repository for all Leno projects' shared components

Local Development

To use locally:

  1. git clone [email protected]:lenoit/leno-shared-components.git
  2. run npm i
  3. Navigate to project that will use this package
  4. run npm install --save ../path/to/this/repo*
  5. Navigate to your tailwind.config.ts (if one isn't present, you can run npx tailwindcss init)
  6. Alter your config like this:
import tailwindConfig from "path/to/leno-components";

const config: Config = {
  ...tailwindConfig,
  content: [
    "./pages/**/*.{js,ts,jsx,tsx,mdx}",
    "./components/**/*.{js,ts,jsx,tsx,mdx}",
    "./app/**/*.{js,ts,jsx,tsx,mdx}",
    "/path/to/leno-components/src/**/*.{jsx,tsx,js,ts,config}",
  ],
};

This should allow you to use the tailwind.config provided from the package in your project.

Please note, that this will also allow access to ALL custom styles or animations from the package.


Installing the package normally

  1. Navigate to your project's directory
  2. run npm i leno-shared-components
  3. Start coding!

Publishing the library

  1. Open the package directory (leno-shared-components)
  2. Change whatever needs changing
  3. Open package.json and find the following line ("version": "1.0.1")
  4. Increment the version number appropriately:
    • small changes - last number
    • medium changes (component additions, etc) - second last number
    • major changes (big changes to entire design) - first number
  5. run npm publish

Using the Button component

Currently the library holds only a button component. To use it in it's most basic variant write:

<Button text={'test'} />

Icons can be added on the left/right side of the button with the iconLeft and iconRight properties. Please Note these properties only take a React.ReactElement so be sure to wrap any SVGs you send in a component

Colors and sizes can be added with the color and size props. Values currently include primary, error, warning, neutral and sm,md,lg,xl respectively.

If anything even more specific is required. A prop called btnClassNames is added. This will allow you to pass and classes (incl. tailwind ones) to the button.