@lobehub/ui 4.36.2 → 4.36.3

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.
Files changed (137) hide show
  1. package/es/Accordion/Accordion.d.mts +2 -2
  2. package/es/Accordion/AccordionItem.d.mts +2 -2
  3. package/es/ActionIcon/ActionIcon.d.mts +2 -2
  4. package/es/Alert/Alert.d.mts +2 -2
  5. package/es/AutoComplete/Select.d.mts +2 -2
  6. package/es/Avatar/AvatarGroup/index.d.mts +2 -2
  7. package/es/Burger/Burger.d.mts +2 -2
  8. package/es/CodeDiff/CodeDiff.d.mts +2 -2
  9. package/es/CodeDiff/PatchDiff.d.mts +2 -2
  10. package/es/CodeEditor/CodeEditor.d.mts +2 -2
  11. package/es/Collapse/Collapse.d.mts +2 -2
  12. package/es/ConfigProvider/index.d.mts +2 -2
  13. package/es/ContextMenu/ContextMenuHost.d.mts +2 -2
  14. package/es/ContextMenu/ContextMenuHost.mjs +1 -1
  15. package/es/ContextMenu/ContextMenuHost.mjs.map +1 -1
  16. package/es/CopyButton/CopyButton.d.mts +2 -2
  17. package/es/DatePicker/DatePicker.d.mts +2 -2
  18. package/es/DraggablePanel/components/DraggablePanelBody.d.mts +2 -2
  19. package/es/DraggablePanel/components/DraggablePanelContainer.d.mts +2 -2
  20. package/es/DraggablePanel/components/DraggablePanelFooter.d.mts +2 -2
  21. package/es/DraggablePanel/components/DraggablePanelHeader.d.mts +2 -2
  22. package/es/DraggableSideNav/DraggableSideNav.d.mts +2 -2
  23. package/es/Drawer/Drawer.d.mts +2 -2
  24. package/es/Dropdown/Dropdown.d.mts +2 -2
  25. package/es/DropdownMenu/DropdownMenu.d.mts +2 -2
  26. package/es/DropdownMenu/atoms.d.mts +18 -18
  27. package/es/EditableText/EditableText.d.mts +2 -2
  28. package/es/EditorSlashMenu/atoms.d.mts +13 -13
  29. package/es/EmojiPicker/EmojiPicker.d.mts +2 -2
  30. package/es/Flex/FlexBasic.d.mts +2 -2
  31. package/es/FontLoader/index.d.mts +2 -2
  32. package/es/Footer/Footer.d.mts +2 -2
  33. package/es/Form/components/FormGroup.d.mts +2 -2
  34. package/es/Form/components/FormItem.d.mts +2 -2
  35. package/es/Form/components/FormSubmitFooter.d.mts +2 -2
  36. package/es/FormModal/FormModal.d.mts +2 -2
  37. package/es/Freeze/Freeze.d.mts +2 -2
  38. package/es/GuideCard/GuideCard.d.mts +2 -2
  39. package/es/Header/Header.d.mts +2 -2
  40. package/es/Highlighter/Highlighter.d.mts +2 -2
  41. package/es/Highlighter/SyntaxHighlighter/index.d.mts +2 -2
  42. package/es/Hotkey/Hotkey.d.mts +2 -2
  43. package/es/HotkeyInput/HotkeyInput.d.mts +2 -2
  44. package/es/Icon/Icon.d.mts +2 -2
  45. package/es/Icon/components/IconProvider.d.mts +3 -3
  46. package/es/Image/PreviewGroup.d.mts +2 -2
  47. package/es/ImageSelect/ImageSelect.d.mts +2 -2
  48. package/es/Input/Input.d.mts +2 -2
  49. package/es/Input/InputNumber.d.mts +2 -2
  50. package/es/Input/InputOPT.d.mts +2 -2
  51. package/es/Input/InputPassword.d.mts +2 -2
  52. package/es/Input/TextArea.d.mts +2 -2
  53. package/es/Layout/components/LayoutFooter.d.mts +2 -2
  54. package/es/Layout/components/LayoutHeader.d.mts +2 -2
  55. package/es/Layout/components/LayoutMain.d.mts +2 -2
  56. package/es/Layout/components/LayoutSidebar.d.mts +2 -2
  57. package/es/Layout/components/LayoutSidebarInner.d.mts +2 -2
  58. package/es/Layout/components/LayoutToc.d.mts +2 -2
  59. package/es/List/ListItem/index.d.mts +2 -2
  60. package/es/LobeSelect/LobeSelect.d.mts +2 -2
  61. package/es/LobeSelect/LobeSelect.mjs +50 -45
  62. package/es/LobeSelect/LobeSelect.mjs.map +1 -1
  63. package/es/LobeSelect/atoms.d.mts +19 -19
  64. package/es/LobeSwitch/LobeSwitch.d.mts +2 -2
  65. package/es/LobeSwitch/atoms.d.mts +4 -4
  66. package/es/Markdown/Markdown.d.mts +2 -2
  67. package/es/Markdown/Typography.d.mts +2 -2
  68. package/es/Markdown/components/SearchResultCards/index.d.mts +2 -2
  69. package/es/MaskShadow/MaskShadow.d.mts +2 -2
  70. package/es/Menu/Menu.d.mts +2 -2
  71. package/es/Mermaid/Mermaid.d.mts +2 -2
  72. package/es/Mermaid/SyntaxMermaid/index.d.mts +2 -2
  73. package/es/Modal/Modal.d.mts +2 -2
  74. package/es/Modal/ModalProvider.d.mts +2 -2
  75. package/es/Modal/imperative.d.mts +2 -2
  76. package/es/MotionProvider/index.d.mts +2 -2
  77. package/es/Popover/ArrowIcon.d.mts +2 -2
  78. package/es/Popover/atoms.d.mts +9 -9
  79. package/es/Popover/context.d.mts +2 -2
  80. package/es/ScrollArea/atoms.d.mts +7 -7
  81. package/es/SearchBar/SearchBar.d.mts +2 -2
  82. package/es/Segmented/Segmented.d.mts +2 -2
  83. package/es/Select/Select.d.mts +2 -2
  84. package/es/SideNav/SideNav.d.mts +2 -2
  85. package/es/SliderWithInput/SliderWithInput.d.mts +2 -2
  86. package/es/SortableList/components/DragHandle.d.mts +2 -2
  87. package/es/SortableList/components/SortableItem.d.mts +2 -2
  88. package/es/ThemeProvider/ThemeProvider.d.mts +2 -2
  89. package/es/Toast/imperative.d.mts +3 -3
  90. package/es/Toast/imperative.mjs +10 -8
  91. package/es/Toast/imperative.mjs.map +1 -1
  92. package/es/Toc/Toc.d.mts +2 -2
  93. package/es/Video/index.d.mts +2 -2
  94. package/es/awesome/GradientButton/GradientButton.d.mts +2 -2
  95. package/es/awesome/GridBackground/GridBackground.d.mts +2 -2
  96. package/es/awesome/GridBackground/GridShowcase.d.mts +2 -2
  97. package/es/awesome/Hero/Hero.d.mts +2 -2
  98. package/es/awesome/Spline/Spine.d.mts +2 -2
  99. package/es/awesome/Spotlight/Spotlight.d.mts +2 -2
  100. package/es/awesome/SpotlightCard/SpotlightCard.d.mts +2 -2
  101. package/es/awesome/TypewriterEffect/TypewriterEffect.d.mts +2 -2
  102. package/es/brand/LobeChat/index.d.mts +2 -2
  103. package/es/brand/LobeHub/index.d.mts +2 -2
  104. package/es/brand/LogoThree/LogoSpline.d.mts +2 -2
  105. package/es/brand/LogoThree/index.d.mts +2 -2
  106. package/es/chat/BackBottom/BackBottom.d.mts +2 -2
  107. package/es/chat/ChatInputArea/components/ChatInputAreaInner.d.mts +2 -2
  108. package/es/chat/ChatItem/ChatItem.d.mts +2 -2
  109. package/es/chat/ChatList/ChatList.d.mts +2 -2
  110. package/es/chat/EditableMessage/EditableMessage.d.mts +2 -2
  111. package/es/chat/EditableMessageList/EditableMessageList.d.mts +2 -2
  112. package/es/chat/MessageInput/MessageInput.d.mts +2 -2
  113. package/es/chat/MessageModal/MessageModal.d.mts +2 -2
  114. package/es/color/ColorScales/index.d.mts +2 -2
  115. package/es/color/CssVar/index.d.mts +2 -2
  116. package/es/i18n/context.d.mts +2 -2
  117. package/es/icons/lucideExtra/BotPromptIcon.d.mts +2 -2
  118. package/es/icons/lucideExtra/CreateBotIcon.d.mts +3 -3
  119. package/es/icons/lucideExtra/DiscordIcon.d.mts +3 -3
  120. package/es/icons/lucideExtra/GlobeOffIcon.d.mts +2 -2
  121. package/es/icons/lucideExtra/GroupBotIcon.d.mts +3 -3
  122. package/es/icons/lucideExtra/GroupBotSquareIcon.d.mts +3 -3
  123. package/es/icons/lucideExtra/LeftClickIcon.d.mts +2 -2
  124. package/es/icons/lucideExtra/LeftDoubleClickIcon.d.mts +3 -3
  125. package/es/icons/lucideExtra/McpIcon.d.mts +3 -3
  126. package/es/icons/lucideExtra/ProviderIcon.d.mts +3 -3
  127. package/es/icons/lucideExtra/RightClickIcon.d.mts +3 -3
  128. package/es/icons/lucideExtra/RightDoubleClickIcon.d.mts +3 -3
  129. package/es/icons/lucideExtra/ShapesUploadIcon.d.mts +2 -2
  130. package/es/icons/lucideExtra/TreeDownRightIcon.d.mts +2 -2
  131. package/es/icons/lucideExtra/TreeUpDownRightIcon.d.mts +2 -2
  132. package/es/mdx/Mdx/index.d.mts +2 -2
  133. package/es/mobile/ChatHeader/ChatHeaderTitle.d.mts +2 -2
  134. package/es/mobile/ChatInputArea/components/ChatSendButton.d.mts +2 -2
  135. package/es/mobile/TabBar/TabBar.d.mts +2 -2
  136. package/es/storybook/StoryBook/index.d.mts +2 -2
  137. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"LobeSelect.mjs","names":["mergedOptions: LobeSelectOptions","missingValueOptions: LobeSelectOption<any>[]","styles","option","content","Icon","baseStyle: React.CSSProperties","indices: number[]","menuStyles","currentIndex"],"sources":["../../src/LobeSelect/LobeSelect.tsx"],"sourcesContent":["'use client';\n\nimport { Select } 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';\n\nimport { styles, triggerVariants } from './style';\nimport {\n type LobeSelectOption,\n type LobeSelectOptionGroup,\n type LobeSelectOptions,\n type LobeSelectProps,\n} from './type';\n\nconst isGroupOption = <Value,>(\n option: LobeSelectOption<Value> | LobeSelectOptionGroup<Value>,\n): option is LobeSelectOptionGroup<Value> =>\n Boolean((option as LobeSelectOptionGroup<Value>).options);\n\nconst getOptionSearchText = <Value,>(option: LobeSelectOption<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: LobeSelectOptions) =>\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 LobeSelect = memo<LobeSelectProps<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<LobeSelectOption<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, LobeSelectOption<any>>();\n\n const addOption = (item: LobeSelectOption<any>) => {\n if (!optionValueMap.has(item.value)) {\n optionValueMap.set(item.value, item);\n }\n };\n\n const walkOptions = (items: LobeSelectOptions) => {\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: LobeSelectOptions = [...baseOptions, ...filteredExtraOptions];\n\n const missingValueOptions: LobeSelectOption<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): LobeSelectOption<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: LobeSelectOptions): LobeSelectOptions => {\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 LobeSelectOptions;\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: LobeSelectOptions) =>\n items.map((item, index) => {\n if (isGroupOption(item)) {\n return (\n <Select.Group className={cx(styles.group, classNames?.group)} key={`group-${index}`}>\n <Select.GroupLabel\n className={cx(menuStyles.groupLabel, styles.groupLabel, classNames?.groupLabel)}\n >\n {item.label}\n </Select.GroupLabel>\n {item.options.map((option) => {\n const currentIndex = optionIndex++;\n return (\n <Select.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 <Select.ItemText className={itemTextClassName}>\n {optionRender ? optionRender(option, { index: currentIndex }) : option.label}\n </Select.ItemText>\n {!isBoldIndicator && (\n <Select.ItemIndicator\n className={cx(styles.itemIndicator, classNames?.itemIndicator)}\n >\n <Icon icon={Check} size={'small'} />\n </Select.ItemIndicator>\n )}\n </Select.Item>\n );\n })}\n </Select.Group>\n );\n }\n\n const currentIndex = optionIndex++;\n return (\n <Select.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 <Select.ItemText className={itemTextClassName}>\n {optionRender ? optionRender(item, { index: currentIndex }) : item.label}\n </Select.ItemText>\n {!isBoldIndicator && (\n <Select.ItemIndicator className={cx(styles.itemIndicator, classNames?.itemIndicator)}>\n <Icon icon={Check} size={'small'} />\n </Select.ItemIndicator>\n )}\n </Select.Item>\n );\n });\n\n return (\n <Select.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 <Select.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 <Select.Value className={cx(styles.value, classNames?.value)}>{renderValue}</Select.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 <Select.Icon className={cx(styles.icon, classNames?.icon)}>\n {suffixIconNode}\n </Select.Icon>\n )}\n </span>\n </Select.Trigger>\n\n <Select.Portal>\n <Select.Positioner\n align=\"start\"\n alignItemWithTrigger={isItemAligned}\n className={styles.positioner}\n side=\"bottom\"\n sideOffset={6}\n >\n <Select.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 <Select.List\n className={cx(styles.list, classNames?.list)}\n data-virtual={virtual || undefined}\n >\n {content}\n </Select.List>\n );\n }\n\n return (\n <Select.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 </Select.List>\n );\n })()}\n </Select.Popup>\n </Select.Positioner>\n </Select.Portal>\n </Select.Root>\n );\n },\n);\n\nLobeSelect.displayName = 'LobeSelect';\n\nexport default LobeSelect;\n"],"mappings":";;;;;;;;;;;;;AA2BA,MAAM,iBACJ,WAEA,QAAS,OAAwC,QAAQ;AAE3D,MAAM,uBAA+B,WAAoC;AACvE,KAAI,OAAO,OAAO,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gBACtD;OACW;MAEX;;IACQ,EAEjB,oBAAC,OAAO,oBACN,oBAAC,OAAO;GACN,OAAM;GACN,sBAAsB;GACtB,WAAWA,SAAO;GAClB,MAAK;GACL,YAAY;aAEZ,qBAAC,OAAO;IACN,OAAO;IACP,WAAW,GACTM,OAAW,OACXN,SAAO,OACP,gBACA,YAAY,OACZ,YAAY,SACb;eAEA,oBACC,oBAAC;KAAI,WAAW,GAAGA,SAAO,QAAQ,YAAY,OAAO;eACnD,oBAAC;MACC,WAAWA,SAAO;MAClB,aAAa,OAAO,gBAAgB,WAAW,cAAc;MAC7D,OAAO;MACP,UAAU;MACV,WAAW;OACX;MACE,SAEA;KACN,MAAM,UACJ,gBAAgB,SAAS,IACvB,cAAc,gBAAgB,GAE9B,oBAAC;MACC,WAAW,GACTM,OAAW,MACXA,OAAW,OACXN,SAAO,OACP,YAAY,MACb;gBACF;OAEK;AAGV,SAAI,CAAC,WAAW,gBAAgB,WAAW,EACzC,QACE,oBAAC,OAAO;MACN,WAAW,GAAGA,SAAO,MAAM,YAAY,KAAK;MAC5C,gBAAc,WAAW;gBAExB;OACW;AAIlB,YACE,oBAAC,OAAO;MACN,WAAW,GAAGA,SAAO,MAAM,YAAY,KAAK;MAC5C,gBAAc,WAAW;MACzB,KAAK;MACL,OAAO;MACP,UAAU,UAAU,KAAK;MACzB,eAAe,UAAU,oBAAoB;MAC7C,UAAU,UAAU,mBAAmB;MACvC,aAAa,UAAU,oBAAoB;MAC3C,SAAS,UAAU,oBAAoB;gBAEvC,oBAAC;OAAY,UAAU;OAAgB,aAAa;iBACjD;QACW;OACF;QAEd;KACS;IACG,GACN;GACJ;EAGnB;AAED,WAAW,cAAc;AAEzB,yBAAe"}
1
+ {"version":3,"file":"LobeSelect.mjs","names":["mergedOptions: LobeSelectOptions","missingValueOptions: LobeSelectOption<any>[]","styles","option","content","Icon","baseStyle: React.CSSProperties","indices: number[]","menuStyles","currentIndex"],"sources":["../../src/LobeSelect/LobeSelect.tsx"],"sourcesContent":["'use client';\n\nimport { Select } 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 LobeSelectOption,\n type LobeSelectOptionGroup,\n type LobeSelectOptions,\n type LobeSelectProps,\n} from './type';\n\nconst isGroupOption = <Value,>(\n option: LobeSelectOption<Value> | LobeSelectOptionGroup<Value>,\n): option is LobeSelectOptionGroup<Value> =>\n Boolean((option as LobeSelectOptionGroup<Value>).options);\n\nconst getOptionSearchText = <Value,>(option: LobeSelectOption<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: LobeSelectOptions) =>\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 LobeSelect = memo<LobeSelectProps<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<LobeSelectOption<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, LobeSelectOption<any>>();\n\n const addOption = (item: LobeSelectOption<any>) => {\n if (!optionValueMap.has(item.value)) {\n optionValueMap.set(item.value, item);\n }\n };\n\n const walkOptions = (items: LobeSelectOptions) => {\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: LobeSelectOptions = [...baseOptions, ...filteredExtraOptions];\n\n const missingValueOptions: LobeSelectOption<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): LobeSelectOption<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: LobeSelectOptions): LobeSelectOptions => {\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 LobeSelectOptions;\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: LobeSelectOptions) =>\n items.map((item, index) => {\n if (isGroupOption(item)) {\n return (\n <Select.Group className={cx(styles.group, classNames?.group)} key={`group-${index}`}>\n <Select.GroupLabel\n className={cx(menuStyles.groupLabel, styles.groupLabel, classNames?.groupLabel)}\n >\n {item.label}\n </Select.GroupLabel>\n {item.options.map((option) => {\n const currentIndex = optionIndex++;\n return (\n <Select.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 <Select.ItemText className={itemTextClassName}>\n {optionRender ? optionRender(option, { index: currentIndex }) : option.label}\n </Select.ItemText>\n {!isBoldIndicator && (\n <Select.ItemIndicator\n className={cx(styles.itemIndicator, classNames?.itemIndicator)}\n >\n <Icon icon={Check} size={'small'} />\n </Select.ItemIndicator>\n )}\n </Select.Item>\n );\n })}\n </Select.Group>\n );\n }\n\n const currentIndex = optionIndex++;\n return (\n <Select.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 <Select.ItemText className={itemTextClassName}>\n {optionRender ? optionRender(item, { index: currentIndex }) : item.label}\n </Select.ItemText>\n {!isBoldIndicator && (\n <Select.ItemIndicator className={cx(styles.itemIndicator, classNames?.itemIndicator)}>\n <Icon icon={Check} size={'small'} />\n </Select.ItemIndicator>\n )}\n </Select.Item>\n );\n });\n\n const appElement = useAppElement();\n return (\n <Select.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 <Select.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 <Select.Value className={cx(styles.value, classNames?.value)}>{renderValue}</Select.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 <Select.Icon className={cx(styles.icon, classNames?.icon)}>\n {suffixIconNode}\n </Select.Icon>\n )}\n </span>\n </Select.Trigger>\n\n <Select.Portal container={appElement}>\n <Select.Positioner\n align=\"start\"\n alignItemWithTrigger={isItemAligned}\n className={styles.positioner}\n side=\"bottom\"\n sideOffset={6}\n >\n <Select.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 <Select.List\n className={cx(styles.list, classNames?.list)}\n data-virtual={virtual || undefined}\n >\n {content}\n </Select.List>\n );\n }\n\n return (\n <Select.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 </Select.List>\n );\n })()}\n </Select.Popup>\n </Select.Positioner>\n </Select.Portal>\n </Select.Root>\n );\n },\n);\n\nLobeSelect.displayName = 'LobeSelect';\n\nexport default LobeSelect;\n"],"mappings":";;;;;;;;;;;;;;AA4BA,MAAM,iBACJ,WAEA,QAAS,OAAwC,QAAQ;AAE3D,MAAM,uBAA+B,WAAoC;AACvE,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,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nD,oBAAC;OACC,WAAWA,SAAO;OAClB,aAAa,OAAO,gBAAgB,WAAW,cAAc;OAC7D,OAAO;OACP,UAAU;OACV,WAAW;QACX;OACE,SAEA;MACN,MAAM,UACJ,gBAAgB,SAAS,IACvB,cAAc,gBAAgB,GAE9B,oBAAC;OACC,WAAW,GACTM,OAAW,MACXA,OAAW,OACXN,SAAO,OACP,YAAY,MACb;iBACF;QAEK;AAGV,UAAI,CAAC,WAAW,gBAAgB,WAAW,EACzC,QACE,oBAAC,OAAO;OACN,WAAW,GAAGA,SAAO,MAAM,YAAY,KAAK;OAC5C,gBAAc,WAAW;iBAExB;QACW;AAIlB,aACE,oBAAC,OAAO;OACN,WAAW,GAAGA,SAAO,MAAM,YAAY,KAAK;OAC5C,gBAAc,WAAW;OACzB,KAAK;OACL,OAAO;OACP,UAAU,UAAU,KAAK;OACzB,eAAe,UAAU,oBAAoB;OAC7C,UAAU,UAAU,mBAAmB;OACvC,aAAa,UAAU,oBAAoB;OAC3C,SAAS,UAAU,oBAAoB;iBAEvC,oBAAC;QAAY,UAAU;QAAgB,aAAa;kBACjD;SACW;QACF;SAEd;MACS;KACG;IACN;GACJ;EAGnB;AAED,WAAW,cAAc;AAEzB,yBAAe"}
@@ -1,15 +1,15 @@
1
1
  import { LobeSelectSize, LobeSelectVariant } from "./type.mjs";
2
- import * as react37 from "react";
2
+ import * as react5 from "react";
3
3
  import { ComponentProps, ComponentPropsWithRef } from "react";
4
- import * as react_jsx_runtime33 from "react/jsx-runtime";
4
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
5
5
  import * as _base_ui_react_select0 from "@base-ui/react/select";
6
6
  import { Select } from "@base-ui/react/select";
7
7
  import * as node_modules__base_ui_react_esm_separator_Separator0 from "node_modules/@base-ui/react/esm/separator/Separator";
8
8
 
9
9
  //#region src/LobeSelect/atoms.d.ts
10
10
  declare const LobeSelectRoot: typeof Select.Root;
11
- declare const LobeSelectBackdrop: react37.ForwardRefExoticComponent<_base_ui_react_select0.SelectBackdropProps & react37.RefAttributes<HTMLDivElement>>;
12
- declare const LobeSelectSeparator: react37.ForwardRefExoticComponent<node_modules__base_ui_react_esm_separator_Separator0.SeparatorProps & react37.RefAttributes<HTMLDivElement>>;
11
+ declare const LobeSelectBackdrop: react5.ForwardRefExoticComponent<_base_ui_react_select0.SelectBackdropProps & react5.RefAttributes<HTMLDivElement>>;
12
+ declare const LobeSelectSeparator: react5.ForwardRefExoticComponent<node_modules__base_ui_react_esm_separator_Separator0.SeparatorProps & react5.RefAttributes<HTMLDivElement>>;
13
13
  type LobeSelectTriggerProps = Omit<ComponentPropsWithRef<typeof Select.Trigger>, 'children' | 'render'> & {
14
14
  children: ComponentProps<typeof Select.Trigger>['children'];
15
15
  shadow?: boolean;
@@ -26,7 +26,7 @@ declare const LobeSelectTrigger: {
26
26
  variant,
27
27
  ref: refProp,
28
28
  ...rest
29
- }: LobeSelectTriggerProps): react_jsx_runtime33.JSX.Element;
29
+ }: LobeSelectTriggerProps): react_jsx_runtime0.JSX.Element;
30
30
  displayName: string;
31
31
  };
32
32
  type LobeSelectIconProps = ComponentProps<typeof Select.Icon>;
@@ -34,7 +34,7 @@ declare const LobeSelectIcon: {
34
34
  ({
35
35
  className,
36
36
  ...rest
37
- }: LobeSelectIconProps): react_jsx_runtime33.JSX.Element;
37
+ }: LobeSelectIconProps): react_jsx_runtime0.JSX.Element;
38
38
  displayName: string;
39
39
  };
40
40
  type LobeSelectValueProps = ComponentProps<typeof Select.Value>;
@@ -42,7 +42,7 @@ declare const LobeSelectValue: {
42
42
  ({
43
43
  className,
44
44
  ...rest
45
- }: LobeSelectValueProps): react_jsx_runtime33.JSX.Element;
45
+ }: LobeSelectValueProps): react_jsx_runtime0.JSX.Element;
46
46
  displayName: string;
47
47
  };
48
48
  type LobeSelectPortalProps = ComponentProps<typeof Select.Portal> & {
@@ -55,7 +55,7 @@ declare const LobeSelectPortal: {
55
55
  ({
56
56
  container,
57
57
  ...rest
58
- }: LobeSelectPortalProps): react_jsx_runtime33.JSX.Element;
58
+ }: LobeSelectPortalProps): react_jsx_runtime0.JSX.Element;
59
59
  displayName: string;
60
60
  };
61
61
  type LobeSelectPositionerProps = ComponentProps<typeof Select.Positioner>;
@@ -67,7 +67,7 @@ declare const LobeSelectPositioner: {
67
67
  side,
68
68
  sideOffset,
69
69
  ...rest
70
- }: LobeSelectPositionerProps): react_jsx_runtime33.JSX.Element;
70
+ }: LobeSelectPositionerProps): react_jsx_runtime0.JSX.Element;
71
71
  displayName: string;
72
72
  };
73
73
  type LobeSelectPopupProps = ComponentProps<typeof Select.Popup>;
@@ -75,7 +75,7 @@ declare const LobeSelectPopup: {
75
75
  ({
76
76
  className,
77
77
  ...rest
78
- }: LobeSelectPopupProps): react_jsx_runtime33.JSX.Element;
78
+ }: LobeSelectPopupProps): react_jsx_runtime0.JSX.Element;
79
79
  displayName: string;
80
80
  };
81
81
  type LobeSelectListProps = ComponentProps<typeof Select.List>;
@@ -83,7 +83,7 @@ declare const LobeSelectList: {
83
83
  ({
84
84
  className,
85
85
  ...rest
86
- }: LobeSelectListProps): react_jsx_runtime33.JSX.Element;
86
+ }: LobeSelectListProps): react_jsx_runtime0.JSX.Element;
87
87
  displayName: string;
88
88
  };
89
89
  type LobeSelectItemProps = ComponentProps<typeof Select.Item>;
@@ -91,7 +91,7 @@ declare const LobeSelectItem: {
91
91
  ({
92
92
  className,
93
93
  ...rest
94
- }: LobeSelectItemProps): react_jsx_runtime33.JSX.Element;
94
+ }: LobeSelectItemProps): react_jsx_runtime0.JSX.Element;
95
95
  displayName: string;
96
96
  };
97
97
  type LobeSelectItemTextProps = ComponentProps<typeof Select.ItemText>;
@@ -99,7 +99,7 @@ declare const LobeSelectItemText: {
99
99
  ({
100
100
  className,
101
101
  ...rest
102
- }: LobeSelectItemTextProps): react_jsx_runtime33.JSX.Element;
102
+ }: LobeSelectItemTextProps): react_jsx_runtime0.JSX.Element;
103
103
  displayName: string;
104
104
  };
105
105
  type LobeSelectItemIndicatorProps = ComponentProps<typeof Select.ItemIndicator>;
@@ -107,7 +107,7 @@ declare const LobeSelectItemIndicator: {
107
107
  ({
108
108
  className,
109
109
  ...rest
110
- }: LobeSelectItemIndicatorProps): react_jsx_runtime33.JSX.Element;
110
+ }: LobeSelectItemIndicatorProps): react_jsx_runtime0.JSX.Element;
111
111
  displayName: string;
112
112
  };
113
113
  type LobeSelectGroupProps = ComponentProps<typeof Select.Group>;
@@ -115,7 +115,7 @@ declare const LobeSelectGroup: {
115
115
  ({
116
116
  className,
117
117
  ...rest
118
- }: LobeSelectGroupProps): react_jsx_runtime33.JSX.Element;
118
+ }: LobeSelectGroupProps): react_jsx_runtime0.JSX.Element;
119
119
  displayName: string;
120
120
  };
121
121
  type LobeSelectGroupLabelProps = ComponentProps<typeof Select.GroupLabel>;
@@ -123,7 +123,7 @@ declare const LobeSelectGroupLabel: {
123
123
  ({
124
124
  className,
125
125
  ...rest
126
- }: LobeSelectGroupLabelProps): react_jsx_runtime33.JSX.Element;
126
+ }: LobeSelectGroupLabelProps): react_jsx_runtime0.JSX.Element;
127
127
  displayName: string;
128
128
  };
129
129
  type LobeSelectScrollUpArrowProps = ComponentProps<typeof Select.ScrollUpArrow>;
@@ -131,7 +131,7 @@ declare const LobeSelectScrollUpArrow: {
131
131
  ({
132
132
  className,
133
133
  ...rest
134
- }: LobeSelectScrollUpArrowProps): react_jsx_runtime33.JSX.Element;
134
+ }: LobeSelectScrollUpArrowProps): react_jsx_runtime0.JSX.Element;
135
135
  displayName: string;
136
136
  };
137
137
  type LobeSelectScrollDownArrowProps = ComponentProps<typeof Select.ScrollDownArrow>;
@@ -139,7 +139,7 @@ declare const LobeSelectScrollDownArrow: {
139
139
  ({
140
140
  className,
141
141
  ...rest
142
- }: LobeSelectScrollDownArrowProps): react_jsx_runtime33.JSX.Element;
142
+ }: LobeSelectScrollDownArrowProps): react_jsx_runtime0.JSX.Element;
143
143
  displayName: string;
144
144
  };
145
145
  type LobeSelectArrowProps = ComponentProps<typeof Select.Arrow>;
@@ -147,7 +147,7 @@ declare const LobeSelectArrow: {
147
147
  ({
148
148
  className,
149
149
  ...rest
150
- }: LobeSelectArrowProps): react_jsx_runtime33.JSX.Element;
150
+ }: LobeSelectArrowProps): react_jsx_runtime0.JSX.Element;
151
151
  displayName: string;
152
152
  };
153
153
  //#endregion
@@ -1,8 +1,8 @@
1
1
  import { LobeSwitchProps } from "./type.mjs";
2
- import * as react36 from "react";
2
+ import * as react10 from "react";
3
3
 
4
4
  //#region src/LobeSwitch/LobeSwitch.d.ts
5
- declare const LobeSwitch: react36.NamedExoticComponent<LobeSwitchProps>;
5
+ declare const LobeSwitch: react10.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 react_jsx_runtime30 from "react/jsx-runtime";
3
+ import * as react_jsx_runtime14 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): react_jsx_runtime30.JSX.Element;
27
+ }: LobeSwitchRootInternalProps): react_jsx_runtime14.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): react_jsx_runtime30.JSX.Element;
38
+ }: LobeSwitchThumbProps): react_jsx_runtime14.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
- }): react_jsx_runtime30.JSX.Element;
51
+ }): react_jsx_runtime14.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 react34 from "react";
2
+ import * as react1 from "react";
3
3
 
4
4
  //#region src/Markdown/Markdown.d.ts
5
- declare const Markdown: react34.NamedExoticComponent<MarkdownProps>;
5
+ declare const Markdown: react1.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 react33 from "react";
2
+ import * as react0 from "react";
3
3
 
4
4
  //#region src/Markdown/Typography.d.ts
5
- declare const Typography: react33.NamedExoticComponent<TypographyProps>;
5
+ declare const Typography: react0.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 react85 from "react";
3
+ import * as react50 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: react85.NamedExoticComponent<SearchResultCardsProps>;
17
+ declare const SearchResultCards: react50.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 react35 from "react";
2
+ import * as react2 from "react";
3
3
 
4
4
  //#region src/MaskShadow/MaskShadow.d.ts
5
- declare const MaskShadow: react35.NamedExoticComponent<MaskShadowProps>;
5
+ declare const MaskShadow: react2.NamedExoticComponent<MaskShadowProps>;
6
6
  //#endregion
7
7
  export { MaskShadow };
8
8
  //# sourceMappingURL=MaskShadow.d.mts.map
@@ -1,8 +1,8 @@
1
1
  import { MenuProps } from "./type.mjs";
2
- import * as react29 from "react";
2
+ import * as react75 from "react";
3
3
 
4
4
  //#region src/Menu/Menu.d.ts
5
- declare const Menu: react29.NamedExoticComponent<MenuProps<unknown>>;
5
+ declare const Menu: react75.NamedExoticComponent<MenuProps<unknown>>;
6
6
  //#endregion
7
7
  export { Menu };
8
8
  //# sourceMappingURL=Menu.d.mts.map
@@ -1,8 +1,8 @@
1
1
  import { MermaidProps } from "./type.mjs";
2
- import * as react42 from "react";
2
+ import * as react3 from "react";
3
3
 
4
4
  //#region src/Mermaid/Mermaid.d.ts
5
- declare const Mermaid: react42.NamedExoticComponent<MermaidProps>;
5
+ declare const Mermaid: react3.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 react43 from "react";
2
+ import * as react4 from "react";
3
3
 
4
4
  //#region src/Mermaid/SyntaxMermaid/index.d.ts
5
- declare const SyntaxMermaid: react43.NamedExoticComponent<SyntaxMermaidProps>;
5
+ declare const SyntaxMermaid: react4.NamedExoticComponent<SyntaxMermaidProps>;
6
6
  //#endregion
7
7
  export { SyntaxMermaid };
8
8
  //# sourceMappingURL=index.d.mts.map
@@ -1,8 +1,8 @@
1
1
  import { ModalProps } from "./type.mjs";
2
- import * as react30 from "react";
2
+ import * as react76 from "react";
3
3
 
4
4
  //#region src/Modal/Modal.d.ts
5
- declare const Modal: react30.NamedExoticComponent<ModalProps>;
5
+ declare const Modal: react76.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 react31 from "react";
2
+ import * as react77 from "react";
3
3
  import { ReactNode } from "react";
4
4
 
5
5
  //#region src/Modal/ModalProvider.d.ts
6
- declare const ModalProvider: react31.NamedExoticComponent<{
6
+ declare const ModalProvider: react77.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 react_jsx_runtime29 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime60 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) => react_jsx_runtime29.JSX.Element | null;
10
+ }: ModalHostProps) => react_jsx_runtime60.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 react86 from "react";
1
+ import * as react51 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: react86.NamedExoticComponent<{
9
+ declare const MotionProvider: react51.NamedExoticComponent<{
10
10
  children: ReactNode;
11
11
  motion: MotionComponentType;
12
12
  }>;
@@ -1,7 +1,7 @@
1
- import * as react_jsx_runtime22 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime53 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/Popover/ArrowIcon.d.ts
4
- declare const PopoverArrowIcon: react_jsx_runtime22.JSX.Element;
4
+ declare const PopoverArrowIcon: react_jsx_runtime53.JSX.Element;
5
5
  //#endregion
6
6
  export { PopoverArrowIcon };
7
7
  //# sourceMappingURL=ArrowIcon.d.mts.map
@@ -1,13 +1,13 @@
1
1
  import { PopoverPlacement } from "./type.mjs";
2
- import * as react25 from "react";
2
+ import * as react71 from "react";
3
3
  import { ComponentProps, ComponentPropsWithRef } from "react";
4
- import * as react_jsx_runtime23 from "react/jsx-runtime";
4
+ import * as react_jsx_runtime54 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: react25.ForwardRefExoticComponent<_base_ui_react_popover0.PopoverBackdropProps & react25.RefAttributes<HTMLDivElement>>;
10
+ declare const PopoverBackdrop: react71.ForwardRefExoticComponent<_base_ui_react_popover0.PopoverBackdropProps & react71.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): react_jsx_runtime23.JSX.Element;
21
+ }: PopoverTriggerElementProps): react_jsx_runtime54.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): react_jsx_runtime23.JSX.Element | null;
40
+ }: PopoverPortalAtomProps): react_jsx_runtime54.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): react_jsx_runtime23.JSX.Element;
57
+ }: PopoverPositionerAtomProps): react_jsx_runtime54.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): react_jsx_runtime23.JSX.Element;
65
+ }: PopoverPopupAtomProps): react_jsx_runtime54.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): react_jsx_runtime23.JSX.Element;
74
+ }: PopoverArrowAtomProps): react_jsx_runtime54.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): react_jsx_runtime23.JSX.Element;
82
+ }: PopoverViewportAtomProps): react_jsx_runtime54.JSX.Element;
83
83
  displayName: string;
84
84
  };
85
85
  //#endregion
@@ -1,11 +1,11 @@
1
- import * as react27 from "react";
1
+ import * as react73 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: react27.NamedExoticComponent<{
8
+ declare const PopoverProvider: react73.NamedExoticComponent<{
9
9
  children: ReactNode;
10
10
  value: PopoverContextValue;
11
11
  }>;