@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,6 +1,10 @@
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
2
|
+
import { ReactNode } from 'react';
|
2
3
|
|
3
|
-
|
4
|
+
interface NotFoundPageProps {
|
5
|
+
siteIcon: ReactNode;
|
6
|
+
}
|
7
|
+
declare function NotFoundPage({ siteIcon }: NotFoundPageProps): react_jsx_runtime.JSX.Element;
|
4
8
|
|
5
9
|
type I18nConfig = {
|
6
10
|
locales: readonly string[];
|
@@ -1,6 +1,10 @@
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
2
|
+
import { ReactNode } from 'react';
|
2
3
|
|
3
|
-
|
4
|
+
interface NotFoundPageProps {
|
5
|
+
siteIcon: ReactNode;
|
6
|
+
}
|
7
|
+
declare function NotFoundPage({ siteIcon }: NotFoundPageProps): react_jsx_runtime.JSX.Element;
|
4
8
|
|
5
9
|
type I18nConfig = {
|
6
10
|
locales: readonly string[];
|
@@ -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,59 +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
|
1141
|
-
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
1142
|
-
}
|
1143
|
-
var IconConfigContext = React30.createContext(null);
|
1144
|
-
function useIconConfig() {
|
1145
|
-
const config = React30.useContext(IconConfigContext);
|
1146
|
-
if (config === null) {
|
1147
|
-
throw new Error(
|
1148
|
-
'[SiteIcon] IconConfigProvider not found. Please wrap your app with <IconConfigProvider config={{ siteIcon: "YourIcon" }}>.'
|
1149
|
-
);
|
1150
|
-
}
|
1151
|
-
return config;
|
1152
|
-
}
|
1153
|
-
function useIconConfigSafe(iconKey) {
|
1154
|
-
try {
|
1155
|
-
const config = useIconConfig();
|
1156
|
-
return config[iconKey];
|
1157
|
-
} catch (e) {
|
1158
|
-
return void 0;
|
1159
|
-
}
|
1160
|
-
}
|
1161
|
-
function SiteIcon(_a) {
|
1162
|
-
var _b = _a, {
|
1163
|
-
size = 24,
|
1164
|
-
className
|
1165
|
-
} = _b, props = __objRest(_b, [
|
1166
|
-
"size",
|
1167
|
-
"className"
|
1168
|
-
]);
|
1169
|
-
const configuredIcon = useIconConfigSafe("siteIcon");
|
1170
|
-
if (configuredIcon === void 0) {
|
1171
|
-
throw new Error(
|
1172
|
-
'[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.'
|
1173
|
-
);
|
1174
|
-
}
|
1175
|
-
if (typeof configuredIcon === "string") {
|
1176
|
-
if (configuredIcon === "") {
|
1177
|
-
const DefaultIcon = globalLucideIcons["Download"];
|
1178
|
-
return /* @__PURE__ */ jsxRuntime.jsx(DefaultIcon, __spreadValues({ size, className: cn(themeIconColor, className) }, props));
|
1179
|
-
}
|
1180
|
-
const IconComponent = globalLucideIcons[configuredIcon];
|
1181
|
-
if (!IconComponent) {
|
1182
|
-
throw new Error(`[SiteIcon] Icon key "${configuredIcon}" not found in globalLucideIcons.`);
|
1183
|
-
}
|
1184
|
-
return /* @__PURE__ */ jsxRuntime.jsx(IconComponent, __spreadValues({ size, className: cn(themeIconColor, className) }, props));
|
1185
|
-
} else {
|
1186
|
-
const CustomIcon = configuredIcon;
|
1187
|
-
const hasColorClass = className && /text-\w+/.test(className);
|
1188
|
-
const finalClassName = hasColorClass ? className : cn(themeIconColor, className);
|
1189
|
-
return /* @__PURE__ */ jsxRuntime.jsx(CustomIcon, __spreadValues({ size, className: finalClassName }, props));
|
1190
|
-
}
|
1191
|
-
}
|
1192
|
-
function NotFoundPage() {
|
1140
|
+
function NotFoundPage({ siteIcon }) {
|
1193
1141
|
const [glitchText, setGlitchText] = React30.useState("404");
|
1194
1142
|
React30.useEffect(() => {
|
1195
1143
|
const glitchChars = ["4", "0", "4", "?", "#", "!", "*", "&", "%", "$"];
|
@@ -1229,7 +1177,7 @@ function NotFoundPage() {
|
|
1229
1177
|
] }),
|
1230
1178
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-center items-center gap-8 pt-8 opacity-60", children: [
|
1231
1179
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
|
1232
|
-
|
1180
|
+
siteIcon,
|
1233
1181
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Woops!" })
|
1234
1182
|
] }),
|
1235
1183
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-1 h-1 bg-purple-500 rounded-full animate-ping" }),
|
@@ -1369,6 +1317,9 @@ function LanguageDetector({ i18nConfig }) {
|
|
1369
1317
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 bg-linear-to-r from-transparent via-purple-200/30 to-transparent animate-shimmer" })
|
1370
1318
|
] }) }) });
|
1371
1319
|
}
|
1320
|
+
function cn(...inputs) {
|
1321
|
+
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
1322
|
+
}
|
1372
1323
|
var DropdownMenu = DropdownMenuPrimitive__namespace.Root;
|
1373
1324
|
var DropdownMenuTrigger = DropdownMenuPrimitive__namespace.Trigger;
|
1374
1325
|
var DropdownMenuSubTrigger = React30__namespace.forwardRef((_a, ref) => {
|