@windrun-huaiin/third-ui 30.1.0 → 31.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/README.md +109 -143
- package/dist/ai/ai-prompt-textarea.js +5 -5
- package/dist/ai/ai-prompt-textarea.mjs +5 -5
- package/dist/clerk/clerk-auth-appearance.d.ts +13 -0
- package/dist/clerk/clerk-auth-appearance.js +19 -0
- package/dist/clerk/clerk-auth-appearance.mjs +15 -0
- package/dist/clerk/clerk-auth-modal-appearance.d.ts +12 -0
- package/dist/clerk/clerk-auth-modal-appearance.js +17 -0
- package/dist/clerk/clerk-auth-modal-appearance.mjs +14 -0
- package/dist/clerk/clerk-page-context-generator.js +3 -3
- package/dist/clerk/clerk-page-context-generator.mjs +3 -3
- package/dist/clerk/clerk-page-generator.js +4 -4
- package/dist/clerk/clerk-page-generator.mjs +4 -4
- package/dist/clerk/clerk-user-client.js +2 -1
- package/dist/clerk/clerk-user-client.mjs +2 -1
- package/dist/clerk/fingerprint/fingerprint-client.d.ts +10 -10
- package/dist/clerk/fingerprint/fingerprint-client.js +20 -20
- package/dist/clerk/fingerprint/fingerprint-client.mjs +20 -20
- package/dist/clerk/fingerprint/fingerprint-provider.d.ts +3 -3
- package/dist/clerk/fingerprint/fingerprint-provider.js +8 -8
- package/dist/clerk/fingerprint/fingerprint-provider.mjs +8 -8
- package/dist/clerk/fingerprint/fingerprint-server.d.ts +12 -12
- package/dist/clerk/fingerprint/fingerprint-server.js +17 -17
- package/dist/clerk/fingerprint/fingerprint-server.mjs +17 -17
- package/dist/clerk/fingerprint/fingerprint-shared.d.ts +3 -3
- package/dist/clerk/fingerprint/fingerprint-shared.js +10 -10
- package/dist/clerk/fingerprint/fingerprint-shared.mjs +10 -10
- package/dist/clerk/fingerprint/types.d.ts +0 -1
- package/dist/clerk/fingerprint/use-fingerprint.js +7 -7
- package/dist/clerk/fingerprint/use-fingerprint.mjs +7 -7
- package/dist/clerk/signin-with-fingerprint-client.d.ts +2 -2
- package/dist/clerk/signin-with-fingerprint-client.js +7 -6
- package/dist/clerk/signin-with-fingerprint-client.mjs +7 -6
- package/dist/clerk/signup-button-with-fingerprint-client.js +6 -4
- package/dist/clerk/signup-button-with-fingerprint-client.mjs +6 -4
- package/dist/clerk/signup-with-fingerprint-client.d.ts +2 -2
- package/dist/clerk/signup-with-fingerprint-client.js +7 -6
- package/dist/clerk/signup-with-fingerprint-client.mjs +7 -6
- package/dist/fuma/heavy/mermaid.js +1 -1
- package/dist/fuma/heavy/mermaid.mjs +1 -1
- package/dist/fuma/site-x.js +0 -1
- package/dist/fuma/site-x.mjs +0 -1
- package/dist/main/calendar/calendar-date-range-input.js +1 -1
- package/dist/main/calendar/calendar-date-range-input.mjs +1 -1
- package/dist/main/credit/types.d.ts +8 -8
- package/dist/main/money-price/index.d.ts +1 -1
- package/dist/main/money-price/money-price-button.js +10 -10
- package/dist/main/money-price/money-price-button.mjs +10 -10
- package/dist/main/money-price/money-price-config-util.d.ts +30 -30
- package/dist/main/money-price/money-price-config-util.js +48 -48
- package/dist/main/money-price/money-price-config-util.mjs +48 -48
- package/dist/main/money-price/money-price-interactive.js +30 -18
- package/dist/main/money-price/money-price-interactive.mjs +30 -18
- package/dist/main/money-price/money-price-types.d.ts +7 -1
- package/dist/main/money-price/money-price-types.js +2 -2
- package/dist/main/money-price/money-price-types.mjs +2 -2
- package/dist/main/money-price/server.d.ts +1 -1
- package/dist/main/pill-select/x-pill-select.js +2 -2
- package/dist/main/pill-select/x-pill-select.mjs +2 -2
- package/dist/main/server.d.ts +1 -1
- package/package.json +13 -7
- package/src/ai/ai-prompt-textarea.tsx +6 -6
- package/src/clerk/clerk-auth-appearance.ts +16 -0
- package/src/clerk/clerk-page-context-generator.tsx +3 -5
- package/src/clerk/clerk-page-generator.tsx +9 -8
- package/src/clerk/clerk-user-client.tsx +14 -5
- package/src/clerk/fingerprint/fingerprint-client.ts +20 -20
- package/src/clerk/fingerprint/fingerprint-provider.tsx +11 -11
- package/src/clerk/fingerprint/fingerprint-server.ts +17 -17
- package/src/clerk/fingerprint/fingerprint-shared.ts +10 -10
- package/src/clerk/fingerprint/types.ts +0 -1
- package/src/clerk/fingerprint/use-fingerprint.ts +7 -7
- package/src/clerk/signin-with-fingerprint-client.tsx +7 -7
- package/src/clerk/signup-button-with-fingerprint-client.tsx +7 -5
- package/src/clerk/signup-with-fingerprint-client.tsx +7 -7
- package/src/fuma/base/custom-home-layout.tsx +4 -4
- package/src/fuma/heavy/mermaid.tsx +1 -1
- package/src/fuma/site-x.tsx +0 -1
- package/src/main/calendar/calendar-date-range-input.tsx +1 -1
- package/src/main/credit/types.ts +8 -8
- package/src/main/gallery/gallery-mobile-swiper.tsx +0 -1
- package/src/main/gallery/gallery-server.tsx +2 -2
- package/src/main/money-price/index.ts +2 -0
- package/src/main/money-price/money-price-button.tsx +10 -10
- package/src/main/money-price/money-price-config-util.ts +49 -49
- package/src/main/money-price/money-price-interactive.tsx +40 -20
- package/src/main/money-price/money-price-types.ts +21 -14
- package/src/main/money-price/server.ts +2 -0
- package/src/main/pill-select/x-pill-select.tsx +2 -2
- package/src/main/server.ts +3 -1
- package/src/styles/third-ui.css +8 -0
package/README.md
CHANGED
|
@@ -1,185 +1,151 @@
|
|
|
1
1
|
# @windrun-huaiin/third-ui
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Shared React and Next.js UI integrations for product websites, documentation systems, authentication flows, pricing pages, credit displays, AI interfaces, and Fuma-based MDX rendering.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
This package is organized around public subpath exports. Use the smallest entry point that matches the feature you need so that application code can keep client, server, and heavy-renderer boundaries explicit.
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## Feature Areas
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
### Main Application UI
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
The main UI layer provides reusable building blocks for product-facing pages and application surfaces:
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
- Hero sections, gallery sections, CTA blocks, feature sections, FAQ sections, footer sections, tips, usage blocks, and SEO-oriented content blocks.
|
|
14
|
+
- Standard application states such as 404 pages, loading indicators, loading frames, and navigation progress feedback.
|
|
15
|
+
- Interaction components such as alert dialogs, buttons, pill selects, calendars, motion helpers, and animation helpers.
|
|
16
|
+
- Home-page and server-side helpers for composing localized, content-driven page sections.
|
|
14
17
|
|
|
15
|
-
|
|
16
|
-
- `third-ui`: React components used when MDX is rendered.
|
|
17
|
-
- application: chooses which compiler features and renderer features are imported.
|
|
18
|
+
Primary entry points:
|
|
18
19
|
|
|
19
|
-
|
|
20
|
+
| Entry | Purpose |
|
|
21
|
+
| --- | --- |
|
|
22
|
+
| `@windrun-huaiin/third-ui/main` | General application UI components and shared main-page building blocks |
|
|
23
|
+
| `@windrun-huaiin/third-ui/main/server` | Server-side helpers for main UI composition |
|
|
24
|
+
| `@windrun-huaiin/third-ui/main/home/server` | Server-side home-page helpers |
|
|
25
|
+
| `@windrun-huaiin/third-ui/main/hero` | Hero section components |
|
|
26
|
+
| `@windrun-huaiin/third-ui/main/alert-dialog` | Alert dialog components |
|
|
27
|
+
| `@windrun-huaiin/third-ui/main/buttons` | Button components |
|
|
28
|
+
| `@windrun-huaiin/third-ui/main/calendar` | Calendar components |
|
|
29
|
+
| `@windrun-huaiin/third-ui/main/pill-select` | Pill select components |
|
|
30
|
+
| `@windrun-huaiin/third-ui/main/loading` | Loading components |
|
|
31
|
+
| `@windrun-huaiin/third-ui/main/loading-frame` | Loading frame components |
|
|
32
|
+
| `@windrun-huaiin/third-ui/main/motion` | Motion helpers and components |
|
|
33
|
+
| `@windrun-huaiin/third-ui/main/anime` | Animation helpers and components |
|
|
34
|
+
|
|
35
|
+
### Pricing, Credits, and Commerce UI
|
|
36
|
+
|
|
37
|
+
The pricing and credit layer covers UI and server utilities for product plans, credit balances, money-price displays, and purchase-oriented controls.
|
|
38
|
+
|
|
39
|
+
Primary entry points:
|
|
40
|
+
|
|
41
|
+
| Entry | Purpose |
|
|
42
|
+
| --- | --- |
|
|
43
|
+
| `@windrun-huaiin/third-ui/main/money-price` | Money-price UI components, interactive pricing controls, and pricing configuration helpers |
|
|
44
|
+
| `@windrun-huaiin/third-ui/main/money-price/server` | Server-side money-price helpers |
|
|
45
|
+
| `@windrun-huaiin/third-ui/main/credit` | Credit UI components, credit types, and credit display helpers |
|
|
46
|
+
| `@windrun-huaiin/third-ui/main/credit/server` | Server-side credit helpers |
|
|
20
47
|
|
|
21
|
-
|
|
22
|
-
- Make heavyweight rendering features explicit imports.
|
|
23
|
-
- Avoid old aggregate component entries that import every renderer feature at module load time.
|
|
24
|
-
- Let application code be the capability declaration.
|
|
25
|
-
- Preserve a safe fallback path when disabled or unknown MDX components appear in content.
|
|
26
|
-
- Keep renderer-only capabilities separate from compiler-only capabilities.
|
|
48
|
+
### AI UI
|
|
27
49
|
|
|
28
|
-
|
|
50
|
+
The AI layer provides ready-to-compose interface pieces for chat and prompt-driven product experiences:
|
|
29
51
|
|
|
30
|
-
|
|
52
|
+
- Prompt textarea and composer components.
|
|
53
|
+
- Message bubbles, message content, message metadata, message actions, and message lists.
|
|
54
|
+
- Markdown rendering support for AI responses.
|
|
55
|
+
- Status indicators and conversation state hooks.
|
|
31
56
|
|
|
32
|
-
|
|
33
|
-
@windrun-huaiin/third-ui/fuma/server/site-mdx/base
|
|
34
|
-
```
|
|
57
|
+
Primary entry point:
|
|
35
58
|
|
|
36
|
-
|
|
59
|
+
| Entry | Purpose |
|
|
60
|
+
| --- | --- |
|
|
61
|
+
| `@windrun-huaiin/third-ui/ai` | AI chat, prompt, message, markdown, status, and conversation UI utilities |
|
|
37
62
|
|
|
38
|
-
|
|
39
|
-
@windrun-huaiin/third-ui/fuma/server/site-mdx/features/code
|
|
40
|
-
@windrun-huaiin/third-ui/fuma/server/site-mdx/features/math
|
|
41
|
-
@windrun-huaiin/third-ui/fuma/server/site-mdx/features/mermaid
|
|
42
|
-
@windrun-huaiin/third-ui/fuma/server/site-mdx/features/type-table
|
|
43
|
-
```
|
|
63
|
+
### Clerk and Fingerprint Integration
|
|
44
64
|
|
|
45
|
-
The
|
|
65
|
+
The Clerk layer provides authentication UI integration for applications that use Clerk, including appearance configuration, provider components, user and organization components, and sign-in or sign-up flows that can be combined with fingerprint-aware behavior.
|
|
46
66
|
|
|
47
|
-
|
|
67
|
+
The fingerprint layer is split into client and server entry points so applications can keep browser collection, provider state, hooks, and server-side fingerprint handling separated.
|
|
48
68
|
|
|
49
|
-
|
|
69
|
+
Primary entry points:
|
|
50
70
|
|
|
51
|
-
|
|
71
|
+
| Entry | Purpose |
|
|
72
|
+
| --- | --- |
|
|
73
|
+
| `@windrun-huaiin/third-ui/clerk` | Clerk UI integration, auth components, providers, page helpers, and fingerprint-aware auth components |
|
|
74
|
+
| `@windrun-huaiin/third-ui/clerk/server` | Server-side Clerk helpers |
|
|
75
|
+
| `@windrun-huaiin/third-ui/fingerprint` | Client-side fingerprint components, provider, hooks, shared types, and debug utilities |
|
|
76
|
+
| `@windrun-huaiin/third-ui/fingerprint/server` | Server-side fingerprint helpers |
|
|
52
77
|
|
|
53
|
-
|
|
54
|
-
- Markdown element renderers: headings, links, blockquote, lists, table, inline code, pre, image, and related primitive tags.
|
|
55
|
-
- Site-level lightweight components: `SiteX`, `TrophyCard`, `ZiaCard`, `GradientButton`, `ZiaFile`, `ZiaFolder`, `SunoEmbed`.
|
|
56
|
-
- Image rendering integration with image fallback and CDN-related options.
|
|
57
|
-
- Feature-specific fallback components for disabled math, Mermaid, type table, and code-tab style components.
|
|
78
|
+
### Fuma Layouts, Docs, and MDX
|
|
58
79
|
|
|
59
|
-
|
|
80
|
+
The Fuma layer provides site layouts, documentation layouts, navigation configuration, docs root providers, MDX component maps, shared markdown components, and optional heavy renderer boundaries.
|
|
60
81
|
|
|
61
|
-
|
|
82
|
+
It is designed for applications that want to compose documentation pages without mixing content compilation, layout composition, and renderer feature selection into one entry.
|
|
62
83
|
|
|
63
|
-
|
|
64
|
-
| --- | --- | --- | --- |
|
|
65
|
-
| `base` | `site-mdx/base` | `local-md/presets/fuma-docs/base` | Required for normal MDX rendering |
|
|
66
|
-
| `code` | `site-mdx/features/code` | `local-md/presets/fuma-docs/features/code` | Enables Fuma codeblock UI and built-in language icon mapping |
|
|
67
|
-
| `math` | `site-mdx/features/math` | `local-md/presets/fuma-docs/features/math` | Enables `MathBlock` and `InlineMath` rendering |
|
|
68
|
-
| `mermaid` | `site-mdx/features/mermaid` | Not required | Renderer-only component capability |
|
|
69
|
-
| `type-table` | `site-mdx/features/type-table` | Not required | Renderer-only component capability |
|
|
70
|
-
| `npm` | Not required | `local-md/presets/fuma-docs/features/npm` | Compiler-only content transform |
|
|
84
|
+
Primary layout and docs entry points:
|
|
71
85
|
|
|
72
|
-
|
|
86
|
+
| Entry | Purpose |
|
|
87
|
+
| --- | --- |
|
|
88
|
+
| `@windrun-huaiin/third-ui/fuma/base` | Base Fuma layout and navigation exports |
|
|
89
|
+
| `@windrun-huaiin/third-ui/fuma/base/docs-root-provider` | Docs root provider |
|
|
90
|
+
| `@windrun-huaiin/third-ui/fuma/base/nav-config` | Navigation configuration helpers |
|
|
91
|
+
| `@windrun-huaiin/third-ui/fuma/base/site-docs-layout` | Documentation layout components |
|
|
92
|
+
| `@windrun-huaiin/third-ui/fuma/base/site-home-layout` | Home layout components |
|
|
93
|
+
| `@windrun-huaiin/third-ui/fuma/base/site-layout-shared` | Shared site layout utilities |
|
|
94
|
+
| `@windrun-huaiin/third-ui/fuma/server` | Server-side Fuma helpers |
|
|
95
|
+
| `@windrun-huaiin/third-ui/fuma/server/page-generator` | Documentation page generation helpers |
|
|
96
|
+
| `@windrun-huaiin/third-ui/fuma/server/llm-copy-handler` | LLM copy handler helpers |
|
|
97
|
+
| `@windrun-huaiin/third-ui/fuma/fuma-translate-util` | Fuma translation utilities |
|
|
73
98
|
|
|
74
|
-
|
|
99
|
+
### MDX Renderer Boundaries
|
|
75
100
|
|
|
76
|
-
|
|
101
|
+
The MDX renderer layer is intentionally split into a base entry and optional feature entries.
|
|
77
102
|
|
|
78
|
-
|
|
103
|
+
Use the base entry for ordinary documentation content. Add feature entries only when an application needs the corresponding renderer capability.
|
|
79
104
|
|
|
80
|
-
|
|
105
|
+
| Capability | Renderer Entry | Typical Purpose |
|
|
106
|
+
| --- | --- | --- |
|
|
107
|
+
| Base MDX | `@windrun-huaiin/third-ui/fuma/server/site-mdx/base` | Standard MDX component map for documentation pages |
|
|
108
|
+
| Code | `@windrun-huaiin/third-ui/fuma/server/site-mdx/features/code` | Code block rendering components |
|
|
109
|
+
| Math | `@windrun-huaiin/third-ui/fuma/server/site-mdx/features/math` | Math block and inline math rendering components |
|
|
110
|
+
| Mermaid | `@windrun-huaiin/third-ui/fuma/server/site-mdx/features/mermaid` | Mermaid diagram rendering components |
|
|
111
|
+
| Type Table | `@windrun-huaiin/third-ui/fuma/server/site-mdx/features/type-table` | Type table rendering components |
|
|
112
|
+
| Shared MDX | `@windrun-huaiin/third-ui/fuma/mdx` | Shared MDX building blocks |
|
|
113
|
+
| Shared Markdown | `@windrun-huaiin/third-ui/fuma/share` | Shared markdown component utilities |
|
|
114
|
+
| Heavy Renderers | `@windrun-huaiin/third-ui/fuma/heavy` | Heavy renderer exports for intentional, explicit imports |
|
|
81
115
|
|
|
82
|
-
|
|
116
|
+
The base MDX entry should stay lightweight. Heavy capabilities such as code, math, Mermaid, and type-table rendering should be imported through their dedicated entries only when the application enables them.
|
|
83
117
|
|
|
84
|
-
|
|
118
|
+
### Server and SEO Utilities
|
|
85
119
|
|
|
86
|
-
|
|
87
|
-
- each optional feature entry imports only its own renderer implementation.
|
|
88
|
-
- application code imports the feature entries it wants.
|
|
120
|
+
Shared server and SEO helpers are exposed separately from UI component entries.
|
|
89
121
|
|
|
90
|
-
|
|
122
|
+
Primary entry points:
|
|
91
123
|
|
|
92
|
-
|
|
124
|
+
| Entry | Purpose |
|
|
125
|
+
| --- | --- |
|
|
126
|
+
| `@windrun-huaiin/third-ui/lib/server` | Shared server utilities |
|
|
127
|
+
| `@windrun-huaiin/third-ui/lib/seo-metadata` | SEO metadata helpers |
|
|
93
128
|
|
|
94
|
-
|
|
129
|
+
### Styles
|
|
95
130
|
|
|
96
|
-
|
|
131
|
+
The package exposes a shared stylesheet for components that depend on the package-level visual system.
|
|
97
132
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
-
|
|
101
|
-
- `TypeTable`
|
|
102
|
-
- `CodeBlockTab`
|
|
103
|
-
- `CodeBlockTabs`
|
|
104
|
-
- `CodeBlockTabsList`
|
|
105
|
-
- `CodeBlockTabsTrigger`
|
|
133
|
+
| Entry | Purpose |
|
|
134
|
+
| --- | --- |
|
|
135
|
+
| `@windrun-huaiin/third-ui/styles/third-ui.css` | Shared third-ui styles |
|
|
106
136
|
|
|
107
|
-
|
|
137
|
+
## Usage Notes
|
|
108
138
|
|
|
109
|
-
|
|
139
|
+
- Prefer specific subpath imports over broad imports when the feature area is known.
|
|
140
|
+
- Use server entries only from server-side application code.
|
|
141
|
+
- Keep optional Fuma MDX renderer features explicit in the application integration layer.
|
|
142
|
+
- Import heavy renderer entries only when the page or feature intentionally needs them.
|
|
143
|
+
- Include the shared stylesheet in the application when using components that rely on package styles.
|
|
110
144
|
|
|
111
|
-
|
|
145
|
+
## Installation
|
|
112
146
|
|
|
113
|
-
```
|
|
114
|
-
|
|
147
|
+
```bash
|
|
148
|
+
pnpm add @windrun-huaiin/third-ui
|
|
115
149
|
```
|
|
116
150
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
The priority order is:
|
|
120
|
-
|
|
121
|
-
- application-provided MDX components
|
|
122
|
-
- enabled `third-ui` renderer feature components
|
|
123
|
-
- `third-ui` known disabled-feature fallbacks
|
|
124
|
-
- `local-md` generic unknown-component fallback
|
|
125
|
-
|
|
126
|
-
## Heavy Renderer Boundary
|
|
127
|
-
|
|
128
|
-
Heavy renderers are isolated under dedicated feature paths or heavy modules.
|
|
129
|
-
|
|
130
|
-
Examples:
|
|
131
|
-
|
|
132
|
-
- Mermaid rendering is behind the Mermaid feature entry.
|
|
133
|
-
- Math rendering uses the math feature entry and lazy heavy math renderer.
|
|
134
|
-
- Type table rendering is behind the type-table feature entry.
|
|
135
|
-
- Fuma codeblock rendering is behind the code feature entry.
|
|
136
|
-
|
|
137
|
-
The code renderer owns its programming-language icon map internally. Applications should not pass a global icon map into `createCodeMdxComponents()`.
|
|
138
|
-
|
|
139
|
-
This keeps `site-mdx/base` from becoming a hidden dependency sink.
|
|
140
|
-
|
|
141
|
-
## Application Rules
|
|
142
|
-
|
|
143
|
-
Applications should treat their MDX integration files as the capability declaration.
|
|
144
|
-
|
|
145
|
-
For `apps/ddaas`, the important files are:
|
|
146
|
-
|
|
147
|
-
- `src/lib/content-source.ts`: compiler/source capabilities.
|
|
148
|
-
- `src/components/mdx-components.tsx`: renderer/component capabilities.
|
|
149
|
-
|
|
150
|
-
When enabling a capability:
|
|
151
|
-
|
|
152
|
-
- import the compiler feature only if the capability needs compiler support.
|
|
153
|
-
- import the renderer feature only if the capability needs renderer support.
|
|
154
|
-
- add the imported feature to the matching `features` list.
|
|
155
|
-
- do not import unused feature entries “just in case”.
|
|
156
|
-
|
|
157
|
-
If an application creates its own MDX component and that component imports a heavy package directly, the package can still enter the bundle. That is expected and belongs to the application layer.
|
|
158
|
-
|
|
159
|
-
## Styling
|
|
160
|
-
|
|
161
|
-
MDX components assume the application includes the package styles and Tailwind source scanning for `third-ui`.
|
|
162
|
-
|
|
163
|
-
The exact global CSS setup is application-specific, but MDX pages need the same base styles used by the rest of the Fuma UI integration.
|
|
164
|
-
|
|
165
|
-
## Export Map
|
|
166
|
-
|
|
167
|
-
MDX-related exports currently relevant to this design:
|
|
168
|
-
|
|
169
|
-
| Export | Purpose |
|
|
170
|
-
| --- | --- |
|
|
171
|
-
| `./fuma/server/site-mdx/base` | Recommended base MDX component factory |
|
|
172
|
-
| `./fuma/server/site-mdx/features/code` | Optional code renderer components |
|
|
173
|
-
| `./fuma/server/site-mdx/features/math` | Optional math renderer components |
|
|
174
|
-
| `./fuma/server/site-mdx/features/mermaid` | Optional Mermaid renderer components |
|
|
175
|
-
| `./fuma/server/site-mdx/features/type-table` | Optional type-table renderer components |
|
|
176
|
-
| `./fuma/mdx` | Shared MDX building blocks used by pages and widgets |
|
|
177
|
-
| `./fuma/heavy` | Heavy renderer exports; avoid importing from app base paths unless intentionally needed |
|
|
178
|
-
| `./fuma/share` | Shared markdown component utilities |
|
|
179
|
-
|
|
180
|
-
## Non-Goals
|
|
181
|
-
|
|
182
|
-
- This README does not document Clerk, main UI, AI UI, fingerprint, or SEO helpers.
|
|
183
|
-
- The base MDX entry should not become an all-features preset.
|
|
184
|
-
- Runtime feature flags should not be used as the primary pruning mechanism.
|
|
185
|
-
- Unknown MDX components should not crash the page.
|
|
151
|
+
This package is intended for React and Next.js applications. Peer framework setup, styling setup, localization setup, and authentication setup are provided by the consuming application.
|
|
@@ -87,27 +87,27 @@ function AIPromptTextarea({ value, onChange, placeholder = "Enter your prompt...
|
|
|
87
87
|
onWordLimitChange(true);
|
|
88
88
|
}
|
|
89
89
|
};
|
|
90
|
-
//
|
|
90
|
+
// Render the title component.
|
|
91
91
|
const renderTitle = () => {
|
|
92
92
|
if (!(title === null || title === void 0 ? void 0 : title.trim()))
|
|
93
93
|
return null;
|
|
94
94
|
return (jsxRuntime.jsxs("div", { className: "space-y-1", children: [title && jsxRuntime.jsx("span", { className: "text-xl font-semibold text-foreground", children: title }), (description === null || description === void 0 ? void 0 : description.trim()) && jsxRuntime.jsx("span", { className: "text-sm text-gray-400 ml-2", children: description })] }));
|
|
95
95
|
};
|
|
96
|
-
//
|
|
96
|
+
// Render the textarea component.
|
|
97
97
|
const renderTextarea = (isEmbedded = false) => (jsxRuntime.jsx("textarea", { ref: textareaRef, value: value, onChange: handleInputChange, onPaste: handlePaste, placeholder: placeholder, disabled: disabled, className: utils.cn('w-full p-4 bg-transparent transition-colors text-foreground placeholder-muted-foreground placeholder:text-base disabled:bg-muted disabled:cursor-not-allowed resize-none', isEmbedded
|
|
98
98
|
? 'border-0 hover:border-2 hover:border-purple-500 focus:outline-none focus:border-2 focus:border-purple-500'
|
|
99
99
|
: 'border-2 border-border rounded-lg hover:border-purple-500 focus:outline-none focus:border-purple-500', className), style: { minHeight: `${minHeight}px` } }));
|
|
100
|
-
//
|
|
100
|
+
// Render the word count.
|
|
101
101
|
const renderWordCount = () => {
|
|
102
102
|
if (!showWordCount)
|
|
103
103
|
return null;
|
|
104
104
|
return (jsxRuntime.jsx("div", { className: "flex justify-end", children: jsxRuntime.jsxs("span", { className: `text-sm ${wordCount >= maxWords ? 'text-red-500' : wordCount > maxWords * 0.75 ? 'text-orange-500' : 'text-muted-foreground'} ${isWordLimit ? 'animate-bounce' : ''}`, onAnimationEnd: () => onWordLimitChange(false), children: [wordCount, "/", maxWords, " ", wordUnitTitle] }) }));
|
|
105
105
|
};
|
|
106
|
-
//
|
|
106
|
+
// Render the embedded title layout when a title is present and embedded mode is enabled.
|
|
107
107
|
if (embed && (title)) {
|
|
108
108
|
return (jsxRuntime.jsxs("div", { className: "space-y-2", children: [jsxRuntime.jsxs("div", { className: "border-2 border-border rounded-lg bg-transparent", children: [jsxRuntime.jsx("div", { className: "p-4 pb-2", children: renderTitle() }), jsxRuntime.jsx("hr", { className: "border-t border-border" }), jsxRuntime.jsx("div", { className: "p-1", children: renderTextarea(true) })] }), renderWordCount()] }));
|
|
109
109
|
}
|
|
110
|
-
//
|
|
110
|
+
// Default layout: external title or no title.
|
|
111
111
|
return (jsxRuntime.jsxs("div", { className: "space-y-2", children: [renderTitle(), renderTextarea(), renderWordCount()] }));
|
|
112
112
|
}
|
|
113
113
|
|
|
@@ -85,27 +85,27 @@ function AIPromptTextarea({ value, onChange, placeholder = "Enter your prompt...
|
|
|
85
85
|
onWordLimitChange(true);
|
|
86
86
|
}
|
|
87
87
|
};
|
|
88
|
-
//
|
|
88
|
+
// Render the title component.
|
|
89
89
|
const renderTitle = () => {
|
|
90
90
|
if (!(title === null || title === void 0 ? void 0 : title.trim()))
|
|
91
91
|
return null;
|
|
92
92
|
return (jsxs("div", { className: "space-y-1", children: [title && jsx("span", { className: "text-xl font-semibold text-foreground", children: title }), (description === null || description === void 0 ? void 0 : description.trim()) && jsx("span", { className: "text-sm text-gray-400 ml-2", children: description })] }));
|
|
93
93
|
};
|
|
94
|
-
//
|
|
94
|
+
// Render the textarea component.
|
|
95
95
|
const renderTextarea = (isEmbedded = false) => (jsx("textarea", { ref: textareaRef, value: value, onChange: handleInputChange, onPaste: handlePaste, placeholder: placeholder, disabled: disabled, className: cn('w-full p-4 bg-transparent transition-colors text-foreground placeholder-muted-foreground placeholder:text-base disabled:bg-muted disabled:cursor-not-allowed resize-none', isEmbedded
|
|
96
96
|
? 'border-0 hover:border-2 hover:border-purple-500 focus:outline-none focus:border-2 focus:border-purple-500'
|
|
97
97
|
: 'border-2 border-border rounded-lg hover:border-purple-500 focus:outline-none focus:border-purple-500', className), style: { minHeight: `${minHeight}px` } }));
|
|
98
|
-
//
|
|
98
|
+
// Render the word count.
|
|
99
99
|
const renderWordCount = () => {
|
|
100
100
|
if (!showWordCount)
|
|
101
101
|
return null;
|
|
102
102
|
return (jsx("div", { className: "flex justify-end", children: jsxs("span", { className: `text-sm ${wordCount >= maxWords ? 'text-red-500' : wordCount > maxWords * 0.75 ? 'text-orange-500' : 'text-muted-foreground'} ${isWordLimit ? 'animate-bounce' : ''}`, onAnimationEnd: () => onWordLimitChange(false), children: [wordCount, "/", maxWords, " ", wordUnitTitle] }) }));
|
|
103
103
|
};
|
|
104
|
-
//
|
|
104
|
+
// Render the embedded title layout when a title is present and embedded mode is enabled.
|
|
105
105
|
if (embed && (title)) {
|
|
106
106
|
return (jsxs("div", { className: "space-y-2", children: [jsxs("div", { className: "border-2 border-border rounded-lg bg-transparent", children: [jsx("div", { className: "p-4 pb-2", children: renderTitle() }), jsx("hr", { className: "border-t border-border" }), jsx("div", { className: "p-1", children: renderTextarea(true) })] }), renderWordCount()] }));
|
|
107
107
|
}
|
|
108
|
-
//
|
|
108
|
+
// Default layout: external title or no title.
|
|
109
109
|
return (jsxs("div", { className: "space-y-2", children: [renderTitle(), renderTextarea(), renderWordCount()] }));
|
|
110
110
|
}
|
|
111
111
|
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const clerkAuthModalAppearance: {
|
|
2
|
+
elements: {
|
|
3
|
+
modalContent: string;
|
|
4
|
+
cardBox: string;
|
|
5
|
+
};
|
|
6
|
+
};
|
|
7
|
+
export declare const clerkAuthPageAppearance: {
|
|
8
|
+
elements: {
|
|
9
|
+
rootBox: string;
|
|
10
|
+
cardBox: string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export declare const clerkAuthPageContainerClassName = "flex min-h-[calc(100dvh-var(--fd-banner-height,0px)-var(--fd-header-height,3.5rem))] w-full items-start justify-center px-6 pt-[calc(var(--fd-header-height,3.5rem)+2rem)] pb-6 md:px-8 md:pt-[calc(var(--fd-header-height,3.5rem)+4.5rem)] md:pb-8";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const clerkAuthModalAppearance = {
|
|
4
|
+
elements: {
|
|
5
|
+
modalContent: '!items-start !pt-16 sm:!pt-24',
|
|
6
|
+
cardBox: '!mt-0',
|
|
7
|
+
},
|
|
8
|
+
};
|
|
9
|
+
const clerkAuthPageAppearance = {
|
|
10
|
+
elements: {
|
|
11
|
+
rootBox: 'w-full',
|
|
12
|
+
cardBox: 'mx-auto',
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
const clerkAuthPageContainerClassName = 'flex min-h-[calc(100dvh-var(--fd-banner-height,0px)-var(--fd-header-height,3.5rem))] w-full items-start justify-center px-6 pt-[calc(var(--fd-header-height,3.5rem)+2rem)] pb-6 md:px-8 md:pt-[calc(var(--fd-header-height,3.5rem)+4.5rem)] md:pb-8';
|
|
16
|
+
|
|
17
|
+
exports.clerkAuthModalAppearance = clerkAuthModalAppearance;
|
|
18
|
+
exports.clerkAuthPageAppearance = clerkAuthPageAppearance;
|
|
19
|
+
exports.clerkAuthPageContainerClassName = clerkAuthPageContainerClassName;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const clerkAuthModalAppearance = {
|
|
2
|
+
elements: {
|
|
3
|
+
modalContent: '!items-start !pt-16 sm:!pt-24',
|
|
4
|
+
cardBox: '!mt-0',
|
|
5
|
+
},
|
|
6
|
+
};
|
|
7
|
+
const clerkAuthPageAppearance = {
|
|
8
|
+
elements: {
|
|
9
|
+
rootBox: 'w-full',
|
|
10
|
+
cardBox: 'mx-auto',
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
|
+
const clerkAuthPageContainerClassName = 'flex min-h-[calc(100dvh-var(--fd-banner-height,0px)-var(--fd-header-height,3.5rem))] w-full items-start justify-center px-6 pt-[calc(var(--fd-header-height,3.5rem)+2rem)] pb-6 md:px-8 md:pt-[calc(var(--fd-header-height,3.5rem)+4.5rem)] md:pb-8';
|
|
14
|
+
|
|
15
|
+
export { clerkAuthModalAppearance, clerkAuthPageAppearance, clerkAuthPageContainerClassName };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const clerkAuthModalAppearance = {
|
|
4
|
+
elements: {
|
|
5
|
+
modalContent: '!items-start !pt-16 sm:!pt-24',
|
|
6
|
+
cardBox: '!mt-0',
|
|
7
|
+
},
|
|
8
|
+
};
|
|
9
|
+
const clerkAuthPageAppearance = {
|
|
10
|
+
elements: {
|
|
11
|
+
rootBox: 'w-full',
|
|
12
|
+
cardBox: 'mx-auto',
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
exports.clerkAuthModalAppearance = clerkAuthModalAppearance;
|
|
17
|
+
exports.clerkAuthPageAppearance = clerkAuthPageAppearance;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const clerkAuthModalAppearance = {
|
|
2
|
+
elements: {
|
|
3
|
+
modalContent: '!items-start !pt-16 sm:!pt-24',
|
|
4
|
+
cardBox: '!mt-0',
|
|
5
|
+
},
|
|
6
|
+
};
|
|
7
|
+
const clerkAuthPageAppearance = {
|
|
8
|
+
elements: {
|
|
9
|
+
rootBox: 'w-full',
|
|
10
|
+
cardBox: 'mx-auto',
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export { clerkAuthModalAppearance, clerkAuthPageAppearance };
|
|
@@ -4,15 +4,15 @@
|
|
|
4
4
|
var jsxRuntime = require('react/jsx-runtime');
|
|
5
5
|
var signupWithFingerprintClient = require('./signup-with-fingerprint-client.js');
|
|
6
6
|
var signinWithFingerprintClient = require('./signin-with-fingerprint-client.js');
|
|
7
|
+
var clerkAuthAppearance = require('./clerk-auth-appearance.js');
|
|
7
8
|
|
|
8
|
-
const clerkPageContainerClassName = 'flex min-h-dvh w-full items-start justify-center px-6 pt-[calc(var(--fd-banner-height,0px)+var(--fd-header-height,3.5rem)+1rem)] pb-6 md:px-8 md:pt-[calc(var(--fd-banner-height,0px)+var(--fd-header-height,3.5rem)+1.5rem)] md:pb-8';
|
|
9
9
|
/**
|
|
10
10
|
* Create a SignUp page with fingerprint support
|
|
11
11
|
* Note: This must be used within a FingerprintProvider
|
|
12
12
|
*/
|
|
13
13
|
function createSignUpPageWithFingerprint() {
|
|
14
14
|
return function SignUpPage() {
|
|
15
|
-
return (jsxRuntime.jsx("div", { className:
|
|
15
|
+
return (jsxRuntime.jsx("div", { className: clerkAuthAppearance.clerkAuthPageContainerClassName, children: jsxRuntime.jsx(signupWithFingerprintClient.SignUpWithFingerprint, {}) }));
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
@@ -21,7 +21,7 @@ function createSignUpPageWithFingerprint() {
|
|
|
21
21
|
*/
|
|
22
22
|
function createSignInPageWithFingerprint() {
|
|
23
23
|
return function SignInPage() {
|
|
24
|
-
return (jsxRuntime.jsx("div", { className:
|
|
24
|
+
return (jsxRuntime.jsx("div", { className: clerkAuthAppearance.clerkAuthPageContainerClassName, children: jsxRuntime.jsx(signinWithFingerprintClient.SignInWithFingerprint, {}) }));
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
27
|
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { SignUpWithFingerprint } from './signup-with-fingerprint-client.mjs';
|
|
4
4
|
import { SignInWithFingerprint } from './signin-with-fingerprint-client.mjs';
|
|
5
|
+
import { clerkAuthPageContainerClassName } from './clerk-auth-appearance.mjs';
|
|
5
6
|
|
|
6
|
-
const clerkPageContainerClassName = 'flex min-h-dvh w-full items-start justify-center px-6 pt-[calc(var(--fd-banner-height,0px)+var(--fd-header-height,3.5rem)+1rem)] pb-6 md:px-8 md:pt-[calc(var(--fd-banner-height,0px)+var(--fd-header-height,3.5rem)+1.5rem)] md:pb-8';
|
|
7
7
|
/**
|
|
8
8
|
* Create a SignUp page with fingerprint support
|
|
9
9
|
* Note: This must be used within a FingerprintProvider
|
|
10
10
|
*/
|
|
11
11
|
function createSignUpPageWithFingerprint() {
|
|
12
12
|
return function SignUpPage() {
|
|
13
|
-
return (jsx("div", { className:
|
|
13
|
+
return (jsx("div", { className: clerkAuthPageContainerClassName, children: jsx(SignUpWithFingerprint, {}) }));
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
@@ -19,7 +19,7 @@ function createSignUpPageWithFingerprint() {
|
|
|
19
19
|
*/
|
|
20
20
|
function createSignInPageWithFingerprint() {
|
|
21
21
|
return function SignInPage() {
|
|
22
|
-
return (jsx("div", { className:
|
|
22
|
+
return (jsx("div", { className: clerkAuthPageContainerClassName, children: jsx(SignInWithFingerprint, {}) }));
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
25
|
|
|
@@ -2,22 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
4
|
var nextjs = require('@clerk/nextjs');
|
|
5
|
+
var clerkAuthAppearance = require('./clerk-auth-appearance.js');
|
|
5
6
|
|
|
6
|
-
const clerkPageContainerClassName = 'flex min-h-dvh w-full items-start justify-center px-6 pt-[calc(var(--fd-banner-height,0px)+var(--fd-header-height,3.5rem)+1rem)] pb-6 md:px-8 md:pt-[calc(var(--fd-banner-height,0px)+var(--fd-header-height,3.5rem)+1.5rem)] md:pb-8';
|
|
7
7
|
// Legacy page generators (for backward compatibility)
|
|
8
8
|
function createSignInPage() {
|
|
9
9
|
return function SignInPage() {
|
|
10
|
-
return (jsxRuntime.jsx("div", { className:
|
|
10
|
+
return (jsxRuntime.jsx("div", { className: clerkAuthAppearance.clerkAuthPageContainerClassName, children: jsxRuntime.jsx(nextjs.SignIn, { appearance: clerkAuthAppearance.clerkAuthPageAppearance }) }));
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
13
|
function createSignUpPage() {
|
|
14
14
|
return function SignUpPage() {
|
|
15
|
-
return (jsxRuntime.jsx("div", { className:
|
|
15
|
+
return (jsxRuntime.jsx("div", { className: clerkAuthAppearance.clerkAuthPageContainerClassName, children: jsxRuntime.jsx(nextjs.SignUp, { appearance: clerkAuthAppearance.clerkAuthPageAppearance }) }));
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
18
|
function createWaitlistPage() {
|
|
19
19
|
return function WaitlistPage() {
|
|
20
|
-
return (jsxRuntime.jsx("div", { className:
|
|
20
|
+
return (jsxRuntime.jsx("div", { className: clerkAuthAppearance.clerkAuthPageContainerClassName, children: jsxRuntime.jsx(nextjs.Waitlist, {}) }));
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
23
|
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { SignIn, SignUp, Waitlist } from '@clerk/nextjs';
|
|
3
|
+
import { clerkAuthPageContainerClassName, clerkAuthPageAppearance } from './clerk-auth-appearance.mjs';
|
|
3
4
|
|
|
4
|
-
const clerkPageContainerClassName = 'flex min-h-dvh w-full items-start justify-center px-6 pt-[calc(var(--fd-banner-height,0px)+var(--fd-header-height,3.5rem)+1rem)] pb-6 md:px-8 md:pt-[calc(var(--fd-banner-height,0px)+var(--fd-header-height,3.5rem)+1.5rem)] md:pb-8';
|
|
5
5
|
// Legacy page generators (for backward compatibility)
|
|
6
6
|
function createSignInPage() {
|
|
7
7
|
return function SignInPage() {
|
|
8
|
-
return (jsx("div", { className:
|
|
8
|
+
return (jsx("div", { className: clerkAuthPageContainerClassName, children: jsx(SignIn, { appearance: clerkAuthPageAppearance }) }));
|
|
9
9
|
};
|
|
10
10
|
}
|
|
11
11
|
function createSignUpPage() {
|
|
12
12
|
return function SignUpPage() {
|
|
13
|
-
return (jsx("div", { className:
|
|
13
|
+
return (jsx("div", { className: clerkAuthPageContainerClassName, children: jsx(SignUp, { appearance: clerkAuthPageAppearance }) }));
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
16
|
function createWaitlistPage() {
|
|
17
17
|
return function WaitlistPage() {
|
|
18
|
-
return (jsx("div", { className:
|
|
18
|
+
return (jsx("div", { className: clerkAuthPageContainerClassName, children: jsx(Waitlist, {}) }));
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
21
|
|
|
@@ -6,12 +6,13 @@ var React = require('react');
|
|
|
6
6
|
var nextjs = require('@clerk/nextjs');
|
|
7
7
|
var icons = require('@windrun-huaiin/base-ui/icons');
|
|
8
8
|
var lib = require('@windrun-huaiin/base-ui/lib');
|
|
9
|
+
var clerkAuthAppearance = require('./clerk-auth-appearance.js');
|
|
9
10
|
var signupButtonWithFingerprintClient = require('./signup-button-with-fingerprint-client.js');
|
|
10
11
|
|
|
11
12
|
function ClerkUserClient({ data }) {
|
|
12
13
|
const [showTooltip, setShowTooltip] = React.useState(false);
|
|
13
14
|
const { isSignedIn } = nextjs.useAuth();
|
|
14
|
-
return (jsxRuntime.jsxs("div", { className: "flex items-center gap-2 h-10 mr-3 sm:mr-2", children: [jsxRuntime.jsx(nextjs.ClerkLoading, { children: jsxRuntime.jsx("div", { className: "w-20 h-9 px-2 border border-gray-300 rounded-full hover:bg-gray-100 dark:border-gray-600 dark:hover:bg-gray-800 text-center text-sm" }) }), jsxRuntime.jsxs(nextjs.ClerkLoaded, { children: [!isSignedIn && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [data.showSignUp && (jsxRuntime.jsxs("div", { className: "relative inline-flex z-10", children: [jsxRuntime.jsx(signupButtonWithFingerprintClient.SignUpButtonWithFingerprint, { mode: data.clerkAuthInModal ? 'modal' : 'redirect', signUp: data.signUp }), data.signUpBonus && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("span", { onMouseEnter: () => setShowTooltip(true), onMouseLeave: () => setShowTooltip(false), className: `absolute -top-0.5 sm:-top-1 -right-1.5 sm:-right-2 flex h-4 sm:h-5 min-w-4 sm:min-w-5 items-center justify-center rounded-full ${lib.themeButtonGradientClass} px-1 sm:px-1.5 text-[9px] sm:text-[10px] font-bold text-white shadow-lg ring-1 sm:ring-2 ring-white/80 dark:ring-white/10 cursor-default`, children: data.signUpBonus }), showTooltip && data.signUpBonusTooltip && (jsxRuntime.jsx("div", { className: `absolute left-1/2 -translate-x-1/2 -translate-y-full -top-1.5 whitespace-nowrap rounded-lg ${lib.themeButtonGradientClass} border border-white/30 dark:border-white/10 px-3 py-1.5 text-xs font-medium text-white shadow-lg pointer-events-none`, children: data.signUpBonusTooltip }))] }))] })), jsxRuntime.jsx(nextjs.SignInButton, { mode: data.
|
|
15
|
+
return (jsxRuntime.jsxs("div", { className: "flex items-center gap-2 h-10 mr-3 sm:mr-2", children: [jsxRuntime.jsx(nextjs.ClerkLoading, { children: jsxRuntime.jsx("div", { className: "w-20 h-9 px-2 border border-gray-300 rounded-full hover:bg-gray-100 dark:border-gray-600 dark:hover:bg-gray-800 text-center text-sm" }) }), jsxRuntime.jsxs(nextjs.ClerkLoaded, { children: [!isSignedIn && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [data.showSignUp && (jsxRuntime.jsxs("div", { className: "relative inline-flex z-10", children: [jsxRuntime.jsx(signupButtonWithFingerprintClient.SignUpButtonWithFingerprint, { mode: data.clerkAuthInModal ? 'modal' : 'redirect', signUp: data.signUp }), data.signUpBonus && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("span", { onMouseEnter: () => setShowTooltip(true), onMouseLeave: () => setShowTooltip(false), className: `absolute -top-0.5 sm:-top-1 -right-1.5 sm:-right-2 flex h-4 sm:h-5 min-w-4 sm:min-w-5 items-center justify-center rounded-full ${lib.themeButtonGradientClass} px-1 sm:px-1.5 text-[9px] sm:text-[10px] font-bold text-white shadow-lg ring-1 sm:ring-2 ring-white/80 dark:ring-white/10 cursor-default`, children: data.signUpBonus }), showTooltip && data.signUpBonusTooltip && (jsxRuntime.jsx("div", { className: `absolute left-1/2 -translate-x-1/2 -translate-y-full -top-1.5 whitespace-nowrap rounded-lg ${lib.themeButtonGradientClass} border border-white/30 dark:border-white/10 px-3 py-1.5 text-xs font-medium text-white shadow-lg pointer-events-none`, children: data.signUpBonusTooltip }))] }))] })), data.clerkAuthInModal ? (jsxRuntime.jsx(nextjs.SignInButton, { mode: "modal", appearance: clerkAuthAppearance.clerkAuthModalAppearance, children: jsxRuntime.jsx("button", { className: "w-16 sm:w-20 h-8 sm:h-9 px-1.5 sm:px-2 border border-gray-300 rounded-full hover:bg-gray-100 dark:border-gray-600 dark:hover:bg-gray-800 text-center text-xs sm:text-sm whitespace-nowrap", children: data.signIn }) })) : (jsxRuntime.jsx(nextjs.SignInButton, { mode: "redirect", children: jsxRuntime.jsx("button", { className: "w-16 sm:w-20 h-8 sm:h-9 px-1.5 sm:px-2 border border-gray-300 rounded-full hover:bg-gray-100 dark:border-gray-600 dark:hover:bg-gray-800 text-center text-xs sm:text-sm whitespace-nowrap", children: data.signIn }) }))] })), isSignedIn && (jsxRuntime.jsx(nextjs.UserButton, { appearance: {
|
|
15
16
|
elements: {
|
|
16
17
|
userButtonAvatarBox: "w-8 h-8 border",
|
|
17
18
|
}
|
|
@@ -4,12 +4,13 @@ import { useState } from 'react';
|
|
|
4
4
|
import { useAuth, ClerkLoading, ClerkLoaded, SignInButton, UserButton } from '@clerk/nextjs';
|
|
5
5
|
import { ReceiptTextIcon, ShieldUserIcon } from '@windrun-huaiin/base-ui/icons';
|
|
6
6
|
import { themeButtonGradientClass } from '@windrun-huaiin/base-ui/lib';
|
|
7
|
+
import { clerkAuthModalAppearance } from './clerk-auth-appearance.mjs';
|
|
7
8
|
import { SignUpButtonWithFingerprint } from './signup-button-with-fingerprint-client.mjs';
|
|
8
9
|
|
|
9
10
|
function ClerkUserClient({ data }) {
|
|
10
11
|
const [showTooltip, setShowTooltip] = useState(false);
|
|
11
12
|
const { isSignedIn } = useAuth();
|
|
12
|
-
return (jsxs("div", { className: "flex items-center gap-2 h-10 mr-3 sm:mr-2", children: [jsx(ClerkLoading, { children: jsx("div", { className: "w-20 h-9 px-2 border border-gray-300 rounded-full hover:bg-gray-100 dark:border-gray-600 dark:hover:bg-gray-800 text-center text-sm" }) }), jsxs(ClerkLoaded, { children: [!isSignedIn && (jsxs(Fragment, { children: [data.showSignUp && (jsxs("div", { className: "relative inline-flex z-10", children: [jsx(SignUpButtonWithFingerprint, { mode: data.clerkAuthInModal ? 'modal' : 'redirect', signUp: data.signUp }), data.signUpBonus && (jsxs(Fragment, { children: [jsx("span", { onMouseEnter: () => setShowTooltip(true), onMouseLeave: () => setShowTooltip(false), className: `absolute -top-0.5 sm:-top-1 -right-1.5 sm:-right-2 flex h-4 sm:h-5 min-w-4 sm:min-w-5 items-center justify-center rounded-full ${themeButtonGradientClass} px-1 sm:px-1.5 text-[9px] sm:text-[10px] font-bold text-white shadow-lg ring-1 sm:ring-2 ring-white/80 dark:ring-white/10 cursor-default`, children: data.signUpBonus }), showTooltip && data.signUpBonusTooltip && (jsx("div", { className: `absolute left-1/2 -translate-x-1/2 -translate-y-full -top-1.5 whitespace-nowrap rounded-lg ${themeButtonGradientClass} border border-white/30 dark:border-white/10 px-3 py-1.5 text-xs font-medium text-white shadow-lg pointer-events-none`, children: data.signUpBonusTooltip }))] }))] })), jsx(SignInButton, { mode: data.
|
|
13
|
+
return (jsxs("div", { className: "flex items-center gap-2 h-10 mr-3 sm:mr-2", children: [jsx(ClerkLoading, { children: jsx("div", { className: "w-20 h-9 px-2 border border-gray-300 rounded-full hover:bg-gray-100 dark:border-gray-600 dark:hover:bg-gray-800 text-center text-sm" }) }), jsxs(ClerkLoaded, { children: [!isSignedIn && (jsxs(Fragment, { children: [data.showSignUp && (jsxs("div", { className: "relative inline-flex z-10", children: [jsx(SignUpButtonWithFingerprint, { mode: data.clerkAuthInModal ? 'modal' : 'redirect', signUp: data.signUp }), data.signUpBonus && (jsxs(Fragment, { children: [jsx("span", { onMouseEnter: () => setShowTooltip(true), onMouseLeave: () => setShowTooltip(false), className: `absolute -top-0.5 sm:-top-1 -right-1.5 sm:-right-2 flex h-4 sm:h-5 min-w-4 sm:min-w-5 items-center justify-center rounded-full ${themeButtonGradientClass} px-1 sm:px-1.5 text-[9px] sm:text-[10px] font-bold text-white shadow-lg ring-1 sm:ring-2 ring-white/80 dark:ring-white/10 cursor-default`, children: data.signUpBonus }), showTooltip && data.signUpBonusTooltip && (jsx("div", { className: `absolute left-1/2 -translate-x-1/2 -translate-y-full -top-1.5 whitespace-nowrap rounded-lg ${themeButtonGradientClass} border border-white/30 dark:border-white/10 px-3 py-1.5 text-xs font-medium text-white shadow-lg pointer-events-none`, children: data.signUpBonusTooltip }))] }))] })), data.clerkAuthInModal ? (jsx(SignInButton, { mode: "modal", appearance: clerkAuthModalAppearance, children: jsx("button", { className: "w-16 sm:w-20 h-8 sm:h-9 px-1.5 sm:px-2 border border-gray-300 rounded-full hover:bg-gray-100 dark:border-gray-600 dark:hover:bg-gray-800 text-center text-xs sm:text-sm whitespace-nowrap", children: data.signIn }) })) : (jsx(SignInButton, { mode: "redirect", children: jsx("button", { className: "w-16 sm:w-20 h-8 sm:h-9 px-1.5 sm:px-2 border border-gray-300 rounded-full hover:bg-gray-100 dark:border-gray-600 dark:hover:bg-gray-800 text-center text-xs sm:text-sm whitespace-nowrap", children: data.signIn }) }))] })), isSignedIn && (jsx(UserButton, { appearance: {
|
|
13
14
|
elements: {
|
|
14
15
|
userButtonAvatarBox: "w-8 h-8 border",
|
|
15
16
|
}
|