aha-components 0.0.1 → 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/CHANGELOG.md +49 -0
- package/README.md +257 -38
- package/dist/Alert.esm.js +2 -0
- package/dist/Alert.esm.js.map +1 -0
- package/dist/Alert.js +2 -0
- package/dist/Alert.js.map +1 -0
- package/dist/AlertComponent.esm.js +2 -0
- package/dist/AlertComponent.esm.js.map +1 -0
- package/dist/AlertComponent.js +2 -0
- package/dist/AlertComponent.js.map +1 -0
- package/dist/Button.esm.js +2 -0
- package/dist/Button.esm.js.map +1 -0
- package/dist/Button.js +2 -0
- package/dist/Button.js.map +1 -0
- package/dist/Card.esm.js +2 -0
- package/dist/Card.esm.js.map +1 -0
- package/dist/Card.js +2 -0
- package/dist/Card.js.map +1 -0
- package/dist/Input.esm.js +2 -0
- package/dist/Input.esm.js.map +1 -0
- package/dist/Input.js +2 -0
- package/dist/Input.js.map +1 -0
- package/dist/TestComponent.esm.js +2 -0
- package/dist/TestComponent.esm.js.map +1 -0
- package/dist/TestComponent.js +2 -0
- package/dist/TestComponent.js.map +1 -0
- package/dist/components/Alert/icon.d.ts +7 -0
- package/dist/components/Alert/index.d.ts +13 -0
- package/dist/components/AlertComponent/index.d.ts +9 -0
- package/dist/components/Button/index.d.ts +11 -0
- package/dist/components/Card/index.d.ts +10 -0
- package/dist/components/Input/index.d.ts +14 -0
- package/dist/components/TestComponent/index.d.ts +7 -0
- package/dist/index.d.ts +49 -0
- package/dist/index.esm.js +2 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/setupTests.d.ts +1 -0
- package/package.json +95 -30
- package/dist/assets/index-BtVi8doP.js +0 -40
- package/dist/assets/index-n_ryQ3BS.css +0 -1
- package/dist/assets/react-CHdo91hT.svg +0 -1
- package/dist/index.html +0 -14
- package/dist/vite.svg +0 -1
- package/eslint.config.js +0 -28
- package/index.html +0 -13
- package/public/vite.svg +0 -1
- package/rollup.config.js +0 -33
- package/src/App.css +0 -42
- package/src/App.tsx +0 -35
- package/src/assets/react.svg +0 -1
- package/src/components/Button/Button.less +0 -13
- package/src/components/Button/Button.tsx +0 -22
- package/src/components/Button/Button.types.ts +0 -36
- package/src/components/Button/index.ts +0 -2
- package/src/components/index.ts +0 -2
- package/src/index.css +0 -68
- package/src/main.tsx +0 -10
- package/src/vite-env.d.ts +0 -1
- package/tsconfig.app.json +0 -26
- package/tsconfig.json +0 -7
- package/tsconfig.node.json +0 -24
- package/vite.config.ts +0 -7
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [1.0.0] - 2024-01-XX
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- Initial release of aha-components
|
|
12
|
+
- Button component with multiple variants (primary, secondary, outline)
|
|
13
|
+
- Input component with different types and sizes
|
|
14
|
+
- Card component with title and subtitle support
|
|
15
|
+
- Alert component with different types (info, success, warning, error)
|
|
16
|
+
- Tailwind CSS integration
|
|
17
|
+
- Storybook documentation
|
|
18
|
+
- TypeScript support
|
|
19
|
+
- Jest testing setup
|
|
20
|
+
- ESLint configuration
|
|
21
|
+
- Component generator scripts
|
|
22
|
+
- Tree-shaking support
|
|
23
|
+
- Individual component exports
|
|
24
|
+
|
|
25
|
+
### Features
|
|
26
|
+
- Support for multiple button sizes (small, medium, large)
|
|
27
|
+
- Support for disabled states
|
|
28
|
+
- Customizable styling with Tailwind CSS
|
|
29
|
+
- Comprehensive Storybook documentation
|
|
30
|
+
- Automated component generation
|
|
31
|
+
- Full TypeScript type definitions
|
|
32
|
+
|
|
33
|
+
### Technical
|
|
34
|
+
- Rollup build configuration
|
|
35
|
+
- Vite development server
|
|
36
|
+
- PostCSS and Tailwind CSS processing
|
|
37
|
+
- Jest testing framework
|
|
38
|
+
- ESLint code quality checks
|
|
39
|
+
- Storybook for component documentation
|
|
40
|
+
|
|
41
|
+
## [Unreleased]
|
|
42
|
+
|
|
43
|
+
### Planned
|
|
44
|
+
- More component variants
|
|
45
|
+
- Additional form components
|
|
46
|
+
- Layout components
|
|
47
|
+
- Animation support
|
|
48
|
+
- Theme customization
|
|
49
|
+
- Accessibility improvements
|
package/README.md
CHANGED
|
@@ -1,50 +1,269 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Aha Components
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
一个现代化的 React 组件库,支持按需加载和 Tree Shaking。
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## ✨ 特性
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
-
|
|
7
|
+
- 🎨 **现代化设计** - 基于 Tailwind CSS 的现代 UI 设计
|
|
8
|
+
- 📦 **按需加载** - 支持 Tree Shaking,只打包使用的组件
|
|
9
|
+
- 🎯 **TypeScript** - 完整的 TypeScript 类型定义
|
|
10
|
+
- 📚 **Storybook** - 完整的组件文档和示例
|
|
11
|
+
- 🧪 **测试覆盖** - Jest 测试框架
|
|
12
|
+
- 🚀 **快速开发** - 自动化组件生成脚本
|
|
9
13
|
|
|
10
|
-
##
|
|
14
|
+
## 📦 安装
|
|
11
15
|
|
|
12
|
-
|
|
16
|
+
```bash
|
|
17
|
+
npm install aha-components
|
|
18
|
+
# 或
|
|
19
|
+
yarn add aha-components
|
|
20
|
+
# 或
|
|
21
|
+
pnpm add aha-components
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## 🚀 快速开始
|
|
25
|
+
|
|
26
|
+
```tsx
|
|
27
|
+
import React from 'react';
|
|
28
|
+
import { Button, Input, Card, Alert } from 'aha-components';
|
|
29
|
+
|
|
30
|
+
function App() {
|
|
31
|
+
return (
|
|
32
|
+
<div className="p-4">
|
|
33
|
+
<Button variant="primary" size="large">
|
|
34
|
+
点击我
|
|
35
|
+
</Button>
|
|
36
|
+
|
|
37
|
+
<Input placeholder="请输入内容..." />
|
|
38
|
+
|
|
39
|
+
<Card title="卡片标题" subtitle="副标题">
|
|
40
|
+
卡片内容
|
|
41
|
+
</Card>
|
|
42
|
+
|
|
43
|
+
<Alert type="success">
|
|
44
|
+
操作成功!
|
|
45
|
+
</Alert>
|
|
46
|
+
</div>
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## 🎨 组件
|
|
52
|
+
|
|
53
|
+
### Button 按钮
|
|
54
|
+
|
|
55
|
+
```tsx
|
|
56
|
+
import { Button } from 'aha-components';
|
|
57
|
+
|
|
58
|
+
// 基础用法
|
|
59
|
+
<Button>默认按钮</Button>
|
|
60
|
+
|
|
61
|
+
// 不同样式
|
|
62
|
+
<Button variant="primary">主要按钮</Button>
|
|
63
|
+
<Button variant="secondary">次要按钮</Button>
|
|
64
|
+
<Button variant="outline">轮廓按钮</Button>
|
|
13
65
|
|
|
14
|
-
|
|
66
|
+
// 不同尺寸
|
|
67
|
+
<Button size="small">小按钮</Button>
|
|
68
|
+
<Button size="medium">中按钮</Button>
|
|
69
|
+
<Button size="large">大按钮</Button>
|
|
15
70
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
languageOptions: {
|
|
19
|
-
// other options...
|
|
20
|
-
parserOptions: {
|
|
21
|
-
project: ['./tsconfig.node.json', './tsconfig.app.json'],
|
|
22
|
-
tsconfigRootDir: import.meta.dirname,
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
})
|
|
71
|
+
// 禁用状态
|
|
72
|
+
<Button disabled>禁用按钮</Button>
|
|
26
73
|
```
|
|
27
74
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
75
|
+
### Input 输入框
|
|
76
|
+
|
|
77
|
+
```tsx
|
|
78
|
+
import { Input } from 'aha-components';
|
|
79
|
+
|
|
80
|
+
// 基础用法
|
|
81
|
+
<Input placeholder="请输入..." />
|
|
82
|
+
|
|
83
|
+
// 不同类型
|
|
84
|
+
<Input type="text" placeholder="文本输入" />
|
|
85
|
+
<Input type="password" placeholder="密码输入" />
|
|
86
|
+
<Input type="email" placeholder="邮箱输入" />
|
|
87
|
+
<Input type="number" placeholder="数字输入" />
|
|
88
|
+
|
|
89
|
+
// 不同尺寸
|
|
90
|
+
<Input size="small" placeholder="小尺寸" />
|
|
91
|
+
<Input size="medium" placeholder="中尺寸" />
|
|
92
|
+
<Input size="large" placeholder="大尺寸" />
|
|
93
|
+
|
|
94
|
+
// 禁用状态
|
|
95
|
+
<Input disabled placeholder="禁用状态" />
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### Card 卡片
|
|
99
|
+
|
|
100
|
+
```tsx
|
|
101
|
+
import { Card } from 'aha-components';
|
|
102
|
+
|
|
103
|
+
// 基础用法
|
|
104
|
+
<Card>卡片内容</Card>
|
|
105
|
+
|
|
106
|
+
// 带标题
|
|
107
|
+
<Card title="卡片标题">卡片内容</Card>
|
|
31
108
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
109
|
+
// 带副标题
|
|
110
|
+
<Card title="卡片标题" subtitle="副标题">
|
|
111
|
+
卡片内容
|
|
112
|
+
</Card>
|
|
35
113
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
// Add the react plugin
|
|
41
|
-
react,
|
|
42
|
-
},
|
|
43
|
-
rules: {
|
|
44
|
-
// other rules...
|
|
45
|
-
// Enable its recommended rules
|
|
46
|
-
...react.configs.recommended.rules,
|
|
47
|
-
...react.configs['jsx-runtime'].rules,
|
|
48
|
-
},
|
|
49
|
-
})
|
|
114
|
+
// 可点击
|
|
115
|
+
<Card onClick={() => alert('卡片被点击了!')}>
|
|
116
|
+
可点击的卡片
|
|
117
|
+
</Card>
|
|
50
118
|
```
|
|
119
|
+
|
|
120
|
+
### Alert 提示
|
|
121
|
+
|
|
122
|
+
```tsx
|
|
123
|
+
import { Alert } from 'aha-components';
|
|
124
|
+
|
|
125
|
+
// 不同类型
|
|
126
|
+
<Alert type="info">信息提示</Alert>
|
|
127
|
+
<Alert type="success">成功提示</Alert>
|
|
128
|
+
<Alert type="warning">警告提示</Alert>
|
|
129
|
+
<Alert type="error">错误提示</Alert>
|
|
130
|
+
|
|
131
|
+
// 自定义样式
|
|
132
|
+
<Alert type="info" className="border-2 border-blue-300">
|
|
133
|
+
自定义样式提示
|
|
134
|
+
</Alert>
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
## 📚 按需加载
|
|
138
|
+
|
|
139
|
+
### 方法一:使用 ES6 导入(推荐)
|
|
140
|
+
|
|
141
|
+
```tsx
|
|
142
|
+
// 只导入需要的组件
|
|
143
|
+
import { Button } from 'aha-components';
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### 方法二:使用 CommonJS 导入
|
|
147
|
+
|
|
148
|
+
```tsx
|
|
149
|
+
const { Button } = require('aha-components');
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
## 🎯 TypeScript 支持
|
|
153
|
+
|
|
154
|
+
所有组件都包含完整的 TypeScript 类型定义:
|
|
155
|
+
|
|
156
|
+
```tsx
|
|
157
|
+
import { Button } from 'aha-components';
|
|
158
|
+
|
|
159
|
+
interface ButtonProps {
|
|
160
|
+
variant?: 'primary' | 'secondary' | 'outline';
|
|
161
|
+
size?: 'small' | 'medium' | 'large';
|
|
162
|
+
disabled?: boolean;
|
|
163
|
+
children: React.ReactNode;
|
|
164
|
+
onClick?: () => void;
|
|
165
|
+
className?: string;
|
|
166
|
+
}
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
## 🛠️ 开发
|
|
170
|
+
|
|
171
|
+
### 安装依赖
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
npm install
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
### 启动开发服务器
|
|
178
|
+
|
|
179
|
+
```bash
|
|
180
|
+
# 启动 Storybook
|
|
181
|
+
npm run storybook
|
|
182
|
+
|
|
183
|
+
# 启动示例应用
|
|
184
|
+
npm run dev:example
|
|
185
|
+
|
|
186
|
+
# 启动构建监听
|
|
187
|
+
npm run dev
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
### 构建
|
|
191
|
+
|
|
192
|
+
```bash
|
|
193
|
+
# 构建组件库
|
|
194
|
+
npm run build
|
|
195
|
+
|
|
196
|
+
# 构建 Storybook
|
|
197
|
+
npm run build-storybook
|
|
198
|
+
|
|
199
|
+
# 构建示例应用
|
|
200
|
+
npm run build:example
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
### 测试
|
|
204
|
+
|
|
205
|
+
```bash
|
|
206
|
+
# 运行测试
|
|
207
|
+
npm test
|
|
208
|
+
|
|
209
|
+
# 监听模式
|
|
210
|
+
npm run test:watch
|
|
211
|
+
|
|
212
|
+
# 类型检查
|
|
213
|
+
npm run type-check
|
|
214
|
+
|
|
215
|
+
# 代码检查
|
|
216
|
+
npm run lint
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
### 生成组件
|
|
220
|
+
|
|
221
|
+
```bash
|
|
222
|
+
# 基础组件生成
|
|
223
|
+
npm run generate
|
|
224
|
+
|
|
225
|
+
# 高级组件生成
|
|
226
|
+
npm run generate:advanced
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
## 📖 文档
|
|
230
|
+
|
|
231
|
+
- [组件文档](https://yourusername.github.io/aha-components) - 完整的组件文档和示例
|
|
232
|
+
- [Storybook](http://localhost:6006) - 本地开发文档
|
|
233
|
+
|
|
234
|
+
## 🤝 贡献
|
|
235
|
+
|
|
236
|
+
1. Fork 本仓库
|
|
237
|
+
2. 创建特性分支 (`git checkout -b feature/AmazingFeature`)
|
|
238
|
+
3. 提交更改 (`git commit -m 'Add some AmazingFeature'`)
|
|
239
|
+
4. 推送到分支 (`git push origin feature/AmazingFeature`)
|
|
240
|
+
5. 打开 Pull Request
|
|
241
|
+
|
|
242
|
+
## 📝 许可证
|
|
243
|
+
|
|
244
|
+
本项目基于 MIT 许可证开源 - 查看 [LICENSE](LICENSE) 文件了解详情。
|
|
245
|
+
|
|
246
|
+
## 🆘 支持
|
|
247
|
+
|
|
248
|
+
如果您遇到问题或有建议,请:
|
|
249
|
+
|
|
250
|
+
1. 查看 [Issues](https://github.com/yourusername/aha-components/issues)
|
|
251
|
+
2. 创建新的 Issue
|
|
252
|
+
3. 联系维护者
|
|
253
|
+
|
|
254
|
+
## 📦 发布
|
|
255
|
+
|
|
256
|
+
```bash
|
|
257
|
+
# 发布到 npm
|
|
258
|
+
npm run release
|
|
259
|
+
|
|
260
|
+
# 构建文档
|
|
261
|
+
npm run docs:build
|
|
262
|
+
|
|
263
|
+
# 部署文档到 GitHub Pages
|
|
264
|
+
npm run docs:deploy
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
## 🔄 更新日志
|
|
268
|
+
|
|
269
|
+
查看 [CHANGELOG.md](CHANGELOG.md) 了解版本更新历史。
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as e,jsxs as l}from"react/jsx-runtime";import{useState as i}from"react";var n={success:e("svg",{className:"flex-shrink-0",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M10 1.66663C5.40002 1.66663 1.66669 5.39996 1.66669 9.99996C1.66669 14.6 5.40002 18.3333 10 18.3333C14.6 18.3333 18.3334 14.6 18.3334 9.99996C18.3334 5.39996 14.6 1.66663 10 1.66663ZM13.3584 8.49997L9.46668 12.3833C9.35001 12.5083 9.19168 12.5666 9.02501 12.5666C8.86668 12.5666 8.70834 12.5083 8.58334 12.3833L6.64169 10.4417C6.40002 10.2 6.40002 9.79994 6.64169 9.55827C6.88336 9.3166 7.28335 9.3166 7.52502 9.55827L9.02501 11.0583L12.475 7.61664C12.7167 7.36664 13.1167 7.36664 13.3584 7.61664C13.6 7.8583 13.6 8.24997 13.3584 8.49997Z",fill:"#00BC7D"})}),error:e("svg",{className:"flex-shrink-0",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M17.1342 6.3009L13.6999 2.86666C13.4658 2.63249 13.1474 2.50085 12.8157 2.50085H7.18504C6.85337 2.50085 6.53584 2.63249 6.30084 2.86666L2.8666 6.3009C2.63243 6.53507 2.50079 6.85343 2.50079 7.1851V12.8158C2.50079 13.1475 2.63243 13.465 2.8666 13.7L6.30084 17.1342C6.53501 17.3684 6.85337 17.5 7.18504 17.5H12.8157C13.1474 17.5 13.4649 17.3684 13.6999 17.1342L17.1342 13.7C17.3683 13.4658 17.5 13.1475 17.5 12.8158V7.1851C17.5 6.85343 17.3683 6.53507 17.1342 6.3009ZM12.525 11.6417C12.7692 11.8858 12.7692 12.2817 12.525 12.5259C12.4033 12.6475 12.2433 12.7092 12.0833 12.7092C11.9233 12.7092 11.7633 12.6484 11.6416 12.5259L9.99998 10.8842L8.35834 12.5259C8.23667 12.6475 8.07665 12.7092 7.91665 12.7092C7.75665 12.7092 7.59662 12.6484 7.47496 12.5259C7.23079 12.2817 7.23079 11.8858 7.47496 11.6417L9.1166 10L7.47496 8.3584C7.23079 8.11423 7.23079 7.71837 7.47496 7.4742C7.71912 7.23004 8.11498 7.23004 8.35915 7.4742L10.0008 9.11585L11.6424 7.4742C11.8866 7.23004 12.2825 7.23004 12.5266 7.4742C12.7708 7.71837 12.7708 8.11423 12.5266 8.3584L10.885 10L12.525 11.6417Z",fill:"#FB2C36"})}),warning:e("svg",{className:"flex-shrink-0",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M18.0057 14.2935L12.4999 3.99662C11.4333 2.00162 8.56744 2.00162 7.49995 3.99662L1.99417 14.2935C1.01583 16.1235 2.3442 18.3334 4.42337 18.3334H15.5765C17.6549 18.3334 18.9841 16.1226 18.0057 14.2935ZM9.37495 8.33337C9.37495 7.98837 9.65494 7.70837 9.99994 7.70837C10.3449 7.70837 10.6249 7.98837 10.6249 8.33337V11.6667C10.6249 12.0117 10.3449 12.2917 9.99994 12.2917C9.65494 12.2917 9.37495 12.0117 9.37495 11.6667V8.33337ZM10.0166 15C9.55663 15 9.17902 14.6267 9.17902 14.1667C9.17902 13.7067 9.54829 13.3334 10.0083 13.3334H10.0166C10.4775 13.3334 10.85 13.7067 10.85 14.1667C10.85 14.6267 10.4766 15 10.0166 15Z",fill:"#FE9A00"})}),info:e("svg",{className:"flex-shrink-0",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M14.6875 2.5H5.3125C3.4375 2.5 2.5 3.4375 2.5 5.3125V14.6875C2.5 16.5625 3.4375 17.5 5.3125 17.5H14.6875C16.5625 17.5 17.5 16.5625 17.5 14.6875V5.3125C17.5 3.4375 16.5625 2.5 14.6875 2.5ZM10.625 13.75C10.625 14.095 10.345 14.375 10 14.375C9.655 14.375 9.375 14.095 9.375 13.75V9.9408C9.375 9.5958 9.655 9.3158 10 9.3158C10.345 9.3158 10.625 9.5958 10.625 9.9408V13.75ZM10.0167 7.91667C9.55668 7.91667 9.17908 7.54333 9.17908 7.08333C9.17908 6.62333 9.54834 6.25 10.0083 6.25H10.0167C10.4775 6.25 10.85 6.62333 10.85 7.08333C10.85 7.54333 10.4767 7.91667 10.0167 7.91667Z",fill:"#2B7FFF"})})},s=e("svg",{className:"flex-shrink-0",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M15.4416 14.5583C15.6858 14.8025 15.6858 15.1984 15.4416 15.4425C15.32 15.5642 15.16 15.6258 15 15.6258C14.84 15.6258 14.68 15.565 14.5583 15.4425L9.99997 10.8842L5.44164 15.4425C5.31997 15.5642 5.15997 15.6258 4.99997 15.6258C4.83997 15.6258 4.67997 15.565 4.55831 15.4425C4.31414 15.1984 4.31414 14.8025 4.55831 14.5583L9.11664 10L4.55831 5.44171C4.31414 5.19754 4.31414 4.80168 4.55831 4.55751C4.80247 4.31335 5.19831 4.31335 5.44248 4.55751L10.0008 9.11587L14.5591 4.55751C14.8033 4.31335 15.1991 4.31335 15.4433 4.55751C15.6875 4.80168 15.6875 5.19754 15.4433 5.44171L10.885 10L15.4416 14.5583Z",fill:"#57534D"})}),t=function(t){var C=t.className,a=void 0===C?"":C,r=t.type,o=t.title,c=t.description,h=t.icon,d=void 0===h?n[r]:h,w=t.showIcon,f=void 0===w||w,g=t.closeable,m=void 0!==g&&g,v=t.action,L=i(!0),x=L[0],p=L[1];return x?l("div",{className:"".concat("aha-alert px-4 py-3 rounded-md flex gap-2 relative"," ").concat({success:"bg-[#ECFDF5]",error:"bg-[#FEF2F2]",warning:"bg-[#FFFBEB]",info:"bg-[#EFF6FF]"}[r]," ").concat(a),children:[f&&d,l("div",{className:"flex flex-col gap-1 ".concat(m?"pr-8":""),children:[o&&e("div",{className:"justify-start text-[#292524] text-base font-semibold font-['DM_Sans'] leading-normal",children:o}),c&&e("div",{className:"w-full justify-center text-[#57534D] text-sm font-normal font-['DM_Sans'] leading-snug",children:c}),v&&m&&e("div",{className:"mt-3",children:v})]}),v&&!m&&e("div",{className:"ml-3",children:v}),m&&e("div",{className:"absolute right-4 top-3 cursor-pointer",onClick:function(){p(!1)},children:s})]}):null};export{t as default};
|
|
2
|
+
//# sourceMappingURL=Alert.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Alert.esm.js","sources":["../src/components/Alert/icon.tsx","../src/components/Alert/index.tsx"],"sourcesContent":["export const AlertIcon = {\n success: (\n <svg\n className=\"flex-shrink-0\"\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 20 20\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M10 1.66663C5.40002 1.66663 1.66669 5.39996 1.66669 9.99996C1.66669 14.6 5.40002 18.3333 10 18.3333C14.6 18.3333 18.3334 14.6 18.3334 9.99996C18.3334 5.39996 14.6 1.66663 10 1.66663ZM13.3584 8.49997L9.46668 12.3833C9.35001 12.5083 9.19168 12.5666 9.02501 12.5666C8.86668 12.5666 8.70834 12.5083 8.58334 12.3833L6.64169 10.4417C6.40002 10.2 6.40002 9.79994 6.64169 9.55827C6.88336 9.3166 7.28335 9.3166 7.52502 9.55827L9.02501 11.0583L12.475 7.61664C12.7167 7.36664 13.1167 7.36664 13.3584 7.61664C13.6 7.8583 13.6 8.24997 13.3584 8.49997Z\"\n fill=\"#00BC7D\"\n />\n </svg>\n ),\n error: (\n <svg\n className=\"flex-shrink-0\"\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 20 20\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M17.1342 6.3009L13.6999 2.86666C13.4658 2.63249 13.1474 2.50085 12.8157 2.50085H7.18504C6.85337 2.50085 6.53584 2.63249 6.30084 2.86666L2.8666 6.3009C2.63243 6.53507 2.50079 6.85343 2.50079 7.1851V12.8158C2.50079 13.1475 2.63243 13.465 2.8666 13.7L6.30084 17.1342C6.53501 17.3684 6.85337 17.5 7.18504 17.5H12.8157C13.1474 17.5 13.4649 17.3684 13.6999 17.1342L17.1342 13.7C17.3683 13.4658 17.5 13.1475 17.5 12.8158V7.1851C17.5 6.85343 17.3683 6.53507 17.1342 6.3009ZM12.525 11.6417C12.7692 11.8858 12.7692 12.2817 12.525 12.5259C12.4033 12.6475 12.2433 12.7092 12.0833 12.7092C11.9233 12.7092 11.7633 12.6484 11.6416 12.5259L9.99998 10.8842L8.35834 12.5259C8.23667 12.6475 8.07665 12.7092 7.91665 12.7092C7.75665 12.7092 7.59662 12.6484 7.47496 12.5259C7.23079 12.2817 7.23079 11.8858 7.47496 11.6417L9.1166 10L7.47496 8.3584C7.23079 8.11423 7.23079 7.71837 7.47496 7.4742C7.71912 7.23004 8.11498 7.23004 8.35915 7.4742L10.0008 9.11585L11.6424 7.4742C11.8866 7.23004 12.2825 7.23004 12.5266 7.4742C12.7708 7.71837 12.7708 8.11423 12.5266 8.3584L10.885 10L12.525 11.6417Z\"\n fill=\"#FB2C36\"\n />\n </svg>\n ),\n warning: (\n <svg \n className=\"flex-shrink-0\"\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 20 20\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M18.0057 14.2935L12.4999 3.99662C11.4333 2.00162 8.56744 2.00162 7.49995 3.99662L1.99417 14.2935C1.01583 16.1235 2.3442 18.3334 4.42337 18.3334H15.5765C17.6549 18.3334 18.9841 16.1226 18.0057 14.2935ZM9.37495 8.33337C9.37495 7.98837 9.65494 7.70837 9.99994 7.70837C10.3449 7.70837 10.6249 7.98837 10.6249 8.33337V11.6667C10.6249 12.0117 10.3449 12.2917 9.99994 12.2917C9.65494 12.2917 9.37495 12.0117 9.37495 11.6667V8.33337ZM10.0166 15C9.55663 15 9.17902 14.6267 9.17902 14.1667C9.17902 13.7067 9.54829 13.3334 10.0083 13.3334H10.0166C10.4775 13.3334 10.85 13.7067 10.85 14.1667C10.85 14.6267 10.4766 15 10.0166 15Z\"\n fill=\"#FE9A00\"\n />\n </svg>\n ),\n info: (\n <svg\n className=\"flex-shrink-0\"\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 20 20\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M14.6875 2.5H5.3125C3.4375 2.5 2.5 3.4375 2.5 5.3125V14.6875C2.5 16.5625 3.4375 17.5 5.3125 17.5H14.6875C16.5625 17.5 17.5 16.5625 17.5 14.6875V5.3125C17.5 3.4375 16.5625 2.5 14.6875 2.5ZM10.625 13.75C10.625 14.095 10.345 14.375 10 14.375C9.655 14.375 9.375 14.095 9.375 13.75V9.9408C9.375 9.5958 9.655 9.3158 10 9.3158C10.345 9.3158 10.625 9.5958 10.625 9.9408V13.75ZM10.0167 7.91667C9.55668 7.91667 9.17908 7.54333 9.17908 7.08333C9.17908 6.62333 9.54834 6.25 10.0083 6.25H10.0167C10.4775 6.25 10.85 6.62333 10.85 7.08333C10.85 7.54333 10.4767 7.91667 10.0167 7.91667Z\"\n fill=\"#2B7FFF\"\n />\n </svg>\n ),\n};\n\nexport const CloseIcon = (\n <svg\n className=\"flex-shrink-0\"\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 20 20\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M15.4416 14.5583C15.6858 14.8025 15.6858 15.1984 15.4416 15.4425C15.32 15.5642 15.16 15.6258 15 15.6258C14.84 15.6258 14.68 15.565 14.5583 15.4425L9.99997 10.8842L5.44164 15.4425C5.31997 15.5642 5.15997 15.6258 4.99997 15.6258C4.83997 15.6258 4.67997 15.565 4.55831 15.4425C4.31414 15.1984 4.31414 14.8025 4.55831 14.5583L9.11664 10L4.55831 5.44171C4.31414 5.19754 4.31414 4.80168 4.55831 4.55751C4.80247 4.31335 5.19831 4.31335 5.44248 4.55751L10.0008 9.11587L14.5591 4.55751C14.8033 4.31335 15.1991 4.31335 15.4433 4.55751C15.6875 4.80168 15.6875 5.19754 15.4433 5.44171L10.885 10L15.4416 14.5583Z\"\n fill=\"#57534D\"\n />\n </svg>\n);\n","import React, { useState } from \"react\";\nimport { AlertIcon, CloseIcon } from \"./icon\";\n\nexport interface AlertProps {\n title?: string;\n description?: string;\n className?: string;\n type: \"success\" | \"error\" | \"warning\" | \"info\";\n icon?: React.ReactNode;\n showIcon?: boolean;\n closeable?: boolean;\n action?: React.ReactNode;\n}\n\nconst Alert: React.FC<AlertProps> = ({\n className = \"\",\n type,\n title,\n description,\n icon = AlertIcon[type],\n showIcon = true,\n closeable = false,\n action,\n}) => {\n const baseClasses = \"aha-alert px-4 py-3 rounded-md flex gap-2 relative\";\n\n const typeClasses = {\n success: \"bg-[#ECFDF5]\",\n error: \"bg-[#FEF2F2]\",\n warning: \"bg-[#FFFBEB]\",\n info: \"bg-[#EFF6FF]\",\n };\n\n const [visible, setVisible] = useState(true);\n const handleClose = () => {\n setVisible(false);\n };\n\n if (!visible) return null;\n\n return (\n <div className={`${baseClasses} ${typeClasses[type]} ${className}`}>\n {showIcon && icon}\n <div className={`flex flex-col gap-1 ${closeable ? \"pr-8\" : \"\"}`}>\n {title && (\n <div className=\"justify-start text-[#292524] text-base font-semibold font-['DM_Sans'] leading-normal\">\n {title}\n </div>\n )}\n {description && (\n <div className=\"w-full justify-center text-[#57534D] text-sm font-normal font-['DM_Sans'] leading-snug\">\n {description}\n </div>\n )}\n {action && closeable && <div className=\"mt-3\">{action}</div>}\n </div>\n {action && !closeable && <div className=\"ml-3\">{action}</div>}\n {closeable && (\n <div\n className=\"absolute right-4 top-3 cursor-pointer\"\n onClick={handleClose}\n >\n {CloseIcon}\n </div>\n )}\n </div>\n );\n};\n\nexport default Alert;\n"],"names":["AlertIcon","success","_jsx","className","width","height","viewBox","fill","xmlns","children","d","error","warning","info","CloseIcon","Alert","_a","_b","type","title","description","_c","icon","_d","showIcon","_e","closeable","action","_f","useState","visible","setVisible","_jsxs","concat","onClick"],"mappings":"mFAAO,IAAMA,EAAY,CACvBC,QACEC,EAAA,MAAA,CACEC,UAAU,gBACVC,MAAM,KACNC,OAAO,KACPC,QAAQ,YACRC,KAAK,OACLC,MAAM,6BAENC,SAAAP,EAAA,OAAA,CACEQ,EAAE,6hBACFH,KAAK,cAIXI,MACET,EAAA,MAAA,CACEC,UAAU,gBACVC,MAAM,KACNC,OAAO,KACPC,QAAQ,YACRC,KAAK,OACLC,MAAM,6BAENC,SAAAP,EAAA,OAAA,CACEQ,EAAE,gjCACFH,KAAK,cAIXK,QACEV,EAAA,MAAA,CACEC,UAAU,gBACVC,MAAM,KACNC,OAAO,KACPC,QAAQ,YACRC,KAAK,OACLC,MAAM,6BAENC,SAAAP,EAAA,OAAA,CACEQ,EAAE,2mBACFH,KAAK,cAIXM,KACEX,EAAA,MAAA,CACEC,UAAU,gBACVC,MAAM,KACNC,OAAO,KACPC,QAAQ,YACRC,KAAK,OACLC,MAAM,6BAENC,SAAAP,EAAA,OAAA,CACEQ,EAAE,6jBACFH,KAAK,eAMAO,EACXZ,EAAA,MAAA,CACEC,UAAU,gBACVC,MAAM,KACNC,OAAO,KACPC,QAAQ,YACRC,KAAK,OACLC,MAAM,6BAENC,SAAAP,EAAA,OAAA,CACEQ,EAAE,0lBACFH,KAAK,cC5DLQ,EAA8B,SAACC,GACnC,IAAAC,EAAAD,EAAAb,UAAAA,OAAS,IAAAc,EAAG,GAAEA,EACdC,EAAIF,EAAAE,KACJC,EAAKH,EAAAG,MACLC,EAAWJ,EAAAI,YACXC,EAAsBL,EAAAM,KAAtBA,OAAO,IAAAD,EAAArB,EAAUkB,GAAKG,EACtBE,aAAAC,cAAeD,EACfE,EAAAT,EAAAU,UAAAA,OAAS,IAAAD,GAAQA,EACjBE,EAAMX,EAAAW,OAWAC,EAAwBC,GAAS,GAAhCC,EAAOF,EAAA,GAAEG,EAAUH,EAAA,GAK1B,OAAKE,EAGHE,SAAK7B,UAAW,UAjBE,qDAiBY,KAAA8B,OAfZ,CAClBhC,QAAS,eACTU,MAAO,eACPC,QAAS,eACTC,KAAM,gBAWwCK,eAASf,aACpDqB,GAAYF,EACbU,EAAA,MAAA,CAAK7B,UAAW,uBAAuB8B,OAAAP,EAAY,OAAS,IACzDjB,SAAA,CAAAU,GACCjB,SAAKC,UAAU,uFACZM,SAAAU,IAGJC,GACClB,EAAA,MAAA,CAAKC,UAAU,kGACZiB,IAGJO,GAAUD,GAAaxB,EAAA,MAAA,CAAKC,UAAU,gBAAQwB,OAEhDA,IAAWD,GAAaxB,SAAKC,UAAU,OAAQM,SAAAkB,IAC/CD,GACCxB,EACE,MAAA,CAAAC,UAAU,wCACV+B,QA1BY,WAClBH,GAAW,EACb,EAwB4BtB,SAEnBK,OAxBY,IA6BvB"}
|
package/dist/Alert.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var s=require("react/jsx-runtime"),e=require("react"),i={success:s.jsx("svg",{className:"flex-shrink-0",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:s.jsx("path",{d:"M10 1.66663C5.40002 1.66663 1.66669 5.39996 1.66669 9.99996C1.66669 14.6 5.40002 18.3333 10 18.3333C14.6 18.3333 18.3334 14.6 18.3334 9.99996C18.3334 5.39996 14.6 1.66663 10 1.66663ZM13.3584 8.49997L9.46668 12.3833C9.35001 12.5083 9.19168 12.5666 9.02501 12.5666C8.86668 12.5666 8.70834 12.5083 8.58334 12.3833L6.64169 10.4417C6.40002 10.2 6.40002 9.79994 6.64169 9.55827C6.88336 9.3166 7.28335 9.3166 7.52502 9.55827L9.02501 11.0583L12.475 7.61664C12.7167 7.36664 13.1167 7.36664 13.3584 7.61664C13.6 7.8583 13.6 8.24997 13.3584 8.49997Z",fill:"#00BC7D"})}),error:s.jsx("svg",{className:"flex-shrink-0",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:s.jsx("path",{d:"M17.1342 6.3009L13.6999 2.86666C13.4658 2.63249 13.1474 2.50085 12.8157 2.50085H7.18504C6.85337 2.50085 6.53584 2.63249 6.30084 2.86666L2.8666 6.3009C2.63243 6.53507 2.50079 6.85343 2.50079 7.1851V12.8158C2.50079 13.1475 2.63243 13.465 2.8666 13.7L6.30084 17.1342C6.53501 17.3684 6.85337 17.5 7.18504 17.5H12.8157C13.1474 17.5 13.4649 17.3684 13.6999 17.1342L17.1342 13.7C17.3683 13.4658 17.5 13.1475 17.5 12.8158V7.1851C17.5 6.85343 17.3683 6.53507 17.1342 6.3009ZM12.525 11.6417C12.7692 11.8858 12.7692 12.2817 12.525 12.5259C12.4033 12.6475 12.2433 12.7092 12.0833 12.7092C11.9233 12.7092 11.7633 12.6484 11.6416 12.5259L9.99998 10.8842L8.35834 12.5259C8.23667 12.6475 8.07665 12.7092 7.91665 12.7092C7.75665 12.7092 7.59662 12.6484 7.47496 12.5259C7.23079 12.2817 7.23079 11.8858 7.47496 11.6417L9.1166 10L7.47496 8.3584C7.23079 8.11423 7.23079 7.71837 7.47496 7.4742C7.71912 7.23004 8.11498 7.23004 8.35915 7.4742L10.0008 9.11585L11.6424 7.4742C11.8866 7.23004 12.2825 7.23004 12.5266 7.4742C12.7708 7.71837 12.7708 8.11423 12.5266 8.3584L10.885 10L12.525 11.6417Z",fill:"#FB2C36"})}),warning:s.jsx("svg",{className:"flex-shrink-0",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:s.jsx("path",{d:"M18.0057 14.2935L12.4999 3.99662C11.4333 2.00162 8.56744 2.00162 7.49995 3.99662L1.99417 14.2935C1.01583 16.1235 2.3442 18.3334 4.42337 18.3334H15.5765C17.6549 18.3334 18.9841 16.1226 18.0057 14.2935ZM9.37495 8.33337C9.37495 7.98837 9.65494 7.70837 9.99994 7.70837C10.3449 7.70837 10.6249 7.98837 10.6249 8.33337V11.6667C10.6249 12.0117 10.3449 12.2917 9.99994 12.2917C9.65494 12.2917 9.37495 12.0117 9.37495 11.6667V8.33337ZM10.0166 15C9.55663 15 9.17902 14.6267 9.17902 14.1667C9.17902 13.7067 9.54829 13.3334 10.0083 13.3334H10.0166C10.4775 13.3334 10.85 13.7067 10.85 14.1667C10.85 14.6267 10.4766 15 10.0166 15Z",fill:"#FE9A00"})}),info:s.jsx("svg",{className:"flex-shrink-0",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:s.jsx("path",{d:"M14.6875 2.5H5.3125C3.4375 2.5 2.5 3.4375 2.5 5.3125V14.6875C2.5 16.5625 3.4375 17.5 5.3125 17.5H14.6875C16.5625 17.5 17.5 16.5625 17.5 14.6875V5.3125C17.5 3.4375 16.5625 2.5 14.6875 2.5ZM10.625 13.75C10.625 14.095 10.345 14.375 10 14.375C9.655 14.375 9.375 14.095 9.375 13.75V9.9408C9.375 9.5958 9.655 9.3158 10 9.3158C10.345 9.3158 10.625 9.5958 10.625 9.9408V13.75ZM10.0167 7.91667C9.55668 7.91667 9.17908 7.54333 9.17908 7.08333C9.17908 6.62333 9.54834 6.25 10.0083 6.25H10.0167C10.4775 6.25 10.85 6.62333 10.85 7.08333C10.85 7.54333 10.4767 7.91667 10.0167 7.91667Z",fill:"#2B7FFF"})})},l=s.jsx("svg",{className:"flex-shrink-0",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:s.jsx("path",{d:"M15.4416 14.5583C15.6858 14.8025 15.6858 15.1984 15.4416 15.4425C15.32 15.5642 15.16 15.6258 15 15.6258C14.84 15.6258 14.68 15.565 14.5583 15.4425L9.99997 10.8842L5.44164 15.4425C5.31997 15.5642 5.15997 15.6258 4.99997 15.6258C4.83997 15.6258 4.67997 15.565 4.55831 15.4425C4.31414 15.1984 4.31414 14.8025 4.55831 14.5583L9.11664 10L4.55831 5.44171C4.31414 5.19754 4.31414 4.80168 4.55831 4.55751C4.80247 4.31335 5.19831 4.31335 5.44248 4.55751L10.0008 9.11587L14.5591 4.55751C14.8033 4.31335 15.1991 4.31335 15.4433 4.55751C15.6875 4.80168 15.6875 5.19754 15.4433 5.44171L10.885 10L15.4416 14.5583Z",fill:"#57534D"})});module.exports=function(t){var n=t.className,C=void 0===n?"":n,a=t.type,r=t.title,c=t.description,o=t.icon,h=void 0===o?i[a]:o,x=t.showIcon,d=void 0===x||x,w=t.closeable,g=void 0!==w&&w,f=t.action,v=e.useState(!0),m=v[0],L=v[1];return m?s.jsxs("div",{className:"".concat("aha-alert px-4 py-3 rounded-md flex gap-2 relative"," ").concat({success:"bg-[#ECFDF5]",error:"bg-[#FEF2F2]",warning:"bg-[#FFFBEB]",info:"bg-[#EFF6FF]"}[a]," ").concat(C),children:[d&&h,s.jsxs("div",{className:"flex flex-col gap-1 ".concat(g?"pr-8":""),children:[r&&s.jsx("div",{className:"justify-start text-[#292524] text-base font-semibold font-['DM_Sans'] leading-normal",children:r}),c&&s.jsx("div",{className:"w-full justify-center text-[#57534D] text-sm font-normal font-['DM_Sans'] leading-snug",children:c}),f&&g&&s.jsx("div",{className:"mt-3",children:f})]}),f&&!g&&s.jsx("div",{className:"ml-3",children:f}),g&&s.jsx("div",{className:"absolute right-4 top-3 cursor-pointer",onClick:function(){L(!1)},children:l})]}):null};
|
|
2
|
+
//# sourceMappingURL=Alert.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Alert.js","sources":["../src/components/Alert/icon.tsx","../src/components/Alert/index.tsx"],"sourcesContent":["export const AlertIcon = {\n success: (\n <svg\n className=\"flex-shrink-0\"\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 20 20\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M10 1.66663C5.40002 1.66663 1.66669 5.39996 1.66669 9.99996C1.66669 14.6 5.40002 18.3333 10 18.3333C14.6 18.3333 18.3334 14.6 18.3334 9.99996C18.3334 5.39996 14.6 1.66663 10 1.66663ZM13.3584 8.49997L9.46668 12.3833C9.35001 12.5083 9.19168 12.5666 9.02501 12.5666C8.86668 12.5666 8.70834 12.5083 8.58334 12.3833L6.64169 10.4417C6.40002 10.2 6.40002 9.79994 6.64169 9.55827C6.88336 9.3166 7.28335 9.3166 7.52502 9.55827L9.02501 11.0583L12.475 7.61664C12.7167 7.36664 13.1167 7.36664 13.3584 7.61664C13.6 7.8583 13.6 8.24997 13.3584 8.49997Z\"\n fill=\"#00BC7D\"\n />\n </svg>\n ),\n error: (\n <svg\n className=\"flex-shrink-0\"\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 20 20\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M17.1342 6.3009L13.6999 2.86666C13.4658 2.63249 13.1474 2.50085 12.8157 2.50085H7.18504C6.85337 2.50085 6.53584 2.63249 6.30084 2.86666L2.8666 6.3009C2.63243 6.53507 2.50079 6.85343 2.50079 7.1851V12.8158C2.50079 13.1475 2.63243 13.465 2.8666 13.7L6.30084 17.1342C6.53501 17.3684 6.85337 17.5 7.18504 17.5H12.8157C13.1474 17.5 13.4649 17.3684 13.6999 17.1342L17.1342 13.7C17.3683 13.4658 17.5 13.1475 17.5 12.8158V7.1851C17.5 6.85343 17.3683 6.53507 17.1342 6.3009ZM12.525 11.6417C12.7692 11.8858 12.7692 12.2817 12.525 12.5259C12.4033 12.6475 12.2433 12.7092 12.0833 12.7092C11.9233 12.7092 11.7633 12.6484 11.6416 12.5259L9.99998 10.8842L8.35834 12.5259C8.23667 12.6475 8.07665 12.7092 7.91665 12.7092C7.75665 12.7092 7.59662 12.6484 7.47496 12.5259C7.23079 12.2817 7.23079 11.8858 7.47496 11.6417L9.1166 10L7.47496 8.3584C7.23079 8.11423 7.23079 7.71837 7.47496 7.4742C7.71912 7.23004 8.11498 7.23004 8.35915 7.4742L10.0008 9.11585L11.6424 7.4742C11.8866 7.23004 12.2825 7.23004 12.5266 7.4742C12.7708 7.71837 12.7708 8.11423 12.5266 8.3584L10.885 10L12.525 11.6417Z\"\n fill=\"#FB2C36\"\n />\n </svg>\n ),\n warning: (\n <svg \n className=\"flex-shrink-0\"\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 20 20\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M18.0057 14.2935L12.4999 3.99662C11.4333 2.00162 8.56744 2.00162 7.49995 3.99662L1.99417 14.2935C1.01583 16.1235 2.3442 18.3334 4.42337 18.3334H15.5765C17.6549 18.3334 18.9841 16.1226 18.0057 14.2935ZM9.37495 8.33337C9.37495 7.98837 9.65494 7.70837 9.99994 7.70837C10.3449 7.70837 10.6249 7.98837 10.6249 8.33337V11.6667C10.6249 12.0117 10.3449 12.2917 9.99994 12.2917C9.65494 12.2917 9.37495 12.0117 9.37495 11.6667V8.33337ZM10.0166 15C9.55663 15 9.17902 14.6267 9.17902 14.1667C9.17902 13.7067 9.54829 13.3334 10.0083 13.3334H10.0166C10.4775 13.3334 10.85 13.7067 10.85 14.1667C10.85 14.6267 10.4766 15 10.0166 15Z\"\n fill=\"#FE9A00\"\n />\n </svg>\n ),\n info: (\n <svg\n className=\"flex-shrink-0\"\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 20 20\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M14.6875 2.5H5.3125C3.4375 2.5 2.5 3.4375 2.5 5.3125V14.6875C2.5 16.5625 3.4375 17.5 5.3125 17.5H14.6875C16.5625 17.5 17.5 16.5625 17.5 14.6875V5.3125C17.5 3.4375 16.5625 2.5 14.6875 2.5ZM10.625 13.75C10.625 14.095 10.345 14.375 10 14.375C9.655 14.375 9.375 14.095 9.375 13.75V9.9408C9.375 9.5958 9.655 9.3158 10 9.3158C10.345 9.3158 10.625 9.5958 10.625 9.9408V13.75ZM10.0167 7.91667C9.55668 7.91667 9.17908 7.54333 9.17908 7.08333C9.17908 6.62333 9.54834 6.25 10.0083 6.25H10.0167C10.4775 6.25 10.85 6.62333 10.85 7.08333C10.85 7.54333 10.4767 7.91667 10.0167 7.91667Z\"\n fill=\"#2B7FFF\"\n />\n </svg>\n ),\n};\n\nexport const CloseIcon = (\n <svg\n className=\"flex-shrink-0\"\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 20 20\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M15.4416 14.5583C15.6858 14.8025 15.6858 15.1984 15.4416 15.4425C15.32 15.5642 15.16 15.6258 15 15.6258C14.84 15.6258 14.68 15.565 14.5583 15.4425L9.99997 10.8842L5.44164 15.4425C5.31997 15.5642 5.15997 15.6258 4.99997 15.6258C4.83997 15.6258 4.67997 15.565 4.55831 15.4425C4.31414 15.1984 4.31414 14.8025 4.55831 14.5583L9.11664 10L4.55831 5.44171C4.31414 5.19754 4.31414 4.80168 4.55831 4.55751C4.80247 4.31335 5.19831 4.31335 5.44248 4.55751L10.0008 9.11587L14.5591 4.55751C14.8033 4.31335 15.1991 4.31335 15.4433 4.55751C15.6875 4.80168 15.6875 5.19754 15.4433 5.44171L10.885 10L15.4416 14.5583Z\"\n fill=\"#57534D\"\n />\n </svg>\n);\n","import React, { useState } from \"react\";\nimport { AlertIcon, CloseIcon } from \"./icon\";\n\nexport interface AlertProps {\n title?: string;\n description?: string;\n className?: string;\n type: \"success\" | \"error\" | \"warning\" | \"info\";\n icon?: React.ReactNode;\n showIcon?: boolean;\n closeable?: boolean;\n action?: React.ReactNode;\n}\n\nconst Alert: React.FC<AlertProps> = ({\n className = \"\",\n type,\n title,\n description,\n icon = AlertIcon[type],\n showIcon = true,\n closeable = false,\n action,\n}) => {\n const baseClasses = \"aha-alert px-4 py-3 rounded-md flex gap-2 relative\";\n\n const typeClasses = {\n success: \"bg-[#ECFDF5]\",\n error: \"bg-[#FEF2F2]\",\n warning: \"bg-[#FFFBEB]\",\n info: \"bg-[#EFF6FF]\",\n };\n\n const [visible, setVisible] = useState(true);\n const handleClose = () => {\n setVisible(false);\n };\n\n if (!visible) return null;\n\n return (\n <div className={`${baseClasses} ${typeClasses[type]} ${className}`}>\n {showIcon && icon}\n <div className={`flex flex-col gap-1 ${closeable ? \"pr-8\" : \"\"}`}>\n {title && (\n <div className=\"justify-start text-[#292524] text-base font-semibold font-['DM_Sans'] leading-normal\">\n {title}\n </div>\n )}\n {description && (\n <div className=\"w-full justify-center text-[#57534D] text-sm font-normal font-['DM_Sans'] leading-snug\">\n {description}\n </div>\n )}\n {action && closeable && <div className=\"mt-3\">{action}</div>}\n </div>\n {action && !closeable && <div className=\"ml-3\">{action}</div>}\n {closeable && (\n <div\n className=\"absolute right-4 top-3 cursor-pointer\"\n onClick={handleClose}\n >\n {CloseIcon}\n </div>\n )}\n </div>\n );\n};\n\nexport default Alert;\n"],"names":["AlertIcon","success","_jsx","jsx","className","width","height","viewBox","fill","xmlns","children","d","error","warning","info","CloseIcon","_a","_b","type","title","description","_c","icon","_d","showIcon","_e","closeable","action","_f","useState","visible","setVisible","_jsxs","concat","jsxs","onClick"],"mappings":"mEAAaA,EAAY,CACvBC,QACEC,EAAAC,IAAA,MAAA,CACEC,UAAU,gBACVC,MAAM,KACNC,OAAO,KACPC,QAAQ,YACRC,KAAK,OACLC,MAAM,6BAENC,SAAAR,EAAAC,IAAA,OAAA,CACEQ,EAAE,6hBACFH,KAAK,cAIXI,MACEV,EAAAC,IAAA,MAAA,CACEC,UAAU,gBACVC,MAAM,KACNC,OAAO,KACPC,QAAQ,YACRC,KAAK,OACLC,MAAM,6BAENC,SAAAR,EAAAC,IAAA,OAAA,CACEQ,EAAE,gjCACFH,KAAK,cAIXK,QACEX,EAAAC,IAAA,MAAA,CACEC,UAAU,gBACVC,MAAM,KACNC,OAAO,KACPC,QAAQ,YACRC,KAAK,OACLC,MAAM,6BAENC,SAAAR,EAAAC,IAAA,OAAA,CACEQ,EAAE,2mBACFH,KAAK,cAIXM,KACEZ,EAAAC,IAAA,MAAA,CACEC,UAAU,gBACVC,MAAM,KACNC,OAAO,KACPC,QAAQ,YACRC,KAAK,OACLC,MAAM,6BAENC,SAAAR,EAAAC,IAAA,OAAA,CACEQ,EAAE,6jBACFH,KAAK,eAMAO,EACXb,EAAAC,IAAA,MAAA,CACEC,UAAU,gBACVC,MAAM,KACNC,OAAO,KACPC,QAAQ,YACRC,KAAK,OACLC,MAAM,6BAENC,SAAAR,EAAAC,IAAA,OAAA,CACEQ,EAAE,0lBACFH,KAAK,6BC5DyB,SAACQ,GACnC,IAAAC,EAAAD,EAAAZ,UAAAA,OAAS,IAAAa,EAAG,GAAEA,EACdC,EAAIF,EAAAE,KACJC,EAAKH,EAAAG,MACLC,EAAWJ,EAAAI,YACXC,EAAsBL,EAAAM,KAAtBA,OAAO,IAAAD,EAAArB,EAAUkB,GAAKG,EACtBE,aAAAC,cAAeD,EACfE,EAAAT,EAAAU,UAAAA,OAAS,IAAAD,GAAQA,EACjBE,EAAMX,EAAAW,OAWAC,EAAwBC,EAAAA,UAAS,GAAhCC,EAAOF,EAAA,GAAEG,EAAUH,EAAA,GAK1B,OAAKE,EAGHE,cAAK5B,UAAW,UAjBE,qDAiBY,KAAA6B,OAfZ,CAClBhC,QAAS,eACTW,MAAO,eACPC,QAAS,eACTC,KAAM,gBAWwCI,eAASd,aACpDoB,GAAYF,EACbU,EAAAE,KAAA,MAAA,CAAK9B,UAAW,uBAAuB6B,OAAAP,EAAY,OAAS,IACzDhB,SAAA,CAAAS,GACCjB,aAAKE,UAAU,uFACZM,SAAAS,IAGJC,GACClB,EAAAA,IAAA,MAAA,CAAKE,UAAU,kGACZgB,IAGJO,GAAUD,GAAaxB,EAAAA,IAAA,MAAA,CAAKE,UAAU,gBAAQuB,OAEhDA,IAAWD,GAAaxB,EAAAA,WAAKE,UAAU,OAAQM,SAAAiB,IAC/CD,GACCxB,MACE,MAAA,CAAAE,UAAU,wCACV+B,QA1BY,WAClBJ,GAAW,EACb,EAwB4BrB,SAEnBK,OAxBY,IA6BvB"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as e,jsxs as r}from"react/jsx-runtime";var o=function(o){var t=o.children,n=o.variant,l=void 0===n?"info":n,a=o.className,c=void 0===a?"":a,i=o.onClose,d="".concat("border rounded-md p-4 relative"," ").concat({success:"bg-green-50 border-green-200 text-green-800",error:"bg-red-50 border-red-200 text-red-800",warning:"bg-yellow-50 border-yellow-200 text-yellow-800",info:"bg-blue-50 border-blue-200 text-blue-800"}[l]," ").concat(c);return e("div",{className:d,children:r("div",{className:"flex",children:[e("div",{className:"flex-1",children:t}),i&&e("button",{onClick:i,className:"ml-3 text-current hover:opacity-70 transition-opacity",children:"✕"})]})})};export{o as default};
|
|
2
|
+
//# sourceMappingURL=AlertComponent.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AlertComponent.esm.js","sources":["../src/components/AlertComponent/index.tsx"],"sourcesContent":["import React from 'react';\n\nexport interface AlertComponentProps {\n children: React.ReactNode;\n variant?: 'success' | 'error' | 'warning' | 'info';\n className?: string;\n onClose?: () => void;\n}\n\nconst AlertComponent: React.FC<AlertComponentProps> = ({\n children,\n variant = 'info',\n className = '',\n onClose,\n}) => {\n const variantClasses = {\n success: 'bg-green-50 border-green-200 text-green-800',\n error: 'bg-red-50 border-red-200 text-red-800',\n warning: 'bg-yellow-50 border-yellow-200 text-yellow-800',\n info: 'bg-blue-50 border-blue-200 text-blue-800',\n };\n\n const baseClasses = 'border rounded-md p-4 relative';\n const classes = `${baseClasses} ${variantClasses[variant]} ${className}`;\n\n return (\n <div className={classes}>\n <div className=\"flex\">\n <div className=\"flex-1\">{children}</div>\n {onClose && (\n <button\n onClick={onClose}\n className=\"ml-3 text-current hover:opacity-70 transition-opacity\"\n >\n ✕\n </button>\n )}\n </div>\n </div>\n );\n};\n\nexport default AlertComponent;\n"],"names":["AlertComponent","_a","children","_b","variant","_c","className","onClose","classes","concat","success","error","warning","info","_jsx","_jsxs","onClick"],"mappings":"kDASM,IAAAA,EAAgD,SAACC,GACrD,IAAAC,aACAC,EAAAF,EAAAG,QAAAA,aAAU,OAAMD,EAChBE,EAAAJ,EAAAK,UAAAA,OAAS,IAAAD,EAAG,GAAEA,EACdE,EAAON,EAAAM,QAUDC,EAAU,GAAGC,OADC,iCACc,KAAAA,OARX,CACrBC,QAAS,8CACTC,MAAO,wCACPC,QAAS,iDACTC,KAAM,4CAIyCT,GAAQ,KAAAK,OAAIH,GAE7D,OACEQ,EAAA,MAAA,CAAKR,UAAWE,EACdN,SAAAa,EAAA,MAAA,CAAKT,UAAU,OACbJ,SAAA,CAAAY,EAAA,MAAA,CAAKR,UAAU,SAAUJ,SAAAA,IACxBK,GACCO,EACE,SAAA,CAAAE,QAAST,EACTD,UAAU,wDAGHJ,SAAA,UAKnB"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime");module.exports=function(r){var t=r.children,o=r.variant,n=void 0===o?"info":o,l=r.className,c=void 0===l?"":l,i=r.onClose,s="".concat("border rounded-md p-4 relative"," ").concat({success:"bg-green-50 border-green-200 text-green-800",error:"bg-red-50 border-red-200 text-red-800",warning:"bg-yellow-50 border-yellow-200 text-yellow-800",info:"bg-blue-50 border-blue-200 text-blue-800"}[n]," ").concat(c);return e.jsx("div",{className:s,children:e.jsxs("div",{className:"flex",children:[e.jsx("div",{className:"flex-1",children:t}),i&&e.jsx("button",{onClick:i,className:"ml-3 text-current hover:opacity-70 transition-opacity",children:"✕"})]})})};
|
|
2
|
+
//# sourceMappingURL=AlertComponent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AlertComponent.js","sources":["../src/components/AlertComponent/index.tsx"],"sourcesContent":["import React from 'react';\n\nexport interface AlertComponentProps {\n children: React.ReactNode;\n variant?: 'success' | 'error' | 'warning' | 'info';\n className?: string;\n onClose?: () => void;\n}\n\nconst AlertComponent: React.FC<AlertComponentProps> = ({\n children,\n variant = 'info',\n className = '',\n onClose,\n}) => {\n const variantClasses = {\n success: 'bg-green-50 border-green-200 text-green-800',\n error: 'bg-red-50 border-red-200 text-red-800',\n warning: 'bg-yellow-50 border-yellow-200 text-yellow-800',\n info: 'bg-blue-50 border-blue-200 text-blue-800',\n };\n\n const baseClasses = 'border rounded-md p-4 relative';\n const classes = `${baseClasses} ${variantClasses[variant]} ${className}`;\n\n return (\n <div className={classes}>\n <div className=\"flex\">\n <div className=\"flex-1\">{children}</div>\n {onClose && (\n <button\n onClick={onClose}\n className=\"ml-3 text-current hover:opacity-70 transition-opacity\"\n >\n ✕\n </button>\n )}\n </div>\n </div>\n );\n};\n\nexport default AlertComponent;\n"],"names":["_a","children","_b","variant","_c","className","onClose","classes","concat","success","error","warning","info","_jsx","_jsxs","onClick"],"mappings":"+DASsD,SAACA,GACrD,IAAAC,aACAC,EAAAF,EAAAG,QAAAA,aAAU,OAAMD,EAChBE,EAAAJ,EAAAK,UAAAA,OAAS,IAAAD,EAAG,GAAEA,EACdE,EAAON,EAAAM,QAUDC,EAAU,GAAGC,OADC,iCACc,KAAAA,OARX,CACrBC,QAAS,8CACTC,MAAO,wCACPC,QAAS,iDACTC,KAAM,4CAIyCT,GAAQ,KAAAK,OAAIH,GAE7D,OACEQ,EAAAA,IAAA,MAAA,CAAKR,UAAWE,EACdN,SAAAa,OAAA,MAAA,CAAKT,UAAU,OACbJ,SAAA,CAAAY,EAAAA,IAAA,MAAA,CAAKR,UAAU,SAAUJ,SAAAA,IACxBK,GACCO,EAAAA,IACE,SAAA,CAAAE,QAAST,EACTD,UAAU,wDAGHJ,SAAA,UAKnB"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";var r=function(r){var o=r.children,t=r.variant,i=void 0===t?"primary":t,n=r.size,a=void 0===n?"medium":n,c=r.disabled,s=void 0!==c&&c,l=r.onClick,u=r.className,d=void 0===u?"":u,g=s?"opacity-50 cursor-not-allowed":"cursor-pointer",m="".concat("inline-flex items-center justify-center rounded-md font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2"," ").concat({primary:"bg-blue-600 text-white hover:bg-blue-700 focus:ring-blue-500",secondary:"bg-gray-600 text-white hover:bg-gray-700 focus:ring-gray-500",outline:"border border-gray-300 bg-white text-gray-700 hover:bg-gray-50 focus:ring-blue-500"}[i]," ").concat({small:"px-3 py-1.5 text-sm",medium:"px-4 py-2 text-base",large:"px-6 py-3 text-lg"}[a]," ").concat(g," ").concat(d);return e("button",{className:m,disabled:s,onClick:l,children:o})};export{r as default};
|
|
2
|
+
//# sourceMappingURL=Button.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.esm.js","sources":["../src/components/Button/index.tsx"],"sourcesContent":["import React from 'react';\n\nexport interface ButtonProps {\n children: React.ReactNode;\n variant?: 'primary' | 'secondary' | 'outline';\n size?: 'small' | 'medium' | 'large';\n disabled?: boolean;\n onClick?: () => void;\n className?: string;\n}\n\nconst Button: React.FC<ButtonProps> = ({\n children,\n variant = 'primary',\n size = 'medium',\n disabled = false,\n onClick,\n className = '',\n}) => {\n const baseClasses = 'inline-flex items-center justify-center rounded-md font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2';\n \n const variantClasses = {\n primary: 'bg-blue-600 text-white hover:bg-blue-700 focus:ring-blue-500',\n secondary: 'bg-gray-600 text-white hover:bg-gray-700 focus:ring-gray-500',\n outline: 'border border-gray-300 bg-white text-gray-700 hover:bg-gray-50 focus:ring-blue-500',\n };\n \n const sizeClasses = {\n small: 'px-3 py-1.5 text-sm',\n medium: 'px-4 py-2 text-base',\n large: 'px-6 py-3 text-lg',\n };\n \n const disabledClasses = disabled ? 'opacity-50 cursor-not-allowed' : 'cursor-pointer';\n \n const classes = `${baseClasses} ${variantClasses[variant]} ${sizeClasses[size]} ${disabledClasses} ${className}`;\n \n return (\n <button\n className={classes}\n disabled={disabled}\n onClick={onClick}\n >\n {children}\n </button>\n );\n};\n\nexport default Button; "],"names":["Button","_a","children","_b","variant","_c","size","_d","disabled","onClick","_e","className","disabledClasses","classes","concat","primary","secondary","outline","small","medium","large","_jsx"],"mappings":"wCAWM,IAAAA,EAAgC,SAACC,GACrC,IAAAC,EAAQD,EAAAC,SACRC,EAAmBF,EAAAG,QAAnBA,OAAO,IAAAD,EAAG,UAASA,EACnBE,EAAAJ,EAAAK,KAAAA,aAAO,SAAQD,EACfE,EAAAN,EAAAO,SAAAA,OAAW,IAAAD,KACXE,EAAOR,EAAAQ,QACPC,EAAcT,EAAAU,UAAdA,OAAS,IAAAD,EAAG,GAAEA,EAgBRE,EAAkBJ,EAAW,gCAAkC,iBAE/DK,EAAU,GAAAC,OAhBI,uIAgBc,KAAAA,OAdX,CACrBC,QAAS,+DACTC,UAAW,+DACXC,QAAS,sFAWsCb,eAR7B,CAClBc,MAAO,sBACPC,OAAQ,sBACRC,MAAO,qBAKgEd,GAAK,KAAAQ,OAAIF,EAAmB,KAAAE,OAAAH,GAErG,OACEU,EACE,SAAA,CAAAV,UAAWE,EACXL,SAAUA,EACVC,QAASA,WAERP,GAGP"}
|
package/dist/Button.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime");module.exports=function(r){var t=r.children,o=r.variant,i=void 0===o?"primary":o,n=r.size,c=void 0===n?"medium":n,a=r.disabled,s=void 0!==a&&a,u=r.onClick,l=r.className,d=void 0===l?"":l,g=s?"opacity-50 cursor-not-allowed":"cursor-pointer",b="".concat("inline-flex items-center justify-center rounded-md font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2"," ").concat({primary:"bg-blue-600 text-white hover:bg-blue-700 focus:ring-blue-500",secondary:"bg-gray-600 text-white hover:bg-gray-700 focus:ring-gray-500",outline:"border border-gray-300 bg-white text-gray-700 hover:bg-gray-50 focus:ring-blue-500"}[i]," ").concat({small:"px-3 py-1.5 text-sm",medium:"px-4 py-2 text-base",large:"px-6 py-3 text-lg"}[c]," ").concat(g," ").concat(d);return e.jsx("button",{className:b,disabled:s,onClick:u,children:t})};
|
|
2
|
+
//# sourceMappingURL=Button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.js","sources":["../src/components/Button/index.tsx"],"sourcesContent":["import React from 'react';\n\nexport interface ButtonProps {\n children: React.ReactNode;\n variant?: 'primary' | 'secondary' | 'outline';\n size?: 'small' | 'medium' | 'large';\n disabled?: boolean;\n onClick?: () => void;\n className?: string;\n}\n\nconst Button: React.FC<ButtonProps> = ({\n children,\n variant = 'primary',\n size = 'medium',\n disabled = false,\n onClick,\n className = '',\n}) => {\n const baseClasses = 'inline-flex items-center justify-center rounded-md font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2';\n \n const variantClasses = {\n primary: 'bg-blue-600 text-white hover:bg-blue-700 focus:ring-blue-500',\n secondary: 'bg-gray-600 text-white hover:bg-gray-700 focus:ring-gray-500',\n outline: 'border border-gray-300 bg-white text-gray-700 hover:bg-gray-50 focus:ring-blue-500',\n };\n \n const sizeClasses = {\n small: 'px-3 py-1.5 text-sm',\n medium: 'px-4 py-2 text-base',\n large: 'px-6 py-3 text-lg',\n };\n \n const disabledClasses = disabled ? 'opacity-50 cursor-not-allowed' : 'cursor-pointer';\n \n const classes = `${baseClasses} ${variantClasses[variant]} ${sizeClasses[size]} ${disabledClasses} ${className}`;\n \n return (\n <button\n className={classes}\n disabled={disabled}\n onClick={onClick}\n >\n {children}\n </button>\n );\n};\n\nexport default Button; "],"names":["_a","children","_b","variant","_c","size","_d","disabled","onClick","_e","className","disabledClasses","classes","concat","primary","secondary","outline","small","medium","large","_jsx"],"mappings":"+DAWsC,SAACA,GACrC,IAAAC,EAAQD,EAAAC,SACRC,EAAmBF,EAAAG,QAAnBA,OAAO,IAAAD,EAAG,UAASA,EACnBE,EAAAJ,EAAAK,KAAAA,aAAO,SAAQD,EACfE,EAAAN,EAAAO,SAAAA,OAAW,IAAAD,KACXE,EAAOR,EAAAQ,QACPC,EAAcT,EAAAU,UAAdA,OAAS,IAAAD,EAAG,GAAEA,EAgBRE,EAAkBJ,EAAW,gCAAkC,iBAE/DK,EAAU,GAAAC,OAhBI,uIAgBc,KAAAA,OAdX,CACrBC,QAAS,+DACTC,UAAW,+DACXC,QAAS,sFAWsCb,eAR7B,CAClBc,MAAO,sBACPC,OAAQ,sBACRC,MAAO,qBAKgEd,GAAK,KAAAQ,OAAIF,EAAmB,KAAAE,OAAAH,GAErG,OACEU,MACE,SAAA,CAAAV,UAAWE,EACXL,SAAUA,EACVC,QAASA,WAERP,GAGP"}
|
package/dist/Card.esm.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsxs as r,jsx as e}from"react/jsx-runtime";var a=function(a){var t=a.children,o=a.title,c=a.subtitle,s=a.className,d=void 0===s?"":s,i=a.onClick,l=i?"cursor-pointer":"",n="".concat("bg-white border border-gray-200 rounded-lg shadow-sm hover:shadow-md transition-shadow"," ").concat(l," ").concat(d);return r("div",{className:n,onClick:i,children:[(o||c)&&r("div",{className:"px-6 py-4 border-b border-gray-200",children:[o&&e("h3",{className:"text-lg font-semibold text-gray-900",children:o}),c&&e("p",{className:"mt-1 text-sm text-gray-600",children:c})]}),e("div",{className:"px-6 py-4",children:t})]})};export{a as default};
|
|
2
|
+
//# sourceMappingURL=Card.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Card.esm.js","sources":["../src/components/Card/index.tsx"],"sourcesContent":["import React from 'react';\n\nexport interface CardProps {\n children: React.ReactNode;\n title?: string;\n subtitle?: string;\n className?: string;\n onClick?: () => void;\n}\n\nconst Card: React.FC<CardProps> = ({\n children,\n title,\n subtitle,\n className = '',\n onClick,\n}) => {\n const baseClasses = 'bg-white border border-gray-200 rounded-lg shadow-sm hover:shadow-md transition-shadow';\n const clickableClasses = onClick ? 'cursor-pointer' : '';\n const classes = `${baseClasses} ${clickableClasses} ${className}`;\n \n return (\n <div className={classes} onClick={onClick}>\n {(title || subtitle) && (\n <div className=\"px-6 py-4 border-b border-gray-200\">\n {title && <h3 className=\"text-lg font-semibold text-gray-900\">{title}</h3>}\n {subtitle && <p className=\"mt-1 text-sm text-gray-600\">{subtitle}</p>}\n </div>\n )}\n <div className=\"px-6 py-4\">\n {children}\n </div>\n </div>\n );\n};\n\nexport default Card; "],"names":["Card","_a","children","title","subtitle","_b","className","onClick","clickableClasses","classes","concat","_jsxs","_jsx"],"mappings":"kDAUM,IAAAA,EAA4B,SAACC,GACjC,IAAAC,aACAC,EAAKF,EAAAE,MACLC,EAAQH,EAAAG,SACRC,EAAcJ,EAAAK,UAAdA,OAAY,IAAAD,EAAA,GAAEA,EACdE,EAAON,EAAAM,QAGDC,EAAmBD,EAAU,iBAAmB,GAChDE,EAAU,GAAGC,OAFC,qGAEcF,EAAgB,KAAAE,OAAIJ,GAEtD,OACEK,EAAK,MAAA,CAAAL,UAAWG,EAASF,QAASA,EAAOL,SAAA,EACrCC,GAASC,IACTO,EAAK,MAAA,CAAAL,UAAU,qCAAoCJ,SAAA,CAChDC,GAASS,EAAI,KAAA,CAAAN,UAAU,sCAAqCJ,SAAEC,IAC9DC,GAAYQ,EAAG,IAAA,CAAAN,UAAU,6BAA8BJ,SAAAE,OAG5DQ,EAAA,MAAA,CAAKN,UAAU,YAAWJ,SACvBA,MAIT"}
|
package/dist/Card.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime");module.exports=function(r){var s=r.children,t=r.title,a=r.subtitle,c=r.className,i=void 0===c?"":c,o=r.onClick,d=o?"cursor-pointer":"",l="".concat("bg-white border border-gray-200 rounded-lg shadow-sm hover:shadow-md transition-shadow"," ").concat(d," ").concat(i);return e.jsxs("div",{className:l,onClick:o,children:[(t||a)&&e.jsxs("div",{className:"px-6 py-4 border-b border-gray-200",children:[t&&e.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:t}),a&&e.jsx("p",{className:"mt-1 text-sm text-gray-600",children:a})]}),e.jsx("div",{className:"px-6 py-4",children:s})]})};
|
|
2
|
+
//# sourceMappingURL=Card.js.map
|
package/dist/Card.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Card.js","sources":["../src/components/Card/index.tsx"],"sourcesContent":["import React from 'react';\n\nexport interface CardProps {\n children: React.ReactNode;\n title?: string;\n subtitle?: string;\n className?: string;\n onClick?: () => void;\n}\n\nconst Card: React.FC<CardProps> = ({\n children,\n title,\n subtitle,\n className = '',\n onClick,\n}) => {\n const baseClasses = 'bg-white border border-gray-200 rounded-lg shadow-sm hover:shadow-md transition-shadow';\n const clickableClasses = onClick ? 'cursor-pointer' : '';\n const classes = `${baseClasses} ${clickableClasses} ${className}`;\n \n return (\n <div className={classes} onClick={onClick}>\n {(title || subtitle) && (\n <div className=\"px-6 py-4 border-b border-gray-200\">\n {title && <h3 className=\"text-lg font-semibold text-gray-900\">{title}</h3>}\n {subtitle && <p className=\"mt-1 text-sm text-gray-600\">{subtitle}</p>}\n </div>\n )}\n <div className=\"px-6 py-4\">\n {children}\n </div>\n </div>\n );\n};\n\nexport default Card; "],"names":["_a","children","title","subtitle","_b","className","onClick","clickableClasses","classes","concat","_jsxs","jsxs","_jsx","jsx"],"mappings":"+DAUkC,SAACA,GACjC,IAAAC,aACAC,EAAKF,EAAAE,MACLC,EAAQH,EAAAG,SACRC,EAAcJ,EAAAK,UAAdA,OAAY,IAAAD,EAAA,GAAEA,EACdE,EAAON,EAAAM,QAGDC,EAAmBD,EAAU,iBAAmB,GAChDE,EAAU,GAAGC,OAFC,qGAEcF,EAAgB,KAAAE,OAAIJ,GAEtD,OACEK,EAAKC,KAAA,MAAA,CAAAN,UAAWG,EAASF,QAASA,EAAOL,SAAA,EACrCC,GAASC,IACTO,EAAAA,KAAK,MAAA,CAAAL,UAAU,qCAAoCJ,SAAA,CAChDC,GAASU,EAAIC,IAAA,KAAA,CAAAR,UAAU,sCAAqCJ,SAAEC,IAC9DC,GAAYS,EAAGC,IAAA,IAAA,CAAAR,UAAU,6BAA8BJ,SAAAE,OAG5DS,EAAAA,IAAA,MAAA,CAAKP,UAAU,YAAWJ,SACvBA,MAIT"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as o}from"react/jsx-runtime";var e=function(e){var a=e.value,t=void 0===a?"":a,r=e.placeholder,n=void 0===r?"":r,c=e.type,l=void 0===c?"text":c,u=e.disabled,i=void 0!==u&&u,d=e.onChange,s=e.onFocus,p=e.onBlur,m=e.className,g=void 0===m?"":m,v=e.size,b=void 0===v?"medium":v,x=i?"opacity-50 cursor-not-allowed bg-gray-100":"bg-white",f="".concat("border border-gray-300 rounded-md transition-colors focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500"," ").concat({small:"px-3 py-1.5 text-sm",medium:"px-4 py-2 text-base",large:"px-6 py-3 text-lg"}[b]," ").concat(x," ").concat(g);return o("input",{type:l,value:t,placeholder:n,disabled:i,onChange:function(o){d&&d(o.target.value)},onFocus:s,onBlur:p,className:f})};export{e as default};
|
|
2
|
+
//# sourceMappingURL=Input.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Input.esm.js","sources":["../src/components/Input/index.tsx"],"sourcesContent":["import React from 'react';\n\nexport interface InputProps {\n value?: string;\n placeholder?: string;\n type?: 'text' | 'password' | 'email' | 'number';\n disabled?: boolean;\n onChange?: (value: string) => void;\n onFocus?: () => void;\n onBlur?: () => void;\n className?: string;\n size?: 'small' | 'medium' | 'large';\n}\n\nconst Input: React.FC<InputProps> = ({\n value = '',\n placeholder = '',\n type = 'text',\n disabled = false,\n onChange,\n onFocus,\n onBlur,\n className = '',\n size = 'medium',\n}) => {\n const baseClasses = 'border border-gray-300 rounded-md transition-colors focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500';\n \n const sizeClasses = {\n small: 'px-3 py-1.5 text-sm',\n medium: 'px-4 py-2 text-base',\n large: 'px-6 py-3 text-lg',\n };\n \n const disabledClasses = disabled ? 'opacity-50 cursor-not-allowed bg-gray-100' : 'bg-white';\n \n const classes = `${baseClasses} ${sizeClasses[size]} ${disabledClasses} ${className}`;\n \n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n if (onChange) {\n onChange(e.target.value);\n }\n };\n \n return (\n <input\n type={type}\n value={value}\n placeholder={placeholder}\n disabled={disabled}\n onChange={handleChange}\n onFocus={onFocus}\n onBlur={onBlur}\n className={classes}\n />\n );\n};\n\nexport default Input; "],"names":["Input","_a","_b","value","_c","placeholder","_d","type","_e","disabled","onChange","onFocus","onBlur","_f","className","_g","size","disabledClasses","classes","concat","small","medium","large","_jsx","e","target"],"mappings":"wCAcM,IAAAA,EAA8B,SAACC,OACnCC,EAAUD,EAAAE,MAAVA,OAAQ,IAAAD,EAAA,KACRE,EAAAH,EAAAI,YAAAA,OAAc,IAAAD,EAAA,KACdE,EAAAL,EAAAM,KAAAA,OAAI,IAAAD,EAAG,OAAMA,EACbE,EAAgBP,EAAAQ,SAAhBA,OAAQ,IAAAD,GAAQA,EAChBE,EAAQT,EAAAS,SACRC,EAAOV,EAAAU,QACPC,EAAMX,EAAAW,OACNC,EAAAZ,EAAAa,UAAAA,OAAS,IAAAD,EAAG,GAAEA,EACdE,SAAAC,OAAO,IAAAD,EAAA,SAAQA,EAUTE,EAAkBR,EAAW,4CAA8C,WAE3ES,EAAU,GAAGC,OAVC,4IAEA,CAClBC,MAAO,sBACPC,OAAQ,sBACRC,MAAO,qBAKqCN,GAAS,KAAAG,OAAAF,EAAmB,KAAAE,OAAAL,GAQ1E,OACES,EAAA,QAAA,CACEhB,KAAMA,EACNJ,MAAOA,EACPE,YAAaA,EACbI,SAAUA,EACVC,SAZiB,SAACc,GAChBd,GACFA,EAASc,EAAEC,OAAOtB,MAEtB,EASIQ,QAASA,EACTC,OAAQA,EACRE,UAAWI,GAGjB"}
|
package/dist/Input.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime");module.exports=function(o){var r=o.value,t=void 0===r?"":r,a=o.placeholder,n=void 0===a?"":a,u=o.type,c=void 0===u?"text":u,i=o.disabled,l=void 0!==i&&i,s=o.onChange,d=o.onFocus,p=o.onBlur,g=o.className,m=void 0===g?"":g,v=o.size,b=void 0===v?"medium":v,x=l?"opacity-50 cursor-not-allowed bg-gray-100":"bg-white",y="".concat("border border-gray-300 rounded-md transition-colors focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500"," ").concat({small:"px-3 py-1.5 text-sm",medium:"px-4 py-2 text-base",large:"px-6 py-3 text-lg"}[b]," ").concat(x," ").concat(m);return e.jsx("input",{type:c,value:t,placeholder:n,disabled:l,onChange:function(e){s&&s(e.target.value)},onFocus:d,onBlur:p,className:y})};
|
|
2
|
+
//# sourceMappingURL=Input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Input.js","sources":["../src/components/Input/index.tsx"],"sourcesContent":["import React from 'react';\n\nexport interface InputProps {\n value?: string;\n placeholder?: string;\n type?: 'text' | 'password' | 'email' | 'number';\n disabled?: boolean;\n onChange?: (value: string) => void;\n onFocus?: () => void;\n onBlur?: () => void;\n className?: string;\n size?: 'small' | 'medium' | 'large';\n}\n\nconst Input: React.FC<InputProps> = ({\n value = '',\n placeholder = '',\n type = 'text',\n disabled = false,\n onChange,\n onFocus,\n onBlur,\n className = '',\n size = 'medium',\n}) => {\n const baseClasses = 'border border-gray-300 rounded-md transition-colors focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500';\n \n const sizeClasses = {\n small: 'px-3 py-1.5 text-sm',\n medium: 'px-4 py-2 text-base',\n large: 'px-6 py-3 text-lg',\n };\n \n const disabledClasses = disabled ? 'opacity-50 cursor-not-allowed bg-gray-100' : 'bg-white';\n \n const classes = `${baseClasses} ${sizeClasses[size]} ${disabledClasses} ${className}`;\n \n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n if (onChange) {\n onChange(e.target.value);\n }\n };\n \n return (\n <input\n type={type}\n value={value}\n placeholder={placeholder}\n disabled={disabled}\n onChange={handleChange}\n onFocus={onFocus}\n onBlur={onBlur}\n className={classes}\n />\n );\n};\n\nexport default Input; "],"names":["_a","_b","value","_c","placeholder","_d","type","_e","disabled","onChange","onFocus","onBlur","_f","className","_g","size","disabledClasses","classes","concat","small","medium","large","_jsx","jsx","e","target"],"mappings":"+DAcoC,SAACA,OACnCC,EAAUD,EAAAE,MAAVA,OAAQ,IAAAD,EAAA,KACRE,EAAAH,EAAAI,YAAAA,OAAc,IAAAD,EAAA,KACdE,EAAAL,EAAAM,KAAAA,OAAI,IAAAD,EAAG,OAAMA,EACbE,EAAgBP,EAAAQ,SAAhBA,OAAQ,IAAAD,GAAQA,EAChBE,EAAQT,EAAAS,SACRC,EAAOV,EAAAU,QACPC,EAAMX,EAAAW,OACNC,EAAAZ,EAAAa,UAAAA,OAAS,IAAAD,EAAG,GAAEA,EACdE,SAAAC,OAAO,IAAAD,EAAA,SAAQA,EAUTE,EAAkBR,EAAW,4CAA8C,WAE3ES,EAAU,GAAGC,OAVC,4IAEA,CAClBC,MAAO,sBACPC,OAAQ,sBACRC,MAAO,qBAKqCN,GAAS,KAAAG,OAAAF,EAAmB,KAAAE,OAAAL,GAQ1E,OACES,EAAAC,IAAA,QAAA,CACEjB,KAAMA,EACNJ,MAAOA,EACPE,YAAaA,EACbI,SAAUA,EACVC,SAZiB,SAACe,GAChBf,GACFA,EAASe,EAAEC,OAAOvB,MAEtB,EASIQ,QAASA,EACTC,OAAQA,EACRE,UAAWI,GAGjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TestComponent.esm.js","sources":["../src/components/TestComponent/index.tsx"],"sourcesContent":["import React from 'react';\n\nexport interface TestComponentProps {\n children?: React.ReactNode;\n className?: string;\n // TODO: 添加更多属性\n}\n\nconst TestComponent: React.FC<TestComponentProps> = ({\n children,\n className = '',\n}) => {\n return (\n <div className={`testcomponent-component ${className}`}>\n {children}\n </div>\n );\n};\n\nexport default TestComponent;\n"],"names":["TestComponent","_a","children","_b","className","_jsx","concat"],"mappings":"wCAQM,IAAAA,EAA8C,SAACC,GACnD,IAAAC,aACAC,EAAAF,EAAAG,UAEA,OACEC,EAAK,MAAA,CAAAD,UAAW,2BAAAE,YAHT,IAAAH,EAAG,GAAEA,GAITD,SAAAA,GAGP"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TestComponent.js","sources":["../src/components/TestComponent/index.tsx"],"sourcesContent":["import React from 'react';\n\nexport interface TestComponentProps {\n children?: React.ReactNode;\n className?: string;\n // TODO: 添加更多属性\n}\n\nconst TestComponent: React.FC<TestComponentProps> = ({\n children,\n className = '',\n}) => {\n return (\n <div className={`testcomponent-component ${className}`}>\n {children}\n </div>\n );\n};\n\nexport default TestComponent;\n"],"names":["_a","children","_b","className","_jsx","concat"],"mappings":"+DAQoD,SAACA,GACnD,IAAAC,aACAC,EAAAF,EAAAG,UAAAA,OAAS,IAAAD,EAAG,GAAEA,EAEd,OACEE,MAAK,MAAA,CAAAD,UAAW,2BAAAE,OAA2BF,GACxCF,SAAAA,GAGP"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const AlertIcon: {
|
|
2
|
+
success: import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
error: import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
warning: import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
info: import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
};
|
|
7
|
+
export declare const CloseIcon: import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface AlertProps {
|
|
3
|
+
title?: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
className?: string;
|
|
6
|
+
type: "success" | "error" | "warning" | "info";
|
|
7
|
+
icon?: React.ReactNode;
|
|
8
|
+
showIcon?: boolean;
|
|
9
|
+
closeable?: boolean;
|
|
10
|
+
action?: React.ReactNode;
|
|
11
|
+
}
|
|
12
|
+
declare const Alert: React.FC<AlertProps>;
|
|
13
|
+
export default Alert;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface AlertComponentProps {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
variant?: 'success' | 'error' | 'warning' | 'info';
|
|
5
|
+
className?: string;
|
|
6
|
+
onClose?: () => void;
|
|
7
|
+
}
|
|
8
|
+
declare const AlertComponent: React.FC<AlertComponentProps>;
|
|
9
|
+
export default AlertComponent;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface ButtonProps {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
variant?: 'primary' | 'secondary' | 'outline';
|
|
5
|
+
size?: 'small' | 'medium' | 'large';
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
onClick?: () => void;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
declare const Button: React.FC<ButtonProps>;
|
|
11
|
+
export default Button;
|