@windrun-huaiin/third-ui 3.2.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 +210 -0
- package/dist/clerk/index.d.mts +33 -0
- package/dist/clerk/index.d.ts +33 -0
- package/dist/clerk/index.js +2395 -0
- package/dist/clerk/index.js.map +1 -0
- package/dist/clerk/index.mjs +2361 -0
- package/dist/clerk/index.mjs.map +1 -0
- package/dist/cta.css +16 -0
- package/dist/fuma/index.d.mts +51 -0
- package/dist/fuma/index.d.ts +51 -0
- package/dist/fuma/index.js +2976 -0
- package/dist/fuma/index.js.map +1 -0
- package/dist/fuma/index.mjs +2944 -0
- package/dist/fuma/index.mjs.map +1 -0
- package/dist/fuma/mdx/index.d.mts +94 -0
- package/dist/fuma/mdx/index.d.ts +94 -0
- package/dist/fuma/mdx/index.js +2866 -0
- package/dist/fuma/mdx/index.js.map +1 -0
- package/dist/fuma/mdx/index.mjs +2827 -0
- package/dist/fuma/mdx/index.mjs.map +1 -0
- package/dist/fuma.css +132 -0
- package/dist/index.d.mts +5 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +3597 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +3549 -0
- package/dist/index.mjs.map +1 -0
- package/dist/lib/index.d.mts +4414 -0
- package/dist/lib/index.d.ts +4414 -0
- package/dist/lib/index.js +127 -0
- package/dist/lib/index.js.map +1 -0
- package/dist/lib/index.mjs +95 -0
- package/dist/lib/index.mjs.map +1 -0
- package/dist/main/index.d.mts +25 -0
- package/dist/main/index.d.ts +25 -0
- package/dist/main/index.js +3003 -0
- package/dist/main/index.js.map +1 -0
- package/dist/main/index.mjs +2963 -0
- package/dist/main/index.mjs.map +1 -0
- package/dist/third-ui.css +44 -0
- package/package.json +106 -0
- package/src/clerk/clerk-organization.tsx +47 -0
- package/src/clerk/clerk-page-generator.tsx +42 -0
- package/src/clerk/clerk-provider-client.tsx +57 -0
- package/src/clerk/clerk-user.tsx +59 -0
- package/src/clerk/index.ts +5 -0
- package/src/fuma/fuma-banner-suit.tsx +16 -0
- package/src/fuma/fuma-github-info.tsx +194 -0
- package/src/fuma/fuma-page-genarator.tsx +94 -0
- package/src/fuma/index.ts +4 -0
- package/src/fuma/mdx/airtical-card.tsx +56 -0
- package/src/fuma/mdx/gradient-button.tsx +62 -0
- package/src/fuma/mdx/image-grid.tsx +35 -0
- package/src/fuma/mdx/image-zoom.tsx +84 -0
- package/src/fuma/mdx/index.ts +8 -0
- package/src/fuma/mdx/mermaid.tsx +87 -0
- package/src/fuma/mdx/toc-base.tsx +88 -0
- package/src/fuma/mdx/toc.tsx +35 -0
- package/src/fuma/mdx/trophy-card.tsx +36 -0
- package/src/fuma/mdx/zia-card.tsx +46 -0
- package/src/index.ts +4 -0
- package/src/lib/clerk-intl.ts +13 -0
- package/src/lib/fuma-schema-check-util.ts +73 -0
- package/src/lib/fuma-search-util.ts +6 -0
- package/src/lib/index.ts +3 -0
- package/src/main/ads-alert-dialog.tsx +133 -0
- package/src/main/cta.tsx +28 -0
- package/src/main/faq.tsx +58 -0
- package/src/main/features.tsx +35 -0
- package/src/main/footer.tsx +37 -0
- package/src/main/gallery.tsx +68 -0
- package/src/main/go-to-top.tsx +44 -0
- package/src/main/index.ts +12 -0
- package/src/main/loading.tsx +93 -0
- package/src/main/nprogress-bar.tsx +24 -0
- package/src/main/seo-content.tsx +34 -0
- package/src/main/tips.tsx +38 -0
- package/src/main/usage.tsx +45 -0
- package/src/styles/cta.css +16 -0
- package/src/styles/fuma.css +132 -0
- package/src/styles/third-ui.css +43 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 D8ger
|
|
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,210 @@
|
|
|
1
|
+
# @windrun-huaiin/third-ui
|
|
2
|
+
|
|
3
|
+
Third-party integrated UI components library, including Clerk authentication, Fumadocs documentation, and main application components.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm add @windrun-huaiin/third-ui
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## TailwindCSS 4.x Config
|
|
12
|
+
|
|
13
|
+
- Assume you have a project structure like this:
|
|
14
|
+
|
|
15
|
+
```txt
|
|
16
|
+
Your-project/
|
|
17
|
+
├── src/
|
|
18
|
+
│ └── app/
|
|
19
|
+
│ └── globals.css
|
|
20
|
+
├── node_modules/
|
|
21
|
+
│ ├── @windrun-huaiin/
|
|
22
|
+
│ │ ├── third-ui/
|
|
23
|
+
│ │ │ └── src/ # This is third-ui src
|
|
24
|
+
│ │ └── base-ui/
|
|
25
|
+
│ │ └── src/ # This is base-ui src
|
|
26
|
+
└── package.json
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
- Then, in your `globals.css` file, you have to configure Tailwind CSS 4.x like this:
|
|
30
|
+
|
|
31
|
+
```css
|
|
32
|
+
@import 'tailwindcss';
|
|
33
|
+
|
|
34
|
+
@source "../node_modules/@windrun-huaiin/third-ui/src/**/*.{js,ts,jsx,tsx}";
|
|
35
|
+
@source "../node_modules/@windrun-huaiin/base-ui/src/**/*.{js,ts,jsx,tsx}";
|
|
36
|
+
@source "./src/**/*.{js,ts,jsx,tsx}";
|
|
37
|
+
|
|
38
|
+
/* Import styles */
|
|
39
|
+
@import '@windrun-huaiin/third-ui/styles/third-ui.css';
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
## Usage Example
|
|
44
|
+
|
|
45
|
+
### Import all components
|
|
46
|
+
```tsx
|
|
47
|
+
import { ClerkUser, CTA, TOC } from '@windrun-huaiin/third-ui';
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Import components by module
|
|
51
|
+
```tsx
|
|
52
|
+
// Only import Clerk related components
|
|
53
|
+
import { ClerkUser, ClerkOrganization } from '@windrun-huaiin/third-ui/clerk';
|
|
54
|
+
|
|
55
|
+
// Only import main application components
|
|
56
|
+
import { CTA, Features } from '@windrun-huaiin/third-ui/main';
|
|
57
|
+
|
|
58
|
+
// Only import Fumadocs components
|
|
59
|
+
import { TOC, FumaBannerSuit } from '@windrun-huaiin/third-ui/fuma';
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Use components
|
|
63
|
+
```tsx
|
|
64
|
+
// Clerk user component (need to pass in translations and configuration)
|
|
65
|
+
<ClerkUser
|
|
66
|
+
locale="zh"
|
|
67
|
+
clerkAuthInModal={true}
|
|
68
|
+
t={{ signIn: "Sign in" }}
|
|
69
|
+
t2={{ terms: "Terms of Service", privacy: "Privacy Policy" }}
|
|
70
|
+
/>
|
|
71
|
+
|
|
72
|
+
// Clerk organization component
|
|
73
|
+
<ClerkOrganization locale="zh" className="custom-class" />
|
|
74
|
+
|
|
75
|
+
// Main application components
|
|
76
|
+
<CTA />
|
|
77
|
+
<Features />
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Design Principles
|
|
81
|
+
|
|
82
|
+
1. **Modularization**: Grouped by functional domain, support import on demand
|
|
83
|
+
2. **Parameterization**: Remove hard-coded dependencies, pass configuration through props
|
|
84
|
+
3. **Type safety**: Full TypeScript support
|
|
85
|
+
4. **Path alias**: Use `@/` alias internally, keep code clean
|
|
86
|
+
|
|
87
|
+
## Dependencies
|
|
88
|
+
|
|
89
|
+
- `@windrun-huaiin/base-ui`: Base UI components
|
|
90
|
+
- `@windrun-huaiin/lib`: General utility library
|
|
91
|
+
- `@clerk/nextjs`: Clerk authentication
|
|
92
|
+
- `fumadocs-core`, `fumadocs-ui`: Fumadocs documentation
|
|
93
|
+
|
|
94
|
+
## Notes
|
|
95
|
+
|
|
96
|
+
- Components have removed direct `appConfig` dependencies, and configuration is passed through props
|
|
97
|
+
- Clerk components need to provide correct translations in the application layer
|
|
98
|
+
- Some components may require specific CSS animation classes (e.g. `animate-cta-gradient-wave`)
|
|
99
|
+
|
|
100
|
+
## Component List
|
|
101
|
+
|
|
102
|
+
### Clerk module
|
|
103
|
+
- `ClerkProviderClient` - Clerk authentication provider
|
|
104
|
+
- `ClerkUser` - User button component
|
|
105
|
+
- `ClerkOrganization` - Organization switcher component
|
|
106
|
+
|
|
107
|
+
### Main module
|
|
108
|
+
- `CTA` - Call-to-Action component
|
|
109
|
+
- `Features` - Feature showcase component
|
|
110
|
+
- `Footer` - Footer component
|
|
111
|
+
- `Gallery` - Image gallery component
|
|
112
|
+
- `GoToTop` - Go to top button
|
|
113
|
+
- `SEOContent` - SEO content component
|
|
114
|
+
- `Tips` - Tip component
|
|
115
|
+
|
|
116
|
+
### Fuma module
|
|
117
|
+
- `getMDXComponents` - MDX component configuration function
|
|
118
|
+
- `createMDXComponents` - MDX component factory function
|
|
119
|
+
- `TocFooter` - Table of contents footer component
|
|
120
|
+
- `FumaBannerSuit` - Fumadocs banner component
|
|
121
|
+
|
|
122
|
+
### Fuma MDX submodule
|
|
123
|
+
- `Mermaid` - Flowchart component
|
|
124
|
+
- `ImageZoom` - Image zoom component
|
|
125
|
+
- `TrophyCard` - Trophy card component
|
|
126
|
+
- `ImageGrid` - Image grid component
|
|
127
|
+
- `ZiaCard` - Zia card component
|
|
128
|
+
- `GradientButton` - Gradient button component
|
|
129
|
+
|
|
130
|
+
## Usage
|
|
131
|
+
|
|
132
|
+
### Clerk components
|
|
133
|
+
|
|
134
|
+
```tsx
|
|
135
|
+
import { ClerkProviderClient, ClerkUser } from '@windrun-huaiin/third-ui/clerk';
|
|
136
|
+
|
|
137
|
+
// Use in layout.tsx
|
|
138
|
+
<ClerkProviderClient
|
|
139
|
+
signInUrl="/sign-in"
|
|
140
|
+
signUpUrl="/sign-up"
|
|
141
|
+
waitlistUrl="/waitlist"
|
|
142
|
+
>
|
|
143
|
+
{children}
|
|
144
|
+
</ClerkProviderClient>
|
|
145
|
+
|
|
146
|
+
// Use in navigation bar
|
|
147
|
+
<ClerkUser clerkAuthInModal={true} />
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### Main components
|
|
151
|
+
|
|
152
|
+
```tsx
|
|
153
|
+
import { CTA, Features, Footer } from '@windrun-huaiin/third-ui/main';
|
|
154
|
+
|
|
155
|
+
// Use various page components
|
|
156
|
+
<Features />
|
|
157
|
+
<CTA />
|
|
158
|
+
<Footer />
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
### Fumadocs components
|
|
162
|
+
|
|
163
|
+
```tsx
|
|
164
|
+
import { createMDXComponents, TocFooter } from '@windrun-huaiin/third-ui/fuma';
|
|
165
|
+
|
|
166
|
+
// Create pre-configured MDX components
|
|
167
|
+
const getMDXComponents = createMDXComponents({
|
|
168
|
+
watermark: {
|
|
169
|
+
enabled: true,
|
|
170
|
+
text: "Your Watermark"
|
|
171
|
+
},
|
|
172
|
+
githubBaseUrl: "https://github.com/your-org/your-repo/edit/main/"
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
// Use in page
|
|
176
|
+
const MDX = page.data.body;
|
|
177
|
+
<MDX components={getMDXComponents()} />
|
|
178
|
+
|
|
179
|
+
// Use TocFooter
|
|
180
|
+
<TocFooter
|
|
181
|
+
lastModified={page.data.date}
|
|
182
|
+
showCopy={true}
|
|
183
|
+
editPath="src/docs/your-file.mdx"
|
|
184
|
+
githubBaseUrl="https://github.com/your-org/your-repo/edit/main/"
|
|
185
|
+
/>
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
#### MDX components global configuration
|
|
189
|
+
|
|
190
|
+
In MDX file:
|
|
191
|
+
|
|
192
|
+
```mdx
|
|
193
|
+
<!-- Mermaid chart, watermark automatically applied -->
|
|
194
|
+
<Mermaid
|
|
195
|
+
chart="graph TD; A-->B"
|
|
196
|
+
title="My Diagram"
|
|
197
|
+
/>
|
|
198
|
+
|
|
199
|
+
<!-- Image grid, CDN URL automatically applied -->
|
|
200
|
+
<ImageGrid
|
|
201
|
+
type="url"
|
|
202
|
+
images={["image1.webp", "image2.webp"]}
|
|
203
|
+
altPrefix="example"
|
|
204
|
+
/>
|
|
205
|
+
|
|
206
|
+
<!-- Image zoom, placeholder image automatically applied -->
|
|
207
|
+
<ImageZoom src="/some-image.jpg" alt="Example" />
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
All configuration parameters will be automatically obtained from the global configuration, and no need to specify them in each use.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import React, { JSX } from 'react';
|
|
3
|
+
|
|
4
|
+
interface ClerkProviderClientProps {
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
locale: string;
|
|
7
|
+
signInUrl?: string;
|
|
8
|
+
signUpUrl?: string;
|
|
9
|
+
fallbackSignInUrl?: string;
|
|
10
|
+
fallbackSignUpUrl?: string;
|
|
11
|
+
waitlistUrl?: string;
|
|
12
|
+
}
|
|
13
|
+
declare function ClerkProviderClient({ children, locale, signInUrl, signUpUrl, fallbackSignInUrl, fallbackSignUpUrl, waitlistUrl, }: ClerkProviderClientProps): react_jsx_runtime.JSX.Element;
|
|
14
|
+
|
|
15
|
+
interface ClerkUserProps {
|
|
16
|
+
locale: string;
|
|
17
|
+
clerkAuthInModal?: boolean;
|
|
18
|
+
}
|
|
19
|
+
declare function ClerkUser({ locale, clerkAuthInModal }: ClerkUserProps): JSX.Element;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* @license
|
|
23
|
+
* MIT License
|
|
24
|
+
* Copyright (c) 2025 D8ger
|
|
25
|
+
*
|
|
26
|
+
* This source code is licensed under the MIT license found in the
|
|
27
|
+
* LICENSE file in the root directory of this source tree.
|
|
28
|
+
*/
|
|
29
|
+
declare function createSignInPage(): () => react_jsx_runtime.JSX.Element;
|
|
30
|
+
declare function createSignUpPage(): () => react_jsx_runtime.JSX.Element;
|
|
31
|
+
declare function createWaitlistPage(): () => react_jsx_runtime.JSX.Element;
|
|
32
|
+
|
|
33
|
+
export { ClerkProviderClient, ClerkUser, createSignInPage, createSignUpPage, createWaitlistPage };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import React, { JSX } from 'react';
|
|
3
|
+
|
|
4
|
+
interface ClerkProviderClientProps {
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
locale: string;
|
|
7
|
+
signInUrl?: string;
|
|
8
|
+
signUpUrl?: string;
|
|
9
|
+
fallbackSignInUrl?: string;
|
|
10
|
+
fallbackSignUpUrl?: string;
|
|
11
|
+
waitlistUrl?: string;
|
|
12
|
+
}
|
|
13
|
+
declare function ClerkProviderClient({ children, locale, signInUrl, signUpUrl, fallbackSignInUrl, fallbackSignUpUrl, waitlistUrl, }: ClerkProviderClientProps): react_jsx_runtime.JSX.Element;
|
|
14
|
+
|
|
15
|
+
interface ClerkUserProps {
|
|
16
|
+
locale: string;
|
|
17
|
+
clerkAuthInModal?: boolean;
|
|
18
|
+
}
|
|
19
|
+
declare function ClerkUser({ locale, clerkAuthInModal }: ClerkUserProps): JSX.Element;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* @license
|
|
23
|
+
* MIT License
|
|
24
|
+
* Copyright (c) 2025 D8ger
|
|
25
|
+
*
|
|
26
|
+
* This source code is licensed under the MIT license found in the
|
|
27
|
+
* LICENSE file in the root directory of this source tree.
|
|
28
|
+
*/
|
|
29
|
+
declare function createSignInPage(): () => react_jsx_runtime.JSX.Element;
|
|
30
|
+
declare function createSignUpPage(): () => react_jsx_runtime.JSX.Element;
|
|
31
|
+
declare function createWaitlistPage(): () => react_jsx_runtime.JSX.Element;
|
|
32
|
+
|
|
33
|
+
export { ClerkProviderClient, ClerkUser, createSignInPage, createSignUpPage, createWaitlistPage };
|