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

@clarittyai/widget-toolkit

v1.1.4

Published

Apple-compliant widget toolkit for Clarity Platform - enforces iOS Human Interface Guidelines

Readme

@clarittyai/widget-toolkit

Apple-compliant widget toolkit for Clarity Platform - Enforces iOS Human Interface Guidelines automatically.

🎯 Overview

This package provides React components and utilities that enforce Apple's design standards for widgets, ensuring your widgets pass App Store review and feel native to iOS users.

📦 Installation

1. Configure GitHub Packages (One-Time Setup)

Create a GitHub Personal Access Token with read:packages permission:

  1. Go to https://github.com/settings/tokens
  2. Generate new token (classic)
  3. Select read:packages scope
  4. Copy the token

Add to ~/.npmrc:

@clarittyai:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=YOUR_GITHUB_TOKEN

2. Install Package

npm install @clarittyai/widget-toolkit

Peer Dependencies:

npm install react framer-motion tailwindcss

🚀 Quick Start

import {
  WidgetContainer,
  WidgetButton,
  widgetText,
  widgetGradients
} from '@clarittyai/widget-toolkit';

export default function MyWidget({ size = 'large' }: { size: 'small' | 'large' }) {
  return (
    <WidgetContainer
      size={size}
      padding="default"
      className={widgetGradients.sunset}
    >
      <div className="flex flex-col gap-3">
        <div className={widgetText.display}>42</div>
        <div className={widgetText.caption}>Active Users</div>

        {size === 'large' && (
          <WidgetButton variant="primary">
            View Details
          </WidgetButton>
        )}
      </div>
    </WidgetContainer>
  );
}

📐 Enforced Standards

Dimensions (Apple iOS Widget Sizes)

  • Small: 190×190px (1:1 ratio - iOS systemSmall)
  • Large: 400×190px (2.1:1 ratio - iOS systemLarge)

Spacing (Apple 8pt Grid)

  • Padding: 16px default (Apple's standard widget margin)
  • Internal gaps: 8px, 12px, 16px (multiples of 8)

Typography (Apple SF Pro Scale)

  • Display: 48px, weight 900 (large metrics)
  • Headline: 20px, weight 700 (titles)
  • Body: 14px, weight 500 (content)
  • Caption: 12px, weight 500 (minimum readable size)

Touch Targets (Apple Accessibility)

  • Buttons: Minimum 44×44px
  • Toggles: Minimum 48px wide

📚 Components

WidgetContainer

Enforces strict dimensions, padding, border radius, and overflow.

<WidgetContainer
  size="small" | "large"
  padding="default" | "compact" | "spacious"
  className="your-gradient-classes"
>
  {children}
</WidgetContainer>

WidgetButton

Enforces touch target sizes and Apple-style styling.

<WidgetButton
  variant="primary" | "secondary" | "ghost"
  size="default" | "large"
  onClick={handleClick}
>
  Button Text
</WidgetButton>

🎨 Utilities

widgetText

Typography scale matching Apple SF Pro:

import { widgetText } from '@clarittyai/widget-toolkit';

<div className={widgetText.display}>42</div>      // 48px, weight 900
<div className={widgetText.headline}>Title</div>  // 20px, weight 700
<div className={widgetText.caption}>Label</div>   // 12px, weight 500

widgetSpacing

Spacing utilities following 8pt grid:

import { widgetSpacing } from '@clarittyai/widget-toolkit';

<div className={widgetSpacing.padding.default}>   // p-4 (16px)
<div className={widgetSpacing.gap.normal}>        // gap-3 (12px)

widgetGradients

Apple-style gradient presets:

import { widgetGradients } from '@clarittyai/widget-toolkit';

<div className={widgetGradients.sunset}>    // Amber/Orange gradient
<div className={widgetGradients.ocean}>     // Blue/Cyan gradient
<div className={widgetGradients.lavender}>  // Indigo/Purple gradient

✅ Validation

Validate your widgets against Apple HIG:

npx @clarittyai/widget-toolkit validate widget/Widget.tsx

Checks:

  • ✅ Dimensions are exact (190×190 or 400×190)
  • ✅ Padding ≥ 12px
  • ✅ Font sizes ≥ 12px
  • ✅ Touch targets ≥ 44px
  • ✅ No advertising content
  • ⚠️ Warns about contrast ratios

📖 Full Documentation

🍎 Apple App Store Compliance

This toolkit enforces Apple's Human Interface Guidelines to ensure:

  • Widgets pass App Store review
  • Consistent user experience
  • Accessibility standards
  • Native iOS feel

📄 License

MIT © Clarity Platform