vxui-re 1.0.6 → 1.0.7
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/index.cjs +2 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +17428 -0
- package/dist/src/components/Accordion.d.ts +14 -0
- package/dist/src/components/Alert.d.ts +10 -0
- package/dist/src/components/AppShell.d.ts +33 -0
- package/dist/src/components/Article.d.ts +72 -0
- package/dist/src/components/Avatar.d.ts +12 -0
- package/dist/src/components/Badge.d.ts +7 -0
- package/dist/src/components/Breadcrumb.d.ts +12 -0
- package/dist/src/components/Button.d.ts +18 -0
- package/dist/src/components/Calendar.d.ts +10 -0
- package/dist/src/components/Card.d.ts +17 -0
- package/dist/src/components/Carousel.d.ts +15 -0
- package/dist/src/components/Checkbox.d.ts +7 -0
- package/dist/src/components/CodeBlock.d.ts +9 -0
- package/dist/src/components/ColorPicker.d.ts +13 -0
- package/dist/src/components/CommandPalette.d.ts +22 -0
- package/dist/src/components/ContextMenu.d.ts +20 -0
- package/dist/src/components/DatePicker.d.ts +15 -0
- package/dist/src/components/Descriptions.d.ts +29 -0
- package/dist/src/components/Dialog.d.ts +49 -0
- package/dist/src/components/DropdownMenu.d.ts +55 -0
- package/dist/src/components/EmptyState.d.ts +9 -0
- package/dist/src/components/FileUpload.d.ts +17 -0
- package/dist/src/components/Form.d.ts +28 -0
- package/dist/src/components/Heading.d.ts +13 -0
- package/dist/src/components/HoverCard.d.ts +11 -0
- package/dist/src/components/Image.d.ts +30 -0
- package/dist/src/components/Input.d.ts +18 -0
- package/dist/src/components/Label.d.ts +5 -0
- package/dist/src/components/LanguageSwitcher.d.ts +9 -0
- package/dist/src/components/Menubar.d.ts +24 -0
- package/dist/src/components/MultiSelect.d.ts +27 -0
- package/dist/src/components/NavigationMenu.d.ts +20 -0
- package/dist/src/components/Notification.d.ts +30 -0
- package/dist/src/components/NumberInput.d.ts +12 -0
- package/dist/src/components/Pagination.d.ts +9 -0
- package/dist/src/components/PinInput.d.ts +37 -0
- package/dist/src/components/Popover.d.ts +13 -0
- package/dist/src/components/Progress.d.ts +11 -0
- package/dist/src/components/Radio.d.ts +12 -0
- package/dist/src/components/Rating.d.ts +14 -0
- package/dist/src/components/Resizable.d.ts +35 -0
- package/dist/src/components/Responsive.d.ts +25 -0
- package/dist/src/components/Result.d.ts +18 -0
- package/dist/src/components/ScrollArea.d.ts +21 -0
- package/dist/src/components/SegmentedControl.d.ts +16 -0
- package/dist/src/components/Select.d.ts +31 -0
- package/dist/src/components/Separator.d.ts +6 -0
- package/dist/src/components/Sheet/Sheet.d.ts +30 -0
- package/dist/src/components/Sheet/SheetPanel.d.ts +44 -0
- package/dist/src/components/Sheet/index.d.ts +2 -0
- package/dist/src/components/Sheet/useSheetState.d.ts +34 -0
- package/dist/src/components/Shell.d.ts +88 -0
- package/dist/src/components/Skeleton.d.ts +8 -0
- package/dist/src/components/Slider.d.ts +7 -0
- package/dist/src/components/Spinner.d.ts +8 -0
- package/dist/src/components/Stepper.d.ts +14 -0
- package/dist/src/components/Switch.d.ts +7 -0
- package/dist/src/components/Table.d.ts +90 -0
- package/dist/src/components/Tabs.d.ts +5 -0
- package/dist/src/components/TagInput.d.ts +18 -0
- package/dist/src/components/Text.d.ts +14 -0
- package/dist/src/components/Textarea.d.ts +7 -0
- package/dist/src/components/ThemeProvider.d.ts +51 -0
- package/dist/src/components/TimePicker.d.ts +14 -0
- package/dist/src/components/Timeline.d.ts +14 -0
- package/dist/src/components/Toast.d.ts +15 -0
- package/dist/src/components/Toggle.d.ts +24 -0
- package/dist/src/components/Tooltip.d.ts +11 -0
- package/dist/src/components/TreeView.d.ts +20 -0
- package/dist/src/components/mobile/ActionSheet.d.ts +15 -0
- package/dist/src/components/mobile/BottomNav.d.ts +23 -0
- package/dist/src/components/mobile/MobileApp.d.ts +1 -0
- package/dist/src/components/mobile/MobileDrawer.d.ts +31 -0
- package/dist/src/components/mobile/MobileList.d.ts +24 -0
- package/dist/src/components/mobile/MobilePreviewPage.d.ts +5 -0
- package/dist/src/components/mobile/MobileShell.d.ts +24 -0
- package/dist/src/components/pages/ErrorPage.d.ts +9 -0
- package/dist/src/components/pages/HomePage.d.ts +10 -0
- package/dist/src/components/pages/LoginPage.d.ts +12 -0
- package/dist/src/components/pages/PrivacyPolicyPage.d.ts +5 -0
- package/dist/src/components/pages/RegisterPage.d.ts +14 -0
- package/dist/src/components/pages/TermsOfServicePage.d.ts +5 -0
- package/dist/src/components/pages/homePageContent.d.ts +25 -0
- package/dist/src/components/pages/legalPageContent.d.ts +15 -0
- package/dist/src/lib/VXUIProvider.d.ts +29 -0
- package/dist/src/lib/breakpoints.d.ts +63 -0
- package/dist/src/lib/cx.d.ts +1 -0
- package/dist/src/lib/dialogPopover.d.ts +30 -0
- package/dist/src/lib/index.d.ts +152 -0
- package/dist/src/lib/version.d.ts +1 -0
- package/dist/src/lib/viewport.d.ts +21 -0
- package/package.json +18 -16
- package/dist/.assetsignore +0 -2
- package/dist/404.html +0 -18
- package/dist/assets/index-CnEehOVd.js +0 -1279
- package/dist/assets/index-rt2jc-43.css +0 -1
- package/dist/colorful_flat_icon.ico +0 -0
- package/dist/colorful_flat_icon.svg +0 -46
- package/dist/index.html +0 -47
- package/dist/wrangler.json +0 -1
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { ReactNode, HTMLAttributes } from 'react';
|
|
2
|
+
import { SelectOption } from './Select';
|
|
3
|
+
export type SortDirection = 'asc' | 'desc' | null;
|
|
4
|
+
export interface TableColumn<T> {
|
|
5
|
+
key: string;
|
|
6
|
+
header: ReactNode;
|
|
7
|
+
accessor: (row: T) => ReactNode;
|
|
8
|
+
sortable?: boolean;
|
|
9
|
+
width?: string | number;
|
|
10
|
+
align?: 'left' | 'center' | 'right';
|
|
11
|
+
className?: string;
|
|
12
|
+
/** 此列是否可作为筛选条件 */
|
|
13
|
+
filterable?: boolean;
|
|
14
|
+
/** 筛选类型:'text' 文本搜索 | 'select' 下拉选择 */
|
|
15
|
+
filterType?: 'text' | 'select';
|
|
16
|
+
/** 当下拉筛选时,可选的选项列表(不传则从 data 中自动提取去重值) */
|
|
17
|
+
filterOptions?: SelectOption[];
|
|
18
|
+
/** 是否参与全局文本搜索(默认 true) */
|
|
19
|
+
searchable?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* 获取该列用于搜索/筛选的纯文本值。
|
|
22
|
+
* 当 accessor 返回 ReactNode(如 Badge、Tag 等)时,String(ReactNode) 会得到 "[object Object]",
|
|
23
|
+
* 导致搜索失效。提供 searchValue 可显式指定搜索用的文本。
|
|
24
|
+
* 不传时,仅当 accessor 返回 string | number 时才参与搜索。
|
|
25
|
+
*/
|
|
26
|
+
searchValue?: (row: T) => string;
|
|
27
|
+
}
|
|
28
|
+
export type TableVariant = 'default' | 'dark' | 'outline';
|
|
29
|
+
/** 可从哪个边移除边框 */
|
|
30
|
+
export type TableBorderSide = 'top' | 'right' | 'bottom' | 'left';
|
|
31
|
+
export interface TableProps<T> extends HTMLAttributes<HTMLDivElement> {
|
|
32
|
+
columns: TableColumn<T>[];
|
|
33
|
+
data: T[];
|
|
34
|
+
/** Row height preset. */
|
|
35
|
+
size?: 'sm' | 'md' | 'lg';
|
|
36
|
+
striped?: boolean;
|
|
37
|
+
hoverable?: boolean;
|
|
38
|
+
bordered?: boolean;
|
|
39
|
+
/** @deprecated Use size="sm" instead */
|
|
40
|
+
compact?: boolean;
|
|
41
|
+
stickyHeader?: boolean;
|
|
42
|
+
/** 搜索栏是否吸顶(滚动时保持可见),默认 false */
|
|
43
|
+
stickyFilter?: boolean;
|
|
44
|
+
borderless?: boolean;
|
|
45
|
+
headless?: boolean;
|
|
46
|
+
rounded?: boolean;
|
|
47
|
+
loading?: boolean;
|
|
48
|
+
caption?: string;
|
|
49
|
+
emptyText?: ReactNode;
|
|
50
|
+
sortColumn?: string | null;
|
|
51
|
+
sortDirection?: SortDirection;
|
|
52
|
+
onSortChange?: (column: string, direction: SortDirection) => void;
|
|
53
|
+
/** 表格视觉变体:'default' | 'dark' | 'outline' */
|
|
54
|
+
variant?: TableVariant;
|
|
55
|
+
/** 固定表格布局(列宽严格按 width 分配,不换行截断) */
|
|
56
|
+
fixed?: boolean;
|
|
57
|
+
/** 移除指定边边框:'all' 移除四边,或传入边列表。用于嵌入 Card 等容器场景 */
|
|
58
|
+
removeBorders?: 'all' | TableBorderSide[];
|
|
59
|
+
/** 紧凑嵌入模式:移除内边距、圆角和外边框,适合直接放入 Card 中 */
|
|
60
|
+
flush?: boolean;
|
|
61
|
+
/** 行点击回调 */
|
|
62
|
+
onRowClick?: (row: T, index: number) => void;
|
|
63
|
+
/** 自定义行类名(字符串或函数) */
|
|
64
|
+
rowClassName?: string | ((row: T, index: number) => string);
|
|
65
|
+
/** 启用行选择(显示复选框列) */
|
|
66
|
+
selectable?: boolean;
|
|
67
|
+
/** 受控选中行索引集合 */
|
|
68
|
+
selectedRows?: Set<number>;
|
|
69
|
+
/** 选中行变化回调 */
|
|
70
|
+
onSelectionChange?: (selected: Set<number>) => void;
|
|
71
|
+
/** 是否显示筛选栏(默认数据 > filterThreshold 时自动显示) */
|
|
72
|
+
filterable?: boolean;
|
|
73
|
+
/** 搜索框占位文本 */
|
|
74
|
+
filterPlaceholder?: string;
|
|
75
|
+
/** 当前筛选文本(受控) */
|
|
76
|
+
filterValue?: string;
|
|
77
|
+
/** 筛选文本变化回调 */
|
|
78
|
+
onFilterChange?: (value: string) => void;
|
|
79
|
+
/** 列筛选状态 */
|
|
80
|
+
columnFilters?: Record<string, string>;
|
|
81
|
+
/** 列筛选变化回调 */
|
|
82
|
+
onColumnFilterChange?: (columnKey: string, value: string) => void;
|
|
83
|
+
/** 数据量超过此值时自动显示筛选栏(默认 10) */
|
|
84
|
+
filterThreshold?: number;
|
|
85
|
+
/** 搜索防抖延迟(毫秒),默认 200。设为 0 禁用防抖 */
|
|
86
|
+
searchDebounce?: number;
|
|
87
|
+
/** 限定参与文本搜索的列 key 列表,不传则搜索所有 searchable !== false 的列 */
|
|
88
|
+
searchColumns?: string[];
|
|
89
|
+
}
|
|
90
|
+
export declare function Table<T>({ columns, data, size, striped, hoverable, bordered, compact, stickyHeader, stickyFilter, borderless, headless, rounded, loading, caption, emptyText, sortColumn: controlledSortCol, sortDirection: controlledSortDir, onSortChange, variant, fixed, removeBorders, flush, onRowClick, rowClassName, selectable, selectedRows: controlledSelectedRows, onSelectionChange, className, filterable: filterableProp, filterPlaceholder, filterValue: controlledFilterValue, onFilterChange, columnFilters: controlledColumnFilters, onColumnFilterChange, filterThreshold, searchDebounce, searchColumns, ...props }: TableProps<T>): import("react").JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as TabsPrimitive from '@radix-ui/react-tabs';
|
|
2
|
+
export declare const Tabs: import('react').ForwardRefExoticComponent<TabsPrimitive.TabsProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
3
|
+
export declare const TabsList: import('react').ForwardRefExoticComponent<Omit<TabsPrimitive.TabsListProps & import('react').RefAttributes<HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
4
|
+
export declare const TabsTrigger: import('react').ForwardRefExoticComponent<Omit<TabsPrimitive.TabsTriggerProps & import('react').RefAttributes<HTMLButtonElement>, "ref"> & import('react').RefAttributes<HTMLButtonElement>>;
|
|
5
|
+
export declare const TabsContent: import('react').ForwardRefExoticComponent<Omit<TabsPrimitive.TabsContentProps & import('react').RefAttributes<HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { InputHTMLAttributes } from 'react';
|
|
2
|
+
export interface TagInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'value' | 'onChange' | 'defaultValue'> {
|
|
3
|
+
value?: string[];
|
|
4
|
+
defaultValue?: string[];
|
|
5
|
+
onChange?: (tags: string[]) => void;
|
|
6
|
+
label?: string;
|
|
7
|
+
hint?: string;
|
|
8
|
+
error?: string;
|
|
9
|
+
placeholder?: string;
|
|
10
|
+
/** Keys that confirm a tag. Defaults to Enter and comma */
|
|
11
|
+
confirmKeys?: string[];
|
|
12
|
+
/** Maximum number of tags */
|
|
13
|
+
maxTags?: number;
|
|
14
|
+
/** Validate a tag before adding; return false or error message to reject */
|
|
15
|
+
validate?: (tag: string) => boolean | string;
|
|
16
|
+
className?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare function TagInput({ value: controlledValue, defaultValue, onChange, label, hint, error, placeholder, confirmKeys, maxTags, validate, disabled, className, ...inputProps }: TagInputProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
type TextVariant = 'default' | 'secondary' | 'muted' | 'danger' | 'success';
|
|
3
|
+
type TextSize = 'sm' | 'base' | 'lg' | 'xl';
|
|
4
|
+
type TextWeight = 'normal' | 'medium' | 'semibold' | 'bold';
|
|
5
|
+
type TextElement = 'p' | 'span' | 'div';
|
|
6
|
+
export interface TextProps extends HTMLAttributes<HTMLElement> {
|
|
7
|
+
as?: TextElement;
|
|
8
|
+
variant?: TextVariant;
|
|
9
|
+
size?: TextSize;
|
|
10
|
+
weight?: TextWeight;
|
|
11
|
+
truncate?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare function Text({ as: Component, variant, size, weight, truncate, className, ...props }: TextProps): import("react").JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { TextareaHTMLAttributes } from 'react';
|
|
2
|
+
export interface TextareaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
3
|
+
label?: string;
|
|
4
|
+
hint?: string;
|
|
5
|
+
resize?: 'none' | 'vertical' | 'horizontal' | 'both';
|
|
6
|
+
}
|
|
7
|
+
export declare function Textarea({ className, label, hint, resize, style, ...props }: TextareaProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export type ThemeMode = 'light' | 'dark';
|
|
3
|
+
export type ThemeTokens = Partial<Record<`--vx-${string}`, string>>;
|
|
4
|
+
export interface ThemeDefinition {
|
|
5
|
+
label?: string;
|
|
6
|
+
mode: ThemeMode;
|
|
7
|
+
tokens?: ThemeTokens;
|
|
8
|
+
}
|
|
9
|
+
export type ThemeRegistry = Record<string, ThemeDefinition>;
|
|
10
|
+
interface CreateThemeOptions {
|
|
11
|
+
label?: string;
|
|
12
|
+
tokens?: ThemeTokens;
|
|
13
|
+
}
|
|
14
|
+
export declare function createTheme(mode: ThemeMode, options?: CreateThemeOptions): ThemeDefinition;
|
|
15
|
+
export declare const themePresets: {
|
|
16
|
+
sunset: ThemeDefinition;
|
|
17
|
+
mint: ThemeDefinition;
|
|
18
|
+
graphite: ThemeDefinition;
|
|
19
|
+
'ivory-gold': ThemeDefinition;
|
|
20
|
+
'black-gold': ThemeDefinition;
|
|
21
|
+
ocean: ThemeDefinition;
|
|
22
|
+
indigo: ThemeDefinition;
|
|
23
|
+
violet: ThemeDefinition;
|
|
24
|
+
'violet-dark': ThemeDefinition;
|
|
25
|
+
vxai: ThemeDefinition;
|
|
26
|
+
'vxai-dark': ThemeDefinition;
|
|
27
|
+
light: {
|
|
28
|
+
label: string;
|
|
29
|
+
mode: "light";
|
|
30
|
+
};
|
|
31
|
+
dark: {
|
|
32
|
+
label: string;
|
|
33
|
+
mode: "dark";
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
interface ThemeContextValue {
|
|
37
|
+
theme: string;
|
|
38
|
+
mode: ThemeMode;
|
|
39
|
+
themes: ThemeRegistry;
|
|
40
|
+
setTheme: (theme: string) => void;
|
|
41
|
+
toggleTheme: () => void;
|
|
42
|
+
}
|
|
43
|
+
interface ThemeProviderProps {
|
|
44
|
+
children: ReactNode;
|
|
45
|
+
defaultTheme?: string;
|
|
46
|
+
storageKey?: string;
|
|
47
|
+
themes?: ThemeRegistry;
|
|
48
|
+
}
|
|
49
|
+
export declare function ThemeProvider({ children, defaultTheme, storageKey, themes, }: ThemeProviderProps): import("react").JSX.Element;
|
|
50
|
+
export declare function useTheme(): ThemeContextValue;
|
|
51
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface TimePickerProps {
|
|
2
|
+
value?: string;
|
|
3
|
+
defaultValue?: string;
|
|
4
|
+
onChange?: (value: string) => void;
|
|
5
|
+
placeholder?: string;
|
|
6
|
+
label?: string;
|
|
7
|
+
hint?: string;
|
|
8
|
+
error?: string;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
/** Show seconds column. Default false */
|
|
11
|
+
seconds?: boolean;
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare function TimePicker({ value: controlledValue, defaultValue, onChange, placeholder, label, hint, error, disabled, seconds, className, }: TimePickerProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export type TimelineItemStatus = 'default' | 'success' | 'warning' | 'danger' | 'info';
|
|
3
|
+
export interface TimelineItem {
|
|
4
|
+
title: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
time?: string;
|
|
7
|
+
icon?: ReactNode;
|
|
8
|
+
status?: TimelineItemStatus;
|
|
9
|
+
}
|
|
10
|
+
export interface TimelineProps {
|
|
11
|
+
items: TimelineItem[];
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare function Timeline({ items, className }: TimelineProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
type ToastTone = 'info' | 'success' | 'warning' | 'danger';
|
|
3
|
+
interface ToastInput {
|
|
4
|
+
title: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
tone?: ToastTone;
|
|
7
|
+
}
|
|
8
|
+
interface ToastContextValue {
|
|
9
|
+
push: (toast: ToastInput) => void;
|
|
10
|
+
}
|
|
11
|
+
export declare function ToastProvider({ children }: {
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
}): import("react").JSX.Element;
|
|
14
|
+
export declare function useToast(): ToastContextValue;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ButtonHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface ToggleProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'onChange'> {
|
|
3
|
+
pressed?: boolean;
|
|
4
|
+
defaultPressed?: boolean;
|
|
5
|
+
onPressedChange?: (pressed: boolean) => void;
|
|
6
|
+
size?: 'sm' | 'md' | 'lg';
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export declare function Toggle({ pressed: controlledPressed, defaultPressed, onPressedChange, size, className, children, onClick, ...props }: ToggleProps): import("react").JSX.Element;
|
|
10
|
+
export interface ToggleGroupItem {
|
|
11
|
+
value: string;
|
|
12
|
+
label: ReactNode;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface ToggleGroupProps {
|
|
16
|
+
items: ToggleGroupItem[];
|
|
17
|
+
value?: string | string[];
|
|
18
|
+
defaultValue?: string | string[];
|
|
19
|
+
onValueChange?: (value: string | string[]) => void;
|
|
20
|
+
type?: 'single' | 'multiple';
|
|
21
|
+
size?: 'sm' | 'md' | 'lg';
|
|
22
|
+
className?: string;
|
|
23
|
+
}
|
|
24
|
+
export declare function ToggleGroup({ items, value: controlledValue, defaultValue, onValueChange, type, size, className, }: ToggleGroupProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
type TooltipPlacement = 'top' | 'bottom' | 'left' | 'right';
|
|
3
|
+
export interface TooltipProps {
|
|
4
|
+
content: ReactNode;
|
|
5
|
+
placement?: TooltipPlacement;
|
|
6
|
+
delay?: number;
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function Tooltip({ content, placement, delay, children, className }: TooltipProps): import("react").JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface TreeNode {
|
|
3
|
+
id: string;
|
|
4
|
+
label: ReactNode;
|
|
5
|
+
icon?: ReactNode;
|
|
6
|
+
children?: TreeNode[];
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
data?: unknown;
|
|
9
|
+
}
|
|
10
|
+
export interface TreeViewProps {
|
|
11
|
+
nodes: TreeNode[];
|
|
12
|
+
selected?: string;
|
|
13
|
+
defaultSelected?: string;
|
|
14
|
+
onSelect?: (id: string, node: TreeNode) => void;
|
|
15
|
+
defaultExpanded?: string[];
|
|
16
|
+
expanded?: string[];
|
|
17
|
+
onExpandedChange?: (ids: string[]) => void;
|
|
18
|
+
className?: string;
|
|
19
|
+
}
|
|
20
|
+
export declare function TreeView({ nodes, selected: controlledSelected, defaultSelected, onSelect, defaultExpanded, expanded: controlledExpanded, onExpandedChange, className, }: TreeViewProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ReactNode, ButtonHTMLAttributes } from 'react';
|
|
2
|
+
export interface ActionSheetProps {
|
|
3
|
+
open: boolean;
|
|
4
|
+
onClose: () => void;
|
|
5
|
+
title?: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function ActionSheet({ open, onClose, title, description, children, className, }: ActionSheetProps): import("react").JSX.Element | null;
|
|
11
|
+
export interface ActionSheetItemProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
12
|
+
icon?: ReactNode;
|
|
13
|
+
destructive?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare function ActionSheetItem({ icon, destructive, className, children, ...props }: ActionSheetItemProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface BottomNavSubMenuItem {
|
|
3
|
+
key: string;
|
|
4
|
+
label: string;
|
|
5
|
+
icon?: ReactNode;
|
|
6
|
+
onSelect?: () => void;
|
|
7
|
+
}
|
|
8
|
+
export interface BottomNavItem {
|
|
9
|
+
key: string;
|
|
10
|
+
label: string;
|
|
11
|
+
icon: ReactNode;
|
|
12
|
+
/** 数字或字符串角标,超过 99 建议传 '99+' */
|
|
13
|
+
badge?: string | number;
|
|
14
|
+
active?: boolean;
|
|
15
|
+
onSelect?: () => void;
|
|
16
|
+
/** 子菜单项,有值时点击 item 将弹出子菜单而非直接触发 onSelect */
|
|
17
|
+
submenu?: BottomNavSubMenuItem[];
|
|
18
|
+
}
|
|
19
|
+
export interface BottomNavProps {
|
|
20
|
+
items: BottomNavItem[];
|
|
21
|
+
className?: string;
|
|
22
|
+
}
|
|
23
|
+
export declare function BottomNav({ items, className }: BottomNavProps): import("react").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function MobileApp(): import("react").JSX.Element;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface MobileDrawerProps {
|
|
3
|
+
open: boolean;
|
|
4
|
+
onClose: () => void;
|
|
5
|
+
/** 抽屉宽度,默认 280px */
|
|
6
|
+
width?: number;
|
|
7
|
+
/** 抽屉头部内容(品牌 logo、用户信息等) */
|
|
8
|
+
header?: ReactNode;
|
|
9
|
+
/** 抽屉底部内容(设置、登出等) */
|
|
10
|
+
footer?: ReactNode;
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare function MobileDrawer({ open, onClose, width, header, footer, children, className, }: MobileDrawerProps): import("react").JSX.Element | null;
|
|
15
|
+
export interface DrawerNavItemProps {
|
|
16
|
+
icon?: ReactNode;
|
|
17
|
+
label: ReactNode;
|
|
18
|
+
badge?: string | number;
|
|
19
|
+
active?: boolean;
|
|
20
|
+
onClick?: () => void;
|
|
21
|
+
}
|
|
22
|
+
export declare function DrawerNavItem({ icon, label, badge, active, onClick }: DrawerNavItemProps): import("react").JSX.Element;
|
|
23
|
+
export interface DrawerNavSectionProps {
|
|
24
|
+
title?: string;
|
|
25
|
+
/** 是否可折叠,默认 false */
|
|
26
|
+
collapsible?: boolean;
|
|
27
|
+
/** 初始展开状态,collapsible=true 时有效,默认 true */
|
|
28
|
+
defaultOpen?: boolean;
|
|
29
|
+
children: ReactNode;
|
|
30
|
+
}
|
|
31
|
+
export declare function DrawerNavSection({ title, collapsible, defaultOpen, children }: DrawerNavSectionProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export declare function MobileList({ className, ...props }: HTMLAttributes<HTMLUListElement>): import("react").JSX.Element;
|
|
3
|
+
export interface MobileListSectionProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
title?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function MobileListSection({ title, className, children, ...props }: MobileListSectionProps): import("react").JSX.Element;
|
|
7
|
+
export interface MobileListItemProps {
|
|
8
|
+
/** 左侧图标或头像区域 */
|
|
9
|
+
leading?: ReactNode;
|
|
10
|
+
/** 右侧自定义内容(如状态标签、数值) */
|
|
11
|
+
trailing?: ReactNode;
|
|
12
|
+
/** 主标签文本 */
|
|
13
|
+
label: ReactNode;
|
|
14
|
+
/** 副文本描述 */
|
|
15
|
+
description?: ReactNode;
|
|
16
|
+
/** 是否显示右侧箭头(表示可进入下一层) */
|
|
17
|
+
chevron?: boolean;
|
|
18
|
+
/** 破坏性操作,文字变为危险色 */
|
|
19
|
+
destructive?: boolean;
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
onClick?: () => void;
|
|
22
|
+
className?: string;
|
|
23
|
+
}
|
|
24
|
+
export declare function MobileListItem({ leading, trailing, label, description, chevron, destructive, disabled, onClick, className, }: MobileListItemProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface MobileShellProps {
|
|
3
|
+
/** 固定在顶部的导航栏区域 */
|
|
4
|
+
topBar?: ReactNode;
|
|
5
|
+
/** 固定在底部的导航栏区域 */
|
|
6
|
+
bottomNav?: ReactNode;
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function MobileShell({ topBar, bottomNav, children, className }: MobileShellProps): import("react").JSX.Element;
|
|
11
|
+
export interface MobileTopBarProps {
|
|
12
|
+
/** 标题文本或节点 */
|
|
13
|
+
title?: ReactNode;
|
|
14
|
+
/** 左侧区域,通常为返回按钮 */
|
|
15
|
+
leading?: ReactNode;
|
|
16
|
+
/** 右侧区域,通常为操作按钮 */
|
|
17
|
+
trailing?: ReactNode;
|
|
18
|
+
className?: string;
|
|
19
|
+
}
|
|
20
|
+
export declare function MobileTopBar({ title, leading, trailing, className }: MobileTopBarProps): import("react").JSX.Element;
|
|
21
|
+
export interface MobileIconButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
22
|
+
label: string;
|
|
23
|
+
}
|
|
24
|
+
export declare function MobileIconButton({ label, className, children, ...props }: MobileIconButtonProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface ErrorPageProps {
|
|
2
|
+
statusCode?: number;
|
|
3
|
+
requestedPath?: string;
|
|
4
|
+
onHome: () => void;
|
|
5
|
+
onDocs: () => void;
|
|
6
|
+
onBack: () => void;
|
|
7
|
+
}
|
|
8
|
+
export declare function ErrorPage({ statusCode, requestedPath, onHome, onDocs, onBack, }: ErrorPageProps): import("react").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface HomePageProps {
|
|
2
|
+
viewerName?: string | null;
|
|
3
|
+
onLogin: () => void;
|
|
4
|
+
onRegister: () => void;
|
|
5
|
+
onDocs: (pageKey?: string) => void;
|
|
6
|
+
onPrivacy: () => void;
|
|
7
|
+
onLogout?: () => void;
|
|
8
|
+
}
|
|
9
|
+
export declare function HomePage({ viewerName, onLogin, onRegister, onDocs, onPrivacy, onLogout, }: HomePageProps): import("react").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
interface LoginPageProps {
|
|
2
|
+
onLogin: (payload: {
|
|
3
|
+
email: string;
|
|
4
|
+
password: string;
|
|
5
|
+
remember: boolean;
|
|
6
|
+
}) => Promise<void> | void;
|
|
7
|
+
onRegister: () => void;
|
|
8
|
+
onGuest: () => void;
|
|
9
|
+
onBack: () => void;
|
|
10
|
+
}
|
|
11
|
+
export declare function LoginPage({ onLogin, onRegister, onGuest, onBack }: LoginPageProps): import("react").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
interface RegisterPageProps {
|
|
2
|
+
onRegister: (payload: {
|
|
3
|
+
name: string;
|
|
4
|
+
email: string;
|
|
5
|
+
password: string;
|
|
6
|
+
}) => Promise<void> | void;
|
|
7
|
+
onLogin: () => void;
|
|
8
|
+
onGuest: () => void;
|
|
9
|
+
onPrivacy: () => void;
|
|
10
|
+
onTerms: () => void;
|
|
11
|
+
onBack: () => void;
|
|
12
|
+
}
|
|
13
|
+
export declare function RegisterPage({ onRegister, onLogin, onGuest, onPrivacy, onTerms, onBack }: RegisterPageProps): import("react").JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { LucideIcon } from 'lucide-react';
|
|
2
|
+
import { Translations } from '../../i18n';
|
|
3
|
+
export interface PublicHomeFeature {
|
|
4
|
+
key: string;
|
|
5
|
+
icon: LucideIcon;
|
|
6
|
+
title: string;
|
|
7
|
+
description: string;
|
|
8
|
+
}
|
|
9
|
+
export interface PublicHomePreviewSection {
|
|
10
|
+
id: string;
|
|
11
|
+
icon: LucideIcon;
|
|
12
|
+
label: string;
|
|
13
|
+
meta: string;
|
|
14
|
+
}
|
|
15
|
+
export interface PublicHomeMetaItem {
|
|
16
|
+
key: string;
|
|
17
|
+
icon: LucideIcon;
|
|
18
|
+
title: string;
|
|
19
|
+
lines: string[];
|
|
20
|
+
}
|
|
21
|
+
export declare function getPublicHomeContent(t: Translations): {
|
|
22
|
+
features: PublicHomeFeature[];
|
|
23
|
+
previewSections: PublicHomePreviewSection[];
|
|
24
|
+
metaItems: PublicHomeMetaItem[];
|
|
25
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface LegalPageSection {
|
|
2
|
+
title: string;
|
|
3
|
+
paragraphs: string[];
|
|
4
|
+
}
|
|
5
|
+
export interface LegalPageContent {
|
|
6
|
+
badgeLabel: string;
|
|
7
|
+
title: string;
|
|
8
|
+
lead: string;
|
|
9
|
+
meta: string[];
|
|
10
|
+
summaryTitle: string;
|
|
11
|
+
summaryItems: string[];
|
|
12
|
+
sections: LegalPageSection[];
|
|
13
|
+
}
|
|
14
|
+
export declare function getPrivacyPolicyContent(locale: string): LegalPageContent;
|
|
15
|
+
export declare function getTermsOfServiceContent(locale: string): LegalPageContent;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { ThemeRegistry } from '../components/ThemeProvider';
|
|
3
|
+
export interface VXUIProviderProps {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
/**
|
|
6
|
+
* 主题配置,传递给 ThemeProvider。
|
|
7
|
+
* 包含预设主题和自定义主题。
|
|
8
|
+
*/
|
|
9
|
+
themes?: ThemeRegistry;
|
|
10
|
+
/** 默认主题名称 */
|
|
11
|
+
defaultTheme?: string;
|
|
12
|
+
/** localStorage 存储键名 */
|
|
13
|
+
storageKey?: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* 组合 Provider,一次性挂载 ThemeProvider、ViewportProvider、ToastProvider。
|
|
17
|
+
*
|
|
18
|
+
* 等价于:
|
|
19
|
+
* ```tsx
|
|
20
|
+
* <ThemeProvider themes={themes} defaultTheme={defaultTheme}>
|
|
21
|
+
* <ViewportProvider>
|
|
22
|
+
* <ToastProvider>
|
|
23
|
+
* {children}
|
|
24
|
+
* </ToastProvider>
|
|
25
|
+
* </ViewportProvider>
|
|
26
|
+
* </ThemeProvider>
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export declare function VXUIProvider({ children, themes, defaultTheme, storageKey, }: VXUIProviderProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unified breakpoint constants shared between JS and CSS.
|
|
3
|
+
*
|
|
4
|
+
* ── 断点系统说明 ─────────────────────────────────────────────
|
|
5
|
+
*
|
|
6
|
+
* 本系统有两套断点,用途不同,请勿混淆:
|
|
7
|
+
*
|
|
8
|
+
* 1. CSS 布局断点 (CSS Media Query Breakpoints)
|
|
9
|
+
* ──────────────────────────────────────────
|
|
10
|
+
* 用于控制页面布局在不同视口宽度下的表现。
|
|
11
|
+
* sm: 640px — 手机布局断点
|
|
12
|
+
* md: 768px — 平板布局断点
|
|
13
|
+
* lg: 1000px — 桌面布局断点
|
|
14
|
+
*
|
|
15
|
+
* 这些值必须与 CSS 变量保持一致:
|
|
16
|
+
* --vx-breakpoint-sm: 640px
|
|
17
|
+
* --vx-breakpoint-md: 768px
|
|
18
|
+
* --vx-breakpoint-lg: 1000px
|
|
19
|
+
*
|
|
20
|
+
* 2. 设备检测断点 (Device Detection Breakpoints)
|
|
21
|
+
* ──────────────────────────────────────────
|
|
22
|
+
* 用于 JS 端判断设备类型(phone / tablet / desktop)。
|
|
23
|
+
* 基于物理屏幕尺寸(window.screen.width),而非视口宽度。
|
|
24
|
+
* PHONE_MAX_WIDTH = 1000
|
|
25
|
+
*
|
|
26
|
+
* 为什么设备检测使用 1000px 而不是 640px?
|
|
27
|
+
* - 物理屏幕宽度 ≤ 1000px 的设备可能是手机或平板
|
|
28
|
+
* - 物理屏幕宽度 > 1000px 的肯定是桌面显示器
|
|
29
|
+
* - 手机和平板的区分通过宽高比(aspect ratio)实现
|
|
30
|
+
* - 这样可以避免桌面浏览器窗口缩小时被误判为手机
|
|
31
|
+
*
|
|
32
|
+
* 3. 为什么 CSS 布局断点用 640px 而设备检测用 1000px?
|
|
33
|
+
* ──────────────────────────────────────────
|
|
34
|
+
* CSS 媒体查询基于视口宽度(viewport width),
|
|
35
|
+
* 而设备检测基于物理屏幕宽度(screen.width)。
|
|
36
|
+
* 两者是不同的概念:
|
|
37
|
+
* - 一个 1024px 物理宽度的平板,在分屏模式下视口可能只有 512px
|
|
38
|
+
* - CSS 需要在视口 640px 时就切换到手机布局
|
|
39
|
+
* - 但设备检测仍应识别为平板(物理宽度 > 640px)
|
|
40
|
+
*
|
|
41
|
+
* 因此这两套断点值不同是合理的,不需要强行统一。
|
|
42
|
+
* 关键是要在代码中明确区分它们的用途。
|
|
43
|
+
*
|
|
44
|
+
* ─────────────────────────────────────────────────────────────
|
|
45
|
+
*/
|
|
46
|
+
export declare const BREAKPOINTS: {
|
|
47
|
+
/** CSS 布局断点 - 手机布局 (max-width: 640px) */
|
|
48
|
+
readonly sm: 640;
|
|
49
|
+
/** CSS 布局断点 - 平板布局 (max-width: 768px) */
|
|
50
|
+
readonly md: 768;
|
|
51
|
+
/** CSS 布局断点 - 桌面布局 (min-width: 1000px) */
|
|
52
|
+
readonly lg: 1000;
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* 设备检测 - 物理屏幕宽度阈值。
|
|
56
|
+
* 物理宽度 ≤ PHONE_MAX_WIDTH 的设备可能是手机或平板,
|
|
57
|
+
* 具体通过宽高比进一步区分。
|
|
58
|
+
*/
|
|
59
|
+
export declare const PHONE_MAX_WIDTH: 1000;
|
|
60
|
+
/** 宽高比阈值:低于此值判定为手机(窄屏设备) */
|
|
61
|
+
export declare const PHONE_ASPECT_RATIO_THRESHOLD = 0.7;
|
|
62
|
+
/** 宽高比阈值:低于此值且宽度 ≤ PHONE_MAX_WIDTH 判定为手机 */
|
|
63
|
+
export declare const TABLET_ASPECT_RATIO_THRESHOLD = 0.75;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function cx(...values: Array<string | false | null | undefined>): string;
|