sparkdesign 0.4.3 → 0.4.4
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 +205 -111
- package/dist/_basePickBy-DnQN8w3y.js +151 -0
- package/dist/_basePickBy-a-kPMlkg.cjs +1 -0
- package/dist/_baseUniq-B-N2NQ50.js +614 -0
- package/dist/_baseUniq-Cc_zbSif.cjs +1 -0
- package/dist/arc-BQBhijZ6.js +83 -0
- package/dist/arc-mWQt0Yph.cjs +1 -0
- package/dist/architectureDiagram-VXUJARFQ-BMZEucno.cjs +36 -0
- package/dist/architectureDiagram-VXUJARFQ-DTdjD3Bp.js +4661 -0
- package/dist/blockDiagram-VD42YOAC-CzHn0yob.js +2256 -0
- package/dist/blockDiagram-VD42YOAC-DDxdHAlz.cjs +122 -0
- package/dist/c4Diagram-YG6GDRKO-4Gz0I4gj.cjs +10 -0
- package/dist/c4Diagram-YG6GDRKO-BIy--yVN.js +1580 -0
- package/dist/channel-BQn0o8bs.js +5 -0
- package/dist/channel-DaN7XniJ.cjs +1 -0
- package/dist/chunk-4BX2VUAB-BlQFTQqz.cjs +1 -0
- package/dist/chunk-4BX2VUAB-Czitj3Kc.js +8 -0
- package/dist/chunk-55IACEB6-DXacNZbO.js +8 -0
- package/dist/chunk-55IACEB6-DnDxpye9.cjs +1 -0
- package/dist/chunk-B4BG7PRW-CBdN0q_V.js +1375 -0
- package/dist/chunk-B4BG7PRW-DbGvUkGO.cjs +165 -0
- package/dist/chunk-DI55MBZ5-D1YJMs6x.cjs +220 -0
- package/dist/chunk-DI55MBZ5-NCQTvayw.js +1370 -0
- package/dist/chunk-FMBD7UC4-CsGMbrtr.js +19 -0
- package/dist/chunk-FMBD7UC4-Di7cUUh5.cjs +15 -0
- package/dist/chunk-QN33PNHL-0j5LC8Lm.cjs +1 -0
- package/dist/chunk-QN33PNHL-3GERZBRm.js +19 -0
- package/dist/chunk-QZHKN3VN-AVEY9ImQ.js +15 -0
- package/dist/chunk-QZHKN3VN-s8Z0a8mc.cjs +1 -0
- package/dist/chunk-TZMSLE5B-CAf87HPt.cjs +1 -0
- package/dist/chunk-TZMSLE5B-sbiflal0.js +64 -0
- package/dist/classDiagram-2ON5EDUG-Ct9JLIN2.cjs +1 -0
- package/dist/classDiagram-2ON5EDUG-Dzfrft3a.js +16 -0
- package/dist/classDiagram-v2-WZHVMYZB-Ct9JLIN2.cjs +1 -0
- package/dist/classDiagram-v2-WZHVMYZB-Dzfrft3a.js +16 -0
- package/dist/clone-Cde_NQ8V.js +8 -0
- package/dist/clone-DCNjWuM2.cjs +1 -0
- package/dist/cose-bilkent-S5V4N54A-0uLijMro.cjs +1 -0
- package/dist/cose-bilkent-S5V4N54A-Bb08N431.js +2608 -0
- package/dist/cytoscape.esm-CNUX3VTg.cjs +321 -0
- package/dist/cytoscape.esm-Cvf3sx9F.js +18704 -0
- package/dist/dagre-6UL2VRFP-CY_Wz5Zd.js +444 -0
- package/dist/dagre-6UL2VRFP-Dxe7_qZc.cjs +4 -0
- package/dist/defaultLocale-BgPVtth8.js +171 -0
- package/dist/defaultLocale-C4wbwF1n.cjs +1 -0
- package/dist/diagram-PSM6KHXK-D2bdb7MT.js +531 -0
- package/dist/diagram-PSM6KHXK-YF69SUjY.cjs +24 -0
- package/dist/diagram-QEK2KX5R-BpUSoh0-.js +217 -0
- package/dist/diagram-QEK2KX5R-DZPGteon.cjs +43 -0
- package/dist/diagram-S2PKOQOG-ht-zdvFG.cjs +24 -0
- package/dist/diagram-S2PKOQOG-zFeLJ50Z.js +142 -0
- package/dist/erDiagram-Q2GNP2WA-B38iJ6ts.js +841 -0
- package/dist/erDiagram-Q2GNP2WA-RgS80DDU.cjs +60 -0
- package/dist/flowDiagram-NV44I4VS-BHilOs2p.cjs +162 -0
- package/dist/flowDiagram-NV44I4VS-BrBJcoce.js +1620 -0
- 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 +267 -0
- package/dist/ganttDiagram-JELNMOA3-tw6FhkWJ.js +2670 -0
- package/dist/gitGraphDiagram-V2S2FVAM-BWn5uIK5.js +699 -0
- package/dist/gitGraphDiagram-V2S2FVAM-DKKeG-9R.cjs +65 -0
- package/dist/graph-DIbblrZP.cjs +1 -0
- package/dist/graph-DPcK91G3.js +247 -0
- package/dist/infoDiagram-HS3SLOUP-B8gwwhct.cjs +2 -0
- package/dist/infoDiagram-HS3SLOUP-D47PNcP_.js +24 -0
- package/dist/init-CHZsXQcr.cjs +1 -0
- package/dist/init-DjUOC4st.js +16 -0
- package/dist/journeyDiagram-XKPGCS4Q-BG3cfhyU.js +834 -0
- package/dist/journeyDiagram-XKPGCS4Q-D8DVLJof.cjs +139 -0
- package/dist/kanban-definition-3W4ZIXB7-4OCnEouP.cjs +89 -0
- package/dist/kanban-definition-3W4ZIXB7-CWi_ssF9.js +719 -0
- package/dist/katex.css +1 -0
- package/dist/layout-Byuh8f-J.cjs +1 -0
- package/dist/layout-CdLdvj1j.js +1335 -0
- package/dist/linear-C2Q_PI9B.js +259 -0
- package/dist/linear-C69aPBW1.cjs +1 -0
- package/dist/mermaid.core-DBwAx_jp.cjs +249 -0
- package/dist/mermaid.core-gFR0XUlD.js +15300 -0
- package/dist/mindmap-definition-VGOIOE7T-8P7obVV4.cjs +68 -0
- package/dist/mindmap-definition-VGOIOE7T-DnOa7WJ9.js +784 -0
- package/dist/ordinal-B6-f3MAq.js +61 -0
- package/dist/ordinal-CagbB1m8.cjs +1 -0
- package/dist/pieDiagram-ADFJNKIX-5NAlvhMo.js +161 -0
- package/dist/pieDiagram-ADFJNKIX-CQBG4yR9.cjs +30 -0
- package/dist/qoder-design.css +2 -0
- package/dist/quadrantDiagram-AYHSOK5B-Oe4y7RZ0.cjs +7 -0
- package/dist/quadrantDiagram-AYHSOK5B-rh2DPEP1.js +1022 -0
- package/dist/registry/basic/alert-dialog.d.ts +40 -0
- package/dist/registry/basic/avatar.d.ts +30 -0
- package/dist/registry/basic/button.d.ts +16 -0
- package/dist/registry/basic/collapse.d.ts +22 -0
- package/dist/registry/basic/collapsible-card.d.ts +34 -0
- package/dist/registry/basic/collapsible.d.ts +15 -0
- package/dist/registry/basic/dropdown-menu.d.ts +52 -0
- package/dist/registry/basic/icon-button.d.ts +12 -0
- package/dist/registry/basic/icons-inline.d.ts +51 -0
- package/dist/registry/basic/kbd.d.ts +23 -0
- package/dist/registry/basic/option-list.d.ts +16 -0
- package/dist/registry/basic/pagination.d.ts +33 -0
- package/dist/registry/basic/progress.d.ts +18 -0
- package/dist/registry/basic/radio-group.d.ts +25 -0
- package/dist/registry/basic/resizable.d.ts +318 -0
- package/dist/registry/basic/scrollbar.d.ts +12 -0
- package/dist/registry/basic/select.d.ts +35 -0
- package/dist/registry/basic/shimmering-text.d.ts +27 -0
- package/dist/registry/basic/sidebar-menu.d.ts +23 -0
- package/dist/registry/basic/skeleton.d.ts +10 -0
- package/dist/registry/basic/slider.d.ts +16 -0
- package/dist/registry/basic/sonner.d.ts +23 -0
- package/dist/registry/basic/spinner.d.ts +5 -0
- package/dist/registry/basic/switch.d.ts +20 -0
- package/dist/registry/basic/table.d.ts +18 -0
- package/dist/registry/basic/tabs.d.ts +29 -0
- package/dist/registry/basic/tag.d.ts +23 -0
- package/dist/registry/basic/theme-from-document.d.ts +10 -0
- package/dist/registry/basic/toggle.d.ts +29 -0
- package/dist/registry/basic/tooltip.d.ts +34 -0
- package/dist/registry/basic/typography.d.ts +76 -0
- package/dist/registry/chat/ask-user-part.d.ts +24 -0
- package/dist/registry/chat/browser-action-part.d.ts +28 -0
- package/dist/registry/chat/chat-input/chat-input-folder-selector.d.ts +22 -0
- package/dist/registry/chat/chat-input/chat-input-model-switcher.d.ts +12 -0
- package/dist/registry/chat/chat-input/chat-input-textarea.d.ts +9 -0
- package/dist/registry/chat/chat-input/compound.d.ts +97 -0
- package/dist/registry/chat/chat-input/context.d.ts +64 -0
- package/dist/registry/chat/chat-input/folder-permission-dialog.d.ts +11 -0
- package/dist/registry/chat/chat-input/index.d.ts +34 -0
- package/dist/registry/chat/chat-input/types.d.ts +79 -0
- package/dist/registry/chat/chat-input/useAutoResizeTextarea.d.ts +7 -0
- package/dist/registry/chat/code-block-part.d.ts +23 -0
- package/dist/registry/chat/file-attachment.d.ts +19 -0
- package/dist/registry/chat/file-card.d.ts +10 -0
- package/dist/registry/chat/file-review-part.d.ts +30 -0
- package/dist/registry/chat/folder-button.d.ts +20 -0
- package/dist/registry/chat/generated-images-grid.d.ts +15 -0
- package/dist/registry/chat/generation-status-bar.d.ts +19 -0
- package/dist/registry/chat/hint-banner.d.ts +28 -0
- package/dist/registry/chat/image-attachment.d.ts +19 -0
- package/dist/registry/chat/image-generating.d.ts +15 -0
- package/dist/registry/chat/markdown.d.ts +8 -0
- package/dist/registry/chat/mermaid-part.d.ts +17 -0
- package/dist/registry/chat/permission-card.d.ts +24 -0
- package/dist/registry/chat/plan-part.d.ts +30 -0
- package/dist/registry/chat/queue-indicator.d.ts +27 -0
- package/dist/registry/chat/reasoning-step/compound.d.ts +17 -0
- package/dist/registry/chat/reasoning-step/context.d.ts +10 -0
- package/dist/registry/chat/reasoning-step/index.d.ts +14 -0
- package/dist/registry/chat/reasoning-step/types.d.ts +95 -0
- package/dist/registry/chat/related-prompts.d.ts +23 -0
- package/dist/registry/chat/response/compound.d.ts +25 -0
- package/dist/registry/chat/response/context.d.ts +9 -0
- package/dist/registry/chat/response/index.d.ts +15 -0
- package/dist/registry/chat/response/types.d.ts +99 -0
- package/dist/registry/chat/send-button.d.ts +17 -0
- package/dist/registry/chat/streaming-markdown-block.d.ts +8 -0
- package/dist/registry/chat/task-part.d.ts +28 -0
- package/dist/registry/chat/terminal-code-block-part.d.ts +18 -0
- package/dist/registry/chat/thinking-indicator.d.ts +14 -0
- package/dist/registry/chat/tool-invocation-card.d.ts +20 -0
- package/dist/registry/chat/user-message.d.ts +6 -0
- package/dist/registry/chat/user-question/UserQuestionCard.d.ts +30 -0
- package/dist/registry/chat/user-question/UserQuestionFooter.d.ts +18 -0
- package/dist/registry/chat/user-question/UserQuestionHeader.d.ts +20 -0
- package/dist/registry/chat/user-question/compound.d.ts +37 -0
- package/dist/registry/chat/user-question/context.d.ts +55 -0
- package/dist/registry/chat/user-question/index.d.ts +15 -0
- package/dist/registry/chat/user-question/types.d.ts +52 -0
- package/dist/registry/chat/user-question/useUserQuestionKeyboard.d.ts +17 -0
- package/dist/registry/chat/user-question/useUserQuestionState.d.ts +26 -0
- package/dist/registry/chat/user-question-answer.d.ts +13 -0
- package/dist/registry/lib/file-icon-maps.d.ts +20 -0
- package/dist/registry/lib/use-mermaid-render.d.ts +5 -0
- package/dist/registry/lib/utils.d.ts +11 -0
- package/dist/requirementDiagram-UZGBJVZJ-DcWaCuXr.js +850 -0
- package/dist/requirementDiagram-UZGBJVZJ-gfdlrFiq.cjs +64 -0
- package/dist/sankeyDiagram-TZEHDZUN-CQIKFwD0.js +810 -0
- package/dist/sankeyDiagram-TZEHDZUN-DvPtzQvC.cjs +10 -0
- package/dist/scale/computed.css +103 -0
- package/dist/scale/config.css +110 -0
- package/dist/scale/index.css +30 -0
- package/dist/scale/presets/compact.css +30 -0
- package/dist/scale/presets/dense.css +64 -0
- package/dist/scale/presets/sharp.css +40 -0
- package/dist/scale/presets/soft.css +16 -0
- package/dist/scale.css +13 -0
- package/dist/sequenceDiagram-WL72ISMW-BNrsMagL.cjs +145 -0
- package/dist/sequenceDiagram-WL72ISMW-iCX3ckKx.js +2511 -0
- package/dist/spark-design.cjs.js +265 -0
- package/dist/spark-design.es.js +13486 -0
- package/dist/src/components/basic/AlertDialog/index.d.ts +20 -0
- package/dist/src/components/basic/Avatar/index.d.ts +7 -0
- package/dist/src/components/basic/Button/index.d.ts +7 -0
- package/dist/src/components/basic/Collapse/index.d.ts +15 -0
- package/dist/src/components/basic/Collapsible/index.d.ts +7 -0
- package/dist/src/components/basic/CollapsibleCard/index.d.ts +7 -0
- package/dist/src/components/basic/CollapsibleSection/index.d.ts +43 -0
- package/dist/src/components/basic/DropdownMenu/index.d.ts +19 -0
- package/dist/src/components/basic/EllipsisText/index.d.ts +53 -0
- package/dist/src/components/basic/IconButton/index.d.ts +7 -0
- package/dist/src/components/basic/Kbd/index.d.ts +7 -0
- package/dist/src/components/basic/OptionList/index.d.ts +7 -0
- package/dist/src/components/basic/Pagination/index.d.ts +7 -0
- package/dist/src/components/basic/Progress/index.d.ts +7 -0
- package/dist/src/components/basic/RadioGroup/index.d.ts +7 -0
- package/dist/src/components/basic/Resizable/index.d.ts +7 -0
- package/dist/src/components/basic/Scrollbar/index.d.ts +7 -0
- package/dist/src/components/basic/Select/index.d.ts +17 -0
- package/dist/src/components/basic/ShimmeringText/index.d.ts +7 -0
- package/dist/src/components/basic/SidebarMenu/index.d.ts +4 -0
- package/dist/src/components/basic/Skeleton/index.d.ts +7 -0
- package/dist/src/components/basic/Slider/index.d.ts +7 -0
- package/dist/src/components/basic/Spinner/index.d.ts +7 -0
- package/dist/src/components/basic/Switch/index.d.ts +38 -0
- package/dist/src/components/basic/Table/index.d.ts +7 -0
- package/dist/src/components/basic/Tabs/index.d.ts +7 -0
- package/dist/src/components/basic/Tag/index.d.ts +10 -0
- package/dist/src/components/basic/Toast/index.d.ts +12 -0
- package/dist/src/components/basic/Toggle/index.d.ts +7 -0
- package/dist/src/components/basic/Tooltip/index.d.ts +21 -0
- package/dist/src/components/basic/Typography/index.d.ts +7 -0
- package/dist/src/components/chat/AskUserPart/index.d.ts +6 -0
- package/dist/src/components/chat/BrowserActionPart/index.d.ts +7 -0
- package/dist/src/components/chat/ChatInput/index.d.ts +29 -0
- package/dist/src/components/chat/CodeBlockPart/index.d.ts +7 -0
- package/dist/src/components/chat/FileAttachment/index.d.ts +3 -0
- package/dist/src/components/chat/FileCard/index.d.ts +3 -0
- package/dist/src/components/chat/FileReviewPart/index.d.ts +7 -0
- package/dist/src/components/chat/FolderButton/index.d.ts +5 -0
- package/dist/src/components/chat/GeneratedImagesGrid/index.d.ts +7 -0
- package/dist/src/components/chat/GenerationStatusBar/index.d.ts +7 -0
- package/dist/src/components/chat/HintBanner/index.d.ts +6 -0
- package/dist/src/components/chat/ImageAttachment/index.d.ts +3 -0
- package/dist/src/components/chat/ImageGenerating/index.d.ts +6 -0
- package/dist/src/components/chat/Markdown/demo-content.d.ts +1 -0
- package/dist/src/components/chat/Markdown/index.d.ts +7 -0
- package/dist/src/components/chat/MermaidPart/index.d.ts +6 -0
- package/dist/src/components/chat/PermissionCard/index.d.ts +4 -0
- package/dist/src/components/chat/PlanPart/index.d.ts +6 -0
- package/dist/src/components/chat/QueueIndicator/index.d.ts +4 -0
- package/dist/src/components/chat/ReasoningStep/index.d.ts +13 -0
- package/dist/src/components/chat/RelatedPrompts/index.d.ts +6 -0
- package/dist/src/components/chat/Response/StreamingMarkdownBlock.d.ts +6 -0
- package/dist/src/components/chat/Response/index.d.ts +16 -0
- package/dist/src/components/chat/SendButton/index.d.ts +5 -0
- package/dist/src/components/chat/TaskPart/index.d.ts +7 -0
- package/dist/src/components/chat/TerminalCodeBlockPart/index.d.ts +6 -0
- package/dist/src/components/chat/ThinkingIndicator/index.d.ts +6 -0
- package/dist/src/components/chat/ToolInvocationCard/index.d.ts +4 -0
- package/dist/src/components/chat/UserMessage/index.d.ts +7 -0
- package/dist/src/components/chat/UserQuestion/index.d.ts +19 -0
- package/dist/src/components/chat/UserQuestionAnswer/index.d.ts +3 -0
- package/dist/src/components/index.d.ts +138 -0
- package/dist/src/icons/context.d.ts +26 -0
- package/dist/src/icons/types.d.ts +18 -0
- package/dist/src/lib/ThemeStyleContext.d.ts +134 -0
- package/dist/src/lib/file-icon.d.ts +16 -0
- package/dist/src/lib/i18n.d.ts +12 -0
- package/dist/src/lib/index.d.ts +10 -0
- package/dist/src/lib/motion.d.ts +22 -0
- package/dist/src/lib/utils.d.ts +11 -0
- package/dist/stateDiagram-FKZM4ZOC-DBvJ_eeL.cjs +1 -0
- package/dist/stateDiagram-FKZM4ZOC-ZVsJlaHJ.js +263 -0
- package/dist/stateDiagram-v2-4FDKWEC3-CB_nTHcE.js +16 -0
- package/dist/stateDiagram-v2-4FDKWEC3-Xkx17v6T.cjs +1 -0
- package/dist/theme-base.css +270 -0
- package/dist/theme.css +17 -0
- package/dist/themes/dark-parchment.css +133 -0
- package/dist/themes/dark-qoder.css +133 -0
- package/dist/themes/light-parchment.css +124 -0
- package/dist/themes/light-qoder.css +132 -0
- package/dist/timeline-definition-IT6M3QCI-BmGkYQiz.cjs +61 -0
- package/dist/timeline-definition-IT6M3QCI-Ck8zTt6w.js +795 -0
- package/dist/tokens/CLAUDE.md +305 -0
- package/dist/tokens/index.css +35 -0
- package/dist/tokens/scale/computed.css +103 -0
- package/dist/tokens/scale/config.css +110 -0
- package/dist/tokens/scale/index.css +30 -0
- package/dist/tokens/scale/presets/compact.css +30 -0
- package/dist/tokens/scale/presets/dense.css +64 -0
- package/dist/tokens/scale/presets/sharp.css +40 -0
- package/dist/tokens/scale/presets/soft.css +16 -0
- package/dist/tokens/scale.css +13 -0
- package/dist/tokens/scrollbar-utility.css +35 -0
- package/dist/tokens/theme-base.css +270 -0
- package/dist/tokens/theme.css +17 -0
- package/dist/tokens/themes/dark-parchment.css +133 -0
- package/dist/tokens/themes/dark-qoder.css +133 -0
- package/dist/tokens/themes/light-parchment.css +124 -0
- package/dist/tokens/themes/light-qoder.css +132 -0
- package/dist/treemap-GDKQZRPO-B9sfERx8.js +17922 -0
- package/dist/treemap-GDKQZRPO-BVfJRs0Z.cjs +160 -0
- package/dist/xychartDiagram-PRI3JC2R-By_S8NzN.js +1340 -0
- package/dist/xychartDiagram-PRI3JC2R-CNfDrGxM.cjs +7 -0
- package/package.json +128 -19
- /package/{dist → cli/dist}/commands/add.js +0 -0
- /package/{dist → cli/dist}/commands/diff.js +0 -0
- /package/{dist → cli/dist}/commands/init.js +0 -0
- /package/{dist → cli/dist}/commands/list.js +0 -0
- /package/{dist → cli/dist}/index.js +0 -0
- /package/{dist → cli/dist}/utils/config.js +0 -0
- /package/{dist → cli/dist}/utils/registry.js +0 -0
- /package/{dist → cli/dist}/utils/tokens.js +0 -0
- /package/{dist → cli/dist}/utils/transform.js +0 -0
- /package/{registry → cli/registry}/__tests__/basic/button.test.tsx +0 -0
- /package/{registry → cli/registry}/__tests__/chat/markdown.test.tsx +0 -0
- /package/{registry → cli/registry}/__tests__/chat/thinking-indicator.test.tsx +0 -0
- /package/{registry → cli/registry}/__tests__/chat/tool-invocation-card.test.tsx +0 -0
- /package/{registry → cli/registry}/basic/alert-dialog.tsx +0 -0
- /package/{registry → cli/registry}/basic/avatar.tsx +0 -0
- /package/{registry → cli/registry}/basic/button.tsx +0 -0
- /package/{registry → cli/registry}/basic/collapse.tsx +0 -0
- /package/{registry → cli/registry}/basic/collapsible-card.tsx +0 -0
- /package/{registry → cli/registry}/basic/collapsible.tsx +0 -0
- /package/{registry → cli/registry}/basic/dropdown-menu.tsx +0 -0
- /package/{registry → cli/registry}/basic/icon-button.tsx +0 -0
- /package/{registry → cli/registry}/basic/icons-inline.tsx +0 -0
- /package/{registry → cli/registry}/basic/kbd.tsx +0 -0
- /package/{registry → cli/registry}/basic/option-list.tsx +0 -0
- /package/{registry → cli/registry}/basic/pagination.tsx +0 -0
- /package/{registry → cli/registry}/basic/progress.tsx +0 -0
- /package/{registry → cli/registry}/basic/radio-group.tsx +0 -0
- /package/{registry → cli/registry}/basic/resizable.tsx +0 -0
- /package/{registry → cli/registry}/basic/scrollbar.tsx +0 -0
- /package/{registry → cli/registry}/basic/select.tsx +0 -0
- /package/{registry → cli/registry}/basic/shimmering-text.tsx +0 -0
- /package/{registry → cli/registry}/basic/sidebar-menu.tsx +0 -0
- /package/{registry → cli/registry}/basic/skeleton.tsx +0 -0
- /package/{registry → cli/registry}/basic/slider.tsx +0 -0
- /package/{registry → cli/registry}/basic/sonner.tsx +0 -0
- /package/{registry → cli/registry}/basic/spinner.tsx +0 -0
- /package/{registry → cli/registry}/basic/switch.tsx +0 -0
- /package/{registry → cli/registry}/basic/table.tsx +0 -0
- /package/{registry → cli/registry}/basic/tabs.tsx +0 -0
- /package/{registry → cli/registry}/basic/tag.tsx +0 -0
- /package/{registry → cli/registry}/basic/theme-from-document.ts +0 -0
- /package/{registry → cli/registry}/basic/toggle.tsx +0 -0
- /package/{registry → cli/registry}/basic/tooltip.tsx +0 -0
- /package/{registry → cli/registry}/basic/typography.tsx +0 -0
- /package/{registry → cli/registry}/chat/ask-user-part.tsx +0 -0
- /package/{registry → cli/registry}/chat/browser-action-part.tsx +0 -0
- /package/{registry → cli/registry}/chat/chat-input/chat-input-folder-selector.tsx +0 -0
- /package/{registry → cli/registry}/chat/chat-input/chat-input-model-switcher.tsx +0 -0
- /package/{registry → cli/registry}/chat/chat-input/chat-input-textarea.tsx +0 -0
- /package/{registry → cli/registry}/chat/chat-input/compound.tsx +0 -0
- /package/{registry → cli/registry}/chat/chat-input/context.tsx +0 -0
- /package/{registry → cli/registry}/chat/chat-input/folder-permission-dialog.tsx +0 -0
- /package/{registry → cli/registry}/chat/chat-input/index.tsx +0 -0
- /package/{registry → cli/registry}/chat/chat-input/types.ts +0 -0
- /package/{registry → cli/registry}/chat/chat-input/useAutoResizeTextarea.ts +0 -0
- /package/{registry → cli/registry}/chat/code-block-part.tsx +0 -0
- /package/{registry → cli/registry}/chat/file-attachment.tsx +0 -0
- /package/{registry → cli/registry}/chat/file-card.tsx +0 -0
- /package/{registry → cli/registry}/chat/file-review-part.tsx +0 -0
- /package/{registry → cli/registry}/chat/folder-button.tsx +0 -0
- /package/{registry → cli/registry}/chat/generated-images-grid.tsx +0 -0
- /package/{registry → cli/registry}/chat/generation-status-bar.tsx +0 -0
- /package/{registry → cli/registry}/chat/hint-banner.tsx +0 -0
- /package/{registry → cli/registry}/chat/image-attachment.tsx +0 -0
- /package/{registry → cli/registry}/chat/image-generating.tsx +0 -0
- /package/{registry → cli/registry}/chat/markdown.tsx +0 -0
- /package/{registry → cli/registry}/chat/mermaid-part.tsx +0 -0
- /package/{registry → cli/registry}/chat/permission-card.tsx +0 -0
- /package/{registry → cli/registry}/chat/plan-part.tsx +0 -0
- /package/{registry → cli/registry}/chat/queue-indicator.tsx +0 -0
- /package/{registry → cli/registry}/chat/reasoning-step/compound.tsx +0 -0
- /package/{registry → cli/registry}/chat/reasoning-step/context.tsx +0 -0
- /package/{registry → cli/registry}/chat/reasoning-step/index.tsx +0 -0
- /package/{registry → cli/registry}/chat/reasoning-step/types.ts +0 -0
- /package/{registry → cli/registry}/chat/related-prompts.tsx +0 -0
- /package/{registry → cli/registry}/chat/response/compound.tsx +0 -0
- /package/{registry → cli/registry}/chat/response/context.tsx +0 -0
- /package/{registry → cli/registry}/chat/response/index.tsx +0 -0
- /package/{registry → cli/registry}/chat/response/types.ts +0 -0
- /package/{registry → cli/registry}/chat/send-button.tsx +0 -0
- /package/{registry → cli/registry}/chat/streaming-markdown-block.tsx +0 -0
- /package/{registry → cli/registry}/chat/task-part.tsx +0 -0
- /package/{registry → cli/registry}/chat/terminal-code-block-part.tsx +0 -0
- /package/{registry → cli/registry}/chat/thinking-indicator.tsx +0 -0
- /package/{registry → cli/registry}/chat/tool-invocation-card.tsx +0 -0
- /package/{registry → cli/registry}/chat/user-message.tsx +0 -0
- /package/{registry → cli/registry}/chat/user-question/UserQuestionCard.tsx +0 -0
- /package/{registry → cli/registry}/chat/user-question/UserQuestionFooter.tsx +0 -0
- /package/{registry → cli/registry}/chat/user-question/UserQuestionHeader.tsx +0 -0
- /package/{registry → cli/registry}/chat/user-question/compound.tsx +0 -0
- /package/{registry → cli/registry}/chat/user-question/context.tsx +0 -0
- /package/{registry → cli/registry}/chat/user-question/index.tsx +0 -0
- /package/{registry → cli/registry}/chat/user-question/types.ts +0 -0
- /package/{registry → cli/registry}/chat/user-question/useUserQuestionKeyboard.ts +0 -0
- /package/{registry → cli/registry}/chat/user-question/useUserQuestionState.ts +0 -0
- /package/{registry → cli/registry}/chat/user-question-answer.tsx +0 -0
- /package/{registry → cli/registry}/lib/file-icon-maps.ts +0 -0
- /package/{registry → cli/registry}/lib/use-mermaid-render.ts +0 -0
- /package/{registry → cli/registry}/lib/utils.ts +0 -0
- /package/{registry → cli/registry}/meta.json +0 -0
- /package/{registry → cli/registry}/tokens/index.css +0 -0
- /package/{registry → cli/registry}/tokens/scale/computed.css +0 -0
- /package/{registry → cli/registry}/tokens/scale/config.css +0 -0
- /package/{registry → cli/registry}/tokens/scale/index.css +0 -0
- /package/{registry → cli/registry}/tokens/scale/presets/compact.css +0 -0
- /package/{registry → cli/registry}/tokens/scale/presets/dense.css +0 -0
- /package/{registry → cli/registry}/tokens/scale/presets/sharp.css +0 -0
- /package/{registry → cli/registry}/tokens/scale/presets/soft.css +0 -0
- /package/{registry → cli/registry}/tokens/scale.css +0 -0
- /package/{registry → cli/registry}/tokens/scrollbar-utility.css +0 -0
- /package/{registry → cli/registry}/tokens/theme.css +0 -0
- /package/{registry → cli/registry}/tokens/themes/dark-parchment.css +0 -0
- /package/{registry → cli/registry}/tokens/themes/dark-qoder.css +0 -0
- /package/{registry → cli/registry}/tokens/themes/light-parchment.css +0 -0
- /package/{registry → cli/registry}/tokens/themes/light-qoder.css +0 -0
package/README.md
CHANGED
|
@@ -1,193 +1,287 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Spark Design
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
现代化 React 设计系统,支持双维度主题(颜色 theme + 布局 scale),5 种内置布局风格,提供 Basic 基础组件与 Chat 对话流组件,可扩展颜色主题。
|
|
4
4
|
|
|
5
|
-
**当前版本**:`0.
|
|
5
|
+
**当前版本**:`0.4.4`([变更说明](docs/NPM发布指南.md))
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
## 快速开始
|
|
7
|
+
> 🌟 **纯新手?** 查看 [快速上手指南-新手版](docs/快速上手指南-新手版.md),一步步带你跑起来!
|
|
10
8
|
|
|
11
|
-
|
|
9
|
+
> 以下为**安装与使用说明**;仓库结构、开发脚本与贡献方式见文末 [仓库与开发](#仓库与开发)。
|
|
12
10
|
|
|
13
|
-
|
|
11
|
+
## 特性
|
|
14
12
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
- **双维度主题**:`data-theme`(颜色)+ `data-style`(布局),独立切换
|
|
14
|
+
- **5 种布局风格**:neutral / compact / soft / sharp / dense
|
|
15
|
+
- **内置颜色主题**:light / dark
|
|
16
|
+
- **CSS 变量驱动**:组件仅用 token,覆盖变量即可定制
|
|
17
|
+
- **Tailwind 友好**:类名与设计 token 映射,无硬编码色值
|
|
18
|
+
- **组件分层**:Basic 原子组件 + Chat 对话组件,开箱即用
|
|
18
19
|
|
|
19
|
-
|
|
20
|
+
## 两种使用方式
|
|
20
21
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
> - 例如默认:`src/components/ui/basic/button.tsx`、`src/components/ui/chat/chat-input/index.tsx`
|
|
26
|
-
|
|
27
|
-
### 步骤 2:引入设计 token
|
|
28
|
-
|
|
29
|
-
CLI 会生成 `src/qoder-tokens.css`,组件样式依赖其中的设计变量。请在**应用入口**引入一次:
|
|
22
|
+
| 方式 | 适用场景 | 命令 |
|
|
23
|
+
|------|----------|------|
|
|
24
|
+
| **npm 安装** | 直接引用、不改源码 | `npm install sparkdesign` |
|
|
25
|
+
| **CLI 按需引入** | 复制源码到项目、可自由修改 | `npx sparkdesign init` → `npx sparkdesign add button` |
|
|
30
26
|
|
|
31
|
-
|
|
27
|
+
**发布模型**:`sparkdesign` 是唯一发布到 npm 的包。CLI 不是第二个独立 npm 包,而是根包中的 `bin` 入口;因此用户侧既可以 `npm install sparkdesign`,也可以直接 `npx sparkdesign@latest add button`。
|
|
32
28
|
|
|
33
|
-
|
|
29
|
+
---
|
|
34
30
|
|
|
35
|
-
|
|
31
|
+
## 安装(npm 包)
|
|
36
32
|
|
|
37
|
-
```
|
|
38
|
-
|
|
33
|
+
```bash
|
|
34
|
+
npm install sparkdesign
|
|
39
35
|
```
|
|
40
36
|
|
|
41
|
-
|
|
37
|
+
**依赖**:需自行安装 `react`、`react-dom`(>=18)。
|
|
42
38
|
|
|
43
|
-
|
|
39
|
+
### 按需引入(CLI,推荐)
|
|
44
40
|
|
|
45
|
-
|
|
46
|
-
import '../qoder-tokens.css'
|
|
47
|
-
```
|
|
41
|
+
若希望**将组件源码复制到项目中**并自由修改,可使用 CLI:
|
|
48
42
|
|
|
49
|
-
|
|
43
|
+
```bash
|
|
44
|
+
npx sparkdesign init # 初始化 components.json、tokens、utils
|
|
45
|
+
npx sparkdesign add button tooltip # 添加组件到 src/components/qoder/
|
|
46
|
+
npx sparkdesign list # 列出可用组件
|
|
47
|
+
npx sparkdesign diff button # 对比本地与注册表差异
|
|
48
|
+
```
|
|
50
49
|
|
|
51
|
-
|
|
50
|
+
详见 [docs/CLI按需引入方案.md](docs/CLI按需引入方案.md)。
|
|
52
51
|
|
|
53
|
-
|
|
52
|
+
---
|
|
54
53
|
|
|
55
|
-
|
|
56
|
-
- **Chat**:`import { X } from '@/components/ui/chat/<组件名>'`
|
|
54
|
+
## 快速开始
|
|
57
55
|
|
|
58
|
-
|
|
56
|
+
三步即可在项目中使用组件,**无需配置 Tailwind**:
|
|
59
57
|
|
|
60
58
|
```tsx
|
|
61
|
-
//
|
|
62
|
-
import
|
|
59
|
+
// 1. 引入样式(必做)
|
|
60
|
+
import 'sparkdesign/style'
|
|
61
|
+
|
|
62
|
+
// 2. 按需引入组件与类型
|
|
63
|
+
import { Button } from 'sparkdesign'
|
|
64
|
+
import type { ButtonProps } from 'sparkdesign'
|
|
63
65
|
|
|
66
|
+
// 3. 在根节点设置主题与布局(可选,不设则使用默认 light + neutral)
|
|
64
67
|
function App() {
|
|
65
68
|
return (
|
|
66
|
-
<div>
|
|
67
|
-
<Button variant="primary">点击</Button>
|
|
69
|
+
<div data-theme="light" data-style="neutral">
|
|
70
|
+
<Button variant="primary" size="md">点击</Button>
|
|
68
71
|
</div>
|
|
69
72
|
)
|
|
70
73
|
}
|
|
71
74
|
```
|
|
72
75
|
|
|
73
|
-
|
|
76
|
+
**样式引入方式**(三选一,推荐方式 A):
|
|
77
|
+
|
|
78
|
+
| 方式 | 用法 | 说明 |
|
|
79
|
+
|------|------|------|
|
|
80
|
+
| **A** | `import 'sparkdesign/style'` | **推荐**。预编译完整样式(Tailwind 工具类 + 设计 token),无需配置 Tailwind |
|
|
81
|
+
| **B** | `import 'sparkdesign/theme.css'`<br>`import 'sparkdesign/scale.css'` | 仅引入设计 token,适合已有 Tailwind 4 项目自行扫描组件并覆盖变量(需在消费者 CSS 中 `@source` 指向本包) |
|
|
82
|
+
| **C** | 只引入组件、不引入样式 | 需在项目中自行提供与设计 token 同名的 CSS 变量,否则组件无样式 |
|
|
83
|
+
|
|
84
|
+
> **Markdown 数学公式**:若使用 `MarkdownBody` 组件且需要渲染 KaTeX 数学公式,额外引入:
|
|
85
|
+
> `import 'sparkdesign/katex.css'`
|
|
86
|
+
|
|
87
|
+
自定义主题时,请**先**引入设计系统样式,**再**引入你的覆盖 CSS,变量覆盖才会生效。
|
|
74
88
|
|
|
75
89
|
---
|
|
76
90
|
|
|
77
|
-
##
|
|
91
|
+
## 设计系统用法
|
|
78
92
|
|
|
79
|
-
|
|
93
|
+
### 1. 引入样式(必做)
|
|
80
94
|
|
|
81
|
-
|
|
95
|
+
样式引入的三种方式见上方「快速开始」表格。
|
|
82
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
|
+
- **方式 A**(推荐):`import 'sparkdesign/style'` 包含预编译的 Tailwind 工具类 + theme/scale 设计 token,消费者项目**不需要安装或配置 Tailwind**。
|
|
98
|
+
- **方式 B**(Tailwind 用户):仅引入 token 文件,消费者需在自己的 CSS 中 `@source` 指向本包以扫描组件中使用的 Tailwind 类名:
|
|
87
99
|
|
|
88
|
-
|
|
100
|
+
```css
|
|
101
|
+
/* 消费者 CSS(已有 Tailwind 4 的项目)*/
|
|
102
|
+
@import "tailwindcss";
|
|
103
|
+
@source "../node_modules/sparkdesign/dist";
|
|
104
|
+
@import "sparkdesign/theme.css";
|
|
105
|
+
@import "sparkdesign/scale.css";
|
|
106
|
+
```
|
|
89
107
|
|
|
90
|
-
|
|
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'`)。 |
|
|
108
|
+
约定:自定义主题时,**先**引入设计系统样式,**再**引入你的覆盖 CSS。
|
|
94
109
|
|
|
95
|
-
|
|
110
|
+
### 2. 颜色主题(theme)
|
|
96
111
|
|
|
97
|
-
|
|
112
|
+
通过 `data-theme` 切换颜色主题,作用于主色、背景、边框、语义色等。
|
|
98
113
|
|
|
99
|
-
|
|
100
|
-
|
|
114
|
+
| 主题 | 说明 |
|
|
115
|
+
|--------|----------|
|
|
116
|
+
| `light` | 亮色模式(默认) |
|
|
117
|
+
| `dark` | 暗色模式 |
|
|
101
118
|
|
|
102
|
-
|
|
119
|
+
```tsx
|
|
120
|
+
// 在根节点或任意父节点设置
|
|
121
|
+
<div data-theme="dark">
|
|
122
|
+
<Button variant="primary">按钮</Button>
|
|
123
|
+
</div>
|
|
124
|
+
```
|
|
103
125
|
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
@import "./qoder-tokens.css";
|
|
126
|
+
```html
|
|
127
|
+
<!-- 或直接挂在 body -->
|
|
128
|
+
<body data-theme="dark">
|
|
108
129
|
```
|
|
109
130
|
|
|
110
|
-
|
|
131
|
+
主题对应的 CSS 变量定义在 **theme.css**(如 `--color-primary`、`--color-bg-container` 等)。自定义主题见下文「自定义 theme / scale」。
|
|
111
132
|
|
|
112
|
-
###
|
|
133
|
+
### 3. 布局风格(scale)
|
|
113
134
|
|
|
114
|
-
|
|
135
|
+
通过 `data-style` 切换布局尺度,作用于间距、圆角、字号等。
|
|
115
136
|
|
|
116
|
-
|
|
117
|
-
|
|
137
|
+
| 风格 | 描述 | 特点 |
|
|
138
|
+
|-----------|----------------|----------------|
|
|
139
|
+
| `neutral` | 平衡的标准 | 默认,简洁直观 |
|
|
140
|
+
| `compact` | 优化效率 | 更窄间距,紧凑 |
|
|
141
|
+
| `soft` | 舒适至上 | 大圆角、宽松间距 |
|
|
142
|
+
| `sharp` | 几何精度 | 直角、利落线条 |
|
|
143
|
+
| `dense` | 信息密集 | 最小留白 |
|
|
118
144
|
|
|
119
|
-
|
|
145
|
+
```tsx
|
|
146
|
+
<div data-style="soft">
|
|
147
|
+
<Button>按钮</Button>
|
|
148
|
+
</div>
|
|
149
|
+
```
|
|
120
150
|
|
|
121
|
-
|
|
151
|
+
布局变量定义在 **scale.css**(如 `--spacing-*`、`--radius-*`、`--font-size-*`)。可组合使用:
|
|
122
152
|
|
|
123
|
-
|
|
153
|
+
```tsx
|
|
154
|
+
<div data-theme="dark" data-style="soft">
|
|
155
|
+
{/* 暗色 + 柔和布局 */}
|
|
156
|
+
</div>
|
|
157
|
+
```
|
|
124
158
|
|
|
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` | 覆盖已有组件文件 |
|
|
159
|
+
### 4. 自定义 theme / scale
|
|
133
160
|
|
|
134
|
-
|
|
161
|
+
在**先引入设计系统样式之后**,用你自己的 CSS 覆盖变量即可。
|
|
135
162
|
|
|
136
|
-
|
|
163
|
+
**选择器约定**:
|
|
137
164
|
|
|
138
|
-
|
|
165
|
+
- `:root` — 覆盖默认
|
|
166
|
+
- `[data-theme="主题名"]` — 颜色主题(自定义名称)
|
|
167
|
+
- `[data-style="风格名"]` — 布局风格(自定义名称)
|
|
139
168
|
|
|
140
|
-
|
|
169
|
+
```css
|
|
170
|
+
/* 自定义颜色主题 */
|
|
171
|
+
[data-theme="my-brand"] {
|
|
172
|
+
--color-primary: #3B82F6;
|
|
173
|
+
--color-primary-hover: #2563EB;
|
|
174
|
+
}
|
|
141
175
|
|
|
142
|
-
|
|
143
|
-
|
|
176
|
+
/* 自定义布局风格 */
|
|
177
|
+
[data-style="custom"] {
|
|
178
|
+
--spacing-4: 20px;
|
|
179
|
+
--radius-md: 8px;
|
|
180
|
+
}
|
|
144
181
|
```
|
|
145
182
|
|
|
146
|
-
|
|
183
|
+
完整变量清单见 [NPM 发布指南](https://github.com/nicepkg/spark-design/blob/master/docs/NPM发布指南.md)(颜色 `--color-*`、间距 `--spacing-*`、圆角 `--radius-*`、字号 `--font-size-*` 等)。
|
|
147
184
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
185
|
+
### 5. Portal 浮层与主题一致
|
|
186
|
+
|
|
187
|
+
DropdownMenu、Tooltip 等会挂到 `body`,不会继承局部容器的 `data-theme` / `data-style`。两种做法:
|
|
188
|
+
|
|
189
|
+
- **做法 A**:把 `data-theme`、`data-style` 设到 `<html>` 或 `<body>`,全局一致。
|
|
190
|
+
- **做法 B**:用 `ThemeStyleProvider` 包裹应用,浮层会使用同一主题/风格:
|
|
191
|
+
|
|
192
|
+
```tsx
|
|
193
|
+
import { ThemeStyleProvider, Button, DropdownMenu } from 'sparkdesign'
|
|
194
|
+
|
|
195
|
+
function App() {
|
|
196
|
+
const theme = 'dark'
|
|
197
|
+
const style = 'soft'
|
|
198
|
+
return (
|
|
199
|
+
<ThemeStyleProvider value={{ theme, style }}>
|
|
200
|
+
<div data-theme={theme} data-style={style}>
|
|
201
|
+
<Button>打开</Button>
|
|
202
|
+
<DropdownMenu>...</DropdownMenu>
|
|
203
|
+
</div>
|
|
204
|
+
</ThemeStyleProvider>
|
|
205
|
+
)
|
|
206
|
+
}
|
|
151
207
|
```
|
|
152
208
|
|
|
153
|
-
|
|
209
|
+
## 组件使用
|
|
154
210
|
|
|
155
|
-
|
|
211
|
+
组件与类型均从主入口按需引入,用法见上方「快速开始」。示例:
|
|
156
212
|
|
|
157
|
-
|
|
213
|
+
```tsx
|
|
214
|
+
import 'sparkdesign/style'
|
|
215
|
+
import { Button } from 'sparkdesign'
|
|
216
|
+
import type { ButtonProps } from 'sparkdesign'
|
|
158
217
|
|
|
159
|
-
|
|
160
|
-
|
|
218
|
+
function App() {
|
|
219
|
+
return (
|
|
220
|
+
<div data-theme="light" data-style="neutral">
|
|
221
|
+
<Button variant="primary" size="md">Click me</Button>
|
|
222
|
+
</div>
|
|
223
|
+
)
|
|
224
|
+
}
|
|
225
|
+
```
|
|
161
226
|
|
|
162
|
-
|
|
227
|
+
## 组件概览
|
|
163
228
|
|
|
164
|
-
|
|
229
|
+
| 分层 | 说明 | 示例 |
|
|
230
|
+
|------|------|------|
|
|
231
|
+
| **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 … |
|
|
232
|
+
| **Chat** | 对话流相关组件 | ChatInput, SendButton, Request, Response, FileCard, FileAttachment, ImageAttachment, FolderButton, ReasoningStep, ToolInvocationCard, PermissionCard, MarkdownBody, GenerationStatusBar, ThinkingIndicator, ImageGenerating, RelatedPrompts, SuggestionPart, SidebarMenu … |
|
|
165
233
|
|
|
166
|
-
|
|
234
|
+
完整导出见 [src/components/index.ts](src/components/index.ts)。图标通过 `IconsProvider` / `useIcon` 注入,可替换为 Lucide、Remix 等,见 [图标自定义说明](docs/图标自定义说明.md)。
|
|
167
235
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
|
171
|
-
|
|
172
|
-
|
|
|
173
|
-
|
|
|
236
|
+
## 文档(仓库内)
|
|
237
|
+
|
|
238
|
+
| 文档 | 说明 |
|
|
239
|
+
|------|------|
|
|
240
|
+
| [NPM 发布指南](docs/NPM发布指南.md) | 变量清单、主题覆盖、发布步骤 |
|
|
241
|
+
| [组件入库文档](docs/组件入库文档.md) | 组件与 Showcase 规范 |
|
|
242
|
+
| [图标自定义说明](docs/图标自定义说明.md) | IconsProvider / 替换为 Lucide 等 |
|
|
243
|
+
| [CLI 按需引入方案](docs/CLI按需引入方案.md) | `npx sparkdesign init / add` 使用说明 |
|
|
174
244
|
|
|
175
245
|
---
|
|
176
246
|
|
|
177
|
-
##
|
|
247
|
+
## 仓库与开发
|
|
248
|
+
|
|
249
|
+
以下内容面向**参与仓库开发**的贡献者;仅使用本包时可忽略。
|
|
250
|
+
|
|
251
|
+
### 组件展示(Showcase)
|
|
178
252
|
|
|
179
|
-
|
|
180
|
-
- **运行时依赖**:组件会用到 `class-variance-authority`、`clsx`(以及部分组件需要 `tailwind-merge`、`@radix-ui/*` 等)。若执行 `npx sparkdesign add button` 后出现依赖缺失,请在项目根目录执行:
|
|
253
|
+
本仓库内 **apps/showcase** 提供所有组件的演示与 Props 文档:
|
|
181
254
|
|
|
182
255
|
```bash
|
|
183
|
-
npm install
|
|
256
|
+
cd apps/showcase && npm install && npm run dev
|
|
184
257
|
```
|
|
185
258
|
|
|
186
|
-
|
|
259
|
+
### 项目脚本
|
|
187
260
|
|
|
188
|
-
|
|
261
|
+
| 脚本 | 说明 |
|
|
262
|
+
|------|------|
|
|
263
|
+
| `npm run dev` | 设计系统开发服务器 |
|
|
264
|
+
| `npm run build` | 生产构建:Vite 输出 JS → @tailwindcss/cli 预编译 CSS → tsc 类型声明 |
|
|
265
|
+
| `npm run build:css` | 仅重新生成预编译 CSS(`dist/qoder-design.css`) |
|
|
266
|
+
| `npm run preview` | 预览构建产物 |
|
|
267
|
+
| `cd apps/showcase && npm run dev` | 组件展示站点 |
|
|
268
|
+
|
|
269
|
+
### 目录结构
|
|
270
|
+
|
|
271
|
+
```
|
|
272
|
+
src/
|
|
273
|
+
├── index.css # dev 模式 CSS 入口
|
|
274
|
+
├── lib.css # 库构建 CSS 入口(@tailwindcss/cli)
|
|
275
|
+
├── tokens/ # theme.css、scale.css
|
|
276
|
+
├── components/ # basic/、chat/
|
|
277
|
+
└── lib/ # 工具与 ThemeStyleProvider
|
|
278
|
+
```
|
|
189
279
|
|
|
190
|
-
|
|
280
|
+
### 技术栈与规范
|
|
191
281
|
|
|
192
|
-
|
|
282
|
+
- React 19 + TypeScript + Vite 7;Tailwind CSS 4;Radix UI、Framer Motion
|
|
283
|
+
- 项目哲学与 GEB 协议:[CLAUDE.md](https://github.com/nicepkg/spark-design/blob/master/CLAUDE.md)
|
|
284
|
+
|
|
285
|
+
---
|
|
193
286
|
|
|
287
|
+
*"Keep the map aligned with the terrain."*
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { e as x, c as O, g as m, k as P, h as p, j as w, l as A, m as c, n as I, t as N, o as E } from "./_baseUniq-B-N2NQ50.js";
|
|
2
|
+
import { aR as g, aA as F, aS as M, aT as T, aU as _, aV as l, aW as $, aX as B, aY as S, aZ as y } from "./mermaid.core-gFR0XUlD.js";
|
|
3
|
+
var R = /\s/;
|
|
4
|
+
function G(n) {
|
|
5
|
+
for (var r = n.length; r-- && R.test(n.charAt(r)); )
|
|
6
|
+
;
|
|
7
|
+
return r;
|
|
8
|
+
}
|
|
9
|
+
var H = /^\s+/;
|
|
10
|
+
function L(n) {
|
|
11
|
+
return n && n.slice(0, G(n) + 1).replace(H, "");
|
|
12
|
+
}
|
|
13
|
+
var o = NaN, W = /^[-+]0x[0-9a-f]+$/i, X = /^0b[01]+$/i, Y = /^0o[0-7]+$/i, q = parseInt;
|
|
14
|
+
function z(n) {
|
|
15
|
+
if (typeof n == "number")
|
|
16
|
+
return n;
|
|
17
|
+
if (x(n))
|
|
18
|
+
return o;
|
|
19
|
+
if (g(n)) {
|
|
20
|
+
var r = typeof n.valueOf == "function" ? n.valueOf() : n;
|
|
21
|
+
n = g(r) ? r + "" : r;
|
|
22
|
+
}
|
|
23
|
+
if (typeof n != "string")
|
|
24
|
+
return n === 0 ? n : +n;
|
|
25
|
+
n = L(n);
|
|
26
|
+
var t = X.test(n);
|
|
27
|
+
return t || Y.test(n) ? q(n.slice(2), t ? 2 : 8) : W.test(n) ? o : +n;
|
|
28
|
+
}
|
|
29
|
+
var v = 1 / 0, C = 17976931348623157e292;
|
|
30
|
+
function K(n) {
|
|
31
|
+
if (!n)
|
|
32
|
+
return n === 0 ? n : 0;
|
|
33
|
+
if (n = z(n), n === v || n === -v) {
|
|
34
|
+
var r = n < 0 ? -1 : 1;
|
|
35
|
+
return r * C;
|
|
36
|
+
}
|
|
37
|
+
return n === n ? n : 0;
|
|
38
|
+
}
|
|
39
|
+
function U(n) {
|
|
40
|
+
var r = K(n), t = r % 1;
|
|
41
|
+
return r === r ? t ? r - t : r : 0;
|
|
42
|
+
}
|
|
43
|
+
function fn(n) {
|
|
44
|
+
var r = n == null ? 0 : n.length;
|
|
45
|
+
return r ? O(n) : [];
|
|
46
|
+
}
|
|
47
|
+
var b = Object.prototype, Z = b.hasOwnProperty, dn = F(function(n, r) {
|
|
48
|
+
n = Object(n);
|
|
49
|
+
var t = -1, i = r.length, a = i > 2 ? r[2] : void 0;
|
|
50
|
+
for (a && M(r[0], r[1], a) && (i = 1); ++t < i; )
|
|
51
|
+
for (var f = r[t], e = T(f), s = -1, d = e.length; ++s < d; ) {
|
|
52
|
+
var u = e[s], h = n[u];
|
|
53
|
+
(h === void 0 || _(h, b[u]) && !Z.call(n, u)) && (n[u] = f[u]);
|
|
54
|
+
}
|
|
55
|
+
return n;
|
|
56
|
+
});
|
|
57
|
+
function un(n) {
|
|
58
|
+
var r = n == null ? 0 : n.length;
|
|
59
|
+
return r ? n[r - 1] : void 0;
|
|
60
|
+
}
|
|
61
|
+
function D(n) {
|
|
62
|
+
return function(r, t, i) {
|
|
63
|
+
var a = Object(r);
|
|
64
|
+
if (!l(r)) {
|
|
65
|
+
var f = m(t);
|
|
66
|
+
r = P(r), t = function(s) {
|
|
67
|
+
return f(a[s], s, a);
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
var e = n(r, t, i);
|
|
71
|
+
return e > -1 ? a[f ? r[e] : e] : void 0;
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
var J = Math.max;
|
|
75
|
+
function Q(n, r, t) {
|
|
76
|
+
var i = n == null ? 0 : n.length;
|
|
77
|
+
if (!i)
|
|
78
|
+
return -1;
|
|
79
|
+
var a = t == null ? 0 : U(t);
|
|
80
|
+
return a < 0 && (a = J(i + a, 0)), p(n, m(r), a);
|
|
81
|
+
}
|
|
82
|
+
var hn = D(Q);
|
|
83
|
+
function V(n, r) {
|
|
84
|
+
var t = -1, i = l(n) ? Array(n.length) : [];
|
|
85
|
+
return w(n, function(a, f, e) {
|
|
86
|
+
i[++t] = r(a, f, e);
|
|
87
|
+
}), i;
|
|
88
|
+
}
|
|
89
|
+
function gn(n, r) {
|
|
90
|
+
var t = $(n) ? A : V;
|
|
91
|
+
return t(n, m(r));
|
|
92
|
+
}
|
|
93
|
+
var j = Object.prototype, k = j.hasOwnProperty;
|
|
94
|
+
function nn(n, r) {
|
|
95
|
+
return n != null && k.call(n, r);
|
|
96
|
+
}
|
|
97
|
+
function mn(n, r) {
|
|
98
|
+
return n != null && c(n, r, nn);
|
|
99
|
+
}
|
|
100
|
+
function rn(n, r) {
|
|
101
|
+
return n < r;
|
|
102
|
+
}
|
|
103
|
+
function tn(n, r, t) {
|
|
104
|
+
for (var i = -1, a = n.length; ++i < a; ) {
|
|
105
|
+
var f = n[i], e = r(f);
|
|
106
|
+
if (e != null && (s === void 0 ? e === e && !x(e) : t(e, s)))
|
|
107
|
+
var s = e, d = f;
|
|
108
|
+
}
|
|
109
|
+
return d;
|
|
110
|
+
}
|
|
111
|
+
function on(n) {
|
|
112
|
+
return n && n.length ? tn(n, B, rn) : void 0;
|
|
113
|
+
}
|
|
114
|
+
function an(n, r, t, i) {
|
|
115
|
+
if (!g(n))
|
|
116
|
+
return n;
|
|
117
|
+
r = I(r, n);
|
|
118
|
+
for (var a = -1, f = r.length, e = f - 1, s = n; s != null && ++a < f; ) {
|
|
119
|
+
var d = N(r[a]), u = t;
|
|
120
|
+
if (d === "__proto__" || d === "constructor" || d === "prototype")
|
|
121
|
+
return n;
|
|
122
|
+
if (a != e) {
|
|
123
|
+
var h = s[d];
|
|
124
|
+
u = void 0, u === void 0 && (u = g(h) ? h : S(r[a + 1]) ? [] : {});
|
|
125
|
+
}
|
|
126
|
+
y(s, d, u), s = s[d];
|
|
127
|
+
}
|
|
128
|
+
return n;
|
|
129
|
+
}
|
|
130
|
+
function vn(n, r, t) {
|
|
131
|
+
for (var i = -1, a = r.length, f = {}; ++i < a; ) {
|
|
132
|
+
var e = r[i], s = E(n, e);
|
|
133
|
+
t(s, e) && an(f, I(e, n), s);
|
|
134
|
+
}
|
|
135
|
+
return f;
|
|
136
|
+
}
|
|
137
|
+
export {
|
|
138
|
+
rn as a,
|
|
139
|
+
tn as b,
|
|
140
|
+
V as c,
|
|
141
|
+
vn as d,
|
|
142
|
+
on as e,
|
|
143
|
+
fn as f,
|
|
144
|
+
hn as g,
|
|
145
|
+
mn as h,
|
|
146
|
+
dn as i,
|
|
147
|
+
U as j,
|
|
148
|
+
un as l,
|
|
149
|
+
gn as m,
|
|
150
|
+
K as t
|
|
151
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const u=require("./_baseUniq-Cc_zbSif.cjs"),d=require("./mermaid.core-DBwAx_jp.cjs");var P=/\s/;function p(n){for(var r=n.length;r--&&P.test(n.charAt(r)););return r}var w=/^\s+/;function A(n){return n&&n.slice(0,p(n)+1).replace(w,"")}var m=NaN,_=/^[-+]0x[0-9a-f]+$/i,y=/^0b[01]+$/i,E=/^0o[0-7]+$/i,F=parseInt;function M(n){if(typeof n=="number")return n;if(u.isSymbol(n))return m;if(d.isObject(n)){var r=typeof n.valueOf=="function"?n.valueOf():n;n=d.isObject(r)?r+"":r}if(typeof n!="string")return n===0?n:+n;n=A(n);var t=y.test(n);return t||E.test(n)?F(n.slice(2),t?2:8):_.test(n)?m:+n}var I=1/0,N=17976931348623157e292;function o(n){if(!n)return n===0?n:0;if(n=M(n),n===I||n===-I){var r=n<0?-1:1;return r*N}return n===n?n:0}function v(n){var r=o(n),t=r%1;return r===r?t?r-t:r:0}function B(n){var r=n==null?0:n.length;return r?u.baseFlatten(n):[]}var x=Object.prototype,$=x.hasOwnProperty,q=d.baseRest(function(n,r){n=Object(n);var t=-1,a=r.length,e=a>2?r[2]:void 0;for(e&&d.isIterateeCall(r[0],r[1],e)&&(a=1);++t<a;)for(var s=r[t],i=d.keysIn(s),f=-1,h=i.length;++f<h;){var b=i[f],g=n[b];(g===void 0||d.eq(g,x[b])&&!$.call(n,b))&&(n[b]=s[b])}return n});function L(n){var r=n==null?0:n.length;return r?n[r-1]:void 0}function S(n){return function(r,t,a){var e=Object(r);if(!d.isArrayLike(r)){var s=u.baseIteratee(t);r=u.keys(r),t=function(f){return s(e[f],f,e)}}var i=n(r,t,a);return i>-1?e[s?r[i]:i]:void 0}}var T=Math.max;function G(n,r,t){var a=n==null?0:n.length;if(!a)return-1;var e=t==null?0:v(t);return e<0&&(e=T(a+e,0)),u.baseFindIndex(n,u.baseIteratee(r),e)}var H=S(G);function l(n,r){var t=-1,a=d.isArrayLike(n)?Array(n.length):[];return u.baseEach(n,function(e,s,i){a[++t]=r(e,s,i)}),a}function R(n,r){var t=d.isArray(n)?u.arrayMap:l;return t(n,u.baseIteratee(r))}var z=Object.prototype,C=z.hasOwnProperty;function K(n,r){return n!=null&&C.call(n,r)}function U(n,r){return n!=null&&u.hasPath(n,r,K)}function O(n,r){return n<r}function c(n,r,t){for(var a=-1,e=n.length;++a<e;){var s=n[a],i=r(s);if(i!=null&&(f===void 0?i===i&&!u.isSymbol(i):t(i,f)))var f=i,h=s}return h}function W(n){return n&&n.length?c(n,d.identity,O):void 0}function X(n,r,t,a){if(!d.isObject(n))return n;r=u.castPath(r,n);for(var e=-1,s=r.length,i=s-1,f=n;f!=null&&++e<s;){var h=u.toKey(r[e]),b=t;if(h==="__proto__"||h==="constructor"||h==="prototype")return n;if(e!=i){var g=f[h];b=void 0,b===void 0&&(b=d.isObject(g)?g:d.isIndex(r[e+1])?[]:{})}d.assignValue(f,h,b),f=f[h]}return n}function Y(n,r,t){for(var a=-1,e=r.length,s={};++a<e;){var i=r[a],f=u.baseGet(n,i);t(f,i)&&X(s,u.castPath(i,n),f)}return s}exports.baseExtremum=c;exports.baseLt=O;exports.baseMap=l;exports.basePickBy=Y;exports.defaults=q;exports.find=H;exports.flatten=B;exports.has=U;exports.last=L;exports.map=R;exports.min=W;exports.toFinite=o;exports.toInteger=v;
|