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

lwc-library

v0.0.4

Published

[![lwc-library](https://img.shields.io/npm/v/lwc-library.svg 'A badge that links to the lwc-library Web Component Library on NPM.JS')](https://www.npmjs.com/package/lwc-library)

Downloads

7

Readme

lwc-library

Usage

Until Salesforce integrates Node library support, the easiest way to use library components is just to copy them directly.

This can be done easily with the following command:

npx lwc-library <component-name> <destination-path>

This copies over the component along with required shared components.

List of Required Components

  • stylesShared (required)

Use --all or -a option to copy over all components.

npx lwc-library --all <destination-path>

Use --ignore or -i to ignore shared components.

npx lwc-library --ignore -c accordion (copy just the accordion - this will break!)

All Options

  • --component or -c to specify a component
  • --target or -t to specify a destination path
  • --all or -a to copy all components
  • --ignore or -i to ignore shared components
  • --help or -h to see all options

Contribution Guidelines

The main purpose of this library is to simplify components, ensure they are fully accessible, have a singular purpose. They are meant to be extensible rather than covering all use cases.

Install

Trying out bun.

bun install

This package is a major work-in-progress, but here is a general guide that outlines questions to ask:

New Component Recipe

  • Accessibility First
    • What will never change about the component?
    • What are the required structure and semantic tags?
    • What are the required ARIA attributes?
  • Functionality
    • What is the components singular purpose?
    • What is the structural layout? Are multiple s needed?
    • What are the functional variants?
    • Are there slots?
    • Does it make sense to abstract any logic or use a utility?
  • Application & Data
    • How does it react to a larger application and data?
    • What datasources does it subscribe to?
  • Style Base and Classes
    • What is the most basic / generic / opinionated style?
    • What are some binary customization options (CSS Classes)?
  • Style Customization
    • What are the ::part(s) to be defined?
    • What are the most obvious CSS Variables to add custom style?

CSS Variable Naming Conventions (WIP)

Theme-Level

Use single dashes for theme-level variables. These are variables that are used across the entire application. They are the base truth for the application.

Three Examples:

  • primary-color
  • secondary-color
  • background-color

Component-Level

Use BEM for component-level variables. These are variables that are used within a component. They read defaults from the theme-level variables (typically in a themeable.css file).

Three Examples:

  • button__primary-color
  • button__secondary-color
  • button__background-color