@lobehub/ui 5.0.0 → 5.1.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/es/Accordion/Accordion.d.mts +2 -2
- package/es/Accordion/AccordionItem.d.mts +2 -2
- package/es/ActionIcon/ActionIcon.d.mts +2 -2
- package/es/Alert/Alert.d.mts +2 -2
- package/es/AutoComplete/Select.d.mts +2 -2
- package/es/Avatar/AvatarGroup/index.d.mts +2 -2
- package/es/Burger/Burger.d.mts +2 -2
- package/es/CodeDiff/CodeDiff.d.mts +2 -2
- package/es/CodeDiff/PatchDiff.d.mts +2 -2
- package/es/CodeEditor/CodeEditor.d.mts +2 -2
- package/es/Collapse/Collapse.d.mts +2 -2
- package/es/ConfigProvider/index.d.mts +2 -2
- package/es/CopyButton/CopyButton.d.mts +2 -2
- package/es/DatePicker/DatePicker.d.mts +2 -2
- package/es/DraggablePanel/components/DraggablePanelBody.d.mts +2 -2
- package/es/DraggablePanel/components/DraggablePanelContainer.d.mts +2 -2
- package/es/DraggablePanel/components/DraggablePanelFooter.d.mts +2 -2
- package/es/DraggablePanel/components/DraggablePanelHeader.d.mts +2 -2
- package/es/DraggableSideNav/DraggableSideNav.d.mts +2 -2
- package/es/Drawer/Drawer.d.mts +2 -2
- package/es/Dropdown/Dropdown.d.mts +2 -2
- package/es/EditableText/EditableText.d.mts +2 -2
- package/es/EditorSlashMenu/atoms.d.mts +13 -13
- package/es/EmojiPicker/EmojiPicker.d.mts +2 -2
- package/es/Flex/FlexBasic.d.mts +2 -2
- package/es/FontLoader/index.d.mts +2 -2
- package/es/Footer/Footer.d.mts +2 -2
- package/es/Form/components/FormGroup.d.mts +2 -2
- package/es/Form/components/FormItem.d.mts +2 -2
- package/es/Form/components/FormSubmitFooter.d.mts +2 -2
- package/es/FormModal/FormModal.d.mts +2 -2
- package/es/Freeze/Freeze.d.mts +2 -2
- package/es/GuideCard/GuideCard.d.mts +2 -2
- package/es/Header/Header.d.mts +2 -2
- package/es/Hotkey/Hotkey.d.mts +2 -2
- package/es/HotkeyInput/HotkeyInput.d.mts +2 -2
- package/es/Icon/Icon.d.mts +2 -2
- package/es/Icon/components/IconProvider.d.mts +3 -3
- package/es/Image/PreviewGroup.d.mts +2 -2
- package/es/ImageSelect/ImageSelect.d.mts +2 -2
- package/es/Input/Input.d.mts +2 -2
- package/es/Input/InputNumber.d.mts +2 -2
- package/es/Input/InputOPT.d.mts +2 -2
- package/es/Input/InputPassword.d.mts +2 -2
- package/es/Input/TextArea.d.mts +2 -2
- package/es/Layout/components/LayoutFooter.d.mts +2 -2
- package/es/Layout/components/LayoutHeader.d.mts +2 -2
- package/es/Layout/components/LayoutMain.d.mts +2 -2
- package/es/Layout/components/LayoutSidebar.d.mts +2 -2
- package/es/Layout/components/LayoutSidebarInner.d.mts +2 -2
- package/es/Layout/components/LayoutToc.d.mts +2 -2
- package/es/List/ListItem/index.d.mts +2 -2
- package/es/Markdown/Markdown.d.mts +2 -2
- package/es/Markdown/Typography.d.mts +2 -2
- package/es/Markdown/components/SearchResultCards/index.d.mts +2 -2
- package/es/MaskShadow/MaskShadow.d.mts +2 -2
- package/es/Menu/Menu.d.mts +2 -2
- package/es/Mermaid/Mermaid.d.mts +2 -2
- package/es/Mermaid/SyntaxMermaid/index.d.mts +2 -2
- package/es/Modal/Modal.d.mts +2 -2
- package/es/Modal/ModalProvider.d.mts +2 -2
- package/es/Modal/imperative.d.mts +2 -2
- package/es/MotionProvider/index.d.mts +2 -2
- package/es/Popover/ArrowIcon.d.mts +2 -2
- package/es/Popover/atoms.d.mts +9 -9
- package/es/Popover/context.d.mts +2 -2
- package/es/SearchBar/SearchBar.d.mts +2 -2
- package/es/Segmented/Segmented.d.mts +2 -2
- package/es/Select/Select.d.mts +2 -2
- package/es/SideNav/SideNav.d.mts +2 -2
- package/es/SliderWithInput/SliderWithInput.d.mts +2 -2
- package/es/SortableList/components/DragHandle.d.mts +2 -2
- package/es/SortableList/components/SortableItem.d.mts +2 -2
- package/es/ThemeProvider/ThemeProvider.d.mts +2 -2
- package/es/Toc/Toc.d.mts +2 -2
- package/es/Video/index.d.mts +2 -2
- package/es/awesome/AuroraBackground/AuroraBackground.d.mts +2 -2
- package/es/awesome/BottomGradientButton/BottomGradientButton.d.mts +2 -2
- package/es/awesome/Features/Features.d.mts +2 -2
- package/es/awesome/Giscus/Giscus.d.mts +2 -2
- package/es/awesome/GradientButton/GradientButton.d.mts +2 -2
- package/es/awesome/GridBackground/GridBackground.d.mts +2 -2
- package/es/awesome/GridBackground/GridShowcase.d.mts +2 -2
- package/es/awesome/Hero/Hero.d.mts +2 -2
- package/es/awesome/Spline/Spine.d.mts +2 -2
- package/es/awesome/Spotlight/Spotlight.d.mts +2 -2
- package/es/awesome/SpotlightCard/SpotlightCard.d.mts +2 -2
- package/es/awesome/TypewriterEffect/TypewriterEffect.d.mts +2 -2
- package/es/base-ui/ContextMenu/ContextMenuHost.d.mts +3 -3
- package/es/base-ui/DropdownMenu/DropdownMenu.d.mts +2 -2
- package/es/base-ui/DropdownMenu/atoms.d.mts +18 -18
- package/es/base-ui/Modal/Modal.d.mts +8 -0
- package/es/base-ui/Modal/Modal.mjs +230 -0
- package/es/base-ui/Modal/Modal.mjs.map +1 -0
- package/es/base-ui/Modal/atoms.d.mts +100 -0
- package/es/base-ui/Modal/atoms.mjs +187 -0
- package/es/base-ui/Modal/atoms.mjs.map +1 -0
- package/es/base-ui/Modal/constants.d.mts +10 -0
- package/es/base-ui/Modal/constants.mjs +27 -0
- package/es/base-ui/Modal/constants.mjs.map +1 -0
- package/es/base-ui/Modal/context.d.mts +9 -0
- package/es/base-ui/Modal/context.mjs +14 -0
- package/es/base-ui/Modal/context.mjs.map +1 -0
- package/es/base-ui/Modal/imperative.d.mts +25 -0
- package/es/base-ui/Modal/imperative.mjs +221 -0
- package/es/base-ui/Modal/imperative.mjs.map +1 -0
- package/es/base-ui/Modal/index.d.mts +6 -0
- package/es/base-ui/Modal/style.mjs +295 -0
- package/es/base-ui/Modal/style.mjs.map +1 -0
- package/es/base-ui/Modal/type.d.mts +110 -0
- package/es/base-ui/ScrollArea/atoms.d.mts +7 -7
- package/es/base-ui/Select/Select.d.mts +2 -2
- package/es/base-ui/Select/atoms.d.mts +19 -19
- package/es/base-ui/Switch/Switch.d.mts +2 -2
- package/es/base-ui/Toast/imperative.d.mts +2 -2
- package/es/base-ui/index.d.mts +8 -1
- package/es/base-ui/index.mjs +6 -1
- package/es/brand/LobeChat/index.d.mts +2 -2
- package/es/brand/LobeHub/index.d.mts +2 -2
- package/es/brand/LogoThree/LogoSpline.d.mts +2 -2
- package/es/brand/LogoThree/index.d.mts +2 -2
- package/es/chat/BackBottom/BackBottom.d.mts +2 -2
- package/es/chat/ChatInputArea/components/ChatInputAreaInner.d.mts +2 -2
- package/es/chat/ChatItem/ChatItem.d.mts +2 -2
- package/es/chat/ChatList/ChatList.d.mts +2 -2
- package/es/chat/EditableMessage/EditableMessage.d.mts +2 -2
- package/es/chat/EditableMessageList/EditableMessageList.d.mts +2 -2
- package/es/chat/MessageInput/MessageInput.d.mts +2 -2
- package/es/chat/MessageModal/MessageModal.d.mts +2 -2
- package/es/color/ColorScales/index.d.mts +2 -2
- package/es/color/CssVar/index.d.mts +2 -2
- package/es/i18n/context.d.mts +2 -2
- package/es/icons/lucideExtra/BotPromptIcon.d.mts +2 -2
- package/es/icons/lucideExtra/CreateBotIcon.d.mts +3 -3
- package/es/icons/lucideExtra/DiscordIcon.d.mts +3 -3
- package/es/icons/lucideExtra/GlobeOffIcon.d.mts +2 -2
- package/es/icons/lucideExtra/GroupBotIcon.d.mts +2 -2
- package/es/icons/lucideExtra/GroupBotSquareIcon.d.mts +2 -2
- package/es/icons/lucideExtra/LeftClickIcon.d.mts +3 -3
- package/es/icons/lucideExtra/LeftDoubleClickIcon.d.mts +3 -3
- package/es/icons/lucideExtra/McpIcon.d.mts +3 -3
- package/es/icons/lucideExtra/ProviderIcon.d.mts +3 -3
- package/es/icons/lucideExtra/RightClickIcon.d.mts +3 -3
- package/es/icons/lucideExtra/RightDoubleClickIcon.d.mts +3 -3
- package/es/icons/lucideExtra/ShapesUploadIcon.d.mts +3 -3
- package/es/icons/lucideExtra/SkillsIcon.d.mts +3 -3
- package/es/icons/lucideExtra/TreeDownRightIcon.d.mts +3 -3
- package/es/icons/lucideExtra/TreeUpDownRightIcon.d.mts +3 -3
- package/es/mdx/Mdx/index.d.mts +2 -2
- package/es/mobile/ChatHeader/ChatHeaderTitle.d.mts +2 -2
- package/es/mobile/ChatInputArea/components/ChatSendButton.d.mts +2 -2
- package/es/mobile/TabBar/TabBar.d.mts +2 -2
- package/es/storybook/StoryBook/index.d.mts +2 -2
- package/package.json +3 -3
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { SpotlightCardProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react141 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/awesome/SpotlightCard/SpotlightCard.d.ts
|
|
5
|
-
declare const SpotlightCard:
|
|
5
|
+
declare const SpotlightCard: react141.NamedExoticComponent<SpotlightCardProps<any>>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { SpotlightCard };
|
|
8
8
|
//# sourceMappingURL=SpotlightCard.d.mts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { TypewriterEffectProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react132 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/awesome/TypewriterEffect/TypewriterEffect.d.ts
|
|
5
|
-
declare const TypewriterEffect:
|
|
5
|
+
declare const TypewriterEffect: react132.NamedExoticComponent<TypewriterEffectProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { TypewriterEffect };
|
|
8
8
|
//# sourceMappingURL=TypewriterEffect.d.mts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
1
|
+
import * as react158 from "react";
|
|
2
|
+
import * as react_jsx_runtime72 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/base-ui/ContextMenu/ContextMenuHost.d.ts
|
|
5
|
-
declare const ContextMenuHost:
|
|
5
|
+
declare const ContextMenuHost: react158.MemoExoticComponent<() => react_jsx_runtime72.JSX.Element | null>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { ContextMenuHost };
|
|
8
8
|
//# sourceMappingURL=ContextMenuHost.d.mts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { DropdownMenuProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react130 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/base-ui/DropdownMenu/DropdownMenu.d.ts
|
|
5
|
-
declare const DropdownMenu:
|
|
5
|
+
declare const DropdownMenu: react130.NamedExoticComponent<DropdownMenuProps<unknown>>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { DropdownMenu };
|
|
8
8
|
//# sourceMappingURL=DropdownMenu.d.mts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DropdownMenuPlacement } from "./type.mjs";
|
|
2
2
|
import React from "react";
|
|
3
|
-
import * as
|
|
3
|
+
import * as react_jsx_runtime20 from "react/jsx-runtime";
|
|
4
4
|
import * as _base_ui_react_menu0 from "@base-ui/react/menu";
|
|
5
5
|
import { Menu } from "@base-ui/react/menu";
|
|
6
6
|
|
|
@@ -18,7 +18,7 @@ declare const DropdownMenuTrigger: {
|
|
|
18
18
|
nativeButton,
|
|
19
19
|
ref: refProp,
|
|
20
20
|
...rest
|
|
21
|
-
}: DropdownMenuTriggerProps):
|
|
21
|
+
}: DropdownMenuTriggerProps): react_jsx_runtime20.JSX.Element;
|
|
22
22
|
displayName: string;
|
|
23
23
|
};
|
|
24
24
|
type DropdownMenuPortalProps = React.ComponentProps<typeof Menu.Portal> & {
|
|
@@ -31,7 +31,7 @@ declare const DropdownMenuPortal: {
|
|
|
31
31
|
({
|
|
32
32
|
container,
|
|
33
33
|
...rest
|
|
34
|
-
}: DropdownMenuPortalProps):
|
|
34
|
+
}: DropdownMenuPortalProps): react_jsx_runtime20.JSX.Element;
|
|
35
35
|
displayName: string;
|
|
36
36
|
};
|
|
37
37
|
type DropdownMenuPositionerProps = React.ComponentProps<typeof Menu.Positioner> & {
|
|
@@ -48,7 +48,7 @@ declare const DropdownMenuPositioner: {
|
|
|
48
48
|
sideOffset,
|
|
49
49
|
children,
|
|
50
50
|
...rest
|
|
51
|
-
}: DropdownMenuPositionerProps):
|
|
51
|
+
}: DropdownMenuPositionerProps): react_jsx_runtime20.JSX.Element;
|
|
52
52
|
displayName: string;
|
|
53
53
|
};
|
|
54
54
|
type DropdownMenuPopupProps = React.ComponentProps<typeof Menu.Popup>;
|
|
@@ -56,7 +56,7 @@ declare const DropdownMenuPopup: {
|
|
|
56
56
|
({
|
|
57
57
|
className,
|
|
58
58
|
...rest
|
|
59
|
-
}: DropdownMenuPopupProps):
|
|
59
|
+
}: DropdownMenuPopupProps): react_jsx_runtime20.JSX.Element;
|
|
60
60
|
displayName: string;
|
|
61
61
|
};
|
|
62
62
|
type DropdownMenuItemProps = React.ComponentProps<typeof Menu.Item> & {
|
|
@@ -67,7 +67,7 @@ declare const DropdownMenuItem: {
|
|
|
67
67
|
className,
|
|
68
68
|
danger,
|
|
69
69
|
...rest
|
|
70
|
-
}: DropdownMenuItemProps):
|
|
70
|
+
}: DropdownMenuItemProps): react_jsx_runtime20.JSX.Element;
|
|
71
71
|
displayName: string;
|
|
72
72
|
};
|
|
73
73
|
type DropdownMenuCheckboxItemProps = React.ComponentProps<typeof Menu.CheckboxItem> & {
|
|
@@ -78,7 +78,7 @@ declare const DropdownMenuCheckboxItemPrimitive: {
|
|
|
78
78
|
className,
|
|
79
79
|
danger,
|
|
80
80
|
...rest
|
|
81
|
-
}: DropdownMenuCheckboxItemProps):
|
|
81
|
+
}: DropdownMenuCheckboxItemProps): react_jsx_runtime20.JSX.Element;
|
|
82
82
|
displayName: string;
|
|
83
83
|
};
|
|
84
84
|
type DropdownMenuSeparatorProps = React.ComponentProps<typeof Menu.Separator>;
|
|
@@ -86,7 +86,7 @@ declare const DropdownMenuSeparator: {
|
|
|
86
86
|
({
|
|
87
87
|
className,
|
|
88
88
|
...rest
|
|
89
|
-
}: DropdownMenuSeparatorProps):
|
|
89
|
+
}: DropdownMenuSeparatorProps): react_jsx_runtime20.JSX.Element;
|
|
90
90
|
displayName: string;
|
|
91
91
|
};
|
|
92
92
|
declare const DropdownMenuGroup: React.ForwardRefExoticComponent<_base_ui_react_menu0.MenuGroupProps & React.RefAttributes<Element>>;
|
|
@@ -95,7 +95,7 @@ declare const DropdownMenuGroupLabel: {
|
|
|
95
95
|
({
|
|
96
96
|
className,
|
|
97
97
|
...rest
|
|
98
|
-
}: DropdownMenuGroupLabelProps):
|
|
98
|
+
}: DropdownMenuGroupLabelProps): react_jsx_runtime20.JSX.Element;
|
|
99
99
|
displayName: string;
|
|
100
100
|
};
|
|
101
101
|
type DropdownMenuSubmenuTriggerProps = React.ComponentProps<typeof Menu.SubmenuTrigger> & {
|
|
@@ -106,7 +106,7 @@ declare const DropdownMenuSubmenuTrigger: {
|
|
|
106
106
|
className,
|
|
107
107
|
danger,
|
|
108
108
|
...rest
|
|
109
|
-
}: DropdownMenuSubmenuTriggerProps):
|
|
109
|
+
}: DropdownMenuSubmenuTriggerProps): react_jsx_runtime20.JSX.Element;
|
|
110
110
|
displayName: string;
|
|
111
111
|
};
|
|
112
112
|
type DropdownMenuItemContentProps = React.HTMLAttributes<HTMLDivElement>;
|
|
@@ -114,7 +114,7 @@ declare const DropdownMenuItemContent: {
|
|
|
114
114
|
({
|
|
115
115
|
className,
|
|
116
116
|
...rest
|
|
117
|
-
}: DropdownMenuItemContentProps):
|
|
117
|
+
}: DropdownMenuItemContentProps): react_jsx_runtime20.JSX.Element;
|
|
118
118
|
displayName: string;
|
|
119
119
|
};
|
|
120
120
|
type DropdownMenuItemIconProps = React.HTMLAttributes<HTMLSpanElement>;
|
|
@@ -122,7 +122,7 @@ declare const DropdownMenuItemIcon: {
|
|
|
122
122
|
({
|
|
123
123
|
className,
|
|
124
124
|
...rest
|
|
125
|
-
}: DropdownMenuItemIconProps):
|
|
125
|
+
}: DropdownMenuItemIconProps): react_jsx_runtime20.JSX.Element;
|
|
126
126
|
displayName: string;
|
|
127
127
|
};
|
|
128
128
|
type DropdownMenuItemLabelGroupProps = React.HTMLAttributes<HTMLDivElement>;
|
|
@@ -130,7 +130,7 @@ declare const DropdownMenuItemLabelGroup: {
|
|
|
130
130
|
({
|
|
131
131
|
className,
|
|
132
132
|
...rest
|
|
133
|
-
}: DropdownMenuItemLabelGroupProps):
|
|
133
|
+
}: DropdownMenuItemLabelGroupProps): react_jsx_runtime20.JSX.Element;
|
|
134
134
|
displayName: string;
|
|
135
135
|
};
|
|
136
136
|
type DropdownMenuItemLabelProps = React.HTMLAttributes<HTMLSpanElement>;
|
|
@@ -138,7 +138,7 @@ declare const DropdownMenuItemLabel: {
|
|
|
138
138
|
({
|
|
139
139
|
className,
|
|
140
140
|
...rest
|
|
141
|
-
}: DropdownMenuItemLabelProps):
|
|
141
|
+
}: DropdownMenuItemLabelProps): react_jsx_runtime20.JSX.Element;
|
|
142
142
|
displayName: string;
|
|
143
143
|
};
|
|
144
144
|
type DropdownMenuItemDescProps = React.HTMLAttributes<HTMLSpanElement>;
|
|
@@ -146,7 +146,7 @@ declare const DropdownMenuItemDesc: {
|
|
|
146
146
|
({
|
|
147
147
|
className,
|
|
148
148
|
...rest
|
|
149
|
-
}: DropdownMenuItemDescProps):
|
|
149
|
+
}: DropdownMenuItemDescProps): react_jsx_runtime20.JSX.Element;
|
|
150
150
|
displayName: string;
|
|
151
151
|
};
|
|
152
152
|
type DropdownMenuItemExtraProps = React.HTMLAttributes<HTMLSpanElement>;
|
|
@@ -154,7 +154,7 @@ declare const DropdownMenuItemExtra: {
|
|
|
154
154
|
({
|
|
155
155
|
className,
|
|
156
156
|
...rest
|
|
157
|
-
}: DropdownMenuItemExtraProps):
|
|
157
|
+
}: DropdownMenuItemExtraProps): react_jsx_runtime20.JSX.Element;
|
|
158
158
|
displayName: string;
|
|
159
159
|
};
|
|
160
160
|
type DropdownMenuSubmenuArrowProps = React.HTMLAttributes<HTMLSpanElement>;
|
|
@@ -162,7 +162,7 @@ declare const DropdownMenuSubmenuArrow: {
|
|
|
162
162
|
({
|
|
163
163
|
className,
|
|
164
164
|
...rest
|
|
165
|
-
}: DropdownMenuSubmenuArrowProps):
|
|
165
|
+
}: DropdownMenuSubmenuArrowProps): react_jsx_runtime20.JSX.Element;
|
|
166
166
|
displayName: string;
|
|
167
167
|
};
|
|
168
168
|
type DropdownMenuSwitchItemProps = Omit<React.ComponentProps<typeof Menu.Item>, 'onClick'> & {
|
|
@@ -183,7 +183,7 @@ declare const DropdownMenuSwitchItem: {
|
|
|
183
183
|
onCheckedChange,
|
|
184
184
|
children,
|
|
185
185
|
...rest
|
|
186
|
-
}: DropdownMenuSwitchItemProps):
|
|
186
|
+
}: DropdownMenuSwitchItemProps): react_jsx_runtime20.JSX.Element;
|
|
187
187
|
displayName: string;
|
|
188
188
|
};
|
|
189
189
|
//#endregion
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ModalComponentProps } from "./type.mjs";
|
|
2
|
+
import React from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/base-ui/Modal/Modal.d.ts
|
|
5
|
+
declare const Modal: React.NamedExoticComponent<ModalComponentProps>;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { Modal };
|
|
8
|
+
//# sourceMappingURL=Modal.d.mts.map
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { stopPropagation } from "../../utils/dom.mjs";
|
|
4
|
+
import { styles } from "./style.mjs";
|
|
5
|
+
import { ModalBackdrop, ModalContent, ModalFooter, ModalHeader, ModalPopup, ModalPortal, ModalRoot, ModalTitle } from "./atoms.mjs";
|
|
6
|
+
import { memo, useCallback, useMemo, useRef, useState } from "react";
|
|
7
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { cx } from "antd-style";
|
|
9
|
+
import { useDragControls } from "motion/react";
|
|
10
|
+
import { Maximize2, Minimize2, X } from "lucide-react";
|
|
11
|
+
|
|
12
|
+
//#region src/base-ui/Modal/Modal.tsx
|
|
13
|
+
const OkBtn = ({ confirmLoading, okButtonProps, okText, onOk }) => {
|
|
14
|
+
const { className: userCls, danger, disabled: userDisabled, onClick: userOnClick, ...restOk } = okButtonProps ?? {};
|
|
15
|
+
return /* @__PURE__ */ jsxs("button", {
|
|
16
|
+
type: "button",
|
|
17
|
+
...restOk,
|
|
18
|
+
className: cx(styles.buttonBase, danger ? styles.dangerOkButton : styles.okButton, userCls),
|
|
19
|
+
disabled: confirmLoading || userDisabled,
|
|
20
|
+
onClick: (e) => {
|
|
21
|
+
onOk(e);
|
|
22
|
+
userOnClick?.(e);
|
|
23
|
+
},
|
|
24
|
+
children: [confirmLoading && /* @__PURE__ */ jsx("span", { className: styles.loadingSpinner }), okText]
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
const CancelBtn = ({ cancelButtonProps, cancelText, onCancel }) => {
|
|
28
|
+
const { className: userCls, onClick: userOnClick, ...restCancel } = cancelButtonProps ?? {};
|
|
29
|
+
return /* @__PURE__ */ jsx("button", {
|
|
30
|
+
type: "button",
|
|
31
|
+
...restCancel,
|
|
32
|
+
className: cx(styles.buttonBase, styles.cancelButton, userCls),
|
|
33
|
+
onClick: (e) => {
|
|
34
|
+
onCancel(e);
|
|
35
|
+
userOnClick?.(e);
|
|
36
|
+
},
|
|
37
|
+
children: cancelText
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
const Modal = memo(({ open, title, children, onOk, onCancel, okText = "OK", cancelText = "Cancel", okButtonProps, cancelButtonProps, confirmLoading, footer, width, height, maskClosable = true, closable = true, closeIcon, className, style, classNames, styles: semanticStyles, zIndex, afterClose, afterOpenChange, loading, getContainer, mask = true, keyboard, draggable = true, allowFullscreen = false }) => {
|
|
41
|
+
const dragControls = useDragControls();
|
|
42
|
+
const constraintsRef = useRef(null);
|
|
43
|
+
const [isFullscreen, setIsFullscreen] = useState(false);
|
|
44
|
+
const [isDragging, setIsDragging] = useState(false);
|
|
45
|
+
const handleOpenChange = useCallback((nextOpen, eventDetails) => {
|
|
46
|
+
if (!open) return;
|
|
47
|
+
if (!nextOpen && keyboard === false && eventDetails.reason === "escape-key") return;
|
|
48
|
+
if (!nextOpen && !maskClosable && eventDetails.reason === "outside-press") return;
|
|
49
|
+
if (!nextOpen) onCancel?.(new MouseEvent("click"));
|
|
50
|
+
}, [
|
|
51
|
+
onCancel,
|
|
52
|
+
keyboard,
|
|
53
|
+
maskClosable,
|
|
54
|
+
open
|
|
55
|
+
]);
|
|
56
|
+
const handleExitComplete = useCallback(() => {
|
|
57
|
+
setIsFullscreen(false);
|
|
58
|
+
afterClose?.();
|
|
59
|
+
afterOpenChange?.(false);
|
|
60
|
+
}, [afterClose, afterOpenChange]);
|
|
61
|
+
const handleAnimationComplete = useCallback(() => {
|
|
62
|
+
if (open) afterOpenChange?.(true);
|
|
63
|
+
}, [open, afterOpenChange]);
|
|
64
|
+
const handleDragStart = useCallback((e) => {
|
|
65
|
+
if (draggable && !isFullscreen) {
|
|
66
|
+
dragControls.start(e);
|
|
67
|
+
setIsDragging(true);
|
|
68
|
+
}
|
|
69
|
+
}, [
|
|
70
|
+
draggable,
|
|
71
|
+
dragControls,
|
|
72
|
+
isFullscreen
|
|
73
|
+
]);
|
|
74
|
+
const handleDragEnd = useCallback(() => {
|
|
75
|
+
setIsDragging(false);
|
|
76
|
+
}, []);
|
|
77
|
+
const handleOk = useCallback((e) => {
|
|
78
|
+
onOk?.(e);
|
|
79
|
+
}, [onOk]);
|
|
80
|
+
const handleCancel = useCallback((e) => {
|
|
81
|
+
onCancel?.(e);
|
|
82
|
+
}, [onCancel]);
|
|
83
|
+
const footerNode = useMemo(() => {
|
|
84
|
+
if (footer === false || footer === null) return null;
|
|
85
|
+
const cancelBtnNode = /* @__PURE__ */ jsx(CancelBtn, {
|
|
86
|
+
cancelButtonProps,
|
|
87
|
+
cancelText,
|
|
88
|
+
onCancel: handleCancel
|
|
89
|
+
});
|
|
90
|
+
const okBtnNode = /* @__PURE__ */ jsx(OkBtn, {
|
|
91
|
+
confirmLoading,
|
|
92
|
+
okButtonProps,
|
|
93
|
+
okText,
|
|
94
|
+
onOk: handleOk
|
|
95
|
+
});
|
|
96
|
+
const defaultFooter = /* @__PURE__ */ jsxs(Fragment$1, { children: [cancelBtnNode, okBtnNode] });
|
|
97
|
+
if (typeof footer === "function") {
|
|
98
|
+
const BoundCancelBtn = () => cancelBtnNode;
|
|
99
|
+
const BoundOkBtn = () => okBtnNode;
|
|
100
|
+
return footer(defaultFooter, {
|
|
101
|
+
CancelBtn: BoundCancelBtn,
|
|
102
|
+
OkBtn: BoundOkBtn
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
return footer ?? defaultFooter;
|
|
106
|
+
}, [
|
|
107
|
+
footer,
|
|
108
|
+
cancelButtonProps,
|
|
109
|
+
cancelText,
|
|
110
|
+
handleCancel,
|
|
111
|
+
confirmLoading,
|
|
112
|
+
okButtonProps,
|
|
113
|
+
okText,
|
|
114
|
+
handleOk
|
|
115
|
+
]);
|
|
116
|
+
const container = getContainer === false ? void 0 : getContainer ?? void 0;
|
|
117
|
+
const backdropZIndex = zIndex ? { zIndex } : void 0;
|
|
118
|
+
const popupZIndex = zIndex ? { zIndex: (zIndex || 1e3) + 1 } : void 0;
|
|
119
|
+
const shouldDrag = draggable && !isFullscreen;
|
|
120
|
+
const dragProps = shouldDrag ? {
|
|
121
|
+
drag: true,
|
|
122
|
+
dragConstraints: constraintsRef,
|
|
123
|
+
dragControls,
|
|
124
|
+
dragElastic: 0,
|
|
125
|
+
dragListener: false,
|
|
126
|
+
dragMomentum: false,
|
|
127
|
+
whileDrag: { cursor: "grabbing" }
|
|
128
|
+
} : {};
|
|
129
|
+
const showTitle = title !== void 0 && title !== false && title !== null;
|
|
130
|
+
const showHeader = showTitle || closable || allowFullscreen;
|
|
131
|
+
const hasHeight = height !== void 0;
|
|
132
|
+
const panelStyle = {
|
|
133
|
+
...hasHeight && !isFullscreen ? { height } : {},
|
|
134
|
+
...style
|
|
135
|
+
};
|
|
136
|
+
return /* @__PURE__ */ jsx(ModalRoot, {
|
|
137
|
+
open: open ?? false,
|
|
138
|
+
onExitComplete: handleExitComplete,
|
|
139
|
+
onOpenChange: handleOpenChange,
|
|
140
|
+
children: /* @__PURE__ */ jsxs(ModalPortal, {
|
|
141
|
+
container,
|
|
142
|
+
children: [mask && /* @__PURE__ */ jsx(ModalBackdrop, {
|
|
143
|
+
className: classNames?.mask,
|
|
144
|
+
style: {
|
|
145
|
+
...backdropZIndex,
|
|
146
|
+
...semanticStyles?.mask
|
|
147
|
+
}
|
|
148
|
+
}), /* @__PURE__ */ jsxs(ModalPopup, {
|
|
149
|
+
className: classNames?.wrapper,
|
|
150
|
+
panelClassName: cx(className, isFullscreen && styles.fullscreenPopupInner),
|
|
151
|
+
popupStyle: {
|
|
152
|
+
...popupZIndex,
|
|
153
|
+
...semanticStyles?.wrapper
|
|
154
|
+
},
|
|
155
|
+
ref: constraintsRef,
|
|
156
|
+
style: panelStyle,
|
|
157
|
+
width: isFullscreen ? void 0 : width,
|
|
158
|
+
motionProps: {
|
|
159
|
+
...dragProps,
|
|
160
|
+
onAnimationComplete: handleAnimationComplete
|
|
161
|
+
},
|
|
162
|
+
children: [
|
|
163
|
+
showHeader && /* @__PURE__ */ jsxs(ModalHeader, {
|
|
164
|
+
className: cx(classNames?.header, shouldDrag && styles.headerDraggable),
|
|
165
|
+
style: {
|
|
166
|
+
...isDragging ? { cursor: "grabbing" } : {},
|
|
167
|
+
...semanticStyles?.header
|
|
168
|
+
},
|
|
169
|
+
onPointerCancel: handleDragEnd,
|
|
170
|
+
onPointerDown: handleDragStart,
|
|
171
|
+
onPointerUp: handleDragEnd,
|
|
172
|
+
children: [showTitle ? /* @__PURE__ */ jsx(ModalTitle, {
|
|
173
|
+
className: classNames?.title,
|
|
174
|
+
style: semanticStyles?.title,
|
|
175
|
+
children: title
|
|
176
|
+
}) : /* @__PURE__ */ jsx("span", {}), /* @__PURE__ */ jsxs("div", {
|
|
177
|
+
className: styles.headerActions,
|
|
178
|
+
onPointerDown: stopPropagation,
|
|
179
|
+
children: [allowFullscreen && /* @__PURE__ */ jsx("button", {
|
|
180
|
+
"aria-label": isFullscreen ? "Exit fullscreen" : "Fullscreen",
|
|
181
|
+
className: styles.fullscreenToggle,
|
|
182
|
+
type: "button",
|
|
183
|
+
onClick: () => setIsFullscreen((prev) => !prev),
|
|
184
|
+
children: isFullscreen ? /* @__PURE__ */ jsx(Minimize2, { size: 14 }) : /* @__PURE__ */ jsx(Maximize2, { size: 14 })
|
|
185
|
+
}), closable && /* @__PURE__ */ jsx("button", {
|
|
186
|
+
"aria-label": "Close",
|
|
187
|
+
className: styles.closeInline,
|
|
188
|
+
type: "button",
|
|
189
|
+
onClick: handleCancel,
|
|
190
|
+
children: closeIcon ?? /* @__PURE__ */ jsx(X, { size: 18 })
|
|
191
|
+
})]
|
|
192
|
+
})]
|
|
193
|
+
}),
|
|
194
|
+
/* @__PURE__ */ jsx(ModalContent, {
|
|
195
|
+
className: classNames?.body,
|
|
196
|
+
style: {
|
|
197
|
+
...hasHeight || isFullscreen ? { flex: 1 } : {},
|
|
198
|
+
...semanticStyles?.body
|
|
199
|
+
},
|
|
200
|
+
children: loading ? /* @__PURE__ */ jsx("div", {
|
|
201
|
+
style: {
|
|
202
|
+
display: "flex",
|
|
203
|
+
justifyContent: "center",
|
|
204
|
+
padding: "32px 0"
|
|
205
|
+
},
|
|
206
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
207
|
+
className: styles.loadingSpinner,
|
|
208
|
+
style: {
|
|
209
|
+
height: 24,
|
|
210
|
+
width: 24
|
|
211
|
+
}
|
|
212
|
+
})
|
|
213
|
+
}) : children
|
|
214
|
+
}),
|
|
215
|
+
footerNode !== null && /* @__PURE__ */ jsx(ModalFooter, {
|
|
216
|
+
className: classNames?.footer,
|
|
217
|
+
style: semanticStyles?.footer,
|
|
218
|
+
children: footerNode
|
|
219
|
+
})
|
|
220
|
+
]
|
|
221
|
+
})]
|
|
222
|
+
})
|
|
223
|
+
});
|
|
224
|
+
});
|
|
225
|
+
Modal.displayName = "Modal";
|
|
226
|
+
var Modal_default = Modal;
|
|
227
|
+
|
|
228
|
+
//#endregion
|
|
229
|
+
export { Modal_default as default };
|
|
230
|
+
//# sourceMappingURL=Modal.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Modal.mjs","names":["OkBtn: React.FC<OkBtnProps>","CancelBtn: React.FC<CancelBtnProps>","BoundCancelBtn: React.FC","BoundOkBtn: React.FC","panelStyle: React.CSSProperties"],"sources":["../../../src/base-ui/Modal/Modal.tsx"],"sourcesContent":["'use client';\n\nimport { cx } from 'antd-style';\nimport { Maximize2, Minimize2, X } from 'lucide-react';\nimport { useDragControls } from 'motion/react';\nimport type { MouseEvent, PointerEvent } from 'react';\nimport type React from 'react';\nimport { memo, useCallback, useMemo, useRef, useState } from 'react';\n\nimport { stopPropagation } from '@/utils/dom';\n\nimport {\n ModalBackdrop,\n ModalContent,\n ModalFooter,\n ModalHeader,\n ModalPopup,\n ModalPortal,\n ModalRoot,\n ModalTitle,\n} from './atoms';\nimport { styles } from './style';\nimport type { ModalComponentProps } from './type';\n\ninterface OkBtnProps {\n confirmLoading?: boolean;\n okButtonProps?: ModalComponentProps['okButtonProps'];\n okText?: React.ReactNode;\n onOk: (e: MouseEvent<HTMLButtonElement>) => void;\n}\n\nconst OkBtn: React.FC<OkBtnProps> = ({ confirmLoading, okButtonProps, okText, onOk }) => {\n const {\n className: userCls,\n danger,\n disabled: userDisabled,\n onClick: userOnClick,\n ...restOk\n } = okButtonProps ?? {};\n return (\n <button\n type=\"button\"\n {...restOk}\n className={cx(styles.buttonBase, danger ? styles.dangerOkButton : styles.okButton, userCls)}\n disabled={confirmLoading || userDisabled}\n onClick={(e) => {\n onOk(e);\n userOnClick?.(e);\n }}\n >\n {confirmLoading && <span className={styles.loadingSpinner} />}\n {okText}\n </button>\n );\n};\ninterface CancelBtnProps {\n cancelButtonProps?: ModalComponentProps['cancelButtonProps'];\n cancelText?: React.ReactNode;\n onCancel: (e: MouseEvent<HTMLButtonElement>) => void;\n}\n\nconst CancelBtn: React.FC<CancelBtnProps> = ({ cancelButtonProps, cancelText, onCancel }) => {\n const { className: userCls, onClick: userOnClick, ...restCancel } = cancelButtonProps ?? {};\n return (\n <button\n type=\"button\"\n {...restCancel}\n className={cx(styles.buttonBase, styles.cancelButton, userCls)}\n onClick={(e) => {\n onCancel(e);\n userOnClick?.(e);\n }}\n >\n {cancelText}\n </button>\n );\n};\n\nconst Modal = memo<ModalComponentProps>(\n ({\n open,\n title,\n children,\n onOk,\n onCancel,\n okText = 'OK',\n cancelText = 'Cancel',\n okButtonProps,\n cancelButtonProps,\n confirmLoading,\n footer,\n width,\n height,\n maskClosable = true,\n closable = true,\n closeIcon,\n className,\n style,\n classNames,\n styles: semanticStyles,\n zIndex,\n afterClose,\n afterOpenChange,\n loading,\n getContainer,\n mask = true,\n keyboard,\n draggable = true,\n allowFullscreen = false,\n }) => {\n const dragControls = useDragControls();\n const constraintsRef = useRef<HTMLDivElement>(null);\n const [isFullscreen, setIsFullscreen] = useState(false);\n const [isDragging, setIsDragging] = useState(false);\n\n const handleOpenChange = useCallback(\n (nextOpen: boolean, eventDetails: { reason: string }) => {\n if (!open) return;\n if (!nextOpen && keyboard === false && eventDetails.reason === 'escape-key') return;\n if (!nextOpen && !maskClosable && eventDetails.reason === 'outside-press') return;\n if (!nextOpen) {\n onCancel?.(new MouseEvent('click') as unknown as MouseEvent<HTMLButtonElement>);\n }\n },\n [onCancel, keyboard, maskClosable, open],\n );\n\n const handleExitComplete = useCallback(() => {\n setIsFullscreen(false);\n afterClose?.();\n afterOpenChange?.(false);\n }, [afterClose, afterOpenChange]);\n\n const handleAnimationComplete = useCallback(() => {\n if (open) afterOpenChange?.(true);\n }, [open, afterOpenChange]);\n\n const handleDragStart = useCallback(\n (e: PointerEvent) => {\n if (draggable && !isFullscreen) {\n dragControls.start(e);\n setIsDragging(true);\n }\n },\n [draggable, dragControls, isFullscreen],\n );\n\n const handleDragEnd = useCallback(() => {\n setIsDragging(false);\n }, []);\n\n const handleOk = useCallback(\n (e: MouseEvent<HTMLButtonElement>) => {\n onOk?.(e);\n },\n [onOk],\n );\n\n const handleCancel = useCallback(\n (e: MouseEvent<HTMLButtonElement>) => {\n onCancel?.(e);\n },\n [onCancel],\n );\n\n const footerNode = useMemo(() => {\n if (footer === false || footer === null) return null;\n const cancelBtnNode = (\n <CancelBtn\n cancelButtonProps={cancelButtonProps}\n cancelText={cancelText}\n onCancel={handleCancel}\n />\n );\n const okBtnNode = (\n <OkBtn\n confirmLoading={confirmLoading}\n okButtonProps={okButtonProps}\n okText={okText}\n onOk={handleOk}\n />\n );\n const defaultFooter = (\n <>\n {cancelBtnNode}\n {okBtnNode}\n </>\n );\n\n if (typeof footer === 'function') {\n const BoundCancelBtn: React.FC = () => cancelBtnNode;\n const BoundOkBtn: React.FC = () => okBtnNode;\n return footer(defaultFooter, { CancelBtn: BoundCancelBtn, OkBtn: BoundOkBtn });\n }\n\n return footer ?? defaultFooter;\n }, [\n footer,\n cancelButtonProps,\n cancelText,\n handleCancel,\n confirmLoading,\n okButtonProps,\n okText,\n handleOk,\n ]);\n\n const container = getContainer === false ? undefined : (getContainer ?? undefined);\n const backdropZIndex = zIndex ? { zIndex } : undefined;\n const popupZIndex = zIndex ? { zIndex: (zIndex || 1000) + 1 } : undefined;\n\n const shouldDrag = draggable && !isFullscreen;\n const dragProps = shouldDrag\n ? {\n drag: true as const,\n dragConstraints: constraintsRef,\n dragControls,\n dragElastic: 0,\n dragListener: false,\n dragMomentum: false,\n whileDrag: { cursor: 'grabbing' as const },\n }\n : {};\n\n const showTitle = title !== undefined && title !== false && title !== null;\n const showHeader = showTitle || closable || allowFullscreen;\n\n const hasHeight = height !== undefined;\n const panelStyle: React.CSSProperties = {\n ...(hasHeight && !isFullscreen ? { height } : {}),\n ...style,\n };\n\n return (\n <ModalRoot\n open={open ?? false}\n onExitComplete={handleExitComplete}\n onOpenChange={handleOpenChange}\n >\n <ModalPortal container={container}>\n {mask && (\n <ModalBackdrop\n className={classNames?.mask}\n style={{ ...backdropZIndex, ...semanticStyles?.mask }}\n />\n )}\n <ModalPopup\n className={classNames?.wrapper}\n panelClassName={cx(className, isFullscreen && styles.fullscreenPopupInner)}\n popupStyle={{ ...popupZIndex, ...semanticStyles?.wrapper }}\n ref={constraintsRef}\n style={panelStyle}\n width={isFullscreen ? undefined : width}\n motionProps={{\n ...dragProps,\n onAnimationComplete: handleAnimationComplete,\n }}\n >\n {showHeader && (\n <ModalHeader\n className={cx(classNames?.header, shouldDrag && styles.headerDraggable)}\n style={{\n ...(isDragging ? { cursor: 'grabbing' } : {}),\n ...semanticStyles?.header,\n }}\n onPointerCancel={handleDragEnd}\n onPointerDown={handleDragStart}\n onPointerUp={handleDragEnd}\n >\n {showTitle ? (\n <ModalTitle className={classNames?.title} style={semanticStyles?.title}>\n {title}\n </ModalTitle>\n ) : (\n <span />\n )}\n <div className={styles.headerActions} onPointerDown={stopPropagation}>\n {allowFullscreen && (\n <button\n aria-label={isFullscreen ? 'Exit fullscreen' : 'Fullscreen'}\n className={styles.fullscreenToggle}\n type=\"button\"\n onClick={() => setIsFullscreen((prev) => !prev)}\n >\n {isFullscreen ? <Minimize2 size={14} /> : <Maximize2 size={14} />}\n </button>\n )}\n {closable && (\n <button\n aria-label=\"Close\"\n className={styles.closeInline}\n type=\"button\"\n onClick={handleCancel}\n >\n {closeIcon ?? <X size={18} />}\n </button>\n )}\n </div>\n </ModalHeader>\n )}\n <ModalContent\n className={classNames?.body}\n style={{\n ...(hasHeight || isFullscreen ? { flex: 1 } : {}),\n ...semanticStyles?.body,\n }}\n >\n {loading ? (\n <div\n style={{\n display: 'flex',\n justifyContent: 'center',\n padding: '32px 0',\n }}\n >\n <span className={styles.loadingSpinner} style={{ height: 24, width: 24 }} />\n </div>\n ) : (\n children\n )}\n </ModalContent>\n {footerNode !== null && (\n <ModalFooter className={classNames?.footer} style={semanticStyles?.footer}>\n {footerNode}\n </ModalFooter>\n )}\n </ModalPopup>\n </ModalPortal>\n </ModalRoot>\n );\n },\n);\n\nModal.displayName = 'Modal';\n\nexport default Modal;\n"],"mappings":"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"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import * as react_jsx_runtime46 from "react/jsx-runtime";
|
|
3
|
+
import { Dialog } from "@base-ui/react/dialog";
|
|
4
|
+
|
|
5
|
+
//#region src/base-ui/Modal/atoms.d.ts
|
|
6
|
+
interface ModalAnimationActions {
|
|
7
|
+
onExitComplete: () => void;
|
|
8
|
+
}
|
|
9
|
+
declare const useModalOpen: () => boolean | null;
|
|
10
|
+
declare const useModalActions: () => ModalAnimationActions | null;
|
|
11
|
+
type ModalRootProps = Dialog.Root.Props & {
|
|
12
|
+
onExitComplete?: () => void;
|
|
13
|
+
};
|
|
14
|
+
declare const ModalRoot: ({
|
|
15
|
+
open,
|
|
16
|
+
onExitComplete,
|
|
17
|
+
...rest
|
|
18
|
+
}: ModalRootProps) => react_jsx_runtime46.JSX.Element;
|
|
19
|
+
type ModalPortalProps = React.ComponentProps<typeof Dialog.Portal> & {
|
|
20
|
+
container?: HTMLElement | null;
|
|
21
|
+
};
|
|
22
|
+
declare const ModalPortal: ({
|
|
23
|
+
container,
|
|
24
|
+
...rest
|
|
25
|
+
}: ModalPortalProps) => react_jsx_runtime46.JSX.Element;
|
|
26
|
+
type ModalViewportProps = React.ComponentProps<typeof Dialog.Viewport>;
|
|
27
|
+
declare const ModalViewport: ({
|
|
28
|
+
className,
|
|
29
|
+
...rest
|
|
30
|
+
}: ModalViewportProps) => react_jsx_runtime46.JSX.Element;
|
|
31
|
+
type ModalBackdropProps = React.ComponentProps<typeof Dialog.Backdrop>;
|
|
32
|
+
declare const ModalBackdrop: ({
|
|
33
|
+
className,
|
|
34
|
+
style,
|
|
35
|
+
...rest
|
|
36
|
+
}: ModalBackdropProps) => react_jsx_runtime46.JSX.Element;
|
|
37
|
+
type ModalPopupProps = React.ComponentProps<typeof Dialog.Popup> & {
|
|
38
|
+
motionProps?: Record<string, any>;
|
|
39
|
+
panelClassName?: string;
|
|
40
|
+
popupStyle?: React.CSSProperties;
|
|
41
|
+
width?: number | string;
|
|
42
|
+
};
|
|
43
|
+
declare const ModalPopup: ({
|
|
44
|
+
className,
|
|
45
|
+
children,
|
|
46
|
+
width,
|
|
47
|
+
style,
|
|
48
|
+
motionProps,
|
|
49
|
+
panelClassName,
|
|
50
|
+
popupStyle,
|
|
51
|
+
...rest
|
|
52
|
+
}: ModalPopupProps) => react_jsx_runtime46.JSX.Element;
|
|
53
|
+
type ModalHeaderProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
54
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
55
|
+
};
|
|
56
|
+
declare const ModalHeader: ({
|
|
57
|
+
className,
|
|
58
|
+
...rest
|
|
59
|
+
}: ModalHeaderProps) => react_jsx_runtime46.JSX.Element;
|
|
60
|
+
type ModalTitleProps = React.ComponentProps<typeof Dialog.Title>;
|
|
61
|
+
declare const ModalTitle: ({
|
|
62
|
+
className,
|
|
63
|
+
...rest
|
|
64
|
+
}: ModalTitleProps) => react_jsx_runtime46.JSX.Element;
|
|
65
|
+
type ModalDescriptionProps = React.ComponentProps<typeof Dialog.Description>;
|
|
66
|
+
declare const ModalDescription: React.FC<ModalDescriptionProps>;
|
|
67
|
+
type ModalContentProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
68
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
69
|
+
};
|
|
70
|
+
declare const ModalContent: ({
|
|
71
|
+
className,
|
|
72
|
+
...rest
|
|
73
|
+
}: ModalContentProps) => react_jsx_runtime46.JSX.Element;
|
|
74
|
+
type ModalFooterProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
75
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
76
|
+
};
|
|
77
|
+
declare const ModalFooter: ({
|
|
78
|
+
className,
|
|
79
|
+
...rest
|
|
80
|
+
}: ModalFooterProps) => react_jsx_runtime46.JSX.Element;
|
|
81
|
+
type ModalCloseProps = React.ComponentProps<typeof Dialog.Close>;
|
|
82
|
+
declare const ModalClose: ({
|
|
83
|
+
className,
|
|
84
|
+
children,
|
|
85
|
+
...rest
|
|
86
|
+
}: ModalCloseProps) => react_jsx_runtime46.JSX.Element;
|
|
87
|
+
type ModalTriggerProps = Omit<React.ComponentPropsWithRef<typeof Dialog.Trigger>, 'children' | 'render'> & {
|
|
88
|
+
children?: React.ReactNode;
|
|
89
|
+
nativeButton?: boolean;
|
|
90
|
+
};
|
|
91
|
+
declare const ModalTrigger: ({
|
|
92
|
+
children,
|
|
93
|
+
className,
|
|
94
|
+
nativeButton,
|
|
95
|
+
ref: refProp,
|
|
96
|
+
...rest
|
|
97
|
+
}: ModalTriggerProps) => react_jsx_runtime46.JSX.Element;
|
|
98
|
+
//#endregion
|
|
99
|
+
export { ModalBackdrop, ModalBackdropProps, ModalClose, ModalCloseProps, ModalContent, ModalContentProps, ModalDescription, ModalDescriptionProps, ModalFooter, ModalFooterProps, ModalHeader, ModalHeaderProps, ModalPopup, ModalPopupProps, ModalPortal, ModalPortalProps, ModalRoot, ModalRootProps, ModalTitle, ModalTitleProps, ModalTrigger, ModalTriggerProps, ModalViewport, ModalViewportProps, useModalActions, useModalOpen };
|
|
100
|
+
//# sourceMappingURL=atoms.d.mts.map
|