@sia.soul/sia-react-ui 0.1.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 +37 -0
- package/THIRD_PARTY_NOTICES.md +12 -0
- package/dist/Select-CJJ5LQap.d.cts +44 -0
- package/dist/Select-CJJ5LQap.d.ts +44 -0
- package/dist/chart.cjs +7523 -0
- package/dist/chart.css +1036 -0
- package/dist/chart.d.cts +2061 -0
- package/dist/chart.d.ts +2061 -0
- package/dist/chart.js +120 -0
- package/dist/chunk-34TTF4Y7.js +812 -0
- package/dist/chunk-6VXOLMKZ.js +381 -0
- package/dist/chunk-DZ45HRVP.js +583 -0
- package/dist/chunk-I342FGQY.js +7344 -0
- package/dist/chunk-JKZGAZMB.js +318 -0
- package/dist/chunk-MBS2HXLZ.js +59 -0
- package/dist/chunk-NZAT2RUM.js +60 -0
- package/dist/chunk-OMA75YLM.js +298 -0
- package/dist/chunk-ULEGTKXR.js +2138 -0
- package/dist/chunk-YCVXUMGP.js +945 -0
- package/dist/core-BeiAQiDY.d.ts +1076 -0
- package/dist/core-DRICIs2n.d.cts +1076 -0
- package/dist/core.cjs +3353 -0
- package/dist/core.css +8734 -0
- package/dist/core.d.cts +3 -0
- package/dist/core.d.ts +3 -0
- package/dist/core.js +45 -0
- package/dist/index.cjs +19658 -0
- package/dist/index.css +9762 -0
- package/dist/index.d.cts +1222 -0
- package/dist/index.d.ts +1222 -0
- package/dist/index.js +6843 -0
- package/dist/markdown-editor.cjs +417 -0
- package/dist/markdown-editor.d.cts +28 -0
- package/dist/markdown-editor.d.ts +28 -0
- package/dist/markdown-editor.js +6 -0
- package/dist/rich-text-editor.cjs +1853 -0
- package/dist/rich-text-editor.d.cts +27 -0
- package/dist/rich-text-editor.d.ts +27 -0
- package/dist/rich-text-editor.js +11 -0
- package/dist/select-date-range-BDWdo7qt.d.ts +84 -0
- package/dist/select-date-range-DWik3ADr.d.cts +84 -0
- package/dist/select-date-range.cjs +2074 -0
- package/dist/select-date-range.d.cts +3 -0
- package/dist/select-date-range.d.ts +3 -0
- package/dist/select-date-range.js +8 -0
- package/package.json +129 -0
package/README.md
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Sia React UI
|
|
2
|
+
|
|
3
|
+
SiaWebUI 的 React 组件库,包含基础控件、布局、表格、编辑器和图表。
|
|
4
|
+
|
|
5
|
+
## 安装
|
|
6
|
+
|
|
7
|
+
在已有 React 项目中执行:
|
|
8
|
+
|
|
9
|
+
```powershell
|
|
10
|
+
pnpm add '@sia.soul/sia-react-ui'
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
项目需要提供 React 和 React DOM。包声明的 peerDependencies 为 React >=18;具体兼容性以项目实际验证为准。
|
|
14
|
+
|
|
15
|
+
## 使用
|
|
16
|
+
|
|
17
|
+
在应用入口引入一次样式:
|
|
18
|
+
|
|
19
|
+
```tsx
|
|
20
|
+
import '@sia.soul/sia-react-ui/styles.css';
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
在组件中使用:
|
|
24
|
+
|
|
25
|
+
```tsx
|
|
26
|
+
import { Button } from '@sia.soul/sia-react-ui';
|
|
27
|
+
|
|
28
|
+
export default function App() {
|
|
29
|
+
return <Button>你好,SiaWebUI</Button>;
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
也提供 `/core`、`/select-date-range`、`/rich-text-editor`、`/markdown-editor` 和 `/chart` 子入口。子入口不会减少包管理器安装的依赖数量。
|
|
34
|
+
|
|
35
|
+
代码编辑器使用 Monaco 和 worker 导入;在接入其他构建工具时,需要验证 worker 配置。本包的组件需要浏览器环境,服务端渲染兼容性需单独验证。
|
|
36
|
+
|
|
37
|
+
第三方说明见 THIRD_PARTY_NOTICES.md。
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Third-party notices
|
|
2
|
+
|
|
3
|
+
## Ant Design Icons
|
|
4
|
+
|
|
5
|
+
Sia Web UI 的图标语义、分类和部分基础构图参考了 Ant Design Icons。Sia 图标路径已针对统一的圆角描边视觉重新绘制。
|
|
6
|
+
|
|
7
|
+
Ant Design Icons is licensed under the MIT License.
|
|
8
|
+
|
|
9
|
+
- Project: https://github.com/ant-design/ant-design-icons
|
|
10
|
+
- Copyright: Ant Design Team
|
|
11
|
+
- License: https://github.com/ant-design/ant-design-icons/blob/master/LICENSE
|
|
12
|
+
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ButtonHTMLAttributes, ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
type ControlSize = "small" | "medium" | "large";
|
|
5
|
+
type ControlStatus = "default" | "warning" | "error";
|
|
6
|
+
type InputPlaceholderMode = "default" | "floating";
|
|
7
|
+
|
|
8
|
+
type SelectValue = string | number;
|
|
9
|
+
type SelectMode = "single" | "multiple";
|
|
10
|
+
type SelectChangeValue = SelectValue | SelectValue[] | null;
|
|
11
|
+
type SelectOption = {
|
|
12
|
+
label: ReactNode;
|
|
13
|
+
value: SelectValue;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
};
|
|
16
|
+
interface SelectProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "defaultValue" | "onChange" | "value"> {
|
|
17
|
+
options: readonly SelectOption[];
|
|
18
|
+
mode?: SelectMode;
|
|
19
|
+
value?: SelectChangeValue;
|
|
20
|
+
defaultValue?: SelectChangeValue;
|
|
21
|
+
onChange?: (value: SelectChangeValue, option: SelectOption | SelectOption[] | null) => void;
|
|
22
|
+
placeholder?: ReactNode;
|
|
23
|
+
size?: ControlSize;
|
|
24
|
+
status?: ControlStatus;
|
|
25
|
+
allowClear?: boolean;
|
|
26
|
+
loading?: boolean;
|
|
27
|
+
showSearch?: boolean;
|
|
28
|
+
/** 允许将搜索框内容作为自定义选项提交。 */
|
|
29
|
+
allowInput?: boolean;
|
|
30
|
+
inputMaxLength?: number;
|
|
31
|
+
searchPlaceholder?: string;
|
|
32
|
+
onSearch?: (query: string) => void;
|
|
33
|
+
filterOption?: (query: string, option: SelectOption) => boolean;
|
|
34
|
+
showSelectAll?: boolean;
|
|
35
|
+
maxTagCount?: number;
|
|
36
|
+
virtual?: boolean;
|
|
37
|
+
virtualThreshold?: number;
|
|
38
|
+
listHeight?: number;
|
|
39
|
+
optionHeight?: number;
|
|
40
|
+
notFoundContent?: ReactNode;
|
|
41
|
+
}
|
|
42
|
+
declare const Select: react.ForwardRefExoticComponent<SelectProps & react.RefAttributes<HTMLButtonElement>>;
|
|
43
|
+
|
|
44
|
+
export { type ControlSize as C, type InputPlaceholderMode as I, Select as S, type ControlStatus as a, type SelectChangeValue as b, type SelectMode as c, type SelectOption as d, type SelectProps as e, type SelectValue as f };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ButtonHTMLAttributes, ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
type ControlSize = "small" | "medium" | "large";
|
|
5
|
+
type ControlStatus = "default" | "warning" | "error";
|
|
6
|
+
type InputPlaceholderMode = "default" | "floating";
|
|
7
|
+
|
|
8
|
+
type SelectValue = string | number;
|
|
9
|
+
type SelectMode = "single" | "multiple";
|
|
10
|
+
type SelectChangeValue = SelectValue | SelectValue[] | null;
|
|
11
|
+
type SelectOption = {
|
|
12
|
+
label: ReactNode;
|
|
13
|
+
value: SelectValue;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
};
|
|
16
|
+
interface SelectProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "defaultValue" | "onChange" | "value"> {
|
|
17
|
+
options: readonly SelectOption[];
|
|
18
|
+
mode?: SelectMode;
|
|
19
|
+
value?: SelectChangeValue;
|
|
20
|
+
defaultValue?: SelectChangeValue;
|
|
21
|
+
onChange?: (value: SelectChangeValue, option: SelectOption | SelectOption[] | null) => void;
|
|
22
|
+
placeholder?: ReactNode;
|
|
23
|
+
size?: ControlSize;
|
|
24
|
+
status?: ControlStatus;
|
|
25
|
+
allowClear?: boolean;
|
|
26
|
+
loading?: boolean;
|
|
27
|
+
showSearch?: boolean;
|
|
28
|
+
/** 允许将搜索框内容作为自定义选项提交。 */
|
|
29
|
+
allowInput?: boolean;
|
|
30
|
+
inputMaxLength?: number;
|
|
31
|
+
searchPlaceholder?: string;
|
|
32
|
+
onSearch?: (query: string) => void;
|
|
33
|
+
filterOption?: (query: string, option: SelectOption) => boolean;
|
|
34
|
+
showSelectAll?: boolean;
|
|
35
|
+
maxTagCount?: number;
|
|
36
|
+
virtual?: boolean;
|
|
37
|
+
virtualThreshold?: number;
|
|
38
|
+
listHeight?: number;
|
|
39
|
+
optionHeight?: number;
|
|
40
|
+
notFoundContent?: ReactNode;
|
|
41
|
+
}
|
|
42
|
+
declare const Select: react.ForwardRefExoticComponent<SelectProps & react.RefAttributes<HTMLButtonElement>>;
|
|
43
|
+
|
|
44
|
+
export { type ControlSize as C, type InputPlaceholderMode as I, Select as S, type ControlStatus as a, type SelectChangeValue as b, type SelectMode as c, type SelectOption as d, type SelectProps as e, type SelectValue as f };
|