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

hanheel-modal-payments

v0.0.14

Published

우아한테크코스 payments 모달

Readme

📦 Modal 컴포넌트

우아한테크코스 components 모듈 배포 실습용 조립형 모달 컴포넌트입니다.
isOpen, handleCloseModal과 함께 내부 구조를 구성할 수 있는 여러 컴포넌트를 제공하여, 유연하게 레이아웃을 조합할 수 있습니다.


✨ Features

  • Compound Component Pattern 기반 구조 제공
  • Modal.Title, Modal.Content, Modal.CloseButton조립 가능한 서브 컴포넌트
  • 가운데 또는 하단 위치 지정 가능 ("center", "bottom")
  • 외부 영역 클릭 및 키보드 이벤트로 모달 닫기 지원
  • React + TypeScript 기반

📦 설치

npm install @woowacourse/modal
# 또는
yarn add @woowacourse/modal

♿️ 키보드 접근성을 위한 FocusTrap

모달 내에서 키보드(Tab 키)로 포커스를 순환하도록 제한합니다. 키보드 포커스 제어가 필요한 컴포넌트를 직접 래핑하여 사용할 수 있습니다. Shift + Tab 또는 Tab 키를 누를 때 포커스가 순환되며 모달 외부로 벗어나지 않습니다.

<Modal isOpen={isOpen} onModalClose={handleCloseModal}>
  <Modal.Background onClick={handleCloseModal} />
  <Modal.ModalContainer $position="center" $size="large">
    <Modal.ModalFocusTrap>
      <Modal.Title>접근성 테스트</Modal.Title>
      <Modal.ModalContent>
        <input type="text" placeholder="이름" />
        <button>확인</button>
      </Modal.ModalContent>
    </Modal.ModalFocusTrap>
  </Modal.ModalContainer>
</Modal>

🧩 사용 예시

🧪 사용 예제

✅ Alert 모달 (확인만 있는 단순 메시지)

<Modal isOpen={isOpen} onModalClose={handleModalClose}>
  <Modal.Background onClick={handleModalClose} />
  <Modal.ModalContainer $position="center" $size="medium">
    <Modal.Title>알림</Modal.Title>
    <Modal.ModalContent>
      카드 정보가 정상적으로 저장되었습니다.
    </Modal.ModalContent>
    <Modal.ModalButtonContainer>
      <Modal.ModalButton onClick={handleModalClose}>확인</Modal.ModalButton>
    </Modal.ModalButtonContainer>
  </Modal.ModalContainer>
</Modal>

✅ Confirm 모달 (확인 + 취소 버튼 제공)

<Modal isOpen={isOpen} onModalClose={handleModalClose}>
  <Modal.Background onClick={handleModalClose} />
  <Modal.ModalContainer $position="center" $size="medium">
    <Modal.Title>카드 삭제</Modal.Title>
    <Modal.ModalContent>이 카드를 정말 삭제하시겠습니까?</Modal.ModalContent>
    <Modal.ModalButtonContainer>
      <Modal.ModalButton onClick={handleConfirm}>확인</Modal.ModalButton>
      <Modal.ModalButton onClick={handleModalClose}>취소</Modal.ModalButton>
    </Modal.ModalButtonContainer>
  </Modal.ModalContainer>
</Modal>

✅ Prompt 모달 (입력 필드 포함)

<Modal isOpen={isOpen} onModalClose={handleModalClose}>
  <Modal.Background onClick={handleModalClose} />
  <Modal.ModalContainer $position="center" $size="medium">
    <Modal.Title>카드 별칭 설정</Modal.Title>
    <Modal.ModalContent>
      <input
        type="text"
        value={nickname}
        onChange={handleChange}
        placeholder="ex) 내 첫 카드"
      />
    </Modal.ModalContent>
    <Modal.ModalButtonContainer>
      <Modal.ModalButton onClick={handleSubmit}>저장</Modal.ModalButton>
      <Modal.ModalButton onClick={handleModalClose}>취소</Modal.ModalButton>
    </Modal.ModalButtonContainer>
  </Modal.ModalContainer>
</Modal>