@windrun-huaiin/third-ui 11.0.1 → 11.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,8 @@
1
1
  interface ClerkUserData {
2
2
  signIn: string;
3
3
  signUp: string;
4
+ signUpBonus?: string;
5
+ signUpBonusTooltip?: string;
4
6
  terms: string;
5
7
  privacy: string;
6
8
  locale: string;
@@ -2,12 +2,14 @@
2
2
  'use strict';
3
3
 
4
4
  var jsxRuntime = require('react/jsx-runtime');
5
+ var React = require('react');
5
6
  var nextjs = require('@clerk/nextjs');
6
7
  var server = require('@windrun-huaiin/base-ui/components/server');
7
8
  var signupButtonWithFingerprintClient = require('./signup-button-with-fingerprint-client.js');
8
9
 
9
10
  function ClerkUserClient({ data }) {
10
- 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: [jsxRuntime.jsxs(nextjs.SignedOut, { children: [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 }) }), data.showSignUp && (jsxRuntime.jsx(signupButtonWithFingerprintClient.SignUpButtonWithFingerprint, { mode: data.clerkAuthInModal ? 'modal' : 'redirect', signUp: data.signUp }))] }), jsxRuntime.jsx(nextjs.SignedIn, { children: jsxRuntime.jsx(nextjs.UserButton, { appearance: {
11
+ const [showTooltip, setShowTooltip] = React.useState(false);
12
+ 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: [jsxRuntime.jsxs(nextjs.SignedOut, { 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 bg-linear-to-r from-purple-400 to-pink-500 dark:from-purple-500 dark:to-pink-600 px-1 sm:px-1.5 text-[9px] sm:text-[10px] font-bold text-white shadow-lg shadow-purple-500/30 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 bg-linear-to-r from-purple-500 to-pink-500 dark:from-purple-500 dark:to-pink-600 border border-white/30 dark:border-white/10 px-3 py-1.5 text-xs font-medium text-white shadow-lg shadow-purple-500/30 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 }) })] }), jsxRuntime.jsx(nextjs.SignedIn, { children: jsxRuntime.jsx(nextjs.UserButton, { appearance: {
11
13
  elements: {
12
14
  userButtonAvatarBox: "w-8 h-8 border",
13
15
  }
@@ -1,11 +1,13 @@
1
1
  "use client";
2
- import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
3
+ import { useState } from 'react';
3
4
  import { ClerkLoading, ClerkLoaded, SignedOut, SignInButton, SignedIn, UserButton } from '@clerk/nextjs';
4
5
  import { globalLucideIcons } from '@windrun-huaiin/base-ui/components/server';
5
6
  import { SignUpButtonWithFingerprint } from './signup-button-with-fingerprint-client.mjs';
6
7
 
7
8
  function ClerkUserClient({ data }) {
8
- 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: [jsxs(SignedOut, { children: [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 }) }), data.showSignUp && (jsx(SignUpButtonWithFingerprint, { mode: data.clerkAuthInModal ? 'modal' : 'redirect', signUp: data.signUp }))] }), jsx(SignedIn, { children: jsx(UserButton, { appearance: {
9
+ const [showTooltip, setShowTooltip] = useState(false);
10
+ 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: [jsxs(SignedOut, { 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 bg-linear-to-r from-purple-400 to-pink-500 dark:from-purple-500 dark:to-pink-600 px-1 sm:px-1.5 text-[9px] sm:text-[10px] font-bold text-white shadow-lg shadow-purple-500/30 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 bg-linear-to-r from-purple-500 to-pink-500 dark:from-purple-500 dark:to-pink-600 border border-white/30 dark:border-white/10 px-3 py-1.5 text-xs font-medium text-white shadow-lg shadow-purple-500/30 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 }) })] }), jsx(SignedIn, { children: jsx(UserButton, { appearance: {
9
11
  elements: {
10
12
  userButtonAvatarBox: "w-8 h-8 border",
11
13
  }
@@ -12,6 +12,8 @@ function ClerkUser(_a) {
12
12
  const data = {
13
13
  signIn: t('signIn'),
14
14
  signUp: t('signUp'),
15
+ signUpBonus: t('signUpBonus'),
16
+ signUpBonusTooltip: t('signUpBonusTooltip'),
15
17
  terms: t2('terms'),
16
18
  privacy: t2('privacy'),
17
19
  locale,
@@ -10,6 +10,8 @@ function ClerkUser(_a) {
10
10
  const data = {
11
11
  signIn: t('signIn'),
12
12
  signUp: t('signUp'),
13
+ signUpBonus: t('signUpBonus'),
14
+ signUpBonusTooltip: t('signUpBonusTooltip'),
13
15
  terms: t2('terms'),
14
16
  privacy: t2('privacy'),
15
17
  locale,
@@ -11,7 +11,7 @@ function FumaBannerSuit(_a) {
11
11
  const heightValue = showBanner ? 3 : 0.5;
12
12
  const height = `${heightValue}rem`;
13
13
  const bannerText = t('banner');
14
- return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: showBanner ? (jsxRuntime.jsx(banner.Banner, { variant: "rainbow", changeLayout: true, height: heightValue, floating: floating, children: jsxRuntime.jsx("p", { className: "text-xl", children: bannerText }) })) : (jsxRuntime.jsx("div", { className: "m-0 rounded-none bg-neutral-100 dark:bg-neutral-900", style: {
14
+ return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: showBanner ? (jsxRuntime.jsx(banner.Banner, { variant: "rainbow", changeLayout: true, height: heightValue, floating: floating, children: jsxRuntime.jsx("p", { className: "text-sm sm:text-xl md:text-xl", children: bannerText }) })) : (jsxRuntime.jsx("div", { className: "m-0 rounded-none bg-neutral-100 dark:bg-neutral-900", style: {
15
15
  position: floating ? 'fixed' : 'relative',
16
16
  top: floating ? 0 : undefined,
17
17
  left: floating ? 0 : undefined,
@@ -9,7 +9,7 @@ function FumaBannerSuit(_a) {
9
9
  const heightValue = showBanner ? 3 : 0.5;
10
10
  const height = `${heightValue}rem`;
11
11
  const bannerText = t('banner');
12
- return (jsx(Fragment, { children: showBanner ? (jsx(Banner, { variant: "rainbow", changeLayout: true, height: heightValue, floating: floating, children: jsx("p", { className: "text-xl", children: bannerText }) })) : (jsx("div", { className: "m-0 rounded-none bg-neutral-100 dark:bg-neutral-900", style: {
12
+ return (jsx(Fragment, { children: showBanner ? (jsx(Banner, { variant: "rainbow", changeLayout: true, height: heightValue, floating: floating, children: jsx("p", { className: "text-sm sm:text-xl md:text-xl", children: bannerText }) })) : (jsx("div", { className: "m-0 rounded-none bg-neutral-100 dark:bg-neutral-900", style: {
13
13
  position: floating ? 'fixed' : 'relative',
14
14
  top: floating ? 0 : undefined,
15
15
  left: floating ? 0 : undefined,
@@ -74,7 +74,7 @@ function GradientButton({ title, icon, align = 'left', disabled = false, classNa
74
74
  : align === 'center'
75
75
  ? 'justify-center'
76
76
  : 'justify-start';
77
- const buttonClassName = utils.cn('bg-gradient-to-r from-purple-400 to-pink-500 hover:from-purple-500 hover:to-pink-600 dark:from-purple-500 dark:to-pink-600 dark:hover:from-purple-600 dark:hover:to-pink-700 text-white text-base font-bold shadow-lg hover:shadow-xl transition-all duration-300 rounded-full', alignmentClass, isDisabled && 'opacity-50 cursor-not-allowed', className);
77
+ const buttonClassName = utils.cn('bg-linear-to-r from-purple-400 to-pink-500 hover:from-purple-500 hover:to-pink-600 dark:from-purple-500 dark:to-pink-600 dark:hover:from-purple-600 dark:hover:to-pink-700 text-white text-base font-bold shadow-lg hover:shadow-xl transition-all duration-300 rounded-full', alignmentClass, isDisabled && 'opacity-50 cursor-not-allowed', className);
78
78
  return (jsxRuntime.jsx("div", { className: `flex flex-row gap-3 ${getAlignmentClass()}`, children: onClick ? (
79
79
  // for click
80
80
  jsxRuntime.jsx(ui.Button, { size: "lg", className: buttonClassName, onClick: handleClick, disabled: isDisabled, children: buttonContent })) : (
@@ -72,7 +72,7 @@ function GradientButton({ title, icon, align = 'left', disabled = false, classNa
72
72
  : align === 'center'
73
73
  ? 'justify-center'
74
74
  : 'justify-start';
75
- const buttonClassName = cn('bg-gradient-to-r from-purple-400 to-pink-500 hover:from-purple-500 hover:to-pink-600 dark:from-purple-500 dark:to-pink-600 dark:hover:from-purple-600 dark:hover:to-pink-700 text-white text-base font-bold shadow-lg hover:shadow-xl transition-all duration-300 rounded-full', alignmentClass, isDisabled && 'opacity-50 cursor-not-allowed', className);
75
+ const buttonClassName = cn('bg-linear-to-r from-purple-400 to-pink-500 hover:from-purple-500 hover:to-pink-600 dark:from-purple-500 dark:to-pink-600 dark:hover:from-purple-600 dark:hover:to-pink-700 text-white text-base font-bold shadow-lg hover:shadow-xl transition-all duration-300 rounded-full', alignmentClass, isDisabled && 'opacity-50 cursor-not-allowed', className);
76
76
  return (jsx("div", { className: `flex flex-row gap-3 ${getAlignmentClass()}`, children: onClick ? (
77
77
  // for click
78
78
  jsx(Button, { size: "lg", className: buttonClassName, onClick: handleClick, disabled: isDisabled, children: buttonContent })) : (
@@ -313,7 +313,7 @@ function MoneyPriceInteractive({ data, config, checkoutApiEndpoint, customerPort
313
313
  return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: "flex justify-center mb-6 max-md:sticky max-md:top-30 max-md:z-30 max-md:py-2 max-md:bg-transparent", children: jsxRuntime.jsx("div", { className: "inline-flex bg-white dark:bg-gray-900 border border-gray-300 dark:border-gray-700 rounded-full px-2 py-2 sm:px-3 sm:py-3 max-md:w-full max-md:max-w-[340px] max-md:mx-auto shadow-sm", "data-billing-switch": true, children: billingOptions.map(option => {
314
314
  const isActive = option.key === billingType;
315
315
  const buttonClasses = isActive
316
- ? 'text-white bg-gradient-to-r from-purple-400 to-pink-500 hover:from-purple-500 hover:to-pink-600 dark:from-purple-500 dark:to-pink-600 dark:hover:from-purple-600 rounded-full shadow-sm'
316
+ ? 'text-white bg-linear-to-r from-purple-400 to-pink-500 hover:from-purple-500 hover:to-pink-600 dark:from-purple-500 dark:to-pink-600 dark:hover:from-purple-600 rounded-full shadow-sm'
317
317
  : 'text-gray-800 dark:text-gray-200 hover:text-gray-900 dark:hover:text-gray-100 rounded-full';
318
318
  const showBadge = option.key === billingType && !!discountBadgeText;
319
319
  return (jsxRuntime.jsxs("div", { className: "relative flex items-center justify-center mx-1", children: [showBadge && (jsxRuntime.jsx("span", { className: "absolute z-10 left-1/2 -translate-x-1/2 -top-3 sm:-top-4 translate-y-[-50%] px-3 py-0.5 text-[0.625rem] sm:text-xs rounded-md bg-yellow-100 text-yellow-800 font-semibold shadow-sm whitespace-nowrap", children: discountBadgeText })), jsxRuntime.jsx("button", { className: utils.cn('text-sm md:text-base font-medium transition relative text-center z-10 px-2 sm:px-4 py-2 min-w-[100px] sm:min-w-[120px]', buttonClasses), type: "button", "data-billing-button": option.key, onClick: () => setBillingType(option.key), children: option.name })] }, option.key));
@@ -311,7 +311,7 @@ function MoneyPriceInteractive({ data, config, checkoutApiEndpoint, customerPort
311
311
  return (jsxs(Fragment, { children: [jsx("div", { className: "flex justify-center mb-6 max-md:sticky max-md:top-30 max-md:z-30 max-md:py-2 max-md:bg-transparent", children: jsx("div", { className: "inline-flex bg-white dark:bg-gray-900 border border-gray-300 dark:border-gray-700 rounded-full px-2 py-2 sm:px-3 sm:py-3 max-md:w-full max-md:max-w-[340px] max-md:mx-auto shadow-sm", "data-billing-switch": true, children: billingOptions.map(option => {
312
312
  const isActive = option.key === billingType;
313
313
  const buttonClasses = isActive
314
- ? 'text-white bg-gradient-to-r from-purple-400 to-pink-500 hover:from-purple-500 hover:to-pink-600 dark:from-purple-500 dark:to-pink-600 dark:hover:from-purple-600 rounded-full shadow-sm'
314
+ ? 'text-white bg-linear-to-r from-purple-400 to-pink-500 hover:from-purple-500 hover:to-pink-600 dark:from-purple-500 dark:to-pink-600 dark:hover:from-purple-600 rounded-full shadow-sm'
315
315
  : 'text-gray-800 dark:text-gray-200 hover:text-gray-900 dark:hover:text-gray-100 rounded-full';
316
316
  const showBadge = option.key === billingType && !!discountBadgeText;
317
317
  return (jsxs("div", { className: "relative flex items-center justify-center mx-1", children: [showBadge && (jsx("span", { className: "absolute z-10 left-1/2 -translate-x-1/2 -top-3 sm:-top-4 translate-y-[-50%] px-3 py-0.5 text-[0.625rem] sm:text-xs rounded-md bg-yellow-100 text-yellow-800 font-semibold shadow-sm whitespace-nowrap", children: discountBadgeText })), jsx("button", { className: cn('text-sm md:text-base font-medium transition relative text-center z-10 px-2 sm:px-4 py-2 min-w-[100px] sm:min-w-[120px]', buttonClasses), type: "button", "data-billing-button": option.key, onClick: () => setBillingType(option.key), children: option.name })] }, option.key));
@@ -172,7 +172,7 @@ function PricePlanInteractive({ data }) {
172
172
  const yearlyButton = document.querySelector('[data-billing-button="yearly"]');
173
173
  if (monthlyButton) {
174
174
  if (newBillingKey === 'monthly') {
175
- monthlyButton.className = utils.cn('min-w-[120px] px-6 py-2 font-medium transition text-lg relative', 'text-white bg-gradient-to-r from-purple-400 to-pink-500 hover:from-purple-500 hover:to-pink-600 dark:from-purple-500 dark:to-pink-600 dark:hover:from-purple-600 rounded-full shadow-sm');
175
+ monthlyButton.className = utils.cn('min-w-[120px] px-6 py-2 font-medium transition text-lg relative', 'text-white bg-linear-to-r from-purple-400 to-pink-500 hover:from-purple-500 hover:to-pink-600 dark:from-purple-500 dark:to-pink-600 dark:hover:from-purple-600 rounded-full shadow-sm');
176
176
  }
177
177
  else {
178
178
  monthlyButton.className = utils.cn('min-w-[120px] px-6 py-2 font-medium transition text-lg relative', 'text-gray-800 dark:text-gray-200 hover:text-gray-900 dark:hover:text-gray-100 rounded-full');
@@ -180,7 +180,7 @@ function PricePlanInteractive({ data }) {
180
180
  }
181
181
  if (yearlyButton) {
182
182
  if (newBillingKey === 'yearly') {
183
- yearlyButton.className = utils.cn('min-w-[120px] px-6 py-2 font-medium transition text-lg relative', 'text-white bg-gradient-to-r from-purple-400 to-pink-500 hover:from-purple-500 hover:to-pink-600 dark:from-purple-500 dark:to-pink-600 dark:hover:from-purple-600 rounded-full shadow-sm');
183
+ yearlyButton.className = utils.cn('min-w-[120px] px-6 py-2 font-medium transition text-lg relative', 'text-white bg-linear-to-r from-purple-400 to-pink-500 hover:from-purple-500 hover:to-pink-600 dark:from-purple-500 dark:to-pink-600 dark:hover:from-purple-600 rounded-full shadow-sm');
184
184
  }
185
185
  else {
186
186
  yearlyButton.className = utils.cn('min-w-[120px] px-6 py-2 font-medium transition text-lg relative', 'text-gray-800 dark:text-gray-200 hover:text-gray-900 dark:hover:text-gray-100 rounded-full');
@@ -170,7 +170,7 @@ function PricePlanInteractive({ data }) {
170
170
  const yearlyButton = document.querySelector('[data-billing-button="yearly"]');
171
171
  if (monthlyButton) {
172
172
  if (newBillingKey === 'monthly') {
173
- monthlyButton.className = cn('min-w-[120px] px-6 py-2 font-medium transition text-lg relative', 'text-white bg-gradient-to-r from-purple-400 to-pink-500 hover:from-purple-500 hover:to-pink-600 dark:from-purple-500 dark:to-pink-600 dark:hover:from-purple-600 rounded-full shadow-sm');
173
+ monthlyButton.className = cn('min-w-[120px] px-6 py-2 font-medium transition text-lg relative', 'text-white bg-linear-to-r from-purple-400 to-pink-500 hover:from-purple-500 hover:to-pink-600 dark:from-purple-500 dark:to-pink-600 dark:hover:from-purple-600 rounded-full shadow-sm');
174
174
  }
175
175
  else {
176
176
  monthlyButton.className = cn('min-w-[120px] px-6 py-2 font-medium transition text-lg relative', 'text-gray-800 dark:text-gray-200 hover:text-gray-900 dark:hover:text-gray-100 rounded-full');
@@ -178,7 +178,7 @@ function PricePlanInteractive({ data }) {
178
178
  }
179
179
  if (yearlyButton) {
180
180
  if (newBillingKey === 'yearly') {
181
- yearlyButton.className = cn('min-w-[120px] px-6 py-2 font-medium transition text-lg relative', 'text-white bg-gradient-to-r from-purple-400 to-pink-500 hover:from-purple-500 hover:to-pink-600 dark:from-purple-500 dark:to-pink-600 dark:hover:from-purple-600 rounded-full shadow-sm');
181
+ yearlyButton.className = cn('min-w-[120px] px-6 py-2 font-medium transition text-lg relative', 'text-white bg-linear-to-r from-purple-400 to-pink-500 hover:from-purple-500 hover:to-pink-600 dark:from-purple-500 dark:to-pink-600 dark:hover:from-purple-600 rounded-full shadow-sm');
182
182
  }
183
183
  else {
184
184
  yearlyButton.className = cn('min-w-[120px] px-6 py-2 font-medium transition text-lg relative', 'text-gray-800 dark:text-gray-200 hover:text-gray-900 dark:hover:text-gray-100 rounded-full');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@windrun-huaiin/third-ui",
3
- "version": "11.0.1",
3
+ "version": "11.0.3",
4
4
  "description": "Third-party integrated UI components for windrun-huaiin projects",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -1,5 +1,6 @@
1
1
  'use client';
2
2
 
3
+ import { useState } from 'react';
3
4
  import { ClerkLoaded, ClerkLoading, SignedIn, SignedOut, SignInButton, UserButton } from "@clerk/nextjs";
4
5
  import { globalLucideIcons as icons } from '@windrun-huaiin/base-ui/components/server';
5
6
  import { SignUpButtonWithFingerprint } from './signup-button-with-fingerprint-client';
@@ -7,6 +8,8 @@ import { SignUpButtonWithFingerprint } from './signup-button-with-fingerprint-cl
7
8
  interface ClerkUserData {
8
9
  signIn: string;
9
10
  signUp: string;
11
+ signUpBonus?: string;
12
+ signUpBonusTooltip?: string;
10
13
  terms: string;
11
14
  privacy: string;
12
15
  locale: string;
@@ -15,6 +18,8 @@ interface ClerkUserData {
15
18
  }
16
19
 
17
20
  export function ClerkUserClient({ data }: { data: ClerkUserData }) {
21
+ const [showTooltip, setShowTooltip] = useState(false);
22
+
18
23
  return (
19
24
  <div className="flex items-center gap-2 h-10 mr-3 sm:mr-2">
20
25
  <ClerkLoading>
@@ -22,12 +27,32 @@ export function ClerkUserClient({ data }: { data: ClerkUserData }) {
22
27
  </ClerkLoading>
23
28
  <ClerkLoaded>
24
29
  <SignedOut>
30
+ {data.showSignUp && (
31
+ <div className="relative inline-flex z-10">
32
+ <SignUpButtonWithFingerprint mode={data.clerkAuthInModal ? 'modal' : 'redirect'} signUp={data.signUp}/>
33
+ {data.signUpBonus && (
34
+ <>
35
+ <span
36
+ onMouseEnter={() => setShowTooltip(true)}
37
+ onMouseLeave={() => setShowTooltip(false)}
38
+ 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 bg-linear-to-r from-purple-400 to-pink-500 dark:from-purple-500 dark:to-pink-600 px-1 sm:px-1.5 text-[9px] sm:text-[10px] font-bold text-white shadow-lg shadow-purple-500/30 ring-1 sm:ring-2 ring-white/80 dark:ring-white/10 cursor-default"
39
+ >
40
+ {data.signUpBonus}
41
+ </span>
42
+ {showTooltip && data.signUpBonusTooltip && (
43
+ <div className="absolute left-1/2 -translate-x-1/2 -translate-y-full -top-1.5 whitespace-nowrap rounded-lg bg-linear-to-r from-purple-500 to-pink-500 dark:from-purple-500 dark:to-pink-600 border border-white/30 dark:border-white/10 px-3 py-1.5 text-xs font-medium text-white shadow-lg shadow-purple-500/30 pointer-events-none">
44
+ {data.signUpBonusTooltip}
45
+ </div>
46
+ )}
47
+ </>
48
+ )}
49
+ </div>
50
+ )}
25
51
  <SignInButton mode={data.clerkAuthInModal ? 'modal' : 'redirect'}>
26
- <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">
52
+ <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">
27
53
  {data.signIn}
28
54
  </button>
29
55
  </SignInButton>
30
- {data.showSignUp && ( <SignUpButtonWithFingerprint mode={data.clerkAuthInModal ? 'modal' : 'redirect'} signUp={data.signUp}/> )}
31
56
  </SignedOut>
32
57
  <SignedIn>
33
58
  <UserButton
@@ -56,4 +81,4 @@ export function ClerkUserClient({ data }: { data: ClerkUserData }) {
56
81
  </ClerkLoaded>
57
82
  </div>
58
83
  );
59
- }
84
+ }
@@ -11,6 +11,8 @@ interface ClerkUserProps {
11
11
  interface ClerkUserData {
12
12
  signIn: string;
13
13
  signUp: string;
14
+ signUpBonus: string;
15
+ signUpBonusTooltip: string;
14
16
  terms: string;
15
17
  privacy: string;
16
18
  locale: string;
@@ -29,6 +31,8 @@ export async function ClerkUser({
29
31
  const data: ClerkUserData = {
30
32
  signIn: t('signIn'),
31
33
  signUp: t('signUp'),
34
+ signUpBonus: t('signUpBonus'),
35
+ signUpBonusTooltip: t('signUpBonusTooltip'),
32
36
  terms: t2('terms'),
33
37
  privacy: t2('privacy'),
34
38
  locale,
@@ -23,7 +23,7 @@ export async function FumaBannerSuit({
23
23
  height={heightValue}
24
24
  floating={floating}
25
25
  >
26
- <p className="text-xl">{bannerText}</p>
26
+ <p className="text-sm sm:text-xl md:text-xl">{bannerText}</p>
27
27
  </Banner>
28
28
  ) : (
29
29
  <div
@@ -124,7 +124,7 @@ export function GradientButton({
124
124
  : 'justify-start';
125
125
 
126
126
  const buttonClassName = cn(
127
- 'bg-gradient-to-r from-purple-400 to-pink-500 hover:from-purple-500 hover:to-pink-600 dark:from-purple-500 dark:to-pink-600 dark:hover:from-purple-600 dark:hover:to-pink-700 text-white text-base font-bold shadow-lg hover:shadow-xl transition-all duration-300 rounded-full',
127
+ 'bg-linear-to-r from-purple-400 to-pink-500 hover:from-purple-500 hover:to-pink-600 dark:from-purple-500 dark:to-pink-600 dark:hover:from-purple-600 dark:hover:to-pink-700 text-white text-base font-bold shadow-lg hover:shadow-xl transition-all duration-300 rounded-full',
128
128
  alignmentClass,
129
129
  isDisabled && 'opacity-50 cursor-not-allowed',
130
130
  className,
@@ -400,7 +400,7 @@ export function MoneyPriceInteractive({
400
400
  {billingOptions.map(option => {
401
401
  const isActive = option.key === billingType;
402
402
  const buttonClasses = isActive
403
- ? 'text-white bg-gradient-to-r from-purple-400 to-pink-500 hover:from-purple-500 hover:to-pink-600 dark:from-purple-500 dark:to-pink-600 dark:hover:from-purple-600 rounded-full shadow-sm'
403
+ ? 'text-white bg-linear-to-r from-purple-400 to-pink-500 hover:from-purple-500 hover:to-pink-600 dark:from-purple-500 dark:to-pink-600 dark:hover:from-purple-600 rounded-full shadow-sm'
404
404
  : 'text-gray-800 dark:text-gray-200 hover:text-gray-900 dark:hover:text-gray-100 rounded-full';
405
405
  const showBadge = option.key === billingType && !!discountBadgeText;
406
406
 
@@ -221,7 +221,7 @@ export function PricePlanInteractive({ data }: { data: PricePlanData }) {
221
221
  if (newBillingKey === 'monthly') {
222
222
  monthlyButton.className = cn(
223
223
  'min-w-[120px] px-6 py-2 font-medium transition text-lg relative',
224
- 'text-white bg-gradient-to-r from-purple-400 to-pink-500 hover:from-purple-500 hover:to-pink-600 dark:from-purple-500 dark:to-pink-600 dark:hover:from-purple-600 rounded-full shadow-sm'
224
+ 'text-white bg-linear-to-r from-purple-400 to-pink-500 hover:from-purple-500 hover:to-pink-600 dark:from-purple-500 dark:to-pink-600 dark:hover:from-purple-600 rounded-full shadow-sm'
225
225
  );
226
226
  } else {
227
227
  monthlyButton.className = cn(
@@ -235,7 +235,7 @@ export function PricePlanInteractive({ data }: { data: PricePlanData }) {
235
235
  if (newBillingKey === 'yearly') {
236
236
  yearlyButton.className = cn(
237
237
  'min-w-[120px] px-6 py-2 font-medium transition text-lg relative',
238
- 'text-white bg-gradient-to-r from-purple-400 to-pink-500 hover:from-purple-500 hover:to-pink-600 dark:from-purple-500 dark:to-pink-600 dark:hover:from-purple-600 rounded-full shadow-sm'
238
+ 'text-white bg-linear-to-r from-purple-400 to-pink-500 hover:from-purple-500 hover:to-pink-600 dark:from-purple-500 dark:to-pink-600 dark:hover:from-purple-600 rounded-full shadow-sm'
239
239
  );
240
240
  } else {
241
241
  yearlyButton.className = cn(