@windrun-huaiin/third-ui 29.0.3 → 29.0.4
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.
|
@@ -16,6 +16,7 @@ var button = require('fumadocs-ui/components/ui/button');
|
|
|
16
16
|
var i18n = require('fumadocs-ui/contexts/i18n');
|
|
17
17
|
var headerThemeSwitch = require('./header-theme-switch.js');
|
|
18
18
|
|
|
19
|
+
const PrefetchLinkItem = shared.LinkItem;
|
|
19
20
|
const DEFAULT_DESKTOP_ACTIONS = [
|
|
20
21
|
'search',
|
|
21
22
|
'theme',
|
|
@@ -163,7 +164,7 @@ const navItemVariants = classVarianceAuthority.cva('[&_svg]:size-4', {
|
|
|
163
164
|
},
|
|
164
165
|
});
|
|
165
166
|
function NavbarLinkItem(_a) {
|
|
166
|
-
var _b;
|
|
167
|
+
var _b, _c;
|
|
167
168
|
var { item } = _a, props = tslib.__rest(_a, ["item"]);
|
|
168
169
|
if (item.type === 'custom')
|
|
169
170
|
return jsxRuntime.jsx("div", Object.assign({}, props, { children: item.children }));
|
|
@@ -179,11 +180,11 @@ function NavbarLinkItem(_a) {
|
|
|
179
180
|
});
|
|
180
181
|
return (jsxRuntime.jsxs(navigationMenu.NavigationMenuItem, { children: [jsxRuntime.jsx(navigationMenu.NavigationMenuTrigger, Object.assign({}, props, { className: utils.cn(navItemVariants(), 'rounded-md', props.className), children: item.url ? (jsxRuntime.jsx(Link, { href: item.url, prefetch: (_b = item.prefetch) !== null && _b !== void 0 ? _b : false, external: item.external, children: item.text })) : (item.text) })), jsxRuntime.jsx(navigationMenu.NavigationMenuContent, { className: "grid grid-cols-1 gap-2 p-4 md:grid-cols-2 lg:grid-cols-3", children: children })] }));
|
|
181
182
|
}
|
|
182
|
-
return (jsxRuntime.jsx(navigationMenu.NavigationMenuItem, { children: jsxRuntime.jsx(navigationMenu.NavigationMenuLink, { asChild: true, children: jsxRuntime.jsx(
|
|
183
|
+
return (jsxRuntime.jsx(navigationMenu.NavigationMenuItem, { children: jsxRuntime.jsx(navigationMenu.NavigationMenuLink, { asChild: true, children: jsxRuntime.jsx(PrefetchLinkItem, Object.assign({ item: item, prefetch: (_c = item.prefetch) !== null && _c !== void 0 ? _c : false, "aria-label": item.type === 'icon' ? item.label : undefined }, props, { className: utils.cn(navItemVariants({ variant: item.type }), props.className), children: item.type === 'icon' ? item.icon : item.text })) }) }));
|
|
183
184
|
}
|
|
184
185
|
const Menu = navigationMenu.NavigationMenuItem;
|
|
185
186
|
function MenuLinkItem(_a) {
|
|
186
|
-
var _b, _c;
|
|
187
|
+
var _b, _c, _d;
|
|
187
188
|
var { item } = _a, props = tslib.__rest(_a, ["item"]);
|
|
188
189
|
if (item.type === 'custom')
|
|
189
190
|
return jsxRuntime.jsx("div", { className: utils.cn('grid', props.className), children: item.children });
|
|
@@ -191,7 +192,7 @@ function MenuLinkItem(_a) {
|
|
|
191
192
|
const header = (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [item.icon, item.text] }));
|
|
192
193
|
return (jsxRuntime.jsxs("div", { className: utils.cn('mb-4 flex flex-col', props.className), children: [jsxRuntime.jsx("p", { className: "mb-1 text-sm text-fd-muted-foreground", children: item.url ? (jsxRuntime.jsx(navigationMenu.NavigationMenuLink, { asChild: true, children: jsxRuntime.jsx(Link, { href: item.url, prefetch: (_b = item.prefetch) !== null && _b !== void 0 ? _b : false, external: item.external, children: header }) })) : (header) }), item.items.map((child, i) => (jsxRuntime.jsx(MenuLinkItem, { item: child }, i)))] }));
|
|
193
194
|
}
|
|
194
|
-
return (jsxRuntime.jsx(navigationMenu.NavigationMenuLink, { asChild: true, children: jsxRuntime.jsxs(
|
|
195
|
+
return (jsxRuntime.jsx(navigationMenu.NavigationMenuLink, { asChild: true, children: jsxRuntime.jsxs(PrefetchLinkItem, { item: item, prefetch: (_c = item.prefetch) !== null && _c !== void 0 ? _c : false, className: utils.cn({
|
|
195
196
|
main: 'inline-flex items-center gap-2 py-1.5 transition-colors hover:text-fd-popover-foreground/50 data-[active=true]:font-medium data-[active=true]:text-fd-primary [&_svg]:size-4',
|
|
196
197
|
icon: button.buttonVariants({
|
|
197
198
|
size: 'icon',
|
|
@@ -201,7 +202,7 @@ function MenuLinkItem(_a) {
|
|
|
201
202
|
color: 'secondary',
|
|
202
203
|
className: 'gap-1.5 [&_svg]:size-4',
|
|
203
204
|
}),
|
|
204
|
-
}[(
|
|
205
|
+
}[(_d = item.type) !== null && _d !== void 0 ? _d : 'main'], props.className), "aria-label": item.type === 'icon' ? item.label : undefined, children: [item.icon, item.type === 'icon' ? undefined : item.text] }) }));
|
|
205
206
|
}
|
|
206
207
|
function MenuTrigger(_a) {
|
|
207
208
|
var { enableHover = false } = _a, props = tslib.__rest(_a, ["enableHover"]);
|
|
@@ -14,6 +14,7 @@ import { buttonVariants } from 'fumadocs-ui/components/ui/button';
|
|
|
14
14
|
import { useI18n } from 'fumadocs-ui/contexts/i18n';
|
|
15
15
|
import { HeaderThemeSwitch } from './header-theme-switch.mjs';
|
|
16
16
|
|
|
17
|
+
const PrefetchLinkItem = LinkItem;
|
|
17
18
|
const DEFAULT_DESKTOP_ACTIONS = [
|
|
18
19
|
'search',
|
|
19
20
|
'theme',
|
|
@@ -161,7 +162,7 @@ const navItemVariants = cva('[&_svg]:size-4', {
|
|
|
161
162
|
},
|
|
162
163
|
});
|
|
163
164
|
function NavbarLinkItem(_a) {
|
|
164
|
-
var _b;
|
|
165
|
+
var _b, _c;
|
|
165
166
|
var { item } = _a, props = __rest(_a, ["item"]);
|
|
166
167
|
if (item.type === 'custom')
|
|
167
168
|
return jsx("div", Object.assign({}, props, { children: item.children }));
|
|
@@ -177,11 +178,11 @@ function NavbarLinkItem(_a) {
|
|
|
177
178
|
});
|
|
178
179
|
return (jsxs(NavigationMenuItem, { children: [jsx(NavigationMenuTrigger, Object.assign({}, props, { className: cn(navItemVariants(), 'rounded-md', props.className), children: item.url ? (jsx(Link, { href: item.url, prefetch: (_b = item.prefetch) !== null && _b !== void 0 ? _b : false, external: item.external, children: item.text })) : (item.text) })), jsx(NavigationMenuContent, { className: "grid grid-cols-1 gap-2 p-4 md:grid-cols-2 lg:grid-cols-3", children: children })] }));
|
|
179
180
|
}
|
|
180
|
-
return (jsx(NavigationMenuItem, { children: jsx(NavigationMenuLink, { asChild: true, children: jsx(
|
|
181
|
+
return (jsx(NavigationMenuItem, { children: jsx(NavigationMenuLink, { asChild: true, children: jsx(PrefetchLinkItem, Object.assign({ item: item, prefetch: (_c = item.prefetch) !== null && _c !== void 0 ? _c : false, "aria-label": item.type === 'icon' ? item.label : undefined }, props, { className: cn(navItemVariants({ variant: item.type }), props.className), children: item.type === 'icon' ? item.icon : item.text })) }) }));
|
|
181
182
|
}
|
|
182
183
|
const Menu = NavigationMenuItem;
|
|
183
184
|
function MenuLinkItem(_a) {
|
|
184
|
-
var _b, _c;
|
|
185
|
+
var _b, _c, _d;
|
|
185
186
|
var { item } = _a, props = __rest(_a, ["item"]);
|
|
186
187
|
if (item.type === 'custom')
|
|
187
188
|
return jsx("div", { className: cn('grid', props.className), children: item.children });
|
|
@@ -189,7 +190,7 @@ function MenuLinkItem(_a) {
|
|
|
189
190
|
const header = (jsxs(Fragment, { children: [item.icon, item.text] }));
|
|
190
191
|
return (jsxs("div", { className: cn('mb-4 flex flex-col', props.className), children: [jsx("p", { className: "mb-1 text-sm text-fd-muted-foreground", children: item.url ? (jsx(NavigationMenuLink, { asChild: true, children: jsx(Link, { href: item.url, prefetch: (_b = item.prefetch) !== null && _b !== void 0 ? _b : false, external: item.external, children: header }) })) : (header) }), item.items.map((child, i) => (jsx(MenuLinkItem, { item: child }, i)))] }));
|
|
191
192
|
}
|
|
192
|
-
return (jsx(NavigationMenuLink, { asChild: true, children: jsxs(
|
|
193
|
+
return (jsx(NavigationMenuLink, { asChild: true, children: jsxs(PrefetchLinkItem, { item: item, prefetch: (_c = item.prefetch) !== null && _c !== void 0 ? _c : false, className: cn({
|
|
193
194
|
main: 'inline-flex items-center gap-2 py-1.5 transition-colors hover:text-fd-popover-foreground/50 data-[active=true]:font-medium data-[active=true]:text-fd-primary [&_svg]:size-4',
|
|
194
195
|
icon: buttonVariants({
|
|
195
196
|
size: 'icon',
|
|
@@ -199,7 +200,7 @@ function MenuLinkItem(_a) {
|
|
|
199
200
|
color: 'secondary',
|
|
200
201
|
className: 'gap-1.5 [&_svg]:size-4',
|
|
201
202
|
}),
|
|
202
|
-
}[(
|
|
203
|
+
}[(_d = item.type) !== null && _d !== void 0 ? _d : 'main'], props.className), "aria-label": item.type === 'icon' ? item.label : undefined, children: [item.icon, item.type === 'icon' ? undefined : item.text] }) }));
|
|
203
204
|
}
|
|
204
205
|
function MenuTrigger(_a) {
|
|
205
206
|
var { enableHover = false } = _a, props = __rest(_a, ["enableHover"]);
|
package/dist/main/footer.js
CHANGED
|
@@ -23,7 +23,7 @@ function Footer(_a) {
|
|
|
23
23
|
clickToCopyText: tIntl.safeT(tFooter, 'clickToCopy', 'Click to copy'),
|
|
24
24
|
copiedText: tIntl.safeT(tFooter, 'copied', 'Copied!'),
|
|
25
25
|
};
|
|
26
|
-
return (jsxRuntime.jsxs("div", { className: "mb-10 w-full mx-auto", children: [jsxRuntime.jsx("div", { className: utils.cn("w-full border-current border-t", lib.themeIconColor) }), jsxRuntime.jsx("footer", { children: jsxRuntime.jsxs("div", { className: "w-full flex flex-col items-center justify-center px-4 py-8 space-y-3", children: [jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center justify-center gap-x-2 gap-y-2 text-xs sm:text-sm sm:gap-x-6", children: [jsxRuntime.jsxs(Link, { href: utils.getAsNeededLocalizedUrl(locale, "/legal/terms", localePrefixAsNeeded, defaultLocale), className: "flex items-center space-x-1 hover:underline", children: [jsxRuntime.jsx(icons.ReceiptTextIcon, { className: "h-3.5 w-3.5" }), jsxRuntime.jsx("span", { children: data.terms })] }), jsxRuntime.jsxs(Link, { href: utils.getAsNeededLocalizedUrl(locale, "/legal/privacy", localePrefixAsNeeded, defaultLocale), className: "flex items-center space-x-1 hover:underline", children: [jsxRuntime.jsx(icons.ShieldUserIcon, { className: "h-3.5 w-3.5" }), jsxRuntime.jsx("span", { children: data.privacy })] }), jsxRuntime.jsxs(footerEmail.FooterEmail, { email: data.email, clickToCopyText: data.clickToCopyText, copiedText: data.copiedText, children: [jsxRuntime.jsx(icons.MailIcon, { className: "h-3.5 w-3.5" }), jsxRuntime.jsx("span", { children: data.contactUs })] })] }), jsxRuntime.jsx("div", { className: "text-xs sm:text-sm text-center", children: jsxRuntime.jsx("span", { children: data.copyright }) })] }) })] }));
|
|
26
|
+
return (jsxRuntime.jsxs("div", { className: "mb-10 w-full mx-auto", children: [jsxRuntime.jsx("div", { className: utils.cn("w-full border-current border-t", lib.themeIconColor) }), jsxRuntime.jsx("footer", { children: jsxRuntime.jsxs("div", { className: "w-full flex flex-col items-center justify-center px-4 py-8 space-y-3", children: [jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center justify-center gap-x-2 gap-y-2 text-xs sm:text-sm sm:gap-x-6", children: [jsxRuntime.jsxs(Link, { prefetch: false, href: utils.getAsNeededLocalizedUrl(locale, "/legal/terms", localePrefixAsNeeded, defaultLocale), className: "flex items-center space-x-1 hover:underline", children: [jsxRuntime.jsx(icons.ReceiptTextIcon, { className: "h-3.5 w-3.5" }), jsxRuntime.jsx("span", { children: data.terms })] }), jsxRuntime.jsxs(Link, { prefetch: false, href: utils.getAsNeededLocalizedUrl(locale, "/legal/privacy", localePrefixAsNeeded, defaultLocale), className: "flex items-center space-x-1 hover:underline", children: [jsxRuntime.jsx(icons.ShieldUserIcon, { className: "h-3.5 w-3.5" }), jsxRuntime.jsx("span", { children: data.privacy })] }), jsxRuntime.jsxs(footerEmail.FooterEmail, { email: data.email, clickToCopyText: data.clickToCopyText, copiedText: data.copiedText, children: [jsxRuntime.jsx(icons.MailIcon, { className: "h-3.5 w-3.5" }), jsxRuntime.jsx("span", { children: data.contactUs })] })] }), jsxRuntime.jsx("div", { className: "text-xs sm:text-sm text-center", children: jsxRuntime.jsx("span", { children: data.copyright }) })] }) })] }));
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
29
|
|
package/dist/main/footer.mjs
CHANGED
|
@@ -21,7 +21,7 @@ function Footer(_a) {
|
|
|
21
21
|
clickToCopyText: safeT(tFooter, 'clickToCopy', 'Click to copy'),
|
|
22
22
|
copiedText: safeT(tFooter, 'copied', 'Copied!'),
|
|
23
23
|
};
|
|
24
|
-
return (jsxs("div", { className: "mb-10 w-full mx-auto", children: [jsx("div", { className: cn("w-full border-current border-t", themeIconColor) }), jsx("footer", { children: jsxs("div", { className: "w-full flex flex-col items-center justify-center px-4 py-8 space-y-3", children: [jsxs("div", { className: "flex flex-wrap items-center justify-center gap-x-2 gap-y-2 text-xs sm:text-sm sm:gap-x-6", children: [jsxs(Link, { href: getAsNeededLocalizedUrl(locale, "/legal/terms", localePrefixAsNeeded, defaultLocale), className: "flex items-center space-x-1 hover:underline", children: [jsx(ReceiptTextIcon, { className: "h-3.5 w-3.5" }), jsx("span", { children: data.terms })] }), jsxs(Link, { href: getAsNeededLocalizedUrl(locale, "/legal/privacy", localePrefixAsNeeded, defaultLocale), className: "flex items-center space-x-1 hover:underline", children: [jsx(ShieldUserIcon, { className: "h-3.5 w-3.5" }), jsx("span", { children: data.privacy })] }), jsxs(FooterEmail, { email: data.email, clickToCopyText: data.clickToCopyText, copiedText: data.copiedText, children: [jsx(MailIcon, { className: "h-3.5 w-3.5" }), jsx("span", { children: data.contactUs })] })] }), jsx("div", { className: "text-xs sm:text-sm text-center", children: jsx("span", { children: data.copyright }) })] }) })] }));
|
|
24
|
+
return (jsxs("div", { className: "mb-10 w-full mx-auto", children: [jsx("div", { className: cn("w-full border-current border-t", themeIconColor) }), jsx("footer", { children: jsxs("div", { className: "w-full flex flex-col items-center justify-center px-4 py-8 space-y-3", children: [jsxs("div", { className: "flex flex-wrap items-center justify-center gap-x-2 gap-y-2 text-xs sm:text-sm sm:gap-x-6", children: [jsxs(Link, { prefetch: false, href: getAsNeededLocalizedUrl(locale, "/legal/terms", localePrefixAsNeeded, defaultLocale), className: "flex items-center space-x-1 hover:underline", children: [jsx(ReceiptTextIcon, { className: "h-3.5 w-3.5" }), jsx("span", { children: data.terms })] }), jsxs(Link, { prefetch: false, href: getAsNeededLocalizedUrl(locale, "/legal/privacy", localePrefixAsNeeded, defaultLocale), className: "flex items-center space-x-1 hover:underline", children: [jsx(ShieldUserIcon, { className: "h-3.5 w-3.5" }), jsx("span", { children: data.privacy })] }), jsxs(FooterEmail, { email: data.email, clickToCopyText: data.clickToCopyText, copiedText: data.copiedText, children: [jsx(MailIcon, { className: "h-3.5 w-3.5" }), jsx("span", { children: data.contactUs })] })] }), jsx("div", { className: "text-xs sm:text-sm text-center", children: jsx("span", { children: data.copyright }) })] }) })] }));
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
27
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@windrun-huaiin/third-ui",
|
|
3
|
-
"version": "29.0.
|
|
3
|
+
"version": "29.0.4",
|
|
4
4
|
"description": "Third-party integrated UI components for windrun-huaiin projects",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./clerk": {
|
|
@@ -228,8 +228,8 @@
|
|
|
228
228
|
"unified": "^11.0.5",
|
|
229
229
|
"zod": "^4.3.6",
|
|
230
230
|
"@windrun-huaiin/base-ui": "^29.0.1",
|
|
231
|
-
"@windrun-huaiin/
|
|
232
|
-
"@windrun-huaiin/
|
|
231
|
+
"@windrun-huaiin/contracts": "^29.0.0",
|
|
232
|
+
"@windrun-huaiin/lib": "^29.0.0"
|
|
233
233
|
},
|
|
234
234
|
"peerDependencies": {
|
|
235
235
|
"clsx": "^2.1.1",
|
|
@@ -43,6 +43,10 @@ export type NavbarCSSVars = CSSProperties & {
|
|
|
43
43
|
'--fd-nav-max-width'?: string;
|
|
44
44
|
};
|
|
45
45
|
|
|
46
|
+
const PrefetchLinkItem = LinkItem as (
|
|
47
|
+
props: ComponentProps<typeof LinkItem> & { prefetch?: boolean },
|
|
48
|
+
) => ReactNode;
|
|
49
|
+
|
|
46
50
|
export interface CustomHomeHeaderProps extends HomeLayoutProps {
|
|
47
51
|
/**
|
|
48
52
|
* Banner height in rem units
|
|
@@ -527,8 +531,9 @@ function NavbarLinkItem({
|
|
|
527
531
|
return (
|
|
528
532
|
<NavigationMenuItem>
|
|
529
533
|
<NavigationMenuLink asChild>
|
|
530
|
-
<
|
|
534
|
+
<PrefetchLinkItem
|
|
531
535
|
item={item}
|
|
536
|
+
prefetch={item.prefetch ?? false}
|
|
532
537
|
aria-label={item.type === 'icon' ? item.label : undefined}
|
|
533
538
|
{...props}
|
|
534
539
|
className={cn(
|
|
@@ -537,7 +542,7 @@ function NavbarLinkItem({
|
|
|
537
542
|
)}
|
|
538
543
|
>
|
|
539
544
|
{item.type === 'icon' ? item.icon : item.text}
|
|
540
|
-
</
|
|
545
|
+
</PrefetchLinkItem>
|
|
541
546
|
</NavigationMenuLink>
|
|
542
547
|
</NavigationMenuItem>
|
|
543
548
|
);
|
|
@@ -585,8 +590,9 @@ function MenuLinkItem({
|
|
|
585
590
|
|
|
586
591
|
return (
|
|
587
592
|
<NavigationMenuLink asChild>
|
|
588
|
-
<
|
|
593
|
+
<PrefetchLinkItem
|
|
589
594
|
item={item}
|
|
595
|
+
prefetch={item.prefetch ?? false}
|
|
590
596
|
className={cn(
|
|
591
597
|
{
|
|
592
598
|
main: 'inline-flex items-center gap-2 py-1.5 transition-colors hover:text-fd-popover-foreground/50 data-[active=true]:font-medium data-[active=true]:text-fd-primary [&_svg]:size-4',
|
|
@@ -605,7 +611,7 @@ function MenuLinkItem({
|
|
|
605
611
|
>
|
|
606
612
|
{item.icon}
|
|
607
613
|
{item.type === 'icon' ? undefined : item.text}
|
|
608
|
-
</
|
|
614
|
+
</PrefetchLinkItem>
|
|
609
615
|
</NavigationMenuLink>
|
|
610
616
|
);
|
|
611
617
|
}
|
package/src/main/footer.tsx
CHANGED
|
@@ -45,11 +45,11 @@ export async function Footer({ locale, localePrefixAsNeeded = true, defaultLocal
|
|
|
45
45
|
<footer>
|
|
46
46
|
<div className="w-full flex flex-col items-center justify-center px-4 py-8 space-y-3">
|
|
47
47
|
<div className="flex flex-wrap items-center justify-center gap-x-2 gap-y-2 text-xs sm:text-sm sm:gap-x-6">
|
|
48
|
-
<Link href={getAsNeededLocalizedUrl(locale, "/legal/terms", localePrefixAsNeeded, defaultLocale)} className="flex items-center space-x-1 hover:underline">
|
|
48
|
+
<Link prefetch={false} href={getAsNeededLocalizedUrl(locale, "/legal/terms", localePrefixAsNeeded, defaultLocale)} className="flex items-center space-x-1 hover:underline">
|
|
49
49
|
<ReceiptTextIcon className="h-3.5 w-3.5"/>
|
|
50
50
|
<span>{data.terms}</span>
|
|
51
51
|
</Link>
|
|
52
|
-
<Link href={getAsNeededLocalizedUrl(locale, "/legal/privacy", localePrefixAsNeeded, defaultLocale)} className="flex items-center space-x-1 hover:underline">
|
|
52
|
+
<Link prefetch={false} href={getAsNeededLocalizedUrl(locale, "/legal/privacy", localePrefixAsNeeded, defaultLocale)} className="flex items-center space-x-1 hover:underline">
|
|
53
53
|
<ShieldUserIcon className="h-3.5 w-3.5"/>
|
|
54
54
|
<span>{data.privacy}</span>
|
|
55
55
|
</Link>
|