@windrun-huaiin/base-ui 3.2.4 → 3.3.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/dist/components/client/index.d.mts +46 -0
- package/dist/components/client/index.d.ts +46 -0
- package/dist/components/client/index.js +1822 -0
- package/dist/components/client/index.js.map +1 -0
- package/dist/components/client/index.mjs +1866 -0
- package/dist/components/client/index.mjs.map +1 -0
- package/dist/components/index.d.mts +1 -44
- package/dist/components/index.d.ts +1 -44
- package/dist/components/index.js +4 -571
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +3 -564
- package/dist/components/index.mjs.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -318
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -312
- package/dist/index.mjs.map +1 -1
- package/dist/lib/index.js +0 -1
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/index.mjs +0 -1
- package/dist/lib/index.mjs.map +1 -1
- package/dist/ui/index.js +0 -1
- package/dist/ui/index.js.map +1 -1
- package/dist/ui/index.mjs +0 -1
- package/dist/ui/index.mjs.map +1 -1
- package/package.json +11 -5
- package/src/components/404-page.tsx +1 -1
- package/src/components/client/index.ts +15 -0
- package/src/components/global-icon.tsx +1 -1
- package/src/components/index.ts +15 -8
- package/src/index.ts +4 -1
package/dist/components/index.js
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
"use client";
|
2
1
|
"use strict";
|
3
2
|
var __create = Object.create;
|
4
3
|
var __defProp = Object.defineProperty;
|
@@ -61,16 +60,10 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
61
60
|
var components_exports = {};
|
62
61
|
__export(components_exports, {
|
63
62
|
DefaultSiteIcon: () => DefaultSiteIcon,
|
64
|
-
GoogleAnalyticsScript: () => GoogleAnalyticsScript,
|
65
|
-
LanguageDetector: () => LanguageDetector,
|
66
|
-
LanguageSwitcher: () => LanguageSwitcher,
|
67
|
-
MicrosoftClarityScript: () => MicrosoftClarityScript,
|
68
63
|
NotFoundIcon: () => NotFoundIcon,
|
69
|
-
NotFoundPage: () => NotFoundPage,
|
70
64
|
getGlobalIcon: () => getGlobalIcon,
|
71
65
|
getIconElement: () => getIconElement,
|
72
|
-
globalLucideIcons: () => globalLucideIcons
|
73
|
-
useGoogleAnalytics: () => useGoogleAnalytics
|
66
|
+
globalLucideIcons: () => globalLucideIcons
|
74
67
|
});
|
75
68
|
module.exports = __toCommonJS(components_exports);
|
76
69
|
|
@@ -1261,6 +1254,7 @@ var wrappedBuiltinIconsPart = tempWrappedBuiltinIcons;
|
|
1261
1254
|
var globalLucideIcons = __spreadValues(__spreadValues({}, styledLimitedIconsPart), wrappedBuiltinIconsPart);
|
1262
1255
|
var DEFAULT_FALLBACK_ICON = "BTC";
|
1263
1256
|
function getGlobalIcon(iconKey, createElement) {
|
1257
|
+
var _a;
|
1264
1258
|
if (!iconKey) {
|
1265
1259
|
if (createElement) {
|
1266
1260
|
return void 0;
|
@@ -1269,7 +1263,7 @@ function getGlobalIcon(iconKey, createElement) {
|
|
1269
1263
|
}
|
1270
1264
|
const Icon = globalLucideIcons[iconKey];
|
1271
1265
|
if (!Icon) {
|
1272
|
-
if (process.env.NODE_ENV !== "production") {
|
1266
|
+
if (typeof process !== "undefined" && ((_a = process.env) == null ? void 0 : _a.NODE_ENV) !== "production") {
|
1273
1267
|
console.warn(
|
1274
1268
|
`[global-icon] iconKey "${iconKey}" is not defined in globalIcons, will use default "${String(DEFAULT_FALLBACK_ICON)}" icon, please check!`
|
1275
1269
|
);
|
@@ -1290,573 +1284,12 @@ function getIconElement(icon) {
|
|
1290
1284
|
}
|
1291
1285
|
var DefaultSiteIcon = () => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(globalLucideIcons.Zap, { className: `h-8 w-8 rounded-full p-1 shadow-lg ring-0.5 border border-purple-500 ring-purple-500/20 ${themeIconColor}` });
|
1292
1286
|
var NotFoundIcon = () => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(globalLucideIcons.SquareTerminal, { className: `h-8 w-8 rounded-full p-1 shadow-lg ring-0.5 border border-purple-500 ring-purple-500/20 ${themeIconColor}` });
|
1293
|
-
|
1294
|
-
// ../lib/src/utils.ts
|
1295
|
-
var import_clsx = require("clsx");
|
1296
|
-
var import_tailwind_merge = require("tailwind-merge");
|
1297
|
-
function cn(...inputs) {
|
1298
|
-
return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
|
1299
|
-
}
|
1300
|
-
|
1301
|
-
// src/lib/icon-context.tsx
|
1302
|
-
var import_react30 = require("react");
|
1303
|
-
var import_jsx_runtime30 = require("react/jsx-runtime");
|
1304
|
-
var IconConfigContext = (0, import_react30.createContext)(null);
|
1305
|
-
function useIconConfig() {
|
1306
|
-
const config = (0, import_react30.useContext)(IconConfigContext);
|
1307
|
-
if (config === null) {
|
1308
|
-
throw new Error(
|
1309
|
-
'[SiteIcon] IconConfigProvider not found. Please wrap your app with <IconConfigProvider config={{ siteIcon: "YourIcon" }}>.'
|
1310
|
-
);
|
1311
|
-
}
|
1312
|
-
return config;
|
1313
|
-
}
|
1314
|
-
function useIconConfigSafe(iconKey) {
|
1315
|
-
try {
|
1316
|
-
const config = useIconConfig();
|
1317
|
-
return config[iconKey];
|
1318
|
-
} catch (e) {
|
1319
|
-
return void 0;
|
1320
|
-
}
|
1321
|
-
}
|
1322
|
-
|
1323
|
-
// src/lib/site-icon.tsx
|
1324
|
-
var import_jsx_runtime31 = require("react/jsx-runtime");
|
1325
|
-
function SiteIcon(_a) {
|
1326
|
-
var _b = _a, {
|
1327
|
-
size = 24,
|
1328
|
-
className
|
1329
|
-
} = _b, props = __objRest(_b, [
|
1330
|
-
"size",
|
1331
|
-
"className"
|
1332
|
-
]);
|
1333
|
-
const configuredIcon = useIconConfigSafe("siteIcon");
|
1334
|
-
if (configuredIcon === void 0) {
|
1335
|
-
throw new Error(
|
1336
|
-
'[SiteIcon] Site icon is not configured. Please use <IconConfigProvider config={{ siteIcon: YourCustomIcon }}> or <IconConfigProvider config={{ siteIcon: "IconKeyName" }}> to set a custom site icon to avoid legal risks.'
|
1337
|
-
);
|
1338
|
-
}
|
1339
|
-
if (typeof configuredIcon === "string") {
|
1340
|
-
if (configuredIcon === "") {
|
1341
|
-
const DefaultIcon = globalLucideIcons["Download"];
|
1342
|
-
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(DefaultIcon, __spreadValues({ size, className: cn(themeIconColor, className) }, props));
|
1343
|
-
}
|
1344
|
-
const IconComponent = globalLucideIcons[configuredIcon];
|
1345
|
-
if (!IconComponent) {
|
1346
|
-
throw new Error(`[SiteIcon] Icon key "${configuredIcon}" not found in globalLucideIcons.`);
|
1347
|
-
}
|
1348
|
-
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(IconComponent, __spreadValues({ size, className: cn(themeIconColor, className) }, props));
|
1349
|
-
} else {
|
1350
|
-
const CustomIcon = configuredIcon;
|
1351
|
-
const hasColorClass = className && /text-\w+/.test(className);
|
1352
|
-
const finalClassName = hasColorClass ? className : cn(themeIconColor, className);
|
1353
|
-
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(CustomIcon, __spreadValues({ size, className: finalClassName }, props));
|
1354
|
-
}
|
1355
|
-
}
|
1356
|
-
|
1357
|
-
// src/components/404-page.tsx
|
1358
|
-
var import_react31 = require("react");
|
1359
|
-
var import_jsx_runtime32 = require("react/jsx-runtime");
|
1360
|
-
function NotFoundPage() {
|
1361
|
-
const [glitchText, setGlitchText] = (0, import_react31.useState)("404");
|
1362
|
-
(0, import_react31.useEffect)(() => {
|
1363
|
-
const glitchChars = ["4", "0", "4", "?", "#", "!", "*", "&", "%", "$"];
|
1364
|
-
const interval = setInterval(() => {
|
1365
|
-
if (Math.random() < 0.5) {
|
1366
|
-
setGlitchText("404");
|
1367
|
-
} else {
|
1368
|
-
const randomChars = Array.from(
|
1369
|
-
{ length: 3 },
|
1370
|
-
() => glitchChars[Math.floor(Math.random() * glitchChars.length)]
|
1371
|
-
).join("");
|
1372
|
-
setGlitchText(randomChars);
|
1373
|
-
}
|
1374
|
-
}, 600);
|
1375
|
-
return () => clearInterval(interval);
|
1376
|
-
}, []);
|
1377
|
-
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex flex-col items-center justify-center min-h-[75vh] w-full px-4 py-8", children: [
|
1378
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "text-center space-y-8 max-w-2xl", children: [
|
1379
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "relative flex justify-center", children: [
|
1380
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
1381
|
-
"h1",
|
1382
|
-
{
|
1383
|
-
className: "text-8xl md:text-9xl font-bold bg-gradient-to-r from-purple-600 via-pink-500 to-purple-700 bg-clip-text text-transparent select-none",
|
1384
|
-
style: {
|
1385
|
-
fontFamily: "Montserrat, monospace",
|
1386
|
-
textShadow: "0 0 30px rgba(172, 98, 253, 0.3)",
|
1387
|
-
letterSpacing: "0.1em"
|
1388
|
-
},
|
1389
|
-
children: glitchText
|
1390
|
-
}
|
1391
|
-
),
|
1392
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "absolute inset-0 pointer-events-none", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "h-full w-full bg-gradient-to-b from-transparent via-purple-500/10 to-transparent animate-pulse" }) })
|
1393
|
-
] }),
|
1394
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "space-y-4", children: [
|
1395
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("h2", { className: "text-2xl md:text-3xl font-semibold text-foreground", children: "Page Not Found" }),
|
1396
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("p", { className: "text-lg text-muted-foreground max-w-md mx-auto leading-relaxed", children: "The page you're looking for doesn't exist" })
|
1397
|
-
] }),
|
1398
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex justify-center items-center gap-8 pt-8 opacity-60", children: [
|
1399
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
|
1400
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(SiteIcon, {}),
|
1401
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { children: "Woops!" })
|
1402
|
-
] }),
|
1403
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "w-1 h-1 bg-purple-500 rounded-full animate-ping" }),
|
1404
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
|
1405
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(NotFoundIcon, {}),
|
1406
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { children: "Error Code: 404" })
|
1407
|
-
] })
|
1408
|
-
] })
|
1409
|
-
] }),
|
1410
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "fixed inset-0 pointer-events-none overflow-hidden -z-10", children: [
|
1411
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
1412
|
-
"div",
|
1413
|
-
{
|
1414
|
-
className: "absolute inset-0 opacity-[0.02] dark:opacity-[0.05]",
|
1415
|
-
style: {
|
1416
|
-
backgroundImage: `
|
1417
|
-
linear-gradient(rgba(172, 98, 253, 0.1) 1px, transparent 1px),
|
1418
|
-
linear-gradient(90deg, rgba(172, 98, 253, 0.1) 1px, transparent 1px)
|
1419
|
-
`,
|
1420
|
-
backgroundSize: "50px 50px"
|
1421
|
-
}
|
1422
|
-
}
|
1423
|
-
),
|
1424
|
-
Array.from({ length: 6 }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
1425
|
-
"div",
|
1426
|
-
{
|
1427
|
-
className: "absolute w-2 h-2 bg-purple-500/20 rounded-full animate-bounce",
|
1428
|
-
style: {
|
1429
|
-
left: `${20 + i * 15}%`,
|
1430
|
-
top: `${30 + i % 3 * 20}%`,
|
1431
|
-
animationDelay: `${i * 0.5}s`,
|
1432
|
-
animationDuration: `${2 + i * 0.3}s`
|
1433
|
-
}
|
1434
|
-
},
|
1435
|
-
i
|
1436
|
-
))
|
1437
|
-
] })
|
1438
|
-
] });
|
1439
|
-
}
|
1440
|
-
|
1441
|
-
// src/components/go-to-top.tsx
|
1442
|
-
var import_react32 = require("react");
|
1443
|
-
var import_jsx_runtime33 = require("react/jsx-runtime");
|
1444
|
-
|
1445
|
-
// src/components/language-detector.tsx
|
1446
|
-
var import_next_intl = require("next-intl");
|
1447
|
-
var import_navigation = require("next/navigation");
|
1448
|
-
var import_react33 = require("react");
|
1449
|
-
var import_jsx_runtime34 = require("react/jsx-runtime");
|
1450
|
-
function LanguageDetector({ i18nConfig }) {
|
1451
|
-
const [show, setShow] = (0, import_react33.useState)(false);
|
1452
|
-
const [detectedLocale, setDetectedLocale] = (0, import_react33.useState)(null);
|
1453
|
-
const currentLocale = (0, import_next_intl.useLocale)();
|
1454
|
-
const router = (0, import_navigation.useRouter)();
|
1455
|
-
const t = (0, import_next_intl.useTranslations)("languageDetection");
|
1456
|
-
const LANGUAGE_PREFERENCE_KEY = `${i18nConfig.detector.storagePrefix}-${i18nConfig.detector.storageKey}`;
|
1457
|
-
(0, import_react33.useEffect)(() => {
|
1458
|
-
const browserLang = navigator.language.split("-")[0];
|
1459
|
-
const savedPreference = localStorage.getItem(LANGUAGE_PREFERENCE_KEY);
|
1460
|
-
const preference = savedPreference ? JSON.parse(savedPreference) : null;
|
1461
|
-
const shouldShowDetector = () => {
|
1462
|
-
if (!preference) return true;
|
1463
|
-
if (preference.locale === currentLocale) return false;
|
1464
|
-
if (preference.status === "rejected" && preference.locale === browserLang) return false;
|
1465
|
-
if (preference.status === "accepted" && preference.locale === currentLocale) return false;
|
1466
|
-
const expirationMs = i18nConfig.detector.expirationDays * 24 * 60 * 60 * 1e3;
|
1467
|
-
if (Date.now() - preference.timestamp < expirationMs) return false;
|
1468
|
-
return true;
|
1469
|
-
};
|
1470
|
-
if (i18nConfig.locales.includes(browserLang) && browserLang !== currentLocale && shouldShowDetector()) {
|
1471
|
-
setDetectedLocale(browserLang);
|
1472
|
-
setShow(true);
|
1473
|
-
const timer = setTimeout(() => {
|
1474
|
-
console.log("[LanguageDetector] Auto closing after timeout");
|
1475
|
-
setShow(false);
|
1476
|
-
savePreference(browserLang, "rejected");
|
1477
|
-
}, i18nConfig.detector.autoCloseTimeout);
|
1478
|
-
return () => clearTimeout(timer);
|
1479
|
-
}
|
1480
|
-
}, [currentLocale]);
|
1481
|
-
const savePreference = (locale, status) => {
|
1482
|
-
const preference = {
|
1483
|
-
locale,
|
1484
|
-
status,
|
1485
|
-
timestamp: Date.now()
|
1486
|
-
};
|
1487
|
-
localStorage.setItem(LANGUAGE_PREFERENCE_KEY, JSON.stringify(preference));
|
1488
|
-
};
|
1489
|
-
const handleLanguageChange = () => {
|
1490
|
-
if (detectedLocale) {
|
1491
|
-
savePreference(detectedLocale, "accepted");
|
1492
|
-
const pathname = window.location.pathname;
|
1493
|
-
const newPathname = pathname.replace(`/${currentLocale}`, `/${detectedLocale}`);
|
1494
|
-
router.push(newPathname);
|
1495
|
-
setShow(false);
|
1496
|
-
}
|
1497
|
-
};
|
1498
|
-
const handleClose = () => {
|
1499
|
-
if (detectedLocale) {
|
1500
|
-
savePreference(detectedLocale, "rejected");
|
1501
|
-
}
|
1502
|
-
setShow(false);
|
1503
|
-
};
|
1504
|
-
if (!detectedLocale || !show) return null;
|
1505
|
-
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "fixed top-16 right-4 z-40 w-[420px]", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: `shadow-lg rounded-lg transition-all duration-300 ${show ? "translate-x-0 opacity-100" : "translate-x-full opacity-0"}
|
1506
|
-
bg-linear-to-r from-purple-100/95 via-white/95 to-purple-100/95 backdrop-blur-xs
|
1507
|
-
animate-gradient-x`, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "relative px-6 py-4 overflow-hidden", children: [
|
1508
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "relative z-10 flex flex-col gap-3", children: [
|
1509
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex items-start justify-between gap-4", children: [
|
1510
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex flex-col gap-1.5", children: [
|
1511
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("h3", { className: "text-lg font-semibold text-gray-900", children: t("title") }),
|
1512
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("p", { className: "text-base text-gray-600", children: [
|
1513
|
-
t("description"),
|
1514
|
-
" ",
|
1515
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "text-purple-500 font-semibold", children: detectedLocale === "zh" ? "\u4E2D\u6587" : "English" }),
|
1516
|
-
"?"
|
1517
|
-
] })
|
1518
|
-
] }),
|
1519
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
1520
|
-
"button",
|
1521
|
-
{
|
1522
|
-
onClick: handleClose,
|
1523
|
-
className: "text-gray-500 hover:text-gray-700",
|
1524
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(globalLucideIcons.X, { className: "h-5 w-5" })
|
1525
|
-
}
|
1526
|
-
)
|
1527
|
-
] }),
|
1528
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex items-center gap-3", children: [
|
1529
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
1530
|
-
"button",
|
1531
|
-
{
|
1532
|
-
onClick: handleClose,
|
1533
|
-
className: "flex-1 px-4 py-2 text-base bg-gray-100 text-gray-600 rounded-md hover:bg-gray-200",
|
1534
|
-
children: t("close")
|
1535
|
-
}
|
1536
|
-
),
|
1537
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
1538
|
-
"button",
|
1539
|
-
{
|
1540
|
-
onClick: handleLanguageChange,
|
1541
|
-
className: "flex-1 px-4 py-2 text-base bg-purple-500 text-white rounded-md hover:bg-purple-600",
|
1542
|
-
children: t("changeAction")
|
1543
|
-
}
|
1544
|
-
)
|
1545
|
-
] })
|
1546
|
-
] }),
|
1547
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "absolute inset-0 bg-linear-to-r from-transparent via-purple-200/30 to-transparent animate-shimmer" })
|
1548
|
-
] }) }) });
|
1549
|
-
}
|
1550
|
-
|
1551
|
-
// src/components/language-switcher.tsx
|
1552
|
-
var import_navigation2 = require("next/navigation");
|
1553
|
-
var import_next_intl2 = require("next-intl");
|
1554
|
-
|
1555
|
-
// src/ui/dropdown-menu.tsx
|
1556
|
-
var React30 = __toESM(require("react"));
|
1557
|
-
var DropdownMenuPrimitive = __toESM(require("@radix-ui/react-dropdown-menu"));
|
1558
|
-
var import_jsx_runtime35 = require("react/jsx-runtime");
|
1559
|
-
var DropdownMenu = DropdownMenuPrimitive.Root;
|
1560
|
-
var DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
1561
|
-
var DropdownMenuSubTrigger = React30.forwardRef((_a, ref) => {
|
1562
|
-
var _b = _a, { className, inset, children } = _b, props = __objRest(_b, ["className", "inset", "children"]);
|
1563
|
-
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
1564
|
-
DropdownMenuPrimitive.SubTrigger,
|
1565
|
-
__spreadProps(__spreadValues({
|
1566
|
-
ref,
|
1567
|
-
className: cn(
|
1568
|
-
"flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-hidden focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
1569
|
-
inset && "pl-8",
|
1570
|
-
className
|
1571
|
-
)
|
1572
|
-
}, props), {
|
1573
|
-
children: [
|
1574
|
-
children,
|
1575
|
-
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(globalLucideIcons.ChevronRight, { className: "ml-auto" })
|
1576
|
-
]
|
1577
|
-
})
|
1578
|
-
);
|
1579
|
-
});
|
1580
|
-
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
|
1581
|
-
var DropdownMenuSubContent = React30.forwardRef((_a, ref) => {
|
1582
|
-
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
1583
|
-
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
1584
|
-
DropdownMenuPrimitive.SubContent,
|
1585
|
-
__spreadValues({
|
1586
|
-
ref,
|
1587
|
-
className: cn(
|
1588
|
-
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
1589
|
-
className
|
1590
|
-
)
|
1591
|
-
}, props)
|
1592
|
-
);
|
1593
|
-
});
|
1594
|
-
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
1595
|
-
var DropdownMenuContent = React30.forwardRef((_a, ref) => {
|
1596
|
-
var _b = _a, { className, sideOffset = 4 } = _b, props = __objRest(_b, ["className", "sideOffset"]);
|
1597
|
-
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
1598
|
-
DropdownMenuPrimitive.Content,
|
1599
|
-
__spreadValues({
|
1600
|
-
ref,
|
1601
|
-
sideOffset,
|
1602
|
-
className: cn(
|
1603
|
-
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
1604
|
-
className
|
1605
|
-
)
|
1606
|
-
}, props)
|
1607
|
-
) });
|
1608
|
-
});
|
1609
|
-
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
1610
|
-
var DropdownMenuItem = React30.forwardRef((_a, ref) => {
|
1611
|
-
var _b = _a, { className, inset } = _b, props = __objRest(_b, ["className", "inset"]);
|
1612
|
-
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
1613
|
-
DropdownMenuPrimitive.Item,
|
1614
|
-
__spreadValues({
|
1615
|
-
ref,
|
1616
|
-
className: cn(
|
1617
|
-
"relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden transition-colors focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
1618
|
-
inset && "pl-8",
|
1619
|
-
className
|
1620
|
-
)
|
1621
|
-
}, props)
|
1622
|
-
);
|
1623
|
-
});
|
1624
|
-
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
1625
|
-
var DropdownMenuCheckboxItem = React30.forwardRef((_a, ref) => {
|
1626
|
-
var _b = _a, { className, children, checked } = _b, props = __objRest(_b, ["className", "children", "checked"]);
|
1627
|
-
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
1628
|
-
DropdownMenuPrimitive.CheckboxItem,
|
1629
|
-
__spreadProps(__spreadValues({
|
1630
|
-
ref,
|
1631
|
-
className: cn(
|
1632
|
-
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-hidden transition-colors focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50",
|
1633
|
-
className
|
1634
|
-
),
|
1635
|
-
checked
|
1636
|
-
}, props), {
|
1637
|
-
children: [
|
1638
|
-
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(globalLucideIcons.Check, { className: "h-4 w-4" }) }) }),
|
1639
|
-
children
|
1640
|
-
]
|
1641
|
-
})
|
1642
|
-
);
|
1643
|
-
});
|
1644
|
-
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
|
1645
|
-
var DropdownMenuRadioItem = React30.forwardRef((_a, ref) => {
|
1646
|
-
var _b = _a, { className, children } = _b, props = __objRest(_b, ["className", "children"]);
|
1647
|
-
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
1648
|
-
DropdownMenuPrimitive.RadioItem,
|
1649
|
-
__spreadProps(__spreadValues({
|
1650
|
-
ref,
|
1651
|
-
className: cn(
|
1652
|
-
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-hidden transition-colors focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50",
|
1653
|
-
className
|
1654
|
-
)
|
1655
|
-
}, props), {
|
1656
|
-
children: [
|
1657
|
-
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(globalLucideIcons.Circle, { className: "h-2 w-2 fill-current" }) }) }),
|
1658
|
-
children
|
1659
|
-
]
|
1660
|
-
})
|
1661
|
-
);
|
1662
|
-
});
|
1663
|
-
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
1664
|
-
var DropdownMenuLabel = React30.forwardRef((_a, ref) => {
|
1665
|
-
var _b = _a, { className, inset } = _b, props = __objRest(_b, ["className", "inset"]);
|
1666
|
-
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
1667
|
-
DropdownMenuPrimitive.Label,
|
1668
|
-
__spreadValues({
|
1669
|
-
ref,
|
1670
|
-
className: cn(
|
1671
|
-
"px-2 py-1.5 text-sm font-semibold",
|
1672
|
-
inset && "pl-8",
|
1673
|
-
className
|
1674
|
-
)
|
1675
|
-
}, props)
|
1676
|
-
);
|
1677
|
-
});
|
1678
|
-
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
1679
|
-
var DropdownMenuSeparator = React30.forwardRef((_a, ref) => {
|
1680
|
-
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
1681
|
-
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
1682
|
-
DropdownMenuPrimitive.Separator,
|
1683
|
-
__spreadValues({
|
1684
|
-
ref,
|
1685
|
-
className: cn("-mx-1 my-1 h-px bg-muted", className)
|
1686
|
-
}, props)
|
1687
|
-
);
|
1688
|
-
});
|
1689
|
-
DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
|
1690
|
-
var DropdownMenuShortcut = (_a) => {
|
1691
|
-
var _b = _a, {
|
1692
|
-
className
|
1693
|
-
} = _b, props = __objRest(_b, [
|
1694
|
-
"className"
|
1695
|
-
]);
|
1696
|
-
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
1697
|
-
"span",
|
1698
|
-
__spreadValues({
|
1699
|
-
className: cn("ml-auto text-xs tracking-widest opacity-60", className)
|
1700
|
-
}, props)
|
1701
|
-
);
|
1702
|
-
};
|
1703
|
-
DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
|
1704
|
-
|
1705
|
-
// src/ui/language-button.tsx
|
1706
|
-
var React31 = __toESM(require("react"));
|
1707
|
-
var import_jsx_runtime36 = require("react/jsx-runtime");
|
1708
|
-
var LanguageButton = React31.forwardRef(
|
1709
|
-
(_a, ref) => {
|
1710
|
-
var _b = _a, { className, variant = "default", size = "default" } = _b, props = __objRest(_b, ["className", "variant", "size"]);
|
1711
|
-
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
1712
|
-
"button",
|
1713
|
-
__spreadValues({
|
1714
|
-
className: cn(
|
1715
|
-
"inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:opacity-50 disabled:pointer-events-none ring-offset-background",
|
1716
|
-
{
|
1717
|
-
"bg-primary text-primary-foreground hover:bg-primary/90": variant === "default",
|
1718
|
-
"hover:bg-accent hover:text-accent-foreground": variant === "ghost",
|
1719
|
-
"h-10 px-4 py-2": size === "default",
|
1720
|
-
"h-9 px-3": size === "sm",
|
1721
|
-
"h-11 px-8": size === "lg",
|
1722
|
-
"h-10 w-10": size === "icon"
|
1723
|
-
},
|
1724
|
-
className
|
1725
|
-
),
|
1726
|
-
ref
|
1727
|
-
}, props)
|
1728
|
-
);
|
1729
|
-
}
|
1730
|
-
);
|
1731
|
-
LanguageButton.displayName = "Button";
|
1732
|
-
|
1733
|
-
// src/components/language-switcher.tsx
|
1734
|
-
var import_jsx_runtime37 = require("react/jsx-runtime");
|
1735
|
-
function LanguageSwitcher({ locales, localeLabels }) {
|
1736
|
-
const locale = (0, import_next_intl2.useLocale)();
|
1737
|
-
const router = (0, import_navigation2.useRouter)();
|
1738
|
-
const pathname = (0, import_navigation2.usePathname)();
|
1739
|
-
const handleLocaleChange = (newLocale) => {
|
1740
|
-
const newPathname = pathname.replace(`/${locale}`, `/${newLocale}`);
|
1741
|
-
router.push(newPathname);
|
1742
|
-
};
|
1743
|
-
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(DropdownMenu, { children: [
|
1744
|
-
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
1745
|
-
LanguageButton,
|
1746
|
-
{
|
1747
|
-
variant: "ghost",
|
1748
|
-
size: "icon",
|
1749
|
-
className: "bg-linear-to-r from-purple-400 to-pink-600 hover:from-purple-500 hover:to-pink-700 text-white transform hover:scale-110 transition-all duration-300",
|
1750
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(globalLucideIcons.Globe, { className: "h-5 w-5" })
|
1751
|
-
}
|
1752
|
-
) }),
|
1753
|
-
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
1754
|
-
DropdownMenuContent,
|
1755
|
-
{
|
1756
|
-
align: "end",
|
1757
|
-
sideOffset: 5,
|
1758
|
-
className: "bg-white/90 dark:bg-gray-800/90 border-purple-100 dark:border-purple-800 w-[200px] p-2 backdrop-blur-xs translate-x-[50px]",
|
1759
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "grid grid-cols-2 gap-1", children: locales.map((loc) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
1760
|
-
DropdownMenuItem,
|
1761
|
-
{
|
1762
|
-
className: `
|
1763
|
-
px-2 py-2 text-sm cursor-pointer text-center justify-center
|
1764
|
-
transition-all duration-300 ease-in-out
|
1765
|
-
hover:scale-105 hover:shadow-md
|
1766
|
-
rounded-md whitespace-nowrap
|
1767
|
-
${locale === loc ? "bg-linear-to-r from-purple-400 to-pink-600 text-white font-medium shadow-lg scale-105" : "hover:bg-linear-to-r hover:from-purple-400/10 hover:to-pink-600/10 hover:text-transparent hover:bg-clip-text"}
|
1768
|
-
`,
|
1769
|
-
onClick: () => handleLocaleChange(loc),
|
1770
|
-
children: localeLabels[loc]
|
1771
|
-
},
|
1772
|
-
loc
|
1773
|
-
)) })
|
1774
|
-
}
|
1775
|
-
)
|
1776
|
-
] });
|
1777
|
-
}
|
1778
|
-
|
1779
|
-
// src/components/script/google-analytics-script.tsx
|
1780
|
-
var import_script = __toESM(require("next/script"));
|
1781
|
-
var import_jsx_runtime38 = require("react/jsx-runtime");
|
1782
|
-
var googleAnalyticsId = process.env.NEXT_PUBLIC_GOOGLE_ANALYTICS_ID;
|
1783
|
-
function GoogleAnalyticsScript() {
|
1784
|
-
if (process.env.NODE_ENV !== "production") {
|
1785
|
-
return null;
|
1786
|
-
}
|
1787
|
-
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [
|
1788
|
-
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
1789
|
-
import_script.default,
|
1790
|
-
{
|
1791
|
-
strategy: "afterInteractive",
|
1792
|
-
src: `https://www.googletagmanager.com/gtag/js?id=${googleAnalyticsId}`
|
1793
|
-
}
|
1794
|
-
),
|
1795
|
-
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
1796
|
-
import_script.default,
|
1797
|
-
{
|
1798
|
-
id: "google-analytics",
|
1799
|
-
strategy: "afterInteractive",
|
1800
|
-
dangerouslySetInnerHTML: {
|
1801
|
-
__html: `
|
1802
|
-
window.dataLayer = window.dataLayer || [];
|
1803
|
-
function gtag(){dataLayer.push(arguments);}
|
1804
|
-
gtag('js', new Date());
|
1805
|
-
gtag('config', '${googleAnalyticsId}');
|
1806
|
-
`
|
1807
|
-
}
|
1808
|
-
}
|
1809
|
-
)
|
1810
|
-
] });
|
1811
|
-
}
|
1812
|
-
function useGoogleAnalytics() {
|
1813
|
-
const trackEvent = (event, data) => {
|
1814
|
-
if (typeof window === "undefined" || !window.gtag) {
|
1815
|
-
return;
|
1816
|
-
}
|
1817
|
-
window.gtag("event", event, data);
|
1818
|
-
};
|
1819
|
-
return {
|
1820
|
-
trackEvent
|
1821
|
-
};
|
1822
|
-
}
|
1823
|
-
|
1824
|
-
// src/components/script/microsoft-clarity-script.tsx
|
1825
|
-
var import_script2 = __toESM(require("next/script"));
|
1826
|
-
var import_jsx_runtime39 = require("react/jsx-runtime");
|
1827
|
-
var microsoftClarityId = process.env.NEXT_PUBLIC_MICROSOFT_CLARITY_ID;
|
1828
|
-
function MicrosoftClarityScript() {
|
1829
|
-
if (process.env.NODE_ENV !== "production") {
|
1830
|
-
return null;
|
1831
|
-
}
|
1832
|
-
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_script2.default, { id: "microsoft-clarity", strategy: "afterInteractive", children: `
|
1833
|
-
(function(c,l,a,r,i,t,y){
|
1834
|
-
c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};
|
1835
|
-
t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i;
|
1836
|
-
y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);
|
1837
|
-
})(window, document, "clarity", "script", "${microsoftClarityId}");
|
1838
|
-
` });
|
1839
|
-
}
|
1840
1287
|
// Annotate the CommonJS export names for ESM import in node:
|
1841
1288
|
0 && (module.exports = {
|
1842
1289
|
DefaultSiteIcon,
|
1843
|
-
GoogleAnalyticsScript,
|
1844
|
-
LanguageDetector,
|
1845
|
-
LanguageSwitcher,
|
1846
|
-
MicrosoftClarityScript,
|
1847
1290
|
NotFoundIcon,
|
1848
|
-
NotFoundPage,
|
1849
1291
|
getGlobalIcon,
|
1850
1292
|
getIconElement,
|
1851
|
-
globalLucideIcons
|
1852
|
-
useGoogleAnalytics
|
1293
|
+
globalLucideIcons
|
1853
1294
|
});
|
1854
|
-
/**
|
1855
|
-
* @license
|
1856
|
-
* MIT License
|
1857
|
-
* Copyright (c) 2025 D8ger
|
1858
|
-
*
|
1859
|
-
* This source code is licensed under the MIT license found in the
|
1860
|
-
* LICENSE file in the root directory of this source tree.
|
1861
|
-
*/
|
1862
1295
|
//# sourceMappingURL=index.js.map
|