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

@foxy.io/elements

v1.34.0

Published

E-commerce web components by Foxy.

Downloads

386,088

Readme

Foxy Elements 🦊🏗

Collection of web components powering the new front-end functionality at Foxy with built-in i18n and theming. Works with React, Vue, Svelte and more – or just on its own. Built with LitElement, Tailwind and Vaadin.

You can view all the components in various states, with plenty of examples, at elements.foxy.dev.

Getting started

If you're targeting browsers that support ES6, you can use modules to get started with no additional setup:

<!-- 1. Load polyfills (optional); -->
<script src="https://unpkg.com/@webcomponents/webcomponentsjs@^2/webcomponents-bundle.js"></script>

<!-- 2. Load element (replace "foxy-donation" with the one you need or add more script tags); -->
<script
  type="module"
  src="https://unpkg.com/@foxy.io/elements@1/dist/cdn/foxy-donation.js"
></script>

<!-- 3. Use the element anywhere on your page. -->
<foxy-donation></foxy-donation>

When using a bundler, you have an option of registering elements with a custom name whenever it works for you in your use case. All public elements are available as named exports (PascalCase, no "Foxy" prefix).

import { Donation } from '@foxy.io/elements';
customElements.define('my-donation', Donation);

This also works great with the ScopedElementsMixin by open-wc.org:

import { ScopedElementsMixin } from '@open-wc/scoped-elements';
import { Donation } from '@foxy.io/elements';

class MyElement extends ScopedElementsMixin(LitElement) {
  static get scopedElements() {
    return {
      'my-donation': Donation,
    };
  }
}

Please keep in mind that with this approach you'll also need to take care of loading polyfills and applying necessary optimizations before deploying to production.

If you use es-dev-server, you might run into a few issues depending on the components you import – those are most likely caused by how xstate is processed by the server. We've made a number of plugins (one, two, three) to battle that. They're a bit hacky and may not work in every scenario, so we are not going to publish them on npm, but you can still use them as a starting point to bring your setup back in action.

Development

To run this project locally, you'll need Node.JS installed on your machine. If you don't have it already, we suggest getting the latest LTS release from nodejs.org. Additionally, you can update npm (comes with Node.JS) to the latest version by running the following command in your Terminal:

npm install npm@latest -g

Once that's done, clone or download this repository, switch to the folder you placed it in and install the dependencies with npm:

npm install

There's a number of useful scripts that you might need:

  • npm run storybook runs Storybook;
  • npm run format fixes style errors in your code;
  • npm run lint shows style errors in your code;
  • npm run test runs all test suites with Karma;
  • npm run test:watch -- --group foxy-attribute-card runs tests in watch mode for a specific element;
  • npm run wca generates docs for element slots and attributes;
  • npm run generate-schemas generates JSONSchemas for element translations based on English i18n files;
  • npm run generate-groups generates test groups for elements;

Note: depending on the hardware, some tests may start failing with a timeout error when running the entire test suite with npm run test. If that happens on your machine, try running tests for individual elements instead with npm run test -- --group element-name.