@ug666/ui-react 0.1.0 → 0.2.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/blocks/index.cjs +238 -0
- package/dist/blocks/index.cjs.map +1 -0
- package/dist/blocks/index.d.cts +86 -0
- package/dist/blocks/index.d.ts +86 -0
- package/dist/blocks/index.js +153 -0
- package/dist/blocks/index.js.map +1 -0
- package/dist/button-CaLZig8j.d.cts +22 -0
- package/dist/button-CaLZig8j.d.ts +22 -0
- package/dist/chunk-2IVRUJKO.js +377 -0
- package/dist/chunk-2IVRUJKO.js.map +1 -0
- package/dist/chunk-73WQAE3E.js +3003 -0
- package/dist/chunk-73WQAE3E.js.map +1 -0
- package/dist/chunk-RUDEZA5Q.js +62 -0
- package/dist/chunk-RUDEZA5Q.js.map +1 -0
- package/dist/chunk-S45GP6IB.js +254 -0
- package/dist/chunk-S45GP6IB.js.map +1 -0
- package/dist/components/index.cjs +3993 -0
- package/dist/components/index.cjs.map +1 -0
- package/dist/components/index.d.cts +1097 -0
- package/dist/components/index.d.ts +1097 -0
- package/dist/components/index.js +330 -0
- package/dist/components/index.js.map +1 -0
- package/dist/hooks/index.cjs +1 -0
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.js +1 -0
- package/dist/index.cjs +1410 -710
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +274 -1340
- package/dist/index.d.ts +274 -1340
- package/dist/index.js +385 -3229
- package/dist/index.js.map +1 -1
- package/dist/labs/index.cjs +34 -0
- package/dist/labs/index.cjs.map +1 -0
- package/dist/labs/index.d.cts +12 -0
- package/dist/labs/index.d.ts +12 -0
- package/dist/labs/index.js +9 -0
- package/dist/labs/index.js.map +1 -0
- package/dist/patterns/index.cjs +758 -0
- package/dist/patterns/index.cjs.map +1 -0
- package/dist/patterns/index.d.cts +158 -0
- package/dist/patterns/index.d.ts +158 -0
- package/dist/patterns/index.js +320 -0
- package/dist/patterns/index.js.map +1 -0
- package/dist/primitives/index.cjs +384 -0
- package/dist/primitives/index.cjs.map +1 -0
- package/dist/primitives/index.d.cts +137 -0
- package/dist/primitives/index.d.ts +137 -0
- package/dist/primitives/index.js +56 -0
- package/dist/primitives/index.js.map +1 -0
- package/dist/sidebar-vl00Z2o-.d.cts +93 -0
- package/dist/sidebar-vl00Z2o-.d.ts +93 -0
- package/dist/styles.css +2499 -0
- package/dist/tokens.css +86 -9
- package/package.json +36 -6
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
export { a as Button, B as ButtonProps, a as UGButton, B as UGButtonProps, b as buttonVariants, b as ugButtonVariants } from '../button-CaLZig8j.js';
|
|
2
|
+
import * as react from 'react';
|
|
3
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
4
|
+
import { VariantProps } from 'class-variance-authority';
|
|
5
|
+
|
|
6
|
+
interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
7
|
+
/** 输入框标签文本 */
|
|
8
|
+
label?: string;
|
|
9
|
+
/** 错误提示文本,有值时边框变红 */
|
|
10
|
+
error?: string;
|
|
11
|
+
/** 帮助说明文本 */
|
|
12
|
+
helperText?: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* 通用输入框组件
|
|
16
|
+
* @example
|
|
17
|
+
* <Input label="用户名" placeholder="请输入用户名" />
|
|
18
|
+
* <Input label="邮箱" error="邮箱格式不正确" value={email} onChange={handleChange} />
|
|
19
|
+
* <Input label="备注" helperText="最多 200 字" />
|
|
20
|
+
*/
|
|
21
|
+
declare const Input: react.ForwardRefExoticComponent<InputProps & react.RefAttributes<HTMLInputElement>>;
|
|
22
|
+
|
|
23
|
+
interface LabelProps extends React.LabelHTMLAttributes<HTMLLabelElement> {
|
|
24
|
+
/** 是否为必填项,显示红色星号 */
|
|
25
|
+
required?: boolean;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* 通用标签组件
|
|
29
|
+
* @example
|
|
30
|
+
* <Label htmlFor="email">邮箱</Label>
|
|
31
|
+
* <Label htmlFor="name" required>姓名</Label>
|
|
32
|
+
*/
|
|
33
|
+
declare const Label: react.ForwardRefExoticComponent<LabelProps & react.RefAttributes<HTMLLabelElement>>;
|
|
34
|
+
|
|
35
|
+
type CardProps = React.HTMLAttributes<HTMLDivElement>;
|
|
36
|
+
type CardHeaderProps = React.HTMLAttributes<HTMLDivElement>;
|
|
37
|
+
type CardTitleProps = React.HTMLAttributes<HTMLHeadingElement>;
|
|
38
|
+
type CardDescriptionProps = React.HTMLAttributes<HTMLParagraphElement>;
|
|
39
|
+
type CardContentProps = React.HTMLAttributes<HTMLDivElement>;
|
|
40
|
+
type CardFooterProps = React.HTMLAttributes<HTMLDivElement>;
|
|
41
|
+
/**
|
|
42
|
+
* 卡片容器
|
|
43
|
+
* @example
|
|
44
|
+
* <Card>
|
|
45
|
+
* <CardHeader>
|
|
46
|
+
* <CardTitle>标题</CardTitle>
|
|
47
|
+
* <CardDescription>描述文字</CardDescription>
|
|
48
|
+
* </CardHeader>
|
|
49
|
+
* <CardContent>内容区域</CardContent>
|
|
50
|
+
* <CardFooter>底部操作</CardFooter>
|
|
51
|
+
* </Card>
|
|
52
|
+
*/
|
|
53
|
+
declare const Card: react.ForwardRefExoticComponent<CardProps & react.RefAttributes<HTMLDivElement>>;
|
|
54
|
+
declare const CardHeader: react.ForwardRefExoticComponent<CardHeaderProps & react.RefAttributes<HTMLDivElement>>;
|
|
55
|
+
declare const CardTitle: react.ForwardRefExoticComponent<CardTitleProps & react.RefAttributes<HTMLHeadingElement>>;
|
|
56
|
+
declare const CardDescription: react.ForwardRefExoticComponent<CardDescriptionProps & react.RefAttributes<HTMLParagraphElement>>;
|
|
57
|
+
declare const CardContent: react.ForwardRefExoticComponent<CardContentProps & react.RefAttributes<HTMLDivElement>>;
|
|
58
|
+
declare const CardFooter: react.ForwardRefExoticComponent<CardFooterProps & react.RefAttributes<HTMLDivElement>>;
|
|
59
|
+
|
|
60
|
+
declare const badgeVariants: (props?: ({
|
|
61
|
+
variant?: "default" | "destructive" | "outline" | "secondary" | "success" | "warning" | null | undefined;
|
|
62
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
63
|
+
interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement>, VariantProps<typeof badgeVariants> {
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* 徽标组件
|
|
67
|
+
* @example
|
|
68
|
+
* <Badge variant="default">新品</Badge>
|
|
69
|
+
* <Badge variant="success">已完成</Badge>
|
|
70
|
+
* <Badge variant="destructive">已删除</Badge>
|
|
71
|
+
* <Badge variant="warning">待审核</Badge>
|
|
72
|
+
*/
|
|
73
|
+
declare const Badge: react.ForwardRefExoticComponent<BadgeProps & react.RefAttributes<HTMLSpanElement>>;
|
|
74
|
+
|
|
75
|
+
declare const tagVariants: (props?: ({
|
|
76
|
+
variant?: "default" | "destructive" | "outline" | "success" | "warning" | "primary" | null | undefined;
|
|
77
|
+
size?: "default" | "sm" | null | undefined;
|
|
78
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
79
|
+
interface TagProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, 'color'>, VariantProps<typeof tagVariants> {
|
|
80
|
+
/** 是否显示关闭按钮 */
|
|
81
|
+
closable?: boolean;
|
|
82
|
+
/** 是否禁用 */
|
|
83
|
+
disabled?: boolean;
|
|
84
|
+
/** 自定义背景色(覆盖 variant 颜色,建议传 token CSS 变量) */
|
|
85
|
+
color?: string;
|
|
86
|
+
/** 关闭按钮点击回调 */
|
|
87
|
+
onClose?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* 标签组件(可交互,支持关闭)
|
|
91
|
+
* @example
|
|
92
|
+
* <Tag>默认标签</Tag>
|
|
93
|
+
* <Tag variant="success">已完成</Tag>
|
|
94
|
+
* <Tag variant="primary" closable onClose={removeTag}>可关闭</Tag>
|
|
95
|
+
* <Tag variant="warning" disabled>禁用状态</Tag>
|
|
96
|
+
* <Tag color="hsl(var(--primary))">自定义颜色</Tag>
|
|
97
|
+
*/
|
|
98
|
+
declare const Tag: react.ForwardRefExoticComponent<TagProps & react.RefAttributes<HTMLSpanElement>>;
|
|
99
|
+
|
|
100
|
+
declare const spinnerVariants: (props?: ({
|
|
101
|
+
size?: "sm" | "lg" | "md" | null | undefined;
|
|
102
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
103
|
+
interface SpinnerProps extends React.HTMLAttributes<SVGSVGElement>, VariantProps<typeof spinnerVariants> {
|
|
104
|
+
/** 无障碍标签 */
|
|
105
|
+
label?: string;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* 加载旋转动画
|
|
109
|
+
* @example
|
|
110
|
+
* <Spinner />
|
|
111
|
+
* <Spinner size="sm" />
|
|
112
|
+
* <Spinner size="lg" className="text-primary" />
|
|
113
|
+
*/
|
|
114
|
+
declare const Spinner: react.ForwardRefExoticComponent<SpinnerProps & react.RefAttributes<SVGSVGElement>>;
|
|
115
|
+
|
|
116
|
+
/** 分割线方向 */
|
|
117
|
+
type SeparatorOrientation = 'horizontal' | 'vertical';
|
|
118
|
+
interface SeparatorProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
119
|
+
/** 方向,默认 horizontal */
|
|
120
|
+
orientation?: SeparatorOrientation;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* 分割线
|
|
124
|
+
* @example
|
|
125
|
+
* // 水平分割线
|
|
126
|
+
* <Separator />
|
|
127
|
+
*
|
|
128
|
+
* // 垂直分割线(父容器需设定高度)
|
|
129
|
+
* <div className="flex h-8 items-center gap-4">
|
|
130
|
+
* <span>左侧文字</span>
|
|
131
|
+
* <Separator orientation="vertical" />
|
|
132
|
+
* <span>右侧文字</span>
|
|
133
|
+
* </div>
|
|
134
|
+
*/
|
|
135
|
+
declare const Separator: react.ForwardRefExoticComponent<SeparatorProps & react.RefAttributes<HTMLDivElement>>;
|
|
136
|
+
|
|
137
|
+
export { Badge, type BadgeProps, Card, CardContent, type CardContentProps, CardDescription, type CardDescriptionProps, CardFooter, type CardFooterProps, CardHeader, type CardHeaderProps, type CardProps, CardTitle, type CardTitleProps, Input, type InputProps, Label, type LabelProps, Separator, type SeparatorOrientation, type SeparatorProps, Spinner, type SpinnerProps, Tag, type TagProps, Badge as UGBadge, type BadgeProps as UGBadgeProps, Card as UGCard, CardContent as UGCardContent, type CardContentProps as UGCardContentProps, CardDescription as UGCardDescription, type CardDescriptionProps as UGCardDescriptionProps, CardFooter as UGCardFooter, type CardFooterProps as UGCardFooterProps, CardHeader as UGCardHeader, type CardHeaderProps as UGCardHeaderProps, type CardProps as UGCardProps, CardTitle as UGCardTitle, type CardTitleProps as UGCardTitleProps, Input as UGInput, type InputProps as UGInputProps, Label as UGLabel, type LabelProps as UGLabelProps, Separator as UGSeparator, type SeparatorOrientation as UGSeparatorOrientation, type SeparatorProps as UGSeparatorProps, Spinner as UGSpinner, type SpinnerProps as UGSpinnerProps, Tag as UGTag, type TagProps as UGTagProps, badgeVariants, tagVariants, badgeVariants as ugBadgeVariants, tagVariants as ugTagVariants };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
Badge,
|
|
4
|
+
Card,
|
|
5
|
+
CardContent,
|
|
6
|
+
CardDescription,
|
|
7
|
+
CardFooter,
|
|
8
|
+
CardHeader,
|
|
9
|
+
CardTitle,
|
|
10
|
+
Input,
|
|
11
|
+
Label,
|
|
12
|
+
Separator,
|
|
13
|
+
Spinner,
|
|
14
|
+
Tag,
|
|
15
|
+
badgeVariants,
|
|
16
|
+
tagVariants
|
|
17
|
+
} from "../chunk-S45GP6IB.js";
|
|
18
|
+
import {
|
|
19
|
+
Button,
|
|
20
|
+
buttonVariants
|
|
21
|
+
} from "../chunk-RUDEZA5Q.js";
|
|
22
|
+
export {
|
|
23
|
+
Badge,
|
|
24
|
+
Button,
|
|
25
|
+
Card,
|
|
26
|
+
CardContent,
|
|
27
|
+
CardDescription,
|
|
28
|
+
CardFooter,
|
|
29
|
+
CardHeader,
|
|
30
|
+
CardTitle,
|
|
31
|
+
Input,
|
|
32
|
+
Label,
|
|
33
|
+
Separator,
|
|
34
|
+
Spinner,
|
|
35
|
+
Tag,
|
|
36
|
+
Badge as UGBadge,
|
|
37
|
+
Button as UGButton,
|
|
38
|
+
Card as UGCard,
|
|
39
|
+
CardContent as UGCardContent,
|
|
40
|
+
CardDescription as UGCardDescription,
|
|
41
|
+
CardFooter as UGCardFooter,
|
|
42
|
+
CardHeader as UGCardHeader,
|
|
43
|
+
CardTitle as UGCardTitle,
|
|
44
|
+
Input as UGInput,
|
|
45
|
+
Label as UGLabel,
|
|
46
|
+
Separator as UGSeparator,
|
|
47
|
+
Spinner as UGSpinner,
|
|
48
|
+
Tag as UGTag,
|
|
49
|
+
badgeVariants,
|
|
50
|
+
buttonVariants,
|
|
51
|
+
tagVariants,
|
|
52
|
+
badgeVariants as ugBadgeVariants,
|
|
53
|
+
buttonVariants as ugButtonVariants,
|
|
54
|
+
tagVariants as ugTagVariants
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { LucideIcon } from 'lucide-react';
|
|
3
|
+
|
|
4
|
+
interface ModalProps {
|
|
5
|
+
/** 是否显示 */
|
|
6
|
+
open: boolean;
|
|
7
|
+
/** 关闭回调 */
|
|
8
|
+
onClose: () => void;
|
|
9
|
+
/** 子内容 */
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
/** 额外类名 */
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
interface ModalContentProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
15
|
+
/** 最大宽度,默认 max-w-lg */
|
|
16
|
+
maxWidth?: string;
|
|
17
|
+
}
|
|
18
|
+
type ModalHeaderProps = React.HTMLAttributes<HTMLDivElement>;
|
|
19
|
+
type ModalTitleProps = React.HTMLAttributes<HTMLHeadingElement>;
|
|
20
|
+
type ModalFooterProps = React.HTMLAttributes<HTMLDivElement>;
|
|
21
|
+
interface ModalCloseButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* 对话框组件
|
|
25
|
+
* @example
|
|
26
|
+
* <Modal open={isOpen} onClose={() => setIsOpen(false)}>
|
|
27
|
+
* <ModalContent>
|
|
28
|
+
* <ModalHeader>
|
|
29
|
+
* <ModalTitle>确认删除</ModalTitle>
|
|
30
|
+
* </ModalHeader>
|
|
31
|
+
* <p className="px-6 pb-4 text-sm text-text-secondary">此操作不可撤销。</p>
|
|
32
|
+
* <ModalFooter>
|
|
33
|
+
* <Button variant="outline" onClick={() => setIsOpen(false)}>取消</Button>
|
|
34
|
+
* <Button variant="destructive">删除</Button>
|
|
35
|
+
* </ModalFooter>
|
|
36
|
+
* </ModalContent>
|
|
37
|
+
* </Modal>
|
|
38
|
+
*/
|
|
39
|
+
declare const Modal: react.ForwardRefExoticComponent<ModalProps & react.RefAttributes<HTMLDivElement>>;
|
|
40
|
+
declare const ModalContent: react.ForwardRefExoticComponent<ModalContentProps & react.RefAttributes<HTMLDivElement>>;
|
|
41
|
+
declare const ModalHeader: react.ForwardRefExoticComponent<ModalHeaderProps & react.RefAttributes<HTMLDivElement>>;
|
|
42
|
+
declare const ModalTitle: react.ForwardRefExoticComponent<ModalTitleProps & react.RefAttributes<HTMLHeadingElement>>;
|
|
43
|
+
declare const ModalFooter: react.ForwardRefExoticComponent<ModalFooterProps & react.RefAttributes<HTMLDivElement>>;
|
|
44
|
+
/** 独立关闭按钮,可放在 ModalHeader 右侧 */
|
|
45
|
+
declare const ModalCloseButton: react.ForwardRefExoticComponent<ModalCloseButtonProps & react.RefAttributes<HTMLButtonElement>>;
|
|
46
|
+
|
|
47
|
+
interface SidebarItem {
|
|
48
|
+
id?: string;
|
|
49
|
+
label: string;
|
|
50
|
+
href?: string;
|
|
51
|
+
icon: LucideIcon;
|
|
52
|
+
active?: boolean;
|
|
53
|
+
children?: SidebarItem[];
|
|
54
|
+
}
|
|
55
|
+
type SidebarVariant = 'primary' | 'dark';
|
|
56
|
+
interface SidebarProps {
|
|
57
|
+
/** 导航菜单项 */
|
|
58
|
+
items: SidebarItem[];
|
|
59
|
+
/** 视觉变体:primary 品牌色(默认),dark 深灰色(推荐后台管理) */
|
|
60
|
+
variant?: SidebarVariant;
|
|
61
|
+
/** 是否折叠,折叠时只显示图标 */
|
|
62
|
+
collapsed?: boolean;
|
|
63
|
+
/** 非受控折叠默认值 */
|
|
64
|
+
defaultCollapsed?: boolean;
|
|
65
|
+
/** 折叠状态变化回调 */
|
|
66
|
+
onCollapsedChange?: (collapsed: boolean) => void;
|
|
67
|
+
/** 是否显示内置折叠按钮 */
|
|
68
|
+
collapsible?: boolean;
|
|
69
|
+
/** 是否显示内置搜索 */
|
|
70
|
+
searchable?: boolean;
|
|
71
|
+
/** 搜索输入占位文案 */
|
|
72
|
+
searchPlaceholder?: string;
|
|
73
|
+
/** 是否启用移动端抽屉模式 */
|
|
74
|
+
responsive?: boolean;
|
|
75
|
+
/** 移动端抽屉是否打开 */
|
|
76
|
+
mobileOpen?: boolean;
|
|
77
|
+
/** 移动端抽屉开关回调 */
|
|
78
|
+
onMobileOpenChange?: (open: boolean) => void;
|
|
79
|
+
/** 顶部插槽,用于品牌或用户信息 */
|
|
80
|
+
header?: React.ReactNode;
|
|
81
|
+
/** 底部插槽,用于退出登录等操作 */
|
|
82
|
+
footer?: React.ReactNode;
|
|
83
|
+
/** 额外类名 */
|
|
84
|
+
className?: string;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* 侧边栏布局组件
|
|
88
|
+
* @example
|
|
89
|
+
* <Sidebar variant="dark" items={navItems} footer={<LogoutButton />} />
|
|
90
|
+
*/
|
|
91
|
+
declare const Sidebar: react.ForwardRefExoticComponent<SidebarProps & react.RefAttributes<HTMLElement>>;
|
|
92
|
+
|
|
93
|
+
export { Modal as M, Sidebar as S, ModalCloseButton as a, type ModalCloseButtonProps as b, ModalContent as c, type ModalContentProps as d, ModalFooter as e, type ModalFooterProps as f, ModalHeader as g, type ModalHeaderProps as h, type ModalProps as i, ModalTitle as j, type ModalTitleProps as k, type SidebarItem as l, type SidebarProps as m, type SidebarVariant as n };
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { LucideIcon } from 'lucide-react';
|
|
3
|
+
|
|
4
|
+
interface ModalProps {
|
|
5
|
+
/** 是否显示 */
|
|
6
|
+
open: boolean;
|
|
7
|
+
/** 关闭回调 */
|
|
8
|
+
onClose: () => void;
|
|
9
|
+
/** 子内容 */
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
/** 额外类名 */
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
interface ModalContentProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
15
|
+
/** 最大宽度,默认 max-w-lg */
|
|
16
|
+
maxWidth?: string;
|
|
17
|
+
}
|
|
18
|
+
type ModalHeaderProps = React.HTMLAttributes<HTMLDivElement>;
|
|
19
|
+
type ModalTitleProps = React.HTMLAttributes<HTMLHeadingElement>;
|
|
20
|
+
type ModalFooterProps = React.HTMLAttributes<HTMLDivElement>;
|
|
21
|
+
interface ModalCloseButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* 对话框组件
|
|
25
|
+
* @example
|
|
26
|
+
* <Modal open={isOpen} onClose={() => setIsOpen(false)}>
|
|
27
|
+
* <ModalContent>
|
|
28
|
+
* <ModalHeader>
|
|
29
|
+
* <ModalTitle>确认删除</ModalTitle>
|
|
30
|
+
* </ModalHeader>
|
|
31
|
+
* <p className="px-6 pb-4 text-sm text-text-secondary">此操作不可撤销。</p>
|
|
32
|
+
* <ModalFooter>
|
|
33
|
+
* <Button variant="outline" onClick={() => setIsOpen(false)}>取消</Button>
|
|
34
|
+
* <Button variant="destructive">删除</Button>
|
|
35
|
+
* </ModalFooter>
|
|
36
|
+
* </ModalContent>
|
|
37
|
+
* </Modal>
|
|
38
|
+
*/
|
|
39
|
+
declare const Modal: react.ForwardRefExoticComponent<ModalProps & react.RefAttributes<HTMLDivElement>>;
|
|
40
|
+
declare const ModalContent: react.ForwardRefExoticComponent<ModalContentProps & react.RefAttributes<HTMLDivElement>>;
|
|
41
|
+
declare const ModalHeader: react.ForwardRefExoticComponent<ModalHeaderProps & react.RefAttributes<HTMLDivElement>>;
|
|
42
|
+
declare const ModalTitle: react.ForwardRefExoticComponent<ModalTitleProps & react.RefAttributes<HTMLHeadingElement>>;
|
|
43
|
+
declare const ModalFooter: react.ForwardRefExoticComponent<ModalFooterProps & react.RefAttributes<HTMLDivElement>>;
|
|
44
|
+
/** 独立关闭按钮,可放在 ModalHeader 右侧 */
|
|
45
|
+
declare const ModalCloseButton: react.ForwardRefExoticComponent<ModalCloseButtonProps & react.RefAttributes<HTMLButtonElement>>;
|
|
46
|
+
|
|
47
|
+
interface SidebarItem {
|
|
48
|
+
id?: string;
|
|
49
|
+
label: string;
|
|
50
|
+
href?: string;
|
|
51
|
+
icon: LucideIcon;
|
|
52
|
+
active?: boolean;
|
|
53
|
+
children?: SidebarItem[];
|
|
54
|
+
}
|
|
55
|
+
type SidebarVariant = 'primary' | 'dark';
|
|
56
|
+
interface SidebarProps {
|
|
57
|
+
/** 导航菜单项 */
|
|
58
|
+
items: SidebarItem[];
|
|
59
|
+
/** 视觉变体:primary 品牌色(默认),dark 深灰色(推荐后台管理) */
|
|
60
|
+
variant?: SidebarVariant;
|
|
61
|
+
/** 是否折叠,折叠时只显示图标 */
|
|
62
|
+
collapsed?: boolean;
|
|
63
|
+
/** 非受控折叠默认值 */
|
|
64
|
+
defaultCollapsed?: boolean;
|
|
65
|
+
/** 折叠状态变化回调 */
|
|
66
|
+
onCollapsedChange?: (collapsed: boolean) => void;
|
|
67
|
+
/** 是否显示内置折叠按钮 */
|
|
68
|
+
collapsible?: boolean;
|
|
69
|
+
/** 是否显示内置搜索 */
|
|
70
|
+
searchable?: boolean;
|
|
71
|
+
/** 搜索输入占位文案 */
|
|
72
|
+
searchPlaceholder?: string;
|
|
73
|
+
/** 是否启用移动端抽屉模式 */
|
|
74
|
+
responsive?: boolean;
|
|
75
|
+
/** 移动端抽屉是否打开 */
|
|
76
|
+
mobileOpen?: boolean;
|
|
77
|
+
/** 移动端抽屉开关回调 */
|
|
78
|
+
onMobileOpenChange?: (open: boolean) => void;
|
|
79
|
+
/** 顶部插槽,用于品牌或用户信息 */
|
|
80
|
+
header?: React.ReactNode;
|
|
81
|
+
/** 底部插槽,用于退出登录等操作 */
|
|
82
|
+
footer?: React.ReactNode;
|
|
83
|
+
/** 额外类名 */
|
|
84
|
+
className?: string;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* 侧边栏布局组件
|
|
88
|
+
* @example
|
|
89
|
+
* <Sidebar variant="dark" items={navItems} footer={<LogoutButton />} />
|
|
90
|
+
*/
|
|
91
|
+
declare const Sidebar: react.ForwardRefExoticComponent<SidebarProps & react.RefAttributes<HTMLElement>>;
|
|
92
|
+
|
|
93
|
+
export { Modal as M, Sidebar as S, ModalCloseButton as a, type ModalCloseButtonProps as b, ModalContent as c, type ModalContentProps as d, ModalFooter as e, type ModalFooterProps as f, ModalHeader as g, type ModalHeaderProps as h, type ModalProps as i, ModalTitle as j, type ModalTitleProps as k, type SidebarItem as l, type SidebarProps as m, type SidebarVariant as n };
|