/packages/ui/src/common
shadcn 원본을 불러와 기본 틀만 둔 공통 파일. 디테일은 각 앱 components/ui 에서 정합니다 (10개 · 이름을 누르면 해당 칸으로 이동)
CommonDialogLayout
packages/ui/src/common/CommonDialogLayout.tsx- 딤 (뒤 배경)
- gray-900 · 투명도 40%
bg-gray-900/40- 블러
- 2px
backdrop-blur-[2px]- 안쪽 여백 (padding)
- 24px
p-6- 요소 간격
- 16px
gap-4- 모서리
- 12px
rounded-[12px]- 그림자
- 0 20px 50px · 검정 18%
shadow-[0_20px_50px_rgb(0_0_0/0.18)]- 배경 · 글자
- popover 색 · 14px
bg-popover text-sm- 위치
- 화면 정가운데
fixed inset-0 m-auto- 크기
- 내용에 맞춤
w-fit h-fit- 최대 크기
- 화면 − 32px, 넘치면 안쪽 스크롤
max-w-[calc(100%-2rem)] max-h-[calc(100dvh-2rem)] overflow-y-auto- 열고 닫힐 때
- 흐려짐 + 확대/축소 · 0.1초
fade · zoom-95 · duration-100- 모바일 모양 (mobile)
- 768px 미만에서만. PC는 항상 가운데 팝업
mobile="popup" (기본) · "full" · "bottom-sheet"- mobile="full"
- 화면 전체 · 모서리 · 그림자 없음 · 세로로 쌓임
max-md:inset-0 max-md:h-dvh max-md:flex-col max-md:rounded-none- 버튼 줄이 있을 때 (full · bottom-sheet)
- 팝업 아래 여백 0 → 버튼 아래 여백은 버튼 줄 것만
max-md:has-[>[data-slot=dialog-footer]]:pb-0- mobile="bottom-sheet"
- 아래에서 올라옴 · 위 모서리 16px · 최대 높이 화면 90%
max-md:bottom-0 max-md:max-h-[90dvh] max-md:rounded-t-[16px] · slide-in-from-bottom
예제 (모바일 폭에서 모양 차이 확인)
CommonInputGroupLayout
packages/ui/src/common/CommonInputGroupLayout.tsx- 높이
- 38px
h-[38px]- 모서리
- 8px
rounded-[8px]- 입력칸 좌우 여백
- 12px
px-3- 글자
- 14px
text-sm- 고정값 (readOnly) 배경
- #f3f4f6
has-[input:read-only]:bg-[#f3f4f6]- 고정값 (readOnly) 글자
- #6b7280
read-only:text-[#6b7280]
기본
<CommonInputGroup>
<CommonInputGroupInput />
</CommonInputGroup>단위 붙음
<CommonInputGroup>
<CommonInputGroupInput />
<InputGroupAddon align="inline-end">
<InputGroupText>g</InputGroupText>
</InputGroupAddon>
</CommonInputGroup>고정값 (readOnly)
<CommonInputGroup>
<CommonInputGroupInput readOnly value="99.99" />
</CommonInputGroup>CommonSelectLayout
packages/ui/src/common/CommonSelectLayout.tsx- 박스 높이
- 38px
data-[size=default]:h-[38px]- 박스 좌우 여백
- 12px
px-3- 박스 모서리
- 8px
rounded-[8px]- 박스 글자 · 화살표 간격
- 8px · 글자 왼쪽 정렬
gap-2 text-left- 목록 위치
- 박스 바로 아래 · 왼쪽 맞춤
align=start · alignItemWithTrigger=false- 목록 폭
- 박스와 같음
w-(--anchor-width) min-w-0- 목록 안쪽 여백 · 모서리
- 4px · 8px
p-1 rounded-[8px]- 항목 여백
- 위아래 8px · 왼쪽 10px · 오른쪽 32px(체크 자리)
py-2 pl-2.5 pr-8- 항목 모서리
- 6px
rounded-[6px]
예제
CommonFilterLayout
packages/ui/src/common/CommonFilterLayout.tsx- ▾ 버튼
- 24px
size-6- ▾ 크기
- 가로 10px · 세로 6px
w-2.5 h-1.5- 목록 위치
- 기준 칸 바로 아래
anchor · sideOffset 0- 목록 폭
- 기준 칸과 같게 · 최소 160px
min-w-[max(var(--anchor-width),160px)]- 항목 여백
- 9px 16px 9px 12px
py-[9px] pr-4 pl-3- 체크 상자
- 16px
size-4
기본
<DropdownMenu>
<CommonFilterTrigger label="머리글" />
<CommonFilterContent>
<CommonFilterItem checked={...} onCheckedChange={...}>옵션 A</CommonFilterItem>
</CommonFilterContent>
</DropdownMenu>CommonPaginationLayout
packages/ui/src/common/CommonPaginationLayout.tsx- 버튼
- 동그란 36px
size-9 rounded-full- 간격
- 6px
gap-1.5- 글자
- 15px
text-[15px]- 지금 페이지
- #ededed 바탕 · 굵게
bg-[#ededed] font-bold- 호버
- #f2f3f5
hover:bg-[#f2f3f5]- 처음 · 끝의 ‹ ›
- 흐리게 40%
aria-disabled:opacity-40
기본
<CommonPagination page={page} last={5} onChange={setPage} />CommonTableLayout
packages/ui/src/common/CommonTableLayout.tsx- 모바일 (768px 미만)
- 항상 세로로 쌓음: 머리글 숨김 · 한 줄 = 한 묶음 · 칸 = 이름표 | 값 (<TableCell label="…">) · 뺄 칸은 max-md:hidden
max-md:- 바깥 테두리
- 1px
border- 바깥 모서리
- 14px (radius-xl)
rounded-xl overflow-hidden- 칸 구분선
- 칸 아래 1px · 마지막 줄 없음
border-separate border-spacing-0 · border-b- 머리 칸
- 높이 49px · 위아래 12px · 좌우 14px
h-[49px] py-3 px-3.5- 본문 칸
- 높이 55px · 위아래 8px · 좌우 14px
h-[55px] py-2 px-3.5- 크기 (size)
- sm 머리 36 · 본문 40 · 좌우 12 / default 49 · 55 · 14 / lg 56 · 64 · 16 (px)
size="sm" · "default"(기본) · "lg"- 글자 정렬
- 왼쪽
text-left
| 번호 | 이름 |
|---|---|
| 1 | 옵션 A |
| 2 | 옵션 B |
| 3 | 옵션 C |
size="sm" (작게)
| 번호 | 이름 |
|---|---|
| 1 | 옵션 A |
| 2 | 옵션 B |
| 3 | 옵션 C |
모바일 (폭 390)
CommonSidebarLayout
packages/ui/src/common/CommonSidebarLayout.tsx- 자리
- sidebar · topBar · children(본문)
—- 사이드바 폭
- 16rem (shadcn 기본, providerProps로 변경)
--sidebar-width- 위쪽 바
- 가로 배치 · 높이 줄지 않음
flex shrink-0- 본문
- 세로 배치 · 남는 높이 채움
flex flex-1 flex-col- 그 외
- 없음 (내용 · 높이 · 여백 · 테두리 · 배경은 앱에서)
sidebar
topBar
children (본문)
설정
sidebarProps · providerProps (shadcn props 그대로) · classNames(inset · topBar · main)
전체 화면 예제
CommonCardLayout
packages/ui/src/common/CommonCardLayout.tsx- 모서리
- 12px
rounded-[12px]- 그림자
- 0 1px 3px · 검정 6%
shadow-[0_1px_3px_rgb(0_0_0/0.06)]- 테두리
- 1px · 글자색 10% (shadcn 기본)
ring-1 ring-foreground/10- 배경
- card 색 (흰색)
bg-card- 안쪽 여백
- 24px
p-6- 칸 사이 간격
- 0 (내용 없음, 앱에서)
gap-0
예제
CommonToastLayout
packages/ui/src/common/CommonToastLayout.tsx- position (선택)
- top-right(기본) · top-center · bottom-right · bottom-center. 생략하면 우측 상단
position- 쌓이는 방향
- 위쪽이면 아래로, 아래쪽이면 위로 (위치에 맞춰 자동)
- 움직임
- 위쪽은 위에서 내려오고 위로 사라짐 · 아래쪽은 반대
- 위치 여백 · 폭
- 화면 가장자리 16px · 최대 384px (좁은 화면은 좌우 16px 꽉 채움)
top-4 · max-w-sm- 쌓임 순서
- 팝업(Dialog)보다 위 — 팝업이 열려 있어도 토스트가 가려지지 않음
z-[100]- 종류별 색 (type)
- 기본 · info 흰색 / success 초록 / error 빨강 / warning 노랑
toast.add({ type })
쓰는 방법
위치별로 눌러서 확인
// 앱 Providers: 앱 전체를 감쌈 (생략하면 우측 상단)
<CommonToaster>{children}</CommonToaster>
<CommonToaster position="bottom-center">{children}</CommonToaster>
// 띄우기
import { toast } from "@repo/ui/shadcn/toast";
toast.add({ title: "저장했습니다", type: "success" });위치 예제
종류별 색