@sxo/ui 0.0.0
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 +35 -0
- package/dist/components/Accordion.d.ts +11 -0
- package/dist/components/Alert.d.ts +12 -0
- package/dist/components/Avatar.d.ts +9 -0
- package/dist/components/BackTop.d.ts +4 -0
- package/dist/components/Badge.d.ts +5 -0
- package/dist/components/Breadcrumb.d.ts +10 -0
- package/dist/components/Button.d.ts +7 -0
- package/dist/components/Calendar.d.ts +19 -0
- package/dist/components/Card.d.ts +7 -0
- package/dist/components/Cascader.d.ts +16 -0
- package/dist/components/Checkbox.d.ts +8 -0
- package/dist/components/DatePicker.d.ts +21 -0
- package/dist/components/Descriptions.d.ts +10 -0
- package/dist/components/Dialog.d.ts +17 -0
- package/dist/components/Divider.d.ts +18 -0
- package/dist/components/Drawer.d.ts +13 -0
- package/dist/components/Dropdown.d.ts +12 -0
- package/dist/components/Empty.d.ts +9 -0
- package/dist/components/Feedback.d.ts +16 -0
- package/dist/components/Form.d.ts +19 -0
- package/dist/components/Input.d.ts +6 -0
- package/dist/components/Mentions.d.ts +12 -0
- package/dist/components/Menu.d.ts +11 -0
- package/dist/components/Pagination.d.ts +14 -0
- package/dist/components/Popconfirm.d.ts +10 -0
- package/dist/components/Popover.d.ts +10 -0
- package/dist/components/Radio.d.ts +8 -0
- package/dist/components/Rate.d.ts +11 -0
- package/dist/components/Result.d.ts +10 -0
- package/dist/components/Search.d.ts +11 -0
- package/dist/components/Select.d.ts +8 -0
- package/dist/components/Skeleton.d.ts +16 -0
- package/dist/components/Slider.d.ts +11 -0
- package/dist/components/Statistic.d.ts +8 -0
- package/dist/components/Steps.d.ts +22 -0
- package/dist/components/Switch.d.ts +8 -0
- package/dist/components/Table.d.ts +19 -0
- package/dist/components/Tabs.d.ts +9 -0
- package/dist/components/Tag.d.ts +11 -0
- package/dist/components/Timeline.d.ts +13 -0
- package/dist/components/Toast.d.ts +13 -0
- package/dist/components/Tooltip.d.ts +7 -0
- package/dist/components/Transfer.d.ts +20 -0
- package/dist/components/Tree.d.ts +11 -0
- package/dist/components/TreeSelect.d.ts +13 -0
- package/dist/components/Upload.d.ts +16 -0
- package/dist/components/VirtualList.d.ts +8 -0
- package/dist/components/index.d.ts +47 -0
- package/dist/demo.d.ts +5 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +952 -0
- package/dist/test-demo.d.ts +1 -0
- package/dist/theme.d.ts +5 -0
- package/package.json +54 -0
package/README.md
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# @sxo/ui
|
|
2
|
+
|
|
3
|
+
SXO 设计系统的 UI 组件定义层。
|
|
4
|
+
|
|
5
|
+
## 安装
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm add @sxo/ui @sxo/engine @sxo/design
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## 核心功能
|
|
12
|
+
|
|
13
|
+
### 样式生成器 (Class Generators)
|
|
14
|
+
提供跨框架通用的样式生成函数。
|
|
15
|
+
|
|
16
|
+
```typescript
|
|
17
|
+
import { getButtonClasses } from '@sxo/ui';
|
|
18
|
+
|
|
19
|
+
// 生成按钮所需的原子类
|
|
20
|
+
const classes = getButtonClasses({
|
|
21
|
+
variant: 'primary',
|
|
22
|
+
size: 'md'
|
|
23
|
+
});
|
|
24
|
+
// 返回: "inline-flex items-center justify-center bg-primary-DEFAULT ..."
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### 类型定义
|
|
28
|
+
定义所有组件的 Props 和接口规范。
|
|
29
|
+
|
|
30
|
+
```typescript
|
|
31
|
+
import type { ButtonProps } from '@sxo/ui';
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## 为什么需要 @sxo/ui?
|
|
35
|
+
`@sxo/ui` 是逻辑适配器(如 `vue-sxo`)和核心逻辑(如 `@sxo/design`)之间的桥梁。它确保了不同框架下的组件在样式表现和属性接口上的一致性。
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface AccordionOptions {
|
|
2
|
+
variant?: 'ghost' | 'bordered' | 'splitted';
|
|
3
|
+
}
|
|
4
|
+
export declare function getAccordionClasses(options?: AccordionOptions): {
|
|
5
|
+
root: string;
|
|
6
|
+
item: (isExpanded: boolean) => string;
|
|
7
|
+
trigger: string;
|
|
8
|
+
triggerText: string;
|
|
9
|
+
icon: (isExpanded: boolean) => string;
|
|
10
|
+
panel: string;
|
|
11
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface AlertOptions {
|
|
2
|
+
type?: 'info' | 'success' | 'warning' | 'error';
|
|
3
|
+
variant?: 'subtle' | 'solid' | 'outline';
|
|
4
|
+
}
|
|
5
|
+
export declare function getAlertClasses(options?: AlertOptions): {
|
|
6
|
+
container: string;
|
|
7
|
+
icon: string;
|
|
8
|
+
content: string;
|
|
9
|
+
title: string;
|
|
10
|
+
description: string;
|
|
11
|
+
closeButton: string;
|
|
12
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface ButtonOptions {
|
|
2
|
+
variant?: 'primary' | 'secondary' | 'accent' | 'outline' | 'ghost';
|
|
3
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
rounded?: 'none' | 'sm' | 'md' | 'lg' | 'full';
|
|
6
|
+
}
|
|
7
|
+
export declare function getButtonClasses(options?: ButtonOptions): string;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare function getCalendarClasses(): {
|
|
2
|
+
container: string;
|
|
3
|
+
header: string;
|
|
4
|
+
headerTitle: string;
|
|
5
|
+
headerActions: string;
|
|
6
|
+
headerBtn: string;
|
|
7
|
+
body: string;
|
|
8
|
+
weekRow: string;
|
|
9
|
+
weekDay: string;
|
|
10
|
+
grid: string;
|
|
11
|
+
day: string;
|
|
12
|
+
dayCurrent: string;
|
|
13
|
+
dayToday: string;
|
|
14
|
+
daySelected: string;
|
|
15
|
+
dayOutside: string;
|
|
16
|
+
dayText: string;
|
|
17
|
+
dayDot: string;
|
|
18
|
+
dayDotToday: string;
|
|
19
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface CardOptions {
|
|
2
|
+
variant?: 'outline' | 'elevated' | 'accent' | 'ghost';
|
|
3
|
+
padding?: 'none' | 'sm' | 'md' | 'lg' | 'xl';
|
|
4
|
+
rounded?: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | 'full';
|
|
5
|
+
interactive?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare function getCardClasses(options?: CardOptions): string;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface CascaderOptions {
|
|
2
|
+
size?: 'sm' | 'md' | 'lg';
|
|
3
|
+
rounded?: boolean;
|
|
4
|
+
}
|
|
5
|
+
export declare function getCascaderClasses(options?: CascaderOptions): {
|
|
6
|
+
container: string;
|
|
7
|
+
input: string;
|
|
8
|
+
icon: string;
|
|
9
|
+
iconOpen: string;
|
|
10
|
+
dropdown: string;
|
|
11
|
+
menu: string;
|
|
12
|
+
menuItem: string;
|
|
13
|
+
menuItemActive: string;
|
|
14
|
+
menuItemDisabled: string;
|
|
15
|
+
expandIcon: string;
|
|
16
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface DatePickerOptions {
|
|
2
|
+
size?: 'sm' | 'md' | 'lg';
|
|
3
|
+
variant?: 'outline' | 'ghost' | 'bottom-line';
|
|
4
|
+
rounded?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare function getDatePickerClasses(options?: DatePickerOptions): {
|
|
7
|
+
container: string;
|
|
8
|
+
input: string;
|
|
9
|
+
icon: string;
|
|
10
|
+
panel: string;
|
|
11
|
+
header: string;
|
|
12
|
+
headerButton: string;
|
|
13
|
+
headerTitle: string;
|
|
14
|
+
grid: string;
|
|
15
|
+
weekday: string;
|
|
16
|
+
day: string;
|
|
17
|
+
dayToday: string;
|
|
18
|
+
daySelected: string;
|
|
19
|
+
dayOutside: string;
|
|
20
|
+
footer: string;
|
|
21
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface DialogStylesOptions {
|
|
2
|
+
size?: 'sm' | 'md' | 'lg' | 'xl' | 'full';
|
|
3
|
+
isCentered?: boolean;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* 获取对话框各部分的样式类名
|
|
7
|
+
*/
|
|
8
|
+
export declare function getDialogClasses(options?: DialogStylesOptions): {
|
|
9
|
+
overlay: string;
|
|
10
|
+
container: string;
|
|
11
|
+
content: string;
|
|
12
|
+
header: string;
|
|
13
|
+
title: string;
|
|
14
|
+
description: string;
|
|
15
|
+
closeButton: string;
|
|
16
|
+
footer: string;
|
|
17
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface DividerOptions {
|
|
2
|
+
direction?: 'horizontal' | 'vertical';
|
|
3
|
+
type?: 'solid' | 'dashed' | 'dotted';
|
|
4
|
+
contentPlacement?: 'left' | 'center' | 'right';
|
|
5
|
+
}
|
|
6
|
+
export declare function getDividerClasses(options?: DividerOptions): {
|
|
7
|
+
container: string;
|
|
8
|
+
text: string;
|
|
9
|
+
lineLeft?: undefined;
|
|
10
|
+
lineRight?: undefined;
|
|
11
|
+
line?: undefined;
|
|
12
|
+
} | {
|
|
13
|
+
container: string;
|
|
14
|
+
lineLeft: string;
|
|
15
|
+
lineRight: string;
|
|
16
|
+
line: string;
|
|
17
|
+
text: string;
|
|
18
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface DrawerOptions {
|
|
2
|
+
placement?: 'left' | 'right' | 'top' | 'bottom';
|
|
3
|
+
size?: 'sm' | 'md' | 'lg' | 'xl' | 'full';
|
|
4
|
+
}
|
|
5
|
+
export declare function getDrawerClasses(options?: DrawerOptions): {
|
|
6
|
+
overlay: string;
|
|
7
|
+
container: string;
|
|
8
|
+
header: string;
|
|
9
|
+
title: string;
|
|
10
|
+
content: string;
|
|
11
|
+
footer: string;
|
|
12
|
+
closeButton: string;
|
|
13
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface DropdownOptions {
|
|
2
|
+
placement?: 'bottom-left' | 'bottom-right' | 'top-left' | 'top-right';
|
|
3
|
+
}
|
|
4
|
+
export declare function getDropdownClasses(options?: DropdownOptions): {
|
|
5
|
+
container: string;
|
|
6
|
+
menu: string;
|
|
7
|
+
item: string;
|
|
8
|
+
itemActive: string;
|
|
9
|
+
itemDisabled: string;
|
|
10
|
+
divider: string;
|
|
11
|
+
header: string;
|
|
12
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface SpinnerOptions {
|
|
2
|
+
size?: 'sm' | 'md' | 'lg';
|
|
3
|
+
color?: 'primary' | 'secondary' | 'accent';
|
|
4
|
+
}
|
|
5
|
+
export declare function getSpinnerClasses(options?: SpinnerOptions): string;
|
|
6
|
+
export interface ProgressOptions {
|
|
7
|
+
value: number;
|
|
8
|
+
max?: number;
|
|
9
|
+
color?: 'primary' | 'success' | 'warning' | 'error';
|
|
10
|
+
size?: 'sm' | 'md' | 'lg';
|
|
11
|
+
}
|
|
12
|
+
export declare function getProgressClasses(options: ProgressOptions): {
|
|
13
|
+
root: string;
|
|
14
|
+
bar: string;
|
|
15
|
+
percentage: number;
|
|
16
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface FormOptions {
|
|
2
|
+
layout?: 'vertical' | 'horizontal' | 'inline';
|
|
3
|
+
size?: 'sm' | 'md' | 'lg';
|
|
4
|
+
}
|
|
5
|
+
export declare function getFormClasses(options?: FormOptions): {
|
|
6
|
+
root: string;
|
|
7
|
+
};
|
|
8
|
+
export interface FormItemOptions {
|
|
9
|
+
layout?: 'vertical' | 'horizontal';
|
|
10
|
+
required?: boolean;
|
|
11
|
+
hasError?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare function getFormItemClasses(options?: FormItemOptions): {
|
|
14
|
+
root: string;
|
|
15
|
+
label: string;
|
|
16
|
+
control: string;
|
|
17
|
+
error: string;
|
|
18
|
+
extra: string;
|
|
19
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface MentionsOptions {
|
|
2
|
+
size?: 'sm' | 'md' | 'lg';
|
|
3
|
+
status?: 'error' | 'warning' | 'success';
|
|
4
|
+
}
|
|
5
|
+
export declare function getMentionsClasses(options?: MentionsOptions): {
|
|
6
|
+
container: string;
|
|
7
|
+
textarea: string;
|
|
8
|
+
dropdown: string;
|
|
9
|
+
item: string;
|
|
10
|
+
itemActive: string;
|
|
11
|
+
avatar: string;
|
|
12
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface PaginationOptions {
|
|
2
|
+
size?: 'sm' | 'md' | 'lg';
|
|
3
|
+
variant?: 'outline' | 'ghost' | 'solid';
|
|
4
|
+
rounded?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare function getPaginationClasses(options?: PaginationOptions): {
|
|
7
|
+
container: string;
|
|
8
|
+
item: string;
|
|
9
|
+
active: string;
|
|
10
|
+
disabled: string;
|
|
11
|
+
jumper: string;
|
|
12
|
+
total: string;
|
|
13
|
+
ellipsis: string;
|
|
14
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface PopoverOptions {
|
|
2
|
+
placement?: 'top' | 'bottom' | 'left' | 'right';
|
|
3
|
+
}
|
|
4
|
+
export declare function getPopoverClasses(options?: PopoverOptions): {
|
|
5
|
+
container: string;
|
|
6
|
+
content: string;
|
|
7
|
+
arrow: string;
|
|
8
|
+
title: string;
|
|
9
|
+
description: string;
|
|
10
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface ResultOptions {
|
|
2
|
+
status?: 'success' | 'error' | 'info' | 'warning' | '404' | '500' | '403';
|
|
3
|
+
}
|
|
4
|
+
export declare function getResultClasses(options?: ResultOptions): {
|
|
5
|
+
container: string;
|
|
6
|
+
icon: string;
|
|
7
|
+
title: string;
|
|
8
|
+
subTitle: string;
|
|
9
|
+
extra: string;
|
|
10
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface SearchOptions {
|
|
2
|
+
variant?: 'outline' | 'ghost' | 'bottom-line';
|
|
3
|
+
size?: 'sm' | 'md' | 'lg';
|
|
4
|
+
rounded?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare function getSearchClasses(options?: SearchOptions): {
|
|
7
|
+
container: string;
|
|
8
|
+
input: string;
|
|
9
|
+
icon: string;
|
|
10
|
+
clearButton: string;
|
|
11
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface SkeletonOptions {
|
|
2
|
+
active?: boolean;
|
|
3
|
+
rounded?: boolean;
|
|
4
|
+
}
|
|
5
|
+
export declare function getSkeletonClasses(options?: SkeletonOptions): {
|
|
6
|
+
root: string;
|
|
7
|
+
header: string;
|
|
8
|
+
avatar: string;
|
|
9
|
+
title: string;
|
|
10
|
+
paragraph: string;
|
|
11
|
+
line: string;
|
|
12
|
+
lineLast: string;
|
|
13
|
+
rect: string;
|
|
14
|
+
circle: string;
|
|
15
|
+
button: string;
|
|
16
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface StepsOptions {
|
|
2
|
+
direction?: 'horizontal' | 'vertical';
|
|
3
|
+
}
|
|
4
|
+
export declare function getStepsClasses(options?: StepsOptions): {
|
|
5
|
+
container: string;
|
|
6
|
+
item: string;
|
|
7
|
+
head: string;
|
|
8
|
+
line: string;
|
|
9
|
+
linePending: string;
|
|
10
|
+
lineCompleted: string;
|
|
11
|
+
icon: string;
|
|
12
|
+
iconContainer: string;
|
|
13
|
+
iconPending: string;
|
|
14
|
+
iconProcess: string;
|
|
15
|
+
iconCompleted: string;
|
|
16
|
+
content: string;
|
|
17
|
+
title: string;
|
|
18
|
+
titlePending: string;
|
|
19
|
+
titleProcess: string;
|
|
20
|
+
titleCompleted: string;
|
|
21
|
+
description: string;
|
|
22
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface TableOptions {
|
|
2
|
+
size?: 'sm' | 'md' | 'lg';
|
|
3
|
+
hover?: boolean;
|
|
4
|
+
striped?: boolean;
|
|
5
|
+
border?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare function getTableClasses(options?: TableOptions): {
|
|
8
|
+
container: string;
|
|
9
|
+
table: string;
|
|
10
|
+
thead: string;
|
|
11
|
+
th: string;
|
|
12
|
+
tr: string;
|
|
13
|
+
trSelected: string;
|
|
14
|
+
trStriped: string;
|
|
15
|
+
td: string;
|
|
16
|
+
pagination: string;
|
|
17
|
+
empty: string;
|
|
18
|
+
loading: string;
|
|
19
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface TagOptions {
|
|
2
|
+
variant?: 'solid' | 'outline' | 'subtle';
|
|
3
|
+
color?: 'primary' | 'secondary' | 'success' | 'warning' | 'error' | 'neutral';
|
|
4
|
+
rounded?: 'none' | 'sm' | 'md' | 'full';
|
|
5
|
+
size?: 'sm' | 'md' | 'lg';
|
|
6
|
+
closable?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare function getTagClasses(options?: TagOptions): {
|
|
9
|
+
base: string;
|
|
10
|
+
closeIcon: string;
|
|
11
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface TimelineOptions {
|
|
2
|
+
mode?: 'left' | 'alternate' | 'right';
|
|
3
|
+
}
|
|
4
|
+
export declare function getTimelineClasses(options?: TimelineOptions): {
|
|
5
|
+
container: string;
|
|
6
|
+
item: string;
|
|
7
|
+
tail: string;
|
|
8
|
+
dot: string;
|
|
9
|
+
content: string;
|
|
10
|
+
label: string;
|
|
11
|
+
title: string;
|
|
12
|
+
description: string;
|
|
13
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface ToastStylesOptions {
|
|
2
|
+
type?: 'info' | 'success' | 'warning' | 'error';
|
|
3
|
+
position?: 'top' | 'bottom' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
|
4
|
+
}
|
|
5
|
+
export declare function getToastClasses(options?: ToastStylesOptions): {
|
|
6
|
+
container: string;
|
|
7
|
+
item: string;
|
|
8
|
+
icon: string;
|
|
9
|
+
content: string;
|
|
10
|
+
title: string;
|
|
11
|
+
description: string;
|
|
12
|
+
close: string;
|
|
13
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface TransferOptions {
|
|
2
|
+
size?: 'sm' | 'md' | 'lg';
|
|
3
|
+
}
|
|
4
|
+
export declare function getTransferClasses(options?: TransferOptions): {
|
|
5
|
+
container: string;
|
|
6
|
+
list: string;
|
|
7
|
+
header: string;
|
|
8
|
+
headerTitle: string;
|
|
9
|
+
headerCount: string;
|
|
10
|
+
search: string;
|
|
11
|
+
body: string;
|
|
12
|
+
item: string;
|
|
13
|
+
itemSelected: string;
|
|
14
|
+
itemDisabled: string;
|
|
15
|
+
itemLabel: string;
|
|
16
|
+
actions: string;
|
|
17
|
+
actionButton: string;
|
|
18
|
+
footer: string;
|
|
19
|
+
empty: string;
|
|
20
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface TreeSelectOptions {
|
|
2
|
+
size?: 'sm' | 'md' | 'lg';
|
|
3
|
+
rounded?: boolean;
|
|
4
|
+
}
|
|
5
|
+
export declare function getTreeSelectClasses(options?: TreeSelectOptions): {
|
|
6
|
+
container: string;
|
|
7
|
+
input: string;
|
|
8
|
+
icon: string;
|
|
9
|
+
iconOpen: string;
|
|
10
|
+
dropdown: string;
|
|
11
|
+
treeContainer: string;
|
|
12
|
+
empty: string;
|
|
13
|
+
};
|