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

quote-flow

v0.1.0

Published

Drop-in React widget for Shopify dimension-based pricing with live price updates and Draft Order checkout

Downloads

11

Readme

quote-flow

Drop-in React widget for Shopify dimension-based pricing with live price updates and Draft Order checkout.

Installation

npm install quote-flow

Peer Dependencies:

  • react ^18.0.0
  • react-dom ^18.0.0

Usage

import { PriceMatrixWidget } from 'quote-flow';

function ProductPage() {
  return (
    <PriceMatrixWidget
      apiUrl="https://your-app.example.com"
      apiKey="your-api-key"
      productId="gid://shopify/Product/1234567890"
      theme={{
        primaryColor: '#5c6ac4',
        borderRadius: '8px',
        fontSize: '14px'
      }}
      onAddToCart={(event) => {
        console.log('Draft Order created:', event.draftOrderId);
        console.log('Checkout URL:', event.checkoutUrl);
        // Optionally redirect to checkout
        window.location.href = event.checkoutUrl;
      }}
    />
  );
}

API

PriceMatrixWidget Props

| Prop | Type | Required | Description | |------|------|----------|-------------| | apiUrl | string | Yes | REST API base URL (e.g., "https://your-app.example.com") | | apiKey | string | Yes | API key for X-API-Key authentication | | productId | string | Yes | Shopify product ID (numeric string or gid:// format) | | theme | ThemeProps | No | Optional theme customization via CSS custom properties | | onAddToCart | (event: AddToCartEvent) => void | No | Callback fired when Draft Order is successfully created |

ThemeProps

All theme properties are optional. Each maps to a CSS custom property within the widget's Shadow DOM.

| Property | CSS Variable | Type | Default | Description | |----------|--------------|------|---------|-------------| | primaryColor | --pm-primary-color | string | #5c6ac4 | Primary button/accent color | | textColor | --pm-text-color | string | #202223 | Main text color | | borderColor | --pm-border-color | string | #c9cccf | Border color for inputs | | borderRadius | --pm-border-radius | string | 8px | Border radius for inputs and buttons | | fontSize | --pm-font-size | string | 14px | Base font size | | errorColor | --pm-error-color | string | #d72c0d | Error text color |

AddToCartEvent

Event payload passed to the onAddToCart callback when a Draft Order is successfully created.

| Property | Type | Description | |----------|------|-------------| | draftOrderId | string | Shopify Draft Order GID | | checkoutUrl | string | Customer-facing checkout URL | | price | number | Unit price from matrix | | total | number | Total price (unit price × quantity) | | dimensions | { width: number; height: number; unit: string; } | Dimensions used for pricing | | quantity | number | Quantity ordered |

Features

  • Shadow DOM CSS Isolation — Styles are scoped and won't conflict with your site's CSS
  • Live Price Calculation — Price updates as user enters dimensions and quantity
  • Draft Order Creation — Submits to Shopify Draft Order API with custom line items
  • Customizable Theming — Override colors, fonts, and spacing via theme props
  • TypeScript Support — Full type definitions included

Example: Redirect to Checkout

<PriceMatrixWidget
  apiUrl="https://your-app.example.com"
  apiKey="your-api-key"
  productId="gid://shopify/Product/1234567890"
  onAddToCart={(event) => {
    // Redirect user to Shopify checkout
    window.location.href = event.checkoutUrl;
  }}
/>

Example: Track Analytics

<PriceMatrixWidget
  apiUrl="https://your-app.example.com"
  apiKey="your-api-key"
  productId="gid://shopify/Product/1234567890"
  onAddToCart={(event) => {
    // Track conversion in your analytics
    analytics.track('Draft Order Created', {
      orderId: event.draftOrderId,
      total: event.total,
      dimensions: event.dimensions,
    });

    // Then redirect
    window.location.href = event.checkoutUrl;
  }}
/>

License

MIT