seam-react 0.13.1 → 0.13.3

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
@@ -45,7 +45,7 @@ export function Root() {
45
45
  - Form 提供组合式字段、同步/异步规则、服务端错误和失败聚焦;安装 `valibot` 后可通过 `seam-react/valibot` 接入 schema 校验。
46
46
  - Sidebar 提供可折叠 Group、可配置分组间距,以及互斥的轨道与背景 hover 模式。
47
47
 
48
- 完整文档:[chenhaojie9527.github.io/ui-kit](https://chenhaojie9527.github.io/ui-kit/)
48
+ 完整文档:[ui-kit.cn](https://ui-kit.cn/)
49
49
 
50
50
  ## License
51
51
 
package/dist/Badge.d.ts CHANGED
@@ -1,14 +1,25 @@
1
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";
2
+ export type BadgeVariant = "default" | "primary" | "success" | "warning" | "danger" | "loading";
3
+ export type BadgeSize = "sm" | "md";
3
4
  export type BadgeDismissEvent = MouseEvent<HTMLButtonElement> | KeyboardEvent<HTMLButtonElement>;
4
5
  export interface BadgeProps extends Omit<HTMLAttributes<HTMLSpanElement>, "onChange"> {
5
- /** 视觉与语义颜色,默认 default。 */
6
+ /** 视觉与语义颜色;loading 会显示 spinner 并默认开启脉冲。 */
6
7
  variant?: BadgeVariant;
8
+ /** 尺寸,默认 md 保持既有高度与字号。 */
9
+ size?: BadgeSize;
7
10
  /** 简短的状态或元数据内容;Badge 不自动截断或换行。 */
8
11
  children: ReactNode;
12
+ /** 覆盖当前 variant 的默认状态图标;图标需要控制在 1em 见方内。 */
13
+ icon?: ReactNode;
14
+ /** 是否显示状态图标,默认 true。 */
15
+ showIcon?: boolean;
16
+ /** 是否显示脉冲;默认只在 variant 为 loading 时开启。 */
17
+ pulse?: boolean;
18
+ /** 状态切换动画的稳定 key;默认取 children(文本)或 variant。 */
19
+ contentKey?: string | number;
9
20
  /** 激活关闭按钮时调用;不会自动移除 Badge。 */
10
21
  onDismiss?: (event: BadgeDismissEvent) => void;
11
- /** 是否显示关闭按钮,默认 Boolean(onDismiss)。 */
22
+ /** 是否显示关闭按钮,默认 Boolean(onDismiss);loading 时始终隐藏。 */
12
23
  dismissible?: boolean;
13
24
  /** 关闭按钮的无障碍名称,建议明确指出被移除的对象。 */
14
25
  dismissLabel?: string;
@@ -20,7 +31,8 @@ export interface BadgeProps extends Omit<HTMLAttributes<HTMLSpanElement>, "onCha
20
31
  /**
21
32
  * 紧凑的内联状态或元数据标签。
22
33
  *
23
- * 默认只渲染语义中性的 span,不添加 live region 或入场动画。提供
24
- * onDismiss 时显示原生关闭按钮;是否移除 Badge 始终由调用方控制。
34
+ * 按 variant 自动配状态图标;loading 使用 spinner 与轻脉冲。状态或文案变化时
35
+ * 图标和文字做一次短距离滚动替换,宽度通过共享 layout 连续过渡。默认不添加
36
+ * live region,也不做挂载入场动画。
25
37
  */
26
38
  export declare const Badge: ForwardRefExoticComponent<BadgeProps & RefAttributes<HTMLSpanElement>>;