seam-react 0.11.0 → 0.12.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.
- package/dist/Badge.d.ts +26 -0
- package/dist/RadioGroup.d.ts +41 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +3387 -3110
- package/dist/index.js.map +1 -1
- package/dist/styles.cjs +214 -0
- package/dist/styles.cjs.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.js +214 -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>>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { type HTMLAttributes, type InputHTMLAttributes, type ReactElement, type ReactNode } from "react";
|
|
2
|
+
export type RadioGroupOrientation = "horizontal" | "vertical";
|
|
3
|
+
export interface RadioGroupProps extends Omit<HTMLAttributes<HTMLDivElement>, "defaultValue" | "onChange" | "children"> {
|
|
4
|
+
/** Controlled selected value. */
|
|
5
|
+
value?: string;
|
|
6
|
+
/** Initial selected value for an uncontrolled group. */
|
|
7
|
+
defaultValue?: string;
|
|
8
|
+
/** Called with the newly selected value. */
|
|
9
|
+
onValueChange?: (value: string) => void;
|
|
10
|
+
/** Layout direction. Defaults to "vertical". */
|
|
11
|
+
orientation?: RadioGroupOrientation;
|
|
12
|
+
/** RadioGroupItem children. */
|
|
13
|
+
children?: ReactNode;
|
|
14
|
+
/** Merged onto the group root. */
|
|
15
|
+
className?: string;
|
|
16
|
+
/** Accessible name when no visible external label exists. */
|
|
17
|
+
"aria-label"?: string;
|
|
18
|
+
/** ID of an external element that labels the group. */
|
|
19
|
+
"aria-labelledby"?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface RadioGroupItemProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "value" | "checked" | "defaultChecked" | "children" | "className" | "size"> {
|
|
22
|
+
/** Value submitted and returned when this item is selected. */
|
|
23
|
+
value: string;
|
|
24
|
+
/** Visible option label. */
|
|
25
|
+
label: ReactNode;
|
|
26
|
+
/** Optional supporting text displayed below the label. */
|
|
27
|
+
description?: ReactNode;
|
|
28
|
+
/** Prevents focus and selection through the native disabled input. */
|
|
29
|
+
disabled?: boolean;
|
|
30
|
+
/** Merged onto the outer item wrapper, not the native input. */
|
|
31
|
+
className?: string;
|
|
32
|
+
/** Optional stable native input ID. */
|
|
33
|
+
id?: string;
|
|
34
|
+
}
|
|
35
|
+
declare function RadioGroupRoot({ value, defaultValue, onValueChange, orientation, children, className, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ...rest }: RadioGroupProps): ReactElement;
|
|
36
|
+
declare const RadioGroupItem: import("react").ForwardRefExoticComponent<RadioGroupItemProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
37
|
+
export declare const RadioGroup: typeof RadioGroupRoot & {
|
|
38
|
+
Item: import("react").ForwardRefExoticComponent<RadioGroupItemProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
39
|
+
};
|
|
40
|
+
export { RadioGroupItem };
|
|
41
|
+
export type RadioGroupComponent = typeof RadioGroup;
|