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

@planningcenter/sweetest-alert

v0.3.4

Published

The sweetest alert ever

Readme

sweetest-alert

⚠️ Not Production Ready This package is currently under development and not yet ready for production use. APIs may change without notice.

A lightweight, React alert/modal dialog component that replaces SweetAlert2 with a custom implementation using native HTML dialog elements.

Installation

yarn add @planningcenter/sweetest-alert

In your product’s main CSS file (ex. app/assets/stylesheets/application.css) add sweetest_alert.css:

@import "@planningcenter/tapestry/dist/index.css";
``

### Peer Dependencies

This package requires the following peer dependencies:

- `react` ^18.3.1
- `react-dom` ^18.3.1
- `@planningcenter/tapestry` ^2.3.0
- `@planningcenter/icons` ^15.25.0

## Usage

### Basic Example

```jsx
import { SweetestAlert } from '@planningcenter/sweetest-alert'

// Simple notification
SweetestAlert({
  title: "Warning!",
  content: "Watch out, he’s coming to get you!",
})

Confirmation Dialog

SweetestAlert({
  type: "danger",
  title: "Delete Item",
  content: "Are you sure you want to delete this item?",
  confirm: () => console.log("Confirmed"),
  cancel: () => console.log("Cancelled")
})

Alert Types

The component supports five visual types:

// Info alert
SweetestAlert({
  type: "info",
  title: "Information",
  content: "This is an informational message."
})

// Success alert
SweetestAlert({
  type: "success",
  title: "Success!",
  content: "Operation completed successfully."
})

// Warning alert (default)
SweetestAlert({
  type: "warning",
  title: "Warning",
  content: "Please proceed with caution."
})

// Error alert
SweetestAlert({
  type: "error",
  title: "Error",
  content: "Something went wrong."
})

// Danger alert (for destructive actions)
SweetestAlert({
  type: "danger",
  title: "Delete Account",
  content: "This action cannot be undone.",
  confirmButton: "Delete"
})

Custom Content

You can pass React components as content for rich formatting:

SweetestAlert({
  title: "Custom Content",
  content: (
    <>
      <p>You can include any React elements:</p>
      <ul>
        <li>Lists</li>
        <li>Links</li>
        <li>Formatted text</li>
      </ul>
    </>
  )
})

API

Parameters

| Parameter | Type | Required | Default | Description | |-----------|------|----------|---------|-------------| | title | string | Yes | - | The main heading text displayed at the top of the modal | | content | string \| React.ReactNode | Yes | - | The body content. Accepts plain text or React components | | type | "info" \| "success" \| "error" \| "danger" \| "warning" | No | "warning" | The visual type of alert, affects icon and styling | | confirm | () => void | No | - | Callback executed when confirm button is clicked | | cancel | () => void | No | - | Callback executed when cancel button is clicked | | confirmButton | string | No | "Okay" | Custom text for the confirm button | | hideCancel | boolean | No | false | When true, hides the cancel button for simple notifications |

Development

Running the Demo

To run the interactive demo locally:

# Install dependencies
yarn install

# Start the development server
yarn dev

Then open your browser to the URL shown in the terminal (typically http://localhost:5173). The demo showcases all alert types and features with interactive buttons.

Running Tests

The project uses Vitest for testing:

# Run tests once
yarn test

# Run tests in watch mode
yarn test --watch

Linting

# Lint JavaScript/TypeScript files
yarn lint:js

# Lint CSS files
yarn lint:css

License

MIT