@windrun-huaiin/third-ui 30.0.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.
Files changed (122) hide show
  1. package/README.md +109 -143
  2. package/dist/ai/ai-prompt-textarea.js +5 -5
  3. package/dist/ai/ai-prompt-textarea.mjs +5 -5
  4. package/dist/clerk/clerk-auth-appearance.d.ts +13 -0
  5. package/dist/clerk/clerk-auth-appearance.js +19 -0
  6. package/dist/clerk/clerk-auth-appearance.mjs +15 -0
  7. package/dist/clerk/clerk-auth-modal-appearance.d.ts +12 -0
  8. package/dist/clerk/clerk-auth-modal-appearance.js +17 -0
  9. package/dist/clerk/clerk-auth-modal-appearance.mjs +14 -0
  10. package/dist/clerk/clerk-page-context-generator.js +3 -3
  11. package/dist/clerk/clerk-page-context-generator.mjs +3 -3
  12. package/dist/clerk/clerk-page-generator.js +4 -4
  13. package/dist/clerk/clerk-page-generator.mjs +4 -4
  14. package/dist/clerk/clerk-user-client.js +2 -1
  15. package/dist/clerk/clerk-user-client.mjs +2 -1
  16. package/dist/clerk/fingerprint/fingerprint-client.d.ts +10 -10
  17. package/dist/clerk/fingerprint/fingerprint-client.js +20 -20
  18. package/dist/clerk/fingerprint/fingerprint-client.mjs +20 -20
  19. package/dist/clerk/fingerprint/fingerprint-provider.d.ts +3 -3
  20. package/dist/clerk/fingerprint/fingerprint-provider.js +8 -8
  21. package/dist/clerk/fingerprint/fingerprint-provider.mjs +8 -8
  22. package/dist/clerk/fingerprint/fingerprint-server.d.ts +12 -12
  23. package/dist/clerk/fingerprint/fingerprint-server.js +17 -17
  24. package/dist/clerk/fingerprint/fingerprint-server.mjs +17 -17
  25. package/dist/clerk/fingerprint/fingerprint-shared.d.ts +3 -3
  26. package/dist/clerk/fingerprint/fingerprint-shared.js +10 -10
  27. package/dist/clerk/fingerprint/fingerprint-shared.mjs +10 -10
  28. package/dist/clerk/fingerprint/types.d.ts +0 -1
  29. package/dist/clerk/fingerprint/use-fingerprint.js +7 -7
  30. package/dist/clerk/fingerprint/use-fingerprint.mjs +7 -7
  31. package/dist/clerk/signin-with-fingerprint-client.d.ts +2 -2
  32. package/dist/clerk/signin-with-fingerprint-client.js +7 -6
  33. package/dist/clerk/signin-with-fingerprint-client.mjs +7 -6
  34. package/dist/clerk/signup-button-with-fingerprint-client.js +6 -4
  35. package/dist/clerk/signup-button-with-fingerprint-client.mjs +6 -4
  36. package/dist/clerk/signup-with-fingerprint-client.d.ts +2 -2
  37. package/dist/clerk/signup-with-fingerprint-client.js +7 -6
  38. package/dist/clerk/signup-with-fingerprint-client.mjs +7 -6
  39. package/dist/fuma/fuma-page-genarator.d.ts +2 -6
  40. package/dist/fuma/fuma-page-genarator.js +3 -2
  41. package/dist/fuma/fuma-page-genarator.mjs +3 -2
  42. package/dist/fuma/heavy/mermaid.js +1 -1
  43. package/dist/fuma/heavy/mermaid.mjs +1 -1
  44. package/dist/fuma/site-x.js +0 -1
  45. package/dist/fuma/site-x.mjs +0 -1
  46. package/dist/main/404-page.d.ts +12 -0
  47. package/dist/main/404-page.js +66 -0
  48. package/dist/main/404-page.mjs +64 -0
  49. package/dist/main/anime/anime-404-page.d.ts +14 -0
  50. package/dist/main/anime/anime-404-page.js +197 -0
  51. package/dist/main/anime/anime-404-page.mjs +195 -0
  52. package/dist/main/anime/anime-not-found-page.d.ts +7 -0
  53. package/dist/main/anime/anime-not-found-page.js +142 -0
  54. package/dist/main/anime/anime-not-found-page.mjs +140 -0
  55. package/dist/main/anime/index.d.ts +1 -0
  56. package/dist/main/anime/index.js +2 -0
  57. package/dist/main/anime/index.mjs +1 -0
  58. package/dist/main/calendar/calendar-date-range-input.js +1 -1
  59. package/dist/main/calendar/calendar-date-range-input.mjs +1 -1
  60. package/dist/main/credit/types.d.ts +8 -8
  61. package/dist/main/index.d.ts +1 -0
  62. package/dist/main/index.js +2 -0
  63. package/dist/main/index.mjs +1 -0
  64. package/dist/main/money-price/index.d.ts +1 -1
  65. package/dist/main/money-price/money-price-button.js +10 -10
  66. package/dist/main/money-price/money-price-button.mjs +10 -10
  67. package/dist/main/money-price/money-price-config-util.d.ts +30 -30
  68. package/dist/main/money-price/money-price-config-util.js +48 -48
  69. package/dist/main/money-price/money-price-config-util.mjs +48 -48
  70. package/dist/main/money-price/money-price-interactive.js +30 -18
  71. package/dist/main/money-price/money-price-interactive.mjs +30 -18
  72. package/dist/main/money-price/money-price-types.d.ts +7 -1
  73. package/dist/main/money-price/money-price-types.js +2 -2
  74. package/dist/main/money-price/money-price-types.mjs +2 -2
  75. package/dist/main/money-price/server.d.ts +1 -1
  76. package/dist/main/motion/creative-left-panel.d.ts +7 -0
  77. package/dist/main/motion/creative-left-panel.js +11 -0
  78. package/dist/main/motion/creative-left-panel.mjs +9 -0
  79. package/dist/main/motion/creative-right-panel.d.ts +7 -0
  80. package/dist/main/motion/creative-right-panel.js +11 -0
  81. package/dist/main/motion/creative-right-panel.mjs +9 -0
  82. package/dist/main/pill-select/x-pill-select.js +2 -2
  83. package/dist/main/pill-select/x-pill-select.mjs +2 -2
  84. package/dist/main/server.d.ts +1 -1
  85. package/dist/main/snake-loading-frame.js +1 -0
  86. package/dist/main/snake-loading-frame.mjs +1 -0
  87. package/package.json +13 -7
  88. package/src/ai/ai-prompt-textarea.tsx +6 -6
  89. package/src/clerk/clerk-auth-appearance.ts +16 -0
  90. package/src/clerk/clerk-page-context-generator.tsx +3 -5
  91. package/src/clerk/clerk-page-generator.tsx +9 -8
  92. package/src/clerk/clerk-user-client.tsx +14 -5
  93. package/src/clerk/fingerprint/fingerprint-client.ts +20 -20
  94. package/src/clerk/fingerprint/fingerprint-provider.tsx +11 -11
  95. package/src/clerk/fingerprint/fingerprint-server.ts +17 -17
  96. package/src/clerk/fingerprint/fingerprint-shared.ts +10 -10
  97. package/src/clerk/fingerprint/types.ts +0 -1
  98. package/src/clerk/fingerprint/use-fingerprint.ts +7 -7
  99. package/src/clerk/signin-with-fingerprint-client.tsx +7 -7
  100. package/src/clerk/signup-button-with-fingerprint-client.tsx +7 -5
  101. package/src/clerk/signup-with-fingerprint-client.tsx +7 -7
  102. package/src/fuma/base/custom-home-layout.tsx +4 -4
  103. package/src/fuma/fuma-page-genarator.tsx +2 -22
  104. package/src/fuma/heavy/mermaid.tsx +1 -1
  105. package/src/fuma/site-x.tsx +0 -1
  106. package/src/main/404-page.tsx +162 -0
  107. package/src/main/anime/anime-404-page.tsx +344 -0
  108. package/src/main/anime/index.ts +1 -0
  109. package/src/main/calendar/calendar-date-range-input.tsx +1 -1
  110. package/src/main/credit/types.ts +8 -8
  111. package/src/main/gallery/gallery-mobile-swiper.tsx +0 -1
  112. package/src/main/gallery/gallery-server.tsx +2 -2
  113. package/src/main/index.ts +1 -0
  114. package/src/main/money-price/index.ts +2 -0
  115. package/src/main/money-price/money-price-button.tsx +10 -10
  116. package/src/main/money-price/money-price-config-util.ts +49 -49
  117. package/src/main/money-price/money-price-interactive.tsx +40 -20
  118. package/src/main/money-price/money-price-types.ts +21 -14
  119. package/src/main/money-price/server.ts +2 -0
  120. package/src/main/pill-select/x-pill-select.tsx +2 -2
  121. package/src/main/server.ts +3 -1
  122. 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
- This README currently documents only the Fuma/MDX component design in `third-ui`.
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
- Other modules in this package, such as Clerk, main application UI, AI UI, fingerprint, SEO helpers, and shared layout utilities, are intentionally not covered here.
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
- ## MDX Component Layer
7
+ ## Feature Areas
8
8
 
9
- The Fuma/MDX part of `third-ui` provides the rendering component map used by application MDX pages.
9
+ ### Main Application UI
10
10
 
11
- It is not responsible for reading files or compiling MDX. That belongs to `@windrun-huaiin/fumadocs-local-md`.
11
+ The main UI layer provides reusable building blocks for product-facing pages and application surfaces:
12
12
 
13
- The split is:
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
- - `local-md`: content source, frontmatter/meta parsing, Markdown/MDX compilation, render execution safety.
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
- ## Design Goals
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
- - Keep the base MDX component map useful but small.
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
- ## Current Entry Model
50
+ The AI layer provides ready-to-compose interface pieces for chat and prompt-driven product experiences:
29
51
 
30
- New applications should use the base site MDX entry:
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
- ```ts
33
- @windrun-huaiin/third-ui/fuma/server/site-mdx/base
34
- ```
57
+ Primary entry point:
35
58
 
36
- Optional renderer features live behind physical subpath entries:
59
+ | Entry | Purpose |
60
+ | --- | --- |
61
+ | `@windrun-huaiin/third-ui/ai` | AI chat, prompt, message, markdown, status, and conversation UI utilities |
37
62
 
38
- ```ts
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 old aggregate entries have been removed. There is no supported `site-mdx-components` entry and no `optional-features` aggregate entry.
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
- ## Base Components
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
- The base entry is the minimum component set for normal documentation content.
69
+ Primary entry points:
50
70
 
51
- It includes:
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
- - Fuma UI basics: `Card`, `Cards`, `Callout`, `File`, `Folder`, `Files`, `Accordion`, `Accordions`, `Tab`, `Tabs`.
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
- It intentionally does not include heavyweight renderer implementations such as Mermaid, KaTeX rendering, Fuma codeblock rendering, or type-table rendering.
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
- ## Renderer Feature Matrix
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
- | Capability | Renderer Entry | Compiler Entry Required | Notes |
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
- This table is the main rule for application integration.
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
- `code` and `math` need both compiler and renderer support. `npm` is compiler-only. `mermaid` and `type-table` are renderer-only.
99
+ ### MDX Renderer Boundaries
75
100
 
76
- ## Bundle Cropping Rule
101
+ The MDX renderer layer is intentionally split into a base entry and optional feature entries.
77
102
 
78
- Renderer pruning is based on import boundaries.
103
+ Use the base entry for ordinary documentation content. Add feature entries only when an application needs the corresponding renderer capability.
79
104
 
80
- If an application does not import `site-mdx/features/mermaid`, Mermaid renderer code should not be pulled into the base renderer entry. The same rule applies to code, math, and type-table renderer features.
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
- Do not reintroduce a file that imports all renderer features and then chooses one at runtime. That pattern defeats bundle cropping because static imports run before configuration checks.
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
- Correct model:
118
+ ### Server and SEO Utilities
85
119
 
86
- - base entry imports only base renderers and lightweight fallback components.
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
- ## Fallback Design
122
+ Primary entry points:
91
123
 
92
- There are two fallback layers.
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
- The first layer lives in `third-ui`.
129
+ ### Styles
95
130
 
96
- It provides feature-aware fallbacks for known but disabled MDX capabilities:
131
+ The package exposes a shared stylesheet for components that depend on the package-level visual system.
97
132
 
98
- - `MathBlock`
99
- - `InlineMath`
100
- - `Mermaid`
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
- These fallbacks render visible warning blocks instead of silently dropping content.
137
+ ## Usage Notes
108
138
 
109
- The second layer lives in `local-md`.
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
- It is the final safety net for arbitrary unknown PascalCase components, such as:
145
+ ## Installation
112
146
 
113
- ```mdx
114
- <CalloutXXX />
147
+ ```bash
148
+ pnpm add @windrun-huaiin/third-ui
115
149
  ```
116
150
 
117
- `local-md` detects missing component references from the compiled MDX output and injects generic fallback components before rendering. This prevents unknown MDX components from crashing the page.
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
- // 渲染textarea组件
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
- // 渲染textarea组件
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,12 @@
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
+ };
@@ -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: clerkPageContainerClassName, children: jsxRuntime.jsx(signupWithFingerprintClient.SignUpWithFingerprint, {}) }));
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: clerkPageContainerClassName, children: jsxRuntime.jsx(signinWithFingerprintClient.SignInWithFingerprint, {}) }));
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: clerkPageContainerClassName, children: jsx(SignUpWithFingerprint, {}) }));
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: clerkPageContainerClassName, children: jsx(SignInWithFingerprint, {}) }));
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: clerkPageContainerClassName, children: jsxRuntime.jsx(nextjs.SignIn, {}) }));
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: clerkPageContainerClassName, children: jsxRuntime.jsx(nextjs.SignUp, {}) }));
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: clerkPageContainerClassName, children: jsxRuntime.jsx(nextjs.Waitlist, {}) }));
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: clerkPageContainerClassName, children: jsx(SignIn, {}) }));
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: clerkPageContainerClassName, children: jsx(SignUp, {}) }));
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: clerkPageContainerClassName, children: jsx(Waitlist, {}) }));
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.clerkAuthInModal ? 'modal' : '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
+ 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.clerkAuthInModal ? 'modal' : '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
+ 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
  }