nfx-ui 0.1.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/README.md +235 -0
- package/dist/animations.cjs +3 -0
- package/dist/animations.d.ts +102 -0
- package/dist/animations.mjs +14 -0
- package/dist/apis.cjs +5 -0
- package/dist/apis.cjs.map +1 -0
- package/dist/apis.d.ts +7 -0
- package/dist/apis.mjs +18 -0
- package/dist/apis.mjs.map +1 -0
- package/dist/chunk-BounceLoading-B54QEw0n.mjs +244 -0
- package/dist/chunk-BounceLoading-B54QEw0n.mjs.map +1 -0
- package/dist/chunk-BounceLoading-C6n4BZVJ.cjs +11 -0
- package/dist/chunk-BounceLoading-C6n4BZVJ.cjs.map +1 -0
- package/dist/chunk-animations-Brp-bsaE.mjs +1243 -0
- package/dist/chunk-animations-Brp-bsaE.mjs.map +1 -0
- package/dist/chunk-animations-e2F3zuP9.cjs +190 -0
- package/dist/chunk-animations-e2F3zuP9.cjs.map +1 -0
- package/dist/chunk-chunk-BFrxaqQT.cjs +1 -0
- package/dist/chunk-i18n-Bp6pPM9n.mjs +207 -0
- package/dist/chunk-i18n-Bp6pPM9n.mjs.map +1 -0
- package/dist/chunk-i18n-_7W7guSV.cjs +3 -0
- package/dist/chunk-i18n-_7W7guSV.cjs.map +1 -0
- package/dist/chunk-lstorage-BVCD00Ow.mjs +27 -0
- package/dist/chunk-lstorage-BVCD00Ow.mjs.map +1 -0
- package/dist/chunk-lstorage-BnxLXHgH.cjs +3 -0
- package/dist/chunk-lstorage-BnxLXHgH.cjs.map +1 -0
- package/dist/chunk-lucide-BhgnmTNo.mjs +158 -0
- package/dist/chunk-lucide-BhgnmTNo.mjs.map +1 -0
- package/dist/chunk-lucide-CP2lvOPY.cjs +3 -0
- package/dist/chunk-lucide-CP2lvOPY.cjs.map +1 -0
- package/dist/chunk-preference-CYl68oeU.cjs +3 -0
- package/dist/chunk-preference-CYl68oeU.cjs.map +1 -0
- package/dist/chunk-preference-DImtu5jI.mjs +51 -0
- package/dist/chunk-preference-DImtu5jI.mjs.map +1 -0
- package/dist/chunk-types-BE3JCLff.cjs +3 -0
- package/dist/chunk-types-BE3JCLff.cjs.map +1 -0
- package/dist/chunk-types-BkFxelHl.mjs +20 -0
- package/dist/chunk-types-BkFxelHl.mjs.map +1 -0
- package/dist/chunk-types-C_opkZGr.cjs +3 -0
- package/dist/chunk-types-C_opkZGr.cjs.map +1 -0
- package/dist/chunk-types-CkbZrFqZ.cjs +3 -0
- package/dist/chunk-types-CkbZrFqZ.cjs.map +1 -0
- package/dist/chunk-types-DNPBKfmx.mjs +11 -0
- package/dist/chunk-types-DNPBKfmx.mjs.map +1 -0
- package/dist/chunk-types-SD4MzUGp.mjs +11 -0
- package/dist/chunk-types-SD4MzUGp.mjs.map +1 -0
- package/dist/chunk-useLayout-BAJHOIL3.cjs +3 -0
- package/dist/chunk-useLayout-BAJHOIL3.cjs.map +1 -0
- package/dist/chunk-useLayout-DPxlynT-.mjs +12 -0
- package/dist/chunk-useLayout-DPxlynT-.mjs.map +1 -0
- package/dist/chunk-useTheme-DgleVMMh.cjs +3 -0
- package/dist/chunk-useTheme-DgleVMMh.cjs.map +1 -0
- package/dist/chunk-useTheme-oHcq3d0o.mjs +13 -0
- package/dist/chunk-useTheme-oHcq3d0o.mjs.map +1 -0
- package/dist/components.cjs +8 -0
- package/dist/components.cjs.map +1 -0
- package/dist/components.d.ts +411 -0
- package/dist/components.mjs +1688 -0
- package/dist/components.mjs.map +1 -0
- package/dist/constants.cjs +5 -0
- package/dist/constants.cjs.map +1 -0
- package/dist/constants.d.ts +130 -0
- package/dist/constants.mjs +85 -0
- package/dist/constants.mjs.map +1 -0
- package/dist/events.cjs +5 -0
- package/dist/events.cjs.map +1 -0
- package/dist/events.d.ts +66 -0
- package/dist/events.mjs +31 -0
- package/dist/events.mjs.map +1 -0
- package/dist/hooks.cjs +5 -0
- package/dist/hooks.cjs.map +1 -0
- package/dist/hooks.d.ts +316 -0
- package/dist/hooks.mjs +107 -0
- package/dist/hooks.mjs.map +1 -0
- package/dist/icons.cjs +3 -0
- package/dist/icons.d.ts +218 -0
- package/dist/icons.mjs +76 -0
- package/dist/languages.cjs +5 -0
- package/dist/languages.cjs.map +1 -0
- package/dist/languages.d.ts +174 -0
- package/dist/languages.mjs +112 -0
- package/dist/languages.mjs.map +1 -0
- package/dist/layouts.cjs +5 -0
- package/dist/layouts.cjs.map +1 -0
- package/dist/layouts.d.ts +209 -0
- package/dist/layouts.mjs +460 -0
- package/dist/layouts.mjs.map +1 -0
- package/dist/navigations.cjs +5 -0
- package/dist/navigations.cjs.map +1 -0
- package/dist/navigations.d.ts +72 -0
- package/dist/navigations.mjs +30 -0
- package/dist/navigations.mjs.map +1 -0
- package/dist/preference.cjs +3 -0
- package/dist/preference.d.ts +94 -0
- package/dist/preference.mjs +14 -0
- package/dist/services.cjs +5 -0
- package/dist/services.cjs.map +1 -0
- package/dist/services.d.ts +8 -0
- package/dist/services.mjs +26 -0
- package/dist/services.mjs.map +1 -0
- package/dist/stores.cjs +5 -0
- package/dist/stores.cjs.map +1 -0
- package/dist/stores.d.ts +101 -0
- package/dist/stores.mjs +167 -0
- package/dist/stores.mjs.map +1 -0
- package/dist/themes.cjs +5 -0
- package/dist/themes.cjs.map +1 -0
- package/dist/themes.d.ts +229 -0
- package/dist/themes.mjs +894 -0
- package/dist/themes.mjs.map +1 -0
- package/dist/types.cjs +2 -0
- package/dist/types.d.ts +147 -0
- package/dist/types.mjs +2 -0
- package/dist/utils.cjs +5 -0
- package/dist/utils.cjs.map +1 -0
- package/dist/utils.d.ts +374 -0
- package/dist/utils.mjs +293 -0
- package/dist/utils.mjs.map +1 -0
- package/package.json +196 -0
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import { Context } from 'react';
|
|
2
|
+
import { JSX } from 'react/jsx-runtime';
|
|
3
|
+
import { MemoExoticComponent } from 'react';
|
|
4
|
+
import { ReactNode } from 'react';
|
|
5
|
+
import { SidebarProps as SidebarProps_2 } from 'react-pro-sidebar';
|
|
6
|
+
|
|
7
|
+
/** 与 NFX-Identity/console 一致:仪表盘背景由用户偏好(可外部传入或从 profile 解析) */
|
|
8
|
+
export declare const Background: MemoExoticComponent<({ children, background }: BackgroundProps) => JSX.Element>;
|
|
9
|
+
|
|
10
|
+
declare interface BackgroundProps {
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
/** 可选:外部传入的偏好,有则优先使用;否则从 profile.preference 解析。Optional: preference from parent; otherwise parsed from profile. */
|
|
13
|
+
background?: DashboardBackgroundEnum | null;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/** 仪表盘背景枚举。Dashboard background enum. */
|
|
17
|
+
declare enum DashboardBackgroundEnum {
|
|
18
|
+
NONE = "none",
|
|
19
|
+
WAVES = "waves",
|
|
20
|
+
SQUARES = "squares",
|
|
21
|
+
LETTER_GLITCH = "letterGlitch",
|
|
22
|
+
PIXEL_BLAST = "pixelBlast"
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export declare const DEFAULT_LAYOUT_MODE = LayoutModeEnum.SHOW;
|
|
26
|
+
|
|
27
|
+
/** 通用 Footer:只负责布局与样式,内容由外部传入。 */
|
|
28
|
+
export declare const Footer: MemoExoticComponent<({ children, className }: FooterProps) => JSX.Element>;
|
|
29
|
+
|
|
30
|
+
/** Footer props. */
|
|
31
|
+
export declare interface FooterProps {
|
|
32
|
+
/** 页脚内容由使用方传入。Footer content passed from parent. */
|
|
33
|
+
children?: ReactNode;
|
|
34
|
+
className?: string;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export declare function getLayoutStorage(): Nilable<string>;
|
|
38
|
+
|
|
39
|
+
/** 通用 Header:只负责布局左右两栏,内容全部由外部传入,内部不获取数据。Generic header: layout only; all content from props. */
|
|
40
|
+
export declare const Header: MemoExoticComponent<({ leftContent, rightContent }: HeaderProps) => JSX.Element>;
|
|
41
|
+
|
|
42
|
+
/** Header props. */
|
|
43
|
+
export declare interface HeaderProps {
|
|
44
|
+
/** 左侧内容(如 Logo、SlideDownSwitcher 等),由使用方传入。Left slot; passed from parent. */
|
|
45
|
+
leftContent?: ReactNode;
|
|
46
|
+
/** 右侧内容(如语言切换、用户菜单等),由使用方传入。Right slot; passed from parent. */
|
|
47
|
+
rightContent?: ReactNode;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export declare const LAYOUT_MODE_VALUES: LayoutModeEnum[];
|
|
51
|
+
|
|
52
|
+
export declare const LAYOUT_STORAGE_KEY = "layout-storage";
|
|
53
|
+
|
|
54
|
+
export declare const LayoutContext: Context<LayoutContextType | undefined>;
|
|
55
|
+
|
|
56
|
+
/** useLayout 返回值类型。Return type of useLayout. */
|
|
57
|
+
export declare interface LayoutContextType {
|
|
58
|
+
/** 侧栏是否展开。Whether sidebar is open. */
|
|
59
|
+
sidebarOpen: boolean;
|
|
60
|
+
/** 当前布局模式(显示/隐藏)。Current layout mode (show/hide). */
|
|
61
|
+
layoutMode: LayoutModeEnum;
|
|
62
|
+
setSidebarOpen: (open: boolean) => void;
|
|
63
|
+
toggleSidebar: () => void;
|
|
64
|
+
closeSidebar: () => void;
|
|
65
|
+
setLayoutMode: (mode: LayoutModeEnum) => void;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export declare const LayoutFrame: MemoExoticComponent<({ children, headerLeft, headerRight, footerContent, sidebarItems, sidebarCurrentPathname, onSidebarNavigate, sidebarLogoutLabel, onSidebarLogout, bottomLogoutButton, }: LayoutFrameProps) => JSX.Element>;
|
|
69
|
+
|
|
70
|
+
/** LayoutFrame props. */
|
|
71
|
+
export declare interface LayoutFrameProps {
|
|
72
|
+
children: ReactNode;
|
|
73
|
+
/** 可选:Header 左侧内容(如 Logo、SlideDownSwitcher),使用方传入。Optional: header left slot. */
|
|
74
|
+
headerLeft?: ReactNode;
|
|
75
|
+
/** 可选:Header 右侧内容(如语言、用户菜单),使用方传入。Optional: header right slot. */
|
|
76
|
+
headerRight?: ReactNode;
|
|
77
|
+
/** 可选:Footer 内容(children),使用方传入。Optional: footer content. */
|
|
78
|
+
footerContent?: ReactNode;
|
|
79
|
+
/** 可选:侧栏菜单项。Optional: sidebar menu items. */
|
|
80
|
+
sidebarItems?: SidebarMenuItem[];
|
|
81
|
+
/** 可选:当前路径,用于高亮。传 useLocation().pathname。Optional: current pathname for active state. */
|
|
82
|
+
sidebarCurrentPathname?: string;
|
|
83
|
+
/** 可选:点击菜单项时调用。Optional: called when a sidebar item is clicked. */
|
|
84
|
+
onSidebarNavigate?: (path: string) => void;
|
|
85
|
+
/** 可选:侧栏底部登出按钮文案。Optional: logout button label. */
|
|
86
|
+
sidebarLogoutLabel?: string;
|
|
87
|
+
/** 可选:侧栏登出回调。Optional: logout handler. */
|
|
88
|
+
onSidebarLogout?: () => void;
|
|
89
|
+
/** 可选:侧栏底部登出按钮。Optional: bottom logout button. */
|
|
90
|
+
bottomLogoutButton?: ReactNode;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* 布局模式枚举与常量。Layout mode enum and constants.
|
|
95
|
+
*/
|
|
96
|
+
export declare enum LayoutModeEnum {
|
|
97
|
+
SHOW = "show",
|
|
98
|
+
HIDE = "hide"
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export declare const LayoutProvider: MemoExoticComponent<({ children, defaultLayoutMode }: LayoutProviderProps) => JSX.Element>;
|
|
102
|
+
|
|
103
|
+
/** 布局 Provider 的 props。LayoutProvider props. */
|
|
104
|
+
export declare interface LayoutProviderProps {
|
|
105
|
+
/** 子节点。Children. */
|
|
106
|
+
children: ReactNode;
|
|
107
|
+
/** 默认布局模式(显示/隐藏侧栏)。Default layout mode (show/hide sidebar). */
|
|
108
|
+
defaultLayoutMode?: LayoutModeEnum;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/** 布局切换器 props。LayoutSwitcher props. */
|
|
112
|
+
export declare interface LayoutSwitcherProps {
|
|
113
|
+
/** 样式状态。Visual status. */
|
|
114
|
+
status?: "primary" | "default";
|
|
115
|
+
/** 显示模式标签(未传 getLayoutDisplayName 且无内置翻译时使用)。Show mode label. */
|
|
116
|
+
showLabel?: string;
|
|
117
|
+
/** 隐藏模式标签(未传 getLayoutDisplayName 且无内置翻译时使用)。Hide mode label. */
|
|
118
|
+
hideLabel?: string;
|
|
119
|
+
/** 根据布局模式返回展示名;未传则使用 showLabel / hideLabel。Display name for layout mode; default uses showLabel/hideLabel. */
|
|
120
|
+
getLayoutDisplayName?: (mode: LayoutModeEnum) => string;
|
|
121
|
+
/** 处理布局模式改变。Handle layout mode change. */
|
|
122
|
+
handleChangeLayoutMode?: (mode: LayoutModeEnum) => void;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export declare const MainWrapper: MemoExoticComponent<({ children, headerLeft, headerRight, footerContent }: MainWrapperProps) => JSX.Element>;
|
|
126
|
+
|
|
127
|
+
/** MainWrapper props. */
|
|
128
|
+
export declare interface MainWrapperProps {
|
|
129
|
+
children: (headerHeight: number, footerHeight: number) => ReactNode;
|
|
130
|
+
headerLeft?: ReactNode;
|
|
131
|
+
headerRight?: ReactNode;
|
|
132
|
+
footerContent?: ReactNode;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* 可为 null 或 undefined。T | null | undefined.
|
|
137
|
+
* @example Nilable<boolean> => boolean | null | undefined
|
|
138
|
+
*/
|
|
139
|
+
declare type Nilable<T> = T | null | undefined;
|
|
140
|
+
|
|
141
|
+
export declare function removeLayoutStorage(): void;
|
|
142
|
+
|
|
143
|
+
export declare function setLayoutStorage(value: string): void;
|
|
144
|
+
|
|
145
|
+
export declare const Sidebar: MemoExoticComponent<({ children, collapsed, toggled, onBackdropClick, breakPoint, className, items, currentPathname, onNavigate, logoutLabel, handleLogout, bottomLogoutButton, }: SidebarProps) => JSX.Element>;
|
|
146
|
+
|
|
147
|
+
/** 侧栏菜单项。Sidebar menu item. */
|
|
148
|
+
export declare interface SidebarMenuItem {
|
|
149
|
+
label: string;
|
|
150
|
+
path: string;
|
|
151
|
+
icon: ReactNode;
|
|
152
|
+
/** Sub-items for SubMenu. Omit for a leaf item. */
|
|
153
|
+
children?: SidebarMenuItem[];
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/** Sidebar props(扩展 react-pro-sidebar). */
|
|
157
|
+
export declare interface SidebarProps extends SidebarProps_2 {
|
|
158
|
+
children?: ReactNode;
|
|
159
|
+
collapsed?: boolean;
|
|
160
|
+
toggled?: boolean;
|
|
161
|
+
onBackdropClick?: () => void;
|
|
162
|
+
className?: string;
|
|
163
|
+
/** Menu items. Rendered when no children. */
|
|
164
|
+
items?: SidebarMenuItem[];
|
|
165
|
+
/** Current pathname for active state. Pass from useLocation().pathname. */
|
|
166
|
+
currentPathname?: string;
|
|
167
|
+
/** Called when a menu item is clicked. Parent should navigate to path. */
|
|
168
|
+
onNavigate?: (path: string) => void;
|
|
169
|
+
/** Logout label. */
|
|
170
|
+
logoutLabel?: string;
|
|
171
|
+
/** Handle logout. */
|
|
172
|
+
handleLogout?: () => void;
|
|
173
|
+
/** Bottom Logout Button. */
|
|
174
|
+
bottomLogoutButton?: ReactNode;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
export declare const SideHideLayout: MemoExoticComponent<({ children, headerHeight, footerHeight, sidebarItems, sidebarCurrentPathname, onSidebarNavigate, sidebarLogoutLabel, onSidebarLogout, }: SideHideLayoutProps) => JSX.Element>;
|
|
178
|
+
|
|
179
|
+
/** SideHideLayout props. */
|
|
180
|
+
export declare interface SideHideLayoutProps {
|
|
181
|
+
children: ReactNode;
|
|
182
|
+
headerHeight: number;
|
|
183
|
+
footerHeight: number;
|
|
184
|
+
sidebarItems?: SidebarMenuItem[];
|
|
185
|
+
sidebarCurrentPathname?: string;
|
|
186
|
+
onSidebarNavigate?: (path: string) => void;
|
|
187
|
+
sidebarLogoutLabel?: string;
|
|
188
|
+
onSidebarLogout?: () => void;
|
|
189
|
+
bottomLogoutButton?: ReactNode;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
export declare const SideShowLayout: MemoExoticComponent<({ children, headerHeight, footerHeight, sidebarItems, sidebarCurrentPathname, onSidebarNavigate, sidebarLogoutLabel, onSidebarLogout, }: SideShowLayoutProps) => JSX.Element>;
|
|
193
|
+
|
|
194
|
+
/** SideShowLayout props. */
|
|
195
|
+
export declare interface SideShowLayoutProps {
|
|
196
|
+
children: ReactNode;
|
|
197
|
+
headerHeight: number;
|
|
198
|
+
footerHeight: number;
|
|
199
|
+
sidebarItems?: SidebarMenuItem[];
|
|
200
|
+
sidebarCurrentPathname?: string;
|
|
201
|
+
onSidebarNavigate?: (path: string) => void;
|
|
202
|
+
sidebarLogoutLabel?: string;
|
|
203
|
+
onSidebarLogout?: () => void;
|
|
204
|
+
bottomLogoutButton?: ReactNode;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
export declare const useLayout: () => LayoutContextType;
|
|
208
|
+
|
|
209
|
+
export { }
|