@windrun-huaiin/base-ui 20.1.0 → 21.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/LICENSE +1 -1
- package/dist/components/global-icon.d.ts +3 -3
- package/dist/components/global-icon.js +17 -1
- package/dist/components/global-icon.mjs +17 -1
- package/dist/components/language-switcher.d.ts +0 -8
- package/dist/components/language-switcher.js +0 -8
- package/dist/components/language-switcher.mjs +0 -8
- package/dist/components/limited-lucide-icons.d.ts +1 -1
- package/dist/components/limited-lucide-icons.js +6 -6
- package/dist/components/limited-lucide-icons.mjs +1 -1
- package/dist/icons/index.js +3 -3
- package/dist/icons/index.mjs +4 -4
- package/dist/ui/language-button.js +0 -8
- package/dist/ui/language-button.mjs +0 -8
- package/package.json +2 -2
- package/src/components/global-icon.tsx +20 -1
- package/src/components/language-switcher.tsx +0 -9
- package/src/components/limited-lucide-icons.ts +3 -3
- package/src/icons/index.ts +3 -3
- package/src/ui/language-button.tsx +0 -8
package/LICENSE
CHANGED
|
@@ -34,7 +34,7 @@ export declare const globalLucideIcons: {
|
|
|
34
34
|
FAQ: StyledLucideIconComponent;
|
|
35
35
|
FAQB: StyledLucideIconComponent;
|
|
36
36
|
FAQS: StyledLucideIconComponent;
|
|
37
|
-
|
|
37
|
+
Album: StyledLucideIconComponent;
|
|
38
38
|
AlignHorizontalJustifyEnd: StyledLucideIconComponent;
|
|
39
39
|
ArrowLeft: StyledLucideIconComponent;
|
|
40
40
|
ArrowRight: StyledLucideIconComponent;
|
|
@@ -87,7 +87,7 @@ export declare const globalLucideIcons: {
|
|
|
87
87
|
ChevronUp: StyledLucideIconComponent;
|
|
88
88
|
Coffee: StyledLucideIconComponent;
|
|
89
89
|
Coins: StyledLucideIconComponent;
|
|
90
|
-
|
|
90
|
+
Component: StyledLucideIconComponent;
|
|
91
91
|
Copy: StyledLucideIconComponent;
|
|
92
92
|
CopyCheck: StyledLucideIconComponent;
|
|
93
93
|
Cpu: StyledLucideIconComponent;
|
|
@@ -133,7 +133,7 @@ export declare const globalLucideIcons: {
|
|
|
133
133
|
Languages: StyledLucideIconComponent;
|
|
134
134
|
Layout: StyledLucideIconComponent;
|
|
135
135
|
LayoutTemplate: StyledLucideIconComponent;
|
|
136
|
-
|
|
136
|
+
Library: StyledLucideIconComponent;
|
|
137
137
|
Lightbulb: StyledLucideIconComponent;
|
|
138
138
|
Link: StyledLucideIconComponent;
|
|
139
139
|
ListTodo: StyledLucideIconComponent;
|
|
@@ -39,6 +39,21 @@ const globalLucideIcons = Object.assign(Object.assign({}, styledLimitedIconsPart
|
|
|
39
39
|
// Default fallback icon - centralized configuration
|
|
40
40
|
// Use a safe fallback that we know exists in both Lucide and custom icons
|
|
41
41
|
const DEFAULT_FALLBACK_ICON = 'Sparkles';
|
|
42
|
+
function resolveIconKey(iconKey) {
|
|
43
|
+
const trimmedKey = iconKey.trim();
|
|
44
|
+
if (trimmedKey === '')
|
|
45
|
+
return undefined;
|
|
46
|
+
const candidates = [
|
|
47
|
+
trimmedKey,
|
|
48
|
+
trimmedKey.endsWith('Icon') ? trimmedKey.slice(0, -4) : `${trimmedKey}Icon`,
|
|
49
|
+
];
|
|
50
|
+
for (const candidate of candidates) {
|
|
51
|
+
if (candidate in globalLucideIcons) {
|
|
52
|
+
return candidate;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return undefined;
|
|
56
|
+
}
|
|
42
57
|
function getGlobalIcon(iconKey, createElement) {
|
|
43
58
|
var _a;
|
|
44
59
|
// Handle undefined iconKey case (for getIconElement compatibility)
|
|
@@ -48,7 +63,8 @@ function getGlobalIcon(iconKey, createElement) {
|
|
|
48
63
|
}
|
|
49
64
|
return globalLucideIcons[DEFAULT_FALLBACK_ICON];
|
|
50
65
|
}
|
|
51
|
-
const
|
|
66
|
+
const resolvedIconKey = resolveIconKey(iconKey);
|
|
67
|
+
const Icon = resolvedIconKey ? globalLucideIcons[resolvedIconKey] : undefined;
|
|
52
68
|
if (!Icon) {
|
|
53
69
|
if (typeof process !== 'undefined' && ((_a = process.env) === null || _a === void 0 ? void 0 : _a.NODE_ENV) !== 'production') {
|
|
54
70
|
// only show in dev|test
|
|
@@ -37,6 +37,21 @@ const globalLucideIcons = Object.assign(Object.assign({}, styledLimitedIconsPart
|
|
|
37
37
|
// Default fallback icon - centralized configuration
|
|
38
38
|
// Use a safe fallback that we know exists in both Lucide and custom icons
|
|
39
39
|
const DEFAULT_FALLBACK_ICON = 'Sparkles';
|
|
40
|
+
function resolveIconKey(iconKey) {
|
|
41
|
+
const trimmedKey = iconKey.trim();
|
|
42
|
+
if (trimmedKey === '')
|
|
43
|
+
return undefined;
|
|
44
|
+
const candidates = [
|
|
45
|
+
trimmedKey,
|
|
46
|
+
trimmedKey.endsWith('Icon') ? trimmedKey.slice(0, -4) : `${trimmedKey}Icon`,
|
|
47
|
+
];
|
|
48
|
+
for (const candidate of candidates) {
|
|
49
|
+
if (candidate in globalLucideIcons) {
|
|
50
|
+
return candidate;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return undefined;
|
|
54
|
+
}
|
|
40
55
|
function getGlobalIcon(iconKey, createElement) {
|
|
41
56
|
var _a;
|
|
42
57
|
// Handle undefined iconKey case (for getIconElement compatibility)
|
|
@@ -46,7 +61,8 @@ function getGlobalIcon(iconKey, createElement) {
|
|
|
46
61
|
}
|
|
47
62
|
return globalLucideIcons[DEFAULT_FALLBACK_ICON];
|
|
48
63
|
}
|
|
49
|
-
const
|
|
64
|
+
const resolvedIconKey = resolveIconKey(iconKey);
|
|
65
|
+
const Icon = resolvedIconKey ? globalLucideIcons[resolvedIconKey] : undefined;
|
|
50
66
|
if (!Icon) {
|
|
51
67
|
if (typeof process !== 'undefined' && ((_a = process.env) === null || _a === void 0 ? void 0 : _a.NODE_ENV) !== 'production') {
|
|
52
68
|
// only show in dev|test
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* MIT License
|
|
4
|
-
* Copyright (c) 2026 D8ger
|
|
5
|
-
*
|
|
6
|
-
* This source code is licensed under the MIT license found in the
|
|
7
|
-
* LICENSE file in the root directory of this source tree.
|
|
8
|
-
*/
|
|
9
1
|
interface LanguageSwitcherProps {
|
|
10
2
|
locales: readonly string[];
|
|
11
3
|
localeLabels: Record<string, string>;
|
|
@@ -8,14 +8,6 @@ var nextIntl = require('next-intl');
|
|
|
8
8
|
var dropdownMenu = require('../ui/dropdown-menu.js');
|
|
9
9
|
var languageButton = require('../ui/language-button.js');
|
|
10
10
|
|
|
11
|
-
/**
|
|
12
|
-
* @license
|
|
13
|
-
* MIT License
|
|
14
|
-
* Copyright (c) 2026 D8ger
|
|
15
|
-
*
|
|
16
|
-
* This source code is licensed under the MIT license found in the
|
|
17
|
-
* LICENSE file in the root directory of this source tree.
|
|
18
|
-
*/
|
|
19
11
|
function LanguageSwitcher({ locales, localeLabels }) {
|
|
20
12
|
const locale = nextIntl.useLocale();
|
|
21
13
|
const router = navigation.useRouter();
|
|
@@ -6,14 +6,6 @@ import { useLocale } from 'next-intl';
|
|
|
6
6
|
import { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem } from '../ui/dropdown-menu.mjs';
|
|
7
7
|
import { LanguageButton } from '../ui/language-button.mjs';
|
|
8
8
|
|
|
9
|
-
/**
|
|
10
|
-
* @license
|
|
11
|
-
* MIT License
|
|
12
|
-
* Copyright (c) 2026 D8ger
|
|
13
|
-
*
|
|
14
|
-
* This source code is licensed under the MIT license found in the
|
|
15
|
-
* LICENSE file in the root directory of this source tree.
|
|
16
|
-
*/
|
|
17
9
|
function LanguageSwitcher({ locales, localeLabels }) {
|
|
18
10
|
const locale = useLocale();
|
|
19
11
|
const router = useRouter();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { Album, AlignHorizontalJustifyEnd, ArrowLeft, ArrowRight, ArrowUp, Baby, BadgeInfo, BadgeAlert, BadgeCheck, BadgeX, BadgeQuestionMark, Bell, Binary, Blocks, BookX, BookOpen, BookAudio, BookA, BookCheck, BookDown, BookHeadphones, Bookmark, BookmarkCheck, BookmarkMinus, BookmarkPlus, BookmarkX, BotMessageSquare, Brain, BrainCircuit, Briefcase, BringToFront, BrushCleaning, Building2, Bug, BugOff, Car, ChartColumnStacked, Circle, CircleAlert, CircleQuestionMark, CircleSmall, CircleStop, Check, CircleArrowDown, CircleArrowUp, CheckCheck, CheckLine, ChevronDown, ChevronLeft, ChevronRight, ChevronUp, Coffee, Coins, Component, Copy, CopyCheck, Cpu, Database, DatabaseZap, Dot, Download, Ellipsis, EllipsisVertical, Eye, EyeOff, ExternalLink, Facebook, Shield, File, FileDown, FileInput, FileLock2, FileUp, Fingerprint, Folder, FolderOpen, Gem, Gift, GitMerge, GitPullRequestArrow, Globe, GlobeLock, Grip, GripVertical, HandHeart, Handshake, Highlighter, History, HousePlus, Infinity, Info, ImageDown, ImageOff, ImageUp, Keyboard, LandPlot, Languages, Layout, LayoutTemplate, Library, Lightbulb, Link, ListTodo, Loader2, LogIn, LogOut, Mail, MessageCircleMore, MessageCircleCode, MessageSquareDiff, Music4, MoreHorizontal, MousePointerClick, NotepadText, Palette, PanelLeft, PanelsTopLeft, PawPrint, Pencil, Pi, Pin, PinOff, Plus, QrCode, ReceiptText, RefreshCcw, Regex, Replace, Rocket, RotateCcw, Rss, Scale, ScanSearch, Search, Send, SendHorizontal, Settings, Settings2, Share, Sigma, ShieldUser, ShoppingCart, Sprout, SquareDashedBottomCode, SquareTerminal, Server, SplinePointer, Sparkles, Star, Tablets, Terminal, Trash2, Twitter, Usb, UserRoundCheck, Wand2, Workflow, X, Zap, } from "lucide-react";
|
|
@@ -9,9 +9,9 @@ var lucideReact = require('lucide-react');
|
|
|
9
9
|
* in globalLucideIcons.
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
Object.defineProperty(exports, "
|
|
12
|
+
Object.defineProperty(exports, "Album", {
|
|
13
13
|
enumerable: true,
|
|
14
|
-
get: function () { return lucideReact.
|
|
14
|
+
get: function () { return lucideReact.Album; }
|
|
15
15
|
});
|
|
16
16
|
Object.defineProperty(exports, "AlignHorizontalJustifyEnd", {
|
|
17
17
|
enumerable: true,
|
|
@@ -221,9 +221,9 @@ Object.defineProperty(exports, "Coins", {
|
|
|
221
221
|
enumerable: true,
|
|
222
222
|
get: function () { return lucideReact.Coins; }
|
|
223
223
|
});
|
|
224
|
-
Object.defineProperty(exports, "
|
|
224
|
+
Object.defineProperty(exports, "Component", {
|
|
225
225
|
enumerable: true,
|
|
226
|
-
get: function () { return lucideReact.
|
|
226
|
+
get: function () { return lucideReact.Component; }
|
|
227
227
|
});
|
|
228
228
|
Object.defineProperty(exports, "Copy", {
|
|
229
229
|
enumerable: true,
|
|
@@ -401,9 +401,9 @@ Object.defineProperty(exports, "LayoutTemplate", {
|
|
|
401
401
|
enumerable: true,
|
|
402
402
|
get: function () { return lucideReact.LayoutTemplate; }
|
|
403
403
|
});
|
|
404
|
-
Object.defineProperty(exports, "
|
|
404
|
+
Object.defineProperty(exports, "Library", {
|
|
405
405
|
enumerable: true,
|
|
406
|
-
get: function () { return lucideReact.
|
|
406
|
+
get: function () { return lucideReact.Library; }
|
|
407
407
|
});
|
|
408
408
|
Object.defineProperty(exports, "Lightbulb", {
|
|
409
409
|
enumerable: true,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { Album, AlignHorizontalJustifyEnd, ArrowLeft, ArrowRight, ArrowUp, Baby, BadgeAlert, BadgeCheck, BadgeInfo, BadgeQuestionMark, BadgeX, Bell, Binary, Blocks, BookA, BookAudio, BookCheck, BookDown, BookHeadphones, BookOpen, BookX, Bookmark, BookmarkCheck, BookmarkMinus, BookmarkPlus, BookmarkX, BotMessageSquare, Brain, BrainCircuit, Briefcase, BringToFront, BrushCleaning, Bug, BugOff, Building2, Car, ChartColumnStacked, Check, CheckCheck, CheckLine, ChevronDown, ChevronLeft, ChevronRight, ChevronUp, Circle, CircleAlert, CircleArrowDown, CircleArrowUp, CircleQuestionMark, CircleSmall, CircleStop, Coffee, Coins, Component, Copy, CopyCheck, Cpu, Database, DatabaseZap, Dot, Download, Ellipsis, EllipsisVertical, ExternalLink, Eye, EyeOff, Facebook, File, FileDown, FileInput, FileLock2, FileUp, Fingerprint, Folder, FolderOpen, Gem, Gift, GitMerge, GitPullRequestArrow, Globe, GlobeLock, Grip, GripVertical, HandHeart, Handshake, Highlighter, History, HousePlus, ImageDown, ImageOff, ImageUp, Infinity, Info, Keyboard, LandPlot, Languages, Layout, LayoutTemplate, Library, Lightbulb, Link, ListTodo, Loader2, LogIn, LogOut, Mail, MessageCircleCode, MessageCircleMore, MessageSquareDiff, MoreHorizontal, MousePointerClick, Music4, NotepadText, Palette, PanelLeft, PanelsTopLeft, PawPrint, Pencil, Pi, Pin, PinOff, Plus, QrCode, ReceiptText, RefreshCcw, Regex, Replace, Rocket, RotateCcw, Rss, Scale, ScanSearch, Search, Send, SendHorizontal, Server, Settings, Settings2, Share, Shield, ShieldUser, ShoppingCart, Sigma, Sparkles, SplinePointer, Sprout, SquareDashedBottomCode, SquareTerminal, Star, Tablets, Terminal, Trash2, Twitter, Usb, UserRoundCheck, Wand2, Workflow, X, Zap } from 'lucide-react';
|
|
2
2
|
|
|
3
3
|
/*
|
|
4
4
|
* This file re-exports selected icons from 'lucide-react'.
|
package/dist/icons/index.js
CHANGED
|
@@ -36,7 +36,7 @@ var lucideReact = require('lucide-react');
|
|
|
36
36
|
var globalIcon = require('../components/global-icon.js');
|
|
37
37
|
var siteIcon = require('../components/site-icon.js');
|
|
38
38
|
|
|
39
|
-
const AlbumIcon = iconFactory.createGlobalLucideIcon(lucideReact.
|
|
39
|
+
const AlbumIcon = iconFactory.createGlobalLucideIcon(lucideReact.Album, 'AlbumIcon');
|
|
40
40
|
const AlignHorizontalJustifyEndIcon = iconFactory.createGlobalLucideIcon(lucideReact.AlignHorizontalJustifyEnd, 'AlignHorizontalJustifyEndIcon');
|
|
41
41
|
const ArrowLeftIcon = iconFactory.createGlobalLucideIcon(lucideReact.ArrowLeft, 'ArrowLeftIcon');
|
|
42
42
|
const ArrowRightIcon = iconFactory.createGlobalLucideIcon(lucideReact.ArrowRight, 'ArrowRightIcon');
|
|
@@ -89,7 +89,7 @@ const ChevronRightIcon = iconFactory.createGlobalLucideIcon(lucideReact.ChevronR
|
|
|
89
89
|
const ChevronUpIcon = iconFactory.createGlobalLucideIcon(lucideReact.ChevronUp, 'ChevronUpIcon');
|
|
90
90
|
const CoffeeIcon = iconFactory.createGlobalLucideIcon(lucideReact.Coffee, 'CoffeeIcon');
|
|
91
91
|
const CoinsIcon = iconFactory.createGlobalLucideIcon(lucideReact.Coins, 'CoinsIcon');
|
|
92
|
-
const ComponentIcon = iconFactory.createGlobalLucideIcon(lucideReact.
|
|
92
|
+
const ComponentIcon = iconFactory.createGlobalLucideIcon(lucideReact.Component, 'ComponentIcon');
|
|
93
93
|
const CopyIcon = iconFactory.createGlobalLucideIcon(lucideReact.Copy, 'CopyIcon');
|
|
94
94
|
const CopyCheckIcon = iconFactory.createGlobalLucideIcon(lucideReact.CopyCheck, 'CopyCheckIcon');
|
|
95
95
|
const CpuIcon = iconFactory.createGlobalLucideIcon(lucideReact.Cpu, 'CpuIcon');
|
|
@@ -135,7 +135,7 @@ const LandPlotIcon = iconFactory.createGlobalLucideIcon(lucideReact.LandPlot, 'L
|
|
|
135
135
|
const LanguagesIcon = iconFactory.createGlobalLucideIcon(lucideReact.Languages, 'LanguagesIcon');
|
|
136
136
|
const LayoutIcon = iconFactory.createGlobalLucideIcon(lucideReact.Layout, 'LayoutIcon');
|
|
137
137
|
const LayoutTemplateIcon = iconFactory.createGlobalLucideIcon(lucideReact.LayoutTemplate, 'LayoutTemplateIcon');
|
|
138
|
-
const LibraryIcon = iconFactory.createGlobalLucideIcon(lucideReact.
|
|
138
|
+
const LibraryIcon = iconFactory.createGlobalLucideIcon(lucideReact.Library, 'LibraryIcon');
|
|
139
139
|
const LightbulbIcon = iconFactory.createGlobalLucideIcon(lucideReact.Lightbulb, 'LightbulbIcon');
|
|
140
140
|
const LinkIcon = iconFactory.createGlobalLucideIcon(lucideReact.Link, 'LinkIcon');
|
|
141
141
|
const ListTodoIcon = iconFactory.createGlobalLucideIcon(lucideReact.ListTodo, 'ListTodoIcon');
|
package/dist/icons/index.mjs
CHANGED
|
@@ -31,11 +31,11 @@ import XMLIcon$1 from '../assets/xml.mjs';
|
|
|
31
31
|
import YamlIcon$1 from '../assets/yaml.mjs';
|
|
32
32
|
import { createGlobalLucideIcon, createGlobalIcon } from '../components/icon-factory.mjs';
|
|
33
33
|
export { GlobalAccentIcon } from '../components/icon-factory.mjs';
|
|
34
|
-
import { Loader2, ChevronRight, Check, Circle,
|
|
34
|
+
import { Loader2, ChevronRight, Check, Circle, Album, AlignHorizontalJustifyEnd, ArrowLeft, ArrowRight, ArrowUp, Baby, BadgeInfo, BadgeAlert, BadgeCheck, BadgeX, Bell, Binary, Blocks, BookX, BookOpen, BookAudio, BookA, BookCheck, BookDown, BookHeadphones, Bookmark, BookmarkCheck, BookmarkMinus, BookmarkPlus, BookmarkX, BotMessageSquare, Brain, BrainCircuit, Briefcase, BringToFront, BrushCleaning, Building2, Bug, BugOff, BadgeQuestionMark, Car, ChartColumnStacked, CircleAlert, CircleQuestionMark, CircleSmall, CircleStop, CircleArrowDown, CircleArrowUp, CheckCheck, CheckLine, ChevronDown, ChevronLeft, ChevronUp, Coffee, Coins, Component, Copy, CopyCheck, Cpu, Database, DatabaseZap, Dot, Download, Ellipsis, EllipsisVertical, Eye, EyeOff, ExternalLink, Facebook, Shield, File, FileDown, FileInput, FileLock2, FileUp, Fingerprint, Folder, FolderOpen, Gem, Gift, GitMerge, GitPullRequestArrow, Globe, GlobeLock, Grip, GripVertical, HandHeart, Handshake, Highlighter, History, HousePlus, Infinity, Info, ImageDown, ImageOff, ImageUp, Keyboard, LandPlot, Languages, Layout, LayoutTemplate, Library, Lightbulb, Link, ListTodo, LogIn, LogOut, Mail, MessageCircleMore, MessageCircleCode, MessageSquareDiff, Music4, MoreHorizontal, MousePointerClick, NotepadText, Palette, PanelLeft, PanelsTopLeft, PawPrint, Pencil, Pi, Pin, PinOff, Plus, QrCode, ReceiptText, RefreshCcw, Regex, Replace, Rocket, RotateCcw, Rss, Scale, ScanSearch, Search, Send, SendHorizontal, Settings, Settings2, Share, Sigma, ShieldUser, ShoppingCart, Sprout, SquareDashedBottomCode, SquareTerminal, Server, SplinePointer, Sparkles, Star, Tablets, Terminal, Trash2, Twitter, Usb, UserRoundCheck, Wand2, Workflow, X, Zap } from 'lucide-react';
|
|
35
35
|
export { getGlobalIcon, getIconElement, globalLucideIcons } from '../components/global-icon.mjs';
|
|
36
36
|
export { createSiteIcon } from '../components/site-icon.mjs';
|
|
37
37
|
|
|
38
|
-
const AlbumIcon = createGlobalLucideIcon(
|
|
38
|
+
const AlbumIcon = createGlobalLucideIcon(Album, 'AlbumIcon');
|
|
39
39
|
const AlignHorizontalJustifyEndIcon = createGlobalLucideIcon(AlignHorizontalJustifyEnd, 'AlignHorizontalJustifyEndIcon');
|
|
40
40
|
const ArrowLeftIcon = createGlobalLucideIcon(ArrowLeft, 'ArrowLeftIcon');
|
|
41
41
|
const ArrowRightIcon = createGlobalLucideIcon(ArrowRight, 'ArrowRightIcon');
|
|
@@ -88,7 +88,7 @@ const ChevronRightIcon = createGlobalLucideIcon(ChevronRight, 'ChevronRightIcon'
|
|
|
88
88
|
const ChevronUpIcon = createGlobalLucideIcon(ChevronUp, 'ChevronUpIcon');
|
|
89
89
|
const CoffeeIcon = createGlobalLucideIcon(Coffee, 'CoffeeIcon');
|
|
90
90
|
const CoinsIcon = createGlobalLucideIcon(Coins, 'CoinsIcon');
|
|
91
|
-
const ComponentIcon = createGlobalLucideIcon(
|
|
91
|
+
const ComponentIcon = createGlobalLucideIcon(Component, 'ComponentIcon');
|
|
92
92
|
const CopyIcon = createGlobalLucideIcon(Copy, 'CopyIcon');
|
|
93
93
|
const CopyCheckIcon = createGlobalLucideIcon(CopyCheck, 'CopyCheckIcon');
|
|
94
94
|
const CpuIcon = createGlobalLucideIcon(Cpu, 'CpuIcon');
|
|
@@ -134,7 +134,7 @@ const LandPlotIcon = createGlobalLucideIcon(LandPlot, 'LandPlotIcon');
|
|
|
134
134
|
const LanguagesIcon = createGlobalLucideIcon(Languages, 'LanguagesIcon');
|
|
135
135
|
const LayoutIcon = createGlobalLucideIcon(Layout, 'LayoutIcon');
|
|
136
136
|
const LayoutTemplateIcon = createGlobalLucideIcon(LayoutTemplate, 'LayoutTemplateIcon');
|
|
137
|
-
const LibraryIcon = createGlobalLucideIcon(
|
|
137
|
+
const LibraryIcon = createGlobalLucideIcon(Library, 'LibraryIcon');
|
|
138
138
|
const LightbulbIcon = createGlobalLucideIcon(Lightbulb, 'LightbulbIcon');
|
|
139
139
|
const LinkIcon = createGlobalLucideIcon(Link, 'LinkIcon');
|
|
140
140
|
const ListTodoIcon = createGlobalLucideIcon(ListTodo, 'ListTodoIcon');
|
|
@@ -25,14 +25,6 @@ function _interopNamespaceDefault(e) {
|
|
|
25
25
|
|
|
26
26
|
var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
|
|
27
27
|
|
|
28
|
-
/**
|
|
29
|
-
* @license
|
|
30
|
-
* MIT License
|
|
31
|
-
* Copyright (c) 2026 D8ger
|
|
32
|
-
*
|
|
33
|
-
* This source code is licensed under the MIT license found in the
|
|
34
|
-
* LICENSE file in the root directory of this source tree.
|
|
35
|
-
*/
|
|
36
28
|
const LanguageButton = React__namespace.forwardRef((_a, ref) => {
|
|
37
29
|
var { className, variant = "default", size = "default" } = _a, props = tslib.__rest(_a, ["className", "variant", "size"]);
|
|
38
30
|
return (jsxRuntime.jsx("button", Object.assign({ className: utils.cn("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", {
|
|
@@ -4,14 +4,6 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { cn } from '@windrun-huaiin/lib/utils';
|
|
6
6
|
|
|
7
|
-
/**
|
|
8
|
-
* @license
|
|
9
|
-
* MIT License
|
|
10
|
-
* Copyright (c) 2026 D8ger
|
|
11
|
-
*
|
|
12
|
-
* This source code is licensed under the MIT license found in the
|
|
13
|
-
* LICENSE file in the root directory of this source tree.
|
|
14
|
-
*/
|
|
15
7
|
const LanguageButton = React.forwardRef((_a, ref) => {
|
|
16
8
|
var { className, variant = "default", size = "default" } = _a, props = __rest(_a, ["className", "variant", "size"]);
|
|
17
9
|
return (jsx("button", Object.assign({ className: cn("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", {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@windrun-huaiin/base-ui",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "21.0.0",
|
|
4
4
|
"description": "Base UI components for windrun-huaiin projects",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"class-variance-authority": "^0.7.1",
|
|
55
55
|
"lucide-react": "^0.577.0",
|
|
56
56
|
"tslib": "^2.8.1",
|
|
57
|
-
"@windrun-huaiin/lib": "^
|
|
57
|
+
"@windrun-huaiin/lib": "^21.0.0"
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
60
60
|
"clsx": "^2.1.1",
|
|
@@ -65,6 +65,24 @@ export const globalLucideIcons = {
|
|
|
65
65
|
// Use a safe fallback that we know exists in both Lucide and custom icons
|
|
66
66
|
const DEFAULT_FALLBACK_ICON = 'Sparkles' as keyof typeof globalLucideIcons;
|
|
67
67
|
|
|
68
|
+
function resolveIconKey(iconKey: string): keyof typeof globalLucideIcons | undefined {
|
|
69
|
+
const trimmedKey = iconKey.trim();
|
|
70
|
+
if (trimmedKey === '') return undefined;
|
|
71
|
+
|
|
72
|
+
const candidates = [
|
|
73
|
+
trimmedKey,
|
|
74
|
+
trimmedKey.endsWith('Icon') ? trimmedKey.slice(0, -4) : `${trimmedKey}Icon`,
|
|
75
|
+
];
|
|
76
|
+
|
|
77
|
+
for (const candidate of candidates) {
|
|
78
|
+
if (candidate in globalLucideIcons) {
|
|
79
|
+
return candidate as keyof typeof globalLucideIcons;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
return undefined;
|
|
84
|
+
}
|
|
85
|
+
|
|
68
86
|
/**
|
|
69
87
|
* use iconKey to load icon safely
|
|
70
88
|
* @param iconKey translation or configuration
|
|
@@ -89,7 +107,8 @@ export function getGlobalIcon(
|
|
|
89
107
|
return globalLucideIcons[DEFAULT_FALLBACK_ICON] as IconComponent;
|
|
90
108
|
}
|
|
91
109
|
|
|
92
|
-
const
|
|
110
|
+
const resolvedIconKey = resolveIconKey(iconKey);
|
|
111
|
+
const Icon = resolvedIconKey ? globalLucideIcons[resolvedIconKey] : undefined;
|
|
93
112
|
if (!Icon) {
|
|
94
113
|
if (typeof process !== 'undefined' && process.env?.NODE_ENV !== 'production') {
|
|
95
114
|
// only show in dev|test
|
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* MIT License
|
|
4
|
-
* Copyright (c) 2026 D8ger
|
|
5
|
-
*
|
|
6
|
-
* This source code is licensed under the MIT license found in the
|
|
7
|
-
* LICENSE file in the root directory of this source tree.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
1
|
'use client'
|
|
11
2
|
|
|
12
3
|
import { GlobeIcon } from '@base-ui/icons'
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* in globalLucideIcons.
|
|
6
6
|
*/
|
|
7
7
|
export {
|
|
8
|
-
|
|
8
|
+
Album,
|
|
9
9
|
AlignHorizontalJustifyEnd,
|
|
10
10
|
ArrowLeft,
|
|
11
11
|
ArrowRight,
|
|
@@ -58,7 +58,7 @@ export {
|
|
|
58
58
|
ChevronUp,
|
|
59
59
|
Coffee,
|
|
60
60
|
Coins,
|
|
61
|
-
|
|
61
|
+
Component,
|
|
62
62
|
Copy,
|
|
63
63
|
CopyCheck,
|
|
64
64
|
Cpu,
|
|
@@ -104,7 +104,7 @@ export {
|
|
|
104
104
|
Languages,
|
|
105
105
|
Layout,
|
|
106
106
|
LayoutTemplate,
|
|
107
|
-
|
|
107
|
+
Library,
|
|
108
108
|
Lightbulb,
|
|
109
109
|
Link,
|
|
110
110
|
ListTodo,
|
package/src/icons/index.ts
CHANGED
|
@@ -31,7 +31,7 @@ import RawXMLIcon from '@base-ui/assets/xml';
|
|
|
31
31
|
import RawYamlIcon from '@base-ui/assets/yaml';
|
|
32
32
|
import { createGlobalIcon, createGlobalLucideIcon } from '@base-ui/components/icon-factory';
|
|
33
33
|
import {
|
|
34
|
-
|
|
34
|
+
Album as RawAlbumIcon,
|
|
35
35
|
AlignHorizontalJustifyEnd as RawAlignHorizontalJustifyEnd,
|
|
36
36
|
ArrowLeft as RawArrowLeft,
|
|
37
37
|
ArrowRight as RawArrowRight,
|
|
@@ -84,7 +84,7 @@ import {
|
|
|
84
84
|
CircleStop as RawCircleStop,
|
|
85
85
|
Coffee as RawCoffee,
|
|
86
86
|
Coins as RawCoins,
|
|
87
|
-
|
|
87
|
+
Component as RawComponentIcon,
|
|
88
88
|
Copy as RawCopy,
|
|
89
89
|
CopyCheck as RawCopyCheck,
|
|
90
90
|
Cpu as RawCpu,
|
|
@@ -129,7 +129,7 @@ import {
|
|
|
129
129
|
Languages as RawLanguages,
|
|
130
130
|
Layout as RawLayout,
|
|
131
131
|
LayoutTemplate as RawLayoutTemplate,
|
|
132
|
-
|
|
132
|
+
Library as RawLibraryIcon,
|
|
133
133
|
Lightbulb as RawLightbulb,
|
|
134
134
|
Link as RawLink,
|
|
135
135
|
ListTodo as RawListTodo,
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* MIT License
|
|
4
|
-
* Copyright (c) 2026 D8ger
|
|
5
|
-
*
|
|
6
|
-
* This source code is licensed under the MIT license found in the
|
|
7
|
-
* LICENSE file in the root directory of this source tree.
|
|
8
|
-
*/
|
|
9
1
|
"use client";
|
|
10
2
|
import * as React from "react"
|
|
11
3
|
import { cn } from "@windrun-huaiin/lib/utils"
|