@pantoia/ui 0.16.1 → 0.16.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/skills/pantoia-design/SKILL.md +11 -11
- package/toast/index.tsx +12 -2
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@ description: PANTOIA Design System(@pantoia/ui)으로 화면을 만들거나 고
|
|
|
5
5
|
|
|
6
6
|
# @pantoia/ui
|
|
7
7
|
|
|
8
|
-
사람이 보는 문서는 https://design.pantoia.com
|
|
8
|
+
사람이 보는 문서는 `https://design.pantoia.com`에 있다.
|
|
9
9
|
|
|
10
10
|
## 설치
|
|
11
11
|
|
|
@@ -78,8 +78,8 @@ Select와 RadioGroup의 state는 `useState<string | null>`로 둔다.
|
|
|
78
78
|
```
|
|
79
79
|
frame 배경과 선. 페이지 안의 영역
|
|
80
80
|
card 배경과 그림자. 목록의 항목
|
|
81
|
-
float
|
|
82
|
-
well bg-bg-well
|
|
81
|
+
float 배경, 선, 그림자. 페이지나 overlay 위에 뜨는 것
|
|
82
|
+
well bg-bg-well
|
|
83
83
|
```
|
|
84
84
|
|
|
85
85
|
### 간격, 둥글기, 글자, 그림자
|
|
@@ -92,7 +92,7 @@ well bg-bg-well. 파인 면
|
|
|
92
92
|
크기만 text-t10부터 text-t64까지
|
|
93
93
|
그림자 shadow-s1, shadow-s2, shadow-s3
|
|
94
94
|
전환 transition-state, animate-enter, animate-exit
|
|
95
|
-
|
|
95
|
+
z-index z-sticky 10, z-overlay 50, z-toast 60
|
|
96
96
|
```
|
|
97
97
|
|
|
98
98
|
### 쓰지 않는 것
|
|
@@ -151,7 +151,7 @@ disabled는 이럴 때만 준다.
|
|
|
151
151
|
```
|
|
152
152
|
팔레트 단계 그 단계를 참조하는 토큰이 모두 바뀐다
|
|
153
153
|
토큰 그 토큰을 쓰는 곳이 모두 바뀐다
|
|
154
|
-
className 그
|
|
154
|
+
className 그 1곳만 바뀐다
|
|
155
155
|
```
|
|
156
156
|
|
|
157
157
|
## 컴포넌트
|
|
@@ -211,15 +211,15 @@ Select와 Combobox 목록에서 고르면 Select, 입력해서 찾으
|
|
|
211
211
|
Checkbox와 Switch 여러 개를 고르면 Checkbox, 설정을 바로 켜고 끄면 Switch
|
|
212
212
|
Toggle과 Switch 도구 모음에서 상태를 누르면 Toggle, 설정이면 Switch
|
|
213
213
|
Badge와 Button 누를 수 없으면 Badge, 누르면 Button
|
|
214
|
-
Tabs와 Accordion 한 번에
|
|
214
|
+
Tabs와 Accordion 한 번에 1개만 보이면 Tabs, 여러 개를 펴 두면 Accordion
|
|
215
215
|
SegmentedControl과 Tabs 같은 내용의 보기 방식을 바꾸면 SegmentedControl, 다른 내용으로 바꾸면 Tabs
|
|
216
|
-
SegmentedControl과 Toggle 여럿 중
|
|
216
|
+
SegmentedControl과 Toggle 여럿 중 1개를 고르면 SegmentedControl, 1개를 켜고 끄면 Toggle
|
|
217
217
|
SegmentedControl과 ToggleGroup 이어진 트랙 안에서 고르면 SegmentedControl, 떨어진 pill 여러 개 중에 고르면 ToggleGroup
|
|
218
|
-
Collapsible과 Accordion
|
|
218
|
+
Collapsible과 Accordion 영역 1개를 접으면 Collapsible, 여러 영역을 함께 다루면 Accordion
|
|
219
219
|
Tooltip과 Popover 짧은 설명이면 Tooltip, 안에서 조작하면 Popover
|
|
220
220
|
```
|
|
221
221
|
|
|
222
|
-
Avatar의 배경색은 color나 seed 중
|
|
222
|
+
Avatar의 배경색은 color나 seed 중 1개로 정한다. seed에는 사용자 id처럼 바뀌지 않는 값을 넘기고, 같은 seed는 어느 앱에서나 같은 색이다.
|
|
223
223
|
|
|
224
224
|
Dialog, AlertDialog, Drawer, BottomSheet의 Footer는 layout으로 버튼을 배치한다. end, between, fill, grow-last 중에 고르고, 화면 폭마다 다르면 { narrow, wide }를 넘긴다. 기준은 sm이고, ModalFooter는 Dialog 모양이면 wide, BottomSheet 모양이면 narrow를 쓴다.
|
|
225
225
|
|
|
@@ -238,7 +238,7 @@ Field는 라벨, 도움말, 오류 메시지를 입력 컨트롤에 묶는다. I
|
|
|
238
238
|
Select는 고른 항목의 `SelectItemText`나 글자를 트리거에 보인다. `SelectItem`을 다른 컴포넌트로 감싸면 `items`로 라벨을 넘긴다.
|
|
239
239
|
Combobox 항목이 `{ value, label }`이 아닌 객체면 `itemToStringLabel`로 `ComboboxInput`에 보일 글자를 정한다.
|
|
240
240
|
|
|
241
|
-
앱에
|
|
241
|
+
아래 컴포넌트는 앱에 1번만 둔다. 앱은 `isolate`로 감싼다.
|
|
242
242
|
|
|
243
243
|
```tsx
|
|
244
244
|
import { Toast, toast } from '@/components/ui/toast'
|
|
@@ -252,7 +252,7 @@ import { TooltipProvider } from '@/components/ui/tooltip'
|
|
|
252
252
|
</TooltipProvider>
|
|
253
253
|
```
|
|
254
254
|
|
|
255
|
-
알림은 일어난 일에 맞는 함수로 띄운다. 예시는 https://design.pantoia.com/toast
|
|
255
|
+
알림은 일어난 일에 맞는 함수로 띄운다. 예시는 `https://design.pantoia.com/toast/`에 있다.
|
|
256
256
|
|
|
257
257
|
```
|
|
258
258
|
toast.success 요청한 작업을 끝냈다
|
package/toast/index.tsx
CHANGED
|
@@ -55,7 +55,17 @@ const toastRoot = tv({
|
|
|
55
55
|
+ ' data-multiline:rounded-r20 data-multiline:w-full data-multiline:items-start data-multiline:px-4 data-multiline:py-3',
|
|
56
56
|
})
|
|
57
57
|
|
|
58
|
-
const toastIcon = tv({
|
|
58
|
+
const toastIcon = tv({
|
|
59
|
+
base: 'shrink-0 in-data-multiline:pt-px',
|
|
60
|
+
variants: {
|
|
61
|
+
kind: {
|
|
62
|
+
success: 'text-fg-success',
|
|
63
|
+
error: 'text-fg-danger',
|
|
64
|
+
warning: 'text-fg-warning',
|
|
65
|
+
info: 'text-fg-info',
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
})
|
|
59
69
|
|
|
60
70
|
const toastContent = tv({ base: 'min-w-0 flex-1' })
|
|
61
71
|
|
|
@@ -137,7 +147,7 @@ function ToastItem({ item, front, swipe }: { item: Item, front: boolean, swipe:
|
|
|
137
147
|
data-multiline={multiline ? '' : undefined}
|
|
138
148
|
className={toastRoot({ className: s.toast })}
|
|
139
149
|
>
|
|
140
|
-
{icon && <div className={toastIcon()}>{icon}</div>}
|
|
150
|
+
{icon && <div className={toastIcon({ kind: item.type as Kind })}>{icon}</div>}
|
|
141
151
|
<ToastPrimitive.Content className={toastContent()}>
|
|
142
152
|
<ToastPrimitive.Title ref={title} className={toastTitle()} />
|
|
143
153
|
<ToastPrimitive.Description className={toastDescription()} />
|