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

@alsaeedfayed/ui-test-lib

v1.1.0

Published

Design System — tokens, mixins, and React components

Readme

@alsaeedfayed/ui-test-lib

Design System package — design tokens (colors, spacing, radii, shadows), SCSS mixins, Tailwind CSS configuration, and React components (Button, Card, Input).

Built to be installed across microfrontend apps so every app shares the same visual language.


Architecture

The design system has 3 layers that chain together:

SCSS Tokens (_colors.scss, _sizes.scss)
    ↓  raw values ($color-primary: #6366f1)
CSS Custom Properties (global.css)
    ↓  runtime bridge (--ebs-primary: #6366f1)
Tailwind Config (tailwind.config.js)
    ↓  class names (bg-primary → var(--ebs-primary) → #6366f1)
React Components (Button, Card, Input)
  • SCSS tokens — source of truth, usable via @use in .scss files
  • CSS custom properties — bridge tokens to the browser, enable runtime theming
  • Tailwind config — maps CSS vars to utility classes like bg-primary, text-muted-foreground, rounded-lg
  • React components — pre-built UI components using the above tokens via Tailwind

Project Structure

src/
├── components/
│   ├── Button/          # CVA-based button (6 variants, 4 sizes)
│   ├── Card/            # Card + CardHeader, CardTitle, CardDescription, CardContent, CardFooter
│   └── Input/           # Input with label and error support
├── lib/
│   └── utils.ts         # cn() helper (clsx + tailwind-merge)
├── tokens/
│   ├── _colors.scss     # Color tokens (brand, neutral, semantic, surface)
│   └── _sizes.scss      # Spacing, radii, font sizes, weights, shadows, transitions
├── mixins/
│   └── _index.scss      # SCSS mixins (flex-center, card, focus-ring, button-base, etc.)
├── styles/
│   └── global.css       # CSS custom properties (:root vars)
└── index.ts             # Package entry point

playground/               # Local dev playground (not published)
tailwind.config.js        # Shared Tailwind theme config (published)
tsup.config.ts            # Build config

Scripts

# Install dependencies
pnpm install

# Build the package (CJS + ESM + types + CSS)
pnpm build

# Build in watch mode during development
pnpm dev

# Run the playground (live demo at http://localhost:3100)
pnpm playground

# Build the playground for static hosting
pnpm playground:build

# Type-check without emitting
pnpm lint

# Remove dist folder
pnpm clean

Publishing

The package is published publicly to npmjs.com under the @alsaeedfayed org.

# Make sure you're logged in
npm whoami

# Build first
pnpm build

# Publish (access: public is configured in package.json)
npm publish --access public

# To publish a new version, bump the version first
npm version patch   # 1.0.0 → 1.0.1
npm version minor   # 1.0.0 → 1.1.0
npm version major   # 1.0.0 → 2.0.0
npm publish --access public

Usage in Microfrontend Apps

1. Install

npm install @alsaeedfayed/ui-test-lib

2. Import the global CSS (required)

This loads the CSS custom properties that power all the tokens:

// In your app's entry file (main.tsx or App.tsx)
import "@alsaeedfayed/ui-test-lib/styles";

3. Extend your Tailwind config

// tailwind.config.js
const libConfig = require("@alsaeedfayed/ui-test-lib/tailwind");

module.exports = {
  content: [
    "./src/**/*.{ts,tsx}",
    // Scan the library's components so Tailwind generates their classes
    "./node_modules/@alsaeedfayed/ui-test-lib/dist/**/*.{js,mjs}",
  ],
  theme: {
    extend: {
      ...libConfig.theme.extend,
    },
  },
};

4. Use the components

import { Button, Card, CardHeader, CardTitle, CardContent, Input } from "@alsaeedfayed/ui-test-lib";

function MyPage() {
  return (
    <Card>
      <CardHeader>
        <CardTitle>Sign In</CardTitle>
      </CardHeader>
      <CardContent className="space-y-4">
        <Input label="Email" type="email" placeholder="[email protected]" />
        <Input label="Password" type="password" />
        <Button className="w-full">Sign In</Button>
        <Button variant="outline" className="w-full">Cancel</Button>
      </CardContent>
    </Card>
  );
}

5. Use SCSS tokens & mixins (optional)

If your app uses SCSS, you can import tokens and mixins directly:

@use "@alsaeedfayed/ui-test-lib/src/tokens" as t;
@use "@alsaeedfayed/ui-test-lib/src/mixins" as m;

.my-component {
  color: t.$color-primary;
  @include m.flex-center;
  @include m.focus-ring;
}

Available Components

Button

<Button>Default</Button>
<Button variant="secondary">Secondary</Button>
<Button variant="destructive">Destructive</Button>
<Button variant="outline">Outline</Button>
<Button variant="ghost">Ghost</Button>
<Button variant="link">Link</Button>

<Button size="sm">Small</Button>
<Button size="default">Default</Button>
<Button size="lg">Large</Button>
<Button size="icon"><Icon /></Button>

<Button disabled>Disabled</Button>

Card

<Card>
  <CardHeader>
    <CardTitle>Title</CardTitle>
    <CardDescription>Description text</CardDescription>
  </CardHeader>
  <CardContent>Body content</CardContent>
  <CardFooter>Footer actions</CardFooter>
</Card>

Input

<Input label="Email" type="email" placeholder="[email protected]" />
<Input label="Username" error="Must be at least 3 characters" />
<Input disabled placeholder="Disabled input" />

Design Tokens

Colors

| Token | CSS Variable | Tailwind Class | Value | |-------|-------------|----------------|-------| | $color-primary | --ebs-primary | bg-primary, text-primary | #6366f1 | | $color-secondary | --ebs-secondary | bg-secondary, text-secondary | #0ea5e9 | | $color-destructive | --ebs-destructive | bg-destructive, text-destructive | #ef4444 | | $color-success | --ebs-success | bg-success, text-success | #22c55e | | $color-warning | --ebs-warning | bg-warning, text-warning | #f59e0b | | $color-info | --ebs-info | bg-info, text-info | #3b82f6 | | $color-background | --ebs-background | bg-background | #ffffff | | $color-foreground | --ebs-foreground | text-foreground | #0f172a | | $color-muted | --ebs-muted | bg-muted, text-muted-foreground | #f1f5f9 | | $color-border | --ebs-border | border-border | #e2e8f0 |

Border Radius

| Tailwind Class | CSS Variable | Default Value | |---------------|-------------|---------------| | rounded-lg | --ebs-radius | 0.5rem | | rounded-md | calc(--ebs-radius - 2px) | 0.375rem | | rounded-sm | calc(--ebs-radius - 4px) | 0.25rem |


Peer Dependencies

These must be installed in the consuming app:

  • react ^18.2.0
  • react-dom ^18.2.0
  • tailwindcss ^3.3.0