sparkdesign 0.4.4 → 0.4.6

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.
Files changed (136) hide show
  1. package/README.md +74 -22
  2. package/cli/dist/commands/add.js +22 -12
  3. package/cli/dist/commands/diff.js +8 -4
  4. package/cli/dist/commands/init.js +84 -9
  5. package/cli/dist/commands/list.js +8 -4
  6. package/cli/dist/index.js +9 -6
  7. package/cli/dist/utils/config.js +16 -8
  8. package/cli/dist/utils/package-manager.js +75 -0
  9. package/cli/dist/utils/registry.js +8 -4
  10. package/cli/dist/utils/tokens.js +33 -25
  11. package/cli/dist/utils/transform.js +9 -5
  12. package/cli/dist/utils/tsconfig.js +182 -0
  13. package/cli/registry/AGENTS.md +18 -0
  14. package/cli/registry/__tests__/chat/thinking-indicator.test.tsx +2 -2
  15. package/cli/registry/chat/chat-input/chat-input-folder-selector.tsx +1 -1
  16. package/cli/registry/chat/chat-input/folder-permission-dialog.tsx +2 -2
  17. package/cli/registry/chat/image-generating.tsx +1 -1
  18. package/cli/registry/chat/response/context.tsx +1 -1
  19. package/cli/registry/chat/thinking-indicator.tsx +1 -1
  20. package/cli/registry/tokens/index.css +8 -5
  21. package/cli/registry/tokens/theme-base.css +235 -0
  22. package/{dist/tokens/themes/dark-qoder.css → cli/registry/tokens/themes/dark-mint.css} +1 -1
  23. package/cli/registry/tokens/themes/dark-parchment.css +104 -103
  24. package/{dist/tokens/themes/light-qoder.css → cli/registry/tokens/themes/light-mint.css} +1 -1
  25. package/cli/registry/tokens/themes/light-parchment.css +103 -102
  26. package/dist/registry/basic/alert-dialog.d.ts +7 -5
  27. package/dist/registry/basic/avatar.d.ts +7 -5
  28. package/dist/registry/basic/collapse.d.ts +7 -5
  29. package/dist/registry/basic/collapsible-card.d.ts +7 -6
  30. package/dist/registry/basic/collapsible.d.ts +7 -5
  31. package/dist/registry/basic/dropdown-menu.d.ts +7 -5
  32. package/dist/registry/basic/icons-inline.d.ts +7 -5
  33. package/dist/registry/basic/kbd.d.ts +7 -5
  34. package/dist/registry/basic/pagination.d.ts +7 -5
  35. package/dist/registry/basic/progress.d.ts +7 -5
  36. package/dist/registry/basic/radio-group.d.ts +7 -5
  37. package/dist/registry/basic/resizable.d.ts +7 -5
  38. package/dist/registry/basic/select.d.ts +7 -5
  39. package/dist/registry/basic/slider.d.ts +7 -5
  40. package/dist/registry/basic/sonner.d.ts +7 -5
  41. package/dist/registry/basic/switch.d.ts +7 -5
  42. package/dist/registry/basic/tabs.d.ts +7 -5
  43. package/dist/registry/basic/tag.d.ts +7 -5
  44. package/dist/registry/basic/theme-from-document.d.ts +7 -5
  45. package/dist/registry/basic/tooltip.d.ts +7 -5
  46. package/dist/registry/basic/typography.d.ts +7 -5
  47. package/dist/registry/chat/ask-user-part.d.ts +9 -3
  48. package/dist/registry/chat/browser-action-part.d.ts +9 -3
  49. package/dist/registry/chat/chat-input/compound.d.ts +7 -5
  50. package/dist/registry/chat/chat-input/context.d.ts +7 -5
  51. package/dist/registry/chat/chat-input/index.d.ts +7 -5
  52. package/dist/registry/chat/chat-input/types.d.ts +9 -3
  53. package/dist/registry/chat/chat-input/useAutoResizeTextarea.d.ts +9 -3
  54. package/dist/registry/chat/code-block-part.d.ts +9 -3
  55. package/dist/registry/chat/file-attachment.d.ts +7 -5
  56. package/dist/registry/chat/file-review-part.d.ts +9 -4
  57. package/dist/registry/chat/generated-images-grid.d.ts +9 -3
  58. package/dist/registry/chat/generation-status-bar.d.ts +8 -4
  59. package/dist/registry/chat/hint-banner.d.ts +9 -3
  60. package/dist/registry/chat/mermaid-part.d.ts +9 -3
  61. package/dist/registry/chat/plan-part.d.ts +9 -3
  62. package/dist/registry/chat/reasoning-step/index.d.ts +8 -6
  63. package/dist/registry/chat/reasoning-step/types.d.ts +9 -3
  64. package/dist/registry/chat/related-prompts.d.ts +9 -3
  65. package/dist/registry/chat/response/index.d.ts +8 -6
  66. package/dist/registry/chat/response/types.d.ts +9 -3
  67. package/dist/registry/chat/task-part.d.ts +9 -3
  68. package/dist/registry/chat/terminal-code-block-part.d.ts +9 -3
  69. package/dist/registry/chat/user-question/UserQuestionCard.d.ts +9 -3
  70. package/dist/registry/chat/user-question/UserQuestionFooter.d.ts +9 -3
  71. package/dist/registry/chat/user-question/UserQuestionHeader.d.ts +9 -3
  72. package/dist/registry/chat/user-question/types.d.ts +8 -5
  73. package/dist/registry/lib/file-icon-maps.d.ts +7 -7
  74. package/dist/registry/lib/utils.d.ts +8 -6
  75. package/dist/spark-design.cjs.js +6 -6
  76. package/dist/spark-design.es.js +10 -10
  77. package/dist/sparkdesign.css +2 -0
  78. package/dist/src/components/basic/AlertDialog/index.d.ts +7 -5
  79. package/dist/src/components/basic/Avatar/index.d.ts +9 -3
  80. package/dist/src/components/basic/Button/index.d.ts +9 -3
  81. package/dist/src/components/basic/Collapse/index.d.ts +7 -4
  82. package/dist/src/components/basic/Collapsible/index.d.ts +9 -4
  83. package/dist/src/components/basic/CollapsibleCard/index.d.ts +9 -3
  84. package/dist/src/components/basic/CollapsibleSection/index.d.ts +7 -7
  85. package/dist/src/components/basic/DropdownMenu/index.d.ts +7 -5
  86. package/dist/src/components/basic/EllipsisText/index.d.ts +7 -15
  87. package/dist/src/components/basic/IconButton/index.d.ts +9 -3
  88. package/dist/src/components/basic/Kbd/index.d.ts +9 -3
  89. package/dist/src/components/basic/OptionList/index.d.ts +9 -3
  90. package/dist/src/components/basic/Pagination/index.d.ts +9 -3
  91. package/dist/src/components/basic/Progress/index.d.ts +9 -3
  92. package/dist/src/components/basic/RadioGroup/index.d.ts +9 -3
  93. package/dist/src/components/basic/Resizable/index.d.ts +9 -3
  94. package/dist/src/components/basic/Scrollbar/index.d.ts +9 -3
  95. package/dist/src/components/basic/Select/index.d.ts +7 -4
  96. package/dist/src/components/basic/ShimmeringText/index.d.ts +9 -3
  97. package/dist/src/components/basic/Skeleton/index.d.ts +9 -3
  98. package/dist/src/components/basic/Slider/index.d.ts +9 -3
  99. package/dist/src/components/basic/Spinner/index.d.ts +9 -3
  100. package/dist/src/components/basic/Switch/index.d.ts +8 -5
  101. package/dist/src/components/basic/Table/index.d.ts +9 -3
  102. package/dist/src/components/basic/Tabs/index.d.ts +9 -3
  103. package/dist/src/components/basic/Tag/index.d.ts +7 -4
  104. package/dist/src/components/basic/Toggle/index.d.ts +9 -3
  105. package/dist/src/components/basic/Tooltip/index.d.ts +7 -4
  106. package/dist/src/components/basic/Typography/index.d.ts +9 -3
  107. package/dist/src/components/chat/GeneratedImagesGrid/index.d.ts +9 -3
  108. package/dist/src/components/chat/GenerationStatusBar/index.d.ts +9 -3
  109. package/dist/src/components/chat/Markdown/demo-content.d.ts +1 -1
  110. package/dist/src/components/chat/Markdown/index.d.ts +9 -3
  111. package/dist/src/components/chat/Response/StreamingMarkdownBlock.d.ts +9 -3
  112. package/dist/src/components/chat/Response/index.d.ts +8 -6
  113. package/dist/src/components/chat/UserMessage/index.d.ts +9 -3
  114. package/dist/src/components/index.d.ts +7 -9
  115. package/dist/src/icons/context.d.ts +7 -6
  116. package/dist/src/icons/types.d.ts +7 -5
  117. package/dist/src/lib/ThemeStyleContext.d.ts +9 -9
  118. package/dist/src/lib/file-icon.d.ts +7 -6
  119. package/dist/src/lib/i18n.d.ts +7 -6
  120. package/dist/src/lib/index.d.ts +9 -3
  121. package/dist/src/lib/utils.d.ts +7 -5
  122. package/dist/theme-base.css +7 -8
  123. package/dist/theme.css +2 -2
  124. package/dist/themes/{dark-qoder.css → dark-mint.css} +1 -1
  125. package/dist/themes/{light-qoder.css → light-mint.css} +1 -1
  126. package/dist/tokens/AGENTS.md +47 -0
  127. package/dist/tokens/index.css +10 -19
  128. package/dist/tokens/theme-base.css +7 -8
  129. package/dist/tokens/theme.css +2 -2
  130. package/dist/tokens/themes/dark-mint.css +133 -0
  131. package/dist/tokens/themes/light-mint.css +132 -0
  132. package/package.json +11 -5
  133. package/cli/registry/tokens/themes/dark-qoder.css +0 -132
  134. package/cli/registry/tokens/themes/light-qoder.css +0 -131
  135. package/dist/qoder-design.css +0 -2
  136. package/dist/tokens/CLAUDE.md +0 -305
@@ -1,123 +1,124 @@
1
1
  /* ============================================
2
- * Theme: Light Parchment (羊皮纸亮色)
3
- * 复制此文件作为自定义主题模板
2
+ * Theme: Light Parchment (羊皮纸亮色 - Figma 导入)
3
+ * 用户可复制此文件作为自定义主题模板
4
4
  * ============================================ */
5
5
 
6
6
  [data-theme="light-parchment"] {
7
7
  /* --- Primary --- */
8
- --color-primary: #202116;
9
- --color-primary-hover: #3D3930;
10
- --color-primary-active: #3D3930;
11
- --color-primary-bg: #F0EDE7;
12
- --color-primary-bg-hover: #E8E4DC;
13
- --color-primary-border: #D4CFC6;
14
- --color-primary-border-hover: #C4BEB4;
15
- --color-primary-text: #202116;
16
- --color-primary-text-hover: #3D3930;
17
- --color-primary-text-active: #3D3930;
18
- --color-text-on-primary: #FAF9F6;
8
+ --token-color-primary: #202116;
9
+ --token-color-primary-hover: #3D3930;
10
+ --token-color-primary-active: #3D3930;
11
+ --token-color-primary-bg: #F0EDE7;
12
+ --token-color-primary-bg-hover: #E8E4DC;
13
+ --token-color-primary-border: #D4CFC6;
14
+ --token-color-primary-border-hover: #C4BEB4;
15
+ --token-color-primary-text: #202116;
16
+ --token-color-primary-text-hover: #3D3930;
17
+ --token-color-primary-text-active: #3D3930;
18
+ --token-color-text-on-primary: #FAF9F6;
19
19
 
20
20
  /* --- Text --- */
21
- --color-text: #202116;
22
- --color-text-secondary: #4A463C;
23
- --color-text-tertiary: #6B665C;
24
- --color-text-quaternary: #8A857A;
25
- --color-text-base: #202116;
21
+ --token-color-text: #202116;
22
+ --token-color-text-secondary: #4A463C;
23
+ --token-color-text-tertiary: #6B665C;
24
+ --token-color-text-quaternary: #8A857A;
25
+ --token-color-text-base: #202116;
26
26
 
27
27
  /* --- Border --- */
28
- --color-border: #D4CFC6;
29
- --color-border-secondary: #E5E1D9;
30
- --color-border-tertiary: #EDE9E2;
28
+ --token-color-border: #D4CFC6;
29
+ --token-color-border-secondary: #E5E1D9;
30
+ --token-color-border-tertiary: #EDE9E2;
31
31
 
32
32
  /* --- Fill --- */
33
- --color-fill: #F5F0E7;
34
- --color-fill-secondary: #EDE8E0;
35
- --color-fill-tertiary: #F7F4EF;
36
- --color-fill-quaternary: #FAF9F6;
37
- --color-fill-disable: #E0DCD4;
33
+ --token-color-fill: #F5F0E7;
34
+ --token-color-fill-secondary: #EDE8E0;
35
+ --token-color-fill-tertiary: #F7F4EF;
36
+ --token-color-fill-quaternary: #FAF9F6;
37
+ --token-color-fill-disable: #E0DCD4;
38
38
 
39
39
  /* --- Background --- */
40
- --color-bg-container: #FAF9F6;
41
- --color-bg-elevated: #F7F4EF;
42
- --color-bg-layout: #FDFCFA;
43
- --color-bg-spotlight: #FAF9F6;
44
- --color-bg-mask: rgba(0, 0, 0, 0.5);
45
- --color-mask-shimmer-weak: rgba(0, 0, 0, 0.3);
46
- --color-mask-shimmer-strong: rgba(0, 0, 0, 0.8);
47
- --color-mask-shimmer-full: rgba(0, 0, 0, 1);
48
- --color-bg-base: #FFFFFF;
49
- --color-bg-highlight: #202116;
50
- --color-bg-highlight-hover: #2D2A22;
40
+ --token-color-bg-container: #FAF9F6;
41
+ --token-color-bg-elevated: #F7F4EF;
42
+ --token-color-bg-layout: #FDFCFA;
43
+ --token-color-bg-spotlight: #FAF9F6;
44
+ --token-color-bg-mask: rgba(0, 0, 0, 0.5);
45
+ /* PlanPart 点阵高亮遮罩渐变(随主题) */
46
+ --token-color-mask-shimmer-weak: rgba(0, 0, 0, 0.3);
47
+ --token-color-mask-shimmer-strong: rgba(0, 0, 0, 0.8);
48
+ --token-color-mask-shimmer-full: rgba(0, 0, 0, 1);
49
+ --token-color-bg-base: #FFFFFF;
50
+ --token-color-bg-highlight: #202116;
51
+ --token-color-bg-highlight-hover: #2D2A22;
51
52
 
52
53
  /* --- Semantic Colors --- */
53
- --color-link: #5B4A3A;
54
- --color-error: #FF4D4F;
55
- --color-error-hover: #FF7875;
56
- --color-error-bg: #FFF2F0;
57
- --color-error-bg-hover: #FFF1F0;
58
- --color-error-border: #FFCCC7;
59
- --color-info: #0B83F1;
60
- --color-info-hover: #5EBCFF;
61
- --color-info-bg: #E6F7FF;
62
- --color-info-bg-hover: #D0EFFF;
63
- --color-info-border: #B0E3FF;
64
- --color-success: #5A7A5E;
65
- --color-success-hover: #6B8F71;
66
- --color-success-bg: #EEF2ED;
67
- --color-success-bg-hover: #E4EBE2;
68
- --color-success-border: #C5D4C4;
69
- --color-warning: #FAAD14;
70
- --color-warning-hover: #FFD666;
71
- --color-warning-bg: #FFFBE6;
72
- --color-warning-bg-hover: #FFF3CF;
73
- --color-warning-border: #FFE5BF;
54
+ --token-color-link: #5B4A3A;
55
+ --token-color-error: #FF4D4F;
56
+ --token-color-error-hover: #FF7875;
57
+ --token-color-error-bg: #FFF2F0;
58
+ --token-color-error-bg-hover: #FFF1F0;
59
+ --token-color-error-border: #FFCCC7;
60
+ --token-color-info: #0B83F1;
61
+ --token-color-info-hover: #5EBCFF;
62
+ --token-color-info-bg: #E6F7FF;
63
+ --token-color-info-bg-hover: #D0EFFF;
64
+ --token-color-info-border: #B0E3FF;
65
+ --token-color-success: #5A7A5E;
66
+ --token-color-success-hover: #6B8F71;
67
+ --token-color-success-bg: #EEF2ED;
68
+ --token-color-success-bg-hover: #E4EBE2;
69
+ --token-color-success-border: #C5D4C4;
70
+ --token-color-warning: #FAAD14;
71
+ --token-color-warning-hover: #FFD666;
72
+ --token-color-warning-bg: #FFFBE6;
73
+ --token-color-warning-bg-hover: #FFF3CF;
74
+ --token-color-warning-border: #FFE5BF;
74
75
 
75
76
  /* --- Accent Colors --- */
76
- --color-pink: #EC4899;
77
- --color-pink-bg: #F9E3F3;
78
- --color-pink-bg-hover: #F5D4EB;
79
- --color-purple: #615CED;
80
- --color-purple-bg: #EBE9FF;
81
- --color-purple-bg-hover: #DDDAFF;
82
- --color-yellow: #FAC414;
83
- --color-yellow-bg: #FFF3CF;
84
- --color-yellow-bg-hover: #FFE9A8;
85
- --color-orange: #FA8125;
86
- --color-orange-bg: #FFEFDE;
87
- --color-orange-bg-hover: #FFE3C7;
88
- --color-teal: #14B8A6;
89
- --color-teal-bg: #DEF7F1;
90
- --color-teal-bg-hover: #CAF0E8;
91
- --color-blue: #0090FF;
92
- --color-blue-bg: #DEEDFF;
93
- --color-blue-bg-hover: #C8E3FF;
94
- --color-mauve: #8E8C99;
95
- --color-mauve-bg: #F1F2F3;
96
- --color-mauve-bg-hover: #E4E5E7;
97
- --color-slate: #1E293B;
98
- --color-slate-bg: #E2E8F0;
99
- --color-slate-bg-hover: #EFEFEF;
100
- --color-lavender: #B99DFF;
101
- --color-lavender-bg: #ECE4FF;
102
- --color-lavender-bg-hover: #E0D4FF;
103
- --color-sage: #6BB394;
104
- --color-sage-bg: #EFF3F2;
105
- --color-sage-bg-hover: #E2EAE8;
77
+ --token-color-pink: #EC4899;
78
+ --token-color-pink-bg: #F9E3F3;
79
+ --token-color-pink-bg-hover: #F5D4EB;
80
+ --token-color-purple: #615CED;
81
+ --token-color-purple-bg: #EBE9FF;
82
+ --token-color-purple-bg-hover: #DDDAFF;
83
+ --token-color-yellow: #FAC414;
84
+ --token-color-yellow-bg: #FFF3CF;
85
+ --token-color-yellow-bg-hover: #FFE9A8;
86
+ --token-color-orange: #FA8125;
87
+ --token-color-orange-bg: #FFEFDE;
88
+ --token-color-orange-bg-hover: #FFE3C7;
89
+ --token-color-teal: #14B8A6;
90
+ --token-color-teal-bg: #DEF7F1;
91
+ --token-color-teal-bg-hover: #CAF0E8;
92
+ --token-color-blue: #0090FF;
93
+ --token-color-blue-bg: #DEEDFF;
94
+ --token-color-blue-bg-hover: #C8E3FF;
95
+ --token-color-mauve: #8E8C99;
96
+ --token-color-mauve-bg: #F1F2F3;
97
+ --token-color-mauve-bg-hover: #E4E5E7;
98
+ --token-color-slate: #1E293B;
99
+ --token-color-slate-bg: #E2E8F0;
100
+ --token-color-slate-bg-hover: #EFEFEF;
101
+ --token-color-lavender: #B99DFF;
102
+ --token-color-lavender-bg: #ECE4FF;
103
+ --token-color-lavender-bg-hover: #E0D4FF;
104
+ --token-color-sage: #6BB394;
105
+ --token-color-sage-bg: #EFF3F2;
106
+ --token-color-sage-bg-hover: #E2EAE8;
106
107
 
107
- /* --- Component aliases --- */
108
- --color-input: var(--color-border-tertiary);
109
- --color-ring: var(--color-primary-border);
110
- --color-popover: var(--color-bg-container);
111
- --color-popover-foreground: var(--color-text);
112
- --color-accent: var(--color-fill-secondary);
113
- --color-accent-foreground: var(--color-text);
114
- --color-muted: var(--color-fill-tertiary);
115
- --color-muted-foreground: var(--color-text-secondary);
116
- --color-background: var(--color-bg-base);
108
+ /* --- Select 等组件 (input/ring/popover 等) --- */
109
+ --token-color-input: var(--token-color-border-tertiary);
110
+ --token-color-ring: var(--token-color-primary-border);
111
+ --token-color-popover: var(--token-color-bg-container);
112
+ --token-color-popover-foreground: var(--token-color-text);
113
+ --token-color-accent: var(--token-color-fill-secondary);
114
+ --token-color-accent-foreground: var(--token-color-text);
115
+ --token-color-muted: var(--token-color-fill-tertiary);
116
+ --token-color-muted-foreground: var(--token-color-text-secondary);
117
+ --token-color-background: var(--token-color-bg-base);
117
118
 
118
119
  /* --- Diff --- */
119
- --color-diff-insert: #A6DCBA;
120
- --color-diff-insert-bg: #D9EBE0;
121
- --color-diff-remove: #FC6B83;
122
- --color-diff-remove-bg: #E3D1D5;
120
+ --token-color-diff-insert: #A6DCBA;
121
+ --token-color-diff-insert-bg: #D9EBE0;
122
+ --token-color-diff-remove: #FC6B83;
123
+ --token-color-diff-remove-bg: #E3D1D5;
123
124
  }
@@ -1,11 +1,13 @@
1
1
  /**
2
- * [INPUT]: (AlertDialog*Props)
3
- * [OUTPUT]: (JSX.Element) - 警告对话框组件
4
- * [POS]: registry/basic/alert-dialog - 注册表模板,复制到用户项目后可自由修改
2
+ * [WHO]: Public exports from this file (see implementation below).
3
+ * [FROM]: See the import block immediately after this header.
4
+ * [TO]: sparkdesign package consumers; output of CLI `add` when applicable.
5
+ * [HERE]: registry/basic/alert-dialog.tsx — Spark Design source; keep aligned with the main library.
5
6
  *
6
7
  * [PROTOCOL]:
7
- * 1. 用户可自由修改此文件
8
- * 2. 更新时使用 npx sparkdesign diff alert-dialog 查看差异
8
+ * 1. Keep this P3 header in sync when the public contract changes.
9
+ * 2. Update module AGENTS.md (P2) and root AGENTS.md (P1) when boundaries change.
10
+ * 3. Follow design tokens and explicit type exports.
9
11
  */
10
12
  import * as React from 'react';
11
13
  import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
@@ -1,11 +1,13 @@
1
1
  /**
2
- * [INPUT]: (AvatarProps, AvatarImageProps, AvatarFallbackProps, AvatarBadgeProps, AvatarGroupProps)
3
- * [OUTPUT]: (JSX.Element) - 用户头像组件(含 badge/group)
4
- * [POS]: registry/basic/avatar - 注册表模板,复制到用户项目后可自由修改
2
+ * [WHO]: Public exports from this file (see implementation below).
3
+ * [FROM]: See the import block immediately after this header.
4
+ * [TO]: sparkdesign package consumers; output of CLI `add` when applicable.
5
+ * [HERE]: registry/basic/avatar.tsx — Spark Design source; keep aligned with the main library.
5
6
  *
6
7
  * [PROTOCOL]:
7
- * 1. 用户可自由修改此文件
8
- * 2. 更新时使用 npx sparkdesign diff avatar 查看差异
8
+ * 1. Keep this P3 header in sync when the public contract changes.
9
+ * 2. Update module AGENTS.md (P2) and root AGENTS.md (P1) when boundaries change.
10
+ * 3. Follow design tokens and explicit type exports.
9
11
  */
10
12
  import * as React from 'react';
11
13
  import * as AvatarPrimitive from '@radix-ui/react-avatar';
@@ -1,11 +1,13 @@
1
1
  /**
2
- * [INPUT]: (Collapse*Props)
3
- * [OUTPUT]: (JSX.Element) - 折叠面板组件(Accordion)
4
- * [POS]: registry/basic/collapse - 注册表模板,复制到用户项目后可自由修改
2
+ * [WHO]: Public exports from this file (see implementation below).
3
+ * [FROM]: See the import block immediately after this header.
4
+ * [TO]: sparkdesign package consumers; output of CLI `add` when applicable.
5
+ * [HERE]: registry/basic/collapse.tsx — Spark Design source; keep aligned with the main library.
5
6
  *
6
7
  * [PROTOCOL]:
7
- * 1. 用户可自由修改此文件
8
- * 2. 更新时使用 npx sparkdesign diff collapse 查看差异
8
+ * 1. Keep this P3 header in sync when the public contract changes.
9
+ * 2. Update module AGENTS.md (P2) and root AGENTS.md (P1) when boundaries change.
10
+ * 3. Follow design tokens and explicit type exports.
9
11
  */
10
12
  import * as React from 'react';
11
13
  import * as AccordionPrimitive from '@radix-ui/react-accordion';
@@ -1,12 +1,13 @@
1
1
  /**
2
- * [INPUT]: (CollapsibleCardProps) - 可折叠卡片:headerIcon/headerTitle/headerRight、children、footer、defaultExpanded、contentPadding、collapsible、showExpandAllBar、maxHeight
3
- * [OUTPUT]: (JSX.Element)
4
- * [POS]: registry/basic - 对话流内 Part 组件共用卡片容器
2
+ * [WHO]: Public exports from this file (see implementation below).
3
+ * [FROM]: See the import block immediately after this header.
4
+ * [TO]: sparkdesign package consumers; output of CLI `add` when applicable.
5
+ * [HERE]: registry/basic/collapsible-card.tsx — Spark Design source; keep aligned with the main library.
5
6
  *
6
7
  * [PROTOCOL]:
7
- * 1. 文件逻辑变更时必须同步更新此 Header
8
- * 2. 所有样式使用 design token 类名
9
- * 3. showExpandAllBar:内容超过 maxHeight 时显示底部展开/收起栏,与 QodeChatPanel 逻辑一致
8
+ * 1. Keep this P3 header in sync when the public contract changes.
9
+ * 2. Update module AGENTS.md (P2) and root AGENTS.md (P1) when boundaries change.
10
+ * 3. Follow design tokens and explicit type exports.
10
11
  */
11
12
  import { type ReactNode } from 'react';
12
13
  export interface CollapsibleCardProps {
@@ -1,11 +1,13 @@
1
1
  /**
2
- * [INPUT]: (CollapsibleProps)
3
- * [OUTPUT]: (JSX.Element) - 可折叠面板组件(Radix primitive)
4
- * [POS]: registry/basic/collapsible - 注册表模板,复制到用户项目后可自由修改
2
+ * [WHO]: Public exports from this file (see implementation below).
3
+ * [FROM]: See the import block immediately after this header.
4
+ * [TO]: sparkdesign package consumers; output of CLI `add` when applicable.
5
+ * [HERE]: registry/basic/collapsible.tsx — Spark Design source; keep aligned with the main library.
5
6
  *
6
7
  * [PROTOCOL]:
7
- * 1. 用户可自由修改此文件
8
- * 2. 更新时使用 npx sparkdesign diff collapsible 查看差异
8
+ * 1. Keep this P3 header in sync when the public contract changes.
9
+ * 2. Update module AGENTS.md (P2) and root AGENTS.md (P1) when boundaries change.
10
+ * 3. Follow design tokens and explicit type exports.
9
11
  */
10
12
  import * as React from 'react';
11
13
  import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
@@ -1,11 +1,13 @@
1
1
  /**
2
- * [INPUT]: (DropdownMenu*Props)
3
- * [OUTPUT]: (JSX.Element) - 下拉菜单组件
4
- * [POS]: registry/basic/dropdown-menu - 注册表模板,复制到用户项目后可自由修改
2
+ * [WHO]: Public exports from this file (see implementation below).
3
+ * [FROM]: See the import block immediately after this header.
4
+ * [TO]: sparkdesign package consumers; output of CLI `add` when applicable.
5
+ * [HERE]: registry/basic/dropdown-menu.tsx — Spark Design source; keep aligned with the main library.
5
6
  *
6
7
  * [PROTOCOL]:
7
- * 1. 用户可自由修改此文件
8
- * 2. 更新时使用 npx sparkdesign diff dropdown-menu 查看差异
8
+ * 1. Keep this P3 header in sync when the public contract changes.
9
+ * 2. Update module AGENTS.md (P2) and root AGENTS.md (P1) when boundaries change.
10
+ * 3. Follow design tokens and explicit type exports.
9
11
  */
10
12
  import * as React from 'react';
11
13
  import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
@@ -1,11 +1,13 @@
1
1
  /**
2
- * [INPUT]: (InlineIconProps)
3
- * [OUTPUT]: (JSX.Element) - 内联 SVG 图标组件(Remix Icon 风格)
4
- * [POS]: registry/basic/icons-inline - 注册表默认图标,无 useIcon 依赖
2
+ * [WHO]: Public exports from this file (see implementation below).
3
+ * [FROM]: See the import block immediately after this header.
4
+ * [TO]: sparkdesign package consumers; output of CLI `add` when applicable.
5
+ * [HERE]: registry/basic/icons-inline.tsx — Spark Design source; keep aligned with the main library.
5
6
  *
6
7
  * [PROTOCOL]:
7
- * 1. 用于 registry 组件的默认图标
8
- * 2. 用户可通过 IconsProvider 注入自定义图标替换
8
+ * 1. Keep this P3 header in sync when the public contract changes.
9
+ * 2. Update module AGENTS.md (P2) and root AGENTS.md (P1) when boundaries change.
10
+ * 3. Follow design tokens and explicit type exports.
9
11
  */
10
12
  import * as React from 'react';
11
13
  export interface InlineIconProps extends React.SVGAttributes<SVGSVGElement> {
@@ -1,11 +1,13 @@
1
1
  /**
2
- * [INPUT]: (KbdProps, KbdGroupProps)
3
- * [OUTPUT]: (JSX.Element) - 键盘按键展示组件
4
- * [POS]: registry/basic/kbd - 注册表模板,复制到用户项目后可自由修改
2
+ * [WHO]: Public exports from this file (see implementation below).
3
+ * [FROM]: See the import block immediately after this header.
4
+ * [TO]: sparkdesign package consumers; output of CLI `add` when applicable.
5
+ * [HERE]: registry/basic/kbd.tsx — Spark Design source; keep aligned with the main library.
5
6
  *
6
7
  * [PROTOCOL]:
7
- * 1. 用户可自由修改此文件
8
- * 2. 更新时使用 npx sparkdesign diff kbd 查看差异
8
+ * 1. Keep this P3 header in sync when the public contract changes.
9
+ * 2. Update module AGENTS.md (P2) and root AGENTS.md (P1) when boundaries change.
10
+ * 3. Follow design tokens and explicit type exports.
9
11
  */
10
12
  import * as React from 'react';
11
13
  export type KbdProps = React.ComponentProps<'kbd'>;
@@ -1,11 +1,13 @@
1
1
  /**
2
- * [INPUT]: (Pagination*Props)
3
- * [OUTPUT]: (JSX.Element) - 分页导航组件
4
- * [POS]: registry/basic/pagination - 注册表模板,复制到用户项目后可自由修改
2
+ * [WHO]: Public exports from this file (see implementation below).
3
+ * [FROM]: See the import block immediately after this header.
4
+ * [TO]: sparkdesign package consumers; output of CLI `add` when applicable.
5
+ * [HERE]: registry/basic/pagination.tsx — Spark Design source; keep aligned with the main library.
5
6
  *
6
7
  * [PROTOCOL]:
7
- * 1. 用户可自由修改此文件
8
- * 2. 更新时使用 npx sparkdesign diff pagination 查看差异
8
+ * 1. Keep this P3 header in sync when the public contract changes.
9
+ * 2. Update module AGENTS.md (P2) and root AGENTS.md (P1) when boundaries change.
10
+ * 3. Follow design tokens and explicit type exports.
9
11
  */
10
12
  import * as React from 'react';
11
13
  declare const Pagination: {
@@ -1,11 +1,13 @@
1
1
  /**
2
- * [INPUT]: (ProgressProps)
3
- * [OUTPUT]: (JSX.Element) - 进度条组件
4
- * [POS]: registry/basic/progress - 注册表模板,复制到用户项目后可自由修改
2
+ * [WHO]: Public exports from this file (see implementation below).
3
+ * [FROM]: See the import block immediately after this header.
4
+ * [TO]: sparkdesign package consumers; output of CLI `add` when applicable.
5
+ * [HERE]: registry/basic/progress.tsx — Spark Design source; keep aligned with the main library.
5
6
  *
6
7
  * [PROTOCOL]:
7
- * 1. 用户可自由修改此文件
8
- * 2. 更新时使用 npx sparkdesign diff progress 查看差异
8
+ * 1. Keep this P3 header in sync when the public contract changes.
9
+ * 2. Update module AGENTS.md (P2) and root AGENTS.md (P1) when boundaries change.
10
+ * 3. Follow design tokens and explicit type exports.
9
11
  */
10
12
  import * as React from 'react';
11
13
  import * as ProgressPrimitive from '@radix-ui/react-progress';
@@ -1,11 +1,13 @@
1
1
  /**
2
- * [INPUT]: (RadioGroupProps, RadioGroupItemProps)
3
- * [OUTPUT]: (JSX.Element) - 单选按钮组组件
4
- * [POS]: registry/basic/radio-group - 注册表模板,复制到用户项目后可自由修改
2
+ * [WHO]: Public exports from this file (see implementation below).
3
+ * [FROM]: See the import block immediately after this header.
4
+ * [TO]: sparkdesign package consumers; output of CLI `add` when applicable.
5
+ * [HERE]: registry/basic/radio-group.tsx — Spark Design source; keep aligned with the main library.
5
6
  *
6
7
  * [PROTOCOL]:
7
- * 1. 用户可自由修改此文件
8
- * 2. 更新时使用 npx sparkdesign diff radio-group 查看差异
8
+ * 1. Keep this P3 header in sync when the public contract changes.
9
+ * 2. Update module AGENTS.md (P2) and root AGENTS.md (P1) when boundaries change.
10
+ * 3. Follow design tokens and explicit type exports.
9
11
  */
10
12
  import * as React from 'react';
11
13
  import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
@@ -1,11 +1,13 @@
1
1
  /**
2
- * [INPUT]: (ResizablePanelGroupProps, ResizablePanelProps, ResizableHandleProps)
3
- * [OUTPUT]: (JSX.Element) - 可调整大小面板组件
4
- * [POS]: registry/basic/resizable - 注册表模板,复制到用户项目后可自由修改
2
+ * [WHO]: Public exports from this file (see implementation below).
3
+ * [FROM]: See the import block immediately after this header.
4
+ * [TO]: sparkdesign package consumers; output of CLI `add` when applicable.
5
+ * [HERE]: registry/basic/resizable.tsx — Spark Design source; keep aligned with the main library.
5
6
  *
6
7
  * [PROTOCOL]:
7
- * 1. 用户可自由修改此文件
8
- * 2. 更新时使用 npx sparkdesign diff resizable 查看差异
8
+ * 1. Keep this P3 header in sync when the public contract changes.
9
+ * 2. Update module AGENTS.md (P2) and root AGENTS.md (P1) when boundaries change.
10
+ * 3. Follow design tokens and explicit type exports.
9
11
  */
10
12
  import * as React from 'react';
11
13
  import type { GroupProps, PanelProps, SeparatorProps } from 'react-resizable-panels';
@@ -1,11 +1,13 @@
1
1
  /**
2
- * [INPUT]: (Select*Props)
3
- * [OUTPUT]: (JSX.Element) - 选择器组件
4
- * [POS]: registry/basic/select - 注册表模板,复制到用户项目后可自由修改
2
+ * [WHO]: Public exports from this file (see implementation below).
3
+ * [FROM]: See the import block immediately after this header.
4
+ * [TO]: sparkdesign package consumers; output of CLI `add` when applicable.
5
+ * [HERE]: registry/basic/select.tsx — Spark Design source; keep aligned with the main library.
5
6
  *
6
7
  * [PROTOCOL]:
7
- * 1. 用户可自由修改此文件
8
- * 2. 更新时使用 npx sparkdesign diff select 查看差异
8
+ * 1. Keep this P3 header in sync when the public contract changes.
9
+ * 2. Update module AGENTS.md (P2) and root AGENTS.md (P1) when boundaries change.
10
+ * 3. Follow design tokens and explicit type exports.
9
11
  */
10
12
  import * as React from 'react';
11
13
  import * as SelectPrimitive from '@radix-ui/react-select';
@@ -1,11 +1,13 @@
1
1
  /**
2
- * [INPUT]: (SliderProps)
3
- * [OUTPUT]: (JSX.Element) - 滑块组件
4
- * [POS]: registry/basic/slider - 注册表模板,复制到用户项目后可自由修改
2
+ * [WHO]: Public exports from this file (see implementation below).
3
+ * [FROM]: See the import block immediately after this header.
4
+ * [TO]: sparkdesign package consumers; output of CLI `add` when applicable.
5
+ * [HERE]: registry/basic/slider.tsx — Spark Design source; keep aligned with the main library.
5
6
  *
6
7
  * [PROTOCOL]:
7
- * 1. 用户可自由修改此文件
8
- * 2. 更新时使用 npx sparkdesign diff slider 查看差异
8
+ * 1. Keep this P3 header in sync when the public contract changes.
9
+ * 2. Update module AGENTS.md (P2) and root AGENTS.md (P1) when boundaries change.
10
+ * 3. Follow design tokens and explicit type exports.
9
11
  */
10
12
  import * as React from 'react';
11
13
  import * as SliderPrimitive from '@radix-ui/react-slider';
@@ -1,11 +1,13 @@
1
1
  /**
2
- * [INPUT]: (ToasterProps) - sonner Toaster 配置,可选 dataStyle/dataTheme
3
- * [OUTPUT]: (JSX.Element) - Portal body Toast 容器,样式通过 design tokens
4
- * [POS]: registry/basic/sonner - Toaster 唯一来源;主库再导出并注入 useIcon、buttonVariants
2
+ * [WHO]: Public exports from this file (see implementation below).
3
+ * [FROM]: See the import block immediately after this header.
4
+ * [TO]: sparkdesign package consumers; output of CLI `add` when applicable.
5
+ * [HERE]: registry/basic/sonner.tsx — Spark Design source; keep aligned with the main library.
5
6
  *
6
7
  * [PROTOCOL]:
7
- * 1. 修改样式时需同步更新 defaultToastOptions 中的 CSS 变量
8
- * 2. 主库组件从 registry 导入,注入 data-style/data-theme 上下文
8
+ * 1. Keep this P3 header in sync when the public contract changes.
9
+ * 2. Update module AGENTS.md (P2) and root AGENTS.md (P1) when boundaries change.
10
+ * 3. Follow design tokens and explicit type exports.
9
11
  */
10
12
  import * as React from 'react';
11
13
  import type { ToasterProps as SonnerToasterProps } from 'sonner';
@@ -1,11 +1,13 @@
1
1
  /**
2
- * [INPUT]: (SwitchProps)
3
- * [OUTPUT]: (JSX.Element) - 开关组件(toggle only,无 segment 变体)
4
- * [POS]: registry/basic/switch - 注册表模板,复制到用户项目后可自由修改
2
+ * [WHO]: Public exports from this file (see implementation below).
3
+ * [FROM]: See the import block immediately after this header.
4
+ * [TO]: sparkdesign package consumers; output of CLI `add` when applicable.
5
+ * [HERE]: registry/basic/switch.tsx — Spark Design source; keep aligned with the main library.
5
6
  *
6
7
  * [PROTOCOL]:
7
- * 1. 用户可自由修改此文件
8
- * 2. 更新时使用 npx sparkdesign diff switch 查看差异
8
+ * 1. Keep this P3 header in sync when the public contract changes.
9
+ * 2. Update module AGENTS.md (P2) and root AGENTS.md (P1) when boundaries change.
10
+ * 3. Follow design tokens and explicit type exports.
9
11
  */
10
12
  import * as React from 'react';
11
13
  import * as SwitchPrimitives from '@radix-ui/react-switch';
@@ -1,11 +1,13 @@
1
1
  /**
2
- * [INPUT]: (Tabs*Props)
3
- * [OUTPUT]: (JSX.Element) - 标签页组件
4
- * [POS]: registry/basic/tabs - 注册表模板,复制到用户项目后可自由修改
2
+ * [WHO]: Public exports from this file (see implementation below).
3
+ * [FROM]: See the import block immediately after this header.
4
+ * [TO]: sparkdesign package consumers; output of CLI `add` when applicable.
5
+ * [HERE]: registry/basic/tabs.tsx — Spark Design source; keep aligned with the main library.
5
6
  *
6
7
  * [PROTOCOL]:
7
- * 1. 用户可自由修改此文件
8
- * 2. 更新时使用 npx sparkdesign diff tabs 查看差异
8
+ * 1. Keep this P3 header in sync when the public contract changes.
9
+ * 2. Update module AGENTS.md (P2) and root AGENTS.md (P1) when boundaries change.
10
+ * 3. Follow design tokens and explicit type exports.
9
11
  */
10
12
  import * as React from 'react';
11
13
  import * as TabsPrimitive from '@radix-ui/react-tabs';
@@ -1,11 +1,13 @@
1
1
  /**
2
- * [INPUT]: (TagProps)
3
- * [OUTPUT]: (JSX.Element) - 标签/徽章组件
4
- * [POS]: registry/basic/tag - 注册表模板,复制到用户项目后可自由修改
2
+ * [WHO]: Public exports from this file (see implementation below).
3
+ * [FROM]: See the import block immediately after this header.
4
+ * [TO]: sparkdesign package consumers; output of CLI `add` when applicable.
5
+ * [HERE]: registry/basic/tag.tsx — Spark Design source; keep aligned with the main library.
5
6
  *
6
7
  * [PROTOCOL]:
7
- * 1. 用户可自由修改此文件
8
- * 2. 更新时使用 npx sparkdesign diff tag 查看差异
8
+ * 1. Keep this P3 header in sync when the public contract changes.
9
+ * 2. Update module AGENTS.md (P2) and root AGENTS.md (P1) when boundaries change.
10
+ * 3. Follow design tokens and explicit type exports.
9
11
  */
10
12
  import * as React from 'react';
11
13
  import { type VariantProps } from 'class-variance-authority';
@@ -1,10 +1,12 @@
1
1
  /**
2
- * [INPUT]: (N/A) - 从 document.documentElement 读取
3
- * [OUTPUT]: (Record<string, string>) - 包含 data-theme / data-style 属性
4
- * [POS]: registry/basic/theme-from-document - 注册表工具函数
2
+ * [WHO]: Public exports from this file (see implementation below).
3
+ * [FROM]: See the import block immediately after this header.
4
+ * [TO]: sparkdesign package consumers; output of CLI `add` when applicable.
5
+ * [HERE]: registry/basic/theme-from-document.ts — Spark Design source; keep aligned with the main library.
5
6
  *
6
7
  * [PROTOCOL]:
7
- * 1. 用于 Portal 根节点继承主题,无 Context 依赖
8
- * 2. 更新时使用 npx sparkdesign diff theme-from-document 查看差异
8
+ * 1. Keep this P3 header in sync when the public contract changes.
9
+ * 2. Update module AGENTS.md (P2) and root AGENTS.md (P1) when boundaries change.
10
+ * 3. Follow design tokens and explicit type exports.
9
11
  */
10
12
  export declare function getThemeFromDocument(): Record<string, string>;