@lobehub/ui 5.51.2 → 5.53.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/Accordion/Accordion.mjs +1 -1
- package/es/Accordion/Accordion.mjs.map +1 -1
- package/es/ActionIconGroup/type.d.mts +2 -1
- package/es/Alert/Alert.mjs +1 -1
- package/es/AutoComplete/Select.mjs +1 -1
- package/es/Avatar/Avatar.mjs +2 -2
- package/es/Burger/Burger.mjs +2 -2
- package/es/Burger/Burger.mjs.map +1 -1
- package/es/Button/Button.mjs +1 -1
- package/es/CodeDiff/DiffPanel.mjs +1 -1
- package/es/CodeDiff/DiffPanel.mjs.map +1 -1
- package/es/Collapse/Collapse.mjs +1 -1
- package/es/ColorSwatches/ColorSwatches.mjs +21 -21
- package/es/ColorSwatches/ColorSwatches.mjs.map +1 -1
- package/es/ColorSwatches/style.mjs +3 -12
- package/es/ColorSwatches/style.mjs.map +1 -1
- package/es/DatePicker/DatePicker.mjs +1 -1
- package/es/DraggablePanel/DraggablePanel.mjs +1 -1
- package/es/Drawer/Drawer.mjs +1 -1
- package/es/EditableText/ControlInput.d.mts +2 -2
- package/es/EditableText/ControlInput.mjs +1 -1
- package/es/EditableText/ControlInput.mjs.map +1 -1
- package/es/EditableText/EditableText.mjs +1 -0
- package/es/EditableText/EditableText.mjs.map +1 -1
- package/es/EditableText/type.d.mts +5 -1
- package/es/EmojiPicker/AvatarUploader.mjs +76 -71
- package/es/EmojiPicker/AvatarUploader.mjs.map +1 -1
- package/es/EmojiPicker/EmojiPicker.mjs +12 -6
- package/es/EmojiPicker/EmojiPicker.mjs.map +1 -1
- package/es/EmojiPicker/style.mjs +32 -9
- package/es/EmojiPicker/style.mjs.map +1 -1
- package/es/EmojiPicker/type.d.mts +2 -1
- package/es/Form/Form.mjs +1 -1
- package/es/Form/components/FormDivider.mjs +1 -1
- package/es/Form/components/FormItem.mjs +1 -1
- package/es/Form/components/FormSubmitFooter.mjs +1 -1
- package/es/Form/components/FormTitle.mjs +1 -1
- package/es/GroupAvatar/GroupAvatar.mjs +1 -1
- package/es/GroupAvatar/GroupAvatar.mjs.map +1 -1
- package/es/GroupAvatar/type.d.mts +2 -1
- package/es/Highlighter/Highlighter.mjs +1 -1
- package/es/Highlighter/Highlighter.mjs.map +1 -1
- package/es/Highlighter/LangSelect.mjs +23 -13
- package/es/Highlighter/LangSelect.mjs.map +1 -1
- package/es/Highlighter/style.mjs +1 -1
- package/es/Highlighter/style.mjs.map +1 -1
- package/es/HtmlPreview/HtmlPreview.mjs +28 -1
- package/es/HtmlPreview/HtmlPreview.mjs.map +1 -1
- package/es/Image/viewer/ImageViewer.mjs +1 -1
- package/es/Image/viewer/ImageViewer.mjs.map +1 -1
- package/es/Image/viewer/Toolbar.mjs +1 -1
- package/es/Input/Input.mjs +1 -1
- package/es/Input/InputNumber.mjs +1 -1
- package/es/Input/InputOPT.mjs +1 -1
- package/es/Input/InputPassword.mjs +1 -1
- package/es/Input/TextArea.mjs +1 -1
- package/es/Menu/Menu.mjs +1 -1
- package/es/Menu/index.d.mts +2 -1
- package/es/Menu/index.mjs +1 -1
- package/es/Menu/itemInterface.d.mts +71 -0
- package/es/Menu/type.d.mts +8 -8
- package/es/Mermaid/Mermaid.mjs +1 -1
- package/es/Mermaid/Mermaid.mjs.map +1 -1
- package/es/Modal/Modal.mjs +1 -1
- package/es/SearchBar/SearchBar.mjs +1 -1
- package/es/SearchBar/SearchBar.mjs.map +1 -1
- package/es/SearchBar/type.d.mts +2 -2
- package/es/Segmented/Segmented.mjs +1 -1
- package/es/Select/Select.mjs +1 -1
- package/es/SliderWithInput/SliderWithInput.mjs +1 -1
- package/es/Tabs/Tabs.mjs +1 -1
- package/es/Tag/Tag.mjs +1 -1
- package/es/ThemeProvider/ConfigProvider.mjs +1 -1
- package/es/ThemeProvider/ThemeProvider.mjs +1 -1
- package/es/ThemeSwitch/ThemeSwitch.mjs +1 -1
- package/es/Toc/Toc.mjs +1 -1
- package/es/Toc/TocMobile.mjs +1 -1
- package/es/awesome/AgentSkillCard/AgentSkillCard.mjs +1 -1
- package/es/awesome/Hero/Hero.mjs +1 -1
- package/es/awesome/LandingSection/LandingSection.mjs +1 -1
- package/es/base-ui/Anchor/Anchor.d.mts +6 -0
- package/es/base-ui/Anchor/Anchor.mjs +141 -0
- package/es/base-ui/Anchor/Anchor.mjs.map +1 -0
- package/es/base-ui/Anchor/index.d.mts +3 -0
- package/es/base-ui/Anchor/style.mjs +80 -0
- package/es/base-ui/Anchor/style.mjs.map +1 -0
- package/es/base-ui/Anchor/type.d.mts +20 -0
- package/es/base-ui/AutoComplete/AutoComplete.mjs.map +1 -1
- package/es/base-ui/Avatar/Avatar.mjs +1 -1
- package/es/base-ui/Breadcrumb/Breadcrumb.d.mts +6 -0
- package/es/base-ui/Breadcrumb/Breadcrumb.mjs +58 -0
- package/es/base-ui/Breadcrumb/Breadcrumb.mjs.map +1 -0
- package/es/base-ui/Breadcrumb/index.d.mts +3 -0
- package/es/base-ui/Breadcrumb/style.mjs +65 -0
- package/es/base-ui/Breadcrumb/style.mjs.map +1 -0
- package/es/base-ui/Breadcrumb/type.d.mts +24 -0
- package/es/base-ui/Burger/Burger.d.mts +6 -0
- package/es/base-ui/Burger/Burger.mjs +69 -0
- package/es/base-ui/Burger/Burger.mjs.map +1 -0
- package/es/base-ui/Burger/index.d.mts +3 -0
- package/es/base-ui/Burger/style.mjs +63 -0
- package/es/base-ui/Burger/style.mjs.map +1 -0
- package/es/base-ui/Burger/type.d.mts +23 -0
- package/es/base-ui/Carousel/Carousel.d.mts +6 -0
- package/es/base-ui/Carousel/Carousel.mjs +157 -0
- package/es/base-ui/Carousel/Carousel.mjs.map +1 -0
- package/es/base-ui/Carousel/index.d.mts +3 -0
- package/es/base-ui/Carousel/style.mjs +88 -0
- package/es/base-ui/Carousel/style.mjs.map +1 -0
- package/es/base-ui/Carousel/type.d.mts +23 -0
- package/es/base-ui/ColorPicker/ColorPicker.d.mts +6 -0
- package/es/base-ui/ColorPicker/ColorPicker.mjs +227 -0
- package/es/base-ui/ColorPicker/ColorPicker.mjs.map +1 -0
- package/es/base-ui/ColorPicker/SaturationArea.mjs +64 -0
- package/es/base-ui/ColorPicker/SaturationArea.mjs.map +1 -0
- package/es/base-ui/ColorPicker/color.mjs +28 -0
- package/es/base-ui/ColorPicker/color.mjs.map +1 -0
- package/es/base-ui/ColorPicker/index.d.mts +3 -0
- package/es/base-ui/ColorPicker/style.mjs +180 -0
- package/es/base-ui/ColorPicker/style.mjs.map +1 -0
- package/es/base-ui/ColorPicker/type.d.mts +20 -0
- package/es/base-ui/ContextMenu/ContextMenuHost.mjs.map +1 -1
- package/es/base-ui/ContextMenu/renderItems.d.mts +0 -1
- package/es/base-ui/ContextMenu/renderItems.mjs.map +1 -1
- package/es/base-ui/DatePicker/CalendarPanel.mjs +188 -0
- package/es/base-ui/DatePicker/CalendarPanel.mjs.map +1 -0
- package/es/base-ui/DatePicker/DatePicker.d.mts +6 -0
- package/es/base-ui/DatePicker/DatePicker.mjs +88 -0
- package/es/base-ui/DatePicker/DatePicker.mjs.map +1 -0
- package/es/base-ui/DatePicker/DateRangePicker.d.mts +6 -0
- package/es/base-ui/DatePicker/DateRangePicker.mjs +128 -0
- package/es/base-ui/DatePicker/DateRangePicker.mjs.map +1 -0
- package/es/base-ui/DatePicker/PickerShell.mjs +43 -0
- package/es/base-ui/DatePicker/PickerShell.mjs.map +1 -0
- package/es/base-ui/DatePicker/calendar.d.mts +5 -0
- package/es/base-ui/DatePicker/calendar.mjs +46 -0
- package/es/base-ui/DatePicker/calendar.mjs.map +1 -0
- package/es/base-ui/DatePicker/index.d.mts +5 -0
- package/es/base-ui/DatePicker/style.mjs +193 -0
- package/es/base-ui/DatePicker/style.mjs.map +1 -0
- package/es/base-ui/DatePicker/type.d.mts +35 -0
- package/es/base-ui/Descriptions/Descriptions.d.mts +6 -0
- package/es/base-ui/Descriptions/Descriptions.mjs +62 -0
- package/es/base-ui/Descriptions/Descriptions.mjs.map +1 -0
- package/es/base-ui/Descriptions/index.d.mts +3 -0
- package/es/base-ui/Descriptions/style.mjs +64 -0
- package/es/base-ui/Descriptions/style.mjs.map +1 -0
- package/es/base-ui/Descriptions/type.d.mts +28 -0
- package/es/base-ui/Divider/Divider.d.mts +6 -0
- package/es/base-ui/Divider/Divider.mjs +30 -0
- package/es/base-ui/Divider/Divider.mjs.map +1 -0
- package/es/base-ui/Divider/index.d.mts +3 -0
- package/es/base-ui/Divider/style.mjs +59 -0
- package/es/base-ui/Divider/style.mjs.map +1 -0
- package/es/base-ui/Divider/type.d.mts +12 -0
- package/es/base-ui/Drawer/atoms.mjs.map +1 -1
- package/es/base-ui/DropdownMenu/atoms.mjs +1 -1
- package/es/base-ui/DropdownMenu/atoms.mjs.map +1 -1
- package/es/base-ui/DropdownMenu/renderItems.d.mts +0 -1
- package/es/base-ui/DropdownMenu/renderItems.mjs.map +1 -1
- package/es/base-ui/Form/components/FormTitle.mjs +1 -1
- package/es/base-ui/Form/components/FormTitle.mjs.map +1 -1
- package/es/base-ui/Form/type.d.mts +2 -2
- package/es/base-ui/Input/ClearButton.mjs +32 -0
- package/es/base-ui/Input/ClearButton.mjs.map +1 -0
- package/es/base-ui/Input/Input.mjs +30 -4
- package/es/base-ui/Input/Input.mjs.map +1 -1
- package/es/base-ui/Input/InputNumber.mjs +43 -22
- package/es/base-ui/Input/InputNumber.mjs.map +1 -1
- package/es/base-ui/Input/TextArea.mjs +50 -13
- package/es/base-ui/Input/TextArea.mjs.map +1 -1
- package/es/base-ui/Input/clearNativeValue.mjs +12 -0
- package/es/base-ui/Input/clearNativeValue.mjs.map +1 -0
- package/es/base-ui/Input/pressEnter.mjs +6 -0
- package/es/base-ui/Input/pressEnter.mjs.map +1 -0
- package/es/base-ui/Input/style.d.mts +5 -1
- package/es/base-ui/Input/style.mjs +67 -4
- package/es/base-ui/Input/style.mjs.map +1 -1
- package/es/base-ui/Input/type.d.mts +13 -2
- package/es/base-ui/List/List.d.mts +6 -0
- package/es/base-ui/List/List.mjs +50 -0
- package/es/base-ui/List/List.mjs.map +1 -0
- package/es/base-ui/List/ListRow.mjs +74 -0
- package/es/base-ui/List/ListRow.mjs.map +1 -0
- package/es/base-ui/List/index.d.mts +3 -0
- package/es/base-ui/List/style.mjs +146 -0
- package/es/base-ui/List/style.mjs.map +1 -0
- package/es/base-ui/List/type.d.mts +48 -0
- package/es/base-ui/Modal/atoms.mjs.map +1 -1
- package/es/base-ui/Modal/imperative.mjs +1 -1
- package/es/base-ui/Modal/imperative.mjs.map +1 -1
- package/es/base-ui/Modal/type.d.mts +1 -0
- package/es/base-ui/Popover/PopoverPortal.mjs.map +1 -1
- package/es/base-ui/Progress/Progress.mjs +16 -14
- package/es/base-ui/Progress/Progress.mjs.map +1 -1
- package/es/base-ui/Progress/style.mjs +16 -25
- package/es/base-ui/Progress/style.mjs.map +1 -1
- package/es/base-ui/QRCode/QRCode.d.mts +6 -0
- package/es/base-ui/QRCode/QRCode.mjs +105 -0
- package/es/base-ui/QRCode/QRCode.mjs.map +1 -0
- package/es/base-ui/QRCode/index.d.mts +3 -0
- package/es/base-ui/QRCode/qrPath.mjs +16 -0
- package/es/base-ui/QRCode/qrPath.mjs.map +1 -0
- package/es/base-ui/QRCode/style.mjs +52 -0
- package/es/base-ui/QRCode/style.mjs.map +1 -0
- package/es/base-ui/QRCode/type.d.mts +19 -0
- package/es/base-ui/Rate/Rate.d.mts +6 -0
- package/es/base-ui/Rate/Rate.mjs +111 -0
- package/es/base-ui/Rate/Rate.mjs.map +1 -0
- package/es/base-ui/Rate/index.d.mts +3 -0
- package/es/base-ui/Rate/style.mjs +81 -0
- package/es/base-ui/Rate/style.mjs.map +1 -0
- package/es/base-ui/Rate/type.d.mts +19 -0
- package/es/base-ui/Select/atoms.mjs.map +1 -1
- package/es/base-ui/Select/hooks.mjs.map +1 -1
- package/es/base-ui/Statistic/Statistic.d.mts +6 -0
- package/es/base-ui/Statistic/Statistic.mjs +42 -0
- package/es/base-ui/Statistic/Statistic.mjs.map +1 -0
- package/es/base-ui/Statistic/formatValue.d.mts +5 -0
- package/es/base-ui/Statistic/formatValue.mjs +23 -0
- package/es/base-ui/Statistic/formatValue.mjs.map +1 -0
- package/es/base-ui/Statistic/index.d.mts +4 -0
- package/es/base-ui/Statistic/style.mjs +34 -0
- package/es/base-ui/Statistic/style.mjs.map +1 -0
- package/es/base-ui/Statistic/type.d.mts +23 -0
- package/es/base-ui/Steps/Steps.d.mts +6 -0
- package/es/base-ui/Steps/Steps.mjs +74 -0
- package/es/base-ui/Steps/Steps.mjs.map +1 -0
- package/es/base-ui/Steps/index.d.mts +3 -0
- package/es/base-ui/Steps/style.mjs +155 -0
- package/es/base-ui/Steps/style.mjs.map +1 -0
- package/es/base-ui/Steps/type.d.mts +32 -0
- package/es/base-ui/Table/FilterMenu.mjs +45 -0
- package/es/base-ui/Table/FilterMenu.mjs.map +1 -0
- package/es/base-ui/Table/Table.d.mts +10 -0
- package/es/base-ui/Table/Table.mjs +134 -0
- package/es/base-ui/Table/Table.mjs.map +1 -0
- package/es/base-ui/Table/TableBody.mjs +59 -0
- package/es/base-ui/Table/TableBody.mjs.map +1 -0
- package/es/base-ui/Table/TableHead.mjs +50 -0
- package/es/base-ui/Table/TableHead.mjs.map +1 -0
- package/es/base-ui/Table/features.mjs +12 -0
- package/es/base-ui/Table/features.mjs.map +1 -0
- package/es/base-ui/Table/fixedOffsets.mjs +29 -0
- package/es/base-ui/Table/fixedOffsets.mjs.map +1 -0
- package/es/base-ui/Table/index.d.mts +3 -0
- package/es/base-ui/Table/style.mjs +168 -0
- package/es/base-ui/Table/style.mjs.map +1 -0
- package/es/base-ui/Table/toColumnDefs.mjs +26 -0
- package/es/base-ui/Table/toColumnDefs.mjs.map +1 -0
- package/es/base-ui/Table/type.d.mts +68 -0
- package/es/base-ui/Table/useTableState.mjs +99 -0
- package/es/base-ui/Table/useTableState.mjs.map +1 -0
- package/es/base-ui/Toast/imperative.mjs.map +1 -1
- package/es/base-ui/Tooltip/TooltipGroup.mjs.map +1 -1
- package/es/base-ui/Tooltip/TooltipStandalone.mjs.map +1 -1
- package/es/base-ui/index.d.mts +66 -21
- package/es/base-ui/index.mjs +42 -26
- package/es/base-ui/panelStyles.mjs +95 -0
- package/es/base-ui/panelStyles.mjs.map +1 -0
- package/es/chat/ChatList/components/HistoryDivider.mjs +9 -6
- package/es/chat/ChatList/components/HistoryDivider.mjs.map +1 -1
- package/es/chat/MessageModal/MessageModal.mjs +1 -1
- package/es/chat/TokenTag/TokenTag.mjs +1 -1
- package/es/color/CssVar/VarRow.mjs +1 -1
- package/es/color/CssVar/index.mjs +1 -1
- package/es/dashboard/FilterSidebar/FilterSidebar.mjs +1 -1
- package/es/eslint/index.mjs +100 -0
- package/es/eslint/index.mjs.map +1 -1
- package/es/i18n/resources/en/burger.d.mts +8 -0
- package/es/i18n/resources/en/burger.mjs +9 -0
- package/es/i18n/resources/en/burger.mjs.map +1 -0
- package/es/i18n/resources/en/colorPicker.d.mts +12 -0
- package/es/i18n/resources/en/colorPicker.mjs +13 -0
- package/es/i18n/resources/en/colorPicker.mjs.map +1 -0
- package/es/i18n/resources/en/common.d.mts +1 -0
- package/es/i18n/resources/en/common.mjs +1 -0
- package/es/i18n/resources/en/common.mjs.map +1 -1
- package/es/i18n/resources/en/datePicker.d.mts +13 -0
- package/es/i18n/resources/en/datePicker.mjs +14 -0
- package/es/i18n/resources/en/datePicker.mjs.map +1 -0
- package/es/i18n/resources/en/index.d.mts +15 -11
- package/es/i18n/resources/en/index.mjs +9 -1
- package/es/i18n/resources/en/index.mjs.map +1 -1
- package/es/i18n/resources/en/qrCode.d.mts +9 -0
- package/es/i18n/resources/en/qrCode.mjs +10 -0
- package/es/i18n/resources/en/qrCode.mjs.map +1 -0
- package/es/i18n/resources/zhCn/burger.d.mts +8 -0
- package/es/i18n/resources/zhCn/burger.mjs +9 -0
- package/es/i18n/resources/zhCn/burger.mjs.map +1 -0
- package/es/i18n/resources/zhCn/colorPicker.d.mts +12 -0
- package/es/i18n/resources/zhCn/colorPicker.mjs +13 -0
- package/es/i18n/resources/zhCn/colorPicker.mjs.map +1 -0
- package/es/i18n/resources/zhCn/common.d.mts +1 -0
- package/es/i18n/resources/zhCn/common.mjs +1 -0
- package/es/i18n/resources/zhCn/common.mjs.map +1 -1
- package/es/i18n/resources/zhCn/datePicker.d.mts +13 -0
- package/es/i18n/resources/zhCn/datePicker.mjs +14 -0
- package/es/i18n/resources/zhCn/datePicker.mjs.map +1 -0
- package/es/i18n/resources/zhCn/index.d.mts +15 -11
- package/es/i18n/resources/zhCn/index.mjs +9 -1
- package/es/i18n/resources/zhCn/index.mjs.map +1 -1
- package/es/i18n/resources/zhCn/qrCode.d.mts +9 -0
- package/es/i18n/resources/zhCn/qrCode.mjs +10 -0
- package/es/i18n/resources/zhCn/qrCode.mjs.map +1 -0
- package/es/i18n/types.d.mts +14 -10
- package/es/index.d.mts +12 -11
- package/es/index.mjs +23 -23
- package/es/mdx/Cards/Card.d.mts +2 -2
- package/es/mdx/Cards/Card.mjs +1 -1
- package/es/mdx/Cards/Card.mjs.map +1 -1
- package/es/mdx/Mdx/index.mjs +1 -1
- package/es/mdx/Mdx/index.mjs.map +1 -1
- package/es/mdx/Tabs/index.d.mts +2 -2
- package/es/mdx/Tabs/index.mjs +7 -2
- package/es/mdx/Tabs/index.mjs.map +1 -1
- package/es/mdx/Tabs/style.mjs +33 -1
- package/es/mdx/Tabs/style.mjs.map +1 -1
- package/es/mdx/mdxComponents/Citation/PopoverPanel.mjs +1 -1
- package/es/mdx/mdxComponents/Citation/PopoverPanel.mjs.map +1 -1
- package/es/node_modules/.pnpm/unist-util-visit@5.1.0/node_modules/unist-util-visit/lib/index.mjs.map +1 -1
- package/es/static-css/baseline.mjs +1 -4
- package/es/static-css/baseline.mjs.map +1 -1
- package/es/static-css/buildAntdStaticCss.mjs +1 -1
- package/package.json +3 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"imperative.mjs","names":["BaseToast"],"sources":["../../../src/base-ui/Toast/imperative.tsx"],"sourcesContent":["'use client';\n\nimport { Toast as BaseToast } from '@base-ui/react/toast';\nimport { cx } from 'antd-style';\nimport { memo, useEffect, useId, useState, useSyncExternalStore } from 'react';\n\nimport { useIsClient } from '@/hooks/useIsClient';\nimport { useAppElement } from '@/ThemeProvider';\n\nimport { acquireLayerZIndex } from '../zIndex';\nimport { ToastContext } from './context';\nimport { isActiveToastHost, registerToastHost, subscribeToastHost } from './hostGuard';\nimport {\n __resetPendingToastQueueForTests,\n markToastHostNotReady,\n markToastHostReady,\n runWhenToastHostReady,\n} from './pendingQueue';\nimport { viewportVariants } from './style';\nimport ToastItem from './Toast';\nimport {\n type ToastAPI,\n type ToastInstance,\n type ToastOptions,\n type ToastPosition,\n type ToastPromiseOptions,\n type ToastType,\n} from './type';\n\n// All possible positions\nconst ALL_POSITIONS: ToastPosition[] = [\n 'top',\n 'top-left',\n 'top-right',\n 'bottom',\n 'bottom-left',\n 'bottom-right',\n];\n\n// Global state management\ninterface ToastState {\n duration: number;\n limit: number;\n position: ToastPosition;\n swipeDirection: ('left' | 'right' | 'up' | 'down') | ('left' | 'right' | 'up' | 'down')[];\n}\n\nlet globalState: ToastState = {\n duration: 5000,\n limit: 5,\n position: 'bottom-right',\n swipeDirection: ['down', 'right'],\n};\n\n// Toast managers for each position\nconst toastManagers: Record<ToastPosition, ReturnType<typeof BaseToast.createToastManager>> = {\n 'bottom': BaseToast.createToastManager(),\n 'bottom-left': BaseToast.createToastManager(),\n 'bottom-right': BaseToast.createToastManager(),\n 'top': BaseToast.createToastManager(),\n 'top-left': BaseToast.createToastManager(),\n 'top-right': BaseToast.createToastManager(),\n};\n\ninterface ActiveToast {\n superseded: boolean;\n}\n\nconst activeToasts: Record<ToastPosition, Map<string, ActiveToast>> = {\n 'bottom': new Map(),\n 'bottom-left': new Map(),\n 'bottom-right': new Map(),\n 'top': new Map(),\n 'top-left': new Map(),\n 'top-right': new Map(),\n};\n\nconst getManager = (position: ToastPosition) => toastManagers[position];\n\nlet toastIdCounter = 0;\nconst generateToastId = (): string =>\n `toast-${Date.now().toString(36)}-${(toastIdCounter++).toString(36)}`;\n\nconst findActivePosition = (id: string) => ALL_POSITIONS.find((pos) => activeToasts[pos].has(id));\n\n// Base UI prepends every new toast, so the last entry we registered is the one\n// currently rendered at the front of the stack.\nconst isFrontMost = (position: ToastPosition, id: string) =>\n Array.from(activeToasts[position].keys()).at(-1) === id;\n\nconst normalizeOptions = (\n optionsOrMessage: Omit<ToastOptions, 'type'> | string,\n type: ToastType,\n): ToastOptions => {\n if (typeof optionsOrMessage === 'string') {\n return {\n description: optionsOrMessage,\n type,\n };\n }\n return {\n ...optionsOrMessage,\n type,\n };\n};\n\nconst createToastInstance = (id: string, position: ToastPosition): ToastInstance => ({\n close: () => runWhenToastHostReady(() => getManager(position).close(id)),\n id,\n update: (options) => {\n runWhenToastHostReady(() =>\n getManager(position).update(id, {\n data: options,\n description: options.description,\n title: options.title,\n }),\n );\n },\n});\n\n// createToastManager() is a stateless emitter (see @base-ui/react/toast/createToastManager):\n// add/close/update just broadcast to whatever is currently subscribed, and the\n// ToastProvider that owns the real toast state only subscribes from a passive\n// useEffect. Calls made while no host is ready (e.g. mid-handoff between the\n// previously-active ToastHost unmounting and its successor's Provider\n// subscribing) would otherwise be silently dropped, so every manager call is\n// routed through runWhenToastHostReady to queue until a host is listening.\nconst addToast = (options: ToastOptions): ToastInstance => {\n const position = options.placement ?? globalState.position;\n const manager = getManager(position);\n const { id: dedupeId, onClose, onRemove } = options;\n\n if (dedupeId) {\n const prevPosition = findActivePosition(dedupeId);\n // Already the front-most toast: let Base UI upsert it in place so it only\n // refreshes its content and timer, without replaying the slide-in animation.\n const shouldPromote =\n prevPosition && !(prevPosition === position && isFrontMost(position, dedupeId));\n\n if (shouldPromote) {\n // Closing marks the toast as `ending`, which makes the following `add`\n // drop it and prepend a fresh one — Base UI's own upsert keeps the\n // original slot instead.\n activeToasts[prevPosition].get(dedupeId)!.superseded = true;\n activeToasts[prevPosition].delete(dedupeId);\n runWhenToastHostReady(() => getManager(prevPosition).close(dedupeId));\n }\n }\n\n const id = dedupeId ?? generateToastId();\n const active: ActiveToast = { superseded: false };\n activeToasts[position].set(id, active);\n runWhenToastHostReady(() => {\n manager.add({\n id,\n data: options,\n description: options.description,\n onClose: () => {\n if (active.superseded) return;\n onClose?.();\n },\n onRemove: () => {\n if (active.superseded) return;\n activeToasts[position].delete(id);\n onRemove?.();\n },\n timeout: options.duration ?? globalState.duration,\n title: options.title,\n });\n });\n return createToastInstance(id, position);\n};\n\nconst dismissToast = (id?: string) => {\n if (id) {\n // Try to close from all managers since we don't know which position the toast is in\n for (const [position, manager] of Object.entries(toastManagers)) {\n activeToasts[position as ToastPosition].delete(id);\n runWhenToastHostReady(() => manager.close(id));\n }\n } else {\n // Clear all toasts\n for (const [position, manager] of Object.entries(toastManagers)) {\n const ids = Array.from(activeToasts[position as ToastPosition].keys());\n activeToasts[position as ToastPosition].clear();\n runWhenToastHostReady(() => {\n for (const toastId of ids) {\n manager.close(toastId);\n }\n });\n }\n }\n};\n\nconst createSuccessToast = (\n optionsOrMessage: Omit<ToastOptions, 'type'> | string,\n): ToastInstance => {\n return addToast(normalizeOptions(optionsOrMessage, 'success'));\n};\n\nconst createErrorToast = (optionsOrMessage: Omit<ToastOptions, 'type'> | string): ToastInstance => {\n return addToast(normalizeOptions(optionsOrMessage, 'error'));\n};\n\nconst createInfoToast = (optionsOrMessage: Omit<ToastOptions, 'type'> | string): ToastInstance => {\n return addToast(normalizeOptions(optionsOrMessage, 'info'));\n};\n\nconst createWarningToast = (\n optionsOrMessage: Omit<ToastOptions, 'type'> | string,\n): ToastInstance => {\n return addToast(normalizeOptions(optionsOrMessage, 'warning'));\n};\n\nconst createLoadingToast = (\n optionsOrMessage: Omit<ToastOptions, 'type'> | string,\n): ToastInstance => {\n const options = normalizeOptions(optionsOrMessage, 'loading');\n // Loading toasts don't auto-dismiss by default\n return addToast({ duration: 0, ...options });\n};\n\nasync function promiseToast<T>(promise: Promise<T>, options: ToastPromiseOptions<T>): Promise<T> {\n const loadingOptions =\n typeof options.loading === 'string'\n ? { description: options.loading }\n : (options.loading as ToastOptions);\n\n const loadingToast = addToast({\n closable: false,\n duration: 0,\n type: 'loading',\n ...loadingOptions,\n });\n\n try {\n const result = await promise;\n\n loadingToast.close();\n\n const successOptions = (() => {\n if (typeof options.success === 'string') {\n return { description: options.success };\n }\n if (typeof options.success === 'function') {\n return { description: options.success(result) };\n }\n return options.success as ToastOptions;\n })();\n\n addToast({ type: 'success', ...successOptions });\n\n return result;\n } catch (error) {\n loadingToast.close();\n\n const errorOptions = (() => {\n if (typeof options.error === 'string') {\n return { description: options.error };\n }\n if (typeof options.error === 'function') {\n return { description: options.error(error as Error) };\n }\n return options.error as ToastOptions;\n })();\n\n addToast({ type: 'error', ...errorOptions });\n\n throw error;\n }\n}\n\n// Base toast function\nconst baseToast = (options: ToastOptions): ToastInstance => {\n return addToast({ type: 'default', ...options });\n};\n\n// Toast API\nexport const toast: ToastAPI = Object.assign(baseToast, {\n dismiss: dismissToast,\n error: createErrorToast,\n info: createInfoToast,\n loading: createLoadingToast,\n promise: promiseToast,\n success: createSuccessToast,\n warning: createWarningToast,\n});\n\n// Toast List Component\nconst ToastList = memo(() => {\n const { toasts } = BaseToast.useToastManager();\n return toasts.map((t) => <ToastItem key={t.id} toast={t} />);\n});\n\nToastList.displayName = 'ToastList';\n\nexport interface ToastHostProps {\n className?: string;\n /**\n * Default duration for toasts\n * @default 5000\n */\n duration?: number;\n /**\n * Maximum number of toasts\n * @default 5\n */\n limit?: number;\n /**\n * Toast position\n * @default 'bottom-right'\n */\n position?: ToastPosition;\n /**\n * Root element for portal\n */\n root?: HTMLElement | ShadowRoot | null;\n /**\n * Swipe direction to dismiss\n * @default ['down', 'right']\n */\n swipeDirection?: ('left' | 'right' | 'up' | 'down') | ('left' | 'right' | 'up' | 'down')[];\n}\n\nexport const ToastHost = memo(\n ({\n root,\n className,\n duration = 5000,\n limit = 5,\n position = 'bottom-right',\n swipeDirection = ['down', 'right'],\n }: ToastHostProps) => {\n const isClient = useIsClient();\n const appElement = useAppElement();\n const [viewportZIndex, setViewportZIndex] = useState<number | undefined>(undefined);\n const hostId = useId();\n\n useEffect(() => registerToastHost(hostId), [hostId]);\n\n const isActive = useSyncExternalStore(\n subscribeToastHost,\n () => isActiveToastHost(hostId),\n () => false,\n );\n\n useEffect(() => {\n if (!isActive) return;\n globalState = {\n duration,\n limit,\n position,\n swipeDirection,\n };\n }, [duration, limit, position, swipeDirection, isActive]);\n\n useEffect(() => {\n if (!isActive) return;\n setViewportZIndex(acquireLayerZIndex('toast'));\n }, [isActive]);\n\n useEffect(() => {\n if (!isActive || !isClient) return undefined;\n // Runs after the six BaseToast.Provider children below have committed\n // and subscribed (child effects run before the parent's), so the\n // managers are guaranteed to have a live listener once this fires.\n markToastHostReady();\n return () => {\n markToastHostNotReady();\n };\n }, [isActive, isClient]);\n\n if (!isClient || !isActive) return null;\n\n const container = root ?? appElement ?? document.body;\n\n return ALL_POSITIONS.map((pos) => (\n <ToastContext key={pos} value={{ position: pos, swipeDirection }}>\n <BaseToast.Provider limit={limit} timeout={duration} toastManager={getManager(pos)}>\n <BaseToast.Portal container={container}>\n <BaseToast.Viewport\n className={cx(viewportVariants({ position: pos }), className)}\n style={{ zIndex: viewportZIndex }}\n >\n <ToastList />\n </BaseToast.Viewport>\n </BaseToast.Portal>\n </BaseToast.Provider>\n </ToastContext>\n ));\n },\n);\n\nToastHost.displayName = 'ToastHost';\n\n// Hook to use toast manager\nexport const useToast = () => toast;\n\nexport const __resetToastStateForTests = (): void => {\n globalState = {\n duration: 5000,\n limit: 5,\n position: 'bottom-right',\n swipeDirection: ['down', 'right'],\n };\n for (const position of ALL_POSITIONS) {\n toastManagers[position] = BaseToast.createToastManager();\n activeToasts[position].clear();\n }\n __resetPendingToastQueueForTests();\n};\n"],"mappings":";;;;;;;;;;;;;;AA8BA,MA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AU,QAAQ,CAAC;CAEvB,IAAI,CAAC,YAAY,CAAC,UAAU,OAAO;CAEnC,MAAM,YAAY,QAAQ,cAAc,SAAS;CAEjD,OAAO,cAAc,KAAK,QACxB,oBAAC,cAAD;EAAwB,OAAO;GAAE,UAAU;GAAK;EAAe;EAC7D,UAAA,oBAACA,MAAU,UAAX;GAA2B;GAAO,SAAS;GAAU,cAAc,WAAW,GAAG;GAC/E,UAAA,oBAACA,MAAU,QAAX;IAA6B;IAC3B,UAAA,oBAACA,MAAU,UAAX;KACE,WAAW,GAAG,iBAAiB,EAAE,UAAU,IAAI,CAAC,GAAG,SAAS;KAC5D,OAAO,EAAE,QAAQ,eAAe;KAEhC,UAAA,oBAAC,WAAD,CAAY,CAAA;IACM,CAAA;GACJ,CAAA;EACA,CAAA;CACR,GAXK,GAWL,CACf;AACH,CACF;AAEA,UAAU,cAAc;AAGxB,MAAa,iBAAiB"}
|
|
1
|
+
{"version":3,"file":"imperative.mjs","names":["BaseToast"],"sources":["../../../src/base-ui/Toast/imperative.tsx"],"sourcesContent":["'use client';\n\nimport { Toast as BaseToast } from '@base-ui/react/toast';\nimport { cx } from 'antd-style';\nimport { memo, useEffect, useId, useState, useSyncExternalStore } from 'react';\n\nimport { useIsClient } from '@/hooks/useIsClient';\nimport { useAppElement } from '@/ThemeProvider/AppElementContext';\n\nimport { acquireLayerZIndex } from '../zIndex';\nimport { ToastContext } from './context';\nimport { isActiveToastHost, registerToastHost, subscribeToastHost } from './hostGuard';\nimport {\n __resetPendingToastQueueForTests,\n markToastHostNotReady,\n markToastHostReady,\n runWhenToastHostReady,\n} from './pendingQueue';\nimport { viewportVariants } from './style';\nimport ToastItem from './Toast';\nimport {\n type ToastAPI,\n type ToastInstance,\n type ToastOptions,\n type ToastPosition,\n type ToastPromiseOptions,\n type ToastType,\n} from './type';\n\n// All possible positions\nconst ALL_POSITIONS: ToastPosition[] = [\n 'top',\n 'top-left',\n 'top-right',\n 'bottom',\n 'bottom-left',\n 'bottom-right',\n];\n\n// Global state management\ninterface ToastState {\n duration: number;\n limit: number;\n position: ToastPosition;\n swipeDirection: ('left' | 'right' | 'up' | 'down') | ('left' | 'right' | 'up' | 'down')[];\n}\n\nlet globalState: ToastState = {\n duration: 5000,\n limit: 5,\n position: 'bottom-right',\n swipeDirection: ['down', 'right'],\n};\n\n// Toast managers for each position\nconst toastManagers: Record<ToastPosition, ReturnType<typeof BaseToast.createToastManager>> = {\n 'bottom': BaseToast.createToastManager(),\n 'bottom-left': BaseToast.createToastManager(),\n 'bottom-right': BaseToast.createToastManager(),\n 'top': BaseToast.createToastManager(),\n 'top-left': BaseToast.createToastManager(),\n 'top-right': BaseToast.createToastManager(),\n};\n\ninterface ActiveToast {\n superseded: boolean;\n}\n\nconst activeToasts: Record<ToastPosition, Map<string, ActiveToast>> = {\n 'bottom': new Map(),\n 'bottom-left': new Map(),\n 'bottom-right': new Map(),\n 'top': new Map(),\n 'top-left': new Map(),\n 'top-right': new Map(),\n};\n\nconst getManager = (position: ToastPosition) => toastManagers[position];\n\nlet toastIdCounter = 0;\nconst generateToastId = (): string =>\n `toast-${Date.now().toString(36)}-${(toastIdCounter++).toString(36)}`;\n\nconst findActivePosition = (id: string) => ALL_POSITIONS.find((pos) => activeToasts[pos].has(id));\n\n// Base UI prepends every new toast, so the last entry we registered is the one\n// currently rendered at the front of the stack.\nconst isFrontMost = (position: ToastPosition, id: string) =>\n Array.from(activeToasts[position].keys()).at(-1) === id;\n\nconst normalizeOptions = (\n optionsOrMessage: Omit<ToastOptions, 'type'> | string,\n type: ToastType,\n): ToastOptions => {\n if (typeof optionsOrMessage === 'string') {\n return {\n description: optionsOrMessage,\n type,\n };\n }\n return {\n ...optionsOrMessage,\n type,\n };\n};\n\nconst createToastInstance = (id: string, position: ToastPosition): ToastInstance => ({\n close: () => runWhenToastHostReady(() => getManager(position).close(id)),\n id,\n update: (options) => {\n runWhenToastHostReady(() =>\n getManager(position).update(id, {\n data: options,\n description: options.description,\n title: options.title,\n }),\n );\n },\n});\n\n// createToastManager() is a stateless emitter (see @base-ui/react/toast/createToastManager):\n// add/close/update just broadcast to whatever is currently subscribed, and the\n// ToastProvider that owns the real toast state only subscribes from a passive\n// useEffect. Calls made while no host is ready (e.g. mid-handoff between the\n// previously-active ToastHost unmounting and its successor's Provider\n// subscribing) would otherwise be silently dropped, so every manager call is\n// routed through runWhenToastHostReady to queue until a host is listening.\nconst addToast = (options: ToastOptions): ToastInstance => {\n const position = options.placement ?? globalState.position;\n const manager = getManager(position);\n const { id: dedupeId, onClose, onRemove } = options;\n\n if (dedupeId) {\n const prevPosition = findActivePosition(dedupeId);\n // Already the front-most toast: let Base UI upsert it in place so it only\n // refreshes its content and timer, without replaying the slide-in animation.\n const shouldPromote =\n prevPosition && !(prevPosition === position && isFrontMost(position, dedupeId));\n\n if (shouldPromote) {\n // Closing marks the toast as `ending`, which makes the following `add`\n // drop it and prepend a fresh one — Base UI's own upsert keeps the\n // original slot instead.\n activeToasts[prevPosition].get(dedupeId)!.superseded = true;\n activeToasts[prevPosition].delete(dedupeId);\n runWhenToastHostReady(() => getManager(prevPosition).close(dedupeId));\n }\n }\n\n const id = dedupeId ?? generateToastId();\n const active: ActiveToast = { superseded: false };\n activeToasts[position].set(id, active);\n runWhenToastHostReady(() => {\n manager.add({\n id,\n data: options,\n description: options.description,\n onClose: () => {\n if (active.superseded) return;\n onClose?.();\n },\n onRemove: () => {\n if (active.superseded) return;\n activeToasts[position].delete(id);\n onRemove?.();\n },\n timeout: options.duration ?? globalState.duration,\n title: options.title,\n });\n });\n return createToastInstance(id, position);\n};\n\nconst dismissToast = (id?: string) => {\n if (id) {\n // Try to close from all managers since we don't know which position the toast is in\n for (const [position, manager] of Object.entries(toastManagers)) {\n activeToasts[position as ToastPosition].delete(id);\n runWhenToastHostReady(() => manager.close(id));\n }\n } else {\n // Clear all toasts\n for (const [position, manager] of Object.entries(toastManagers)) {\n const ids = Array.from(activeToasts[position as ToastPosition].keys());\n activeToasts[position as ToastPosition].clear();\n runWhenToastHostReady(() => {\n for (const toastId of ids) {\n manager.close(toastId);\n }\n });\n }\n }\n};\n\nconst createSuccessToast = (\n optionsOrMessage: Omit<ToastOptions, 'type'> | string,\n): ToastInstance => {\n return addToast(normalizeOptions(optionsOrMessage, 'success'));\n};\n\nconst createErrorToast = (optionsOrMessage: Omit<ToastOptions, 'type'> | string): ToastInstance => {\n return addToast(normalizeOptions(optionsOrMessage, 'error'));\n};\n\nconst createInfoToast = (optionsOrMessage: Omit<ToastOptions, 'type'> | string): ToastInstance => {\n return addToast(normalizeOptions(optionsOrMessage, 'info'));\n};\n\nconst createWarningToast = (\n optionsOrMessage: Omit<ToastOptions, 'type'> | string,\n): ToastInstance => {\n return addToast(normalizeOptions(optionsOrMessage, 'warning'));\n};\n\nconst createLoadingToast = (\n optionsOrMessage: Omit<ToastOptions, 'type'> | string,\n): ToastInstance => {\n const options = normalizeOptions(optionsOrMessage, 'loading');\n // Loading toasts don't auto-dismiss by default\n return addToast({ duration: 0, ...options });\n};\n\nasync function promiseToast<T>(promise: Promise<T>, options: ToastPromiseOptions<T>): Promise<T> {\n const loadingOptions =\n typeof options.loading === 'string'\n ? { description: options.loading }\n : (options.loading as ToastOptions);\n\n const loadingToast = addToast({\n closable: false,\n duration: 0,\n type: 'loading',\n ...loadingOptions,\n });\n\n try {\n const result = await promise;\n\n loadingToast.close();\n\n const successOptions = (() => {\n if (typeof options.success === 'string') {\n return { description: options.success };\n }\n if (typeof options.success === 'function') {\n return { description: options.success(result) };\n }\n return options.success as ToastOptions;\n })();\n\n addToast({ type: 'success', ...successOptions });\n\n return result;\n } catch (error) {\n loadingToast.close();\n\n const errorOptions = (() => {\n if (typeof options.error === 'string') {\n return { description: options.error };\n }\n if (typeof options.error === 'function') {\n return { description: options.error(error as Error) };\n }\n return options.error as ToastOptions;\n })();\n\n addToast({ type: 'error', ...errorOptions });\n\n throw error;\n }\n}\n\n// Base toast function\nconst baseToast = (options: ToastOptions): ToastInstance => {\n return addToast({ type: 'default', ...options });\n};\n\n// Toast API\nexport const toast: ToastAPI = Object.assign(baseToast, {\n dismiss: dismissToast,\n error: createErrorToast,\n info: createInfoToast,\n loading: createLoadingToast,\n promise: promiseToast,\n success: createSuccessToast,\n warning: createWarningToast,\n});\n\n// Toast List Component\nconst ToastList = memo(() => {\n const { toasts } = BaseToast.useToastManager();\n return toasts.map((t) => <ToastItem key={t.id} toast={t} />);\n});\n\nToastList.displayName = 'ToastList';\n\nexport interface ToastHostProps {\n className?: string;\n /**\n * Default duration for toasts\n * @default 5000\n */\n duration?: number;\n /**\n * Maximum number of toasts\n * @default 5\n */\n limit?: number;\n /**\n * Toast position\n * @default 'bottom-right'\n */\n position?: ToastPosition;\n /**\n * Root element for portal\n */\n root?: HTMLElement | ShadowRoot | null;\n /**\n * Swipe direction to dismiss\n * @default ['down', 'right']\n */\n swipeDirection?: ('left' | 'right' | 'up' | 'down') | ('left' | 'right' | 'up' | 'down')[];\n}\n\nexport const ToastHost = memo(\n ({\n root,\n className,\n duration = 5000,\n limit = 5,\n position = 'bottom-right',\n swipeDirection = ['down', 'right'],\n }: ToastHostProps) => {\n const isClient = useIsClient();\n const appElement = useAppElement();\n const [viewportZIndex, setViewportZIndex] = useState<number | undefined>(undefined);\n const hostId = useId();\n\n useEffect(() => registerToastHost(hostId), [hostId]);\n\n const isActive = useSyncExternalStore(\n subscribeToastHost,\n () => isActiveToastHost(hostId),\n () => false,\n );\n\n useEffect(() => {\n if (!isActive) return;\n globalState = {\n duration,\n limit,\n position,\n swipeDirection,\n };\n }, [duration, limit, position, swipeDirection, isActive]);\n\n useEffect(() => {\n if (!isActive) return;\n setViewportZIndex(acquireLayerZIndex('toast'));\n }, [isActive]);\n\n useEffect(() => {\n if (!isActive || !isClient) return undefined;\n // Runs after the six BaseToast.Provider children below have committed\n // and subscribed (child effects run before the parent's), so the\n // managers are guaranteed to have a live listener once this fires.\n markToastHostReady();\n return () => {\n markToastHostNotReady();\n };\n }, [isActive, isClient]);\n\n if (!isClient || !isActive) return null;\n\n const container = root ?? appElement ?? document.body;\n\n return ALL_POSITIONS.map((pos) => (\n <ToastContext key={pos} value={{ position: pos, swipeDirection }}>\n <BaseToast.Provider limit={limit} timeout={duration} toastManager={getManager(pos)}>\n <BaseToast.Portal container={container}>\n <BaseToast.Viewport\n className={cx(viewportVariants({ position: pos }), className)}\n style={{ zIndex: viewportZIndex }}\n >\n <ToastList />\n </BaseToast.Viewport>\n </BaseToast.Portal>\n </BaseToast.Provider>\n </ToastContext>\n ));\n },\n);\n\nToastHost.displayName = 'ToastHost';\n\n// Hook to use toast manager\nexport const useToast = () => toast;\n\nexport const __resetToastStateForTests = (): void => {\n globalState = {\n duration: 5000,\n limit: 5,\n position: 'bottom-right',\n swipeDirection: ['down', 'right'],\n };\n for (const position of ALL_POSITIONS) {\n toastManagers[position] = BaseToast.createToastManager();\n activeToasts[position].clear();\n }\n __resetPendingToastQueueForTests();\n};\n"],"mappings":";;;;;;;;;;;;;;AA8BA,MAAM,gBAAiC;CACrC;CACA;CACA;CACA;CACA;CACA;AACF;AAUA,IAAI,cAA0B;CAC5B,UAAU;CACV,OAAO;CACP,UAAU;CACV,gBAAgB,CAAC,QAAQ,OAAO;AAClC;AAGA,MAAM,gBAAwF;CAC5F,UAAUA,MAAU,mBAAmB;CACvC,eAAeA,MAAU,mBAAmB;CAC5C,gBAAgBA,MAAU,mBAAmB;CAC7C,OAAOA,MAAU,mBAAmB;CACpC,YAAYA,MAAU,mBAAmB;CACzC,aAAaA,MAAU,mBAAmB;AAC5C;AAMA,MAAM,eAAgE;CACpE,0BAAU,IAAI,IAAI;CAClB,+BAAe,IAAI,IAAI;CACvB,gCAAgB,IAAI,IAAI;CACxB,uBAAO,IAAI,IAAI;CACf,4BAAY,IAAI,IAAI;CACpB,6BAAa,IAAI,IAAI;AACvB;AAEA,MAAM,cAAc,aAA4B,cAAc;AAE9D,IAAI,iBAAiB;AACrB,MAAM,wBACJ,SAAS,KAAK,IAAI,CAAC,CAAC,SAA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.mjs","names":["BaseTooltip"],"sources":["../../../src/base-ui/Tooltip/TooltipGroup.tsx"],"sourcesContent":["'use client';\n\nimport { Tooltip as BaseTooltip } from '@base-ui/react/tooltip';\nimport { cx } from 'antd-style';\nimport { type FC, useCallback, useRef, useState } from 'react';\n\nimport { getFloatingCollisionPadding } from '@/base-ui/floating';\nimport { useFloatingLayer } from '@/hooks/useFloatingLayer';\nimport { useAppElement } from '@/ThemeProvider';\nimport {\n useDestroyOnInvalidActiveTriggerElement,\n useHidePopupWhenPositionerAtOrigin,\n usePopupHandleStore,\n} from '@/utils/destroyOnInvalidActiveTriggerElement';\nimport { placementMap } from '@/utils/placement';\nimport { useRepopOnFarTriggerSwitch } from '@/utils/useRepopOnFarTriggerSwitch';\n\nimport { TooltipArrowIcon } from './ArrowIcon';\nimport {\n TooltipGroupHandleContext,\n type TooltipGroupItem,\n TooltipGroupPropsContext,\n} from './groupContext';\nimport { styles } from './style';\nimport TooltipContent from './TooltipContent';\nimport { type TooltipGroupProps } from './type';\n\nconst TooltipGroup: FC<TooltipGroupProps> = ({\n children,\n disableDestroyOnInvalidTrigger = false,\n disableZeroOriginGuard = false,\n layoutAnimation = true,\n popupContainer,\n ...sharedProps\n}) => {\n const [{ handle, key }, setHandleState] = useState(() => ({\n handle: BaseTooltip.createHandle<TooltipGroupItem>(),\n key: 0,\n }));\n const activeItemRef = useRef<TooltipGroupItem | null>(null);\n\n const destroy = useCallback(() => {\n activeItemRef.current = null;\n setHandleState(({ key }) => ({\n handle: BaseTooltip.createHandle<TooltipGroupItem>(),\n key: key + 1,\n }));\n }, []);\n\n const handleOpenChange = useCallback((open: boolean) => {\n activeItemRef.current?.onOpenChange?.(open);\n }, []);\n\n const appElement = useAppElement();\n const floatingLayerContainer = useFloatingLayer();\n const portalContainer = floatingLayerContainer ?? appElement;\n\n const store = usePopupHandleStore(handle);\n useDestroyOnInvalidActiveTriggerElement(store, destroy, {\n enabled: !disableDestroyOnInvalidTrigger,\n });\n useHidePopupWhenPositionerAtOrigin(store, { enabled: !disableZeroOriginGuard });\n const repop = useRepopOnFarTriggerSwitch(store, { enabled: layoutAnimation });\n\n return (\n <TooltipGroupHandleContext value={handle}>\n <TooltipGroupPropsContext value={sharedProps}>\n {/* Outside Root on purpose: the handle/key reset remounts Root's subtree; children must\n survive it. Triggers bind to the group via the handle, not DOM nesting. */}\n {children}\n <BaseTooltip.Root handle={handle} key={key} onOpenChange={handleOpenChange}>\n {({ payload }) => {\n const item = (payload as TooltipGroupItem | null) ?? null;\n activeItemRef.current = item;\n\n if (!item || (item.title == null && !item.hotkey)) {\n return null;\n }\n\n const arrow = item.arrow ?? false;\n const placement = item.placement ?? 'top';\n const placementConfig = placementMap[placement] ?? placementMap.top;\n const baseSideOffset = arrow ? 8 : 6;\n\n const resolvedClassNames = {\n arrow: cx(styles.arrow, item.classNames?.arrow),\n popup: cx(\n styles.popup,\n item.className,\n item.classNames?.root,\n item.classNames?.container,\n ),\n positioner: styles.positioner,\n viewport: cx(styles.viewport, item.classNames?.content),\n };\n\n const resolvedStyleProps = (() => {\n if (typeof item.styles === 'function') return undefined;\n return item.styles;\n })();\n\n const resolvedStyles = {\n arrow: resolvedStyleProps?.arrow,\n popup: {\n ...resolvedStyleProps?.root,\n ...resolvedStyleProps?.container,\n },\n positioner: {\n zIndex: item.zIndex ?? 114_514,\n },\n viewport: resolvedStyleProps?.content,\n };\n\n const body = (\n <BaseTooltip.Viewport\n className={resolvedClassNames.viewport}\n data-repop={repop || undefined}\n style={resolvedStyles.viewport}\n >\n <TooltipContent\n hotkey={item.hotkey}\n hotkeyProps={item.hotkeyProps}\n title={item.title}\n />\n </BaseTooltip.Viewport>\n );\n\n const popup = (\n <BaseTooltip.Positioner\n align={placementConfig.align}\n className={resolvedClassNames.positioner}\n data-layout-animation={layoutAnimation || undefined}\n data-placement={placement}\n data-repop={repop || undefined}\n side={placementConfig.side}\n sideOffset={baseSideOffset}\n style={resolvedStyles.positioner}\n {...item.positionerProps}\n collisionPadding={\n item.positionerProps?.collisionPadding ?? getFloatingCollisionPadding()\n }\n >\n <BaseTooltip.Popup\n className={resolvedClassNames.popup}\n data-layout-animation={layoutAnimation || undefined}\n data-repop={repop || undefined}\n style={resolvedStyles.popup}\n {...item.popupProps}\n >\n {arrow && (\n <BaseTooltip.Arrow\n className={resolvedClassNames.arrow}\n style={resolvedStyles.arrow}\n >\n {TooltipArrowIcon}\n </BaseTooltip.Arrow>\n )}\n {body}\n </BaseTooltip.Popup>\n </BaseTooltip.Positioner>\n );\n\n const resolvedPortalContainer =\n item.popupContainer ?? popupContainer ?? portalContainer;\n\n return resolvedPortalContainer ? (\n <BaseTooltip.Portal container={resolvedPortalContainer}>{popup}</BaseTooltip.Portal>\n ) : null;\n }}\n </BaseTooltip.Root>\n </TooltipGroupPropsContext>\n </TooltipGroupHandleContext>\n );\n};\n\nTooltipGroup.displayName = 'TooltipGroup';\n\nexport default TooltipGroup;\n"],"mappings":";;;;;;;;;;;;;;;;AA2BA,MAAM,gBAAuC,EAC3C,UACA,iCAAiC,OACjC,yBAAyB,OACzB,kBAAkB,MAClB,gBACA,GAAG,kBACC;CACJ,MAAM,CAAC,EAAE,QAAQ,OAAO,kBAAkB,gBAAgB;EACxD,QAAQA,QAAY,aAA+B;EACnD,KAAK;CACP,EAAE;CACF,MAAM,gBAAgB,OAAgC,IAAI;CAE1D,MAAM,UAAU,kBAAkB;EAChC,cAAc,UAAU;EACxB,gBAAgB,EAAE,WAAW;GAC3B,QAAQA,QAAY,aAA+B;GACnD,KAAK,MAAM;EACb,EAAE;CACJ,GAAG,CAAC,CAAC;CAEL,MAAM,mBAAmB,aAAa,SAAkB;EACtD,cAAc,SAAS,eAAe,IAAI;CAC5C,GAAG,CAAC,CAAC;CAEL,MAAM,aAAa,cAAc;CAEjC,MAAM,kBADyB,iBACc,KAAK;CAElD,MAAM,QAAQ,oBAAoB,MAAM;CACxC,wCAAwC,OAAO,SAAS,EACtD,SAAS,CAAC,+BACZ,CAAC;CACD,mCAAmC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QAAY,YAAb;MACE,OAAO,gBAAgB;MACvB,WAAW,mBAAmB;MAC9B,yBAAuB,mBAAmB,KAAA;MAC1C,kBAAgB;MAChB,cAAY,SAAS,KAAA;MACrB,MAAM,gBAAgB;MACtB,YAAY;MACZ,OAAO,eAAe;MACtB,GAAI,KAAK;MACT,kBACE,KAAK,iBAAiB,oBAAoB,4BAA4B;MAGxE,UAAA,qBAACA,QAAY,OAAb;OACE,WAAW,mBAAmB;OAC9B,yBAAuB,mBAAmB,KAAA;OAC1C,cAAY,SAAS,KAAA;OACrB,OAAO,eAAe;OACtB,GAAI,KAAK;OALX,UAAA,CAOG,SACC,oBAACA,QAAY,OAAb;QACE,WAAW,mBAAmB;QAC9B,OAAO,eAAe;QAErB,UAAA;OACgB,CAAA,GAEpB,IACgB;;KACG,CAAA;KAG1B,MAAM,0BACJ,KAAK,kBAAkB,kBAAkB;KAE3C,OAAO,0BACL,oBAACA,QAAY,QAAb;MAAoB,WAAW;MAA0B,UAAA;KAA0B,CAAA,IACjF;IACN;GACgB,GAnGqB,GAmGrB,CACM;;CACD,CAAA;AAE/B;AAEA,aAAa,cAAc"}
|
|
1
|
+
{"version":3,"file":"TooltipGroup.mjs","names":["BaseTooltip"],"sources":["../../../src/base-ui/Tooltip/TooltipGroup.tsx"],"sourcesContent":["'use client';\n\nimport { Tooltip as BaseTooltip } from '@base-ui/react/tooltip';\nimport { cx } from 'antd-style';\nimport { type FC, useCallback, useRef, useState } from 'react';\n\nimport { getFloatingCollisionPadding } from '@/base-ui/floating';\nimport { useFloatingLayer } from '@/hooks/useFloatingLayer';\nimport { useAppElement } from '@/ThemeProvider/AppElementContext';\nimport {\n useDestroyOnInvalidActiveTriggerElement,\n useHidePopupWhenPositionerAtOrigin,\n usePopupHandleStore,\n} from '@/utils/destroyOnInvalidActiveTriggerElement';\nimport { placementMap } from '@/utils/placement';\nimport { useRepopOnFarTriggerSwitch } from '@/utils/useRepopOnFarTriggerSwitch';\n\nimport { TooltipArrowIcon } from './ArrowIcon';\nimport {\n TooltipGroupHandleContext,\n type TooltipGroupItem,\n TooltipGroupPropsContext,\n} from './groupContext';\nimport { styles } from './style';\nimport TooltipContent from './TooltipContent';\nimport { type TooltipGroupProps } from './type';\n\nconst TooltipGroup: FC<TooltipGroupProps> = ({\n children,\n disableDestroyOnInvalidTrigger = false,\n disableZeroOriginGuard = false,\n layoutAnimation = true,\n popupContainer,\n ...sharedProps\n}) => {\n const [{ handle, key }, setHandleState] = useState(() => ({\n handle: BaseTooltip.createHandle<TooltipGroupItem>(),\n key: 0,\n }));\n const activeItemRef = useRef<TooltipGroupItem | null>(null);\n\n const destroy = useCallback(() => {\n activeItemRef.current = null;\n setHandleState(({ key }) => ({\n handle: BaseTooltip.createHandle<TooltipGroupItem>(),\n key: key + 1,\n }));\n }, []);\n\n const handleOpenChange = useCallback((open: boolean) => {\n activeItemRef.current?.onOpenChange?.(open);\n }, []);\n\n const appElement = useAppElement();\n const floatingLayerContainer = useFloatingLayer();\n const portalContainer = floatingLayerContainer ?? appElement;\n\n const store = usePopupHandleStore(handle);\n useDestroyOnInvalidActiveTriggerElement(store, destroy, {\n enabled: !disableDestroyOnInvalidTrigger,\n });\n useHidePopupWhenPositionerAtOrigin(store, { enabled: !disableZeroOriginGuard });\n const repop = useRepopOnFarTriggerSwitch(store, { enabled: layoutAnimation });\n\n return (\n <TooltipGroupHandleContext value={handle}>\n <TooltipGroupPropsContext value={sharedProps}>\n {/* Outside Root on purpose: the handle/key reset remounts Root's subtree; children must\n survive it. Triggers bind to the group via the handle, not DOM nesting. */}\n {children}\n <BaseTooltip.Root handle={handle} key={key} onOpenChange={handleOpenChange}>\n {({ payload }) => {\n const item = (payload as TooltipGroupItem | null) ?? null;\n activeItemRef.current = item;\n\n if (!item || (item.title == null && !item.hotkey)) {\n return null;\n }\n\n const arrow = item.arrow ?? false;\n const placement = item.placement ?? 'top';\n const placementConfig = placementMap[placement] ?? placementMap.top;\n const baseSideOffset = arrow ? 8 : 6;\n\n const resolvedClassNames = {\n arrow: cx(styles.arrow, item.classNames?.arrow),\n popup: cx(\n styles.popup,\n item.className,\n item.classNames?.root,\n item.classNames?.container,\n ),\n positioner: styles.positioner,\n viewport: cx(styles.viewport, item.classNames?.content),\n };\n\n const resolvedStyleProps = (() => {\n if (typeof item.styles === 'function') return undefined;\n return item.styles;\n })();\n\n const resolvedStyles = {\n arrow: resolvedStyleProps?.arrow,\n popup: {\n ...resolvedStyleProps?.root,\n ...resolvedStyleProps?.container,\n },\n positioner: {\n zIndex: item.zIndex ?? 114_514,\n },\n viewport: resolvedStyleProps?.content,\n };\n\n const body = (\n <BaseTooltip.Viewport\n className={resolvedClassNames.viewport}\n data-repop={repop || undefined}\n style={resolvedStyles.viewport}\n >\n <TooltipContent\n hotkey={item.hotkey}\n hotkeyProps={item.hotkeyProps}\n title={item.title}\n />\n </BaseTooltip.Viewport>\n );\n\n const popup = (\n <BaseTooltip.Positioner\n align={placementConfig.align}\n className={resolvedClassNames.positioner}\n data-layout-animation={layoutAnimation || undefined}\n data-placement={placement}\n data-repop={repop || undefined}\n side={placementConfig.side}\n sideOffset={baseSideOffset}\n style={resolvedStyles.positioner}\n {...item.positionerProps}\n collisionPadding={\n item.positionerProps?.collisionPadding ?? getFloatingCollisionPadding()\n }\n >\n <BaseTooltip.Popup\n className={resolvedClassNames.popup}\n data-layout-animation={layoutAnimation || undefined}\n data-repop={repop || undefined}\n style={resolvedStyles.popup}\n {...item.popupProps}\n >\n {arrow && (\n <BaseTooltip.Arrow\n className={resolvedClassNames.arrow}\n style={resolvedStyles.arrow}\n >\n {TooltipArrowIcon}\n </BaseTooltip.Arrow>\n )}\n {body}\n </BaseTooltip.Popup>\n </BaseTooltip.Positioner>\n );\n\n const resolvedPortalContainer =\n item.popupContainer ?? popupContainer ?? portalContainer;\n\n return resolvedPortalContainer ? (\n <BaseTooltip.Portal container={resolvedPortalContainer}>{popup}</BaseTooltip.Portal>\n ) : null;\n }}\n </BaseTooltip.Root>\n </TooltipGroupP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ACgB;;KACG,CAAA;KAG1B,MAAM,0BACJ,KAAK,kBAAkB,kBAAkB;KAE3C,OAAO,0BACL,oBAACA,QAAY,QAAb;MAAoB,WAAW;MAA0B,UAAA;KAA0B,CAAA,IACjF;IACN;GACgB,GAnGqB,GAmGrB,CACM;;CACD,CAAA;AAE/B;AAEA,aAAa,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TooltipStandalone.mjs","names":["BaseTooltip"],"sources":["../../../src/base-ui/Tooltip/TooltipStandalone.tsx"],"sourcesContent":["'use client';\n\nimport { mergeProps } from '@base-ui/react/merge-props';\nimport { Tooltip as BaseTooltip } from '@base-ui/react/tooltip';\nimport { cx } from 'antd-style';\nimport {\n cloneElement,\n isValidElement,\n memo,\n type Ref,\n useCallback,\n useMemo,\n useState,\n} from 'react';\nimport { mergeRefs } from 'react-merge-refs';\n\nimport { getFloatingCollisionPadding } from '@/base-ui/floating';\nimport { useFloatingLayer } from '@/hooks/useFloatingLayer';\nimport { useIsClient } from '@/hooks/useIsClient';\nimport { useNativeButton } from '@/hooks/useNativeButton';\nimport { useAppElement } from '@/ThemeProvider';\nimport { placementMap } from '@/utils/placement';\n\nimport { TooltipArrowIcon } from './ArrowIcon';\nimport { styles } from './style';\nimport TooltipContent from './TooltipContent';\nimport { type TooltipProps } from './type';\n\nconst DEFAULT_OPEN_DELAY = 400;\nconst DEFAULT_CLOSE_DELAY = 100;\n\n/**\n * Tooltip component - displays small contextual hints on hover/focus\n * Compatible with Ant Design Tooltip-like API (subset)\n */\nexport const TooltipStandalone = memo<TooltipProps>(\n ({\n children,\n title,\n arrow = false,\n className,\n classNames,\n closeDelay,\n defaultOpen = false,\n disabled = false,\n getPopupContainer,\n hotkey,\n hotkeyProps,\n mouseEnterDelay,\n mouseLeaveDelay,\n onOpenChange,\n open,\n openDelay,\n placement = 'top',\n popupContainer,\n styles: styleProps,\n zIndex,\n ref: refProp,\n positionerProps,\n triggerProps,\n popupProps,\n portalProps,\n standalone: _standalone,\n ...restProps\n }) => {\n const isClient = useIsClient();\n const [uncontrolledOpen, setUncontrolledOpen] = useState(Boolean(defaultOpen));\n const [triggerNode, setTriggerNode] = useState<HTMLElement | null>(null);\n const triggerCallbackRef = useCallback((node: HTMLElement | null) => {\n if (node) setTriggerNode(node);\n }, []);\n\n const mergedOpen = open ?? uncontrolledOpen;\n const resolvedOpen = disabled ? false : mergedOpen;\n\n const handleOpenChange = useCallback(\n (nextOpen: boolean) => {\n if (disabled && nextOpen) return;\n onOpenChange?.(nextOpen);\n if (open === undefined) {\n setUncontrolledOpen(nextOpen);\n }\n },\n [disabled, onOpenChange, open],\n );\n\n const resolvedOpenDelay = useMemo(() => {\n if (openDelay !== undefined) return openDelay;\n if (mouseEnterDelay !== undefined) return mouseEnterDelay * 1000;\n return DEFAULT_OPEN_DELAY;\n }, [mouseEnterDelay, openDelay]);\n\n const resolvedCloseDelay = useMemo(() => {\n if (closeDelay !== undefined) return closeDelay;\n if (mouseLeaveDelay !== undefined) return mouseLeaveDelay * 1000;\n return DEFAULT_CLOSE_DELAY;\n }, [closeDelay, mouseLeaveDelay]);\n\n const placementConfig = placementMap[placement] ?? placementMap.top;\n const baseSideOffset = arrow ? 8 : 6;\n\n const appElement = useAppElement();\n const floatingLayerContainer = useFloatingLayer();\n const portalContainer = floatingLayerContainer ?? appElement;\n\n const { isNativeButtonTriggerElement } = useNativeButton({\n children,\n });\n\n const resolvedClassNames = useMemo(\n () => ({\n arrow: cx(styles.arrow, classNames?.arrow),\n popup: cx(styles.popup, className, classNames?.root, classNames?.container),\n positioner: styles.positioner,\n viewport: cx(styles.viewport, classNames?.content),\n }),\n [className, classNames?.arrow, classNames?.container, classNames?.content, classNames?.root],\n );\n\n const resolvedStyleProps = useMemo(() => {\n if (typeof styleProps === 'function') return undefined;\n return styleProps;\n }, [styleProps]);\n\n const resolvedStyles = useMemo(\n () => ({\n arrow: resolvedStyleProps?.arrow,\n popup: {\n ...resolvedStyleProps?.root,\n ...resolvedStyleProps?.container,\n },\n positioner: {\n zIndex: zIndex ?? 114_514,\n },\n viewport: resolvedStyleProps?.content,\n }),\n [resolvedStyleProps, zIndex],\n );\n\n const triggerElement = useMemo(() => {\n const popupTriggerId =\n isValidElement(children) &&\n (children as any).props['aria-haspopup'] !== undefined &&\n (children as any).props.id !== undefined\n ? (children as any).props.id\n : undefined;\n\n const baseTriggerProps = {\n closeDelay: resolvedCloseDelay,\n delay: resolvedOpenDelay,\n disabled,\n ...triggerProps,\n id: popupTriggerId ?? triggerProps?.id,\n };\n\n if (isValidElement(children)) {\n return (\n <BaseTooltip.Trigger\n {...baseTriggerProps}\n render={(props) => {\n // Base UI's trigger props include `type=\"button\"` by default.\n // If we render into a non-<button> element, that prop is invalid and can warn.\n const resolvedProps = (() => {\n if (isNativeButtonTriggerElement) return props as any;\n // eslint-disable-next-line unused-imports/no-unused-vars\n const { type, ref: triggerRef, ...triggerRest } = props as any;\n return triggerRest;\n })();\n\n const childProps = (children as any).props;\n const mergedProps = mergeProps(restProps, childProps, resolvedProps);\n const shouldPreservePopupTriggerId =\n childProps['aria-haspopup'] !== undefined && childProps.id !== undefined;\n\n return cloneElement(children as any, {\n ...mergedProps,\n id: shouldPreservePopupTriggerId ? childProps.id : mergedProps.id,\n ref: mergeRefs([\n (children as any).ref,\n (props as any).ref,\n refProp,\n triggerCallbackRef,\n ]),\n });\n }}\n />\n );\n }\n\n return (\n <BaseTooltip.Trigger\n {...baseTriggerProps}\n ref={mergeRefs([refProp, triggerCallbackRef]) as Ref<HTMLButtonElement>}\n >\n {children}\n </BaseTooltip.Trigger>\n );\n }, [\n children,\n disabled,\n isNativeButtonTriggerElement,\n refProp,\n resolvedCloseDelay,\n resolvedOpenDelay,\n restProps,\n triggerCallbackRef,\n triggerProps,\n ]);\n\n const customContainer = useMemo(() => {\n if (popupContainer) return popupContainer;\n if (!getPopupContainer || !isClient || !triggerNode) return undefined;\n return getPopupContainer(triggerNode);\n }, [popupContainer, getPopupContainer, isClient, triggerNode]);\n\n const popup = useMemo(\n () => (\n <BaseTooltip.Positioner\n align={placementConfig.align}\n className={resolvedClassNames.positioner}\n data-placement={placement}\n side={placementConfig.side}\n sideOffset={baseSideOffset}\n style={resolvedStyles.positioner}\n {...positionerProps}\n collisionPadding={positionerProps?.collisionPadding ?? getFloatingCollisionPadding()}\n >\n <BaseTooltip.Popup\n className={resolvedClassNames.popup}\n style={resolvedStyles.popup}\n {...popupProps}\n >\n {arrow && (\n <BaseTooltip.Arrow className={resolvedClassNames.arrow} style={resolvedStyles.arrow}>\n {TooltipArrowIcon}\n </BaseTooltip.Arrow>\n )}\n <BaseTooltip.Viewport\n className={resolvedClassNames.viewport}\n style={resolvedStyles.viewport}\n >\n <TooltipContent hotkey={hotkey} hotkeyProps={hotkeyProps} title={title} />\n </BaseTooltip.Viewport>\n </BaseTooltip.Popup>\n </BaseTooltip.Positioner>\n ),\n [\n arrow,\n baseSideOffset,\n hotkey,\n hotkeyProps,\n placement,\n placementConfig.align,\n placementConfig.side,\n popupProps,\n positionerProps,\n resolvedClassNames,\n resolvedStyles,\n title,\n ],\n );\n\n if (title == null && !hotkey) {\n return children;\n }\n\n const resolvedPortalContainer = customContainer ?? portalContainer;\n\n return (\n <BaseTooltip.Root\n defaultOpen={defaultOpen}\n disabled={disabled}\n open={resolvedOpen}\n onOpenChange={handleOpenChange}\n >\n {triggerElement}\n {resolvedPortalContainer ? (\n <BaseTooltip.Portal container={resolvedPortalContainer} {...portalProps}>\n {popup}\n </BaseTooltip.Portal>\n ) : null}\n </BaseTooltip.Root>\n );\n },\n);\n\nTooltipStandalone.displayName = 'TooltipStandalone';\n"],"mappings":";;;;;;;;;;;;;;;;;AA4BA,MAAM,qBAAqB;AAC3B,MAAM,sBAAsB;;;;;AAM5B,MAAa,oBAAoB,MAC9B,EACC,UACA,OACA,QAAQ,OACR,WACA,YACA,YACA,cAAc,OACd,WAAW,OACX,mBACA,QACA,aACA,iBACA,iBACA,cACA,MACA,WACA,YAAY,OACZ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ACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;CAED,MAAM,kBAAkB,cAAc;EACpC,IAAI,gBAAgB,OAAO;EAC3B,IAAI,CAAC,qBAAqB,CAAC,YAAY,CAAC,aAAa,OAAO,KAAA;EAC5D,OAAO,kBAAkB,WAAW;CACtC,GAAG;EAAC;EAAgB;EAAmB;EAAU;CAAW,CAAC;CAE7D,MAAM,QAAQ,cAEV,oBAACA,QAAY,YAAb;EACE,OAAO,gBAAgB;EACvB,WAAW,mBAAmB;EAC9B,kBAAgB;EAChB,MAAM,gBAAgB;EACtB,YAAY;EACZ,OAAO,eAAe;EACtB,GAAI;EACJ,kBAAkB,iBAAiB,oBAAoB,4BAA4B;EAEnF,UAAA,qBAACA,QAAY,OAAb;GACE,WAAW,mBAAmB;GAC9B,OAAO,eAAe;GACtB,GAAI;GAHN,UAAA,CAKG,SACC,oBAACA,QAAY,OAAb;IAAmB,WAAW,mBAAmB;IAAO,OAAO,eAAe;IAC3E,UAAA;GACgB,CAAA,GAErB,oBAACA,QAAY,UAAb;IACE,WAAW,mBAAmB;IAC9B,OAAO,eAAe;IAEtB,UAAA,oBAAC,gBAAD;KAAwB;KAAqB;KAAoB;IAAQ,CAAA;GACrD,CAAA,CACL;;CACG,CAAA,GAE1B;EACE;EACA;EACA;EACA;EACA;EACA,gBAAgB;EAChB,gBAAgB;EAChB;EACA;EACA;EACA;EACA;CACF,CACF;CAEA,IAAI,SAAS,QAAQ,CAAC,QACpB,OAAO;CAGT,MAAM,0BAA0B,mBAAmB;CAEnD,OACE,qBAACA,QAAY,MAAb;EACe;EACH;EACV,MAAM;EACN,cAAc;EAJhB,UAAA,CAMG,gBACA,0BACC,oBAACA,QAAY,QAAb;GAAoB,WAAW;GAAyB,GAAI;GACzD,UAAA;EACiB,CAAA,IAClB,IACY;;AAEtB,CACF;AAEA,kBAAkB,cAAc"}
|
|
1
|
+
{"version":3,"file":"TooltipStandalone.mjs","names":["BaseTooltip"],"sources":["../../../src/base-ui/Tooltip/TooltipStandalone.tsx"],"sourcesContent":["'use client';\n\nimport { mergeProps } from '@base-ui/react/merge-props';\nimport { Tooltip as BaseTooltip } from '@base-ui/react/tooltip';\nimport { cx } from 'antd-style';\nimport {\n cloneElement,\n isValidElement,\n memo,\n type Ref,\n useCallback,\n useMemo,\n useState,\n} from 'react';\nimport { mergeRefs } from 'react-merge-refs';\n\nimport { getFloatingCollisionPadding } from '@/base-ui/floating';\nimport { useFloatingLayer } from '@/hooks/useFloatingLayer';\nimport { useIsClient } from '@/hooks/useIsClient';\nimport { useNativeButton } from '@/hooks/useNativeButton';\nimport { useAppElement } from '@/ThemeProvider/AppElementContext';\nimport { placementMap } from '@/utils/placement';\n\nimport { TooltipArrowIcon } from './ArrowIcon';\nimport { styles } from './style';\nimport TooltipContent from './TooltipContent';\nimport { type TooltipProps } from './type';\n\nconst DEFAULT_OPEN_DELAY = 400;\nconst DEFAULT_CLOSE_DELAY = 100;\n\n/**\n * Tooltip component - displays small contextual hints on hover/focus\n * Compatible with Ant Design Tooltip-like API (subset)\n */\nexport const TooltipStandalone = memo<TooltipProps>(\n ({\n children,\n title,\n arrow = false,\n className,\n classNames,\n closeDelay,\n defaultOpen = false,\n disabled = false,\n getPopupContainer,\n hotkey,\n hotkeyProps,\n mouseEnterDelay,\n mouseLeaveDelay,\n onOpenChange,\n open,\n openDelay,\n placement = 'top',\n popupContainer,\n styles: styleProps,\n zIndex,\n ref: refProp,\n positionerProps,\n triggerProps,\n popupProps,\n portalProps,\n standalone: _standalone,\n ...restProps\n }) => {\n const isClient = useIsClient();\n const [uncontrolledOpen, setUncontrolledOpen] = useState(Boolean(defaultOpen));\n const [triggerNode, setTriggerNode] = useState<HTMLElement | null>(null);\n const triggerCallbackRef = useCallback((node: HTMLElement | null) => {\n if (node) setTriggerNode(node);\n }, []);\n\n const mergedOpen = open ?? uncontrolledOpen;\n const resolvedOpen = disabled ? false : mergedOpen;\n\n const handleOpenChange = useCallback(\n (nextOpen: boolean) => {\n if (disabled && nextOpen) return;\n onOpenChange?.(nextOpen);\n if (open === undefined) {\n setUncontrolledOpen(nextOpen);\n }\n },\n [disabled, onOpenChange, open],\n );\n\n const resolvedOpenDelay = useMemo(() => {\n if (openDelay !== undefined) return openDelay;\n if (mouseEnterDelay !== undefined) return mouseEnterDelay * 1000;\n return DEFAULT_OPEN_DELAY;\n }, [mouseEnterDelay, openDelay]);\n\n const resolvedCloseDelay = useMemo(() => {\n if (closeDelay !== undefined) return closeDelay;\n if (mouseLeaveDelay !== undefined) return mouseLeaveDelay * 1000;\n return DEFAULT_CLOSE_DELAY;\n }, [closeDelay, mouseLeaveDelay]);\n\n const placementConfig = placementMap[placement] ?? placementMap.top;\n const baseSideOffset = arrow ? 8 : 6;\n\n const appElement = useAppElement();\n const floatingLayerContainer = useFloatingLayer();\n const portalContainer = floatingLayerContainer ?? appElement;\n\n const { isNativeButtonTriggerElement } = useNativeButton({\n children,\n });\n\n const resolvedClassNames = useMemo(\n () => ({\n arrow: cx(styles.arrow, classNames?.arrow),\n popup: cx(styles.popup, className, classNames?.root, classNames?.container),\n positioner: styles.positioner,\n viewport: cx(styles.viewport, classNames?.content),\n }),\n [className, classNames?.arrow, classNames?.container, classNames?.content, classNames?.root],\n );\n\n const resolvedStyleProps = useMemo(() => {\n if (typeof styleProps === 'function') return undefined;\n return styleProps;\n }, [styleProps]);\n\n const resolvedStyles = useMemo(\n () => ({\n arrow: resolvedStyleProps?.arrow,\n popup: {\n ...resolvedStyleProps?.root,\n ...resolvedStyleProps?.container,\n },\n positioner: {\n zIndex: zIndex ?? 114_514,\n },\n viewport: resolvedStyleProps?.content,\n }),\n [resolvedStyleProps, zIndex],\n );\n\n const triggerElement = useMemo(() => {\n const popupTriggerId =\n isValidElement(children) &&\n (children as any).props['aria-haspopup'] !== undefined &&\n (children as any).props.id !== undefined\n ? (children as any).props.id\n : undefined;\n\n const baseTriggerProps = {\n closeDelay: resolvedCloseDelay,\n delay: resolvedOpenDelay,\n disabled,\n ...triggerProps,\n id: popupTriggerId ?? triggerProps?.id,\n };\n\n if (isValidElement(children)) {\n return (\n <BaseTooltip.Trigger\n {...baseTriggerProps}\n render={(props) => {\n // Base UI's trigger props include `type=\"button\"` by default.\n // If we render into a non-<button> element, that prop is invalid and can warn.\n const resolvedProps = (() => {\n if (isNativeButtonTriggerElement) return props as any;\n // eslint-disable-next-line unused-imports/no-unused-vars\n const { type, ref: triggerRef, ...triggerRest } = props as any;\n return triggerRest;\n })();\n\n const childProps = (children as any).props;\n const mergedProps = mergeProps(restProps, childProps, resolvedProps);\n const shouldPreservePopupTriggerId =\n childProps['aria-haspopup'] !== undefined && childProps.id !== undefined;\n\n return cloneElement(children as any, {\n ...mergedProps,\n id: shouldPreservePopupTriggerId ? childProps.id : mergedProps.id,\n ref: mergeRefs([\n (children as any).ref,\n (props as any).ref,\n refProp,\n triggerCallbackRef,\n ]),\n });\n }}\n />\n );\n }\n\n return (\n <BaseTooltip.Trigger\n {...baseTriggerProps}\n ref={mergeRefs([refProp, triggerCallbackRef]) as Ref<HTMLButtonElement>}\n >\n {children}\n </BaseTooltip.Trigger>\n );\n }, [\n children,\n disabled,\n isNativeButtonTriggerElement,\n refProp,\n resolvedCloseDelay,\n resolvedOpenDelay,\n restProps,\n triggerCallbackRef,\n triggerProps,\n ]);\n\n const customContainer = useMemo(() => {\n if (popupContainer) return popupContainer;\n if (!getPopupContainer || !isClient || !triggerNode) return undefined;\n return getPopupContainer(triggerNode);\n }, [popupContainer, getPopupContainer, isClient, triggerNode]);\n\n const popup = useMemo(\n () => (\n <BaseTooltip.Positioner\n align={placementConfig.align}\n className={resolvedClassNames.positioner}\n data-placement={placement}\n side={placementConfig.side}\n sideOffset={baseSideOffset}\n style={resolvedStyles.positioner}\n {...positionerProps}\n collisionPadding={positionerProps?.collisionPadding ?? getFloatingCollisionPadding()}\n >\n <BaseTooltip.Popup\n className={resolvedClassNames.popup}\n style={resolvedStyles.popup}\n {...popupProps}\n >\n {arrow && (\n <BaseTooltip.Arrow className={resolvedClassNames.arrow} style={resolvedStyles.arrow}>\n {TooltipArrowIcon}\n </BaseTooltip.Arrow>\n )}\n <BaseTooltip.Viewport\n className={resolvedClassNames.viewport}\n style={resolvedStyles.viewport}\n >\n <TooltipContent hotkey={hotkey} hotkeyProps={hotkeyProps} title={title} />\n </BaseTooltip.Viewport>\n </BaseTooltip.Popup>\n </BaseTooltip.Positioner>\n ),\n [\n arrow,\n baseSideOffset,\n hotkey,\n hotkeyProps,\n placement,\n placementConfig.align,\n placementConfig.side,\n popupProps,\n positionerProps,\n resolvedClassNames,\n resolvedStyles,\n title,\n ],\n );\n\n if (title == null && !hotkey) {\n return children;\n }\n\n const resolvedPortalContainer = customContainer ?? portalContainer;\n\n return (\n <BaseTooltip.Root\n defaultOpen={defaultOpen}\n disabled={disabled}\n open={resolvedOpen}\n onOpenChange={handleOpenChange}\n >\n {triggerElement}\n {resolvedPortalContainer ? (\n <BaseTooltip.Portal container={resolvedPortalContainer} {...portalProps}>\n {popup}\n </BaseTooltip.Portal>\n ) : null}\n </BaseTooltip.Root>\n );\n },\n);\n\nTooltipStandalone.displayName = 'TooltipStandalone';\n"],"mappings":";;;;;;;;;;;;;;;;;AA4BA,MAAM,qBAAqB;AAC3B,MAAM,sBAAsB;;;;;AAM5B,MAAa,oBAAoB,MAC9B,EACC,UACA,OACA,QAAQ,OACR,WACA,YACA,YACA,cAAc,OACd,WAAW,OACX,mBACA,QACA,aACA,iBACA,iBACA,cACA,MACA,WACA,YAAY,OACZ,gBACA,QAAQ,YACR,QACA,KAAK,SACL,iBACA,cACA,YACA,aACA,YAAY,aACZ,GAAG,gBACC;CACJ,MAAM,WAAW,YAAY;CAC7B,MAAM,CAAC,kBAAkB,uBAAuB,SAAS,QAAQ,WAAW,CAAC;CAC7E,MAAM,CAAC,aAAa,kBAAkB,SAA6B,IAAI;CACvE,MAAM,qBAAqB,aAAa,SAA6B;EACnE,IAAI,MAAM,eAAe,IAAI;CAC/B,GAAG,CAAC,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AO,gBAAgB;EACvB,WAAW,mBAAmB;EAC9B,kBAAgB;EAChB,MAAM,gBAAgB;EACtB,YAAY;EACZ,OAAO,eAAe;EACtB,GAAI;EACJ,kBAAkB,iBAAiB,oBAAoB,4BAA4B;EAEnF,UAAA,qBAACA,QAAY,OAAb;GACE,WAAW,mBAAmB;GAC9B,OAAO,eAAe;GACtB,GAAI;GAHN,UAAA,CAKG,SACC,oBAACA,QAAY,OAAb;IAAmB,WAAW,mBAAmB;IAAO,OAAO,eAAe;IAC3E,UAAA;GACgB,CAAA,GAErB,oBAACA,QAAY,UAAb;IACE,WAAW,mBAAmB;IAC9B,OAAO,eAAe;IAEtB,UAAA,oBAAC,gBAAD;KAAwB;KAAqB;KAAoB;IAAQ,CAAA;GACrD,CAAA,CACL;;CACG,CAAA,GAE1B;EACE;EACA;EACA;EACA;EACA;EACA,gBAAgB;EAChB,gBAAgB;EAChB;EACA;EACA;EACA;EACA;CACF,CACF;CAEA,IAAI,SAAS,QAAQ,CAAC,QACpB,OAAO;CAGT,MAAM,0BAA0B,mBAAmB;CAEnD,OACE,qBAACA,QAAY,MAAb;EACe;EACH;EACV,MAAM;EACN,cAAc;EAJhB,UAAA,CAMG,gBACA,0BACC,oBAACA,QAAY,QAAb;GAAoB,WAAW;GAAyB,GAAI;GACzD,UAAA;EACiB,CAAA,IAClB,IACY;;AAEtB,CACF;AAEA,kBAAkB,cAAc"}
|
package/es/base-ui/index.d.mts
CHANGED
|
@@ -20,6 +20,17 @@ import { ContextMenuTrigger } from "./ContextMenu/ContextMenuTrigger.mjs";
|
|
|
20
20
|
import { ContextMenuHost } from "./ContextMenu/ContextMenuHost.mjs";
|
|
21
21
|
import { ContextMenuInterceptor, closeContextMenu, setContextMenuInterceptor, showContextMenu, updateContextMenuItems } from "./ContextMenu/store.mjs";
|
|
22
22
|
import "./ContextMenu/index.mjs";
|
|
23
|
+
import { InputClassNames, InputNumberProps, InputOTPProps, InputPasswordProps, InputProps, InputSize, InputStyles, InputVariant, TextAreaAutoSize, TextAreaProps } from "./Input/type.mjs";
|
|
24
|
+
import Input from "./Input/Input.mjs";
|
|
25
|
+
import InputNumber from "./Input/InputNumber.mjs";
|
|
26
|
+
import InputOTP from "./Input/InputOTP.mjs";
|
|
27
|
+
import InputPassword from "./Input/InputPassword.mjs";
|
|
28
|
+
import { rootVariants, styles as styles$7 } from "./Input/style.mjs";
|
|
29
|
+
import TextArea from "./Input/TextArea.mjs";
|
|
30
|
+
import "./Input/index.mjs";
|
|
31
|
+
import { AvatarClassNames, AvatarGroupItemType, AvatarGroupProps, AvatarProps, AvatarStyles } from "./Avatar/type.mjs";
|
|
32
|
+
import AvatarGroup from "./Avatar/AvatarGroup/index.mjs";
|
|
33
|
+
import Avatar from "./Avatar/index.mjs";
|
|
23
34
|
import { PopoverArrowIcon } from "./Popover/ArrowIcon.mjs";
|
|
24
35
|
import { PopoverBackdropProps, PopoverPlacement, PopoverPopupProps, PopoverPortalProps, PopoverPositionerProps, PopoverProps, PopoverTrigger, PopoverTriggerComponentProps } from "./Popover/type.mjs";
|
|
25
36
|
import { PopoverArrow, PopoverArrowAtomProps, PopoverBackdrop, PopoverPopup, PopoverPopupAtomProps, PopoverPortal, PopoverPortalAtomProps, PopoverPositioner, PopoverPositionerAtomProps, PopoverRoot, PopoverTriggerElement, PopoverTriggerElementProps, PopoverViewport, PopoverViewportAtomProps } from "./Popover/atoms.mjs";
|
|
@@ -49,6 +60,15 @@ import { UploadChangeInfo, UploadProps } from "./Upload/type.mjs";
|
|
|
49
60
|
import Upload from "./Upload/Upload.mjs";
|
|
50
61
|
import UploadDragger from "./Upload/UploadDragger.mjs";
|
|
51
62
|
import "./Upload/index.mjs";
|
|
63
|
+
import { TagClassNames, TagProps, TagShape, TagSize, TagStyles, TagVariant } from "./Tag/type.mjs";
|
|
64
|
+
import Tag from "./Tag/Tag.mjs";
|
|
65
|
+
import { colorsPreset, colorsPresetSystem, presetColors, presetSystemColors } from "./Tag/utils.mjs";
|
|
66
|
+
import "./Tag/index.mjs";
|
|
67
|
+
import { TabsClassNames, TabsIndicatorProps, TabsItem, TabsListProps, TabsOrientation, TabsPanelProps, TabsProps, TabsRootProps, TabsSize, TabsStyles, TabsTabProps, TabsVariant } from "./Tabs/type.mjs";
|
|
68
|
+
import { styles as styles$11 } from "./Tabs/style.mjs";
|
|
69
|
+
import { TabsIndicator, TabsList, TabsPanel, TabsRoot, TabsTab, useTabsContext } from "./Tabs/atoms.mjs";
|
|
70
|
+
import Tabs from "./Tabs/Tabs.mjs";
|
|
71
|
+
import "./Tabs/index.mjs";
|
|
52
72
|
import { ScrollAreaProps } from "./ScrollArea/type.mjs";
|
|
53
73
|
import { ScrollArea } from "./ScrollArea/ScrollArea.mjs";
|
|
54
74
|
import "./ScrollArea/index.mjs";
|
|
@@ -64,26 +84,30 @@ import { AlertClassNames, AlertCloseConfig, AlertProps, AlertRef, AlertStyles, A
|
|
|
64
84
|
import Alert from "./Alert/Alert.mjs";
|
|
65
85
|
import { styles as styles$2 } from "./Alert/style.mjs";
|
|
66
86
|
import "./Alert/index.mjs";
|
|
67
|
-
import {
|
|
68
|
-
import
|
|
69
|
-
import
|
|
70
|
-
import InputOTP from "./Input/InputOTP.mjs";
|
|
71
|
-
import InputPassword from "./Input/InputPassword.mjs";
|
|
72
|
-
import { rootVariants, styles as styles$7 } from "./Input/style.mjs";
|
|
73
|
-
import TextArea from "./Input/TextArea.mjs";
|
|
74
|
-
import "./Input/index.mjs";
|
|
87
|
+
import { AnchorItem, AnchorProps } from "./Anchor/type.mjs";
|
|
88
|
+
import Anchor from "./Anchor/Anchor.mjs";
|
|
89
|
+
import "./Anchor/index.mjs";
|
|
75
90
|
import { AutoCompleteOption, AutoCompleteProps } from "./AutoComplete/type.mjs";
|
|
76
91
|
import AutoComplete from "./AutoComplete/AutoComplete.mjs";
|
|
77
92
|
import { styles as styles$3 } from "./AutoComplete/style.mjs";
|
|
78
93
|
import "./AutoComplete/index.mjs";
|
|
79
|
-
import {
|
|
80
|
-
import
|
|
81
|
-
import
|
|
94
|
+
import { BreadcrumbItem, BreadcrumbProps } from "./Breadcrumb/type.mjs";
|
|
95
|
+
import Breadcrumb from "./Breadcrumb/Breadcrumb.mjs";
|
|
96
|
+
import "./Breadcrumb/index.mjs";
|
|
97
|
+
import { ListClickInfo, ListDividerType, ListItem, ListItemType, ListProps, ListSemanticName } from "./List/type.mjs";
|
|
98
|
+
import List from "./List/List.mjs";
|
|
99
|
+
import "./List/index.mjs";
|
|
100
|
+
import { BurgerProps } from "./Burger/type.mjs";
|
|
101
|
+
import Burger from "./Burger/Burger.mjs";
|
|
102
|
+
import "./Burger/index.mjs";
|
|
82
103
|
import { ButtonIconPosition, ButtonOutdent, ButtonProps, ButtonShape, ButtonSize, ButtonType } from "./Button/type.mjs";
|
|
83
104
|
import Button from "./Button/Button.mjs";
|
|
84
105
|
import _default, { SplitButtonMenuProps, SplitButtonProps } from "./Button/SplitButton.mjs";
|
|
85
106
|
import { buttonPaddingInline, styles as styles$4 } from "./Button/style.mjs";
|
|
86
107
|
import "./Button/index.mjs";
|
|
108
|
+
import { CarouselProps, CarouselRef } from "./Carousel/type.mjs";
|
|
109
|
+
import Carousel from "./Carousel/Carousel.mjs";
|
|
110
|
+
import "./Carousel/index.mjs";
|
|
87
111
|
import { CheckboxGroupOption, CheckboxGroupProps, CheckboxProps, CheckboxShape } from "./Checkbox/type.mjs";
|
|
88
112
|
import Checkbox from "./Checkbox/Checkbox.mjs";
|
|
89
113
|
import CheckboxGroup from "./Checkbox/CheckboxGroup.mjs";
|
|
@@ -92,7 +116,21 @@ import "./Checkbox/index.mjs";
|
|
|
92
116
|
import { CollapsibleProps } from "./Collapsible/type.mjs";
|
|
93
117
|
import Collapsible from "./Collapsible/Collapsible.mjs";
|
|
94
118
|
import "./Collapsible/index.mjs";
|
|
119
|
+
import { ColorPickerProps } from "./ColorPicker/type.mjs";
|
|
120
|
+
import ColorPicker from "./ColorPicker/ColorPicker.mjs";
|
|
121
|
+
import "./ColorPicker/index.mjs";
|
|
95
122
|
import { ControlSize, controlHeight } from "./controlSize.mjs";
|
|
123
|
+
import { CalendarMode } from "./DatePicker/calendar.mjs";
|
|
124
|
+
import { DatePickerProps, DateRangePickerProps, DateRangeValue } from "./DatePicker/type.mjs";
|
|
125
|
+
import DatePicker from "./DatePicker/DatePicker.mjs";
|
|
126
|
+
import DateRangePicker from "./DatePicker/DateRangePicker.mjs";
|
|
127
|
+
import "./DatePicker/index.mjs";
|
|
128
|
+
import { DescriptionsItem, DescriptionsProps } from "./Descriptions/type.mjs";
|
|
129
|
+
import Descriptions from "./Descriptions/Descriptions.mjs";
|
|
130
|
+
import "./Descriptions/index.mjs";
|
|
131
|
+
import { DividerOrientation, DividerProps } from "./Divider/type.mjs";
|
|
132
|
+
import Divider from "./Divider/Divider.mjs";
|
|
133
|
+
import "./Divider/index.mjs";
|
|
96
134
|
import { DraggablePanelBody, DraggablePanelBodyProps, DraggablePanelContainer, DraggablePanelContainerProps, DraggablePanelContent, DraggablePanelContentProps, DraggablePanelFooter, DraggablePanelFooterProps, DraggablePanelHandle, DraggablePanelHandleProps, DraggablePanelHeader, DraggablePanelHeaderProps, DraggablePanelRoot, DraggablePanelRootProps, DraggablePanelToggle, DraggablePanelToggleProps } from "./DraggablePanel/atoms.mjs";
|
|
97
135
|
import { useDraggablePanelContext } from "./DraggablePanel/context.mjs";
|
|
98
136
|
import { DraggablePanelPlacement, DraggablePanelProps, DraggablePanelSize } from "./DraggablePanel/type.mjs";
|
|
@@ -133,11 +171,17 @@ import FormSubmitFooter from "./Form/components/FormSubmitFooter.mjs";
|
|
|
133
171
|
import FormTitle from "./Form/components/FormTitle.mjs";
|
|
134
172
|
import { useFormContext } from "./Form/context.mjs";
|
|
135
173
|
import { Form } from "./Form/index.mjs";
|
|
174
|
+
import { QRCodeErrorLevel, QRCodeProps, QRCodeStatus } from "./QRCode/type.mjs";
|
|
175
|
+
import QRCode from "./QRCode/QRCode.mjs";
|
|
176
|
+
import "./QRCode/index.mjs";
|
|
136
177
|
import { RadioGroupOption, RadioGroupProps, RadioProps } from "./Radio/type.mjs";
|
|
137
178
|
import Radio from "./Radio/Radio.mjs";
|
|
138
179
|
import RadioGroup from "./Radio/RadioGroup.mjs";
|
|
139
180
|
import { styles as styles$8 } from "./Radio/style.mjs";
|
|
140
181
|
import "./Radio/index.mjs";
|
|
182
|
+
import { RateProps } from "./Rate/type.mjs";
|
|
183
|
+
import Rate from "./Rate/Rate.mjs";
|
|
184
|
+
import "./Rate/index.mjs";
|
|
141
185
|
import { SegmentedClassNames, SegmentedOption, SegmentedOptions, SegmentedOrientation, SegmentedProps, SegmentedSize, SegmentedStyles, SegmentedVariant } from "./Segmented/type.mjs";
|
|
142
186
|
import { SegmentedIndicator, SegmentedIndicatorProps, SegmentedItem, SegmentedItemIcon, SegmentedItemLabel, SegmentedItemProps, SegmentedRoot, SegmentedRootProps } from "./Segmented/atoms.mjs";
|
|
143
187
|
import Segmented from "./Segmented/Segmented.mjs";
|
|
@@ -155,20 +199,21 @@ import Slider from "./Slider/Slider.mjs";
|
|
|
155
199
|
import SliderWithInput from "./Slider/SliderWithInput.mjs";
|
|
156
200
|
import { styles as styles$9 } from "./Slider/style.mjs";
|
|
157
201
|
import "./Slider/index.mjs";
|
|
202
|
+
import { formatStatisticValue } from "./Statistic/formatValue.mjs";
|
|
203
|
+
import { StatisticProps } from "./Statistic/type.mjs";
|
|
204
|
+
import Statistic from "./Statistic/Statistic.mjs";
|
|
205
|
+
import "./Statistic/index.mjs";
|
|
206
|
+
import { StepItem, StepStatus, StepsProps } from "./Steps/type.mjs";
|
|
207
|
+
import Steps from "./Steps/Steps.mjs";
|
|
208
|
+
import "./Steps/index.mjs";
|
|
158
209
|
import { SwitchChangeEventHandler, SwitchClassNames, SwitchClickEventHandler, SwitchContextType, SwitchIconPosition, SwitchIconProps, SwitchProps, SwitchRootProps, SwitchSize, SwitchStyles, SwitchThumbProps } from "./Switch/type.mjs";
|
|
159
210
|
import { styles as styles$10 } from "./Switch/style.mjs";
|
|
160
211
|
import { SwitchIcon, SwitchRoot, SwitchThumb, useSwitchContext } from "./Switch/atoms.mjs";
|
|
161
212
|
import Switch from "./Switch/Switch.mjs";
|
|
162
213
|
import "./Switch/index.mjs";
|
|
163
|
-
import {
|
|
164
|
-
import
|
|
165
|
-
import
|
|
166
|
-
import Tabs from "./Tabs/Tabs.mjs";
|
|
167
|
-
import "./Tabs/index.mjs";
|
|
168
|
-
import { TagClassNames, TagProps, TagShape, TagSize, TagStyles, TagVariant } from "./Tag/type.mjs";
|
|
169
|
-
import Tag from "./Tag/Tag.mjs";
|
|
170
|
-
import { colorsPreset, colorsPresetSystem, presetColors, presetSystemColors } from "./Tag/utils.mjs";
|
|
171
|
-
import "./Tag/index.mjs";
|
|
214
|
+
import { FilterValue, SortOrder, TableColumn, TableFilters, TablePaginationConfig, TableProps, TableSemanticName, TableSorterResult } from "./Table/type.mjs";
|
|
215
|
+
import Table from "./Table/Table.mjs";
|
|
216
|
+
import "./Table/index.mjs";
|
|
172
217
|
import { groupStyles, styles as styles$12, variants } from "./Text/style.mjs";
|
|
173
218
|
import { TextClassNames, TextProps, TextStyles } from "./Text/type.mjs";
|
|
174
219
|
import Text from "./Text/Text.mjs";
|
|
@@ -183,4 +228,4 @@ import { TreeClassNames, TreeDataNode, TreeFlatRow, TreeProps, TreeStyles } from
|
|
|
183
228
|
import Tree from "./Tree/Tree.mjs";
|
|
184
229
|
import { conductCheck, flattenVisible, getAllKeys } from "./Tree/utils.mjs";
|
|
185
230
|
import "./Tree/index.mjs";
|
|
186
|
-
export { Accordion, type AccordionClassNames, AccordionHeader, type AccordionHeaderProps, type AccordionIndicatorPlacement, AccordionItem, type AccordionItemProps, type AccordionItemType, AccordionPanel, type AccordionPanelProps, type AccordionProps, AccordionRoot, type AccordionRootProps, type AccordionStyles, AccordionTrigger, type AccordionTriggerProps, type AccordionVariant, ActionIcon, type ActionIconClassNames, type ActionIconOutdent, type ActionIconProps, type ActionIconSize, type ActionIconStyles, type ActionIconVariant, Alert, type AlertClassNames, type AlertCloseConfig, type AlertProps, type AlertRef, type AlertStyles, type AlertType, type AlertVariant, AutoComplete, type AutoCompleteOption, type AutoCompleteProps, Avatar, type AvatarClassNames, AvatarGroup, type AvatarGroupItemType, type AvatarGroupProps, type AvatarProps, type AvatarStyles, Badge, type BadgeProps, type BadgeSize, type BadgeStatus, type BaseModalProps, Button, type ButtonIconPosition, type ButtonOutdent, type ButtonProps, type ButtonShape, type ButtonSize, type ButtonType, Checkbox, CheckboxGroup, type CheckboxGroupOption, type CheckboxGroupProps, type CheckboxProps, type CheckboxShape, Collapsible, type CollapsibleProps, type ContextMenuCheckboxItem, ContextMenuHost, type ContextMenuInterceptor, type ContextMenuItem, ContextMenuTrigger, type ControlSize, DraggablePanel, DraggablePanelBody, type DraggablePanelBodyProps, DraggablePanelContainer, type DraggablePanelContainerProps, DraggablePanelContent, type DraggablePanelContentProps, DraggablePanelFooter, type DraggablePanelFooterProps, DraggablePanelHandle, type DraggablePanelHandleProps, DraggablePanelHeader, type DraggablePanelHeaderProps, type DraggablePanelPlacement, type DraggablePanelProps, DraggablePanelRoot, type DraggablePanelRootProps, type DraggablePanelSize, DraggablePanelToggle, type DraggablePanelToggleProps, Drawer, DrawerBackdrop, type DrawerBackdropProps, DrawerClose, type DrawerCloseProps, DrawerContent, type DrawerContentProps, DrawerDescription, type DrawerDescriptionProps, DrawerFooter, type DrawerFooterProps, DrawerHeader, type DrawerHeaderProps, type DrawerPlacement, DrawerPopup, type DrawerPopupProps, DrawerPortal, type DrawerPortalProps, type DrawerProps, type DrawerPush, DrawerRoot, type DrawerRootProps, type DrawerSemanticNames, type DrawerSemanticStyles, DrawerTitle, type DrawerTitleProps, DrawerTrigger, type DrawerTriggerProps, type DropdownItem, DropdownMenu, type DropdownMenuCheckboxItem, DropdownMenuCheckboxItemIndicator, DropdownMenuCheckboxItemPrimitive, type DropdownMenuCheckboxItemProps, DropdownMenuFooter, type DropdownMenuFooterProps, DropdownMenuGroup, DropdownMenuGroupLabel, type DropdownMenuGroupLabelProps, DropdownMenuHeader, type DropdownMenuHeaderProps, DropdownMenuItem, DropdownMenuItemContent, type DropdownMenuItemContentProps, DropdownMenuItemDesc, type DropdownMenuItemDescProps, DropdownMenuItemExtra, type DropdownMenuItemExtraProps, DropdownMenuItemIcon, type DropdownMenuItemIconProps, DropdownMenuItemLabel, DropdownMenuItemLabelGroup, type DropdownMenuItemLabelGroupProps, type DropdownMenuItemLabelProps, type DropdownMenuItemProps, type DropdownMenuPlacement, DropdownMenuPopup, type DropdownMenuPopupProps, DropdownMenuPortal, type DropdownMenuPortalProps, DropdownMenuPositioner, type DropdownMenuPositionerProps, type DropdownMenuProps, DropdownMenuRoot, DropdownMenuScrollViewport, type DropdownMenuScrollViewportProps, DropdownMenuSeparator, type DropdownMenuSeparatorProps, DropdownMenuSubmenuArrow, type DropdownMenuSubmenuArrowProps, DropdownMenuSubmenuRoot, DropdownMenuSubmenuTrigger, type DropdownMenuSubmenuTriggerProps, DropdownMenuSwitchItem, type DropdownMenuSwitchItemProps, type DropdownMenuSwitchItem$1 as DropdownMenuSwitchItemType, DropdownMenuTrigger, type DropdownMenuTriggerProps, type FloatingCollisionPadding, FloatingPanel, type FloatingPanelOffset, type FloatingPanelPlacement, type FloatingPanelProps, FloatingSheet, type FloatingSheetProps, FocusScope, type FocusScopeProps, Form, type FormContextValue, FormDivider, type FormDividerProps, FormField, type FormFieldProps, FormFlatGroup, type FormFlatGroupProps, FormFooter, type FormFooterProps, FormGroup, type FormGroupItemType, type FormGroupProps, type FormLayout, type FormProps, FormSubmitFooter, type FormSubmitFooterProps, FormTitle, type FormTitleProps, type FormValues, type FormVariant, type IconSpaceMode, type ImperativeModalProps, Input, type InputClassNames, InputNumber, type InputNumberProps, InputOTP, type InputOTPProps, InputPassword, type InputPasswordProps, type InputProps, type InputSize, type InputStyles, type InputVariant, type ItemsType, Modal, ModalBackdrop, type ModalBackdropProps, ModalClose, type ModalCloseProps, type ModalComponentProps, type ModalConfirmConfig, ModalContent, type ModalContentProps, ModalContext, type ModalContextValue, ModalDescription, type ModalDescriptionProps, ModalFooter, type ModalFooterProps, ModalHeader, type ModalHeaderProps, ModalHost, type ModalHostProps, type ModalInstance, ModalPopup, type ModalPopupProps, ModalPortal, type ModalPortalProps, ModalRoot, type ModalRootProps, type ModalSystem, ModalTitle, type ModalTitleProps, ModalTrigger, type ModalTriggerProps, ModalViewport, type ModalViewportProps, Pagination, type PaginationProps, type PaginationSize, Popover, PopoverArrow, type PopoverArrowAtomProps, PopoverArrowIcon, PopoverBackdrop, type PopoverBackdropProps, type PopoverContextValue, PopoverGroup, type PopoverGroupHandle, type PopoverGroupItem, type PopoverPlacement, PopoverPopup, type PopoverPopupAtomProps, type PopoverPopupProps, PopoverPortal, type PopoverPortalAtomProps, type PopoverPortalProps, PopoverPositioner, type PopoverPositionerAtomProps, type PopoverPositionerProps, type PopoverProps, PopoverProvider, PopoverRoot, type PopoverTrigger, type PopoverTriggerComponentProps, PopoverTriggerElement, type PopoverTriggerElementProps, PopoverViewport, type PopoverViewportAtomProps, Progress, type ProgressProps, type ProgressSize, type ProgressStatus, type ProgressType, type ProgressVariant, Radio, RadioGroup, type RadioGroupOption, type RadioGroupProps, type RadioProps, Result, type ResultProps, type ResultStatus, ScrollArea, ScrollAreaContent, type ScrollAreaContentProps, ScrollAreaCorner, type ScrollAreaCornerProps, type ScrollAreaProps, ScrollAreaRoot, type ScrollAreaRootProps, ScrollAreaScrollbar, type ScrollAreaScrollbarProps, ScrollAreaThumb, type ScrollAreaThumbProps, ScrollAreaViewport, type ScrollAreaViewportProps, Segmented, type SegmentedClassNames, SegmentedIndicator, type SegmentedIndicatorProps, SegmentedItem, SegmentedItemIcon, SegmentedItemLabel, type SegmentedItemProps, type SegmentedOption, type SegmentedOptions, type SegmentedOrientation, type SegmentedProps, SegmentedRoot, type SegmentedRootProps, type SegmentedSize, type SegmentedStyles, type SegmentedVariant, Select, SelectArrow, type SelectArrowProps, SelectBackdrop, type SelectBehaviorVariant, type SelectClassNames, SelectGroup, SelectGroupLabel, type SelectGroupLabelProps, type SelectGroupProps, SelectIcon, type SelectIconProps, type SelectIndicatorVariant, SelectItem, SelectItemIndicator, type SelectItemIndicatorProps, type SelectItemProps, SelectItemText, type SelectItemTextProps, SelectList, type SelectListProps, type SelectOption, type SelectOptionGroup, type SelectOptions, SelectPopup, type SelectPopupProps, SelectPortal, type SelectPortalProps, SelectPositioner, type SelectPositionerProps, type SelectProps, SelectRoot, type SelectRootChangeEventDetails, SelectScrollDownArrow, type SelectScrollDownArrowProps, SelectScrollUpArrow, type SelectScrollUpArrowProps, SelectSeparator, type SelectSize, SelectTrigger, type SelectTriggerProps, SelectValue, type SelectValueProps, type SelectVariant, Skeleton, type SkeletonAnimation, SkeletonAvatar, type SkeletonAvatarProps, type SkeletonProps, SkeletonText, type SkeletonTextProps, Slider, type SliderProps, SliderWithInput, type SliderWithInputProps, Spin, type SpinProps, type SpinSize, type SpinVariant, _default as SplitButton, type SplitButtonMenuProps, type SplitButtonProps, Switch, type SwitchChangeEventHandler, type SwitchClassNames, type SwitchClickEventHandler, type SwitchContextType, SwitchIcon, type SwitchIconPosition, type SwitchIconProps, type SwitchProps, SwitchRoot, type SwitchRootProps, type SwitchSize, type SwitchStyles, SwitchThumb, type SwitchThumbProps, Tabs, type TabsClassNames, TabsIndicator, type TabsIndicatorProps, type TabsItem, TabsList, type TabsListProps, type TabsOrientation, TabsPanel, type TabsPanelProps, type TabsProps, TabsRoot, type TabsRootProps, type TabsSize, type TabsStyles, TabsTab, type TabsTabProps, type TabsVariant, Tag, type TagClassNames, type TagProps, type TagShape, type TagSize, type TagStyles, type TagVariant, Text, TextArea, type TextAreaAutoSize, type TextAreaProps, type TextClassNames, type TextProps, type TextStyles, type ToastAPI, ToastHost, type ToastHostProps, type ToastInstance, type ToastOptions, type ToastPosition, type ToastPromiseOptions, type ToastProps, type ToastType, ToggleGroup, type ToggleGroupClassNames, ToggleGroupItem, ToggleGroupItemIcon, ToggleGroupItemLabel, type ToggleGroupItemProps, type ToggleGroupOption, type ToggleGroupProps, ToggleGroupRoot, type ToggleGroupRootProps, type ToggleGroupSize, type ToggleGroupStyles, type ToggleGroupVariant, Tooltip, TooltipGroup, type TooltipGroupProps, type TooltipPlacement, type TooltipPopupComponentProps, type TooltipPortalProps, type TooltipPositionerProps, type TooltipProps, type TooltipTriggerComponentProps, Tree, type TreeClassNames, type TreeDataNode, type TreeFlatRow, type TreeProps, type TreeStyles, Upload, type UploadChangeInfo, UploadDragger, type UploadProps, type UseScopeArrowNavOptions, type UseScopeSwitcherOptions, type VirtualListProps, styles as accordionStyles, styles$1 as actionIconStyles, styles$2 as alertStyles, styles$3 as autoCompleteStyles, backdropTransition, buttonPaddingInline, styles$4 as buttonStyles, styles$5 as checkboxStyles, closeContextMenu, colorsPreset, colorsPresetSystem, conductCheck, confirmModal, controlHeight, createModal, createModalSystem, drawerBackdropTransition, flattenVisible, focusScopeItem, styles$6 as focusScopeStyles, getActiveScopeId, getAllKeys, getDrawerMotionConfig, getFloatingCollisionPadding, getLastFocusedItem, styles$7 as inputStyles, rootVariants as inputVariants, modalMotionConfig, notifyScopeItemFocus, parseTrigger, presetColors, presetSystemColors, styles$8 as radioStyles, registerScope, renderDropdownMenuItems, setActiveScope, setContextMenuInterceptor, setFloatingCollisionPadding, setLastFocusedItem, showContextMenu, styles$9 as sliderStyles, styles$10 as switchStyles, styles$11 as tabsStyles, groupStyles as textGroupStyles, styles$12 as textStyles, variants as textVariants, toast, styles$13 as toggleGroupStyles, styles$14 as treeStyles, updateContextMenuItems, useAccordionContext, useActiveScopeId, useDraggablePanelContext, useDrawerActions, useDrawerOpen, useFocusScopeActive, useFocusScopeId, useFormContext, useModalActions, useModalContext, useModalOpen, usePopoverContext, usePopoverGroupHandle, usePopoverPortalContainer, useScopeArrowNav, useScopeSwitcher, useSwitchContext, useTabsContext, useToast };
|
|
231
|
+
export { Accordion, type AccordionClassNames, AccordionHeader, type AccordionHeaderProps, type AccordionIndicatorPlacement, AccordionItem, type AccordionItemProps, type AccordionItemType, AccordionPanel, type AccordionPanelProps, type AccordionProps, AccordionRoot, type AccordionRootProps, type AccordionStyles, AccordionTrigger, type AccordionTriggerProps, type AccordionVariant, ActionIcon, type ActionIconClassNames, type ActionIconOutdent, type ActionIconProps, type ActionIconSize, type ActionIconStyles, type ActionIconVariant, Alert, type AlertClassNames, type AlertCloseConfig, type AlertProps, type AlertRef, type AlertStyles, type AlertType, type AlertVariant, Anchor, type AnchorItem, type AnchorProps, AutoComplete, type AutoCompleteOption, type AutoCompleteProps, Avatar, type AvatarClassNames, AvatarGroup, type AvatarGroupItemType, type AvatarGroupProps, type AvatarProps, type AvatarStyles, Badge, type BadgeProps, type BadgeSize, type BadgeStatus, type BaseModalProps, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, Burger, type BurgerProps, Button, type ButtonIconPosition, type ButtonOutdent, type ButtonProps, type ButtonShape, type ButtonSize, type ButtonType, type CalendarMode, Carousel, type CarouselProps, type CarouselRef, Checkbox, CheckboxGroup, type CheckboxGroupOption, type CheckboxGroupProps, type CheckboxProps, type CheckboxShape, Collapsible, type CollapsibleProps, ColorPicker, type ColorPickerProps, type ContextMenuCheckboxItem, ContextMenuHost, type ContextMenuInterceptor, type ContextMenuItem, ContextMenuTrigger, type ControlSize, DatePicker, type DatePickerProps, DateRangePicker, type DateRangePickerProps, type DateRangeValue, Descriptions, type DescriptionsItem, type DescriptionsProps, Divider, type DividerOrientation, type DividerProps, DraggablePanel, DraggablePanelBody, type DraggablePanelBodyProps, DraggablePanelContainer, type DraggablePanelContainerProps, DraggablePanelContent, type DraggablePanelContentProps, DraggablePanelFooter, type DraggablePanelFooterProps, DraggablePanelHandle, type DraggablePanelHandleProps, DraggablePanelHeader, type DraggablePanelHeaderProps, type DraggablePanelPlacement, type DraggablePanelProps, DraggablePanelRoot, type DraggablePanelRootProps, type DraggablePanelSize, DraggablePanelToggle, type DraggablePanelToggleProps, Drawer, DrawerBackdrop, type DrawerBackdropProps, DrawerClose, type DrawerCloseProps, DrawerContent, type DrawerContentProps, DrawerDescription, type DrawerDescriptionProps, DrawerFooter, type DrawerFooterProps, DrawerHeader, type DrawerHeaderProps, type DrawerPlacement, DrawerPopup, type DrawerPopupProps, DrawerPortal, type DrawerPortalProps, type DrawerProps, type DrawerPush, DrawerRoot, type DrawerRootProps, type DrawerSemanticNames, type DrawerSemanticStyles, DrawerTitle, type DrawerTitleProps, DrawerTrigger, type DrawerTriggerProps, type DropdownItem, DropdownMenu, type DropdownMenuCheckboxItem, DropdownMenuCheckboxItemIndicator, DropdownMenuCheckboxItemPrimitive, type DropdownMenuCheckboxItemProps, DropdownMenuFooter, type DropdownMenuFooterProps, DropdownMenuGroup, DropdownMenuGroupLabel, type DropdownMenuGroupLabelProps, DropdownMenuHeader, type DropdownMenuHeaderProps, DropdownMenuItem, DropdownMenuItemContent, type DropdownMenuItemContentProps, DropdownMenuItemDesc, type DropdownMenuItemDescProps, DropdownMenuItemExtra, type DropdownMenuItemExtraProps, DropdownMenuItemIcon, type DropdownMenuItemIconProps, DropdownMenuItemLabel, DropdownMenuItemLabelGroup, type DropdownMenuItemLabelGroupProps, type DropdownMenuItemLabelProps, type DropdownMenuItemProps, type DropdownMenuPlacement, DropdownMenuPopup, type DropdownMenuPopupProps, DropdownMenuPortal, type DropdownMenuPortalProps, DropdownMenuPositioner, type DropdownMenuPositionerProps, type DropdownMenuProps, DropdownMenuRoot, DropdownMenuScrollViewport, type DropdownMenuScrollViewportProps, DropdownMenuSeparator, type DropdownMenuSeparatorProps, DropdownMenuSubmenuArrow, type DropdownMenuSubmenuArrowProps, DropdownMenuSubmenuRoot, DropdownMenuSubmenuTrigger, type DropdownMenuSubmenuTriggerProps, DropdownMenuSwitchItem, type DropdownMenuSwitchItemProps, type DropdownMenuSwitchItem$1 as DropdownMenuSwitchItemType, DropdownMenuTrigger, type DropdownMenuTriggerProps, type FilterValue, type FloatingCollisionPadding, FloatingPanel, type FloatingPanelOffset, type FloatingPanelPlacement, type FloatingPanelProps, FloatingSheet, type FloatingSheetProps, FocusScope, type FocusScopeProps, Form, type FormContextValue, FormDivider, type FormDividerProps, FormField, type FormFieldProps, FormFlatGroup, type FormFlatGroupProps, FormFooter, type FormFooterProps, FormGroup, type FormGroupItemType, type FormGroupProps, type FormLayout, type FormProps, FormSubmitFooter, type FormSubmitFooterProps, FormTitle, type FormTitleProps, type FormValues, type FormVariant, type IconSpaceMode, type ImperativeModalProps, Input, type InputClassNames, InputNumber, type InputNumberProps, InputOTP, type InputOTPProps, InputPassword, type InputPasswordProps, type InputProps, type InputSize, type InputStyles, type InputVariant, type ItemsType, List, type ListClickInfo, type ListDividerType, type ListItem, type ListItemType, type ListProps, type ListSemanticName, Modal, ModalBackdrop, type ModalBackdropProps, ModalClose, type ModalCloseProps, type ModalComponentProps, type ModalConfirmConfig, ModalContent, type ModalContentProps, ModalContext, type ModalContextValue, ModalDescription, type ModalDescriptionProps, ModalFooter, type ModalFooterProps, ModalHeader, type ModalHeaderProps, ModalHost, type ModalHostProps, type ModalInstance, ModalPopup, type ModalPopupProps, ModalPortal, type ModalPortalProps, ModalRoot, type ModalRootProps, type ModalSystem, ModalTitle, type ModalTitleProps, ModalTrigger, type ModalTriggerProps, ModalViewport, type ModalViewportProps, Pagination, type PaginationProps, type PaginationSize, Popover, PopoverArrow, type PopoverArrowAtomProps, PopoverArrowIcon, PopoverBackdrop, type PopoverBackdropProps, type PopoverContextValue, PopoverGroup, type PopoverGroupHandle, type PopoverGroupItem, type PopoverPlacement, PopoverPopup, type PopoverPopupAtomProps, type PopoverPopupProps, PopoverPortal, type PopoverPortalAtomProps, type PopoverPortalProps, PopoverPositioner, type PopoverPositionerAtomProps, type PopoverPositionerProps, type PopoverProps, PopoverProvider, PopoverRoot, type PopoverTrigger, type PopoverTriggerComponentProps, PopoverTriggerElement, type PopoverTriggerElementProps, PopoverViewport, type PopoverViewportAtomProps, Progress, type ProgressProps, type ProgressSize, type ProgressStatus, type ProgressType, type ProgressVariant, QRCode, type QRCodeErrorLevel, type QRCodeProps, type QRCodeStatus, Radio, RadioGroup, type RadioGroupOption, type RadioGroupProps, type RadioProps, Rate, type RateProps, Result, type ResultProps, type ResultStatus, ScrollArea, ScrollAreaContent, type ScrollAreaContentProps, ScrollAreaCorner, type ScrollAreaCornerProps, type ScrollAreaProps, ScrollAreaRoot, type ScrollAreaRootProps, ScrollAreaScrollbar, type ScrollAreaScrollbarProps, ScrollAreaThumb, type ScrollAreaThumbProps, ScrollAreaViewport, type ScrollAreaViewportProps, Segmented, type SegmentedClassNames, SegmentedIndicator, type SegmentedIndicatorProps, SegmentedItem, SegmentedItemIcon, SegmentedItemLabel, type SegmentedItemProps, type SegmentedOption, type SegmentedOptions, type SegmentedOrientation, type SegmentedProps, SegmentedRoot, type SegmentedRootProps, type SegmentedSize, type SegmentedStyles, type SegmentedVariant, Select, SelectArrow, type SelectArrowProps, SelectBackdrop, type SelectBehaviorVariant, type SelectClassNames, SelectGroup, SelectGroupLabel, type SelectGroupLabelProps, type SelectGroupProps, SelectIcon, type SelectIconProps, type SelectIndicatorVariant, SelectItem, SelectItemIndicator, type SelectItemIndicatorProps, type SelectItemProps, SelectItemText, type SelectItemTextProps, SelectList, type SelectListProps, type SelectOption, type SelectOptionGroup, type SelectOptions, SelectPopup, type SelectPopupProps, SelectPortal, type SelectPortalProps, SelectPositioner, type SelectPositionerProps, type SelectProps, SelectRoot, type SelectRootChangeEventDetails, SelectScrollDownArrow, type SelectScrollDownArrowProps, SelectScrollUpArrow, type SelectScrollUpArrowProps, SelectSeparator, type SelectSize, SelectTrigger, type SelectTriggerProps, SelectValue, type SelectValueProps, type SelectVariant, Skeleton, type SkeletonAnimation, SkeletonAvatar, type SkeletonAvatarProps, type SkeletonProps, SkeletonText, type SkeletonTextProps, Slider, type SliderProps, SliderWithInput, type SliderWithInputProps, type SortOrder, Spin, type SpinProps, type SpinSize, type SpinVariant, _default as SplitButton, type SplitButtonMenuProps, type SplitButtonProps, Statistic, type StatisticProps, type StepItem, type StepStatus, Steps, type StepsProps, Switch, type SwitchChangeEventHandler, type SwitchClassNames, type SwitchClickEventHandler, type SwitchContextType, SwitchIcon, type SwitchIconPosition, type SwitchIconProps, type SwitchProps, SwitchRoot, type SwitchRootProps, type SwitchSize, type SwitchStyles, SwitchThumb, type SwitchThumbProps, Table, type TableColumn, type TableFilters, type TablePaginationConfig, type TableProps, type TableSemanticName, type TableSorterResult, Tabs, type TabsClassNames, TabsIndicator, type TabsIndicatorProps, type TabsItem, TabsList, type TabsListProps, type TabsOrientation, TabsPanel, type TabsPanelProps, type TabsProps, TabsRoot, type TabsRootProps, type TabsSize, type TabsStyles, TabsTab, type TabsTabProps, type TabsVariant, Tag, type TagClassNames, type TagProps, type TagShape, type TagSize, type TagStyles, type TagVariant, Text, TextArea, type TextAreaAutoSize, type TextAreaProps, type TextClassNames, type TextProps, type TextStyles, type ToastAPI, ToastHost, type ToastHostProps, type ToastInstance, type ToastOptions, type ToastPosition, type ToastPromiseOptions, type ToastProps, type ToastType, ToggleGroup, type ToggleGroupClassNames, ToggleGroupItem, ToggleGroupItemIcon, ToggleGroupItemLabel, type ToggleGroupItemProps, type ToggleGroupOption, type ToggleGroupProps, ToggleGroupRoot, type ToggleGroupRootProps, type ToggleGroupSize, type ToggleGroupStyles, type ToggleGroupVariant, Tooltip, TooltipGroup, type TooltipGroupProps, type TooltipPlacement, type TooltipPopupComponentProps, type TooltipPortalProps, type TooltipPositionerProps, type TooltipProps, type TooltipTriggerComponentProps, Tree, type TreeClassNames, type TreeDataNode, type TreeFlatRow, type TreeProps, type TreeStyles, Upload, type UploadChangeInfo, UploadDragger, type UploadProps, type UseScopeArrowNavOptions, type UseScopeSwitcherOptions, type VirtualListProps, styles as accordionStyles, styles$1 as actionIconStyles, styles$2 as alertStyles, styles$3 as autoCompleteStyles, backdropTransition, buttonPaddingInline, styles$4 as buttonStyles, styles$5 as checkboxStyles, closeContextMenu, colorsPreset, colorsPresetSystem, conductCheck, confirmModal, controlHeight, createModal, createModalSystem, drawerBackdropTransition, flattenVisible, focusScopeItem, styles$6 as focusScopeStyles, formatStatisticValue, getActiveScopeId, getAllKeys, getDrawerMotionConfig, getFloatingCollisionPadding, getLastFocusedItem, styles$7 as inputStyles, rootVariants as inputVariants, modalMotionConfig, notifyScopeItemFocus, parseTrigger, presetColors, presetSystemColors, styles$8 as radioStyles, registerScope, renderDropdownMenuItems, setActiveScope, setContextMenuInterceptor, setFloatingCollisionPadding, setLastFocusedItem, showContextMenu, styles$9 as sliderStyles, styles$10 as switchStyles, styles$11 as tabsStyles, groupStyles as textGroupStyles, styles$12 as textStyles, variants as textVariants, toast, styles$13 as toggleGroupStyles, styles$14 as treeStyles, updateContextMenuItems, useAccordionContext, useActiveScopeId, useDraggablePanelContext, useDrawerActions, useDrawerOpen, useFocusScopeActive, useFocusScopeId, useFormContext, useModalActions, useModalContext, useModalOpen, usePopoverContext, usePopoverGroupHandle, usePopoverPortalContainer, useScopeArrowNav, useScopeSwitcher, useSwitchContext, useTabsContext, useToast };
|
package/es/base-ui/index.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import Divider from "./Divider/Divider.mjs";
|
|
1
2
|
import { getFloatingCollisionPadding, setFloatingCollisionPadding } from "./floating/collisionPadding.mjs";
|
|
2
3
|
import { Tooltip } from "./Tooltip/Tooltip.mjs";
|
|
3
4
|
import TooltipGroup from "./Tooltip/TooltipGroup.mjs";
|
|
@@ -24,9 +25,14 @@ import Result from "./Result/Result.mjs";
|
|
|
24
25
|
import Spin from "./Spin/Spin.mjs";
|
|
25
26
|
import Upload from "./Upload/Upload.mjs";
|
|
26
27
|
import UploadDragger from "./Upload/UploadDragger.mjs";
|
|
27
|
-
import {
|
|
28
|
-
import
|
|
29
|
-
import {
|
|
28
|
+
import { colorsPreset, colorsPresetSystem, presetColors, presetSystemColors } from "./Tag/utils.mjs";
|
|
29
|
+
import Tag from "./Tag/Tag.mjs";
|
|
30
|
+
import { rootVariants, styles as styles$7 } from "./Input/style.mjs";
|
|
31
|
+
import Input from "./Input/Input.mjs";
|
|
32
|
+
import InputNumber from "./Input/InputNumber.mjs";
|
|
33
|
+
import InputOTP from "./Input/InputOTP.mjs";
|
|
34
|
+
import InputPassword from "./Input/InputPassword.mjs";
|
|
35
|
+
import TextArea from "./Input/TextArea.mjs";
|
|
30
36
|
import { PopoverArrowIcon } from "./Popover/ArrowIcon.mjs";
|
|
31
37
|
import { usePopoverPortalContainer } from "./Popover/PopoverPortal.mjs";
|
|
32
38
|
import { PopoverArrow, PopoverBackdrop, PopoverPopup, PopoverPortal, PopoverPositioner, PopoverRoot, PopoverTriggerElement, PopoverViewport } from "./Popover/atoms.mjs";
|
|
@@ -34,40 +40,50 @@ import { PopoverProvider, usePopoverContext } from "./Popover/context.mjs";
|
|
|
34
40
|
import { usePopoverGroupHandle } from "./Popover/groupContext.mjs";
|
|
35
41
|
import Popover from "./Popover/Popover.mjs";
|
|
36
42
|
import PopoverGroup from "./Popover/PopoverGroup.mjs";
|
|
43
|
+
import { styles as styles$9 } from "./Slider/style.mjs";
|
|
44
|
+
import Slider from "./Slider/Slider.mjs";
|
|
45
|
+
import SliderWithInput from "./Slider/SliderWithInput.mjs";
|
|
46
|
+
import ColorPicker from "./ColorPicker/ColorPicker.mjs";
|
|
47
|
+
import { closeContextMenu, setContextMenuInterceptor, showContextMenu, updateContextMenuItems } from "./ContextMenu/store.mjs";
|
|
48
|
+
import { ContextMenuHost } from "./ContextMenu/ContextMenuHost.mjs";
|
|
49
|
+
import { ContextMenuTrigger } from "./ContextMenu/ContextMenuTrigger.mjs";
|
|
50
|
+
import AvatarGroup from "./Avatar/AvatarGroup/index.mjs";
|
|
51
|
+
import Avatar from "./Avatar/index.mjs";
|
|
52
|
+
import { styles as styles$11 } from "./Tabs/style.mjs";
|
|
53
|
+
import { TabsIndicator, TabsList, TabsPanel, TabsRoot, TabsTab, useTabsContext } from "./Tabs/atoms.mjs";
|
|
54
|
+
import Tabs from "./Tabs/Tabs.mjs";
|
|
55
|
+
import { ToastHost, toast, useToast } from "./Toast/imperative.mjs";
|
|
56
|
+
import { SegmentedIndicator, SegmentedItem, SegmentedItemIcon, SegmentedItemLabel, SegmentedRoot } from "./Segmented/atoms.mjs";
|
|
57
|
+
import Segmented from "./Segmented/Segmented.mjs";
|
|
37
58
|
import SkeletonAvatar from "./Skeleton/SkeletonAvatar.mjs";
|
|
38
59
|
import SkeletonText from "./Skeleton/SkeletonText.mjs";
|
|
39
60
|
import Skeleton from "./Skeleton/index.mjs";
|
|
40
|
-
import { ToastHost, toast, useToast } from "./Toast/imperative.mjs";
|
|
41
61
|
import { ScrollArea } from "./ScrollArea/ScrollArea.mjs";
|
|
42
|
-
import { SegmentedIndicator, SegmentedItem, SegmentedItemIcon, SegmentedItemLabel, SegmentedRoot } from "./Segmented/atoms.mjs";
|
|
43
|
-
import Segmented from "./Segmented/Segmented.mjs";
|
|
44
|
-
import { colorsPreset, colorsPresetSystem, presetColors, presetSystemColors } from "./Tag/utils.mjs";
|
|
45
|
-
import Tag from "./Tag/Tag.mjs";
|
|
46
62
|
import { styles } from "./Accordion/style.mjs";
|
|
47
63
|
import { AccordionHeader, AccordionItem, AccordionPanel, AccordionRoot, AccordionTrigger, useAccordionContext } from "./Accordion/atoms.mjs";
|
|
48
64
|
import Accordion from "./Accordion/Accordion.mjs";
|
|
49
65
|
import { styles as styles$2 } from "./Alert/style.mjs";
|
|
50
66
|
import Alert from "./Alert/Alert.mjs";
|
|
51
|
-
import
|
|
52
|
-
import Input from "./Input/Input.mjs";
|
|
53
|
-
import InputNumber from "./Input/InputNumber.mjs";
|
|
54
|
-
import InputOTP from "./Input/InputOTP.mjs";
|
|
55
|
-
import InputPassword from "./Input/InputPassword.mjs";
|
|
56
|
-
import TextArea from "./Input/TextArea.mjs";
|
|
67
|
+
import Anchor from "./Anchor/Anchor.mjs";
|
|
57
68
|
import { styles as styles$3 } from "./AutoComplete/style.mjs";
|
|
58
69
|
import AutoComplete from "./AutoComplete/AutoComplete.mjs";
|
|
59
|
-
import
|
|
60
|
-
import
|
|
70
|
+
import Breadcrumb from "./Breadcrumb/Breadcrumb.mjs";
|
|
71
|
+
import { drawerBackdropTransition, getDrawerMotionConfig } from "./Drawer/constants.mjs";
|
|
72
|
+
import { DrawerBackdrop, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerPopup, DrawerPortal, DrawerRoot, DrawerTitle, DrawerTrigger, useDrawerActions, useDrawerOpen } from "./Drawer/atoms.mjs";
|
|
73
|
+
import Drawer from "./Drawer/Drawer.mjs";
|
|
74
|
+
import List from "./List/List.mjs";
|
|
75
|
+
import Burger from "./Burger/Burger.mjs";
|
|
76
|
+
import Carousel from "./Carousel/Carousel.mjs";
|
|
61
77
|
import { styles as styles$5 } from "./Checkbox/style.mjs";
|
|
62
78
|
import Checkbox from "./Checkbox/Checkbox.mjs";
|
|
63
79
|
import CheckboxGroup from "./Checkbox/CheckboxGroup.mjs";
|
|
64
80
|
import Collapsible from "./Collapsible/Collapsible.mjs";
|
|
81
|
+
import DatePicker from "./DatePicker/DatePicker.mjs";
|
|
82
|
+
import DateRangePicker from "./DatePicker/DateRangePicker.mjs";
|
|
83
|
+
import Descriptions from "./Descriptions/Descriptions.mjs";
|
|
65
84
|
import { useDraggablePanelContext } from "./DraggablePanel/context.mjs";
|
|
66
85
|
import { DraggablePanelBody, DraggablePanelContainer, DraggablePanelContent, DraggablePanelFooter, DraggablePanelHandle, DraggablePanelHeader, DraggablePanelRoot, DraggablePanelToggle } from "./DraggablePanel/atoms.mjs";
|
|
67
86
|
import DraggablePanel from "./DraggablePanel/DraggablePanel.mjs";
|
|
68
|
-
import { drawerBackdropTransition, getDrawerMotionConfig } from "./Drawer/constants.mjs";
|
|
69
|
-
import { DrawerBackdrop, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerPopup, DrawerPortal, DrawerRoot, DrawerTitle, DrawerTrigger, useDrawerActions, useDrawerOpen } from "./Drawer/atoms.mjs";
|
|
70
|
-
import Drawer from "./Drawer/Drawer.mjs";
|
|
71
87
|
import { backdropTransition, modalMotionConfig } from "./Modal/constants.mjs";
|
|
72
88
|
import { ModalBackdrop, ModalClose, ModalContent, ModalDescription, ModalFooter, ModalHeader, ModalPopup, ModalPortal, ModalRoot, ModalTitle, ModalTrigger, ModalViewport, useModalActions, useModalOpen } from "./Modal/atoms.mjs";
|
|
73
89
|
import { ModalContext, useModalContext } from "./Modal/context.mjs";
|
|
@@ -89,15 +105,15 @@ import FormFooter from "./Form/components/FormFooter.mjs";
|
|
|
89
105
|
import FormGroup from "./Form/components/FormGroup.mjs";
|
|
90
106
|
import FormSubmitFooter from "./Form/components/FormSubmitFooter.mjs";
|
|
91
107
|
import { Form } from "./Form/index.mjs";
|
|
108
|
+
import QRCode from "./QRCode/QRCode.mjs";
|
|
92
109
|
import { styles as styles$8 } from "./Radio/style.mjs";
|
|
93
110
|
import Radio from "./Radio/Radio.mjs";
|
|
94
111
|
import RadioGroup from "./Radio/RadioGroup.mjs";
|
|
95
|
-
import
|
|
96
|
-
import
|
|
97
|
-
import
|
|
98
|
-
import
|
|
99
|
-
import
|
|
100
|
-
import Tabs from "./Tabs/Tabs.mjs";
|
|
112
|
+
import Rate from "./Rate/Rate.mjs";
|
|
113
|
+
import { formatStatisticValue } from "./Statistic/formatValue.mjs";
|
|
114
|
+
import Statistic from "./Statistic/Statistic.mjs";
|
|
115
|
+
import Steps from "./Steps/Steps.mjs";
|
|
116
|
+
import Table from "./Table/Table.mjs";
|
|
101
117
|
import { groupStyles, styles as styles$12, variants } from "./Text/style.mjs";
|
|
102
118
|
import Text from "./Text/Text.mjs";
|
|
103
119
|
import { styles as styles$13 } from "./ToggleGroup/style.mjs";
|
|
@@ -106,4 +122,4 @@ import ToggleGroup from "./ToggleGroup/ToggleGroup.mjs";
|
|
|
106
122
|
import { styles as styles$14 } from "./Tree/style.mjs";
|
|
107
123
|
import { conductCheck, flattenVisible, getAllKeys } from "./Tree/utils.mjs";
|
|
108
124
|
import Tree from "./Tree/Tree.mjs";
|
|
109
|
-
export { Accordion, AccordionHeader, AccordionItem, AccordionPanel, AccordionRoot, AccordionTrigger, ActionIcon, Alert, AutoComplete, Avatar, AvatarGroup, Badge, Button, Checkbox, CheckboxGroup, Collapsible, ContextMenuHost, ContextMenuTrigger, DraggablePanel, DraggablePanelBody, DraggablePanelContainer, DraggablePanelContent, DraggablePanelFooter, DraggablePanelHandle, DraggablePanelHeader, DraggablePanelRoot, DraggablePanelToggle, Drawer, DrawerBackdrop, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerPopup, DrawerPortal, DrawerRoot, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItemIndicator, DropdownMenuCheckboxItemPrimitive, DropdownMenuFooter, DropdownMenuGroup, DropdownMenuGroupLabel, DropdownMenuHeader, DropdownMenuItem, DropdownMenuItemContent, DropdownMenuItemDesc, DropdownMenuItemExtra, DropdownMenuItemIcon, DropdownMenuItemLabel, DropdownMenuItemLabelGroup, DropdownMenuPopup, DropdownMenuPortal, DropdownMenuPositioner, DropdownMenuRoot, DropdownMenuScrollViewport, DropdownMenuSeparator, DropdownMenuSubmenuArrow, DropdownMenuSubmenuRoot, DropdownMenuSubmenuTrigger, DropdownMenuSwitchItem, DropdownMenuTrigger, FloatingPanel, FloatingSheet, FocusScope, Form, FormDivider, FormField, FormFlatGroup, FormFooter, FormGroup, FormSubmitFooter, FormTitle, Input, InputNumber, InputOTP, InputPassword, Modal, ModalBackdrop, ModalClose, ModalContent, ModalContext, ModalDescription, ModalFooter, ModalHeader, ModalHost, ModalPopup, ModalPortal, ModalRoot, ModalTitle, ModalTrigger, ModalViewport, Pagination, Popover, PopoverArrow, PopoverArrowIcon, PopoverBackdrop, PopoverGroup, PopoverPopup, PopoverPortal, PopoverPositioner, PopoverProvider, PopoverRoot, PopoverTriggerElement, PopoverViewport, Progress, Radio, RadioGroup, Result, ScrollArea, ScrollAreaContent, ScrollAreaCorner, ScrollAreaRoot, ScrollAreaScrollbar, ScrollAreaThumb, ScrollAreaViewport, Segmented, SegmentedIndicator, SegmentedItem, SegmentedItemIcon, SegmentedItemLabel, SegmentedRoot, Select, SelectArrow, SelectBackdrop, SelectGroup, SelectGroupLabel, SelectIcon, SelectItem, SelectItemIndicator, SelectItemText, SelectList, SelectPopup, SelectPortal, SelectPositioner, SelectRoot, SelectScrollDownArrow, SelectScrollUpArrow, SelectSeparator, SelectTrigger, SelectValue, Skeleton, SkeletonAvatar, SkeletonText, Slider, SliderWithInput, Spin, SplitButton, Switch, SwitchIcon, SwitchRoot, SwitchThumb, Tabs, TabsIndicator, TabsList, TabsPanel, TabsRoot, TabsTab, Tag, Text, TextArea, ToastHost, ToggleGroup, ToggleGroupItem, ToggleGroupItemIcon, ToggleGroupItemLabel, ToggleGroupRoot, Tooltip, TooltipGroup, Tree, Upload, UploadDragger, styles as accordionStyles, styles$1 as actionIconStyles, styles$2 as alertStyles, styles$3 as autoCompleteStyles, backdropTransition, buttonPaddingInline, styles$4 as buttonStyles, styles$5 as checkboxStyles, closeContextMenu, colorsPreset, colorsPresetSystem, conductCheck, confirmModal, controlHeight, createModal, createModalSystem, drawerBackdropTransition, flattenVisible, focusScopeItem, styles$6 as focusScopeStyles, getActiveScopeId, getAllKeys, getDrawerMotionConfig, getFloatingCollisionPadding, getLastFocusedItem, styles$7 as inputStyles, rootVariants as inputVariants, modalMotionConfig, notifyScopeItemFocus, parseTrigger, presetColors, presetSystemColors, styles$8 as radioStyles, registerScope, renderDropdownMenuItems, setActiveScope, setContextMenuInterceptor, setFloatingCollisionPadding, setLastFocusedItem, showContextMenu, styles$9 as sliderStyles, styles$10 as switchStyles, styles$11 as tabsStyles, groupStyles as textGroupStyles, styles$12 as textStyles, variants as textVariants, toast, styles$13 as toggleGroupStyles, styles$14 as treeStyles, updateContextMenuItems, useAccordionContext, useActiveScopeId, useDraggablePanelContext, useDrawerActions, useDrawerOpen, useFocusScopeActive, useFocusScopeId, useFormContext, useModalActions, useModalContext, useModalOpen, usePopoverContext, usePopoverGroupHandle, usePopoverPortalContainer, useScopeArrowNav, useScopeSwitcher, useSwitchContext, useTabsContext, useToast };
|
|
125
|
+
export { Accordion, AccordionHeader, AccordionItem, AccordionPanel, AccordionRoot, AccordionTrigger, ActionIcon, Alert, Anchor, AutoComplete, Avatar, AvatarGroup, Badge, Breadcrumb, Burger, Button, Carousel, Checkbox, CheckboxGroup, Collapsible, ColorPicker, ContextMenuHost, ContextMenuTrigger, DatePicker, DateRangePicker, Descriptions, Divider, DraggablePanel, DraggablePanelBody, DraggablePanelContainer, DraggablePanelContent, DraggablePanelFooter, DraggablePanelHandle, DraggablePanelHeader, DraggablePanelRoot, DraggablePanelToggle, Drawer, DrawerBackdrop, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerPopup, DrawerPortal, DrawerRoot, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItemIndicator, DropdownMenuCheckboxItemPrimitive, DropdownMenuFooter, DropdownMenuGroup, DropdownMenuGroupLabel, DropdownMenuHeader, DropdownMenuItem, DropdownMenuItemContent, DropdownMenuItemDesc, DropdownMenuItemExtra, DropdownMenuItemIcon, DropdownMenuItemLabel, DropdownMenuItemLabelGroup, DropdownMenuPopup, DropdownMenuPortal, DropdownMenuPositioner, DropdownMenuRoot, DropdownMenuScrollViewport, DropdownMenuSeparator, DropdownMenuSubmenuArrow, DropdownMenuSubmenuRoot, DropdownMenuSubmenuTrigger, DropdownMenuSwitchItem, DropdownMenuTrigger, FloatingPanel, FloatingSheet, FocusScope, Form, FormDivider, FormField, FormFlatGroup, FormFooter, FormGroup, FormSubmitFooter, FormTitle, Input, InputNumber, InputOTP, InputPassword, List, Modal, ModalBackdrop, ModalClose, ModalContent, ModalContext, ModalDescription, ModalFooter, ModalHeader, ModalHost, ModalPopup, ModalPortal, ModalRoot, ModalTitle, ModalTrigger, ModalViewport, Pagination, Popover, PopoverArrow, PopoverArrowIcon, PopoverBackdrop, PopoverGroup, PopoverPopup, PopoverPortal, PopoverPositioner, PopoverProvider, PopoverRoot, PopoverTriggerElement, PopoverViewport, Progress, QRCode, Radio, RadioGroup, Rate, Result, ScrollArea, ScrollAreaContent, ScrollAreaCorner, ScrollAreaRoot, ScrollAreaScrollbar, ScrollAreaThumb, ScrollAreaViewport, Segmented, SegmentedIndicator, SegmentedItem, SegmentedItemIcon, SegmentedItemLabel, SegmentedRoot, Select, SelectArrow, SelectBackdrop, SelectGroup, SelectGroupLabel, SelectIcon, SelectItem, SelectItemIndicator, SelectItemText, SelectList, SelectPopup, SelectPortal, SelectPositioner, SelectRoot, SelectScrollDownArrow, SelectScrollUpArrow, SelectSeparator, SelectTrigger, SelectValue, Skeleton, SkeletonAvatar, SkeletonText, Slider, SliderWithInput, Spin, SplitButton, Statistic, Steps, Switch, SwitchIcon, SwitchRoot, SwitchThumb, Table, Tabs, TabsIndicator, TabsList, TabsPanel, TabsRoot, TabsTab, Tag, Text, TextArea, ToastHost, ToggleGroup, ToggleGroupItem, ToggleGroupItemIcon, ToggleGroupItemLabel, ToggleGroupRoot, Tooltip, TooltipGroup, Tree, Upload, UploadDragger, styles as accordionStyles, styles$1 as actionIconStyles, styles$2 as alertStyles, styles$3 as autoCompleteStyles, backdropTransition, buttonPaddingInline, styles$4 as buttonStyles, styles$5 as checkboxStyles, closeContextMenu, colorsPreset, colorsPresetSystem, conductCheck, confirmModal, controlHeight, createModal, createModalSystem, drawerBackdropTransition, flattenVisible, focusScopeItem, styles$6 as focusScopeStyles, formatStatisticValue, getActiveScopeId, getAllKeys, getDrawerMotionConfig, getFloatingCollisionPadding, getLastFocusedItem, styles$7 as inputStyles, rootVariants as inputVariants, modalMotionConfig, notifyScopeItemFocus, parseTrigger, presetColors, presetSystemColors, styles$8 as radioStyles, registerScope, renderDropdownMenuItems, setActiveScope, setContextMenuInterceptor, setFloatingCollisionPadding, setLastFocusedItem, showContextMenu, styles$9 as sliderStyles, styles$10 as switchStyles, styles$11 as tabsStyles, groupStyles as textGroupStyles, styles$12 as textStyles, variants as textVariants, toast, styles$13 as toggleGroupStyles, styles$14 as treeStyles, updateContextMenuItems, useAccordionContext, useActiveScopeId, useDraggablePanelContext, useDrawerActions, useDrawerOpen, useFocusScopeActive, useFocusScopeId, useFormContext, useModalActions, useModalContext, useModalOpen, usePopoverContext, usePopoverGroupHandle, usePopoverPortalContainer, useScopeArrowNav, useScopeSwitcher, useSwitchContext, useTabsContext, useToast };
|