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

@dorian-ui/my-ui-lib

v0.2.3

Published

Design System React + Tailwind + Vite + TypeScript — by Dorian

Readme

🎨 @dorian-ui/my-ui-lib

Design System React + Tailwind + Vite + TypeScript — créé par Dorian

Un Design System modulaire et extensible, conçu pour être utilisé tel quel ou personnalisé via des Design Tokens JSON. Basé sur TailwindCSS, React 18, et un pipeline Style Dictionary pour gérer les thèmes light/dark.


🚀 Installation

pnpm add @dorian-ui/my-ui-lib
# ou
npm install @dorian-ui/my-ui-lib

🧱 Utilisation de base

Importer les styles globaux :

import '@dorian-ui/my-ui-lib/style.css'

Importer et utiliser les composants :

import { Button, Card, Typography } from '@dorian-ui/my-ui-lib'

export default function App() {
  return (
    <Card>
      <Typography.Heading level={2}>Hello My UI Lib!</Typography.Heading>
      <Button intent="primary">Click me</Button>
    </Card>
  )
}

🌗 Gestion du thème (light/dark)

Tu peux basculer dynamiquement entre les thèmes générés grâce à la fonction applyTheme() :

import { applyTheme } from '@dorian-ui/my-ui-lib/theme/applyTheme'

applyTheme('dark') // ou 'light'

Ceci applique automatiquement les variables CSS de ton thème (themes.css, dark.css, light.css).


🧩 Structure du Design System

| Dossier | Description | |-----------------------------|--------------------------------------------------------| | src/components/ui/ | Composants UI (Button, Card, Badge, etc.) | | src/components/layout/ | Composants de layout (Grid, Container, Section, Stack) | | src/components/utilities/ | Avatars, Dividers, Icons, etc. | | theme/ | Gestion des thèmes, tokens compilés et config Tailwind | | tokens/ | Design Tokens sources (JSON) | | tools/ | CLI + Template de génération | | scripts/ | Script build-tokens.mjs pour régénérer le thème |


🧪 Commandes principales

🧩 Développement local

pnpm run dev

Lance Vite avec un environnement de démo local.


🗷️ Build complet (lib + tokens + types)

pnpm run build
  • Génère les tokens (theme/tokens-build/*)
  • Compile la lib en ESM + CJS (dist/)
  • Génère les types TypeScript (dist/types)

🎨 Générer les tokens uniquement

pnpm run build:tokens
  • Compile tous les JSON dans tokens/

  • Produit :

    • theme/tokens-build/tailwind.tokens.js
    • theme/tokens-build/css/ (light/dark)
    • theme/tailwind.config.mjs

🧪 Tester la lib dans un autre projet localement

pnpm run pack:local

Cette commande :

  1. Build la lib
  2. Crée un .tgz
  3. Copie le package dans ton projet ../my-landing/
  4. Installe automatiquement le paquet

Tu peux alors tester :

import { Button } from '@dorian-ui/my-ui-lib'

🎨 Personnalisation du Design System

Le Design System est basé sur des tokens JSON. Tu peux modifier les fichiers du dossier :

tokens/
├─ global/
│  ├─ color.json
│  ├─ spacing.json
│  ├─ typography.json
│  └─ ...
├─ semantic/
│  └─ color.json
└─ themes/
   ├─ light.json
   └─ dark.json

Puis relancer :

pnpm run build:tokens

💥 Les CSS, variables et config Tailwind seront régénérées automatiquement.


🧱 Fichiers importants

| Fichier | Rôle | |------------------------------------------------|--------------------------------------------------------------| | theme/tailwind.config.mjs | Config Tailwind générée automatiquement à partir des tokens | | theme/applyTheme.ts | Fonction d’application de thème runtime | | tools/cli.mjs | CLI pour re-générer les tokens | | tools/templates/tailwind.config.template.mjs | Template utilisé pour générer la config Tailwind | | scripts/build-tokens.mjs | Script de build appelé par la CLI et pnpm run build:tokens |


🧬 Exemple d’architecture générée après build

theme/
├── applyTheme.ts
├── tailwind.config.mjs
└── tokens-build/
    ├── tailwind.tokens.js
    └── css/
        ├── light.css
        ├── dark.css
        └── themes.css

⚙️ API CLI

📦 Générer les tokens

npx my-ui-lib --tokens=./tokens --themes=light,dark

🧰 Arguments

| Flag | Description | Par défaut | |------------|-------------------------------|------------------------| | --tokens | Dossier des tokens à compiler | ./tokens | | --output | Dossier de sortie | ./theme/tokens-build | | --themes | Liste des thèmes à générer | light,dark |


🧑‍💻 Pour les contributeurs

1️⃣ Cloner et installer :

git clone https://github.com/dorian-ui/my-ui-lib.git
cd my-ui-lib
pnpm install

2️⃣ Lancer la démo :

pnpm run dev

3️⃣ Modifier les composants ou tokens :

  • Les composants se trouvent dans src/components/
  • Les tokens dans tokens/

4️⃣ Rebuild :

pnpm run build

🧪 Stack technique

  • Vite 5
  • 💅 TailwindCSS 3
  • 🧠 React 18 + TypeScript
  • 🎨 Style Dictionary pour la génération des tokens
  • 🧰 Storybook 8 (en option)
  • 🧱 pnpm pour la gestion mono-repo rapide

📄 Licence

MIT © Dorian Libre d’utilisation, de modification et de distribution.