@ug666/ui-react 0.2.0 → 0.3.0-beta.1
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/aliases.d.ts +59 -0
- package/dist/aliases.d.ts.map +1 -0
- package/dist/blocks/feature-grid.d.ts +40 -0
- package/dist/blocks/feature-grid.d.ts.map +1 -0
- package/dist/blocks/index.cjs +293 -64
- package/dist/blocks/index.cjs.map +1 -1
- package/dist/blocks/index.d.ts +6 -84
- package/dist/blocks/index.d.ts.map +1 -0
- package/dist/blocks/index.js +80 -39
- package/dist/blocks/index.js.map +1 -1
- package/dist/blocks/landing-hero.d.ts +55 -0
- package/dist/blocks/landing-hero.d.ts.map +1 -0
- package/dist/chunk-AKWJMDCW.js +467 -0
- package/dist/chunk-AKWJMDCW.js.map +1 -0
- package/dist/chunk-F23X4N6B.js +11 -0
- package/dist/chunk-F23X4N6B.js.map +1 -0
- package/dist/chunk-HGO3GZ56.js +1777 -0
- package/dist/chunk-HGO3GZ56.js.map +1 -0
- package/dist/chunk-HXIWD5LQ.js +319 -0
- package/dist/chunk-HXIWD5LQ.js.map +1 -0
- package/dist/chunk-M6J4PLF4.js +521 -0
- package/dist/chunk-M6J4PLF4.js.map +1 -0
- package/dist/chunk-N3Z7R6GG.js +139 -0
- package/dist/chunk-N3Z7R6GG.js.map +1 -0
- package/dist/chunk-UXWCK6M7.js +5757 -0
- package/dist/chunk-UXWCK6M7.js.map +1 -0
- package/dist/components/accordion.d.ts +59 -0
- package/dist/components/accordion.d.ts.map +1 -0
- package/dist/components/alert.d.ts +23 -0
- package/dist/components/alert.d.ts.map +1 -0
- package/dist/components/avatar-group.d.ts +20 -0
- package/dist/components/avatar-group.d.ts.map +1 -0
- package/dist/components/avatar.d.ts +34 -0
- package/dist/components/avatar.d.ts.map +1 -0
- package/dist/components/badge.d.ts +17 -0
- package/dist/components/badge.d.ts.map +1 -0
- package/dist/components/breadcrumb.d.ts +33 -0
- package/dist/components/breadcrumb.d.ts.map +1 -0
- package/dist/components/button-group.d.ts +26 -0
- package/dist/components/button-group.d.ts.map +1 -0
- package/dist/components/button.d.ts +43 -0
- package/dist/components/button.d.ts.map +1 -0
- package/dist/components/card.d.ts +26 -0
- package/dist/components/card.d.ts.map +1 -0
- package/dist/components/checkbox-group-context.d.ts +14 -0
- package/dist/components/checkbox-group-context.d.ts.map +1 -0
- package/dist/components/checkbox-group.d.ts +18 -0
- package/dist/components/checkbox-group.d.ts.map +1 -0
- package/dist/components/checkbox.d.ts +32 -0
- package/dist/components/checkbox.d.ts.map +1 -0
- package/dist/components/config-provider.d.ts +29 -0
- package/dist/components/config-provider.d.ts.map +1 -0
- package/dist/components/container.d.ts +27 -0
- package/dist/components/container.d.ts.map +1 -0
- package/dist/components/context/form-context.d.ts +41 -0
- package/dist/components/context/form-context.d.ts.map +1 -0
- package/dist/components/context-menu.d.ts +39 -0
- package/dist/components/context-menu.d.ts.map +1 -0
- package/dist/components/descriptions.d.ts +40 -0
- package/dist/components/descriptions.d.ts.map +1 -0
- package/dist/components/dialog.d.ts +55 -0
- package/dist/components/dialog.d.ts.map +1 -0
- package/dist/components/drawer.d.ts +38 -0
- package/dist/components/drawer.d.ts.map +1 -0
- package/dist/components/dropdown.d.ts +42 -0
- package/dist/components/dropdown.d.ts.map +1 -0
- package/dist/components/empty-state.d.ts +24 -0
- package/dist/components/empty-state.d.ts.map +1 -0
- package/dist/components/form.d.ts +127 -0
- package/dist/components/form.d.ts.map +1 -0
- package/dist/components/icon.d.ts +16 -0
- package/dist/components/icon.d.ts.map +1 -0
- package/dist/components/index.cjs +6173 -1482
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.d.ts +59 -1096
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +67 -6
- package/dist/components/input.d.ts +28 -0
- package/dist/components/input.d.ts.map +1 -0
- package/dist/components/label.d.ts +18 -0
- package/dist/components/label.d.ts.map +1 -0
- package/dist/components/layout.d.ts +34 -0
- package/dist/components/layout.d.ts.map +1 -0
- package/dist/components/link.d.ts +18 -0
- package/dist/components/link.d.ts.map +1 -0
- package/dist/components/modal.d.ts +46 -0
- package/dist/components/modal.d.ts.map +1 -0
- package/dist/components/navigation-menu.d.ts +39 -0
- package/dist/components/navigation-menu.d.ts.map +1 -0
- package/dist/components/number-input.d.ts +35 -0
- package/dist/components/number-input.d.ts.map +1 -0
- package/dist/components/otp-input.d.ts +35 -0
- package/dist/components/otp-input.d.ts.map +1 -0
- package/dist/components/pagination.d.ts +16 -0
- package/dist/components/pagination.d.ts.map +1 -0
- package/dist/components/popover.d.ts +36 -0
- package/dist/components/popover.d.ts.map +1 -0
- package/dist/components/progress.d.ts +21 -0
- package/dist/components/progress.d.ts.map +1 -0
- package/dist/components/radio.d.ts +68 -0
- package/dist/components/radio.d.ts.map +1 -0
- package/dist/components/scrollbar.d.ts +29 -0
- package/dist/components/scrollbar.d.ts.map +1 -0
- package/dist/components/select.d.ts +48 -0
- package/dist/components/select.d.ts.map +1 -0
- package/dist/components/separator.d.ts +28 -0
- package/dist/components/separator.d.ts.map +1 -0
- package/dist/components/sheet.d.ts +24 -0
- package/dist/components/sheet.d.ts.map +1 -0
- package/dist/components/sidebar.d.ts +48 -0
- package/dist/components/sidebar.d.ts.map +1 -0
- package/dist/components/skeleton.d.ts +16 -0
- package/dist/components/skeleton.d.ts.map +1 -0
- package/dist/components/slider.d.ts +44 -0
- package/dist/components/slider.d.ts.map +1 -0
- package/dist/components/space.d.ts +19 -0
- package/dist/components/space.d.ts.map +1 -0
- package/dist/components/spinner.d.ts +18 -0
- package/dist/components/spinner.d.ts.map +1 -0
- package/dist/components/splitter.d.ts +51 -0
- package/dist/components/splitter.d.ts.map +1 -0
- package/dist/components/statistic.d.ts +30 -0
- package/dist/components/statistic.d.ts.map +1 -0
- package/dist/components/steps.d.ts +33 -0
- package/dist/components/steps.d.ts.map +1 -0
- package/dist/components/switch.d.ts +49 -0
- package/dist/components/switch.d.ts.map +1 -0
- package/dist/components/table.d.ts +32 -0
- package/dist/components/table.d.ts.map +1 -0
- package/dist/components/tabs.d.ts +27 -0
- package/dist/components/tabs.d.ts.map +1 -0
- package/dist/components/tag.d.ts +27 -0
- package/dist/components/tag.d.ts.map +1 -0
- package/dist/components/text.d.ts +16 -0
- package/dist/components/text.d.ts.map +1 -0
- package/dist/components/textarea.d.ts +26 -0
- package/dist/components/textarea.d.ts.map +1 -0
- package/dist/components/toast.d.ts +26 -0
- package/dist/components/toast.d.ts.map +1 -0
- package/dist/components/tooltip.d.ts +29 -0
- package/dist/components/tooltip.d.ts.map +1 -0
- package/dist/hooks/index.cjs +228 -27
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.d.ts +19 -231
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/use-click-outside.d.ts +9 -0
- package/dist/hooks/use-click-outside.d.ts.map +1 -0
- package/dist/hooks/use-copy-to-clipboard.d.ts +12 -0
- package/dist/hooks/use-copy-to-clipboard.d.ts.map +1 -0
- package/dist/hooks/use-debounce.d.ts +7 -0
- package/dist/hooks/use-debounce.d.ts.map +1 -0
- package/dist/hooks/use-escape-key.d.ts +10 -0
- package/dist/hooks/use-escape-key.d.ts.map +1 -0
- package/dist/hooks/use-event-listener.d.ts +28 -0
- package/dist/hooks/use-event-listener.d.ts.map +1 -0
- package/dist/hooks/use-form.d.ts +48 -0
- package/dist/hooks/use-form.d.ts.map +1 -0
- package/dist/hooks/use-hotkeys.d.ts +30 -0
- package/dist/hooks/use-hotkeys.d.ts.map +1 -0
- package/dist/hooks/use-interval.d.ts +19 -0
- package/dist/hooks/use-interval.d.ts.map +1 -0
- package/dist/hooks/use-local-storage.d.ts +9 -0
- package/dist/hooks/use-local-storage.d.ts.map +1 -0
- package/dist/hooks/use-media-query.d.ts +8 -0
- package/dist/hooks/use-media-query.d.ts.map +1 -0
- package/dist/hooks/use-mounted.d.ts +18 -0
- package/dist/hooks/use-mounted.d.ts.map +1 -0
- package/dist/hooks/use-pagination.d.ts +36 -0
- package/dist/hooks/use-pagination.d.ts.map +1 -0
- package/dist/hooks/use-timeout.d.ts +19 -0
- package/dist/hooks/use-timeout.d.ts.map +1 -0
- package/dist/hooks/use-toggle.d.ts +9 -0
- package/dist/hooks/use-toggle.d.ts.map +1 -0
- package/dist/index.cjs +6475 -1768
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +73 -294
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +64 -184
- package/dist/index.js.map +1 -1
- package/dist/internal/button-group-context.d.ts +11 -0
- package/dist/internal/button-group-context.d.ts.map +1 -0
- package/dist/internal/cn.d.ts +8 -0
- package/dist/internal/cn.d.ts.map +1 -0
- package/dist/internal/use-overlay-focus.d.ts +8 -0
- package/dist/internal/use-overlay-focus.d.ts.map +1 -0
- package/dist/internal/use-portal-container.d.ts +2 -0
- package/dist/internal/use-portal-container.d.ts.map +1 -0
- package/dist/labs/file-preview.d.ts +44 -0
- package/dist/labs/file-preview.d.ts.map +1 -0
- package/dist/labs/index.cjs +191 -1
- package/dist/labs/index.cjs.map +1 -1
- package/dist/labs/index.d.ts +8 -6
- package/dist/labs/index.d.ts.map +1 -0
- package/dist/labs/index.js +180 -1
- package/dist/labs/index.js.map +1 -1
- package/dist/labs/model-card.d.ts +50 -0
- package/dist/labs/model-card.d.ts.map +1 -0
- package/dist/patterns/admin-shell.d.ts +52 -0
- package/dist/patterns/admin-shell.d.ts.map +1 -0
- package/dist/patterns/confirm-dialog.d.ts +50 -0
- package/dist/patterns/confirm-dialog.d.ts.map +1 -0
- package/dist/patterns/copy-field.d.ts +29 -0
- package/dist/patterns/copy-field.d.ts.map +1 -0
- package/dist/patterns/index.cjs +699 -251
- package/dist/patterns/index.cjs.map +1 -1
- package/dist/patterns/index.d.ts +5 -158
- package/dist/patterns/index.d.ts.map +1 -0
- package/dist/patterns/index.js +137 -82
- package/dist/patterns/index.js.map +1 -1
- package/dist/patterns/page-header.d.ts +37 -0
- package/dist/patterns/page-header.d.ts.map +1 -0
- package/dist/primitives/index.cjs +1889 -112
- package/dist/primitives/index.cjs.map +1 -1
- package/dist/primitives/index.d.ts +22 -135
- package/dist/primitives/index.d.ts.map +1 -0
- package/dist/primitives/index.js +55 -4
- package/dist/styles.css +2819 -953
- package/dist/theme.cjs +161 -0
- package/dist/theme.cjs.map +1 -0
- package/dist/theme.d.ts +39 -0
- package/dist/theme.d.ts.map +1 -0
- package/dist/theme.js +19 -0
- package/dist/theme.js.map +1 -0
- package/dist/themes/default.css +80 -0
- package/dist/themes/mecha.css +195 -0
- package/dist/themes/minimal.css +160 -0
- package/dist/tokens.css +1173 -18
- package/package.json +22 -12
- package/dist/blocks/index.d.cts +0 -86
- package/dist/button-CaLZig8j.d.cts +0 -22
- package/dist/button-CaLZig8j.d.ts +0 -22
- package/dist/chunk-2IVRUJKO.js +0 -377
- package/dist/chunk-2IVRUJKO.js.map +0 -1
- package/dist/chunk-73WQAE3E.js +0 -3003
- package/dist/chunk-73WQAE3E.js.map +0 -1
- package/dist/chunk-MGXIF756.js +0 -313
- package/dist/chunk-MGXIF756.js.map +0 -1
- package/dist/chunk-RUDEZA5Q.js +0 -62
- package/dist/chunk-RUDEZA5Q.js.map +0 -1
- package/dist/chunk-S45GP6IB.js +0 -254
- package/dist/chunk-S45GP6IB.js.map +0 -1
- package/dist/components/index.d.cts +0 -1097
- package/dist/hooks/index.d.cts +0 -232
- package/dist/index.d.cts +0 -297
- package/dist/labs/index.d.cts +0 -12
- package/dist/patterns/index.d.cts +0 -158
- package/dist/primitives/index.d.cts +0 -137
- package/dist/sidebar-vl00Z2o-.d.cts +0 -93
- package/dist/sidebar-vl00Z2o-.d.ts +0 -93
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
import * as react from 'react';
|
|
2
|
-
import { HTMLAttributes, ReactNode } from 'react';
|
|
3
|
-
import { l as SidebarItem, n as SidebarVariant, d as ModalContentProps } from '../sidebar-vl00Z2o-.cjs';
|
|
4
|
-
import { LucideIcon } from 'lucide-react';
|
|
5
|
-
|
|
6
|
-
interface AdminShellProps extends HTMLAttributes<HTMLDivElement> {
|
|
7
|
-
/** 侧栏导航项 */
|
|
8
|
-
navItems: SidebarItem[];
|
|
9
|
-
/** 侧栏顶部区域,通常是品牌、租户或产品名 */
|
|
10
|
-
sidebarHeader?: ReactNode;
|
|
11
|
-
/** 侧栏底部区域,通常是用户区或退出入口 */
|
|
12
|
-
sidebarFooter?: ReactNode;
|
|
13
|
-
/** 侧栏视觉风格 */
|
|
14
|
-
sidebarVariant?: SidebarVariant;
|
|
15
|
-
/** 是否启用侧栏搜索 */
|
|
16
|
-
sidebarSearchable?: boolean;
|
|
17
|
-
/** 是否启用侧栏折叠 */
|
|
18
|
-
sidebarCollapsible?: boolean;
|
|
19
|
-
/** 受控折叠状态 */
|
|
20
|
-
sidebarCollapsed?: boolean;
|
|
21
|
-
/** 非受控默认折叠状态 */
|
|
22
|
-
defaultSidebarCollapsed?: boolean;
|
|
23
|
-
/** 折叠状态变化 */
|
|
24
|
-
onSidebarCollapsedChange?: (collapsed: boolean) => void;
|
|
25
|
-
/** 受控移动端侧栏状态 */
|
|
26
|
-
mobileSidebarOpen?: boolean;
|
|
27
|
-
/** 移动端侧栏状态变化 */
|
|
28
|
-
onMobileSidebarOpenChange?: (open: boolean) => void;
|
|
29
|
-
/** 顶栏左侧内容 */
|
|
30
|
-
topbarStart?: ReactNode;
|
|
31
|
-
/** 顶栏右侧内容 */
|
|
32
|
-
topbarEnd?: ReactNode;
|
|
33
|
-
/** 完全自定义顶栏内容 */
|
|
34
|
-
topbar?: ReactNode;
|
|
35
|
-
/** main 元素类名 */
|
|
36
|
-
mainClassName?: string;
|
|
37
|
-
/** 内容容器类名 */
|
|
38
|
-
contentClassName?: string;
|
|
39
|
-
/** 页面内容 */
|
|
40
|
-
children: ReactNode;
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* 后台框架模式
|
|
44
|
-
* @example
|
|
45
|
-
* <AdminShell
|
|
46
|
-
* navItems={items}
|
|
47
|
-
* sidebarHeader={<Brand />}
|
|
48
|
-
* topbarEnd={<UserMenu />}
|
|
49
|
-
* >
|
|
50
|
-
* <PageHeader title="控制台" />
|
|
51
|
-
* </AdminShell>
|
|
52
|
-
*/
|
|
53
|
-
declare const AdminShell: react.ForwardRefExoticComponent<AdminShellProps & react.RefAttributes<HTMLDivElement>>;
|
|
54
|
-
|
|
55
|
-
type ConfirmDialogVariant = 'default' | 'destructive';
|
|
56
|
-
interface ConfirmDialogProps extends Omit<ModalContentProps, 'children' | 'title'> {
|
|
57
|
-
/** 是否打开 */
|
|
58
|
-
open: boolean;
|
|
59
|
-
/** 打开状态变化回调 */
|
|
60
|
-
onOpenChange: (open: boolean) => void;
|
|
61
|
-
/** 标题 */
|
|
62
|
-
title: ReactNode;
|
|
63
|
-
/** 描述 */
|
|
64
|
-
description?: ReactNode;
|
|
65
|
-
/** 自定义正文内容 */
|
|
66
|
-
children?: ReactNode;
|
|
67
|
-
/** 变体,destructive 用于危险操作 */
|
|
68
|
-
variant?: ConfirmDialogVariant;
|
|
69
|
-
/** 自定义图标 */
|
|
70
|
-
icon?: LucideIcon;
|
|
71
|
-
/** 取消按钮文案 */
|
|
72
|
-
cancelText?: string;
|
|
73
|
-
/** 确认按钮文案 */
|
|
74
|
-
confirmText?: string;
|
|
75
|
-
/** 是否展示确认按钮 loading */
|
|
76
|
-
loading?: boolean;
|
|
77
|
-
/** 是否禁用确认按钮 */
|
|
78
|
-
disabled?: boolean;
|
|
79
|
-
/** 确认后是否自动关闭 */
|
|
80
|
-
closeOnConfirm?: boolean;
|
|
81
|
-
/** 取消回调 */
|
|
82
|
-
onCancel?: () => void;
|
|
83
|
-
/** 确认回调 */
|
|
84
|
-
onConfirm?: () => void | Promise<void>;
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* 确认弹窗模式
|
|
88
|
-
* @example
|
|
89
|
-
* <ConfirmDialog
|
|
90
|
-
* open={open}
|
|
91
|
-
* onOpenChange={setOpen}
|
|
92
|
-
* title="删除文件?"
|
|
93
|
-
* description="删除后不可恢复。"
|
|
94
|
-
* variant="destructive"
|
|
95
|
-
* confirmText="删除"
|
|
96
|
-
* onConfirm={handleDelete}
|
|
97
|
-
* />
|
|
98
|
-
*/
|
|
99
|
-
declare const ConfirmDialog: react.ForwardRefExoticComponent<ConfirmDialogProps & react.RefAttributes<HTMLDivElement>>;
|
|
100
|
-
|
|
101
|
-
interface CopyFieldProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
102
|
-
/** 实际复制的值 */
|
|
103
|
-
value: string;
|
|
104
|
-
/** 字段标签 */
|
|
105
|
-
label?: ReactNode;
|
|
106
|
-
/** 展示值;不传时展示 value */
|
|
107
|
-
displayValue?: ReactNode;
|
|
108
|
-
/** 是否使用等宽字体展示 */
|
|
109
|
-
monospace?: boolean;
|
|
110
|
-
/** 是否禁用复制 */
|
|
111
|
-
disabled?: boolean;
|
|
112
|
-
/** 复制按钮文案 */
|
|
113
|
-
copyLabel?: string;
|
|
114
|
-
/** 复制成功后的短暂文案 */
|
|
115
|
-
copiedLabel?: string;
|
|
116
|
-
/** 复制成功回调 */
|
|
117
|
-
onCopied?: (value: string) => void;
|
|
118
|
-
/** 复制失败回调 */
|
|
119
|
-
onCopyError?: (error: unknown) => void;
|
|
120
|
-
}
|
|
121
|
-
/**
|
|
122
|
-
* 可复制字段模式
|
|
123
|
-
* @example
|
|
124
|
-
* <CopyField label="访问地址" value="https://cdn.ug666.top/file.png" />
|
|
125
|
-
*/
|
|
126
|
-
declare const CopyField: react.ForwardRefExoticComponent<CopyFieldProps & react.RefAttributes<HTMLDivElement>>;
|
|
127
|
-
|
|
128
|
-
interface PageHeaderProps extends Omit<HTMLAttributes<HTMLElement>, 'title'> {
|
|
129
|
-
/** 标题上方的短标签,例如模块名或当前范围 */
|
|
130
|
-
eyebrow?: ReactNode;
|
|
131
|
-
/** 页面主标题 */
|
|
132
|
-
title: ReactNode;
|
|
133
|
-
/** 页面说明文案 */
|
|
134
|
-
description?: ReactNode;
|
|
135
|
-
/** 标题旁的状态、徽标或计数 */
|
|
136
|
-
badge?: ReactNode;
|
|
137
|
-
/** 面包屑、返回入口或路径区域 */
|
|
138
|
-
breadcrumb?: ReactNode;
|
|
139
|
-
/** 右侧主要操作区 */
|
|
140
|
-
actions?: ReactNode;
|
|
141
|
-
/** 标题下方的元信息,例如更新时间、所有者、环境 */
|
|
142
|
-
meta?: ReactNode;
|
|
143
|
-
/** 页头底部扩展区,例如 tabs 或筛选入口 */
|
|
144
|
-
children?: ReactNode;
|
|
145
|
-
}
|
|
146
|
-
/**
|
|
147
|
-
* 后台页面标题模式
|
|
148
|
-
* @example
|
|
149
|
-
* <PageHeader
|
|
150
|
-
* eyebrow="Storage"
|
|
151
|
-
* title="文件空间"
|
|
152
|
-
* description="管理项目文件、外链和访问策略。"
|
|
153
|
-
* actions={<Button>上传文件</Button>}
|
|
154
|
-
* />
|
|
155
|
-
*/
|
|
156
|
-
declare const PageHeader: react.ForwardRefExoticComponent<PageHeaderProps & react.RefAttributes<HTMLElement>>;
|
|
157
|
-
|
|
158
|
-
export { AdminShell, type AdminShellProps, ConfirmDialog, type ConfirmDialogProps, type ConfirmDialogVariant, CopyField, type CopyFieldProps, PageHeader, type PageHeaderProps, AdminShell as UGAdminShell, type AdminShellProps as UGAdminShellProps, ConfirmDialog as UGConfirmDialog, type ConfirmDialogProps as UGConfirmDialogProps, type ConfirmDialogVariant as UGConfirmDialogVariant, CopyField as UGCopyField, type CopyFieldProps as UGCopyFieldProps, PageHeader as UGPageHeader, type PageHeaderProps as UGPageHeaderProps };
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
export { a as Button, B as ButtonProps, a as UGButton, B as UGButtonProps, b as buttonVariants, b as ugButtonVariants } from '../button-CaLZig8j.cjs';
|
|
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 };
|
|
@@ -1,93 +0,0 @@
|
|
|
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 };
|
|
@@ -1,93 +0,0 @@
|
|
|
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 };
|