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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@pact-toolbox/wallet-ui

v0.1.0

Published

Cross-framework wallet UI components for pact-toolbox

Downloads

4

Readme

@pact-toolbox/wallet-ui

Cross-framework wallet UI components for pact-toolbox. Provides a wallet selection modal for connecting to various Kadena wallets.

Features

  • 🎨 Cross-Framework: Works with React, Vue, Angular, and vanilla JavaScript
  • 🔌 Auto-Connect: Support for automatic wallet connection
  • 🎯 Web Components: Built with LitElement for true framework independence
  • 🌙 Theme Support: Light/dark themes with CSS variables

Installation

npm install @pact-toolbox/wallet-ui

Quick Start

Vanilla JavaScript

import { ModalManager } from "@pact-toolbox/wallet-ui";

// Initialize modal manager
const modalManager = ModalManager.getInstance();
modalManager.initialize();

// Show wallet selector
const walletId = await modalManager.showWalletSelector();
if (walletId) {
  await modalManager.connectWallet(walletId);
}

React

import { WalletModalProvider, ConnectWalletButton } from "@pact-toolbox/wallet-ui/react";

function App() {
  return (
    <WalletModalProvider>
      <ConnectWalletButton onConnect={(walletId) => console.log("Connected:", walletId)} />
      {/* Your app components */}
    </WalletModalProvider>
  );
}

Vue

<script setup>
import { provideWalletModal, useWalletSelector } from "@pact-toolbox/wallet-ui/vue";

// In root component
provideWalletModal();

// In any child component
const { openSelector, isOpen, error } = useWalletSelector();

const connectWallet = async () => {
  const walletId = await openSelector();
  if (walletId) {
    console.log("Connected:", walletId);
  }
};
</script>

<template>
  <button @click="connectWallet" :disabled="isOpen">
    {{ isOpen ? "Connecting..." : "Connect Wallet" }}
  </button>
</template>

Angular

import { Component } from "@angular/core";
import { WalletModalService, ConnectWalletComponent } from "@pact-toolbox/wallet-ui/angular";

@Component({
  selector: "app-root",
  standalone: true,
  imports: [ConnectWalletComponent],
  template: `
    <pact-connect-wallet (connected)="onWalletConnected($event)" (connectionError)="onError($event)" />
    <p>Wallet Open: {{ walletModal.isOpen() }}</p>
    <p>Current Theme: {{ walletModal.theme() }}</p>
  `,
})
export class AppComponent {
  constructor(public walletModal: WalletModalService) {
    // Initialize with options
    walletModal.initialize({
      modalOptions: { theme: "dark" },
    });
  }

  onWalletConnected(walletId: string) {
    console.log("Connected:", walletId);
  }

  onError(error: Error) {
    console.error("Connection failed:", error);
  }
}

Components

Web Components

All components are registered automatically when you import the package:

  • <pact-wallet-modal> - Base modal container
  • <pact-wallet-selector> - Wallet selection grid
  • <pact-wallet-connect> - Connect wallet button

Modal Manager

The ModalManager class provides programmatic control:

import { ModalManager } from "@pact-toolbox/wallet-ui";

const modalManager = ModalManager.getInstance();

// Initialize the modal manager
modalManager.initialize();

// Show wallet selector
const walletId = await modalManager.showWalletSelector();

// Connect to a wallet
const success = await modalManager.connectWallet(walletId);

// Set theme
modalManager.setTheme("dark");

// Cleanup when done
modalManager.cleanup();

Framework Adapters

React

import {
  WalletModalProvider,
  useWalletModal,
  ConnectWalletButton,
  AutoConnectWallet,
} from "@pact-toolbox/wallet-ui/react";

// Provider setup
function App() {
  return (
    <WalletModalProvider modalOptions={{ theme: "dark" }}>
      <YourApp />
    </WalletModalProvider>
  );
}

// Using the hook
function YourComponent() {
  const { showWalletSelector, setTheme } = useWalletModal();

  const handleConnect = async () => {
    const walletId = await showWalletSelector();
    console.log("Selected:", walletId);
  };

  return <button onClick={handleConnect}>Connect</button>;
}

Theming

Customize the appearance with CSS variables. The components use the theme system from @pact-toolbox/ui-shared:

/* Light theme (default) */
[data-theme="light"] {
  --pact-bg-primary: #ffffff;
  --pact-text-primary: #000000;
  --pact-brand-primary: #0066cc;
  /* ... see @pact-toolbox/ui-shared for all variables */
}

/* Dark theme */
[data-theme="dark"] {
  --pact-bg-primary: #1e293b;
  --pact-text-primary: #f1f5f9;
  --pact-brand-primary: #60a5fa;
}

Advanced Usage

Custom Modal Container

const modalManager = new ModalManager({
  containerId: "my-modal-root",
  theme: "dark",
});

Manual Wallet Connection

const modalManager = ModalManager.getInstance();

// Show selector
const walletId = await modalManager.showWalletSelector();

// Connect
if (walletId) {
  const success = await modalManager.connectWallet(walletId);
  if (success) {
    console.log("Connected successfully");
  }
}

Browser Support

  • Chrome/Edge 89+
  • Firefox 63+
  • Safari 14+

For older browsers, include the Web Components polyfill:

<script src="https://unpkg.com/@webcomponents/[email protected]/webcomponents-loader.js"></script>

License

MIT