straw-ui-vue 0.1.20 → 0.1.22
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.md +146 -146
- package/dist/{cn-CiflBmGp.js → cn-CThBjlvA.js} +7 -7
- package/dist/components/st-button/types.d.ts +63 -63
- package/dist/components/st-card/types.d.ts +184 -184
- package/dist/components/st-cascade/index.d.ts +3 -11
- package/dist/components/st-cascade/st-cascade-panel.d.ts +2 -5
- package/dist/components/st-cascade/st-cascade.d.ts +2 -7
- package/dist/components/st-cascade/types.d.ts +166 -156
- package/dist/components/st-checkbox/types.d.ts +120 -120
- package/dist/components/st-checkbox/useCheckboxGroupState.d.ts +2 -0
- package/dist/components/st-color-picker/index.d.ts +94 -12
- package/dist/components/st-color-picker/st-color-picker-panel.d.ts +9 -2
- package/dist/components/st-color-picker/st-color-picker.d.ts +9 -2
- package/dist/components/st-color-picker/types.d.ts +176 -160
- package/dist/components/st-date-picker/index.d.ts +85 -19
- package/dist/components/st-date-picker/st-date-picker-panel.d.ts +9 -4
- package/dist/components/st-date-picker/st-date-picker.d.ts +2 -5
- package/dist/components/st-date-picker/types.d.ts +171 -157
- package/dist/components/st-datetime-picker/index.d.ts +89 -19
- package/dist/components/st-datetime-picker/st-datetime-picker-panel.d.ts +9 -4
- package/dist/components/st-datetime-picker/st-datetime-picker.d.ts +2 -5
- package/dist/components/st-datetime-picker/types.d.ts +169 -155
- package/dist/components/st-dialog/types.d.ts +293 -293
- package/dist/components/st-dialog/useDialogState.d.ts +2 -0
- package/dist/components/st-divider/types.d.ts +92 -92
- package/dist/components/st-divider/useDividerState.d.ts +2 -0
- package/dist/components/st-drawer/types.d.ts +232 -232
- package/dist/components/st-drawer/useDrawerState.d.ts +2 -0
- package/dist/components/st-empty/types.d.ts +44 -39
- package/dist/components/st-form-control/types.d.ts +19 -21
- package/dist/components/st-form-description/index.d.ts +1 -3
- package/dist/components/st-form-description/st-form-description.d.ts +2 -5
- package/dist/components/st-form-description/types.d.ts +26 -21
- package/dist/components/st-form-field/index.d.ts +1 -11
- package/dist/components/st-form-field/st-form-field.d.ts +2 -9
- package/dist/components/st-form-field/types.d.ts +63 -64
- package/dist/components/st-form-item/index.d.ts +1 -3
- package/dist/components/st-form-item/st-form-item.d.ts +2 -5
- package/dist/components/st-form-item/types.d.ts +19 -21
- package/dist/components/st-form-label/index.d.ts +1 -3
- package/dist/components/st-form-label/st-form-label.d.ts +2 -5
- package/dist/components/st-form-label/types.d.ts +24 -19
- package/dist/components/st-form-message/index.d.ts +1 -3
- package/dist/components/st-form-message/st-form-message.d.ts +2 -5
- package/dist/components/st-form-message/types.d.ts +28 -23
- package/dist/components/st-image/types.d.ts +58 -58
- package/dist/components/st-input/index.d.ts +1863 -607
- package/dist/components/st-input/st-input-group-input.d.ts +9 -2
- package/dist/components/st-input/st-input-group-textarea.d.ts +9 -2
- package/dist/components/st-input/st-input-number.d.ts +10 -3
- package/dist/components/st-input/st-input.d.ts +165 -57
- package/dist/components/st-input/st-textarea.d.ts +167 -57
- package/dist/components/st-input/types.d.ts +465 -415
- package/dist/components/st-label/index.d.ts +1 -3
- package/dist/components/st-label/st-label.d.ts +2 -5
- package/dist/components/st-label/types.d.ts +24 -19
- package/dist/components/st-menu/index.d.ts +14 -82
- package/dist/components/st-menu/st-menu-content.d.ts +1 -6
- package/dist/components/st-menu/st-menu-divider.d.ts +1 -4
- package/dist/components/st-menu/st-menu-group.d.ts +0 -4
- package/dist/components/st-menu/st-menu-item.d.ts +0 -4
- package/dist/components/st-menu/st-menu-trigger.d.ts +1 -6
- package/dist/components/st-menu/types.d.ts +316 -262
- package/dist/components/st-menu/useMenuState.d.ts +60 -0
- package/dist/components/st-pagination/index.d.ts +1 -7
- package/dist/components/st-pagination/st-pagination.d.ts +2 -9
- package/dist/components/st-pagination/types.d.ts +91 -91
- package/dist/components/st-popover/index.d.ts +17 -47
- package/dist/components/st-popover/st-popover-arrow.d.ts +1 -8
- package/dist/components/st-popover/st-popover-content.d.ts +0 -6
- package/dist/components/st-popover/st-popover-trigger.d.ts +0 -6
- package/dist/components/st-popover/st-popover.d.ts +11 -12
- package/dist/components/st-popover/types.d.ts +233 -202
- package/dist/components/st-popover/usePopoverState.d.ts +62 -0
- package/dist/components/st-progress/index.d.ts +1 -5
- package/dist/components/st-progress/st-progress.d.ts +2 -7
- package/dist/components/st-progress/types.d.ts +42 -37
- package/dist/components/st-radio/types.d.ts +126 -126
- package/dist/components/st-radio/useRadioGroupState.d.ts +2 -0
- package/dist/components/st-scrollbar/index.d.ts +1 -3
- package/dist/components/st-scrollbar/st-scrollbar.d.ts +2 -5
- package/dist/components/st-scrollbar/types.d.ts +56 -62
- package/dist/components/st-segmented/index.d.ts +43 -8
- package/dist/components/st-segmented/st-segmented.d.ts +9 -2
- package/dist/components/st-segmented/types.d.ts +53 -53
- package/dist/components/st-select/index.d.ts +19 -93
- package/dist/components/st-select/st-select-content.d.ts +1 -8
- package/dist/components/st-select/st-select-empty.d.ts +1 -8
- package/dist/components/st-select/st-select-group.d.ts +1 -8
- package/dist/components/st-select/st-select-item.d.ts +0 -6
- package/dist/components/st-select/st-select-trigger.d.ts +6 -12
- package/dist/components/st-select/st-select.d.ts +2 -7
- package/dist/components/st-select/types.d.ts +68 -0
- package/dist/components/st-select/useSelectState.d.ts +55 -0
- package/dist/components/st-sidebar/index.d.ts +13 -3
- package/dist/components/st-sidebar/st-sidebar.d.ts +5 -1
- package/dist/components/st-sidebar/types.d.ts +85 -85
- package/dist/components/st-sidebar/useSidebarState.d.ts +2 -0
- package/dist/components/st-sidebar-item/index.d.ts +13 -3
- package/dist/components/st-sidebar-item/st-sidebar-item.d.ts +5 -1
- package/dist/components/st-sidebar-item/types.d.ts +45 -45
- package/dist/components/st-skeleton/index.d.ts +3 -11
- package/dist/components/st-skeleton/st-skeleton-item.d.ts +2 -5
- package/dist/components/st-skeleton/st-skeleton.d.ts +2 -7
- package/dist/components/st-skeleton/types.d.ts +60 -56
- package/dist/components/st-slider/index.d.ts +1 -17
- package/dist/components/st-slider/st-slider.d.ts +2 -19
- package/dist/components/st-slider/types.d.ts +69 -61
- package/dist/components/st-splitter/index.d.ts +14 -6
- package/dist/components/st-splitter/st-splitter.d.ts +7 -6
- package/dist/components/st-splitter/types.d.ts +260 -260
- package/dist/components/st-splitter/useSplitter.d.ts +0 -8
- package/dist/components/st-splitter/useSplitterState.d.ts +2 -0
- package/dist/components/st-splitter-panel/index.d.ts +6 -3
- package/dist/components/st-splitter-panel/st-splitter-panel.d.ts +4 -5
- package/dist/components/st-splitter-panel/types.d.ts +63 -63
- package/dist/components/st-switch/types.d.ts +53 -53
- package/dist/components/st-tabs/index.d.ts +26 -6
- package/dist/components/st-tabs/st-tabs-pane.d.ts +5 -1
- package/dist/components/st-tabs/types.d.ts +151 -151
- package/dist/components/st-tabs/useTabsState.d.ts +12 -0
- package/dist/components/st-tag/index.d.ts +1 -20
- package/dist/components/st-tag/st-tag.d.ts +3 -13
- package/dist/components/st-tag/types.d.ts +0 -11
- package/dist/components/st-time-picker/index.d.ts +102 -14
- package/dist/components/st-time-picker/st-time-picker-panel.d.ts +9 -2
- package/dist/components/st-time-picker/st-time-picker.d.ts +9 -2
- package/dist/components/st-time-picker/types.d.ts +155 -143
- package/dist/components/st-toggle/index.d.ts +15 -13
- package/dist/components/st-toggle/st-toggle.d.ts +11 -10
- package/dist/components/st-toggle/types.d.ts +58 -58
- package/dist/components/st-tooltip/index.d.ts +27 -352
- package/dist/components/st-tooltip/st-tooltip.d.ts +14 -10
- package/dist/components/st-tooltip/types.d.ts +85 -172
- package/dist/components/st-tree/index.d.ts +48 -73
- package/dist/components/st-tree/st-tree-node.d.ts +9 -2
- package/dist/components/st-tree/st-tree.d.ts +15 -69
- package/dist/components/st-tree/types.d.ts +193 -188
- package/dist/components/st-tree/useTreeStyleState.d.ts +2 -0
- package/dist/directive/v-intersection.d.ts +3 -15
- package/dist/directive/v-resize.d.ts +3 -15
- package/dist/dist--ubF9h1Q.js +335 -0
- package/dist/global.d.ts +0 -3
- package/dist/index.d.ts +2 -8
- package/dist/straw-ui.js +3811 -4257
- package/dist/useDialogState-Cs1mp3-Y.js +5 -0
- package/dist/utils/device.d.ts +20 -21
- package/dist/utils/z-index.d.ts +9 -39
- package/package.json +19 -14
- package/dist/components/st-tooltip/st-tooltip-container.d.ts +0 -44
- package/dist/components/st-tooltip/st-tooltip-content.d.ts +0 -30
- package/dist/components/st-tooltip/st-tooltip-trigger.d.ts +0 -23
- package/dist/context-B_FwxbY6.js +0 -4
- package/dist/utils/id.d.ts +0 -4
package/README.md
CHANGED
|
@@ -1,146 +1,146 @@
|
|
|
1
|
-
# Straw UI
|
|
2
|
-
|
|
3
|
-
一个基于 Vue 3 + TypeScript + UnoCSS 的现代组件库。
|
|
4
|
-
|
|
5
|
-
## 特性
|
|
6
|
-
|
|
7
|
-
- 🚀 **Vue 3 + TypeScript** - 完整的类型支持
|
|
8
|
-
- 🎨 **UnoCSS** - 原子化 CSS,按需生成
|
|
9
|
-
- 📦 **零运行时依赖** - 仅对等依赖 Vue 3
|
|
10
|
-
- 🔧 **按需导入** - 支持 tree-shaking
|
|
11
|
-
- 🌙 **暗色主题** - 内置暗色模式支持
|
|
12
|
-
|
|
13
|
-
## 安装
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
npm install straw-ui-vue
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
## 快速开始
|
|
20
|
-
|
|
21
|
-
### 完整引入
|
|
22
|
-
|
|
23
|
-
```ts
|
|
24
|
-
import { createApp } from 'vue';
|
|
25
|
-
import StrawUI from 'straw-ui-vue';
|
|
26
|
-
|
|
27
|
-
const app = createApp(App);
|
|
28
|
-
app.use(StrawUI);
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
### 按需导入
|
|
32
|
-
|
|
33
|
-
```vue
|
|
34
|
-
<script setup lang="ts">
|
|
35
|
-
import { StButton, StInput } from 'straw-ui-vue';
|
|
36
|
-
</script>
|
|
37
|
-
|
|
38
|
-
<template>
|
|
39
|
-
<StButton>Click me</StButton>
|
|
40
|
-
<StInput v-model="value" placeholder="Type something" />
|
|
41
|
-
</template>
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
## UnoCSS 集成
|
|
45
|
-
|
|
46
|
-
Straw UI 基于 UnoCSS 构建:
|
|
47
|
-
|
|
48
|
-
```ts
|
|
49
|
-
// uno.config.ts
|
|
50
|
-
import { defineConfig, presetWind4, presetIcons } from 'unocss';
|
|
51
|
-
import { presetStrawUI } from 'straw-ui-vue/unocss';
|
|
52
|
-
|
|
53
|
-
export default defineConfig({
|
|
54
|
-
presets: [
|
|
55
|
-
presetWind4(),
|
|
56
|
-
presetIcons(),
|
|
57
|
-
presetStrawUI(), // Straw UI 预设
|
|
58
|
-
],
|
|
59
|
-
});
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
```ts
|
|
63
|
-
// main.ts
|
|
64
|
-
import 'straw-ui-vue/dist/variables.css'; // 主题预设变量,或使用自己的变量文件
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
详细配置请参阅 [UnoCSS 集成文档](./docs/unocss.md)。
|
|
68
|
-
|
|
69
|
-
## TypeScript 支持
|
|
70
|
-
|
|
71
|
-
Straw UI 提供完整的 TypeScript 类型支持。
|
|
72
|
-
|
|
73
|
-
## 组件列表
|
|
74
|
-
|
|
75
|
-
| 组件 | 说明 |
|
|
76
|
-
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
77
|
-
| `StButton` | 按钮组件 |
|
|
78
|
-
| `StCard` | 卡片组件(含 StCardGroup、StCardGroupHeader、StCardGroupTitle、StCardGroupContent、StCardGroupFooter、StCardGroupAction、StCardGroupDescription 子组件) |
|
|
79
|
-
| `StCascade` / `StCascadePanel` | 级联选择组件 |
|
|
80
|
-
| `StCheckbox` / `StCheckboxGroup` | 复选框 / 复选框组组件 |
|
|
81
|
-
| `StColorPicker` / `StColorPickerPanel` | 颜色选择器组件 |
|
|
82
|
-
| `StDatePicker` / `StDatePickerPanel` | 日期选择器组件 |
|
|
83
|
-
| `StDateTimePicker` / `StDateTimePickerPanel` | 日期时间选择器组件 |
|
|
84
|
-
| `StDialog` | 对话框组件(含 StDialogGroup、StDialogGroupHeader、StDialogGroupTitle、StDialogGroupBody、StDialogGroupContent、StDialogGroupFooter、StDialogGroupAction、StDialogGroupOverlay、StDialogGroupDraggable 子组件) |
|
|
85
|
-
| `StDivider` | 分割线组件 |
|
|
86
|
-
| `StDrawer` | 抽屉组件(含 StDrawerGroup、StDrawerGroupHeader、StDrawerGroupTitle、StDrawerGroupBody、StDrawerGroupContent、StDrawerGroupFooter、StDrawerGroupAction、StDrawerGroupOverlay 子组件) |
|
|
87
|
-
| `StEmpty` | 空状态组件 |
|
|
88
|
-
| `StFormControl` / `StFormDescription` / `StFormField` / `StFormItem` / `StFormLabel` / `StFormMessage` | 表单字段系列组件 |
|
|
89
|
-
| `StImage` | 图片组件 |
|
|
90
|
-
| `StInput` / `StInputGroup` / `StInputGroupAddon` / `StInputGroupButton` / `StInputGroupInput` / `StInputGroupText` / `StInputGroupTextarea` / `StInputNumber` / `StTextarea` | 输入框系列组件 |
|
|
91
|
-
| `StLabel` | 标签组件 |
|
|
92
|
-
| `StMenu`(含 StMenuContainer、StMenuContent、StMenuDivider、StMenuGroup、StMenuItem、StMenuNode、StMenuTrigger) | 菜单组件 |
|
|
93
|
-
| `StPagination` | 分页组件 |
|
|
94
|
-
| `StPopover`(含 StPopoverArrow、StPopoverContainer、StPopoverContent、StPopoverTrigger) | 弹出卡片组件 |
|
|
95
|
-
| `StProgress` | 进度条组件 |
|
|
96
|
-
| `StRadio` / `StRadioGroup` | 单选框 / 单选框组组件 |
|
|
97
|
-
| `StScrollbar` | 滚动条组件 |
|
|
98
|
-
| `StSegmented` | 分段控制器组件 |
|
|
99
|
-
| `StSelect`(含 StSelectContainer、StSelectContent、StSelectEmpty、StSelectGroup、StSelectItem、StSelectTrigger) | 下拉选择器组件 |
|
|
100
|
-
| `StSidebar` / `StSidebarItem` | 侧边栏 / 侧边栏项组件 |
|
|
101
|
-
| `StSkeleton` / `StSkeletonItem` | 骨架屏组件 |
|
|
102
|
-
| `StSlider` | 滑块组件 |
|
|
103
|
-
| `StSplitter` / `StSplitterPanel` | 分割面板组件 |
|
|
104
|
-
| `StSwitch` | 开关组件 |
|
|
105
|
-
| `StTabs` / `StTabsPane` | 标签页组件 |
|
|
106
|
-
| `StTag` | 标签组件 |
|
|
107
|
-
| `StTimePicker` / `StTimePickerPanel` | 时间选择器组件 |
|
|
108
|
-
| `StToggle` | 切换按钮组件 |
|
|
109
|
-
| `StTooltip`(含 StTooltipContainer、StTooltipContent、StTooltipTrigger) | 工具提示组件 |
|
|
110
|
-
| `StTree` / `StTreeNode` | 树形组件 |
|
|
111
|
-
|
|
112
|
-
## 自定义指令
|
|
113
|
-
|
|
114
|
-
| 指令 | 说明 |
|
|
115
|
-
| ---------------- | ---------------- |
|
|
116
|
-
| `v-intersection` | 元素可视区域监听 |
|
|
117
|
-
| `v-resize` | 元素尺寸变化监听 |
|
|
118
|
-
|
|
119
|
-
## 主题定制
|
|
120
|
-
|
|
121
|
-
Straw UI 使用 CSS 变量定义主题,你可以通过覆盖变量来自定义主题:
|
|
122
|
-
|
|
123
|
-
```css
|
|
124
|
-
:root {
|
|
125
|
-
--primary: #3b82f6;
|
|
126
|
-
--primary-foreground: #ffffff;
|
|
127
|
-
--radius: 0.5rem;
|
|
128
|
-
/* 更多变量... */
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
[data-theme='dark'] {
|
|
132
|
-
--primary: #3b82f6;
|
|
133
|
-
/* 暗色主题变量... */
|
|
134
|
-
}
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
完整变量列表请参阅 [UnoCSS 集成文档](./docs/unocss.md#主题变量)。
|
|
138
|
-
|
|
139
|
-
## 文档
|
|
140
|
-
|
|
141
|
-
- [UnoCSS 集成](./docs/unocss.md)
|
|
142
|
-
- [TypeScript 配置](./docs/typescript.md)
|
|
143
|
-
|
|
144
|
-
## License
|
|
145
|
-
|
|
146
|
-
MIT
|
|
1
|
+
# Straw UI
|
|
2
|
+
|
|
3
|
+
一个基于 Vue 3 + TypeScript + UnoCSS 的现代组件库。
|
|
4
|
+
|
|
5
|
+
## 特性
|
|
6
|
+
|
|
7
|
+
- 🚀 **Vue 3 + TypeScript** - 完整的类型支持
|
|
8
|
+
- 🎨 **UnoCSS** - 原子化 CSS,按需生成
|
|
9
|
+
- 📦 **零运行时依赖** - 仅对等依赖 Vue 3
|
|
10
|
+
- 🔧 **按需导入** - 支持 tree-shaking
|
|
11
|
+
- 🌙 **暗色主题** - 内置暗色模式支持
|
|
12
|
+
|
|
13
|
+
## 安装
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install straw-ui-vue
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## 快速开始
|
|
20
|
+
|
|
21
|
+
### 完整引入
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
import { createApp } from 'vue';
|
|
25
|
+
import StrawUI from 'straw-ui-vue';
|
|
26
|
+
|
|
27
|
+
const app = createApp(App);
|
|
28
|
+
app.use(StrawUI);
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### 按需导入
|
|
32
|
+
|
|
33
|
+
```vue
|
|
34
|
+
<script setup lang="ts">
|
|
35
|
+
import { StButton, StInput } from 'straw-ui-vue';
|
|
36
|
+
</script>
|
|
37
|
+
|
|
38
|
+
<template>
|
|
39
|
+
<StButton>Click me</StButton>
|
|
40
|
+
<StInput v-model="value" placeholder="Type something" />
|
|
41
|
+
</template>
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## UnoCSS 集成
|
|
45
|
+
|
|
46
|
+
Straw UI 基于 UnoCSS 构建:
|
|
47
|
+
|
|
48
|
+
```ts
|
|
49
|
+
// uno.config.ts
|
|
50
|
+
import { defineConfig, presetWind4, presetIcons } from 'unocss';
|
|
51
|
+
import { presetStrawUI } from 'straw-ui-vue/unocss';
|
|
52
|
+
|
|
53
|
+
export default defineConfig({
|
|
54
|
+
presets: [
|
|
55
|
+
presetWind4(),
|
|
56
|
+
presetIcons(),
|
|
57
|
+
presetStrawUI(), // Straw UI 预设
|
|
58
|
+
],
|
|
59
|
+
});
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
```ts
|
|
63
|
+
// main.ts
|
|
64
|
+
import 'straw-ui-vue/dist/variables.css'; // 主题预设变量,或使用自己的变量文件
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
详细配置请参阅 [UnoCSS 集成文档](./docs/unocss.md)。
|
|
68
|
+
|
|
69
|
+
## TypeScript 支持
|
|
70
|
+
|
|
71
|
+
Straw UI 提供完整的 TypeScript 类型支持。
|
|
72
|
+
|
|
73
|
+
## 组件列表
|
|
74
|
+
|
|
75
|
+
| 组件 | 说明 |
|
|
76
|
+
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
77
|
+
| `StButton` | 按钮组件 |
|
|
78
|
+
| `StCard` | 卡片组件(含 StCardGroup、StCardGroupHeader、StCardGroupTitle、StCardGroupContent、StCardGroupFooter、StCardGroupAction、StCardGroupDescription 子组件) |
|
|
79
|
+
| `StCascade` / `StCascadePanel` | 级联选择组件 |
|
|
80
|
+
| `StCheckbox` / `StCheckboxGroup` | 复选框 / 复选框组组件 |
|
|
81
|
+
| `StColorPicker` / `StColorPickerPanel` | 颜色选择器组件 |
|
|
82
|
+
| `StDatePicker` / `StDatePickerPanel` | 日期选择器组件 |
|
|
83
|
+
| `StDateTimePicker` / `StDateTimePickerPanel` | 日期时间选择器组件 |
|
|
84
|
+
| `StDialog` | 对话框组件(含 StDialogGroup、StDialogGroupHeader、StDialogGroupTitle、StDialogGroupBody、StDialogGroupContent、StDialogGroupFooter、StDialogGroupAction、StDialogGroupOverlay、StDialogGroupDraggable 子组件) |
|
|
85
|
+
| `StDivider` | 分割线组件 |
|
|
86
|
+
| `StDrawer` | 抽屉组件(含 StDrawerGroup、StDrawerGroupHeader、StDrawerGroupTitle、StDrawerGroupBody、StDrawerGroupContent、StDrawerGroupFooter、StDrawerGroupAction、StDrawerGroupOverlay 子组件) |
|
|
87
|
+
| `StEmpty` | 空状态组件 |
|
|
88
|
+
| `StFormControl` / `StFormDescription` / `StFormField` / `StFormItem` / `StFormLabel` / `StFormMessage` | 表单字段系列组件 |
|
|
89
|
+
| `StImage` | 图片组件 |
|
|
90
|
+
| `StInput` / `StInputGroup` / `StInputGroupAddon` / `StInputGroupButton` / `StInputGroupInput` / `StInputGroupText` / `StInputGroupTextarea` / `StInputNumber` / `StTextarea` | 输入框系列组件 |
|
|
91
|
+
| `StLabel` | 标签组件 |
|
|
92
|
+
| `StMenu`(含 StMenuContainer、StMenuContent、StMenuDivider、StMenuGroup、StMenuItem、StMenuNode、StMenuTrigger) | 菜单组件 |
|
|
93
|
+
| `StPagination` | 分页组件 |
|
|
94
|
+
| `StPopover`(含 StPopoverArrow、StPopoverContainer、StPopoverContent、StPopoverTrigger) | 弹出卡片组件 |
|
|
95
|
+
| `StProgress` | 进度条组件 |
|
|
96
|
+
| `StRadio` / `StRadioGroup` | 单选框 / 单选框组组件 |
|
|
97
|
+
| `StScrollbar` | 滚动条组件 |
|
|
98
|
+
| `StSegmented` | 分段控制器组件 |
|
|
99
|
+
| `StSelect`(含 StSelectContainer、StSelectContent、StSelectEmpty、StSelectGroup、StSelectItem、StSelectTrigger) | 下拉选择器组件 |
|
|
100
|
+
| `StSidebar` / `StSidebarItem` | 侧边栏 / 侧边栏项组件 |
|
|
101
|
+
| `StSkeleton` / `StSkeletonItem` | 骨架屏组件 |
|
|
102
|
+
| `StSlider` | 滑块组件 |
|
|
103
|
+
| `StSplitter` / `StSplitterPanel` | 分割面板组件 |
|
|
104
|
+
| `StSwitch` | 开关组件 |
|
|
105
|
+
| `StTabs` / `StTabsPane` | 标签页组件 |
|
|
106
|
+
| `StTag` | 标签组件 |
|
|
107
|
+
| `StTimePicker` / `StTimePickerPanel` | 时间选择器组件 |
|
|
108
|
+
| `StToggle` | 切换按钮组件 |
|
|
109
|
+
| `StTooltip`(含 StTooltipContainer、StTooltipContent、StTooltipTrigger) | 工具提示组件 |
|
|
110
|
+
| `StTree` / `StTreeNode` | 树形组件 |
|
|
111
|
+
|
|
112
|
+
## 自定义指令
|
|
113
|
+
|
|
114
|
+
| 指令 | 说明 |
|
|
115
|
+
| ---------------- | ---------------- |
|
|
116
|
+
| `v-intersection` | 元素可视区域监听 |
|
|
117
|
+
| `v-resize` | 元素尺寸变化监听 |
|
|
118
|
+
|
|
119
|
+
## 主题定制
|
|
120
|
+
|
|
121
|
+
Straw UI 使用 CSS 变量定义主题,你可以通过覆盖变量来自定义主题:
|
|
122
|
+
|
|
123
|
+
```css
|
|
124
|
+
:root {
|
|
125
|
+
--primary: #3b82f6;
|
|
126
|
+
--primary-foreground: #ffffff;
|
|
127
|
+
--radius: 0.5rem;
|
|
128
|
+
/* 更多变量... */
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
[data-theme='dark'] {
|
|
132
|
+
--primary: #3b82f6;
|
|
133
|
+
/* 暗色主题变量... */
|
|
134
|
+
}
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
完整变量列表请参阅 [UnoCSS 集成文档](./docs/unocss.md#主题变量)。
|
|
138
|
+
|
|
139
|
+
## 文档
|
|
140
|
+
|
|
141
|
+
- [UnoCSS 集成](./docs/unocss.md)
|
|
142
|
+
- [TypeScript 配置](./docs/typescript.md)
|
|
143
|
+
|
|
144
|
+
## License
|
|
145
|
+
|
|
146
|
+
MIT
|
|
@@ -1733,11 +1733,11 @@ var n = (e, t) => {
|
|
|
1733
1733
|
}, Fe = (e, t, n) => {
|
|
1734
1734
|
let r = t[n];
|
|
1735
1735
|
r !== void 0 && (e[n] = e[n] ? e[n].concat(r) : r);
|
|
1736
|
-
}, Ie = (e, ...t) => typeof e == "function" ? O(je, e, ...t) : O(() => Me(je(), e), ...t), Le = (e) => /^\d+(\.\d+)?$/.test(e), $ = (e) => /^(default|xxs|xs|sm|lg|xl|xxl)$/.test(e),
|
|
1736
|
+
}, Ie = (e, ...t) => typeof e == "function" ? O(je, e, ...t) : O(() => Me(je(), e), ...t), Le = (e) => /^\d+(\.\d+)?$/.test(e), Re = (e) => /^\d+(\.\d+)?(px|rem|em|vh|vw|dvh|svh|lvh|dvw|svw|lvw|%|cm|mm|pt|pc|ex|ch|vmin|vmax)$/.test(e), $ = (e) => /^(default|xxs|xs|sm|lg|xl|xxl)$/.test(e), ze = Ie({ extend: { classGroups: {
|
|
1737
1737
|
"font-size": [{ text: [Le] }],
|
|
1738
|
-
h: [{ h: [
|
|
1739
|
-
w: [{ w: [
|
|
1740
|
-
size: [{ size: [
|
|
1738
|
+
h: [{ h: [$, Re] }],
|
|
1739
|
+
w: [{ w: [$, Re] }],
|
|
1740
|
+
size: [{ size: [$, Re] }],
|
|
1741
1741
|
m: [{ m: [$] }],
|
|
1742
1742
|
mx: [{ mx: [$] }],
|
|
1743
1743
|
my: [{ my: [$] }],
|
|
@@ -1756,8 +1756,8 @@ var n = (e, t) => {
|
|
|
1756
1756
|
"gap-x": [{ "gap-x": [$] }],
|
|
1757
1757
|
"gap-y": [{ "gap-y": [$] }]
|
|
1758
1758
|
} } });
|
|
1759
|
-
function
|
|
1760
|
-
return
|
|
1759
|
+
function Be(...e) {
|
|
1760
|
+
return ze(t(e));
|
|
1761
1761
|
}
|
|
1762
1762
|
//#endregion
|
|
1763
|
-
export {
|
|
1763
|
+
export { Be as t };
|
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
import type { ClassValue, StyleValue } from 'vue';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* 按钮变体类型
|
|
5
|
-
* */
|
|
6
|
-
export type StButtonVariant = 'primary' | 'default' | 'ghost';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* 按钮类型
|
|
10
|
-
* */
|
|
11
|
-
export type StButtonType = 'default' | 'icon';
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* 按钮组件属性
|
|
15
|
-
* */
|
|
16
|
-
export interface StButtonProps {
|
|
17
|
-
/** 按钮变体类型 */
|
|
18
|
-
variant?: StButtonVariant;
|
|
19
|
-
/** 按钮类型 */
|
|
20
|
-
type?: StButtonType;
|
|
21
|
-
/** 是否禁用 */
|
|
22
|
-
disabled?: boolean;
|
|
23
|
-
/** 是否显示加载状态 */
|
|
24
|
-
loading?: boolean;
|
|
25
|
-
/** 前缀图标名称 */
|
|
26
|
-
prefixIcon?: string;
|
|
27
|
-
/** 后缀图标名称 */
|
|
28
|
-
suffixIcon?: string;
|
|
29
|
-
/** 前缀图标类名 */
|
|
30
|
-
prefixIconClass?: ClassValue;
|
|
31
|
-
/** 前缀图标样式 */
|
|
32
|
-
prefixIconStyle?: StyleValue;
|
|
33
|
-
/** 后缀图标类名 */
|
|
34
|
-
suffixIconClass?: ClassValue;
|
|
35
|
-
/** 后缀图标样式 */
|
|
36
|
-
suffixIconStyle?: StyleValue;
|
|
37
|
-
/** loading图标类名 */
|
|
38
|
-
loadingIconClass?: ClassValue;
|
|
39
|
-
/** loading图标样式 */
|
|
40
|
-
loadingIconStyle?: StyleValue;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* 按钮组件插槽类型
|
|
45
|
-
* */
|
|
46
|
-
export interface StButtonSlots {
|
|
47
|
-
/** 默认插槽 */
|
|
48
|
-
default?: () => unknown;
|
|
49
|
-
/** 前缀图标插槽 */
|
|
50
|
-
prefixIcon?: () => unknown;
|
|
51
|
-
/** 后缀图标插槽 */
|
|
52
|
-
suffixIcon?: () => unknown;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* 按钮组件事件类型
|
|
57
|
-
* */
|
|
58
|
-
export interface StButtonEmits {
|
|
59
|
-
/** 点击事件 */
|
|
60
|
-
click: [event: MouseEvent];
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export {};
|
|
1
|
+
import type { ClassValue, StyleValue } from 'vue';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 按钮变体类型
|
|
5
|
+
* */
|
|
6
|
+
export type StButtonVariant = 'primary' | 'default' | 'ghost';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* 按钮类型
|
|
10
|
+
* */
|
|
11
|
+
export type StButtonType = 'default' | 'icon';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* 按钮组件属性
|
|
15
|
+
* */
|
|
16
|
+
export interface StButtonProps {
|
|
17
|
+
/** 按钮变体类型 */
|
|
18
|
+
variant?: StButtonVariant;
|
|
19
|
+
/** 按钮类型 */
|
|
20
|
+
type?: StButtonType;
|
|
21
|
+
/** 是否禁用 */
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
/** 是否显示加载状态 */
|
|
24
|
+
loading?: boolean;
|
|
25
|
+
/** 前缀图标名称 */
|
|
26
|
+
prefixIcon?: string;
|
|
27
|
+
/** 后缀图标名称 */
|
|
28
|
+
suffixIcon?: string;
|
|
29
|
+
/** 前缀图标类名 */
|
|
30
|
+
prefixIconClass?: ClassValue;
|
|
31
|
+
/** 前缀图标样式 */
|
|
32
|
+
prefixIconStyle?: StyleValue;
|
|
33
|
+
/** 后缀图标类名 */
|
|
34
|
+
suffixIconClass?: ClassValue;
|
|
35
|
+
/** 后缀图标样式 */
|
|
36
|
+
suffixIconStyle?: StyleValue;
|
|
37
|
+
/** loading图标类名 */
|
|
38
|
+
loadingIconClass?: ClassValue;
|
|
39
|
+
/** loading图标样式 */
|
|
40
|
+
loadingIconStyle?: StyleValue;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* 按钮组件插槽类型
|
|
45
|
+
* */
|
|
46
|
+
export interface StButtonSlots {
|
|
47
|
+
/** 默认插槽 */
|
|
48
|
+
default?: () => unknown;
|
|
49
|
+
/** 前缀图标插槽 */
|
|
50
|
+
prefixIcon?: () => unknown;
|
|
51
|
+
/** 后缀图标插槽 */
|
|
52
|
+
suffixIcon?: () => unknown;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* 按钮组件事件类型
|
|
57
|
+
* */
|
|
58
|
+
export interface StButtonEmits {
|
|
59
|
+
/** 点击事件 */
|
|
60
|
+
click: [event: MouseEvent];
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export {};
|