@windrun-huaiin/third-ui 11.0.7 → 11.0.8
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.
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
|
|
4
4
|
var tslib_es6 = require('../../node_modules/.pnpm/@rollup_plugin-typescript@12.1.4_rollup@4.46.2_tslib@2.8.1_typescript@5.9.3/node_modules/tslib/tslib.es6.js');
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
-
var ui = require('@windrun-huaiin/base-ui/ui');
|
|
7
6
|
var utils = require('@windrun-huaiin/lib/utils');
|
|
8
7
|
var server = require('@windrun-huaiin/base-ui/components/server');
|
|
9
8
|
var Link = require('next/link');
|
|
@@ -76,12 +75,15 @@ function GradientButton({ title, icon, align = 'left', disabled = false, classNa
|
|
|
76
75
|
: align === 'center'
|
|
77
76
|
? 'justify-center'
|
|
78
77
|
: 'justify-start';
|
|
79
|
-
|
|
78
|
+
// Base styles extracted from Button component + size="lg" (h-11 px-8)
|
|
79
|
+
// Removed [&_svg] constraints
|
|
80
|
+
const baseButtonStyles = "inline-flex items-center gap-2 whitespace-nowrap h-11 px-8 ring-offset-background focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50";
|
|
81
|
+
const buttonClassName = utils.cn(baseButtonStyles, '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);
|
|
80
82
|
return (jsxRuntime.jsx("div", { className: `flex flex-row gap-3 ${getAlignmentClass()}`, children: onClick ? (
|
|
81
83
|
// for click
|
|
82
|
-
jsxRuntime.jsx(
|
|
84
|
+
jsxRuntime.jsx("button", { type: "button", className: buttonClassName, onClick: handleClick, disabled: isDisabled, children: buttonContent })) : (
|
|
83
85
|
// for Link
|
|
84
|
-
jsxRuntime.jsx(
|
|
86
|
+
jsxRuntime.jsx(Link, Object.assign({ href: href || "#", className: utils.cn(buttonClassName, "no-underline hover:no-underline") }, (openInNewTab ? { target: "_blank", rel: "noopener noreferrer" } : {}), { onClick: isDisabled ? (e) => e.preventDefault() : undefined, "aria-disabled": isDisabled, children: buttonContent }))) }));
|
|
85
87
|
}
|
|
86
88
|
|
|
87
89
|
exports.GradientButton = GradientButton;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { __awaiter } from '../../node_modules/.pnpm/@rollup_plugin-typescript@12.1.4_rollup@4.46.2_tslib@2.8.1_typescript@5.9.3/node_modules/tslib/tslib.es6.mjs';
|
|
3
3
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
4
|
-
import { Button } from '@windrun-huaiin/base-ui/ui';
|
|
5
4
|
import { cn } from '@windrun-huaiin/lib/utils';
|
|
6
5
|
import { globalLucideIcons } from '@windrun-huaiin/base-ui/components/server';
|
|
7
6
|
import Link from 'next/link';
|
|
@@ -74,12 +73,15 @@ function GradientButton({ title, icon, align = 'left', disabled = false, classNa
|
|
|
74
73
|
: align === 'center'
|
|
75
74
|
? 'justify-center'
|
|
76
75
|
: 'justify-start';
|
|
77
|
-
|
|
76
|
+
// Base styles extracted from Button component + size="lg" (h-11 px-8)
|
|
77
|
+
// Removed [&_svg] constraints
|
|
78
|
+
const baseButtonStyles = "inline-flex items-center gap-2 whitespace-nowrap h-11 px-8 ring-offset-background focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50";
|
|
79
|
+
const buttonClassName = cn(baseButtonStyles, '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
80
|
return (jsx("div", { className: `flex flex-row gap-3 ${getAlignmentClass()}`, children: onClick ? (
|
|
79
81
|
// for click
|
|
80
|
-
jsx(
|
|
82
|
+
jsx("button", { type: "button", className: buttonClassName, onClick: handleClick, disabled: isDisabled, children: buttonContent })) : (
|
|
81
83
|
// for Link
|
|
82
|
-
jsx(
|
|
84
|
+
jsx(Link, Object.assign({ href: href || "#", className: cn(buttonClassName, "no-underline hover:no-underline") }, (openInNewTab ? { target: "_blank", rel: "noopener noreferrer" } : {}), { onClick: isDisabled ? (e) => e.preventDefault() : undefined, "aria-disabled": isDisabled, children: buttonContent }))) }));
|
|
83
85
|
}
|
|
84
86
|
|
|
85
87
|
export { GradientButton };
|
package/package.json
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { Button } from "@windrun-huaiin/base-ui/ui";
|
|
4
3
|
import { cn } from '@windrun-huaiin/lib/utils';
|
|
5
4
|
import { globalLucideIcons as icons } from "@windrun-huaiin/base-ui/components/server";
|
|
6
5
|
import Link from "next/link";
|
|
@@ -128,7 +127,12 @@ export function GradientButton({
|
|
|
128
127
|
? 'justify-center'
|
|
129
128
|
: 'justify-start';
|
|
130
129
|
|
|
130
|
+
// Base styles extracted from Button component + size="lg" (h-11 px-8)
|
|
131
|
+
// Removed [&_svg] constraints
|
|
132
|
+
const baseButtonStyles = "inline-flex items-center gap-2 whitespace-nowrap h-11 px-8 ring-offset-background focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50";
|
|
133
|
+
|
|
131
134
|
const buttonClassName = cn(
|
|
135
|
+
baseButtonStyles,
|
|
132
136
|
'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',
|
|
133
137
|
alignmentClass,
|
|
134
138
|
isDisabled && 'opacity-50 cursor-not-allowed',
|
|
@@ -139,31 +143,25 @@ export function GradientButton({
|
|
|
139
143
|
<div className={`flex flex-row gap-3 ${getAlignmentClass()}`}>
|
|
140
144
|
{onClick ? (
|
|
141
145
|
// for click
|
|
142
|
-
<
|
|
143
|
-
|
|
146
|
+
<button
|
|
147
|
+
type="button"
|
|
144
148
|
className={buttonClassName}
|
|
145
149
|
onClick={handleClick}
|
|
146
150
|
disabled={isDisabled}
|
|
147
151
|
>
|
|
148
152
|
{buttonContent}
|
|
149
|
-
</
|
|
153
|
+
</button>
|
|
150
154
|
) : (
|
|
151
155
|
// for Link
|
|
152
|
-
<
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
156
|
+
<Link
|
|
157
|
+
href={href || "#"}
|
|
158
|
+
className={cn(buttonClassName, "no-underline hover:no-underline")}
|
|
159
|
+
{...(openInNewTab ? { target: "_blank", rel: "noopener noreferrer" } : {})}
|
|
160
|
+
onClick={isDisabled ? (e) => e.preventDefault() : undefined}
|
|
161
|
+
aria-disabled={isDisabled}
|
|
157
162
|
>
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
className="no-underline hover:no-underline"
|
|
161
|
-
{...(openInNewTab ? { target: "_blank", rel: "noopener noreferrer" } : {})}
|
|
162
|
-
onClick={isDisabled ? (e) => e.preventDefault() : undefined}
|
|
163
|
-
>
|
|
164
|
-
{buttonContent}
|
|
165
|
-
</Link>
|
|
166
|
-
</Button>
|
|
163
|
+
{buttonContent}
|
|
164
|
+
</Link>
|
|
167
165
|
)}
|
|
168
166
|
</div>
|
|
169
167
|
);
|