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

@a11y-gate/core

v0.1.2

Published

Retrofitting WCAG compliance onto legacy React components

Readme

@a11y-gate/core

Runtime React library for WCAG 2.1 Level AA compliance on legacy components.

Works as a non-invasive wrapper — no modifications to source files required.

Install

npm install @a11y-gate/core
# or
pnpm add @a11y-gate/core

Requirements

  • React >= 17
  • a11y-gate.config.json generated by @a11y-gate/cli

Usage

1. Wrap your app root with A11yGateProvider

// main.tsx or _app.tsx
import config from './a11y-gate.config.json';
import { A11yGateProvider } from '@a11y-gate/core';

export default function App() {
  return (
    <A11yGateProvider config={config}>
      {/* your app */}
    </A11yGateProvider>
  );
}

2. Wrap each legacy overlay component with Shield

import { Shield } from '@a11y-gate/core';

// Somewhere in your component tree
<Shield component="LegacyDrawer">
  <LegacyDrawer isOpen={open} onClose={close} title="Settings" />
</Shield>

The component prop must match a componentName in your a11y-gate.config.json.

What Shield does

| Feature | Behaviour | |---|---| | Focus trap | Traps Tab/Shift+Tab inside the overlay when triggerProp === true | | Escape key | Global listener calls closeHandler on the topmost active overlay | | Background inert | Applies aria-hidden + inert to rootSelector while any overlay is active | | Focus restore | Returns focus to the previously focused element when overlay closes | | Tab-order patching | Optionally adds reversible tabIndex=0 to legacy interactive elements | | Tab-order preview | Optionally shows numbered tab-order badges in development |

Tab-order preview and patching

Enable preview globally in a11y-gate.config.json:

{
  "version": "1",
  "tab_order_preview": true,
  "tab_order_preview_production": false,
  "tab_order_preview_scope": "both",
  "components": [
    {
      "componentName": "LegacyPopup",
      "componentType": "modal",
      "triggerProp": "isOpen",
      "closeHandler": "onClose",
      "rootSelector": "#root",
      "tabOrder": {
        "auto": true,
        "patches": [
          {
            "selector": "[data-action='close']",
            "role": "button",
            "label": "Close"
          }
        ]
      }
    }
  ]
}

tabOrder.auto uses conservative heuristics for legacy clickable markup such as [role="button"], [role="link"], [onclick], [data-action], [data-a11y-gate-tab], and visible pointer-style elements.

tabOrder.patches is the reliable path for ambiguous legacy DOM. It adds tabIndex=0 in DOM order, optional role, optional aria-label, and keyboard activation for Enter/Space. All changes are restored when the overlay closes.

The preview is development-only by default. Production preview requires both tab_order_preview: true and tab_order_preview_production: true.

tab_order_preview_scope controls where badges appear:

| Scope | Behaviour | |---|---| | overlay | Default. Show badges only inside active Shield overlays | | global | Show badges across the whole page, including header/footer links | | both | Show global page badges and active overlay badges |

Bundle size

~1.6kb gzipped (ESM). React is a peer dependency and not bundled.