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 🙏

© 2025 – Pkg Stats / Ryan Hefner

laif-ds

v0.2.61

Published

Design System di Laif con componenti React basati su principi di Atomic Design

Readme

PUBBLICARE:

npm login npm whoami (verifica se sei loggato con accoutn corretto) yarn build (farà partire build per tailwindv3 e tailwindv4) npm publish --access public

INSTALL:

npm i @laif/ds

HOW IT WORKS

Per vedere i componenti con storybook:

yarn storybook

Il comando esegue due operazioni in sequenza: prima compila il CSS con tailwindcss v4 salvandolo in un file output.css, poi avvia Storybook che utilizza questo file CSS precompilato. Questo approccio è necessario con Tailwind CSS v4 perché, a differenza delle versioni precedenti, v4 utilizza un'architettura "zero-runtime" che non si integra più direttamente con Storybook. La generazione separata del CSS è quindi la soluzione raccomandata per utilizzare Tailwind v4 con Storybook.

COME FUNZIONANO LE STORIES

Le stories in Storybook sono il modo in cui documentiamo e testiamo visivamente i nostri componenti. Ogni story rappresenta uno stato specifico di un componente.

Struttura di una Story

Una story è definita in un file con estensione .stories.tsx (o .stories.jsx per JavaScript) e segue questa struttura:

// button.stories.tsx
import type { Meta, StoryObj } from "@storybook/react";
import { Button } from "../ui/button";

// Metadati del componente
const meta = {
  title: "UI/Button", // Categoria/Nome nella sidebar di Storybook
  component: Button, // Il componente da documentare
  parameters: {
    layout: "centered", // Layout della preview
  },
  tags: ["autodocs"], // Genera automaticamente la documentazione
  argTypes: {
    // Definizione dei controlli per i props
    variant: {
      control: "select",
      options: [
        "default",
        "destructive",
        "outline",
        "secondary",
        "ghost",
        "link",
      ],
      description: "La variante visiva del bottone",
    },
    // Altri argTypes...
  },
} satisfies Meta<typeof Button>;

export default meta;
type Story = StoryObj<typeof meta>;

// Definizione delle singole stories
export const Default: Story = {
  args: {
    children: "Button",
    variant: "default",
    size: "default",
  },
};

export const Secondary: Story = {
  args: {
    children: "Button",
    variant: "secondary",
    size: "default",
  },
};

// Altre stories...

Come creare una nuova Story

  1. Crea un nuovo file nella directory src/components/stories/ con nome nome-componente.stories.tsx
  2. Importa il componente e le dipendenze necessarie
  3. Definisci i metadati con const meta = {...}
  4. Esporta i metadati con export default meta
  5. Definisci il tipo Story con type Story = StoryObj<typeof meta>
  6. Crea le diverse varianti del componente esportando costanti di tipo Story

Colors

Qui è definito il tema base di laif. Sovrascrivibile nel progetto che lo implementa. Per farlo basta cambiare i valori delle variabili. Di seguito sono importati 3 temi per demostrazione generati con (https://tweakcn.com/editor/theme)