vxui-react 1.1.1 → 1.1.3
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 +205 -0
- package/README.md +17 -8
- package/dist/404.html +18 -0
- package/dist/_redirects +1 -0
- package/dist/colorful_flat_icon.ico +0 -0
- package/dist/colorful_flat_icon.svg +46 -0
- package/dist/index.cjs +23 -23
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1833 -1663
- package/dist/{components → src/components}/AppShell.d.ts +2 -1
- package/dist/{components → src/components}/Button.d.ts +8 -2
- package/dist/{components → src/components}/Card.d.ts +12 -1
- package/dist/src/components/Dialog.d.ts +21 -0
- package/dist/src/components/Input.d.ts +18 -0
- package/dist/src/components/SegmentedControl.d.ts +16 -0
- package/dist/{components → src/components}/Shell.d.ts +2 -1
- package/dist/src/components/Table.d.ts +37 -0
- package/dist/{lib → src/lib}/index.d.ts +2 -0
- package/dist/src/lib/version.d.ts +1 -0
- package/dist/{lib → src/lib}/viewport.d.ts +2 -0
- package/dist/vxui-react.css +1 -1
- package/package.json +2 -1
- package/dist/components/Dialog.d.ts +0 -11
- package/dist/components/Input.d.ts +0 -9
- package/dist/components/Table.d.ts +0 -26
- /package/dist/{components → src/components}/Accordion.d.ts +0 -0
- /package/dist/{components → src/components}/Alert.d.ts +0 -0
- /package/dist/{components → src/components}/AlertDialog.d.ts +0 -0
- /package/dist/{components → src/components}/Avatar.d.ts +0 -0
- /package/dist/{components → src/components}/Badge.d.ts +0 -0
- /package/dist/{components → src/components}/Breadcrumb.d.ts +0 -0
- /package/dist/{components → src/components}/Calendar.d.ts +0 -0
- /package/dist/{components → src/components}/Carousel.d.ts +0 -0
- /package/dist/{components → src/components}/Checkbox.d.ts +0 -0
- /package/dist/{components → src/components}/CodeBlock.d.ts +0 -0
- /package/dist/{components → src/components}/ColorPicker.d.ts +0 -0
- /package/dist/{components → src/components}/Combobox.d.ts +0 -0
- /package/dist/{components → src/components}/CommandPalette.d.ts +0 -0
- /package/dist/{components → src/components}/ContextMenu.d.ts +0 -0
- /package/dist/{components → src/components}/DatePicker.d.ts +0 -0
- /package/dist/{components → src/components}/DropdownMenu.d.ts +0 -0
- /package/dist/{components → src/components}/EmptyState.d.ts +0 -0
- /package/dist/{components → src/components}/FileUpload.d.ts +0 -0
- /package/dist/{components → src/components}/Form.d.ts +0 -0
- /package/dist/{components → src/components}/Heading.d.ts +0 -0
- /package/dist/{components → src/components}/HoverCard.d.ts +0 -0
- /package/dist/{components → src/components}/Label.d.ts +0 -0
- /package/dist/{components → src/components}/LanguageSwitcher.d.ts +0 -0
- /package/dist/{components → src/components}/Menubar.d.ts +0 -0
- /package/dist/{components → src/components}/NavigationMenu.d.ts +0 -0
- /package/dist/{components → src/components}/NumberInput.d.ts +0 -0
- /package/dist/{components → src/components}/Pagination.d.ts +0 -0
- /package/dist/{components → src/components}/Popover.d.ts +0 -0
- /package/dist/{components → src/components}/Progress.d.ts +0 -0
- /package/dist/{components → src/components}/Radio.d.ts +0 -0
- /package/dist/{components → src/components}/Rating.d.ts +0 -0
- /package/dist/{components → src/components}/Resizable.d.ts +0 -0
- /package/dist/{components → src/components}/Responsive.d.ts +0 -0
- /package/dist/{components → src/components}/ScrollArea.d.ts +0 -0
- /package/dist/{components → src/components}/Select.d.ts +0 -0
- /package/dist/{components → src/components}/Separator.d.ts +0 -0
- /package/dist/{components → src/components}/Sheet.d.ts +0 -0
- /package/dist/{components → src/components}/Skeleton.d.ts +0 -0
- /package/dist/{components → src/components}/Slider.d.ts +0 -0
- /package/dist/{components → src/components}/Spinner.d.ts +0 -0
- /package/dist/{components → src/components}/Stepper.d.ts +0 -0
- /package/dist/{components → src/components}/Switch.d.ts +0 -0
- /package/dist/{components → src/components}/Tabs.d.ts +0 -0
- /package/dist/{components → src/components}/TagInput.d.ts +0 -0
- /package/dist/{components → src/components}/Text.d.ts +0 -0
- /package/dist/{components → src/components}/Textarea.d.ts +0 -0
- /package/dist/{components → src/components}/ThemeProvider.d.ts +0 -0
- /package/dist/{components → src/components}/Timeline.d.ts +0 -0
- /package/dist/{components → src/components}/Toast.d.ts +0 -0
- /package/dist/{components → src/components}/Toggle.d.ts +0 -0
- /package/dist/{components → src/components}/Tooltip.d.ts +0 -0
- /package/dist/{components → src/components}/TreeView.d.ts +0 -0
- /package/dist/{components → src/components}/mobile/ActionSheet.d.ts +0 -0
- /package/dist/{components → src/components}/mobile/BottomNav.d.ts +0 -0
- /package/dist/{components → src/components}/mobile/MobileApp.d.ts +0 -0
- /package/dist/{components → src/components}/mobile/MobileDrawer.d.ts +0 -0
- /package/dist/{components → src/components}/mobile/MobileList.d.ts +0 -0
- /package/dist/{components → src/components}/mobile/MobilePreviewPage.d.ts +0 -0
- /package/dist/{components → src/components}/mobile/MobileShell.d.ts +0 -0
- /package/dist/{components → src/components}/pages/ErrorPage.d.ts +0 -0
- /package/dist/{components → src/components}/pages/HomePage.d.ts +0 -0
- /package/dist/{components → src/components}/pages/LoginPage.d.ts +0 -0
- /package/dist/{components → src/components}/pages/PrivacyPolicyPage.d.ts +0 -0
- /package/dist/{components → src/components}/pages/RegisterPage.d.ts +0 -0
- /package/dist/{components → src/components}/pages/TermsOfServicePage.d.ts +0 -0
- /package/dist/{components → src/components}/pages/homePageContent.d.ts +0 -0
- /package/dist/{components → src/components}/pages/legalPageContent.d.ts +0 -0
- /package/dist/{lib → src/lib}/cx.d.ts +0 -0
package/README.en.md
ADDED
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
# VXUI React · v1.1.1
|
|
2
|
+
|
|
3
|
+
**Website**: [ui.vx.link](https://ui.vx.link) | **GitHub**: [tmplink/vxui_react](https://github.com/tmplink/vxui_react) | [中文](README.md)
|
|
4
|
+
|
|
5
|
+
VXUI React is a general-purpose React UI component library designed for admin panels, ops dashboards, internal tools, and data-heavy interfaces.
|
|
6
|
+
|
|
7
|
+
The documentation follows the conventions of popular UI frameworks: installation first, then a minimal working example, then scenario-specific component code.
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
Install from npm:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install vxui-react
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
`react` and `react-dom` must be provided by the host application.
|
|
18
|
+
|
|
19
|
+
## Import Styles
|
|
20
|
+
|
|
21
|
+
```tsx
|
|
22
|
+
import 'vxui-react/styles.css';
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Basic Setup
|
|
26
|
+
|
|
27
|
+
```tsx
|
|
28
|
+
// src/main.tsx
|
|
29
|
+
import ReactDOM from 'react-dom/client';
|
|
30
|
+
import { ThemeProvider, ToastProvider, themePresets } from 'vxui-react';
|
|
31
|
+
import App from './App';
|
|
32
|
+
import 'vxui-react/styles.css';
|
|
33
|
+
|
|
34
|
+
ReactDOM.createRoot(document.getElementById('root')!).render(
|
|
35
|
+
<ThemeProvider themes={themePresets} defaultTheme="light">
|
|
36
|
+
<ToastProvider>
|
|
37
|
+
<App />
|
|
38
|
+
</ToastProvider>
|
|
39
|
+
</ThemeProvider>,
|
|
40
|
+
);
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## First Page
|
|
44
|
+
|
|
45
|
+
```tsx
|
|
46
|
+
import {
|
|
47
|
+
AppShell,
|
|
48
|
+
Button,
|
|
49
|
+
Card,
|
|
50
|
+
CardContent,
|
|
51
|
+
CardHeader,
|
|
52
|
+
CardTitle,
|
|
53
|
+
Input,
|
|
54
|
+
} from 'vxui-react';
|
|
55
|
+
|
|
56
|
+
const navSections = [
|
|
57
|
+
{
|
|
58
|
+
title: 'Workspace',
|
|
59
|
+
items: [{ key: 'overview', label: 'Overview', active: true }],
|
|
60
|
+
},
|
|
61
|
+
];
|
|
62
|
+
|
|
63
|
+
export function App() {
|
|
64
|
+
return (
|
|
65
|
+
<AppShell
|
|
66
|
+
brand="Acme Ops"
|
|
67
|
+
title="Overview"
|
|
68
|
+
description="Build internal tools with a single shell."
|
|
69
|
+
navSections={navSections}
|
|
70
|
+
headerActions={<Button size="sm">Create order</Button>}
|
|
71
|
+
>
|
|
72
|
+
<Card>
|
|
73
|
+
<CardHeader>
|
|
74
|
+
<CardTitle>Queue health</CardTitle>
|
|
75
|
+
</CardHeader>
|
|
76
|
+
<CardContent>
|
|
77
|
+
<Input label="Search orders" placeholder="PO-1024" />
|
|
78
|
+
</CardContent>
|
|
79
|
+
</Card>
|
|
80
|
+
</AppShell>
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Form Example
|
|
86
|
+
|
|
87
|
+
```tsx
|
|
88
|
+
import { Button, Checkbox, Input, Select, Textarea } from 'vxui-react';
|
|
89
|
+
|
|
90
|
+
export function ProjectForm() {
|
|
91
|
+
return (
|
|
92
|
+
<form style={{ display: 'grid', gap: 16 }}>
|
|
93
|
+
<Input label="Project name" placeholder="Northwind migration" />
|
|
94
|
+
|
|
95
|
+
<Select label="Release track" defaultValue="stable">
|
|
96
|
+
<option value="stable">Stable</option>
|
|
97
|
+
<option value="preview">Preview</option>
|
|
98
|
+
<option value="internal">Internal</option>
|
|
99
|
+
</Select>
|
|
100
|
+
|
|
101
|
+
<Textarea
|
|
102
|
+
label="Summary"
|
|
103
|
+
rows={4}
|
|
104
|
+
placeholder="Describe what changed in this release."
|
|
105
|
+
/>
|
|
106
|
+
|
|
107
|
+
<Checkbox label="Notify operators after publish" defaultChecked />
|
|
108
|
+
|
|
109
|
+
<Button type="submit">Save changes</Button>
|
|
110
|
+
</form>
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## Feedback Example
|
|
116
|
+
|
|
117
|
+
```tsx
|
|
118
|
+
import { Alert, Button, Progress, useToast } from 'vxui-react';
|
|
119
|
+
|
|
120
|
+
export function PublishActions() {
|
|
121
|
+
const { push } = useToast();
|
|
122
|
+
|
|
123
|
+
return (
|
|
124
|
+
<div style={{ display: 'grid', gap: 16 }}>
|
|
125
|
+
<Alert variant="info" title="Ready to publish">
|
|
126
|
+
Confirm the release notes before you notify customers.
|
|
127
|
+
</Alert>
|
|
128
|
+
|
|
129
|
+
<Progress label="Rollout progress" value={72} showLabel />
|
|
130
|
+
|
|
131
|
+
<Button
|
|
132
|
+
onClick={() =>
|
|
133
|
+
push({
|
|
134
|
+
tone: 'success',
|
|
135
|
+
title: 'Release published',
|
|
136
|
+
description: 'Customers can see the new version now.',
|
|
137
|
+
})
|
|
138
|
+
}
|
|
139
|
+
>
|
|
140
|
+
Publish release
|
|
141
|
+
</Button>
|
|
142
|
+
</div>
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
## Custom Theme
|
|
148
|
+
|
|
149
|
+
```tsx
|
|
150
|
+
import { ThemeProvider, createTheme, themePresets } from 'vxui-react';
|
|
151
|
+
|
|
152
|
+
const themes = {
|
|
153
|
+
...themePresets,
|
|
154
|
+
ocean: createTheme('dark', {
|
|
155
|
+
label: 'Ocean',
|
|
156
|
+
tokens: {
|
|
157
|
+
'--vx-primary': '#38bdf8',
|
|
158
|
+
'--vx-primary-strong': '#0ea5e9',
|
|
159
|
+
'--vx-primary-soft': 'rgba(56, 189, 248, 0.16)',
|
|
160
|
+
'--vx-bg': '#06131f',
|
|
161
|
+
'--vx-surface': '#0d2236',
|
|
162
|
+
},
|
|
163
|
+
}),
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
export function Root({ children }: { children: React.ReactNode }) {
|
|
167
|
+
return (
|
|
168
|
+
<ThemeProvider themes={themes} defaultTheme="ocean">
|
|
169
|
+
{children}
|
|
170
|
+
</ThemeProvider>
|
|
171
|
+
);
|
|
172
|
+
}
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
Use `useTheme()` at runtime to read the current theme or call `setTheme('ocean')` to switch to any registered theme.
|
|
176
|
+
|
|
177
|
+
## What's Included
|
|
178
|
+
|
|
179
|
+
- **Layout**: AppShell, Card, Separator, Breadcrumb, Pagination, Resizable, ScrollArea
|
|
180
|
+
- **Forms**: Input, Select, Checkbox, Radio, Textarea, Slider, Switch, NumberInput, TagInput, ColorPicker, DatePicker, FileUpload, Form, Rating, Combobox
|
|
181
|
+
- **Feedback**: Alert, AlertDialog, Toast, Progress, Skeleton, Spinner, Stepper, Timeline, EmptyState
|
|
182
|
+
- **Overlay**: Dialog, Sheet, Popover, DropdownMenu, ContextMenu, Tooltip, HoverCard, CommandPalette, Menubar, NavigationMenu
|
|
183
|
+
- **Data Display**: Avatar, Table, Badge, Tabs, Accordion, TreeView, Carousel, Calendar
|
|
184
|
+
- **Typography**: Heading, Text, Label, CodeBlock
|
|
185
|
+
- **Mobile**: MobileShell, BottomNav, ActionSheet, MobileDrawer, MobileList
|
|
186
|
+
|
|
187
|
+
## Local Development
|
|
188
|
+
|
|
189
|
+
```bash
|
|
190
|
+
npm install
|
|
191
|
+
npm run dev
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
## Validation & Build
|
|
195
|
+
|
|
196
|
+
```bash
|
|
197
|
+
# TypeScript type check
|
|
198
|
+
npm run typecheck
|
|
199
|
+
|
|
200
|
+
# Build component library (for npm publish)
|
|
201
|
+
npm run build
|
|
202
|
+
|
|
203
|
+
# Build demo site (for Pages deployment, output to dist-demo/)
|
|
204
|
+
npm run build:demo
|
|
205
|
+
```
|
package/README.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
# VXUI React
|
|
1
|
+
# VXUI React · v1.1.3
|
|
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
|
+
|
|
5
|
+
VXUI React 是一套适合后台、运营台、仪表盘和内部工具的通用 UI 组件库。
|
|
4
6
|
|
|
5
7
|
文档内容现在按流行 UI 框架的写法组织:先给安装方式,再给最小可运行示例,最后给分场景的组件代码。
|
|
6
8
|
|
|
@@ -176,12 +178,13 @@ export function Root({ children }: { children: React.ReactNode }) {
|
|
|
176
178
|
|
|
177
179
|
## 当前包含
|
|
178
180
|
|
|
179
|
-
- Layout
|
|
180
|
-
- Forms
|
|
181
|
-
- Feedback
|
|
182
|
-
- Overlay
|
|
183
|
-
- Data Display
|
|
184
|
-
-
|
|
181
|
+
- **Layout**: AppShell、Card、Separator、Breadcrumb、Pagination、Resizable、ScrollArea
|
|
182
|
+
- **Forms**: Input、Select、Checkbox、Radio、Textarea、Slider、Switch、NumberInput、TagInput、ColorPicker、DatePicker、FileUpload、Form、Rating、Combobox
|
|
183
|
+
- **Feedback**: Alert、AlertDialog、Toast、Progress、Skeleton、Spinner、Stepper、Timeline、EmptyState
|
|
184
|
+
- **Overlay**: Dialog、Sheet、Popover、DropdownMenu、ContextMenu、Tooltip、HoverCard、CommandPalette、Menubar、NavigationMenu
|
|
185
|
+
- **Data Display**: Avatar、Table、Badge、Tabs、Accordion、TreeView、Carousel、Calendar
|
|
186
|
+
- **Typography**: Heading、Text、Label、CodeBlock
|
|
187
|
+
- **Mobile**: MobileShell、BottomNav、ActionSheet、MobileDrawer、MobileList
|
|
185
188
|
|
|
186
189
|
## 本地开发
|
|
187
190
|
|
|
@@ -193,6 +196,12 @@ npm run dev
|
|
|
193
196
|
## 验证与构建
|
|
194
197
|
|
|
195
198
|
```bash
|
|
199
|
+
# TypeScript 类型检查
|
|
196
200
|
npm run typecheck
|
|
201
|
+
|
|
202
|
+
# 构建组件库(用于 npm publish)
|
|
197
203
|
npm run build
|
|
204
|
+
|
|
205
|
+
# 构建演示站(用于 Pages 部署,输出至 dist-demo/)
|
|
206
|
+
npm run build:demo
|
|
198
207
|
```
|
package/dist/404.html
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<title>VXUI React</title>
|
|
6
|
+
<script>
|
|
7
|
+
// GitHub Pages SPA redirect hack.
|
|
8
|
+
// Redirects all 404s back to index.html, preserving the full path as a
|
|
9
|
+
// query-string so the SPA router can restore it client-side.
|
|
10
|
+
var l = window.location;
|
|
11
|
+
l.replace(
|
|
12
|
+
l.protocol + '//' + l.host + '/?p=' +
|
|
13
|
+
encodeURIComponent(l.pathname + l.search) + l.hash
|
|
14
|
+
);
|
|
15
|
+
</script>
|
|
16
|
+
</head>
|
|
17
|
+
<body></body>
|
|
18
|
+
</html>
|
package/dist/_redirects
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/* /index.html 200
|
|
Binary file
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" id="层_1" data-name="层 1" viewBox="0 0 192 192">
|
|
2
|
+
<defs>
|
|
3
|
+
<!-- 日落橙金渐变背景 -->
|
|
4
|
+
<linearGradient id="bgGradient" x1="0%" y1="0%" x2="100%" y2="100%">
|
|
5
|
+
<stop offset="0%" stop-color="#C0392B"/>
|
|
6
|
+
<stop offset="30%" stop-color="#E8541A"/>
|
|
7
|
+
<stop offset="65%" stop-color="#F39C12"/>
|
|
8
|
+
<stop offset="100%" stop-color="#F1C40F"/>
|
|
9
|
+
</linearGradient>
|
|
10
|
+
<!-- 左侧形状:白色微暖 -->
|
|
11
|
+
<linearGradient id="shapeGrad1" x1="0%" y1="0%" x2="100%" y2="100%">
|
|
12
|
+
<stop offset="0%" stop-color="#FFFFFF" stop-opacity="1"/>
|
|
13
|
+
<stop offset="100%" stop-color="#FFF5E0" stop-opacity="0.93"/>
|
|
14
|
+
</linearGradient>
|
|
15
|
+
<!-- 右侧形状:白色微暖 -->
|
|
16
|
+
<linearGradient id="shapeGrad2" x1="100%" y1="0%" x2="0%" y2="100%">
|
|
17
|
+
<stop offset="0%" stop-color="#FFFFFF" stop-opacity="1"/>
|
|
18
|
+
<stop offset="100%" stop-color="#FFF8E7" stop-opacity="0.93"/>
|
|
19
|
+
</linearGradient>
|
|
20
|
+
</defs>
|
|
21
|
+
|
|
22
|
+
<!-- 圆角矩形背景:炫彩渐变 -->
|
|
23
|
+
<rect width="192" height="192" rx="22.88" fill="url(#bgGradient)"/>
|
|
24
|
+
|
|
25
|
+
<!-- 左侧 X 字形 -->
|
|
26
|
+
<polygon
|
|
27
|
+
points="45 36.75 28.5 36.75 61.5 90.75 26.25 144 42.75 144 79.5 91.5 45 36.75"
|
|
28
|
+
fill="url(#shapeGrad1)"/>
|
|
29
|
+
|
|
30
|
+
<!-- 右侧 XX 字形 -->
|
|
31
|
+
<polygon
|
|
32
|
+
points="162.75 36.75 141 36.75 115.5 81 91.5 37.5 68.25 37.5 102.75 91.5 66 144 88.5 144 114 102.75 138.75 144.75 161.25 144.75 126.75 90.75 162.75 36.75"
|
|
33
|
+
fill="url(#shapeGrad2)"/>
|
|
34
|
+
|
|
35
|
+
<!-- 底部装饰:暖色圆点 -->
|
|
36
|
+
<circle cx="31.5" cy="170.63" r="3.75" fill="#FF4D4D"/>
|
|
37
|
+
<circle cx="42.75" cy="170.63" r="3.75" fill="#FF8C00"/>
|
|
38
|
+
<circle cx="54" cy="170.63" r="3.75" fill="#FFC300"/>
|
|
39
|
+
<circle cx="131.25" cy="170.63" r="3.75" fill="#FF6B35"/>
|
|
40
|
+
<circle cx="142.5" cy="170.63" r="3.75" fill="#FFD700"/>
|
|
41
|
+
|
|
42
|
+
<!-- 底部装饰:短横条(暖色) -->
|
|
43
|
+
<rect x="60.75" y="166.88" width="18.75" height="7.5" rx="3.75" fill="#E74C3C"/>
|
|
44
|
+
<rect x="105" y="166.88" width="18.75" height="7.5" rx="3.75" fill="#F39C12"/>
|
|
45
|
+
<rect x="149.25" y="166.88" width="18.75" height="7.5" rx="3.75" fill="#FFEAA7"/>
|
|
46
|
+
</svg>
|