@ldkj/web-ui 0.14.0 → 0.15.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/README.md +31 -27
- package/components/data-display/badge/Badge.d.ts +14 -0
- package/components/data-display/badge/index.d.ts +1 -0
- package/components/data-display/empty/Empty.d.ts +7 -0
- package/components/data-display/empty/index.d.ts +1 -0
- package/components/data-display/image/Image.d.ts +74 -0
- package/components/data-display/image/index.d.ts +1 -0
- package/components/data-display/list/List.d.ts +8 -0
- package/components/data-display/list/index.d.ts +1 -0
- package/components/form/auto-complete/AutoComplete.d.ts +9 -0
- package/components/form/auto-complete/index.d.ts +1 -0
- package/components/form/cascader/Cascader.d.ts +12 -0
- package/components/form/cascader/index.d.ts +1 -0
- package/components/form/form-v2/FormV2.d.ts +5 -0
- package/components/form/form-v2/index.d.ts +1 -0
- package/components/form/input-number/InputNumber.d.ts +7 -0
- package/components/form/input-number/index.d.ts +1 -0
- package/components/form/input-opt/InputOPT.d.ts +9 -0
- package/components/form/input-opt/index.d.ts +1 -0
- package/components/form/rate/Rate.d.ts +9 -0
- package/components/form/rate/index.d.ts +1 -0
- package/components/form/required/Required.d.ts +4 -0
- package/components/form/required/index.d.ts +1 -0
- package/components/form/slider-v2/SliderV2.d.ts +7 -0
- package/components/form/slider-v2/index.d.ts +1 -0
- package/components/form/uploader/Uploader.d.ts +7 -0
- package/components/form/uploader/index.d.ts +1 -0
- package/components/interact/alert/Alert.d.ts +9 -0
- package/components/interact/alert/index.d.ts +1 -0
- package/components/interact/drawer/Drawer.d.ts +11 -0
- package/components/interact/drawer/index.d.ts +1 -0
- package/components/interact/loading/Loading.d.ts +3 -0
- package/components/interact/loading/index.d.ts +1 -0
- package/components/interact/notification/Notification.d.ts +6 -0
- package/components/interact/notification/index.d.ts +1 -0
- package/components/interact/progress/Progress.d.ts +8 -0
- package/components/interact/progress/index.d.ts +1 -0
- package/components/interact/spin/Spin.d.ts +6 -0
- package/components/interact/spin/index.d.ts +1 -0
- package/components/layout/typography/Typography.d.ts +13 -0
- package/components/layout/typography/index.d.ts +1 -0
- package/index.cjs +16 -16
- package/index.d.ts +20 -0
- package/index.js +5683 -4980
- package/package.json +3 -2
- package/reset.css +11 -0
- package/style.css +1 -1
package/README.md
CHANGED
|
@@ -1,27 +1,31 @@
|
|
|
1
|
-
# @ldkj/web-ui
|
|
2
|
-
|
|
3
|
-
由 shadcn-ui, Tailwind CSS 和 VitePress 构建的 React 组件库.
|
|
4
|
-
|
|
5
|
-
## 立即开始
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
pnpm add @ldkj/web-ui
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## 使用示例
|
|
12
|
-
|
|
13
|
-
```tsx
|
|
14
|
-
import "@ldkj/web-ui/style.css";
|
|
15
|
-
import { Button, Chip } from "@ldkj/web-ui";
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
</
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
1
|
+
# @ldkj/web-ui
|
|
2
|
+
|
|
3
|
+
由 shadcn-ui, Tailwind CSS 和 VitePress 构建的 React 组件库.
|
|
4
|
+
|
|
5
|
+
## 立即开始
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm add @ldkj/web-ui
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## 使用示例
|
|
12
|
+
|
|
13
|
+
```tsx
|
|
14
|
+
import "@ldkj/web-ui/style.css";
|
|
15
|
+
import { Button, Chip } from "@ldkj/web-ui";
|
|
16
|
+
|
|
17
|
+
// 可选:如需启用设计系统基础重置(全局样式),再额外引入
|
|
18
|
+
// import "@ldkj/web-ui/reset.css";
|
|
19
|
+
|
|
20
|
+
export default function App() {
|
|
21
|
+
return (
|
|
22
|
+
<div className="p-4">
|
|
23
|
+
<Button variant="primary">Hello World</Button>
|
|
24
|
+
<Chip variant="success" size="sm">
|
|
25
|
+
Ready
|
|
26
|
+
</Chip>
|
|
27
|
+
</div>
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type SxProps } from "@/styling";
|
|
3
|
+
export type BadgeVariant = "neutral" | "primary" | "success" | "warning" | "danger";
|
|
4
|
+
export type BadgeProps = React.HTMLAttributes<HTMLSpanElement> & {
|
|
5
|
+
class?: string;
|
|
6
|
+
sx?: SxProps;
|
|
7
|
+
badgeContent?: React.ReactNode;
|
|
8
|
+
dot?: boolean;
|
|
9
|
+
light?: boolean;
|
|
10
|
+
showZero?: boolean;
|
|
11
|
+
max?: number;
|
|
12
|
+
variant?: BadgeVariant;
|
|
13
|
+
};
|
|
14
|
+
export declare function Badge(props: BadgeProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Badge";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type BoxProps } from "@/components/layout/box";
|
|
3
|
+
export type EmptyProps = BoxProps<"div"> & {
|
|
4
|
+
description?: React.ReactNode;
|
|
5
|
+
image?: React.ReactNode;
|
|
6
|
+
};
|
|
7
|
+
export declare function Empty(props: EmptyProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Empty";
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type SxProps } from "@/styling";
|
|
3
|
+
type ImageStatus = "idle" | "loading" | "loaded" | "error";
|
|
4
|
+
type ImageLoader = (src: string, options: {
|
|
5
|
+
width?: number;
|
|
6
|
+
quality?: number;
|
|
7
|
+
format?: string;
|
|
8
|
+
crop?: boolean;
|
|
9
|
+
height?: number;
|
|
10
|
+
}) => string;
|
|
11
|
+
type ImageSource = {
|
|
12
|
+
media?: string;
|
|
13
|
+
srcSet: string;
|
|
14
|
+
type?: string;
|
|
15
|
+
sizes?: string;
|
|
16
|
+
};
|
|
17
|
+
export type ImageRenderState = {
|
|
18
|
+
status: ImageStatus;
|
|
19
|
+
loading: boolean;
|
|
20
|
+
error: boolean;
|
|
21
|
+
loaded: boolean;
|
|
22
|
+
previewOpen: boolean;
|
|
23
|
+
src?: string;
|
|
24
|
+
};
|
|
25
|
+
type ImageFormat = "webp" | "avif";
|
|
26
|
+
export type ImageProps = Omit<React.ImgHTMLAttributes<HTMLImageElement>, "placeholder" | "children"> & {
|
|
27
|
+
class?: string;
|
|
28
|
+
sx?: SxProps;
|
|
29
|
+
fallback?: React.ReactNode;
|
|
30
|
+
fallbackSrc?: string;
|
|
31
|
+
loadingFallback?: React.ReactNode;
|
|
32
|
+
fit?: React.CSSProperties["objectFit"];
|
|
33
|
+
position?: React.CSSProperties["objectPosition"];
|
|
34
|
+
aspectRatio?: number | string;
|
|
35
|
+
placeholder?: "blur";
|
|
36
|
+
blurDataURL?: string;
|
|
37
|
+
retry?: number;
|
|
38
|
+
retryDelay?: number;
|
|
39
|
+
onLoadingChange?: (loading: boolean) => void;
|
|
40
|
+
loader?: ImageLoader;
|
|
41
|
+
quality?: number;
|
|
42
|
+
format?: string;
|
|
43
|
+
crop?: boolean;
|
|
44
|
+
sources?: ImageSource[];
|
|
45
|
+
formats?: ImageFormat[];
|
|
46
|
+
responsiveWidths?: number[];
|
|
47
|
+
preview?: boolean;
|
|
48
|
+
children?: (state: ImageRenderState) => React.ReactNode;
|
|
49
|
+
};
|
|
50
|
+
export declare const Image: React.ForwardRefExoticComponent<Omit<React.ImgHTMLAttributes<HTMLImageElement>, "children" | "placeholder"> & {
|
|
51
|
+
class?: string;
|
|
52
|
+
sx?: SxProps;
|
|
53
|
+
fallback?: React.ReactNode;
|
|
54
|
+
fallbackSrc?: string;
|
|
55
|
+
loadingFallback?: React.ReactNode;
|
|
56
|
+
fit?: React.CSSProperties["objectFit"];
|
|
57
|
+
position?: React.CSSProperties["objectPosition"];
|
|
58
|
+
aspectRatio?: number | string;
|
|
59
|
+
placeholder?: "blur";
|
|
60
|
+
blurDataURL?: string;
|
|
61
|
+
retry?: number;
|
|
62
|
+
retryDelay?: number;
|
|
63
|
+
onLoadingChange?: (loading: boolean) => void;
|
|
64
|
+
loader?: ImageLoader;
|
|
65
|
+
quality?: number;
|
|
66
|
+
format?: string;
|
|
67
|
+
crop?: boolean;
|
|
68
|
+
sources?: ImageSource[];
|
|
69
|
+
formats?: ImageFormat[];
|
|
70
|
+
responsiveWidths?: number[];
|
|
71
|
+
preview?: boolean;
|
|
72
|
+
children?: (state: ImageRenderState) => React.ReactNode;
|
|
73
|
+
} & React.RefAttributes<HTMLImageElement>>;
|
|
74
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Image";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type SxProps } from "@/styling";
|
|
3
|
+
export type ListProps = React.HTMLAttributes<HTMLUListElement> & {
|
|
4
|
+
class?: string;
|
|
5
|
+
sx?: SxProps;
|
|
6
|
+
bordered?: boolean;
|
|
7
|
+
};
|
|
8
|
+
export declare function List(props: ListProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./List";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type InputProps } from "@/components/form/input";
|
|
2
|
+
export type AutoCompleteOption = {
|
|
3
|
+
label: string;
|
|
4
|
+
value: string;
|
|
5
|
+
};
|
|
6
|
+
export type AutoCompleteProps = Omit<InputProps, "list"> & {
|
|
7
|
+
options?: AutoCompleteOption[];
|
|
8
|
+
};
|
|
9
|
+
export declare function AutoComplete(props: AutoCompleteProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./AutoComplete";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type CascaderOption = {
|
|
2
|
+
label: string;
|
|
3
|
+
value: string;
|
|
4
|
+
children?: CascaderOption[];
|
|
5
|
+
};
|
|
6
|
+
export type CascaderProps = {
|
|
7
|
+
options?: CascaderOption[];
|
|
8
|
+
value?: string;
|
|
9
|
+
placeholder?: string;
|
|
10
|
+
onValueChange?: (value: string) => void;
|
|
11
|
+
};
|
|
12
|
+
export declare function Cascader(props: CascaderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Cascader";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./FormV2";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type InputProps } from "@/components/form/input";
|
|
2
|
+
export type InputNumberProps = Omit<InputProps, "type" | "inputMode"> & {
|
|
3
|
+
min?: number;
|
|
4
|
+
max?: number;
|
|
5
|
+
step?: number;
|
|
6
|
+
};
|
|
7
|
+
export declare function InputNumber(props: InputNumberProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./InputNumber";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type InputOPTProps = {
|
|
2
|
+
value?: string;
|
|
3
|
+
length?: number;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
className?: string;
|
|
6
|
+
class?: string;
|
|
7
|
+
onChange?: (value: string) => void;
|
|
8
|
+
};
|
|
9
|
+
export declare function InputOPT(props: InputOPTProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./InputOPT";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Rate";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Required";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type SliderV2Props = Omit<React.InputHTMLAttributes<HTMLInputElement>, "type" | "value" | "onChange"> & {
|
|
3
|
+
value?: number;
|
|
4
|
+
class?: string;
|
|
5
|
+
onValueChange?: (value: number) => void;
|
|
6
|
+
};
|
|
7
|
+
export declare function SliderV2(props: SliderV2Props): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./SliderV2";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Uploader";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type AlertVariant = "info" | "success" | "warning" | "error";
|
|
3
|
+
export type AlertProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
4
|
+
class?: string;
|
|
5
|
+
variant?: AlertVariant;
|
|
6
|
+
title?: React.ReactNode;
|
|
7
|
+
description?: React.ReactNode;
|
|
8
|
+
};
|
|
9
|
+
export declare function Alert(props: AlertProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Alert";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type DrawerProps = {
|
|
3
|
+
open: boolean;
|
|
4
|
+
title?: React.ReactNode;
|
|
5
|
+
width?: number | string;
|
|
6
|
+
className?: string;
|
|
7
|
+
class?: string;
|
|
8
|
+
children?: React.ReactNode;
|
|
9
|
+
onOpenChange?: (open: boolean) => void;
|
|
10
|
+
};
|
|
11
|
+
export declare function Drawer(props: DrawerProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Drawer";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Loading";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Notification';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type ProgressProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
3
|
+
value?: number;
|
|
4
|
+
max?: number;
|
|
5
|
+
showInfo?: boolean;
|
|
6
|
+
class?: string;
|
|
7
|
+
};
|
|
8
|
+
export declare function Progress(props: ProgressProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Progress";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Spin";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { ElementType } from "react";
|
|
3
|
+
import { type SxProps } from "@/styling";
|
|
4
|
+
type TypographyVariant = "h1" | "h2" | "h3" | "body" | "caption";
|
|
5
|
+
export type TypographyProps<T extends ElementType = "p"> = {
|
|
6
|
+
component?: T;
|
|
7
|
+
className?: string;
|
|
8
|
+
class?: string;
|
|
9
|
+
sx?: SxProps;
|
|
10
|
+
variant?: TypographyVariant;
|
|
11
|
+
} & Omit<React.ComponentPropsWithoutRef<T>, "as" | "className">;
|
|
12
|
+
export declare function Typography<T extends ElementType = "p">(props: TypographyProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Typography";
|