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

hanna-simple-ui

v0.0.2

Published

스토리북 사용법

Readme

스토리북 사용법

  1. npx storybook init
  2. npm i -D vite-tsconfig-paths
    • 만약 Vite 프로젝트에서 TypeScript를 사용하고 있고, paths 옵션을 사용하여 모듈을 참조하려면 vite-tsconfig-paths 패키지를 설치하여 설정해야 합니다.
    • .storybook>main.ts에 아래 코드 추가
 docs: {
        autodocs: "tag",
    },
    viteFinal: async (config) => {
        config.plugins?.push(
            tsconfigPaths({
                projects: [
                    path.resolve(path.dirname(__dirname), "tsconfig.json"),
                ],
            })
        );
        return config;
    },
  1. 라이브러리 설치
  • clsx 라이브러리 사용
    • 컴포넌트의 클래스 이름을 동적으로 결합하고 관리하는 과정을 단순화
    • 객체나 배열을 입력으로 받아, 조건부로 클래스 이름을 생성
  • tailwind-merge 라이브러리 사용
    • 스타일 충돌 없이 JS에서 Tailwind CSS 클래스들을 병합할 수 있게 해주는 유틸 함수
    • 충돌하는 클래스 명만 덮어쓰고 다른 것들은 그대로 남겨둠
  • class-variance-authority 라이브러리 사용
    • tailwind의 동적 스타일링에 도움을 주는 라이브러리
  1. components>만들 컴포넌트 폴더>index.ts와 index.stories.tsx 파일 생성
    • index.stories.tsx에 아래와 같이 코드 넣기
import type { Meta, StoryObj } from "@storybook/react";
import { Button } from ".";

const meta: Meta<typeof Button> = {
    title: "Components/Button",
    component: Button,
    parameters: {
        layout: "centered",
    },
    tags: ["autodocs"],
};

export default meta;

type Story = StoryObj<typeof meta>;

export const Default: Story = {
    args: {
        children: "Click me",
    },
};
  1. utils폴더의 index.tsx에 아래의 코드넣기
import clsx, { ClassValue } from "clsx";
import { twMerge } from "tailwind-merge";

export const cn = (...classes: ClassValue[]) => twMerge(clsx(classes));
  1. .vscode>setting.json: tailwindCSS.experimental.classRegex 코드 추가
{
    "powermode.explosions.duration": 1000,
    "editor.codeActionsOnSave": {
        "source.fixAll.eslint": true,
        "source.organizeImports": true
    },
    "editor.formatOnSave": true,
    "editor.defaultFormatter": "esbenp.prettier-vscode",
    "tailwindCSS.experimental.classRegex": [
        ["cva\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"],
        ["cx\\(([^)]*)\\)", "(?:'|\"|`)([^']*)(?:'|\"]`)"]
    ]
}

reference:https://github.com/CodeWithGionatha-Labs/hanna-simple-ui

Library final build

  1. npm i -D vite-plugin-dts

  2. package.json 에 코드 추가

    "files": [
       "dist"
   ],
   "main": "dist/hanna-simple-ui-umd.cjs",
   "module": "dist/hanna-simple-ui.js",
   "exports": {
       ".": {
           "import": "./dist/hanna-simple-ui.js",
           "require": "./dist/hanna-simple-ui-umd.cjs"
       }
   },