vxui-react 1.3.6 → 1.3.8
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/README.en.md +79 -3
- package/README.md +81 -3
- package/dist/index.cjs +22 -66
- package/dist/index.js +6528 -5509
- package/dist/src/components/Article.d.ts +72 -0
- package/dist/src/components/Dialog.d.ts +24 -6
- package/dist/src/components/Select.d.ts +8 -1
- 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/mobile/BottomSheet.d.ts +28 -0
- package/dist/src/lib/VXUIProvider.d.ts +29 -0
- package/dist/src/lib/breakpoints.d.ts +63 -0
- package/dist/src/lib/dialogPopover.d.ts +26 -0
- package/dist/src/lib/index.d.ts +23 -8
- package/dist/src/lib/viewport.d.ts +6 -0
- package/dist/vxui-react.css +1 -1
- package/llms.txt +6 -2
- package/package.json +4 -3
- package/dist/src/components/AlertDialog.d.ts +0 -14
- package/dist/src/components/Sheet.d.ts +0 -13
- package/dist/src/components/__tests__/Accordion.test.d.ts +0 -1
- package/dist/src/components/__tests__/ActionSheet.test.d.ts +0 -1
- package/dist/src/components/__tests__/Alert.test.d.ts +0 -1
- package/dist/src/components/__tests__/AlertDialog.test.d.ts +0 -1
- package/dist/src/components/__tests__/AppShell.test.d.ts +0 -1
- package/dist/src/components/__tests__/Avatar.test.d.ts +0 -1
- package/dist/src/components/__tests__/Badge.test.d.ts +0 -1
- package/dist/src/components/__tests__/BottomNav.test.d.ts +0 -1
- package/dist/src/components/__tests__/Breadcrumb.test.d.ts +0 -1
- package/dist/src/components/__tests__/Button.test.d.ts +0 -1
- package/dist/src/components/__tests__/Calendar.test.d.ts +0 -1
- package/dist/src/components/__tests__/Card.test.d.ts +0 -1
- package/dist/src/components/__tests__/Carousel.test.d.ts +0 -1
- package/dist/src/components/__tests__/Checkbox.test.d.ts +0 -1
- package/dist/src/components/__tests__/CodeBlock.test.d.ts +0 -1
- package/dist/src/components/__tests__/ColorPicker.test.d.ts +0 -1
- package/dist/src/components/__tests__/CommandPalette.test.d.ts +0 -1
- package/dist/src/components/__tests__/ContextMenu.test.d.ts +0 -1
- package/dist/src/components/__tests__/DatePicker.test.d.ts +0 -1
- package/dist/src/components/__tests__/Dialog.test.d.ts +0 -1
- package/dist/src/components/__tests__/DialogFormControls.test.d.ts +0 -1
- package/dist/src/components/__tests__/DropdownMenu.test.d.ts +0 -1
- package/dist/src/components/__tests__/EmptyState.test.d.ts +0 -1
- package/dist/src/components/__tests__/FileUpload.test.d.ts +0 -1
- package/dist/src/components/__tests__/Form.test.d.ts +0 -1
- package/dist/src/components/__tests__/Heading.test.d.ts +0 -1
- package/dist/src/components/__tests__/HoverCard.test.d.ts +0 -1
- package/dist/src/components/__tests__/Input.test.d.ts +0 -1
- package/dist/src/components/__tests__/Label.test.d.ts +0 -1
- package/dist/src/components/__tests__/LanguageSwitcher.test.d.ts +0 -1
- package/dist/src/components/__tests__/Menubar.test.d.ts +0 -1
- package/dist/src/components/__tests__/MobileDrawer.test.d.ts +0 -1
- package/dist/src/components/__tests__/MobileList.test.d.ts +0 -1
- package/dist/src/components/__tests__/MultiSelect.test.d.ts +0 -1
- package/dist/src/components/__tests__/NavigationMenu.test.d.ts +0 -1
- package/dist/src/components/__tests__/NumberInput.test.d.ts +0 -1
- package/dist/src/components/__tests__/Pagination.test.d.ts +0 -1
- package/dist/src/components/__tests__/Popover.test.d.ts +0 -1
- package/dist/src/components/__tests__/Progress.test.d.ts +0 -1
- package/dist/src/components/__tests__/Radio.test.d.ts +0 -1
- package/dist/src/components/__tests__/Rating.test.d.ts +0 -1
- package/dist/src/components/__tests__/Resizable.test.d.ts +0 -1
- package/dist/src/components/__tests__/Responsive.test.d.ts +0 -1
- package/dist/src/components/__tests__/ScrollArea.test.d.ts +0 -1
- package/dist/src/components/__tests__/SegmentedControl.test.d.ts +0 -1
- package/dist/src/components/__tests__/Select.test.d.ts +0 -1
- package/dist/src/components/__tests__/Separator.test.d.ts +0 -1
- package/dist/src/components/__tests__/Sheet.test.d.ts +0 -1
- package/dist/src/components/__tests__/Shell.test.d.ts +0 -1
- package/dist/src/components/__tests__/Skeleton.test.d.ts +0 -1
- package/dist/src/components/__tests__/Slider.test.d.ts +0 -1
- package/dist/src/components/__tests__/Spinner.test.d.ts +0 -1
- package/dist/src/components/__tests__/Stepper.test.d.ts +0 -1
- package/dist/src/components/__tests__/Switch.test.d.ts +0 -1
- package/dist/src/components/__tests__/Table.test.d.ts +0 -1
- package/dist/src/components/__tests__/Tabs.test.d.ts +0 -1
- package/dist/src/components/__tests__/TagInput.test.d.ts +0 -1
- package/dist/src/components/__tests__/Text.test.d.ts +0 -1
- package/dist/src/components/__tests__/Textarea.test.d.ts +0 -1
- package/dist/src/components/__tests__/ThemeProvider.test.d.ts +0 -1
- package/dist/src/components/__tests__/TimePicker.test.d.ts +0 -1
- package/dist/src/components/__tests__/Timeline.test.d.ts +0 -1
- package/dist/src/components/__tests__/Toast.test.d.ts +0 -1
- package/dist/src/components/__tests__/Toggle.test.d.ts +0 -1
- package/dist/src/components/__tests__/Tooltip.test.d.ts +0 -1
- package/dist/src/components/__tests__/TreeView.test.d.ts +0 -1
- package/dist/src/lib/__tests__/cx.test.d.ts +0 -1
- package/dist/src/lib/__tests__/viewport.test.d.ts +0 -1
package/README.en.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# VXUI React · v1.3.
|
|
1
|
+
# VXUI React · v1.3.8
|
|
2
2
|
|
|
3
3
|
**Website**: [ui.vx.link](https://ui.vx.link) | **GitHub**: [tmplink/vxui_react](https://github.com/tmplink/vxui_react) | [中文](README.md)
|
|
4
4
|
|
|
@@ -6,12 +6,90 @@ VXUI React is a general-purpose React UI component library designed for admin pa
|
|
|
6
6
|
|
|
7
7
|
## 🚀 Changelog
|
|
8
8
|
|
|
9
|
+
> **v1.3.8** — 2026-06
|
|
10
|
+
> - Dialog: add onConfirm/onCancel/confirmLabel/cancelLabel/confirmVariant props, built-in confirm/cancel button support
|
|
11
|
+
> - Remove AlertDialog component (merged into Dialog)
|
|
12
|
+
> - Remove demo build config (vite.demo.config.ts)
|
|
13
|
+
>
|
|
9
14
|
> **v1.3.6** — 2025-05
|
|
10
15
|
> - Update createPortal calls in components to support dialogContentRef as target element
|
|
11
16
|
> - Update test cases, optimize user interaction simulation, enhance component availability verification
|
|
12
17
|
|
|
13
18
|
See full changelog at [GitHub Releases](https://github.com/tmplink/vxui_react/releases).
|
|
14
19
|
|
|
20
|
+
### v1.3.8 Migration Guide
|
|
21
|
+
|
|
22
|
+
#### New Dialog Props
|
|
23
|
+
|
|
24
|
+
v1.3.7 adds built-in confirm/cancel button support to [`Dialog`](src/components/Dialog.tsx):
|
|
25
|
+
|
|
26
|
+
| Prop | Type | Default | Description |
|
|
27
|
+
|------|------|---------|-------------|
|
|
28
|
+
| `onConfirm` | `() => void` | — | Callback when confirm button is clicked |
|
|
29
|
+
| `onCancel` | `() => void` | — | Callback when cancel button is clicked |
|
|
30
|
+
| `confirmLabel` | `string` | `'Confirm'` | Confirm button text |
|
|
31
|
+
| `cancelLabel` | `string` | `'Cancel'` | Cancel button text |
|
|
32
|
+
| `confirmVariant` | `'solid' \| 'danger'` | `'solid'` | Confirm button style variant |
|
|
33
|
+
|
|
34
|
+
**Usage example:**
|
|
35
|
+
|
|
36
|
+
```tsx
|
|
37
|
+
import { Dialog, useToast } from 'vxui-react';
|
|
38
|
+
|
|
39
|
+
function DeleteConfirm() {
|
|
40
|
+
const { push } = useToast();
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<Dialog
|
|
44
|
+
trigger={<Button variant="danger">Delete Project</Button>}
|
|
45
|
+
title="Confirm Deletion"
|
|
46
|
+
description="This action cannot be undone."
|
|
47
|
+
onConfirm={() => {
|
|
48
|
+
// Execute delete logic
|
|
49
|
+
push({ tone: 'success', title: 'Deleted' });
|
|
50
|
+
}}
|
|
51
|
+
onCancel={() => {}}
|
|
52
|
+
confirmLabel="Delete"
|
|
53
|
+
cancelLabel="Cancel"
|
|
54
|
+
confirmVariant="danger"
|
|
55
|
+
>
|
|
56
|
+
<p>All related data will be permanently removed.</p>
|
|
57
|
+
</Dialog>
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
#### AlertDialog Removal
|
|
63
|
+
|
|
64
|
+
v1.3.7 removes the standalone `AlertDialog` component. Use Dialog with `confirmVariant="danger"` for destructive actions:
|
|
65
|
+
|
|
66
|
+
**Before (v1.3.6):**
|
|
67
|
+
```tsx
|
|
68
|
+
import { AlertDialog } from 'vxui-react';
|
|
69
|
+
|
|
70
|
+
<AlertDialog
|
|
71
|
+
trigger={<Button variant="danger">Delete</Button>}
|
|
72
|
+
title="Confirm Delete"
|
|
73
|
+
onConfirm={() => {}}
|
|
74
|
+
/>
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
**After (v1.3.7):**
|
|
78
|
+
```tsx
|
|
79
|
+
import { Dialog, Button } from 'vxui-react';
|
|
80
|
+
|
|
81
|
+
<Dialog
|
|
82
|
+
trigger={<Button variant="danger">Delete</Button>}
|
|
83
|
+
title="Confirm Delete"
|
|
84
|
+
confirmVariant="danger"
|
|
85
|
+
onConfirm={() => {}}
|
|
86
|
+
/>
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
#### Demo Build Config Removal
|
|
90
|
+
|
|
91
|
+
`vite.demo.config.ts` has been removed. Use `npm run dev` to run the demo site.
|
|
92
|
+
|
|
15
93
|
The documentation follows the conventions of popular UI frameworks: installation first, then a minimal working example, then scenario-specific component code.
|
|
16
94
|
|
|
17
95
|
## Installation
|
|
@@ -232,6 +310,4 @@ npm run typecheck
|
|
|
232
310
|
# Build component library (for npm publish)
|
|
233
311
|
npm run build
|
|
234
312
|
|
|
235
|
-
# Build demo site (for Pages deployment, output to dist-demo/)
|
|
236
|
-
npm run build:demo
|
|
237
313
|
```
|
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# VXUI React · v1.3.
|
|
1
|
+
# VXUI React · v1.3.8
|
|
2
2
|
|
|
3
3
|
**官网**:[ui.vx.link](https://ui.vx.link) | **GitHub**:[tmplink/vxui_react](https://github.com/tmplink/vxui_react) | [English](README.en.md)
|
|
4
4
|
|
|
@@ -6,12 +6,92 @@ VXUI React 是一套适合后台、运营台、仪表盘和内部工具的通用
|
|
|
6
6
|
|
|
7
7
|
## 🚀 更新公告
|
|
8
8
|
|
|
9
|
+
> **v1.3.8** — 2026-06
|
|
10
|
+
> - Dialog: 新增 onConfirm/onCancel/confirmLabel/cancelLabel/confirmVariant 属性,内置确认/取消按钮支持
|
|
11
|
+
> - 移除 AlertDialog 独立组件,功能已合并至 Dialog
|
|
12
|
+
> - 移除 demo 构建配置 (vite.demo.config.ts)
|
|
13
|
+
>
|
|
9
14
|
> **v1.3.6** — 2025-05
|
|
10
15
|
> - 优化组件中的 createPortal 调用,支持使用 dialogContentRef 作为目标元素
|
|
11
16
|
> - 更新测试用例,优化用户交互模拟,增强组件可用性验证
|
|
12
17
|
|
|
13
18
|
查看完整更新日志请访问 [GitHub Releases](https://github.com/tmplink/vxui_react/releases)。
|
|
14
19
|
|
|
20
|
+
### v1.3.8 适配指南
|
|
21
|
+
|
|
22
|
+
#### Dialog 组件新增属性
|
|
23
|
+
|
|
24
|
+
v1.3.7 为 [`Dialog`](src/components/Dialog.tsx) 组件新增了内置确认/取消按钮支持,无需再手动实现:
|
|
25
|
+
|
|
26
|
+
| 属性 | 类型 | 默认值 | 说明 |
|
|
27
|
+
|------|------|--------|------|
|
|
28
|
+
| `onConfirm` | `() => void` | — | 点击确认按钮时的回调 |
|
|
29
|
+
| `onCancel` | `() => void` | — | 点击取消按钮时的回调 |
|
|
30
|
+
| `confirmLabel` | `string` | `'确认'` | 确认按钮文本 |
|
|
31
|
+
| `cancelLabel` | `string` | `'取消'` | 取消按钮文本 |
|
|
32
|
+
| `confirmVariant` | `'solid' \| 'danger'` | `'solid'` | 确认按钮样式变体 |
|
|
33
|
+
|
|
34
|
+
**使用示例:**
|
|
35
|
+
|
|
36
|
+
```tsx
|
|
37
|
+
import { Dialog, useToast } from 'vxui-react';
|
|
38
|
+
|
|
39
|
+
function DeleteConfirm() {
|
|
40
|
+
const { push } = useToast();
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<Dialog
|
|
44
|
+
trigger={<Button variant="danger">删除项目</Button>}
|
|
45
|
+
title="确认删除"
|
|
46
|
+
description="此操作不可撤销,确定要继续吗?"
|
|
47
|
+
onConfirm={() => {
|
|
48
|
+
// 执行删除逻辑
|
|
49
|
+
push({ tone: 'success', title: '已删除' });
|
|
50
|
+
}}
|
|
51
|
+
onCancel={() => {
|
|
52
|
+
// 取消逻辑
|
|
53
|
+
}}
|
|
54
|
+
confirmLabel="确认删除"
|
|
55
|
+
cancelLabel="暂不删除"
|
|
56
|
+
confirmVariant="danger"
|
|
57
|
+
>
|
|
58
|
+
<p>删除后所有相关数据将被永久移除。</p>
|
|
59
|
+
</Dialog>
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
#### AlertDialog 移除
|
|
65
|
+
|
|
66
|
+
v1.3.7 移除了独立的 `AlertDialog` 组件。如需危险操作确认对话框,请使用 Dialog 的 `confirmVariant="danger"`:
|
|
67
|
+
|
|
68
|
+
**迁移前(v1.3.6):**
|
|
69
|
+
```tsx
|
|
70
|
+
import { AlertDialog } from 'vxui-react';
|
|
71
|
+
|
|
72
|
+
<AlertDialog
|
|
73
|
+
trigger={<Button variant="danger">删除</Button>}
|
|
74
|
+
title="确认删除"
|
|
75
|
+
onConfirm={() => {}}
|
|
76
|
+
/>
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
**迁移后(v1.3.7):**
|
|
80
|
+
```tsx
|
|
81
|
+
import { Dialog, Button } from 'vxui-react';
|
|
82
|
+
|
|
83
|
+
<Dialog
|
|
84
|
+
trigger={<Button variant="danger">删除</Button>}
|
|
85
|
+
title="确认删除"
|
|
86
|
+
confirmVariant="danger"
|
|
87
|
+
onConfirm={() => {}}
|
|
88
|
+
/>
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
#### demo 构建配置移除
|
|
92
|
+
|
|
93
|
+
`vite.demo.config.ts` 已从项目中移除。如需运行演示站点,使用标准的 `npm run dev` 命令即可。
|
|
94
|
+
|
|
15
95
|
文档内容现在按流行 UI 框架的写法组织:先给安装方式,再给最小可运行示例,最后给分场景的组件代码。
|
|
16
96
|
|
|
17
97
|
## 安装
|
|
@@ -234,6 +314,4 @@ npm run typecheck
|
|
|
234
314
|
# 构建组件库(用于 npm publish)
|
|
235
315
|
npm run build
|
|
236
316
|
|
|
237
|
-
# 构建演示站(用于 Pages 部署,输出至 dist-demo/)
|
|
238
|
-
npm run build:demo
|
|
239
317
|
```
|