@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,8 +1,10 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { ComponentType, ReactNode } from 'react';
3
- import { LucideProps } from 'lucide-react';
2
+ import { ReactNode } from 'react';
4
3
 
5
- declare function NotFoundPage(): react_jsx_runtime.JSX.Element;
4
+ interface NotFoundPageProps {
5
+ siteIcon: ReactNode;
6
+ }
7
+ declare function NotFoundPage({ siteIcon }: NotFoundPageProps): react_jsx_runtime.JSX.Element;
6
8
 
7
9
  type I18nConfig = {
8
10
  locales: readonly string[];
@@ -45,23 +47,4 @@ declare global {
45
47
 
46
48
  declare function MicrosoftClarityScript(): react_jsx_runtime.JSX.Element | null;
47
49
 
48
- interface IconConfig {
49
- siteIcon?: ComponentType | string;
50
- }
51
- interface IconConfigProviderProps {
52
- config: IconConfig;
53
- children: ReactNode;
54
- }
55
- /**
56
- * IconConfigProvider - icon config provider based on React Context
57
- * directly store the config value, without depending on module state
58
- */
59
- declare function IconConfigProvider({ config, children }: IconConfigProviderProps): react_jsx_runtime.JSX.Element;
60
-
61
- /**
62
- * site icon component - client component
63
- * based on React Context to get the config, solve the problem of cross-package module instance isolation
64
- */
65
- declare function SiteIcon({ size, className, ...props }: Omit<LucideProps, 'children'>): react_jsx_runtime.JSX.Element;
66
-
67
- export { GoogleAnalyticsScript, type IconConfig, IconConfigProvider, LanguageDetector, LanguageSwitcher, MicrosoftClarityScript, NotFoundPage, SiteIcon, useGoogleAnalytics };
50
+ export { GoogleAnalyticsScript, LanguageDetector, LanguageSwitcher, MicrosoftClarityScript, NotFoundPage, useGoogleAnalytics };
@@ -1,8 +1,10 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { ComponentType, ReactNode } from 'react';
3
- import { LucideProps } from 'lucide-react';
2
+ import { ReactNode } from 'react';
4
3
 
5
- declare function NotFoundPage(): react_jsx_runtime.JSX.Element;
4
+ interface NotFoundPageProps {
5
+ siteIcon: ReactNode;
6
+ }
7
+ declare function NotFoundPage({ siteIcon }: NotFoundPageProps): react_jsx_runtime.JSX.Element;
6
8
 
7
9
  type I18nConfig = {
8
10
  locales: readonly string[];
@@ -45,23 +47,4 @@ declare global {
45
47
 
46
48
  declare function MicrosoftClarityScript(): react_jsx_runtime.JSX.Element | null;
47
49
 
48
- interface IconConfig {
49
- siteIcon?: ComponentType | string;
50
- }
51
- interface IconConfigProviderProps {
52
- config: IconConfig;
53
- children: ReactNode;
54
- }
55
- /**
56
- * IconConfigProvider - icon config provider based on React Context
57
- * directly store the config value, without depending on module state
58
- */
59
- declare function IconConfigProvider({ config, children }: IconConfigProviderProps): react_jsx_runtime.JSX.Element;
60
-
61
- /**
62
- * site icon component - client component
63
- * based on React Context to get the config, solve the problem of cross-package module instance isolation
64
- */
65
- declare function SiteIcon({ size, className, ...props }: Omit<LucideProps, 'children'>): react_jsx_runtime.JSX.Element;
66
-
67
- export { GoogleAnalyticsScript, type IconConfig, IconConfigProvider, LanguageDetector, LanguageSwitcher, MicrosoftClarityScript, NotFoundPage, SiteIcon, useGoogleAnalytics };
50
+ export { GoogleAnalyticsScript, LanguageDetector, LanguageSwitcher, MicrosoftClarityScript, NotFoundPage, useGoogleAnalytics };
@@ -3,11 +3,11 @@
3
3
  var React30 = require('react');
4
4
  var jsxRuntime = require('react/jsx-runtime');
5
5
  var lucideReact = require('lucide-react');
6
- var clsx = require('clsx');
7
- var tailwindMerge = require('tailwind-merge');
8
6
  var nextIntl = require('next-intl');
9
7
  var navigation = require('next/navigation');
10
8
  var DropdownMenuPrimitive = require('@radix-ui/react-dropdown-menu');
9
+ var clsx = require('clsx');
10
+ var tailwindMerge = require('tailwind-merge');
11
11
  var Script = require('next/script');
12
12
 
13
13
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
@@ -1137,62 +1137,7 @@ for (const [iconName, IconComponent] of Object.entries(BUILTIN_ICON_COMPONENTS))
1137
1137
  var wrappedBuiltinIconsPart = tempWrappedBuiltinIcons;
1138
1138
  var globalLucideIcons = __spreadValues(__spreadValues({}, styledLimitedIconsPart), wrappedBuiltinIconsPart);
1139
1139
  var NotFoundIcon = () => /* @__PURE__ */ jsxRuntime.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}` });
1140
- function cn(...inputs) {
1141
- return tailwindMerge.twMerge(clsx.clsx(inputs));
1142
- }
1143
- var IconConfigContext = React30.createContext(null);
1144
- function IconConfigProvider({ config, children }) {
1145
- return /* @__PURE__ */ jsxRuntime.jsx(IconConfigContext.Provider, { value: config, children });
1146
- }
1147
- function useIconConfig() {
1148
- const config = React30.useContext(IconConfigContext);
1149
- if (config === null) {
1150
- throw new Error(
1151
- '[SiteIcon] IconConfigProvider not found. Please wrap your app with <IconConfigProvider config={{ siteIcon: "YourIcon" }}>.'
1152
- );
1153
- }
1154
- return config;
1155
- }
1156
- function useIconConfigSafe(iconKey) {
1157
- try {
1158
- const config = useIconConfig();
1159
- return config[iconKey];
1160
- } catch (e) {
1161
- return void 0;
1162
- }
1163
- }
1164
- function SiteIcon(_a) {
1165
- var _b = _a, {
1166
- size = 24,
1167
- className
1168
- } = _b, props = __objRest(_b, [
1169
- "size",
1170
- "className"
1171
- ]);
1172
- const configuredIcon = useIconConfigSafe("siteIcon");
1173
- if (configuredIcon === void 0) {
1174
- throw new Error(
1175
- '[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.'
1176
- );
1177
- }
1178
- if (typeof configuredIcon === "string") {
1179
- if (configuredIcon === "") {
1180
- const DefaultIcon = globalLucideIcons["Download"];
1181
- return /* @__PURE__ */ jsxRuntime.jsx(DefaultIcon, __spreadValues({ size, className: cn(themeIconColor, className) }, props));
1182
- }
1183
- const IconComponent = globalLucideIcons[configuredIcon];
1184
- if (!IconComponent) {
1185
- throw new Error(`[SiteIcon] Icon key "${configuredIcon}" not found in globalLucideIcons.`);
1186
- }
1187
- return /* @__PURE__ */ jsxRuntime.jsx(IconComponent, __spreadValues({ size, className: cn(themeIconColor, className) }, props));
1188
- } else {
1189
- const CustomIcon = configuredIcon;
1190
- const hasColorClass = className && /text-\w+/.test(className);
1191
- const finalClassName = hasColorClass ? className : cn(themeIconColor, className);
1192
- return /* @__PURE__ */ jsxRuntime.jsx(CustomIcon, __spreadValues({ size, className: finalClassName }, props));
1193
- }
1194
- }
1195
- function NotFoundPage() {
1140
+ function NotFoundPage({ siteIcon }) {
1196
1141
  const [glitchText, setGlitchText] = React30.useState("404");
1197
1142
  React30.useEffect(() => {
1198
1143
  const glitchChars = ["4", "0", "4", "?", "#", "!", "*", "&", "%", "$"];
@@ -1232,7 +1177,7 @@ function NotFoundPage() {
1232
1177
  ] }),
1233
1178
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-center items-center gap-8 pt-8 opacity-60", children: [
1234
1179
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
1235
- /* @__PURE__ */ jsxRuntime.jsx(SiteIcon, {}),
1180
+ siteIcon,
1236
1181
  /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Woops!" })
1237
1182
  ] }),
1238
1183
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-1 h-1 bg-purple-500 rounded-full animate-ping" }),
@@ -1372,6 +1317,9 @@ function LanguageDetector({ i18nConfig }) {
1372
1317
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 bg-linear-to-r from-transparent via-purple-200/30 to-transparent animate-shimmer" })
1373
1318
  ] }) }) });
1374
1319
  }
1320
+ function cn(...inputs) {
1321
+ return tailwindMerge.twMerge(clsx.clsx(inputs));
1322
+ }
1375
1323
  var DropdownMenu = DropdownMenuPrimitive__namespace.Root;
1376
1324
  var DropdownMenuTrigger = DropdownMenuPrimitive__namespace.Trigger;
1377
1325
  var DropdownMenuSubTrigger = React30__namespace.forwardRef((_a, ref) => {
@@ -1634,12 +1582,10 @@ function MicrosoftClarityScript() {
1634
1582
  */
1635
1583
 
1636
1584
  exports.GoogleAnalyticsScript = GoogleAnalyticsScript;
1637
- exports.IconConfigProvider = IconConfigProvider;
1638
1585
  exports.LanguageDetector = LanguageDetector;
1639
1586
  exports.LanguageSwitcher = LanguageSwitcher;
1640
1587
  exports.MicrosoftClarityScript = MicrosoftClarityScript;
1641
1588
  exports.NotFoundPage = NotFoundPage;
1642
- exports.SiteIcon = SiteIcon;
1643
1589
  exports.useGoogleAnalytics = useGoogleAnalytics;
1644
1590
  //# sourceMappingURL=index.js.map
1645
1591
  //# sourceMappingURL=index.js.map