@windrun-huaiin/base-ui 4.1.1 → 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.
@@ -1,12 +1,12 @@
1
1
  import * as React30 from 'react';
2
- import React30__default, { createContext, useState, useEffect, useContext } from 'react';
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,62 +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 cn(...inputs) {
1116
- return twMerge(clsx(inputs));
1117
- }
1118
- var IconConfigContext = createContext(null);
1119
- function IconConfigProvider({ config, children }) {
1120
- return /* @__PURE__ */ jsx(IconConfigContext.Provider, { value: config, children });
1121
- }
1122
- function useIconConfig() {
1123
- const config = useContext(IconConfigContext);
1124
- if (config === null) {
1125
- throw new Error(
1126
- '[SiteIcon] IconConfigProvider not found. Please wrap your app with <IconConfigProvider config={{ siteIcon: "YourIcon" }}>.'
1127
- );
1128
- }
1129
- return config;
1130
- }
1131
- function useIconConfigSafe(iconKey) {
1132
- try {
1133
- const config = useIconConfig();
1134
- return config[iconKey];
1135
- } catch (e) {
1136
- return void 0;
1137
- }
1138
- }
1139
- function SiteIcon(_a) {
1140
- var _b = _a, {
1141
- size = 24,
1142
- className
1143
- } = _b, props = __objRest(_b, [
1144
- "size",
1145
- "className"
1146
- ]);
1147
- const configuredIcon = useIconConfigSafe("siteIcon");
1148
- if (configuredIcon === void 0) {
1149
- throw new Error(
1150
- '[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.'
1151
- );
1152
- }
1153
- if (typeof configuredIcon === "string") {
1154
- if (configuredIcon === "") {
1155
- const DefaultIcon = globalLucideIcons["Download"];
1156
- return /* @__PURE__ */ jsx(DefaultIcon, __spreadValues({ size, className: cn(themeIconColor, className) }, props));
1157
- }
1158
- const IconComponent = globalLucideIcons[configuredIcon];
1159
- if (!IconComponent) {
1160
- throw new Error(`[SiteIcon] Icon key "${configuredIcon}" not found in globalLucideIcons.`);
1161
- }
1162
- return /* @__PURE__ */ jsx(IconComponent, __spreadValues({ size, className: cn(themeIconColor, className) }, props));
1163
- } else {
1164
- const CustomIcon = configuredIcon;
1165
- const hasColorClass = className && /text-\w+/.test(className);
1166
- const finalClassName = hasColorClass ? className : cn(themeIconColor, className);
1167
- return /* @__PURE__ */ jsx(CustomIcon, __spreadValues({ size, className: finalClassName }, props));
1168
- }
1169
- }
1170
- function NotFoundPage() {
1115
+ function NotFoundPage({ siteIcon }) {
1171
1116
  const [glitchText, setGlitchText] = useState("404");
1172
1117
  useEffect(() => {
1173
1118
  const glitchChars = ["4", "0", "4", "?", "#", "!", "*", "&", "%", "$"];
@@ -1207,7 +1152,7 @@ function NotFoundPage() {
1207
1152
  ] }),
1208
1153
  /* @__PURE__ */ jsxs("div", { className: "flex justify-center items-center gap-8 pt-8 opacity-60", children: [
1209
1154
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
1210
- /* @__PURE__ */ jsx(SiteIcon, {}),
1155
+ siteIcon,
1211
1156
  /* @__PURE__ */ jsx("span", { children: "Woops!" })
1212
1157
  ] }),
1213
1158
  /* @__PURE__ */ jsx("div", { className: "w-1 h-1 bg-purple-500 rounded-full animate-ping" }),
@@ -1347,6 +1292,9 @@ function LanguageDetector({ i18nConfig }) {
1347
1292
  /* @__PURE__ */ jsx("div", { className: "absolute inset-0 bg-linear-to-r from-transparent via-purple-200/30 to-transparent animate-shimmer" })
1348
1293
  ] }) }) });
1349
1294
  }
1295
+ function cn(...inputs) {
1296
+ return twMerge(clsx(inputs));
1297
+ }
1350
1298
  var DropdownMenu = DropdownMenuPrimitive.Root;
1351
1299
  var DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
1352
1300
  var DropdownMenuSubTrigger = React30.forwardRef((_a, ref) => {
@@ -1608,6 +1556,6 @@ function MicrosoftClarityScript() {
1608
1556
  * LICENSE file in the root directory of this source tree.
1609
1557
  */
1610
1558
 
1611
- export { GoogleAnalyticsScript, IconConfigProvider, LanguageDetector, LanguageSwitcher, MicrosoftClarityScript, NotFoundPage, SiteIcon, useGoogleAnalytics };
1559
+ export { GoogleAnalyticsScript, LanguageDetector, LanguageSwitcher, MicrosoftClarityScript, NotFoundPage, useGoogleAnalytics };
1612
1560
  //# sourceMappingURL=index.mjs.map
1613
1561
  //# sourceMappingURL=index.mjs.map