@seclab-dev/react 0.1.0-alpha.1

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.
Files changed (33) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/LICENSE +21 -0
  3. package/README.md +65 -0
  4. package/dist/components/SecLabActionMenu/SecLabActionMenu.d.ts +21 -0
  5. package/dist/components/SecLabAlert/SecLabAlert.d.ts +18 -0
  6. package/dist/components/SecLabBreadcrumb/SecLabBreadcrumb.d.ts +7 -0
  7. package/dist/components/SecLabBreadcrumbItem/SecLabBreadcrumbItem.d.ts +6 -0
  8. package/dist/components/SecLabButton/SecLabButton.d.ts +10 -0
  9. package/dist/components/SecLabCard/SecLabCard.d.ts +16 -0
  10. package/dist/components/SecLabCheckbox/SecLabCheckbox.d.ts +10 -0
  11. package/dist/components/SecLabDateTimeRangePicker/SecLabDateTimeRangePicker.d.ts +44 -0
  12. package/dist/components/SecLabDescriptions/SecLabDescriptions.d.ts +23 -0
  13. package/dist/components/SecLabDialog/SecLabDialog.d.ts +20 -0
  14. package/dist/components/SecLabDrawer/SecLabDrawer.d.ts +18 -0
  15. package/dist/components/SecLabEmpty/SecLabEmpty.d.ts +14 -0
  16. package/dist/components/SecLabFormItem/SecLabFormItem.d.ts +10 -0
  17. package/dist/components/SecLabIcon/SecLabIcon.d.ts +10 -0
  18. package/dist/components/SecLabInput/SecLabInput.d.ts +37 -0
  19. package/dist/components/SecLabLoading/SecLabLoading.d.ts +10 -0
  20. package/dist/components/SecLabMenu/SecLabMenu.d.ts +21 -0
  21. package/dist/components/SecLabModal/SecLabModal.d.ts +20 -0
  22. package/dist/components/SecLabPagination/SecLabPagination.d.ts +12 -0
  23. package/dist/components/SecLabSelect/SecLabSelect.d.ts +22 -0
  24. package/dist/components/SecLabSwitch/SecLabSwitch.d.ts +8 -0
  25. package/dist/components/SecLabTable/SecLabTable.d.ts +42 -0
  26. package/dist/components/SecLabTabs/SecLabTabs.d.ts +17 -0
  27. package/dist/components/SecLabTag/SecLabTag.d.ts +8 -0
  28. package/dist/components/SecLabToast/SecLabToast.d.ts +14 -0
  29. package/dist/components/SecLabTooltip/SecLabTooltip.d.ts +15 -0
  30. package/dist/index.d.ts +52 -0
  31. package/dist/index.js +1134 -0
  32. package/dist/style.css +2 -0
  33. package/package.json +45 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,14 @@
1
+ # Changelog
2
+
3
+ 格式遵循 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/),并遵循 [Semantic Versioning](https://semver.org/lang/zh-CN/)。
4
+
5
+ ## [0.1.0-alpha.1] - 2026-06-28
6
+
7
+ ### Added
8
+
9
+ - 首次发布 SecLab React 19 基础组件库。
10
+ - 提供按钮、输入、选择、开关、复选框、日期范围和表单组件。
11
+ - 提供表格、分页、标签、描述列表、卡片和空状态组件。
12
+ - 提供弹窗、抽屉、模态框、菜单、标签页和面包屑组件。
13
+ - 提供提示、通知、加载、告警和统一 SVG 图标组件。
14
+ - 发布 ESM、TypeScript 类型声明和独立组件样式。
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 seclab-dev
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,65 @@
1
+ # @seclab-dev/react
2
+
3
+ SecLab React 19 基础组件库,实现 SecLab Design Language(SDL)的通用交互和视觉规范。
4
+
5
+ ## 安装
6
+
7
+ ```bash
8
+ pnpm add @seclab-dev/react @seclab-dev/icons @seclab-dev/tokens
9
+ ```
10
+
11
+ 项目需要安装 React 19:
12
+
13
+ ```bash
14
+ pnpm add react react-dom
15
+ ```
16
+
17
+ ## 样式
18
+
19
+ 在全局样式入口导入主题变量和组件样式:
20
+
21
+ ```css
22
+ @import "@seclab-dev/tokens/index.css";
23
+ @import "@seclab-dev/react/style.css";
24
+ ```
25
+
26
+ ## 使用
27
+
28
+ 组件采用按需导入:
29
+
30
+ ```tsx
31
+ import { useState } from "react";
32
+ import { SecLabButton, SecLabIcon, SecLabInput } from "@seclab-dev/react";
33
+
34
+ export default function SearchPanel() {
35
+ const [keyword, setKeyword] = useState("");
36
+
37
+ return (
38
+ <div>
39
+ <SecLabInput value={keyword} onChange={setKeyword} placeholder="搜索" />
40
+ <SecLabButton type="primary">
41
+ <SecLabIcon name="search" size={16} />
42
+ 查询
43
+ </SecLabButton>
44
+ </div>
45
+ );
46
+ }
47
+ ```
48
+
49
+ ## 组件范围
50
+
51
+ - 操作:按钮、操作菜单
52
+ - 输入:输入框、选择器、开关、复选框、日期时间范围
53
+ - 数据:表格、分页、标签、描述列表
54
+ - 容器:卡片、对话框、抽屉、模态框
55
+ - 反馈:告警、通知、加载、空状态、提示
56
+ - 导航:菜单、标签页、面包屑
57
+
58
+ 组件的实际 Props、事件和类型声明以发布包中的 TypeScript 类型为准。
59
+
60
+ ## 约束
61
+
62
+ - 组件不依赖业务 API、任何全局状态管理库或路由。
63
+ - 视觉变量由 `@seclab-dev/tokens` 提供。
64
+ - 图标由 `@seclab-dev/icons` 提供。
65
+ - `react` 和 `react-dom` 是 peer dependencies,不会被组件库重复打包。
@@ -0,0 +1,21 @@
1
+ import { default as React } from 'react';
2
+ export interface SecLabAction {
3
+ label: string;
4
+ class?: string;
5
+ className?: string;
6
+ icon?: string;
7
+ disabled?: boolean;
8
+ tooltip?: string;
9
+ handler: () => void;
10
+ }
11
+ export interface SecLabActionMenuProps extends React.HTMLAttributes<HTMLDivElement> {
12
+ /** 操作列表 */
13
+ actions: SecLabAction[];
14
+ /** 按钮文案 */
15
+ label?: string;
16
+ /** 是否禁用菜单入口 */
17
+ disabled?: boolean;
18
+ /** 菜单项默认图标 */
19
+ defaultIcon?: string;
20
+ }
21
+ export declare const SecLabActionMenu: React.FC<SecLabActionMenuProps>;
@@ -0,0 +1,18 @@
1
+ import { default as React } from 'react';
2
+ export interface SecLabAlertProps extends React.HTMLAttributes<HTMLDivElement> {
3
+ /** 警告标题 */
4
+ title?: string;
5
+ /** 警告描述 (如果有 title, 则在下方显示) */
6
+ description?: string;
7
+ /** 警告类型 */
8
+ type?: "success" | "warning" | "error" | "info";
9
+ /** 是否显示图标 */
10
+ showIcon?: boolean;
11
+ /** 是否可关闭 */
12
+ closable?: boolean;
13
+ /** 关闭事件 */
14
+ onClose?: () => void;
15
+ /** 子元素,将作为 description 渲染 */
16
+ children?: React.ReactNode;
17
+ }
18
+ export declare const SecLabAlert: React.FC<SecLabAlertProps>;
@@ -0,0 +1,7 @@
1
+ import { default as React } from 'react';
2
+ export declare const BreadcrumbContext: React.Context<string>;
3
+ export interface SecLabBreadcrumbProps extends React.HTMLAttributes<HTMLElement> {
4
+ /** 分隔符 */
5
+ separator?: string;
6
+ }
7
+ export declare const SecLabBreadcrumb: React.FC<SecLabBreadcrumbProps>;
@@ -0,0 +1,6 @@
1
+ import { default as React } from 'react';
2
+ export interface SecLabBreadcrumbItemProps extends React.HTMLAttributes<HTMLSpanElement> {
3
+ /** 子元素,面包屑项内容 */
4
+ children?: React.ReactNode;
5
+ }
6
+ export declare const SecLabBreadcrumbItem: React.FC<SecLabBreadcrumbItemProps>;
@@ -0,0 +1,10 @@
1
+ import { default as React } from 'react';
2
+ export interface SecLabButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "type"> {
3
+ type?: "primary" | "secondary" | "danger" | "warning" | "info";
4
+ size?: "small" | "default" | "large";
5
+ disabled?: boolean;
6
+ loading?: boolean;
7
+ onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
8
+ children?: React.ReactNode;
9
+ }
10
+ export declare const SecLabButton: React.FC<SecLabButtonProps>;
@@ -0,0 +1,16 @@
1
+ import { default as React } from 'react';
2
+ export interface SecLabCardProps extends React.HTMLAttributes<HTMLDivElement> {
3
+ /** 阴影显示时机 */
4
+ shadow?: "always" | "hover" | "never";
5
+ /** 内容区自定义样式 */
6
+ contentStyle?: React.CSSProperties;
7
+ /** 默认插槽容器语义 */
8
+ contentRole?: "content" | "header";
9
+ /** 内容区是否撑满高度 (用于包含滚动表格的场景) */
10
+ fullHeight?: boolean;
11
+ /** 头部内容 */
12
+ header?: React.ReactNode;
13
+ /** 子元素,卡片内容 */
14
+ children?: React.ReactNode;
15
+ }
16
+ export declare const SecLabCard: React.FC<SecLabCardProps>;
@@ -0,0 +1,10 @@
1
+ import { default as React } from 'react';
2
+ export interface SecLabCheckboxProps extends Omit<React.LabelHTMLAttributes<HTMLLabelElement>, "onChange"> {
3
+ /** 绑定值 */
4
+ checked?: boolean;
5
+ /** 禁用状态 */
6
+ disabled?: boolean;
7
+ /** 改变事件 */
8
+ onChange?: (checked: boolean) => void;
9
+ }
10
+ export declare const SecLabCheckbox: React.FC<SecLabCheckboxProps>;
@@ -0,0 +1,44 @@
1
+ import { default as React } from 'react';
2
+ export interface DateTimeRangeValue {
3
+ startAt: number | null;
4
+ endAt: number | null;
5
+ }
6
+ export interface ShortcutOption {
7
+ label: string;
8
+ value: "15m" | "1h" | "24h" | "7d" | "today";
9
+ }
10
+ export interface SecLabDateTimeRangePickerProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "value" | "onChange"> {
11
+ /** 绑定的时间范围,使用 Unix epoch milliseconds */
12
+ value?: DateTimeRangeValue;
13
+ /** 占位文案 */
14
+ placeholder?: string;
15
+ /** 起始端标签 */
16
+ startLabel?: string;
17
+ /** 结束端标签 */
18
+ endLabel?: string;
19
+ /** 快捷范围标题 */
20
+ shortcutsLabel?: string;
21
+ /** 日历标题 */
22
+ calendarLabel?: string;
23
+ /** 时间标题 */
24
+ timeLabel?: string;
25
+ /** 清空按钮文案 */
26
+ clearLabel?: string;
27
+ /** 确认按钮文案 */
28
+ confirmLabel?: string;
29
+ /** 取消按钮文案 */
30
+ cancelLabel?: string;
31
+ /** 当前应用语言 */
32
+ locale?: string;
33
+ /** 星期标题,长度为 7 */
34
+ weekDays?: string[];
35
+ /** 快捷范围选项 */
36
+ shortcuts?: ShortcutOption[];
37
+ /** 是否禁用 */
38
+ disabled?: boolean;
39
+ /** 改变值时的回调 */
40
+ onChange?: (value: DateTimeRangeValue) => void;
41
+ /** 点击确认应用时的回调 */
42
+ onApply?: (value: DateTimeRangeValue) => void;
43
+ }
44
+ export declare const SecLabDateTimeRangePicker: React.FC<SecLabDateTimeRangePickerProps>;
@@ -0,0 +1,23 @@
1
+ import { default as React } from 'react';
2
+ export interface DescriptionItem {
3
+ label: string;
4
+ value?: React.ReactNode;
5
+ slot?: string;
6
+ span?: number;
7
+ render?: (item: DescriptionItem, data?: any) => React.ReactNode;
8
+ }
9
+ export interface SecLabDescriptionsProps extends React.HTMLAttributes<HTMLDivElement> {
10
+ /** 标题 */
11
+ title?: string;
12
+ /** 列表项配置 */
13
+ items: DescriptionItem[];
14
+ /** 原始数据对象 (用于插槽渲染) */
15
+ data?: Record<string, any>;
16
+ /** 列数 */
17
+ column?: number;
18
+ /** 是否显示边框 */
19
+ border?: boolean;
20
+ /** 插槽渲染器,对应 Vue 的 slot */
21
+ slots?: Record<string, (item: DescriptionItem, data?: any) => React.ReactNode>;
22
+ }
23
+ export declare const SecLabDescriptions: React.FC<SecLabDescriptionsProps>;
@@ -0,0 +1,20 @@
1
+ import { default as React } from 'react';
2
+ export interface SecLabDialogProps extends React.HTMLAttributes<HTMLDivElement> {
3
+ /** 对话框是否显示 */
4
+ visible: boolean;
5
+ /** 对话框标题 */
6
+ title: string;
7
+ /** 自定义宽度,支持 px 或百分比,默认值为 500px */
8
+ width?: string;
9
+ /** 点击遮罩层是否允许自动关闭对话框,默认为 true */
10
+ closeOnClickOverlay?: boolean;
11
+ /** 对话框遮罩层级,默认使用 SDL modal 层级 */
12
+ zIndex?: number | string;
13
+ /** 关闭回调 */
14
+ onClose?: () => void;
15
+ /** 底部渲染插槽 */
16
+ footer?: React.ReactNode;
17
+ /** 对话框内容 */
18
+ children?: React.ReactNode;
19
+ }
20
+ export declare const SecLabDialog: React.FC<SecLabDialogProps>;
@@ -0,0 +1,18 @@
1
+ import { default as React } from 'react';
2
+ export interface SecLabDrawerProps extends React.HTMLAttributes<HTMLDivElement> {
3
+ /** 抽屉是否显示 */
4
+ visible: boolean;
5
+ /** 抽屉标题 */
6
+ title?: string;
7
+ /** 自定义宽度,支持 px 或百分比,默认值为 420px */
8
+ width?: string;
9
+ /** 点击遮罩层是否允许自动关闭抽屉,默认为 true */
10
+ closeOnOverlay?: boolean;
11
+ /** 关闭回调 */
12
+ onClose?: () => void;
13
+ /** 底部操作按钮栏 */
14
+ footer?: React.ReactNode;
15
+ /** 抽屉主体内容 */
16
+ children?: React.ReactNode;
17
+ }
18
+ export declare const SecLabDrawer: React.FC<SecLabDrawerProps>;
@@ -0,0 +1,14 @@
1
+ import { default as React } from 'react';
2
+ export interface SecLabEmptyProps extends React.HTMLAttributes<HTMLDivElement> {
3
+ /** 描述文字 */
4
+ description?: string;
5
+ /** SDL 图标名称 */
6
+ icon?: string;
7
+ /** 自定义图标节点,会覆盖 icon 属性 */
8
+ iconNode?: React.ReactNode;
9
+ /** 额外内容 */
10
+ extra?: React.ReactNode;
11
+ /** 子元素,将作为 description 渲染 */
12
+ children?: React.ReactNode;
13
+ }
14
+ export declare const SecLabEmpty: React.FC<SecLabEmptyProps>;
@@ -0,0 +1,10 @@
1
+ import { default as React } from 'react';
2
+ export interface SecLabFormItemProps extends React.HTMLAttributes<HTMLDivElement> {
3
+ /** 标签文本 */
4
+ label?: string;
5
+ /** 是否必填 (显示红星) */
6
+ required?: boolean;
7
+ /** 提示文本 */
8
+ hint?: string;
9
+ }
10
+ export declare const SecLabFormItem: React.FC<SecLabFormItemProps>;
@@ -0,0 +1,10 @@
1
+ import { default as React } from 'react';
2
+ import { IconNamespace } from '@seclab-dev/icons';
3
+ export interface SecLabIconProps extends React.HTMLAttributes<HTMLSpanElement> {
4
+ name?: string | null;
5
+ namespace?: IconNamespace;
6
+ size?: number | string;
7
+ label?: string;
8
+ decorative?: boolean;
9
+ }
10
+ export declare const SecLabIcon: React.FC<SecLabIconProps>;
@@ -0,0 +1,37 @@
1
+ import { default as React } from 'react';
2
+ export interface SecLabInputProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "value" | "onChange" | "onFocus" | "onBlur"> {
3
+ /** 绑定值 */
4
+ value?: string | number | null;
5
+ /** 输入类型 */
6
+ type?: "text" | "password" | "textarea" | "number" | "datetime-local";
7
+ /** 占位符 */
8
+ placeholder?: string;
9
+ /** 是否禁用 */
10
+ disabled?: boolean;
11
+ /** 是否只读 */
12
+ readonly?: boolean;
13
+ readOnly?: boolean;
14
+ /** 最大长度 */
15
+ maxlength?: number;
16
+ maxLength?: number;
17
+ /** 行数 (仅 textarea 有效) */
18
+ rows?: number;
19
+ /** 是否显示密码切换按钮 */
20
+ showPassword?: boolean;
21
+ /** 最小值 (仅 number 有效) */
22
+ min?: number | string;
23
+ /** 最大值 (仅 number 有效) */
24
+ max?: number | string;
25
+ /** 步长 (仅 number 有效) */
26
+ step?: number | string;
27
+ /** 自动填充属性 */
28
+ autocomplete?: string;
29
+ autoComplete?: string;
30
+ /** 值改变事件 */
31
+ onChange?: (value: string) => void;
32
+ /** focus 事件 */
33
+ onFocus?: React.FocusEventHandler<HTMLInputElement | HTMLTextAreaElement>;
34
+ /** blur 事件 */
35
+ onBlur?: React.FocusEventHandler<HTMLInputElement | HTMLTextAreaElement>;
36
+ }
37
+ export declare const SecLabInput: React.FC<SecLabInputProps>;
@@ -0,0 +1,10 @@
1
+ import { default as React } from 'react';
2
+ export interface SecLabLoadingProps extends React.HTMLAttributes<HTMLDivElement> {
3
+ /** 是否显示加载中 */
4
+ loading: boolean;
5
+ /** 提示文字 */
6
+ text?: string;
7
+ /** 是否覆盖父容器 */
8
+ cover?: boolean;
9
+ }
10
+ export declare const SecLabLoading: React.FC<SecLabLoadingProps>;
@@ -0,0 +1,21 @@
1
+ import { default as React } from 'react';
2
+ export interface MenuItem {
3
+ key: string;
4
+ label: string;
5
+ }
6
+ export interface MenuCategory {
7
+ key: string;
8
+ label: string;
9
+ children: MenuItem[];
10
+ }
11
+ export interface SecLabMenuProps extends Omit<React.HTMLAttributes<HTMLElement>, "onChange" | "onSelect"> {
12
+ /** 当前选中的菜单项 key */
13
+ value?: string;
14
+ /** 菜单项列表 (带分组) */
15
+ items: MenuCategory[];
16
+ /** 选中事件 */
17
+ onSelect?: (key: string) => void;
18
+ /** 绑定值改变事件 */
19
+ onChange?: (key: string) => void;
20
+ }
21
+ export declare const SecLabMenu: React.FC<SecLabMenuProps>;
@@ -0,0 +1,20 @@
1
+ import { default as React } from 'react';
2
+ export interface SecLabModalProps extends React.HTMLAttributes<HTMLDivElement> {
3
+ /** 是否可见 */
4
+ visible: boolean;
5
+ /** 标题 */
6
+ title: string;
7
+ /** 消息内容 */
8
+ message: string;
9
+ /** 确认按钮文案 */
10
+ confirmText?: string;
11
+ /** 取消按钮文案 */
12
+ cancelText?: string;
13
+ /** 确认按钮类型 */
14
+ type?: "primary" | "danger" | "warning";
15
+ /** 确认回调 */
16
+ onConfirm?: () => void;
17
+ /** 取消回调 */
18
+ onCancel?: () => void;
19
+ }
20
+ export declare const SecLabModal: React.FC<SecLabModalProps>;
@@ -0,0 +1,12 @@
1
+ import { default as React } from 'react';
2
+ export interface SecLabPaginationProps extends React.HTMLAttributes<HTMLDivElement> {
3
+ /** 当前页码 (从 1 开始) */
4
+ currentPage: number;
5
+ /** 总页数 */
6
+ totalPages: number;
7
+ /** 最大可见页码数,默认为 5 */
8
+ maxVisibleButtons?: number;
9
+ /** 页码改变时的回调 */
10
+ onPageChange?: (page: number) => void;
11
+ }
12
+ export declare const SecLabPagination: React.FC<SecLabPaginationProps>;
@@ -0,0 +1,22 @@
1
+ import { default as React } from 'react';
2
+ export interface SecLabSelectOption {
3
+ value: string | number;
4
+ label: string;
5
+ disabled?: boolean;
6
+ hint?: string;
7
+ }
8
+ export interface SecLabSelectProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "value" | "onChange"> {
9
+ /** 绑定值 */
10
+ value: string | number | null;
11
+ /** 选项列表 */
12
+ options: SecLabSelectOption[];
13
+ /** 占位符 */
14
+ placeholder?: string;
15
+ /** 是否禁用 */
16
+ disabled?: boolean;
17
+ /** 改变值时的回调 */
18
+ onChange?: (value: string | number | null) => void;
19
+ /** 禁用选项被点击时的回调 */
20
+ onOptionDisabled?: (option: SecLabSelectOption) => void;
21
+ }
22
+ export declare const SecLabSelect: React.FC<SecLabSelectProps>;
@@ -0,0 +1,8 @@
1
+ import { default as React } from 'react';
2
+ export interface SecLabSwitchProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onChange"> {
3
+ value: boolean;
4
+ onChange?: (value: boolean) => void;
5
+ activeText?: string;
6
+ disabled?: boolean;
7
+ }
8
+ export declare const SecLabSwitch: React.FC<SecLabSwitchProps>;
@@ -0,0 +1,42 @@
1
+ import { default as React } from 'react';
2
+ export interface SecLabTableColumn<T = any> {
3
+ prop?: string;
4
+ label: string;
5
+ width?: string | number;
6
+ minWidth?: string | number;
7
+ align?: "left" | "center" | "right";
8
+ headerAlign?: "left" | "center" | "right";
9
+ slot?: string;
10
+ headerSlot?: string;
11
+ renderCell?: (row: T, column: SecLabTableColumn<T>, index: number) => React.ReactNode;
12
+ renderHeader?: (column: SecLabTableColumn<T>, index: number) => React.ReactNode;
13
+ fixed?: string;
14
+ }
15
+ export interface SecLabTableProps<T> extends React.HTMLAttributes<HTMLDivElement> {
16
+ /** 表格数据 */
17
+ data: T[];
18
+ /** 列配置 */
19
+ columns: SecLabTableColumn<T>[];
20
+ /** 是否显示全网格边框 */
21
+ border?: boolean;
22
+ /** 无数据时显示的占位文案 */
23
+ emptyText?: string;
24
+ /** 插槽映射 (对应 Vue 中的 scoped slots) */
25
+ slots?: Record<string, (scope: {
26
+ row: T;
27
+ column: SecLabTableColumn<T>;
28
+ index: number;
29
+ }) => React.ReactNode>;
30
+ /** 表头插槽映射 */
31
+ headerSlots?: Record<string, (scope: {
32
+ column: SecLabTableColumn<T>;
33
+ index: number;
34
+ }) => React.ReactNode>;
35
+ /** 自定义空数据占位 */
36
+ emptySlot?: React.ReactNode;
37
+ /** 鼠标悬浮行回调 */
38
+ onRowMouseEnter?: (row: T, event: React.MouseEvent<HTMLTableRowElement>, index: number) => void;
39
+ /** 右键行回调 */
40
+ onRowContextMenu?: (row: T, event: React.MouseEvent<HTMLTableRowElement>, index: number) => void;
41
+ }
42
+ export declare function SecLabTable<T extends Record<string, any>>({ data, columns, border, emptyText, slots, headerSlots, emptySlot, onRowMouseEnter, onRowContextMenu, className, ...rest }: SecLabTableProps<T>): React.JSX.Element;
@@ -0,0 +1,17 @@
1
+ import { default as React } from 'react';
2
+ export interface TabItem {
3
+ label: string;
4
+ name: string;
5
+ disabled?: boolean;
6
+ }
7
+ export interface SecLabTabsProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onChange"> {
8
+ /** 当前选中的标签页 name */
9
+ value?: string;
10
+ /** 标签页列表 */
11
+ tabs: TabItem[];
12
+ /** 标签页改变事件 */
13
+ onTabChange?: (name: string) => void;
14
+ /** 绑定值改变事件 */
15
+ onChange?: (name: string) => void;
16
+ }
17
+ export declare const SecLabTabs: React.FC<SecLabTabsProps>;
@@ -0,0 +1,8 @@
1
+ import { default as React } from 'react';
2
+ export interface SecLabTagProps extends React.HTMLAttributes<HTMLSpanElement> {
3
+ /** 标签类型 */
4
+ type?: "primary" | "success" | "warning" | "danger" | "info" | "default";
5
+ /** 主题风格 */
6
+ effect?: "light" | "plain" | "dark";
7
+ }
8
+ export declare const SecLabTag: React.FC<SecLabTagProps>;
@@ -0,0 +1,14 @@
1
+ import { default as React } from 'react';
2
+ export interface ToastItem {
3
+ id: string;
4
+ type: "success" | "error" | "warning" | "info";
5
+ title: string;
6
+ message: string;
7
+ }
8
+ export interface SecLabToastProps extends React.HTMLAttributes<HTMLDivElement> {
9
+ /** 通知列表 */
10
+ toasts: ToastItem[];
11
+ /** 关闭事件 */
12
+ onClose?: (id: string) => void;
13
+ }
14
+ export declare const SecLabToast: React.FC<SecLabToastProps>;
@@ -0,0 +1,15 @@
1
+ import { default as React } from 'react';
2
+ export type TooltipPosition = "top" | "bottom" | "left" | "right";
3
+ export interface SecLabTooltipProps extends React.HTMLAttributes<HTMLDivElement> {
4
+ /** 提示文字内容 */
5
+ text: string;
6
+ /** 显示位置 */
7
+ position?: TooltipPosition;
8
+ /** 显示延迟 (ms) */
9
+ delay?: number;
10
+ /** 是否禁用 */
11
+ disabled?: boolean;
12
+ /** 子元素 */
13
+ children: React.ReactNode;
14
+ }
15
+ export declare const SecLabTooltip: React.FC<SecLabTooltipProps>;
@@ -0,0 +1,52 @@
1
+ export { SecLabIcon } from './components/SecLabIcon/SecLabIcon';
2
+ export type { SecLabIconProps } from './components/SecLabIcon/SecLabIcon';
3
+ export { SecLabButton } from './components/SecLabButton/SecLabButton';
4
+ export type { SecLabButtonProps } from './components/SecLabButton/SecLabButton';
5
+ export { SecLabSwitch } from './components/SecLabSwitch/SecLabSwitch';
6
+ export type { SecLabSwitchProps } from './components/SecLabSwitch/SecLabSwitch';
7
+ export { SecLabAlert } from './components/SecLabAlert/SecLabAlert';
8
+ export type { SecLabAlertProps } from './components/SecLabAlert/SecLabAlert';
9
+ export { SecLabCard } from './components/SecLabCard/SecLabCard';
10
+ export type { SecLabCardProps } from './components/SecLabCard/SecLabCard';
11
+ export { SecLabCheckbox } from './components/SecLabCheckbox/SecLabCheckbox';
12
+ export type { SecLabCheckboxProps } from './components/SecLabCheckbox/SecLabCheckbox';
13
+ export { SecLabEmpty } from './components/SecLabEmpty/SecLabEmpty';
14
+ export type { SecLabEmptyProps } from './components/SecLabEmpty/SecLabEmpty';
15
+ export { SecLabFormItem } from './components/SecLabFormItem/SecLabFormItem';
16
+ export type { SecLabFormItemProps } from './components/SecLabFormItem/SecLabFormItem';
17
+ export { SecLabLoading } from './components/SecLabLoading/SecLabLoading';
18
+ export type { SecLabLoadingProps } from './components/SecLabLoading/SecLabLoading';
19
+ export { SecLabTag } from './components/SecLabTag/SecLabTag';
20
+ export type { SecLabTagProps } from './components/SecLabTag/SecLabTag';
21
+ export { SecLabBreadcrumb } from './components/SecLabBreadcrumb/SecLabBreadcrumb';
22
+ export type { SecLabBreadcrumbProps } from './components/SecLabBreadcrumb/SecLabBreadcrumb';
23
+ export { SecLabBreadcrumbItem } from './components/SecLabBreadcrumbItem/SecLabBreadcrumbItem';
24
+ export type { SecLabBreadcrumbItemProps } from './components/SecLabBreadcrumbItem/SecLabBreadcrumbItem';
25
+ export { SecLabInput } from './components/SecLabInput/SecLabInput';
26
+ export type { SecLabInputProps } from './components/SecLabInput/SecLabInput';
27
+ export { SecLabMenu } from './components/SecLabMenu/SecLabMenu';
28
+ export type { SecLabMenuProps, MenuItem, MenuCategory, } from './components/SecLabMenu/SecLabMenu';
29
+ export { SecLabTabs } from './components/SecLabTabs/SecLabTabs';
30
+ export type { SecLabTabsProps, TabItem, } from './components/SecLabTabs/SecLabTabs';
31
+ export { SecLabDescriptions } from './components/SecLabDescriptions/SecLabDescriptions';
32
+ export type { SecLabDescriptionsProps, DescriptionItem, } from './components/SecLabDescriptions/SecLabDescriptions';
33
+ export { SecLabTooltip } from './components/SecLabTooltip/SecLabTooltip';
34
+ export type { SecLabTooltipProps, TooltipPosition, } from './components/SecLabTooltip/SecLabTooltip';
35
+ export { SecLabToast } from './components/SecLabToast/SecLabToast';
36
+ export type { SecLabToastProps, ToastItem, } from './components/SecLabToast/SecLabToast';
37
+ export { SecLabDialog } from './components/SecLabDialog/SecLabDialog';
38
+ export type { SecLabDialogProps } from './components/SecLabDialog/SecLabDialog';
39
+ export { SecLabDrawer } from './components/SecLabDrawer/SecLabDrawer';
40
+ export type { SecLabDrawerProps } from './components/SecLabDrawer/SecLabDrawer';
41
+ export { SecLabModal } from './components/SecLabModal/SecLabModal';
42
+ export type { SecLabModalProps } from './components/SecLabModal/SecLabModal';
43
+ export { SecLabPagination } from './components/SecLabPagination/SecLabPagination';
44
+ export type { SecLabPaginationProps } from './components/SecLabPagination/SecLabPagination';
45
+ export { SecLabSelect } from './components/SecLabSelect/SecLabSelect';
46
+ export type { SecLabSelectProps, SecLabSelectOption, } from './components/SecLabSelect/SecLabSelect';
47
+ export { SecLabActionMenu } from './components/SecLabActionMenu/SecLabActionMenu';
48
+ export type { SecLabActionMenuProps, SecLabAction, } from './components/SecLabActionMenu/SecLabActionMenu';
49
+ export { SecLabTable } from './components/SecLabTable/SecLabTable';
50
+ export type { SecLabTableProps, SecLabTableColumn, } from './components/SecLabTable/SecLabTable';
51
+ export { SecLabDateTimeRangePicker } from './components/SecLabDateTimeRangePicker/SecLabDateTimeRangePicker';
52
+ export type { SecLabDateTimeRangePickerProps, DateTimeRangeValue, ShortcutOption, } from './components/SecLabDateTimeRangePicker/SecLabDateTimeRangePicker';