@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
package/dist/hooks/index.d.cts
DELETED
|
@@ -1,232 +0,0 @@
|
|
|
1
|
-
import { RefObject } from 'react';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* 防抖值,延迟 delay 毫秒后才更新
|
|
5
|
-
* @example
|
|
6
|
-
* const keyword = useDebounce(inputValue, 300)
|
|
7
|
-
*/
|
|
8
|
-
declare function useDebounce<T>(value: T, delay?: number): T;
|
|
9
|
-
|
|
10
|
-
type SetLocalStorageValue<T> = (value: T | ((prev: T) => T)) => void;
|
|
11
|
-
type UseLocalStorageReturn<T> = [T, SetLocalStorageValue<T>, () => void];
|
|
12
|
-
/**
|
|
13
|
-
* 自动读写 localStorage 的 useState
|
|
14
|
-
* @example
|
|
15
|
-
* const [token, setToken, removeToken] = useLocalStorage('token', '')
|
|
16
|
-
*/
|
|
17
|
-
declare function useLocalStorage<T>(key: string, initialValue: T): UseLocalStorageReturn<T>;
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* 监听 CSS media query 变化,返回当前是否匹配
|
|
21
|
-
* @example
|
|
22
|
-
* const isMobile = useMediaQuery('(max-width: 768px)')
|
|
23
|
-
* const prefersDark = useMediaQuery('(prefers-color-scheme: dark)')
|
|
24
|
-
*/
|
|
25
|
-
declare function useMediaQuery(query: string): boolean;
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* 点击 ref 元素外部时触发 handler
|
|
29
|
-
* @example
|
|
30
|
-
* const ref = useRef<HTMLDivElement>(null)
|
|
31
|
-
* useClickOutside(ref, () => setOpen(false))
|
|
32
|
-
*/
|
|
33
|
-
declare function useClickOutside<T extends HTMLElement>(ref: RefObject<T | null>, handler: () => void): void;
|
|
34
|
-
|
|
35
|
-
interface UseCopyToClipboardReturn {
|
|
36
|
-
copied: boolean;
|
|
37
|
-
copy: (text: string) => Promise<void>;
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* 复制文本到剪贴板,copied 状态 2 秒后自动重置
|
|
41
|
-
* @example
|
|
42
|
-
* const { copied, copy } = useCopyToClipboard()
|
|
43
|
-
* <button onClick={() => copy('hello')}>{copied ? '已复制' : '复制'}</button>
|
|
44
|
-
*/
|
|
45
|
-
declare function useCopyToClipboard(): UseCopyToClipboardReturn;
|
|
46
|
-
|
|
47
|
-
type UseToggleReturn = [boolean, () => void, (value: boolean) => void];
|
|
48
|
-
/**
|
|
49
|
-
* 简单的布尔值切换,返回 [value, toggle, setValue]
|
|
50
|
-
* @example
|
|
51
|
-
* const [isOpen, toggleOpen, setIsOpen] = useToggle(false)
|
|
52
|
-
* <button onClick={toggleOpen}>切换</button>
|
|
53
|
-
*/
|
|
54
|
-
declare function useToggle(initial?: boolean): UseToggleReturn;
|
|
55
|
-
|
|
56
|
-
interface UsePaginationOptions {
|
|
57
|
-
/** 数据总条数 */
|
|
58
|
-
total: number;
|
|
59
|
-
/** 每页条数,默认 10 */
|
|
60
|
-
pageSize?: number;
|
|
61
|
-
/** 初始页码,默认 1 */
|
|
62
|
-
initialPage?: number;
|
|
63
|
-
}
|
|
64
|
-
interface UsePaginationReturn {
|
|
65
|
-
/** 当前页码 (从 1 开始) */
|
|
66
|
-
page: number;
|
|
67
|
-
/** 总页数 */
|
|
68
|
-
totalPages: number;
|
|
69
|
-
/** 跳转到指定页 */
|
|
70
|
-
setPage: (p: number) => void;
|
|
71
|
-
/** 下一页 */
|
|
72
|
-
nextPage: () => void;
|
|
73
|
-
/** 上一页 */
|
|
74
|
-
prevPage: () => void;
|
|
75
|
-
/** 是否有下一页 */
|
|
76
|
-
hasNext: boolean;
|
|
77
|
-
/** 是否有上一页 */
|
|
78
|
-
hasPrev: boolean;
|
|
79
|
-
/** 当前页起始索引 (0-based,用于切片) */
|
|
80
|
-
startIndex: number;
|
|
81
|
-
/** 当前页结束索引 (exclusive,用于切片) */
|
|
82
|
-
endIndex: number;
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* 分页状态管理,提供页码、边界判断和数据切片索引
|
|
86
|
-
* @example
|
|
87
|
-
* const { page, totalPages, nextPage, prevPage, startIndex, endIndex } = usePagination({ total: 100, pageSize: 10 })
|
|
88
|
-
* const pageData = data.slice(startIndex, endIndex)
|
|
89
|
-
*/
|
|
90
|
-
declare function usePagination({ total, pageSize, initialPage, }: UsePaginationOptions): UsePaginationReturn;
|
|
91
|
-
|
|
92
|
-
type UseFormErrors<T extends Record<string, unknown>> = Partial<Record<keyof T, string>>;
|
|
93
|
-
interface UseFormReturn<T extends Record<string, unknown>> {
|
|
94
|
-
/** 当前表单值 */
|
|
95
|
-
values: T;
|
|
96
|
-
/** 字段错误信息 */
|
|
97
|
-
errors: UseFormErrors<T>;
|
|
98
|
-
/** 更新单个字段值 */
|
|
99
|
-
handleChange: <K extends keyof T>(name: K, value: T[K]) => void;
|
|
100
|
-
/** 设置字段错误 */
|
|
101
|
-
setError: (name: keyof T, message: string) => void;
|
|
102
|
-
/** 清除所有错误 */
|
|
103
|
-
clearErrors: () => void;
|
|
104
|
-
/** 重置表单到初始值 */
|
|
105
|
-
reset: () => void;
|
|
106
|
-
/** 表单是否被修改过 */
|
|
107
|
-
isDirty: boolean;
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
110
|
-
* 极简表单状态管理,提供值管理、错误处理和脏状态检测
|
|
111
|
-
* @example
|
|
112
|
-
* const form = useForm({ username: '', password: '' })
|
|
113
|
-
* <input value={form.values.username} onChange={e => form.handleChange('username', e.target.value)} />
|
|
114
|
-
* {form.errors.username && <span>{form.errors.username}</span>}
|
|
115
|
-
*/
|
|
116
|
-
declare function useForm<T extends Record<string, unknown>>(initialValues: T): UseFormReturn<T>;
|
|
117
|
-
|
|
118
|
-
/**
|
|
119
|
-
* 返回组件是否已在客户端挂载完成。
|
|
120
|
-
*
|
|
121
|
-
* 在 SSR 场景中,服务端渲染时始终返回 false,
|
|
122
|
-
* 客户端 hydration 完成后变为 true,可用于条件渲染仅客户端内容。
|
|
123
|
-
*
|
|
124
|
-
* @returns 组件是否已挂载
|
|
125
|
-
*
|
|
126
|
-
* @example
|
|
127
|
-
* ```tsx
|
|
128
|
-
* const isMounted = useMounted()
|
|
129
|
-
*
|
|
130
|
-
* if (!isMounted) return null // 服务端不渲染
|
|
131
|
-
* return <ClientOnlyComponent />
|
|
132
|
-
* ```
|
|
133
|
-
*/
|
|
134
|
-
declare function useMounted(): boolean;
|
|
135
|
-
|
|
136
|
-
/**
|
|
137
|
-
* 以指定间隔重复调用回调函数。
|
|
138
|
-
*
|
|
139
|
-
* 当 delay 为 null 时定时器自动暂停,可动态修改 delay 或 callback。
|
|
140
|
-
* 参考 Dan Abramov 的 useInterval 实现,使用 ref 保持 callback 最新引用。
|
|
141
|
-
*
|
|
142
|
-
* @param callback 每次触发时调用的函数
|
|
143
|
-
* @param delay 间隔毫秒数;传入 null 则暂停定时器
|
|
144
|
-
*
|
|
145
|
-
* @example
|
|
146
|
-
* ```tsx
|
|
147
|
-
* const [count, setCount] = useState(0)
|
|
148
|
-
* const [running, setRunning] = useState(true)
|
|
149
|
-
*
|
|
150
|
-
* useInterval(() => setCount(c => c + 1), running ? 1000 : null)
|
|
151
|
-
* ```
|
|
152
|
-
*/
|
|
153
|
-
declare function useInterval(callback: () => void, delay: number | null): void;
|
|
154
|
-
|
|
155
|
-
/**
|
|
156
|
-
* 在指定延迟后执行一次回调函数。
|
|
157
|
-
*
|
|
158
|
-
* 当 delay 为 null 时定时器不启动(暂停模式)。
|
|
159
|
-
* 每次 delay 变化都会重置定时器;组件卸载时自动清理。
|
|
160
|
-
*
|
|
161
|
-
* @param callback 延迟结束后调用的函数
|
|
162
|
-
* @param delay 延迟毫秒数;传入 null 则不执行
|
|
163
|
-
*
|
|
164
|
-
* @example
|
|
165
|
-
* ```tsx
|
|
166
|
-
* const [show, setShow] = useState(true)
|
|
167
|
-
*
|
|
168
|
-
* // 3 秒后自动隐藏提示
|
|
169
|
-
* useTimeout(() => setShow(false), show ? 3000 : null)
|
|
170
|
-
* ```
|
|
171
|
-
*/
|
|
172
|
-
declare function useTimeout(callback: () => void, delay: number | null): void;
|
|
173
|
-
|
|
174
|
-
interface UseHotkeysOptions {
|
|
175
|
-
/** 是否阻止默认浏览器行为,默认 false */
|
|
176
|
-
preventDefault?: boolean;
|
|
177
|
-
/** 监听目标,默认 window */
|
|
178
|
-
target?: HTMLElement | null;
|
|
179
|
-
}
|
|
180
|
-
/**
|
|
181
|
-
* 将快捷键字符串绑定到回调函数。
|
|
182
|
-
*
|
|
183
|
-
* 支持修饰键组合:ctrl、cmd(Meta)、alt、shift,加主键(不区分大小写)。
|
|
184
|
-
* 组件卸载时自动解绑。
|
|
185
|
-
*
|
|
186
|
-
* @param keys 快捷键字符串,如 "ctrl+k"、"cmd+s"、"escape"
|
|
187
|
-
* @param callback 触发时调用的函数
|
|
188
|
-
* @param options 额外配置项
|
|
189
|
-
*
|
|
190
|
-
* @example
|
|
191
|
-
* ```tsx
|
|
192
|
-
* // 全局搜索快捷键
|
|
193
|
-
* useHotkeys('ctrl+k', () => setSearchOpen(true), { preventDefault: true })
|
|
194
|
-
*
|
|
195
|
-
* // ESC 关闭弹窗
|
|
196
|
-
* useHotkeys('escape', () => setOpen(false))
|
|
197
|
-
*
|
|
198
|
-
* // 仅在特定元素内响应
|
|
199
|
-
* useHotkeys('ctrl+enter', handleSubmit, { target: formRef.current })
|
|
200
|
-
* ```
|
|
201
|
-
*/
|
|
202
|
-
declare function useHotkeys(keys: string, callback: (event: KeyboardEvent) => void, options?: UseHotkeysOptions): void;
|
|
203
|
-
|
|
204
|
-
/**
|
|
205
|
-
* 在指定目标上绑定事件监听器,组件卸载时自动清理。
|
|
206
|
-
*
|
|
207
|
-
* 支持三种目标类型:
|
|
208
|
-
* - 不传 target → 默认监听 window
|
|
209
|
-
* - 传入 HTMLElement → 监听该元素
|
|
210
|
-
* - 传入 null → 跳过绑定(适合 ref 未初始化的场景)
|
|
211
|
-
*
|
|
212
|
-
* @typeParam K WindowEventMap 中的事件名称
|
|
213
|
-
* @param event 事件名称,如 "scroll"、"resize"、"click"
|
|
214
|
-
* @param handler 事件处理函数
|
|
215
|
-
* @param target 监听目标;默认 window;传 null 跳过绑定
|
|
216
|
-
*
|
|
217
|
-
* @example
|
|
218
|
-
* ```tsx
|
|
219
|
-
* // 监听全局滚动
|
|
220
|
-
* useEventListener('scroll', () => setScrollY(window.scrollY))
|
|
221
|
-
*
|
|
222
|
-
* // 监听特定元素的点击
|
|
223
|
-
* const divRef = useRef<HTMLDivElement>(null)
|
|
224
|
-
* useEventListener('click', handleClick, divRef.current)
|
|
225
|
-
*
|
|
226
|
-
* // 传入 null 跳过(ref 尚未挂载时)
|
|
227
|
-
* useEventListener('mouseenter', onEnter, ref.current)
|
|
228
|
-
* ```
|
|
229
|
-
*/
|
|
230
|
-
declare function useEventListener<K extends keyof WindowEventMap>(event: K, handler: (event: WindowEventMap[K]) => void, target?: EventTarget | null): void;
|
|
231
|
-
|
|
232
|
-
export { type SetLocalStorageValue, type UseCopyToClipboardReturn, type UseFormErrors, type UseFormReturn, type UseHotkeysOptions, type UseLocalStorageReturn, type UsePaginationOptions, type UsePaginationReturn, type UseToggleReturn, useClickOutside, useCopyToClipboard, useDebounce, useEventListener, useForm, useHotkeys, useInterval, useLocalStorage, useMediaQuery, useMounted, usePagination, useTimeout, useToggle };
|
package/dist/index.d.cts
DELETED
|
@@ -1,297 +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
|
-
export { Badge, BadgeProps, Card, CardContent, CardContentProps, CardDescription, CardDescriptionProps, CardFooter, CardFooterProps, CardHeader, CardHeaderProps, CardProps, CardTitle, CardTitleProps, Input, InputProps, Label, LabelProps, Separator, SeparatorOrientation, SeparatorProps, Spinner, SpinnerProps, Tag, TagProps, Badge as UGBadge, BadgeProps as UGBadgeProps, Card as UGCard, CardContent as UGCardContent, CardContentProps as UGCardContentProps, CardDescription as UGCardDescription, CardDescriptionProps as UGCardDescriptionProps, CardFooter as UGCardFooter, CardFooterProps as UGCardFooterProps, CardHeader as UGCardHeader, CardHeaderProps as UGCardHeaderProps, CardProps as UGCardProps, CardTitle as UGCardTitle, CardTitleProps as UGCardTitleProps, Input as UGInput, InputProps as UGInputProps, Label as UGLabel, LabelProps as UGLabelProps, Separator as UGSeparator, SeparatorOrientation as UGSeparatorOrientation, SeparatorProps as UGSeparatorProps, Spinner as UGSpinner, SpinnerProps as UGSpinnerProps, Tag as UGTag, TagProps as UGTagProps, badgeVariants, tagVariants, badgeVariants as ugBadgeVariants, tagVariants as ugTagVariants } from './primitives/index.cjs';
|
|
3
|
-
export { M as Modal, a as ModalCloseButton, b as ModalCloseButtonProps, c as ModalContent, d as ModalContentProps, e as ModalFooter, f as ModalFooterProps, g as ModalHeader, h as ModalHeaderProps, i as ModalProps, j as ModalTitle, k as ModalTitleProps, S as Sidebar, l as SidebarItem, m as SidebarProps, M as UGModal, a as UGModalCloseButton, b as UGModalCloseButtonProps, c as UGModalContent, d as UGModalContentProps, e as UGModalFooter, f as UGModalFooterProps, g as UGModalHeader, h as UGModalHeaderProps, i as UGModalProps, j as UGModalTitle, k as UGModalTitleProps, S as UGSidebar, l as UGSidebarItem, m as UGSidebarProps } from './sidebar-vl00Z2o-.cjs';
|
|
4
|
-
export { Accordion, AccordionContent, AccordionContentProps, AccordionItem, AccordionItemProps, AccordionMultipleProps, AccordionProps, AccordionSingleProps, AccordionTrigger, AccordionTriggerProps, AccordionType, Alert, AlertDescription, AlertDescriptionProps, AlertProps, AlertTitle, AlertTitleProps, Avatar, AvatarFallback, AvatarFallbackProps, AvatarGroup, AvatarGroupProps, AvatarGroupSize, AvatarImage, AvatarImageProps, AvatarProps, Breadcrumb, BreadcrumbItem, BreadcrumbItemProps, BreadcrumbLink, BreadcrumbLinkProps, BreadcrumbProps, BreadcrumbSeparator, BreadcrumbSeparatorProps, Checkbox, CheckboxProps, ContextMenu, ContextMenuContent, ContextMenuContentProps, ContextMenuItem, ContextMenuItemProps, ContextMenuProps, ContextMenuSeparator, ContextMenuSeparatorProps, ContextMenuTrigger, ContextMenuTriggerProps, Descriptions, DescriptionsItem, DescriptionsItemProps, DescriptionsProps, DescriptionsSize, Dialog, DialogProps, DialogVariant, Drawer, DrawerClose, DrawerCloseProps, DrawerContent, DrawerContentProps, DrawerDescription, DrawerDescriptionProps, DrawerFooter, DrawerFooterProps, DrawerHeader, DrawerHeaderProps, DrawerProps, DrawerSide, DrawerTitle, DrawerTitleProps, DropdownContent, DropdownContentProps, DropdownItem, DropdownItemProps, DropdownMenu, DropdownMenuProps, DropdownSeparator, DropdownSeparatorProps, DropdownTrigger, DropdownTriggerProps, EmptyState, EmptyStateProps, Form, FormControl, FormControlProps, FormDescription, FormDescriptionProps, FormField, FormFieldProps, FormItem, FormItemProps, FormLabel, FormLabelProps, FormMessage, FormMessageProps, FormProps, NavigationMenu, NavigationMenuContent, NavigationMenuContentProps, NavigationMenuItem, NavigationMenuItemProps, NavigationMenuLink, NavigationMenuLinkProps, NavigationMenuProps, NavigationMenuTrigger, NavigationMenuTriggerProps, NumberInput, NumberInputProps, OTPInput, OTPInputProps, Pagination, PaginationProps, Popover, PopoverAlign, PopoverContent, PopoverContentProps, PopoverProps, PopoverSide, PopoverTrigger, PopoverTriggerProps, Progress, ProgressColor, ProgressProps, Radio, RadioGroup, RadioGroupProps, RadioProps, Select, SelectOption, SelectProps, Sheet, SheetProps, Skeleton, SkeletonProps, Slider, SliderProps, Statistic, StatisticProps, StatisticSize, StatisticTrend, StepItem, Steps, StepsProps, Switch, SwitchProps, Table, TableBody, TableBodyProps, TableCell, TableCellProps, TableHead, TableHeadProps, TableHeader, TableHeaderProps, TableProps, TableRow, TableRowProps, Tabs, TabsContent, TabsContentProps, TabsList, TabsListProps, TabsProps, TabsTrigger, TabsTriggerProps, Textarea, TextareaProps, ToastItem, ToastType, Toaster, Tooltip, TooltipContent, TooltipContentProps, TooltipProps, TooltipTrigger, TooltipTriggerProps, Accordion as UGAccordion, AccordionContent as UGAccordionContent, AccordionContentProps as UGAccordionContentProps, AccordionItem as UGAccordionItem, AccordionItemProps as UGAccordionItemProps, AccordionMultipleProps as UGAccordionMultipleProps, AccordionProps as UGAccordionProps, AccordionSingleProps as UGAccordionSingleProps, AccordionTrigger as UGAccordionTrigger, AccordionTriggerProps as UGAccordionTriggerProps, AccordionType as UGAccordionType, Alert as UGAlert, AlertDescription as UGAlertDescription, AlertDescriptionProps as UGAlertDescriptionProps, AlertProps as UGAlertProps, AlertTitle as UGAlertTitle, AlertTitleProps as UGAlertTitleProps, Avatar as UGAvatar, AvatarFallback as UGAvatarFallback, AvatarFallbackProps as UGAvatarFallbackProps, AvatarGroup as UGAvatarGroup, AvatarGroupProps as UGAvatarGroupProps, AvatarGroupSize as UGAvatarGroupSize, AvatarImage as UGAvatarImage, AvatarImageProps as UGAvatarImageProps, AvatarProps as UGAvatarProps, Breadcrumb as UGBreadcrumb, BreadcrumbItem as UGBreadcrumbItem, BreadcrumbItemProps as UGBreadcrumbItemProps, BreadcrumbLink as UGBreadcrumbLink, BreadcrumbLinkProps as UGBreadcrumbLinkProps, BreadcrumbProps as UGBreadcrumbProps, BreadcrumbSeparator as UGBreadcrumbSeparator, BreadcrumbSeparatorProps as UGBreadcrumbSeparatorProps, Checkbox as UGCheckbox, CheckboxProps as UGCheckboxProps, ContextMenu as UGContextMenu, ContextMenuContent as UGContextMenuContent, ContextMenuContentProps as UGContextMenuContentProps, ContextMenuItem as UGContextMenuItem, ContextMenuItemProps as UGContextMenuItemProps, ContextMenuProps as UGContextMenuProps, ContextMenuSeparator as UGContextMenuSeparator, ContextMenuSeparatorProps as UGContextMenuSeparatorProps, ContextMenuTrigger as UGContextMenuTrigger, ContextMenuTriggerProps as UGContextMenuTriggerProps, Descriptions as UGDescriptions, DescriptionsItem as UGDescriptionsItem, DescriptionsItemProps as UGDescriptionsItemProps, DescriptionsProps as UGDescriptionsProps, DescriptionsSize as UGDescriptionsSize, Dialog as UGDialog, DialogProps as UGDialogProps, DialogVariant as UGDialogVariant, Drawer as UGDrawer, DrawerClose as UGDrawerClose, DrawerCloseProps as UGDrawerCloseProps, DrawerContent as UGDrawerContent, DrawerContentProps as UGDrawerContentProps, DrawerDescription as UGDrawerDescription, DrawerDescriptionProps as UGDrawerDescriptionProps, DrawerFooter as UGDrawerFooter, DrawerFooterProps as UGDrawerFooterProps, DrawerHeader as UGDrawerHeader, DrawerHeaderProps as UGDrawerHeaderProps, DrawerProps as UGDrawerProps, DrawerSide as UGDrawerSide, DrawerTitle as UGDrawerTitle, DrawerTitleProps as UGDrawerTitleProps, DropdownMenu as UGDropdown, DropdownContent as UGDropdownContent, DropdownContentProps as UGDropdownContentProps, DropdownItem as UGDropdownItem, DropdownItemProps as UGDropdownItemProps, DropdownMenu as UGDropdownMenu, DropdownMenuProps as UGDropdownMenuProps, DropdownMenuProps as UGDropdownProps, DropdownSeparator as UGDropdownSeparator, DropdownSeparatorProps as UGDropdownSeparatorProps, DropdownTrigger as UGDropdownTrigger, DropdownTriggerProps as UGDropdownTriggerProps, EmptyState as UGEmptyState, EmptyStateProps as UGEmptyStateProps, Form as UGForm, FormControl as UGFormControl, FormControlProps as UGFormControlProps, FormDescription as UGFormDescription, FormDescriptionProps as UGFormDescriptionProps, FormField as UGFormField, FormFieldProps as UGFormFieldProps, FormItem as UGFormItem, FormItemProps as UGFormItemProps, FormLabel as UGFormLabel, FormLabelProps as UGFormLabelProps, FormMessage as UGFormMessage, FormMessageProps as UGFormMessageProps, FormProps as UGFormProps, NavigationMenu as UGNavigationMenu, NavigationMenuContent as UGNavigationMenuContent, NavigationMenuContentProps as UGNavigationMenuContentProps, NavigationMenuItem as UGNavigationMenuItem, NavigationMenuItemProps as UGNavigationMenuItemProps, NavigationMenuLink as UGNavigationMenuLink, NavigationMenuLinkProps as UGNavigationMenuLinkProps, NavigationMenuProps as UGNavigationMenuProps, NavigationMenuTrigger as UGNavigationMenuTrigger, NavigationMenuTriggerProps as UGNavigationMenuTriggerProps, NumberInput as UGNumberInput, NumberInputProps as UGNumberInputProps, OTPInput as UGOTPInput, OTPInputProps as UGOTPInputProps, Pagination as UGPagination, PaginationProps as UGPaginationProps, Popover as UGPopover, PopoverAlign as UGPopoverAlign, PopoverContent as UGPopoverContent, PopoverContentProps as UGPopoverContentProps, PopoverProps as UGPopoverProps, PopoverSide as UGPopoverSide, PopoverTrigger as UGPopoverTrigger, PopoverTriggerProps as UGPopoverTriggerProps, Progress as UGProgress, ProgressColor as UGProgressColor, ProgressProps as UGProgressProps, Radio as UGRadio, RadioGroup as UGRadioGroup, RadioGroupProps as UGRadioGroupProps, RadioProps as UGRadioProps, Select as UGSelect, SelectOption as UGSelectOption, SelectProps as UGSelectProps, Sheet as UGSheet, SheetProps as UGSheetProps, Skeleton as UGSkeleton, SkeletonProps as UGSkeletonProps, Slider as UGSlider, SliderProps as UGSliderProps, Statistic as UGStatistic, StatisticProps as UGStatisticProps, StatisticSize as UGStatisticSize, StatisticTrend as UGStatisticTrend, StepItem as UGStepItem, Steps as UGSteps, StepsProps as UGStepsProps, Switch as UGSwitch, SwitchProps as UGSwitchProps, Table as UGTable, TableBody as UGTableBody, TableBodyProps as UGTableBodyProps, TableCell as UGTableCell, TableCellProps as UGTableCellProps, TableHead as UGTableHead, TableHeadProps as UGTableHeadProps, TableHeader as UGTableHeader, TableHeaderProps as UGTableHeaderProps, TableProps as UGTableProps, TableRow as UGTableRow, TableRowProps as UGTableRowProps, Tabs as UGTabs, TabsContent as UGTabsContent, TabsContentProps as UGTabsContentProps, TabsList as UGTabsList, TabsListProps as UGTabsListProps, TabsProps as UGTabsProps, TabsTrigger as UGTabsTrigger, TabsTriggerProps as UGTabsTriggerProps, Textarea as UGTextarea, TextareaProps as UGTextareaProps, ToastItem as UGToastItem, ToastType as UGToastType, Toaster as UGToaster, Tooltip as UGTooltip, TooltipContent as UGTooltipContent, TooltipContentProps as UGTooltipContentProps, TooltipProps as UGTooltipProps, TooltipTrigger as UGTooltipTrigger, TooltipTriggerProps as UGTooltipTriggerProps, checkboxVariants, numberInputVariants, toast, checkboxVariants as ugCheckboxVariants, numberInputVariants as ugNumberInputVariants } from './components/index.cjs';
|
|
5
|
-
import { ClassValue } from 'clsx';
|
|
6
|
-
export { SetLocalStorageValue, UseCopyToClipboardReturn, UseFormErrors, UseFormReturn, UseHotkeysOptions, UseLocalStorageReturn, UsePaginationOptions, UsePaginationReturn, UseToggleReturn, useClickOutside, useCopyToClipboard, useDebounce, useEventListener, useForm, useHotkeys, useInterval, useLocalStorage, useMediaQuery, useMounted, usePagination, useTimeout, useToggle } from './hooks/index.cjs';
|
|
7
|
-
import 'react';
|
|
8
|
-
import 'class-variance-authority/types';
|
|
9
|
-
import 'class-variance-authority';
|
|
10
|
-
import 'lucide-react';
|
|
11
|
-
import 'react/jsx-runtime';
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* @description: 主题配置 — 暴露与 configs/tokens.css 对齐的 CSS 变量引用
|
|
15
|
-
* @author: UG - 一个斗码大陆苦逼的三段码之气的少年,并没有神秘戒指中码老的帮助,但总有一天,我会成为斗码大陆中码帝一样的存在。三十年河东,三十年河西,莫欺少年穷。
|
|
16
|
-
* @date: 2026-04-15
|
|
17
|
-
*/
|
|
18
|
-
declare const theme: {
|
|
19
|
-
readonly colors: {
|
|
20
|
-
readonly primary: {
|
|
21
|
-
readonly DEFAULT: "hsl(var(--primary))";
|
|
22
|
-
readonly hover: "hsl(var(--primary-hover))";
|
|
23
|
-
readonly active: "hsl(var(--primary-active))";
|
|
24
|
-
readonly foreground: "hsl(var(--primary-fg))";
|
|
25
|
-
readonly soft: "hsl(var(--primary-soft) / 0.12)";
|
|
26
|
-
readonly softForeground: "hsl(var(--primary-soft-fg))";
|
|
27
|
-
};
|
|
28
|
-
readonly success: {
|
|
29
|
-
readonly DEFAULT: "hsl(var(--success))";
|
|
30
|
-
readonly hover: "hsl(var(--success-hover))";
|
|
31
|
-
readonly foreground: "hsl(var(--success-fg))";
|
|
32
|
-
readonly soft: "hsl(var(--success-soft) / 0.12)";
|
|
33
|
-
readonly softForeground: "hsl(var(--success-soft-fg))";
|
|
34
|
-
};
|
|
35
|
-
readonly warning: {
|
|
36
|
-
readonly DEFAULT: "hsl(var(--warning))";
|
|
37
|
-
readonly hover: "hsl(var(--warning-hover))";
|
|
38
|
-
readonly foreground: "hsl(var(--warning-fg))";
|
|
39
|
-
readonly soft: "hsl(var(--warning-soft) / 0.12)";
|
|
40
|
-
readonly softForeground: "hsl(var(--warning-soft-fg))";
|
|
41
|
-
};
|
|
42
|
-
readonly danger: {
|
|
43
|
-
readonly DEFAULT: "hsl(var(--danger))";
|
|
44
|
-
readonly hover: "hsl(var(--danger-hover))";
|
|
45
|
-
readonly foreground: "hsl(var(--danger-fg))";
|
|
46
|
-
readonly soft: "hsl(var(--danger-soft) / 0.12)";
|
|
47
|
-
readonly softForeground: "hsl(var(--danger-soft-fg))";
|
|
48
|
-
};
|
|
49
|
-
readonly info: {
|
|
50
|
-
readonly DEFAULT: "hsl(var(--info))";
|
|
51
|
-
readonly hover: "hsl(var(--info-hover))";
|
|
52
|
-
readonly foreground: "hsl(var(--info-fg))";
|
|
53
|
-
readonly soft: "hsl(var(--info-soft) / 0.12)";
|
|
54
|
-
readonly softForeground: "hsl(var(--info-soft-fg))";
|
|
55
|
-
};
|
|
56
|
-
readonly surface: {
|
|
57
|
-
readonly 0: "hsl(var(--surface-0))";
|
|
58
|
-
readonly 1: "hsl(var(--surface-1))";
|
|
59
|
-
readonly 2: "hsl(var(--surface-2))";
|
|
60
|
-
readonly 3: "hsl(var(--surface-3))";
|
|
61
|
-
};
|
|
62
|
-
readonly text: {
|
|
63
|
-
readonly primary: "hsl(var(--text-primary))";
|
|
64
|
-
readonly secondary: "hsl(var(--text-secondary))";
|
|
65
|
-
readonly tertiary: "hsl(var(--text-tertiary))";
|
|
66
|
-
readonly inverted: "hsl(var(--text-inverted))";
|
|
67
|
-
};
|
|
68
|
-
readonly border: {
|
|
69
|
-
readonly strong: "hsl(var(--border-strong))";
|
|
70
|
-
readonly base: "hsl(var(--border-base))";
|
|
71
|
-
readonly subtle: "hsl(var(--border-subtle))";
|
|
72
|
-
};
|
|
73
|
-
readonly ring: "hsl(var(--ring))";
|
|
74
|
-
readonly overlay: "hsl(var(--overlay) / var(--overlay-alpha))";
|
|
75
|
-
};
|
|
76
|
-
readonly radius: {
|
|
77
|
-
readonly sm: "var(--radius-sm)";
|
|
78
|
-
readonly md: "var(--radius-md)";
|
|
79
|
-
readonly lg: "var(--radius-lg)";
|
|
80
|
-
readonly xl: "var(--radius-xl)";
|
|
81
|
-
readonly full: "9999px";
|
|
82
|
-
};
|
|
83
|
-
readonly fontFamily: {
|
|
84
|
-
readonly sans: "var(--font-sans)";
|
|
85
|
-
readonly mono: "var(--font-mono)";
|
|
86
|
-
};
|
|
87
|
-
};
|
|
88
|
-
type Theme = typeof theme;
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* @description: React 包内部类名合并工具
|
|
92
|
-
* @author: UG - 一个斗码大陆苦逼的三段码之气的少年,并没有神秘戒指中码老的帮助,但总有一天,我会成为斗码大陆中码帝一样的存在。三十年河东,三十年河西,莫欺少年穷。
|
|
93
|
-
* @date: 2026-05-27
|
|
94
|
-
*/
|
|
95
|
-
|
|
96
|
-
declare function cn(...inputs: ClassValue[]): string;
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* @description: React 组件分层清单 — 供文档导航和自动化脚本复用
|
|
100
|
-
* @author: UG - 一个斗码大陆苦逼的三段码之气的少年,并没有神秘戒指中码老的帮助,但总有一天,我会成为斗码大陆中码帝一样的存在。三十年河东,三十年河西,莫欺少年穷。
|
|
101
|
-
* @date: 2026-05-27
|
|
102
|
-
*/
|
|
103
|
-
declare const reactComponentLayers: readonly [{
|
|
104
|
-
readonly id: "primitives";
|
|
105
|
-
readonly label: "基础组件";
|
|
106
|
-
readonly description: "最小可复用视觉单元,负责按钮、容器、标签、分隔和加载基础状态。";
|
|
107
|
-
readonly components: readonly [{
|
|
108
|
-
readonly name: "UGButton";
|
|
109
|
-
readonly route: "/react/components/button";
|
|
110
|
-
}, {
|
|
111
|
-
readonly name: "UGInput";
|
|
112
|
-
readonly route: "/react/components/input";
|
|
113
|
-
}, {
|
|
114
|
-
readonly name: "UGLabel";
|
|
115
|
-
readonly route: "/react/components/label";
|
|
116
|
-
}, {
|
|
117
|
-
readonly name: "UGCard";
|
|
118
|
-
readonly route: "/react/components/card";
|
|
119
|
-
}, {
|
|
120
|
-
readonly name: "UGBadge";
|
|
121
|
-
readonly route: "/react/components/badge";
|
|
122
|
-
}, {
|
|
123
|
-
readonly name: "UGTag";
|
|
124
|
-
readonly route: "/react/components/tag";
|
|
125
|
-
}, {
|
|
126
|
-
readonly name: "UGSeparator";
|
|
127
|
-
readonly route: "/react/components/separator";
|
|
128
|
-
}, {
|
|
129
|
-
readonly name: "UGSpinner";
|
|
130
|
-
readonly route: "/react/components/spinner";
|
|
131
|
-
}];
|
|
132
|
-
}, {
|
|
133
|
-
readonly id: "forms";
|
|
134
|
-
readonly label: "表单输入";
|
|
135
|
-
readonly description: "收集、校验和编辑用户输入,要求标签、帮助文本、错误状态稳定对齐。";
|
|
136
|
-
readonly components: readonly [{
|
|
137
|
-
readonly name: "UGTextarea";
|
|
138
|
-
readonly route: "/react/components/textarea";
|
|
139
|
-
}, {
|
|
140
|
-
readonly name: "UGSelect";
|
|
141
|
-
readonly route: "/react/components/select";
|
|
142
|
-
}, {
|
|
143
|
-
readonly name: "UGCheckbox";
|
|
144
|
-
readonly route: "/react/components/checkbox";
|
|
145
|
-
}, {
|
|
146
|
-
readonly name: "UGRadio";
|
|
147
|
-
readonly route: "/react/components/radio";
|
|
148
|
-
}, {
|
|
149
|
-
readonly name: "UGSwitch";
|
|
150
|
-
readonly route: "/react/components/switch";
|
|
151
|
-
}, {
|
|
152
|
-
readonly name: "UGSlider";
|
|
153
|
-
readonly route: "/react/components/slider";
|
|
154
|
-
}, {
|
|
155
|
-
readonly name: "UGNumberInput";
|
|
156
|
-
readonly route: "/react/components/number-input";
|
|
157
|
-
}, {
|
|
158
|
-
readonly name: "UGOTPInput";
|
|
159
|
-
readonly route: "/react/components/otp-input";
|
|
160
|
-
}, {
|
|
161
|
-
readonly name: "UGForm";
|
|
162
|
-
readonly route: "/react/components/form";
|
|
163
|
-
}];
|
|
164
|
-
}, {
|
|
165
|
-
readonly id: "navigation";
|
|
166
|
-
readonly label: "导航流程";
|
|
167
|
-
readonly description: "页面定位、区域切换、分页和流程表达,要求选中态明确且移动端不溢出。";
|
|
168
|
-
readonly components: readonly [{
|
|
169
|
-
readonly name: "UGTabs";
|
|
170
|
-
readonly route: "/react/components/tabs";
|
|
171
|
-
}, {
|
|
172
|
-
readonly name: "UGBreadcrumb";
|
|
173
|
-
readonly route: "/react/components/breadcrumb";
|
|
174
|
-
}, {
|
|
175
|
-
readonly name: "UGPagination";
|
|
176
|
-
readonly route: "/react/components/pagination";
|
|
177
|
-
}, {
|
|
178
|
-
readonly name: "UGNavigationMenu";
|
|
179
|
-
readonly route: "/react/components/navigation-menu";
|
|
180
|
-
}, {
|
|
181
|
-
readonly name: "UGSidebar";
|
|
182
|
-
readonly route: "/react/components/sidebar";
|
|
183
|
-
}, {
|
|
184
|
-
readonly name: "UGSteps";
|
|
185
|
-
readonly route: "/react/components/steps";
|
|
186
|
-
}];
|
|
187
|
-
}, {
|
|
188
|
-
readonly id: "overlays";
|
|
189
|
-
readonly label: "浮层弹层";
|
|
190
|
-
readonly description: "临时承载操作和上下文信息,要求定位、关闭、焦点和遮罩行为可靠。";
|
|
191
|
-
readonly components: readonly [{
|
|
192
|
-
readonly name: "UGModal";
|
|
193
|
-
readonly route: "/react/components/modal";
|
|
194
|
-
}, {
|
|
195
|
-
readonly name: "UGDialog";
|
|
196
|
-
readonly route: "/react/components/dialog";
|
|
197
|
-
}, {
|
|
198
|
-
readonly name: "UGDrawer";
|
|
199
|
-
readonly route: "/react/components/drawer";
|
|
200
|
-
}, {
|
|
201
|
-
readonly name: "UGSheet";
|
|
202
|
-
readonly route: "/react/components/sheet";
|
|
203
|
-
}, {
|
|
204
|
-
readonly name: "UGDropdownMenu";
|
|
205
|
-
readonly route: "/react/components/dropdown";
|
|
206
|
-
}, {
|
|
207
|
-
readonly name: "UGContextMenu";
|
|
208
|
-
readonly route: "/react/components/context-menu";
|
|
209
|
-
}, {
|
|
210
|
-
readonly name: "UGPopover";
|
|
211
|
-
readonly route: "/react/components/popover";
|
|
212
|
-
}, {
|
|
213
|
-
readonly name: "UGTooltip";
|
|
214
|
-
readonly route: "/react/components/tooltip";
|
|
215
|
-
}];
|
|
216
|
-
}, {
|
|
217
|
-
readonly id: "feedback";
|
|
218
|
-
readonly label: "反馈状态";
|
|
219
|
-
readonly description: "表达成功、警告、错误、空状态和加载过程,要求语义文案和视觉状态一致。";
|
|
220
|
-
readonly components: readonly [{
|
|
221
|
-
readonly name: "UGAlert";
|
|
222
|
-
readonly route: "/react/components/alert";
|
|
223
|
-
}, {
|
|
224
|
-
readonly name: "UGToaster";
|
|
225
|
-
readonly route: "/react/components/toast";
|
|
226
|
-
}, {
|
|
227
|
-
readonly name: "UGProgress";
|
|
228
|
-
readonly route: "/react/components/progress";
|
|
229
|
-
}, {
|
|
230
|
-
readonly name: "UGSkeleton";
|
|
231
|
-
readonly route: "/react/components/skeleton";
|
|
232
|
-
}, {
|
|
233
|
-
readonly name: "UGEmptyState";
|
|
234
|
-
readonly route: "/react/components/empty-state";
|
|
235
|
-
}];
|
|
236
|
-
}, {
|
|
237
|
-
readonly id: "data";
|
|
238
|
-
readonly label: "数据展示";
|
|
239
|
-
readonly description: "展示列表、对象详情、头像、指标和折叠信息,要求密度清晰且文本不挤出。";
|
|
240
|
-
readonly components: readonly [{
|
|
241
|
-
readonly name: "UGTable";
|
|
242
|
-
readonly route: "/react/components/table";
|
|
243
|
-
}, {
|
|
244
|
-
readonly name: "UGDescriptions";
|
|
245
|
-
readonly route: "/react/components/descriptions";
|
|
246
|
-
}, {
|
|
247
|
-
readonly name: "UGStatistic";
|
|
248
|
-
readonly route: "/react/components/statistic";
|
|
249
|
-
}, {
|
|
250
|
-
readonly name: "UGAvatar";
|
|
251
|
-
readonly route: "/react/components/avatar";
|
|
252
|
-
}, {
|
|
253
|
-
readonly name: "UGAvatarGroup";
|
|
254
|
-
readonly route: "/react/components/avatar-group";
|
|
255
|
-
}, {
|
|
256
|
-
readonly name: "UGAccordion";
|
|
257
|
-
readonly route: "/react/components/accordion";
|
|
258
|
-
}];
|
|
259
|
-
}, {
|
|
260
|
-
readonly id: "patterns";
|
|
261
|
-
readonly label: "框架模式";
|
|
262
|
-
readonly description: "后台、工具型和跨业务通用模式,通过子入口 @ug666/ui-react/patterns 使用。";
|
|
263
|
-
readonly components: readonly [{
|
|
264
|
-
readonly name: "UGAdminShell";
|
|
265
|
-
readonly route: "/react/patterns#adminshell";
|
|
266
|
-
}, {
|
|
267
|
-
readonly name: "UGPageHeader";
|
|
268
|
-
readonly route: "/react/patterns#pageheader";
|
|
269
|
-
}, {
|
|
270
|
-
readonly name: "UGCopyField";
|
|
271
|
-
readonly route: "/react/patterns#copyfield";
|
|
272
|
-
}, {
|
|
273
|
-
readonly name: "UGConfirmDialog";
|
|
274
|
-
readonly route: "/react/patterns#confirmdialog";
|
|
275
|
-
}];
|
|
276
|
-
}, {
|
|
277
|
-
readonly id: "blocks";
|
|
278
|
-
readonly label: "展示区块";
|
|
279
|
-
readonly description: "展示页、产品页和介绍页区块,通过子入口 @ug666/ui-react/blocks 使用。";
|
|
280
|
-
readonly components: readonly [{
|
|
281
|
-
readonly name: "UGLandingHero";
|
|
282
|
-
readonly route: "/react/blocks#landinghero";
|
|
283
|
-
}, {
|
|
284
|
-
readonly name: "UGFeatureGrid";
|
|
285
|
-
readonly route: "/react/blocks#featuregrid";
|
|
286
|
-
}];
|
|
287
|
-
}, {
|
|
288
|
-
readonly id: "labs";
|
|
289
|
-
readonly label: "实验组件";
|
|
290
|
-
readonly description: "尚未稳定承诺的实验组件,通过子入口 @ug666/ui-react/labs 使用。";
|
|
291
|
-
readonly components: readonly [];
|
|
292
|
-
}];
|
|
293
|
-
type ReactComponentLayer = (typeof reactComponentLayers)[number];
|
|
294
|
-
type ReactLayerId = ReactComponentLayer['id'];
|
|
295
|
-
type ReactLayerComponent = ReactComponentLayer['components'][number];
|
|
296
|
-
|
|
297
|
-
export { type ReactComponentLayer, type ReactLayerComponent, type ReactLayerId, type Theme, cn, reactComponentLayers, theme };
|
package/dist/labs/index.d.cts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description: React labs 子入口 — 实验组件占位入口,稳定前不进入主入口
|
|
3
|
-
* @author: UG - 一个斗码大陆苦逼的三段码之气的少年,并没有神秘戒指中码老的帮助,但总有一天,我会成为斗码大陆中码帝一样的存在。三十年河东,三十年河西,莫欺少年穷。
|
|
4
|
-
* @date: 2026-05-30
|
|
5
|
-
*/
|
|
6
|
-
declare const reactLabsEntrypoint: {
|
|
7
|
-
readonly stability: "experimental";
|
|
8
|
-
readonly description: "用于孵化还未稳定的 ug-ui React 组件,正式使用前需要先晋升到 patterns、blocks 或 components。";
|
|
9
|
-
};
|
|
10
|
-
type ReactLabsEntrypoint = typeof reactLabsEntrypoint;
|
|
11
|
-
|
|
12
|
-
export { type ReactLabsEntrypoint, reactLabsEntrypoint };
|