@lobehub/ui 6.0.0-beta.7 → 6.0.0-beta.9
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/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 +9 -2
- package/es/DatePicker/DatePicker.mjs +15 -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/DayjsDatePicker.d.mts +12 -0
- package/es/DatePicker/DayjsDatePicker.mjs +19 -0
- package/es/DatePicker/DayjsDatePicker.mjs.map +1 -0
- package/es/DatePicker/DayjsDateRangePicker.d.mts +7 -0
- package/es/DatePicker/DayjsDateRangePicker.mjs +8 -0
- package/es/DatePicker/DayjsDateRangePicker.mjs.map +1 -0
- package/es/DatePicker/PurePanel.mjs +65 -0
- package/es/DatePicker/PurePanel.mjs.map +1 -0
- package/es/DatePicker/RangePicker.mjs +121 -0
- package/es/DatePicker/RangePicker.mjs.map +1 -0
- package/es/DatePicker/SinglePicker.mjs +134 -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/dateGenerateConfig.mjs +52 -0
- package/es/DatePicker/dateGenerateConfig.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 +8 -3
- package/es/DatePicker/index.mjs +5 -1
- package/es/DatePicker/legacyDate.mjs +58 -0
- package/es/DatePicker/legacyDate.mjs.map +1 -0
- 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 +294 -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 +49 -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/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/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 -6
- package/es/index.mjs +12 -6
- 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/stylex/props.mjs +2 -2
- package/es/styles/stylex/props.mjs.map +1 -1
- package/es/styles/theme/themeCss.mjs +15 -0
- package/es/styles/theme/themeCss.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/Icon/Icon.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import { calcSize } from "./components/utils.mjs";
|
|
|
5
5
|
import { styles } from "./style.mjs";
|
|
6
6
|
import { isValidElement, memo, useMemo } from "react";
|
|
7
7
|
import { jsx } from "react/jsx-runtime";
|
|
8
|
-
import clsx from "clsx";
|
|
8
|
+
import clsx$1 from "clsx";
|
|
9
9
|
//#region src/Icon/Icon.tsx
|
|
10
10
|
const Icon = memo(({ icon, size: iconSize, color, fill = "transparent", className, focusable, spin, fillRule, fillOpacity, ref, ...rest }) => {
|
|
11
11
|
const { color: colorConfig, fill: fillConfig, fillOpacity: fillOpacityConfig, fillRule: fillRuleConfig, focusable: focusableConfig, className: classNameConfig, size: sizeConfig, ...restConfig } = useIconContext();
|
|
@@ -13,7 +13,7 @@ const Icon = memo(({ icon, size: iconSize, color, fill = "transparent", classNam
|
|
|
13
13
|
const SvgIcon = icon;
|
|
14
14
|
return /* @__PURE__ */ jsx("span", {
|
|
15
15
|
role: "img",
|
|
16
|
-
className: styleProps([styles.root, spin && styles.spin], clsx("anticon", classNameConfig, className)).className,
|
|
16
|
+
className: styleProps([styles.root, spin && styles.spin], clsx$1("anticon", classNameConfig, className)).className,
|
|
17
17
|
...restConfig,
|
|
18
18
|
...rest,
|
|
19
19
|
children: icon && (isValidElement(icon) ? icon : /* @__PURE__ */ jsx(SvgIcon, {
|
package/es/Icon/Icon.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Icon.mjs","names":[],"sources":["../../src/Icon/Icon.tsx"],"sourcesContent":["'use client';\n\nimport clsx from 'clsx';\nimport type { LucideIcon } from 'lucide-react';\nimport { isValidElement, memo, useMemo } from 'react';\n\nimport { styleProps } from '@/styles/stylex/props';\n\nimport { useIconContext } from './components/IconProvider';\nimport { calcSize } from './components/utils';\nimport { styles } from './style';\nimport type { IconProps } from './type';\n\nconst Icon = memo<IconProps>(\n ({\n icon,\n size: iconSize,\n color,\n fill = 'transparent',\n className,\n focusable,\n spin,\n fillRule,\n fillOpacity,\n ref,\n ...rest\n }) => {\n const {\n color: colorConfig,\n fill: fillConfig,\n fillOpacity: fillOpacityConfig,\n fillRule: fillRuleConfig,\n focusable: focusableConfig,\n className: classNameConfig,\n size: sizeConfig,\n ...restConfig\n } = useIconContext();\n\n const { size, strokeWidth } = useMemo(\n () => calcSize(iconSize || sizeConfig),\n [iconSize, sizeConfig],\n );\n\n const SvgIcon = icon as LucideIcon;\n\n return (\n <span\n role=\"img\"\n className={\n styleProps(\n [styles.root, spin && styles.spin],\n clsx('anticon', classNameConfig, className),\n ).className\n }\n {...restConfig}\n {...rest}\n >\n {icon &&\n (isValidElement(icon) ? (\n icon\n ) : (\n <SvgIcon\n color={color || colorConfig}\n fill={fill || fillConfig}\n fillOpacity={fillOpacity || fillOpacityConfig}\n fillRule={fillRule || fillRuleConfig}\n focusable={focusable || focusableConfig}\n height={size}\n ref={ref}\n size={size}\n strokeWidth={strokeWidth}\n width={size}\n />\n ))}\n </span>\n );\n },\n);\n\nIcon.displayName = 'Icon';\n\nexport default Icon;\n"],"mappings":";;;;;;;;;AAaA,MAAM,OAAO,MACV,EACC,MACA,MAAM,UACN,OACA,OAAO,eACP,WACA,WACA,MACA,UACA,aACA,KACA,GAAG,WACC;CACJ,MAAM,EACJ,OAAO,aACP,MAAM,YACN,aAAa,mBACb,UAAU,gBACV,WAAW,iBACX,WAAW,iBACX,MAAM,YACN,GAAG,eACD,eAAe;CAEnB,MAAM,EAAE,MAAM,gBAAgB,cACtB,SAAS,YAAY,UAAU,GACrC,CAAC,UAAU,UAAU,CACvB;CAEA,MAAM,UAAU;CAEhB,OACE,oBAAC,QAAD;EACE,MAAK;EACL,WACE,WACE,CAAC,OAAO,MAAM,QAAQ,OAAO,IAAI,
|
|
1
|
+
{"version":3,"file":"Icon.mjs","names":["clsx"],"sources":["../../src/Icon/Icon.tsx"],"sourcesContent":["'use client';\n\nimport clsx from 'clsx';\nimport type { LucideIcon } from 'lucide-react';\nimport { isValidElement, memo, useMemo } from 'react';\n\nimport { styleProps } from '@/styles/stylex/props';\n\nimport { useIconContext } from './components/IconProvider';\nimport { calcSize } from './components/utils';\nimport { styles } from './style';\nimport type { IconProps } from './type';\n\nconst Icon = memo<IconProps>(\n ({\n icon,\n size: iconSize,\n color,\n fill = 'transparent',\n className,\n focusable,\n spin,\n fillRule,\n fillOpacity,\n ref,\n ...rest\n }) => {\n const {\n color: colorConfig,\n fill: fillConfig,\n fillOpacity: fillOpacityConfig,\n fillRule: fillRuleConfig,\n focusable: focusableConfig,\n className: classNameConfig,\n size: sizeConfig,\n ...restConfig\n } = useIconContext();\n\n const { size, strokeWidth } = useMemo(\n () => calcSize(iconSize || sizeConfig),\n [iconSize, sizeConfig],\n );\n\n const SvgIcon = icon as LucideIcon;\n\n return (\n <span\n role=\"img\"\n className={\n styleProps(\n [styles.root, spin && styles.spin],\n clsx('anticon', classNameConfig, className),\n ).className\n }\n {...restConfig}\n {...rest}\n >\n {icon &&\n (isValidElement(icon) ? (\n icon\n ) : (\n <SvgIcon\n color={color || colorConfig}\n fill={fill || fillConfig}\n fillOpacity={fillOpacity || fillOpacityConfig}\n fillRule={fillRule || fillRuleConfig}\n focusable={focusable || focusableConfig}\n height={size}\n ref={ref}\n size={size}\n strokeWidth={strokeWidth}\n width={size}\n />\n ))}\n </span>\n );\n },\n);\n\nIcon.displayName = 'Icon';\n\nexport default Icon;\n"],"mappings":";;;;;;;;;AAaA,MAAM,OAAO,MACV,EACC,MACA,MAAM,UACN,OACA,OAAO,eACP,WACA,WACA,MACA,UACA,aACA,KACA,GAAG,WACC;CACJ,MAAM,EACJ,OAAO,aACP,MAAM,YACN,aAAa,mBACb,UAAU,gBACV,WAAW,iBACX,WAAW,iBACX,MAAM,YACN,GAAG,eACD,eAAe;CAEnB,MAAM,EAAE,MAAM,gBAAgB,cACtB,SAAS,YAAY,UAAU,GACrC,CAAC,UAAU,UAAU,CACvB;CAEA,MAAM,UAAU;CAEhB,OACE,oBAAC,QAAD;EACE,MAAK;EACL,WACE,WACE,CAAC,OAAO,MAAM,QAAQ,OAAO,IAAI,GACjCA,OAAK,WAAW,iBAAiB,SAAS,CAC5C,CAAC,CAAC;EAEJ,GAAI;EACJ,GAAI;EAEH,UAAA,SACE,eAAe,IAAI,IAClB,OAEA,oBAAC,SAAD;GACE,OAAO,SAAS;GAChB,MAAM,QAAQ;GACd,aAAa,eAAe;GAC5B,UAAU,YAAY;GACtB,WAAW,aAAa;GACxB,QAAQ;GACH;GACC;GACO;GACb,OAAO;EACR,CAAA;CAED,CAAA;AAEV,CACF;AAEA,KAAK,cAAc"}
|
package/es/List/ListRow.mjs
CHANGED
|
@@ -7,7 +7,7 @@ import { listItemMarker } from "./marker.stylex.mjs";
|
|
|
7
7
|
import { styles } from "./style.mjs";
|
|
8
8
|
import { memo } from "react";
|
|
9
9
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
-
import clsx from "clsx";
|
|
10
|
+
import clsx$1 from "clsx";
|
|
11
11
|
import * as stylex from "@stylexjs/stylex";
|
|
12
12
|
//#region src/List/ListRow.tsx
|
|
13
13
|
const ListRow = memo(({ active, classNames, compact, item, onSelect, styles: customStyles, xstyle }) => {
|
|
@@ -27,7 +27,7 @@ const ListRow = memo(({ active, classNames, compact, item, onSelect, styles: cus
|
|
|
27
27
|
danger && styles.danger,
|
|
28
28
|
disabled && styles.disabled,
|
|
29
29
|
xstyle?.(item, active)
|
|
30
|
-
], clsx(classNames?.item, item.className)).className;
|
|
30
|
+
], clsx$1(classNames?.item, item.className)).className;
|
|
31
31
|
const rowStyle = {
|
|
32
32
|
...customStyles?.item,
|
|
33
33
|
...item.style
|
|
@@ -40,7 +40,7 @@ const ListRow = memo(({ active, classNames, compact, item, onSelect, styles: cus
|
|
|
40
40
|
/* @__PURE__ */ jsxs("span", {
|
|
41
41
|
...stylex.props(styles.body),
|
|
42
42
|
children: [/* @__PURE__ */ jsx("span", {
|
|
43
|
-
...styleProps(styles.label, clsx("lobe-list-label", classNames?.label), customStyles?.label),
|
|
43
|
+
...styleProps(styles.label, clsx$1("lobe-list-label", classNames?.label), customStyles?.label),
|
|
44
44
|
children: label
|
|
45
45
|
}), description != null && /* @__PURE__ */ jsx("span", {
|
|
46
46
|
...styleProps(styles.description, classNames?.description, customStyles?.description),
|
package/es/List/ListRow.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListRow.mjs","names":[],"sources":["../../src/List/ListRow.tsx"],"sourcesContent":["'use client';\n\nimport './style.css';\n\nimport * as stylex from '@stylexjs/stylex';\nimport clsx from 'clsx';\nimport { memo, type MouseEvent } from 'react';\n\nimport A from '@/A';\nimport Icon from '@/Icon';\nimport { focusRing } from '@/styles/stylex/focusRing';\nimport { styleProps } from '@/styles/stylex/props';\n\nimport { listItemMarker } from './marker.stylex';\nimport { styles } from './style';\nimport type { ListItemType, ListProps } from './type';\n\nexport type ListRowXstyle = (\n item: ListItemType,\n active: boolean,\n) => Parameters<typeof styleProps>[0];\n\ninterface ListRowProps {\n active: boolean;\n classNames?: ListProps['classNames'];\n compact: boolean;\n item: ListItemType;\n onSelect: (item: ListItemType, event: MouseEvent<HTMLElement>) => void;\n styles?: ListProps['styles'];\n xstyle?: ListRowXstyle;\n}\n\nconst ListRow = memo<ListRowProps>(\n ({ active, classNames, compact, item, onSelect, styles: customStyles, xstyle }) => {\n const { actions, avatar, danger, description, disabled, extra, href, icon, label, showAction } =\n item;\n\n const handleClick = (event: MouseEvent<HTMLElement>) => {\n if (disabled) {\n event.preventDefault();\n return;\n }\n onSelect(item, event);\n };\n\n const rowClassName = styleProps(\n [\n focusRing.info,\n styles.row,\n compact && styles.compactRow,\n active && styles.active,\n danger && styles.danger,\n disabled && styles.disabled,\n xstyle?.(item, active),\n ],\n clsx(classNames?.item, item.className),\n ).className;\n const rowStyle = { ...customStyles?.item, ...item.style };\n\n const content = (\n <>\n {avatar ?? (icon ? <Icon icon={icon} size={16} /> : null)}\n <span {...stylex.props(styles.body)}>\n <span\n {...styleProps(\n styles.label,\n clsx('lobe-list-label', classNames?.label),\n customStyles?.label,\n )}\n >\n {label}\n </span>\n {description != null && (\n <span\n {...styleProps(\n styles.description,\n classNames?.description,\n customStyles?.description,\n )}\n >\n {description}\n </span>\n )}\n </span>\n {extra != null && (\n <span {...styleProps(styles.extra, classNames?.extra, customStyles?.extra)}>{extra}</span>\n )}\n </>\n );\n\n return (\n <li {...stylex.props(styles.item, listItemMarker)}>\n {href && !disabled ? (\n <A\n aria-current={active ? 'page' : undefined}\n className={rowClassName}\n href={href}\n style={rowStyle}\n onClick={handleClick}\n >\n {content}\n </A>\n ) : (\n <button\n aria-current={active ? 'true' : undefined}\n aria-disabled={disabled || undefined}\n className={rowClassName}\n style={rowStyle}\n type=\"button\"\n onClick={handleClick}\n >\n {content}\n </button>\n )}\n {actions != null && (\n <span\n {...styleProps(\n [styles.actions, showAction && styles.showAction],\n classNames?.actions,\n customStyles?.actions,\n )}\n >\n {actions}\n </span>\n )}\n </li>\n );\n },\n);\n\nListRow.displayName = 'ListRow';\n\nexport default ListRow;\n"],"mappings":";;;;;;;;;;;;AAuBA,MAAM,UAAU,MAAoB,EAClC,QACA,YACA,SACA,MACA,UACA,QAAQ,cACR,aACI;CACJ,MAAM,EACJ,SACA,QACA,QACA,aACA,UACA,OACA,MACA,MACA,OACA,eACE;CACJ,MAAM,eAAe,UAAmC;EACtD,IAAI,UAAU;GACZ,MAAM,eAAe;GACrB;EACF;EACA,SAAS,MAAM,KAAK;CACtB;CACA,MAAM,eAAe,WAAW;EAAC,UAAU;EAAM,OAAO;EAAK,WAAW,OAAO;EAAY,UAAU,OAAO;EAAQ,UAAU,OAAO;EAAQ,YAAY,OAAO;EAAU,SAAS,MAAM,MAAM;CAAC,
|
|
1
|
+
{"version":3,"file":"ListRow.mjs","names":["clsx"],"sources":["../../src/List/ListRow.tsx"],"sourcesContent":["'use client';\n\nimport './style.css';\n\nimport * as stylex from '@stylexjs/stylex';\nimport clsx from 'clsx';\nimport { memo, type MouseEvent } from 'react';\n\nimport A from '@/A';\nimport Icon from '@/Icon';\nimport { focusRing } from '@/styles/stylex/focusRing';\nimport { styleProps } from '@/styles/stylex/props';\n\nimport { listItemMarker } from './marker.stylex';\nimport { styles } from './style';\nimport type { ListItemType, ListProps } from './type';\n\nexport type ListRowXstyle = (\n item: ListItemType,\n active: boolean,\n) => Parameters<typeof styleProps>[0];\n\ninterface ListRowProps {\n active: boolean;\n classNames?: ListProps['classNames'];\n compact: boolean;\n item: ListItemType;\n onSelect: (item: ListItemType, event: MouseEvent<HTMLElement>) => void;\n styles?: ListProps['styles'];\n xstyle?: ListRowXstyle;\n}\n\nconst ListRow = memo<ListRowProps>(\n ({ active, classNames, compact, item, onSelect, styles: customStyles, xstyle }) => {\n const { actions, avatar, danger, description, disabled, extra, href, icon, label, showAction } =\n item;\n\n const handleClick = (event: MouseEvent<HTMLElement>) => {\n if (disabled) {\n event.preventDefault();\n return;\n }\n onSelect(item, event);\n };\n\n const rowClassName = styleProps(\n [\n focusRing.info,\n styles.row,\n compact && styles.compactRow,\n active && styles.active,\n danger && styles.danger,\n disabled && styles.disabled,\n xstyle?.(item, active),\n ],\n clsx(classNames?.item, item.className),\n ).className;\n const rowStyle = { ...customStyles?.item, ...item.style };\n\n const content = (\n <>\n {avatar ?? (icon ? <Icon icon={icon} size={16} /> : null)}\n <span {...stylex.props(styles.body)}>\n <span\n {...styleProps(\n styles.label,\n clsx('lobe-list-label', classNames?.label),\n customStyles?.label,\n )}\n >\n {label}\n </span>\n {description != null && (\n <span\n {...styleProps(\n styles.description,\n classNames?.description,\n customStyles?.description,\n )}\n >\n {description}\n </span>\n )}\n </span>\n {extra != null && (\n <span {...styleProps(styles.extra, classNames?.extra, customStyles?.extra)}>{extra}</span>\n )}\n </>\n );\n\n return (\n <li {...stylex.props(styles.item, listItemMarker)}>\n {href && !disabled ? (\n <A\n aria-current={active ? 'page' : undefined}\n className={rowClassName}\n href={href}\n style={rowStyle}\n onClick={handleClick}\n >\n {content}\n </A>\n ) : (\n <button\n aria-current={active ? 'true' : undefined}\n aria-disabled={disabled || undefined}\n className={rowClassName}\n style={rowStyle}\n type=\"button\"\n onClick={handleClick}\n >\n {content}\n </button>\n )}\n {actions != null && (\n <span\n {...styleProps(\n [styles.actions, showAction && styles.showAction],\n classNames?.actions,\n customStyles?.actions,\n )}\n >\n {actions}\n </span>\n )}\n </li>\n );\n },\n);\n\nListRow.displayName = 'ListRow';\n\nexport default ListRow;\n"],"mappings":";;;;;;;;;;;;AAuBA,MAAM,UAAU,MAAoB,EAClC,QACA,YACA,SACA,MACA,UACA,QAAQ,cACR,aACI;CACJ,MAAM,EACJ,SACA,QACA,QACA,aACA,UAC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WAAW;GAAc,OAAO;GAAU,MAAK;GAAS,SAAS;GAC9J,UAAA;EACK,CAAA,GACT,WAAW,QAAQ,oBAAC,QAAD;GAAM,GAAI,WAAW,CAAC,OAAO,SAAS,cAAc,OAAO,UAAU,GAAG,YAAY,SAAS,cAAc,OAAO;GACjI,UAAA;EACG,CAAA,CACN;;AACV,CAAC;AACD,QAAQ,cAAc"}
|
package/es/Markdown/Markdown.mjs
CHANGED
|
@@ -9,7 +9,7 @@ import { StreamdownRender } from "./SyntaxMarkdown/StreamdownRender.mjs";
|
|
|
9
9
|
import { TypographyImpl } from "./Typography.mjs";
|
|
10
10
|
import { memo, useCallback } from "react";
|
|
11
11
|
import { jsx } from "react/jsx-runtime";
|
|
12
|
-
import clsx from "clsx";
|
|
12
|
+
import clsx$1 from "clsx";
|
|
13
13
|
//#region src/Markdown/Markdown.tsx
|
|
14
14
|
const Markdown = memo((props) => {
|
|
15
15
|
const { ref, children = "", className, style, fullFeaturedCodeBlock, onDoubleClick, animated, enableHtmlPreview = false, enableLatex = true, enableMermaid = true, enableImageGallery, enableCustomFootnotes, enableGithubAlert, enableStream = true, componentProps, rehypePluginsAhead, allowHtml, borderRadius, fontSize = props.variant === "chat" ? 14 : void 0, headerMultiple = props.variant === "chat" ? .25 : void 0, marginMultiple = props.variant === "chat" ? 1 : void 0, variant = "default", reactMarkdownProps, lineHeight = props.variant === "chat" ? 1.6 : void 0, rehypePlugins, remarkPlugins, remarkPluginsAhead, components = {}, customRender, showFootnotes = true, streamAnimationGranularity, streamSmoothingPreset, citations, ...rest } = props;
|
|
@@ -35,7 +35,7 @@ const Markdown = memo((props) => {
|
|
|
35
35
|
ref,
|
|
36
36
|
style,
|
|
37
37
|
xstyle: rootStyles.root,
|
|
38
|
-
className: clsx(variant === "chat" && styles.chat, enableLatex && styles.latex, styles.gfm, className),
|
|
38
|
+
className: clsx$1(variant === "chat" && styles.chat, enableLatex && styles.latex, styles.gfm, className),
|
|
39
39
|
onDoubleClick,
|
|
40
40
|
...rest,
|
|
41
41
|
children: /* @__PURE__ */ jsx(MarkdownProvider, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Markdown.mjs","names":["MarkdownRender"],"sources":["../../src/Markdown/Markdown.tsx"],"sourcesContent":["'use client';\n\nimport clsx from 'clsx';\nimport { memo, useCallback } from 'react';\n\nimport { useStableValue } from '@/hooks/useStableValue';\nimport { PreviewGroup } from '@/Image';\n\nimport { MarkdownProvider } from './components/MarkdownProvider';\nimport { useDelayedAnimated } from './components/useDelayedAnimated';\nimport { rootStyles, styles } from './style';\nimport { MarkdownRender, StreamdownRender } from './SyntaxMarkdown';\nimport { type MarkdownProps } from './type';\nimport { TypographyImpl } from './Typography';\n\nconst Markdown = memo<MarkdownProps>((props) => {\n const {\n ref,\n children = '',\n className,\n style,\n fullFeaturedCodeBlock,\n onDoubleClick,\n animated,\n enableHtmlPreview = false,\n enableLatex = true,\n enableMermaid = true,\n enableImageGallery,\n enableCustomFootnotes,\n enableGithubAlert,\n enableStream = true,\n componentProps,\n rehypePluginsAhead,\n allowHtml,\n borderRadius,\n fontSize = props.variant === 'chat' ? 14 : undefined,\n headerMultiple = props.variant === 'chat' ? 0.25 : undefined,\n marginMultiple = props.variant === 'chat' ? 1 : undefined,\n variant = 'default',\n reactMarkdownProps,\n lineHeight = props.variant === 'chat' ? 1.6 : undefined,\n rehypePlugins,\n remarkPlugins,\n remarkPluginsAhead,\n components = {},\n customRender,\n showFootnotes = true,\n streamAnimationGranularity,\n streamSmoothingPreset,\n citations,\n ...rest\n } = props;\n\n const delayedAnimated = useDelayedAnimated(animated);\n\n // Stabilise structural props so an inline `componentProps={{ html:\n // {...} }}` from the caller doesn't cascade through MarkdownProvider →\n // useMarkdownComponents → react-markdown's `components` and remount the\n // entire code-block subtree (including the HtmlPreview iframe) on\n // every parent render. The deep-equal compare treats inline literals\n // as the same object as long as their structure matches. Inline\n // callbacks (`actionsRender`, custom `components`) still need\n // `useCallback` at the call site — function bodies aren't compared.\n const stableComponentProps = useStableValue(componentProps);\n const stableComponents = useStableValue(components);\n\n const Render = useCallback(\n ({\n enableStream,\n children,\n reactMarkdownProps,\n }: Pick<MarkdownProps, 'children' | 'enableStream' | 'reactMarkdownProps'>) => {\n const DefaultRender = enableStream ? StreamdownRender : MarkdownRender;\n const defaultDOM = <DefaultRender {...reactMarkdownProps}>{children}</DefaultRender>;\n return customRender ? customRender(defaultDOM, { text: children }) : defaultDOM;\n },\n [customRender],\n );\n\n return (\n <PreviewGroup enable={enableImageGallery}>\n <TypographyImpl\n borderRadius={borderRadius}\n data-code-type=\"markdown\"\n fontSize={fontSize}\n headerMultiple={headerMultiple}\n lineHeight={lineHeight}\n marginMultiple={marginMultiple}\n ref={ref}\n style={style}\n xstyle={rootStyles.root}\n className={clsx(\n variant === 'chat' && styles.chat,\n enableLatex && styles.latex,\n styles.gfm,\n className,\n )}\n onDoubleClick={onDoubleClick}\n {...rest}\n >\n <MarkdownProvider\n allowHtml={allowHtml}\n animated={delayedAnimated}\n citations={citations}\n componentProps={stableComponentProps}\n components={stableComponents}\n enableCustomFootnotes={enableCustomFootnotes}\n enableGithubAlert={enableGithubAlert}\n enableHtmlPreview={enableHtmlPreview}\n enableLatex={enableLatex}\n enableMermaid={enableMermaid}\n fullFeaturedCodeBlock={fullFeaturedCodeBlock}\n rehypePlugins={rehypePlugins}\n rehypePluginsAhead={rehypePluginsAhead}\n remarkPlugins={remarkPlugins}\n remarkPluginsAhead={remarkPluginsAhead}\n showFootnotes={showFootnotes}\n streamAnimationGranularity={streamAnimationGranularity}\n streamSmoothingPreset={streamSmoothingPreset}\n variant={variant}\n >\n <Render\n enableStream={enableStream && delayedAnimated}\n reactMarkdownProps={reactMarkdownProps}\n >\n {children}\n </Render>\n </MarkdownProvider>\n </TypographyImpl>\n </PreviewGroup>\n );\n});\n\nMarkdown.displayName = 'Markdown';\n\nexport default Markdown;\n"],"mappings":";;;;;;;;;;;;;AAeA,MAAM,WAAW,MAAqB,UAAU;CAC9C,MAAM,EACJ,KACA,WAAW,IACX,WACA,OACA,uBACA,eACA,UACA,oBAAoB,OACpB,cAAc,MACd,gBAAgB,MAChB,oBACA,uBACA,mBACA,eAAe,MACf,gBACA,oBACA,WACA,cACA,WAAW,MAAM,YAAY,SAAS,KAAK,KAAA,GAC3C,iBAAiB,MAAM,YAAY,SAAS,MAAO,KAAA,GACnD,iBAAiB,MAAM,YAAY,SAAS,IAAI,KAAA,GAChD,UAAU,WACV,oBACA,aAAa,MAAM,YAAY,SAAS,MAAM,KAAA,GAC9C,eACA,eACA,oBACA,aAAa,CAAC,GACd,cACA,gBAAgB,MAChB,4BACA,uBACA,WACA,GAAG,SACD;CAEJ,MAAM,kBAAkB,mBAAmB,QAAQ;CAUnD,MAAM,uBAAuB,eAAe,cAAc;CAC1D,MAAM,mBAAmB,eAAe,UAAU;CAElD,MAAM,SAAS,aACZ,EACC,cACA,UACA,yBAC6E;EAE7E,MAAM,aAAa,oBADG,eAAe,mBAAmBA,kBACrC;GAAe,GAAI;GAAqB;EAAwB,CAAA;EACnF,OAAO,eAAe,aAAa,YAAY,EAAE,MAAM,SAAS,CAAC,IAAI;CACvE,GACA,CAAC,YAAY,CACf;CAEA,OACE,oBAAC,cAAD;EAAc,QAAQ;EACpB,UAAA,oBAAC,gBAAD;GACgB;GACd,kBAAe;GACL;GACM;GACJ;GACI;GACX;GACE;GACP,QAAQ,WAAW;GACnB,
|
|
1
|
+
{"version":3,"file":"Markdown.mjs","names":["MarkdownRender","clsx"],"sources":["../../src/Markdown/Markdown.tsx"],"sourcesContent":["'use client';\n\nimport clsx from 'clsx';\nimport { memo, useCallback } from 'react';\n\nimport { useStableValue } from '@/hooks/useStableValue';\nimport { PreviewGroup } from '@/Image';\n\nimport { MarkdownProvider } from './components/MarkdownProvider';\nimport { useDelayedAnimated } from './components/useDelayedAnimated';\nimport { rootStyles, styles } from './style';\nimport { MarkdownRender, StreamdownRender } from './SyntaxMarkdown';\nimport { type MarkdownProps } from './type';\nimport { TypographyImpl } from './Typography';\n\nconst Markdown = memo<MarkdownProps>((props) => {\n const {\n ref,\n children = '',\n className,\n style,\n fullFeaturedCodeBlock,\n onDoubleClick,\n animated,\n enableHtmlPreview = false,\n enableLatex = true,\n enableMermaid = true,\n enableImageGallery,\n enableCustomFootnotes,\n enableGithubAlert,\n enableStream = true,\n componentProps,\n rehypePluginsAhead,\n allowHtml,\n borderRadius,\n fontSize = props.variant === 'chat' ? 14 : undefined,\n headerMultiple = props.variant === 'chat' ? 0.25 : undefined,\n marginMultiple = props.variant === 'chat' ? 1 : undefined,\n variant = 'default',\n reactMarkdownProps,\n lineHeight = props.variant === 'chat' ? 1.6 : undefined,\n rehypePlugins,\n remarkPlugins,\n remarkPluginsAhead,\n components = {},\n customRender,\n showFootnotes = true,\n streamAnimationGranularity,\n streamSmoothingPreset,\n citations,\n ...rest\n } = props;\n\n const delayedAnimated = useDelayedAnimated(animated);\n\n // Stabilise structural props so an inline `componentProps={{ html:\n // {...} }}` from the caller doesn't cascade through MarkdownProvider →\n // useMarkdownComponents → react-markdown's `components` and remount the\n // entire code-block subtree (including the HtmlPreview iframe) on\n // every parent render. The deep-equal compare treats inline literals\n // as the same object as long as their structure matches. Inline\n // callbacks (`actionsRender`, custom `components`) still need\n // `useCallback` at the call site — function bodies aren't compared.\n const stableComponentProps = useStableValue(componentProps);\n const stableComponents = useStableValue(components);\n\n const Render = useCallback(\n ({\n enableStream,\n children,\n reactMarkdownProps,\n }: Pick<MarkdownProps, 'children' | 'enableStream' | 'reactMarkdownProps'>) => {\n const DefaultRender = enableStream ? StreamdownRender : MarkdownRender;\n const defaultDOM = <DefaultRender {...reactMarkdownProps}>{children}</DefaultRender>;\n return customRender ? customRender(defaultDOM, { text: children }) : defaultDOM;\n },\n [customRender],\n );\n\n return (\n <PreviewGroup enable={enableImageGallery}>\n <TypographyImpl\n borderRadius={borderRadius}\n data-code-type=\"markdown\"\n fontSize={fontSize}\n headerMultiple={headerMultiple}\n lineHeight={lineHeight}\n marginMultiple={marginMultiple}\n ref={ref}\n style={style}\n xstyle={rootStyles.root}\n className={clsx(\n variant === 'chat' && styles.chat,\n enableLatex && styles.latex,\n styles.gfm,\n className,\n )}\n onDoubleClick={onDoubleClick}\n {...rest}\n >\n <MarkdownProvider\n allowHtml={allowHtml}\n animated={delayedAnimated}\n citations={citations}\n componentProps={stableComponentProps}\n components={stableComponents}\n enableCustomFootnotes={enableCustomFootnotes}\n enableGithubAlert={enableGithubAlert}\n enableHtmlPreview={enableHtmlPreview}\n enableLatex={enableLatex}\n enableMermaid={enableMermaid}\n fullFeaturedCodeBlock={fullFeaturedCodeBlock}\n rehypePlugins={rehypePlugins}\n rehypePluginsAhead={rehypePluginsAhead}\n remarkPlugins={remarkPlugins}\n remarkPluginsAhead={remarkPluginsAhead}\n showFootnotes={showFootnotes}\n streamAnimationGranularity={streamAnimationGranularity}\n streamSmoothingPreset={streamSmoothingPreset}\n variant={variant}\n >\n <Render\n enableStream={enableStream && delayedAnimated}\n reactMarkdownProps={reactMarkdownProps}\n >\n {children}\n </Render>\n </MarkdownProvider>\n </TypographyImpl>\n </PreviewGroup>\n );\n});\n\nMarkdown.displayName = 'Markdown';\n\nexport default Markdown;\n"],"mappings":";;;;;;;;;;;;;AAeA,MAAM,WAAW,MAAqB,UAAU;CAC9C,MAAM,EACJ,KACA,WAAW,IACX,WACA,OACA,uBACA,eACA,UACA,oBAAoB,OACpB,cAAc,MACd,gBAAgB,MAChB,oBACA,uBACA,mBACA,eAAe,MACf,gBACA,oBACA,WACA,cACA,WAAW,MAAM,YAAY,SAAS,KAAK,KAAA,GAC3C,iBAAiB,MAAM,YAAY,SAAS,MAAO,KAAA,GACnD,iBAAiB,MAAM,YAAY,SAAS,IAAI,KAAA,GAChD,UAAU,WACV,oBACA,aAAa,MAAM,YAAY,SAAS,MAAM,KAAA,GAC9C,eACA,eACA,oBACA,aAAa,CAAC,GACd,cACA,gBAAgB,MAChB,4BACA,uBACA,WACA,GAAG,SACD;CAEJ,MAAM,kBAAkB,mBAAmB,QAAQ;CAUnD,MAAM,uBAAuB,eAAe,cAAc;CAC1D,MAAM,mBAAmB,eAAe,UAAU;CAElD,MAAM,SAAS,aACZ,EACC,cACA,UACA,yBAC6E;EAE7E,MAAM,aAAa,oBADG,eAAe,mBAAmBA,kBACrC;GAAe,GAAI;GAAqB;EAAwB,CAAA;EACnF,OAAO,eAAe,aAAa,YAAY,EAAE,MAAM,SAAS,CAAC,IAAI;CACvE,GACA,CAAC,YAAY,CACf;CAEA,OACE,oBAAC,cAAD;EAAc,QAAQ;EACpB,UAAA,oBAAC,gBAAD;GACgB;GACd,kBAAe;GACL;GACM;GACJ;GACI;GACX;GACE;GACP,QAAQ,WAAW;GACnB,WAAWC,OACT,YAAY,UAAU,OAAO,MAC7B,eAAe,OAAO,OACtB,OAAO,KACP,SACF;GACe;GACf,GAAI;GAEJ,UAAA,oBAAC,kBAAD;IACa;IACX,UAAU;IACC;IACX,gBAAgB;IAChB,YAAY;IACW;IACJ;IACA;IACN;IACE;IACQ;IACR;IACK;IACL;IACK;IACL;IACa;IACL;IACd;IAET,UAAA,oBAAC,QAAD;KACE,cAAc,gBAAgB;KACV;KAEnB;IACK,CAAA;GACQ,CAAA;EACJ,CAAA;CACJ,CAAA;AAElB,CAAC;AAED,SAAS,cAAc"}
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
import { styleProps } from "../styles/stylex/props.mjs";
|
|
3
3
|
import { memo } from "react";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
|
-
import clsx from "clsx";
|
|
5
|
+
import clsx$1 from "clsx";
|
|
6
6
|
//#region src/Markdown/Typography.tsx
|
|
7
7
|
const TypographyImpl = ({ ref, children, className, fontSize = 16, headerMultiple = 1, marginMultiple = 2, lineHeight = 1.8, borderRadius = 8, style, xstyle, ...rest }) => {
|
|
8
8
|
return /* @__PURE__ */ jsx("article", {
|
|
9
9
|
ref,
|
|
10
|
-
...styleProps(xstyle, clsx("lobe-markdown", className), {
|
|
10
|
+
...styleProps(xstyle, clsx$1("lobe-markdown", className), {
|
|
11
11
|
"--lobe-markdown-border-radius": borderRadius,
|
|
12
12
|
"--lobe-markdown-font-size": `${fontSize}px`,
|
|
13
13
|
"--lobe-markdown-header-multiple": headerMultiple,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Typography.mjs","names":[],"sources":["../../src/Markdown/Typography.tsx"],"sourcesContent":["'use client';\n\nimport './style.css';\n\nimport clsx from 'clsx';\nimport { type CSSProperties, memo } from 'react';\n\nimport { styleProps } from '@/styles/stylex/props';\n\nimport type { TypographyProps } from './type';\n\nexport const TypographyImpl = ({\n ref,\n children,\n className,\n fontSize = 16,\n headerMultiple = 1,\n marginMultiple = 2,\n lineHeight = 1.8,\n borderRadius = 8,\n style,\n xstyle,\n ...rest\n}: TypographyProps & { xstyle?: Parameters<typeof styleProps>[0] }) => {\n return (\n <article\n ref={ref}\n {...styleProps(xstyle, clsx('lobe-markdown', className), {\n '--lobe-markdown-border-radius': borderRadius,\n '--lobe-markdown-font-size': `${fontSize}px`,\n '--lobe-markdown-header-multiple': headerMultiple,\n '--lobe-markdown-line-height': lineHeight,\n '--lobe-markdown-margin-multiple': marginMultiple,\n ...style,\n } as CSSProperties)}\n {...rest}\n >\n {children}\n </article>\n );\n};\n\nconst Typography = memo<TypographyProps>((props) => <TypographyImpl {...props} />);\n\nTypography.displayName = 'Typography';\n\nexport default Typography;\n"],"mappings":";;;;;;AAWA,MAAa,kBAAkB,EAC7B,KACA,UACA,WACA,WAAW,IACX,iBAAiB,GACjB,iBAAiB,GACjB,aAAa,KACb,eAAe,GACf,OACA,QACA,GAAG,WACkE;CACrE,OACE,oBAAC,WAAD;EACO;EACL,GAAI,WAAW,
|
|
1
|
+
{"version":3,"file":"Typography.mjs","names":["clsx"],"sources":["../../src/Markdown/Typography.tsx"],"sourcesContent":["'use client';\n\nimport './style.css';\n\nimport clsx from 'clsx';\nimport { type CSSProperties, memo } from 'react';\n\nimport { styleProps } from '@/styles/stylex/props';\n\nimport type { TypographyProps } from './type';\n\nexport const TypographyImpl = ({\n ref,\n children,\n className,\n fontSize = 16,\n headerMultiple = 1,\n marginMultiple = 2,\n lineHeight = 1.8,\n borderRadius = 8,\n style,\n xstyle,\n ...rest\n}: TypographyProps & { xstyle?: Parameters<typeof styleProps>[0] }) => {\n return (\n <article\n ref={ref}\n {...styleProps(xstyle, clsx('lobe-markdown', className), {\n '--lobe-markdown-border-radius': borderRadius,\n '--lobe-markdown-font-size': `${fontSize}px`,\n '--lobe-markdown-header-multiple': headerMultiple,\n '--lobe-markdown-line-height': lineHeight,\n '--lobe-markdown-margin-multiple': marginMultiple,\n ...style,\n } as CSSProperties)}\n {...rest}\n >\n {children}\n </article>\n );\n};\n\nconst Typography = memo<TypographyProps>((props) => <TypographyImpl {...props} />);\n\nTypography.displayName = 'Typography';\n\nexport default Typography;\n"],"mappings":";;;;;;AAWA,MAAa,kBAAkB,EAC7B,KACA,UACA,WACA,WAAW,IACX,iBAAiB,GACjB,iBAAiB,GACjB,aAAa,KACb,eAAe,GACf,OACA,QACA,GAAG,WACkE;CACrE,OACE,oBAAC,WAAD;EACO;EACL,GAAI,WAAW,QAAQA,OAAK,iBAAiB,SAAS,GAAG;GACvD,iCAAiC;GACjC,6BAA6B,GAAG,SAAS;GACzC,mCAAmC;GACnC,+BAA+B;GAC/B,mCAAmC;GACnC,GAAG;EACL,CAAkB;EAClB,GAAI;EAEH;CACM,CAAA;AAEb;AAEA,MAAM,aAAa,MAAuB,UAAU,oBAAC,gBAAD,EAAgB,GAAI,MAAQ,CAAA,CAAC;AAEjF,WAAW,cAAc"}
|
|
@@ -9,7 +9,7 @@ import CopyButton from "../CopyButton/CopyButton.mjs";
|
|
|
9
9
|
import { bodyStyles, headerFlexProps, headerStyles, rootClassName, rootStyles } from "../Highlighter/style.mjs";
|
|
10
10
|
import { memo, useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
11
11
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
-
import clsx from "clsx";
|
|
12
|
+
import clsx$1 from "clsx";
|
|
13
13
|
import { ChevronDown, ChevronRight } from "lucide-react";
|
|
14
14
|
//#region src/Mermaid/FullFeatured.tsx
|
|
15
15
|
const MermaidHeaderLanguage = memo(({ fileName, language, showLanguage }) => {
|
|
@@ -106,7 +106,7 @@ const MermaidFullFeatured = memo(({ showLanguage, styles: customStyles, classNam
|
|
|
106
106
|
})]
|
|
107
107
|
}), /* @__PURE__ */ jsx(FlexBasic_default, {
|
|
108
108
|
height: expand ? void 0 : 0,
|
|
109
|
-
...styleProps(bodyStyles(expand, variant), clsx(expand && "ant-highlighter-highlighter-body-expand", classNames?.body), customStyles?.body),
|
|
109
|
+
...styleProps(bodyStyles(expand, variant), clsx$1(expand && "ant-highlighter-highlighter-body-expand", classNames?.body), customStyles?.body),
|
|
110
110
|
children
|
|
111
111
|
})]
|
|
112
112
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FullFeatured.mjs","names":["Flexbox"],"sources":["../../src/Mermaid/FullFeatured.tsx"],"sourcesContent":["'use client';\n\nimport clsx from 'clsx';\nimport { ChevronDown, ChevronRight } from 'lucide-react';\nimport { memo, type ReactNode, useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\nimport ActionIcon from '@/ActionIcon';\nimport CopyButton from '@/CopyButton';\nimport { Flexbox } from '@/Flex';\nimport {\n bodyStyles,\n expandCls,\n headerFlexProps,\n headerStyles,\n rootClassName,\n rootStyles,\n} from '@/Highlighter/style';\nimport MaterialFileTypeIcon from '@/MaterialFileTypeIcon';\nimport { styleProps } from '@/styles/stylex/props';\nimport Text from '@/Text';\nimport { stopPropagation } from '@/utils/dom';\n\nimport { type MermaidProps } from './type';\n\nconst MermaidHeaderLanguage = memo(\n ({\n fileName,\n language,\n showLanguage,\n }: {\n fileName?: string;\n language: string;\n showLanguage?: boolean;\n }) => {\n if (!showLanguage) return null;\n\n return (\n <Flexbox\n horizontal\n align={'center'}\n className={'language-title'}\n flex={1}\n gap={4}\n justify={'flex-start'}\n paddingInline={8}\n >\n <MaterialFileTypeIcon\n fallbackUnknownType={false}\n filename={fileName || language}\n size={18}\n type={'file'}\n variant={'raw'}\n />\n\n <Text ellipsis fontSize={13}>\n {fileName || 'Mermaid'}\n </Text>\n </Flexbox>\n );\n },\n (prev, next) =>\n prev.fileName === next.fileName &&\n prev.language === next.language &&\n prev.showLanguage === next.showLanguage,\n);\n\nexport interface MermaidFullFeaturedProps extends Omit<MermaidProps, 'children'> {\n children: ReactNode;\n content: string;\n}\n\nexport const MermaidFullFeatured = memo<MermaidFullFeaturedProps>(\n ({\n showLanguage,\n styles: customStyles,\n classNames,\n content,\n children,\n className,\n copyable,\n actionsRender,\n style,\n variant,\n shadow,\n language = 'mermaid',\n fileName,\n defaultExpand = true,\n ...rest\n }) => {\n const [expand, setExpand] = useState(defaultExpand);\n const contentRef = useRef(content);\n\n useEffect(() => {\n contentRef.current = content;\n }, [content]);\n\n const getContent = useCallback(() => contentRef.current, []);\n\n const originalActions = useMemo(() => {\n if (!copyable) return null;\n return <CopyButton content={getContent} size={'small'} />;\n }, [copyable, getContent]);\n\n const actions = useMemo(() => {\n if (!actionsRender) return originalActions;\n return actionsRender({\n actionIconSize: 'small',\n content,\n getContent,\n originalNode: originalActions,\n });\n }, [actionsRender, content, getContent, originalActions]);\n\n const handleToggleExpand = useCallback(() => {\n setExpand((prev) => !prev);\n }, []);\n\n return (\n <Flexbox\n data-code-type=\"mermaid\"\n width={'100%'}\n {...rest}\n {...styleProps(rootStyles({ shadow, variant }), rootClassName(false, className), style)}\n >\n <Flexbox\n horizontal\n align={'center'}\n justify={'space-between'}\n onClick={handleToggleExpand}\n {...headerFlexProps(variant)}\n {...styleProps(headerStyles(variant), classNames?.header, customStyles?.header)}\n >\n <MermaidHeaderLanguage\n fileName={fileName}\n language={language}\n showLanguage={showLanguage}\n />\n <Flexbox horizontal align={'center'} flex={'none'} gap={4} onClick={stopPropagation}>\n <Flexbox horizontal align={'center'} className={'panel-actions'} flex={'none'} gap={4}>\n {actions}\n </Flexbox>\n <ActionIcon\n icon={expand ? ChevronDown : ChevronRight}\n size={'small'}\n onClick={handleToggleExpand}\n />\n </Flexbox>\n </Flexbox>\n <Flexbox\n height={expand ? undefined : 0}\n {...styleProps(\n bodyStyles(expand, variant),\n clsx(expand && expandCls, classNames?.body),\n customStyles?.body,\n )}\n >\n {children}\n </Flexbox>\n </Flexbox>\n );\n },\n);\n\nexport default MermaidFullFeatured;\n"],"mappings":";;;;;;;;;;;;;;AAwBA,MAAM,wBAAwB,MAC3B,EACC,UACA,UACA,mBAKI;CACJ,IAAI,CAAC,cAAc,OAAO;CAE1B,OACE,qBAACA,mBAAD;EACE,YAAA;EACA,OAAO;EACP,WAAW;EACX,MAAM;EACN,KAAK;EACL,SAAS;EACT,eAAe;EAPjB,UAAA,CASE,oBAAC,sBAAD;GACE,qBAAqB;GACrB,UAAU,YAAY;GACtB,MAAM;GACN,MAAM;GACN,SAAS;EACV,CAAA,GAED,oBAAC,MAAD;GAAM,UAAA;GAAS,UAAU;GACtB,UAAA,YAAY;EACT,CAAA,CACC;;AAEb,IACC,MAAM,SACL,KAAK,aAAa,KAAK,YACvB,KAAK,aAAa,KAAK,YACvB,KAAK,iBAAiB,KAAK,YAC/B;AAOA,MAAa,sBAAsB,MAChC,EACC,cACA,QAAQ,cACR,YACA,SACA,UACA,WACA,UACA,eACA,OACA,SACA,QACA,WAAW,WACX,UACA,gBAAgB,MAChB,GAAG,WACC;CACJ,MAAM,CAAC,QAAQ,aAAa,SAAS,aAAa;CAClD,MAAM,aAAa,OAAO,OAAO;CAEjC,gBAAgB;EACd,WAAW,UAAU;CACvB,GAAG,CAAC,OAAO,CAAC;CAEZ,MAAM,aAAa,kBAAkB,WAAW,SAAS,CAAC,CAAC;CAE3D,MAAM,kBAAkB,cAAc;EACpC,IAAI,CAAC,UAAU,OAAO;EACtB,OAAO,oBAAC,YAAD;GAAY,SAAS;GAAY,MAAM;EAAU,CAAA;CAC1D,GAAG,CAAC,UAAU,UAAU,CAAC;CAEzB,MAAM,UAAU,cAAc;EAC5B,IAAI,CAAC,eAAe,OAAO;EAC3B,OAAO,cAAc;GACnB,gBAAgB;GAChB;GACA;GACA,cAAc;EAChB,CAAC;CACH,GAAG;EAAC;EAAe;EAAS;EAAY;CAAe,CAAC;CAExD,MAAM,qBAAqB,kBAAkB;EAC3C,WAAW,SAAS,CAAC,IAAI;CAC3B,GAAG,CAAC,CAAC;CAEL,OACE,qBAACA,mBAAD;EACE,kBAAe;EACf,OAAO;EACP,GAAI;EACJ,GAAI,WAAW,WAAW;GAAE;GAAQ;EAAQ,CAAC,GAAG,cAAc,OAAO,SAAS,GAAG,KAAK;EAJxF,UAAA,CAME,qBAACA,mBAAD;GACE,YAAA;GACA,OAAO;GACP,SAAS;GACT,SAAS;GACT,GAAI,gBAAgB,OAAO;GAC3B,GAAI,WAAW,aAAa,OAAO,GAAG,YAAY,QAAQ,cAAc,MAAM;GANhF,UAAA,CAQE,oBAAC,uBAAD;IACY;IACA;IACI;GACf,CAAA,GACD,qBAACA,mBAAD;IAAS,YAAA;IAAW,OAAO;IAAU,MAAM;IAAQ,KAAK;IAAG,SAAS;IAApE,UAAA,CACE,oBAACA,mBAAD;KAAS,YAAA;KAAW,OAAO;KAAU,WAAW;KAAiB,MAAM;KAAQ,KAAK;KACjF,UAAA;IACM,CAAA,GACT,oBAAC,YAAD;KACE,MAAM,SAAS,cAAc;KAC7B,MAAM;KACN,SAAS;IACV,CAAA,CACM;GACF,CAAA,CAAA;EACT,CAAA,GAAA,oBAACA,mBAAD;GACE,QAAQ,SAAS,KAAA,IAAY;GAC7B,GAAI,WACF,WAAW,QAAQ,OAAO,
|
|
1
|
+
{"version":3,"file":"FullFeatured.mjs","names":["Flexbox","clsx"],"sources":["../../src/Mermaid/FullFeatured.tsx"],"sourcesContent":["'use client';\n\nimport clsx from 'clsx';\nimport { ChevronDown, ChevronRight } from 'lucide-react';\nimport { memo, type ReactNode, useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\nimport ActionIcon from '@/ActionIcon';\nimport CopyButton from '@/CopyButton';\nimport { Flexbox } from '@/Flex';\nimport {\n bodyStyles,\n expandCls,\n headerFlexProps,\n headerStyles,\n rootClassName,\n rootStyles,\n} from '@/Highlighter/style';\nimport MaterialFileTypeIcon from '@/MaterialFileTypeIcon';\nimport { styleProps } from '@/styles/stylex/props';\nimport Text from '@/Text';\nimport { stopPropagation } from '@/utils/dom';\n\nimport { type MermaidProps } from './type';\n\nconst MermaidHeaderLanguage = memo(\n ({\n fileName,\n language,\n showLanguage,\n }: {\n fileName?: string;\n language: string;\n showLanguage?: boolean;\n }) => {\n if (!showLanguage) return null;\n\n return (\n <Flexbox\n horizontal\n align={'center'}\n className={'language-title'}\n flex={1}\n gap={4}\n justify={'flex-start'}\n paddingInline={8}\n >\n <MaterialFileTypeIcon\n fallbackUnknownType={false}\n filename={fileName || language}\n size={18}\n type={'file'}\n variant={'raw'}\n />\n\n <Text ellipsis fontSize={13}>\n {fileName || 'Mermaid'}\n </Text>\n </Flexbox>\n );\n },\n (prev, next) =>\n prev.fileName === next.fileName &&\n prev.language === next.language &&\n prev.showLanguage === next.showLanguage,\n);\n\nexport interface MermaidFullFeaturedProps extends Omit<MermaidProps, 'children'> {\n children: ReactNode;\n content: string;\n}\n\nexport const MermaidFullFeatured = memo<MermaidFullFeaturedProps>(\n ({\n showLanguage,\n styles: customStyles,\n classNames,\n content,\n children,\n className,\n copyable,\n actionsRender,\n style,\n variant,\n shadow,\n language = 'mermaid',\n fileName,\n defaultExpand = true,\n ...rest\n }) => {\n const [expand, setExpand] = useState(defaultExpand);\n const contentRef = useRef(content);\n\n useEffect(() => {\n contentRef.current = content;\n }, [content]);\n\n const getContent = useCallback(() => contentRef.current, []);\n\n const originalActions = useMemo(() => {\n if (!copyable) return null;\n return <CopyButton content={getContent} size={'small'} />;\n }, [copyable, getContent]);\n\n const actions = useMemo(() => {\n if (!actionsRender) return originalActions;\n return actionsRender({\n actionIconSize: 'small',\n content,\n getContent,\n originalNode: originalActions,\n });\n }, [actionsRender, content, getContent, originalActions]);\n\n const handleToggleExpand = useCallback(() => {\n setExpand((prev) => !prev);\n }, []);\n\n return (\n <Flexbox\n data-code-type=\"mermaid\"\n width={'100%'}\n {...rest}\n {...styleProps(rootStyles({ shadow, variant }), rootClassName(false, className), style)}\n >\n <Flexbox\n horizontal\n align={'center'}\n justify={'space-between'}\n onClick={handleToggleExpand}\n {...headerFlexProps(variant)}\n {...styleProps(headerStyles(variant), classNames?.header, customStyles?.header)}\n >\n <MermaidHeaderLanguage\n fileName={fileName}\n language={language}\n showLanguage={showLanguage}\n />\n <Flexbox horizontal align={'center'} flex={'none'} gap={4} onClick={stopPropagation}>\n <Flexbox horizontal align={'center'} className={'panel-actions'} flex={'none'} gap={4}>\n {actions}\n </Flexbox>\n <ActionIcon\n icon={expand ? ChevronDown : ChevronRight}\n size={'small'}\n onClick={handleToggleExpand}\n />\n </Flexbox>\n </Flexbox>\n <Flexbox\n height={expand ? undefined : 0}\n {...styleProps(\n bodyStyles(expand, variant),\n clsx(expand && expandCls, classNames?.body),\n customStyles?.body,\n )}\n >\n {children}\n </Flexbox>\n </Flexbox>\n );\n },\n);\n\nexport default MermaidFullFeatured;\n"],"mappings":";;;;;;;;;;;;;;AAwBA,MAAM,wBAAwB,MAC3B,EACC,UACA,UACA,mBAKI;CACJ,IAAI,CAAC,cAAc,OAAO;CAE1B,OACE,qBAACA,mBAAD;EACE,YAAA;EACA,OAAO;EACP,WAAW;EACX,MAAM;EACN,KAAK;EACL,SAAS;EACT,eAAe;EAPjB,UAAA,CASE,oBAAC,sBAAD;GACE,qBAAqB;GACrB,UAAU,YAAY;GACtB,MAAM;GACN,MAAM;GACN,SAAS;EACV,CAAA,GAED,oBAAC,MAAD;GAAM,UAAA;GAAS,UAAU;GACtB,UAAA,YAAY;EACT,CAAA,CACC;;AAEb,IACC,MAAM,SACL,K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AQ,KAAK;IAAG,SAAS;IAApE,UAAA,CACE,oBAACA,mBAAD;KAAS,YAAA;KAAW,OAAO;KAAU,WAAW;KAAiB,MAAM;KAAQ,KAAK;KACjF,UAAA;IACM,CAAA,GACT,oBAAC,YAAD;KACE,MAAM,SAAS,cAAc;KAC7B,MAAM;KACN,SAAS;IACV,CAAA,CACM;GACF,CAAA,CAAA;EACT,CAAA,GAAA,oBAACA,mBAAD;GACE,QAAQ,SAAS,KAAA,IAAY;GAC7B,GAAI,WACF,WAAW,QAAQ,OAAO,GAC1BC,OAAK,UAAA,2CAAqB,YAAY,IAAI,GAC1C,cAAc,IAChB;GAEC;EACM,CAAA,CACF;;AAEb,CACF"}
|
|
@@ -5,20 +5,20 @@ import StreamMermaid from "./StreamMermaid.mjs";
|
|
|
5
5
|
import { styles } from "./style.mjs";
|
|
6
6
|
import { memo } from "react";
|
|
7
7
|
import { jsx } from "react/jsx-runtime";
|
|
8
|
-
import clsx from "clsx";
|
|
8
|
+
import clsx$1 from "clsx";
|
|
9
9
|
//#region src/Mermaid/SyntaxMermaid/index.tsx
|
|
10
10
|
const SyntaxMermaid = memo(({ animated, children, className, fallbackClassName, ref, style, theme: customTheme, variant = "borderless" }) => {
|
|
11
11
|
const isDefaultTheme = customTheme === "lobe-theme" || !customTheme;
|
|
12
12
|
const showBackground = !isDefaultTheme && variant === "filled";
|
|
13
13
|
const resolvedTheme = isDefaultTheme ? void 0 : customTheme;
|
|
14
|
-
const classes = clsx(!showBackground && "lobe-mermaid-transparent", animated && "lobe-mermaid-animated");
|
|
14
|
+
const classes = clsx$1(!showBackground && "lobe-mermaid-transparent", animated && "lobe-mermaid-animated");
|
|
15
15
|
const padded = variant !== "borderless" && styles.padded;
|
|
16
|
-
const mermaidClassName = styleProps([styles.root, padded], clsx("ant-mermaid-mermaid lobe-mermaid", classes, className)).className;
|
|
16
|
+
const mermaidClassName = styleProps([styles.root, padded], clsx$1("ant-mermaid-mermaid lobe-mermaid", classes, className)).className;
|
|
17
17
|
const fallback = styleProps([
|
|
18
18
|
styles.root,
|
|
19
19
|
styles.unmermaid,
|
|
20
20
|
padded
|
|
21
|
-
], clsx(classes, fallbackClassName)).className;
|
|
21
|
+
], clsx$1(classes, fallbackClassName)).className;
|
|
22
22
|
if (animated) return /* @__PURE__ */ jsx(StreamMermaid, {
|
|
23
23
|
className: mermaidClassName,
|
|
24
24
|
fallbackClassName: fallback,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../../src/Mermaid/SyntaxMermaid/index.tsx"],"sourcesContent":["'use client';\n\nimport clsx from 'clsx';\nimport { memo } from 'react';\n\nimport { styleProps } from '@/styles/stylex/props';\n\nimport type { SyntaxMermaidProps } from '../type';\nimport StaticMermaid from './StaticMermaid';\nimport StreamMermaid from './StreamMermaid';\nimport { styles } from './style';\n\nconst SyntaxMermaid = memo<SyntaxMermaidProps>(\n ({\n animated,\n children,\n className,\n fallbackClassName,\n ref,\n style,\n theme: customTheme,\n variant = 'borderless',\n }) => {\n const isDefaultTheme = customTheme === 'lobe-theme' || !customTheme;\n const showBackground = !isDefaultTheme && variant === 'filled';\n const resolvedTheme = isDefaultTheme ? undefined : customTheme;\n\n const classes = clsx(\n !showBackground && 'lobe-mermaid-transparent',\n animated && 'lobe-mermaid-animated',\n );\n const padded = variant !== 'borderless' && styles.padded;\n const mermaidClassName = styleProps(\n [styles.root, padded],\n clsx('ant-mermaid-mermaid lobe-mermaid', classes, className),\n ).className;\n const fallback = styleProps(\n [styles.root, styles.unmermaid, padded],\n clsx(classes, fallbackClassName),\n ).className;\n\n if (animated) {\n return (\n <StreamMermaid\n className={mermaidClassName}\n fallbackClassName={fallback}\n ref={ref}\n style={style}\n theme={resolvedTheme}\n variant={variant}\n >\n {children}\n </StreamMermaid>\n );\n }\n\n return (\n <StaticMermaid\n className={mermaidClassName}\n fallbackClassName={fallback}\n ref={ref}\n style={style}\n theme={resolvedTheme}\n variant={variant}\n >\n {children}\n </StaticMermaid>\n );\n },\n (prevProps, nextProps) =>\n prevProps.children === nextProps.children && prevProps.animated === nextProps.animated,\n);\n\nSyntaxMermaid.displayName = 'SyntaxMermaid';\n\nexport default SyntaxMermaid;\n"],"mappings":";;;;;;;;;AAYA,MAAM,gBAAgB,MACnB,EACC,UACA,UACA,WACA,mBACA,KACA,OACA,OAAO,aACP,UAAU,mBACN;CACJ,MAAM,iBAAiB,gBAAgB,gBAAgB,CAAC;CACxD,MAAM,iBAAiB,CAAC,kBAAkB,YAAY;CACtD,MAAM,gBAAgB,iBAAiB,KAAA,IAAY;CAEnD,MAAM,
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["clsx"],"sources":["../../../src/Mermaid/SyntaxMermaid/index.tsx"],"sourcesContent":["'use client';\n\nimport clsx from 'clsx';\nimport { memo } from 'react';\n\nimport { styleProps } from '@/styles/stylex/props';\n\nimport type { SyntaxMermaidProps } from '../type';\nimport StaticMermaid from './StaticMermaid';\nimport StreamMermaid from './StreamMermaid';\nimport { styles } from './style';\n\nconst SyntaxMermaid = memo<SyntaxMermaidProps>(\n ({\n animated,\n children,\n className,\n fallbackClassName,\n ref,\n style,\n theme: customTheme,\n variant = 'borderless',\n }) => {\n const isDefaultTheme = customTheme === 'lobe-theme' || !customTheme;\n const showBackground = !isDefaultTheme && variant === 'filled';\n const resolvedTheme = isDefaultTheme ? undefined : customTheme;\n\n const classes = clsx(\n !showBackground && 'lobe-mermaid-transparent',\n animated && 'lobe-mermaid-animated',\n );\n const padded = variant !== 'borderless' && styles.padded;\n const mermaidClassName = styleProps(\n [styles.root, padded],\n clsx('ant-mermaid-mermaid lobe-mermaid', classes, className),\n ).className;\n const fallback = styleProps(\n [styles.root, styles.unmermaid, padded],\n clsx(classes, fallbackClassName),\n ).className;\n\n if (animated) {\n return (\n <StreamMermaid\n className={mermaidClassName}\n fallbackClassName={fallback}\n ref={ref}\n style={style}\n theme={resolvedTheme}\n variant={variant}\n >\n {children}\n </StreamMermaid>\n );\n }\n\n return (\n <StaticMermaid\n className={mermaidClassName}\n fallbackClassName={fallback}\n ref={ref}\n style={style}\n theme={resolvedTheme}\n variant={variant}\n >\n {children}\n </StaticMermaid>\n );\n },\n (prevProps, nextProps) =>\n prevProps.children === nextProps.children && prevProps.animated === nextProps.animated,\n);\n\nSyntaxMermaid.displayName = 'SyntaxMermaid';\n\nexport default SyntaxMermaid;\n"],"mappings":";;;;;;;;;AAYA,MAAM,gBAAgB,MACnB,EACC,UACA,UACA,WACA,mBACA,KACA,OACA,OAAO,aACP,UAAU,mBACN;CACJ,MAAM,iBAAiB,gBAAgB,gBAAgB,CAAC;CACxD,MAAM,iBAAiB,CAAC,kBAAkB,YAAY;CACtD,MAAM,gBAAgB,iBAAiB,KAAA,IAAY;CAEnD,MAAM,UAAUA,OACd,CAAC,kBAAkB,4BACnB,YAAY,uBACd;CACA,MAAM,SAAS,YAAY,gBAAgB,OAAO;CAClD,MAAM,mBAAmB,WACvB,CAAC,OAAO,MAAM,MAAM,GACpBA,OAAK,oCAAoC,SAAS,SAAS,CAC7D,CAAC,CAAC;CACF,MAAM,WAAW,WACf;EAAC,OAAO;EAAM,OAAO;EAAW;CAAM,GACtCA,OAAK,SAAS,iBAAiB,CACjC,CAAC,CAAC;CAEF,IAAI,UACF,OACE,oBAAC,eAAD;EACE,WAAW;EACX,mBAAmB;EACd;EACE;EACP,OAAO;EACE;EAER;CACY,CAAA;CAInB,OACE,oBAAC,eAAD;EACE,WAAW;EACX,mBAAmB;EACd;EACE;EACP,OAAO;EACE;EAER;CACY,CAAA;AAEnB,IACC,WAAW,cACV,UAAU,aAAa,UAAU,YAAY,UAAU,aAAa,UAAU,QAClF;AAEA,cAAc,cAAc"}
|
package/es/Modal/atoms.mjs
CHANGED
|
@@ -11,7 +11,7 @@ import { ModalLayerProvider, useModalLayer } from "./ModalLayerContext.mjs";
|
|
|
11
11
|
import { styles } from "./style.mjs";
|
|
12
12
|
import { cloneElement, createContext, createElement, isValidElement, use, useCallback, useEffect, useMemo, 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/Modal/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 ModalOpenContext = createContext(null);
|
|
27
27
|
const ModalActionsContext = createContext(null);
|
|
@@ -100,7 +100,7 @@ const ModalBackdrop = ({ className, style, ...rest }) => {
|
|
|
100
100
|
const layerStyle = layer?.zIndex !== void 0 ? { zIndex: layer.zIndex } : void 0;
|
|
101
101
|
if (open !== null) return /* @__PURE__ */ jsx(Dialog.Backdrop, {
|
|
102
102
|
...rest,
|
|
103
|
-
className: clsx(stylex.props(styles.backdrop).className, className),
|
|
103
|
+
className: clsx$1(stylex.props(styles.backdrop).className, className),
|
|
104
104
|
style: {
|
|
105
105
|
...layerStyle,
|
|
106
106
|
...style,
|
|
@@ -130,7 +130,7 @@ const ModalPopupImpl = ({ className, children, width, style, motionProps, panelC
|
|
|
130
130
|
const composedRef = useMergeRefs([forwardedRef, layer?.popupRef]);
|
|
131
131
|
if (open !== null && actions) return /* @__PURE__ */ jsx(Dialog.Popup, {
|
|
132
132
|
...rest,
|
|
133
|
-
className: clsx(stylex.props(styles.popup, xstyle).className, className),
|
|
133
|
+
className: clsx$1(stylex.props(styles.popup, xstyle).className, className),
|
|
134
134
|
ref: composedRef,
|
|
135
135
|
style: {
|
|
136
136
|
...popupZIndexStyle,
|
|
@@ -147,7 +147,7 @@ const ModalPopupImpl = ({ className, children, width, style, motionProps, panelC
|
|
|
147
147
|
transition: "none",
|
|
148
148
|
...style
|
|
149
149
|
},
|
|
150
|
-
className: clsx(stylex.props(styles.popupInner, panelXstyle).className, panelClassName)
|
|
150
|
+
className: clsx$1(stylex.props(styles.popupInner, panelXstyle).className, panelClassName)
|
|
151
151
|
}, children) : null
|
|
152
152
|
})
|
|
153
153
|
});
|
package/es/Modal/atoms.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"atoms.mjs","names":[],"sources":["../../src/Modal/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 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 { backdropTransition, modalMotionConfig } from './constants';\nimport { ModalLayerProvider, useModalLayer } from './ModalLayerContext';\nimport { styles } from './style';\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\n// --- Animation Contexts (granular to minimize re-renders) ---\n\n// State: open boolean, null = non-animated mode\nconst ModalOpenContext = createContext<boolean | null>(null);\n\n// Actions: stable callbacks, null = non-animated mode\ninterface ModalAnimationActions {\n onExitComplete: () => void;\n}\nconst ModalActionsContext = createContext<ModalAnimationActions | null>(null);\n\nexport const useModalOpen = () => use(ModalOpenContext);\nexport const useModalActions = () => use(ModalActionsContext);\n\n// --- Root ---\nexport type ModalRootProps = Dialog.Root.Props & {\n onExitComplete?: () => void;\n zIndex?: number;\n};\n\nconst AnimatedModalRoot = ({\n open,\n children,\n onExitComplete: onExitCompleteProp,\n zIndex: explicitZIndex,\n ...rest\n}: Omit<ModalRootProps, '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 <ModalOpenContext value={open}>\n <ModalActionsContext value={actions}>\n <ModalLayerProvider value={layer}>\n <Dialog.Root modal open {...rest}>\n {children}\n </Dialog.Root>\n </ModalLayerProvider>\n </ModalActionsContext>\n </ModalOpenContext>\n );\n};\n\nconst NonAnimatedModalRoot = ({ zIndex: explicitZIndex, children, ...rest }: ModalRootProps) => {\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 return (\n <ModalLayerProvider value={layer}>\n <Dialog.Root modal {...rest}>\n {children}\n </Dialog.Root>\n </ModalLayerProvider>\n );\n};\n\nexport const ModalRoot = ({ open, onExitComplete, ...rest }: ModalRootProps) => {\n if (open !== undefined) {\n return <AnimatedModalRoot open={open} onExitComplete={onExitComplete} {...rest} />;\n }\n return <NonAnimatedModalRoot {...rest} />;\n};\n\n// --- Portal ---\nexport type ModalPortalProps = React.ComponentProps<typeof Dialog.Portal> & {\n container?: HTMLElement | null;\n};\nexport const ModalPortal = ({ container, ...rest }: ModalPortalProps) => {\n const appElement = useAppElement();\n return <Dialog.Portal container={container ?? appElement ?? undefined} {...rest} />;\n};\n\n// --- Viewport ---\nexport type ModalViewportProps = React.ComponentProps<typeof Dialog.Viewport>;\nexport const ModalViewport = ({ className, ...rest }: ModalViewportProps) => (\n <Dialog.Viewport\n {...rest}\n className={mergeStateClassName(styles.viewport, className as any) as any}\n />\n);\n\n// --- Backdrop ---\nexport type ModalBackdropProps = React.ComponentProps<typeof Dialog.Backdrop>;\nexport const ModalBackdrop = ({ className, style, ...rest }: ModalBackdropProps) => {\n const open = useModalOpen();\n const layer = useModalLayer();\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={backdropTransition}\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\n// --- Popup ---\nexport type ModalPopupProps = React.ComponentProps<typeof Dialog.Popup> & {\n motionProps?: Record<string, any>;\n panelClassName?: string;\n popupStyle?: React.CSSProperties;\n width?: number | string;\n};\nexport const ModalPopupImpl = ({\n className,\n children,\n width,\n style,\n motionProps,\n panelClassName,\n panelXstyle,\n popupStyle,\n ref: forwardedRef,\n xstyle,\n ...rest\n}: ModalPopupProps & { panelXstyle?: XStyle; xstyle?: XStyle }) => {\n const open = useModalOpen();\n const actions = useModalActions();\n const layer = useModalLayer();\n const Motion = useMotionComponent();\n const popupZIndexStyle = layer?.zIndex !== undefined ? { zIndex: layer.zIndex + 1 } : undefined;\n const composedRef = useMergeRefs([forwardedRef, layer?.popupRef]);\n\n if (open !== null && actions) {\n return (\n <Dialog.Popup\n {...rest}\n className={clsx(stylex.props(styles.popup, xstyle).className, className as string)}\n ref={composedRef as any}\n style={{ ...popupZIndexStyle, ...popupStyle }}\n >\n <AnimatePresence onExitComplete={actions.onExitComplete}>\n {open ? (\n <Motion.div\n {...modalMotionConfig}\n {...motionProps}\n key=\"modal-popup-panel\"\n style={{ maxWidth: width ?? undefined, transition: 'none', ...style }}\n className={clsx(\n stylex.props(styles.popupInner, panelXstyle).className,\n panelClassName,\n )}\n >\n {children}\n </Motion.div>\n ) : null}\n </AnimatePresence>\n </Dialog.Popup>\n );\n }\n\n return (\n <Dialog.Popup\n {...rest}\n className={mergeStateClassName([styles.popup, xstyle], className as any) as any}\n ref={composedRef as any}\n style={{ ...popupZIndexStyle, ...popupStyle }}\n >\n <div\n {...styleProps([styles.popupInner, panelXstyle], panelClassName, {\n maxWidth: width ?? undefined,\n ...style,\n })}\n >\n {children}\n </div>\n </Dialog.Popup>\n );\n};\n\nexport const ModalPopup: React.FC<ModalPopupProps> = ModalPopupImpl;\n\n// --- Header ---\nexport type ModalHeaderProps = React.HTMLAttributes<HTMLDivElement> & {\n ref?: React.Ref<HTMLDivElement>;\n};\nexport const ModalHeaderImpl = ({\n className,\n style,\n xstyle,\n ...rest\n}: ModalHeaderProps & { xstyle?: XStyle }) => (\n <div {...rest} {...styleProps([styles.header, xstyle], className, style)} />\n);\nexport const ModalHeader: React.FC<ModalHeaderProps> = ModalHeaderImpl;\n\n// --- Title ---\nexport type ModalTitleProps = React.ComponentProps<typeof Dialog.Title>;\nexport const ModalTitleImpl = ({\n className,\n xstyle,\n ...rest\n}: ModalTitleProps & { xstyle?: XStyle }) => (\n <Dialog.Title\n {...rest}\n className={mergeStateClassName([styles.title, xstyle], className as any) as any}\n />\n);\nexport const ModalTitle: React.FC<ModalTitleProps> = ModalTitleImpl;\n\n// --- Description ---\nexport type ModalDescriptionProps = React.ComponentProps<typeof Dialog.Description>;\nexport const ModalDescription: React.FC<ModalDescriptionProps> = Dialog.Description;\n\n// --- Content ---\nexport type ModalContentProps = React.HTMLAttributes<HTMLDivElement> & {\n ref?: React.Ref<HTMLDivElement>;\n};\nexport const ModalContentImpl = ({\n className,\n style,\n xstyle,\n ...rest\n}: ModalContentProps & { xstyle?: XStyle }) => (\n <div {...rest} {...styleProps([styles.content, xstyle], className, style)} />\n);\nexport const ModalContent: React.FC<ModalContentProps> = ModalContentImpl;\n\n// --- Footer ---\nexport type ModalFooterProps = React.HTMLAttributes<HTMLDivElement> & {\n ref?: React.Ref<HTMLDivElement>;\n};\nexport const ModalFooterImpl = ({\n className,\n style,\n xstyle,\n ...rest\n}: ModalFooterProps & { xstyle?: XStyle }) => (\n <div {...rest} {...styleProps([styles.footer, xstyle], className, style)} />\n);\nexport const ModalFooter: React.FC<ModalFooterProps> = ModalFooterImpl;\n\n// --- Close ---\nexport type ModalCloseProps = React.ComponentProps<typeof Dialog.Close>;\nexport const ModalCloseImpl = ({\n className,\n children,\n xstyle,\n ...rest\n}: ModalCloseProps & { xstyle?: XStyle }) => (\n <Dialog.Close\n {...rest}\n className={\n mergeStateClassName(\n [styles.closeInline, styles.close, focusRing.info, xstyle],\n className as any,\n ) as any\n }\n >\n {children ?? <X size={16} />}\n </Dialog.Close>\n);\nexport const ModalClose: React.FC<ModalCloseProps> = ModalCloseImpl;\n\n// --- Trigger ---\nexport type ModalTriggerProps = Omit<\n React.ComponentPropsWithRef<typeof Dialog.Trigger>,\n 'children' | 'render'\n> & {\n children?: React.ReactNode;\n nativeButton?: boolean;\n};\n\nexport const ModalTrigger = ({\n children,\n className,\n nativeButton,\n ref: refProp,\n ...rest\n}: ModalTriggerProps) => {\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":";;;;;;;;;;;;;;;;;;;;AAqBA,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;AAKA,MAAM,mBAAmB,cAA8B,IAAI;AAM3D,MAAM,sBAAsB,cAA4C,IAAI;AAC5E,MAAa,qBAAqB,IAAI,gBAAgB;AACtD,MAAa,wBAAwB,IAAI,mBAAmB;AAO5D,MAAM,qBAAqB,EACzB,MACA,UACA,gBAAgB,oBAChB,QAAQ,gBACR,GAAG,WAGC;CACJ,MAAM,CAAC,WAAW,gBAAgB,SAAS,CAAC,CAAC,IAAI;CACjD,gBAAgB;EACd,IAAI,MAAM,aAAa,IAAI;CAC7B,GAAG,CAAC,IAAI,CAAC;CACT,MAAM,qBAAqB,kBAAkB;EAC3C,aAAa,KAAK;EAClB,qBAAqB;CACvB,GAAG,CAAC,kBAAkB,CAAC;CACvB,MAAM,UAAU,eAAe,EAC7B,gBAAgB,mBAClB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AI;CAAM,GAAI,WAAW,CAAC,OAAO,QAAQ,MAAM,GAAG,WAAW,KAAK;AAAI,CAAA;AACjF,MAAa,cAA0C;AAIvD,MAAa,kBAAkB,EAC7B,WACA,UACA,QACA,GAAG,WAGC,oBAAC,OAAO,OAAR;CAAc,GAAI;CAAM,WAAW,oBAAoB;EAAC,OAAO;EAAa,OAAO;EAAO,UAAU;EAAM;CAAM,GAAG,SAAgB;CACpI,UAAA,YAAY,oBAAC,GAAD,EAAG,MAAM,GAAK,CAAA;AACf,CAAA;AAChB,MAAa,aAAwC;AAOrD,MAAa,gBAAgB,EAC3B,UACA,WACA,cACA,KAAK,SACL,GAAG,WACoB;CACvB,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/Modal/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 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 { backdropTransition, modalMotionConfig } from './constants';\nimport { ModalLayerProvider, useModalLayer } from './ModalLayerContext';\nimport { styles } from './style';\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\n// --- Animation Contexts (granular to minimize re-renders) ---\n\n// State: open boolean, null = non-animated mode\nconst ModalOpenContext = createContext<boolean | null>(null);\n\n// Actions: stable callbacks, null = non-animated mode\ninterface ModalAnimationActions {\n onExitComplete: () => void;\n}\nconst ModalActionsContext = createContext<ModalAnimationActions | null>(null);\n\nexport const useModalOpen = () => use(ModalOpenContext);\nexport const useModalActions = () => use(ModalActionsContext);\n\n// --- Root ---\nexport type ModalRootProps = Dialog.Root.Props & {\n onExitComplete?: () => void;\n zIndex?: number;\n};\n\nconst AnimatedModalRoot = ({\n open,\n children,\n onExitComplete: onExitCompleteProp,\n zIndex: explicitZIndex,\n ...rest\n}: Omit<ModalRootProps, '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 <ModalOpenContext value={open}>\n <ModalActionsContext value={actions}>\n <ModalLayerProvider value={layer}>\n <Dialog.Root modal open {...rest}>\n {children}\n </Dialog.Root>\n </ModalLayerProvider>\n </ModalActionsContext>\n </ModalOpenContext>\n );\n};\n\nconst NonAnimatedModalRoot = ({ zIndex: explicitZIndex, children, ...rest }: ModalRootProps) => {\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 return (\n <ModalLayerProvider value={layer}>\n <Dialog.Root modal {...rest}>\n {children}\n </Dialog.Root>\n </ModalLayerProvider>\n );\n};\n\nexport const ModalRoot = ({ open, onExitComplete, ...rest }: ModalRootProps) => {\n if (open !== undefined) {\n return <AnimatedModalRoot open={open} onExitComplete={onExitComplete} {...rest} />;\n }\n return <NonAnimatedModalRoot {...rest} />;\n};\n\n// --- Portal ---\nexport type ModalPortalProps = React.ComponentProps<typeof Dialog.Portal> & {\n container?: HTMLElement | null;\n};\nexport const ModalPortal = ({ container, ...rest }: ModalPortalProps) => {\n const appElement = useAppElement();\n return <Dialog.Portal container={container ?? appElement ?? undefined} {...rest} />;\n};\n\n// --- Viewport ---\nexport type ModalViewportProps = React.ComponentProps<typeof Dialog.Viewport>;\nexport const ModalViewport = ({ className, ...rest }: ModalViewportProps) => (\n <Dialog.Viewport\n {...rest}\n className={mergeStateClassName(styles.viewport, className as any) as any}\n />\n);\n\n// --- Backdrop ---\nexport type ModalBackdropProps = React.ComponentProps<typeof Dialog.Backdrop>;\nexport const ModalBackdrop = ({ className, style, ...rest }: ModalBackdropProps) => {\n const open = useModalOpen();\n const layer = useModalLayer();\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={backdropTransition}\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\n// --- Popup ---\nexport type ModalPopupProps = React.ComponentProps<typeof Dialog.Popup> & {\n motionProps?: Record<string, any>;\n panelClassName?: string;\n popupStyle?: React.CSSProperties;\n width?: number | string;\n};\nexport const ModalPopupImpl = ({\n className,\n children,\n width,\n style,\n motionProps,\n panelClassName,\n panelXstyle,\n popupStyle,\n ref: forwardedRef,\n xstyle,\n ...rest\n}: ModalPopupProps & { panelXstyle?: XStyle; xstyle?: XStyle }) => {\n const open = useModalOpen();\n const actions = useModalActions();\n const layer = useModalLayer();\n const Motion = useMotionComponent();\n const popupZIndexStyle = layer?.zIndex !== undefined ? { zIndex: layer.zIndex + 1 } : undefined;\n const composedRef = useMergeRefs([forwardedRef, layer?.popupRef]);\n\n if (open !== null && actions) {\n return (\n <Dialog.Popup\n {...rest}\n className={clsx(stylex.props(styles.popup, xstyle).className, className as string)}\n ref={composedRef as any}\n style={{ ...popupZIndexStyle, ...popupStyle }}\n >\n <AnimatePresence onExitComplete={actions.onExitComplete}>\n {open ? (\n <Motion.div\n {...modalMotionConfig}\n {...motionProps}\n key=\"modal-popup-panel\"\n style={{ maxWidth: width ?? undefined, transition: 'none', ...style }}\n className={clsx(\n stylex.props(styles.popupInner, panelXstyle).className,\n panelClassName,\n )}\n >\n {children}\n </Motion.div>\n ) : null}\n </AnimatePresence>\n </Dialog.Popup>\n );\n }\n\n return (\n <Dialog.Popup\n {...rest}\n className={mergeStateClassName([styles.popup, xstyle], className as any) as any}\n ref={composedRef as any}\n style={{ ...popupZIndexStyle, ...popupStyle }}\n >\n <div\n {...styleProps([styles.popupInner, panelXstyle], panelClassName, {\n maxWidth: width ?? undefined,\n ...style,\n })}\n >\n {children}\n </div>\n </Dialog.Popup>\n );\n};\n\nexport const ModalPopup: React.FC<ModalPopupProps> = ModalPopupImpl;\n\n// --- Header ---\nexport type ModalHeaderProps = React.HTMLAttributes<HTMLDivElement> & {\n ref?: React.Ref<HTMLDivElement>;\n};\nexport const ModalHeaderImpl = ({\n className,\n style,\n xstyle,\n ...rest\n}: ModalHeaderProps & { xstyle?: XStyle }) => (\n <div {...rest} {...styleProps([styles.header, xstyle], className, style)} />\n);\nexport const ModalHeader: React.FC<ModalHeaderProps> = ModalHeaderImpl;\n\n// --- Title ---\nexport type ModalTitleProps = React.ComponentProps<typeof Dialog.Title>;\nexport const ModalTitleImpl = ({\n className,\n xstyle,\n ...rest\n}: ModalTitleProps & { xstyle?: XStyle }) => (\n <Dialog.Title\n {...rest}\n className={mergeStateClassName([styles.title, xstyle], className as any) as any}\n />\n);\nexport const ModalTitle: React.FC<ModalTitleProps> = ModalTitleImpl;\n\n// --- Description ---\nexport type ModalDescriptionProps = React.ComponentProps<typeof Dialog.Description>;\nexport const ModalDescription: React.FC<ModalDescriptionProps> = Dialog.Description;\n\n// --- Content ---\nexport type ModalContentProps = React.HTMLAttributes<HTMLDivElement> & {\n ref?: React.Ref<HTMLDivElement>;\n};\nexport const ModalContentImpl = ({\n className,\n style,\n xstyle,\n ...rest\n}: ModalContentProps & { xstyle?: XStyle }) => (\n <div {...rest} {...styleProps([styles.content, xstyle], className, style)} />\n);\nexport const ModalContent: React.FC<ModalContentProps> = ModalContentImpl;\n\n// --- Footer ---\nexport type ModalFooterProps = React.HTMLAttributes<HTMLDivElement> & {\n ref?: React.Ref<HTMLDivElement>;\n};\nexport const ModalFooterImpl = ({\n className,\n style,\n xstyle,\n ...rest\n}: ModalFooterProps & { xstyle?: XStyle }) => (\n <div {...rest} {...styleProps([styles.footer, xstyle], className, style)} />\n);\nexport const ModalFooter: React.FC<ModalFooterProps> = ModalFooterImpl;\n\n// --- Close ---\nexport type ModalCloseProps = React.ComponentProps<typeof Dialog.Close>;\nexport const ModalCloseImpl = ({\n className,\n children,\n xstyle,\n ...rest\n}: ModalCloseProps & { xstyle?: XStyle }) => (\n <Dialog.Close\n {...rest}\n className={\n mergeStateClassName(\n [styles.closeInline, styles.close, focusRing.info, xstyle],\n className as any,\n ) as any\n }\n >\n {children ?? <X size={16} />}\n </Dialog.Close>\n);\nexport const ModalClose: React.FC<ModalCloseProps> = ModalCloseImpl;\n\n// --- Trigger ---\nexport type ModalTriggerProps = Omit<\n React.ComponentPropsWithRef<typeof Dialog.Trigger>,\n 'children' | 'render'\n> & {\n children?: React.ReactNode;\n nativeButton?: boolean;\n};\n\nexport const ModalTrigger = ({\n children,\n className,\n nativeButton,\n ref: refProp,\n ...rest\n}: ModalTriggerProps) => {\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":";;;;;;;;;;;;;;;;;;;;AAqBA,MAAM,uBAAgC,QAAgB,cAA4E;CAChI,MAAM,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