@npm-tuan17tuii/ui-components 1.0.0 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +107 -107
- package/dist/index.css +101 -0
- package/dist/index.css.map +1 -0
- package/dist/index.d.mts +74 -2
- package/dist/index.d.ts +74 -2
- package/dist/index.js +323 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +321 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +63 -47
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 tuan17tui
|
|
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.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 tuan17tui
|
|
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
CHANGED
|
@@ -1,107 +1,107 @@
|
|
|
1
|
-
# @tuan17tui/ui-components
|
|
2
|
-
|
|
3
|
-
[](https://www.npmjs.com/package/@tuan17tui/ui-components)
|
|
4
|
-
[](https://opensource.org/licenses/MIT)
|
|
5
|
-
|
|
6
|
-
Thư viện UI Components cho React, được build bằng TypeScript và tsup.
|
|
7
|
-
|
|
8
|
-
## 🚀 Cài đặt
|
|
9
|
-
|
|
10
|
-
```bash
|
|
11
|
-
npm install @tuan17tui/ui-components
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
hoặc
|
|
15
|
-
|
|
16
|
-
```bash
|
|
17
|
-
yarn add @tuan17tui/ui-components
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
## 📦 Sử dụng
|
|
21
|
-
|
|
22
|
-
### Import Components
|
|
23
|
-
|
|
24
|
-
```tsx
|
|
25
|
-
import { Button, Prompt } from '@tuan17tui/ui-components';
|
|
26
|
-
|
|
27
|
-
function App() {
|
|
28
|
-
return (
|
|
29
|
-
<div>
|
|
30
|
-
<Button variant="primary" size="medium">
|
|
31
|
-
Click me
|
|
32
|
-
</Button>
|
|
33
|
-
|
|
34
|
-
<Prompt
|
|
35
|
-
type="success"
|
|
36
|
-
title="Thành công!"
|
|
37
|
-
message="Thao tác đã được thực hiện thành công."
|
|
38
|
-
/>
|
|
39
|
-
</div>
|
|
40
|
-
);
|
|
41
|
-
}
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
## 🎨 Components
|
|
45
|
-
|
|
46
|
-
### Button
|
|
47
|
-
|
|
48
|
-
Component button với nhiều variants và sizes.
|
|
49
|
-
|
|
50
|
-
**Props:**
|
|
51
|
-
- `variant`: `'primary' | 'secondary' | 'outline'` (default: `'primary'`)
|
|
52
|
-
- `size`: `'small' | 'medium' | 'large'` (default: `'medium'`)
|
|
53
|
-
- `loading`: `boolean` (default: `false`)
|
|
54
|
-
- Kế thừa tất cả props của HTML button element
|
|
55
|
-
|
|
56
|
-
**Ví dụ:**
|
|
57
|
-
|
|
58
|
-
```tsx
|
|
59
|
-
<Button variant="primary" size="large" onClick={() => alert('Clicked!')}>
|
|
60
|
-
Primary Button
|
|
61
|
-
</Button>
|
|
62
|
-
|
|
63
|
-
<Button variant="outline" size="small" loading>
|
|
64
|
-
Loading...
|
|
65
|
-
</Button>
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
### Prompt
|
|
69
|
-
|
|
70
|
-
Component hiển thị thông báo với các loại khác nhau.
|
|
71
|
-
|
|
72
|
-
**Props:**
|
|
73
|
-
- `title`: `string` (required) - Tiêu đề prompt
|
|
74
|
-
- `message`: `string` (required) - Nội dung thông báo
|
|
75
|
-
- `type`: `'info' | 'success' | 'warning' | 'error'` (default: `'info'`)
|
|
76
|
-
- `closable`: `boolean` (default: `true`)
|
|
77
|
-
- `onClose`: `() => void` - Callback khi đóng
|
|
78
|
-
- Kế thừa tất cả props của HTML div element
|
|
79
|
-
|
|
80
|
-
**Ví dụ:**
|
|
81
|
-
|
|
82
|
-
```tsx
|
|
83
|
-
<Prompt
|
|
84
|
-
type="error"
|
|
85
|
-
title="Lỗi"
|
|
86
|
-
message="Đã xảy ra lỗi trong quá trình xử lý."
|
|
87
|
-
onClose={() => console.log('Prompt closed')}
|
|
88
|
-
/>
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
## 🛠️ Development
|
|
92
|
-
|
|
93
|
-
### Build
|
|
94
|
-
|
|
95
|
-
```bash
|
|
96
|
-
npm run build
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
### Watch mode
|
|
100
|
-
|
|
101
|
-
```bash
|
|
102
|
-
npm run dev
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
## 📄 License
|
|
106
|
-
|
|
107
|
-
MIT © tuan17tui
|
|
1
|
+
# @tuan17tui/ui-components
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@tuan17tui/ui-components)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
5
|
+
|
|
6
|
+
Thư viện UI Components cho React, được build bằng TypeScript và tsup.
|
|
7
|
+
|
|
8
|
+
## 🚀 Cài đặt
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npm install @tuan17tui/ui-components
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
hoặc
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
yarn add @tuan17tui/ui-components
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## 📦 Sử dụng
|
|
21
|
+
|
|
22
|
+
### Import Components
|
|
23
|
+
|
|
24
|
+
```tsx
|
|
25
|
+
import { Button, Prompt } from '@tuan17tui/ui-components';
|
|
26
|
+
|
|
27
|
+
function App() {
|
|
28
|
+
return (
|
|
29
|
+
<div>
|
|
30
|
+
<Button variant="primary" size="medium">
|
|
31
|
+
Click me
|
|
32
|
+
</Button>
|
|
33
|
+
|
|
34
|
+
<Prompt
|
|
35
|
+
type="success"
|
|
36
|
+
title="Thành công!"
|
|
37
|
+
message="Thao tác đã được thực hiện thành công."
|
|
38
|
+
/>
|
|
39
|
+
</div>
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## 🎨 Components
|
|
45
|
+
|
|
46
|
+
### Button
|
|
47
|
+
|
|
48
|
+
Component button với nhiều variants và sizes.
|
|
49
|
+
|
|
50
|
+
**Props:**
|
|
51
|
+
- `variant`: `'primary' | 'secondary' | 'outline'` (default: `'primary'`)
|
|
52
|
+
- `size`: `'small' | 'medium' | 'large'` (default: `'medium'`)
|
|
53
|
+
- `loading`: `boolean` (default: `false`)
|
|
54
|
+
- Kế thừa tất cả props của HTML button element
|
|
55
|
+
|
|
56
|
+
**Ví dụ:**
|
|
57
|
+
|
|
58
|
+
```tsx
|
|
59
|
+
<Button variant="primary" size="large" onClick={() => alert('Clicked!')}>
|
|
60
|
+
Primary Button
|
|
61
|
+
</Button>
|
|
62
|
+
|
|
63
|
+
<Button variant="outline" size="small" loading>
|
|
64
|
+
Loading...
|
|
65
|
+
</Button>
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Prompt
|
|
69
|
+
|
|
70
|
+
Component hiển thị thông báo với các loại khác nhau.
|
|
71
|
+
|
|
72
|
+
**Props:**
|
|
73
|
+
- `title`: `string` (required) - Tiêu đề prompt
|
|
74
|
+
- `message`: `string` (required) - Nội dung thông báo
|
|
75
|
+
- `type`: `'info' | 'success' | 'warning' | 'error'` (default: `'info'`)
|
|
76
|
+
- `closable`: `boolean` (default: `true`)
|
|
77
|
+
- `onClose`: `() => void` - Callback khi đóng
|
|
78
|
+
- Kế thừa tất cả props của HTML div element
|
|
79
|
+
|
|
80
|
+
**Ví dụ:**
|
|
81
|
+
|
|
82
|
+
```tsx
|
|
83
|
+
<Prompt
|
|
84
|
+
type="error"
|
|
85
|
+
title="Lỗi"
|
|
86
|
+
message="Đã xảy ra lỗi trong quá trình xử lý."
|
|
87
|
+
onClose={() => console.log('Prompt closed')}
|
|
88
|
+
/>
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## 🛠️ Development
|
|
92
|
+
|
|
93
|
+
### Build
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
npm run build
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### Watch mode
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
npm run dev
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## 📄 License
|
|
106
|
+
|
|
107
|
+
MIT © tuan17tui
|
package/dist/index.css
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/* src/ProfileFrame/ProfileFrame.css */
|
|
2
|
+
@keyframes profile-frame-spin {
|
|
3
|
+
0% {
|
|
4
|
+
transform: rotate(0deg);
|
|
5
|
+
}
|
|
6
|
+
100% {
|
|
7
|
+
transform: rotate(360deg);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
.profile-frame-container {
|
|
11
|
+
position: relative;
|
|
12
|
+
overflow: hidden;
|
|
13
|
+
width: var(--frame-width, 100%);
|
|
14
|
+
height: var(--frame-height, 100vh);
|
|
15
|
+
background-color: var(--loader-bg-color, #ffffff);
|
|
16
|
+
}
|
|
17
|
+
.profile-frame-iframe {
|
|
18
|
+
width: 100%;
|
|
19
|
+
height: 100%;
|
|
20
|
+
border: none;
|
|
21
|
+
}
|
|
22
|
+
.profile-frame-iframe--loading {
|
|
23
|
+
display: none;
|
|
24
|
+
}
|
|
25
|
+
.profile-frame-iframe--error {
|
|
26
|
+
opacity: 0.5;
|
|
27
|
+
}
|
|
28
|
+
.profile-frame-loader {
|
|
29
|
+
position: absolute;
|
|
30
|
+
top: 0;
|
|
31
|
+
left: 0;
|
|
32
|
+
right: 0;
|
|
33
|
+
bottom: 0;
|
|
34
|
+
display: flex;
|
|
35
|
+
align-items: center;
|
|
36
|
+
justify-content: center;
|
|
37
|
+
flex-direction: column;
|
|
38
|
+
gap: 20px;
|
|
39
|
+
z-index: 10;
|
|
40
|
+
background-color: var(--loader-bg-color, #ffffff);
|
|
41
|
+
}
|
|
42
|
+
.profile-frame-loader--hidden {
|
|
43
|
+
display: none;
|
|
44
|
+
}
|
|
45
|
+
.profile-frame-spinner {
|
|
46
|
+
width: 50px;
|
|
47
|
+
height: 50px;
|
|
48
|
+
border: 5px solid rgba(0, 0, 0, 0.1);
|
|
49
|
+
border-top-color: var(--spinner-color, #3182ce);
|
|
50
|
+
border-radius: 50%;
|
|
51
|
+
animation: profile-frame-spin 0.8s linear infinite;
|
|
52
|
+
}
|
|
53
|
+
.profile-frame-loading-text {
|
|
54
|
+
font-size: 16px;
|
|
55
|
+
color: #666;
|
|
56
|
+
font-weight: 500;
|
|
57
|
+
font-family:
|
|
58
|
+
system-ui,
|
|
59
|
+
-apple-system,
|
|
60
|
+
sans-serif;
|
|
61
|
+
}
|
|
62
|
+
.profile-frame-error {
|
|
63
|
+
position: absolute;
|
|
64
|
+
top: 50%;
|
|
65
|
+
left: 50%;
|
|
66
|
+
transform: translate(-50%, -50%);
|
|
67
|
+
text-align: center;
|
|
68
|
+
padding: 24px;
|
|
69
|
+
max-width: 500px;
|
|
70
|
+
display: none;
|
|
71
|
+
}
|
|
72
|
+
.profile-frame-error--visible {
|
|
73
|
+
display: block;
|
|
74
|
+
}
|
|
75
|
+
.profile-frame-error__title {
|
|
76
|
+
font-size: 18px;
|
|
77
|
+
font-weight: bold;
|
|
78
|
+
color: #e53e3e;
|
|
79
|
+
margin-bottom: 12px;
|
|
80
|
+
}
|
|
81
|
+
.profile-frame-error__message {
|
|
82
|
+
font-size: 14px;
|
|
83
|
+
color: #666;
|
|
84
|
+
line-height: 1.6;
|
|
85
|
+
margin-bottom: 16px;
|
|
86
|
+
}
|
|
87
|
+
.profile-frame-error__link {
|
|
88
|
+
display: inline-block;
|
|
89
|
+
padding: 10px 20px;
|
|
90
|
+
background-color: #3182ce;
|
|
91
|
+
color: #fff;
|
|
92
|
+
text-decoration: none;
|
|
93
|
+
border-radius: 6px;
|
|
94
|
+
font-size: 14px;
|
|
95
|
+
font-weight: 500;
|
|
96
|
+
transition: all 0.2s ease;
|
|
97
|
+
}
|
|
98
|
+
.profile-frame-error__link:hover {
|
|
99
|
+
background-color: #2c5282;
|
|
100
|
+
}
|
|
101
|
+
/*# sourceMappingURL=index.css.map */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/ProfileFrame/ProfileFrame.css"],"sourcesContent":["@keyframes profile-frame-spin {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n}\n\n.profile-frame-container {\n position: relative;\n overflow: hidden;\n width: var(--frame-width, 100%);\n height: var(--frame-height, 100vh);\n background-color: var(--loader-bg-color, #ffffff);\n}\n\n.profile-frame-iframe {\n width: 100%;\n height: 100%;\n border: none;\n}\n\n.profile-frame-iframe--loading {\n display: none;\n}\n\n.profile-frame-iframe--error {\n opacity: 0.5;\n}\n\n.profile-frame-loader {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n gap: 20px;\n z-index: 10;\n background-color: var(--loader-bg-color, #ffffff);\n}\n\n.profile-frame-loader--hidden {\n display: none;\n}\n\n.profile-frame-spinner {\n width: 50px;\n height: 50px;\n border: 5px solid rgba(0, 0, 0, 0.1);\n border-top-color: var(--spinner-color, #3182ce);\n border-radius: 50%;\n animation: profile-frame-spin 0.8s linear infinite;\n}\n\n.profile-frame-loading-text {\n font-size: 16px;\n color: #666;\n font-weight: 500;\n font-family: system-ui, -apple-system, sans-serif;\n}\n\n.profile-frame-error {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n text-align: center;\n padding: 24px;\n max-width: 500px;\n display: none;\n}\n\n.profile-frame-error--visible {\n display: block;\n}\n\n.profile-frame-error__title {\n font-size: 18px;\n font-weight: bold;\n color: #e53e3e;\n margin-bottom: 12px;\n}\n\n.profile-frame-error__message {\n font-size: 14px;\n color: #666;\n line-height: 1.6;\n margin-bottom: 16px;\n}\n\n.profile-frame-error__link {\n display: inline-block;\n padding: 10px 20px;\n background-color: #3182ce;\n color: #fff;\n text-decoration: none;\n border-radius: 6px;\n font-size: 14px;\n font-weight: 500;\n transition: all 0.2s ease;\n}\n\n.profile-frame-error__link:hover {\n background-color: #2c5282;\n}\n"],"mappings":";AAAA,WAAW;AACT;AACE,eAAW,OAAO;AACpB;AACA;AACE,eAAW,OAAO;AACpB;AACF;AAEA,CAAC;AACC,YAAU;AACV,YAAU;AACV,SAAO,IAAI,aAAa,EAAE;AAC1B,UAAQ,IAAI,cAAc,EAAE;AAC5B,oBAAkB,IAAI,iBAAiB,EAAE;AAC3C;AAEA,CAAC;AACC,SAAO;AACP,UAAQ;AACR,UAAQ;AACV;AAEA,CAAC;AACC,WAAS;AACX;AAEA,CAAC;AACC,WAAS;AACX;AAEA,CAAC;AACC,YAAU;AACV,OAAK;AACL,QAAM;AACN,SAAO;AACP,UAAQ;AACR,WAAS;AACT,eAAa;AACb,mBAAiB;AACjB,kBAAgB;AAChB,OAAK;AACL,WAAS;AACT,oBAAkB,IAAI,iBAAiB,EAAE;AAC3C;AAEA,CAAC;AACC,WAAS;AACX;AAEA,CAAC;AACC,SAAO;AACP,UAAQ;AACR,UAAQ,IAAI,MAAM,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE;AAChC,oBAAkB,IAAI,eAAe,EAAE;AACvC,iBAAe;AACf,aAAW,mBAAmB,KAAK,OAAO;AAC5C;AAEA,CAAC;AACC,aAAW;AACX,SAAO;AACP,eAAa;AACb;AAAA,IAAa,SAAS;AAAA,IAAE,aAAa;AAAA,IAAE;AACzC;AAEA,CAAC;AACC,YAAU;AACV,OAAK;AACL,QAAM;AACN,aAAW,UAAU,IAAI,EAAE;AAC3B,cAAY;AACZ,WAAS;AACT,aAAW;AACX,WAAS;AACX;AAEA,CAAC;AACC,WAAS;AACX;AAEA,CAAC;AACC,aAAW;AACX,eAAa;AACb,SAAO;AACP,iBAAe;AACjB;AAEA,CAAC;AACC,aAAW;AACX,SAAO;AACP,eAAa;AACb,iBAAe;AACjB;AAEA,CAAC;AACC,WAAS;AACT,WAAS,KAAK;AACd,oBAAkB;AAClB,SAAO;AACP,mBAAiB;AACjB,iBAAe;AACf,aAAW;AACX,eAAa;AACb,cAAY,IAAI,KAAK;AACvB;AAEA,CAZC,yBAYyB;AACxB,oBAAkB;AACpB;","names":[]}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import React, { ButtonHTMLAttributes, HTMLAttributes } from 'react';
|
|
1
|
+
import React, { ButtonHTMLAttributes, HTMLAttributes, IframeHTMLAttributes } from 'react';
|
|
2
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
3
|
|
|
3
4
|
interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
4
5
|
/**
|
|
@@ -40,4 +41,75 @@ interface PromptProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
|
40
41
|
}
|
|
41
42
|
declare const Prompt: React.FC<PromptProps>;
|
|
42
43
|
|
|
43
|
-
|
|
44
|
+
interface ProfileFrameProps extends Omit<IframeHTMLAttributes<HTMLIFrameElement>, 'src'> {
|
|
45
|
+
/**
|
|
46
|
+
* URL của trang web profile (mặc định: https://personal-website-black-two-43.vercel.app)
|
|
47
|
+
*/
|
|
48
|
+
url?: string;
|
|
49
|
+
/**
|
|
50
|
+
* Chiều cao của frame
|
|
51
|
+
*/
|
|
52
|
+
height?: string | number;
|
|
53
|
+
/**
|
|
54
|
+
* Chiều rộng của frame
|
|
55
|
+
*/
|
|
56
|
+
width?: string | number;
|
|
57
|
+
/**
|
|
58
|
+
* Hiển thị loading spinner
|
|
59
|
+
*/
|
|
60
|
+
showLoader?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Thông báo loading
|
|
63
|
+
*/
|
|
64
|
+
loadingMessage?: string;
|
|
65
|
+
/**
|
|
66
|
+
* Màu nền loading
|
|
67
|
+
*/
|
|
68
|
+
loaderBgColor?: string;
|
|
69
|
+
/**
|
|
70
|
+
* Màu spinner
|
|
71
|
+
*/
|
|
72
|
+
spinnerColor?: string;
|
|
73
|
+
}
|
|
74
|
+
declare const ProfileFrame: React.FC<ProfileFrameProps>;
|
|
75
|
+
|
|
76
|
+
type Props$2 = {
|
|
77
|
+
initialDensity?: number;
|
|
78
|
+
initialWind?: number;
|
|
79
|
+
initialSize?: number;
|
|
80
|
+
showSettings?: boolean;
|
|
81
|
+
bgColor?: string;
|
|
82
|
+
bgColor1?: string;
|
|
83
|
+
bgColor2?: string;
|
|
84
|
+
bgColor3?: string;
|
|
85
|
+
colorStop1?: number;
|
|
86
|
+
colorStop2?: number;
|
|
87
|
+
colorStop3?: number;
|
|
88
|
+
};
|
|
89
|
+
declare const SnowNightSceneApp: ({ initialDensity, initialWind, initialSize, showSettings, bgColor, bgColor1, bgColor2, bgColor3, colorStop1, colorStop2, colorStop3, }: Props$2) => react_jsx_runtime.JSX.Element;
|
|
90
|
+
|
|
91
|
+
type Props$1 = {
|
|
92
|
+
density: number;
|
|
93
|
+
wind: number;
|
|
94
|
+
size: number;
|
|
95
|
+
bgColor?: string;
|
|
96
|
+
bgColor1?: string;
|
|
97
|
+
bgColor2?: string;
|
|
98
|
+
bgColor3?: string;
|
|
99
|
+
colorStop1?: number;
|
|
100
|
+
colorStop2?: number;
|
|
101
|
+
colorStop3?: number;
|
|
102
|
+
};
|
|
103
|
+
declare const SnowScene: ({ density, wind, size, bgColor, bgColor1, bgColor2, bgColor3, colorStop1, colorStop2, colorStop3, }: Props$1) => react_jsx_runtime.JSX.Element;
|
|
104
|
+
|
|
105
|
+
type Props = {
|
|
106
|
+
density: number;
|
|
107
|
+
wind: number;
|
|
108
|
+
size: number;
|
|
109
|
+
setDensity: (v: number) => void;
|
|
110
|
+
setWind: (v: number) => void;
|
|
111
|
+
setSize: (v: number) => void;
|
|
112
|
+
};
|
|
113
|
+
declare const SnowSettings: ({ density, wind, size, setDensity, setWind, setSize, }: Props) => react_jsx_runtime.JSX.Element;
|
|
114
|
+
|
|
115
|
+
export { Button, type ButtonProps, ProfileFrame, type ProfileFrameProps, Prompt, type PromptProps, SnowNightSceneApp, SnowScene, SnowSettings };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import React, { ButtonHTMLAttributes, HTMLAttributes } from 'react';
|
|
1
|
+
import React, { ButtonHTMLAttributes, HTMLAttributes, IframeHTMLAttributes } from 'react';
|
|
2
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
3
|
|
|
3
4
|
interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
4
5
|
/**
|
|
@@ -40,4 +41,75 @@ interface PromptProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
|
40
41
|
}
|
|
41
42
|
declare const Prompt: React.FC<PromptProps>;
|
|
42
43
|
|
|
43
|
-
|
|
44
|
+
interface ProfileFrameProps extends Omit<IframeHTMLAttributes<HTMLIFrameElement>, 'src'> {
|
|
45
|
+
/**
|
|
46
|
+
* URL của trang web profile (mặc định: https://personal-website-black-two-43.vercel.app)
|
|
47
|
+
*/
|
|
48
|
+
url?: string;
|
|
49
|
+
/**
|
|
50
|
+
* Chiều cao của frame
|
|
51
|
+
*/
|
|
52
|
+
height?: string | number;
|
|
53
|
+
/**
|
|
54
|
+
* Chiều rộng của frame
|
|
55
|
+
*/
|
|
56
|
+
width?: string | number;
|
|
57
|
+
/**
|
|
58
|
+
* Hiển thị loading spinner
|
|
59
|
+
*/
|
|
60
|
+
showLoader?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Thông báo loading
|
|
63
|
+
*/
|
|
64
|
+
loadingMessage?: string;
|
|
65
|
+
/**
|
|
66
|
+
* Màu nền loading
|
|
67
|
+
*/
|
|
68
|
+
loaderBgColor?: string;
|
|
69
|
+
/**
|
|
70
|
+
* Màu spinner
|
|
71
|
+
*/
|
|
72
|
+
spinnerColor?: string;
|
|
73
|
+
}
|
|
74
|
+
declare const ProfileFrame: React.FC<ProfileFrameProps>;
|
|
75
|
+
|
|
76
|
+
type Props$2 = {
|
|
77
|
+
initialDensity?: number;
|
|
78
|
+
initialWind?: number;
|
|
79
|
+
initialSize?: number;
|
|
80
|
+
showSettings?: boolean;
|
|
81
|
+
bgColor?: string;
|
|
82
|
+
bgColor1?: string;
|
|
83
|
+
bgColor2?: string;
|
|
84
|
+
bgColor3?: string;
|
|
85
|
+
colorStop1?: number;
|
|
86
|
+
colorStop2?: number;
|
|
87
|
+
colorStop3?: number;
|
|
88
|
+
};
|
|
89
|
+
declare const SnowNightSceneApp: ({ initialDensity, initialWind, initialSize, showSettings, bgColor, bgColor1, bgColor2, bgColor3, colorStop1, colorStop2, colorStop3, }: Props$2) => react_jsx_runtime.JSX.Element;
|
|
90
|
+
|
|
91
|
+
type Props$1 = {
|
|
92
|
+
density: number;
|
|
93
|
+
wind: number;
|
|
94
|
+
size: number;
|
|
95
|
+
bgColor?: string;
|
|
96
|
+
bgColor1?: string;
|
|
97
|
+
bgColor2?: string;
|
|
98
|
+
bgColor3?: string;
|
|
99
|
+
colorStop1?: number;
|
|
100
|
+
colorStop2?: number;
|
|
101
|
+
colorStop3?: number;
|
|
102
|
+
};
|
|
103
|
+
declare const SnowScene: ({ density, wind, size, bgColor, bgColor1, bgColor2, bgColor3, colorStop1, colorStop2, colorStop3, }: Props$1) => react_jsx_runtime.JSX.Element;
|
|
104
|
+
|
|
105
|
+
type Props = {
|
|
106
|
+
density: number;
|
|
107
|
+
wind: number;
|
|
108
|
+
size: number;
|
|
109
|
+
setDensity: (v: number) => void;
|
|
110
|
+
setWind: (v: number) => void;
|
|
111
|
+
setSize: (v: number) => void;
|
|
112
|
+
};
|
|
113
|
+
declare const SnowSettings: ({ density, wind, size, setDensity, setWind, setSize, }: Props) => react_jsx_runtime.JSX.Element;
|
|
114
|
+
|
|
115
|
+
export { Button, type ButtonProps, ProfileFrame, type ProfileFrameProps, Prompt, type PromptProps, SnowNightSceneApp, SnowScene, SnowSettings };
|