@ldkj/web-ui 0.13.0 → 0.14.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/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 ldkj
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 ldkj
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # @ldkj/web-ui
1
+ # @ldkj/web-ui
2
2
 
3
3
  由 shadcn-ui, Tailwind CSS 和 VitePress 构建的 React 组件库.
4
4
 
@@ -14,6 +14,9 @@ pnpm add @ldkj/web-ui
14
14
  import "@ldkj/web-ui/style.css";
15
15
  import { Button, Chip } from "@ldkj/web-ui";
16
16
 
17
+ // 可选:如需启用设计系统基础重置(全局样式),再额外引入
18
+ // import "@ldkj/web-ui/reset.css";
19
+
17
20
  export default function App() {
18
21
  return (
19
22
  <div className="p-4">
@@ -25,3 +28,4 @@ export default function App() {
25
28
  );
26
29
  }
27
30
  ```
31
+
@@ -0,0 +1,42 @@
1
+ import * as React from "react";
2
+ import * as AvatarPrimitive from "@radix-ui/react-avatar";
3
+ import { type SxProps } from "@/styling";
4
+ import { type Rounded } from "@/components/shared/rounded";
5
+ import { type Shadow } from "@/components/shared/shadow";
6
+ export type AvatarSize = "xs" | "sm" | "md" | "lg" | "xl" | number | string;
7
+ export type AvatarProps = React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root> & {
8
+ class?: string;
9
+ sx?: SxProps;
10
+ size?: AvatarSize;
11
+ rounded?: Rounded;
12
+ shadow?: Shadow;
13
+ };
14
+ export type AvatarImageProps = React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Image> & {
15
+ class?: string;
16
+ sx?: SxProps;
17
+ };
18
+ export type AvatarFallbackProps = React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Fallback> & {
19
+ class?: string;
20
+ sx?: SxProps;
21
+ };
22
+ declare const AvatarRoot: React.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarProps & React.RefAttributes<HTMLSpanElement>, "ref"> & {
23
+ class?: string;
24
+ sx?: SxProps;
25
+ size?: AvatarSize;
26
+ rounded?: Rounded;
27
+ shadow?: Shadow;
28
+ } & React.RefAttributes<HTMLSpanElement>>;
29
+ declare const AvatarImage: React.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarImageProps & React.RefAttributes<HTMLImageElement>, "ref"> & {
30
+ class?: string;
31
+ sx?: SxProps;
32
+ } & React.RefAttributes<HTMLImageElement>>;
33
+ declare const AvatarFallback: React.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarFallbackProps & React.RefAttributes<HTMLSpanElement>, "ref"> & {
34
+ class?: string;
35
+ sx?: SxProps;
36
+ } & React.RefAttributes<HTMLSpanElement>>;
37
+ type AvatarComponent = typeof AvatarRoot & {
38
+ Image: typeof AvatarImage;
39
+ Fallback: typeof AvatarFallback;
40
+ };
41
+ export declare const Avatar: AvatarComponent;
42
+ export { AvatarImage, AvatarFallback };
@@ -0,0 +1 @@
1
+ export * from "./Avatar";
@@ -0,0 +1,72 @@
1
+ import * as React from "react";
2
+ import { type Rounded } from "@/components/shared/rounded";
3
+ import { type SxProps } from "@/styling";
4
+ export type SkeletonVariant = "text" | "rect" | "circle";
5
+ export type SkeletonSize = number | string;
6
+ export type SkeletonProps = Omit<React.HTMLAttributes<HTMLDivElement>, "className"> & {
7
+ className?: string;
8
+ class?: string;
9
+ sx?: SxProps;
10
+ rounded?: Rounded;
11
+ width?: SkeletonSize;
12
+ height?: SkeletonSize;
13
+ inline?: boolean;
14
+ animated?: boolean;
15
+ variant?: SkeletonVariant;
16
+ };
17
+ export type SkeletonTextProps = Omit<React.HTMLAttributes<HTMLDivElement>, "className"> & {
18
+ className?: string;
19
+ class?: string;
20
+ sx?: SxProps;
21
+ rounded?: Rounded;
22
+ width?: SkeletonSize;
23
+ inline?: boolean;
24
+ animated?: boolean;
25
+ rows?: number;
26
+ rowHeight?: SkeletonSize;
27
+ gap?: SkeletonSize;
28
+ widths?: SkeletonSize[];
29
+ };
30
+ export type SkeletonAvatarProps = Omit<SkeletonProps, "children" | "variant" | "width" | "height"> & {
31
+ size?: SkeletonSize;
32
+ };
33
+ export type SkeletonButtonProps = Omit<SkeletonProps, "children" | "variant">;
34
+ export type SkeletonCardProps = Omit<SkeletonProps, "children" | "variant" | "height"> & {
35
+ showAvatar?: boolean;
36
+ rows?: number;
37
+ };
38
+ /**
39
+ * Skeleton renders a neutral placeholder block for content that is still loading.
40
+ */
41
+ export declare function Skeleton(props: SkeletonProps): import("react/jsx-runtime").JSX.Element;
42
+ export declare namespace Skeleton {
43
+ var displayName: string;
44
+ }
45
+ /**
46
+ * SkeletonText renders one or more text-like loading rows.
47
+ */
48
+ export declare function SkeletonText(props: SkeletonTextProps): import("react/jsx-runtime").JSX.Element;
49
+ export declare namespace SkeletonText {
50
+ var displayName: string;
51
+ }
52
+ /**
53
+ * SkeletonAvatar renders a circular placeholder for user or object avatars.
54
+ */
55
+ export declare function SkeletonAvatar(props: SkeletonAvatarProps): import("react/jsx-runtime").JSX.Element;
56
+ export declare namespace SkeletonAvatar {
57
+ var displayName: string;
58
+ }
59
+ /**
60
+ * SkeletonButton renders a rounded placeholder sized like a common button.
61
+ */
62
+ export declare function SkeletonButton(props: SkeletonButtonProps): import("react/jsx-runtime").JSX.Element;
63
+ export declare namespace SkeletonButton {
64
+ var displayName: string;
65
+ }
66
+ /**
67
+ * SkeletonCard renders a compact card loading layout composed from Skeleton parts.
68
+ */
69
+ export declare function SkeletonCard(props: SkeletonCardProps): import("react/jsx-runtime").JSX.Element;
70
+ export declare namespace SkeletonCard {
71
+ var displayName: string;
72
+ }
@@ -0,0 +1,2 @@
1
+ export { Skeleton, SkeletonAvatar, SkeletonButton, SkeletonCard, SkeletonText, } from "./Skeleton";
2
+ export type { SkeletonAvatarProps, SkeletonButtonProps, SkeletonCardProps, SkeletonProps, SkeletonSize, SkeletonTextProps, SkeletonVariant, } from "./Skeleton";
@@ -0,0 +1,107 @@
1
+ import * as React from "react";
2
+ import * as SelectPrimitive from "@radix-ui/react-select";
3
+ import { type SxProps } from "@/styling";
4
+ type StyledPrimitiveProps<TProps> = Omit<TProps, "className" | "style"> & {
5
+ className?: string;
6
+ class?: string;
7
+ style?: React.CSSProperties;
8
+ sx?: SxProps;
9
+ };
10
+ export type SelectOption = {
11
+ label: React.ReactNode;
12
+ value: string;
13
+ disabled?: boolean;
14
+ textValue?: string;
15
+ className?: string;
16
+ class?: string;
17
+ style?: React.CSSProperties;
18
+ sx?: SxProps;
19
+ };
20
+ export type SelectOptionGroup = {
21
+ label?: React.ReactNode;
22
+ options: SelectOption[];
23
+ separator?: boolean;
24
+ };
25
+ export type SelectItemsProps = {
26
+ options: Array<SelectOption | SelectOptionGroup>;
27
+ itemProps?: Omit<SelectItemProps, "children" | "value" | "disabled" | "textValue">;
28
+ labelProps?: Omit<SelectLabelProps, "children">;
29
+ separatorProps?: SelectSeparatorProps;
30
+ };
31
+ export type SelectTriggerProps = StyledPrimitiveProps<React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>>;
32
+ export type SelectScrollButtonProps = StyledPrimitiveProps<React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>>;
33
+ export type SelectContentProps = StyledPrimitiveProps<React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>>;
34
+ export type SelectLabelProps = StyledPrimitiveProps<React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>>;
35
+ export type SelectItemProps = StyledPrimitiveProps<React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>>;
36
+ export type SelectSeparatorProps = StyledPrimitiveProps<React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>>;
37
+ declare const Select: React.FC<SelectPrimitive.SelectProps>;
38
+ declare const SelectGroup: React.ForwardRefExoticComponent<SelectPrimitive.SelectGroupProps & React.RefAttributes<HTMLDivElement>>;
39
+ declare const SelectValue: React.ForwardRefExoticComponent<SelectPrimitive.SelectValueProps & React.RefAttributes<HTMLSpanElement>>;
40
+ /**
41
+ * SelectTrigger 是 Select 的触发按钮,支持原生 Radix Trigger 属性与本库 `sx` 样式系统。
42
+ */
43
+ declare const SelectTrigger: React.ForwardRefExoticComponent<Omit<Omit<SelectPrimitive.SelectTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref">, "className" | "style"> & {
44
+ className?: string;
45
+ class?: string;
46
+ style?: React.CSSProperties;
47
+ sx?: SxProps;
48
+ } & React.RefAttributes<HTMLButtonElement>>;
49
+ /**
50
+ * SelectScrollUpButton 用于长列表弹层的向上滚动控制。
51
+ */
52
+ declare const SelectScrollUpButton: React.ForwardRefExoticComponent<Omit<Omit<SelectPrimitive.SelectScrollUpButtonProps & React.RefAttributes<HTMLDivElement>, "ref">, "className" | "style"> & {
53
+ className?: string;
54
+ class?: string;
55
+ style?: React.CSSProperties;
56
+ sx?: SxProps;
57
+ } & React.RefAttributes<HTMLDivElement>>;
58
+ /**
59
+ * SelectScrollDownButton 用于长列表弹层的向下滚动控制。
60
+ */
61
+ declare const SelectScrollDownButton: React.ForwardRefExoticComponent<Omit<Omit<SelectPrimitive.SelectScrollUpButtonProps & React.RefAttributes<HTMLDivElement>, "ref">, "className" | "style"> & {
62
+ className?: string;
63
+ class?: string;
64
+ style?: React.CSSProperties;
65
+ sx?: SxProps;
66
+ } & React.RefAttributes<HTMLDivElement>>;
67
+ /**
68
+ * SelectContent 渲染下拉弹层,默认使用 Radix Portal 与 popper 定位。
69
+ */
70
+ declare const SelectContent: React.ForwardRefExoticComponent<Omit<Omit<SelectPrimitive.SelectContentProps & React.RefAttributes<HTMLDivElement>, "ref">, "className" | "style"> & {
71
+ className?: string;
72
+ class?: string;
73
+ style?: React.CSSProperties;
74
+ sx?: SxProps;
75
+ } & React.RefAttributes<HTMLDivElement>>;
76
+ /**
77
+ * SelectLabel 用于在分组选项中显示不可选择的分组标题。
78
+ */
79
+ declare const SelectLabel: React.ForwardRefExoticComponent<Omit<Omit<SelectPrimitive.SelectLabelProps & React.RefAttributes<HTMLDivElement>, "ref">, "className" | "style"> & {
80
+ className?: string;
81
+ class?: string;
82
+ style?: React.CSSProperties;
83
+ sx?: SxProps;
84
+ } & React.RefAttributes<HTMLDivElement>>;
85
+ /**
86
+ * SelectItem 是 Select 的可选项,需放在 SelectContent 内使用。
87
+ */
88
+ declare const SelectItem: React.ForwardRefExoticComponent<Omit<Omit<SelectPrimitive.SelectItemProps & React.RefAttributes<HTMLDivElement>, "ref">, "className" | "style"> & {
89
+ className?: string;
90
+ class?: string;
91
+ style?: React.CSSProperties;
92
+ sx?: SxProps;
93
+ } & React.RefAttributes<HTMLDivElement>>;
94
+ /**
95
+ * SelectSeparator 用于在 SelectContent 内分隔选项区域。
96
+ */
97
+ declare const SelectSeparator: React.ForwardRefExoticComponent<Omit<Omit<SelectPrimitive.SelectSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref">, "className" | "style"> & {
98
+ className?: string;
99
+ class?: string;
100
+ style?: React.CSSProperties;
101
+ sx?: SxProps;
102
+ } & React.RefAttributes<HTMLDivElement>>;
103
+ /**
104
+ * SelectItems 按配置快速渲染 SelectItem,同时保留 Select 的原始组合式能力。
105
+ */
106
+ declare function SelectItems(props: SelectItemsProps): import("react/jsx-runtime").JSX.Element;
107
+ export { Select, SelectGroup, SelectValue, SelectTrigger, SelectContent, SelectLabel, SelectItem, SelectSeparator, SelectScrollUpButton, SelectScrollDownButton, SelectItems, };
@@ -0,0 +1 @@
1
+ export * from "./Select";
@@ -0,0 +1,37 @@
1
+ import * as React from "react";
2
+ import * as SwitchPrimitive from "@radix-ui/react-switch";
3
+ import { type SxProps } from "@/styling";
4
+ export type SwitchSize = "sm" | "md" | "lg";
5
+ export type SwitchLabelPosition = "left" | "right";
6
+ export type SwitchProps = Omit<React.ComponentPropsWithoutRef<typeof SwitchPrimitive.Root>, "className" | "style"> & {
7
+ className?: string;
8
+ class?: string;
9
+ containerClass?: string;
10
+ containerClassName?: string;
11
+ containerStyle?: React.CSSProperties;
12
+ containerSx?: SxProps;
13
+ description?: React.ReactNode;
14
+ label?: React.ReactNode;
15
+ labelPosition?: SwitchLabelPosition;
16
+ size?: SwitchSize;
17
+ sx?: SxProps;
18
+ style?: React.CSSProperties;
19
+ };
20
+ /**
21
+ * 基于 Radix Switch 的开关组件,支持受控/非受控状态、标签说明与本库 `sx` 样式系统。
22
+ */
23
+ declare const Switch: React.ForwardRefExoticComponent<Omit<Omit<SwitchPrimitive.SwitchProps & React.RefAttributes<HTMLButtonElement>, "ref">, "className" | "style"> & {
24
+ className?: string;
25
+ class?: string;
26
+ containerClass?: string;
27
+ containerClassName?: string;
28
+ containerStyle?: React.CSSProperties;
29
+ containerSx?: SxProps;
30
+ description?: React.ReactNode;
31
+ label?: React.ReactNode;
32
+ labelPosition?: SwitchLabelPosition;
33
+ size?: SwitchSize;
34
+ sx?: SxProps;
35
+ style?: React.CSSProperties;
36
+ } & React.RefAttributes<HTMLButtonElement>>;
37
+ export { Switch };
@@ -0,0 +1 @@
1
+ export * from "./Switch";
@@ -13,8 +13,8 @@ type ButtonOwnProps = Omit<ButtonVariants, "rounded" | "shadow"> & {
13
13
  sx?: SxProps;
14
14
  };
15
15
  export type ButtonProps<T extends ElementType = "button"> = PolymorphicProps<T> & ButtonOwnProps;
16
- export declare function Button<T extends ElementType = "button">(props: ButtonProps<T>): import("react/jsx-runtime").JSX.Element;
17
- export declare namespace Button {
16
+ declare function Button<T extends ElementType = "button">(props: ButtonProps<T>): import("react/jsx-runtime").JSX.Element;
17
+ declare namespace Button {
18
18
  var displayName: string;
19
19
  }
20
- export {};
20
+ export { Button };
@@ -0,0 +1,121 @@
1
+ import * as React from "react";
2
+ import { type SxProps } from "@/styling";
3
+ type StyledDomProps<T extends React.ElementType> = Omit<React.ComponentPropsWithoutRef<T>, "className" | "style"> & {
4
+ className?: string;
5
+ class?: string;
6
+ style?: React.CSSProperties;
7
+ sx?: SxProps;
8
+ };
9
+ type AsChildProps = {
10
+ asChild?: boolean;
11
+ asChildWrapper?: React.ElementType;
12
+ };
13
+ export type DialogProps = {
14
+ open?: boolean;
15
+ defaultOpen?: boolean;
16
+ onOpenChange?: (open: boolean) => void;
17
+ modal?: boolean;
18
+ lockScroll?: boolean;
19
+ destroyOnClose?: boolean;
20
+ closeOnMaskClick?: boolean;
21
+ scrollable?: boolean;
22
+ children?: React.ReactNode;
23
+ };
24
+ export type DialogTriggerProps = StyledDomProps<"button"> & AsChildProps;
25
+ export type DialogCloseProps = StyledDomProps<"button"> & AsChildProps;
26
+ export type DialogOverlayProps = StyledDomProps<"div"> & {
27
+ blur?: boolean;
28
+ };
29
+ export type DialogContentProps = StyledDomProps<"div"> & {
30
+ showClose?: boolean;
31
+ overlayClassName?: string;
32
+ overlaySx?: SxProps;
33
+ overlayBlur?: boolean;
34
+ onEscapeKeyDown?: (event: KeyboardEvent) => void;
35
+ onPointerDownOutside?: (event: PointerEvent) => void;
36
+ onOpenAutoFocus?: (event: Event) => void;
37
+ onCloseAutoFocus?: (event: Event) => void;
38
+ };
39
+ export type DialogHeaderProps = React.HTMLAttributes<HTMLDivElement> & {
40
+ class?: string;
41
+ sx?: SxProps;
42
+ };
43
+ export type DialogFooterProps = React.HTMLAttributes<HTMLDivElement> & {
44
+ class?: string;
45
+ sx?: SxProps;
46
+ };
47
+ export type DialogTitleProps = StyledDomProps<"h2">;
48
+ export type DialogDescriptionProps = StyledDomProps<"p">;
49
+ declare const DialogTrigger: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref">, "className" | "style"> & {
50
+ className?: string;
51
+ class?: string;
52
+ style?: React.CSSProperties;
53
+ sx?: SxProps;
54
+ } & AsChildProps & React.RefAttributes<HTMLButtonElement>>;
55
+ declare const DialogClose: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref">, "className" | "style"> & {
56
+ className?: string;
57
+ class?: string;
58
+ style?: React.CSSProperties;
59
+ sx?: SxProps;
60
+ } & AsChildProps & React.RefAttributes<HTMLButtonElement>>;
61
+ type DialogPortalProps = {
62
+ children?: React.ReactNode;
63
+ container?: Element | DocumentFragment | null;
64
+ };
65
+ declare const DialogPortal: (props: DialogPortalProps) => React.ReactPortal | null;
66
+ declare const DialogOverlay: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "className" | "style"> & {
67
+ className?: string;
68
+ class?: string;
69
+ style?: React.CSSProperties;
70
+ sx?: SxProps;
71
+ } & {
72
+ blur?: boolean;
73
+ } & React.RefAttributes<HTMLDivElement>>;
74
+ declare const DialogContent: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "className" | "style"> & {
75
+ className?: string;
76
+ class?: string;
77
+ style?: React.CSSProperties;
78
+ sx?: SxProps;
79
+ } & {
80
+ showClose?: boolean;
81
+ overlayClassName?: string;
82
+ overlaySx?: SxProps;
83
+ overlayBlur?: boolean;
84
+ onEscapeKeyDown?: (event: KeyboardEvent) => void;
85
+ onPointerDownOutside?: (event: PointerEvent) => void;
86
+ onOpenAutoFocus?: (event: Event) => void;
87
+ onCloseAutoFocus?: (event: Event) => void;
88
+ } & React.RefAttributes<HTMLDivElement>>;
89
+ declare const DialogHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
90
+ class?: string;
91
+ sx?: SxProps;
92
+ } & React.RefAttributes<HTMLDivElement>>;
93
+ declare const DialogFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
94
+ class?: string;
95
+ sx?: SxProps;
96
+ } & React.RefAttributes<HTMLDivElement>>;
97
+ declare const DialogTitle: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "ref">, "className" | "style"> & {
98
+ className?: string;
99
+ class?: string;
100
+ style?: React.CSSProperties;
101
+ sx?: SxProps;
102
+ } & React.RefAttributes<HTMLHeadingElement>>;
103
+ declare const DialogDescription: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "ref">, "className" | "style"> & {
104
+ className?: string;
105
+ class?: string;
106
+ style?: React.CSSProperties;
107
+ sx?: SxProps;
108
+ } & React.RefAttributes<HTMLParagraphElement>>;
109
+ type DialogCompound = ((props: DialogProps) => React.ReactElement) & {
110
+ Trigger: typeof DialogTrigger;
111
+ Portal: typeof DialogPortal;
112
+ Close: typeof DialogClose;
113
+ Overlay: typeof DialogOverlay;
114
+ Content: typeof DialogContent;
115
+ Header: typeof DialogHeader;
116
+ Footer: typeof DialogFooter;
117
+ Title: typeof DialogTitle;
118
+ Description: typeof DialogDescription;
119
+ };
120
+ declare const Dialog: DialogCompound;
121
+ export { Dialog, DialogPortal, DialogOverlay, DialogClose, DialogTrigger, DialogContent, DialogHeader, DialogFooter, DialogTitle, DialogDescription, };
@@ -0,0 +1,2 @@
1
+ export { Dialog, DialogPortal, DialogOverlay, DialogClose, DialogTrigger, DialogContent, DialogHeader, DialogFooter, DialogTitle, DialogDescription, } from "./Dialog";
2
+ export type { DialogProps, DialogTriggerProps, DialogCloseProps, DialogOverlayProps, DialogContentProps, DialogHeaderProps, DialogFooterProps, DialogTitleProps, DialogDescriptionProps, } from "./Dialog";
@@ -0,0 +1,32 @@
1
+ import * as React from "react";
2
+ import { type SxProps } from "@/styling";
3
+ export type ModalBlur = boolean | number | string;
4
+ export type ModalProps = Omit<React.HTMLAttributes<HTMLDivElement>, "className" | "style" | "onClose" | "onOpen"> & {
5
+ open?: boolean;
6
+ destroyOnClose?: boolean;
7
+ closeOnMaskClick?: boolean;
8
+ scrollable?: boolean;
9
+ alpha?: number;
10
+ blur?: ModalBlur;
11
+ x?: string;
12
+ y?: string;
13
+ translateX?: string;
14
+ translateY?: string;
15
+ onClose?: () => void;
16
+ onOpen?: () => void;
17
+ className?: string;
18
+ class?: string;
19
+ style?: React.CSSProperties;
20
+ sx?: SxProps;
21
+ contentClassName?: string;
22
+ contentClass?: string;
23
+ contentStyle?: React.CSSProperties;
24
+ contentSx?: SxProps;
25
+ };
26
+ /**
27
+ * Modal 全屏遮罩容器,适用于轻量弹层和临时聚焦内容。
28
+ */
29
+ export declare function Modal(props: ModalProps): import("react/jsx-runtime").JSX.Element | null;
30
+ export declare namespace Modal {
31
+ var displayName: string;
32
+ }
@@ -0,0 +1,2 @@
1
+ export { Modal } from "./Modal";
2
+ export type { ModalProps, ModalBlur } from "./Modal";
@@ -0,0 +1,119 @@
1
+ import * as React from "react";
2
+ import * as PopoverPrimitive from "@radix-ui/react-popover";
3
+ import { type Rounded } from "@/components/shared/rounded";
4
+ import { type Shadow } from "@/components/shared/shadow";
5
+ import { type SxProps } from "@/styling";
6
+ type RadixPopoverContentProps = React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>;
7
+ type RadixPopoverTriggerProps = React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Trigger>;
8
+ type RadixPopoverCloseProps = React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Close>;
9
+ type PopoverWrapperProps<TProps> = Omit<TProps, "className" | "style"> & {
10
+ className?: string;
11
+ class?: string;
12
+ style?: React.CSSProperties;
13
+ sx?: SxProps;
14
+ };
15
+ export type PopoverTriggerProps = PopoverWrapperProps<RadixPopoverTriggerProps>;
16
+ export type PopoverCloseProps = PopoverWrapperProps<RadixPopoverCloseProps>;
17
+ /**
18
+ * Popover 根组件,管理弹层的打开状态。
19
+ *
20
+ * 该组件保留 Radix Popover Root 的完整能力,支持非受控与受控两种用法。
21
+ */
22
+ declare const Popover: React.FC<PopoverPrimitive.PopoverProps>;
23
+ /**
24
+ * Popover 触发器。
25
+ *
26
+ * 使用 `asChild` 时会由本组件生成一层触发容器,业务子组件无需转发 ref。
27
+ */
28
+ declare const PopoverTrigger: React.ForwardRefExoticComponent<Omit<Omit<PopoverPrimitive.PopoverTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref">, "className" | "style"> & {
29
+ className?: string;
30
+ class?: string;
31
+ style?: React.CSSProperties;
32
+ sx?: SxProps;
33
+ } & React.RefAttributes<HTMLElement>>;
34
+ /**
35
+ * Popover 锚点。
36
+ *
37
+ * 当弹层定位目标与触发器不是同一个元素时,可以使用 Anchor 明确定位参考元素。
38
+ */
39
+ declare const PopoverAnchor: React.ForwardRefExoticComponent<PopoverPrimitive.PopoverAnchorProps & React.RefAttributes<HTMLDivElement>>;
40
+ /**
41
+ * Popover 关闭按钮。
42
+ *
43
+ * 使用 `asChild` 时会由本组件生成一层关闭容器,业务子组件无需转发 ref。
44
+ */
45
+ declare const PopoverClose: React.ForwardRefExoticComponent<Omit<Omit<PopoverPrimitive.PopoverCloseProps & React.RefAttributes<HTMLButtonElement>, "ref">, "className" | "style"> & {
46
+ className?: string;
47
+ class?: string;
48
+ style?: React.CSSProperties;
49
+ sx?: SxProps;
50
+ } & React.RefAttributes<HTMLElement>>;
51
+ /**
52
+ * PopoverContent 的属性。
53
+ */
54
+ export type PopoverContentProps = Omit<RadixPopoverContentProps, "className" | "style"> & {
55
+ /**
56
+ * 弹层宽度。传入数字时自动转换为 px。
57
+ *
58
+ * @default 288
59
+ */
60
+ width?: number | string;
61
+ /**
62
+ * 弹层圆角,支持本库圆角预设或任意 CSS border-radius 值。
63
+ *
64
+ * @default "lg"
65
+ */
66
+ rounded?: Rounded;
67
+ /**
68
+ * 弹层阴影,支持本库阴影预设或任意 CSS box-shadow 值。
69
+ *
70
+ * @default "md"
71
+ */
72
+ shadow?: Shadow;
73
+ /**
74
+ * 本库 sx 样式入口,支持对象、数组、函数与嵌套选择器。
75
+ */
76
+ sx?: SxProps;
77
+ /**
78
+ * 兼容历史 class 写法。
79
+ */
80
+ class?: string;
81
+ className?: string;
82
+ style?: React.CSSProperties;
83
+ };
84
+ /**
85
+ * Popover 内容面板。
86
+ *
87
+ * 默认通过 Portal 渲染到 body,并保留 Radix Content 的定位、碰撞检测与焦点管理能力。
88
+ */
89
+ declare const PopoverContent: React.ForwardRefExoticComponent<Omit<Omit<PopoverPrimitive.PopoverContentProps & React.RefAttributes<HTMLDivElement>, "ref">, "className" | "style"> & {
90
+ /**
91
+ * 弹层宽度。传入数字时自动转换为 px。
92
+ *
93
+ * @default 288
94
+ */
95
+ width?: number | string;
96
+ /**
97
+ * 弹层圆角,支持本库圆角预设或任意 CSS border-radius 值。
98
+ *
99
+ * @default "lg"
100
+ */
101
+ rounded?: Rounded;
102
+ /**
103
+ * 弹层阴影,支持本库阴影预设或任意 CSS box-shadow 值。
104
+ *
105
+ * @default "md"
106
+ */
107
+ shadow?: Shadow;
108
+ /**
109
+ * 本库 sx 样式入口,支持对象、数组、函数与嵌套选择器。
110
+ */
111
+ sx?: SxProps;
112
+ /**
113
+ * 兼容历史 class 写法。
114
+ */
115
+ class?: string;
116
+ className?: string;
117
+ style?: React.CSSProperties;
118
+ } & React.RefAttributes<HTMLDivElement>>;
119
+ export { Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverTrigger, };
@@ -0,0 +1 @@
1
+ export * from "./Popover";