@pactor-app/ui 1.7.0 → 1.9.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/dist/{chunk-PMYLC26E.js → chunk-KUFQSYTS.js} +82 -38
- package/dist/{chunk-ZM3WJZZ7.js → chunk-PECP7DJB.js} +1 -1
- package/dist/{chunk-7KC6DMKH.js → chunk-S3SMCICK.js} +10 -3
- package/dist/{chunk-FJPRXEKQ.js → chunk-TAJXMOEX.js} +2 -2
- package/dist/{chunk-L4Z7MNYY.js → chunk-VM4FESQB.js} +16 -2
- package/dist/{chunk-E2TD6JD2.js → chunk-VT5XP4U4.js} +29 -10
- package/dist/components/index.cjs +459 -384
- package/dist/components/index.d.cts +21 -7
- package/dist/components/index.d.ts +21 -7
- package/dist/components/index.js +4 -4
- package/dist/index.cjs +481 -399
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +6 -6
- package/dist/interaction/index.cjs +10 -3
- package/dist/interaction/index.d.cts +3 -1
- package/dist/interaction/index.d.ts +3 -1
- package/dist/interaction/index.js +1 -1
- package/dist/layout/index.cjs +16 -2
- package/dist/layout/index.js +3 -3
- package/dist/{typography-DsGdDBc2.d.cts → typography-BYDh5oku.d.cts} +14 -1
- package/dist/{typography-DsGdDBc2.d.ts → typography-BYDh5oku.d.ts} +14 -1
- package/dist/ui/index.cjs +44 -11
- package/dist/ui/index.d.cts +10 -14
- package/dist/ui/index.d.ts +10 -14
- package/dist/ui/index.js +2 -2
- package/package.json +5 -5
- package/styles.css +57 -27
|
@@ -2,8 +2,8 @@ import { ComponentRegistry } from '@pactor-app/runtime';
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { CSSProperties, ReactNode, ReactElement } from 'react';
|
|
4
4
|
import { DslNode, DslChildren } from '@pactor-app/core';
|
|
5
|
+
import { i as CardRounded, t as toggleVariants, h as typographyVariants } from '../typography-BYDh5oku.cjs';
|
|
5
6
|
import { LucideIcon } from 'lucide-react';
|
|
6
|
-
import { t as toggleVariants, b as typographyVariants } from '../typography-DsGdDBc2.cjs';
|
|
7
7
|
import { VariantProps } from 'class-variance-authority';
|
|
8
8
|
import 'class-variance-authority/types';
|
|
9
9
|
import '@base-ui/react/toggle';
|
|
@@ -41,13 +41,20 @@ interface AlertProps {
|
|
|
41
41
|
description?: string;
|
|
42
42
|
/** 变体,默认 info */
|
|
43
43
|
variant?: AlertVariant;
|
|
44
|
+
/** 是否显示图标;true 时按 variant 显示对应默认图标 */
|
|
45
|
+
showIcon?: boolean;
|
|
46
|
+
/** 自定义图标名(Icon 白名单,kebab-case / PascalCase 均可);提供时隐含 showIcon */
|
|
47
|
+
icon?: string;
|
|
44
48
|
/** 通用:根节点 class(与内置样式合并) */
|
|
45
49
|
className?: string;
|
|
46
50
|
/** 通用:根节点内联样式 */
|
|
47
51
|
style?: CSSProperties;
|
|
48
52
|
}
|
|
49
|
-
/**
|
|
50
|
-
|
|
53
|
+
/**
|
|
54
|
+
* Alert 适配器(shadcn kit):message → AlertTitle,description → AlertDescription;
|
|
55
|
+
* `showIcon` / `icon` 渲染前缀图标(vendored Alert 的 has-[>svg] 栅格自动让出图标列)
|
|
56
|
+
*/
|
|
57
|
+
declare function Alert({ message, description, variant, showIcon, icon, className, style, }: AlertProps): React.JSX.Element;
|
|
51
58
|
|
|
52
59
|
interface AlertDialogProps {
|
|
53
60
|
/** 标题 */
|
|
@@ -202,6 +209,9 @@ interface InputProps {
|
|
|
202
209
|
type?: 'text' | 'password';
|
|
203
210
|
placeholder?: string;
|
|
204
211
|
disabled?: boolean;
|
|
212
|
+
/** 值为非空时显示清除按钮,点击清空当前值;开启后独立渲染的
|
|
213
|
+
* className/style 挂控件包裹节点(含清除按钮),未开启时保持挂控件本身 */
|
|
214
|
+
allowClear?: boolean;
|
|
205
215
|
/** 输入事件,传出 string 值(非原生 event,设计决策 D2) */
|
|
206
216
|
onChange?: (value: string) => void;
|
|
207
217
|
/** 通用:根节点 class(Form 内为 form-item 容器,独立渲染时为控件本身) */
|
|
@@ -216,7 +226,7 @@ interface InputProps {
|
|
|
216
226
|
* 表单项为去原语化结构(design D3):`<div data-slot="form-item">` +
|
|
217
227
|
* `<label htmlFor>` 与控件 `useId` 关联。
|
|
218
228
|
*/
|
|
219
|
-
declare function Input({ name, label, rules, value, type, placeholder, disabled, onChange, className, style, }: InputProps): React.JSX.Element;
|
|
229
|
+
declare function Input({ name, label, rules, value, type, placeholder, disabled, allowClear, onChange, className, style, }: InputProps): React.JSX.Element;
|
|
220
230
|
|
|
221
231
|
interface CalendarProps {
|
|
222
232
|
/** 字段名;在 Form 内声明 name 即自动成为表单项 */
|
|
@@ -249,14 +259,16 @@ interface CardProps {
|
|
|
249
259
|
title?: string;
|
|
250
260
|
/** 是否有边框,默认 true(false 去边框与阴影) */
|
|
251
261
|
bordered?: boolean;
|
|
262
|
+
/** 圆角档位,默认 'lg'(即 --radius 基准值) */
|
|
263
|
+
rounded?: CardRounded;
|
|
252
264
|
/** 通用:根节点 class(与内置样式合并) */
|
|
253
265
|
className?: string;
|
|
254
266
|
/** 通用:根节点内联样式(布局逃逸口,如 `{ flex: 1 }`) */
|
|
255
267
|
style?: CSSProperties;
|
|
256
268
|
children?: ReactNode;
|
|
257
269
|
}
|
|
258
|
-
/** Card 适配器(shadcn kit):可选标题 + 边框开关(bordered=false
|
|
259
|
-
declare function Card({ title, bordered, className, style, children }: CardProps): React.JSX.Element;
|
|
270
|
+
/** Card 适配器(shadcn kit):可选标题 + 边框开关(bordered=false 去边框与阴影)+ 圆角档位 */
|
|
271
|
+
declare function Card({ title, bordered, rounded, className, style, children }: CardProps): React.JSX.Element;
|
|
260
272
|
|
|
261
273
|
/** 轮播图片项 */
|
|
262
274
|
interface CarouselImage {
|
|
@@ -1665,6 +1677,8 @@ interface TabsProps {
|
|
|
1665
1677
|
items?: TabItem[];
|
|
1666
1678
|
/** 当前激活页签 key(可绑表达式) */
|
|
1667
1679
|
activeKey?: string;
|
|
1680
|
+
/** 页签栏样式:default 胶囊(缺省)/ line 下划线 */
|
|
1681
|
+
variant?: 'default' | 'line';
|
|
1668
1682
|
/** 页签切换事件,传出新激活的 key */
|
|
1669
1683
|
onChange?: (key: string) => void;
|
|
1670
1684
|
/** 通用:根节点 class(与内置样式合并) */
|
|
@@ -1677,7 +1691,7 @@ interface TabsProps {
|
|
|
1677
1691
|
* 基于 vendored shadcn Tabs(@base-ui/react),每个 pane 的内容经
|
|
1678
1692
|
* renderChildren 渲染;未传 activeKey 时缺省激活第一个页签。
|
|
1679
1693
|
*/
|
|
1680
|
-
declare function Tabs({ items, activeKey, onChange, className, style }: TabsProps): React.JSX.Element;
|
|
1694
|
+
declare function Tabs({ items, activeKey, variant, onChange, className, style }: TabsProps): React.JSX.Element;
|
|
1681
1695
|
|
|
1682
1696
|
/** DSL Text 语义类型 */
|
|
1683
1697
|
type TextType = 'default' | 'secondary' | 'success' | 'warning' | 'danger';
|
|
@@ -2,8 +2,8 @@ import { ComponentRegistry } from '@pactor-app/runtime';
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { CSSProperties, ReactNode, ReactElement } from 'react';
|
|
4
4
|
import { DslNode, DslChildren } from '@pactor-app/core';
|
|
5
|
+
import { i as CardRounded, t as toggleVariants, h as typographyVariants } from '../typography-BYDh5oku.js';
|
|
5
6
|
import { LucideIcon } from 'lucide-react';
|
|
6
|
-
import { t as toggleVariants, b as typographyVariants } from '../typography-DsGdDBc2.js';
|
|
7
7
|
import { VariantProps } from 'class-variance-authority';
|
|
8
8
|
import 'class-variance-authority/types';
|
|
9
9
|
import '@base-ui/react/toggle';
|
|
@@ -41,13 +41,20 @@ interface AlertProps {
|
|
|
41
41
|
description?: string;
|
|
42
42
|
/** 变体,默认 info */
|
|
43
43
|
variant?: AlertVariant;
|
|
44
|
+
/** 是否显示图标;true 时按 variant 显示对应默认图标 */
|
|
45
|
+
showIcon?: boolean;
|
|
46
|
+
/** 自定义图标名(Icon 白名单,kebab-case / PascalCase 均可);提供时隐含 showIcon */
|
|
47
|
+
icon?: string;
|
|
44
48
|
/** 通用:根节点 class(与内置样式合并) */
|
|
45
49
|
className?: string;
|
|
46
50
|
/** 通用:根节点内联样式 */
|
|
47
51
|
style?: CSSProperties;
|
|
48
52
|
}
|
|
49
|
-
/**
|
|
50
|
-
|
|
53
|
+
/**
|
|
54
|
+
* Alert 适配器(shadcn kit):message → AlertTitle,description → AlertDescription;
|
|
55
|
+
* `showIcon` / `icon` 渲染前缀图标(vendored Alert 的 has-[>svg] 栅格自动让出图标列)
|
|
56
|
+
*/
|
|
57
|
+
declare function Alert({ message, description, variant, showIcon, icon, className, style, }: AlertProps): React.JSX.Element;
|
|
51
58
|
|
|
52
59
|
interface AlertDialogProps {
|
|
53
60
|
/** 标题 */
|
|
@@ -202,6 +209,9 @@ interface InputProps {
|
|
|
202
209
|
type?: 'text' | 'password';
|
|
203
210
|
placeholder?: string;
|
|
204
211
|
disabled?: boolean;
|
|
212
|
+
/** 值为非空时显示清除按钮,点击清空当前值;开启后独立渲染的
|
|
213
|
+
* className/style 挂控件包裹节点(含清除按钮),未开启时保持挂控件本身 */
|
|
214
|
+
allowClear?: boolean;
|
|
205
215
|
/** 输入事件,传出 string 值(非原生 event,设计决策 D2) */
|
|
206
216
|
onChange?: (value: string) => void;
|
|
207
217
|
/** 通用:根节点 class(Form 内为 form-item 容器,独立渲染时为控件本身) */
|
|
@@ -216,7 +226,7 @@ interface InputProps {
|
|
|
216
226
|
* 表单项为去原语化结构(design D3):`<div data-slot="form-item">` +
|
|
217
227
|
* `<label htmlFor>` 与控件 `useId` 关联。
|
|
218
228
|
*/
|
|
219
|
-
declare function Input({ name, label, rules, value, type, placeholder, disabled, onChange, className, style, }: InputProps): React.JSX.Element;
|
|
229
|
+
declare function Input({ name, label, rules, value, type, placeholder, disabled, allowClear, onChange, className, style, }: InputProps): React.JSX.Element;
|
|
220
230
|
|
|
221
231
|
interface CalendarProps {
|
|
222
232
|
/** 字段名;在 Form 内声明 name 即自动成为表单项 */
|
|
@@ -249,14 +259,16 @@ interface CardProps {
|
|
|
249
259
|
title?: string;
|
|
250
260
|
/** 是否有边框,默认 true(false 去边框与阴影) */
|
|
251
261
|
bordered?: boolean;
|
|
262
|
+
/** 圆角档位,默认 'lg'(即 --radius 基准值) */
|
|
263
|
+
rounded?: CardRounded;
|
|
252
264
|
/** 通用:根节点 class(与内置样式合并) */
|
|
253
265
|
className?: string;
|
|
254
266
|
/** 通用:根节点内联样式(布局逃逸口,如 `{ flex: 1 }`) */
|
|
255
267
|
style?: CSSProperties;
|
|
256
268
|
children?: ReactNode;
|
|
257
269
|
}
|
|
258
|
-
/** Card 适配器(shadcn kit):可选标题 + 边框开关(bordered=false
|
|
259
|
-
declare function Card({ title, bordered, className, style, children }: CardProps): React.JSX.Element;
|
|
270
|
+
/** Card 适配器(shadcn kit):可选标题 + 边框开关(bordered=false 去边框与阴影)+ 圆角档位 */
|
|
271
|
+
declare function Card({ title, bordered, rounded, className, style, children }: CardProps): React.JSX.Element;
|
|
260
272
|
|
|
261
273
|
/** 轮播图片项 */
|
|
262
274
|
interface CarouselImage {
|
|
@@ -1665,6 +1677,8 @@ interface TabsProps {
|
|
|
1665
1677
|
items?: TabItem[];
|
|
1666
1678
|
/** 当前激活页签 key(可绑表达式) */
|
|
1667
1679
|
activeKey?: string;
|
|
1680
|
+
/** 页签栏样式:default 胶囊(缺省)/ line 下划线 */
|
|
1681
|
+
variant?: 'default' | 'line';
|
|
1668
1682
|
/** 页签切换事件,传出新激活的 key */
|
|
1669
1683
|
onChange?: (key: string) => void;
|
|
1670
1684
|
/** 通用:根节点 class(与内置样式合并) */
|
|
@@ -1677,7 +1691,7 @@ interface TabsProps {
|
|
|
1677
1691
|
* 基于 vendored shadcn Tabs(@base-ui/react),每个 pane 的内容经
|
|
1678
1692
|
* renderChildren 渲染;未传 activeKey 时缺省激活第一个页签。
|
|
1679
1693
|
*/
|
|
1680
|
-
declare function Tabs({ items, activeKey, onChange, className, style }: TabsProps): React.JSX.Element;
|
|
1694
|
+
declare function Tabs({ items, activeKey, variant, onChange, className, style }: TabsProps): React.JSX.Element;
|
|
1681
1695
|
|
|
1682
1696
|
/** DSL Text 语义类型 */
|
|
1683
1697
|
type TextType = 'default' | 'secondary' | 'success' | 'warning' | 'danger';
|
package/dist/components/index.js
CHANGED
|
@@ -71,7 +71,7 @@ import {
|
|
|
71
71
|
createComponentRegistry,
|
|
72
72
|
registerBuiltinComponents,
|
|
73
73
|
useFormContext
|
|
74
|
-
} from "../chunk-
|
|
74
|
+
} from "../chunk-KUFQSYTS.js";
|
|
75
75
|
import {
|
|
76
76
|
ICONS,
|
|
77
77
|
Icon,
|
|
@@ -80,10 +80,10 @@ import {
|
|
|
80
80
|
Sidebar,
|
|
81
81
|
normalizeIconName,
|
|
82
82
|
useSidebarDrawer
|
|
83
|
-
} from "../chunk-
|
|
84
|
-
import "../chunk-
|
|
83
|
+
} from "../chunk-PECP7DJB.js";
|
|
84
|
+
import "../chunk-VT5XP4U4.js";
|
|
85
85
|
import "../chunk-F42SGQNW.js";
|
|
86
|
-
import "../chunk-
|
|
86
|
+
import "../chunk-VM4FESQB.js";
|
|
87
87
|
import "../chunk-WKJUCGV4.js";
|
|
88
88
|
export {
|
|
89
89
|
Accordion,
|