@windrun-huaiin/base-ui 4.1.0 → 5.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/dist/components/client/index.d.mts +5 -1
- package/dist/components/client/index.d.ts +5 -1
- package/dist/components/client/index.js +7 -56
- package/dist/components/client/index.js.map +1 -1
- package/dist/components/client/index.mjs +8 -57
- package/dist/components/client/index.mjs.map +1 -1
- package/dist/components/index.d.mts +8 -1
- package/dist/components/index.d.ts +8 -1
- package/dist/components/index.js +33 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +33 -1
- package/dist/components/index.mjs.map +1 -1
- package/dist/index.d.mts +2 -9
- package/dist/index.d.ts +2 -9
- package/dist/index.js +63 -512
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +61 -461
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -9
- package/src/components/404-page.tsx +7 -4
- package/src/components/client/index.ts +2 -1
- package/src/components/index.ts +2 -0
- package/src/components/site-icon.tsx +38 -0
- package/src/index.ts +1 -3
- package/dist/lib/index.d.mts +0 -24
- package/dist/lib/index.d.ts +0 -24
- package/dist/lib/index.js +0 -1174
- package/dist/lib/index.js.map +0 -1
- package/dist/lib/index.mjs +0 -1167
- package/dist/lib/index.mjs.map +0 -1
- package/src/lib/icon-context.tsx +0 -57
- package/src/lib/index.ts +0 -5
- package/src/lib/site-icon.tsx +0 -46
@@ -1,12 +1,12 @@
|
|
1
1
|
import * as React30 from 'react';
|
2
|
-
import React30__default, {
|
2
|
+
import React30__default, { useState, useEffect } from 'react';
|
3
3
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
4
4
|
import { Zap, X, Twitter, Terminal, Tablets, Star, SquareTerminal, SquareDashedBottomCode, SplinePointer, Sparkles, ShieldUser, Share, Server, Search, Scale, Rss, Replace, Regex, ReceiptText, Pi, Pencil, PanelsTopLeft, PanelLeft, Palette, MousePointerClick, MoreHorizontal, LogOut, LogIn, Loader2, Link, LibraryIcon, LayoutTemplate, Layout, LandPlot, Keyboard, Info, ImageUp, ImageOff, ImageDown, HousePlus, Highlighter, Handshake, HandHeart, GripVertical, GlobeLock, Globe, GitPullRequestArrow, Gift, Fingerprint, FileLock2, Facebook, Eye, ExternalLink, Download, Dot, DatabaseZap, Cpu, ComponentIcon, CircleSmall, CircleAlert, Circle, ChevronUp, ChevronRight, ChevronLeft, ChevronDown, Check, Car, Building2, Bug, BringToFront, BookX, Blocks, Binary, ArrowUp, ArrowRight, ArrowLeft, AlignHorizontalJustifyEnd, AlbumIcon } from 'lucide-react';
|
5
|
-
import { clsx } from 'clsx';
|
6
|
-
import { twMerge } from 'tailwind-merge';
|
7
5
|
import { useLocale, useTranslations } from 'next-intl';
|
8
6
|
import { useRouter, usePathname } from 'next/navigation';
|
9
7
|
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
8
|
+
import { clsx } from 'clsx';
|
9
|
+
import { twMerge } from 'tailwind-merge';
|
10
10
|
import Script from 'next/script';
|
11
11
|
|
12
12
|
var __defProp = Object.defineProperty;
|
@@ -1112,59 +1112,7 @@ for (const [iconName, IconComponent] of Object.entries(BUILTIN_ICON_COMPONENTS))
|
|
1112
1112
|
var wrappedBuiltinIconsPart = tempWrappedBuiltinIcons;
|
1113
1113
|
var globalLucideIcons = __spreadValues(__spreadValues({}, styledLimitedIconsPart), wrappedBuiltinIconsPart);
|
1114
1114
|
var NotFoundIcon = () => /* @__PURE__ */ 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}` });
|
1115
|
-
function
|
1116
|
-
return twMerge(clsx(inputs));
|
1117
|
-
}
|
1118
|
-
var IconConfigContext = createContext(null);
|
1119
|
-
function useIconConfig() {
|
1120
|
-
const config = useContext(IconConfigContext);
|
1121
|
-
if (config === null) {
|
1122
|
-
throw new Error(
|
1123
|
-
'[SiteIcon] IconConfigProvider not found. Please wrap your app with <IconConfigProvider config={{ siteIcon: "YourIcon" }}>.'
|
1124
|
-
);
|
1125
|
-
}
|
1126
|
-
return config;
|
1127
|
-
}
|
1128
|
-
function useIconConfigSafe(iconKey) {
|
1129
|
-
try {
|
1130
|
-
const config = useIconConfig();
|
1131
|
-
return config[iconKey];
|
1132
|
-
} catch (e) {
|
1133
|
-
return void 0;
|
1134
|
-
}
|
1135
|
-
}
|
1136
|
-
function SiteIcon(_a) {
|
1137
|
-
var _b = _a, {
|
1138
|
-
size = 24,
|
1139
|
-
className
|
1140
|
-
} = _b, props = __objRest(_b, [
|
1141
|
-
"size",
|
1142
|
-
"className"
|
1143
|
-
]);
|
1144
|
-
const configuredIcon = useIconConfigSafe("siteIcon");
|
1145
|
-
if (configuredIcon === void 0) {
|
1146
|
-
throw new Error(
|
1147
|
-
'[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.'
|
1148
|
-
);
|
1149
|
-
}
|
1150
|
-
if (typeof configuredIcon === "string") {
|
1151
|
-
if (configuredIcon === "") {
|
1152
|
-
const DefaultIcon = globalLucideIcons["Download"];
|
1153
|
-
return /* @__PURE__ */ jsx(DefaultIcon, __spreadValues({ size, className: cn(themeIconColor, className) }, props));
|
1154
|
-
}
|
1155
|
-
const IconComponent = globalLucideIcons[configuredIcon];
|
1156
|
-
if (!IconComponent) {
|
1157
|
-
throw new Error(`[SiteIcon] Icon key "${configuredIcon}" not found in globalLucideIcons.`);
|
1158
|
-
}
|
1159
|
-
return /* @__PURE__ */ jsx(IconComponent, __spreadValues({ size, className: cn(themeIconColor, className) }, props));
|
1160
|
-
} else {
|
1161
|
-
const CustomIcon = configuredIcon;
|
1162
|
-
const hasColorClass = className && /text-\w+/.test(className);
|
1163
|
-
const finalClassName = hasColorClass ? className : cn(themeIconColor, className);
|
1164
|
-
return /* @__PURE__ */ jsx(CustomIcon, __spreadValues({ size, className: finalClassName }, props));
|
1165
|
-
}
|
1166
|
-
}
|
1167
|
-
function NotFoundPage() {
|
1115
|
+
function NotFoundPage({ siteIcon }) {
|
1168
1116
|
const [glitchText, setGlitchText] = useState("404");
|
1169
1117
|
useEffect(() => {
|
1170
1118
|
const glitchChars = ["4", "0", "4", "?", "#", "!", "*", "&", "%", "$"];
|
@@ -1204,7 +1152,7 @@ function NotFoundPage() {
|
|
1204
1152
|
] }),
|
1205
1153
|
/* @__PURE__ */ jsxs("div", { className: "flex justify-center items-center gap-8 pt-8 opacity-60", children: [
|
1206
1154
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
|
1207
|
-
|
1155
|
+
siteIcon,
|
1208
1156
|
/* @__PURE__ */ jsx("span", { children: "Woops!" })
|
1209
1157
|
] }),
|
1210
1158
|
/* @__PURE__ */ jsx("div", { className: "w-1 h-1 bg-purple-500 rounded-full animate-ping" }),
|
@@ -1344,6 +1292,9 @@ function LanguageDetector({ i18nConfig }) {
|
|
1344
1292
|
/* @__PURE__ */ jsx("div", { className: "absolute inset-0 bg-linear-to-r from-transparent via-purple-200/30 to-transparent animate-shimmer" })
|
1345
1293
|
] }) }) });
|
1346
1294
|
}
|
1295
|
+
function cn(...inputs) {
|
1296
|
+
return twMerge(clsx(inputs));
|
1297
|
+
}
|
1347
1298
|
var DropdownMenu = DropdownMenuPrimitive.Root;
|
1348
1299
|
var DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
1349
1300
|
var DropdownMenuSubTrigger = React30.forwardRef((_a, ref) => {
|