seam-react 0.10.0 → 0.12.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/Badge.d.ts +26 -0
- package/dist/Toast.d.ts +3 -2
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +2523 -2454
- package/dist/index.js.map +1 -1
- package/dist/styles.cjs +103 -0
- package/dist/styles.cjs.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.js +103 -0
- package/dist/styles.js.map +1 -1
- package/package.json +1 -1
package/dist/Badge.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type ForwardRefExoticComponent, type HTMLAttributes, type KeyboardEvent, type MouseEvent, type ReactNode, type RefAttributes } from "react";
|
|
2
|
+
export type BadgeVariant = "default" | "primary" | "success" | "warning" | "danger";
|
|
3
|
+
export type BadgeDismissEvent = MouseEvent<HTMLButtonElement> | KeyboardEvent<HTMLButtonElement>;
|
|
4
|
+
export interface BadgeProps extends Omit<HTMLAttributes<HTMLSpanElement>, "onChange"> {
|
|
5
|
+
/** 视觉与语义颜色,默认 default。 */
|
|
6
|
+
variant?: BadgeVariant;
|
|
7
|
+
/** 简短的状态或元数据内容;Badge 不自动截断或换行。 */
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
/** 激活关闭按钮时调用;不会自动移除 Badge。 */
|
|
10
|
+
onDismiss?: (event: BadgeDismissEvent) => void;
|
|
11
|
+
/** 是否显示关闭按钮,默认 Boolean(onDismiss)。 */
|
|
12
|
+
dismissible?: boolean;
|
|
13
|
+
/** 关闭按钮的无障碍名称,建议明确指出被移除的对象。 */
|
|
14
|
+
dismissLabel?: string;
|
|
15
|
+
/** 仅禁用关闭操作,不影响 Badge 内容显示。 */
|
|
16
|
+
dismissDisabled?: boolean;
|
|
17
|
+
/** 仅应用于关闭按钮的额外类名。 */
|
|
18
|
+
dismissButtonClassName?: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* 紧凑的内联状态或元数据标签。
|
|
22
|
+
*
|
|
23
|
+
* 默认只渲染语义中性的 span,不添加 live region 或入场动画。提供
|
|
24
|
+
* onDismiss 时显示原生关闭按钮;是否移除 Badge 始终由调用方控制。
|
|
25
|
+
*/
|
|
26
|
+
export declare const Badge: ForwardRefExoticComponent<BadgeProps & RefAttributes<HTMLSpanElement>>;
|
package/dist/Toast.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ export type Toast = {
|
|
|
19
19
|
export type ToastInput = Omit<Toast, "id" | "createdAt"> & {
|
|
20
20
|
id?: string;
|
|
21
21
|
};
|
|
22
|
+
export type ToastUpdateInput = Omit<Partial<ToastInput>, "id">;
|
|
22
23
|
export type UseToastOptions = {
|
|
23
24
|
initialToasts?: ToastInput[];
|
|
24
25
|
defaultDuration?: number;
|
|
@@ -57,8 +58,8 @@ type ManagedToast = Toast & {
|
|
|
57
58
|
};
|
|
58
59
|
export declare function useToast({ initialToasts, defaultDuration, limit, }?: UseToastOptions): {
|
|
59
60
|
toasts: ManagedToast[];
|
|
60
|
-
showToast: (input: ToastInput) => string;
|
|
61
|
-
updateToast: (id: string, patch:
|
|
61
|
+
showToast: (input: Omit<ToastInput, "id">) => string;
|
|
62
|
+
updateToast: (id: string, patch: ToastUpdateInput) => void;
|
|
62
63
|
dismissToast: (id: string) => void;
|
|
63
64
|
clearToasts: () => void;
|
|
64
65
|
pauseToast: (id: string) => void;
|