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

@puzzleitc/puzzle-shell

v4.2.4

Published

The standard design for Puzzle tools

Downloads

308

Readme

Puzzle Shell

Linting Storybook Build Software bill of materials (BOM)

The standard design for Puzzle tools as a set of Web Components.

The Puzzle Shell project strives for the following goals:

  • Integration of internal tools & solutions into the Puzzle identity
  • Uniform and consistent presentation with recognizability across tools & solutions
  • Providing a flexible construction kit without rigid specifications

Part of this project is the Puzzle Shell Storybook that lists and documents all Puzzle Shell components and contains usage examples.

Check out the changelog for the latest changes.

Usage

JavaScript Modules (ESM)

You can install this package with NPM:

npm i @puzzleitc/puzzle-shell

Or Yarn:

yarn add @puzzleitc/puzzle-shell

Or PNPM:

pnpm add @puzzleitc/puzzle-shell

Then, with a bundler like Vite, you can import the package in your main JavaScript file to include all components:

import "@puzzleitc/puzzle-shell";
import "@puzzleitc/puzzle-shell/style.css";

Or you can import specific components:

import "@puzzleitc/puzzle-shell/components/Topbar.js";
import "@puzzleitc/puzzle-shell/style.css";

// Only once

Either way the components are then ready to use in your markup:

<pzsh-topbar></pzsh-topbar>

We suggest to include the library this way if possible.

Bundled Version

Alternatively you can use a pre-bundled version of the Puzzle Shell that includes Lit as a carefree package. You can even reference the package from a NPM CDN (or self-serve it) and include it as follows:

<html>
  <head>
    <link
      rel="stylesheet"
      href="https://unpkg.com/@puzzleitc/puzzle-shell/dist/style.css"
    />
    <script
      type="module"
      src="https://unpkg.com/@puzzleitc/puzzle-shell/dist/bundle.js"
    ></script>
  </head>

  <body>
    <pzsh-container>
      <pzsh-topbar></pzsh-topbar>
      <main></main>
      <pzsh-footer></pzsh-footer>
    </pzsh-container>
  </body>
</html>

Linting etc.

To scan the project for linting or type errors, run:

npm run lint

To automatically fix many linting errors & reformat code using Prettier, run:

npm run lint:fix

To automatically generate the custom-elements.json manifest using the web-component-analyzer, run:

npm run manifest

Tryout Components with Storybook

To run a local instance of Storybook, run:

npm run storybook

To build a production version of Storybook, run:

npm run build-storybook

Customizing

Mobile/Desktop Breakpoint

The mobile/desktop breakpoint of the Puzzle Shell is at 800px per default. Below that screen width, the hamburger menu is displayed, paddings will change etc. To customize this breakpoint, you can set the global window.pzshBreakpoint property to another value before the Puzzle Shell import, e.g.:

<script>
  window.pzshBreakpoint = 1024;
</script>
<script
  type="module"
  src="/path/to/@puzzleitc/puzzle-shell/dist/puzzle-shell.js"
></script>

Publishing

To publish a new package version, do the following:

  • Build the library with npm run build
  • Execute npm run manifest to make sure the custom-elements.json manifest is up-to-date
  • Update the CHANGELOG.md
  • Bump the version with npm version (updates package.json and creates Git tag)
  • Execute npm publish to upload the new package version