sparkdesign 0.4.2 → 0.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +112 -204
- package/{cli/dist → dist}/commands/add.js +11 -2
- package/package.json +19 -126
- package/{cli/registry → registry}/chat/markdown.tsx +1 -1
- package/{cli/registry → registry}/chat/tool-invocation-card.tsx +5 -5
- package/registry/meta.json +750 -0
- package/cli/registry/meta.json +0 -1
- package/dist/_basePickBy-DnQN8w3y.js +0 -151
- package/dist/_basePickBy-a-kPMlkg.cjs +0 -1
- package/dist/_baseUniq-B-N2NQ50.js +0 -614
- package/dist/_baseUniq-Cc_zbSif.cjs +0 -1
- package/dist/arc-BQBhijZ6.js +0 -83
- package/dist/arc-mWQt0Yph.cjs +0 -1
- package/dist/architectureDiagram-VXUJARFQ-BMZEucno.cjs +0 -36
- package/dist/architectureDiagram-VXUJARFQ-DTdjD3Bp.js +0 -4661
- package/dist/blockDiagram-VD42YOAC-CzHn0yob.js +0 -2256
- package/dist/blockDiagram-VD42YOAC-DDxdHAlz.cjs +0 -122
- package/dist/c4Diagram-YG6GDRKO-4Gz0I4gj.cjs +0 -10
- package/dist/c4Diagram-YG6GDRKO-BIy--yVN.js +0 -1580
- package/dist/channel-BQn0o8bs.js +0 -5
- package/dist/channel-DaN7XniJ.cjs +0 -1
- package/dist/chunk-4BX2VUAB-BlQFTQqz.cjs +0 -1
- package/dist/chunk-4BX2VUAB-Czitj3Kc.js +0 -8
- package/dist/chunk-55IACEB6-DXacNZbO.js +0 -8
- package/dist/chunk-55IACEB6-DnDxpye9.cjs +0 -1
- package/dist/chunk-B4BG7PRW-CBdN0q_V.js +0 -1375
- package/dist/chunk-B4BG7PRW-DbGvUkGO.cjs +0 -165
- package/dist/chunk-DI55MBZ5-D1YJMs6x.cjs +0 -220
- package/dist/chunk-DI55MBZ5-NCQTvayw.js +0 -1370
- package/dist/chunk-FMBD7UC4-CsGMbrtr.js +0 -19
- package/dist/chunk-FMBD7UC4-Di7cUUh5.cjs +0 -15
- package/dist/chunk-QN33PNHL-0j5LC8Lm.cjs +0 -1
- package/dist/chunk-QN33PNHL-3GERZBRm.js +0 -19
- package/dist/chunk-QZHKN3VN-AVEY9ImQ.js +0 -15
- package/dist/chunk-QZHKN3VN-s8Z0a8mc.cjs +0 -1
- package/dist/chunk-TZMSLE5B-CAf87HPt.cjs +0 -1
- package/dist/chunk-TZMSLE5B-sbiflal0.js +0 -64
- package/dist/classDiagram-2ON5EDUG-Ct9JLIN2.cjs +0 -1
- package/dist/classDiagram-2ON5EDUG-Dzfrft3a.js +0 -16
- package/dist/classDiagram-v2-WZHVMYZB-Ct9JLIN2.cjs +0 -1
- package/dist/classDiagram-v2-WZHVMYZB-Dzfrft3a.js +0 -16
- package/dist/clone-Cde_NQ8V.js +0 -8
- package/dist/clone-DCNjWuM2.cjs +0 -1
- package/dist/cose-bilkent-S5V4N54A-0uLijMro.cjs +0 -1
- package/dist/cose-bilkent-S5V4N54A-Bb08N431.js +0 -2608
- package/dist/cytoscape.esm-CNUX3VTg.cjs +0 -321
- package/dist/cytoscape.esm-Cvf3sx9F.js +0 -18704
- package/dist/dagre-6UL2VRFP-CY_Wz5Zd.js +0 -444
- package/dist/dagre-6UL2VRFP-Dxe7_qZc.cjs +0 -4
- package/dist/defaultLocale-BgPVtth8.js +0 -171
- package/dist/defaultLocale-C4wbwF1n.cjs +0 -1
- package/dist/diagram-PSM6KHXK-D2bdb7MT.js +0 -531
- package/dist/diagram-PSM6KHXK-YF69SUjY.cjs +0 -24
- package/dist/diagram-QEK2KX5R-BpUSoh0-.js +0 -217
- package/dist/diagram-QEK2KX5R-DZPGteon.cjs +0 -43
- package/dist/diagram-S2PKOQOG-ht-zdvFG.cjs +0 -24
- package/dist/diagram-S2PKOQOG-zFeLJ50Z.js +0 -142
- package/dist/erDiagram-Q2GNP2WA-B38iJ6ts.js +0 -841
- package/dist/erDiagram-Q2GNP2WA-RgS80DDU.cjs +0 -60
- package/dist/flowDiagram-NV44I4VS-BHilOs2p.cjs +0 -162
- package/dist/flowDiagram-NV44I4VS-BrBJcoce.js +0 -1620
- package/dist/fonts/KaTeX_AMS-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_AMS-Regular.woff +0 -0
- package/dist/fonts/KaTeX_AMS-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Caligraphic-Bold.ttf +0 -0
- package/dist/fonts/KaTeX_Caligraphic-Bold.woff +0 -0
- package/dist/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
- package/dist/fonts/KaTeX_Caligraphic-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Caligraphic-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Fraktur-Bold.ttf +0 -0
- package/dist/fonts/KaTeX_Fraktur-Bold.woff +0 -0
- package/dist/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
- package/dist/fonts/KaTeX_Fraktur-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Fraktur-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Main-Bold.ttf +0 -0
- package/dist/fonts/KaTeX_Main-Bold.woff +0 -0
- package/dist/fonts/KaTeX_Main-Bold.woff2 +0 -0
- package/dist/fonts/KaTeX_Main-BoldItalic.ttf +0 -0
- package/dist/fonts/KaTeX_Main-BoldItalic.woff +0 -0
- package/dist/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
- package/dist/fonts/KaTeX_Main-Italic.ttf +0 -0
- package/dist/fonts/KaTeX_Main-Italic.woff +0 -0
- package/dist/fonts/KaTeX_Main-Italic.woff2 +0 -0
- package/dist/fonts/KaTeX_Main-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Main-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Main-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Math-BoldItalic.ttf +0 -0
- package/dist/fonts/KaTeX_Math-BoldItalic.woff +0 -0
- package/dist/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
- package/dist/fonts/KaTeX_Math-Italic.ttf +0 -0
- package/dist/fonts/KaTeX_Math-Italic.woff +0 -0
- package/dist/fonts/KaTeX_Math-Italic.woff2 +0 -0
- package/dist/fonts/KaTeX_SansSerif-Bold.ttf +0 -0
- package/dist/fonts/KaTeX_SansSerif-Bold.woff +0 -0
- package/dist/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
- package/dist/fonts/KaTeX_SansSerif-Italic.ttf +0 -0
- package/dist/fonts/KaTeX_SansSerif-Italic.woff +0 -0
- package/dist/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
- package/dist/fonts/KaTeX_SansSerif-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_SansSerif-Regular.woff +0 -0
- package/dist/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Script-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Script-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Script-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Size1-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Size1-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Size1-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Size2-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Size2-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Size2-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Size3-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Size3-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Size3-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Size4-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Size4-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Size4-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Typewriter-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Typewriter-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
- package/dist/ganttDiagram-JELNMOA3-pZiJeFio.cjs +0 -267
- package/dist/ganttDiagram-JELNMOA3-tw6FhkWJ.js +0 -2670
- package/dist/gitGraphDiagram-V2S2FVAM-BWn5uIK5.js +0 -699
- package/dist/gitGraphDiagram-V2S2FVAM-DKKeG-9R.cjs +0 -65
- package/dist/graph-DIbblrZP.cjs +0 -1
- package/dist/graph-DPcK91G3.js +0 -247
- package/dist/infoDiagram-HS3SLOUP-B8gwwhct.cjs +0 -2
- package/dist/infoDiagram-HS3SLOUP-D47PNcP_.js +0 -24
- package/dist/init-CHZsXQcr.cjs +0 -1
- package/dist/init-DjUOC4st.js +0 -16
- package/dist/journeyDiagram-XKPGCS4Q-BG3cfhyU.js +0 -834
- package/dist/journeyDiagram-XKPGCS4Q-D8DVLJof.cjs +0 -139
- package/dist/kanban-definition-3W4ZIXB7-4OCnEouP.cjs +0 -89
- package/dist/kanban-definition-3W4ZIXB7-CWi_ssF9.js +0 -719
- package/dist/katex.css +0 -1
- package/dist/layout-Byuh8f-J.cjs +0 -1
- package/dist/layout-CdLdvj1j.js +0 -1335
- package/dist/linear-C2Q_PI9B.js +0 -259
- package/dist/linear-C69aPBW1.cjs +0 -1
- package/dist/mermaid.core-DBwAx_jp.cjs +0 -249
- package/dist/mermaid.core-gFR0XUlD.js +0 -15300
- package/dist/mindmap-definition-VGOIOE7T-8P7obVV4.cjs +0 -68
- package/dist/mindmap-definition-VGOIOE7T-DnOa7WJ9.js +0 -784
- package/dist/ordinal-B6-f3MAq.js +0 -61
- package/dist/ordinal-CagbB1m8.cjs +0 -1
- package/dist/pieDiagram-ADFJNKIX-5NAlvhMo.js +0 -161
- package/dist/pieDiagram-ADFJNKIX-CQBG4yR9.cjs +0 -30
- package/dist/qoder-design.css +0 -2
- package/dist/quadrantDiagram-AYHSOK5B-Oe4y7RZ0.cjs +0 -7
- package/dist/quadrantDiagram-AYHSOK5B-rh2DPEP1.js +0 -1022
- package/dist/registry/basic/alert-dialog.d.ts +0 -40
- package/dist/registry/basic/avatar.d.ts +0 -30
- package/dist/registry/basic/button.d.ts +0 -16
- package/dist/registry/basic/collapse.d.ts +0 -22
- package/dist/registry/basic/collapsible-card.d.ts +0 -34
- package/dist/registry/basic/collapsible.d.ts +0 -15
- package/dist/registry/basic/dropdown-menu.d.ts +0 -52
- package/dist/registry/basic/icon-button.d.ts +0 -12
- package/dist/registry/basic/icons-inline.d.ts +0 -51
- package/dist/registry/basic/kbd.d.ts +0 -23
- package/dist/registry/basic/option-list.d.ts +0 -16
- package/dist/registry/basic/pagination.d.ts +0 -33
- package/dist/registry/basic/progress.d.ts +0 -18
- package/dist/registry/basic/radio-group.d.ts +0 -25
- package/dist/registry/basic/resizable.d.ts +0 -318
- package/dist/registry/basic/scrollbar.d.ts +0 -12
- package/dist/registry/basic/select.d.ts +0 -35
- package/dist/registry/basic/shimmering-text.d.ts +0 -27
- package/dist/registry/basic/sidebar-menu.d.ts +0 -23
- package/dist/registry/basic/skeleton.d.ts +0 -10
- package/dist/registry/basic/slider.d.ts +0 -16
- package/dist/registry/basic/sonner.d.ts +0 -23
- package/dist/registry/basic/spinner.d.ts +0 -5
- package/dist/registry/basic/switch.d.ts +0 -20
- package/dist/registry/basic/table.d.ts +0 -18
- package/dist/registry/basic/tabs.d.ts +0 -29
- package/dist/registry/basic/tag.d.ts +0 -23
- package/dist/registry/basic/theme-from-document.d.ts +0 -10
- package/dist/registry/basic/toggle.d.ts +0 -29
- package/dist/registry/basic/tooltip.d.ts +0 -34
- package/dist/registry/basic/typography.d.ts +0 -76
- package/dist/registry/chat/ask-user-part.d.ts +0 -24
- package/dist/registry/chat/browser-action-part.d.ts +0 -28
- package/dist/registry/chat/chat-input/chat-input-folder-selector.d.ts +0 -22
- package/dist/registry/chat/chat-input/chat-input-model-switcher.d.ts +0 -12
- package/dist/registry/chat/chat-input/chat-input-textarea.d.ts +0 -9
- package/dist/registry/chat/chat-input/compound.d.ts +0 -97
- package/dist/registry/chat/chat-input/context.d.ts +0 -64
- package/dist/registry/chat/chat-input/folder-permission-dialog.d.ts +0 -11
- package/dist/registry/chat/chat-input/index.d.ts +0 -34
- package/dist/registry/chat/chat-input/types.d.ts +0 -79
- package/dist/registry/chat/chat-input/useAutoResizeTextarea.d.ts +0 -7
- package/dist/registry/chat/code-block-part.d.ts +0 -23
- package/dist/registry/chat/file-attachment.d.ts +0 -19
- package/dist/registry/chat/file-card.d.ts +0 -10
- package/dist/registry/chat/file-review-part.d.ts +0 -30
- package/dist/registry/chat/folder-button.d.ts +0 -20
- package/dist/registry/chat/generated-images-grid.d.ts +0 -15
- package/dist/registry/chat/generation-status-bar.d.ts +0 -19
- package/dist/registry/chat/hint-banner.d.ts +0 -28
- package/dist/registry/chat/image-attachment.d.ts +0 -19
- package/dist/registry/chat/image-generating.d.ts +0 -15
- package/dist/registry/chat/markdown.d.ts +0 -8
- package/dist/registry/chat/mermaid-part.d.ts +0 -17
- package/dist/registry/chat/permission-card.d.ts +0 -24
- package/dist/registry/chat/plan-part.d.ts +0 -30
- package/dist/registry/chat/queue-indicator.d.ts +0 -27
- package/dist/registry/chat/reasoning-step/compound.d.ts +0 -17
- package/dist/registry/chat/reasoning-step/context.d.ts +0 -10
- package/dist/registry/chat/reasoning-step/index.d.ts +0 -14
- package/dist/registry/chat/reasoning-step/types.d.ts +0 -95
- package/dist/registry/chat/related-prompts.d.ts +0 -23
- package/dist/registry/chat/response/compound.d.ts +0 -25
- package/dist/registry/chat/response/context.d.ts +0 -9
- package/dist/registry/chat/response/index.d.ts +0 -15
- package/dist/registry/chat/response/types.d.ts +0 -99
- package/dist/registry/chat/send-button.d.ts +0 -17
- package/dist/registry/chat/streaming-markdown-block.d.ts +0 -8
- package/dist/registry/chat/task-part.d.ts +0 -28
- package/dist/registry/chat/terminal-code-block-part.d.ts +0 -18
- package/dist/registry/chat/thinking-indicator.d.ts +0 -14
- package/dist/registry/chat/tool-invocation-card.d.ts +0 -20
- package/dist/registry/chat/user-message.d.ts +0 -6
- package/dist/registry/chat/user-question/UserQuestionCard.d.ts +0 -30
- package/dist/registry/chat/user-question/UserQuestionFooter.d.ts +0 -18
- package/dist/registry/chat/user-question/UserQuestionHeader.d.ts +0 -20
- package/dist/registry/chat/user-question/compound.d.ts +0 -37
- package/dist/registry/chat/user-question/context.d.ts +0 -55
- package/dist/registry/chat/user-question/index.d.ts +0 -15
- package/dist/registry/chat/user-question/types.d.ts +0 -52
- package/dist/registry/chat/user-question/useUserQuestionKeyboard.d.ts +0 -17
- package/dist/registry/chat/user-question/useUserQuestionState.d.ts +0 -26
- package/dist/registry/chat/user-question-answer.d.ts +0 -13
- package/dist/registry/lib/file-icon-maps.d.ts +0 -20
- package/dist/registry/lib/use-mermaid-render.d.ts +0 -5
- package/dist/registry/lib/utils.d.ts +0 -11
- package/dist/requirementDiagram-UZGBJVZJ-DcWaCuXr.js +0 -850
- package/dist/requirementDiagram-UZGBJVZJ-gfdlrFiq.cjs +0 -64
- package/dist/sankeyDiagram-TZEHDZUN-CQIKFwD0.js +0 -810
- package/dist/sankeyDiagram-TZEHDZUN-DvPtzQvC.cjs +0 -10
- package/dist/scale/computed.css +0 -103
- package/dist/scale/config.css +0 -110
- package/dist/scale/index.css +0 -30
- package/dist/scale/presets/compact.css +0 -30
- package/dist/scale/presets/dense.css +0 -64
- package/dist/scale/presets/sharp.css +0 -40
- package/dist/scale/presets/soft.css +0 -16
- package/dist/scale.css +0 -13
- package/dist/sequenceDiagram-WL72ISMW-BNrsMagL.cjs +0 -145
- package/dist/sequenceDiagram-WL72ISMW-iCX3ckKx.js +0 -2511
- package/dist/spark-design.cjs.js +0 -265
- package/dist/spark-design.es.js +0 -13425
- package/dist/src/components/basic/AlertDialog/index.d.ts +0 -20
- package/dist/src/components/basic/Avatar/index.d.ts +0 -7
- package/dist/src/components/basic/Button/index.d.ts +0 -7
- package/dist/src/components/basic/Collapse/index.d.ts +0 -15
- package/dist/src/components/basic/Collapsible/index.d.ts +0 -7
- package/dist/src/components/basic/CollapsibleCard/index.d.ts +0 -7
- package/dist/src/components/basic/CollapsibleSection/index.d.ts +0 -43
- package/dist/src/components/basic/DropdownMenu/index.d.ts +0 -19
- package/dist/src/components/basic/EllipsisText/index.d.ts +0 -53
- package/dist/src/components/basic/IconButton/index.d.ts +0 -7
- package/dist/src/components/basic/Kbd/index.d.ts +0 -7
- package/dist/src/components/basic/OptionList/index.d.ts +0 -7
- package/dist/src/components/basic/Pagination/index.d.ts +0 -7
- package/dist/src/components/basic/Progress/index.d.ts +0 -7
- package/dist/src/components/basic/RadioGroup/index.d.ts +0 -7
- package/dist/src/components/basic/Resizable/index.d.ts +0 -7
- package/dist/src/components/basic/Scrollbar/index.d.ts +0 -7
- package/dist/src/components/basic/Select/index.d.ts +0 -17
- package/dist/src/components/basic/ShimmeringText/index.d.ts +0 -7
- package/dist/src/components/basic/SidebarMenu/index.d.ts +0 -4
- package/dist/src/components/basic/Skeleton/index.d.ts +0 -7
- package/dist/src/components/basic/Slider/index.d.ts +0 -7
- package/dist/src/components/basic/Spinner/index.d.ts +0 -7
- package/dist/src/components/basic/Switch/index.d.ts +0 -38
- package/dist/src/components/basic/Table/index.d.ts +0 -7
- package/dist/src/components/basic/Tabs/index.d.ts +0 -7
- package/dist/src/components/basic/Tag/index.d.ts +0 -10
- package/dist/src/components/basic/Toast/index.d.ts +0 -12
- package/dist/src/components/basic/Toggle/index.d.ts +0 -7
- package/dist/src/components/basic/Tooltip/index.d.ts +0 -21
- package/dist/src/components/basic/Typography/index.d.ts +0 -7
- package/dist/src/components/chat/AskUserPart/index.d.ts +0 -6
- package/dist/src/components/chat/BrowserActionPart/index.d.ts +0 -7
- package/dist/src/components/chat/ChatInput/index.d.ts +0 -29
- package/dist/src/components/chat/CodeBlockPart/index.d.ts +0 -7
- package/dist/src/components/chat/FileAttachment/index.d.ts +0 -3
- package/dist/src/components/chat/FileCard/index.d.ts +0 -3
- package/dist/src/components/chat/FileReviewPart/index.d.ts +0 -7
- package/dist/src/components/chat/FolderButton/index.d.ts +0 -5
- package/dist/src/components/chat/GeneratedImagesGrid/index.d.ts +0 -7
- package/dist/src/components/chat/GenerationStatusBar/index.d.ts +0 -7
- package/dist/src/components/chat/HintBanner/index.d.ts +0 -6
- package/dist/src/components/chat/ImageAttachment/index.d.ts +0 -3
- package/dist/src/components/chat/ImageGenerating/index.d.ts +0 -6
- package/dist/src/components/chat/Markdown/demo-content.d.ts +0 -1
- package/dist/src/components/chat/Markdown/index.d.ts +0 -7
- package/dist/src/components/chat/MermaidPart/index.d.ts +0 -6
- package/dist/src/components/chat/PermissionCard/index.d.ts +0 -4
- package/dist/src/components/chat/PlanPart/index.d.ts +0 -6
- package/dist/src/components/chat/QueueIndicator/index.d.ts +0 -4
- package/dist/src/components/chat/ReasoningStep/index.d.ts +0 -13
- package/dist/src/components/chat/RelatedPrompts/index.d.ts +0 -6
- package/dist/src/components/chat/Response/StreamingMarkdownBlock.d.ts +0 -6
- package/dist/src/components/chat/Response/index.d.ts +0 -16
- package/dist/src/components/chat/SendButton/index.d.ts +0 -5
- package/dist/src/components/chat/TaskPart/index.d.ts +0 -7
- package/dist/src/components/chat/TerminalCodeBlockPart/index.d.ts +0 -6
- package/dist/src/components/chat/ThinkingIndicator/index.d.ts +0 -6
- package/dist/src/components/chat/ToolInvocationCard/index.d.ts +0 -4
- package/dist/src/components/chat/UserMessage/index.d.ts +0 -7
- package/dist/src/components/chat/UserQuestion/index.d.ts +0 -19
- package/dist/src/components/chat/UserQuestionAnswer/index.d.ts +0 -3
- package/dist/src/components/index.d.ts +0 -138
- package/dist/src/icons/context.d.ts +0 -26
- package/dist/src/icons/types.d.ts +0 -18
- package/dist/src/lib/ThemeStyleContext.d.ts +0 -21
- package/dist/src/lib/file-icon.d.ts +0 -16
- package/dist/src/lib/i18n.d.ts +0 -12
- package/dist/src/lib/index.d.ts +0 -10
- package/dist/src/lib/motion.d.ts +0 -22
- package/dist/src/lib/utils.d.ts +0 -11
- package/dist/stateDiagram-FKZM4ZOC-DBvJ_eeL.cjs +0 -1
- package/dist/stateDiagram-FKZM4ZOC-ZVsJlaHJ.js +0 -263
- package/dist/stateDiagram-v2-4FDKWEC3-CB_nTHcE.js +0 -16
- package/dist/stateDiagram-v2-4FDKWEC3-Xkx17v6T.cjs +0 -1
- package/dist/theme-base.css +0 -270
- package/dist/theme.css +0 -17
- package/dist/themes/dark-parchment.css +0 -133
- package/dist/themes/dark-qoder.css +0 -133
- package/dist/themes/light-parchment.css +0 -124
- package/dist/themes/light-qoder.css +0 -132
- package/dist/timeline-definition-IT6M3QCI-BmGkYQiz.cjs +0 -61
- package/dist/timeline-definition-IT6M3QCI-Ck8zTt6w.js +0 -795
- package/dist/tokens/CLAUDE.md +0 -305
- package/dist/tokens/index.css +0 -35
- package/dist/tokens/scale/computed.css +0 -103
- package/dist/tokens/scale/config.css +0 -110
- package/dist/tokens/scale/index.css +0 -30
- package/dist/tokens/scale/presets/compact.css +0 -30
- package/dist/tokens/scale/presets/dense.css +0 -64
- package/dist/tokens/scale/presets/sharp.css +0 -40
- package/dist/tokens/scale/presets/soft.css +0 -16
- package/dist/tokens/scale.css +0 -13
- package/dist/tokens/scrollbar-utility.css +0 -35
- package/dist/tokens/theme-base.css +0 -270
- package/dist/tokens/theme.css +0 -17
- package/dist/tokens/themes/dark-parchment.css +0 -133
- package/dist/tokens/themes/dark-qoder.css +0 -133
- package/dist/tokens/themes/light-parchment.css +0 -124
- package/dist/tokens/themes/light-qoder.css +0 -132
- package/dist/treemap-GDKQZRPO-B9sfERx8.js +0 -17922
- package/dist/treemap-GDKQZRPO-BVfJRs0Z.cjs +0 -160
- package/dist/xychartDiagram-PRI3JC2R-By_S8NzN.js +0 -1340
- package/dist/xychartDiagram-PRI3JC2R-CNfDrGxM.cjs +0 -7
- /package/{cli/dist → dist}/commands/diff.js +0 -0
- /package/{cli/dist → dist}/commands/init.js +0 -0
- /package/{cli/dist → dist}/commands/list.js +0 -0
- /package/{cli/dist → dist}/index.js +0 -0
- /package/{cli/dist → dist}/utils/config.js +0 -0
- /package/{cli/dist → dist}/utils/registry.js +0 -0
- /package/{cli/dist → dist}/utils/tokens.js +0 -0
- /package/{cli/dist → dist}/utils/transform.js +0 -0
- /package/{cli/registry → registry}/__tests__/basic/button.test.tsx +0 -0
- /package/{cli/registry → registry}/__tests__/chat/markdown.test.tsx +0 -0
- /package/{cli/registry → registry}/__tests__/chat/thinking-indicator.test.tsx +0 -0
- /package/{cli/registry → registry}/__tests__/chat/tool-invocation-card.test.tsx +0 -0
- /package/{cli/registry → registry}/basic/alert-dialog.tsx +0 -0
- /package/{cli/registry → registry}/basic/avatar.tsx +0 -0
- /package/{cli/registry → registry}/basic/button.tsx +0 -0
- /package/{cli/registry → registry}/basic/collapse.tsx +0 -0
- /package/{cli/registry → registry}/basic/collapsible-card.tsx +0 -0
- /package/{cli/registry → registry}/basic/collapsible.tsx +0 -0
- /package/{cli/registry → registry}/basic/dropdown-menu.tsx +0 -0
- /package/{cli/registry → registry}/basic/icon-button.tsx +0 -0
- /package/{cli/registry → registry}/basic/icons-inline.tsx +0 -0
- /package/{cli/registry → registry}/basic/kbd.tsx +0 -0
- /package/{cli/registry → registry}/basic/option-list.tsx +0 -0
- /package/{cli/registry → registry}/basic/pagination.tsx +0 -0
- /package/{cli/registry → registry}/basic/progress.tsx +0 -0
- /package/{cli/registry → registry}/basic/radio-group.tsx +0 -0
- /package/{cli/registry → registry}/basic/resizable.tsx +0 -0
- /package/{cli/registry → registry}/basic/scrollbar.tsx +0 -0
- /package/{cli/registry → registry}/basic/select.tsx +0 -0
- /package/{cli/registry → registry}/basic/shimmering-text.tsx +0 -0
- /package/{cli/registry → registry}/basic/sidebar-menu.tsx +0 -0
- /package/{cli/registry → registry}/basic/skeleton.tsx +0 -0
- /package/{cli/registry → registry}/basic/slider.tsx +0 -0
- /package/{cli/registry → registry}/basic/sonner.tsx +0 -0
- /package/{cli/registry → registry}/basic/spinner.tsx +0 -0
- /package/{cli/registry → registry}/basic/switch.tsx +0 -0
- /package/{cli/registry → registry}/basic/table.tsx +0 -0
- /package/{cli/registry → registry}/basic/tabs.tsx +0 -0
- /package/{cli/registry → registry}/basic/tag.tsx +0 -0
- /package/{cli/registry → registry}/basic/theme-from-document.ts +0 -0
- /package/{cli/registry → registry}/basic/toggle.tsx +0 -0
- /package/{cli/registry → registry}/basic/tooltip.tsx +0 -0
- /package/{cli/registry → registry}/basic/typography.tsx +0 -0
- /package/{cli/registry → registry}/chat/ask-user-part.tsx +0 -0
- /package/{cli/registry → registry}/chat/browser-action-part.tsx +0 -0
- /package/{cli/registry → registry}/chat/chat-input/chat-input-folder-selector.tsx +0 -0
- /package/{cli/registry → registry}/chat/chat-input/chat-input-model-switcher.tsx +0 -0
- /package/{cli/registry → registry}/chat/chat-input/chat-input-textarea.tsx +0 -0
- /package/{cli/registry → registry}/chat/chat-input/compound.tsx +0 -0
- /package/{cli/registry → registry}/chat/chat-input/context.tsx +0 -0
- /package/{cli/registry → registry}/chat/chat-input/folder-permission-dialog.tsx +0 -0
- /package/{cli/registry → registry}/chat/chat-input/index.tsx +0 -0
- /package/{cli/registry → registry}/chat/chat-input/types.ts +0 -0
- /package/{cli/registry → registry}/chat/chat-input/useAutoResizeTextarea.ts +0 -0
- /package/{cli/registry → registry}/chat/code-block-part.tsx +0 -0
- /package/{cli/registry → registry}/chat/file-attachment.tsx +0 -0
- /package/{cli/registry → registry}/chat/file-card.tsx +0 -0
- /package/{cli/registry → registry}/chat/file-review-part.tsx +0 -0
- /package/{cli/registry → registry}/chat/folder-button.tsx +0 -0
- /package/{cli/registry → registry}/chat/generated-images-grid.tsx +0 -0
- /package/{cli/registry → registry}/chat/generation-status-bar.tsx +0 -0
- /package/{cli/registry → registry}/chat/hint-banner.tsx +0 -0
- /package/{cli/registry → registry}/chat/image-attachment.tsx +0 -0
- /package/{cli/registry → registry}/chat/image-generating.tsx +0 -0
- /package/{cli/registry → registry}/chat/mermaid-part.tsx +0 -0
- /package/{cli/registry → registry}/chat/permission-card.tsx +0 -0
- /package/{cli/registry → registry}/chat/plan-part.tsx +0 -0
- /package/{cli/registry → registry}/chat/queue-indicator.tsx +0 -0
- /package/{cli/registry → registry}/chat/reasoning-step/compound.tsx +0 -0
- /package/{cli/registry → registry}/chat/reasoning-step/context.tsx +0 -0
- /package/{cli/registry → registry}/chat/reasoning-step/index.tsx +0 -0
- /package/{cli/registry → registry}/chat/reasoning-step/types.ts +0 -0
- /package/{cli/registry → registry}/chat/related-prompts.tsx +0 -0
- /package/{cli/registry → registry}/chat/response/compound.tsx +0 -0
- /package/{cli/registry → registry}/chat/response/context.tsx +0 -0
- /package/{cli/registry → registry}/chat/response/index.tsx +0 -0
- /package/{cli/registry → registry}/chat/response/types.ts +0 -0
- /package/{cli/registry → registry}/chat/send-button.tsx +0 -0
- /package/{cli/registry → registry}/chat/streaming-markdown-block.tsx +0 -0
- /package/{cli/registry → registry}/chat/task-part.tsx +0 -0
- /package/{cli/registry → registry}/chat/terminal-code-block-part.tsx +0 -0
- /package/{cli/registry → registry}/chat/thinking-indicator.tsx +0 -0
- /package/{cli/registry → registry}/chat/user-message.tsx +0 -0
- /package/{cli/registry → registry}/chat/user-question/UserQuestionCard.tsx +0 -0
- /package/{cli/registry → registry}/chat/user-question/UserQuestionFooter.tsx +0 -0
- /package/{cli/registry → registry}/chat/user-question/UserQuestionHeader.tsx +0 -0
- /package/{cli/registry → registry}/chat/user-question/compound.tsx +0 -0
- /package/{cli/registry → registry}/chat/user-question/context.tsx +0 -0
- /package/{cli/registry → registry}/chat/user-question/index.tsx +0 -0
- /package/{cli/registry → registry}/chat/user-question/types.ts +0 -0
- /package/{cli/registry → registry}/chat/user-question/useUserQuestionKeyboard.ts +0 -0
- /package/{cli/registry → registry}/chat/user-question/useUserQuestionState.ts +0 -0
- /package/{cli/registry → registry}/chat/user-question-answer.tsx +0 -0
- /package/{cli/registry → registry}/lib/file-icon-maps.ts +0 -0
- /package/{cli/registry → registry}/lib/use-mermaid-render.ts +0 -0
- /package/{cli/registry → registry}/lib/utils.ts +0 -0
- /package/{cli/registry → registry}/tokens/index.css +0 -0
- /package/{cli/registry → registry}/tokens/scale/computed.css +0 -0
- /package/{cli/registry → registry}/tokens/scale/config.css +0 -0
- /package/{cli/registry → registry}/tokens/scale/index.css +0 -0
- /package/{cli/registry → registry}/tokens/scale/presets/compact.css +0 -0
- /package/{cli/registry → registry}/tokens/scale/presets/dense.css +0 -0
- /package/{cli/registry → registry}/tokens/scale/presets/sharp.css +0 -0
- /package/{cli/registry → registry}/tokens/scale/presets/soft.css +0 -0
- /package/{cli/registry → registry}/tokens/scale.css +0 -0
- /package/{cli/registry → registry}/tokens/scrollbar-utility.css +0 -0
- /package/{cli/registry → registry}/tokens/theme.css +0 -0
- /package/{cli/registry → registry}/tokens/themes/dark-parchment.css +0 -0
- /package/{cli/registry → registry}/tokens/themes/dark-qoder.css +0 -0
- /package/{cli/registry → registry}/tokens/themes/light-parchment.css +0 -0
- /package/{cli/registry → registry}/tokens/themes/light-qoder.css +0 -0
package/README.md
CHANGED
|
@@ -1,285 +1,193 @@
|
|
|
1
|
-
#
|
|
1
|
+
# sparkdesign
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Spark Design 按需引入 CLI:将组件**源码**复制到当前项目,支持在项目内自由修改。
|
|
4
4
|
|
|
5
|
-
**当前版本**:`0.
|
|
5
|
+
**当前版本**:`0.1.6` · 设计系统主包:[sparkdesign](https://www.npmjs.com/package/sparkdesign)
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
---
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
## 快速开始
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
### 步骤 1:添加组件
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
- **5 种布局风格**:neutral / compact / soft / sharp / dense
|
|
15
|
-
- **内置颜色主题**:light / dark
|
|
16
|
-
- **CSS 变量驱动**:组件仅用 token,覆盖变量即可定制
|
|
17
|
-
- **Tailwind 友好**:类名与设计 token 映射,无硬编码色值
|
|
18
|
-
- **组件分层**:Basic 原子组件 + Chat 对话组件,开箱即用
|
|
13
|
+
在项目根目录执行:
|
|
19
14
|
|
|
20
|
-
|
|
15
|
+
```bash
|
|
16
|
+
npx sparkdesign add button
|
|
17
|
+
```
|
|
21
18
|
|
|
22
|
-
|
|
23
|
-
|------|----------|------|
|
|
24
|
-
| **npm 安装** | 直接引用、不改源码 | `npm install sparkdesign` |
|
|
25
|
-
| **CLI 按需引入** | 复制源码到项目、可自由修改 | `npx sparkdesign init` → `npx sparkdesign add button` |
|
|
19
|
+
添加多个组件时在命令后追加组件名,例如:`npx sparkdesign add button tooltip dropdown-menu`。
|
|
26
20
|
|
|
27
|
-
|
|
21
|
+
> 输出目录由 **components.json** 的 `aliases.ui` 决定(默认 `@/components/ui` → `src/components/ui/`)。执行 add 时会在终端打印当前配置与目标目录,修改 `components.json` 后再次 add 即可生效。
|
|
22
|
+
>
|
|
23
|
+
> - Foundation:`<目标目录>/basic/*.tsx`
|
|
24
|
+
> - Chat:`<目标目录>/chat/*.tsx`
|
|
25
|
+
> - 例如默认:`src/components/ui/basic/button.tsx`、`src/components/ui/chat/chat-input/index.tsx`
|
|
28
26
|
|
|
29
|
-
|
|
27
|
+
### 步骤 2:引入设计 token
|
|
30
28
|
|
|
31
|
-
|
|
32
|
-
npm install sparkdesign
|
|
33
|
-
```
|
|
29
|
+
CLI 会生成 `src/qoder-tokens.css`,组件样式依赖其中的设计变量。请在**应用入口**引入一次:
|
|
34
30
|
|
|
35
|
-
|
|
31
|
+
> **注意**:组件样式需在 **Tailwind CSS 4** 环境下才能正确生效(token 使用 `@theme` 生成工具类)。请确保项目使用 Tailwind 4,并在**同一份会被 Tailwind 处理的 CSS 入口**中引入 token(详见下方「按需引入完整说明」)。
|
|
36
32
|
|
|
37
|
-
|
|
33
|
+
**Vite / CRA(入口为 main.tsx 或 main.jsx):**
|
|
38
34
|
|
|
39
|
-
|
|
35
|
+
在 `src/main.tsx`(或 `src/main.jsx`)顶部添加:
|
|
40
36
|
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
npx sparkdesign add button tooltip # 添加组件到 src/components/qoder/
|
|
44
|
-
npx sparkdesign list # 列出可用组件
|
|
45
|
-
npx sparkdesign diff button # 对比本地与注册表差异
|
|
37
|
+
```ts
|
|
38
|
+
import './qoder-tokens.css'
|
|
46
39
|
```
|
|
47
40
|
|
|
48
|
-
|
|
41
|
+
**Next.js(App Router):**
|
|
49
42
|
|
|
50
|
-
|
|
43
|
+
在 `src/app/layout.tsx` 中与其他 import 一并添加:
|
|
51
44
|
|
|
52
|
-
|
|
45
|
+
```ts
|
|
46
|
+
import '../qoder-tokens.css'
|
|
47
|
+
```
|
|
53
48
|
|
|
54
|
-
|
|
49
|
+
(若 layout 位于 `src/app/layout.tsx` 使用 `../qoder-tokens.css`,位于 `app/layout.tsx` 则使用 `./qoder-tokens.css`。)
|
|
55
50
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
51
|
+
### 步骤 3:使用组件
|
|
52
|
+
|
|
53
|
+
默认会生成 `src/components/ui/basic/<name>.tsx`(Foundation)或 `src/components/ui/chat/<name>/`(Chat),因此导入路径在默认配置下为:
|
|
59
54
|
|
|
60
|
-
|
|
61
|
-
import {
|
|
62
|
-
|
|
55
|
+
- **Foundation**:`import { X } from '@/components/ui/basic/<组件名>'`
|
|
56
|
+
- **Chat**:`import { X } from '@/components/ui/chat/<组件名>'`
|
|
57
|
+
|
|
58
|
+
(若你修改了 `aliases.ui`,把上面路径中的 `@/components/ui` 换成你的 alias 即可。)
|
|
59
|
+
|
|
60
|
+
```tsx
|
|
61
|
+
// 默认 aliases.ui = @/components/ui 时:
|
|
62
|
+
import { Button } from '@/components/ui/basic/button'
|
|
63
63
|
|
|
64
|
-
// 3. 在根节点设置主题与布局(可选,不设则使用默认 light + neutral)
|
|
65
64
|
function App() {
|
|
66
65
|
return (
|
|
67
|
-
<div
|
|
68
|
-
<Button variant="primary"
|
|
66
|
+
<div>
|
|
67
|
+
<Button variant="primary">点击</Button>
|
|
69
68
|
</div>
|
|
70
69
|
)
|
|
71
70
|
}
|
|
72
71
|
```
|
|
73
72
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
| 方式 | 用法 | 说明 |
|
|
77
|
-
|------|------|------|
|
|
78
|
-
| **A** | `import 'sparkdesign/style'` | **推荐**。预编译完整样式(Tailwind 工具类 + 设计 token),无需配置 Tailwind |
|
|
79
|
-
| **B** | `import 'sparkdesign/theme.css'`<br>`import 'sparkdesign/scale.css'` | 仅引入设计 token,适合已有 Tailwind 4 项目自行扫描组件并覆盖变量(需在消费者 CSS 中 `@source` 指向本包) |
|
|
80
|
-
| **C** | 只引入组件、不引入样式 | 需在项目中自行提供与设计 token 同名的 CSS 变量,否则组件无样式 |
|
|
81
|
-
|
|
82
|
-
> **Markdown 数学公式**:若使用 `MarkdownBody` 组件且需要渲染 KaTeX 数学公式,额外引入:
|
|
83
|
-
> `import 'sparkdesign/katex.css'`
|
|
84
|
-
|
|
85
|
-
自定义主题时,请**先**引入设计系统样式,**再**引入你的覆盖 CSS,变量覆盖才会生效。
|
|
73
|
+
可选:在根节点设置 `data-theme` 与 `data-style`(如 `<div data-theme="light" data-style="neutral">`),不设置则使用默认值。
|
|
86
74
|
|
|
87
75
|
---
|
|
88
76
|
|
|
89
|
-
##
|
|
77
|
+
## 按需引入完整说明(与 Showcase 一致)
|
|
90
78
|
|
|
91
|
-
|
|
79
|
+
要让按需引入的组件**样式与官方 Showcase 完全一致**,需满足以下环境与配置。
|
|
92
80
|
|
|
93
|
-
|
|
81
|
+
### 环境要求
|
|
94
82
|
|
|
95
|
-
|
|
96
|
-
|
|
83
|
+
| 项目 | 要求 |
|
|
84
|
+
|------|------|
|
|
85
|
+
| **Tailwind 版本** | 必须使用 **Tailwind CSS 4**。设计 token 使用 Tailwind 4 的 `@theme` 语法,将 CSS 变量映射为工具类(如 `h-7`、`bg-primary`、`rounded-md`)。使用 Tailwind 3 时这些类不会生成,组件样式会异常。 |
|
|
86
|
+
| **安装** | `npm install tailwindcss@^4 @tailwindcss/vite`(Vite 项目);或使用 `@tailwindcss/cli` 做预编译。 |
|
|
97
87
|
|
|
98
|
-
|
|
99
|
-
/* 消费者 CSS(已有 Tailwind 4 的项目)*/
|
|
100
|
-
@import "tailwindcss";
|
|
101
|
-
@source "../node_modules/sparkdesign/dist";
|
|
102
|
-
@import "sparkdesign/theme.css";
|
|
103
|
-
@import "sparkdesign/scale.css";
|
|
104
|
-
```
|
|
88
|
+
### Token 引入的两种方式
|
|
105
89
|
|
|
106
|
-
|
|
90
|
+
| 方式 | 何时用 | Token 如何生效 |
|
|
91
|
+
|------|--------|----------------|
|
|
92
|
+
| **先 init** | 希望 token 直接写进现有 CSS 入口、少一步手动 import 时 | 执行 `npx sparkdesign init`,CLI 会把 **theme.css + scale.css** 的内容注入到 `src/app/globals.css` 或 `src/index.css`,无需再单独引入 token 文件。 |
|
|
93
|
+
| **直接 add** | 不想改现有流程、先装组件再补样式时 | 执行 `npx sparkdesign add button` 会生成 **`src/qoder-tokens.css`**。须在**应用入口**(如 `main.tsx`、`layout.tsx`)添加一行:`import './qoder-tokens.css'`(路径按实际入口位置调整,如 Next.js 可为 `import '../qoder-tokens.css'`)。 |
|
|
107
94
|
|
|
108
|
-
|
|
95
|
+
无论哪种方式,**token 必须处在「会被 Tailwind 处理的同一份 CSS 管线」中**(即包含 `@import "tailwindcss"` 的那份 CSS 或其 import 链中),这样 `@theme` 才会被 Tailwind 4 读取并生成对应工具类。
|
|
109
96
|
|
|
110
|
-
|
|
97
|
+
### CSS 入口配置(与 Showcase 一致)
|
|
111
98
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
| `light` | 亮色模式(默认) |
|
|
115
|
-
| `dark` | 暗色模式 |
|
|
99
|
+
1. **顺序**:先 `@import "tailwindcss"`,再引入 token(或包含 token 的文件)。
|
|
100
|
+
2. **扫描组件目录**:Showcase 会扫描组件所在目录以生成 `h-7`、`w-9` 等工具类。按需引入后组件在你项目里,需让 Tailwind 扫描到这些文件。在**同一份 CSS 入口**中增加 `@source` 指向组件目录(路径对应你当前的 `aliases.ui`)。
|
|
116
101
|
|
|
117
|
-
|
|
118
|
-
// 在根节点或任意父节点设置
|
|
119
|
-
<div data-theme="dark">
|
|
120
|
-
<Button variant="primary">按钮</Button>
|
|
121
|
-
</div>
|
|
122
|
-
```
|
|
102
|
+
**最小可用的入口 CSS 示例**(Vite 项目,组件默认在 `src/components/ui`):
|
|
123
103
|
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
|
|
104
|
+
```css
|
|
105
|
+
@import "tailwindcss";
|
|
106
|
+
@source "../components/ui";
|
|
107
|
+
@import "./qoder-tokens.css";
|
|
127
108
|
```
|
|
128
109
|
|
|
129
|
-
|
|
110
|
+
若你已通过 **init** 把 token 写入了本文件,则无需再写 `@import "./qoder-tokens.css"`,只需保留 `@import "tailwindcss"` 和 `@source "../components/ui"` 即可。
|
|
130
111
|
|
|
131
|
-
###
|
|
112
|
+
### 主题与布局风格(可选)
|
|
132
113
|
|
|
133
|
-
|
|
114
|
+
与 Showcase 一样切换主题/风格时,在根节点设置:
|
|
134
115
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
| `neutral` | 平衡的标准 | 默认,简洁直观 |
|
|
138
|
-
| `compact` | 优化效率 | 更窄间距,紧凑 |
|
|
139
|
-
| `soft` | 舒适至上 | 大圆角、宽松间距 |
|
|
140
|
-
| `sharp` | 几何精度 | 直角、利落线条 |
|
|
141
|
-
| `dense` | 信息密集 | 最小留白 |
|
|
116
|
+
- **`data-theme`**:颜色主题,如 `light`、`dark`。
|
|
117
|
+
- **`data-style`**:布局风格,如 `neutral`、`compact`、`soft`、`sharp`、`dense`。
|
|
142
118
|
|
|
143
|
-
|
|
144
|
-
<div data-style="soft">
|
|
145
|
-
<Button>按钮</Button>
|
|
146
|
-
</div>
|
|
147
|
-
```
|
|
119
|
+
示例:`<div data-theme="light" data-style="neutral">`。不设置则使用默认值。
|
|
148
120
|
|
|
149
|
-
|
|
121
|
+
---
|
|
150
122
|
|
|
151
|
-
|
|
152
|
-
<div data-theme="dark" data-style="soft">
|
|
153
|
-
{/* 暗色 + 柔和布局 */}
|
|
154
|
-
</div>
|
|
155
|
-
```
|
|
123
|
+
## 命令说明
|
|
156
124
|
|
|
157
|
-
|
|
125
|
+
| 命令 | 说明 |
|
|
126
|
+
|------|------|
|
|
127
|
+
| `npx sparkdesign add button` | 添加 button 到 `src/components/ui/`(默认),并自动创建缺失的 config、token 文件、utils |
|
|
128
|
+
| `npx sparkdesign add button tooltip dropdown-menu` | 一次添加多个组件 |
|
|
129
|
+
| `npx sparkdesign init` | 先做一次「完整初始化」:选择布局风格、**组件存放目录(相对 src,默认 components)**、是否安装依赖;token 会写进现有 CSS 入口 |
|
|
130
|
+
| `npx sparkdesign list` | 列出所有可添加的组件名 |
|
|
131
|
+
| `npx sparkdesign diff button` | 对比本地 button 和最新模板的差异 |
|
|
132
|
+
| `npx sparkdesign add button --overwrite` | 覆盖已有组件文件 |
|
|
158
133
|
|
|
159
|
-
|
|
134
|
+
---
|
|
160
135
|
|
|
161
|
-
|
|
136
|
+
## 支持的组件
|
|
162
137
|
|
|
163
|
-
|
|
164
|
-
- `[data-theme="主题名"]` — 颜色主题(自定义名称)
|
|
165
|
-
- `[data-style="风格名"]` — 布局风格(自定义名称)
|
|
138
|
+
**支持的组件 = CLI 包内 `registry/meta.json` 的全部条目**(覆盖当前 registry 的 Foundation + Chat 组件实现)。
|
|
166
139
|
|
|
167
|
-
|
|
168
|
-
/* 自定义颜色主题 */
|
|
169
|
-
[data-theme="my-brand"] {
|
|
170
|
-
--color-primary: #3B82F6;
|
|
171
|
-
--color-primary-hover: #2563EB;
|
|
172
|
-
}
|
|
140
|
+
权威列表请运行:
|
|
173
141
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
--spacing-4: 20px;
|
|
177
|
-
--radius-md: 8px;
|
|
178
|
-
}
|
|
142
|
+
```bash
|
|
143
|
+
npx sparkdesign list
|
|
179
144
|
```
|
|
180
145
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
### 5. Portal 浮层与主题一致
|
|
184
|
-
|
|
185
|
-
DropdownMenu、Tooltip 等会挂到 `body`,不会继承局部容器的 `data-theme` / `data-style`。两种做法:
|
|
146
|
+
示例(Foundation + Chat 混合添加):
|
|
186
147
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
```tsx
|
|
191
|
-
import { ThemeStyleProvider, Button, DropdownMenu } from 'sparkdesign'
|
|
192
|
-
|
|
193
|
-
function App() {
|
|
194
|
-
const theme = 'dark'
|
|
195
|
-
const style = 'soft'
|
|
196
|
-
return (
|
|
197
|
-
<ThemeStyleProvider value={{ theme, style }}>
|
|
198
|
-
<div data-theme={theme} data-style={style}>
|
|
199
|
-
<Button>打开</Button>
|
|
200
|
-
<DropdownMenu>...</DropdownMenu>
|
|
201
|
-
</div>
|
|
202
|
-
</ThemeStyleProvider>
|
|
203
|
-
)
|
|
204
|
-
}
|
|
148
|
+
```bash
|
|
149
|
+
npx sparkdesign add button select dropdown-menu tooltip
|
|
150
|
+
npx sparkdesign add chat-input response markdown
|
|
205
151
|
```
|
|
206
152
|
|
|
207
|
-
|
|
153
|
+
> 说明:tokens(`registry/tokens/*.css`)与 `registry/lib/utils.ts` 由 `init` 或首次 `add` 时的“初始化逻辑”处理,不作为单组件条目列出。
|
|
208
154
|
|
|
209
|
-
|
|
155
|
+
---
|
|
210
156
|
|
|
211
|
-
|
|
212
|
-
import 'sparkdesign/style'
|
|
213
|
-
import { Button } from 'sparkdesign'
|
|
214
|
-
import type { ButtonProps } from 'sparkdesign'
|
|
157
|
+
## init 与 add 的选用
|
|
215
158
|
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
<div data-theme="light" data-style="neutral">
|
|
219
|
-
<Button variant="primary" size="md">Click me</Button>
|
|
220
|
-
</div>
|
|
221
|
-
)
|
|
222
|
-
}
|
|
223
|
-
```
|
|
159
|
+
- **直接 add**(推荐):执行 `npx sparkdesign add button` 会生成 `src/qoder-tokens.css`,按步骤 2 在入口添加 `import './qoder-tokens.css'` 即可。
|
|
160
|
+
- **先 init 再 add**:执行 `npx sparkdesign init` 时会询问**组件存放目录**(相对 src,如 `components` 或 `ui`),并写入 `components.json` 的 `aliases.components` 与 **`aliases.ui`**(默认 `@/components/ui`)。之后 add 会按该配置输出到对应目录(如 `src/components/ui/`),并将 token 写入现有 `globals.css` / `index.css`。
|
|
224
161
|
|
|
225
|
-
|
|
162
|
+
两种方式择一使用即可。若要**与官方 Showcase 样式完全一致**,请同时满足上文「按需引入完整说明」中的 Tailwind 4 与 CSS 入口配置(含 `@source` 扫描组件目录)。
|
|
226
163
|
|
|
227
|
-
|
|
228
|
-
|------|------|------|
|
|
229
|
-
| **Basic** | 原子级 UI 组件 | Button, IconButton, Tooltip, Select, DropdownMenu, Tabs, Toast, Tag, Progress, Avatar, Table, Slider, Pagination, Collapse, Resizable, Scrollbar, Skeleton, Spinner, Kbd, EllipsisText, Switch, Toggle, ToggleGroup, RadioGroup, AlertDialog, OptionList … |
|
|
230
|
-
| **Chat** | 对话流相关组件 | ChatInput, SendButton, Request, Response, FileCard, FileAttachment, ImageAttachment, FolderButton, ReasoningStep, ToolInvocationCard, PermissionCard, MarkdownBody, GenerationStatusBar, ThinkingIndicator, ImageGenerating, RelatedPrompts, SuggestionPart, SidebarMenu … |
|
|
231
|
-
|
|
232
|
-
完整导出见 [src/components/index.ts](src/components/index.ts)。图标通过 `IconsProvider` / `useIcon` 注入,可替换为 Lucide、Remix 等,见 [图标自定义说明](docs/图标自定义说明.md)。
|
|
164
|
+
---
|
|
233
165
|
|
|
234
|
-
##
|
|
166
|
+
## 生成文件说明
|
|
235
167
|
|
|
236
|
-
|
|
|
237
|
-
|
|
238
|
-
|
|
|
239
|
-
|
|
|
240
|
-
|
|
|
241
|
-
|
|
|
168
|
+
| 文件 | 何时出现 | 说明 |
|
|
169
|
+
|------|----------|------|
|
|
170
|
+
| `components.json` | add 或 init | 配置:`style`、`aliases.components`、`aliases.utils`、**`aliases.ui`**(组件安装目录,默认 **`@/components/ui`**)。修改 **`aliases.ui`** 可改变 add 的输出目录;再次 add 时终端会打印目标目录以确认生效。 |
|
|
171
|
+
| `src/qoder-tokens.css` | 直接 add 且项目中尚无 token 时 | 设计 token 文件(theme + scale),须在**与 Tailwind 同一管线的入口**中引入一次,且项目需使用 Tailwind 4 |
|
|
172
|
+
| `src/lib/utils.ts` | add 或 init 且不存在时 | 工具函数 `cn()`,供组件使用 |
|
|
173
|
+
| `src/<aliases.ui 解析路径>/basic/*.tsx`<br>`src/<aliases.ui 解析路径>/chat/*.tsx` | add 对应组件时 | 组件源码(路径由 `aliases.ui` 决定,默认 `src/components/ui/`),可按需修改 |
|
|
242
174
|
|
|
243
175
|
---
|
|
244
176
|
|
|
245
|
-
##
|
|
246
|
-
|
|
247
|
-
以下内容面向**参与仓库开发**的贡献者;仅使用本包时可忽略。
|
|
248
|
-
|
|
249
|
-
### 组件展示(Showcase)
|
|
177
|
+
## 依赖
|
|
250
178
|
|
|
251
|
-
|
|
179
|
+
- **样式生效前提**:组件样式依赖设计 token 与 Tailwind 工具类,项目须使用 **Tailwind CSS 4**(见上文「按需引入完整说明」)。若未使用 Tailwind 4,token 中的 `@theme` 不会生效,`h-7`、`bg-primary` 等类不会生成。
|
|
180
|
+
- **运行时依赖**:组件会用到 `class-variance-authority`、`clsx`(以及部分组件需要 `tailwind-merge`、`@radix-ui/*` 等)。若执行 `npx sparkdesign add button` 后出现依赖缺失,请在项目根目录执行:
|
|
252
181
|
|
|
253
182
|
```bash
|
|
254
|
-
|
|
183
|
+
npm install class-variance-authority clsx tailwind-merge
|
|
255
184
|
```
|
|
256
185
|
|
|
257
|
-
|
|
186
|
+
使用 tooltip、dropdown-menu 等组件时,按提示安装 `@radix-ui/react-tooltip`、`@radix-ui/react-dropdown-menu` 等依赖。
|
|
258
187
|
|
|
259
|
-
|
|
260
|
-
|------|------|
|
|
261
|
-
| `npm run dev` | 设计系统开发服务器 |
|
|
262
|
-
| `npm run build` | 生产构建:Vite 输出 JS → @tailwindcss/cli 预编译 CSS → tsc 类型声明 |
|
|
263
|
-
| `npm run build:css` | 仅重新生成预编译 CSS(`dist/qoder-design.css`) |
|
|
264
|
-
| `npm run preview` | 预览构建产物 |
|
|
265
|
-
| `cd apps/showcase && npm run dev` | 组件展示站点 |
|
|
266
|
-
|
|
267
|
-
### 目录结构
|
|
268
|
-
|
|
269
|
-
```
|
|
270
|
-
src/
|
|
271
|
-
├── index.css # dev 模式 CSS 入口
|
|
272
|
-
├── lib.css # 库构建 CSS 入口(@tailwindcss/cli)
|
|
273
|
-
├── tokens/ # theme.css、scale.css
|
|
274
|
-
├── components/ # basic/、chat/
|
|
275
|
-
└── lib/ # 工具与 ThemeStyleProvider
|
|
276
|
-
```
|
|
277
|
-
|
|
278
|
-
### 技术栈与规范
|
|
188
|
+
---
|
|
279
189
|
|
|
280
|
-
|
|
281
|
-
- 项目哲学与 GEB 协议:[CLAUDE.md](https://github.com/nicepkg/spark-design/blob/master/CLAUDE.md)
|
|
190
|
+
## 安装目录配置
|
|
282
191
|
|
|
283
|
-
|
|
192
|
+
支持 **`aliases.ui`** 作为组件安装目录,默认 **`@/components/ui`**;未设置时使用 `aliases.components + '/qoder'` 以兼容旧配置。**改安装位置只需改 `aliases.ui`**,`aliases.components` 一般不必改。详见 [CLI 配置说明](../docs/CLI配置说明.md)。
|
|
284
193
|
|
|
285
|
-
*"Keep the map aligned with the terrain."*
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
import path from 'node:path';
|
|
9
9
|
import fs from 'fs-extra';
|
|
10
10
|
import chalk from 'chalk';
|
|
11
|
+
import { execa } from 'execa';
|
|
11
12
|
import { readConfig, writeConfig, getComponentsBaseAlias, resolveTargetDir } from '../utils/config.js';
|
|
12
13
|
import { getRegistryRoot, getComponentMeta, getComponentSource } from '../utils/registry.js';
|
|
13
14
|
import { stripL3Header, transformImports } from '../utils/transform.js';
|
|
@@ -78,7 +79,15 @@ export async function add(components, options = {}) {
|
|
|
78
79
|
}
|
|
79
80
|
if (allDeps.size > 0) {
|
|
80
81
|
console.log('');
|
|
81
|
-
console.log(chalk.cyan('
|
|
82
|
-
|
|
82
|
+
console.log(chalk.cyan('Installing dependencies...'));
|
|
83
|
+
const depsArray = Array.from(allDeps);
|
|
84
|
+
try {
|
|
85
|
+
await execa('npm', ['install', ...depsArray], { cwd, stdio: 'inherit' });
|
|
86
|
+
console.log(chalk.green('✓'), 'Installed', depsArray.length, 'dependencies');
|
|
87
|
+
}
|
|
88
|
+
catch {
|
|
89
|
+
console.log(chalk.yellow('○'), 'Auto-install failed. Run manually:');
|
|
90
|
+
console.log(' npm install', depsArray.join(' '));
|
|
91
|
+
}
|
|
83
92
|
}
|
|
84
93
|
}
|
package/package.json
CHANGED
|
@@ -1,146 +1,39 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sparkdesign",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.3",
|
|
4
|
+
"description": "CLI for Spark Design - add components on demand (copy source to your project)",
|
|
4
5
|
"type": "module",
|
|
5
|
-
"description": "Modern React Design System with dual-dimension theme system",
|
|
6
|
-
"keywords": [
|
|
7
|
-
"react",
|
|
8
|
-
"components",
|
|
9
|
-
"design-system",
|
|
10
|
-
"ui-library",
|
|
11
|
-
"tailwind"
|
|
12
|
-
],
|
|
13
|
-
"license": "MIT",
|
|
14
|
-
"repository": {
|
|
15
|
-
"type": "git",
|
|
16
|
-
"url": "git+https://github.com/nicepkg/spark-design.git"
|
|
17
|
-
},
|
|
18
|
-
"homepage": "https://spark.design",
|
|
19
6
|
"bin": {
|
|
20
|
-
"sparkdesign": "
|
|
21
|
-
},
|
|
22
|
-
"exports": {
|
|
23
|
-
".": {
|
|
24
|
-
"types": "./dist/components/index.d.ts",
|
|
25
|
-
"import": "./dist/spark-design.es.js",
|
|
26
|
-
"require": "./dist/spark-design.cjs.js"
|
|
27
|
-
},
|
|
28
|
-
"./style": "./dist/qoder-design.css",
|
|
29
|
-
"./theme.css": "./dist/theme.css",
|
|
30
|
-
"./scale.css": "./dist/scale.css",
|
|
31
|
-
"./katex.css": "./dist/katex.css",
|
|
32
|
-
"./theme-base.css": "./dist/theme-base.css",
|
|
33
|
-
"./tokens/*": "./dist/tokens/*",
|
|
34
|
-
"./themes/*": "./dist/themes/*",
|
|
35
|
-
"./scale/*": "./dist/scale/*"
|
|
7
|
+
"sparkdesign": "dist/index.js"
|
|
36
8
|
},
|
|
37
9
|
"files": [
|
|
38
10
|
"dist",
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
],
|
|
42
|
-
"sideEffects": [
|
|
43
|
-
"*.css",
|
|
44
|
-
"dist/fonts/*"
|
|
11
|
+
"registry",
|
|
12
|
+
"README.md"
|
|
45
13
|
],
|
|
46
14
|
"scripts": {
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
"build": "vite build && npx @tailwindcss/cli -i src/lib.css -o dist/qoder-design.css --minify && tsc -p tsconfig.lib.json && npm run build:cli",
|
|
52
|
-
"build:cli": "cd cli && npm run build",
|
|
53
|
-
"build:css": "npx @tailwindcss/cli -i src/lib.css -o dist/qoder-design.css --minify",
|
|
54
|
-
"build:watch": "vite build --watch",
|
|
55
|
-
"preview": "vite preview",
|
|
56
|
-
"lint": "eslint .",
|
|
57
|
-
"test": "vitest",
|
|
58
|
-
"test:run": "vitest run",
|
|
59
|
-
"test:ui": "vitest --ui",
|
|
60
|
-
"test:coverage": "vitest run --coverage",
|
|
61
|
-
"test:e2e": "playwright test",
|
|
62
|
-
"test:e2e:ui": "playwright test --ui",
|
|
63
|
-
"size": "size-limit",
|
|
64
|
-
"size:why": "size-limit --why",
|
|
65
|
-
"prepublishOnly": "npm run build && node scripts/sync-registry-to-cli.mjs"
|
|
66
|
-
},
|
|
67
|
-
"peerDependencies": {
|
|
68
|
-
"react": ">=18.0.0",
|
|
69
|
-
"react-dom": ">=18.0.0"
|
|
70
|
-
},
|
|
71
|
-
"optionalDependencies": {
|
|
72
|
-
"mermaid": "^11.12.0"
|
|
15
|
+
"build": "tsc",
|
|
16
|
+
"dev": "tsc --watch",
|
|
17
|
+
"cli": "node dist/index.js",
|
|
18
|
+
"prepublishOnly": "node ../scripts/generate-registry-meta.mjs && node ../scripts/sync-registry-to-cli.mjs && node ../scripts/validate-registry-meta.mjs cli"
|
|
73
19
|
},
|
|
74
20
|
"dependencies": {
|
|
75
|
-
"@radix-ui/react-accordion": "^1.2.12",
|
|
76
|
-
"@radix-ui/react-alert-dialog": "^1.1.15",
|
|
77
|
-
"@radix-ui/react-avatar": "^1.1.11",
|
|
78
|
-
"@radix-ui/react-collapsible": "^1.1.12",
|
|
79
|
-
"@radix-ui/react-dropdown-menu": "^2.1.16",
|
|
80
|
-
"@radix-ui/react-progress": "^1.1.8",
|
|
81
|
-
"@radix-ui/react-radio-group": "^1.3.8",
|
|
82
|
-
"@radix-ui/react-select": "^2.2.6",
|
|
83
|
-
"@radix-ui/react-slider": "^1.3.6",
|
|
84
|
-
"@radix-ui/react-switch": "^1.2.6",
|
|
85
|
-
"@radix-ui/react-tabs": "^1.1.2",
|
|
86
|
-
"@radix-ui/react-toggle": "^1.1.10",
|
|
87
|
-
"@radix-ui/react-toggle-group": "^1.1.11",
|
|
88
|
-
"@radix-ui/react-tooltip": "^1.2.8",
|
|
89
|
-
"@rive-app/react-canvas": "^4.26.2",
|
|
90
21
|
"chalk": "^5.3.0",
|
|
91
|
-
"class-variance-authority": "^0.7.1",
|
|
92
|
-
"clsx": "^2.1.1",
|
|
93
22
|
"commander": "^12.1.0",
|
|
94
23
|
"diff": "^7.0.0",
|
|
95
24
|
"execa": "^9.5.2",
|
|
96
|
-
"framer-motion": "^12.34.0",
|
|
97
25
|
"fs-extra": "^11.2.0",
|
|
98
|
-
"i18next": "^25.8.7",
|
|
99
|
-
"katex": "^0.16.28",
|
|
100
|
-
"lottie-react": "^2.4.1",
|
|
101
26
|
"ora": "^8.1.1",
|
|
102
|
-
"
|
|
103
|
-
"prompts": "^2.4.2",
|
|
104
|
-
"react-i18next": "^16.5.4",
|
|
105
|
-
"react-markdown": "^10.1.0",
|
|
106
|
-
"react-resizable-panels": "^4.6.2",
|
|
107
|
-
"rehype-katex": "^7.0.1",
|
|
108
|
-
"remark-gfm": "^4.0.1",
|
|
109
|
-
"remark-math": "^6.0.0",
|
|
110
|
-
"sonner": "^2.0.7",
|
|
111
|
-
"tailwind-merge": "^3.4.1",
|
|
112
|
-
"tailwind-variants": "^3.2.2",
|
|
113
|
-
"tailwindcss": "^4.1.18",
|
|
114
|
-
"tailwindcss-animate": "^1.0.7"
|
|
27
|
+
"prompts": "^2.4.2"
|
|
115
28
|
},
|
|
116
29
|
"devDependencies": {
|
|
117
|
-
"@
|
|
118
|
-
"@
|
|
119
|
-
"@
|
|
120
|
-
"@
|
|
121
|
-
"
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
"
|
|
125
|
-
|
|
126
|
-
"@vitejs/plugin-react": "^5.1.1",
|
|
127
|
-
"@vitest/coverage-v8": "^4.0.18",
|
|
128
|
-
"eslint": "^9.39.1",
|
|
129
|
-
"eslint-plugin-react-hooks": "^7.0.1",
|
|
130
|
-
"eslint-plugin-react-refresh": "^0.4.24",
|
|
131
|
-
"globals": "^16.5.0",
|
|
132
|
-
"size-limit": "^12.0.0",
|
|
133
|
-
"typescript": "~5.9.3",
|
|
134
|
-
"typescript-eslint": "^8.48.0",
|
|
135
|
-
"vite": "^7.3.1",
|
|
136
|
-
"vitest": "^4.0.18"
|
|
137
|
-
},
|
|
138
|
-
"size-limit": [
|
|
139
|
-
{
|
|
140
|
-
"path": "dist/spark-design.es.js",
|
|
141
|
-
"limit": "550 KB",
|
|
142
|
-
"brotli": false,
|
|
143
|
-
"gzip": false
|
|
144
|
-
}
|
|
145
|
-
]
|
|
30
|
+
"@types/diff": "^6.0.0",
|
|
31
|
+
"@types/fs-extra": "^11.0.4",
|
|
32
|
+
"@types/node": "^22.10.1",
|
|
33
|
+
"@types/prompts": "^2.4.9",
|
|
34
|
+
"typescript": "~5.9.3"
|
|
35
|
+
},
|
|
36
|
+
"engines": {
|
|
37
|
+
"node": ">=18"
|
|
38
|
+
}
|
|
146
39
|
}
|
|
@@ -134,7 +134,7 @@ export function MarkdownBody({ children, className }: MarkdownBodyProps) {
|
|
|
134
134
|
<div className={cn('markdown-body text-sm leading-sm text-text', className)}>
|
|
135
135
|
<ReactMarkdown
|
|
136
136
|
remarkPlugins={[remarkGfm, remarkMath]}
|
|
137
|
-
rehypePlugins={[rehypeKatex]}
|
|
137
|
+
rehypePlugins={[rehypeKatex as any]}
|
|
138
138
|
components={markdownComponents}
|
|
139
139
|
>
|
|
140
140
|
{children}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { memo, useState } from 'react'
|
|
2
2
|
import { cn } from '@/lib/utils'
|
|
3
3
|
import type { ReactNode } from 'react'
|
|
4
|
-
import { TimeLine, CheckboxCircleLine, CloseCircleLine,
|
|
4
|
+
import { TimeLine, CheckboxCircleLine, CloseCircleLine, ArrowDownSLine } from '../basic/icons-inline'
|
|
5
5
|
import { Scrollbar } from '../basic/scrollbar'
|
|
6
6
|
|
|
7
7
|
export type ToolInvocationStatus = 'running' | 'success' | 'error'
|
|
@@ -17,7 +17,7 @@ export interface ToolInvocationCardProps {
|
|
|
17
17
|
timeIcon?: ReactNode
|
|
18
18
|
checkboxCircleIcon?: ReactNode
|
|
19
19
|
closeCircleIcon?: ReactNode
|
|
20
|
-
|
|
20
|
+
arrowDownIcon?: ReactNode
|
|
21
21
|
runningText?: string
|
|
22
22
|
ranText?: string
|
|
23
23
|
failedText?: string
|
|
@@ -42,7 +42,7 @@ export const ToolInvocationCard = memo(function ToolInvocationCard({
|
|
|
42
42
|
timeIcon,
|
|
43
43
|
checkboxCircleIcon,
|
|
44
44
|
closeCircleIcon,
|
|
45
|
-
|
|
45
|
+
arrowDownIcon,
|
|
46
46
|
runningText = 'Running',
|
|
47
47
|
ranText = 'Ran',
|
|
48
48
|
failedText = 'Failed',
|
|
@@ -62,7 +62,7 @@ export const ToolInvocationCard = memo(function ToolInvocationCard({
|
|
|
62
62
|
const defaultTime = timeIcon ?? <TimeLine className={timeClass} />
|
|
63
63
|
const defaultCheck = checkboxCircleIcon ?? <CheckboxCircleLine className={checkboxClass} />
|
|
64
64
|
const defaultCloseCircle = closeCircleIcon ?? <CloseCircleLine className={closeCircleClass} />
|
|
65
|
-
const defaultArrow =
|
|
65
|
+
const defaultArrow = arrowDownIcon ?? <ArrowDownSLine className={arrowClass} />
|
|
66
66
|
|
|
67
67
|
return (
|
|
68
68
|
<div className={cn('flex flex-col', className)}>
|
|
@@ -96,7 +96,7 @@ export const ToolInvocationCard = memo(function ToolInvocationCard({
|
|
|
96
96
|
'shrink-0 inline-flex items-center justify-center',
|
|
97
97
|
'opacity-0 group-hover:opacity-100',
|
|
98
98
|
isExpanded && '!opacity-100',
|
|
99
|
-
isExpanded ? 'rotate-
|
|
99
|
+
isExpanded ? 'rotate-180' : 'rotate-0'
|
|
100
100
|
)}
|
|
101
101
|
>
|
|
102
102
|
{defaultArrow}
|