@windrun-huaiin/third-ui 20.1.0 → 22.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/dist/ai/ai-markdown.js +1 -1
- package/dist/ai/ai-markdown.mjs +1 -1
- package/dist/clerk/clerk-page-context-generator.js +3 -2
- package/dist/clerk/clerk-page-context-generator.mjs +3 -2
- package/dist/clerk/clerk-page-generator.d.ts +0 -8
- package/dist/clerk/clerk-page-generator.js +4 -3
- package/dist/clerk/clerk-page-generator.mjs +4 -3
- package/dist/fuma/base/custom-header.d.ts +1 -1
- package/dist/fuma/base/custom-header.js +38 -36
- package/dist/fuma/base/custom-header.mjs +25 -23
- package/dist/fuma/base/custom-home-layout.d.ts +1 -1
- package/dist/fuma/base/custom-home-layout.js +1 -1
- package/dist/fuma/base/custom-home-layout.mjs +1 -1
- package/dist/fuma/base/header-theme-switch.d.ts +5 -0
- package/dist/fuma/base/header-theme-switch.js +42 -0
- package/dist/fuma/base/header-theme-switch.mjs +40 -0
- package/dist/fuma/base/index.d.ts +1 -0
- package/dist/fuma/base/index.js +7 -0
- package/dist/fuma/base/index.mjs +1 -0
- package/dist/fuma/base/site-layout.d.ts +116 -0
- package/dist/fuma/base/site-layout.js +72 -0
- package/dist/fuma/base/site-layout.mjs +65 -0
- package/dist/fuma/fuma-banner-suit.js +9 -6
- package/dist/fuma/fuma-banner-suit.mjs +10 -7
- package/dist/fuma/fuma-page-genarator.d.ts +2 -2
- package/dist/fuma/fuma-page-genarator.js +21 -8
- package/dist/fuma/fuma-page-genarator.mjs +21 -8
- package/dist/fuma/heavy/image-grid.d.ts +6 -0
- package/dist/fuma/heavy/image-grid.js +17 -0
- package/dist/fuma/heavy/image-grid.mjs +15 -0
- package/dist/fuma/heavy/image-zoom.d.ts +22 -0
- package/dist/fuma/heavy/image-zoom.js +39 -0
- package/dist/fuma/heavy/image-zoom.mjs +37 -0
- package/dist/fuma/heavy/index.d.ts +4 -0
- package/dist/fuma/heavy/index.js +15 -0
- package/dist/fuma/heavy/index.mjs +5 -0
- package/dist/fuma/heavy/math.d.ts +17 -0
- package/dist/fuma/heavy/math.js +60 -0
- package/dist/fuma/heavy/math.mjs +57 -0
- package/dist/fuma/heavy/mermaid.d.ts +13 -0
- package/dist/fuma/heavy/mermaid.js +360 -0
- package/dist/fuma/heavy/mermaid.mjs +358 -0
- package/dist/fuma/llm-copy-handler.js +3 -2
- package/dist/fuma/llm-copy-handler.mjs +3 -2
- package/dist/fuma/mdx/features.d.ts +8 -0
- package/dist/fuma/mdx/features.js +92 -0
- package/dist/fuma/mdx/features.mjs +85 -0
- package/dist/fuma/mdx/index.d.ts +0 -4
- package/dist/fuma/mdx/index.js +0 -8
- package/dist/fuma/mdx/index.mjs +0 -4
- package/dist/fuma/mdx/markdown-component-map.js +7 -1
- package/dist/fuma/mdx/markdown-component-map.mjs +7 -1
- package/dist/fuma/mdx/math.d.ts +17 -0
- package/dist/fuma/mdx/math.js +60 -0
- package/dist/fuma/mdx/math.mjs +57 -0
- package/dist/fuma/mdx/site-mdx-components.d.ts +13 -0
- package/dist/fuma/mdx/site-mdx-components.js +19 -0
- package/dist/fuma/mdx/site-mdx-components.mjs +17 -0
- package/dist/fuma/mdx/site-mdx-presets.d.ts +13 -0
- package/dist/fuma/mdx/site-mdx-presets.js +49 -0
- package/dist/fuma/mdx/site-mdx-presets.mjs +45 -0
- package/dist/fuma/mdx/toc-clerk-portable.js +9 -5
- package/dist/fuma/mdx/toc-clerk-portable.mjs +8 -4
- package/dist/fuma/mdx/zia-card.js +1 -1
- package/dist/fuma/mdx/zia-card.mjs +1 -1
- package/dist/fuma/mdx/zia-file.js +1 -0
- package/dist/fuma/mdx/zia-file.mjs +1 -0
- package/dist/fuma/server/optional-features.d.ts +8 -0
- package/dist/fuma/server/optional-features.js +111 -0
- package/dist/fuma/server/optional-features.mjs +104 -0
- package/dist/fuma/server/site-mdx-components.d.ts +13 -0
- package/dist/fuma/server/site-mdx-components.js +19 -0
- package/dist/fuma/server/site-mdx-components.mjs +17 -0
- package/dist/fuma/server/site-mdx-presets.d.ts +194 -0
- package/dist/fuma/server/site-mdx-presets.js +46 -0
- package/dist/fuma/server/site-mdx-presets.mjs +42 -0
- package/dist/fuma/share/index.d.ts +1 -0
- package/dist/fuma/share/index.js +7 -0
- package/dist/fuma/share/index.mjs +1 -0
- package/dist/fuma/share/markdown-component-map.d.ts +3 -0
- package/dist/fuma/share/markdown-component-map.js +79 -0
- package/dist/fuma/share/markdown-component-map.mjs +77 -0
- package/dist/lib/fuma-schema-check-util.js +19 -5
- package/dist/lib/fuma-schema-check-util.mjs +19 -5
- package/dist/lib/seo-metadata.d.ts +10 -0
- package/dist/main/x-button.js +2 -2
- package/dist/main/x-button.mjs +2 -2
- package/package.json +31 -8
- package/src/ai/ai-markdown.tsx +1 -1
- package/src/clerk/clerk-page-context-generator.tsx +6 -3
- package/src/clerk/clerk-page-generator.tsx +7 -13
- package/src/fuma/base/custom-header.tsx +32 -35
- package/src/fuma/base/custom-home-layout.tsx +2 -2
- package/src/fuma/base/header-theme-switch.tsx +88 -0
- package/src/fuma/base/index.ts +1 -0
- package/src/fuma/base/site-layout.tsx +289 -0
- package/src/fuma/fuma-banner-suit.tsx +30 -28
- package/src/fuma/fuma-page-genarator.tsx +27 -10
- package/src/fuma/{mdx → heavy}/image-grid.tsx +1 -1
- package/src/fuma/heavy/index.ts +7 -0
- package/src/fuma/heavy/math.tsx +130 -0
- package/src/fuma/llm-copy-handler.ts +3 -3
- package/src/fuma/mdx/index.ts +0 -4
- package/src/fuma/mdx/toc-clerk-portable.tsx +27 -24
- package/src/fuma/mdx/zia-card.tsx +1 -0
- package/src/fuma/mdx/zia-file.tsx +3 -1
- package/src/fuma/server/optional-features.tsx +168 -0
- package/src/fuma/server/site-mdx-components.tsx +48 -0
- package/src/fuma/server/site-mdx-presets.ts +80 -0
- package/src/fuma/share/index.ts +1 -0
- package/src/fuma/{mdx → share}/markdown-component-map.tsx +1 -1
- package/src/lib/fuma-schema-check-util.ts +22 -6
- package/src/lib/seo-metadata.ts +47 -0
- package/src/main/language-detector.tsx +0 -8
- package/src/main/x-button.tsx +2 -2
- package/src/styles/fuma.css +3 -7
- package/src/styles/third-ui.css +0 -4
- package/dist/main/ads-alert-dialog.d.ts +0 -15
- package/dist/main/ads-alert-dialog.js +0 -21
- package/dist/main/ads-alert-dialog.mjs +0 -19
- /package/src/fuma/{mdx → heavy}/image-zoom.tsx +0 -0
- /package/src/fuma/{mdx → heavy}/mermaid.tsx +0 -0
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { z, ZodObject } from 'zod';
|
|
2
|
-
import { frontmatterSchema, metaSchema } from 'fumadocs-mdx/config';
|
|
3
2
|
|
|
4
3
|
// Reusable schema for date
|
|
5
4
|
export const createDateSchema = () =>
|
|
@@ -22,9 +21,27 @@ export const createDateSchema = () =>
|
|
|
22
21
|
.refine((val: any) => !isNaN(new Date(val).getTime()), 'Invalid date!')
|
|
23
22
|
);
|
|
24
23
|
|
|
24
|
+
const baseFrontmatterSchema = z
|
|
25
|
+
.object({
|
|
26
|
+
title: z.string().optional(),
|
|
27
|
+
description: z.string().optional(),
|
|
28
|
+
icon: z.string().optional(),
|
|
29
|
+
})
|
|
30
|
+
.loose();
|
|
31
|
+
|
|
32
|
+
const baseMetaSchema = z
|
|
33
|
+
.object({
|
|
34
|
+
title: z.string().optional(),
|
|
35
|
+
pages: z.array(z.string()).optional(),
|
|
36
|
+
description: z.string().optional(),
|
|
37
|
+
root: z.boolean().optional(),
|
|
38
|
+
defaultOpen: z.boolean().optional(),
|
|
39
|
+
icon: z.string().optional(),
|
|
40
|
+
})
|
|
41
|
+
.loose();
|
|
42
|
+
|
|
25
43
|
// common docs frontmatter schema
|
|
26
|
-
|
|
27
|
-
export const createCommonDocsSchema = (): ZodObject<any> => frontmatterSchema
|
|
44
|
+
export const createCommonDocsSchema = (): ZodObject<any> => baseFrontmatterSchema
|
|
28
45
|
.extend({
|
|
29
46
|
date: createDateSchema(),
|
|
30
47
|
author: z.string().optional(),
|
|
@@ -32,8 +49,7 @@ export const createCommonDocsSchema = (): ZodObject<any> => frontmatterSchema
|
|
|
32
49
|
});
|
|
33
50
|
|
|
34
51
|
// common meta schema
|
|
35
|
-
|
|
36
|
-
export const createCommonMetaSchema = (): ZodObject<any> => metaSchema.extend({
|
|
52
|
+
export const createCommonMetaSchema = (): ZodObject<any> => baseMetaSchema.extend({
|
|
37
53
|
|
|
38
54
|
});
|
|
39
55
|
|
|
@@ -41,4 +57,4 @@ export const remarkInstallOptions = {
|
|
|
41
57
|
persist: {
|
|
42
58
|
id: 'package-manager',
|
|
43
59
|
},
|
|
44
|
-
};
|
|
60
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { Metadata } from 'next';
|
|
2
|
+
import { getTranslations } from 'next-intl/server';
|
|
3
|
+
import { getAsNeededLocalizedUrl } from '@windrun-huaiin/lib';
|
|
4
|
+
|
|
5
|
+
export interface CreateLocalizedSiteMetadataOptions {
|
|
6
|
+
locale: string;
|
|
7
|
+
baseUrl: string;
|
|
8
|
+
locales: readonly string[];
|
|
9
|
+
defaultLocale: string;
|
|
10
|
+
localePrefixAsNeeded: boolean;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export type LocalizedSiteMetadata = Pick<
|
|
14
|
+
Metadata,
|
|
15
|
+
'title' | 'description' | 'keywords' | 'alternates' | 'icons'
|
|
16
|
+
>;
|
|
17
|
+
|
|
18
|
+
const DEFAULT_SITE_ICONS = [
|
|
19
|
+
{ rel: 'icon', type: 'image/png', sizes: '16x16', url: '/favicon-16x16.png' },
|
|
20
|
+
{ rel: 'icon', type: 'image/png', sizes: '32x32', url: '/favicon-32x32.png' },
|
|
21
|
+
{ rel: 'icon', type: 'image/ico', url: '/favicon.ico' },
|
|
22
|
+
{ rel: 'apple-touch-icon', sizes: '180x180', url: '/favicon-180x180.png' },
|
|
23
|
+
{ rel: 'android-chrome', sizes: '512x512', url: '/favicon-512x512.png' },
|
|
24
|
+
];
|
|
25
|
+
|
|
26
|
+
export async function createLocalizedSiteMetadata(
|
|
27
|
+
options: CreateLocalizedSiteMetadataOptions,
|
|
28
|
+
): Promise<LocalizedSiteMetadata> {
|
|
29
|
+
const { baseUrl, defaultLocale, locale, localePrefixAsNeeded, locales } = options;
|
|
30
|
+
const t = await getTranslations({ locale, namespace: 'home' });
|
|
31
|
+
|
|
32
|
+
return {
|
|
33
|
+
title: t('webTitle'),
|
|
34
|
+
description: t('webDescription'),
|
|
35
|
+
keywords: t('keywords'),
|
|
36
|
+
alternates: {
|
|
37
|
+
canonical: `${baseUrl}${getAsNeededLocalizedUrl(locale, '/', localePrefixAsNeeded, defaultLocale)}`,
|
|
38
|
+
languages: Object.fromEntries(
|
|
39
|
+
locales.map((siteLocale) => [
|
|
40
|
+
siteLocale,
|
|
41
|
+
`${baseUrl}${getAsNeededLocalizedUrl(siteLocale, '/', localePrefixAsNeeded, defaultLocale)}`,
|
|
42
|
+
]),
|
|
43
|
+
),
|
|
44
|
+
},
|
|
45
|
+
icons: DEFAULT_SITE_ICONS,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* MIT License
|
|
4
|
-
* Copyright (c) 2026 D8ger
|
|
5
|
-
*
|
|
6
|
-
* This source code is licensed under the MIT license found in the
|
|
7
|
-
* LICENSE file in the root directory of this source tree.
|
|
8
|
-
*/
|
|
9
1
|
'use client'
|
|
10
2
|
|
|
11
3
|
import { XIcon } from "@windrun-huaiin/base-ui/icons"
|
package/src/main/x-button.tsx
CHANGED
|
@@ -197,7 +197,7 @@ export function XButton(props: xButtonProps) {
|
|
|
197
197
|
return (
|
|
198
198
|
<div className={cn(
|
|
199
199
|
"relative flex flex-row items-stretch w-full sm:w-auto rounded-full gap-0",
|
|
200
|
-
menuOpen && "z-
|
|
200
|
+
menuOpen && "z-90",
|
|
201
201
|
variant === 'soft'
|
|
202
202
|
? cn(themeBgColor, themeBorderColor, "border")
|
|
203
203
|
: variant === 'subtle'
|
|
@@ -251,7 +251,7 @@ export function XButton(props: xButtonProps) {
|
|
|
251
251
|
{menuOpen && (
|
|
252
252
|
<div
|
|
253
253
|
ref={menuRef}
|
|
254
|
-
className={`absolute right-0 top-full ${menuWidth} bg-white dark:bg-neutral-800 text-neutral-800 dark:text-white text-sm rounded-xl shadow-lg z-
|
|
254
|
+
className={`absolute right-0 top-full ${menuWidth} bg-white dark:bg-neutral-800 text-neutral-800 dark:text-white text-sm rounded-xl shadow-lg z-100 border border-neutral-200 dark:border-neutral-700 overflow-hidden animate-fade-in`}
|
|
255
255
|
>
|
|
256
256
|
{menuItems.map((item, index) => (
|
|
257
257
|
<button
|
package/src/styles/fuma.css
CHANGED
|
@@ -21,10 +21,6 @@
|
|
|
21
21
|
@apply top-24!;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
/* #nd-subnav {
|
|
25
|
-
top: 20px !important;
|
|
26
|
-
} */
|
|
27
|
-
|
|
28
24
|
#nd-subnav {
|
|
29
25
|
@apply
|
|
30
26
|
relative!
|
|
@@ -62,9 +58,9 @@ button[aria-label="Open Search"][data-search=""] {
|
|
|
62
58
|
|
|
63
59
|
:root {
|
|
64
60
|
--fd-layout-width: 100vw;
|
|
65
|
-
--fd-banner-height: 0px;
|
|
66
|
-
--fd-
|
|
67
|
-
--fd-
|
|
61
|
+
--fd-banner-height: 0px;
|
|
62
|
+
--fd-header-height: 3.5rem;
|
|
63
|
+
--fd-toc-popover-height: 0px;
|
|
68
64
|
}
|
|
69
65
|
|
|
70
66
|
/* fuma image-zoom COPY */
|
package/src/styles/third-ui.css
CHANGED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
interface AdsAlertDialogProps {
|
|
3
|
-
open: boolean;
|
|
4
|
-
onOpenChange: (open: boolean) => void;
|
|
5
|
-
title: React.ReactNode;
|
|
6
|
-
description: React.ReactNode;
|
|
7
|
-
imgSrc?: string;
|
|
8
|
-
imgHref?: string;
|
|
9
|
-
onCancel?: () => void;
|
|
10
|
-
cancelText?: string;
|
|
11
|
-
confirmText?: string;
|
|
12
|
-
onConfirm?: () => void;
|
|
13
|
-
}
|
|
14
|
-
export declare function AdsAlertDialog({ open, onOpenChange, title, description, imgSrc, imgHref, cancelText, onCancel, confirmText, onConfirm, }: AdsAlertDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
-
export {};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
-
var React = require('react');
|
|
6
|
-
var Image = require('next/image');
|
|
7
|
-
var icons = require('@windrun-huaiin/base-ui/icons');
|
|
8
|
-
var ui = require('@windrun-huaiin/base-ui/ui');
|
|
9
|
-
|
|
10
|
-
function AdsAlertDialog({ open, onOpenChange, title, description, imgSrc, imgHref, cancelText, onCancel, confirmText, onConfirm, }) {
|
|
11
|
-
const [imgError, setImgError] = React.useState(false);
|
|
12
|
-
return (jsxRuntime.jsx(ui.AlertDialog, { open: open, onOpenChange: onOpenChange, children: jsxRuntime.jsxs(ui.AlertDialogContent, { className: "fixed left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 bg-white dark:bg-neutral-900 rounded-2xl shadow-2xl border border-neutral-200 dark:border-neutral-700 max-w-md w-full min-w-[320px] p-4 flex flex-col items-stretch", children: [jsxRuntime.jsxs("div", { className: "flex flex-row items-center justify-between mb-2", children: [jsxRuntime.jsx(ui.AlertDialogTitle, { asChild: true, children: jsxRuntime.jsxs("div", { className: "flex flex-row items-center gap-1 min-w-0 text-xl font-semibold", children: [jsxRuntime.jsx(icons.InfoIcon, { className: "w-5 h-5" }), jsxRuntime.jsx("span", { className: "truncate", children: title })] }) }), jsxRuntime.jsx("button", { className: "text-neutral-400 hover:text-neutral-700 dark:hover:text-neutral-200 text-xl ml-4", onClick: () => onOpenChange(false), "aria-label": "Close", tabIndex: 0, children: jsxRuntime.jsx(icons.XIcon, { className: "w-5 h-5" }) })] }), jsxRuntime.jsx(ui.AlertDialogDescription, { className: "text-base font-medium text-neutral-800 dark:text-neutral-100 mb-2", children: description }), imgSrc && (jsxRuntime.jsx("div", { className: "w-full max-w-[400px] h-[220px] relative flex items-center justify-center mb-2", children: imgError ? (jsxRuntime.jsxs("div", { className: "absolute inset-0 flex flex-col items-center justify-center bg-gray-100 dark:bg-neutral-800 border border-dashed border-neutral-300 dark:border-neutral-700 rounded-lg text-neutral-400 text-sm", children: [jsxRuntime.jsx(icons.ImageOffIcon, { className: "w-12 h-12 mb-2" }), jsxRuntime.jsx("span", { children: "Image loading failed" })] })) : imgHref ? (jsxRuntime.jsx("a", { href: imgHref, target: "_blank", rel: "noopener noreferrer", className: "block w-full h-full", children: jsxRuntime.jsx(Image, { src: imgSrc, alt: "image", fill: true, className: "object-contain rounded-lg", priority: false, placeholder: "empty", unoptimized: true, onError: () => setImgError(true), sizes: "(max-width: 400px) 100vw, 400px" }) })) : (jsxRuntime.jsx(Image, { src: imgSrc, alt: "image", fill: true, className: "object-contain rounded-lg", priority: false, placeholder: "empty", unoptimized: true, onError: () => setImgError(true), sizes: "(max-width: 400px) 100vw, 400px" })) })), (cancelText || confirmText) && (jsxRuntime.jsxs("div", { className: "flex justify-end gap-2 mt-2", children: [cancelText && (jsxRuntime.jsx("button", { onClick: () => {
|
|
13
|
-
onOpenChange(false);
|
|
14
|
-
onCancel === null || onCancel === void 0 ? void 0 : onCancel();
|
|
15
|
-
}, className: "px-6 py-2 rounded-lg border border-neutral-300 dark:border-neutral-600 bg-white dark:bg-neutral-800 text-neutral-700 dark:text-neutral-200 font-semibold hover:bg-neutral-100 dark:hover:bg-neutral-700 transition", children: cancelText })), confirmText && (jsxRuntime.jsx(ui.AlertDialogAction, { onClick: () => {
|
|
16
|
-
onOpenChange(false);
|
|
17
|
-
onConfirm === null || onConfirm === void 0 ? void 0 : onConfirm();
|
|
18
|
-
}, className: "px-6 py-2 rounded-lg bg-purple-500 text-white font-semibold hover:bg-purple-600 transition", children: confirmText }))] }))] }) }));
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
exports.AdsAlertDialog = AdsAlertDialog;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
-
import { useState } from 'react';
|
|
4
|
-
import Image from 'next/image';
|
|
5
|
-
import { InfoIcon, XIcon, ImageOffIcon } from '@windrun-huaiin/base-ui/icons';
|
|
6
|
-
import { AlertDialog, AlertDialogContent, AlertDialogTitle, AlertDialogDescription, AlertDialogAction } from '@windrun-huaiin/base-ui/ui';
|
|
7
|
-
|
|
8
|
-
function AdsAlertDialog({ open, onOpenChange, title, description, imgSrc, imgHref, cancelText, onCancel, confirmText, onConfirm, }) {
|
|
9
|
-
const [imgError, setImgError] = useState(false);
|
|
10
|
-
return (jsx(AlertDialog, { open: open, onOpenChange: onOpenChange, children: jsxs(AlertDialogContent, { className: "fixed left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 bg-white dark:bg-neutral-900 rounded-2xl shadow-2xl border border-neutral-200 dark:border-neutral-700 max-w-md w-full min-w-[320px] p-4 flex flex-col items-stretch", children: [jsxs("div", { className: "flex flex-row items-center justify-between mb-2", children: [jsx(AlertDialogTitle, { asChild: true, children: jsxs("div", { className: "flex flex-row items-center gap-1 min-w-0 text-xl font-semibold", children: [jsx(InfoIcon, { className: "w-5 h-5" }), jsx("span", { className: "truncate", children: title })] }) }), jsx("button", { className: "text-neutral-400 hover:text-neutral-700 dark:hover:text-neutral-200 text-xl ml-4", onClick: () => onOpenChange(false), "aria-label": "Close", tabIndex: 0, children: jsx(XIcon, { className: "w-5 h-5" }) })] }), jsx(AlertDialogDescription, { className: "text-base font-medium text-neutral-800 dark:text-neutral-100 mb-2", children: description }), imgSrc && (jsx("div", { className: "w-full max-w-[400px] h-[220px] relative flex items-center justify-center mb-2", children: imgError ? (jsxs("div", { className: "absolute inset-0 flex flex-col items-center justify-center bg-gray-100 dark:bg-neutral-800 border border-dashed border-neutral-300 dark:border-neutral-700 rounded-lg text-neutral-400 text-sm", children: [jsx(ImageOffIcon, { className: "w-12 h-12 mb-2" }), jsx("span", { children: "Image loading failed" })] })) : imgHref ? (jsx("a", { href: imgHref, target: "_blank", rel: "noopener noreferrer", className: "block w-full h-full", children: jsx(Image, { src: imgSrc, alt: "image", fill: true, className: "object-contain rounded-lg", priority: false, placeholder: "empty", unoptimized: true, onError: () => setImgError(true), sizes: "(max-width: 400px) 100vw, 400px" }) })) : (jsx(Image, { src: imgSrc, alt: "image", fill: true, className: "object-contain rounded-lg", priority: false, placeholder: "empty", unoptimized: true, onError: () => setImgError(true), sizes: "(max-width: 400px) 100vw, 400px" })) })), (cancelText || confirmText) && (jsxs("div", { className: "flex justify-end gap-2 mt-2", children: [cancelText && (jsx("button", { onClick: () => {
|
|
11
|
-
onOpenChange(false);
|
|
12
|
-
onCancel === null || onCancel === void 0 ? void 0 : onCancel();
|
|
13
|
-
}, className: "px-6 py-2 rounded-lg border border-neutral-300 dark:border-neutral-600 bg-white dark:bg-neutral-800 text-neutral-700 dark:text-neutral-200 font-semibold hover:bg-neutral-100 dark:hover:bg-neutral-700 transition", children: cancelText })), confirmText && (jsx(AlertDialogAction, { onClick: () => {
|
|
14
|
-
onOpenChange(false);
|
|
15
|
-
onConfirm === null || onConfirm === void 0 ? void 0 : onConfirm();
|
|
16
|
-
}, className: "px-6 py-2 rounded-lg bg-purple-500 text-white font-semibold hover:bg-purple-600 transition", children: confirmText }))] }))] }) }));
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export { AdsAlertDialog };
|
|
File without changes
|
|
File without changes
|