@lobehub/ui 6.0.0-beta.6 → 6.0.0-beta.8
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 +3 -3
- package/es/Accordion/Accordion.mjs.map +1 -1
- package/es/Accordion/atoms.mjs +2 -2
- package/es/Accordion/atoms.mjs.map +1 -1
- package/es/Accordion/style.d.mts +1 -1
- package/es/ActionIcon/ActionIcon.mjs +2 -2
- package/es/ActionIcon/ActionIcon.mjs.map +1 -1
- package/es/Alert/Alert.mjs +5 -5
- package/es/Alert/Alert.mjs.map +1 -1
- package/es/AutoComplete/AutoComplete.mjs +5 -5
- package/es/AutoComplete/AutoComplete.mjs.map +1 -1
- package/es/AutoComplete/style.mjs +2 -2
- package/es/AutoComplete/style.mjs.map +1 -1
- package/es/Avatar/Avatar.mjs +2 -2
- package/es/Avatar/Avatar.mjs.map +1 -1
- package/es/Avatar/AvatarGroup/index.mjs +2 -2
- package/es/Avatar/AvatarGroup/index.mjs.map +1 -1
- package/es/Breadcrumb/Breadcrumb.mjs +2 -2
- package/es/Breadcrumb/Breadcrumb.mjs.map +1 -1
- package/es/Button/Button.mjs +1 -1
- package/es/Button/Button.mjs.map +1 -1
- package/es/Button/style.d.mts +8 -1
- package/es/Button/style.mjs +41 -18
- package/es/Button/style.mjs.map +1 -1
- package/es/Checkbox/Checkbox.mjs +3 -3
- package/es/Checkbox/Checkbox.mjs.map +1 -1
- package/es/CodeDiff/DiffPanel.mjs +4 -4
- package/es/CodeDiff/DiffPanel.mjs.map +1 -1
- package/es/CodeEditor/CodeEditor.mjs +4 -4
- package/es/CodeEditor/CodeEditor.mjs.map +1 -1
- package/es/ColorPicker/ColorInputs.mjs +136 -0
- package/es/ColorPicker/ColorInputs.mjs.map +1 -0
- package/es/ColorPicker/ColorPanel.mjs +145 -0
- package/es/ColorPicker/ColorPanel.mjs.map +1 -0
- package/es/ColorPicker/ColorPicker.mjs +62 -199
- package/es/ColorPicker/ColorPicker.mjs.map +1 -1
- package/es/ColorPicker/SaturationArea.mjs +2 -1
- package/es/ColorPicker/SaturationArea.mjs.map +1 -1
- package/es/ColorPicker/Swatch.mjs +24 -0
- package/es/ColorPicker/Swatch.mjs.map +1 -0
- package/es/ColorPicker/Swatches.mjs +66 -0
- package/es/ColorPicker/Swatches.mjs.map +1 -0
- package/es/ColorPicker/Trigger.mjs +112 -0
- package/es/ColorPicker/Trigger.mjs.map +1 -0
- package/es/ColorPicker/color.mjs +25 -1
- package/es/ColorPicker/color.mjs.map +1 -1
- package/es/ColorPicker/recent.mjs +25 -0
- package/es/ColorPicker/recent.mjs.map +1 -0
- package/es/ColorPicker/style.mjs +269 -70
- package/es/ColorPicker/style.mjs.map +1 -1
- package/es/ColorPicker/type.d.mts +15 -0
- package/es/ColorSwatches/type.d.mts +2 -2
- package/es/ContextMenu/ContextMenuHost.mjs +2 -2
- package/es/ContextMenu/ContextMenuHost.mjs.map +1 -1
- package/es/ContextMenu/ContextMenuTrigger.mjs +2 -2
- package/es/ContextMenu/ContextMenuTrigger.mjs.map +1 -1
- package/es/ContextMenu/renderItems.mjs +3 -3
- package/es/ContextMenu/renderItems.mjs.map +1 -1
- package/es/DatePicker/DatePicker.d.mts +7 -2
- package/es/DatePicker/DatePicker.mjs +13 -85
- package/es/DatePicker/DatePicker.mjs.map +1 -1
- package/es/DatePicker/DateRangePicker.d.mts +3 -2
- package/es/DatePicker/DateRangePicker.mjs +3 -125
- package/es/DatePicker/DateRangePicker.mjs.map +1 -1
- package/es/DatePicker/PurePanel.mjs +65 -0
- package/es/DatePicker/PurePanel.mjs.map +1 -0
- package/es/DatePicker/RangePicker.mjs +115 -0
- package/es/DatePicker/RangePicker.mjs.map +1 -0
- package/es/DatePicker/SinglePicker.mjs +132 -0
- package/es/DatePicker/SinglePicker.mjs.map +1 -0
- package/es/DatePicker/core/PickerInput/Popup/Footer.mjs +57 -0
- package/es/DatePicker/core/PickerInput/Popup/Footer.mjs.map +1 -0
- package/es/DatePicker/core/PickerInput/Popup/PopupPanel.mjs +57 -0
- package/es/DatePicker/core/PickerInput/Popup/PopupPanel.mjs.map +1 -0
- package/es/DatePicker/core/PickerInput/Popup/PresetPanel.mjs +29 -0
- package/es/DatePicker/core/PickerInput/Popup/PresetPanel.mjs.map +1 -0
- package/es/DatePicker/core/PickerInput/Popup/index.mjs +133 -0
- package/es/DatePicker/core/PickerInput/Popup/index.mjs.map +1 -0
- package/es/DatePicker/core/PickerInput/RangePicker.d.mts +51 -0
- package/es/DatePicker/core/PickerInput/RangePicker.mjs +343 -0
- package/es/DatePicker/core/PickerInput/RangePicker.mjs.map +1 -0
- package/es/DatePicker/core/PickerInput/Selector/ClearIcon.mjs +27 -0
- package/es/DatePicker/core/PickerInput/Selector/ClearIcon.mjs.map +1 -0
- package/es/DatePicker/core/PickerInput/Selector/Icon.mjs +19 -0
- package/es/DatePicker/core/PickerInput/Selector/Icon.mjs.map +1 -0
- package/es/DatePicker/core/PickerInput/Selector/Input.mjs +237 -0
- package/es/DatePicker/core/PickerInput/Selector/Input.mjs.map +1 -0
- package/es/DatePicker/core/PickerInput/Selector/MaskFormat.mjs +70 -0
- package/es/DatePicker/core/PickerInput/Selector/MaskFormat.mjs.map +1 -0
- package/es/DatePicker/core/PickerInput/Selector/RangeSelector.d.mts +8 -0
- package/es/DatePicker/core/PickerInput/Selector/RangeSelector.mjs +136 -0
- package/es/DatePicker/core/PickerInput/Selector/RangeSelector.mjs.map +1 -0
- package/es/DatePicker/core/PickerInput/Selector/SingleSelector/HoverSelector.mjs +28 -0
- package/es/DatePicker/core/PickerInput/Selector/SingleSelector/HoverSelector.mjs.map +1 -0
- package/es/DatePicker/core/PickerInput/Selector/SingleSelector/MultipleDates.mjs +69 -0
- package/es/DatePicker/core/PickerInput/Selector/SingleSelector/MultipleDates.mjs.map +1 -0
- package/es/DatePicker/core/PickerInput/Selector/SingleSelector/index.mjs +111 -0
- package/es/DatePicker/core/PickerInput/Selector/SingleSelector/index.mjs.map +1 -0
- package/es/DatePicker/core/PickerInput/Selector/hooks/useClearIcon.mjs +18 -0
- package/es/DatePicker/core/PickerInput/Selector/hooks/useClearIcon.mjs.map +1 -0
- package/es/DatePicker/core/PickerInput/Selector/hooks/useInputProps.mjs +108 -0
- package/es/DatePicker/core/PickerInput/Selector/hooks/useInputProps.mjs.map +1 -0
- package/es/DatePicker/core/PickerInput/Selector/hooks/useRootProps.mjs +11 -0
- package/es/DatePicker/core/PickerInput/Selector/hooks/useRootProps.mjs.map +1 -0
- package/es/DatePicker/core/PickerInput/Selector/util.mjs +20 -0
- package/es/DatePicker/core/PickerInput/Selector/util.mjs.map +1 -0
- package/es/DatePicker/core/PickerInput/SinglePicker.d.mts +55 -0
- package/es/DatePicker/core/PickerInput/SinglePicker.mjs +318 -0
- package/es/DatePicker/core/PickerInput/SinglePicker.mjs.map +1 -0
- package/es/DatePicker/core/PickerInput/context.mjs +7 -0
- package/es/DatePicker/core/PickerInput/context.mjs.map +1 -0
- package/es/DatePicker/core/PickerInput/hooks/useCellRender.mjs +30 -0
- package/es/DatePicker/core/PickerInput/hooks/useCellRender.mjs.map +1 -0
- package/es/DatePicker/core/PickerInput/hooks/useDelayState.mjs +37 -0
- package/es/DatePicker/core/PickerInput/hooks/useDelayState.mjs.map +1 -0
- package/es/DatePicker/core/PickerInput/hooks/useDisabledBoundary.mjs +18 -0
- package/es/DatePicker/core/PickerInput/hooks/useDisabledBoundary.mjs.map +1 -0
- package/es/DatePicker/core/PickerInput/hooks/useFieldFormat.mjs +20 -0
- package/es/DatePicker/core/PickerInput/hooks/useFieldFormat.mjs.map +1 -0
- package/es/DatePicker/core/PickerInput/hooks/useFieldsInvalidate.mjs +31 -0
- package/es/DatePicker/core/PickerInput/hooks/useFieldsInvalidate.mjs.map +1 -0
- package/es/DatePicker/core/PickerInput/hooks/useFilledProps.mjs +98 -0
- package/es/DatePicker/core/PickerInput/hooks/useFilledProps.mjs.map +1 -0
- package/es/DatePicker/core/PickerInput/hooks/useFocusEvents.mjs +41 -0
- package/es/DatePicker/core/PickerInput/hooks/useFocusEvents.mjs.map +1 -0
- package/es/DatePicker/core/PickerInput/hooks/useFocusLock.mjs +34 -0
- package/es/DatePicker/core/PickerInput/hooks/useFocusLock.mjs.map +1 -0
- package/es/DatePicker/core/PickerInput/hooks/useHoverStore.mjs +35 -0
- package/es/DatePicker/core/PickerInput/hooks/useHoverStore.mjs.map +1 -0
- package/es/DatePicker/core/PickerInput/hooks/useInputReadOnly.mjs +9 -0
- package/es/DatePicker/core/PickerInput/hooks/useInputReadOnly.mjs.map +1 -0
- package/es/DatePicker/core/PickerInput/hooks/useInvalidate.mjs +36 -0
- package/es/DatePicker/core/PickerInput/hooks/useInvalidate.mjs.map +1 -0
- package/es/DatePicker/core/PickerInput/hooks/useLockEffect.mjs +27 -0
- package/es/DatePicker/core/PickerInput/hooks/useLockEffect.mjs.map +1 -0
- package/es/DatePicker/core/PickerInput/hooks/useOpen.mjs +18 -0
- package/es/DatePicker/core/PickerInput/hooks/useOpen.mjs.map +1 -0
- package/es/DatePicker/core/PickerInput/hooks/usePickerRef.mjs +19 -0
- package/es/DatePicker/core/PickerInput/hooks/usePickerRef.mjs.map +1 -0
- package/es/DatePicker/core/PickerInput/hooks/usePresets.mjs +20 -0
- package/es/DatePicker/core/PickerInput/hooks/usePresets.mjs.map +1 -0
- package/es/DatePicker/core/PickerInput/hooks/useRangeDisabledDate.mjs +24 -0
- package/es/DatePicker/core/PickerInput/hooks/useRangeDisabledDate.mjs.map +1 -0
- package/es/DatePicker/core/PickerInput/hooks/useRangePickerValue.mjs +107 -0
- package/es/DatePicker/core/PickerInput/hooks/useRangePickerValue.mjs.map +1 -0
- package/es/DatePicker/core/PickerInput/hooks/useRangeValue.mjs +144 -0
- package/es/DatePicker/core/PickerInput/hooks/useRangeValue.mjs.map +1 -0
- package/es/DatePicker/core/PickerInput/hooks/useRangeValueChange.mjs +219 -0
- package/es/DatePicker/core/PickerInput/hooks/useRangeValueChange.mjs.map +1 -0
- package/es/DatePicker/core/PickerInput/hooks/useShowNow.mjs +11 -0
- package/es/DatePicker/core/PickerInput/hooks/useShowNow.mjs.map +1 -0
- package/es/DatePicker/core/PickerPanel/DatePanel/index.mjs +131 -0
- package/es/DatePicker/core/PickerPanel/DatePanel/index.mjs.map +1 -0
- package/es/DatePicker/core/PickerPanel/DateTimePanel/index.mjs +35 -0
- package/es/DatePicker/core/PickerPanel/DateTimePanel/index.mjs.map +1 -0
- package/es/DatePicker/core/PickerPanel/DecadePanel/index.mjs +84 -0
- package/es/DatePicker/core/PickerPanel/DecadePanel/index.mjs.map +1 -0
- package/es/DatePicker/core/PickerPanel/MonthPanel/index.mjs +73 -0
- package/es/DatePicker/core/PickerPanel/MonthPanel/index.mjs.map +1 -0
- package/es/DatePicker/core/PickerPanel/PanelBody.mjs +95 -0
- package/es/DatePicker/core/PickerPanel/PanelBody.mjs.map +1 -0
- package/es/DatePicker/core/PickerPanel/PanelHeader.mjs +130 -0
- package/es/DatePicker/core/PickerPanel/PanelHeader.mjs.map +1 -0
- package/es/DatePicker/core/PickerPanel/QuarterPanel/index.mjs +64 -0
- package/es/DatePicker/core/PickerPanel/QuarterPanel/index.mjs.map +1 -0
- package/es/DatePicker/core/PickerPanel/TimePanel/TimeClock/ClockDial.mjs +108 -0
- package/es/DatePicker/core/PickerPanel/TimePanel/TimeClock/ClockDial.mjs.map +1 -0
- package/es/DatePicker/core/PickerPanel/TimePanel/TimeClock/geometry.mjs +44 -0
- package/es/DatePicker/core/PickerPanel/TimePanel/TimeClock/geometry.mjs.map +1 -0
- package/es/DatePicker/core/PickerPanel/TimePanel/TimeClock/index.mjs +157 -0
- package/es/DatePicker/core/PickerPanel/TimePanel/TimeClock/index.mjs.map +1 -0
- package/es/DatePicker/core/PickerPanel/TimePanel/TimePanelBody/TimeColumn.mjs +100 -0
- package/es/DatePicker/core/PickerPanel/TimePanel/TimePanelBody/TimeColumn.mjs.map +1 -0
- package/es/DatePicker/core/PickerPanel/TimePanel/TimePanelBody/index.mjs +71 -0
- package/es/DatePicker/core/PickerPanel/TimePanel/TimePanelBody/index.mjs.map +1 -0
- package/es/DatePicker/core/PickerPanel/TimePanel/TimePanelBody/useScrollTo.mjs +62 -0
- package/es/DatePicker/core/PickerPanel/TimePanel/TimePanelBody/useScrollTo.mjs.map +1 -0
- package/es/DatePicker/core/PickerPanel/TimePanel/TimePanelBody/useTimeState.mjs +200 -0
- package/es/DatePicker/core/PickerPanel/TimePanel/TimePanelBody/useTimeState.mjs.map +1 -0
- package/es/DatePicker/core/PickerPanel/TimePanel/TimePanelBody/util.mjs +25 -0
- package/es/DatePicker/core/PickerPanel/TimePanel/TimePanelBody/util.mjs.map +1 -0
- package/es/DatePicker/core/PickerPanel/TimePanel/index.mjs +31 -0
- package/es/DatePicker/core/PickerPanel/TimePanel/index.mjs.map +1 -0
- package/es/DatePicker/core/PickerPanel/WeekPanel/index.mjs +34 -0
- package/es/DatePicker/core/PickerPanel/WeekPanel/index.mjs.map +1 -0
- package/es/DatePicker/core/PickerPanel/YearPanel/index.mjs +92 -0
- package/es/DatePicker/core/PickerPanel/YearPanel/index.mjs.map +1 -0
- package/es/DatePicker/core/PickerPanel/context.mjs +48 -0
- package/es/DatePicker/core/PickerPanel/context.mjs.map +1 -0
- package/es/DatePicker/core/PickerPanel/index.d.mts +1 -0
- package/es/DatePicker/core/PickerPanel/index.mjs +175 -0
- package/es/DatePicker/core/PickerPanel/index.mjs.map +1 -0
- package/es/DatePicker/core/PickerPopup.mjs +118 -0
- package/es/DatePicker/core/PickerPopup.mjs.map +1 -0
- package/es/DatePicker/core/generate/dayjs.mjs +109 -0
- package/es/DatePicker/core/generate/dayjs.mjs.map +1 -0
- package/es/DatePicker/core/generate/index.d.mts +40 -0
- package/es/DatePicker/core/hooks/react.mjs +58 -0
- package/es/DatePicker/core/hooks/react.mjs.map +1 -0
- package/es/DatePicker/core/hooks/useLocale.mjs +51 -0
- package/es/DatePicker/core/hooks/useLocale.mjs.map +1 -0
- package/es/DatePicker/core/hooks/useSemantic.mjs +20 -0
- package/es/DatePicker/core/hooks/useSemantic.mjs.map +1 -0
- package/es/DatePicker/core/hooks/useSyncState.mjs +25 -0
- package/es/DatePicker/core/hooks/useSyncState.mjs.map +1 -0
- package/es/DatePicker/core/hooks/useTimeConfig.mjs +173 -0
- package/es/DatePicker/core/hooks/useTimeConfig.mjs.map +1 -0
- package/es/DatePicker/core/hooks/useTimeInfo.mjs +110 -0
- package/es/DatePicker/core/hooks/useTimeInfo.mjs.map +1 -0
- package/es/DatePicker/core/hooks/useToggleDates.mjs +21 -0
- package/es/DatePicker/core/hooks/useToggleDates.mjs.map +1 -0
- package/es/DatePicker/core/index.d.mts +5 -0
- package/es/DatePicker/core/index.mjs +9 -0
- package/es/DatePicker/core/index.mjs.map +1 -0
- package/es/DatePicker/core/interface.d.mts +325 -0
- package/es/DatePicker/core/locale/common.mjs +11 -0
- package/es/DatePicker/core/locale/common.mjs.map +1 -0
- package/es/DatePicker/core/locale/en_US.mjs +39 -0
- package/es/DatePicker/core/locale/en_US.mjs.map +1 -0
- package/es/DatePicker/core/utils/common.mjs +73 -0
- package/es/DatePicker/core/utils/common.mjs.map +1 -0
- package/es/DatePicker/core/utils/dateUtil.mjs +106 -0
- package/es/DatePicker/core/utils/dateUtil.mjs.map +1 -0
- package/es/DatePicker/core/utils/miscUtil.mjs +46 -0
- package/es/DatePicker/core/utils/miscUtil.mjs.map +1 -0
- package/es/DatePicker/core/utils/uiUtil.mjs +9 -0
- package/es/DatePicker/core/utils/uiUtil.mjs.map +1 -0
- package/es/DatePicker/generateConfig.mjs +12 -0
- package/es/DatePicker/generateConfig.mjs.map +1 -0
- package/es/DatePicker/generatePicker.d.mts +12 -0
- package/es/DatePicker/generatePicker.mjs +22 -0
- package/es/DatePicker/generatePicker.mjs.map +1 -0
- package/es/DatePicker/index.d.mts +6 -3
- package/es/DatePicker/index.mjs +3 -1
- package/es/DatePicker/locale.d.mts +15 -0
- package/es/DatePicker/locale.mjs +143 -0
- package/es/DatePicker/locale.mjs.map +1 -0
- package/es/DatePicker/semantic.mjs +29 -0
- package/es/DatePicker/semantic.mjs.map +1 -0
- package/es/DatePicker/style.mjs +3 -155
- package/es/DatePicker/style.mjs.map +1 -1
- package/es/DatePicker/type.d.mts +268 -27
- package/es/DatePicker/usePanelKeyboard.mjs +230 -0
- package/es/DatePicker/usePanelKeyboard.mjs.map +1 -0
- package/es/DatePicker/usePickerShared.mjs +106 -0
- package/es/DatePicker/usePickerShared.mjs.map +1 -0
- package/es/DatePicker/usePresetActive.mjs +48 -0
- package/es/DatePicker/usePresetActive.mjs.map +1 -0
- package/es/DraggablePanel/atoms.mjs +5 -5
- package/es/DraggablePanel/atoms.mjs.map +1 -1
- package/es/DraggableSideNav/DraggableSideNav.mjs +3 -3
- package/es/DraggableSideNav/DraggableSideNav.mjs.map +1 -1
- package/es/Drawer/Drawer.mjs +2 -2
- package/es/Drawer/Drawer.mjs.map +1 -1
- package/es/Drawer/atoms.mjs +6 -6
- package/es/Drawer/atoms.mjs.map +1 -1
- package/es/DropdownMenu/atoms.mjs +22 -22
- package/es/DropdownMenu/atoms.mjs.map +1 -1
- package/es/DropdownMenu/sharedStyle.mjs +2 -2
- package/es/DropdownMenu/sharedStyle.mjs.map +1 -1
- package/es/EditableText/EditableText.mjs +1 -1
- package/es/EditorSlashMenu/atoms.mjs +12 -12
- package/es/EditorSlashMenu/atoms.mjs.map +1 -1
- package/es/EmojiPicker/EmojiPicker.mjs +7 -7
- package/es/EmojiPicker/EmojiPicker.mjs.map +1 -1
- package/es/EmojiPicker/loadEmojiData.mjs +6 -0
- package/es/EmojiPicker/loadEmojiData.mjs.map +1 -0
- package/es/FloatingPanel/FloatingPanel.mjs +2 -2
- package/es/FloatingPanel/FloatingPanel.mjs.map +1 -1
- package/es/FormKit/List.mjs +2 -2
- package/es/FormKit/List.mjs.map +1 -1
- package/es/Highlighter/FullFeatured.mjs +2 -2
- package/es/Highlighter/FullFeatured.mjs.map +1 -1
- package/es/Highlighter/SyntaxHighlighter/StreamRenderer.mjs +2 -2
- package/es/Highlighter/SyntaxHighlighter/StreamRenderer.mjs.map +1 -1
- package/es/Highlighter/SyntaxHighlighter/index.mjs +4 -4
- package/es/Highlighter/SyntaxHighlighter/index.mjs.map +1 -1
- package/es/Highlighter/style.mjs +2 -2
- package/es/Highlighter/style.mjs.map +1 -1
- package/es/HtmlPreview/HtmlPreview.mjs +2 -2
- package/es/HtmlPreview/HtmlPreview.mjs.map +1 -1
- package/es/Icon/Icon.mjs +2 -2
- package/es/Icon/Icon.mjs.map +1 -1
- package/es/List/ListRow.mjs +3 -3
- package/es/List/ListRow.mjs.map +1 -1
- package/es/Markdown/Markdown.mjs +2 -2
- package/es/Markdown/Markdown.mjs.map +1 -1
- package/es/Markdown/Typography.mjs +2 -2
- package/es/Markdown/Typography.mjs.map +1 -1
- package/es/Mermaid/FullFeatured.mjs +2 -2
- package/es/Mermaid/FullFeatured.mjs.map +1 -1
- package/es/Mermaid/SyntaxMermaid/index.mjs +4 -4
- package/es/Mermaid/SyntaxMermaid/index.mjs.map +1 -1
- package/es/Modal/atoms.mjs +6 -6
- package/es/Modal/atoms.mjs.map +1 -1
- package/es/Pagination/Pagination.mjs +181 -41
- package/es/Pagination/Pagination.mjs.map +1 -1
- package/es/Pagination/helpers.mjs +3 -3
- package/es/Pagination/helpers.mjs.map +1 -1
- package/es/Pagination/index.d.mts +2 -2
- package/es/Pagination/marker.stylex.mjs +9 -0
- package/es/Pagination/marker.stylex.mjs.map +1 -0
- package/es/Pagination/style.mjs +74 -4
- package/es/Pagination/style.mjs.map +1 -1
- package/es/Pagination/type.d.mts +41 -3
- package/es/Popover/PopoverInGroup.mjs +2 -2
- package/es/Popover/PopoverInGroup.mjs.map +1 -1
- package/es/Popover/atoms.mjs +6 -6
- package/es/Popover/atoms.mjs.map +1 -1
- package/es/ProTable/ProTable.d.mts +11 -0
- package/es/ProTable/ProTable.mjs +208 -0
- package/es/ProTable/ProTable.mjs.map +1 -0
- package/es/ProTable/hooks/useColumnRequest.mjs +55 -0
- package/es/ProTable/hooks/useColumnRequest.mjs.map +1 -0
- package/es/ProTable/hooks/useColumnsState.mjs +37 -0
- package/es/ProTable/hooks/useColumnsState.mjs.map +1 -0
- package/es/ProTable/hooks/useDelayedFlag.mjs +18 -0
- package/es/ProTable/hooks/useDelayedFlag.mjs.map +1 -0
- package/es/ProTable/hooks/useDensity.mjs +15 -0
- package/es/ProTable/hooks/useDensity.mjs.map +1 -0
- package/es/ProTable/hooks/useFetchData.mjs +97 -0
- package/es/ProTable/hooks/useFetchData.mjs.map +1 -0
- package/es/ProTable/hooks/useFullscreen.mjs +22 -0
- package/es/ProTable/hooks/useFullscreen.mjs.map +1 -0
- package/es/ProTable/hooks/usePageInfo.mjs +35 -0
- package/es/ProTable/hooks/usePageInfo.mjs.map +1 -0
- package/es/ProTable/hooks/useProColumns.mjs +123 -0
- package/es/ProTable/hooks/useProColumns.mjs.map +1 -0
- package/es/ProTable/hooks/useProLoading.mjs +19 -0
- package/es/ProTable/hooks/useProLoading.mjs.map +1 -0
- package/es/ProTable/hooks/useProLocale.mjs +22 -0
- package/es/ProTable/hooks/useProLocale.mjs.map +1 -0
- package/es/ProTable/hooks/useProRequest.mjs +137 -0
- package/es/ProTable/hooks/useProRequest.mjs.map +1 -0
- package/es/ProTable/hooks/useRowCache.mjs +11 -0
- package/es/ProTable/hooks/useRowCache.mjs.map +1 -0
- package/es/ProTable/hooks/useSearchForm.mjs +141 -0
- package/es/ProTable/hooks/useSearchForm.mjs.map +1 -0
- package/es/ProTable/hooks/useTableBindings.mjs +39 -0
- package/es/ProTable/hooks/useTableBindings.mjs.map +1 -0
- package/es/ProTable/hooks/useTableSelection.mjs +14 -0
- package/es/ProTable/hooks/useTableSelection.mjs.map +1 -0
- package/es/ProTable/index.d.mts +4 -0
- package/es/ProTable/index.d.ts +1 -0
- package/es/ProTable/index.js +1 -0
- package/es/ProTable/index.mjs +3 -0
- package/es/ProTable/locale.d.mts +15 -0
- package/es/ProTable/locale.mjs +66 -0
- package/es/ProTable/locale.mjs.map +1 -0
- package/es/ProTable/parts/ColumnSetting.mjs +155 -0
- package/es/ProTable/parts/ColumnSetting.mjs.map +1 -0
- package/es/ProTable/parts/FieldControl.mjs +117 -0
- package/es/ProTable/parts/FieldControl.mjs.map +1 -0
- package/es/ProTable/parts/KeywordInput.mjs +19 -0
- package/es/ProTable/parts/KeywordInput.mjs.map +1 -0
- package/es/ProTable/parts/LightFilter.mjs +70 -0
- package/es/ProTable/parts/LightFilter.mjs.map +1 -0
- package/es/ProTable/parts/OptionPopover.mjs +17 -0
- package/es/ProTable/parts/OptionPopover.mjs.map +1 -0
- package/es/ProTable/parts/SearchForm.mjs +180 -0
- package/es/ProTable/parts/SearchForm.mjs.map +1 -0
- package/es/ProTable/parts/SearchSection.mjs +33 -0
- package/es/ProTable/parts/SearchSection.mjs.map +1 -0
- package/es/ProTable/parts/TableAlert.mjs +38 -0
- package/es/ProTable/parts/TableAlert.mjs.map +1 -0
- package/es/ProTable/parts/Toolbar.mjs +50 -0
- package/es/ProTable/parts/Toolbar.mjs.map +1 -0
- package/es/ProTable/parts/ToolbarOptions.mjs +103 -0
- package/es/ProTable/parts/ToolbarOptions.mjs.map +1 -0
- package/es/ProTable/parts/renderValue.mjs +118 -0
- package/es/ProTable/parts/renderValue.mjs.map +1 -0
- package/es/ProTable/style.mjs +278 -0
- package/es/ProTable/style.mjs.map +1 -0
- package/es/ProTable/type.d.mts +397 -0
- package/es/ProTable/utils.mjs +152 -0
- package/es/ProTable/utils.mjs.map +1 -0
- package/es/Radio/Radio.mjs +3 -3
- package/es/Radio/Radio.mjs.map +1 -1
- package/es/ScrollArea/atoms.mjs +4 -4
- package/es/ScrollArea/atoms.mjs.map +1 -1
- package/es/Segmented/Segmented.mjs +3 -3
- package/es/Segmented/Segmented.mjs.map +1 -1
- package/es/Segmented/atoms.mjs +2 -2
- package/es/Segmented/atoms.mjs.map +1 -1
- package/es/Select/Select.mjs +22 -13
- package/es/Select/Select.mjs.map +1 -1
- package/es/Select/atoms.mjs +4 -4
- package/es/Select/atoms.mjs.map +1 -1
- package/es/Select/helpers.mjs +8 -1
- package/es/Select/helpers.mjs.map +1 -1
- package/es/Select/hooks.mjs +8 -4
- package/es/Select/hooks.mjs.map +1 -1
- package/es/Select/renderOptions.mjs +2 -2
- package/es/Select/renderOptions.mjs.map +1 -1
- package/es/Select/type.d.mts +7 -0
- package/es/Switch/Switch.mjs +2 -2
- package/es/Switch/Switch.mjs.map +1 -1
- package/es/Switch/atoms.mjs +2 -2
- package/es/Switch/atoms.mjs.map +1 -1
- package/es/Table/Column.d.mts +8 -0
- package/es/Table/Column.mjs +6 -0
- package/es/Table/Column.mjs.map +1 -0
- package/es/Table/ColumnGroup.d.mts +11 -0
- package/es/Table/ColumnGroup.mjs +6 -0
- package/es/Table/ColumnGroup.mjs.map +1 -0
- package/es/Table/Table.d.mts +16 -2
- package/es/Table/Table.mjs +149 -118
- package/es/Table/Table.mjs.map +1 -1
- package/es/Table/atoms/cells.d.mts +42 -0
- package/es/Table/atoms/cells.mjs +72 -0
- package/es/Table/atoms/cells.mjs.map +1 -0
- package/es/Table/atoms/index.d.mts +3 -0
- package/es/Table/atoms/layout.d.mts +44 -0
- package/es/Table/atoms/layout.mjs +62 -0
- package/es/Table/atoms/layout.mjs.map +1 -0
- package/es/Table/constants.mjs +16 -0
- package/es/Table/constants.mjs.map +1 -0
- package/es/Table/engine/fixed.d.mts +1 -0
- package/es/Table/engine/fixed.mjs +53 -0
- package/es/Table/engine/fixed.mjs.map +1 -0
- package/es/Table/engine/types.d.mts +1 -0
- package/es/Table/engine/useTableEngine.mjs +180 -0
- package/es/Table/engine/useTableEngine.mjs.map +1 -0
- package/es/Table/index.d.mts +7 -2
- package/es/Table/index.mjs +4 -1
- package/es/Table/internal.d.mts +3 -0
- package/es/Table/pipeline/columnUtils.d.mts +5 -0
- package/es/Table/pipeline/columnUtils.mjs +58 -0
- package/es/Table/pipeline/columnUtils.mjs.map +1 -0
- package/es/Table/pipeline/convertChildrenToColumns.mjs +24 -0
- package/es/Table/pipeline/convertChildrenToColumns.mjs.map +1 -0
- package/es/Table/pipeline/normalizeColumns.mjs +140 -0
- package/es/Table/pipeline/normalizeColumns.mjs.map +1 -0
- package/es/Table/pipeline/selectionUtils.d.mts +9 -0
- package/es/Table/pipeline/selectionUtils.mjs +115 -0
- package/es/Table/pipeline/selectionUtils.mjs.map +1 -0
- package/es/Table/pipeline/useBreakpoint.mjs +36 -0
- package/es/Table/pipeline/useBreakpoint.mjs.map +1 -0
- package/es/Table/pipeline/useExpandable.mjs +45 -0
- package/es/Table/pipeline/useExpandable.mjs.map +1 -0
- package/es/Table/pipeline/useFilter.mjs +52 -0
- package/es/Table/pipeline/useFilter.mjs.map +1 -0
- package/es/Table/pipeline/useSelection.mjs +302 -0
- package/es/Table/pipeline/useSelection.mjs.map +1 -0
- package/es/Table/pipeline/useSorter.mjs +146 -0
- package/es/Table/pipeline/useSorter.mjs.map +1 -0
- package/es/Table/pipeline/useTableLocale.mjs +30 -0
- package/es/Table/pipeline/useTableLocale.mjs.map +1 -0
- package/es/Table/pipeline/useTableState.mjs +118 -0
- package/es/Table/pipeline/useTableState.mjs.map +1 -0
- package/es/Table/pipeline/useVirtualLayout.mjs +80 -0
- package/es/Table/pipeline/useVirtualLayout.mjs.map +1 -0
- package/es/Table/render/Body.mjs +150 -0
- package/es/Table/render/Body.mjs.map +1 -0
- package/es/Table/render/BodyCell.mjs +87 -0
- package/es/Table/render/BodyCell.mjs.map +1 -0
- package/es/Table/render/CellShell.mjs +84 -0
- package/es/Table/render/CellShell.mjs.map +1 -0
- package/es/Table/render/ExpandIcon.mjs +28 -0
- package/es/Table/render/ExpandIcon.mjs.map +1 -0
- package/es/Table/render/FilterDropdown.mjs +139 -0
- package/es/Table/render/FilterDropdown.mjs.map +1 -0
- package/es/Table/render/FilterPanel.mjs +152 -0
- package/es/Table/render/FilterPanel.mjs.map +1 -0
- package/es/Table/render/FixedFrost.mjs +113 -0
- package/es/Table/render/FixedFrost.mjs.map +1 -0
- package/es/Table/render/FixedHolder.mjs +51 -0
- package/es/Table/render/FixedHolder.mjs.map +1 -0
- package/es/Table/render/Header.mjs +184 -0
- package/es/Table/render/Header.mjs.map +1 -0
- package/es/Table/render/LoadingSkeleton.mjs +78 -0
- package/es/Table/render/LoadingSkeleton.mjs.map +1 -0
- package/es/Table/render/PaginationBar.mjs +71 -0
- package/es/Table/render/PaginationBar.mjs.map +1 -0
- package/es/Table/render/SelectionCells.mjs +111 -0
- package/es/Table/render/SelectionCells.mjs.map +1 -0
- package/es/Table/render/StickyScrollBar.mjs +99 -0
- package/es/Table/render/StickyScrollBar.mjs.map +1 -0
- package/es/Table/render/Summary.d.mts +16 -0
- package/es/Table/render/Summary.mjs +58 -0
- package/es/Table/render/Summary.mjs.map +1 -0
- package/es/Table/render/TableView.mjs +215 -0
- package/es/Table/render/TableView.mjs.map +1 -0
- package/es/Table/render/VirtualBody.mjs +101 -0
- package/es/Table/render/VirtualBody.mjs.map +1 -0
- package/es/Table/render/context.mjs +15 -0
- package/es/Table/render/context.mjs.map +1 -0
- package/es/Table/render/filterUtils.mjs +22 -0
- package/es/Table/render/filterUtils.mjs.map +1 -0
- package/es/Table/render/tableHelpers.mjs +27 -0
- package/es/Table/render/tableHelpers.mjs.map +1 -0
- package/es/Table/render/useColGroups.mjs +23 -0
- package/es/Table/render/useColGroups.mjs.map +1 -0
- package/es/Table/render/useScrollSync.mjs +104 -0
- package/es/Table/render/useScrollSync.mjs.map +1 -0
- package/es/Table/render/useViewContexts.mjs +134 -0
- package/es/Table/render/useViewContexts.mjs.map +1 -0
- package/es/Table/semantic.mjs +45 -0
- package/es/Table/semantic.mjs.map +1 -0
- package/es/Table/store/createTableStore.d.mts +1 -0
- package/es/Table/store/createTableStore.mjs +40 -0
- package/es/Table/store/createTableStore.mjs.map +1 -0
- package/es/Table/store/hooks.mjs +24 -0
- package/es/Table/store/hooks.mjs.map +1 -0
- package/es/Table/style.mjs +175 -90
- package/es/Table/style.mjs.map +1 -1
- package/es/Table/type.d.mts +467 -37
- package/es/Table/useTableController.mjs +293 -0
- package/es/Table/useTableController.mjs.map +1 -0
- package/es/Tabs/Tabs.mjs +2 -2
- package/es/Tabs/Tabs.mjs.map +1 -1
- package/es/Tabs/atoms.mjs +2 -2
- package/es/Tabs/atoms.mjs.map +1 -1
- package/es/Tabs/style.d.mts +1 -1
- package/es/Tag/Tag.mjs +2 -2
- package/es/Tag/Tag.mjs.map +1 -1
- package/es/Text/Text.mjs +2 -2
- package/es/Text/Text.mjs.map +1 -1
- package/es/Text/style.d.mts +3 -3
- package/es/Text/style.mjs +3 -3
- package/es/Text/style.mjs.map +1 -1
- package/es/ToggleGroup/ToggleGroup.mjs +3 -3
- package/es/ToggleGroup/ToggleGroup.mjs.map +1 -1
- package/es/ToggleGroup/atoms.mjs +2 -2
- package/es/ToggleGroup/atoms.mjs.map +1 -1
- package/es/Tooltip/TooltipGroup.mjs +3 -3
- package/es/Tooltip/TooltipGroup.mjs.map +1 -1
- package/es/Tooltip/TooltipStandalone.mjs +3 -3
- package/es/Tooltip/TooltipStandalone.mjs.map +1 -1
- package/es/Tree/Tree.mjs +2 -2
- package/es/Tree/Tree.mjs.map +1 -1
- package/es/Tree/TreeNode.mjs +2 -2
- package/es/Tree/TreeNode.mjs.map +1 -1
- package/es/Video/Video.mjs +2 -2
- package/es/Video/Video.mjs.map +1 -1
- package/es/awesome/Features/FeatureItem.mjs +2 -2
- package/es/awesome/Features/FeatureItem.mjs.map +1 -1
- package/es/awesome/Hero/Hero.mjs +3 -3
- package/es/awesome/Hero/Hero.mjs.map +1 -1
- package/es/awesome/InstallBanner/InstallBanner.mjs +2 -2
- package/es/awesome/InstallBanner/InstallBanner.mjs.map +1 -1
- package/es/awesome/LandingHero/LandingHero.mjs +3 -3
- package/es/awesome/LandingHero/LandingHero.mjs.map +1 -1
- package/es/awesome/LogoMarquee/LogoMarquee.mjs +2 -2
- package/es/awesome/LogoMarquee/LogoMarquee.mjs.map +1 -1
- package/es/awesome/TypewriterEffect/TypewriterEffect.mjs +4 -4
- package/es/awesome/TypewriterEffect/TypewriterEffect.mjs.map +1 -1
- package/es/awesome/landingActions.mjs +2 -2
- package/es/awesome/landingActions.mjs.map +1 -1
- package/es/chat/ChatItem/ChatItem.mjs +2 -2
- package/es/chat/ChatItem/ChatItem.mjs.map +1 -1
- package/es/chat/EditableMessage/EditableMessage.mjs +3 -3
- package/es/chat/EditableMessage/EditableMessage.mjs.map +1 -1
- package/es/chat/EditableMessageList/EditableMessageList.mjs +1 -1
- package/es/chat/MessageInput/MessageInput.mjs +3 -3
- package/es/chat/MessageInput/MessageInput.mjs.map +1 -1
- package/es/dashboard/AuthLayout/AuthLayout.mjs +8 -4
- package/es/dashboard/AuthLayout/AuthLayout.mjs.map +1 -1
- package/es/dashboard/AuthLayout/style.mjs +14 -3
- package/es/dashboard/AuthLayout/style.mjs.map +1 -1
- package/es/dashboard/AuthTools/AuthLocaleSwitch.mjs +2 -2
- package/es/dashboard/AuthTools/AuthLocaleSwitch.mjs.map +1 -1
- package/es/dashboard/AuthTools/AuthThemeSwitch.mjs +2 -2
- package/es/dashboard/AuthTools/AuthThemeSwitch.mjs.map +1 -1
- package/es/dashboard/ConsoleNav/ConsoleNav.mjs +3 -3
- package/es/dashboard/ConsoleNav/ConsoleNav.mjs.map +1 -1
- package/es/dashboard/ConsoleNav/style.mjs +2 -2
- package/es/dashboard/ConsoleNav/style.mjs.map +1 -1
- package/es/dashboard/ConsoleShell/style.mjs +1 -1
- package/es/dashboard/ConsoleShell/style.mjs.map +1 -1
- package/es/dashboard/FilterSidebar/FilterSidebar.mjs +1 -1
- package/es/dashboard/FilterSidebar/style.mjs +2 -2
- package/es/dashboard/FilterSidebar/style.mjs.map +1 -1
- package/es/dashboard/FilterStrip/style.mjs +1 -1
- package/es/dashboard/FilterStrip/style.mjs.map +1 -1
- package/es/dashboard/MetricStrip/MetricCell.mjs +25 -14
- package/es/dashboard/MetricStrip/MetricCell.mjs.map +1 -1
- package/es/dashboard/MetricStrip/style.mjs +14 -1
- package/es/dashboard/MetricStrip/style.mjs.map +1 -1
- package/es/dashboard/MetricStrip/type.d.mts +2 -0
- package/es/dashboard/PageSkeleton/style.mjs +2 -1
- package/es/dashboard/PageSkeleton/style.mjs.map +1 -1
- package/es/dashboard/StatCard/StatCard.d.mts +1 -1
- package/es/dashboard/StatCard/StatCard.mjs +2 -1
- package/es/dashboard/StatCard/StatCard.mjs.map +1 -1
- package/es/dashboard/StatCard/type.d.mts +2 -0
- package/es/dashboard/Surface/Surface.mjs +3 -4
- package/es/dashboard/Surface/Surface.mjs.map +1 -1
- package/es/dashboard/Surface/link.mjs +1 -1
- package/es/dashboard/Surface/link.mjs.map +1 -1
- package/es/dashboard/Surface/style.mjs +15 -14
- package/es/dashboard/Surface/style.mjs.map +1 -1
- package/es/dashboard/index.mjs +2 -2
- package/es/eslint/noBaseUiSubpath.mjs +2 -1
- package/es/eslint/noBaseUiSubpath.mjs.map +1 -1
- package/es/i18n/resources/en/colorPicker.d.mts +5 -0
- package/es/i18n/resources/en/colorPicker.mjs +5 -0
- package/es/i18n/resources/en/colorPicker.mjs.map +1 -1
- package/es/i18n/resources/en/datePicker.d.mts +54 -0
- package/es/i18n/resources/en/datePicker.mjs +55 -1
- package/es/i18n/resources/en/datePicker.mjs.map +1 -1
- package/es/i18n/resources/en/index.d.mts +4 -3
- package/es/i18n/resources/en/index.mjs +3 -1
- package/es/i18n/resources/en/index.mjs.map +1 -1
- package/es/i18n/resources/en/table.d.mts +23 -0
- package/es/i18n/resources/en/table.mjs +24 -0
- package/es/i18n/resources/en/table.mjs.map +1 -0
- package/es/i18n/resources/zhCn/colorPicker.d.mts +5 -0
- package/es/i18n/resources/zhCn/colorPicker.mjs +5 -0
- package/es/i18n/resources/zhCn/colorPicker.mjs.map +1 -1
- package/es/i18n/resources/zhCn/datePicker.d.mts +54 -0
- package/es/i18n/resources/zhCn/datePicker.mjs +55 -1
- package/es/i18n/resources/zhCn/datePicker.mjs.map +1 -1
- package/es/i18n/resources/zhCn/index.d.mts +4 -3
- package/es/i18n/resources/zhCn/index.mjs +4 -2
- package/es/i18n/resources/zhCn/index.mjs.map +1 -1
- package/es/i18n/resources/zhCn/table.d.mts +23 -0
- package/es/i18n/resources/zhCn/table.mjs +24 -0
- package/es/i18n/resources/zhCn/table.mjs.map +1 -0
- package/es/i18n/types.d.mts +3 -2
- package/es/index.d.mts +15 -7
- package/es/index.mjs +14 -9
- package/es/internal/overflow/OverflowList.mjs +71 -0
- package/es/internal/overflow/OverflowList.mjs.map +1 -0
- package/es/mdx/Callout/index.mjs +2 -2
- package/es/mdx/Callout/index.mjs.map +1 -1
- package/es/mdx/Cards/Card.mjs +2 -2
- package/es/mdx/Cards/Card.mjs.map +1 -1
- package/es/mdx/Cards/index.mjs +2 -2
- package/es/mdx/Cards/index.mjs.map +1 -1
- package/es/mdx/Mdx/index.mjs +2 -2
- package/es/mdx/Mdx/index.mjs.map +1 -1
- package/es/mdx/Steps/index.mjs +2 -2
- package/es/mdx/Steps/index.mjs.map +1 -1
- package/es/mdx/mdxComponents/Pre.mjs +5 -5
- package/es/mdx/mdxComponents/Pre.mjs.map +1 -1
- package/es/storybook/StoryBook/style.mjs +2 -0
- package/es/storybook/StoryBook/style.mjs.map +1 -1
- package/es/style.css +2966 -957
- package/es/styles/createGlobalStyle.mjs +1 -1
- package/es/styles/index.d.mts +3 -2
- package/es/styles/index.mjs +5 -4
- package/es/styles/stylex/props.mjs +2 -2
- package/es/styles/stylex/props.mjs.map +1 -1
- package/es/styles/theme/createLobeToken.d.mts +3 -2
- package/es/styles/theme/createLobeToken.mjs.map +1 -1
- package/es/styles/theme/customPrimary.d.mts +7 -0
- package/es/styles/theme/customPrimary.mjs +66 -0
- package/es/styles/theme/customPrimary.mjs.map +1 -0
- package/es/styles/theme/scope.d.mts +4 -3
- package/es/styles/theme/scope.mjs +30 -8
- package/es/styles/theme/scope.mjs.map +1 -1
- package/es/styles/theme/themeCss.d.mts +2 -0
- package/es/styles/theme/themeCss.mjs +24 -2
- package/es/styles/theme/themeCss.mjs.map +1 -1
- package/es/styles/theme/token/primary.mjs +6 -2
- package/es/styles/theme/token/primary.mjs.map +1 -1
- package/es/theme.css +8 -0
- package/package.json +6 -1
- package/es/DatePicker/CalendarPanel.mjs +0 -189
- package/es/DatePicker/CalendarPanel.mjs.map +0 -1
- package/es/DatePicker/PickerShell.mjs +0 -43
- package/es/DatePicker/PickerShell.mjs.map +0 -1
- package/es/DatePicker/calendar.d.mts +0 -4
- package/es/DatePicker/calendar.mjs +0 -46
- package/es/DatePicker/calendar.mjs.map +0 -1
- package/es/Table/FilterMenu.mjs +0 -45
- package/es/Table/FilterMenu.mjs.map +0 -1
- package/es/Table/TableBody.mjs +0 -67
- package/es/Table/TableBody.mjs.map +0 -1
- package/es/Table/TableHead.mjs +0 -58
- package/es/Table/TableHead.mjs.map +0 -1
- package/es/Table/features.mjs +0 -12
- package/es/Table/features.mjs.map +0 -1
- package/es/Table/fixedOffsets.mjs +0 -29
- package/es/Table/fixedOffsets.mjs.map +0 -1
- package/es/Table/marker.stylex.mjs +0 -9
- package/es/Table/marker.stylex.mjs.map +0 -1
- package/es/Table/toColumnDefs.mjs +0 -26
- package/es/Table/toColumnDefs.mjs.map +0 -1
- package/es/Table/useTableState.mjs +0 -99
- package/es/Table/useTableState.mjs.map +0 -1
package/es/Drawer/atoms.mjs
CHANGED
|
@@ -11,7 +11,7 @@ import { DrawerLayerProvider, useDrawerLayer } from "./DrawerLayerContext.mjs";
|
|
|
11
11
|
import { styles } from "./style.mjs";
|
|
12
12
|
import { cloneElement, createContext, createElement, isValidElement, use, useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
13
13
|
import { jsx } from "react/jsx-runtime";
|
|
14
|
-
import clsx from "clsx";
|
|
14
|
+
import clsx$1 from "clsx";
|
|
15
15
|
import * as stylex from "@stylexjs/stylex";
|
|
16
16
|
import { X } from "lucide-react";
|
|
17
17
|
import { mergeProps } from "@base-ui/react/merge-props";
|
|
@@ -20,8 +20,8 @@ import { AnimatePresence } from "motion/react";
|
|
|
20
20
|
//#region src/Drawer/atoms.tsx
|
|
21
21
|
const mergeStateClassName = (xstyle, className) => {
|
|
22
22
|
const base = stylex.props(xstyle).className;
|
|
23
|
-
if (typeof className === "function") return (state) => clsx(base, className(state));
|
|
24
|
-
return clsx(base, className);
|
|
23
|
+
if (typeof className === "function") return (state) => clsx$1(base, className(state));
|
|
24
|
+
return clsx$1(base, className);
|
|
25
25
|
};
|
|
26
26
|
const popupPlacementClass = {
|
|
27
27
|
bottom: styles.popupBottom,
|
|
@@ -114,7 +114,7 @@ const DrawerBackdrop = ({ className, style, ...rest }) => {
|
|
|
114
114
|
const layerStyle = layer?.zIndex !== void 0 ? { zIndex: layer.zIndex } : void 0;
|
|
115
115
|
if (open !== null) return /* @__PURE__ */ jsx(Dialog.Backdrop, {
|
|
116
116
|
...rest,
|
|
117
|
-
className: clsx(stylex.props(styles.backdrop).className, className),
|
|
117
|
+
className: clsx$1(stylex.props(styles.backdrop).className, className),
|
|
118
118
|
style: {
|
|
119
119
|
...layerStyle,
|
|
120
120
|
...style,
|
|
@@ -159,12 +159,12 @@ const DrawerPopupImpl = ({ className, children, placement: placementProp = "righ
|
|
|
159
159
|
...popupStyle
|
|
160
160
|
};
|
|
161
161
|
const popupXstyle = [styles.popup, popupPlacementClass[placement]];
|
|
162
|
-
const resolvedPanelClassName = clsx(stylex.props(styles.panel, panelPlacementClass[placement], flush ? styles.panelFlush : panelRoundedClass[placement], panelXstyle).className, panelClassName);
|
|
162
|
+
const resolvedPanelClassName = clsx$1(stylex.props(styles.panel, panelPlacementClass[placement], flush ? styles.panelFlush : panelRoundedClass[placement], panelXstyle).className, panelClassName);
|
|
163
163
|
if (open !== null && actions) {
|
|
164
164
|
const motionConfig = getDrawerMotionConfig(placement, pushOffset);
|
|
165
165
|
return /* @__PURE__ */ jsx(Dialog.Popup, {
|
|
166
166
|
...rest,
|
|
167
|
-
className: clsx(stylex.props(popupXstyle).className, className),
|
|
167
|
+
className: clsx$1(stylex.props(popupXstyle).className, className),
|
|
168
168
|
"data-drawer-anchor": placement,
|
|
169
169
|
ref: composedRef,
|
|
170
170
|
style: resolvedPopupStyle,
|
package/es/Drawer/atoms.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"atoms.mjs","names":[],"sources":["../../src/Drawer/atoms.tsx"],"sourcesContent":["'use client';\n\nimport { Dialog } from '@base-ui/react/dialog';\nimport { mergeProps } from '@base-ui/react/merge-props';\nimport * as stylex from '@stylexjs/stylex';\nimport clsx from 'clsx';\nimport { X } from 'lucide-react';\nimport { AnimatePresence } from 'motion/react';\nimport type React from 'react';\nimport {\n cloneElement,\n createContext,\n isValidElement,\n use,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\nimport { useAppElement } from '@/ConfigProvider/AppElementContext';\nimport { useNativeButton } from '@/hooks/useNativeButton';\nimport { useMotionComponent } from '@/MotionProvider';\nimport { focusRing } from '@/styles/stylex/focusRing';\nimport { styleProps } from '@/styles/stylex/props';\nimport { mergeRefs, useMergeRefs } from '@/utils/mergeRefs';\n\nimport { useLayerZIndex } from '../internal/zIndex';\nimport { drawerBackdropTransition, getDrawerMotionConfig, pushAxis } from './constants';\nimport { DrawerLayerProvider, useDrawerLayer } from './DrawerLayerContext';\nimport { styles } from './style';\nimport type { DrawerPlacement } from './type';\n\ntype XStyle = Parameters<typeof styleProps>[0];\n\nconst mergeStateClassName = <TState,>(\n xstyle: XStyle,\n className: string | ((state: TState) => string | undefined) | undefined,\n) => {\n const base = stylex.props(xstyle).className;\n if (typeof className === 'function') return (state: TState) => clsx(base, className(state));\n return clsx(base, className);\n};\n\nconst popupPlacementClass = {\n bottom: styles.popupBottom,\n left: styles.popupLeft,\n right: styles.popupRight,\n top: styles.popupTop,\n};\n\nconst panelPlacementClass = {\n bottom: styles.panelBottom,\n left: styles.panelLeft,\n right: styles.panelRight,\n top: styles.panelTop,\n};\n\nconst panelRoundedClass = {\n bottom: styles.panelRoundedBottom,\n left: styles.panelRoundedLeft,\n right: styles.panelRoundedRight,\n top: styles.panelRoundedTop,\n};\n\nconst DrawerOpenContext = createContext<boolean | null>(null);\n\ninterface DrawerAnimationActions {\n onExitComplete: () => void;\n}\nconst DrawerActionsContext = createContext<DrawerAnimationActions | null>(null);\n\nexport const useDrawerOpen = () => use(DrawerOpenContext);\nexport const useDrawerActions = () => use(DrawerActionsContext);\n\nexport type DrawerRootProps = Dialog.Root.Props & {\n onExitComplete?: () => void;\n zIndex?: number;\n};\n\nconst AnimatedDrawerRoot = ({\n open,\n children,\n onExitComplete: onExitCompleteProp,\n zIndex: explicitZIndex,\n ...rest\n}: Omit<DrawerRootProps, 'open'> & { open: boolean }) => {\n const [isPresent, setIsPresent] = useState(!!open);\n\n useEffect(() => {\n if (open) setIsPresent(true);\n }, [open]);\n\n const handleExitComplete = useCallback(() => {\n setIsPresent(false);\n onExitCompleteProp?.();\n }, [onExitCompleteProp]);\n\n const actions = useMemo(() => ({ onExitComplete: handleExitComplete }), [handleExitComplete]);\n\n const { zIndex, ref: popupRef } = useLayerZIndex<HTMLDivElement>('modal', explicitZIndex);\n const layer = useMemo(\n () => ({ popupRef: popupRef as (node: HTMLElement | null) => void, zIndex }),\n [zIndex, popupRef],\n );\n\n if (!isPresent) return null;\n\n return (\n <DrawerOpenContext value={open}>\n <DrawerActionsContext value={actions}>\n <DrawerLayerProvider value={layer}>\n <Dialog.Root modal open {...rest}>\n {children}\n </Dialog.Root>\n </DrawerLayerProvider>\n </DrawerActionsContext>\n </DrawerOpenContext>\n );\n};\n\nconst NonAnimatedDrawerRoot = ({ zIndex: explicitZIndex, children, ...rest }: DrawerRootProps) => {\n const { zIndex, ref: popupRef } = useLayerZIndex<HTMLDivElement>('modal', explicitZIndex);\n const layer = useMemo(\n () => ({ popupRef: popupRef as (node: HTMLElement | null) => void, zIndex }),\n [zIndex, popupRef],\n );\n\n return (\n <DrawerLayerProvider value={layer}>\n <Dialog.Root modal {...rest}>\n {children}\n </Dialog.Root>\n </DrawerLayerProvider>\n );\n};\n\nexport const DrawerRoot = ({ open, onExitComplete, ...rest }: DrawerRootProps) => {\n if (open !== undefined) {\n return <AnimatedDrawerRoot open={open} onExitComplete={onExitComplete} {...rest} />;\n }\n return <NonAnimatedDrawerRoot {...rest} />;\n};\n\nexport type DrawerPortalProps = React.ComponentProps<typeof Dialog.Portal> & {\n container?: HTMLElement | null;\n};\nexport const DrawerPortal = ({ container, ...rest }: DrawerPortalProps) => {\n const appElement = useAppElement();\n return <Dialog.Portal container={container ?? appElement ?? undefined} {...rest} />;\n};\n\nexport type DrawerBackdropProps = React.ComponentProps<typeof Dialog.Backdrop>;\nexport const DrawerBackdrop = ({ className, style, ...rest }: DrawerBackdropProps) => {\n const open = useDrawerOpen();\n const layer = useDrawerLayer();\n const Motion = useMotionComponent();\n const layerStyle = layer?.zIndex !== undefined ? { zIndex: layer.zIndex } : undefined;\n\n if (open !== null) {\n return (\n <Dialog.Backdrop\n {...rest}\n className={clsx(stylex.props(styles.backdrop).className, className as string)}\n style={{ ...layerStyle, ...style, transition: 'none' }}\n render={\n <Motion.div\n animate={{ opacity: open ? 1 : 0 }}\n initial={{ opacity: 0 }}\n transition={drawerBackdropTransition}\n />\n }\n />\n );\n }\n\n return (\n <Dialog.Backdrop\n {...rest}\n className={mergeStateClassName(styles.backdrop, className as any) as any}\n style={{ ...layerStyle, ...style }}\n />\n );\n};\n\nexport type DrawerPopupProps = React.ComponentProps<typeof Dialog.Popup> & {\n flush?: boolean;\n height?: number | string;\n motionProps?: Record<string, any>;\n panelClassName?: string;\n panelStyle?: React.CSSProperties;\n placement?: DrawerPlacement;\n popupStyle?: React.CSSProperties;\n pushOffset?: number;\n width?: number | string;\n};\n\nexport const DrawerPopupImpl = ({\n className,\n children,\n placement: placementProp = 'right',\n width: widthProp,\n height: heightProp,\n flush,\n pushOffset = 0,\n motionProps,\n panelClassName,\n panelStyle,\n panelXstyle,\n popupStyle,\n ref: forwardedRef,\n ...rest\n}: DrawerPopupProps & { panelXstyle?: XStyle }) => {\n const open = useDrawerOpen();\n const actions = useDrawerActions();\n const layer = useDrawerLayer();\n const Motion = useMotionComponent();\n const composedRef = useMergeRefs([forwardedRef, layer?.popupRef]);\n\n // The exiting panel lives inside AnimatePresence and keeps the props it had while open,\n // but this popup re-renders with whatever the consumer passes now. Freezing the geometry\n // during exit keeps the two in sync — otherwise a placement change on close teleports the\n // popup to the new edge while the panel animates out along the old axis.\n const openGeometryRef = useRef({\n height: heightProp,\n placement: placementProp,\n width: widthProp,\n });\n if (open !== false) {\n openGeometryRef.current = { height: heightProp, placement: placementProp, width: widthProp };\n }\n const { height, placement, width } = openGeometryRef.current;\n\n const isHorizontal = placement === 'left' || placement === 'right';\n const sizeStyle: React.CSSProperties = isHorizontal ? { width } : { height };\n const resolvedPopupStyle: React.CSSProperties = {\n ...(layer?.zIndex === undefined ? undefined : { zIndex: layer.zIndex + 1 }),\n ...sizeStyle,\n ...popupStyle,\n };\n const popupXstyle = [styles.popup, popupPlacementClass[placement]];\n const resolvedPanelClassName = clsx(\n stylex.props(\n styles.panel,\n panelPlacementClass[placement],\n flush ? styles.panelFlush : panelRoundedClass[placement],\n panelXstyle,\n ).className,\n panelClassName,\n );\n\n if (open !== null && actions) {\n const motionConfig = getDrawerMotionConfig(placement, pushOffset);\n return (\n <Dialog.Popup\n {...rest}\n className={clsx(stylex.props(popupXstyle).className, className as string)}\n data-drawer-anchor={placement}\n ref={composedRef as any}\n style={resolvedPopupStyle}\n >\n <AnimatePresence onExitComplete={actions.onExitComplete}>\n {open ? (\n <Motion.div\n {...motionConfig}\n {...motionProps}\n className={resolvedPanelClassName}\n data-drawer-placement={placement}\n key=\"drawer-popup-panel\"\n style={{ transition: 'none', ...panelStyle }}\n >\n {children}\n </Motion.div>\n ) : null}\n </AnimatePresence>\n </Dialog.Popup>\n );\n }\n\n const { axis, sign } = pushAxis[placement];\n const pushVars = {\n [axis === 'x' ? '--drawer-push-x' : '--drawer-push-y']: `${pushOffset * sign}px`,\n } as React.CSSProperties;\n\n return (\n <Dialog.Popup\n {...rest}\n className={mergeStateClassName(popupXstyle, className as any) as any}\n data-drawer-anchor={placement}\n ref={composedRef as any}\n style={resolvedPopupStyle}\n >\n <div\n className={resolvedPanelClassName}\n data-drawer-placement={placement}\n style={{ ...pushVars, ...panelStyle }}\n >\n {children}\n </div>\n </Dialog.Popup>\n );\n};\n\nexport const DrawerPopup: React.FC<DrawerPopupProps> = DrawerPopupImpl;\n\nexport type DrawerHeaderProps = React.HTMLAttributes<HTMLDivElement> & {\n ref?: React.Ref<HTMLDivElement>;\n};\nexport const DrawerHeader = ({ className, style, ...rest }: DrawerHeaderProps) => (\n <div {...rest} {...styleProps(styles.header, className, style)} />\n);\n\nexport type DrawerTitleProps = React.ComponentProps<typeof Dialog.Title>;\nexport const DrawerTitle = ({ className, ...rest }: DrawerTitleProps) => (\n <Dialog.Title {...rest} className={mergeStateClassName(styles.title, className as any) as any} />\n);\n\nexport type DrawerDescriptionProps = React.ComponentProps<typeof Dialog.Description>;\nexport const DrawerDescription: React.FC<DrawerDescriptionProps> = Dialog.Description;\n\nexport type DrawerContentProps = React.HTMLAttributes<HTMLDivElement> & {\n ref?: React.Ref<HTMLDivElement>;\n};\nexport const DrawerContentImpl = ({\n className,\n style,\n xstyle,\n ...rest\n}: DrawerContentProps & { xstyle?: XStyle }) => (\n <div {...rest} {...styleProps([styles.content, xstyle], className, style)} />\n);\nexport const DrawerContent: React.FC<DrawerContentProps> = DrawerContentImpl;\n\nexport type DrawerFooterProps = React.HTMLAttributes<HTMLDivElement> & {\n ref?: React.Ref<HTMLDivElement>;\n};\nexport const DrawerFooter = ({ className, style, ...rest }: DrawerFooterProps) => (\n <div {...rest} {...styleProps(styles.footer, className, style)} />\n);\n\nexport type DrawerCloseProps = React.ComponentProps<typeof Dialog.Close>;\nexport const DrawerClose = ({ className, children, ...rest }: DrawerCloseProps) => (\n <Dialog.Close\n {...rest}\n className={mergeStateClassName([styles.close, focusRing.info], className as any) as any}\n >\n {children ?? <X size={16} />}\n </Dialog.Close>\n);\n\nexport type DrawerTriggerProps = Omit<\n React.ComponentPropsWithRef<typeof Dialog.Trigger>,\n 'children' | 'render'\n> & {\n children?: React.ReactNode;\n nativeButton?: boolean;\n};\n\nexport const DrawerTrigger = ({\n children,\n className,\n nativeButton,\n ref: refProp,\n ...rest\n}: DrawerTriggerProps) => {\n const { isNativeButtonTriggerElement, resolvedNativeButton } = useNativeButton({\n children,\n nativeButton,\n });\n\n const renderer = (props: any) => {\n const resolvedProps = (() => {\n if (isNativeButtonTriggerElement) return props as any;\n // eslint-disable-next-line unused-imports/no-unused-vars\n const { type, ...restProps } = props as any;\n return restProps;\n })();\n\n const mergedProps = mergeProps((children as any).props, resolvedProps);\n return cloneElement(children as any, {\n ...mergedProps,\n ref: mergeRefs([(children as any).ref, (props as any).ref, refProp]),\n });\n };\n\n if (isValidElement(children)) {\n return (\n <Dialog.Trigger\n {...rest}\n className={className}\n nativeButton={resolvedNativeButton}\n render={renderer as any}\n />\n );\n }\n\n return (\n <Dialog.Trigger\n {...rest}\n className={className}\n nativeButton={resolvedNativeButton}\n ref={refProp as any}\n >\n {children}\n </Dialog.Trigger>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAsBA,MAAM,uBAAgC,QAAgB,cAA4E;CAChI,MAAM,OAAO,OAAO,MAAM,MAAM,CAAC,CAAC;CAClC,IAAI,OAAO,cAAc,YAAY,QAAQ,UAAkB,KAAK,MAAM,UAAU,KAAK,CAAC;CAC1F,OAAO,KAAK,MAAM,SAAS;AAC7B;AACA,MAAM,sBAAsB;CAC1B,QAAQ,OAAO;CACf,MAAM,OAAO;CACb,OAAO,OAAO;CACd,KAAK,OAAO;AACd;AACA,MAAM,sBAAsB;CAC1B,QAAQ,OAAO;CACf,MA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A,WACA,cACA,KAAK,SACL,GAAG,WACqB;CACxB,MAAM,EACJ,8BACA,yBACE,gBAAgB;EAClB;EACA;CACF,CAAC;CACD,MAAM,YAAY,UAAe;EAC/B,MAAM,uBAAuB;GAC3B,IAAI,8BAA8B,OAAO;GAEzC,MAAM,EACJ,MACA,GAAG,cACD;GACJ,OAAO;EACT,EAAA,CAAG;EACH,MAAM,cAAc,WAAY,SAAiB,OAAO,aAAa;EACrE,OAAO,aAAa,UAAiB;GACnC,GAAG;GACH,KAAK,UAAU;IAAE,SAAiB;IAAM,MAAc;IAAK;GAAO,CAAC;EACrE,CAAC;CACH;CACA,IAAI,eAAe,QAAQ,GACzB,OAAO,oBAAC,OAAO,SAAR;EAAgB,GAAI;EAAiB;EAAW,cAAc;EAAsB,QAAQ;CAAkB,CAAA;CAEvH,OAAO,oBAAC,OAAO,SAAR;EAAgB,GAAI;EAAiB;EAAW,cAAc;EAAsB,KAAK;EAC3F;CACa,CAAA;AACpB"}
|
|
1
|
+
{"version":3,"file":"atoms.mjs","names":["clsx"],"sources":["../../src/Drawer/atoms.tsx"],"sourcesContent":["'use client';\n\nimport { Dialog } from '@base-ui/react/dialog';\nimport { mergeProps } from '@base-ui/react/merge-props';\nimport * as stylex from '@stylexjs/stylex';\nimport clsx from 'clsx';\nimport { X } from 'lucide-react';\nimport { AnimatePresence } from 'motion/react';\nimport type React from 'react';\nimport {\n cloneElement,\n createContext,\n isValidElement,\n use,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\nimport { useAppElement } from '@/ConfigProvider/AppElementContext';\nimport { useNativeButton } from '@/hooks/useNativeButton';\nimport { useMotionComponent } from '@/MotionProvider';\nimport { focusRing } from '@/styles/stylex/focusRing';\nimport { styleProps } from '@/styles/stylex/props';\nimport { mergeRefs, useMergeRefs } from '@/utils/mergeRefs';\n\nimport { useLayerZIndex } from '../internal/zIndex';\nimport { drawerBackdropTransition, getDrawerMotionConfig, pushAxis } from './constants';\nimport { DrawerLayerProvider, useDrawerLayer } from './DrawerLayerContext';\nimport { styles } from './style';\nimport type { DrawerPlacement } from './type';\n\ntype XStyle = Parameters<typeof styleProps>[0];\n\nconst mergeStateClassName = <TState,>(\n xstyle: XStyle,\n className: string | ((state: TState) => string | undefined) | undefined,\n) => {\n const base = stylex.props(xstyle).className;\n if (typeof className === 'function') return (state: TState) => clsx(base, className(state));\n return clsx(base, className);\n};\n\nconst popupPlacementClass = {\n bottom: styles.popupBottom,\n left: styles.popupLeft,\n right: styles.popupRight,\n top: styles.popupTop,\n};\n\nconst panelPlacementClass = {\n bottom: styles.panelBottom,\n left: styles.panelLeft,\n right: styles.panelRight,\n top: styles.panelTop,\n};\n\nconst panelRoundedClass = {\n bottom: styles.panelRoundedBottom,\n left: styles.panelRoundedLeft,\n right: styles.panelRoundedRight,\n top: styles.panelRoundedTop,\n};\n\nconst DrawerOpenContext = createContext<boolean | null>(null);\n\ninterface DrawerAnimationActions {\n onExitComplete: () => void;\n}\nconst DrawerActionsContext = createContext<DrawerAnimationActions | null>(null);\n\nexport const useDrawerOpen = () => use(DrawerOpenContext);\nexport const useDrawerActions = () => use(DrawerActionsContext);\n\nexport type DrawerRootProps = Dialog.Root.Props & {\n onExitComplete?: () => void;\n zIndex?: number;\n};\n\nconst AnimatedDrawerRoot = ({\n open,\n children,\n onExitComplete: onExitCompleteProp,\n zIndex: explicitZIndex,\n ...rest\n}: Omit<DrawerRootProps, 'open'> & { open: boolean }) => {\n const [isPresent, setIsPresent] = useState(!!open);\n\n useEffect(() => {\n if (open) setIsPresent(true);\n }, [open]);\n\n const handleExitComplete = useCallback(() => {\n setIsPresent(false);\n onExitCompleteProp?.();\n }, [onExitCompleteProp]);\n\n const actions = useMemo(() => ({ onExitComplete: handleExitComplete }), [handleExitComplete]);\n\n const { zIndex, ref: popupRef } = useLayerZIndex<HTMLDivElement>('modal', explicitZIndex);\n const layer = useMemo(\n () => ({ popupRef: popupRef as (node: HTMLElement | null) => void, zIndex }),\n [zIndex, popupRef],\n );\n\n if (!isPresent) return null;\n\n return (\n <DrawerOpenContext value={open}>\n <DrawerActionsContext value={actions}>\n <DrawerLayerProvider value={layer}>\n <Dialog.Root modal open {...rest}>\n {children}\n </Dialog.Root>\n </DrawerLayerProvider>\n </DrawerActionsContext>\n </DrawerOpenContext>\n );\n};\n\nconst NonAnimatedDrawerRoot = ({ zIndex: explicitZIndex, children, ...rest }: DrawerRootProps) => {\n const { zIndex, ref: popupRef } = useLayerZIndex<HTMLDivElement>('modal', explicitZIndex);\n const layer = useMemo(\n () => ({ popupRef: popupRef as (node: HTMLElement | null) => void, zIndex }),\n [zIndex, popupRef],\n );\n\n return (\n <DrawerLayerProvider value={layer}>\n <Dialog.Root modal {...rest}>\n {children}\n </Dialog.Root>\n </DrawerLayerProvider>\n );\n};\n\nexport const DrawerRoot = ({ open, onExitComplete, ...rest }: DrawerRootProps) => {\n if (open !== undefined) {\n return <AnimatedDrawerRoot open={open} onExitComplete={onExitComplete} {...rest} />;\n }\n return <NonAnimatedDrawerRoot {...rest} />;\n};\n\nexport type DrawerPortalProps = React.ComponentProps<typeof Dialog.Portal> & {\n container?: HTMLElement | null;\n};\nexport const DrawerPortal = ({ container, ...rest }: DrawerPortalProps) => {\n const appElement = useAppElement();\n return <Dialog.Portal container={container ?? appElement ?? undefined} {...rest} />;\n};\n\nexport type DrawerBackdropProps = React.ComponentProps<typeof Dialog.Backdrop>;\nexport const DrawerBackdrop = ({ className, style, ...rest }: DrawerBackdropProps) => {\n const open = useDrawerOpen();\n const layer = useDrawerLayer();\n const Motion = useMotionComponent();\n const layerStyle = layer?.zIndex !== undefined ? { zIndex: layer.zIndex } : undefined;\n\n if (open !== null) {\n return (\n <Dialog.Backdrop\n {...rest}\n className={clsx(stylex.props(styles.backdrop).className, className as string)}\n style={{ ...layerStyle, ...style, transition: 'none' }}\n render={\n <Motion.div\n animate={{ opacity: open ? 1 : 0 }}\n initial={{ opacity: 0 }}\n transition={drawerBackdropTransition}\n />\n }\n />\n );\n }\n\n return (\n <Dialog.Backdrop\n {...rest}\n className={mergeStateClassName(styles.backdrop, className as any) as any}\n style={{ ...layerStyle, ...style }}\n />\n );\n};\n\nexport type DrawerPopupProps = React.ComponentProps<typeof Dialog.Popup> & {\n flush?: boolean;\n height?: number | string;\n motionProps?: Record<string, any>;\n panelClassName?: string;\n panelStyle?: React.CSSProperties;\n placement?: DrawerPlacement;\n popupStyle?: React.CSSProperties;\n pushOffset?: number;\n width?: number | string;\n};\n\nexport const DrawerPopupImpl = ({\n className,\n children,\n placement: placementProp = 'right',\n width: widthProp,\n height: heightProp,\n flush,\n pushOffset = 0,\n motionProps,\n panelClassName,\n panelStyle,\n panelXstyle,\n popupStyle,\n ref: forwardedRef,\n ...rest\n}: DrawerPopupProps & { panelXstyle?: XStyle }) => {\n const open = useDrawerOpen();\n const actions = useDrawerActions();\n const layer = useDrawerLayer();\n const Motion = useMotionComponent();\n const composedRef = useMergeRefs([forwardedRef, layer?.popupRef]);\n\n // The exiting panel lives inside AnimatePresence and keeps the props it had while open,\n // but this popup re-renders with whatever the consumer passes now. Freezing the geometry\n // during exit keeps the two in sync — otherwise a placement change on close teleports the\n // popup to the new edge while the panel animates out along the old axis.\n const openGeometryRef = useRef({\n height: heightProp,\n placement: placementProp,\n width: widthProp,\n });\n if (open !== false) {\n openGeometryRef.current = { height: heightProp, placement: placementProp, width: widthProp };\n }\n const { height, placement, width } = openGeometryRef.current;\n\n const isHorizontal = placement === 'left' || placement === 'right';\n const sizeStyle: React.CSSProperties = isHorizontal ? { width } : { height };\n const resolvedPopupStyle: React.CSSProperties = {\n ...(layer?.zIndex === undefined ? undefined : { zIndex: layer.zIndex + 1 }),\n ...sizeStyle,\n ...popupStyle,\n };\n const popupXstyle = [styles.popup, popupPlacementClass[placement]];\n const resolvedPanelClassName = clsx(\n stylex.props(\n styles.panel,\n panelPlacementClass[placement],\n flush ? styles.panelFlush : panelRoundedClass[placement],\n panelXstyle,\n ).className,\n panelClassName,\n );\n\n if (open !== null && actions) {\n const motionConfig = getDrawerMotionConfig(placement, pushOffset);\n return (\n <Dialog.Popup\n {...rest}\n className={clsx(stylex.props(popupXstyle).className, className as string)}\n data-drawer-anchor={placement}\n ref={composedRef as any}\n style={resolvedPopupStyle}\n >\n <AnimatePresence onExitComplete={actions.onExitComplete}>\n {open ? (\n <Motion.div\n {...motionConfig}\n {...motionProps}\n className={resolvedPanelClassName}\n data-drawer-placement={placement}\n key=\"drawer-popup-panel\"\n style={{ transition: 'none', ...panelStyle }}\n >\n {children}\n </Motion.div>\n ) : null}\n </AnimatePresence>\n </Dialog.Popup>\n );\n }\n\n const { axis, sign } = pushAxis[placement];\n const pushVars = {\n [axis === 'x' ? '--drawer-push-x' : '--drawer-push-y']: `${pushOffset * sign}px`,\n } as React.CSSProperties;\n\n return (\n <Dialog.Popup\n {...rest}\n className={mergeStateClassName(popupXstyle, className as any) as any}\n data-drawer-anchor={placement}\n ref={composedRef as any}\n style={resolvedPopupStyle}\n >\n <div\n className={resolvedPanelClassName}\n data-drawer-placement={placement}\n style={{ ...pushVars, ...panelStyle }}\n >\n {children}\n </div>\n </Dialog.Popup>\n );\n};\n\nexport const DrawerPopup: React.FC<DrawerPopupProps> = DrawerPopupImpl;\n\nexport type DrawerHeaderProps = React.HTMLAttributes<HTMLDivElement> & {\n ref?: React.Ref<HTMLDivElement>;\n};\nexport const DrawerHeader = ({ className, style, ...rest }: DrawerHeaderProps) => (\n <div {...rest} {...styleProps(styles.header, className, style)} />\n);\n\nexport type DrawerTitleProps = React.ComponentProps<typeof Dialog.Title>;\nexport const DrawerTitle = ({ className, ...rest }: DrawerTitleProps) => (\n <Dialog.Title {...rest} className={mergeStateClassName(styles.title, className as any) as any} />\n);\n\nexport type DrawerDescriptionProps = React.ComponentProps<typeof Dialog.Description>;\nexport const DrawerDescription: React.FC<DrawerDescriptionProps> = Dialog.Description;\n\nexport type DrawerContentProps = React.HTMLAttributes<HTMLDivElement> & {\n ref?: React.Ref<HTMLDivElement>;\n};\nexport const DrawerContentImpl = ({\n className,\n style,\n xstyle,\n ...rest\n}: DrawerContentProps & { xstyle?: XStyle }) => (\n <div {...rest} {...styleProps([styles.content, xstyle], className, style)} />\n);\nexport const DrawerContent: React.FC<DrawerContentProps> = DrawerContentImpl;\n\nexport type DrawerFooterProps = React.HTMLAttributes<HTMLDivElement> & {\n ref?: React.Ref<HTMLDivElement>;\n};\nexport const DrawerFooter = ({ className, style, ...rest }: DrawerFooterProps) => (\n <div {...rest} {...styleProps(styles.footer, className, style)} />\n);\n\nexport type DrawerCloseProps = React.ComponentProps<typeof Dialog.Close>;\nexport const DrawerClose = ({ className, children, ...rest }: DrawerCloseProps) => (\n <Dialog.Close\n {...rest}\n className={mergeStateClassName([styles.close, focusRing.info], className as any) as any}\n >\n {children ?? <X size={16} />}\n </Dialog.Close>\n);\n\nexport type DrawerTriggerProps = Omit<\n React.ComponentPropsWithRef<typeof Dialog.Trigger>,\n 'children' | 'render'\n> & {\n children?: React.ReactNode;\n nativeButton?: boolean;\n};\n\nexport const DrawerTrigger = ({\n children,\n className,\n nativeButton,\n ref: refProp,\n ...rest\n}: DrawerTriggerProps) => {\n const { isNativeButtonTriggerElement, resolvedNativeButton } = useNativeButton({\n children,\n nativeButton,\n });\n\n const renderer = (props: any) => {\n const resolvedProps = (() => {\n if (isNativeButtonTriggerElement) return props as any;\n // eslint-disable-next-line unused-imports/no-unused-vars\n const { type, ...restProps } = props as any;\n return restProps;\n })();\n\n const mergedProps = mergeProps((children as any).props, resolvedProps);\n return cloneElement(children as any, {\n ...mergedProps,\n ref: mergeRefs([(children as any).ref, (props as any).ref, refProp]),\n });\n };\n\n if (isValidElement(children)) {\n return (\n <Dialog.Trigger\n {...rest}\n className={className}\n nativeButton={resolvedNativeButton}\n render={renderer as any}\n />\n );\n }\n\n return (\n <Dialog.Trigger\n {...rest}\n className={className}\n nativeButton={resolvedNativeButton}\n ref={refProp as any}\n >\n {children}\n </Dialog.Trigger>\n );\n};\n"],"mappings":";;;;;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Aa,gBAAgB,EAC3B,WACA,OACA,GAAG,WACoB,oBAAC,OAAD;CAAK,GAAI;CAAM,GAAI,WAAW,OAAO,QAAQ,WAAW,KAAK;AAAI,CAAA;AAE1F,MAAa,eAAe,EAC1B,WACA,UACA,GAAG,WACmB,oBAAC,OAAO,OAAR;CAAc,GAAI;CAAM,WAAW,oBAAoB,CAAC,OAAO,OAAO,UAAU,IAAI,GAAG,SAAgB;CAC1H,UAAA,YAAY,oBAAC,GAAD,EAAG,MAAM,GAAK,CAAA;AACf,CAAA;AAKhB,MAAa,iBAAiB,EAC5B,UACA,WACA,cACA,KAAK,SACL,GAAG,WACqB;CACxB,MAAM,EACJ,8BACA,yBACE,gBAAgB;EAClB;EACA;CACF,CAAC;CACD,MAAM,YAAY,UAAe;EAC/B,MAAM,uBAAuB;GAC3B,IAAI,8BAA8B,OAAO;GAEzC,MAAM,EACJ,MACA,GAAG,cACD;GACJ,OAAO;EACT,EAAA,CAAG;EACH,MAAM,cAAc,WAAY,SAAiB,OAAO,aAAa;EACrE,OAAO,aAAa,UAAiB;GACnC,GAAG;GACH,KAAK,UAAU;IAAE,SAAiB;IAAM,MAAc;IAAK;GAAO,CAAC;EACrE,CAAC;CACH;CACA,IAAI,eAAe,QAAQ,GACzB,OAAO,oBAAC,OAAO,SAAR;EAAgB,GAAI;EAAiB;EAAW,cAAc;EAAsB,QAAQ;CAAkB,CAAA;CAEvH,OAAO,oBAAC,OAAO,SAAR;EAAgB,GAAI;EAAiB;EAAW,cAAc;EAAsB,KAAK;EAC3F;CACa,CAAA;AACpB"}
|
|
@@ -12,7 +12,7 @@ import { useLayerZIndex } from "../internal/zIndex/useLayerZIndex.mjs";
|
|
|
12
12
|
import { menuClassNames, menuStyles } from "./style.mjs";
|
|
13
13
|
import { cloneElement, isValidElement, useCallback, useState } from "react";
|
|
14
14
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
15
|
-
import clsx from "clsx";
|
|
15
|
+
import clsx$1 from "clsx";
|
|
16
16
|
import * as stylex from "@stylexjs/stylex";
|
|
17
17
|
import { mergeProps } from "@base-ui/react/merge-props";
|
|
18
18
|
import { Menu } from "@base-ui/react/menu";
|
|
@@ -24,10 +24,10 @@ const DropdownMenuRoot = (props) => /* @__PURE__ */ jsx(Menu.Root, {
|
|
|
24
24
|
const DropdownMenuSubmenuRoot = Menu.SubmenuRoot;
|
|
25
25
|
const DropdownMenuCheckboxItemIndicator = Menu.CheckboxItemIndicator;
|
|
26
26
|
const mergeStateClassName = (base, className) => {
|
|
27
|
-
if (typeof className === "function") return (state) => clsx(base, className(state));
|
|
28
|
-
return clsx(base, className);
|
|
27
|
+
if (typeof className === "function") return (state) => clsx$1(base, className(state));
|
|
28
|
+
return clsx$1(base, className);
|
|
29
29
|
};
|
|
30
|
-
const sx = (styles, stableClassName) => clsx(stylex.props(styles).className, stableClassName);
|
|
30
|
+
const sx = (styles, stableClassName) => clsx$1(stylex.props(styles).className, stableClassName);
|
|
31
31
|
const itemClassName = (danger) => sx([menuStyles.item, danger && menuStyles.danger]);
|
|
32
32
|
const DropdownMenuTrigger = ({ children, className, nativeButton, ref: refProp, ...rest }) => {
|
|
33
33
|
const { isNativeButtonTriggerElement, resolvedNativeButton } = useNativeButton({
|
|
@@ -43,7 +43,7 @@ const DropdownMenuTrigger = ({ children, className, nativeButton, ref: refProp,
|
|
|
43
43
|
const mergedProps = mergeProps(children.props, resolvedProps);
|
|
44
44
|
return cloneElement(children, {
|
|
45
45
|
...mergedProps,
|
|
46
|
-
className: clsx(CLASSNAMES.DropdownMenuTrigger, className, mergedProps.className),
|
|
46
|
+
className: clsx$1(CLASSNAMES.DropdownMenuTrigger, className, mergedProps.className),
|
|
47
47
|
ref: mergeRefs([
|
|
48
48
|
children.ref,
|
|
49
49
|
props.ref,
|
|
@@ -58,7 +58,7 @@ const DropdownMenuTrigger = ({ children, className, nativeButton, ref: refProp,
|
|
|
58
58
|
});
|
|
59
59
|
return /* @__PURE__ */ jsx(Menu.Trigger, {
|
|
60
60
|
...rest,
|
|
61
|
-
className: clsx(CLASSNAMES.DropdownMenuTrigger, className),
|
|
61
|
+
className: clsx$1(CLASSNAMES.DropdownMenuTrigger, className),
|
|
62
62
|
nativeButton: resolvedNativeButton,
|
|
63
63
|
ref: refProp,
|
|
64
64
|
children
|
|
@@ -115,7 +115,7 @@ DropdownMenuPopup.displayName = "DropdownMenuPopup";
|
|
|
115
115
|
const DropdownMenuHeader = ({ className, ...rest }) => {
|
|
116
116
|
return /* @__PURE__ */ jsx("div", {
|
|
117
117
|
...rest,
|
|
118
|
-
className: clsx(sx(menuStyles.header), className),
|
|
118
|
+
className: clsx$1(sx(menuStyles.header), className),
|
|
119
119
|
"data-slot": "header"
|
|
120
120
|
});
|
|
121
121
|
};
|
|
@@ -123,7 +123,7 @@ DropdownMenuHeader.displayName = "DropdownMenuHeader";
|
|
|
123
123
|
const DropdownMenuFooter = ({ className, ...rest }) => {
|
|
124
124
|
return /* @__PURE__ */ jsx("div", {
|
|
125
125
|
...rest,
|
|
126
|
-
className: clsx(sx(menuStyles.footer), className),
|
|
126
|
+
className: clsx$1(sx(menuStyles.footer), className),
|
|
127
127
|
"data-slot": "footer"
|
|
128
128
|
});
|
|
129
129
|
};
|
|
@@ -131,7 +131,7 @@ DropdownMenuFooter.displayName = "DropdownMenuFooter";
|
|
|
131
131
|
const DropdownMenuScrollViewport = ({ children, className, getItemLabel, keepMounted, listItemHeight, virtual, ...rest }) => {
|
|
132
132
|
if (!virtual) return /* @__PURE__ */ jsx("div", {
|
|
133
133
|
...rest,
|
|
134
|
-
className: clsx(sx(menuStyles.slotViewport), className),
|
|
134
|
+
className: clsx$1(sx(menuStyles.slotViewport), className),
|
|
135
135
|
children
|
|
136
136
|
});
|
|
137
137
|
return /* @__PURE__ */ jsx(MenuVirtualList, {
|
|
@@ -147,21 +147,21 @@ DropdownMenuScrollViewport.displayName = "DropdownMenuScrollViewport";
|
|
|
147
147
|
const DropdownMenuItem = ({ className, danger, ...rest }) => {
|
|
148
148
|
return /* @__PURE__ */ jsx(Menu.Item, {
|
|
149
149
|
...rest,
|
|
150
|
-
className: (state) => clsx(itemClassName(danger), typeof className === "function" ? className(state) : className)
|
|
150
|
+
className: (state) => clsx$1(itemClassName(danger), typeof className === "function" ? className(state) : className)
|
|
151
151
|
});
|
|
152
152
|
};
|
|
153
153
|
DropdownMenuItem.displayName = "DropdownMenuItem";
|
|
154
154
|
const DropdownMenuCheckboxItemPrimitive = ({ className, danger, ...rest }) => {
|
|
155
155
|
return /* @__PURE__ */ jsx(Menu.CheckboxItem, {
|
|
156
156
|
...rest,
|
|
157
|
-
className: (state) => clsx(itemClassName(danger), typeof className === "function" ? className(state) : className)
|
|
157
|
+
className: (state) => clsx$1(itemClassName(danger), typeof className === "function" ? className(state) : className)
|
|
158
158
|
});
|
|
159
159
|
};
|
|
160
160
|
DropdownMenuCheckboxItemPrimitive.displayName = "DropdownMenuCheckboxItemPrimitive";
|
|
161
161
|
const DropdownMenuSeparator = ({ className, ...rest }) => {
|
|
162
162
|
return /* @__PURE__ */ jsx(Menu.Separator, {
|
|
163
163
|
...rest,
|
|
164
|
-
className: (state) => clsx(sx(menuStyles.separator), typeof className === "function" ? className(state) : className)
|
|
164
|
+
className: (state) => clsx$1(sx(menuStyles.separator), typeof className === "function" ? className(state) : className)
|
|
165
165
|
});
|
|
166
166
|
};
|
|
167
167
|
DropdownMenuSeparator.displayName = "DropdownMenuSeparator";
|
|
@@ -169,21 +169,21 @@ const DropdownMenuGroup = Menu.Group;
|
|
|
169
169
|
const DropdownMenuGroupLabel = ({ className, ...rest }) => {
|
|
170
170
|
return /* @__PURE__ */ jsx(Menu.GroupLabel, {
|
|
171
171
|
...rest,
|
|
172
|
-
className: (state) => clsx(sx(menuStyles.groupLabel), typeof className === "function" ? className(state) : className)
|
|
172
|
+
className: (state) => clsx$1(sx(menuStyles.groupLabel), typeof className === "function" ? className(state) : className)
|
|
173
173
|
});
|
|
174
174
|
};
|
|
175
175
|
DropdownMenuGroupLabel.displayName = "DropdownMenuGroupLabel";
|
|
176
176
|
const DropdownMenuSubmenuTrigger = ({ className, danger, ...rest }) => {
|
|
177
177
|
return /* @__PURE__ */ jsx(Menu.SubmenuTrigger, {
|
|
178
178
|
...rest,
|
|
179
|
-
className: (state) => clsx(itemClassName(danger), typeof className === "function" ? className(state) : className)
|
|
179
|
+
className: (state) => clsx$1(itemClassName(danger), typeof className === "function" ? className(state) : className)
|
|
180
180
|
});
|
|
181
181
|
};
|
|
182
182
|
DropdownMenuSubmenuTrigger.displayName = "DropdownMenuSubmenuTrigger";
|
|
183
183
|
const DropdownMenuItemContentImpl = ({ className, xstyle, ...rest }) => {
|
|
184
184
|
return /* @__PURE__ */ jsx("div", {
|
|
185
185
|
...rest,
|
|
186
|
-
className: clsx(sx([menuStyles.itemContent, xstyle]), className)
|
|
186
|
+
className: clsx$1(sx([menuStyles.itemContent, xstyle]), className)
|
|
187
187
|
});
|
|
188
188
|
};
|
|
189
189
|
const DropdownMenuItemContent = (props) => /* @__PURE__ */ jsx(DropdownMenuItemContentImpl, { ...props });
|
|
@@ -191,7 +191,7 @@ DropdownMenuItemContent.displayName = "DropdownMenuItemContent";
|
|
|
191
191
|
const DropdownMenuItemIconImpl = ({ className, xstyle, ...rest }) => {
|
|
192
192
|
return /* @__PURE__ */ jsx("span", {
|
|
193
193
|
...rest,
|
|
194
|
-
className: clsx(sx([menuStyles.icon, xstyle], menuClassNames.icon), className)
|
|
194
|
+
className: clsx$1(sx([menuStyles.icon, xstyle], menuClassNames.icon), className)
|
|
195
195
|
});
|
|
196
196
|
};
|
|
197
197
|
const DropdownMenuItemIcon = (props) => /* @__PURE__ */ jsx(DropdownMenuItemIconImpl, { ...props });
|
|
@@ -199,35 +199,35 @@ DropdownMenuItemIcon.displayName = "DropdownMenuItemIcon";
|
|
|
199
199
|
const DropdownMenuItemLabelGroup = ({ className, ...rest }) => {
|
|
200
200
|
return /* @__PURE__ */ jsx("div", {
|
|
201
201
|
...rest,
|
|
202
|
-
className: clsx(sx(menuStyles.labelGroup), className)
|
|
202
|
+
className: clsx$1(sx(menuStyles.labelGroup), className)
|
|
203
203
|
});
|
|
204
204
|
};
|
|
205
205
|
DropdownMenuItemLabelGroup.displayName = "DropdownMenuItemLabelGroup";
|
|
206
206
|
const DropdownMenuItemLabel = ({ className, ...rest }) => {
|
|
207
207
|
return /* @__PURE__ */ jsx("span", {
|
|
208
208
|
...rest,
|
|
209
|
-
className: clsx(sx(menuStyles.label, menuClassNames.label), className)
|
|
209
|
+
className: clsx$1(sx(menuStyles.label, menuClassNames.label), className)
|
|
210
210
|
});
|
|
211
211
|
};
|
|
212
212
|
DropdownMenuItemLabel.displayName = "DropdownMenuItemLabel";
|
|
213
213
|
const DropdownMenuItemDesc = ({ className, ...rest }) => {
|
|
214
214
|
return /* @__PURE__ */ jsx("span", {
|
|
215
215
|
...rest,
|
|
216
|
-
className: clsx(sx(menuStyles.desc), className)
|
|
216
|
+
className: clsx$1(sx(menuStyles.desc), className)
|
|
217
217
|
});
|
|
218
218
|
};
|
|
219
219
|
DropdownMenuItemDesc.displayName = "DropdownMenuItemDesc";
|
|
220
220
|
const DropdownMenuItemExtra = ({ className, ...rest }) => {
|
|
221
221
|
return /* @__PURE__ */ jsx("span", {
|
|
222
222
|
...rest,
|
|
223
|
-
className: clsx(sx(menuStyles.extra), className)
|
|
223
|
+
className: clsx$1(sx(menuStyles.extra), className)
|
|
224
224
|
});
|
|
225
225
|
};
|
|
226
226
|
DropdownMenuItemExtra.displayName = "DropdownMenuItemExtra";
|
|
227
227
|
const DropdownMenuSubmenuArrow = ({ className, ...rest }) => {
|
|
228
228
|
return /* @__PURE__ */ jsx("span", {
|
|
229
229
|
...rest,
|
|
230
|
-
className: clsx(sx(menuStyles.submenuArrow, menuClassNames.submenuArrow), className)
|
|
230
|
+
className: clsx$1(sx(menuStyles.submenuArrow, menuClassNames.submenuArrow), className)
|
|
231
231
|
});
|
|
232
232
|
};
|
|
233
233
|
DropdownMenuSubmenuArrow.displayName = "DropdownMenuSubmenuArrow";
|
|
@@ -243,7 +243,7 @@ const DropdownMenuSwitchItem = ({ checked: checkedProp, className, closeOnClick
|
|
|
243
243
|
...rest,
|
|
244
244
|
closeOnClick,
|
|
245
245
|
disabled,
|
|
246
|
-
className: (state) => clsx(itemClassName(danger), typeof className === "function" ? className(state) : className),
|
|
246
|
+
className: (state) => clsx$1(itemClassName(danger), typeof className === "function" ? className(state) : className),
|
|
247
247
|
onClick: (e) => {
|
|
248
248
|
e.preventDefault();
|
|
249
249
|
if (!disabled) handleCheckedChange(!checked);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"atoms.mjs","names":[],"sources":["../../src/DropdownMenu/atoms.tsx"],"sourcesContent":["'use client';\n\nimport { Menu } from '@base-ui/react/menu';\nimport { mergeProps } from '@base-ui/react/merge-props';\nimport * as stylex from '@stylexjs/stylex';\nimport clsx from 'clsx';\nimport type React from 'react';\nimport { cloneElement, isValidElement, useCallback, useState } from 'react';\n\nimport { useAppElement } from '@/ConfigProvider/AppElementContext';\nimport { FloatingLayerProvider } from '@/hooks/useFloatingLayer';\nimport { useNativeButton } from '@/hooks/useNativeButton';\nimport { getFloatingCollisionPadding } from '@/internal/floating';\nimport { MenuVirtualList, type VirtualListProps } from '@/internal/virtual';\nimport { CLASSNAMES } from '@/styles/classNames';\nimport { type styleProps } from '@/styles/stylex/props';\nimport Switch from '@/Switch';\nimport { mergeRefs, useMergeRefs } from '@/utils/mergeRefs';\nimport { placementMap } from '@/utils/placement';\n\nimport { useLayerZIndex } from '../internal/zIndex';\nimport { menuClassNames, menuStyles } from './style';\nimport { type DropdownMenuPlacement } from './type';\n\nexport const DropdownMenuRoot: typeof Menu.Root = (props) => <Menu.Root modal={false} {...props} />;\nexport const DropdownMenuSubmenuRoot = Menu.SubmenuRoot;\nexport const DropdownMenuCheckboxItemIndicator = Menu.CheckboxItemIndicator;\n\ntype XStyle = Parameters<typeof styleProps>[0];\n\nconst mergeStateClassName = <TState,>(\n base: string,\n className: string | ((state: TState) => string | undefined) | undefined,\n) => {\n if (typeof className === 'function') return (state: TState) => clsx(base, className(state));\n return clsx(base, className);\n};\n\nconst sx = (styles: XStyle, stableClassName?: string) =>\n clsx(stylex.props(styles).className, stableClassName);\n\nconst itemClassName = (danger: boolean | undefined) =>\n sx([menuStyles.item, danger && menuStyles.danger]);\n\nexport type DropdownMenuTriggerProps = Omit<\n React.ComponentPropsWithRef<typeof Menu.Trigger>,\n 'children' | 'render'\n> & {\n children: React.ReactNode;\n};\n\nexport const DropdownMenuTrigger = ({\n children,\n className,\n nativeButton,\n ref: refProp,\n ...rest\n}: DropdownMenuTriggerProps) => {\n const { isNativeButtonTriggerElement, resolvedNativeButton } = useNativeButton({\n children,\n nativeButton,\n });\n\n const renderer = (props: any) => {\n // Base UI's trigger props include `type=\"button\"` by default.\n // If we render into a non-<button> element, that prop is invalid and can warn.\n const resolvedProps = (() => {\n if (isNativeButtonTriggerElement) return props as any;\n // eslint-disable-next-line unused-imports/no-unused-vars\n const { type, ...restProps } = props as any;\n return restProps;\n })();\n\n const mergedProps = mergeProps((children as any).props, resolvedProps);\n return cloneElement(children as any, {\n ...mergedProps,\n className: clsx(CLASSNAMES.DropdownMenuTrigger, className, mergedProps.className),\n ref: mergeRefs([(children as any).ref, (props as any).ref, refProp]),\n });\n };\n\n if (isValidElement(children)) {\n return <Menu.Trigger {...rest} nativeButton={resolvedNativeButton} render={renderer as any} />;\n }\n\n return (\n <Menu.Trigger\n {...rest}\n className={clsx(CLASSNAMES.DropdownMenuTrigger, className)}\n nativeButton={resolvedNativeButton}\n ref={refProp as any}\n >\n {children}\n </Menu.Trigger>\n );\n};\n\nDropdownMenuTrigger.displayName = 'DropdownMenuTrigger';\n\nexport type DropdownMenuPortalProps = React.ComponentProps<typeof Menu.Portal> & {\n /**\n * When `container` is not provided, it uses a shared container created by `usePortalContainer`.\n */\n container?: HTMLElement | null;\n};\n\nexport const DropdownMenuPortal = ({ container, ...rest }: DropdownMenuPortalProps) => {\n const appElement = useAppElement();\n return <Menu.Portal container={container ?? appElement ?? undefined} {...rest} />;\n};\n\nDropdownMenuPortal.displayName = 'DropdownMenuPortal';\n\nexport type DropdownMenuPositionerProps = React.ComponentProps<typeof Menu.Positioner> & {\n hoverTrigger?: boolean;\n placement?: DropdownMenuPlacement;\n};\n\nexport const DropdownMenuPositioner = ({\n className,\n collisionPadding,\n placement,\n hoverTrigger,\n align,\n side,\n sideOffset,\n children,\n style,\n ...rest\n}: DropdownMenuPositionerProps) => {\n const placementConfig = placement ? placementMap[placement] : undefined;\n const [positionerNode, setPositionerNode] = useState<HTMLDivElement | null>(null);\n\n const explicitZIndex =\n typeof style !== 'function' && style?.zIndex != null && typeof style.zIndex === 'number'\n ? style.zIndex\n : undefined;\n const { zIndex, ref: zRef } = useLayerZIndex<HTMLDivElement>('floating', explicitZIndex);\n const composedRef = useMergeRefs([setPositionerNode, zRef]);\n\n const resolvedStyle =\n typeof style === 'function'\n ? (state: any) => ({ zIndex, ...style(state) })\n : { zIndex, ...style };\n\n return (\n <Menu.Positioner\n {...rest}\n align={align ?? placementConfig?.align}\n collisionPadding={collisionPadding ?? getFloatingCollisionPadding()}\n data-hover-trigger={hoverTrigger || undefined}\n data-placement={placement}\n ref={composedRef as any}\n side={side ?? placementConfig?.side}\n sideOffset={sideOffset ?? (placementConfig ? 6 : undefined)}\n style={resolvedStyle}\n className={\n mergeStateClassName(\n sx(menuStyles.positioner, menuClassNames.positioner),\n className as any,\n ) as any\n }\n >\n <FloatingLayerProvider value={positionerNode}>{children}</FloatingLayerProvider>\n </Menu.Positioner>\n );\n};\n\nDropdownMenuPositioner.displayName = 'DropdownMenuPositioner';\n\nexport type DropdownMenuPopupProps = React.ComponentProps<typeof Menu.Popup>;\n\nexport const DropdownMenuPopupImpl = ({\n className,\n xstyle,\n ...rest\n}: DropdownMenuPopupProps & { xstyle?: XStyle }) => {\n return (\n <Menu.Popup\n {...rest}\n className={\n mergeStateClassName(\n sx([menuStyles.popup, xstyle], menuClassNames.popup),\n className as any,\n ) as any\n }\n />\n );\n};\n\nexport const DropdownMenuPopup = (props: DropdownMenuPopupProps) => (\n <DropdownMenuPopupImpl {...props} />\n);\n\nDropdownMenuPopup.displayName = 'DropdownMenuPopup';\n\nexport type DropdownMenuHeaderProps = React.HTMLAttributes<HTMLDivElement>;\n\nexport const DropdownMenuHeader = ({ className, ...rest }: DropdownMenuHeaderProps) => {\n return <div {...rest} className={clsx(sx(menuStyles.header), className)} data-slot=\"header\" />;\n};\n\nDropdownMenuHeader.displayName = 'DropdownMenuHeader';\n\nexport type DropdownMenuFooterProps = React.HTMLAttributes<HTMLDivElement>;\n\nexport const DropdownMenuFooter = ({ className, ...rest }: DropdownMenuFooterProps) => {\n return <div {...rest} className={clsx(sx(menuStyles.footer), className)} data-slot=\"footer\" />;\n};\n\nDropdownMenuFooter.displayName = 'DropdownMenuFooter';\n\nexport type DropdownMenuScrollViewportProps = React.HTMLAttributes<HTMLDivElement> &\n VirtualListProps;\n\nexport const DropdownMenuScrollViewport = ({\n children,\n className,\n getItemLabel,\n keepMounted,\n listItemHeight,\n virtual,\n ...rest\n}: DropdownMenuScrollViewportProps) => {\n if (!virtual) {\n return (\n <div {...rest} className={clsx(sx(menuStyles.slotViewport), className)}>\n {children}\n </div>\n );\n }\n\n return (\n <MenuVirtualList\n {...rest}\n className={className}\n getItemLabel={getItemLabel}\n itemSize={listItemHeight}\n keepMounted={keepMounted}\n >\n {children}\n </MenuVirtualList>\n );\n};\n\nDropdownMenuScrollViewport.displayName = 'DropdownMenuScrollViewport';\n\nexport type DropdownMenuItemProps = React.ComponentProps<typeof Menu.Item> & { danger?: boolean };\n\nexport const DropdownMenuItem = ({ className, danger, ...rest }: DropdownMenuItemProps) => {\n return (\n <Menu.Item\n {...rest}\n className={(state) =>\n clsx(itemClassName(danger), typeof className === 'function' ? className(state) : className)\n }\n />\n );\n};\n\nDropdownMenuItem.displayName = 'DropdownMenuItem';\n\nexport type DropdownMenuCheckboxItemProps = React.ComponentProps<typeof Menu.CheckboxItem> & {\n danger?: boolean;\n};\n\nexport const DropdownMenuCheckboxItemPrimitive = ({\n className,\n danger,\n ...rest\n}: DropdownMenuCheckboxItemProps) => {\n return (\n <Menu.CheckboxItem\n {...rest}\n className={(state) =>\n clsx(itemClassName(danger), typeof className === 'function' ? className(state) : className)\n }\n />\n );\n};\n\nDropdownMenuCheckboxItemPrimitive.displayName = 'DropdownMenuCheckboxItemPrimitive';\n\nexport type DropdownMenuSeparatorProps = React.ComponentProps<typeof Menu.Separator>;\n\nexport const DropdownMenuSeparator = ({ className, ...rest }: DropdownMenuSeparatorProps) => {\n return (\n <Menu.Separator\n {...rest}\n className={(state) =>\n clsx(\n sx(menuStyles.separator),\n typeof className === 'function' ? className(state) : className,\n )\n }\n />\n );\n};\n\nDropdownMenuSeparator.displayName = 'DropdownMenuSeparator';\n\nexport const DropdownMenuGroup = Menu.Group;\n\nexport type DropdownMenuGroupLabelProps = React.ComponentProps<typeof Menu.GroupLabel>;\n\nexport const DropdownMenuGroupLabel = ({ className, ...rest }: DropdownMenuGroupLabelProps) => {\n return (\n <Menu.GroupLabel\n {...rest}\n className={(state) =>\n clsx(\n sx(menuStyles.groupLabel),\n typeof className === 'function' ? className(state) : className,\n )\n }\n />\n );\n};\n\nDropdownMenuGroupLabel.displayName = 'DropdownMenuGroupLabel';\n\nexport type DropdownMenuSubmenuTriggerProps = React.ComponentProps<typeof Menu.SubmenuTrigger> & {\n danger?: boolean;\n};\n\nexport const DropdownMenuSubmenuTrigger = ({\n className,\n danger,\n ...rest\n}: DropdownMenuSubmenuTriggerProps) => {\n return (\n <Menu.SubmenuTrigger\n {...rest}\n className={(state) =>\n clsx(itemClassName(danger), typeof className === 'function' ? className(state) : className)\n }\n />\n );\n};\n\nDropdownMenuSubmenuTrigger.displayName = 'DropdownMenuSubmenuTrigger';\n\nexport type DropdownMenuItemContentProps = React.HTMLAttributes<HTMLDivElement>;\n\nexport const DropdownMenuItemContentImpl = ({\n className,\n xstyle,\n ...rest\n}: DropdownMenuItemContentProps & { xstyle?: XStyle }) => {\n return <div {...rest} className={clsx(sx([menuStyles.itemContent, xstyle]), className)} />;\n};\n\nexport const DropdownMenuItemContent = (props: DropdownMenuItemContentProps) => (\n <DropdownMenuItemContentImpl {...props} />\n);\n\nDropdownMenuItemContent.displayName = 'DropdownMenuItemContent';\n\nexport type DropdownMenuItemIconProps = React.HTMLAttributes<HTMLSpanElement>;\n\nexport const DropdownMenuItemIconImpl = ({\n className,\n xstyle,\n ...rest\n}: DropdownMenuItemIconProps & { xstyle?: XStyle }) => {\n return (\n <span\n {...rest}\n className={clsx(sx([menuStyles.icon, xstyle], menuClassNames.icon), className)}\n />\n );\n};\n\nexport const DropdownMenuItemIcon = (props: DropdownMenuItemIconProps) => (\n <DropdownMenuItemIconImpl {...props} />\n);\n\nDropdownMenuItemIcon.displayName = 'DropdownMenuItemIcon';\n\nexport type DropdownMenuItemLabelGroupProps = React.HTMLAttributes<HTMLDivElement>;\n\nexport const DropdownMenuItemLabelGroup = ({\n className,\n ...rest\n}: DropdownMenuItemLabelGroupProps) => {\n return <div {...rest} className={clsx(sx(menuStyles.labelGroup), className)} />;\n};\n\nDropdownMenuItemLabelGroup.displayName = 'DropdownMenuItemLabelGroup';\n\nexport type DropdownMenuItemLabelProps = React.HTMLAttributes<HTMLSpanElement>;\n\nexport const DropdownMenuItemLabel = ({ className, ...rest }: DropdownMenuItemLabelProps) => {\n return <span {...rest} className={clsx(sx(menuStyles.label, menuClassNames.label), className)} />;\n};\n\nDropdownMenuItemLabel.displayName = 'DropdownMenuItemLabel';\n\nexport type DropdownMenuItemDescProps = React.HTMLAttributes<HTMLSpanElement>;\n\nexport const DropdownMenuItemDesc = ({ className, ...rest }: DropdownMenuItemDescProps) => {\n return <span {...rest} className={clsx(sx(menuStyles.desc), className)} />;\n};\n\nDropdownMenuItemDesc.displayName = 'DropdownMenuItemDesc';\n\nexport type DropdownMenuItemExtraProps = React.HTMLAttributes<HTMLSpanElement>;\n\nexport const DropdownMenuItemExtra = ({ className, ...rest }: DropdownMenuItemExtraProps) => {\n return <span {...rest} className={clsx(sx(menuStyles.extra), className)} />;\n};\n\nDropdownMenuItemExtra.displayName = 'DropdownMenuItemExtra';\n\nexport type DropdownMenuSubmenuArrowProps = React.HTMLAttributes<HTMLSpanElement>;\n\nexport const DropdownMenuSubmenuArrow = ({ className, ...rest }: DropdownMenuSubmenuArrowProps) => {\n return (\n <span\n {...rest}\n className={clsx(sx(menuStyles.submenuArrow, menuClassNames.submenuArrow), className)}\n />\n );\n};\n\nDropdownMenuSubmenuArrow.displayName = 'DropdownMenuSubmenuArrow';\n\nexport type DropdownMenuSwitchItemProps = Omit<\n React.ComponentProps<typeof Menu.Item>,\n 'onClick'\n> & {\n checked?: boolean;\n closeOnClick?: boolean;\n danger?: boolean;\n defaultChecked?: boolean;\n onCheckedChange?: (checked: boolean) => void;\n};\n\nexport const DropdownMenuSwitchItem = ({\n checked: checkedProp,\n className,\n closeOnClick = false,\n danger,\n defaultChecked,\n disabled,\n onCheckedChange,\n children,\n ...rest\n}: DropdownMenuSwitchItemProps) => {\n const [internalChecked, setInternalChecked] = useState(defaultChecked ?? false);\n const isControlled = checkedProp !== undefined;\n const checked = isControlled ? checkedProp : internalChecked;\n\n const handleCheckedChange = useCallback(\n (newChecked: boolean) => {\n if (!isControlled) {\n setInternalChecked(newChecked);\n }\n onCheckedChange?.(newChecked);\n },\n [isControlled, onCheckedChange],\n );\n\n return (\n <Menu.Item\n {...rest}\n closeOnClick={closeOnClick}\n disabled={disabled}\n className={(state) =>\n clsx(itemClassName(danger), typeof className === 'function' ? className(state) : className)\n }\n onClick={(e) => {\n e.preventDefault();\n if (!disabled) {\n handleCheckedChange(!checked);\n }\n }}\n >\n {children}\n <span\n style={{ display: 'inline-flex', marginInlineStart: 16 }}\n onFocus={(e) => e.stopPropagation()}\n >\n <Switch\n checked={checked}\n disabled={disabled}\n size=\"small\"\n tabIndex={-1}\n onChange={handleC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U;CAC9B,GAAG,CAAC,cAAc,eAAe,CAAC;CAClC,OAAO,qBAAC,KAAK,MAAN;EAAW,GAAI;EAAoB;EAAwB;EAAU,YAAW,UAAS,KAAK,cAAc,MAAM,GAAG,OAAO,cAAc,aAAa,UAAU,KAAK,IAAI,SAAS;EAAG,UAAS,MAAK;GACzM,EAAE,eAAe;GACjB,IAAI,CAAC,UACH,oBAAoB,CAAC,OAAO;EAEhC;EALO,UAAA,CAMF,UACD,oBAAC,QAAD;GAAM,OAAO;IACb,SAAS;IACT,mBAAmB;GACrB;GAAG,UAAS,MAAK,EAAE,gBAAgB;GAC/B,UAAA,oBAAC,QAAD;IAAiB;IAAmB;IAAU,MAAK;IAAQ,UAAU;IAAI,UAAU;IAAqB,UAAU,GAAG,MAAM,EAAE,gBAAgB;GAAI,CAAA;EAC7I,CAAA,CACG;;AACf;AACA,uBAAuB,cAAc"}
|
|
1
|
+
{"version":3,"file":"atoms.mjs","names":["clsx"],"sources":["../../src/DropdownMenu/atoms.tsx"],"sourcesContent":["'use client';\n\nimport { Menu } from '@base-ui/react/menu';\nimport { mergeProps } from '@base-ui/react/merge-props';\nimport * as stylex from '@stylexjs/stylex';\nimport clsx from 'clsx';\nimport type React from 'react';\nimport { cloneElement, isValidElement, useCallback, useState } from 'react';\n\nimport { useAppElement } from '@/ConfigProvider/AppElementContext';\nimport { FloatingLayerProvider } from '@/hooks/useFloatingLayer';\nimport { useNativeButton } from '@/hooks/useNativeButton';\nimport { getFloatingCollisionPadding } from '@/internal/floating';\nimport { MenuVirtualList, type VirtualListProps } from '@/internal/virtual';\nimport { CLASSNAMES } from '@/styles/classNames';\nimport { type styleProps } from '@/styles/stylex/props';\nimport Switch from '@/Switch';\nimport { mergeRefs, useMergeRefs } from '@/utils/mergeRefs';\nimport { placementMap } from '@/utils/placement';\n\nimport { useLayerZIndex } from '../internal/zIndex';\nimport { menuClassNames, menuStyles } from './style';\nimport { type DropdownMenuPlacement } from './type';\n\nexport const DropdownMenuRoot: typeof Menu.Root = (props) => <Menu.Root modal={false} {...props} />;\nexport const DropdownMenuSubmenuRoot = Menu.SubmenuRoot;\nexport const DropdownMenuCheckboxItemIndicator = Menu.CheckboxItemIndicator;\n\ntype XStyle = Parameters<typeof styleProps>[0];\n\nconst mergeStateClassName = <TState,>(\n base: string,\n className: string | ((state: TState) => string | undefined) | undefined,\n) => {\n if (typeof className === 'function') return (state: TState) => clsx(base, className(state));\n return clsx(base, className);\n};\n\nconst sx = (styles: XStyle, stableClassName?: string) =>\n clsx(stylex.props(styles).className, stableClassName);\n\nconst itemClassName = (danger: boolean | undefined) =>\n sx([menuStyles.item, danger && menuStyles.danger]);\n\nexport type DropdownMenuTriggerProps = Omit<\n React.ComponentPropsWithRef<typeof Menu.Trigger>,\n 'children' | 'render'\n> & {\n children: React.ReactNode;\n};\n\nexport const DropdownMenuTrigger = ({\n children,\n className,\n nativeButton,\n ref: refProp,\n ...rest\n}: DropdownMenuTriggerProps) => {\n const { isNativeButtonTriggerElement, resolvedNativeButton } = useNativeButton({\n children,\n nativeButton,\n });\n\n const renderer = (props: any) => {\n // Base UI's trigger props include `type=\"button\"` by default.\n // If we render into a non-<button> element, that prop is invalid and can warn.\n const resolvedProps = (() => {\n if (isNativeButtonTriggerElement) return props as any;\n // eslint-disable-next-line unused-imports/no-unused-vars\n const { type, ...restProps } = props as any;\n return restProps;\n })();\n\n const mergedProps = mergeProps((children as any).props, resolvedProps);\n return cloneElement(children as any, {\n ...mergedProps,\n className: clsx(CLASSNAMES.DropdownMenuTrigger, className, mergedProps.className),\n ref: mergeRefs([(children as any).ref, (props as any).ref, refProp]),\n });\n };\n\n if (isValidElement(children)) {\n return <Menu.Trigger {...rest} nativeButton={resolvedNativeButton} render={renderer as any} />;\n }\n\n return (\n <Menu.Trigger\n {...rest}\n className={clsx(CLASSNAMES.DropdownMenuTrigger, className)}\n nativeButton={resolvedNativeButton}\n ref={refProp as any}\n >\n {children}\n </Menu.Trigger>\n );\n};\n\nDropdownMenuTrigger.displayName = 'DropdownMenuTrigger';\n\nexport type DropdownMenuPortalProps = React.ComponentProps<typeof Menu.Portal> & {\n /**\n * When `container` is not provided, it uses a shared container created by `usePortalContainer`.\n */\n container?: HTMLElement | null;\n};\n\nexport const DropdownMenuPortal = ({ container, ...rest }: DropdownMenuPortalProps) => {\n const appElement = useAppElement();\n return <Menu.Portal container={container ?? appElement ?? undefined} {...rest} />;\n};\n\nDropdownMenuPortal.displayName = 'DropdownMenuPortal';\n\nexport type DropdownMenuPositionerProps = React.ComponentProps<typeof Menu.Positioner> & {\n hoverTrigger?: boolean;\n placement?: DropdownMenuPlacement;\n};\n\nexport const DropdownMenuPositioner = ({\n className,\n collisionPadding,\n placement,\n hoverTrigger,\n align,\n side,\n sideOffset,\n children,\n style,\n ...rest\n}: DropdownMenuPositionerProps) => {\n const placementConfig = placement ? placementMap[placement] : undefined;\n const [positionerNode, setPositionerNode] = useState<HTMLDivElement | null>(null);\n\n const explicitZIndex =\n typeof style !== 'function' && style?.zIndex != null && typeof style.zIndex === 'number'\n ? style.zIndex\n : undefined;\n const { zIndex, ref: zRef } = useLayerZIndex<HTMLDivElement>('floating', explicitZIndex);\n const composedRef = useMergeRefs([setPositionerNode, zRef]);\n\n const resolvedStyle =\n typeof style === 'function'\n ? (state: any) => ({ zIndex, ...style(state) })\n : { zIndex, ...style };\n\n return (\n <Menu.Positioner\n {...rest}\n align={align ?? placementConfig?.align}\n collisionPadding={collisionPadding ?? getFloatingCollisionPadding()}\n data-hover-trigger={hoverTrigger || undefined}\n data-placement={placement}\n ref={composedRef as any}\n side={side ?? placementConfig?.side}\n sideOffset={sideOffset ?? (placementConfig ? 6 : undefined)}\n style={resolvedStyle}\n className={\n mergeStateClassName(\n sx(menuStyles.positioner, menuClassNames.positioner),\n className as any,\n ) as any\n }\n >\n <FloatingLayerProvider value={positionerNode}>{children}</FloatingLayerProvider>\n </Menu.Positioner>\n );\n};\n\nDropdownMenuPositioner.displayName = 'DropdownMenuPositioner';\n\nexport type DropdownMenuPopupProps = React.ComponentProps<typeof Menu.Popup>;\n\nexport const DropdownMenuPopupImpl = ({\n className,\n xstyle,\n ...rest\n}: DropdownMenuPopupProps & { xstyle?: XStyle }) => {\n return (\n <Menu.Popup\n {...rest}\n className={\n mergeStateClassName(\n sx([menuStyles.popup, xstyle], menuClassNames.popup),\n className as any,\n ) as any\n }\n />\n );\n};\n\nexport const DropdownMenuPopup = (props: DropdownMenuPopupProps) => (\n <DropdownMenuPopupImpl {...props} />\n);\n\nDropdownMenuPopup.displayName = 'DropdownMenuPopup';\n\nexport type DropdownMenuHeaderProps = React.HTMLAttributes<HTMLDivElement>;\n\nexport const DropdownMenuHeader = ({ className, ...rest }: DropdownMenuHeaderProps) => {\n return <div {...rest} className={clsx(sx(menuStyles.header), className)} data-slot=\"header\" />;\n};\n\nDropdownMenuHeader.displayName = 'DropdownMenuHeader';\n\nexport type DropdownMenuFooterProps = React.HTMLAttributes<HTMLDivElement>;\n\nexport const DropdownMenuFooter = ({ className, ...rest }: DropdownMenuFooterProps) => {\n return <div {...rest} className={clsx(sx(menuStyles.footer), className)} data-slot=\"footer\" />;\n};\n\nDropdownMenuFooter.displayName = 'DropdownMenuFooter';\n\nexport type DropdownMenuScrollViewportProps = React.HTMLAttributes<HTMLDivElement> &\n VirtualListProps;\n\nexport const DropdownMenuScrollViewport = ({\n children,\n className,\n getItemLabel,\n keepMounted,\n listItemHeight,\n virtual,\n ...rest\n}: DropdownMenuScrollViewportProps) => {\n if (!virtual) {\n return (\n <div {...rest} className={clsx(sx(menuStyles.slotViewport), className)}>\n {children}\n </div>\n );\n }\n\n return (\n <MenuVirtualList\n {...rest}\n className={className}\n getItemLabel={getItemLabel}\n itemSize={listItemHeight}\n keepMounted={keepMounted}\n >\n {children}\n </MenuVirtualList>\n );\n};\n\nDropdownMenuScrollViewport.displayName = 'DropdownMenuScrollViewport';\n\nexport type DropdownMenuItemProps = React.ComponentProps<typeof Menu.Item> & { danger?: boolean };\n\nexport const DropdownMenuItem = ({ className, danger, ...rest }: DropdownMenuItemProps) => {\n return (\n <Menu.Item\n {...rest}\n className={(state) =>\n clsx(itemClassName(danger), typeof className === 'function' ? className(state) : className)\n }\n />\n );\n};\n\nDropdownMenuItem.displayName = 'DropdownMenuItem';\n\nexport type DropdownMenuCheckboxItemProps = React.ComponentProps<typeof Menu.CheckboxItem> & {\n danger?: boolean;\n};\n\nexport const DropdownMenuCheckboxItemPrimitive = ({\n className,\n danger,\n ...rest\n}: DropdownMenuCheckboxItemProps) => {\n return (\n <Menu.CheckboxItem\n {...rest}\n className={(state) =>\n clsx(itemClassName(danger), typeof className === 'function' ? className(state) : className)\n }\n />\n );\n};\n\nDropdownMenuCheckboxItemPrimitive.displayName = 'DropdownMenuCheckboxItemPrimitive';\n\nexport type DropdownMenuSeparatorProps = React.ComponentProps<typeof Menu.Separator>;\n\nexport const DropdownMenuSeparator = ({ className, ...rest }: DropdownMenuSeparatorProps) => {\n return (\n <Menu.Separator\n {...rest}\n className={(state) =>\n clsx(\n sx(menuStyles.separator),\n typeof className === 'function' ? className(state) : className,\n )\n }\n />\n );\n};\n\nDropdownMenuSeparator.displayName = 'DropdownMenuSeparator';\n\nexport const DropdownMenuGroup = Menu.Group;\n\nexport type DropdownMenuGroupLabelProps = React.ComponentProps<typeof Menu.GroupLabel>;\n\nexport const DropdownMenuGroupLabel = ({ className, ...rest }: DropdownMenuGroupLabelProps) => {\n return (\n <Menu.GroupLabel\n {...rest}\n className={(state) =>\n clsx(\n sx(menuStyles.groupLabel),\n typeof className === 'function' ? className(state) : className,\n )\n }\n />\n );\n};\n\nDropdownMenuGroupLabel.displayName = 'DropdownMenuGroupLabel';\n\nexport type DropdownMenuSubmenuTriggerProps = React.ComponentProps<typeof Menu.SubmenuTrigger> & {\n danger?: boolean;\n};\n\nexport const DropdownMenuSubmenuTrigger = ({\n className,\n danger,\n ...rest\n}: DropdownMenuSubmenuTriggerProps) => {\n return (\n <Menu.SubmenuTrigger\n {...rest}\n className={(state) =>\n clsx(itemClassName(danger), typeof className === 'function' ? className(state) : className)\n }\n />\n );\n};\n\nDropdownMenuSubmenuTrigger.displayName = 'DropdownMenuSubmenuTrigger';\n\nexport type DropdownMenuItemContentProps = React.HTMLAttributes<HTMLDivElement>;\n\nexport const DropdownMenuItemContentImpl = ({\n className,\n xstyle,\n ...rest\n}: DropdownMenuItemContentProps & { xstyle?: XStyle }) => {\n return <div {...rest} className={clsx(sx([menuStyles.itemContent, xstyle]), className)} />;\n};\n\nexport const DropdownMenuItemContent = (props: DropdownMenuItemContentProps) => (\n <DropdownMenuItemContentImpl {...props} />\n);\n\nDropdownMenuItemContent.displayName = 'DropdownMenuItemContent';\n\nexport type DropdownMenuItemIconProps = React.HTMLAttributes<HTMLSpanElement>;\n\nexport const DropdownMenuItemIconImpl = ({\n className,\n xstyle,\n ...rest\n}: DropdownMenuItemIconProps & { xstyle?: XStyle }) => {\n return (\n <span\n {...rest}\n className={clsx(sx([menuStyles.icon, xstyle], menuClassNames.icon), className)}\n />\n );\n};\n\nexport const DropdownMenuItemIcon = (props: DropdownMenuItemIconProps) => (\n <DropdownMenuItemIconImpl {...props} />\n);\n\nDropdownMenuItemIcon.displayName = 'DropdownMenuItemIcon';\n\nexport type DropdownMenuItemLabelGroupProps = React.HTMLAttributes<HTMLDivElement>;\n\nexport const DropdownMenuItemLabelGroup = ({\n className,\n ...rest\n}: DropdownMenuItemLabelGroupProps) => {\n return <div {...rest} className={clsx(sx(menuStyles.labelGroup), className)} />;\n};\n\nDropdownMenuItemLabelGroup.displayName = 'DropdownMenuItemLabelGroup';\n\nexport type DropdownMenuItemLabelProps = React.HTMLAttributes<HTMLSpanElement>;\n\nexport const DropdownMenuItemLabel = ({ className, ...rest }: DropdownMenuItemLabelProps) => {\n return <span {...rest} className={clsx(sx(menuStyles.label, menuClassNames.label), className)} />;\n};\n\nDropdownMenuItemLabel.displayName = 'DropdownMenuItemLabel';\n\nexport type DropdownMenuItemDescProps = React.HTMLAttributes<HTMLSpanElement>;\n\nexport const DropdownMenuItemDesc = ({ className, ...rest }: DropdownMenuItemDescProps) => {\n return <span {...rest} className={clsx(sx(menuStyles.desc), className)} />;\n};\n\nDropdownMenuItemDesc.displayName = 'DropdownMenuItemDesc';\n\nexport type DropdownMenuItemExtraProps = React.HTMLAttributes<HTMLSpanElement>;\n\nexport const DropdownMenuItemExtra = ({ className, ...rest }: DropdownMenuItemExtraProps) => {\n return <span {...rest} className={clsx(sx(menuStyles.extra), className)} />;\n};\n\nDropdownMenuItemExtra.displayName = 'DropdownMenuItemExtra';\n\nexport type DropdownMenuSubmenuArrowProps = React.HTMLAttributes<HTMLSpanElement>;\n\nexport const DropdownMenuSubmenuArrow = ({ className, ...rest }: DropdownMenuSubmenuArrowProps) => {\n return (\n <span\n {...rest}\n className={clsx(sx(menuStyles.submenuArrow, menuClassNames.submenuArrow), className)}\n />\n );\n};\n\nDropdownMenuSubmenuArrow.displayName = 'DropdownMenuSubmenuArrow';\n\nexport type DropdownMenuSwitchItemProps = Omit<\n React.ComponentProps<typeof Menu.Item>,\n 'onClick'\n> & {\n checked?: boolean;\n closeOnClick?: boolean;\n danger?: boolean;\n defaultChecked?: boolean;\n onCheckedChange?: (checked: boolean) => void;\n};\n\nexport const DropdownMenuSwitchItem = ({\n checked: checkedProp,\n className,\n closeOnClick = false,\n danger,\n defaultChecked,\n disabled,\n onCheckedChange,\n children,\n ...rest\n}: DropdownMenuSwitchItemProps) => {\n const [internalChecked, setInternalChecked] = useState(defaultChecked ?? false);\n const isControlled = checkedProp !== undefined;\n const checked = isControlled ? checkedProp : internalChecked;\n\n const handleCheckedChange = useCallback(\n (newChecked: boolean) => {\n if (!isControlled) {\n setInternalChecked(newChecked);\n }\n onCheckedChange?.(newChecked);\n },\n [isControlled, onCheckedChange],\n );\n\n return (\n <Menu.Item\n {...rest}\n closeOnClick={closeOnClick}\n disabled={disabled}\n className={(state) =>\n clsx(itemClassName(danger), typeof className === 'function' ? className(state) : className)\n }\n onClick={(e) => {\n e.preventDefault();\n if (!disabled) {\n handleCheckedChange(!checked);\n }\n }}\n >\n {children}\n <span\n style={{ display: 'inline-flex', marginInlineStart: 16 }}\n onFocus={(e) => e.stopPropagation()}\n >\n <Switch\n checked={checked}\n disabled={disabled}\n size=\"small\"\n tabIndex={-1}\n onChange={handleCheckedChange}\n onClick={(_, e) => e.stopPropagation()}\n />\n </span>\n </Menu.Item>\n );\n};\n\nDropdownMenuSwitchItem.displayName = 'DropdownMenuSwitchItem';\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAqBA,MAAa,oBAAqC,UAAS,oBAAC,KAAK,MAAN;CAAW,OAAO;CAAO,GAAI;AAAQ,CAAA;AAChG,MAAa,0BAA0B,KAAK;AAC5C,MAAa,oCAAoC,KAAK;AAEtD,MAAM,uBAAgC,MAAc,cAA4E;CAC9H,IAAI,OAAO,cAAc,YAAY,QAAQ,UAAkBA,OAAK,MAAM,UAAU,KAAK,CAAC;CAC1F,OAAOA,OAAK,MAAM,SAAS;AAC7B;AACA,MAAM,MAAM,QAAgB,oBAA6BA,OAAK,OAAO,MAAM,MAAM,CAAC,CAAC,WAAW,eAAe;AAC7G,MAAM,iBAAiB,WAAgC,GAAG,CAAC,WAAW,MAAM,UAAU,WAAW,MAAM,CAAC;AAIxG,MAAa,uBAAuB,EAClC,UACA,WACA,cACA,KAAK,SACL,GAAG,WAC2B;CAC9B,MAAM,EACJ,8BACA,yBACE,gBAAgB;EAClB;EACA;CACF,CAAC;CACD,MAAM,YAAY,UAAe;EAG/B,MAAM,uBAAuB;GAC3B,IAAI,8BAA8B,OAAO;GAEzC,MAAM,EACJ,MACA,GAAG,cACD;GACJ,OAAO;EACT,EAAA,CAAG;EACH,MAAM,cAAc,WAAY,SAAiB,OAAO,aAAa;EACrE,OAAO,aAAa,UAAiB;GACnC,GAAG;GACH,WAAWA,OAAK,WAAW,qBAAqB,WAAW,YAAY,SAAS;GAChF,KAAK,UAAU;IAAE,SAAiB;IAAM,MAAc;IAAK;GAAO,CAAC;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AAM,CAAC,iBAAiB,sBAAsB,SAAS,kBAAkB,KAAK;CAC9E,MAAM,eAAe,gBAAgB,KAAA;CACrC,MAAM,UAAU,eAAe,cAAc;CAC7C,MAAM,sBAAsB,aAAa,eAAwB;EAC/D,IAAI,CAAC,cACH,mBAAmB,UAAU;EAE/B,kBAAkB,UAAU;CAC9B,GAAG,CAAC,cAAc,eAAe,CAAC;CAClC,OAAO,qBAAC,KAAK,MAAN;EAAW,GAAI;EAAoB;EAAwB;EAAU,YAAW,UAASA,OAAK,cAAc,MAAM,GAAG,OAAO,cAAc,aAAa,UAAU,KAAK,IAAI,SAAS;EAAG,UAAS,MAAK;GACzM,EAAE,eAAe;GACjB,IAAI,CAAC,UACH,oBAAoB,CAAC,OAAO;EAEhC;EALO,UAAA,CAMF,UACD,oBAAC,QAAD;GAAM,OAAO;IACb,SAAS;IACT,mBAAmB;GACrB;GAAG,UAAS,MAAK,EAAE,gBAAgB;GAC/B,UAAA,oBAAC,QAAD;IAAiB;IAAmB;IAAU,MAAK;IAAQ,UAAU;IAAI,UAAU;IAAqB,UAAU,GAAG,MAAM,EAAE,gBAAgB;GAAI,CAAA;EAC7I,CAAA,CACG;;AACf;AACA,uBAAuB,cAAc"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { menuClassNames, menuStyles } from "./style.mjs";
|
|
2
|
-
import clsx from "clsx";
|
|
2
|
+
import clsx$1 from "clsx";
|
|
3
3
|
import * as stylex from "@stylexjs/stylex";
|
|
4
4
|
//#region src/DropdownMenu/sharedStyle.ts
|
|
5
|
-
const styles = Object.fromEntries(Object.entries(menuStyles).map(([key, value]) => [key, clsx(stylex.props(value).className, menuClassNames[key])]));
|
|
5
|
+
const styles = Object.fromEntries(Object.entries(menuStyles).map(([key, value]) => [key, clsx$1(stylex.props(value).className, menuClassNames[key])]));
|
|
6
6
|
//#endregion
|
|
7
7
|
export { menuClassNames, menuStyles, styles };
|
|
8
8
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sharedStyle.mjs","names":[],"sources":["../../src/DropdownMenu/sharedStyle.ts"],"sourcesContent":["import * as stylex from '@stylexjs/stylex';\nimport clsx from 'clsx';\n\nimport { menuClassNames, menuStyles } from './style';\n\nexport { menuClassNames, menuStyles } from './style';\n\nexport const styles = Object.fromEntries(\n Object.entries(menuStyles).map(([key, value]) => [\n key,\n clsx(stylex.props(value).className, menuClassNames[key as keyof typeof menuClassNames]),\n ]),\n) as Record<keyof typeof menuStyles, string>;\n"],"mappings":";;;;AAIA,MAAa,SAAS,OAAO,YAAY,OAAO,QAAQ,UAAU,CAAC,CAAC,KAAK,CAAC,KAAK,WAAW,CAAC,
|
|
1
|
+
{"version":3,"file":"sharedStyle.mjs","names":["clsx"],"sources":["../../src/DropdownMenu/sharedStyle.ts"],"sourcesContent":["import * as stylex from '@stylexjs/stylex';\nimport clsx from 'clsx';\n\nimport { menuClassNames, menuStyles } from './style';\n\nexport { menuClassNames, menuStyles } from './style';\n\nexport const styles = Object.fromEntries(\n Object.entries(menuStyles).map(([key, value]) => [\n key,\n clsx(stylex.props(value).className, menuClassNames[key as keyof typeof menuClassNames]),\n ]),\n) as Record<keyof typeof menuStyles, string>;\n"],"mappings":";;;;AAIA,MAAa,SAAS,OAAO,YAAY,OAAO,QAAQ,UAAU,CAAC,CAAC,KAAK,CAAC,KAAK,WAAW,CAAC,KAAKA,OAAK,OAAO,MAAM,KAAK,CAAC,CAAC,WAAW,eAAe,IAAmC,CAAC,CAAC,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import FlexBasic_default from "../Flex/FlexBasic.mjs";
|
|
3
|
+
import { cx } from "../styles/css.mjs";
|
|
3
4
|
import ActionIcon from "../ActionIcon/ActionIcon.mjs";
|
|
4
5
|
import { useControlledState } from "../hooks/useControlledState.mjs";
|
|
5
|
-
import { cx } from "../styles/css.mjs";
|
|
6
6
|
import ControlInput from "./ControlInput.mjs";
|
|
7
7
|
import { memo, useMemo } from "react";
|
|
8
8
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -3,13 +3,13 @@ import { useAppElement } from "../ConfigProvider/AppElementContext.mjs";
|
|
|
3
3
|
import { menuClassNames, menuStyles } from "../DropdownMenu/style.mjs";
|
|
4
4
|
import { styles } from "./style.mjs";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
|
-
import clsx from "clsx";
|
|
6
|
+
import clsx$1 from "clsx";
|
|
7
7
|
import * as stylex from "@stylexjs/stylex";
|
|
8
8
|
import { Autocomplete } from "@base-ui/react/autocomplete";
|
|
9
9
|
//#region src/EditorSlashMenu/atoms.tsx
|
|
10
10
|
const mergeStateClassName = (base, className) => {
|
|
11
|
-
if (typeof className === "function") return (state) => clsx(base, className(state));
|
|
12
|
-
return clsx(base, className);
|
|
11
|
+
if (typeof className === "function") return (state) => clsx$1(base, className(state));
|
|
12
|
+
return clsx$1(base, className);
|
|
13
13
|
};
|
|
14
14
|
const sx = (styles) => stylex.props(styles).className ?? "";
|
|
15
15
|
const EditorSlashMenuRoot = Autocomplete.Root;
|
|
@@ -36,7 +36,7 @@ const EditorSlashMenuPositioner = ({ className, align, positionMethod, side, sid
|
|
|
36
36
|
positionMethod: positionMethod ?? "fixed",
|
|
37
37
|
side: side ?? "bottom",
|
|
38
38
|
sideOffset: sideOffset ?? 6,
|
|
39
|
-
className: mergeStateClassName(clsx(sx(menuStyles.positioner), menuClassNames.positioner), className)
|
|
39
|
+
className: mergeStateClassName(clsx$1(sx(menuStyles.positioner), menuClassNames.positioner), className)
|
|
40
40
|
});
|
|
41
41
|
};
|
|
42
42
|
EditorSlashMenuPositioner.displayName = "EditorSlashMenuPositioner";
|
|
@@ -44,14 +44,14 @@ const EditorSlashMenuPopup = ({ className, initialFocus = false, ...rest }) => {
|
|
|
44
44
|
return /* @__PURE__ */ jsx(Autocomplete.Popup, {
|
|
45
45
|
...rest,
|
|
46
46
|
initialFocus,
|
|
47
|
-
className: mergeStateClassName(clsx(sx(menuStyles.popup), menuClassNames.popup), className)
|
|
47
|
+
className: mergeStateClassName(clsx$1(sx(menuStyles.popup), menuClassNames.popup), className)
|
|
48
48
|
});
|
|
49
49
|
};
|
|
50
50
|
EditorSlashMenuPopup.displayName = "EditorSlashMenuPopup";
|
|
51
51
|
const EditorSlashMenuItem = ({ className, danger, ...rest }) => {
|
|
52
52
|
return /* @__PURE__ */ jsx(Autocomplete.Item, {
|
|
53
53
|
...rest,
|
|
54
|
-
className: (state) => clsx(sx([menuStyles.item, danger && menuStyles.danger]), typeof className === "function" ? className(state) : className)
|
|
54
|
+
className: (state) => clsx$1(sx([menuStyles.item, danger && menuStyles.danger]), typeof className === "function" ? className(state) : className)
|
|
55
55
|
});
|
|
56
56
|
};
|
|
57
57
|
EditorSlashMenuItem.displayName = "EditorSlashMenuItem";
|
|
@@ -59,42 +59,42 @@ const EditorSlashMenuGroup = Autocomplete.Group;
|
|
|
59
59
|
const EditorSlashMenuGroupLabel = ({ className, ...rest }) => {
|
|
60
60
|
return /* @__PURE__ */ jsx(Autocomplete.GroupLabel, {
|
|
61
61
|
...rest,
|
|
62
|
-
className: (state) => clsx(sx(menuStyles.groupLabel), typeof className === "function" ? className(state) : className)
|
|
62
|
+
className: (state) => clsx$1(sx(menuStyles.groupLabel), typeof className === "function" ? className(state) : className)
|
|
63
63
|
});
|
|
64
64
|
};
|
|
65
65
|
EditorSlashMenuGroupLabel.displayName = "EditorSlashMenuGroupLabel";
|
|
66
66
|
const EditorSlashMenuEmpty = ({ className, ...rest }) => {
|
|
67
67
|
return /* @__PURE__ */ jsx(Autocomplete.Empty, {
|
|
68
68
|
...rest,
|
|
69
|
-
className: (state) => clsx(sx([menuStyles.item, menuStyles.empty]), typeof className === "function" ? className(state) : className)
|
|
69
|
+
className: (state) => clsx$1(sx([menuStyles.item, menuStyles.empty]), typeof className === "function" ? className(state) : className)
|
|
70
70
|
});
|
|
71
71
|
};
|
|
72
72
|
EditorSlashMenuEmpty.displayName = "EditorSlashMenuEmpty";
|
|
73
73
|
const EditorSlashMenuItemContent = ({ className, ...rest }) => {
|
|
74
74
|
return /* @__PURE__ */ jsx("div", {
|
|
75
75
|
...rest,
|
|
76
|
-
className: clsx(sx(menuStyles.itemContent), className)
|
|
76
|
+
className: clsx$1(sx(menuStyles.itemContent), className)
|
|
77
77
|
});
|
|
78
78
|
};
|
|
79
79
|
EditorSlashMenuItemContent.displayName = "EditorSlashMenuItemContent";
|
|
80
80
|
const EditorSlashMenuItemIcon = ({ className, ...rest }) => {
|
|
81
81
|
return /* @__PURE__ */ jsx("span", {
|
|
82
82
|
...rest,
|
|
83
|
-
className: clsx(sx(menuStyles.icon), menuClassNames.icon, className)
|
|
83
|
+
className: clsx$1(sx(menuStyles.icon), menuClassNames.icon, className)
|
|
84
84
|
});
|
|
85
85
|
};
|
|
86
86
|
EditorSlashMenuItemIcon.displayName = "EditorSlashMenuItemIcon";
|
|
87
87
|
const EditorSlashMenuItemLabel = ({ className, ...rest }) => {
|
|
88
88
|
return /* @__PURE__ */ jsx("span", {
|
|
89
89
|
...rest,
|
|
90
|
-
className: clsx(sx(menuStyles.label), menuClassNames.label, className)
|
|
90
|
+
className: clsx$1(sx(menuStyles.label), menuClassNames.label, className)
|
|
91
91
|
});
|
|
92
92
|
};
|
|
93
93
|
EditorSlashMenuItemLabel.displayName = "EditorSlashMenuItemLabel";
|
|
94
94
|
const EditorSlashMenuItemExtra = ({ className, ...rest }) => {
|
|
95
95
|
return /* @__PURE__ */ jsx("span", {
|
|
96
96
|
...rest,
|
|
97
|
-
className: clsx(sx(menuStyles.extra), className)
|
|
97
|
+
className: clsx$1(sx(menuStyles.extra), className)
|
|
98
98
|
});
|
|
99
99
|
};
|
|
100
100
|
EditorSlashMenuItemExtra.displayName = "EditorSlashMenuItemExtra";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"atoms.mjs","names":[],"sources":["../../src/EditorSlashMenu/atoms.tsx"],"sourcesContent":["'use client';\n\nimport { Autocomplete } from '@base-ui/react/autocomplete';\nimport * as stylex from '@stylexjs/stylex';\nimport clsx from 'clsx';\nimport type React from 'react';\n\nimport { useAppElement } from '@/ConfigProvider';\nimport { menuClassNames, menuStyles } from '@/DropdownMenu/sharedStyle';\nimport { type styleProps } from '@/styles/stylex/props';\n\nimport { styles } from './style';\n\nconst mergeStateClassName = <TState,>(\n base: string,\n className: string | ((state: TState) => string | undefined) | undefined,\n) => {\n if (typeof className === 'function') return (state: TState) => clsx(base, className(state));\n return clsx(base, className);\n};\n\nconst sx = (styles: Parameters<typeof styleProps>[0]) => stylex.props(styles).className ?? '';\n\nexport const EditorSlashMenuRoot = Autocomplete.Root;\nexport const EditorSlashMenuList = ({\n ref,\n className,\n ...rest\n}: React.ComponentProps<typeof Autocomplete.List> & {\n ref?: React.RefObject<HTMLDivElement | null>;\n}) => {\n return (\n <Autocomplete.List\n {...rest}\n className={mergeStateClassName(sx(styles.list), className as any) as any}\n ref={ref}\n />\n );\n};\nEditorSlashMenuList.displayName = 'EditorSlashMenuList';\n\nexport type EditorSlashMenuPortalProps = React.ComponentProps<typeof Autocomplete.Portal> & {\n /**\n * When `container` is not provided, it uses a shared container created by `usePortalContainer`.\n */\n container?: HTMLElement | null;\n};\n\nexport const EditorSlashMenuPortal = ({ container, ...rest }: EditorSlashMenuPortalProps) => {\n const appElement = useAppElement();\n return <Autocomplete.Portal container={container ?? appElement ?? undefined} {...rest} />;\n};\nEditorSlashMenuPortal.displayName = 'EditorSlashMenuPortal';\n\nexport type EditorSlashMenuPositionerProps = React.ComponentProps<typeof Autocomplete.Positioner>;\n\nexport const EditorSlashMenuPositioner = ({\n className,\n align,\n positionMethod,\n side,\n sideOffset,\n ...rest\n}: EditorSlashMenuPositionerProps) => {\n return (\n <Autocomplete.Positioner\n {...rest}\n align={align ?? 'start'}\n positionMethod={positionMethod ?? 'fixed'}\n side={side ?? 'bottom'}\n sideOffset={sideOffset ?? 6}\n className={\n mergeStateClassName(\n clsx(sx(menuStyles.positioner), menuClassNames.positioner),\n className as any,\n ) as any\n }\n />\n );\n};\nEditorSlashMenuPositioner.displayName = 'EditorSlashMenuPositioner';\n\nexport type EditorSlashMenuPopupProps = React.ComponentProps<typeof Autocomplete.Popup>;\n\nexport const EditorSlashMenuPopup = ({\n className,\n initialFocus = false,\n ...rest\n}: EditorSlashMenuPopupProps) => {\n return (\n <Autocomplete.Popup\n {...rest}\n initialFocus={initialFocus}\n className={\n mergeStateClassName(\n clsx(sx(menuStyles.popup), menuClassNames.popup),\n className as any,\n ) as any\n }\n />\n );\n};\nEditorSlashMenuPopup.displayName = 'EditorSlashMenuPopup';\n\nexport type EditorSlashMenuItemProps = React.ComponentProps<typeof Autocomplete.Item> & {\n danger?: boolean;\n};\n\nexport const EditorSlashMenuItem = ({ className, danger, ...rest }: EditorSlashMenuItemProps) => {\n return (\n <Autocomplete.Item\n {...rest}\n className={(state) =>\n clsx(\n sx([menuStyles.item, danger && menuStyles.danger]),\n typeof className === 'function' ? className(state) : className,\n )\n }\n />\n );\n};\nEditorSlashMenuItem.displayName = 'EditorSlashMenuItem';\n\nexport type EditorSlashMenuGroupProps = React.ComponentProps<typeof Autocomplete.Group>;\nexport const EditorSlashMenuGroup = Autocomplete.Group;\n\nexport type EditorSlashMenuGroupLabelProps = React.ComponentProps<typeof Autocomplete.GroupLabel>;\n\nexport const EditorSlashMenuGroupLabel = ({\n className,\n ...rest\n}: EditorSlashMenuGroupLabelProps) => {\n return (\n <Autocomplete.GroupLabel\n {...rest}\n className={(state) =>\n clsx(\n sx(menuStyles.groupLabel),\n typeof className === 'function' ? className(state) : className,\n )\n }\n />\n );\n};\nEditorSlashMenuGroupLabel.displayName = 'EditorSlashMenuGroupLabel';\n\nexport type EditorSlashMenuEmptyProps = React.ComponentProps<typeof Autocomplete.Empty>;\n\nexport const EditorSlashMenuEmpty = ({ className, ...rest }: EditorSlashMenuEmptyProps) => {\n return (\n <Autocomplete.Empty\n {...rest}\n className={(state) =>\n clsx(\n sx([menuStyles.item, menuStyles.empty]),\n typeof className === 'function' ? className(state) : className,\n )\n }\n />\n );\n};\nEditorSlashMenuEmpty.displayName = 'EditorSlashMenuEmpty';\n\nexport type EditorSlashMenuItemContentProps = React.HTMLAttributes<HTMLDivElement>;\nexport const EditorSlashMenuItemContent = ({\n className,\n ...rest\n}: EditorSlashMenuItemContentProps) => {\n return <div {...rest} className={clsx(sx(menuStyles.itemContent), className)} />;\n};\nEditorSlashMenuItemContent.displayName = 'EditorSlashMenuItemContent';\n\nexport type EditorSlashMenuItemIconProps = React.HTMLAttributes<HTMLSpanElement>;\nexport const EditorSlashMenuItemIcon = ({ className, ...rest }: EditorSlashMenuItemIconProps) => {\n return <span {...rest} className={clsx(sx(menuStyles.icon), menuClassNames.icon, className)} />;\n};\nEditorSlashMenuItemIcon.displayName = 'EditorSlashMenuItemIcon';\n\nexport type EditorSlashMenuItemLabelProps = React.HTMLAttributes<HTMLSpanElement>;\nexport const EditorSlashMenuItemLabel = ({ className, ...rest }: EditorSlashMenuItemLabelProps) => {\n return <span {...rest} className={clsx(sx(menuStyles.label), menuClassNames.label, className)} />;\n};\nEditorSlashMenuItemLabel.displayName = 'EditorSlashMenuItemLabel';\n\nexport type EditorSlashMenuItemExtraProps = React.HTMLAttributes<HTMLSpanElement>;\nexport const EditorSlashMenuItemExtra = ({ className, ...rest }: EditorSlashMenuItemExtraProps) => {\n return <span {...rest} className={clsx(sx(menuStyles.extra), className)} />;\n};\nEditorSlashMenuItemExtra.displayName = 'EditorSlashMenuItemExtra';\n\nexport type EditorSlashMenuHiddenInputProps = React.ComponentProps<typeof Autocomplete.Input>;\nexport const EditorSlashMenuHiddenInput = ({\n className,\n ...rest\n}: EditorSlashMenuHiddenInputProps) => {\n return (\n <Autocomplete.Input\n {...rest}\n className={mergeStateClassName(sx(styles.hiddenInput), className as any) as any}\n />\n );\n};\nEditorSlashMenuHiddenInput.displayName = 'EditorSlashMenuHiddenInput';\n"],"mappings":";;;;;;;;;AAUA,MAAM,uBAAgC,MAAc,cAA4E;CAC9H,IAAI,OAAO,cAAc,YAAY,QAAQ,
|
|
1
|
+
{"version":3,"file":"atoms.mjs","names":["clsx"],"sources":["../../src/EditorSlashMenu/atoms.tsx"],"sourcesContent":["'use client';\n\nimport { Autocomplete } from '@base-ui/react/autocomplete';\nimport * as stylex from '@stylexjs/stylex';\nimport clsx from 'clsx';\nimport type React from 'react';\n\nimport { useAppElement } from '@/ConfigProvider';\nimport { menuClassNames, menuStyles } from '@/DropdownMenu/sharedStyle';\nimport { type styleProps } from '@/styles/stylex/props';\n\nimport { styles } from './style';\n\nconst mergeStateClassName = <TState,>(\n base: string,\n className: string | ((state: TState) => string | undefined) | undefined,\n) => {\n if (typeof className === 'function') return (state: TState) => clsx(base, className(state));\n return clsx(base, className);\n};\n\nconst sx = (styles: Parameters<typeof styleProps>[0]) => stylex.props(styles).className ?? '';\n\nexport const EditorSlashMenuRoot = Autocomplete.Root;\nexport const EditorSlashMenuList = ({\n ref,\n className,\n ...rest\n}: React.ComponentProps<typeof Autocomplete.List> & {\n ref?: React.RefObject<HTMLDivElement | null>;\n}) => {\n return (\n <Autocomplete.List\n {...rest}\n className={mergeStateClassName(sx(styles.list), className as any) as any}\n ref={ref}\n />\n );\n};\nEditorSlashMenuList.displayName = 'EditorSlashMenuList';\n\nexport type EditorSlashMenuPortalProps = React.ComponentProps<typeof Autocomplete.Portal> & {\n /**\n * When `container` is not provided, it uses a shared container created by `usePortalContainer`.\n */\n container?: HTMLElement | null;\n};\n\nexport const EditorSlashMenuPortal = ({ container, ...rest }: EditorSlashMenuPortalProps) => {\n const appElement = useAppElement();\n return <Autocomplete.Portal container={container ?? appElement ?? undefined} {...rest} />;\n};\nEditorSlashMenuPortal.displayName = 'EditorSlashMenuPortal';\n\nexport type EditorSlashMenuPositionerProps = React.ComponentProps<typeof Autocomplete.Positioner>;\n\nexport const EditorSlashMenuPositioner = ({\n className,\n align,\n positionMethod,\n side,\n sideOffset,\n ...rest\n}: EditorSlashMenuPositionerProps) => {\n return (\n <Autocomplete.Positioner\n {...rest}\n align={align ?? 'start'}\n positionMethod={positionMethod ?? 'fixed'}\n side={side ?? 'bottom'}\n sideOffset={sideOffset ?? 6}\n className={\n mergeStateClassName(\n clsx(sx(menuStyles.positioner), menuClassNames.positioner),\n className as any,\n ) as any\n }\n />\n );\n};\nEditorSlashMenuPositioner.displayName = 'EditorSlashMenuPositioner';\n\nexport type EditorSlashMenuPopupProps = React.ComponentProps<typeof Autocomplete.Popup>;\n\nexport const EditorSlashMenuPopup = ({\n className,\n initialFocus = false,\n ...rest\n}: EditorSlashMenuPopupProps) => {\n return (\n <Autocomplete.Popup\n {...rest}\n initialFocus={initialFocus}\n className={\n mergeStateClassName(\n clsx(sx(menuStyles.popup), menuClassNames.popup),\n className as any,\n ) as any\n }\n />\n );\n};\nEditorSlashMenuPopup.displayName = 'EditorSlashMenuPopup';\n\nexport type EditorSlashMenuItemProps = React.ComponentProps<typeof Autocomplete.Item> & {\n danger?: boolean;\n};\n\nexport const EditorSlashMenuItem = ({ className, danger, ...rest }: EditorSlashMenuItemProps) => {\n return (\n <Autocomplete.Item\n {...rest}\n className={(state) =>\n clsx(\n sx([menuStyles.item, danger && menuStyles.danger]),\n typeof className === 'function' ? className(state) : className,\n )\n }\n />\n );\n};\nEditorSlashMenuItem.displayName = 'EditorSlashMenuItem';\n\nexport type EditorSlashMenuGroupProps = React.ComponentProps<typeof Autocomplete.Group>;\nexport const EditorSlashMenuGroup = Autocomplete.Group;\n\nexport type EditorSlashMenuGroupLabelProps = React.ComponentProps<typeof Autocomplete.GroupLabel>;\n\nexport const EditorSlashMenuGroupLabel = ({\n className,\n ...rest\n}: EditorSlashMenuGroupLabelProps) => {\n return (\n <Autocomplete.GroupLabel\n {...rest}\n className={(state) =>\n clsx(\n sx(menuStyles.groupLabel),\n typeof className === 'function' ? className(state) : className,\n )\n }\n />\n );\n};\nEditorSlashMenuGroupLabel.displayName = 'EditorSlashMenuGroupLabel';\n\nexport type EditorSlashMenuEmptyProps = React.ComponentProps<typeof Autocomplete.Empty>;\n\nexport const EditorSlashMenuEmpty = ({ className, ...rest }: EditorSlashMenuEmptyProps) => {\n return (\n <Autocomplete.Empty\n {...rest}\n className={(state) =>\n clsx(\n sx([menuStyles.item, menuStyles.empty]),\n typeof className === 'function' ? className(state) : className,\n )\n }\n />\n );\n};\nEditorSlashMenuEmpty.displayName = 'EditorSlashMenuEmpty';\n\nexport type EditorSlashMenuItemContentProps = React.HTMLAttributes<HTMLDivElement>;\nexport const EditorSlashMenuItemContent = ({\n className,\n ...rest\n}: EditorSlashMenuItemContentProps) => {\n return <div {...rest} className={clsx(sx(menuStyles.itemContent), className)} />;\n};\nEditorSlashMenuItemContent.displayName = 'EditorSlashMenuItemContent';\n\nexport type EditorSlashMenuItemIconProps = React.HTMLAttributes<HTMLSpanElement>;\nexport const EditorSlashMenuItemIcon = ({ className, ...rest }: EditorSlashMenuItemIconProps) => {\n return <span {...rest} className={clsx(sx(menuStyles.icon), menuClassNames.icon, className)} />;\n};\nEditorSlashMenuItemIcon.displayName = 'EditorSlashMenuItemIcon';\n\nexport type EditorSlashMenuItemLabelProps = React.HTMLAttributes<HTMLSpanElement>;\nexport const EditorSlashMenuItemLabel = ({ className, ...rest }: EditorSlashMenuItemLabelProps) => {\n return <span {...rest} className={clsx(sx(menuStyles.label), menuClassNames.label, className)} />;\n};\nEditorSlashMenuItemLabel.displayName = 'EditorSlashMenuItemLabel';\n\nexport type EditorSlashMenuItemExtraProps = React.HTMLAttributes<HTMLSpanElement>;\nexport const EditorSlashMenuItemExtra = ({ className, ...rest }: EditorSlashMenuItemExtraProps) => {\n return <span {...rest} className={clsx(sx(menuStyles.extra), className)} />;\n};\nEditorSlashMenuItemExtra.displayName = 'EditorSlashMenuItemExtra';\n\nexport type EditorSlashMenuHiddenInputProps = React.ComponentProps<typeof Autocomplete.Input>;\nexport const EditorSlashMenuHiddenInput = ({\n className,\n ...rest\n}: EditorSlashMenuHiddenInputProps) => {\n return (\n <Autocomplete.Input\n {...rest}\n className={mergeStateClassName(sx(styles.hiddenInput), className as any) as any}\n />\n );\n};\nEditorSlashMenuHiddenInput.displayName = 'EditorSlashMenuHiddenInput';\n"],"mappings":";;;;;;;;;AAUA,MAAM,uBAAgC,MAAc,cAA4E;CAC9H,IAAI,OAAO,cAAc,YAAY,QAAQ,UAAkBA,OAAK,MAAM,UAAU,KAAK,CAAC;CAC1F,OAAOA,OAAK,MAAM,SAAS;AAC7B;AACA,MAAM,MAAM,WAA6C,OAAO,MAAM,MAAM,CAAC,CAAC,aAAa;AAC3F,MAAa,sBAAsB,aAAa;AAChD,MAAa,uBAAuB,EAClC,KACA,WACA,GAAG,WAGC;CACJ,OAAO,oBAAC,aAAa,MAAd;EAAmB,GAAI;EAAM,WAAW,oBAAoB,GAAG,OAAO,IAAI,GAAG,SAAgB;EAAe;CAAM,CAAA;AAC3H;AACA,oBAAoB,cAAc;AAOlC,MAAa,yBAAyB,EACpC,WACA,GAAG,WAC6B;CAChC,MAAM,aAAa,cAAc;CACjC,OAAO,oBAAC,aAAa,QAAd;EAAqB,WAAW,aAAa,cAAc,KAAA;EAAW,GAAI;CAAO,CAAA;AAC1F;AACA,sBAAsB,cAAc;AAEpC,MAAa,6BAA6B,EACxC,WACA,OACA,gBACA,MACA,YACA,GAAG,WACiC;CACpC,OAAO,oBAAC,aAAa,YAAd;EAAyB,GAAI;EAAM,OAAO,SAAS;EAAS,gBAAgB,kBAAkB;EAAS,MAAM,QAAQ;EAAU,YAAY,cAAc;EAAG,WAAW,oBAAoBA,OAAK,GAAG,WAAW,UAAU,GAAG,eAAe,UAAU,GAAG,SAAgB;CAAW,CAAA;AAC3R;AACA,0BAA0B,cAAc;AAExC,MAAa,wBAAwB,EACnC,WACA,eAAe,OACf,GAAG,WAC4B;CAC/B,OAAO,oBAAC,aAAa,OAAd;EAAoB,GAAI;EAAoB;EAAc,WAAW,oBAAoBA,OAAK,GAAG,WAAW,KAAK,GAAG,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