@turinhub/atomix-common-ui 0.1.0 → 0.1.2

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 CHANGED
@@ -27,6 +27,7 @@
27
27
  ## 📦 安装
28
28
 
29
29
  **环境要求:**
30
+
30
31
  - Node.js >= 18
31
32
  - React >= 18.0.0 || >= 19.0.0
32
33
  - pnpm (推荐) 或 npm/yarn
@@ -60,11 +61,7 @@ npx shadcn-ui@latest add button card dialog input label select table skeleton dr
60
61
 
61
62
  ```typescript
62
63
  // src/lib/ui-adapter.ts
63
- import {
64
- Card,
65
- CardContent,
66
- CardFooter,
67
- } from '@/components/ui/card';
64
+ import { Card, CardContent, CardFooter } from '@/components/ui/card';
68
65
  import { Button } from '@/components/ui/button';
69
66
  import {
70
67
  TableHeader as DataTableHeader,
@@ -105,6 +102,8 @@ import { dataTableUI } from '@/lib/ui-adapter';
105
102
  - **DeleteConfirmDialog** - 删除确认对话框
106
103
  - **TableHeader** - 表格头部(支持搜索和操作按钮)
107
104
  - **TablePagination** - 分页组件
105
+ - **ThemeSwitcher** - 主题切换组件(完整版,支持下拉菜单)
106
+ - **ThemeSwitcherContent** - 主题切换内容组件(轻量版,可嵌入)
108
107
 
109
108
  ## 📁 项目结构
110
109
 
@@ -166,6 +165,11 @@ import type {
166
165
  HeaderUIComponents,
167
166
  TablePaginationProps,
168
167
  PaginationUIComponents,
168
+ ThemeSwitcherProps,
169
+ ThemeSwitcherUIComponents,
170
+ ThemeSwitcherContentProps,
171
+ ThemeSwitcherContentUIComponents,
172
+ ThemeOption,
169
173
  } from '@turinhub/atomix-common-ui';
170
174
  ```
171
175
 
@@ -242,7 +246,7 @@ pnpm format:check
242
246
 
243
247
  ```typescript
244
248
  // 问题:UI 组件被打包进 npm 包
245
- import { DataTable, Button, Dialog } from '@some-ui-lib'
249
+ import { DataTable, Button, Dialog } from '@some-ui-lib';
246
250
 
247
251
  // 缺点:
248
252
  // 1. ❌ 无法修改 Button、Dialog 的源码
@@ -254,8 +258,8 @@ import { DataTable, Button, Dialog } from '@some-ui-lib'
254
258
 
255
259
  ```typescript
256
260
  // 优势:UI 组件由业务项目提供
257
- import { DataTable } from '@turinhub/atomix-common-ui'
258
- import { Button, Dialog } from '@/components/ui' // 自己的 shadcn/ui
261
+ import { DataTable } from '@turinhub/atomix-common-ui';
262
+ import { Button, Dialog } from '@/components/ui'; // 自己的 shadcn/ui
259
263
 
260
264
  // 优点:
261
265
  // 1. ✅ 可以随时修改 UI 组件源码
@@ -1 +1 @@
1
- {"version":3,"file":"DataTable.d.ts","sourceRoot":"","sources":["../../src/components/DataTable.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,KAAK,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAElE,OAAO,KAAK,EACV,WAAW,EACX,eAAe,EACf,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,kBAAkB,EACnB,MAAM,0BAA0B,CAAC;AAElC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAE9D,KAAK,SAAS,CAAC,CAAC,IAAI,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC;AAE7C,KAAK,cAAc,CAAC,CAAC,IAAI;IACvB,KAAK,EAAE,SAAS,CAAC;IACjB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,OAAO,EAAE,CAAC,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,KAAK,CAAC;CACnB,CAAC;AAEF,KAAK,mBAAmB,GAAG;IACzB,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KA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KAAK,EACL,OAAO,EACP,UAAU,EACV,UAAU,EACV,WAAW,EACX,aAAa,GACd,EAAE,cAAc,CAAC,CAAC,CAAC,2UAqRnB"}
@@ -29,10 +29,11 @@ export interface DeleteConfirmDialogProps {
29
29
  placeholder?: string;
30
30
  };
31
31
  components?: DialogUIComponents;
32
+ loadingIcon?: React.ReactNode;
32
33
  }
33
34
  /**
34
35
  * 删除确认对话框
35
36
  * 需要通过 components prop 注入 UI 组件
36
37
  */
37
- export declare function DeleteConfirmDialog({ open, onOpenChange, title, description, onConfirm, loading, confirmText, cancelText, confirmButtonVariant, verification, components, }: DeleteConfirmDialogProps): import("react/jsx-runtime").JSX.Element;
38
+ export declare function DeleteConfirmDialog({ open, onOpenChange, title, description, onConfirm, loading, confirmText, cancelText, confirmButtonVariant, verification, components, loadingIcon, }: DeleteConfirmDialogProps): import("react/jsx-runtime").JSX.Element;
38
39
  //# sourceMappingURL=DeleteConfirmDialog.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DeleteConfirmDialog.d.ts","sourceRoot":"","sources":["../../src/components/DeleteConfirmDialog.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,eAAe,EACf,cAAc,EACd,cAAc,EACd,eAAe,EACf,sBAAsB,EACtB,qBAAqB,EACrB,qBAAqB,EACrB,oBAAoB,EACpB,0BAA0B,EAC3B,MAAM,0BAA0B,CAAC;AAElC;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,eAAe,CAAC;IACxB,aAAa,EAAE,sBAAsB,CAAC;IACtC,YAAY,EAAE,qBAAqB,CAAC;IACpC,YAAY,EAAE,qBAAqB,CAAC;IACpC,WAAW,EAAE,oBAAoB,CAAC;IAClC,iBAAiB,EAAE,0BAA0B,CAAC;IAC9C,MAAM,EAAE,eAAe,CAAC;IACxB,KAAK,EAAE,cAAc,CAAC;IACtB,KAAK,EAAE,cAAc,CAAC;CACvB;AAED,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,OAAO,CAAC;IACd,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACtC,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,WAAW,EAAE,KAAK,CAAC,SAAS,CAAC;IAC7B,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,oBAAoB,CAAC,EAAE,SAAS,GAAG,aAAa,GAAG,SAAS,GAAG,WAAW,GAAG,OAAO,GAAG,MAAM,CAAC;IAC9F,YAAY,CAAC,EAAE;QACb,WAAW,EAAE,MAAM,CAAC;QACpB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC;IAGF,UAAU,CAAC,EAAE,kBAAkB,CAAC;CACjC;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,IAAI,EACJ,YAAY,EACZ,KAAK,EACL,WAAW,EACX,SAAS,EACT,OAAe,EACf,WAAoB,EACpB,UAAiB,EACjB,oBAAoC,EACpC,YAAY,EACZ,UAAU,GACX,EAAE,wBAAwB,2CA4G1B"}
1
+ {"version":3,"file":"DeleteConfirmDialog.d.ts","sourceRoot":"","sources":["../../src/components/DeleteConfirmDialog.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,eAAe,EACf,cAAc,EACd,cAAc,EACd,eAAe,EACf,sBAAsB,EACtB,qBAAqB,EACrB,qBAAqB,EACrB,oBAAoB,EACpB,0BAA0B,EAC3B,MAAM,0BAA0B,CAAC;AAElC;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,eAAe,CAAC;IACxB,aAAa,EAAE,sBAAsB,CAAC;IACtC,YAAY,EAAE,qBAAqB,CAAC;IACpC,YAAY,EAAE,qBAAqB,CAAC;IACpC,WAAW,EAAE,oBAAoB,CAAC;IAClC,iBAAiB,EAAE,0BAA0B,CAAC;IAC9C,MAAM,EAAE,eAAe,CAAC;IACxB,KAAK,EAAE,cAAc,CAAC;IACtB,KAAK,EAAE,cAAc,CAAC;CACvB;AAED,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,OAAO,CAAC;IACd,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACtC,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,WAAW,EAAE,KAAK,CAAC,SAAS,CAAC;IAC7B,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,oBAAoB,CAAC,EACjB,SAAS,GACT,aAAa,GACb,SAAS,GACT,WAAW,GACX,OAAO,GACP,MAAM,CAAC;IACX,YAAY,CAAC,EAAE;QACb,WAAW,EAAE,MAAM,CAAC;QACpB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC;IAGF,UAAU,CAAC,EAAE,kBAAkB,CAAC;IAGhC,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC/B;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,IAAI,EACJ,YAAY,EACZ,KAAK,EACL,WAAW,EACX,SAAS,EACT,OAAe,EACf,WAAoB,EACpB,UAAiB,EACjB,oBAAoC,EACpC,YAAY,EACZ,UAAU,EACV,WAAW,GACZ,EAAE,wBAAwB,2CAkH1B"}
@@ -1 +1 @@
1
- {"version":3,"file":"TableHeader.d.ts","sourceRoot":"","sources":["../../src/components/TableHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAA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AAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,OAAO,CAAC,EAAE,OAAO,CAAC;IAGlB,UAAU,CAAC,EAAE,kBAAkB,CAAC;CACjC;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,iBAA2B,EAC3B,WAAgB,EAChB,cAAc,EACd,QAAQ,EACR,UAAiB,EACjB,MAAM,EACN,WAAW,EACX,aAAa,EACb,OAAe,EACf,UAAU,GACX,EAAE,gBAAgB,2CA8DlB"}
@@ -1 +1 @@
1
- {"version":3,"file":"TablePagination.d.ts","sourceRoot":"","sources":["../../src/components/TablePagination.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,eAAe,EACf,sBAAsB,EACtB,sBAAsB,EACtB,mBAAmB,EACnB,oBAAoB,EACrB,MAAM,0BAA0B,CAAC;AAElC;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,eAAe,CAAC;IACxB,MAAM,EAAE,eAAe,CAAC;IACxB,aAAa,EAAE,sBAAsB,CAAC;IACtC,aAAa,EAAE,sBAAsB,CAAC;IACtC,UAAU,EAAE,mBAAmB,CAAC;IAChC,WAAW,EAAE,oBAAoB,CAAC;CACnC;AAED,MAAM,WAAW,oBAAoB;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,YAAY,CAAC,EAAE,OAAO,CAAC;IAGvB,UAAU,CAAC,EAAE,sBAAsB,CAAC;CACrC;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,EAC9B,WAAW,EACX,QAAQ,EACR,KAAK,EACL,YAAY,EACZ,gBAAgB,EAChB,eAA8B,EAC9B,oBAA2B,EAC3B,SAAgB,EAChB,YAAoB,EACpB,UAAU,GACX,EAAE,oBAAoB,kDAyHtB"}
1
+ {"version":3,"file":"TablePagination.d.ts","sourceRoot":"","sources":["../../src/components/TablePagination.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,eAAe,EACf,eAAe,EACf,sBAAsB,EACtB,sBAAsB,EACtB,mBAAmB,EACnB,oBAAoB,EACrB,MAAM,0BAA0B,CAAC;AAElC;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,eAAe,CAAC;IACxB,MAAM,EAAE,eAAe,CAAC;IACxB,aAAa,EAAE,sBAAsB,CAAC;IACtC,aAAa,EAAE,sBAAsB,CAAC;IACtC,UAAU,EAAE,mBAAmB,CAAC;IAChC,WAAW,EAAE,oBAAoB,CAAC;CACnC;AAED,MAAM,WAAW,oBAAoB;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,YAAY,CAAC,EAAE,OAAO,CAAC;IAGvB,UAAU,CAAC,EAAE,sBAAsB,CAAC;CACrC;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,EAC9B,WAAW,EACX,QAAQ,EACR,KAAK,EACL,YAAY,EACZ,gBAAgB,EAChB,eAA8B,EAC9B,oBAA2B,EAC3B,SAAgB,EAChB,YAAoB,EACpB,UAAU,GACX,EAAE,oBAAoB,kDAiGtB"}
@@ -0,0 +1,40 @@
1
+ import { ButtonComponent, DropdownMenuComponent, DropdownMenuTriggerComponent, DropdownMenuContentComponent, DropdownMenuRadioGroupComponent, DropdownMenuRadioItemComponent } from '../types/component-types';
2
+ /**
3
+ * 主题选项
4
+ */
5
+ export interface ThemeOption {
6
+ value: string;
7
+ label: string;
8
+ icon: React.ReactNode;
9
+ }
10
+ /**
11
+ * UI 组件适配器接口
12
+ */
13
+ export interface ThemeSwitcherUIComponents {
14
+ DropdownMenu: DropdownMenuComponent;
15
+ DropdownMenuTrigger: DropdownMenuTriggerComponent;
16
+ DropdownMenuContent: DropdownMenuContentComponent;
17
+ DropdownMenuRadioGroup: DropdownMenuRadioGroupComponent;
18
+ DropdownMenuRadioItem: DropdownMenuRadioItemComponent;
19
+ Button: ButtonComponent;
20
+ }
21
+ export interface ThemeSwitcherProps {
22
+ value: string;
23
+ onValueChange: (value: string) => void;
24
+ themes?: ThemeOption[];
25
+ triggerVariant?: 'default' | 'destructive' | 'outline' | 'secondary' | 'ghost' | 'link';
26
+ triggerSize?: 'default' | 'sm' | 'lg' | 'icon';
27
+ triggerClassName?: string;
28
+ iconSize?: number;
29
+ showCurrentIcon?: boolean;
30
+ enableSSRHandling?: boolean;
31
+ triggerContent?: React.ReactNode;
32
+ components?: ThemeSwitcherUIComponents;
33
+ themeIcons?: Partial<Record<string, React.ReactNode>>;
34
+ }
35
+ /**
36
+ * 主题切换组件
37
+ * 需要通过 components prop 注入 UI 组件
38
+ */
39
+ export declare function ThemeSwitcher({ value, onValueChange, themes, triggerVariant, triggerSize, triggerClassName, iconSize, showCurrentIcon, enableSSRHandling, triggerContent, components, themeIcons, }: ThemeSwitcherProps): import("react/jsx-runtime").JSX.Element | null;
40
+ //# sourceMappingURL=ThemeSwitcher.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ThemeSwitcher.d.ts","sourceRoot":"","sources":["../../src/components/ThemeSwitcher.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,eAAe,EACf,qBAAqB,EACrB,4BAA4B,EAC5B,4BAA4B,EAC5B,+BAA+B,EAC/B,8BAA8B,EAC/B,MAAM,0BAA0B,CAAC;AAElC;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC,YAAY,EAAE,qBAAqB,CAAC;IACpC,mBAAmB,EAAE,4BAA4B,CAAC;IAClD,mBAAmB,EAAE,4BAA4B,CAAC;IAClD,sBAAsB,EAAE,+BAA+B,CAAC;IACxD,qBAAqB,EAAE,8BAA8B,CAAC;IACtD,MAAM,EAAE,eAAe,CAAC;CACzB;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,MAAM,CAAC,EAAE,WAAW,EAAE,CAAC;IACvB,cAAc,CAAC,EACX,SAAS,GACT,aAAa,GACb,SAAS,GACT,WAAW,GACX,OAAO,GACP,MAAM,CAAC;IACX,WAAW,CAAC,EAAE,SAAS,GAAG,IAAI,GAAG,IAAI,GAAG,MAAM,CAAC;IAC/C,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,cAAc,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACjC,UAAU,CAAC,EAAE,yBAAyB,CAAC;IAEvC,UAAU,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;CACvD;AAsED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,aAAa,EACb,MAAsB,EACtB,cAAwB,EACxB,WAAoB,EACpB,gBAAgB,EAChB,QAAa,EACb,eAAsB,EACtB,iBAAwB,EACxB,cAAc,EACd,UAAU,EACV,UAAU,GACX,EAAE,kBAAkB,kDA6EpB"}
@@ -0,0 +1,30 @@
1
+ import { DropdownMenuRadioGroupComponent, DropdownMenuRadioItemComponent } from '../types/component-types';
2
+ /**
3
+ * 主题选项
4
+ */
5
+ export interface ThemeOption {
6
+ value: string;
7
+ label: string;
8
+ icon: React.ReactNode;
9
+ }
10
+ export interface ThemeSwitcherContentProps {
11
+ value: string;
12
+ onValueChange: (value: string) => void;
13
+ themes?: ThemeOption[];
14
+ iconSize?: number;
15
+ components?: Pick<ThemeSwitcherContentUIComponents, 'DropdownMenuRadioGroup' | 'DropdownMenuRadioItem'>;
16
+ themeIcons?: Partial<Record<string, React.ReactNode>>;
17
+ }
18
+ /**
19
+ * UI 组件适配器接口(轻量版)
20
+ */
21
+ export interface ThemeSwitcherContentUIComponents {
22
+ DropdownMenuRadioGroup: DropdownMenuRadioGroupComponent;
23
+ DropdownMenuRadioItem: DropdownMenuRadioItemComponent;
24
+ }
25
+ /**
26
+ * 主题切换内容组件(轻量版)
27
+ * 可嵌入到其他 DropdownMenu 中使用
28
+ */
29
+ export declare function ThemeSwitcherContent({ value, onValueChange, themes, iconSize, components, themeIcons, }: ThemeSwitcherContentProps): import("react/jsx-runtime").JSX.Element;
30
+ //# sourceMappingURL=ThemeSwitcherContent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ThemeSwitcherContent.d.ts","sourceRoot":"","sources":["../../src/components/ThemeSwitcherContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,+BAA+B,EAC/B,8BAA8B,EAC/B,MAAM,0BAA0B,CAAC;AAElC;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC;CACvB;AAED,MAAM,WAAW,yBAAyB;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,MAAM,CAAC,EAAE,WAAW,EAAE,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,IAAI,CACf,gCAAgC,EAChC,wBAAwB,GAAG,uBAAuB,CACnD,CAAC;IAEF,UAAU,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;CACvD;AAED;;GAEG;AACH,MAAM,WAAW,gCAAgC;IAC/C,sBAAsB,EAAE,+BAA+B,CAAC;IACxD,qBAAqB,EAAE,8BAA8B,CAAC;CACvD;AAsED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,KAAK,EACL,aAAa,EACb,MAAsB,EACtB,QAAa,EACb,UAAU,EACV,UAAU,GACX,EAAE,yBAAyB,2CAqC3B"}
package/dist/index.c.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const oe=require("clsx"),ce=require("tailwind-merge"),ee=require("react");function ie(...a){return ce.twMerge(oe.clsx(a))}var Z={exports:{}},F={};/**
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ce=require("clsx"),ie=require("tailwind-merge"),q=require("react"),H=require("lucide-react");function ue(...n){return ie.twMerge(ce.clsx(n))}var ee={exports:{}},U={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.js
4
4
  *
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var te;function ue(){if(te)return F;te=1;var a=Symbol.for("react.transitional.element"),h=Symbol.for("react.fragment");function d(j,c,f){var x=null;if(f!==void 0&&(x=""+f),c.key!==void 0&&(x=""+c.key),"key"in c){f={};for(var o in c)o!=="key"&&(f[o]=c[o])}else f=c;return c=f.ref,{$$typeof:a,type:j,key:x,ref:c!==void 0?c:null,props:f}}return F.Fragment=h,F.jsx=d,F.jsxs=d,F}var W={};/**
9
+ */var se;function de(){if(se)return U;se=1;var n=Symbol.for("react.transitional.element"),m=Symbol.for("react.fragment");function c(x,a,i){var d=null;if(i!==void 0&&(d=""+i),a.key!==void 0&&(d=""+a.key),"key"in a){i={};for(var o in a)o!=="key"&&(i[o]=a[o])}else i=a;return a=i.ref,{$$typeof:n,type:x,key:d,ref:a!==void 0?a:null,props:i}}return U.Fragment=m,U.jsx=c,U.jsxs=c,U}var V={};/**
10
10
  * @license React
11
11
  * react-jsx-runtime.development.js
12
12
  *
@@ -14,10 +14,10 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var se;function de(){return se||(se=1,process.env.NODE_ENV!=="production"&&(function(){function a(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===K?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case S:return"Fragment";case D:return"Profiler";case R:return"StrictMode";case g:return"Suspense";case k:return"SuspenseList";case Q:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case O:return"Portal";case w:return e.displayName||"Context";case y:return(e._context.displayName||"Context")+".Consumer";case P:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Y:return t=e.displayName||null,t!==null?t:a(e.type)||"Memo";case L:t=e._payload,e=e._init;try{return a(e(t))}catch{}}return null}function h(e){return""+e}function d(e){try{h(e);var t=!1}catch{t=!0}if(t){t=console;var l=t.error,i=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return l.call(t,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",i),h(e)}}function j(e){if(e===S)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===L)return"<...>";try{var t=a(e);return t?"<"+t+">":"<...>"}catch{return"<...>"}}function c(){var e=z.A;return e===null?null:e.getOwner()}function f(){return Error("react-stack-top-frame")}function x(e){if(U.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return e.key!==void 0}function o(e,t){function l(){H||(H=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",t))}l.isReactWarning=!0,Object.defineProperty(e,"key",{get:l,configurable:!0})}function E(){var e=a(this.type);return J[e]||(J[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function m(e,t,l,i,M,I){var u=l.ref;return e={$$typeof:N,type:e,key:t,props:l,_owner:i},(u!==void 0?u:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:E}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:M}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:I}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function s(e,t,l,i,M,I){var u=t.children;if(u!==void 0)if(i)if(q(u)){for(i=0;i<u.length;i++)_(u[i]);Object.freeze&&Object.freeze(u)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else _(u);if(U.call(t,"key")){u=a(e);var C=Object.keys(t).filter(function(p){return p!=="key"});i=0<C.length?"{key: someKey, "+C.join(": ..., ")+": ...}":"{key: someKey}",G[u+i]||(C=0<C.length?"{"+C.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
17
+ */var ne;function fe(){return ne||(ne=1,process.env.NODE_ENV!=="production"&&(function(){function n(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===re?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case S:return"Fragment";case O:return"Profiler";case R:return"StrictMode";case E:return"Suspense";case g:return"SuspenseList";case L:return"Activity"}if(typeof r=="object")switch(typeof r.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),r.$$typeof){case M:return"Portal";case y:return r.displayName||"Context";case C:return(r._context.displayName||"Context")+".Consumer";case A:var s=r.render;return r=r.displayName,r||(r=s.displayName||s.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case _:return s=r.displayName||null,s!==null?s:n(r.type)||"Memo";case P:s=r._payload,r=r._init;try{return n(r(s))}catch{}}return null}function m(r){return""+r}function c(r){try{m(r);var s=!1}catch{s=!0}if(s){s=console;var u=s.error,h=typeof Symbol=="function"&&Symbol.toStringTag&&r[Symbol.toStringTag]||r.constructor.name||"Object";return u.call(s,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",h),m(r)}}function x(r){if(r===S)return"<>";if(typeof r=="object"&&r!==null&&r.$$typeof===P)return"<...>";try{var s=n(r);return s?"<"+s+">":"<...>"}catch{return"<...>"}}function a(){var r=Y.A;return r===null?null:r.getOwner()}function i(){return Error("react-stack-top-frame")}function d(r){if(G.call(r,"key")){var s=Object.getOwnPropertyDescriptor(r,"key").get;if(s&&s.isReactWarning)return!1}return r.key!==void 0}function o(r,s){function u(){X||(X=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",s))}u.isReactWarning=!0,Object.defineProperty(r,"key",{get:u,configurable:!0})}function w(){var r=n(this.type);return Z[r]||(Z[r]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),r=this.props.ref,r!==void 0?r:null}function f(r,s,u,h,$,W){var p=u.ref;return r={$$typeof:T,type:r,key:s,props:u,_owner:h},(p!==void 0?p:null)!==null?Object.defineProperty(r,"ref",{enumerable:!1,get:w}):Object.defineProperty(r,"ref",{enumerable:!1,value:null}),r._store={},Object.defineProperty(r._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(r,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(r,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:$}),Object.defineProperty(r,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:W}),Object.freeze&&(Object.freeze(r.props),Object.freeze(r)),r}function t(r,s,u,h,$,W){var p=s.children;if(p!==void 0)if(h)if(J(p)){for(h=0;h<p.length;h++)j(p[h]);Object.freeze&&Object.freeze(p)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else j(p);if(G.call(s,"key")){p=n(r);var D=Object.keys(s).filter(function(N){return N!=="key"});h=0<D.length?"{key: someKey, "+D.join(": ..., ")+": ...}":"{key: someKey}",Q[p+h]||(D=0<D.length?"{"+D.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
18
18
  let props = %s;
19
19
  <%s {...props} />
20
20
  React keys must be passed directly to JSX without using spread:
21
21
  let props = %s;
22
- <%s key={someKey} {...props} />`,i,u,C,u),G[u+i]=!0)}if(u=null,l!==void 0&&(d(l),u=""+l),x(t)&&(d(t.key),u=""+t.key),"key"in t){l={};for(var n in t)n!=="key"&&(l[n]=t[n])}else l=t;return u&&o(l,typeof e=="function"?e.displayName||e.name||"Unknown":e),m(e,u,l,c(),M,I)}function _(e){T(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===L&&(e._payload.status==="fulfilled"?T(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function T(e){return typeof e=="object"&&e!==null&&e.$$typeof===N}var b=ee,N=Symbol.for("react.transitional.element"),O=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),D=Symbol.for("react.profiler"),y=Symbol.for("react.consumer"),w=Symbol.for("react.context"),P=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),k=Symbol.for("react.suspense_list"),Y=Symbol.for("react.memo"),L=Symbol.for("react.lazy"),Q=Symbol.for("react.activity"),K=Symbol.for("react.client.reference"),z=b.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,U=Object.prototype.hasOwnProperty,q=Array.isArray,B=console.createTask?console.createTask:function(){return null};b={react_stack_bottom_frame:function(e){return e()}};var H,J={},V=b.react_stack_bottom_frame.bind(b,f)(),A=B(j(f)),G={};W.Fragment=S,W.jsx=function(e,t,l){var i=1e4>z.recentlyCreatedOwnerStacks++;return s(e,t,l,!1,i?Error("react-stack-top-frame"):V,i?B(j(e)):A)},W.jsxs=function(e,t,l){var i=1e4>z.recentlyCreatedOwnerStacks++;return s(e,t,l,!0,i?Error("react-stack-top-frame"):V,i?B(j(e)):A)}})()),W}var ne;function fe(){return ne||(ne=1,process.env.NODE_ENV==="production"?Z.exports=ue():Z.exports=de()),Z.exports}var r=fe();function me({data:a,loading:h=!1,columns:d,rowKey:j,emptyText:c="暂无数据",searchActiveEmptyText:f="未找到匹配的记录",header:x,pagination:o,rowClassName:E,onRow:m,actions:s,components:_,renderCard:T,renderTable:b,renderActions:N}){var u,C;if(!_)return r.jsxs("div",{className:"p-4 text-center text-destructive",children:["错误:请通过 components prop 注入 UI 组件",r.jsx("br",{}),r.jsx("code",{className:"text-sm",children:'import { Card, Table, Button, ... } from "@/components/ui"'})]});const{Card:O,CardContent:S,CardFooter:R,Table:D,TableBody:y,TableCell:w,TableHead:P,TableHeader:g,TableRow:k,Button:Y,DropdownMenu:L,DropdownMenuTrigger:Q,DropdownMenuContent:K,DropdownMenuItem:z,DropdownMenuSeparator:U,Skeleton:q,TableHeaderComponent:B,TablePaginationComponent:H}=_,J=(n,p)=>{if(typeof j=="function")return j(n);const v=n[j];return v!=null?String(v):`row-${p}`},V=!!(x!=null&&x.searchValue&&x.searchValue.trim().length>0),A=!!(s!=null&&s.render||(u=s==null?void 0:s.items)!=null&&u.length),G=(s==null?void 0:s.mode)??((C=s==null?void 0:s.items)!=null&&C.length?"collapsed":"expanded"),e=n=>n.separator===!0,t=(n,p)=>!s||!A?null:G==="collapsed"&&s.items&&s.items.length>0?r.jsxs(L,{children:[r.jsx(Q,{asChild:!0,children:r.jsx(Y,{variant:"ghost",className:"h-8 w-8 p-0","aria-label":"打开行操作菜单",children:r.jsxs("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[r.jsx("circle",{cx:"12",cy:"12",r:"1"}),r.jsx("circle",{cx:"12",cy:"5",r:"1"}),r.jsx("circle",{cx:"12",cy:"19",r:"1"})]})})}),r.jsx(K,{align:"end",children:s.items.map((v,X)=>e(v)?r.jsx(U,{},`separator-${X}`):r.jsxs(z,{onClick:()=>v.onClick(n,p),className:v.className,children:[v.icon&&r.jsx("span",{className:"mr-2 h-4 w-4",children:v.icon}),v.label]},`action-${X}`))})]}):s.render?s.render(n,p):null,l=()=>r.jsx(g,{children:r.jsxs(k,{className:"bg-muted/50 hover:bg-muted/50",children:[d.map(n=>r.jsx(P,{className:`font-semibold text-foreground ${n.align==="center"?"text-center":n.align==="right"?"text-right":"text-left"}`,style:{width:n.width},children:n.title},String(n.key))),A&&r.jsx(P,{className:"text-right font-semibold text-foreground",children:(s==null?void 0:s.title)||"操作"})]})}),i=()=>h?r.jsx(y,{children:Array.from({length:5}).map((n,p)=>r.jsxs(k,{children:[d.map(v=>r.jsx(w,{style:{width:v.width},className:v.align==="center"?"text-center":v.align==="right"?"text-right":"",children:r.jsx(q,{className:"h-4 w-full"})},String(v.key))),A&&r.jsx(w,{children:r.jsx(q,{className:"ml-auto h-4 w-8"})})]},p))}):a.length===0?r.jsx(y,{children:r.jsx(k,{children:r.jsx(w,{colSpan:d.length+(A?1:0),className:"py-8 text-center text-muted-foreground",children:V?f:c})})}):r.jsx(y,{children:a.map((n,p)=>{const v=J(n,p),X=m==null?void 0:m(n,p),le=E==null?void 0:E(n,p);return r.jsxs(k,{className:`${le||""} hover:bg-muted/50`,...X,children:[d.map($=>{const re=n[$.key],ae=$.render?$.render(re,n,p):re;return r.jsx(w,{className:$.align==="center"?"text-center":$.align==="right"?"text-right":"",children:ae},String($.key))}),A&&r.jsx(w,{className:"text-right",children:N?N(n,p):t(n,p)})]},v)})}),M=n=>r.jsxs(O,{children:[x&&r.jsx("div",{className:"p-6 pb-0",children:r.jsx(B,{...x})}),r.jsx(S,{className:"p-0",children:n}),(o==null?void 0:o.show)!==!1&&o&&r.jsx(R,{className:"border-t py-4",children:r.jsx(H,{currentPage:o.currentPage,pageSize:o.pageSize,total:o.total,onPageChange:o.onPageChange,onPageSizeChange:o.onPageSizeChange,pageSizeOptions:o.pageSizeOptions,showPageSizeSelector:o.showPageSizeSelector,showTotal:o.showTotal,searchActive:V})})]}),I=(n,p)=>r.jsxs(D,{children:[n,p]});return T?T(b?b(l(),i()):I(l(),i())):M(b?b(l(),i()):I(l(),i()))}function xe({open:a,onOpenChange:h,title:d,description:j,onConfirm:c,loading:f=!1,confirmText:x="确认删除",cancelText:o="取消",confirmButtonVariant:E="destructive",verification:m,components:s}){const[_,T]=ee.useState("");if(ee.useEffect(()=>{a&&T("")},[a,m==null?void 0:m.targetValue]),!s)return r.jsx("div",{className:"p-4 text-center text-destructive",children:"错误:请通过 components prop 注入 UI 组件"});const{Dialog:b,DialogContent:N,DialogHeader:O,DialogFooter:S,DialogTitle:R,DialogDescription:D,Button:y,Input:w,Label:P}=s,g=m?_!==m.targetValue:!1,k=()=>{g||c()};return r.jsx(b,{open:a,onOpenChange:h,children:r.jsxs(N,{children:[r.jsxs(O,{children:[r.jsx(R,{asChild:!0,children:r.jsx("div",{className:"flex items-center gap-2",children:d})}),r.jsx(D,{asChild:!0,children:r.jsx("div",{children:j})})]}),m&&r.jsx("div",{className:"space-y-4 py-2",children:r.jsxs("div",{className:"space-y-2",children:[r.jsx(P,{htmlFor:"confirm-input",children:m.label||"请输入以确认"}),r.jsx(w,{id:"confirm-input",value:_,onChange:Y=>T(Y.target.value),placeholder:m.placeholder,disabled:f})]})}),r.jsxs(S,{children:[r.jsx(y,{variant:"outline",onClick:()=>h(!1),disabled:f,children:o}),r.jsxs(y,{variant:E,onClick:k,disabled:g||f,children:[f&&r.jsxs("svg",{className:"mr-2 h-4 w-4 animate-spin",fill:"none",viewBox:"0 0 24 24",children:[r.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),r.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),x]})]})]})})}function he({title:a,searchPlaceholder:h="搜索...",searchValue:d="",onSearchChange:j,onSearch:c,showSearch:f=!0,action:x,actionLabel:o,onActionClick:E,loading:m=!1,components:s}){if(!s)return r.jsx("div",{className:"p-4 text-center text-destructive",children:"错误:请通过 components prop 注入 UI 组件"});const{Input:_,Button:T}=s,b=N=>{N.key==="Enter"&&c&&c()};return r.jsxs("div",{className:"flex flex-col gap-4 p-1",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("div",{className:"text-lg font-semibold leading-none tracking-tight",children:a}),r.jsxs("div",{className:"flex items-center gap-2",children:[x&&r.jsx("div",{className:"flex items-center gap-2",children:x}),!x&&o&&E&&r.jsxs(T,{onClick:E,disabled:m,size:"sm",children:[r.jsx("svg",{className:"mr-2 h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})}),o]})]})]}),f&&r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs("div",{className:"relative max-w-sm flex-1",children:[r.jsx("svg",{className:"absolute left-2 top-2.5 h-4 w-4 text-muted-foreground",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),r.jsx(_,{placeholder:h,value:d,onChange:N=>j==null?void 0:j(N.target.value),onKeyPress:b,className:"h-9 pl-8",disabled:m})]}),c&&r.jsx(T,{onClick:c,disabled:m,variant:"secondary",size:"sm",children:"搜索"})]})]})}function je({currentPage:a,pageSize:h,total:d,onPageChange:j,onPageSizeChange:c,pageSizeOptions:f=[10,20,50],showPageSizeSelector:x=!0,showTotal:o=!0,searchActive:E=!1,components:m}){if(!m)return r.jsx("div",{className:"p-4 text-center text-destructive",children:"错误:请通过 components prop 注入 UI 组件"});const{Button:s,Select:_,SelectTrigger:T,SelectContent:b,SelectItem:N,SelectValue:O}=m,S=Math.ceil(d/h),R=Math.max(S,1),D=a*h+1,y=Math.min((a+1)*h,d),w=Array.from(new Set([...f,h])).sort((g,k)=>g-k),P=x&&!!c;return d===0?null:r.jsxs("div",{className:"flex w-full items-center justify-between",children:[o&&r.jsx("div",{className:"text-sm text-muted-foreground",children:E?`找到 ${d} 条匹配记录`:d>0?`显示 ${D} - ${y} 条,共 ${d} 条记录`:"暂无数据"}),r.jsxs("div",{className:"flex items-center space-x-2",children:[P&&r.jsxs("div",{className:"mr-2 flex items-center gap-2",children:[r.jsx("span",{className:"text-sm text-muted-foreground",children:"每页"}),r.jsxs(_,{value:String(h),onValueChange:g=>{const k=Number(g);Number.isNaN(k)||k===h||!c||c(k)},children:[r.jsx(T,{className:"h-8 w-[90px]",children:r.jsx(O,{})}),r.jsx(b,{children:w.map(g=>r.jsx(N,{value:String(g),children:g},g))})]}),r.jsx("span",{className:"text-sm text-muted-foreground",children:"条"})]}),r.jsxs("div",{className:"mr-4 text-sm text-muted-foreground",children:["第 ",a+1," 页,共 ",R," 页"]}),r.jsxs(s,{variant:"outline",size:"sm",onClick:()=>j(a-1),disabled:a===0||R<=1,children:[r.jsx("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})}),"上一页"]}),r.jsxs(s,{variant:"outline",size:"sm",onClick:()=>j(a+1),disabled:a>=R-1||R<=1,children:["下一页",r.jsx("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})]})]})]})}exports.DataTable=me;exports.DeleteConfirmDialog=xe;exports.TableHeader=he;exports.TablePagination=je;exports.cn=ie;
22
+ <%s key={someKey} {...props} />`,h,p,D,p),Q[p+h]=!0)}if(p=null,u!==void 0&&(c(u),p=""+u),d(s)&&(c(s.key),p=""+s.key),"key"in s){u={};for(var l in s)l!=="key"&&(u[l]=s[l])}else u=s;return p&&o(u,typeof r=="function"?r.displayName||r.name||"Unknown":r),f(r,p,u,a(),$,W)}function j(r){b(r)?r._store&&(r._store.validated=1):typeof r=="object"&&r!==null&&r.$$typeof===P&&(r._payload.status==="fulfilled"?b(r._payload.value)&&r._payload.value._store&&(r._payload.value._store.validated=1):r._store&&(r._store.validated=1))}function b(r){return typeof r=="object"&&r!==null&&r.$$typeof===T}var v=q,T=Symbol.for("react.transitional.element"),M=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),O=Symbol.for("react.profiler"),C=Symbol.for("react.consumer"),y=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),E=Symbol.for("react.suspense"),g=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),L=Symbol.for("react.activity"),re=Symbol.for("react.client.reference"),Y=v.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G=Object.prototype.hasOwnProperty,J=Array.isArray,F=console.createTask?console.createTask:function(){return null};v={react_stack_bottom_frame:function(r){return r()}};var X,Z={},z=v.react_stack_bottom_frame.bind(v,i)(),I=F(x(i)),Q={};V.Fragment=S,V.jsx=function(r,s,u){var h=1e4>Y.recentlyCreatedOwnerStacks++;return t(r,s,u,!1,h?Error("react-stack-top-frame"):z,h?F(x(r)):I)},V.jsxs=function(r,s,u){var h=1e4>Y.recentlyCreatedOwnerStacks++;return t(r,s,u,!0,h?Error("react-stack-top-frame"):z,h?F(x(r)):I)}})()),V}var le;function xe(){return le||(le=1,process.env.NODE_ENV==="production"?ee.exports=de():ee.exports=fe()),ee.exports}var e=xe();function he({data:n,loading:m=!1,columns:c,rowKey:x,emptyText:a="暂无数据",searchActiveEmptyText:i="未找到匹配的记录",header:d,pagination:o,rowClassName:w,onRow:f,actions:t,components:j,renderCard:b,renderTable:v,renderActions:T}){var p,D;if(!j)return e.jsxs("div",{className:"p-4 text-center text-destructive",children:["错误:请通过 components prop 注入 UI 组件",e.jsx("br",{}),e.jsx("code",{className:"text-sm",children:'import { Card, Table, Button, ... } from "@/components/ui"'})]});const{Card:M,CardContent:S,CardFooter:R,Table:O,TableBody:C,TableCell:y,TableHead:A,TableHeader:E,TableRow:g,Button:_,DropdownMenu:P,DropdownMenuTrigger:L,DropdownMenuContent:re,DropdownMenuItem:Y,DropdownMenuSeparator:G,Skeleton:J,TableHeaderComponent:F,TablePaginationComponent:X}=j,Z=(l,N)=>{if(typeof x=="function")return x(l);const k=l[x];return k!=null?String(k):`row-${N}`},z=!!(d!=null&&d.searchValue&&d.searchValue.trim().length>0),I=!!(t!=null&&t.render||(p=t==null?void 0:t.items)!=null&&p.length),Q=(t==null?void 0:t.mode)??((D=t==null?void 0:t.items)!=null&&D.length?"collapsed":"expanded"),r=l=>l.separator===!0,s=(l,N)=>!t||!I?null:Q==="collapsed"&&t.items&&t.items.length>0?e.jsxs(P,{children:[e.jsx(L,{asChild:!0,children:e.jsx(_,{variant:"ghost",className:"h-8 w-8 p-0","aria-label":"打开行操作菜单",children:e.jsx(H.MoreVertical,{className:"h-4 w-4"})})}),e.jsx(re,{align:"end",children:t.items.map((k,K)=>r(k)?e.jsx(G,{},`separator-${K}`):e.jsxs(Y,{onClick:()=>k.onClick(l,N),className:k.className,children:[k.icon&&e.jsx("span",{className:"mr-2 h-4 w-4",children:k.icon}),k.label]},`action-${K}`))})]}):t.render?t.render(l,N):null,u=()=>e.jsx(E,{children:e.jsxs(g,{className:"bg-muted/50 hover:bg-muted/50",children:[c.map(l=>e.jsx(A,{className:`font-semibold text-foreground ${l.align==="center"?"text-center":l.align==="right"?"text-right":"text-left"}`,style:{width:l.width},children:l.title},String(l.key))),I&&e.jsx(A,{className:"text-right font-semibold text-foreground",children:(t==null?void 0:t.title)||"操作"})]})}),h=()=>m?e.jsx(C,{children:Array.from({length:5}).map((l,N)=>e.jsxs(g,{children:[c.map(k=>e.jsx(y,{style:{width:k.width},className:k.align==="center"?"text-center":k.align==="right"?"text-right":"",children:e.jsx(J,{className:"h-4 w-full"})},String(k.key))),I&&e.jsx(y,{children:e.jsx(J,{className:"ml-auto h-4 w-8"})})]},N))}):n.length===0?e.jsx(C,{children:e.jsx(g,{children:e.jsx(y,{colSpan:c.length+(I?1:0),className:"py-8 text-center text-muted-foreground",children:z?i:a})})}):e.jsx(C,{children:n.map((l,N)=>{const k=Z(l,N),K=f==null?void 0:f(l,N),ae=w==null?void 0:w(l,N);return e.jsxs(g,{className:`${ae||""} hover:bg-muted/50`,...K,children:[c.map(B=>{const te=l[B.key],oe=B.render?B.render(te,l,N):te;return e.jsx(y,{className:B.align==="center"?"text-center":B.align==="right"?"text-right":"",children:oe},String(B.key))}),I&&e.jsx(y,{className:"text-right",children:T?T(l,N):s(l,N)})]},k)})}),$=l=>e.jsxs(M,{children:[d&&e.jsx("div",{className:"p-6 pb-0",children:e.jsx(F,{...d})}),e.jsx(S,{className:"p-0",children:l}),(o==null?void 0:o.show)!==!1&&o&&e.jsx(R,{className:"border-t py-4",children:e.jsx(X,{currentPage:o.currentPage,pageSize:o.pageSize,total:o.total,onPageChange:o.onPageChange,onPageSizeChange:o.onPageSizeChange,pageSizeOptions:o.pageSizeOptions,showPageSizeSelector:o.showPageSizeSelector,showTotal:o.showTotal,searchActive:z})})]}),W=(l,N)=>e.jsxs(O,{children:[l,N]});return b?b(v?v(u(),h()):W(u(),h())):$(v?v(u(),h()):W(u(),h()))}function me({open:n,onOpenChange:m,title:c,description:x,onConfirm:a,loading:i=!1,confirmText:d="确认删除",cancelText:o="取消",confirmButtonVariant:w="destructive",verification:f,components:t,loadingIcon:j}){const[b,v]=q.useState("");if(q.useEffect(()=>{n&&v("")},[n,f==null?void 0:f.targetValue]),!t)return e.jsx("div",{className:"p-4 text-center text-destructive",children:"错误:请通过 components prop 注入 UI 组件"});const{Dialog:T,DialogContent:M,DialogHeader:S,DialogFooter:R,DialogTitle:O,DialogDescription:C,Button:y,Input:A,Label:E}=t,g=f?b!==f.targetValue:!1,_=()=>{g||a()};return e.jsx(T,{open:n,onOpenChange:m,children:e.jsxs(M,{children:[e.jsxs(S,{children:[e.jsx(O,{asChild:!0,children:e.jsx("div",{className:"flex items-center gap-2",children:c})}),e.jsx(C,{asChild:!0,children:e.jsx("div",{children:x})})]}),f&&e.jsx("div",{className:"space-y-4 py-2",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx(E,{htmlFor:"confirm-input",children:f.label||"请输入以确认"}),e.jsx(A,{id:"confirm-input",value:b,onChange:P=>v(P.target.value),placeholder:f.placeholder,disabled:i})]})}),e.jsxs(R,{children:[e.jsx(y,{variant:"outline",onClick:()=>m(!1),disabled:i,children:o}),e.jsxs(y,{variant:w,onClick:_,disabled:g||i,children:[i&&e.jsx("span",{className:"mr-2",children:j||e.jsxs("svg",{className:"h-4 w-4 animate-spin",fill:"none",viewBox:"0 0 24 24",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}),d]})]})]})})}function pe({title:n,searchPlaceholder:m="搜索...",searchValue:c="",onSearchChange:x,onSearch:a,showSearch:i=!0,action:d,actionLabel:o,onActionClick:w,loading:f=!1,components:t}){if(!t)return e.jsx("div",{className:"p-4 text-center text-destructive",children:"错误:请通过 components prop 注入 UI 组件"});const{Input:j,Button:b}=t,v=T=>{T.key==="Enter"&&a&&a()};return e.jsxs("div",{className:"flex flex-col gap-4 p-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{className:"text-lg font-semibold leading-none tracking-tight",children:n}),e.jsxs("div",{className:"flex items-center gap-2",children:[d&&e.jsx("div",{className:"flex items-center gap-2",children:d}),!d&&o&&w&&e.jsxs(b,{onClick:w,disabled:f,size:"sm",children:[e.jsx(H.Plus,{className:"mr-2 h-4 w-4"}),o]})]})]}),i&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"relative max-w-sm flex-1",children:[e.jsx(H.Search,{className:"absolute left-2 top-2.5 h-4 w-4 text-muted-foreground"}),e.jsx(j,{placeholder:m,value:c,onChange:T=>x==null?void 0:x(T.target.value),onKeyPress:v,className:"h-9 pl-8",disabled:f})]}),a&&e.jsx(b,{onClick:a,disabled:f,variant:"secondary",size:"sm",children:"搜索"})]})]})}function je({currentPage:n,pageSize:m,total:c,onPageChange:x,onPageSizeChange:a,pageSizeOptions:i=[10,20,50],showPageSizeSelector:d=!0,showTotal:o=!0,searchActive:w=!1,components:f}){if(!f)return e.jsx("div",{className:"p-4 text-center text-destructive",children:"错误:请通过 components prop 注入 UI 组件"});const{Button:t,Select:j,SelectTrigger:b,SelectContent:v,SelectItem:T,SelectValue:M}=f,S=Math.ceil(c/m),R=Math.max(S,1),O=n*m+1,C=Math.min((n+1)*m,c),y=Array.from(new Set([...i,m])).sort((E,g)=>E-g),A=d&&!!a;return c===0?null:e.jsxs("div",{className:"flex w-full items-center justify-between",children:[o&&e.jsx("div",{className:"text-sm text-muted-foreground",children:w?`找到 ${c} 条匹配记录`:c>0?`显示 ${O} - ${C} 条,共 ${c} 条记录`:"暂无数据"}),e.jsxs("div",{className:"flex items-center space-x-2",children:[A&&e.jsxs("div",{className:"mr-2 flex items-center gap-2",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"每页"}),e.jsxs(j,{value:String(m),onValueChange:E=>{const g=Number(E);Number.isNaN(g)||g===m||!a||a(g)},children:[e.jsx(b,{className:"h-8 w-[90px]",children:e.jsx(M,{})}),e.jsx(v,{children:y.map(E=>e.jsx(T,{value:String(E),children:E},E))})]}),e.jsx("span",{className:"text-sm text-muted-foreground",children:"条"})]}),e.jsxs("div",{className:"mr-4 text-sm text-muted-foreground",children:["第 ",n+1," 页,共 ",R," 页"]}),e.jsxs(t,{variant:"outline",size:"sm",onClick:()=>x(n-1),disabled:n===0||R<=1,children:[e.jsx(H.ChevronLeft,{className:"h-4 w-4"}),"上一页"]}),e.jsxs(t,{variant:"outline",size:"sm",onClick:()=>x(n+1),disabled:n>=R-1||R<=1,children:["下一页",e.jsx(H.ChevronRight,{className:"h-4 w-4"})]})]})]})}const ve=[{value:"light",label:"浅色",icon:e.jsxs("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",strokeWidth:"2"}),e.jsx("path",{className:"opacity-75",d:"M12 2v2m0 16v2M4.93 4.93l1.41 1.41m11.32 11.32l1.41 1.41M2 12h2m16 0h2M6.34 17.66l-1.41 1.41M19.07 4.93l-1.41 1.41",strokeWidth:"2",strokeLinecap:"round"})]})},{value:"dark",label:"深色",icon:e.jsx("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{d:"M21 12.79A9 9 0 1111.21 3 7 7 0 0021 12.79z",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},{value:"system",label:"跟随系统",icon:e.jsxs("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:[e.jsx("rect",{x:"2",y:"3",width:"20",height:"14",rx:"2",ry:"2",strokeWidth:"2"}),e.jsx("path",{d:"M8 21h8m-4-4v4",strokeWidth:"2",strokeLinecap:"round"})]})}];function be({value:n,onValueChange:m,themes:c=ve,triggerVariant:x="ghost",triggerSize:a="icon",triggerClassName:i,iconSize:d=16,showCurrentIcon:o=!0,enableSSRHandling:w=!0,triggerContent:f,components:t,themeIcons:j}){const[b,v]=q.useState(!1);if(q.useEffect(()=>{v(!0)},[]),w&&!b)return null;if(!t)return e.jsx("div",{className:"p-4 text-center text-destructive",children:"错误:请通过 components prop 注入 UI 组件"});const{DropdownMenu:T,DropdownMenuTrigger:M,DropdownMenuContent:S,DropdownMenuRadioGroup:R,DropdownMenuRadioItem:O,Button:C}=t,y=_=>{if(j&&j[_])return j[_];const P=c.find(L=>L.value===_);return P==null?void 0:P.icon},A=y(n),E=o?A:null,g=d?{width:d,height:d}:{};return e.jsxs(T,{children:[e.jsx(M,{asChild:!0,children:e.jsx(C,{variant:x,size:a,className:i,children:f||e.jsx("span",{style:g,className:"inline-flex items-center justify-center",children:E})})}),e.jsx(S,{children:e.jsx(R,{value:n,onValueChange:m,children:c.map(_=>e.jsxs(O,{value:_.value,children:[e.jsx("span",{className:"mr-2 inline-flex items-center",children:y(_.value)}),e.jsx("span",{children:_.label})]},_.value))})})]})}const ge=[{value:"light",label:"浅色",icon:e.jsxs("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",strokeWidth:"2"}),e.jsx("path",{className:"opacity-75",d:"M12 2v2m0 16v2M4.93 4.93l1.41 1.41m11.32 11.32l1.41 1.41M2 12h2m16 0h2M6.34 17.66l-1.41 1.41M19.07 4.93l-1.41 1.41",strokeWidth:"2",strokeLinecap:"round"})]})},{value:"dark",label:"深色",icon:e.jsx("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{d:"M21 12.79A9 9 0 1111.21 3 7 7 0 0021 12.79z",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},{value:"system",label:"跟随系统",icon:e.jsxs("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:[e.jsx("rect",{x:"2",y:"3",width:"20",height:"14",rx:"2",ry:"2",strokeWidth:"2"}),e.jsx("path",{d:"M8 21h8m-4-4v4",strokeWidth:"2",strokeLinecap:"round"})]})}];function Ne({value:n,onValueChange:m,themes:c=ge,iconSize:x=16,components:a,themeIcons:i}){if(!a)return e.jsx("div",{className:"p-4 text-center text-destructive",children:"错误:请通过 components prop 注入 UI 组件"});const{DropdownMenuRadioGroup:d,DropdownMenuRadioItem:o}=a,w=t=>{if(i&&i[t])return i[t];const j=c.find(b=>b.value===t);return j==null?void 0:j.icon},f=x?{width:x,height:x}:{};return e.jsx(d,{value:n,onValueChange:m,children:c.map(t=>e.jsxs(o,{value:t.value,children:[e.jsx("span",{className:"mr-2 inline-flex items-center",style:f,children:w(t.value)}),e.jsx("span",{children:t.label})]},t.value))})}exports.DataTable=he;exports.DeleteConfirmDialog=me;exports.TableHeader=pe;exports.TablePagination=je;exports.ThemeSwitcher=be;exports.ThemeSwitcherContent=Ne;exports.cn=ue;
23
23
  //# sourceMappingURL=index.c.js.map