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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@y-media/ring-builder

v0.7.7

Published

Reusable Ring Builder widget and Magento PWA integration package.

Readme

@y-media/ring-builder

Reusable Ring Builder widget package with adapters for Magento PWA Studio. The package ships three public submodules:

  • RingBuilderWidget
  • ...

Quick Start

yarn add @y-media/ring-builder
import { RingBuilderWidget } from "@y-media/ring-builder";

export function ProductPage() {
  return (
    <RingBuilderWidget
      ringBuilderUrl="https://erb.example.com"
      ringBuilderAssetsUrl="https://erb.example.com/assets"
      apiEndpoint="https://api-ringbuilderapp.example.com"
      baseUrl="/ring-builder"
      defaultConfigurationId="XXXXX"
      onReady={() => {
        console.log("Ring Builder is ready");
      }}
      onError={(error) => {
        console.error("Ring Builder error", error);
      }}
      onAddToCart={() => {
        console.log("Ring Builder add to cart");
      }}
      onExitHandler={() => {
        console.log("Ring Builder exit handler");
      }}
    />
  );
}

Props reference

| Prop | Type | Required | Description | | ------------------------ | -------------------------- | -------- | ------------------------------------------------------------------------ | | ringBuilderUrl | string | Yes | Public Ring Builder entry point. | | ringBuilderAssetsUrl | string | No | Override assets origin for embedded.js and CSS. | | apiEndpoint | string | Yes | REST or GraphQL endpoint used by the widget. | | baseUrl | string | Yes | Storefront base URL passed to the widget bootstrapper. | | defaultConfigurationId | string | No | Configuration SKU to preselect on first load. | | containerId | string | No | DOM id for the injected container (ring-builder-container by default). | | onReady | () => void | No | Fired after a successful mount in the browser. | | onError | (error: unknown) => void | No | Fired when embedded.js fails to load or export mount. | | onAddToCart | (data: unknown) => void | No | Fired when the user adds a product to the cart. | | onExitHandler | () => void | No | Fired when the user exits the widget. | | themeConfig | object | No | Theme configuration for the widget. |

SSR-safe rendering is handled internally; the widget only loads in the browser. Repeated mounts reuse the same script asset and call unmount when exposed by the widget runtime.

Theme Configuration Properties

| Property | Type | Description | | --------------------------------------- | -------------------- | ------------------------------------------------------------------------- | | primaryColor | string | Primary brand color used throughout the widget for accents and highlights | | primaryTextColor | string | Primary text color used throughout the widget | | stickyTopPosition.desktop | string | Top offset for sticky positioning on desktop viewports (e.g., '100px') | | stickyTopPosition.mobile | string | Top offset for sticky positioning on mobile viewports (e.g., '80px') | | fonts.heading | string | Font family name for headings | | fonts.body | string | Font family name for body text | | fonts.families | string[] | Google Fonts families with weights (e.g., ['Roboto:400,700']) | | fonts.url | string \| string[] | Custom font stylesheet URL(s) from Google Fonts, Adobe Fonts, etc. | | buttons.primary.* | object | Styling for primary buttons | | buttons.secondary.* | object | Styling for secondary buttons | | buttons.outlined.* | object | Styling for outlined buttons | | buttons.ghost.* | object | Styling for ghost buttons | | buttons.*.bgColor | string | Button background color | | buttons.*.textColor | string | Button text color | | buttons.*.hoverColor | string | Button background color on hover | | buttons.*.borderColor | string | Button border color | | buttons.*.roundSize | string | Button border radius (e.g., '4px') | | productCards.borderColor | string | Border color for product cards | | productCards.borderRoundSize | string | Border radius for product cards | | filtersAndOptions.roundSize | string | Border radius for filter and option elements | | filtersAndOptions.borderColor | string | Border color for filter and option elements | | filtersAndOptions.selectedBorderColor | string | Border color for selected filter and option elements | | panels.bgColor | string | Background color for panels | | panels.roundSize | string | Border radius for panels | | panels.borderColor | string | Border color for panels |

Magento PWA Studio usage (WIP)

Install the package inside your Venia project and wire the intercept target:

{
  "pwa-studio": {
    "targets": {
      "intercept": "./node_modules/@y-media/ring-builder/dist/magento-pwa-plugin/intercept.js"
    }
  }
}

Add the plugin to local-intercept.js if you prefer local overrides:

module.exports = (targets) => {
  const {
    intercept,
  } = require("@y-media/ring-builder/dist/magento-pwa-plugin/intercept.cjs");
  intercept(targets);
};

After running yarn build or yarn watch, Venia registers /ring-builder routed to the bundled Route component which renders RingBuilderWidgetMagento.

Magento adapter (WIP)

The adapter performs a single ringBuilderConfig GraphQL query and pipes values into the base widget. Extend the GraphQL document (src/magento-pwa-adapter/query.graphql) if your storefront exposes additional fields.

import { RingBuilderWidgetMagento } from "@y-media/ring-builder/magento-pwa-adapter";

export default function RingBuilderPage() {
  return <RingBuilderWidgetMagento />;
}

Override the loading or error experience by wrapping the component and inspecting the Apollo state (useQuery options are public in the source).