@hua-labs/ui 1.0.0
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/LICENSE +21 -0
- package/README.md +363 -0
- package/dist/components/Accordion.d.ts +39 -0
- package/dist/components/Accordion.d.ts.map +1 -0
- package/dist/components/Accordion.js +84 -0
- package/dist/components/Alert.d.ts +17 -0
- package/dist/components/Alert.d.ts.map +1 -0
- package/dist/components/Alert.js +61 -0
- package/dist/components/Avatar.d.ts +13 -0
- package/dist/components/Avatar.d.ts.map +1 -0
- package/dist/components/Avatar.js +18 -0
- package/dist/components/Badge.d.ts +7 -0
- package/dist/components/Badge.d.ts.map +1 -0
- package/dist/components/Badge.js +15 -0
- package/dist/components/BottomSheet.d.ts +29 -0
- package/dist/components/BottomSheet.d.ts.map +1 -0
- package/dist/components/BottomSheet.js +96 -0
- package/dist/components/Breadcrumb.d.ts +27 -0
- package/dist/components/Breadcrumb.d.ts.map +1 -0
- package/dist/components/Breadcrumb.js +47 -0
- package/dist/components/Button.d.ts +9 -0
- package/dist/components/Button.d.ts.map +1 -0
- package/dist/components/Button.js +23 -0
- package/dist/components/Card.d.ts +21 -0
- package/dist/components/Card.d.ts.map +1 -0
- package/dist/components/Card.js +18 -0
- package/dist/components/ChatMessage.d.ts +35 -0
- package/dist/components/ChatMessage.d.ts.map +1 -0
- package/dist/components/ChatMessage.js +59 -0
- package/dist/components/Checkbox.d.ts +12 -0
- package/dist/components/Checkbox.d.ts.map +1 -0
- package/dist/components/Checkbox.js +30 -0
- package/dist/components/Command.d.ts +36 -0
- package/dist/components/Command.d.ts.map +1 -0
- package/dist/components/Command.js +119 -0
- package/dist/components/ConfirmModal.d.ts +26 -0
- package/dist/components/ConfirmModal.d.ts.map +1 -0
- package/dist/components/ConfirmModal.js +53 -0
- package/dist/components/Container.d.ts +10 -0
- package/dist/components/Container.d.ts.map +1 -0
- package/dist/components/Container.js +23 -0
- package/dist/components/ContextMenu.d.ts +26 -0
- package/dist/components/ContextMenu.d.ts.map +1 -0
- package/dist/components/ContextMenu.js +110 -0
- package/dist/components/Divider.d.ts +11 -0
- package/dist/components/Divider.d.ts.map +1 -0
- package/dist/components/Divider.js +39 -0
- package/dist/components/Drawer.d.ts +32 -0
- package/dist/components/Drawer.d.ts.map +1 -0
- package/dist/components/Drawer.js +79 -0
- package/dist/components/Dropdown.d.ts +28 -0
- package/dist/components/Dropdown.d.ts.map +1 -0
- package/dist/components/Dropdown.js +174 -0
- package/dist/components/EmotionAnalysis.d.ts +25 -0
- package/dist/components/EmotionAnalysis.d.ts.map +1 -0
- package/dist/components/EmotionAnalysis.js +40 -0
- package/dist/components/EmotionButton.d.ts +9 -0
- package/dist/components/EmotionButton.d.ts.map +1 -0
- package/dist/components/EmotionButton.js +16 -0
- package/dist/components/EmotionMeter.d.ts +10 -0
- package/dist/components/EmotionMeter.d.ts.map +1 -0
- package/dist/components/EmotionMeter.js +21 -0
- package/dist/components/EmotionSelector.d.ts +20 -0
- package/dist/components/EmotionSelector.d.ts.map +1 -0
- package/dist/components/EmotionSelector.js +46 -0
- package/dist/components/Grid.d.ts +11 -0
- package/dist/components/Grid.d.ts.map +1 -0
- package/dist/components/Grid.js +44 -0
- package/dist/components/Icon.d.ts +26 -0
- package/dist/components/Icon.d.ts.map +1 -0
- package/dist/components/Icon.js +48 -0
- package/dist/components/Input.d.ts +12 -0
- package/dist/components/Input.d.ts.map +1 -0
- package/dist/components/Input.js +25 -0
- package/dist/components/LanguageToggle.d.ts +17 -0
- package/dist/components/LanguageToggle.d.ts.map +1 -0
- package/dist/components/LanguageToggle.js +61 -0
- package/dist/components/LoadingSpinner.d.ts +10 -0
- package/dist/components/LoadingSpinner.d.ts.map +1 -0
- package/dist/components/LoadingSpinner.js +37 -0
- package/dist/components/Menu.d.ts +29 -0
- package/dist/components/Menu.d.ts.map +1 -0
- package/dist/components/Menu.js +122 -0
- package/dist/components/Modal.d.ts +15 -0
- package/dist/components/Modal.d.ts.map +1 -0
- package/dist/components/Modal.js +62 -0
- package/dist/components/PageTransition.d.ts +18 -0
- package/dist/components/PageTransition.d.ts.map +1 -0
- package/dist/components/PageTransition.js +39 -0
- package/dist/components/Pagination.d.ts +21 -0
- package/dist/components/Pagination.d.ts.map +1 -0
- package/dist/components/Pagination.js +87 -0
- package/dist/components/Popover.d.ts +16 -0
- package/dist/components/Popover.d.ts.map +1 -0
- package/dist/components/Popover.js +159 -0
- package/dist/components/Progress.d.ts +23 -0
- package/dist/components/Progress.d.ts.map +1 -0
- package/dist/components/Progress.js +51 -0
- package/dist/components/Radio.d.ts +12 -0
- package/dist/components/Radio.d.ts.map +1 -0
- package/dist/components/Radio.js +29 -0
- package/dist/components/ScrollArea.d.ts +16 -0
- package/dist/components/ScrollArea.d.ts.map +1 -0
- package/dist/components/ScrollArea.js +42 -0
- package/dist/components/ScrollIndicator.d.ts +17 -0
- package/dist/components/ScrollIndicator.d.ts.map +1 -0
- package/dist/components/ScrollIndicator.js +60 -0
- package/dist/components/ScrollProgress.d.ts +12 -0
- package/dist/components/ScrollProgress.d.ts.map +1 -0
- package/dist/components/ScrollProgress.js +39 -0
- package/dist/components/ScrollToTop.d.ts +15 -0
- package/dist/components/ScrollToTop.d.ts.map +1 -0
- package/dist/components/ScrollToTop.js +46 -0
- package/dist/components/Select.d.ts +17 -0
- package/dist/components/Select.d.ts.map +1 -0
- package/dist/components/Select.js +29 -0
- package/dist/components/Skeleton.d.ts +19 -0
- package/dist/components/Skeleton.d.ts.map +1 -0
- package/dist/components/Skeleton.js +71 -0
- package/dist/components/Stack.d.ts +11 -0
- package/dist/components/Stack.d.ts.map +1 -0
- package/dist/components/Stack.js +34 -0
- package/dist/components/Switch.d.ts +12 -0
- package/dist/components/Switch.d.ts.map +1 -0
- package/dist/components/Switch.js +29 -0
- package/dist/components/Tabs.d.ts +36 -0
- package/dist/components/Tabs.d.ts.map +1 -0
- package/dist/components/Tabs.js +117 -0
- package/dist/components/Textarea.d.ts +11 -0
- package/dist/components/Textarea.d.ts.map +1 -0
- package/dist/components/Textarea.js +31 -0
- package/dist/components/ThemeProvider.d.ts +19 -0
- package/dist/components/ThemeProvider.d.ts.map +1 -0
- package/dist/components/ThemeProvider.js +76 -0
- package/dist/components/ThemeToggle.d.ts +14 -0
- package/dist/components/ThemeToggle.d.ts.map +1 -0
- package/dist/components/ThemeToggle.js +49 -0
- package/dist/components/Toast.d.ts +32 -0
- package/dist/components/Toast.d.ts.map +1 -0
- package/dist/components/Toast.js +138 -0
- package/dist/components/Tooltip.d.ts +14 -0
- package/dist/components/Tooltip.d.ts.map +1 -0
- package/dist/components/Tooltip.js +102 -0
- package/dist/index.d.ts +50 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +49 -0
- package/dist/lib/icons.d.ts +43 -0
- package/dist/lib/icons.d.ts.map +1 -0
- package/dist/lib/icons.js +321 -0
- package/dist/lib/utils.d.ts +3 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +5 -0
- package/package.json +67 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 HUA Labs Team
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,363 @@
|
|
|
1
|
+
# @hua-labs/ui 🎨
|
|
2
|
+
|
|
3
|
+
**HUA Labs의 모던 React UI 컴포넌트 라이브러리**
|
|
4
|
+
|
|
5
|
+
Beautiful, accessible, and customizable components for React applications.
|
|
6
|
+
|
|
7
|
+
## ✨ 주요 기능
|
|
8
|
+
|
|
9
|
+
### 🎯 **15개의 핵심 컴포넌트**
|
|
10
|
+
- **기본 UI**: Accordion, BottomSheet, Drawer, ConfirmModal, ScrollArea, Icon, Breadcrumb
|
|
11
|
+
- **테마**: ThemeProvider, ThemeToggle
|
|
12
|
+
- **스크롤**: ScrollToTop, ScrollIndicator, ScrollProgress
|
|
13
|
+
- **전환**: PageTransition
|
|
14
|
+
- **감정**: ChatMessage, EmotionAnalysis, EmotionSelector
|
|
15
|
+
|
|
16
|
+
### 🌙 **다크모드 지원**
|
|
17
|
+
- 자동 테마 감지
|
|
18
|
+
- 수동 테마 전환
|
|
19
|
+
- 일관된 디자인 시스템
|
|
20
|
+
|
|
21
|
+
### ♿ **접근성 고려**
|
|
22
|
+
- ARIA 속성 지원
|
|
23
|
+
- 키보드 네비게이션
|
|
24
|
+
- 스크린 리더 호환
|
|
25
|
+
|
|
26
|
+
### 📱 **반응형 디자인**
|
|
27
|
+
- 모든 디바이스에서 완벽한 경험
|
|
28
|
+
- 모바일 우선 설계
|
|
29
|
+
|
|
30
|
+
## 🚀 시작하기
|
|
31
|
+
|
|
32
|
+
### 설치
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
npm install @hua-labs/ui
|
|
36
|
+
# or
|
|
37
|
+
yarn add @hua-labs/ui
|
|
38
|
+
# or
|
|
39
|
+
pnpm add @hua-labs/ui
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### 기본 사용법
|
|
43
|
+
|
|
44
|
+
```tsx
|
|
45
|
+
import { Accordion, ThemeProvider } from '@hua-labs/ui';
|
|
46
|
+
|
|
47
|
+
function App() {
|
|
48
|
+
return (
|
|
49
|
+
<ThemeProvider>
|
|
50
|
+
<Accordion type="single" collapsible>
|
|
51
|
+
<AccordionItem value="item-1">
|
|
52
|
+
<AccordionTrigger>아코디언 제목</AccordionTrigger>
|
|
53
|
+
<AccordionContent>
|
|
54
|
+
아코디언 내용입니다.
|
|
55
|
+
</AccordionContent>
|
|
56
|
+
</AccordionItem>
|
|
57
|
+
</Accordion>
|
|
58
|
+
</ThemeProvider>
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## 📚 컴포넌트 가이드
|
|
64
|
+
|
|
65
|
+
### Accordion (아코디언)
|
|
66
|
+
|
|
67
|
+
```tsx
|
|
68
|
+
import { Accordion, AccordionItem, AccordionTrigger, AccordionContent } from '@hua-labs/ui';
|
|
69
|
+
|
|
70
|
+
<Accordion type="single" collapsible>
|
|
71
|
+
<AccordionItem value="item-1">
|
|
72
|
+
<AccordionTrigger>첫 번째 항목</AccordionTrigger>
|
|
73
|
+
<AccordionContent>첫 번째 항목의 내용</AccordionContent>
|
|
74
|
+
</AccordionItem>
|
|
75
|
+
<AccordionItem value="item-2">
|
|
76
|
+
<AccordionTrigger>두 번째 항목</AccordionTrigger>
|
|
77
|
+
<AccordionContent>두 번째 항목의 내용</AccordionContent>
|
|
78
|
+
</AccordionItem>
|
|
79
|
+
</Accordion>
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### ThemeProvider & ThemeToggle
|
|
83
|
+
|
|
84
|
+
```tsx
|
|
85
|
+
import { ThemeProvider, ThemeToggle } from '@hua-labs/ui';
|
|
86
|
+
|
|
87
|
+
function App() {
|
|
88
|
+
return (
|
|
89
|
+
<ThemeProvider>
|
|
90
|
+
<div>
|
|
91
|
+
<ThemeToggle />
|
|
92
|
+
{/* 다른 컴포넌트들 */}
|
|
93
|
+
</div>
|
|
94
|
+
</ThemeProvider>
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### BottomSheet (바텀시트)
|
|
100
|
+
|
|
101
|
+
```tsx
|
|
102
|
+
import { BottomSheet } from '@hua-labs/ui';
|
|
103
|
+
|
|
104
|
+
function MyComponent() {
|
|
105
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
106
|
+
|
|
107
|
+
return (
|
|
108
|
+
<BottomSheet
|
|
109
|
+
isOpen={isOpen}
|
|
110
|
+
onClose={() => setIsOpen(false)}
|
|
111
|
+
>
|
|
112
|
+
<div className="p-6">
|
|
113
|
+
<h2>바텀시트 제목</h2>
|
|
114
|
+
<p>바텀시트 내용입니다.</p>
|
|
115
|
+
</div>
|
|
116
|
+
</BottomSheet>
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
## 🎨 테마 커스터마이징
|
|
122
|
+
|
|
123
|
+
### CSS 변수 사용
|
|
124
|
+
|
|
125
|
+
```css
|
|
126
|
+
:root {
|
|
127
|
+
--hua-primary: #3b82f6;
|
|
128
|
+
--hua-secondary: #64748b;
|
|
129
|
+
--hua-accent: #f59e0b;
|
|
130
|
+
--hua-background: #ffffff;
|
|
131
|
+
--hua-foreground: #0f172a;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
[data-theme="dark"] {
|
|
135
|
+
--hua-background: #0f172a;
|
|
136
|
+
--hua-foreground: #f8fafc;
|
|
137
|
+
}
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
## 🔧 개발
|
|
141
|
+
|
|
142
|
+
### 빌드
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
pnpm build
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### 개발 모드
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
pnpm dev
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### 타입 체크
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
pnpm type-check
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
## 📄 라이선스
|
|
161
|
+
|
|
162
|
+
MIT License - 자유롭게 사용하세요!
|
|
163
|
+
|
|
164
|
+
## 🤝 기여하기
|
|
165
|
+
|
|
166
|
+
1. **Fork** 프로젝트
|
|
167
|
+
2. **Feature branch** 생성 (`git checkout -b feature/amazing-feature`)
|
|
168
|
+
3. **Commit** 변경사항 (`git commit -m 'Add amazing feature'`)
|
|
169
|
+
4. **Push** 브랜치 (`git push origin feature/amazing-feature`)
|
|
170
|
+
5. **Pull Request** 생성
|
|
171
|
+
|
|
172
|
+
## 🔗 관련 링크
|
|
173
|
+
|
|
174
|
+
- [HUA Labs 공식 사이트](https://hua-labs.com)
|
|
175
|
+
- [UI 컴포넌트 갤러리](https://ui.hua-labs.com)
|
|
176
|
+
- [GitHub 저장소](https://github.com/HUA-Labs/HUA-Labs-public)
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
**HUA Labs**에서 제작되었습니다. 🚀
|
|
181
|
+
|
|
182
|
+
---
|
|
183
|
+
|
|
184
|
+
# @hua-labs/ui 🎨
|
|
185
|
+
|
|
186
|
+
**HUA Labs' Modern React UI Component Library**
|
|
187
|
+
|
|
188
|
+
Beautiful, accessible, and customizable components for React applications.
|
|
189
|
+
|
|
190
|
+
## ✨ Key Features
|
|
191
|
+
|
|
192
|
+
### 🎯 **15 Core Components**
|
|
193
|
+
- **Basic UI**: Accordion, BottomSheet, Drawer, ConfirmModal, ScrollArea, Icon, Breadcrumb
|
|
194
|
+
- **Theme**: ThemeProvider, ThemeToggle
|
|
195
|
+
- **Scroll**: ScrollToTop, ScrollIndicator, ScrollProgress
|
|
196
|
+
- **Transition**: PageTransition
|
|
197
|
+
- **Emotion**: ChatMessage, EmotionAnalysis, EmotionSelector
|
|
198
|
+
|
|
199
|
+
### 🌙 **Dark Mode Support**
|
|
200
|
+
- Automatic theme detection
|
|
201
|
+
- Manual theme switching
|
|
202
|
+
- Consistent design system
|
|
203
|
+
|
|
204
|
+
### ♿ **Accessibility**
|
|
205
|
+
- ARIA attributes support
|
|
206
|
+
- Keyboard navigation
|
|
207
|
+
- Screen reader compatibility
|
|
208
|
+
|
|
209
|
+
### 📱 **Responsive Design**
|
|
210
|
+
- Perfect experience on all devices
|
|
211
|
+
- Mobile-first design
|
|
212
|
+
|
|
213
|
+
## 🚀 Getting Started
|
|
214
|
+
|
|
215
|
+
### Installation
|
|
216
|
+
|
|
217
|
+
```bash
|
|
218
|
+
npm install @hua-labs/ui
|
|
219
|
+
# or
|
|
220
|
+
yarn add @hua-labs/ui
|
|
221
|
+
# or
|
|
222
|
+
pnpm add @hua-labs/ui
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
### Basic Usage
|
|
226
|
+
|
|
227
|
+
```tsx
|
|
228
|
+
import { Accordion, ThemeProvider } from '@hua-labs/ui';
|
|
229
|
+
|
|
230
|
+
function App() {
|
|
231
|
+
return (
|
|
232
|
+
<ThemeProvider>
|
|
233
|
+
<Accordion type="single" collapsible>
|
|
234
|
+
<AccordionItem value="item-1">
|
|
235
|
+
<AccordionTrigger>Accordion Title</AccordionTrigger>
|
|
236
|
+
<AccordionContent>
|
|
237
|
+
Accordion content here.
|
|
238
|
+
</AccordionContent>
|
|
239
|
+
</AccordionItem>
|
|
240
|
+
</Accordion>
|
|
241
|
+
</ThemeProvider>
|
|
242
|
+
);
|
|
243
|
+
}
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
## 📚 Component Guide
|
|
247
|
+
|
|
248
|
+
### Accordion
|
|
249
|
+
|
|
250
|
+
```tsx
|
|
251
|
+
import { Accordion, AccordionItem, AccordionTrigger, AccordionContent } from '@hua-labs/ui';
|
|
252
|
+
|
|
253
|
+
<Accordion type="single" collapsible>
|
|
254
|
+
<AccordionItem value="item-1">
|
|
255
|
+
<AccordionTrigger>First Item</AccordionTrigger>
|
|
256
|
+
<AccordionContent>First item content</AccordionContent>
|
|
257
|
+
</AccordionItem>
|
|
258
|
+
<AccordionItem value="item-2">
|
|
259
|
+
<AccordionTrigger>Second Item</AccordionTrigger>
|
|
260
|
+
<AccordionContent>Second item content</AccordionContent>
|
|
261
|
+
</AccordionItem>
|
|
262
|
+
</Accordion>
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
### ThemeProvider & ThemeToggle
|
|
266
|
+
|
|
267
|
+
```tsx
|
|
268
|
+
import { ThemeProvider, ThemeToggle } from '@hua-labs/ui';
|
|
269
|
+
|
|
270
|
+
function App() {
|
|
271
|
+
return (
|
|
272
|
+
<ThemeProvider>
|
|
273
|
+
<div>
|
|
274
|
+
<ThemeToggle />
|
|
275
|
+
{/* Other components */}
|
|
276
|
+
</div>
|
|
277
|
+
</ThemeProvider>
|
|
278
|
+
);
|
|
279
|
+
}
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
### BottomSheet
|
|
283
|
+
|
|
284
|
+
```tsx
|
|
285
|
+
import { BottomSheet } from '@hua-labs/ui';
|
|
286
|
+
|
|
287
|
+
function MyComponent() {
|
|
288
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
289
|
+
|
|
290
|
+
return (
|
|
291
|
+
<BottomSheet
|
|
292
|
+
isOpen={isOpen}
|
|
293
|
+
onClose={() => setIsOpen(false)}
|
|
294
|
+
>
|
|
295
|
+
<div className="p-6">
|
|
296
|
+
<h2>Bottom Sheet Title</h2>
|
|
297
|
+
<p>Bottom sheet content here.</p>
|
|
298
|
+
</div>
|
|
299
|
+
</BottomSheet>
|
|
300
|
+
);
|
|
301
|
+
}
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
## 🎨 Theme Customization
|
|
305
|
+
|
|
306
|
+
### Using CSS Variables
|
|
307
|
+
|
|
308
|
+
```css
|
|
309
|
+
:root {
|
|
310
|
+
--hua-primary: #3b82f6;
|
|
311
|
+
--hua-secondary: #64748b;
|
|
312
|
+
--hua-accent: #f59e0b;
|
|
313
|
+
--hua-background: #ffffff;
|
|
314
|
+
--hua-foreground: #0f172a;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
[data-theme="dark"] {
|
|
318
|
+
--hua-background: #0f172a;
|
|
319
|
+
--hua-foreground: #f8fafc;
|
|
320
|
+
}
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
## 🔧 Development
|
|
324
|
+
|
|
325
|
+
### Build
|
|
326
|
+
|
|
327
|
+
```bash
|
|
328
|
+
pnpm build
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
### Development Mode
|
|
332
|
+
|
|
333
|
+
```bash
|
|
334
|
+
pnpm dev
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
### Type Check
|
|
338
|
+
|
|
339
|
+
```bash
|
|
340
|
+
pnpm type-check
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
## 📄 License
|
|
344
|
+
|
|
345
|
+
MIT License - Feel free to use!
|
|
346
|
+
|
|
347
|
+
## 🤝 Contributing
|
|
348
|
+
|
|
349
|
+
1. **Fork** the project
|
|
350
|
+
2. **Create** feature branch (`git checkout -b feature/amazing-feature`)
|
|
351
|
+
3. **Commit** changes (`git commit -m 'Add amazing feature'`)
|
|
352
|
+
4. **Push** branch (`git push origin feature/amazing-feature`)
|
|
353
|
+
5. **Create** Pull Request
|
|
354
|
+
|
|
355
|
+
## 🔗 Links
|
|
356
|
+
|
|
357
|
+
- [HUA Labs Official Site](https://hua-labs.com)
|
|
358
|
+
- [UI Component Gallery](https://ui.hua-labs.com)
|
|
359
|
+
- [GitHub Repository](https://github.com/HUA-Labs/HUA-Labs-public)
|
|
360
|
+
|
|
361
|
+
---
|
|
362
|
+
|
|
363
|
+
**Made with ❤️ by HUA Labs** 🚀
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
interface AccordionProps {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
className?: string;
|
|
5
|
+
type?: "single" | "multiple";
|
|
6
|
+
defaultValue?: string | string[];
|
|
7
|
+
value?: string | string[];
|
|
8
|
+
onValueChange?: (value: string | string[]) => void;
|
|
9
|
+
collapsible?: boolean;
|
|
10
|
+
}
|
|
11
|
+
declare const Accordion: React.ForwardRefExoticComponent<AccordionProps & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
+
interface AccordionItemProps {
|
|
13
|
+
value: string;
|
|
14
|
+
children: React.ReactNode;
|
|
15
|
+
className?: string;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
openItems?: string[];
|
|
18
|
+
onToggle?: (value: string) => void;
|
|
19
|
+
}
|
|
20
|
+
declare const AccordionItem: React.ForwardRefExoticComponent<AccordionItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
21
|
+
interface AccordionTriggerProps {
|
|
22
|
+
children: React.ReactNode;
|
|
23
|
+
className?: string;
|
|
24
|
+
icon?: React.ReactNode;
|
|
25
|
+
iconPosition?: "left" | "right";
|
|
26
|
+
value?: string;
|
|
27
|
+
isOpen?: boolean;
|
|
28
|
+
disabled?: boolean;
|
|
29
|
+
onToggle?: () => void;
|
|
30
|
+
}
|
|
31
|
+
declare const AccordionTrigger: React.ForwardRefExoticComponent<AccordionTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
32
|
+
interface AccordionContentProps {
|
|
33
|
+
children: React.ReactNode;
|
|
34
|
+
className?: string;
|
|
35
|
+
isOpen?: boolean;
|
|
36
|
+
}
|
|
37
|
+
declare const AccordionContent: React.ForwardRefExoticComponent<AccordionContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
38
|
+
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent };
|
|
39
|
+
//# sourceMappingURL=Accordion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Accordion.d.ts","sourceRoot":"","sources":["../../src/components/Accordion.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,UAAU,cAAc;IACtB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,IAAI,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAA;IAC5B,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;IAChC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;IACzB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,KAAK,IAAI,CAAA;IAClD,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB;AAED,QAAA,MAAM,SAAS,uFA8Dd,CAAA;AAGD,UAAU,kBAAkB;IAC1B,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAA;IACpB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;CACnC;AAED,QAAA,MAAM,aAAa,2FAqClB,CAAA;AAGD,UAAU,qBAAqB;IAC7B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;CACtB;AAED,QAAA,MAAM,gBAAgB,iGAyCrB,CAAA;AAGD,UAAU,qBAAqB;IAC7B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB;AAED,QAAA,MAAM,gBAAgB,8FA+BrB,CAAA;AAGD,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,CAAA"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { cn } from "../lib/utils";
|
|
5
|
+
import { Icon } from "./Icon";
|
|
6
|
+
const Accordion = React.forwardRef(({ children, className, type = "single", defaultValue, value, onValueChange, collapsible = false, ...props }, ref) => {
|
|
7
|
+
const [openItems, setOpenItems] = React.useState(value ? (Array.isArray(value) ? value : [value]) :
|
|
8
|
+
defaultValue ? (Array.isArray(defaultValue) ? defaultValue : [defaultValue]) : []);
|
|
9
|
+
React.useEffect(() => {
|
|
10
|
+
if (value !== undefined) {
|
|
11
|
+
setOpenItems(Array.isArray(value) ? value : [value]);
|
|
12
|
+
}
|
|
13
|
+
}, [value]);
|
|
14
|
+
const handleItemToggle = (itemValue) => {
|
|
15
|
+
let newOpenItems;
|
|
16
|
+
if (type === "single") {
|
|
17
|
+
if (openItems.includes(itemValue)) {
|
|
18
|
+
newOpenItems = collapsible ? [] : openItems;
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
newOpenItems = [itemValue];
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
if (openItems.includes(itemValue)) {
|
|
26
|
+
newOpenItems = openItems.filter(item => item !== itemValue);
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
newOpenItems = [...openItems, itemValue];
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
setOpenItems(newOpenItems);
|
|
33
|
+
onValueChange?.(type === "single" ? newOpenItems[0] || "" : newOpenItems);
|
|
34
|
+
};
|
|
35
|
+
return (_jsx("div", { ref: ref, className: cn("space-y-2", className), ...props, children: React.Children.map(children, (child) => {
|
|
36
|
+
if (React.isValidElement(child)) {
|
|
37
|
+
return React.cloneElement(child, {
|
|
38
|
+
openItems,
|
|
39
|
+
onToggle: handleItemToggle,
|
|
40
|
+
...child.props
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
return child;
|
|
44
|
+
}) }));
|
|
45
|
+
});
|
|
46
|
+
Accordion.displayName = "Accordion";
|
|
47
|
+
const AccordionItem = React.forwardRef(({ value, children, className, disabled = false, openItems = [], onToggle, ...props }, ref) => {
|
|
48
|
+
const isOpen = openItems.includes(value);
|
|
49
|
+
return (_jsx("div", { ref: ref, className: cn("border border-gray-200/50 dark:border-gray-700/50 rounded-lg overflow-hidden", disabled && "opacity-50 pointer-events-none", className), ...props, children: React.Children.map(children, (child) => {
|
|
50
|
+
if (React.isValidElement(child)) {
|
|
51
|
+
return React.cloneElement(child, {
|
|
52
|
+
value,
|
|
53
|
+
isOpen,
|
|
54
|
+
disabled,
|
|
55
|
+
onToggle: () => onToggle?.(value),
|
|
56
|
+
...child.props
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
return child;
|
|
60
|
+
}) }));
|
|
61
|
+
});
|
|
62
|
+
AccordionItem.displayName = "AccordionItem";
|
|
63
|
+
const AccordionTrigger = React.forwardRef(({ children, className, icon, iconPosition = "right", isOpen = false, disabled = false, onToggle, ...props }, ref) => {
|
|
64
|
+
const defaultIcon = (_jsx(Icon, { name: "chevronDown", size: 20, className: cn("transition-transform duration-300 ease-out", isOpen && "rotate-180") }));
|
|
65
|
+
return (_jsxs("button", { ref: ref, onClick: onToggle, disabled: disabled, className: cn("flex w-full items-center justify-between px-6 py-4 text-left font-medium transition-all hover:bg-gray-50/80 dark:hover:bg-gray-800/80 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500/50 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50", className), ...props, children: [_jsxs("div", { className: "flex items-center gap-3 flex-1", children: [iconPosition === "left" && (icon || defaultIcon), _jsx("span", { className: "flex-1", children: children })] }), iconPosition === "right" && (icon || defaultIcon)] }));
|
|
66
|
+
});
|
|
67
|
+
AccordionTrigger.displayName = "AccordionTrigger";
|
|
68
|
+
const AccordionContent = React.forwardRef(({ children, className, isOpen = false, ...props }, ref) => {
|
|
69
|
+
const [height, setHeight] = React.useState(0);
|
|
70
|
+
const contentRef = React.useRef(null);
|
|
71
|
+
React.useEffect(() => {
|
|
72
|
+
if (contentRef.current) {
|
|
73
|
+
if (isOpen) {
|
|
74
|
+
setHeight(contentRef.current.scrollHeight);
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
setHeight(0);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}, [isOpen, children]);
|
|
81
|
+
return (_jsx("div", { ref: ref, className: "overflow-hidden transition-all duration-300 ease-out", style: { height: `${height}px` }, ...props, children: _jsx("div", { ref: contentRef, className: cn("px-6 pb-4", className), children: children }) }));
|
|
82
|
+
});
|
|
83
|
+
AccordionContent.displayName = "AccordionContent";
|
|
84
|
+
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface AlertProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
variant?: "default" | "success" | "warning" | "error" | "info";
|
|
4
|
+
title?: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
icon?: React.ReactNode;
|
|
7
|
+
action?: React.ReactNode;
|
|
8
|
+
closable?: boolean;
|
|
9
|
+
onClose?: () => void;
|
|
10
|
+
}
|
|
11
|
+
declare const Alert: React.ForwardRefExoticComponent<AlertProps & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
+
export declare const AlertSuccess: React.ForwardRefExoticComponent<Omit<AlertProps, "variant"> & React.RefAttributes<HTMLDivElement>>;
|
|
13
|
+
export declare const AlertWarning: React.ForwardRefExoticComponent<Omit<AlertProps, "variant"> & React.RefAttributes<HTMLDivElement>>;
|
|
14
|
+
export declare const AlertError: React.ForwardRefExoticComponent<Omit<AlertProps, "variant"> & React.RefAttributes<HTMLDivElement>>;
|
|
15
|
+
export declare const AlertInfo: React.ForwardRefExoticComponent<Omit<AlertProps, "variant"> & React.RefAttributes<HTMLDivElement>>;
|
|
16
|
+
export { Alert };
|
|
17
|
+
//# sourceMappingURL=Alert.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Alert.d.ts","sourceRoot":"","sources":["../../src/components/Alert.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,MAAM,WAAW,UAAW,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACtE,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,CAAA;IAC9D,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;CACrB;AAED,QAAA,MAAM,KAAK,mFAuIV,CAAA;AAID,eAAO,MAAM,YAAY,oGAIxB,CAAA;AAGD,eAAO,MAAM,YAAY,oGAIxB,CAAA;AAGD,eAAO,MAAM,UAAU,oGAItB,CAAA;AAGD,eAAO,MAAM,SAAS,oGAIrB,CAAA;AAGD,OAAO,EAAE,KAAK,EAAE,CAAA"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { cn } from "../lib/utils";
|
|
5
|
+
const Alert = React.forwardRef(({ className, variant = "default", title, description, icon, action, closable = false, onClose, children, ...props }, ref) => {
|
|
6
|
+
const getVariantClasses = () => {
|
|
7
|
+
switch (variant) {
|
|
8
|
+
case "success":
|
|
9
|
+
return "bg-green-50 dark:bg-green-900/20 border-green-200 dark:border-green-800 text-green-800 dark:text-green-200";
|
|
10
|
+
case "warning":
|
|
11
|
+
return "bg-yellow-50 dark:bg-yellow-900/20 border-yellow-200 dark:border-yellow-800 text-yellow-800 dark:text-yellow-200";
|
|
12
|
+
case "error":
|
|
13
|
+
return "bg-red-50 dark:bg-red-900/20 border-red-200 dark:border-red-800 text-red-800 dark:text-red-200";
|
|
14
|
+
case "info":
|
|
15
|
+
return "bg-blue-50 dark:bg-blue-900/20 border-blue-200 dark:border-blue-800 text-blue-800 dark:text-blue-200";
|
|
16
|
+
default:
|
|
17
|
+
return "bg-gray-50 dark:bg-gray-900/20 border-gray-200 dark:border-gray-800 text-gray-800 dark:text-gray-200";
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
const getIconClasses = () => {
|
|
21
|
+
switch (variant) {
|
|
22
|
+
case "success":
|
|
23
|
+
return "text-green-500 dark:text-green-400";
|
|
24
|
+
case "warning":
|
|
25
|
+
return "text-yellow-500 dark:text-yellow-400";
|
|
26
|
+
case "error":
|
|
27
|
+
return "text-red-500 dark:text-red-400";
|
|
28
|
+
case "info":
|
|
29
|
+
return "text-blue-500 dark:text-blue-400";
|
|
30
|
+
default:
|
|
31
|
+
return "text-gray-500 dark:text-gray-400";
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
const getDefaultIcon = () => {
|
|
35
|
+
switch (variant) {
|
|
36
|
+
case "success":
|
|
37
|
+
return (_jsx("svg", { className: "w-5 h-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M5 13l4 4L19 7" }) }));
|
|
38
|
+
case "warning":
|
|
39
|
+
return (_jsx("svg", { className: "w-5 h-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.732 16.5c-.77.833.192 2.5 1.732 2.5z" }) }));
|
|
40
|
+
case "error":
|
|
41
|
+
return (_jsx("svg", { className: "w-5 h-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) }));
|
|
42
|
+
case "info":
|
|
43
|
+
return (_jsx("svg", { className: "w-5 h-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) }));
|
|
44
|
+
default:
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
return (_jsx("div", { ref: ref, className: cn("relative rounded-lg border p-4", // 16px 패딩
|
|
49
|
+
getVariantClasses(), className), ...props, children: _jsxs("div", { className: "flex items-start gap-3", children: [" ", (icon || getDefaultIcon()) && (_jsx("div", { className: cn("flex-shrink-0 mt-0.5", getIconClasses()), children: icon || getDefaultIcon() })), _jsxs("div", { className: "flex-1 min-w-0", children: [title && (_jsxs("h4", { className: "text-sm font-semibold mb-1", children: [" ", title] })), description && (_jsx("p", { className: "text-sm leading-relaxed", children: description })), children && (_jsxs("div", { className: "mt-2", children: [" ", children] }))] }), (action || closable) && (_jsxs("div", { className: "flex-shrink-0 flex items-center gap-2", children: [" ", action, closable && (_jsx("button", { onClick: onClose, className: cn("inline-flex rounded-md p-1.5 focus:outline-none focus:ring-2 focus:ring-offset-2 transition-all duration-200 hover:bg-black/5 dark:hover:bg-white/5", getIconClasses()), "aria-label": "\uB2EB\uAE30", children: _jsx("svg", { className: "w-4 h-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) }) }))] }))] }) }));
|
|
50
|
+
});
|
|
51
|
+
Alert.displayName = "Alert";
|
|
52
|
+
// 편의 컴포넌트들
|
|
53
|
+
export const AlertSuccess = React.forwardRef(({ className, ...props }, ref) => (_jsx(Alert, { ref: ref, variant: "success", className: className, ...props })));
|
|
54
|
+
AlertSuccess.displayName = "AlertSuccess";
|
|
55
|
+
export const AlertWarning = React.forwardRef(({ className, ...props }, ref) => (_jsx(Alert, { ref: ref, variant: "warning", className: className, ...props })));
|
|
56
|
+
AlertWarning.displayName = "AlertWarning";
|
|
57
|
+
export const AlertError = React.forwardRef(({ className, ...props }, ref) => (_jsx(Alert, { ref: ref, variant: "error", className: className, ...props })));
|
|
58
|
+
AlertError.displayName = "AlertError";
|
|
59
|
+
export const AlertInfo = React.forwardRef(({ className, ...props }, ref) => (_jsx(Alert, { ref: ref, variant: "info", className: className, ...props })));
|
|
60
|
+
AlertInfo.displayName = "AlertInfo";
|
|
61
|
+
export { Alert };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface AvatarProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
size?: "sm" | "md" | "lg";
|
|
4
|
+
}
|
|
5
|
+
export interface AvatarImageProps extends React.ImgHTMLAttributes<HTMLImageElement> {
|
|
6
|
+
}
|
|
7
|
+
export interface AvatarFallbackProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
8
|
+
}
|
|
9
|
+
declare const Avatar: React.ForwardRefExoticComponent<AvatarProps & React.RefAttributes<HTMLDivElement>>;
|
|
10
|
+
declare const AvatarImage: React.ForwardRefExoticComponent<AvatarImageProps & React.RefAttributes<HTMLImageElement>>;
|
|
11
|
+
declare const AvatarFallback: React.ForwardRefExoticComponent<AvatarFallbackProps & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
+
export { Avatar, AvatarImage, AvatarFallback };
|
|
13
|
+
//# sourceMappingURL=Avatar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../src/components/Avatar.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,MAAM,WAAW,WAAY,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACvE,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;CAC1B;AAED,MAAM,WAAW,gBAAiB,SAAQ,KAAK,CAAC,iBAAiB,CAAC,gBAAgB,CAAC;CAAG;AAEtF,MAAM,WAAW,mBAAoB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;CAAG;AAEpF,QAAA,MAAM,MAAM,oFAoBX,CAAA;AAGD,QAAA,MAAM,WAAW,2FAQhB,CAAA;AAGD,QAAA,MAAM,cAAc,4FAWnB,CAAA;AAGD,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,cAAc,EAAE,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { cn } from "../lib/utils";
|
|
5
|
+
const Avatar = React.forwardRef(({ className, size = "md", ...props }, ref) => {
|
|
6
|
+
const sizeClasses = {
|
|
7
|
+
sm: "w-8 h-8",
|
|
8
|
+
md: "w-10 h-10",
|
|
9
|
+
lg: "w-12 h-12"
|
|
10
|
+
};
|
|
11
|
+
return (_jsx("div", { ref: ref, className: cn("relative flex shrink-0 overflow-hidden rounded-full", sizeClasses[size], className), ...props }));
|
|
12
|
+
});
|
|
13
|
+
Avatar.displayName = "Avatar";
|
|
14
|
+
const AvatarImage = React.forwardRef(({ className, ...props }, ref) => (_jsx("img", { ref: ref, className: cn("aspect-square h-full w-full", className), ...props })));
|
|
15
|
+
AvatarImage.displayName = "AvatarImage";
|
|
16
|
+
const AvatarFallback = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn("flex h-full w-full items-center justify-center rounded-full bg-gray-100 dark:bg-gray-800", className), ...props })));
|
|
17
|
+
AvatarFallback.displayName = "AvatarFallback";
|
|
18
|
+
export { Avatar, AvatarImage, AvatarFallback };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface BadgeProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
variant?: "default" | "secondary" | "destructive" | "outline";
|
|
4
|
+
}
|
|
5
|
+
declare const Badge: React.ForwardRefExoticComponent<BadgeProps & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
export { Badge };
|
|
7
|
+
//# sourceMappingURL=Badge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../src/components/Badge.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,MAAM,WAAW,UAAW,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACtE,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,aAAa,GAAG,SAAS,CAAA;CAC9D;AAED,QAAA,MAAM,KAAK,mFAqBV,CAAA;AAGD,OAAO,EAAE,KAAK,EAAE,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { cn } from "../lib/utils";
|
|
5
|
+
const Badge = React.forwardRef(({ className, variant = "default", ...props }, ref) => {
|
|
6
|
+
const variantClasses = {
|
|
7
|
+
default: "bg-gray-900 text-gray-50 hover:bg-gray-900/80 dark:bg-gray-50 dark:text-gray-900 dark:hover:bg-gray-50/80",
|
|
8
|
+
secondary: "bg-gray-100 text-gray-900 hover:bg-gray-100/80 dark:bg-gray-800 dark:text-gray-50 dark:hover:bg-gray-800/80",
|
|
9
|
+
destructive: "bg-red-500 text-gray-50 hover:bg-red-500/80 dark:bg-red-900 dark:text-gray-50 dark:hover:bg-red-900/80",
|
|
10
|
+
outline: "text-gray-950 border border-gray-200 hover:bg-gray-100 hover:text-gray-900 dark:border-gray-800 dark:text-gray-50 dark:hover:bg-gray-800 dark:hover:text-gray-50"
|
|
11
|
+
};
|
|
12
|
+
return (_jsx("div", { ref: ref, className: cn("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-gray-400 focus:ring-offset-2", variantClasses[variant], className), ...props }));
|
|
13
|
+
});
|
|
14
|
+
Badge.displayName = "Badge";
|
|
15
|
+
export { Badge };
|