@lobehub/ui 4.38.4 → 5.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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/ActionIconGroup/ActionIconGroup.mjs +1 -1
- package/es/ActionIconGroup/type.d.mts +1 -1
- 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/ContextMenu/index.d.mts +6 -7
- package/es/ContextMenu/index.mjs +3 -3
- 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/index.d.mts +6 -5
- package/es/DropdownMenu/index.mjs +4 -4
- 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/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/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/ScrollArea/index.d.mts +5 -4
- package/es/ScrollArea/index.mjs +2 -2
- package/es/SearchBar/SearchBar.d.mts +2 -2
- package/es/Segmented/Segmented.d.mts +2 -2
- package/es/Select/Select.d.mts +3 -3
- package/es/Select/Select.mjs +1 -1
- package/es/Select/Select.mjs.map +1 -1
- 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/ThemeSwitch/ThemeSwitch.mjs +1 -1
- package/es/Toast/index.d.mts +4 -3
- package/es/Toast/index.mjs +1 -1
- 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 +8 -0
- package/es/{ContextMenu → base-ui/ContextMenu}/ContextMenuHost.mjs +6 -6
- package/es/base-ui/ContextMenu/ContextMenuHost.mjs.map +1 -0
- package/es/{ContextMenu → base-ui/ContextMenu}/ContextMenuTrigger.d.mts +1 -1
- package/es/{ContextMenu → base-ui/ContextMenu}/ContextMenuTrigger.mjs +2 -2
- package/es/base-ui/ContextMenu/ContextMenuTrigger.mjs.map +1 -0
- package/es/base-ui/ContextMenu/index.d.mts +7 -0
- package/es/base-ui/ContextMenu/renderItems.d.mts +4 -0
- package/es/{ContextMenu → base-ui/ContextMenu}/renderItems.mjs +7 -7
- package/es/base-ui/ContextMenu/renderItems.mjs.map +1 -0
- package/es/{ContextMenu → base-ui/ContextMenu}/store.d.mts +3 -3
- package/es/{ContextMenu → base-ui/ContextMenu}/store.mjs +1 -1
- package/es/base-ui/ContextMenu/store.mjs.map +1 -0
- package/es/base-ui/ContextMenu/type.d.mts +12 -0
- package/es/base-ui/DropdownMenu/DropdownMenu.d.mts +8 -0
- package/es/{DropdownMenu → base-ui/DropdownMenu}/DropdownMenu.mjs +3 -3
- package/es/base-ui/DropdownMenu/DropdownMenu.mjs.map +1 -0
- package/es/{DropdownMenu → base-ui/DropdownMenu}/atoms.d.mts +19 -19
- package/es/{DropdownMenu → base-ui/DropdownMenu}/atoms.mjs +7 -7
- package/es/base-ui/DropdownMenu/atoms.mjs.map +1 -0
- package/es/base-ui/DropdownMenu/index.d.mts +5 -0
- package/es/{DropdownMenu → base-ui/DropdownMenu}/renderItems.d.mts +3 -3
- package/es/{DropdownMenu → base-ui/DropdownMenu}/renderItems.mjs +3 -3
- package/es/base-ui/DropdownMenu/renderItems.mjs.map +1 -0
- package/es/{DropdownMenu → base-ui/DropdownMenu}/type.d.mts +9 -9
- package/es/{ScrollArea → base-ui/ScrollArea}/ScrollArea.d.mts +1 -1
- package/es/{ScrollArea → base-ui/ScrollArea}/ScrollArea.mjs +1 -1
- package/es/base-ui/ScrollArea/ScrollArea.mjs.map +1 -0
- package/es/{ScrollArea → base-ui/ScrollArea}/atoms.d.mts +8 -8
- package/es/{ScrollArea → base-ui/ScrollArea}/atoms.mjs +1 -1
- package/es/base-ui/ScrollArea/atoms.mjs.map +1 -0
- package/es/{ScrollArea → base-ui/ScrollArea}/globalStyle.mjs +1 -1
- package/es/base-ui/ScrollArea/globalStyle.mjs.map +1 -0
- package/es/base-ui/ScrollArea/index.d.mts +3 -0
- package/es/{ScrollArea → base-ui/ScrollArea}/style.mjs +1 -1
- package/es/base-ui/ScrollArea/style.mjs.map +1 -0
- package/es/{ScrollArea → base-ui/ScrollArea}/type.d.mts +1 -1
- package/es/base-ui/Select/Select.d.mts +8 -0
- package/es/{LobeSelect/LobeSelect.mjs → base-ui/Select/Select.mjs} +9 -9
- package/es/base-ui/Select/Select.mjs.map +1 -0
- package/es/base-ui/Select/atoms.d.mts +155 -0
- package/es/{LobeSelect → base-ui/Select}/atoms.mjs +38 -38
- package/es/base-ui/Select/atoms.mjs.map +1 -0
- package/es/base-ui/Select/index.d.mts +3 -0
- package/es/{LobeSelect → base-ui/Select}/style.mjs +2 -2
- package/es/base-ui/Select/style.mjs.map +1 -0
- package/es/{LobeSelect → base-ui/Select}/type.d.mts +24 -24
- package/es/base-ui/Switch/Switch.d.mts +8 -0
- package/es/{LobeSwitch/LobeSwitch.mjs → base-ui/Switch/Switch.mjs} +12 -12
- package/es/base-ui/Switch/Switch.mjs.map +1 -0
- package/es/base-ui/Switch/atoms.d.mts +56 -0
- package/es/{LobeSwitch → base-ui/Switch}/atoms.mjs +16 -16
- package/es/base-ui/Switch/atoms.mjs.map +1 -0
- package/es/base-ui/Switch/index.d.mts +4 -0
- package/es/{LobeSwitch → base-ui/Switch}/style.d.mts +1 -1
- package/es/{LobeSwitch → base-ui/Switch}/style.mjs +4 -4
- package/es/base-ui/Switch/style.mjs.map +1 -0
- package/es/{LobeSwitch → base-ui/Switch}/type.d.mts +21 -21
- package/es/{Toast → base-ui/Toast}/Toast.mjs +2 -2
- package/es/base-ui/Toast/Toast.mjs.map +1 -0
- package/es/{Toast → base-ui/Toast}/context.mjs +1 -1
- package/es/base-ui/Toast/context.mjs.map +1 -0
- package/es/{Toast → base-ui/Toast}/imperative.d.mts +3 -3
- package/es/{Toast → base-ui/Toast}/imperative.mjs +3 -3
- package/es/base-ui/Toast/imperative.mjs.map +1 -0
- package/es/base-ui/Toast/index.d.mts +2 -0
- package/es/{Toast → base-ui/Toast}/style.mjs +1 -1
- package/es/base-ui/Toast/style.mjs.map +1 -0
- package/es/{Toast → base-ui/Toast}/type.d.mts +3 -3
- package/es/base-ui/index.d.mts +28 -0
- package/es/base-ui/index.mjs +16 -0
- 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/hooks/useNativeButton.mjs +2 -2
- package/es/hooks/useNativeButton.mjs.map +1 -1
- package/es/i18n/context.d.mts +2 -2
- package/es/icons/lucideExtra/BotPromptIcon.d.mts +2 -2
- package/es/icons/lucideExtra/CreateBotIcon.d.mts +2 -2
- 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/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/index.d.mts +15 -24
- package/es/index.mjs +11 -16
- 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 +48 -33
- package/awesome.d.ts +0 -1
- package/awesome.js +0 -1
- package/brand.d.ts +0 -1
- package/brand.js +0 -1
- package/chat.d.ts +0 -1
- package/chat.js +0 -1
- package/color.d.ts +0 -1
- package/color.js +0 -1
- package/es/ContextMenu/ContextMenuHost.d.mts +0 -8
- package/es/ContextMenu/ContextMenuHost.mjs.map +0 -1
- package/es/ContextMenu/ContextMenuTrigger.mjs.map +0 -1
- package/es/ContextMenu/renderItems.d.mts +0 -4
- package/es/ContextMenu/renderItems.mjs.map +0 -1
- package/es/ContextMenu/store.mjs.map +0 -1
- package/es/ContextMenu/type.d.mts +0 -12
- package/es/DropdownMenu/DropdownMenu.d.mts +0 -8
- package/es/DropdownMenu/DropdownMenu.mjs.map +0 -1
- package/es/DropdownMenu/atoms.mjs.map +0 -1
- package/es/DropdownMenu/renderItems.mjs.map +0 -1
- package/es/LobeSelect/LobeSelect.d.mts +0 -8
- package/es/LobeSelect/LobeSelect.mjs.map +0 -1
- package/es/LobeSelect/atoms.d.mts +0 -155
- package/es/LobeSelect/atoms.mjs.map +0 -1
- package/es/LobeSelect/index.d.mts +0 -4
- package/es/LobeSelect/index.mjs +0 -4
- package/es/LobeSelect/style.mjs.map +0 -1
- package/es/LobeSwitch/LobeSwitch.d.mts +0 -8
- package/es/LobeSwitch/LobeSwitch.mjs.map +0 -1
- package/es/LobeSwitch/atoms.d.mts +0 -56
- package/es/LobeSwitch/atoms.mjs.map +0 -1
- package/es/LobeSwitch/index.d.mts +0 -5
- package/es/LobeSwitch/index.d.ts +0 -1
- package/es/LobeSwitch/index.js +0 -1
- package/es/LobeSwitch/index.mjs +0 -5
- package/es/LobeSwitch/style.mjs.map +0 -1
- package/es/ScrollArea/ScrollArea.mjs.map +0 -1
- package/es/ScrollArea/atoms.mjs.map +0 -1
- package/es/ScrollArea/globalStyle.mjs.map +0 -1
- package/es/ScrollArea/style.mjs.map +0 -1
- package/es/Toast/Toast.mjs.map +0 -1
- package/es/Toast/context.mjs.map +0 -1
- package/es/Toast/imperative.mjs.map +0 -1
- package/es/Toast/style.mjs.map +0 -1
- package/icons.d.ts +0 -1
- package/icons.js +0 -1
- package/mdx.d.ts +0 -1
- package/mdx.js +0 -1
- package/mobile.d.ts +0 -1
- package/mobile.js +0 -1
- package/storybook.d.ts +0 -1
- package/storybook.js +0 -1
- /package/es/{ContextMenu → base-ui/ContextMenu}/imperative.d.mts +0 -0
- /package/es/{LobeSelect → base-ui}/index.d.ts +0 -0
- /package/es/{LobeSelect → base-ui}/index.js +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { useNativeButton } from "
|
|
4
|
-
import { FloatingLayerProvider } from "
|
|
5
|
-
import { useAppElement } from "
|
|
6
|
-
import { CLASSNAMES } from "
|
|
7
|
-
import { placementMap } from "
|
|
8
|
-
import { styles } from "
|
|
3
|
+
import { useNativeButton } from "../../hooks/useNativeButton.mjs";
|
|
4
|
+
import { FloatingLayerProvider } from "../../hooks/useFloatingLayer.mjs";
|
|
5
|
+
import { useAppElement } from "../../ThemeProvider/AppElementContext.mjs";
|
|
6
|
+
import { CLASSNAMES } from "../../styles/classNames.mjs";
|
|
7
|
+
import { placementMap } from "../../utils/placement.mjs";
|
|
8
|
+
import { styles } from "../../Menu/sharedStyle.mjs";
|
|
9
9
|
import { cloneElement, isValidElement, useCallback, useState } from "react";
|
|
10
10
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
11
|
import { Switch } from "antd";
|
|
@@ -15,7 +15,7 @@ import { mergeRefs } from "react-merge-refs";
|
|
|
15
15
|
import { Menu as Menu$1 } from "@base-ui/react/menu";
|
|
16
16
|
import clsx from "clsx";
|
|
17
17
|
|
|
18
|
-
//#region src/DropdownMenu/atoms.tsx
|
|
18
|
+
//#region src/base-ui/DropdownMenu/atoms.tsx
|
|
19
19
|
const DropdownMenuRoot = (props) => /* @__PURE__ */ jsx(Menu$1.Root, {
|
|
20
20
|
modal: false,
|
|
21
21
|
...props
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"atoms.mjs","names":["DropdownMenuRoot: typeof Menu.Root","Menu"],"sources":["../../../src/base-ui/DropdownMenu/atoms.tsx"],"sourcesContent":["'use client';\n\nimport { Menu } from '@base-ui/react/menu';\nimport { mergeProps } from '@base-ui/react/merge-props';\nimport { Switch } from 'antd';\nimport { cx } from 'antd-style';\nimport clsx from 'clsx';\nimport type React from 'react';\nimport { cloneElement, isValidElement, useCallback, useState } from 'react';\nimport { mergeRefs } from 'react-merge-refs';\n\nimport { FloatingLayerProvider } from '@/hooks/useFloatingLayer';\nimport { useNativeButton } from '@/hooks/useNativeButton';\nimport { styles } from '@/Menu/sharedStyle';\nimport { CLASSNAMES } from '@/styles/classNames';\nimport { useAppElement } from '@/ThemeProvider';\nimport { placementMap } from '@/utils/placement';\n\nimport { type DropdownMenuPlacement } from './type';\n\nexport const DropdownMenuRoot: typeof Menu.Root = (props) => <Menu.Root modal={false} {...props} />;\nexport const DropdownMenuSubmenuRoot = Menu.SubmenuRoot;\nexport const DropdownMenuCheckboxItemIndicator = Menu.CheckboxItemIndicator;\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 type DropdownMenuTriggerProps = Omit<\n React.ComponentPropsWithRef<typeof Menu.Trigger>,\n 'children' | 'render'\n> & {\n children: React.ReactNode;\n};\n\nexport const DropdownMenuTrigger = ({\n children,\n className,\n nativeButton,\n ref: refProp,\n ...rest\n}: DropdownMenuTriggerProps) => {\n const { isNativeButtonTriggerElement, resolvedNativeButton } = useNativeButton({\n children,\n nativeButton,\n });\n\n const renderer = (props: any) => {\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, ...restProps } = props as any;\n return restProps;\n })();\n\n const mergedProps = mergeProps((children as any).props, resolvedProps);\n return cloneElement(children as any, {\n ...mergedProps,\n className: clsx(CLASSNAMES.DropdownMenuTrigger, className, mergedProps.className),\n ref: mergeRefs([(children as any).ref, (props as any).ref, refProp]),\n });\n };\n\n if (isValidElement(children)) {\n return <Menu.Trigger {...rest} nativeButton={resolvedNativeButton} render={renderer as any} />;\n }\n\n return (\n <Menu.Trigger\n {...rest}\n className={clsx(CLASSNAMES.DropdownMenuTrigger, className)}\n nativeButton={resolvedNativeButton}\n ref={refProp as any}\n >\n {children}\n </Menu.Trigger>\n );\n};\n\nDropdownMenuTrigger.displayName = 'DropdownMenuTrigger';\n\nexport type DropdownMenuPortalProps = React.ComponentProps<typeof Menu.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 DropdownMenuPortal = ({ container, ...rest }: DropdownMenuPortalProps) => {\n const appElement = useAppElement();\n return <Menu.Portal container={container ?? appElement ?? undefined} {...rest} />;\n};\n\nDropdownMenuPortal.displayName = 'DropdownMenuPortal';\n\nexport type DropdownMenuPositionerProps = React.ComponentProps<typeof Menu.Positioner> & {\n hoverTrigger?: boolean;\n placement?: DropdownMenuPlacement;\n};\n\nexport const DropdownMenuPositioner = ({\n className,\n placement,\n hoverTrigger,\n align,\n side,\n sideOffset,\n children,\n ...rest\n}: DropdownMenuPositionerProps) => {\n const placementConfig = placement ? placementMap[placement] : undefined;\n const [positionerNode, setPositionerNode] = useState<HTMLDivElement | null>(null);\n\n return (\n <Menu.Positioner\n {...rest}\n align={align ?? placementConfig?.align}\n className={mergeStateClassName(styles.positioner, className as any) as any}\n data-hover-trigger={hoverTrigger || undefined}\n data-placement={placement}\n ref={setPositionerNode}\n side={side ?? placementConfig?.side}\n sideOffset={sideOffset ?? (placementConfig ? 6 : undefined)}\n >\n <FloatingLayerProvider value={positionerNode}>{children}</FloatingLayerProvider>\n </Menu.Positioner>\n );\n};\n\nDropdownMenuPositioner.displayName = 'DropdownMenuPositioner';\n\nexport type DropdownMenuPopupProps = React.ComponentProps<typeof Menu.Popup>;\n\nexport const DropdownMenuPopup = ({ className, ...rest }: DropdownMenuPopupProps) => {\n return (\n <Menu.Popup {...rest} className={mergeStateClassName(styles.popup, className as any) as any} />\n );\n};\n\nDropdownMenuPopup.displayName = 'DropdownMenuPopup';\n\nexport type DropdownMenuItemProps = React.ComponentProps<typeof Menu.Item> & { danger?: boolean };\n\nexport const DropdownMenuItem = ({ className, danger, ...rest }: DropdownMenuItemProps) => {\n return (\n <Menu.Item\n {...rest}\n className={(state) =>\n cx(\n styles.item,\n danger && styles.danger,\n typeof className === 'function' ? className(state) : className,\n )\n }\n />\n );\n};\n\nDropdownMenuItem.displayName = 'DropdownMenuItem';\n\nexport type DropdownMenuCheckboxItemProps = React.ComponentProps<typeof Menu.CheckboxItem> & {\n danger?: boolean;\n};\n\nexport const DropdownMenuCheckboxItemPrimitive = ({\n className,\n danger,\n ...rest\n}: DropdownMenuCheckboxItemProps) => {\n return (\n <Menu.CheckboxItem\n {...rest}\n className={(state) =>\n cx(\n styles.item,\n danger && styles.danger,\n typeof className === 'function' ? className(state) : className,\n )\n }\n />\n );\n};\n\nDropdownMenuCheckboxItemPrimitive.displayName = 'DropdownMenuCheckboxItemPrimitive';\n\nexport type DropdownMenuSeparatorProps = React.ComponentProps<typeof Menu.Separator>;\n\nexport const DropdownMenuSeparator = ({ className, ...rest }: DropdownMenuSeparatorProps) => {\n return (\n <Menu.Separator\n {...rest}\n className={(state) =>\n cx(styles.separator, typeof className === 'function' ? className(state) : className)\n }\n />\n );\n};\n\nDropdownMenuSeparator.displayName = 'DropdownMenuSeparator';\n\nexport const DropdownMenuGroup = Menu.Group;\n\nexport type DropdownMenuGroupLabelProps = React.ComponentProps<typeof Menu.GroupLabel>;\n\nexport const DropdownMenuGroupLabel = ({ className, ...rest }: DropdownMenuGroupLabelProps) => {\n return (\n <Menu.GroupLabel\n {...rest}\n className={(state) =>\n cx(styles.groupLabel, typeof className === 'function' ? className(state) : className)\n }\n />\n );\n};\n\nDropdownMenuGroupLabel.displayName = 'DropdownMenuGroupLabel';\n\nexport type DropdownMenuSubmenuTriggerProps = React.ComponentProps<typeof Menu.SubmenuTrigger> & {\n danger?: boolean;\n};\n\nexport const DropdownMenuSubmenuTrigger = ({\n className,\n danger,\n ...rest\n}: DropdownMenuSubmenuTriggerProps) => {\n return (\n <Menu.SubmenuTrigger\n {...rest}\n className={(state) =>\n cx(\n styles.item,\n danger && styles.danger,\n typeof className === 'function' ? className(state) : className,\n )\n }\n />\n );\n};\n\nDropdownMenuSubmenuTrigger.displayName = 'DropdownMenuSubmenuTrigger';\n\nexport type DropdownMenuItemContentProps = React.HTMLAttributes<HTMLDivElement>;\n\nexport const DropdownMenuItemContent = ({ className, ...rest }: DropdownMenuItemContentProps) => {\n return <div {...rest} className={cx(styles.itemContent, className)} />;\n};\n\nDropdownMenuItemContent.displayName = 'DropdownMenuItemContent';\n\nexport type DropdownMenuItemIconProps = React.HTMLAttributes<HTMLSpanElement>;\n\nexport const DropdownMenuItemIcon = ({ className, ...rest }: DropdownMenuItemIconProps) => {\n return <span {...rest} className={cx(styles.icon, className)} />;\n};\n\nDropdownMenuItemIcon.displayName = 'DropdownMenuItemIcon';\n\nexport type DropdownMenuItemLabelGroupProps = React.HTMLAttributes<HTMLDivElement>;\n\nexport const DropdownMenuItemLabelGroup = ({\n className,\n ...rest\n}: DropdownMenuItemLabelGroupProps) => {\n return <div {...rest} className={cx(styles.labelGroup, className)} />;\n};\n\nDropdownMenuItemLabelGroup.displayName = 'DropdownMenuItemLabelGroup';\n\nexport type DropdownMenuItemLabelProps = React.HTMLAttributes<HTMLSpanElement>;\n\nexport const DropdownMenuItemLabel = ({ className, ...rest }: DropdownMenuItemLabelProps) => {\n return <span {...rest} className={cx(styles.label, className)} />;\n};\n\nDropdownMenuItemLabel.displayName = 'DropdownMenuItemLabel';\n\nexport type DropdownMenuItemDescProps = React.HTMLAttributes<HTMLSpanElement>;\n\nexport const DropdownMenuItemDesc = ({ className, ...rest }: DropdownMenuItemDescProps) => {\n return <span {...rest} className={cx(styles.desc, className)} />;\n};\n\nDropdownMenuItemDesc.displayName = 'DropdownMenuItemDesc';\n\nexport type DropdownMenuItemExtraProps = React.HTMLAttributes<HTMLSpanElement>;\n\nexport const DropdownMenuItemExtra = ({ className, ...rest }: DropdownMenuItemExtraProps) => {\n return <span {...rest} className={cx(styles.extra, className)} />;\n};\n\nDropdownMenuItemExtra.displayName = 'DropdownMenuItemExtra';\n\nexport type DropdownMenuSubmenuArrowProps = React.HTMLAttributes<HTMLSpanElement>;\n\nexport const DropdownMenuSubmenuArrow = ({ className, ...rest }: DropdownMenuSubmenuArrowProps) => {\n return <span {...rest} className={cx(styles.submenuArrow, className)} />;\n};\n\nDropdownMenuSubmenuArrow.displayName = 'DropdownMenuSubmenuArrow';\n\nexport type DropdownMenuSwitchItemProps = Omit<\n React.ComponentProps<typeof Menu.Item>,\n 'onClick'\n> & {\n checked?: boolean;\n closeOnClick?: boolean;\n danger?: boolean;\n defaultChecked?: boolean;\n onCheckedChange?: (checked: boolean) => void;\n};\n\nexport const DropdownMenuSwitchItem = ({\n checked: checkedProp,\n className,\n closeOnClick = false,\n danger,\n defaultChecked,\n disabled,\n onCheckedChange,\n children,\n ...rest\n}: DropdownMenuSwitchItemProps) => {\n const [internalChecked, setInternalChecked] = useState(defaultChecked ?? false);\n const isControlled = checkedProp !== undefined;\n const checked = isControlled ? checkedProp : internalChecked;\n\n const handleCheckedChange = useCallback(\n (newChecked: boolean) => {\n if (!isControlled) {\n setInternalChecked(newChecked);\n }\n onCheckedChange?.(newChecked);\n },\n [isControlled, onCheckedChange],\n );\n\n return (\n <Menu.Item\n {...rest}\n closeOnClick={closeOnClick}\n disabled={disabled}\n className={(state) =>\n cx(\n styles.item,\n danger && styles.danger,\n typeof className === 'function' ? className(state) : className,\n )\n }\n onClick={(e) => {\n e.preventDefault();\n if (!disabled) {\n handleCheckedChange(!checked);\n }\n }}\n >\n {children}\n <Switch\n checked={checked}\n disabled={disabled}\n size=\"small\"\n style={{ marginInlineStart: 16 }}\n onChange={handleCheckedChange}\n onClick={(_, e) => e.stopPropagation()}\n />\n </Menu.Item>\n );\n};\n\nDropdownMenuSwitchItem.displayName = 'DropdownMenuSwitchItem';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAoBA,MAAaA,oBAAsC,UAAU,oBAACC,OAAK;CAAK,OAAO;CAAO,GAAI;EAAS;AACnG,MAAa,0BAA0BA,OAAK;AAC5C,MAAa,oCAAoCA,OAAK;AAEtD,MAAM,uBACJ,MACA,cACG;AACH,KAAI,OAAO,cAAc,WAAY,SAAQ,UAAkB,GAAG,MAAM,UAAU,MAAM,CAAC;AACzF,QAAO,GAAG,MAAM,UAAU;;AAU5B,MAAa,uBAAuB,EAClC,UACA,WACA,cACA,KAAK,SACL,GAAG,WAC2B;CAC9B,MAAM,EAAE,8BAA8B,yBAAyB,gBAAgB;EAC7E;EACA;EACD,CAAC;CAEF,MAAM,YAAY,UAAe;EAG/B,MAAM,uBAAuB;AAC3B,OAAI,6BAA8B,QAAO;GAEzC,MAAM,EAAE,MAAM,GAAG,cAAc;AAC/B,UAAO;MACL;EAEJ,MAAM,cAAc,WAAY,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AE,gBAAgB;AAClB,OAAI,CAAC,SACH,qBAAoB,CAAC,QAAQ;;aAIhC,UACD,oBAAC;GACU;GACC;GACV,MAAK;GACL,OAAO,EAAE,mBAAmB,IAAI;GAChC,UAAU;GACV,UAAU,GAAG,MAAM,EAAE,iBAAiB;IACtC;GACQ;;AAIhB,uBAAuB,cAAc"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { IconSpaceMode } from "../../Menu/renderUtils.mjs";
|
|
2
|
+
import { renderDropdownMenuItems } from "./renderItems.mjs";
|
|
3
|
+
import { DropdownItem, DropdownMenuCheckboxItem, DropdownMenuPlacement, DropdownMenuProps, DropdownMenuSwitchItem } from "./type.mjs";
|
|
4
|
+
import { DropdownMenuCheckboxItemIndicator, DropdownMenuCheckboxItemPrimitive, DropdownMenuCheckboxItemProps, DropdownMenuGroup, DropdownMenuGroupLabel, DropdownMenuGroupLabelProps, DropdownMenuItem, DropdownMenuItemContent, DropdownMenuItemContentProps, DropdownMenuItemDesc, DropdownMenuItemDescProps, DropdownMenuItemExtra, DropdownMenuItemExtraProps, DropdownMenuItemIcon, DropdownMenuItemIconProps, DropdownMenuItemLabel, DropdownMenuItemLabelGroup, DropdownMenuItemLabelGroupProps, DropdownMenuItemLabelProps, DropdownMenuItemProps, DropdownMenuPopup, DropdownMenuPopupProps, DropdownMenuPortal, DropdownMenuPortalProps, DropdownMenuPositioner, DropdownMenuPositionerProps, DropdownMenuRoot, DropdownMenuSeparator, DropdownMenuSeparatorProps, DropdownMenuSubmenuArrow, DropdownMenuSubmenuArrowProps, DropdownMenuSubmenuRoot, DropdownMenuSubmenuTrigger, DropdownMenuSubmenuTriggerProps, DropdownMenuSwitchItem as DropdownMenuSwitchItem$1, DropdownMenuSwitchItemProps, DropdownMenuTrigger, DropdownMenuTriggerProps } from "./atoms.mjs";
|
|
5
|
+
import { DropdownMenu } from "./DropdownMenu.mjs";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { IconAlign, IconSpaceMode, RenderOptions } from "
|
|
2
|
-
import "
|
|
1
|
+
import { IconAlign, IconSpaceMode, RenderOptions } from "../../Menu/renderUtils.mjs";
|
|
2
|
+
import "../../Menu/index.mjs";
|
|
3
3
|
import { DropdownItem } from "./type.mjs";
|
|
4
4
|
import { ReactNode } from "react";
|
|
5
5
|
|
|
6
|
-
//#region src/DropdownMenu/renderItems.d.ts
|
|
6
|
+
//#region src/base-ui/DropdownMenu/renderItems.d.ts
|
|
7
7
|
declare const renderDropdownMenuItems: (items: DropdownItem[], keyPath?: string[], options?: RenderOptions) => ReactNode[];
|
|
8
8
|
//#endregion
|
|
9
9
|
export { renderDropdownMenuItems };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { styles } from "
|
|
1
|
+
import { styles } from "../../Menu/sharedStyle.mjs";
|
|
2
2
|
import { DropdownMenuCheckboxItemIndicator, DropdownMenuCheckboxItemPrimitive, DropdownMenuGroup, DropdownMenuGroupLabel, DropdownMenuItem, DropdownMenuItemContent, DropdownMenuItemDesc, DropdownMenuItemExtra, DropdownMenuItemIcon, DropdownMenuItemLabel, DropdownMenuItemLabelGroup, DropdownMenuPopup, DropdownMenuPortal, DropdownMenuPositioner, DropdownMenuSeparator, DropdownMenuSubmenuArrow, DropdownMenuSubmenuRoot, DropdownMenuSubmenuTrigger, DropdownMenuSwitchItem } from "./atoms.mjs";
|
|
3
|
-
import { getItemKey, getItemLabel, hasAnyIcon, hasCheckboxAndIcon, renderIcon } from "
|
|
3
|
+
import { getItemKey, getItemLabel, hasAnyIcon, hasCheckboxAndIcon, renderIcon } from "../../Menu/renderUtils.mjs";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
import { Check, ChevronRight } from "lucide-react";
|
|
6
6
|
|
|
7
|
-
//#region src/DropdownMenu/renderItems.tsx
|
|
7
|
+
//#region src/base-ui/DropdownMenu/renderItems.tsx
|
|
8
8
|
const renderItemContent = (item, options, iconNode) => {
|
|
9
9
|
const label = getItemLabel(item);
|
|
10
10
|
const desc = "desc" in item ? item.desc : void 0;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderItems.mjs","names":["info: MenuInfo","label","labelText","isDanger"],"sources":["../../../src/base-ui/DropdownMenu/renderItems.tsx"],"sourcesContent":["import { Check, ChevronRight } from 'lucide-react';\nimport { type MenuInfo } from 'rc-menu/es/interface';\nimport {\n type KeyboardEvent as ReactKeyboardEvent,\n type MouseEvent as ReactMouseEvent,\n type ReactNode,\n} from 'react';\n\nimport {\n getItemKey,\n getItemLabel,\n hasAnyIcon,\n hasCheckboxAndIcon,\n type MenuDividerType,\n type MenuItemGroupType,\n type MenuItemType,\n renderIcon,\n type RenderItemContentOptions,\n type RenderOptions,\n type SubMenuType,\n} from '@/Menu';\nimport { styles } from '@/Menu/sharedStyle';\n\nimport {\n DropdownMenuCheckboxItemIndicator,\n DropdownMenuCheckboxItemPrimitive,\n DropdownMenuGroup,\n DropdownMenuGroupLabel,\n DropdownMenuItem,\n DropdownMenuItemContent,\n DropdownMenuItemDesc,\n DropdownMenuItemExtra,\n DropdownMenuItemIcon,\n DropdownMenuItemLabel,\n DropdownMenuItemLabelGroup,\n DropdownMenuPopup,\n DropdownMenuPortal,\n DropdownMenuPositioner,\n DropdownMenuSeparator,\n DropdownMenuSubmenuArrow,\n DropdownMenuSubmenuRoot,\n DropdownMenuSubmenuTrigger,\n DropdownMenuSwitchItem,\n} from './atoms';\nimport {\n type DropdownItem,\n type DropdownMenuCheckboxItem as DropdownMenuCheckboxItemType,\n type DropdownMenuSwitchItem as DropdownMenuSwitchItemType,\n} from './type';\n\nexport type { IconAlign, IconSpaceMode } from '@/Menu';\n\nconst renderItemContent = (\n item: MenuItemType | SubMenuType | DropdownMenuCheckboxItemType | DropdownMenuSwitchItemType,\n options?: RenderItemContentOptions,\n iconNode?: ReactNode,\n) => {\n const label = getItemLabel(item);\n const desc = 'desc' in item ? item.desc : undefined;\n const extra = 'extra' in item ? item.extra : undefined;\n const indicatorOnRight = options?.indicatorOnRight;\n const alignStart = Boolean(desc) && options?.iconAlign === 'start';\n\n const hasCustomIcon = iconNode !== undefined && !indicatorOnRight;\n const hasIcon = hasCustomIcon ? Boolean(iconNode) : Boolean(item.icon);\n const shouldRenderIcon = hasCustomIcon\n ? Boolean(options?.reserveIconSpace || iconNode)\n : Boolean(hasIcon || options?.reserveIconSpace);\n\n const labelNode = desc ? (\n <DropdownMenuItemLabelGroup>\n <DropdownMenuItemLabel>{label}</DropdownMenuItemLabel>\n <DropdownMenuItemDesc>{desc}</DropdownMenuItemDesc>\n </DropdownMenuItemLabelGroup>\n ) : (\n <DropdownMenuItemLabel>{label}</DropdownMenuItemLabel>\n );\n\n return (\n <DropdownMenuItemContent className={alignStart ? styles.itemContentAlignStart : undefined}>\n {shouldRenderIcon ? (\n <DropdownMenuItemIcon\n aria-hidden={!hasIcon}\n className={alignStart ? styles.iconAlignStart : undefined}\n >\n {hasCustomIcon ? iconNode : hasIcon ? renderIcon(item.icon) : null}\n </DropdownMenuItemIcon>\n ) : null}\n {labelNode}\n {extra ? <DropdownMenuItemExtra>{extra}</DropdownMenuItemExtra> : null}\n {indicatorOnRight && iconNode ? iconNode : null}\n {options?.submenu ? (\n <DropdownMenuSubmenuArrow>\n <ChevronRight size={16} />\n </DropdownMenuSubmenuArrow>\n ) : null}\n </DropdownMenuItemContent>\n );\n};\n\nconst invokeItemClick = (\n item: MenuItemType,\n keyPath: string[],\n event: ReactMouseEvent<HTMLElement> | ReactKeyboardEvent<HTMLElement>,\n) => {\n if (!item.onClick) return;\n const key = item.key ?? keyPath.at(-1) ?? '';\n const info: MenuInfo = {\n domEvent: event,\n item: event.currentTarget as MenuInfo['item'],\n key: String(key),\n keyPath,\n };\n item.onClick(info);\n};\n\nexport const renderDropdownMenuItems = (\n items: DropdownItem[],\n keyPath: string[] = [],\n options?: RenderOptions,\n): ReactNode[] => {\n const iconAlign = options?.iconAlign;\n const iconSpaceMode = options?.iconSpaceMode ?? 'global';\n const reserveIconSpace =\n options?.reserveIconSpace ?? hasAnyIcon(items, iconSpaceMode === 'global');\n const indicatorOnRight = options?.indicatorOnRight ?? hasCheckboxAndIcon(items);\n\n return items.map((item, index) => {\n if (!item) return null;\n\n const fallbackKey = `${keyPath.join('-') || 'root'}-${index}`;\n const itemKey = getItemKey(item, fallbackKey);\n const nextKeyPath = [...keyPath, String(itemKey)];\n\n if ((item as DropdownMenuCheckboxItemType).type === 'checkbox') {\n const checkboxItem = item as DropdownMenuCheckboxItemType;\n const label = getItemLabel(checkboxItem);\n const labelText = typeof label === 'string' ? label : undefined;\n const isDanger = Boolean(checkboxItem.danger);\n const indicator = (\n <DropdownMenuCheckboxItemIndicator>{renderIcon(Check)}</DropdownMenuCheckboxItemIndicator>\n );\n\n return (\n <DropdownMenuCheckboxItemPrimitive\n checked={checkboxItem.checked}\n closeOnClick={checkboxItem.closeOnClick}\n danger={isDanger}\n defaultChecked={checkboxItem.defaultChecked}\n disabled={checkboxItem.disabled}\n key={itemKey}\n label={labelText}\n onCheckedChange={(checked) => checkboxItem.onCheckedChange?.(checked)}\n >\n {renderItemContent(\n checkboxItem,\n { iconAlign, indicatorOnRight, reserveIconSpace },\n indicator,\n )}\n </DropdownMenuCheckboxItemPrimitive>\n );\n }\n\n if ((item as DropdownMenuSwitchItemType).type === 'switch') {\n const switchItem = item as DropdownMenuSwitchItemType;\n const label = getItemLabel(switchItem);\n const labelText = typeof label === 'string' ? label : undefined;\n const isDanger = Boolean(switchItem.danger);\n\n return (\n <DropdownMenuSwitchItem\n checked={switchItem.checked}\n closeOnClick={switchItem.closeOnClick}\n danger={isDanger}\n defaultChecked={switchItem.defaultChecked}\n disabled={switchItem.disabled}\n key={itemKey}\n label={labelText}\n onCheckedChange={(checked) => switchItem.onCheckedChange?.(checked)}\n >\n {renderItemContent(switchItem, { iconAlign, reserveIconSpace })}\n </DropdownMenuSwitchItem>\n );\n }\n\n if ((item as MenuDividerType).type === 'divider') {\n return <DropdownMenuSeparator key={itemKey} />;\n }\n\n if ((item as MenuItemGroupType).type === 'group') {\n const group = item as MenuItemGroupType;\n const groupReserveIconSpace =\n iconSpaceMode === 'group'\n ? group.children\n ? hasAnyIcon(group.children)\n : false\n : reserveIconSpace;\n const groupIndicatorOnRight = group.children ? hasCheckboxAndIcon(group.children) : false;\n return (\n <DropdownMenuGroup key={itemKey}>\n {group.label ? <DropdownMenuGroupLabel>{group.label}</DropdownMenuGroupLabel> : null}\n {group.children\n ? renderDropdownMenuItems(group.children, nextKeyPath, {\n iconAlign,\n iconSpaceMode,\n indicatorOnRight: groupIndicatorOnRight,\n reserveIconSpace: groupReserveIconSpace,\n })\n : null}\n </DropdownMenuGroup>\n );\n }\n\n if ((item as SubMenuType).type === 'submenu' || 'children' in item) {\n const submenu = item as SubMenuType;\n const label = getItemLabel(submenu);\n const labelText = typeof label === 'string' ? label : undefined;\n const isDanger = 'danger' in submenu && Boolean(submenu.danger);\n\n return (\n <DropdownMenuSubmenuRoot key={itemKey}>\n <DropdownMenuSubmenuTrigger\n danger={isDanger}\n disabled={submenu.disabled}\n label={labelText}\n >\n {renderItemContent(submenu, {\n iconAlign,\n reserveIconSpace,\n submenu: true,\n })}\n </DropdownMenuSubmenuTrigger>\n <DropdownMenuPortal>\n <DropdownMenuPositioner alignOffset={-4} data-submenu=\"\" sideOffset={-1}>\n <DropdownMenuPopup>\n {submenu.children\n ? renderDropdownMenuItems(submenu.children, nextKeyPath, {\n iconAlign,\n iconSpaceMode,\n })\n : null}\n </DropdownMenuPopup>\n </DropdownMenuPositioner>\n </DropdownMenuPortal>\n </DropdownMenuSubmenuRoot>\n );\n }\n\n const menuItem = item as MenuItemType;\n const label = getItemLabel(menuItem);\n const labelText = typeof label === 'string' ? label : undefined;\n const isDanger = 'danger' in menuItem && Boolean(menuItem.danger);\n\n return (\n <DropdownMenuItem\n closeOnClick={menuItem.closeOnClick}\n danger={isDanger}\n disabled={menuItem.disabled}\n key={itemKey}\n label={labelText}\n onClick={(event) => invokeItem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kB,UAAU;IAAE;IAAW;IAAkB,CAAC;KAJxD,QAKY;GAErB"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { Trigger } from "
|
|
2
|
-
import "
|
|
3
|
-
import { Placement } from "
|
|
4
|
-
import { MenuCheckboxItemType } from "
|
|
5
|
-
import { MenuSwitchItemType } from "
|
|
6
|
-
import { BaseMenuItemType } from "
|
|
7
|
-
import { IconAlign, IconSpaceMode } from "
|
|
8
|
-
import "
|
|
1
|
+
import { Trigger } from "../../types/trigger.mjs";
|
|
2
|
+
import "../../types/index.mjs";
|
|
3
|
+
import { Placement } from "../../utils/placement.mjs";
|
|
4
|
+
import { MenuCheckboxItemType } from "../../Menu/checkboxItem.mjs";
|
|
5
|
+
import { MenuSwitchItemType } from "../../Menu/switchItem.mjs";
|
|
6
|
+
import { BaseMenuItemType } from "../../Menu/baseItem.mjs";
|
|
7
|
+
import { IconAlign, IconSpaceMode } from "../../Menu/renderUtils.mjs";
|
|
8
|
+
import "../../Menu/index.mjs";
|
|
9
9
|
import "./renderItems.mjs";
|
|
10
10
|
import { ReactNode } from "react";
|
|
11
11
|
import { MenuPopupProps, MenuPortalProps, MenuPositionerProps, MenuRootProps, MenuTriggerProps } from "@base-ui/react/menu";
|
|
12
12
|
|
|
13
|
-
//#region src/DropdownMenu/type.d.ts
|
|
13
|
+
//#region src/base-ui/DropdownMenu/type.d.ts
|
|
14
14
|
type DropdownMenuPlacement = Placement;
|
|
15
15
|
type DropdownMenuCheckboxItem = MenuCheckboxItemType;
|
|
16
16
|
type DropdownMenuSwitchItem = MenuSwitchItemType;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { ScrollAreaContent, ScrollAreaCorner, ScrollAreaRoot, ScrollAreaScrollbar, ScrollAreaThumb, ScrollAreaViewport } from "./atoms.mjs";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
|
|
6
|
-
//#region src/ScrollArea/ScrollArea.tsx
|
|
6
|
+
//#region src/base-ui/ScrollArea/ScrollArea.tsx
|
|
7
7
|
const ScrollArea = ({ children, contentProps, corner = false, cornerProps, scrollFade = false, scrollbarProps, thumbProps, viewportProps, ...rest }) => {
|
|
8
8
|
return /* @__PURE__ */ jsxs(ScrollAreaRoot, {
|
|
9
9
|
...rest,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScrollArea.mjs","names":["ScrollArea: FC<ScrollAreaProps>"],"sources":["../../../src/base-ui/ScrollArea/ScrollArea.tsx"],"sourcesContent":["'use client';\n\nimport { type FC } from 'react';\n\nimport {\n ScrollAreaContent,\n ScrollAreaCorner,\n ScrollAreaRoot,\n ScrollAreaScrollbar,\n ScrollAreaThumb,\n ScrollAreaViewport,\n} from './atoms';\nimport type { ScrollAreaProps } from './type';\n\nexport const ScrollArea: FC<ScrollAreaProps> = ({\n children,\n contentProps,\n corner = false,\n cornerProps,\n scrollFade = false,\n scrollbarProps,\n thumbProps,\n viewportProps,\n ...rest\n}) => {\n return (\n <ScrollAreaRoot {...rest}>\n <ScrollAreaViewport scrollFade={scrollFade} {...viewportProps}>\n <ScrollAreaContent {...contentProps}>{children}</ScrollAreaContent>\n </ScrollAreaViewport>\n <ScrollAreaScrollbar {...scrollbarProps}>\n <ScrollAreaThumb {...thumbProps} />\n </ScrollAreaScrollbar>\n {corner && <ScrollAreaCorner {...cornerProps} />}\n </ScrollAreaRoot>\n );\n};\n"],"mappings":";;;;;;AAcA,MAAaA,cAAmC,EAC9C,UACA,cACA,SAAS,OACT,aACA,aAAa,OACb,gBACA,YACA,eACA,GAAG,WACC;AACJ,QACE,qBAAC;EAAe,GAAI;;GAClB,oBAAC;IAA+B;IAAY,GAAI;cAC9C,oBAAC;KAAkB,GAAI;KAAe;MAA6B;KAChD;GACrB,oBAAC;IAAoB,GAAI;cACvB,oBAAC,mBAAgB,GAAI,aAAc;KACf;GACrB,UAAU,oBAAC,oBAAiB,GAAI,cAAe;;GACjC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime20 from "react/jsx-runtime";
|
|
3
3
|
import { ScrollArea } from "@base-ui/react/scroll-area";
|
|
4
4
|
|
|
5
|
-
//#region src/ScrollArea/atoms.d.ts
|
|
5
|
+
//#region src/base-ui/ScrollArea/atoms.d.ts
|
|
6
6
|
type ScrollAreaRootProps = React.ComponentProps<typeof ScrollArea.Root>;
|
|
7
7
|
type ScrollAreaViewportProps = React.ComponentProps<typeof ScrollArea.Viewport> & {
|
|
8
8
|
/**
|
|
@@ -19,7 +19,7 @@ declare const ScrollAreaRoot: {
|
|
|
19
19
|
({
|
|
20
20
|
className,
|
|
21
21
|
...rest
|
|
22
|
-
}: ScrollAreaRootProps):
|
|
22
|
+
}: ScrollAreaRootProps): react_jsx_runtime20.JSX.Element;
|
|
23
23
|
displayName: string;
|
|
24
24
|
};
|
|
25
25
|
declare const ScrollAreaViewport: {
|
|
@@ -27,35 +27,35 @@ declare const ScrollAreaViewport: {
|
|
|
27
27
|
className,
|
|
28
28
|
scrollFade,
|
|
29
29
|
...rest
|
|
30
|
-
}: ScrollAreaViewportProps):
|
|
30
|
+
}: ScrollAreaViewportProps): react_jsx_runtime20.JSX.Element;
|
|
31
31
|
displayName: string;
|
|
32
32
|
};
|
|
33
33
|
declare const ScrollAreaContent: {
|
|
34
34
|
({
|
|
35
35
|
className,
|
|
36
36
|
...rest
|
|
37
|
-
}: ScrollAreaContentProps):
|
|
37
|
+
}: ScrollAreaContentProps): react_jsx_runtime20.JSX.Element;
|
|
38
38
|
displayName: string;
|
|
39
39
|
};
|
|
40
40
|
declare const ScrollAreaScrollbar: {
|
|
41
41
|
({
|
|
42
42
|
className,
|
|
43
43
|
...rest
|
|
44
|
-
}: ScrollAreaScrollbarProps):
|
|
44
|
+
}: ScrollAreaScrollbarProps): react_jsx_runtime20.JSX.Element;
|
|
45
45
|
displayName: string;
|
|
46
46
|
};
|
|
47
47
|
declare const ScrollAreaThumb: {
|
|
48
48
|
({
|
|
49
49
|
className,
|
|
50
50
|
...rest
|
|
51
|
-
}: ScrollAreaThumbProps):
|
|
51
|
+
}: ScrollAreaThumbProps): react_jsx_runtime20.JSX.Element;
|
|
52
52
|
displayName: string;
|
|
53
53
|
};
|
|
54
54
|
declare const ScrollAreaCorner: {
|
|
55
55
|
({
|
|
56
56
|
className,
|
|
57
57
|
...rest
|
|
58
|
-
}: ScrollAreaCornerProps):
|
|
58
|
+
}: ScrollAreaCornerProps): react_jsx_runtime20.JSX.Element;
|
|
59
59
|
displayName: string;
|
|
60
60
|
};
|
|
61
61
|
//#endregion
|
|
@@ -6,7 +6,7 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
|
6
6
|
import { cx } from "antd-style";
|
|
7
7
|
import { ScrollArea } from "@base-ui/react/scroll-area";
|
|
8
8
|
|
|
9
|
-
//#region src/ScrollArea/atoms.tsx
|
|
9
|
+
//#region src/base-ui/ScrollArea/atoms.tsx
|
|
10
10
|
const mergeStateClassName = (base, className) => {
|
|
11
11
|
if (typeof className === "function") return (state) => cx(base, className(state));
|
|
12
12
|
return cx(base, className);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"atoms.mjs","names":["BaseScrollArea","ScrollAreaGlobalStyle"],"sources":["../../../src/base-ui/ScrollArea/atoms.tsx"],"sourcesContent":["'use client';\n\nimport { ScrollArea as BaseScrollArea } from '@base-ui/react/scroll-area';\nimport { cx } from 'antd-style';\nimport type React from 'react';\n\nimport ScrollAreaGlobalStyle from './globalStyle';\nimport { styles } from './style';\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 type ScrollAreaRootProps = React.ComponentProps<typeof BaseScrollArea.Root>;\nexport type ScrollAreaViewportProps = React.ComponentProps<typeof BaseScrollArea.Viewport> & {\n /**\n * Enable gradient scroll fade on the viewport edges.\n * @default false\n */\n scrollFade?: boolean;\n};\nexport type ScrollAreaContentProps = React.ComponentProps<typeof BaseScrollArea.Content>;\nexport type ScrollAreaScrollbarProps = React.ComponentProps<typeof BaseScrollArea.Scrollbar>;\nexport type ScrollAreaThumbProps = React.ComponentProps<typeof BaseScrollArea.Thumb>;\nexport type ScrollAreaCornerProps = React.ComponentProps<typeof BaseScrollArea.Corner>;\n\nexport const ScrollAreaRoot = ({ className, ...rest }: ScrollAreaRootProps) => {\n return (\n <BaseScrollArea.Root {...rest} className={mergeStateClassName(styles.root, className) as any} />\n );\n};\n\nScrollAreaRoot.displayName = 'ScrollAreaRoot';\n\nexport const ScrollAreaViewport = ({\n className,\n scrollFade = false,\n ...rest\n}: ScrollAreaViewportProps) => {\n return (\n <>\n <ScrollAreaGlobalStyle />\n <BaseScrollArea.Viewport\n {...rest}\n className={\n mergeStateClassName(\n cx(styles.viewport, scrollFade && styles.viewportFade),\n className,\n ) as any\n }\n />\n </>\n );\n};\n\nScrollAreaViewport.displayName = 'ScrollAreaViewport';\n\nexport const ScrollAreaContent = ({ className, ...rest }: ScrollAreaContentProps) => {\n return (\n <BaseScrollArea.Content\n {...rest}\n className={mergeStateClassName(styles.content, className) as any}\n />\n );\n};\n\nScrollAreaContent.displayName = 'ScrollAreaContent';\n\nexport const ScrollAreaScrollbar = ({ className, ...rest }: ScrollAreaScrollbarProps) => {\n return (\n <BaseScrollArea.Scrollbar\n {...rest}\n className={mergeStateClassName(styles.scrollbar, className) as any}\n />\n );\n};\n\nScrollAreaScrollbar.displayName = 'ScrollAreaScrollbar';\n\nexport const ScrollAreaThumb = ({ className, ...rest }: ScrollAreaThumbProps) => {\n return (\n <BaseScrollArea.Thumb\n {...rest}\n className={mergeStateClassName(styles.thumb, className) as any}\n />\n );\n};\n\nScrollAreaThumb.displayName = 'ScrollAreaThumb';\n\nexport const ScrollAreaCorner = ({ className, ...rest }: ScrollAreaCornerProps) => {\n return (\n <BaseScrollArea.Corner\n {...rest}\n className={mergeStateClassName(styles.corner, className) as any}\n />\n );\n};\n\nScrollAreaCorner.displayName = 'ScrollAreaCorner';\n"],"mappings":";;;;;;;;;AASA,MAAM,uBACJ,MACA,cACG;AACH,KAAI,OAAO,cAAc,WAAY,SAAQ,UAAkB,GAAG,MAAM,UAAU,MAAM,CAAC;AACzF,QAAO,GAAG,MAAM,UAAU;;AAgB5B,MAAa,kBAAkB,EAAE,WAAW,GAAG,WAAgC;AAC7E,QACE,oBAACA,WAAe;EAAK,GAAI;EAAM,WAAW,oBAAoB,OAAO,MAAM,UAAU;GAAW;;AAIpG,eAAe,cAAc;AAE7B,MAAa,sBAAsB,EACjC,WACA,aAAa,OACb,GAAG,WAC0B;AAC7B,QACE,4CACE,oBAACC,wBAAwB,EACzB,oBAACD,WAAe;EACd,GAAI;EACJ,WACE,oBACE,GAAG,OAAO,UAAU,cAAc,OAAO,aAAa,EACtD,UACD;GAEH,IACD;;AAIP,mBAAmB,cAAc;AAEjC,MAAa,qBAAqB,EAAE,WAAW,GAAG,WAAmC;AACnF,QACE,oBAACA,WAAe;EACd,GAAI;EACJ,WAAW,oBAAoB,OAAO,SAAS,UAAU;GACzD;;AAIN,kBAAkB,cAAc;AAEhC,MAAa,uBAAuB,EAAE,WAAW,GAAG,WAAqC;AACvF,QACE,oBAACA,WAAe;EACd,GAAI;EACJ,WAAW,oBAAoB,OAAO,WAAW,UAAU;GAC3D;;AAIN,oBAAoB,cAAc;AAElC,MAAa,mBAAmB,EAAE,WAAW,GAAG,WAAiC;AAC/E,QACE,oBAACA,WAAe;EACd,GAAI;EACJ,WAAW,oBAAoB,OAAO,OAAO,UAAU;GACvD;;AAIN,gBAAgB,cAAc;AAE9B,MAAa,oBAAoB,EAAE,WAAW,GAAG,WAAkC;AACjF,QACE,oBAACA,WAAe;EACd,GAAI;EACJ,WAAW,oBAAoB,OAAO,QAAQ,UAAU;GACxD;;AAIN,iBAAiB,cAAc"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"globalStyle.mjs","names":[],"sources":["../../../src/base-ui/ScrollArea/globalStyle.ts"],"sourcesContent":["'use client';\n\nimport { createGlobalStyle, css } from 'antd-style';\n\n/**\n * Register animatable custom properties used by scroll-driven animations.\n *\n * Without @property registration, custom properties interpolate discretely,\n * which can cause visible snapping at scroll boundaries.\n */\nconst ScrollAreaGlobalStyle = createGlobalStyle(\n () => css`\n @property --lobe-scroll-area-fade-top {\n inherits: true;\n initial-value: 0;\n syntax: '<length>';\n }\n\n @property --lobe-scroll-area-fade-bottom {\n inherits: true;\n initial-value: 0;\n syntax: '<length>';\n }\n `,\n);\n\nexport default ScrollAreaGlobalStyle;\n"],"mappings":";;;;;;;;;;;AAUA,MAAM,wBAAwB,wBACtB,GAAG;;;;;;;;;;;;IAaV;AAED,0BAAe"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { ScrollAreaContent, ScrollAreaContentProps, ScrollAreaCorner, ScrollAreaCornerProps, ScrollAreaRoot, ScrollAreaRootProps, ScrollAreaScrollbar, ScrollAreaScrollbarProps, ScrollAreaThumb, ScrollAreaThumbProps, ScrollAreaViewport, ScrollAreaViewportProps } from "./atoms.mjs";
|
|
2
|
+
import { ScrollAreaProps } from "./type.mjs";
|
|
3
|
+
import { ScrollArea } from "./ScrollArea.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style.mjs","names":["cssVar"],"sources":["../../../src/base-ui/ScrollArea/style.ts"],"sourcesContent":["import { createStaticStyles } from 'antd-style';\n\nexport const styles = createStaticStyles(({ css, cssVar }) => ({\n content: css`\n display: flex;\n flex-direction: column;\n gap: 16px;\n\n font-size: ${cssVar.fontSizeSM};\n line-height: 1.375rem;\n color: ${cssVar.colorText};\n `,\n\n corner: css`\n background: ${cssVar.colorFillSecondary};\n `,\n\n root: css`\n position: relative;\n box-sizing: border-box;\n border-radius: ${cssVar.borderRadiusLG};\n background: ${cssVar.colorBgLayout};\n `,\n\n scrollbar: css`\n pointer-events: none;\n\n position: relative;\n\n display: flex;\n justify-content: center;\n\n margin: 8px;\n border-radius: ${cssVar.borderRadiusSM};\n\n opacity: 0;\n background: transparent;\n\n transition: opacity 150ms;\n\n &::before {\n content: '';\n position: absolute;\n }\n\n &[data-scrolling] {\n transition-duration: 0ms;\n }\n\n &[data-hovering],\n &[data-scrolling] {\n pointer-events: auto;\n opacity: 1;\n }\n\n &[data-orientation='vertical'] {\n width: 4px;\n\n &::before {\n inset-inline-start: 50%;\n transform: translateX(-50%);\n width: 20px;\n height: 100%;\n }\n }\n\n &[data-orientation='horizontal'] {\n height: 4px;\n\n &::before {\n inset-block-end: -8px;\n inset-inline: 0;\n width: 100%;\n height: 20px;\n }\n }\n `,\n\n thumb: css`\n width: 100%;\n border-radius: inherit;\n background: ${cssVar.colorTextQuaternary};\n `,\n\n viewport: css`\n position: relative;\n height: 100%;\n outline: none;\n\n &:focus-visible {\n outline: 2px solid ${cssVar.colorPrimary};\n outline-offset: 2px;\n }\n `,\n\n viewportFade: css`\n --scroll-area-overflow-y-start: inherit;\n --scroll-area-overflow-y-end: inherit;\n --lobe-scroll-area-fade-size: 40px;\n --lobe-scroll-area-fade-top: min(\n var(--lobe-scroll-area-fade-size),\n var(--scroll-area-overflow-y-start, 0px)\n );\n --lobe-scroll-area-fade-bottom: min(\n var(--lobe-scroll-area-fade-size),\n var(--scroll-area-overflow-y-end, 0px)\n );\n\n /* Fade the CONTENT via mask, so it works on background images too. */\n mask-image: linear-gradient(\n to bottom,\n transparent 0,\n #000 var(--lobe-scroll-area-fade-top),\n #000 calc(100% - var(--lobe-scroll-area-fade-bottom)),\n transparent 100%\n );\n mask-repeat: no-repeat;\n mask-size: 100% 100%;\n\n /* Scroll-driven animation: use scroll position to drive the mask. */\n @supports (animation-timeline: scroll()) {\n /*\n * Important: drive fade by *distance to edges* (first/last 40px),\n * so reaching top/bottom doesn't cause a sudden snap.\n */\n @keyframes lobe-scroll-area-fade-top-in {\n from {\n --lobe-scroll-area-fade-top: 0;\n }\n\n to {\n --lobe-scroll-area-fade-top: var(--lobe-scroll-area-fade-size);\n }\n }\n\n @keyframes lobe-scroll-area-fade-bottom-out {\n from {\n --lobe-scroll-area-fade-bottom: var(--lobe-scroll-area-fade-size);\n }\n\n to {\n --lobe-scroll-area-fade-bottom: 0;\n }\n }\n\n animation-name: lobe-scroll-area-fade-top-in, lobe-scroll-area-fade-bottom-out;\n animation-duration: 1ms, 1ms;\n animation-timing-function: linear, linear;\n animation-fill-mode: both, both;\n animation-timeline: scroll(self y), scroll(self y);\n\n animation-range:\n 0 var(--lobe-scroll-area-fade-size),\n calc(100% - var(--lobe-scroll-area-fade-size)) 100%;\n }\n `,\n}));\n"],"mappings":";;;AAEA,MAAa,SAAS,oBAAoB,EAAE,YAAK,wBAAc;CAC7D,SAAS,KAAG;;;;;iBAKGA,SAAO,WAAW;;aAEtBA,SAAO,UAAU;;CAG5B,QAAQ,KAAG;kBACKA,SAAO,mBAAmB;;CAG1C,MAAM,KAAG;;;qBAGUA,SAAO,eAAe;kBACzBA,SAAO,cAAc;;CAGrC,WAAW,KAAG;;;;;;;;;qBASKA,SAAO,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6CzC,OAAO,KAAG;;;kBAGMA,SAAO,oBAAoB;;CAG3C,UAAU,KAAG;;;;;;2BAMYA,SAAO,aAAa;;;;CAK7C,cAAc,KAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6DlB,EAAE"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ScrollAreaContentProps, ScrollAreaCornerProps, ScrollAreaRootProps, ScrollAreaScrollbarProps, ScrollAreaThumbProps, ScrollAreaViewportProps } from "./atoms.mjs";
|
|
2
2
|
import { ReactNode } from "react";
|
|
3
3
|
|
|
4
|
-
//#region src/ScrollArea/type.d.ts
|
|
4
|
+
//#region src/base-ui/ScrollArea/type.d.ts
|
|
5
5
|
interface ScrollAreaProps extends Omit<ScrollAreaRootProps, 'children'> {
|
|
6
6
|
children?: ReactNode;
|
|
7
7
|
contentProps?: Omit<ScrollAreaContentProps, 'children'>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SelectProps } from "./type.mjs";
|
|
2
|
+
import * as react155 from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/base-ui/Select/Select.d.ts
|
|
5
|
+
declare const Select: react155.NamedExoticComponent<SelectProps<any>>;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { Select };
|
|
8
|
+
//# sourceMappingURL=Select.d.mts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { useAppElement } from "
|
|
4
|
-
import Icon_default from "
|
|
5
|
-
import { styles } from "
|
|
3
|
+
import { useAppElement } from "../../ThemeProvider/AppElementContext.mjs";
|
|
4
|
+
import Icon_default from "../../Icon/Icon.mjs";
|
|
5
|
+
import { styles } from "../../Menu/sharedStyle.mjs";
|
|
6
6
|
import { styles as styles$1, triggerVariants } from "./style.mjs";
|
|
7
7
|
import { isValidElement, memo, useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
8
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -11,7 +11,7 @@ import { Check, ChevronDown, Loader2, X } from "lucide-react";
|
|
|
11
11
|
import { Select } from "@base-ui/react/select";
|
|
12
12
|
import { Virtualizer } from "virtua";
|
|
13
13
|
|
|
14
|
-
//#region src/
|
|
14
|
+
//#region src/base-ui/Select/Select.tsx
|
|
15
15
|
const isGroupOption = (option) => Boolean(option.options);
|
|
16
16
|
const getOptionSearchText = (option) => {
|
|
17
17
|
if (typeof option.label === "string" || typeof option.label === "number") return String(option.label);
|
|
@@ -30,7 +30,7 @@ const countVirtualItems = (items) => items.reduce((count, item) => {
|
|
|
30
30
|
return count + 1;
|
|
31
31
|
}, 0);
|
|
32
32
|
const isValueEmpty = (value) => value === null || value === void 0 || value === "";
|
|
33
|
-
const
|
|
33
|
+
const Select$1 = memo(({ allowClear, autoFocus, className, classNames, defaultOpen, defaultValue, disabled, id, labelRender, listHeight = 512, listItemHeight, loading, mode, name, onChange, onOpenChange, onSelect, open, optionRender, options, placeholder, popupClassName, popupMatchSelectWidth, prefix, readOnly, required, behaviorVariant = "default", selectedIndicatorVariant = "check", shadow, showSearch, size = "middle", style, suffixIcon, suffixIconProps, tokenSeparators, value, variant, virtual }) => {
|
|
34
34
|
const { isDarkMode } = useThemeMode();
|
|
35
35
|
const resolvedVariant = variant ?? (isDarkMode ? "filled" : "outlined");
|
|
36
36
|
const isMultiple = mode === "multiple" || mode === "tags";
|
|
@@ -549,9 +549,9 @@ const LobeSelect = memo(({ allowClear, autoFocus, className, classNames, default
|
|
|
549
549
|
})]
|
|
550
550
|
});
|
|
551
551
|
});
|
|
552
|
-
|
|
553
|
-
var
|
|
552
|
+
Select$1.displayName = "Select";
|
|
553
|
+
var Select_default = Select$1;
|
|
554
554
|
|
|
555
555
|
//#endregion
|
|
556
|
-
export {
|
|
557
|
-
//# sourceMappingURL=
|
|
556
|
+
export { Select_default as default };
|
|
557
|
+
//# sourceMappingURL=Select.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Select.mjs","names":["Select","mergedOptions: SelectOptions","missingValueOptions: SelectOption<any>[]","styles","option","content","Icon","baseStyle: React.CSSProperties","indices: number[]","menuStyles","BaseSelect","currentIndex"],"sources":["../../../src/base-ui/Select/Select.tsx"],"sourcesContent":["'use client';\n\nimport { Select as BaseSelect } from '@base-ui/react/select';\nimport { cx, useThemeMode } from 'antd-style';\nimport { Check, ChevronDown, Loader2, X } from 'lucide-react';\nimport {\n type ChangeEvent,\n type HTMLAttributes,\n type KeyboardEvent,\n type MouseEvent,\n type MutableRefObject,\n type Ref,\n} from 'react';\nimport { isValidElement, memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { Virtualizer } from 'virtua';\n\nimport Icon from '@/Icon';\nimport { styles as menuStyles } from '@/Menu/sharedStyle';\nimport { useAppElement } from '@/ThemeProvider';\n\nimport { styles, triggerVariants } from './style';\nimport {\n type SelectOption,\n type SelectOptionGroup,\n type SelectOptions,\n type SelectProps,\n} from './type';\n\nconst isGroupOption = <Value,>(\n option: SelectOption<Value> | SelectOptionGroup<Value>,\n): option is SelectOptionGroup<Value> => Boolean((option as SelectOptionGroup<Value>).options);\n\nconst getOptionSearchText = <Value,>(option: SelectOption<Value>) => {\n if (typeof option.label === 'string' || typeof option.label === 'number') {\n return String(option.label);\n }\n if (typeof option.value === 'string' || typeof option.value === 'number') {\n return String(option.value);\n }\n if (option.title) return option.title;\n return '';\n};\n\nconst escapeRegExp = (value: string) => value.replaceAll(/[$()*+.?[\\\\\\]^{|}]/g, '\\\\$&');\n\nconst splitBySeparators = (value: string, separators?: string[]) => {\n if (!separators || separators.length === 0) return [value];\n const pattern = separators.map(escapeRegExp).join('|');\n return value.split(new RegExp(pattern, 'g'));\n};\n\nconst countVirtualItems = (items: SelectOptions) =>\n items.reduce((count, item) => {\n if (isGroupOption(item)) {\n return count + item.options.length + 1;\n }\n return count + 1;\n }, 0);\n\nconst isValueEmpty = (value: unknown) => value === null || value === undefined || value === '';\n\nconst Select = memo<SelectProps<any>>(\n ({\n allowClear,\n autoFocus,\n className,\n classNames,\n defaultOpen,\n defaultValue,\n disabled,\n id,\n labelRender,\n listHeight = 512,\n listItemHeight,\n loading,\n mode,\n name,\n onChange,\n onOpenChange,\n onSelect,\n open,\n optionRender,\n options,\n placeholder,\n popupClassName,\n popupMatchSelectWidth,\n prefix,\n readOnly,\n required,\n behaviorVariant = 'default',\n selectedIndicatorVariant = 'check',\n shadow,\n showSearch,\n size = 'middle',\n style,\n suffixIcon,\n suffixIconProps,\n tokenSeparators,\n value,\n variant,\n virtual,\n }) => {\n const { isDarkMode } = useThemeMode();\n const resolvedVariant = variant ?? (isDarkMode ? 'filled' : 'outlined');\n const isMultiple = mode === 'multiple' || mode === 'tags';\n const isItemAligned = behaviorVariant === 'item-aligned';\n\n const [uncontrolledValue, setUncontrolledValue] = useState<any>(() => {\n if (defaultValue !== undefined) return defaultValue;\n return isMultiple ? [] : null;\n });\n\n const normalizeValue = useCallback(\n (nextValue: any) => {\n if (isMultiple) {\n if (Array.isArray(nextValue)) return nextValue;\n if (nextValue === null || nextValue === undefined) return [];\n return [nextValue];\n }\n if (Array.isArray(nextValue)) return nextValue[0] ?? null;\n return nextValue === undefined ? null : nextValue;\n },\n [isMultiple],\n );\n\n const mergedValue = value !== undefined ? value : uncontrolledValue;\n const normalizedValue = useMemo(\n () => normalizeValue(mergedValue),\n [mergedValue, normalizeValue],\n );\n const valueArray = useMemo(\n () =>\n isMultiple\n ? (normalizedValue as any[])\n : isValueEmpty(normalizedValue)\n ? []\n : [normalizedValue],\n [isMultiple, normalizedValue],\n );\n\n const [extraOptions, setExtraOptions] = useState<SelectOption<any>[]>([]);\n\n useEffect(() => {\n if (mode !== 'tags' && extraOptions.length > 0) {\n setExtraOptions([]);\n }\n }, [mode, extraOptions.length]);\n\n const { resolvedOptions, optionMap } = useMemo(() => {\n const baseOptions = options ?? [];\n const optionValueMap = new Map<any, SelectOption<any>>();\n\n const addOption = (item: SelectOption<any>) => {\n if (!optionValueMap.has(item.value)) {\n optionValueMap.set(item.value, item);\n }\n };\n\n const walkOptions = (items: SelectOptions) => {\n items.forEach((item) => {\n if (isGroupOption(item)) {\n item.options.forEach(addOption);\n } else {\n addOption(item);\n }\n });\n };\n\n walkOptions(baseOptions);\n\n const filteredExtraOptions = extraOptions.filter((item) => !optionValueMap.has(item.value));\n filteredExtraOptions.forEach(addOption);\n\n const mergedOptions: SelectOptions = [...baseOptions, ...filteredExtraOptions];\n\n const missingValueOptions: SelectOption<any>[] = valueArray\n .filter((val) => !optionValueMap.has(val))\n .map((val) => ({\n label: String(val),\n value: val,\n }));\n missingValueOptions.forEach(addOption);\n\n return {\n optionMap: optionValueMap,\n resolvedOptions: missingValueOptions.length\n ? [...mergedOptions, ...missingValueOptions]\n : mergedOptions,\n };\n }, [extraOptions, options, valueArray]);\n\n const [uncontrolledOpen, setUncontrolledOpen] = useState(Boolean(defaultOpen));\n\n useEffect(() => {\n if (open !== undefined) {\n setUncontrolledOpen(open);\n }\n }, [open]);\n\n const mergedOpen = open ?? uncontrolledOpen;\n\n const handleOpenChange = useCallback(\n (nextOpen: boolean) => {\n onOpenChange?.(nextOpen);\n if (open === undefined) {\n setUncontrolledOpen(nextOpen);\n }\n },\n [onOpenChange, open],\n );\n\n const [searchValue, setSearchValue] = useState('');\n const shouldShowSearch = Boolean(showSearch || mode === 'tags');\n\n useEffect(() => {\n if (!mergedOpen) setSearchValue('');\n }, [mergedOpen]);\n\n const getOption = useCallback(\n (optionValue: any): SelectOption<any> => {\n const matched = optionMap.get(optionValue);\n if (matched) return matched;\n if (optionValue && typeof optionValue === 'object' && 'label' in optionValue) {\n return {\n label: (optionValue as any).label,\n value: optionValue,\n };\n }\n return {\n label: String(optionValue),\n value: optionValue,\n };\n },\n [optionMap],\n );\n\n const previousValueRef = useRef<any>(normalizedValue);\n\n useEffect(() => {\n previousValueRef.current = normalizedValue;\n }, [normalizedValue]);\n\n const handleValueChange = useCallback(\n (nextValue: any) => {\n const normalizedNextValue = normalizeValue(nextValue);\n const previousValue = previousValueRef.current;\n\n if (isMultiple) {\n const prevValues = Array.isArray(previousValue) ? previousValue : [];\n const nextValues = Array.isArray(normalizedNextValue) ? normalizedNextValue : [];\n const addedValues = nextValues.filter(\n (val) => !prevValues.some((prev) => Object.is(prev, val)),\n );\n\n addedValues.forEach((val) => {\n onSelect?.(val, getOption(val));\n });\n\n if (value === undefined) {\n setUncontrolledValue(nextValues);\n }\n onChange?.(\n nextValues,\n nextValues.map((val) => getOption(val)),\n );\n } else {\n if (\n !isValueEmpty(normalizedNextValue) &&\n !Object.is(previousValue, normalizedNextValue)\n ) {\n onSelect?.(normalizedNextValue, getOption(normalizedNextValue));\n }\n if (value === undefined) {\n setUncontrolledValue(normalizedNextValue);\n }\n onChange?.(\n normalizedNextValue,\n isValueEmpty(normalizedNextValue) ? undefined : getOption(normalizedNextValue),\n );\n }\n\n previousValueRef.current = normalizedNextValue;\n },\n [getOption, isMultiple, normalizeValue, onChange, onSelect, value],\n );\n\n const appendTagValues = useCallback(\n (rawValues: string[]) => {\n const valuesToAdd = rawValues.map((val) => val.trim()).filter(Boolean);\n if (!valuesToAdd.length) return;\n\n const nextValues = [...valueArray];\n const newOptionValues = valuesToAdd.filter((val) => !optionMap.has(val));\n\n if (newOptionValues.length > 0) {\n setExtraOptions((prev) => {\n const existingValues = new Set(prev.map((item) => item.value));\n const merged = [...prev];\n newOptionValues.forEach((val) => {\n if (!existingValues.has(val)) {\n merged.push({ label: val, value: val });\n }\n });\n return merged;\n });\n }\n\n valuesToAdd.forEach((val) => {\n if (!nextValues.some((item) => Object.is(item, val))) {\n nextValues.push(val);\n }\n });\n\n if (nextValues.length !== valueArray.length) {\n handleValueChange(nextValues);\n }\n },\n [handleValueChange, optionMap, valueArray],\n );\n\n const handleSearchChange = useCallback(\n (event: ChangeEvent<HTMLInputElement>) => {\n const nextValue = event.target.value;\n if (mode === 'tags') {\n const parts = splitBySeparators(nextValue, tokenSeparators);\n if (parts.length > 1) {\n const pending = parts.pop() ?? '';\n appendTagValues(parts.filter(Boolean));\n setSearchValue(pending);\n return;\n }\n }\n setSearchValue(nextValue);\n },\n [appendTagValues, mode, tokenSeparators],\n );\n\n const handleSearchKeyDown = useCallback(\n (event: KeyboardEvent<HTMLInputElement>) => {\n event.stopPropagation();\n\n if (event.key === 'Escape') {\n handleOpenChange(false);\n return;\n }\n\n if (mode !== 'tags') return;\n\n if (event.key === 'Enter') {\n event.preventDefault();\n event.stopPropagation();\n appendTagValues([searchValue]);\n setSearchValue('');\n return;\n }\n\n if (tokenSeparators?.includes(event.key)) {\n event.preventDefault();\n event.stopPropagation();\n appendTagValues([searchValue]);\n setSearchValue('');\n }\n },\n [appendTagValues, handleOpenChange, mode, searchValue, tokenSeparators],\n );\n\n const filteredOptions = useMemo(() => {\n if (!shouldShowSearch || !searchValue.trim()) return resolvedOptions;\n const query = searchValue.trim().toLowerCase();\n\n const filterItems = (items: SelectOptions): SelectOptions => {\n const filtered = items\n .map((item) => {\n if (isGroupOption(item)) {\n const groupItems = item.options.filter((option) =>\n getOptionSearchText(option).toLowerCase().includes(query),\n );\n if (!groupItems.length) return null;\n return { ...item, options: groupItems };\n }\n return getOptionSearchText(item).toLowerCase().includes(query) ? item : null;\n })\n .filter(Boolean) as SelectOptions;\n\n return filtered;\n };\n\n return filterItems(resolvedOptions);\n }, [resolvedOptions, searchValue, shouldShowSearch]);\n\n const renderValue = useCallback(\n (currentValue: any) => {\n const resolved = normalizeValue(currentValue);\n const placeholderNode =\n placeholder === undefined ? null : (\n <span className={styles.valueText}>{placeholder}</span>\n );\n\n if (isMultiple) {\n const values = Array.isArray(resolved) ? resolved : [];\n if (values.length === 0) return placeholderNode;\n return (\n <span className={styles.tags}>\n {values.map((val, index) => {\n const option = getOption(val);\n const content = labelRender ? labelRender(option) : (option.label ?? String(val));\n return (\n <span className={styles.tag} key={`${String(val)}-${index}`}>\n {content}\n </span>\n );\n })}\n </span>\n );\n }\n\n if (isValueEmpty(resolved)) return placeholderNode;\n const option = getOption(resolved);\n const content = labelRender ? labelRender(option) : (option.label ?? String(resolved));\n return <span className={styles.valueText}>{content}</span>;\n },\n [getOption, isMultiple, labelRender, normalizeValue, placeholder],\n );\n\n const hasValue = isMultiple ? valueArray.length > 0 : !isValueEmpty(normalizedValue);\n const showClear = Boolean(allowClear && hasValue && !disabled && !readOnly);\n\n const handleClear = useCallback(\n (event: MouseEvent) => {\n event.preventDefault();\n event.stopPropagation();\n handleValueChange(isMultiple ? [] : null);\n },\n [handleValueChange, isMultiple],\n );\n\n const prefixNode = useMemo(() => {\n if (prefix === undefined || prefix === null) return null;\n if (isValidElement(prefix) || typeof prefix === 'string' || typeof prefix === 'number') {\n return prefix;\n }\n return <Icon icon={prefix as any} size={'small'} />;\n }, [prefix]);\n\n const suffixIconNode = useMemo(() => {\n if (loading) {\n return <Icon spin icon={Loader2} size={'small'} />;\n }\n if (suffixIcon === null) return null;\n if (\n isValidElement(suffixIcon) ||\n typeof suffixIcon === 'string' ||\n typeof suffixIcon === 'number'\n ) {\n return suffixIcon;\n }\n return (\n <Icon\n icon={(suffixIcon as any) || ChevronDown}\n size={'small'}\n {...suffixIconProps}\n style={{\n pointerEvents: 'none',\n ...suffixIconProps?.style,\n }}\n />\n );\n }, [loading, suffixIcon, suffixIconProps]);\n\n const popupStyle = useMemo(() => {\n const maxHeight = isItemAligned ? '80vh' : `${listHeight}px`;\n const baseStyle: React.CSSProperties = {\n maxHeight,\n maxWidth: 'var(--available-width)',\n minWidth: 'var(--anchor-width)',\n ['--lobe-select-popup-max-height' as any]: maxHeight,\n };\n\n if (popupMatchSelectWidth === undefined || popupMatchSelectWidth === true) {\n return baseStyle;\n }\n if (typeof popupMatchSelectWidth === 'number') {\n return {\n ...baseStyle,\n minWidth: popupMatchSelectWidth,\n width: popupMatchSelectWidth,\n };\n }\n return {\n ...baseStyle,\n minWidth: 'max-content',\n };\n }, [isItemAligned, listHeight, popupMatchSelectWidth]);\n\n const triggerClassName = cx(\n triggerVariants({ shadow, size, variant: resolvedVariant }),\n className,\n classNames?.root,\n classNames?.trigger,\n );\n\n const listRef = useRef<HTMLDivElement | null>(null);\n const pointerScrollRef = useRef(false);\n const pointerScrollTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n const renderVirtualItem = useCallback((props: HTMLAttributes<HTMLDivElement>) => {\n const { ref, ...rest } = props as HTMLAttributes<HTMLDivElement> & {\n ref?: Ref<HTMLDivElement>;\n };\n\n return (\n <div\n {...rest}\n ref={(node) => {\n if (node) {\n node.scrollIntoView = (...args) => {\n if (!pointerScrollRef.current) {\n HTMLElement.prototype.scrollIntoView.call(node, ...args);\n }\n };\n }\n\n if (typeof ref === 'function') {\n ref(node);\n } else if (ref && 'current' in ref) {\n (ref as MutableRefObject<HTMLDivElement | null>).current = node;\n }\n }}\n />\n );\n }, []);\n\n const markPointerScroll = useCallback(() => {\n pointerScrollRef.current = true;\n if (pointerScrollTimeoutRef.current) {\n clearTimeout(pointerScrollTimeoutRef.current);\n }\n pointerScrollTimeoutRef.current = setTimeout(() => {\n pointerScrollRef.current = false;\n }, 120);\n }, []);\n\n const handleListScroll = useCallback(() => {\n if (!virtual || !pointerScrollRef.current) return;\n const listElement = listRef.current;\n const activeElement = document.activeElement;\n if (listElement && activeElement && listElement.contains(activeElement)) {\n listElement.focus({ preventScroll: true });\n }\n }, [virtual]);\n\n useEffect(() => {\n return () => {\n if (pointerScrollTimeoutRef.current) {\n clearTimeout(pointerScrollTimeoutRef.current);\n }\n };\n }, []);\n const virtualListStyle = useMemo(() => {\n if (!virtual) return undefined;\n const rowCount = countVirtualItems(filteredOptions);\n const maxVisibleRows = 6;\n const estimatedRowHeight =\n listItemHeight ?? (size === 'large' ? 40 : size === 'small' ? 28 : 32);\n const visibleRows = Math.min(Math.max(rowCount, 1), maxVisibleRows);\n const estimatedHeight = visibleRows * estimatedRowHeight + 8;\n\n return {\n height: `min(${estimatedHeight}px, var(--lobe-select-available-height, var(--available-height)))`,\n };\n }, [filteredOptions, listItemHeight, size, virtual]);\n\n const keepMountedIndices = useMemo(() => {\n if (!virtual || valueArray.length === 0) return undefined;\n const selectedSet = new Set(valueArray);\n const indices: number[] = [];\n let index = 0;\n\n filteredOptions.forEach((item) => {\n if (isGroupOption(item)) {\n if (item.options.some((option) => selectedSet.has(option.value))) {\n indices.push(index);\n }\n index += 1;\n return;\n }\n\n if (selectedSet.has(item.value)) {\n indices.push(index);\n }\n index += 1;\n });\n\n return indices.length ? indices : undefined;\n }, [filteredOptions, valueArray, virtual]);\n\n const itemTextClassName = cx(\n optionRender ? menuStyles.itemContent : menuStyles.label,\n styles.itemText,\n classNames?.itemText,\n );\n\n const isBoldIndicator = selectedIndicatorVariant === 'bold';\n let optionIndex = 0;\n const renderOptions = (items: SelectOptions) =>\n items.map((item, index) => {\n if (isGroupOption(item)) {\n return (\n <BaseSelect.Group\n className={cx(styles.group, classNames?.group)}\n key={`group-${index}`}\n >\n <BaseSelect.GroupLabel\n className={cx(menuStyles.groupLabel, styles.groupLabel, classNames?.groupLabel)}\n >\n {item.label}\n </BaseSelect.GroupLabel>\n {item.options.map((option) => {\n const currentIndex = optionIndex++;\n return (\n <BaseSelect.Item\n disabled={option.disabled}\n key={`${String(option.value)}-${currentIndex}`}\n label={getOptionSearchText(option)}\n render={virtual ? renderVirtualItem : undefined}\n value={option.value}\n className={cx(\n menuStyles.item,\n styles.item,\n isBoldIndicator && styles.itemBoldSelected,\n classNames?.item,\n classNames?.option,\n option.className,\n )}\n style={{\n minHeight: listItemHeight,\n ...option.style,\n }}\n >\n <BaseSelect.ItemText className={itemTextClassName}>\n {optionRender ? optionRender(option, { index: currentIndex }) : option.label}\n </BaseSelect.ItemText>\n {!isBoldIndicator && (\n <BaseSelect.ItemIndicator\n className={cx(styles.itemIndicator, classNames?.itemIndicator)}\n >\n <Icon icon={Check} size={'small'} />\n </BaseSelect.ItemIndicator>\n )}\n </BaseSelect.Item>\n );\n })}\n </BaseSelect.Group>\n );\n }\n\n const currentIndex = optionIndex++;\n return (\n <BaseSelect.Item\n disabled={item.disabled}\n key={`${String(item.value)}-${currentIndex}`}\n label={getOptionSearchText(item)}\n render={virtual ? renderVirtualItem : undefined}\n value={item.value}\n className={cx(\n menuStyles.item,\n styles.item,\n isBoldIndicator && styles.itemBoldSelected,\n classNames?.item,\n classNames?.option,\n item.className,\n )}\n style={{\n minHeight: listItemHeight,\n ...item.style,\n }}\n >\n <BaseSelect.ItemText className={itemTextClassName}>\n {optionRender ? optionRender(item, { index: currentIndex }) : item.label}\n </BaseSelect.ItemText>\n {!isBoldIndicator && (\n <BaseSelect.ItemIndicator\n className={cx(styles.itemIndicator, classNames?.itemIndicator)}\n >\n <Icon icon={Check} size={'small'} />\n </BaseSelect.ItemIndicator>\n )}\n </BaseSelect.Item>\n );\n });\n\n const appElement = useAppElement();\n return (\n <BaseSelect.Root\n disabled={disabled}\n id={id}\n modal={isItemAligned}\n multiple={isMultiple}\n name={name}\n open={mergedOpen}\n readOnly={readOnly}\n required={required}\n value={normalizedValue}\n onOpenChange={handleOpenChange}\n onValueChange={handleValueChange}\n >\n <BaseSelect.Trigger\n autoFocus={autoFocus}\n className={triggerClassName}\n disabled={disabled}\n style={style}\n >\n {prefixNode !== null && prefixNode !== undefined && (\n <span className={cx(styles.prefix, classNames?.prefix)}>{prefixNode}</span>\n )}\n <BaseSelect.Value className={cx(styles.value, classNames?.value)}>\n {renderValue}\n </BaseSelect.Value>\n <span className={cx(styles.suffix, classNames?.suffix)}>\n {showClear && (\n <span\n className={cx(styles.clear, classNames?.clear)}\n data-role=\"lobe-select-clear\"\n onClick={handleClear}\n >\n <Icon icon={X} size={'small'} />\n </span>\n )}\n {suffixIconNode !== null && suffixIconNode !== undefined && (\n <BaseSelect.Icon className={cx(styles.icon, classNames?.icon)}>\n {suffixIconNode}\n </BaseSelect.Icon>\n )}\n </span>\n </BaseSelect.Trigger>\n\n <BaseSelect.Portal container={appElement}>\n <BaseSelect.Positioner\n align=\"start\"\n alignItemWithTrigger={isItemAligned}\n className={styles.positioner}\n side=\"bottom\"\n sideOffset={6}\n >\n <BaseSelect.Popup\n style={popupStyle}\n className={cx(\n menuStyles.popup,\n styles.popup,\n popupClassName,\n classNames?.popup,\n classNames?.dropdown,\n )}\n >\n {shouldShowSearch && (\n <div className={cx(styles.search, classNames?.search)}>\n <input\n className={styles.searchInput}\n placeholder={typeof placeholder === 'string' ? placeholder : undefined}\n value={searchValue}\n onChange={handleSearchChange}\n onKeyDown={handleSearchKeyDown}\n />\n </div>\n )}\n {(() => {\n const content =\n filteredOptions.length > 0 ? (\n renderOptions(filteredOptions)\n ) : (\n <div\n className={cx(\n menuStyles.item,\n menuStyles.empty,\n styles.empty,\n classNames?.empty,\n )}\n >\n No data\n </div>\n );\n\n if (!virtual || filteredOptions.length === 0) {\n return (\n <BaseSelect.List\n className={cx(styles.list, classNames?.list)}\n data-virtual={virtual || undefined}\n >\n {content}\n </BaseSelect.List>\n );\n }\n\n return (\n <BaseSelect.List\n className={cx(styles.list, classNames?.list)}\n data-virtual={virtual || undefined}\n ref={listRef}\n style={virtualListStyle}\n tabIndex={virtual ? -1 : undefined}\n onPointerDown={virtual ? markPointerScroll : undefined}\n onScroll={virtual ? handleListScroll : undefined}\n onTouchMove={virtual ? markPointerScroll : undefined}\n onWheel={virtual ? markPointerScroll : undefined}\n >\n <Virtualizer itemSize={listItemHeight} keepMounted={keepMountedIndices}>\n {content}\n </Virtualizer>\n </BaseSelect.List>\n );\n })()}\n </BaseSelect.Popup>\n </BaseSelect.Positioner>\n </BaseSelect.Portal>\n </BaseSelect.Root>\n );\n },\n);\n\nSelect.displayName = 'Select';\n\nexport default Select;\n"],"mappings":";;;;;;;;;;;;;;AA4BA,MAAM,iBACJ,WACuC,QAAS,OAAoC,QAAQ;AAE9F,MAAM,uBAA+B,WAAgC;AACnE,KAAI,OAAO,OAAO,UAAU,YAAY,OAAO,OAAO,UAAU,SAC9D,QAAO,OAAO,OAAO,MAAM;AAE7B,KAAI,OAAO,OAAO,UAAU,YAAY,OAAO,OAAO,UAAU,SAC9D,QAAO,OAAO,OAAO,MAAM;AAE7B,KAAI,OAAO,MAAO,QAAO,OAAO;AAChC,QAAO;;AAGT,MAAM,gBAAgB,UAAkB,MAAM,WAAW,uBAAuB,OAAO;AAEvF,MAAM,qBAAqB,OAAe,eAA0B;AAClE,KAAI,CAAC,cAAc,WAAW,WAAW,EAAG,QAAO,CAAC,MAAM;CAC1D,MAAM,UAAU,WAAW,IAAI,aAAa,CAAC,KAAK,IAAI;AACtD,QAAO,MAAM,MAAM,IAAI,OAAO,SAAS,IAAI,CAAC;;AAG9C,MAAM,qBAAqB,UACzB,MAAM,QAAQ,OAAO,SAAS;AAC5B,K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