@inf-monkeys-tech/monkeys-design 0.4.46 → 0.4.47
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/layout/index.d.mts +125 -3
- package/dist/components/layout/index.d.ts +125 -3
- package/dist/components/layout/index.js +3925 -12
- package/dist/components/layout/index.js.map +1 -1
- package/dist/components/layout/index.mjs +3924 -13
- package/dist/components/layout/index.mjs.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1042 -70
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1040 -70
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,80 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
+
import { c as BaseAppearance } from '../../types-Bn6PEDsX.mjs';
|
|
4
|
+
import '@radix-ui/react-context-menu';
|
|
5
|
+
|
|
6
|
+
type UserAccountMenuRadius = 'default' | 'none' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
|
|
7
|
+
type UserAccountMenuSide = 'top' | 'right' | 'bottom' | 'left';
|
|
8
|
+
type UserAccountMenuTriggerVariant = 'avatar' | 'profile';
|
|
9
|
+
interface UserAccountMenuUser {
|
|
10
|
+
avatarAlt?: string;
|
|
11
|
+
avatarUrl?: string;
|
|
12
|
+
initials?: string;
|
|
13
|
+
name?: string;
|
|
14
|
+
secondaryText?: ReactNode;
|
|
15
|
+
}
|
|
16
|
+
interface UserAccountMenuSelectorOption {
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
icon?: ReactNode;
|
|
19
|
+
label: ReactNode;
|
|
20
|
+
value: string;
|
|
21
|
+
}
|
|
22
|
+
interface UserAccountMenuSelectorConfig {
|
|
23
|
+
contentWidthClassName?: string;
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
id?: string;
|
|
26
|
+
icon?: ReactNode;
|
|
27
|
+
label: ReactNode;
|
|
28
|
+
onChange?: (value: string) => void;
|
|
29
|
+
options: UserAccountMenuSelectorOption[];
|
|
30
|
+
value: string;
|
|
31
|
+
visible?: boolean;
|
|
32
|
+
}
|
|
33
|
+
interface UserAccountMenuItem {
|
|
34
|
+
disabled?: boolean;
|
|
35
|
+
icon?: ReactNode;
|
|
36
|
+
id: string;
|
|
37
|
+
label: ReactNode;
|
|
38
|
+
onSelect?: () => void;
|
|
39
|
+
separatorBefore?: boolean;
|
|
40
|
+
shortcut?: ReactNode;
|
|
41
|
+
tone?: 'default' | 'danger';
|
|
42
|
+
visible?: boolean;
|
|
43
|
+
}
|
|
44
|
+
interface UserAccountMenuClassNames {
|
|
45
|
+
avatar?: string;
|
|
46
|
+
content?: string;
|
|
47
|
+
dangerItem?: string;
|
|
48
|
+
item?: string;
|
|
49
|
+
itemIcon?: string;
|
|
50
|
+
label?: string;
|
|
51
|
+
root?: string;
|
|
52
|
+
secondaryText?: string;
|
|
53
|
+
separator?: string;
|
|
54
|
+
subContent?: string;
|
|
55
|
+
subTrigger?: string;
|
|
56
|
+
trigger?: string;
|
|
57
|
+
userName?: string;
|
|
58
|
+
}
|
|
59
|
+
interface UserAccountMenuProps {
|
|
60
|
+
align?: 'start' | 'center' | 'end';
|
|
61
|
+
appearance?: BaseAppearance;
|
|
62
|
+
ariaLabel?: string;
|
|
63
|
+
className?: string;
|
|
64
|
+
classNames?: UserAccountMenuClassNames;
|
|
65
|
+
contentWidthClassName?: string;
|
|
66
|
+
fallbackName?: string;
|
|
67
|
+
items?: UserAccountMenuItem[];
|
|
68
|
+
menuRadius?: UserAccountMenuRadius;
|
|
69
|
+
selectors?: UserAccountMenuSelectorConfig[];
|
|
70
|
+
side?: UserAccountMenuSide;
|
|
71
|
+
sideOffset?: number;
|
|
72
|
+
triggerEndIcon?: ReactNode;
|
|
73
|
+
triggerTitle?: string;
|
|
74
|
+
triggerVariant?: UserAccountMenuTriggerVariant;
|
|
75
|
+
user: UserAccountMenuUser;
|
|
76
|
+
}
|
|
77
|
+
declare function UserAccountMenu({ align, appearance, ariaLabel, className, classNames, contentWidthClassName, fallbackName, items, menuRadius, selectors, side, sideOffset, triggerEndIcon, triggerTitle, triggerVariant, user, }: UserAccountMenuProps): react_jsx_runtime.JSX.Element;
|
|
3
78
|
|
|
4
79
|
declare function cn(...inputs: (string | undefined | null | false)[]): string;
|
|
5
80
|
interface NavButtonProps {
|
|
@@ -89,9 +164,9 @@ interface AppSidebarProps {
|
|
|
89
164
|
declare function AppSidebar({ logo, navItems, activeItemId, onNavigate, account, onLogout, logoutLabel, footer, defaultExpandedGroups, className, }: AppSidebarProps): react_jsx_runtime.JSX.Element;
|
|
90
165
|
interface AppLayoutProps {
|
|
91
166
|
/** header 组件 */
|
|
92
|
-
header
|
|
167
|
+
header?: ReactNode;
|
|
93
168
|
/** sidebar 组件 */
|
|
94
|
-
sidebar
|
|
169
|
+
sidebar?: ReactNode;
|
|
95
170
|
/** 主内容 */
|
|
96
171
|
children: ReactNode;
|
|
97
172
|
/** 是否 flush 布局(无内边距) */
|
|
@@ -99,5 +174,52 @@ interface AppLayoutProps {
|
|
|
99
174
|
className?: string;
|
|
100
175
|
}
|
|
101
176
|
declare function AppLayout({ header, sidebar, children, flush, className }: AppLayoutProps): react_jsx_runtime.JSX.Element;
|
|
177
|
+
type NavigationMode = 'sidebar' | 'headbar';
|
|
178
|
+
type HeadbarLayoutMode = 'boxed' | 'full-bleed';
|
|
179
|
+
type HeadbarMenuRadius = 'default' | 'none' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
|
|
180
|
+
type HeadbarNavPosition = 'left' | 'center' | 'right';
|
|
181
|
+
interface LayoutNavItem {
|
|
182
|
+
id: string;
|
|
183
|
+
label: ReactNode;
|
|
184
|
+
headbarLabel?: ReactNode;
|
|
185
|
+
icon?: ReactNode;
|
|
186
|
+
children?: LayoutNavItem[];
|
|
187
|
+
}
|
|
188
|
+
interface HeadbarLayout {
|
|
189
|
+
brandTitle?: ReactNode;
|
|
190
|
+
heightPx?: number;
|
|
191
|
+
layoutMode?: HeadbarLayoutMode;
|
|
192
|
+
menuRadius?: HeadbarMenuRadius;
|
|
193
|
+
navPosition?: HeadbarNavPosition;
|
|
194
|
+
}
|
|
195
|
+
interface NavigationLayoutProps {
|
|
196
|
+
activeItemId?: string;
|
|
197
|
+
activeRootId?: string;
|
|
198
|
+
allowModeSwitch?: boolean;
|
|
199
|
+
accountMenu?: ReactNode;
|
|
200
|
+
children: ReactNode;
|
|
201
|
+
className?: string;
|
|
202
|
+
collapsedSidebarAccountMenu?: ReactNode;
|
|
203
|
+
collapsedSidebarWidth?: string;
|
|
204
|
+
defaultMode?: NavigationMode;
|
|
205
|
+
defaultSidebarCollapsed?: boolean;
|
|
206
|
+
expandedSidebarWidth?: string;
|
|
207
|
+
flush?: boolean;
|
|
208
|
+
headbarActions?: ReactNode;
|
|
209
|
+
headbarLayout?: HeadbarLayout;
|
|
210
|
+
logo?: AppHeaderLogo;
|
|
211
|
+
mode?: NavigationMode;
|
|
212
|
+
navItems: LayoutNavItem[];
|
|
213
|
+
onModeChange?: (mode: NavigationMode) => void;
|
|
214
|
+
onNavigate?: (itemId: string) => void;
|
|
215
|
+
onSidebarCollapsedChange?: (collapsed: boolean) => void;
|
|
216
|
+
renderHeadbarExtra?: ReactNode;
|
|
217
|
+
sidebarAccountMenu?: ReactNode;
|
|
218
|
+
sidebarFooter?: ReactNode;
|
|
219
|
+
sidebarHeader?: ReactNode;
|
|
220
|
+
switchToHeadbarLabel?: string;
|
|
221
|
+
switchToSidebarLabel?: string;
|
|
222
|
+
}
|
|
223
|
+
declare function NavigationLayout({ activeItemId, activeRootId, allowModeSwitch, accountMenu, children, className, collapsedSidebarAccountMenu, collapsedSidebarWidth, defaultMode, defaultSidebarCollapsed, expandedSidebarWidth, flush, headbarActions, headbarLayout, logo, mode, navItems, onModeChange, onNavigate, onSidebarCollapsedChange, renderHeadbarExtra, sidebarAccountMenu, sidebarFooter, sidebarHeader, switchToHeadbarLabel, switchToSidebarLabel, }: NavigationLayoutProps): react_jsx_runtime.JSX.Element;
|
|
102
224
|
|
|
103
|
-
export { AppHeader, type AppHeaderLogo, type AppHeaderProps, type AppHeaderUser, AppLayout, type AppLayoutProps, AppSidebar, type AppSidebarProps, type HeaderTab, NavButton, type NavButtonProps, type SidebarAccount, type SidebarNavItem, cn };
|
|
225
|
+
export { AppHeader, type AppHeaderLogo, type AppHeaderProps, type AppHeaderUser, AppLayout, type AppLayoutProps, AppSidebar, type AppSidebarProps, type HeadbarLayout, type HeadbarLayoutMode, type HeadbarMenuRadius, type HeadbarNavPosition, type HeaderTab, type LayoutNavItem, NavButton, type NavButtonProps, NavigationLayout, type NavigationLayoutProps, type NavigationMode, type SidebarAccount, type SidebarNavItem, UserAccountMenu, type UserAccountMenuClassNames, type UserAccountMenuItem, type UserAccountMenuProps, type UserAccountMenuRadius, type UserAccountMenuSelectorConfig, type UserAccountMenuSelectorOption, type UserAccountMenuSide, type UserAccountMenuTriggerVariant, type UserAccountMenuUser, cn };
|
|
@@ -1,5 +1,80 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
+
import { c as BaseAppearance } from '../../types-Bn6PEDsX.js';
|
|
4
|
+
import '@radix-ui/react-context-menu';
|
|
5
|
+
|
|
6
|
+
type UserAccountMenuRadius = 'default' | 'none' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
|
|
7
|
+
type UserAccountMenuSide = 'top' | 'right' | 'bottom' | 'left';
|
|
8
|
+
type UserAccountMenuTriggerVariant = 'avatar' | 'profile';
|
|
9
|
+
interface UserAccountMenuUser {
|
|
10
|
+
avatarAlt?: string;
|
|
11
|
+
avatarUrl?: string;
|
|
12
|
+
initials?: string;
|
|
13
|
+
name?: string;
|
|
14
|
+
secondaryText?: ReactNode;
|
|
15
|
+
}
|
|
16
|
+
interface UserAccountMenuSelectorOption {
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
icon?: ReactNode;
|
|
19
|
+
label: ReactNode;
|
|
20
|
+
value: string;
|
|
21
|
+
}
|
|
22
|
+
interface UserAccountMenuSelectorConfig {
|
|
23
|
+
contentWidthClassName?: string;
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
id?: string;
|
|
26
|
+
icon?: ReactNode;
|
|
27
|
+
label: ReactNode;
|
|
28
|
+
onChange?: (value: string) => void;
|
|
29
|
+
options: UserAccountMenuSelectorOption[];
|
|
30
|
+
value: string;
|
|
31
|
+
visible?: boolean;
|
|
32
|
+
}
|
|
33
|
+
interface UserAccountMenuItem {
|
|
34
|
+
disabled?: boolean;
|
|
35
|
+
icon?: ReactNode;
|
|
36
|
+
id: string;
|
|
37
|
+
label: ReactNode;
|
|
38
|
+
onSelect?: () => void;
|
|
39
|
+
separatorBefore?: boolean;
|
|
40
|
+
shortcut?: ReactNode;
|
|
41
|
+
tone?: 'default' | 'danger';
|
|
42
|
+
visible?: boolean;
|
|
43
|
+
}
|
|
44
|
+
interface UserAccountMenuClassNames {
|
|
45
|
+
avatar?: string;
|
|
46
|
+
content?: string;
|
|
47
|
+
dangerItem?: string;
|
|
48
|
+
item?: string;
|
|
49
|
+
itemIcon?: string;
|
|
50
|
+
label?: string;
|
|
51
|
+
root?: string;
|
|
52
|
+
secondaryText?: string;
|
|
53
|
+
separator?: string;
|
|
54
|
+
subContent?: string;
|
|
55
|
+
subTrigger?: string;
|
|
56
|
+
trigger?: string;
|
|
57
|
+
userName?: string;
|
|
58
|
+
}
|
|
59
|
+
interface UserAccountMenuProps {
|
|
60
|
+
align?: 'start' | 'center' | 'end';
|
|
61
|
+
appearance?: BaseAppearance;
|
|
62
|
+
ariaLabel?: string;
|
|
63
|
+
className?: string;
|
|
64
|
+
classNames?: UserAccountMenuClassNames;
|
|
65
|
+
contentWidthClassName?: string;
|
|
66
|
+
fallbackName?: string;
|
|
67
|
+
items?: UserAccountMenuItem[];
|
|
68
|
+
menuRadius?: UserAccountMenuRadius;
|
|
69
|
+
selectors?: UserAccountMenuSelectorConfig[];
|
|
70
|
+
side?: UserAccountMenuSide;
|
|
71
|
+
sideOffset?: number;
|
|
72
|
+
triggerEndIcon?: ReactNode;
|
|
73
|
+
triggerTitle?: string;
|
|
74
|
+
triggerVariant?: UserAccountMenuTriggerVariant;
|
|
75
|
+
user: UserAccountMenuUser;
|
|
76
|
+
}
|
|
77
|
+
declare function UserAccountMenu({ align, appearance, ariaLabel, className, classNames, contentWidthClassName, fallbackName, items, menuRadius, selectors, side, sideOffset, triggerEndIcon, triggerTitle, triggerVariant, user, }: UserAccountMenuProps): react_jsx_runtime.JSX.Element;
|
|
3
78
|
|
|
4
79
|
declare function cn(...inputs: (string | undefined | null | false)[]): string;
|
|
5
80
|
interface NavButtonProps {
|
|
@@ -89,9 +164,9 @@ interface AppSidebarProps {
|
|
|
89
164
|
declare function AppSidebar({ logo, navItems, activeItemId, onNavigate, account, onLogout, logoutLabel, footer, defaultExpandedGroups, className, }: AppSidebarProps): react_jsx_runtime.JSX.Element;
|
|
90
165
|
interface AppLayoutProps {
|
|
91
166
|
/** header 组件 */
|
|
92
|
-
header
|
|
167
|
+
header?: ReactNode;
|
|
93
168
|
/** sidebar 组件 */
|
|
94
|
-
sidebar
|
|
169
|
+
sidebar?: ReactNode;
|
|
95
170
|
/** 主内容 */
|
|
96
171
|
children: ReactNode;
|
|
97
172
|
/** 是否 flush 布局(无内边距) */
|
|
@@ -99,5 +174,52 @@ interface AppLayoutProps {
|
|
|
99
174
|
className?: string;
|
|
100
175
|
}
|
|
101
176
|
declare function AppLayout({ header, sidebar, children, flush, className }: AppLayoutProps): react_jsx_runtime.JSX.Element;
|
|
177
|
+
type NavigationMode = 'sidebar' | 'headbar';
|
|
178
|
+
type HeadbarLayoutMode = 'boxed' | 'full-bleed';
|
|
179
|
+
type HeadbarMenuRadius = 'default' | 'none' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
|
|
180
|
+
type HeadbarNavPosition = 'left' | 'center' | 'right';
|
|
181
|
+
interface LayoutNavItem {
|
|
182
|
+
id: string;
|
|
183
|
+
label: ReactNode;
|
|
184
|
+
headbarLabel?: ReactNode;
|
|
185
|
+
icon?: ReactNode;
|
|
186
|
+
children?: LayoutNavItem[];
|
|
187
|
+
}
|
|
188
|
+
interface HeadbarLayout {
|
|
189
|
+
brandTitle?: ReactNode;
|
|
190
|
+
heightPx?: number;
|
|
191
|
+
layoutMode?: HeadbarLayoutMode;
|
|
192
|
+
menuRadius?: HeadbarMenuRadius;
|
|
193
|
+
navPosition?: HeadbarNavPosition;
|
|
194
|
+
}
|
|
195
|
+
interface NavigationLayoutProps {
|
|
196
|
+
activeItemId?: string;
|
|
197
|
+
activeRootId?: string;
|
|
198
|
+
allowModeSwitch?: boolean;
|
|
199
|
+
accountMenu?: ReactNode;
|
|
200
|
+
children: ReactNode;
|
|
201
|
+
className?: string;
|
|
202
|
+
collapsedSidebarAccountMenu?: ReactNode;
|
|
203
|
+
collapsedSidebarWidth?: string;
|
|
204
|
+
defaultMode?: NavigationMode;
|
|
205
|
+
defaultSidebarCollapsed?: boolean;
|
|
206
|
+
expandedSidebarWidth?: string;
|
|
207
|
+
flush?: boolean;
|
|
208
|
+
headbarActions?: ReactNode;
|
|
209
|
+
headbarLayout?: HeadbarLayout;
|
|
210
|
+
logo?: AppHeaderLogo;
|
|
211
|
+
mode?: NavigationMode;
|
|
212
|
+
navItems: LayoutNavItem[];
|
|
213
|
+
onModeChange?: (mode: NavigationMode) => void;
|
|
214
|
+
onNavigate?: (itemId: string) => void;
|
|
215
|
+
onSidebarCollapsedChange?: (collapsed: boolean) => void;
|
|
216
|
+
renderHeadbarExtra?: ReactNode;
|
|
217
|
+
sidebarAccountMenu?: ReactNode;
|
|
218
|
+
sidebarFooter?: ReactNode;
|
|
219
|
+
sidebarHeader?: ReactNode;
|
|
220
|
+
switchToHeadbarLabel?: string;
|
|
221
|
+
switchToSidebarLabel?: string;
|
|
222
|
+
}
|
|
223
|
+
declare function NavigationLayout({ activeItemId, activeRootId, allowModeSwitch, accountMenu, children, className, collapsedSidebarAccountMenu, collapsedSidebarWidth, defaultMode, defaultSidebarCollapsed, expandedSidebarWidth, flush, headbarActions, headbarLayout, logo, mode, navItems, onModeChange, onNavigate, onSidebarCollapsedChange, renderHeadbarExtra, sidebarAccountMenu, sidebarFooter, sidebarHeader, switchToHeadbarLabel, switchToSidebarLabel, }: NavigationLayoutProps): react_jsx_runtime.JSX.Element;
|
|
102
224
|
|
|
103
|
-
export { AppHeader, type AppHeaderLogo, type AppHeaderProps, type AppHeaderUser, AppLayout, type AppLayoutProps, AppSidebar, type AppSidebarProps, type HeaderTab, NavButton, type NavButtonProps, type SidebarAccount, type SidebarNavItem, cn };
|
|
225
|
+
export { AppHeader, type AppHeaderLogo, type AppHeaderProps, type AppHeaderUser, AppLayout, type AppLayoutProps, AppSidebar, type AppSidebarProps, type HeadbarLayout, type HeadbarLayoutMode, type HeadbarMenuRadius, type HeadbarNavPosition, type HeaderTab, type LayoutNavItem, NavButton, type NavButtonProps, NavigationLayout, type NavigationLayoutProps, type NavigationMode, type SidebarAccount, type SidebarNavItem, UserAccountMenu, type UserAccountMenuClassNames, type UserAccountMenuItem, type UserAccountMenuProps, type UserAccountMenuRadius, type UserAccountMenuSelectorConfig, type UserAccountMenuSelectorOption, type UserAccountMenuSide, type UserAccountMenuTriggerVariant, type UserAccountMenuUser, cn };
|