@lobehub/ui 4.35.3 → 4.36.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/Avatar.mjs +1 -1
- 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/ColorSwatches/ColorSwatches.mjs +1 -1
- package/es/ConfigProvider/index.d.mts +2 -2
- package/es/ContextMenu/ContextMenuHost.d.mts +3 -3
- package/es/ContextMenu/ContextMenuHost.mjs +14 -9
- package/es/ContextMenu/ContextMenuHost.mjs.map +1 -1
- 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/DropdownMenu/DropdownMenu.d.mts +2 -2
- package/es/DropdownMenu/atoms.d.mts +18 -18
- package/es/DropdownMenu/atoms.mjs +4 -2
- package/es/DropdownMenu/atoms.mjs.map +1 -1
- package/es/EditableText/EditableText.d.mts +2 -2
- package/es/EditorSlashMenu/atoms.d.mts +20 -14
- package/es/EditorSlashMenu/atoms.mjs +8 -1
- package/es/EditorSlashMenu/atoms.mjs.map +1 -1
- 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/Highlighter/Highlighter.d.mts +2 -2
- package/es/Highlighter/SyntaxHighlighter/index.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/LobeSelect/LobeSelect.d.mts +2 -2
- package/es/LobeSelect/atoms.d.mts +19 -19
- package/es/LobeSelect/atoms.mjs +3 -1
- package/es/LobeSelect/atoms.mjs.map +1 -1
- package/es/LobeSwitch/LobeSwitch.d.mts +2 -2
- package/es/LobeSwitch/atoms.d.mts +4 -4
- 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/PopoverPortal.mjs +8 -6
- package/es/Popover/PopoverPortal.mjs.map +1 -1
- package/es/Popover/atoms.d.mts +9 -9
- package/es/Popover/context.d.mts +2 -2
- package/es/ScrollArea/atoms.d.mts +7 -7
- 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/AppElementContext.d.mts +7 -0
- package/es/ThemeProvider/AppElementContext.mjs +14 -0
- package/es/ThemeProvider/AppElementContext.mjs.map +1 -0
- package/es/ThemeProvider/ThemeProvider.d.mts +2 -2
- package/es/ThemeProvider/ThemeProvider.mjs +9 -34
- package/es/ThemeProvider/ThemeProvider.mjs.map +1 -1
- package/es/ThemeProvider/index.d.mts +2 -1
- package/es/ThemeProvider/index.mjs +2 -1
- package/es/Toast/imperative.d.mts +3 -3
- package/es/Toc/Toc.d.mts +2 -2
- package/es/Tooltip/TooltipGroup.mjs +3 -3
- package/es/Tooltip/TooltipGroup.mjs.map +1 -1
- package/es/Tooltip/TooltipStandalone.mjs +3 -3
- package/es/Tooltip/TooltipStandalone.mjs.map +1 -1
- 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/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/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 +3 -3
- 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/TreeDownRightIcon.d.mts +3 -3
- package/es/icons/lucideExtra/TreeUpDownRightIcon.d.mts +3 -3
- package/es/index.d.mts +2 -1
- package/es/index.mjs +7 -6
- 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 +1 -1
- package/es/Tooltip/TooltipPortal.mjs +0 -38
- package/es/Tooltip/TooltipPortal.mjs.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { LayoutSidebarInnerProps } from "../type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react52 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Layout/components/LayoutSidebarInner.d.ts
|
|
5
|
-
declare const LayoutSidebarInner:
|
|
5
|
+
declare const LayoutSidebarInner: react52.NamedExoticComponent<LayoutSidebarInnerProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { LayoutSidebarInner };
|
|
8
8
|
//# sourceMappingURL=LayoutSidebarInner.d.mts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { LayoutTocProps } from "../type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react53 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Layout/components/LayoutToc.d.ts
|
|
5
|
-
declare const LayoutToc:
|
|
5
|
+
declare const LayoutToc: react53.NamedExoticComponent<LayoutTocProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { LayoutToc };
|
|
8
8
|
//# sourceMappingURL=LayoutToc.d.mts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ListItemProps } from "../type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react58 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/List/ListItem/index.d.ts
|
|
5
|
-
declare const ListItem:
|
|
5
|
+
declare const ListItem: react58.NamedExoticComponent<ListItemProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { ListItem };
|
|
8
8
|
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { LobeSelectProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react50 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/LobeSelect/LobeSelect.d.ts
|
|
5
|
-
declare const LobeSelect:
|
|
5
|
+
declare const LobeSelect: react50.NamedExoticComponent<LobeSelectProps<any>>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { LobeSelect };
|
|
8
8
|
//# sourceMappingURL=LobeSelect.d.mts.map
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { LobeSelectSize, LobeSelectVariant } from "./type.mjs";
|
|
2
2
|
import { LOBE_SELECT_CONTAINER_ATTR } from "./constants.mjs";
|
|
3
|
-
import * as
|
|
3
|
+
import * as react46 from "react";
|
|
4
4
|
import { ComponentProps, ComponentPropsWithRef } from "react";
|
|
5
|
-
import * as
|
|
5
|
+
import * as react_jsx_runtime33 from "react/jsx-runtime";
|
|
6
6
|
import * as _base_ui_react_select0 from "@base-ui/react/select";
|
|
7
7
|
import { Select } from "@base-ui/react/select";
|
|
8
8
|
import * as node_modules__base_ui_react_esm_separator_Separator0 from "node_modules/@base-ui/react/esm/separator/Separator";
|
|
9
9
|
|
|
10
10
|
//#region src/LobeSelect/atoms.d.ts
|
|
11
11
|
declare const LobeSelectRoot: typeof Select.Root;
|
|
12
|
-
declare const LobeSelectBackdrop:
|
|
13
|
-
declare const LobeSelectSeparator:
|
|
12
|
+
declare const LobeSelectBackdrop: react46.ForwardRefExoticComponent<_base_ui_react_select0.SelectBackdropProps & react46.RefAttributes<HTMLDivElement>>;
|
|
13
|
+
declare const LobeSelectSeparator: react46.ForwardRefExoticComponent<node_modules__base_ui_react_esm_separator_Separator0.SeparatorProps & react46.RefAttributes<HTMLDivElement>>;
|
|
14
14
|
type LobeSelectTriggerProps = Omit<ComponentPropsWithRef<typeof Select.Trigger>, 'children' | 'render'> & {
|
|
15
15
|
children: ComponentProps<typeof Select.Trigger>['children'];
|
|
16
16
|
shadow?: boolean;
|
|
@@ -27,7 +27,7 @@ declare const LobeSelectTrigger: {
|
|
|
27
27
|
variant,
|
|
28
28
|
ref: refProp,
|
|
29
29
|
...rest
|
|
30
|
-
}: LobeSelectTriggerProps):
|
|
30
|
+
}: LobeSelectTriggerProps): react_jsx_runtime33.JSX.Element;
|
|
31
31
|
displayName: string;
|
|
32
32
|
};
|
|
33
33
|
type LobeSelectIconProps = ComponentProps<typeof Select.Icon>;
|
|
@@ -35,7 +35,7 @@ declare const LobeSelectIcon: {
|
|
|
35
35
|
({
|
|
36
36
|
className,
|
|
37
37
|
...rest
|
|
38
|
-
}: LobeSelectIconProps):
|
|
38
|
+
}: LobeSelectIconProps): react_jsx_runtime33.JSX.Element;
|
|
39
39
|
displayName: string;
|
|
40
40
|
};
|
|
41
41
|
type LobeSelectValueProps = ComponentProps<typeof Select.Value>;
|
|
@@ -43,7 +43,7 @@ declare const LobeSelectValue: {
|
|
|
43
43
|
({
|
|
44
44
|
className,
|
|
45
45
|
...rest
|
|
46
|
-
}: LobeSelectValueProps):
|
|
46
|
+
}: LobeSelectValueProps): react_jsx_runtime33.JSX.Element;
|
|
47
47
|
displayName: string;
|
|
48
48
|
};
|
|
49
49
|
type LobeSelectPortalProps = ComponentProps<typeof Select.Portal> & {
|
|
@@ -56,7 +56,7 @@ declare const LobeSelectPortal: {
|
|
|
56
56
|
({
|
|
57
57
|
container,
|
|
58
58
|
...rest
|
|
59
|
-
}: LobeSelectPortalProps):
|
|
59
|
+
}: LobeSelectPortalProps): react_jsx_runtime33.JSX.Element;
|
|
60
60
|
displayName: string;
|
|
61
61
|
};
|
|
62
62
|
type LobeSelectPositionerProps = ComponentProps<typeof Select.Positioner>;
|
|
@@ -68,7 +68,7 @@ declare const LobeSelectPositioner: {
|
|
|
68
68
|
side,
|
|
69
69
|
sideOffset,
|
|
70
70
|
...rest
|
|
71
|
-
}: LobeSelectPositionerProps):
|
|
71
|
+
}: LobeSelectPositionerProps): react_jsx_runtime33.JSX.Element;
|
|
72
72
|
displayName: string;
|
|
73
73
|
};
|
|
74
74
|
type LobeSelectPopupProps = ComponentProps<typeof Select.Popup>;
|
|
@@ -76,7 +76,7 @@ declare const LobeSelectPopup: {
|
|
|
76
76
|
({
|
|
77
77
|
className,
|
|
78
78
|
...rest
|
|
79
|
-
}: LobeSelectPopupProps):
|
|
79
|
+
}: LobeSelectPopupProps): react_jsx_runtime33.JSX.Element;
|
|
80
80
|
displayName: string;
|
|
81
81
|
};
|
|
82
82
|
type LobeSelectListProps = ComponentProps<typeof Select.List>;
|
|
@@ -84,7 +84,7 @@ declare const LobeSelectList: {
|
|
|
84
84
|
({
|
|
85
85
|
className,
|
|
86
86
|
...rest
|
|
87
|
-
}: LobeSelectListProps):
|
|
87
|
+
}: LobeSelectListProps): react_jsx_runtime33.JSX.Element;
|
|
88
88
|
displayName: string;
|
|
89
89
|
};
|
|
90
90
|
type LobeSelectItemProps = ComponentProps<typeof Select.Item>;
|
|
@@ -92,7 +92,7 @@ declare const LobeSelectItem: {
|
|
|
92
92
|
({
|
|
93
93
|
className,
|
|
94
94
|
...rest
|
|
95
|
-
}: LobeSelectItemProps):
|
|
95
|
+
}: LobeSelectItemProps): react_jsx_runtime33.JSX.Element;
|
|
96
96
|
displayName: string;
|
|
97
97
|
};
|
|
98
98
|
type LobeSelectItemTextProps = ComponentProps<typeof Select.ItemText>;
|
|
@@ -100,7 +100,7 @@ declare const LobeSelectItemText: {
|
|
|
100
100
|
({
|
|
101
101
|
className,
|
|
102
102
|
...rest
|
|
103
|
-
}: LobeSelectItemTextProps):
|
|
103
|
+
}: LobeSelectItemTextProps): react_jsx_runtime33.JSX.Element;
|
|
104
104
|
displayName: string;
|
|
105
105
|
};
|
|
106
106
|
type LobeSelectItemIndicatorProps = ComponentProps<typeof Select.ItemIndicator>;
|
|
@@ -108,7 +108,7 @@ declare const LobeSelectItemIndicator: {
|
|
|
108
108
|
({
|
|
109
109
|
className,
|
|
110
110
|
...rest
|
|
111
|
-
}: LobeSelectItemIndicatorProps):
|
|
111
|
+
}: LobeSelectItemIndicatorProps): react_jsx_runtime33.JSX.Element;
|
|
112
112
|
displayName: string;
|
|
113
113
|
};
|
|
114
114
|
type LobeSelectGroupProps = ComponentProps<typeof Select.Group>;
|
|
@@ -116,7 +116,7 @@ declare const LobeSelectGroup: {
|
|
|
116
116
|
({
|
|
117
117
|
className,
|
|
118
118
|
...rest
|
|
119
|
-
}: LobeSelectGroupProps):
|
|
119
|
+
}: LobeSelectGroupProps): react_jsx_runtime33.JSX.Element;
|
|
120
120
|
displayName: string;
|
|
121
121
|
};
|
|
122
122
|
type LobeSelectGroupLabelProps = ComponentProps<typeof Select.GroupLabel>;
|
|
@@ -124,7 +124,7 @@ declare const LobeSelectGroupLabel: {
|
|
|
124
124
|
({
|
|
125
125
|
className,
|
|
126
126
|
...rest
|
|
127
|
-
}: LobeSelectGroupLabelProps):
|
|
127
|
+
}: LobeSelectGroupLabelProps): react_jsx_runtime33.JSX.Element;
|
|
128
128
|
displayName: string;
|
|
129
129
|
};
|
|
130
130
|
type LobeSelectScrollUpArrowProps = ComponentProps<typeof Select.ScrollUpArrow>;
|
|
@@ -132,7 +132,7 @@ declare const LobeSelectScrollUpArrow: {
|
|
|
132
132
|
({
|
|
133
133
|
className,
|
|
134
134
|
...rest
|
|
135
|
-
}: LobeSelectScrollUpArrowProps):
|
|
135
|
+
}: LobeSelectScrollUpArrowProps): react_jsx_runtime33.JSX.Element;
|
|
136
136
|
displayName: string;
|
|
137
137
|
};
|
|
138
138
|
type LobeSelectScrollDownArrowProps = ComponentProps<typeof Select.ScrollDownArrow>;
|
|
@@ -140,7 +140,7 @@ declare const LobeSelectScrollDownArrow: {
|
|
|
140
140
|
({
|
|
141
141
|
className,
|
|
142
142
|
...rest
|
|
143
|
-
}: LobeSelectScrollDownArrowProps):
|
|
143
|
+
}: LobeSelectScrollDownArrowProps): react_jsx_runtime33.JSX.Element;
|
|
144
144
|
displayName: string;
|
|
145
145
|
};
|
|
146
146
|
type LobeSelectArrowProps = ComponentProps<typeof Select.Arrow>;
|
|
@@ -148,7 +148,7 @@ declare const LobeSelectArrow: {
|
|
|
148
148
|
({
|
|
149
149
|
className,
|
|
150
150
|
...rest
|
|
151
|
-
}: LobeSelectArrowProps):
|
|
151
|
+
}: LobeSelectArrowProps): react_jsx_runtime33.JSX.Element;
|
|
152
152
|
displayName: string;
|
|
153
153
|
};
|
|
154
154
|
//#endregion
|
package/es/LobeSelect/atoms.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { useNativeButton } from "../hooks/useNativeButton.mjs";
|
|
4
|
+
import { useAppElement } from "../ThemeProvider/AppElementContext.mjs";
|
|
4
5
|
import { styles } from "../Menu/sharedStyle.mjs";
|
|
5
6
|
import { styles as styles$1, triggerVariants } from "./style.mjs";
|
|
6
7
|
import { LOBE_SELECT_CONTAINER_ATTR } from "./constants.mjs";
|
|
@@ -77,8 +78,9 @@ const LobeSelectValue = ({ className, ...rest }) => {
|
|
|
77
78
|
};
|
|
78
79
|
LobeSelectValue.displayName = "LobeSelectValue";
|
|
79
80
|
const LobeSelectPortal = ({ container, ...rest }) => {
|
|
81
|
+
const appElement = useAppElement();
|
|
80
82
|
return /* @__PURE__ */ jsx(Select.Portal, {
|
|
81
|
-
container: container ?? void 0,
|
|
83
|
+
container: container ?? appElement ?? void 0,
|
|
82
84
|
...rest
|
|
83
85
|
});
|
|
84
86
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"atoms.mjs","names":["styles","menuStyles"],"sources":["../../src/LobeSelect/atoms.tsx"],"sourcesContent":["'use client';\n\nimport { mergeProps } from '@base-ui/react/merge-props';\nimport { Select } from '@base-ui/react/select';\nimport { cx, useThemeMode } from 'antd-style';\nimport {\n cloneElement,\n type ComponentProps,\n type ComponentPropsWithRef,\n isValidElement,\n} from 'react';\nimport { mergeRefs } from 'react-merge-refs';\n\nimport { useNativeButton } from '@/hooks/useNativeButton';\nimport { styles as menuStyles } from '@/Menu/sharedStyle';\n\nimport { styles, triggerVariants } from './style';\nimport { type LobeSelectSize, type LobeSelectVariant } from './type';\n\nconst mergeStateClassName = <TState,>(\n base: string,\n className: string | ((state: TState) => string | undefined) | undefined,\n) => {\n if (typeof className === 'function') return (state: TState) => cx(base, className(state));\n return cx(base, className);\n};\n\nexport const LobeSelectRoot = Select.Root;\nexport const LobeSelectBackdrop = Select.Backdrop;\nexport const LobeSelectSeparator = Select.Separator;\n\nexport type LobeSelectTriggerProps = Omit<\n ComponentPropsWithRef<typeof Select.Trigger>,\n 'children' | 'render'\n> & {\n children: ComponentProps<typeof Select.Trigger>['children'];\n shadow?: boolean;\n size?: LobeSelectSize;\n variant?: LobeSelectVariant;\n};\n\nexport const LobeSelectTrigger = ({\n children,\n className,\n nativeButton,\n shadow,\n size = 'middle',\n variant,\n ref: refProp,\n ...rest\n}: LobeSelectTriggerProps) => {\n const { isDarkMode } = useThemeMode();\n const resolvedVariant = variant ?? (isDarkMode ? 'filled' : 'outlined');\n const baseClassName = triggerVariants({ shadow, size, variant: resolvedVariant });\n\n const { isNativeButtonTriggerElement, resolvedNativeButton } = useNativeButton({\n children,\n nativeButton,\n });\n\n if (isValidElement(children)) {\n return (\n <Select.Trigger\n {...rest}\n nativeButton={resolvedNativeButton}\n render={(props, state) => {\n // Base UI's trigger props include `type=\"button\"` by default.\n // If we render into a non-<button> element, that prop is invalid and can warn.\n const resolvedProps = (() => {\n if (isNativeButtonTriggerElement) return props as any;\n // eslint-disable-next-line unused-imports/no-unused-vars\n const { type, ref: triggerRef, ...restProps } = props as any;\n return restProps;\n })();\n\n const mergedProps = mergeProps((children as any).props, resolvedProps);\n const childClassName =\n typeof (mergedProps as any).className === 'function'\n ? (mergedProps as any).className(state)\n : (mergedProps as any).className;\n const extraClassName = typeof className === 'function' ? className(state) : className;\n\n return cloneElement(children as any, {\n ...mergedProps,\n className: cx(baseClassName, childClassName, extraClassName),\n ref: mergeRefs([(children as any).ref, (props as any).ref, refProp]),\n });\n }}\n />\n );\n }\n\n return (\n <Select.Trigger\n {...rest}\n className={mergeStateClassName(baseClassName, className) as any}\n nativeButton={resolvedNativeButton}\n ref={refProp as any}\n >\n {children}\n </Select.Trigger>\n );\n};\n\nLobeSelectTrigger.displayName = 'LobeSelectTrigger';\n\nexport type LobeSelectIconProps = ComponentProps<typeof Select.Icon>;\n\nexport const LobeSelectIcon = ({ className, ...rest }: LobeSelectIconProps) => {\n return <Select.Icon className={mergeStateClassName(styles.icon, className) as any} {...rest} />;\n};\n\nLobeSelectIcon.displayName = 'LobeSelectIcon';\n\nexport type LobeSelectValueProps = ComponentProps<typeof Select.Value>;\n\nexport const LobeSelectValue = ({ className, ...rest }: LobeSelectValueProps) => {\n return <Select.Value className={mergeStateClassName(styles.value, className) as any} {...rest} />;\n};\n\nLobeSelectValue.displayName = 'LobeSelectValue';\n\nexport type LobeSelectPortalProps = ComponentProps<typeof Select.Portal> & {\n /**\n * When `container` is not provided, it uses a shared container created by `usePortalContainer`.\n */\n container?: HTMLElement | null;\n};\n\nexport const LobeSelectPortal = ({ container, ...rest }: LobeSelectPortalProps) => {\n return <Select.Portal container={container ?? undefined} {...rest} />;\n};\n\nLobeSelectPortal.displayName = 'LobeSelectPortal';\n\nexport type LobeSelectPositionerProps = ComponentProps<typeof Select.Positioner>;\n\nexport const LobeSelectPositioner = ({\n align,\n alignItemWithTrigger,\n className,\n side,\n sideOffset,\n ...rest\n}: LobeSelectPositionerProps) => {\n return (\n <Select.Positioner\n align={align ?? 'start'}\n alignItemWithTrigger={alignItemWithTrigger ?? false}\n className={mergeStateClassName(styles.positioner, className) as any}\n side={side ?? 'bottom'}\n sideOffset={sideOffset ?? 6}\n {...rest}\n />\n );\n};\n\nLobeSelectPositioner.displayName = 'LobeSelectPositioner';\n\nexport type LobeSelectPopupProps = ComponentProps<typeof Select.Popup>;\n\nexport const LobeSelectPopup = ({ className, ...rest }: LobeSelectPopupProps) => {\n return (\n <Select.Popup\n className={mergeStateClassName(cx(menuStyles.popup, styles.popup), className) as any}\n {...rest}\n />\n );\n};\n\nLobeSelectPopup.displayName = 'LobeSelectPopup';\n\nexport type LobeSelectListProps = ComponentProps<typeof Select.List>;\n\nexport const LobeSelectList = ({ className, ...rest }: LobeSelectListProps) => {\n return <Select.List className={mergeStateClassName(styles.list, className) as any} {...rest} />;\n};\n\nLobeSelectList.displayName = 'LobeSelectList';\n\nexport type LobeSelectItemProps = ComponentProps<typeof Select.Item>;\n\nexport const LobeSelectItem = ({ className, ...rest }: LobeSelectItemProps) => {\n return (\n <Select.Item\n className={mergeStateClassName(cx(menuStyles.item, styles.item), className) as any}\n {...rest}\n />\n );\n};\n\nLobeSelectItem.displayName = 'LobeSelectItem';\n\nexport type LobeSelectItemTextProps = ComponentProps<typeof Select.ItemText>;\n\nexport const LobeSelectItemText = ({ className, ...rest }: LobeSelectItemTextProps) => {\n return (\n <Select.ItemText\n className={mergeStateClassName(cx(menuStyles.label, styles.itemText), className) as any}\n {...rest}\n />\n );\n};\n\nLobeSelectItemText.displayName = 'LobeSelectItemText';\n\nexport type LobeSelectItemIndicatorProps = ComponentProps<typeof Select.ItemIndicator>;\n\nexport const LobeSelectItemIndicator = ({ className, ...rest }: LobeSelectItemIndicatorProps) => {\n return (\n <Select.ItemIndicator\n className={mergeStateClassName(styles.itemIndicator, className) as any}\n {...rest}\n />\n );\n};\n\nLobeSelectItemIndicator.displayName = 'LobeSelectItemIndicator';\n\nexport type LobeSelectGroupProps = ComponentProps<typeof Select.Group>;\n\nexport const LobeSelectGroup = ({ className, ...rest }: LobeSelectGroupProps) => {\n return <Select.Group className={mergeStateClassName(styles.group, className) as any} {...rest} />;\n};\n\nLobeSelectGroup.displayName = 'LobeSelectGroup';\n\nexport type LobeSelectGroupLabelProps = ComponentProps<typeof Select.GroupLabel>;\n\nexport const LobeSelectGroupLabel = ({ className, ...rest }: LobeSelectGroupLabelProps) => {\n return (\n <Select.GroupLabel\n className={\n mergeStateClassName(cx(menuStyles.groupLabel, styles.groupLabel), className) as any\n }\n {...rest}\n />\n );\n};\n\nLobeSelectGroupLabel.displayName = 'LobeSelectGroupLabel';\n\nexport type LobeSelectScrollUpArrowProps = ComponentProps<typeof Select.ScrollUpArrow>;\n\nexport const LobeSelectScrollUpArrow = ({ className, ...rest }: LobeSelectScrollUpArrowProps) => {\n return (\n <Select.ScrollUpArrow\n className={mergeStateClassName(styles.scrollArrow, className) as any}\n {...rest}\n />\n );\n};\n\nLobeSelectScrollUpArrow.displayName = 'LobeSelectScrollUpArrow';\n\nexport type LobeSelectScrollDownArrowProps = ComponentProps<typeof Select.ScrollDownArrow>;\n\nexport const LobeSelectScrollDownArrow = ({\n className,\n ...rest\n}: LobeSelectScrollDownArrowProps) => {\n return (\n <Select.ScrollDownArrow\n className={mergeStateClassName(styles.scrollArrow, className) as any}\n {...rest}\n />\n );\n};\n\nLobeSelectScrollDownArrow.displayName = 'LobeSelectScrollDownArrow';\n\nexport type LobeSelectArrowProps = ComponentProps<typeof Select.Arrow>;\n\nexport const LobeSelectArrow = ({ className, ...rest }: LobeSelectArrowProps) => {\n return <Select.Arrow className={mergeStateClassName(styles.arrow, className) as any} {...rest} />;\n};\n\nLobeSelectArrow.displayName = 'LobeSelectArrow';\n\nex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AACrF,QACE,oBAAC,OAAO;EACN,WAAW,oBAAoB,GAAGC,OAAW,OAAOD,SAAO,SAAS,EAAE,UAAU;EAChF,GAAI;GACJ;;AAIN,mBAAmB,cAAc;AAIjC,MAAa,2BAA2B,EAAE,WAAW,GAAG,WAAyC;AAC/F,QACE,oBAAC,OAAO;EACN,WAAW,oBAAoBA,SAAO,eAAe,UAAU;EAC/D,GAAI;GACJ;;AAIN,wBAAwB,cAAc;AAItC,MAAa,mBAAmB,EAAE,WAAW,GAAG,WAAiC;AAC/E,QAAO,oBAAC,OAAO;EAAM,WAAW,oBAAoBA,SAAO,OAAO,UAAU;EAAS,GAAI;GAAQ;;AAGnG,gBAAgB,cAAc;AAI9B,MAAa,wBAAwB,EAAE,WAAW,GAAG,WAAsC;AACzF,QACE,oBAAC,OAAO;EACN,WACE,oBAAoB,GAAGC,OAAW,YAAYD,SAAO,WAAW,EAAE,UAAU;EAE9E,GAAI;GACJ;;AAIN,qBAAqB,cAAc;AAInC,MAAa,2BAA2B,EAAE,WAAW,GAAG,WAAyC;AAC/F,QACE,oBAAC,OAAO;EACN,WAAW,oBAAoBA,SAAO,aAAa,UAAU;EAC7D,GAAI;GACJ;;AAIN,wBAAwB,cAAc;AAItC,MAAa,6BAA6B,EACxC,WACA,GAAG,WACiC;AACpC,QACE,oBAAC,OAAO;EACN,WAAW,oBAAoBA,SAAO,aAAa,UAAU;EAC7D,GAAI;GACJ;;AAIN,0BAA0B,cAAc;AAIxC,MAAa,mBAAmB,EAAE,WAAW,GAAG,WAAiC;AAC/E,QAAO,oBAAC,OAAO;EAAM,WAAW,oBAAoBA,SAAO,OAAO,UAAU;EAAS,GAAI;GAAQ;;AAGnG,gBAAgB,cAAc"}
|
|
1
|
+
{"version":3,"file":"atoms.mjs","names":["styles","menuStyles"],"sources":["../../src/LobeSelect/atoms.tsx"],"sourcesContent":["'use client';\n\nimport { mergeProps } from '@base-ui/react/merge-props';\nimport { Select } from '@base-ui/react/select';\nimport { cx, useThemeMode } from 'antd-style';\nimport {\n cloneElement,\n type ComponentProps,\n type ComponentPropsWithRef,\n isValidElement,\n} from 'react';\nimport { mergeRefs } from 'react-merge-refs';\n\nimport { useNativeButton } from '@/hooks/useNativeButton';\nimport { styles as menuStyles } from '@/Menu/sharedStyle';\nimport { useAppElement } from '@/ThemeProvider';\n\nimport { styles, triggerVariants } from './style';\nimport { type LobeSelectSize, type LobeSelectVariant } from './type';\n\nconst mergeStateClassName = <TState,>(\n base: string,\n className: string | ((state: TState) => string | undefined) | undefined,\n) => {\n if (typeof className === 'function') return (state: TState) => cx(base, className(state));\n return cx(base, className);\n};\n\nexport const LobeSelectRoot = Select.Root;\nexport const LobeSelectBackdrop = Select.Backdrop;\nexport const LobeSelectSeparator = Select.Separator;\n\nexport type LobeSelectTriggerProps = Omit<\n ComponentPropsWithRef<typeof Select.Trigger>,\n 'children' | 'render'\n> & {\n children: ComponentProps<typeof Select.Trigger>['children'];\n shadow?: boolean;\n size?: LobeSelectSize;\n variant?: LobeSelectVariant;\n};\n\nexport const LobeSelectTrigger = ({\n children,\n className,\n nativeButton,\n shadow,\n size = 'middle',\n variant,\n ref: refProp,\n ...rest\n}: LobeSelectTriggerProps) => {\n const { isDarkMode } = useThemeMode();\n const resolvedVariant = variant ?? (isDarkMode ? 'filled' : 'outlined');\n const baseClassName = triggerVariants({ shadow, size, variant: resolvedVariant });\n\n const { isNativeButtonTriggerElement, resolvedNativeButton } = useNativeButton({\n children,\n nativeButton,\n });\n\n if (isValidElement(children)) {\n return (\n <Select.Trigger\n {...rest}\n nativeButton={resolvedNativeButton}\n render={(props, state) => {\n // Base UI's trigger props include `type=\"button\"` by default.\n // If we render into a non-<button> element, that prop is invalid and can warn.\n const resolvedProps = (() => {\n if (isNativeButtonTriggerElement) return props as any;\n // eslint-disable-next-line unused-imports/no-unused-vars\n const { type, ref: triggerRef, ...restProps } = props as any;\n return restProps;\n })();\n\n const mergedProps = mergeProps((children as any).props, resolvedProps);\n const childClassName =\n typeof (mergedProps as any).className === 'function'\n ? (mergedProps as any).className(state)\n : (mergedProps as any).className;\n const extraClassName = typeof className === 'function' ? className(state) : className;\n\n return cloneElement(children as any, {\n ...mergedProps,\n className: cx(baseClassName, childClassName, extraClassName),\n ref: mergeRefs([(children as any).ref, (props as any).ref, refProp]),\n });\n }}\n />\n );\n }\n\n return (\n <Select.Trigger\n {...rest}\n className={mergeStateClassName(baseClassName, className) as any}\n nativeButton={resolvedNativeButton}\n ref={refProp as any}\n >\n {children}\n </Select.Trigger>\n );\n};\n\nLobeSelectTrigger.displayName = 'LobeSelectTrigger';\n\nexport type LobeSelectIconProps = ComponentProps<typeof Select.Icon>;\n\nexport const LobeSelectIcon = ({ className, ...rest }: LobeSelectIconProps) => {\n return <Select.Icon className={mergeStateClassName(styles.icon, className) as any} {...rest} />;\n};\n\nLobeSelectIcon.displayName = 'LobeSelectIcon';\n\nexport type LobeSelectValueProps = ComponentProps<typeof Select.Value>;\n\nexport const LobeSelectValue = ({ className, ...rest }: LobeSelectValueProps) => {\n return <Select.Value className={mergeStateClassName(styles.value, className) as any} {...rest} />;\n};\n\nLobeSelectValue.displayName = 'LobeSelectValue';\n\nexport type LobeSelectPortalProps = ComponentProps<typeof Select.Portal> & {\n /**\n * When `container` is not provided, it uses a shared container created by `usePortalContainer`.\n */\n container?: HTMLElement | null;\n};\n\nexport const LobeSelectPortal = ({ container, ...rest }: LobeSelectPortalProps) => {\n const appElement = useAppElement();\n return <Select.Portal container={container ?? appElement ?? undefined} {...rest} />;\n};\n\nLobeSelectPortal.displayName = 'LobeSelectPortal';\n\nexport type LobeSelectPositionerProps = ComponentProps<typeof Select.Positioner>;\n\nexport const LobeSelectPositioner = ({\n align,\n alignItemWithTrigger,\n className,\n side,\n sideOffset,\n ...rest\n}: LobeSelectPositionerProps) => {\n return (\n <Select.Positioner\n align={align ?? 'start'}\n alignItemWithTrigger={alignItemWithTrigger ?? false}\n className={mergeStateClassName(styles.positioner, className) as any}\n side={side ?? 'bottom'}\n sideOffset={sideOffset ?? 6}\n {...rest}\n />\n );\n};\n\nLobeSelectPositioner.displayName = 'LobeSelectPositioner';\n\nexport type LobeSelectPopupProps = ComponentProps<typeof Select.Popup>;\n\nexport const LobeSelectPopup = ({ className, ...rest }: LobeSelectPopupProps) => {\n return (\n <Select.Popup\n className={mergeStateClassName(cx(menuStyles.popup, styles.popup), className) as any}\n {...rest}\n />\n );\n};\n\nLobeSelectPopup.displayName = 'LobeSelectPopup';\n\nexport type LobeSelectListProps = ComponentProps<typeof Select.List>;\n\nexport const LobeSelectList = ({ className, ...rest }: LobeSelectListProps) => {\n return <Select.List className={mergeStateClassName(styles.list, className) as any} {...rest} />;\n};\n\nLobeSelectList.displayName = 'LobeSelectList';\n\nexport type LobeSelectItemProps = ComponentProps<typeof Select.Item>;\n\nexport const LobeSelectItem = ({ className, ...rest }: LobeSelectItemProps) => {\n return (\n <Select.Item\n className={mergeStateClassName(cx(menuStyles.item, styles.item), className) as any}\n {...rest}\n />\n );\n};\n\nLobeSelectItem.displayName = 'LobeSelectItem';\n\nexport type LobeSelectItemTextProps = ComponentProps<typeof Select.ItemText>;\n\nexport const LobeSelectItemText = ({ className, ...rest }: LobeSelectItemTextProps) => {\n return (\n <Select.ItemText\n className={mergeStateClassName(cx(menuStyles.label, styles.itemText), className) as any}\n {...rest}\n />\n );\n};\n\nLobeSelectItemText.displayName = 'LobeSelectItemText';\n\nexport type LobeSelectItemIndicatorProps = ComponentProps<typeof Select.ItemIndicator>;\n\nexport const LobeSelectItemIndicator = ({ className, ...rest }: LobeSelectItemIndicatorProps) => {\n return (\n <Select.ItemIndicator\n className={mergeStateClassName(styles.itemIndicator, className) as any}\n {...rest}\n />\n );\n};\n\nLobeSelectItemIndicator.displayName = 'LobeSelectItemIndicator';\n\nexport type LobeSelectGroupProps = ComponentProps<typeof Select.Group>;\n\nexport const LobeSelectGroup = ({ className, ...rest }: LobeSelectGroupProps) => {\n return <Select.Group className={mergeStateClassName(styles.group, className) as any} {...rest} />;\n};\n\nLobeSelectGroup.displayName = 'LobeSelectGroup';\n\nexport type LobeSelectGroupLabelProps = ComponentProps<typeof Select.GroupLabel>;\n\nexport const LobeSelectGroupLabel = ({ className, ...rest }: LobeSelectGroupLabelProps) => {\n return (\n <Select.GroupLabel\n className={\n mergeStateClassName(cx(menuStyles.groupLabel, styles.groupLabel), className) as any\n }\n {...rest}\n />\n );\n};\n\nLobeSelectGroupLabel.displayName = 'LobeSelectGroupLabel';\n\nexport type LobeSelectScrollUpArrowProps = ComponentProps<typeof Select.ScrollUpArrow>;\n\nexport const LobeSelectScrollUpArrow = ({ className, ...rest }: LobeSelectScrollUpArrowProps) => {\n return (\n <Select.ScrollUpArrow\n className={mergeStateClassName(styles.scrollArrow, className) as any}\n {...rest}\n />\n );\n};\n\nLobeSelectScrollUpArrow.displayName = 'LobeSelectScrollUpArrow';\n\nexport type LobeSelectScrollDownArrowProps = ComponentProps<typeof Select.ScrollDownArrow>;\n\nexport const LobeSelectScrollDownArrow = ({\n className,\n ...rest\n}: LobeSelectScrollDownArrowProps) => {\n return (\n <Select.ScrollDownArrow\n className={mergeStateClassName(styles.scrollArrow, className) as any}\n {...rest}\n />\n );\n};\n\nLobeSelectScrollDownArrow.displayName = 'LobeSelectScrollDownArrow';\n\nexport type LobeSelectArrowProps = ComponentProps<typeof Select.Arrow>;\n\nexport const LobeSelectArrow = ({ className, ...rest }: LobeSelectArrowProps) => {\n return <Select.Arrow className={mergeStateClassName(styles.arrow, className) as any} {...rest} />;\n};\n\nLobeSelectArrow.displayName = 'LobeSelectArrow';\n\nexport { LOBE_SELECT_CONTAINER_ATTR } from './constants';\n"],"mappings":";;;;;;;;;;;;;;;AAoBA,MAAM,uBACJ,MACA,cACG;AACH,KAAI,OAAO,cAAc,WAAY,SAAQ,UAAkB,GAAG,MAAM,UAAU,MAAM,CAAC;AACzF,QAAO,GAAG,MAAM,UAAU;;AAG5B,MAAa,iBAAiB,OAAO;AACrC,MAAa,qBAAqB,OAAO;AACzC,MAAa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UAAU;EAC/D,GAAI;GACJ;;AAIN,wBAAwB,cAAc;AAItC,MAAa,mBAAmB,EAAE,WAAW,GAAG,WAAiC;AAC/E,QAAO,oBAAC,OAAO;EAAM,WAAW,oBAAoBA,SAAO,OAAO,UAAU;EAAS,GAAI;GAAQ;;AAGnG,gBAAgB,cAAc;AAI9B,MAAa,wBAAwB,EAAE,WAAW,GAAG,WAAsC;AACzF,QACE,oBAAC,OAAO;EACN,WACE,oBAAoB,GAAGC,OAAW,YAAYD,SAAO,WAAW,EAAE,UAAU;EAE9E,GAAI;GACJ;;AAIN,qBAAqB,cAAc;AAInC,MAAa,2BAA2B,EAAE,WAAW,GAAG,WAAyC;AAC/F,QACE,oBAAC,OAAO;EACN,WAAW,oBAAoBA,SAAO,aAAa,UAAU;EAC7D,GAAI;GACJ;;AAIN,wBAAwB,cAAc;AAItC,MAAa,6BAA6B,EACxC,WACA,GAAG,WACiC;AACpC,QACE,oBAAC,OAAO;EACN,WAAW,oBAAoBA,SAAO,aAAa,UAAU;EAC7D,GAAI;GACJ;;AAIN,0BAA0B,cAAc;AAIxC,MAAa,mBAAmB,EAAE,WAAW,GAAG,WAAiC;AAC/E,QAAO,oBAAC,OAAO;EAAM,WAAW,oBAAoBA,SAAO,OAAO,UAAU;EAAS,GAAI;GAAQ;;AAGnG,gBAAgB,cAAc"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { LobeSwitchProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react45 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/LobeSwitch/LobeSwitch.d.ts
|
|
5
|
-
declare const LobeSwitch:
|
|
5
|
+
declare const LobeSwitch: react45.NamedExoticComponent<LobeSwitchProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { LobeSwitch };
|
|
8
8
|
//# sourceMappingURL=LobeSwitch.d.mts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LobeSwitchChangeEventHandler, LobeSwitchContextType, LobeSwitchIconProps, LobeSwitchRootProps, LobeSwitchThumbProps } from "./type.mjs";
|
|
2
2
|
import { styles } from "./style.mjs";
|
|
3
|
-
import * as
|
|
3
|
+
import * as react_jsx_runtime30 from "react/jsx-runtime";
|
|
4
4
|
|
|
5
5
|
//#region src/LobeSwitch/atoms.d.ts
|
|
6
6
|
declare const useLobeSwitchContext: () => LobeSwitchContextType;
|
|
@@ -24,7 +24,7 @@ declare const LobeSwitchRoot: {
|
|
|
24
24
|
id,
|
|
25
25
|
name,
|
|
26
26
|
...rest
|
|
27
|
-
}: LobeSwitchRootInternalProps):
|
|
27
|
+
}: LobeSwitchRootInternalProps): react_jsx_runtime30.JSX.Element;
|
|
28
28
|
displayName: string;
|
|
29
29
|
};
|
|
30
30
|
declare const LobeSwitchThumb: {
|
|
@@ -35,7 +35,7 @@ declare const LobeSwitchThumb: {
|
|
|
35
35
|
transition,
|
|
36
36
|
children,
|
|
37
37
|
...rest
|
|
38
|
-
}: LobeSwitchThumbProps):
|
|
38
|
+
}: LobeSwitchThumbProps): react_jsx_runtime30.JSX.Element;
|
|
39
39
|
displayName: string;
|
|
40
40
|
};
|
|
41
41
|
declare const LobeSwitchIcon: {
|
|
@@ -48,7 +48,7 @@ declare const LobeSwitchIcon: {
|
|
|
48
48
|
}: LobeSwitchIconProps & {
|
|
49
49
|
children?: React.ReactNode;
|
|
50
50
|
size?: "default" | "small";
|
|
51
|
-
}):
|
|
51
|
+
}): react_jsx_runtime30.JSX.Element;
|
|
52
52
|
displayName: string;
|
|
53
53
|
};
|
|
54
54
|
//#endregion
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { MarkdownProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react43 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Markdown/Markdown.d.ts
|
|
5
|
-
declare const Markdown:
|
|
5
|
+
declare const Markdown: react43.NamedExoticComponent<MarkdownProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { Markdown };
|
|
8
8
|
//# sourceMappingURL=Markdown.d.mts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { TypographyProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react42 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Markdown/Typography.d.ts
|
|
5
|
-
declare const Typography:
|
|
5
|
+
declare const Typography: react42.NamedExoticComponent<TypographyProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { Typography };
|
|
8
8
|
//# sourceMappingURL=Typography.d.mts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FlexboxProps } from "../../../Flex/type.mjs";
|
|
2
2
|
import "../../../Flex/index.mjs";
|
|
3
|
-
import * as
|
|
3
|
+
import * as react86 from "react";
|
|
4
4
|
import { Ref } from "react";
|
|
5
5
|
|
|
6
6
|
//#region src/Markdown/components/SearchResultCards/index.d.ts
|
|
@@ -14,7 +14,7 @@ interface SearchResultCardsProps extends FlexboxProps {
|
|
|
14
14
|
dataSource: string[] | SearchResultItem[];
|
|
15
15
|
ref?: Ref<HTMLDivElement>;
|
|
16
16
|
}
|
|
17
|
-
declare const SearchResultCards:
|
|
17
|
+
declare const SearchResultCards: react86.NamedExoticComponent<SearchResultCardsProps>;
|
|
18
18
|
//#endregion
|
|
19
19
|
export { SearchResultCards, SearchResultCardsProps };
|
|
20
20
|
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { MaskShadowProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react44 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/MaskShadow/MaskShadow.d.ts
|
|
5
|
-
declare const MaskShadow:
|
|
5
|
+
declare const MaskShadow: react44.NamedExoticComponent<MaskShadowProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { MaskShadow };
|
|
8
8
|
//# sourceMappingURL=MaskShadow.d.mts.map
|
package/es/Menu/Menu.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { MenuProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react77 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Menu/Menu.d.ts
|
|
5
|
-
declare const Menu:
|
|
5
|
+
declare const Menu: react77.NamedExoticComponent<MenuProps<unknown>>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { Menu };
|
|
8
8
|
//# sourceMappingURL=Menu.d.mts.map
|
package/es/Mermaid/Mermaid.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { MermaidProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react31 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Mermaid/Mermaid.d.ts
|
|
5
|
-
declare const Mermaid:
|
|
5
|
+
declare const Mermaid: react31.NamedExoticComponent<MermaidProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { Mermaid };
|
|
8
8
|
//# sourceMappingURL=Mermaid.d.mts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { SyntaxMermaidProps } from "../type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react30 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Mermaid/SyntaxMermaid/index.d.ts
|
|
5
|
-
declare const SyntaxMermaid:
|
|
5
|
+
declare const SyntaxMermaid: react30.NamedExoticComponent<SyntaxMermaidProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { SyntaxMermaid };
|
|
8
8
|
//# sourceMappingURL=index.d.mts.map
|
package/es/Modal/Modal.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ModalProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react39 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Modal/Modal.d.ts
|
|
5
|
-
declare const Modal:
|
|
5
|
+
declare const Modal: react39.NamedExoticComponent<ModalProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { Modal };
|
|
8
8
|
//# sourceMappingURL=Modal.d.mts.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ModalContextValue } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react40 from "react";
|
|
3
3
|
import { ReactNode } from "react";
|
|
4
4
|
|
|
5
5
|
//#region src/Modal/ModalProvider.d.ts
|
|
6
|
-
declare const ModalProvider:
|
|
6
|
+
declare const ModalProvider: react40.NamedExoticComponent<{
|
|
7
7
|
children: ReactNode;
|
|
8
8
|
value: ModalContextValue;
|
|
9
9
|
}>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ImperativeModalProps, ModalInstance, RawModalComponent, RawModalComponentProps, RawModalInstance, RawModalKeyOptions, RawModalOptions } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime29 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/Modal/imperative.d.ts
|
|
5
5
|
type ModalHostProps = {
|
|
@@ -7,7 +7,7 @@ type ModalHostProps = {
|
|
|
7
7
|
};
|
|
8
8
|
declare const ModalHost: ({
|
|
9
9
|
root
|
|
10
|
-
}: ModalHostProps) =>
|
|
10
|
+
}: ModalHostProps) => react_jsx_runtime29.JSX.Element | null;
|
|
11
11
|
declare const createModal: (props: ImperativeModalProps) => ModalInstance;
|
|
12
12
|
declare function createRawModal<P extends RawModalComponentProps>(component: RawModalComponent<P>, props: Omit<P, 'open' | 'onClose'>, options?: RawModalOptions): RawModalInstance<P>;
|
|
13
13
|
declare function createRawModal<P, OpenKey extends keyof P, CloseKey extends keyof P>(component: RawModalComponent<P>, props: Omit<P, OpenKey | CloseKey>, options: RawModalKeyOptions<OpenKey, CloseKey>): RawModalInstance<P, OpenKey, CloseKey>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react87 from "react";
|
|
2
2
|
import { Context, ReactNode } from "react";
|
|
3
3
|
import * as motion_react0 from "motion/react";
|
|
4
4
|
import * as m from "motion/react-m";
|
|
@@ -6,7 +6,7 @@ import * as m from "motion/react-m";
|
|
|
6
6
|
//#region src/MotionProvider/index.d.ts
|
|
7
7
|
type MotionComponentType = typeof motion_react0.motion | typeof m;
|
|
8
8
|
declare const MotionComponent: Context<MotionComponentType>;
|
|
9
|
-
declare const MotionProvider:
|
|
9
|
+
declare const MotionProvider: react87.NamedExoticComponent<{
|
|
10
10
|
children: ReactNode;
|
|
11
11
|
motion: MotionComponentType;
|
|
12
12
|
}>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime22 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region src/Popover/ArrowIcon.d.ts
|
|
4
|
-
declare const PopoverArrowIcon:
|
|
4
|
+
declare const PopoverArrowIcon: react_jsx_runtime22.JSX.Element;
|
|
5
5
|
//#endregion
|
|
6
6
|
export { PopoverArrowIcon };
|
|
7
7
|
//# sourceMappingURL=ArrowIcon.d.mts.map
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
+
import { useAppElement } from "../ThemeProvider/AppElementContext.mjs";
|
|
3
4
|
import { useEffect, useState } from "react";
|
|
4
5
|
|
|
5
6
|
//#region src/Popover/PopoverPortal.tsx
|
|
@@ -20,17 +21,18 @@ const getOrCreateContainer = (root) => {
|
|
|
20
21
|
containerMap.set(resolvedRoot, el);
|
|
21
22
|
return el;
|
|
22
23
|
};
|
|
23
|
-
const resolveRoot = (root) => {
|
|
24
|
-
if (root) return root;
|
|
25
|
-
return document.body;
|
|
26
|
-
};
|
|
27
24
|
const usePopoverPortalContainer = (root) => {
|
|
25
|
+
const appElement = useAppElement();
|
|
28
26
|
const [container, setContainer] = useState(null);
|
|
29
27
|
useEffect(() => {
|
|
30
|
-
const resolved =
|
|
28
|
+
const resolved = root ?? appElement ?? document.body;
|
|
31
29
|
if (!resolved) return;
|
|
32
30
|
setContainer(getOrCreateContainer(resolved));
|
|
33
|
-
}, [
|
|
31
|
+
}, [
|
|
32
|
+
root,
|
|
33
|
+
appElement,
|
|
34
|
+
container?.isConnected
|
|
35
|
+
]);
|
|
34
36
|
return container;
|
|
35
37
|
};
|
|
36
38
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PopoverPortal.mjs","names":[],"sources":["../../src/Popover/PopoverPortal.tsx"],"sourcesContent":["'use client';\n\nimport { useEffect, useState } from 'react';\n\nconst PORTAL_ATTR = 'data-lobe-ui-popover-portal';\nexport const POPOVER_CONTAINER_ATTR = 'data-lobe-ui-popover-container';\n\n// Reuse one portal container per root (document.body by default).\nconst containerMap = new WeakMap<object, HTMLElement>();\n\nconst getOrCreateContainer = (root: HTMLElement | ShadowRoot): HTMLElement => {\n const resolvedRoot = (() => {\n if (typeof document === 'undefined') return root;\n if (typeof ShadowRoot !== 'undefined' && root instanceof ShadowRoot) return root;\n\n return root;\n })();\n\n const cached = containerMap.get(resolvedRoot);\n if (cached && cached.isConnected) return cached;\n\n const el = document.createElement('div');\n el.setAttribute(PORTAL_ATTR, 'true');\n resolvedRoot.append(el);\n containerMap.set(resolvedRoot, el);\n return el;\n};\n\
|
|
1
|
+
{"version":3,"file":"PopoverPortal.mjs","names":[],"sources":["../../src/Popover/PopoverPortal.tsx"],"sourcesContent":["'use client';\n\nimport { useEffect, useState } from 'react';\n\nimport { useAppElement } from '@/ThemeProvider';\n\nconst PORTAL_ATTR = 'data-lobe-ui-popover-portal';\nexport const POPOVER_CONTAINER_ATTR = 'data-lobe-ui-popover-container';\n\n// Reuse one portal container per root (document.body by default).\nconst containerMap = new WeakMap<object, HTMLElement>();\n\nconst getOrCreateContainer = (root: HTMLElement | ShadowRoot): HTMLElement => {\n const resolvedRoot = (() => {\n if (typeof document === 'undefined') return root;\n if (typeof ShadowRoot !== 'undefined' && root instanceof ShadowRoot) return root;\n\n return root;\n })();\n\n const cached = containerMap.get(resolvedRoot);\n if (cached && cached.isConnected) return cached;\n\n const el = document.createElement('div');\n el.setAttribute(PORTAL_ATTR, 'true');\n resolvedRoot.append(el);\n containerMap.set(resolvedRoot, el);\n return el;\n};\n\nexport const usePopoverPortalContainer = (\n root?: HTMLElement | ShadowRoot | null,\n): HTMLElement | null => {\n const appElement = useAppElement();\n const [container, setContainer] = useState<HTMLElement | null>(null);\n\n // Never mutate DOM / create portal container during render.\n // Create it after mount to avoid SSR/hydration side effects.\n useEffect(() => {\n const resolved = root ?? appElement ?? document.body;\n if (!resolved) return;\n setContainer(getOrCreateContainer(resolved));\n }, [root, appElement, container?.isConnected]);\n\n return container;\n};\n"],"mappings":";;;;;;AAMA,MAAM,cAAc;AACpB,MAAa,yBAAyB;AAGtC,MAAM,+BAAe,IAAI,SAA8B;AAEvD,MAAM,wBAAwB,SAAgD;CAC5E,MAAM,sBAAsB;AAC1B,MAAI,OAAO,aAAa,YAAa,QAAO;AAC5C,MAAI,OAAO,eAAe,eAAe,gBAAgB,WAAY,QAAO;AAE5E,SAAO;KACL;CAEJ,MAAM,SAAS,aAAa,IAAI,aAAa;AAC7C,KAAI,UAAU,OAAO,YAAa,QAAO;CAEzC,MAAM,KAAK,SAAS,cAAc,MAAM;AACxC,IAAG,aAAa,aAAa,OAAO;AACpC,cAAa,OAAO,GAAG;AACvB,cAAa,IAAI,cAAc,GAAG;AAClC,QAAO;;AAGT,MAAa,6BACX,SACuB;CACvB,MAAM,aAAa,eAAe;CAClC,MAAM,CAAC,WAAW,gBAAgB,SAA6B,KAAK;AAIpE,iBAAgB;EACd,MAAM,WAAW,QAAQ,cAAc,SAAS;AAChD,MAAI,CAAC,SAAU;AACf,eAAa,qBAAqB,SAAS,CAAC;IAC3C;EAAC;EAAM;EAAY,WAAW;EAAY,CAAC;AAE9C,QAAO"}
|
package/es/Popover/atoms.d.mts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { PopoverPlacement } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react34 from "react";
|
|
3
3
|
import { ComponentProps, ComponentPropsWithRef } from "react";
|
|
4
|
-
import * as
|
|
4
|
+
import * as react_jsx_runtime23 from "react/jsx-runtime";
|
|
5
5
|
import * as _base_ui_react_popover0 from "@base-ui/react/popover";
|
|
6
6
|
import { Popover } from "@base-ui/react/popover";
|
|
7
7
|
|
|
8
8
|
//#region src/Popover/atoms.d.ts
|
|
9
9
|
declare const PopoverRoot: typeof Popover.Root;
|
|
10
|
-
declare const PopoverBackdrop:
|
|
10
|
+
declare const PopoverBackdrop: react34.ForwardRefExoticComponent<_base_ui_react_popover0.PopoverBackdropProps & react34.RefAttributes<HTMLDivElement>>;
|
|
11
11
|
type PopoverTriggerElementProps = Omit<ComponentPropsWithRef<typeof Popover.Trigger>, 'children' | 'render'> & {
|
|
12
12
|
children: ComponentProps<typeof Popover.Trigger>['children'];
|
|
13
13
|
};
|
|
@@ -18,7 +18,7 @@ declare const PopoverTriggerElement: {
|
|
|
18
18
|
nativeButton,
|
|
19
19
|
ref: refProp,
|
|
20
20
|
...rest
|
|
21
|
-
}: PopoverTriggerElementProps):
|
|
21
|
+
}: PopoverTriggerElementProps): react_jsx_runtime23.JSX.Element;
|
|
22
22
|
displayName: string;
|
|
23
23
|
};
|
|
24
24
|
type PopoverPortalAtomProps = Omit<ComponentProps<typeof Popover.Portal>, 'container'> & {
|
|
@@ -37,7 +37,7 @@ declare const PopoverPortal: {
|
|
|
37
37
|
root,
|
|
38
38
|
children,
|
|
39
39
|
...rest
|
|
40
|
-
}: PopoverPortalAtomProps):
|
|
40
|
+
}: PopoverPortalAtomProps): react_jsx_runtime23.JSX.Element | null;
|
|
41
41
|
displayName: string;
|
|
42
42
|
};
|
|
43
43
|
type PopoverPositionerAtomProps = ComponentProps<typeof Popover.Positioner> & {
|
|
@@ -54,7 +54,7 @@ declare const PopoverPositioner: {
|
|
|
54
54
|
side,
|
|
55
55
|
sideOffset,
|
|
56
56
|
...rest
|
|
57
|
-
}: PopoverPositionerAtomProps):
|
|
57
|
+
}: PopoverPositionerAtomProps): react_jsx_runtime23.JSX.Element;
|
|
58
58
|
displayName: string;
|
|
59
59
|
};
|
|
60
60
|
type PopoverPopupAtomProps = ComponentProps<typeof Popover.Popup>;
|
|
@@ -62,7 +62,7 @@ declare const PopoverPopup: {
|
|
|
62
62
|
({
|
|
63
63
|
className,
|
|
64
64
|
...rest
|
|
65
|
-
}: PopoverPopupAtomProps):
|
|
65
|
+
}: PopoverPopupAtomProps): react_jsx_runtime23.JSX.Element;
|
|
66
66
|
displayName: string;
|
|
67
67
|
};
|
|
68
68
|
type PopoverArrowAtomProps = ComponentProps<typeof Popover.Arrow>;
|
|
@@ -71,7 +71,7 @@ declare const PopoverArrow: {
|
|
|
71
71
|
className,
|
|
72
72
|
children,
|
|
73
73
|
...rest
|
|
74
|
-
}: PopoverArrowAtomProps):
|
|
74
|
+
}: PopoverArrowAtomProps): react_jsx_runtime23.JSX.Element;
|
|
75
75
|
displayName: string;
|
|
76
76
|
};
|
|
77
77
|
type PopoverViewportAtomProps = ComponentProps<typeof Popover.Viewport>;
|
|
@@ -79,7 +79,7 @@ declare const PopoverViewport: {
|
|
|
79
79
|
({
|
|
80
80
|
className,
|
|
81
81
|
...rest
|
|
82
|
-
}: PopoverViewportAtomProps):
|
|
82
|
+
}: PopoverViewportAtomProps): react_jsx_runtime23.JSX.Element;
|
|
83
83
|
displayName: string;
|
|
84
84
|
};
|
|
85
85
|
//#endregion
|
package/es/Popover/context.d.mts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react32 from "react";
|
|
2
2
|
import { ReactNode } from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Popover/context.d.ts
|
|
5
5
|
type PopoverContextValue = {
|
|
6
6
|
close: () => void;
|
|
7
7
|
};
|
|
8
|
-
declare const PopoverProvider:
|
|
8
|
+
declare const PopoverProvider: react32.NamedExoticComponent<{
|
|
9
9
|
children: ReactNode;
|
|
10
10
|
value: PopoverContextValue;
|
|
11
11
|
}>;
|