sparkdesign 0.4.7 → 0.4.8

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 (64) hide show
  1. package/cli/registry/basic/alert-dialog.tsx +3 -6
  2. package/cli/registry/basic/button.tsx +19 -6
  3. package/cli/registry/basic/card.tsx +20 -8
  4. package/cli/registry/basic/collapsible-card.tsx +2 -4
  5. package/cli/registry/basic/combobox.tsx +104 -46
  6. package/cli/registry/basic/context-menu.tsx +2 -3
  7. package/cli/registry/basic/date-picker.tsx +78 -7
  8. package/cli/registry/basic/dialog.tsx +3 -8
  9. package/cli/registry/basic/drawer.tsx +3 -5
  10. package/cli/registry/basic/dropdown-menu.tsx +2 -3
  11. package/cli/registry/basic/hover-card.tsx +2 -3
  12. package/cli/registry/basic/icon-button.tsx +18 -11
  13. package/cli/registry/basic/input-group.tsx +4 -4
  14. package/cli/registry/basic/input.tsx +29 -13
  15. package/cli/registry/basic/popover.tsx +2 -3
  16. package/cli/registry/basic/select.tsx +24 -4
  17. package/cli/registry/basic/spinner.tsx +20 -5
  18. package/cli/registry/basic/textarea.tsx +30 -12
  19. package/cli/registry/basic/tooltip.tsx +2 -1
  20. package/cli/registry/meta.json +97 -30
  21. package/dist/registry/basic/alert-dialog.d.ts +1 -1
  22. package/dist/registry/basic/avatar.d.ts +1 -1
  23. package/dist/registry/basic/button.d.ts +3 -1
  24. package/dist/registry/basic/card.d.ts +9 -4
  25. package/dist/registry/basic/combobox.d.ts +20 -9
  26. package/dist/registry/basic/date-picker.d.ts +18 -9
  27. package/dist/registry/basic/dialog.d.ts +1 -1
  28. package/dist/registry/basic/icon-button.d.ts +2 -1
  29. package/dist/registry/basic/input-group.d.ts +5 -3
  30. package/dist/registry/basic/input.d.ts +8 -3
  31. package/dist/registry/basic/item.d.ts +2 -2
  32. package/dist/registry/basic/resizable.d.ts +48 -48
  33. package/dist/registry/basic/select.d.ts +7 -2
  34. package/dist/registry/basic/spinner.d.ts +6 -2
  35. package/dist/registry/basic/tag.d.ts +1 -1
  36. package/dist/registry/basic/textarea.d.ts +9 -3
  37. package/dist/registry/basic/toggle.d.ts +1 -1
  38. package/dist/scale/computed.css +11 -0
  39. package/dist/scale/config.css +11 -0
  40. package/dist/scale/presets/compact.css +7 -0
  41. package/dist/scale/presets/dense.css +7 -0
  42. package/dist/scale/presets/sharp.css +7 -0
  43. package/dist/scale/presets/soft.css +7 -0
  44. package/dist/spark-design.cjs.js +35 -35
  45. package/dist/spark-design.es.js +5151 -3767
  46. package/dist/sparkdesign.css +1 -1
  47. package/dist/src/components/index.d.ts +1 -1
  48. package/dist/src/lib/index.d.ts +1 -1
  49. package/dist/src/lib/motion.d.ts +79 -0
  50. package/dist/theme-base.css +22 -0
  51. package/dist/themes/dark-mint.css +6 -0
  52. package/dist/themes/dark-parchment.css +6 -0
  53. package/dist/themes/light-parchment.css +6 -0
  54. package/dist/tokens/scale/computed.css +11 -0
  55. package/dist/tokens/scale/config.css +11 -0
  56. package/dist/tokens/scale/presets/compact.css +7 -0
  57. package/dist/tokens/scale/presets/dense.css +7 -0
  58. package/dist/tokens/scale/presets/sharp.css +7 -0
  59. package/dist/tokens/scale/presets/soft.css +7 -0
  60. package/dist/tokens/theme-base.css +22 -0
  61. package/dist/tokens/themes/dark-mint.css +6 -0
  62. package/dist/tokens/themes/dark-parchment.css +6 -0
  63. package/dist/tokens/themes/light-parchment.css +6 -0
  64. package/package.json +1 -1
@@ -189,5 +189,5 @@ export { IconsProvider, useIcons, useIcon } from '../icons/context';
189
189
  export type { IconKey, IconComponent, IconProps } from '../icons/types';
190
190
  export type { IconsContextValue } from '../icons/context';
191
191
  export { ThemeStyleProvider, useThemeStyle, type Appearance, type ThemePreset, type CustomTheme, type Theme, type StylePreset, type CustomStyle, type Style, type ThemeStyleContextValue, type ThemeStyleProviderProps, type ThemeStyleValue, } from '../lib/ThemeStyleContext';
192
- export { MOTION_DURATION, MOTION_EASE, MOTION_SPRING } from '../lib/motion';
192
+ export { MOTION_DURATION, MOTION_EASE, MOTION_SPRING, MOTION_FADE, MOTION_SLIDE_UP, MOTION_SCALE_IN, MOTION_EXPAND, getReducedMotion, getMotionMultiplier, } from '../lib/motion';
193
193
  export { FILE_TYPE_MAP, SETI_CHAR_MAP, SETI_COLOR_MAP, TYPE_TO_TOKEN_CLASS, getSetiIconType, getSetiIcon, getSetiIconColor, getFileIconColorClass, } from '../lib';
@@ -13,4 +13,4 @@ export { getFileIconByFilename } from './file-icon';
13
13
  export { FILE_TYPE_MAP, SETI_CHAR_MAP, SETI_COLOR_MAP, TYPE_TO_TOKEN_CLASS, getSetiIconType, getSetiIcon, getSetiIconColor, getFileIconColorClass, } from '../../registry/lib/file-icon-maps';
14
14
  export { default as i18n } from './i18n';
15
15
  export { ThemeStyleProvider, useThemeStyle, type Appearance, type ThemePreset, type CustomTheme, type Theme, type StylePreset, type CustomStyle, type Style, type ThemeStyleContextValue, type ThemeStyleProviderProps, type ThemeStyleValue, } from './ThemeStyleContext';
16
- export { MOTION_DURATION, MOTION_EASE, MOTION_SPRING } from './motion';
16
+ export { MOTION_DURATION, MOTION_EASE, MOTION_SPRING, MOTION_FADE, MOTION_SLIDE_UP, MOTION_SCALE_IN, MOTION_EXPAND, getReducedMotion, getMotionMultiplier, } from './motion';
@@ -20,3 +20,82 @@ export declare const MOTION_SPRING: {
20
20
  readonly mass: 0.7;
21
21
  };
22
22
  };
23
+ /** Overlay fade (dialog masks, backdrops) */
24
+ export declare const MOTION_FADE: {
25
+ readonly initial: {
26
+ readonly opacity: 0;
27
+ };
28
+ readonly animate: {
29
+ readonly opacity: 1;
30
+ };
31
+ readonly exit: {
32
+ readonly opacity: 0;
33
+ };
34
+ readonly transition: {
35
+ readonly duration: 0.15;
36
+ };
37
+ };
38
+ /** Content slide-up (dialogs, alert-dialogs) */
39
+ export declare const MOTION_SLIDE_UP: {
40
+ readonly initial: {
41
+ readonly opacity: 0;
42
+ readonly y: 8;
43
+ };
44
+ readonly animate: {
45
+ readonly opacity: 1;
46
+ readonly y: 0;
47
+ };
48
+ readonly exit: {
49
+ readonly opacity: 0;
50
+ readonly y: 8;
51
+ };
52
+ readonly transition: {
53
+ readonly duration: 0.2;
54
+ readonly ease: readonly [0.16, 1, 0.3, 1];
55
+ };
56
+ };
57
+ /** Scale-in (tooltips, popovers, dropdowns, context menus, hover cards) */
58
+ export declare const MOTION_SCALE_IN: {
59
+ readonly initial: {
60
+ readonly opacity: 0;
61
+ readonly scale: 0.96;
62
+ };
63
+ readonly animate: {
64
+ readonly opacity: 1;
65
+ readonly scale: 1;
66
+ };
67
+ readonly exit: {
68
+ readonly opacity: 0;
69
+ readonly scale: 0.96;
70
+ };
71
+ readonly transition: {
72
+ readonly duration: 0.15;
73
+ readonly ease: readonly [0.16, 1, 0.3, 1];
74
+ };
75
+ };
76
+ /** Expand (collapsible sections, accordion-like reveals) */
77
+ export declare const MOTION_EXPAND: {
78
+ readonly initial: {
79
+ readonly opacity: 0;
80
+ readonly height: 0;
81
+ };
82
+ readonly animate: {
83
+ readonly opacity: 1;
84
+ readonly height: "auto";
85
+ };
86
+ readonly exit: {
87
+ readonly opacity: 0;
88
+ readonly height: 0;
89
+ };
90
+ readonly transition: {
91
+ readonly duration: 0.2;
92
+ readonly ease: readonly [0.2, 0.8, 0.2, 1];
93
+ };
94
+ };
95
+ /** Check if user prefers reduced motion (SSR-safe) */
96
+ export declare function getReducedMotion(): boolean;
97
+ /**
98
+ * Read the --motion-multiplier CSS variable from the DOM (SSR-safe).
99
+ * Presets override this value to make motion faster or slower.
100
+ */
101
+ export declare function getMotionMultiplier(): number;
@@ -146,6 +146,14 @@
146
146
  --color-shadow-tertiary: var(--token-color-shadow-tertiary);
147
147
  --color-shadow-quaternary: var(--token-color-shadow-quaternary);
148
148
 
149
+ /* Elevation — 完整 box-shadow value token,Tailwind shadow-* 类自动消费 */
150
+ --shadow-xs: 0 1px 2px var(--color-shadow-primary);
151
+ --shadow-sm: 0 1px 3px var(--color-shadow-secondary), 0 1px 2px var(--color-shadow-primary);
152
+ --shadow-md: 0 4px 6px var(--color-shadow-secondary), 0 2px 4px var(--color-shadow-primary);
153
+ --shadow-lg: 0 10px 15px var(--color-shadow-tertiary), 0 4px 6px var(--color-shadow-secondary);
154
+ --shadow-xl: 0 20px 25px var(--color-shadow-tertiary), 0 8px 10px var(--color-shadow-secondary);
155
+ --shadow-2xl: 0 25px 50px var(--color-shadow-quaternary);
156
+
149
157
  /* Semantic */
150
158
  --color-link: var(--token-color-link);
151
159
  --color-error: var(--token-color-error);
@@ -254,6 +262,20 @@
254
262
  }
255
263
  }
256
264
 
265
+ /* ============================================
266
+ Reduced motion — 全局无障碍
267
+ ============================================ */
268
+ @media (prefers-reduced-motion: reduce) {
269
+ *,
270
+ *::before,
271
+ *::after {
272
+ animation-duration: 0.01ms !important;
273
+ animation-iteration-count: 1 !important;
274
+ transition-duration: 0.01ms !important;
275
+ scroll-behavior: auto !important;
276
+ }
277
+ }
278
+
257
279
  /* ============================================
258
280
  Seti 文件图标字体(与 QodeChatPanel 一致;需将 qoder-seti.woff 置于 public/ 或根路径)
259
281
  ============================================ */
@@ -51,6 +51,12 @@
51
51
  --token-color-bg-highlight: #d0d0d0;
52
52
  --token-color-bg-highlight-hover: #e0e0e0;
53
53
 
54
+ /* --- Shadow (暗色需要更强的阴影以在深色背景上可见) --- */
55
+ --token-color-shadow-primary: rgba(0, 0, 0, 0.08);
56
+ --token-color-shadow-secondary: rgba(0, 0, 0, 0.14);
57
+ --token-color-shadow-tertiary: rgba(0, 0, 0, 0.22);
58
+ --token-color-shadow-quaternary: rgba(0, 0, 0, 0.30);
59
+
54
60
  /* --- Semantic Colors --- */
55
61
  --token-color-link: #8EE5A1;
56
62
  --token-color-error: #FF4D4F;
@@ -51,6 +51,12 @@
51
51
  --token-color-bg-highlight: #C9C4B8;
52
52
  --token-color-bg-highlight-hover: #D4C9BC;
53
53
 
54
+ /* --- Shadow (暗色羊皮纸,需要更强的阴影) --- */
55
+ --token-color-shadow-primary: rgba(0, 0, 0, 0.08);
56
+ --token-color-shadow-secondary: rgba(0, 0, 0, 0.14);
57
+ --token-color-shadow-tertiary: rgba(0, 0, 0, 0.22);
58
+ --token-color-shadow-quaternary: rgba(0, 0, 0, 0.30);
59
+
54
60
  /* --- Semantic Colors --- */
55
61
  --token-color-link: #C4B8A8;
56
62
  --token-color-error: #FF6B6B;
@@ -50,6 +50,12 @@
50
50
  --token-color-bg-highlight: #202116;
51
51
  --token-color-bg-highlight-hover: #2D2A22;
52
52
 
53
+ /* --- Shadow (暖色基底,匹配羊皮纸调性) --- */
54
+ --token-color-shadow-primary: rgba(30, 25, 15, 0.025);
55
+ --token-color-shadow-secondary: rgba(30, 25, 15, 0.045);
56
+ --token-color-shadow-tertiary: rgba(30, 25, 15, 0.07);
57
+ --token-color-shadow-quaternary: rgba(30, 25, 15, 0.09);
58
+
53
59
  /* --- Semantic Colors --- */
54
60
  --token-color-link: #5B4A3A;
55
61
  --token-color-error: #FF4D4F;
@@ -100,4 +100,15 @@
100
100
  --motion-ease-standard: var(--config-motion-ease-standard);
101
101
  --motion-ease-emphasized: var(--config-motion-ease-emphasized);
102
102
  --motion-ease-out: var(--config-motion-ease-out);
103
+
104
+ /* ============================================
105
+ Motion Multiplier (从配置映射)
106
+ ============================================ */
107
+ --motion-multiplier: var(--config-motion-multiplier);
108
+
109
+ /* ============================================
110
+ Border Width (从配置映射)
111
+ ============================================ */
112
+ --border-width: var(--config-border-width);
113
+ --border-width-thick: var(--config-border-width-thick);
103
114
  }
@@ -102,6 +102,17 @@
102
102
  --config-motion-ease-emphasized: cubic-bezier(0.2, 0.8, 0.2, 1);
103
103
  --config-motion-ease-out: cubic-bezier(0, 0, 0.2, 1);
104
104
 
105
+ /* ============================================
106
+ Motion Multiplier (preset 可覆盖,<1 更快,>1 更慢)
107
+ ============================================ */
108
+ --config-motion-multiplier: 1;
109
+
110
+ /* ============================================
111
+ Border Width 配置
112
+ ============================================ */
113
+ --config-border-width: 1px;
114
+ --config-border-width-thick: 2px;
115
+
105
116
  /* ============================================
106
117
  Font Family 配置
107
118
  ============================================ */
@@ -38,4 +38,11 @@
38
38
  --font-size-7xl: 56px;
39
39
  --font-size-8xl: 64px;
40
40
  --font-size-9xl: 88px;
41
+
42
+ /* Motion (略快) */
43
+ --motion-multiplier: 0.9;
44
+
45
+ /* Border */
46
+ --border-width: 1px;
47
+ --border-width-thick: 1px;
41
48
  }
@@ -72,4 +72,11 @@
72
72
  --font-size-7xl: 44px;
73
73
  --font-size-8xl: 56px;
74
74
  --font-size-9xl: 72px;
75
+
76
+ /* Motion (快速) */
77
+ --motion-multiplier: 0.8;
78
+
79
+ /* Border (极细) */
80
+ --border-width: 1px;
81
+ --border-width-thick: 1px;
75
82
  }
@@ -49,4 +49,11 @@
49
49
  --font-size-7xl: 56px;
50
50
  --font-size-8xl: 64px;
51
51
  --font-size-9xl: 88px;
52
+
53
+ /* Motion (机械精准,最快) */
54
+ --motion-multiplier: 0.75;
55
+
56
+ /* Border (几何硬边) */
57
+ --border-width: 1px;
58
+ --border-width-thick: 2px;
52
59
  }
@@ -35,4 +35,11 @@
35
35
  --font-size-xl--line-height: 28px;
36
36
  --font-size-2xl: 22px;
37
37
  --font-size-2xl--line-height: 30px;
38
+
39
+ /* Motion (更舒缓) */
40
+ --motion-multiplier: 1.3;
41
+
42
+ /* Border (无边框面,靠阴影区分层级) */
43
+ --border-width: 0px;
44
+ --border-width-thick: 1px;
38
45
  }
@@ -146,6 +146,14 @@
146
146
  --color-shadow-tertiary: var(--token-color-shadow-tertiary);
147
147
  --color-shadow-quaternary: var(--token-color-shadow-quaternary);
148
148
 
149
+ /* Elevation — 完整 box-shadow value token,Tailwind shadow-* 类自动消费 */
150
+ --shadow-xs: 0 1px 2px var(--color-shadow-primary);
151
+ --shadow-sm: 0 1px 3px var(--color-shadow-secondary), 0 1px 2px var(--color-shadow-primary);
152
+ --shadow-md: 0 4px 6px var(--color-shadow-secondary), 0 2px 4px var(--color-shadow-primary);
153
+ --shadow-lg: 0 10px 15px var(--color-shadow-tertiary), 0 4px 6px var(--color-shadow-secondary);
154
+ --shadow-xl: 0 20px 25px var(--color-shadow-tertiary), 0 8px 10px var(--color-shadow-secondary);
155
+ --shadow-2xl: 0 25px 50px var(--color-shadow-quaternary);
156
+
149
157
  /* Semantic */
150
158
  --color-link: var(--token-color-link);
151
159
  --color-error: var(--token-color-error);
@@ -254,6 +262,20 @@
254
262
  }
255
263
  }
256
264
 
265
+ /* ============================================
266
+ Reduced motion — 全局无障碍
267
+ ============================================ */
268
+ @media (prefers-reduced-motion: reduce) {
269
+ *,
270
+ *::before,
271
+ *::after {
272
+ animation-duration: 0.01ms !important;
273
+ animation-iteration-count: 1 !important;
274
+ transition-duration: 0.01ms !important;
275
+ scroll-behavior: auto !important;
276
+ }
277
+ }
278
+
257
279
  /* ============================================
258
280
  Seti 文件图标字体(与 QodeChatPanel 一致;需将 qoder-seti.woff 置于 public/ 或根路径)
259
281
  ============================================ */
@@ -51,6 +51,12 @@
51
51
  --token-color-bg-highlight: #d0d0d0;
52
52
  --token-color-bg-highlight-hover: #e0e0e0;
53
53
 
54
+ /* --- Shadow (暗色需要更强的阴影以在深色背景上可见) --- */
55
+ --token-color-shadow-primary: rgba(0, 0, 0, 0.08);
56
+ --token-color-shadow-secondary: rgba(0, 0, 0, 0.14);
57
+ --token-color-shadow-tertiary: rgba(0, 0, 0, 0.22);
58
+ --token-color-shadow-quaternary: rgba(0, 0, 0, 0.30);
59
+
54
60
  /* --- Semantic Colors --- */
55
61
  --token-color-link: #8EE5A1;
56
62
  --token-color-error: #FF4D4F;
@@ -51,6 +51,12 @@
51
51
  --token-color-bg-highlight: #C9C4B8;
52
52
  --token-color-bg-highlight-hover: #D4C9BC;
53
53
 
54
+ /* --- Shadow (暗色羊皮纸,需要更强的阴影) --- */
55
+ --token-color-shadow-primary: rgba(0, 0, 0, 0.08);
56
+ --token-color-shadow-secondary: rgba(0, 0, 0, 0.14);
57
+ --token-color-shadow-tertiary: rgba(0, 0, 0, 0.22);
58
+ --token-color-shadow-quaternary: rgba(0, 0, 0, 0.30);
59
+
54
60
  /* --- Semantic Colors --- */
55
61
  --token-color-link: #C4B8A8;
56
62
  --token-color-error: #FF6B6B;
@@ -50,6 +50,12 @@
50
50
  --token-color-bg-highlight: #202116;
51
51
  --token-color-bg-highlight-hover: #2D2A22;
52
52
 
53
+ /* --- Shadow (暖色基底,匹配羊皮纸调性) --- */
54
+ --token-color-shadow-primary: rgba(30, 25, 15, 0.025);
55
+ --token-color-shadow-secondary: rgba(30, 25, 15, 0.045);
56
+ --token-color-shadow-tertiary: rgba(30, 25, 15, 0.07);
57
+ --token-color-shadow-quaternary: rgba(30, 25, 15, 0.09);
58
+
53
59
  /* --- Semantic Colors --- */
54
60
  --token-color-link: #5B4A3A;
55
61
  --token-color-error: #FF4D4F;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sparkdesign",
3
- "version": "0.4.7",
3
+ "version": "0.4.8",
4
4
  "type": "module",
5
5
  "description": "Modern React Design System with dual-dimension theme system",
6
6
  "keywords": [