@ldkj/web-ui 0.11.1 → 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/components/form/checkbox/CheckboxGroup.d.ts +43 -0
- package/components/form/checkbox/index.d.ts +1 -0
- package/components/form/input/index.d.ts +1 -0
- package/components/form/input/input.d.ts +14 -0
- package/index.cjs +7 -7
- package/index.d.ts +1 -0
- package/index.js +1516 -1377
- package/package.json +1 -1
- package/style.css +1 -1
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type SxProps } from "@/styling";
|
|
3
|
+
import { type CheckboxProps } from "./Checkbox";
|
|
4
|
+
type CheckboxGroupGapPreset = "xs" | "sm" | "md" | "lg";
|
|
5
|
+
type CheckboxGroupGap = CheckboxGroupGapPreset | number | string;
|
|
6
|
+
export type CheckboxGroupOption = {
|
|
7
|
+
label: React.ReactNode;
|
|
8
|
+
value: string;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
description?: React.ReactNode;
|
|
11
|
+
className?: string;
|
|
12
|
+
checkboxProps?: Omit<CheckboxProps, "checked" | "defaultChecked" | "disabled" | "name" | "onCheckedChange" | "value">;
|
|
13
|
+
};
|
|
14
|
+
type CheckboxGroupBaseProps = Omit<React.ComponentPropsWithoutRef<"div">, "children" | "defaultValue" | "onChange"> & {
|
|
15
|
+
class?: string;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
direction?: "horizontal" | "vertical";
|
|
18
|
+
gap?: CheckboxGroupGap;
|
|
19
|
+
name?: string;
|
|
20
|
+
options: CheckboxGroupOption[];
|
|
21
|
+
sx?: SxProps;
|
|
22
|
+
};
|
|
23
|
+
export type CheckboxGroupMultipleProps = CheckboxGroupBaseProps & {
|
|
24
|
+
type?: "multiple";
|
|
25
|
+
value?: string[];
|
|
26
|
+
defaultValue?: string[];
|
|
27
|
+
onChange?: (value: string[]) => void;
|
|
28
|
+
};
|
|
29
|
+
export type CheckboxGroupSingleProps = CheckboxGroupBaseProps & {
|
|
30
|
+
type: "single";
|
|
31
|
+
value?: string;
|
|
32
|
+
defaultValue?: string;
|
|
33
|
+
onChange?: (value: string | undefined) => void;
|
|
34
|
+
};
|
|
35
|
+
export type CheckboxGroupProps = CheckboxGroupMultipleProps | CheckboxGroupSingleProps;
|
|
36
|
+
/**
|
|
37
|
+
* CheckboxGroup 管理一组选项的选择状态,支持多选、单选和原生表单提交。
|
|
38
|
+
*/
|
|
39
|
+
export declare function CheckboxGroup(props: CheckboxGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
40
|
+
export declare namespace CheckboxGroup {
|
|
41
|
+
var displayName: string;
|
|
42
|
+
}
|
|
43
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./input";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type SxProps } from "@/styling";
|
|
3
|
+
export type InputProps = React.ComponentPropsWithoutRef<"input"> & {
|
|
4
|
+
class?: string;
|
|
5
|
+
sx?: SxProps;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Input 是基础文本输入框组件,支持原生 input 属性、`class` 别名与本库 `sx` 样式系统。
|
|
9
|
+
*/
|
|
10
|
+
declare const Input: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref"> & {
|
|
11
|
+
class?: string;
|
|
12
|
+
sx?: SxProps;
|
|
13
|
+
} & React.RefAttributes<HTMLInputElement>>;
|
|
14
|
+
export { Input };
|