dishui 0.0.65 → 0.0.67
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/dist/_virtual/_rolldown/runtime.js +10 -11
- package/dist/chart.js +12 -46
- package/dist/code-editor.js +16 -43
- package/dist/components/Accordion/index.d.ts +39 -0
- package/dist/components/Accordion/index.js +70 -0
- package/dist/components/Accordion/index.js.map +1 -0
- package/dist/components/Avatar/index.d.ts +48 -0
- package/dist/components/Avatar/index.js +71 -0
- package/dist/components/Avatar/index.js.map +1 -0
- package/dist/components/Badge/index.js +10 -15
- package/dist/components/Badge/index.js.map +1 -1
- package/dist/components/Button/index.js +62 -89
- package/dist/components/Button/index.js.map +1 -1
- package/dist/components/Card/index.d.ts +142 -0
- package/dist/components/Card/index.js +368 -69
- package/dist/components/Card/index.js.map +1 -1
- package/dist/components/Chart/Chart.js +25 -25
- package/dist/components/Chart/Chart.js.map +1 -1
- package/dist/components/Checkbox/index.js +57 -65
- package/dist/components/Checkbox/index.js.map +1 -1
- package/dist/components/ChoicePicker/index.d.ts +44 -0
- package/dist/components/ChoicePicker/index.js +81 -0
- package/dist/components/ChoicePicker/index.js.map +1 -0
- package/dist/components/Column/index.d.ts +28 -0
- package/dist/components/Column/index.js +30 -0
- package/dist/components/Column/index.js.map +1 -0
- package/dist/components/DateTimeInput/index.d.ts +44 -0
- package/dist/components/DateTimeInput/index.js +48 -0
- package/dist/components/DateTimeInput/index.js.map +1 -0
- package/dist/components/Demo/index.js +107 -107
- package/dist/components/Demo/index.js.map +1 -1
- package/dist/components/Divider/index.d.ts +20 -0
- package/dist/components/Divider/index.js +30 -0
- package/dist/components/Divider/index.js.map +1 -0
- package/dist/components/EmptyState/index.js +24 -24
- package/dist/components/EmptyState/index.js.map +1 -1
- package/dist/components/FileUploader/DropZone.js +134 -136
- package/dist/components/FileUploader/DropZone.js.map +1 -1
- package/dist/components/FileUploader/FileItem.js +159 -163
- package/dist/components/FileUploader/FileItem.js.map +1 -1
- package/dist/components/FileUploader/FileUploader.js +126 -127
- package/dist/components/FileUploader/FileUploader.js.map +1 -1
- package/dist/components/FileUploader/UploadQueue.js +62 -62
- package/dist/components/FileUploader/UploadQueue.js.map +1 -1
- package/dist/components/FloatWindow/index.d.ts +28 -0
- package/dist/components/GridLayout/index.d.ts +42 -0
- package/dist/components/Icon/index.d.ts +26 -0
- package/dist/components/Icon/index.js +27 -0
- package/dist/components/Icon/index.js.map +1 -0
- package/dist/components/Image/index.d.ts +33 -0
- package/dist/components/Image/index.js +44 -0
- package/dist/components/Image/index.js.map +1 -0
- package/dist/components/Input/index.js +196 -197
- package/dist/components/Input/index.js.map +1 -1
- package/dist/components/Label/index.js +62 -74
- package/dist/components/Label/index.js.map +1 -1
- package/dist/components/Layout/index.js +134 -139
- package/dist/components/Layout/index.js.map +1 -1
- package/dist/components/List/index.js +45 -58
- package/dist/components/List/index.js.map +1 -1
- package/dist/components/Markdown/Markdown.js +106 -107
- package/dist/components/Markdown/Markdown.js.map +1 -1
- package/dist/components/Markdown/codeThemes.js +24 -33
- package/dist/components/Markdown/codeThemes.js.map +1 -1
- package/dist/components/Markdown/markdownComponents.js +203 -208
- package/dist/components/Markdown/markdownComponents.js.map +1 -1
- package/dist/components/Markdown/parseCodeBlockMeta.js +22 -22
- package/dist/components/Markdown/parseCodeBlockMeta.js.map +1 -1
- package/dist/components/Markdown/useMarkdownSource.js +46 -46
- package/dist/components/Markdown/useMarkdownSource.js.map +1 -1
- package/dist/components/Markdown/useMarkmapRenderer.js +35 -36
- package/dist/components/Markdown/useMarkmapRenderer.js.map +1 -1
- package/dist/components/Markdown/useMermaidRenderer.js +41 -42
- package/dist/components/Markdown/useMermaidRenderer.js.map +1 -1
- package/dist/components/Modal/index.js +82 -82
- package/dist/components/Modal/index.js.map +1 -1
- package/dist/components/MultipleChoice/index.d.ts +44 -0
- package/dist/components/MultipleChoice/index.js +52 -0
- package/dist/components/MultipleChoice/index.js.map +1 -0
- package/dist/components/Notification/index.d.ts +17 -0
- package/dist/components/Page/index.d.ts +1 -1
- package/dist/components/Page/index.js +40 -71
- package/dist/components/Page/index.js.map +1 -1
- package/dist/components/PageHeader/index.js +28 -28
- package/dist/components/PageHeader/index.js.map +1 -1
- package/dist/components/ProtectedRoute/index.js +8 -9
- package/dist/components/ProtectedRoute/index.js.map +1 -1
- package/dist/components/Row/index.d.ts +28 -0
- package/dist/components/Row/index.js +30 -0
- package/dist/components/Row/index.js.map +1 -0
- package/dist/components/Select/index.js +251 -254
- package/dist/components/Select/index.js.map +1 -1
- package/dist/components/SidebarToggleButton/index.js +56 -59
- package/dist/components/SidebarToggleButton/index.js.map +1 -1
- package/dist/components/Slider/index.d.ts +39 -0
- package/dist/components/Slider/index.js +52 -0
- package/dist/components/Slider/index.js.map +1 -0
- package/dist/components/Switch/index.d.ts +34 -0
- package/dist/components/Switch/index.js +55 -0
- package/dist/components/Switch/index.js.map +1 -0
- package/dist/components/Tab/index.d.ts +40 -0
- package/dist/components/Table/index.js +109 -121
- package/dist/components/Table/index.js.map +1 -1
- package/dist/components/Tabs/index.js +28 -38
- package/dist/components/Tabs/index.js.map +1 -1
- package/dist/components/Text/index.d.ts +43 -0
- package/dist/components/Text/index.js +55 -0
- package/dist/components/Text/index.js.map +1 -0
- package/dist/components/Tooltip/index.d.ts +23 -0
- package/dist/components/Tooltip/index.js +34 -0
- package/dist/components/Tooltip/index.js.map +1 -0
- package/dist/components/Tree/Tree.js +205 -205
- package/dist/components/Tree/Tree.js.map +1 -1
- package/dist/components/pro/ArticleContextMenu/index.js +86 -87
- package/dist/components/pro/ArticleContextMenu/index.js.map +1 -1
- package/dist/components/pro/ArticleControl/ArticleControl2.js +250 -250
- package/dist/components/pro/ArticleControl/ArticleControl2.js.map +1 -1
- package/dist/components/pro/ArticleControl/buildHeadingTree.js +31 -32
- package/dist/components/pro/ArticleControl/buildHeadingTree.js.map +1 -1
- package/dist/components/pro/ArticleControl/useArticleToc.js +100 -102
- package/dist/components/pro/ArticleControl/useArticleToc.js.map +1 -1
- package/dist/components/pro/Calendar/Calendar.d.ts +10 -0
- package/dist/components/pro/Calendar/hooks/useCalendarDrag.d.ts +47 -0
- package/dist/components/pro/Calendar/hooks/useCalendarState.d.ts +56 -0
- package/dist/components/pro/Calendar/index.d.ts +7 -0
- package/dist/components/pro/Calendar/types.d.ts +151 -0
- package/dist/components/pro/Calendar/utils.d.ts +94 -0
- package/dist/components/pro/Chat/Chat.d.ts +6 -0
- package/dist/components/pro/Chat/index.d.ts +2 -0
- package/dist/components/pro/Chat/types.d.ts +84 -0
- package/dist/components/pro/CodeEditor/editors/CodeEditor.js +287 -327
- package/dist/components/pro/CodeEditor/editors/CodeEditor.js.map +1 -1
- package/dist/components/pro/CodeEditor/editors/MarkdownEditor.js +167 -224
- package/dist/components/pro/CodeEditor/editors/MarkdownEditor.js.map +1 -1
- package/dist/components/pro/CodeEditor/editors/markdownExtensions.js +594 -613
- package/dist/components/pro/CodeEditor/editors/markdownExtensions.js.map +1 -1
- package/dist/components/pro/CodeEditor/extensions/contextMenu.js +54 -55
- package/dist/components/pro/CodeEditor/extensions/contextMenu.js.map +1 -1
- package/dist/components/pro/CodeEditor/extensions/index.js +152 -160
- package/dist/components/pro/CodeEditor/extensions/index.js.map +1 -1
- package/dist/components/pro/CodeEditor/langs/index.js +7 -15
- package/dist/components/pro/CodeEditor/langs/index.js.map +1 -1
- package/dist/components/pro/CodeEditor/langs/javascript.js +11 -48
- package/dist/components/pro/CodeEditor/langs/javascript.js.map +1 -1
- package/dist/components/pro/CodeEditor/langs/python.js +4 -40
- package/dist/components/pro/CodeEditor/langs/python.js.map +1 -1
- package/dist/components/pro/CodeEditor/langs/snippets.js +118 -147
- package/dist/components/pro/CodeEditor/langs/snippets.js.map +1 -1
- package/dist/components/pro/CodeEditor/panels/FootnotePanel.js +153 -153
- package/dist/components/pro/CodeEditor/panels/FootnotePanel.js.map +1 -1
- package/dist/components/pro/CodeEditor/panels/HistoryPanel.js +180 -190
- package/dist/components/pro/CodeEditor/panels/HistoryPanel.js.map +1 -1
- package/dist/components/pro/CodeEditor/panels/OutlinePanel.js +130 -137
- package/dist/components/pro/CodeEditor/panels/OutlinePanel.js.map +1 -1
- package/dist/components/pro/CodeEditor/panels/TableOfContentsPanel.js +228 -242
- package/dist/components/pro/CodeEditor/panels/TableOfContentsPanel.js.map +1 -1
- package/dist/components/pro/CodeEditor/panels/VariablePanel.js +208 -248
- package/dist/components/pro/CodeEditor/panels/VariablePanel.js.map +1 -1
- package/dist/components/pro/CodeEditor/themes.js +513 -483
- package/dist/components/pro/CodeEditor/themes.js.map +1 -1
- package/dist/components/pro/CodeEditor/types.d.ts +1 -1
- package/dist/components/pro/CodeEditor/utils.js +171 -175
- package/dist/components/pro/CodeEditor/utils.js.map +1 -1
- package/dist/components/pro/DataTable/DataTable.js +305 -306
- package/dist/components/pro/DataTable/DataTable.js.map +1 -1
- package/dist/components/pro/DataTable/Filters.js +299 -314
- package/dist/components/pro/DataTable/Filters.js.map +1 -1
- package/dist/components/pro/DataTable/PivotPanel.js +203 -204
- package/dist/components/pro/DataTable/PivotPanel.js.map +1 -1
- package/dist/components/pro/DataTable/PivotView.js +142 -144
- package/dist/components/pro/DataTable/PivotView.js.map +1 -1
- package/dist/components/pro/DataTable/components/BulkActions.js +42 -42
- package/dist/components/pro/DataTable/components/BulkActions.js.map +1 -1
- package/dist/components/pro/DataTable/components/ColumnSelector.js +84 -84
- package/dist/components/pro/DataTable/components/ColumnSelector.js.map +1 -1
- package/dist/components/pro/DataTable/components/FilterBar.js +58 -58
- package/dist/components/pro/DataTable/components/FilterBar.js.map +1 -1
- package/dist/components/pro/DataTable/components/TableBody.js +93 -94
- package/dist/components/pro/DataTable/components/TableBody.js.map +1 -1
- package/dist/components/pro/DataTable/components/TableHeader.js +78 -78
- package/dist/components/pro/DataTable/components/TableHeader.js.map +1 -1
- package/dist/components/pro/DataTable/components/TablePagination.js +77 -77
- package/dist/components/pro/DataTable/components/TablePagination.js.map +1 -1
- package/dist/components/pro/DataTable/components/TableToolbar.js +40 -40
- package/dist/components/pro/DataTable/components/TableToolbar.js.map +1 -1
- package/dist/components/pro/DataTable/extension.js +5 -5
- package/dist/components/pro/DataTable/extension.js.map +1 -1
- package/dist/components/pro/DataTable/pivotEngine.js +84 -92
- package/dist/components/pro/DataTable/pivotEngine.js.map +1 -1
- package/dist/components/pro/DataTable/pivotExtension.js +93 -93
- package/dist/components/pro/DataTable/pivotExtension.js.map +1 -1
- package/dist/components/pro/DataTable/rowDetailExtension.js +30 -30
- package/dist/components/pro/DataTable/rowDetailExtension.js.map +1 -1
- package/dist/components/pro/DataTable/tanstack-table.js +45 -62
- package/dist/components/pro/DataTable/tanstack-table.js.map +1 -1
- package/dist/components/pro/DataTable/treeDataUtils.js +37 -48
- package/dist/components/pro/DataTable/treeDataUtils.js.map +1 -1
- package/dist/components/pro/DataTable/useColumnDragReorder.js +68 -68
- package/dist/components/pro/DataTable/useColumnDragReorder.js.map +1 -1
- package/dist/components/pro/DataTable/utils.js +156 -168
- package/dist/components/pro/DataTable/utils.js.map +1 -1
- package/dist/components/pro/FileExplorer/Breadcrumb.js +180 -180
- package/dist/components/pro/FileExplorer/Breadcrumb.js.map +1 -1
- package/dist/components/pro/FileExplorer/CreateDialog.js +78 -78
- package/dist/components/pro/FileExplorer/CreateDialog.js.map +1 -1
- package/dist/components/pro/FileExplorer/FileExplorer.js +202 -205
- package/dist/components/pro/FileExplorer/FileExplorer.js.map +1 -1
- package/dist/components/pro/FileExplorer/FileIcon.js +189 -189
- package/dist/components/pro/FileExplorer/FileIcon.js.map +1 -1
- package/dist/components/pro/FileExplorer/GridView.js +100 -100
- package/dist/components/pro/FileExplorer/GridView.js.map +1 -1
- package/dist/components/pro/FileExplorer/ListView.js +209 -209
- package/dist/components/pro/FileExplorer/ListView.js.map +1 -1
- package/dist/components/pro/FileExplorer/Toolbar.js +199 -199
- package/dist/components/pro/FileExplorer/Toolbar.js.map +1 -1
- package/dist/components/pro/Flow/Flow.js +920 -948
- package/dist/components/pro/Flow/Flow.js.map +1 -1
- package/dist/components/pro/Flow/FlowCanvas.js +1626 -1662
- package/dist/components/pro/Flow/FlowCanvas.js.map +1 -1
- package/dist/components/pro/Flow/archify/build.js +85 -94
- package/dist/components/pro/Flow/archify/build.js.map +1 -1
- package/dist/components/pro/Flow/archify/convert.js +512 -519
- package/dist/components/pro/Flow/archify/convert.js.map +1 -1
- package/dist/components/pro/Flow/archify/palette.js +87 -104
- package/dist/components/pro/Flow/archify/palette.js.map +1 -1
- package/dist/components/pro/Flow/archify/presets.js +34 -37
- package/dist/components/pro/Flow/archify/presets.js.map +1 -1
- package/dist/components/pro/Flow/archify/spec.js +7 -7
- package/dist/components/pro/Flow/archify/spec.js.map +1 -1
- package/dist/components/pro/Flow/canvas/AlignmentGuides.js +25 -25
- package/dist/components/pro/Flow/canvas/AlignmentGuides.js.map +1 -1
- package/dist/components/pro/Flow/canvas/GridRenderer.js +54 -55
- package/dist/components/pro/Flow/canvas/GridRenderer.js.map +1 -1
- package/dist/components/pro/Flow/canvas/MiniMapRenderer.js +54 -58
- package/dist/components/pro/Flow/canvas/MiniMapRenderer.js.map +1 -1
- package/dist/components/pro/Flow/canvas/PixiApp.js +105 -102
- package/dist/components/pro/Flow/canvas/PixiApp.js.map +1 -1
- package/dist/components/pro/Flow/canvas/SelectionOverlay.js +38 -38
- package/dist/components/pro/Flow/canvas/SelectionOverlay.js.map +1 -1
- package/dist/components/pro/Flow/canvas/ViewportContainer.js +117 -117
- package/dist/components/pro/Flow/canvas/ViewportContainer.js.map +1 -1
- package/dist/components/pro/Flow/constants.js +266 -278
- package/dist/components/pro/Flow/constants.js.map +1 -1
- package/dist/components/pro/Flow/context/FlowAIContext.js +27 -28
- package/dist/components/pro/Flow/context/FlowAIContext.js.map +1 -1
- package/dist/components/pro/Flow/context/FlowContext.js +60 -61
- package/dist/components/pro/Flow/context/FlowContext.js.map +1 -1
- package/dist/components/pro/Flow/context/FlowUIContext.js +115 -117
- package/dist/components/pro/Flow/context/FlowUIContext.js.map +1 -1
- package/dist/components/pro/Flow/edges/EdgeRenderer.js +135 -138
- package/dist/components/pro/Flow/edges/EdgeRenderer.js.map +1 -1
- package/dist/components/pro/Flow/edges/edgeMarkers.js +11 -14
- package/dist/components/pro/Flow/edges/edgeMarkers.js.map +1 -1
- package/dist/components/pro/Flow/edges/edgePaths.js +351 -367
- package/dist/components/pro/Flow/edges/edgePaths.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useAlignmentGuides.js +49 -52
- package/dist/components/pro/Flow/hooks/useAlignmentGuides.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useClipboard.js +154 -154
- package/dist/components/pro/Flow/hooks/useClipboard.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useCompactMode.js +17 -17
- package/dist/components/pro/Flow/hooks/useCompactMode.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useDeleteSelection.js +40 -40
- package/dist/components/pro/Flow/hooks/useDeleteSelection.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useDraggablePanel.js +51 -51
- package/dist/components/pro/Flow/hooks/useDraggablePanel.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useEdgeMutations.js +157 -157
- package/dist/components/pro/Flow/hooks/useEdgeMutations.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useFlowImportExport.js +190 -201
- package/dist/components/pro/Flow/hooks/useFlowImportExport.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useKeyboardShortcuts.js +32 -38
- package/dist/components/pro/Flow/hooks/useKeyboardShortcuts.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useLayoutActions.js +172 -180
- package/dist/components/pro/Flow/hooks/useLayoutActions.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useLineMutations.js +57 -57
- package/dist/components/pro/Flow/hooks/useLineMutations.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useMindMap.js +229 -238
- package/dist/components/pro/Flow/hooks/useMindMap.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useNodeMutations.js +102 -102
- package/dist/components/pro/Flow/hooks/useNodeMutations.js.map +1 -1
- package/dist/components/pro/Flow/hooks/usePdfExport.js +55 -56
- package/dist/components/pro/Flow/hooks/usePdfExport.js.map +1 -1
- package/dist/components/pro/Flow/hooks/usePixiApp.js +55 -57
- package/dist/components/pro/Flow/hooks/usePixiApp.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useResizablePanel.js +31 -31
- package/dist/components/pro/Flow/hooks/useResizablePanel.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useSelection.js +69 -69
- package/dist/components/pro/Flow/hooks/useSelection.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useUndoRedo.js +27 -27
- package/dist/components/pro/Flow/hooks/useUndoRedo.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useViewport.js +28 -28
- package/dist/components/pro/Flow/hooks/useViewport.js.map +1 -1
- package/dist/components/pro/Flow/lines/FreehandTool.js +63 -63
- package/dist/components/pro/Flow/lines/FreehandTool.js.map +1 -1
- package/dist/components/pro/Flow/lines/GeometricLineTool.js +80 -80
- package/dist/components/pro/Flow/lines/GeometricLineTool.js.map +1 -1
- package/dist/components/pro/Flow/lines/LineRenderer.js +88 -88
- package/dist/components/pro/Flow/lines/LineRenderer.js.map +1 -1
- package/dist/components/pro/Flow/lines/lineSmoothing.js +32 -34
- package/dist/components/pro/Flow/lines/lineSmoothing.js.map +1 -1
- package/dist/components/pro/Flow/nodes/DataNodeView.js +236 -242
- package/dist/components/pro/Flow/nodes/DataNodeView.js.map +1 -1
- package/dist/components/pro/Flow/nodes/MediaContent.js +236 -246
- package/dist/components/pro/Flow/nodes/MediaContent.js.map +1 -1
- package/dist/components/pro/Flow/nodes/MediaOverlay.js +63 -63
- package/dist/components/pro/Flow/nodes/MediaOverlay.js.map +1 -1
- package/dist/components/pro/Flow/nodes/Model3DView.js +111 -113
- package/dist/components/pro/Flow/nodes/Model3DView.js.map +1 -1
- package/dist/components/pro/Flow/nodes/NodeHandles.js +74 -80
- package/dist/components/pro/Flow/nodes/NodeHandles.js.map +1 -1
- package/dist/components/pro/Flow/nodes/NodeRenderer.js +303 -314
- package/dist/components/pro/Flow/nodes/NodeRenderer.js.map +1 -1
- package/dist/components/pro/Flow/nodes/NodeText.js +25 -29
- package/dist/components/pro/Flow/nodes/NodeText.js.map +1 -1
- package/dist/components/pro/Flow/nodes/aiClient.js +124 -137
- package/dist/components/pro/Flow/nodes/aiClient.js.map +1 -1
- package/dist/components/pro/Flow/nodes/animAnchors.js +42 -49
- package/dist/components/pro/Flow/nodes/animAnchors.js.map +1 -1
- package/dist/components/pro/Flow/nodes/dataUtils.js +246 -267
- package/dist/components/pro/Flow/nodes/dataUtils.js.map +1 -1
- package/dist/components/pro/Flow/nodes/nodeUtils.js +23 -28
- package/dist/components/pro/Flow/nodes/nodeUtils.js.map +1 -1
- package/dist/components/pro/Flow/nodes/shapes.js +556 -589
- package/dist/components/pro/Flow/nodes/shapes.js.map +1 -1
- package/dist/components/pro/Flow/nodes/svgIconTexture.js +37 -39
- package/dist/components/pro/Flow/nodes/svgIconTexture.js.map +1 -1
- package/dist/components/pro/Flow/nodes/svgIcons.js +684 -689
- package/dist/components/pro/Flow/nodes/svgIcons.js.map +1 -1
- package/dist/components/pro/Flow/panels/AIPanel.js +464 -491
- package/dist/components/pro/Flow/panels/AIPanel.js.map +1 -1
- package/dist/components/pro/Flow/panels/Breadcrumb.js +41 -41
- package/dist/components/pro/Flow/panels/Breadcrumb.js.map +1 -1
- package/dist/components/pro/Flow/panels/ContextMenu.js +37 -37
- package/dist/components/pro/Flow/panels/ContextMenu.js.map +1 -1
- package/dist/components/pro/Flow/panels/DataInspectorSection.js +428 -432
- package/dist/components/pro/Flow/panels/DataInspectorSection.js.map +1 -1
- package/dist/components/pro/Flow/panels/ExpandableTextarea.js +61 -62
- package/dist/components/pro/Flow/panels/ExpandableTextarea.js.map +1 -1
- package/dist/components/pro/Flow/panels/FlowPanelGroup.js +114 -114
- package/dist/components/pro/Flow/panels/FlowPanelGroup.js.map +1 -1
- package/dist/components/pro/Flow/panels/FlowToolbar.js +347 -391
- package/dist/components/pro/Flow/panels/FlowToolbar.js.map +1 -1
- package/dist/components/pro/Flow/panels/InspectorPanel.js +1792 -1798
- package/dist/components/pro/Flow/panels/InspectorPanel.js.map +1 -1
- package/dist/components/pro/Flow/panels/OutlinePanel.js +242 -248
- package/dist/components/pro/Flow/panels/OutlinePanel.js.map +1 -1
- package/dist/components/pro/Flow/panels/PresentationMode.js +137 -140
- package/dist/components/pro/Flow/panels/PresentationMode.js.map +1 -1
- package/dist/components/pro/Flow/panels/ProjectTitle.js +46 -46
- package/dist/components/pro/Flow/panels/ProjectTitle.js.map +1 -1
- package/dist/components/pro/Flow/panels/ShapePalette.js +557 -572
- package/dist/components/pro/Flow/panels/ShapePalette.js.map +1 -1
- package/dist/components/pro/Flow/panels/toolbarIcons.d.ts +0 -1
- package/dist/components/pro/Flow/panels/toolbarIcons.js +508 -557
- package/dist/components/pro/Flow/panels/toolbarIcons.js.map +1 -1
- package/dist/components/pro/Flow/types.js +26 -26
- package/dist/components/pro/Flow/types.js.map +1 -1
- package/dist/components/pro/Flow/utils/dashedLine.js +113 -117
- package/dist/components/pro/Flow/utils/dashedLine.js.map +1 -1
- package/dist/components/pro/Flow/utils/gradient.js +55 -55
- package/dist/components/pro/Flow/utils/gradient.js.map +1 -1
- package/dist/components/pro/Flow/utils/pdfExport.js +50 -89
- package/dist/components/pro/Flow/utils/pdfExport.js.map +1 -1
- package/dist/components/pro/Flow/utils/themeColor.js +185 -195
- package/dist/components/pro/Flow/utils/themeColor.js.map +1 -1
- package/dist/components/pro/Gantt/Gantt.d.ts +7 -0
- package/dist/components/pro/Gantt/hooks/useGanttDrag.d.ts +31 -0
- package/dist/components/pro/Gantt/hooks/useGanttState.d.ts +58 -0
- package/dist/components/pro/Gantt/index.d.ts +6 -0
- package/dist/components/pro/Gantt/types.d.ts +478 -0
- package/dist/components/pro/Gantt/utils.d.ts +124 -0
- package/dist/components/pro/Resizable/Resizable.d.ts +30 -0
- package/dist/components/pro/Resizable/index.d.ts +2 -0
- package/dist/components/pro/RichTextEditor/AIRewrite.js +323 -334
- package/dist/components/pro/RichTextEditor/AIRewrite.js.map +1 -1
- package/dist/components/pro/RichTextEditor/BlockHandle.js +314 -316
- package/dist/components/pro/RichTextEditor/BlockHandle.js.map +1 -1
- package/dist/components/pro/RichTextEditor/BubbleToolbar.js +97 -97
- package/dist/components/pro/RichTextEditor/BubbleToolbar.js.map +1 -1
- package/dist/components/pro/RichTextEditor/CommentDialog.js +88 -88
- package/dist/components/pro/RichTextEditor/CommentDialog.js.map +1 -1
- package/dist/components/pro/RichTextEditor/CommentPanel.js +240 -240
- package/dist/components/pro/RichTextEditor/CommentPanel.js.map +1 -1
- package/dist/components/pro/RichTextEditor/CommentPopover.js +234 -234
- package/dist/components/pro/RichTextEditor/CommentPopover.js.map +1 -1
- package/dist/components/pro/RichTextEditor/ContextMenu.js +251 -252
- package/dist/components/pro/RichTextEditor/ContextMenu.js.map +1 -1
- package/dist/components/pro/RichTextEditor/RichTextEditor.js +267 -271
- package/dist/components/pro/RichTextEditor/RichTextEditor.js.map +1 -1
- package/dist/components/pro/RichTextEditor/SlashMenu.js +214 -214
- package/dist/components/pro/RichTextEditor/SlashMenu.js.map +1 -1
- package/dist/components/pro/RichTextEditor/Toolbar/ColorPicker.js +44 -75
- package/dist/components/pro/RichTextEditor/Toolbar/ColorPicker.js.map +1 -1
- package/dist/components/pro/RichTextEditor/Toolbar/FloatingDialogMenu.js +261 -261
- package/dist/components/pro/RichTextEditor/Toolbar/FloatingDialogMenu.js.map +1 -1
- package/dist/components/pro/RichTextEditor/Toolbar/MarkdownTemplates.js +172 -526
- package/dist/components/pro/RichTextEditor/Toolbar/MarkdownTemplates.js.map +1 -1
- package/dist/components/pro/RichTextEditor/Toolbar/SelectDropdown.js +112 -114
- package/dist/components/pro/RichTextEditor/Toolbar/SelectDropdown.js.map +1 -1
- package/dist/components/pro/RichTextEditor/Toolbar/TableOpsMenu.js +194 -194
- package/dist/components/pro/RichTextEditor/Toolbar/TableOpsMenu.js.map +1 -1
- package/dist/components/pro/RichTextEditor/Toolbar/Toolbar.js +970 -973
- package/dist/components/pro/RichTextEditor/Toolbar/Toolbar.js.map +1 -1
- package/dist/components/pro/RichTextEditor/Toolbar/ToolbarButton.js +11 -12
- package/dist/components/pro/RichTextEditor/Toolbar/ToolbarButton.js.map +1 -1
- package/dist/components/pro/RichTextEditor/extensions/CodeBlockView.js +310 -344
- package/dist/components/pro/RichTextEditor/extensions/CodeBlockView.js.map +1 -1
- package/dist/components/pro/RichTextEditor/extensions/CommentMark.js +38 -39
- package/dist/components/pro/RichTextEditor/extensions/CommentMark.js.map +1 -1
- package/dist/components/pro/RichTextEditor/extensions/FloatingDialog.js +620 -625
- package/dist/components/pro/RichTextEditor/extensions/FloatingDialog.js.map +1 -1
- package/dist/components/pro/RichTextEditor/extensions/FontSize.js +25 -25
- package/dist/components/pro/RichTextEditor/extensions/FontSize.js.map +1 -1
- package/dist/components/pro/RichTextEditor/extensions/MarkdownBlock.js +167 -176
- package/dist/components/pro/RichTextEditor/extensions/MarkdownBlock.js.map +1 -1
- package/dist/components/pro/RichTextEditor/types.js +75 -75
- package/dist/components/pro/RichTextEditor/types.js.map +1 -1
- package/dist/contexts/AppContext.d.ts +1 -1
- package/dist/contexts/AppContext.js +216 -221
- package/dist/contexts/AppContext.js.map +1 -1
- package/dist/data-table.js +15 -41
- package/dist/data-table.js.map +1 -1
- package/dist/dishui.css +1 -1
- package/dist/flow.js +27 -83
- package/dist/hooks/useClickOutside.js +18 -18
- package/dist/hooks/useClickOutside.js.map +1 -1
- package/dist/hooks/useContainerElement.js +9 -9
- package/dist/hooks/useContainerElement.js.map +1 -1
- package/dist/hooks/useControllableState.js +33 -35
- package/dist/hooks/useControllableState.js.map +1 -1
- package/dist/hooks/useCopyToClipboard.js +16 -16
- package/dist/hooks/useCopyToClipboard.js.map +1 -1
- package/dist/hooks/useDebounce.js +14 -14
- package/dist/hooks/useDebounce.js.map +1 -1
- package/dist/hooks/useDraggable.js +50 -50
- package/dist/hooks/useDraggable.js.map +1 -1
- package/dist/hooks/useTableColumns.js +39 -41
- package/dist/hooks/useTableColumns.js.map +1 -1
- package/dist/hooks/useTableData.js +67 -68
- package/dist/hooks/useTableData.js.map +1 -1
- package/dist/index-nostyled.d.ts +8 -0
- package/dist/index.d.ts +31 -3
- package/dist/index.js +106 -241
- package/dist/layouts/MainLayout.js +56 -56
- package/dist/layouts/MainLayout.js.map +1 -1
- package/dist/layouts/Navbar.js +214 -214
- package/dist/layouts/Navbar.js.map +1 -1
- package/dist/layouts/Sidebar.js +184 -186
- package/dist/layouts/Sidebar.js.map +1 -1
- package/dist/layouts/headbar/Headbar.js +25 -25
- package/dist/layouts/headbar/Headbar.js.map +1 -1
- package/dist/layouts/headbar/HeadbarLangSwitcher.js +39 -39
- package/dist/layouts/headbar/HeadbarLangSwitcher.js.map +1 -1
- package/dist/layouts/headbar/HeadbarSearch.js +120 -120
- package/dist/layouts/headbar/HeadbarSearch.js.map +1 -1
- package/dist/layouts/headbar/HeadbarThemeSwitcher.js +27 -27
- package/dist/layouts/headbar/HeadbarThemeSwitcher.js.map +1 -1
- package/dist/layouts/headbar/HeadbarTitle.js +26 -26
- package/dist/layouts/headbar/HeadbarTitle.js.map +1 -1
- package/dist/lite.js +9 -24
- package/dist/markdown.js +4 -9
- package/dist/pages/components/Calendar/index.d.ts +3 -0
- package/dist/pages/components/Calendar/index.en.d.ts +3 -0
- package/dist/pages/components/Calendar/index.zh.d.ts +3 -0
- package/dist/pages/components/Chat/index.d.ts +3 -0
- package/dist/pages/components/Chat/index.en.d.ts +3 -0
- package/dist/pages/components/Chat/index.zh.d.ts +3 -0
- package/dist/pages/components/FloatWindow/index.d.ts +3 -0
- package/dist/pages/components/FloatWindow/index.en.d.ts +3 -0
- package/dist/pages/components/FloatWindow/index.zh.d.ts +3 -0
- package/dist/pages/components/Gantt/index.d.ts +3 -0
- package/dist/pages/components/Gantt/index.en.d.ts +3 -0
- package/dist/pages/components/Gantt/index.zh.d.ts +3 -0
- package/dist/pages/components/GridLayout/index.d.ts +3 -0
- package/dist/pages/components/GridLayout/index.en.d.ts +3 -0
- package/dist/pages/components/GridLayout/index.zh.d.ts +3 -0
- package/dist/pages/components/Notification/index.d.ts +3 -0
- package/dist/pages/components/Notification/index.en.d.ts +3 -0
- package/dist/pages/components/Notification/index.zh.d.ts +3 -0
- package/dist/pages/components/Resizable/index.d.ts +3 -0
- package/dist/pages/components/Resizable/index.en.d.ts +3 -0
- package/dist/pages/components/Resizable/index.zh.d.ts +3 -0
- package/dist/pages/components/Tab/index.d.ts +3 -0
- package/dist/pages/components/Tab/index.en.d.ts +3 -0
- package/dist/pages/components/Tab/index.zh.d.ts +3 -0
- package/dist/styles/themeStyles.js +87 -86
- package/dist/styles/themeStyles.js.map +1 -1
- package/dist/utils/cn.d.ts +13 -0
- package/dist/utils/cn.js +16 -0
- package/dist/utils/cn.js.map +1 -0
- package/dist/utils/i18n.js +700 -602
- package/dist/utils/i18n.js.map +1 -1
- package/dist/utils/menu.js +94 -94
- package/dist/utils/menu.js.map +1 -1
- package/dist/utils/rehype-code-meta.js +14 -14
- package/dist/utils/rehype-code-meta.js.map +1 -1
- package/dist/utils/remark-code-meta.js +9 -9
- package/dist/utils/remark-code-meta.js.map +1 -1
- package/dist/utils/routerBuilder.js +59 -60
- package/dist/utils/routerBuilder.js.map +1 -1
- package/dist/utils/selection.js +28 -29
- package/dist/utils/selection.js.map +1 -1
- package/dist/utils/themes.js +275 -255
- package/dist/utils/themes.js.map +1 -1
- package/package.json +19 -6
- package/dist/components/StatCard/index.d.ts +0 -24
- package/dist/components/StatCard/index.js +0 -90
- package/dist/components/StatCard/index.js.map +0 -1
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
};
|
|
10
|
-
export {
|
|
11
|
-
l as __exportAll
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var e = Object.defineProperty, t = (t, n) => {
|
|
3
|
+
let r = {};
|
|
4
|
+
for (var i in t) e(r, i, {
|
|
5
|
+
get: t[i],
|
|
6
|
+
enumerable: !0
|
|
7
|
+
});
|
|
8
|
+
return n || e(r, Symbol.toStringTag, { value: "Module" }), r;
|
|
12
9
|
};
|
|
10
|
+
//#endregion
|
|
11
|
+
export { t as __exportAll };
|
package/dist/chart.js
CHANGED
|
@@ -1,48 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { areaX as
|
|
3
|
-
import { scaleBand as
|
|
1
|
+
import e from "./components/Chart/Chart.js";
|
|
2
|
+
import { areaX as t, areaY as n, barX as r, barY as i, cell as a, colorGradientLegend as o, colorLegend as s, defineChart as c, dot as l, group as u, lineX as d, lineY as f, linearRegressionY as p, link as m, rect as h, stack as g, text as _ } from "@tanstack/charts";
|
|
3
|
+
import { scaleBand as v } from "@tanstack/charts/scales/band";
|
|
4
4
|
import { scaleLinear as y } from "@tanstack/charts/scales/linear";
|
|
5
|
-
import { scalePoint as
|
|
6
|
-
import { scaleOrdinal as
|
|
7
|
-
import { geoShape as
|
|
8
|
-
import { treemap as
|
|
9
|
-
import { delaunayLink as
|
|
10
|
-
import { pie as
|
|
11
|
-
import { sankeyDiagram as
|
|
12
|
-
import { tooltip as
|
|
5
|
+
import { scalePoint as b } from "@tanstack/charts/scales/point";
|
|
6
|
+
import { scaleOrdinal as x } from "@tanstack/charts/scales/ordinal";
|
|
7
|
+
import { geoShape as S } from "@tanstack/charts/geo";
|
|
8
|
+
import { treemap as C } from "@tanstack/charts/hierarchy/treemap";
|
|
9
|
+
import { delaunayLink as w } from "@tanstack/charts/spatial/delaunay";
|
|
10
|
+
import { pie as T, polar as E, radialArc as D, radialDot as O, radialLine as k } from "@tanstack/charts/polar";
|
|
11
|
+
import { sankeyDiagram as A } from "@tanstack/charts/network/sankey";
|
|
12
|
+
import { tooltip as j } from "@tanstack/charts/tooltip";
|
|
13
13
|
export * from "@tanstack/react-charts";
|
|
14
|
-
export {
|
|
15
|
-
o as Chart,
|
|
16
|
-
e as areaX,
|
|
17
|
-
i as areaY,
|
|
18
|
-
t as barX,
|
|
19
|
-
m as barY,
|
|
20
|
-
l as cell,
|
|
21
|
-
p as colorGradientLegend,
|
|
22
|
-
n as colorLegend,
|
|
23
|
-
o as default,
|
|
24
|
-
f as defineChart,
|
|
25
|
-
j as delaunayLink,
|
|
26
|
-
d as dot,
|
|
27
|
-
O as geoShape,
|
|
28
|
-
c as group,
|
|
29
|
-
s as lineX,
|
|
30
|
-
g as lineY,
|
|
31
|
-
L as linearRegressionY,
|
|
32
|
-
k as link,
|
|
33
|
-
v as pie,
|
|
34
|
-
w as polar,
|
|
35
|
-
z as radialArc,
|
|
36
|
-
E as radialDot,
|
|
37
|
-
F as radialLine,
|
|
38
|
-
Y as rect,
|
|
39
|
-
I as sankeyDiagram,
|
|
40
|
-
X as scaleBand,
|
|
41
|
-
y as scaleLinear,
|
|
42
|
-
B as scaleOrdinal,
|
|
43
|
-
D as scalePoint,
|
|
44
|
-
h as stack,
|
|
45
|
-
u as text,
|
|
46
|
-
K as tooltip,
|
|
47
|
-
R as treemap
|
|
48
|
-
};
|
|
14
|
+
export { e as Chart, t as areaX, n as areaY, r as barX, i as barY, a as cell, o as colorGradientLegend, s as colorLegend, e as default, c as defineChart, w as delaunayLink, l as dot, S as geoShape, u as group, d as lineX, f as lineY, p as linearRegressionY, m as link, T as pie, E as polar, D as radialArc, O as radialDot, k as radialLine, h as rect, A as sankeyDiagram, v as scaleBand, y as scaleLinear, x as scaleOrdinal, b as scalePoint, g as stack, _ as text, j as tooltip, C as treemap };
|
package/dist/code-editor.js
CHANGED
|
@@ -1,43 +1,16 @@
|
|
|
1
|
-
import { getDefaultSnippets as
|
|
2
|
-
import { jsJumpableKeywords as
|
|
3
|
-
import { pyJumpableKeywords as a, pyKeywords as
|
|
4
|
-
import { getJumpableKeywords as s, getLanguageKeywords as
|
|
5
|
-
import { bracketMatchingStyle as
|
|
6
|
-
import { createHighlightExtension as
|
|
7
|
-
import { collectVariables as
|
|
8
|
-
import { defaultContextMenu as
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
export {
|
|
17
|
-
C as CodeEditor,
|
|
18
|
-
k as FootnotePanel,
|
|
19
|
-
z as HistoryPanel,
|
|
20
|
-
V as MarkdownEditor,
|
|
21
|
-
A as OutlinePanel,
|
|
22
|
-
M as TableOfContentsPanel,
|
|
23
|
-
L as VariablePanel,
|
|
24
|
-
y as bracketMatchingStyle,
|
|
25
|
-
S as collectVariables,
|
|
26
|
-
K as createHighlightExtension,
|
|
27
|
-
j as createThemeExtension,
|
|
28
|
-
H as defaultContextMenu,
|
|
29
|
-
x as generateOutline,
|
|
30
|
-
t as getDefaultSnippets,
|
|
31
|
-
s as getJumpableKeywords,
|
|
32
|
-
g as getLanguageKeywords,
|
|
33
|
-
e as javascriptSnippets,
|
|
34
|
-
m as jsJumpableKeywords,
|
|
35
|
-
p as jsKeywords,
|
|
36
|
-
d as jumpTargetHighlight,
|
|
37
|
-
h as jumpToDefinition,
|
|
38
|
-
c as lineHighlightStyle,
|
|
39
|
-
a as pyJumpableKeywords,
|
|
40
|
-
l as pyKeywords,
|
|
41
|
-
r as pythonSnippets,
|
|
42
|
-
b as smartAutocompletion
|
|
43
|
-
};
|
|
1
|
+
import { getDefaultSnippets as e, javascriptSnippets as t, pythonSnippets as n } from "./components/pro/CodeEditor/langs/snippets.js";
|
|
2
|
+
import { jsJumpableKeywords as r, jsKeywords as i } from "./components/pro/CodeEditor/langs/javascript.js";
|
|
3
|
+
import { pyJumpableKeywords as a, pyKeywords as o } from "./components/pro/CodeEditor/langs/python.js";
|
|
4
|
+
import { getJumpableKeywords as s, getLanguageKeywords as c } from "./components/pro/CodeEditor/langs/index.js";
|
|
5
|
+
import { bracketMatchingStyle as l, jumpTargetHighlight as u, jumpToDefinition as d, lineHighlightStyle as f, smartAutocompletion as p } from "./components/pro/CodeEditor/extensions/index.js";
|
|
6
|
+
import { createHighlightExtension as m, createThemeExtension as h } from "./components/pro/CodeEditor/themes.js";
|
|
7
|
+
import { collectVariables as g, generateOutline as _ } from "./components/pro/CodeEditor/utils.js";
|
|
8
|
+
import { defaultContextMenu as v } from "./components/pro/CodeEditor/extensions/contextMenu.js";
|
|
9
|
+
import y from "./components/pro/CodeEditor/editors/CodeEditor.js";
|
|
10
|
+
import b from "./components/pro/CodeEditor/panels/TableOfContentsPanel.js";
|
|
11
|
+
import x from "./components/pro/CodeEditor/panels/FootnotePanel.js";
|
|
12
|
+
import S from "./components/pro/CodeEditor/editors/MarkdownEditor.js";
|
|
13
|
+
import C from "./components/pro/CodeEditor/panels/OutlinePanel.js";
|
|
14
|
+
import w from "./components/pro/CodeEditor/panels/VariablePanel.js";
|
|
15
|
+
import T from "./components/pro/CodeEditor/panels/HistoryPanel.js";
|
|
16
|
+
export { y as CodeEditor, x as FootnotePanel, T as HistoryPanel, S as MarkdownEditor, C as OutlinePanel, b as TableOfContentsPanel, w as VariablePanel, l as bracketMatchingStyle, g as collectVariables, m as createHighlightExtension, h as createThemeExtension, v as defaultContextMenu, _ as generateOutline, e as getDefaultSnippets, s as getJumpableKeywords, c as getLanguageKeywords, t as javascriptSnippets, r as jsJumpableKeywords, i as jsKeywords, u as jumpTargetHighlight, d as jumpToDefinition, f as lineHighlightStyle, a as pyJumpableKeywords, o as pyKeywords, n as pythonSnippets, p as smartAutocompletion };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type AccordionItemType = {
|
|
3
|
+
/** 唯一标识(用于展开状态管理)。 */
|
|
4
|
+
key: string;
|
|
5
|
+
/** 标题。 */
|
|
6
|
+
title: React.ReactNode;
|
|
7
|
+
/** 展开区域内容。 */
|
|
8
|
+
content: React.ReactNode;
|
|
9
|
+
/** 标题左侧图标。 */
|
|
10
|
+
icon?: React.ReactNode;
|
|
11
|
+
/** 标题行右侧、展开指示器之前的附加内容。 */
|
|
12
|
+
extra?: React.ReactNode;
|
|
13
|
+
/** 禁用该项。 */
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
};
|
|
16
|
+
export type AccordionProps = {
|
|
17
|
+
/** 手风琴项(数据驱动,可动态增删)。 */
|
|
18
|
+
items: AccordionItemType[];
|
|
19
|
+
/** 受控:当前展开项的 key 列表。 */
|
|
20
|
+
openKeys?: string[];
|
|
21
|
+
/** 非受控:默认展开项的 key 列表。 */
|
|
22
|
+
defaultOpenKeys?: string[];
|
|
23
|
+
/** 是否允许同时展开多项;默认 false(互斥展开,展开新项时收起其它项)。 */
|
|
24
|
+
multiple?: boolean;
|
|
25
|
+
/** 展开状态变化回调。 */
|
|
26
|
+
onChange?: (openKeys: string[]) => void;
|
|
27
|
+
/** 是否显示右侧展开指示箭头,默认 true。 */
|
|
28
|
+
indicator?: boolean;
|
|
29
|
+
/** 是否显示外层边框,默认 true。 */
|
|
30
|
+
bordered?: boolean;
|
|
31
|
+
className?: string;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Accordion —— 手风琴组件:动态交互式的聚合展开列表。
|
|
35
|
+
* 数据驱动(items 可动态增删),支持受控 / 非受控、互斥或多开、
|
|
36
|
+
* 禁用项、图标与自定义内容,展开 / 收起带平滑过渡动画。
|
|
37
|
+
*/
|
|
38
|
+
declare const Accordion: React.FC<AccordionProps>;
|
|
39
|
+
export default Accordion;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { cn as e } from "../../utils/cn.js";
|
|
2
|
+
import t from "react";
|
|
3
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/Accordion/index.tsx
|
|
5
|
+
var i = ({ className: t }) => /* @__PURE__ */ n("svg", {
|
|
6
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
7
|
+
viewBox: "0 0 24 24",
|
|
8
|
+
fill: "none",
|
|
9
|
+
stroke: "currentColor",
|
|
10
|
+
strokeWidth: 2,
|
|
11
|
+
strokeLinecap: "round",
|
|
12
|
+
strokeLinejoin: "round",
|
|
13
|
+
className: e("h-4 w-4", t),
|
|
14
|
+
"aria-hidden": "true",
|
|
15
|
+
children: /* @__PURE__ */ n("path", { d: "m6 9 6 6 6-6" })
|
|
16
|
+
}), a = ({ items: a, openKeys: o, defaultOpenKeys: s = [], multiple: c = !1, onChange: l, indicator: u = !0, bordered: d = !0, className: f = "" }) => {
|
|
17
|
+
let [p, m] = t.useState(s), h = o !== void 0, g = h ? o ?? [] : p, _ = (e, t) => {
|
|
18
|
+
if (t) return;
|
|
19
|
+
let n = g.includes(e) ? g.filter((t) => t !== e) : c ? [...g, e] : [e];
|
|
20
|
+
h || m(n), l?.(n);
|
|
21
|
+
};
|
|
22
|
+
return /* @__PURE__ */ n("div", {
|
|
23
|
+
className: e("w-full divide-y divide-base-300 overflow-hidden bg-base-100", d && "rounded-xl border border-base-300/70", f),
|
|
24
|
+
children: a.map((t) => {
|
|
25
|
+
let a = g.includes(t.key);
|
|
26
|
+
return /* @__PURE__ */ r("div", {
|
|
27
|
+
className: e(a && !t.disabled && "bg-base-200/40"),
|
|
28
|
+
children: [/* @__PURE__ */ r("button", {
|
|
29
|
+
type: "button",
|
|
30
|
+
disabled: t.disabled,
|
|
31
|
+
"aria-expanded": a,
|
|
32
|
+
onClick: () => _(t.key, t.disabled),
|
|
33
|
+
className: e("flex w-full items-center gap-2 px-4 py-3 text-left text-sm font-medium transition-colors", t.disabled ? "cursor-not-allowed opacity-50" : "cursor-pointer hover:bg-base-200/60", a && !t.disabled && "text-primary"),
|
|
34
|
+
children: [
|
|
35
|
+
t.icon && /* @__PURE__ */ n("span", {
|
|
36
|
+
className: "flex shrink-0 items-center text-base-content/60 [&>svg]:h-4 [&>svg]:w-4",
|
|
37
|
+
children: t.icon
|
|
38
|
+
}),
|
|
39
|
+
/* @__PURE__ */ n("span", {
|
|
40
|
+
className: "min-w-0 flex-1 truncate",
|
|
41
|
+
children: t.title
|
|
42
|
+
}),
|
|
43
|
+
t.extra && /* @__PURE__ */ n("span", {
|
|
44
|
+
className: "flex shrink-0 items-center",
|
|
45
|
+
children: t.extra
|
|
46
|
+
}),
|
|
47
|
+
u && /* @__PURE__ */ n("span", {
|
|
48
|
+
className: e("shrink-0 text-base-content/50 transition-transform duration-200", a && "rotate-180 text-primary"),
|
|
49
|
+
children: /* @__PURE__ */ n(i, {})
|
|
50
|
+
})
|
|
51
|
+
]
|
|
52
|
+
}), /* @__PURE__ */ n("div", {
|
|
53
|
+
className: "grid transition-[grid-template-rows] duration-200 ease-out",
|
|
54
|
+
style: { gridTemplateRows: a ? "1fr" : "0fr" },
|
|
55
|
+
children: /* @__PURE__ */ n("div", {
|
|
56
|
+
className: "overflow-hidden",
|
|
57
|
+
children: /* @__PURE__ */ n("div", {
|
|
58
|
+
className: "px-4 pb-4 pt-0 text-sm leading-relaxed text-base-content/75",
|
|
59
|
+
children: t.content
|
|
60
|
+
})
|
|
61
|
+
})
|
|
62
|
+
})]
|
|
63
|
+
}, t.key);
|
|
64
|
+
})
|
|
65
|
+
});
|
|
66
|
+
};
|
|
67
|
+
//#endregion
|
|
68
|
+
export { a as default };
|
|
69
|
+
|
|
70
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/components/Accordion/index.tsx"],"sourcesContent":["import React from 'react';\nimport { cn } from '../../utils/cn';\n\nexport type AccordionItemType = {\n /** 唯一标识(用于展开状态管理)。 */\n key: string;\n /** 标题。 */\n title: React.ReactNode;\n /** 展开区域内容。 */\n content: React.ReactNode;\n /** 标题左侧图标。 */\n icon?: React.ReactNode;\n /** 标题行右侧、展开指示器之前的附加内容。 */\n extra?: React.ReactNode;\n /** 禁用该项。 */\n disabled?: boolean;\n};\n\nexport type AccordionProps = {\n /** 手风琴项(数据驱动,可动态增删)。 */\n items: AccordionItemType[];\n /** 受控:当前展开项的 key 列表。 */\n openKeys?: string[];\n /** 非受控:默认展开项的 key 列表。 */\n defaultOpenKeys?: string[];\n /** 是否允许同时展开多项;默认 false(互斥展开,展开新项时收起其它项)。 */\n multiple?: boolean;\n /** 展开状态变化回调。 */\n onChange?: (openKeys: string[]) => void;\n /** 是否显示右侧展开指示箭头,默认 true。 */\n indicator?: boolean;\n /** 是否显示外层边框,默认 true。 */\n bordered?: boolean;\n className?: string;\n};\n\nconst ChevronGlyph: React.FC<{ className?: string }> = ({ className }) => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className={cn('h-4 w-4', className)}\n aria-hidden=\"true\"\n >\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n);\n\n/**\n * Accordion —— 手风琴组件:动态交互式的聚合展开列表。\n * 数据驱动(items 可动态增删),支持受控 / 非受控、互斥或多开、\n * 禁用项、图标与自定义内容,展开 / 收起带平滑过渡动画。\n */\nconst Accordion: React.FC<AccordionProps> = ({\n items,\n openKeys,\n defaultOpenKeys = [],\n multiple = false,\n onChange,\n indicator = true,\n bordered = true,\n className = '',\n}) => {\n const [innerKeys, setInnerKeys] = React.useState<string[]>(defaultOpenKeys);\n const isControlled = openKeys !== undefined;\n const currentKeys = isControlled ? (openKeys ?? []) : innerKeys;\n\n const toggle = (key: string, disabled?: boolean) => {\n if (disabled) return;\n const nextKeys = currentKeys.includes(key)\n ? currentKeys.filter((k) => k !== key)\n : multiple\n ? [...currentKeys, key]\n : [key];\n if (!isControlled) setInnerKeys(nextKeys);\n onChange?.(nextKeys);\n };\n\n return (\n <div\n className={cn(\n 'w-full divide-y divide-base-300 overflow-hidden bg-base-100',\n bordered && 'rounded-xl border border-base-300/70',\n className,\n )}\n >\n {items.map((item) => {\n const open = currentKeys.includes(item.key);\n return (\n <div key={item.key} className={cn(open && !item.disabled && 'bg-base-200/40')}>\n <button\n type=\"button\"\n disabled={item.disabled}\n aria-expanded={open}\n onClick={() => toggle(item.key, item.disabled)}\n className={cn(\n 'flex w-full items-center gap-2 px-4 py-3 text-left text-sm font-medium transition-colors',\n item.disabled\n ? 'cursor-not-allowed opacity-50'\n : 'cursor-pointer hover:bg-base-200/60',\n open && !item.disabled && 'text-primary',\n )}\n >\n {item.icon && <span className=\"flex shrink-0 items-center text-base-content/60 [&>svg]:h-4 [&>svg]:w-4\">{item.icon}</span>}\n <span className=\"min-w-0 flex-1 truncate\">{item.title}</span>\n {item.extra && <span className=\"flex shrink-0 items-center\">{item.extra}</span>}\n {indicator && (\n <span className={cn('shrink-0 text-base-content/50 transition-transform duration-200', open && 'rotate-180 text-primary')}>\n <ChevronGlyph />\n </span>\n )}\n </button>\n <div\n className=\"grid transition-[grid-template-rows] duration-200 ease-out\"\n style={{ gridTemplateRows: open ? '1fr' : '0fr' }}\n >\n <div className=\"overflow-hidden\">\n <div className=\"px-4 pb-4 pt-0 text-sm leading-relaxed text-base-content/75\">\n {item.content}\n </div>\n </div>\n </div>\n </div>\n );\n })}\n </div>\n );\n};\n\nexport default Accordion;\n"],"mappings":";;;;AAoCA,IAAM,KAAkD,EAAE,mBACxD,kBAAC,OAAD;CACE,OAAM;CACN,SAAQ;CACR,MAAK;CACL,QAAO;CACP,aAAa;CACb,eAAc;CACd,gBAAe;CACf,WAAW,EAAG,WAAW,CAAS;CAClC,eAAY;CAEZ,UAAA,kBAAC,QAAD,EAAM,GAAE,eAAgB,CAAA;AACrB,CAAA,GAQD,KAAuC,EAC3C,UACA,aACA,qBAAkB,CAAC,GACnB,cAAW,IACX,aACA,eAAY,IACZ,cAAW,IACX,eAAY,SACR;CACJ,IAAM,CAAC,GAAW,KAAgB,EAAM,SAAmB,CAAe,GACpE,IAAe,MAAa,KAAA,GAC5B,IAAc,IAAgB,KAAY,CAAC,IAAK,GAEhD,KAAU,GAAa,MAAuB;EAClD,IAAI,GAAU;EACd,IAAM,IAAW,EAAY,SAAS,CAAG,IACrC,EAAY,QAAQ,MAAM,MAAM,CAAG,IACnC,IACE,CAAC,GAAG,GAAa,CAAG,IACpB,CAAC,CAAG;EAEV,AADK,KAAc,EAAa,CAAQ,GACxC,IAAW,CAAQ;CACrB;CAEA,OACE,kBAAC,OAAD;EACE,WAAW,EACT,+DACA,KAAY,wCACZ,CACF;EAEC,UAAA,EAAM,KAAK,MAAS;GACnB,IAAM,IAAO,EAAY,SAAS,EAAK,GAAG;GAC1C,OACE,kBAAC,OAAD;IAAoB,WAAW,EAAG,KAAQ,CAAC,EAAK,YAAY,gBAAgB;IAA5E,UAAA,CACE,kBAAC,UAAD;KACE,MAAK;KACL,UAAU,EAAK;KACf,iBAAe;KACf,eAAe,EAAO,EAAK,KAAK,EAAK,QAAQ;KAC7C,WAAW,EACT,4FACA,EAAK,WACD,kCACA,uCACJ,KAAQ,CAAC,EAAK,YAAY,cAC5B;KAXF,UAAA;MAaG,EAAK,QAAQ,kBAAC,QAAD;OAAM,WAAU;OAA2E,UAAA,EAAK;MAAW,CAAA;MACzH,kBAAC,QAAD;OAAM,WAAU;OAA2B,UAAA,EAAK;MAAY,CAAA;MAC3D,EAAK,SAAS,kBAAC,QAAD;OAAM,WAAU;OAA8B,UAAA,EAAK;MAAY,CAAA;MAC7E,KACC,kBAAC,QAAD;OAAM,WAAW,EAAG,mEAAmE,KAAQ,yBAAyB;OACtH,UAAA,kBAAC,GAAD,CAAe,CAAA;MACX,CAAA;KAEF;IACR,CAAA,GAAA,kBAAC,OAAD;KACE,WAAU;KACV,OAAO,EAAE,kBAAkB,IAAO,QAAQ,MAAM;KAEhD,UAAA,kBAAC,OAAD;MAAK,WAAU;MACb,UAAA,kBAAC,OAAD;OAAK,WAAU;OACZ,UAAA,EAAK;MACH,CAAA;KACF,CAAA;IACF,CAAA,CACF;GAjCK,GAAA,EAAK,GAiCV;EAET,CAAC;CACE,CAAA;AAET"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type AvatarShape = 'circle' | 'square' | 'squircle';
|
|
3
|
+
export type AvatarBorderStyle = 'solid' | 'dashed' | 'dotted';
|
|
4
|
+
export type AvatarNotificationPosition = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
|
5
|
+
export type AvatarProps = {
|
|
6
|
+
/** 头像图片地址;缺省或加载失败时回退为 `name` 的关键字母。 */
|
|
7
|
+
src?: string;
|
|
8
|
+
/** 图片 alt 描述。 */
|
|
9
|
+
alt?: string;
|
|
10
|
+
/** 名称 / 描述:未配置头像时取其关键字母(两个单词取首字母,否则取前两个字符)作为回退展示。 */
|
|
11
|
+
name?: string;
|
|
12
|
+
/** 方形尺寸;数字按 px 处理。默认 40。 */
|
|
13
|
+
size?: number | string;
|
|
14
|
+
/** 边框(整体)形态:circle 圆形(默认)/ square 方形 / squircle 超椭圆圆角方。 */
|
|
15
|
+
shape?: AvatarShape;
|
|
16
|
+
/** shape="square" 时的自定义圆角(数字按 px)。 */
|
|
17
|
+
radius?: number | string;
|
|
18
|
+
/** 边框宽度(数字按 px);mask 边框模式下即为环宽,默认 2。 */
|
|
19
|
+
borderWidth?: number | string;
|
|
20
|
+
/** 边框颜色。 */
|
|
21
|
+
borderColor?: string;
|
|
22
|
+
/** 边框线型:solid(默认)/ dashed / dotted。 */
|
|
23
|
+
borderStyle?: AvatarBorderStyle;
|
|
24
|
+
/** mask 边框:颜色或 CSS 渐变(如 story ring)。设置后以 mask 环的形式覆盖在头像边缘,中间不遮挡内容。 */
|
|
25
|
+
maskBorder?: string;
|
|
26
|
+
/** 中间(内容)区域透明度 0–1,默认 1;mask 边框模式下常用于压暗头像突出环。 */
|
|
27
|
+
centerOpacity?: number;
|
|
28
|
+
/** 角标通知位置,默认 top-right。 */
|
|
29
|
+
notificationPosition?: AvatarNotificationPosition;
|
|
30
|
+
/** 角标通知内容(如计数数值 / 短文本);传 `true` 显示小圆点,不传则不渲染角标。 */
|
|
31
|
+
notification?: React.ReactNode;
|
|
32
|
+
/** 角标背景色,默认 var(--color-error)。 */
|
|
33
|
+
notificationColor?: string;
|
|
34
|
+
/** Extra class names on the wrapper. */
|
|
35
|
+
className?: string;
|
|
36
|
+
/** Inline styles on the wrapper. */
|
|
37
|
+
style?: React.CSSProperties;
|
|
38
|
+
/** Click handler. */
|
|
39
|
+
onClick?: (e: React.MouseEvent<HTMLSpanElement>) => void;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Avatar —— 头像组件。
|
|
43
|
+
* 展示图片头像;未配置(或加载失败)时回退为 `name` 的关键字母。
|
|
44
|
+
* 支持自定义边框形态 / 颜色 / 线型、mask 环状边框(中间区域透明度可控)
|
|
45
|
+
* 以及四角 notification 短描述(计数 / 文本 / 圆点)。
|
|
46
|
+
*/
|
|
47
|
+
declare const Avatar: React.FC<AvatarProps>;
|
|
48
|
+
export default Avatar;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { cn as e } from "../../utils/cn.js";
|
|
2
|
+
import t from "react";
|
|
3
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/Avatar/index.tsx
|
|
5
|
+
var i = (e) => {
|
|
6
|
+
let t = e.trim().split(/\s+/).filter(Boolean);
|
|
7
|
+
return t.length >= 2 ? (t[0][0] + t[1][0]).toUpperCase() : e.trim().slice(0, 2).toUpperCase();
|
|
8
|
+
}, a = {
|
|
9
|
+
circle: "rounded-full",
|
|
10
|
+
square: "",
|
|
11
|
+
squircle: "mask mask-squircle"
|
|
12
|
+
}, o = {
|
|
13
|
+
"top-left": "top-0 left-0 -translate-x-1/3 -translate-y-1/3",
|
|
14
|
+
"top-right": "top-0 right-0 translate-x-1/3 -translate-y-1/3",
|
|
15
|
+
"bottom-left": "bottom-0 left-0 -translate-x-1/3 translate-y-1/3",
|
|
16
|
+
"bottom-right": "bottom-0 right-0 translate-x-1/3 translate-y-1/3"
|
|
17
|
+
}, s = ({ src: s, alt: c, name: l, size: u = 40, shape: d = "circle", radius: f, borderWidth: p, borderColor: m, borderStyle: h = "solid", maskBorder: g, centerOpacity: _ = 1, notificationPosition: v = "top-right", notification: y, notificationColor: b = "var(--color-error)", className: x = "", style: S, onClick: C }) => {
|
|
18
|
+
let w = typeof u == "number" ? `${u}px` : u, [T, E] = t.useState(!1);
|
|
19
|
+
t.useEffect(() => E(!1), [s]);
|
|
20
|
+
let D = !!s && !T, O = l ? i(l) : "", k = `calc(${w} * 0.36)`, A = d === "square" ? { borderRadius: f ?? "0.5rem" } : {}, j = p === void 0 ? g ? "2px" : "0px" : typeof p == "number" ? `${p}px` : p, M = y != null && y !== !1;
|
|
21
|
+
return /* @__PURE__ */ r("span", {
|
|
22
|
+
className: e("relative inline-flex shrink-0 leading-none", C && "cursor-pointer", x),
|
|
23
|
+
style: {
|
|
24
|
+
width: w,
|
|
25
|
+
height: w,
|
|
26
|
+
...S
|
|
27
|
+
},
|
|
28
|
+
onClick: C,
|
|
29
|
+
children: [
|
|
30
|
+
g && /* @__PURE__ */ n("span", {
|
|
31
|
+
"aria-hidden": "true",
|
|
32
|
+
className: "pointer-events-none absolute inset-0 z-10",
|
|
33
|
+
style: {
|
|
34
|
+
padding: j,
|
|
35
|
+
background: g,
|
|
36
|
+
WebkitMask: "linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0)",
|
|
37
|
+
WebkitMaskComposite: "xor",
|
|
38
|
+
mask: "linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0)",
|
|
39
|
+
maskComposite: "exclude",
|
|
40
|
+
...A
|
|
41
|
+
}
|
|
42
|
+
}),
|
|
43
|
+
/* @__PURE__ */ n("span", {
|
|
44
|
+
className: e("relative flex h-full w-full select-none items-center justify-center overflow-hidden bg-base-200 text-center font-semibold text-base-content/70", a[d]),
|
|
45
|
+
style: {
|
|
46
|
+
fontSize: k,
|
|
47
|
+
opacity: _,
|
|
48
|
+
borderWidth: g ? 0 : j,
|
|
49
|
+
borderStyle: g ? void 0 : h,
|
|
50
|
+
borderColor: g ? void 0 : m,
|
|
51
|
+
...A
|
|
52
|
+
},
|
|
53
|
+
children: D ? /* @__PURE__ */ n("img", {
|
|
54
|
+
src: s,
|
|
55
|
+
alt: c ?? l ?? "",
|
|
56
|
+
className: "h-full w-full object-cover",
|
|
57
|
+
onError: () => E(!0)
|
|
58
|
+
}) : O
|
|
59
|
+
}),
|
|
60
|
+
M && /* @__PURE__ */ n("span", {
|
|
61
|
+
className: e("absolute z-20 flex items-center justify-center rounded-full border-2 border-base-100 font-bold leading-none text-white", o[v], y === !0 ? "h-3 w-3 p-0" : "h-[18px] min-w-[18px] px-1 text-[10px]"),
|
|
62
|
+
style: { backgroundColor: b },
|
|
63
|
+
children: y === !0 ? "" : y
|
|
64
|
+
})
|
|
65
|
+
]
|
|
66
|
+
});
|
|
67
|
+
};
|
|
68
|
+
//#endregion
|
|
69
|
+
export { s as default };
|
|
70
|
+
|
|
71
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/components/Avatar/index.tsx"],"sourcesContent":["import React from 'react';\nimport { cn } from '../../utils/cn';\n\nexport type AvatarShape = 'circle' | 'square' | 'squircle';\nexport type AvatarBorderStyle = 'solid' | 'dashed' | 'dotted';\nexport type AvatarNotificationPosition = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';\n\nexport type AvatarProps = {\n /** 头像图片地址;缺省或加载失败时回退为 `name` 的关键字母。 */\n src?: string;\n /** 图片 alt 描述。 */\n alt?: string;\n /** 名称 / 描述:未配置头像时取其关键字母(两个单词取首字母,否则取前两个字符)作为回退展示。 */\n name?: string;\n /** 方形尺寸;数字按 px 处理。默认 40。 */\n size?: number | string;\n /** 边框(整体)形态:circle 圆形(默认)/ square 方形 / squircle 超椭圆圆角方。 */\n shape?: AvatarShape;\n /** shape=\"square\" 时的自定义圆角(数字按 px)。 */\n radius?: number | string;\n /** 边框宽度(数字按 px);mask 边框模式下即为环宽,默认 2。 */\n borderWidth?: number | string;\n /** 边框颜色。 */\n borderColor?: string;\n /** 边框线型:solid(默认)/ dashed / dotted。 */\n borderStyle?: AvatarBorderStyle;\n /** mask 边框:颜色或 CSS 渐变(如 story ring)。设置后以 mask 环的形式覆盖在头像边缘,中间不遮挡内容。 */\n maskBorder?: string;\n /** 中间(内容)区域透明度 0–1,默认 1;mask 边框模式下常用于压暗头像突出环。 */\n centerOpacity?: number;\n /** 角标通知位置,默认 top-right。 */\n notificationPosition?: AvatarNotificationPosition;\n /** 角标通知内容(如计数数值 / 短文本);传 `true` 显示小圆点,不传则不渲染角标。 */\n notification?: React.ReactNode;\n /** 角标背景色,默认 var(--color-error)。 */\n notificationColor?: string;\n /** Extra class names on the wrapper. */\n className?: string;\n /** Inline styles on the wrapper. */\n style?: React.CSSProperties;\n /** Click handler. */\n onClick?: (e: React.MouseEvent<HTMLSpanElement>) => void;\n};\n\n/** 从名称/描述中提取关键字母:两个单词取首字母,否则取前两个字符(统一大写)。 */\nconst initialsOf = (name: string): string => {\n const parts = name.trim().split(/\\s+/).filter(Boolean);\n if (parts.length >= 2) return (parts[0][0] + parts[1][0]).toUpperCase();\n return name.trim().slice(0, 2).toUpperCase();\n};\n\nconst SHAPE_CLASS: Record<AvatarShape, string> = {\n circle: 'rounded-full',\n square: '',\n squircle: 'mask mask-squircle',\n};\n\nconst NOTIFICATION_POSITION_CLASS: Record<AvatarNotificationPosition, string> = {\n 'top-left': 'top-0 left-0 -translate-x-1/3 -translate-y-1/3',\n 'top-right': 'top-0 right-0 translate-x-1/3 -translate-y-1/3',\n 'bottom-left': 'bottom-0 left-0 -translate-x-1/3 translate-y-1/3',\n 'bottom-right': 'bottom-0 right-0 translate-x-1/3 translate-y-1/3',\n};\n\n/**\n * Avatar —— 头像组件。\n * 展示图片头像;未配置(或加载失败)时回退为 `name` 的关键字母。\n * 支持自定义边框形态 / 颜色 / 线型、mask 环状边框(中间区域透明度可控)\n * 以及四角 notification 短描述(计数 / 文本 / 圆点)。\n */\nconst Avatar: React.FC<AvatarProps> = ({\n src,\n alt,\n name,\n size = 40,\n shape = 'circle',\n radius,\n borderWidth,\n borderColor,\n borderStyle = 'solid',\n maskBorder,\n centerOpacity = 1,\n notificationPosition = 'top-right',\n notification,\n notificationColor = 'var(--color-error)',\n className = '',\n style,\n onClick,\n}) => {\n const px = typeof size === 'number' ? `${size}px` : size;\n const [imgFailed, setImgFailed] = React.useState(false);\n React.useEffect(() => setImgFailed(false), [src]);\n\n const showImage = Boolean(src) && !imgFailed;\n const initials = name ? initialsOf(name) : '';\n const fontSize = `calc(${px} * 0.36)`;\n\n const shapeStyle: React.CSSProperties = shape === 'square' ? { borderRadius: radius ?? '0.5rem' } : {};\n const ringWidth = borderWidth === undefined ? (maskBorder ? '2px' : '0px') : typeof borderWidth === 'number' ? `${borderWidth}px` : borderWidth;\n\n const showNotification = notification !== undefined && notification !== null && notification !== false;\n\n return (\n <span\n className={cn('relative inline-flex shrink-0 leading-none', onClick && 'cursor-pointer', className)}\n style={{ width: px, height: px, ...style }}\n onClick={onClick}\n >\n {/* mask 边框:mask-composite 排除中间区域,只留下覆盖在头像边缘的环 */}\n {maskBorder && (\n <span\n aria-hidden=\"true\"\n className=\"pointer-events-none absolute inset-0 z-10\"\n style={{\n padding: ringWidth,\n background: maskBorder,\n WebkitMask: 'linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0)',\n WebkitMaskComposite: 'xor',\n mask: 'linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0)',\n maskComposite: 'exclude',\n ...shapeStyle,\n } as React.CSSProperties}\n />\n )}\n <span\n className={cn(\n 'relative flex h-full w-full select-none items-center justify-center overflow-hidden bg-base-200 text-center font-semibold text-base-content/70',\n SHAPE_CLASS[shape],\n )}\n style={{\n fontSize,\n opacity: centerOpacity,\n borderWidth: maskBorder ? 0 : ringWidth,\n borderStyle: maskBorder ? undefined : borderStyle,\n borderColor: maskBorder ? undefined : borderColor,\n ...shapeStyle,\n }}\n >\n {showImage ? (\n <img\n src={src}\n alt={alt ?? name ?? ''}\n className=\"h-full w-full object-cover\"\n onError={() => setImgFailed(true)}\n />\n ) : (\n initials\n )}\n </span>\n {showNotification && (\n <span\n className={cn(\n 'absolute z-20 flex items-center justify-center rounded-full border-2 border-base-100 font-bold leading-none text-white',\n NOTIFICATION_POSITION_CLASS[notificationPosition],\n notification === true ? 'h-3 w-3 p-0' : 'h-[18px] min-w-[18px] px-1 text-[10px]',\n )}\n style={{ backgroundColor: notificationColor }}\n >\n {notification === true ? '' : notification}\n </span>\n )}\n </span>\n );\n};\n\nexport default Avatar;\n"],"mappings":";;;;AA6CA,IAAM,KAAc,MAAyB;CAC3C,IAAM,IAAQ,EAAK,KAAK,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,OAAO,OAAO;CAErD,OADI,EAAM,UAAU,KAAW,EAAM,EAAE,CAAC,KAAK,EAAM,EAAE,CAAC,GAAA,CAAI,YAAY,IAC/D,EAAK,KAAK,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,YAAY;AAC7C,GAEM,IAA2C;CAC/C,QAAQ;CACR,QAAQ;CACR,UAAU;AACZ,GAEM,IAA0E;CAC9E,YAAY;CACZ,aAAa;CACb,eAAe;CACf,gBAAgB;AAClB,GAQM,KAAiC,EACrC,QACA,QACA,SACA,UAAO,IACP,WAAQ,UACR,WACA,gBACA,gBACA,iBAAc,SACd,eACA,mBAAgB,GAChB,0BAAuB,aACvB,iBACA,uBAAoB,sBACpB,eAAY,IACZ,UACA,iBACI;CACJ,IAAM,IAAK,OAAO,KAAS,WAAW,GAAG,EAAK,MAAM,GAC9C,CAAC,GAAW,KAAgB,EAAM,SAAS,EAAK;CACtD,EAAM,gBAAgB,EAAa,EAAK,GAAG,CAAC,CAAG,CAAC;CAEhD,IAAM,IAAY,EAAQ,KAAQ,CAAC,GAC7B,IAAW,IAAO,EAAW,CAAI,IAAI,IACrC,IAAW,QAAQ,EAAG,WAEtB,IAAkC,MAAU,WAAW,EAAE,cAAc,KAAU,SAAS,IAAI,CAAC,GAC/F,IAAY,MAAgB,KAAA,IAAa,IAAa,QAAQ,QAAS,OAAO,KAAgB,WAAW,GAAG,EAAY,MAAM,GAE9H,IAAmB,KAA+C,QAAQ,MAAiB;CAEjG,OACE,kBAAC,QAAD;EACE,WAAW,EAAG,8CAA8C,KAAW,kBAAkB,CAAS;EAClG,OAAO;GAAE,OAAO;GAAI,QAAQ;GAAI,GAAG;EAAM;EAChC;EAHX,UAAA;GAMG,KACC,kBAAC,QAAD;IACE,eAAY;IACZ,WAAU;IACV,OAAO;KACL,SAAS;KACT,YAAY;KACZ,YAAY;KACZ,qBAAqB;KACrB,MAAM;KACN,eAAe;KACf,GAAG;IACL;GACD,CAAA;GAEH,kBAAC,QAAD;IACE,WAAW,EACT,kJACA,EAAY,EACd;IACA,OAAO;KACL;KACA,SAAS;KACT,aAAa,IAAa,IAAI;KAC9B,aAAa,IAAa,KAAA,IAAY;KACtC,aAAa,IAAa,KAAA,IAAY;KACtC,GAAG;IACL;IAEC,UAAA,IACC,kBAAC,OAAD;KACO;KACL,KAAK,KAAO,KAAQ;KACpB,WAAU;KACV,eAAe,EAAa,EAAI;IACjC,CAAA,IAED;GAEE,CAAA;GACL,KACC,kBAAC,QAAD;IACE,WAAW,EACT,0HACA,EAA4B,IAC5B,MAAiB,KAAO,gBAAgB,wCAC1C;IACA,OAAO,EAAE,iBAAiB,EAAkB;IAE3C,UAAA,MAAiB,KAAO,KAAK;GAC1B,CAAA;EAEJ;;AAEV"}
|
|
@@ -1,20 +1,15 @@
|
|
|
1
|
+
import { cn as e } from "../../utils/cn.js";
|
|
1
2
|
import "react";
|
|
2
3
|
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
].filter(Boolean).join(" ");
|
|
11
|
-
return /* @__PURE__ */ t("div", {
|
|
12
|
-
className: d,
|
|
13
|
-
children: o
|
|
14
|
-
});
|
|
15
|
-
};
|
|
16
|
-
export {
|
|
17
|
-
b as default
|
|
4
|
+
//#region src/components/Badge/index.tsx
|
|
5
|
+
var n = ({ children: n, variant: r = "primary", size: i = "sm", outline: a = !1, className: o = "" }) => {
|
|
6
|
+
let s = r ? `badge-${r}` : "", c = i ? `badge-${i}` : "", l = e("badge", s, c, a ? "badge-outline" : "", o);
|
|
7
|
+
return /* @__PURE__ */ t("div", {
|
|
8
|
+
className: l,
|
|
9
|
+
children: n
|
|
10
|
+
});
|
|
18
11
|
};
|
|
12
|
+
//#endregion
|
|
13
|
+
export { n as default };
|
|
19
14
|
|
|
20
15
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../src/components/Badge/index.tsx"],"sourcesContent":["import React from 'react';\n\nexport type BadgeProps = {\n children: React.ReactNode;\n variant?: 'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'error' | 'ghost';\n size?: 'xs' | 'sm' | 'md' | 'lg';\n outline?: boolean;\n className?: string;\n};\n\nconst Badge: React.FC<BadgeProps> = ({\n children,\n variant = 'primary',\n size = 'sm',\n outline = false,\n className = '',\n}) => {\n const baseClass = 'badge';\n const variantClass = variant ? `badge-${variant}` : '';\n const sizeClass = size ? `badge-${size}` : '';\n const outlineClass = outline ? 'badge-outline' : '';\n \n const badgeClasses =
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/components/Badge/index.tsx"],"sourcesContent":["import React from 'react';\nimport { cn } from '../../utils/cn';\n\nexport type BadgeProps = {\n children: React.ReactNode;\n variant?: 'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'error' | 'ghost';\n size?: 'xs' | 'sm' | 'md' | 'lg';\n outline?: boolean;\n className?: string;\n};\n\nconst Badge: React.FC<BadgeProps> = ({\n children,\n variant = 'primary',\n size = 'sm',\n outline = false,\n className = '',\n}) => {\n const baseClass = 'badge';\n const variantClass = variant ? `badge-${variant}` : '';\n const sizeClass = size ? `badge-${size}` : '';\n const outlineClass = outline ? 'badge-outline' : '';\n \n const badgeClasses = cn(\n baseClass,\n variantClass,\n sizeClass,\n outlineClass,\n className\n );\n\n return (\n <div className={badgeClasses}>\n {children}\n </div>\n );\n};\n\nexport default Badge; "],"mappings":";;;;AAWA,IAAM,KAA+B,EACnC,aACA,aAAU,WACV,UAAO,MACP,aAAU,IACV,eAAY,SACR;CACJ,IACM,IAAe,IAAU,SAAS,MAAY,IAC9C,IAAY,IAAO,SAAS,MAAS,IAGrC,IAAe,EACnB,SACA,GACA,GALmB,IAAU,kBAAkB,IAO/C,CACF;CAEA,OACE,kBAAC,OAAD;EAAK,WAAW;EACb;CACE,CAAA;AAET"}
|
|
@@ -1,91 +1,64 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
let i = "";
|
|
64
|
-
s ? a ? (t === "left" || t === "top") && e && s.top ? i = s.top : (t === "right" || t === "bottom") && l && s.bottom ? i = s.bottom : t === "both" && (e && s.top && (i = s.top), l && s.bottom && (i = s.bottom)) : (t === "left" || t === "top") && e && s.left ? i = s.left : (t === "right" || t === "bottom") && l && s.right ? i = s.right : t === "both" && (e && s.left && (i = s.left), l && s.right && (i = s.right)) : a ? t === "left" || t === "top" ? e && (i = `rounded-t-${o}`) : t === "right" || t === "bottom" ? l && (i = `rounded-b-${o}`) : t === "both" && (e && (i = `rounded-t-${o}`), l && (i = `rounded-b-${o}`)) : t === "left" || t === "top" ? e && (i = `rounded-l-${o}`) : t === "right" || t === "bottom" ? l && (i = `rounded-r-${o}`) : t === "both" && (e && (i = `rounded-l-${o}`), l && (i = `rounded-r-${o}`));
|
|
65
|
-
const g = `${N} join-item ${i}`.trim();
|
|
66
|
-
return $.cloneElement(C, { className: g });
|
|
67
|
-
})
|
|
68
|
-
});
|
|
69
|
-
}, O = ({ children: f, className: a = "" }) => {
|
|
70
|
-
const c = [
|
|
71
|
-
"join-item",
|
|
72
|
-
"flex",
|
|
73
|
-
"items-center",
|
|
74
|
-
"px-4",
|
|
75
|
-
"bg-base-200",
|
|
76
|
-
"border",
|
|
77
|
-
"border-base-300",
|
|
78
|
-
a
|
|
79
|
-
].filter(Boolean).join(" ");
|
|
80
|
-
return /* @__PURE__ */ p("div", {
|
|
81
|
-
className: c,
|
|
82
|
-
children: f
|
|
83
|
-
});
|
|
84
|
-
}, F = K;
|
|
85
|
-
F.Group = M;
|
|
86
|
-
F.GroupSection = O;
|
|
87
|
-
export {
|
|
88
|
-
F as default
|
|
89
|
-
};
|
|
1
|
+
import { cn as e } from "../../utils/cn.js";
|
|
2
|
+
import t, { useCallback as n, useState as r } from "react";
|
|
3
|
+
import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/Button/index.tsx
|
|
5
|
+
var s = ({ children: t, variant: s = "primary", size: c = "sm", outline: l = !1, dash: u = !1, soft: d = !1, active: f = !1, disabled: p = !1, wide: m = !1, block: h = !1, square: g = !1, circle: _ = !1, leftSection: v, rightSection: y, onClick: b, type: x, className: S = "", states: C, initialStateIndex: w = 0, onStateChange: T }) => {
|
|
6
|
+
let [E, D] = r(w), [O, k] = r(0), A = C && C.length > 0, j = A ? C[E] : null, M = n(() => {
|
|
7
|
+
if (A) {
|
|
8
|
+
let e = O + 1, t = (E + 1) % C.length, n = C[t];
|
|
9
|
+
k(e), D(t), T && T(n, e, t);
|
|
10
|
+
}
|
|
11
|
+
b && b();
|
|
12
|
+
}, [
|
|
13
|
+
A,
|
|
14
|
+
C,
|
|
15
|
+
E,
|
|
16
|
+
O,
|
|
17
|
+
T,
|
|
18
|
+
b
|
|
19
|
+
]), N = j?.variant || s, P = A ? /* @__PURE__ */ o(i, { children: [j?.icon && /* @__PURE__ */ a("span", {
|
|
20
|
+
className: "mr-1",
|
|
21
|
+
children: j.icon
|
|
22
|
+
}), j?.label] }) : t, F = N ? `btn-${N}` : "", I = c ? `btn-${c}` : "", L = e("btn", F, I, l ? "btn-outline" : "", u ? "btn-dash" : "", d ? "btn-soft" : "", f || A ? "btn-active" : "", m ? "btn-wide" : "", h ? "btn-block" : "", g ? "btn-square" : "", _ ? "btn-circle" : "", S);
|
|
23
|
+
return /* @__PURE__ */ o("button", {
|
|
24
|
+
type: x,
|
|
25
|
+
className: L,
|
|
26
|
+
disabled: p,
|
|
27
|
+
onClick: M,
|
|
28
|
+
title: A ? `当前状态: ${j?.key} (点击次数: ${O})` : void 0,
|
|
29
|
+
children: [
|
|
30
|
+
!A && v && /* @__PURE__ */ a("span", {
|
|
31
|
+
className: "mr-2",
|
|
32
|
+
children: v
|
|
33
|
+
}),
|
|
34
|
+
P,
|
|
35
|
+
!A && y && /* @__PURE__ */ a("span", {
|
|
36
|
+
className: "ml-2",
|
|
37
|
+
children: y
|
|
38
|
+
})
|
|
39
|
+
]
|
|
40
|
+
});
|
|
41
|
+
}, c = ({ children: n, vertical: r = !1, className: i = "", rounded: o = "none", radius: s = "full", roundedStyle: c }) => {
|
|
42
|
+
let l = e("join", r ? "join-vertical" : "join-horizontal", i), u = o === "none" ? s : "full";
|
|
43
|
+
return /* @__PURE__ */ a("div", {
|
|
44
|
+
className: l,
|
|
45
|
+
children: t.Children.map(n, (e, i) => {
|
|
46
|
+
if (!t.isValidElement(e)) return e;
|
|
47
|
+
let a = e, s = a.props.className || "", l = i === 0, d = i === t.Children.count(n) - 1, f = "";
|
|
48
|
+
c ? r ? (o === "left" || o === "top") && l && c.top ? f = c.top : (o === "right" || o === "bottom") && d && c.bottom ? f = c.bottom : o === "both" && (l && c.top && (f = c.top), d && c.bottom && (f = c.bottom)) : (o === "left" || o === "top") && l && c.left ? f = c.left : (o === "right" || o === "bottom") && d && c.right ? f = c.right : o === "both" && (l && c.left && (f = c.left), d && c.right && (f = c.right)) : r ? o === "left" || o === "top" ? l && (f = `rounded-t-${u}`) : o === "right" || o === "bottom" ? d && (f = `rounded-b-${u}`) : o === "both" && (l && (f = `rounded-t-${u}`), d && (f = `rounded-b-${u}`)) : o === "left" || o === "top" ? l && (f = `rounded-l-${u}`) : o === "right" || o === "bottom" ? d && (f = `rounded-r-${u}`) : o === "both" && (l && (f = `rounded-l-${u}`), d && (f = `rounded-r-${u}`));
|
|
49
|
+
let p = `${s} join-item ${f}`.trim();
|
|
50
|
+
return t.cloneElement(a, { className: p });
|
|
51
|
+
})
|
|
52
|
+
});
|
|
53
|
+
}, l = ({ children: t, className: n = "" }) => {
|
|
54
|
+
let r = e("join-item", "flex", "items-center", "px-4", "bg-base-200", "border", "border-base-300", n);
|
|
55
|
+
return /* @__PURE__ */ a("div", {
|
|
56
|
+
className: r,
|
|
57
|
+
children: t
|
|
58
|
+
});
|
|
59
|
+
}, u = s;
|
|
60
|
+
u.Group = c, u.GroupSection = l;
|
|
61
|
+
//#endregion
|
|
62
|
+
export { u as default };
|
|
90
63
|
|
|
91
64
|
//# sourceMappingURL=index.js.map
|