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

standards-ui

v1.34.0

Published

A foundational design system built with native Web Components. Includes comprehensive TypeScript types, JSDoc documentation, and component examples.

Readme

Design System - Web Components

GitHub Pages

🌐 View the Live Design System Site on GitHub Pages

A comprehensive design system built with native Web Components, featuring layout components and form elements with consistent styling and behavior.

Features

  • Native Web Components: Built using vanilla JavaScript and Web Components standards
  • Shadow DOM: Encapsulated styling with mode: 'open' for experimentation
  • CSS Custom Properties: Design tokens for consistent theming
  • Flexbox Layout: Responsive layout system with ds-row and ds-col
  • Form Components: Complete set of form elements with accessibility support
  • Customizable Design Tokens: Initialize with your own brand colors, spacing, and typography
  • Theme Switching: Dynamic theme switching with runtime token updates
  • TypeScript Support: Full TypeScript declarations for type safety
  • Storybook Integration: Interactive documentation and testing
  • JSDoc Documentation: Comprehensive API documentation
  • No Dependencies: Pure vanilla JavaScript implementation

Components

Layout Components

  • ds-page - Page container with consistent max-width and padding
  • ds-row - Flexbox row container with configurable alignment and spacing
  • ds-col - Flexbox column container with configurable growth and alignment

Form Components

  • ds-form - Form container with validation and accessibility support
  • ds-text-input - Text input with support for various input types
  • ds-button - Button component with variants and types
  • ds-radio - Radio button for single selection within groups
  • ds-checkbox - Checkbox for individual or grouped selections
  • ds-textarea - Multi-line text input
  • ds-select - Dropdown select with single/multiple selection
  • ds-option - Select option component
  • ds-label - Form label with association support
  • ds-fieldset - Form grouping container
  • ds-legend - Fieldset caption/title

Installation

npm install standards-ui

TypeScript Configuration

If you're using TypeScript, the library includes full type definitions. The JSX elements are automatically recognized by TypeScript when you import the library:

import { init } from "standards-ui";
import "standards-ui/styles.css";

All the custom web component elements like <ds-page>, <ds-button>, etc. are automatically recognized by TypeScript.

Quick Start

1. Initialize the Design System

import { init, DEFAULT_TOKENS } from "standards-ui";

// Initialize with default tokens
init(DEFAULT_TOKENS);

// Or customize with your own tokens
init({
  ...DEFAULT_TOKENS,
  color: {
    ...DEFAULT_TOKENS.color,
    primary: "#your-brand-color",
    secondary: "#your-secondary-color",
  },
  spacing: {
    ...DEFAULT_TOKENS.spacing,
    md: "20px",
  },
});

2. Use Components

Include the design system styles and components in your HTML:

<!DOCTYPE html>
<html lang="en">
  <head>
    <link rel="stylesheet" href="src/styles/styles.css" />
  </head>
  <body>
    <!-- Import components -->
    <script type="module" src="src/components/ds-page.js"></script>
    <script type="module" src="src/components/ds-row.js"></script>
    <script type="module" src="src/components/ds-col.js"></script>
    <script type="module" src="src/components/ds-text-input.js"></script>
    <!-- Import other components as needed -->

    <ds-page>
      <ds-row>
        <ds-col>
          <h1>My Application</h1>
        </ds-col>
      </ds-row>
    </ds-page>
  </body>
</html>

Listening to events

React

import React, { useEffect } from "react";
import { init } from "standards-ui";
import "standards-ui/styles.css";

// The JSX elements are automatically recognized by TypeScript

function App() {
  useEffect(() => {
    // Initialize the design system
    init();
  }, []);

  return (
    <ds-page>
      <ds-row>
        <ds-col>
          <ds-button>Click me</ds-button>
        </ds-col>
      </ds-row>
    </ds-page>
  );
}

Event Handling in React

import React, { useRef, useEffect } from "react";

function FormExample() {
  const inputRef = useRef(null);

  useEffect(() => {
    const input = inputRef.current;
    if (input) {
      const handleChange = (e) => {
        console.log("Value changed:", e.detail.value);
      };

      input.addEventListener("ds-change", handleChange);
      return () => input.removeEventListener("ds-change", handleChange);
    }
  }, []);

  return <ds-text-input ref={inputRef} placeholder="Enter text..." />;
}

TypeScript Support

The library includes full TypeScript support:

  1. JSX elements are automatically recognized by TypeScript
  2. All component props are properly typed
  3. No additional type imports needed

Angular

<ds-text-input
  (input)="onInput($event)"
  (change)="onChange($event)"
  (ds-change)="onDsChange($event)"></ds-text-input>

Vue

<ds-text-input @input="onInput" @change="onChange" @ds-change="onDsChange" />

Svelte

<ds-text-input
  on:input="{onInput}"
  on:change="{onChange}"
  on:ds-change="{onDsChange}" />

Testing

🧪 Zero-configuration Jest testing with true JSDOM compatibility!

Quick Jest Setup:

import { setupTesting } from "standards-ui/testing";
beforeAll(async () => await setupTesting());
// Now all ds-* components work perfectly in Jest/JSDOM!

Documentation

Design Tokens

The design system uses CSS custom properties for consistent theming:

Browser Support

  • Chrome 67+
  • Firefox 63+
  • Safari 10.1+
  • Edge 79+

Development

Project Structure

ai_design_system/
├── src/                     # Source code and components
│   ├── components/          # Web Components
│   ├── design_system/       # Design tokens and base styles
│   └── stories/             # Storybook stories
├── docs/                    # Documentation
├── plans/                   # Development plans and specifications
├── tests/                   # Test files

├── .storybook/              # Storybook configuration
├── .github/                 # GitHub workflows and templates
├── docs-output/             # JSDoc documentation output
├── storybook-static/        # Built Storybook files
├── node_modules/            # Dependencies
└── README.md

Available Scripts

  • npm start: Start development server
  • npm run storybook: Start Storybook
  • npm run build-storybook: Build Storybook for production
  • npm run generate-docs: Generate JSDoc documentation
  • npm run serve-docs: Generate docs and serve locally
  • npm test: Run tests (if configured)

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

License

This project is licensed under the MIT License.